From 4cf9a9867916a69f99c8b356f6d805bf25f76eb0 Mon Sep 17 00:00:00 2001 From: Michael Cristina Date: Fri, 12 Mar 2021 12:51:03 -0600 Subject: [PATCH 01/86] Release leader election lock on shutdown --- cluster-autoscaler/main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cluster-autoscaler/main.go b/cluster-autoscaler/main.go index 304bbedd6300..d2f0ab00a569 100644 --- a/cluster-autoscaler/main.go +++ b/cluster-autoscaler/main.go @@ -434,10 +434,11 @@ func main() { } leaderelection.RunOrDie(ctx.TODO(), leaderelection.LeaderElectionConfig{ - Lock: lock, - LeaseDuration: leaderElection.LeaseDuration.Duration, - RenewDeadline: leaderElection.RenewDeadline.Duration, - RetryPeriod: leaderElection.RetryPeriod.Duration, + Lock: lock, + LeaseDuration: leaderElection.LeaseDuration.Duration, + RenewDeadline: leaderElection.RenewDeadline.Duration, + RetryPeriod: leaderElection.RetryPeriod.Duration, + ReleaseOnCancel: true, Callbacks: leaderelection.LeaderCallbacks{ OnStartedLeading: func(_ ctx.Context) { // Since we are committing a suicide after losing From a24ea6c66b5cc61bbaf834899e4d6e58453f78db Mon Sep 17 00:00:00 2001 From: Michael McCune Date: Tue, 23 Mar 2021 17:00:52 -0400 Subject: [PATCH 02/86] add cluster cores and memory bytes count metrics This change adds 4 metrics that can be used to monitor the minimum and maximum limits for CPU and memory, as well as the current counts in cores and bytes, respectively. The four metrics added are: * `cluster_autoscaler_cpu_limits_cores` * `cluster_autoscaler_cluster_cpu_current_cores` * `cluster_autoscaler_memory_limits_bytes` * `cluster_autoscaler_cluster_memory_current_bytes` This change also adds the `max_cores_total` metric to the metrics proposal doc, as it was previously not recorded there. User story: As a cluster autoscaler user, I would like to monitor my cluster through metrics to determine when the cluster is nearing its limits for cores and memory usage. --- cluster-autoscaler/core/static_autoscaler.go | 23 ++++++++ cluster-autoscaler/main.go | 2 + cluster-autoscaler/metrics/metrics.go | 58 ++++++++++++++++++++ cluster-autoscaler/proposals/metrics.md | 5 ++ 4 files changed, 88 insertions(+) diff --git a/cluster-autoscaler/core/static_autoscaler.go b/cluster-autoscaler/core/static_autoscaler.go index 3dfced108c82..47afd916e000 100644 --- a/cluster-autoscaler/core/static_autoscaler.go +++ b/cluster-autoscaler/core/static_autoscaler.go @@ -246,6 +246,11 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) errors.AutoscalerError return nil } + // Update cluster resource usage metrics + coresTotal, memoryTotal := calculateCoresMemoryTotal(allNodes, currentTime) + metrics.UpdateClusterCPUCurrentCores(coresTotal) + metrics.UpdateClusterMemoryCurrentBytes(memoryTotal) + daemonsets, err := a.ListerRegistry.DaemonSetLister().List(labels.Everything()) if err != nil { klog.Errorf("Failed to get daemonset list: %v", err) @@ -800,3 +805,21 @@ func getUpcomingNodeInfos(registry *clusterstate.ClusterStateRegistry, nodeInfos } return upcomingNodes } + +func calculateCoresMemoryTotal(nodes []*apiv1.Node, timestamp time.Time) (int64, int64) { + // this function is essentially similar to the calculateScaleDownCoresMemoryTotal + // we want to check all nodes, aside from those deleting, to sum the cluster resource usage. + var coresTotal, memoryTotal int64 + for _, node := range nodes { + if isNodeBeingDeleted(node, timestamp) { + // Nodes being deleted do not count towards total cluster resources + continue + } + cores, memory := core_utils.GetNodeCoresAndMemory(node) + + coresTotal += cores + memoryTotal += memory + } + + return coresTotal, memoryTotal +} diff --git a/cluster-autoscaler/main.go b/cluster-autoscaler/main.go index 304bbedd6300..e7c8bc810c7b 100644 --- a/cluster-autoscaler/main.go +++ b/cluster-autoscaler/main.go @@ -330,6 +330,8 @@ func buildAutoscaler() (core.Autoscaler, error) { // These metrics should be published only once. metrics.UpdateNapEnabled(autoscalingOptions.NodeAutoprovisioningEnabled) metrics.UpdateMaxNodesCount(autoscalingOptions.MaxNodesTotal) + metrics.UpdateCPULimitsCores(autoscalingOptions.MinCoresTotal, autoscalingOptions.MaxCoresTotal) + metrics.UpdateMemoryLimitsBytes(autoscalingOptions.MinMemoryTotal, autoscalingOptions.MaxMemoryTotal) // Create autoscaler. return core.NewAutoscaler(opts) diff --git a/cluster-autoscaler/metrics/metrics.go b/cluster-autoscaler/metrics/metrics.go index e3b5ed22edbd..9580ee3344c0 100644 --- a/cluster-autoscaler/metrics/metrics.go +++ b/cluster-autoscaler/metrics/metrics.go @@ -138,6 +138,38 @@ var ( }, ) + cpuCurrentCores = k8smetrics.NewGauge( + &k8smetrics.GaugeOpts{ + Namespace: caNamespace, + Name: "cluster_cpu_current_cores", + Help: "Current number of cores in the cluster, minus deleting nodes.", + }, + ) + + cpuLimitsCores = k8smetrics.NewGaugeVec( + &k8smetrics.GaugeOpts{ + Namespace: caNamespace, + Name: "cpu_limits_cores", + Help: "Minimum and maximum number of cores in the cluster.", + }, []string{"direction"}, + ) + + memoryCurrentBytes = k8smetrics.NewGauge( + &k8smetrics.GaugeOpts{ + Namespace: caNamespace, + Name: "cluster_memory_current_bytes", + Help: "Current number of bytes of memory in the cluster, minus deleting nodes.", + }, + ) + + memoryLimitsBytes = k8smetrics.NewGaugeVec( + &k8smetrics.GaugeOpts{ + Namespace: caNamespace, + Name: "memory_limits_bytes", + Help: "Minimum and maximum number of bytes of memory in cluster.", + }, []string{"direction"}, + ) + /**** Metrics related to autoscaler execution ****/ lastActivity = k8smetrics.NewGaugeVec( &k8smetrics.GaugeOpts{ @@ -288,6 +320,10 @@ func RegisterAll() { legacyregistry.MustRegister(nodeGroupsCount) legacyregistry.MustRegister(unschedulablePodsCount) legacyregistry.MustRegister(maxNodesCount) + legacyregistry.MustRegister(cpuCurrentCores) + legacyregistry.MustRegister(cpuLimitsCores) + legacyregistry.MustRegister(memoryCurrentBytes) + legacyregistry.MustRegister(memoryLimitsBytes) legacyregistry.MustRegister(lastActivity) legacyregistry.MustRegister(functionDuration) legacyregistry.MustRegister(functionDurationSummary) @@ -364,6 +400,28 @@ func UpdateMaxNodesCount(nodesCount int) { maxNodesCount.Set(float64(nodesCount)) } +// UpdateClusterCPUCurrentCores records the number of cores in the cluster, minus deleting nodes +func UpdateClusterCPUCurrentCores(coresCount int64) { + cpuCurrentCores.Set(float64(coresCount)) +} + +// UpdateCPULimitsCores records the minimum and maximum number of cores in the cluster +func UpdateCPULimitsCores(minCoresCount int64, maxCoresCount int64) { + cpuLimitsCores.WithLabelValues("minimum").Set(float64(minCoresCount)) + cpuLimitsCores.WithLabelValues("maximum").Set(float64(maxCoresCount)) +} + +// UpdateClusterMemoryCurrentBytes records the number of bytes of memory in the cluster, minus deleting nodes +func UpdateClusterMemoryCurrentBytes(memoryCount int64) { + memoryCurrentBytes.Set(float64(memoryCount)) +} + +// UpdateMemoryLimitsBytes records the minimum and maximum bytes of memory in the cluster +func UpdateMemoryLimitsBytes(minMemoryCount int64, maxMemoryCount int64) { + memoryLimitsBytes.WithLabelValues("minimum").Set(float64(minMemoryCount)) + memoryLimitsBytes.WithLabelValues("maximum").Set(float64(maxMemoryCount)) +} + // RegisterError records any errors preventing Cluster Autoscaler from working. // No more than one error should be recorded per loop. func RegisterError(err errors.AutoscalerError) { diff --git a/cluster-autoscaler/proposals/metrics.md b/cluster-autoscaler/proposals/metrics.md index 6cb3b5ac0d06..d21eb1a2f642 100644 --- a/cluster-autoscaler/proposals/metrics.md +++ b/cluster-autoscaler/proposals/metrics.md @@ -27,6 +27,11 @@ All the metrics are prefixed with `cluster_autoscaler_`. | nodes_count | Gauge | `state`=<node-state> | Number of nodes in cluster. | | unschedulable_pods_count | Gauge | | Number of unschedulable ("Pending") pods in the cluster. | | node_groups_count | Gauge | `node_group_type`=<node-group-type> | Number of node groups managed by CA. | +| max_nodes_count | Gauge | | Maximum number of nodes in all node groups. | +| cluster_cpu_current_cores | Gauge | | | Current number of cores in the cluster, minus deleting nodes. | +| cpu_limits_cores | Gauge | `direction`=<`minimum` or `maximum`> | Minimum and maximum number of cores in the cluster. | +| cluster_memory_current_bytes | Gauge | | Current number of bytes of memory in the cluster, minus deleting nodes. | +| memory_limits_bytes | Gauge | `direction`=<`minimum` or `maximum`> | Minimum and maximum number of bytes of memory in cluster. | * `cluster_safe_to_autoscale` indicates whether cluster is healthy enough for autoscaling. CA stops all operations if significant number of nodes are unready (by default 33% as of CA 0.5.4). * `nodes_count` records the total number of nodes, labeled by node state. Possible From d103b70447c12fd53b9467d46e3fa47919d6f837 Mon Sep 17 00:00:00 2001 From: Thomas George Hartland Date: Wed, 7 Apr 2021 16:36:17 +0200 Subject: [PATCH 03/86] Enable magnum provider scale to zero Now supported by magnum. https://review.opendev.org/c/openstack/magnum/+/737580/ If using node group autodiscovery, older versions of magnum will still forbid scaling to zero or setting the minimum node count to zero. --- cluster-autoscaler/cloudprovider/magnum/magnum_util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/magnum/magnum_util.go b/cluster-autoscaler/cloudprovider/magnum/magnum_util.go index 7e4bfa3224f6..688154cfead6 100644 --- a/cluster-autoscaler/cloudprovider/magnum/magnum_util.go +++ b/cluster-autoscaler/cloudprovider/magnum/magnum_util.go @@ -24,7 +24,7 @@ import ( ) const ( - scaleToZeroSupported = false + scaleToZeroSupported = true ) // NodeRef stores the name, systemUUID and providerID of a node. From 71353a6dd47f88c0c231b94710ba2a3e2ede9414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Minh=20Qu=C3=A2n?= Date: Mon, 12 Apr 2021 14:06:28 +0700 Subject: [PATCH 04/86] Fix/dependencies --- .../cloudprovider/bizflycloud/README.md | 12 + .../bizflycloud/bizflycloud_cloud_provider.go | 202 +++ .../bizflycloud_cloud_provider_test.go | 155 ++ .../bizflycloud/bizflycloud_manager.go | 181 +++ .../bizflycloud/bizflycloud_manager_test.go | 122 ++ .../bizflycloud/bizflycloud_node_group.go | 267 ++++ .../bizflycloud_node_group_test.go | 445 ++++++ .../bizflycloud/gobizfly/.gitignore | 28 + .../bizflycloud/gobizfly/.goreleaser.yml | 31 + .../bizflycloud/gobizfly/COPYING | 674 +++++++++ .../bizflycloud/gobizfly/Dockerfile | 29 + .../bizflycloud/gobizfly/Makefile | 34 + .../bizflycloud/gobizfly/README.md | 47 + .../bizflycloud/gobizfly/account.go | 166 +++ .../bizflycloud/gobizfly/alert.go | 794 +++++++++++ .../bizflycloud/gobizfly/autoscaling.go | 1266 +++++++++++++++++ .../cloudprovider/bizflycloud/gobizfly/cdn.go | 235 +++ .../bizflycloud/gobizfly/client.go | 293 ++++ .../bizflycloud/gobizfly/common.go | 36 + .../gobizfly/container_registry.go | 219 +++ .../cloudprovider/bizflycloud/gobizfly/dns.go | 298 ++++ .../bizflycloud/gobizfly/firewall.go | 301 ++++ .../cloudprovider/bizflycloud/gobizfly/go.mod | 5 + .../cloudprovider/bizflycloud/gobizfly/go.sum | 11 + .../bizflycloud/gobizfly/kubernetes.go | 342 +++++ .../bizflycloud/gobizfly/loadbalancer.go | 887 ++++++++++++ .../bizflycloud/gobizfly/server.go | 688 +++++++++ .../bizflycloud/gobizfly/service.go | 79 + .../bizflycloud/gobizfly/snapshot.go | 148 ++ .../bizflycloud/gobizfly/ssh_key.go | 122 ++ .../bizflycloud/gobizfly/token.go | 106 ++ .../bizflycloud/gobizfly/volume.go | 295 ++++ .../cloudprovider/bizflycloud/gobizfly/vpc.go | 197 +++ .../manifest/cluster-autoscaler.yaml | 66 + .../bizflycloud/manifest/demo.yaml | 27 + .../bizflycloud/manifest/rbac.yaml | 116 ++ .../cloudprovider/builder/builder_all.go | 6 +- .../builder/builder_bizflycloud.go | 42 + .../cloudprovider/cloud_provider.go | 2 + hack/boilerplate/boilerplate.py | 1 + hack/verify-gofmt.sh | 1 + hack/verify-golint.sh | 1 + hack/verify-spelling.sh | 2 +- 43 files changed, 8977 insertions(+), 2 deletions(-) create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/README.md create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_cloud_provider.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_cloud_provider_test.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_manager.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_manager_test.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_node_group.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_node_group_test.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/.gitignore create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/.goreleaser.yml create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/COPYING create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/Dockerfile create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/Makefile create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/README.md create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/account.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/alert.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/autoscaling.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/cdn.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/client.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/common.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/container_registry.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/dns.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/firewall.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.mod create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.sum create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/kubernetes.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/loadbalancer.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/server.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/service.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/snapshot.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/ssh_key.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/token.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/volume.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/vpc.go create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/manifest/cluster-autoscaler.yaml create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/manifest/demo.yaml create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/manifest/rbac.yaml create mode 100644 cluster-autoscaler/cloudprovider/builder/builder_bizflycloud.go diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/README.md b/cluster-autoscaler/cloudprovider/bizflycloud/README.md new file mode 100644 index 000000000000..a80e8d93ff2c --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/README.md @@ -0,0 +1,12 @@ +# Cluster Autoscaler for Bizflycloud + +The cluster autoscaler for Bizflycloud scales worker nodes within any +specified Bizflycloud Kubernetes Engine cluster's worker pool. + +# Configuration + +Bizflycloud Kubernetes Engine (BKE) will authenticate with Bizflycloud providers using your application credentials automatics created by BKE. + +The scaling option about enable autoscaler, min-nodes, max-nodes will be configure though our dashboard + +**Note**: Do not install cluster-autoscaler deployment in manifest since it already install by BKE. diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_cloud_provider.go b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_cloud_provider.go new file mode 100644 index 000000000000..1a52f18295ef --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_cloud_provider.go @@ -0,0 +1,202 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package bizflycloud + +import ( + "fmt" + "io" + "os" + "strings" + + apiv1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" + "k8s.io/autoscaler/cluster-autoscaler/config" + "k8s.io/autoscaler/cluster-autoscaler/utils/errors" + klog "k8s.io/klog/v2" +) + +var _ cloudprovider.CloudProvider = (*bizflycloudCloudProvider)(nil) + +const ( + // GPULabel is the label added to nodes with GPU resource. + GPULabel = "bke.bizflycloud.vn/gpu-node" + + bizflyProviderIDPrefix = "bizflycloud://" +) + +// bizflycloudCloudProvider implements CloudProvider interface. +type bizflycloudCloudProvider struct { + manager *Manager + resourceLimiter *cloudprovider.ResourceLimiter +} + +func newBizflyCloudProvider(manager *Manager, rl *cloudprovider.ResourceLimiter) (*bizflycloudCloudProvider, error) { + if err := manager.Refresh(); err != nil { + return nil, err + } + return &bizflycloudCloudProvider{ + manager: manager, + resourceLimiter: rl, + }, nil +} + +// Name returns name of the cloud provider. +func (d *bizflycloudCloudProvider) Name() string { + return cloudprovider.BizflyCloudProviderName +} + +// NodeGroups returns all node groups configured for this cloud provider. +func (d *bizflycloudCloudProvider) NodeGroups() []cloudprovider.NodeGroup { + nodeGroups := make([]cloudprovider.NodeGroup, len(d.manager.nodeGroups)) + for i, ng := range d.manager.nodeGroups { + nodeGroups[i] = ng + } + return nodeGroups +} + +// NodeGroupForNode returns the node group for the given node, nil if the node +// should not be processed by cluster autoscaler, or non-nil error if such +// occurred. Must be implemented. +func (d *bizflycloudCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error) { + providerID := node.Spec.ProviderID + nodeID := toNodeID(providerID) + + klog.V(5).Infof("checking nodegroup for node ID: %q", nodeID) + + // NOTE(arslan): the number of node groups per cluster is usually very + // small. So even though this looks like quadratic runtime, it's OK to + // proceed with this. + for _, group := range d.manager.nodeGroups { + klog.V(5).Infof("iterating over node group %q", group.Id()) + nodes, err := group.Nodes() + if err != nil { + return nil, err + } + + for _, node := range nodes { + klog.V(6).Infof("checking node has: %q want: %q", node.Id, providerID) + // CA uses node.Spec.ProviderID when looking for (un)registered nodes, + // so we need to use it here too. + if node.Id != providerID { + continue + } + + return group, nil + } + } + + // there is no "ErrNotExist" error, so we have to return a nil error + return nil, nil +} + +// Pricing returns pricing model for this cloud provider or error if not +// available. Implementation optional. +func (d *bizflycloudCloudProvider) Pricing() (cloudprovider.PricingModel, errors.AutoscalerError) { + return nil, cloudprovider.ErrNotImplemented +} + +// GetAvailableMachineTypes get all machine types that can be requested from +// the cloud provider. Implementation optional. +func (d *bizflycloudCloudProvider) GetAvailableMachineTypes() ([]string, error) { + return []string{}, nil +} + +// NewNodeGroup builds a theoretical node group based on the node definition +// provided. The node group is not automatically created on the cloud provider +// side. The node group is not returned by NodeGroups() until it is created. +// Implementation optional. +func (d *bizflycloudCloudProvider) NewNodeGroup( + machineType string, + labels map[string]string, + systemLabels map[string]string, + taints []apiv1.Taint, + extraResources map[string]resource.Quantity, +) (cloudprovider.NodeGroup, error) { + return nil, cloudprovider.ErrNotImplemented +} + +// GetResourceLimiter returns struct containing limits (max, min) for +// resources (cores, memory etc.). +func (d *bizflycloudCloudProvider) GetResourceLimiter() (*cloudprovider.ResourceLimiter, error) { + return d.resourceLimiter, nil +} + +// GPULabel returns the label added to nodes with GPU resource. +func (d *bizflycloudCloudProvider) GPULabel() string { + return GPULabel +} + +// GetAvailableGPUTypes return all available GPU types cloud provider supports. +func (d *bizflycloudCloudProvider) GetAvailableGPUTypes() map[string]struct{} { + return nil +} + +// Cleanup cleans up open resources before the cloud provider is destroyed, +// i.e. go routines etc. +func (d *bizflycloudCloudProvider) Cleanup() error { + return nil +} + +// Refresh is called before every main loop and can be used to dynamically +// update cloud provider state. In particular the list of node groups returned +// by NodeGroups() can change as a result of CloudProvider.Refresh(). +func (d *bizflycloudCloudProvider) Refresh() error { + klog.V(4).Info("Refreshing node group cache") + return d.manager.Refresh() +} + +// BuildBizflyCloud builds the Bizflycloud cloud provider. +func BuildBizflyCloud( + opts config.AutoscalingOptions, + do cloudprovider.NodeGroupDiscoveryOptions, + rl *cloudprovider.ResourceLimiter, +) cloudprovider.CloudProvider { + var configFile io.ReadCloser + if opts.CloudConfig != "" { + var err error + configFile, err = os.Open(opts.CloudConfig) + if err != nil { + klog.Fatalf("Couldn't open cloud provider configuration %s: %#v", opts.CloudConfig, err) + } + defer configFile.Close() + } + manager, err := newManager(configFile) + + if err != nil { + klog.Fatalf("Failed to create Bizflycloud manager: %v", err) + } + + // the cloud provider automatically uses all node pools in Bizflycloud. + // This means we don't use the cloudprovider.NodeGroupDiscoveryOptions + provider, err := newBizflyCloudProvider(manager, rl) + if err != nil { + klog.Fatalf("Failed to create Blizflycloud provider: %v", err) + } + + return provider +} + +// toProviderID returns a provider ID from the given node ID. +func toProviderID(nodeID string) string { + return fmt.Sprintf("%s%s", bizflyProviderIDPrefix, nodeID) +} + +// toNodeID returns a node or physical ID from the given provider ID. +func toNodeID(providerID string) string { + return strings.TrimPrefix(providerID, bizflyProviderIDPrefix) +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_cloud_provider_test.go b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_cloud_provider_test.go new file mode 100644 index 000000000000..4d4d51995244 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_cloud_provider_test.go @@ -0,0 +1,155 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package bizflycloud + +import ( + "bytes" + "context" + "testing" + + "github.com/stretchr/testify/assert" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly" + + apiv1 "k8s.io/api/core/v1" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" +) + +func testCloudProvider(t *testing.T, client *bizflyClientMock) *bizflycloudCloudProvider { + cfg := `{"cluster_id": "123456", "token": "123123123", "url": "https://manage.bizflycloud.vn", "version": "test"}` + + manager, err := newManagerTest(bytes.NewBufferString(cfg)) + assert.NoError(t, err) + rl := &cloudprovider.ResourceLimiter{} + + // fill the test provider with some example + if client == nil { + client = &bizflyClientMock{} + ctx := context.Background() + + client.On("Get", ctx, manager.clusterID, nil).Return(&gobizfly.FullCluster{ + ExtendedCluster: gobizfly.ExtendedCluster{ + Cluster: gobizfly.Cluster{ + UID: "cluster-1", + Name: "test-cluster", + WorkerPoolsCount: 4, + }, + WorkerPools: []gobizfly.ExtendedWorkerPool{ + { + WorkerPool: gobizfly.WorkerPool{}, + UID: "pool-1", + }, + }, + }, + Stat: gobizfly.ClusterStat{}, + }, nil).Once() + + client.On("GetClusterWorkerPool", ctx, manager.clusterID, "pool-1", nil).Return(&gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + EnableAutoScaling: true, + }, + UID: "pool-1", + }, + Nodes: []gobizfly.PoolNode{ + { + ID: "1", + Name: "node-1", + }, + { + ID: "2", + Name: "node-2", + }, + }, + }, nil).Once() + } + + manager.client = client + provider, err := newBizflyCloudProvider(manager, rl) + assert.NoError(t, err) + return provider +} + +func TestNewBizflyCloudProvider(t *testing.T) { + t.Run("success", func(t *testing.T) { + _ = testCloudProvider(t, nil) + }) +} + +func TestBizflyCloudProvider_Name(t *testing.T) { + provider := testCloudProvider(t, nil) + + t.Run("success", func(t *testing.T) { + name := provider.Name() + assert.Equal(t, cloudprovider.BizflyCloudProviderName, name, "provider name doesn't match") + }) +} + +func TestBizflyCloudProvider_NodeGroups(t *testing.T) { + provider := testCloudProvider(t, nil) + + t.Run("zero groups", func(t *testing.T) { + provider.manager.nodeGroups = []*NodeGroup{} + nodes := provider.NodeGroups() + assert.Equal(t, len(nodes), 0, "number of nodes do not match") + }) +} + +func TestBizflyCloudProvider_NodeGroupForNode(t *testing.T) { + clusterID := "123456" + + t.Run("success", func(t *testing.T) { + client := &bizflyClientMock{} + ctx := context.Background() + + client.On("Get", ctx, clusterID, nil).Return( + &gobizfly.FullCluster{}, + nil, + ).Once() + + provider := testCloudProvider(t, client) + + node := &apiv1.Node{ + Spec: apiv1.NodeSpec{ + ProviderID: toProviderID("droplet-4"), + }, + } + nodeGroup, err := provider.NodeGroupForNode(node) + assert.NoError(t, err) + assert.Nil(t, nodeGroup) + }) + t.Run("node does not exist", func(t *testing.T) { + client := &bizflyClientMock{} + ctx := context.Background() + + client.On("Get", ctx, clusterID, nil).Return( + &gobizfly.FullCluster{}, + nil, + ).Once() + + provider := testCloudProvider(t, client) + + node := &apiv1.Node{ + Spec: apiv1.NodeSpec{ + ProviderID: toProviderID("xxxxx-7"), + }, + } + + nodeGroup, err := provider.NodeGroupForNode(node) + assert.NoError(t, err) + assert.Nil(t, nodeGroup) + }) +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_manager.go b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_manager.go new file mode 100644 index 000000000000..4604d71c91da --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_manager.go @@ -0,0 +1,181 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package bizflycloud + +import ( + "context" + "errors" + "fmt" + "io" + "os" + + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly" + klog "k8s.io/klog/v2" +) + +const ( + // ProviderName specifies the name for the Bizfly provider + ProviderName string = "bizflycloud" + defaultRegion string = "HN" + authPassword string = "password" + authAppCred string = "application_credential" + defaultApiUrl string = "https://manage.bizflycloud.vn" + + bizflyCloudAuthMethod string = "BIZFLYCLOUD_AUTH_METHOD" + bizflyCloudEmailEnvName string = "BIZFLYCLOUD_EMAIL" + bizflyCloudPasswordEnvName string = "BIZFLYCLOUD_PASSWORD" + bizflyCloudRegionEnvName string = "BIZFLYCLOUD_REGION" + bizflyCloudAppCredID string = "BIZFLYCLOUD_APP_CREDENTIAL_ID" + bizflyCloudAppCredSecret string = "BIZFLYCLOUD_APP_CREDENTIAL_SECRET" + bizflyCloudApiUrl string = "BIZFLYCLOUD_API_URL" + bizflyCloudTenantID string = "BIZFLYCLOUD_TENANT_ID" + clusterName string = "CLUSTER_NAME" +) + +type nodeGroupClient interface { + // Get lists all the cluster information in a Kubernetes cluster to lists all the worker pools . + Get(ctx context.Context, id string) (*gobizfly.FullCluster, error) + + // GetClusterWorkerPool get the details of an existing worker pool. + GetClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string) (*gobizfly.WorkerPoolWithNodes, error) + + // UpdateClusterWorkerPool updates the details of an existing worker pool. + UpdateClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string, uwp *gobizfly.UpdateWorkerPoolRequest) error + + // DeleteClusterWorkerPoolNode deletes a specific node in a worker pool. + DeleteClusterWorkerPoolNode(ctx context.Context, clusterUID string, PoolID string, NodeID string) error +} + +// Manager handles Bizflycloud communication and data caching of +// node groups (worker pools in BKE) +type Manager struct { + client nodeGroupClient + clusterID string + nodeGroups []*NodeGroup +} + +// Config is the configuration of the Bizflycloud cloud provider (just for test) +type Config struct { + ClusterID string `json:"cluster_id"` + Token string `json:"token"` + URL string `json:"url"` +} + +func newManager(configReader io.Reader) (*Manager, error) { + //newManager will authenticate directly with BKE to build manager + authMethod := os.Getenv(bizflyCloudAuthMethod) + username := os.Getenv(bizflyCloudEmailEnvName) + password := os.Getenv(bizflyCloudPasswordEnvName) + region := os.Getenv(bizflyCloudRegionEnvName) + appCredId := os.Getenv(bizflyCloudAppCredID) + appCredSecret := os.Getenv(bizflyCloudAppCredSecret) + apiUrl := os.Getenv(bizflyCloudApiUrl) + tenantId := os.Getenv(bizflyCloudTenantID) + clusterID := os.Getenv(clusterName) + + switch authMethod { + case authPassword: + { + if username == "" { + return nil, errors.New("you have to provide username variable") + } + if password == "" { + return nil, errors.New("you have to provide password variable") + } + } + case authAppCred: + { + if appCredId == "" { + return nil, errors.New("you have to provide application credential ID") + } + if appCredSecret == "" { + return nil, errors.New("you have to provide application credential secret") + } + } + } + + if region == "" { + region = defaultRegion + } + + if apiUrl == "" { + apiUrl = defaultApiUrl + } + + bizflyClient, err := gobizfly.NewClient(gobizfly.WithTenantName(username), gobizfly.WithAPIUrl(apiUrl), gobizfly.WithTenantID(tenantId), gobizfly.WithRegionName(region)) + if err != nil { + return nil, fmt.Errorf("couldn't initialize Bizflycloud client: %s", err) + } + + token, err := bizflyClient.Token.Create( + context.Background(), + &gobizfly.TokenCreateRequest{ + AuthMethod: authMethod, + Username: username, + Password: password, + AppCredID: appCredId, + AppCredSecret: appCredSecret}) + + if err != nil { + return nil, fmt.Errorf("cannot create token: %w", err) + } + + bizflyClient.SetKeystoneToken(token.KeystoneToken) + m := &Manager{ + client: bizflyClient.KubernetesEngine, + clusterID: clusterID, + nodeGroups: make([]*NodeGroup, 0), + } + return m, nil +} + +// Refresh refreshes the cache holding the nodegroups. This is called by the CA +// based on the `--scan-interval`. By default it's 10 seconds. +func (m *Manager) Refresh() error { + ctx := context.Background() + nodePools, err := m.client.Get(ctx, m.clusterID) + if err != nil { + return err + } + var group []*NodeGroup + for _, nodePool := range nodePools.WorkerPools { + if !nodePool.EnableAutoScaling { + continue + } + poolNode, err := m.client.GetClusterWorkerPool(ctx, m.clusterID, nodePool.UID) + if err != nil { + return err + } + klog.V(4).Infof("adding worker pool: %q name: %s min: %d max: %d desire: %d", + nodePool.UID, nodePool.Name, nodePool.MinSize, nodePool.MaxSize, nodePool.DesiredSize) + + group = append(group, &NodeGroup{ + id: nodePool.UID, + clusterID: m.clusterID, + client: m.client, + nodePool: poolNode, + minSize: nodePool.MinSize, + maxSize: nodePool.MaxSize, + }) + } + if len(group) == 0 { + klog.V(4).Info("cluster-autoscaler is disabled. no worker pools are configured") + } + + m.nodeGroups = group + return nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_manager_test.go b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_manager_test.go new file mode 100644 index 000000000000..1b6082fc7299 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_manager_test.go @@ -0,0 +1,122 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package bizflycloud + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "testing" + + "github.com/stretchr/testify/assert" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly" +) + +// Due to newManager require authenticate with our server, we will use newManagerTest for simple test case +func newManagerTest(configReader io.Reader) (*Manager, error) { + cfg := &Config{} + if configReader != nil { + body, err := ioutil.ReadAll(configReader) + if err != nil { + return nil, err + } + err = json.Unmarshal(body, cfg) + if err != nil { + return nil, err + } + } + + if cfg.Token == "" { + return nil, errors.New("access token is not provided") + } + if cfg.ClusterID == "" { + return nil, errors.New("cluster ID is not provided") + } + + bizflyClient, err := gobizfly.NewClient() + if err != nil { + return nil, fmt.Errorf("couldn't initialize Bizflycloud client: %s", err) + } + + m := &Manager{ + client: bizflyClient.KubernetesEngine, + clusterID: cfg.ClusterID, + nodeGroups: make([]*NodeGroup, 0), + } + + return m, nil +} + +func TestNewManager(t *testing.T) { + t.Run("success", func(t *testing.T) { + cfg := `{"cluster_id": "123456", "token": "123123123", "url": "https://manage.bizflycloud.vn", "version": "test"}` + manager, err := newManagerTest(bytes.NewBufferString(cfg)) + assert.NoError(t, err) + assert.Equal(t, manager.clusterID, "123456", "cluster ID does not match") + }) +} + +func TestBizflyCloudManager_Refresh(t *testing.T) { + t.Run("success", func(t *testing.T) { + client := &bizflyClientMock{} + cfg := `{"cluster_id": "123456", "token": "123123123", "url": "https://manage.bizflycloud.vn", "version": "test"}` + manager, err := newManagerTest(bytes.NewBufferString(cfg)) + assert.NoError(t, err) + ctx := context.Background() + + client.On("Get", ctx, manager.clusterID, nil).Return(&gobizfly.FullCluster{ + ExtendedCluster: gobizfly.ExtendedCluster{ + Cluster: gobizfly.Cluster{ + UID: "1", + Name: "test-1", + VPCNetworkID: "vpc-1", + WorkerPoolsCount: 1, + }, + WorkerPools: []gobizfly.ExtendedWorkerPool{}, + }, + Stat: gobizfly.ClusterStat{}, + }, nil).Once() + + manager.client = client + assert.Equal(t, len(manager.nodeGroups), 0, "number of nodes do not match") + }) + +} + +func TestBizflyCloudManager_RefreshWithNodeSpec(t *testing.T) { + t.Run("success", func(t *testing.T) { + cfg := `{"cluster_id": "123456", "token": "123123123", "url": "https://manage.bizflycloud.vn", "version": "test"}` + + manager, err := newManagerTest(bytes.NewBufferString(cfg)) + assert.NoError(t, err) + + client := &bizflyClientMock{} + ctx := context.Background() + + client.On("Get", ctx, manager.clusterID, nil).Return(&gobizfly.FullCluster{}, + nil, + ).Once() + manager.client = client + err = manager.Refresh() + assert.NoError(t, err) + assert.Equal(t, len(manager.nodeGroups), 0, "number of node groups do not match") + }) +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_node_group.go b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_node_group.go new file mode 100644 index 000000000000..363d634e9e81 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_node_group.go @@ -0,0 +1,267 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package bizflycloud + +import ( + "context" + "errors" + "fmt" + + apiv1 "k8s.io/api/core/v1" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly" + + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" + "k8s.io/autoscaler/cluster-autoscaler/config" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" +) + +const ( + bkeLabelNamespace = "bke.bizflycloud.vn" + nodeIDLabel = bkeLabelNamespace + "/node-id" +) + +var ( + // ErrNodePoolNotExist is return if no node pool exists for a given cluster ID + ErrNodePoolNotExist = errors.New("node pool does not exist") +) + +// NodeGroup implements cloudprovider.NodeGroup interface. NodeGroup contains +// configuration info and functions to control a set of nodes that have the +// same capacity and set of labels. +type NodeGroup struct { + id string + clusterID string + client nodeGroupClient + nodePool *gobizfly.WorkerPoolWithNodes + minSize int + maxSize int +} + +// MaxSize returns maximum size of the node group. +func (n *NodeGroup) MaxSize() int { + return n.maxSize +} + +// MinSize returns minimum size of the node group. +func (n *NodeGroup) MinSize() int { + return n.minSize +} + +// TargetSize returns the current target size of the node group. It is possible +// that the number of nodes in Kubernetes is different at the moment but should +// be equal to Size() once everything stabilizes (new nodes finish startup and +// registration or removed nodes are deleted completely). Implementation +// required. +func (n *NodeGroup) TargetSize() (int, error) { + return n.nodePool.DesiredSize, nil +} + +// IncreaseSize increases the size of the node group. To delete a node you need +// to explicitly name it and use DeleteNode. This function should wait until +// node group size is updated. Implementation required. +func (n *NodeGroup) IncreaseSize(delta int) error { + if delta <= 0 { + return fmt.Errorf("delta must be positive, have: %d", delta) + } + + targetSize := n.nodePool.DesiredSize + delta + + if targetSize > n.MaxSize() { + return fmt.Errorf("size increase is too large. current: %d desired: %d max: %d", + n.nodePool.DesiredSize, targetSize, n.MaxSize()) + } + + req := &gobizfly.UpdateWorkerPoolRequest{ + DesiredSize: targetSize, + } + + ctx := context.Background() + err := n.client.UpdateClusterWorkerPool(ctx, n.clusterID, n.id, req) + if err != nil { + return err + } + + // update internal cache + n.nodePool.DesiredSize = targetSize + return nil +} + +// DeleteNodes deletes nodes from this node group (and also increasing the size +// of the node group with that). Error is returned either on failure or if the +// given node doesn't belong to this node group. This function should wait +// until node group size is updated. Implementation required. +func (n *NodeGroup) DeleteNodes(nodes []*apiv1.Node) error { + ctx := context.Background() + for _, node := range nodes { + nodeID, ok := node.Labels[nodeIDLabel] + if !ok { + // CA creates fake node objects to represent upcoming VMs that + // haven't registered as nodes yet. We cannot delete the node at + // this point. + return fmt.Errorf("cannot delete node %q with provider ID %q on node pool %q: node ID label %q is missing", node.Name, node.Spec.ProviderID, n.id, nodeIDLabel) + } + err := n.client.DeleteClusterWorkerPoolNode(ctx, n.clusterID, n.id, nodeID) + if err != nil { + return fmt.Errorf("deleting node failed for cluster: %q node pool: %q node: %q: %s", + n.clusterID, n.id, nodeID, err) + } + + // decrement the count by one after a successful delete + n.nodePool.DesiredSize-- + } + + return nil +} + +// DecreaseTargetSize decreases the target size of the node group. This function +// doesn't permit to delete any existing node and can be used only to reduce the +// request for new nodes that have not been yet fulfilled. Delta should be negative. +// It is assumed that cloud provider will not delete the existing nodes when there +// is an option to just decrease the target. Implementation required. +func (n *NodeGroup) DecreaseTargetSize(delta int) error { + if delta >= 0 { + return fmt.Errorf("delta must be negative, have: %d", delta) + } + + targetSize := n.nodePool.DesiredSize + delta + if targetSize < n.MinSize() { + return fmt.Errorf("size decrease is too small. current: %d desired: %d min: %d", + n.nodePool.DesiredSize, targetSize, n.MinSize()) + } + + req := &gobizfly.UpdateWorkerPoolRequest{ + DesiredSize: targetSize, + } + + ctx := context.Background() + err := n.client.UpdateClusterWorkerPool(ctx, n.clusterID, n.id, req) + if err != nil { + return err + } + + // update internal cache + n.nodePool.DesiredSize = targetSize + return nil +} + +// Id returns an unique identifier of the node group. +func (n *NodeGroup) Id() string { + return n.id +} + +// Debug returns a string containing all information regarding this node group. +func (n *NodeGroup) Debug() string { + return fmt.Sprintf("cluster ID: %s (min:%d max:%d)", n.Id(), n.MinSize(), n.MaxSize()) +} + +// Nodes returns a list of all nodes that belong to this node group. It is +// required that Instance objects returned by this method have Id field set. +// Other fields are optional. +func (n *NodeGroup) Nodes() ([]cloudprovider.Instance, error) { + if n.nodePool == nil { + return nil, errors.New("node pool instance is not created") + } + return toInstances(n.nodePool.Nodes), nil +} + +// TemplateNodeInfo returns a schedulerframework.NodeInfo structure of an empty +// (as if just started) node. This will be used in scale-up simulations to +// predict what would a new node look like if a node group was expanded. The +// returned NodeInfo is expected to have a fully populated Node object, with +// all of the labels, capacity and allocatable information as well as all pods +// that are started on the node by default, using manifest (most likely only +// kube-proxy). Implementation optional. +func (n *NodeGroup) TemplateNodeInfo() (*schedulerframework.NodeInfo, error) { + return nil, cloudprovider.ErrNotImplemented +} + +// Exist checks if the node group really exists on the cloud provider side. +// Allows to tell the theoretical node group from the real one. Implementation +// required. +func (n *NodeGroup) Exist() bool { + return n.nodePool != nil +} + +// Create creates the node group on the cloud provider side. Implementation +// optional. +func (n *NodeGroup) Create() (cloudprovider.NodeGroup, error) { + return nil, cloudprovider.ErrNotImplemented +} + +// Delete deletes the node group on the cloud provider side. This will be +// executed only for autoprovisioned node groups, once their size drops to 0. +// Implementation optional. +func (n *NodeGroup) Delete() error { + return cloudprovider.ErrNotImplemented +} + +// Autoprovisioned returns true if the node group is autoprovisioned. An +// autoprovisioned group was created by CA and can be deleted when scaled to 0. +func (n *NodeGroup) Autoprovisioned() bool { + return false +} + +// GetOptions returns NodeGroupAutoscalingOptions that should be used for this particular +// NodeGroup. Returning a nil will result in using default options. +func (n *NodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) { + return nil, cloudprovider.ErrNotImplemented +} + +// toInstance converts the given *gobizfly.GetClusterWorkerPool to a +// cloudprovider.Instances +func toInstances(nodes []gobizfly.PoolNode) []cloudprovider.Instance { + instances := make([]cloudprovider.Instance, 0, len(nodes)) + for _, nd := range nodes { + instances = append(instances, toInstance(nd)) + } + return instances +} + +// toInstance converts the given *gobizfly.GetClusterWorkerPool to a +// cloudprovider.Instance +func toInstance(node gobizfly.PoolNode) cloudprovider.Instance { + return cloudprovider.Instance{ + Id: toProviderID(node.PhysicalID), + Status: toInstanceStatus(node), + } +} + +// toInstance converts the given *gobizfly.GetClusterWorkerPool to a +// cloudprovider.InstanceStatus +func toInstanceStatus(nodeState gobizfly.PoolNode) *cloudprovider.InstanceStatus { + if nodeState.ID == "" { + return nil + } + + st := &cloudprovider.InstanceStatus{} + switch nodeState.Status { + case "provisioning": + st.State = cloudprovider.InstanceCreating + case "running": + st.State = cloudprovider.InstanceRunning + case "draining", "deleting": + st.State = cloudprovider.InstanceDeleting + default: + st.ErrorInfo = &cloudprovider.InstanceErrorInfo{ + ErrorClass: cloudprovider.OtherErrorClass, + ErrorCode: "no-code-bizflycloud", + ErrorMessage: nodeState.StatusReason, + } + } + + return st +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_node_group_test.go b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_node_group_test.go new file mode 100644 index 000000000000..170fd49d3a30 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/bizflycloud_node_group_test.go @@ -0,0 +1,445 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package bizflycloud + +import ( + "context" + "errors" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + apiv1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly" +) + +func TestNodeGroup_TargetSize(t *testing.T) { + t.Run("success", func(t *testing.T) { + numberOfNodes := 3 + + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + }, + }, + }) + + size, err := ng.TargetSize() + assert.NoError(t, err) + assert.Equal(t, numberOfNodes, size, "target size is not correct") + }) +} + +func TestNodeGroup_IncreaseSize(t *testing.T) { + ctx := context.Background() + + t.Run("success", func(t *testing.T) { + numberOfNodes := 3 + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + MaxSize: 10, + }, + }, + }) + + delta := 2 + + newCount := numberOfNodes + delta + client.On("UpdateClusterWorkerPool", ctx, ng.clusterID, ng.id, &gobizfly.UpdateWorkerPoolRequest{ + DesiredSize: newCount, + }, + nil).Return(nil).Once() + + err := ng.IncreaseSize(delta) + assert.NoError(t, err) + }) + + t.Run("successful increase to maximum", func(t *testing.T) { + numberOfNodes := 2 + maxNodes := 3 + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + EnableAutoScaling: true, + MinSize: 1, + MaxSize: maxNodes, + }, + }, + }) + + delta := 1 + newCount := numberOfNodes + delta + client.On("UpdateClusterWorkerPool", ctx, ng.clusterID, ng.id, &gobizfly.UpdateWorkerPoolRequest{ + DesiredSize: newCount, + }, nil).Return(nil).Once() + + err := ng.IncreaseSize(delta) + assert.NoError(t, err) + }) + + t.Run("negative increase", func(t *testing.T) { + numberOfNodes := 3 + delta := -1 + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + }, + }, + }) + err := ng.IncreaseSize(delta) + + exp := fmt.Errorf("delta must be positive, have: %d", delta) + assert.EqualError(t, err, exp.Error(), "size increase must be positive") + }) + + t.Run("zero increase", func(t *testing.T) { + numberOfNodes := 3 + delta := 0 + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + }, + }, + }) + + exp := fmt.Errorf("delta must be positive, have: %d", delta) + + err := ng.IncreaseSize(delta) + assert.EqualError(t, err, exp.Error(), "size increase must be positive") + }) + + t.Run("large increase above maximum", func(t *testing.T) { + numberOfNodes := 195 + delta := 10 + + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + }, + }, + }) + + exp := fmt.Errorf("size increase is too large. current: %d desired: %d max: %d", + numberOfNodes, numberOfNodes+delta, ng.MaxSize()) + + err := ng.IncreaseSize(delta) + assert.EqualError(t, err, exp.Error(), "size increase is too large") + }) +} + +func TestNodeGroup_DecreaseTargetSize(t *testing.T) { + ctx := context.Background() + + t.Run("success", func(t *testing.T) { + numberOfNodes := 5 + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + }, + }, + }) + + delta := -2 + + newCount := numberOfNodes + delta + client.On("UpdateClusterWorkerPool", ctx, ng.clusterID, ng.id, &gobizfly.UpdateWorkerPoolRequest{ + DesiredSize: newCount, + }, nil, + ).Return(nil).Once() + + err := ng.DecreaseTargetSize(delta) + assert.NoError(t, err) + }) + + t.Run("successful decrease to minimum", func(t *testing.T) { + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: 2, + EnableAutoScaling: true, + MinSize: 1, + MaxSize: 5, + }, + }, + }) + + delta := -1 + newCount := ng.nodePool.DesiredSize + delta + client.On("UpdateClusterWorkerPool", ctx, ng.clusterID, ng.id, &gobizfly.UpdateWorkerPoolRequest{ + DesiredSize: newCount, + }, nil, + ).Return(nil).Once() + + err := ng.DecreaseTargetSize(delta) + assert.NoError(t, err) + }) + + t.Run("positive decrease", func(t *testing.T) { + numberOfNodes := 5 + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + }, + }, + }) + + delta := 1 + err := ng.DecreaseTargetSize(delta) + + exp := fmt.Errorf("delta must be negative, have: %d", delta) + assert.EqualError(t, err, exp.Error(), "size decrease must be negative") + }) + + t.Run("zero decrease", func(t *testing.T) { + numberOfNodes := 5 + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + }, + }, + }) + + delta := 0 + exp := fmt.Errorf("delta must be negative, have: %d", delta) + + err := ng.DecreaseTargetSize(delta) + assert.EqualError(t, err, exp.Error(), "size decrease must be negative") + }) + + t.Run("small decrease below minimum", func(t *testing.T) { + delta := -2 + numberOfNodes := 3 + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: numberOfNodes, + MinSize: 2, + MaxSize: 5, + }, + }, + }) + + exp := fmt.Errorf("size decrease is too small. current: %d desired: %d min: %d", + numberOfNodes, numberOfNodes+delta, ng.MinSize()) + err := ng.DecreaseTargetSize(delta) + assert.EqualError(t, err, exp.Error(), "size decrease is too small") + }) +} + +func TestNodeGroup_DeleteNodes(t *testing.T) { + ctx := context.Background() + + t.Run("success", func(t *testing.T) { + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: 3, + }, + }, + }) + + nodes := []*apiv1.Node{ + {ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{nodeIDLabel: "1"}}}, + {ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{nodeIDLabel: "2"}}}, + {ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{nodeIDLabel: "3"}}}, + } + + // this should be called three times (the number of nodes) + client.On("DeleteClusterWorkerPoolNode", ctx, ng.clusterID, ng.id, "1", nil).Return(nil).Once() + client.On("DeleteClusterWorkerPoolNode", ctx, ng.clusterID, ng.id, "2", nil).Return(nil).Once() + client.On("DeleteClusterWorkerPoolNode", ctx, ng.clusterID, ng.id, "3", nil).Return(nil).Once() + + err := ng.DeleteNodes(nodes) + assert.NoError(t, err) + }) + + t.Run("client deleting node fails", func(t *testing.T) { + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: 3, + }, + }, + }) + + nodes := []*apiv1.Node{ + {ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{nodeIDLabel: "1"}}}, + {ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{nodeIDLabel: "2"}}}, + {ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{nodeIDLabel: "3"}}}, + } + + // client is called twice, first run is successfully but the second one + // fails with a random error. In this case DeleteNodes() should return + // immediately. + client.On("DeleteClusterWorkerPoolNode", ctx, ng.clusterID, ng.id, "1", nil).Return(nil).Once() + client.On("DeleteClusterWorkerPoolNode", ctx, ng.clusterID, ng.id, "2", nil).Return(errors.New("random error")).Once() + + err := ng.DeleteNodes(nodes) + assert.Error(t, err) + }) +} + +func TestNodeGroup_Nodes(t *testing.T) { + t.Run("success", func(t *testing.T) { + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: 2, + }, + }, + Nodes: []gobizfly.PoolNode{ + { + PhysicalID: "xxxxxxxx1", + }, + { + PhysicalID: "xxxxxxxx2", + }, + }, + }) + + exp := []cloudprovider.Instance{ + { + Id: "bizflycloud://xxxxxxxx1", + }, + { + Id: "bizflycloud://xxxxxxxx2", + }, + } + + nodes, err := ng.Nodes() + assert.NoError(t, err) + assert.Equal(t, exp, nodes, "nodes do not match") + }) + + t.Run("failure (nil node pool)", func(t *testing.T) { + client := &bizflyClientMock{} + ng := testNodeGroup(client, nil) + + _, err := ng.Nodes() + assert.Error(t, err, "Nodes() should return an error") + }) +} + +func TestNodeGroup_Debug(t *testing.T) { + t.Run("success", func(t *testing.T) { + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: 3, + MinSize: 1, + MaxSize: 200, + }, + }, + }) + + d := ng.Debug() + exp := "cluster ID: 1 (min:1 max:200)" + assert.Equal(t, exp, d, "debug string do not match") + }) +} + +func TestNodeGroup_Exist(t *testing.T) { + t.Run("success", func(t *testing.T) { + client := &bizflyClientMock{} + ng := testNodeGroup(client, &gobizfly.WorkerPoolWithNodes{ + ExtendedWorkerPool: gobizfly.ExtendedWorkerPool{ + WorkerPool: gobizfly.WorkerPool{ + DesiredSize: 3, + }, + }, + }) + + exist := ng.Exist() + assert.Equal(t, true, exist, "node pool should exist") + }) + + t.Run("failure", func(t *testing.T) { + client := &bizflyClientMock{} + ng := testNodeGroup(client, nil) + + exist := ng.Exist() + assert.Equal(t, false, exist, "node pool should not exist") + }) +} + +func testNodeGroup(client *bizflyClientMock, np *gobizfly.WorkerPoolWithNodes) *NodeGroup { + var minNodes, maxNodes int + if np != nil { + minNodes = np.MinSize + maxNodes = np.MaxSize + } + return &NodeGroup{ + id: "1", + clusterID: "1", + client: client, + nodePool: np, + minSize: minNodes, + maxSize: maxNodes, + } +} + +type bizflyClientMock struct { + mock.Mock +} + +func (m *bizflyClientMock) Get(ctx context.Context, id string) (*gobizfly.FullCluster, error) { + args := m.Called(ctx, id, nil) + return args.Get(0).(*gobizfly.FullCluster), args.Error(1) +} + +func (m *bizflyClientMock) GetClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string) (*gobizfly.WorkerPoolWithNodes, error) { + args := m.Called(ctx, clusterUID, PoolID) + return args.Get(0).(*gobizfly.WorkerPoolWithNodes), args.Error(1) +} + +func (m *bizflyClientMock) UpdateClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string, uwp *gobizfly.UpdateWorkerPoolRequest) error { + args := m.Called(ctx, clusterUID, PoolID, uwp, nil) + return args.Error(0) +} + +func (m *bizflyClientMock) DeleteClusterWorkerPoolNode(ctx context.Context, clusterUID string, PoolID string, NodeID string) error { + args := m.Called(ctx, clusterUID, PoolID, NodeID, nil) + return args.Error(0) +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/.gitignore b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/.gitignore new file mode 100644 index 000000000000..7437dfe95f81 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/.gitignore @@ -0,0 +1,28 @@ + +# Created by https://www.gitignore.io/api/go +# Edit at https://www.gitignore.io/?templates=go + +### Go ### +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +### Go Patch ### +/vendor/ +/Godeps/ + +# End of https://www.gitignore.io/api/go + +.idea/ diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/.goreleaser.yml b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/.goreleaser.yml new file mode 100644 index 000000000000..2f9923cb9218 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/.goreleaser.yml @@ -0,0 +1,31 @@ +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + - go mod download + +builds: + - env: + - GO111MODULE=on + - CGO_ENABLED=0 + main: ./cmd/ + binary: gobizfly + hooks: + pre: make build + skip: true ## set false if specific main program for building + +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + +checksum: + name_template: "checksums.txt" +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/COPYING b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/COPYING new file mode 100644 index 000000000000..f288702d2fa1 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/Dockerfile b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/Dockerfile new file mode 100644 index 000000000000..d69e3f108fcb --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/Dockerfile @@ -0,0 +1,29 @@ + + +FROM golang:1.13 AS build_base + +RUN apt-get update && apt-get install -y git pkg-config + +# stage 2 +from build_base AS build_go + +ENV GO111MODULE=on + +WORKDIR $GOPATH/src/github.com/bizflycloud/gobizfly +COPY go.mod . +COPY go.sum . +RUN go mod download +RUN go mod vendor +# # RUN CGO_ENABLED=0 GOOS=linux go get + +# stage 3 +FROM build_go AS server_builder + +ENV GO111MODULE=on + +COPY . . +RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -gcflags="-N -l" -o /bin/gobizfly *.go + +ENTRYPOINT [ "/bin/gobizfly" ] + + diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/Makefile b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/Makefile new file mode 100644 index 000000000000..b4a556259179 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/Makefile @@ -0,0 +1,34 @@ +PROJECT_NAME := "gobizfly" +PKG := "github.com/bizflycloud/$(PROJECT_NAME)" +PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/) +GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go) + +.PHONY: all dep lint vet test test-coverage build clean + +all: build + +dep: ## Get the dependencies + @go mod download + +lint: ## Lint Golang files + @golint -set_exit_status ${PKG_LIST} + +vet: ## Run go vet + @go vet ${PKG_LIST} + +test: ## Run unittests + @go test -short ${PKG_LIST} + +test-coverage: ## Run tests with coverage + @go test -short -coverprofile cover.out -covermode=atomic ${PKG_LIST} + @cat cover.out >> coverage.txt + +build: dep ## Build the binary file + @go build -i -o build/main *.go + ## $(PKG) + +clean: ## Remove previous build + @rm -f $(PROJECT_NAME)/build + +help: ## Display this help screen + @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/README.md b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/README.md new file mode 100644 index 000000000000..679c8e9989e9 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/README.md @@ -0,0 +1,47 @@ +# bizfly-client-go + +# Example + +```go +package main + +import ( + "context" + "log" + "time" + + gobizfly "github.com/bizflycloud/bizfly-client-go" +) + +const ( + host = "https://manage.bizflycloud.vn" + username = "cuonglm@vccloud.vn" + password = "foobar" +) + +func main() { + client, err := gobizfly.NewClient( + gobizfly.WithAPIUrl(host), + gobizfly.WithTenantName(username), + ) + if err != nil { + log.Fatal(err) + } + + ctx, cancelFunc := context.WithTimeout(context.Background(), time.Second*10) + defer cancelFunc() + tok, err := client.Token.Create(ctx, &gobizfly.TokenCreateRequest{Username: username, Password: password}) + if err != nil { + log.Fatal(err) + } + client.SetKeystoneToken(tok.KeystoneToken) + + lbs, err := client.LoadBalancer.List(ctx, &gobizfly.ListOptions{}) + if err != nil { + log.Fatal(err) + } + log.Printf("%#v\n", lbs) +} +``` + +For other usages, see test files. diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/account.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/account.go new file mode 100644 index 000000000000..7625ab395860 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/account.go @@ -0,0 +1,166 @@ +package gobizfly + +import ( + "context" + "encoding/json" + "net/http" + "strings" +) + +const ( + regionsPath = "/regions" + usersInfoPath = "/users/info" +) + +type accountService struct { + client *Client +} + +var _ AccountService = (*accountService)(nil) + +type AccountService interface { + ListRegion(ctx context.Context) (*Regions, error) + GetRegion(ctx context.Context, regionName string) (*Region, error) + GetUserInfo(ctx context.Context) (*User, error) +} + +type Region struct { + Active bool `json:"active"` + Icon string `json:"icon"` + Name string `json:"name"` + Order int `json:"order"` + RegionName string `json:"region_name"` + ShortName string `json:"short_name"` + Zones []AvailabilityZone `json:"zones"` +} + +type AvailabilityZone struct { + Active bool `json:"active"` + Icon string `json:"icon"` + Name string `json:"name"` + Order int `json:"order"` + ShortName string `json:"short_name"` +} + +type Regions struct { + HN Region `json:"HN"` + HCM Region `json:"HCM"` +} + +type User struct { + Service string `json:"service"` + URLType string `json:"url_type"` + Origin string `json:"origin"` + ClientType string `json:"client_type"` + BillingBalance int `json:"billing_balance"` + Balances map[string]float32 `json:"balances"` + PaymentMethod string `json:"payment_method"` + BillingAccID string `json:"billing_acc_id"` + Debit bool `json:"debit"` + Email string `json:"email"` + Phone string `json:"phone"` + FullName string `json:"full_name"` + VerifiedEmail bool `json:"verified_email"` + VerifiedPhone bool `json:"verified_phone"` + LoginAlert bool `json:"login_alert"` + VerifiedPayment bool `json:"verified_payment"` + LastRegion string `json:"last_region"` + LastProject string `json:"last_project"` + Type string `json:"type"` + OTP bool `json:"otp"` + Services []Service `json:"services"` + Whitelist []string `json:"whitelist"` + Expires string `json:"expires"` + TenantID string `json:"tenant_id"` + TenantName string `json:"tenant_name"` + KsUserID string `json:"ks_user_id"` + IAM IAM `json:"iam"` + Domains []string `json:"domains"` + PaymentType string `json:"payment_type"` + DOB string `json:"dob"` + Gender string `json:"_gender"` + Trial Trial `json:"trial"` + HasExpiredInvoice bool `json:"has_expired_invoice"` + NegativeBalance bool `json:"negative_balance"` + Promotion []string `json:"promotion"` +} + +type IAM struct { + Expire string `json:"expire"` + TenantID string `json:"tenant_id"` + TenantName string `json:"tenant_name"` + VerifiedPhone bool `json:"verified_phone"` + VerifiedEmail bool `json:"verified_email"` + VerifiedPayment bool `json:"verified_payment"` +} + +type Trial struct { + StartedAt string `json:"started_at"` + ExpiredAt string `json:"expired_at"` + Active bool `json:"active"` + Enable bool `json:"enable"` + ServiceLevel int `json:"service_level"` +} + +func (a accountService) resourceRegionPath() string { + return regionsPath +} + +func (a accountService) resourceUserInfo() string { + return usersInfoPath +} + +func (a accountService) itemPath(name string) string { + return strings.Join([]string{regionsPath, name}, "/") +} + +func (a accountService) ListRegion(ctx context.Context) (*Regions, error) { + req, err := a.client.NewRequest(ctx, http.MethodGet, accountName, a.resourceRegionPath(), nil) + if err != nil { + return nil, err + } + var regions *Regions + resp, err := a.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(®ions); err != nil { + return nil, err + } + return regions, nil +} + +func (a accountService) GetRegion(ctx context.Context, regionName string) (*Region, error) { + req, err := a.client.NewRequest(ctx, http.MethodGet, accountName, a.itemPath(regionName), nil) + if err != nil { + return nil, err + } + var region *Region + resp, err := a.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(®ion); err != nil { + return nil, err + } + return region, nil +} + +func (a accountService) GetUserInfo(ctx context.Context) (*User, error) { + req, err := a.client.NewRequest(ctx, http.MethodGet, accountName, a.resourceUserInfo(), nil) + if err != nil { + return nil, err + } + resp, err := a.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var user *User + if err := json.NewDecoder(resp.Body).Decode(&user); err != nil { + return nil, err + } + return user, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/alert.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/alert.go new file mode 100644 index 000000000000..9f9a45f09ac3 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/alert.go @@ -0,0 +1,794 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "io" + "io/ioutil" + "net/http" + "strings" +) + +var _ CloudWatcherService = (*cloudwatcherService)(nil) + +type cloudwatcherService struct { + client *Client +} + +// CloudWatcherService is interface wrap others resource's interfaces +type CloudWatcherService interface { + Agents() *agents + Alarms() *alarms + Histories() *histories + Receivers() *receivers + Secrets() *secrets +} + +func (cws *cloudwatcherService) Agents() *agents { + return &agents{client: cws.client} +} + +func (cws *cloudwatcherService) Alarms() *alarms { + return &alarms{client: cws.client} +} + +func (cws *cloudwatcherService) Receivers() *receivers { + return &receivers{client: cws.client} +} + +func (cws *cloudwatcherService) Histories() *histories { + return &histories{client: cws.client} +} + +func (cws *cloudwatcherService) Secrets() *secrets { + return &secrets{client: cws.client} +} + +const ( + agentsResourcePath = "/agents" + alarmsResourcePath = "/alarms" + getVerificationPath = "/resend" + historiesResourcePath = "/histories" + receiversResourcePath = "/receivers" + secretsResourcePath = "/secrets" +) + +// Comparison is represents comparison payload in alarms +type Comparison struct { + CompareType string `json:"compare_type"` + Measurement string `json:"measurement"` + RangeTime int `json:"range_time"` + Value float64 `json:"value"` +} + +// AlarmInstancesMonitors is represents instances payload - which servers will be monitored +type AlarmInstancesMonitors struct { + ID string `json:"id"` + Name string `json:"name"` +} + +// AlarmVolumesMonitor is represents volumes payload - which volumes will be monitored +type AlarmVolumesMonitor struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Device string `json:"device,omitempty"` +} + +// HTTPHeaders is is represents http headers - which using call to http_url +type HTTPHeaders struct { + Key string `json:"key"` + Value string `json:"value"` +} + +// AlarmLoadBalancersMonitor is represents load balancer payload - which load balancer will be monitored +type AlarmLoadBalancersMonitor struct { + LoadBalancerID string `json:"load_balancer_id"` + LoadBalancerName string `json:"load_balancer_name"` + TargetID string `json:"target_id"` + TargetName string `json:"target_name,omitempty"` + TargetType string `json:"target_type"` +} + +// AlarmReceiversUse is represents receiver's payload will be use create alarms +type AlarmReceiversUse struct { + AutoscaleClusterName string `json:"autoscale_cluster_name,omitempty"` + EmailAddress string `json:"email_address,omitempty"` + Name string `json:"name"` + ReceiverID string `json:"receiver_id"` + SlackChannelName string `json:"slack_channel_name,omitempty"` + SMSInterval int `json:"sms_interval,omitempty"` + SMSNumber string `json:"sms_number,omitempty"` + TelegramChatID string `json:"telegram_chat_id,omitempty"` + WebhookURL string `json:"webhook_url,omitempty"` +} + +type agents struct { + client *Client +} + +type alarms struct { + client *Client +} + +type receivers struct { + client *Client +} + +type histories struct { + client *Client +} + +type secrets struct { + client *Client +} + +// AlarmCreateRequest represents create new alarm request payload. +type AlarmCreateRequest struct { + AlertInterval int `json:"alert_interval"` + ClusterID string `json:"cluster_id,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + Comparison *Comparison `json:"comparison,omitempty"` + Hostname string `json:"hostname,omitempty"` + HTTPExpectedCode int `json:"http_expected_code,omitempty"` + HTTPHeaders *[]HTTPHeaders `json:"http_headers,omitempty"` + HTTPURL string `json:"http_url,omitempty"` + Instances *[]AlarmInstancesMonitors `json:"instances,omitempty"` + LoadBalancers []*AlarmLoadBalancersMonitor `json:"load_balancers,omitempty"` + Name string `json:"name"` + Receivers []AlarmReceiversUse `json:"receivers"` + ResourceType string `json:"resource_type"` + Volumes *[]AlarmVolumesMonitor `json:"volumes,omitempty"` +} + +// ReceiverCreateRequest contains receiver information. +type ReceiverCreateRequest struct { + AutoScale *AutoScalingWebhook `json:"autoscale,omitempty"` + EmailAddress string `json:"email_address,omitempty"` + Name string `json:"name"` + Slack *Slack `json:"slack,omitempty"` + SMSNumber string `json:"sms_number,omitempty"` + TelegramChatID string `json:"telegram_chat_id,omitempty"` + WebhookURL string `json:"webhook_url,omitempty"` +} + +// SecretsCreateRequest contains receiver information. +type SecretsCreateRequest struct { + Name string `json:"name,omitempty"` +} + +// AlarmUpdateRequest represents update alarm request payload. +type AlarmUpdateRequest struct { + AlertInterval int `json:"alert_interval,omitempty"` + ClusterID string `json:"cluster_id,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + Comparison *Comparison `json:"comparison,omitempty"` + Enable bool `json:"enable"` + Hostname string `json:"hostname,omitempty"` + HTTPExpectedCode int `json:"http_expected_code,omitempty"` + HTTPHeaders *[]HTTPHeaders `json:"http_headers,omitempty"` + HTTPURL string `json:"http_url,omitempty"` + Instances *[]AlarmInstancesMonitors `json:"instances,omitempty"` + LoadBalancers []*AlarmLoadBalancersMonitor `json:"load_balancers,omitempty"` + Name string `json:"name,omitempty"` + Receivers *[]AlarmReceiversUse `json:"receivers,omitempty"` + ResourceType string `json:"resource_type,omitempty"` + Volumes *[]AlarmVolumesMonitor `json:"volumes,omitempty"` +} + +// ResponseRequest represents api's response. +type ResponseRequest struct { + Created string `json:"_created,omitempty"` + Deleted bool `json:"_deleted,omitempty"` + ID string `json:"_id,omitempty"` + Status string `json:"_status,omitempty"` +} + +// Agents contains agent information. +type Agents struct { + Created string `json:"_created"` + Hostname string `json:"hostname"` + ID string `json:"_id"` + Name string `json:"name"` + Online bool `json:"online"` + ProjectID string `json:"project_id"` + Runtime string `json:"runtime"` + UserID string `json:"user_id"` +} + +// Alarms contains alarm information. +type Alarms struct { + AlertInterval int `json:"alert_interval"` + ClusterID string `json:"cluster_id,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + Comparison *Comparison `json:"comparison,omitempty"` + Created string `json:"_created"` + Creator string `json:"creator"` + Enable bool `json:"enable"` + Hostname string `json:"hostname,omitempty"` + HTTPExpectedCode int `json:"http_expected_code,omitempty"` + HTTPHeaders []HTTPHeaders `json:"http_headers,omitempty"` + HTTPURL string `json:"http_url,omitempty"` + ID string `json:"_id"` + Instances []AlarmInstancesMonitors `json:"instances,omitempty"` + LoadBalancers []*AlarmLoadBalancersMonitor `json:"load_balancers,omitempty"` + Name string `json:"name"` + ProjectID string `json:"project_id"` + Receivers []AlarmReceiversUse `json:"receivers"` + ResourceType string `json:"resource_type"` + UserID string `json:"user_id"` + Volumes []AlarmVolumesMonitor `json:"volumes,omitempty"` +} + +// AlarmsInHistories contains alarm information in a history +type AlarmsInHistories struct { + AlertInterval int `json:"alert_interval"` + ClusterID string `json:"cluster_id,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + Comparison *Comparison `json:"comparison,omitempty"` + Enable bool `json:"enable"` + Hostname string `json:"hostname,omitempty"` + HTTPExpectedCode int `json:"http_expected_code,omitempty"` + HTTPHeaders *[]HTTPHeaders `json:"http_headers,omitempty"` + HTTPURL string `json:"http_url,omitempty"` + ID string `json:"_id"` + Instances *[]AlarmInstancesMonitors `json:"instances,omitempty"` + LoadBalancers *[]AlarmLoadBalancersMonitor `json:"load_balancers,omitempty"` + Name string `json:"name"` + ProjectID string `json:"project_id"` + Receivers *[]struct { + ReceiverID string `json:"receiver_id"` + Methods []string `json:"methods"` + } `json:"receivers"` + ResourceType string `json:"resource_type"` + UserID string `json:"user_id"` + Volumes *[]AlarmVolumesMonitor `json:"volumes,omitempty"` +} + +// Slack is represents slack payload - which will be use create a receiver +type Slack struct { + SlackChannelName string `json:"channel_name"` + WebhookURL string `json:"webhook_url"` +} + +// Receivers contains receiver information. +type Receivers struct { + AutoScale *AutoScalingWebhook `json:"autoscale,omitempty"` + Created string `json:"_created"` + Creator string `json:"creator"` + EmailAddress string `json:"email_address,omitempty"` + Name string `json:"name"` + ProjectID string `json:"project_id,omitempty"` + ReceiverID string `json:"_id"` + Slack *Slack `json:"slack,omitempty"` + SMSNumber string `json:"sms_number,omitempty"` + TelegramChatID string `json:"telegram_chat_id,omitempty"` + UserID string `json:"user_id,omitempty"` + VerifiedEmailDddress bool `json:"verified_email_address,omitempty"` + VerifiedSMSNumber bool `json:"verified_sms_number,omitempty"` + VerifiedTelegramChatID bool `json:"verified_telegram_chat_id,omitempty"` + VerifiedWebhookURL bool `json:"verified_webhook_url,omitempty"` + WebhookURL string `json:"webhook_url,omitempty"` +} + +// Histories contains history information. +type Histories struct { + HistoryID string `json:"_id"` + Name string `json:"name"` + ProjectID string `json:"project_id,omitempty"` + UserID string `json:"user_id,omitempty"` + Resource interface{} `json:"resource,omitempty"` + State string `json:"state,omitempty"` + Measurement string `json:"measurement,omitempty"` + AlarmID string `json:"alarm_id"` + Alarm AlarmsInHistories `json:"alarm,omitempty"` + Created string `json:"_created,omitempty"` +} + +// SecretCreateRequest represents create new secret request payload. +type SecretCreateRequest struct { + Name string `json:"name,omitempty"` +} + +// Secrets contains secrets information. +type Secrets struct { + Created string `json:"_created,omitempty"` + ID string `json:"_id"` + Name string `json:"name"` + ProjectID string `json:"project_id,omitempty"` + Secret string `json:"secret,omitempty"` + UserID string `json:"user_id,omitempty"` +} + +// =========================================================================== +// Start block interaction for agents +// =========================================================================== +func (a *agents) resourcePath() string { + return strings.Join([]string{agentsResourcePath}, "/") +} + +func (a *agents) itemPath(id string) string { + return strings.Join([]string{agentsResourcePath, id}, "/") +} + +// List agents +func (a *agents) List(ctx context.Context, filters *string) ([]*Agents, error) { + req, err := a.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, a.resourcePath(), nil) + if err != nil { + return nil, err + } + + if filters != nil { + q := req.URL.Query() + q.Add("where", *filters) + req.URL.RawQuery = q.Encode() + } + + resp, err := a.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + Agents []*Agents `json:"_items"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.Agents, nil +} + +// Get an agent +func (a *agents) Get(ctx context.Context, id string) (*Agents, error) { + req, err := a.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, a.itemPath(id), nil) + if err != nil { + return nil, err + } + resp, err := a.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + agent := &Agents{} + if err := json.NewDecoder(resp.Body).Decode(agent); err != nil { + return nil, err + } + + return agent, nil +} + +// Delete an agent +func (a *agents) Delete(ctx context.Context, id string) error { + req, err := a.client.NewRequest(ctx, http.MethodDelete, cloudwatcherServiceName, a.itemPath(id), nil) + if err != nil { + return err + } + resp, err := a.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +// =========================================================================== +// Start block interaction for alarms +// =========================================================================== +func (a *alarms) resourcePath() string { + return strings.Join([]string{alarmsResourcePath}, "/") +} + +func (a *alarms) itemPath(id string) string { + return strings.Join([]string{alarmsResourcePath, id}, "/") +} + +// List alarms +func (a *alarms) List(ctx context.Context, filters *string) ([]*Alarms, error) { + req, err := a.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, a.resourcePath(), nil) + if err != nil { + return nil, err + } + + if filters != nil { + q := req.URL.Query() + q.Add("where", *filters) + req.URL.RawQuery = q.Encode() + } + + resp, err := a.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + Alarms []*Alarms `json:"_items"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.Alarms, nil +} + +// Create an alarm +func (a *alarms) Create(ctx context.Context, acr *AlarmCreateRequest) (*ResponseRequest, error) { + req, err := a.client.NewRequest(ctx, http.MethodPost, cloudwatcherServiceName, a.resourcePath(), &acr) + if err != nil { + return nil, err + } + resp, err := a.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData = &ResponseRequest{} + if err := json.NewDecoder(resp.Body).Decode(respData); err != nil { + return nil, err + } + return respData, nil +} + +// Get an alarm +func (a *alarms) Get(ctx context.Context, id string) (*Alarms, error) { + req, err := a.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, a.itemPath(id), nil) + if err != nil { + return nil, err + } + resp, err := a.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + alarm := &Alarms{} + if err := json.NewDecoder(resp.Body).Decode(alarm); err != nil { + return nil, err + } + // hardcode in here + for _, loadbalancer := range alarm.LoadBalancers { + if loadbalancer.TargetType == "frontend" { + frontend, err := a.client.Listener.Get(ctx, loadbalancer.TargetID) + if err != nil { + loadbalancer.TargetName = "" + } + loadbalancer.TargetName = frontend.Name + } else { + backend, err := a.client.Pool.Get(ctx, loadbalancer.TargetID) + if err != nil { + loadbalancer.TargetName = "" + } + loadbalancer.TargetName = backend.Name + } + } + return alarm, nil +} + +// Update an alarm +func (a *alarms) Update(ctx context.Context, id string, aur *AlarmUpdateRequest) (*ResponseRequest, error) { + req, err := a.client.NewRequest(ctx, http.MethodPatch, cloudwatcherServiceName, a.itemPath(id), &aur) + if err != nil { + return nil, err + } + resp, err := a.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + respData := &ResponseRequest{} + if err := json.NewDecoder(resp.Body).Decode(respData); err != nil { + return nil, err + } + + return respData, nil +} + +// Delete an alarm +func (a *alarms) Delete(ctx context.Context, id string) error { + req, err := a.client.NewRequest(ctx, http.MethodDelete, cloudwatcherServiceName, a.itemPath(id), nil) + if err != nil { + return err + } + resp, err := a.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +// =========================================================================== +// Start block interaction for receivers +// =========================================================================== +func (r *receivers) resourcePath() string { + return strings.Join([]string{receiversResourcePath}, "/") +} + +func (r *receivers) itemPath(id string) string { + return strings.Join([]string{receiversResourcePath, id}, "/") +} + +func (r *receivers) verificationPath() string { + return strings.Join([]string{getVerificationPath}, "/") +} + +// List receivers +func (r *receivers) List(ctx context.Context, filters *string) ([]*Receivers, error) { + req, err := r.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, r.resourcePath(), nil) + if err != nil { + return nil, err + } + + if filters != nil { + q := req.URL.Query() + q.Add("where", *filters) + req.URL.RawQuery = q.Encode() + } + + resp, err := r.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + Receivers []*Receivers `json:"_items"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.Receivers, nil +} + +// Create a receiver +func (r *receivers) Create(ctx context.Context, rcr *ReceiverCreateRequest) (*ResponseRequest, error) { + req, err := r.client.NewRequest(ctx, http.MethodPost, cloudwatcherServiceName, r.resourcePath(), &rcr) + if err != nil { + return nil, err + } + resp, err := r.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData = &ResponseRequest{} + if err := json.NewDecoder(resp.Body).Decode(respData); err != nil { + return nil, err + } + return respData, nil +} + +// Get a receiver +func (r *receivers) Get(ctx context.Context, id string) (*Receivers, error) { + req, err := r.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, r.itemPath(id), nil) + if err != nil { + return nil, err + } + resp, err := r.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + receiver := &Receivers{} + if err := json.NewDecoder(resp.Body).Decode(receiver); err != nil { + return nil, err + } + return receiver, nil +} + +// Update receiver +func (r *receivers) Update(ctx context.Context, id string, rur *ReceiverCreateRequest) (*ResponseRequest, error) { + req, err := r.client.NewRequest(ctx, http.MethodPut, cloudwatcherServiceName, r.itemPath(id), &rur) + if err != nil { + return nil, err + } + resp, err := r.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + respData := &ResponseRequest{} + if err := json.NewDecoder(resp.Body).Decode(respData); err != nil { + return nil, err + } + + return respData, nil +} + +// Delete receiver +func (r *receivers) Delete(ctx context.Context, id string) error { + req, err := r.client.NewRequest(ctx, http.MethodDelete, cloudwatcherServiceName, r.itemPath(id), nil) + if err != nil { + return err + } + resp, err := r.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +// ResendVerificationLink is use get a link verification +func (r *receivers) ResendVerificationLink(ctx context.Context, id string, rType string) error { + req, err := r.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, r.verificationPath(), nil) + if err != nil { + return err + } + + q := req.URL.Query() + q.Add("rec_id", id) + q.Add("rec_type", rType) + req.URL.RawQuery = q.Encode() + + resp, err := r.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +// =========================================================================== +// Start block interaction for histories +// =========================================================================== +func (h *histories) resourcePath() string { + return strings.Join([]string{historiesResourcePath}, "/") +} + +// List histories +func (h *histories) List(ctx context.Context, filters *string) ([]*Histories, error) { + req, err := h.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, h.resourcePath(), nil) + if err != nil { + return nil, err + } + + q := req.URL.Query() + if filters != nil { + q.Add("where", *filters) + } + q.Add("sort", "-_created") + req.URL.RawQuery = q.Encode() + + resp, err := h.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + Histories []*Histories `json:"_items"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.Histories, nil +} + +// =========================================================================== +// Start block interaction for secrets +// =========================================================================== +func (s *secrets) resourcePath() string { + return strings.Join([]string{secretsResourcePath}, "/") +} + +func (s *secrets) itemPath(id string) string { + return strings.Join([]string{secretsResourcePath, id}, "/") +} + +// List secrets +func (s *secrets) List(ctx context.Context, filters *string) ([]*Secrets, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, s.resourcePath(), nil) + if err != nil { + return nil, err + } + + if filters != nil { + q := req.URL.Query() + q.Add("where", *filters) + req.URL.RawQuery = q.Encode() + } + + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + Secrets []*Secrets `json:"_items"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.Secrets, nil +} + +// Create a secret +func (s *secrets) Create(ctx context.Context, scr *SecretsCreateRequest) (*ResponseRequest, error) { + req, err := s.client.NewRequest(ctx, http.MethodPost, cloudwatcherServiceName, s.resourcePath(), &scr) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData = &ResponseRequest{} + if err := json.NewDecoder(resp.Body).Decode(respData); err != nil { + return nil, err + } + return respData, nil +} + +// Get a secret +func (s *secrets) Get(ctx context.Context, id string) (*Secrets, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, cloudwatcherServiceName, s.itemPath(id), nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + secret := &Secrets{} + if err := json.NewDecoder(resp.Body).Decode(secret); err != nil { + return nil, err + } + return secret, nil +} + +// Delete secret +func (s *secrets) Delete(ctx context.Context, id string) error { + req, err := s.client.NewRequest(ctx, http.MethodDelete, cloudwatcherServiceName, s.itemPath(id), nil) + if err != nil { + return err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/autoscaling.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/autoscaling.go new file mode 100644 index 000000000000..60d91332addb --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/autoscaling.go @@ -0,0 +1,1266 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "errors" + "io" + "io/ioutil" + "net/http" + "strconv" + "strings" +) + +const ( + statusActive = "Active" + statusError = "Error" +) + +const ( + autoscalingGroupResourcePath = "/groups" + eventsResourcePath = "/events" + launchConfigurationsResourcePath = "/launch_configs" + nodesResourcePath = "nodes" + policiesResourcePath = "policies" + quotasResourcePath = "/quotas" + schedulesResourcePath = "cron_triggers" + suggestionResourcePath = "/suggestion" + tasksResourcePath = "/task" + usingResourcePath = "/using_resource" + webhooksResourcePath = "webhooks" +) + +var ( + actionTypeSupportedWebhooks = []string{ + "CLUSTER SCALE IN", + "CLUSTER SCALE OUT", + } + networkPlan = []string{ + "free_datatransfer", + "free_bandwidth", + } +) + +var _ AutoScalingService = (*autoscalingService)(nil) + +type autoscalingService struct { + client *Client +} + +/* +AutoScalingService is interface wrap others resource's interfaces. Includes: +1. AutoScalingGroups: Provides function interact with an autoscaling group such as: + Create, Update, Delete +2. Events: Provides function to list events of an autoscaling group +3. LaunchConfigurations: Provides function to interact with launch configurations +4. Nodes: Provides function to interact with members of autoscaling group +5. Policies: Provides function to interact with autoscaling policies of autoscaling group +6. Schedules: Provides function to interact with schedule for auto scaling +7. Tasks: Provides function to get information of task +8. Webhooks: Provides fucntion to list webhook triggers scale of autoscaling group +*/ +type AutoScalingService interface { + AutoScalingGroups() *autoScalingGroup + Common() *common + Events() *event + LaunchConfigurations() *launchConfiguration + Nodes() *node + Policies() *policy + Schedules() *schedule + Tasks() *task + Webhooks() *webhook +} + +func (as *autoscalingService) AutoScalingGroups() *autoScalingGroup { + return &autoScalingGroup{client: as.client} +} + +func (as *autoscalingService) LaunchConfigurations() *launchConfiguration { + return &launchConfiguration{client: as.client} +} + +func (as *autoscalingService) Webhooks() *webhook { + return &webhook{client: as.client} +} + +func (as *autoscalingService) Events() *event { + return &event{client: as.client} +} + +func (as *autoscalingService) Nodes() *node { + return &node{client: as.client} +} + +func (as *autoscalingService) Policies() *policy { + return &policy{client: as.client} +} + +func (as *autoscalingService) Schedules() *schedule { + return &schedule{client: as.client} +} + +func (as *autoscalingService) Tasks() *task { + return &task{client: as.client} +} + +func (as *autoscalingService) Common() *common { + return &common{client: as.client} +} + +type autoScalingGroup struct { + client *Client +} + +type launchConfiguration struct { + client *Client +} + +type webhook struct { + client *Client +} + +type event struct { + client *Client +} + +type policy struct { + client *Client +} + +type node struct { + client *Client +} + +type schedule struct { + client *Client +} + +type task struct { + client *Client +} + +type common struct { + client *Client +} + +// Webhook - informaion of cluster's receiver +type Webhook struct { + ID string `json:"id"` + Name string `json:"name"` +} + +// ASWebhookIDs - information about cluster's receivers +type ASWebhookIDs struct { + ScaleIn Webhook `json:"scale_in"` + ScaleOut Webhook `json:"scale_out"` +} + +// ASAlarm - alarm to triggers scale +type ASAlarm struct { + AutoScaling []string `json:"auto_scaling"` + LoadBalancer []string `json:"load_balancer"` +} + +// ASAlarms - alarms to do trigger scale +type ASAlarms struct { + ScaleIn ASAlarm `json:"scale_in"` + ScaleOut ASAlarm `json:"scale_out"` +} + +// taskResult - Struct of data was returned by workers +type taskResult struct { + Action string `json:"action,omitempty"` + Data interface{} `json:"data,omitempty"` + Message string `json:"message,omitempty"` + Progress int `json:"progress,omitempty"` + Success bool `json:"success,omitempty"` +} + +// ASTask is information of doing task +type ASTask struct { + Ready bool `json:"ready"` + Result taskResult `json:"result"` +} + +// ASMetadata - Medata of an auto scaling group +type ASMetadata struct { + Alarms ASAlarms `json:"alarms"` + DeletionPolicy []string `json:"deletion_policy"` + ScaleInReceiver string `json:"scale_in_receiver"` + ScaleOutReceiver string `json:"scale_out_receiver"` + WebhookIDs ASWebhookIDs `json:"webhook_ids"` +} + +// ScalePolicyInformation - information about a scale policy +type ScalePolicyInformation struct { + BestEffort bool `json:"best_effort"` + CoolDown int `json:"cooldown"` + Event string `json:"event,omitempty"` + ID *string `json:"id,omitempty"` + MetricType string `json:"metric"` + RangeTime int `json:"range_time"` + ScaleSize int `json:"number"` + Threshold float64 `json:"threshold"` + Type *string `json:"type,omitempty"` +} + +// DeleteionPolicyHooks represents a hooks was triggered when delete node in auto scaling group +type DeleteionPolicyHooks struct { + URL string `json:"url"` + Method *string `json:"method"` + Params *map[string]interface{} `json:"params"` + Headers *map[string]interface{} `json:"headers"` + Verify *bool `json:"verify"` +} + +// LoadBalancerScalingPolicy represents payload load balancers in LoadBalancersPolicyCreateRequest/Update +type LoadBalancerScalingPolicy struct { + ID string `json:"load_balancer_id"` + Name string `json:"load_balancer_name,omitempty"` + TargetID string `json:"target_id"` + TargetName string `json:"target_name,omitempty"` + TargetType string `json:"target_type"` +} + +// LoadBalancersPolicyCreateRequest represents payload in create a load balancer policy +type LoadBalancersPolicyCreateRequest struct { + CoolDown int `json:"cooldown,omitempty"` + Event string `json:"event,omitempty"` + LoadBalancers LoadBalancerScalingPolicy `json:"load_balancers,omitempty"` + MetricType string `json:"metric,omitempty"` + RangeTime int `json:"range_time,omitempty"` + ScaleSize int `json:"number,omitempty"` + Threshold int `json:"threshold,omitempty"` +} + +// LoadBalancersPolicyUpdateRequest represents payload in create a load balancer policy +type LoadBalancersPolicyUpdateRequest struct { + CoolDown int `json:"cooldown,omitempty"` + Event string `json:"event,omitempty"` + LoadBalancers LoadBalancerScalingPolicy `json:"load_balancers,omitempty"` + MetricType string `json:"metric,omitempty"` + RangeTime int `json:"range_time,omitempty"` + ScaleSize int `json:"number,omitempty"` + Threshold int `json:"threshold,omitempty"` +} + +// HooksPolicyCreateRequest represents payload use create a deletion policy +type HooksPolicyCreateRequest struct { + Criteria string `json:"criteria,omitempty"` + DestroyAfterDeletion bool `json:"destroy_after_deletion,omitempty"` + GracePeriod int `json:"grace_period,omitempty"` + Hooks DeleteionPolicyHooks `json:"hooks,omitempty"` + ReduceDesiredCapacity bool `json:"reduce_desired_capacity,omitempty"` + Type string `json:"policy_type"` +} + +// PolicyCreateRequest represents payload use create a policy +type PolicyCreateRequest struct { + CoolDown int `json:"cooldown,omitempty"` + Event string `json:"event,omitempty"` + MetricType string `json:"metric,omitempty"` + RangeTime int `json:"range_time,omitempty"` + ScaleSize int `json:"number,omitempty"` + Threshold int `json:"threshold,omitempty"` +} + +// PolicyUpdateRequest represents payload use update a policy +type PolicyUpdateRequest struct { + CoolDown int `json:"cooldown,omitempty"` + Event string `json:"event,omitempty"` + MetricType string `json:"metric,omitempty"` + RangeTime int `json:"range_time,omitempty"` + ScaleSize int `json:"number,omitempty"` + Threshold int `json:"threshold,omitempty"` +} + +// TaskResponses is responses +type TaskResponses struct { + Message string `json:"message"` + TaskID string `json:"task_id,omitempty"` +} + +// DeletionInformation - represents a deletion policy +type DeletionInformation struct { + ID string `json:"id"` + Hooks DeleteionPolicyHooks `json:"hooks"` +} + +// LoadBalancerPolicyInformation - information of load balancer will be use for auto scaling group +type LoadBalancerPolicyInformation struct { + LoadBalancerID string `json:"id"` + LoadBalancerName string `json:"name,omitempty"` + ServerGroupID string `json:"server_group_id"` + ServerGroupName string `json:"server_group_name,omitempty"` + ServerGroupPort int `json:"server_group_port"` +} + +// AutoScalingPolicies - information of policies using for auto scaling group +type AutoScalingPolicies struct { + ScaleInPolicyInformations []ScalePolicyInformation `json:"scale_in_info,omitempty"` + ScaleOutPolicyInformations []ScalePolicyInformation `json:"scale_out_info,omitempty"` + LoadBalancerPolicyInformations LoadBalancerPolicyInformation `json:"load_balancer_info,omitempty"` + DeletionPolicyInformations DeletionInformation `json:"deletion_info,omitempty"` + DoingTasks []string `json:"doing_task,omitempty"` +} + +// AutoScalingGroupCreateRequest - payload use to create auto scaling group +type AutoScalingGroupCreateRequest struct { + DeletionPolicyInformations *DeletionInformation `json:"deletion_info,omitempty"` + DesiredCapacity int `json:"desired_capacity"` + LoadBalancerPolicyInformations *LoadBalancerPolicyInformation `json:"load_balancer_info,omitempty"` + MaxSize int `json:"max_size"` + MinSize int `json:"min_size"` + Name string `json:"name"` + ProfileID string `json:"profile_id"` + ScaleInPolicyInformations *[]ScalePolicyInformation `json:"scale_in_info,omitempty"` + ScaleOutPolicyInformations *[]ScalePolicyInformation `json:"scale_out_info,omitempty"` +} + +// AutoScalingGroupUpdateRequest - payload use to update auto scaling group +type AutoScalingGroupUpdateRequest struct { + DesiredCapacity int `json:"desired_capacity"` + LoadBalancerPolicyInformations *LoadBalancerPolicyInformation `json:"load_balancer_info,omitempty"` + MaxSize int `json:"max_size"` + MinSize int `json:"min_size"` + Name string `json:"name"` + ProfileID string `json:"profile_id"` + ProfileOnly bool `json:"profile_only"` +} + +// AutoScalingGroup - is represents an auto scaling group +type AutoScalingGroup struct { + Created string `json:"created_at"` + Data map[string]interface{} `json:"data"` + DeletionPolicyInformations DeletionInformation `json:"deletion_info,omitempty"` + DesiredCapacity int `json:"desired_capacity"` + ID string `json:"id"` + LoadBalancerPolicyInformations LoadBalancerPolicyInformation `json:"load_balancer_info,omitempty"` + MaxSize int `json:"max_size"` + Metadata ASMetadata `json:"metadata"` + MinSize int `json:"min_size"` + Name string `json:"name"` + NodeIDs []string `json:"node_ids"` + ProfileID string `json:"profile_id"` + ProfileName string `json:"profile_name"` + ScaleInPolicyInformations []ScalePolicyInformation `json:"scale_in_info,omitempty"` + ScaleOutPolicyInformations []ScalePolicyInformation `json:"scale_out_info,omitempty"` + Status string `json:"status"` + TaskID string `json:"task_id,omitempty"` + Timeout int `json:"timeout"` + Updated string `json:"updated_at"` +} + +// AutoScalingDataDisk is represents for a data disk being created with servers +type AutoScalingDataDisk struct { + DeleteOnTermination bool `json:"delete_on_termination"` + Size int `json:"size"` + Type string `json:"type"` +} + +// AutoScalingOperatingSystem is represents for operating system being use to create servers +type AutoScalingOperatingSystem struct { + CreateFrom string `json:"type,omitempty"` + Error string `json:"error,omitempty"` + ID string `json:"id,omitempty"` + OSName string `json:"os_name,omitempty"` +} + +// AutoScalingNetworks - is represents for relationship between network and firewalls +type AutoScalingNetworks struct { + ID string `json:"id"` + SecurityGroups []*string `json:"security_groups,omitempty"` +} + +// LaunchConfiguration - is represents a launch configurations +type LaunchConfiguration struct { + AvailabilityZone string `json:"availability_zone"` + Created string `json:"created_at,omitempty"` + DataDisks []*AutoScalingDataDisk `json:"datadisks,omitempty"` + Flavor string `json:"flavor"` + ID string `json:"id,omitempty"` + Metadata map[string]interface{} `json:"metadata"` + Name string `json:"name"` + NetworkPlan string `json:"network_plan,omitempty"` + Networks []*AutoScalingNetworks `json:"networks,omitempty"` + OperatingSystem AutoScalingOperatingSystem `json:"os"` + ProfileType string `json:"profile_type,omitempty"` + RootDisk *AutoScalingDataDisk `json:"rootdisk"` + SecurityGroups []*string `json:"security_groups,omitempty"` + SSHKey string `json:"key_name,omitempty"` + Status string `json:"status,omitempty"` + Type string `json:"type,omitempty"` + UserData string `json:"user_data,omitempty"` +} + +// AutoScalingWebhook is represents for a Webhook to trigger scale +type AutoScalingWebhook struct { + ActionID string `json:"action_id"` + ActionType string `json:"action_type"` + ClusterID string `json:"cluster_id"` + ClusterName string `json:"cluster_name"` +} + +// AutoScalingEvent is represents for a event of auto scaling group +type AutoScalingEvent struct { + ActionName string `json:"action"` + ActionType string `json:"type"` + Metadata struct { + Action struct { + Outputs map[string]interface{} `json:"outputs"` + } `json:"action"` + } `json:"meta_data"` + ClusterID string `json:"cluster_id"` + ID string `json:"id"` + Level string `json:"level"` + ObjectType string `json:"otype"` + StatusReason string `json:"status_reason"` + Timestamp string `json:"timestamp"` +} + +// AutoScalingNode is represents a cloud server in auto scaling group +type AutoScalingNode struct { + Status string `json:"status"` + Name string `json:"name"` + ProfileID string `json:"profile_id"` + ProfileName string `json:"profile_name"` + PhysicalID string `json:"physical_id"` + StatusReason string `json:"status_reason"` + ID string `json:"id"` + Addresses map[string]interface{} `json:"addresses"` +} + +// AutoScalingNodesDelete is represents a list cloud server being deleted +type AutoScalingNodesDelete struct { + Nodes []string `json:"nodes"` +} + +// usingResource - list snapshot, ssh key using to create launch configurations +type usingResource struct { + SSHKeys []string `json:"ssh_keys"` + Snapshots []string `json:"snapshots"` +} + +// usingResource - list snapshot, ssh key using to create launch configurations +type autoscalingQuotas struct { + Availability map[string]int `json:"can_create,omitempty"` + Limited map[string]int `json:"limited,omitempty"` + Valid bool `json:"valid"` +} + +// AutoScalingSize - size of auto scaling group +type AutoScalingSize struct { + DesiredCapacity int `json:"desired_capacity"` + MaxSize int `json:"max_size"` + MinSize int `json:"min_size"` +} + +// AutoScalingSchdeuleValid - represents for a validation time of cron triggers +type AutoScalingSchdeuleValid struct { + From string `json:"_from"` + To *string `json:"_to,omitempty"` +} + +// AutoScalingSchdeuleInputs - represents for a input of cron triggers +type AutoScalingSchdeuleInputs struct { + CronPattern string `json:"cron_pattern"` + Inputs AutoScalingSize `json:"inputs"` +} + +// AutoScalingSchdeuleSizing - represents for phase time of cron triggers +type AutoScalingSchdeuleSizing struct { + From AutoScalingSchdeuleInputs `json:"_from"` + To AutoScalingSchdeuleInputs `json:"_to,omitempty"` + Type string `json:"_type"` +} + +// AutoScalingSchdeuleCreateRequest - payload use create a scheduler (cron trigger) +type AutoScalingSchdeuleCreateRequest struct { + Name string `json:"name"` + Sizing AutoScalingSchdeuleSizing `json:"sizing"` + Valid AutoScalingSchdeuleValid `json:"valid"` +} + +// AutoScalingSchdeule - cron triggers to do time-based scale +type AutoScalingSchdeule struct { + ClusterID string `json:"cluster_id"` + Created string `json:"created_at"` + ID string `json:"_id"` + Name string `json:"name"` + Sizing AutoScalingSchdeuleSizing `json:"sizing"` + Status string `json:"status"` + TaskID string `json:"task_id"` + Valid AutoScalingSchdeuleValid `json:"valid"` +} + +// Auto Scaling Group path +func (asg *autoScalingGroup) resourcePath() string { + return autoscalingGroupResourcePath +} + +func (asg *autoScalingGroup) itemPath(id string) string { + return strings.Join([]string{autoscalingGroupResourcePath, id}, "/") +} + +// Launch Configurations path +func (lc *launchConfiguration) resourcePath() string { + return launchConfigurationsResourcePath +} + +func (lc *launchConfiguration) itemPath(id string) string { + return strings.Join([]string{launchConfigurationsResourcePath, id}, "/") +} + +// Webhook path +func (wh *webhook) resourcePath(clusterID string) string { + return strings.Join([]string{autoscalingGroupResourcePath, clusterID, webhooksResourcePath}, "/") +} + +// Events path +func (e *event) resourcePath(clusterID string, page, total int) string { + return eventsResourcePath +} + +// Policy path +func (p *policy) resourcePath(clusterID string) string { + return strings.Join([]string{autoscalingGroupResourcePath, clusterID, policiesResourcePath}, "/") +} + +func (p *policy) itemPath(clusterID, policyID string) string { + return strings.Join([]string{autoscalingGroupResourcePath, clusterID, policiesResourcePath, policyID}, "/") +} + +// Node path +func (n *node) resourcePath(clusterID string) string { + return strings.Join([]string{autoscalingGroupResourcePath, clusterID, nodesResourcePath}, "/") +} + +// Schedule path +func (s *schedule) resourcePath(clusterID string) string { + return strings.Join([]string{autoscalingGroupResourcePath, clusterID, schedulesResourcePath}, "/") +} + +func (s *schedule) itemPath(clusterID, scheduleID string) string { + return strings.Join([]string{autoscalingGroupResourcePath, clusterID, schedulesResourcePath, scheduleID}, "/") +} + +// Task path +func (t *task) resourcePath(taskID string) string { + return strings.Join([]string{tasksResourcePath, taskID, "status"}, "/") +} + +// Using Resource path +func (c *common) usingResourcePath() string { + return usingResourcePath +} + +func getQuotasResourcePath() string { + return quotasResourcePath +} + +func getSuggestionResourcePath() string { + return suggestionResourcePath +} + +// List +func (asg *autoScalingGroup) List(ctx context.Context, all bool) ([]*AutoScalingGroup, error) { + req, err := asg.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, asg.resourcePath(), nil) + if err != nil { + return nil, err + } + + if all { + q := req.URL.Query() + q.Add("all", "true") + req.URL.RawQuery = q.Encode() + } + + resp, err := asg.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + AutoScalingGroups []*AutoScalingGroup `json:"clusters"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.AutoScalingGroups, nil +} + +func (lc *launchConfiguration) List(ctx context.Context, all bool) ([]*LaunchConfiguration, error) { + req, err := lc.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, lc.resourcePath(), nil) + if err != nil { + return nil, err + } + + if all { + q := req.URL.Query() + q.Add("all", "true") + req.URL.RawQuery = q.Encode() + } + + resp, err := lc.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + LaunchConfigurations []*LaunchConfiguration `json:"profiles"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + for _, LaunchConfiguration := range data.LaunchConfigurations { + // Force ProfileType = Type + LaunchConfiguration.ProfileType = LaunchConfiguration.Type + + if LaunchConfiguration.OperatingSystem.Error != "" { + LaunchConfiguration.Status = statusError + } else { + LaunchConfiguration.Status = statusActive + } + } + return data.LaunchConfigurations, nil +} + +func (wh *webhook) List(ctx context.Context, clusterID string) ([]*AutoScalingWebhook, error) { + if clusterID == "" { + return nil, errors.New("Auto Scaling Group ID is required") + } + + req, err := wh.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, wh.resourcePath(clusterID), nil) + if err != nil { + return nil, err + } + resp, err := wh.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data []*AutoScalingWebhook + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data, nil +} + +func (e *event) List(ctx context.Context, clusterID string, page, total int) ([]*AutoScalingEvent, error) { + if clusterID == "" { + return nil, errors.New("Auto Scaling Group ID is required") + } + + req, err := e.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, e.resourcePath(clusterID, page, total), nil) + if err != nil { + return nil, err + } + + q := req.URL.Query() + q.Add("cluster_id", clusterID) + q.Add("page", strconv.Itoa(page)) + q.Add("total", strconv.Itoa(total)) + req.URL.RawQuery = q.Encode() + + resp, err := e.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + AutoScalingEvents []*AutoScalingEvent `json:"events"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.AutoScalingEvents, nil +} + +func (p *policy) List(ctx context.Context, clusterID string) (*AutoScalingPolicies, error) { + if clusterID == "" { + return nil, errors.New("Auto Scaling Group ID is required") + } + + req, err := p.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, p.resourcePath(clusterID), nil) + if err != nil { + return nil, err + } + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data = &AutoScalingPolicies{} + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data, nil +} + +func (n *node) List(ctx context.Context, clusterID string) ([]*AutoScalingNode, error) { + if clusterID == "" { + return nil, errors.New("Auto Scaling Group ID is required") + } + + req, err := n.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, n.resourcePath(clusterID), nil) + if err != nil { + return nil, err + } + resp, err := n.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + AutoScalingNodes []*AutoScalingNode `json:"nodes"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.AutoScalingNodes, nil +} + +func (s *schedule) List(ctx context.Context, clusterID string) ([]*AutoScalingSchdeule, error) { + if clusterID == "" { + return nil, errors.New("Auto Scaling Group ID is required") + } + + req, err := s.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, s.resourcePath(clusterID), nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + AutoScalingSchdeules []*AutoScalingSchdeule `json:"cron_triggers"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.AutoScalingSchdeules, nil +} + +// Get +func (asg *autoScalingGroup) Get(ctx context.Context, clusterID string) (*AutoScalingGroup, error) { + req, err := asg.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, asg.itemPath(clusterID), nil) + if err != nil { + return nil, err + } + resp, err := asg.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + data := &AutoScalingGroup{} + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data, nil +} + +func (lc *launchConfiguration) Get(ctx context.Context, profileID string) (*LaunchConfiguration, error) { + req, err := lc.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, lc.itemPath(profileID), nil) + if err != nil { + return nil, err + } + resp, err := lc.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + data := &LaunchConfiguration{} + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + // Force ProfileType = Type + data.ProfileType = data.Type + + if data.OperatingSystem.Error != "" { + data.Status = statusError + } else { + data.Status = statusActive + } + return data, nil +} + +func (wh *webhook) Get(ctx context.Context, clusterID string, ActionType string) (*AutoScalingWebhook, error) { + if clusterID == "" { + return nil, errors.New("Auto Scaling Group ID is required") + } + if _, ok := SliceContains(actionTypeSupportedWebhooks, ActionType); !ok { + return nil, errors.New("UNSUPPORTED action type") + } + req, err := wh.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, wh.resourcePath(clusterID), nil) + if err != nil { + return nil, err + } + resp, err := wh.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data []*AutoScalingWebhook + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + for _, webhook := range data { + if webhook.ActionType == ActionType { + return webhook, nil + } + } + return nil, nil +} + +func (t *task) Get(ctx context.Context, taskID string) (*ASTask, error) { + req, err := t.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, t.resourcePath(taskID), nil) + if err != nil { + return nil, err + } + resp, err := t.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data = &ASTask{} + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data, nil +} + +func (s *schedule) Get(ctx context.Context, clusterID, scheduleID string) (*AutoScalingSchdeule, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, s.itemPath(clusterID, scheduleID), nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data = &AutoScalingSchdeule{} + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data, nil +} + +func (p *policy) Get(ctx context.Context, clusterID, PolicyID string) (*ScalePolicyInformation, error) { + req, err := p.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, p.itemPath(clusterID, PolicyID), nil) + if err != nil { + return nil, err + } + + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &ScalePolicyInformation{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +// Delete +func (asg *autoScalingGroup) Delete(ctx context.Context, clusterID string) error { + req, err := asg.client.NewRequest(ctx, http.MethodDelete, autoScalingServiceName, asg.itemPath(clusterID), nil) + if err != nil { + return err + } + resp, err := asg.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +func (lc *launchConfiguration) Delete(ctx context.Context, profileID string) error { + req, err := lc.client.NewRequest(ctx, http.MethodDelete, autoScalingServiceName, lc.itemPath(profileID), nil) + if err != nil { + return err + } + resp, err := lc.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +func (p *policy) Delete(ctx context.Context, clusterID, PolicyID string) error { + req, err := p.client.NewRequest(ctx, http.MethodDelete, autoScalingServiceName, p.itemPath(clusterID, PolicyID), nil) + if err != nil { + return err + } + + resp, err := p.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +func (n *node) Delete(ctx context.Context, clusterID string, asnd *AutoScalingNodesDelete) error { + req, err := n.client.NewRequest(ctx, http.MethodDelete, autoScalingServiceName, n.resourcePath(clusterID), &asnd) + if err != nil { + return err + } + + resp, err := n.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +func (s *schedule) Delete(ctx context.Context, clusterID, scheduleID string) error { + req, err := s.client.NewRequest(ctx, http.MethodDelete, autoScalingServiceName, s.itemPath(clusterID, scheduleID), nil) + if err != nil { + return err + } + + resp, err := s.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +// Create +func (asg *autoScalingGroup) Create(ctx context.Context, ascr *AutoScalingGroupCreateRequest) (*AutoScalingGroup, error) { + if valid, _ := isValidQuotas(ctx, asg.client, "", ascr.ProfileID, ascr.DesiredCapacity, ascr.MaxSize); !valid { + return nil, errors.New("Not enough quotas to create new auto scaling group") + } + req, err := asg.client.NewRequest(ctx, http.MethodPost, autoScalingServiceName, asg.resourcePath(), &ascr) + if err != nil { + return nil, err + } + + resp, err := asg.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &AutoScalingGroup{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +func (lc *launchConfiguration) Create(ctx context.Context, lcr *LaunchConfiguration) (*LaunchConfiguration, error) { + if _, ok := SliceContains(networkPlan, lcr.NetworkPlan); !ok { + return nil, errors.New("UNSUPPORTED network plan") + } + + req, err := lc.client.NewRequest(ctx, http.MethodPost, autoScalingServiceName, lc.resourcePath(), &lcr) + if err != nil { + return nil, err + } + + resp, err := lc.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &LaunchConfiguration{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +func (p *policy) Create(ctx context.Context, clusterID string, pcr *PolicyCreateRequest) (*TaskResponses, error) { + req, err := p.client.NewRequest(ctx, http.MethodPost, autoScalingServiceName, p.resourcePath(clusterID), &pcr) + if err != nil { + return nil, err + } + + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &TaskResponses{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +func (p *policy) CreateHooks(ctx context.Context, clusterID string, hpcr *HooksPolicyCreateRequest) (*TaskResponses, error) { + req, err := p.client.NewRequest(ctx, http.MethodPost, autoScalingServiceName, p.resourcePath(clusterID), &hpcr) + if err != nil { + return nil, err + } + + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &TaskResponses{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +func (p *policy) CreateLoadBalancers(ctx context.Context, clusterID string, lbpcr *LoadBalancersPolicyCreateRequest) (*TaskResponses, error) { + req, err := p.client.NewRequest(ctx, http.MethodPost, autoScalingServiceName, p.resourcePath(clusterID), &lbpcr) + if err != nil { + return nil, err + } + + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &TaskResponses{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +func (s *schedule) Create(ctx context.Context, clusterID string, asscr *AutoScalingSchdeuleCreateRequest) (*TaskResponses, error) { + req, err := s.client.NewRequest(ctx, http.MethodPost, autoScalingServiceName, s.resourcePath(clusterID), &asscr) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &TaskResponses{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +// Update +func (asg *autoScalingGroup) Update(ctx context.Context, clusterID string, asur *AutoScalingGroupUpdateRequest) (*AutoScalingGroup, error) { + if valid, _ := isValidQuotas(ctx, asg.client, clusterID, asur.ProfileID, asur.DesiredCapacity, asur.MaxSize); !valid { + return nil, errors.New("Not enough quotas to update new auto scaling group") + } + + req, err := asg.client.NewRequest(ctx, http.MethodPut, autoScalingServiceName, asg.itemPath(clusterID), &asur) + if err != nil { + return nil, err + } + + resp, err := asg.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &AutoScalingGroup{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +func (p *policy) UpdateLoadBalancers(ctx context.Context, clusterID, PolicyID string, lbpur *LoadBalancersPolicyUpdateRequest) (*TaskResponses, error) { + req, err := p.client.NewRequest(ctx, http.MethodPut, autoScalingServiceName, p.itemPath(clusterID, PolicyID), &lbpur) + if err != nil { + return nil, err + } + + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &TaskResponses{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +func (p *policy) Update(ctx context.Context, clusterID, PolicyID string, pur *PolicyUpdateRequest) (*TaskResponses, error) { + req, err := p.client.NewRequest(ctx, http.MethodPut, autoScalingServiceName, p.itemPath(clusterID, PolicyID), &pur) + if err != nil { + return nil, err + } + + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &TaskResponses{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +// Common +func (c *common) AutoScalingUsingResource(ctx context.Context) (*usingResource, error) { + req, err := c.client.NewRequest(ctx, http.MethodGet, autoScalingServiceName, c.usingResourcePath(), nil) + if err != nil { + return nil, err + } + + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := &usingResource{} + + if err := json.NewDecoder(resp.Body).Decode(data); err != nil { + return nil, err + } + return data, nil +} + +func (c *common) AutoScalingIsValidQuotas(ctx context.Context, clusterID, ProfileID string, desiredCapacity, maxSize int) (bool, error) { + return isValidQuotas(ctx, c.client, clusterID, ProfileID, desiredCapacity, maxSize) +} + +func isValidQuotas(ctx context.Context, client *Client, clusterID, ProfileID string, desiredCapacity, maxSize int) (bool, error) { + payload := map[string]interface{}{ + "desired_capacity": desiredCapacity, + "max_size": maxSize, + "profile_id": ProfileID, + } + + if clusterID != "" { + payload["cluster_id"] = clusterID + } + + req, err := client.NewRequest(ctx, http.MethodPost, autoScalingServiceName, getQuotasResourcePath(), &payload) + if err != nil { + return false, err + } + + resp, err := client.Do(ctx, req) + if err != nil { + return false, err + } + + var data struct { + Quotas autoscalingQuotas `json:"message"` + } + + // data := &map[string]interface{}{} + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return false, err + } + return data.Quotas.Valid, nil +} + +func (c *common) AutoScalingGetSuggestion(ctx context.Context, ProfileID string, desiredCapacity, maxSize int) (interface{}, error) { + return getSuggestion(ctx, c.client, ProfileID, desiredCapacity, maxSize) +} + +// getSuggestion do get suggestion +func getSuggestion(ctx context.Context, client *Client, ProfileID string, desiredCapacity, maxSize int) (interface{}, error) { + payload := map[string]interface{}{ + "desired_capacity": desiredCapacity, + "max_size": maxSize, + "profile_id": ProfileID, + } + + req, err := client.NewRequest(ctx, http.MethodPost, autoScalingServiceName, getSuggestionResourcePath(), &payload) + if err != nil { + return nil, err + } + + resp, err := client.Do(ctx, req) + if err != nil { + return nil, err + } + + data := map[string]interface{}{} + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/cdn.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/cdn.go new file mode 100644 index 000000000000..3c16b2f02fe5 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/cdn.go @@ -0,0 +1,235 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "io" + "io/ioutil" + "net/http" + "net/url" + "strconv" + "strings" +) + +const ( + domainPath = "/domains" + usersPath = "/users" +) + +type cdnService struct { + client *Client +} + +var _ CDNService = (*cdnService)(nil) + +type CDNService interface { + List(ctx context.Context, opts *ListOptions) (*DomainsResp, error) + Get(ctx context.Context, domainID string) (*ExtendedDomain, error) + Create(ctx context.Context, cdrq *CreateDomainReq) (*CreateDomainResp, error) + Update(ctx context.Context, domainID string, udrq *UpdateDomainReq) (*UpdateDomainResp, error) + Delete(ctx context.Context, domainID string) error + DeleteCache(ctx context.Context, domainID string, files *Files) error +} + +type Domain struct { + ID int `json:"id"` + User int `json:"user"` + Certificate int `json:"certificate"` + CName string `json:"cname"` + UpstreamAddrs string `json:"upstream_addrs"` + Slug string `json:"slug"` + PageSpeed int `json:"pagespeed"` + UpstreamProto string `json:"upstream_proto"` + DDOSProtection int `json:"ddos_protection"` + Status string `json:"status"` + CreatedAt string `json:"created_at"` + DomainID string `json:"domain_id"` + Domain string `json:"domain"` + Type string `json:"type"` +} + +type DomainsResp struct { + Domains []Domain `json:"results"` + Next string `json:"next"` + Prev string `json:"prev"` + Pages int `json:"pages"` + Total int `json:"total"` +} + +type OriginAddr struct { + Type string `json:"type"` + Host string `json:"host"` +} + +type ExtendedDomain struct { + Domain + Last24hUsage int `json:"last_24h_usage"` + UpstreamHost string `json:"upstream_host"` + Slug string `json:"slug"` + SecretKey string `json:"secret_key"` + DomainCDN string `json:"domain_cdn"` + OriginAddrs []OriginAddr `json:"origin_addrs"` + HostID string `json:"host_id"` +} + +type CreateDomainReq struct { + Domain string `json:"domain"` + Email string `json:"email,omitempty"` + UpstreamAddrs string `json:"upstream_addrs"` + UpstreamProto string `json:"upstream_proto"` + PageSpeed int `json:"pagespeed"` +} + +type CreateDomainResp struct { + Message string `json:"message"` + Domain Domain `json:"domain"` +} + +type UpdateDomainReq struct { + UpstreamAddrs string `json:"upstream_addrs"` + UpstreamProto string `json:"upstream_proto"` + PageSpeed int `json:"pagespeed"` + SecureLink int `json:"secure_link"` +} + +type UpdateDomainResp struct { + Message string `json:"message"` + Domain ExtendedDomain `json:"domain"` +} + +type CheckConnResp struct { + Status string `json:"status"` +} + +type Files struct { + Files []string `json:"files"` +} + +func (c *cdnService) resourcePath() string { + return domainPath +} + +func (c *cdnService) itemPath(id string) string { + return strings.Join([]string{domainPath, id}, "/") +} + +func (c *cdnService) List(ctx context.Context, opts *ListOptions) (*DomainsResp, error) { + u, _ := url.Parse(strings.Join([]string{usersPath, domainPath}, "")) + query := url.Values{} + if opts.Page != 0 { + query.Add("page", strconv.Itoa(opts.Page)) + } + if opts.Page != 0 { + query.Add("limit", strconv.Itoa(opts.Limit)) + } + u.RawQuery = query.Encode() + req, err := c.client.NewRequest(ctx, http.MethodGet, cdnName, u.String(), nil) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var data *DomainsResp + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (c *cdnService) Get(ctx context.Context, domainID string) (*ExtendedDomain, error) { + req, err := c.client.NewRequest(ctx, http.MethodGet, cdnName, c.itemPath(domainID), nil) + var data struct { + Domain *ExtendedDomain `json:"domain"` + } + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data.Domain, nil +} + +func (c *cdnService) Create(ctx context.Context, cdrq *CreateDomainReq) (*CreateDomainResp, error) { + var data *CreateDomainResp + req, err := c.client.NewRequest(ctx, http.MethodPost, cdnName, c.resourcePath(), &cdrq) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (c *cdnService) Update(ctx context.Context, domainID string, udrq *UpdateDomainReq) (*UpdateDomainResp, error) { + req, err := c.client.NewRequest(ctx, http.MethodPut, cdnName, c.itemPath(domainID), udrq) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + var data *UpdateDomainResp + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (c *cdnService) Delete(ctx context.Context, domainID string) error { + req, err := c.client.NewRequest(ctx, http.MethodDelete, cdnName, c.itemPath(domainID), nil) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + return resp.Body.Close() +} + +func (c *cdnService) DeleteCache(ctx context.Context, domainID string, files *Files) error { + req, err := c.client.NewRequest(ctx, http.MethodDelete, cdnName, c.itemPath(domainID), files) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + return resp.Body.Close() +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/client.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/client.go new file mode 100644 index 000000000000..4d8d8902e2d0 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/client.go @@ -0,0 +1,293 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +// Package gobizfly is the BizFly API client for Go. +package gobizfly + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "net/url" +) + +const ( + defaultAuthType = "token" + version = "0.0.1" + ua = "bizfly-client-go/" + version + defaultAPIURL = "https://manage.bizflycloud.vn/api" + mediaType = "application/json; charset=utf-8" + accountName = "account" + loadBalancerServiceName = "load_balancer" + serverServiceName = "cloud_server" + autoScalingServiceName = "auto_scaling" + cloudwatcherServiceName = "alert" + authServiceName = "auth" + kubernetesServiceName = "kubernetes_engine" + containerRegistryName = "container_registry" + cdnName = "cdn" + dnsName = "dns" +) + +var ( + // ErrNotFound for resource not found status + ErrNotFound = errors.New("Resource not found") + // ErrPermissionDenied for permission denied + ErrPermissionDenied = errors.New("You are not allowed to do this action") + // ErrCommon for common error + ErrCommon = errors.New("Error") +) + +// Client represents BizFly API client. +type Client struct { + AutoScaling AutoScalingService + CloudWatcher CloudWatcherService + Token TokenService + LoadBalancer LoadBalancerService + Listener ListenerService + Pool PoolService + Member MemberService + HealthMonitor HealthMonitorService + KubernetesEngine KubernetesEngineService + ContainerRegistry ContainerRegistryService + CDN CDNService + DNS DNSService + Account AccountService + VPC VPCService + + Snapshot SnapshotService + + Volume VolumeService + Server ServerService + + Service ServiceInterface + Firewall FirewallService + SSHKey SSHKeyService + + httpClient *http.Client + apiURL *url.URL + userAgent string + keystoneToken string + authMethod string + authType string + username string + password string + projectName string + appCredID string + appCredSecret string + // TODO: this will be removed in near future + tenantName string + tenantID string + regionName string + services []*Service +} + +// Option set Client specific attributes +type Option func(c *Client) error + +// WithAPIUrl sets the API url option for BizFly client. +func WithAPIUrl(u string) Option { + return func(c *Client) error { + var err error + c.apiURL, err = url.Parse(u) + return err + } +} + +// WithHTTPClient sets the client option for BizFly client. +func WithHTTPClient(client *http.Client) Option { + return func(c *Client) error { + if client == nil { + return errors.New("client is nil") + } + + c.httpClient = client + + return nil + } +} + +// WithRegionName sets the client region for BizFly client. +func WithRegionName(region string) Option { + return func(c *Client) error { + c.regionName = region + return nil + } +} + +// WithTenantName sets the tenant name option for BizFly client. +// +// Deprecated: X-Tenant-Name header required will be removed in API server. +func WithTenantName(tenant string) Option { + return func(c *Client) error { + c.tenantName = tenant + return nil + } +} + +// WithTenantID sets the tenant id name option for BizFly client +// +// Deprecated: X-Tenant-Id header required will be removed in API server. +func WithTenantID(id string) Option { + return func(c *Client) error { + c.tenantID = id + return nil + } +} + +// NewClient creates new BizFly client. +func NewClient(options ...Option) (*Client, error) { + c := &Client{ + httpClient: http.DefaultClient, + userAgent: ua, + } + + err := WithAPIUrl(defaultAPIURL)(c) + if err != nil { + return nil, err + } + + for _, option := range options { + if err := option(c); err != nil { + return nil, err + } + } + + c.AutoScaling = &autoscalingService{client: c} + c.CloudWatcher = &cloudwatcherService{client: c} + c.Snapshot = &snapshot{client: c} + c.Token = &token{client: c} + c.LoadBalancer = &loadbalancer{client: c} + c.Listener = &listener{client: c} + c.Pool = &pool{client: c} + c.HealthMonitor = &healthmonitor{client: c} + c.Member = &member{client: c} + c.Volume = &volume{client: c} + c.Server = &server{client: c} + c.Service = &service{client: c} + c.Firewall = &firewall{client: c} + c.SSHKey = &sshkey{client: c} + c.KubernetesEngine = &kubernetesEngineService{client: c} + c.ContainerRegistry = &containerRegistry{client: c} + c.CDN = &cdnService{client: c} + c.DNS = &dnsService{client: c} + c.Account = &accountService{client: c} + c.VPC = &vpcService{client: c} + return c, nil +} + +func (c *Client) GetServiceUrl(serviceName string) string { + for _, service := range c.services { + if service.CanonicalName == serviceName && service.Region == c.regionName { + return service.ServiceUrl + } + } + return defaultAPIURL +} + +// NewRequest creates an API request. +func (c *Client) NewRequest(ctx context.Context, method, serviceName string, urlStr string, body interface{}) (*http.Request, error) { + serviceUrl := c.GetServiceUrl(serviceName) + url := serviceUrl + urlStr + + buf := new(bytes.Buffer) + if body != nil { + if err := json.NewEncoder(buf).Encode(body); err != nil { + return nil, err + } + } + req, err := http.NewRequest(method, url, buf) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", mediaType) + req.Header.Add("Accept", mediaType) + req.Header.Add("User-Agent", c.userAgent) + req.Header.Add("X-Tenant-Name", c.tenantName) + req.Header.Add("X-Tenant-Id", c.tenantID) + + if c.authType == "" { + c.authType = defaultAuthType + } + + if c.keystoneToken != "" { + req.Header.Add("X-Auth-Token", c.keystoneToken) + } + + req.Header.Add("X-Auth-Type", c.authType) + return req, nil +} + +func (c *Client) do(ctx context.Context, req *http.Request) (*http.Response, error) { + return c.httpClient.Do(req) +} + +// Do sends API request. +func (c *Client) Do(ctx context.Context, req *http.Request) (resp *http.Response, err error) { + + resp, err = c.do(ctx, req) + if err != nil { + return + } + + // If 401, get new token and retry one time. + if resp.StatusCode == http.StatusUnauthorized { + tok, tokErr := c.Token.Refresh(ctx) + if tokErr != nil { + buf, _ := ioutil.ReadAll(resp.Body) + err = fmt.Errorf("%s : %w", string(buf), tokErr) + return + } + c.SetKeystoneToken(tok.KeystoneToken) + req.Header.Set("X-Auth-Token", c.keystoneToken) + resp, err = c.do(ctx, req) + } + if resp.StatusCode >= http.StatusBadRequest { + defer resp.Body.Close() + buf, _ := ioutil.ReadAll(resp.Body) + err = errorFromStatus(resp.StatusCode, string(buf)) + + } + return +} + +// SetKeystoneToken sets keystone token value, which will be used for authentication. +func (c *Client) SetKeystoneToken(s string) { + c.keystoneToken = s +} + +// ListOptions specifies the optional parameters for List method. +type ListOptions struct { + Page int `json:"page,omitempty"` + Limit int `json:"limit,omitempty"` +} + +func errorFromStatus(code int, msg string) error { + switch code { + case http.StatusNotFound: + return fmt.Errorf("%s: %w", msg, ErrNotFound) + case http.StatusForbidden: + return fmt.Errorf("%s: %w", msg, ErrPermissionDenied) + default: + return fmt.Errorf("%s: %w", msg, ErrCommon) + } +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/common.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/common.go new file mode 100644 index 000000000000..fd8e06f11974 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/common.go @@ -0,0 +1,36 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +// SliceContains - Check data in slice +func SliceContains(slice interface{}, val interface{}) (int, bool) { + switch v := slice.(type) { + case string: + if slice == val { + return 1, true + } + return -1, false + default: + for i, item := range v.([]string) { + if item == val { + return i, true + } + } + return -1, false + } +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/container_registry.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/container_registry.go new file mode 100644 index 000000000000..ff59a32506e2 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/container_registry.go @@ -0,0 +1,219 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + +const ( + registryPath = "/_" +) + +type containerRegistry struct { + client *Client +} + +var _ ContainerRegistryService = (*containerRegistry)(nil) + +type ContainerRegistryService interface { + List(ctx context.Context, opts *ListOptions) ([]*Repository, error) + Create(ctx context.Context, crpl *createRepositoryPayload) error + Delete(ctx context.Context, repositoryName string) error + GetTags(ctx context.Context, repositoryName string) (*TagRepository, error) + EditRepo(ctx context.Context, repositoryName string, erpl *editRepositoryPayload) error + DeleteTag(ctx context.Context, tagName string, repositoryName string) error + GetTag(ctx context.Context, repositoryName string, tagName string, vulnerabilities string) (*Image, error) +} + +type Repository struct { + Name string `json:"name"` + LastPush string `json:"last_push"` + Pulls int `json:"pulls"` + Public bool `json:"public"` + CreatedAt string `json:"created_at"` +} + +type Repositories struct { + Repositories []Repository `json:"repositories"` +} + +type createRepositoryPayload struct { + Name string `json:"name"` + Public bool `json:"public"` +} + +type RepositoryTag struct { + Name string `json:"name"` + Author string `json:"author"` + LastUpdated string `json:"last_updated"` + CreatedAt string `json:"created_at"` + LastScan string `json:"last_scan"` + ScanStatus string `json:"scan_status"` + Vulnerabilities int `json:"vulnerabilities"` + Fixes int `json:"fixes"` +} + +type editRepositoryPayload struct { + Public bool `json:"public"` +} + +type Vulnerability struct { + Package string `json:"package"` + Name string `json:"name"` + Namespace string `json:"namespace"` + Description string `json:"description"` + Link string `json:"link"` + Severity string `json:"severity"` + FixedBy string `json:"fixed_by"` +} + +type Image struct { + Repository Repository `json:"repository"` + Tag RepositoryTag `json:"tag"` + Vulnerabilities []Vulnerability `json:"vulnerabilities"` +} + +type TagRepository struct { + Repository Repository `json:"repository"` + Tags []RepositoryTag `json:"tags"` +} + +func (c *containerRegistry) resourcePath() string { + return registryPath +} + +func (c *containerRegistry) itemPath(id string) string { + return strings.Join([]string{registryPath, id}, "/") +} + +func (c *containerRegistry) List(ctx context.Context, opts *ListOptions) ([]*Repository, error) { + req, err := c.client.NewRequest(ctx, http.MethodGet, containerRegistryName, c.resourcePath(), nil) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var data struct { + Repositories []*Repository `json:"repositories"` + } + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data.Repositories, nil +} + +func (c *containerRegistry) Create(ctx context.Context, crpl *createRepositoryPayload) error { + req, err := c.client.NewRequest(ctx, http.MethodPost, containerRegistryName, c.resourcePath(), &crpl) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + return resp.Body.Close() +} + +func (c *containerRegistry) Delete(ctx context.Context, repositoryName string) error { + req, err := c.client.NewRequest(ctx, http.MethodDelete, containerRegistryName, c.itemPath(repositoryName), nil) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + return resp.Body.Close() +} + +func (c *containerRegistry) GetTags(ctx context.Context, repositoryName string) (*TagRepository, error) { + var data *TagRepository + req, err := c.client.NewRequest(ctx, http.MethodGet, containerRegistryName, strings.Join([]string{registryPath, repositoryName}, "/"), nil) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (c *containerRegistry) EditRepo(ctx context.Context, repositoryName string, erpl *editRepositoryPayload) error { + req, err := c.client.NewRequest(ctx, http.MethodPatch, containerRegistryName, strings.Join([]string{registryPath, repositoryName}, "/"), erpl) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + return resp.Body.Close() +} + +func (c *containerRegistry) DeleteTag(ctx context.Context, repositoryName string, tagName string) error { + req, err := c.client.NewRequest(ctx, http.MethodDelete, containerRegistryName, strings.Join([]string{registryPath, repositoryName, "tag", tagName}, "/"), nil) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + return resp.Body.Close() +} + +func (c *containerRegistry) GetTag(ctx context.Context, repositoryName string, tagName string, vulnerabilities string) (*Image, error) { + var data *Image + u, _ := url.Parse(strings.Join([]string{registryPath, repositoryName, "tag", tagName}, "/")) + if vulnerabilities != "" { + query := url.Values{ + "vulnerabilities": {vulnerabilities}, + } + u.RawQuery = query.Encode() + + } + req, err := c.client.NewRequest(ctx, http.MethodGet, containerRegistryName, u.String(), nil) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/dns.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/dns.go new file mode 100644 index 000000000000..6b1819ab1aec --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/dns.go @@ -0,0 +1,298 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "net/http" + "strings" +) + +const ( + zonePath = "/zones" + recordPath = "/record" +) + +type dnsService struct { + client *Client +} + +var _ DNSService = (*dnsService)(nil) + +type DNSService interface { + ListZones(ctx context.Context, opts *ListOptions) (*ListZoneResp, error) + CreateZone(ctx context.Context, czpl *createZonePayload) (*ExtendedZone, error) + GetZone(ctx context.Context, zoneID string) (*ExtendedZone, error) + DeleteZone(ctx context.Context, zoneID string) error + CreateRecord(ctx context.Context, zoneID string, crpl *CreateRecordPayload) (*Record, error) + GetRecord(ctx context.Context, recordID string) (*Record, error) + UpdateRecord(ctx context.Context, recordID string, urpl *UpdateRecordPayload) (*ExtendedRecord, error) + DeleteRecord(ctx context.Context, recordID string) error +} + +type Zone struct { + ID string `json:"id"` + Name string `json:"name"` + Deleted int `json:"deleted"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + TenantId string `json:"tenant_id"` + NameServer []string `json:"nameserver"` + TTL int `json:"ttl"` + Active bool `json:"active"` + RecordsSet []string `json:"records_set"` +} + +type ExtendedZone struct { + Zone + RecordsSet []RecordSet `json:"records_set"` +} + +type RecordSet struct { + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + TTL int `json:"ttl"` + Data []string `json:"data"` + RoutingPolicyData RoutingPolicyData `json:"routing_policy_data"` +} +type Meta struct { + MaxResults int `json:"max_results"` + Total int `json:"total"` + Page int `json:"page"` +} + +type ListZoneResp struct { + Zones []Zone `json:"zones"` + Meta Meta `json:"_meta"` +} + +type createZonePayload struct { + Name string `json:"name"` + Required bool `json:"required,omitempty"` + Description string `json:"description,omitempty"` +} + +type Addrs struct { + HN []string `json:"HN"` + HCM []string `json:"HCM"` + SG []string `json:"SG"` + USA []string `json:"USA"` +} +type RoutingData struct { + AddrsV4 Addrs `json:"addrs_v4"` + AddrsV6 Addrs `json:"addrs_v6"` +} + +type RoutingPolicyData struct { + RoutingData RoutingData `json:"routing_data,omitempty"` + HealthCheck struct { + TCPConnect struct { + TCPPort int `json:"tcp_port"` + } `json:"tcp_connect,omitempty"` + HTTPStatus struct { + HTTPPort int `json:"http_port"` + URLPath string `json:"url_path"` + VHost string `json:"vhost"` + OkCodes []int `json:"ok_codes"` + Interval int `json:"internal"` + } `json:"http_status,omitempty"` + } `json:"healthcheck,omitempty"` +} + +type CreateRecordPayload struct { + Name string `json:"name"` + Type string `json:"type"` + TTL int `json:"ttl"` + Data []string `json:"data"` + RoutingPolicyData RoutingPolicyData `json:"routing_policy_data"` +} + +type RecordData struct { + Value string `json:"value"` + Priority int `json:"priority"` +} +type UpdateRecordPayload struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + TTL int `json:"ttl,omitempty"` + Data []RecordData `json:"data,omitempty"` + RoutingPolicyData RoutingPolicyData `json:"routing_policy_data,omitempty"` +} + +type Record struct { + ID string `json:"id"` + Name string `json:"name"` + Delete int `json:"deleted"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + TenantID string `json:"tenant_id"` + ZoneID string `json:"zone_id"` + Type string `json:"type"` + TTL int `json:"ttl"` + Data []string `json:"data"` + RoutingPolicyData RoutingPolicyData `json:"routing_policy_data"` +} + +type ExtendedRecord struct { + Record + Data []RecordData `json:"data"` +} + +type Records struct { + Records []Record `json:"records"` +} + +func (d dnsService) resourcePath() string { + return zonePath +} + +func (d dnsService) zoneItemPath(id string) string { + return strings.Join([]string{zonePath, id}, "/") +} + +func (d dnsService) recordItemPath(id string) string { + return strings.Join([]string{recordPath, id}, "/") +} + +func (d *dnsService) ListZones(ctx context.Context, opts *ListOptions) (*ListZoneResp, error) { + req, err := d.client.NewRequest(ctx, http.MethodGet, dnsName, d.resourcePath(), nil) + if err != nil { + return nil, err + } + resp, err := d.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var data *ListZoneResp + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (d *dnsService) CreateZone(ctx context.Context, czpl *createZonePayload) (*ExtendedZone, error) { + req, err := d.client.NewRequest(ctx, http.MethodPost, dnsName, d.resourcePath(), czpl) + if err != nil { + return nil, err + } + resp, err := d.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var data *ExtendedZone + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (d *dnsService) GetZone(ctx context.Context, zoneID string) (*ExtendedZone, error) { + req, err := d.client.NewRequest(ctx, http.MethodGet, dnsName, d.zoneItemPath(zoneID), nil) + if err != nil { + return nil, err + } + resp, err := d.client.Do(ctx, req) + var data *ExtendedZone + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (d *dnsService) DeleteZone(ctx context.Context, zoneID string) error { + req, err := d.client.NewRequest(ctx, http.MethodDelete, dnsName, d.zoneItemPath(zoneID), nil) + if err != nil { + return err + } + resp, err := d.client.Do(ctx, req) + if err != nil { + return err + } + return resp.Body.Close() +} + +func (d *dnsService) CreateRecord(ctx context.Context, zoneID string, crpl *CreateRecordPayload) (*Record, error) { + req, err := d.client.NewRequest(ctx, http.MethodPost, dnsName, strings.Join([]string{d.zoneItemPath(zoneID), "record"}, "/"), crpl) + if err != nil { + return nil, err + } + resp, err := d.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var data *Record + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (d *dnsService) GetRecord(ctx context.Context, recordID string) (*Record, error) { + req, err := d.client.NewRequest(ctx, http.MethodGet, dnsName, d.recordItemPath(recordID), nil) + if err != nil { + return nil, err + } + resp, err := d.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var data *Record + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (d *dnsService) UpdateRecord(ctx context.Context, recordID string, urpl *UpdateRecordPayload) (*ExtendedRecord, error) { + req, err := d.client.NewRequest(ctx, http.MethodPut, dnsName, d.recordItemPath(recordID), urpl) + if err != nil { + return nil, err + } + resp, err := d.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var data *ExtendedRecord + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (d *dnsService) DeleteRecord(ctx context.Context, recordID string) error { + req, err := d.client.NewRequest(ctx, http.MethodDelete, dnsName, d.recordItemPath(recordID), nil) + if err != nil { + return err + } + resp, err := d.client.Do(ctx, req) + if err != nil { + return err + } + return resp.Body.Close() +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/firewall.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/firewall.go new file mode 100644 index 000000000000..fe1ce7b80475 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/firewall.go @@ -0,0 +1,301 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "net/http" + "strings" +) + +const ( + firewallBasePath = "/firewalls" +) + +var _ FirewallService = (*firewall)(nil) + +type firewall struct { + client *Client +} + +type BaseFirewall struct { + ID string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + Tags []string `json:"tags"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + RevisionNumber int `json:"revision_number"` + ProjectID string `json:"project_id"` + ServersCount int `json:"servers_count"` + RulesCount int `json:"rules_count"` + InBound []FirewallRule `json:"inbound"` + OutBound []FirewallRule `json:"outbound"` +} + +type Firewall struct { + BaseFirewall + Servers []string `json:"servers"` +} + +type FirewallDetail struct { + BaseFirewall + Servers []*Server `json:"servers"` +} + +type FirewallRule struct { + ID string `json:"id"` + FirewallID string `json:"security_group_id"` + EtherType string `json:"ethertype"` + Direction string `json:"direction"` + Protocol string `json:"protocol"` + PortRangeMin int `json:"port_range_min"` + PortRangeMax int `json:"port_range_max"` + RemoteIPPrefix string `json:"remote_ip_prefix"` + Description string `json:"description"` + Tags []string `json:"tags"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + RevisionNumber int `json:"revision_number"` + ProjectID string `json:"project_id"` + Type string `json:"type"` + CIDR string `json:"cidr"` + PortRange string `json:"port_range"` +} + +type FirewallRuleCreateRequest struct { + Type string `json:"type"` + Protocol string `json:"protocol"` + PortRange string `json:"port_range"` + CIDR string `json:"cidr"` +} + +type FirewallSingleRuleCreateRequest struct { + FirewallRuleCreateRequest + Direction string `json:"direction"` +} + +type FirewallRequestPayload struct { + Name string `json:"name"` + InBound []FirewallRuleCreateRequest `json:"inbound,omitempty"` + OutBound []FirewallRuleCreateRequest `json:"outbound,omitempty"` + Targets []string `json:"targets,omitempty"` +} + +type FirewallDeleteResponse struct { + Message string `json:"message"` +} + +type FirewallRemoveServerRequest struct { + Servers []string `json:"servers"` +} + +type FirewallRuleCreateResponse struct { + Rule FirewallRule `json:"security_group_rule"` +} + +type FirewallService interface { + List(ctx context.Context, opts *ListOptions) ([]*Firewall, error) + Create(ctx context.Context, fcr *FirewallRequestPayload) (*FirewallDetail, error) + Get(ctx context.Context, id string) (*FirewallDetail, error) + Delete(ctx context.Context, id string) (*FirewallDeleteResponse, error) + RemoveServer(ctx context.Context, id string, rsfr *FirewallRemoveServerRequest) (*Firewall, error) + Update(ctx context.Context, id string, ufr *FirewallRequestPayload) (*FirewallDetail, error) + DeleteRule(ctx context.Context, id string) (*FirewallDeleteResponse, error) + CreateRule(ctx context.Context, fwID string, fsrcr *FirewallSingleRuleCreateRequest) (*FirewallRule, error) +} + +// List lists all firewall. +func (f *firewall) List(ctx context.Context, opts *ListOptions) ([]*Firewall, error) { + + req, err := f.client.NewRequest(ctx, http.MethodGet, serverServiceName, firewallBasePath, nil) + if err != nil { + return nil, err + } + + resp, err := f.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var firewalls []*Firewall + + if err := json.NewDecoder(resp.Body).Decode(&firewalls); err != nil { + return nil, err + } + + return firewalls, nil +} + +// Create a firewall. +func (f *firewall) Create(ctx context.Context, fcr *FirewallRequestPayload) (*FirewallDetail, error) { + + req, err := f.client.NewRequest(ctx, http.MethodPost, serverServiceName, firewallBasePath, fcr) + if err != nil { + return nil, err + } + + resp, err := f.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var firewall *FirewallDetail + + if err := json.NewDecoder(resp.Body).Decode(&firewall); err != nil { + return nil, err + } + + return firewall, nil +} + +// Get detail a firewall. +func (f *firewall) Get(ctx context.Context, id string) (*FirewallDetail, error) { + + req, err := f.client.NewRequest(ctx, http.MethodGet, serverServiceName, firewallBasePath+"/"+id, nil) + if err != nil { + return nil, err + } + + resp, err := f.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var firewall *FirewallDetail + + if err := json.NewDecoder(resp.Body).Decode(&firewall); err != nil { + return nil, err + } + + return firewall, nil +} + +// Remove servers from a firewall. +func (f *firewall) RemoveServer(ctx context.Context, id string, rsfr *FirewallRemoveServerRequest) (*Firewall, error) { + + req, err := f.client.NewRequest(ctx, http.MethodDelete, serverServiceName, strings.Join([]string{firewallBasePath, id, "servers"}, "/"), rsfr) + + if err != nil { + return nil, err + } + + resp, err := f.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var firewall *Firewall + + if err := json.NewDecoder(resp.Body).Decode(&firewall); err != nil { + return nil, err + } + + return firewall, nil +} + +// Update Firewall +func (f *firewall) Update(ctx context.Context, id string, ufr *FirewallRequestPayload) (*FirewallDetail, error) { + + req, err := f.client.NewRequest(ctx, http.MethodPatch, serverServiceName, firewallBasePath+"/"+id, ufr) + + if err != nil { + return nil, err + } + + resp, err := f.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var firewall *FirewallDetail + + if err := json.NewDecoder(resp.Body).Decode(&firewall); err != nil { + return nil, err + } + + return firewall, nil +} + +// Delete a Firewall +func (f *firewall) Delete(ctx context.Context, id string) (*FirewallDeleteResponse, error) { + + req, err := f.client.NewRequest(ctx, http.MethodDelete, serverServiceName, firewallBasePath+"/"+id, nil) + + if err != nil { + return nil, err + } + + resp, err := f.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var dwr *FirewallDeleteResponse + + if err := json.NewDecoder(resp.Body).Decode(&dwr); err != nil { + return nil, err + } + + return dwr, nil +} + +// Delete a rule in a firewall +func (f *firewall) DeleteRule(ctx context.Context, id string) (*FirewallDeleteResponse, error) { + req, err := f.client.NewRequest(ctx, http.MethodDelete, serverServiceName, firewallBasePath+"/"+id, nil) + + if err != nil { + return nil, err + } + + resp, err := f.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var dwr *FirewallDeleteResponse + + if err := json.NewDecoder(resp.Body).Decode(&dwr); err != nil { + return nil, err + } + + return dwr, nil +} + +// Create a new rule in a firewall +func (f *firewall) CreateRule(ctx context.Context, fwID string, fsrcr *FirewallSingleRuleCreateRequest) (*FirewallRule, error) { + req, err := f.client.NewRequest(ctx, http.MethodPost, serverServiceName, strings.Join([]string{firewallBasePath, fwID, "rules"}, "/"), fsrcr) + if err != nil { + return nil, err + } + + resp, err := f.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var firewallRuleCreateResponse struct { + Rule *FirewallRule `json:"security_group_rule"` + } + + if err := json.NewDecoder(resp.Body).Decode(&firewallRuleCreateResponse); err != nil { + return nil, err + } + return firewallRuleCreateResponse.Rule, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.mod b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.mod new file mode 100644 index 000000000000..eddfbe88a702 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.mod @@ -0,0 +1,5 @@ +module github.com/bizflycloud/gobizfly + +go 1.13 + +require github.com/stretchr/testify v1.4.0 diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.sum b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.sum new file mode 100644 index 000000000000..8fdee5854f19 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.sum @@ -0,0 +1,11 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/kubernetes.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/kubernetes.go new file mode 100644 index 000000000000..39ba6fdcf767 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/kubernetes.go @@ -0,0 +1,342 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "log" + "net/http" + "strings" +) + +const ( + clusterPath = "/_" + kubeConfig = "kubeconfig" +) + +var _ KubernetesEngineService = (*kubernetesEngineService)(nil) + +type kubernetesEngineService struct { + client *Client +} + +type KubernetesEngineService interface { + List(ctx context.Context, opts *ListOptions) ([]*Cluster, error) + Create(ctx context.Context, req *ClusterCreateRequest) (*ExtendedCluster, error) + Get(ctx context.Context, id string) (*FullCluster, error) + Delete(ctx context.Context, id string) error + AddWorkerPools(ctx context.Context, id string, awp *AddWorkerPoolsRequest) ([]*ExtendedWorkerPool, error) + RecycleNode(ctx context.Context, clusterUID string, PoolID string, NodePhysicalID string) error + DeleteClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string) error + GetClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string) (*WorkerPoolWithNodes, error) + UpdateClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string, uwp *UpdateWorkerPoolRequest) error + DeleteClusterWorkerPoolNode(ctx context.Context, clusterUID string, PoolID string, NodeID string) error + GetKubeConfig(ctx context.Context, clusterUID string) (string, error) +} + +type WorkerPool struct { + Name string `json:"name" yaml:"name"` + Version string `json:"version,omitempty" yaml:"version,omitempty"` + Flavor string `json:"flavor" yaml:"flavor"` + ProfileType string `json:"profile_type" yaml:"profile_type"` + VolumeType string `json:"volume_type" yaml:"volume_type"` + VolumeSize int `json:"volume_size" yaml:"volume_size"` + AvailabilityZone string `json:"availability_zone" yaml:"availability_zone"` + DesiredSize int `json:"desired_size" yaml:"desired_size"` + EnableAutoScaling bool `json:"enable_autoscaling,omitempty" yaml:"enable_autoscaling,omitempty"` + MinSize int `json:"min_size,omitempty" yaml:"min_size,omitempty"` + MaxSize int `json:"max_size,omitempty" yaml:"max_size,omitempty"` + Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"` +} + +type ControllerVersion struct { + ID string `json:"id,omitempty" yaml:"id,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Description string `json:"description" yaml:"description"` + K8SVersion string `json:"kubernetes_version" yaml:"kubernetes_version"` +} + +type Clusters struct { + Clusters_ []Cluster `json:"clusters" yaml:"clusters"` +} + +type Cluster struct { + UID string `json:"uid" yaml:"uid"` + Name string `json:"name" yaml:"name"` + Version ControllerVersion `json:"version" yaml:"version"` + VPCNetworkID string `json:"private_network_id" yaml:"private_network_id"` + AutoUpgrade bool `json:"auto_upgrade" yaml:"auto_upgrade"` + Tags []string `json:"tags" yaml:"tags"` + ProvisionStatus string `json:"provision_status" yaml:"provision_status"` + ClusterStatus string `json:"cluster_status" yaml:"cluster_status"` + CreatedAt string `json:"created_at" yaml:"created_at"` + CreatedBy string `json:"created_by" yaml:"created_by"` + WorkerPoolsCount int `json:"worker_pools_count" yaml:"worker_pools_count"` +} + +type ExtendedCluster struct { + Cluster + WorkerPools []ExtendedWorkerPool `json:"worker_pools" yaml:"worker_pools"` +} + +type ClusterStat struct { + WorkerPoolCount int `json:"worker_pools" yaml:"worker_pools"` + TotalCPU int `json:"total_cpu" yaml:"total_cpu"` + TotalMemory int `json:"total_memory" yaml:"total_memory"` +} + +type FullCluster struct { + ExtendedCluster + Stat ClusterStat `json:"stat" yaml:"stat"` +} + +type ExtendedWorkerPool struct { + WorkerPool + UID string `json:"id" yaml:"id"` + ProvisionStatus string `json:"provision_status" yaml:"provision_status"` + LaunchConfigID string `json:"launch_config_id" yaml:"launch_config_id"` + AutoScalingGroupID string `json:"autoscaling_group_id" yaml:"autoscaling_group_id"` + CreatedAt string `json:"created_at" yaml:"created_at"` +} + +type ExtendedWorkerPools struct { + WorkerPools []ExtendedWorkerPool `json:"worker_pools" yaml:"worker_pools"` +} + +type ClusterCreateRequest struct { + Name string `json:"name" yaml:"name"` + Version string `json:"version" yaml:"version"` + AutoUpgrade bool `json:"auto_upgrade,omitempty" yaml:"auto_upgrade,omitempty"` + VPCNetworkID string `json:"private_network_id" yaml:"private_network_id"` + EnableCloud bool `json:"enable_cloud,omitempty" yaml:"enable_cloud,omitempty"` + Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"` + WorkerPools []WorkerPool `json:"worker_pools" yaml:"worker_pools"` +} + +type AddWorkerPoolsRequest struct { + WorkerPools []WorkerPool `json:"worker_pools" yaml:"worker_pools"` +} + +type PoolNode struct { + ID string `json:"id" yaml:"id"` + Name string `json:"name" yaml:"name"` + PhysicalID string `json:"physical_id" yaml:"physical_id"` + IPAddresses []string `json:"ip_addresses" yaml:"ip_addresses"` + Status string `json:"status" yaml:"status"` + StatusReason string `json:"status_reason" yaml:"status_reason"` +} + +type WorkerPoolWithNodes struct { + ExtendedWorkerPool + Nodes []PoolNode `json:"nodes" yaml:"nodes"` +} + +type UpdateWorkerPoolRequest struct { + DesiredSize int `json:"desired_size,omitempty" yaml:"desired_size,omitempty"` + EnableAutoScaling bool `json:"enable_autoscaling,omitempty" yaml:"enable_autoscaling,omitempty"` + MinSize int `json:"min_size,omitempty" yaml:"min_size,omitempty"` + MaxSize int `json:"max_size,omitempty" yaml:"max_size,omitempty"` +} + +func (c *kubernetesEngineService) resourcePath() string { + return clusterPath + "/" +} + +func (c *kubernetesEngineService) itemPath(id string) string { + return strings.Join([]string{clusterPath, id}, "/") +} + +func (c *kubernetesEngineService) List(ctx context.Context, opts *ListOptions) ([]*Cluster, error) { + req, err := c.client.NewRequest(ctx, http.MethodGet, kubernetesServiceName, c.resourcePath(), nil) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var data struct { + Clusters []*Cluster `json:"clusters" yaml:"clusters"` + } + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data.Clusters, nil +} + +func (c *kubernetesEngineService) Create(ctx context.Context, clcr *ClusterCreateRequest) (*ExtendedCluster, error) { + var data struct { + Cluster *ExtendedCluster `json:"cluster" yaml:"cluster"` + } + req, err := c.client.NewRequest(ctx, http.MethodPost, kubernetesServiceName, c.resourcePath(), &clcr) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data.Cluster, nil +} + +func (c *kubernetesEngineService) Get(ctx context.Context, id string) (*FullCluster, error) { + var cluster *FullCluster + req, err := c.client.NewRequest(ctx, http.MethodGet, kubernetesServiceName, c.itemPath(id), nil) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&cluster); err != nil { + return nil, err + } + return cluster, nil +} + +func (c *kubernetesEngineService) Delete(ctx context.Context, id string) error { + req, err := c.client.NewRequest(ctx, http.MethodDelete, kubernetesServiceName, c.itemPath(id), nil) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + + if err != nil { + fmt.Println("error send req") + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + return resp.Body.Close() +} + +func (c *kubernetesEngineService) AddWorkerPools(ctx context.Context, id string, awp *AddWorkerPoolsRequest) ([]*ExtendedWorkerPool, error) { + req, err := c.client.NewRequest(ctx, http.MethodPost, kubernetesServiceName, c.itemPath(id), &awp) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var respData struct { + Pools []*ExtendedWorkerPool `json:"worker_pools" yaml:"worker_pools"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.Pools, nil +} + +func (c *kubernetesEngineService) RecycleNode(ctx context.Context, clusterUID string, poolID string, nodePhysicalID string) error { + req, err := c.client.NewRequest(ctx, http.MethodPut, kubernetesServiceName, strings.Join([]string{clusterPath, clusterUID, poolID, nodePhysicalID}, "/"), nil) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + return resp.Body.Close() +} + +func (c *kubernetesEngineService) DeleteClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string) error { + req, err := c.client.NewRequest(ctx, http.MethodDelete, kubernetesServiceName, strings.Join([]string{clusterPath, clusterUID, PoolID}, "/"), nil) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + return resp.Body.Close() +} + +func (c *kubernetesEngineService) GetClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string) (*WorkerPoolWithNodes, error) { + var pool *WorkerPoolWithNodes + req, err := c.client.NewRequest(ctx, http.MethodGet, kubernetesServiceName, strings.Join([]string{clusterPath, clusterUID, PoolID}, "/"), nil) + if err != nil { + return nil, err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&pool); err != nil { + return nil, err + } + return pool, nil +} + +func (c *kubernetesEngineService) UpdateClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string, uwp *UpdateWorkerPoolRequest) error { + req, err := c.client.NewRequest(ctx, http.MethodPatch, kubernetesServiceName, strings.Join([]string{clusterPath, clusterUID, PoolID}, "/"), &uwp) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + return resp.Body.Close() +} + +func (c *kubernetesEngineService) DeleteClusterWorkerPoolNode(ctx context.Context, clusterUID string, PoolID string, NodeID string) error { + req, err := c.client.NewRequest(ctx, http.MethodDelete, kubernetesServiceName, strings.Join([]string{clusterPath, clusterUID, PoolID, NodeID}, "/"), nil) + if err != nil { + return err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + return resp.Body.Close() +} + +func (c *kubernetesEngineService) GetKubeConfig(ctx context.Context, clusterUID string) (string, error) { + req, err := c.client.NewRequest(ctx, http.MethodGet, kubernetesServiceName, strings.Join([]string{c.itemPath(clusterUID), kubeConfig}, "/"), nil) + if err != nil { + return "", err + } + resp, err := c.client.Do(ctx, req) + if err != nil { + return "", nil + } + defer resp.Body.Close() + bodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + log.Fatal(err) + } + bodyString := string(bodyBytes) + return bodyString, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/loadbalancer.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/loadbalancer.go new file mode 100644 index 000000000000..56685da0fb08 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/loadbalancer.go @@ -0,0 +1,887 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "io" + "io/ioutil" + "net/http" + "strings" +) + +const ( + loadBalancersPath = "/loadbalancers" + loadBalancerResourcePath = "/loadbalancer" + listenerPath = "/listener" + poolPath = "/pool" + healthMonitorPath = "/healthmonitor" +) + +var _ LoadBalancerService = (*loadbalancer)(nil) + +type resourceID struct { + ID string +} + +// LoadBalancerService is an interface to interact with BizFly API Load Balancers endpoint. +type LoadBalancerService interface { + List(ctx context.Context, opts *ListOptions) ([]*LoadBalancer, error) + Create(ctx context.Context, req *LoadBalancerCreateRequest) (*LoadBalancer, error) + Get(ctx context.Context, id string) (*LoadBalancer, error) + Update(ctx context.Context, id string, req *LoadBalancerUpdateRequest) (*LoadBalancer, error) + Delete(ctx context.Context, req *LoadBalancerDeleteRequest) error +} + +// LoadBalancerCreateRequest represents create new load balancer request payload. +type LoadBalancerCreateRequest struct { + Description string `json:"description,omitempty"` + Type string `json:"type"` + Listeners []string `json:"listeners,omitempty"` + Name string `json:"name"` + NetworkType string `json:"network_type"` +} + +// LoadBalancerUpdateRequest represents update load balancer request payload. +type LoadBalancerUpdateRequest struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + AdminStateUp *bool `json:"admin_state_up,omitempty"` +} + +// LoadBalancerDeleteRequest represents delete load balancer request payload. +type LoadBalancerDeleteRequest struct { + Cascade bool `json:"cascade"` + ID string `json:"loadbalancer_id"` +} + +// LoadBalancer contains load balancer information. +type LoadBalancer struct { + ID string `json:"id"` + FlavorID string `json:"flavor_id"` + Description string `json:"description"` + Provider string `json:"provider"` + UpdatedAt string `json:"updated_at"` + Listeners []resourceID `json:"listeners"` + VipSubnetID string `json:"vip_subnet_id"` + ProjectID string `json:"project_id"` + VipQosPolicyID string `json:"vip_qos_policy_id"` + VipNetworkID string `json:"vip_network_id"` + NetworkType string `json:"network_type"` + VipAddress string `json:"vip_address"` + VipPortID string `json:"vip_port_id"` + AdminStateUp bool `json:"admin_state_up"` + Name string `json:"name"` + OperatingStatus string `json:"operating_status"` + ProvisioningStatus string `json:"provisioning_status"` + Pools []resourceID `json:"pools"` + Type string `json:"type"` + TenantID string `json:"tenant_id"` + CreatedAt string `json:"created_at"` +} + +type loadbalancer struct { + client *Client +} + +func (l *loadbalancer) resourcePath() string { + return loadBalancersPath +} + +func (l *loadbalancer) itemPath(id string) string { + return strings.Join([]string{loadBalancerResourcePath, id}, "/") +} + +func (l *loadbalancer) List(ctx context.Context, opts *ListOptions) ([]*LoadBalancer, error) { + req, err := l.client.NewRequest(ctx, http.MethodGet, loadBalancerServiceName, l.resourcePath(), nil) + if err != nil { + return nil, err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + LoadBalancers []*LoadBalancer `json:"loadbalancers"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.LoadBalancers, nil +} + +func (l *loadbalancer) Create(ctx context.Context, lbcr *LoadBalancerCreateRequest) (*LoadBalancer, error) { + var data struct { + LoadBalancer *LoadBalancerCreateRequest `json:"loadbalancer"` + } + data.LoadBalancer = lbcr + req, err := l.client.NewRequest(ctx, http.MethodPost, loadBalancerServiceName, l.resourcePath(), &data) + if err != nil { + return nil, err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData struct { + LoadBalancer *LoadBalancer `json:"loadbalancer"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.LoadBalancer, nil +} + +func (l *loadbalancer) Get(ctx context.Context, id string) (*LoadBalancer, error) { + req, err := l.client.NewRequest(ctx, http.MethodGet, loadBalancerServiceName, l.itemPath(id), nil) + if err != nil { + return nil, err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + lb := &LoadBalancer{} + if err := json.NewDecoder(resp.Body).Decode(lb); err != nil { + return nil, err + } + return lb, nil +} + +func (l *loadbalancer) Update(ctx context.Context, id string, lbur *LoadBalancerUpdateRequest) (*LoadBalancer, error) { + var data struct { + LoadBalancer *LoadBalancerUpdateRequest `json:"loadbalancer"` + } + data.LoadBalancer = lbur + req, err := l.client.NewRequest(ctx, http.MethodPut, loadBalancerServiceName, l.itemPath(id), &data) + if err != nil { + return nil, err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData struct { + LoadBalancer *LoadBalancer `json:"loadbalancer"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.LoadBalancer, nil +} + +func (l *loadbalancer) Delete(ctx context.Context, lbdr *LoadBalancerDeleteRequest) error { + req, err := l.client.NewRequest(ctx, http.MethodDelete, loadBalancerServiceName, l.itemPath(lbdr.ID), lbdr) + if err != nil { + return err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +var _ ListenerService = (*listener)(nil) + +// ListenerService is an interface to interact with BizFly API Listeners endpoint. +type ListenerService interface { + List(ctx context.Context, loadBalancerID string, opts *ListOptions) ([]*Listener, error) + Create(ctx context.Context, loadBalancerID string, req *ListenerCreateRequest) (*Listener, error) + Get(ctx context.Context, id string) (*Listener, error) + Update(ctx context.Context, id string, req *ListenerUpdateRequest) (*Listener, error) + Delete(ctx context.Context, id string) error +} + +// ListenerCreateRequest represents create new listener request payload. +type ListenerCreateRequest struct { + TimeoutTCPInspect *int `json:"timeout_tcp_inspect,omitempty"` + TimeoutMemberData *int `json:"timeout_member_data,omitempty"` + TimeoutMemberConnect *int `json:"timeout_member_connect,omitempty"` + TimeoutClientData *int `json:"timeout_client_data,omitempty"` + SNIContainerRefs *[]string `json:"sni_container_refs,omitempty"` + ProtocolPort int `json:"protocol_port"` + Protocol string `json:"protocol"` + Name *string `json:"name,omitempty"` + L7Policies *[]resourceID `json:"l7policies,omitempty"` + InsertHeaders *map[string]string `json:"insert_headers,omitempty"` + Description *string `json:"description,omitempty"` + DefaultTLSContainerRef *string `json:"default_tls_container_ref,omitempty"` + DefaultPoolID *string `json:"default_pool_id,omitempty"` +} + +// ListenerUpdateRequest represents update listener request payload. +type ListenerUpdateRequest struct { + TimeoutTCPInspect *int `json:"timeout_tcp_inspect,omitempty"` + TimeoutMemberData *int `json:"timeout_member_data,omitempty"` + TimeoutMemberConnect *int `json:"timeout_member_connect,omitempty"` + TimeoutClientData *int `json:"timeout_client_data,omitempty"` + SNIContainerRefs *[]string `json:"sni_container_refs,omitempty"` + Name *string `json:"name,omitempty"` + L7Policies *[]resourceID `json:"l7policies,omitempty"` + InsertHeaders *map[string]string `json:"insert_headers,omitempty"` + Description *string `json:"description,omitempty"` + DefaultTLSContainerRef *string `json:"default_tls_container_ref,omitempty"` + DefaultPoolID *string `json:"default_pool_id,omitempty"` + AdminStateUp *bool `json:"admin_state_up,omitempty"` +} + +// Listener contains listener information. +type Listener struct { + ID string `json:"id"` + TimeoutClientData int `json:"timeout_client_data"` + Description string `json:"description"` + SNIContainerRefs []string `json:"sni_container_refs"` + Name string `json:"name"` + ConnectionLimit int `json:"connection_limit"` + UpdatedAt string `json:"updated_at"` + ProjectID string `json:"project_id"` + TimeoutMemberData int `json:"timeout_member_data"` + TimeoutMemberConnect int `json:"timeout_member_connect"` + L7Policies []resourceID `json:"l7policies"` + TenandID string `json:"tenant_id"` + DefaultTLSContainerRef *string `json:"default_tls_container_ref"` + AdminStateUp bool `json:"admin_state_up"` + CreatedAt string `json:"created_at"` + OperatingStatus string `json:"operating_status"` + ProtocolPort int `json:"protocol_port"` + LoadBalancers []resourceID `json:"loadbalancers"` + ProvisoningStatus string `json:"provisioning_status"` + DefaultPoolID string `json:"default_pool_id"` + Protocol string `json:"protocol"` + InsertHeaders map[string]string `json:"insert_headers"` + TimeoutTCPInspect int `json:"timeout_tcp_inspect"` +} + +type listener struct { + client *Client +} + +func (l *listener) resourcePath(lbID string) string { + return strings.Join([]string{loadBalancerResourcePath, lbID, "listeners"}, "/") +} + +func (l *listener) itemPath(id string) string { + return strings.Join([]string{listenerPath, id}, "/") +} + +func (l *listener) List(ctx context.Context, lbID string, opts *ListOptions) ([]*Listener, error) { + req, err := l.client.NewRequest(ctx, http.MethodGet, loadBalancerServiceName, l.resourcePath(lbID), nil) + if err != nil { + return nil, err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + Listeners []*Listener `json:"listeners"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.Listeners, nil +} + +func (l *listener) Create(ctx context.Context, lbID string, lcr *ListenerCreateRequest) (*Listener, error) { + var data struct { + Listener *ListenerCreateRequest `json:"listener"` + } + data.Listener = lcr + req, err := l.client.NewRequest(ctx, http.MethodPost, loadBalancerServiceName, l.resourcePath(lbID), &data) + if err != nil { + return nil, err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData struct { + Listener *Listener `json:"listener"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.Listener, err +} + +func (l *listener) Get(ctx context.Context, id string) (*Listener, error) { + req, err := l.client.NewRequest(ctx, http.MethodGet, loadBalancerServiceName, l.itemPath(id), nil) + if err != nil { + return nil, err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + listener := &Listener{} + if err := json.NewDecoder(resp.Body).Decode(listener); err != nil { + return nil, err + } + return listener, nil +} + +func (l *listener) Update(ctx context.Context, id string, lur *ListenerUpdateRequest) (*Listener, error) { + var data struct { + Listener *ListenerUpdateRequest + } + data.Listener = lur + req, err := l.client.NewRequest(ctx, http.MethodPut, loadBalancerServiceName, l.itemPath(id), &data) + if err != nil { + return nil, err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData struct { + Listener *Listener `json:"listener"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.Listener, nil +} + +func (l *listener) Delete(ctx context.Context, id string) error { + req, err := l.client.NewRequest(ctx, http.MethodDelete, loadBalancerServiceName, l.itemPath(id), nil) + if err != nil { + return err + } + resp, err := l.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +var _ MemberService = (*member)(nil) + +// MemberService is an interface to interact with BizFly API Members endpoint. +type MemberService interface { + List(ctx context.Context, poolID string, opts *ListOptions) ([]*Member, error) + Get(ctx context.Context, poolID, id string) (*Member, error) + Update(ctx context.Context, poolID, id string, req *MemberUpdateRequest) (*Member, error) + Delete(ctx context.Context, poolID, id string) error + Create(ctx context.Context, poolID string, req *MemberCreateRequest) (*Member, error) +} + +// MemberUpdateRequest represents update member request payload. +type MemberUpdateRequest struct { + Name string `json:"name"` + Weight int `json:"weight"` + AdminStateUp bool `json:"admin_state_up"` + MonitorAddress *string `json:"monitor_address"` + MonitorPort *int `json:"monitor_port"` + Backup bool `json:"backup"` +} + +// MemberCreateRequest represents create member request payload +type MemberCreateRequest struct { + Name string `json:"name"` + Weight int `json:"weight,omitempty"` + Address string `json:"address"` + ProtocolPort int `json:"protocol_port"` + MonitorAddress string `json:"monitor_address,omitempty"` + MonitorPort int `json:"monitor_port,omitempty"` + Backup bool `json:"backup,omitempty"` +} + +// Member contains member information. +type Member struct { + ID string `json:"id"` + TenandID string `json:"tenant_id"` + AdminStateUp bool `json:"admin_state_up"` + Name string `json:"name"` + UpdatedAt string `json:"updated_at"` + OperatingStatus string `json:"operating_status"` + MonitorAddress *string `json:"monitor_address"` + ProvisoningStatus string `json:"provisioning_status"` + ProjectID string `json:"project_id"` + ProtocolPort int `json:"protocol_port"` + SubnetID string `json:"subnet_id"` + MonitorPort *int `json:"monitor_port"` + Address string `json:"address"` + Weight int `json:"weight"` + CreatedAt string `json:"created_at"` + Backup bool `json:"backup"` +} + +type member struct { + client *Client +} + +func (m *member) resourcePath(poolID string) string { + return strings.Join([]string{poolPath, poolID, "member"}, "/") +} + +func (m *member) itemPath(poolID string, id string) string { + return strings.Join([]string{poolPath, poolID, "member", id}, "/") +} + +func (m *member) List(ctx context.Context, poolID string, opts *ListOptions) ([]*Member, error) { + req, err := m.client.NewRequest(ctx, http.MethodGet, loadBalancerServiceName, m.resourcePath(poolID), nil) + if err != nil { + return nil, err + } + resp, err := m.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + Members []*Member `json:"members"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.Members, nil +} + +func (m *member) Get(ctx context.Context, poolID, id string) (*Member, error) { + req, err := m.client.NewRequest(ctx, http.MethodGet, loadBalancerServiceName, m.itemPath(poolID, id), nil) + if err != nil { + return nil, err + } + resp, err := m.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + mb := &Member{} + if err := json.NewDecoder(resp.Body).Decode(mb); err != nil { + return nil, err + } + return mb, nil +} + +func (m *member) Update(ctx context.Context, poolID, id string, mur *MemberUpdateRequest) (*Member, error) { + var data struct { + Member *MemberUpdateRequest `json:"member"` + } + data.Member = mur + req, err := m.client.NewRequest(ctx, http.MethodPut, loadBalancerServiceName, m.itemPath(poolID, id), &data) + if err != nil { + + return nil, err + } + resp, err := m.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData struct { + Member *Member `json:"member"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.Member, nil +} + +func (m *member) Delete(ctx context.Context, poolID, id string) error { + req, err := m.client.NewRequest(ctx, http.MethodDelete, loadBalancerServiceName, m.itemPath(poolID, id), nil) + if err != nil { + return err + } + resp, err := m.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +func (m *member) Create(ctx context.Context, poolID string, mcr *MemberCreateRequest) (*Member, error) { + var data struct { + Member *MemberCreateRequest `json:"member"` + } + data.Member = mcr + req, err := m.client.NewRequest(ctx, http.MethodPost, loadBalancerServiceName, m.resourcePath(poolID), &data) + if err != nil { + return nil, err + } + resp, err := m.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var response struct { + Member *Member `json:"member"` + } + if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { + return nil, err + } + return response.Member, nil +} + +var _ PoolService = (*pool)(nil) + +// PoolService is an interface to interact with BizFly API Pools endpoint. +type PoolService interface { + List(ctx context.Context, loadBalancerID string, opts *ListOptions) ([]*Pool, error) + Create(ctx context.Context, loadBalancerID string, req *PoolCreateRequest) (*Pool, error) + Get(ctx context.Context, id string) (*Pool, error) + Update(ctx context.Context, id string, req *PoolUpdateRequest) (*Pool, error) + Delete(ctx context.Context, id string) error +} + +// SessionPersistence object controls how LoadBalacner sends request to backend. +// See https://support.bizflycloud.vn/api/loadbalancer/#post-loadbalancer-load_balancer_id-pools +type SessionPersistence struct { + Type string `json:"type"` + CookieName *string `json:"cookie_name,omitempty"` + PersistenceTimeout *string `json:"persistence_timeout,omitempty"` + PersistenceGranularity *string `json:"persistence_granularity,omitempty"` +} + +// PoolCreateRequest represents create new pool request payload. +type PoolCreateRequest struct { + Description *string `json:"description,omitempty"` + LBAlgorithm string `json:"lb_algorithm"` + ListenerID *string `json:"listener_id"` + Name *string `json:"name,omitempty"` + Protocol string `json:"protocol"` + SessionPersistence *SessionPersistence `json:"session_persistence"` +} + +// PoolUpdateRequest represents update pool request payload. +type PoolUpdateRequest struct { + AdminStateUp *bool `json:"admin_state_up,omitempty"` + Description *string `json:"description,omitempty"` + LBAlgorithm *string `json:"lb_algorithm,omitempty"` + Name *string `json:"name,omitempty"` + SessionPersistence *SessionPersistence `json:"session_persistence"` +} + +// Pool contains pool information. +type Pool struct { + ID string `json:"id"` + TenandID string `json:"tenant_id"` + Description string `json:"description"` + LBAlgorithm string `json:"lb_algorithm"` + Name string `json:"name"` + HealthMonitor *HealthMonitor `json:"healthmonitor"` + UpdatedAt string `json:"updated_at"` + OperatingStatus string `json:"operating_status"` + Listeners []resourceID `json:"listeners"` + SessionPersistence *SessionPersistence `json:"session_persistence"` + ProvisoningStatus string `json:"provisioning_status"` + ProjectID string `json:"project_id"` + LoadBalancers []resourceID `json:"loadbalancers"` + Members []string `json:"memebers"` + AdminStateUp bool `json:"admin_state_up"` + Protocol string `json:"protocol"` + CreatedAt string `json:"created_at"` + HealthMonitorID string `json:"healthmonitor_id"` +} + +type pool struct { + client *Client +} + +func (p *pool) resourcePath(lbID string) string { + return strings.Join([]string{loadBalancerResourcePath, lbID, "pools"}, "/") +} + +func (p *pool) itemPath(id string) string { + return strings.Join([]string{poolPath, id}, "/") +} + +func (p *pool) List(ctx context.Context, lbID string, opts *ListOptions) ([]*Pool, error) { + req, err := p.client.NewRequest(ctx, http.MethodGet, loadBalancerServiceName, p.resourcePath(lbID), nil) + if err != nil { + return nil, err + } + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var data struct { + Pools []*Pool `json:"pools"` + } + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + + return data.Pools, nil +} + +func (p *pool) Create(ctx context.Context, lbID string, pcr *PoolCreateRequest) (*Pool, error) { + var data struct { + Pool *PoolCreateRequest `json:"pool"` + } + data.Pool = pcr + req, err := p.client.NewRequest(ctx, http.MethodPost, loadBalancerServiceName, p.resourcePath(lbID), &data) + if err != nil { + return nil, err + } + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData struct { + Pool *Pool `json:"pool"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.Pool, nil +} + +func (p *pool) Get(ctx context.Context, id string) (*Pool, error) { + req, err := p.client.NewRequest(ctx, http.MethodGet, loadBalancerServiceName, p.itemPath(id), nil) + if err != nil { + return nil, err + } + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + pool := &Pool{} + if err := json.NewDecoder(resp.Body).Decode(pool); err != nil { + return nil, err + } + return pool, nil +} + +func (p *pool) Update(ctx context.Context, id string, pur *PoolUpdateRequest) (*Pool, error) { + var data struct { + Pool *PoolUpdateRequest `json:"pool"` + } + data.Pool = pur + req, err := p.client.NewRequest(ctx, http.MethodPut, loadBalancerServiceName, p.itemPath(id), data) + if err != nil { + return nil, err + } + resp, err := p.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData struct { + Pool *Pool `json:"pool"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.Pool, nil +} + +func (p *pool) Delete(ctx context.Context, id string) error { + req, err := p.client.NewRequest(ctx, http.MethodDelete, loadBalancerServiceName, p.itemPath(id), nil) + if err != nil { + return err + } + resp, err := p.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +type HealthMonitor struct { + Name string `json:"name"` + Type string `json:"type"` + Delay int `json:"delay"` + MaxRetries int `json:"max_retries"` + MaxRetriesDown int `json:"max_retries_down"` + TimeOut int `json:"timeout"` + HTTPMethod string `json:"http_method"` + UrlPath string `json:"url_path"` + ExpectedCodes string `json:"expected_codes"` + HTTPVersion float32 `json:"http_version"` + OpratingStatus string `json:"oprating_status"` + DomainName string `json:"domain_name"` + ID string `json:"id"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + TenantID string `json:"tenant_id"` + Pool []resourceID `json:"pool"` +} + +type HealthMonitorCreateRequest struct { + Name string `json:"name"` + Type string `json:"type"` + TimeOut int `json:"timeout,omitempty"` + PoolID string `json:"pool_id"` + Delay int `json:"delay,omitempty"` + MaxRetries int `json:"max_retries,omitempty"` + MaxRetriesDown int `json:"max_retries_down,omitempty"` + HTTPMethod string `json:"http_method,omitempty"` + HTTPVersion float32 `json:"http_version,omitempty"` + URLPath string `json:"url_path,omitempty"` + ExpectedCodes string `json:"expected_codes,omitempty"` + DomainName string `json:"domain_name,omitempty"` +} + +type HealthMonitorUpdateRequest struct { + Name string `json:"name"` + TimeOut int `json:"timeout,omitempty"` + Delay int `json:"delay,omitempty"` + MaxRetries int `json:"max_retries,omitempty"` + MaxRetriesDown int `json:"max_retries_down,omitempty"` + HTTPMethod string `json:"http_method,omitempty"` + HTTPVersion float32 `json:"http_version,omitempty"` + URLPath string `json:"url_path,omitempty"` + ExpectedCodes string `json:"expected_codes,omitempty"` + DomainName string `json:"domain_name,omitempty"` +} + +type healthmonitor struct { + client *Client +} + +var _ HealthMonitorService = (*healthmonitor)(nil) + +// HealthMonitorService is an interface to interact with BizFly API Health Monitor endpoint. +type HealthMonitorService interface { + Get(ctx context.Context, healthMonitorID string) (*HealthMonitor, error) + Delete(ctx context.Context, healthMonitorID string) error + Create(ctx context.Context, poolID string, hmcr *HealthMonitorCreateRequest) (*HealthMonitor, error) + Update(Ctx context.Context, healthMonitorID string, hmur *HealthMonitorUpdateRequest) (*HealthMonitor, error) +} + +func (h *healthmonitor) itemPath(hmID string) string { + return strings.Join([]string{healthMonitorPath, hmID}, "/") +} + +// Get gets detail a health monitor +func (h *healthmonitor) Get(ctx context.Context, hmID string) (*HealthMonitor, error) { + req, err := h.client.NewRequest(ctx, http.MethodGet, loadBalancerServiceName, h.itemPath(hmID), nil) + if err != nil { + return nil, err + } + resp, err := h.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + hm := &HealthMonitor{} + if err := json.NewDecoder(resp.Body).Decode(hm); err != nil { + return nil, err + } + return hm, nil +} + +// Create creates a health monitor for a pool +func (h *healthmonitor) Create(ctx context.Context, poolID string, hmcr *HealthMonitorCreateRequest) (*HealthMonitor, error) { + var data struct { + HealthMonitor *HealthMonitorCreateRequest `json:"healthmonitor"` + } + hmcr.PoolID = poolID + data.HealthMonitor = hmcr + req, err := h.client.NewRequest(ctx, http.MethodPost, loadBalancerServiceName, "/"+strings.Join([]string{"pool", poolID, "healthmonitor"}, "/"), &data) + if err != nil { + return nil, err + } + resp, err := h.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData struct { + HealthMonitor *HealthMonitor `json:"healthmonitor"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.HealthMonitor, nil +} + +// Delete deletes a health monitor +func (h *healthmonitor) Delete(ctx context.Context, hmID string) error { + req, err := h.client.NewRequest(ctx, http.MethodDelete, loadBalancerServiceName, h.itemPath(hmID), nil) + if err != nil { + return err + } + resp, err := h.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +func (h *healthmonitor) Update(ctx context.Context, hmID string, hmur *HealthMonitorUpdateRequest) (*HealthMonitor, error) { + var data struct { + HealthMonitor *HealthMonitorUpdateRequest `json:"healthmonitor"` + } + data.HealthMonitor = hmur + req, err := h.client.NewRequest(ctx, http.MethodPut, loadBalancerServiceName, h.itemPath(hmID), data) + if err != nil { + return nil, err + } + resp, err := h.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var respData struct { + HealthMonitor *HealthMonitor `json:"healthmonitor"` + } + if err := json.NewDecoder(resp.Body).Decode(&respData); err != nil { + return nil, err + } + return respData.HealthMonitor, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/server.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/server.go new file mode 100644 index 000000000000..0591a39e0ed3 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/server.go @@ -0,0 +1,688 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "io" + "io/ioutil" + "net/http" + "strings" +) + +const ( + serverBasePath = "/servers" + flavorPath = "/flavors" + osImagePath = "/images" + taskPath = "/tasks" + customImagesPath = "/user/images" + customImagePath = "/user/image" +) + +var _ ServerService = (*server)(nil) + +// ServerSecurityGroup contains information of security group of a server. +type ServerSecurityGroup struct { + Name string `json:"name"` +} + +// AttachedVolume contains attached volumes of a server. +type AttachedVolume struct { + ID string `json:"id"` + Name string `json:"name"` + Size int `json:"size"` + AttachedType string `json:"attached_type"` + Type string `json:"type"` + Category string `json:"category"` +} + +// IP represents the IP address, version and mac address of a port +type IP struct { + Version int `json:"version"` + Address string `json:"addr"` + Type string `json:"OS-EXT-IPS:type"` + MacAddress string `json:"0S-EXT-IPS-MAC:mac_addr"` +} + +// IPAddresses contains LAN & WAN Ip address of a Cloud Server +type IPAddress struct { + LanAddresses []IP `json:"LAN"` + WanV4Addresses []IP `json:"WAN_V4"` + WanV6Addresses []IP `json:"WAN_V6"` +} + +// Flavor contains flavor information. +type Flavor struct { + ID string `json:"id"` + Name string `json:"name"` + Ram int `json:"ram"` + VCPU int `json:"vcpu"` +} + +// Server contains server information. +type Server struct { + ID string `json:"id"` + Name string `json:"name"` + KeyName string `json:"key_name"` + UserID string `json:"user_id"` + ProjectID string `json:"tenant_id"` + CreatedAt string `json:"created"` + UpdatedAt string `json:"updated"` + Status string `json:"status"` + IPv6 bool `json:"ipv6"` + SecurityGroup []ServerSecurityGroup `json:"security_group"` + Addresses map[string]interface{} `json:"addresses"` // Deprecated: This field will be removed in the near future + Metadata map[string]string `json:"metadata"` + Flavor Flavor `json:"flavor"` + Progress int `json:"progress"` + AttachedVolumes []AttachedVolume `json:"os-extended-volumes:volumes_attached"` + AvailabilityZone string `json:"OS-EXT-AZ:availability_zone"` + Category string `json:"category"` + IPAddresses IPAddress `json:"ip_addresses"` + RegionName string `json:"region_name"` +} + +type CreateCustomImagePayload struct { + Name string `json:"name"` + DiskFormat string `json:"disk_format"` + Description string `json:"description,omitempty"` + ImageURL string `json:"image_url,omitempty"` +} + +type Location struct { + URL string `json:"url"` + Metadata map[string]string `json:"metadata,"` +} + +type CustomImage struct { + Name string `json:"name"` + Description string `json:"description"` + DiskFormat string `json:"disk_format"` + ContainerFormat string `json:"container_format"` + Visibility string `json:"visibility"` + Size int `json:"size"` + VirtualSize int `json:"virtual_size"` + Status string `json:"status"` + Checksum string `json:"checksum"` + Protected bool `json:"protected"` + MinRam int `json:"min_ram"` + MinDisk int `json:"min_disk"` + Owner string `json:"owner"` + OSHidden bool `json:"os_hidden"` + OSHashAlgo string `json:"os_hash_algo"` + OSHashValue string `json:"os_hash_value"` + ID string `json:"id"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + Locations []Location `json:"locations"` + DirectURL string `json:"direct_url"` + Tags []string `json:"tags"` + File string `json:"file"` + Schema string `json:"schema"` +} + +type CreateCustomImageResp struct { + Image CustomImage `json:"image"` + Success bool `json:"success"` + Token string `json:"token,omitempty"` + UploadURI string `json:"upload_uri,omitempty"` +} + +type CustomImageGetResp struct { + Image CustomImage `json:"image"` + Token string `json:"token"` +} + +type server struct { + client *Client +} + +// ServerService is an interface to interact with BizFly Cloud API. +type ServerService interface { + List(ctx context.Context, opts *ListOptions) ([]*Server, error) + Create(ctx context.Context, scr *ServerCreateRequest) (*ServerCreateResponse, error) + Get(ctx context.Context, id string) (*Server, error) + Delete(ctx context.Context, id string) error + Resize(ctx context.Context, id string, newFlavor string) (*ServerTask, error) + Start(ctx context.Context, id string) (*Server, error) + Stop(ctx context.Context, id string) (*Server, error) + SoftReboot(ctx context.Context, id string) (*ServerMessageResponse, error) + HardReboot(ctx context.Context, id string) (*ServerMessageResponse, error) + Rebuild(ctx context.Context, id string, imageID string) (*ServerTask, error) + GetVNC(ctx context.Context, id string) (*ServerConsoleResponse, error) + ListFlavors(ctx context.Context) ([]*serverFlavorResponse, error) + ListOSImages(ctx context.Context) ([]osImageResponse, error) + GetTask(ctx context.Context, id string) (*ServerTaskResponse, error) + ChangeCategory(ctx context.Context, id string, newCategory string) (*ServerTask, error) + AddVPC(ctx context.Context, id string, vpcs []string) (*Server, error) + RemoveVPC(ctx context.Context, id string, vpcs []string) (*Server, error) + ListCustomImages(ctx context.Context) ([]*CustomImage, error) + CreateCustomImage(ctx context.Context, cipl *CreateCustomImagePayload) (*CreateCustomImageResp, error) + DeleteCustomImage(ctx context.Context, imageID string) error + GetCustomImage(ctx context.Context, imageID string) (*CustomImageGetResp, error) +} + +// ServerConsoleResponse contains information of server console url. +type ServerConsoleResponse struct { + URL string `json:"url"` + Type string `json:"type"` +} + +// ServerMessageResponse contains message response from Cloud Server API. +type ServerMessageResponse struct { + Message string `json:"message"` +} + +// ServerAction represents server action request payload. +type ServerAction struct { + Action string `json:"action"` + ImageID string `json:"image,omitempty"` + FlavorName string `json:"flavor_name,omitempty"` + ConsoleType string `json:"type,omitempty"` + FirewallIDs []string `json:"firewall_ids,omitempty"` + NewType string `json:"new_type,omitempty"` + VPCNetworkIDs []string `json:"vpc_network_ids,omitempty"` +} + +// ServerTask contains task information. +type ServerTask struct { + TaskID string `json:"task_id"` +} + +// ServerCreateResponse contains response tasks when create server +type ServerCreateResponse struct { + Task []string `json:"task_id"` +} + +// ServerDisk contains server's disk information. +type ServerDisk struct { + Size int `json:"size"` + Type string `json:"type"` +} + +// ServerOS contains OS information of server. +type ServerOS struct { + ID string `json:"id"` + Type string `json:"type"` +} + +// ServerCreateRequest represents create a new server payload. +type ServerCreateRequest struct { + Name string `json:"name"` + FlavorName string `json:"flavor"` + SSHKey string `json:"sshkey,omitempty"` + Password bool `json:"password"` + RootDisk *ServerDisk `json:"rootdisk"` + DataDisks []*ServerDisk `json:"datadisks,omitempty"` + Type string `json:"type"` + AvailabilityZone string `json:"availability_zone"` + OS *ServerOS `json:"os"` + Quantity int `json:"quantity,omitempty"` +} + +// itemActionPath return http path of server action +func (s *server) itemActionPath(id string) string { + return strings.Join([]string{serverBasePath, id, "action"}, "/") +} + +func (s *server) itemCustomImagePath(id string) string { + return strings.Join([]string{customImagePath, id}, "/") +} + +// List lists all servers. +func (s *server) List(ctx context.Context, opts *ListOptions) ([]*Server, error) { + + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, serverBasePath, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var servers []*Server + + if err := json.NewDecoder(resp.Body).Decode(&servers); err != nil { + return nil, err + } + + return servers, nil +} + +// Create creates a new server. +func (s *server) Create(ctx context.Context, scr *ServerCreateRequest) (*ServerCreateResponse, error) { + payload := []*ServerCreateRequest{scr} + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, serverBasePath, payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + var task *ServerCreateResponse + if err := json.NewDecoder(resp.Body).Decode(&task); err != nil { + return nil, err + } + return task, nil +} + +// Get gets a server. +func (s *server) Get(ctx context.Context, id string) (*Server, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, serverBasePath+"/"+id, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var svr *Server + if err := json.NewDecoder(resp.Body).Decode(&svr); err != nil { + return nil, err + } + return svr, nil +} + +// Delete deletes a server. +func (s *server) Delete(ctx context.Context, id string) error { + req, err := s.client.NewRequest(ctx, http.MethodDelete, serverServiceName, serverBasePath+"/"+id, nil) + if err != nil { + return err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + return resp.Body.Close() +} + +// Resize resizes a server. +func (s *server) Resize(ctx context.Context, id string, newFlavor string) (*ServerTask, error) { + var payload = &ServerAction{ + Action: "resize", + FlavorName: newFlavor} + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var task *ServerTask + if err := json.NewDecoder(resp.Body).Decode(&task); err != nil { + return nil, err + } + return task, nil +} + +// Start starts a server. +func (s *server) Start(ctx context.Context, id string) (*Server, error) { + payload := &ServerAction{Action: "start"} + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var svr *Server + if err := json.NewDecoder(resp.Body).Decode(&svr); err != nil { + return nil, err + } + return svr, nil +} + +// Stop stops a server +func (s *server) Stop(ctx context.Context, id string) (*Server, error) { + payload := &ServerAction{Action: "stop"} + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var svr *Server + if err := json.NewDecoder(resp.Body).Decode(&svr); err != nil { + return nil, err + } + return svr, nil +} + +// SoftReboot soft reboots a server. +func (s *server) SoftReboot(ctx context.Context, id string) (*ServerMessageResponse, error) { + payload := &ServerAction{Action: "soft_reboot"} + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var srm *ServerMessageResponse + if err := json.NewDecoder(resp.Body).Decode(&srm); err != nil { + return nil, err + } + return srm, nil +} + +// HardReboot hard reboots a server. +func (s *server) HardReboot(ctx context.Context, id string) (*ServerMessageResponse, error) { + payload := &ServerAction{Action: "hard_reboot"} + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var smr *ServerMessageResponse + if err := json.NewDecoder(resp.Body).Decode(&smr); err != nil { + return nil, err + } + return smr, nil +} + +// AddVPC add VPC to the server + +// Rebuild rebuilds a server. +func (s *server) Rebuild(ctx context.Context, id string, imageID string) (*ServerTask, error) { + var payload = &ServerAction{ + Action: "rebuild", + ImageID: imageID} + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var task *ServerTask + if err := json.NewDecoder(resp.Body).Decode(&task); err != nil { + return nil, err + } + return task, nil +} + +// GetVNC gets vnc console of a server. +func (s *server) GetVNC(ctx context.Context, id string) (*ServerConsoleResponse, error) { + payload := &ServerAction{ + Action: "get_vnc", + ConsoleType: "novnc"} + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var respPayload struct { + Console *ServerConsoleResponse `json:"console"` + } + + if err := json.NewDecoder(resp.Body).Decode(&respPayload); err != nil { + return nil, err + } + return respPayload.Console, nil +} + +type serverFlavorResponse struct { + ID string `json:"_id"` + Name string `json:"name"` +} + +// ListFlavors lists server flavors +func (s *server) ListFlavors(ctx context.Context) ([]*serverFlavorResponse, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, flavorPath, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + var flavors []*serverFlavorResponse + + if err := json.NewDecoder(resp.Body).Decode(&flavors); err != nil { + return nil, err + } + return flavors, nil +} + +type osDistributionVersion struct { + Name string `json:"name"` + ID string `json:"id"` +} + +type osImageResponse struct { + OSDistribution string `json:"os"` + Version []osDistributionVersion `json:"versions"` +} + +// ListOSImage list server os images +func (s *server) ListOSImages(ctx context.Context) ([]osImageResponse, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, osImagePath, nil) + + if err != nil { + return nil, err + } + q := req.URL.Query() + q.Add("os_images", "True") + req.URL.RawQuery = q.Encode() + + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + var respPayload struct { + OSImages []osImageResponse `json:"os_images"` + } + if err := json.NewDecoder(resp.Body).Decode(&respPayload); err != nil { + return nil, err + } + return respPayload.OSImages, nil +} + +type ServerTaskResult struct { + Action string `json:"action"` + Progress int `json:"progress"` + Success bool `json:"success"` + Server +} + +type ServerTaskResponse struct { + Ready bool `json:"ready"` + Result ServerTaskResult `json:"result"` +} + +// GetTask get tasks result from Server API +func (s *server) GetTask(ctx context.Context, id string) (*ServerTaskResponse, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, taskPath+"/"+id, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + var str *ServerTaskResponse + if err := json.NewDecoder(resp.Body).Decode(&str); err != nil { + return nil, err + } + return str, nil +} + +func (s server) ChangeCategory(ctx context.Context, id string, newCategory string) (*ServerTask, error) { + payload := &ServerAction{ + Action: "change_type", + NewType: newCategory} + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var svt *ServerTask + if err := json.NewDecoder(resp.Body).Decode(&svt); err != nil { + return nil, err + } + return svt, nil +} + +func (s server) AddVPC(ctx context.Context, id string, vpcs []string) (*Server, error) { + payload := &ServerAction{ + Action: "add_vpc", + VPCNetworkIDs: vpcs, + } + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var server *Server + if err := json.NewDecoder(resp.Body).Decode(&server); err != nil { + return nil, err + } + return server, nil +} + +func (s server) RemoveVPC(ctx context.Context, id string, vpcs []string) (*Server, error) { + payload := &ServerAction{ + Action: "remove_vpc", + VPCNetworkIDs: vpcs, + } + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, s.itemActionPath(id), payload) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var server *Server + if err := json.NewDecoder(resp.Body).Decode(&server); err != nil { + return nil, err + } + return server, nil +} + +func (s *server) ListCustomImages(ctx context.Context) ([]*CustomImage, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, customImagesPath, nil) + if err != nil { + return nil, err + } + var data struct { + Images []*CustomImage `json:"images"` + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data.Images, nil +} + +func (s *server) CreateCustomImage(ctx context.Context, cipl *CreateCustomImagePayload) (*CreateCustomImageResp, error) { + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, strings.Join([]string{customImagePath, "upload"}, "/"), cipl) + if err != nil { + return nil, err + } + var data *CreateCustomImageResp + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (s *server) DeleteCustomImage(ctx context.Context, imageID string) error { + req, err := s.client.NewRequest(ctx, http.MethodDelete, serverServiceName, s.itemCustomImagePath(imageID), nil) + + if err != nil { + return err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return err + } + return resp.Body.Close() +} + +func (s *server) GetCustomImage(ctx context.Context, imageID string) (*CustomImageGetResp, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, strings.Join([]string{customImagePath, imageID}, "/"), nil) + if err != nil { + return nil, err + } + var data *CustomImageGetResp + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/service.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/service.go new file mode 100644 index 000000000000..056f785e4241 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/service.go @@ -0,0 +1,79 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "bytes" + "context" + "encoding/json" + "net/http" +) + +var _ ServiceInterface = (*service)(nil) + +const serviceUrl = "/api/auth/service" + +type Service struct { + Name string `json:"name"` + Code string `json:"code"` + CanonicalName string `json:"canonical_name"` + Id int `json:"id"` + Region string `json:"region"` + Icon string `json:"icon"` + Description string `json:"description"` + Enabled bool `json:"enabled"` + ServiceUrl string `json:"service_url"` +} + +type ServiceList struct { + Services []*Service `json:"services"` +} + +type service struct { + client *Client +} + +type ServiceInterface interface { + List(ctx context.Context) ([]*Service, error) + //GetEndpoint(ctx context.Context, name string, region string) (string, error) +} + +func (s *service) List(ctx context.Context) ([]*Service, error) { + u, err := s.client.apiURL.Parse(serviceUrl) + if err != nil { + return nil, err + } + buf := new(bytes.Buffer) + + req, err := http.NewRequest("GET", u.String(), buf) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var services ServiceList + + if err := json.NewDecoder(resp.Body).Decode(&services); err != nil { + return nil, err + } + return services.Services, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/snapshot.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/snapshot.go new file mode 100644 index 000000000000..11e1870c23e3 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/snapshot.go @@ -0,0 +1,148 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "strings" +) + +const ( + snapshotPath = "/snapshots" +) + +var _ SnapshotService = (*snapshot)(nil) + +// SnapshotService is an interface to interact with BizFly API Snapshot endpoint. +type SnapshotService interface { + List(ctx context.Context, opts *ListOptions) ([]*Snapshot, error) + Create(ctx context.Context, scr *SnapshotCreateRequest) (*Snapshot, error) + Get(ctx context.Context, id string) (*Snapshot, error) + Delete(ctx context.Context, id string) error +} + +// SnapshotCreateRequest represents create new volume request payload. +type SnapshotCreateRequest struct { + Name string `json:"name"` + VolumeId string `json:"volume_id"` + Force bool `json:"force"` +} + +// Snapshot contains snapshot information +type Snapshot struct { + Id string `json:"id"` + Name string `json:"name"` + Status string `json:"status"` + VolumeTypeId string `json:"volume_type_id"` + VolumeId string `json:"volume_id"` + Size int `json:"size"` + Progress string `json:"os-extended-snapshot-attributes:progress"` + TenantId string `json:"os-extended-snapshot-attributes:project_id"` + Metadata map[string]string `json:"metadata"` + Description string `json:"description"` + IsUsingAutoscale bool `json:"is_using_autoscale"` + UpdatedAt string `json:"updated_at"` + CreateAt string `json:"created_at"` + FromVolume Volume `json:"volume"` + Category string `json:"category"` +} + +type snapshot struct { + client *Client +} + +// Get gets a snapshot +func (s *snapshot) Get(ctx context.Context, id string) (*Snapshot, error) { + var snapshot *Snapshot + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, strings.Join([]string{snapshotPath, id}, "/"), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&snapshot); err != nil { + return nil, err + } + return snapshot, nil +} + +// Delete deletes a snapshot +func (s *snapshot) Delete(ctx context.Context, id string) error { + req, err := s.client.NewRequest(ctx, http.MethodDelete, serverServiceName, strings.Join([]string{snapshotPath, id}, "/"), nil) + + if err != nil { + return err + } + + resp, err := s.client.Do(ctx, req) + if err != nil { + fmt.Println("error send req") + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +// Create creates a new snapshot +func (s *snapshot) Create(ctx context.Context, scr *SnapshotCreateRequest) (*Snapshot, error) { + var snapshot *Snapshot + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, snapshotPath, &scr) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&snapshot); err != nil { + return nil, err + } + return snapshot, nil +} + +// List lists all snapshot of user +func (s *snapshot) List(ctx context.Context, opts *ListOptions) ([]*Snapshot, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, snapshotPath, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var snapshots []*Snapshot + if err := json.NewDecoder(resp.Body).Decode(&snapshots); err != nil { + return nil, err + } + + return snapshots, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/ssh_key.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/ssh_key.go new file mode 100644 index 000000000000..2550597d0b35 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/ssh_key.go @@ -0,0 +1,122 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "net/http" +) + +const ( + sshKeyBasePath = "/keypairs" +) + +var _ SSHKeyService = (*sshkey)(nil) + +type sshkey struct { + client *Client +} + +// SSHKeyService is an interface to interact with BizFly API SSH Key +type SSHKeyService interface { + List(ctx context.Context, opts *ListOptions) ([]*KeyPair, error) + Create(ctx context.Context, scr *SSHKeyCreateRequest) (*SSHKeyCreateResponse, error) + Delete(ctx context.Context, keyname string) (*SSHKeyDeleteResponse, error) +} + +type SSHKey struct { + Name string `json:"name"` + PublicKey string `json:"public_key"` + FingerPrint string `json:"fingerprint"` +} + +type KeyPair struct { + SSHKeyPair SSHKey `json:"keypair"` +} + +type SSHKeyCreateResponse struct { + SSHKey + UserID string `json:"user_id"` +} + +type SSHKeyCreateRequest struct { + Name string `json:"name"` + PublicKey string `json:"public_key"` +} + +type SSHKeyDeleteResponse struct { + Message string `json:"message"` +} + +func (s *sshkey) List(ctx context.Context, opts *ListOptions) ([]*KeyPair, error) { + req, err := s.client.NewRequest(ctx, http.MethodGet, serverServiceName, sshKeyBasePath, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + var sshKeys []*KeyPair + + if err := json.NewDecoder(resp.Body).Decode(&sshKeys); err != nil { + return nil, err + } + return sshKeys, nil +} + +func (s *sshkey) Create(ctx context.Context, scr *SSHKeyCreateRequest) (*SSHKeyCreateResponse, error) { + req, err := s.client.NewRequest(ctx, http.MethodPost, serverServiceName, sshKeyBasePath, &scr) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + var sshKey *SSHKeyCreateResponse + + if err := json.NewDecoder(resp.Body).Decode(&sshKey); err != nil { + return nil, err + } + return sshKey, nil +} + +func (s *sshkey) Delete(ctx context.Context, keyname string) (*SSHKeyDeleteResponse, error) { + req, err := s.client.NewRequest(ctx, http.MethodDelete, serverServiceName, sshKeyBasePath+"/"+keyname, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + var response *SSHKeyDeleteResponse + + if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { + return nil, err + } + return response, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/token.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/token.go new file mode 100644 index 000000000000..98aa8ef47514 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/token.go @@ -0,0 +1,106 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "net/http" +) + +const ( + tokenPath = "/token" +) + +var _ TokenService = (*token)(nil) + +// TokenService is an interface to interact with BizFly API token endpoint. +type TokenService interface { + Create(ctx context.Context, request *TokenCreateRequest) (*Token, error) + Refresh(ctx context.Context) (*Token, error) +} + +// TokenCreateRequest represents create new token request payload. +type TokenCreateRequest struct { + AuthMethod string `json:"auth_method"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + ProjectName string `json:"project_name,omitempty"` + AppCredID string `json:"credential_id,omitempty"` + AppCredSecret string `json:"credential_secret,omitempty"` +} + +// Token contains token information. +type Token struct { + KeystoneToken string `json:"token"` + ExpiresAt string `json:"expires_at"` +} + +type token struct { + client *Client +} + +// Create creates new token base on the information in TokenCreateRequest. +func (t *token) Create(ctx context.Context, tcr *TokenCreateRequest) (*Token, error) { + return t.create(ctx, tcr) +} + +// Refresh retrieves new token base on underlying client information. +func (t *token) Refresh(ctx context.Context) (*Token, error) { + tcr := &TokenCreateRequest{ + AuthMethod: t.client.authMethod, + Username: t.client.username, + Password: t.client.password, + AppCredID: t.client.appCredID, + AppCredSecret: t.client.appCredSecret, + } + return t.create(ctx, tcr) +} + +func (t *token) create(ctx context.Context, tcr *TokenCreateRequest) (*Token, error) { + + req, err := t.client.NewRequest(ctx, http.MethodPost, authServiceName, tokenPath, tcr) + if err != nil { + return nil, err + } + resp, err := t.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + tok := &Token{} + if err := json.NewDecoder(resp.Body).Decode(tok); err != nil { + return nil, err + } + // Get new services catalog after create token + services, err := t.client.Service.List(ctx) + if err != nil { + return nil, err + } + + t.client.authMethod = tcr.AuthMethod + t.client.username = tcr.Username + t.client.password = tcr.Password + t.client.projectName = tcr.ProjectName + t.client.appCredID = tcr.AppCredID + t.client.appCredSecret = tcr.AppCredSecret + t.client.services = services + + return tok, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/volume.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/volume.go new file mode 100644 index 000000000000..d5469e8b54dc --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/volume.go @@ -0,0 +1,295 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "io" + "io/ioutil" + "net/http" + "strings" +) + +const ( + volumeBasePath = "/volumes" +) + +var _ VolumeService = (*volume)(nil) + +// VolumeService is an interface to interact with BizFly API Volume endpoint. +type VolumeService interface { + List(ctx context.Context, opts *ListOptions) ([]*Volume, error) + Create(ctx context.Context, req *VolumeCreateRequest) (*Volume, error) + Get(ctx context.Context, id string) (*Volume, error) + Delete(ctx context.Context, id string) error + ExtendVolume(ctx context.Context, id string, newsize int) (*Task, error) + Attach(ctx context.Context, id string, serverID string) (*VolumeAttachDetachResponse, error) + Detach(ctx context.Context, id string, serverID string) (*VolumeAttachDetachResponse, error) + Restore(ctx context.Context, id string, snapshotID string) (*Task, error) +} + +// VolumeCreateRequest represents create new volume request payload. +type VolumeCreateRequest struct { + Name string `json:"name"` + Size int `json:"size"` + VolumeType string `json:"volume_type"` + VolumeCategory string `json:"category"` + AvailabilityZone string `json:"availability_zone"` + SnapshotID string `json:"snapshot_id,omitempty"` + ServerID string `json:"instance_uuid,omitempty"` +} + +// VolumeAttachment contains volume attachment information. +type VolumeAttachment struct { + Server Server `json:"server"` + ServerID string `json:"server_id"` + AttachmentID string `json:"attachment_id"` + VolumeID string `json:"volume_id"` + Device string `json:"device"` + ID string `json:"id"` +} + +// Volume contains volume information. +type Volume struct { + ID string `json:"id"` + Size int `json:"size"` + AttachedType string `json:"attached_type"` + Name string `json:"name"` + VolumeType string `json:"type"` + Description string `json:"description"` + SnapshotID string `json:"snapshot_id"` + Bootable bool `json:"bootable"` + AvailabilityZone string `json:"availability_zone"` + Status string `json:"status"` + UserID string `json:"user_id"` + ProjectID string `json:"os-vol-tenant-attr:tenant_id"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + Metadata map[string]string `json:"metadata"` + Attachments []VolumeAttachment `json:"attachments"` + Category string `json:"category"` +} + +type volume struct { + client *Client +} + +// List lists all volumes of users. +func (v *volume) List(ctx context.Context, opts *ListOptions) ([]*Volume, error) { + req, err := v.client.NewRequest(ctx, http.MethodGet, serverServiceName, volumeBasePath, nil) + if err != nil { + return nil, err + } + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + var volumes []*Volume + + if err := json.NewDecoder(resp.Body).Decode(&volumes); err != nil { + return nil, err + } + return volumes, nil +} + +// Create creates a new volume. +func (v *volume) Create(ctx context.Context, vcr *VolumeCreateRequest) (*Volume, error) { + req, err := v.client.NewRequest(ctx, http.MethodPost, serverServiceName, volumeBasePath, &vcr) + if err != nil { + return nil, err + } + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + + var volumeRespData *Volume + + if err := json.NewDecoder(resp.Body).Decode(&volumeRespData); err != nil { + return nil, err + } + return volumeRespData, nil +} + +// Get gets information of a volume. +func (v *volume) Get(ctx context.Context, id string) (*Volume, error) { + req, err := v.client.NewRequest(ctx, http.MethodGet, serverServiceName, volumeBasePath+"/"+id, nil) + if err != nil { + return nil, err + } + + resp, err := v.client.Do(ctx, req) + + if err != nil { + return nil, err + } + + defer resp.Body.Close() + + var volume *Volume + + if err := json.NewDecoder(resp.Body).Decode(&volume); err != nil { + return nil, err + } + return volume, nil +} + +// Delete deletes a volume. +func (v *volume) Delete(ctx context.Context, id string) error { + req, err := v.client.NewRequest(ctx, http.MethodDelete, serverServiceName, volumeBasePath+"/"+id, nil) + + if err != nil { + return err + } + + resp, err := v.client.Do(ctx, req) + if err != nil { + return err + } + _, _ = io.Copy(ioutil.Discard, resp.Body) + + return resp.Body.Close() +} + +// VolumeAction represents volume action request payload. +type VolumeAction struct { + Type string `json:"type"` + NewSize int `json:"new_size,omitempty"` + ServerID string `json:"instance_uuid,omitempty"` + SnapshotID string `json:"snapshot_id,omitempty"` +} + +// Task represents task response when perform an action. +type Task struct { + TaskID string `json:"task_id"` +} + +// VolumeAttachDetachResponse contains information when detach or attach a volume from/to a server. +type VolumeAttachDetachResponse struct { + Message string `json:"message"` + VolumeDetail Volume `json:"volume_detail"` +} + +func (v *volume) itemActionPath(id string) string { + return strings.Join([]string{volumeBasePath, id, "action"}, "/") +} + +// ExtendVolume extends capacity of a volume. +func (v *volume) ExtendVolume(ctx context.Context, id string, newsize int) (*Task, error) { + var payload = &VolumeAction{ + Type: "extend", + NewSize: newsize} + + req, err := v.client.NewRequest(ctx, http.MethodPost, serverServiceName, v.itemActionPath(id), payload) + if err != nil { + return nil, err + } + + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + + t := &Task{} + if err := json.NewDecoder(resp.Body).Decode(t); err != nil { + return nil, err + } + return t, nil +} + +// Attach attaches a volume to a server. +func (v *volume) Attach(ctx context.Context, id string, serverID string) (*VolumeAttachDetachResponse, error) { + var payload = &VolumeAction{ + Type: "attach", + ServerID: serverID} + + req, err := v.client.NewRequest(ctx, http.MethodPost, serverServiceName, v.itemActionPath(id), payload) + if err != nil { + return nil, err + } + + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + + volumeAttachResponse := &VolumeAttachDetachResponse{} + if err := json.NewDecoder(resp.Body).Decode(volumeAttachResponse); err != nil { + return nil, err + } + return volumeAttachResponse, nil +} + +// Detach detaches a volume from a server. +func (v *volume) Detach(ctx context.Context, id string, serverID string) (*VolumeAttachDetachResponse, error) { + var payload = &VolumeAction{ + Type: "detach", + ServerID: serverID} + + req, err := v.client.NewRequest(ctx, http.MethodPost, serverServiceName, v.itemActionPath(id), payload) + if err != nil { + return nil, err + } + + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + + r := &VolumeAttachDetachResponse{} + if err := json.NewDecoder(resp.Body).Decode(r); err != nil { + return nil, err + } + return r, nil +} + +// Restore restores a volume from a snapshot. +func (v *volume) Restore(ctx context.Context, id string, snapshotID string) (*Task, error) { + var payload = &VolumeAction{ + Type: "restore", + SnapshotID: snapshotID} + + req, err := v.client.NewRequest(ctx, http.MethodPost, serverServiceName, v.itemActionPath(id), payload) + if err != nil { + return nil, err + } + + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + + t := &Task{} + if err := json.NewDecoder(resp.Body).Decode(t); err != nil { + return nil, err + } + return t, nil +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/vpc.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/vpc.go new file mode 100644 index 000000000000..a235fd93d7dd --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/vpc.go @@ -0,0 +1,197 @@ +// This file is part of gobizfly +// +// Copyright (C) 2020 BizFly Cloud +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see + +package gobizfly + +import ( + "context" + "encoding/json" + "net/http" + "strings" +) + +const ( + vpcPath = "/vpc-networks" +) + +var _ VPCService = (*vpcService)(nil) + +type vpcService struct { + client *Client +} + +type VPCService interface { + List(ctx context.Context) ([]*VPC, error) + Get(ctx context.Context, vpcID string) (*VPC, error) + Update(ctx context.Context, vpcID string, uvpl *UpdateVPCPayload) (*VPC, error) + Create(ctx context.Context, cvpl *CreateVPCPayload) (*VPC, error) + Delete(ctx context.Context, vpcID string) error +} + +type VPC struct { + ID string `json:"id"` + Name string `json:"name"` + TenantID string `json:"tenant_id"` + AdminStateUp bool `json:"admin_state_up"` + MTU int `json:"mtu"` + Status string `json:"status"` + Subnets []Subnet `json:"subnets"` + Shared bool `json:"shared"` + AvailabilityZoneHints []string `json:"availability_zone_hints"` + AvailabilityZones []string `json:"availability_zones"` + IPv4AddressScope string `json:"ipv4_address_scope"` + IPv6AddressScope string `json:"ipv6_address_scope"` + RouterExternal bool `json:"router:external"` + Description string `json:"description"` + PortSecurityEnabled bool `json:"port_security_enabled"` + QosPolicyID string `json:"qos_policy_id"` + Tags []string `json:"tags"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + RevisionNumber int `json:"revision_number"` + IsDefault bool `json:"is_default"` +} + +type Subnet struct { + ID string `json:"id"` + Name string `json:"name"` + TenantID string `json:"tenant_id"` + NetworkID string `json:"network_id"` + IPVersion int `json:"ip_version"` + SubnetPoolID string `json:"subnet_pool_id"` + EnableDHCP bool `json:"enable_dhcp"` + IPv6RaMode string `json:"ipv6_ra_mode"` + IPv6AddressMode string `json:"ipv6_address_mode"` + GatewayIP string `json:"gateway_ip"` + CIDR string `json:"cidr"` + AllocationPools []map[string]string `json:"allocation_pools"` + HostRoutes []string `json:"host_routes"` + DNSNameServers []string `json:"dns_nameservers"` + Description string `json:"description"` + ServiceTypes []string `json:"service_types"` + Tags []string `json:"tags"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + RevisionNumber int `json:"revision_number"` + ProjectID string `json:"project_id"` +} + +type CreateVPCPayload struct { + Name string `json:"name"` + CIDR string `json:"cidr,omitempty"` + Description string `json:"description,omitempty"` + IsDefault bool `json:"is_default,omitempty"` +} + +type UpdateVPCPayload struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + CIDR string `json:"cidr,omitempty"` + IsDefault bool `json:"is_default,omitempty"` +} + +func (v vpcService) resourcePath() string { + return vpcPath +} + +func (v vpcService) itemPath(id string) string { + return strings.Join([]string{vpcPath, id}, "/") +} + +func (v vpcService) List(ctx context.Context) ([]*VPC, error) { + req, err := v.client.NewRequest(ctx, http.MethodGet, serverServiceName, v.resourcePath(), nil) + if err != nil { + return nil, err + } + var data []*VPC + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (v vpcService) Get(ctx context.Context, vpcID string) (*VPC, error) { + req, err := v.client.NewRequest(ctx, http.MethodGet, serverServiceName, v.itemPath(vpcID), nil) + if err != nil { + return nil, err + } + var data *struct { + Network *VPC `json:"network"` + } + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data.Network, nil +} + +func (v vpcService) Update(ctx context.Context, vpcID string, uvpl *UpdateVPCPayload) (*VPC, error) { + req, err := v.client.NewRequest(ctx, http.MethodPut, serverServiceName, v.itemPath(vpcID), uvpl) + if err != nil { + return nil, err + } + var data *struct { + Network *VPC `json:"network"` + } + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data.Network, nil +} + +func (v vpcService) Create(ctx context.Context, cvpl *CreateVPCPayload) (*VPC, error) { + req, err := v.client.NewRequest(ctx, http.MethodPost, serverServiceName, v.resourcePath(), cvpl) + if err != nil { + return nil, err + } + var data *VPC + resp, err := v.client.Do(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return nil, err + } + return data, nil +} + +func (v vpcService) Delete(ctx context.Context, vpcID string) error { + req, err := v.client.NewRequest(ctx, http.MethodDelete, serverServiceName, v.itemPath(vpcID), nil) + if err != nil { + return err + } + resp, err := v.client.Do(ctx, req) + if err != nil { + return err + } + return resp.Body.Close() +} diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/manifest/cluster-autoscaler.yaml b/cluster-autoscaler/cloudprovider/bizflycloud/manifest/cluster-autoscaler.yaml new file mode 100644 index 000000000000..f414ab5cfbba --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/manifest/cluster-autoscaler.yaml @@ -0,0 +1,66 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cluster-autoscaler + namespace: kube-system + labels: + app: cluster-autoscaler +spec: + replicas: 1 + selector: + matchLabels: + app: cluster-autoscaler + template: + metadata: + labels: + app: cluster-autoscaler + spec: + containers: + - image: cr-hn-1.bizflycloud.vn/1e7f10a9850b45b488a3f0417ccb60e0/cluster-autoscaler:1.0 + name: cluster-autoscaler + resources: + limits: + cpu: 100m + memory: 300Mi + requests: + cpu: 100m + memory: 300Mi + command: + - ./cluster-autoscaler + - --v=4 + - --stderrthreshold=info + - --cloud-provider=bizflycloud + - --skip-nodes-with-local-storage=false + - --leader-elect=true + - --expander=least-waste + - --kubeconfig=/var/lib/kubernetes/clusterxxxx.kubeconfig + env: + - name: BIZFLYCLOUD_AUTH_METHOD + value: password #application_credential + - name: BIZFLYCLOUD_EMAIL + value: xxxxxxxxxxxxxxxxx + - name: BIZFLYCLOUD_PASSWORD + value: xxxxxxxxxxxxxxxxx + # - name: BIZFLYCLOUD_APP_CREDENTIAL_ID + # value: xxxxxxxxxxxxxxxxx + # - name: BIZFLYCLOUD_APP_CREDENTIAL_SECRET + # value: xxxxxxxxxxxxxxxxx + # - name: BIZFLYCLOUD_PROJECT_ID + # value: xxxxxxxxxxxxxxxxx + # - name: BIZFLYCLOUD_TENANT_ID + # value: xxxxxxxxxxxxxxxxx + - name: BIZFLYCLOUD_REGION + value: HN + - name: BIZFLYCLOUD_API_URL + value: https://manage.bizflycloud.vn + - name: CLUSTER_NAME + value: xxxxxxxxxxxxxxxxx + volumeMounts: + - name: kubeconfig + mountPath: /var/lib/kubernetes/clusterxxxx.kubeconfig + readOnly: true + imagePullPolicy: "Always" + volumes: + - name: ssl-cekubeconfigrts + hostPath: + path: "/var/lib/kubernetes/clusterxxxx.kubeconfig" \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/manifest/demo.yaml b/cluster-autoscaler/cloudprovider/bizflycloud/manifest/demo.yaml new file mode 100644 index 000000000000..fe6e8be85556 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/manifest/demo.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deployment +spec: + selector: + matchLabels: + app: nginx + replicas: 1 + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80 + name: "http-server" + resources: + limits: + cpu: 200m + memory: 200Mi + requests: + cpu: 200m + memory: 200Mi \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/manifest/rbac.yaml b/cluster-autoscaler/cloudprovider/bizflycloud/manifest/rbac.yaml new file mode 100644 index 000000000000..34159c181fad --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/manifest/rbac.yaml @@ -0,0 +1,116 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + k8s-addon: cluster-autoscaler.addons.k8s.io + k8s-app: cluster-autoscaler + name: cluster-autoscaler + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: cluster-autoscaler + labels: + k8s-addon: cluster-autoscaler.addons.k8s.io + k8s-app: cluster-autoscaler +rules: + - apiGroups: [""] + resources: ["events", "endpoints"] + verbs: ["create", "patch"] + - apiGroups: [""] + resources: ["pods/eviction"] + verbs: ["create"] + - apiGroups: [""] + resources: ["pods/status"] + verbs: ["update"] + - apiGroups: [""] + resources: ["endpoints"] + resourceNames: ["cluster-autoscaler"] + verbs: ["get", "update"] + - apiGroups: [""] + resources: ["nodes"] + verbs: ["watch", "list", "get", "update"] + - apiGroups: [""] + resources: + - "pods" + - "services" + - "replicationcontrollers" + - "persistentvolumeclaims" + - "persistentvolumes" + verbs: ["watch", "list", "get"] + - apiGroups: ["extensions"] + resources: ["replicasets", "daemonsets"] + verbs: ["watch", "list", "get"] + - apiGroups: ["policy"] + resources: ["poddisruptionbudgets"] + verbs: ["watch", "list"] + - apiGroups: ["apps"] + resources: ["statefulsets", "replicasets", "daemonsets"] + verbs: ["watch", "list", "get"] + - apiGroups: ["storage.k8s.io"] + resources: ["storageclasses", "csinodes"] + verbs: ["watch", "list", "get"] + - apiGroups: ["batch", "extensions"] + resources: ["jobs"] + verbs: ["get", "list", "watch", "patch"] + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["create"] + - apiGroups: ["coordination.k8s.io"] + resourceNames: ["cluster-autoscaler"] + resources: ["leases"] + verbs: ["get", "update"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: cluster-autoscaler + namespace: kube-system + labels: + k8s-addon: cluster-autoscaler.addons.k8s.io + k8s-app: cluster-autoscaler +rules: + - apiGroups: [""] + resources: ["configmaps"] + verbs: ["create","list","watch"] + - apiGroups: [""] + resources: ["configmaps"] + resourceNames: ["cluster-autoscaler-status", "cluster-autoscaler-priority-expander"] + verbs: ["delete", "get", "update", "watch"] + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: cluster-autoscaler + labels: + k8s-addon: cluster-autoscaler.addons.k8s.io + k8s-app: cluster-autoscaler +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-autoscaler +subjects: + - kind: ServiceAccount + name: cluster-autoscaler + namespace: kube-system + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: cluster-autoscaler + namespace: kube-system + labels: + k8s-addon: cluster-autoscaler.addons.k8s.io + k8s-app: cluster-autoscaler +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: cluster-autoscaler +subjects: + - kind: ServiceAccount + name: cluster-autoscaler + namespace: kube-system \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/builder/builder_all.go b/cluster-autoscaler/cloudprovider/builder/builder_all.go index e4ce5c2b18bf..ecc5176021be 100644 --- a/cluster-autoscaler/cloudprovider/builder/builder_all.go +++ b/cluster-autoscaler/cloudprovider/builder/builder_all.go @@ -1,4 +1,4 @@ -// +build !gce,!aws,!azure,!kubemark,!alicloud,!magnum,!digitalocean,!clusterapi,!huaweicloud,!ionoscloud,!linode,!hetzner +// +build !gce,!aws,!azure,!kubemark,!alicloud,!magnum,!digitalocean,!clusterapi,!huaweicloud,!ionoscloud,!linode,!hetzner,!bizflycloud /* Copyright 2018 The Kubernetes Authors. @@ -24,6 +24,7 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/azure" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/baiducloud" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/bizflycloud" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/cloudstack" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/clusterapi" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/digitalocean" @@ -56,6 +57,7 @@ var AvailableCloudProviders = []string{ cloudprovider.ClusterAPIProiverName, cloudprovider.IonoscloudProviderName, cloudprovider.LinodeProviderName, + cloudprovider.BizflyCloudProviderName, } // DefaultCloudProvider is GCE. @@ -63,6 +65,8 @@ const DefaultCloudProvider = cloudprovider.GceProviderName func buildCloudProvider(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider { switch opts.CloudProviderName { + case cloudprovider.BizflyCloudProviderName: + return bizflycloud.BuildBizflyCloud(opts, do, rl) case cloudprovider.GceProviderName: return gce.BuildGCE(opts, do, rl) case cloudprovider.AwsProviderName: diff --git a/cluster-autoscaler/cloudprovider/builder/builder_bizflycloud.go b/cluster-autoscaler/cloudprovider/builder/builder_bizflycloud.go new file mode 100644 index 000000000000..11c05dff52d0 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/builder/builder_bizflycloud.go @@ -0,0 +1,42 @@ +// +build bizflycloud + +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/bizflycloud" + "k8s.io/autoscaler/cluster-autoscaler/config" +) + +// AvailableCloudProviders supported by the Bizflycloud provider builder. +var AvailableCloudProviders = []string{ + cloudprovider.BizflyCloudProviderName, +} + +// DefaultCloudProvider build is Bizflycloud.. +const DefaultCloudProvider = cloudprovider.BizflyCloudProviderName + +func buildCloudProvider(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider { + switch opts.CloudProviderName { + case cloudprovider.BizflyCloudProviderName: + return bizflycloud.BuildBizflyCloud(opts, do, rl) + } + + return nil +} diff --git a/cluster-autoscaler/cloudprovider/cloud_provider.go b/cluster-autoscaler/cloudprovider/cloud_provider.go index 2176ad61bfb2..c525ac17a332 100644 --- a/cluster-autoscaler/cloudprovider/cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/cloud_provider.go @@ -37,6 +37,8 @@ const ( // BaiducloudProviderName gets the provider name of baiducloud BaiducloudProviderName = "baiducloud" // CloudStackProviderName gets the provider name of cloudstack + BizflyCloudProviderName = "bizflycloud" + // CloudStackProviderName gets the provider name of cloudstack CloudStackProviderName = "cloudstack" // ClusterAPIProiverName gets the provider name of clusterapi ClusterAPIProiverName = "clusterapi" diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index b0800993085d..f0b597049a07 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -149,6 +149,7 @@ def file_extension(filename): "vendor", "test/e2e/generated/bindata.go", "hack/boilerplate/test", "pkg/generated/bindata.go", "cluster-autoscaler/cloudprovider/huaweicloud/huaweicloud-sdk-go-v3", + "cluster-autoscaler/cloudprovider/bizflycloud/gobizfly" "cluster-autoscaler/cloudprovider/digitalocean/godo", "cluster-autoscaler/cloudprovider/magnum/gophercloud", "cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go", diff --git a/hack/verify-gofmt.sh b/hack/verify-gofmt.sh index e620f78cd363..de1e2f459610 100755 --- a/hack/verify-gofmt.sh +++ b/hack/verify-gofmt.sh @@ -36,6 +36,7 @@ find_files() { -o -wholename '*/vendor/*' \ -o -wholename './cluster-autoscaler/cloudprovider/magnum/gophercloud/*' \ -o -wholename './cluster-autoscaler/cloudprovider/digitalocean/godo/*' \ + -o -wholename './cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/*' \ -o -wholename './cluster-autoscaler/cloudprovider/huaweicloud/huaweicloud-sdk-go-v3/*' \ -o -wholename './cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go/*' \ -o -wholename './cluster-autoscaler/cloudprovider/hetzner/hcloud-go/*' \ diff --git a/hack/verify-golint.sh b/hack/verify-golint.sh index db368e898179..c65ee672e191 100755 --- a/hack/verify-golint.sh +++ b/hack/verify-golint.sh @@ -27,6 +27,7 @@ excluded_packages=( 'vertical-pod-autoscaler/pkg/client' 'cluster-autoscaler/cloudprovider/magnum/gophercloud' 'cluster-autoscaler/cloudprovider/digitalocean/godo' + 'cluster-autoscaler/cloudprovider/bizflycloud/gobizfly' 'cluster-autoscaler/cloudprovider/exoscale/internal' 'cluster-autoscaler/cloudprovider/huaweicloud/huaweicloud-sdk-go-v3' 'cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go' diff --git a/hack/verify-spelling.sh b/hack/verify-spelling.sh index 148c60dd60dc..3b7d2b12c3ec 100755 --- a/hack/verify-spelling.sh +++ b/hack/verify-spelling.sh @@ -23,4 +23,4 @@ DIR=$(dirname $0) go install ${DIR}/../../../github.com/client9/misspell/cmd/misspell # Spell checking -git ls-files --full-name | grep -v -e vendor | grep -v cluster-autoscaler/cloudprovider/magnum/gophercloud| grep -v cluster-autoscaler/cloudprovider/huaweicloud/huaweicloud-sdk-go-v3 | grep -v cluster-autoscaler/cloudprovider/digitalocean/godo | grep -v cluster-autoscaler/cloudprovider/hetzner/hcloud-go | xargs misspell -error -o stderr +git ls-files --full-name | grep -v -e vendor | grep -v cluster-autoscaler/cloudprovider/magnum/gophercloud| grep -v cluster-autoscaler/cloudprovider/huaweicloud/huaweicloud-sdk-go-v3 | grep -v cluster-autoscaler/cloudprovider/digitalocean/godo | grep -v cluster-autoscaler/cloudprovider/hetzner/hcloud-go | grep -v cluster-autoscaler/cloudprovider/bizflycloud/gobizfly | xargs misspell -error -o stderr From b57ba6edb7672d10014b75893adee4c2f384ad39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Minh=20Qu=C3=A2n?= Date: Mon, 12 Apr 2021 14:17:00 +0700 Subject: [PATCH 05/86] Fix/Provider name --- cluster-autoscaler/cloudprovider/cloud_provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/cloud_provider.go b/cluster-autoscaler/cloudprovider/cloud_provider.go index c525ac17a332..71ca976df2f6 100644 --- a/cluster-autoscaler/cloudprovider/cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/cloud_provider.go @@ -36,7 +36,7 @@ const ( AwsProviderName = "aws" // BaiducloudProviderName gets the provider name of baiducloud BaiducloudProviderName = "baiducloud" - // CloudStackProviderName gets the provider name of cloudstack + // BizflyCloudProviderName gets the provider name of bizflycloud BizflyCloudProviderName = "bizflycloud" // CloudStackProviderName gets the provider name of cloudstack CloudStackProviderName = "cloudstack" From 90bd1ebadb1bd58f359920457abd2803a3ad2de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Minh=20Qu=C3=A2n?= Date: Mon, 12 Apr 2021 14:34:16 +0700 Subject: [PATCH 06/86] Fix/Add bizflycloud package in skipped_dirs --- hack/boilerplate/boilerplate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index f0b597049a07..7f17514a71df 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -149,7 +149,7 @@ def file_extension(filename): "vendor", "test/e2e/generated/bindata.go", "hack/boilerplate/test", "pkg/generated/bindata.go", "cluster-autoscaler/cloudprovider/huaweicloud/huaweicloud-sdk-go-v3", - "cluster-autoscaler/cloudprovider/bizflycloud/gobizfly" + "cluster-autoscaler/cloudprovider/bizflycloud/gobizfly", "cluster-autoscaler/cloudprovider/digitalocean/godo", "cluster-autoscaler/cloudprovider/magnum/gophercloud", "cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go", From dd8005d919eaaf9e80c34905918fe081c8c05dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Minh=20Qu=C3=A2n?= Date: Wed, 14 Apr 2021 18:40:31 +0700 Subject: [PATCH 07/86] Add Bizfly Cloud provider to README --- cluster-autoscaler/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cluster-autoscaler/README.md b/cluster-autoscaler/README.md index 3b89d292b0da..ac996cd63659 100644 --- a/cluster-autoscaler/README.md +++ b/cluster-autoscaler/README.md @@ -25,6 +25,7 @@ You should also take a look at the notes and "gotchas" for your specific cloud p * [OVHcloud](./cloudprovider/ovhcloud/README.md) * [Linode](./cloudprovider/linode/README.md) * [ClusterAPI](./cloudprovider/clusterapi/README.md) +* [BizflyCloud](./cloudprovider/bizflycloud/README.md) # Releases From e95938525793a9c6d6a813eb7ae16488b1a64087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Minh=20Qu=C3=A2n?= Date: Thu, 15 Apr 2021 12:35:33 +0700 Subject: [PATCH 08/86] Update license for Bizfly Cloud dependencies --- .../bizflycloud/gobizfly/COPYING | 674 ------------------ .../bizflycloud/gobizfly/LICENSE | 21 + .../bizflycloud/gobizfly/account.go | 2 + .../bizflycloud/gobizfly/alert.go | 15 - .../bizflycloud/gobizfly/autoscaling.go | 15 - .../cloudprovider/bizflycloud/gobizfly/cdn.go | 15 - .../bizflycloud/gobizfly/client.go | 16 - .../bizflycloud/gobizfly/common.go | 15 - .../gobizfly/container_registry.go | 15 - .../cloudprovider/bizflycloud/gobizfly/dns.go | 15 - .../bizflycloud/gobizfly/firewall.go | 15 - .../bizflycloud/gobizfly/kubernetes.go | 15 - .../bizflycloud/gobizfly/loadbalancer.go | 15 - .../bizflycloud/gobizfly/server.go | 15 - .../bizflycloud/gobizfly/service.go | 15 - .../bizflycloud/gobizfly/snapshot.go | 15 - .../bizflycloud/gobizfly/ssh_key.go | 15 - .../bizflycloud/gobizfly/token.go | 15 - .../bizflycloud/gobizfly/volume.go | 15 - .../cloudprovider/bizflycloud/gobizfly/vpc.go | 15 - 20 files changed, 23 insertions(+), 930 deletions(-) delete mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/COPYING create mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/LICENSE diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/COPYING b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/COPYING deleted file mode 100644 index f288702d2fa1..000000000000 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/LICENSE b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/LICENSE new file mode 100644 index 000000000000..4166c66b64d1 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 BizFly Cloud + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/account.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/account.go index 7625ab395860..86f220eca1d8 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/account.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/account.go @@ -1,3 +1,5 @@ +// This file is part of gobizfly + package gobizfly import ( diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/alert.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/alert.go index 9f9a45f09ac3..f179d0990c36 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/alert.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/alert.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/autoscaling.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/autoscaling.go index 60d91332addb..f3ca12dce3f2 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/autoscaling.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/autoscaling.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/cdn.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/cdn.go index 3c16b2f02fe5..4101c887fa5f 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/cdn.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/cdn.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/client.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/client.go index 4d8d8902e2d0..31850f530be5 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/client.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/client.go @@ -1,21 +1,5 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see -// Package gobizfly is the BizFly API client for Go. package gobizfly import ( diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/common.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/common.go index fd8e06f11974..e4b10d7d71a4 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/common.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/common.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/container_registry.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/container_registry.go index ff59a32506e2..8e974df25802 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/container_registry.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/container_registry.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/dns.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/dns.go index 6b1819ab1aec..25c69bc2a5fb 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/dns.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/dns.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/firewall.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/firewall.go index fe1ce7b80475..2cbd371b5c8c 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/firewall.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/firewall.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/kubernetes.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/kubernetes.go index 39ba6fdcf767..b0dc2ce36fd8 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/kubernetes.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/kubernetes.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/loadbalancer.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/loadbalancer.go index 56685da0fb08..3570ae68cb52 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/loadbalancer.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/loadbalancer.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/server.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/server.go index 0591a39e0ed3..09665a33bd81 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/server.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/server.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/service.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/service.go index 056f785e4241..6e45be92137d 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/service.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/service.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/snapshot.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/snapshot.go index 11e1870c23e3..5dce5ba29ec4 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/snapshot.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/snapshot.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/ssh_key.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/ssh_key.go index 2550597d0b35..a3c51234f6dc 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/ssh_key.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/ssh_key.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/token.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/token.go index 98aa8ef47514..55caec9ded9d 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/token.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/token.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/volume.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/volume.go index d5469e8b54dc..2d69c10824e6 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/volume.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/volume.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/vpc.go b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/vpc.go index a235fd93d7dd..1de39ac8a47d 100644 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/vpc.go +++ b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/vpc.go @@ -1,19 +1,4 @@ // This file is part of gobizfly -// -// Copyright (C) 2020 BizFly Cloud -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see package gobizfly From ec2676b36686471c6da5db588c7b519133e300ec Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 19 Apr 2021 16:04:23 +0300 Subject: [PATCH 09/86] add required api resources to hetzner cluster-autoscaler example --- .../hetzner/examples/cluster-autoscaler-run-on-master.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/hetzner/examples/cluster-autoscaler-run-on-master.yaml b/cluster-autoscaler/cloudprovider/hetzner/examples/cluster-autoscaler-run-on-master.yaml index 6b0aa5e0a242..40c50e21cd57 100644 --- a/cluster-autoscaler/cloudprovider/hetzner/examples/cluster-autoscaler-run-on-master.yaml +++ b/cluster-autoscaler/cloudprovider/hetzner/examples/cluster-autoscaler-run-on-master.yaml @@ -50,7 +50,7 @@ rules: resources: ["statefulsets", "replicasets", "daemonsets"] verbs: ["watch", "list", "get"] - apiGroups: ["storage.k8s.io"] - resources: ["storageclasses", "csinodes"] + resources: ["storageclasses", "csinodes", "csistoragecapacities", "csidrivers"] verbs: ["watch", "list", "get"] - apiGroups: ["batch", "extensions"] resources: ["jobs"] From 037dc7367aba21bb2f593be09d85a7c99d0f894d Mon Sep 17 00:00:00 2001 From: Benjamin Pineau Date: Wed, 6 Jan 2021 12:02:19 +0100 Subject: [PATCH 10/86] Don't pile up successive full refreshes during AWS scaledowns Force refreshing everything at every DeleteNodes calls causes slow down and throttling on large clusters with many ASGs (and lot of activity). That function might be called several times in a row during scale-down (once for each ASG having a node to be removed). Each time the forced refresh will re-discover all ASGs, all LaunchConfigurations, then re-list all instances from discovered ASGs. That immediate refresh isn't required anyway, as the cache's DeleteInstances concrete implementation will decrement the nodegroup size, and we can schedule a grouped refresh for the next loop iteration. --- .../cloudprovider/aws/aws_cloud_provider_test.go | 4 ++-- cluster-autoscaler/cloudprovider/aws/aws_manager.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go b/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go index 587833779335..4ae024c437d4 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go @@ -469,7 +469,7 @@ func TestDeleteNodes(t *testing.T) { err = asgs[0].DeleteNodes([]*apiv1.Node{node}) assert.NoError(t, err) service.AssertNumberOfCalls(t, "TerminateInstanceInAutoScalingGroup", 1) - service.AssertNumberOfCalls(t, "DescribeAutoScalingGroupsPages", 2) + service.AssertNumberOfCalls(t, "DescribeAutoScalingGroupsPages", 1) newSize, err := asgs[0].TargetSize() assert.NoError(t, err) @@ -516,7 +516,7 @@ func TestDeleteNodesWithPlaceholder(t *testing.T) { err = asgs[0].DeleteNodes([]*apiv1.Node{node}) assert.NoError(t, err) service.AssertNumberOfCalls(t, "SetDesiredCapacity", 1) - service.AssertNumberOfCalls(t, "DescribeAutoScalingGroupsPages", 2) + service.AssertNumberOfCalls(t, "DescribeAutoScalingGroupsPages", 1) newSize, err := asgs[0].TargetSize() assert.NoError(t, err) diff --git a/cluster-autoscaler/cloudprovider/aws/aws_manager.go b/cluster-autoscaler/cloudprovider/aws/aws_manager.go index d9f71bec8281..361eed052c91 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_manager.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_manager.go @@ -294,8 +294,9 @@ func (m *AwsManager) DeleteInstances(instances []*AwsInstanceRef) error { if err := m.asgCache.DeleteInstances(instances); err != nil { return err } - klog.V(2).Infof("Some ASG instances might have been deleted, forcing ASG list refresh") - return m.forceRefresh() + klog.V(2).Infof("DeleteInstances was called: scheduling an ASG list refresh for next main loop evaluation") + m.lastRefresh = time.Now().Add(-refreshInterval) + return nil } // GetAsgNodes returns Asg nodes. From 3ffe4b3557d716eddc540336adf670503f66549f Mon Sep 17 00:00:00 2001 From: Benjamin Pineau Date: Tue, 26 Jan 2021 11:18:29 +0100 Subject: [PATCH 11/86] aws: support arm64 instances Sets the `kubernetes.io/arch` (and legacy `beta.kubernetes.io/arch`) to the proper instance architecture. While at it, re-gen the instance types list (adding new instance types that were missing) --- .../cloudprovider/aws/aws_manager.go | 3 +- .../cloudprovider/aws/aws_manager_test.go | 2 + .../cloudprovider/aws/aws_util.go | 14 + .../cloudprovider/aws/aws_util_test.go | 25 + .../cloudprovider/aws/ec2_instance_types.go | 534 ++++++++++++++++++ .../aws/ec2_instance_types/gen.go | 2 + 6 files changed, 579 insertions(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/aws/aws_manager.go b/cluster-autoscaler/cloudprovider/aws/aws_manager.go index d9f387e34851..ad440564933a 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_manager.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_manager.go @@ -390,7 +390,8 @@ func (m *AwsManager) buildNodeFromTemplate(asg *asg, template *asgTemplate) (*ap func buildGenericLabels(template *asgTemplate, nodeName string) map[string]string { result := make(map[string]string) // TODO: extract it somehow - result[kubeletapis.LabelArch] = cloudprovider.DefaultArch + result[kubeletapis.LabelArch] = template.InstanceType.Architecture + result[apiv1.LabelArchStable] = template.InstanceType.Architecture result[kubeletapis.LabelOS] = cloudprovider.DefaultOS result[apiv1.LabelInstanceType] = template.InstanceType.InstanceType diff --git a/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go b/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go index e03caed1283b..e1a548ce7a91 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go @@ -77,6 +77,7 @@ func TestBuildGenericLabels(t *testing.T) { InstanceType: "c4.large", VCPU: 2, MemoryMb: 3840, + Architecture: cloudprovider.DefaultArch, }, Region: "us-east-1", }, "sillyname") @@ -84,6 +85,7 @@ func TestBuildGenericLabels(t *testing.T) { assert.Equal(t, "sillyname", labels[apiv1.LabelHostname]) assert.Equal(t, "c4.large", labels[apiv1.LabelInstanceType]) assert.Equal(t, cloudprovider.DefaultArch, labels[kubeletapis.LabelArch]) + assert.Equal(t, cloudprovider.DefaultArch, labels[apiv1.LabelArchStable]) assert.Equal(t, cloudprovider.DefaultOS, labels[kubeletapis.LabelOS]) } diff --git a/cluster-autoscaler/cloudprovider/aws/aws_util.go b/cluster-autoscaler/cloudprovider/aws/aws_util.go index 6085ffe89e64..223eb547035b 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_util.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_util.go @@ -35,6 +35,7 @@ var ( ec2PricingServiceUrlTemplate = "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/%s/index.json" ec2PricingServiceUrlTemplateCN = "https://pricing.cn-north-1.amazonaws.com.cn/offers/v1.0/cn/AmazonEC2/current/%s/index.json" staticListLastUpdateTime = "2020-12-07" + ec2Arm64Processors = []string{"AWS Graviton Processor", "AWS Graviton2 Processor"} ) type response struct { @@ -50,6 +51,7 @@ type productAttributes struct { VCPU string `json:"vcpu"` Memory string `json:"memory"` GPU string `json:"gpu"` + Architecture string `json:"physicalProcessor"` } // GenerateEC2InstanceTypes returns a map of ec2 resources @@ -110,6 +112,9 @@ func GenerateEC2InstanceTypes(region string) (map[string]*InstanceType, error) { if attr.GPU != "" { instanceTypes[attr.InstanceType].GPU = parseCPU(attr.GPU) } + if attr.Architecture != "" { + instanceTypes[attr.InstanceType].Architecture = parseArchitecture(attr.Architecture) + } } } } @@ -150,6 +155,15 @@ func parseCPU(cpu string) int64 { return i } +func parseArchitecture(archName string) string { + for _, processor := range ec2Arm64Processors { + if archName == processor { + return "arm64" + } + } + return "amd64" +} + // GetCurrentAwsRegion return region of current cluster without building awsManager func GetCurrentAwsRegion() (string, error) { region, present := os.LookupEnv("AWS_REGION") diff --git a/cluster-autoscaler/cloudprovider/aws/aws_util_test.go b/cluster-autoscaler/cloudprovider/aws/aws_util_test.go index 6027babd8900..55ef894a6197 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_util_test.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_util_test.go @@ -77,6 +77,31 @@ func TestParseCPU(t *testing.T) { } } +func TestParseArchitecture(t *testing.T) { + tests := []struct { + input string + expect string + }{ + { + input: "Intel Xeon Platinum 8259 (Cascade Lake)", + expect: "amd64", + }, + { + input: "AWS Graviton2 Processor", + expect: "arm64", + }, + { + input: "anything default", + expect: "amd64", + }, + } + + for _, test := range tests { + got := parseArchitecture(test.input) + assert.Equal(t, test.expect, got) + } +} + func TestGetCurrentAwsRegion(t *testing.T) { region := "us-west-2" if oldRegion, found := os.LookupEnv("AWS_REGION"); found { diff --git a/cluster-autoscaler/cloudprovider/aws/ec2_instance_types.go b/cluster-autoscaler/cloudprovider/aws/ec2_instance_types.go index fa7df49b185c..855c4a47acbf 100644 --- a/cluster-autoscaler/cloudprovider/aws/ec2_instance_types.go +++ b/cluster-autoscaler/cloudprovider/aws/ec2_instance_types.go @@ -24,6 +24,7 @@ type InstanceType struct { VCPU int64 MemoryMb int64 GPU int64 + Architecture string } // InstanceTypes is a map of ec2 resources @@ -33,2567 +34,3100 @@ var InstanceTypes = map[string]*InstanceType{ VCPU: 16, MemoryMb: 0, GPU: 0, + Architecture: "arm64", }, "a1.2xlarge": { InstanceType: "a1.2xlarge", VCPU: 8, MemoryMb: 16384, GPU: 0, + Architecture: "arm64", }, "a1.4xlarge": { InstanceType: "a1.4xlarge", VCPU: 16, MemoryMb: 32768, GPU: 0, + Architecture: "arm64", }, "a1.large": { InstanceType: "a1.large", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "arm64", }, "a1.medium": { InstanceType: "a1.medium", VCPU: 1, MemoryMb: 2048, GPU: 0, + Architecture: "arm64", }, "a1.metal": { InstanceType: "a1.metal", VCPU: 16, MemoryMb: 32768, GPU: 0, + Architecture: "arm64", }, "a1.xlarge": { InstanceType: "a1.xlarge", VCPU: 4, MemoryMb: 8192, GPU: 0, + Architecture: "arm64", }, "c1.medium": { InstanceType: "c1.medium", VCPU: 2, MemoryMb: 1740, GPU: 0, + Architecture: "amd64", }, "c1.xlarge": { InstanceType: "c1.xlarge", VCPU: 8, MemoryMb: 7168, GPU: 0, + Architecture: "amd64", }, "c3": { InstanceType: "c3", VCPU: 32, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "c3.2xlarge": { InstanceType: "c3.2xlarge", VCPU: 8, MemoryMb: 15360, GPU: 0, + Architecture: "amd64", }, "c3.4xlarge": { InstanceType: "c3.4xlarge", VCPU: 16, MemoryMb: 30720, GPU: 0, + Architecture: "amd64", }, "c3.8xlarge": { InstanceType: "c3.8xlarge", VCPU: 32, MemoryMb: 61440, GPU: 0, + Architecture: "amd64", }, "c3.large": { InstanceType: "c3.large", VCPU: 2, MemoryMb: 3840, GPU: 0, + Architecture: "amd64", }, "c3.xlarge": { InstanceType: "c3.xlarge", VCPU: 4, MemoryMb: 7680, GPU: 0, + Architecture: "amd64", }, "c4": { InstanceType: "c4", VCPU: 36, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "c4.2xlarge": { InstanceType: "c4.2xlarge", VCPU: 8, MemoryMb: 15360, GPU: 0, + Architecture: "amd64", }, "c4.4xlarge": { InstanceType: "c4.4xlarge", VCPU: 16, MemoryMb: 30720, GPU: 0, + Architecture: "amd64", }, "c4.8xlarge": { InstanceType: "c4.8xlarge", VCPU: 36, MemoryMb: 61440, GPU: 0, + Architecture: "amd64", }, "c4.large": { InstanceType: "c4.large", VCPU: 2, MemoryMb: 3840, GPU: 0, + Architecture: "amd64", }, "c4.xlarge": { InstanceType: "c4.xlarge", VCPU: 4, MemoryMb: 7680, GPU: 0, + Architecture: "amd64", }, "c5": { InstanceType: "c5", VCPU: 72, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "c5.12xlarge": { InstanceType: "c5.12xlarge", VCPU: 48, MemoryMb: 98304, GPU: 0, + Architecture: "amd64", }, "c5.18xlarge": { InstanceType: "c5.18xlarge", VCPU: 72, MemoryMb: 147456, GPU: 0, + Architecture: "amd64", }, "c5.24xlarge": { InstanceType: "c5.24xlarge", VCPU: 96, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "c5.2xlarge": { InstanceType: "c5.2xlarge", VCPU: 8, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "c5.4xlarge": { InstanceType: "c5.4xlarge", VCPU: 16, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "c5.9xlarge": { InstanceType: "c5.9xlarge", VCPU: 36, MemoryMb: 73728, GPU: 0, + Architecture: "amd64", }, "c5.large": { InstanceType: "c5.large", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "amd64", }, "c5.metal": { InstanceType: "c5.metal", VCPU: 96, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "c5.xlarge": { InstanceType: "c5.xlarge", VCPU: 4, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "c5a.12xlarge": { InstanceType: "c5a.12xlarge", VCPU: 48, MemoryMb: 98304, GPU: 0, + Architecture: "amd64", }, "c5a.16xlarge": { InstanceType: "c5a.16xlarge", VCPU: 64, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "c5a.24xlarge": { InstanceType: "c5a.24xlarge", VCPU: 96, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "c5a.2xlarge": { InstanceType: "c5a.2xlarge", VCPU: 8, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "c5a.4xlarge": { InstanceType: "c5a.4xlarge", VCPU: 16, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "c5a.8xlarge": { InstanceType: "c5a.8xlarge", VCPU: 32, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "c5a.large": { InstanceType: "c5a.large", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "amd64", }, "c5a.xlarge": { InstanceType: "c5a.xlarge", VCPU: 4, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "c5ad.12xlarge": { InstanceType: "c5ad.12xlarge", VCPU: 48, MemoryMb: 98304, GPU: 0, + Architecture: "amd64", }, "c5ad.16xlarge": { InstanceType: "c5ad.16xlarge", VCPU: 64, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "c5ad.24xlarge": { InstanceType: "c5ad.24xlarge", VCPU: 96, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "c5ad.2xlarge": { InstanceType: "c5ad.2xlarge", VCPU: 8, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "c5ad.4xlarge": { InstanceType: "c5ad.4xlarge", VCPU: 16, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "c5ad.8xlarge": { InstanceType: "c5ad.8xlarge", VCPU: 32, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "c5ad.large": { InstanceType: "c5ad.large", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "amd64", }, "c5ad.xlarge": { InstanceType: "c5ad.xlarge", VCPU: 4, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "c5d": { InstanceType: "c5d", VCPU: 72, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "c5d.12xlarge": { InstanceType: "c5d.12xlarge", VCPU: 48, MemoryMb: 98304, GPU: 0, + Architecture: "amd64", }, "c5d.18xlarge": { InstanceType: "c5d.18xlarge", VCPU: 72, MemoryMb: 147456, GPU: 0, + Architecture: "amd64", }, "c5d.24xlarge": { InstanceType: "c5d.24xlarge", VCPU: 96, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "c5d.2xlarge": { InstanceType: "c5d.2xlarge", VCPU: 8, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "c5d.4xlarge": { InstanceType: "c5d.4xlarge", VCPU: 16, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "c5d.9xlarge": { InstanceType: "c5d.9xlarge", VCPU: 36, MemoryMb: 73728, GPU: 0, + Architecture: "amd64", }, "c5d.large": { InstanceType: "c5d.large", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "amd64", }, "c5d.metal": { InstanceType: "c5d.metal", VCPU: 96, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "c5d.xlarge": { InstanceType: "c5d.xlarge", VCPU: 4, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "c5n": { InstanceType: "c5n", VCPU: 72, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "c5n.18xlarge": { InstanceType: "c5n.18xlarge", VCPU: 72, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "c5n.2xlarge": { InstanceType: "c5n.2xlarge", VCPU: 8, MemoryMb: 21504, GPU: 0, + Architecture: "amd64", }, "c5n.4xlarge": { InstanceType: "c5n.4xlarge", VCPU: 16, MemoryMb: 43008, GPU: 0, + Architecture: "amd64", }, "c5n.9xlarge": { InstanceType: "c5n.9xlarge", VCPU: 36, MemoryMb: 98304, GPU: 0, + Architecture: "amd64", }, "c5n.large": { InstanceType: "c5n.large", VCPU: 2, MemoryMb: 5376, GPU: 0, + Architecture: "amd64", }, "c5n.metal": { InstanceType: "c5n.metal", VCPU: 72, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "c5n.xlarge": { InstanceType: "c5n.xlarge", VCPU: 4, MemoryMb: 10752, GPU: 0, + Architecture: "amd64", }, "c6g": { InstanceType: "c6g", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "arm64", }, "c6g.12xlarge": { InstanceType: "c6g.12xlarge", VCPU: 48, MemoryMb: 98304, GPU: 0, + Architecture: "arm64", }, "c6g.16xlarge": { InstanceType: "c6g.16xlarge", VCPU: 64, MemoryMb: 131072, GPU: 0, + Architecture: "arm64", }, "c6g.2xlarge": { InstanceType: "c6g.2xlarge", VCPU: 8, MemoryMb: 16384, GPU: 0, + Architecture: "arm64", }, "c6g.4xlarge": { InstanceType: "c6g.4xlarge", VCPU: 16, MemoryMb: 32768, GPU: 0, + Architecture: "arm64", }, "c6g.8xlarge": { InstanceType: "c6g.8xlarge", VCPU: 32, MemoryMb: 65536, GPU: 0, + Architecture: "arm64", }, "c6g.large": { InstanceType: "c6g.large", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "arm64", }, "c6g.medium": { InstanceType: "c6g.medium", VCPU: 1, MemoryMb: 2048, GPU: 0, + Architecture: "arm64", }, "c6g.metal": { InstanceType: "c6g.metal", VCPU: 64, MemoryMb: 131072, GPU: 0, + Architecture: "arm64", }, "c6g.xlarge": { InstanceType: "c6g.xlarge", VCPU: 4, MemoryMb: 8192, GPU: 0, + Architecture: "arm64", }, "c6gd": { InstanceType: "c6gd", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "arm64", }, "c6gd.12xlarge": { InstanceType: "c6gd.12xlarge", VCPU: 48, MemoryMb: 98304, GPU: 0, + Architecture: "arm64", }, "c6gd.16xlarge": { InstanceType: "c6gd.16xlarge", VCPU: 64, MemoryMb: 131072, GPU: 0, + Architecture: "arm64", }, "c6gd.2xlarge": { InstanceType: "c6gd.2xlarge", VCPU: 8, MemoryMb: 16384, GPU: 0, + Architecture: "arm64", }, "c6gd.4xlarge": { InstanceType: "c6gd.4xlarge", VCPU: 16, MemoryMb: 32768, GPU: 0, + Architecture: "arm64", }, "c6gd.8xlarge": { InstanceType: "c6gd.8xlarge", VCPU: 32, MemoryMb: 65536, GPU: 0, + Architecture: "arm64", }, "c6gd.large": { InstanceType: "c6gd.large", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "arm64", }, "c6gd.medium": { InstanceType: "c6gd.medium", VCPU: 1, MemoryMb: 2048, GPU: 0, + Architecture: "arm64", }, "c6gd.metal": { InstanceType: "c6gd.metal", VCPU: 64, MemoryMb: 131072, GPU: 0, + Architecture: "arm64", }, "c6gd.xlarge": { InstanceType: "c6gd.xlarge", VCPU: 4, MemoryMb: 8192, GPU: 0, + Architecture: "arm64", + }, + "c6gn": { + InstanceType: "c6gn", + VCPU: 64, + MemoryMb: 0, + GPU: 0, + Architecture: "arm64", + }, + "c6gn.12xlarge": { + InstanceType: "c6gn.12xlarge", + VCPU: 48, + MemoryMb: 98304, + GPU: 0, + Architecture: "arm64", + }, + "c6gn.16xlarge": { + InstanceType: "c6gn.16xlarge", + VCPU: 64, + MemoryMb: 131072, + GPU: 0, + Architecture: "arm64", + }, + "c6gn.2xlarge": { + InstanceType: "c6gn.2xlarge", + VCPU: 8, + MemoryMb: 16384, + GPU: 0, + Architecture: "arm64", + }, + "c6gn.4xlarge": { + InstanceType: "c6gn.4xlarge", + VCPU: 16, + MemoryMb: 32768, + GPU: 0, + Architecture: "arm64", + }, + "c6gn.8xlarge": { + InstanceType: "c6gn.8xlarge", + VCPU: 32, + MemoryMb: 65536, + GPU: 0, + Architecture: "arm64", + }, + "c6gn.large": { + InstanceType: "c6gn.large", + VCPU: 2, + MemoryMb: 4096, + GPU: 0, + Architecture: "arm64", + }, + "c6gn.medium": { + InstanceType: "c6gn.medium", + VCPU: 1, + MemoryMb: 2048, + GPU: 0, + Architecture: "arm64", + }, + "c6gn.metal": { + InstanceType: "c6gn.metal", + VCPU: 64, + MemoryMb: 131072, + GPU: 0, + Architecture: "arm64", + }, + "c6gn.xlarge": { + InstanceType: "c6gn.xlarge", + VCPU: 4, + MemoryMb: 8192, + GPU: 0, + Architecture: "arm64", }, "cc2.8xlarge": { InstanceType: "cc2.8xlarge", VCPU: 32, MemoryMb: 61952, GPU: 0, + Architecture: "amd64", }, "cr1.8xlarge": { InstanceType: "cr1.8xlarge", VCPU: 32, MemoryMb: 249856, GPU: 0, + Architecture: "amd64", }, "d2": { InstanceType: "d2", VCPU: 36, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "d2.2xlarge": { InstanceType: "d2.2xlarge", VCPU: 8, MemoryMb: 62464, GPU: 0, + Architecture: "amd64", }, "d2.4xlarge": { InstanceType: "d2.4xlarge", VCPU: 16, MemoryMb: 124928, GPU: 0, + Architecture: "amd64", }, "d2.8xlarge": { InstanceType: "d2.8xlarge", VCPU: 36, MemoryMb: 249856, GPU: 0, + Architecture: "amd64", }, "d2.xlarge": { InstanceType: "d2.xlarge", VCPU: 4, MemoryMb: 31232, GPU: 0, + Architecture: "amd64", }, "d3.2xlarge": { InstanceType: "d3.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "d3.4xlarge": { InstanceType: "d3.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "d3.8xlarge": { InstanceType: "d3.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "d3.xlarge": { InstanceType: "d3.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "d3en.12xlarge": { InstanceType: "d3en.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "d3en.2xlarge": { InstanceType: "d3en.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "d3en.4xlarge": { InstanceType: "d3en.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "d3en.6xlarge": { InstanceType: "d3en.6xlarge", VCPU: 24, MemoryMb: 98304, GPU: 0, + Architecture: "amd64", }, "d3en.8xlarge": { InstanceType: "d3en.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "d3en.xlarge": { InstanceType: "d3en.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "f1": { InstanceType: "f1", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "f1.16xlarge": { InstanceType: "f1.16xlarge", VCPU: 64, MemoryMb: 999424, GPU: 0, + Architecture: "amd64", }, "f1.2xlarge": { InstanceType: "f1.2xlarge", VCPU: 8, MemoryMb: 124928, GPU: 0, + Architecture: "amd64", }, "f1.4xlarge": { InstanceType: "f1.4xlarge", VCPU: 16, MemoryMb: 249856, GPU: 0, + Architecture: "amd64", }, "g2": { InstanceType: "g2", VCPU: 32, MemoryMb: 0, GPU: 4, + Architecture: "amd64", }, "g2.2xlarge": { InstanceType: "g2.2xlarge", VCPU: 8, MemoryMb: 15360, GPU: 1, + Architecture: "amd64", }, "g2.8xlarge": { InstanceType: "g2.8xlarge", VCPU: 32, MemoryMb: 61440, GPU: 4, + Architecture: "amd64", }, "g3": { InstanceType: "g3", VCPU: 64, MemoryMb: 0, GPU: 4, + Architecture: "amd64", }, "g3.16xlarge": { InstanceType: "g3.16xlarge", VCPU: 64, MemoryMb: 499712, GPU: 4, + Architecture: "amd64", }, "g3.4xlarge": { InstanceType: "g3.4xlarge", VCPU: 16, MemoryMb: 124928, GPU: 1, + Architecture: "amd64", }, "g3.8xlarge": { InstanceType: "g3.8xlarge", VCPU: 32, MemoryMb: 249856, GPU: 2, + Architecture: "amd64", }, "g3s.xlarge": { InstanceType: "g3s.xlarge", VCPU: 4, MemoryMb: 31232, GPU: 1, + Architecture: "amd64", + }, + "g4ad": { + InstanceType: "g4ad", + VCPU: 192, + MemoryMb: 0, + GPU: 2, + Architecture: "amd64", + }, + "g4ad.16xlarge": { + InstanceType: "g4ad.16xlarge", + VCPU: 64, + MemoryMb: 262144, + GPU: 4, + Architecture: "amd64", + }, + "g4ad.4xlarge": { + InstanceType: "g4ad.4xlarge", + VCPU: 16, + MemoryMb: 65536, + GPU: 1, + Architecture: "amd64", + }, + "g4ad.8xlarge": { + InstanceType: "g4ad.8xlarge", + VCPU: 32, + MemoryMb: 131072, + GPU: 2, + Architecture: "amd64", }, "g4dn": { InstanceType: "g4dn", VCPU: 96, MemoryMb: 0, GPU: 8, + Architecture: "amd64", }, "g4dn.12xlarge": { InstanceType: "g4dn.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 4, + Architecture: "amd64", }, "g4dn.16xlarge": { InstanceType: "g4dn.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 1, + Architecture: "amd64", }, "g4dn.2xlarge": { InstanceType: "g4dn.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 1, + Architecture: "amd64", }, "g4dn.4xlarge": { InstanceType: "g4dn.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 1, + Architecture: "amd64", }, "g4dn.8xlarge": { InstanceType: "g4dn.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 1, + Architecture: "amd64", }, "g4dn.metal": { InstanceType: "g4dn.metal", VCPU: 96, MemoryMb: 393216, GPU: 8, + Architecture: "amd64", }, "g4dn.xlarge": { InstanceType: "g4dn.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 1, + Architecture: "amd64", }, "h1": { InstanceType: "h1", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "h1.16xlarge": { InstanceType: "h1.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "h1.2xlarge": { InstanceType: "h1.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "h1.4xlarge": { InstanceType: "h1.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "h1.8xlarge": { InstanceType: "h1.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "hs1.8xlarge": { InstanceType: "hs1.8xlarge", VCPU: 16, MemoryMb: 119808, GPU: 0, + Architecture: "amd64", }, "i2": { InstanceType: "i2", VCPU: 32, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "i2.2xlarge": { InstanceType: "i2.2xlarge", VCPU: 8, MemoryMb: 62464, GPU: 0, + Architecture: "amd64", }, "i2.4xlarge": { InstanceType: "i2.4xlarge", VCPU: 16, MemoryMb: 124928, GPU: 0, + Architecture: "amd64", }, "i2.8xlarge": { InstanceType: "i2.8xlarge", VCPU: 32, MemoryMb: 249856, GPU: 0, + Architecture: "amd64", }, "i2.xlarge": { InstanceType: "i2.xlarge", VCPU: 4, MemoryMb: 31232, GPU: 0, + Architecture: "amd64", }, "i3": { InstanceType: "i3", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "i3.16xlarge": { InstanceType: "i3.16xlarge", VCPU: 64, MemoryMb: 499712, GPU: 0, + Architecture: "amd64", }, "i3.2xlarge": { InstanceType: "i3.2xlarge", VCPU: 8, MemoryMb: 62464, GPU: 0, + Architecture: "amd64", }, "i3.4xlarge": { InstanceType: "i3.4xlarge", VCPU: 16, MemoryMb: 124928, GPU: 0, + Architecture: "amd64", }, "i3.8xlarge": { InstanceType: "i3.8xlarge", VCPU: 32, MemoryMb: 249856, GPU: 0, + Architecture: "amd64", }, "i3.large": { InstanceType: "i3.large", VCPU: 2, MemoryMb: 15616, GPU: 0, + Architecture: "amd64", }, "i3.metal": { InstanceType: "i3.metal", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "amd64", }, "i3.xlarge": { InstanceType: "i3.xlarge", VCPU: 4, MemoryMb: 31232, GPU: 0, + Architecture: "amd64", }, "i3en": { InstanceType: "i3en", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "i3en.12xlarge": { InstanceType: "i3en.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "i3en.24xlarge": { InstanceType: "i3en.24xlarge", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "i3en.2xlarge": { InstanceType: "i3en.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "i3en.3xlarge": { InstanceType: "i3en.3xlarge", VCPU: 12, MemoryMb: 98304, GPU: 0, + Architecture: "amd64", }, "i3en.6xlarge": { InstanceType: "i3en.6xlarge", VCPU: 24, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "i3en.large": { InstanceType: "i3en.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "i3en.metal": { InstanceType: "i3en.metal", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "i3en.xlarge": { InstanceType: "i3en.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "i3p.16xlarge": { InstanceType: "i3p.16xlarge", VCPU: 64, MemoryMb: 499712, GPU: 0, + Architecture: "amd64", }, "inf1": { InstanceType: "inf1", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "inf1.24xlarge": { InstanceType: "inf1.24xlarge", VCPU: 96, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "inf1.2xlarge": { InstanceType: "inf1.2xlarge", VCPU: 8, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "inf1.6xlarge": { InstanceType: "inf1.6xlarge", VCPU: 24, MemoryMb: 49152, GPU: 0, + Architecture: "amd64", }, "inf1.xlarge": { InstanceType: "inf1.xlarge", VCPU: 4, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "m1.large": { InstanceType: "m1.large", VCPU: 2, MemoryMb: 7680, GPU: 0, + Architecture: "amd64", }, "m1.medium": { InstanceType: "m1.medium", VCPU: 1, MemoryMb: 3840, GPU: 0, + Architecture: "amd64", }, "m1.small": { InstanceType: "m1.small", VCPU: 1, MemoryMb: 1740, GPU: 0, + Architecture: "amd64", }, "m1.xlarge": { InstanceType: "m1.xlarge", VCPU: 4, MemoryMb: 15360, GPU: 0, + Architecture: "amd64", }, "m2.2xlarge": { InstanceType: "m2.2xlarge", VCPU: 4, MemoryMb: 35020, GPU: 0, + Architecture: "amd64", }, "m2.4xlarge": { InstanceType: "m2.4xlarge", VCPU: 8, MemoryMb: 70041, GPU: 0, + Architecture: "amd64", }, "m2.xlarge": { InstanceType: "m2.xlarge", VCPU: 2, MemoryMb: 17510, GPU: 0, + Architecture: "amd64", }, "m3": { InstanceType: "m3", VCPU: 8, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "m3.2xlarge": { InstanceType: "m3.2xlarge", VCPU: 8, MemoryMb: 30720, GPU: 0, + Architecture: "amd64", }, "m3.large": { InstanceType: "m3.large", VCPU: 2, MemoryMb: 7680, GPU: 0, + Architecture: "amd64", }, "m3.medium": { InstanceType: "m3.medium", VCPU: 1, MemoryMb: 3840, GPU: 0, + Architecture: "amd64", }, "m3.xlarge": { InstanceType: "m3.xlarge", VCPU: 4, MemoryMb: 15360, GPU: 0, + Architecture: "amd64", }, "m4": { InstanceType: "m4", VCPU: 40, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "m4.10xlarge": { InstanceType: "m4.10xlarge", VCPU: 40, MemoryMb: 163840, GPU: 0, + Architecture: "amd64", }, "m4.16xlarge": { InstanceType: "m4.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "m4.2xlarge": { InstanceType: "m4.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "m4.4xlarge": { InstanceType: "m4.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "m4.large": { InstanceType: "m4.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "m4.xlarge": { InstanceType: "m4.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "m5": { InstanceType: "m5", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "m5.12xlarge": { InstanceType: "m5.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "m5.16xlarge": { InstanceType: "m5.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "m5.24xlarge": { InstanceType: "m5.24xlarge", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5.2xlarge": { InstanceType: "m5.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "m5.4xlarge": { InstanceType: "m5.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "m5.8xlarge": { InstanceType: "m5.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "m5.large": { InstanceType: "m5.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "m5.metal": { InstanceType: "m5.metal", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5.xlarge": { InstanceType: "m5.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "m5a.12xlarge": { InstanceType: "m5a.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "m5a.16xlarge": { InstanceType: "m5a.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "m5a.24xlarge": { InstanceType: "m5a.24xlarge", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5a.2xlarge": { InstanceType: "m5a.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "m5a.4xlarge": { InstanceType: "m5a.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "m5a.8xlarge": { InstanceType: "m5a.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "m5a.large": { InstanceType: "m5a.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "m5a.xlarge": { InstanceType: "m5a.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "m5ad.12xlarge": { InstanceType: "m5ad.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "m5ad.16xlarge": { InstanceType: "m5ad.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "m5ad.24xlarge": { InstanceType: "m5ad.24xlarge", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5ad.2xlarge": { InstanceType: "m5ad.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "m5ad.4xlarge": { InstanceType: "m5ad.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "m5ad.8xlarge": { InstanceType: "m5ad.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "m5ad.large": { InstanceType: "m5ad.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "m5ad.xlarge": { InstanceType: "m5ad.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "m5d": { InstanceType: "m5d", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "m5d.12xlarge": { InstanceType: "m5d.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "m5d.16xlarge": { InstanceType: "m5d.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "m5d.24xlarge": { InstanceType: "m5d.24xlarge", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5d.2xlarge": { InstanceType: "m5d.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "m5d.4xlarge": { InstanceType: "m5d.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "m5d.8xlarge": { InstanceType: "m5d.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "m5d.large": { InstanceType: "m5d.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "m5d.metal": { InstanceType: "m5d.metal", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5d.xlarge": { InstanceType: "m5d.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "m5dn": { InstanceType: "m5dn", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "m5dn.12xlarge": { InstanceType: "m5dn.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "m5dn.16xlarge": { InstanceType: "m5dn.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "m5dn.24xlarge": { InstanceType: "m5dn.24xlarge", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5dn.2xlarge": { InstanceType: "m5dn.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "m5dn.4xlarge": { InstanceType: "m5dn.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "m5dn.8xlarge": { InstanceType: "m5dn.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "m5dn.large": { InstanceType: "m5dn.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "m5dn.metal": { InstanceType: "m5dn.metal", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5dn.xlarge": { InstanceType: "m5dn.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "m5n": { InstanceType: "m5n", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "m5n.12xlarge": { InstanceType: "m5n.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "m5n.16xlarge": { InstanceType: "m5n.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "m5n.24xlarge": { InstanceType: "m5n.24xlarge", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5n.2xlarge": { InstanceType: "m5n.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "m5n.4xlarge": { InstanceType: "m5n.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "m5n.8xlarge": { InstanceType: "m5n.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "m5n.large": { InstanceType: "m5n.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "m5n.metal": { InstanceType: "m5n.metal", VCPU: 96, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "m5n.xlarge": { InstanceType: "m5n.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "m5zn": { InstanceType: "m5zn", VCPU: 48, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "m5zn.12xlarge": { InstanceType: "m5zn.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "m5zn.2xlarge": { InstanceType: "m5zn.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "m5zn.3xlarge": { InstanceType: "m5zn.3xlarge", VCPU: 12, MemoryMb: 49152, GPU: 0, + Architecture: "amd64", }, "m5zn.6xlarge": { InstanceType: "m5zn.6xlarge", VCPU: 24, MemoryMb: 98304, GPU: 0, + Architecture: "amd64", }, "m5zn.large": { InstanceType: "m5zn.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "m5zn.metal": { InstanceType: "m5zn.metal", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "m5zn.xlarge": { InstanceType: "m5zn.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "m6g": { InstanceType: "m6g", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "arm64", }, "m6g.12xlarge": { InstanceType: "m6g.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "arm64", }, "m6g.16xlarge": { InstanceType: "m6g.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "arm64", }, "m6g.2xlarge": { InstanceType: "m6g.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "arm64", }, "m6g.4xlarge": { InstanceType: "m6g.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "arm64", }, "m6g.8xlarge": { InstanceType: "m6g.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "arm64", }, "m6g.large": { InstanceType: "m6g.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "arm64", }, "m6g.medium": { InstanceType: "m6g.medium", VCPU: 1, MemoryMb: 4096, GPU: 0, + Architecture: "arm64", }, "m6g.metal": { InstanceType: "m6g.metal", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "arm64", }, "m6g.xlarge": { InstanceType: "m6g.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "arm64", }, "m6gd": { InstanceType: "m6gd", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "arm64", }, "m6gd.12xlarge": { InstanceType: "m6gd.12xlarge", VCPU: 48, MemoryMb: 196608, GPU: 0, + Architecture: "arm64", }, "m6gd.16xlarge": { InstanceType: "m6gd.16xlarge", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "arm64", }, "m6gd.2xlarge": { InstanceType: "m6gd.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "arm64", }, "m6gd.4xlarge": { InstanceType: "m6gd.4xlarge", VCPU: 16, MemoryMb: 65536, GPU: 0, + Architecture: "arm64", }, "m6gd.8xlarge": { InstanceType: "m6gd.8xlarge", VCPU: 32, MemoryMb: 131072, GPU: 0, + Architecture: "arm64", }, "m6gd.large": { InstanceType: "m6gd.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "arm64", }, "m6gd.medium": { InstanceType: "m6gd.medium", VCPU: 1, MemoryMb: 4096, GPU: 0, + Architecture: "arm64", }, "m6gd.metal": { InstanceType: "m6gd.metal", VCPU: 64, MemoryMb: 262144, GPU: 0, + Architecture: "arm64", }, "m6gd.xlarge": { InstanceType: "m6gd.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "arm64", }, "mac1": { InstanceType: "mac1", VCPU: 12, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "mac1.metal": { InstanceType: "mac1.metal", VCPU: 12, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "p2": { InstanceType: "p2", VCPU: 64, MemoryMb: 0, GPU: 16, + Architecture: "amd64", }, "p2.16xlarge": { InstanceType: "p2.16xlarge", VCPU: 64, MemoryMb: 749568, GPU: 16, + Architecture: "amd64", }, "p2.8xlarge": { InstanceType: "p2.8xlarge", VCPU: 32, MemoryMb: 499712, GPU: 8, + Architecture: "amd64", }, "p2.xlarge": { InstanceType: "p2.xlarge", VCPU: 4, MemoryMb: 62464, GPU: 1, + Architecture: "amd64", }, "p3": { InstanceType: "p3", VCPU: 64, MemoryMb: 0, GPU: 8, + Architecture: "amd64", }, "p3.16xlarge": { InstanceType: "p3.16xlarge", VCPU: 64, MemoryMb: 499712, GPU: 8, + Architecture: "amd64", }, "p3.2xlarge": { InstanceType: "p3.2xlarge", VCPU: 8, MemoryMb: 62464, GPU: 1, + Architecture: "amd64", }, "p3.8xlarge": { InstanceType: "p3.8xlarge", VCPU: 32, MemoryMb: 249856, GPU: 4, + Architecture: "amd64", }, "p3dn": { InstanceType: "p3dn", VCPU: 96, MemoryMb: 0, GPU: 8, + Architecture: "amd64", }, "p3dn.24xlarge": { InstanceType: "p3dn.24xlarge", VCPU: 96, MemoryMb: 786432, GPU: 8, + Architecture: "amd64", + }, + "p4d": { + InstanceType: "p4d", + VCPU: 96, + MemoryMb: 0, + GPU: 8, + Architecture: "amd64", }, "p4d.24xlarge": { InstanceType: "p4d.24xlarge", VCPU: 96, MemoryMb: 1179648, GPU: 8, + Architecture: "amd64", }, "r3": { InstanceType: "r3", VCPU: 32, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "r3.2xlarge": { InstanceType: "r3.2xlarge", VCPU: 8, MemoryMb: 62464, GPU: 0, + Architecture: "amd64", }, "r3.4xlarge": { InstanceType: "r3.4xlarge", VCPU: 16, MemoryMb: 124928, GPU: 0, + Architecture: "amd64", }, "r3.8xlarge": { InstanceType: "r3.8xlarge", VCPU: 32, MemoryMb: 249856, GPU: 0, + Architecture: "amd64", }, "r3.large": { InstanceType: "r3.large", VCPU: 2, MemoryMb: 15616, GPU: 0, + Architecture: "amd64", }, "r3.xlarge": { InstanceType: "r3.xlarge", VCPU: 4, MemoryMb: 31232, GPU: 0, + Architecture: "amd64", }, "r4": { InstanceType: "r4", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "r4.16xlarge": { InstanceType: "r4.16xlarge", VCPU: 64, MemoryMb: 499712, GPU: 0, + Architecture: "amd64", }, "r4.2xlarge": { InstanceType: "r4.2xlarge", VCPU: 8, MemoryMb: 62464, GPU: 0, + Architecture: "amd64", }, "r4.4xlarge": { InstanceType: "r4.4xlarge", VCPU: 16, MemoryMb: 124928, GPU: 0, + Architecture: "amd64", }, "r4.8xlarge": { InstanceType: "r4.8xlarge", VCPU: 32, MemoryMb: 249856, GPU: 0, + Architecture: "amd64", }, "r4.large": { InstanceType: "r4.large", VCPU: 2, MemoryMb: 15616, GPU: 0, + Architecture: "amd64", }, "r4.xlarge": { InstanceType: "r4.xlarge", VCPU: 4, MemoryMb: 31232, GPU: 0, + Architecture: "amd64", }, "r5": { InstanceType: "r5", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "r5.12xlarge": { InstanceType: "r5.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "r5.16xlarge": { InstanceType: "r5.16xlarge", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "amd64", }, "r5.24xlarge": { InstanceType: "r5.24xlarge", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5.2xlarge": { InstanceType: "r5.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "r5.4xlarge": { InstanceType: "r5.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "r5.8xlarge": { InstanceType: "r5.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "r5.large": { InstanceType: "r5.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "r5.metal": { InstanceType: "r5.metal", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5.xlarge": { InstanceType: "r5.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "r5a.12xlarge": { InstanceType: "r5a.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "r5a.16xlarge": { InstanceType: "r5a.16xlarge", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "amd64", }, "r5a.24xlarge": { InstanceType: "r5a.24xlarge", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5a.2xlarge": { InstanceType: "r5a.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "r5a.4xlarge": { InstanceType: "r5a.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "r5a.8xlarge": { InstanceType: "r5a.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "r5a.large": { InstanceType: "r5a.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "r5a.xlarge": { InstanceType: "r5a.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "r5ad.12xlarge": { InstanceType: "r5ad.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "r5ad.16xlarge": { InstanceType: "r5ad.16xlarge", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "amd64", }, "r5ad.24xlarge": { InstanceType: "r5ad.24xlarge", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5ad.2xlarge": { InstanceType: "r5ad.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "r5ad.4xlarge": { InstanceType: "r5ad.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "r5ad.8xlarge": { InstanceType: "r5ad.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "r5ad.large": { InstanceType: "r5ad.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "r5ad.xlarge": { InstanceType: "r5ad.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "r5b": { InstanceType: "r5b", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "r5b.12xlarge": { InstanceType: "r5b.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "r5b.16xlarge": { InstanceType: "r5b.16xlarge", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "amd64", }, "r5b.24xlarge": { InstanceType: "r5b.24xlarge", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5b.2xlarge": { InstanceType: "r5b.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "r5b.4xlarge": { InstanceType: "r5b.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "r5b.8xlarge": { InstanceType: "r5b.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "r5b.large": { InstanceType: "r5b.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "r5b.metal": { InstanceType: "r5b.metal", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5b.xlarge": { InstanceType: "r5b.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "r5d": { InstanceType: "r5d", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "r5d.12xlarge": { InstanceType: "r5d.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "r5d.16xlarge": { InstanceType: "r5d.16xlarge", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "amd64", }, "r5d.24xlarge": { InstanceType: "r5d.24xlarge", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5d.2xlarge": { InstanceType: "r5d.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "r5d.4xlarge": { InstanceType: "r5d.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "r5d.8xlarge": { InstanceType: "r5d.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "r5d.large": { InstanceType: "r5d.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "r5d.metal": { InstanceType: "r5d.metal", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5d.xlarge": { InstanceType: "r5d.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "r5dn": { InstanceType: "r5dn", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "r5dn.12xlarge": { InstanceType: "r5dn.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "r5dn.16xlarge": { InstanceType: "r5dn.16xlarge", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "amd64", }, "r5dn.24xlarge": { InstanceType: "r5dn.24xlarge", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5dn.2xlarge": { InstanceType: "r5dn.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "r5dn.4xlarge": { InstanceType: "r5dn.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "r5dn.8xlarge": { InstanceType: "r5dn.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "r5dn.large": { InstanceType: "r5dn.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "r5dn.metal": { InstanceType: "r5dn.metal", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5dn.xlarge": { InstanceType: "r5dn.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "r5n": { InstanceType: "r5n", VCPU: 96, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "r5n.12xlarge": { InstanceType: "r5n.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "r5n.16xlarge": { InstanceType: "r5n.16xlarge", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "amd64", }, "r5n.24xlarge": { InstanceType: "r5n.24xlarge", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5n.2xlarge": { InstanceType: "r5n.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "r5n.4xlarge": { InstanceType: "r5n.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "amd64", }, "r5n.8xlarge": { InstanceType: "r5n.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "amd64", }, "r5n.large": { InstanceType: "r5n.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "r5n.metal": { InstanceType: "r5n.metal", VCPU: 96, MemoryMb: 786432, GPU: 0, + Architecture: "amd64", }, "r5n.xlarge": { InstanceType: "r5n.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "r6g": { InstanceType: "r6g", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "arm64", }, "r6g.12xlarge": { InstanceType: "r6g.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "arm64", }, "r6g.16xlarge": { InstanceType: "r6g.16xlarge", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "arm64", }, "r6g.2xlarge": { InstanceType: "r6g.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "arm64", }, "r6g.4xlarge": { InstanceType: "r6g.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "arm64", }, "r6g.8xlarge": { InstanceType: "r6g.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "arm64", }, "r6g.large": { InstanceType: "r6g.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "arm64", }, "r6g.medium": { InstanceType: "r6g.medium", VCPU: 1, MemoryMb: 8192, GPU: 0, + Architecture: "arm64", }, "r6g.metal": { InstanceType: "r6g.metal", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "arm64", }, "r6g.xlarge": { InstanceType: "r6g.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "arm64", }, "r6gd": { InstanceType: "r6gd", VCPU: 64, MemoryMb: 0, GPU: 0, + Architecture: "arm64", }, "r6gd.12xlarge": { InstanceType: "r6gd.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "arm64", }, "r6gd.16xlarge": { InstanceType: "r6gd.16xlarge", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "arm64", }, "r6gd.2xlarge": { InstanceType: "r6gd.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "arm64", }, "r6gd.4xlarge": { InstanceType: "r6gd.4xlarge", VCPU: 16, MemoryMb: 131072, GPU: 0, + Architecture: "arm64", }, "r6gd.8xlarge": { InstanceType: "r6gd.8xlarge", VCPU: 32, MemoryMb: 262144, GPU: 0, + Architecture: "arm64", }, "r6gd.large": { InstanceType: "r6gd.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "arm64", }, "r6gd.medium": { InstanceType: "r6gd.medium", VCPU: 1, MemoryMb: 8192, GPU: 0, + Architecture: "arm64", }, "r6gd.metal": { InstanceType: "r6gd.metal", VCPU: 64, MemoryMb: 524288, GPU: 0, + Architecture: "arm64", }, "r6gd.xlarge": { InstanceType: "r6gd.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "arm64", }, "t1.micro": { InstanceType: "t1.micro", VCPU: 1, MemoryMb: 627, GPU: 0, + Architecture: "amd64", }, "t2.2xlarge": { InstanceType: "t2.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "t2.large": { InstanceType: "t2.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "t2.medium": { InstanceType: "t2.medium", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "amd64", }, "t2.micro": { InstanceType: "t2.micro", VCPU: 1, MemoryMb: 1024, GPU: 0, + Architecture: "amd64", }, "t2.nano": { InstanceType: "t2.nano", VCPU: 1, MemoryMb: 512, GPU: 0, + Architecture: "amd64", }, "t2.small": { InstanceType: "t2.small", VCPU: 1, MemoryMb: 2048, GPU: 0, + Architecture: "amd64", }, "t2.xlarge": { InstanceType: "t2.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "t3.2xlarge": { InstanceType: "t3.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "t3.large": { InstanceType: "t3.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "t3.medium": { InstanceType: "t3.medium", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "amd64", }, "t3.micro": { InstanceType: "t3.micro", VCPU: 2, MemoryMb: 1024, GPU: 0, + Architecture: "amd64", }, "t3.nano": { InstanceType: "t3.nano", VCPU: 2, MemoryMb: 512, GPU: 0, + Architecture: "amd64", }, "t3.small": { InstanceType: "t3.small", VCPU: 2, MemoryMb: 2048, GPU: 0, + Architecture: "amd64", }, "t3.xlarge": { InstanceType: "t3.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "t3a.2xlarge": { InstanceType: "t3a.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, "t3a.large": { InstanceType: "t3a.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "amd64", }, "t3a.medium": { InstanceType: "t3a.medium", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "amd64", }, "t3a.micro": { InstanceType: "t3a.micro", VCPU: 2, MemoryMb: 1024, GPU: 0, + Architecture: "amd64", }, "t3a.nano": { InstanceType: "t3a.nano", VCPU: 2, MemoryMb: 512, GPU: 0, + Architecture: "amd64", }, "t3a.small": { InstanceType: "t3a.small", VCPU: 2, MemoryMb: 2048, GPU: 0, + Architecture: "amd64", }, "t3a.xlarge": { InstanceType: "t3a.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "t4g.2xlarge": { InstanceType: "t4g.2xlarge", VCPU: 8, MemoryMb: 32768, GPU: 0, + Architecture: "arm64", }, "t4g.large": { InstanceType: "t4g.large", VCPU: 2, MemoryMb: 8192, GPU: 0, + Architecture: "arm64", }, "t4g.medium": { InstanceType: "t4g.medium", VCPU: 2, MemoryMb: 4096, GPU: 0, + Architecture: "arm64", }, "t4g.micro": { InstanceType: "t4g.micro", VCPU: 2, MemoryMb: 1024, GPU: 0, + Architecture: "arm64", }, "t4g.nano": { InstanceType: "t4g.nano", VCPU: 2, MemoryMb: 512, GPU: 0, + Architecture: "arm64", }, "t4g.small": { InstanceType: "t4g.small", VCPU: 2, MemoryMb: 2048, GPU: 0, + Architecture: "arm64", }, "t4g.xlarge": { InstanceType: "t4g.xlarge", VCPU: 4, MemoryMb: 16384, GPU: 0, + Architecture: "arm64", }, "u-12tb1": { InstanceType: "u-12tb1", VCPU: 448, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "u-12tb1.metal": { InstanceType: "u-12tb1.metal", VCPU: 448, MemoryMb: 12582912, GPU: 0, + Architecture: "amd64", }, "u-18tb1": { InstanceType: "u-18tb1", VCPU: 448, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "u-18tb1.metal": { InstanceType: "u-18tb1.metal", VCPU: 448, MemoryMb: 18874368, GPU: 0, + Architecture: "amd64", }, "u-24tb1": { InstanceType: "u-24tb1", VCPU: 448, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "u-24tb1.metal": { InstanceType: "u-24tb1.metal", VCPU: 448, MemoryMb: 25165824, GPU: 0, + Architecture: "amd64", }, "u-6tb1": { InstanceType: "u-6tb1", VCPU: 448, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "u-6tb1.metal": { InstanceType: "u-6tb1.metal", VCPU: 448, MemoryMb: 6291456, GPU: 0, + Architecture: "amd64", }, "u-9tb1": { InstanceType: "u-9tb1", VCPU: 448, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "u-9tb1.metal": { InstanceType: "u-9tb1.metal", VCPU: 448, MemoryMb: 9437184, GPU: 0, + Architecture: "amd64", }, "x1": { InstanceType: "x1", VCPU: 128, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "x1.16xlarge": { InstanceType: "x1.16xlarge", VCPU: 64, MemoryMb: 999424, GPU: 0, + Architecture: "amd64", }, "x1.32xlarge": { InstanceType: "x1.32xlarge", VCPU: 128, MemoryMb: 1998848, GPU: 0, + Architecture: "amd64", }, "x1e": { InstanceType: "x1e", VCPU: 128, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "x1e.16xlarge": { InstanceType: "x1e.16xlarge", VCPU: 64, MemoryMb: 1998848, GPU: 0, + Architecture: "amd64", }, "x1e.2xlarge": { InstanceType: "x1e.2xlarge", VCPU: 8, MemoryMb: 249856, GPU: 0, + Architecture: "amd64", }, "x1e.32xlarge": { InstanceType: "x1e.32xlarge", VCPU: 128, MemoryMb: 3997696, GPU: 0, + Architecture: "amd64", }, "x1e.4xlarge": { InstanceType: "x1e.4xlarge", VCPU: 16, MemoryMb: 499712, GPU: 0, + Architecture: "amd64", }, "x1e.8xlarge": { InstanceType: "x1e.8xlarge", VCPU: 32, MemoryMb: 999424, GPU: 0, + Architecture: "amd64", }, "x1e.xlarge": { InstanceType: "x1e.xlarge", VCPU: 4, MemoryMb: 124928, GPU: 0, + Architecture: "amd64", }, "z1d": { InstanceType: "z1d", VCPU: 48, MemoryMb: 0, GPU: 0, + Architecture: "amd64", }, "z1d.12xlarge": { InstanceType: "z1d.12xlarge", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "z1d.2xlarge": { InstanceType: "z1d.2xlarge", VCPU: 8, MemoryMb: 65536, GPU: 0, + Architecture: "amd64", }, "z1d.3xlarge": { InstanceType: "z1d.3xlarge", VCPU: 12, MemoryMb: 98304, GPU: 0, + Architecture: "amd64", }, "z1d.6xlarge": { InstanceType: "z1d.6xlarge", VCPU: 24, MemoryMb: 196608, GPU: 0, + Architecture: "amd64", }, "z1d.large": { InstanceType: "z1d.large", VCPU: 2, MemoryMb: 16384, GPU: 0, + Architecture: "amd64", }, "z1d.metal": { InstanceType: "z1d.metal", VCPU: 48, MemoryMb: 393216, GPU: 0, + Architecture: "amd64", }, "z1d.xlarge": { InstanceType: "z1d.xlarge", VCPU: 4, MemoryMb: 32768, GPU: 0, + Architecture: "amd64", }, } diff --git a/cluster-autoscaler/cloudprovider/aws/ec2_instance_types/gen.go b/cluster-autoscaler/cloudprovider/aws/ec2_instance_types/gen.go index 74fe1a887a14..2f6b094b2bbf 100644 --- a/cluster-autoscaler/cloudprovider/aws/ec2_instance_types/gen.go +++ b/cluster-autoscaler/cloudprovider/aws/ec2_instance_types/gen.go @@ -52,6 +52,7 @@ type InstanceType struct { VCPU int64 MemoryMb int64 GPU int64 + Architecture string } // InstanceTypes is a map of ec2 resources @@ -62,6 +63,7 @@ var InstanceTypes = map[string]*InstanceType{ VCPU: {{ .VCPU }}, MemoryMb: {{ .MemoryMb }}, GPU: {{ .GPU }}, + Architecture: "{{ .Architecture }}", }, {{- end }} } From 249a7287ab0c24d5a1ae6ddf8f850ef39ea7ee14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Tu=C5=BCnik?= Date: Tue, 27 Apr 2021 15:58:41 +0200 Subject: [PATCH 12/86] Cluster Autoscaler: remove vivekbagade, add towca as an approver in OWNERS --- cluster-autoscaler/OWNERS | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cluster-autoscaler/OWNERS b/cluster-autoscaler/OWNERS index 0242f785e0dc..50bbbaf5fc9b 100644 --- a/cluster-autoscaler/OWNERS +++ b/cluster-autoscaler/OWNERS @@ -1,9 +1,8 @@ approvers: - aleksandra-malinowska - feiskyer -- vivekbagade +- towca reviewers: - aleksandra-malinowska - feiskyer - Jeffwan -- towca From a15d9944f9dd8f88d8bff1c41baa4855413d2bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Tu=C5=BCnik?= Date: Wed, 28 Apr 2021 18:29:20 +0200 Subject: [PATCH 13/86] Cluster Autoscaler GCE: change the format of MIG id The current implementation assumes MIG ids have the "https://content.googleapis.com" prefix, while the canonical id format seems to begin with "https://www.googleapis.com". Both formats work while talking to the GCE API, but the API returns the latter and other GCP services seem to assume it as well. --- cluster-autoscaler/cloudprovider/gce/gce_url.go | 17 +++++++++-------- .../cloudprovider/gce/gce_url_test.go | 4 +++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/gce/gce_url.go b/cluster-autoscaler/cloudprovider/gce/gce_url.go index f9b1ab61af27..e0f04ee91008 100644 --- a/cluster-autoscaler/cloudprovider/gce/gce_url.go +++ b/cluster-autoscaler/cloudprovider/gce/gce_url.go @@ -22,33 +22,34 @@ import ( ) const ( - gceUrlSchema = "https" - gceDomainSuffix = "googleapis.com/compute/v1/projects/" - gcePrefix = gceUrlSchema + "://content." + gceDomainSuffix + gceUrlSchema = "https" + gceDomainSuffix = "googleapis.com/compute/v1/projects/" + // Cluster Autoscaler previously used "content" instead of "www" here, for reasons unknown. + gcePrefix = gceUrlSchema + "://www." + gceDomainSuffix instanceUrlTemplate = gcePrefix + "%s/zones/%s/instances/%s" migUrlTemplate = gcePrefix + "%s/zones/%s/instanceGroups/%s" ) // ParseMigUrl expects url in format: -// https://content.googleapis.com/compute/v1/projects//zones//instanceGroups/ +// https://www.googleapis.com/compute/v1/projects//zones//instanceGroups/ func ParseMigUrl(url string) (project string, zone string, name string, err error) { return parseGceUrl(url, "instanceGroups") } // ParseIgmUrl expects url in format: -// https://content.googleapis.com/compute/v1/projects//zones//instanceGroupManagers/ +// https://www.googleapis.com/compute/v1/projects//zones//instanceGroupManagers/ func ParseIgmUrl(url string) (project string, zone string, name string, err error) { return parseGceUrl(url, "instanceGroupManagers") } // ParseInstanceUrl expects url in format: -// https://content.googleapis.com/compute/v1/projects//zones//instances/ +// https://www.googleapis.com/compute/v1/projects//zones//instances/ func ParseInstanceUrl(url string) (project string, zone string, name string, err error) { return parseGceUrl(url, "instances") } // ParseInstanceUrlRef expects url in format: -// https://content.googleapis.com/compute/v1/projects//zones//instances/ +// https://www.googleapis.com/compute/v1/projects//zones//instances/ // and returns a GceRef struct for it. func ParseInstanceUrlRef(url string) (GceRef, error) { project, zone, name, err := parseGceUrl(url, "instances") @@ -73,7 +74,7 @@ func GenerateMigUrl(ref GceRef) string { } func parseGceUrl(url, expectedResource string) (project string, zone string, name string, err error) { - errMsg := fmt.Errorf("wrong url: expected format https://content.googleapis.com/compute/v1/projects//zones//%s/, got %s", expectedResource, url) + errMsg := fmt.Errorf("wrong url: expected format https://www.googleapis.com/compute/v1/projects//zones//%s/, got %s", expectedResource, url) if !strings.Contains(url, gceDomainSuffix) { return "", "", "", errMsg } diff --git a/cluster-autoscaler/cloudprovider/gce/gce_url_test.go b/cluster-autoscaler/cloudprovider/gce/gce_url_test.go index a487e9681ec9..e048396b6cf2 100644 --- a/cluster-autoscaler/cloudprovider/gce/gce_url_test.go +++ b/cluster-autoscaler/cloudprovider/gce/gce_url_test.go @@ -29,6 +29,8 @@ func TestParseUrl(t *testing.T) { assert.Equal(t, "us-central1-b", zone) assert.Equal(t, "kubernetes-minion-group", name) + // Cluster Autoscaler previously used this format for MIG id (with "content" instead of "www"). Make sure it's still accepted + // just to be safe. proj, zone, name, err = parseGceUrl("https://content.googleapis.com/compute/v1/projects/mwielgus-proj/zones/us-central1-b/instanceGroups/kubernetes-minion-group", "instanceGroups") assert.Nil(t, err) assert.Equal(t, "mwielgus-proj", proj) @@ -38,6 +40,6 @@ func TestParseUrl(t *testing.T) { _, _, _, err = parseGceUrl("www.onet.pl", "instanceGroups") assert.NotNil(t, err) - _, _, _, err = parseGceUrl("https://content.googleapis.com/compute/vabc/projects/mwielgus-proj/zones/us-central1-b/instanceGroups/kubernetes-minion-group", "instanceGroups") + _, _, _, err = parseGceUrl("https://www.googleapis.com/compute/vabc/projects/mwielgus-proj/zones/us-central1-b/instanceGroups/kubernetes-minion-group", "instanceGroups") assert.NotNil(t, err) } From 3e53369e17d0878d10a41261d7360da25e4c1885 Mon Sep 17 00:00:00 2001 From: Marwan Ahmed Date: Tue, 4 May 2021 22:31:07 -0700 Subject: [PATCH 14/86] support separators in custom allocatable overrides via vmss tags --- cluster-autoscaler/cloudprovider/azure/azure_template.go | 3 ++- .../cloudprovider/azure/azure_template_test.go | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_template.go b/cluster-autoscaler/cloudprovider/azure/azure_template.go index eb931f31c3a0..89c1f7017f62 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_template.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_template.go @@ -196,11 +196,12 @@ func extractAllocatableResourcesFromScaleSet(tags map[string]*string) map[string continue } + normalizedResourceName := strings.Replace(resourceName[1], "_", "/", -1) quantity, err := resource.ParseQuantity(*tagValue) if err != nil { continue } - resources[resourceName[1]] = &quantity + resources[normalizedResourceName] = &quantity } return resources diff --git a/cluster-autoscaler/cloudprovider/azure/azure_template_test.go b/cluster-autoscaler/cloudprovider/azure/azure_template_test.go index 3ee23080eccd..5049f7cb5979 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_template_test.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_template_test.go @@ -90,9 +90,10 @@ func TestExtractTaintsFromScaleSet(t *testing.T) { func TestExtractAllocatableResourcesFromScaleSet(t *testing.T) { tags := map[string]*string{ - fmt.Sprintf("%s%s", nodeResourcesTagName, "cpu"): to.StringPtr("100m"), - fmt.Sprintf("%s%s", nodeResourcesTagName, "memory"): to.StringPtr("100M"), - fmt.Sprintf("%s%s", nodeResourcesTagName, "ephemeral-storage"): to.StringPtr("20G"), + fmt.Sprintf("%s%s", nodeResourcesTagName, "cpu"): to.StringPtr("100m"), + fmt.Sprintf("%s%s", nodeResourcesTagName, "memory"): to.StringPtr("100M"), + fmt.Sprintf("%s%s", nodeResourcesTagName, "ephemeral-storage"): to.StringPtr("20G"), + fmt.Sprintf("%s%s", nodeResourcesTagName, "nvidia.com_Tesla-P100-PCIE"): to.StringPtr("4"), } labels := extractAllocatableResourcesFromScaleSet(tags) @@ -102,6 +103,8 @@ func TestExtractAllocatableResourcesFromScaleSet(t *testing.T) { assert.Equal(t, (&expectedMemory).String(), labels["memory"].String()) expectedEphemeralStorage := resource.MustParse("20G") assert.Equal(t, (&expectedEphemeralStorage).String(), labels["ephemeral-storage"].String()) + exepectedCustomAllocatable := resource.MustParse("4") + assert.Equal(t, (&exepectedCustomAllocatable).String(), labels["nvidia.com/Tesla-P100-PCIE"].String()) } func makeTaintSet(taints []apiv1.Taint) map[apiv1.Taint]bool { From 6432c27950a82ae5b1a197300960926dfe627afd Mon Sep 17 00:00:00 2001 From: Benjamin Pineau Date: Wed, 5 May 2021 15:24:45 +0200 Subject: [PATCH 15/86] gce: concurrent zonal List()s + opportunistic basename fill FetchAllMigs (unfiltered InstanceGroupManagers.List) is costly as it's not bounded to MIGs attached to the current cluster, but rather lists all MIGs in the project/zone, and therefore equally affects all clusters in that project/zone. Running the calls concurrently over the region's zones (so at most, 4 concurrent API calls, about once per minute) contains that impact. findMigsInRegion might be scoped to the current cluster (name pattern), but also benefits from the same improvement, as it's also costly and called at each refreshInterval (1mn). Also: we're calling out GCE mig.Get() API again for each MIG (at ~300ms per API call, in my tests), sequentially and with the global cache lock held (when updateClusterState -> ...-> GetMigForInstance kicks in). Yet we already get that bit of information (MIG's basename) from any other mig.Get or mig.List call, like the one fetching target sizes. Leveraging this helps significantly on large fleets (for instance this shaves 8mn startup time on the large cluster I tested on). --- .../cloudprovider/gce/gce_manager.go | 15 +++++-- .../gce/mig_target_sizes_provider.go | 39 ++++++++++++++----- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/gce/gce_manager.go b/cluster-autoscaler/cloudprovider/gce/gce_manager.go index 0c8d3de94e58..a667abc25d8b 100644 --- a/cluster-autoscaler/cloudprovider/gce/gce_manager.go +++ b/cluster-autoscaler/cloudprovider/gce/gce_manager.go @@ -474,11 +474,20 @@ func (m *gceManagerImpl) findMigsInRegion(region string, name *regexp.Regexp) ([ if err != nil { return nil, err } - for _, z := range zones { - zl, err := m.GceService.FetchMigsWithName(z, name) + + zoneLinks := make([][]string, len(zones)) + errors := make([]error, len(zones)) + workqueue.ParallelizeUntil(context.Background(), len(zones), len(zones), func(piece int) { + zoneLinks[piece], errors[piece] = m.GceService.FetchMigsWithName(zones[piece], name) + }) + + for _, err := range errors { if err != nil { - return nil, err + return nil, fmt.Errorf("%v", errors) } + } + + for _, zl := range zoneLinks { for _, link := range zl { links = append(links, link) } diff --git a/cluster-autoscaler/cloudprovider/gce/mig_target_sizes_provider.go b/cluster-autoscaler/cloudprovider/gce/mig_target_sizes_provider.go index b4d1b85ace95..896217f05cdc 100644 --- a/cluster-autoscaler/cloudprovider/gce/mig_target_sizes_provider.go +++ b/cluster-autoscaler/cloudprovider/gce/mig_target_sizes_provider.go @@ -17,8 +17,12 @@ limitations under the License. package gce import ( + "context" + "fmt" "sync" + gce "google.golang.org/api/compute/v1" + "k8s.io/client-go/util/workqueue" klog "k8s.io/klog/v2" ) @@ -54,7 +58,7 @@ func (c *cachingMigTargetSizesProvider) GetMigTargetSize(migRef GceRef) (int64, return targetSize, nil } - newTargetSizes, err := c.fillInMigTargetSizeCache() + newTargetSizes, err := c.fillInMigTargetSizeAndBaseNameCaches() size, found := newTargetSizes[migRef] if err != nil || !found { @@ -71,20 +75,30 @@ func (c *cachingMigTargetSizesProvider) GetMigTargetSize(migRef GceRef) (int64, return size, nil } -func (c *cachingMigTargetSizesProvider) fillInMigTargetSizeCache() (map[GceRef]int64, error) { - zones := c.listAllZonesForMigs() +func (c *cachingMigTargetSizesProvider) fillInMigTargetSizeAndBaseNameCaches() (map[GceRef]int64, error) { + var zones []string + for zone := range c.listAllZonesForMigs() { + zones = append(zones, zone) + } - newMigTargetSizeCache := map[GceRef]int64{} - for zone := range zones { - zoneMigs, err := c.gceClient.FetchAllMigs(zone) + migs := make([][]*gce.InstanceGroupManager, len(zones)) + errors := make([]error, len(zones)) + workqueue.ParallelizeUntil(context.Background(), len(zones), len(zones), func(piece int) { + migs[piece], errors[piece] = c.gceClient.FetchAllMigs(zones[piece]) + }) + + for idx, err := range errors { if err != nil { - klog.Errorf("Error listing migs from zone %v; err=%v", zone, err) - return nil, err + klog.Errorf("Error listing migs from zone %v; err=%v", zones[idx], err) + return nil, fmt.Errorf("%v", errors) } + } + newMigTargetSizeCache := map[GceRef]int64{} + newMigBasenameCache := map[GceRef]string{} + for idx, zone := range zones { registeredMigRefs := c.getMigRefs() - - for _, zoneMig := range zoneMigs { + for _, zoneMig := range migs[idx] { zoneMigRef := GceRef{ c.projectId, zone, @@ -93,6 +107,7 @@ func (c *cachingMigTargetSizesProvider) fillInMigTargetSizeCache() (map[GceRef]i if registeredMigRefs[zoneMigRef] { newMigTargetSizeCache[zoneMigRef] = zoneMig.TargetSize + newMigBasenameCache[zoneMigRef] = zoneMig.BaseInstanceName } } } @@ -101,6 +116,10 @@ func (c *cachingMigTargetSizesProvider) fillInMigTargetSizeCache() (map[GceRef]i c.cache.SetMigTargetSize(migRef, targetSize) } + for migRef, baseName := range newMigBasenameCache { + c.cache.SetMigBasename(migRef, baseName) + } + return newMigTargetSizeCache, nil } From dda7db08d9ac0438aa2a0b326d710ea8ed3ed1bf Mon Sep 17 00:00:00 2001 From: Marwan Ahmed Date: Wed, 5 May 2021 21:10:17 -0700 Subject: [PATCH 16/86] add stable zone labels in azure template generation --- cluster-autoscaler/cloudprovider/azure/azure_template.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_template.go b/cluster-autoscaler/cloudprovider/azure/azure_template.go index 89c1f7017f62..14704c8ad4bc 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_template.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_template.go @@ -52,6 +52,7 @@ func buildGenericLabels(template compute.VirtualMachineScaleSet, nodeName string result[apiv1.LabelInstanceType] = *template.Sku.Name result[apiv1.LabelZoneRegion] = strings.ToLower(*template.Location) + result[apiv1.LabelTopologyRegion] = strings.ToLower(*template.Location) if template.Zones != nil && len(*template.Zones) > 0 { failureDomains := make([]string, len(*template.Zones)) @@ -60,8 +61,10 @@ func buildGenericLabels(template compute.VirtualMachineScaleSet, nodeName string } result[apiv1.LabelZoneFailureDomain] = strings.Join(failureDomains[:], cloudvolume.LabelMultiZoneDelimiter) + result[apiv1.LabelTopologyZone] = strings.Join(failureDomains[:], cloudvolume.LabelMultiZoneDelimiter) } else { result[apiv1.LabelZoneFailureDomain] = "0" + result[apiv1.LabelTopologyZone] = "0" } result[apiv1.LabelHostname] = nodeName From 1b0aa0c7a90be6e16bc889ac99f6cf2569051399 Mon Sep 17 00:00:00 2001 From: Dharma Bellamkonda Date: Fri, 7 May 2021 14:07:14 -0600 Subject: [PATCH 17/86] Document that TLS bootstrapping may be necessary for scale-up --- cluster-autoscaler/FAQ.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cluster-autoscaler/FAQ.md b/cluster-autoscaler/FAQ.md index 9fa2d9cd7bef..b852933db5f5 100644 --- a/cluster-autoscaler/FAQ.md +++ b/cluster-autoscaler/FAQ.md @@ -466,8 +466,9 @@ If there are multiple node groups that, if increased, would help with getting so different strategies can be selected for choosing which node group is increased. Check [What are Expanders?](#what-are-expanders) section to learn more about strategies. It may take some time before the created nodes appear in Kubernetes. It almost entirely -depends on the cloud provider and the speed of node provisioning. Cluster -Autoscaler expects requested nodes to appear within 15 minutes +depends on the cloud provider and the speed of node provisioning, including the +[TLS bootstrapping process](https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet-tls-bootstrapping/). +Cluster Autoscaler expects requested nodes to appear within 15 minutes (configured by `--max-node-provision-time` flag.) After this time, if they are still unregistered, it stops considering them in simulations and may attempt to scale up a different group if the pods are still pending. It will also attempt to remove From 23b43297595e1318a26e902c5c993a237c37db8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Wr=C3=B3blewski?= Date: Wed, 21 Apr 2021 13:53:19 +0000 Subject: [PATCH 18/86] Enable custom k8s fork in update-vendor.sh --- cluster-autoscaler/FAQ.md | 7 ++++--- cluster-autoscaler/hack/submodule-k8s.sh | 17 ++++++++++++++--- cluster-autoscaler/hack/update-vendor.sh | 17 ++++++++++++++--- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/cluster-autoscaler/FAQ.md b/cluster-autoscaler/FAQ.md index 9fa2d9cd7bef..700d2b3e27d7 100644 --- a/cluster-autoscaler/FAQ.md +++ b/cluster-autoscaler/FAQ.md @@ -921,14 +921,15 @@ unexpected problems coming from version incompatibilities. To sync the repositories' vendored k8s libraries, we have a script that takes a released version of k8s and updates the `replace` directives of each k8s -sub-library. +sub-library. It can be used with custom kubernetes fork, by default it uses +`git@github.com:kubernetes/kubernetes.git`. Example execution looks like this: ``` -./hack/update-vendor.sh 1.20.0-alpha.1 +./hack/update-vendor.sh 1.20.0-alpha.1 git@github.com:kubernetes/kubernetes.git ``` If you need to update vendor to an unreleased commit of Kubernetes, you can use the breakglass script: ``` -./hack/submodule-k8s.sh +./hack/submodule-k8s.sh git@github.com:kubernetes/kubernetes.git ``` diff --git a/cluster-autoscaler/hack/submodule-k8s.sh b/cluster-autoscaler/hack/submodule-k8s.sh index d3263a458dc1..2e409348fa56 100755 --- a/cluster-autoscaler/hack/submodule-k8s.sh +++ b/cluster-autoscaler/hack/submodule-k8s.sh @@ -24,18 +24,29 @@ set -o errexit set -o pipefail VERSION=${1} +FORK=${2:-git@github.com:kubernetes/kubernetes.git} if [ -z "$VERSION" ]; then - echo "Usage: hack/submodule-k8s.sh " + echo "Usage: hack/submodule-k8s.sh " exit 1 fi set -x +WORKDIR=$(mktemp -d) +REPO="${WORKDIR}/kubernetes" +git clone --depth 1 ${FORK} ${REPO} + +pushd ${REPO} +git fetch --depth 1 origin v${VERSION} +git checkout FETCH_HEAD + MODS=($( - curl -sS https://raw.githubusercontent.com/kubernetes/kubernetes/${VERSION}/go.mod | - sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p' + cat go.mod | sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p' )) +popd +rm -rf ${WORKDIR} + git submodule add --force https://github.com/kubernetes/kubernetes git submodule update --init --recursive --remote cd kubernetes diff --git a/cluster-autoscaler/hack/update-vendor.sh b/cluster-autoscaler/hack/update-vendor.sh index 922dc1827920..7c6608cc3a01 100755 --- a/cluster-autoscaler/hack/update-vendor.sh +++ b/cluster-autoscaler/hack/update-vendor.sh @@ -25,18 +25,29 @@ set -o errexit set -o pipefail VERSION=${1#"v"} +FORK=${2:-git@github.com:kubernetes/kubernetes.git} if [ -z "$VERSION" ]; then - echo "Usage: hack/update-vendor.sh " + echo "Usage: hack/update-vendor.sh " exit 1 fi set -x +WORKDIR=$(mktemp -d) +REPO="${WORKDIR}/kubernetes" +git clone --depth 1 ${FORK} ${REPO} + +pushd ${REPO} +git fetch --depth 1 origin v${VERSION} +git checkout FETCH_HEAD + MODS=($( - curl -sS https://raw.githubusercontent.com/kubernetes/kubernetes/v${VERSION}/go.mod | - sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p' + cat go.mod | sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p' )) +popd +rm -rf ${WORKDIR} + for MOD in "${MODS[@]}"; do V=$( go mod download -json "${MOD}@kubernetes-${VERSION}" | From a1577ef84945885c21e59b8526e26170b1c31cf2 Mon Sep 17 00:00:00 2001 From: Mario Valderrama Date: Mon, 10 May 2021 22:27:53 +0200 Subject: [PATCH 19/86] Replace package satori/go.uuid for cloudprovider ionoscloud --- .../cloudprovider/ionoscloud/client.go | 4 ++-- .../cloudprovider/ionoscloud/client_test.go | 5 ++--- .../ionoscloud/ionoscloud_manager.go | 4 ++-- .../ionoscloud/ionoscloud_manager_test.go | 7 +++--- .../cloudprovider/ionoscloud/utils.go | 6 +++++ cluster-autoscaler/go.mod | 3 +-- cluster-autoscaler/go.sum | 22 ------------------- cluster-autoscaler/vendor/modules.txt | 5 +---- 8 files changed, 17 insertions(+), 39 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/client.go b/cluster-autoscaler/cloudprovider/ionoscloud/client.go index 570f37e60bf0..f7ebc4eccc77 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/client.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/client.go @@ -25,7 +25,7 @@ import ( "path/filepath" "time" - uuid "github.com/satori/go.uuid" + "github.com/google/uuid" "k8s.io/apimachinery/pkg/util/wait" ionos "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go" "k8s.io/klog/v2" @@ -123,7 +123,7 @@ func loadTokensFromFilesystem(path string) (map[string]string, error) { tokens := make(map[string]string) for _, filename := range filenames { name := filepath.Base(filename) - if _, err := uuid.FromString(name); err != nil { + if _, err := uuid.Parse(name); err != nil { continue } data, err := ioutil.ReadFile(filename) diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/client_test.go b/cluster-autoscaler/cloudprovider/ionoscloud/client_test.go index f21e4981dc9f..c6ff5b841e26 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/client_test.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/client_test.go @@ -23,7 +23,6 @@ import ( "path/filepath" "testing" - uuid "github.com/satori/go.uuid" "github.com/stretchr/testify/require" ) @@ -78,7 +77,7 @@ func TestLoadTokensFromFilesystem_OK(t *testing.T) { require.NoError(t, err) defer func() { _ = os.RemoveAll(tempDir) }() - uuid1, uuid2, uuid3 := uuid.NewV4().String(), uuid.NewV4().String(), uuid.NewV4().String() + uuid1, uuid2, uuid3 := NewUUID(), NewUUID(), NewUUID() input := map[string]string{ uuid1: "token1", @@ -106,7 +105,7 @@ func TestLoadTokensFromFilesystem_ReadError(t *testing.T) { require.NoError(t, err) defer func() { _ = os.RemoveAll(tempDir) }() - require.NoError(t, os.Mkdir(filepath.Join(tempDir, uuid.NewV4().String()), 0755)) + require.NoError(t, os.Mkdir(filepath.Join(tempDir, NewUUID()), 0755)) client, err := NewAutoscalingClient(&Config{TokensPath: tempDir}) require.Error(t, err) require.Nil(t, client) diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager.go index 462e7ba0d01f..2d794782fc76 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager.go @@ -23,7 +23,7 @@ import ( "strings" "time" - uuid "github.com/satori/go.uuid" + "github.com/google/uuid" apiv1 "k8s.io/api/core/v1" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" "k8s.io/klog/v2" @@ -176,7 +176,7 @@ func (manager *ionosCloudManagerImpl) initExplicitNodeGroups(nodeGroupsConfig [] if err != nil || max == 0 { return fmt.Errorf("invalid value for max: %s", parts[1]) } - if _, err := uuid.FromString(parts[2]); err != nil { + if _, err := uuid.Parse(parts[2]); err != nil { return fmt.Errorf("invalid value for id: %s", parts[2]) } diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager_test.go b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager_test.go index 3fe9ec99e8f4..61be60ef0b57 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager_test.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/ionoscloud_manager_test.go @@ -23,7 +23,6 @@ import ( "testing" "time" - uuid "github.com/satori/go.uuid" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -507,7 +506,7 @@ func (s *ManagerTestSuite) TestInitExplicitNodeGroups_InvalidIDValue() { } func (s *ManagerTestSuite) TestInitExplicitNodeGroups_GetNodePoolError() { - id := uuid.NewV4().String() + id := NewUUID() s.nodePool.id = id s.OnGetKubernetesNodePool(nil, fmt.Errorf("error")).Once() @@ -515,7 +514,7 @@ func (s *ManagerTestSuite) TestInitExplicitNodeGroups_GetNodePoolError() { } func (s *ManagerTestSuite) TestInitExplicitNodeGroups_ListNodesError() { - id := uuid.NewV4().String() + id := NewUUID() s.nodePool.id = id kNodePool := newKubernetesNodePool(K8sStateActive, 2) s.OnGetKubernetesNodePool(kNodePool, nil).Once() @@ -525,7 +524,7 @@ func (s *ManagerTestSuite) TestInitExplicitNodeGroups_ListNodesError() { } func (s *ManagerTestSuite) TestInitExplicitNodeGroups_OK() { - id := uuid.NewV4().String() + id := NewUUID() s.nodePool.id = id kNodePool := newKubernetesNodePool(K8sStateActive, 2) s.OnGetKubernetesNodePool(kNodePool, nil).Once() diff --git a/cluster-autoscaler/cloudprovider/ionoscloud/utils.go b/cluster-autoscaler/cloudprovider/ionoscloud/utils.go index db45c91fd0df..527e4a5f6fd5 100644 --- a/cluster-autoscaler/cloudprovider/ionoscloud/utils.go +++ b/cluster-autoscaler/cloudprovider/ionoscloud/utils.go @@ -20,6 +20,7 @@ import ( "fmt" "strings" + "github.com/google/uuid" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" ionos "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go" ) @@ -77,3 +78,8 @@ func convertToInstanceStatus(nodeState string) *cloudprovider.InstanceStatus { } return st } + +// NewUUID returns a new UUID as string. +func NewUUID() string { + return uuid.New().String() +} diff --git a/cluster-autoscaler/go.mod b/cluster-autoscaler/go.mod index a2509be28ae9..faf0a27222b1 100644 --- a/cluster-autoscaler/go.mod +++ b/cluster-autoscaler/go.mod @@ -10,11 +10,10 @@ require ( github.com/Azure/go-autorest/autorest/date v0.3.0 github.com/Azure/go-autorest/autorest/to v0.2.0 github.com/aws/aws-sdk-go v1.35.24 - github.com/codegangsta/negroni v1.0.0 // indirect github.com/digitalocean/godo v1.27.0 github.com/ghodss/yaml v1.0.0 github.com/golang/mock v1.4.4 - github.com/gorilla/context v1.1.1 // indirect + github.com/google/uuid v1.1.2 github.com/jmespath/go-jmespath v0.4.0 github.com/json-iterator/go v1.1.10 github.com/pkg/errors v0.9.1 diff --git a/cluster-autoscaler/go.sum b/cluster-autoscaler/go.sum index ec7e42af0e6f..f6ad857606de 100644 --- a/cluster-autoscaler/go.sum +++ b/cluster-autoscaler/go.sum @@ -61,7 +61,6 @@ github.com/Microsoft/go-winio v0.4.15 h1:qkLXKzb1QoVatRyd/YlXZ/Kg0m5K3SPuoD82jjS github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/Microsoft/hcsshim v0.8.10-0.20200715222032-5eafd1556990 h1:1xpVY4dSUSbW3PcSGxZJhI8Z+CJiqbd933kM7HIinTc= github.com/Microsoft/hcsshim v0.8.10-0.20200715222032-5eafd1556990/go.mod h1:ay/0dTb7NsG8QMDfsRfLHgZo/6xAJShLe1+ePPflihk= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= @@ -124,8 +123,6 @@ github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313 h1:eIHD9GNM3H github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codegangsta/negroni v1.0.0 h1:+aYywywx4bnKXWvoWtRfJ91vC59NbEhEY03sZjQhbVY= -github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= github.com/container-storage-interface/spec v1.3.0 h1:wMH4UIoWnK/TXYw8mbcIHgZmB6kHOeIsYsiaTJwa6bc= github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 h1:qWj4qVYZ95vLWwqyNJCQg7rDsG5wPdze0UaPolH7DUk= @@ -233,7 +230,6 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= @@ -266,7 +262,6 @@ github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29g github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/spec v0.19.5 h1:Xm0Ao53uqnk9QE/LlYV5DEU09UAgpliA85QoT9LzqPw= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= @@ -291,7 +286,6 @@ github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -308,7 +302,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1 h1:ocYkMQY5RrXTYgXl7ICpV0IXwlEQGwKIsery4gyXa1U= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= @@ -364,10 +357,7 @@ github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyyc github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -430,7 +420,6 @@ github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= @@ -447,11 +436,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -621,9 +608,7 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -722,7 +707,6 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= @@ -800,7 +784,6 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -816,7 +799,6 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -889,7 +871,6 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1014,7 +995,6 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1043,7 +1023,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/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= @@ -1127,7 +1106,6 @@ sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe sigs.k8s.io/kustomize/cmd/config v0.9.7/go.mod h1:MvXCpHs77cfyxRmCNUQjIqCmZyYsbn5PyQpWiq44nW0= sigs.k8s.io/kustomize/kustomize/v4 v4.0.5/go.mod h1:C7rYla7sI8EnxHE/xEhRBSHMNfcL91fx0uKmUlUhrBk= sigs.k8s.io/kustomize/kyaml v0.10.15/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.3 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= diff --git a/cluster-autoscaler/vendor/modules.txt b/cluster-autoscaler/vendor/modules.txt index 00c62f1c6781..eb1013c4a71f 100644 --- a/cluster-autoscaler/vendor/modules.txt +++ b/cluster-autoscaler/vendor/modules.txt @@ -144,8 +144,6 @@ github.com/cilium/ebpf/internal/btf github.com/cilium/ebpf/internal/unix # github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313 github.com/clusterhq/flocker-go -# github.com/codegangsta/negroni v1.0.0 -## explicit # github.com/container-storage-interface/spec v1.3.0 github.com/container-storage-interface/spec/lib/go/csi # github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 @@ -328,6 +326,7 @@ github.com/google/go-querystring/query # github.com/google/gofuzz v1.1.0 github.com/google/gofuzz # github.com/google/uuid v1.1.2 +## explicit github.com/google/uuid # github.com/googleapis/gax-go/v2 v2.0.5 github.com/googleapis/gax-go/v2 @@ -367,8 +366,6 @@ github.com/gophercloud/gophercloud/openstack/networking/v2/networks github.com/gophercloud/gophercloud/openstack/networking/v2/ports github.com/gophercloud/gophercloud/openstack/utils github.com/gophercloud/gophercloud/pagination -# github.com/gorilla/context v1.1.1 -## explicit # github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/go-grpc-prometheus # github.com/hashicorp/golang-lru v0.5.1 From a5d27007128bd336acada259ceac04a313ac0b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Tu=C5=BCnik?= Date: Wed, 12 May 2021 18:00:50 +0200 Subject: [PATCH 20/86] BizFly: remove go.mod from the inlined "gobizfly" client Right now the file is breaking `go mod` commands. --- .../cloudprovider/bizflycloud/gobizfly/go.mod | 5 ----- .../cloudprovider/bizflycloud/gobizfly/go.sum | 11 ----------- 2 files changed, 16 deletions(-) delete mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.mod delete mode 100644 cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.sum diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.mod b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.mod deleted file mode 100644 index eddfbe88a702..000000000000 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/bizflycloud/gobizfly - -go 1.13 - -require github.com/stretchr/testify v1.4.0 diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.sum b/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.sum deleted file mode 100644 index 8fdee5854f19..000000000000 --- a/cluster-autoscaler/cloudprovider/bizflycloud/gobizfly/go.sum +++ /dev/null @@ -1,11 +0,0 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From e80f7c502b051e6d3007b4f0fd5d7a969da3ec7e Mon Sep 17 00:00:00 2001 From: Dharma Bellamkonda Date: Wed, 5 May 2021 11:42:10 -0600 Subject: [PATCH 21/86] Log names of longUnregistered Nodes --- cluster-autoscaler/clusterstate/clusterstate.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cluster-autoscaler/clusterstate/clusterstate.go b/cluster-autoscaler/clusterstate/clusterstate.go index 08126c2a9d74..e66d49636808 100644 --- a/cluster-autoscaler/clusterstate/clusterstate.go +++ b/cluster-autoscaler/clusterstate/clusterstate.go @@ -576,6 +576,7 @@ func (csr *ClusterStateRegistry) updateReadinessStats(currentTime time.Time) { total = update(total, node, ready) } + var longUnregisteredNodeNames []string for _, unregistered := range csr.unregisteredNodes { nodeGroup, errNg := csr.cloudProvider.NodeGroupForNode(unregistered.Node) if errNg != nil { @@ -588,6 +589,7 @@ func (csr *ClusterStateRegistry) updateReadinessStats(currentTime time.Time) { } perNgCopy := perNodeGroup[nodeGroup.Id()] if unregistered.UnregisteredSince.Add(csr.config.MaxNodeProvisionTime).Before(currentTime) { + longUnregisteredNodeNames = append(longUnregisteredNodeNames, unregistered.Node.Name) perNgCopy.LongUnregistered++ total.LongUnregistered++ } else { @@ -596,6 +598,9 @@ func (csr *ClusterStateRegistry) updateReadinessStats(currentTime time.Time) { } perNodeGroup[nodeGroup.Id()] = perNgCopy } + if total.LongUnregistered > 0 { + klog.V(3).Infof("Found longUnregistered Nodes %s", longUnregisteredNodeNames) + } for ngId, ngReadiness := range perNodeGroup { ngReadiness.Time = currentTime From 2bd7f0efa39023b7d66764ede20f26ce98f690ec Mon Sep 17 00:00:00 2001 From: "Amr Hanafi (MAHDI))" Date: Wed, 21 Apr 2021 00:26:43 -0700 Subject: [PATCH 22/86] [cluster-autoscaler] Publish node group min/max metrics --- cluster-autoscaler/core/autoscaler.go | 8 ++++++++ cluster-autoscaler/metrics/metrics.go | 28 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/cluster-autoscaler/core/autoscaler.go b/cluster-autoscaler/core/autoscaler.go index 3735baaac083..bf243eaf8cab 100644 --- a/cluster-autoscaler/core/autoscaler.go +++ b/cluster-autoscaler/core/autoscaler.go @@ -27,6 +27,7 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/estimator" "k8s.io/autoscaler/cluster-autoscaler/expander" "k8s.io/autoscaler/cluster-autoscaler/expander/factory" + "k8s.io/autoscaler/cluster-autoscaler/metrics" ca_processors "k8s.io/autoscaler/cluster-autoscaler/processors" "k8s.io/autoscaler/cluster-autoscaler/simulator" "k8s.io/autoscaler/cluster-autoscaler/utils/backoff" @@ -66,6 +67,13 @@ func NewAutoscaler(opts AutoscalerOptions) (Autoscaler, errors.AutoscalerError) if err != nil { return nil, errors.ToAutoscalerError(errors.InternalError, err) } + + // These metrics should be published only once. + for _, nodeGroup := range opts.CloudProvider.NodeGroups() { + metrics.UpdateNodeGroupMin(nodeGroup.Id(), nodeGroup.MinSize()) + metrics.UpdateNodeGroupMax(nodeGroup.Id(), nodeGroup.MaxSize()) + } + return NewStaticAutoscaler( opts.AutoscalingOptions, opts.PredicateChecker, diff --git a/cluster-autoscaler/metrics/metrics.go b/cluster-autoscaler/metrics/metrics.go index 9580ee3344c0..713af534ea79 100644 --- a/cluster-autoscaler/metrics/metrics.go +++ b/cluster-autoscaler/metrics/metrics.go @@ -170,6 +170,22 @@ var ( }, []string{"direction"}, ) + nodesGroupMinNodes = k8smetrics.NewGaugeVec( + &k8smetrics.GaugeOpts{ + Namespace: caNamespace, + Name: "node_group_min_count", + Help: "Minimum number of nodes in the node group", + }, []string{"node_group"}, + ) + + nodesGroupMaxNodes = k8smetrics.NewGaugeVec( + &k8smetrics.GaugeOpts{ + Namespace: caNamespace, + Name: "node_group_max_count", + Help: "Maximum number of nodes in the node group", + }, []string{"node_group"}, + ) + /**** Metrics related to autoscaler execution ****/ lastActivity = k8smetrics.NewGaugeVec( &k8smetrics.GaugeOpts{ @@ -324,6 +340,8 @@ func RegisterAll() { legacyregistry.MustRegister(cpuLimitsCores) legacyregistry.MustRegister(memoryCurrentBytes) legacyregistry.MustRegister(memoryLimitsBytes) + legacyregistry.MustRegister(nodesGroupMinNodes) + legacyregistry.MustRegister(nodesGroupMaxNodes) legacyregistry.MustRegister(lastActivity) legacyregistry.MustRegister(functionDuration) legacyregistry.MustRegister(functionDurationSummary) @@ -422,6 +440,16 @@ func UpdateMemoryLimitsBytes(minMemoryCount int64, maxMemoryCount int64) { memoryLimitsBytes.WithLabelValues("maximum").Set(float64(maxMemoryCount)) } +// UpdateNodeGroupMin records the node group minimum allowed number of nodes +func UpdateNodeGroupMin(nodeGroup string, minNodes int) { + nodesGroupMinNodes.WithLabelValues(nodeGroup).Set(float64(minNodes)) +} + +// UpdateNodeGroupMax records the node group maximum allowed number of nodes +func UpdateNodeGroupMax(nodeGroup string, maxNodes int) { + nodesGroupMaxNodes.WithLabelValues(nodeGroup).Set(float64(maxNodes)) +} + // RegisterError records any errors preventing Cluster Autoscaler from working. // No more than one error should be recorded per loop. func RegisterError(err errors.AutoscalerError) { From 030a2152b018334edf6101397b458d92b9ee5d48 Mon Sep 17 00:00:00 2001 From: Benjamin Pineau Date: Wed, 19 May 2021 12:05:40 +0200 Subject: [PATCH 23/86] Fix templated nodeinfo names collisions in BinpackingNodeEstimator Both upscale's `getUpcomingNodeInfos` and the binpacking estimator now uses the same shared DeepCopyTemplateNode function and inherits its naming pattern, which is great as that fixes a long standing bug. Due to that, `getUpcomingNodeInfos` will enrich the cluster snapshots with generated nodeinfos and nodes having predictable names (using template name + an incremental ordinal starting at 0) for upcoming nodes. Later, when it looks for fitting nodes for unschedulable pods (when upcoming nodes don't satisfy those (FitsAnyNodeMatching failing due to nodes capacity, or pods antiaffinity, ...), the binpacking estimator will also build virtual nodes and place them in a snapshot fork to evaluate scheduler predicates. Those temporary virtual nodes are built using the same pattern (template name and an index ordinal also starting at 0) as the one previously used by `getUpcomingNodeInfos`, which means it will generate the same nodeinfos/nodes names for nodegroups having upcoming nodes. But adding nodes by the same name in an existing cluster snapshot isn't allowed, and the evaluation attempt will fail. Practically this blocks re-upscales for nodegroups having upcoming nodes, which can cause a significant delay. --- cluster-autoscaler/core/static_autoscaler.go | 2 +- cluster-autoscaler/estimator/binpacking_estimator.go | 3 ++- cluster-autoscaler/utils/scheduler/scheduler.go | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cluster-autoscaler/core/static_autoscaler.go b/cluster-autoscaler/core/static_autoscaler.go index 83d840265a75..da91119b3d83 100644 --- a/cluster-autoscaler/core/static_autoscaler.go +++ b/cluster-autoscaler/core/static_autoscaler.go @@ -799,7 +799,7 @@ func getUpcomingNodeInfos(registry *clusterstate.ClusterStateRegistry, nodeInfos // Ensure new nodes have different names because nodeName // will be used as a map key. Also deep copy pods (daemonsets & // any pods added by cloud provider on template). - upcomingNodes = append(upcomingNodes, scheduler_utils.DeepCopyTemplateNode(nodeTemplate, i)) + upcomingNodes = append(upcomingNodes, scheduler_utils.DeepCopyTemplateNode(nodeTemplate, fmt.Sprintf("upcoming-%d", i))) } } return upcomingNodes diff --git a/cluster-autoscaler/estimator/binpacking_estimator.go b/cluster-autoscaler/estimator/binpacking_estimator.go index b998143cce70..87482f4921f1 100644 --- a/cluster-autoscaler/estimator/binpacking_estimator.go +++ b/cluster-autoscaler/estimator/binpacking_estimator.go @@ -17,6 +17,7 @@ limitations under the License. package estimator import ( + "fmt" "sort" apiv1 "k8s.io/api/core/v1" @@ -113,7 +114,7 @@ func (estimator *BinpackingNodeEstimator) addNewNodeToSnapshot( template *schedulerframework.NodeInfo, nameIndex int) (string, error) { - newNodeInfo := scheduler.DeepCopyTemplateNode(template, nameIndex) + newNodeInfo := scheduler.DeepCopyTemplateNode(template, fmt.Sprintf("estimator-%d", nameIndex)) var pods []*apiv1.Pod for _, podInfo := range newNodeInfo.Pods { pods = append(pods, podInfo.Pod) diff --git a/cluster-autoscaler/utils/scheduler/scheduler.go b/cluster-autoscaler/utils/scheduler/scheduler.go index f3e4439f6748..f710114cf1a1 100644 --- a/cluster-autoscaler/utils/scheduler/scheduler.go +++ b/cluster-autoscaler/utils/scheduler/scheduler.go @@ -64,9 +64,9 @@ func CreateNodeNameToInfoMap(pods []*apiv1.Pod, nodes []*apiv1.Node) map[string] // DeepCopyTemplateNode copies NodeInfo object used as a template. It changes // names of UIDs of both node and pods running on it, so that copies can be used // to represent multiple nodes. -func DeepCopyTemplateNode(nodeTemplate *schedulerframework.NodeInfo, index int) *schedulerframework.NodeInfo { +func DeepCopyTemplateNode(nodeTemplate *schedulerframework.NodeInfo, suffix string) *schedulerframework.NodeInfo { node := nodeTemplate.Node().DeepCopy() - node.Name = fmt.Sprintf("%s-%d", node.Name, index) + node.Name = fmt.Sprintf("%s-%s", node.Name, suffix) node.UID = uuid.NewUUID() if node.Labels == nil { node.Labels = make(map[string]string) @@ -76,7 +76,7 @@ func DeepCopyTemplateNode(nodeTemplate *schedulerframework.NodeInfo, index int) nodeInfo.SetNode(node) for _, podInfo := range nodeTemplate.Pods { pod := podInfo.Pod.DeepCopy() - pod.Name = fmt.Sprintf("%s-%d", podInfo.Pod.Name, index) + pod.Name = fmt.Sprintf("%s-%s", podInfo.Pod.Name, suffix) pod.UID = uuid.NewUUID() nodeInfo.AddPod(pod) } From 7456f05b74ef9e21d9543e3402bd143a79ee1512 Mon Sep 17 00:00:00 2001 From: Marwan Ahmed Date: Wed, 19 May 2021 17:54:09 -0700 Subject: [PATCH 24/86] update storage API version --- cluster-autoscaler/cloudprovider/azure/azure_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_client.go b/cluster-autoscaler/cloudprovider/azure/azure_client.go index 14160c06a3cb..ac1e1b667774 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_client.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_client.go @@ -24,7 +24,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources" - "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/adal" "github.com/Azure/go-autorest/autorest/azure" From 775b54560f11903f812ad1074a7f8575d13f4007 Mon Sep 17 00:00:00 2001 From: "Beata Lach (Skiba)" Date: Thu, 20 May 2021 10:55:27 +0200 Subject: [PATCH 25/86] Add patch deployment permission to example addon resizer deployment --- addon-resizer/deploy/example.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/addon-resizer/deploy/example.yaml b/addon-resizer/deploy/example.yaml index b8c7744ccd12..60c3e6264c04 100644 --- a/addon-resizer/deploy/example.yaml +++ b/addon-resizer/deploy/example.yaml @@ -100,6 +100,7 @@ rules: - list - update - watch + - patch --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding From 18dec33958386e9fcc9687aef0d2057dec537412 Mon Sep 17 00:00:00 2001 From: Vladimir Masarik Date: Thu, 20 May 2021 13:27:52 +0200 Subject: [PATCH 26/86] Document that CA is not responsible for registering new nodes --- cluster-autoscaler/FAQ.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cluster-autoscaler/FAQ.md b/cluster-autoscaler/FAQ.md index 1125b54ec141..3f5def46260b 100644 --- a/cluster-autoscaler/FAQ.md +++ b/cluster-autoscaler/FAQ.md @@ -474,6 +474,12 @@ still unregistered, it stops considering them in simulations and may attempt to different group if the pods are still pending. It will also attempt to remove any nodes left unregistered after this time. +> Note: Cluster Autoscaler is **not** responsible for behaviour and registration +> to the cluster of the new nodes it creates. The responsibility of registering the new nodes +> into your cluster lies with the cluster provisioning tooling you use. +> Example: If you use kubeadm to provision your cluster, it is up to you to automatically +> execute `kubeadm join` at boot time via some script. + ### How does scale-down work? Every 10 seconds (configurable by `--scan-interval` flag), if no scale-up is From 5cf64a2b3c3c7874d0c3c73a2924196f083692aa Mon Sep 17 00:00:00 2001 From: Brett Elliott Date: Thu, 20 May 2021 18:12:04 +0200 Subject: [PATCH 27/86] Update vendor to v1.22.0-alpha.1 --- .../hetzner/hetzner_node_group.go | 5 +- .../ovhcloud/ovh_cloud_node_group.go | 5 +- cluster-autoscaler/core/scale_down_test.go | 3 +- cluster-autoscaler/core/utils/utils.go | 8 +- cluster-autoscaler/core/utils/utils_test.go | 3 +- cluster-autoscaler/go.mod | 76 +- cluster-autoscaler/go.sum | 211 +- .../nodegroupset/compare_nodegroups.go | 3 +- .../simulator/basic_cluster_snapshot.go | 5 +- .../simulator/delta_cluster_snapshot.go | 4 +- cluster-autoscaler/simulator/nodes.go | 4 +- .../utils/scheduler/scheduler.go | 24 + .../utils/scheduler/scheduler_test.go | 52 + .../Azure/azure-sdk-for-go/LICENSE.txt | 21 + .../mgmt/2019-12-01/compute/CHANGELOG.md | 96 + .../2019-12-01/compute/availabilitysets.go | 39 +- .../compute/mgmt/2019-12-01/compute/client.go | 15 +- .../2019-12-01/compute/containerservices.go | 53 +- .../2019-12-01/compute/dedicatedhostgroups.go | 35 +- .../mgmt/2019-12-01/compute/dedicatedhosts.go | 59 +- .../2019-12-01/compute/diskencryptionsets.go | 65 +- .../compute/mgmt/2019-12-01/compute/disks.go | 89 +- .../compute/mgmt/2019-12-01/compute/enums.go | 1393 ++ .../mgmt/2019-12-01/compute/galleries.go | 65 +- .../2019-12-01/compute/galleryapplications.go | 59 +- .../compute/galleryapplicationversions.go | 59 +- .../mgmt/2019-12-01/compute/galleryimages.go | 59 +- .../compute/galleryimageversions.go | 59 +- .../compute/mgmt/2019-12-01/compute/images.go | 65 +- .../mgmt/2019-12-01/compute/loganalytics.go | 39 +- .../compute/mgmt/2019-12-01/compute/models.go | 4712 ++++--- .../mgmt/2019-12-01/compute/operations.go | 17 +- .../compute/proximityplacementgroups.go | 35 +- .../mgmt/2019-12-01/compute/resourceskus.go | 21 +- .../mgmt/2019-12-01/compute/snapshots.go | 89 +- .../mgmt/2019-12-01/compute/sshpublickeys.go | 37 +- .../compute/mgmt/2019-12-01/compute/usage.go | 21 +- .../mgmt/2019-12-01/compute/version.go | 15 +- .../compute/virtualmachineextensionimages.go | 21 +- .../compute/virtualmachineextensions.go | 55 +- .../compute/virtualmachineimages.go | 25 +- .../compute/virtualmachineruncommands.go | 23 +- .../2019-12-01/compute/virtualmachines.go | 220 +- .../virtualmachinescalesetextensions.go | 59 +- .../virtualmachinescalesetrollingupgrades.go | 53 +- .../compute/virtualmachinescalesets.go | 217 +- .../virtualmachinescalesetvmextensions.go | 55 +- .../compute/virtualmachinescalesetvms.go | 169 +- .../2019-12-01/compute/virtualmachinesizes.go | 17 +- .../2019-05-01/containerregistry/CHANGELOG.md | 23 + .../2019-05-01/containerregistry/client.go | 15 +- .../2019-05-01/containerregistry/enums.go | 513 + .../2019-05-01/containerregistry/models.go | 1185 +- .../containerregistry/operations.go | 21 +- .../containerregistry/registries.go | 99 +- .../containerregistry/replications.go | 59 +- .../mgmt/2019-05-01/containerregistry/runs.go | 49 +- .../2019-05-01/containerregistry/tasks.go | 62 +- .../2019-05-01/containerregistry/version.go | 15 +- .../2019-05-01/containerregistry/webhooks.go | 69 +- .../2020-04-01/containerservice/CHANGELOG.md | 20 + .../2020-04-01/containerservice/agentpools.go | 51 +- .../2020-04-01/containerservice/client.go | 15 +- .../containerservice/containerservices.go | 55 +- .../mgmt/2020-04-01/containerservice/enums.go | 702 + .../containerservice/managedclusters.go | 115 +- .../2020-04-01/containerservice/models.go | 1274 +- .../openshiftmanagedclusters.go | 65 +- .../2020-04-01/containerservice/operations.go | 17 +- .../2020-04-01/containerservice/version.go | 15 +- .../mgmt/2019-06-01/network/CHANGELOG.md | 186 + .../2019-06-01/network/applicationgateways.go | 131 +- .../network/applicationsecuritygroups.go | 65 +- .../network/availabledelegations.go | 21 +- .../network/availableendpointservices.go | 21 +- .../network/availableprivateendpointtypes.go | 27 +- .../availableresourcegroupdelegations.go | 21 +- .../network/azurefirewallfqdntags.go | 21 +- .../mgmt/2019-06-01/network/azurefirewalls.go | 55 +- .../mgmt/2019-06-01/network/bastionhosts.go | 65 +- .../network/bgpservicecommunities.go | 21 +- .../network/mgmt/2019-06-01/network/client.go | 19 +- .../2019-06-01/network/connectionmonitors.go | 81 +- .../2019-06-01/network/ddoscustompolicies.go | 53 +- .../2019-06-01/network/ddosprotectionplans.go | 65 +- .../network/defaultsecurityrules.go | 23 +- .../network/mgmt/2019-06-01/network/enums.go | 2076 +++ .../expressroutecircuitauthorizations.go | 47 +- .../network/expressroutecircuitconnections.go | 47 +- .../network/expressroutecircuitpeerings.go | 47 +- .../network/expressroutecircuits.go | 105 +- .../network/expressrouteconnections.go | 43 +- .../expressroutecrossconnectionpeerings.go | 47 +- .../network/expressroutecrossconnections.go | 89 +- .../network/expressroutegateways.go | 45 +- .../2019-06-01/network/expressroutelinks.go | 23 +- .../2019-06-01/network/expressrouteports.go | 65 +- .../network/expressrouteportslocations.go | 23 +- .../network/expressrouteserviceproviders.go | 21 +- .../2019-06-01/network/firewallpolicies.go | 55 +- .../network/firewallpolicyrulegroups.go | 47 +- .../network/hubvirtualnetworkconnections.go | 23 +- .../2019-06-01/network/inboundnatrules.go | 47 +- .../network/interfaceipconfigurations.go | 23 +- .../network/interfaceloadbalancers.go | 21 +- .../2019-06-01/network/interfacesgroup.go | 111 +- .../network/interfacetapconfigurations.go | 47 +- .../loadbalancerbackendaddresspools.go | 23 +- .../loadbalancerfrontendipconfigurations.go | 23 +- .../network/loadbalancerloadbalancingrules.go | 23 +- .../network/loadbalancernetworkinterfaces.go | 21 +- .../network/loadbalanceroutboundrules.go | 23 +- .../2019-06-01/network/loadbalancerprobes.go | 23 +- .../mgmt/2019-06-01/network/loadbalancers.go | 65 +- .../network/localnetworkgateways.go | 59 +- .../network/mgmt/2019-06-01/network/models.go | 9610 +++++++++----- .../mgmt/2019-06-01/network/natgateways.go | 55 +- .../mgmt/2019-06-01/network/operations.go | 21 +- .../mgmt/2019-06-01/network/p2svpngateways.go | 89 +- .../network/p2svpnserverconfigurations.go | 47 +- .../mgmt/2019-06-01/network/packetcaptures.go | 67 +- .../peerexpressroutecircuitconnections.go | 23 +- .../2019-06-01/network/privateendpoints.go | 53 +- .../2019-06-01/network/privatelinkservices.go | 143 +- .../mgmt/2019-06-01/network/profiles.go | 45 +- .../2019-06-01/network/publicipaddresses.go | 79 +- .../2019-06-01/network/publicipprefixes.go | 65 +- .../network/resourcenavigationlinks.go | 17 +- .../2019-06-01/network/routefilterrules.go | 59 +- .../mgmt/2019-06-01/network/routefilters.go | 65 +- .../network/mgmt/2019-06-01/network/routes.go | 47 +- .../mgmt/2019-06-01/network/routetables.go | 65 +- .../mgmt/2019-06-01/network/securitygroups.go | 65 +- .../mgmt/2019-06-01/network/securityrules.go | 47 +- .../network/serviceassociationlinks.go | 17 +- .../network/serviceendpointpolicies.go | 65 +- .../serviceendpointpolicydefinitions.go | 47 +- .../mgmt/2019-06-01/network/servicetags.go | 17 +- .../mgmt/2019-06-01/network/subnets.go | 71 +- .../network/mgmt/2019-06-01/network/usages.go | 21 +- .../mgmt/2019-06-01/network/version.go | 15 +- .../mgmt/2019-06-01/network/virtualhubs.go | 65 +- .../virtualnetworkgatewayconnections.go | 85 +- .../network/virtualnetworkgateways.go | 201 +- .../network/virtualnetworkpeerings.go | 47 +- .../2019-06-01/network/virtualnetworks.go | 73 +- .../2019-06-01/network/virtualnetworktaps.go | 65 +- .../mgmt/2019-06-01/network/virtualwans.go | 65 +- .../mgmt/2019-06-01/network/vpnconnections.go | 47 +- .../mgmt/2019-06-01/network/vpngateways.go | 77 +- .../2019-06-01/network/vpnlinkconnections.go | 21 +- .../network/vpnsitelinkconnections.go | 17 +- .../mgmt/2019-06-01/network/vpnsitelinks.go | 23 +- .../mgmt/2019-06-01/network/vpnsites.go | 65 +- .../network/vpnsitesconfiguration.go | 27 +- .../mgmt/2019-06-01/network/watchers.go | 171 +- .../network/webapplicationfirewallpolicies.go | 43 +- .../mgmt/2017-05-10/resources/CHANGELOG.md | 18 + .../mgmt/2017-05-10/resources/client.go | 15 +- .../resources/deploymentoperations.go | 23 +- .../mgmt/2017-05-10/resources/deployments.go | 57 +- .../mgmt/2017-05-10/resources/enums.go | 35 + .../mgmt/2017-05-10/resources/groups.go | 43 +- .../mgmt/2017-05-10/resources/models.go | 592 +- .../mgmt/2017-05-10/resources/providers.go | 27 +- .../mgmt/2017-05-10/resources/resources.go | 131 +- .../mgmt/2017-05-10/resources/tags.go | 29 +- .../mgmt/2017-05-10/resources/version.go | 15 +- .../mgmt/2018-07-01/storage/accounts.go | 1157 -- .../mgmt/2018-07-01/storage/blobcontainers.go | 1405 -- .../mgmt/2018-07-01/storage/blobservices.go | 242 - .../storage/mgmt/2018-07-01/storage/client.go | 52 - .../2018-07-01/storage/managementpolicies.go | 322 - .../storage/mgmt/2018-07-01/storage/models.go | 2187 ---- .../mgmt/2018-07-01/storage/operations.go | 109 - .../storage/mgmt/2018-07-01/storage/skus.go | 120 - .../storage/mgmt/2018-07-01/storage/usages.go | 123 - .../mgmt/2018-07-01/storage/version.go | 30 - .../mgmt/2019-06-01/storage/CHANGELOG.md | 10 + .../mgmt/2019-06-01/storage/accounts.go | 77 +- .../mgmt/2019-06-01/storage/blobcontainers.go | 49 +- .../mgmt/2019-06-01/storage/blobservices.go | 21 +- .../storage/mgmt/2019-06-01/storage/client.go | 15 +- .../2019-06-01/storage/encryptionscopes.go | 27 +- .../storage/mgmt/2019-06-01/storage/enums.go | 784 ++ .../mgmt/2019-06-01/storage/fileservices.go | 21 +- .../mgmt/2019-06-01/storage/fileshares.go | 31 +- .../2019-06-01/storage/managementpolicies.go | 21 +- .../storage/mgmt/2019-06-01/storage/models.go | 1304 +- .../storage/objectreplicationpolicies.go | 23 +- .../mgmt/2019-06-01/storage/operations.go | 17 +- .../storage/privateendpointconnections.go | 23 +- .../storage/privatelinkresources.go | 17 +- .../storage/mgmt/2019-06-01/storage/queue.go | 29 +- .../mgmt/2019-06-01/storage/queueservices.go | 21 +- .../storage/mgmt/2019-06-01/storage/skus.go | 17 +- .../storage/mgmt/2019-06-01/storage/table.go | 29 +- .../mgmt/2019-06-01/storage/tableservices.go | 21 +- .../storage/mgmt/2019-06-01/storage/usages.go | 17 +- .../mgmt/2019-06-01/storage/version.go | 15 +- .../Azure/azure-sdk-for-go/storage/README.md | 2 +- .../azure-sdk-for-go/storage/appendblob.go | 16 +- .../azure-sdk-for-go/storage/authorization.go | 15 +- .../Azure/azure-sdk-for-go/storage/blob.go | 15 +- .../azure-sdk-for-go/storage/blobsasuri.go | 15 +- .../storage/blobserviceclient.go | 15 +- .../azure-sdk-for-go/storage/blockblob.go | 15 +- .../Azure/azure-sdk-for-go/storage/client.go | 86 +- .../azure-sdk-for-go/storage/commonsasuri.go | 15 +- .../azure-sdk-for-go/storage/container.go | 15 +- .../azure-sdk-for-go/storage/copyblob.go | 15 +- .../azure-sdk-for-go/storage/directory.go | 15 +- .../Azure/azure-sdk-for-go/storage/entity.go | 17 +- .../Azure/azure-sdk-for-go/storage/file.go | 15 +- .../storage/fileserviceclient.go | 15 +- .../azure-sdk-for-go/storage/leaseblob.go | 15 +- .../Azure/azure-sdk-for-go/storage/message.go | 15 +- .../Azure/azure-sdk-for-go/storage/odata.go | 15 +- .../azure-sdk-for-go/storage/pageblob.go | 15 +- .../Azure/azure-sdk-for-go/storage/queue.go | 15 +- .../azure-sdk-for-go/storage/queuesasuri.go | 15 +- .../storage/queueserviceclient.go | 15 +- .../Azure/azure-sdk-for-go/storage/share.go | 15 +- .../azure-sdk-for-go/storage/storagepolicy.go | 15 +- .../storage/storageservice.go | 15 +- .../Azure/azure-sdk-for-go/storage/table.go | 15 +- .../azure-sdk-for-go/storage/table_batch.go | 15 +- .../storage/tableserviceclient.go | 15 +- .../Azure/azure-sdk-for-go/storage/util.go | 17 +- .../Azure/azure-sdk-for-go/version/version.go | 2 +- .../Azure/go-autorest/autorest/adal/token.go | 172 +- .../go-autorest/autorest/adal/token_1.13.go | 41 + .../go-autorest/autorest/adal/token_legacy.go | 40 + .../Azure/go-autorest/autorest/azure/async.go | 46 + .../Azure/go-autorest/autorest/azure/azure.go | 126 +- .../Azure/go-autorest/autorest/client.go | 3 +- .../Azure/go-autorest/autorest/error.go | 5 + .../Azure/go-autorest/autorest/utility.go | 14 - .../go-autorest/autorest/utility_1.13.go | 29 + .../go-autorest/autorest/utility_legacy.go | 31 + .../github.com/cilium/ebpf/.clang-format | 17 + .../vendor/github.com/cilium/ebpf/.gitignore | 1 + .../vendor/github.com/cilium/ebpf/abi.go | 6 - .../github.com/cilium/ebpf/asm/instruction.go | 121 +- .../github.com/cilium/ebpf/asm/opcode.go | 6 +- .../github.com/cilium/ebpf/collection.go | 168 +- .../vendor/github.com/cilium/ebpf/doc.go | 3 +- .../github.com/cilium/ebpf/elf_reader.go | 16 +- .../vendor/github.com/cilium/ebpf/go.mod | 7 +- .../vendor/github.com/cilium/ebpf/go.sum | 4 + .../cilium/ebpf/internal/btf/btf.go | 133 +- .../cilium/ebpf/internal/btf/btf_types.go | 18 +- .../cilium/ebpf/internal/btf/ext_info.go | 12 +- .../cilium/ebpf/internal/btf/fuzz.go | 49 + .../cilium/ebpf/internal/btf/types.go | 185 +- .../cilium/ebpf/internal/feature.go | 8 + .../cilium/ebpf/internal/syscall.go | 27 + .../cilium/ebpf/internal/unix/types_linux.go | 14 + .../cilium/ebpf/internal/unix/types_other.go | 5 + .../vendor/github.com/cilium/ebpf/linker.go | 47 + .../vendor/github.com/cilium/ebpf/map.go | 156 +- .../vendor/github.com/cilium/ebpf/prog.go | 52 +- .../vendor/github.com/cilium/ebpf/readme.md | 10 +- .../github.com/cilium/ebpf/run-tests.sh | 20 +- .../vendor/github.com/cilium/ebpf/syscalls.go | 29 +- .../vendor/github.com/cilium/ebpf/types.go | 54 +- .../github.com/cilium/ebpf/types_string.go | 41 +- .../containerd/console/.golangci.yml | 20 + .../github.com/containerd/console/.travis.yml | 27 - .../github.com/containerd/console/console.go | 22 +- .../containerd/console/console_unix.go | 2 +- .../github.com/containerd/console/go.mod | 4 +- .../github.com/containerd/console/go.sum | 8 +- .../containerd/console/tc_darwin.go | 11 +- .../github.com/containerd/console/tc_linux.go | 11 +- .../containerd/console/tc_netbsd.go | 45 + .../github.com/containerd/console/tc_unix.go | 2 +- .../services/containers/v1/containers.pb.go | 64 +- .../api/services/tasks/v1/tasks.pb.go | 135 +- .../api/services/version/v1/version.pb.go | 5 +- .../containerd/api/types/descriptor.pb.go | 7 +- .../containerd/api/types/metrics.pb.go | 5 +- .../containerd/api/types/mount.pb.go | 5 +- .../containerd/api/types/platform.pb.go | 5 +- .../containerd/api/types/task/task.pb.go | 10 +- .../containerd/containerd/log/context.go | 60 + .../containerd/platforms/compare.go | 229 + .../containerd/platforms/cpuinfo.go | 122 + .../containerd/platforms/database.go | 114 + .../containerd/platforms/defaults.go | 38 + .../containerd/platforms/defaults_unix.go | 24 + .../containerd/platforms/defaults_windows.go | 31 + .../containerd/platforms/platforms.go | 278 + .../vendor/github.com/docker/docker/AUTHORS | 117 +- .../github.com/docker/docker/api/common.go | 2 +- .../github.com/docker/docker/api/swagger.yaml | 307 +- .../docker/docker/api/types/client.go | 8 +- .../docker/docker/api/types/configs.go | 2 + .../api/types/container/container_changes.go | 3 +- .../api/types/container/container_create.go | 3 +- .../api/types/container/container_top.go | 3 +- .../api/types/container/container_update.go | 3 +- .../api/types/container/container_wait.go | 3 +- .../docker/api/types/container/host_config.go | 37 +- .../docker/api/types/error_response_ext.go | 6 + .../docker/docker/api/types/events/events.go | 2 + .../docker/docker/api/types/filters/parse.go | 8 +- .../docker/api/types/image/image_history.go | 3 +- .../docker/docker/api/types/mount/mount.go | 2 +- .../docker/api/types/network/network.go | 5 +- .../docker/api/types/registry/registry.go | 2 +- .../docker/docker/api/types/seccomp.go | 94 - .../docker/api/types/swarm/container.go | 16 +- .../api/types/swarm/runtime/plugin.pb.go | 110 +- .../api/types/swarm/runtime/plugin.proto | 1 + .../docker/docker/api/types/swarm/service.go | 82 +- .../docker/docker/api/types/swarm/task.go | 18 +- .../docker/docker/api/types/types.go | 50 +- .../docker/api/types/volume/volume_create.go | 3 +- .../docker/api/types/volume/volume_list.go | 3 +- .../github.com/docker/docker/client/client.go | 7 +- .../docker/docker/client/client_unix.go | 2 +- .../docker/docker/client/container_create.go | 13 +- .../docker/docker/client/container_list.go | 1 + .../docker/docker/client/container_stats.go | 16 + .../github.com/docker/docker/client/errors.go | 8 +- .../github.com/docker/docker/client/events.go | 1 + .../github.com/docker/docker/client/hijack.go | 6 +- .../docker/docker/client/image_import.go | 2 +- .../docker/docker/client/image_list.go | 1 + .../docker/docker/client/image_push.go | 13 +- .../docker/docker/client/interface.go | 4 +- .../docker/docker/client/network_list.go | 1 + .../github.com/docker/docker/client/ping.go | 6 +- .../docker/docker/client/plugin_list.go | 1 + .../docker/docker/client/request.go | 23 +- .../docker/docker/client/service_create.go | 78 +- .../docker/docker/client/service_list.go | 4 + .../docker/docker/client/service_update.go | 41 +- .../docker/docker/client/volume_list.go | 1 + .../docker/docker/errdefs/helpers.go | 52 + .../docker/pkg/jsonmessage/jsonmessage.go | 14 +- .../docker/docker/pkg/term/proxy.go | 78 - .../github.com/docker/docker/pkg/term/tc.go | 20 - .../docker/docker/pkg/term/termios_bsd.go | 42 - .../docker/docker/pkg/term/windows/windows.go | 33 - .../github.com/go-openapi/spec/.editorconfig | 26 - .../github.com/go-openapi/spec/.golangci.yml | 28 - .../github.com/go-openapi/spec/.travis.yml | 15 - .../go-openapi/spec/CODE_OF_CONDUCT.md | 74 - .../github.com/go-openapi/spec/README.md | 10 - .../github.com/go-openapi/spec/bindata.go | 297 - .../github.com/go-openapi/spec/cache.go | 60 - .../github.com/go-openapi/spec/debug.go | 47 - .../github.com/go-openapi/spec/expander.go | 651 - .../vendor/github.com/go-openapi/spec/go.mod | 12 - .../vendor/github.com/go-openapi/spec/go.sum | 49 - .../github.com/go-openapi/spec/header.go | 197 - .../github.com/go-openapi/spec/normalizer.go | 152 - .../github.com/go-openapi/spec/operation.go | 398 - .../github.com/go-openapi/spec/parameter.go | 321 - .../go-openapi/spec/schema_loader.go | 271 - .../vendor/github.com/go-openapi/spec/spec.go | 86 - .../github.com/go-openapi/spec/unused.go | 174 - .../github.com/go-openapi/spec/xml_object.go | 68 - .../vendor/github.com/gofrs/uuid/.gitignore | 15 + .../vendor/github.com/gofrs/uuid/.travis.yml | 22 + .../vendor/github.com/gofrs/uuid/LICENSE | 20 + .../vendor/github.com/gofrs/uuid/README.md | 108 + .../vendor/github.com/gofrs/uuid/codec.go | 212 + .../vendor/github.com/gofrs/uuid/fuzz.go | 47 + .../vendor/github.com/gofrs/uuid/generator.go | 265 + .../vendor/github.com/gofrs/uuid/sql.go | 109 + .../vendor/github.com/gofrs/uuid/uuid.go | 258 + .../cadvisor/container/common/helpers.go | 34 +- .../cadvisor/container/docker/factory.go | 30 +- .../cadvisor/container/docker/handler.go | 37 + .../google/cadvisor/container/factory.go | 2 + .../container/libcontainer/handler.go | 33 +- .../github.com/google/cadvisor/fs/fs.go | 144 +- .../github.com/google/cadvisor/fs/types.go | 2 + .../google/cadvisor/info/v1/container.go | 6 + .../google/cadvisor/machine/machine.go | 47 +- .../google/cadvisor/manager/container.go | 225 +- .../google/cadvisor/metrics/prometheus.go | 32 + .../cadvisor/metrics/prometheus_fake.go | 16 + .../google/cadvisor/resctrl/collector.go | 12 +- .../cadvisor/utils/oomparser/oomparser.go | 8 +- .../google/cadvisor/utils/sysfs/sysfs.go | 180 +- .../cadvisor/utils/sysfs/sysfs_notx86.go | 19 + .../google/cadvisor/utils/sysfs/sysfs_x86.go | 19 + .../googleapis/gnostic/compiler/README.md | 3 +- .../googleapis/gnostic/compiler/context.go | 2 +- .../googleapis/gnostic/compiler/error.go | 2 +- .../gnostic/compiler/extension-handler.go | 101 - .../googleapis/gnostic/compiler/extensions.go | 85 + .../googleapis/gnostic/compiler/helpers.go | 336 +- .../googleapis/gnostic/compiler/main.go | 2 +- .../googleapis/gnostic/compiler/reader.go | 116 +- .../googleapis/gnostic/extensions/README.md | 12 +- .../gnostic/extensions/extension.pb.go | 529 +- .../gnostic/extensions/extension.proto | 29 +- .../gnostic/extensions/extensions.go | 68 +- .../googleapis/gnostic/jsonschema/README.md | 4 + .../googleapis/gnostic/jsonschema/base.go | 84 + .../googleapis/gnostic/jsonschema/display.go | 229 + .../googleapis/gnostic/jsonschema/models.go | 228 + .../gnostic/jsonschema/operations.go | 394 + .../googleapis/gnostic/jsonschema/reader.go | 442 + .../googleapis/gnostic/jsonschema/schema.json | 150 + .../googleapis/gnostic/jsonschema/writer.go | 369 + .../googleapis/gnostic/openapiv2/OpenAPIv2.go | 3306 +++-- .../gnostic/openapiv2/OpenAPIv2.pb.go | 8199 +++++++----- .../gnostic/openapiv2/OpenAPIv2.proto | 7 +- .../googleapis/gnostic/openapiv2/README.md | 20 +- .../googleapis/gnostic/openapiv2/document.go | 26 + .../gnostic/openapiv2/openapi-2.0.json | 4 +- .../go-windows-terminal-sequences/LICENSE | 9 - .../go-windows-terminal-sequences/README.md | 42 - .../go-windows-terminal-sequences/go.mod | 1 - .../sequences.go | 35 - .../sequences_dummy.go | 11 - .../github.com/moby/sys/mountinfo/doc.go | 44 + .../github.com/moby/sys/mountinfo/go.mod | 2 + .../github.com/moby/sys/mountinfo/go.sum | 2 + .../moby/sys/mountinfo/mounted_linux.go | 58 + .../moby/sys/mountinfo/mounted_unix.go | 66 + .../moby/sys/mountinfo/mountinfo.go | 42 +- ...{mountinfo_freebsd.go => mountinfo_bsd.go} | 16 +- .../moby/sys/mountinfo/mountinfo_filters.go | 26 +- .../moby/sys/mountinfo/mountinfo_linux.go | 134 +- .../sys/mountinfo/mountinfo_unsupported.go | 11 +- .../moby/sys/mountinfo/mountinfo_windows.go | 6 +- .../vendor/github.com/moby/term/.gitignore | 8 + .../azure-sdk-for-go => moby/term}/LICENSE | 17 +- .../vendor/github.com/moby/term/README.md | 36 + .../{docker/docker/pkg => moby}/term/ascii.go | 2 +- .../vendor/github.com/moby/term/go.mod | 12 + .../vendor/github.com/moby/term/go.sum | 23 + .../vendor/github.com/moby/term/proxy.go | 88 + .../vendor/github.com/moby/term/tc.go | 19 + .../{docker/docker/pkg => moby}/term/term.go | 20 +- .../docker/pkg => moby}/term/term_windows.go | 94 +- .../termios_linux.go => moby/term/termios.go} | 20 +- .../github.com/moby/term/termios_bsd.go | 12 + .../github.com/moby/term/termios_nonbsd.go | 12 + .../pkg => moby}/term/windows/ansi_reader.go | 21 +- .../pkg => moby}/term/windows/ansi_writer.go | 12 +- .../pkg => moby}/term/windows/console.go | 16 +- .../github.com/moby/term/windows/doc.go | 5 + .../docker/pkg => moby}/term/winsize.go | 2 +- .../github.com/mrunalp/fileutils/fileutils.go | 38 +- .../github.com/mrunalp/fileutils/go.mod | 3 + .../runc/libcontainer/README.md | 162 +- .../{apparmor.go => apparmor_linux.go} | 20 +- ...or_disabled.go => apparmor_unsupported.go} | 2 +- .../libcontainer/capabilities/capabilities.go | 96 + .../capabilities/capabilities_unsupported.go | 3 + .../runc/libcontainer/capabilities_linux.go | 117 - .../cgroups/devices/devices_emulator.go | 50 +- .../cgroups/ebpf/devicefilter/devicefilter.go | 22 +- .../runc/libcontainer/cgroups/fs/blkio.go | 180 +- .../runc/libcontainer/cgroups/fs/cpu.go | 3 +- .../runc/libcontainer/cgroups/fs/cpuacct.go | 14 +- .../runc/libcontainer/cgroups/fs/cpuset.go | 188 +- .../runc/libcontainer/cgroups/fs/devices.go | 11 +- .../runc/libcontainer/cgroups/fs/freezer.go | 49 +- .../runc/libcontainer/cgroups/fs/fs.go | 89 +- .../runc/libcontainer/cgroups/fs/hugetlb.go | 9 +- .../runc/libcontainer/cgroups/fs/kmem.go | 6 +- .../runc/libcontainer/cgroups/fs/memory.go | 124 +- .../runc/libcontainer/cgroups/fs/name.go | 2 +- .../runc/libcontainer/cgroups/fs2/cpu.go | 3 +- .../runc/libcontainer/cgroups/fs2/create.go | 35 +- .../runc/libcontainer/cgroups/fs2/devices.go | 5 +- .../runc/libcontainer/cgroups/fs2/freezer.go | 2 +- .../runc/libcontainer/cgroups/fs2/fs2.go | 79 +- .../runc/libcontainer/cgroups/fs2/hugetlb.go | 21 +- .../runc/libcontainer/cgroups/fs2/io.go | 4 +- .../runc/libcontainer/cgroups/fs2/memory.go | 10 +- .../runc/libcontainer/cgroups/fs2/pids.go | 7 +- .../libcontainer/cgroups/fscommon/fscommon.go | 35 +- .../libcontainer/cgroups/fscommon/open.go | 103 + .../libcontainer/cgroups/fscommon/utils.go | 57 +- .../runc/libcontainer/cgroups/stats.go | 28 + .../libcontainer/cgroups/systemd/common.go | 118 +- .../libcontainer/cgroups/systemd/cpuset.go | 67 + .../runc/libcontainer/cgroups/systemd/user.go | 4 +- .../runc/libcontainer/cgroups/systemd/v1.go | 136 +- .../runc/libcontainer/cgroups/systemd/v2.go | 143 + .../runc/libcontainer/cgroups/utils.go | 135 +- .../runc/libcontainer/cgroups/v1_utils.go | 100 +- .../runc/libcontainer/configs/cgroup_linux.go | 6 +- .../runc/libcontainer/configs/config.go | 6 +- .../libcontainer/configs/device_windows.go | 5 - .../runc/libcontainer/configs/devices.go | 17 + .../libcontainer/configs/namespaces_linux.go | 2 +- .../configs/validate/validator.go | 87 +- .../runc/libcontainer/container_linux.go | 133 +- .../runc/libcontainer/criu_opts_linux.go | 12 +- .../{configs => devices}/device.go | 58 +- .../{configs => devices}/device_unix.go | 4 +- .../libcontainer/devices/device_windows.go | 5 + .../runc/libcontainer/devices/devices.go | 112 + .../runc/libcontainer/factory_linux.go | 43 +- .../runc/libcontainer/init_linux.go | 34 +- .../runc/libcontainer/intelrdt/cmt.go | 11 +- .../runc/libcontainer/intelrdt/intelrdt.go | 244 +- .../runc/libcontainer/intelrdt/mbm.go | 1 + .../runc/libcontainer/intelrdt/monitoring.go | 5 +- .../runc/libcontainer/intelrdt/stats.go | 6 +- .../runc/libcontainer/network_linux.go | 4 +- .../runc/libcontainer/process_linux.go | 47 +- .../runc/libcontainer/rootfs_linux.go | 152 +- .../runc/libcontainer/seccomp/config.go | 6 +- .../seccomp/patchbpf/enosys_linux.go | 628 + .../seccomp/patchbpf/enosys_unsupported.go | 3 + .../libcontainer/seccomp/seccomp_linux.go | 22 +- .../seccomp/seccomp_unsupported.go | 5 + .../runc/libcontainer/setns_init_linux.go | 3 +- .../runc/libcontainer/standard_init_linux.go | 6 +- .../runc/libcontainer/state_linux.go | 3 +- .../runc/libcontainer/system/proc.go | 10 - .../runc/libcontainer/user/lookup_windows.go | 6 +- .../runc/libcontainer/user/user.go | 4 +- .../runc/libcontainer/utils/utils.go | 19 +- .../opencontainers/runc/types/events.go | 15 + .../runtime-spec/specs-go/config.go | 10 +- .../opencontainers/selinux/go-selinux/doc.go | 3 - .../{label_selinux.go => label_linux.go} | 7 +- .../selinux/go-selinux/label/label_stub.go | 2 +- .../selinux/go-selinux/selinux.go | 41 +- .../selinux/go-selinux/selinux_linux.go | 224 +- .../selinux/go-selinux/selinux_stub.go | 6 +- .../selinux/go-selinux/xattrs.go | 30 - .../selinux/go-selinux/xattrs_linux.go | 38 + .../opencontainers/selinux/pkg/pwalk/pwalk.go | 17 +- .../github.com/sirupsen/logrus/.gitignore | 2 + .../github.com/sirupsen/logrus/buffer_pool.go | 52 + .../github.com/sirupsen/logrus/entry.go | 14 +- .../github.com/sirupsen/logrus/exported.go | 45 + .../vendor/github.com/sirupsen/logrus/go.mod | 3 +- .../vendor/github.com/sirupsen/logrus/go.sum | 6 +- .../github.com/sirupsen/logrus/logger.go | 54 +- .../sirupsen/logrus/terminal_check_windows.go | 29 +- .../syndtr/gocapability/capability/enum.go | 45 +- .../gocapability/capability/enum_gen.go | 9 + .../vendor/github.com/willf/bitset/Makefile | 191 - .../vendor/github.com/willf/bitset/README.md | 20 +- .../vendor/github.com/willf/bitset/bitset.go | 72 +- .../vendor/github.com/willf/bitset/go.mod | 3 + .../vendor/github.com/willf/bitset/go.sum | 0 .../vendor/go.uber.org/atomic/.gitignore | 3 +- .../vendor/go.uber.org/atomic/.travis.yml | 18 +- .../vendor/go.uber.org/atomic/CHANGELOG.md | 64 + .../vendor/go.uber.org/atomic/Makefile | 60 +- .../vendor/go.uber.org/atomic/README.md | 31 +- .../vendor/go.uber.org/atomic/atomic.go | 9 +- .../vendor/go.uber.org/atomic/glide.lock | 17 - .../vendor/go.uber.org/atomic/glide.yaml | 6 - .../vendor/go.uber.org/atomic/go.mod | 10 + .../vendor/go.uber.org/atomic/go.sum | 22 + .../vendor/go.uber.org/multierr/.gitignore | 3 + .../vendor/go.uber.org/multierr/.travis.yml | 14 +- .../vendor/go.uber.org/multierr/CHANGELOG.md | 26 + .../vendor/go.uber.org/multierr/Makefile | 56 +- .../vendor/go.uber.org/multierr/README.md | 4 +- .../vendor/go.uber.org/multierr/error.go | 58 +- .../vendor/go.uber.org/multierr/glide.lock | 19 - .../vendor/go.uber.org/multierr/go.mod | 12 + .../vendor/go.uber.org/multierr/go.sum | 45 + .../vendor/go.uber.org/multierr/go113.go | 52 + .../vendor/go.uber.org/zap/.gitignore | 4 + .../vendor/go.uber.org/zap/.readme.tmpl | 5 +- .../vendor/go.uber.org/zap/.travis.yml | 20 +- .../vendor/go.uber.org/zap/CHANGELOG.md | 105 + .../vendor/go.uber.org/zap/FAQ.md | 1 + .../vendor/go.uber.org/zap/Makefile | 77 +- .../vendor/go.uber.org/zap/README.md | 68 +- .../vendor/go.uber.org/zap/buffer/buffer.go | 10 +- .../zap/{check_license.sh => checklicense.sh} | 0 .../vendor/go.uber.org/zap/config.go | 31 +- .../vendor/go.uber.org/zap/encoder.go | 4 + .../vendor/go.uber.org/zap/field.go | 231 +- .../vendor/go.uber.org/zap/glide.lock | 76 - .../vendor/go.uber.org/zap/glide.yaml | 3 +- .../vendor/go.uber.org/zap/go.mod | 13 + .../vendor/go.uber.org/zap/go.sum | 56 + .../vendor/go.uber.org/zap/logger.go | 47 +- .../vendor/go.uber.org/zap/options.go | 39 +- .../vendor/go.uber.org/zap/sink.go | 2 +- .../vendor/go.uber.org/zap/stacktrace.go | 47 +- .../zap/zapcore/console_encoder.go | 30 +- .../vendor/go.uber.org/zap/zapcore/encoder.go | 109 +- .../vendor/go.uber.org/zap/zapcore/entry.go | 17 +- .../vendor/go.uber.org/zap/zapcore/error.go | 5 - .../vendor/go.uber.org/zap/zapcore/field.go | 25 +- .../go.uber.org/zap/zapcore/increase_level.go | 66 + .../go.uber.org/zap/zapcore/json_encoder.go | 65 +- .../go.uber.org/zap/zapcore/marshaler.go | 8 + .../vendor/go.uber.org/zap/zapcore/sampler.go | 94 +- .../vendor/gopkg.in/yaml.v3/.travis.yml | 1 + .../vendor/gopkg.in/yaml.v3/apic.go | 1 + .../vendor/gopkg.in/yaml.v3/decode.go | 63 +- .../vendor/gopkg.in/yaml.v3/emitterc.go | 54 +- .../vendor/gopkg.in/yaml.v3/encode.go | 25 +- .../vendor/gopkg.in/yaml.v3/parserc.go | 48 +- .../vendor/gopkg.in/yaml.v3/scannerc.go | 21 +- .../vendor/gopkg.in/yaml.v3/yaml.go | 35 +- .../vendor/gopkg.in/yaml.v3/yamlh.go | 2 + .../vendor/k8s.io/api/apps/v1/types.go | 3 + .../k8s.io/api/apps/v1beta2/generated.proto | 1 + .../vendor/k8s.io/api/apps/v1beta2/types.go | 2 + .../k8s.io/api/autoscaling/v1/generated.proto | 1 + .../vendor/k8s.io/api/autoscaling/v1/types.go | 1 + .../k8s.io/api/batch/v1/generated.pb.go | 189 +- .../k8s.io/api/batch/v1/generated.proto | 2 +- .../vendor/k8s.io/api/batch/v1/types.go | 6 +- .../batch/v1/types_swagger_doc_generated.go | 2 +- .../api/batch/v1/zz_generated.deepcopy.go | 5 + .../api/core/v1/annotation_key_constants.go | 15 +- .../vendor/k8s.io/api/core/v1/generated.pb.go | 2352 ++-- .../vendor/k8s.io/api/core/v1/generated.proto | 59 +- .../vendor/k8s.io/api/core/v1/register.go | 1 - .../vendor/k8s.io/api/core/v1/types.go | 70 +- .../core/v1/types_swagger_doc_generated.go | 29 +- .../api/core/v1/zz_generated.deepcopy.go | 38 +- .../k8s.io/api/discovery/v1/generated.pb.go | 509 +- .../k8s.io/api/discovery/v1/generated.proto | 20 + .../vendor/k8s.io/api/discovery/v1/types.go | 19 + .../v1/types_swagger_doc_generated.go | 19 + .../api/discovery/v1/zz_generated.deepcopy.go | 42 + .../api/discovery/v1beta1/generated.pb.go | 506 +- .../api/discovery/v1beta1/generated.proto | 20 + .../k8s.io/api/discovery/v1beta1/types.go | 27 +- .../v1beta1/types_swagger_doc_generated.go | 19 + .../v1beta1/zz_generated.deepcopy.go | 42 + .../zz_generated.prerelease-lifecycle.go | 20 +- .../api/extensions/v1beta1/generated.proto | 1 + .../k8s.io/api/extensions/v1beta1/types.go | 3 + .../vendor/k8s.io/api/node/v1/generated.proto | 1 + .../vendor/k8s.io/api/node/v1/types.go | 1 + .../k8s.io/api/node/v1alpha1/generated.proto | 5 +- .../vendor/k8s.io/api/node/v1alpha1/types.go | 5 +- .../v1alpha1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/node/v1beta1/generated.proto | 5 +- .../vendor/k8s.io/api/node/v1beta1/types.go | 5 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../vendor/k8s.io/api/policy/v1/doc.go | 24 + .../k8s.io/api/policy/v1/generated.pb.go | 1681 +++ .../k8s.io/api/policy/v1/generated.proto | 151 + .../vendor/k8s.io/api/policy/v1/register.go | 52 + .../vendor/k8s.io/api/policy/v1/types.go | 172 + .../policy/v1/types_swagger_doc_generated.go | 87 + .../api/policy/v1/zz_generated.deepcopy.go | 180 + .../k8s.io/api/policy/v1beta1/generated.proto | 4 + .../vendor/k8s.io/api/policy/v1beta1/types.go | 14 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../zz_generated.prerelease-lifecycle.go | 20 +- .../vendor/k8s.io/api/rbac/v1/generated.proto | 6 +- .../vendor/k8s.io/api/rbac/v1/types.go | 6 +- .../rbac/v1/types_swagger_doc_generated.go | 4 +- .../k8s.io/api/rbac/v1alpha1/generated.proto | 4 +- .../vendor/k8s.io/api/rbac/v1alpha1/types.go | 4 +- .../v1alpha1/types_swagger_doc_generated.go | 4 +- .../k8s.io/api/rbac/v1beta1/generated.proto | 2 +- .../vendor/k8s.io/api/rbac/v1beta1/types.go | 2 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/storage/v1/generated.proto | 25 +- .../vendor/k8s.io/api/storage/v1/types.go | 32 +- .../storage/v1/types_swagger_doc_generated.go | 14 +- .../api/storage/v1beta1/generated.proto | 25 +- .../k8s.io/api/storage/v1beta1/types.go | 31 +- .../v1beta1/types_swagger_doc_generated.go | 14 +- .../k8s.io/apimachinery/pkg/api/errors/OWNERS | 1 - .../apimachinery/pkg/api/errors/errors.go | 2 +- .../pkg/api/resource/quantity_proto.go | 2 +- .../apimachinery/pkg/apis/meta/v1/OWNERS | 2 - .../pkg/apis/meta/v1/generated.pb.go | 387 +- .../pkg/apis/meta/v1/generated.proto | 10 + .../apimachinery/pkg/apis/meta/v1/types.go | 10 + .../meta/v1/types_swagger_doc_generated.go | 15 +- .../pkg/apis/meta/v1/validation/validation.go | 6 + .../apimachinery/pkg/labels/selector.go | 11 +- .../k8s.io/apimachinery/pkg/runtime/scheme.go | 26 + .../pkg/util/httpstream/httpstream.go | 2 + .../pkg/util/httpstream/spdy/connection.go | 22 +- .../pkg/util/managedfields/extract.go | 101 + .../apimachinery/pkg/util/proxy/transport.go | 3 +- .../pkg/util/validation/field/errors.go | 2 +- .../configuration/mutating_webhook_manager.go | 35 +- .../validating_webhook_manager.go | 37 +- .../plugin/webhook/mutating/dispatcher.go | 8 +- .../k8s.io/apiserver/pkg/apis/audit/types.go | 8 +- .../apiserver/pkg/apis/audit/v1/types.go | 8 +- .../pkg/apis/audit/v1alpha1/types.go | 8 +- .../apiserver/pkg/apis/audit/v1beta1/types.go | 8 +- .../pkg/apis/flowcontrol/bootstrap/default.go | 57 + .../k8s.io/apiserver/pkg/audit/format.go | 4 +- .../k8s.io/apiserver/pkg/audit/policy/util.go | 8 +- .../k8s.io/apiserver/pkg/audit/request.go | 18 +- .../authenticatorfactory/delegating.go | 11 +- .../authenticatorfactory/loopback.go | 4 +- .../authenticatorfactory/requestheader.go | 15 +- .../authorization/authorizer/interfaces.go | 4 +- .../authorization/authorizerfactory/OWNERS | 5 - .../apiserver/pkg/authorization/path/path.go | 3 +- .../apiserver/pkg/endpoints/filters/audit.go | 12 - .../pkg/endpoints/filters/authentication.go | 12 +- .../pkg/endpoints/filters/metrics.go | 4 +- .../pkg/endpoints/filters/with_auditid.go | 68 + .../apiserver/pkg/endpoints/groupversion.go | 22 +- .../pkg/endpoints/handlers/create.go | 5 +- .../pkg/endpoints/handlers/delete.go | 5 +- .../handlers/fieldmanager/buildmanagerinfo.go | 11 +- .../handlers/fieldmanager/fieldmanager.go | 48 +- .../fieldmanager/internal/conflict.go | 10 +- .../fieldmanager/internal/managedfields.go | 6 +- .../handlers/fieldmanager/scalehandler.go | 174 + .../handlers/fieldmanager/structuredmerge.go | 12 +- .../endpoints/handlers/finisher/finisher.go | 109 + .../pkg/endpoints/handlers/helpers.go | 15 + .../apiserver/pkg/endpoints/handlers/patch.go | 3 +- .../apiserver/pkg/endpoints/handlers/rest.go | 76 +- .../pkg/endpoints/handlers/trace_util.go | 1 + .../pkg/endpoints/handlers/update.go | 5 +- .../apiserver/pkg/endpoints/installer.go | 22 +- .../pkg/endpoints/openapi/openapi.go | 4 +- .../pkg/endpoints/request/auditid.go | 66 + .../apiserver/pkg/features/kube_features.go | 3 +- .../apiserver/pkg/quota/v1/interfaces.go | 2 +- .../pkg/registry/generic/registry/store.go | 13 + .../apiserver/pkg/registry/rest/rest.go | 28 + .../k8s.io/apiserver/pkg/server/config.go | 11 +- .../server/dynamiccertificates/cert_key.go | 15 - .../server/dynamiccertificates/client_ca.go | 12 - .../configmap_cafile_content.go | 1 - .../dynamic_cafile_content.go | 12 - .../dynamic_serving_content.go | 1 - .../dynamic_sni_content.go | 1 - .../server/dynamiccertificates/interfaces.go | 68 + .../dynamiccertificates/static_content.go | 36 +- .../dynamiccertificates/union_content.go | 5 +- .../apiserver/pkg/server/filters/wrap.go | 10 +- .../apiserver/pkg/server/genericapiserver.go | 29 +- .../apiserver/pkg/server/httplog/httplog.go | 22 +- .../apiserver/pkg/server/options/audit.go | 35 +- .../pkg/server/options/authentication.go | 47 +- .../authentication_dynamic_request_header.go | 1 - .../pkg/server/options/authorization.go | 14 +- .../apiserver/pkg/server/routes/openapi.go | 2 +- .../apiserver/pkg/server/secure_serving.go | 16 +- .../k8s.io/apiserver/pkg/storage/OWNERS | 1 - .../pkg/storage/etcd3/metrics/metrics.go | 17 +- .../apiserver/pkg/storageversion/manager.go | 23 +- .../pkg/util/flowcontrol/apf_controller.go | 186 +- .../pkg/util/flowcontrol/apf_filter.go | 27 +- .../fairqueuing/queueset/queueset.go | 7 +- .../apiserver/pkg/util/openapi/proto.go | 12 +- .../authenticator/token/webhook/webhook.go | 27 +- .../v1/mutatingwebhookconfiguration.go | 38 + .../v1/validatingwebhookconfiguration.go | 38 + .../v1beta1/mutatingwebhookconfiguration.go | 38 + .../v1beta1/validatingwebhookconfiguration.go | 38 + .../v1alpha1/storageversion.go | 37 + .../apps/v1/controllerrevision.go | 39 + .../applyconfigurations/apps/v1/daemonset.go | 39 + .../applyconfigurations/apps/v1/deployment.go | 39 + .../applyconfigurations/apps/v1/replicaset.go | 39 + .../apps/v1/statefulset.go | 39 + .../apps/v1beta1/controllerrevision.go | 39 + .../apps/v1beta1/deployment.go | 39 + .../apps/v1beta1/statefulset.go | 39 + .../apps/v1beta2/controllerrevision.go | 39 + .../apps/v1beta2/daemonset.go | 39 + .../apps/v1beta2/deployment.go | 39 + .../apps/v1beta2/replicaset.go | 39 + .../applyconfigurations/apps/v1beta2/scale.go | 233 + .../apps/v1beta2/statefulset.go | 39 + .../autoscaling/v1/horizontalpodautoscaler.go | 39 + .../autoscaling/v1/scale.go | 232 + .../autoscaling/v1/scalespec.go | 39 + .../autoscaling/v1/scalestatus.go | 48 + .../v2beta1/horizontalpodautoscaler.go | 39 + .../v2beta2/horizontalpodautoscaler.go | 39 + .../applyconfigurations/batch/v1/cronjob.go | 39 + .../applyconfigurations/batch/v1/job.go | 39 + .../batch/v1beta1/cronjob.go | 39 + .../v1/certificatesigningrequest.go | 38 + .../v1beta1/certificatesigningrequest.go | 38 + .../coordination/v1/lease.go | 39 + .../coordination/v1beta1/lease.go | 39 + .../core/v1/componentstatus.go | 38 + .../applyconfigurations/core/v1/configmap.go | 39 + .../applyconfigurations/core/v1/endpoints.go | 39 + .../core/v1/ephemeralvolumesource.go | 9 - .../applyconfigurations/core/v1/event.go | 39 + .../applyconfigurations/core/v1/limitrange.go | 39 + .../applyconfigurations/core/v1/namespace.go | 38 + .../applyconfigurations/core/v1/node.go | 38 + .../core/v1/persistentvolume.go | 38 + .../core/v1/persistentvolumeclaim.go | 39 + .../applyconfigurations/core/v1/pod.go | 39 + .../core/v1/podtemplate.go | 39 + .../applyconfigurations/core/v1/probe.go | 21 +- .../core/v1/replicationcontroller.go | 39 + .../core/v1/resourcequota.go | 39 + .../applyconfigurations/core/v1/secret.go | 38 + .../applyconfigurations/core/v1/service.go | 39 + .../core/v1/serviceaccount.go | 39 + .../discovery/v1/endpoint.go | 9 + .../discovery/v1/endpointhints.go | 44 + .../discovery/v1/endpointslice.go | 38 + .../discovery/v1/forzone.go | 39 + .../discovery/v1beta1/endpoint.go | 9 + .../discovery/v1beta1/endpointhints.go | 44 + .../discovery/v1beta1/endpointslice.go | 38 + .../discovery/v1beta1/forzone.go | 39 + .../applyconfigurations/events/v1/event.go | 39 + .../events/v1beta1/event.go | 39 + .../extensions/v1beta1/daemonset.go | 39 + .../extensions/v1beta1/deployment.go | 39 + .../extensions/v1beta1/ingress.go | 39 + .../extensions/v1beta1/networkpolicy.go | 39 + .../extensions/v1beta1/podsecuritypolicy.go | 38 + .../extensions/v1beta1/replicaset.go | 39 + .../extensions/v1beta1/scale.go | 233 + .../flowcontrol/v1alpha1/flowschema.go | 38 + .../v1alpha1/prioritylevelconfiguration.go | 38 + .../flowcontrol/v1beta1/flowschema.go | 38 + .../v1beta1/prioritylevelconfiguration.go | 38 + .../applyconfigurations/internal/internal.go | 10806 ++++++++++++++++ .../meta/v1/managedfieldsentry.go | 21 +- .../networking/v1/ingress.go | 39 + .../networking/v1/ingressclass.go | 38 + .../networking/v1/networkpolicy.go | 39 + .../networking/v1beta1/ingress.go | 39 + .../networking/v1beta1/ingressclass.go | 38 + .../node/v1/runtimeclass.go | 38 + .../node/v1alpha1/runtimeclass.go | 38 + .../node/v1beta1/runtimeclass.go | 38 + .../applyconfigurations/policy/v1/eviction.go | 267 + .../policy/v1/poddisruptionbudget.go | 276 + .../policy/v1/poddisruptionbudgetspec.go | 62 + .../policy/v1/poddisruptionbudgetstatus.go | 109 + .../policy/v1beta1/eviction.go | 39 + .../policy/v1beta1/poddisruptionbudget.go | 39 + .../policy/v1beta1/podsecuritypolicy.go | 38 + .../rbac/v1/clusterrole.go | 38 + .../rbac/v1/clusterrolebinding.go | 38 + .../applyconfigurations/rbac/v1/role.go | 39 + .../rbac/v1/rolebinding.go | 39 + .../rbac/v1alpha1/clusterrole.go | 38 + .../rbac/v1alpha1/clusterrolebinding.go | 38 + .../applyconfigurations/rbac/v1alpha1/role.go | 39 + .../rbac/v1alpha1/rolebinding.go | 39 + .../rbac/v1beta1/clusterrole.go | 38 + .../rbac/v1beta1/clusterrolebinding.go | 38 + .../applyconfigurations/rbac/v1beta1/role.go | 39 + .../rbac/v1beta1/rolebinding.go | 39 + .../scheduling/v1/priorityclass.go | 38 + .../scheduling/v1alpha1/priorityclass.go | 38 + .../scheduling/v1beta1/priorityclass.go | 38 + .../storage/v1/csidriver.go | 38 + .../applyconfigurations/storage/v1/csinode.go | 38 + .../storage/v1/storageclass.go | 37 + .../storage/v1/volumeattachment.go | 38 + .../storage/v1alpha1/csistoragecapacity.go | 39 + .../storage/v1alpha1/volumeattachment.go | 38 + .../storage/v1beta1/csidriver.go | 38 + .../storage/v1beta1/csinode.go | 38 + .../storage/v1beta1/csistoragecapacity.go | 39 + .../storage/v1beta1/storageclass.go | 37 + .../storage/v1beta1/volumeattachment.go | 38 + .../client-go/discovery/discovery_client.go | 3 +- .../k8s.io/client-go/dynamic/fake/simple.go | 7 +- .../k8s.io/client-go/informers/generic.go | 5 + .../client-go/informers/policy/interface.go | 8 + .../informers/policy/v1/interface.go | 45 + .../policy/v1/poddisruptionbudget.go | 90 + .../k8s.io/client-go/kubernetes/clientset.go | 14 + .../kubernetes/fake/clientset_generated.go | 7 + .../client-go/kubernetes/fake/register.go | 2 + .../client-go/kubernetes/scheme/register.go | 2 + .../kubernetes/typed/apps/v1/deployment.go | 27 + .../typed/apps/v1/fake/fake_deployment.go | 20 + .../typed/apps/v1/fake/fake_replicaset.go | 20 + .../typed/apps/v1/fake/fake_statefulset.go | 20 + .../kubernetes/typed/apps/v1/replicaset.go | 27 + .../kubernetes/typed/apps/v1/statefulset.go | 27 + .../apps/v1beta2/fake/fake_statefulset.go | 19 + .../typed/apps/v1beta2/statefulset.go | 26 + .../kubernetes/typed/core/v1/fake/fake_pod.go | 19 +- .../typed/core/v1/fake/fake_pod_expansion.go | 21 +- .../client-go/kubernetes/typed/core/v1/pod.go | 25 +- .../kubernetes/typed/core/v1/pod_expansion.go | 27 +- .../typed/extensions/v1beta1/deployment.go | 26 + .../v1beta1/fake/fake_deployment.go | 19 + .../v1beta1/fake/fake_replicaset.go | 19 + .../typed/extensions/v1beta1/replicaset.go | 26 + .../kubernetes/typed/policy/v1/doc.go | 20 + .../kubernetes/typed/policy/v1/eviction.go | 48 + .../typed/policy/v1/eviction_expansion.go | 40 + .../kubernetes/typed/policy/v1/fake/doc.go | 20 + .../typed/policy/v1/fake/fake_eviction.go | 25 + .../policy/v1/fake/fake_eviction_expansion.go | 37 + .../v1/fake/fake_poddisruptionbudget.go | 190 + .../policy/v1/fake/fake_policy_client.go | 44 + .../typed/policy/v1/generated_expansion.go | 21 + .../typed/policy/v1/poddisruptionbudget.go | 256 + .../typed/policy/v1/policy_client.go | 94 + .../client-go/listers/policy/v1/eviction.go | 99 + .../listers/policy/v1/expansion_generated.go | 27 + .../listers/policy/v1/poddisruptionbudget.go | 99 + .../v1/poddisruptionbudget_expansion.go | 69 + .../v1beta1/poddisruptionbudget_expansion.go | 4 - .../plugin/pkg/client/auth/exec/exec.go | 2 +- .../vendor/k8s.io/client-go/rest/OWNERS | 1 - .../vendor/k8s.io/client-go/rest/request.go | 2 +- .../k8s.io/client-go/tools/cache/OWNERS | 2 - .../client-go/tools/cache/delta_fifo.go | 11 +- .../tools/cache/mutation_detector.go | 2 +- .../k8s.io/client-go/tools/cache/reflector.go | 7 +- .../k8s.io/client-go/tools/cache/store.go | 5 + .../k8s.io/client-go/tools/events/OWNERS | 2 + .../tools/leaderelection/leaderelection.go | 44 +- .../k8s.io/client-go/tools/record/OWNERS | 27 +- .../client-go/tools/record/events_cache.go | 6 +- .../k8s.io/client-go/tools/watch/until.go | 2 +- .../k8s.io/client-go/transport/transport.go | 2 +- .../util/certificate/certificate_manager.go | 84 +- .../vendor/k8s.io/cloud-provider/go.mod | 26 +- .../vendor/k8s.io/cloud-provider/go.sum | 90 +- .../cloud-provider/volume/helpers/rounding.go | 138 +- .../component-base/cli/flag/sectioned.go | 28 +- .../cli/flag/string_slice_flag.go | 6 +- .../k8s.io/component-base/logs/json/json.go | 5 +- .../k8s.io/component-base/logs/options.go | 33 +- .../metrics/prometheus/restclient/metrics.go | 1 + .../metrics/testutil/metrics.go | 15 - .../corev1/nodeaffinity/nodeaffinity.go | 35 + .../vendor/k8s.io/csi-translation-lib/go.mod | 10 +- .../vendor/k8s.io/csi-translation-lib/go.sum | 35 +- .../csi-translation-lib/plugins/aws_ebs.go | 2 +- .../csi-translation-lib/plugins/azure_disk.go | 2 +- .../csi-translation-lib/plugins/azure_file.go | 9 +- .../csi-translation-lib/plugins/gce_pd.go | 2 +- .../plugins/in_tree_volume.go | 3 +- .../plugins/openstack_cinder.go | 2 +- .../plugins/vsphere_volume.go | 2 +- .../k8s.io/csi-translation-lib/translate.go | 4 +- .../vendor/k8s.io/klog/v2/klog.go | 24 +- .../kube-openapi/pkg/builder/openapi.go | 2 +- .../k8s.io/kube-openapi/pkg/builder/util.go | 2 +- .../k8s.io/kube-openapi/pkg/common/common.go | 2 +- .../pkg/handler/default_pruning.go | 2 +- .../kube-openapi/pkg/handler/handler.go | 14 +- .../pkg/validation}/spec/.gitignore | 0 .../kube-openapi/pkg/validation}/spec/LICENSE | 0 .../pkg/validation}/spec/contact_info.go | 0 .../pkg/validation}/spec/external_docs.go | 0 .../pkg/validation/spec/header.go | 71 + .../kube-openapi/pkg/validation}/spec/info.go | 10 - .../pkg/validation}/spec/items.go | 135 - .../pkg/validation}/spec/license.go | 0 .../pkg/validation/spec/operation.go | 96 + .../pkg/validation/spec/parameter.go | 111 + .../pkg/validation}/spec/path_item.go | 13 - .../pkg/validation}/spec/paths.go | 12 - .../kube-openapi/pkg/validation}/spec/ref.go | 26 - .../pkg/validation}/spec/response.go | 53 - .../pkg/validation}/spec/responses.go | 17 - .../pkg/validation}/spec/schema.go | 83 - .../pkg/validation}/spec/security_scheme.go | 76 - .../pkg/validation}/spec/swagger.go | 162 - .../kube-openapi/pkg/validation}/spec/tag.go | 16 - .../pkg/apis/deviceplugin/v1beta1/api.pb.go | 131 +- .../pkg/apis/deviceplugin/v1beta1/api.proto | 10 +- .../pkg/apis/podresources/v1/api.pb.go | 565 +- .../pkg/apis/podresources/v1/api.proto | 9 + .../kubernetes/cmd/kube-proxy/app/server.go | 2 +- .../cmd/kube-proxy/app/server_others.go | 8 +- .../cmd/kube-proxy/app/server_windows.go | 18 +- .../cmd/kubelet/app/init_windows.go | 2 +- .../cmd/kubelet/app/options/options.go | 6 +- .../kubernetes/cmd/kubelet/app/plugins.go | 5 - .../cmd/kubelet/app/plugins_providers.go | 11 +- .../kubernetes/cmd/kubelet/app/server.go | 185 +- .../cmd/kubelet/app/server_linux.go | 8 +- .../cmd/kubelet/app/server_others.go | 33 + .../cmd/kubelet/app/server_windows.go | 85 + .../k8s.io/kubernetes/pkg/api/pod/util.go | 35 + .../k8s.io/kubernetes/pkg/apis/apps/OWNERS | 1 - .../pkg/apis/apps/validation/validation.go | 20 +- .../kubernetes/pkg/apis/autoscaling/OWNERS | 2 - .../k8s.io/kubernetes/pkg/apis/batch/OWNERS | 2 - .../k8s.io/kubernetes/pkg/apis/batch/types.go | 4 +- .../pkg/apis/batch/zz_generated.deepcopy.go | 5 + .../k8s.io/kubernetes/pkg/apis/core/OWNERS | 2 - .../pkg/apis/core/annotation_key_constants.go | 15 +- .../kubernetes/pkg/apis/core/register.go | 1 - .../k8s.io/kubernetes/pkg/apis/core/types.go | 43 +- .../k8s.io/kubernetes/pkg/apis/core/v1/OWNERS | 1 - .../apis/core/v1/zz_generated.conversion.go | 36 +- .../pkg/apis/core/v1/zz_generated.defaults.go | 54 - .../pkg/apis/core/validation/OWNERS | 1 - .../pkg/apis/core/validation/validation.go | 172 +- .../pkg/apis/core/zz_generated.deepcopy.go | 38 +- .../kubernetes/pkg/apis/extensions/OWNERS | 2 - .../kubernetes/pkg/apis/policy/helper.go | 51 + .../volume/persistentvolume/util/util.go | 2 +- .../kubernetes/pkg/credentialprovider/OWNERS | 1 - .../credentialprovider/aws/aws_credentials.go | 90 +- .../azure/azure_acr_helper.go | 8 +- .../pkg/credentialprovider/plugin/config.go | 4 +- .../pkg/credentialprovider/plugin/plugin.go | 4 +- .../kubernetes/pkg/features/kube_features.go | 70 +- .../kubelet/apis/podresources/server_v1.go | 22 + .../pkg/kubelet/apis/podresources/types.go | 9 +- .../cadvisor/cadvisor_cloudproviders.go | 28 + .../pkg/kubelet/cadvisor/cadvisor_linux.go | 10 +- .../pkg/kubelet/cm/cgroup_manager_linux.go | 31 +- .../pkg/kubelet/cm/container_manager.go | 49 +- .../pkg/kubelet/cm/container_manager_linux.go | 68 +- .../pkg/kubelet/cm/container_manager_stub.go | 20 +- .../kubelet/cm/container_manager_windows.go | 14 +- .../kubelet/cm/cpumanager/cpu_assignment.go | 6 +- .../pkg/kubelet/cm/cpumanager/cpu_manager.go | 47 +- .../kubelet/cm/cpumanager/fake_cpu_manager.go | 21 +- .../pkg/kubelet/cm/cpumanager/policy.go | 3 + .../pkg/kubelet/cm/cpumanager/policy_none.go | 14 +- .../kubelet/cm/cpumanager/policy_static.go | 45 +- .../cm/cpumanager/state/state_checkpoint.go | 16 +- .../kubelet/cm/cpumanager/state/state_mem.go | 12 +- .../cm/cpumanager/topology/topology.go | 3 +- .../pkg/kubelet/cm/cpuset/cpuset.go | 13 +- .../cm/devicemanager/device_plugin_stub.go | 19 +- .../pkg/kubelet/cm/devicemanager/endpoint.go | 8 +- .../pkg/kubelet/cm/devicemanager/manager.go | 99 +- .../kubelet/cm/devicemanager/manager_stub.go | 8 +- .../kubelet/cm/devicemanager/pod_devices.go | 92 +- .../cm/devicemanager/topology_hints.go | 17 +- .../pkg/kubelet/cm/devicemanager/types.go | 10 +- .../pkg/kubelet/cm/fake_container_manager.go | 13 + .../cm/memorymanager/fake_memory_manager.go | 16 +- .../cm/memorymanager/memory_manager.go | 20 +- .../kubelet/cm/memorymanager/policy_static.go | 38 +- .../memorymanager/state/state_checkpoint.go | 14 +- .../cm/memorymanager/state/state_mem.go | 10 +- .../cm/node_container_manager_linux.go | 10 +- .../kubelet/cm/pod_container_manager_linux.go | 31 +- .../kubelet/cm/qos_container_manager_linux.go | 16 +- .../topologymanager/fake_topology_manager.go | 13 +- .../pkg/kubelet/cm/topologymanager/policy.go | 6 +- .../pkg/kubelet/cm/topologymanager/scope.go | 2 +- .../cm/topologymanager/scope_container.go | 9 +- .../kubelet/cm/topologymanager/scope_pod.go | 9 +- .../cm/topologymanager/topology_manager.go | 4 +- .../pkg/kubelet/config/apiserver.go | 25 +- .../kubernetes/pkg/kubelet/config/common.go | 8 +- .../kubernetes/pkg/kubelet/config/config.go | 20 +- .../kubernetes/pkg/kubelet/config/file.go | 18 +- .../pkg/kubelet/config/file_linux.go | 4 +- .../pkg/kubelet/config/file_unsupported.go | 2 +- .../kubernetes/pkg/kubelet/config/flags.go | 2 - .../kubernetes/pkg/kubelet/config/http.go | 10 +- .../pkg/kubelet/container/container_gc.go | 2 +- .../pkg/kubelet/container/helpers.go | 7 +- .../pkg/kubelet/container/runtime.go | 2 +- .../pkg/kubelet/cri/remote/util/util_unix.go | 2 +- .../cri/streaming/portforward/httpstream.go | 28 +- .../cri/streaming/portforward/websocket.go | 4 +- .../cri/streaming/remotecommand/httpstream.go | 4 +- .../dockershim/cm/container_manager_linux.go | 7 +- .../kubelet/dockershim/docker_container.go | 1 + .../pkg/kubelet/dockershim/docker_sandbox.go | 2 +- .../kubernetes/pkg/kubelet/dockershim/exec.go | 4 +- .../pkg/kubelet/dockershim/helpers_linux.go | 1 + .../libdocker/kube_docker_client.go | 2 +- .../dockershim/network/cni/cni_windows.go | 6 +- .../pkg/kubelet/eviction/eviction_manager.go | 5 +- .../pkg/kubelet/images/image_gc_manager.go | 32 +- .../pkg/kubelet/images/image_manager.go | 2 +- .../k8s.io/kubernetes/pkg/kubelet/kubelet.go | 192 +- .../kubernetes/pkg/kubelet/kubelet_getters.go | 19 +- .../pkg/kubelet/kubelet_node_status.go | 58 +- .../kubernetes/pkg/kubelet/kubelet_pods.go | 85 +- .../pkg/kubelet/kubelet_resources.go | 2 +- .../kubernetes/pkg/kubelet/kubelet_volumes.go | 40 +- .../kubeletconfig/checkpoint/download.go | 16 +- .../kubeletconfig/checkpoint/store/fsstore.go | 6 +- .../pkg/kubelet/kubeletconfig/configsync.go | 21 +- .../pkg/kubelet/kubeletconfig/controller.go | 24 +- .../kubelet/kubeletconfig/status/status.go | 8 +- .../kubelet/kubeletconfig/util/codec/codec.go | 2 +- .../pkg/kubelet/kubeletconfig/util/log/log.go | 49 - .../pkg/kubelet/kubeletconfig/watch.go | 22 +- .../pkg/kubelet/kuberuntime/helpers.go | 2 +- .../kuberuntime/kuberuntime_container.go | 22 +- .../kuberuntime_container_linux.go | 4 +- .../kuberuntime_container_windows.go | 2 +- .../pkg/kubelet/kuberuntime/kuberuntime_gc.go | 24 +- .../kubelet/kuberuntime/kuberuntime_image.go | 12 +- .../kuberuntime/kuberuntime_manager.go | 39 +- .../kuberuntime/kuberuntime_sandbox.go | 26 +- .../pkg/kubelet/kuberuntime/labels.go | 25 +- .../pkg/kubelet/kuberuntime/logs/logs.go | 20 +- .../kuberuntime/security_context_windows.go | 8 +- .../pkg/kubelet/lifecycle/handlers.go | 10 +- .../pkg/kubelet/lifecycle/predicate.go | 22 +- .../pkg/kubelet/logs/container_log_manager.go | 14 +- .../kubernetes/pkg/kubelet/metrics/metrics.go | 54 +- .../kubernetes/pkg/kubelet/network/dns/dns.go | 12 +- .../nodeshutdown_manager_linux.go | 21 +- .../nodeshutdown/systemd/inhibit_linux.go | 18 +- .../pkg/kubelet/nodestatus/setters.go | 6 +- .../pkg/kubelet/oom/oom_watcher_linux.go | 4 +- .../kubernetes/pkg/kubelet/pleg/generic.go | 28 +- .../cache/actual_state_of_world.go | 2 +- .../cache/desired_state_of_world.go | 2 +- .../operationexecutor/operation_generator.go | 4 +- .../kubelet/pluginmanager/plugin_manager.go | 6 +- .../pluginwatcher/example_handler.go | 2 +- .../pluginwatcher/example_plugin.go | 14 +- .../pluginwatcher/plugin_watcher.go | 28 +- .../pluginmanager/reconciler/reconciler.go | 14 +- .../pkg/kubelet/pod/mirror_client.go | 2 +- .../pkg/kubelet/pod_container_deletor.go | 6 +- .../kubernetes/pkg/kubelet/pod_workers.go | 3 +- .../pkg/kubelet/preemption/preemption.go | 8 +- .../kubernetes/pkg/kubelet/prober/prober.go | 23 +- .../pkg/kubelet/prober/prober_manager.go | 15 +- .../kubernetes/pkg/kubelet/prober/worker.go | 28 +- .../kubernetes/pkg/kubelet/qos/policy.go | 4 +- .../k8s.io/kubernetes/pkg/kubelet/runonce.go | 30 +- .../server/stats/fs_resource_analyzer.go | 7 +- .../pkg/kubelet/server/stats/handler.go | 3 + .../kubelet/server/stats/resource_analyzer.go | 5 +- .../server/stats/volume_stat_calculator.go | 39 +- .../pkg/kubelet/stats/host_stats_provider.go | 17 +- .../kubernetes/pkg/kubelet/stats/provider.go | 2 +- .../pkg/kubelet/status/status_manager.go | 2 +- .../pkg/kubelet/types/pod_update.go | 5 + .../kubernetes/pkg/kubelet/volume_host.go | 6 +- .../cache/actual_state_of_world.go | 29 +- .../desired_state_of_world_populator.go | 89 +- .../volumemanager/reconciler/reconciler.go | 93 +- .../kubelet/volumemanager/volume_manager.go | 14 +- .../pkg/kubelet/winstats/network_stats.go | 16 +- .../kubelet/winstats/perfcounter_nodestats.go | 38 +- .../k8s.io/kubernetes/pkg/probe/http/http.go | 6 +- .../k8s.io/kubernetes/pkg/proxy/endpoints.go | 25 +- .../pkg/proxy/endpointslicecache.go | 15 +- .../kubernetes/pkg/proxy/iptables/proxier.go | 74 +- .../k8s.io/kubernetes/pkg/proxy/ipvs/OWNERS | 2 + .../kubernetes/pkg/proxy/ipvs/README.md | 2 +- .../kubernetes/pkg/proxy/ipvs/proxier.go | 86 +- .../pkg/proxy/metaproxier/meta_proxier.go | 28 + .../k8s.io/kubernetes/pkg/proxy/service.go | 7 + .../k8s.io/kubernetes/pkg/proxy/topology.go | 83 +- .../k8s.io/kubernetes/pkg/proxy/types.go | 6 + .../k8s.io/kubernetes/pkg/proxy/util/utils.go | 14 +- .../kubernetes/pkg/proxy/winkernel/proxier.go | 10 +- .../scheduler/apis/config/types_pluginargs.go | 2 +- .../scheduler/apis/config/v1beta1/defaults.go | 3 +- .../apis/config/validation/validation.go | 142 +- .../validation/validation_pluginargs.go | 61 +- .../pkg/scheduler/framework/interface.go | 8 + .../defaultpreemption/default_preemption.go | 21 +- .../framework/plugins/helper/node_affinity.go | 70 - .../plugins/interpodaffinity/filtering.go | 13 +- .../plugins/interpodaffinity/plugin.go | 22 +- .../plugins/interpodaffinity/scoring.go | 7 +- .../framework/plugins/legacy_registry.go | 34 +- .../plugins/nodeaffinity/node_affinity.go | 50 +- .../framework/plugins/nodelabel/node_label.go | 29 +- .../framework/plugins/nodename/node_name.go | 9 + .../framework/plugins/nodeports/node_ports.go | 11 + .../node_prefer_avoid_pods.go | 3 - .../framework/plugins/noderesources/fit.go | 48 +- .../plugins/noderesources/least_allocated.go | 3 +- .../plugins/noderesources/most_allocated.go | 3 +- .../requested_to_capacity_ratio.go | 3 +- .../nodeunschedulable/node_unschedulable.go | 9 + .../framework/plugins/nodevolumelimits/csi.go | 28 +- .../plugins/nodevolumelimits/non_csi.go | 18 +- .../plugins/podtopologyspread/filtering.go | 10 +- .../plugins/podtopologyspread/plugin.go | 24 +- .../plugins/podtopologyspread/scoring.go | 11 +- .../plugins/selectorspread/selector_spread.go | 3 +- .../serviceaffinity/service_affinity.go | 25 +- .../tainttoleration/taint_toleration.go | 11 +- .../plugins/volumebinding/volume_binding.go | 2 +- .../volumerestrictions/volume_restrictions.go | 14 + .../plugins/volumezone/volume_zone.go | 32 +- .../scheduler/framework/runtime/framework.go | 47 +- .../pkg/scheduler/framework/types.go | 69 +- .../internal/parallelize/parallelism.go | 24 +- .../pkg/security/apparmor/validate.go | 18 +- .../kubernetes/pkg/volume/awsebs/aws_util.go | 8 +- .../pkg/volume/azure_file/azure_file.go | 5 +- .../pkg/volume/azure_file/azure_provision.go | 5 +- .../kubernetes/pkg/volume/csi/csi_block.go | 19 +- .../kubernetes/pkg/volume/csi/csi_client.go | 39 + .../kubernetes/pkg/volume/csi/csi_mounter.go | 52 +- .../kubernetes/pkg/volume/csi/csi_plugin.go | 36 + .../kubernetes/pkg/volume/csi/csi_util.go | 15 + .../csi/nodeinfomanager/nodeinfomanager.go | 2 +- .../pkg/volume/csimigration/plugin_manager.go | 37 +- .../pkg/volume/emptydir/empty_dir.go | 2 +- .../pkg/volume/flexvolume/mounter-defaults.go | 2 +- .../pkg/volume/flexvolume/plugin-defaults.go | 2 +- .../pkg/volume/flexvolume/plugin.go | 2 +- .../pkg/volume/glusterfs/glusterfs.go | 1 - .../kubernetes/pkg/volume/iscsi/iscsi_util.go | 2 +- .../k8s.io/kubernetes/pkg/volume/nfs/nfs.go | 4 +- .../pkg/volume/portworx/portworx_util.go | 6 +- .../pkg/volume/scaleio/sio_client.go | 2 +- .../pkg/volume/util/fs/fs_windows.go | 6 + .../operationexecutor/operation_generator.go | 10 +- .../kubernetes/pkg/volume/util/resize_util.go | 68 +- .../volumepathhandler/volume_path_handler.go | 6 +- .../k8s.io/kubernetes/pkg/volume/volume.go | 15 + .../kubernetes/pkg/volume/volume_linux.go | 16 +- .../vsphere_volume/vsphere_volume_util.go | 20 +- .../k8s.io/legacy-cloud-providers/aws/aws.go | 22 +- .../legacy-cloud-providers/azure/azure.go | 25 + .../azure/azure_backoff.go | 6 + .../azure/azure_loadbalancer.go | 90 +- .../azure/azure_vmss.go | 3 +- .../azure/azure_vmss_cache.go | 34 +- .../gce/gcpcredential/gcpcredential.go | 2 +- .../vsphere/shared_datastore.go | 209 + .../vsphere/vclib/custom_errors.go | 22 +- .../vsphere/vclib/diskmanagers/virtualdisk.go | 6 +- .../vsphere/vclib/virtualmachine.go | 18 + .../vsphere/vclib/volumeoptions.go | 9 +- .../legacy-cloud-providers/vsphere/vsphere.go | 39 +- .../vendor/k8s.io/mount-utils/go.mod | 3 +- .../vendor/k8s.io/mount-utils/go.sum | 7 +- .../k8s.io/mount-utils/mount_helper_common.go | 4 + .../k8s.io/mount-utils/mount_helper_unix.go | 2 +- .../mount-utils/mount_helper_windows.go | 3 +- .../k8s.io/mount-utils/resizefs_linux.go | 116 + cluster-autoscaler/vendor/modules.txt | 161 +- .../structured-merge-diff/v4/fieldpath/set.go | 48 + .../v4/typed/reconcile_schema.go | 43 +- .../structured-merge-diff/v4/typed/remove.go | 87 +- .../structured-merge-diff/v4/typed/typed.go | 8 +- 1249 files changed, 70286 insertions(+), 35685 deletions(-) create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/LICENSE.txt create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/CHANGELOG.md create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/enums.go create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/CHANGELOG.md create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/enums.go create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/CHANGELOG.md create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/enums.go create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/CHANGELOG.md create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/enums.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/accounts.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/blobcontainers.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/blobservices.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/client.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/managementpolicies.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/models.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/operations.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/skus.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/usages.go delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/version.go create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/CHANGELOG.md create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/enums.go create mode 100644 cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go create mode 100644 cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/.clang-format create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/console/.golangci.yml delete mode 100644 cluster-autoscaler/vendor/github.com/containerd/console/.travis.yml create mode 100644 cluster-autoscaler/vendor/github.com/containerd/console/tc_netbsd.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/containerd/log/context.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/compare.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/cpuinfo.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/database.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults_unix.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults_windows.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/platforms.go create mode 100644 cluster-autoscaler/vendor/github.com/docker/docker/api/types/error_response_ext.go delete mode 100644 cluster-autoscaler/vendor/github.com/docker/docker/api/types/seccomp.go delete mode 100644 cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/proxy.go delete mode 100644 cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/tc.go delete mode 100644 cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/termios_bsd.go delete mode 100644 cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/windows.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/.editorconfig delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/.golangci.yml delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/.travis.yml delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/README.md delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/bindata.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/cache.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/debug.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/expander.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/go.mod delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/go.sum delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/header.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/normalizer.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/operation.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/parameter.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/schema_loader.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/spec.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/unused.go delete mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/spec/xml_object.go create mode 100644 cluster-autoscaler/vendor/github.com/gofrs/uuid/.gitignore create mode 100644 cluster-autoscaler/vendor/github.com/gofrs/uuid/.travis.yml create mode 100644 cluster-autoscaler/vendor/github.com/gofrs/uuid/LICENSE create mode 100644 cluster-autoscaler/vendor/github.com/gofrs/uuid/README.md create mode 100644 cluster-autoscaler/vendor/github.com/gofrs/uuid/codec.go create mode 100644 cluster-autoscaler/vendor/github.com/gofrs/uuid/fuzz.go create mode 100644 cluster-autoscaler/vendor/github.com/gofrs/uuid/generator.go create mode 100644 cluster-autoscaler/vendor/github.com/gofrs/uuid/sql.go create mode 100644 cluster-autoscaler/vendor/github.com/gofrs/uuid/uuid.go create mode 100644 cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs_notx86.go create mode 100644 cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs_x86.go delete mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/extension-handler.go create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/extensions.go create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/README.md create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/base.go create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/display.go create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/models.go create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/operations.go create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/reader.go create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/schema.json create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/writer.go create mode 100644 cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/document.go delete mode 100644 cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE delete mode 100644 cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md delete mode 100644 cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod delete mode 100644 cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go delete mode 100644 cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go create mode 100644 cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/doc.go create mode 100644 cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/go.sum create mode 100644 cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mounted_linux.go create mode 100644 cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mounted_unix.go rename cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/{mountinfo_freebsd.go => mountinfo_bsd.go} (73%) create mode 100644 cluster-autoscaler/vendor/github.com/moby/term/.gitignore rename cluster-autoscaler/vendor/github.com/{Azure/azure-sdk-for-go => moby/term}/LICENSE (93%) create mode 100644 cluster-autoscaler/vendor/github.com/moby/term/README.md rename cluster-autoscaler/vendor/github.com/{docker/docker/pkg => moby}/term/ascii.go (94%) create mode 100644 cluster-autoscaler/vendor/github.com/moby/term/go.mod create mode 100644 cluster-autoscaler/vendor/github.com/moby/term/go.sum create mode 100644 cluster-autoscaler/vendor/github.com/moby/term/proxy.go create mode 100644 cluster-autoscaler/vendor/github.com/moby/term/tc.go rename cluster-autoscaler/vendor/github.com/{docker/docker/pkg => moby}/term/term.go (89%) rename cluster-autoscaler/vendor/github.com/{docker/docker/pkg => moby}/term/term_windows.go (67%) rename cluster-autoscaler/vendor/github.com/{docker/docker/pkg/term/termios_linux.go => moby/term/termios.go} (61%) create mode 100644 cluster-autoscaler/vendor/github.com/moby/term/termios_bsd.go create mode 100644 cluster-autoscaler/vendor/github.com/moby/term/termios_nonbsd.go rename cluster-autoscaler/vendor/github.com/{docker/docker/pkg => moby}/term/windows/ansi_reader.go (87%) rename cluster-autoscaler/vendor/github.com/{docker/docker/pkg => moby}/term/windows/ansi_writer.go (79%) rename cluster-autoscaler/vendor/github.com/{docker/docker/pkg => moby}/term/windows/console.go (64%) create mode 100644 cluster-autoscaler/vendor/github.com/moby/term/windows/doc.go rename cluster-autoscaler/vendor/github.com/{docker/docker/pkg => moby}/term/winsize.go (91%) create mode 100644 cluster-autoscaler/vendor/github.com/mrunalp/fileutils/go.mod rename cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/{apparmor.go => apparmor_linux.go} (67%) rename cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/{apparmor_disabled.go => apparmor_unsupported.go} (91%) create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities_unsupported.go delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities_linux.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/open.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/cpuset.go delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device_windows.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/devices.go rename cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/{configs => devices}/device.go (63%) rename cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/{configs => devices}/device_unix.go (79%) create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_windows.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/devices.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_unsupported.go rename cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/{label_selinux.go => label_linux.go} (98%) delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/xattrs.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go create mode 100644 cluster-autoscaler/vendor/github.com/sirupsen/logrus/buffer_pool.go delete mode 100644 cluster-autoscaler/vendor/github.com/willf/bitset/Makefile create mode 100644 cluster-autoscaler/vendor/github.com/willf/bitset/go.mod create mode 100644 cluster-autoscaler/vendor/github.com/willf/bitset/go.sum create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/CHANGELOG.md delete mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/glide.lock delete mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/glide.yaml create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/go.mod create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/go.sum delete mode 100644 cluster-autoscaler/vendor/go.uber.org/multierr/glide.lock create mode 100644 cluster-autoscaler/vendor/go.uber.org/multierr/go.mod create mode 100644 cluster-autoscaler/vendor/go.uber.org/multierr/go.sum create mode 100644 cluster-autoscaler/vendor/go.uber.org/multierr/go113.go rename cluster-autoscaler/vendor/go.uber.org/zap/{check_license.sh => checklicense.sh} (100%) delete mode 100644 cluster-autoscaler/vendor/go.uber.org/zap/glide.lock create mode 100644 cluster-autoscaler/vendor/go.uber.org/zap/go.mod create mode 100644 cluster-autoscaler/vendor/go.uber.org/zap/go.sum create mode 100644 cluster-autoscaler/vendor/go.uber.org/zap/zapcore/increase_level.go create mode 100644 cluster-autoscaler/vendor/k8s.io/api/policy/v1/doc.go create mode 100644 cluster-autoscaler/vendor/k8s.io/api/policy/v1/generated.pb.go create mode 100644 cluster-autoscaler/vendor/k8s.io/api/policy/v1/generated.proto create mode 100644 cluster-autoscaler/vendor/k8s.io/api/policy/v1/register.go create mode 100644 cluster-autoscaler/vendor/k8s.io/api/policy/v1/types.go create mode 100644 cluster-autoscaler/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go create mode 100644 cluster-autoscaler/vendor/k8s.io/api/policy/v1/zz_generated.deepcopy.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/managedfields/extract.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/OWNERS create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/with_auditid.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/scalehandler.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/request/auditid.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/interfaces.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/scale.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scale.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scalespec.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scalestatus.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointhints.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/forzone.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointhints.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/forzone.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/scale.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/eviction.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudget.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetspec.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetstatus.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/v1/interface.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/doc.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/eviction.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/eviction_expansion.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/doc.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_policy_client.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/generated_expansion.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/poddisruptionbudget.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/policy_client.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/eviction.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/expansion_generated.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/poddisruptionbudget.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/poddisruptionbudget_expansion.go rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/.gitignore (100%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/LICENSE (100%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/contact_info.go (100%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/external_docs.go (100%) create mode 100644 cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/header.go rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/info.go (93%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/items.go (53%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/license.go (100%) create mode 100644 cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/operation.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/path_item.go (86%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/paths.go (88%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/ref.go (87%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/response.go (60%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/responses.go (88%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/schema.go (88%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/security_scheme.go (50%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/swagger.go (67%) rename cluster-autoscaler/vendor/{github.com/go-openapi => k8s.io/kube-openapi/pkg/validation}/spec/tag.go (77%) create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_others.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_windows.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/helper.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_cloudproviders.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log/log.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper/node_affinity.go create mode 100644 cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/shared_datastore.go diff --git a/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go b/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go index 2865db873925..6a39b168f1f2 100644 --- a/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go +++ b/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go @@ -230,10 +230,7 @@ func (n *hetznerNodeGroup) TemplateNodeInfo() (*schedulerframework.NodeInfo, err node.Status.Conditions = cloudprovider.BuildReadyConditions() nodeInfo := schedulerframework.NewNodeInfo(cloudprovider.BuildKubeProxy(n.id)) - err = nodeInfo.SetNode(&node) - if err != nil { - return nil, fmt.Errorf("could not create node info for node group %s error: %v", n.id, err) - } + nodeInfo.SetNode(&node) return nodeInfo, nil } diff --git a/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group.go b/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group.go index ea80ac9bde89..189f36f93d78 100644 --- a/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group.go +++ b/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group.go @@ -247,10 +247,7 @@ func (ng *NodeGroup) TemplateNodeInfo() (*schedulerframework.NodeInfo, error) { // Setup node info template nodeInfo := schedulerframework.NewNodeInfo(cloudprovider.BuildKubeProxy(ng.Id())) - err := nodeInfo.SetNode(node) - if err != nil { - return nil, fmt.Errorf("failed to set up node info: %w", err) - } + nodeInfo.SetNode(node) return nodeInfo, nil } diff --git a/cluster-autoscaler/core/scale_down_test.go b/cluster-autoscaler/core/scale_down_test.go index 3dd73219bce8..918e467a5b21 100644 --- a/cluster-autoscaler/core/scale_down_test.go +++ b/cluster-autoscaler/core/scale_down_test.go @@ -1797,8 +1797,7 @@ func TestFilterOutMasters(t *testing.T) { node := BuildTestNode(n.name, n.cpu, n.memory) SetNodeReadyState(node, n.ready, time.Now()) nodeInfo := schedulerframework.NewNodeInfo() - err := nodeInfo.SetNode(node) - assert.NoError(t, err) + nodeInfo.SetNode(node) nodes[i] = nodeInfo nodeMap[n.name] = nodeInfo } diff --git a/cluster-autoscaler/core/utils/utils.go b/cluster-autoscaler/core/utils/utils.go index c60b050c2c4d..fce14d38a0a6 100644 --- a/cluster-autoscaler/core/utils/utils.go +++ b/cluster-autoscaler/core/utils/utils.go @@ -222,9 +222,7 @@ func deepCopyNodeInfo(nodeInfo *schedulerframework.NodeInfo) (*schedulerframewor // Build a new node info. newNodeInfo := schedulerframework.NewNodeInfo(newPods...) - if err := newNodeInfo.SetNode(nodeInfo.Node().DeepCopy()); err != nil { - return nil, errors.ToAutoscalerError(errors.InternalError, err) - } + newNodeInfo.SetNode(nodeInfo.Node().DeepCopy()) return newNodeInfo, nil } @@ -245,9 +243,7 @@ func sanitizeNodeInfo(nodeInfo *schedulerframework.NodeInfo, nodeGroupName strin // Build a new node info. sanitizedNodeInfo := schedulerframework.NewNodeInfo(sanitizedPods...) - if err := sanitizedNodeInfo.SetNode(sanitizedNode); err != nil { - return nil, errors.ToAutoscalerError(errors.InternalError, err) - } + sanitizedNodeInfo.SetNode(sanitizedNode) return sanitizedNodeInfo, nil } diff --git a/cluster-autoscaler/core/utils/utils_test.go b/cluster-autoscaler/core/utils/utils_test.go index f15234397dda..dfb7eb49f963 100644 --- a/cluster-autoscaler/core/utils/utils_test.go +++ b/cluster-autoscaler/core/utils/utils_test.go @@ -197,8 +197,7 @@ func TestGetNodeInfosForGroupsCache(t *testing.T) { // Fill cache manually infoNg4Node6 := schedulerframework.NewNodeInfo() - err2 := infoNg4Node6.SetNode(ready6.DeepCopy()) - assert.NoError(t, err2) + infoNg4Node6.SetNode(ready6.DeepCopy()) nodeInfoCache = map[string]*schedulerframework.NodeInfo{"ng4": infoNg4Node6} // Check if cache was used res, err = GetNodeInfosForGroups([]*apiv1.Node{ready1, ready2}, nodeInfoCache, diff --git a/cluster-autoscaler/go.mod b/cluster-autoscaler/go.mod index faf0a27222b1..e11b2c2b7376 100644 --- a/cluster-autoscaler/go.mod +++ b/cluster-autoscaler/go.mod @@ -4,9 +4,9 @@ go 1.16 require ( cloud.google.com/go v0.54.0 - github.com/Azure/azure-sdk-for-go v43.0.0+incompatible - github.com/Azure/go-autorest/autorest v0.11.12 - github.com/Azure/go-autorest/autorest/adal v0.9.5 + github.com/Azure/azure-sdk-for-go v53.1.0+incompatible + github.com/Azure/go-autorest/autorest v0.11.17 + github.com/Azure/go-autorest/autorest/adal v0.9.10 github.com/Azure/go-autorest/autorest/date v0.3.0 github.com/Azure/go-autorest/autorest/to v0.2.0 github.com/aws/aws-sdk-go v1.35.24 @@ -25,16 +25,16 @@ require ( google.golang.org/api v0.20.0 gopkg.in/gcfg.v1 v1.2.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.21.0-beta.1 - k8s.io/apimachinery v0.21.0-beta.1 - k8s.io/apiserver v0.21.0-beta.1 - k8s.io/client-go v0.21.0-beta.1 - k8s.io/cloud-provider v0.21.0-beta.1 - k8s.io/component-base v0.21.0-beta.1 - k8s.io/component-helpers v0.21.0-beta.1 - k8s.io/klog/v2 v2.5.0 + k8s.io/api v0.22.0-alpha.1 + k8s.io/apimachinery v0.22.0-alpha.1 + k8s.io/apiserver v0.22.0-alpha.1 + k8s.io/client-go v0.22.0-alpha.1 + k8s.io/cloud-provider v0.22.0-alpha.1 + k8s.io/component-base v0.22.0-alpha.1 + k8s.io/component-helpers v0.22.0-alpha.1 + k8s.io/klog/v2 v2.8.0 k8s.io/kubelet v0.0.0 - k8s.io/kubernetes v1.21.0-beta.1 + k8s.io/kubernetes v1.22.0-alpha.1 k8s.io/legacy-cloud-providers v0.0.0 k8s.io/utils v0.0.0-20201110183641-67b214c5f920 ) @@ -43,54 +43,54 @@ replace github.com/digitalocean/godo => github.com/digitalocean/godo v1.27.0 replace github.com/rancher/go-rancher => github.com/rancher/go-rancher v0.1.0 -replace k8s.io/api => k8s.io/api v0.21.0-beta.1 +replace k8s.io/api => k8s.io/api v0.22.0-alpha.1 -replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.21.0-beta.1 +replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0-alpha.1 -replace k8s.io/apimachinery => k8s.io/apimachinery v0.21.0-beta.1 +replace k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.1 -replace k8s.io/apiserver => k8s.io/apiserver v0.21.0-beta.1 +replace k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.1 -replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.21.0-beta.1 +replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.0-alpha.1 -replace k8s.io/client-go => k8s.io/client-go v0.21.0-beta.1 +replace k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.1 -replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.21.0-beta.1 +replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0-alpha.1 -replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.21.0-beta.1 +replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.0-alpha.1 -replace k8s.io/code-generator => k8s.io/code-generator v0.21.0-beta.1 +replace k8s.io/code-generator => k8s.io/code-generator v0.22.0-alpha.1 -replace k8s.io/component-base => k8s.io/component-base v0.21.0-beta.1 +replace k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.1 -replace k8s.io/component-helpers => k8s.io/component-helpers v0.21.0-beta.1 +replace k8s.io/component-helpers => k8s.io/component-helpers v0.22.0-alpha.1 -replace k8s.io/controller-manager => k8s.io/controller-manager v0.21.0-beta.1 +replace k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.1 -replace k8s.io/cri-api => k8s.io/cri-api v0.21.0-beta.1 +replace k8s.io/cri-api => k8s.io/cri-api v0.22.0-alpha.1 -replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.21.0-beta.1 +replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.22.0-alpha.1 -replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.21.0-beta.1 +replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.22.0-alpha.1 -replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.21.0-beta.1 +replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.22.0-alpha.1 -replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.21.0-beta.1 +replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.22.0-alpha.1 -replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.21.0-beta.1 +replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.22.0-alpha.1 -replace k8s.io/kubectl => k8s.io/kubectl v0.21.0-beta.1 +replace k8s.io/kubectl => k8s.io/kubectl v0.22.0-alpha.1 -replace k8s.io/kubelet => k8s.io/kubelet v0.21.0-beta.1 +replace k8s.io/kubelet => k8s.io/kubelet v0.22.0-alpha.1 -replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.21.0-beta.1 +replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.22.0-alpha.1 -replace k8s.io/metrics => k8s.io/metrics v0.21.0-beta.1 +replace k8s.io/metrics => k8s.io/metrics v0.22.0-alpha.1 -replace k8s.io/mount-utils => k8s.io/mount-utils v0.21.0-beta.1 +replace k8s.io/mount-utils => k8s.io/mount-utils v0.22.0-alpha.1 -replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.21.0-beta.1 +replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.0-alpha.1 -replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.21.0-beta.1 +replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.22.0-alpha.1 -replace k8s.io/sample-controller => k8s.io/sample-controller v0.21.0-beta.1 +replace k8s.io/sample-controller => k8s.io/sample-controller v0.22.0-alpha.1 diff --git a/cluster-autoscaler/go.sum b/cluster-autoscaler/go.sum index f6ad857606de..51e457b6d610 100644 --- a/cluster-autoscaler/go.sum +++ b/cluster-autoscaler/go.sum @@ -26,16 +26,17 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v43.0.0+incompatible h1:/wSNCu0e6EsHFR4Qa3vBEBbicaprEHMyyga9g8RTULI= -github.com/Azure/azure-sdk-for-go v43.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v53.1.0+incompatible h1:f2h0KLVGa3zIaMDMHBe5Lazc0FT5+L78z0B8K9PmDyg= +github.com/Azure/azure-sdk-for-go v53.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.12 h1:gI8ytXbxMfI+IVbI9mP2JGCTXIuhHLgRlvQ9X4PsnHE= -github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= -github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0= +github.com/Azure/go-autorest/autorest v0.11.17 h1:2zCdHwNgRH+St1J+ZMf66xI8aLr/5KMy+wWLH97zwYM= +github.com/Azure/go-autorest/autorest v0.11.17/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.10 h1:r6fZHMaHD8B6LDCn0o5vyBFHIHrM6Ywwx7mb49lPItI= +github.com/Azure/go-autorest/autorest/adal v0.9.10/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= @@ -116,8 +117,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775 h1:cHzBGGVew0ezFsq2grfy2RsB8hO/eNyBgOLHBCqfR1U= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= +github.com/cilium/ebpf v0.2.0 h1:Fv93L3KKckEcEHR3oApXVzyBTDA8WAm6VXhPE00N3f8= +github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313 h1:eIHD9GNM3Hp7kcRW5mvcz7WTR3ETeoYYKwpgA04kaXE= github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= @@ -128,11 +129,11 @@ github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93C github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 h1:qWj4qVYZ95vLWwqyNJCQg7rDsG5wPdze0UaPolH7DUk= github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v1.0.0 h1:fU3UuQapBs+zLJu82NhR11Rif1ny2zfMMAyPJzSN5tQ= -github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= +github.com/containerd/console v1.0.1 h1:u7SFAJyRqWcG6ogaMAx3KjSTy1e3hT9QxqX7Jco7dRc= +github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1 h1:pASeJT3R3YyVn+94qEPk0SnU1OQ20Jd/T+SPKy9xehY= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.4 h1:rtRG4N6Ct7GNssATwgpvMGfnjnwfjnu/Zs9W3Ikzq+M= +github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= @@ -165,6 +166,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2 h1:jCwT2GTP+PY5nBz3c/YL5PAIbusElVrPujOBSCj8xRg= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -181,8 +184,8 @@ github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyG github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible h1:SiUATuP//KecDjpOK2tvZJgeScYAklvyjfK8JZlU6fo= -github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.2+incompatible h1:vFgEHPqWBTp4pTjdLwjAA4bSo3gvIGOYwuJTlEjVBCw= +github.com/docker/docker v20.10.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -263,7 +266,6 @@ github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsd github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.5 h1:Xm0Ao53uqnk9QE/LlYV5DEU09UAgpliA85QoT9LzqPw= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= @@ -284,6 +286,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -324,8 +328,8 @@ github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA// github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/cadvisor v0.38.8 h1:3RQEwcEqPEcJ840AOCvDEjYvgpcbyXfEZd+UHlg1ETg= -github.com/google/cadvisor v0.38.8/go.mod h1:1OFB9sOOMkBdUBGCO/1SArawTnDscgMzTodacVDe8mA= +github.com/google/cadvisor v0.39.0 h1:jai6dmBP9QAYluNGqU18yVUTw6uuyAW0AqtZIjvl8Qg= +github.com/google/cadvisor v0.39.0/go.mod h1:rjQFmK4jPCpxeUdLq9bYhNFFsjgGOtpnDmDeap0+nsw= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -353,8 +357,8 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= +github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -432,8 +436,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -495,9 +497,10 @@ github.com/moby/ipvs v1.0.1 h1:aoZ7fhLTXgDbzVrAnvV+XbKOU8kOET7B3+xULDF/1o0= github.com/moby/ipvs v1.0.1/go.mod h1:2pngiyseZbIKXNv7hsKj3O9UEz30c53MT9005gt2hxQ= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.1.3 h1:KIrhRO14+AkwKvG/g2yIpNMOUVZ02xNhOw8KY1WsLOI= -github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= +github.com/moby/sys/mountinfo v0.4.0 h1:1KInV3Huv18akCu58V7lzNlt+jFmqlu1EaErnEHE/VM= +github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -509,8 +512,8 @@ github.com/mohae/deepcopy v0.0.0-20170603005431-491d3605edfb/go.mod h1:TaXosZuwd github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976 h1:aZQToFSLH8ejFeSkTc3r3L4dPImcj7Ib/KgmkQqbGGg= -github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0= +github.com/mrunalp/fileutils v0.5.0 h1:NKzVxiH7eSk+OQ4M+ZYW1K6h27RUV3MI6NUTsHhU6Z4= +github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -540,13 +543,13 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc92 h1:+IczUKCRzDzFDnw99O/PAqrcBBCoRp9xN3cB1SYSNS4= -github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE= +github.com/opencontainers/runc v1.0.0-rc93 h1:x2UMpOOVf3kQ8arv/EsDGwim8PTNqzL1/EYDr/+scOM= +github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6 h1:NhsM2gc769rVWDqJvapK37r+7+CBXI8xHhnfnt8uQsg= -github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/selinux v1.6.0 h1:+bIAS/Za3q5FTwWym4fTB0vObnfCf3G/NC7K6Jx62mY= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= +github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d h1:pNa8metDkwZjb9g4T8s+krQ+HRgZAkqnXml+wNir/+s= +github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.8.0 h1:+77ba4ar4jsCbL1GLbFL8fFM57w6suPfSS9PDLDY7KM= +github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -606,8 +609,8 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= @@ -630,6 +633,7 @@ 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/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/storageos/go-api v2.2.0+incompatible h1:U0SablXoZIg06gvSlg8BCdzq1C/SkHVygOVX95Z2MU0= github.com/storageos/go-api v2.2.0+incompatible/go.mod h1:ZrLn+e0ZuF3Y65PNF6dIwbJPZqfmtCXxFm9ckv0agOY= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -639,11 +643,12 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 h1:b6uOv7YOFK0TYG7HtkIgExQo+2RdLuwRft63jn2HWj8= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/thecodeteam/goscaleio v0.1.0 h1:SB5tO98lawC+UK8ds/U2jyfOCH7GTcFztcF5x9gbut4= github.com/thecodeteam/goscaleio v0.1.0/go.mod h1:68sdkZAsK8bvEwBlbQnlLS+xU+hvLYM/iQ8KXej1AwM= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -664,8 +669,8 @@ github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae h1:4hwBBUfQCFe3C github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vmware/govmomi v0.20.3 h1:gpw/0Ku+6RgF3jsi7fnCLmlcikBHfKBCUcu1qgc16OU= github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243 h1:R43TdZy32XXSXjJn7M/HhALJ9imq6ztLnChfYJpVDnM= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= +github.com/willf/bitset v1.1.11 h1:N7Z7E9UvjW+sGsEl7k/SJrvY2reP1A07MrGuCjIOjRE= +github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= @@ -688,12 +693,17 @@ go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= +go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -738,6 +748,7 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -749,6 +760,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ= golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -785,6 +797,7 @@ golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -833,7 +846,6 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -849,9 +861,10 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= @@ -898,6 +911,8 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -919,6 +934,7 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1026,68 +1042,71 @@ gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/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 h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.21.0-beta.1 h1:nIQCL8N0a0AncD6Xs/QPiDbw466AGsPs1K9CG0ZMcTY= -k8s.io/api v0.21.0-beta.1/go.mod h1:8A+GKfJYDnFlmsIqnwi7z2l5+GwI3fbIdAkPu3xiZKA= -k8s.io/apiextensions-apiserver v0.21.0-beta.1/go.mod h1:vluMqsJ5+hPgM9UtBhkFSGrfD86KUac9yeKVqpGBZz0= -k8s.io/apimachinery v0.21.0-beta.1 h1:PFLBa8viYJOvtkOEiyrzzcZSzBHEuu4wwIxzED0utCw= -k8s.io/apimachinery v0.21.0-beta.1/go.mod h1:ZaN7d/yx5I8h2mk8Nu08sdLigsmkt4flkTxCTc9LElI= -k8s.io/apiserver v0.21.0-beta.1 h1:MhdZptxbJ2Nl2CVZRrySi4jiJ8zgCV+j4Qmfo/95yHw= -k8s.io/apiserver v0.21.0-beta.1/go.mod h1:nl/H4DPS1abtRhCj8bhosbyU9XOgnMt0QFK3fAFEhSE= -k8s.io/cli-runtime v0.21.0-beta.1/go.mod h1:JUzUd7rH9KGkeZPz0AF978vEuJdW4tiug1JygiLhEzw= -k8s.io/client-go v0.21.0-beta.1 h1:gIO2RPWzchI9DnHn1hz0pObztWh7RDVcIUCSKzbxb/g= -k8s.io/client-go v0.21.0-beta.1/go.mod h1:SsWZEBajlozcXLnUS7OD47n9MtuzduVt02GMQO2/DIA= -k8s.io/cloud-provider v0.21.0-beta.1 h1:+nE8Epp53DLmMvZzUT5vFyXlLHEQunNc371p+IfrPLI= -k8s.io/cloud-provider v0.21.0-beta.1/go.mod h1:3RpBjUc8TGLkVKQRRepmEsxjvs1jMtMctK5KkiIcCyU= -k8s.io/cluster-bootstrap v0.21.0-beta.1/go.mod h1:q6cVhPidp1sXjZBSMECnoO6XcaEubQejrTmA27j8RQ0= -k8s.io/code-generator v0.21.0-beta.1/go.mod h1:IpCUojpiKp25KNB3/UbEeElznqpQUMvhAOUoC7AbISY= -k8s.io/component-base v0.21.0-beta.1 h1:1p2rRyBgoXuCD0rZrG07jXCfkvSnHo0aGCoNCbyhQhY= -k8s.io/component-base v0.21.0-beta.1/go.mod h1:WPMZyV0sNk3ruzA8cWt1EO2KWAnLDK2docEC14JWbTM= -k8s.io/component-helpers v0.21.0-beta.1 h1:cFeSCqL14ck24yMVpUTH9dw3N88n0wyCVOfiihEUn7w= -k8s.io/component-helpers v0.21.0-beta.1/go.mod h1:gpNCeSdQi45xUrrxgubi5XJ9tXCrjMNXmNvDh9bjAM4= -k8s.io/controller-manager v0.21.0-beta.1/go.mod h1:n1shQUgOvkQZiXMsQ9b1VziquCUPn4RNuWLw9zAgZeY= -k8s.io/cri-api v0.21.0-beta.1 h1:51ncBvr3YpC4t5TSiXG2/IkrW/gQrgwZuNjacPCYmyw= -k8s.io/cri-api v0.21.0-beta.1/go.mod h1:nJbXlTpXwYCYuGMR7v3PQb1Du4WOGj2I9085xMVjr3I= -k8s.io/csi-translation-lib v0.21.0-beta.1 h1:TfDRtH4e9+EClD5df5zSbVdhPQuIsOqxPzny/t5cjSM= -k8s.io/csi-translation-lib v0.21.0-beta.1/go.mod h1:vFj9+thkvoS22GN9GMVE8T+iorHVejAU8r5KS3UBLEw= +k8s.io/api v0.22.0-alpha.1 h1:LuUYyELM7hm5I7B8pjn8dhZHQTcw86C/bFBNNu0/QoY= +k8s.io/api v0.22.0-alpha.1/go.mod h1:vQHAkhGeeRA6zI8QNe3tcuQqGXanfyk6mehgpyIHcpY= +k8s.io/apiextensions-apiserver v0.22.0-alpha.1/go.mod h1:CTqXHlfdBhzVb5XlYKBX99W8uPDk6kIj+4fwOofXq5o= +k8s.io/apimachinery v0.22.0-alpha.1 h1:5H8J1su7o60La1W4iOytFrsn2DeRxd9NXVxulXWOdOE= +k8s.io/apimachinery v0.22.0-alpha.1/go.mod h1:fBRSkoylGO2QUTae8Wb2wac6pZ83/r+tL6HFSXGbzfs= +k8s.io/apiserver v0.22.0-alpha.1 h1:1KEDWuHHLCbH+Q/qR8gZRCJdbmoEcRanjsvTvG/AAR0= +k8s.io/apiserver v0.22.0-alpha.1/go.mod h1:EBtDCYoV1+DxaNcB9OD61zUUyWlUaJ5a9CHwQKTD5Qg= +k8s.io/cli-runtime v0.22.0-alpha.1/go.mod h1:hAbdWeaJyja4PsFqgGoQT/JGmYFKd09bCU6h6F7ZpI8= +k8s.io/client-go v0.22.0-alpha.1 h1:RHT0MJXzZLwNhL8lluEko7zQ4n0fRn2TtmiZPiQI/fY= +k8s.io/client-go v0.22.0-alpha.1/go.mod h1:9onZcKpTRbDD0wiJC/T1toeVMYPyCQPgWHDn4xpQsHA= +k8s.io/cloud-provider v0.22.0-alpha.1 h1:vE5MNEDgVsWaFglmJE0axaH++Uae/vqwaGDmipIO/dQ= +k8s.io/cloud-provider v0.22.0-alpha.1/go.mod h1:cUGBYLml8bn4RknAgwXQw910xzwclIs0vmPI5HTV1YI= +k8s.io/cluster-bootstrap v0.22.0-alpha.1/go.mod h1:Nijrrjw05J+GtQCmW0wnYSqWoCMbVFbDSnVh2SB8U9k= +k8s.io/code-generator v0.22.0-alpha.1/go.mod h1:tHNeGA58jE3nJvZLDN0c/5k7P3NlYdjbWuJYK9QiU3s= +k8s.io/component-base v0.22.0-alpha.1 h1:X33MURXK6wXVMH4u28ckqXakOv1YBaB13FuPpUed8Y0= +k8s.io/component-base v0.22.0-alpha.1/go.mod h1:mglpF0fcNfkUMD+FaqSzEE/nop+WUlBrujXwYG5gthg= +k8s.io/component-helpers v0.22.0-alpha.1 h1:8ufrFeTCiRzHbQsvoZUO1MTkv+SK5l+SnnrvNrwm3kE= +k8s.io/component-helpers v0.22.0-alpha.1/go.mod h1:Du7D9KlzPvjXfWY7z58/pj2mYhQeu6yfz2Z16NjAJMs= +k8s.io/controller-manager v0.22.0-alpha.1/go.mod h1:3LoOmi7qe/dMhTgruY0iE8sYzMAq7sHwmPUYPKrKjW8= +k8s.io/cri-api v0.22.0-alpha.1 h1:wCHYU4INUMc4c93cZNjjMRYjrOC3dCOXk3doqBq4atQ= +k8s.io/cri-api v0.22.0-alpha.1/go.mod h1:9zj46jgx4C526EGuJx3lJvLk/YJsiXMsqimM7oOeVaY= +k8s.io/csi-translation-lib v0.22.0-alpha.1 h1:VD58o2JWFVRti8SMwBhFg1LGQt1nEMCGw6qVC/05qI4= +k8s.io/csi-translation-lib v0.22.0-alpha.1/go.mod h1:bf6KlUwPsvTsuj1i/ao/dLsdX0bmIG0dej1jmTXcUP8= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/heapster v1.2.0-beta.1/go.mod h1:h1uhptVXMwC8xtZBYsPXKVi8fpdlYkTs6k949KozGrM= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.5.0 h1:8mOnjf1RmUPW6KRqQCfYSZq/K20Unmp3IhuZUhxl8KI= -k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-aggregator v0.21.0-beta.1/go.mod h1:D28RMhuIgylikl2M7DHcpiV695nSkoeX6uemjelKyxk= -k8s.io/kube-controller-manager v0.21.0-beta.1/go.mod h1:ew8e6OKMpLmbbSBJOG0pfF4Y0mevCNEplebHfF8xYQ4= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-proxy v0.21.0-beta.1 h1:Fhql6s9IzTcqYySf8CEHcua0VPk+9GLouk6wn46TAXI= -k8s.io/kube-proxy v0.21.0-beta.1/go.mod h1:s7htWpulRI8oSL0aWVle7LBdUCynVirn7H5ocEvesQ8= -k8s.io/kube-scheduler v0.21.0-beta.1 h1:9O4rM3wLuotI2VO3PPVkuSlUuOmPZT7bFE/iQwX51u8= -k8s.io/kube-scheduler v0.21.0-beta.1/go.mod h1:JohxNAMQFFF6rCBu6JZbLRB7kgMxe0OeeBZ6VvpWm6Q= -k8s.io/kubectl v0.21.0-beta.1 h1:Q7JPuO5ibaBuLoySYUNps5DAjb+9SebxugPyS8RuyoI= -k8s.io/kubectl v0.21.0-beta.1/go.mod h1:v9Wal3y7JAPefA0FuyOugrtayqctOS/5T70vWO8BKGE= -k8s.io/kubelet v0.21.0-beta.1 h1:PZqNKgr0A/WWTaTQm301nCqJu6obLwZf/Ja/8Pcy88E= -k8s.io/kubelet v0.21.0-beta.1/go.mod h1:IfRiKAlQsCqunpyg9PjwZPWBLDSqccq3zUKwp0d/kuo= -k8s.io/kubernetes v1.21.0-beta.1 h1:aR+sJBSTtUJZ0r9QUmconbOZS08Cy3/w1/t7sbd/59Q= -k8s.io/kubernetes v1.21.0-beta.1/go.mod h1:S3Pxzy4S47QcBwSl6+vBW2n5k4ZWdkQzcIRxCtL4/L4= -k8s.io/legacy-cloud-providers v0.21.0-beta.1 h1:cosuKcK5JsfaOEJ0AVqJiDZXv8I5K+WMslP6ND0hTug= -k8s.io/legacy-cloud-providers v0.21.0-beta.1/go.mod h1:EKGANm8dBkKp7o7KzxCX/aGnfOjqTOv136tlf1tLgyI= -k8s.io/metrics v0.21.0-beta.1/go.mod h1:IZI4MfDwnVzuaA3+SebxHGBLV9Ee6isYjPlZh181Ay0= -k8s.io/mount-utils v0.21.0-beta.1 h1:2WkPHg4CuESD00UIhHv7S2yD8jZWejjTbZiMmBoaKYw= -k8s.io/mount-utils v0.21.0-beta.1/go.mod h1:ULpPwlxBP6fDTzM6NvNvHjdtMUHX5BreuxGl5kkay6o= -k8s.io/sample-apiserver v0.21.0-beta.1/go.mod h1:E85Su4H2BdGq3qNcrhF0hBqc31ifabyqPvA8zs+KWhI= +k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/kube-aggregator v0.22.0-alpha.1/go.mod h1:wEVaZtchAIkCavNYrz83/z39KUISsJd80eh9jyEhlh0= +k8s.io/kube-controller-manager v0.22.0-alpha.1/go.mod h1:WSvEur2WV7V6YU+Z1pO2v5TQ04M32vVzTVEh1JE3zGQ= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kube-proxy v0.22.0-alpha.1 h1:8NRNfQraLRdwRzcmF7OIf5aY+04k54BFDBJmNwmrnQo= +k8s.io/kube-proxy v0.22.0-alpha.1/go.mod h1:r9Sk0UBefjXXfWZD6ReppotzMnyrSWPeus1hhZmN+jQ= +k8s.io/kube-scheduler v0.22.0-alpha.1 h1:0stphlaj66tYpFTdfyjaQY8C/Bvn7tjG70/+R5Bf/R4= +k8s.io/kube-scheduler v0.22.0-alpha.1/go.mod h1:BDbG/vXOcuUoV13aqP+Q0BNoEmTTbqWQwea1a6KABh0= +k8s.io/kubectl v0.22.0-alpha.1 h1:jG6k+5vjeEX7Iue8SjWXDOBbEmDuwzTRlZD0/wCSvn8= +k8s.io/kubectl v0.22.0-alpha.1/go.mod h1:kWcYWQs1XkM7Y2EvFJaeswhq2CQfJ28qUhFBdXC0Xjk= +k8s.io/kubelet v0.22.0-alpha.1 h1:Ln86e0mf+VCx4iIC6bMW75S7+n/cbHIIhxd7Wan6oII= +k8s.io/kubelet v0.22.0-alpha.1/go.mod h1:JmUEgOZaxdULOcR1gO87OyDJTWfBMsvoWat6YaZSRoc= +k8s.io/kubernetes v1.22.0-alpha.1 h1:tMDxJBrbwsbhnmWL9ovCG6tzNtIJZwXsrJtNPSiGHrU= +k8s.io/kubernetes v1.22.0-alpha.1/go.mod h1:Exr4czZFzGgO6m7eSrRcnJ+9oU20nk79/70jbYDMWFI= +k8s.io/legacy-cloud-providers v0.22.0-alpha.1 h1:zXfiLPppxSGgDh2HZr76sqrmj8XJPcPxr9UFses63aw= +k8s.io/legacy-cloud-providers v0.22.0-alpha.1/go.mod h1:E7daTU5Rozx6HR7JcffGe/3Kiozt907jNiWwzuzJSDM= +k8s.io/metrics v0.22.0-alpha.1/go.mod h1:sr4On/UmHn4pxvTGlLbd1k8ZIf2p3Nmgu/l1greLcaA= +k8s.io/mount-utils v0.22.0-alpha.1 h1:+gdD2K2lKFdvhjqDOPIfKGzaZ7AfQ2y7eOfyPu/prpI= +k8s.io/mount-utils v0.22.0-alpha.1/go.mod h1:cZkyEGfqT7U10Wby27fOGpgjS82N+dyhng5OtRk3qoo= +k8s.io/sample-apiserver v0.22.0-alpha.1/go.mod h1:jEdF6mOYZZixQabD8h5H+j69FQe6DlVo+Jlr4VrbExA= k8s.io/system-validators v1.4.0/go.mod h1:bPldcLgkIUK22ALflnsXk8pvkTEndYdNuaHH6gRrl0Q= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= @@ -1102,13 +1121,13 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15 h1:4uqm9Mv+w2MmBYD+F4qf/v6tDFUdPOk29C095RbU5mY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY= -sigs.k8s.io/kustomize/cmd/config v0.9.7/go.mod h1:MvXCpHs77cfyxRmCNUQjIqCmZyYsbn5PyQpWiq44nW0= -sigs.k8s.io/kustomize/kustomize/v4 v4.0.5/go.mod h1:C7rYla7sI8EnxHE/xEhRBSHMNfcL91fx0uKmUlUhrBk= -sigs.k8s.io/kustomize/kyaml v0.10.15/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= +sigs.k8s.io/kustomize/api v0.8.8/go.mod h1:He1zoK0nk43Pc6NlV085xDXDXTNprtcyKZVm3swsdNY= +sigs.k8s.io/kustomize/cmd/config v0.9.10/go.mod h1:Mrby0WnRH7hA6OwOYnYpfpiY0WJIMgYrEDfwOeFdMK0= +sigs.k8s.io/kustomize/kustomize/v4 v4.1.2/go.mod h1:PxBvo4WGYlCLeRPL+ziT64wBXqbgfcalOS/SXa/tcyo= +sigs.k8s.io/kustomize/kyaml v0.10.17/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.1 h1:nYqY2A6oy37sKLYuSBXuQhbj4JVclzJK13BOIvJG5XU= +sigs.k8s.io/structured-merge-diff/v4 v4.1.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/cluster-autoscaler/processors/nodegroupset/compare_nodegroups.go b/cluster-autoscaler/processors/nodegroupset/compare_nodegroups.go index 709064055871..b5647a3b048a 100644 --- a/cluster-autoscaler/processors/nodegroupset/compare_nodegroups.go +++ b/cluster-autoscaler/processors/nodegroupset/compare_nodegroups.go @@ -21,6 +21,7 @@ import ( apiv1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/autoscaler/cluster-autoscaler/utils/scheduler" schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" ) @@ -122,7 +123,7 @@ func IsCloudProviderNodeInfoSimilar(n1, n2 *schedulerframework.NodeInfo, ignored for res, quantity := range node.Node().Status.Allocatable { allocatable[res] = append(allocatable[res], quantity) } - for res, quantity := range node.Requested.ResourceList() { + for res, quantity := range scheduler.ResourceToResourceList(node.Requested) { freeRes := node.Node().Status.Allocatable[res].DeepCopy() freeRes.Sub(quantity) free[res] = append(free[res], freeRes) diff --git a/cluster-autoscaler/simulator/basic_cluster_snapshot.go b/cluster-autoscaler/simulator/basic_cluster_snapshot.go index 35fd7d246725..d210c3de426b 100644 --- a/cluster-autoscaler/simulator/basic_cluster_snapshot.go +++ b/cluster-autoscaler/simulator/basic_cluster_snapshot.go @@ -92,10 +92,7 @@ func (data *internalBasicSnapshotData) addNode(node *apiv1.Node) error { return fmt.Errorf("node %s already in snapshot", node.Name) } nodeInfo := schedulerframework.NewNodeInfo() - err := nodeInfo.SetNode(node) - if err != nil { - return fmt.Errorf("cannot set node in NodeInfo; %v", err) - } + nodeInfo.SetNode(node) data.nodeInfoMap[node.Name] = nodeInfo return nil } diff --git a/cluster-autoscaler/simulator/delta_cluster_snapshot.go b/cluster-autoscaler/simulator/delta_cluster_snapshot.go index ffc3343f5d9d..e8870ec1f566 100644 --- a/cluster-autoscaler/simulator/delta_cluster_snapshot.go +++ b/cluster-autoscaler/simulator/delta_cluster_snapshot.go @@ -143,9 +143,7 @@ func (data *internalDeltaSnapshotData) addNodes(nodes []*apiv1.Node) error { func (data *internalDeltaSnapshotData) addNode(node *apiv1.Node) error { nodeInfo := schedulerframework.NewNodeInfo() - if err := nodeInfo.SetNode(node); err != nil { - return fmt.Errorf("cannot set node in NodeInfo: %v", err) - } + nodeInfo.SetNode(node) return data.addNodeInfo(nodeInfo) } diff --git a/cluster-autoscaler/simulator/nodes.go b/cluster-autoscaler/simulator/nodes.go index 5e7dad210734..22fb6eaedc44 100644 --- a/cluster-autoscaler/simulator/nodes.go +++ b/cluster-autoscaler/simulator/nodes.go @@ -40,9 +40,7 @@ func BuildNodeInfoForNode(node *apiv1.Node, podsForNodes map[string][]*apiv1.Pod return nil, err } result := schedulerframework.NewNodeInfo(requiredPods...) - if err := result.SetNode(node); err != nil { - return nil, errors.ToAutoscalerError(errors.InternalError, err) - } + result.SetNode(node) return result, nil } diff --git a/cluster-autoscaler/utils/scheduler/scheduler.go b/cluster-autoscaler/utils/scheduler/scheduler.go index f3e4439f6748..ccb7c6a1db3e 100644 --- a/cluster-autoscaler/utils/scheduler/scheduler.go +++ b/cluster-autoscaler/utils/scheduler/scheduler.go @@ -18,8 +18,10 @@ package scheduler import ( "fmt" + "strings" apiv1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/uuid" schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" ) @@ -61,6 +63,10 @@ func CreateNodeNameToInfoMap(pods []*apiv1.Pod, nodes []*apiv1.Node) map[string] return nodeNameToNodeInfo } +func isHugePageResourceName(name apiv1.ResourceName) bool { + return strings.HasPrefix(string(name), apiv1.ResourceHugePagesPrefix) +} + // DeepCopyTemplateNode copies NodeInfo object used as a template. It changes // names of UIDs of both node and pods running on it, so that copies can be used // to represent multiple nodes. @@ -82,3 +88,21 @@ func DeepCopyTemplateNode(nodeTemplate *schedulerframework.NodeInfo, index int) } return nodeInfo } + +// ResourceToResourceList returns a resource list of the resource. +func ResourceToResourceList(r *schedulerframework.Resource) apiv1.ResourceList { + result := apiv1.ResourceList{ + apiv1.ResourceCPU: *resource.NewMilliQuantity(r.MilliCPU, resource.DecimalSI), + apiv1.ResourceMemory: *resource.NewQuantity(r.Memory, resource.BinarySI), + apiv1.ResourcePods: *resource.NewQuantity(int64(r.AllowedPodNumber), resource.BinarySI), + apiv1.ResourceEphemeralStorage: *resource.NewQuantity(r.EphemeralStorage, resource.BinarySI), + } + for rName, rQuant := range r.ScalarResources { + if isHugePageResourceName(rName) { + result[rName] = *resource.NewQuantity(rQuant, resource.BinarySI) + } else { + result[rName] = *resource.NewQuantity(rQuant, resource.DecimalSI) + } + } + return result +} diff --git a/cluster-autoscaler/utils/scheduler/scheduler_test.go b/cluster-autoscaler/utils/scheduler/scheduler_test.go index f226f8da2d83..54989cb6fe16 100644 --- a/cluster-autoscaler/utils/scheduler/scheduler_test.go +++ b/cluster-autoscaler/utils/scheduler/scheduler_test.go @@ -17,9 +17,13 @@ limitations under the License. package scheduler import ( + "fmt" + "reflect" "testing" + "k8s.io/apimachinery/pkg/api/resource" . "k8s.io/autoscaler/cluster-autoscaler/utils/test" + schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" apiv1 "k8s.io/api/core/v1" @@ -50,3 +54,51 @@ func TestCreateNodeNameToInfoMap(t *testing.T) { assert.Equal(t, p2, res["node2"].Pods[0].Pod) assert.Equal(t, n2, res["node2"].Node()) } + +func TestResourceList(t *testing.T) { + tests := []struct { + resource *schedulerframework.Resource + expected apiv1.ResourceList + }{ + { + resource: &schedulerframework.Resource{}, + expected: map[apiv1.ResourceName]resource.Quantity{ + apiv1.ResourceCPU: *resource.NewScaledQuantity(0, -3), + apiv1.ResourceMemory: *resource.NewQuantity(0, resource.BinarySI), + apiv1.ResourcePods: *resource.NewQuantity(0, resource.BinarySI), + apiv1.ResourceEphemeralStorage: *resource.NewQuantity(0, resource.BinarySI), + }, + }, + { + resource: &schedulerframework.Resource{ + MilliCPU: 4, + Memory: 2000, + EphemeralStorage: 5000, + AllowedPodNumber: 80, + ScalarResources: map[apiv1.ResourceName]int64{ + "scalar.test/scalar1": 1, + "hugepages-test": 2, + "attachable-volumes-aws-ebs": 39, + }, + }, + expected: map[apiv1.ResourceName]resource.Quantity{ + apiv1.ResourceCPU: *resource.NewScaledQuantity(4, -3), + apiv1.ResourceMemory: *resource.NewQuantity(2000, resource.BinarySI), + apiv1.ResourcePods: *resource.NewQuantity(80, resource.BinarySI), + apiv1.ResourceEphemeralStorage: *resource.NewQuantity(5000, resource.BinarySI), + "scalar.test/" + "scalar1": *resource.NewQuantity(1, resource.DecimalSI), + "attachable-volumes-aws-ebs": *resource.NewQuantity(39, resource.DecimalSI), + apiv1.ResourceHugePagesPrefix + "test": *resource.NewQuantity(2, resource.BinarySI), + }, + }, + } + + for i, test := range tests { + t.Run(fmt.Sprintf("case_%d", i), func(t *testing.T) { + rl := ResourceToResourceList(test.resource) + if !reflect.DeepEqual(test.expected, rl) { + t.Errorf("expected: %#v, got: %#v", test.expected, rl) + } + }) + } +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/LICENSE.txt b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/LICENSE.txt new file mode 100644 index 000000000000..ccb63b166732 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md new file mode 100644 index 000000000000..c51c03e958f8 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md @@ -0,0 +1,96 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/compute/resource-manager/readme.md tag: `package-2019-12-01` + +Code generator @microsoft.azure/autorest.go@2.1.178 + + +### New Funcs + +1. *ContainerServicesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ContainerServicesDeleteFuture.UnmarshalJSON([]byte) error +1. *DedicatedHostsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *DedicatedHostsDeleteFuture.UnmarshalJSON([]byte) error +1. *DedicatedHostsUpdateFuture.UnmarshalJSON([]byte) error +1. *DiskEncryptionSetsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *DiskEncryptionSetsDeleteFuture.UnmarshalJSON([]byte) error +1. *DiskEncryptionSetsUpdateFuture.UnmarshalJSON([]byte) error +1. *DisksCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *DisksDeleteFuture.UnmarshalJSON([]byte) error +1. *DisksGrantAccessFuture.UnmarshalJSON([]byte) error +1. *DisksRevokeAccessFuture.UnmarshalJSON([]byte) error +1. *DisksUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleriesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleriesDeleteFuture.UnmarshalJSON([]byte) error +1. *GalleriesUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleryApplicationVersionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleryApplicationVersionsDeleteFuture.UnmarshalJSON([]byte) error +1. *GalleryApplicationVersionsUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleryApplicationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleryApplicationsDeleteFuture.UnmarshalJSON([]byte) error +1. *GalleryApplicationsUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleryImageVersionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleryImageVersionsDeleteFuture.UnmarshalJSON([]byte) error +1. *GalleryImageVersionsUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleryImagesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *GalleryImagesDeleteFuture.UnmarshalJSON([]byte) error +1. *GalleryImagesUpdateFuture.UnmarshalJSON([]byte) error +1. *ImagesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ImagesDeleteFuture.UnmarshalJSON([]byte) error +1. *ImagesUpdateFuture.UnmarshalJSON([]byte) error +1. *LogAnalyticsExportRequestRateByIntervalFuture.UnmarshalJSON([]byte) error +1. *LogAnalyticsExportThrottledRequestsFuture.UnmarshalJSON([]byte) error +1. *SnapshotsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *SnapshotsDeleteFuture.UnmarshalJSON([]byte) error +1. *SnapshotsGrantAccessFuture.UnmarshalJSON([]byte) error +1. *SnapshotsRevokeAccessFuture.UnmarshalJSON([]byte) error +1. *SnapshotsUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineExtensionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineExtensionsDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineExtensionsUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetExtensionsDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetExtensionsUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetRollingUpgradesCancelFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMExtensionsDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMExtensionsUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsDeallocateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsPerformMaintenanceFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsPowerOffFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsRedeployFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsReimageAllFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsReimageFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsRestartFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsRunCommandFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsStartFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetVMsUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsDeallocateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsDeleteInstancesFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsPerformMaintenanceFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsPowerOffFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsRedeployFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsReimageAllFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsReimageFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsRestartFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsStartFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachineScaleSetsUpdateInstancesFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesCaptureFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesConvertToManagedDisksFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesDeallocateFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesPerformMaintenanceFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesPowerOffFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesReapplyFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesRedeployFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesReimageFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesRestartFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesRunCommandFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesStartFuture.UnmarshalJSON([]byte) error +1. *VirtualMachinesUpdateFuture.UnmarshalJSON([]byte) error diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go index fa23adc38c6e..8caf510ee78c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourc result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -113,7 +103,6 @@ func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*h func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,7 @@ func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupNa result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request") + return } return @@ -189,7 +179,6 @@ func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Resp func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +216,7 @@ func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request") + return } return @@ -264,7 +254,6 @@ func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Respons func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -303,6 +292,11 @@ func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName result.aslr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request") + return + } + if result.aslr.hasNextLink() && result.aslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -339,7 +333,6 @@ func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Respon func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +409,7 @@ func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, res result, err = client.ListAvailableSizesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request") + return } return @@ -453,7 +447,6 @@ func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -463,7 +456,7 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp // ListBySubscription lists all availability sets in a subscription. // Parameters: -// expand - the expand expression to apply to the operation. +// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") @@ -492,6 +485,11 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, exp result.aslr, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.aslr.hasNextLink() && result.aslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -530,7 +528,6 @@ func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -607,6 +604,7 @@ func (client AvailabilitySetsClient) Update(ctx context.Context, resourceGroupNa result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure responding to request") + return } return @@ -646,7 +644,6 @@ func (client AvailabilitySetsClient) UpdateSender(req *http.Request) (*http.Resp func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/client.go index d9d0430190ea..1812f27feb99 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/client.go @@ -3,19 +3,8 @@ // Compute Client package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go index 0d0f705daba1..d27f363dab63 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -99,7 +88,7 @@ func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resour result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -137,7 +126,10 @@ func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -146,7 +138,6 @@ func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (f func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -166,8 +157,8 @@ func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -180,7 +171,7 @@ func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupN result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", nil, "Failure sending request") return } @@ -216,7 +207,10 @@ func (client ContainerServicesClient) DeleteSender(req *http.Request) (future Co if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -225,7 +219,6 @@ func (client ContainerServicesClient) DeleteSender(req *http.Request) (future Co func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -265,6 +258,7 @@ func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", resp, "Failure responding to request") + return } return @@ -302,7 +296,6 @@ func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Respon func (client ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -340,6 +333,11 @@ func (client ContainerServicesClient) List(ctx context.Context) (result Containe result.cslr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure responding to request") + return + } + if result.cslr.hasNextLink() && result.cslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -375,7 +373,6 @@ func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Respo func (client ContainerServicesClient) ListResponder(resp *http.Response) (result ContainerServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -453,6 +450,11 @@ func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, r result.cslr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cslr.hasNextLink() && result.cslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -489,7 +491,6 @@ func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Reques func (client ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ContainerServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go index 2ae90747f6f5..70f9358cc5b5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -87,6 +76,7 @@ func (client DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, reso result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -126,7 +116,6 @@ func (client DedicatedHostGroupsClient) CreateOrUpdateSender(req *http.Request) func (client DedicatedHostGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -165,6 +154,7 @@ func (client DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGrou result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure responding to request") + return } return @@ -202,7 +192,6 @@ func (client DedicatedHostGroupsClient) DeleteSender(req *http.Request) (*http.R func (client DedicatedHostGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -240,6 +229,7 @@ func (client DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupNa result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure responding to request") + return } return @@ -277,7 +267,6 @@ func (client DedicatedHostGroupsClient) GetSender(req *http.Request) (*http.Resp func (client DedicatedHostGroupsClient) GetResponder(resp *http.Response) (result DedicatedHostGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -317,6 +306,11 @@ func (client DedicatedHostGroupsClient) ListByResourceGroup(ctx context.Context, result.dhglr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -353,7 +347,6 @@ func (client DedicatedHostGroupsClient) ListByResourceGroupSender(req *http.Requ func (client DedicatedHostGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -428,6 +421,11 @@ func (client DedicatedHostGroupsClient) ListBySubscription(ctx context.Context) result.dhglr, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -463,7 +461,6 @@ func (client DedicatedHostGroupsClient) ListBySubscriptionSender(req *http.Reque func (client DedicatedHostGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -540,6 +537,7 @@ func (client DedicatedHostGroupsClient) Update(ctx context.Context, resourceGrou result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", resp, "Failure responding to request") + return } return @@ -579,7 +577,6 @@ func (client DedicatedHostGroupsClient) UpdateSender(req *http.Request) (*http.R func (client DedicatedHostGroupsClient) UpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go index 53126ca84248..934ac008b8ae 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client DedicatedHostsClient) CreateOrUpdate(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -79,7 +68,7 @@ func (client DedicatedHostsClient) CreateOrUpdate(ctx context.Context, resourceG result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -118,7 +107,10 @@ func (client DedicatedHostsClient) CreateOrUpdateSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -127,7 +119,6 @@ func (client DedicatedHostsClient) CreateOrUpdateSender(req *http.Request) (futu func (client DedicatedHostsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHost, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -145,8 +136,8 @@ func (client DedicatedHostsClient) Delete(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -159,7 +150,7 @@ func (client DedicatedHostsClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", nil, "Failure sending request") return } @@ -196,7 +187,10 @@ func (client DedicatedHostsClient) DeleteSender(req *http.Request) (future Dedic if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -205,7 +199,6 @@ func (client DedicatedHostsClient) DeleteSender(req *http.Request) (future Dedic func (client DedicatedHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -245,6 +238,7 @@ func (client DedicatedHostsClient) Get(ctx context.Context, resourceGroupName st result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure responding to request") + return } return @@ -286,7 +280,6 @@ func (client DedicatedHostsClient) GetSender(req *http.Request) (*http.Response, func (client DedicatedHostsClient) GetResponder(resp *http.Response) (result DedicatedHost, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -327,6 +320,11 @@ func (client DedicatedHostsClient) ListByHostGroup(ctx context.Context, resource result.dhlr, err = client.ListByHostGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure responding to request") + return + } + if result.dhlr.hasNextLink() && result.dhlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -364,7 +362,6 @@ func (client DedicatedHostsClient) ListByHostGroupSender(req *http.Request) (*ht func (client DedicatedHostsClient) ListByHostGroupResponder(resp *http.Response) (result DedicatedHostListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -420,8 +417,8 @@ func (client DedicatedHostsClient) Update(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -434,7 +431,7 @@ func (client DedicatedHostsClient) Update(ctx context.Context, resourceGroupName result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", nil, "Failure sending request") return } @@ -473,7 +470,10 @@ func (client DedicatedHostsClient) UpdateSender(req *http.Request) (future Dedic if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -482,7 +482,6 @@ func (client DedicatedHostsClient) UpdateSender(req *http.Request) (future Dedic func (client DedicatedHostsClient) UpdateResponder(resp *http.Response) (result DedicatedHost, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go index 12874d026a55..da0a8164cd24 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -56,8 +45,8 @@ func (client DiskEncryptionSetsClient) CreateOrUpdate(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -81,7 +70,7 @@ func (client DiskEncryptionSetsClient) CreateOrUpdate(ctx context.Context, resou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -119,7 +108,10 @@ func (client DiskEncryptionSetsClient) CreateOrUpdateSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -128,7 +120,6 @@ func (client DiskEncryptionSetsClient) CreateOrUpdateSender(req *http.Request) ( func (client DiskEncryptionSetsClient) CreateOrUpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -147,8 +138,8 @@ func (client DiskEncryptionSetsClient) Delete(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -161,7 +152,7 @@ func (client DiskEncryptionSetsClient) Delete(ctx context.Context, resourceGroup result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", nil, "Failure sending request") return } @@ -197,7 +188,10 @@ func (client DiskEncryptionSetsClient) DeleteSender(req *http.Request) (future D if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -206,7 +200,6 @@ func (client DiskEncryptionSetsClient) DeleteSender(req *http.Request) (future D func (client DiskEncryptionSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -246,6 +239,7 @@ func (client DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupNam result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure responding to request") + return } return @@ -283,7 +277,6 @@ func (client DiskEncryptionSetsClient) GetSender(req *http.Request) (*http.Respo func (client DiskEncryptionSetsClient) GetResponder(resp *http.Response) (result DiskEncryptionSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -320,6 +313,11 @@ func (client DiskEncryptionSetsClient) List(ctx context.Context) (result DiskEnc result.desl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure responding to request") + return + } + if result.desl.hasNextLink() && result.desl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -355,7 +353,6 @@ func (client DiskEncryptionSetsClient) ListSender(req *http.Request) (*http.Resp func (client DiskEncryptionSetsClient) ListResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -431,6 +428,11 @@ func (client DiskEncryptionSetsClient) ListByResourceGroup(ctx context.Context, result.desl, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.desl.hasNextLink() && result.desl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -467,7 +469,6 @@ func (client DiskEncryptionSetsClient) ListByResourceGroupSender(req *http.Reque func (client DiskEncryptionSetsClient) ListByResourceGroupResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -525,8 +526,8 @@ func (client DiskEncryptionSetsClient) Update(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -539,7 +540,7 @@ func (client DiskEncryptionSetsClient) Update(ctx context.Context, resourceGroup result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", nil, "Failure sending request") return } @@ -577,7 +578,10 @@ func (client DiskEncryptionSetsClient) UpdateSender(req *http.Request) (future D if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -586,7 +590,6 @@ func (client DiskEncryptionSetsClient) UpdateSender(req *http.Request) (future D func (client DiskEncryptionSetsClient) UpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go index 420deb654794..915d456cda4f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -83,7 +72,7 @@ func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -123,7 +112,10 @@ func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksC if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -132,7 +124,6 @@ func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksC func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -151,8 +142,8 @@ func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -165,7 +156,7 @@ func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure sending request") return } @@ -201,7 +192,10 @@ func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -210,7 +204,6 @@ func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFut func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -250,6 +243,7 @@ func (client DisksClient) Get(ctx context.Context, resourceGroupName string, dis result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request") + return } return @@ -287,7 +281,6 @@ func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) { func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -307,8 +300,8 @@ func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName str ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.GrantAccess") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -327,7 +320,7 @@ func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName str result, err = client.GrantAccessSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure sending request") return } @@ -365,7 +358,10 @@ func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGran if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -374,7 +370,6 @@ func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGran func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -411,6 +406,11 @@ func (client DisksClient) List(ctx context.Context) (result DiskListPage, err er result.dl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request") + return + } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -446,7 +446,6 @@ func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -522,6 +521,11 @@ func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroup result.dl, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -558,7 +562,6 @@ func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Re func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -614,8 +617,8 @@ func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName st ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.RevokeAccess") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -628,7 +631,7 @@ func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName st result, err = client.RevokeAccessSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure sending request") return } @@ -664,7 +667,10 @@ func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRev if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -673,7 +679,6 @@ func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRev func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -692,8 +697,8 @@ func (client DisksClient) Update(ctx context.Context, resourceGroupName string, ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -706,7 +711,7 @@ func (client DisksClient) Update(ctx context.Context, resourceGroupName string, result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure sending request") return } @@ -744,7 +749,10 @@ func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -753,7 +761,6 @@ func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFut func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go new file mode 100644 index 000000000000..e666bfc7361d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go @@ -0,0 +1,1393 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AccessLevel enumerates the values for access level. +type AccessLevel string + +const ( + // None ... + None AccessLevel = "None" + // Read ... + Read AccessLevel = "Read" + // Write ... + Write AccessLevel = "Write" +) + +// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. +func PossibleAccessLevelValues() []AccessLevel { + return []AccessLevel{None, Read, Write} +} + +// AggregatedReplicationState enumerates the values for aggregated replication state. +type AggregatedReplicationState string + +const ( + // Completed ... + Completed AggregatedReplicationState = "Completed" + // Failed ... + Failed AggregatedReplicationState = "Failed" + // InProgress ... + InProgress AggregatedReplicationState = "InProgress" + // Unknown ... + Unknown AggregatedReplicationState = "Unknown" +) + +// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. +func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { + return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} +} + +// AvailabilitySetSkuTypes enumerates the values for availability set sku types. +type AvailabilitySetSkuTypes string + +const ( + // Aligned ... + Aligned AvailabilitySetSkuTypes = "Aligned" + // Classic ... + Classic AvailabilitySetSkuTypes = "Classic" +) + +// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. +func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { + return []AvailabilitySetSkuTypes{Aligned, Classic} +} + +// CachingTypes enumerates the values for caching types. +type CachingTypes string + +const ( + // CachingTypesNone ... + CachingTypesNone CachingTypes = "None" + // CachingTypesReadOnly ... + CachingTypesReadOnly CachingTypes = "ReadOnly" + // CachingTypesReadWrite ... + CachingTypesReadWrite CachingTypes = "ReadWrite" +) + +// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. +func PossibleCachingTypesValues() []CachingTypes { + return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} +} + +// ComponentNames enumerates the values for component names. +type ComponentNames string + +const ( + // MicrosoftWindowsShellSetup ... + MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" +) + +// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. +func PossibleComponentNamesValues() []ComponentNames { + return []ComponentNames{MicrosoftWindowsShellSetup} +} + +// ContainerServiceOrchestratorTypes enumerates the values for container service orchestrator types. +type ContainerServiceOrchestratorTypes string + +const ( + // Custom ... + Custom ContainerServiceOrchestratorTypes = "Custom" + // DCOS ... + DCOS ContainerServiceOrchestratorTypes = "DCOS" + // Kubernetes ... + Kubernetes ContainerServiceOrchestratorTypes = "Kubernetes" + // Swarm ... + Swarm ContainerServiceOrchestratorTypes = "Swarm" +) + +// PossibleContainerServiceOrchestratorTypesValues returns an array of possible values for the ContainerServiceOrchestratorTypes const type. +func PossibleContainerServiceOrchestratorTypesValues() []ContainerServiceOrchestratorTypes { + return []ContainerServiceOrchestratorTypes{Custom, DCOS, Kubernetes, Swarm} +} + +// ContainerServiceVMSizeTypes enumerates the values for container service vm size types. +type ContainerServiceVMSizeTypes string + +const ( + // StandardA0 ... + StandardA0 ContainerServiceVMSizeTypes = "Standard_A0" + // StandardA1 ... + StandardA1 ContainerServiceVMSizeTypes = "Standard_A1" + // StandardA10 ... + StandardA10 ContainerServiceVMSizeTypes = "Standard_A10" + // StandardA11 ... + StandardA11 ContainerServiceVMSizeTypes = "Standard_A11" + // StandardA2 ... + StandardA2 ContainerServiceVMSizeTypes = "Standard_A2" + // StandardA3 ... + StandardA3 ContainerServiceVMSizeTypes = "Standard_A3" + // StandardA4 ... + StandardA4 ContainerServiceVMSizeTypes = "Standard_A4" + // StandardA5 ... + StandardA5 ContainerServiceVMSizeTypes = "Standard_A5" + // StandardA6 ... + StandardA6 ContainerServiceVMSizeTypes = "Standard_A6" + // StandardA7 ... + StandardA7 ContainerServiceVMSizeTypes = "Standard_A7" + // StandardA8 ... + StandardA8 ContainerServiceVMSizeTypes = "Standard_A8" + // StandardA9 ... + StandardA9 ContainerServiceVMSizeTypes = "Standard_A9" + // StandardD1 ... + StandardD1 ContainerServiceVMSizeTypes = "Standard_D1" + // StandardD11 ... + StandardD11 ContainerServiceVMSizeTypes = "Standard_D11" + // StandardD11V2 ... + StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" + // StandardD12 ... + StandardD12 ContainerServiceVMSizeTypes = "Standard_D12" + // StandardD12V2 ... + StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" + // StandardD13 ... + StandardD13 ContainerServiceVMSizeTypes = "Standard_D13" + // StandardD13V2 ... + StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" + // StandardD14 ... + StandardD14 ContainerServiceVMSizeTypes = "Standard_D14" + // StandardD14V2 ... + StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" + // StandardD1V2 ... + StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" + // StandardD2 ... + StandardD2 ContainerServiceVMSizeTypes = "Standard_D2" + // StandardD2V2 ... + StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" + // StandardD3 ... + StandardD3 ContainerServiceVMSizeTypes = "Standard_D3" + // StandardD3V2 ... + StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" + // StandardD4 ... + StandardD4 ContainerServiceVMSizeTypes = "Standard_D4" + // StandardD4V2 ... + StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" + // StandardD5V2 ... + StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" + // StandardDS1 ... + StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" + // StandardDS11 ... + StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" + // StandardDS12 ... + StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" + // StandardDS13 ... + StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" + // StandardDS14 ... + StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" + // StandardDS2 ... + StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" + // StandardDS3 ... + StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" + // StandardDS4 ... + StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" + // StandardG1 ... + StandardG1 ContainerServiceVMSizeTypes = "Standard_G1" + // StandardG2 ... + StandardG2 ContainerServiceVMSizeTypes = "Standard_G2" + // StandardG3 ... + StandardG3 ContainerServiceVMSizeTypes = "Standard_G3" + // StandardG4 ... + StandardG4 ContainerServiceVMSizeTypes = "Standard_G4" + // StandardG5 ... + StandardG5 ContainerServiceVMSizeTypes = "Standard_G5" + // StandardGS1 ... + StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" + // StandardGS2 ... + StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" + // StandardGS3 ... + StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" + // StandardGS4 ... + StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" + // StandardGS5 ... + StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" +) + +// PossibleContainerServiceVMSizeTypesValues returns an array of possible values for the ContainerServiceVMSizeTypes const type. +func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { + return []ContainerServiceVMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA2, StandardA3, StandardA4, StandardA5, StandardA6, StandardA7, StandardA8, StandardA9, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS12, StandardDS13, StandardDS14, StandardDS2, StandardDS3, StandardDS4, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5} +} + +// DedicatedHostLicenseTypes enumerates the values for dedicated host license types. +type DedicatedHostLicenseTypes string + +const ( + // DedicatedHostLicenseTypesNone ... + DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" + // DedicatedHostLicenseTypesWindowsServerHybrid ... + DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" + // DedicatedHostLicenseTypesWindowsServerPerpetual ... + DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" +) + +// PossibleDedicatedHostLicenseTypesValues returns an array of possible values for the DedicatedHostLicenseTypes const type. +func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { + return []DedicatedHostLicenseTypes{DedicatedHostLicenseTypesNone, DedicatedHostLicenseTypesWindowsServerHybrid, DedicatedHostLicenseTypesWindowsServerPerpetual} +} + +// DiffDiskOptions enumerates the values for diff disk options. +type DiffDiskOptions string + +const ( + // Local ... + Local DiffDiskOptions = "Local" +) + +// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. +func PossibleDiffDiskOptionsValues() []DiffDiskOptions { + return []DiffDiskOptions{Local} +} + +// DiffDiskPlacement enumerates the values for diff disk placement. +type DiffDiskPlacement string + +const ( + // CacheDisk ... + CacheDisk DiffDiskPlacement = "CacheDisk" + // ResourceDisk ... + ResourceDisk DiffDiskPlacement = "ResourceDisk" +) + +// PossibleDiffDiskPlacementValues returns an array of possible values for the DiffDiskPlacement const type. +func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { + return []DiffDiskPlacement{CacheDisk, ResourceDisk} +} + +// DiskCreateOption enumerates the values for disk create option. +type DiskCreateOption string + +const ( + // Attach Disk will be attached to a VM. + Attach DiskCreateOption = "Attach" + // Copy Create a new disk or snapshot by copying from a disk or snapshot specified by the given + // sourceResourceId. + Copy DiskCreateOption = "Copy" + // Empty Create an empty data disk of a size given by diskSizeGB. + Empty DiskCreateOption = "Empty" + // FromImage Create a new disk from a platform image specified by the given imageReference or + // galleryImageReference. + FromImage DiskCreateOption = "FromImage" + // Import Create a disk by importing from a blob specified by a sourceUri in a storage account specified by + // storageAccountId. + Import DiskCreateOption = "Import" + // Restore Create a new disk by copying from a backup recovery point. + Restore DiskCreateOption = "Restore" + // Upload Create a new disk by obtaining a write token and using it to directly upload the contents of the + // disk. + Upload DiskCreateOption = "Upload" +) + +// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. +func PossibleDiskCreateOptionValues() []DiskCreateOption { + return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore, Upload} +} + +// DiskCreateOptionTypes enumerates the values for disk create option types. +type DiskCreateOptionTypes string + +const ( + // DiskCreateOptionTypesAttach ... + DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" + // DiskCreateOptionTypesEmpty ... + DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" + // DiskCreateOptionTypesFromImage ... + DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" +) + +// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. +func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { + return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} +} + +// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. +type DiskEncryptionSetIdentityType string + +const ( + // SystemAssigned ... + SystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" +) + +// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. +func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { + return []DiskEncryptionSetIdentityType{SystemAssigned} +} + +// DiskState enumerates the values for disk state. +type DiskState string + +const ( + // ActiveSAS The disk currently has an Active SAS Uri associated with it. + ActiveSAS DiskState = "ActiveSAS" + // ActiveUpload A disk is created for upload and a write token has been issued for uploading to it. + ActiveUpload DiskState = "ActiveUpload" + // Attached The disk is currently mounted to a running VM. + Attached DiskState = "Attached" + // ReadyToUpload A disk is ready to be created by upload by requesting a write token. + ReadyToUpload DiskState = "ReadyToUpload" + // Reserved The disk is mounted to a stopped-deallocated VM + Reserved DiskState = "Reserved" + // Unattached The disk is not being used and can be attached to a VM. + Unattached DiskState = "Unattached" +) + +// PossibleDiskStateValues returns an array of possible values for the DiskState const type. +func PossibleDiskStateValues() []DiskState { + return []DiskState{ActiveSAS, ActiveUpload, Attached, ReadyToUpload, Reserved, Unattached} +} + +// DiskStorageAccountTypes enumerates the values for disk storage account types. +type DiskStorageAccountTypes string + +const ( + // PremiumLRS Premium SSD locally redundant storage. Best for production and performance sensitive + // workloads. + PremiumLRS DiskStorageAccountTypes = "Premium_LRS" + // StandardLRS Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent + // access. + StandardLRS DiskStorageAccountTypes = "Standard_LRS" + // StandardSSDLRS Standard SSD locally redundant storage. Best for web servers, lightly used enterprise + // applications and dev/test. + StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" + // UltraSSDLRS Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top + // tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. + UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" +) + +// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. +func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { + return []DiskStorageAccountTypes{PremiumLRS, StandardLRS, StandardSSDLRS, UltraSSDLRS} +} + +// EncryptionType enumerates the values for encryption type. +type EncryptionType string + +const ( + // EncryptionAtRestWithCustomerKey Disk is encrypted with Customer managed key at rest. + EncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" + // EncryptionAtRestWithPlatformKey Disk is encrypted with XStore managed key at rest. It is the default + // encryption type. + EncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" +) + +// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. +func PossibleEncryptionTypeValues() []EncryptionType { + return []EncryptionType{EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformKey} +} + +// HostCaching enumerates the values for host caching. +type HostCaching string + +const ( + // HostCachingNone ... + HostCachingNone HostCaching = "None" + // HostCachingReadOnly ... + HostCachingReadOnly HostCaching = "ReadOnly" + // HostCachingReadWrite ... + HostCachingReadWrite HostCaching = "ReadWrite" +) + +// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. +func PossibleHostCachingValues() []HostCaching { + return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} +} + +// HyperVGeneration enumerates the values for hyper v generation. +type HyperVGeneration string + +const ( + // V1 ... + V1 HyperVGeneration = "V1" + // V2 ... + V2 HyperVGeneration = "V2" +) + +// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. +func PossibleHyperVGenerationValues() []HyperVGeneration { + return []HyperVGeneration{V1, V2} +} + +// HyperVGenerationType enumerates the values for hyper v generation type. +type HyperVGenerationType string + +const ( + // HyperVGenerationTypeV1 ... + HyperVGenerationTypeV1 HyperVGenerationType = "V1" + // HyperVGenerationTypeV2 ... + HyperVGenerationTypeV2 HyperVGenerationType = "V2" +) + +// PossibleHyperVGenerationTypeValues returns an array of possible values for the HyperVGenerationType const type. +func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { + return []HyperVGenerationType{HyperVGenerationTypeV1, HyperVGenerationTypeV2} +} + +// HyperVGenerationTypes enumerates the values for hyper v generation types. +type HyperVGenerationTypes string + +const ( + // HyperVGenerationTypesV1 ... + HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" + // HyperVGenerationTypesV2 ... + HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" +) + +// PossibleHyperVGenerationTypesValues returns an array of possible values for the HyperVGenerationTypes const type. +func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { + return []HyperVGenerationTypes{HyperVGenerationTypesV1, HyperVGenerationTypesV2} +} + +// InstanceViewTypes enumerates the values for instance view types. +type InstanceViewTypes string + +const ( + // InstanceView ... + InstanceView InstanceViewTypes = "instanceView" +) + +// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. +func PossibleInstanceViewTypesValues() []InstanceViewTypes { + return []InstanceViewTypes{InstanceView} +} + +// IntervalInMins enumerates the values for interval in mins. +type IntervalInMins string + +const ( + // FiveMins ... + FiveMins IntervalInMins = "FiveMins" + // SixtyMins ... + SixtyMins IntervalInMins = "SixtyMins" + // ThirtyMins ... + ThirtyMins IntervalInMins = "ThirtyMins" + // ThreeMins ... + ThreeMins IntervalInMins = "ThreeMins" +) + +// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. +func PossibleIntervalInMinsValues() []IntervalInMins { + return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins} +} + +// IPVersion enumerates the values for ip version. +type IPVersion string + +const ( + // IPv4 ... + IPv4 IPVersion = "IPv4" + // IPv6 ... + IPv6 IPVersion = "IPv6" +) + +// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. +func PossibleIPVersionValues() []IPVersion { + return []IPVersion{IPv4, IPv6} +} + +// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. +type MaintenanceOperationResultCodeTypes string + +const ( + // MaintenanceOperationResultCodeTypesMaintenanceAborted ... + MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" + // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... + MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" + // MaintenanceOperationResultCodeTypesNone ... + MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" + // MaintenanceOperationResultCodeTypesRetryLater ... + MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" +) + +// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. +func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { + return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} +} + +// OperatingSystemStateTypes enumerates the values for operating system state types. +type OperatingSystemStateTypes string + +const ( + // Generalized Generalized image. Needs to be provisioned during deployment time. + Generalized OperatingSystemStateTypes = "Generalized" + // Specialized Specialized image. Contains already provisioned OS Disk. + Specialized OperatingSystemStateTypes = "Specialized" +) + +// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. +func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { + return []OperatingSystemStateTypes{Generalized, Specialized} +} + +// OperatingSystemTypes enumerates the values for operating system types. +type OperatingSystemTypes string + +const ( + // Linux ... + Linux OperatingSystemTypes = "Linux" + // Windows ... + Windows OperatingSystemTypes = "Windows" +) + +// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. +func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { + return []OperatingSystemTypes{Linux, Windows} +} + +// OrchestrationServiceNames enumerates the values for orchestration service names. +type OrchestrationServiceNames string + +const ( + // AutomaticRepairs ... + AutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" +) + +// PossibleOrchestrationServiceNamesValues returns an array of possible values for the OrchestrationServiceNames const type. +func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { + return []OrchestrationServiceNames{AutomaticRepairs} +} + +// OrchestrationServiceState enumerates the values for orchestration service state. +type OrchestrationServiceState string + +const ( + // NotRunning ... + NotRunning OrchestrationServiceState = "NotRunning" + // Running ... + Running OrchestrationServiceState = "Running" + // Suspended ... + Suspended OrchestrationServiceState = "Suspended" +) + +// PossibleOrchestrationServiceStateValues returns an array of possible values for the OrchestrationServiceState const type. +func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { + return []OrchestrationServiceState{NotRunning, Running, Suspended} +} + +// OrchestrationServiceStateAction enumerates the values for orchestration service state action. +type OrchestrationServiceStateAction string + +const ( + // Resume ... + Resume OrchestrationServiceStateAction = "Resume" + // Suspend ... + Suspend OrchestrationServiceStateAction = "Suspend" +) + +// PossibleOrchestrationServiceStateActionValues returns an array of possible values for the OrchestrationServiceStateAction const type. +func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { + return []OrchestrationServiceStateAction{Resume, Suspend} +} + +// PassNames enumerates the values for pass names. +type PassNames string + +const ( + // OobeSystem ... + OobeSystem PassNames = "OobeSystem" +) + +// PossiblePassNamesValues returns an array of possible values for the PassNames const type. +func PossiblePassNamesValues() []PassNames { + return []PassNames{OobeSystem} +} + +// ProtocolTypes enumerates the values for protocol types. +type ProtocolTypes string + +const ( + // HTTP ... + HTTP ProtocolTypes = "Http" + // HTTPS ... + HTTPS ProtocolTypes = "Https" +) + +// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. +func PossibleProtocolTypesValues() []ProtocolTypes { + return []ProtocolTypes{HTTP, HTTPS} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateMigrating ... + ProvisioningStateMigrating ProvisioningState = "Migrating" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating} +} + +// ProvisioningState1 enumerates the values for provisioning state 1. +type ProvisioningState1 string + +const ( + // ProvisioningState1Creating ... + ProvisioningState1Creating ProvisioningState1 = "Creating" + // ProvisioningState1Deleting ... + ProvisioningState1Deleting ProvisioningState1 = "Deleting" + // ProvisioningState1Failed ... + ProvisioningState1Failed ProvisioningState1 = "Failed" + // ProvisioningState1Migrating ... + ProvisioningState1Migrating ProvisioningState1 = "Migrating" + // ProvisioningState1Succeeded ... + ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" + // ProvisioningState1Updating ... + ProvisioningState1Updating ProvisioningState1 = "Updating" +) + +// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. +func PossibleProvisioningState1Values() []ProvisioningState1 { + return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating} +} + +// ProvisioningState2 enumerates the values for provisioning state 2. +type ProvisioningState2 string + +const ( + // ProvisioningState2Creating ... + ProvisioningState2Creating ProvisioningState2 = "Creating" + // ProvisioningState2Deleting ... + ProvisioningState2Deleting ProvisioningState2 = "Deleting" + // ProvisioningState2Failed ... + ProvisioningState2Failed ProvisioningState2 = "Failed" + // ProvisioningState2Migrating ... + ProvisioningState2Migrating ProvisioningState2 = "Migrating" + // ProvisioningState2Succeeded ... + ProvisioningState2Succeeded ProvisioningState2 = "Succeeded" + // ProvisioningState2Updating ... + ProvisioningState2Updating ProvisioningState2 = "Updating" +) + +// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type. +func PossibleProvisioningState2Values() []ProvisioningState2 { + return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating} +} + +// ProvisioningState3 enumerates the values for provisioning state 3. +type ProvisioningState3 string + +const ( + // ProvisioningState3Creating ... + ProvisioningState3Creating ProvisioningState3 = "Creating" + // ProvisioningState3Deleting ... + ProvisioningState3Deleting ProvisioningState3 = "Deleting" + // ProvisioningState3Failed ... + ProvisioningState3Failed ProvisioningState3 = "Failed" + // ProvisioningState3Migrating ... + ProvisioningState3Migrating ProvisioningState3 = "Migrating" + // ProvisioningState3Succeeded ... + ProvisioningState3Succeeded ProvisioningState3 = "Succeeded" + // ProvisioningState3Updating ... + ProvisioningState3Updating ProvisioningState3 = "Updating" +) + +// PossibleProvisioningState3Values returns an array of possible values for the ProvisioningState3 const type. +func PossibleProvisioningState3Values() []ProvisioningState3 { + return []ProvisioningState3{ProvisioningState3Creating, ProvisioningState3Deleting, ProvisioningState3Failed, ProvisioningState3Migrating, ProvisioningState3Succeeded, ProvisioningState3Updating} +} + +// ProximityPlacementGroupType enumerates the values for proximity placement group type. +type ProximityPlacementGroupType string + +const ( + // Standard ... + Standard ProximityPlacementGroupType = "Standard" + // Ultra ... + Ultra ProximityPlacementGroupType = "Ultra" +) + +// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. +func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { + return []ProximityPlacementGroupType{Standard, Ultra} +} + +// ReplicationState enumerates the values for replication state. +type ReplicationState string + +const ( + // ReplicationStateCompleted ... + ReplicationStateCompleted ReplicationState = "Completed" + // ReplicationStateFailed ... + ReplicationStateFailed ReplicationState = "Failed" + // ReplicationStateReplicating ... + ReplicationStateReplicating ReplicationState = "Replicating" + // ReplicationStateUnknown ... + ReplicationStateUnknown ReplicationState = "Unknown" +) + +// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. +func PossibleReplicationStateValues() []ReplicationState { + return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} +} + +// ReplicationStatusTypes enumerates the values for replication status types. +type ReplicationStatusTypes string + +const ( + // ReplicationStatusTypesReplicationStatus ... + ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" +) + +// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. +func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { + return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. +type ResourceSkuCapacityScaleType string + +const ( + // ResourceSkuCapacityScaleTypeAutomatic ... + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" + // ResourceSkuCapacityScaleTypeManual ... + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" + // ResourceSkuCapacityScaleTypeNone ... + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" +) + +// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. +func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { + return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} +} + +// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. +type ResourceSkuRestrictionsReasonCode string + +const ( + // NotAvailableForSubscription ... + NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + // QuotaID ... + QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. +func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { + return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} +} + +// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. +type ResourceSkuRestrictionsType string + +const ( + // Location ... + Location ResourceSkuRestrictionsType = "Location" + // Zone ... + Zone ResourceSkuRestrictionsType = "Zone" +) + +// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. +func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { + return []ResourceSkuRestrictionsType{Location, Zone} +} + +// RollingUpgradeActionType enumerates the values for rolling upgrade action type. +type RollingUpgradeActionType string + +const ( + // Cancel ... + Cancel RollingUpgradeActionType = "Cancel" + // Start ... + Start RollingUpgradeActionType = "Start" +) + +// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. +func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { + return []RollingUpgradeActionType{Cancel, Start} +} + +// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. +type RollingUpgradeStatusCode string + +const ( + // RollingUpgradeStatusCodeCancelled ... + RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" + // RollingUpgradeStatusCodeCompleted ... + RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" + // RollingUpgradeStatusCodeFaulted ... + RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" + // RollingUpgradeStatusCodeRollingForward ... + RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" +) + +// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. +func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { + return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} +} + +// SettingNames enumerates the values for setting names. +type SettingNames string + +const ( + // AutoLogon ... + AutoLogon SettingNames = "AutoLogon" + // FirstLogonCommands ... + FirstLogonCommands SettingNames = "FirstLogonCommands" +) + +// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. +func PossibleSettingNamesValues() []SettingNames { + return []SettingNames{AutoLogon, FirstLogonCommands} +} + +// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. +type SnapshotStorageAccountTypes string + +const ( + // SnapshotStorageAccountTypesPremiumLRS Premium SSD locally redundant storage + SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" + // SnapshotStorageAccountTypesStandardLRS Standard HDD locally redundant storage + SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" + // SnapshotStorageAccountTypesStandardZRS Standard zone redundant storage + SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" +) + +// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. +func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { + return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} +} + +// StatusLevelTypes enumerates the values for status level types. +type StatusLevelTypes string + +const ( + // Error ... + Error StatusLevelTypes = "Error" + // Info ... + Info StatusLevelTypes = "Info" + // Warning ... + Warning StatusLevelTypes = "Warning" +) + +// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. +func PossibleStatusLevelTypesValues() []StatusLevelTypes { + return []StatusLevelTypes{Error, Info, Warning} +} + +// StorageAccountType enumerates the values for storage account type. +type StorageAccountType string + +const ( + // StorageAccountTypePremiumLRS ... + StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" + // StorageAccountTypeStandardLRS ... + StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" + // StorageAccountTypeStandardZRS ... + StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" +) + +// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. +func PossibleStorageAccountTypeValues() []StorageAccountType { + return []StorageAccountType{StorageAccountTypePremiumLRS, StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} +} + +// StorageAccountTypes enumerates the values for storage account types. +type StorageAccountTypes string + +const ( + // StorageAccountTypesPremiumLRS ... + StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" + // StorageAccountTypesStandardLRS ... + StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" + // StorageAccountTypesStandardSSDLRS ... + StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" + // StorageAccountTypesUltraSSDLRS ... + StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" +) + +// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. +func PossibleStorageAccountTypesValues() []StorageAccountTypes { + return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesUltraSSDLRS} +} + +// UpgradeMode enumerates the values for upgrade mode. +type UpgradeMode string + +const ( + // Automatic ... + Automatic UpgradeMode = "Automatic" + // Manual ... + Manual UpgradeMode = "Manual" + // Rolling ... + Rolling UpgradeMode = "Rolling" +) + +// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. +func PossibleUpgradeModeValues() []UpgradeMode { + return []UpgradeMode{Automatic, Manual, Rolling} +} + +// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. +type UpgradeOperationInvoker string + +const ( + // UpgradeOperationInvokerPlatform ... + UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" + // UpgradeOperationInvokerUnknown ... + UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" + // UpgradeOperationInvokerUser ... + UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" +) + +// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. +func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { + return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} +} + +// UpgradeState enumerates the values for upgrade state. +type UpgradeState string + +const ( + // UpgradeStateCancelled ... + UpgradeStateCancelled UpgradeState = "Cancelled" + // UpgradeStateCompleted ... + UpgradeStateCompleted UpgradeState = "Completed" + // UpgradeStateFaulted ... + UpgradeStateFaulted UpgradeState = "Faulted" + // UpgradeStateRollingForward ... + UpgradeStateRollingForward UpgradeState = "RollingForward" +) + +// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. +func PossibleUpgradeStateValues() []UpgradeState { + return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} +} + +// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. +type VirtualMachineEvictionPolicyTypes string + +const ( + // Deallocate ... + Deallocate VirtualMachineEvictionPolicyTypes = "Deallocate" + // Delete ... + Delete VirtualMachineEvictionPolicyTypes = "Delete" +) + +// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. +func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { + return []VirtualMachineEvictionPolicyTypes{Deallocate, Delete} +} + +// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. +type VirtualMachinePriorityTypes string + +const ( + // Low ... + Low VirtualMachinePriorityTypes = "Low" + // Regular ... + Regular VirtualMachinePriorityTypes = "Regular" + // Spot ... + Spot VirtualMachinePriorityTypes = "Spot" +) + +// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. +func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { + return []VirtualMachinePriorityTypes{Low, Regular, Spot} +} + +// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. +type VirtualMachineScaleSetScaleInRules string + +const ( + // Default ... + Default VirtualMachineScaleSetScaleInRules = "Default" + // NewestVM ... + NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" + // OldestVM ... + OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" +) + +// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. +func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { + return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} +} + +// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. +type VirtualMachineScaleSetSkuScaleType string + +const ( + // VirtualMachineScaleSetSkuScaleTypeAutomatic ... + VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" + // VirtualMachineScaleSetSkuScaleTypeNone ... + VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" +) + +// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. +func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { + return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} +} + +// VirtualMachineSizeTypes enumerates the values for virtual machine size types. +type VirtualMachineSizeTypes string + +const ( + // VirtualMachineSizeTypesBasicA0 ... + VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" + // VirtualMachineSizeTypesBasicA1 ... + VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" + // VirtualMachineSizeTypesBasicA2 ... + VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" + // VirtualMachineSizeTypesBasicA3 ... + VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" + // VirtualMachineSizeTypesBasicA4 ... + VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" + // VirtualMachineSizeTypesStandardA0 ... + VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" + // VirtualMachineSizeTypesStandardA1 ... + VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" + // VirtualMachineSizeTypesStandardA10 ... + VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" + // VirtualMachineSizeTypesStandardA11 ... + VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" + // VirtualMachineSizeTypesStandardA1V2 ... + VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" + // VirtualMachineSizeTypesStandardA2 ... + VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" + // VirtualMachineSizeTypesStandardA2mV2 ... + VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" + // VirtualMachineSizeTypesStandardA2V2 ... + VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" + // VirtualMachineSizeTypesStandardA3 ... + VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" + // VirtualMachineSizeTypesStandardA4 ... + VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" + // VirtualMachineSizeTypesStandardA4mV2 ... + VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" + // VirtualMachineSizeTypesStandardA4V2 ... + VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" + // VirtualMachineSizeTypesStandardA5 ... + VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" + // VirtualMachineSizeTypesStandardA6 ... + VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" + // VirtualMachineSizeTypesStandardA7 ... + VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" + // VirtualMachineSizeTypesStandardA8 ... + VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" + // VirtualMachineSizeTypesStandardA8mV2 ... + VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" + // VirtualMachineSizeTypesStandardA8V2 ... + VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" + // VirtualMachineSizeTypesStandardA9 ... + VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" + // VirtualMachineSizeTypesStandardB1ms ... + VirtualMachineSizeTypesStandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" + // VirtualMachineSizeTypesStandardB1s ... + VirtualMachineSizeTypesStandardB1s VirtualMachineSizeTypes = "Standard_B1s" + // VirtualMachineSizeTypesStandardB2ms ... + VirtualMachineSizeTypesStandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" + // VirtualMachineSizeTypesStandardB2s ... + VirtualMachineSizeTypesStandardB2s VirtualMachineSizeTypes = "Standard_B2s" + // VirtualMachineSizeTypesStandardB4ms ... + VirtualMachineSizeTypesStandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" + // VirtualMachineSizeTypesStandardB8ms ... + VirtualMachineSizeTypesStandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" + // VirtualMachineSizeTypesStandardD1 ... + VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" + // VirtualMachineSizeTypesStandardD11 ... + VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" + // VirtualMachineSizeTypesStandardD11V2 ... + VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" + // VirtualMachineSizeTypesStandardD12 ... + VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" + // VirtualMachineSizeTypesStandardD12V2 ... + VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" + // VirtualMachineSizeTypesStandardD13 ... + VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" + // VirtualMachineSizeTypesStandardD13V2 ... + VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" + // VirtualMachineSizeTypesStandardD14 ... + VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" + // VirtualMachineSizeTypesStandardD14V2 ... + VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" + // VirtualMachineSizeTypesStandardD15V2 ... + VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" + // VirtualMachineSizeTypesStandardD16sV3 ... + VirtualMachineSizeTypesStandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" + // VirtualMachineSizeTypesStandardD16V3 ... + VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" + // VirtualMachineSizeTypesStandardD1V2 ... + VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" + // VirtualMachineSizeTypesStandardD2 ... + VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" + // VirtualMachineSizeTypesStandardD2sV3 ... + VirtualMachineSizeTypesStandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" + // VirtualMachineSizeTypesStandardD2V2 ... + VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" + // VirtualMachineSizeTypesStandardD2V3 ... + VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" + // VirtualMachineSizeTypesStandardD3 ... + VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" + // VirtualMachineSizeTypesStandardD32sV3 ... + VirtualMachineSizeTypesStandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" + // VirtualMachineSizeTypesStandardD32V3 ... + VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" + // VirtualMachineSizeTypesStandardD3V2 ... + VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" + // VirtualMachineSizeTypesStandardD4 ... + VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" + // VirtualMachineSizeTypesStandardD4sV3 ... + VirtualMachineSizeTypesStandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" + // VirtualMachineSizeTypesStandardD4V2 ... + VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" + // VirtualMachineSizeTypesStandardD4V3 ... + VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" + // VirtualMachineSizeTypesStandardD5V2 ... + VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" + // VirtualMachineSizeTypesStandardD64sV3 ... + VirtualMachineSizeTypesStandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" + // VirtualMachineSizeTypesStandardD64V3 ... + VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" + // VirtualMachineSizeTypesStandardD8sV3 ... + VirtualMachineSizeTypesStandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" + // VirtualMachineSizeTypesStandardD8V3 ... + VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" + // VirtualMachineSizeTypesStandardDS1 ... + VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" + // VirtualMachineSizeTypesStandardDS11 ... + VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" + // VirtualMachineSizeTypesStandardDS11V2 ... + VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" + // VirtualMachineSizeTypesStandardDS12 ... + VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" + // VirtualMachineSizeTypesStandardDS12V2 ... + VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" + // VirtualMachineSizeTypesStandardDS13 ... + VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" + // VirtualMachineSizeTypesStandardDS132V2 ... + VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" + // VirtualMachineSizeTypesStandardDS134V2 ... + VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" + // VirtualMachineSizeTypesStandardDS13V2 ... + VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" + // VirtualMachineSizeTypesStandardDS14 ... + VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" + // VirtualMachineSizeTypesStandardDS144V2 ... + VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" + // VirtualMachineSizeTypesStandardDS148V2 ... + VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" + // VirtualMachineSizeTypesStandardDS14V2 ... + VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" + // VirtualMachineSizeTypesStandardDS15V2 ... + VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" + // VirtualMachineSizeTypesStandardDS1V2 ... + VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" + // VirtualMachineSizeTypesStandardDS2 ... + VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" + // VirtualMachineSizeTypesStandardDS2V2 ... + VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" + // VirtualMachineSizeTypesStandardDS3 ... + VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" + // VirtualMachineSizeTypesStandardDS3V2 ... + VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" + // VirtualMachineSizeTypesStandardDS4 ... + VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" + // VirtualMachineSizeTypesStandardDS4V2 ... + VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" + // VirtualMachineSizeTypesStandardDS5V2 ... + VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" + // VirtualMachineSizeTypesStandardE16sV3 ... + VirtualMachineSizeTypesStandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" + // VirtualMachineSizeTypesStandardE16V3 ... + VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" + // VirtualMachineSizeTypesStandardE2sV3 ... + VirtualMachineSizeTypesStandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" + // VirtualMachineSizeTypesStandardE2V3 ... + VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" + // VirtualMachineSizeTypesStandardE3216V3 ... + VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" + // VirtualMachineSizeTypesStandardE328sV3 ... + VirtualMachineSizeTypesStandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" + // VirtualMachineSizeTypesStandardE32sV3 ... + VirtualMachineSizeTypesStandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" + // VirtualMachineSizeTypesStandardE32V3 ... + VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" + // VirtualMachineSizeTypesStandardE4sV3 ... + VirtualMachineSizeTypesStandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" + // VirtualMachineSizeTypesStandardE4V3 ... + VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" + // VirtualMachineSizeTypesStandardE6416sV3 ... + VirtualMachineSizeTypesStandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" + // VirtualMachineSizeTypesStandardE6432sV3 ... + VirtualMachineSizeTypesStandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" + // VirtualMachineSizeTypesStandardE64sV3 ... + VirtualMachineSizeTypesStandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" + // VirtualMachineSizeTypesStandardE64V3 ... + VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" + // VirtualMachineSizeTypesStandardE8sV3 ... + VirtualMachineSizeTypesStandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" + // VirtualMachineSizeTypesStandardE8V3 ... + VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" + // VirtualMachineSizeTypesStandardF1 ... + VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" + // VirtualMachineSizeTypesStandardF16 ... + VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" + // VirtualMachineSizeTypesStandardF16s ... + VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" + // VirtualMachineSizeTypesStandardF16sV2 ... + VirtualMachineSizeTypesStandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" + // VirtualMachineSizeTypesStandardF1s ... + VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" + // VirtualMachineSizeTypesStandardF2 ... + VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" + // VirtualMachineSizeTypesStandardF2s ... + VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" + // VirtualMachineSizeTypesStandardF2sV2 ... + VirtualMachineSizeTypesStandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" + // VirtualMachineSizeTypesStandardF32sV2 ... + VirtualMachineSizeTypesStandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" + // VirtualMachineSizeTypesStandardF4 ... + VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" + // VirtualMachineSizeTypesStandardF4s ... + VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" + // VirtualMachineSizeTypesStandardF4sV2 ... + VirtualMachineSizeTypesStandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" + // VirtualMachineSizeTypesStandardF64sV2 ... + VirtualMachineSizeTypesStandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" + // VirtualMachineSizeTypesStandardF72sV2 ... + VirtualMachineSizeTypesStandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" + // VirtualMachineSizeTypesStandardF8 ... + VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" + // VirtualMachineSizeTypesStandardF8s ... + VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" + // VirtualMachineSizeTypesStandardF8sV2 ... + VirtualMachineSizeTypesStandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" + // VirtualMachineSizeTypesStandardG1 ... + VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" + // VirtualMachineSizeTypesStandardG2 ... + VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" + // VirtualMachineSizeTypesStandardG3 ... + VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" + // VirtualMachineSizeTypesStandardG4 ... + VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" + // VirtualMachineSizeTypesStandardG5 ... + VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" + // VirtualMachineSizeTypesStandardGS1 ... + VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" + // VirtualMachineSizeTypesStandardGS2 ... + VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" + // VirtualMachineSizeTypesStandardGS3 ... + VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" + // VirtualMachineSizeTypesStandardGS4 ... + VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" + // VirtualMachineSizeTypesStandardGS44 ... + VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" + // VirtualMachineSizeTypesStandardGS48 ... + VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" + // VirtualMachineSizeTypesStandardGS5 ... + VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" + // VirtualMachineSizeTypesStandardGS516 ... + VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" + // VirtualMachineSizeTypesStandardGS58 ... + VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" + // VirtualMachineSizeTypesStandardH16 ... + VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" + // VirtualMachineSizeTypesStandardH16m ... + VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" + // VirtualMachineSizeTypesStandardH16mr ... + VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" + // VirtualMachineSizeTypesStandardH16r ... + VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" + // VirtualMachineSizeTypesStandardH8 ... + VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" + // VirtualMachineSizeTypesStandardH8m ... + VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" + // VirtualMachineSizeTypesStandardL16s ... + VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" + // VirtualMachineSizeTypesStandardL32s ... + VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" + // VirtualMachineSizeTypesStandardL4s ... + VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" + // VirtualMachineSizeTypesStandardL8s ... + VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" + // VirtualMachineSizeTypesStandardM12832ms ... + VirtualMachineSizeTypesStandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" + // VirtualMachineSizeTypesStandardM12864ms ... + VirtualMachineSizeTypesStandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" + // VirtualMachineSizeTypesStandardM128ms ... + VirtualMachineSizeTypesStandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" + // VirtualMachineSizeTypesStandardM128s ... + VirtualMachineSizeTypesStandardM128s VirtualMachineSizeTypes = "Standard_M128s" + // VirtualMachineSizeTypesStandardM6416ms ... + VirtualMachineSizeTypesStandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" + // VirtualMachineSizeTypesStandardM6432ms ... + VirtualMachineSizeTypesStandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" + // VirtualMachineSizeTypesStandardM64ms ... + VirtualMachineSizeTypesStandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" + // VirtualMachineSizeTypesStandardM64s ... + VirtualMachineSizeTypesStandardM64s VirtualMachineSizeTypes = "Standard_M64s" + // VirtualMachineSizeTypesStandardNC12 ... + VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" + // VirtualMachineSizeTypesStandardNC12sV2 ... + VirtualMachineSizeTypesStandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" + // VirtualMachineSizeTypesStandardNC12sV3 ... + VirtualMachineSizeTypesStandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" + // VirtualMachineSizeTypesStandardNC24 ... + VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" + // VirtualMachineSizeTypesStandardNC24r ... + VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" + // VirtualMachineSizeTypesStandardNC24rsV2 ... + VirtualMachineSizeTypesStandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" + // VirtualMachineSizeTypesStandardNC24rsV3 ... + VirtualMachineSizeTypesStandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" + // VirtualMachineSizeTypesStandardNC24sV2 ... + VirtualMachineSizeTypesStandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" + // VirtualMachineSizeTypesStandardNC24sV3 ... + VirtualMachineSizeTypesStandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" + // VirtualMachineSizeTypesStandardNC6 ... + VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" + // VirtualMachineSizeTypesStandardNC6sV2 ... + VirtualMachineSizeTypesStandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" + // VirtualMachineSizeTypesStandardNC6sV3 ... + VirtualMachineSizeTypesStandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" + // VirtualMachineSizeTypesStandardND12s ... + VirtualMachineSizeTypesStandardND12s VirtualMachineSizeTypes = "Standard_ND12s" + // VirtualMachineSizeTypesStandardND24rs ... + VirtualMachineSizeTypesStandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" + // VirtualMachineSizeTypesStandardND24s ... + VirtualMachineSizeTypesStandardND24s VirtualMachineSizeTypes = "Standard_ND24s" + // VirtualMachineSizeTypesStandardND6s ... + VirtualMachineSizeTypesStandardND6s VirtualMachineSizeTypes = "Standard_ND6s" + // VirtualMachineSizeTypesStandardNV12 ... + VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" + // VirtualMachineSizeTypesStandardNV24 ... + VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" + // VirtualMachineSizeTypesStandardNV6 ... + VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" +) + +// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. +func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { + return []VirtualMachineSizeTypes{VirtualMachineSizeTypesBasicA0, VirtualMachineSizeTypesBasicA1, VirtualMachineSizeTypesBasicA2, VirtualMachineSizeTypesBasicA3, VirtualMachineSizeTypesBasicA4, VirtualMachineSizeTypesStandardA0, VirtualMachineSizeTypesStandardA1, VirtualMachineSizeTypesStandardA10, VirtualMachineSizeTypesStandardA11, VirtualMachineSizeTypesStandardA1V2, VirtualMachineSizeTypesStandardA2, VirtualMachineSizeTypesStandardA2mV2, VirtualMachineSizeTypesStandardA2V2, VirtualMachineSizeTypesStandardA3, VirtualMachineSizeTypesStandardA4, VirtualMachineSizeTypesStandardA4mV2, VirtualMachineSizeTypesStandardA4V2, VirtualMachineSizeTypesStandardA5, VirtualMachineSizeTypesStandardA6, VirtualMachineSizeTypesStandardA7, VirtualMachineSizeTypesStandardA8, VirtualMachineSizeTypesStandardA8mV2, VirtualMachineSizeTypesStandardA8V2, VirtualMachineSizeTypesStandardA9, VirtualMachineSizeTypesStandardB1ms, VirtualMachineSizeTypesStandardB1s, VirtualMachineSizeTypesStandardB2ms, VirtualMachineSizeTypesStandardB2s, VirtualMachineSizeTypesStandardB4ms, VirtualMachineSizeTypesStandardB8ms, VirtualMachineSizeTypesStandardD1, VirtualMachineSizeTypesStandardD11, VirtualMachineSizeTypesStandardD11V2, VirtualMachineSizeTypesStandardD12, VirtualMachineSizeTypesStandardD12V2, VirtualMachineSizeTypesStandardD13, VirtualMachineSizeTypesStandardD13V2, VirtualMachineSizeTypesStandardD14, VirtualMachineSizeTypesStandardD14V2, VirtualMachineSizeTypesStandardD15V2, VirtualMachineSizeTypesStandardD16sV3, VirtualMachineSizeTypesStandardD16V3, VirtualMachineSizeTypesStandardD1V2, VirtualMachineSizeTypesStandardD2, VirtualMachineSizeTypesStandardD2sV3, VirtualMachineSizeTypesStandardD2V2, VirtualMachineSizeTypesStandardD2V3, VirtualMachineSizeTypesStandardD3, VirtualMachineSizeTypesStandardD32sV3, VirtualMachineSizeTypesStandardD32V3, VirtualMachineSizeTypesStandardD3V2, VirtualMachineSizeTypesStandardD4, VirtualMachineSizeTypesStandardD4sV3, VirtualMachineSizeTypesStandardD4V2, VirtualMachineSizeTypesStandardD4V3, VirtualMachineSizeTypesStandardD5V2, VirtualMachineSizeTypesStandardD64sV3, VirtualMachineSizeTypesStandardD64V3, VirtualMachineSizeTypesStandardD8sV3, VirtualMachineSizeTypesStandardD8V3, VirtualMachineSizeTypesStandardDS1, VirtualMachineSizeTypesStandardDS11, VirtualMachineSizeTypesStandardDS11V2, VirtualMachineSizeTypesStandardDS12, VirtualMachineSizeTypesStandardDS12V2, VirtualMachineSizeTypesStandardDS13, VirtualMachineSizeTypesStandardDS132V2, VirtualMachineSizeTypesStandardDS134V2, VirtualMachineSizeTypesStandardDS13V2, VirtualMachineSizeTypesStandardDS14, VirtualMachineSizeTypesStandardDS144V2, VirtualMachineSizeTypesStandardDS148V2, VirtualMachineSizeTypesStandardDS14V2, VirtualMachineSizeTypesStandardDS15V2, VirtualMachineSizeTypesStandardDS1V2, VirtualMachineSizeTypesStandardDS2, VirtualMachineSizeTypesStandardDS2V2, VirtualMachineSizeTypesStandardDS3, VirtualMachineSizeTypesStandardDS3V2, VirtualMachineSizeTypesStandardDS4, VirtualMachineSizeTypesStandardDS4V2, VirtualMachineSizeTypesStandardDS5V2, VirtualMachineSizeTypesStandardE16sV3, VirtualMachineSizeTypesStandardE16V3, VirtualMachineSizeTypesStandardE2sV3, VirtualMachineSizeTypesStandardE2V3, VirtualMachineSizeTypesStandardE3216V3, VirtualMachineSizeTypesStandardE328sV3, VirtualMachineSizeTypesStandardE32sV3, VirtualMachineSizeTypesStandardE32V3, VirtualMachineSizeTypesStandardE4sV3, VirtualMachineSizeTypesStandardE4V3, VirtualMachineSizeTypesStandardE6416sV3, VirtualMachineSizeTypesStandardE6432sV3, VirtualMachineSizeTypesStandardE64sV3, VirtualMachineSizeTypesStandardE64V3, VirtualMachineSizeTypesStandardE8sV3, VirtualMachineSizeTypesStandardE8V3, VirtualMachineSizeTypesStandardF1, VirtualMachineSizeTypesStandardF16, VirtualMachineSizeTypesStandardF16s, VirtualMachineSizeTypesStandardF16sV2, VirtualMachineSizeTypesStandardF1s, VirtualMachineSizeTypesStandardF2, VirtualMachineSizeTypesStandardF2s, VirtualMachineSizeTypesStandardF2sV2, VirtualMachineSizeTypesStandardF32sV2, VirtualMachineSizeTypesStandardF4, VirtualMachineSizeTypesStandardF4s, VirtualMachineSizeTypesStandardF4sV2, VirtualMachineSizeTypesStandardF64sV2, VirtualMachineSizeTypesStandardF72sV2, VirtualMachineSizeTypesStandardF8, VirtualMachineSizeTypesStandardF8s, VirtualMachineSizeTypesStandardF8sV2, VirtualMachineSizeTypesStandardG1, VirtualMachineSizeTypesStandardG2, VirtualMachineSizeTypesStandardG3, VirtualMachineSizeTypesStandardG4, VirtualMachineSizeTypesStandardG5, VirtualMachineSizeTypesStandardGS1, VirtualMachineSizeTypesStandardGS2, VirtualMachineSizeTypesStandardGS3, VirtualMachineSizeTypesStandardGS4, VirtualMachineSizeTypesStandardGS44, VirtualMachineSizeTypesStandardGS48, VirtualMachineSizeTypesStandardGS5, VirtualMachineSizeTypesStandardGS516, VirtualMachineSizeTypesStandardGS58, VirtualMachineSizeTypesStandardH16, VirtualMachineSizeTypesStandardH16m, VirtualMachineSizeTypesStandardH16mr, VirtualMachineSizeTypesStandardH16r, VirtualMachineSizeTypesStandardH8, VirtualMachineSizeTypesStandardH8m, VirtualMachineSizeTypesStandardL16s, VirtualMachineSizeTypesStandardL32s, VirtualMachineSizeTypesStandardL4s, VirtualMachineSizeTypesStandardL8s, VirtualMachineSizeTypesStandardM12832ms, VirtualMachineSizeTypesStandardM12864ms, VirtualMachineSizeTypesStandardM128ms, VirtualMachineSizeTypesStandardM128s, VirtualMachineSizeTypesStandardM6416ms, VirtualMachineSizeTypesStandardM6432ms, VirtualMachineSizeTypesStandardM64ms, VirtualMachineSizeTypesStandardM64s, VirtualMachineSizeTypesStandardNC12, VirtualMachineSizeTypesStandardNC12sV2, VirtualMachineSizeTypesStandardNC12sV3, VirtualMachineSizeTypesStandardNC24, VirtualMachineSizeTypesStandardNC24r, VirtualMachineSizeTypesStandardNC24rsV2, VirtualMachineSizeTypesStandardNC24rsV3, VirtualMachineSizeTypesStandardNC24sV2, VirtualMachineSizeTypesStandardNC24sV3, VirtualMachineSizeTypesStandardNC6, VirtualMachineSizeTypesStandardNC6sV2, VirtualMachineSizeTypesStandardNC6sV3, VirtualMachineSizeTypesStandardND12s, VirtualMachineSizeTypesStandardND24rs, VirtualMachineSizeTypesStandardND24s, VirtualMachineSizeTypesStandardND6s, VirtualMachineSizeTypesStandardNV12, VirtualMachineSizeTypesStandardNV24, VirtualMachineSizeTypesStandardNV6} +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go index e4f6dad9233a..75873554375b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client GalleriesClient) CreateOrUpdate(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client GalleriesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client GalleriesClient) CreateOrUpdateSender(req *http.Request) (future Ga if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client GalleriesClient) CreateOrUpdateSender(req *http.Request) (future Ga func (client GalleriesClient) CreateOrUpdateResponder(resp *http.Response) (result Gallery, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client GalleriesClient) Delete(ctx context.Context, resourceGroupName stri ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client GalleriesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client GalleriesClient) DeleteSender(req *http.Request) (future GalleriesD if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client GalleriesClient) DeleteSender(req *http.Request) (future GalleriesD func (client GalleriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client GalleriesClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure responding to request") + return } return @@ -264,7 +258,6 @@ func (client GalleriesClient) GetSender(req *http.Request) (*http.Response, erro func (client GalleriesClient) GetResponder(resp *http.Response) (result Gallery, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -301,6 +294,11 @@ func (client GalleriesClient) List(ctx context.Context) (result GalleryListPage, result.gl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure responding to request") + return + } + if result.gl.hasNextLink() && result.gl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -336,7 +334,6 @@ func (client GalleriesClient) ListSender(req *http.Request) (*http.Response, err func (client GalleriesClient) ListResponder(resp *http.Response) (result GalleryList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -412,6 +409,11 @@ func (client GalleriesClient) ListByResourceGroup(ctx context.Context, resourceG result.gl, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.gl.hasNextLink() && result.gl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -448,7 +450,6 @@ func (client GalleriesClient) ListByResourceGroupSender(req *http.Request) (*htt func (client GalleriesClient) ListByResourceGroupResponder(resp *http.Response) (result GalleryList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -504,8 +505,8 @@ func (client GalleriesClient) Update(ctx context.Context, resourceGroupName stri ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -518,7 +519,7 @@ func (client GalleriesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", nil, "Failure sending request") return } @@ -556,7 +557,10 @@ func (client GalleriesClient) UpdateSender(req *http.Request) (future GalleriesU if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -565,7 +569,6 @@ func (client GalleriesClient) UpdateSender(req *http.Request) (future GalleriesU func (client GalleriesClient) UpdateResponder(resp *http.Response) (result Gallery, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go index 1968d2533b70..9f50ac068e76 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -56,8 +45,8 @@ func (client GalleryApplicationsClient) CreateOrUpdate(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -70,7 +59,7 @@ func (client GalleryApplicationsClient) CreateOrUpdate(ctx context.Context, reso result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -109,7 +98,10 @@ func (client GalleryApplicationsClient) CreateOrUpdateSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -118,7 +110,6 @@ func (client GalleryApplicationsClient) CreateOrUpdateSender(req *http.Request) func (client GalleryApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -137,8 +128,8 @@ func (client GalleryApplicationsClient) Delete(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -151,7 +142,7 @@ func (client GalleryApplicationsClient) Delete(ctx context.Context, resourceGrou result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", nil, "Failure sending request") return } @@ -188,7 +179,10 @@ func (client GalleryApplicationsClient) DeleteSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -197,7 +191,6 @@ func (client GalleryApplicationsClient) DeleteSender(req *http.Request) (future func (client GalleryApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -237,6 +230,7 @@ func (client GalleryApplicationsClient) Get(ctx context.Context, resourceGroupNa result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure responding to request") + return } return @@ -275,7 +269,6 @@ func (client GalleryApplicationsClient) GetSender(req *http.Request) (*http.Resp func (client GalleryApplicationsClient) GetResponder(resp *http.Response) (result GalleryApplication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -316,6 +309,11 @@ func (client GalleryApplicationsClient) ListByGallery(ctx context.Context, resou result.gal, err = client.ListByGalleryResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure responding to request") + return + } + if result.gal.hasNextLink() && result.gal.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -353,7 +351,6 @@ func (client GalleryApplicationsClient) ListByGallerySender(req *http.Request) ( func (client GalleryApplicationsClient) ListByGalleryResponder(resp *http.Response) (result GalleryApplicationList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -412,8 +409,8 @@ func (client GalleryApplicationsClient) Update(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -426,7 +423,7 @@ func (client GalleryApplicationsClient) Update(ctx context.Context, resourceGrou result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", nil, "Failure sending request") return } @@ -465,7 +462,10 @@ func (client GalleryApplicationsClient) UpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -474,7 +474,6 @@ func (client GalleryApplicationsClient) UpdateSender(req *http.Request) (future func (client GalleryApplicationsClient) UpdateResponder(resp *http.Response) (result GalleryApplication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go index 795f6c8e8a42..122818fed019 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -59,8 +48,8 @@ func (client GalleryApplicationVersionsClient) CreateOrUpdate(ctx context.Contex ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -86,7 +75,7 @@ func (client GalleryApplicationVersionsClient) CreateOrUpdate(ctx context.Contex result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -126,7 +115,10 @@ func (client GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -135,7 +127,6 @@ func (client GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Re func (client GalleryApplicationVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -155,8 +146,8 @@ func (client GalleryApplicationVersionsClient) Delete(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -169,7 +160,7 @@ func (client GalleryApplicationVersionsClient) Delete(ctx context.Context, resou result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", nil, "Failure sending request") return } @@ -207,7 +198,10 @@ func (client GalleryApplicationVersionsClient) DeleteSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -216,7 +210,6 @@ func (client GalleryApplicationVersionsClient) DeleteSender(req *http.Request) ( func (client GalleryApplicationVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -258,6 +251,7 @@ func (client GalleryApplicationVersionsClient) Get(ctx context.Context, resource result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure responding to request") + return } return @@ -300,7 +294,6 @@ func (client GalleryApplicationVersionsClient) GetSender(req *http.Request) (*ht func (client GalleryApplicationVersionsClient) GetResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -342,6 +335,11 @@ func (client GalleryApplicationVersionsClient) ListByGalleryApplication(ctx cont result.gavl, err = client.ListByGalleryApplicationResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure responding to request") + return + } + if result.gavl.hasNextLink() && result.gavl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -380,7 +378,6 @@ func (client GalleryApplicationVersionsClient) ListByGalleryApplicationSender(re func (client GalleryApplicationVersionsClient) ListByGalleryApplicationResponder(resp *http.Response) (result GalleryApplicationVersionList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -440,8 +437,8 @@ func (client GalleryApplicationVersionsClient) Update(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -454,7 +451,7 @@ func (client GalleryApplicationVersionsClient) Update(ctx context.Context, resou result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", nil, "Failure sending request") return } @@ -494,7 +491,10 @@ func (client GalleryApplicationVersionsClient) UpdateSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -503,7 +503,6 @@ func (client GalleryApplicationVersionsClient) UpdateSender(req *http.Request) ( func (client GalleryApplicationVersionsClient) UpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go index c88030f69eaa..98858ff6c7e3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -55,8 +44,8 @@ func (client GalleryImagesClient) CreateOrUpdate(ctx context.Context, resourceGr ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -81,7 +70,7 @@ func (client GalleryImagesClient) CreateOrUpdate(ctx context.Context, resourceGr result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -120,7 +109,10 @@ func (client GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (futur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -129,7 +121,6 @@ func (client GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (futur func (client GalleryImagesClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -147,8 +138,8 @@ func (client GalleryImagesClient) Delete(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -161,7 +152,7 @@ func (client GalleryImagesClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", nil, "Failure sending request") return } @@ -198,7 +189,10 @@ func (client GalleryImagesClient) DeleteSender(req *http.Request) (future Galler if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -207,7 +201,6 @@ func (client GalleryImagesClient) DeleteSender(req *http.Request) (future Galler func (client GalleryImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -246,6 +239,7 @@ func (client GalleryImagesClient) Get(ctx context.Context, resourceGroupName str result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure responding to request") + return } return @@ -284,7 +278,6 @@ func (client GalleryImagesClient) GetSender(req *http.Request) (*http.Response, func (client GalleryImagesClient) GetResponder(resp *http.Response) (result GalleryImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -324,6 +317,11 @@ func (client GalleryImagesClient) ListByGallery(ctx context.Context, resourceGro result.gil, err = client.ListByGalleryResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure responding to request") + return + } + if result.gil.hasNextLink() && result.gil.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -361,7 +359,6 @@ func (client GalleryImagesClient) ListByGallerySender(req *http.Request) (*http. func (client GalleryImagesClient) ListByGalleryResponder(resp *http.Response) (result GalleryImageList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -419,8 +416,8 @@ func (client GalleryImagesClient) Update(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -433,7 +430,7 @@ func (client GalleryImagesClient) Update(ctx context.Context, resourceGroupName result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", nil, "Failure sending request") return } @@ -472,7 +469,10 @@ func (client GalleryImagesClient) UpdateSender(req *http.Request) (future Galler if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -481,7 +481,6 @@ func (client GalleryImagesClient) UpdateSender(req *http.Request) (future Galler func (client GalleryImagesClient) UpdateResponder(resp *http.Response) (result GalleryImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go index a81aa50e8414..64ab355fd855 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -57,8 +46,8 @@ func (client GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, res ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -78,7 +67,7 @@ func (client GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, res result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -118,7 +107,10 @@ func (client GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -127,7 +119,6 @@ func (client GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) func (client GalleryImageVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -146,8 +137,8 @@ func (client GalleryImageVersionsClient) Delete(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -160,7 +151,7 @@ func (client GalleryImageVersionsClient) Delete(ctx context.Context, resourceGro result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", nil, "Failure sending request") return } @@ -198,7 +189,10 @@ func (client GalleryImageVersionsClient) DeleteSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -207,7 +201,6 @@ func (client GalleryImageVersionsClient) DeleteSender(req *http.Request) (future func (client GalleryImageVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -248,6 +241,7 @@ func (client GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupN result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure responding to request") + return } return @@ -290,7 +284,6 @@ func (client GalleryImageVersionsClient) GetSender(req *http.Request) (*http.Res func (client GalleryImageVersionsClient) GetResponder(resp *http.Response) (result GalleryImageVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -332,6 +325,11 @@ func (client GalleryImageVersionsClient) ListByGalleryImage(ctx context.Context, result.givl, err = client.ListByGalleryImageResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure responding to request") + return + } + if result.givl.hasNextLink() && result.givl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -370,7 +368,6 @@ func (client GalleryImageVersionsClient) ListByGalleryImageSender(req *http.Requ func (client GalleryImageVersionsClient) ListByGalleryImageResponder(resp *http.Response) (result GalleryImageVersionList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -429,8 +426,8 @@ func (client GalleryImageVersionsClient) Update(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -443,7 +440,7 @@ func (client GalleryImageVersionsClient) Update(ctx context.Context, resourceGro result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", nil, "Failure sending request") return } @@ -483,7 +480,10 @@ func (client GalleryImageVersionsClient) UpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -492,7 +492,6 @@ func (client GalleryImageVersionsClient) UpdateSender(req *http.Request) (future func (client GalleryImageVersionsClient) UpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go index aadeb4529069..a4dca093545a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -103,7 +92,10 @@ func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future Image if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -112,7 +104,6 @@ func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future Image func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -129,8 +120,8 @@ func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -143,7 +134,7 @@ func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", nil, "Failure sending request") return } @@ -179,7 +170,10 @@ func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteF if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -188,7 +182,6 @@ func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteF func (client ImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, im result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure responding to request") + return } return @@ -267,7 +261,6 @@ func (client ImagesClient) GetSender(req *http.Request) (*http.Response, error) func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -305,6 +298,11 @@ func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage result.ilr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request") + return + } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -340,7 +338,6 @@ func (client ImagesClient) ListSender(req *http.Request) (*http.Response, error) func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +413,11 @@ func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGrou result.ilr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -452,7 +454,6 @@ func (client ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.R func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -507,8 +508,8 @@ func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -521,7 +522,7 @@ func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", nil, "Failure sending request") return } @@ -559,7 +560,10 @@ func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateF if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -568,7 +572,6 @@ func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateF func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go index e6e20676f0fc..0220277e0498 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportRequestRateByInterval") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -72,7 +61,7 @@ func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context result, err = client.ExportRequestRateByIntervalSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", nil, "Failure sending request") return } @@ -109,7 +98,10 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Req if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -118,7 +110,6 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Req func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -136,8 +127,8 @@ func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, pa ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportThrottledRequests") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -156,7 +147,7 @@ func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, pa result, err = client.ExportThrottledRequestsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", nil, "Failure sending request") return } @@ -193,7 +184,10 @@ func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -202,7 +196,6 @@ func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go index 6b5eb1bc6477..d76fa9c6351c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -31,1392 +20,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute" -// AccessLevel enumerates the values for access level. -type AccessLevel string - -const ( - // None ... - None AccessLevel = "None" - // Read ... - Read AccessLevel = "Read" - // Write ... - Write AccessLevel = "Write" -) - -// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{None, Read, Write} -} - -// AggregatedReplicationState enumerates the values for aggregated replication state. -type AggregatedReplicationState string - -const ( - // Completed ... - Completed AggregatedReplicationState = "Completed" - // Failed ... - Failed AggregatedReplicationState = "Failed" - // InProgress ... - InProgress AggregatedReplicationState = "InProgress" - // Unknown ... - Unknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} -} - -// AvailabilitySetSkuTypes enumerates the values for availability set sku types. -type AvailabilitySetSkuTypes string - -const ( - // Aligned ... - Aligned AvailabilitySetSkuTypes = "Aligned" - // Classic ... - Classic AvailabilitySetSkuTypes = "Classic" -) - -// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. -func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { - return []AvailabilitySetSkuTypes{Aligned, Classic} -} - -// CachingTypes enumerates the values for caching types. -type CachingTypes string - -const ( - // CachingTypesNone ... - CachingTypesNone CachingTypes = "None" - // CachingTypesReadOnly ... - CachingTypesReadOnly CachingTypes = "ReadOnly" - // CachingTypesReadWrite ... - CachingTypesReadWrite CachingTypes = "ReadWrite" -) - -// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. -func PossibleCachingTypesValues() []CachingTypes { - return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} -} - -// ComponentNames enumerates the values for component names. -type ComponentNames string - -const ( - // MicrosoftWindowsShellSetup ... - MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" -) - -// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. -func PossibleComponentNamesValues() []ComponentNames { - return []ComponentNames{MicrosoftWindowsShellSetup} -} - -// ContainerServiceOrchestratorTypes enumerates the values for container service orchestrator types. -type ContainerServiceOrchestratorTypes string - -const ( - // Custom ... - Custom ContainerServiceOrchestratorTypes = "Custom" - // DCOS ... - DCOS ContainerServiceOrchestratorTypes = "DCOS" - // Kubernetes ... - Kubernetes ContainerServiceOrchestratorTypes = "Kubernetes" - // Swarm ... - Swarm ContainerServiceOrchestratorTypes = "Swarm" -) - -// PossibleContainerServiceOrchestratorTypesValues returns an array of possible values for the ContainerServiceOrchestratorTypes const type. -func PossibleContainerServiceOrchestratorTypesValues() []ContainerServiceOrchestratorTypes { - return []ContainerServiceOrchestratorTypes{Custom, DCOS, Kubernetes, Swarm} -} - -// ContainerServiceVMSizeTypes enumerates the values for container service vm size types. -type ContainerServiceVMSizeTypes string - -const ( - // StandardA0 ... - StandardA0 ContainerServiceVMSizeTypes = "Standard_A0" - // StandardA1 ... - StandardA1 ContainerServiceVMSizeTypes = "Standard_A1" - // StandardA10 ... - StandardA10 ContainerServiceVMSizeTypes = "Standard_A10" - // StandardA11 ... - StandardA11 ContainerServiceVMSizeTypes = "Standard_A11" - // StandardA2 ... - StandardA2 ContainerServiceVMSizeTypes = "Standard_A2" - // StandardA3 ... - StandardA3 ContainerServiceVMSizeTypes = "Standard_A3" - // StandardA4 ... - StandardA4 ContainerServiceVMSizeTypes = "Standard_A4" - // StandardA5 ... - StandardA5 ContainerServiceVMSizeTypes = "Standard_A5" - // StandardA6 ... - StandardA6 ContainerServiceVMSizeTypes = "Standard_A6" - // StandardA7 ... - StandardA7 ContainerServiceVMSizeTypes = "Standard_A7" - // StandardA8 ... - StandardA8 ContainerServiceVMSizeTypes = "Standard_A8" - // StandardA9 ... - StandardA9 ContainerServiceVMSizeTypes = "Standard_A9" - // StandardD1 ... - StandardD1 ContainerServiceVMSizeTypes = "Standard_D1" - // StandardD11 ... - StandardD11 ContainerServiceVMSizeTypes = "Standard_D11" - // StandardD11V2 ... - StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" - // StandardD12 ... - StandardD12 ContainerServiceVMSizeTypes = "Standard_D12" - // StandardD12V2 ... - StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" - // StandardD13 ... - StandardD13 ContainerServiceVMSizeTypes = "Standard_D13" - // StandardD13V2 ... - StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" - // StandardD14 ... - StandardD14 ContainerServiceVMSizeTypes = "Standard_D14" - // StandardD14V2 ... - StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" - // StandardD1V2 ... - StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" - // StandardD2 ... - StandardD2 ContainerServiceVMSizeTypes = "Standard_D2" - // StandardD2V2 ... - StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" - // StandardD3 ... - StandardD3 ContainerServiceVMSizeTypes = "Standard_D3" - // StandardD3V2 ... - StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" - // StandardD4 ... - StandardD4 ContainerServiceVMSizeTypes = "Standard_D4" - // StandardD4V2 ... - StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" - // StandardD5V2 ... - StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" - // StandardDS1 ... - StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" - // StandardDS11 ... - StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" - // StandardDS12 ... - StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" - // StandardDS13 ... - StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" - // StandardDS14 ... - StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" - // StandardDS2 ... - StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" - // StandardDS3 ... - StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" - // StandardDS4 ... - StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" - // StandardG1 ... - StandardG1 ContainerServiceVMSizeTypes = "Standard_G1" - // StandardG2 ... - StandardG2 ContainerServiceVMSizeTypes = "Standard_G2" - // StandardG3 ... - StandardG3 ContainerServiceVMSizeTypes = "Standard_G3" - // StandardG4 ... - StandardG4 ContainerServiceVMSizeTypes = "Standard_G4" - // StandardG5 ... - StandardG5 ContainerServiceVMSizeTypes = "Standard_G5" - // StandardGS1 ... - StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" - // StandardGS2 ... - StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" - // StandardGS3 ... - StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" - // StandardGS4 ... - StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" - // StandardGS5 ... - StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" -) - -// PossibleContainerServiceVMSizeTypesValues returns an array of possible values for the ContainerServiceVMSizeTypes const type. -func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { - return []ContainerServiceVMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA2, StandardA3, StandardA4, StandardA5, StandardA6, StandardA7, StandardA8, StandardA9, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS12, StandardDS13, StandardDS14, StandardDS2, StandardDS3, StandardDS4, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5} -} - -// DedicatedHostLicenseTypes enumerates the values for dedicated host license types. -type DedicatedHostLicenseTypes string - -const ( - // DedicatedHostLicenseTypesNone ... - DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" - // DedicatedHostLicenseTypesWindowsServerHybrid ... - DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" - // DedicatedHostLicenseTypesWindowsServerPerpetual ... - DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" -) - -// PossibleDedicatedHostLicenseTypesValues returns an array of possible values for the DedicatedHostLicenseTypes const type. -func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { - return []DedicatedHostLicenseTypes{DedicatedHostLicenseTypesNone, DedicatedHostLicenseTypesWindowsServerHybrid, DedicatedHostLicenseTypesWindowsServerPerpetual} -} - -// DiffDiskOptions enumerates the values for diff disk options. -type DiffDiskOptions string - -const ( - // Local ... - Local DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{Local} -} - -// DiffDiskPlacement enumerates the values for diff disk placement. -type DiffDiskPlacement string - -const ( - // CacheDisk ... - CacheDisk DiffDiskPlacement = "CacheDisk" - // ResourceDisk ... - ResourceDisk DiffDiskPlacement = "ResourceDisk" -) - -// PossibleDiffDiskPlacementValues returns an array of possible values for the DiffDiskPlacement const type. -func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { - return []DiffDiskPlacement{CacheDisk, ResourceDisk} -} - -// DiskCreateOption enumerates the values for disk create option. -type DiskCreateOption string - -const ( - // Attach Disk will be attached to a VM. - Attach DiskCreateOption = "Attach" - // Copy Create a new disk or snapshot by copying from a disk or snapshot specified by the given - // sourceResourceId. - Copy DiskCreateOption = "Copy" - // Empty Create an empty data disk of a size given by diskSizeGB. - Empty DiskCreateOption = "Empty" - // FromImage Create a new disk from a platform image specified by the given imageReference or - // galleryImageReference. - FromImage DiskCreateOption = "FromImage" - // Import Create a disk by importing from a blob specified by a sourceUri in a storage account specified by - // storageAccountId. - Import DiskCreateOption = "Import" - // Restore Create a new disk by copying from a backup recovery point. - Restore DiskCreateOption = "Restore" - // Upload Create a new disk by obtaining a write token and using it to directly upload the contents of the - // disk. - Upload DiskCreateOption = "Upload" -) - -// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore, Upload} -} - -// DiskCreateOptionTypes enumerates the values for disk create option types. -type DiskCreateOptionTypes string - -const ( - // DiskCreateOptionTypesAttach ... - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - // DiskCreateOptionTypesEmpty ... - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - // DiskCreateOptionTypesFromImage ... - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" -) - -// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} -} - -// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. -type DiskEncryptionSetIdentityType string - -const ( - // SystemAssigned ... - SystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" -) - -// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. -func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { - return []DiskEncryptionSetIdentityType{SystemAssigned} -} - -// DiskState enumerates the values for disk state. -type DiskState string - -const ( - // ActiveSAS The disk currently has an Active SAS Uri associated with it. - ActiveSAS DiskState = "ActiveSAS" - // ActiveUpload A disk is created for upload and a write token has been issued for uploading to it. - ActiveUpload DiskState = "ActiveUpload" - // Attached The disk is currently mounted to a running VM. - Attached DiskState = "Attached" - // ReadyToUpload A disk is ready to be created by upload by requesting a write token. - ReadyToUpload DiskState = "ReadyToUpload" - // Reserved The disk is mounted to a stopped-deallocated VM - Reserved DiskState = "Reserved" - // Unattached The disk is not being used and can be attached to a VM. - Unattached DiskState = "Unattached" -) - -// PossibleDiskStateValues returns an array of possible values for the DiskState const type. -func PossibleDiskStateValues() []DiskState { - return []DiskState{ActiveSAS, ActiveUpload, Attached, ReadyToUpload, Reserved, Unattached} -} - -// DiskStorageAccountTypes enumerates the values for disk storage account types. -type DiskStorageAccountTypes string - -const ( - // PremiumLRS Premium SSD locally redundant storage. Best for production and performance sensitive - // workloads. - PremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // StandardLRS Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent - // access. - StandardLRS DiskStorageAccountTypes = "Standard_LRS" - // StandardSSDLRS Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test. - StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // UltraSSDLRS Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top - // tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. - UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{PremiumLRS, StandardLRS, StandardSSDLRS, UltraSSDLRS} -} - -// EncryptionType enumerates the values for encryption type. -type EncryptionType string - -const ( - // EncryptionAtRestWithCustomerKey Disk is encrypted with Customer managed key at rest. - EncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" - // EncryptionAtRestWithPlatformKey Disk is encrypted with XStore managed key at rest. It is the default - // encryption type. - EncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformKey} -} - -// HostCaching enumerates the values for host caching. -type HostCaching string - -const ( - // HostCachingNone ... - HostCachingNone HostCaching = "None" - // HostCachingReadOnly ... - HostCachingReadOnly HostCaching = "ReadOnly" - // HostCachingReadWrite ... - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} -} - -// HyperVGeneration enumerates the values for hyper v generation. -type HyperVGeneration string - -const ( - // V1 ... - V1 HyperVGeneration = "V1" - // V2 ... - V2 HyperVGeneration = "V2" -) - -// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. -func PossibleHyperVGenerationValues() []HyperVGeneration { - return []HyperVGeneration{V1, V2} -} - -// HyperVGenerationType enumerates the values for hyper v generation type. -type HyperVGenerationType string - -const ( - // HyperVGenerationTypeV1 ... - HyperVGenerationTypeV1 HyperVGenerationType = "V1" - // HyperVGenerationTypeV2 ... - HyperVGenerationTypeV2 HyperVGenerationType = "V2" -) - -// PossibleHyperVGenerationTypeValues returns an array of possible values for the HyperVGenerationType const type. -func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { - return []HyperVGenerationType{HyperVGenerationTypeV1, HyperVGenerationTypeV2} -} - -// HyperVGenerationTypes enumerates the values for hyper v generation types. -type HyperVGenerationTypes string - -const ( - // HyperVGenerationTypesV1 ... - HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" - // HyperVGenerationTypesV2 ... - HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" -) - -// PossibleHyperVGenerationTypesValues returns an array of possible values for the HyperVGenerationTypes const type. -func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { - return []HyperVGenerationTypes{HyperVGenerationTypesV1, HyperVGenerationTypesV2} -} - -// InstanceViewTypes enumerates the values for instance view types. -type InstanceViewTypes string - -const ( - // InstanceView ... - InstanceView InstanceViewTypes = "instanceView" -) - -// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return []InstanceViewTypes{InstanceView} -} - -// IntervalInMins enumerates the values for interval in mins. -type IntervalInMins string - -const ( - // FiveMins ... - FiveMins IntervalInMins = "FiveMins" - // SixtyMins ... - SixtyMins IntervalInMins = "SixtyMins" - // ThirtyMins ... - ThirtyMins IntervalInMins = "ThirtyMins" - // ThreeMins ... - ThreeMins IntervalInMins = "ThreeMins" -) - -// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. -func PossibleIntervalInMinsValues() []IntervalInMins { - return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins} -} - -// IPVersion enumerates the values for ip version. -type IPVersion string - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. -type MaintenanceOperationResultCodeTypes string - -const ( - // MaintenanceOperationResultCodeTypesMaintenanceAborted ... - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" - // MaintenanceOperationResultCodeTypesNone ... - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - // MaintenanceOperationResultCodeTypesRetryLater ... - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" -) - -// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} -} - -// OperatingSystemStateTypes enumerates the values for operating system state types. -type OperatingSystemStateTypes string - -const ( - // Generalized Generalized image. Needs to be provisioned during deployment time. - Generalized OperatingSystemStateTypes = "Generalized" - // Specialized Specialized image. Contains already provisioned OS Disk. - Specialized OperatingSystemStateTypes = "Specialized" -) - -// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return []OperatingSystemStateTypes{Generalized, Specialized} -} - -// OperatingSystemTypes enumerates the values for operating system types. -type OperatingSystemTypes string - -const ( - // Linux ... - Linux OperatingSystemTypes = "Linux" - // Windows ... - Windows OperatingSystemTypes = "Windows" -) - -// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{Linux, Windows} -} - -// OrchestrationServiceNames enumerates the values for orchestration service names. -type OrchestrationServiceNames string - -const ( - // AutomaticRepairs ... - AutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" -) - -// PossibleOrchestrationServiceNamesValues returns an array of possible values for the OrchestrationServiceNames const type. -func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { - return []OrchestrationServiceNames{AutomaticRepairs} -} - -// OrchestrationServiceState enumerates the values for orchestration service state. -type OrchestrationServiceState string - -const ( - // NotRunning ... - NotRunning OrchestrationServiceState = "NotRunning" - // Running ... - Running OrchestrationServiceState = "Running" - // Suspended ... - Suspended OrchestrationServiceState = "Suspended" -) - -// PossibleOrchestrationServiceStateValues returns an array of possible values for the OrchestrationServiceState const type. -func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { - return []OrchestrationServiceState{NotRunning, Running, Suspended} -} - -// OrchestrationServiceStateAction enumerates the values for orchestration service state action. -type OrchestrationServiceStateAction string - -const ( - // Resume ... - Resume OrchestrationServiceStateAction = "Resume" - // Suspend ... - Suspend OrchestrationServiceStateAction = "Suspend" -) - -// PossibleOrchestrationServiceStateActionValues returns an array of possible values for the OrchestrationServiceStateAction const type. -func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { - return []OrchestrationServiceStateAction{Resume, Suspend} -} - -// PassNames enumerates the values for pass names. -type PassNames string - -const ( - // OobeSystem ... - OobeSystem PassNames = "OobeSystem" -) - -// PossiblePassNamesValues returns an array of possible values for the PassNames const type. -func PossiblePassNamesValues() []PassNames { - return []PassNames{OobeSystem} -} - -// ProtocolTypes enumerates the values for protocol types. -type ProtocolTypes string - -const ( - // HTTP ... - HTTP ProtocolTypes = "Http" - // HTTPS ... - HTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{HTTP, HTTPS} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // ProvisioningStateCreating ... - ProvisioningStateCreating ProvisioningState = "Creating" - // ProvisioningStateDeleting ... - ProvisioningStateDeleting ProvisioningState = "Deleting" - // ProvisioningStateFailed ... - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateMigrating ... - ProvisioningStateMigrating ProvisioningState = "Migrating" - // ProvisioningStateSucceeded ... - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - // ProvisioningStateUpdating ... - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating} -} - -// ProvisioningState1 enumerates the values for provisioning state 1. -type ProvisioningState1 string - -const ( - // ProvisioningState1Creating ... - ProvisioningState1Creating ProvisioningState1 = "Creating" - // ProvisioningState1Deleting ... - ProvisioningState1Deleting ProvisioningState1 = "Deleting" - // ProvisioningState1Failed ... - ProvisioningState1Failed ProvisioningState1 = "Failed" - // ProvisioningState1Migrating ... - ProvisioningState1Migrating ProvisioningState1 = "Migrating" - // ProvisioningState1Succeeded ... - ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" - // ProvisioningState1Updating ... - ProvisioningState1Updating ProvisioningState1 = "Updating" -) - -// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. -func PossibleProvisioningState1Values() []ProvisioningState1 { - return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating} -} - -// ProvisioningState2 enumerates the values for provisioning state 2. -type ProvisioningState2 string - -const ( - // ProvisioningState2Creating ... - ProvisioningState2Creating ProvisioningState2 = "Creating" - // ProvisioningState2Deleting ... - ProvisioningState2Deleting ProvisioningState2 = "Deleting" - // ProvisioningState2Failed ... - ProvisioningState2Failed ProvisioningState2 = "Failed" - // ProvisioningState2Migrating ... - ProvisioningState2Migrating ProvisioningState2 = "Migrating" - // ProvisioningState2Succeeded ... - ProvisioningState2Succeeded ProvisioningState2 = "Succeeded" - // ProvisioningState2Updating ... - ProvisioningState2Updating ProvisioningState2 = "Updating" -) - -// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type. -func PossibleProvisioningState2Values() []ProvisioningState2 { - return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating} -} - -// ProvisioningState3 enumerates the values for provisioning state 3. -type ProvisioningState3 string - -const ( - // ProvisioningState3Creating ... - ProvisioningState3Creating ProvisioningState3 = "Creating" - // ProvisioningState3Deleting ... - ProvisioningState3Deleting ProvisioningState3 = "Deleting" - // ProvisioningState3Failed ... - ProvisioningState3Failed ProvisioningState3 = "Failed" - // ProvisioningState3Migrating ... - ProvisioningState3Migrating ProvisioningState3 = "Migrating" - // ProvisioningState3Succeeded ... - ProvisioningState3Succeeded ProvisioningState3 = "Succeeded" - // ProvisioningState3Updating ... - ProvisioningState3Updating ProvisioningState3 = "Updating" -) - -// PossibleProvisioningState3Values returns an array of possible values for the ProvisioningState3 const type. -func PossibleProvisioningState3Values() []ProvisioningState3 { - return []ProvisioningState3{ProvisioningState3Creating, ProvisioningState3Deleting, ProvisioningState3Failed, ProvisioningState3Migrating, ProvisioningState3Succeeded, ProvisioningState3Updating} -} - -// ProximityPlacementGroupType enumerates the values for proximity placement group type. -type ProximityPlacementGroupType string - -const ( - // Standard ... - Standard ProximityPlacementGroupType = "Standard" - // Ultra ... - Ultra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{Standard, Ultra} -} - -// ReplicationState enumerates the values for replication state. -type ReplicationState string - -const ( - // ReplicationStateCompleted ... - ReplicationStateCompleted ReplicationState = "Completed" - // ReplicationStateFailed ... - ReplicationStateFailed ReplicationState = "Failed" - // ReplicationStateReplicating ... - ReplicationStateReplicating ReplicationState = "Replicating" - // ReplicationStateUnknown ... - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} -} - -// ReplicationStatusTypes enumerates the values for replication status types. -type ReplicationStatusTypes string - -const ( - // ReplicationStatusTypesReplicationStatus ... - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" -) - -// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. -type ResourceSkuCapacityScaleType string - -const ( - // ResourceSkuCapacityScaleTypeAutomatic ... - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" - // ResourceSkuCapacityScaleTypeManual ... - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" - // ResourceSkuCapacityScaleTypeNone ... - ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" -) - -// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. -func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { - return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} -} - -// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. -type ResourceSkuRestrictionsReasonCode string - -const ( - // NotAvailableForSubscription ... - NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" - // QuotaID ... - QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" -) - -// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. -func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { - return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} -} - -// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. -type ResourceSkuRestrictionsType string - -const ( - // Location ... - Location ResourceSkuRestrictionsType = "Location" - // Zone ... - Zone ResourceSkuRestrictionsType = "Zone" -) - -// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. -func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { - return []ResourceSkuRestrictionsType{Location, Zone} -} - -// RollingUpgradeActionType enumerates the values for rolling upgrade action type. -type RollingUpgradeActionType string - -const ( - // Cancel ... - Cancel RollingUpgradeActionType = "Cancel" - // Start ... - Start RollingUpgradeActionType = "Start" -) - -// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. -func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { - return []RollingUpgradeActionType{Cancel, Start} -} - -// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. -type RollingUpgradeStatusCode string - -const ( - // RollingUpgradeStatusCodeCancelled ... - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - // RollingUpgradeStatusCodeCompleted ... - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - // RollingUpgradeStatusCodeFaulted ... - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" - // RollingUpgradeStatusCodeRollingForward ... - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" -) - -// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} -} - -// SettingNames enumerates the values for setting names. -type SettingNames string - -const ( - // AutoLogon ... - AutoLogon SettingNames = "AutoLogon" - // FirstLogonCommands ... - FirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{AutoLogon, FirstLogonCommands} -} - -// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. -type SnapshotStorageAccountTypes string - -const ( - // SnapshotStorageAccountTypesPremiumLRS Premium SSD locally redundant storage - SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" - // SnapshotStorageAccountTypesStandardLRS Standard HDD locally redundant storage - SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" - // SnapshotStorageAccountTypesStandardZRS Standard zone redundant storage - SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" -) - -// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} -} - -// StatusLevelTypes enumerates the values for status level types. -type StatusLevelTypes string - -const ( - // Error ... - Error StatusLevelTypes = "Error" - // Info ... - Info StatusLevelTypes = "Info" - // Warning ... - Warning StatusLevelTypes = "Warning" -) - -// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{Error, Info, Warning} -} - -// StorageAccountType enumerates the values for storage account type. -type StorageAccountType string - -const ( - // StorageAccountTypePremiumLRS ... - StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" - // StorageAccountTypeStandardLRS ... - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - // StorageAccountTypeStandardZRS ... - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" -) - -// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{StorageAccountTypePremiumLRS, StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} -} - -// StorageAccountTypes enumerates the values for storage account types. -type StorageAccountTypes string - -const ( - // StorageAccountTypesPremiumLRS ... - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - // StorageAccountTypesStandardLRS ... - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - // StorageAccountTypesStandardSSDLRS ... - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - // StorageAccountTypesUltraSSDLRS ... - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesUltraSSDLRS} -} - -// UpgradeMode enumerates the values for upgrade mode. -type UpgradeMode string - -const ( - // Automatic ... - Automatic UpgradeMode = "Automatic" - // Manual ... - Manual UpgradeMode = "Manual" - // Rolling ... - Rolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{Automatic, Manual, Rolling} -} - -// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. -type UpgradeOperationInvoker string - -const ( - // UpgradeOperationInvokerPlatform ... - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" - // UpgradeOperationInvokerUnknown ... - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - // UpgradeOperationInvokerUser ... - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" -) - -// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} -} - -// UpgradeState enumerates the values for upgrade state. -type UpgradeState string - -const ( - // UpgradeStateCancelled ... - UpgradeStateCancelled UpgradeState = "Cancelled" - // UpgradeStateCompleted ... - UpgradeStateCompleted UpgradeState = "Completed" - // UpgradeStateFaulted ... - UpgradeStateFaulted UpgradeState = "Faulted" - // UpgradeStateRollingForward ... - UpgradeStateRollingForward UpgradeState = "RollingForward" -) - -// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} -} - -// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. -type VirtualMachineEvictionPolicyTypes string - -const ( - // Deallocate ... - Deallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - // Delete ... - Delete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{Deallocate, Delete} -} - -// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. -type VirtualMachinePriorityTypes string - -const ( - // Low ... - Low VirtualMachinePriorityTypes = "Low" - // Regular ... - Regular VirtualMachinePriorityTypes = "Regular" - // Spot ... - Spot VirtualMachinePriorityTypes = "Spot" -) - -// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{Low, Regular, Spot} -} - -// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. -type VirtualMachineScaleSetScaleInRules string - -const ( - // Default ... - Default VirtualMachineScaleSetScaleInRules = "Default" - // NewestVM ... - NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" - // OldestVM ... - OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" -) - -// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. -func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { - return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} -} - -// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. -type VirtualMachineScaleSetSkuScaleType string - -const ( - // VirtualMachineScaleSetSkuScaleTypeAutomatic ... - VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" - // VirtualMachineScaleSetSkuScaleTypeNone ... - VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" -) - -// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. -func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { - return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} -} - -// VirtualMachineSizeTypes enumerates the values for virtual machine size types. -type VirtualMachineSizeTypes string - -const ( - // VirtualMachineSizeTypesBasicA0 ... - VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" - // VirtualMachineSizeTypesBasicA1 ... - VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" - // VirtualMachineSizeTypesBasicA2 ... - VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" - // VirtualMachineSizeTypesBasicA3 ... - VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" - // VirtualMachineSizeTypesBasicA4 ... - VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" - // VirtualMachineSizeTypesStandardA0 ... - VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" - // VirtualMachineSizeTypesStandardA1 ... - VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" - // VirtualMachineSizeTypesStandardA10 ... - VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" - // VirtualMachineSizeTypesStandardA11 ... - VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" - // VirtualMachineSizeTypesStandardA1V2 ... - VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - // VirtualMachineSizeTypesStandardA2 ... - VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" - // VirtualMachineSizeTypesStandardA2mV2 ... - VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - // VirtualMachineSizeTypesStandardA2V2 ... - VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - // VirtualMachineSizeTypesStandardA3 ... - VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" - // VirtualMachineSizeTypesStandardA4 ... - VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" - // VirtualMachineSizeTypesStandardA4mV2 ... - VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - // VirtualMachineSizeTypesStandardA4V2 ... - VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - // VirtualMachineSizeTypesStandardA5 ... - VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" - // VirtualMachineSizeTypesStandardA6 ... - VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" - // VirtualMachineSizeTypesStandardA7 ... - VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" - // VirtualMachineSizeTypesStandardA8 ... - VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" - // VirtualMachineSizeTypesStandardA8mV2 ... - VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - // VirtualMachineSizeTypesStandardA8V2 ... - VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - // VirtualMachineSizeTypesStandardA9 ... - VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" - // VirtualMachineSizeTypesStandardB1ms ... - VirtualMachineSizeTypesStandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" - // VirtualMachineSizeTypesStandardB1s ... - VirtualMachineSizeTypesStandardB1s VirtualMachineSizeTypes = "Standard_B1s" - // VirtualMachineSizeTypesStandardB2ms ... - VirtualMachineSizeTypesStandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" - // VirtualMachineSizeTypesStandardB2s ... - VirtualMachineSizeTypesStandardB2s VirtualMachineSizeTypes = "Standard_B2s" - // VirtualMachineSizeTypesStandardB4ms ... - VirtualMachineSizeTypesStandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" - // VirtualMachineSizeTypesStandardB8ms ... - VirtualMachineSizeTypesStandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" - // VirtualMachineSizeTypesStandardD1 ... - VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" - // VirtualMachineSizeTypesStandardD11 ... - VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" - // VirtualMachineSizeTypesStandardD11V2 ... - VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - // VirtualMachineSizeTypesStandardD12 ... - VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" - // VirtualMachineSizeTypesStandardD12V2 ... - VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - // VirtualMachineSizeTypesStandardD13 ... - VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" - // VirtualMachineSizeTypesStandardD13V2 ... - VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - // VirtualMachineSizeTypesStandardD14 ... - VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" - // VirtualMachineSizeTypesStandardD14V2 ... - VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - // VirtualMachineSizeTypesStandardD15V2 ... - VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - // VirtualMachineSizeTypesStandardD16sV3 ... - VirtualMachineSizeTypesStandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - // VirtualMachineSizeTypesStandardD16V3 ... - VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - // VirtualMachineSizeTypesStandardD1V2 ... - VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - // VirtualMachineSizeTypesStandardD2 ... - VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" - // VirtualMachineSizeTypesStandardD2sV3 ... - VirtualMachineSizeTypesStandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - // VirtualMachineSizeTypesStandardD2V2 ... - VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - // VirtualMachineSizeTypesStandardD2V3 ... - VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - // VirtualMachineSizeTypesStandardD3 ... - VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" - // VirtualMachineSizeTypesStandardD32sV3 ... - VirtualMachineSizeTypesStandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - // VirtualMachineSizeTypesStandardD32V3 ... - VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - // VirtualMachineSizeTypesStandardD3V2 ... - VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - // VirtualMachineSizeTypesStandardD4 ... - VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" - // VirtualMachineSizeTypesStandardD4sV3 ... - VirtualMachineSizeTypesStandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - // VirtualMachineSizeTypesStandardD4V2 ... - VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - // VirtualMachineSizeTypesStandardD4V3 ... - VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - // VirtualMachineSizeTypesStandardD5V2 ... - VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - // VirtualMachineSizeTypesStandardD64sV3 ... - VirtualMachineSizeTypesStandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - // VirtualMachineSizeTypesStandardD64V3 ... - VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - // VirtualMachineSizeTypesStandardD8sV3 ... - VirtualMachineSizeTypesStandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - // VirtualMachineSizeTypesStandardD8V3 ... - VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - // VirtualMachineSizeTypesStandardDS1 ... - VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - // VirtualMachineSizeTypesStandardDS11 ... - VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - // VirtualMachineSizeTypesStandardDS11V2 ... - VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - // VirtualMachineSizeTypesStandardDS12 ... - VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - // VirtualMachineSizeTypesStandardDS12V2 ... - VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - // VirtualMachineSizeTypesStandardDS13 ... - VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - // VirtualMachineSizeTypesStandardDS132V2 ... - VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - // VirtualMachineSizeTypesStandardDS134V2 ... - VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - // VirtualMachineSizeTypesStandardDS13V2 ... - VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - // VirtualMachineSizeTypesStandardDS14 ... - VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - // VirtualMachineSizeTypesStandardDS144V2 ... - VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - // VirtualMachineSizeTypesStandardDS148V2 ... - VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - // VirtualMachineSizeTypesStandardDS14V2 ... - VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - // VirtualMachineSizeTypesStandardDS15V2 ... - VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - // VirtualMachineSizeTypesStandardDS1V2 ... - VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - // VirtualMachineSizeTypesStandardDS2 ... - VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - // VirtualMachineSizeTypesStandardDS2V2 ... - VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - // VirtualMachineSizeTypesStandardDS3 ... - VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - // VirtualMachineSizeTypesStandardDS3V2 ... - VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - // VirtualMachineSizeTypesStandardDS4 ... - VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - // VirtualMachineSizeTypesStandardDS4V2 ... - VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - // VirtualMachineSizeTypesStandardDS5V2 ... - VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - // VirtualMachineSizeTypesStandardE16sV3 ... - VirtualMachineSizeTypesStandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - // VirtualMachineSizeTypesStandardE16V3 ... - VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - // VirtualMachineSizeTypesStandardE2sV3 ... - VirtualMachineSizeTypesStandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - // VirtualMachineSizeTypesStandardE2V3 ... - VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - // VirtualMachineSizeTypesStandardE3216V3 ... - VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - // VirtualMachineSizeTypesStandardE328sV3 ... - VirtualMachineSizeTypesStandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - // VirtualMachineSizeTypesStandardE32sV3 ... - VirtualMachineSizeTypesStandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - // VirtualMachineSizeTypesStandardE32V3 ... - VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - // VirtualMachineSizeTypesStandardE4sV3 ... - VirtualMachineSizeTypesStandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - // VirtualMachineSizeTypesStandardE4V3 ... - VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - // VirtualMachineSizeTypesStandardE6416sV3 ... - VirtualMachineSizeTypesStandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - // VirtualMachineSizeTypesStandardE6432sV3 ... - VirtualMachineSizeTypesStandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - // VirtualMachineSizeTypesStandardE64sV3 ... - VirtualMachineSizeTypesStandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - // VirtualMachineSizeTypesStandardE64V3 ... - VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - // VirtualMachineSizeTypesStandardE8sV3 ... - VirtualMachineSizeTypesStandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - // VirtualMachineSizeTypesStandardE8V3 ... - VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - // VirtualMachineSizeTypesStandardF1 ... - VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" - // VirtualMachineSizeTypesStandardF16 ... - VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" - // VirtualMachineSizeTypesStandardF16s ... - VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" - // VirtualMachineSizeTypesStandardF16sV2 ... - VirtualMachineSizeTypesStandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - // VirtualMachineSizeTypesStandardF1s ... - VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" - // VirtualMachineSizeTypesStandardF2 ... - VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" - // VirtualMachineSizeTypesStandardF2s ... - VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" - // VirtualMachineSizeTypesStandardF2sV2 ... - VirtualMachineSizeTypesStandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - // VirtualMachineSizeTypesStandardF32sV2 ... - VirtualMachineSizeTypesStandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - // VirtualMachineSizeTypesStandardF4 ... - VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" - // VirtualMachineSizeTypesStandardF4s ... - VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" - // VirtualMachineSizeTypesStandardF4sV2 ... - VirtualMachineSizeTypesStandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - // VirtualMachineSizeTypesStandardF64sV2 ... - VirtualMachineSizeTypesStandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - // VirtualMachineSizeTypesStandardF72sV2 ... - VirtualMachineSizeTypesStandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - // VirtualMachineSizeTypesStandardF8 ... - VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" - // VirtualMachineSizeTypesStandardF8s ... - VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" - // VirtualMachineSizeTypesStandardF8sV2 ... - VirtualMachineSizeTypesStandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - // VirtualMachineSizeTypesStandardG1 ... - VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" - // VirtualMachineSizeTypesStandardG2 ... - VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" - // VirtualMachineSizeTypesStandardG3 ... - VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" - // VirtualMachineSizeTypesStandardG4 ... - VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" - // VirtualMachineSizeTypesStandardG5 ... - VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" - // VirtualMachineSizeTypesStandardGS1 ... - VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - // VirtualMachineSizeTypesStandardGS2 ... - VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - // VirtualMachineSizeTypesStandardGS3 ... - VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - // VirtualMachineSizeTypesStandardGS4 ... - VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - // VirtualMachineSizeTypesStandardGS44 ... - VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - // VirtualMachineSizeTypesStandardGS48 ... - VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - // VirtualMachineSizeTypesStandardGS5 ... - VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - // VirtualMachineSizeTypesStandardGS516 ... - VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - // VirtualMachineSizeTypesStandardGS58 ... - VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - // VirtualMachineSizeTypesStandardH16 ... - VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" - // VirtualMachineSizeTypesStandardH16m ... - VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" - // VirtualMachineSizeTypesStandardH16mr ... - VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" - // VirtualMachineSizeTypesStandardH16r ... - VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" - // VirtualMachineSizeTypesStandardH8 ... - VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" - // VirtualMachineSizeTypesStandardH8m ... - VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" - // VirtualMachineSizeTypesStandardL16s ... - VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" - // VirtualMachineSizeTypesStandardL32s ... - VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" - // VirtualMachineSizeTypesStandardL4s ... - VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" - // VirtualMachineSizeTypesStandardL8s ... - VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" - // VirtualMachineSizeTypesStandardM12832ms ... - VirtualMachineSizeTypesStandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" - // VirtualMachineSizeTypesStandardM12864ms ... - VirtualMachineSizeTypesStandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" - // VirtualMachineSizeTypesStandardM128ms ... - VirtualMachineSizeTypesStandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" - // VirtualMachineSizeTypesStandardM128s ... - VirtualMachineSizeTypesStandardM128s VirtualMachineSizeTypes = "Standard_M128s" - // VirtualMachineSizeTypesStandardM6416ms ... - VirtualMachineSizeTypesStandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" - // VirtualMachineSizeTypesStandardM6432ms ... - VirtualMachineSizeTypesStandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" - // VirtualMachineSizeTypesStandardM64ms ... - VirtualMachineSizeTypesStandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" - // VirtualMachineSizeTypesStandardM64s ... - VirtualMachineSizeTypesStandardM64s VirtualMachineSizeTypes = "Standard_M64s" - // VirtualMachineSizeTypesStandardNC12 ... - VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - // VirtualMachineSizeTypesStandardNC12sV2 ... - VirtualMachineSizeTypesStandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - // VirtualMachineSizeTypesStandardNC12sV3 ... - VirtualMachineSizeTypesStandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - // VirtualMachineSizeTypesStandardNC24 ... - VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - // VirtualMachineSizeTypesStandardNC24r ... - VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" - // VirtualMachineSizeTypesStandardNC24rsV2 ... - VirtualMachineSizeTypesStandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - // VirtualMachineSizeTypesStandardNC24rsV3 ... - VirtualMachineSizeTypesStandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - // VirtualMachineSizeTypesStandardNC24sV2 ... - VirtualMachineSizeTypesStandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - // VirtualMachineSizeTypesStandardNC24sV3 ... - VirtualMachineSizeTypesStandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - // VirtualMachineSizeTypesStandardNC6 ... - VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - // VirtualMachineSizeTypesStandardNC6sV2 ... - VirtualMachineSizeTypesStandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - // VirtualMachineSizeTypesStandardNC6sV3 ... - VirtualMachineSizeTypesStandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - // VirtualMachineSizeTypesStandardND12s ... - VirtualMachineSizeTypesStandardND12s VirtualMachineSizeTypes = "Standard_ND12s" - // VirtualMachineSizeTypesStandardND24rs ... - VirtualMachineSizeTypesStandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" - // VirtualMachineSizeTypesStandardND24s ... - VirtualMachineSizeTypesStandardND24s VirtualMachineSizeTypes = "Standard_ND24s" - // VirtualMachineSizeTypesStandardND6s ... - VirtualMachineSizeTypesStandardND6s VirtualMachineSizeTypes = "Standard_ND6s" - // VirtualMachineSizeTypesStandardNV12 ... - VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - // VirtualMachineSizeTypesStandardNV24 ... - VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - // VirtualMachineSizeTypesStandardNV6 ... - VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" -) - -// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. -func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { - return []VirtualMachineSizeTypes{VirtualMachineSizeTypesBasicA0, VirtualMachineSizeTypesBasicA1, VirtualMachineSizeTypesBasicA2, VirtualMachineSizeTypesBasicA3, VirtualMachineSizeTypesBasicA4, VirtualMachineSizeTypesStandardA0, VirtualMachineSizeTypesStandardA1, VirtualMachineSizeTypesStandardA10, VirtualMachineSizeTypesStandardA11, VirtualMachineSizeTypesStandardA1V2, VirtualMachineSizeTypesStandardA2, VirtualMachineSizeTypesStandardA2mV2, VirtualMachineSizeTypesStandardA2V2, VirtualMachineSizeTypesStandardA3, VirtualMachineSizeTypesStandardA4, VirtualMachineSizeTypesStandardA4mV2, VirtualMachineSizeTypesStandardA4V2, VirtualMachineSizeTypesStandardA5, VirtualMachineSizeTypesStandardA6, VirtualMachineSizeTypesStandardA7, VirtualMachineSizeTypesStandardA8, VirtualMachineSizeTypesStandardA8mV2, VirtualMachineSizeTypesStandardA8V2, VirtualMachineSizeTypesStandardA9, VirtualMachineSizeTypesStandardB1ms, VirtualMachineSizeTypesStandardB1s, VirtualMachineSizeTypesStandardB2ms, VirtualMachineSizeTypesStandardB2s, VirtualMachineSizeTypesStandardB4ms, VirtualMachineSizeTypesStandardB8ms, VirtualMachineSizeTypesStandardD1, VirtualMachineSizeTypesStandardD11, VirtualMachineSizeTypesStandardD11V2, VirtualMachineSizeTypesStandardD12, VirtualMachineSizeTypesStandardD12V2, VirtualMachineSizeTypesStandardD13, VirtualMachineSizeTypesStandardD13V2, VirtualMachineSizeTypesStandardD14, VirtualMachineSizeTypesStandardD14V2, VirtualMachineSizeTypesStandardD15V2, VirtualMachineSizeTypesStandardD16sV3, VirtualMachineSizeTypesStandardD16V3, VirtualMachineSizeTypesStandardD1V2, VirtualMachineSizeTypesStandardD2, VirtualMachineSizeTypesStandardD2sV3, VirtualMachineSizeTypesStandardD2V2, VirtualMachineSizeTypesStandardD2V3, VirtualMachineSizeTypesStandardD3, VirtualMachineSizeTypesStandardD32sV3, VirtualMachineSizeTypesStandardD32V3, VirtualMachineSizeTypesStandardD3V2, VirtualMachineSizeTypesStandardD4, VirtualMachineSizeTypesStandardD4sV3, VirtualMachineSizeTypesStandardD4V2, VirtualMachineSizeTypesStandardD4V3, VirtualMachineSizeTypesStandardD5V2, VirtualMachineSizeTypesStandardD64sV3, VirtualMachineSizeTypesStandardD64V3, VirtualMachineSizeTypesStandardD8sV3, VirtualMachineSizeTypesStandardD8V3, VirtualMachineSizeTypesStandardDS1, VirtualMachineSizeTypesStandardDS11, VirtualMachineSizeTypesStandardDS11V2, VirtualMachineSizeTypesStandardDS12, VirtualMachineSizeTypesStandardDS12V2, VirtualMachineSizeTypesStandardDS13, VirtualMachineSizeTypesStandardDS132V2, VirtualMachineSizeTypesStandardDS134V2, VirtualMachineSizeTypesStandardDS13V2, VirtualMachineSizeTypesStandardDS14, VirtualMachineSizeTypesStandardDS144V2, VirtualMachineSizeTypesStandardDS148V2, VirtualMachineSizeTypesStandardDS14V2, VirtualMachineSizeTypesStandardDS15V2, VirtualMachineSizeTypesStandardDS1V2, VirtualMachineSizeTypesStandardDS2, VirtualMachineSizeTypesStandardDS2V2, VirtualMachineSizeTypesStandardDS3, VirtualMachineSizeTypesStandardDS3V2, VirtualMachineSizeTypesStandardDS4, VirtualMachineSizeTypesStandardDS4V2, VirtualMachineSizeTypesStandardDS5V2, VirtualMachineSizeTypesStandardE16sV3, VirtualMachineSizeTypesStandardE16V3, VirtualMachineSizeTypesStandardE2sV3, VirtualMachineSizeTypesStandardE2V3, VirtualMachineSizeTypesStandardE3216V3, VirtualMachineSizeTypesStandardE328sV3, VirtualMachineSizeTypesStandardE32sV3, VirtualMachineSizeTypesStandardE32V3, VirtualMachineSizeTypesStandardE4sV3, VirtualMachineSizeTypesStandardE4V3, VirtualMachineSizeTypesStandardE6416sV3, VirtualMachineSizeTypesStandardE6432sV3, VirtualMachineSizeTypesStandardE64sV3, VirtualMachineSizeTypesStandardE64V3, VirtualMachineSizeTypesStandardE8sV3, VirtualMachineSizeTypesStandardE8V3, VirtualMachineSizeTypesStandardF1, VirtualMachineSizeTypesStandardF16, VirtualMachineSizeTypesStandardF16s, VirtualMachineSizeTypesStandardF16sV2, VirtualMachineSizeTypesStandardF1s, VirtualMachineSizeTypesStandardF2, VirtualMachineSizeTypesStandardF2s, VirtualMachineSizeTypesStandardF2sV2, VirtualMachineSizeTypesStandardF32sV2, VirtualMachineSizeTypesStandardF4, VirtualMachineSizeTypesStandardF4s, VirtualMachineSizeTypesStandardF4sV2, VirtualMachineSizeTypesStandardF64sV2, VirtualMachineSizeTypesStandardF72sV2, VirtualMachineSizeTypesStandardF8, VirtualMachineSizeTypesStandardF8s, VirtualMachineSizeTypesStandardF8sV2, VirtualMachineSizeTypesStandardG1, VirtualMachineSizeTypesStandardG2, VirtualMachineSizeTypesStandardG3, VirtualMachineSizeTypesStandardG4, VirtualMachineSizeTypesStandardG5, VirtualMachineSizeTypesStandardGS1, VirtualMachineSizeTypesStandardGS2, VirtualMachineSizeTypesStandardGS3, VirtualMachineSizeTypesStandardGS4, VirtualMachineSizeTypesStandardGS44, VirtualMachineSizeTypesStandardGS48, VirtualMachineSizeTypesStandardGS5, VirtualMachineSizeTypesStandardGS516, VirtualMachineSizeTypesStandardGS58, VirtualMachineSizeTypesStandardH16, VirtualMachineSizeTypesStandardH16m, VirtualMachineSizeTypesStandardH16mr, VirtualMachineSizeTypesStandardH16r, VirtualMachineSizeTypesStandardH8, VirtualMachineSizeTypesStandardH8m, VirtualMachineSizeTypesStandardL16s, VirtualMachineSizeTypesStandardL32s, VirtualMachineSizeTypesStandardL4s, VirtualMachineSizeTypesStandardL8s, VirtualMachineSizeTypesStandardM12832ms, VirtualMachineSizeTypesStandardM12864ms, VirtualMachineSizeTypesStandardM128ms, VirtualMachineSizeTypesStandardM128s, VirtualMachineSizeTypesStandardM6416ms, VirtualMachineSizeTypesStandardM6432ms, VirtualMachineSizeTypesStandardM64ms, VirtualMachineSizeTypesStandardM64s, VirtualMachineSizeTypesStandardNC12, VirtualMachineSizeTypesStandardNC12sV2, VirtualMachineSizeTypesStandardNC12sV3, VirtualMachineSizeTypesStandardNC24, VirtualMachineSizeTypesStandardNC24r, VirtualMachineSizeTypesStandardNC24rsV2, VirtualMachineSizeTypesStandardNC24rsV3, VirtualMachineSizeTypesStandardNC24sV2, VirtualMachineSizeTypesStandardNC24sV3, VirtualMachineSizeTypesStandardNC6, VirtualMachineSizeTypesStandardNC6sV2, VirtualMachineSizeTypesStandardNC6sV3, VirtualMachineSizeTypesStandardND12s, VirtualMachineSizeTypesStandardND24rs, VirtualMachineSizeTypesStandardND24s, VirtualMachineSizeTypesStandardND6s, VirtualMachineSizeTypesStandardNV12, VirtualMachineSizeTypesStandardNV24, VirtualMachineSizeTypesStandardNV6} -} - // AccessURI a disk access SAS uri. type AccessURI struct { autorest.Response `json:"-"` @@ -1698,10 +301,15 @@ func (aslr AvailabilitySetListResult) IsEmpty() bool { return aslr.Value == nil || len(*aslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (aslr AvailabilitySetListResult) hasNextLink() bool { + return aslr.NextLink != nil && len(*aslr.NextLink) != 0 +} + // availabilitySetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { - if aslr.NextLink == nil || len(to.String(aslr.NextLink)) < 1 { + if !aslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1729,11 +337,16 @@ func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.aslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.aslr) + if err != nil { + return err + } + page.aslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.aslr = next return nil } @@ -1763,8 +376,11 @@ func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { } // Creates a new instance of the AvailabilitySetListResultPage type. -func NewAvailabilitySetListResultPage(getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { - return AvailabilitySetListResultPage{fn: getNextPage} +func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { + return AvailabilitySetListResultPage{ + fn: getNextPage, + aslr: cur, + } } // AvailabilitySetProperties the instance view of a resource. @@ -1781,6 +397,24 @@ type AvailabilitySetProperties struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } +// MarshalJSON is the custom marshaler for AvailabilitySetProperties. +func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.PlatformUpdateDomainCount != nil { + objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount + } + if asp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount + } + if asp.VirtualMachines != nil { + objectMap["virtualMachines"] = asp.VirtualMachines + } + if asp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup + } + return json.Marshal(objectMap) +} + // AvailabilitySetUpdate specifies information about the availability set that the virtual machine should // be assigned to. Only tags may be updated. type AvailabilitySetUpdate struct { @@ -1994,6 +628,24 @@ type ContainerServiceAgentPoolProfile struct { Fqdn *string `json:"fqdn,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. +func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csapp.Name != nil { + objectMap["name"] = csapp.Name + } + if csapp.Count != nil { + objectMap["count"] = csapp.Count + } + if csapp.VMSize != "" { + objectMap["vmSize"] = csapp.VMSize + } + if csapp.DNSPrefix != nil { + objectMap["dnsPrefix"] = csapp.DNSPrefix + } + return json.Marshal(objectMap) +} + // ContainerServiceCustomProfile properties to configure a custom container service cluster. type ContainerServiceCustomProfile struct { // Orchestrator - The name of the custom orchestrator to use. @@ -2091,10 +743,15 @@ func (cslr ContainerServiceListResult) IsEmpty() bool { return cslr.Value == nil || len(*cslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (cslr ContainerServiceListResult) hasNextLink() bool { + return cslr.NextLink != nil && len(*cslr.NextLink) != 0 +} + // containerServiceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if cslr.NextLink == nil || len(to.String(cslr.NextLink)) < 1 { + if !cslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2122,11 +779,16 @@ func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.cslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.cslr) + if err != nil { + return err + } + page.cslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.cslr = next return nil } @@ -2156,8 +818,11 @@ func (page ContainerServiceListResultPage) Values() []ContainerService { } // Creates a new instance of the ContainerServiceListResultPage type. -func NewContainerServiceListResultPage(getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { - return ContainerServiceListResultPage{fn: getNextPage} +func NewContainerServiceListResultPage(cur ContainerServiceListResult, getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { + return ContainerServiceListResultPage{ + fn: getNextPage, + cslr: cur, + } } // ContainerServiceMasterProfile profile for the container service master. @@ -2170,6 +835,18 @@ type ContainerServiceMasterProfile struct { Fqdn *string `json:"fqdn,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. +func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csmp.Count != nil { + objectMap["count"] = csmp.Count + } + if csmp.DNSPrefix != nil { + objectMap["dnsPrefix"] = csmp.DNSPrefix + } + return json.Marshal(objectMap) +} + // ContainerServiceOrchestratorProfile profile for the container service orchestrator. type ContainerServiceOrchestratorProfile struct { // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' @@ -2198,15 +875,58 @@ type ContainerServiceProperties struct { DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceProperties. +func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csp.OrchestratorProfile != nil { + objectMap["orchestratorProfile"] = csp.OrchestratorProfile + } + if csp.CustomProfile != nil { + objectMap["customProfile"] = csp.CustomProfile + } + if csp.ServicePrincipalProfile != nil { + objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile + } + if csp.MasterProfile != nil { + objectMap["masterProfile"] = csp.MasterProfile + } + if csp.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles + } + if csp.WindowsProfile != nil { + objectMap["windowsProfile"] = csp.WindowsProfile + } + if csp.LinuxProfile != nil { + objectMap["linuxProfile"] = csp.LinuxProfile + } + if csp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile + } + return json.Marshal(objectMap) +} + // ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ContainerServicesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerServicesClient) (ContainerService, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ContainerServicesCreateOrUpdateFuture) Result(client ContainerServicesClient) (cs ContainerService, err error) { +// result is the default implementation for ContainerServicesCreateOrUpdateFuture.Result. +func (future *ContainerServicesCreateOrUpdateFuture) result(client ContainerServicesClient) (cs ContainerService, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2230,12 +950,25 @@ func (future *ContainerServicesCreateOrUpdateFuture) Result(client ContainerServ // ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ContainerServicesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerServicesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ContainerServicesDeleteFuture) Result(client ContainerServicesClient) (ar autorest.Response, err error) { +// result is the default implementation for ContainerServicesDeleteFuture.Result. +func (future *ContainerServicesDeleteFuture) result(client ContainerServicesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2279,6 +1012,15 @@ type ContainerServiceVMDiagnostics struct { StorageURI *string `json:"storageUri,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. +func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csvd.Enabled != nil { + objectMap["enabled"] = csvd.Enabled + } + return json.Marshal(objectMap) +} + // ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. type ContainerServiceWindowsProfile struct { // AdminUsername - The administrator username to use for Windows VMs. @@ -2307,6 +1049,33 @@ type CreationData struct { UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` } +// MarshalJSON is the custom marshaler for CreationData. +func (cd CreationData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cd.CreateOption != "" { + objectMap["createOption"] = cd.CreateOption + } + if cd.StorageAccountID != nil { + objectMap["storageAccountId"] = cd.StorageAccountID + } + if cd.ImageReference != nil { + objectMap["imageReference"] = cd.ImageReference + } + if cd.GalleryImageReference != nil { + objectMap["galleryImageReference"] = cd.GalleryImageReference + } + if cd.SourceURI != nil { + objectMap["sourceUri"] = cd.SourceURI + } + if cd.SourceResourceID != nil { + objectMap["sourceResourceId"] = cd.SourceResourceID + } + if cd.UploadSizeBytes != nil { + objectMap["uploadSizeBytes"] = cd.UploadSizeBytes + } + return json.Marshal(objectMap) +} + // DataDisk describes a data disk. type DataDisk struct { // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. @@ -2335,6 +1104,42 @@ type DataDisk struct { DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` } +// MarshalJSON is the custom marshaler for DataDisk. +func (dd DataDisk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dd.Lun != nil { + objectMap["lun"] = dd.Lun + } + if dd.Name != nil { + objectMap["name"] = dd.Name + } + if dd.Vhd != nil { + objectMap["vhd"] = dd.Vhd + } + if dd.Image != nil { + objectMap["image"] = dd.Image + } + if dd.Caching != "" { + objectMap["caching"] = dd.Caching + } + if dd.WriteAcceleratorEnabled != nil { + objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled + } + if dd.CreateOption != "" { + objectMap["createOption"] = dd.CreateOption + } + if dd.DiskSizeGB != nil { + objectMap["diskSizeGB"] = dd.DiskSizeGB + } + if dd.ManagedDisk != nil { + objectMap["managedDisk"] = dd.ManagedDisk + } + if dd.ToBeDetached != nil { + objectMap["toBeDetached"] = dd.ToBeDetached + } + return json.Marshal(objectMap) +} + // DataDiskImage contains the data disk images information. type DataDiskImage struct { // Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. @@ -2671,10 +1476,15 @@ func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { return dhglr.Value == nil || len(*dhglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { + return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 +} + // dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if dhglr.NextLink == nil || len(to.String(dhglr.NextLink)) < 1 { + if !dhglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2702,11 +1512,16 @@ func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dhglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dhglr) + if err != nil { + return err + } + page.dhglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dhglr = next return nil } @@ -2736,8 +1551,11 @@ func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { } // Creates a new instance of the DedicatedHostGroupListResultPage type. -func NewDedicatedHostGroupListResultPage(getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { - return DedicatedHostGroupListResultPage{fn: getNextPage} +func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { + return DedicatedHostGroupListResultPage{ + fn: getNextPage, + dhglr: cur, + } } // DedicatedHostGroupProperties dedicated Host Group Properties. @@ -2748,6 +1566,15 @@ type DedicatedHostGroupProperties struct { Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` } +// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. +func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhgp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount + } + return json.Marshal(objectMap) +} + // DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host // should be assigned to. Only tags may be updated. type DedicatedHostGroupUpdate struct { @@ -2825,6 +1652,18 @@ type DedicatedHostInstanceView struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } +// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. +func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhiv.AvailableCapacity != nil { + objectMap["availableCapacity"] = dhiv.AvailableCapacity + } + if dhiv.Statuses != nil { + objectMap["statuses"] = dhiv.Statuses + } + return json.Marshal(objectMap) +} + // DedicatedHostListResult the list dedicated host operation response. type DedicatedHostListResult struct { autorest.Response `json:"-"` @@ -2902,10 +1741,15 @@ func (dhlr DedicatedHostListResult) IsEmpty() bool { return dhlr.Value == nil || len(*dhlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dhlr DedicatedHostListResult) hasNextLink() bool { + return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 +} + // dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { - if dhlr.NextLink == nil || len(to.String(dhlr.NextLink)) < 1 { + if !dhlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2933,11 +1777,16 @@ func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dhlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dhlr) + if err != nil { + return err + } + page.dhlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dhlr = next return nil } @@ -2967,8 +1816,11 @@ func (page DedicatedHostListResultPage) Values() []DedicatedHost { } // Creates a new instance of the DedicatedHostListResultPage type. -func NewDedicatedHostListResultPage(getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { - return DedicatedHostListResultPage{fn: getNextPage} +func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { + return DedicatedHostListResultPage{ + fn: getNextPage, + dhlr: cur, + } } // DedicatedHostProperties properties of the dedicated host. @@ -2991,15 +1843,43 @@ type DedicatedHostProperties struct { InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` } +// MarshalJSON is the custom marshaler for DedicatedHostProperties. +func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhp.PlatformFaultDomain != nil { + objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain + } + if dhp.AutoReplaceOnFailure != nil { + objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure + } + if dhp.LicenseType != "" { + objectMap["licenseType"] = dhp.LicenseType + } + return json.Marshal(objectMap) +} + // DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DedicatedHostsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DedicatedHostsClient) (DedicatedHost, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DedicatedHostsCreateOrUpdateFuture) Result(client DedicatedHostsClient) (dh DedicatedHost, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. +func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3023,12 +1903,25 @@ func (future *DedicatedHostsCreateOrUpdateFuture) Result(client DedicatedHostsCl // DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DedicatedHostsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DedicatedHostsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DedicatedHostsDeleteFuture) Result(client DedicatedHostsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DedicatedHostsDeleteFuture.Result. +func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3046,12 +1939,25 @@ func (future *DedicatedHostsDeleteFuture) Result(client DedicatedHostsClient) (a // DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DedicatedHostsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DedicatedHostsClient) (DedicatedHost, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DedicatedHostsUpdateFuture) Result(client DedicatedHostsClient) (dh DedicatedHost, err error) { +// result is the default implementation for DedicatedHostsUpdateFuture.Result. +func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3486,10 +2392,15 @@ func (desl DiskEncryptionSetList) IsEmpty() bool { return desl.Value == nil || len(*desl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (desl DiskEncryptionSetList) hasNextLink() bool { + return desl.NextLink != nil && len(*desl.NextLink) != 0 +} + // diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { - if desl.NextLink == nil || len(to.String(desl.NextLink)) < 1 { + if !desl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3517,11 +2428,16 @@ func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.desl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.desl) + if err != nil { + return err + } + page.desl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.desl = next return nil } @@ -3551,8 +2467,11 @@ func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { } // Creates a new instance of the DiskEncryptionSetListPage type. -func NewDiskEncryptionSetListPage(getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { - return DiskEncryptionSetListPage{fn: getNextPage} +func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { + return DiskEncryptionSetListPage{ + fn: getNextPage, + desl: cur, + } } // DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id @@ -3566,12 +2485,25 @@ type DiskEncryptionSetParameters struct { // DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DiskEncryptionSetsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DiskEncryptionSetsCreateOrUpdateFuture) Result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { +// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. +func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3595,12 +2527,25 @@ func (future *DiskEncryptionSetsCreateOrUpdateFuture) Result(client DiskEncrypti // DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DiskEncryptionSetsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskEncryptionSetsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DiskEncryptionSetsDeleteFuture) Result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. +func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3618,12 +2563,25 @@ func (future *DiskEncryptionSetsDeleteFuture) Result(client DiskEncryptionSetsCl // DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DiskEncryptionSetsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DiskEncryptionSetsUpdateFuture) Result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. +func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3804,10 +2762,15 @@ func (dl DiskList) IsEmpty() bool { return dl.Value == nil || len(*dl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dl DiskList) hasNextLink() bool { + return dl.NextLink != nil && len(*dl.NextLink) != 0 +} + // diskListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { - if dl.NextLink == nil || len(to.String(dl.NextLink)) < 1 { + if !dl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3835,11 +2798,16 @@ func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dl) + if err != nil { + return err + } + page.dl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dl = next return nil } @@ -3869,8 +2837,11 @@ func (page DiskListPage) Values() []Disk { } // Creates a new instance of the DiskListPage type. -func NewDiskListPage(getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { - return DiskListPage{fn: getNextPage} +func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { + return DiskListPage{ + fn: getNextPage, + dl: cur, + } } // DiskProperties disk resource properties. @@ -3911,15 +2882,67 @@ type DiskProperties struct { ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` } +// MarshalJSON is the custom marshaler for DiskProperties. +func (dp DiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.OsType != "" { + objectMap["osType"] = dp.OsType + } + if dp.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = dp.HyperVGeneration + } + if dp.CreationData != nil { + objectMap["creationData"] = dp.CreationData + } + if dp.DiskSizeGB != nil { + objectMap["diskSizeGB"] = dp.DiskSizeGB + } + if dp.EncryptionSettingsCollection != nil { + objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection + } + if dp.DiskIOPSReadWrite != nil { + objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite + } + if dp.DiskMBpsReadWrite != nil { + objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite + } + if dp.DiskIOPSReadOnly != nil { + objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly + } + if dp.DiskMBpsReadOnly != nil { + objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly + } + if dp.Encryption != nil { + objectMap["encryption"] = dp.Encryption + } + if dp.MaxShares != nil { + objectMap["maxShares"] = dp.MaxShares + } + return json.Marshal(objectMap) +} + // DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DisksCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (Disk, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DisksCreateOrUpdateFuture) Result(client DisksClient) (d Disk, err error) { +// result is the default implementation for DisksCreateOrUpdateFuture.Result. +func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3942,12 +2965,25 @@ func (future *DisksCreateOrUpdateFuture) Result(client DisksClient) (d Disk, err // DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type DisksDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DisksDeleteFuture) Result(client DisksClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DisksDeleteFuture.Result. +func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3965,12 +3001,25 @@ func (future *DisksDeleteFuture) Result(client DisksClient) (ar autorest.Respons // DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DisksGrantAccessFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (AccessURI, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DisksGrantAccessFuture) Result(client DisksClient) (au AccessURI, err error) { +// result is the default implementation for DisksGrantAccessFuture.Result. +func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3999,15 +3048,37 @@ type DiskSku struct { Tier *string `json:"tier,omitempty"` } +// MarshalJSON is the custom marshaler for DiskSku. +func (ds DiskSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ds.Name != "" { + objectMap["name"] = ds.Name + } + return json.Marshal(objectMap) +} + // DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DisksRevokeAccessFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DisksRevokeAccessFuture) Result(client DisksClient) (ar autorest.Response, err error) { +// result is the default implementation for DisksRevokeAccessFuture.Result. +func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4024,12 +3095,25 @@ func (future *DisksRevokeAccessFuture) Result(client DisksClient) (ar autorest.R // DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type DisksUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (Disk, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DisksUpdateFuture) Result(client DisksClient) (d Disk, err error) { +// result is the default implementation for DisksUpdateFuture.Result. +func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4164,6 +3248,15 @@ type EncryptionSetIdentity struct { TenantID *string `json:"tenantId,omitempty"` } +// MarshalJSON is the custom marshaler for EncryptionSetIdentity. +func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esi.Type != "" { + objectMap["type"] = esi.Type + } + return json.Marshal(objectMap) +} + // EncryptionSetProperties ... type EncryptionSetProperties struct { // ActiveKey - The key vault key which is currently used by this disk encryption set. @@ -4174,6 +3267,15 @@ type EncryptionSetProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for EncryptionSetProperties. +func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esp.ActiveKey != nil { + objectMap["activeKey"] = esp.ActiveKey + } + return json.Marshal(objectMap) +} + // EncryptionSettingsCollection encryption settings for disk or snapshot type EncryptionSettingsCollection struct { // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. @@ -4195,12 +3297,25 @@ type EncryptionSettingsElement struct { // GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type GalleriesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleriesClient) (Gallery, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleriesCreateOrUpdateFuture) Result(client GalleriesClient) (g Gallery, err error) { +// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. +func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4224,12 +3339,25 @@ func (future *GalleriesCreateOrUpdateFuture) Result(client GalleriesClient) (g G // GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type GalleriesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleriesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleriesDeleteFuture) Result(client GalleriesClient) (ar autorest.Response, err error) { +// result is the default implementation for GalleriesDeleteFuture.Result. +func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4247,12 +3375,25 @@ func (future *GalleriesDeleteFuture) Result(client GalleriesClient) (ar autorest // GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type GalleriesUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleriesClient) (Gallery, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleriesUpdateFuture) Result(client GalleriesClient) (g Gallery, err error) { +// result is the default implementation for GalleriesUpdateFuture.Result. +func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4551,10 +3692,15 @@ func (gal GalleryApplicationList) IsEmpty() bool { return gal.Value == nil || len(*gal.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gal GalleryApplicationList) hasNextLink() bool { + return gal.NextLink != nil && len(*gal.NextLink) != 0 +} + // galleryApplicationListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { - if gal.NextLink == nil || len(to.String(gal.NextLink)) < 1 { + if !gal.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -4582,11 +3728,16 @@ func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gal) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gal) + if err != nil { + return err + } + page.gal = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gal = next return nil } @@ -4616,8 +3767,11 @@ func (page GalleryApplicationListPage) Values() []GalleryApplication { } // Creates a new instance of the GalleryApplicationListPage type. -func NewGalleryApplicationListPage(getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { - return GalleryApplicationListPage{fn: getNextPage} +func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { + return GalleryApplicationListPage{ + fn: getNextPage, + gal: cur, + } } // GalleryApplicationProperties describes the properties of a gallery Application Definition. @@ -4639,12 +3793,25 @@ type GalleryApplicationProperties struct { // GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryApplicationsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationsClient) (GalleryApplication, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryApplicationsCreateOrUpdateFuture) Result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { +// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. +func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4668,12 +3835,25 @@ func (future *GalleryApplicationsCreateOrUpdateFuture) Result(client GalleryAppl // GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryApplicationsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryApplicationsDeleteFuture) Result(client GalleryApplicationsClient) (ar autorest.Response, err error) { +// result is the default implementation for GalleryApplicationsDeleteFuture.Result. +func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4691,12 +3871,25 @@ func (future *GalleryApplicationsDeleteFuture) Result(client GalleryApplications // GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryApplicationsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationsClient) (GalleryApplication, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryApplicationsUpdateFuture) Result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { +// result is the default implementation for GalleryApplicationsUpdateFuture.Result. +func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4982,10 +4175,15 @@ func (gavl GalleryApplicationVersionList) IsEmpty() bool { return gavl.Value == nil || len(*gavl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gavl GalleryApplicationVersionList) hasNextLink() bool { + return gavl.NextLink != nil && len(*gavl.NextLink) != 0 +} + // galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { - if gavl.NextLink == nil || len(to.String(gavl.NextLink)) < 1 { + if !gavl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5013,11 +4211,16 @@ func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gavl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gavl) + if err != nil { + return err + } + page.gavl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gavl = next return nil } @@ -5047,8 +4250,11 @@ func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersi } // Creates a new instance of the GalleryApplicationVersionListPage type. -func NewGalleryApplicationVersionListPage(getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { - return GalleryApplicationVersionListPage{fn: getNextPage} +func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { + return GalleryApplicationVersionListPage{ + fn: getNextPage, + gavl: cur, + } } // GalleryApplicationVersionProperties describes the properties of a gallery Image Version. @@ -5060,6 +4266,15 @@ type GalleryApplicationVersionProperties struct { ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. +func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gavp.PublishingProfile != nil { + objectMap["publishingProfile"] = gavp.PublishingProfile + } + return json.Marshal(objectMap) +} + // GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. type GalleryApplicationVersionPublishingProfile struct { Source *UserArtifactSource `json:"source,omitempty"` @@ -5081,15 +4296,58 @@ type GalleryApplicationVersionPublishingProfile struct { StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. +func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gavpp.Source != nil { + objectMap["source"] = gavpp.Source + } + if gavpp.ContentType != nil { + objectMap["contentType"] = gavpp.ContentType + } + if gavpp.EnableHealthCheck != nil { + objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck + } + if gavpp.TargetRegions != nil { + objectMap["targetRegions"] = gavpp.TargetRegions + } + if gavpp.ReplicaCount != nil { + objectMap["replicaCount"] = gavpp.ReplicaCount + } + if gavpp.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest + } + if gavpp.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate + } + if gavpp.StorageAccountType != "" { + objectMap["storageAccountType"] = gavpp.StorageAccountType + } + return json.Marshal(objectMap) +} + // GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type GalleryApplicationVersionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryApplicationVersionsCreateOrUpdateFuture) Result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { +// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. +func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5113,12 +4371,25 @@ func (future *GalleryApplicationVersionsCreateOrUpdateFuture) Result(client Gall // GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryApplicationVersionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationVersionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryApplicationVersionsDeleteFuture) Result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { +// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. +func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5136,12 +4407,25 @@ func (future *GalleryApplicationVersionsDeleteFuture) Result(client GalleryAppli // GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryApplicationVersionsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryApplicationVersionsUpdateFuture) Result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { +// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. +func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5264,6 +4548,27 @@ type GalleryArtifactPublishingProfileBase struct { StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. +func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gappb.TargetRegions != nil { + objectMap["targetRegions"] = gappb.TargetRegions + } + if gappb.ReplicaCount != nil { + objectMap["replicaCount"] = gappb.ReplicaCount + } + if gappb.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest + } + if gappb.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gappb.EndOfLifeDate + } + if gappb.StorageAccountType != "" { + objectMap["storageAccountType"] = gappb.StorageAccountType + } + return json.Marshal(objectMap) +} + // GalleryArtifactSource the source image from which the Image Version is going to be created. type GalleryArtifactSource struct { ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` @@ -5286,6 +4591,21 @@ type GalleryDataDiskImage struct { Source *GalleryArtifactVersionSource `json:"source,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryDataDiskImage. +func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gddi.Lun != nil { + objectMap["lun"] = gddi.Lun + } + if gddi.HostCaching != "" { + objectMap["hostCaching"] = gddi.HostCaching + } + if gddi.Source != nil { + objectMap["source"] = gddi.Source + } + return json.Marshal(objectMap) +} + // GalleryDiskImage this is the disk image base class. type GalleryDiskImage struct { // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. @@ -5295,6 +4615,18 @@ type GalleryDiskImage struct { Source *GalleryArtifactVersionSource `json:"source,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryDiskImage. +func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdi.HostCaching != "" { + objectMap["hostCaching"] = gdi.HostCaching + } + if gdi.Source != nil { + objectMap["source"] = gdi.Source + } + return json.Marshal(objectMap) +} + // GalleryIdentifier describes the gallery unique name. type GalleryIdentifier struct { // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. @@ -5488,10 +4820,15 @@ func (gil GalleryImageList) IsEmpty() bool { return gil.Value == nil || len(*gil.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gil GalleryImageList) hasNextLink() bool { + return gil.NextLink != nil && len(*gil.NextLink) != 0 +} + // galleryImageListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if gil.NextLink == nil || len(to.String(gil.NextLink)) < 1 { + if !gil.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5519,11 +4856,16 @@ func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gil) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gil) + if err != nil { + return err + } + page.gil = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gil = next return nil } @@ -5553,8 +4895,11 @@ func (page GalleryImageListPage) Values() []GalleryImage { } // Creates a new instance of the GalleryImageListPage type. -func NewGalleryImageListPage(getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { - return GalleryImageListPage{fn: getNextPage} +func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { + return GalleryImageListPage{ + fn: getNextPage, + gil: cur, + } } // GalleryImageProperties describes the properties of a gallery Image Definition. @@ -5583,15 +4928,70 @@ type GalleryImageProperties struct { ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryImageProperties. +func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gip.Description != nil { + objectMap["description"] = gip.Description + } + if gip.Eula != nil { + objectMap["eula"] = gip.Eula + } + if gip.PrivacyStatementURI != nil { + objectMap["privacyStatementUri"] = gip.PrivacyStatementURI + } + if gip.ReleaseNoteURI != nil { + objectMap["releaseNoteUri"] = gip.ReleaseNoteURI + } + if gip.OsType != "" { + objectMap["osType"] = gip.OsType + } + if gip.OsState != "" { + objectMap["osState"] = gip.OsState + } + if gip.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = gip.HyperVGeneration + } + if gip.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gip.EndOfLifeDate + } + if gip.Identifier != nil { + objectMap["identifier"] = gip.Identifier + } + if gip.Recommended != nil { + objectMap["recommended"] = gip.Recommended + } + if gip.Disallowed != nil { + objectMap["disallowed"] = gip.Disallowed + } + if gip.PurchasePlan != nil { + objectMap["purchasePlan"] = gip.PurchasePlan + } + return json.Marshal(objectMap) +} + // GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryImagesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImagesClient) (GalleryImage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryImagesCreateOrUpdateFuture) Result(client GalleryImagesClient) (gi GalleryImage, err error) { +// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. +func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5615,12 +5015,25 @@ func (future *GalleryImagesCreateOrUpdateFuture) Result(client GalleryImagesClie // GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type GalleryImagesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImagesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryImagesDeleteFuture) Result(client GalleryImagesClient) (ar autorest.Response, err error) { +// result is the default implementation for GalleryImagesDeleteFuture.Result. +func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5638,12 +5051,25 @@ func (future *GalleryImagesDeleteFuture) Result(client GalleryImagesClient) (ar // GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type GalleryImagesUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImagesClient) (GalleryImage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryImagesUpdateFuture) Result(client GalleryImagesClient) (gi GalleryImage, err error) { +// result is the default implementation for GalleryImagesUpdateFuture.Result. +func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5927,10 +5353,15 @@ func (givl GalleryImageVersionList) IsEmpty() bool { return givl.Value == nil || len(*givl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (givl GalleryImageVersionList) hasNextLink() bool { + return givl.NextLink != nil && len(*givl.NextLink) != 0 +} + // galleryImageVersionListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if givl.NextLink == nil || len(to.String(givl.NextLink)) < 1 { + if !givl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5958,11 +5389,16 @@ func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.givl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.givl) + if err != nil { + return err + } + page.givl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.givl = next return nil } @@ -5992,8 +5428,11 @@ func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { } // Creates a new instance of the GalleryImageVersionListPage type. -func NewGalleryImageVersionListPage(getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { - return GalleryImageVersionListPage{fn: getNextPage} +func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { + return GalleryImageVersionListPage{ + fn: getNextPage, + givl: cur, + } } // GalleryImageVersionProperties describes the properties of a gallery Image Version. @@ -6006,6 +5445,18 @@ type GalleryImageVersionProperties struct { ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. +func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if givp.PublishingProfile != nil { + objectMap["publishingProfile"] = givp.PublishingProfile + } + if givp.StorageProfile != nil { + objectMap["storageProfile"] = givp.StorageProfile + } + return json.Marshal(objectMap) +} + // GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. type GalleryImageVersionPublishingProfile struct { // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. @@ -6022,15 +5473,49 @@ type GalleryImageVersionPublishingProfile struct { StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. +func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if givpp.TargetRegions != nil { + objectMap["targetRegions"] = givpp.TargetRegions + } + if givpp.ReplicaCount != nil { + objectMap["replicaCount"] = givpp.ReplicaCount + } + if givpp.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest + } + if givpp.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = givpp.EndOfLifeDate + } + if givpp.StorageAccountType != "" { + objectMap["storageAccountType"] = givpp.StorageAccountType + } + return json.Marshal(objectMap) +} + // GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryImageVersionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryImageVersionsCreateOrUpdateFuture) Result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { +// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. +func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -6054,12 +5539,25 @@ func (future *GalleryImageVersionsCreateOrUpdateFuture) Result(client GalleryIma // GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryImageVersionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImageVersionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryImageVersionsDeleteFuture) Result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { +// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. +func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -6085,12 +5583,25 @@ type GalleryImageVersionStorageProfile struct { // GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryImageVersionsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GalleryImageVersionsUpdateFuture) Result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { +// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. +func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -6273,10 +5784,15 @@ func (gl GalleryList) IsEmpty() bool { return gl.Value == nil || len(*gl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gl GalleryList) hasNextLink() bool { + return gl.NextLink != nil && len(*gl.NextLink) != 0 +} + // galleryListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { - if gl.NextLink == nil || len(to.String(gl.NextLink)) < 1 { + if !gl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -6304,11 +5820,16 @@ func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gl) + if err != nil { + return err + } + page.gl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gl = next return nil } @@ -6338,8 +5859,11 @@ func (page GalleryListPage) Values() []Gallery { } // Creates a new instance of the GalleryListPage type. -func NewGalleryListPage(getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { - return GalleryListPage{fn: getNextPage} +func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { + return GalleryListPage{ + fn: getNextPage, + gl: cur, + } } // GalleryOSDiskImage this is the OS disk image. @@ -6351,6 +5875,18 @@ type GalleryOSDiskImage struct { Source *GalleryArtifactVersionSource `json:"source,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryOSDiskImage. +func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if godi.HostCaching != "" { + objectMap["hostCaching"] = godi.HostCaching + } + if godi.Source != nil { + objectMap["source"] = godi.Source + } + return json.Marshal(objectMap) +} + // GalleryProperties describes the properties of a Shared Image Gallery. type GalleryProperties struct { // Description - The description of this Shared Image Gallery resource. This property is updatable. @@ -6360,6 +5896,18 @@ type GalleryProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryProperties. +func (gp GalleryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gp.Description != nil { + objectMap["description"] = gp.Description + } + if gp.Identifier != nil { + objectMap["identifier"] = gp.Identifier + } + return json.Marshal(objectMap) +} + // GalleryUpdate specifies information about the Shared Image Gallery that you want to update. type GalleryUpdate struct { *GalleryProperties `json:"properties,omitempty"` @@ -6684,10 +6232,15 @@ func (ilr ImageListResult) IsEmpty() bool { return ilr.Value == nil || len(*ilr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ilr ImageListResult) hasNextLink() bool { + return ilr.NextLink != nil && len(*ilr.NextLink) != 0 +} + // imageListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { - if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 { + if !ilr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -6715,11 +6268,16 @@ func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ilr) + if err != nil { + return err + } + page.ilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ilr = next return nil } @@ -6749,8 +6307,11 @@ func (page ImageListResultPage) Values() []Image { } // Creates a new instance of the ImageListResultPage type. -func NewImageListResultPage(getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { - return ImageListResultPage{fn: getNextPage} +func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { + return ImageListResultPage{ + fn: getNextPage, + ilr: cur, + } } // ImageOSDisk describes an Operating System disk. @@ -6787,6 +6348,21 @@ type ImageProperties struct { HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` } +// MarshalJSON is the custom marshaler for ImageProperties. +func (IP ImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if IP.SourceVirtualMachine != nil { + objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine + } + if IP.StorageProfile != nil { + objectMap["storageProfile"] = IP.StorageProfile + } + if IP.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = IP.HyperVGeneration + } + return json.Marshal(objectMap) +} + // ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace // images. type ImagePurchasePlan struct { @@ -6817,15 +6393,49 @@ type ImageReference struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for ImageReference. +func (ir ImageReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ir.Publisher != nil { + objectMap["publisher"] = ir.Publisher + } + if ir.Offer != nil { + objectMap["offer"] = ir.Offer + } + if ir.Sku != nil { + objectMap["sku"] = ir.Sku + } + if ir.Version != nil { + objectMap["version"] = ir.Version + } + if ir.ID != nil { + objectMap["id"] = ir.ID + } + return json.Marshal(objectMap) +} + // ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ImagesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ImagesClient) (Image, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ImagesCreateOrUpdateFuture) Result(client ImagesClient) (i Image, err error) { +// result is the default implementation for ImagesCreateOrUpdateFuture.Result. +func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -6848,12 +6458,25 @@ func (future *ImagesCreateOrUpdateFuture) Result(client ImagesClient) (i Image, // ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ImagesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ImagesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ImagesDeleteFuture) Result(client ImagesClient) (ar autorest.Response, err error) { +// result is the default implementation for ImagesDeleteFuture.Result. +func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -6880,12 +6503,25 @@ type ImageStorageProfile struct { // ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ImagesUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ImagesClient) (Image, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ImagesUpdateFuture) Result(client ImagesClient) (i Image, err error) { +// result is the default implementation for ImagesUpdateFuture.Result. +func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -7104,10 +6740,15 @@ func (lur ListUsagesResult) IsEmpty() bool { return lur.Value == nil || len(*lur.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lur ListUsagesResult) hasNextLink() bool { + return lur.NextLink != nil && len(*lur.NextLink) != 0 +} + // listUsagesResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { - if lur.NextLink == nil || len(to.String(lur.NextLink)) < 1 { + if !lur.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -7135,11 +6776,16 @@ func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lur) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lur) + if err != nil { + return err + } + page.lur = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lur = next return nil } @@ -7169,8 +6815,11 @@ func (page ListUsagesResultPage) Values() []Usage { } // Creates a new instance of the ListUsagesResultPage type. -func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { - return ListUsagesResultPage{fn: getNextPage} +func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { + return ListUsagesResultPage{ + fn: getNextPage, + lur: cur, + } } // ListVirtualMachineExtensionImage ... @@ -7188,12 +6837,25 @@ type ListVirtualMachineImageResource struct { // LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type LogAnalyticsExportRequestRateByIntervalFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LogAnalyticsExportRequestRateByIntervalFuture) Result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { +// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. +func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -7217,12 +6879,25 @@ func (future *LogAnalyticsExportRequestRateByIntervalFuture) Result(client LogAn // LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type LogAnalyticsExportThrottledRequestsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LogAnalyticsExportThrottledRequestsFuture) Result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { +// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. +func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -7723,10 +7398,15 @@ func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { return ppglr.Value == nil || len(*ppglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { + return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 +} + // proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if ppglr.NextLink == nil || len(to.String(ppglr.NextLink)) < 1 { + if !ppglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -7754,11 +7434,16 @@ func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.C tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ppglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ppglr) + if err != nil { + return err + } + page.ppglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ppglr = next return nil } @@ -7788,8 +7473,11 @@ func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementG } // Creates a new instance of the ProximityPlacementGroupListResultPage type. -func NewProximityPlacementGroupListResultPage(getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { - return ProximityPlacementGroupListResultPage{fn: getNextPage} +func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { + return ProximityPlacementGroupListResultPage{ + fn: getNextPage, + ppglr: cur, + } } // ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. @@ -7806,6 +7494,18 @@ type ProximityPlacementGroupProperties struct { ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` } +// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. +func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppgp.ProximityPlacementGroupType != "" { + objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType + } + if ppgp.ColocationStatus != nil { + objectMap["colocationStatus"] = ppgp.ColocationStatus + } + return json.Marshal(objectMap) +} + // ProximityPlacementGroupUpdate specifies information about the proximity placement group. type ProximityPlacementGroupUpdate struct { // Tags - Resource tags @@ -8086,10 +7786,15 @@ func (rsr ResourceSkusResult) IsEmpty() bool { return rsr.Value == nil || len(*rsr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rsr ResourceSkusResult) hasNextLink() bool { + return rsr.NextLink != nil && len(*rsr.NextLink) != 0 +} + // resourceSkusResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if rsr.NextLink == nil || len(to.String(rsr.NextLink)) < 1 { + if !rsr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8117,11 +7822,16 @@ func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rsr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rsr) + if err != nil { + return err + } + page.rsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rsr = next return nil } @@ -8151,8 +7861,11 @@ func (page ResourceSkusResultPage) Values() []ResourceSku { } // Creates a new instance of the ResourceSkusResultPage type. -func NewResourceSkusResultPage(getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { - return ResourceSkusResultPage{fn: getNextPage} +func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { + return ResourceSkusResultPage{ + fn: getNextPage, + rsr: cur, + } } // ResourceSkuZoneDetails describes The zonal capabilities of a SKU. @@ -8450,10 +8163,15 @@ func (rclr RunCommandListResult) IsEmpty() bool { return rclr.Value == nil || len(*rclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rclr RunCommandListResult) hasNextLink() bool { + return rclr.NextLink != nil && len(*rclr.NextLink) != 0 +} + // runCommandListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { - if rclr.NextLink == nil || len(to.String(rclr.NextLink)) < 1 { + if !rclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8481,11 +8199,16 @@ func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rclr) + if err != nil { + return err + } + page.rclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rclr = next return nil } @@ -8515,8 +8238,11 @@ func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { } // Creates a new instance of the RunCommandListResultPage type. -func NewRunCommandListResultPage(getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { - return RunCommandListResultPage{fn: getNextPage} +func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { + return RunCommandListResultPage{ + fn: getNextPage, + rclr: cur, + } } // RunCommandParameterDefinition describes the properties of a run command parameter. @@ -8769,10 +8495,15 @@ func (sl SnapshotList) IsEmpty() bool { return sl.Value == nil || len(*sl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sl SnapshotList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 +} + // snapshotListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { - if sl.NextLink == nil || len(to.String(sl.NextLink)) < 1 { + if !sl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8800,11 +8531,16 @@ func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sl) + if err != nil { + return err + } + page.sl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sl = next return nil } @@ -8834,8 +8570,11 @@ func (page SnapshotListPage) Values() []Snapshot { } // Creates a new instance of the SnapshotListPage type. -func NewSnapshotListPage(getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { - return SnapshotListPage{fn: getNextPage} +func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { + return SnapshotListPage{ + fn: getNextPage, + sl: cur, + } } // SnapshotProperties snapshot resource properties. @@ -8864,15 +8603,55 @@ type SnapshotProperties struct { Encryption *Encryption `json:"encryption,omitempty"` } +// MarshalJSON is the custom marshaler for SnapshotProperties. +func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.OsType != "" { + objectMap["osType"] = sp.OsType + } + if sp.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = sp.HyperVGeneration + } + if sp.CreationData != nil { + objectMap["creationData"] = sp.CreationData + } + if sp.DiskSizeGB != nil { + objectMap["diskSizeGB"] = sp.DiskSizeGB + } + if sp.EncryptionSettingsCollection != nil { + objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection + } + if sp.Incremental != nil { + objectMap["incremental"] = sp.Incremental + } + if sp.Encryption != nil { + objectMap["encryption"] = sp.Encryption + } + return json.Marshal(objectMap) +} + // SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SnapshotsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (Snapshot, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SnapshotsCreateOrUpdateFuture) Result(client SnapshotsClient) (s Snapshot, err error) { +// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. +func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8896,12 +8675,25 @@ func (future *SnapshotsCreateOrUpdateFuture) Result(client SnapshotsClient) (s S // SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SnapshotsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SnapshotsDeleteFuture) Result(client SnapshotsClient) (ar autorest.Response, err error) { +// result is the default implementation for SnapshotsDeleteFuture.Result. +func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8919,12 +8711,25 @@ func (future *SnapshotsDeleteFuture) Result(client SnapshotsClient) (ar autorest // SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SnapshotsGrantAccessFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (AccessURI, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SnapshotsGrantAccessFuture) Result(client SnapshotsClient) (au AccessURI, err error) { +// result is the default implementation for SnapshotsGrantAccessFuture.Result. +func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8953,15 +8758,37 @@ type SnapshotSku struct { Tier *string `json:"tier,omitempty"` } +// MarshalJSON is the custom marshaler for SnapshotSku. +func (ss SnapshotSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.Name != "" { + objectMap["name"] = ss.Name + } + return json.Marshal(objectMap) +} + // SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SnapshotsRevokeAccessFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SnapshotsRevokeAccessFuture) Result(client SnapshotsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsRevokeAccessFuture.Result. +func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8979,12 +8806,25 @@ func (future *SnapshotsRevokeAccessFuture) Result(client SnapshotsClient) (ar au // SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SnapshotsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (Snapshot, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SnapshotsUpdateFuture) Result(client SnapshotsClient) (s Snapshot, err error) { +// result is the default implementation for SnapshotsUpdateFuture.Result. +func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -9300,10 +9140,15 @@ func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { return spkglr.Value == nil || len(*spkglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { + return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 +} + // sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if spkglr.NextLink == nil || len(to.String(spkglr.NextLink)) < 1 { + if !spkglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -9331,11 +9176,16 @@ func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.spkglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.spkglr) + if err != nil { + return err + } + page.spkglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.spkglr = next return nil } @@ -9365,8 +9215,11 @@ func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { } // Creates a new instance of the SSHPublicKeysGroupListResultPage type. -func NewSSHPublicKeysGroupListResultPage(getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { - return SSHPublicKeysGroupListResultPage{fn: getNextPage} +func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { + return SSHPublicKeysGroupListResultPage{ + fn: getNextPage, + spkglr: cur, + } } // SSHPublicKeyUpdateResource specifies information about the SSH public key. @@ -9809,6 +9662,15 @@ type VirtualMachineCaptureResult struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. +func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcr.ID != nil { + objectMap["id"] = vmcr.ID + } + return json.Marshal(objectMap) +} + // VirtualMachineExtension describes a Virtual Machine Extension. type VirtualMachineExtension struct { autorest.Response `json:"-"` @@ -10069,15 +9931,58 @@ type VirtualMachineExtensionProperties struct { InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. +func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmep.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = vmep.ForceUpdateTag + } + if vmep.Publisher != nil { + objectMap["publisher"] = vmep.Publisher + } + if vmep.Type != nil { + objectMap["type"] = vmep.Type + } + if vmep.TypeHandlerVersion != nil { + objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion + } + if vmep.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion + } + if vmep.Settings != nil { + objectMap["settings"] = vmep.Settings + } + if vmep.ProtectedSettings != nil { + objectMap["protectedSettings"] = vmep.ProtectedSettings + } + if vmep.InstanceView != nil { + objectMap["instanceView"] = vmep.InstanceView + } + return json.Marshal(objectMap) +} + // VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type VirtualMachineExtensionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineExtensionsCreateOrUpdateFuture) Result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { +// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. +func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -10101,12 +10006,25 @@ func (future *VirtualMachineExtensionsCreateOrUpdateFuture) Result(client Virtua // VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineExtensionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineExtensionsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineExtensionsDeleteFuture) Result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. +func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -10131,12 +10049,25 @@ type VirtualMachineExtensionsListResult struct { // VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineExtensionsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineExtensionsUpdateFuture) Result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { +// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. +func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -10508,10 +10439,15 @@ func (vmlr VirtualMachineListResult) IsEmpty() bool { return vmlr.Value == nil || len(*vmlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmlr VirtualMachineListResult) hasNextLink() bool { + return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 +} + // virtualMachineListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmlr.NextLink == nil || len(to.String(vmlr.NextLink)) < 1 { + if !vmlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -10539,11 +10475,16 @@ func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmlr) + if err != nil { + return err + } + page.vmlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmlr = next return nil } @@ -10573,8 +10514,11 @@ func (page VirtualMachineListResultPage) Values() []VirtualMachine { } // Creates a new instance of the VirtualMachineListResultPage type. -func NewVirtualMachineListResultPage(getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { - return VirtualMachineListResultPage{fn: getNextPage} +func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { + return VirtualMachineListResultPage{ + fn: getNextPage, + vmlr: cur, + } } // VirtualMachineProperties describes the properties of a Virtual Machine. @@ -10599,7 +10543,7 @@ type VirtualMachineProperties struct { ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` // Priority - Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

For Azure Spot virtual machines, the only supported value is 'Deallocate' and the minimum api-version is 2019-03-01.

For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' + // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine.

Minimum api-version: 2019-03-01. BillingProfile *BillingProfile `json:"billingProfile,omitempty"` @@ -10615,6 +10559,54 @@ type VirtualMachineProperties struct { VMID *string `json:"vmId,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineProperties. +func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmp.HardwareProfile != nil { + objectMap["hardwareProfile"] = vmp.HardwareProfile + } + if vmp.StorageProfile != nil { + objectMap["storageProfile"] = vmp.StorageProfile + } + if vmp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities + } + if vmp.OsProfile != nil { + objectMap["osProfile"] = vmp.OsProfile + } + if vmp.NetworkProfile != nil { + objectMap["networkProfile"] = vmp.NetworkProfile + } + if vmp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile + } + if vmp.AvailabilitySet != nil { + objectMap["availabilitySet"] = vmp.AvailabilitySet + } + if vmp.VirtualMachineScaleSet != nil { + objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet + } + if vmp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup + } + if vmp.Priority != "" { + objectMap["priority"] = vmp.Priority + } + if vmp.EvictionPolicy != "" { + objectMap["evictionPolicy"] = vmp.EvictionPolicy + } + if vmp.BillingProfile != nil { + objectMap["billingProfile"] = vmp.BillingProfile + } + if vmp.Host != nil { + objectMap["host"] = vmp.Host + } + if vmp.LicenseType != nil { + objectMap["licenseType"] = vmp.LicenseType + } + return json.Marshal(objectMap) +} + // VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk // will always be reimaged type VirtualMachineReimageParameters struct { @@ -10953,10 +10945,15 @@ func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { return vmsselr.Value == nil || len(*vmsselr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { + return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 +} + // virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsselr.NextLink == nil || len(to.String(vmsselr.NextLink)) < 1 { + if !vmsselr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -10984,11 +10981,16 @@ func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx c tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsselr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsselr) + if err != nil { + return err + } + page.vmsselr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsselr = next return nil } @@ -11018,8 +11020,11 @@ func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMach } // Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. -func NewVirtualMachineScaleSetExtensionListResultPage(getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { - return VirtualMachineScaleSetExtensionListResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { + return VirtualMachineScaleSetExtensionListResultPage{ + fn: getNextPage, + vmsselr: cur, + } } // VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. @@ -11051,15 +11056,58 @@ type VirtualMachineScaleSetExtensionProperties struct { ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. +func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssep.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag + } + if vmssep.Publisher != nil { + objectMap["publisher"] = vmssep.Publisher + } + if vmssep.Type != nil { + objectMap["type"] = vmssep.Type + } + if vmssep.TypeHandlerVersion != nil { + objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion + } + if vmssep.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion + } + if vmssep.Settings != nil { + objectMap["settings"] = vmssep.Settings + } + if vmssep.ProtectedSettings != nil { + objectMap["protectedSettings"] = vmssep.ProtectedSettings + } + if vmssep.ProvisionAfterExtensions != nil { + objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) Result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. +func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11083,12 +11131,25 @@ func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) Result(clien // VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type VirtualMachineScaleSetExtensionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetExtensionsDeleteFuture) Result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. +func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11106,12 +11167,25 @@ func (future *VirtualMachineScaleSetExtensionsDeleteFuture) Result(client Virtua // VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type VirtualMachineScaleSetExtensionsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetExtensionsUpdateFuture) Result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { +// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. +func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11248,6 +11322,15 @@ type VirtualMachineScaleSetInstanceView struct { OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. +func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssiv.Statuses != nil { + objectMap["statuses"] = vmssiv.Statuses + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of // a virtual machine scale set. type VirtualMachineScaleSetInstanceViewStatusesSummary struct { @@ -11337,9 +11420,9 @@ type VirtualMachineScaleSetIPConfigurationProperties struct { ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` // ApplicationSecurityGroups - Specifies an array of references to application security group. ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. + // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer + // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` } @@ -11430,10 +11513,15 @@ func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { + return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 +} + // virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { - if vmsslouh.NextLink == nil || len(to.String(vmsslouh.NextLink)) < 1 { + if !vmsslouh.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11462,11 +11550,16 @@ func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslouh) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslouh) + if err != nil { + return err + } + page.vmsslouh = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslouh = next return nil } @@ -11496,8 +11589,11 @@ func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOpe } // Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { - return VirtualMachineScaleSetListOSUpgradeHistoryPage{fn: getNextPage} +func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { + return VirtualMachineScaleSetListOSUpgradeHistoryPage{ + fn: getNextPage, + vmsslouh: cur, + } } // VirtualMachineScaleSetListResult the List Virtual Machine operation response. @@ -11578,10 +11674,15 @@ func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { return vmsslr.Value == nil || len(*vmsslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { + return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 +} + // virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsslr.NextLink == nil || len(to.String(vmsslr.NextLink)) < 1 { + if !vmsslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11609,11 +11710,16 @@ func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Co tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslr) + if err != nil { + return err + } + page.vmsslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslr = next return nil } @@ -11643,8 +11749,11 @@ func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleS } // Creates a new instance of the VirtualMachineScaleSetListResultPage type. -func NewVirtualMachineScaleSetListResultPage(getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { - return VirtualMachineScaleSetListResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { + return VirtualMachineScaleSetListResultPage{ + fn: getNextPage, + vmsslr: cur, + } } // VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. @@ -11725,10 +11834,15 @@ func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { + return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 +} + // virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsslsr.NextLink == nil || len(to.String(vmsslsr.NextLink)) < 1 { + if !vmsslsr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11756,11 +11870,16 @@ func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslsr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslsr) + if err != nil { + return err + } + page.vmsslsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslsr = next return nil } @@ -11790,8 +11909,11 @@ func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineSc } // Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. -func NewVirtualMachineScaleSetListSkusResultPage(getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { - return VirtualMachineScaleSetListSkusResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { + return VirtualMachineScaleSetListSkusResultPage{ + fn: getNextPage, + vmsslsr: cur, + } } // VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. @@ -11872,10 +11994,15 @@ func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { + return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 +} + // virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsslwlr.NextLink == nil || len(to.String(vmsslwlr.NextLink)) < 1 { + if !vmsslwlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11903,11 +12030,16 @@ func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx co tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslwlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslwlr) + if err != nil { + return err + } + page.vmsslwlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslwlr = next return nil } @@ -11937,8 +12069,11 @@ func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachi } // Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. -func NewVirtualMachineScaleSetListWithLinkResultPage(getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { - return VirtualMachineScaleSetListWithLinkResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { + return VirtualMachineScaleSetListWithLinkResultPage{ + fn: getNextPage, + vmsslwlr: cur, + } } // VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. @@ -12120,6 +12255,45 @@ type VirtualMachineScaleSetProperties struct { ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. +func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssp.UpgradePolicy != nil { + objectMap["upgradePolicy"] = vmssp.UpgradePolicy + } + if vmssp.AutomaticRepairsPolicy != nil { + objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy + } + if vmssp.VirtualMachineProfile != nil { + objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile + } + if vmssp.Overprovision != nil { + objectMap["overprovision"] = vmssp.Overprovision + } + if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { + objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs + } + if vmssp.SinglePlacementGroup != nil { + objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup + } + if vmssp.ZoneBalance != nil { + objectMap["zoneBalance"] = vmssp.ZoneBalance + } + if vmssp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount + } + if vmssp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup + } + if vmssp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities + } + if vmssp.ScaleInPolicy != nil { + objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP // Configuration's PublicIPAddress configuration type VirtualMachineScaleSetPublicIPAddressConfiguration struct { @@ -12206,12 +12380,25 @@ type VirtualMachineScaleSetReimageParameters struct { // VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) Result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. +func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12229,12 +12416,25 @@ func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) Result(client V // VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and // retrieving the results of a long-running operation. type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) Result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. +func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12252,12 +12452,25 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) // VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving // the results of a long-running operation. type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) Result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. +func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12275,12 +12488,25 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) Result( // VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type VirtualMachineScaleSetsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) Result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { +// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. +func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12304,12 +12530,25 @@ func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) Result(client Virtual // VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetsDeallocateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsDeallocateFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. +func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12327,12 +12566,25 @@ func (future *VirtualMachineScaleSetsDeallocateFuture) Result(client VirtualMach // VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsDeleteFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. +func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12350,12 +12602,25 @@ func (future *VirtualMachineScaleSetsDeleteFuture) Result(client VirtualMachineS // VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type VirtualMachineScaleSetsDeleteInstancesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsDeleteInstancesFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. +func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12395,12 +12660,25 @@ type VirtualMachineScaleSetSkuCapacity struct { // VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type VirtualMachineScaleSetsPerformMaintenanceFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. +func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12418,12 +12696,25 @@ func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) Result(client Vir // VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetsPowerOffFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsPowerOffFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. +func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12441,12 +12732,25 @@ func (future *VirtualMachineScaleSetsPowerOffFuture) Result(client VirtualMachin // VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetsRedeployFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsRedeployFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. +func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12464,12 +12768,25 @@ func (future *VirtualMachineScaleSetsRedeployFuture) Result(client VirtualMachin // VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetsReimageAllFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsReimageAllFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. +func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12487,12 +12804,25 @@ func (future *VirtualMachineScaleSetsReimageAllFuture) Result(client VirtualMach // VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetsReimageFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsReimageFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. +func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12510,12 +12840,25 @@ func (future *VirtualMachineScaleSetsReimageFuture) Result(client VirtualMachine // VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetsRestartFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsRestartFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. +func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12533,12 +12876,25 @@ func (future *VirtualMachineScaleSetsRestartFuture) Result(client VirtualMachine // VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving // the results of a long-running operation. type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. +func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12556,12 +12912,25 @@ func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) Result( // VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetsStartFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsStartFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. +func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12589,12 +12958,25 @@ type VirtualMachineScaleSetStorageProfile struct { // VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsUpdateFuture) Result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { +// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. +func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12618,12 +13000,25 @@ func (future *VirtualMachineScaleSetsUpdateFuture) Result(client VirtualMachineS // VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type VirtualMachineScaleSetsUpdateInstancesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetsUpdateInstancesFuture) Result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. +func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13218,12 +13613,25 @@ func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { // VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. +func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13247,12 +13655,25 @@ func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) Result(cli // VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. +func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13279,12 +13700,25 @@ type VirtualMachineScaleSetVMExtensionsSummary struct { // VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) Result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { +// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. +func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13346,6 +13780,42 @@ type VirtualMachineScaleSetVMInstanceView struct { PlacementGroupID *string `json:"placementGroupId,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. +func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssviv.PlatformUpdateDomain != nil { + objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain + } + if vmssviv.PlatformFaultDomain != nil { + objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain + } + if vmssviv.RdpThumbPrint != nil { + objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint + } + if vmssviv.VMAgent != nil { + objectMap["vmAgent"] = vmssviv.VMAgent + } + if vmssviv.MaintenanceRedeployStatus != nil { + objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus + } + if vmssviv.Disks != nil { + objectMap["disks"] = vmssviv.Disks + } + if vmssviv.Extensions != nil { + objectMap["extensions"] = vmssviv.Extensions + } + if vmssviv.BootDiagnostics != nil { + objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics + } + if vmssviv.Statuses != nil { + objectMap["statuses"] = vmssviv.Statuses + } + if vmssviv.PlacementGroupID != nil { + objectMap["placementGroupId"] = vmssviv.PlacementGroupID + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. type VirtualMachineScaleSetVMListResult struct { autorest.Response `json:"-"` @@ -13424,10 +13894,15 @@ func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { + return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 +} + // virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmssvlr.NextLink == nil || len(to.String(vmssvlr.NextLink)) < 1 { + if !vmssvlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -13455,11 +13930,16 @@ func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context. tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmssvlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmssvlr) + if err != nil { + return err + } + page.vmssvlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmssvlr = next return nil } @@ -13489,8 +13969,11 @@ func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScal } // Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. -func NewVirtualMachineScaleSetVMListResultPage(getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { - return VirtualMachineScaleSetVMListResultPage{fn: getNextPage} +func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { + return VirtualMachineScaleSetVMListResultPage{ + fn: getNextPage, + vmssvlr: cur, + } } // VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network @@ -13516,7 +13999,7 @@ type VirtualMachineScaleSetVMProfile struct { LicenseType *string `json:"licenseType,omitempty"` // Priority - Specifies the priority for the virtual machines in the scale set.

Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

For Azure Spot virtual machines, the only supported value is 'Deallocate' and the minimum api-version is 2019-03-01.

For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' + // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

Minimum api-version: 2019-03-01. BillingProfile *BillingProfile `json:"billingProfile,omitempty"` @@ -13559,6 +14042,42 @@ type VirtualMachineScaleSetVMProperties struct { ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. +func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssvp.HardwareProfile != nil { + objectMap["hardwareProfile"] = vmssvp.HardwareProfile + } + if vmssvp.StorageProfile != nil { + objectMap["storageProfile"] = vmssvp.StorageProfile + } + if vmssvp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities + } + if vmssvp.OsProfile != nil { + objectMap["osProfile"] = vmssvp.OsProfile + } + if vmssvp.NetworkProfile != nil { + objectMap["networkProfile"] = vmssvp.NetworkProfile + } + if vmssvp.NetworkProfileConfiguration != nil { + objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration + } + if vmssvp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile + } + if vmssvp.AvailabilitySet != nil { + objectMap["availabilitySet"] = vmssvp.AvailabilitySet + } + if vmssvp.LicenseType != nil { + objectMap["licenseType"] = vmssvp.LicenseType + } + if vmssvp.ProtectionPolicy != nil { + objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. type VirtualMachineScaleSetVMProtectionPolicy struct { // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. @@ -13576,12 +14095,25 @@ type VirtualMachineScaleSetVMReimageParameters struct { // VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsDeallocateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsDeallocateFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. +func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13599,12 +14131,25 @@ func (future *VirtualMachineScaleSetVMsDeallocateFuture) Result(client VirtualMa // VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsDeleteFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. +func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13622,12 +14167,25 @@ func (future *VirtualMachineScaleSetVMsDeleteFuture) Result(client VirtualMachin // VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. +func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13645,12 +14203,25 @@ func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) Result(client V // VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsPowerOffFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsPowerOffFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. +func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13668,12 +14239,25 @@ func (future *VirtualMachineScaleSetVMsPowerOffFuture) Result(client VirtualMach // VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsRedeployFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsRedeployFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. +func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13691,12 +14275,25 @@ func (future *VirtualMachineScaleSetVMsRedeployFuture) Result(client VirtualMach // VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsReimageAllFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsReimageAllFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. +func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13714,12 +14311,25 @@ func (future *VirtualMachineScaleSetVMsReimageAllFuture) Result(client VirtualMa // VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsReimageFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsReimageFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. +func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13737,12 +14347,25 @@ func (future *VirtualMachineScaleSetVMsReimageFuture) Result(client VirtualMachi // VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsRestartFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsRestartFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. +func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13760,12 +14383,25 @@ func (future *VirtualMachineScaleSetVMsRestartFuture) Result(client VirtualMachi // VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsRunCommandFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsRunCommandFuture) Result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { +// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. +func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13789,12 +14425,25 @@ func (future *VirtualMachineScaleSetVMsRunCommandFuture) Result(client VirtualMa // VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsStartFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsStartFuture) Result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. +func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13812,12 +14461,25 @@ func (future *VirtualMachineScaleSetVMsStartFuture) Result(client VirtualMachine // VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetVMsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachineScaleSetVMsUpdateFuture) Result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { +// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. +func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13841,12 +14503,25 @@ func (future *VirtualMachineScaleSetVMsUpdateFuture) Result(client VirtualMachin // VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesCaptureFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesCaptureFuture) Result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { +// result is the default implementation for VirtualMachinesCaptureFuture.Result. +func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13870,12 +14545,25 @@ func (future *VirtualMachinesCaptureFuture) Result(client VirtualMachinesClient) // VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachinesConvertToManagedDisksFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesConvertToManagedDisksFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. +func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13893,12 +14581,25 @@ func (future *VirtualMachinesConvertToManagedDisksFuture) Result(client VirtualM // VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachinesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (VirtualMachine, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesCreateOrUpdateFuture) Result(client VirtualMachinesClient) (VM VirtualMachine, err error) { +// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. +func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13922,12 +14623,25 @@ func (future *VirtualMachinesCreateOrUpdateFuture) Result(client VirtualMachines // VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachinesDeallocateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesDeallocateFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesDeallocateFuture.Result. +func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13945,12 +14659,25 @@ func (future *VirtualMachinesDeallocateFuture) Result(client VirtualMachinesClie // VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesDeleteFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesDeleteFuture.Result. +func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13991,12 +14718,25 @@ type VirtualMachineSizeListResult struct { // VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachinesPerformMaintenanceFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesPerformMaintenanceFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. +func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14014,12 +14754,25 @@ func (future *VirtualMachinesPerformMaintenanceFuture) Result(client VirtualMach // VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesPowerOffFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesPowerOffFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesPowerOffFuture.Result. +func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14037,12 +14790,25 @@ func (future *VirtualMachinesPowerOffFuture) Result(client VirtualMachinesClient // VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesReapplyFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesReapplyFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesReapplyFuture.Result. +func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14060,12 +14826,25 @@ func (future *VirtualMachinesReapplyFuture) Result(client VirtualMachinesClient) // VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesRedeployFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesRedeployFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesRedeployFuture.Result. +func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14083,12 +14862,25 @@ func (future *VirtualMachinesRedeployFuture) Result(client VirtualMachinesClient // VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesReimageFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesReimageFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesReimageFuture.Result. +func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14106,12 +14898,25 @@ func (future *VirtualMachinesReimageFuture) Result(client VirtualMachinesClient) // VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesRestartFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesRestartFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesRestartFuture.Result. +func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14129,12 +14934,25 @@ func (future *VirtualMachinesRestartFuture) Result(client VirtualMachinesClient) // VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachinesRunCommandFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (RunCommandResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesRunCommandFuture) Result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { +// result is the default implementation for VirtualMachinesRunCommandFuture.Result. +func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14158,12 +14976,25 @@ func (future *VirtualMachinesRunCommandFuture) Result(client VirtualMachinesClie // VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesStartFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesStartFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesStartFuture.Result. +func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14190,12 +15021,25 @@ type VirtualMachineStatusCodeCount struct { // VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (VirtualMachine, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualMachinesUpdateFuture) Result(client VirtualMachinesClient) (VM VirtualMachine, err error) { +// result is the default implementation for VirtualMachinesUpdateFuture.Result. +func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go index 891fba0f646c..516c9a375cd2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -69,6 +58,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure responding to request") + return } return @@ -100,7 +90,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go index 3abf4a32b0c6..9eae72328b40 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -113,7 +103,6 @@ func (client ProximityPlacementGroupsClient) CreateOrUpdateSender(req *http.Requ func (client ProximityPlacementGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,7 @@ func (client ProximityPlacementGroupsClient) Delete(ctx context.Context, resourc result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure responding to request") + return } return @@ -189,7 +179,6 @@ func (client ProximityPlacementGroupsClient) DeleteSender(req *http.Request) (*h func (client ProximityPlacementGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -229,6 +218,7 @@ func (client ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGr result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure responding to request") + return } return @@ -269,7 +259,6 @@ func (client ProximityPlacementGroupsClient) GetSender(req *http.Request) (*http func (client ProximityPlacementGroupsClient) GetResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -308,6 +297,11 @@ func (client ProximityPlacementGroupsClient) ListByResourceGroup(ctx context.Con result.ppglr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -344,7 +338,6 @@ func (client ProximityPlacementGroupsClient) ListByResourceGroupSender(req *http func (client ProximityPlacementGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -418,6 +411,11 @@ func (client ProximityPlacementGroupsClient) ListBySubscription(ctx context.Cont result.ppglr, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -453,7 +451,6 @@ func (client ProximityPlacementGroupsClient) ListBySubscriptionSender(req *http. func (client ProximityPlacementGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -530,6 +527,7 @@ func (client ProximityPlacementGroupsClient) Update(ctx context.Context, resourc result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", resp, "Failure responding to request") + return } return @@ -569,7 +567,6 @@ func (client ProximityPlacementGroupsClient) UpdateSender(req *http.Request) (*h func (client ProximityPlacementGroupsClient) UpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go index e71328f0c6cc..9c967d93aa8d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -72,6 +61,11 @@ func (client ResourceSkusClient) List(ctx context.Context, filter string) (resul result.rsr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") + return + } + if result.rsr.hasNextLink() && result.rsr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -110,7 +104,6 @@ func (client ResourceSkusClient) ListSender(req *http.Request) (*http.Response, func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go index e3f4980da291..3e802546cc83 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -82,7 +71,7 @@ func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -121,7 +110,10 @@ func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future Sn if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -130,7 +122,6 @@ func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future Sn func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -148,8 +139,8 @@ func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName stri ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -162,7 +153,7 @@ func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure sending request") return } @@ -198,7 +189,10 @@ func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsD if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -207,7 +201,6 @@ func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsD func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -246,6 +239,7 @@ func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request") + return } return @@ -283,7 +277,6 @@ func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, erro func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -302,8 +295,8 @@ func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.GrantAccess") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -322,7 +315,7 @@ func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName result, err = client.GrantAccessSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure sending request") return } @@ -360,7 +353,10 @@ func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future Snaps if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -369,7 +365,6 @@ func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future Snaps func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -406,6 +401,11 @@ func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage result.sl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request") + return + } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -441,7 +441,6 @@ func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, err func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -517,6 +516,11 @@ func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceG result.sl, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -553,7 +557,6 @@ func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*htt func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -608,8 +611,8 @@ func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RevokeAccess") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -622,7 +625,7 @@ func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupNam result, err = client.RevokeAccessSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure sending request") return } @@ -658,7 +661,10 @@ func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future Snap if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -667,7 +673,6 @@ func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future Snap func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -685,8 +690,8 @@ func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName stri ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -699,7 +704,7 @@ func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure sending request") return } @@ -737,7 +742,10 @@ func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsU if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -746,7 +754,6 @@ func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsU func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go index d12c7d867660..017269b6188a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,7 @@ func (client SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName result, err = client.CreateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client SSHPublicKeysClient) CreateSender(req *http.Request) (*http.Respons func (client SSHPublicKeysClient) CreateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -151,6 +140,7 @@ func (client SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", resp, "Failure responding to request") + return } return @@ -188,7 +178,6 @@ func (client SSHPublicKeysClient) DeleteSender(req *http.Request) (*http.Respons func (client SSHPublicKeysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -228,6 +217,7 @@ func (client SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceG result, err = client.GenerateKeyPairResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", resp, "Failure responding to request") + return } return @@ -265,7 +255,6 @@ func (client SSHPublicKeysClient) GenerateKeyPairSender(req *http.Request) (*htt func (client SSHPublicKeysClient) GenerateKeyPairResponder(resp *http.Response) (result SSHPublicKeyGenerateKeyPairResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -304,6 +293,7 @@ func (client SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName str result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", resp, "Failure responding to request") + return } return @@ -341,7 +331,6 @@ func (client SSHPublicKeysClient) GetSender(req *http.Request) (*http.Response, func (client SSHPublicKeysClient) GetResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -381,6 +370,11 @@ func (client SSHPublicKeysClient) ListByResourceGroup(ctx context.Context, resou result.spkglr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -417,7 +411,6 @@ func (client SSHPublicKeysClient) ListByResourceGroupSender(req *http.Request) ( func (client SSHPublicKeysClient) ListByResourceGroupResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -492,6 +485,11 @@ func (client SSHPublicKeysClient) ListBySubscription(ctx context.Context) (resul result.spkglr, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -527,7 +525,6 @@ func (client SSHPublicKeysClient) ListBySubscriptionSender(req *http.Request) (* func (client SSHPublicKeysClient) ListBySubscriptionResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -604,6 +601,7 @@ func (client SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Update", resp, "Failure responding to request") + return } return @@ -643,7 +641,6 @@ func (client SSHPublicKeysClient) UpdateSender(req *http.Request) (*http.Respons func (client SSHPublicKeysClient) UpdateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go index 7ec1c40267e5..3231cc193eb5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -80,6 +69,11 @@ func (client UsageClient) List(ctx context.Context, location string) (result Lis result.lur, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request") + return + } + if result.lur.hasNextLink() && result.lur.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -116,7 +110,6 @@ func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/version.go index 69ef1e6763e4..a4893da4aa36 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/version.go @@ -2,19 +2,8 @@ package compute import "github.com/Azure/azure-sdk-for-go/version" -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go index 62d2dfefdf26..334f878d21ee 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -72,6 +61,7 @@ func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, locat result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request") + return } return @@ -111,7 +101,6 @@ func (client VirtualMachineExtensionImagesClient) GetSender(req *http.Request) ( func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -149,6 +138,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, result, err = client.ListTypesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request") + return } return @@ -186,7 +176,6 @@ func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Requ func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -225,6 +214,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Conte result, err = client.ListVersionsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request") + return } return @@ -272,7 +262,6 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.R func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go index 545d45a63bf8..52c8c43792a3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -67,7 +56,7 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -106,7 +95,10 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -115,7 +107,6 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Requ func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -133,8 +124,8 @@ func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -147,7 +138,7 @@ func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourc result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure sending request") return } @@ -184,7 +175,10 @@ func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -193,7 +187,6 @@ func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (fu func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -233,6 +226,7 @@ func (client VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGr result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request") + return } return @@ -274,7 +268,6 @@ func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -314,6 +307,7 @@ func (client VirtualMachineExtensionsClient) List(ctx context.Context, resourceG result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure responding to request") + return } return @@ -354,7 +348,6 @@ func (client VirtualMachineExtensionsClient) ListSender(req *http.Request) (*htt func (client VirtualMachineExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -373,8 +366,8 @@ func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -387,7 +380,7 @@ func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourc result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure sending request") return } @@ -426,7 +419,10 @@ func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -435,7 +431,6 @@ func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (fu func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go index 431ac3ae3c28..2032e8e25413 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -76,6 +65,7 @@ func (client VirtualMachineImagesClient) Get(ctx context.Context, location strin result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request") + return } return @@ -116,7 +106,6 @@ func (client VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Res func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -158,6 +147,7 @@ func (client VirtualMachineImagesClient) List(ctx context.Context, location stri result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request") + return } return @@ -206,7 +196,6 @@ func (client VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Re func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -245,6 +234,7 @@ func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, locatio result, err = client.ListOffersResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request") + return } return @@ -282,7 +272,6 @@ func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*h func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -320,6 +309,7 @@ func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, loc result, err = client.ListPublishersResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request") + return } return @@ -356,7 +346,6 @@ func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -396,6 +385,7 @@ func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location result, err = client.ListSkusResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request") + return } return @@ -434,7 +424,6 @@ func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*htt func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go index 9a670358b39b..250d8156520f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -80,6 +69,7 @@ func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request") + return } return @@ -117,7 +107,6 @@ func (client VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*htt func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -162,6 +151,11 @@ func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location result.rclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request") + return + } + if result.rclr.hasNextLink() && result.rclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -198,7 +192,6 @@ func (client VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*ht func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go index b73c77f84777..fd89096a5aa4 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Capture") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -75,7 +64,7 @@ func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupNa result, err = client.CaptureSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", nil, "Failure sending request") return } @@ -113,7 +102,10 @@ func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future Vir if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -122,7 +114,6 @@ func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future Vir func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -131,7 +122,11 @@ func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (resul } // ConvertToManagedDisks converts virtual machine disks from blob-based to managed disks. Virtual machine must be -// stop-deallocated before invoking this operation. +// stop-deallocated before invoking this operation.
For Windows, please refer to [Convert a virtual machine from +// unmanaged disks to managed +// disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).
For +// Linux, please refer to [Convert a virtual machine from unmanaged disks to managed +// disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). // Parameters: // resourceGroupName - the name of the resource group. // VMName - the name of the virtual machine. @@ -140,8 +135,8 @@ func (client VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, r ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ConvertToManagedDisks") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -154,7 +149,7 @@ func (client VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, r result, err = client.ConvertToManagedDisksSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", nil, "Failure sending request") return } @@ -190,7 +185,10 @@ func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Reques if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -199,7 +197,6 @@ func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Reques func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -217,8 +214,8 @@ func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -252,7 +249,7 @@ func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -291,7 +288,10 @@ func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -300,7 +300,6 @@ func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (fut func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -318,8 +317,8 @@ func (client VirtualMachinesClient) Deallocate(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Deallocate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -332,7 +331,7 @@ func (client VirtualMachinesClient) Deallocate(ctx context.Context, resourceGrou result, err = client.DeallocateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", nil, "Failure sending request") return } @@ -368,7 +367,10 @@ func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -377,7 +379,6 @@ func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -393,8 +394,8 @@ func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -407,7 +408,7 @@ func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", nil, "Failure sending request") return } @@ -443,7 +444,10 @@ func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future Virt if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -452,7 +456,6 @@ func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future Virt func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -494,6 +497,7 @@ func (client VirtualMachinesClient) Generalize(ctx context.Context, resourceGrou result, err = client.GeneralizeResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure responding to request") + return } return @@ -531,7 +535,6 @@ func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.R func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -570,6 +573,7 @@ func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName s result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure responding to request") + return } return @@ -610,7 +614,6 @@ func (client VirtualMachinesClient) GetSender(req *http.Request) (*http.Response func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -649,6 +652,7 @@ func (client VirtualMachinesClient) InstanceView(ctx context.Context, resourceGr result, err = client.InstanceViewResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure responding to request") + return } return @@ -686,7 +690,6 @@ func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -726,6 +729,11 @@ func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName result.vmlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request") + return + } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -762,7 +770,6 @@ func (client VirtualMachinesClient) ListSender(req *http.Request) (*http.Respons func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result VirtualMachineListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -839,6 +846,11 @@ func (client VirtualMachinesClient) ListAll(ctx context.Context, statusOnly stri result.vmlr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -877,7 +889,6 @@ func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Resp func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (result VirtualMachineListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -953,6 +964,7 @@ func (client VirtualMachinesClient) ListAvailableSizes(ctx context.Context, reso result, err = client.ListAvailableSizesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure responding to request") + return } return @@ -990,7 +1002,6 @@ func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1035,6 +1046,11 @@ func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location result.vmlr, err = client.ListByLocationResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request") + return + } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -1071,7 +1087,6 @@ func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*ht func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1116,7 +1131,8 @@ func (client VirtualMachinesClient) ListByLocationComplete(ctx context.Context, return } -// PerformMaintenance the operation to perform maintenance on a virtual machine. +// PerformMaintenance shuts down the virtual machine, moves it to an already updated node, and powers it back on during +// the self-service phase of planned maintenance. // Parameters: // resourceGroupName - the name of the resource group. // VMName - the name of the virtual machine. @@ -1125,8 +1141,8 @@ func (client VirtualMachinesClient) PerformMaintenance(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PerformMaintenance") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1139,7 +1155,7 @@ func (client VirtualMachinesClient) PerformMaintenance(ctx context.Context, reso result, err = client.PerformMaintenanceSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", nil, "Failure sending request") return } @@ -1175,7 +1191,10 @@ func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1184,7 +1203,6 @@ func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1204,8 +1222,8 @@ func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PowerOff") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1218,7 +1236,7 @@ func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupN result, err = client.PowerOffSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", nil, "Failure sending request") return } @@ -1259,7 +1277,10 @@ func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future Vi if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1268,7 +1289,6 @@ func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future Vi func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1284,8 +1304,8 @@ func (client VirtualMachinesClient) Reapply(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reapply") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1298,7 +1318,7 @@ func (client VirtualMachinesClient) Reapply(ctx context.Context, resourceGroupNa result, err = client.ReapplySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", nil, "Failure sending request") return } @@ -1334,7 +1354,10 @@ func (client VirtualMachinesClient) ReapplySender(req *http.Request) (future Vir if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1343,7 +1366,6 @@ func (client VirtualMachinesClient) ReapplySender(req *http.Request) (future Vir func (client VirtualMachinesClient) ReapplyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1359,8 +1381,8 @@ func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Redeploy") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1373,7 +1395,7 @@ func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupN result, err = client.RedeploySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", nil, "Failure sending request") return } @@ -1409,7 +1431,10 @@ func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future Vi if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1418,7 +1443,6 @@ func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future Vi func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1435,8 +1459,8 @@ func (client VirtualMachinesClient) Reimage(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reimage") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1449,7 +1473,7 @@ func (client VirtualMachinesClient) Reimage(ctx context.Context, resourceGroupNa result, err = client.ReimageSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", nil, "Failure sending request") return } @@ -1490,7 +1514,10 @@ func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future Vir if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1499,7 +1526,6 @@ func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future Vir func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1515,8 +1541,8 @@ func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Restart") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1529,7 +1555,7 @@ func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupNa result, err = client.RestartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", nil, "Failure sending request") return } @@ -1565,7 +1591,10 @@ func (client VirtualMachinesClient) RestartSender(req *http.Request) (future Vir if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1574,7 +1603,6 @@ func (client VirtualMachinesClient) RestartSender(req *http.Request) (future Vir func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1591,8 +1619,8 @@ func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RunCommand") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1611,7 +1639,7 @@ func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGrou result, err = client.RunCommandSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", nil, "Failure sending request") return } @@ -1649,7 +1677,10 @@ func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1658,7 +1689,6 @@ func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1698,6 +1728,7 @@ func (client VirtualMachinesClient) SimulateEviction(ctx context.Context, resour result, err = client.SimulateEvictionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", resp, "Failure responding to request") + return } return @@ -1735,7 +1766,6 @@ func (client VirtualMachinesClient) SimulateEvictionSender(req *http.Request) (* func (client VirtualMachinesClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1751,8 +1781,8 @@ func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Start") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1765,7 +1795,7 @@ func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", nil, "Failure sending request") return } @@ -1801,7 +1831,10 @@ func (client VirtualMachinesClient) StartSender(req *http.Request) (future Virtu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1810,7 +1843,6 @@ func (client VirtualMachinesClient) StartSender(req *http.Request) (future Virtu func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1827,8 +1859,8 @@ func (client VirtualMachinesClient) Update(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1841,7 +1873,7 @@ func (client VirtualMachinesClient) Update(ctx context.Context, resourceGroupNam result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", nil, "Failure sending request") return } @@ -1879,7 +1911,10 @@ func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future Virt if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1888,7 +1923,6 @@ func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future Virt func (client VirtualMachinesClient) UpdateResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go index 97605bcbf059..59f4fee45c92 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context. ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -67,7 +56,7 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context. result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -107,7 +96,10 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *h if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -116,7 +108,6 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *h func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -134,8 +125,8 @@ func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -148,7 +139,7 @@ func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure sending request") return } @@ -185,7 +176,10 @@ func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -194,7 +188,6 @@ func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Requ func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -234,6 +227,7 @@ func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, re result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request") + return } return @@ -275,7 +269,6 @@ func (client VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -315,6 +308,11 @@ func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, r result.vmsselr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request") + return + } + if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -352,7 +350,6 @@ func (client VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Reques func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -408,8 +405,8 @@ func (client VirtualMachineScaleSetExtensionsClient) Update(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -422,7 +419,7 @@ func (client VirtualMachineScaleSetExtensionsClient) Update(ctx context.Context, result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", nil, "Failure sending request") return } @@ -463,7 +460,10 @@ func (client VirtualMachineScaleSetExtensionsClient) UpdateSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -472,7 +472,6 @@ func (client VirtualMachineScaleSetExtensionsClient) UpdateSender(req *http.Requ func (client VirtualMachineScaleSetExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go index e5653cbc2628..117a4155d388 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Con ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.Cancel") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Con result, err = client.CancelSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", nil, "Failure sending request") return } @@ -102,7 +91,10 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -111,7 +103,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -149,6 +140,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context. result, err = client.GetLatestResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure responding to request") + return } return @@ -186,7 +178,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *h func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -205,8 +196,8 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgrade( ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartExtensionUpgrade") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -219,7 +210,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgrade( result, err = client.StartExtensionUpgradeSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", nil, "Failure sending request") return } @@ -255,7 +246,10 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeS if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -264,7 +258,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeS func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -281,8 +274,8 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx con ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartOSUpgrade") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -295,7 +288,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx con result, err = client.StartOSUpgradeSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", nil, "Failure sending request") return } @@ -331,7 +324,10 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(r if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -340,7 +336,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(r func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go index c95a97566950..ef561dedb432 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -43,7 +32,7 @@ func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// ConvertToSinglePlacementGroup converts SinglePlacementGroup property to false for a existing virtual machine scale +// ConvertToSinglePlacementGroup converts SinglePlacementGroup property to true for a existing virtual machine scale // set. // Parameters: // resourceGroupName - the name of the resource group. @@ -76,6 +65,7 @@ func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx co result, err = client.ConvertToSinglePlacementGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure responding to request") + return } return @@ -115,7 +105,6 @@ func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupSender( func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -132,8 +121,8 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -169,7 +158,7 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -207,7 +196,10 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Reque if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -216,7 +208,6 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Reque func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -235,8 +226,8 @@ func (client VirtualMachineScaleSetsClient) Deallocate(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Deallocate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -249,7 +240,7 @@ func (client VirtualMachineScaleSetsClient) Deallocate(ctx context.Context, reso result, err = client.DeallocateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", nil, "Failure sending request") return } @@ -290,7 +281,10 @@ func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -299,7 +293,6 @@ func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -315,8 +308,8 @@ func (client VirtualMachineScaleSetsClient) Delete(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -329,7 +322,7 @@ func (client VirtualMachineScaleSetsClient) Delete(ctx context.Context, resource result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", nil, "Failure sending request") return } @@ -365,7 +358,10 @@ func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -374,7 +370,6 @@ func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (fut func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -391,8 +386,8 @@ func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.DeleteInstances") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -411,7 +406,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, result, err = client.DeleteInstancesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure sending request") return } @@ -449,7 +444,10 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -458,7 +456,6 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Requ func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -498,6 +495,7 @@ func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUp result, err = client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure responding to request") + return } return @@ -536,7 +534,6 @@ func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUp func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -575,6 +572,7 @@ func (client VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGro result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure responding to request") + return } return @@ -612,7 +610,6 @@ func (client VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http. func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -651,6 +648,7 @@ func (client VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, result, err = client.GetInstanceViewResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure responding to request") + return } return @@ -688,7 +686,6 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Requ func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -728,6 +725,11 @@ func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Cont result.vmsslouh, err = client.GetOSUpgradeHistoryResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request") + return + } + if result.vmsslouh.hasNextLink() && result.vmsslouh.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -765,7 +767,6 @@ func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http. func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -841,6 +842,11 @@ func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGr result.vmsslr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request") + return + } + if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -877,7 +883,6 @@ func (client VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -953,6 +958,11 @@ func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result result.vmsslwlr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request") + return + } + if result.vmsslwlr.hasNextLink() && result.vmsslwlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -988,7 +998,6 @@ func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*h func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1066,6 +1075,11 @@ func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resour result.vmsslsr, err = client.ListSkusResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request") + return + } + if result.vmsslsr.hasNextLink() && result.vmsslsr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -1103,7 +1117,6 @@ func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (* func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1160,8 +1173,8 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Conte ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PerformMaintenance") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1174,7 +1187,7 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Conte result, err = client.PerformMaintenanceSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", nil, "Failure sending request") return } @@ -1215,7 +1228,10 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.R if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1224,7 +1240,6 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.R func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1245,8 +1260,8 @@ func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PowerOff") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1259,7 +1274,7 @@ func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resour result, err = client.PowerOffSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure sending request") return } @@ -1305,7 +1320,10 @@ func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1314,7 +1332,6 @@ func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (f func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1332,8 +1349,8 @@ func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Redeploy") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1346,7 +1363,7 @@ func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resour result, err = client.RedeploySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", nil, "Failure sending request") return } @@ -1387,7 +1404,10 @@ func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1396,7 +1416,6 @@ func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (f func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1414,8 +1433,8 @@ func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Reimage") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1428,7 +1447,7 @@ func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourc result, err = client.ReimageSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure sending request") return } @@ -1469,7 +1488,10 @@ func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1478,7 +1500,6 @@ func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (fu func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1496,8 +1517,8 @@ func (client VirtualMachineScaleSetsClient) ReimageAll(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ReimageAll") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1510,7 +1531,7 @@ func (client VirtualMachineScaleSetsClient) ReimageAll(ctx context.Context, reso result, err = client.ReimageAllSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", nil, "Failure sending request") return } @@ -1551,7 +1572,10 @@ func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1560,7 +1584,6 @@ func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1577,8 +1600,8 @@ func (client VirtualMachineScaleSetsClient) Restart(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Restart") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1591,7 +1614,7 @@ func (client VirtualMachineScaleSetsClient) Restart(ctx context.Context, resourc result, err = client.RestartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", nil, "Failure sending request") return } @@ -1632,7 +1655,10 @@ func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1641,7 +1667,6 @@ func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (fu func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1658,8 +1683,8 @@ func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceState(ctx con ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.SetOrchestrationServiceState") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1672,7 +1697,7 @@ func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceState(ctx con result, err = client.SetOrchestrationServiceStateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", nil, "Failure sending request") return } @@ -1710,7 +1735,10 @@ func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateSender(r if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1719,7 +1747,6 @@ func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateSender(r func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1736,8 +1763,8 @@ func (client VirtualMachineScaleSetsClient) Start(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Start") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1750,7 +1777,7 @@ func (client VirtualMachineScaleSetsClient) Start(ctx context.Context, resourceG result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", nil, "Failure sending request") return } @@ -1791,7 +1818,10 @@ func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1800,7 +1830,6 @@ func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (futu func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1817,8 +1846,8 @@ func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1831,7 +1860,7 @@ func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resource result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", nil, "Failure sending request") return } @@ -1869,7 +1898,10 @@ func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1878,7 +1910,6 @@ func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (fut func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1896,8 +1927,8 @@ func (client VirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.UpdateInstances") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1916,7 +1947,7 @@ func (client VirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, result, err = client.UpdateInstancesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure sending request") return } @@ -1954,7 +1985,10 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1963,7 +1997,6 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Requ func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go index bf1427b10660..e2a2e0fef6a4 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -55,8 +44,8 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx contex ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -69,7 +58,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx contex result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -109,7 +98,10 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -118,7 +110,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -137,8 +128,8 @@ func (client VirtualMachineScaleSetVMExtensionsClient) Delete(ctx context.Contex ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -151,7 +142,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) Delete(ctx context.Contex result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", nil, "Failure sending request") return } @@ -189,7 +180,10 @@ func (client VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -198,7 +192,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Re func (client VirtualMachineScaleSetVMExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -239,6 +232,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure responding to request") + return } return @@ -281,7 +275,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) GetSender(req *http.Reque func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -322,6 +315,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure responding to request") + return } return @@ -363,7 +357,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) ListSender(req *http.Requ func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -383,8 +376,8 @@ func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Contex ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -397,7 +390,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Contex result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", nil, "Failure sending request") return } @@ -437,7 +430,10 @@ func (client VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -446,7 +442,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Re func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go index 7e611cfb12b5..a80529f51b32 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -55,8 +44,8 @@ func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, re ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Deallocate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -69,7 +58,7 @@ func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, re result, err = client.DeallocateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", nil, "Failure sending request") return } @@ -106,7 +95,10 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -115,7 +107,6 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -132,8 +123,8 @@ func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -146,7 +137,7 @@ func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resour result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", nil, "Failure sending request") return } @@ -183,7 +174,10 @@ func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -192,7 +186,6 @@ func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (f func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -232,6 +225,7 @@ func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceG result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure responding to request") + return } return @@ -273,7 +267,6 @@ func (client VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*htt func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -313,6 +306,7 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Contex result, err = client.GetInstanceViewResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure responding to request") + return } return @@ -351,7 +345,6 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Re func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -363,9 +356,10 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *htt // Parameters: // resourceGroupName - the name of the resource group. // virtualMachineScaleSetName - the name of the VM scale set. -// filter - the filter to apply to the operation. -// selectParameter - the list parameters. -// expand - the expand expression to apply to the operation. +// filter - the filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, +// 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. +// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. +// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") @@ -394,6 +388,11 @@ func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resource result.vmssvlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request") + return + } + if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -440,7 +439,6 @@ func (client VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*ht func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -485,7 +483,8 @@ func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context, return } -// PerformMaintenance performs maintenance on a virtual machine in a VM scale set. +// PerformMaintenance shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers +// it back on during the self-service phase of planned maintenance. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. @@ -495,8 +494,8 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenance(ctx context.Con ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PerformMaintenance") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -509,7 +508,7 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenance(ctx context.Con result, err = client.PerformMaintenanceSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", nil, "Failure sending request") return } @@ -546,7 +545,10 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -555,7 +557,6 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -576,8 +577,8 @@ func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PowerOff") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -590,7 +591,7 @@ func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, reso result, err = client.PowerOffSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure sending request") return } @@ -632,7 +633,10 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -641,7 +645,6 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -659,8 +662,8 @@ func (client VirtualMachineScaleSetVMsClient) Redeploy(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Redeploy") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -673,7 +676,7 @@ func (client VirtualMachineScaleSetVMsClient) Redeploy(ctx context.Context, reso result, err = client.RedeploySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", nil, "Failure sending request") return } @@ -710,7 +713,10 @@ func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -719,7 +725,6 @@ func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -737,8 +742,8 @@ func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Reimage") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -751,7 +756,7 @@ func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resou result, err = client.ReimageSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure sending request") return } @@ -793,7 +798,10 @@ func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -802,7 +810,6 @@ func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) ( func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -820,8 +827,8 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, re ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.ReimageAll") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -834,7 +841,7 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, re result, err = client.ReimageAllSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", nil, "Failure sending request") return } @@ -871,7 +878,10 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -880,7 +890,6 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -897,8 +906,8 @@ func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Restart") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -911,7 +920,7 @@ func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resou result, err = client.RestartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", nil, "Failure sending request") return } @@ -948,7 +957,10 @@ func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -957,7 +969,6 @@ func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) ( func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -975,8 +986,8 @@ func (client VirtualMachineScaleSetVMsClient) RunCommand(ctx context.Context, re ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.RunCommand") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -995,7 +1006,7 @@ func (client VirtualMachineScaleSetVMsClient) RunCommand(ctx context.Context, re result, err = client.RunCommandSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", nil, "Failure sending request") return } @@ -1034,7 +1045,10 @@ func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1043,7 +1057,6 @@ func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request func (client VirtualMachineScaleSetVMsClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1084,6 +1097,7 @@ func (client VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Conte result, err = client.SimulateEvictionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", resp, "Failure responding to request") + return } return @@ -1122,7 +1136,6 @@ func (client VirtualMachineScaleSetVMsClient) SimulateEvictionSender(req *http.R func (client VirtualMachineScaleSetVMsClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1139,8 +1152,8 @@ func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Start") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1153,7 +1166,7 @@ func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourc result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", nil, "Failure sending request") return } @@ -1190,7 +1203,10 @@ func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1199,7 +1215,6 @@ func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (fu func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1217,8 +1232,8 @@ func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1252,7 +1267,7 @@ func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resour result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", nil, "Failure sending request") return } @@ -1295,7 +1310,10 @@ func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1304,7 +1322,6 @@ func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (f func (client VirtualMachineScaleSetVMsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go index 0eb7702a3b48..caa2b60e5403 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go @@ -1,18 +1,7 @@ package compute -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -80,6 +69,7 @@ func (client VirtualMachineSizesClient) List(ctx context.Context, location strin result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to request") + return } return @@ -116,7 +106,6 @@ func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Res func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/CHANGELOG.md new file mode 100644 index 000000000000..16a73060963d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/CHANGELOG.md @@ -0,0 +1,23 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/containerregistry/resource-manager/readme.md tag: `package-2019-05` + +Code generator @microsoft.azure/autorest.go@2.1.178 + + +### New Funcs + +1. *RegistriesCreateFuture.UnmarshalJSON([]byte) error +1. *RegistriesDeleteFuture.UnmarshalJSON([]byte) error +1. *RegistriesImportImageFuture.UnmarshalJSON([]byte) error +1. *RegistriesScheduleRunFuture.UnmarshalJSON([]byte) error +1. *RegistriesUpdateFuture.UnmarshalJSON([]byte) error +1. *ReplicationsCreateFuture.UnmarshalJSON([]byte) error +1. *ReplicationsDeleteFuture.UnmarshalJSON([]byte) error +1. *ReplicationsUpdateFuture.UnmarshalJSON([]byte) error +1. *RunsCancelFuture.UnmarshalJSON([]byte) error +1. *RunsUpdateFuture.UnmarshalJSON([]byte) error +1. *TasksCreateFuture.UnmarshalJSON([]byte) error +1. *TasksDeleteFuture.UnmarshalJSON([]byte) error +1. *TasksUpdateFuture.UnmarshalJSON([]byte) error +1. *WebhooksCreateFuture.UnmarshalJSON([]byte) error +1. *WebhooksDeleteFuture.UnmarshalJSON([]byte) error +1. *WebhooksUpdateFuture.UnmarshalJSON([]byte) error diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/client.go index 578a43823145..79937e123765 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/client.go @@ -3,19 +3,8 @@ // package containerregistry -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/enums.go new file mode 100644 index 000000000000..289fec598ebf --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/enums.go @@ -0,0 +1,513 @@ +package containerregistry + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Action enumerates the values for action. +type Action string + +const ( + // Allow ... + Allow Action = "Allow" +) + +// PossibleActionValues returns an array of possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{Allow} +} + +// Architecture enumerates the values for architecture. +type Architecture string + +const ( + // Amd64 ... + Amd64 Architecture = "amd64" + // Arm ... + Arm Architecture = "arm" + // X86 ... + X86 Architecture = "x86" +) + +// PossibleArchitectureValues returns an array of possible values for the Architecture const type. +func PossibleArchitectureValues() []Architecture { + return []Architecture{Amd64, Arm, X86} +} + +// BaseImageDependencyType enumerates the values for base image dependency type. +type BaseImageDependencyType string + +const ( + // BuildTime ... + BuildTime BaseImageDependencyType = "BuildTime" + // RunTime ... + RunTime BaseImageDependencyType = "RunTime" +) + +// PossibleBaseImageDependencyTypeValues returns an array of possible values for the BaseImageDependencyType const type. +func PossibleBaseImageDependencyTypeValues() []BaseImageDependencyType { + return []BaseImageDependencyType{BuildTime, RunTime} +} + +// BaseImageTriggerType enumerates the values for base image trigger type. +type BaseImageTriggerType string + +const ( + // All ... + All BaseImageTriggerType = "All" + // Runtime ... + Runtime BaseImageTriggerType = "Runtime" +) + +// PossibleBaseImageTriggerTypeValues returns an array of possible values for the BaseImageTriggerType const type. +func PossibleBaseImageTriggerTypeValues() []BaseImageTriggerType { + return []BaseImageTriggerType{All, Runtime} +} + +// DefaultAction enumerates the values for default action. +type DefaultAction string + +const ( + // DefaultActionAllow ... + DefaultActionAllow DefaultAction = "Allow" + // DefaultActionDeny ... + DefaultActionDeny DefaultAction = "Deny" +) + +// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. +func PossibleDefaultActionValues() []DefaultAction { + return []DefaultAction{DefaultActionAllow, DefaultActionDeny} +} + +// ImportMode enumerates the values for import mode. +type ImportMode string + +const ( + // Force ... + Force ImportMode = "Force" + // NoForce ... + NoForce ImportMode = "NoForce" +) + +// PossibleImportModeValues returns an array of possible values for the ImportMode const type. +func PossibleImportModeValues() []ImportMode { + return []ImportMode{Force, NoForce} +} + +// OS enumerates the values for os. +type OS string + +const ( + // Linux ... + Linux OS = "Linux" + // Windows ... + Windows OS = "Windows" +) + +// PossibleOSValues returns an array of possible values for the OS const type. +func PossibleOSValues() []OS { + return []OS{Linux, Windows} +} + +// PasswordName enumerates the values for password name. +type PasswordName string + +const ( + // Password ... + Password PasswordName = "password" + // Password2 ... + Password2 PasswordName = "password2" +) + +// PossiblePasswordNameValues returns an array of possible values for the PasswordName const type. +func PossiblePasswordNameValues() []PasswordName { + return []PasswordName{Password, Password2} +} + +// PolicyStatus enumerates the values for policy status. +type PolicyStatus string + +const ( + // Disabled ... + Disabled PolicyStatus = "disabled" + // Enabled ... + Enabled PolicyStatus = "enabled" +) + +// PossiblePolicyStatusValues returns an array of possible values for the PolicyStatus const type. +func PossiblePolicyStatusValues() []PolicyStatus { + return []PolicyStatus{Disabled, Enabled} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Canceled ... + Canceled ProvisioningState = "Canceled" + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} +} + +// RegistryUsageUnit enumerates the values for registry usage unit. +type RegistryUsageUnit string + +const ( + // Bytes ... + Bytes RegistryUsageUnit = "Bytes" + // Count ... + Count RegistryUsageUnit = "Count" +) + +// PossibleRegistryUsageUnitValues returns an array of possible values for the RegistryUsageUnit const type. +func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { + return []RegistryUsageUnit{Bytes, Count} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // UserAssigned ... + UserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} +} + +// RunStatus enumerates the values for run status. +type RunStatus string + +const ( + // RunStatusCanceled ... + RunStatusCanceled RunStatus = "Canceled" + // RunStatusError ... + RunStatusError RunStatus = "Error" + // RunStatusFailed ... + RunStatusFailed RunStatus = "Failed" + // RunStatusQueued ... + RunStatusQueued RunStatus = "Queued" + // RunStatusRunning ... + RunStatusRunning RunStatus = "Running" + // RunStatusStarted ... + RunStatusStarted RunStatus = "Started" + // RunStatusSucceeded ... + RunStatusSucceeded RunStatus = "Succeeded" + // RunStatusTimeout ... + RunStatusTimeout RunStatus = "Timeout" +) + +// PossibleRunStatusValues returns an array of possible values for the RunStatus const type. +func PossibleRunStatusValues() []RunStatus { + return []RunStatus{RunStatusCanceled, RunStatusError, RunStatusFailed, RunStatusQueued, RunStatusRunning, RunStatusStarted, RunStatusSucceeded, RunStatusTimeout} +} + +// RunType enumerates the values for run type. +type RunType string + +const ( + // AutoBuild ... + AutoBuild RunType = "AutoBuild" + // AutoRun ... + AutoRun RunType = "AutoRun" + // QuickBuild ... + QuickBuild RunType = "QuickBuild" + // QuickRun ... + QuickRun RunType = "QuickRun" +) + +// PossibleRunTypeValues returns an array of possible values for the RunType const type. +func PossibleRunTypeValues() []RunType { + return []RunType{AutoBuild, AutoRun, QuickBuild, QuickRun} +} + +// SecretObjectType enumerates the values for secret object type. +type SecretObjectType string + +const ( + // Opaque ... + Opaque SecretObjectType = "Opaque" + // Vaultsecret ... + Vaultsecret SecretObjectType = "Vaultsecret" +) + +// PossibleSecretObjectTypeValues returns an array of possible values for the SecretObjectType const type. +func PossibleSecretObjectTypeValues() []SecretObjectType { + return []SecretObjectType{Opaque, Vaultsecret} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // Basic ... + Basic SkuName = "Basic" + // Classic ... + Classic SkuName = "Classic" + // Premium ... + Premium SkuName = "Premium" + // Standard ... + Standard SkuName = "Standard" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Basic, Classic, Premium, Standard} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // SkuTierBasic ... + SkuTierBasic SkuTier = "Basic" + // SkuTierClassic ... + SkuTierClassic SkuTier = "Classic" + // SkuTierPremium ... + SkuTierPremium SkuTier = "Premium" + // SkuTierStandard ... + SkuTierStandard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierClassic, SkuTierPremium, SkuTierStandard} +} + +// SourceControlType enumerates the values for source control type. +type SourceControlType string + +const ( + // Github ... + Github SourceControlType = "Github" + // VisualStudioTeamService ... + VisualStudioTeamService SourceControlType = "VisualStudioTeamService" +) + +// PossibleSourceControlTypeValues returns an array of possible values for the SourceControlType const type. +func PossibleSourceControlTypeValues() []SourceControlType { + return []SourceControlType{Github, VisualStudioTeamService} +} + +// SourceRegistryLoginMode enumerates the values for source registry login mode. +type SourceRegistryLoginMode string + +const ( + // SourceRegistryLoginModeDefault ... + SourceRegistryLoginModeDefault SourceRegistryLoginMode = "Default" + // SourceRegistryLoginModeNone ... + SourceRegistryLoginModeNone SourceRegistryLoginMode = "None" +) + +// PossibleSourceRegistryLoginModeValues returns an array of possible values for the SourceRegistryLoginMode const type. +func PossibleSourceRegistryLoginModeValues() []SourceRegistryLoginMode { + return []SourceRegistryLoginMode{SourceRegistryLoginModeDefault, SourceRegistryLoginModeNone} +} + +// SourceTriggerEvent enumerates the values for source trigger event. +type SourceTriggerEvent string + +const ( + // Commit ... + Commit SourceTriggerEvent = "commit" + // Pullrequest ... + Pullrequest SourceTriggerEvent = "pullrequest" +) + +// PossibleSourceTriggerEventValues returns an array of possible values for the SourceTriggerEvent const type. +func PossibleSourceTriggerEventValues() []SourceTriggerEvent { + return []SourceTriggerEvent{Commit, Pullrequest} +} + +// TaskStatus enumerates the values for task status. +type TaskStatus string + +const ( + // TaskStatusDisabled ... + TaskStatusDisabled TaskStatus = "Disabled" + // TaskStatusEnabled ... + TaskStatusEnabled TaskStatus = "Enabled" +) + +// PossibleTaskStatusValues returns an array of possible values for the TaskStatus const type. +func PossibleTaskStatusValues() []TaskStatus { + return []TaskStatus{TaskStatusDisabled, TaskStatusEnabled} +} + +// TokenType enumerates the values for token type. +type TokenType string + +const ( + // OAuth ... + OAuth TokenType = "OAuth" + // PAT ... + PAT TokenType = "PAT" +) + +// PossibleTokenTypeValues returns an array of possible values for the TokenType const type. +func PossibleTokenTypeValues() []TokenType { + return []TokenType{OAuth, PAT} +} + +// TriggerStatus enumerates the values for trigger status. +type TriggerStatus string + +const ( + // TriggerStatusDisabled ... + TriggerStatusDisabled TriggerStatus = "Disabled" + // TriggerStatusEnabled ... + TriggerStatusEnabled TriggerStatus = "Enabled" +) + +// PossibleTriggerStatusValues returns an array of possible values for the TriggerStatus const type. +func PossibleTriggerStatusValues() []TriggerStatus { + return []TriggerStatus{TriggerStatusDisabled, TriggerStatusEnabled} +} + +// TrustPolicyType enumerates the values for trust policy type. +type TrustPolicyType string + +const ( + // Notary ... + Notary TrustPolicyType = "Notary" +) + +// PossibleTrustPolicyTypeValues returns an array of possible values for the TrustPolicyType const type. +func PossibleTrustPolicyTypeValues() []TrustPolicyType { + return []TrustPolicyType{Notary} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeDockerBuildRequest ... + TypeDockerBuildRequest Type = "DockerBuildRequest" + // TypeEncodedTaskRunRequest ... + TypeEncodedTaskRunRequest Type = "EncodedTaskRunRequest" + // TypeFileTaskRunRequest ... + TypeFileTaskRunRequest Type = "FileTaskRunRequest" + // TypeRunRequest ... + TypeRunRequest Type = "RunRequest" + // TypeTaskRunRequest ... + TypeTaskRunRequest Type = "TaskRunRequest" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeDockerBuildRequest, TypeEncodedTaskRunRequest, TypeFileTaskRunRequest, TypeRunRequest, TypeTaskRunRequest} +} + +// TypeBasicTaskStepProperties enumerates the values for type basic task step properties. +type TypeBasicTaskStepProperties string + +const ( + // TypeDocker ... + TypeDocker TypeBasicTaskStepProperties = "Docker" + // TypeEncodedTask ... + TypeEncodedTask TypeBasicTaskStepProperties = "EncodedTask" + // TypeFileTask ... + TypeFileTask TypeBasicTaskStepProperties = "FileTask" + // TypeTaskStepProperties ... + TypeTaskStepProperties TypeBasicTaskStepProperties = "TaskStepProperties" +) + +// PossibleTypeBasicTaskStepPropertiesValues returns an array of possible values for the TypeBasicTaskStepProperties const type. +func PossibleTypeBasicTaskStepPropertiesValues() []TypeBasicTaskStepProperties { + return []TypeBasicTaskStepProperties{TypeDocker, TypeEncodedTask, TypeFileTask, TypeTaskStepProperties} +} + +// TypeBasicTaskStepUpdateParameters enumerates the values for type basic task step update parameters. +type TypeBasicTaskStepUpdateParameters string + +const ( + // TypeBasicTaskStepUpdateParametersTypeDocker ... + TypeBasicTaskStepUpdateParametersTypeDocker TypeBasicTaskStepUpdateParameters = "Docker" + // TypeBasicTaskStepUpdateParametersTypeEncodedTask ... + TypeBasicTaskStepUpdateParametersTypeEncodedTask TypeBasicTaskStepUpdateParameters = "EncodedTask" + // TypeBasicTaskStepUpdateParametersTypeFileTask ... + TypeBasicTaskStepUpdateParametersTypeFileTask TypeBasicTaskStepUpdateParameters = "FileTask" + // TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters ... + TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters TypeBasicTaskStepUpdateParameters = "TaskStepUpdateParameters" +) + +// PossibleTypeBasicTaskStepUpdateParametersValues returns an array of possible values for the TypeBasicTaskStepUpdateParameters const type. +func PossibleTypeBasicTaskStepUpdateParametersValues() []TypeBasicTaskStepUpdateParameters { + return []TypeBasicTaskStepUpdateParameters{TypeBasicTaskStepUpdateParametersTypeDocker, TypeBasicTaskStepUpdateParametersTypeEncodedTask, TypeBasicTaskStepUpdateParametersTypeFileTask, TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters} +} + +// Variant enumerates the values for variant. +type Variant string + +const ( + // V6 ... + V6 Variant = "v6" + // V7 ... + V7 Variant = "v7" + // V8 ... + V8 Variant = "v8" +) + +// PossibleVariantValues returns an array of possible values for the Variant const type. +func PossibleVariantValues() []Variant { + return []Variant{V6, V7, V8} +} + +// WebhookAction enumerates the values for webhook action. +type WebhookAction string + +const ( + // ChartDelete ... + ChartDelete WebhookAction = "chart_delete" + // ChartPush ... + ChartPush WebhookAction = "chart_push" + // Delete ... + Delete WebhookAction = "delete" + // Push ... + Push WebhookAction = "push" + // Quarantine ... + Quarantine WebhookAction = "quarantine" +) + +// PossibleWebhookActionValues returns an array of possible values for the WebhookAction const type. +func PossibleWebhookActionValues() []WebhookAction { + return []WebhookAction{ChartDelete, ChartPush, Delete, Push, Quarantine} +} + +// WebhookStatus enumerates the values for webhook status. +type WebhookStatus string + +const ( + // WebhookStatusDisabled ... + WebhookStatusDisabled WebhookStatus = "disabled" + // WebhookStatusEnabled ... + WebhookStatusEnabled WebhookStatus = "enabled" +) + +// PossibleWebhookStatusValues returns an array of possible values for the WebhookStatus const type. +func PossibleWebhookStatusValues() []WebhookStatus { + return []WebhookStatus{WebhookStatusDisabled, WebhookStatusEnabled} +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/models.go index cf551f2a5e17..8561a3d87b4b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/models.go @@ -1,18 +1,7 @@ package containerregistry -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -31,512 +20,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry" -// Action enumerates the values for action. -type Action string - -const ( - // Allow ... - Allow Action = "Allow" -) - -// PossibleActionValues returns an array of possible values for the Action const type. -func PossibleActionValues() []Action { - return []Action{Allow} -} - -// Architecture enumerates the values for architecture. -type Architecture string - -const ( - // Amd64 ... - Amd64 Architecture = "amd64" - // Arm ... - Arm Architecture = "arm" - // X86 ... - X86 Architecture = "x86" -) - -// PossibleArchitectureValues returns an array of possible values for the Architecture const type. -func PossibleArchitectureValues() []Architecture { - return []Architecture{Amd64, Arm, X86} -} - -// BaseImageDependencyType enumerates the values for base image dependency type. -type BaseImageDependencyType string - -const ( - // BuildTime ... - BuildTime BaseImageDependencyType = "BuildTime" - // RunTime ... - RunTime BaseImageDependencyType = "RunTime" -) - -// PossibleBaseImageDependencyTypeValues returns an array of possible values for the BaseImageDependencyType const type. -func PossibleBaseImageDependencyTypeValues() []BaseImageDependencyType { - return []BaseImageDependencyType{BuildTime, RunTime} -} - -// BaseImageTriggerType enumerates the values for base image trigger type. -type BaseImageTriggerType string - -const ( - // All ... - All BaseImageTriggerType = "All" - // Runtime ... - Runtime BaseImageTriggerType = "Runtime" -) - -// PossibleBaseImageTriggerTypeValues returns an array of possible values for the BaseImageTriggerType const type. -func PossibleBaseImageTriggerTypeValues() []BaseImageTriggerType { - return []BaseImageTriggerType{All, Runtime} -} - -// DefaultAction enumerates the values for default action. -type DefaultAction string - -const ( - // DefaultActionAllow ... - DefaultActionAllow DefaultAction = "Allow" - // DefaultActionDeny ... - DefaultActionDeny DefaultAction = "Deny" -) - -// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. -func PossibleDefaultActionValues() []DefaultAction { - return []DefaultAction{DefaultActionAllow, DefaultActionDeny} -} - -// ImportMode enumerates the values for import mode. -type ImportMode string - -const ( - // Force ... - Force ImportMode = "Force" - // NoForce ... - NoForce ImportMode = "NoForce" -) - -// PossibleImportModeValues returns an array of possible values for the ImportMode const type. -func PossibleImportModeValues() []ImportMode { - return []ImportMode{Force, NoForce} -} - -// OS enumerates the values for os. -type OS string - -const ( - // Linux ... - Linux OS = "Linux" - // Windows ... - Windows OS = "Windows" -) - -// PossibleOSValues returns an array of possible values for the OS const type. -func PossibleOSValues() []OS { - return []OS{Linux, Windows} -} - -// PasswordName enumerates the values for password name. -type PasswordName string - -const ( - // Password ... - Password PasswordName = "password" - // Password2 ... - Password2 PasswordName = "password2" -) - -// PossiblePasswordNameValues returns an array of possible values for the PasswordName const type. -func PossiblePasswordNameValues() []PasswordName { - return []PasswordName{Password, Password2} -} - -// PolicyStatus enumerates the values for policy status. -type PolicyStatus string - -const ( - // Disabled ... - Disabled PolicyStatus = "disabled" - // Enabled ... - Enabled PolicyStatus = "enabled" -) - -// PossiblePolicyStatusValues returns an array of possible values for the PolicyStatus const type. -func PossiblePolicyStatusValues() []PolicyStatus { - return []PolicyStatus{Disabled, Enabled} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Canceled ... - Canceled ProvisioningState = "Canceled" - // Creating ... - Creating ProvisioningState = "Creating" - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" - // Updating ... - Updating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} -} - -// RegistryUsageUnit enumerates the values for registry usage unit. -type RegistryUsageUnit string - -const ( - // Bytes ... - Bytes RegistryUsageUnit = "Bytes" - // Count ... - Count RegistryUsageUnit = "Count" -) - -// PossibleRegistryUsageUnitValues returns an array of possible values for the RegistryUsageUnit const type. -func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { - return []RegistryUsageUnit{Bytes, Count} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // None ... - None ResourceIdentityType = "None" - // SystemAssigned ... - SystemAssigned ResourceIdentityType = "SystemAssigned" - // SystemAssignedUserAssigned ... - SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // UserAssigned ... - UserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} -} - -// RunStatus enumerates the values for run status. -type RunStatus string - -const ( - // RunStatusCanceled ... - RunStatusCanceled RunStatus = "Canceled" - // RunStatusError ... - RunStatusError RunStatus = "Error" - // RunStatusFailed ... - RunStatusFailed RunStatus = "Failed" - // RunStatusQueued ... - RunStatusQueued RunStatus = "Queued" - // RunStatusRunning ... - RunStatusRunning RunStatus = "Running" - // RunStatusStarted ... - RunStatusStarted RunStatus = "Started" - // RunStatusSucceeded ... - RunStatusSucceeded RunStatus = "Succeeded" - // RunStatusTimeout ... - RunStatusTimeout RunStatus = "Timeout" -) - -// PossibleRunStatusValues returns an array of possible values for the RunStatus const type. -func PossibleRunStatusValues() []RunStatus { - return []RunStatus{RunStatusCanceled, RunStatusError, RunStatusFailed, RunStatusQueued, RunStatusRunning, RunStatusStarted, RunStatusSucceeded, RunStatusTimeout} -} - -// RunType enumerates the values for run type. -type RunType string - -const ( - // AutoBuild ... - AutoBuild RunType = "AutoBuild" - // AutoRun ... - AutoRun RunType = "AutoRun" - // QuickBuild ... - QuickBuild RunType = "QuickBuild" - // QuickRun ... - QuickRun RunType = "QuickRun" -) - -// PossibleRunTypeValues returns an array of possible values for the RunType const type. -func PossibleRunTypeValues() []RunType { - return []RunType{AutoBuild, AutoRun, QuickBuild, QuickRun} -} - -// SecretObjectType enumerates the values for secret object type. -type SecretObjectType string - -const ( - // Opaque ... - Opaque SecretObjectType = "Opaque" - // Vaultsecret ... - Vaultsecret SecretObjectType = "Vaultsecret" -) - -// PossibleSecretObjectTypeValues returns an array of possible values for the SecretObjectType const type. -func PossibleSecretObjectTypeValues() []SecretObjectType { - return []SecretObjectType{Opaque, Vaultsecret} -} - -// SkuName enumerates the values for sku name. -type SkuName string - -const ( - // Basic ... - Basic SkuName = "Basic" - // Classic ... - Classic SkuName = "Classic" - // Premium ... - Premium SkuName = "Premium" - // Standard ... - Standard SkuName = "Standard" -) - -// PossibleSkuNameValues returns an array of possible values for the SkuName const type. -func PossibleSkuNameValues() []SkuName { - return []SkuName{Basic, Classic, Premium, Standard} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // SkuTierBasic ... - SkuTierBasic SkuTier = "Basic" - // SkuTierClassic ... - SkuTierClassic SkuTier = "Classic" - // SkuTierPremium ... - SkuTierPremium SkuTier = "Premium" - // SkuTierStandard ... - SkuTierStandard SkuTier = "Standard" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{SkuTierBasic, SkuTierClassic, SkuTierPremium, SkuTierStandard} -} - -// SourceControlType enumerates the values for source control type. -type SourceControlType string - -const ( - // Github ... - Github SourceControlType = "Github" - // VisualStudioTeamService ... - VisualStudioTeamService SourceControlType = "VisualStudioTeamService" -) - -// PossibleSourceControlTypeValues returns an array of possible values for the SourceControlType const type. -func PossibleSourceControlTypeValues() []SourceControlType { - return []SourceControlType{Github, VisualStudioTeamService} -} - -// SourceRegistryLoginMode enumerates the values for source registry login mode. -type SourceRegistryLoginMode string - -const ( - // SourceRegistryLoginModeDefault ... - SourceRegistryLoginModeDefault SourceRegistryLoginMode = "Default" - // SourceRegistryLoginModeNone ... - SourceRegistryLoginModeNone SourceRegistryLoginMode = "None" -) - -// PossibleSourceRegistryLoginModeValues returns an array of possible values for the SourceRegistryLoginMode const type. -func PossibleSourceRegistryLoginModeValues() []SourceRegistryLoginMode { - return []SourceRegistryLoginMode{SourceRegistryLoginModeDefault, SourceRegistryLoginModeNone} -} - -// SourceTriggerEvent enumerates the values for source trigger event. -type SourceTriggerEvent string - -const ( - // Commit ... - Commit SourceTriggerEvent = "commit" - // Pullrequest ... - Pullrequest SourceTriggerEvent = "pullrequest" -) - -// PossibleSourceTriggerEventValues returns an array of possible values for the SourceTriggerEvent const type. -func PossibleSourceTriggerEventValues() []SourceTriggerEvent { - return []SourceTriggerEvent{Commit, Pullrequest} -} - -// TaskStatus enumerates the values for task status. -type TaskStatus string - -const ( - // TaskStatusDisabled ... - TaskStatusDisabled TaskStatus = "Disabled" - // TaskStatusEnabled ... - TaskStatusEnabled TaskStatus = "Enabled" -) - -// PossibleTaskStatusValues returns an array of possible values for the TaskStatus const type. -func PossibleTaskStatusValues() []TaskStatus { - return []TaskStatus{TaskStatusDisabled, TaskStatusEnabled} -} - -// TokenType enumerates the values for token type. -type TokenType string - -const ( - // OAuth ... - OAuth TokenType = "OAuth" - // PAT ... - PAT TokenType = "PAT" -) - -// PossibleTokenTypeValues returns an array of possible values for the TokenType const type. -func PossibleTokenTypeValues() []TokenType { - return []TokenType{OAuth, PAT} -} - -// TriggerStatus enumerates the values for trigger status. -type TriggerStatus string - -const ( - // TriggerStatusDisabled ... - TriggerStatusDisabled TriggerStatus = "Disabled" - // TriggerStatusEnabled ... - TriggerStatusEnabled TriggerStatus = "Enabled" -) - -// PossibleTriggerStatusValues returns an array of possible values for the TriggerStatus const type. -func PossibleTriggerStatusValues() []TriggerStatus { - return []TriggerStatus{TriggerStatusDisabled, TriggerStatusEnabled} -} - -// TrustPolicyType enumerates the values for trust policy type. -type TrustPolicyType string - -const ( - // Notary ... - Notary TrustPolicyType = "Notary" -) - -// PossibleTrustPolicyTypeValues returns an array of possible values for the TrustPolicyType const type. -func PossibleTrustPolicyTypeValues() []TrustPolicyType { - return []TrustPolicyType{Notary} -} - -// Type enumerates the values for type. -type Type string - -const ( - // TypeDockerBuildRequest ... - TypeDockerBuildRequest Type = "DockerBuildRequest" - // TypeEncodedTaskRunRequest ... - TypeEncodedTaskRunRequest Type = "EncodedTaskRunRequest" - // TypeFileTaskRunRequest ... - TypeFileTaskRunRequest Type = "FileTaskRunRequest" - // TypeRunRequest ... - TypeRunRequest Type = "RunRequest" - // TypeTaskRunRequest ... - TypeTaskRunRequest Type = "TaskRunRequest" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{TypeDockerBuildRequest, TypeEncodedTaskRunRequest, TypeFileTaskRunRequest, TypeRunRequest, TypeTaskRunRequest} -} - -// TypeBasicTaskStepProperties enumerates the values for type basic task step properties. -type TypeBasicTaskStepProperties string - -const ( - // TypeDocker ... - TypeDocker TypeBasicTaskStepProperties = "Docker" - // TypeEncodedTask ... - TypeEncodedTask TypeBasicTaskStepProperties = "EncodedTask" - // TypeFileTask ... - TypeFileTask TypeBasicTaskStepProperties = "FileTask" - // TypeTaskStepProperties ... - TypeTaskStepProperties TypeBasicTaskStepProperties = "TaskStepProperties" -) - -// PossibleTypeBasicTaskStepPropertiesValues returns an array of possible values for the TypeBasicTaskStepProperties const type. -func PossibleTypeBasicTaskStepPropertiesValues() []TypeBasicTaskStepProperties { - return []TypeBasicTaskStepProperties{TypeDocker, TypeEncodedTask, TypeFileTask, TypeTaskStepProperties} -} - -// TypeBasicTaskStepUpdateParameters enumerates the values for type basic task step update parameters. -type TypeBasicTaskStepUpdateParameters string - -const ( - // TypeBasicTaskStepUpdateParametersTypeDocker ... - TypeBasicTaskStepUpdateParametersTypeDocker TypeBasicTaskStepUpdateParameters = "Docker" - // TypeBasicTaskStepUpdateParametersTypeEncodedTask ... - TypeBasicTaskStepUpdateParametersTypeEncodedTask TypeBasicTaskStepUpdateParameters = "EncodedTask" - // TypeBasicTaskStepUpdateParametersTypeFileTask ... - TypeBasicTaskStepUpdateParametersTypeFileTask TypeBasicTaskStepUpdateParameters = "FileTask" - // TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters ... - TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters TypeBasicTaskStepUpdateParameters = "TaskStepUpdateParameters" -) - -// PossibleTypeBasicTaskStepUpdateParametersValues returns an array of possible values for the TypeBasicTaskStepUpdateParameters const type. -func PossibleTypeBasicTaskStepUpdateParametersValues() []TypeBasicTaskStepUpdateParameters { - return []TypeBasicTaskStepUpdateParameters{TypeBasicTaskStepUpdateParametersTypeDocker, TypeBasicTaskStepUpdateParametersTypeEncodedTask, TypeBasicTaskStepUpdateParametersTypeFileTask, TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters} -} - -// Variant enumerates the values for variant. -type Variant string - -const ( - // V6 ... - V6 Variant = "v6" - // V7 ... - V7 Variant = "v7" - // V8 ... - V8 Variant = "v8" -) - -// PossibleVariantValues returns an array of possible values for the Variant const type. -func PossibleVariantValues() []Variant { - return []Variant{V6, V7, V8} -} - -// WebhookAction enumerates the values for webhook action. -type WebhookAction string - -const ( - // ChartDelete ... - ChartDelete WebhookAction = "chart_delete" - // ChartPush ... - ChartPush WebhookAction = "chart_push" - // Delete ... - Delete WebhookAction = "delete" - // Push ... - Push WebhookAction = "push" - // Quarantine ... - Quarantine WebhookAction = "quarantine" -) - -// PossibleWebhookActionValues returns an array of possible values for the WebhookAction const type. -func PossibleWebhookActionValues() []WebhookAction { - return []WebhookAction{ChartDelete, ChartPush, Delete, Push, Quarantine} -} - -// WebhookStatus enumerates the values for webhook status. -type WebhookStatus string - -const ( - // WebhookStatusDisabled ... - WebhookStatusDisabled WebhookStatus = "disabled" - // WebhookStatusEnabled ... - WebhookStatusEnabled WebhookStatus = "enabled" -) - -// PossibleWebhookStatusValues returns an array of possible values for the WebhookStatus const type. -func PossibleWebhookStatusValues() []WebhookStatus { - return []WebhookStatus{WebhookStatusDisabled, WebhookStatusEnabled} -} - // Actor the agent that initiated the event. For most situations, this could be from the authorization // context of the request. type Actor struct { @@ -1290,10 +773,15 @@ func (elr EventListResult) IsEmpty() bool { return elr.Value == nil || len(*elr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (elr EventListResult) hasNextLink() bool { + return elr.NextLink != nil && len(*elr.NextLink) != 0 +} + // eventListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (elr EventListResult) eventListResultPreparer(ctx context.Context) (*http.Request, error) { - if elr.NextLink == nil || len(to.String(elr.NextLink)) < 1 { + if !elr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1321,11 +809,16 @@ func (page *EventListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.elr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.elr) + if err != nil { + return err + } + page.elr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.elr = next return nil } @@ -1355,8 +848,11 @@ func (page EventListResultPage) Values() []Event { } // Creates a new instance of the EventListResultPage type. -func NewEventListResultPage(getNextPage func(context.Context, EventListResult) (EventListResult, error)) EventListResultPage { - return EventListResultPage{fn: getNextPage} +func NewEventListResultPage(cur EventListResult, getNextPage func(context.Context, EventListResult) (EventListResult, error)) EventListResultPage { + return EventListResultPage{ + fn: getNextPage, + elr: cur, + } } // EventRequestMessage the event request message sent to the service URI. @@ -1933,10 +1429,15 @@ func (olr OperationListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + if !olr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1964,11 +1465,16 @@ func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.olr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.olr = next return nil } @@ -1998,8 +1504,11 @@ func (page OperationListResultPage) Values() []OperationDefinition { } // Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{fn: getNextPage} +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } } // OperationMetricSpecificationDefinition the definition of Azure Monitoring metric. @@ -2086,12 +1595,25 @@ type RegenerateCredentialParameters struct { // RegistriesCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RegistriesCreateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (Registry, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RegistriesCreateFuture) Result(client RegistriesClient) (r Registry, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegistriesCreateFuture.Result. +func (future *RegistriesCreateFuture) result(client RegistriesClient) (r Registry, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2115,12 +1637,25 @@ func (future *RegistriesCreateFuture) Result(client RegistriesClient) (r Registr // RegistriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RegistriesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RegistriesDeleteFuture) Result(client RegistriesClient) (ar autorest.Response, err error) { +// result is the default implementation for RegistriesDeleteFuture.Result. +func (future *RegistriesDeleteFuture) result(client RegistriesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2138,12 +1673,25 @@ func (future *RegistriesDeleteFuture) Result(client RegistriesClient) (ar autore // RegistriesImportImageFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RegistriesImportImageFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RegistriesImportImageFuture) Result(client RegistriesClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesImportImageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegistriesImportImageFuture.Result. +func (future *RegistriesImportImageFuture) result(client RegistriesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2161,12 +1709,25 @@ func (future *RegistriesImportImageFuture) Result(client RegistriesClient) (ar a // RegistriesScheduleRunFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RegistriesScheduleRunFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (Run, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RegistriesScheduleRunFuture) Result(client RegistriesClient) (r Run, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesScheduleRunFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegistriesScheduleRunFuture.Result. +func (future *RegistriesScheduleRunFuture) result(client RegistriesClient) (r Run, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2190,12 +1751,25 @@ func (future *RegistriesScheduleRunFuture) Result(client RegistriesClient) (r Ru // RegistriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RegistriesUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (Registry, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RegistriesUpdateFuture) Result(client RegistriesClient) (r Registry, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegistriesUpdateFuture.Result. +func (future *RegistriesUpdateFuture) result(client RegistriesClient) (r Registry, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2417,10 +1991,15 @@ func (rlr RegistryListResult) IsEmpty() bool { return rlr.Value == nil || len(*rlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rlr RegistryListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + // registryListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rlr RegistryListResult) registryListResultPreparer(ctx context.Context) (*http.Request, error) { - if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + if !rlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2448,11 +2027,16 @@ func (page *RegistryListResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rlr = next return nil } @@ -2482,8 +2066,11 @@ func (page RegistryListResultPage) Values() []Registry { } // Creates a new instance of the RegistryListResultPage type. -func NewRegistryListResultPage(getNextPage func(context.Context, RegistryListResult) (RegistryListResult, error)) RegistryListResultPage { - return RegistryListResultPage{fn: getNextPage} +func NewRegistryListResultPage(cur RegistryListResult, getNextPage func(context.Context, RegistryListResult) (RegistryListResult, error)) RegistryListResultPage { + return RegistryListResultPage{ + fn: getNextPage, + rlr: cur, + } } // RegistryNameCheckRequest a request to check whether a container registry name is available. @@ -2533,6 +2120,24 @@ type RegistryProperties struct { Policies *Policies `json:"policies,omitempty"` } +// MarshalJSON is the custom marshaler for RegistryProperties. +func (rp RegistryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.AdminUserEnabled != nil { + objectMap["adminUserEnabled"] = rp.AdminUserEnabled + } + if rp.StorageAccount != nil { + objectMap["storageAccount"] = rp.StorageAccount + } + if rp.NetworkRuleSet != nil { + objectMap["networkRuleSet"] = rp.NetworkRuleSet + } + if rp.Policies != nil { + objectMap["policies"] = rp.Policies + } + return json.Marshal(objectMap) +} + // RegistryPropertiesUpdateParameters the parameters for updating the properties of a container registry. type RegistryPropertiesUpdateParameters struct { // AdminUserEnabled - The value that indicates whether the admin user is enabled. @@ -2807,10 +2412,15 @@ func (rlr ReplicationListResult) IsEmpty() bool { return rlr.Value == nil || len(*rlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rlr ReplicationListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + // replicationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rlr ReplicationListResult) replicationListResultPreparer(ctx context.Context) (*http.Request, error) { - if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + if !rlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2838,11 +2448,16 @@ func (page *ReplicationListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rlr = next return nil } @@ -2872,8 +2487,11 @@ func (page ReplicationListResultPage) Values() []Replication { } // Creates a new instance of the ReplicationListResultPage type. -func NewReplicationListResultPage(getNextPage func(context.Context, ReplicationListResult) (ReplicationListResult, error)) ReplicationListResultPage { - return ReplicationListResultPage{fn: getNextPage} +func NewReplicationListResultPage(cur ReplicationListResult, getNextPage func(context.Context, ReplicationListResult) (ReplicationListResult, error)) ReplicationListResultPage { + return ReplicationListResultPage{ + fn: getNextPage, + rlr: cur, + } } // ReplicationProperties the properties of a replication. @@ -2887,12 +2505,25 @@ type ReplicationProperties struct { // ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ReplicationsCreateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationsClient) (Replication, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicationsCreateFuture) Result(client ReplicationsClient) (r Replication, err error) { +// result is the default implementation for ReplicationsCreateFuture.Result. +func (future *ReplicationsCreateFuture) result(client ReplicationsClient) (r Replication, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2916,12 +2547,25 @@ func (future *ReplicationsCreateFuture) Result(client ReplicationsClient) (r Rep // ReplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ReplicationsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicationsDeleteFuture) Result(client ReplicationsClient) (ar autorest.Response, err error) { +// result is the default implementation for ReplicationsDeleteFuture.Result. +func (future *ReplicationsDeleteFuture) result(client ReplicationsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2939,12 +2583,25 @@ func (future *ReplicationsDeleteFuture) Result(client ReplicationsClient) (ar au // ReplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ReplicationsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationsClient) (Replication, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ReplicationsUpdateFuture) Result(client ReplicationsClient) (r Replication, err error) { +// result is the default implementation for ReplicationsUpdateFuture.Result. +func (future *ReplicationsUpdateFuture) result(client ReplicationsClient) (r Replication, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3030,6 +2687,18 @@ type RetentionPolicy struct { Status PolicyStatus `json:"status,omitempty"` } +// MarshalJSON is the custom marshaler for RetentionPolicy. +func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Days != nil { + objectMap["days"] = rp.Days + } + if rp.Status != "" { + objectMap["status"] = rp.Status + } + return json.Marshal(objectMap) +} + // Run run resource properties type Run struct { autorest.Response `json:"-"` @@ -3208,10 +2877,15 @@ func (rlr RunListResult) IsEmpty() bool { return rlr.Value == nil || len(*rlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rlr RunListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + // runListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rlr RunListResult) runListResultPreparer(ctx context.Context) (*http.Request, error) { - if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + if !rlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3239,11 +2913,16 @@ func (page *RunListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rlr = next return nil } @@ -3273,8 +2952,11 @@ func (page RunListResultPage) Values() []Run { } // Creates a new instance of the RunListResultPage type. -func NewRunListResultPage(getNextPage func(context.Context, RunListResult) (RunListResult, error)) RunListResultPage { - return RunListResultPage{fn: getNextPage} +func NewRunListResultPage(cur RunListResult, getNextPage func(context.Context, RunListResult) (RunListResult, error)) RunListResultPage { + return RunListResultPage{ + fn: getNextPage, + rlr: cur, + } } // RunProperties the properties for a run. @@ -3319,6 +3001,66 @@ type RunProperties struct { TimerTrigger *TimerTriggerDescriptor `json:"timerTrigger,omitempty"` } +// MarshalJSON is the custom marshaler for RunProperties. +func (rp RunProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.RunID != nil { + objectMap["runId"] = rp.RunID + } + if rp.Status != "" { + objectMap["status"] = rp.Status + } + if rp.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = rp.LastUpdatedTime + } + if rp.RunType != "" { + objectMap["runType"] = rp.RunType + } + if rp.CreateTime != nil { + objectMap["createTime"] = rp.CreateTime + } + if rp.StartTime != nil { + objectMap["startTime"] = rp.StartTime + } + if rp.FinishTime != nil { + objectMap["finishTime"] = rp.FinishTime + } + if rp.OutputImages != nil { + objectMap["outputImages"] = rp.OutputImages + } + if rp.Task != nil { + objectMap["task"] = rp.Task + } + if rp.ImageUpdateTrigger != nil { + objectMap["imageUpdateTrigger"] = rp.ImageUpdateTrigger + } + if rp.SourceTrigger != nil { + objectMap["sourceTrigger"] = rp.SourceTrigger + } + if rp.Platform != nil { + objectMap["platform"] = rp.Platform + } + if rp.AgentConfiguration != nil { + objectMap["agentConfiguration"] = rp.AgentConfiguration + } + if rp.SourceRegistryAuth != nil { + objectMap["sourceRegistryAuth"] = rp.SourceRegistryAuth + } + if rp.CustomRegistries != nil { + objectMap["customRegistries"] = rp.CustomRegistries + } + if rp.ProvisioningState != "" { + objectMap["provisioningState"] = rp.ProvisioningState + } + if rp.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = rp.IsArchiveEnabled + } + if rp.TimerTrigger != nil { + objectMap["timerTrigger"] = rp.TimerTrigger + } + return json.Marshal(objectMap) +} + // BasicRunRequest the request parameters for scheduling a run. type BasicRunRequest interface { AsDockerBuildRequest() (*DockerBuildRequest, bool) @@ -3430,12 +3172,25 @@ func (rr RunRequest) AsBasicRunRequest() (BasicRunRequest, bool) { // RunsCancelFuture an abstraction for monitoring and retrieving the results of a long-running operation. type RunsCancelFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RunsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RunsCancelFuture) Result(client RunsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RunsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RunsCancelFuture.Result. +func (future *RunsCancelFuture) result(client RunsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3452,12 +3207,25 @@ func (future *RunsCancelFuture) Result(client RunsClient) (ar autorest.Response, // RunsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type RunsUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RunsClient) (Run, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RunsUpdateFuture) Result(client RunsClient) (r Run, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RunsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RunsUpdateFuture.Result. +func (future *RunsUpdateFuture) result(client RunsClient) (r Run, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3513,6 +3281,15 @@ type Sku struct { Tier SkuTier `json:"tier,omitempty"` } +// MarshalJSON is the custom marshaler for Sku. +func (s Sku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Name != "" { + objectMap["name"] = s.Name + } + return json.Marshal(objectMap) +} + // Source the registry node that generated the event. Put differently, while the actor initiates the event, // the source generates it. type Source struct { @@ -3839,10 +3616,15 @@ func (tlr TaskListResult) IsEmpty() bool { return tlr.Value == nil || len(*tlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (tlr TaskListResult) hasNextLink() bool { + return tlr.NextLink != nil && len(*tlr.NextLink) != 0 +} + // taskListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (tlr TaskListResult) taskListResultPreparer(ctx context.Context) (*http.Request, error) { - if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { + if !tlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3870,11 +3652,16 @@ func (page *TaskListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.tlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.tlr) + if err != nil { + return err + } + page.tlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.tlr = next return nil } @@ -3904,8 +3691,11 @@ func (page TaskListResultPage) Values() []Task { } // Creates a new instance of the TaskListResultPage type. -func NewTaskListResultPage(getNextPage func(context.Context, TaskListResult) (TaskListResult, error)) TaskListResultPage { - return TaskListResultPage{fn: getNextPage} +func NewTaskListResultPage(cur TaskListResult, getNextPage func(context.Context, TaskListResult) (TaskListResult, error)) TaskListResultPage { + return TaskListResultPage{ + fn: getNextPage, + tlr: cur, + } } // TaskProperties the properties of a task. @@ -3930,6 +3720,31 @@ type TaskProperties struct { Credentials *Credentials `json:"credentials,omitempty"` } +// MarshalJSON is the custom marshaler for TaskProperties. +func (tp TaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tp.Status != "" { + objectMap["status"] = tp.Status + } + if tp.Platform != nil { + objectMap["platform"] = tp.Platform + } + if tp.AgentConfiguration != nil { + objectMap["agentConfiguration"] = tp.AgentConfiguration + } + if tp.Timeout != nil { + objectMap["timeout"] = tp.Timeout + } + objectMap["step"] = tp.Step + if tp.Trigger != nil { + objectMap["trigger"] = tp.Trigger + } + if tp.Credentials != nil { + objectMap["credentials"] = tp.Credentials + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for TaskProperties struct. func (tp *TaskProperties) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -4183,12 +3998,25 @@ func (trr TaskRunRequest) AsBasicRunRequest() (BasicRunRequest, bool) { // TasksCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type TasksCreateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TasksClient) (Task, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *TasksCreateFuture) Result(client TasksClient) (t Task, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TasksCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TasksCreateFuture.Result. +func (future *TasksCreateFuture) result(client TasksClient) (t Task, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4211,12 +4039,25 @@ func (future *TasksCreateFuture) Result(client TasksClient) (t Task, err error) // TasksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type TasksDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TasksClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TasksDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *TasksDeleteFuture) Result(client TasksClient) (ar autorest.Response, err error) { +// result is the default implementation for TasksDeleteFuture.Result. +func (future *TasksDeleteFuture) result(client TasksClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4443,12 +4284,25 @@ func (tsup TaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTas // TasksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type TasksUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TasksClient) (Task, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TasksUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *TasksUpdateFuture) Result(client TasksClient) (t Task, err error) { +// result is the default implementation for TasksUpdateFuture.Result. +func (future *TasksUpdateFuture) result(client TasksClient) (t Task, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4853,10 +4707,15 @@ func (wlr WebhookListResult) IsEmpty() bool { return wlr.Value == nil || len(*wlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (wlr WebhookListResult) hasNextLink() bool { + return wlr.NextLink != nil && len(*wlr.NextLink) != 0 +} + // webhookListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (wlr WebhookListResult) webhookListResultPreparer(ctx context.Context) (*http.Request, error) { - if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 { + if !wlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -4884,11 +4743,16 @@ func (page *WebhookListResultPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.wlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.wlr) + if err != nil { + return err + } + page.wlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.wlr = next return nil } @@ -4918,8 +4782,11 @@ func (page WebhookListResultPage) Values() []Webhook { } // Creates a new instance of the WebhookListResultPage type. -func NewWebhookListResultPage(getNextPage func(context.Context, WebhookListResult) (WebhookListResult, error)) WebhookListResultPage { - return WebhookListResultPage{fn: getNextPage} +func NewWebhookListResultPage(cur WebhookListResult, getNextPage func(context.Context, WebhookListResult) (WebhookListResult, error)) WebhookListResultPage { + return WebhookListResultPage{ + fn: getNextPage, + wlr: cur, + } } // WebhookProperties the properties of a webhook. @@ -4934,6 +4801,21 @@ type WebhookProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookProperties. +func (wp WebhookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.Status != "" { + objectMap["status"] = wp.Status + } + if wp.Scope != nil { + objectMap["scope"] = wp.Scope + } + if wp.Actions != nil { + objectMap["actions"] = wp.Actions + } + return json.Marshal(objectMap) +} + // WebhookPropertiesCreateParameters the parameters for creating the properties of a webhook. type WebhookPropertiesCreateParameters struct { // ServiceURI - The service URI for the webhook to post notifications. @@ -5007,12 +4889,25 @@ func (wpup WebhookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { // WebhooksCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type WebhooksCreateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WebhooksClient) (Webhook, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WebhooksCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WebhooksCreateFuture) Result(client WebhooksClient) (w Webhook, err error) { +// result is the default implementation for WebhooksCreateFuture.Result. +func (future *WebhooksCreateFuture) result(client WebhooksClient) (w Webhook, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5036,12 +4931,25 @@ func (future *WebhooksCreateFuture) Result(client WebhooksClient) (w Webhook, er // WebhooksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type WebhooksDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WebhooksClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WebhooksDeleteFuture) Result(client WebhooksClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WebhooksDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WebhooksDeleteFuture.Result. +func (future *WebhooksDeleteFuture) result(client WebhooksClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5059,12 +4967,25 @@ func (future *WebhooksDeleteFuture) Result(client WebhooksClient) (ar autorest.R // WebhooksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type WebhooksUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WebhooksClient) (Webhook, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WebhooksUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WebhooksUpdateFuture) Result(client WebhooksClient) (w Webhook, err error) { +// result is the default implementation for WebhooksUpdateFuture.Result. +func (future *WebhooksUpdateFuture) result(client WebhooksClient) (w Webhook, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/operations.go index 9014900552ea..86a7947a8b6b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/operations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/operations.go @@ -1,18 +1,7 @@ package containerregistry -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -70,6 +59,11 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result.olr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -101,7 +95,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/registries.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/registries.go index 4ba0f940ead4..c040c70e07b4 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/registries.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/registries.go @@ -1,18 +1,7 @@ package containerregistry -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -84,6 +73,7 @@ func (client RegistriesClient) CheckNameAvailability(ctx context.Context, regist result, err = client.CheckNameAvailabilityResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", resp, "Failure responding to request") + return } return @@ -121,7 +111,6 @@ func (client RegistriesClient) CheckNameAvailabilitySender(req *http.Request) (* func (client RegistriesClient) CheckNameAvailabilityResponder(resp *http.Response) (result RegistryNameStatus, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -139,8 +128,8 @@ func (client RegistriesClient) Create(ctx context.Context, resourceGroupName str ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Create") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -169,7 +158,7 @@ func (client RegistriesClient) Create(ctx context.Context, resourceGroupName str result, err = client.CreateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Create", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Create", nil, "Failure sending request") return } @@ -207,7 +196,10 @@ func (client RegistriesClient) CreateSender(req *http.Request) (future Registrie if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -216,7 +208,6 @@ func (client RegistriesClient) CreateSender(req *http.Request) (future Registrie func (client RegistriesClient) CreateResponder(resp *http.Response) (result Registry, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -233,8 +224,8 @@ func (client RegistriesClient) Delete(ctx context.Context, resourceGroupName str ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -257,7 +248,7 @@ func (client RegistriesClient) Delete(ctx context.Context, resourceGroupName str result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", nil, "Failure sending request") return } @@ -293,7 +284,10 @@ func (client RegistriesClient) DeleteSender(req *http.Request) (future Registrie if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -302,7 +296,6 @@ func (client RegistriesClient) DeleteSender(req *http.Request) (future Registrie func (client RegistriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -350,6 +343,7 @@ func (client RegistriesClient) Get(ctx context.Context, resourceGroupName string result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Get", resp, "Failure responding to request") + return } return @@ -387,7 +381,6 @@ func (client RegistriesClient) GetSender(req *http.Request) (*http.Response, err func (client RegistriesClient) GetResponder(resp *http.Response) (result Registry, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -436,6 +429,7 @@ func (client RegistriesClient) GetBuildSourceUploadURL(ctx context.Context, reso result, err = client.GetBuildSourceUploadURLResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetBuildSourceUploadURL", resp, "Failure responding to request") + return } return @@ -473,7 +467,6 @@ func (client RegistriesClient) GetBuildSourceUploadURLSender(req *http.Request) func (client RegistriesClient) GetBuildSourceUploadURLResponder(resp *http.Response) (result SourceUploadDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -491,8 +484,8 @@ func (client RegistriesClient) ImportImage(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ImportImage") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -521,7 +514,7 @@ func (client RegistriesClient) ImportImage(ctx context.Context, resourceGroupNam result, err = client.ImportImageSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ImportImage", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ImportImage", nil, "Failure sending request") return } @@ -559,7 +552,10 @@ func (client RegistriesClient) ImportImageSender(req *http.Request) (future Regi if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -568,7 +564,6 @@ func (client RegistriesClient) ImportImageSender(req *http.Request) (future Regi func (client RegistriesClient) ImportImageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -604,6 +599,11 @@ func (client RegistriesClient) List(ctx context.Context) (result RegistryListRes result.rlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -639,7 +639,6 @@ func (client RegistriesClient) ListSender(req *http.Request) (*http.Response, er func (client RegistriesClient) ListResponder(resp *http.Response) (result RegistryListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -721,6 +720,11 @@ func (client RegistriesClient) ListByResourceGroup(ctx context.Context, resource result.rlr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -757,7 +761,6 @@ func (client RegistriesClient) ListByResourceGroupSender(req *http.Request) (*ht func (client RegistriesClient) ListByResourceGroupResponder(resp *http.Response) (result RegistryListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -843,6 +846,7 @@ func (client RegistriesClient) ListCredentials(ctx context.Context, resourceGrou result, err = client.ListCredentialsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListCredentials", resp, "Failure responding to request") + return } return @@ -880,7 +884,6 @@ func (client RegistriesClient) ListCredentialsSender(req *http.Request) (*http.R func (client RegistriesClient) ListCredentialsResponder(resp *http.Response) (result RegistryListCredentialsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -929,6 +932,7 @@ func (client RegistriesClient) ListUsages(ctx context.Context, resourceGroupName result, err = client.ListUsagesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", resp, "Failure responding to request") + return } return @@ -966,7 +970,6 @@ func (client RegistriesClient) ListUsagesSender(req *http.Request) (*http.Respon func (client RegistriesClient) ListUsagesResponder(resp *http.Response) (result RegistryUsageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1017,6 +1020,7 @@ func (client RegistriesClient) RegenerateCredential(ctx context.Context, resourc result, err = client.RegenerateCredentialResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredential", resp, "Failure responding to request") + return } return @@ -1056,7 +1060,6 @@ func (client RegistriesClient) RegenerateCredentialSender(req *http.Request) (*h func (client RegistriesClient) RegenerateCredentialResponder(resp *http.Response) (result RegistryListCredentialsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1074,8 +1077,8 @@ func (client RegistriesClient) ScheduleRun(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ScheduleRun") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1098,7 +1101,7 @@ func (client RegistriesClient) ScheduleRun(ctx context.Context, resourceGroupNam result, err = client.ScheduleRunSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ScheduleRun", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ScheduleRun", nil, "Failure sending request") return } @@ -1136,7 +1139,10 @@ func (client RegistriesClient) ScheduleRunSender(req *http.Request) (future Regi if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1145,7 +1151,6 @@ func (client RegistriesClient) ScheduleRunSender(req *http.Request) (future Regi func (client RegistriesClient) ScheduleRunResponder(resp *http.Response) (result Run, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1163,8 +1168,8 @@ func (client RegistriesClient) Update(ctx context.Context, resourceGroupName str ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1187,7 +1192,7 @@ func (client RegistriesClient) Update(ctx context.Context, resourceGroupName str result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", nil, "Failure sending request") return } @@ -1225,7 +1230,10 @@ func (client RegistriesClient) UpdateSender(req *http.Request) (future Registrie if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1234,7 +1242,6 @@ func (client RegistriesClient) UpdateSender(req *http.Request) (future Registrie func (client RegistriesClient) UpdateResponder(resp *http.Response) (result Registry, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/replications.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/replications.go index 045c66b790f1..aaa51100d8a4 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/replications.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/replications.go @@ -1,18 +1,7 @@ package containerregistry -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client ReplicationsClient) Create(ctx context.Context, resourceGroupName s ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Create") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -81,7 +70,7 @@ func (client ReplicationsClient) Create(ctx context.Context, resourceGroupName s result, err = client.CreateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Create", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Create", nil, "Failure sending request") return } @@ -120,7 +109,10 @@ func (client ReplicationsClient) CreateSender(req *http.Request) (future Replica if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -129,7 +121,6 @@ func (client ReplicationsClient) CreateSender(req *http.Request) (future Replica func (client ReplicationsClient) CreateResponder(resp *http.Response) (result Replication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -147,8 +138,8 @@ func (client ReplicationsClient) Delete(ctx context.Context, resourceGroupName s ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -175,7 +166,7 @@ func (client ReplicationsClient) Delete(ctx context.Context, resourceGroupName s result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Delete", nil, "Failure sending request") return } @@ -212,7 +203,10 @@ func (client ReplicationsClient) DeleteSender(req *http.Request) (future Replica if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -221,7 +215,6 @@ func (client ReplicationsClient) DeleteSender(req *http.Request) (future Replica func (client ReplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -274,6 +267,7 @@ func (client ReplicationsClient) Get(ctx context.Context, resourceGroupName stri result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", resp, "Failure responding to request") + return } return @@ -312,7 +306,6 @@ func (client ReplicationsClient) GetSender(req *http.Request) (*http.Response, e func (client ReplicationsClient) GetResponder(resp *http.Response) (result Replication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -362,6 +355,11 @@ func (client ReplicationsClient) List(ctx context.Context, resourceGroupName str result.rlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -399,7 +397,6 @@ func (client ReplicationsClient) ListSender(req *http.Request) (*http.Response, func (client ReplicationsClient) ListResponder(resp *http.Response) (result ReplicationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -455,8 +452,8 @@ func (client ReplicationsClient) Update(ctx context.Context, resourceGroupName s ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -483,7 +480,7 @@ func (client ReplicationsClient) Update(ctx context.Context, resourceGroupName s result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Update", nil, "Failure sending request") return } @@ -522,7 +519,10 @@ func (client ReplicationsClient) UpdateSender(req *http.Request) (future Replica if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -531,7 +531,6 @@ func (client ReplicationsClient) UpdateSender(req *http.Request) (future Replica func (client ReplicationsClient) UpdateResponder(resp *http.Response) (result Replication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/runs.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/runs.go index 91c393f0c713..8c4cd26ab417 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/runs.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/runs.go @@ -1,18 +1,7 @@ package containerregistry -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client RunsClient) Cancel(ctx context.Context, resourceGroupName string, r ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.Cancel") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -76,7 +65,7 @@ func (client RunsClient) Cancel(ctx context.Context, resourceGroupName string, r result, err = client.CancelSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Cancel", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Cancel", nil, "Failure sending request") return } @@ -113,7 +102,10 @@ func (client RunsClient) CancelSender(req *http.Request) (future RunsCancelFutur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -122,7 +114,6 @@ func (client RunsClient) CancelSender(req *http.Request) (future RunsCancelFutur func (client RunsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -171,6 +162,7 @@ func (client RunsClient) Get(ctx context.Context, resourceGroupName string, regi result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Get", resp, "Failure responding to request") + return } return @@ -209,7 +201,6 @@ func (client RunsClient) GetSender(req *http.Request) (*http.Response, error) { func (client RunsClient) GetResponder(resp *http.Response) (result Run, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -259,6 +250,7 @@ func (client RunsClient) GetLogSasURL(ctx context.Context, resourceGroupName str result, err = client.GetLogSasURLResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "GetLogSasURL", resp, "Failure responding to request") + return } return @@ -297,7 +289,6 @@ func (client RunsClient) GetLogSasURLSender(req *http.Request) (*http.Response, func (client RunsClient) GetLogSasURLResponder(resp *http.Response) (result RunGetLogResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -350,6 +341,11 @@ func (client RunsClient) List(ctx context.Context, resourceGroupName string, reg result.rlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "List", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -393,7 +389,6 @@ func (client RunsClient) ListSender(req *http.Request) (*http.Response, error) { func (client RunsClient) ListResponder(resp *http.Response) (result RunListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -449,8 +444,8 @@ func (client RunsClient) Update(ctx context.Context, resourceGroupName string, r ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -473,7 +468,7 @@ func (client RunsClient) Update(ctx context.Context, resourceGroupName string, r result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Update", nil, "Failure sending request") return } @@ -512,7 +507,10 @@ func (client RunsClient) UpdateSender(req *http.Request) (future RunsUpdateFutur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -521,7 +519,6 @@ func (client RunsClient) UpdateSender(req *http.Request) (future RunsUpdateFutur func (client RunsClient) UpdateResponder(resp *http.Response) (result Run, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/tasks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/tasks.go index fc11eb857ed0..c48959f99727 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/tasks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/tasks.go @@ -1,18 +1,7 @@ package containerregistry -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client TasksClient) Create(ctx context.Context, resourceGroupName string, ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.Create") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -77,7 +66,6 @@ func (client TasksClient) Create(ctx context.Context, resourceGroupName string, Chain: []validation.Constraint{{Target: "taskCreateParameters.TaskProperties.Timeout", Name: validation.InclusiveMaximum, Rule: int64(28800), Chain: nil}, {Target: "taskCreateParameters.TaskProperties.Timeout", Name: validation.InclusiveMinimum, Rule: int64(300), Chain: nil}, }}, - {Target: "taskCreateParameters.TaskProperties.Step", Name: validation.Null, Rule: true, Chain: nil}, {Target: "taskCreateParameters.TaskProperties.Trigger", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "taskCreateParameters.TaskProperties.Trigger.BaseImageTrigger", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "taskCreateParameters.TaskProperties.Trigger.BaseImageTrigger.Name", Name: validation.Null, Rule: true, Chain: nil}}}, @@ -94,7 +82,7 @@ func (client TasksClient) Create(ctx context.Context, resourceGroupName string, result, err = client.CreateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Create", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Create", nil, "Failure sending request") return } @@ -133,7 +121,10 @@ func (client TasksClient) CreateSender(req *http.Request) (future TasksCreateFut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -142,7 +133,6 @@ func (client TasksClient) CreateSender(req *http.Request) (future TasksCreateFut func (client TasksClient) CreateResponder(resp *http.Response) (result Task, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -160,8 +150,8 @@ func (client TasksClient) Delete(ctx context.Context, resourceGroupName string, ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -188,7 +178,7 @@ func (client TasksClient) Delete(ctx context.Context, resourceGroupName string, result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Delete", nil, "Failure sending request") return } @@ -225,7 +215,10 @@ func (client TasksClient) DeleteSender(req *http.Request) (future TasksDeleteFut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -234,7 +227,6 @@ func (client TasksClient) DeleteSender(req *http.Request) (future TasksDeleteFut func (client TasksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -287,6 +279,7 @@ func (client TasksClient) Get(ctx context.Context, resourceGroupName string, reg result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Get", resp, "Failure responding to request") + return } return @@ -325,7 +318,6 @@ func (client TasksClient) GetSender(req *http.Request) (*http.Response, error) { func (client TasksClient) GetResponder(resp *http.Response) (result Task, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -379,6 +371,7 @@ func (client TasksClient) GetDetails(ctx context.Context, resourceGroupName stri result, err = client.GetDetailsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "GetDetails", resp, "Failure responding to request") + return } return @@ -417,7 +410,6 @@ func (client TasksClient) GetDetailsSender(req *http.Request) (*http.Response, e func (client TasksClient) GetDetailsResponder(resp *http.Response) (result Task, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -467,6 +459,11 @@ func (client TasksClient) List(ctx context.Context, resourceGroupName string, re result.tlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "List", resp, "Failure responding to request") + return + } + if result.tlr.hasNextLink() && result.tlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -504,7 +501,6 @@ func (client TasksClient) ListSender(req *http.Request) (*http.Response, error) func (client TasksClient) ListResponder(resp *http.Response) (result TaskListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -560,8 +556,8 @@ func (client TasksClient) Update(ctx context.Context, resourceGroupName string, ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -588,7 +584,7 @@ func (client TasksClient) Update(ctx context.Context, resourceGroupName string, result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Update", nil, "Failure sending request") return } @@ -627,7 +623,10 @@ func (client TasksClient) UpdateSender(req *http.Request) (future TasksUpdateFut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -636,7 +635,6 @@ func (client TasksClient) UpdateSender(req *http.Request) (future TasksUpdateFut func (client TasksClient) UpdateResponder(resp *http.Response) (result Task, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/version.go index 8c51fa478b79..fb255e3b7482 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/version.go @@ -2,19 +2,8 @@ package containerregistry import "github.com/Azure/azure-sdk-for-go/version" -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/webhooks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/webhooks.go index 7de5c13ec5fb..848cdf190133 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/webhooks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/webhooks.go @@ -1,18 +1,7 @@ package containerregistry -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client WebhooksClient) Create(ctx context.Context, resourceGroupName strin ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Create") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -87,7 +76,7 @@ func (client WebhooksClient) Create(ctx context.Context, resourceGroupName strin result, err = client.CreateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Create", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Create", nil, "Failure sending request") return } @@ -126,7 +115,10 @@ func (client WebhooksClient) CreateSender(req *http.Request) (future WebhooksCre if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -135,7 +127,6 @@ func (client WebhooksClient) CreateSender(req *http.Request) (future WebhooksCre func (client WebhooksClient) CreateResponder(resp *http.Response) (result Webhook, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,8 +144,8 @@ func (client WebhooksClient) Delete(ctx context.Context, resourceGroupName strin ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -181,7 +172,7 @@ func (client WebhooksClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Delete", nil, "Failure sending request") return } @@ -218,7 +209,10 @@ func (client WebhooksClient) DeleteSender(req *http.Request) (future WebhooksDel if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -227,7 +221,6 @@ func (client WebhooksClient) DeleteSender(req *http.Request) (future WebhooksDel func (client WebhooksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -280,6 +273,7 @@ func (client WebhooksClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", resp, "Failure responding to request") + return } return @@ -318,7 +312,6 @@ func (client WebhooksClient) GetSender(req *http.Request) (*http.Response, error func (client WebhooksClient) GetResponder(resp *http.Response) (result Webhook, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -372,6 +365,7 @@ func (client WebhooksClient) GetCallbackConfig(ctx context.Context, resourceGrou result, err = client.GetCallbackConfigResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", resp, "Failure responding to request") + return } return @@ -410,7 +404,6 @@ func (client WebhooksClient) GetCallbackConfigSender(req *http.Request) (*http.R func (client WebhooksClient) GetCallbackConfigResponder(resp *http.Response) (result CallbackConfig, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -460,6 +453,11 @@ func (client WebhooksClient) List(ctx context.Context, resourceGroupName string, result.wlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure responding to request") + return + } + if result.wlr.hasNextLink() && result.wlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -497,7 +495,6 @@ func (client WebhooksClient) ListSender(req *http.Request) (*http.Response, erro func (client WebhooksClient) ListResponder(resp *http.Response) (result WebhookListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -589,6 +586,11 @@ func (client WebhooksClient) ListEvents(ctx context.Context, resourceGroupName s result.elr, err = client.ListEventsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure responding to request") + return + } + if result.elr.hasNextLink() && result.elr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -627,7 +629,6 @@ func (client WebhooksClient) ListEventsSender(req *http.Request) (*http.Response func (client WebhooksClient) ListEventsResponder(resp *http.Response) (result EventListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -718,6 +719,7 @@ func (client WebhooksClient) Ping(ctx context.Context, resourceGroupName string, result, err = client.PingResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", resp, "Failure responding to request") + return } return @@ -756,7 +758,6 @@ func (client WebhooksClient) PingSender(req *http.Request) (*http.Response, erro func (client WebhooksClient) PingResponder(resp *http.Response) (result EventInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -775,8 +776,8 @@ func (client WebhooksClient) Update(ctx context.Context, resourceGroupName strin ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -803,7 +804,7 @@ func (client WebhooksClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Update", nil, "Failure sending request") return } @@ -842,7 +843,10 @@ func (client WebhooksClient) UpdateSender(req *http.Request) (future WebhooksUpd if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -851,7 +855,6 @@ func (client WebhooksClient) UpdateSender(req *http.Request) (future WebhooksUpd func (client WebhooksClient) UpdateResponder(resp *http.Response) (result Webhook, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/CHANGELOG.md new file mode 100644 index 000000000000..4adb7524e145 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/CHANGELOG.md @@ -0,0 +1,20 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/containerservice/resource-manager/readme.md tag: `package-2020-04` + +Code generator @microsoft.azure/autorest.go@2.1.178 + + +### New Funcs + +1. *AgentPoolsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *AgentPoolsDeleteFuture.UnmarshalJSON([]byte) error +1. *ContainerServicesCreateOrUpdateFutureType.UnmarshalJSON([]byte) error +1. *ContainerServicesDeleteFutureType.UnmarshalJSON([]byte) error +1. *ManagedClustersCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ManagedClustersDeleteFuture.UnmarshalJSON([]byte) error +1. *ManagedClustersResetAADProfileFuture.UnmarshalJSON([]byte) error +1. *ManagedClustersResetServicePrincipalProfileFuture.UnmarshalJSON([]byte) error +1. *ManagedClustersRotateClusterCertificatesFuture.UnmarshalJSON([]byte) error +1. *ManagedClustersUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *OpenShiftManagedClustersCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *OpenShiftManagedClustersDeleteFuture.UnmarshalJSON([]byte) error +1. *OpenShiftManagedClustersUpdateTagsFuture.UnmarshalJSON([]byte) error diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/agentpools.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/agentpools.go index 65f696ef58ba..941a2edf44ff 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/agentpools.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/agentpools.go @@ -1,18 +1,7 @@ package containerservice -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -77,7 +66,7 @@ func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroup result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -116,7 +105,10 @@ func (client AgentPoolsClient) CreateOrUpdateSender(req *http.Request) (future A if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -125,7 +117,6 @@ func (client AgentPoolsClient) CreateOrUpdateSender(req *http.Request) (future A func (client AgentPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result AgentPool, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -143,8 +134,8 @@ func (client AgentPoolsClient) Delete(ctx context.Context, resourceGroupName str ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -167,7 +158,7 @@ func (client AgentPoolsClient) Delete(ctx context.Context, resourceGroupName str result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", nil, "Failure sending request") return } @@ -204,7 +195,10 @@ func (client AgentPoolsClient) DeleteSender(req *http.Request) (future AgentPool if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -213,7 +207,6 @@ func (client AgentPoolsClient) DeleteSender(req *http.Request) (future AgentPool func (client AgentPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -262,6 +255,7 @@ func (client AgentPoolsClient) Get(ctx context.Context, resourceGroupName string result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure responding to request") + return } return @@ -300,7 +294,6 @@ func (client AgentPoolsClient) GetSender(req *http.Request) (*http.Response, err func (client AgentPoolsClient) GetResponder(resp *http.Response) (result AgentPool, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -349,6 +342,7 @@ func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context result, err = client.GetAvailableAgentPoolVersionsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure responding to request") + return } return @@ -386,7 +380,6 @@ func (client AgentPoolsClient) GetAvailableAgentPoolVersionsSender(req *http.Req func (client AgentPoolsClient) GetAvailableAgentPoolVersionsResponder(resp *http.Response) (result AgentPoolAvailableVersions, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -437,6 +430,7 @@ func (client AgentPoolsClient) GetUpgradeProfile(ctx context.Context, resourceGr result, err = client.GetUpgradeProfileResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure responding to request") + return } return @@ -475,7 +469,6 @@ func (client AgentPoolsClient) GetUpgradeProfileSender(req *http.Request) (*http func (client AgentPoolsClient) GetUpgradeProfileResponder(resp *http.Response) (result AgentPoolUpgradeProfile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -526,6 +519,11 @@ func (client AgentPoolsClient) List(ctx context.Context, resourceGroupName strin result.aplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure responding to request") + return + } + if result.aplr.hasNextLink() && result.aplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -563,7 +561,6 @@ func (client AgentPoolsClient) ListSender(req *http.Request) (*http.Response, er func (client AgentPoolsClient) ListResponder(resp *http.Response) (result AgentPoolListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/client.go index 858e168f208f..0720193b7aaa 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/client.go @@ -3,19 +3,8 @@ // The Container Service Client. package containerservice -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/containerservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/containerservices.go index c059245f0e0e..b0d0759ab9d8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/containerservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/containerservices.go @@ -1,18 +1,7 @@ package containerservice -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -102,7 +91,7 @@ func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resour result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -140,7 +129,10 @@ func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -149,7 +141,6 @@ func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (f func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -169,8 +160,8 @@ func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -183,7 +174,7 @@ func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupN result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", nil, "Failure sending request") return } @@ -219,7 +210,10 @@ func (client ContainerServicesClient) DeleteSender(req *http.Request) (future Co if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -228,7 +222,6 @@ func (client ContainerServicesClient) DeleteSender(req *http.Request) (future Co func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -268,6 +261,7 @@ func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", resp, "Failure responding to request") + return } return @@ -305,7 +299,6 @@ func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Respon func (client ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -343,6 +336,11 @@ func (client ContainerServicesClient) List(ctx context.Context) (result ListResu result.lr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", resp, "Failure responding to request") + return + } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -378,7 +376,6 @@ func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Respo func (client ContainerServicesClient) ListResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -456,6 +453,11 @@ func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, r result.lr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -492,7 +494,6 @@ func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Reques func (client ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -570,6 +571,7 @@ func (client ContainerServicesClient) ListOrchestrators(ctx context.Context, loc result, err = client.ListOrchestratorsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", resp, "Failure responding to request") + return } return @@ -609,7 +611,6 @@ func (client ContainerServicesClient) ListOrchestratorsSender(req *http.Request) func (client ContainerServicesClient) ListOrchestratorsResponder(resp *http.Response) (result OrchestratorVersionProfileListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/enums.go new file mode 100644 index 000000000000..13c22893adff --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/enums.go @@ -0,0 +1,702 @@ +package containerservice + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AgentPoolMode enumerates the values for agent pool mode. +type AgentPoolMode string + +const ( + // System ... + System AgentPoolMode = "System" + // User ... + User AgentPoolMode = "User" +) + +// PossibleAgentPoolModeValues returns an array of possible values for the AgentPoolMode const type. +func PossibleAgentPoolModeValues() []AgentPoolMode { + return []AgentPoolMode{System, User} +} + +// AgentPoolType enumerates the values for agent pool type. +type AgentPoolType string + +const ( + // AvailabilitySet ... + AvailabilitySet AgentPoolType = "AvailabilitySet" + // VirtualMachineScaleSets ... + VirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" +) + +// PossibleAgentPoolTypeValues returns an array of possible values for the AgentPoolType const type. +func PossibleAgentPoolTypeValues() []AgentPoolType { + return []AgentPoolType{AvailabilitySet, VirtualMachineScaleSets} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindAADIdentityProvider ... + KindAADIdentityProvider Kind = "AADIdentityProvider" + // KindOpenShiftManagedClusterBaseIdentityProvider ... + KindOpenShiftManagedClusterBaseIdentityProvider Kind = "OpenShiftManagedClusterBaseIdentityProvider" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindAADIdentityProvider, KindOpenShiftManagedClusterBaseIdentityProvider} +} + +// LoadBalancerSku enumerates the values for load balancer sku. +type LoadBalancerSku string + +const ( + // Basic ... + Basic LoadBalancerSku = "basic" + // Standard ... + Standard LoadBalancerSku = "standard" +) + +// PossibleLoadBalancerSkuValues returns an array of possible values for the LoadBalancerSku const type. +func PossibleLoadBalancerSkuValues() []LoadBalancerSku { + return []LoadBalancerSku{Basic, Standard} +} + +// ManagedClusterSKUName enumerates the values for managed cluster sku name. +type ManagedClusterSKUName string + +const ( + // ManagedClusterSKUNameBasic ... + ManagedClusterSKUNameBasic ManagedClusterSKUName = "Basic" +) + +// PossibleManagedClusterSKUNameValues returns an array of possible values for the ManagedClusterSKUName const type. +func PossibleManagedClusterSKUNameValues() []ManagedClusterSKUName { + return []ManagedClusterSKUName{ManagedClusterSKUNameBasic} +} + +// ManagedClusterSKUTier enumerates the values for managed cluster sku tier. +type ManagedClusterSKUTier string + +const ( + // Free ... + Free ManagedClusterSKUTier = "Free" + // Paid ... + Paid ManagedClusterSKUTier = "Paid" +) + +// PossibleManagedClusterSKUTierValues returns an array of possible values for the ManagedClusterSKUTier const type. +func PossibleManagedClusterSKUTierValues() []ManagedClusterSKUTier { + return []ManagedClusterSKUTier{Free, Paid} +} + +// NetworkMode enumerates the values for network mode. +type NetworkMode string + +const ( + // Bridge ... + Bridge NetworkMode = "bridge" + // Transparent ... + Transparent NetworkMode = "transparent" +) + +// PossibleNetworkModeValues returns an array of possible values for the NetworkMode const type. +func PossibleNetworkModeValues() []NetworkMode { + return []NetworkMode{Bridge, Transparent} +} + +// NetworkPlugin enumerates the values for network plugin. +type NetworkPlugin string + +const ( + // Azure ... + Azure NetworkPlugin = "azure" + // Kubenet ... + Kubenet NetworkPlugin = "kubenet" +) + +// PossibleNetworkPluginValues returns an array of possible values for the NetworkPlugin const type. +func PossibleNetworkPluginValues() []NetworkPlugin { + return []NetworkPlugin{Azure, Kubenet} +} + +// NetworkPolicy enumerates the values for network policy. +type NetworkPolicy string + +const ( + // NetworkPolicyAzure ... + NetworkPolicyAzure NetworkPolicy = "azure" + // NetworkPolicyCalico ... + NetworkPolicyCalico NetworkPolicy = "calico" +) + +// PossibleNetworkPolicyValues returns an array of possible values for the NetworkPolicy const type. +func PossibleNetworkPolicyValues() []NetworkPolicy { + return []NetworkPolicy{NetworkPolicyAzure, NetworkPolicyCalico} +} + +// OpenShiftAgentPoolProfileRole enumerates the values for open shift agent pool profile role. +type OpenShiftAgentPoolProfileRole string + +const ( + // Compute ... + Compute OpenShiftAgentPoolProfileRole = "compute" + // Infra ... + Infra OpenShiftAgentPoolProfileRole = "infra" +) + +// PossibleOpenShiftAgentPoolProfileRoleValues returns an array of possible values for the OpenShiftAgentPoolProfileRole const type. +func PossibleOpenShiftAgentPoolProfileRoleValues() []OpenShiftAgentPoolProfileRole { + return []OpenShiftAgentPoolProfileRole{Compute, Infra} +} + +// OpenShiftContainerServiceVMSize enumerates the values for open shift container service vm size. +type OpenShiftContainerServiceVMSize string + +const ( + // StandardD16sV3 ... + StandardD16sV3 OpenShiftContainerServiceVMSize = "Standard_D16s_v3" + // StandardD2sV3 ... + StandardD2sV3 OpenShiftContainerServiceVMSize = "Standard_D2s_v3" + // StandardD32sV3 ... + StandardD32sV3 OpenShiftContainerServiceVMSize = "Standard_D32s_v3" + // StandardD4sV3 ... + StandardD4sV3 OpenShiftContainerServiceVMSize = "Standard_D4s_v3" + // StandardD64sV3 ... + StandardD64sV3 OpenShiftContainerServiceVMSize = "Standard_D64s_v3" + // StandardD8sV3 ... + StandardD8sV3 OpenShiftContainerServiceVMSize = "Standard_D8s_v3" + // StandardDS12V2 ... + StandardDS12V2 OpenShiftContainerServiceVMSize = "Standard_DS12_v2" + // StandardDS13V2 ... + StandardDS13V2 OpenShiftContainerServiceVMSize = "Standard_DS13_v2" + // StandardDS14V2 ... + StandardDS14V2 OpenShiftContainerServiceVMSize = "Standard_DS14_v2" + // StandardDS15V2 ... + StandardDS15V2 OpenShiftContainerServiceVMSize = "Standard_DS15_v2" + // StandardDS4V2 ... + StandardDS4V2 OpenShiftContainerServiceVMSize = "Standard_DS4_v2" + // StandardDS5V2 ... + StandardDS5V2 OpenShiftContainerServiceVMSize = "Standard_DS5_v2" + // StandardE16sV3 ... + StandardE16sV3 OpenShiftContainerServiceVMSize = "Standard_E16s_v3" + // StandardE20sV3 ... + StandardE20sV3 OpenShiftContainerServiceVMSize = "Standard_E20s_v3" + // StandardE32sV3 ... + StandardE32sV3 OpenShiftContainerServiceVMSize = "Standard_E32s_v3" + // StandardE4sV3 ... + StandardE4sV3 OpenShiftContainerServiceVMSize = "Standard_E4s_v3" + // StandardE64sV3 ... + StandardE64sV3 OpenShiftContainerServiceVMSize = "Standard_E64s_v3" + // StandardE8sV3 ... + StandardE8sV3 OpenShiftContainerServiceVMSize = "Standard_E8s_v3" + // StandardF16s ... + StandardF16s OpenShiftContainerServiceVMSize = "Standard_F16s" + // StandardF16sV2 ... + StandardF16sV2 OpenShiftContainerServiceVMSize = "Standard_F16s_v2" + // StandardF32sV2 ... + StandardF32sV2 OpenShiftContainerServiceVMSize = "Standard_F32s_v2" + // StandardF64sV2 ... + StandardF64sV2 OpenShiftContainerServiceVMSize = "Standard_F64s_v2" + // StandardF72sV2 ... + StandardF72sV2 OpenShiftContainerServiceVMSize = "Standard_F72s_v2" + // StandardF8s ... + StandardF8s OpenShiftContainerServiceVMSize = "Standard_F8s" + // StandardF8sV2 ... + StandardF8sV2 OpenShiftContainerServiceVMSize = "Standard_F8s_v2" + // StandardGS2 ... + StandardGS2 OpenShiftContainerServiceVMSize = "Standard_GS2" + // StandardGS3 ... + StandardGS3 OpenShiftContainerServiceVMSize = "Standard_GS3" + // StandardGS4 ... + StandardGS4 OpenShiftContainerServiceVMSize = "Standard_GS4" + // StandardGS5 ... + StandardGS5 OpenShiftContainerServiceVMSize = "Standard_GS5" + // StandardL16s ... + StandardL16s OpenShiftContainerServiceVMSize = "Standard_L16s" + // StandardL32s ... + StandardL32s OpenShiftContainerServiceVMSize = "Standard_L32s" + // StandardL4s ... + StandardL4s OpenShiftContainerServiceVMSize = "Standard_L4s" + // StandardL8s ... + StandardL8s OpenShiftContainerServiceVMSize = "Standard_L8s" +) + +// PossibleOpenShiftContainerServiceVMSizeValues returns an array of possible values for the OpenShiftContainerServiceVMSize const type. +func PossibleOpenShiftContainerServiceVMSizeValues() []OpenShiftContainerServiceVMSize { + return []OpenShiftContainerServiceVMSize{StandardD16sV3, StandardD2sV3, StandardD32sV3, StandardD4sV3, StandardD64sV3, StandardD8sV3, StandardDS12V2, StandardDS13V2, StandardDS14V2, StandardDS15V2, StandardDS4V2, StandardDS5V2, StandardE16sV3, StandardE20sV3, StandardE32sV3, StandardE4sV3, StandardE64sV3, StandardE8sV3, StandardF16s, StandardF16sV2, StandardF32sV2, StandardF64sV2, StandardF72sV2, StandardF8s, StandardF8sV2, StandardGS2, StandardGS3, StandardGS4, StandardGS5, StandardL16s, StandardL32s, StandardL4s, StandardL8s} +} + +// OrchestratorTypes enumerates the values for orchestrator types. +type OrchestratorTypes string + +const ( + // Custom ... + Custom OrchestratorTypes = "Custom" + // DCOS ... + DCOS OrchestratorTypes = "DCOS" + // DockerCE ... + DockerCE OrchestratorTypes = "DockerCE" + // Kubernetes ... + Kubernetes OrchestratorTypes = "Kubernetes" + // Swarm ... + Swarm OrchestratorTypes = "Swarm" +) + +// PossibleOrchestratorTypesValues returns an array of possible values for the OrchestratorTypes const type. +func PossibleOrchestratorTypesValues() []OrchestratorTypes { + return []OrchestratorTypes{Custom, DCOS, DockerCE, Kubernetes, Swarm} +} + +// OSType enumerates the values for os type. +type OSType string + +const ( + // Linux ... + Linux OSType = "Linux" + // Windows ... + Windows OSType = "Windows" +) + +// PossibleOSTypeValues returns an array of possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{Linux, Windows} +} + +// OutboundType enumerates the values for outbound type. +type OutboundType string + +const ( + // LoadBalancer ... + LoadBalancer OutboundType = "loadBalancer" + // UserDefinedRouting ... + UserDefinedRouting OutboundType = "userDefinedRouting" +) + +// PossibleOutboundTypeValues returns an array of possible values for the OutboundType const type. +func PossibleOutboundTypeValues() []OutboundType { + return []OutboundType{LoadBalancer, UserDefinedRouting} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned} +} + +// ScaleSetEvictionPolicy enumerates the values for scale set eviction policy. +type ScaleSetEvictionPolicy string + +const ( + // Deallocate ... + Deallocate ScaleSetEvictionPolicy = "Deallocate" + // Delete ... + Delete ScaleSetEvictionPolicy = "Delete" +) + +// PossibleScaleSetEvictionPolicyValues returns an array of possible values for the ScaleSetEvictionPolicy const type. +func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy { + return []ScaleSetEvictionPolicy{Deallocate, Delete} +} + +// ScaleSetPriority enumerates the values for scale set priority. +type ScaleSetPriority string + +const ( + // Regular ... + Regular ScaleSetPriority = "Regular" + // Spot ... + Spot ScaleSetPriority = "Spot" +) + +// PossibleScaleSetPriorityValues returns an array of possible values for the ScaleSetPriority const type. +func PossibleScaleSetPriorityValues() []ScaleSetPriority { + return []ScaleSetPriority{Regular, Spot} +} + +// StorageProfileTypes enumerates the values for storage profile types. +type StorageProfileTypes string + +const ( + // ManagedDisks ... + ManagedDisks StorageProfileTypes = "ManagedDisks" + // StorageAccount ... + StorageAccount StorageProfileTypes = "StorageAccount" +) + +// PossibleStorageProfileTypesValues returns an array of possible values for the StorageProfileTypes const type. +func PossibleStorageProfileTypesValues() []StorageProfileTypes { + return []StorageProfileTypes{ManagedDisks, StorageAccount} +} + +// VMSizeTypes enumerates the values for vm size types. +type VMSizeTypes string + +const ( + // VMSizeTypesStandardA1 ... + VMSizeTypesStandardA1 VMSizeTypes = "Standard_A1" + // VMSizeTypesStandardA10 ... + VMSizeTypesStandardA10 VMSizeTypes = "Standard_A10" + // VMSizeTypesStandardA11 ... + VMSizeTypesStandardA11 VMSizeTypes = "Standard_A11" + // VMSizeTypesStandardA1V2 ... + VMSizeTypesStandardA1V2 VMSizeTypes = "Standard_A1_v2" + // VMSizeTypesStandardA2 ... + VMSizeTypesStandardA2 VMSizeTypes = "Standard_A2" + // VMSizeTypesStandardA2mV2 ... + VMSizeTypesStandardA2mV2 VMSizeTypes = "Standard_A2m_v2" + // VMSizeTypesStandardA2V2 ... + VMSizeTypesStandardA2V2 VMSizeTypes = "Standard_A2_v2" + // VMSizeTypesStandardA3 ... + VMSizeTypesStandardA3 VMSizeTypes = "Standard_A3" + // VMSizeTypesStandardA4 ... + VMSizeTypesStandardA4 VMSizeTypes = "Standard_A4" + // VMSizeTypesStandardA4mV2 ... + VMSizeTypesStandardA4mV2 VMSizeTypes = "Standard_A4m_v2" + // VMSizeTypesStandardA4V2 ... + VMSizeTypesStandardA4V2 VMSizeTypes = "Standard_A4_v2" + // VMSizeTypesStandardA5 ... + VMSizeTypesStandardA5 VMSizeTypes = "Standard_A5" + // VMSizeTypesStandardA6 ... + VMSizeTypesStandardA6 VMSizeTypes = "Standard_A6" + // VMSizeTypesStandardA7 ... + VMSizeTypesStandardA7 VMSizeTypes = "Standard_A7" + // VMSizeTypesStandardA8 ... + VMSizeTypesStandardA8 VMSizeTypes = "Standard_A8" + // VMSizeTypesStandardA8mV2 ... + VMSizeTypesStandardA8mV2 VMSizeTypes = "Standard_A8m_v2" + // VMSizeTypesStandardA8V2 ... + VMSizeTypesStandardA8V2 VMSizeTypes = "Standard_A8_v2" + // VMSizeTypesStandardA9 ... + VMSizeTypesStandardA9 VMSizeTypes = "Standard_A9" + // VMSizeTypesStandardB2ms ... + VMSizeTypesStandardB2ms VMSizeTypes = "Standard_B2ms" + // VMSizeTypesStandardB2s ... + VMSizeTypesStandardB2s VMSizeTypes = "Standard_B2s" + // VMSizeTypesStandardB4ms ... + VMSizeTypesStandardB4ms VMSizeTypes = "Standard_B4ms" + // VMSizeTypesStandardB8ms ... + VMSizeTypesStandardB8ms VMSizeTypes = "Standard_B8ms" + // VMSizeTypesStandardD1 ... + VMSizeTypesStandardD1 VMSizeTypes = "Standard_D1" + // VMSizeTypesStandardD11 ... + VMSizeTypesStandardD11 VMSizeTypes = "Standard_D11" + // VMSizeTypesStandardD11V2 ... + VMSizeTypesStandardD11V2 VMSizeTypes = "Standard_D11_v2" + // VMSizeTypesStandardD11V2Promo ... + VMSizeTypesStandardD11V2Promo VMSizeTypes = "Standard_D11_v2_Promo" + // VMSizeTypesStandardD12 ... + VMSizeTypesStandardD12 VMSizeTypes = "Standard_D12" + // VMSizeTypesStandardD12V2 ... + VMSizeTypesStandardD12V2 VMSizeTypes = "Standard_D12_v2" + // VMSizeTypesStandardD12V2Promo ... + VMSizeTypesStandardD12V2Promo VMSizeTypes = "Standard_D12_v2_Promo" + // VMSizeTypesStandardD13 ... + VMSizeTypesStandardD13 VMSizeTypes = "Standard_D13" + // VMSizeTypesStandardD13V2 ... + VMSizeTypesStandardD13V2 VMSizeTypes = "Standard_D13_v2" + // VMSizeTypesStandardD13V2Promo ... + VMSizeTypesStandardD13V2Promo VMSizeTypes = "Standard_D13_v2_Promo" + // VMSizeTypesStandardD14 ... + VMSizeTypesStandardD14 VMSizeTypes = "Standard_D14" + // VMSizeTypesStandardD14V2 ... + VMSizeTypesStandardD14V2 VMSizeTypes = "Standard_D14_v2" + // VMSizeTypesStandardD14V2Promo ... + VMSizeTypesStandardD14V2Promo VMSizeTypes = "Standard_D14_v2_Promo" + // VMSizeTypesStandardD15V2 ... + VMSizeTypesStandardD15V2 VMSizeTypes = "Standard_D15_v2" + // VMSizeTypesStandardD16sV3 ... + VMSizeTypesStandardD16sV3 VMSizeTypes = "Standard_D16s_v3" + // VMSizeTypesStandardD16V3 ... + VMSizeTypesStandardD16V3 VMSizeTypes = "Standard_D16_v3" + // VMSizeTypesStandardD1V2 ... + VMSizeTypesStandardD1V2 VMSizeTypes = "Standard_D1_v2" + // VMSizeTypesStandardD2 ... + VMSizeTypesStandardD2 VMSizeTypes = "Standard_D2" + // VMSizeTypesStandardD2sV3 ... + VMSizeTypesStandardD2sV3 VMSizeTypes = "Standard_D2s_v3" + // VMSizeTypesStandardD2V2 ... + VMSizeTypesStandardD2V2 VMSizeTypes = "Standard_D2_v2" + // VMSizeTypesStandardD2V2Promo ... + VMSizeTypesStandardD2V2Promo VMSizeTypes = "Standard_D2_v2_Promo" + // VMSizeTypesStandardD2V3 ... + VMSizeTypesStandardD2V3 VMSizeTypes = "Standard_D2_v3" + // VMSizeTypesStandardD3 ... + VMSizeTypesStandardD3 VMSizeTypes = "Standard_D3" + // VMSizeTypesStandardD32sV3 ... + VMSizeTypesStandardD32sV3 VMSizeTypes = "Standard_D32s_v3" + // VMSizeTypesStandardD32V3 ... + VMSizeTypesStandardD32V3 VMSizeTypes = "Standard_D32_v3" + // VMSizeTypesStandardD3V2 ... + VMSizeTypesStandardD3V2 VMSizeTypes = "Standard_D3_v2" + // VMSizeTypesStandardD3V2Promo ... + VMSizeTypesStandardD3V2Promo VMSizeTypes = "Standard_D3_v2_Promo" + // VMSizeTypesStandardD4 ... + VMSizeTypesStandardD4 VMSizeTypes = "Standard_D4" + // VMSizeTypesStandardD4sV3 ... + VMSizeTypesStandardD4sV3 VMSizeTypes = "Standard_D4s_v3" + // VMSizeTypesStandardD4V2 ... + VMSizeTypesStandardD4V2 VMSizeTypes = "Standard_D4_v2" + // VMSizeTypesStandardD4V2Promo ... + VMSizeTypesStandardD4V2Promo VMSizeTypes = "Standard_D4_v2_Promo" + // VMSizeTypesStandardD4V3 ... + VMSizeTypesStandardD4V3 VMSizeTypes = "Standard_D4_v3" + // VMSizeTypesStandardD5V2 ... + VMSizeTypesStandardD5V2 VMSizeTypes = "Standard_D5_v2" + // VMSizeTypesStandardD5V2Promo ... + VMSizeTypesStandardD5V2Promo VMSizeTypes = "Standard_D5_v2_Promo" + // VMSizeTypesStandardD64sV3 ... + VMSizeTypesStandardD64sV3 VMSizeTypes = "Standard_D64s_v3" + // VMSizeTypesStandardD64V3 ... + VMSizeTypesStandardD64V3 VMSizeTypes = "Standard_D64_v3" + // VMSizeTypesStandardD8sV3 ... + VMSizeTypesStandardD8sV3 VMSizeTypes = "Standard_D8s_v3" + // VMSizeTypesStandardD8V3 ... + VMSizeTypesStandardD8V3 VMSizeTypes = "Standard_D8_v3" + // VMSizeTypesStandardDS1 ... + VMSizeTypesStandardDS1 VMSizeTypes = "Standard_DS1" + // VMSizeTypesStandardDS11 ... + VMSizeTypesStandardDS11 VMSizeTypes = "Standard_DS11" + // VMSizeTypesStandardDS11V2 ... + VMSizeTypesStandardDS11V2 VMSizeTypes = "Standard_DS11_v2" + // VMSizeTypesStandardDS11V2Promo ... + VMSizeTypesStandardDS11V2Promo VMSizeTypes = "Standard_DS11_v2_Promo" + // VMSizeTypesStandardDS12 ... + VMSizeTypesStandardDS12 VMSizeTypes = "Standard_DS12" + // VMSizeTypesStandardDS12V2 ... + VMSizeTypesStandardDS12V2 VMSizeTypes = "Standard_DS12_v2" + // VMSizeTypesStandardDS12V2Promo ... + VMSizeTypesStandardDS12V2Promo VMSizeTypes = "Standard_DS12_v2_Promo" + // VMSizeTypesStandardDS13 ... + VMSizeTypesStandardDS13 VMSizeTypes = "Standard_DS13" + // VMSizeTypesStandardDS132V2 ... + VMSizeTypesStandardDS132V2 VMSizeTypes = "Standard_DS13-2_v2" + // VMSizeTypesStandardDS134V2 ... + VMSizeTypesStandardDS134V2 VMSizeTypes = "Standard_DS13-4_v2" + // VMSizeTypesStandardDS13V2 ... + VMSizeTypesStandardDS13V2 VMSizeTypes = "Standard_DS13_v2" + // VMSizeTypesStandardDS13V2Promo ... + VMSizeTypesStandardDS13V2Promo VMSizeTypes = "Standard_DS13_v2_Promo" + // VMSizeTypesStandardDS14 ... + VMSizeTypesStandardDS14 VMSizeTypes = "Standard_DS14" + // VMSizeTypesStandardDS144V2 ... + VMSizeTypesStandardDS144V2 VMSizeTypes = "Standard_DS14-4_v2" + // VMSizeTypesStandardDS148V2 ... + VMSizeTypesStandardDS148V2 VMSizeTypes = "Standard_DS14-8_v2" + // VMSizeTypesStandardDS14V2 ... + VMSizeTypesStandardDS14V2 VMSizeTypes = "Standard_DS14_v2" + // VMSizeTypesStandardDS14V2Promo ... + VMSizeTypesStandardDS14V2Promo VMSizeTypes = "Standard_DS14_v2_Promo" + // VMSizeTypesStandardDS15V2 ... + VMSizeTypesStandardDS15V2 VMSizeTypes = "Standard_DS15_v2" + // VMSizeTypesStandardDS1V2 ... + VMSizeTypesStandardDS1V2 VMSizeTypes = "Standard_DS1_v2" + // VMSizeTypesStandardDS2 ... + VMSizeTypesStandardDS2 VMSizeTypes = "Standard_DS2" + // VMSizeTypesStandardDS2V2 ... + VMSizeTypesStandardDS2V2 VMSizeTypes = "Standard_DS2_v2" + // VMSizeTypesStandardDS2V2Promo ... + VMSizeTypesStandardDS2V2Promo VMSizeTypes = "Standard_DS2_v2_Promo" + // VMSizeTypesStandardDS3 ... + VMSizeTypesStandardDS3 VMSizeTypes = "Standard_DS3" + // VMSizeTypesStandardDS3V2 ... + VMSizeTypesStandardDS3V2 VMSizeTypes = "Standard_DS3_v2" + // VMSizeTypesStandardDS3V2Promo ... + VMSizeTypesStandardDS3V2Promo VMSizeTypes = "Standard_DS3_v2_Promo" + // VMSizeTypesStandardDS4 ... + VMSizeTypesStandardDS4 VMSizeTypes = "Standard_DS4" + // VMSizeTypesStandardDS4V2 ... + VMSizeTypesStandardDS4V2 VMSizeTypes = "Standard_DS4_v2" + // VMSizeTypesStandardDS4V2Promo ... + VMSizeTypesStandardDS4V2Promo VMSizeTypes = "Standard_DS4_v2_Promo" + // VMSizeTypesStandardDS5V2 ... + VMSizeTypesStandardDS5V2 VMSizeTypes = "Standard_DS5_v2" + // VMSizeTypesStandardDS5V2Promo ... + VMSizeTypesStandardDS5V2Promo VMSizeTypes = "Standard_DS5_v2_Promo" + // VMSizeTypesStandardE16sV3 ... + VMSizeTypesStandardE16sV3 VMSizeTypes = "Standard_E16s_v3" + // VMSizeTypesStandardE16V3 ... + VMSizeTypesStandardE16V3 VMSizeTypes = "Standard_E16_v3" + // VMSizeTypesStandardE2sV3 ... + VMSizeTypesStandardE2sV3 VMSizeTypes = "Standard_E2s_v3" + // VMSizeTypesStandardE2V3 ... + VMSizeTypesStandardE2V3 VMSizeTypes = "Standard_E2_v3" + // VMSizeTypesStandardE3216sV3 ... + VMSizeTypesStandardE3216sV3 VMSizeTypes = "Standard_E32-16s_v3" + // VMSizeTypesStandardE328sV3 ... + VMSizeTypesStandardE328sV3 VMSizeTypes = "Standard_E32-8s_v3" + // VMSizeTypesStandardE32sV3 ... + VMSizeTypesStandardE32sV3 VMSizeTypes = "Standard_E32s_v3" + // VMSizeTypesStandardE32V3 ... + VMSizeTypesStandardE32V3 VMSizeTypes = "Standard_E32_v3" + // VMSizeTypesStandardE4sV3 ... + VMSizeTypesStandardE4sV3 VMSizeTypes = "Standard_E4s_v3" + // VMSizeTypesStandardE4V3 ... + VMSizeTypesStandardE4V3 VMSizeTypes = "Standard_E4_v3" + // VMSizeTypesStandardE6416sV3 ... + VMSizeTypesStandardE6416sV3 VMSizeTypes = "Standard_E64-16s_v3" + // VMSizeTypesStandardE6432sV3 ... + VMSizeTypesStandardE6432sV3 VMSizeTypes = "Standard_E64-32s_v3" + // VMSizeTypesStandardE64sV3 ... + VMSizeTypesStandardE64sV3 VMSizeTypes = "Standard_E64s_v3" + // VMSizeTypesStandardE64V3 ... + VMSizeTypesStandardE64V3 VMSizeTypes = "Standard_E64_v3" + // VMSizeTypesStandardE8sV3 ... + VMSizeTypesStandardE8sV3 VMSizeTypes = "Standard_E8s_v3" + // VMSizeTypesStandardE8V3 ... + VMSizeTypesStandardE8V3 VMSizeTypes = "Standard_E8_v3" + // VMSizeTypesStandardF1 ... + VMSizeTypesStandardF1 VMSizeTypes = "Standard_F1" + // VMSizeTypesStandardF16 ... + VMSizeTypesStandardF16 VMSizeTypes = "Standard_F16" + // VMSizeTypesStandardF16s ... + VMSizeTypesStandardF16s VMSizeTypes = "Standard_F16s" + // VMSizeTypesStandardF16sV2 ... + VMSizeTypesStandardF16sV2 VMSizeTypes = "Standard_F16s_v2" + // VMSizeTypesStandardF1s ... + VMSizeTypesStandardF1s VMSizeTypes = "Standard_F1s" + // VMSizeTypesStandardF2 ... + VMSizeTypesStandardF2 VMSizeTypes = "Standard_F2" + // VMSizeTypesStandardF2s ... + VMSizeTypesStandardF2s VMSizeTypes = "Standard_F2s" + // VMSizeTypesStandardF2sV2 ... + VMSizeTypesStandardF2sV2 VMSizeTypes = "Standard_F2s_v2" + // VMSizeTypesStandardF32sV2 ... + VMSizeTypesStandardF32sV2 VMSizeTypes = "Standard_F32s_v2" + // VMSizeTypesStandardF4 ... + VMSizeTypesStandardF4 VMSizeTypes = "Standard_F4" + // VMSizeTypesStandardF4s ... + VMSizeTypesStandardF4s VMSizeTypes = "Standard_F4s" + // VMSizeTypesStandardF4sV2 ... + VMSizeTypesStandardF4sV2 VMSizeTypes = "Standard_F4s_v2" + // VMSizeTypesStandardF64sV2 ... + VMSizeTypesStandardF64sV2 VMSizeTypes = "Standard_F64s_v2" + // VMSizeTypesStandardF72sV2 ... + VMSizeTypesStandardF72sV2 VMSizeTypes = "Standard_F72s_v2" + // VMSizeTypesStandardF8 ... + VMSizeTypesStandardF8 VMSizeTypes = "Standard_F8" + // VMSizeTypesStandardF8s ... + VMSizeTypesStandardF8s VMSizeTypes = "Standard_F8s" + // VMSizeTypesStandardF8sV2 ... + VMSizeTypesStandardF8sV2 VMSizeTypes = "Standard_F8s_v2" + // VMSizeTypesStandardG1 ... + VMSizeTypesStandardG1 VMSizeTypes = "Standard_G1" + // VMSizeTypesStandardG2 ... + VMSizeTypesStandardG2 VMSizeTypes = "Standard_G2" + // VMSizeTypesStandardG3 ... + VMSizeTypesStandardG3 VMSizeTypes = "Standard_G3" + // VMSizeTypesStandardG4 ... + VMSizeTypesStandardG4 VMSizeTypes = "Standard_G4" + // VMSizeTypesStandardG5 ... + VMSizeTypesStandardG5 VMSizeTypes = "Standard_G5" + // VMSizeTypesStandardGS1 ... + VMSizeTypesStandardGS1 VMSizeTypes = "Standard_GS1" + // VMSizeTypesStandardGS2 ... + VMSizeTypesStandardGS2 VMSizeTypes = "Standard_GS2" + // VMSizeTypesStandardGS3 ... + VMSizeTypesStandardGS3 VMSizeTypes = "Standard_GS3" + // VMSizeTypesStandardGS4 ... + VMSizeTypesStandardGS4 VMSizeTypes = "Standard_GS4" + // VMSizeTypesStandardGS44 ... + VMSizeTypesStandardGS44 VMSizeTypes = "Standard_GS4-4" + // VMSizeTypesStandardGS48 ... + VMSizeTypesStandardGS48 VMSizeTypes = "Standard_GS4-8" + // VMSizeTypesStandardGS5 ... + VMSizeTypesStandardGS5 VMSizeTypes = "Standard_GS5" + // VMSizeTypesStandardGS516 ... + VMSizeTypesStandardGS516 VMSizeTypes = "Standard_GS5-16" + // VMSizeTypesStandardGS58 ... + VMSizeTypesStandardGS58 VMSizeTypes = "Standard_GS5-8" + // VMSizeTypesStandardH16 ... + VMSizeTypesStandardH16 VMSizeTypes = "Standard_H16" + // VMSizeTypesStandardH16m ... + VMSizeTypesStandardH16m VMSizeTypes = "Standard_H16m" + // VMSizeTypesStandardH16mr ... + VMSizeTypesStandardH16mr VMSizeTypes = "Standard_H16mr" + // VMSizeTypesStandardH16r ... + VMSizeTypesStandardH16r VMSizeTypes = "Standard_H16r" + // VMSizeTypesStandardH8 ... + VMSizeTypesStandardH8 VMSizeTypes = "Standard_H8" + // VMSizeTypesStandardH8m ... + VMSizeTypesStandardH8m VMSizeTypes = "Standard_H8m" + // VMSizeTypesStandardL16s ... + VMSizeTypesStandardL16s VMSizeTypes = "Standard_L16s" + // VMSizeTypesStandardL32s ... + VMSizeTypesStandardL32s VMSizeTypes = "Standard_L32s" + // VMSizeTypesStandardL4s ... + VMSizeTypesStandardL4s VMSizeTypes = "Standard_L4s" + // VMSizeTypesStandardL8s ... + VMSizeTypesStandardL8s VMSizeTypes = "Standard_L8s" + // VMSizeTypesStandardM12832ms ... + VMSizeTypesStandardM12832ms VMSizeTypes = "Standard_M128-32ms" + // VMSizeTypesStandardM12864ms ... + VMSizeTypesStandardM12864ms VMSizeTypes = "Standard_M128-64ms" + // VMSizeTypesStandardM128ms ... + VMSizeTypesStandardM128ms VMSizeTypes = "Standard_M128ms" + // VMSizeTypesStandardM128s ... + VMSizeTypesStandardM128s VMSizeTypes = "Standard_M128s" + // VMSizeTypesStandardM6416ms ... + VMSizeTypesStandardM6416ms VMSizeTypes = "Standard_M64-16ms" + // VMSizeTypesStandardM6432ms ... + VMSizeTypesStandardM6432ms VMSizeTypes = "Standard_M64-32ms" + // VMSizeTypesStandardM64ms ... + VMSizeTypesStandardM64ms VMSizeTypes = "Standard_M64ms" + // VMSizeTypesStandardM64s ... + VMSizeTypesStandardM64s VMSizeTypes = "Standard_M64s" + // VMSizeTypesStandardNC12 ... + VMSizeTypesStandardNC12 VMSizeTypes = "Standard_NC12" + // VMSizeTypesStandardNC12sV2 ... + VMSizeTypesStandardNC12sV2 VMSizeTypes = "Standard_NC12s_v2" + // VMSizeTypesStandardNC12sV3 ... + VMSizeTypesStandardNC12sV3 VMSizeTypes = "Standard_NC12s_v3" + // VMSizeTypesStandardNC24 ... + VMSizeTypesStandardNC24 VMSizeTypes = "Standard_NC24" + // VMSizeTypesStandardNC24r ... + VMSizeTypesStandardNC24r VMSizeTypes = "Standard_NC24r" + // VMSizeTypesStandardNC24rsV2 ... + VMSizeTypesStandardNC24rsV2 VMSizeTypes = "Standard_NC24rs_v2" + // VMSizeTypesStandardNC24rsV3 ... + VMSizeTypesStandardNC24rsV3 VMSizeTypes = "Standard_NC24rs_v3" + // VMSizeTypesStandardNC24sV2 ... + VMSizeTypesStandardNC24sV2 VMSizeTypes = "Standard_NC24s_v2" + // VMSizeTypesStandardNC24sV3 ... + VMSizeTypesStandardNC24sV3 VMSizeTypes = "Standard_NC24s_v3" + // VMSizeTypesStandardNC6 ... + VMSizeTypesStandardNC6 VMSizeTypes = "Standard_NC6" + // VMSizeTypesStandardNC6sV2 ... + VMSizeTypesStandardNC6sV2 VMSizeTypes = "Standard_NC6s_v2" + // VMSizeTypesStandardNC6sV3 ... + VMSizeTypesStandardNC6sV3 VMSizeTypes = "Standard_NC6s_v3" + // VMSizeTypesStandardND12s ... + VMSizeTypesStandardND12s VMSizeTypes = "Standard_ND12s" + // VMSizeTypesStandardND24rs ... + VMSizeTypesStandardND24rs VMSizeTypes = "Standard_ND24rs" + // VMSizeTypesStandardND24s ... + VMSizeTypesStandardND24s VMSizeTypes = "Standard_ND24s" + // VMSizeTypesStandardND6s ... + VMSizeTypesStandardND6s VMSizeTypes = "Standard_ND6s" + // VMSizeTypesStandardNV12 ... + VMSizeTypesStandardNV12 VMSizeTypes = "Standard_NV12" + // VMSizeTypesStandardNV24 ... + VMSizeTypesStandardNV24 VMSizeTypes = "Standard_NV24" + // VMSizeTypesStandardNV6 ... + VMSizeTypesStandardNV6 VMSizeTypes = "Standard_NV6" +) + +// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type. +func PossibleVMSizeTypesValues() []VMSizeTypes { + return []VMSizeTypes{VMSizeTypesStandardA1, VMSizeTypesStandardA10, VMSizeTypesStandardA11, VMSizeTypesStandardA1V2, VMSizeTypesStandardA2, VMSizeTypesStandardA2mV2, VMSizeTypesStandardA2V2, VMSizeTypesStandardA3, VMSizeTypesStandardA4, VMSizeTypesStandardA4mV2, VMSizeTypesStandardA4V2, VMSizeTypesStandardA5, VMSizeTypesStandardA6, VMSizeTypesStandardA7, VMSizeTypesStandardA8, VMSizeTypesStandardA8mV2, VMSizeTypesStandardA8V2, VMSizeTypesStandardA9, VMSizeTypesStandardB2ms, VMSizeTypesStandardB2s, VMSizeTypesStandardB4ms, VMSizeTypesStandardB8ms, VMSizeTypesStandardD1, VMSizeTypesStandardD11, VMSizeTypesStandardD11V2, VMSizeTypesStandardD11V2Promo, VMSizeTypesStandardD12, VMSizeTypesStandardD12V2, VMSizeTypesStandardD12V2Promo, VMSizeTypesStandardD13, VMSizeTypesStandardD13V2, VMSizeTypesStandardD13V2Promo, VMSizeTypesStandardD14, VMSizeTypesStandardD14V2, VMSizeTypesStandardD14V2Promo, VMSizeTypesStandardD15V2, VMSizeTypesStandardD16sV3, VMSizeTypesStandardD16V3, VMSizeTypesStandardD1V2, VMSizeTypesStandardD2, VMSizeTypesStandardD2sV3, VMSizeTypesStandardD2V2, VMSizeTypesStandardD2V2Promo, VMSizeTypesStandardD2V3, VMSizeTypesStandardD3, VMSizeTypesStandardD32sV3, VMSizeTypesStandardD32V3, VMSizeTypesStandardD3V2, VMSizeTypesStandardD3V2Promo, VMSizeTypesStandardD4, VMSizeTypesStandardD4sV3, VMSizeTypesStandardD4V2, VMSizeTypesStandardD4V2Promo, VMSizeTypesStandardD4V3, VMSizeTypesStandardD5V2, VMSizeTypesStandardD5V2Promo, VMSizeTypesStandardD64sV3, VMSizeTypesStandardD64V3, VMSizeTypesStandardD8sV3, VMSizeTypesStandardD8V3, VMSizeTypesStandardDS1, VMSizeTypesStandardDS11, VMSizeTypesStandardDS11V2, VMSizeTypesStandardDS11V2Promo, VMSizeTypesStandardDS12, VMSizeTypesStandardDS12V2, VMSizeTypesStandardDS12V2Promo, VMSizeTypesStandardDS13, VMSizeTypesStandardDS132V2, VMSizeTypesStandardDS134V2, VMSizeTypesStandardDS13V2, VMSizeTypesStandardDS13V2Promo, VMSizeTypesStandardDS14, VMSizeTypesStandardDS144V2, VMSizeTypesStandardDS148V2, VMSizeTypesStandardDS14V2, VMSizeTypesStandardDS14V2Promo, VMSizeTypesStandardDS15V2, VMSizeTypesStandardDS1V2, VMSizeTypesStandardDS2, VMSizeTypesStandardDS2V2, VMSizeTypesStandardDS2V2Promo, VMSizeTypesStandardDS3, VMSizeTypesStandardDS3V2, VMSizeTypesStandardDS3V2Promo, VMSizeTypesStandardDS4, VMSizeTypesStandardDS4V2, VMSizeTypesStandardDS4V2Promo, VMSizeTypesStandardDS5V2, VMSizeTypesStandardDS5V2Promo, VMSizeTypesStandardE16sV3, VMSizeTypesStandardE16V3, VMSizeTypesStandardE2sV3, VMSizeTypesStandardE2V3, VMSizeTypesStandardE3216sV3, VMSizeTypesStandardE328sV3, VMSizeTypesStandardE32sV3, VMSizeTypesStandardE32V3, VMSizeTypesStandardE4sV3, VMSizeTypesStandardE4V3, VMSizeTypesStandardE6416sV3, VMSizeTypesStandardE6432sV3, VMSizeTypesStandardE64sV3, VMSizeTypesStandardE64V3, VMSizeTypesStandardE8sV3, VMSizeTypesStandardE8V3, VMSizeTypesStandardF1, VMSizeTypesStandardF16, VMSizeTypesStandardF16s, VMSizeTypesStandardF16sV2, VMSizeTypesStandardF1s, VMSizeTypesStandardF2, VMSizeTypesStandardF2s, VMSizeTypesStandardF2sV2, VMSizeTypesStandardF32sV2, VMSizeTypesStandardF4, VMSizeTypesStandardF4s, VMSizeTypesStandardF4sV2, VMSizeTypesStandardF64sV2, VMSizeTypesStandardF72sV2, VMSizeTypesStandardF8, VMSizeTypesStandardF8s, VMSizeTypesStandardF8sV2, VMSizeTypesStandardG1, VMSizeTypesStandardG2, VMSizeTypesStandardG3, VMSizeTypesStandardG4, VMSizeTypesStandardG5, VMSizeTypesStandardGS1, VMSizeTypesStandardGS2, VMSizeTypesStandardGS3, VMSizeTypesStandardGS4, VMSizeTypesStandardGS44, VMSizeTypesStandardGS48, VMSizeTypesStandardGS5, VMSizeTypesStandardGS516, VMSizeTypesStandardGS58, VMSizeTypesStandardH16, VMSizeTypesStandardH16m, VMSizeTypesStandardH16mr, VMSizeTypesStandardH16r, VMSizeTypesStandardH8, VMSizeTypesStandardH8m, VMSizeTypesStandardL16s, VMSizeTypesStandardL32s, VMSizeTypesStandardL4s, VMSizeTypesStandardL8s, VMSizeTypesStandardM12832ms, VMSizeTypesStandardM12864ms, VMSizeTypesStandardM128ms, VMSizeTypesStandardM128s, VMSizeTypesStandardM6416ms, VMSizeTypesStandardM6432ms, VMSizeTypesStandardM64ms, VMSizeTypesStandardM64s, VMSizeTypesStandardNC12, VMSizeTypesStandardNC12sV2, VMSizeTypesStandardNC12sV3, VMSizeTypesStandardNC24, VMSizeTypesStandardNC24r, VMSizeTypesStandardNC24rsV2, VMSizeTypesStandardNC24rsV3, VMSizeTypesStandardNC24sV2, VMSizeTypesStandardNC24sV3, VMSizeTypesStandardNC6, VMSizeTypesStandardNC6sV2, VMSizeTypesStandardNC6sV3, VMSizeTypesStandardND12s, VMSizeTypesStandardND24rs, VMSizeTypesStandardND24s, VMSizeTypesStandardND6s, VMSizeTypesStandardNV12, VMSizeTypesStandardNV24, VMSizeTypesStandardNV6} +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/managedclusters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/managedclusters.go index 2e2955fa987e..28744f538273 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/managedclusters.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/managedclusters.go @@ -1,18 +1,7 @@ package containerservice -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -75,9 +64,7 @@ func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resource Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, }}, {Target: "parameters.ManagedClusterProperties.WindowsProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, - }}, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.ManagedClusterProperties.NetworkProfile", Name: validation.Null, Rule: false, @@ -118,7 +105,7 @@ func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -156,7 +143,10 @@ func (client ManagedClustersClient) CreateOrUpdateSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -165,7 +155,6 @@ func (client ManagedClustersClient) CreateOrUpdateSender(req *http.Request) (fut func (client ManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedCluster, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -182,8 +171,8 @@ func (client ManagedClustersClient) Delete(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -206,7 +195,7 @@ func (client ManagedClustersClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", nil, "Failure sending request") return } @@ -242,7 +231,10 @@ func (client ManagedClustersClient) DeleteSender(req *http.Request) (future Mana if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -251,7 +243,6 @@ func (client ManagedClustersClient) DeleteSender(req *http.Request) (future Mana func (client ManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -299,6 +290,7 @@ func (client ManagedClustersClient) Get(ctx context.Context, resourceGroupName s result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure responding to request") + return } return @@ -336,7 +328,6 @@ func (client ManagedClustersClient) GetSender(req *http.Request) (*http.Response func (client ManagedClustersClient) GetResponder(resp *http.Response) (result ManagedCluster, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -391,6 +382,7 @@ func (client ManagedClustersClient) GetAccessProfile(ctx context.Context, resour result, err = client.GetAccessProfileResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure responding to request") + return } return @@ -429,7 +421,6 @@ func (client ManagedClustersClient) GetAccessProfileSender(req *http.Request) (* func (client ManagedClustersClient) GetAccessProfileResponder(resp *http.Response) (result ManagedClusterAccessProfile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -479,6 +470,7 @@ func (client ManagedClustersClient) GetUpgradeProfile(ctx context.Context, resou result, err = client.GetUpgradeProfileResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure responding to request") + return } return @@ -516,7 +508,6 @@ func (client ManagedClustersClient) GetUpgradeProfileSender(req *http.Request) ( func (client ManagedClustersClient) GetUpgradeProfileResponder(resp *http.Response) (result ManagedClusterUpgradeProfile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -554,6 +545,11 @@ func (client ManagedClustersClient) List(ctx context.Context) (result ManagedClu result.mclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure responding to request") + return + } + if result.mclr.hasNextLink() && result.mclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -589,7 +585,6 @@ func (client ManagedClustersClient) ListSender(req *http.Request) (*http.Respons func (client ManagedClustersClient) ListResponder(resp *http.Response) (result ManagedClusterListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -672,6 +667,11 @@ func (client ManagedClustersClient) ListByResourceGroup(ctx context.Context, res result.mclr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.mclr.hasNextLink() && result.mclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -708,7 +708,6 @@ func (client ManagedClustersClient) ListByResourceGroupSender(req *http.Request) func (client ManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ManagedClusterListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -795,6 +794,7 @@ func (client ManagedClustersClient) ListClusterAdminCredentials(ctx context.Cont result, err = client.ListClusterAdminCredentialsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", resp, "Failure responding to request") + return } return @@ -832,7 +832,6 @@ func (client ManagedClustersClient) ListClusterAdminCredentialsSender(req *http. func (client ManagedClustersClient) ListClusterAdminCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -882,6 +881,7 @@ func (client ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx con result, err = client.ListClusterMonitoringUserCredentialsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", resp, "Failure responding to request") + return } return @@ -919,7 +919,6 @@ func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsSender(r func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -969,6 +968,7 @@ func (client ManagedClustersClient) ListClusterUserCredentials(ctx context.Conte result, err = client.ListClusterUserCredentialsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", resp, "Failure responding to request") + return } return @@ -1006,7 +1006,6 @@ func (client ManagedClustersClient) ListClusterUserCredentialsSender(req *http.R func (client ManagedClustersClient) ListClusterUserCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1024,8 +1023,8 @@ func (client ManagedClustersClient) ResetAADProfile(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetAADProfile") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1048,7 +1047,7 @@ func (client ManagedClustersClient) ResetAADProfile(ctx context.Context, resourc result, err = client.ResetAADProfileSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", nil, "Failure sending request") return } @@ -1086,7 +1085,10 @@ func (client ManagedClustersClient) ResetAADProfileSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1095,7 +1097,6 @@ func (client ManagedClustersClient) ResetAADProfileSender(req *http.Request) (fu func (client ManagedClustersClient) ResetAADProfileResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1112,8 +1113,8 @@ func (client ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Con ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetServicePrincipalProfile") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1138,7 +1139,7 @@ func (client ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Con result, err = client.ResetServicePrincipalProfileSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", nil, "Failure sending request") return } @@ -1176,7 +1177,10 @@ func (client ManagedClustersClient) ResetServicePrincipalProfileSender(req *http if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1185,7 +1189,6 @@ func (client ManagedClustersClient) ResetServicePrincipalProfileSender(req *http func (client ManagedClustersClient) ResetServicePrincipalProfileResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1201,8 +1204,8 @@ func (client ManagedClustersClient) RotateClusterCertificates(ctx context.Contex ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.RotateClusterCertificates") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1225,7 +1228,7 @@ func (client ManagedClustersClient) RotateClusterCertificates(ctx context.Contex result, err = client.RotateClusterCertificatesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", nil, "Failure sending request") return } @@ -1261,7 +1264,10 @@ func (client ManagedClustersClient) RotateClusterCertificatesSender(req *http.Re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1270,7 +1276,6 @@ func (client ManagedClustersClient) RotateClusterCertificatesSender(req *http.Re func (client ManagedClustersClient) RotateClusterCertificatesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1287,8 +1292,8 @@ func (client ManagedClustersClient) UpdateTags(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1311,7 +1316,7 @@ func (client ManagedClustersClient) UpdateTags(ctx context.Context, resourceGrou result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", nil, "Failure sending request") return } @@ -1349,7 +1354,10 @@ func (client ManagedClustersClient) UpdateTagsSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1358,7 +1366,6 @@ func (client ManagedClustersClient) UpdateTagsSender(req *http.Request) (future func (client ManagedClustersClient) UpdateTagsResponder(resp *http.Response) (result ManagedCluster, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/models.go index 3d30ed739bd9..71d00b2460a7 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/models.go @@ -1,18 +1,7 @@ package containerservice -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -30,701 +19,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice" -// AgentPoolMode enumerates the values for agent pool mode. -type AgentPoolMode string - -const ( - // System ... - System AgentPoolMode = "System" - // User ... - User AgentPoolMode = "User" -) - -// PossibleAgentPoolModeValues returns an array of possible values for the AgentPoolMode const type. -func PossibleAgentPoolModeValues() []AgentPoolMode { - return []AgentPoolMode{System, User} -} - -// AgentPoolType enumerates the values for agent pool type. -type AgentPoolType string - -const ( - // AvailabilitySet ... - AvailabilitySet AgentPoolType = "AvailabilitySet" - // VirtualMachineScaleSets ... - VirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" -) - -// PossibleAgentPoolTypeValues returns an array of possible values for the AgentPoolType const type. -func PossibleAgentPoolTypeValues() []AgentPoolType { - return []AgentPoolType{AvailabilitySet, VirtualMachineScaleSets} -} - -// Kind enumerates the values for kind. -type Kind string - -const ( - // KindAADIdentityProvider ... - KindAADIdentityProvider Kind = "AADIdentityProvider" - // KindOpenShiftManagedClusterBaseIdentityProvider ... - KindOpenShiftManagedClusterBaseIdentityProvider Kind = "OpenShiftManagedClusterBaseIdentityProvider" -) - -// PossibleKindValues returns an array of possible values for the Kind const type. -func PossibleKindValues() []Kind { - return []Kind{KindAADIdentityProvider, KindOpenShiftManagedClusterBaseIdentityProvider} -} - -// LoadBalancerSku enumerates the values for load balancer sku. -type LoadBalancerSku string - -const ( - // Basic ... - Basic LoadBalancerSku = "basic" - // Standard ... - Standard LoadBalancerSku = "standard" -) - -// PossibleLoadBalancerSkuValues returns an array of possible values for the LoadBalancerSku const type. -func PossibleLoadBalancerSkuValues() []LoadBalancerSku { - return []LoadBalancerSku{Basic, Standard} -} - -// ManagedClusterSKUName enumerates the values for managed cluster sku name. -type ManagedClusterSKUName string - -const ( - // ManagedClusterSKUNameBasic ... - ManagedClusterSKUNameBasic ManagedClusterSKUName = "Basic" -) - -// PossibleManagedClusterSKUNameValues returns an array of possible values for the ManagedClusterSKUName const type. -func PossibleManagedClusterSKUNameValues() []ManagedClusterSKUName { - return []ManagedClusterSKUName{ManagedClusterSKUNameBasic} -} - -// ManagedClusterSKUTier enumerates the values for managed cluster sku tier. -type ManagedClusterSKUTier string - -const ( - // Free ... - Free ManagedClusterSKUTier = "Free" - // Paid ... - Paid ManagedClusterSKUTier = "Paid" -) - -// PossibleManagedClusterSKUTierValues returns an array of possible values for the ManagedClusterSKUTier const type. -func PossibleManagedClusterSKUTierValues() []ManagedClusterSKUTier { - return []ManagedClusterSKUTier{Free, Paid} -} - -// NetworkMode enumerates the values for network mode. -type NetworkMode string - -const ( - // Bridge ... - Bridge NetworkMode = "bridge" - // Transparent ... - Transparent NetworkMode = "transparent" -) - -// PossibleNetworkModeValues returns an array of possible values for the NetworkMode const type. -func PossibleNetworkModeValues() []NetworkMode { - return []NetworkMode{Bridge, Transparent} -} - -// NetworkPlugin enumerates the values for network plugin. -type NetworkPlugin string - -const ( - // Azure ... - Azure NetworkPlugin = "azure" - // Kubenet ... - Kubenet NetworkPlugin = "kubenet" -) - -// PossibleNetworkPluginValues returns an array of possible values for the NetworkPlugin const type. -func PossibleNetworkPluginValues() []NetworkPlugin { - return []NetworkPlugin{Azure, Kubenet} -} - -// NetworkPolicy enumerates the values for network policy. -type NetworkPolicy string - -const ( - // NetworkPolicyAzure ... - NetworkPolicyAzure NetworkPolicy = "azure" - // NetworkPolicyCalico ... - NetworkPolicyCalico NetworkPolicy = "calico" -) - -// PossibleNetworkPolicyValues returns an array of possible values for the NetworkPolicy const type. -func PossibleNetworkPolicyValues() []NetworkPolicy { - return []NetworkPolicy{NetworkPolicyAzure, NetworkPolicyCalico} -} - -// OpenShiftAgentPoolProfileRole enumerates the values for open shift agent pool profile role. -type OpenShiftAgentPoolProfileRole string - -const ( - // Compute ... - Compute OpenShiftAgentPoolProfileRole = "compute" - // Infra ... - Infra OpenShiftAgentPoolProfileRole = "infra" -) - -// PossibleOpenShiftAgentPoolProfileRoleValues returns an array of possible values for the OpenShiftAgentPoolProfileRole const type. -func PossibleOpenShiftAgentPoolProfileRoleValues() []OpenShiftAgentPoolProfileRole { - return []OpenShiftAgentPoolProfileRole{Compute, Infra} -} - -// OpenShiftContainerServiceVMSize enumerates the values for open shift container service vm size. -type OpenShiftContainerServiceVMSize string - -const ( - // StandardD16sV3 ... - StandardD16sV3 OpenShiftContainerServiceVMSize = "Standard_D16s_v3" - // StandardD2sV3 ... - StandardD2sV3 OpenShiftContainerServiceVMSize = "Standard_D2s_v3" - // StandardD32sV3 ... - StandardD32sV3 OpenShiftContainerServiceVMSize = "Standard_D32s_v3" - // StandardD4sV3 ... - StandardD4sV3 OpenShiftContainerServiceVMSize = "Standard_D4s_v3" - // StandardD64sV3 ... - StandardD64sV3 OpenShiftContainerServiceVMSize = "Standard_D64s_v3" - // StandardD8sV3 ... - StandardD8sV3 OpenShiftContainerServiceVMSize = "Standard_D8s_v3" - // StandardDS12V2 ... - StandardDS12V2 OpenShiftContainerServiceVMSize = "Standard_DS12_v2" - // StandardDS13V2 ... - StandardDS13V2 OpenShiftContainerServiceVMSize = "Standard_DS13_v2" - // StandardDS14V2 ... - StandardDS14V2 OpenShiftContainerServiceVMSize = "Standard_DS14_v2" - // StandardDS15V2 ... - StandardDS15V2 OpenShiftContainerServiceVMSize = "Standard_DS15_v2" - // StandardDS4V2 ... - StandardDS4V2 OpenShiftContainerServiceVMSize = "Standard_DS4_v2" - // StandardDS5V2 ... - StandardDS5V2 OpenShiftContainerServiceVMSize = "Standard_DS5_v2" - // StandardE16sV3 ... - StandardE16sV3 OpenShiftContainerServiceVMSize = "Standard_E16s_v3" - // StandardE20sV3 ... - StandardE20sV3 OpenShiftContainerServiceVMSize = "Standard_E20s_v3" - // StandardE32sV3 ... - StandardE32sV3 OpenShiftContainerServiceVMSize = "Standard_E32s_v3" - // StandardE4sV3 ... - StandardE4sV3 OpenShiftContainerServiceVMSize = "Standard_E4s_v3" - // StandardE64sV3 ... - StandardE64sV3 OpenShiftContainerServiceVMSize = "Standard_E64s_v3" - // StandardE8sV3 ... - StandardE8sV3 OpenShiftContainerServiceVMSize = "Standard_E8s_v3" - // StandardF16s ... - StandardF16s OpenShiftContainerServiceVMSize = "Standard_F16s" - // StandardF16sV2 ... - StandardF16sV2 OpenShiftContainerServiceVMSize = "Standard_F16s_v2" - // StandardF32sV2 ... - StandardF32sV2 OpenShiftContainerServiceVMSize = "Standard_F32s_v2" - // StandardF64sV2 ... - StandardF64sV2 OpenShiftContainerServiceVMSize = "Standard_F64s_v2" - // StandardF72sV2 ... - StandardF72sV2 OpenShiftContainerServiceVMSize = "Standard_F72s_v2" - // StandardF8s ... - StandardF8s OpenShiftContainerServiceVMSize = "Standard_F8s" - // StandardF8sV2 ... - StandardF8sV2 OpenShiftContainerServiceVMSize = "Standard_F8s_v2" - // StandardGS2 ... - StandardGS2 OpenShiftContainerServiceVMSize = "Standard_GS2" - // StandardGS3 ... - StandardGS3 OpenShiftContainerServiceVMSize = "Standard_GS3" - // StandardGS4 ... - StandardGS4 OpenShiftContainerServiceVMSize = "Standard_GS4" - // StandardGS5 ... - StandardGS5 OpenShiftContainerServiceVMSize = "Standard_GS5" - // StandardL16s ... - StandardL16s OpenShiftContainerServiceVMSize = "Standard_L16s" - // StandardL32s ... - StandardL32s OpenShiftContainerServiceVMSize = "Standard_L32s" - // StandardL4s ... - StandardL4s OpenShiftContainerServiceVMSize = "Standard_L4s" - // StandardL8s ... - StandardL8s OpenShiftContainerServiceVMSize = "Standard_L8s" -) - -// PossibleOpenShiftContainerServiceVMSizeValues returns an array of possible values for the OpenShiftContainerServiceVMSize const type. -func PossibleOpenShiftContainerServiceVMSizeValues() []OpenShiftContainerServiceVMSize { - return []OpenShiftContainerServiceVMSize{StandardD16sV3, StandardD2sV3, StandardD32sV3, StandardD4sV3, StandardD64sV3, StandardD8sV3, StandardDS12V2, StandardDS13V2, StandardDS14V2, StandardDS15V2, StandardDS4V2, StandardDS5V2, StandardE16sV3, StandardE20sV3, StandardE32sV3, StandardE4sV3, StandardE64sV3, StandardE8sV3, StandardF16s, StandardF16sV2, StandardF32sV2, StandardF64sV2, StandardF72sV2, StandardF8s, StandardF8sV2, StandardGS2, StandardGS3, StandardGS4, StandardGS5, StandardL16s, StandardL32s, StandardL4s, StandardL8s} -} - -// OrchestratorTypes enumerates the values for orchestrator types. -type OrchestratorTypes string - -const ( - // Custom ... - Custom OrchestratorTypes = "Custom" - // DCOS ... - DCOS OrchestratorTypes = "DCOS" - // DockerCE ... - DockerCE OrchestratorTypes = "DockerCE" - // Kubernetes ... - Kubernetes OrchestratorTypes = "Kubernetes" - // Swarm ... - Swarm OrchestratorTypes = "Swarm" -) - -// PossibleOrchestratorTypesValues returns an array of possible values for the OrchestratorTypes const type. -func PossibleOrchestratorTypesValues() []OrchestratorTypes { - return []OrchestratorTypes{Custom, DCOS, DockerCE, Kubernetes, Swarm} -} - -// OSType enumerates the values for os type. -type OSType string - -const ( - // Linux ... - Linux OSType = "Linux" - // Windows ... - Windows OSType = "Windows" -) - -// PossibleOSTypeValues returns an array of possible values for the OSType const type. -func PossibleOSTypeValues() []OSType { - return []OSType{Linux, Windows} -} - -// OutboundType enumerates the values for outbound type. -type OutboundType string - -const ( - // LoadBalancer ... - LoadBalancer OutboundType = "loadBalancer" - // UserDefinedRouting ... - UserDefinedRouting OutboundType = "userDefinedRouting" -) - -// PossibleOutboundTypeValues returns an array of possible values for the OutboundType const type. -func PossibleOutboundTypeValues() []OutboundType { - return []OutboundType{LoadBalancer, UserDefinedRouting} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // None ... - None ResourceIdentityType = "None" - // SystemAssigned ... - SystemAssigned ResourceIdentityType = "SystemAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{None, SystemAssigned} -} - -// ScaleSetEvictionPolicy enumerates the values for scale set eviction policy. -type ScaleSetEvictionPolicy string - -const ( - // Deallocate ... - Deallocate ScaleSetEvictionPolicy = "Deallocate" - // Delete ... - Delete ScaleSetEvictionPolicy = "Delete" -) - -// PossibleScaleSetEvictionPolicyValues returns an array of possible values for the ScaleSetEvictionPolicy const type. -func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy { - return []ScaleSetEvictionPolicy{Deallocate, Delete} -} - -// ScaleSetPriority enumerates the values for scale set priority. -type ScaleSetPriority string - -const ( - // Regular ... - Regular ScaleSetPriority = "Regular" - // Spot ... - Spot ScaleSetPriority = "Spot" -) - -// PossibleScaleSetPriorityValues returns an array of possible values for the ScaleSetPriority const type. -func PossibleScaleSetPriorityValues() []ScaleSetPriority { - return []ScaleSetPriority{Regular, Spot} -} - -// StorageProfileTypes enumerates the values for storage profile types. -type StorageProfileTypes string - -const ( - // ManagedDisks ... - ManagedDisks StorageProfileTypes = "ManagedDisks" - // StorageAccount ... - StorageAccount StorageProfileTypes = "StorageAccount" -) - -// PossibleStorageProfileTypesValues returns an array of possible values for the StorageProfileTypes const type. -func PossibleStorageProfileTypesValues() []StorageProfileTypes { - return []StorageProfileTypes{ManagedDisks, StorageAccount} -} - -// VMSizeTypes enumerates the values for vm size types. -type VMSizeTypes string - -const ( - // VMSizeTypesStandardA1 ... - VMSizeTypesStandardA1 VMSizeTypes = "Standard_A1" - // VMSizeTypesStandardA10 ... - VMSizeTypesStandardA10 VMSizeTypes = "Standard_A10" - // VMSizeTypesStandardA11 ... - VMSizeTypesStandardA11 VMSizeTypes = "Standard_A11" - // VMSizeTypesStandardA1V2 ... - VMSizeTypesStandardA1V2 VMSizeTypes = "Standard_A1_v2" - // VMSizeTypesStandardA2 ... - VMSizeTypesStandardA2 VMSizeTypes = "Standard_A2" - // VMSizeTypesStandardA2mV2 ... - VMSizeTypesStandardA2mV2 VMSizeTypes = "Standard_A2m_v2" - // VMSizeTypesStandardA2V2 ... - VMSizeTypesStandardA2V2 VMSizeTypes = "Standard_A2_v2" - // VMSizeTypesStandardA3 ... - VMSizeTypesStandardA3 VMSizeTypes = "Standard_A3" - // VMSizeTypesStandardA4 ... - VMSizeTypesStandardA4 VMSizeTypes = "Standard_A4" - // VMSizeTypesStandardA4mV2 ... - VMSizeTypesStandardA4mV2 VMSizeTypes = "Standard_A4m_v2" - // VMSizeTypesStandardA4V2 ... - VMSizeTypesStandardA4V2 VMSizeTypes = "Standard_A4_v2" - // VMSizeTypesStandardA5 ... - VMSizeTypesStandardA5 VMSizeTypes = "Standard_A5" - // VMSizeTypesStandardA6 ... - VMSizeTypesStandardA6 VMSizeTypes = "Standard_A6" - // VMSizeTypesStandardA7 ... - VMSizeTypesStandardA7 VMSizeTypes = "Standard_A7" - // VMSizeTypesStandardA8 ... - VMSizeTypesStandardA8 VMSizeTypes = "Standard_A8" - // VMSizeTypesStandardA8mV2 ... - VMSizeTypesStandardA8mV2 VMSizeTypes = "Standard_A8m_v2" - // VMSizeTypesStandardA8V2 ... - VMSizeTypesStandardA8V2 VMSizeTypes = "Standard_A8_v2" - // VMSizeTypesStandardA9 ... - VMSizeTypesStandardA9 VMSizeTypes = "Standard_A9" - // VMSizeTypesStandardB2ms ... - VMSizeTypesStandardB2ms VMSizeTypes = "Standard_B2ms" - // VMSizeTypesStandardB2s ... - VMSizeTypesStandardB2s VMSizeTypes = "Standard_B2s" - // VMSizeTypesStandardB4ms ... - VMSizeTypesStandardB4ms VMSizeTypes = "Standard_B4ms" - // VMSizeTypesStandardB8ms ... - VMSizeTypesStandardB8ms VMSizeTypes = "Standard_B8ms" - // VMSizeTypesStandardD1 ... - VMSizeTypesStandardD1 VMSizeTypes = "Standard_D1" - // VMSizeTypesStandardD11 ... - VMSizeTypesStandardD11 VMSizeTypes = "Standard_D11" - // VMSizeTypesStandardD11V2 ... - VMSizeTypesStandardD11V2 VMSizeTypes = "Standard_D11_v2" - // VMSizeTypesStandardD11V2Promo ... - VMSizeTypesStandardD11V2Promo VMSizeTypes = "Standard_D11_v2_Promo" - // VMSizeTypesStandardD12 ... - VMSizeTypesStandardD12 VMSizeTypes = "Standard_D12" - // VMSizeTypesStandardD12V2 ... - VMSizeTypesStandardD12V2 VMSizeTypes = "Standard_D12_v2" - // VMSizeTypesStandardD12V2Promo ... - VMSizeTypesStandardD12V2Promo VMSizeTypes = "Standard_D12_v2_Promo" - // VMSizeTypesStandardD13 ... - VMSizeTypesStandardD13 VMSizeTypes = "Standard_D13" - // VMSizeTypesStandardD13V2 ... - VMSizeTypesStandardD13V2 VMSizeTypes = "Standard_D13_v2" - // VMSizeTypesStandardD13V2Promo ... - VMSizeTypesStandardD13V2Promo VMSizeTypes = "Standard_D13_v2_Promo" - // VMSizeTypesStandardD14 ... - VMSizeTypesStandardD14 VMSizeTypes = "Standard_D14" - // VMSizeTypesStandardD14V2 ... - VMSizeTypesStandardD14V2 VMSizeTypes = "Standard_D14_v2" - // VMSizeTypesStandardD14V2Promo ... - VMSizeTypesStandardD14V2Promo VMSizeTypes = "Standard_D14_v2_Promo" - // VMSizeTypesStandardD15V2 ... - VMSizeTypesStandardD15V2 VMSizeTypes = "Standard_D15_v2" - // VMSizeTypesStandardD16sV3 ... - VMSizeTypesStandardD16sV3 VMSizeTypes = "Standard_D16s_v3" - // VMSizeTypesStandardD16V3 ... - VMSizeTypesStandardD16V3 VMSizeTypes = "Standard_D16_v3" - // VMSizeTypesStandardD1V2 ... - VMSizeTypesStandardD1V2 VMSizeTypes = "Standard_D1_v2" - // VMSizeTypesStandardD2 ... - VMSizeTypesStandardD2 VMSizeTypes = "Standard_D2" - // VMSizeTypesStandardD2sV3 ... - VMSizeTypesStandardD2sV3 VMSizeTypes = "Standard_D2s_v3" - // VMSizeTypesStandardD2V2 ... - VMSizeTypesStandardD2V2 VMSizeTypes = "Standard_D2_v2" - // VMSizeTypesStandardD2V2Promo ... - VMSizeTypesStandardD2V2Promo VMSizeTypes = "Standard_D2_v2_Promo" - // VMSizeTypesStandardD2V3 ... - VMSizeTypesStandardD2V3 VMSizeTypes = "Standard_D2_v3" - // VMSizeTypesStandardD3 ... - VMSizeTypesStandardD3 VMSizeTypes = "Standard_D3" - // VMSizeTypesStandardD32sV3 ... - VMSizeTypesStandardD32sV3 VMSizeTypes = "Standard_D32s_v3" - // VMSizeTypesStandardD32V3 ... - VMSizeTypesStandardD32V3 VMSizeTypes = "Standard_D32_v3" - // VMSizeTypesStandardD3V2 ... - VMSizeTypesStandardD3V2 VMSizeTypes = "Standard_D3_v2" - // VMSizeTypesStandardD3V2Promo ... - VMSizeTypesStandardD3V2Promo VMSizeTypes = "Standard_D3_v2_Promo" - // VMSizeTypesStandardD4 ... - VMSizeTypesStandardD4 VMSizeTypes = "Standard_D4" - // VMSizeTypesStandardD4sV3 ... - VMSizeTypesStandardD4sV3 VMSizeTypes = "Standard_D4s_v3" - // VMSizeTypesStandardD4V2 ... - VMSizeTypesStandardD4V2 VMSizeTypes = "Standard_D4_v2" - // VMSizeTypesStandardD4V2Promo ... - VMSizeTypesStandardD4V2Promo VMSizeTypes = "Standard_D4_v2_Promo" - // VMSizeTypesStandardD4V3 ... - VMSizeTypesStandardD4V3 VMSizeTypes = "Standard_D4_v3" - // VMSizeTypesStandardD5V2 ... - VMSizeTypesStandardD5V2 VMSizeTypes = "Standard_D5_v2" - // VMSizeTypesStandardD5V2Promo ... - VMSizeTypesStandardD5V2Promo VMSizeTypes = "Standard_D5_v2_Promo" - // VMSizeTypesStandardD64sV3 ... - VMSizeTypesStandardD64sV3 VMSizeTypes = "Standard_D64s_v3" - // VMSizeTypesStandardD64V3 ... - VMSizeTypesStandardD64V3 VMSizeTypes = "Standard_D64_v3" - // VMSizeTypesStandardD8sV3 ... - VMSizeTypesStandardD8sV3 VMSizeTypes = "Standard_D8s_v3" - // VMSizeTypesStandardD8V3 ... - VMSizeTypesStandardD8V3 VMSizeTypes = "Standard_D8_v3" - // VMSizeTypesStandardDS1 ... - VMSizeTypesStandardDS1 VMSizeTypes = "Standard_DS1" - // VMSizeTypesStandardDS11 ... - VMSizeTypesStandardDS11 VMSizeTypes = "Standard_DS11" - // VMSizeTypesStandardDS11V2 ... - VMSizeTypesStandardDS11V2 VMSizeTypes = "Standard_DS11_v2" - // VMSizeTypesStandardDS11V2Promo ... - VMSizeTypesStandardDS11V2Promo VMSizeTypes = "Standard_DS11_v2_Promo" - // VMSizeTypesStandardDS12 ... - VMSizeTypesStandardDS12 VMSizeTypes = "Standard_DS12" - // VMSizeTypesStandardDS12V2 ... - VMSizeTypesStandardDS12V2 VMSizeTypes = "Standard_DS12_v2" - // VMSizeTypesStandardDS12V2Promo ... - VMSizeTypesStandardDS12V2Promo VMSizeTypes = "Standard_DS12_v2_Promo" - // VMSizeTypesStandardDS13 ... - VMSizeTypesStandardDS13 VMSizeTypes = "Standard_DS13" - // VMSizeTypesStandardDS132V2 ... - VMSizeTypesStandardDS132V2 VMSizeTypes = "Standard_DS13-2_v2" - // VMSizeTypesStandardDS134V2 ... - VMSizeTypesStandardDS134V2 VMSizeTypes = "Standard_DS13-4_v2" - // VMSizeTypesStandardDS13V2 ... - VMSizeTypesStandardDS13V2 VMSizeTypes = "Standard_DS13_v2" - // VMSizeTypesStandardDS13V2Promo ... - VMSizeTypesStandardDS13V2Promo VMSizeTypes = "Standard_DS13_v2_Promo" - // VMSizeTypesStandardDS14 ... - VMSizeTypesStandardDS14 VMSizeTypes = "Standard_DS14" - // VMSizeTypesStandardDS144V2 ... - VMSizeTypesStandardDS144V2 VMSizeTypes = "Standard_DS14-4_v2" - // VMSizeTypesStandardDS148V2 ... - VMSizeTypesStandardDS148V2 VMSizeTypes = "Standard_DS14-8_v2" - // VMSizeTypesStandardDS14V2 ... - VMSizeTypesStandardDS14V2 VMSizeTypes = "Standard_DS14_v2" - // VMSizeTypesStandardDS14V2Promo ... - VMSizeTypesStandardDS14V2Promo VMSizeTypes = "Standard_DS14_v2_Promo" - // VMSizeTypesStandardDS15V2 ... - VMSizeTypesStandardDS15V2 VMSizeTypes = "Standard_DS15_v2" - // VMSizeTypesStandardDS1V2 ... - VMSizeTypesStandardDS1V2 VMSizeTypes = "Standard_DS1_v2" - // VMSizeTypesStandardDS2 ... - VMSizeTypesStandardDS2 VMSizeTypes = "Standard_DS2" - // VMSizeTypesStandardDS2V2 ... - VMSizeTypesStandardDS2V2 VMSizeTypes = "Standard_DS2_v2" - // VMSizeTypesStandardDS2V2Promo ... - VMSizeTypesStandardDS2V2Promo VMSizeTypes = "Standard_DS2_v2_Promo" - // VMSizeTypesStandardDS3 ... - VMSizeTypesStandardDS3 VMSizeTypes = "Standard_DS3" - // VMSizeTypesStandardDS3V2 ... - VMSizeTypesStandardDS3V2 VMSizeTypes = "Standard_DS3_v2" - // VMSizeTypesStandardDS3V2Promo ... - VMSizeTypesStandardDS3V2Promo VMSizeTypes = "Standard_DS3_v2_Promo" - // VMSizeTypesStandardDS4 ... - VMSizeTypesStandardDS4 VMSizeTypes = "Standard_DS4" - // VMSizeTypesStandardDS4V2 ... - VMSizeTypesStandardDS4V2 VMSizeTypes = "Standard_DS4_v2" - // VMSizeTypesStandardDS4V2Promo ... - VMSizeTypesStandardDS4V2Promo VMSizeTypes = "Standard_DS4_v2_Promo" - // VMSizeTypesStandardDS5V2 ... - VMSizeTypesStandardDS5V2 VMSizeTypes = "Standard_DS5_v2" - // VMSizeTypesStandardDS5V2Promo ... - VMSizeTypesStandardDS5V2Promo VMSizeTypes = "Standard_DS5_v2_Promo" - // VMSizeTypesStandardE16sV3 ... - VMSizeTypesStandardE16sV3 VMSizeTypes = "Standard_E16s_v3" - // VMSizeTypesStandardE16V3 ... - VMSizeTypesStandardE16V3 VMSizeTypes = "Standard_E16_v3" - // VMSizeTypesStandardE2sV3 ... - VMSizeTypesStandardE2sV3 VMSizeTypes = "Standard_E2s_v3" - // VMSizeTypesStandardE2V3 ... - VMSizeTypesStandardE2V3 VMSizeTypes = "Standard_E2_v3" - // VMSizeTypesStandardE3216sV3 ... - VMSizeTypesStandardE3216sV3 VMSizeTypes = "Standard_E32-16s_v3" - // VMSizeTypesStandardE328sV3 ... - VMSizeTypesStandardE328sV3 VMSizeTypes = "Standard_E32-8s_v3" - // VMSizeTypesStandardE32sV3 ... - VMSizeTypesStandardE32sV3 VMSizeTypes = "Standard_E32s_v3" - // VMSizeTypesStandardE32V3 ... - VMSizeTypesStandardE32V3 VMSizeTypes = "Standard_E32_v3" - // VMSizeTypesStandardE4sV3 ... - VMSizeTypesStandardE4sV3 VMSizeTypes = "Standard_E4s_v3" - // VMSizeTypesStandardE4V3 ... - VMSizeTypesStandardE4V3 VMSizeTypes = "Standard_E4_v3" - // VMSizeTypesStandardE6416sV3 ... - VMSizeTypesStandardE6416sV3 VMSizeTypes = "Standard_E64-16s_v3" - // VMSizeTypesStandardE6432sV3 ... - VMSizeTypesStandardE6432sV3 VMSizeTypes = "Standard_E64-32s_v3" - // VMSizeTypesStandardE64sV3 ... - VMSizeTypesStandardE64sV3 VMSizeTypes = "Standard_E64s_v3" - // VMSizeTypesStandardE64V3 ... - VMSizeTypesStandardE64V3 VMSizeTypes = "Standard_E64_v3" - // VMSizeTypesStandardE8sV3 ... - VMSizeTypesStandardE8sV3 VMSizeTypes = "Standard_E8s_v3" - // VMSizeTypesStandardE8V3 ... - VMSizeTypesStandardE8V3 VMSizeTypes = "Standard_E8_v3" - // VMSizeTypesStandardF1 ... - VMSizeTypesStandardF1 VMSizeTypes = "Standard_F1" - // VMSizeTypesStandardF16 ... - VMSizeTypesStandardF16 VMSizeTypes = "Standard_F16" - // VMSizeTypesStandardF16s ... - VMSizeTypesStandardF16s VMSizeTypes = "Standard_F16s" - // VMSizeTypesStandardF16sV2 ... - VMSizeTypesStandardF16sV2 VMSizeTypes = "Standard_F16s_v2" - // VMSizeTypesStandardF1s ... - VMSizeTypesStandardF1s VMSizeTypes = "Standard_F1s" - // VMSizeTypesStandardF2 ... - VMSizeTypesStandardF2 VMSizeTypes = "Standard_F2" - // VMSizeTypesStandardF2s ... - VMSizeTypesStandardF2s VMSizeTypes = "Standard_F2s" - // VMSizeTypesStandardF2sV2 ... - VMSizeTypesStandardF2sV2 VMSizeTypes = "Standard_F2s_v2" - // VMSizeTypesStandardF32sV2 ... - VMSizeTypesStandardF32sV2 VMSizeTypes = "Standard_F32s_v2" - // VMSizeTypesStandardF4 ... - VMSizeTypesStandardF4 VMSizeTypes = "Standard_F4" - // VMSizeTypesStandardF4s ... - VMSizeTypesStandardF4s VMSizeTypes = "Standard_F4s" - // VMSizeTypesStandardF4sV2 ... - VMSizeTypesStandardF4sV2 VMSizeTypes = "Standard_F4s_v2" - // VMSizeTypesStandardF64sV2 ... - VMSizeTypesStandardF64sV2 VMSizeTypes = "Standard_F64s_v2" - // VMSizeTypesStandardF72sV2 ... - VMSizeTypesStandardF72sV2 VMSizeTypes = "Standard_F72s_v2" - // VMSizeTypesStandardF8 ... - VMSizeTypesStandardF8 VMSizeTypes = "Standard_F8" - // VMSizeTypesStandardF8s ... - VMSizeTypesStandardF8s VMSizeTypes = "Standard_F8s" - // VMSizeTypesStandardF8sV2 ... - VMSizeTypesStandardF8sV2 VMSizeTypes = "Standard_F8s_v2" - // VMSizeTypesStandardG1 ... - VMSizeTypesStandardG1 VMSizeTypes = "Standard_G1" - // VMSizeTypesStandardG2 ... - VMSizeTypesStandardG2 VMSizeTypes = "Standard_G2" - // VMSizeTypesStandardG3 ... - VMSizeTypesStandardG3 VMSizeTypes = "Standard_G3" - // VMSizeTypesStandardG4 ... - VMSizeTypesStandardG4 VMSizeTypes = "Standard_G4" - // VMSizeTypesStandardG5 ... - VMSizeTypesStandardG5 VMSizeTypes = "Standard_G5" - // VMSizeTypesStandardGS1 ... - VMSizeTypesStandardGS1 VMSizeTypes = "Standard_GS1" - // VMSizeTypesStandardGS2 ... - VMSizeTypesStandardGS2 VMSizeTypes = "Standard_GS2" - // VMSizeTypesStandardGS3 ... - VMSizeTypesStandardGS3 VMSizeTypes = "Standard_GS3" - // VMSizeTypesStandardGS4 ... - VMSizeTypesStandardGS4 VMSizeTypes = "Standard_GS4" - // VMSizeTypesStandardGS44 ... - VMSizeTypesStandardGS44 VMSizeTypes = "Standard_GS4-4" - // VMSizeTypesStandardGS48 ... - VMSizeTypesStandardGS48 VMSizeTypes = "Standard_GS4-8" - // VMSizeTypesStandardGS5 ... - VMSizeTypesStandardGS5 VMSizeTypes = "Standard_GS5" - // VMSizeTypesStandardGS516 ... - VMSizeTypesStandardGS516 VMSizeTypes = "Standard_GS5-16" - // VMSizeTypesStandardGS58 ... - VMSizeTypesStandardGS58 VMSizeTypes = "Standard_GS5-8" - // VMSizeTypesStandardH16 ... - VMSizeTypesStandardH16 VMSizeTypes = "Standard_H16" - // VMSizeTypesStandardH16m ... - VMSizeTypesStandardH16m VMSizeTypes = "Standard_H16m" - // VMSizeTypesStandardH16mr ... - VMSizeTypesStandardH16mr VMSizeTypes = "Standard_H16mr" - // VMSizeTypesStandardH16r ... - VMSizeTypesStandardH16r VMSizeTypes = "Standard_H16r" - // VMSizeTypesStandardH8 ... - VMSizeTypesStandardH8 VMSizeTypes = "Standard_H8" - // VMSizeTypesStandardH8m ... - VMSizeTypesStandardH8m VMSizeTypes = "Standard_H8m" - // VMSizeTypesStandardL16s ... - VMSizeTypesStandardL16s VMSizeTypes = "Standard_L16s" - // VMSizeTypesStandardL32s ... - VMSizeTypesStandardL32s VMSizeTypes = "Standard_L32s" - // VMSizeTypesStandardL4s ... - VMSizeTypesStandardL4s VMSizeTypes = "Standard_L4s" - // VMSizeTypesStandardL8s ... - VMSizeTypesStandardL8s VMSizeTypes = "Standard_L8s" - // VMSizeTypesStandardM12832ms ... - VMSizeTypesStandardM12832ms VMSizeTypes = "Standard_M128-32ms" - // VMSizeTypesStandardM12864ms ... - VMSizeTypesStandardM12864ms VMSizeTypes = "Standard_M128-64ms" - // VMSizeTypesStandardM128ms ... - VMSizeTypesStandardM128ms VMSizeTypes = "Standard_M128ms" - // VMSizeTypesStandardM128s ... - VMSizeTypesStandardM128s VMSizeTypes = "Standard_M128s" - // VMSizeTypesStandardM6416ms ... - VMSizeTypesStandardM6416ms VMSizeTypes = "Standard_M64-16ms" - // VMSizeTypesStandardM6432ms ... - VMSizeTypesStandardM6432ms VMSizeTypes = "Standard_M64-32ms" - // VMSizeTypesStandardM64ms ... - VMSizeTypesStandardM64ms VMSizeTypes = "Standard_M64ms" - // VMSizeTypesStandardM64s ... - VMSizeTypesStandardM64s VMSizeTypes = "Standard_M64s" - // VMSizeTypesStandardNC12 ... - VMSizeTypesStandardNC12 VMSizeTypes = "Standard_NC12" - // VMSizeTypesStandardNC12sV2 ... - VMSizeTypesStandardNC12sV2 VMSizeTypes = "Standard_NC12s_v2" - // VMSizeTypesStandardNC12sV3 ... - VMSizeTypesStandardNC12sV3 VMSizeTypes = "Standard_NC12s_v3" - // VMSizeTypesStandardNC24 ... - VMSizeTypesStandardNC24 VMSizeTypes = "Standard_NC24" - // VMSizeTypesStandardNC24r ... - VMSizeTypesStandardNC24r VMSizeTypes = "Standard_NC24r" - // VMSizeTypesStandardNC24rsV2 ... - VMSizeTypesStandardNC24rsV2 VMSizeTypes = "Standard_NC24rs_v2" - // VMSizeTypesStandardNC24rsV3 ... - VMSizeTypesStandardNC24rsV3 VMSizeTypes = "Standard_NC24rs_v3" - // VMSizeTypesStandardNC24sV2 ... - VMSizeTypesStandardNC24sV2 VMSizeTypes = "Standard_NC24s_v2" - // VMSizeTypesStandardNC24sV3 ... - VMSizeTypesStandardNC24sV3 VMSizeTypes = "Standard_NC24s_v3" - // VMSizeTypesStandardNC6 ... - VMSizeTypesStandardNC6 VMSizeTypes = "Standard_NC6" - // VMSizeTypesStandardNC6sV2 ... - VMSizeTypesStandardNC6sV2 VMSizeTypes = "Standard_NC6s_v2" - // VMSizeTypesStandardNC6sV3 ... - VMSizeTypesStandardNC6sV3 VMSizeTypes = "Standard_NC6s_v3" - // VMSizeTypesStandardND12s ... - VMSizeTypesStandardND12s VMSizeTypes = "Standard_ND12s" - // VMSizeTypesStandardND24rs ... - VMSizeTypesStandardND24rs VMSizeTypes = "Standard_ND24rs" - // VMSizeTypesStandardND24s ... - VMSizeTypesStandardND24s VMSizeTypes = "Standard_ND24s" - // VMSizeTypesStandardND6s ... - VMSizeTypesStandardND6s VMSizeTypes = "Standard_ND6s" - // VMSizeTypesStandardNV12 ... - VMSizeTypesStandardNV12 VMSizeTypes = "Standard_NV12" - // VMSizeTypesStandardNV24 ... - VMSizeTypesStandardNV24 VMSizeTypes = "Standard_NV24" - // VMSizeTypesStandardNV6 ... - VMSizeTypesStandardNV6 VMSizeTypes = "Standard_NV6" -) - -// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type. -func PossibleVMSizeTypesValues() []VMSizeTypes { - return []VMSizeTypes{VMSizeTypesStandardA1, VMSizeTypesStandardA10, VMSizeTypesStandardA11, VMSizeTypesStandardA1V2, VMSizeTypesStandardA2, VMSizeTypesStandardA2mV2, VMSizeTypesStandardA2V2, VMSizeTypesStandardA3, VMSizeTypesStandardA4, VMSizeTypesStandardA4mV2, VMSizeTypesStandardA4V2, VMSizeTypesStandardA5, VMSizeTypesStandardA6, VMSizeTypesStandardA7, VMSizeTypesStandardA8, VMSizeTypesStandardA8mV2, VMSizeTypesStandardA8V2, VMSizeTypesStandardA9, VMSizeTypesStandardB2ms, VMSizeTypesStandardB2s, VMSizeTypesStandardB4ms, VMSizeTypesStandardB8ms, VMSizeTypesStandardD1, VMSizeTypesStandardD11, VMSizeTypesStandardD11V2, VMSizeTypesStandardD11V2Promo, VMSizeTypesStandardD12, VMSizeTypesStandardD12V2, VMSizeTypesStandardD12V2Promo, VMSizeTypesStandardD13, VMSizeTypesStandardD13V2, VMSizeTypesStandardD13V2Promo, VMSizeTypesStandardD14, VMSizeTypesStandardD14V2, VMSizeTypesStandardD14V2Promo, VMSizeTypesStandardD15V2, VMSizeTypesStandardD16sV3, VMSizeTypesStandardD16V3, VMSizeTypesStandardD1V2, VMSizeTypesStandardD2, VMSizeTypesStandardD2sV3, VMSizeTypesStandardD2V2, VMSizeTypesStandardD2V2Promo, VMSizeTypesStandardD2V3, VMSizeTypesStandardD3, VMSizeTypesStandardD32sV3, VMSizeTypesStandardD32V3, VMSizeTypesStandardD3V2, VMSizeTypesStandardD3V2Promo, VMSizeTypesStandardD4, VMSizeTypesStandardD4sV3, VMSizeTypesStandardD4V2, VMSizeTypesStandardD4V2Promo, VMSizeTypesStandardD4V3, VMSizeTypesStandardD5V2, VMSizeTypesStandardD5V2Promo, VMSizeTypesStandardD64sV3, VMSizeTypesStandardD64V3, VMSizeTypesStandardD8sV3, VMSizeTypesStandardD8V3, VMSizeTypesStandardDS1, VMSizeTypesStandardDS11, VMSizeTypesStandardDS11V2, VMSizeTypesStandardDS11V2Promo, VMSizeTypesStandardDS12, VMSizeTypesStandardDS12V2, VMSizeTypesStandardDS12V2Promo, VMSizeTypesStandardDS13, VMSizeTypesStandardDS132V2, VMSizeTypesStandardDS134V2, VMSizeTypesStandardDS13V2, VMSizeTypesStandardDS13V2Promo, VMSizeTypesStandardDS14, VMSizeTypesStandardDS144V2, VMSizeTypesStandardDS148V2, VMSizeTypesStandardDS14V2, VMSizeTypesStandardDS14V2Promo, VMSizeTypesStandardDS15V2, VMSizeTypesStandardDS1V2, VMSizeTypesStandardDS2, VMSizeTypesStandardDS2V2, VMSizeTypesStandardDS2V2Promo, VMSizeTypesStandardDS3, VMSizeTypesStandardDS3V2, VMSizeTypesStandardDS3V2Promo, VMSizeTypesStandardDS4, VMSizeTypesStandardDS4V2, VMSizeTypesStandardDS4V2Promo, VMSizeTypesStandardDS5V2, VMSizeTypesStandardDS5V2Promo, VMSizeTypesStandardE16sV3, VMSizeTypesStandardE16V3, VMSizeTypesStandardE2sV3, VMSizeTypesStandardE2V3, VMSizeTypesStandardE3216sV3, VMSizeTypesStandardE328sV3, VMSizeTypesStandardE32sV3, VMSizeTypesStandardE32V3, VMSizeTypesStandardE4sV3, VMSizeTypesStandardE4V3, VMSizeTypesStandardE6416sV3, VMSizeTypesStandardE6432sV3, VMSizeTypesStandardE64sV3, VMSizeTypesStandardE64V3, VMSizeTypesStandardE8sV3, VMSizeTypesStandardE8V3, VMSizeTypesStandardF1, VMSizeTypesStandardF16, VMSizeTypesStandardF16s, VMSizeTypesStandardF16sV2, VMSizeTypesStandardF1s, VMSizeTypesStandardF2, VMSizeTypesStandardF2s, VMSizeTypesStandardF2sV2, VMSizeTypesStandardF32sV2, VMSizeTypesStandardF4, VMSizeTypesStandardF4s, VMSizeTypesStandardF4sV2, VMSizeTypesStandardF64sV2, VMSizeTypesStandardF72sV2, VMSizeTypesStandardF8, VMSizeTypesStandardF8s, VMSizeTypesStandardF8sV2, VMSizeTypesStandardG1, VMSizeTypesStandardG2, VMSizeTypesStandardG3, VMSizeTypesStandardG4, VMSizeTypesStandardG5, VMSizeTypesStandardGS1, VMSizeTypesStandardGS2, VMSizeTypesStandardGS3, VMSizeTypesStandardGS4, VMSizeTypesStandardGS44, VMSizeTypesStandardGS48, VMSizeTypesStandardGS5, VMSizeTypesStandardGS516, VMSizeTypesStandardGS58, VMSizeTypesStandardH16, VMSizeTypesStandardH16m, VMSizeTypesStandardH16mr, VMSizeTypesStandardH16r, VMSizeTypesStandardH8, VMSizeTypesStandardH8m, VMSizeTypesStandardL16s, VMSizeTypesStandardL32s, VMSizeTypesStandardL4s, VMSizeTypesStandardL8s, VMSizeTypesStandardM12832ms, VMSizeTypesStandardM12864ms, VMSizeTypesStandardM128ms, VMSizeTypesStandardM128s, VMSizeTypesStandardM6416ms, VMSizeTypesStandardM6432ms, VMSizeTypesStandardM64ms, VMSizeTypesStandardM64s, VMSizeTypesStandardNC12, VMSizeTypesStandardNC12sV2, VMSizeTypesStandardNC12sV3, VMSizeTypesStandardNC24, VMSizeTypesStandardNC24r, VMSizeTypesStandardNC24rsV2, VMSizeTypesStandardNC24rsV3, VMSizeTypesStandardNC24sV2, VMSizeTypesStandardNC24sV3, VMSizeTypesStandardNC6, VMSizeTypesStandardNC6sV2, VMSizeTypesStandardNC6sV3, VMSizeTypesStandardND12s, VMSizeTypesStandardND24rs, VMSizeTypesStandardND24s, VMSizeTypesStandardND6s, VMSizeTypesStandardNV12, VMSizeTypesStandardNV24, VMSizeTypesStandardNV6} -} - // AccessProfile profile for enabling a user to access a managed cluster. type AccessProfile struct { // KubeConfig - Base64-encoded Kubernetes configuration file. @@ -902,6 +196,15 @@ type AgentPoolListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for AgentPoolListResult. +func (aplr AgentPoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aplr.Value != nil { + objectMap["value"] = aplr.Value + } + return json.Marshal(objectMap) +} + // AgentPoolListResultIterator provides access to a complete listing of AgentPool values. type AgentPoolListResultIterator struct { i int @@ -970,10 +273,15 @@ func (aplr AgentPoolListResult) IsEmpty() bool { return aplr.Value == nil || len(*aplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (aplr AgentPoolListResult) hasNextLink() bool { + return aplr.NextLink != nil && len(*aplr.NextLink) != 0 +} + // agentPoolListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (aplr AgentPoolListResult) agentPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if aplr.NextLink == nil || len(to.String(aplr.NextLink)) < 1 { + if !aplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1001,11 +309,16 @@ func (page *AgentPoolListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.aplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.aplr) + if err != nil { + return err + } + page.aplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.aplr = next return nil } @@ -1035,8 +348,11 @@ func (page AgentPoolListResultPage) Values() []AgentPool { } // Creates a new instance of the AgentPoolListResultPage type. -func NewAgentPoolListResultPage(getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage { - return AgentPoolListResultPage{fn: getNextPage} +func NewAgentPoolListResultPage(cur AgentPoolListResult, getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage { + return AgentPoolListResultPage{ + fn: getNextPage, + aplr: cur, + } } // AgentPoolProfile profile for the container service agent pool. @@ -1063,15 +379,61 @@ type AgentPoolProfile struct { OsType OSType `json:"osType,omitempty"` } +// MarshalJSON is the custom marshaler for AgentPoolProfile. +func (app AgentPoolProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if app.Name != nil { + objectMap["name"] = app.Name + } + if app.Count != nil { + objectMap["count"] = app.Count + } + if app.VMSize != "" { + objectMap["vmSize"] = app.VMSize + } + if app.OsDiskSizeGB != nil { + objectMap["osDiskSizeGB"] = app.OsDiskSizeGB + } + if app.DNSPrefix != nil { + objectMap["dnsPrefix"] = app.DNSPrefix + } + if app.Ports != nil { + objectMap["ports"] = app.Ports + } + if app.StorageProfile != "" { + objectMap["storageProfile"] = app.StorageProfile + } + if app.VnetSubnetID != nil { + objectMap["vnetSubnetID"] = app.VnetSubnetID + } + if app.OsType != "" { + objectMap["osType"] = app.OsType + } + return json.Marshal(objectMap) +} + // AgentPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type AgentPoolsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AgentPoolsClient) (AgentPool, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AgentPoolsCreateOrUpdateFuture) Result(client AgentPoolsClient) (ap AgentPool, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AgentPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AgentPoolsCreateOrUpdateFuture.Result. +func (future *AgentPoolsCreateOrUpdateFuture) result(client AgentPoolsClient) (ap AgentPool, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1095,12 +457,25 @@ func (future *AgentPoolsCreateOrUpdateFuture) Result(client AgentPoolsClient) (a // AgentPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type AgentPoolsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AgentPoolsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AgentPoolsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AgentPoolsDeleteFuture) Result(client AgentPoolsClient) (ar autorest.Response, err error) { +// result is the default implementation for AgentPoolsDeleteFuture.Result. +func (future *AgentPoolsDeleteFuture) result(client AgentPoolsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1336,12 +711,25 @@ func (cs *ContainerService) UnmarshalJSON(body []byte) error { // ContainerServicesCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a // long-running operation. type ContainerServicesCreateOrUpdateFutureType struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerServicesClient) (ContainerService, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerServicesCreateOrUpdateFutureType) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ContainerServicesCreateOrUpdateFutureType) Result(client ContainerServicesClient) (cs ContainerService, err error) { +// result is the default implementation for ContainerServicesCreateOrUpdateFutureType.Result. +func (future *ContainerServicesCreateOrUpdateFutureType) result(client ContainerServicesClient) (cs ContainerService, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1365,12 +753,25 @@ func (future *ContainerServicesCreateOrUpdateFutureType) Result(client Container // ContainerServicesDeleteFutureType an abstraction for monitoring and retrieving the results of a // long-running operation. type ContainerServicesDeleteFutureType struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerServicesDeleteFutureType) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ContainerServicesDeleteFutureType) Result(client ContainerServicesClient) (ar autorest.Response, err error) { +// result is the default implementation for ContainerServicesDeleteFutureType.Result. +func (future *ContainerServicesDeleteFutureType) result(client ContainerServicesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1439,6 +840,15 @@ type ListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ListResult. +func (lr ListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lr.Value != nil { + objectMap["value"] = lr.Value + } + return json.Marshal(objectMap) +} + // ListResultIterator provides access to a complete listing of ContainerService values. type ListResultIterator struct { i int @@ -1507,10 +917,15 @@ func (lr ListResult) IsEmpty() bool { return lr.Value == nil || len(*lr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lr ListResult) hasNextLink() bool { + return lr.NextLink != nil && len(*lr.NextLink) != 0 +} + // listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if !lr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1538,11 +953,16 @@ func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lr = next return nil } @@ -1572,8 +992,11 @@ func (page ListResultPage) Values() []ContainerService { } // Creates a new instance of the ListResultPage type. -func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { - return ListResultPage{fn: getNextPage} +func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{ + fn: getNextPage, + lr: cur, + } } // ManagedCluster managed cluster. @@ -2121,6 +1544,15 @@ type ManagedClusterIdentity struct { Type ResourceIdentityType `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for ManagedClusterIdentity. +func (mci ManagedClusterIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mci.Type != "" { + objectMap["type"] = mci.Type + } + return json.Marshal(objectMap) +} + // ManagedClusterListResult the response from the List Managed Clusters operation. type ManagedClusterListResult struct { autorest.Response `json:"-"` @@ -2130,6 +1562,15 @@ type ManagedClusterListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ManagedClusterListResult. +func (mclr ManagedClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mclr.Value != nil { + objectMap["value"] = mclr.Value + } + return json.Marshal(objectMap) +} + // ManagedClusterListResultIterator provides access to a complete listing of ManagedCluster values. type ManagedClusterListResultIterator struct { i int @@ -2198,10 +1639,15 @@ func (mclr ManagedClusterListResult) IsEmpty() bool { return mclr.Value == nil || len(*mclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (mclr ManagedClusterListResult) hasNextLink() bool { + return mclr.NextLink != nil && len(*mclr.NextLink) != 0 +} + // managedClusterListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (mclr ManagedClusterListResult) managedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { - if mclr.NextLink == nil || len(to.String(mclr.NextLink)) < 1 { + if !mclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2229,11 +1675,16 @@ func (page *ManagedClusterListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.mclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.mclr) + if err != nil { + return err + } + page.mclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.mclr = next return nil } @@ -2263,8 +1714,11 @@ func (page ManagedClusterListResultPage) Values() []ManagedCluster { } // Creates a new instance of the ManagedClusterListResultPage type. -func NewManagedClusterListResultPage(getNextPage func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)) ManagedClusterListResultPage { - return ManagedClusterListResultPage{fn: getNextPage} +func NewManagedClusterListResultPage(cur ManagedClusterListResult, getNextPage func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)) ManagedClusterListResultPage { + return ManagedClusterListResultPage{ + fn: getNextPage, + mclr: cur, + } } // ManagedClusterLoadBalancerProfile profile of the managed cluster load balancer. @@ -2352,7 +1806,7 @@ type ManagedClusterProperties struct { NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` // EnableRBAC - Whether to enable Kubernetes Role-Based Access Control. EnableRBAC *bool `json:"enableRBAC,omitempty"` - // EnablePodSecurityPolicy - (PREVIEW) Whether to enable Kubernetes Pod security policy. + // EnablePodSecurityPolicy - (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` // NetworkProfile - Profile of network configuration. NetworkProfile *NetworkProfileType `json:"networkProfile,omitempty"` @@ -2449,12 +1903,25 @@ type ManagedClusterPropertiesIdentityProfileValue struct { // ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ManagedClustersCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (ManagedCluster, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedClustersCreateOrUpdateFuture) Result(client ManagedClustersClient) (mc ManagedCluster, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersCreateOrUpdateFuture.Result. +func (future *ManagedClustersCreateOrUpdateFuture) result(client ManagedClustersClient) (mc ManagedCluster, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2478,12 +1945,25 @@ func (future *ManagedClustersCreateOrUpdateFuture) Result(client ManagedClusters // ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ManagedClustersDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedClustersDeleteFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersDeleteFuture.Result. +func (future *ManagedClustersDeleteFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2518,12 +1998,25 @@ type ManagedClusterSKU struct { // ManagedClustersResetAADProfileFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ManagedClustersResetAADProfileFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedClustersResetAADProfileFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersResetAADProfileFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersResetAADProfileFuture.Result. +func (future *ManagedClustersResetAADProfileFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2541,12 +2034,25 @@ func (future *ManagedClustersResetAADProfileFuture) Result(client ManagedCluster // ManagedClustersResetServicePrincipalProfileFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ManagedClustersResetServicePrincipalProfileFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersResetServicePrincipalProfileFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedClustersResetServicePrincipalProfileFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { +// result is the default implementation for ManagedClustersResetServicePrincipalProfileFuture.Result. +func (future *ManagedClustersResetServicePrincipalProfileFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2564,12 +2070,25 @@ func (future *ManagedClustersResetServicePrincipalProfileFuture) Result(client M // ManagedClustersRotateClusterCertificatesFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ManagedClustersRotateClusterCertificatesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedClustersRotateClusterCertificatesFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersRotateClusterCertificatesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersRotateClusterCertificatesFuture.Result. +func (future *ManagedClustersRotateClusterCertificatesFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2587,12 +2106,25 @@ func (future *ManagedClustersRotateClusterCertificatesFuture) Result(client Mana // ManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ManagedClustersUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (ManagedCluster, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ManagedClustersUpdateTagsFuture) Result(client ManagedClustersClient) (mc ManagedCluster, err error) { +// result is the default implementation for ManagedClustersUpdateTagsFuture.Result. +func (future *ManagedClustersUpdateTagsFuture) result(client ManagedClustersClient) (mc ManagedCluster, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -2696,9 +2228,9 @@ type ManagedClusterUpgradeProfileProperties struct { // ManagedClusterWindowsProfile profile for Windows VMs in the container service cluster. type ManagedClusterWindowsProfile struct { - // AdminUsername - The administrator username to use for Windows VMs. + // AdminUsername - Specifies the name of the administrator account.

**restriction:** Cannot end in "."

**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters AdminUsername *string `json:"adminUsername,omitempty"` - // AdminPassword - The administrator password to use for Windows VMs. + // AdminPassword - Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" AdminPassword *string `json:"adminPassword,omitempty"` } @@ -2722,6 +2254,33 @@ type MasterProfile struct { Fqdn *string `json:"fqdn,omitempty"` } +// MarshalJSON is the custom marshaler for MasterProfile. +func (mp MasterProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mp.Count != nil { + objectMap["count"] = mp.Count + } + if mp.DNSPrefix != nil { + objectMap["dnsPrefix"] = mp.DNSPrefix + } + if mp.VMSize != "" { + objectMap["vmSize"] = mp.VMSize + } + if mp.OsDiskSizeGB != nil { + objectMap["osDiskSizeGB"] = mp.OsDiskSizeGB + } + if mp.VnetSubnetID != nil { + objectMap["vnetSubnetID"] = mp.VnetSubnetID + } + if mp.FirstConsecutiveStaticIP != nil { + objectMap["firstConsecutiveStaticIP"] = mp.FirstConsecutiveStaticIP + } + if mp.StorageProfile != "" { + objectMap["storageProfile"] = mp.StorageProfile + } + return json.Marshal(objectMap) +} + // NetworkProfile represents the OpenShift networking configuration type NetworkProfile struct { // VnetCidr - CIDR for the OpenShift Vnet. @@ -3069,6 +2628,15 @@ type OpenShiftManagedClusterListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for OpenShiftManagedClusterListResult. +func (osmclr OpenShiftManagedClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if osmclr.Value != nil { + objectMap["value"] = osmclr.Value + } + return json.Marshal(objectMap) +} + // OpenShiftManagedClusterListResultIterator provides access to a complete listing of // OpenShiftManagedCluster values. type OpenShiftManagedClusterListResultIterator struct { @@ -3138,10 +2706,15 @@ func (osmclr OpenShiftManagedClusterListResult) IsEmpty() bool { return osmclr.Value == nil || len(*osmclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (osmclr OpenShiftManagedClusterListResult) hasNextLink() bool { + return osmclr.NextLink != nil && len(*osmclr.NextLink) != 0 +} + // openShiftManagedClusterListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (osmclr OpenShiftManagedClusterListResult) openShiftManagedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { - if osmclr.NextLink == nil || len(to.String(osmclr.NextLink)) < 1 { + if !osmclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3169,11 +2742,16 @@ func (page *OpenShiftManagedClusterListResultPage) NextWithContext(ctx context.C tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.osmclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.osmclr) + if err != nil { + return err + } + page.osmclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.osmclr = next return nil } @@ -3203,8 +2781,11 @@ func (page OpenShiftManagedClusterListResultPage) Values() []OpenShiftManagedClu } // Creates a new instance of the OpenShiftManagedClusterListResultPage type. -func NewOpenShiftManagedClusterListResultPage(getNextPage func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error)) OpenShiftManagedClusterListResultPage { - return OpenShiftManagedClusterListResultPage{fn: getNextPage} +func NewOpenShiftManagedClusterListResultPage(cur OpenShiftManagedClusterListResult, getNextPage func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error)) OpenShiftManagedClusterListResultPage { + return OpenShiftManagedClusterListResultPage{ + fn: getNextPage, + osmclr: cur, + } } // OpenShiftManagedClusterMasterPoolProfile openShiftManagedClusterMaterPoolProfile contains configuration @@ -3246,15 +2827,52 @@ type OpenShiftManagedClusterProperties struct { AuthProfile *OpenShiftManagedClusterAuthProfile `json:"authProfile,omitempty"` } +// MarshalJSON is the custom marshaler for OpenShiftManagedClusterProperties. +func (osmcp OpenShiftManagedClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if osmcp.OpenShiftVersion != nil { + objectMap["openShiftVersion"] = osmcp.OpenShiftVersion + } + if osmcp.NetworkProfile != nil { + objectMap["networkProfile"] = osmcp.NetworkProfile + } + if osmcp.RouterProfiles != nil { + objectMap["routerProfiles"] = osmcp.RouterProfiles + } + if osmcp.MasterPoolProfile != nil { + objectMap["masterPoolProfile"] = osmcp.MasterPoolProfile + } + if osmcp.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = osmcp.AgentPoolProfiles + } + if osmcp.AuthProfile != nil { + objectMap["authProfile"] = osmcp.AuthProfile + } + return json.Marshal(objectMap) +} + // OpenShiftManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type OpenShiftManagedClustersCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(OpenShiftManagedClustersClient) (OpenShiftManagedCluster, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *OpenShiftManagedClustersCreateOrUpdateFuture) Result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *OpenShiftManagedClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for OpenShiftManagedClustersCreateOrUpdateFuture.Result. +func (future *OpenShiftManagedClustersCreateOrUpdateFuture) result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3278,12 +2896,25 @@ func (future *OpenShiftManagedClustersCreateOrUpdateFuture) Result(client OpenSh // OpenShiftManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type OpenShiftManagedClustersDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(OpenShiftManagedClustersClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *OpenShiftManagedClustersDeleteFuture) Result(client OpenShiftManagedClustersClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *OpenShiftManagedClustersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for OpenShiftManagedClustersDeleteFuture.Result. +func (future *OpenShiftManagedClustersDeleteFuture) result(client OpenShiftManagedClustersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3301,12 +2932,25 @@ func (future *OpenShiftManagedClustersDeleteFuture) Result(client OpenShiftManag // OpenShiftManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type OpenShiftManagedClustersUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(OpenShiftManagedClustersClient) (OpenShiftManagedCluster, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *OpenShiftManagedClustersUpdateTagsFuture) Result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *OpenShiftManagedClustersUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for OpenShiftManagedClustersUpdateTagsFuture.Result. +func (future *OpenShiftManagedClustersUpdateTagsFuture) result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -3337,6 +2981,15 @@ type OpenShiftRouterProfile struct { Fqdn *string `json:"fqdn,omitempty"` } +// MarshalJSON is the custom marshaler for OpenShiftRouterProfile. +func (osrp OpenShiftRouterProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if osrp.Name != nil { + objectMap["name"] = osrp.Name + } + return json.Marshal(objectMap) +} + // OperationListResult the List Compute Operation operation response. type OperationListResult struct { autorest.Response `json:"-"` @@ -3550,6 +3203,36 @@ type Properties struct { DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` } +// MarshalJSON is the custom marshaler for Properties. +func (p Properties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.OrchestratorProfile != nil { + objectMap["orchestratorProfile"] = p.OrchestratorProfile + } + if p.CustomProfile != nil { + objectMap["customProfile"] = p.CustomProfile + } + if p.ServicePrincipalProfile != nil { + objectMap["servicePrincipalProfile"] = p.ServicePrincipalProfile + } + if p.MasterProfile != nil { + objectMap["masterProfile"] = p.MasterProfile + } + if p.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = p.AgentPoolProfiles + } + if p.WindowsProfile != nil { + objectMap["windowsProfile"] = p.WindowsProfile + } + if p.LinuxProfile != nil { + objectMap["linuxProfile"] = p.LinuxProfile + } + if p.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = p.DiagnosticsProfile + } + return json.Marshal(objectMap) +} + // PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. type PurchasePlan struct { // Name - The plan ID. @@ -3660,6 +3343,15 @@ type VMDiagnostics struct { StorageURI *string `json:"storageUri,omitempty"` } +// MarshalJSON is the custom marshaler for VMDiagnostics. +func (vd VMDiagnostics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vd.Enabled != nil { + objectMap["enabled"] = vd.Enabled + } + return json.Marshal(objectMap) +} + // WindowsProfile profile for Windows VMs in the container service cluster. type WindowsProfile struct { // AdminUsername - The administrator username to use for Windows VMs. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/openshiftmanagedclusters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/openshiftmanagedclusters.go index bec338c6523b..074d37d1060a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/openshiftmanagedclusters.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/openshiftmanagedclusters.go @@ -1,18 +1,7 @@ package containerservice -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client OpenShiftManagedClustersClient) CreateOrUpdate(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -80,7 +69,7 @@ func (client OpenShiftManagedClustersClient) CreateOrUpdate(ctx context.Context, result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -118,7 +107,10 @@ func (client OpenShiftManagedClustersClient) CreateOrUpdateSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -127,7 +119,6 @@ func (client OpenShiftManagedClustersClient) CreateOrUpdateSender(req *http.Requ func (client OpenShiftManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -144,8 +135,8 @@ func (client OpenShiftManagedClustersClient) Delete(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -164,7 +155,7 @@ func (client OpenShiftManagedClustersClient) Delete(ctx context.Context, resourc result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Delete", nil, "Failure sending request") return } @@ -200,7 +191,10 @@ func (client OpenShiftManagedClustersClient) DeleteSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -209,7 +203,6 @@ func (client OpenShiftManagedClustersClient) DeleteSender(req *http.Request) (fu func (client OpenShiftManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -253,6 +246,7 @@ func (client OpenShiftManagedClustersClient) Get(ctx context.Context, resourceGr result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", resp, "Failure responding to request") + return } return @@ -290,7 +284,6 @@ func (client OpenShiftManagedClustersClient) GetSender(req *http.Request) (*http func (client OpenShiftManagedClustersClient) GetResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -328,6 +321,11 @@ func (client OpenShiftManagedClustersClient) List(ctx context.Context) (result O result.osmclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", resp, "Failure responding to request") + return + } + if result.osmclr.hasNextLink() && result.osmclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -363,7 +361,6 @@ func (client OpenShiftManagedClustersClient) ListSender(req *http.Request) (*htt func (client OpenShiftManagedClustersClient) ListResponder(resp *http.Response) (result OpenShiftManagedClusterListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -446,6 +443,11 @@ func (client OpenShiftManagedClustersClient) ListByResourceGroup(ctx context.Con result.osmclr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.osmclr.hasNextLink() && result.osmclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -482,7 +484,6 @@ func (client OpenShiftManagedClustersClient) ListByResourceGroupSender(req *http func (client OpenShiftManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result OpenShiftManagedClusterListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -537,8 +538,8 @@ func (client OpenShiftManagedClustersClient) UpdateTags(ctx context.Context, res ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -557,7 +558,7 @@ func (client OpenShiftManagedClustersClient) UpdateTags(ctx context.Context, res result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "UpdateTags", nil, "Failure sending request") return } @@ -595,7 +596,10 @@ func (client OpenShiftManagedClustersClient) UpdateTagsSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -604,7 +608,6 @@ func (client OpenShiftManagedClustersClient) UpdateTagsSender(req *http.Request) func (client OpenShiftManagedClustersClient) UpdateTagsResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/operations.go index a090960e690d..cb4eeb2f27ae 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/operations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/operations.go @@ -1,18 +1,7 @@ package containerservice -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -69,6 +58,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure responding to request") + return } return @@ -100,7 +90,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/version.go index 57f38f2e70bc..1744f6527acd 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/version.go @@ -2,19 +2,8 @@ package containerservice import "github.com/Azure/azure-sdk-for-go/version" -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/CHANGELOG.md new file mode 100644 index 000000000000..31ca48a5d321 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/CHANGELOG.md @@ -0,0 +1,186 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/network/resource-manager/readme.md tag: `package-2019-06` + +Code generator @microsoft.azure/autorest.go@2.1.178 + + +### New Funcs + +1. *ApplicationGatewaysBackendHealthFuture.UnmarshalJSON([]byte) error +1. *ApplicationGatewaysBackendHealthOnDemandFuture.UnmarshalJSON([]byte) error +1. *ApplicationGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ApplicationGatewaysDeleteFuture.UnmarshalJSON([]byte) error +1. *ApplicationGatewaysStartFuture.UnmarshalJSON([]byte) error +1. *ApplicationGatewaysStopFuture.UnmarshalJSON([]byte) error +1. *ApplicationGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *ApplicationSecurityGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ApplicationSecurityGroupsDeleteFuture.UnmarshalJSON([]byte) error +1. *ApplicationSecurityGroupsUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *AzureFirewallsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *AzureFirewallsDeleteFuture.UnmarshalJSON([]byte) error +1. *BastionHostsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *BastionHostsDeleteFuture.UnmarshalJSON([]byte) error +1. *BastionHostsUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *ConnectionMonitorsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ConnectionMonitorsDeleteFuture.UnmarshalJSON([]byte) error +1. *ConnectionMonitorsQueryFuture.UnmarshalJSON([]byte) error +1. *ConnectionMonitorsStartFuture.UnmarshalJSON([]byte) error +1. *ConnectionMonitorsStopFuture.UnmarshalJSON([]byte) error +1. *DdosCustomPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *DdosCustomPoliciesDeleteFuture.UnmarshalJSON([]byte) error +1. *DdosCustomPoliciesUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *DdosProtectionPlansCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *DdosProtectionPlansDeleteFuture.UnmarshalJSON([]byte) error +1. *DdosProtectionPlansUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitAuthorizationsDeleteFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitConnectionsDeleteFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitPeeringsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitPeeringsDeleteFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitsDeleteFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitsListArpTableFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitsListRoutesTableFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitsListRoutesTableSummaryFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCircuitsUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteConnectionsDeleteFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCrossConnectionPeeringsDeleteFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCrossConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCrossConnectionsListArpTableFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCrossConnectionsListRoutesTableFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteCrossConnectionsUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ExpressRouteGatewaysDeleteFuture.UnmarshalJSON([]byte) error +1. *ExpressRoutePortsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ExpressRoutePortsDeleteFuture.UnmarshalJSON([]byte) error +1. *ExpressRoutePortsUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *FirewallPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *FirewallPoliciesDeleteFuture.UnmarshalJSON([]byte) error +1. *FirewallPolicyRuleGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *FirewallPolicyRuleGroupsDeleteFuture.UnmarshalJSON([]byte) error +1. *InboundNatRulesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *InboundNatRulesDeleteFuture.UnmarshalJSON([]byte) error +1. *InterfaceTapConfigurationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *InterfaceTapConfigurationsDeleteFuture.UnmarshalJSON([]byte) error +1. *InterfacesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *InterfacesDeleteFuture.UnmarshalJSON([]byte) error +1. *InterfacesGetEffectiveRouteTableFuture.UnmarshalJSON([]byte) error +1. *InterfacesListEffectiveNetworkSecurityGroupsFuture.UnmarshalJSON([]byte) error +1. *InterfacesUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *LoadBalancersCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *LoadBalancersDeleteFuture.UnmarshalJSON([]byte) error +1. *LoadBalancersUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *LocalNetworkGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *LocalNetworkGatewaysDeleteFuture.UnmarshalJSON([]byte) error +1. *LocalNetworkGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *NatGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *NatGatewaysDeleteFuture.UnmarshalJSON([]byte) error +1. *P2sVpnGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *P2sVpnGatewaysDeleteFuture.UnmarshalJSON([]byte) error +1. *P2sVpnGatewaysGenerateVpnProfileFuture.UnmarshalJSON([]byte) error +1. *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture.UnmarshalJSON([]byte) error +1. *P2sVpnGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *P2sVpnServerConfigurationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *P2sVpnServerConfigurationsDeleteFuture.UnmarshalJSON([]byte) error +1. *PacketCapturesCreateFuture.UnmarshalJSON([]byte) error +1. *PacketCapturesDeleteFuture.UnmarshalJSON([]byte) error +1. *PacketCapturesGetStatusFuture.UnmarshalJSON([]byte) error +1. *PacketCapturesStopFuture.UnmarshalJSON([]byte) error +1. *PrivateEndpointsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *PrivateEndpointsDeleteFuture.UnmarshalJSON([]byte) error +1. *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture.UnmarshalJSON([]byte) error +1. *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture.UnmarshalJSON([]byte) error +1. *PrivateLinkServicesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *PrivateLinkServicesDeleteFuture.UnmarshalJSON([]byte) error +1. *PrivateLinkServicesDeletePrivateEndpointConnectionFuture.UnmarshalJSON([]byte) error +1. *ProfilesDeleteFuture.UnmarshalJSON([]byte) error +1. *PublicIPAddressesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *PublicIPAddressesDeleteFuture.UnmarshalJSON([]byte) error +1. *PublicIPAddressesUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *PublicIPPrefixesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *PublicIPPrefixesDeleteFuture.UnmarshalJSON([]byte) error +1. *PublicIPPrefixesUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *RouteFilterRulesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *RouteFilterRulesDeleteFuture.UnmarshalJSON([]byte) error +1. *RouteFilterRulesUpdateFuture.UnmarshalJSON([]byte) error +1. *RouteFiltersCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *RouteFiltersDeleteFuture.UnmarshalJSON([]byte) error +1. *RouteFiltersUpdateFuture.UnmarshalJSON([]byte) error +1. *RouteTablesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *RouteTablesDeleteFuture.UnmarshalJSON([]byte) error +1. *RouteTablesUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *RoutesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *RoutesDeleteFuture.UnmarshalJSON([]byte) error +1. *SecurityGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *SecurityGroupsDeleteFuture.UnmarshalJSON([]byte) error +1. *SecurityGroupsUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *SecurityRulesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *SecurityRulesDeleteFuture.UnmarshalJSON([]byte) error +1. *ServiceEndpointPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ServiceEndpointPoliciesDeleteFuture.UnmarshalJSON([]byte) error +1. *ServiceEndpointPoliciesUpdateFuture.UnmarshalJSON([]byte) error +1. *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *ServiceEndpointPolicyDefinitionsDeleteFuture.UnmarshalJSON([]byte) error +1. *SubnetsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *SubnetsDeleteFuture.UnmarshalJSON([]byte) error +1. *SubnetsPrepareNetworkPoliciesFuture.UnmarshalJSON([]byte) error +1. *SubnetsUnprepareNetworkPoliciesFuture.UnmarshalJSON([]byte) error +1. *VirtualHubsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualHubsDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualHubsUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewayConnectionsDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewayConnectionsResetSharedKeyFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewayConnectionsSetSharedKeyFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewayConnectionsUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysGenerateVpnProfileFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysGeneratevpnclientpackageFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysGetAdvertisedRoutesFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysGetBgpPeerStatusFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysGetLearnedRoutesFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysResetFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkPeeringsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkPeeringsDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkTapsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkTapsDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworkTapsUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworksCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworksDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualNetworksUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *VirtualWansCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VirtualWansDeleteFuture.UnmarshalJSON([]byte) error +1. *VirtualWansUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *VpnConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VpnConnectionsDeleteFuture.UnmarshalJSON([]byte) error +1. *VpnGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VpnGatewaysDeleteFuture.UnmarshalJSON([]byte) error +1. *VpnGatewaysResetFuture.UnmarshalJSON([]byte) error +1. *VpnGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *VpnSitesConfigurationDownloadFuture.UnmarshalJSON([]byte) error +1. *VpnSitesCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *VpnSitesDeleteFuture.UnmarshalJSON([]byte) error +1. *VpnSitesUpdateTagsFuture.UnmarshalJSON([]byte) error +1. *WatchersCheckConnectivityFuture.UnmarshalJSON([]byte) error +1. *WatchersDeleteFuture.UnmarshalJSON([]byte) error +1. *WatchersGetAzureReachabilityReportFuture.UnmarshalJSON([]byte) error +1. *WatchersGetFlowLogStatusFuture.UnmarshalJSON([]byte) error +1. *WatchersGetNetworkConfigurationDiagnosticFuture.UnmarshalJSON([]byte) error +1. *WatchersGetNextHopFuture.UnmarshalJSON([]byte) error +1. *WatchersGetTroubleshootingFuture.UnmarshalJSON([]byte) error +1. *WatchersGetTroubleshootingResultFuture.UnmarshalJSON([]byte) error +1. *WatchersGetVMSecurityRulesFuture.UnmarshalJSON([]byte) error +1. *WatchersListAvailableProvidersFuture.UnmarshalJSON([]byte) error +1. *WatchersSetFlowLogConfigurationFuture.UnmarshalJSON([]byte) error +1. *WatchersVerifyIPFlowFuture.UnmarshalJSON([]byte) error +1. *WebApplicationFirewallPoliciesDeleteFuture.UnmarshalJSON([]byte) error diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/applicationgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/applicationgateways.go index 8c65f4bef46a..cc4c614064aa 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/applicationgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/applicationgateways.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client ApplicationGatewaysClient) BackendHealth(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.BackendHealth") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -67,7 +56,7 @@ func (client ApplicationGatewaysClient) BackendHealth(ctx context.Context, resou result, err = client.BackendHealthSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealth", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealth", nil, "Failure sending request") return } @@ -106,7 +95,10 @@ func (client ApplicationGatewaysClient) BackendHealthSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -115,7 +107,6 @@ func (client ApplicationGatewaysClient) BackendHealthSender(req *http.Request) ( func (client ApplicationGatewaysClient) BackendHealthResponder(resp *http.Response) (result ApplicationGatewayBackendHealth, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -135,8 +126,8 @@ func (client ApplicationGatewaysClient) BackendHealthOnDemand(ctx context.Contex ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.BackendHealthOnDemand") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -149,7 +140,7 @@ func (client ApplicationGatewaysClient) BackendHealthOnDemand(ctx context.Contex result, err = client.BackendHealthOnDemandSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealthOnDemand", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealthOnDemand", nil, "Failure sending request") return } @@ -190,7 +181,10 @@ func (client ApplicationGatewaysClient) BackendHealthOnDemandSender(req *http.Re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -199,7 +193,6 @@ func (client ApplicationGatewaysClient) BackendHealthOnDemandSender(req *http.Re func (client ApplicationGatewaysClient) BackendHealthOnDemandResponder(resp *http.Response) (result ApplicationGatewayBackendHealthOnDemand, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -217,8 +210,8 @@ func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -259,7 +252,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, reso result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -297,7 +290,10 @@ func (client ApplicationGatewaysClient) CreateOrUpdateSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -306,7 +302,6 @@ func (client ApplicationGatewaysClient) CreateOrUpdateSender(req *http.Request) func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -323,8 +318,8 @@ func (client ApplicationGatewaysClient) Delete(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -337,7 +332,7 @@ func (client ApplicationGatewaysClient) Delete(ctx context.Context, resourceGrou result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Delete", nil, "Failure sending request") return } @@ -373,7 +368,10 @@ func (client ApplicationGatewaysClient) DeleteSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -382,7 +380,6 @@ func (client ApplicationGatewaysClient) DeleteSender(req *http.Request) (future func (client ApplicationGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -420,6 +417,7 @@ func (client ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupNa result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", resp, "Failure responding to request") + return } return @@ -457,7 +455,6 @@ func (client ApplicationGatewaysClient) GetSender(req *http.Request) (*http.Resp func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (result ApplicationGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -495,6 +492,7 @@ func (client ApplicationGatewaysClient) GetSslPredefinedPolicy(ctx context.Conte result, err = client.GetSslPredefinedPolicyResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", resp, "Failure responding to request") + return } return @@ -531,7 +529,6 @@ func (client ApplicationGatewaysClient) GetSslPredefinedPolicySender(req *http.R func (client ApplicationGatewaysClient) GetSslPredefinedPolicyResponder(resp *http.Response) (result ApplicationGatewaySslPredefinedPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -570,6 +567,11 @@ func (client ApplicationGatewaysClient) List(ctx context.Context, resourceGroupN result.aglr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure responding to request") + return + } + if result.aglr.hasNextLink() && result.aglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -606,7 +608,6 @@ func (client ApplicationGatewaysClient) ListSender(req *http.Request) (*http.Res func (client ApplicationGatewaysClient) ListResponder(resp *http.Response) (result ApplicationGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -680,6 +681,11 @@ func (client ApplicationGatewaysClient) ListAll(ctx context.Context) (result App result.aglr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure responding to request") + return + } + if result.aglr.hasNextLink() && result.aglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -715,7 +721,6 @@ func (client ApplicationGatewaysClient) ListAllSender(req *http.Request) (*http. func (client ApplicationGatewaysClient) ListAllResponder(resp *http.Response) (result ApplicationGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -788,6 +793,7 @@ func (client ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context. result, err = client.ListAvailableRequestHeadersResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableRequestHeaders", resp, "Failure responding to request") + return } return @@ -823,7 +829,6 @@ func (client ApplicationGatewaysClient) ListAvailableRequestHeadersSender(req *h func (client ApplicationGatewaysClient) ListAvailableRequestHeadersResponder(resp *http.Response) (result ListString, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -859,6 +864,7 @@ func (client ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context result, err = client.ListAvailableResponseHeadersResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableResponseHeaders", resp, "Failure responding to request") + return } return @@ -894,7 +900,6 @@ func (client ApplicationGatewaysClient) ListAvailableResponseHeadersSender(req * func (client ApplicationGatewaysClient) ListAvailableResponseHeadersResponder(resp *http.Response) (result ListString, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -930,6 +935,7 @@ func (client ApplicationGatewaysClient) ListAvailableServerVariables(ctx context result, err = client.ListAvailableServerVariablesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableServerVariables", resp, "Failure responding to request") + return } return @@ -965,7 +971,6 @@ func (client ApplicationGatewaysClient) ListAvailableServerVariablesSender(req * func (client ApplicationGatewaysClient) ListAvailableServerVariablesResponder(resp *http.Response) (result ListString, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -1001,6 +1006,7 @@ func (client ApplicationGatewaysClient) ListAvailableSslOptions(ctx context.Cont result, err = client.ListAvailableSslOptionsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", resp, "Failure responding to request") + return } return @@ -1036,7 +1042,6 @@ func (client ApplicationGatewaysClient) ListAvailableSslOptionsSender(req *http. func (client ApplicationGatewaysClient) ListAvailableSslOptionsResponder(resp *http.Response) (result ApplicationGatewayAvailableSslOptions, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1073,6 +1078,11 @@ func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPolicies(ctx c result.agaspp, err = client.ListAvailableSslPredefinedPoliciesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure responding to request") + return + } + if result.agaspp.hasNextLink() && result.agaspp.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -1108,7 +1118,6 @@ func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesSender func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesResponder(resp *http.Response) (result ApplicationGatewayAvailableSslPredefinedPolicies, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1181,6 +1190,7 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Con result, err = client.ListAvailableWafRuleSetsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableWafRuleSets", resp, "Failure responding to request") + return } return @@ -1216,7 +1226,6 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsSender(req *http func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsResponder(resp *http.Response) (result ApplicationGatewayAvailableWafRuleSetsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1233,8 +1242,8 @@ func (client ApplicationGatewaysClient) Start(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Start") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1247,7 +1256,7 @@ func (client ApplicationGatewaysClient) Start(ctx context.Context, resourceGroup result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Start", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Start", nil, "Failure sending request") return } @@ -1283,7 +1292,10 @@ func (client ApplicationGatewaysClient) StartSender(req *http.Request) (future A if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1292,7 +1304,6 @@ func (client ApplicationGatewaysClient) StartSender(req *http.Request) (future A func (client ApplicationGatewaysClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1308,8 +1319,8 @@ func (client ApplicationGatewaysClient) Stop(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Stop") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1322,7 +1333,7 @@ func (client ApplicationGatewaysClient) Stop(ctx context.Context, resourceGroupN result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Stop", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Stop", nil, "Failure sending request") return } @@ -1358,7 +1369,10 @@ func (client ApplicationGatewaysClient) StopSender(req *http.Request) (future Ap if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1367,7 +1381,6 @@ func (client ApplicationGatewaysClient) StopSender(req *http.Request) (future Ap func (client ApplicationGatewaysClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1384,8 +1397,8 @@ func (client ApplicationGatewaysClient) UpdateTags(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1398,7 +1411,7 @@ func (client ApplicationGatewaysClient) UpdateTags(ctx context.Context, resource result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "UpdateTags", nil, "Failure sending request") return } @@ -1436,7 +1449,10 @@ func (client ApplicationGatewaysClient) UpdateTagsSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1445,7 +1461,6 @@ func (client ApplicationGatewaysClient) UpdateTagsSender(req *http.Request) (fut func (client ApplicationGatewaysClient) UpdateTagsResponder(resp *http.Response) (result ApplicationGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/applicationsecuritygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/applicationsecuritygroups.go index 706a092aaeaf..5abea7e7a2ae 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/applicationsecuritygroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/applicationsecuritygroups.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdate(ctx context.Context ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdate(ctx context.Context result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -105,7 +94,10 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdateSender(req *http.Req if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -114,7 +106,6 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdateSender(req *http.Req func (client ApplicationSecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -131,8 +122,8 @@ func (client ApplicationSecurityGroupsClient) Delete(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -145,7 +136,7 @@ func (client ApplicationSecurityGroupsClient) Delete(ctx context.Context, resour result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Delete", nil, "Failure sending request") return } @@ -181,7 +172,10 @@ func (client ApplicationSecurityGroupsClient) DeleteSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -190,7 +184,6 @@ func (client ApplicationSecurityGroupsClient) DeleteSender(req *http.Request) (f func (client ApplicationSecurityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -228,6 +221,7 @@ func (client ApplicationSecurityGroupsClient) Get(ctx context.Context, resourceG result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", resp, "Failure responding to request") + return } return @@ -265,7 +259,6 @@ func (client ApplicationSecurityGroupsClient) GetSender(req *http.Request) (*htt func (client ApplicationSecurityGroupsClient) GetResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -304,6 +297,11 @@ func (client ApplicationSecurityGroupsClient) List(ctx context.Context, resource result.asglr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure responding to request") + return + } + if result.asglr.hasNextLink() && result.asglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -340,7 +338,6 @@ func (client ApplicationSecurityGroupsClient) ListSender(req *http.Request) (*ht func (client ApplicationSecurityGroupsClient) ListResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -414,6 +411,11 @@ func (client ApplicationSecurityGroupsClient) ListAll(ctx context.Context) (resu result.asglr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure responding to request") + return + } + if result.asglr.hasNextLink() && result.asglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -449,7 +451,6 @@ func (client ApplicationSecurityGroupsClient) ListAllSender(req *http.Request) ( func (client ApplicationSecurityGroupsClient) ListAllResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -504,8 +505,8 @@ func (client ApplicationSecurityGroupsClient) UpdateTags(ctx context.Context, re ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -518,7 +519,7 @@ func (client ApplicationSecurityGroupsClient) UpdateTags(ctx context.Context, re result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "UpdateTags", nil, "Failure sending request") return } @@ -556,7 +557,10 @@ func (client ApplicationSecurityGroupsClient) UpdateTagsSender(req *http.Request if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -565,7 +569,6 @@ func (client ApplicationSecurityGroupsClient) UpdateTagsSender(req *http.Request func (client ApplicationSecurityGroupsClient) UpdateTagsResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availabledelegations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availabledelegations.go index 7a04f311e391..ccbf2ba97b05 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availabledelegations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availabledelegations.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,11 @@ func (client AvailableDelegationsClient) List(ctx context.Context, location stri result.adr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "List", resp, "Failure responding to request") + return + } + if result.adr.hasNextLink() && result.adr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -109,7 +103,6 @@ func (client AvailableDelegationsClient) ListSender(req *http.Request) (*http.Re func (client AvailableDelegationsClient) ListResponder(resp *http.Response) (result AvailableDelegationsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableendpointservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableendpointservices.go index 69d99c04af0f..9c193f48bc10 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableendpointservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableendpointservices.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,11 @@ func (client AvailableEndpointServicesClient) List(ctx context.Context, location result.eslr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure responding to request") + return + } + if result.eslr.hasNextLink() && result.eslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -109,7 +103,6 @@ func (client AvailableEndpointServicesClient) ListSender(req *http.Request) (*ht func (client AvailableEndpointServicesClient) ListResponder(resp *http.Response) (result EndpointServicesListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableprivateendpointtypes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableprivateendpointtypes.go index 2f796046190b..dc9871acd86c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableprivateendpointtypes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableprivateendpointtypes.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,11 @@ func (client AvailablePrivateEndpointTypesClient) List(ctx context.Context, loca result.apetr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "List", resp, "Failure responding to request") + return + } + if result.apetr.hasNextLink() && result.apetr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -109,7 +103,6 @@ func (client AvailablePrivateEndpointTypesClient) ListSender(req *http.Request) func (client AvailablePrivateEndpointTypesClient) ListResponder(resp *http.Response) (result AvailablePrivateEndpointTypesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -187,6 +180,11 @@ func (client AvailablePrivateEndpointTypesClient) ListByResourceGroup(ctx contex result.apetr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.apetr.hasNextLink() && result.apetr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -224,7 +222,6 @@ func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupSender(req func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupResponder(resp *http.Response) (result AvailablePrivateEndpointTypesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableresourcegroupdelegations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableresourcegroupdelegations.go index 31fa824c0232..392dcd58ec40 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableresourcegroupdelegations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/availableresourcegroupdelegations.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -75,6 +64,11 @@ func (client AvailableResourceGroupDelegationsClient) List(ctx context.Context, result.adr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "List", resp, "Failure responding to request") + return + } + if result.adr.hasNextLink() && result.adr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -112,7 +106,6 @@ func (client AvailableResourceGroupDelegationsClient) ListSender(req *http.Reque func (client AvailableResourceGroupDelegationsClient) ListResponder(resp *http.Response) (result AvailableDelegationsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/azurefirewallfqdntags.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/azurefirewallfqdntags.go index 6b4f3afced5a..0fcfac4377ce 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/azurefirewallfqdntags.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/azurefirewallfqdntags.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -71,6 +60,11 @@ func (client AzureFirewallFqdnTagsClient) ListAll(ctx context.Context) (result A result.afftlr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "ListAll", resp, "Failure responding to request") + return + } + if result.afftlr.hasNextLink() && result.afftlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -106,7 +100,6 @@ func (client AzureFirewallFqdnTagsClient) ListAllSender(req *http.Request) (*htt func (client AzureFirewallFqdnTagsClient) ListAllResponder(resp *http.Response) (result AzureFirewallFqdnTagListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/azurefirewalls.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/azurefirewalls.go index 74ee61bbe9d8..d9f29e4a2393 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/azurefirewalls.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/azurefirewalls.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client AzureFirewallsClient) CreateOrUpdate(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client AzureFirewallsClient) CreateOrUpdate(ctx context.Context, resourceG result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client AzureFirewallsClient) CreateOrUpdateSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client AzureFirewallsClient) CreateOrUpdateSender(req *http.Request) (futu func (client AzureFirewallsClient) CreateOrUpdateResponder(resp *http.Response) (result AzureFirewall, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client AzureFirewallsClient) Delete(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client AzureFirewallsClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client AzureFirewallsClient) DeleteSender(req *http.Request) (future Azure if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client AzureFirewallsClient) DeleteSender(req *http.Request) (future Azure func (client AzureFirewallsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client AzureFirewallsClient) Get(ctx context.Context, resourceGroupName st result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", resp, "Failure responding to request") + return } return @@ -264,7 +258,6 @@ func (client AzureFirewallsClient) GetSender(req *http.Request) (*http.Response, func (client AzureFirewallsClient) GetResponder(resp *http.Response) (result AzureFirewall, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -303,6 +296,11 @@ func (client AzureFirewallsClient) List(ctx context.Context, resourceGroupName s result.aflr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure responding to request") + return + } + if result.aflr.hasNextLink() && result.aflr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -339,7 +337,6 @@ func (client AzureFirewallsClient) ListSender(req *http.Request) (*http.Response func (client AzureFirewallsClient) ListResponder(resp *http.Response) (result AzureFirewallListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +410,11 @@ func (client AzureFirewallsClient) ListAll(ctx context.Context) (result AzureFir result.aflr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure responding to request") + return + } + if result.aflr.hasNextLink() && result.aflr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -448,7 +450,6 @@ func (client AzureFirewallsClient) ListAllSender(req *http.Request) (*http.Respo func (client AzureFirewallsClient) ListAllResponder(resp *http.Response) (result AzureFirewallListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -525,6 +526,7 @@ func (client AzureFirewallsClient) UpdateTags(ctx context.Context, resourceGroup result, err = client.UpdateTagsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "UpdateTags", resp, "Failure responding to request") + return } return @@ -565,7 +567,6 @@ func (client AzureFirewallsClient) UpdateTagsSender(req *http.Request) (*http.Re func (client AzureFirewallsClient) UpdateTagsResponder(resp *http.Response) (result AzureFirewall, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/bastionhosts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/bastionhosts.go index fe68d8a4109a..f738a0220358 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/bastionhosts.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/bastionhosts.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client BastionHostsClient) CreateOrUpdate(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client BastionHostsClient) CreateOrUpdate(ctx context.Context, resourceGro result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client BastionHostsClient) CreateOrUpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client BastionHostsClient) CreateOrUpdateSender(req *http.Request) (future func (client BastionHostsClient) CreateOrUpdateResponder(resp *http.Response) (result BastionHost, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client BastionHostsClient) Delete(ctx context.Context, resourceGroupName s ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client BastionHostsClient) Delete(ctx context.Context, resourceGroupName s result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client BastionHostsClient) DeleteSender(req *http.Request) (future Bastion if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client BastionHostsClient) DeleteSender(req *http.Request) (future Bastion func (client BastionHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client BastionHostsClient) Get(ctx context.Context, resourceGroupName stri result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Get", resp, "Failure responding to request") + return } return @@ -264,7 +258,6 @@ func (client BastionHostsClient) GetSender(req *http.Request) (*http.Response, e func (client BastionHostsClient) GetResponder(resp *http.Response) (result BastionHost, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -301,6 +294,11 @@ func (client BastionHostsClient) List(ctx context.Context) (result BastionHostLi result.bhlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "List", resp, "Failure responding to request") + return + } + if result.bhlr.hasNextLink() && result.bhlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -336,7 +334,6 @@ func (client BastionHostsClient) ListSender(req *http.Request) (*http.Response, func (client BastionHostsClient) ListResponder(resp *http.Response) (result BastionHostListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -412,6 +409,11 @@ func (client BastionHostsClient) ListByResourceGroup(ctx context.Context, resour result.bhlr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.bhlr.hasNextLink() && result.bhlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -448,7 +450,6 @@ func (client BastionHostsClient) ListByResourceGroupSender(req *http.Request) (* func (client BastionHostsClient) ListByResourceGroupResponder(resp *http.Response) (result BastionHostListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -503,8 +504,8 @@ func (client BastionHostsClient) UpdateTags(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -517,7 +518,7 @@ func (client BastionHostsClient) UpdateTags(ctx context.Context, resourceGroupNa result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "UpdateTags", nil, "Failure sending request") return } @@ -555,7 +556,10 @@ func (client BastionHostsClient) UpdateTagsSender(req *http.Request) (future Bas if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -564,7 +568,6 @@ func (client BastionHostsClient) UpdateTagsSender(req *http.Request) (future Bas func (client BastionHostsClient) UpdateTagsResponder(resp *http.Response) (result BastionHost, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/bgpservicecommunities.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/bgpservicecommunities.go index d5964f2a5ad5..2dd6880c4cc2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/bgpservicecommunities.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/bgpservicecommunities.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -71,6 +60,11 @@ func (client BgpServiceCommunitiesClient) List(ctx context.Context) (result BgpS result.bsclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "List", resp, "Failure responding to request") + return + } + if result.bsclr.hasNextLink() && result.bsclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -106,7 +100,6 @@ func (client BgpServiceCommunitiesClient) ListSender(req *http.Request) (*http.R func (client BgpServiceCommunitiesClient) ListResponder(resp *http.Response) (result BgpServiceCommunityListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/client.go index 26209bf396f5..535f4ca3e282 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/client.go @@ -3,19 +3,8 @@ // Network Client package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -87,6 +76,7 @@ func (client BaseClient) CheckDNSNameAvailability(ctx context.Context, location result, err = client.CheckDNSNameAvailabilityResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.BaseClient", "CheckDNSNameAvailability", resp, "Failure responding to request") + return } return @@ -124,7 +114,6 @@ func (client BaseClient) CheckDNSNameAvailabilitySender(req *http.Request) (*htt func (client BaseClient) CheckDNSNameAvailabilityResponder(resp *http.Response) (result DNSNameAvailabilityResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -163,6 +152,7 @@ func (client BaseClient) SupportedSecurityProviders(ctx context.Context, resourc result, err = client.SupportedSecurityProvidersResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.BaseClient", "SupportedSecurityProviders", resp, "Failure responding to request") + return } return @@ -200,7 +190,6 @@ func (client BaseClient) SupportedSecurityProvidersSender(req *http.Request) (*h func (client BaseClient) SupportedSecurityProvidersResponder(resp *http.Response) (result VirtualWanSecurityProviders, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/connectionmonitors.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/connectionmonitors.go index 86b7360f7005..c1f278cc48ea 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/connectionmonitors.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/connectionmonitors.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client ConnectionMonitorsClient) CreateOrUpdate(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -78,7 +67,7 @@ func (client ConnectionMonitorsClient) CreateOrUpdate(ctx context.Context, resou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -117,7 +106,10 @@ func (client ConnectionMonitorsClient) CreateOrUpdateSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -126,7 +118,6 @@ func (client ConnectionMonitorsClient) CreateOrUpdateSender(req *http.Request) ( func (client ConnectionMonitorsClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -144,8 +135,8 @@ func (client ConnectionMonitorsClient) Delete(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -158,7 +149,7 @@ func (client ConnectionMonitorsClient) Delete(ctx context.Context, resourceGroup result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Delete", nil, "Failure sending request") return } @@ -195,7 +186,10 @@ func (client ConnectionMonitorsClient) DeleteSender(req *http.Request) (future C if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -204,7 +198,6 @@ func (client ConnectionMonitorsClient) DeleteSender(req *http.Request) (future C func (client ConnectionMonitorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -243,6 +236,7 @@ func (client ConnectionMonitorsClient) Get(ctx context.Context, resourceGroupNam result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Get", resp, "Failure responding to request") + return } return @@ -281,7 +275,6 @@ func (client ConnectionMonitorsClient) GetSender(req *http.Request) (*http.Respo func (client ConnectionMonitorsClient) GetResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -320,6 +313,7 @@ func (client ConnectionMonitorsClient) List(ctx context.Context, resourceGroupNa result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "List", resp, "Failure responding to request") + return } return @@ -357,7 +351,6 @@ func (client ConnectionMonitorsClient) ListSender(req *http.Request) (*http.Resp func (client ConnectionMonitorsClient) ListResponder(resp *http.Response) (result ConnectionMonitorListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -375,8 +368,8 @@ func (client ConnectionMonitorsClient) Query(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Query") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -389,7 +382,7 @@ func (client ConnectionMonitorsClient) Query(ctx context.Context, resourceGroupN result, err = client.QuerySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Query", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Query", nil, "Failure sending request") return } @@ -426,7 +419,10 @@ func (client ConnectionMonitorsClient) QuerySender(req *http.Request) (future Co if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -435,7 +431,6 @@ func (client ConnectionMonitorsClient) QuerySender(req *http.Request) (future Co func (client ConnectionMonitorsClient) QueryResponder(resp *http.Response) (result ConnectionMonitorQueryResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -453,8 +448,8 @@ func (client ConnectionMonitorsClient) Start(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Start") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -467,7 +462,7 @@ func (client ConnectionMonitorsClient) Start(ctx context.Context, resourceGroupN result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Start", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Start", nil, "Failure sending request") return } @@ -504,7 +499,10 @@ func (client ConnectionMonitorsClient) StartSender(req *http.Request) (future Co if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -513,7 +511,6 @@ func (client ConnectionMonitorsClient) StartSender(req *http.Request) (future Co func (client ConnectionMonitorsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -530,8 +527,8 @@ func (client ConnectionMonitorsClient) Stop(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Stop") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -544,7 +541,7 @@ func (client ConnectionMonitorsClient) Stop(ctx context.Context, resourceGroupNa result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Stop", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Stop", nil, "Failure sending request") return } @@ -581,7 +578,10 @@ func (client ConnectionMonitorsClient) StopSender(req *http.Request) (future Con if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -590,7 +590,6 @@ func (client ConnectionMonitorsClient) StopSender(req *http.Request) (future Con func (client ConnectionMonitorsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -630,6 +629,7 @@ func (client ConnectionMonitorsClient) UpdateTags(ctx context.Context, resourceG result, err = client.UpdateTagsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "UpdateTags", resp, "Failure responding to request") + return } return @@ -670,7 +670,6 @@ func (client ConnectionMonitorsClient) UpdateTagsSender(req *http.Request) (*htt func (client ConnectionMonitorsClient) UpdateTagsResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/ddoscustompolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/ddoscustompolicies.go index 21d6819fd75c..3d6b2c3de8de 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/ddoscustompolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/ddoscustompolicies.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client DdosCustomPoliciesClient) CreateOrUpdate(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client DdosCustomPoliciesClient) CreateOrUpdate(ctx context.Context, resou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -105,7 +94,10 @@ func (client DdosCustomPoliciesClient) CreateOrUpdateSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -114,7 +106,6 @@ func (client DdosCustomPoliciesClient) CreateOrUpdateSender(req *http.Request) ( func (client DdosCustomPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DdosCustomPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -131,8 +122,8 @@ func (client DdosCustomPoliciesClient) Delete(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -145,7 +136,7 @@ func (client DdosCustomPoliciesClient) Delete(ctx context.Context, resourceGroup result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Delete", nil, "Failure sending request") return } @@ -181,7 +172,10 @@ func (client DdosCustomPoliciesClient) DeleteSender(req *http.Request) (future D if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -190,7 +184,6 @@ func (client DdosCustomPoliciesClient) DeleteSender(req *http.Request) (future D func (client DdosCustomPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -228,6 +221,7 @@ func (client DdosCustomPoliciesClient) Get(ctx context.Context, resourceGroupNam result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Get", resp, "Failure responding to request") + return } return @@ -265,7 +259,6 @@ func (client DdosCustomPoliciesClient) GetSender(req *http.Request) (*http.Respo func (client DdosCustomPoliciesClient) GetResponder(resp *http.Response) (result DdosCustomPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -283,8 +276,8 @@ func (client DdosCustomPoliciesClient) UpdateTags(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -297,7 +290,7 @@ func (client DdosCustomPoliciesClient) UpdateTags(ctx context.Context, resourceG result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "UpdateTags", nil, "Failure sending request") return } @@ -335,7 +328,10 @@ func (client DdosCustomPoliciesClient) UpdateTagsSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -344,7 +340,6 @@ func (client DdosCustomPoliciesClient) UpdateTagsSender(req *http.Request) (futu func (client DdosCustomPoliciesClient) UpdateTagsResponder(resp *http.Response) (result DdosCustomPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/ddosprotectionplans.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/ddosprotectionplans.go index 5b6b270ce4e0..0bdab4eae4d3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/ddosprotectionplans.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/ddosprotectionplans.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client DdosProtectionPlansClient) CreateOrUpdate(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client DdosProtectionPlansClient) CreateOrUpdate(ctx context.Context, reso result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -108,7 +97,10 @@ func (client DdosProtectionPlansClient) CreateOrUpdateSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -117,7 +109,6 @@ func (client DdosProtectionPlansClient) CreateOrUpdateSender(req *http.Request) func (client DdosProtectionPlansClient) CreateOrUpdateResponder(resp *http.Response) (result DdosProtectionPlan, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -134,8 +125,8 @@ func (client DdosProtectionPlansClient) Delete(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -148,7 +139,7 @@ func (client DdosProtectionPlansClient) Delete(ctx context.Context, resourceGrou result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Delete", nil, "Failure sending request") return } @@ -184,7 +175,10 @@ func (client DdosProtectionPlansClient) DeleteSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -193,7 +187,6 @@ func (client DdosProtectionPlansClient) DeleteSender(req *http.Request) (future func (client DdosProtectionPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -231,6 +224,7 @@ func (client DdosProtectionPlansClient) Get(ctx context.Context, resourceGroupNa result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", resp, "Failure responding to request") + return } return @@ -268,7 +262,6 @@ func (client DdosProtectionPlansClient) GetSender(req *http.Request) (*http.Resp func (client DdosProtectionPlansClient) GetResponder(resp *http.Response) (result DdosProtectionPlan, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -305,6 +298,11 @@ func (client DdosProtectionPlansClient) List(ctx context.Context) (result DdosPr result.dpplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", resp, "Failure responding to request") + return + } + if result.dpplr.hasNextLink() && result.dpplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -340,7 +338,6 @@ func (client DdosProtectionPlansClient) ListSender(req *http.Request) (*http.Res func (client DdosProtectionPlansClient) ListResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +413,11 @@ func (client DdosProtectionPlansClient) ListByResourceGroup(ctx context.Context, result.dpplr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.dpplr.hasNextLink() && result.dpplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -452,7 +454,6 @@ func (client DdosProtectionPlansClient) ListByResourceGroupSender(req *http.Requ func (client DdosProtectionPlansClient) ListByResourceGroupResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -507,8 +508,8 @@ func (client DdosProtectionPlansClient) UpdateTags(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -521,7 +522,7 @@ func (client DdosProtectionPlansClient) UpdateTags(ctx context.Context, resource result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", nil, "Failure sending request") return } @@ -559,7 +560,10 @@ func (client DdosProtectionPlansClient) UpdateTagsSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -568,7 +572,6 @@ func (client DdosProtectionPlansClient) UpdateTagsSender(req *http.Request) (fut func (client DdosProtectionPlansClient) UpdateTagsResponder(resp *http.Response) (result DdosProtectionPlan, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/defaultsecurityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/defaultsecurityrules.go index 9265ce276939..1a4d1519e48d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/defaultsecurityrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/defaultsecurityrules.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client DefaultSecurityRulesClient) Get(ctx context.Context, resourceGroupN result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client DefaultSecurityRulesClient) GetSender(req *http.Request) (*http.Res func (client DefaultSecurityRulesClient) GetResponder(resp *http.Response) (result SecurityRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,11 @@ func (client DefaultSecurityRulesClient) List(ctx context.Context, resourceGroup result.srlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure responding to request") + return + } + if result.srlr.hasNextLink() && result.srlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -189,7 +183,6 @@ func (client DefaultSecurityRulesClient) ListSender(req *http.Request) (*http.Re func (client DefaultSecurityRulesClient) ListResponder(resp *http.Response) (result SecurityRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/enums.go new file mode 100644 index 000000000000..20f33f9e4bf1 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/enums.go @@ -0,0 +1,2076 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Access enumerates the values for access. +type Access string + +const ( + // Allow ... + Allow Access = "Allow" + // Deny ... + Deny Access = "Deny" +) + +// PossibleAccessValues returns an array of possible values for the Access const type. +func PossibleAccessValues() []Access { + return []Access{Allow, Deny} +} + +// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health +// server health. +type ApplicationGatewayBackendHealthServerHealth string + +const ( + // Down ... + Down ApplicationGatewayBackendHealthServerHealth = "Down" + // Draining ... + Draining ApplicationGatewayBackendHealthServerHealth = "Draining" + // Partial ... + Partial ApplicationGatewayBackendHealthServerHealth = "Partial" + // Unknown ... + Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" + // Up ... + Up ApplicationGatewayBackendHealthServerHealth = "Up" +) + +// PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. +func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { + return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} +} + +// ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. +type ApplicationGatewayCookieBasedAffinity string + +const ( + // Disabled ... + Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" + // Enabled ... + Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" +) + +// PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. +func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { + return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} +} + +// ApplicationGatewayCustomErrorStatusCode enumerates the values for application gateway custom error status +// code. +type ApplicationGatewayCustomErrorStatusCode string + +const ( + // HTTPStatus403 ... + HTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" + // HTTPStatus502 ... + HTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" +) + +// PossibleApplicationGatewayCustomErrorStatusCodeValues returns an array of possible values for the ApplicationGatewayCustomErrorStatusCode const type. +func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { + return []ApplicationGatewayCustomErrorStatusCode{HTTPStatus403, HTTPStatus502} +} + +// ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. +type ApplicationGatewayFirewallMode string + +const ( + // Detection ... + Detection ApplicationGatewayFirewallMode = "Detection" + // Prevention ... + Prevention ApplicationGatewayFirewallMode = "Prevention" +) + +// PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. +func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { + return []ApplicationGatewayFirewallMode{Detection, Prevention} +} + +// ApplicationGatewayOperationalState enumerates the values for application gateway operational state. +type ApplicationGatewayOperationalState string + +const ( + // Running ... + Running ApplicationGatewayOperationalState = "Running" + // Starting ... + Starting ApplicationGatewayOperationalState = "Starting" + // Stopped ... + Stopped ApplicationGatewayOperationalState = "Stopped" + // Stopping ... + Stopping ApplicationGatewayOperationalState = "Stopping" +) + +// PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. +func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { + return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} +} + +// ApplicationGatewayProtocol enumerates the values for application gateway protocol. +type ApplicationGatewayProtocol string + +const ( + // HTTP ... + HTTP ApplicationGatewayProtocol = "Http" + // HTTPS ... + HTTPS ApplicationGatewayProtocol = "Https" +) + +// PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. +func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { + return []ApplicationGatewayProtocol{HTTP, HTTPS} +} + +// ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. +type ApplicationGatewayRedirectType string + +const ( + // Found ... + Found ApplicationGatewayRedirectType = "Found" + // Permanent ... + Permanent ApplicationGatewayRedirectType = "Permanent" + // SeeOther ... + SeeOther ApplicationGatewayRedirectType = "SeeOther" + // Temporary ... + Temporary ApplicationGatewayRedirectType = "Temporary" +) + +// PossibleApplicationGatewayRedirectTypeValues returns an array of possible values for the ApplicationGatewayRedirectType const type. +func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { + return []ApplicationGatewayRedirectType{Found, Permanent, SeeOther, Temporary} +} + +// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule +// type. +type ApplicationGatewayRequestRoutingRuleType string + +const ( + // Basic ... + Basic ApplicationGatewayRequestRoutingRuleType = "Basic" + // PathBasedRouting ... + PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" +) + +// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. +func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { + return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} +} + +// ApplicationGatewaySkuName enumerates the values for application gateway sku name. +type ApplicationGatewaySkuName string + +const ( + // StandardLarge ... + StandardLarge ApplicationGatewaySkuName = "Standard_Large" + // StandardMedium ... + StandardMedium ApplicationGatewaySkuName = "Standard_Medium" + // StandardSmall ... + StandardSmall ApplicationGatewaySkuName = "Standard_Small" + // StandardV2 ... + StandardV2 ApplicationGatewaySkuName = "Standard_v2" + // WAFLarge ... + WAFLarge ApplicationGatewaySkuName = "WAF_Large" + // WAFMedium ... + WAFMedium ApplicationGatewaySkuName = "WAF_Medium" + // WAFV2 ... + WAFV2 ApplicationGatewaySkuName = "WAF_v2" +) + +// PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. +func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { + return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, StandardV2, WAFLarge, WAFMedium, WAFV2} +} + +// ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. +type ApplicationGatewaySslCipherSuite string + +const ( + // TLSDHEDSSWITH3DESEDECBCSHA ... + TLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + // TLSDHEDSSWITHAES128CBCSHA ... + TLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + // TLSDHEDSSWITHAES128CBCSHA256 ... + TLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + // TLSDHEDSSWITHAES256CBCSHA ... + TLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + // TLSDHEDSSWITHAES256CBCSHA256 ... + TLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + // TLSDHERSAWITHAES128CBCSHA ... + TLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + // TLSDHERSAWITHAES128GCMSHA256 ... + TLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + // TLSDHERSAWITHAES256CBCSHA ... + TLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + // TLSDHERSAWITHAES256GCMSHA384 ... + TLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + // TLSECDHEECDSAWITHAES128CBCSHA ... + TLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + // TLSECDHEECDSAWITHAES128CBCSHA256 ... + TLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + // TLSECDHEECDSAWITHAES128GCMSHA256 ... + TLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + // TLSECDHEECDSAWITHAES256CBCSHA ... + TLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + // TLSECDHEECDSAWITHAES256CBCSHA384 ... + TLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + // TLSECDHEECDSAWITHAES256GCMSHA384 ... + TLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + // TLSECDHERSAWITHAES128CBCSHA ... + TLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + // TLSECDHERSAWITHAES128CBCSHA256 ... + TLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + // TLSECDHERSAWITHAES128GCMSHA256 ... + TLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + // TLSECDHERSAWITHAES256CBCSHA ... + TLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + // TLSECDHERSAWITHAES256CBCSHA384 ... + TLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + // TLSECDHERSAWITHAES256GCMSHA384 ... + TLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + // TLSRSAWITH3DESEDECBCSHA ... + TLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + // TLSRSAWITHAES128CBCSHA ... + TLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" + // TLSRSAWITHAES128CBCSHA256 ... + TLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" + // TLSRSAWITHAES128GCMSHA256 ... + TLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" + // TLSRSAWITHAES256CBCSHA ... + TLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" + // TLSRSAWITHAES256CBCSHA256 ... + TLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" + // TLSRSAWITHAES256GCMSHA384 ... + TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" +) + +// PossibleApplicationGatewaySslCipherSuiteValues returns an array of possible values for the ApplicationGatewaySslCipherSuite const type. +func PossibleApplicationGatewaySslCipherSuiteValues() []ApplicationGatewaySslCipherSuite { + return []ApplicationGatewaySslCipherSuite{TLSDHEDSSWITH3DESEDECBCSHA, TLSDHEDSSWITHAES128CBCSHA, TLSDHEDSSWITHAES128CBCSHA256, TLSDHEDSSWITHAES256CBCSHA, TLSDHEDSSWITHAES256CBCSHA256, TLSDHERSAWITHAES128CBCSHA, TLSDHERSAWITHAES128GCMSHA256, TLSDHERSAWITHAES256CBCSHA, TLSDHERSAWITHAES256GCMSHA384, TLSECDHEECDSAWITHAES128CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA256, TLSECDHEECDSAWITHAES128GCMSHA256, TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES256CBCSHA384, TLSECDHEECDSAWITHAES256GCMSHA384, TLSECDHERSAWITHAES128CBCSHA, TLSECDHERSAWITHAES128CBCSHA256, TLSECDHERSAWITHAES128GCMSHA256, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES256CBCSHA384, TLSECDHERSAWITHAES256GCMSHA384, TLSRSAWITH3DESEDECBCSHA, TLSRSAWITHAES128CBCSHA, TLSRSAWITHAES128CBCSHA256, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES256GCMSHA384} +} + +// ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. +type ApplicationGatewaySslPolicyName string + +const ( + // AppGwSslPolicy20150501 ... + AppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" + // AppGwSslPolicy20170401 ... + AppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" + // AppGwSslPolicy20170401S ... + AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" +) + +// PossibleApplicationGatewaySslPolicyNameValues returns an array of possible values for the ApplicationGatewaySslPolicyName const type. +func PossibleApplicationGatewaySslPolicyNameValues() []ApplicationGatewaySslPolicyName { + return []ApplicationGatewaySslPolicyName{AppGwSslPolicy20150501, AppGwSslPolicy20170401, AppGwSslPolicy20170401S} +} + +// ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. +type ApplicationGatewaySslPolicyType string + +const ( + // Custom ... + Custom ApplicationGatewaySslPolicyType = "Custom" + // Predefined ... + Predefined ApplicationGatewaySslPolicyType = "Predefined" +) + +// PossibleApplicationGatewaySslPolicyTypeValues returns an array of possible values for the ApplicationGatewaySslPolicyType const type. +func PossibleApplicationGatewaySslPolicyTypeValues() []ApplicationGatewaySslPolicyType { + return []ApplicationGatewaySslPolicyType{Custom, Predefined} +} + +// ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. +type ApplicationGatewaySslProtocol string + +const ( + // TLSv10 ... + TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" + // TLSv11 ... + TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" + // TLSv12 ... + TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" +) + +// PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. +func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { + return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12} +} + +// ApplicationGatewayTier enumerates the values for application gateway tier. +type ApplicationGatewayTier string + +const ( + // ApplicationGatewayTierStandard ... + ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" + // ApplicationGatewayTierStandardV2 ... + ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" + // ApplicationGatewayTierWAF ... + ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" + // ApplicationGatewayTierWAFV2 ... + ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" +) + +// PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. +func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { + return []ApplicationGatewayTier{ApplicationGatewayTierStandard, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, ApplicationGatewayTierWAFV2} +} + +// AssociationType enumerates the values for association type. +type AssociationType string + +const ( + // Associated ... + Associated AssociationType = "Associated" + // Contains ... + Contains AssociationType = "Contains" +) + +// PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. +func PossibleAssociationTypeValues() []AssociationType { + return []AssociationType{Associated, Contains} +} + +// AuthenticationMethod enumerates the values for authentication method. +type AuthenticationMethod string + +const ( + // EAPMSCHAPv2 ... + EAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" + // EAPTLS ... + EAPTLS AuthenticationMethod = "EAPTLS" +) + +// PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. +func PossibleAuthenticationMethodValues() []AuthenticationMethod { + return []AuthenticationMethod{EAPMSCHAPv2, EAPTLS} +} + +// AuthorizationUseStatus enumerates the values for authorization use status. +type AuthorizationUseStatus string + +const ( + // Available ... + Available AuthorizationUseStatus = "Available" + // InUse ... + InUse AuthorizationUseStatus = "InUse" +) + +// PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. +func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { + return []AuthorizationUseStatus{Available, InUse} +} + +// AzureFirewallApplicationRuleProtocolType enumerates the values for azure firewall application rule protocol +// type. +type AzureFirewallApplicationRuleProtocolType string + +const ( + // AzureFirewallApplicationRuleProtocolTypeHTTP ... + AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" + // AzureFirewallApplicationRuleProtocolTypeHTTPS ... + AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" +) + +// PossibleAzureFirewallApplicationRuleProtocolTypeValues returns an array of possible values for the AzureFirewallApplicationRuleProtocolType const type. +func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApplicationRuleProtocolType { + return []AzureFirewallApplicationRuleProtocolType{AzureFirewallApplicationRuleProtocolTypeHTTP, AzureFirewallApplicationRuleProtocolTypeHTTPS} +} + +// AzureFirewallNatRCActionType enumerates the values for azure firewall nat rc action type. +type AzureFirewallNatRCActionType string + +const ( + // Dnat ... + Dnat AzureFirewallNatRCActionType = "Dnat" + // Snat ... + Snat AzureFirewallNatRCActionType = "Snat" +) + +// PossibleAzureFirewallNatRCActionTypeValues returns an array of possible values for the AzureFirewallNatRCActionType const type. +func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { + return []AzureFirewallNatRCActionType{Dnat, Snat} +} + +// AzureFirewallNetworkRuleProtocol enumerates the values for azure firewall network rule protocol. +type AzureFirewallNetworkRuleProtocol string + +const ( + // Any ... + Any AzureFirewallNetworkRuleProtocol = "Any" + // ICMP ... + ICMP AzureFirewallNetworkRuleProtocol = "ICMP" + // TCP ... + TCP AzureFirewallNetworkRuleProtocol = "TCP" + // UDP ... + UDP AzureFirewallNetworkRuleProtocol = "UDP" +) + +// PossibleAzureFirewallNetworkRuleProtocolValues returns an array of possible values for the AzureFirewallNetworkRuleProtocol const type. +func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { + return []AzureFirewallNetworkRuleProtocol{Any, ICMP, TCP, UDP} +} + +// AzureFirewallRCActionType enumerates the values for azure firewall rc action type. +type AzureFirewallRCActionType string + +const ( + // AzureFirewallRCActionTypeAllow ... + AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" + // AzureFirewallRCActionTypeDeny ... + AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" +) + +// PossibleAzureFirewallRCActionTypeValues returns an array of possible values for the AzureFirewallRCActionType const type. +func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { + return []AzureFirewallRCActionType{AzureFirewallRCActionTypeAllow, AzureFirewallRCActionTypeDeny} +} + +// AzureFirewallThreatIntelMode enumerates the values for azure firewall threat intel mode. +type AzureFirewallThreatIntelMode string + +const ( + // AzureFirewallThreatIntelModeAlert ... + AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" + // AzureFirewallThreatIntelModeDeny ... + AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" + // AzureFirewallThreatIntelModeOff ... + AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" +) + +// PossibleAzureFirewallThreatIntelModeValues returns an array of possible values for the AzureFirewallThreatIntelMode const type. +func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode { + return []AzureFirewallThreatIntelMode{AzureFirewallThreatIntelModeAlert, AzureFirewallThreatIntelModeDeny, AzureFirewallThreatIntelModeOff} +} + +// BgpPeerState enumerates the values for bgp peer state. +type BgpPeerState string + +const ( + // BgpPeerStateConnected ... + BgpPeerStateConnected BgpPeerState = "Connected" + // BgpPeerStateConnecting ... + BgpPeerStateConnecting BgpPeerState = "Connecting" + // BgpPeerStateIdle ... + BgpPeerStateIdle BgpPeerState = "Idle" + // BgpPeerStateStopped ... + BgpPeerStateStopped BgpPeerState = "Stopped" + // BgpPeerStateUnknown ... + BgpPeerStateUnknown BgpPeerState = "Unknown" +) + +// PossibleBgpPeerStateValues returns an array of possible values for the BgpPeerState const type. +func PossibleBgpPeerStateValues() []BgpPeerState { + return []BgpPeerState{BgpPeerStateConnected, BgpPeerStateConnecting, BgpPeerStateIdle, BgpPeerStateStopped, BgpPeerStateUnknown} +} + +// CircuitConnectionStatus enumerates the values for circuit connection status. +type CircuitConnectionStatus string + +const ( + // Connected ... + Connected CircuitConnectionStatus = "Connected" + // Connecting ... + Connecting CircuitConnectionStatus = "Connecting" + // Disconnected ... + Disconnected CircuitConnectionStatus = "Disconnected" +) + +// PossibleCircuitConnectionStatusValues returns an array of possible values for the CircuitConnectionStatus const type. +func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { + return []CircuitConnectionStatus{Connected, Connecting, Disconnected} +} + +// ConnectionMonitorSourceStatus enumerates the values for connection monitor source status. +type ConnectionMonitorSourceStatus string + +const ( + // ConnectionMonitorSourceStatusActive ... + ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" + // ConnectionMonitorSourceStatusInactive ... + ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" + // ConnectionMonitorSourceStatusUnknown ... + ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" +) + +// PossibleConnectionMonitorSourceStatusValues returns an array of possible values for the ConnectionMonitorSourceStatus const type. +func PossibleConnectionMonitorSourceStatusValues() []ConnectionMonitorSourceStatus { + return []ConnectionMonitorSourceStatus{ConnectionMonitorSourceStatusActive, ConnectionMonitorSourceStatusInactive, ConnectionMonitorSourceStatusUnknown} +} + +// ConnectionState enumerates the values for connection state. +type ConnectionState string + +const ( + // ConnectionStateReachable ... + ConnectionStateReachable ConnectionState = "Reachable" + // ConnectionStateUnknown ... + ConnectionStateUnknown ConnectionState = "Unknown" + // ConnectionStateUnreachable ... + ConnectionStateUnreachable ConnectionState = "Unreachable" +) + +// PossibleConnectionStateValues returns an array of possible values for the ConnectionState const type. +func PossibleConnectionStateValues() []ConnectionState { + return []ConnectionState{ConnectionStateReachable, ConnectionStateUnknown, ConnectionStateUnreachable} +} + +// ConnectionStatus enumerates the values for connection status. +type ConnectionStatus string + +const ( + // ConnectionStatusConnected ... + ConnectionStatusConnected ConnectionStatus = "Connected" + // ConnectionStatusDegraded ... + ConnectionStatusDegraded ConnectionStatus = "Degraded" + // ConnectionStatusDisconnected ... + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + // ConnectionStatusUnknown ... + ConnectionStatusUnknown ConnectionStatus = "Unknown" +) + +// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. +func PossibleConnectionStatusValues() []ConnectionStatus { + return []ConnectionStatus{ConnectionStatusConnected, ConnectionStatusDegraded, ConnectionStatusDisconnected, ConnectionStatusUnknown} +} + +// DdosCustomPolicyProtocol enumerates the values for ddos custom policy protocol. +type DdosCustomPolicyProtocol string + +const ( + // DdosCustomPolicyProtocolSyn ... + DdosCustomPolicyProtocolSyn DdosCustomPolicyProtocol = "Syn" + // DdosCustomPolicyProtocolTCP ... + DdosCustomPolicyProtocolTCP DdosCustomPolicyProtocol = "Tcp" + // DdosCustomPolicyProtocolUDP ... + DdosCustomPolicyProtocolUDP DdosCustomPolicyProtocol = "Udp" +) + +// PossibleDdosCustomPolicyProtocolValues returns an array of possible values for the DdosCustomPolicyProtocol const type. +func PossibleDdosCustomPolicyProtocolValues() []DdosCustomPolicyProtocol { + return []DdosCustomPolicyProtocol{DdosCustomPolicyProtocolSyn, DdosCustomPolicyProtocolTCP, DdosCustomPolicyProtocolUDP} +} + +// DdosCustomPolicyTriggerSensitivityOverride enumerates the values for ddos custom policy trigger sensitivity +// override. +type DdosCustomPolicyTriggerSensitivityOverride string + +const ( + // Default ... + Default DdosCustomPolicyTriggerSensitivityOverride = "Default" + // High ... + High DdosCustomPolicyTriggerSensitivityOverride = "High" + // Low ... + Low DdosCustomPolicyTriggerSensitivityOverride = "Low" + // Relaxed ... + Relaxed DdosCustomPolicyTriggerSensitivityOverride = "Relaxed" +) + +// PossibleDdosCustomPolicyTriggerSensitivityOverrideValues returns an array of possible values for the DdosCustomPolicyTriggerSensitivityOverride const type. +func PossibleDdosCustomPolicyTriggerSensitivityOverrideValues() []DdosCustomPolicyTriggerSensitivityOverride { + return []DdosCustomPolicyTriggerSensitivityOverride{Default, High, Low, Relaxed} +} + +// DdosSettingsProtectionCoverage enumerates the values for ddos settings protection coverage. +type DdosSettingsProtectionCoverage string + +const ( + // DdosSettingsProtectionCoverageBasic ... + DdosSettingsProtectionCoverageBasic DdosSettingsProtectionCoverage = "Basic" + // DdosSettingsProtectionCoverageStandard ... + DdosSettingsProtectionCoverageStandard DdosSettingsProtectionCoverage = "Standard" +) + +// PossibleDdosSettingsProtectionCoverageValues returns an array of possible values for the DdosSettingsProtectionCoverage const type. +func PossibleDdosSettingsProtectionCoverageValues() []DdosSettingsProtectionCoverage { + return []DdosSettingsProtectionCoverage{DdosSettingsProtectionCoverageBasic, DdosSettingsProtectionCoverageStandard} +} + +// DhGroup enumerates the values for dh group. +type DhGroup string + +const ( + // DHGroup1 ... + DHGroup1 DhGroup = "DHGroup1" + // DHGroup14 ... + DHGroup14 DhGroup = "DHGroup14" + // DHGroup2 ... + DHGroup2 DhGroup = "DHGroup2" + // DHGroup2048 ... + DHGroup2048 DhGroup = "DHGroup2048" + // DHGroup24 ... + DHGroup24 DhGroup = "DHGroup24" + // ECP256 ... + ECP256 DhGroup = "ECP256" + // ECP384 ... + ECP384 DhGroup = "ECP384" + // None ... + None DhGroup = "None" +) + +// PossibleDhGroupValues returns an array of possible values for the DhGroup const type. +func PossibleDhGroupValues() []DhGroup { + return []DhGroup{DHGroup1, DHGroup14, DHGroup2, DHGroup2048, DHGroup24, ECP256, ECP384, None} +} + +// Direction enumerates the values for direction. +type Direction string + +const ( + // Inbound ... + Inbound Direction = "Inbound" + // Outbound ... + Outbound Direction = "Outbound" +) + +// PossibleDirectionValues returns an array of possible values for the Direction const type. +func PossibleDirectionValues() []Direction { + return []Direction{Inbound, Outbound} +} + +// EffectiveRouteSource enumerates the values for effective route source. +type EffectiveRouteSource string + +const ( + // EffectiveRouteSourceDefault ... + EffectiveRouteSourceDefault EffectiveRouteSource = "Default" + // EffectiveRouteSourceUnknown ... + EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" + // EffectiveRouteSourceUser ... + EffectiveRouteSourceUser EffectiveRouteSource = "User" + // EffectiveRouteSourceVirtualNetworkGateway ... + EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" +) + +// PossibleEffectiveRouteSourceValues returns an array of possible values for the EffectiveRouteSource const type. +func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { + return []EffectiveRouteSource{EffectiveRouteSourceDefault, EffectiveRouteSourceUnknown, EffectiveRouteSourceUser, EffectiveRouteSourceVirtualNetworkGateway} +} + +// EffectiveRouteState enumerates the values for effective route state. +type EffectiveRouteState string + +const ( + // Active ... + Active EffectiveRouteState = "Active" + // Invalid ... + Invalid EffectiveRouteState = "Invalid" +) + +// PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. +func PossibleEffectiveRouteStateValues() []EffectiveRouteState { + return []EffectiveRouteState{Active, Invalid} +} + +// EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. +type EffectiveSecurityRuleProtocol string + +const ( + // EffectiveSecurityRuleProtocolAll ... + EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" + // EffectiveSecurityRuleProtocolTCP ... + EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" + // EffectiveSecurityRuleProtocolUDP ... + EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" +) + +// PossibleEffectiveSecurityRuleProtocolValues returns an array of possible values for the EffectiveSecurityRuleProtocol const type. +func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { + return []EffectiveSecurityRuleProtocol{EffectiveSecurityRuleProtocolAll, EffectiveSecurityRuleProtocolTCP, EffectiveSecurityRuleProtocolUDP} +} + +// EvaluationState enumerates the values for evaluation state. +type EvaluationState string + +const ( + // Completed ... + Completed EvaluationState = "Completed" + // InProgress ... + InProgress EvaluationState = "InProgress" + // NotStarted ... + NotStarted EvaluationState = "NotStarted" +) + +// PossibleEvaluationStateValues returns an array of possible values for the EvaluationState const type. +func PossibleEvaluationStateValues() []EvaluationState { + return []EvaluationState{Completed, InProgress, NotStarted} +} + +// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit +// peering advertised public prefix state. +type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string + +const ( + // Configured ... + Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" + // Configuring ... + Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" + // NotConfigured ... + NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" + // ValidationNeeded ... + ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" +) + +// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. +func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { + return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} +} + +// ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. +type ExpressRouteCircuitPeeringState string + +const ( + // ExpressRouteCircuitPeeringStateDisabled ... + ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" + // ExpressRouteCircuitPeeringStateEnabled ... + ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" +) + +// PossibleExpressRouteCircuitPeeringStateValues returns an array of possible values for the ExpressRouteCircuitPeeringState const type. +func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { + return []ExpressRouteCircuitPeeringState{ExpressRouteCircuitPeeringStateDisabled, ExpressRouteCircuitPeeringStateEnabled} +} + +// ExpressRouteCircuitSkuFamily enumerates the values for express route circuit sku family. +type ExpressRouteCircuitSkuFamily string + +const ( + // MeteredData ... + MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" + // UnlimitedData ... + UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" +) + +// PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. +func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { + return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} +} + +// ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. +type ExpressRouteCircuitSkuTier string + +const ( + // ExpressRouteCircuitSkuTierBasic ... + ExpressRouteCircuitSkuTierBasic ExpressRouteCircuitSkuTier = "Basic" + // ExpressRouteCircuitSkuTierLocal ... + ExpressRouteCircuitSkuTierLocal ExpressRouteCircuitSkuTier = "Local" + // ExpressRouteCircuitSkuTierPremium ... + ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" + // ExpressRouteCircuitSkuTierStandard ... + ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" +) + +// PossibleExpressRouteCircuitSkuTierValues returns an array of possible values for the ExpressRouteCircuitSkuTier const type. +func PossibleExpressRouteCircuitSkuTierValues() []ExpressRouteCircuitSkuTier { + return []ExpressRouteCircuitSkuTier{ExpressRouteCircuitSkuTierBasic, ExpressRouteCircuitSkuTierLocal, ExpressRouteCircuitSkuTierPremium, ExpressRouteCircuitSkuTierStandard} +} + +// ExpressRouteLinkAdminState enumerates the values for express route link admin state. +type ExpressRouteLinkAdminState string + +const ( + // ExpressRouteLinkAdminStateDisabled ... + ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" + // ExpressRouteLinkAdminStateEnabled ... + ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" +) + +// PossibleExpressRouteLinkAdminStateValues returns an array of possible values for the ExpressRouteLinkAdminState const type. +func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { + return []ExpressRouteLinkAdminState{ExpressRouteLinkAdminStateDisabled, ExpressRouteLinkAdminStateEnabled} +} + +// ExpressRouteLinkConnectorType enumerates the values for express route link connector type. +type ExpressRouteLinkConnectorType string + +const ( + // LC ... + LC ExpressRouteLinkConnectorType = "LC" + // SC ... + SC ExpressRouteLinkConnectorType = "SC" +) + +// PossibleExpressRouteLinkConnectorTypeValues returns an array of possible values for the ExpressRouteLinkConnectorType const type. +func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { + return []ExpressRouteLinkConnectorType{LC, SC} +} + +// ExpressRoutePeeringState enumerates the values for express route peering state. +type ExpressRoutePeeringState string + +const ( + // ExpressRoutePeeringStateDisabled ... + ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" + // ExpressRoutePeeringStateEnabled ... + ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" +) + +// PossibleExpressRoutePeeringStateValues returns an array of possible values for the ExpressRoutePeeringState const type. +func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { + return []ExpressRoutePeeringState{ExpressRoutePeeringStateDisabled, ExpressRoutePeeringStateEnabled} +} + +// ExpressRoutePeeringType enumerates the values for express route peering type. +type ExpressRoutePeeringType string + +const ( + // AzurePrivatePeering ... + AzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" + // AzurePublicPeering ... + AzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" + // MicrosoftPeering ... + MicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" +) + +// PossibleExpressRoutePeeringTypeValues returns an array of possible values for the ExpressRoutePeeringType const type. +func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { + return []ExpressRoutePeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} +} + +// ExpressRoutePortsEncapsulation enumerates the values for express route ports encapsulation. +type ExpressRoutePortsEncapsulation string + +const ( + // Dot1Q ... + Dot1Q ExpressRoutePortsEncapsulation = "Dot1Q" + // QinQ ... + QinQ ExpressRoutePortsEncapsulation = "QinQ" +) + +// PossibleExpressRoutePortsEncapsulationValues returns an array of possible values for the ExpressRoutePortsEncapsulation const type. +func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { + return []ExpressRoutePortsEncapsulation{Dot1Q, QinQ} +} + +// FirewallPolicyFilterRuleActionType enumerates the values for firewall policy filter rule action type. +type FirewallPolicyFilterRuleActionType string + +const ( + // FirewallPolicyFilterRuleActionTypeAlert ... + FirewallPolicyFilterRuleActionTypeAlert FirewallPolicyFilterRuleActionType = "Alert " + // FirewallPolicyFilterRuleActionTypeAllow ... + FirewallPolicyFilterRuleActionTypeAllow FirewallPolicyFilterRuleActionType = "Allow" + // FirewallPolicyFilterRuleActionTypeDeny ... + FirewallPolicyFilterRuleActionTypeDeny FirewallPolicyFilterRuleActionType = "Deny" +) + +// PossibleFirewallPolicyFilterRuleActionTypeValues returns an array of possible values for the FirewallPolicyFilterRuleActionType const type. +func PossibleFirewallPolicyFilterRuleActionTypeValues() []FirewallPolicyFilterRuleActionType { + return []FirewallPolicyFilterRuleActionType{FirewallPolicyFilterRuleActionTypeAlert, FirewallPolicyFilterRuleActionTypeAllow, FirewallPolicyFilterRuleActionTypeDeny} +} + +// FirewallPolicyNatRuleActionType enumerates the values for firewall policy nat rule action type. +type FirewallPolicyNatRuleActionType string + +const ( + // DNAT ... + DNAT FirewallPolicyNatRuleActionType = "DNAT" + // SNAT ... + SNAT FirewallPolicyNatRuleActionType = "SNAT" +) + +// PossibleFirewallPolicyNatRuleActionTypeValues returns an array of possible values for the FirewallPolicyNatRuleActionType const type. +func PossibleFirewallPolicyNatRuleActionTypeValues() []FirewallPolicyNatRuleActionType { + return []FirewallPolicyNatRuleActionType{DNAT, SNAT} +} + +// FirewallPolicyRuleConditionApplicationProtocolType enumerates the values for firewall policy rule condition +// application protocol type. +type FirewallPolicyRuleConditionApplicationProtocolType string + +const ( + // FirewallPolicyRuleConditionApplicationProtocolTypeHTTP ... + FirewallPolicyRuleConditionApplicationProtocolTypeHTTP FirewallPolicyRuleConditionApplicationProtocolType = "Http" + // FirewallPolicyRuleConditionApplicationProtocolTypeHTTPS ... + FirewallPolicyRuleConditionApplicationProtocolTypeHTTPS FirewallPolicyRuleConditionApplicationProtocolType = "Https" +) + +// PossibleFirewallPolicyRuleConditionApplicationProtocolTypeValues returns an array of possible values for the FirewallPolicyRuleConditionApplicationProtocolType const type. +func PossibleFirewallPolicyRuleConditionApplicationProtocolTypeValues() []FirewallPolicyRuleConditionApplicationProtocolType { + return []FirewallPolicyRuleConditionApplicationProtocolType{FirewallPolicyRuleConditionApplicationProtocolTypeHTTP, FirewallPolicyRuleConditionApplicationProtocolTypeHTTPS} +} + +// FirewallPolicyRuleConditionNetworkProtocol enumerates the values for firewall policy rule condition network +// protocol. +type FirewallPolicyRuleConditionNetworkProtocol string + +const ( + // FirewallPolicyRuleConditionNetworkProtocolAny ... + FirewallPolicyRuleConditionNetworkProtocolAny FirewallPolicyRuleConditionNetworkProtocol = "Any" + // FirewallPolicyRuleConditionNetworkProtocolICMP ... + FirewallPolicyRuleConditionNetworkProtocolICMP FirewallPolicyRuleConditionNetworkProtocol = "ICMP" + // FirewallPolicyRuleConditionNetworkProtocolTCP ... + FirewallPolicyRuleConditionNetworkProtocolTCP FirewallPolicyRuleConditionNetworkProtocol = "TCP" + // FirewallPolicyRuleConditionNetworkProtocolUDP ... + FirewallPolicyRuleConditionNetworkProtocolUDP FirewallPolicyRuleConditionNetworkProtocol = "UDP" +) + +// PossibleFirewallPolicyRuleConditionNetworkProtocolValues returns an array of possible values for the FirewallPolicyRuleConditionNetworkProtocol const type. +func PossibleFirewallPolicyRuleConditionNetworkProtocolValues() []FirewallPolicyRuleConditionNetworkProtocol { + return []FirewallPolicyRuleConditionNetworkProtocol{FirewallPolicyRuleConditionNetworkProtocolAny, FirewallPolicyRuleConditionNetworkProtocolICMP, FirewallPolicyRuleConditionNetworkProtocolTCP, FirewallPolicyRuleConditionNetworkProtocolUDP} +} + +// FlowLogFormatType enumerates the values for flow log format type. +type FlowLogFormatType string + +const ( + // JSON ... + JSON FlowLogFormatType = "JSON" +) + +// PossibleFlowLogFormatTypeValues returns an array of possible values for the FlowLogFormatType const type. +func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { + return []FlowLogFormatType{JSON} +} + +// HTTPMethod enumerates the values for http method. +type HTTPMethod string + +const ( + // Get ... + Get HTTPMethod = "Get" +) + +// PossibleHTTPMethodValues returns an array of possible values for the HTTPMethod const type. +func PossibleHTTPMethodValues() []HTTPMethod { + return []HTTPMethod{Get} +} + +// HubVirtualNetworkConnectionStatus enumerates the values for hub virtual network connection status. +type HubVirtualNetworkConnectionStatus string + +const ( + // HubVirtualNetworkConnectionStatusConnected ... + HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" + // HubVirtualNetworkConnectionStatusConnecting ... + HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" + // HubVirtualNetworkConnectionStatusNotConnected ... + HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" + // HubVirtualNetworkConnectionStatusUnknown ... + HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" +) + +// PossibleHubVirtualNetworkConnectionStatusValues returns an array of possible values for the HubVirtualNetworkConnectionStatus const type. +func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { + return []HubVirtualNetworkConnectionStatus{HubVirtualNetworkConnectionStatusConnected, HubVirtualNetworkConnectionStatusConnecting, HubVirtualNetworkConnectionStatusNotConnected, HubVirtualNetworkConnectionStatusUnknown} +} + +// IkeEncryption enumerates the values for ike encryption. +type IkeEncryption string + +const ( + // AES128 ... + AES128 IkeEncryption = "AES128" + // AES192 ... + AES192 IkeEncryption = "AES192" + // AES256 ... + AES256 IkeEncryption = "AES256" + // DES ... + DES IkeEncryption = "DES" + // DES3 ... + DES3 IkeEncryption = "DES3" + // GCMAES128 ... + GCMAES128 IkeEncryption = "GCMAES128" + // GCMAES256 ... + GCMAES256 IkeEncryption = "GCMAES256" +) + +// PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. +func PossibleIkeEncryptionValues() []IkeEncryption { + return []IkeEncryption{AES128, AES192, AES256, DES, DES3, GCMAES128, GCMAES256} +} + +// IkeIntegrity enumerates the values for ike integrity. +type IkeIntegrity string + +const ( + // IkeIntegrityGCMAES128 ... + IkeIntegrityGCMAES128 IkeIntegrity = "GCMAES128" + // IkeIntegrityGCMAES256 ... + IkeIntegrityGCMAES256 IkeIntegrity = "GCMAES256" + // IkeIntegrityMD5 ... + IkeIntegrityMD5 IkeIntegrity = "MD5" + // IkeIntegritySHA1 ... + IkeIntegritySHA1 IkeIntegrity = "SHA1" + // IkeIntegritySHA256 ... + IkeIntegritySHA256 IkeIntegrity = "SHA256" + // IkeIntegritySHA384 ... + IkeIntegritySHA384 IkeIntegrity = "SHA384" +) + +// PossibleIkeIntegrityValues returns an array of possible values for the IkeIntegrity const type. +func PossibleIkeIntegrityValues() []IkeIntegrity { + return []IkeIntegrity{IkeIntegrityGCMAES128, IkeIntegrityGCMAES256, IkeIntegrityMD5, IkeIntegritySHA1, IkeIntegritySHA256, IkeIntegritySHA384} +} + +// IPAllocationMethod enumerates the values for ip allocation method. +type IPAllocationMethod string + +const ( + // Dynamic ... + Dynamic IPAllocationMethod = "Dynamic" + // Static ... + Static IPAllocationMethod = "Static" +) + +// PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. +func PossibleIPAllocationMethodValues() []IPAllocationMethod { + return []IPAllocationMethod{Dynamic, Static} +} + +// IPFlowProtocol enumerates the values for ip flow protocol. +type IPFlowProtocol string + +const ( + // IPFlowProtocolTCP ... + IPFlowProtocolTCP IPFlowProtocol = "TCP" + // IPFlowProtocolUDP ... + IPFlowProtocolUDP IPFlowProtocol = "UDP" +) + +// PossibleIPFlowProtocolValues returns an array of possible values for the IPFlowProtocol const type. +func PossibleIPFlowProtocolValues() []IPFlowProtocol { + return []IPFlowProtocol{IPFlowProtocolTCP, IPFlowProtocolUDP} +} + +// IpsecEncryption enumerates the values for ipsec encryption. +type IpsecEncryption string + +const ( + // IpsecEncryptionAES128 ... + IpsecEncryptionAES128 IpsecEncryption = "AES128" + // IpsecEncryptionAES192 ... + IpsecEncryptionAES192 IpsecEncryption = "AES192" + // IpsecEncryptionAES256 ... + IpsecEncryptionAES256 IpsecEncryption = "AES256" + // IpsecEncryptionDES ... + IpsecEncryptionDES IpsecEncryption = "DES" + // IpsecEncryptionDES3 ... + IpsecEncryptionDES3 IpsecEncryption = "DES3" + // IpsecEncryptionGCMAES128 ... + IpsecEncryptionGCMAES128 IpsecEncryption = "GCMAES128" + // IpsecEncryptionGCMAES192 ... + IpsecEncryptionGCMAES192 IpsecEncryption = "GCMAES192" + // IpsecEncryptionGCMAES256 ... + IpsecEncryptionGCMAES256 IpsecEncryption = "GCMAES256" + // IpsecEncryptionNone ... + IpsecEncryptionNone IpsecEncryption = "None" +) + +// PossibleIpsecEncryptionValues returns an array of possible values for the IpsecEncryption const type. +func PossibleIpsecEncryptionValues() []IpsecEncryption { + return []IpsecEncryption{IpsecEncryptionAES128, IpsecEncryptionAES192, IpsecEncryptionAES256, IpsecEncryptionDES, IpsecEncryptionDES3, IpsecEncryptionGCMAES128, IpsecEncryptionGCMAES192, IpsecEncryptionGCMAES256, IpsecEncryptionNone} +} + +// IpsecIntegrity enumerates the values for ipsec integrity. +type IpsecIntegrity string + +const ( + // IpsecIntegrityGCMAES128 ... + IpsecIntegrityGCMAES128 IpsecIntegrity = "GCMAES128" + // IpsecIntegrityGCMAES192 ... + IpsecIntegrityGCMAES192 IpsecIntegrity = "GCMAES192" + // IpsecIntegrityGCMAES256 ... + IpsecIntegrityGCMAES256 IpsecIntegrity = "GCMAES256" + // IpsecIntegrityMD5 ... + IpsecIntegrityMD5 IpsecIntegrity = "MD5" + // IpsecIntegritySHA1 ... + IpsecIntegritySHA1 IpsecIntegrity = "SHA1" + // IpsecIntegritySHA256 ... + IpsecIntegritySHA256 IpsecIntegrity = "SHA256" +) + +// PossibleIpsecIntegrityValues returns an array of possible values for the IpsecIntegrity const type. +func PossibleIpsecIntegrityValues() []IpsecIntegrity { + return []IpsecIntegrity{IpsecIntegrityGCMAES128, IpsecIntegrityGCMAES192, IpsecIntegrityGCMAES256, IpsecIntegrityMD5, IpsecIntegritySHA1, IpsecIntegritySHA256} +} + +// IPVersion enumerates the values for ip version. +type IPVersion string + +const ( + // IPv4 ... + IPv4 IPVersion = "IPv4" + // IPv6 ... + IPv6 IPVersion = "IPv6" +) + +// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. +func PossibleIPVersionValues() []IPVersion { + return []IPVersion{IPv4, IPv6} +} + +// IssueType enumerates the values for issue type. +type IssueType string + +const ( + // IssueTypeAgentStopped ... + IssueTypeAgentStopped IssueType = "AgentStopped" + // IssueTypeDNSResolution ... + IssueTypeDNSResolution IssueType = "DnsResolution" + // IssueTypeGuestFirewall ... + IssueTypeGuestFirewall IssueType = "GuestFirewall" + // IssueTypeNetworkSecurityRule ... + IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" + // IssueTypePlatform ... + IssueTypePlatform IssueType = "Platform" + // IssueTypePortThrottled ... + IssueTypePortThrottled IssueType = "PortThrottled" + // IssueTypeSocketBind ... + IssueTypeSocketBind IssueType = "SocketBind" + // IssueTypeUnknown ... + IssueTypeUnknown IssueType = "Unknown" + // IssueTypeUserDefinedRoute ... + IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" +) + +// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. +func PossibleIssueTypeValues() []IssueType { + return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} +} + +// LoadBalancerOutboundRuleProtocol enumerates the values for load balancer outbound rule protocol. +type LoadBalancerOutboundRuleProtocol string + +const ( + // LoadBalancerOutboundRuleProtocolAll ... + LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" + // LoadBalancerOutboundRuleProtocolTCP ... + LoadBalancerOutboundRuleProtocolTCP LoadBalancerOutboundRuleProtocol = "Tcp" + // LoadBalancerOutboundRuleProtocolUDP ... + LoadBalancerOutboundRuleProtocolUDP LoadBalancerOutboundRuleProtocol = "Udp" +) + +// PossibleLoadBalancerOutboundRuleProtocolValues returns an array of possible values for the LoadBalancerOutboundRuleProtocol const type. +func PossibleLoadBalancerOutboundRuleProtocolValues() []LoadBalancerOutboundRuleProtocol { + return []LoadBalancerOutboundRuleProtocol{LoadBalancerOutboundRuleProtocolAll, LoadBalancerOutboundRuleProtocolTCP, LoadBalancerOutboundRuleProtocolUDP} +} + +// LoadBalancerSkuName enumerates the values for load balancer sku name. +type LoadBalancerSkuName string + +const ( + // LoadBalancerSkuNameBasic ... + LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" + // LoadBalancerSkuNameStandard ... + LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" +) + +// PossibleLoadBalancerSkuNameValues returns an array of possible values for the LoadBalancerSkuName const type. +func PossibleLoadBalancerSkuNameValues() []LoadBalancerSkuName { + return []LoadBalancerSkuName{LoadBalancerSkuNameBasic, LoadBalancerSkuNameStandard} +} + +// LoadDistribution enumerates the values for load distribution. +type LoadDistribution string + +const ( + // LoadDistributionDefault ... + LoadDistributionDefault LoadDistribution = "Default" + // LoadDistributionSourceIP ... + LoadDistributionSourceIP LoadDistribution = "SourceIP" + // LoadDistributionSourceIPProtocol ... + LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" +) + +// PossibleLoadDistributionValues returns an array of possible values for the LoadDistribution const type. +func PossibleLoadDistributionValues() []LoadDistribution { + return []LoadDistribution{LoadDistributionDefault, LoadDistributionSourceIP, LoadDistributionSourceIPProtocol} +} + +// NatGatewaySkuName enumerates the values for nat gateway sku name. +type NatGatewaySkuName string + +const ( + // Standard ... + Standard NatGatewaySkuName = "Standard" +) + +// PossibleNatGatewaySkuNameValues returns an array of possible values for the NatGatewaySkuName const type. +func PossibleNatGatewaySkuNameValues() []NatGatewaySkuName { + return []NatGatewaySkuName{Standard} +} + +// NextHopType enumerates the values for next hop type. +type NextHopType string + +const ( + // NextHopTypeHyperNetGateway ... + NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" + // NextHopTypeInternet ... + NextHopTypeInternet NextHopType = "Internet" + // NextHopTypeNone ... + NextHopTypeNone NextHopType = "None" + // NextHopTypeVirtualAppliance ... + NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" + // NextHopTypeVirtualNetworkGateway ... + NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" + // NextHopTypeVnetLocal ... + NextHopTypeVnetLocal NextHopType = "VnetLocal" +) + +// PossibleNextHopTypeValues returns an array of possible values for the NextHopType const type. +func PossibleNextHopTypeValues() []NextHopType { + return []NextHopType{NextHopTypeHyperNetGateway, NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal} +} + +// OfficeTrafficCategory enumerates the values for office traffic category. +type OfficeTrafficCategory string + +const ( + // OfficeTrafficCategoryAll ... + OfficeTrafficCategoryAll OfficeTrafficCategory = "All" + // OfficeTrafficCategoryNone ... + OfficeTrafficCategoryNone OfficeTrafficCategory = "None" + // OfficeTrafficCategoryOptimize ... + OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" + // OfficeTrafficCategoryOptimizeAndAllow ... + OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" +) + +// PossibleOfficeTrafficCategoryValues returns an array of possible values for the OfficeTrafficCategory const type. +func PossibleOfficeTrafficCategoryValues() []OfficeTrafficCategory { + return []OfficeTrafficCategory{OfficeTrafficCategoryAll, OfficeTrafficCategoryNone, OfficeTrafficCategoryOptimize, OfficeTrafficCategoryOptimizeAndAllow} +} + +// OperationStatus enumerates the values for operation status. +type OperationStatus string + +const ( + // OperationStatusFailed ... + OperationStatusFailed OperationStatus = "Failed" + // OperationStatusInProgress ... + OperationStatusInProgress OperationStatus = "InProgress" + // OperationStatusSucceeded ... + OperationStatusSucceeded OperationStatus = "Succeeded" +) + +// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} +} + +// Origin enumerates the values for origin. +type Origin string + +const ( + // OriginInbound ... + OriginInbound Origin = "Inbound" + // OriginLocal ... + OriginLocal Origin = "Local" + // OriginOutbound ... + OriginOutbound Origin = "Outbound" +) + +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{OriginInbound, OriginLocal, OriginOutbound} +} + +// PcError enumerates the values for pc error. +type PcError string + +const ( + // AgentStopped ... + AgentStopped PcError = "AgentStopped" + // CaptureFailed ... + CaptureFailed PcError = "CaptureFailed" + // InternalError ... + InternalError PcError = "InternalError" + // LocalFileFailed ... + LocalFileFailed PcError = "LocalFileFailed" + // StorageFailed ... + StorageFailed PcError = "StorageFailed" +) + +// PossiblePcErrorValues returns an array of possible values for the PcError const type. +func PossiblePcErrorValues() []PcError { + return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} +} + +// PcProtocol enumerates the values for pc protocol. +type PcProtocol string + +const ( + // PcProtocolAny ... + PcProtocolAny PcProtocol = "Any" + // PcProtocolTCP ... + PcProtocolTCP PcProtocol = "TCP" + // PcProtocolUDP ... + PcProtocolUDP PcProtocol = "UDP" +) + +// PossiblePcProtocolValues returns an array of possible values for the PcProtocol const type. +func PossiblePcProtocolValues() []PcProtocol { + return []PcProtocol{PcProtocolAny, PcProtocolTCP, PcProtocolUDP} +} + +// PcStatus enumerates the values for pc status. +type PcStatus string + +const ( + // PcStatusError ... + PcStatusError PcStatus = "Error" + // PcStatusNotStarted ... + PcStatusNotStarted PcStatus = "NotStarted" + // PcStatusRunning ... + PcStatusRunning PcStatus = "Running" + // PcStatusStopped ... + PcStatusStopped PcStatus = "Stopped" + // PcStatusUnknown ... + PcStatusUnknown PcStatus = "Unknown" +) + +// PossiblePcStatusValues returns an array of possible values for the PcStatus const type. +func PossiblePcStatusValues() []PcStatus { + return []PcStatus{PcStatusError, PcStatusNotStarted, PcStatusRunning, PcStatusStopped, PcStatusUnknown} +} + +// PfsGroup enumerates the values for pfs group. +type PfsGroup string + +const ( + // PfsGroupECP256 ... + PfsGroupECP256 PfsGroup = "ECP256" + // PfsGroupECP384 ... + PfsGroupECP384 PfsGroup = "ECP384" + // PfsGroupNone ... + PfsGroupNone PfsGroup = "None" + // PfsGroupPFS1 ... + PfsGroupPFS1 PfsGroup = "PFS1" + // PfsGroupPFS14 ... + PfsGroupPFS14 PfsGroup = "PFS14" + // PfsGroupPFS2 ... + PfsGroupPFS2 PfsGroup = "PFS2" + // PfsGroupPFS2048 ... + PfsGroupPFS2048 PfsGroup = "PFS2048" + // PfsGroupPFS24 ... + PfsGroupPFS24 PfsGroup = "PFS24" + // PfsGroupPFSMM ... + PfsGroupPFSMM PfsGroup = "PFSMM" +) + +// PossiblePfsGroupValues returns an array of possible values for the PfsGroup const type. +func PossiblePfsGroupValues() []PfsGroup { + return []PfsGroup{PfsGroupECP256, PfsGroupECP384, PfsGroupNone, PfsGroupPFS1, PfsGroupPFS14, PfsGroupPFS2, PfsGroupPFS2048, PfsGroupPFS24, PfsGroupPFSMM} +} + +// ProbeProtocol enumerates the values for probe protocol. +type ProbeProtocol string + +const ( + // ProbeProtocolHTTP ... + ProbeProtocolHTTP ProbeProtocol = "Http" + // ProbeProtocolHTTPS ... + ProbeProtocolHTTPS ProbeProtocol = "Https" + // ProbeProtocolTCP ... + ProbeProtocolTCP ProbeProtocol = "Tcp" +) + +// PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. +func PossibleProbeProtocolValues() []ProbeProtocol { + return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolTCP} +} + +// ProcessorArchitecture enumerates the values for processor architecture. +type ProcessorArchitecture string + +const ( + // Amd64 ... + Amd64 ProcessorArchitecture = "Amd64" + // X86 ... + X86 ProcessorArchitecture = "X86" +) + +// PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. +func PossibleProcessorArchitectureValues() []ProcessorArchitecture { + return []ProcessorArchitecture{Amd64, X86} +} + +// Protocol enumerates the values for protocol. +type Protocol string + +const ( + // ProtocolHTTP ... + ProtocolHTTP Protocol = "Http" + // ProtocolHTTPS ... + ProtocolHTTPS Protocol = "Https" + // ProtocolIcmp ... + ProtocolIcmp Protocol = "Icmp" + // ProtocolTCP ... + ProtocolTCP Protocol = "Tcp" +) + +// PossibleProtocolValues returns an array of possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolIcmp, ProtocolTCP} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Deleting, Failed, Succeeded, Updating} +} + +// PublicIPAddressSkuName enumerates the values for public ip address sku name. +type PublicIPAddressSkuName string + +const ( + // PublicIPAddressSkuNameBasic ... + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + // PublicIPAddressSkuNameStandard ... + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. +func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { + return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} +} + +// PublicIPPrefixSkuName enumerates the values for public ip prefix sku name. +type PublicIPPrefixSkuName string + +const ( + // PublicIPPrefixSkuNameStandard ... + PublicIPPrefixSkuNameStandard PublicIPPrefixSkuName = "Standard" +) + +// PossiblePublicIPPrefixSkuNameValues returns an array of possible values for the PublicIPPrefixSkuName const type. +func PossiblePublicIPPrefixSkuNameValues() []PublicIPPrefixSkuName { + return []PublicIPPrefixSkuName{PublicIPPrefixSkuNameStandard} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// RouteNextHopType enumerates the values for route next hop type. +type RouteNextHopType string + +const ( + // RouteNextHopTypeInternet ... + RouteNextHopTypeInternet RouteNextHopType = "Internet" + // RouteNextHopTypeNone ... + RouteNextHopTypeNone RouteNextHopType = "None" + // RouteNextHopTypeVirtualAppliance ... + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + // RouteNextHopTypeVirtualNetworkGateway ... + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + // RouteNextHopTypeVnetLocal ... + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +// PossibleRouteNextHopTypeValues returns an array of possible values for the RouteNextHopType const type. +func PossibleRouteNextHopTypeValues() []RouteNextHopType { + return []RouteNextHopType{RouteNextHopTypeInternet, RouteNextHopTypeNone, RouteNextHopTypeVirtualAppliance, RouteNextHopTypeVirtualNetworkGateway, RouteNextHopTypeVnetLocal} +} + +// RuleConditionType enumerates the values for rule condition type. +type RuleConditionType string + +const ( + // RuleConditionTypeApplicationRuleCondition ... + RuleConditionTypeApplicationRuleCondition RuleConditionType = "ApplicationRuleCondition" + // RuleConditionTypeFirewallPolicyRuleCondition ... + RuleConditionTypeFirewallPolicyRuleCondition RuleConditionType = "FirewallPolicyRuleCondition" + // RuleConditionTypeNetworkRuleCondition ... + RuleConditionTypeNetworkRuleCondition RuleConditionType = "NetworkRuleCondition" +) + +// PossibleRuleConditionTypeValues returns an array of possible values for the RuleConditionType const type. +func PossibleRuleConditionTypeValues() []RuleConditionType { + return []RuleConditionType{RuleConditionTypeApplicationRuleCondition, RuleConditionTypeFirewallPolicyRuleCondition, RuleConditionTypeNetworkRuleCondition} +} + +// RuleType enumerates the values for rule type. +type RuleType string + +const ( + // RuleTypeFirewallPolicyFilterRule ... + RuleTypeFirewallPolicyFilterRule RuleType = "FirewallPolicyFilterRule" + // RuleTypeFirewallPolicyNatRule ... + RuleTypeFirewallPolicyNatRule RuleType = "FirewallPolicyNatRule" + // RuleTypeFirewallPolicyRule ... + RuleTypeFirewallPolicyRule RuleType = "FirewallPolicyRule" +) + +// PossibleRuleTypeValues returns an array of possible values for the RuleType const type. +func PossibleRuleTypeValues() []RuleType { + return []RuleType{RuleTypeFirewallPolicyFilterRule, RuleTypeFirewallPolicyNatRule, RuleTypeFirewallPolicyRule} +} + +// SecurityRuleAccess enumerates the values for security rule access. +type SecurityRuleAccess string + +const ( + // SecurityRuleAccessAllow ... + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + // SecurityRuleAccessDeny ... + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +// PossibleSecurityRuleAccessValues returns an array of possible values for the SecurityRuleAccess const type. +func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { + return []SecurityRuleAccess{SecurityRuleAccessAllow, SecurityRuleAccessDeny} +} + +// SecurityRuleDirection enumerates the values for security rule direction. +type SecurityRuleDirection string + +const ( + // SecurityRuleDirectionInbound ... + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + // SecurityRuleDirectionOutbound ... + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +// PossibleSecurityRuleDirectionValues returns an array of possible values for the SecurityRuleDirection const type. +func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { + return []SecurityRuleDirection{SecurityRuleDirectionInbound, SecurityRuleDirectionOutbound} +} + +// SecurityRuleProtocol enumerates the values for security rule protocol. +type SecurityRuleProtocol string + +const ( + // SecurityRuleProtocolAsterisk ... + SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" + // SecurityRuleProtocolEsp ... + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + // SecurityRuleProtocolIcmp ... + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + // SecurityRuleProtocolTCP ... + SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" + // SecurityRuleProtocolUDP ... + SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" +) + +// PossibleSecurityRuleProtocolValues returns an array of possible values for the SecurityRuleProtocol const type. +func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { + return []SecurityRuleProtocol{SecurityRuleProtocolAsterisk, SecurityRuleProtocolEsp, SecurityRuleProtocolIcmp, SecurityRuleProtocolTCP, SecurityRuleProtocolUDP} +} + +// ServiceProviderProvisioningState enumerates the values for service provider provisioning state. +type ServiceProviderProvisioningState string + +const ( + // Deprovisioning ... + Deprovisioning ServiceProviderProvisioningState = "Deprovisioning" + // NotProvisioned ... + NotProvisioned ServiceProviderProvisioningState = "NotProvisioned" + // Provisioned ... + Provisioned ServiceProviderProvisioningState = "Provisioned" + // Provisioning ... + Provisioning ServiceProviderProvisioningState = "Provisioning" +) + +// PossibleServiceProviderProvisioningStateValues returns an array of possible values for the ServiceProviderProvisioningState const type. +func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { + return []ServiceProviderProvisioningState{Deprovisioning, NotProvisioned, Provisioned, Provisioning} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // SeverityError ... + SeverityError Severity = "Error" + // SeverityWarning ... + SeverityWarning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{SeverityError, SeverityWarning} +} + +// TransportProtocol enumerates the values for transport protocol. +type TransportProtocol string + +const ( + // TransportProtocolAll ... + TransportProtocolAll TransportProtocol = "All" + // TransportProtocolTCP ... + TransportProtocolTCP TransportProtocol = "Tcp" + // TransportProtocolUDP ... + TransportProtocolUDP TransportProtocol = "Udp" +) + +// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. +func PossibleTransportProtocolValues() []TransportProtocol { + return []TransportProtocol{TransportProtocolAll, TransportProtocolTCP, TransportProtocolUDP} +} + +// TunnelConnectionStatus enumerates the values for tunnel connection status. +type TunnelConnectionStatus string + +const ( + // TunnelConnectionStatusConnected ... + TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" + // TunnelConnectionStatusConnecting ... + TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" + // TunnelConnectionStatusNotConnected ... + TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" + // TunnelConnectionStatusUnknown ... + TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" +) + +// PossibleTunnelConnectionStatusValues returns an array of possible values for the TunnelConnectionStatus const type. +func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { + return []TunnelConnectionStatus{TunnelConnectionStatusConnected, TunnelConnectionStatusConnecting, TunnelConnectionStatusNotConnected, TunnelConnectionStatusUnknown} +} + +// VerbosityLevel enumerates the values for verbosity level. +type VerbosityLevel string + +const ( + // Full ... + Full VerbosityLevel = "Full" + // Minimum ... + Minimum VerbosityLevel = "Minimum" + // Normal ... + Normal VerbosityLevel = "Normal" +) + +// PossibleVerbosityLevelValues returns an array of possible values for the VerbosityLevel const type. +func PossibleVerbosityLevelValues() []VerbosityLevel { + return []VerbosityLevel{Full, Minimum, Normal} +} + +// VirtualNetworkGatewayConnectionProtocol enumerates the values for virtual network gateway connection +// protocol. +type VirtualNetworkGatewayConnectionProtocol string + +const ( + // IKEv1 ... + IKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" + // IKEv2 ... + IKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" +) + +// PossibleVirtualNetworkGatewayConnectionProtocolValues returns an array of possible values for the VirtualNetworkGatewayConnectionProtocol const type. +func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { + return []VirtualNetworkGatewayConnectionProtocol{IKEv1, IKEv2} +} + +// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. +type VirtualNetworkGatewayConnectionStatus string + +const ( + // VirtualNetworkGatewayConnectionStatusConnected ... + VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" + // VirtualNetworkGatewayConnectionStatusConnecting ... + VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" + // VirtualNetworkGatewayConnectionStatusNotConnected ... + VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" + // VirtualNetworkGatewayConnectionStatusUnknown ... + VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" +) + +// PossibleVirtualNetworkGatewayConnectionStatusValues returns an array of possible values for the VirtualNetworkGatewayConnectionStatus const type. +func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { + return []VirtualNetworkGatewayConnectionStatus{VirtualNetworkGatewayConnectionStatusConnected, VirtualNetworkGatewayConnectionStatusConnecting, VirtualNetworkGatewayConnectionStatusNotConnected, VirtualNetworkGatewayConnectionStatusUnknown} +} + +// VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type. +type VirtualNetworkGatewayConnectionType string + +const ( + // ExpressRoute ... + ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" + // IPsec ... + IPsec VirtualNetworkGatewayConnectionType = "IPsec" + // Vnet2Vnet ... + Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" + // VPNClient ... + VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" +) + +// PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. +func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { + return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} +} + +// VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. +type VirtualNetworkGatewaySkuName string + +const ( + // VirtualNetworkGatewaySkuNameBasic ... + VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" + // VirtualNetworkGatewaySkuNameErGw1AZ ... + VirtualNetworkGatewaySkuNameErGw1AZ VirtualNetworkGatewaySkuName = "ErGw1AZ" + // VirtualNetworkGatewaySkuNameErGw2AZ ... + VirtualNetworkGatewaySkuNameErGw2AZ VirtualNetworkGatewaySkuName = "ErGw2AZ" + // VirtualNetworkGatewaySkuNameErGw3AZ ... + VirtualNetworkGatewaySkuNameErGw3AZ VirtualNetworkGatewaySkuName = "ErGw3AZ" + // VirtualNetworkGatewaySkuNameHighPerformance ... + VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" + // VirtualNetworkGatewaySkuNameStandard ... + VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" + // VirtualNetworkGatewaySkuNameUltraPerformance ... + VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" + // VirtualNetworkGatewaySkuNameVpnGw1 ... + VirtualNetworkGatewaySkuNameVpnGw1 VirtualNetworkGatewaySkuName = "VpnGw1" + // VirtualNetworkGatewaySkuNameVpnGw1AZ ... + VirtualNetworkGatewaySkuNameVpnGw1AZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" + // VirtualNetworkGatewaySkuNameVpnGw2 ... + VirtualNetworkGatewaySkuNameVpnGw2 VirtualNetworkGatewaySkuName = "VpnGw2" + // VirtualNetworkGatewaySkuNameVpnGw2AZ ... + VirtualNetworkGatewaySkuNameVpnGw2AZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" + // VirtualNetworkGatewaySkuNameVpnGw3 ... + VirtualNetworkGatewaySkuNameVpnGw3 VirtualNetworkGatewaySkuName = "VpnGw3" + // VirtualNetworkGatewaySkuNameVpnGw3AZ ... + VirtualNetworkGatewaySkuNameVpnGw3AZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" +) + +// PossibleVirtualNetworkGatewaySkuNameValues returns an array of possible values for the VirtualNetworkGatewaySkuName const type. +func PossibleVirtualNetworkGatewaySkuNameValues() []VirtualNetworkGatewaySkuName { + return []VirtualNetworkGatewaySkuName{VirtualNetworkGatewaySkuNameBasic, VirtualNetworkGatewaySkuNameErGw1AZ, VirtualNetworkGatewaySkuNameErGw2AZ, VirtualNetworkGatewaySkuNameErGw3AZ, VirtualNetworkGatewaySkuNameHighPerformance, VirtualNetworkGatewaySkuNameStandard, VirtualNetworkGatewaySkuNameUltraPerformance, VirtualNetworkGatewaySkuNameVpnGw1, VirtualNetworkGatewaySkuNameVpnGw1AZ, VirtualNetworkGatewaySkuNameVpnGw2, VirtualNetworkGatewaySkuNameVpnGw2AZ, VirtualNetworkGatewaySkuNameVpnGw3, VirtualNetworkGatewaySkuNameVpnGw3AZ} +} + +// VirtualNetworkGatewaySkuTier enumerates the values for virtual network gateway sku tier. +type VirtualNetworkGatewaySkuTier string + +const ( + // VirtualNetworkGatewaySkuTierBasic ... + VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" + // VirtualNetworkGatewaySkuTierErGw1AZ ... + VirtualNetworkGatewaySkuTierErGw1AZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" + // VirtualNetworkGatewaySkuTierErGw2AZ ... + VirtualNetworkGatewaySkuTierErGw2AZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" + // VirtualNetworkGatewaySkuTierErGw3AZ ... + VirtualNetworkGatewaySkuTierErGw3AZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" + // VirtualNetworkGatewaySkuTierHighPerformance ... + VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" + // VirtualNetworkGatewaySkuTierStandard ... + VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" + // VirtualNetworkGatewaySkuTierUltraPerformance ... + VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" + // VirtualNetworkGatewaySkuTierVpnGw1 ... + VirtualNetworkGatewaySkuTierVpnGw1 VirtualNetworkGatewaySkuTier = "VpnGw1" + // VirtualNetworkGatewaySkuTierVpnGw1AZ ... + VirtualNetworkGatewaySkuTierVpnGw1AZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" + // VirtualNetworkGatewaySkuTierVpnGw2 ... + VirtualNetworkGatewaySkuTierVpnGw2 VirtualNetworkGatewaySkuTier = "VpnGw2" + // VirtualNetworkGatewaySkuTierVpnGw2AZ ... + VirtualNetworkGatewaySkuTierVpnGw2AZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" + // VirtualNetworkGatewaySkuTierVpnGw3 ... + VirtualNetworkGatewaySkuTierVpnGw3 VirtualNetworkGatewaySkuTier = "VpnGw3" + // VirtualNetworkGatewaySkuTierVpnGw3AZ ... + VirtualNetworkGatewaySkuTierVpnGw3AZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" +) + +// PossibleVirtualNetworkGatewaySkuTierValues returns an array of possible values for the VirtualNetworkGatewaySkuTier const type. +func PossibleVirtualNetworkGatewaySkuTierValues() []VirtualNetworkGatewaySkuTier { + return []VirtualNetworkGatewaySkuTier{VirtualNetworkGatewaySkuTierBasic, VirtualNetworkGatewaySkuTierErGw1AZ, VirtualNetworkGatewaySkuTierErGw2AZ, VirtualNetworkGatewaySkuTierErGw3AZ, VirtualNetworkGatewaySkuTierHighPerformance, VirtualNetworkGatewaySkuTierStandard, VirtualNetworkGatewaySkuTierUltraPerformance, VirtualNetworkGatewaySkuTierVpnGw1, VirtualNetworkGatewaySkuTierVpnGw1AZ, VirtualNetworkGatewaySkuTierVpnGw2, VirtualNetworkGatewaySkuTierVpnGw2AZ, VirtualNetworkGatewaySkuTierVpnGw3, VirtualNetworkGatewaySkuTierVpnGw3AZ} +} + +// VirtualNetworkGatewayType enumerates the values for virtual network gateway type. +type VirtualNetworkGatewayType string + +const ( + // VirtualNetworkGatewayTypeExpressRoute ... + VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" + // VirtualNetworkGatewayTypeVpn ... + VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" +) + +// PossibleVirtualNetworkGatewayTypeValues returns an array of possible values for the VirtualNetworkGatewayType const type. +func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { + return []VirtualNetworkGatewayType{VirtualNetworkGatewayTypeExpressRoute, VirtualNetworkGatewayTypeVpn} +} + +// VirtualNetworkPeeringState enumerates the values for virtual network peering state. +type VirtualNetworkPeeringState string + +const ( + // VirtualNetworkPeeringStateConnected ... + VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" + // VirtualNetworkPeeringStateDisconnected ... + VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" + // VirtualNetworkPeeringStateInitiated ... + VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" +) + +// PossibleVirtualNetworkPeeringStateValues returns an array of possible values for the VirtualNetworkPeeringState const type. +func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { + return []VirtualNetworkPeeringState{VirtualNetworkPeeringStateConnected, VirtualNetworkPeeringStateDisconnected, VirtualNetworkPeeringStateInitiated} +} + +// VirtualWanSecurityProviderType enumerates the values for virtual wan security provider type. +type VirtualWanSecurityProviderType string + +const ( + // External ... + External VirtualWanSecurityProviderType = "External" + // Native ... + Native VirtualWanSecurityProviderType = "Native" +) + +// PossibleVirtualWanSecurityProviderTypeValues returns an array of possible values for the VirtualWanSecurityProviderType const type. +func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { + return []VirtualWanSecurityProviderType{External, Native} +} + +// VpnClientProtocol enumerates the values for vpn client protocol. +type VpnClientProtocol string + +const ( + // IkeV2 ... + IkeV2 VpnClientProtocol = "IkeV2" + // OpenVPN ... + OpenVPN VpnClientProtocol = "OpenVPN" + // SSTP ... + SSTP VpnClientProtocol = "SSTP" +) + +// PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. +func PossibleVpnClientProtocolValues() []VpnClientProtocol { + return []VpnClientProtocol{IkeV2, OpenVPN, SSTP} +} + +// VpnConnectionStatus enumerates the values for vpn connection status. +type VpnConnectionStatus string + +const ( + // VpnConnectionStatusConnected ... + VpnConnectionStatusConnected VpnConnectionStatus = "Connected" + // VpnConnectionStatusConnecting ... + VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" + // VpnConnectionStatusNotConnected ... + VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" + // VpnConnectionStatusUnknown ... + VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" +) + +// PossibleVpnConnectionStatusValues returns an array of possible values for the VpnConnectionStatus const type. +func PossibleVpnConnectionStatusValues() []VpnConnectionStatus { + return []VpnConnectionStatus{VpnConnectionStatusConnected, VpnConnectionStatusConnecting, VpnConnectionStatusNotConnected, VpnConnectionStatusUnknown} +} + +// VpnGatewayTunnelingProtocol enumerates the values for vpn gateway tunneling protocol. +type VpnGatewayTunnelingProtocol string + +const ( + // VpnGatewayTunnelingProtocolIkeV2 ... + VpnGatewayTunnelingProtocolIkeV2 VpnGatewayTunnelingProtocol = "IkeV2" + // VpnGatewayTunnelingProtocolOpenVPN ... + VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" +) + +// PossibleVpnGatewayTunnelingProtocolValues returns an array of possible values for the VpnGatewayTunnelingProtocol const type. +func PossibleVpnGatewayTunnelingProtocolValues() []VpnGatewayTunnelingProtocol { + return []VpnGatewayTunnelingProtocol{VpnGatewayTunnelingProtocolIkeV2, VpnGatewayTunnelingProtocolOpenVPN} +} + +// VpnType enumerates the values for vpn type. +type VpnType string + +const ( + // PolicyBased ... + PolicyBased VpnType = "PolicyBased" + // RouteBased ... + RouteBased VpnType = "RouteBased" +) + +// PossibleVpnTypeValues returns an array of possible values for the VpnType const type. +func PossibleVpnTypeValues() []VpnType { + return []VpnType{PolicyBased, RouteBased} +} + +// WebApplicationFirewallAction enumerates the values for web application firewall action. +type WebApplicationFirewallAction string + +const ( + // WebApplicationFirewallActionAllow ... + WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" + // WebApplicationFirewallActionBlock ... + WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" + // WebApplicationFirewallActionLog ... + WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" +) + +// PossibleWebApplicationFirewallActionValues returns an array of possible values for the WebApplicationFirewallAction const type. +func PossibleWebApplicationFirewallActionValues() []WebApplicationFirewallAction { + return []WebApplicationFirewallAction{WebApplicationFirewallActionAllow, WebApplicationFirewallActionBlock, WebApplicationFirewallActionLog} +} + +// WebApplicationFirewallEnabledState enumerates the values for web application firewall enabled state. +type WebApplicationFirewallEnabledState string + +const ( + // WebApplicationFirewallEnabledStateDisabled ... + WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" + // WebApplicationFirewallEnabledStateEnabled ... + WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" +) + +// PossibleWebApplicationFirewallEnabledStateValues returns an array of possible values for the WebApplicationFirewallEnabledState const type. +func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewallEnabledState { + return []WebApplicationFirewallEnabledState{WebApplicationFirewallEnabledStateDisabled, WebApplicationFirewallEnabledStateEnabled} +} + +// WebApplicationFirewallMatchVariable enumerates the values for web application firewall match variable. +type WebApplicationFirewallMatchVariable string + +const ( + // PostArgs ... + PostArgs WebApplicationFirewallMatchVariable = "PostArgs" + // QueryString ... + QueryString WebApplicationFirewallMatchVariable = "QueryString" + // RemoteAddr ... + RemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" + // RequestBody ... + RequestBody WebApplicationFirewallMatchVariable = "RequestBody" + // RequestCookies ... + RequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" + // RequestHeaders ... + RequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" + // RequestMethod ... + RequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" + // RequestURI ... + RequestURI WebApplicationFirewallMatchVariable = "RequestUri" +) + +// PossibleWebApplicationFirewallMatchVariableValues returns an array of possible values for the WebApplicationFirewallMatchVariable const type. +func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { + return []WebApplicationFirewallMatchVariable{PostArgs, QueryString, RemoteAddr, RequestBody, RequestCookies, RequestHeaders, RequestMethod, RequestURI} +} + +// WebApplicationFirewallMode enumerates the values for web application firewall mode. +type WebApplicationFirewallMode string + +const ( + // WebApplicationFirewallModeDetection ... + WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" + // WebApplicationFirewallModePrevention ... + WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" +) + +// PossibleWebApplicationFirewallModeValues returns an array of possible values for the WebApplicationFirewallMode const type. +func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { + return []WebApplicationFirewallMode{WebApplicationFirewallModeDetection, WebApplicationFirewallModePrevention} +} + +// WebApplicationFirewallOperator enumerates the values for web application firewall operator. +type WebApplicationFirewallOperator string + +const ( + // WebApplicationFirewallOperatorBeginsWith ... + WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" + // WebApplicationFirewallOperatorContains ... + WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" + // WebApplicationFirewallOperatorEndsWith ... + WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" + // WebApplicationFirewallOperatorEqual ... + WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" + // WebApplicationFirewallOperatorGreaterThan ... + WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" + // WebApplicationFirewallOperatorGreaterThanOrEqual ... + WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" + // WebApplicationFirewallOperatorIPMatch ... + WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" + // WebApplicationFirewallOperatorLessThan ... + WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" + // WebApplicationFirewallOperatorLessThanOrEqual ... + WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" + // WebApplicationFirewallOperatorRegex ... + WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" +) + +// PossibleWebApplicationFirewallOperatorValues returns an array of possible values for the WebApplicationFirewallOperator const type. +func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOperator { + return []WebApplicationFirewallOperator{WebApplicationFirewallOperatorBeginsWith, WebApplicationFirewallOperatorContains, WebApplicationFirewallOperatorEndsWith, WebApplicationFirewallOperatorEqual, WebApplicationFirewallOperatorGreaterThan, WebApplicationFirewallOperatorGreaterThanOrEqual, WebApplicationFirewallOperatorIPMatch, WebApplicationFirewallOperatorLessThan, WebApplicationFirewallOperatorLessThanOrEqual, WebApplicationFirewallOperatorRegex} +} + +// WebApplicationFirewallPolicyResourceState enumerates the values for web application firewall policy resource +// state. +type WebApplicationFirewallPolicyResourceState string + +const ( + // WebApplicationFirewallPolicyResourceStateCreating ... + WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" + // WebApplicationFirewallPolicyResourceStateDeleting ... + WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" + // WebApplicationFirewallPolicyResourceStateDisabled ... + WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" + // WebApplicationFirewallPolicyResourceStateDisabling ... + WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" + // WebApplicationFirewallPolicyResourceStateEnabled ... + WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" + // WebApplicationFirewallPolicyResourceStateEnabling ... + WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" +) + +// PossibleWebApplicationFirewallPolicyResourceStateValues returns an array of possible values for the WebApplicationFirewallPolicyResourceState const type. +func PossibleWebApplicationFirewallPolicyResourceStateValues() []WebApplicationFirewallPolicyResourceState { + return []WebApplicationFirewallPolicyResourceState{WebApplicationFirewallPolicyResourceStateCreating, WebApplicationFirewallPolicyResourceStateDeleting, WebApplicationFirewallPolicyResourceStateDisabled, WebApplicationFirewallPolicyResourceStateDisabling, WebApplicationFirewallPolicyResourceStateEnabled, WebApplicationFirewallPolicyResourceStateEnabling} +} + +// WebApplicationFirewallRuleType enumerates the values for web application firewall rule type. +type WebApplicationFirewallRuleType string + +const ( + // WebApplicationFirewallRuleTypeInvalid ... + WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" + // WebApplicationFirewallRuleTypeMatchRule ... + WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" +) + +// PossibleWebApplicationFirewallRuleTypeValues returns an array of possible values for the WebApplicationFirewallRuleType const type. +func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRuleType { + return []WebApplicationFirewallRuleType{WebApplicationFirewallRuleTypeInvalid, WebApplicationFirewallRuleTypeMatchRule} +} + +// WebApplicationFirewallTransform enumerates the values for web application firewall transform. +type WebApplicationFirewallTransform string + +const ( + // HTMLEntityDecode ... + HTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" + // Lowercase ... + Lowercase WebApplicationFirewallTransform = "Lowercase" + // RemoveNulls ... + RemoveNulls WebApplicationFirewallTransform = "RemoveNulls" + // Trim ... + Trim WebApplicationFirewallTransform = "Trim" + // URLDecode ... + URLDecode WebApplicationFirewallTransform = "UrlDecode" + // URLEncode ... + URLEncode WebApplicationFirewallTransform = "UrlEncode" +) + +// PossibleWebApplicationFirewallTransformValues returns an array of possible values for the WebApplicationFirewallTransform const type. +func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { + return []WebApplicationFirewallTransform{HTMLEntityDecode, Lowercase, RemoveNulls, Trim, URLDecode, URLEncode} +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitauthorizations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitauthorizations.go index 4777865f11de..ee8fcdbc54e8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitauthorizations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitauthorizations.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -55,8 +44,8 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -69,7 +58,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -110,7 +99,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateSender(req * if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -119,7 +111,6 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateSender(req * func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitAuthorization, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -137,8 +128,8 @@ func (client ExpressRouteCircuitAuthorizationsClient) Delete(ctx context.Context ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -151,7 +142,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) Delete(ctx context.Context result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Delete", nil, "Failure sending request") return } @@ -188,7 +179,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteSender(req *http.Req if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -197,7 +191,6 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteSender(req *http.Req func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -236,6 +229,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, r result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", resp, "Failure responding to request") + return } return @@ -274,7 +268,6 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetSender(req *http.Reques func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitAuthorization, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -314,6 +307,11 @@ func (client ExpressRouteCircuitAuthorizationsClient) List(ctx context.Context, result.alr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure responding to request") + return + } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -351,7 +349,6 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListSender(req *http.Reque func (client ExpressRouteCircuitAuthorizationsClient) ListResponder(resp *http.Response) (result AuthorizationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitconnections.go index 9ff6529f50c3..6aceab107c89 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitconnections.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -55,8 +44,8 @@ func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdate(ctx context.Co ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -69,7 +58,7 @@ func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdate(ctx context.Co result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -111,7 +100,10 @@ func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdateSender(req *htt if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -120,7 +112,6 @@ func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdateSender(req *htt func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -139,8 +130,8 @@ func (client ExpressRouteCircuitConnectionsClient) Delete(ctx context.Context, r ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -153,7 +144,7 @@ func (client ExpressRouteCircuitConnectionsClient) Delete(ctx context.Context, r result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Delete", nil, "Failure sending request") return } @@ -191,7 +182,10 @@ func (client ExpressRouteCircuitConnectionsClient) DeleteSender(req *http.Reques if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -200,7 +194,6 @@ func (client ExpressRouteCircuitConnectionsClient) DeleteSender(req *http.Reques func (client ExpressRouteCircuitConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -240,6 +233,7 @@ func (client ExpressRouteCircuitConnectionsClient) Get(ctx context.Context, reso result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -279,7 +273,6 @@ func (client ExpressRouteCircuitConnectionsClient) GetSender(req *http.Request) func (client ExpressRouteCircuitConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -320,6 +313,11 @@ func (client ExpressRouteCircuitConnectionsClient) List(ctx context.Context, res result.ercclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "List", resp, "Failure responding to request") + return + } + if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -358,7 +356,6 @@ func (client ExpressRouteCircuitConnectionsClient) ListSender(req *http.Request) func (client ExpressRouteCircuitConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitpeerings.go index 9645fefdb72a..890b81bd3add 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuitpeerings.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Conte ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -79,7 +68,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Conte result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -120,7 +109,10 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateSender(req *http.R if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -129,7 +121,6 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateSender(req *http.R func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -147,8 +138,8 @@ func (client ExpressRouteCircuitPeeringsClient) Delete(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -161,7 +152,7 @@ func (client ExpressRouteCircuitPeeringsClient) Delete(ctx context.Context, reso result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Delete", nil, "Failure sending request") return } @@ -198,7 +189,10 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -207,7 +201,6 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteSender(req *http.Request) func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -246,6 +239,7 @@ func (client ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, resourc result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", resp, "Failure responding to request") + return } return @@ -284,7 +278,6 @@ func (client ExpressRouteCircuitPeeringsClient) GetSender(req *http.Request) (*h func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -324,6 +317,11 @@ func (client ExpressRouteCircuitPeeringsClient) List(ctx context.Context, resour result.ercplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure responding to request") + return + } + if result.ercplr.hasNextLink() && result.ercplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -361,7 +359,6 @@ func (client ExpressRouteCircuitPeeringsClient) ListSender(req *http.Request) (* func (client ExpressRouteCircuitPeeringsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitPeeringListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuits.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuits.go index 6089db218447..ea3943a0d8ad 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuits.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecircuits.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdate(ctx context.Context, res ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdate(ctx context.Context, res result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -105,7 +94,10 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdateSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -114,7 +106,6 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdateSender(req *http.Request) func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -131,8 +122,8 @@ func (client ExpressRouteCircuitsClient) Delete(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -145,7 +136,7 @@ func (client ExpressRouteCircuitsClient) Delete(ctx context.Context, resourceGro result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Delete", nil, "Failure sending request") return } @@ -181,7 +172,10 @@ func (client ExpressRouteCircuitsClient) DeleteSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -190,7 +184,6 @@ func (client ExpressRouteCircuitsClient) DeleteSender(req *http.Request) (future func (client ExpressRouteCircuitsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -228,6 +221,7 @@ func (client ExpressRouteCircuitsClient) Get(ctx context.Context, resourceGroupN result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", resp, "Failure responding to request") + return } return @@ -265,7 +259,6 @@ func (client ExpressRouteCircuitsClient) GetSender(req *http.Request) (*http.Res func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -305,6 +298,7 @@ func (client ExpressRouteCircuitsClient) GetPeeringStats(ctx context.Context, re result, err = client.GetPeeringStatsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", resp, "Failure responding to request") + return } return @@ -343,7 +337,6 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsSender(req *http.Request func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -382,6 +375,7 @@ func (client ExpressRouteCircuitsClient) GetStats(ctx context.Context, resourceG result, err = client.GetStatsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", resp, "Failure responding to request") + return } return @@ -419,7 +413,6 @@ func (client ExpressRouteCircuitsClient) GetStatsSender(req *http.Request) (*htt func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -458,6 +451,11 @@ func (client ExpressRouteCircuitsClient) List(ctx context.Context, resourceGroup result.erclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure responding to request") + return + } + if result.erclr.hasNextLink() && result.erclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -494,7 +492,6 @@ func (client ExpressRouteCircuitsClient) ListSender(req *http.Request) (*http.Re func (client ExpressRouteCircuitsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -568,6 +565,11 @@ func (client ExpressRouteCircuitsClient) ListAll(ctx context.Context) (result Ex result.erclr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure responding to request") + return + } + if result.erclr.hasNextLink() && result.erclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -603,7 +605,6 @@ func (client ExpressRouteCircuitsClient) ListAllSender(req *http.Request) (*http func (client ExpressRouteCircuitsClient) ListAllResponder(resp *http.Response) (result ExpressRouteCircuitListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -659,8 +660,8 @@ func (client ExpressRouteCircuitsClient) ListArpTable(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListArpTable") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -673,7 +674,7 @@ func (client ExpressRouteCircuitsClient) ListArpTable(ctx context.Context, resou result, err = client.ListArpTableSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", nil, "Failure sending request") return } @@ -711,7 +712,10 @@ func (client ExpressRouteCircuitsClient) ListArpTableSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -720,7 +724,6 @@ func (client ExpressRouteCircuitsClient) ListArpTableSender(req *http.Request) ( func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -740,8 +743,8 @@ func (client ExpressRouteCircuitsClient) ListRoutesTable(ctx context.Context, re ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListRoutesTable") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -754,7 +757,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTable(ctx context.Context, re result, err = client.ListRoutesTableSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", nil, "Failure sending request") return } @@ -792,7 +795,10 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSender(req *http.Request if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -801,7 +807,6 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSender(req *http.Request func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -821,8 +826,8 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(ctx context.Cont ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListRoutesTableSummary") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -835,7 +840,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(ctx context.Cont result, err = client.ListRoutesTableSummarySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", nil, "Failure sending request") return } @@ -873,7 +878,10 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummarySender(req *http. if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -882,7 +890,6 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummarySender(req *http. func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -900,8 +907,8 @@ func (client ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -914,7 +921,7 @@ func (client ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, resourc result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "UpdateTags", nil, "Failure sending request") return } @@ -952,7 +959,10 @@ func (client ExpressRouteCircuitsClient) UpdateTagsSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -961,7 +971,6 @@ func (client ExpressRouteCircuitsClient) UpdateTagsSender(req *http.Request) (fu func (client ExpressRouteCircuitsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteconnections.go index 5f68a3567d04..21109eab6f5b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteconnections.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client ExpressRouteConnectionsClient) CreateOrUpdate(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -76,7 +65,7 @@ func (client ExpressRouteConnectionsClient) CreateOrUpdate(ctx context.Context, result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -115,7 +104,10 @@ func (client ExpressRouteConnectionsClient) CreateOrUpdateSender(req *http.Reque if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -124,7 +116,6 @@ func (client ExpressRouteConnectionsClient) CreateOrUpdateSender(req *http.Reque func (client ExpressRouteConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -142,8 +133,8 @@ func (client ExpressRouteConnectionsClient) Delete(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -156,7 +147,7 @@ func (client ExpressRouteConnectionsClient) Delete(ctx context.Context, resource result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Delete", nil, "Failure sending request") return } @@ -193,7 +184,10 @@ func (client ExpressRouteConnectionsClient) DeleteSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -202,7 +196,6 @@ func (client ExpressRouteConnectionsClient) DeleteSender(req *http.Request) (fut func (client ExpressRouteConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -241,6 +234,7 @@ func (client ExpressRouteConnectionsClient) Get(ctx context.Context, resourceGro result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -279,7 +273,6 @@ func (client ExpressRouteConnectionsClient) GetSender(req *http.Request) (*http. func (client ExpressRouteConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -318,6 +311,7 @@ func (client ExpressRouteConnectionsClient) List(ctx context.Context, resourceGr result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "List", resp, "Failure responding to request") + return } return @@ -355,7 +349,6 @@ func (client ExpressRouteConnectionsClient) ListSender(req *http.Request) (*http func (client ExpressRouteConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteConnectionList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecrossconnectionpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecrossconnectionpeerings.go index afbad2436d6b..4485554186f7 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecrossconnectionpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecrossconnectionpeerings.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -56,8 +45,8 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdate(ctx conte ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -81,7 +70,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdate(ctx conte result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -121,7 +110,10 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateSender(req if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -130,7 +122,6 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateSender(req func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -148,8 +139,8 @@ func (client ExpressRouteCrossConnectionPeeringsClient) Delete(ctx context.Conte ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -162,7 +153,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) Delete(ctx context.Conte result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Delete", nil, "Failure sending request") return } @@ -199,7 +190,10 @@ func (client ExpressRouteCrossConnectionPeeringsClient) DeleteSender(req *http.R if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -208,7 +202,6 @@ func (client ExpressRouteCrossConnectionPeeringsClient) DeleteSender(req *http.R func (client ExpressRouteCrossConnectionPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -247,6 +240,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) Get(ctx context.Context, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Get", resp, "Failure responding to request") + return } return @@ -285,7 +279,6 @@ func (client ExpressRouteCrossConnectionPeeringsClient) GetSender(req *http.Requ func (client ExpressRouteCrossConnectionPeeringsClient) GetResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -325,6 +318,11 @@ func (client ExpressRouteCrossConnectionPeeringsClient) List(ctx context.Context result.erccpl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "List", resp, "Failure responding to request") + return + } + if result.erccpl.hasNextLink() && result.erccpl.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -362,7 +360,6 @@ func (client ExpressRouteCrossConnectionPeeringsClient) ListSender(req *http.Req func (client ExpressRouteCrossConnectionPeeringsClient) ListResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeeringList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecrossconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecrossconnections.go index 17b5c2b19db1..ff5cddfef4be 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecrossconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutecrossconnections.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client ExpressRouteCrossConnectionsClient) CreateOrUpdate(ctx context.Cont ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client ExpressRouteCrossConnectionsClient) CreateOrUpdate(ctx context.Cont result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -105,7 +94,10 @@ func (client ExpressRouteCrossConnectionsClient) CreateOrUpdateSender(req *http. if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -114,7 +106,6 @@ func (client ExpressRouteCrossConnectionsClient) CreateOrUpdateSender(req *http. func (client ExpressRouteCrossConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +144,7 @@ func (client ExpressRouteCrossConnectionsClient) Get(ctx context.Context, resour result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -190,7 +182,6 @@ func (client ExpressRouteCrossConnectionsClient) GetSender(req *http.Request) (* func (client ExpressRouteCrossConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -227,6 +218,11 @@ func (client ExpressRouteCrossConnectionsClient) List(ctx context.Context) (resu result.ercclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "List", resp, "Failure responding to request") + return + } + if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -262,7 +258,6 @@ func (client ExpressRouteCrossConnectionsClient) ListSender(req *http.Request) ( func (client ExpressRouteCrossConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteCrossConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -319,8 +314,8 @@ func (client ExpressRouteCrossConnectionsClient) ListArpTable(ctx context.Contex ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListArpTable") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -333,7 +328,7 @@ func (client ExpressRouteCrossConnectionsClient) ListArpTable(ctx context.Contex result, err = client.ListArpTableSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListArpTable", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListArpTable", nil, "Failure sending request") return } @@ -371,7 +366,10 @@ func (client ExpressRouteCrossConnectionsClient) ListArpTableSender(req *http.Re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -380,7 +378,6 @@ func (client ExpressRouteCrossConnectionsClient) ListArpTableSender(req *http.Re func (client ExpressRouteCrossConnectionsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -419,6 +416,11 @@ func (client ExpressRouteCrossConnectionsClient) ListByResourceGroup(ctx context result.ercclr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -455,7 +457,6 @@ func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupSender(req * func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRouteCrossConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -512,8 +513,8 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTable(ctx context.Con ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListRoutesTable") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -526,7 +527,7 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTable(ctx context.Con result, err = client.ListRoutesTableSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTable", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTable", nil, "Failure sending request") return } @@ -564,7 +565,10 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSender(req *http if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -573,7 +577,6 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSender(req *http func (client ExpressRouteCrossConnectionsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -593,8 +596,8 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummary(ctx cont ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListRoutesTableSummary") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -607,7 +610,7 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummary(ctx cont result, err = client.ListRoutesTableSummarySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTableSummary", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTableSummary", nil, "Failure sending request") return } @@ -645,7 +648,10 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummarySender(re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -654,7 +660,6 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummarySender(re func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -672,8 +677,8 @@ func (client ExpressRouteCrossConnectionsClient) UpdateTags(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -686,7 +691,7 @@ func (client ExpressRouteCrossConnectionsClient) UpdateTags(ctx context.Context, result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "UpdateTags", nil, "Failure sending request") return } @@ -724,7 +729,10 @@ func (client ExpressRouteCrossConnectionsClient) UpdateTagsSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -733,7 +741,6 @@ func (client ExpressRouteCrossConnectionsClient) UpdateTagsSender(req *http.Requ func (client ExpressRouteCrossConnectionsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutegateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutegateways.go index 8759ccf752ee..82748fc21997 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutegateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutegateways.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client ExpressRouteGatewaysClient) CreateOrUpdate(ctx context.Context, res ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -74,7 +63,7 @@ func (client ExpressRouteGatewaysClient) CreateOrUpdate(ctx context.Context, res result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -113,7 +102,10 @@ func (client ExpressRouteGatewaysClient) CreateOrUpdateSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -122,7 +114,6 @@ func (client ExpressRouteGatewaysClient) CreateOrUpdateSender(req *http.Request) func (client ExpressRouteGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -140,8 +131,8 @@ func (client ExpressRouteGatewaysClient) Delete(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -154,7 +145,7 @@ func (client ExpressRouteGatewaysClient) Delete(ctx context.Context, resourceGro result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Delete", nil, "Failure sending request") return } @@ -190,7 +181,10 @@ func (client ExpressRouteGatewaysClient) DeleteSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -199,7 +193,6 @@ func (client ExpressRouteGatewaysClient) DeleteSender(req *http.Request) (future func (client ExpressRouteGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -237,6 +230,7 @@ func (client ExpressRouteGatewaysClient) Get(ctx context.Context, resourceGroupN result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", resp, "Failure responding to request") + return } return @@ -274,7 +268,6 @@ func (client ExpressRouteGatewaysClient) GetSender(req *http.Request) (*http.Res func (client ExpressRouteGatewaysClient) GetResponder(resp *http.Response) (result ExpressRouteGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -312,6 +305,7 @@ func (client ExpressRouteGatewaysClient) ListByResourceGroup(ctx context.Context result, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") + return } return @@ -348,7 +342,6 @@ func (client ExpressRouteGatewaysClient) ListByResourceGroupSender(req *http.Req func (client ExpressRouteGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -384,6 +377,7 @@ func (client ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context) result, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", resp, "Failure responding to request") + return } return @@ -419,7 +413,6 @@ func (client ExpressRouteGatewaysClient) ListBySubscriptionSender(req *http.Requ func (client ExpressRouteGatewaysClient) ListBySubscriptionResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutelinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutelinks.go index 630607dc87dc..2908eb3e1471 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutelinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressroutelinks.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client ExpressRouteLinksClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "Get", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client ExpressRouteLinksClient) GetSender(req *http.Request) (*http.Respon func (client ExpressRouteLinksClient) GetResponder(resp *http.Response) (result ExpressRouteLink, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,11 @@ func (client ExpressRouteLinksClient) List(ctx context.Context, resourceGroupNam result.erllr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "List", resp, "Failure responding to request") + return + } + if result.erllr.hasNextLink() && result.erllr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -189,7 +183,6 @@ func (client ExpressRouteLinksClient) ListSender(req *http.Request) (*http.Respo func (client ExpressRouteLinksClient) ListResponder(resp *http.Response) (result ExpressRouteLinkListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteports.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteports.go index 24319267a552..6a78ebe811b0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteports.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteports.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client ExpressRoutePortsClient) CreateOrUpdate(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client ExpressRoutePortsClient) CreateOrUpdate(ctx context.Context, resour result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -105,7 +94,10 @@ func (client ExpressRoutePortsClient) CreateOrUpdateSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -114,7 +106,6 @@ func (client ExpressRoutePortsClient) CreateOrUpdateSender(req *http.Request) (f func (client ExpressRoutePortsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRoutePort, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -131,8 +122,8 @@ func (client ExpressRoutePortsClient) Delete(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -145,7 +136,7 @@ func (client ExpressRoutePortsClient) Delete(ctx context.Context, resourceGroupN result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Delete", nil, "Failure sending request") return } @@ -181,7 +172,10 @@ func (client ExpressRoutePortsClient) DeleteSender(req *http.Request) (future Ex if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -190,7 +184,6 @@ func (client ExpressRoutePortsClient) DeleteSender(req *http.Request) (future Ex func (client ExpressRoutePortsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -228,6 +221,7 @@ func (client ExpressRoutePortsClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Get", resp, "Failure responding to request") + return } return @@ -265,7 +259,6 @@ func (client ExpressRoutePortsClient) GetSender(req *http.Request) (*http.Respon func (client ExpressRoutePortsClient) GetResponder(resp *http.Response) (result ExpressRoutePort, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -302,6 +295,11 @@ func (client ExpressRoutePortsClient) List(ctx context.Context) (result ExpressR result.erplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "List", resp, "Failure responding to request") + return + } + if result.erplr.hasNextLink() && result.erplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -337,7 +335,6 @@ func (client ExpressRoutePortsClient) ListSender(req *http.Request) (*http.Respo func (client ExpressRoutePortsClient) ListResponder(resp *http.Response) (result ExpressRoutePortListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +410,11 @@ func (client ExpressRoutePortsClient) ListByResourceGroup(ctx context.Context, r result.erplr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.erplr.hasNextLink() && result.erplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -449,7 +451,6 @@ func (client ExpressRoutePortsClient) ListByResourceGroupSender(req *http.Reques func (client ExpressRoutePortsClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRoutePortListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -504,8 +505,8 @@ func (client ExpressRoutePortsClient) UpdateTags(ctx context.Context, resourceGr ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -518,7 +519,7 @@ func (client ExpressRoutePortsClient) UpdateTags(ctx context.Context, resourceGr result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "UpdateTags", nil, "Failure sending request") return } @@ -556,7 +557,10 @@ func (client ExpressRoutePortsClient) UpdateTagsSender(req *http.Request) (futur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -565,7 +569,6 @@ func (client ExpressRoutePortsClient) UpdateTagsSender(req *http.Request) (futur func (client ExpressRoutePortsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRoutePort, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteportslocations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteportslocations.go index c688c98e0594..d4e6f5d1a731 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteportslocations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteportslocations.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,7 @@ func (client ExpressRoutePortsLocationsClient) Get(ctx context.Context, location result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "Get", resp, "Failure responding to request") + return } return @@ -109,7 +99,6 @@ func (client ExpressRoutePortsLocationsClient) GetSender(req *http.Request) (*ht func (client ExpressRoutePortsLocationsClient) GetResponder(resp *http.Response) (result ExpressRoutePortsLocation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -147,6 +136,11 @@ func (client ExpressRoutePortsLocationsClient) List(ctx context.Context) (result result.erpllr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "List", resp, "Failure responding to request") + return + } + if result.erpllr.hasNextLink() && result.erpllr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -182,7 +176,6 @@ func (client ExpressRoutePortsLocationsClient) ListSender(req *http.Request) (*h func (client ExpressRoutePortsLocationsClient) ListResponder(resp *http.Response) (result ExpressRoutePortsLocationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteserviceproviders.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteserviceproviders.go index 262a38bad3b3..d77a93f8898f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteserviceproviders.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/expressrouteserviceproviders.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -71,6 +60,11 @@ func (client ExpressRouteServiceProvidersClient) List(ctx context.Context) (resu result.ersplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.ersplr.hasNextLink() && result.ersplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -106,7 +100,6 @@ func (client ExpressRouteServiceProvidersClient) ListSender(req *http.Request) ( func (client ExpressRouteServiceProvidersClient) ListResponder(resp *http.Response) (result ExpressRouteServiceProviderListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicies.go index bb43fc933172..7c7c3ef5e2b7 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicies.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client FirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client FirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourc result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -105,7 +94,10 @@ func (client FirewallPoliciesClient) CreateOrUpdateSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -114,7 +106,6 @@ func (client FirewallPoliciesClient) CreateOrUpdateSender(req *http.Request) (fu func (client FirewallPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -131,8 +122,8 @@ func (client FirewallPoliciesClient) Delete(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -145,7 +136,7 @@ func (client FirewallPoliciesClient) Delete(ctx context.Context, resourceGroupNa result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Delete", nil, "Failure sending request") return } @@ -181,7 +172,10 @@ func (client FirewallPoliciesClient) DeleteSender(req *http.Request) (future Fir if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -190,7 +184,6 @@ func (client FirewallPoliciesClient) DeleteSender(req *http.Request) (future Fir func (client FirewallPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -229,6 +222,7 @@ func (client FirewallPoliciesClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", resp, "Failure responding to request") + return } return @@ -269,7 +263,6 @@ func (client FirewallPoliciesClient) GetSender(req *http.Request) (*http.Respons func (client FirewallPoliciesClient) GetResponder(resp *http.Response) (result FirewallPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -308,6 +301,11 @@ func (client FirewallPoliciesClient) List(ctx context.Context, resourceGroupName result.fplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.fplr.hasNextLink() && result.fplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -344,7 +342,6 @@ func (client FirewallPoliciesClient) ListSender(req *http.Request) (*http.Respon func (client FirewallPoliciesClient) ListResponder(resp *http.Response) (result FirewallPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -418,6 +415,11 @@ func (client FirewallPoliciesClient) ListAll(ctx context.Context) (result Firewa result.fplr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.fplr.hasNextLink() && result.fplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -453,7 +455,6 @@ func (client FirewallPoliciesClient) ListAllSender(req *http.Request) (*http.Res func (client FirewallPoliciesClient) ListAllResponder(resp *http.Response) (result FirewallPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -530,6 +531,7 @@ func (client FirewallPoliciesClient) UpdateTags(ctx context.Context, resourceGro result, err = client.UpdateTagsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", resp, "Failure responding to request") + return } return @@ -569,7 +571,6 @@ func (client FirewallPoliciesClient) UpdateTagsSender(req *http.Request) (*http. func (client FirewallPoliciesClient) UpdateTagsResponder(resp *http.Response) (result FirewallPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicyrulegroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicyrulegroups.go index a7e13ab452ef..6a0db209c780 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicyrulegroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/firewallpolicyrulegroups.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client FirewallPolicyRuleGroupsClient) CreateOrUpdate(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleGroupsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -79,7 +68,7 @@ func (client FirewallPolicyRuleGroupsClient) CreateOrUpdate(ctx context.Context, result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -120,7 +109,10 @@ func (client FirewallPolicyRuleGroupsClient) CreateOrUpdateSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -129,7 +121,6 @@ func (client FirewallPolicyRuleGroupsClient) CreateOrUpdateSender(req *http.Requ func (client FirewallPolicyRuleGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallPolicyRuleGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -147,8 +138,8 @@ func (client FirewallPolicyRuleGroupsClient) Delete(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleGroupsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -161,7 +152,7 @@ func (client FirewallPolicyRuleGroupsClient) Delete(ctx context.Context, resourc result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "Delete", nil, "Failure sending request") return } @@ -198,7 +189,10 @@ func (client FirewallPolicyRuleGroupsClient) DeleteSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -207,7 +201,6 @@ func (client FirewallPolicyRuleGroupsClient) DeleteSender(req *http.Request) (fu func (client FirewallPolicyRuleGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -246,6 +239,7 @@ func (client FirewallPolicyRuleGroupsClient) Get(ctx context.Context, resourceGr result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "Get", resp, "Failure responding to request") + return } return @@ -284,7 +278,6 @@ func (client FirewallPolicyRuleGroupsClient) GetSender(req *http.Request) (*http func (client FirewallPolicyRuleGroupsClient) GetResponder(resp *http.Response) (result FirewallPolicyRuleGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -324,6 +317,11 @@ func (client FirewallPolicyRuleGroupsClient) List(ctx context.Context, resourceG result.fprglr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsClient", "List", resp, "Failure responding to request") + return + } + if result.fprglr.hasNextLink() && result.fprglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -361,7 +359,6 @@ func (client FirewallPolicyRuleGroupsClient) ListSender(req *http.Request) (*htt func (client FirewallPolicyRuleGroupsClient) ListResponder(resp *http.Response) (result FirewallPolicyRuleGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/hubvirtualnetworkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/hubvirtualnetworkconnections.go index 6bf6d94f0eb8..89acce8dd5ad 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/hubvirtualnetworkconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/hubvirtualnetworkconnections.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client HubVirtualNetworkConnectionsClient) Get(ctx context.Context, resour result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client HubVirtualNetworkConnectionsClient) GetSender(req *http.Request) (* func (client HubVirtualNetworkConnectionsClient) GetResponder(resp *http.Response) (result HubVirtualNetworkConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,11 @@ func (client HubVirtualNetworkConnectionsClient) List(ctx context.Context, resou result.lhvncr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", resp, "Failure responding to request") + return + } + if result.lhvncr.hasNextLink() && result.lhvncr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -189,7 +183,6 @@ func (client HubVirtualNetworkConnectionsClient) ListSender(req *http.Request) ( func (client HubVirtualNetworkConnectionsClient) ListResponder(resp *http.Response) (result ListHubVirtualNetworkConnectionsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/inboundnatrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/inboundnatrules.go index 41f109bbe898..50baf1506bee 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/inboundnatrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/inboundnatrules.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client InboundNatRulesClient) CreateOrUpdate(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -86,7 +75,7 @@ func (client InboundNatRulesClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -126,7 +115,10 @@ func (client InboundNatRulesClient) CreateOrUpdateSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -135,7 +127,6 @@ func (client InboundNatRulesClient) CreateOrUpdateSender(req *http.Request) (fut func (client InboundNatRulesClient) CreateOrUpdateResponder(resp *http.Response) (result InboundNatRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,8 +144,8 @@ func (client InboundNatRulesClient) Delete(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -167,7 +158,7 @@ func (client InboundNatRulesClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Delete", nil, "Failure sending request") return } @@ -204,7 +195,10 @@ func (client InboundNatRulesClient) DeleteSender(req *http.Request) (future Inbo if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -213,7 +207,6 @@ func (client InboundNatRulesClient) DeleteSender(req *http.Request) (future Inbo func (client InboundNatRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -253,6 +246,7 @@ func (client InboundNatRulesClient) Get(ctx context.Context, resourceGroupName s result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -294,7 +288,6 @@ func (client InboundNatRulesClient) GetSender(req *http.Request) (*http.Response func (client InboundNatRulesClient) GetResponder(resp *http.Response) (result InboundNatRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -334,6 +327,11 @@ func (client InboundNatRulesClient) List(ctx context.Context, resourceGroupName result.inrlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure responding to request") + return + } + if result.inrlr.hasNextLink() && result.inrlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -371,7 +369,6 @@ func (client InboundNatRulesClient) ListSender(req *http.Request) (*http.Respons func (client InboundNatRulesClient) ListResponder(resp *http.Response) (result InboundNatRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfaceipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfaceipconfigurations.go index 879c23b8cecb..b421812bba44 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfaceipconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfaceipconfigurations.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client InterfaceIPConfigurationsClient) Get(ctx context.Context, resourceG result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client InterfaceIPConfigurationsClient) GetSender(req *http.Request) (*htt func (client InterfaceIPConfigurationsClient) GetResponder(resp *http.Response) (result InterfaceIPConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,11 @@ func (client InterfaceIPConfigurationsClient) List(ctx context.Context, resource result.iiclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure responding to request") + return + } + if result.iiclr.hasNextLink() && result.iiclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -189,7 +183,6 @@ func (client InterfaceIPConfigurationsClient) ListSender(req *http.Request) (*ht func (client InterfaceIPConfigurationsClient) ListResponder(resp *http.Response) (result InterfaceIPConfigurationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfaceloadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfaceloadbalancers.go index 50434af08deb..e488f6c75785 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfaceloadbalancers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfaceloadbalancers.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,11 @@ func (client InterfaceLoadBalancersClient) List(ctx context.Context, resourceGro result.ilblr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure responding to request") + return + } + if result.ilblr.hasNextLink() && result.ilblr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -111,7 +105,6 @@ func (client InterfaceLoadBalancersClient) ListSender(req *http.Request) (*http. func (client InterfaceLoadBalancersClient) ListResponder(resp *http.Response) (result InterfaceLoadBalancerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfacesgroup.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfacesgroup.go index 865ff564fb9a..4008cb289654 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfacesgroup.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfacesgroup.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client InterfacesClient) CreateOrUpdate(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client InterfacesClient) CreateOrUpdate(ctx context.Context, resourceGroup result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -103,7 +92,10 @@ func (client InterfacesClient) CreateOrUpdateSender(req *http.Request) (future I if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -112,7 +104,6 @@ func (client InterfacesClient) CreateOrUpdateSender(req *http.Request) (future I func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (result Interface, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -129,8 +120,8 @@ func (client InterfacesClient) Delete(ctx context.Context, resourceGroupName str ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -143,7 +134,7 @@ func (client InterfacesClient) Delete(ctx context.Context, resourceGroupName str result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Delete", nil, "Failure sending request") return } @@ -179,7 +170,10 @@ func (client InterfacesClient) DeleteSender(req *http.Request) (future Interface if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -188,7 +182,6 @@ func (client InterfacesClient) DeleteSender(req *http.Request) (future Interface func (client InterfacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client InterfacesClient) Get(ctx context.Context, resourceGroupName string result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure responding to request") + return } return @@ -267,7 +261,6 @@ func (client InterfacesClient) GetSender(req *http.Request) (*http.Response, err func (client InterfacesClient) GetResponder(resp *http.Response) (result Interface, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -284,8 +277,8 @@ func (client InterfacesClient) GetEffectiveRouteTable(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.GetEffectiveRouteTable") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -298,7 +291,7 @@ func (client InterfacesClient) GetEffectiveRouteTable(ctx context.Context, resou result, err = client.GetEffectiveRouteTableSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetEffectiveRouteTable", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetEffectiveRouteTable", nil, "Failure sending request") return } @@ -334,7 +327,10 @@ func (client InterfacesClient) GetEffectiveRouteTableSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -343,7 +339,6 @@ func (client InterfacesClient) GetEffectiveRouteTableSender(req *http.Request) ( func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Response) (result EffectiveRouteListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -387,6 +382,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx cont result, err = client.GetVirtualMachineScaleSetIPConfigurationResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetIPConfiguration", resp, "Failure responding to request") + return } return @@ -430,7 +426,6 @@ func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationSender(re func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationResponder(resp *http.Response) (result InterfaceIPConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -472,6 +467,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx con result, err = client.GetVirtualMachineScaleSetNetworkInterfaceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", resp, "Failure responding to request") + return } return @@ -514,7 +510,6 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceSender(r func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponder(resp *http.Response) (result Interface, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -553,6 +548,11 @@ func (client InterfacesClient) List(ctx context.Context, resourceGroupName strin result.ilr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure responding to request") + return + } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -589,7 +589,6 @@ func (client InterfacesClient) ListSender(req *http.Request) (*http.Response, er func (client InterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -663,6 +662,11 @@ func (client InterfacesClient) ListAll(ctx context.Context) (result InterfaceLis result.ilr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -698,7 +702,6 @@ func (client InterfacesClient) ListAllSender(req *http.Request) (*http.Response, func (client InterfacesClient) ListAllResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -752,8 +755,8 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroups(ctx context.Co ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListEffectiveNetworkSecurityGroups") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -766,7 +769,7 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroups(ctx context.Co result, err = client.ListEffectiveNetworkSecurityGroupsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListEffectiveNetworkSecurityGroups", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListEffectiveNetworkSecurityGroups", nil, "Failure sending request") return } @@ -802,7 +805,10 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsSender(req *htt if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -811,7 +817,6 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsSender(req *htt func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp *http.Response) (result EffectiveNetworkSecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -855,6 +860,11 @@ func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurations(ctx co result.iiclr, err = client.ListVirtualMachineScaleSetIPConfigurationsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetIPConfigurations", resp, "Failure responding to request") + return + } + if result.iiclr.hasNextLink() && result.iiclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -897,7 +907,6 @@ func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsSender( func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsResponder(resp *http.Response) (result InterfaceIPConfigurationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -974,6 +983,11 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(ctx c result.ilr, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure responding to request") + return + } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -1011,7 +1025,6 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesSender func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1090,6 +1103,11 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(ctx result.ilr, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure responding to request") + return + } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -1128,7 +1146,6 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesSend func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1183,8 +1200,8 @@ func (client InterfacesClient) UpdateTags(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1197,7 +1214,7 @@ func (client InterfacesClient) UpdateTags(ctx context.Context, resourceGroupName result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.InterfacesClient", "UpdateTags", nil, "Failure sending request") return } @@ -1235,7 +1252,10 @@ func (client InterfacesClient) UpdateTagsSender(req *http.Request) (future Inter if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1244,7 +1264,6 @@ func (client InterfacesClient) UpdateTagsSender(req *http.Request) (future Inter func (client InterfacesClient) UpdateTagsResponder(resp *http.Response) (result Interface, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfacetapconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfacetapconfigurations.go index fdd5f43b095b..549e232d7ba2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfacetapconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/interfacetapconfigurations.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client InterfaceTapConfigurationsClient) CreateOrUpdate(ctx context.Contex ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -103,7 +92,7 @@ func (client InterfaceTapConfigurationsClient) CreateOrUpdate(ctx context.Contex result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -143,7 +132,10 @@ func (client InterfaceTapConfigurationsClient) CreateOrUpdateSender(req *http.Re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -152,7 +144,6 @@ func (client InterfaceTapConfigurationsClient) CreateOrUpdateSender(req *http.Re func (client InterfaceTapConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result InterfaceTapConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -170,8 +161,8 @@ func (client InterfaceTapConfigurationsClient) Delete(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -184,7 +175,7 @@ func (client InterfaceTapConfigurationsClient) Delete(ctx context.Context, resou result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Delete", nil, "Failure sending request") return } @@ -221,7 +212,10 @@ func (client InterfaceTapConfigurationsClient) DeleteSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -230,7 +224,6 @@ func (client InterfaceTapConfigurationsClient) DeleteSender(req *http.Request) ( func (client InterfaceTapConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -269,6 +262,7 @@ func (client InterfaceTapConfigurationsClient) Get(ctx context.Context, resource result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Get", resp, "Failure responding to request") + return } return @@ -307,7 +301,6 @@ func (client InterfaceTapConfigurationsClient) GetSender(req *http.Request) (*ht func (client InterfaceTapConfigurationsClient) GetResponder(resp *http.Response) (result InterfaceTapConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -347,6 +340,11 @@ func (client InterfaceTapConfigurationsClient) List(ctx context.Context, resourc result.itclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "List", resp, "Failure responding to request") + return + } + if result.itclr.hasNextLink() && result.itclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -384,7 +382,6 @@ func (client InterfaceTapConfigurationsClient) ListSender(req *http.Request) (*h func (client InterfaceTapConfigurationsClient) ListResponder(resp *http.Response) (result InterfaceTapConfigurationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerbackendaddresspools.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerbackendaddresspools.go index bdf93fadfade..045e7e964800 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerbackendaddresspools.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerbackendaddresspools.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client LoadBalancerBackendAddressPoolsClient) Get(ctx context.Context, res result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client LoadBalancerBackendAddressPoolsClient) GetSender(req *http.Request) func (client LoadBalancerBackendAddressPoolsClient) GetResponder(resp *http.Response) (result BackendAddressPool, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,11 @@ func (client LoadBalancerBackendAddressPoolsClient) List(ctx context.Context, re result.lbbaplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure responding to request") + return + } + if result.lbbaplr.hasNextLink() && result.lbbaplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -189,7 +183,6 @@ func (client LoadBalancerBackendAddressPoolsClient) ListSender(req *http.Request func (client LoadBalancerBackendAddressPoolsClient) ListResponder(resp *http.Response) (result LoadBalancerBackendAddressPoolListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerfrontendipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerfrontendipconfigurations.go index f6fc524ed5a0..fcf76e647e12 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerfrontendipconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerfrontendipconfigurations.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -75,6 +64,7 @@ func (client LoadBalancerFrontendIPConfigurationsClient) Get(ctx context.Context result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", resp, "Failure responding to request") + return } return @@ -113,7 +103,6 @@ func (client LoadBalancerFrontendIPConfigurationsClient) GetSender(req *http.Req func (client LoadBalancerFrontendIPConfigurationsClient) GetResponder(resp *http.Response) (result FrontendIPConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +142,11 @@ func (client LoadBalancerFrontendIPConfigurationsClient) List(ctx context.Contex result.lbficlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure responding to request") + return + } + if result.lbficlr.hasNextLink() && result.lbficlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -190,7 +184,6 @@ func (client LoadBalancerFrontendIPConfigurationsClient) ListSender(req *http.Re func (client LoadBalancerFrontendIPConfigurationsClient) ListResponder(resp *http.Response) (result LoadBalancerFrontendIPConfigurationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerloadbalancingrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerloadbalancingrules.go index f3af8009d3bd..e4509bec7559 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerloadbalancingrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerloadbalancingrules.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client LoadBalancerLoadBalancingRulesClient) Get(ctx context.Context, reso result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client LoadBalancerLoadBalancingRulesClient) GetSender(req *http.Request) func (client LoadBalancerLoadBalancingRulesClient) GetResponder(resp *http.Response) (result LoadBalancingRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,11 @@ func (client LoadBalancerLoadBalancingRulesClient) List(ctx context.Context, res result.lblbrlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure responding to request") + return + } + if result.lblbrlr.hasNextLink() && result.lblbrlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -189,7 +183,6 @@ func (client LoadBalancerLoadBalancingRulesClient) ListSender(req *http.Request) func (client LoadBalancerLoadBalancingRulesClient) ListResponder(resp *http.Response) (result LoadBalancerLoadBalancingRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancernetworkinterfaces.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancernetworkinterfaces.go index 84947bb17c77..8330a7da3c88 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancernetworkinterfaces.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancernetworkinterfaces.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,11 @@ func (client LoadBalancerNetworkInterfacesClient) List(ctx context.Context, reso result.ilr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure responding to request") + return + } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -111,7 +105,6 @@ func (client LoadBalancerNetworkInterfacesClient) ListSender(req *http.Request) func (client LoadBalancerNetworkInterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalanceroutboundrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalanceroutboundrules.go index 7ef578d8f814..cfe7af7416d4 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalanceroutboundrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalanceroutboundrules.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client LoadBalancerOutboundRulesClient) Get(ctx context.Context, resourceG result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client LoadBalancerOutboundRulesClient) GetSender(req *http.Request) (*htt func (client LoadBalancerOutboundRulesClient) GetResponder(resp *http.Response) (result OutboundRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,11 @@ func (client LoadBalancerOutboundRulesClient) List(ctx context.Context, resource result.lborlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "List", resp, "Failure responding to request") + return + } + if result.lborlr.hasNextLink() && result.lborlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -189,7 +183,6 @@ func (client LoadBalancerOutboundRulesClient) ListSender(req *http.Request) (*ht func (client LoadBalancerOutboundRulesClient) ListResponder(resp *http.Response) (result LoadBalancerOutboundRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerprobes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerprobes.go index 977dcb00e2f5..37f885d3f459 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerprobes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancerprobes.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client LoadBalancerProbesClient) Get(ctx context.Context, resourceGroupNam result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client LoadBalancerProbesClient) GetSender(req *http.Request) (*http.Respo func (client LoadBalancerProbesClient) GetResponder(resp *http.Response) (result Probe, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -152,6 +141,11 @@ func (client LoadBalancerProbesClient) List(ctx context.Context, resourceGroupNa result.lbplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure responding to request") + return + } + if result.lbplr.hasNextLink() && result.lbplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -189,7 +183,6 @@ func (client LoadBalancerProbesClient) ListSender(req *http.Request) (*http.Resp func (client LoadBalancerProbesClient) ListResponder(resp *http.Response) (result LoadBalancerProbeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancers.go index 7c373eb55ce9..4b42e6e3a60b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/loadbalancers.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGr ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGr result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -103,7 +92,10 @@ func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (futur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -112,7 +104,6 @@ func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (futur func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancer, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -129,8 +120,8 @@ func (client LoadBalancersClient) Delete(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -143,7 +134,7 @@ func (client LoadBalancersClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", nil, "Failure sending request") return } @@ -179,7 +170,10 @@ func (client LoadBalancersClient) DeleteSender(req *http.Request) (future LoadBa if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -188,7 +182,6 @@ func (client LoadBalancersClient) DeleteSender(req *http.Request) (future LoadBa func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client LoadBalancersClient) Get(ctx context.Context, resourceGroupName str result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure responding to request") + return } return @@ -267,7 +261,6 @@ func (client LoadBalancersClient) GetSender(req *http.Request) (*http.Response, func (client LoadBalancersClient) GetResponder(resp *http.Response) (result LoadBalancer, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +299,11 @@ func (client LoadBalancersClient) List(ctx context.Context, resourceGroupName st result.lblr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to request") + return + } + if result.lblr.hasNextLink() && result.lblr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -342,7 +340,6 @@ func (client LoadBalancersClient) ListSender(req *http.Request) (*http.Response, func (client LoadBalancersClient) ListResponder(resp *http.Response) (result LoadBalancerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +413,11 @@ func (client LoadBalancersClient) ListAll(ctx context.Context) (result LoadBalan result.lblr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to request") + return + } + if result.lblr.hasNextLink() && result.lblr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -451,7 +453,6 @@ func (client LoadBalancersClient) ListAllSender(req *http.Request) (*http.Respon func (client LoadBalancersClient) ListAllResponder(resp *http.Response) (result LoadBalancerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -506,8 +507,8 @@ func (client LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -520,7 +521,7 @@ func (client LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupN result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", nil, "Failure sending request") return } @@ -558,7 +559,10 @@ func (client LoadBalancersClient) UpdateTagsSender(req *http.Request) (future Lo if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -567,7 +571,6 @@ func (client LoadBalancersClient) UpdateTagsSender(req *http.Request) (future Lo func (client LoadBalancersClient) UpdateTagsResponder(resp *http.Response) (result LoadBalancer, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/localnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/localnetworkgateways.go index 0f438358602a..75a5fc5bdd22 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/localnetworkgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/localnetworkgateways.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, res ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -75,7 +64,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, res result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -113,7 +102,10 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -122,7 +114,6 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result LocalNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -139,8 +130,8 @@ func (client LocalNetworkGatewaysClient) Delete(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -159,7 +150,7 @@ func (client LocalNetworkGatewaysClient) Delete(ctx context.Context, resourceGro result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Delete", nil, "Failure sending request") return } @@ -195,7 +186,10 @@ func (client LocalNetworkGatewaysClient) DeleteSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -204,7 +198,6 @@ func (client LocalNetworkGatewaysClient) DeleteSender(req *http.Request) (future func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -248,6 +241,7 @@ func (client LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroupN result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", resp, "Failure responding to request") + return } return @@ -285,7 +279,6 @@ func (client LocalNetworkGatewaysClient) GetSender(req *http.Request) (*http.Res func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (result LocalNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -324,6 +317,11 @@ func (client LocalNetworkGatewaysClient) List(ctx context.Context, resourceGroup result.lnglr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure responding to request") + return + } + if result.lnglr.hasNextLink() && result.lnglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -360,7 +358,6 @@ func (client LocalNetworkGatewaysClient) ListSender(req *http.Request) (*http.Re func (client LocalNetworkGatewaysClient) ListResponder(resp *http.Response) (result LocalNetworkGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -415,8 +412,8 @@ func (client LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -435,7 +432,7 @@ func (client LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resourc result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "UpdateTags", nil, "Failure sending request") return } @@ -473,7 +470,10 @@ func (client LocalNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -482,7 +482,6 @@ func (client LocalNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (fu func (client LocalNetworkGatewaysClient) UpdateTagsResponder(resp *http.Response) (result LocalNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go index c5d93eac2258..fd8d5c5175d4 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go @@ -1,2104 +1,24 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network" - -// Access enumerates the values for access. -type Access string - -const ( - // Allow ... - Allow Access = "Allow" - // Deny ... - Deny Access = "Deny" -) - -// PossibleAccessValues returns an array of possible values for the Access const type. -func PossibleAccessValues() []Access { - return []Access{Allow, Deny} -} - -// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health -// server health. -type ApplicationGatewayBackendHealthServerHealth string - -const ( - // Down ... - Down ApplicationGatewayBackendHealthServerHealth = "Down" - // Draining ... - Draining ApplicationGatewayBackendHealthServerHealth = "Draining" - // Partial ... - Partial ApplicationGatewayBackendHealthServerHealth = "Partial" - // Unknown ... - Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - // Up ... - Up ApplicationGatewayBackendHealthServerHealth = "Up" -) - -// PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. -func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { - return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} -} - -// ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. -type ApplicationGatewayCookieBasedAffinity string - -const ( - // Disabled ... - Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" - // Enabled ... - Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -// PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. -func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { - return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} -} - -// ApplicationGatewayCustomErrorStatusCode enumerates the values for application gateway custom error status -// code. -type ApplicationGatewayCustomErrorStatusCode string - -const ( - // HTTPStatus403 ... - HTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" - // HTTPStatus502 ... - HTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" -) - -// PossibleApplicationGatewayCustomErrorStatusCodeValues returns an array of possible values for the ApplicationGatewayCustomErrorStatusCode const type. -func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { - return []ApplicationGatewayCustomErrorStatusCode{HTTPStatus403, HTTPStatus502} -} - -// ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. -type ApplicationGatewayFirewallMode string - -const ( - // Detection ... - Detection ApplicationGatewayFirewallMode = "Detection" - // Prevention ... - Prevention ApplicationGatewayFirewallMode = "Prevention" -) - -// PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. -func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { - return []ApplicationGatewayFirewallMode{Detection, Prevention} -} - -// ApplicationGatewayOperationalState enumerates the values for application gateway operational state. -type ApplicationGatewayOperationalState string - -const ( - // Running ... - Running ApplicationGatewayOperationalState = "Running" - // Starting ... - Starting ApplicationGatewayOperationalState = "Starting" - // Stopped ... - Stopped ApplicationGatewayOperationalState = "Stopped" - // Stopping ... - Stopping ApplicationGatewayOperationalState = "Stopping" -) - -// PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. -func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { - return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} -} - -// ApplicationGatewayProtocol enumerates the values for application gateway protocol. -type ApplicationGatewayProtocol string - -const ( - // HTTP ... - HTTP ApplicationGatewayProtocol = "Http" - // HTTPS ... - HTTPS ApplicationGatewayProtocol = "Https" -) - -// PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. -func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { - return []ApplicationGatewayProtocol{HTTP, HTTPS} -} - -// ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. -type ApplicationGatewayRedirectType string - -const ( - // Found ... - Found ApplicationGatewayRedirectType = "Found" - // Permanent ... - Permanent ApplicationGatewayRedirectType = "Permanent" - // SeeOther ... - SeeOther ApplicationGatewayRedirectType = "SeeOther" - // Temporary ... - Temporary ApplicationGatewayRedirectType = "Temporary" -) - -// PossibleApplicationGatewayRedirectTypeValues returns an array of possible values for the ApplicationGatewayRedirectType const type. -func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { - return []ApplicationGatewayRedirectType{Found, Permanent, SeeOther, Temporary} -} - -// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule -// type. -type ApplicationGatewayRequestRoutingRuleType string - -const ( - // Basic ... - Basic ApplicationGatewayRequestRoutingRuleType = "Basic" - // PathBasedRouting ... - PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. -func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { - return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} -} - -// ApplicationGatewaySkuName enumerates the values for application gateway sku name. -type ApplicationGatewaySkuName string - -const ( - // StandardLarge ... - StandardLarge ApplicationGatewaySkuName = "Standard_Large" - // StandardMedium ... - StandardMedium ApplicationGatewaySkuName = "Standard_Medium" - // StandardSmall ... - StandardSmall ApplicationGatewaySkuName = "Standard_Small" - // StandardV2 ... - StandardV2 ApplicationGatewaySkuName = "Standard_v2" - // WAFLarge ... - WAFLarge ApplicationGatewaySkuName = "WAF_Large" - // WAFMedium ... - WAFMedium ApplicationGatewaySkuName = "WAF_Medium" - // WAFV2 ... - WAFV2 ApplicationGatewaySkuName = "WAF_v2" -) - -// PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. -func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { - return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, StandardV2, WAFLarge, WAFMedium, WAFV2} -} - -// ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. -type ApplicationGatewaySslCipherSuite string - -const ( - // TLSDHEDSSWITH3DESEDECBCSHA ... - TLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA ... - TLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA256 ... - TLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - // TLSDHEDSSWITHAES256CBCSHA ... - TLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - // TLSDHEDSSWITHAES256CBCSHA256 ... - TLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - // TLSDHERSAWITHAES128CBCSHA ... - TLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - // TLSDHERSAWITHAES128GCMSHA256 ... - TLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSDHERSAWITHAES256CBCSHA ... - TLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - // TLSDHERSAWITHAES256GCMSHA384 ... - TLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSECDHEECDSAWITHAES128CBCSHA ... - TLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - // TLSECDHEECDSAWITHAES128CBCSHA256 ... - TLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - // TLSECDHEECDSAWITHAES128GCMSHA256 ... - TLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - // TLSECDHEECDSAWITHAES256CBCSHA ... - TLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - // TLSECDHEECDSAWITHAES256CBCSHA384 ... - TLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - // TLSECDHEECDSAWITHAES256GCMSHA384 ... - TLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - // TLSECDHERSAWITHAES128CBCSHA ... - TLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - // TLSECDHERSAWITHAES128CBCSHA256 ... - TLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - // TLSECDHERSAWITHAES128GCMSHA256 ... - TLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSECDHERSAWITHAES256CBCSHA ... - TLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - // TLSECDHERSAWITHAES256CBCSHA384 ... - TLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - // TLSECDHERSAWITHAES256GCMSHA384 ... - TLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSRSAWITH3DESEDECBCSHA ... - TLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" - // TLSRSAWITHAES128CBCSHA ... - TLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - // TLSRSAWITHAES128CBCSHA256 ... - TLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - // TLSRSAWITHAES128GCMSHA256 ... - TLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - // TLSRSAWITHAES256CBCSHA ... - TLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - // TLSRSAWITHAES256CBCSHA256 ... - TLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - // TLSRSAWITHAES256GCMSHA384 ... - TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" -) - -// PossibleApplicationGatewaySslCipherSuiteValues returns an array of possible values for the ApplicationGatewaySslCipherSuite const type. -func PossibleApplicationGatewaySslCipherSuiteValues() []ApplicationGatewaySslCipherSuite { - return []ApplicationGatewaySslCipherSuite{TLSDHEDSSWITH3DESEDECBCSHA, TLSDHEDSSWITHAES128CBCSHA, TLSDHEDSSWITHAES128CBCSHA256, TLSDHEDSSWITHAES256CBCSHA, TLSDHEDSSWITHAES256CBCSHA256, TLSDHERSAWITHAES128CBCSHA, TLSDHERSAWITHAES128GCMSHA256, TLSDHERSAWITHAES256CBCSHA, TLSDHERSAWITHAES256GCMSHA384, TLSECDHEECDSAWITHAES128CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA256, TLSECDHEECDSAWITHAES128GCMSHA256, TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES256CBCSHA384, TLSECDHEECDSAWITHAES256GCMSHA384, TLSECDHERSAWITHAES128CBCSHA, TLSECDHERSAWITHAES128CBCSHA256, TLSECDHERSAWITHAES128GCMSHA256, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES256CBCSHA384, TLSECDHERSAWITHAES256GCMSHA384, TLSRSAWITH3DESEDECBCSHA, TLSRSAWITHAES128CBCSHA, TLSRSAWITHAES128CBCSHA256, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES256GCMSHA384} -} - -// ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. -type ApplicationGatewaySslPolicyName string - -const ( - // AppGwSslPolicy20150501 ... - AppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - // AppGwSslPolicy20170401 ... - AppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - // AppGwSslPolicy20170401S ... - AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" -) - -// PossibleApplicationGatewaySslPolicyNameValues returns an array of possible values for the ApplicationGatewaySslPolicyName const type. -func PossibleApplicationGatewaySslPolicyNameValues() []ApplicationGatewaySslPolicyName { - return []ApplicationGatewaySslPolicyName{AppGwSslPolicy20150501, AppGwSslPolicy20170401, AppGwSslPolicy20170401S} -} - -// ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. -type ApplicationGatewaySslPolicyType string - -const ( - // Custom ... - Custom ApplicationGatewaySslPolicyType = "Custom" - // Predefined ... - Predefined ApplicationGatewaySslPolicyType = "Predefined" -) - -// PossibleApplicationGatewaySslPolicyTypeValues returns an array of possible values for the ApplicationGatewaySslPolicyType const type. -func PossibleApplicationGatewaySslPolicyTypeValues() []ApplicationGatewaySslPolicyType { - return []ApplicationGatewaySslPolicyType{Custom, Predefined} -} - -// ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. -type ApplicationGatewaySslProtocol string - -const ( - // TLSv10 ... - TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" - // TLSv11 ... - TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" - // TLSv12 ... - TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" -) - -// PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. -func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { - return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12} -} - -// ApplicationGatewayTier enumerates the values for application gateway tier. -type ApplicationGatewayTier string - -const ( - // ApplicationGatewayTierStandard ... - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - // ApplicationGatewayTierStandardV2 ... - ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" - // ApplicationGatewayTierWAF ... - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - // ApplicationGatewayTierWAFV2 ... - ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" -) - -// PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. -func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { - return []ApplicationGatewayTier{ApplicationGatewayTierStandard, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, ApplicationGatewayTierWAFV2} -} - -// AssociationType enumerates the values for association type. -type AssociationType string - -const ( - // Associated ... - Associated AssociationType = "Associated" - // Contains ... - Contains AssociationType = "Contains" -) - -// PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. -func PossibleAssociationTypeValues() []AssociationType { - return []AssociationType{Associated, Contains} -} - -// AuthenticationMethod enumerates the values for authentication method. -type AuthenticationMethod string - -const ( - // EAPMSCHAPv2 ... - EAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" - // EAPTLS ... - EAPTLS AuthenticationMethod = "EAPTLS" -) - -// PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. -func PossibleAuthenticationMethodValues() []AuthenticationMethod { - return []AuthenticationMethod{EAPMSCHAPv2, EAPTLS} -} - -// AuthorizationUseStatus enumerates the values for authorization use status. -type AuthorizationUseStatus string - -const ( - // Available ... - Available AuthorizationUseStatus = "Available" - // InUse ... - InUse AuthorizationUseStatus = "InUse" -) - -// PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. -func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { - return []AuthorizationUseStatus{Available, InUse} -} - -// AzureFirewallApplicationRuleProtocolType enumerates the values for azure firewall application rule protocol -// type. -type AzureFirewallApplicationRuleProtocolType string - -const ( - // AzureFirewallApplicationRuleProtocolTypeHTTP ... - AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" - // AzureFirewallApplicationRuleProtocolTypeHTTPS ... - AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" -) - -// PossibleAzureFirewallApplicationRuleProtocolTypeValues returns an array of possible values for the AzureFirewallApplicationRuleProtocolType const type. -func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApplicationRuleProtocolType { - return []AzureFirewallApplicationRuleProtocolType{AzureFirewallApplicationRuleProtocolTypeHTTP, AzureFirewallApplicationRuleProtocolTypeHTTPS} -} - -// AzureFirewallNatRCActionType enumerates the values for azure firewall nat rc action type. -type AzureFirewallNatRCActionType string - -const ( - // Dnat ... - Dnat AzureFirewallNatRCActionType = "Dnat" - // Snat ... - Snat AzureFirewallNatRCActionType = "Snat" -) - -// PossibleAzureFirewallNatRCActionTypeValues returns an array of possible values for the AzureFirewallNatRCActionType const type. -func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { - return []AzureFirewallNatRCActionType{Dnat, Snat} -} - -// AzureFirewallNetworkRuleProtocol enumerates the values for azure firewall network rule protocol. -type AzureFirewallNetworkRuleProtocol string - -const ( - // Any ... - Any AzureFirewallNetworkRuleProtocol = "Any" - // ICMP ... - ICMP AzureFirewallNetworkRuleProtocol = "ICMP" - // TCP ... - TCP AzureFirewallNetworkRuleProtocol = "TCP" - // UDP ... - UDP AzureFirewallNetworkRuleProtocol = "UDP" -) - -// PossibleAzureFirewallNetworkRuleProtocolValues returns an array of possible values for the AzureFirewallNetworkRuleProtocol const type. -func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { - return []AzureFirewallNetworkRuleProtocol{Any, ICMP, TCP, UDP} -} - -// AzureFirewallRCActionType enumerates the values for azure firewall rc action type. -type AzureFirewallRCActionType string - -const ( - // AzureFirewallRCActionTypeAllow ... - AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" - // AzureFirewallRCActionTypeDeny ... - AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" -) - -// PossibleAzureFirewallRCActionTypeValues returns an array of possible values for the AzureFirewallRCActionType const type. -func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { - return []AzureFirewallRCActionType{AzureFirewallRCActionTypeAllow, AzureFirewallRCActionTypeDeny} -} - -// AzureFirewallThreatIntelMode enumerates the values for azure firewall threat intel mode. -type AzureFirewallThreatIntelMode string - -const ( - // AzureFirewallThreatIntelModeAlert ... - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - // AzureFirewallThreatIntelModeDeny ... - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - // AzureFirewallThreatIntelModeOff ... - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -// PossibleAzureFirewallThreatIntelModeValues returns an array of possible values for the AzureFirewallThreatIntelMode const type. -func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode { - return []AzureFirewallThreatIntelMode{AzureFirewallThreatIntelModeAlert, AzureFirewallThreatIntelModeDeny, AzureFirewallThreatIntelModeOff} -} - -// BgpPeerState enumerates the values for bgp peer state. -type BgpPeerState string - -const ( - // BgpPeerStateConnected ... - BgpPeerStateConnected BgpPeerState = "Connected" - // BgpPeerStateConnecting ... - BgpPeerStateConnecting BgpPeerState = "Connecting" - // BgpPeerStateIdle ... - BgpPeerStateIdle BgpPeerState = "Idle" - // BgpPeerStateStopped ... - BgpPeerStateStopped BgpPeerState = "Stopped" - // BgpPeerStateUnknown ... - BgpPeerStateUnknown BgpPeerState = "Unknown" -) - -// PossibleBgpPeerStateValues returns an array of possible values for the BgpPeerState const type. -func PossibleBgpPeerStateValues() []BgpPeerState { - return []BgpPeerState{BgpPeerStateConnected, BgpPeerStateConnecting, BgpPeerStateIdle, BgpPeerStateStopped, BgpPeerStateUnknown} -} - -// CircuitConnectionStatus enumerates the values for circuit connection status. -type CircuitConnectionStatus string - -const ( - // Connected ... - Connected CircuitConnectionStatus = "Connected" - // Connecting ... - Connecting CircuitConnectionStatus = "Connecting" - // Disconnected ... - Disconnected CircuitConnectionStatus = "Disconnected" -) - -// PossibleCircuitConnectionStatusValues returns an array of possible values for the CircuitConnectionStatus const type. -func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { - return []CircuitConnectionStatus{Connected, Connecting, Disconnected} -} - -// ConnectionMonitorSourceStatus enumerates the values for connection monitor source status. -type ConnectionMonitorSourceStatus string - -const ( - // ConnectionMonitorSourceStatusActive ... - ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" - // ConnectionMonitorSourceStatusInactive ... - ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" - // ConnectionMonitorSourceStatusUnknown ... - ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" -) - -// PossibleConnectionMonitorSourceStatusValues returns an array of possible values for the ConnectionMonitorSourceStatus const type. -func PossibleConnectionMonitorSourceStatusValues() []ConnectionMonitorSourceStatus { - return []ConnectionMonitorSourceStatus{ConnectionMonitorSourceStatusActive, ConnectionMonitorSourceStatusInactive, ConnectionMonitorSourceStatusUnknown} -} - -// ConnectionState enumerates the values for connection state. -type ConnectionState string - -const ( - // ConnectionStateReachable ... - ConnectionStateReachable ConnectionState = "Reachable" - // ConnectionStateUnknown ... - ConnectionStateUnknown ConnectionState = "Unknown" - // ConnectionStateUnreachable ... - ConnectionStateUnreachable ConnectionState = "Unreachable" -) - -// PossibleConnectionStateValues returns an array of possible values for the ConnectionState const type. -func PossibleConnectionStateValues() []ConnectionState { - return []ConnectionState{ConnectionStateReachable, ConnectionStateUnknown, ConnectionStateUnreachable} -} - -// ConnectionStatus enumerates the values for connection status. -type ConnectionStatus string - -const ( - // ConnectionStatusConnected ... - ConnectionStatusConnected ConnectionStatus = "Connected" - // ConnectionStatusDegraded ... - ConnectionStatusDegraded ConnectionStatus = "Degraded" - // ConnectionStatusDisconnected ... - ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - // ConnectionStatusUnknown ... - ConnectionStatusUnknown ConnectionStatus = "Unknown" -) - -// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. -func PossibleConnectionStatusValues() []ConnectionStatus { - return []ConnectionStatus{ConnectionStatusConnected, ConnectionStatusDegraded, ConnectionStatusDisconnected, ConnectionStatusUnknown} -} - -// DdosCustomPolicyProtocol enumerates the values for ddos custom policy protocol. -type DdosCustomPolicyProtocol string - -const ( - // DdosCustomPolicyProtocolSyn ... - DdosCustomPolicyProtocolSyn DdosCustomPolicyProtocol = "Syn" - // DdosCustomPolicyProtocolTCP ... - DdosCustomPolicyProtocolTCP DdosCustomPolicyProtocol = "Tcp" - // DdosCustomPolicyProtocolUDP ... - DdosCustomPolicyProtocolUDP DdosCustomPolicyProtocol = "Udp" -) - -// PossibleDdosCustomPolicyProtocolValues returns an array of possible values for the DdosCustomPolicyProtocol const type. -func PossibleDdosCustomPolicyProtocolValues() []DdosCustomPolicyProtocol { - return []DdosCustomPolicyProtocol{DdosCustomPolicyProtocolSyn, DdosCustomPolicyProtocolTCP, DdosCustomPolicyProtocolUDP} -} - -// DdosCustomPolicyTriggerSensitivityOverride enumerates the values for ddos custom policy trigger sensitivity -// override. -type DdosCustomPolicyTriggerSensitivityOverride string - -const ( - // Default ... - Default DdosCustomPolicyTriggerSensitivityOverride = "Default" - // High ... - High DdosCustomPolicyTriggerSensitivityOverride = "High" - // Low ... - Low DdosCustomPolicyTriggerSensitivityOverride = "Low" - // Relaxed ... - Relaxed DdosCustomPolicyTriggerSensitivityOverride = "Relaxed" -) - -// PossibleDdosCustomPolicyTriggerSensitivityOverrideValues returns an array of possible values for the DdosCustomPolicyTriggerSensitivityOverride const type. -func PossibleDdosCustomPolicyTriggerSensitivityOverrideValues() []DdosCustomPolicyTriggerSensitivityOverride { - return []DdosCustomPolicyTriggerSensitivityOverride{Default, High, Low, Relaxed} -} - -// DdosSettingsProtectionCoverage enumerates the values for ddos settings protection coverage. -type DdosSettingsProtectionCoverage string - -const ( - // DdosSettingsProtectionCoverageBasic ... - DdosSettingsProtectionCoverageBasic DdosSettingsProtectionCoverage = "Basic" - // DdosSettingsProtectionCoverageStandard ... - DdosSettingsProtectionCoverageStandard DdosSettingsProtectionCoverage = "Standard" -) - -// PossibleDdosSettingsProtectionCoverageValues returns an array of possible values for the DdosSettingsProtectionCoverage const type. -func PossibleDdosSettingsProtectionCoverageValues() []DdosSettingsProtectionCoverage { - return []DdosSettingsProtectionCoverage{DdosSettingsProtectionCoverageBasic, DdosSettingsProtectionCoverageStandard} -} - -// DhGroup enumerates the values for dh group. -type DhGroup string - -const ( - // DHGroup1 ... - DHGroup1 DhGroup = "DHGroup1" - // DHGroup14 ... - DHGroup14 DhGroup = "DHGroup14" - // DHGroup2 ... - DHGroup2 DhGroup = "DHGroup2" - // DHGroup2048 ... - DHGroup2048 DhGroup = "DHGroup2048" - // DHGroup24 ... - DHGroup24 DhGroup = "DHGroup24" - // ECP256 ... - ECP256 DhGroup = "ECP256" - // ECP384 ... - ECP384 DhGroup = "ECP384" - // None ... - None DhGroup = "None" -) - -// PossibleDhGroupValues returns an array of possible values for the DhGroup const type. -func PossibleDhGroupValues() []DhGroup { - return []DhGroup{DHGroup1, DHGroup14, DHGroup2, DHGroup2048, DHGroup24, ECP256, ECP384, None} -} - -// Direction enumerates the values for direction. -type Direction string - -const ( - // Inbound ... - Inbound Direction = "Inbound" - // Outbound ... - Outbound Direction = "Outbound" -) - -// PossibleDirectionValues returns an array of possible values for the Direction const type. -func PossibleDirectionValues() []Direction { - return []Direction{Inbound, Outbound} -} - -// EffectiveRouteSource enumerates the values for effective route source. -type EffectiveRouteSource string - -const ( - // EffectiveRouteSourceDefault ... - EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - // EffectiveRouteSourceUnknown ... - EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - // EffectiveRouteSourceUser ... - EffectiveRouteSourceUser EffectiveRouteSource = "User" - // EffectiveRouteSourceVirtualNetworkGateway ... - EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" -) - -// PossibleEffectiveRouteSourceValues returns an array of possible values for the EffectiveRouteSource const type. -func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { - return []EffectiveRouteSource{EffectiveRouteSourceDefault, EffectiveRouteSourceUnknown, EffectiveRouteSourceUser, EffectiveRouteSourceVirtualNetworkGateway} -} - -// EffectiveRouteState enumerates the values for effective route state. -type EffectiveRouteState string - -const ( - // Active ... - Active EffectiveRouteState = "Active" - // Invalid ... - Invalid EffectiveRouteState = "Invalid" -) - -// PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. -func PossibleEffectiveRouteStateValues() []EffectiveRouteState { - return []EffectiveRouteState{Active, Invalid} -} - -// EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. -type EffectiveSecurityRuleProtocol string - -const ( - // EffectiveSecurityRuleProtocolAll ... - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - // EffectiveSecurityRuleProtocolTCP ... - EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" - // EffectiveSecurityRuleProtocolUDP ... - EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" -) - -// PossibleEffectiveSecurityRuleProtocolValues returns an array of possible values for the EffectiveSecurityRuleProtocol const type. -func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { - return []EffectiveSecurityRuleProtocol{EffectiveSecurityRuleProtocolAll, EffectiveSecurityRuleProtocolTCP, EffectiveSecurityRuleProtocolUDP} -} - -// EvaluationState enumerates the values for evaluation state. -type EvaluationState string - -const ( - // Completed ... - Completed EvaluationState = "Completed" - // InProgress ... - InProgress EvaluationState = "InProgress" - // NotStarted ... - NotStarted EvaluationState = "NotStarted" -) - -// PossibleEvaluationStateValues returns an array of possible values for the EvaluationState const type. -func PossibleEvaluationStateValues() []EvaluationState { - return []EvaluationState{Completed, InProgress, NotStarted} -} - -// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit -// peering advertised public prefix state. -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - // Configured ... - Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - // Configuring ... - Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - // NotConfigured ... - NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - // ValidationNeeded ... - ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. -func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { - return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} -} - -// ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. -type ExpressRouteCircuitPeeringState string - -const ( - // ExpressRouteCircuitPeeringStateDisabled ... - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - // ExpressRouteCircuitPeeringStateEnabled ... - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -// PossibleExpressRouteCircuitPeeringStateValues returns an array of possible values for the ExpressRouteCircuitPeeringState const type. -func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { - return []ExpressRouteCircuitPeeringState{ExpressRouteCircuitPeeringStateDisabled, ExpressRouteCircuitPeeringStateEnabled} -} - -// ExpressRouteCircuitSkuFamily enumerates the values for express route circuit sku family. -type ExpressRouteCircuitSkuFamily string - -const ( - // MeteredData ... - MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" - // UnlimitedData ... - UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" -) - -// PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. -func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { - return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} -} - -// ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. -type ExpressRouteCircuitSkuTier string - -const ( - // ExpressRouteCircuitSkuTierBasic ... - ExpressRouteCircuitSkuTierBasic ExpressRouteCircuitSkuTier = "Basic" - // ExpressRouteCircuitSkuTierLocal ... - ExpressRouteCircuitSkuTierLocal ExpressRouteCircuitSkuTier = "Local" - // ExpressRouteCircuitSkuTierPremium ... - ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" - // ExpressRouteCircuitSkuTierStandard ... - ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" -) - -// PossibleExpressRouteCircuitSkuTierValues returns an array of possible values for the ExpressRouteCircuitSkuTier const type. -func PossibleExpressRouteCircuitSkuTierValues() []ExpressRouteCircuitSkuTier { - return []ExpressRouteCircuitSkuTier{ExpressRouteCircuitSkuTierBasic, ExpressRouteCircuitSkuTierLocal, ExpressRouteCircuitSkuTierPremium, ExpressRouteCircuitSkuTierStandard} -} - -// ExpressRouteLinkAdminState enumerates the values for express route link admin state. -type ExpressRouteLinkAdminState string - -const ( - // ExpressRouteLinkAdminStateDisabled ... - ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - // ExpressRouteLinkAdminStateEnabled ... - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" -) - -// PossibleExpressRouteLinkAdminStateValues returns an array of possible values for the ExpressRouteLinkAdminState const type. -func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { - return []ExpressRouteLinkAdminState{ExpressRouteLinkAdminStateDisabled, ExpressRouteLinkAdminStateEnabled} -} - -// ExpressRouteLinkConnectorType enumerates the values for express route link connector type. -type ExpressRouteLinkConnectorType string - -const ( - // LC ... - LC ExpressRouteLinkConnectorType = "LC" - // SC ... - SC ExpressRouteLinkConnectorType = "SC" -) - -// PossibleExpressRouteLinkConnectorTypeValues returns an array of possible values for the ExpressRouteLinkConnectorType const type. -func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { - return []ExpressRouteLinkConnectorType{LC, SC} -} - -// ExpressRoutePeeringState enumerates the values for express route peering state. -type ExpressRoutePeeringState string - -const ( - // ExpressRoutePeeringStateDisabled ... - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - // ExpressRoutePeeringStateEnabled ... - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -// PossibleExpressRoutePeeringStateValues returns an array of possible values for the ExpressRoutePeeringState const type. -func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { - return []ExpressRoutePeeringState{ExpressRoutePeeringStateDisabled, ExpressRoutePeeringStateEnabled} -} - -// ExpressRoutePeeringType enumerates the values for express route peering type. -type ExpressRoutePeeringType string - -const ( - // AzurePrivatePeering ... - AzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - // AzurePublicPeering ... - AzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - // MicrosoftPeering ... - MicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -// PossibleExpressRoutePeeringTypeValues returns an array of possible values for the ExpressRoutePeeringType const type. -func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { - return []ExpressRoutePeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} -} - -// ExpressRoutePortsEncapsulation enumerates the values for express route ports encapsulation. -type ExpressRoutePortsEncapsulation string - -const ( - // Dot1Q ... - Dot1Q ExpressRoutePortsEncapsulation = "Dot1Q" - // QinQ ... - QinQ ExpressRoutePortsEncapsulation = "QinQ" -) - -// PossibleExpressRoutePortsEncapsulationValues returns an array of possible values for the ExpressRoutePortsEncapsulation const type. -func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { - return []ExpressRoutePortsEncapsulation{Dot1Q, QinQ} -} - -// FirewallPolicyFilterRuleActionType enumerates the values for firewall policy filter rule action type. -type FirewallPolicyFilterRuleActionType string - -const ( - // FirewallPolicyFilterRuleActionTypeAlert ... - FirewallPolicyFilterRuleActionTypeAlert FirewallPolicyFilterRuleActionType = "Alert " - // FirewallPolicyFilterRuleActionTypeAllow ... - FirewallPolicyFilterRuleActionTypeAllow FirewallPolicyFilterRuleActionType = "Allow" - // FirewallPolicyFilterRuleActionTypeDeny ... - FirewallPolicyFilterRuleActionTypeDeny FirewallPolicyFilterRuleActionType = "Deny" -) - -// PossibleFirewallPolicyFilterRuleActionTypeValues returns an array of possible values for the FirewallPolicyFilterRuleActionType const type. -func PossibleFirewallPolicyFilterRuleActionTypeValues() []FirewallPolicyFilterRuleActionType { - return []FirewallPolicyFilterRuleActionType{FirewallPolicyFilterRuleActionTypeAlert, FirewallPolicyFilterRuleActionTypeAllow, FirewallPolicyFilterRuleActionTypeDeny} -} - -// FirewallPolicyNatRuleActionType enumerates the values for firewall policy nat rule action type. -type FirewallPolicyNatRuleActionType string - -const ( - // DNAT ... - DNAT FirewallPolicyNatRuleActionType = "DNAT" - // SNAT ... - SNAT FirewallPolicyNatRuleActionType = "SNAT" -) - -// PossibleFirewallPolicyNatRuleActionTypeValues returns an array of possible values for the FirewallPolicyNatRuleActionType const type. -func PossibleFirewallPolicyNatRuleActionTypeValues() []FirewallPolicyNatRuleActionType { - return []FirewallPolicyNatRuleActionType{DNAT, SNAT} -} - -// FirewallPolicyRuleConditionApplicationProtocolType enumerates the values for firewall policy rule condition -// application protocol type. -type FirewallPolicyRuleConditionApplicationProtocolType string - -const ( - // FirewallPolicyRuleConditionApplicationProtocolTypeHTTP ... - FirewallPolicyRuleConditionApplicationProtocolTypeHTTP FirewallPolicyRuleConditionApplicationProtocolType = "Http" - // FirewallPolicyRuleConditionApplicationProtocolTypeHTTPS ... - FirewallPolicyRuleConditionApplicationProtocolTypeHTTPS FirewallPolicyRuleConditionApplicationProtocolType = "Https" -) - -// PossibleFirewallPolicyRuleConditionApplicationProtocolTypeValues returns an array of possible values for the FirewallPolicyRuleConditionApplicationProtocolType const type. -func PossibleFirewallPolicyRuleConditionApplicationProtocolTypeValues() []FirewallPolicyRuleConditionApplicationProtocolType { - return []FirewallPolicyRuleConditionApplicationProtocolType{FirewallPolicyRuleConditionApplicationProtocolTypeHTTP, FirewallPolicyRuleConditionApplicationProtocolTypeHTTPS} -} - -// FirewallPolicyRuleConditionNetworkProtocol enumerates the values for firewall policy rule condition network -// protocol. -type FirewallPolicyRuleConditionNetworkProtocol string - -const ( - // FirewallPolicyRuleConditionNetworkProtocolAny ... - FirewallPolicyRuleConditionNetworkProtocolAny FirewallPolicyRuleConditionNetworkProtocol = "Any" - // FirewallPolicyRuleConditionNetworkProtocolICMP ... - FirewallPolicyRuleConditionNetworkProtocolICMP FirewallPolicyRuleConditionNetworkProtocol = "ICMP" - // FirewallPolicyRuleConditionNetworkProtocolTCP ... - FirewallPolicyRuleConditionNetworkProtocolTCP FirewallPolicyRuleConditionNetworkProtocol = "TCP" - // FirewallPolicyRuleConditionNetworkProtocolUDP ... - FirewallPolicyRuleConditionNetworkProtocolUDP FirewallPolicyRuleConditionNetworkProtocol = "UDP" -) - -// PossibleFirewallPolicyRuleConditionNetworkProtocolValues returns an array of possible values for the FirewallPolicyRuleConditionNetworkProtocol const type. -func PossibleFirewallPolicyRuleConditionNetworkProtocolValues() []FirewallPolicyRuleConditionNetworkProtocol { - return []FirewallPolicyRuleConditionNetworkProtocol{FirewallPolicyRuleConditionNetworkProtocolAny, FirewallPolicyRuleConditionNetworkProtocolICMP, FirewallPolicyRuleConditionNetworkProtocolTCP, FirewallPolicyRuleConditionNetworkProtocolUDP} -} - -// FlowLogFormatType enumerates the values for flow log format type. -type FlowLogFormatType string - -const ( - // JSON ... - JSON FlowLogFormatType = "JSON" -) - -// PossibleFlowLogFormatTypeValues returns an array of possible values for the FlowLogFormatType const type. -func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { - return []FlowLogFormatType{JSON} -} - -// HTTPMethod enumerates the values for http method. -type HTTPMethod string - -const ( - // Get ... - Get HTTPMethod = "Get" -) - -// PossibleHTTPMethodValues returns an array of possible values for the HTTPMethod const type. -func PossibleHTTPMethodValues() []HTTPMethod { - return []HTTPMethod{Get} -} - -// HubVirtualNetworkConnectionStatus enumerates the values for hub virtual network connection status. -type HubVirtualNetworkConnectionStatus string - -const ( - // HubVirtualNetworkConnectionStatusConnected ... - HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" - // HubVirtualNetworkConnectionStatusConnecting ... - HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" - // HubVirtualNetworkConnectionStatusNotConnected ... - HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" - // HubVirtualNetworkConnectionStatusUnknown ... - HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" -) - -// PossibleHubVirtualNetworkConnectionStatusValues returns an array of possible values for the HubVirtualNetworkConnectionStatus const type. -func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { - return []HubVirtualNetworkConnectionStatus{HubVirtualNetworkConnectionStatusConnected, HubVirtualNetworkConnectionStatusConnecting, HubVirtualNetworkConnectionStatusNotConnected, HubVirtualNetworkConnectionStatusUnknown} -} - -// IkeEncryption enumerates the values for ike encryption. -type IkeEncryption string - -const ( - // AES128 ... - AES128 IkeEncryption = "AES128" - // AES192 ... - AES192 IkeEncryption = "AES192" - // AES256 ... - AES256 IkeEncryption = "AES256" - // DES ... - DES IkeEncryption = "DES" - // DES3 ... - DES3 IkeEncryption = "DES3" - // GCMAES128 ... - GCMAES128 IkeEncryption = "GCMAES128" - // GCMAES256 ... - GCMAES256 IkeEncryption = "GCMAES256" -) - -// PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. -func PossibleIkeEncryptionValues() []IkeEncryption { - return []IkeEncryption{AES128, AES192, AES256, DES, DES3, GCMAES128, GCMAES256} -} - -// IkeIntegrity enumerates the values for ike integrity. -type IkeIntegrity string - -const ( - // IkeIntegrityGCMAES128 ... - IkeIntegrityGCMAES128 IkeIntegrity = "GCMAES128" - // IkeIntegrityGCMAES256 ... - IkeIntegrityGCMAES256 IkeIntegrity = "GCMAES256" - // IkeIntegrityMD5 ... - IkeIntegrityMD5 IkeIntegrity = "MD5" - // IkeIntegritySHA1 ... - IkeIntegritySHA1 IkeIntegrity = "SHA1" - // IkeIntegritySHA256 ... - IkeIntegritySHA256 IkeIntegrity = "SHA256" - // IkeIntegritySHA384 ... - IkeIntegritySHA384 IkeIntegrity = "SHA384" -) - -// PossibleIkeIntegrityValues returns an array of possible values for the IkeIntegrity const type. -func PossibleIkeIntegrityValues() []IkeIntegrity { - return []IkeIntegrity{IkeIntegrityGCMAES128, IkeIntegrityGCMAES256, IkeIntegrityMD5, IkeIntegritySHA1, IkeIntegritySHA256, IkeIntegritySHA384} -} - -// IPAllocationMethod enumerates the values for ip allocation method. -type IPAllocationMethod string - -const ( - // Dynamic ... - Dynamic IPAllocationMethod = "Dynamic" - // Static ... - Static IPAllocationMethod = "Static" -) - -// PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. -func PossibleIPAllocationMethodValues() []IPAllocationMethod { - return []IPAllocationMethod{Dynamic, Static} -} - -// IPFlowProtocol enumerates the values for ip flow protocol. -type IPFlowProtocol string - -const ( - // IPFlowProtocolTCP ... - IPFlowProtocolTCP IPFlowProtocol = "TCP" - // IPFlowProtocolUDP ... - IPFlowProtocolUDP IPFlowProtocol = "UDP" -) - -// PossibleIPFlowProtocolValues returns an array of possible values for the IPFlowProtocol const type. -func PossibleIPFlowProtocolValues() []IPFlowProtocol { - return []IPFlowProtocol{IPFlowProtocolTCP, IPFlowProtocolUDP} -} - -// IpsecEncryption enumerates the values for ipsec encryption. -type IpsecEncryption string - -const ( - // IpsecEncryptionAES128 ... - IpsecEncryptionAES128 IpsecEncryption = "AES128" - // IpsecEncryptionAES192 ... - IpsecEncryptionAES192 IpsecEncryption = "AES192" - // IpsecEncryptionAES256 ... - IpsecEncryptionAES256 IpsecEncryption = "AES256" - // IpsecEncryptionDES ... - IpsecEncryptionDES IpsecEncryption = "DES" - // IpsecEncryptionDES3 ... - IpsecEncryptionDES3 IpsecEncryption = "DES3" - // IpsecEncryptionGCMAES128 ... - IpsecEncryptionGCMAES128 IpsecEncryption = "GCMAES128" - // IpsecEncryptionGCMAES192 ... - IpsecEncryptionGCMAES192 IpsecEncryption = "GCMAES192" - // IpsecEncryptionGCMAES256 ... - IpsecEncryptionGCMAES256 IpsecEncryption = "GCMAES256" - // IpsecEncryptionNone ... - IpsecEncryptionNone IpsecEncryption = "None" -) - -// PossibleIpsecEncryptionValues returns an array of possible values for the IpsecEncryption const type. -func PossibleIpsecEncryptionValues() []IpsecEncryption { - return []IpsecEncryption{IpsecEncryptionAES128, IpsecEncryptionAES192, IpsecEncryptionAES256, IpsecEncryptionDES, IpsecEncryptionDES3, IpsecEncryptionGCMAES128, IpsecEncryptionGCMAES192, IpsecEncryptionGCMAES256, IpsecEncryptionNone} -} - -// IpsecIntegrity enumerates the values for ipsec integrity. -type IpsecIntegrity string - -const ( - // IpsecIntegrityGCMAES128 ... - IpsecIntegrityGCMAES128 IpsecIntegrity = "GCMAES128" - // IpsecIntegrityGCMAES192 ... - IpsecIntegrityGCMAES192 IpsecIntegrity = "GCMAES192" - // IpsecIntegrityGCMAES256 ... - IpsecIntegrityGCMAES256 IpsecIntegrity = "GCMAES256" - // IpsecIntegrityMD5 ... - IpsecIntegrityMD5 IpsecIntegrity = "MD5" - // IpsecIntegritySHA1 ... - IpsecIntegritySHA1 IpsecIntegrity = "SHA1" - // IpsecIntegritySHA256 ... - IpsecIntegritySHA256 IpsecIntegrity = "SHA256" -) - -// PossibleIpsecIntegrityValues returns an array of possible values for the IpsecIntegrity const type. -func PossibleIpsecIntegrityValues() []IpsecIntegrity { - return []IpsecIntegrity{IpsecIntegrityGCMAES128, IpsecIntegrityGCMAES192, IpsecIntegrityGCMAES256, IpsecIntegrityMD5, IpsecIntegritySHA1, IpsecIntegritySHA256} -} - -// IPVersion enumerates the values for ip version. -type IPVersion string - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// IssueType enumerates the values for issue type. -type IssueType string - -const ( - // IssueTypeAgentStopped ... - IssueTypeAgentStopped IssueType = "AgentStopped" - // IssueTypeDNSResolution ... - IssueTypeDNSResolution IssueType = "DnsResolution" - // IssueTypeGuestFirewall ... - IssueTypeGuestFirewall IssueType = "GuestFirewall" - // IssueTypeNetworkSecurityRule ... - IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - // IssueTypePlatform ... - IssueTypePlatform IssueType = "Platform" - // IssueTypePortThrottled ... - IssueTypePortThrottled IssueType = "PortThrottled" - // IssueTypeSocketBind ... - IssueTypeSocketBind IssueType = "SocketBind" - // IssueTypeUnknown ... - IssueTypeUnknown IssueType = "Unknown" - // IssueTypeUserDefinedRoute ... - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" -) - -// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. -func PossibleIssueTypeValues() []IssueType { - return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} -} - -// LoadBalancerOutboundRuleProtocol enumerates the values for load balancer outbound rule protocol. -type LoadBalancerOutboundRuleProtocol string - -const ( - // LoadBalancerOutboundRuleProtocolAll ... - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - // LoadBalancerOutboundRuleProtocolTCP ... - LoadBalancerOutboundRuleProtocolTCP LoadBalancerOutboundRuleProtocol = "Tcp" - // LoadBalancerOutboundRuleProtocolUDP ... - LoadBalancerOutboundRuleProtocolUDP LoadBalancerOutboundRuleProtocol = "Udp" -) - -// PossibleLoadBalancerOutboundRuleProtocolValues returns an array of possible values for the LoadBalancerOutboundRuleProtocol const type. -func PossibleLoadBalancerOutboundRuleProtocolValues() []LoadBalancerOutboundRuleProtocol { - return []LoadBalancerOutboundRuleProtocol{LoadBalancerOutboundRuleProtocolAll, LoadBalancerOutboundRuleProtocolTCP, LoadBalancerOutboundRuleProtocolUDP} -} - -// LoadBalancerSkuName enumerates the values for load balancer sku name. -type LoadBalancerSkuName string - -const ( - // LoadBalancerSkuNameBasic ... - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - // LoadBalancerSkuNameStandard ... - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -// PossibleLoadBalancerSkuNameValues returns an array of possible values for the LoadBalancerSkuName const type. -func PossibleLoadBalancerSkuNameValues() []LoadBalancerSkuName { - return []LoadBalancerSkuName{LoadBalancerSkuNameBasic, LoadBalancerSkuNameStandard} -} - -// LoadDistribution enumerates the values for load distribution. -type LoadDistribution string - -const ( - // LoadDistributionDefault ... - LoadDistributionDefault LoadDistribution = "Default" - // LoadDistributionSourceIP ... - LoadDistributionSourceIP LoadDistribution = "SourceIP" - // LoadDistributionSourceIPProtocol ... - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -// PossibleLoadDistributionValues returns an array of possible values for the LoadDistribution const type. -func PossibleLoadDistributionValues() []LoadDistribution { - return []LoadDistribution{LoadDistributionDefault, LoadDistributionSourceIP, LoadDistributionSourceIPProtocol} -} - -// NatGatewaySkuName enumerates the values for nat gateway sku name. -type NatGatewaySkuName string - -const ( - // Standard ... - Standard NatGatewaySkuName = "Standard" -) - -// PossibleNatGatewaySkuNameValues returns an array of possible values for the NatGatewaySkuName const type. -func PossibleNatGatewaySkuNameValues() []NatGatewaySkuName { - return []NatGatewaySkuName{Standard} -} - -// NextHopType enumerates the values for next hop type. -type NextHopType string - -const ( - // NextHopTypeHyperNetGateway ... - NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" - // NextHopTypeInternet ... - NextHopTypeInternet NextHopType = "Internet" - // NextHopTypeNone ... - NextHopTypeNone NextHopType = "None" - // NextHopTypeVirtualAppliance ... - NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" - // NextHopTypeVirtualNetworkGateway ... - NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" - // NextHopTypeVnetLocal ... - NextHopTypeVnetLocal NextHopType = "VnetLocal" -) - -// PossibleNextHopTypeValues returns an array of possible values for the NextHopType const type. -func PossibleNextHopTypeValues() []NextHopType { - return []NextHopType{NextHopTypeHyperNetGateway, NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal} -} - -// OfficeTrafficCategory enumerates the values for office traffic category. -type OfficeTrafficCategory string - -const ( - // OfficeTrafficCategoryAll ... - OfficeTrafficCategoryAll OfficeTrafficCategory = "All" - // OfficeTrafficCategoryNone ... - OfficeTrafficCategoryNone OfficeTrafficCategory = "None" - // OfficeTrafficCategoryOptimize ... - OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" - // OfficeTrafficCategoryOptimizeAndAllow ... - OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" -) - -// PossibleOfficeTrafficCategoryValues returns an array of possible values for the OfficeTrafficCategory const type. -func PossibleOfficeTrafficCategoryValues() []OfficeTrafficCategory { - return []OfficeTrafficCategory{OfficeTrafficCategoryAll, OfficeTrafficCategoryNone, OfficeTrafficCategoryOptimize, OfficeTrafficCategoryOptimizeAndAllow} -} - -// OperationStatus enumerates the values for operation status. -type OperationStatus string - -const ( - // OperationStatusFailed ... - OperationStatusFailed OperationStatus = "Failed" - // OperationStatusInProgress ... - OperationStatusInProgress OperationStatus = "InProgress" - // OperationStatusSucceeded ... - OperationStatusSucceeded OperationStatus = "Succeeded" -) - -// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. -func PossibleOperationStatusValues() []OperationStatus { - return []OperationStatus{OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} -} - -// Origin enumerates the values for origin. -type Origin string - -const ( - // OriginInbound ... - OriginInbound Origin = "Inbound" - // OriginLocal ... - OriginLocal Origin = "Local" - // OriginOutbound ... - OriginOutbound Origin = "Outbound" -) - -// PossibleOriginValues returns an array of possible values for the Origin const type. -func PossibleOriginValues() []Origin { - return []Origin{OriginInbound, OriginLocal, OriginOutbound} -} - -// PcError enumerates the values for pc error. -type PcError string - -const ( - // AgentStopped ... - AgentStopped PcError = "AgentStopped" - // CaptureFailed ... - CaptureFailed PcError = "CaptureFailed" - // InternalError ... - InternalError PcError = "InternalError" - // LocalFileFailed ... - LocalFileFailed PcError = "LocalFileFailed" - // StorageFailed ... - StorageFailed PcError = "StorageFailed" -) - -// PossiblePcErrorValues returns an array of possible values for the PcError const type. -func PossiblePcErrorValues() []PcError { - return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} -} - -// PcProtocol enumerates the values for pc protocol. -type PcProtocol string - -const ( - // PcProtocolAny ... - PcProtocolAny PcProtocol = "Any" - // PcProtocolTCP ... - PcProtocolTCP PcProtocol = "TCP" - // PcProtocolUDP ... - PcProtocolUDP PcProtocol = "UDP" -) - -// PossiblePcProtocolValues returns an array of possible values for the PcProtocol const type. -func PossiblePcProtocolValues() []PcProtocol { - return []PcProtocol{PcProtocolAny, PcProtocolTCP, PcProtocolUDP} -} - -// PcStatus enumerates the values for pc status. -type PcStatus string - -const ( - // PcStatusError ... - PcStatusError PcStatus = "Error" - // PcStatusNotStarted ... - PcStatusNotStarted PcStatus = "NotStarted" - // PcStatusRunning ... - PcStatusRunning PcStatus = "Running" - // PcStatusStopped ... - PcStatusStopped PcStatus = "Stopped" - // PcStatusUnknown ... - PcStatusUnknown PcStatus = "Unknown" -) - -// PossiblePcStatusValues returns an array of possible values for the PcStatus const type. -func PossiblePcStatusValues() []PcStatus { - return []PcStatus{PcStatusError, PcStatusNotStarted, PcStatusRunning, PcStatusStopped, PcStatusUnknown} -} - -// PfsGroup enumerates the values for pfs group. -type PfsGroup string - -const ( - // PfsGroupECP256 ... - PfsGroupECP256 PfsGroup = "ECP256" - // PfsGroupECP384 ... - PfsGroupECP384 PfsGroup = "ECP384" - // PfsGroupNone ... - PfsGroupNone PfsGroup = "None" - // PfsGroupPFS1 ... - PfsGroupPFS1 PfsGroup = "PFS1" - // PfsGroupPFS14 ... - PfsGroupPFS14 PfsGroup = "PFS14" - // PfsGroupPFS2 ... - PfsGroupPFS2 PfsGroup = "PFS2" - // PfsGroupPFS2048 ... - PfsGroupPFS2048 PfsGroup = "PFS2048" - // PfsGroupPFS24 ... - PfsGroupPFS24 PfsGroup = "PFS24" - // PfsGroupPFSMM ... - PfsGroupPFSMM PfsGroup = "PFSMM" -) - -// PossiblePfsGroupValues returns an array of possible values for the PfsGroup const type. -func PossiblePfsGroupValues() []PfsGroup { - return []PfsGroup{PfsGroupECP256, PfsGroupECP384, PfsGroupNone, PfsGroupPFS1, PfsGroupPFS14, PfsGroupPFS2, PfsGroupPFS2048, PfsGroupPFS24, PfsGroupPFSMM} -} - -// ProbeProtocol enumerates the values for probe protocol. -type ProbeProtocol string - -const ( - // ProbeProtocolHTTP ... - ProbeProtocolHTTP ProbeProtocol = "Http" - // ProbeProtocolHTTPS ... - ProbeProtocolHTTPS ProbeProtocol = "Https" - // ProbeProtocolTCP ... - ProbeProtocolTCP ProbeProtocol = "Tcp" -) - -// PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. -func PossibleProbeProtocolValues() []ProbeProtocol { - return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolTCP} -} - -// ProcessorArchitecture enumerates the values for processor architecture. -type ProcessorArchitecture string - -const ( - // Amd64 ... - Amd64 ProcessorArchitecture = "Amd64" - // X86 ... - X86 ProcessorArchitecture = "X86" -) - -// PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. -func PossibleProcessorArchitectureValues() []ProcessorArchitecture { - return []ProcessorArchitecture{Amd64, X86} -} - -// Protocol enumerates the values for protocol. -type Protocol string - -const ( - // ProtocolHTTP ... - ProtocolHTTP Protocol = "Http" - // ProtocolHTTPS ... - ProtocolHTTPS Protocol = "Https" - // ProtocolIcmp ... - ProtocolIcmp Protocol = "Icmp" - // ProtocolTCP ... - ProtocolTCP Protocol = "Tcp" -) - -// PossibleProtocolValues returns an array of possible values for the Protocol const type. -func PossibleProtocolValues() []Protocol { - return []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolIcmp, ProtocolTCP} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" - // Updating ... - Updating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Deleting, Failed, Succeeded, Updating} -} - -// PublicIPAddressSkuName enumerates the values for public ip address sku name. -type PublicIPAddressSkuName string - -const ( - // PublicIPAddressSkuNameBasic ... - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - // PublicIPAddressSkuNameStandard ... - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. -func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { - return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} -} - -// PublicIPPrefixSkuName enumerates the values for public ip prefix sku name. -type PublicIPPrefixSkuName string - -const ( - // PublicIPPrefixSkuNameStandard ... - PublicIPPrefixSkuNameStandard PublicIPPrefixSkuName = "Standard" -) - -// PossiblePublicIPPrefixSkuNameValues returns an array of possible values for the PublicIPPrefixSkuName const type. -func PossiblePublicIPPrefixSkuNameValues() []PublicIPPrefixSkuName { - return []PublicIPPrefixSkuName{PublicIPPrefixSkuNameStandard} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// RouteNextHopType enumerates the values for route next hop type. -type RouteNextHopType string - -const ( - // RouteNextHopTypeInternet ... - RouteNextHopTypeInternet RouteNextHopType = "Internet" - // RouteNextHopTypeNone ... - RouteNextHopTypeNone RouteNextHopType = "None" - // RouteNextHopTypeVirtualAppliance ... - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - // RouteNextHopTypeVirtualNetworkGateway ... - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - // RouteNextHopTypeVnetLocal ... - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -// PossibleRouteNextHopTypeValues returns an array of possible values for the RouteNextHopType const type. -func PossibleRouteNextHopTypeValues() []RouteNextHopType { - return []RouteNextHopType{RouteNextHopTypeInternet, RouteNextHopTypeNone, RouteNextHopTypeVirtualAppliance, RouteNextHopTypeVirtualNetworkGateway, RouteNextHopTypeVnetLocal} -} - -// RuleConditionType enumerates the values for rule condition type. -type RuleConditionType string - -const ( - // RuleConditionTypeApplicationRuleCondition ... - RuleConditionTypeApplicationRuleCondition RuleConditionType = "ApplicationRuleCondition" - // RuleConditionTypeFirewallPolicyRuleCondition ... - RuleConditionTypeFirewallPolicyRuleCondition RuleConditionType = "FirewallPolicyRuleCondition" - // RuleConditionTypeNetworkRuleCondition ... - RuleConditionTypeNetworkRuleCondition RuleConditionType = "NetworkRuleCondition" -) - -// PossibleRuleConditionTypeValues returns an array of possible values for the RuleConditionType const type. -func PossibleRuleConditionTypeValues() []RuleConditionType { - return []RuleConditionType{RuleConditionTypeApplicationRuleCondition, RuleConditionTypeFirewallPolicyRuleCondition, RuleConditionTypeNetworkRuleCondition} -} - -// RuleType enumerates the values for rule type. -type RuleType string - -const ( - // RuleTypeFirewallPolicyFilterRule ... - RuleTypeFirewallPolicyFilterRule RuleType = "FirewallPolicyFilterRule" - // RuleTypeFirewallPolicyNatRule ... - RuleTypeFirewallPolicyNatRule RuleType = "FirewallPolicyNatRule" - // RuleTypeFirewallPolicyRule ... - RuleTypeFirewallPolicyRule RuleType = "FirewallPolicyRule" -) - -// PossibleRuleTypeValues returns an array of possible values for the RuleType const type. -func PossibleRuleTypeValues() []RuleType { - return []RuleType{RuleTypeFirewallPolicyFilterRule, RuleTypeFirewallPolicyNatRule, RuleTypeFirewallPolicyRule} -} - -// SecurityRuleAccess enumerates the values for security rule access. -type SecurityRuleAccess string - -const ( - // SecurityRuleAccessAllow ... - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - // SecurityRuleAccessDeny ... - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -// PossibleSecurityRuleAccessValues returns an array of possible values for the SecurityRuleAccess const type. -func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { - return []SecurityRuleAccess{SecurityRuleAccessAllow, SecurityRuleAccessDeny} -} - -// SecurityRuleDirection enumerates the values for security rule direction. -type SecurityRuleDirection string - -const ( - // SecurityRuleDirectionInbound ... - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - // SecurityRuleDirectionOutbound ... - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -// PossibleSecurityRuleDirectionValues returns an array of possible values for the SecurityRuleDirection const type. -func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { - return []SecurityRuleDirection{SecurityRuleDirectionInbound, SecurityRuleDirectionOutbound} -} - -// SecurityRuleProtocol enumerates the values for security rule protocol. -type SecurityRuleProtocol string - -const ( - // SecurityRuleProtocolAsterisk ... - SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" - // SecurityRuleProtocolEsp ... - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - // SecurityRuleProtocolIcmp ... - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - // SecurityRuleProtocolTCP ... - SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" - // SecurityRuleProtocolUDP ... - SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" -) - -// PossibleSecurityRuleProtocolValues returns an array of possible values for the SecurityRuleProtocol const type. -func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { - return []SecurityRuleProtocol{SecurityRuleProtocolAsterisk, SecurityRuleProtocolEsp, SecurityRuleProtocolIcmp, SecurityRuleProtocolTCP, SecurityRuleProtocolUDP} -} - -// ServiceProviderProvisioningState enumerates the values for service provider provisioning state. -type ServiceProviderProvisioningState string - -const ( - // Deprovisioning ... - Deprovisioning ServiceProviderProvisioningState = "Deprovisioning" - // NotProvisioned ... - NotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - // Provisioned ... - Provisioned ServiceProviderProvisioningState = "Provisioned" - // Provisioning ... - Provisioning ServiceProviderProvisioningState = "Provisioning" -) - -// PossibleServiceProviderProvisioningStateValues returns an array of possible values for the ServiceProviderProvisioningState const type. -func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { - return []ServiceProviderProvisioningState{Deprovisioning, NotProvisioned, Provisioned, Provisioning} -} - -// Severity enumerates the values for severity. -type Severity string - -const ( - // SeverityError ... - SeverityError Severity = "Error" - // SeverityWarning ... - SeverityWarning Severity = "Warning" -) - -// PossibleSeverityValues returns an array of possible values for the Severity const type. -func PossibleSeverityValues() []Severity { - return []Severity{SeverityError, SeverityWarning} -} - -// TransportProtocol enumerates the values for transport protocol. -type TransportProtocol string - -const ( - // TransportProtocolAll ... - TransportProtocolAll TransportProtocol = "All" - // TransportProtocolTCP ... - TransportProtocolTCP TransportProtocol = "Tcp" - // TransportProtocolUDP ... - TransportProtocolUDP TransportProtocol = "Udp" -) - -// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. -func PossibleTransportProtocolValues() []TransportProtocol { - return []TransportProtocol{TransportProtocolAll, TransportProtocolTCP, TransportProtocolUDP} -} - -// TunnelConnectionStatus enumerates the values for tunnel connection status. -type TunnelConnectionStatus string - -const ( - // TunnelConnectionStatusConnected ... - TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" - // TunnelConnectionStatusConnecting ... - TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" - // TunnelConnectionStatusNotConnected ... - TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" - // TunnelConnectionStatusUnknown ... - TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" -) - -// PossibleTunnelConnectionStatusValues returns an array of possible values for the TunnelConnectionStatus const type. -func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { - return []TunnelConnectionStatus{TunnelConnectionStatusConnected, TunnelConnectionStatusConnecting, TunnelConnectionStatusNotConnected, TunnelConnectionStatusUnknown} -} - -// VerbosityLevel enumerates the values for verbosity level. -type VerbosityLevel string - -const ( - // Full ... - Full VerbosityLevel = "Full" - // Minimum ... - Minimum VerbosityLevel = "Minimum" - // Normal ... - Normal VerbosityLevel = "Normal" -) - -// PossibleVerbosityLevelValues returns an array of possible values for the VerbosityLevel const type. -func PossibleVerbosityLevelValues() []VerbosityLevel { - return []VerbosityLevel{Full, Minimum, Normal} -} - -// VirtualNetworkGatewayConnectionProtocol enumerates the values for virtual network gateway connection -// protocol. -type VirtualNetworkGatewayConnectionProtocol string - -const ( - // IKEv1 ... - IKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" - // IKEv2 ... - IKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -// PossibleVirtualNetworkGatewayConnectionProtocolValues returns an array of possible values for the VirtualNetworkGatewayConnectionProtocol const type. -func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { - return []VirtualNetworkGatewayConnectionProtocol{IKEv1, IKEv2} -} - -// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. -type VirtualNetworkGatewayConnectionStatus string - -const ( - // VirtualNetworkGatewayConnectionStatusConnected ... - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - // VirtualNetworkGatewayConnectionStatusConnecting ... - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - // VirtualNetworkGatewayConnectionStatusNotConnected ... - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - // VirtualNetworkGatewayConnectionStatusUnknown ... - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -// PossibleVirtualNetworkGatewayConnectionStatusValues returns an array of possible values for the VirtualNetworkGatewayConnectionStatus const type. -func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { - return []VirtualNetworkGatewayConnectionStatus{VirtualNetworkGatewayConnectionStatusConnected, VirtualNetworkGatewayConnectionStatusConnecting, VirtualNetworkGatewayConnectionStatusNotConnected, VirtualNetworkGatewayConnectionStatusUnknown} -} - -// VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type. -type VirtualNetworkGatewayConnectionType string - -const ( - // ExpressRoute ... - ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - // IPsec ... - IPsec VirtualNetworkGatewayConnectionType = "IPsec" - // Vnet2Vnet ... - Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" - // VPNClient ... - VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" -) - -// PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. -func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { - return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} -} - -// VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. -type VirtualNetworkGatewaySkuName string - -const ( - // VirtualNetworkGatewaySkuNameBasic ... - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - // VirtualNetworkGatewaySkuNameErGw1AZ ... - VirtualNetworkGatewaySkuNameErGw1AZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - // VirtualNetworkGatewaySkuNameErGw2AZ ... - VirtualNetworkGatewaySkuNameErGw2AZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - // VirtualNetworkGatewaySkuNameErGw3AZ ... - VirtualNetworkGatewaySkuNameErGw3AZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - // VirtualNetworkGatewaySkuNameHighPerformance ... - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - // VirtualNetworkGatewaySkuNameStandard ... - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - // VirtualNetworkGatewaySkuNameUltraPerformance ... - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - // VirtualNetworkGatewaySkuNameVpnGw1 ... - VirtualNetworkGatewaySkuNameVpnGw1 VirtualNetworkGatewaySkuName = "VpnGw1" - // VirtualNetworkGatewaySkuNameVpnGw1AZ ... - VirtualNetworkGatewaySkuNameVpnGw1AZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - // VirtualNetworkGatewaySkuNameVpnGw2 ... - VirtualNetworkGatewaySkuNameVpnGw2 VirtualNetworkGatewaySkuName = "VpnGw2" - // VirtualNetworkGatewaySkuNameVpnGw2AZ ... - VirtualNetworkGatewaySkuNameVpnGw2AZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" - // VirtualNetworkGatewaySkuNameVpnGw3 ... - VirtualNetworkGatewaySkuNameVpnGw3 VirtualNetworkGatewaySkuName = "VpnGw3" - // VirtualNetworkGatewaySkuNameVpnGw3AZ ... - VirtualNetworkGatewaySkuNameVpnGw3AZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" -) - -// PossibleVirtualNetworkGatewaySkuNameValues returns an array of possible values for the VirtualNetworkGatewaySkuName const type. -func PossibleVirtualNetworkGatewaySkuNameValues() []VirtualNetworkGatewaySkuName { - return []VirtualNetworkGatewaySkuName{VirtualNetworkGatewaySkuNameBasic, VirtualNetworkGatewaySkuNameErGw1AZ, VirtualNetworkGatewaySkuNameErGw2AZ, VirtualNetworkGatewaySkuNameErGw3AZ, VirtualNetworkGatewaySkuNameHighPerformance, VirtualNetworkGatewaySkuNameStandard, VirtualNetworkGatewaySkuNameUltraPerformance, VirtualNetworkGatewaySkuNameVpnGw1, VirtualNetworkGatewaySkuNameVpnGw1AZ, VirtualNetworkGatewaySkuNameVpnGw2, VirtualNetworkGatewaySkuNameVpnGw2AZ, VirtualNetworkGatewaySkuNameVpnGw3, VirtualNetworkGatewaySkuNameVpnGw3AZ} -} - -// VirtualNetworkGatewaySkuTier enumerates the values for virtual network gateway sku tier. -type VirtualNetworkGatewaySkuTier string - -const ( - // VirtualNetworkGatewaySkuTierBasic ... - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - // VirtualNetworkGatewaySkuTierErGw1AZ ... - VirtualNetworkGatewaySkuTierErGw1AZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - // VirtualNetworkGatewaySkuTierErGw2AZ ... - VirtualNetworkGatewaySkuTierErGw2AZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - // VirtualNetworkGatewaySkuTierErGw3AZ ... - VirtualNetworkGatewaySkuTierErGw3AZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - // VirtualNetworkGatewaySkuTierHighPerformance ... - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - // VirtualNetworkGatewaySkuTierStandard ... - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - // VirtualNetworkGatewaySkuTierUltraPerformance ... - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - // VirtualNetworkGatewaySkuTierVpnGw1 ... - VirtualNetworkGatewaySkuTierVpnGw1 VirtualNetworkGatewaySkuTier = "VpnGw1" - // VirtualNetworkGatewaySkuTierVpnGw1AZ ... - VirtualNetworkGatewaySkuTierVpnGw1AZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - // VirtualNetworkGatewaySkuTierVpnGw2 ... - VirtualNetworkGatewaySkuTierVpnGw2 VirtualNetworkGatewaySkuTier = "VpnGw2" - // VirtualNetworkGatewaySkuTierVpnGw2AZ ... - VirtualNetworkGatewaySkuTierVpnGw2AZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" - // VirtualNetworkGatewaySkuTierVpnGw3 ... - VirtualNetworkGatewaySkuTierVpnGw3 VirtualNetworkGatewaySkuTier = "VpnGw3" - // VirtualNetworkGatewaySkuTierVpnGw3AZ ... - VirtualNetworkGatewaySkuTierVpnGw3AZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" -) - -// PossibleVirtualNetworkGatewaySkuTierValues returns an array of possible values for the VirtualNetworkGatewaySkuTier const type. -func PossibleVirtualNetworkGatewaySkuTierValues() []VirtualNetworkGatewaySkuTier { - return []VirtualNetworkGatewaySkuTier{VirtualNetworkGatewaySkuTierBasic, VirtualNetworkGatewaySkuTierErGw1AZ, VirtualNetworkGatewaySkuTierErGw2AZ, VirtualNetworkGatewaySkuTierErGw3AZ, VirtualNetworkGatewaySkuTierHighPerformance, VirtualNetworkGatewaySkuTierStandard, VirtualNetworkGatewaySkuTierUltraPerformance, VirtualNetworkGatewaySkuTierVpnGw1, VirtualNetworkGatewaySkuTierVpnGw1AZ, VirtualNetworkGatewaySkuTierVpnGw2, VirtualNetworkGatewaySkuTierVpnGw2AZ, VirtualNetworkGatewaySkuTierVpnGw3, VirtualNetworkGatewaySkuTierVpnGw3AZ} -} - -// VirtualNetworkGatewayType enumerates the values for virtual network gateway type. -type VirtualNetworkGatewayType string - -const ( - // VirtualNetworkGatewayTypeExpressRoute ... - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - // VirtualNetworkGatewayTypeVpn ... - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -// PossibleVirtualNetworkGatewayTypeValues returns an array of possible values for the VirtualNetworkGatewayType const type. -func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { - return []VirtualNetworkGatewayType{VirtualNetworkGatewayTypeExpressRoute, VirtualNetworkGatewayTypeVpn} -} - -// VirtualNetworkPeeringState enumerates the values for virtual network peering state. -type VirtualNetworkPeeringState string - -const ( - // VirtualNetworkPeeringStateConnected ... - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - // VirtualNetworkPeeringStateDisconnected ... - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - // VirtualNetworkPeeringStateInitiated ... - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -// PossibleVirtualNetworkPeeringStateValues returns an array of possible values for the VirtualNetworkPeeringState const type. -func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { - return []VirtualNetworkPeeringState{VirtualNetworkPeeringStateConnected, VirtualNetworkPeeringStateDisconnected, VirtualNetworkPeeringStateInitiated} -} - -// VirtualWanSecurityProviderType enumerates the values for virtual wan security provider type. -type VirtualWanSecurityProviderType string - -const ( - // External ... - External VirtualWanSecurityProviderType = "External" - // Native ... - Native VirtualWanSecurityProviderType = "Native" -) - -// PossibleVirtualWanSecurityProviderTypeValues returns an array of possible values for the VirtualWanSecurityProviderType const type. -func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { - return []VirtualWanSecurityProviderType{External, Native} -} - -// VpnClientProtocol enumerates the values for vpn client protocol. -type VpnClientProtocol string - -const ( - // IkeV2 ... - IkeV2 VpnClientProtocol = "IkeV2" - // OpenVPN ... - OpenVPN VpnClientProtocol = "OpenVPN" - // SSTP ... - SSTP VpnClientProtocol = "SSTP" -) - -// PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. -func PossibleVpnClientProtocolValues() []VpnClientProtocol { - return []VpnClientProtocol{IkeV2, OpenVPN, SSTP} -} - -// VpnConnectionStatus enumerates the values for vpn connection status. -type VpnConnectionStatus string - -const ( - // VpnConnectionStatusConnected ... - VpnConnectionStatusConnected VpnConnectionStatus = "Connected" - // VpnConnectionStatusConnecting ... - VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" - // VpnConnectionStatusNotConnected ... - VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" - // VpnConnectionStatusUnknown ... - VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" -) - -// PossibleVpnConnectionStatusValues returns an array of possible values for the VpnConnectionStatus const type. -func PossibleVpnConnectionStatusValues() []VpnConnectionStatus { - return []VpnConnectionStatus{VpnConnectionStatusConnected, VpnConnectionStatusConnecting, VpnConnectionStatusNotConnected, VpnConnectionStatusUnknown} -} - -// VpnGatewayTunnelingProtocol enumerates the values for vpn gateway tunneling protocol. -type VpnGatewayTunnelingProtocol string - -const ( - // VpnGatewayTunnelingProtocolIkeV2 ... - VpnGatewayTunnelingProtocolIkeV2 VpnGatewayTunnelingProtocol = "IkeV2" - // VpnGatewayTunnelingProtocolOpenVPN ... - VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" -) - -// PossibleVpnGatewayTunnelingProtocolValues returns an array of possible values for the VpnGatewayTunnelingProtocol const type. -func PossibleVpnGatewayTunnelingProtocolValues() []VpnGatewayTunnelingProtocol { - return []VpnGatewayTunnelingProtocol{VpnGatewayTunnelingProtocolIkeV2, VpnGatewayTunnelingProtocolOpenVPN} -} - -// VpnType enumerates the values for vpn type. -type VpnType string - -const ( - // PolicyBased ... - PolicyBased VpnType = "PolicyBased" - // RouteBased ... - RouteBased VpnType = "RouteBased" -) - -// PossibleVpnTypeValues returns an array of possible values for the VpnType const type. -func PossibleVpnTypeValues() []VpnType { - return []VpnType{PolicyBased, RouteBased} -} - -// WebApplicationFirewallAction enumerates the values for web application firewall action. -type WebApplicationFirewallAction string - -const ( - // WebApplicationFirewallActionAllow ... - WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" - // WebApplicationFirewallActionBlock ... - WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" - // WebApplicationFirewallActionLog ... - WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" -) - -// PossibleWebApplicationFirewallActionValues returns an array of possible values for the WebApplicationFirewallAction const type. -func PossibleWebApplicationFirewallActionValues() []WebApplicationFirewallAction { - return []WebApplicationFirewallAction{WebApplicationFirewallActionAllow, WebApplicationFirewallActionBlock, WebApplicationFirewallActionLog} -} - -// WebApplicationFirewallEnabledState enumerates the values for web application firewall enabled state. -type WebApplicationFirewallEnabledState string - -const ( - // WebApplicationFirewallEnabledStateDisabled ... - WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" - // WebApplicationFirewallEnabledStateEnabled ... - WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" -) - -// PossibleWebApplicationFirewallEnabledStateValues returns an array of possible values for the WebApplicationFirewallEnabledState const type. -func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewallEnabledState { - return []WebApplicationFirewallEnabledState{WebApplicationFirewallEnabledStateDisabled, WebApplicationFirewallEnabledStateEnabled} -} - -// WebApplicationFirewallMatchVariable enumerates the values for web application firewall match variable. -type WebApplicationFirewallMatchVariable string - -const ( - // PostArgs ... - PostArgs WebApplicationFirewallMatchVariable = "PostArgs" - // QueryString ... - QueryString WebApplicationFirewallMatchVariable = "QueryString" - // RemoteAddr ... - RemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - // RequestBody ... - RequestBody WebApplicationFirewallMatchVariable = "RequestBody" - // RequestCookies ... - RequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - // RequestHeaders ... - RequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - // RequestMethod ... - RequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - // RequestURI ... - RequestURI WebApplicationFirewallMatchVariable = "RequestUri" -) - -// PossibleWebApplicationFirewallMatchVariableValues returns an array of possible values for the WebApplicationFirewallMatchVariable const type. -func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { - return []WebApplicationFirewallMatchVariable{PostArgs, QueryString, RemoteAddr, RequestBody, RequestCookies, RequestHeaders, RequestMethod, RequestURI} -} - -// WebApplicationFirewallMode enumerates the values for web application firewall mode. -type WebApplicationFirewallMode string - -const ( - // WebApplicationFirewallModeDetection ... - WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" - // WebApplicationFirewallModePrevention ... - WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" -) - -// PossibleWebApplicationFirewallModeValues returns an array of possible values for the WebApplicationFirewallMode const type. -func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { - return []WebApplicationFirewallMode{WebApplicationFirewallModeDetection, WebApplicationFirewallModePrevention} -} - -// WebApplicationFirewallOperator enumerates the values for web application firewall operator. -type WebApplicationFirewallOperator string - -const ( - // WebApplicationFirewallOperatorBeginsWith ... - WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" - // WebApplicationFirewallOperatorContains ... - WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" - // WebApplicationFirewallOperatorEndsWith ... - WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" - // WebApplicationFirewallOperatorEqual ... - WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" - // WebApplicationFirewallOperatorGreaterThan ... - WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" - // WebApplicationFirewallOperatorGreaterThanOrEqual ... - WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" - // WebApplicationFirewallOperatorIPMatch ... - WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" - // WebApplicationFirewallOperatorLessThan ... - WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" - // WebApplicationFirewallOperatorLessThanOrEqual ... - WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" - // WebApplicationFirewallOperatorRegex ... - WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" -) - -// PossibleWebApplicationFirewallOperatorValues returns an array of possible values for the WebApplicationFirewallOperator const type. -func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOperator { - return []WebApplicationFirewallOperator{WebApplicationFirewallOperatorBeginsWith, WebApplicationFirewallOperatorContains, WebApplicationFirewallOperatorEndsWith, WebApplicationFirewallOperatorEqual, WebApplicationFirewallOperatorGreaterThan, WebApplicationFirewallOperatorGreaterThanOrEqual, WebApplicationFirewallOperatorIPMatch, WebApplicationFirewallOperatorLessThan, WebApplicationFirewallOperatorLessThanOrEqual, WebApplicationFirewallOperatorRegex} -} - -// WebApplicationFirewallPolicyResourceState enumerates the values for web application firewall policy resource -// state. -type WebApplicationFirewallPolicyResourceState string - -const ( - // WebApplicationFirewallPolicyResourceStateCreating ... - WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" - // WebApplicationFirewallPolicyResourceStateDeleting ... - WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" - // WebApplicationFirewallPolicyResourceStateDisabled ... - WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" - // WebApplicationFirewallPolicyResourceStateDisabling ... - WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" - // WebApplicationFirewallPolicyResourceStateEnabled ... - WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" - // WebApplicationFirewallPolicyResourceStateEnabling ... - WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" -) - -// PossibleWebApplicationFirewallPolicyResourceStateValues returns an array of possible values for the WebApplicationFirewallPolicyResourceState const type. -func PossibleWebApplicationFirewallPolicyResourceStateValues() []WebApplicationFirewallPolicyResourceState { - return []WebApplicationFirewallPolicyResourceState{WebApplicationFirewallPolicyResourceStateCreating, WebApplicationFirewallPolicyResourceStateDeleting, WebApplicationFirewallPolicyResourceStateDisabled, WebApplicationFirewallPolicyResourceStateDisabling, WebApplicationFirewallPolicyResourceStateEnabled, WebApplicationFirewallPolicyResourceStateEnabling} -} - -// WebApplicationFirewallRuleType enumerates the values for web application firewall rule type. -type WebApplicationFirewallRuleType string - -const ( - // WebApplicationFirewallRuleTypeInvalid ... - WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" - // WebApplicationFirewallRuleTypeMatchRule ... - WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" -) - -// PossibleWebApplicationFirewallRuleTypeValues returns an array of possible values for the WebApplicationFirewallRuleType const type. -func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRuleType { - return []WebApplicationFirewallRuleType{WebApplicationFirewallRuleTypeInvalid, WebApplicationFirewallRuleTypeMatchRule} -} - -// WebApplicationFirewallTransform enumerates the values for web application firewall transform. -type WebApplicationFirewallTransform string - -const ( - // HTMLEntityDecode ... - HTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - // Lowercase ... - Lowercase WebApplicationFirewallTransform = "Lowercase" - // RemoveNulls ... - RemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - // Trim ... - Trim WebApplicationFirewallTransform = "Trim" - // URLDecode ... - URLDecode WebApplicationFirewallTransform = "UrlDecode" - // URLEncode ... - URLEncode WebApplicationFirewallTransform = "UrlEncode" + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" ) -// PossibleWebApplicationFirewallTransformValues returns an array of possible values for the WebApplicationFirewallTransform const type. -func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { - return []WebApplicationFirewallTransform{HTMLEntityDecode, Lowercase, RemoveNulls, Trim, URLDecode, URLEncode} -} +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network" // AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the // virtual network. @@ -2562,10 +482,15 @@ func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) IsEmpty() bool { return agaspp.Value == nil || len(*agaspp.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) hasNextLink() bool { + return agaspp.NextLink != nil && len(*agaspp.NextLink) != 0 +} + // applicationGatewayAvailableSslPredefinedPoliciesPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) { - if agaspp.NextLink == nil || len(to.String(agaspp.NextLink)) < 1 { + if !agaspp.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2594,11 +519,16 @@ func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.agaspp) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.agaspp) + if err != nil { + return err + } + page.agaspp = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.agaspp = next return nil } @@ -2628,8 +558,11 @@ func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Values() []Appl } // Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesPage type. -func NewApplicationGatewayAvailableSslPredefinedPoliciesPage(getNextPage func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error)) ApplicationGatewayAvailableSslPredefinedPoliciesPage { - return ApplicationGatewayAvailableSslPredefinedPoliciesPage{fn: getNextPage} +func NewApplicationGatewayAvailableSslPredefinedPoliciesPage(cur ApplicationGatewayAvailableSslPredefinedPolicies, getNextPage func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error)) ApplicationGatewayAvailableSslPredefinedPoliciesPage { + return ApplicationGatewayAvailableSslPredefinedPoliciesPage{ + fn: getNextPage, + agaspp: cur, + } } // ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API @@ -3614,10 +1547,15 @@ func (aglr ApplicationGatewayListResult) IsEmpty() bool { return aglr.Value == nil || len(*aglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (aglr ApplicationGatewayListResult) hasNextLink() bool { + return aglr.NextLink != nil && len(*aglr.NextLink) != 0 +} + // applicationGatewayListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if aglr.NextLink == nil || len(to.String(aglr.NextLink)) < 1 { + if !aglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3645,11 +1583,16 @@ func (page *ApplicationGatewayListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.aglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.aglr) + if err != nil { + return err + } + page.aglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.aglr = next return nil } @@ -3679,8 +1622,11 @@ func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway { } // Creates a new instance of the ApplicationGatewayListResultPage type. -func NewApplicationGatewayListResultPage(getNextPage func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)) ApplicationGatewayListResultPage { - return ApplicationGatewayListResultPage{fn: getNextPage} +func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNextPage func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)) ApplicationGatewayListResultPage { + return ApplicationGatewayListResultPage{ + fn: getNextPage, + aglr: cur, + } } // ApplicationGatewayOnDemandProbe details of on demand test probe request. @@ -3997,6 +1943,84 @@ type ApplicationGatewayPropertiesFormat struct { CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` } +// MarshalJSON is the custom marshaler for ApplicationGatewayPropertiesFormat. +func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agpf.Sku != nil { + objectMap["sku"] = agpf.Sku + } + if agpf.SslPolicy != nil { + objectMap["sslPolicy"] = agpf.SslPolicy + } + if agpf.GatewayIPConfigurations != nil { + objectMap["gatewayIPConfigurations"] = agpf.GatewayIPConfigurations + } + if agpf.AuthenticationCertificates != nil { + objectMap["authenticationCertificates"] = agpf.AuthenticationCertificates + } + if agpf.TrustedRootCertificates != nil { + objectMap["trustedRootCertificates"] = agpf.TrustedRootCertificates + } + if agpf.SslCertificates != nil { + objectMap["sslCertificates"] = agpf.SslCertificates + } + if agpf.FrontendIPConfigurations != nil { + objectMap["frontendIPConfigurations"] = agpf.FrontendIPConfigurations + } + if agpf.FrontendPorts != nil { + objectMap["frontendPorts"] = agpf.FrontendPorts + } + if agpf.Probes != nil { + objectMap["probes"] = agpf.Probes + } + if agpf.BackendAddressPools != nil { + objectMap["backendAddressPools"] = agpf.BackendAddressPools + } + if agpf.BackendHTTPSettingsCollection != nil { + objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection + } + if agpf.HTTPListeners != nil { + objectMap["httpListeners"] = agpf.HTTPListeners + } + if agpf.URLPathMaps != nil { + objectMap["urlPathMaps"] = agpf.URLPathMaps + } + if agpf.RequestRoutingRules != nil { + objectMap["requestRoutingRules"] = agpf.RequestRoutingRules + } + if agpf.RewriteRuleSets != nil { + objectMap["rewriteRuleSets"] = agpf.RewriteRuleSets + } + if agpf.RedirectConfigurations != nil { + objectMap["redirectConfigurations"] = agpf.RedirectConfigurations + } + if agpf.WebApplicationFirewallConfiguration != nil { + objectMap["webApplicationFirewallConfiguration"] = agpf.WebApplicationFirewallConfiguration + } + if agpf.FirewallPolicy != nil { + objectMap["firewallPolicy"] = agpf.FirewallPolicy + } + if agpf.EnableHTTP2 != nil { + objectMap["enableHttp2"] = agpf.EnableHTTP2 + } + if agpf.EnableFips != nil { + objectMap["enableFips"] = agpf.EnableFips + } + if agpf.AutoscaleConfiguration != nil { + objectMap["autoscaleConfiguration"] = agpf.AutoscaleConfiguration + } + if agpf.ResourceGUID != nil { + objectMap["resourceGuid"] = agpf.ResourceGUID + } + if agpf.ProvisioningState != nil { + objectMap["provisioningState"] = agpf.ProvisioningState + } + if agpf.CustomErrorConfigurations != nil { + objectMap["customErrorConfigurations"] = agpf.CustomErrorConfigurations + } + return json.Marshal(objectMap) +} + // ApplicationGatewayRedirectConfiguration redirect configuration of an application gateway. type ApplicationGatewayRedirectConfiguration struct { // ApplicationGatewayRedirectConfigurationPropertiesFormat - Properties of the application gateway redirect configuration. @@ -4348,15 +2372,37 @@ type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ApplicationGatewayRewriteRuleSetPropertiesFormat. +func (agrrspf ApplicationGatewayRewriteRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agrrspf.RewriteRules != nil { + objectMap["rewriteRules"] = agrrspf.RewriteRules + } + return json.Marshal(objectMap) +} + // ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ApplicationGatewaysBackendHealthFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealth, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationGatewaysBackendHealthFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationGatewaysBackendHealthFuture) Result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) { +// result is the default implementation for ApplicationGatewaysBackendHealthFuture.Result. +func (future *ApplicationGatewaysBackendHealthFuture) result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4380,12 +2426,25 @@ func (future *ApplicationGatewaysBackendHealthFuture) Result(client ApplicationG // ApplicationGatewaysBackendHealthOnDemandFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ApplicationGatewaysBackendHealthOnDemandFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealthOnDemand, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationGatewaysBackendHealthOnDemandFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationGatewaysBackendHealthOnDemandFuture) Result(client ApplicationGatewaysClient) (agbhod ApplicationGatewayBackendHealthOnDemand, err error) { +// result is the default implementation for ApplicationGatewaysBackendHealthOnDemandFuture.Result. +func (future *ApplicationGatewaysBackendHealthOnDemandFuture) result(client ApplicationGatewaysClient) (agbhod ApplicationGatewayBackendHealthOnDemand, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4409,12 +2468,25 @@ func (future *ApplicationGatewaysBackendHealthOnDemandFuture) Result(client Appl // ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ApplicationGatewaysCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationGatewaysClient) (ApplicationGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationGatewaysCreateOrUpdateFuture) Result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { +// result is the default implementation for ApplicationGatewaysCreateOrUpdateFuture.Result. +func (future *ApplicationGatewaysCreateOrUpdateFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4438,12 +2510,25 @@ func (future *ApplicationGatewaysCreateOrUpdateFuture) Result(client Application // ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ApplicationGatewaysDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationGatewaysClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationGatewaysDeleteFuture) Result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for ApplicationGatewaysDeleteFuture.Result. +func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4672,12 +2757,25 @@ type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { // ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ApplicationGatewaysStartFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationGatewaysClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationGatewaysStartFuture) Result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationGatewaysStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ApplicationGatewaysStartFuture.Result. +func (future *ApplicationGatewaysStartFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4695,12 +2793,25 @@ func (future *ApplicationGatewaysStartFuture) Result(client ApplicationGatewaysC // ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ApplicationGatewaysStopFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationGatewaysClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationGatewaysStopFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationGatewaysStopFuture) Result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for ApplicationGatewaysStopFuture.Result. +func (future *ApplicationGatewaysStopFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -4718,12 +2829,25 @@ func (future *ApplicationGatewaysStopFuture) Result(client ApplicationGatewaysCl // ApplicationGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ApplicationGatewaysUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationGatewaysClient) (ApplicationGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationGatewaysUpdateTagsFuture) Result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { +// result is the default implementation for ApplicationGatewaysUpdateTagsFuture.Result. +func (future *ApplicationGatewaysUpdateTagsFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5182,6 +3306,15 @@ type ApplicationSecurityGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ApplicationSecurityGroupListResult. +func (asglr ApplicationSecurityGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asglr.Value != nil { + objectMap["value"] = asglr.Value + } + return json.Marshal(objectMap) +} + // ApplicationSecurityGroupListResultIterator provides access to a complete listing of // ApplicationSecurityGroup values. type ApplicationSecurityGroupListResultIterator struct { @@ -5251,10 +3384,15 @@ func (asglr ApplicationSecurityGroupListResult) IsEmpty() bool { return asglr.Value == nil || len(*asglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (asglr ApplicationSecurityGroupListResult) hasNextLink() bool { + return asglr.NextLink != nil && len(*asglr.NextLink) != 0 +} + // applicationSecurityGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (asglr ApplicationSecurityGroupListResult) applicationSecurityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if asglr.NextLink == nil || len(to.String(asglr.NextLink)) < 1 { + if !asglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5282,11 +3420,16 @@ func (page *ApplicationSecurityGroupListResultPage) NextWithContext(ctx context. tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.asglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.asglr) + if err != nil { + return err + } + page.asglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.asglr = next return nil } @@ -5316,8 +3459,11 @@ func (page ApplicationSecurityGroupListResultPage) Values() []ApplicationSecurit } // Creates a new instance of the ApplicationSecurityGroupListResultPage type. -func NewApplicationSecurityGroupListResultPage(getNextPage func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error)) ApplicationSecurityGroupListResultPage { - return ApplicationSecurityGroupListResultPage{fn: getNextPage} +func NewApplicationSecurityGroupListResultPage(cur ApplicationSecurityGroupListResult, getNextPage func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error)) ApplicationSecurityGroupListResultPage { + return ApplicationSecurityGroupListResultPage{ + fn: getNextPage, + asglr: cur, + } } // ApplicationSecurityGroupPropertiesFormat application security group properties. @@ -5331,12 +3477,25 @@ type ApplicationSecurityGroupPropertiesFormat struct { // ApplicationSecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ApplicationSecurityGroupsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationSecurityGroupsClient) (ApplicationSecurityGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) Result(client ApplicationSecurityGroupsClient) (asg ApplicationSecurityGroup, err error) { +// result is the default implementation for ApplicationSecurityGroupsCreateOrUpdateFuture.Result. +func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) result(client ApplicationSecurityGroupsClient) (asg ApplicationSecurityGroup, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5360,12 +3519,25 @@ func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) Result(client Appli // ApplicationSecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ApplicationSecurityGroupsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationSecurityGroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationSecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationSecurityGroupsDeleteFuture) Result(client ApplicationSecurityGroupsClient) (ar autorest.Response, err error) { +// result is the default implementation for ApplicationSecurityGroupsDeleteFuture.Result. +func (future *ApplicationSecurityGroupsDeleteFuture) result(client ApplicationSecurityGroupsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5383,12 +3555,25 @@ func (future *ApplicationSecurityGroupsDeleteFuture) Result(client ApplicationSe // ApplicationSecurityGroupsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ApplicationSecurityGroupsUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ApplicationSecurityGroupsClient) (ApplicationSecurityGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ApplicationSecurityGroupsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ApplicationSecurityGroupsUpdateTagsFuture) Result(client ApplicationSecurityGroupsClient) (asg ApplicationSecurityGroup, err error) { +// result is the default implementation for ApplicationSecurityGroupsUpdateTagsFuture.Result. +func (future *ApplicationSecurityGroupsUpdateTagsFuture) result(client ApplicationSecurityGroupsClient) (asg ApplicationSecurityGroup, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -5488,10 +3673,15 @@ func (alr AuthorizationListResult) IsEmpty() bool { return alr.Value == nil || len(*alr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (alr AuthorizationListResult) hasNextLink() bool { + return alr.NextLink != nil && len(*alr.NextLink) != 0 +} + // authorizationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (alr AuthorizationListResult) authorizationListResultPreparer(ctx context.Context) (*http.Request, error) { - if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + if !alr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5519,11 +3709,16 @@ func (page *AuthorizationListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.alr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.alr = next return nil } @@ -5553,8 +3748,11 @@ func (page AuthorizationListResultPage) Values() []ExpressRouteCircuitAuthorizat } // Creates a new instance of the AuthorizationListResultPage type. -func NewAuthorizationListResultPage(getNextPage func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)) AuthorizationListResultPage { - return AuthorizationListResultPage{fn: getNextPage} +func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)) AuthorizationListResultPage { + return AuthorizationListResultPage{ + fn: getNextPage, + alr: cur, + } } // AuthorizationPropertiesFormat properties of ExpressRouteCircuitAuthorization. @@ -5583,6 +3781,15 @@ type AutoApprovedPrivateLinkServicesResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for AutoApprovedPrivateLinkServicesResult. +func (aaplsr AutoApprovedPrivateLinkServicesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aaplsr.Value != nil { + objectMap["value"] = aaplsr.Value + } + return json.Marshal(objectMap) +} + // AutoApprovedPrivateLinkServicesResultIterator provides access to a complete listing of // AutoApprovedPrivateLinkService values. type AutoApprovedPrivateLinkServicesResultIterator struct { @@ -5652,10 +3859,15 @@ func (aaplsr AutoApprovedPrivateLinkServicesResult) IsEmpty() bool { return aaplsr.Value == nil || len(*aaplsr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (aaplsr AutoApprovedPrivateLinkServicesResult) hasNextLink() bool { + return aaplsr.NextLink != nil && len(*aaplsr.NextLink) != 0 +} + // autoApprovedPrivateLinkServicesResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (aaplsr AutoApprovedPrivateLinkServicesResult) autoApprovedPrivateLinkServicesResultPreparer(ctx context.Context) (*http.Request, error) { - if aaplsr.NextLink == nil || len(to.String(aaplsr.NextLink)) < 1 { + if !aaplsr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5683,11 +3895,16 @@ func (page *AutoApprovedPrivateLinkServicesResultPage) NextWithContext(ctx conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.aaplsr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.aaplsr) + if err != nil { + return err + } + page.aaplsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.aaplsr = next return nil } @@ -5717,8 +3934,11 @@ func (page AutoApprovedPrivateLinkServicesResultPage) Values() []AutoApprovedPri } // Creates a new instance of the AutoApprovedPrivateLinkServicesResultPage type. -func NewAutoApprovedPrivateLinkServicesResultPage(getNextPage func(context.Context, AutoApprovedPrivateLinkServicesResult) (AutoApprovedPrivateLinkServicesResult, error)) AutoApprovedPrivateLinkServicesResultPage { - return AutoApprovedPrivateLinkServicesResultPage{fn: getNextPage} +func NewAutoApprovedPrivateLinkServicesResultPage(cur AutoApprovedPrivateLinkServicesResult, getNextPage func(context.Context, AutoApprovedPrivateLinkServicesResult) (AutoApprovedPrivateLinkServicesResult, error)) AutoApprovedPrivateLinkServicesResultPage { + return AutoApprovedPrivateLinkServicesResultPage{ + fn: getNextPage, + aaplsr: cur, + } } // Availability availability of the metric. @@ -5755,6 +3975,15 @@ type AvailableDelegationsResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for AvailableDelegationsResult. +func (adr AvailableDelegationsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if adr.Value != nil { + objectMap["value"] = adr.Value + } + return json.Marshal(objectMap) +} + // AvailableDelegationsResultIterator provides access to a complete listing of AvailableDelegation values. type AvailableDelegationsResultIterator struct { i int @@ -5823,10 +4052,15 @@ func (adr AvailableDelegationsResult) IsEmpty() bool { return adr.Value == nil || len(*adr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (adr AvailableDelegationsResult) hasNextLink() bool { + return adr.NextLink != nil && len(*adr.NextLink) != 0 +} + // availableDelegationsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (adr AvailableDelegationsResult) availableDelegationsResultPreparer(ctx context.Context) (*http.Request, error) { - if adr.NextLink == nil || len(to.String(adr.NextLink)) < 1 { + if !adr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5854,11 +4088,16 @@ func (page *AvailableDelegationsResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.adr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.adr) + if err != nil { + return err + } + page.adr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.adr = next return nil } @@ -5888,8 +4127,11 @@ func (page AvailableDelegationsResultPage) Values() []AvailableDelegation { } // Creates a new instance of the AvailableDelegationsResultPage type. -func NewAvailableDelegationsResultPage(getNextPage func(context.Context, AvailableDelegationsResult) (AvailableDelegationsResult, error)) AvailableDelegationsResultPage { - return AvailableDelegationsResultPage{fn: getNextPage} +func NewAvailableDelegationsResultPage(cur AvailableDelegationsResult, getNextPage func(context.Context, AvailableDelegationsResult) (AvailableDelegationsResult, error)) AvailableDelegationsResultPage { + return AvailableDelegationsResultPage{ + fn: getNextPage, + adr: cur, + } } // AvailablePrivateEndpointType the information of an AvailablePrivateEndpointType. @@ -5913,6 +4155,15 @@ type AvailablePrivateEndpointTypesResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for AvailablePrivateEndpointTypesResult. +func (apetr AvailablePrivateEndpointTypesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apetr.Value != nil { + objectMap["value"] = apetr.Value + } + return json.Marshal(objectMap) +} + // AvailablePrivateEndpointTypesResultIterator provides access to a complete listing of // AvailablePrivateEndpointType values. type AvailablePrivateEndpointTypesResultIterator struct { @@ -5982,10 +4233,15 @@ func (apetr AvailablePrivateEndpointTypesResult) IsEmpty() bool { return apetr.Value == nil || len(*apetr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (apetr AvailablePrivateEndpointTypesResult) hasNextLink() bool { + return apetr.NextLink != nil && len(*apetr.NextLink) != 0 +} + // availablePrivateEndpointTypesResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (apetr AvailablePrivateEndpointTypesResult) availablePrivateEndpointTypesResultPreparer(ctx context.Context) (*http.Request, error) { - if apetr.NextLink == nil || len(to.String(apetr.NextLink)) < 1 { + if !apetr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -6013,11 +4269,16 @@ func (page *AvailablePrivateEndpointTypesResultPage) NextWithContext(ctx context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.apetr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.apetr) + if err != nil { + return err + } + page.apetr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.apetr = next return nil } @@ -6047,8 +4308,11 @@ func (page AvailablePrivateEndpointTypesResultPage) Values() []AvailablePrivateE } // Creates a new instance of the AvailablePrivateEndpointTypesResultPage type. -func NewAvailablePrivateEndpointTypesResultPage(getNextPage func(context.Context, AvailablePrivateEndpointTypesResult) (AvailablePrivateEndpointTypesResult, error)) AvailablePrivateEndpointTypesResultPage { - return AvailablePrivateEndpointTypesResultPage{fn: getNextPage} +func NewAvailablePrivateEndpointTypesResultPage(cur AvailablePrivateEndpointTypesResult, getNextPage func(context.Context, AvailablePrivateEndpointTypesResult) (AvailablePrivateEndpointTypesResult, error)) AvailablePrivateEndpointTypesResultPage { + return AvailablePrivateEndpointTypesResultPage{ + fn: getNextPage, + apetr: cur, + } } // AvailableProvidersList list of available countries with details. @@ -6547,10 +4811,15 @@ func (afftlr AzureFirewallFqdnTagListResult) IsEmpty() bool { return afftlr.Value == nil || len(*afftlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (afftlr AzureFirewallFqdnTagListResult) hasNextLink() bool { + return afftlr.NextLink != nil && len(*afftlr.NextLink) != 0 +} + // azureFirewallFqdnTagListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (afftlr AzureFirewallFqdnTagListResult) azureFirewallFqdnTagListResultPreparer(ctx context.Context) (*http.Request, error) { - if afftlr.NextLink == nil || len(to.String(afftlr.NextLink)) < 1 { + if !afftlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -6578,11 +4847,16 @@ func (page *AzureFirewallFqdnTagListResultPage) NextWithContext(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.afftlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.afftlr) + if err != nil { + return err + } + page.afftlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.afftlr = next return nil } @@ -6612,8 +4886,11 @@ func (page AzureFirewallFqdnTagListResultPage) Values() []AzureFirewallFqdnTag { } // Creates a new instance of the AzureFirewallFqdnTagListResultPage type. -func NewAzureFirewallFqdnTagListResultPage(getNextPage func(context.Context, AzureFirewallFqdnTagListResult) (AzureFirewallFqdnTagListResult, error)) AzureFirewallFqdnTagListResultPage { - return AzureFirewallFqdnTagListResultPage{fn: getNextPage} +func NewAzureFirewallFqdnTagListResultPage(cur AzureFirewallFqdnTagListResult, getNextPage func(context.Context, AzureFirewallFqdnTagListResult) (AzureFirewallFqdnTagListResult, error)) AzureFirewallFqdnTagListResultPage { + return AzureFirewallFqdnTagListResultPage{ + fn: getNextPage, + afftlr: cur, + } } // AzureFirewallFqdnTagPropertiesFormat azure Firewall FQDN Tag Properties. @@ -6714,6 +4991,21 @@ type AzureFirewallIPConfigurationPropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for AzureFirewallIPConfigurationPropertiesFormat. +func (aficpf AzureFirewallIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aficpf.Subnet != nil { + objectMap["subnet"] = aficpf.Subnet + } + if aficpf.PublicIPAddress != nil { + objectMap["publicIPAddress"] = aficpf.PublicIPAddress + } + if aficpf.ProvisioningState != "" { + objectMap["provisioningState"] = aficpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // AzureFirewallListResult response for ListAzureFirewalls API service call. type AzureFirewallListResult struct { autorest.Response `json:"-"` @@ -6791,10 +5083,15 @@ func (aflr AzureFirewallListResult) IsEmpty() bool { return aflr.Value == nil || len(*aflr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (aflr AzureFirewallListResult) hasNextLink() bool { + return aflr.NextLink != nil && len(*aflr.NextLink) != 0 +} + // azureFirewallListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (aflr AzureFirewallListResult) azureFirewallListResultPreparer(ctx context.Context) (*http.Request, error) { - if aflr.NextLink == nil || len(to.String(aflr.NextLink)) < 1 { + if !aflr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -6822,11 +5119,16 @@ func (page *AzureFirewallListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.aflr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.aflr) + if err != nil { + return err + } + page.aflr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.aflr = next return nil } @@ -6856,8 +5158,11 @@ func (page AzureFirewallListResultPage) Values() []AzureFirewall { } // Creates a new instance of the AzureFirewallListResultPage type. -func NewAzureFirewallListResultPage(getNextPage func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error)) AzureFirewallListResultPage { - return AzureFirewallListResultPage{fn: getNextPage} +func NewAzureFirewallListResultPage(cur AzureFirewallListResult, getNextPage func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error)) AzureFirewallListResultPage { + return AzureFirewallListResultPage{ + fn: getNextPage, + aflr: cur, + } } // AzureFirewallNatRCAction azureFirewall NAT Rule Collection Action. @@ -7104,6 +5409,36 @@ type AzureFirewallPropertiesFormat struct { HubIPAddresses *HubIPAddresses `json:"hubIpAddresses,omitempty"` } +// MarshalJSON is the custom marshaler for AzureFirewallPropertiesFormat. +func (afpf AzureFirewallPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if afpf.ApplicationRuleCollections != nil { + objectMap["applicationRuleCollections"] = afpf.ApplicationRuleCollections + } + if afpf.NatRuleCollections != nil { + objectMap["natRuleCollections"] = afpf.NatRuleCollections + } + if afpf.NetworkRuleCollections != nil { + objectMap["networkRuleCollections"] = afpf.NetworkRuleCollections + } + if afpf.IPConfigurations != nil { + objectMap["ipConfigurations"] = afpf.IPConfigurations + } + if afpf.ProvisioningState != "" { + objectMap["provisioningState"] = afpf.ProvisioningState + } + if afpf.ThreatIntelMode != "" { + objectMap["threatIntelMode"] = afpf.ThreatIntelMode + } + if afpf.VirtualHub != nil { + objectMap["virtualHub"] = afpf.VirtualHub + } + if afpf.FirewallPolicy != nil { + objectMap["firewallPolicy"] = afpf.FirewallPolicy + } + return json.Marshal(objectMap) +} + // AzureFirewallPublicIPAddress public IP Address associated with azure firewall. type AzureFirewallPublicIPAddress struct { // Address - Public IP Address value. @@ -7119,12 +5454,25 @@ type AzureFirewallRCAction struct { // AzureFirewallsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type AzureFirewallsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AzureFirewallsClient) (AzureFirewall, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AzureFirewallsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AzureFirewallsCreateOrUpdateFuture) Result(client AzureFirewallsClient) (af AzureFirewall, err error) { +// result is the default implementation for AzureFirewallsCreateOrUpdateFuture.Result. +func (future *AzureFirewallsCreateOrUpdateFuture) result(client AzureFirewallsClient) (af AzureFirewall, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -7148,12 +5496,25 @@ func (future *AzureFirewallsCreateOrUpdateFuture) Result(client AzureFirewallsCl // AzureFirewallsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type AzureFirewallsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AzureFirewallsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AzureFirewallsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AzureFirewallsDeleteFuture) Result(client AzureFirewallsClient) (ar autorest.Response, err error) { +// result is the default implementation for AzureFirewallsDeleteFuture.Result. +func (future *AzureFirewallsDeleteFuture) result(client AzureFirewallsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -7328,6 +5689,15 @@ type BackendAddressPoolPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat. +func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bappf.ProvisioningState != nil { + objectMap["provisioningState"] = bappf.ProvisioningState + } + return json.Marshal(objectMap) +} + // BastionHost bastion Host resource. type BastionHost struct { autorest.Response `json:"-"` @@ -7621,10 +5991,15 @@ func (bhlr BastionHostListResult) IsEmpty() bool { return bhlr.Value == nil || len(*bhlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (bhlr BastionHostListResult) hasNextLink() bool { + return bhlr.NextLink != nil && len(*bhlr.NextLink) != 0 +} + // bastionHostListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (bhlr BastionHostListResult) bastionHostListResultPreparer(ctx context.Context) (*http.Request, error) { - if bhlr.NextLink == nil || len(to.String(bhlr.NextLink)) < 1 { + if !bhlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -7652,11 +6027,16 @@ func (page *BastionHostListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.bhlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.bhlr) + if err != nil { + return err + } + page.bhlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.bhlr = next return nil } @@ -7686,8 +6066,11 @@ func (page BastionHostListResultPage) Values() []BastionHost { } // Creates a new instance of the BastionHostListResultPage type. -func NewBastionHostListResultPage(getNextPage func(context.Context, BastionHostListResult) (BastionHostListResult, error)) BastionHostListResultPage { - return BastionHostListResultPage{fn: getNextPage} +func NewBastionHostListResultPage(cur BastionHostListResult, getNextPage func(context.Context, BastionHostListResult) (BastionHostListResult, error)) BastionHostListResultPage { + return BastionHostListResultPage{ + fn: getNextPage, + bhlr: cur, + } } // BastionHostPropertiesFormat properties of the Bastion Host. @@ -7703,12 +6086,25 @@ type BastionHostPropertiesFormat struct { // BastionHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type BastionHostsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BastionHostsClient) (BastionHost, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BastionHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BastionHostsCreateOrUpdateFuture) Result(client BastionHostsClient) (bh BastionHost, err error) { +// result is the default implementation for BastionHostsCreateOrUpdateFuture.Result. +func (future *BastionHostsCreateOrUpdateFuture) result(client BastionHostsClient) (bh BastionHost, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -7732,12 +6128,25 @@ func (future *BastionHostsCreateOrUpdateFuture) Result(client BastionHostsClient // BastionHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type BastionHostsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BastionHostsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BastionHostsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BastionHostsDeleteFuture) Result(client BastionHostsClient) (ar autorest.Response, err error) { +// result is the default implementation for BastionHostsDeleteFuture.Result. +func (future *BastionHostsDeleteFuture) result(client BastionHostsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -7755,12 +6164,25 @@ func (future *BastionHostsDeleteFuture) Result(client BastionHostsClient) (ar au // BastionHostsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type BastionHostsUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BastionHostsClient) (BastionHost, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BastionHostsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *BastionHostsUpdateTagsFuture) Result(client BastionHostsClient) (bh BastionHost, err error) { +// result is the default implementation for BastionHostsUpdateTagsFuture.Result. +func (future *BastionHostsUpdateTagsFuture) result(client BastionHostsClient) (bh BastionHost, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8005,10 +6427,15 @@ func (bsclr BgpServiceCommunityListResult) IsEmpty() bool { return bsclr.Value == nil || len(*bsclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (bsclr BgpServiceCommunityListResult) hasNextLink() bool { + return bsclr.NextLink != nil && len(*bsclr.NextLink) != 0 +} + // bgpServiceCommunityListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (bsclr BgpServiceCommunityListResult) bgpServiceCommunityListResultPreparer(ctx context.Context) (*http.Request, error) { - if bsclr.NextLink == nil || len(to.String(bsclr.NextLink)) < 1 { + if !bsclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8036,11 +6463,16 @@ func (page *BgpServiceCommunityListResultPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.bsclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.bsclr) + if err != nil { + return err + } + page.bsclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.bsclr = next return nil } @@ -8070,8 +6502,11 @@ func (page BgpServiceCommunityListResultPage) Values() []BgpServiceCommunity { } // Creates a new instance of the BgpServiceCommunityListResultPage type. -func NewBgpServiceCommunityListResultPage(getNextPage func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error)) BgpServiceCommunityListResultPage { - return BgpServiceCommunityListResultPage{fn: getNextPage} +func NewBgpServiceCommunityListResultPage(cur BgpServiceCommunityListResult, getNextPage func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error)) BgpServiceCommunityListResultPage { + return BgpServiceCommunityListResultPage{ + fn: getNextPage, + bsclr: cur, + } } // BgpServiceCommunityPropertiesFormat properties of Service Community. @@ -8398,12 +6833,25 @@ type ConnectionMonitorResultProperties struct { // ConnectionMonitorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ConnectionMonitorsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ConnectionMonitorsClient) (ConnectionMonitorResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ConnectionMonitorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ConnectionMonitorsCreateOrUpdateFuture) Result(client ConnectionMonitorsClient) (cmr ConnectionMonitorResult, err error) { +// result is the default implementation for ConnectionMonitorsCreateOrUpdateFuture.Result. +func (future *ConnectionMonitorsCreateOrUpdateFuture) result(client ConnectionMonitorsClient) (cmr ConnectionMonitorResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8427,12 +6875,25 @@ func (future *ConnectionMonitorsCreateOrUpdateFuture) Result(client ConnectionMo // ConnectionMonitorsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ConnectionMonitorsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ConnectionMonitorsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ConnectionMonitorsDeleteFuture) Result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ConnectionMonitorsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ConnectionMonitorsDeleteFuture.Result. +func (future *ConnectionMonitorsDeleteFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8458,12 +6919,25 @@ type ConnectionMonitorSource struct { // ConnectionMonitorsQueryFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ConnectionMonitorsQueryFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ConnectionMonitorsClient) (ConnectionMonitorQueryResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ConnectionMonitorsQueryFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ConnectionMonitorsQueryFuture) Result(client ConnectionMonitorsClient) (cmqr ConnectionMonitorQueryResult, err error) { +// result is the default implementation for ConnectionMonitorsQueryFuture.Result. +func (future *ConnectionMonitorsQueryFuture) result(client ConnectionMonitorsClient) (cmqr ConnectionMonitorQueryResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8487,12 +6961,25 @@ func (future *ConnectionMonitorsQueryFuture) Result(client ConnectionMonitorsCli // ConnectionMonitorsStartFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ConnectionMonitorsStartFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ConnectionMonitorsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ConnectionMonitorsStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ConnectionMonitorsStartFuture) Result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { +// result is the default implementation for ConnectionMonitorsStartFuture.Result. +func (future *ConnectionMonitorsStartFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8510,12 +6997,25 @@ func (future *ConnectionMonitorsStartFuture) Result(client ConnectionMonitorsCli // ConnectionMonitorsStopFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ConnectionMonitorsStopFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ConnectionMonitorsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ConnectionMonitorsStopFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ConnectionMonitorsStopFuture) Result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { +// result is the default implementation for ConnectionMonitorsStopFuture.Result. +func (future *ConnectionMonitorsStopFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8570,6 +7070,39 @@ type ConnectionStateSnapshot struct { Hops *[]ConnectivityHop `json:"hops,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectionStateSnapshot. +func (CSS ConnectionStateSnapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if CSS.ConnectionState != "" { + objectMap["connectionState"] = CSS.ConnectionState + } + if CSS.StartTime != nil { + objectMap["startTime"] = CSS.StartTime + } + if CSS.EndTime != nil { + objectMap["endTime"] = CSS.EndTime + } + if CSS.EvaluationState != "" { + objectMap["evaluationState"] = CSS.EvaluationState + } + if CSS.AvgLatencyInMs != nil { + objectMap["avgLatencyInMs"] = CSS.AvgLatencyInMs + } + if CSS.MinLatencyInMs != nil { + objectMap["minLatencyInMs"] = CSS.MinLatencyInMs + } + if CSS.MaxLatencyInMs != nil { + objectMap["maxLatencyInMs"] = CSS.MaxLatencyInMs + } + if CSS.ProbesSent != nil { + objectMap["probesSent"] = CSS.ProbesSent + } + if CSS.ProbesFailed != nil { + objectMap["probesFailed"] = CSS.ProbesFailed + } + return json.Marshal(objectMap) +} + // ConnectivityDestination parameters that define destination of connection. type ConnectivityDestination struct { // ResourceID - The ID of the resource to which a connection attempt will be made. @@ -8848,6 +7381,18 @@ type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceConfigurationPropertiesFormat. +func (cnicpf ContainerNetworkInterfaceConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cnicpf.IPConfigurations != nil { + objectMap["ipConfigurations"] = cnicpf.IPConfigurations + } + if cnicpf.ContainerNetworkInterfaces != nil { + objectMap["containerNetworkInterfaces"] = cnicpf.ContainerNetworkInterfaces + } + return json.Marshal(objectMap) +} + // ContainerNetworkInterfaceIPConfiguration the ip configuration for a container network interface. type ContainerNetworkInterfaceIPConfiguration struct { // ContainerNetworkInterfaceIPConfigurationPropertiesFormat - Properties of the container network interface IP configuration. @@ -8945,15 +7490,43 @@ type ContainerNetworkInterfacePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerNetworkInterfacePropertiesFormat. +func (cnipf ContainerNetworkInterfacePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cnipf.ContainerNetworkInterfaceConfiguration != nil { + objectMap["containerNetworkInterfaceConfiguration"] = cnipf.ContainerNetworkInterfaceConfiguration + } + if cnipf.Container != nil { + objectMap["container"] = cnipf.Container + } + if cnipf.IPConfigurations != nil { + objectMap["ipConfigurations"] = cnipf.IPConfigurations + } + return json.Marshal(objectMap) +} + // DdosCustomPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DdosCustomPoliciesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DdosCustomPoliciesClient) (DdosCustomPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DdosCustomPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DdosCustomPoliciesCreateOrUpdateFuture) Result(client DdosCustomPoliciesClient) (dcp DdosCustomPolicy, err error) { +// result is the default implementation for DdosCustomPoliciesCreateOrUpdateFuture.Result. +func (future *DdosCustomPoliciesCreateOrUpdateFuture) result(client DdosCustomPoliciesClient) (dcp DdosCustomPolicy, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -8977,12 +7550,25 @@ func (future *DdosCustomPoliciesCreateOrUpdateFuture) Result(client DdosCustomPo // DdosCustomPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DdosCustomPoliciesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DdosCustomPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DdosCustomPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DdosCustomPoliciesDeleteFuture) Result(client DdosCustomPoliciesClient) (ar autorest.Response, err error) { +// result is the default implementation for DdosCustomPoliciesDeleteFuture.Result. +func (future *DdosCustomPoliciesDeleteFuture) result(client DdosCustomPoliciesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -9000,12 +7586,25 @@ func (future *DdosCustomPoliciesDeleteFuture) Result(client DdosCustomPoliciesCl // DdosCustomPoliciesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DdosCustomPoliciesUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DdosCustomPoliciesClient) (DdosCustomPolicy, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DdosCustomPoliciesUpdateTagsFuture) Result(client DdosCustomPoliciesClient) (dcp DdosCustomPolicy, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DdosCustomPoliciesUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DdosCustomPoliciesUpdateTagsFuture.Result. +func (future *DdosCustomPoliciesUpdateTagsFuture) result(client DdosCustomPoliciesClient) (dcp DdosCustomPolicy, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -9153,6 +7752,15 @@ type DdosCustomPolicyPropertiesFormat struct { ProtocolCustomSettings *[]ProtocolCustomSettingsFormat `json:"protocolCustomSettings,omitempty"` } +// MarshalJSON is the custom marshaler for DdosCustomPolicyPropertiesFormat. +func (dcppf DdosCustomPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcppf.ProtocolCustomSettings != nil { + objectMap["protocolCustomSettings"] = dcppf.ProtocolCustomSettings + } + return json.Marshal(objectMap) +} + // DdosProtectionPlan a DDoS protection plan in a resource group. type DdosProtectionPlan struct { autorest.Response `json:"-"` @@ -9274,6 +7882,15 @@ type DdosProtectionPlanListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for DdosProtectionPlanListResult. +func (dpplr DdosProtectionPlanListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpplr.Value != nil { + objectMap["value"] = dpplr.Value + } + return json.Marshal(objectMap) +} + // DdosProtectionPlanListResultIterator provides access to a complete listing of DdosProtectionPlan values. type DdosProtectionPlanListResultIterator struct { i int @@ -9342,10 +7959,15 @@ func (dpplr DdosProtectionPlanListResult) IsEmpty() bool { return dpplr.Value == nil || len(*dpplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dpplr DdosProtectionPlanListResult) hasNextLink() bool { + return dpplr.NextLink != nil && len(*dpplr.NextLink) != 0 +} + // ddosProtectionPlanListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dpplr DdosProtectionPlanListResult) ddosProtectionPlanListResultPreparer(ctx context.Context) (*http.Request, error) { - if dpplr.NextLink == nil || len(to.String(dpplr.NextLink)) < 1 { + if !dpplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -9373,11 +7995,16 @@ func (page *DdosProtectionPlanListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dpplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dpplr) + if err != nil { + return err + } + page.dpplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dpplr = next return nil } @@ -9407,8 +8034,11 @@ func (page DdosProtectionPlanListResultPage) Values() []DdosProtectionPlan { } // Creates a new instance of the DdosProtectionPlanListResultPage type. -func NewDdosProtectionPlanListResultPage(getNextPage func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error)) DdosProtectionPlanListResultPage { - return DdosProtectionPlanListResultPage{fn: getNextPage} +func NewDdosProtectionPlanListResultPage(cur DdosProtectionPlanListResult, getNextPage func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error)) DdosProtectionPlanListResultPage { + return DdosProtectionPlanListResultPage{ + fn: getNextPage, + dpplr: cur, + } } // DdosProtectionPlanPropertiesFormat dDoS protection plan properties. @@ -9424,12 +8054,25 @@ type DdosProtectionPlanPropertiesFormat struct { // DdosProtectionPlansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DdosProtectionPlansCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DdosProtectionPlansClient) (DdosProtectionPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DdosProtectionPlansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DdosProtectionPlansCreateOrUpdateFuture) Result(client DdosProtectionPlansClient) (dpp DdosProtectionPlan, err error) { +// result is the default implementation for DdosProtectionPlansCreateOrUpdateFuture.Result. +func (future *DdosProtectionPlansCreateOrUpdateFuture) result(client DdosProtectionPlansClient) (dpp DdosProtectionPlan, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -9453,12 +8096,25 @@ func (future *DdosProtectionPlansCreateOrUpdateFuture) Result(client DdosProtect // DdosProtectionPlansDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DdosProtectionPlansDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DdosProtectionPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DdosProtectionPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DdosProtectionPlansDeleteFuture) Result(client DdosProtectionPlansClient) (ar autorest.Response, err error) { +// result is the default implementation for DdosProtectionPlansDeleteFuture.Result. +func (future *DdosProtectionPlansDeleteFuture) result(client DdosProtectionPlansClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -9476,12 +8132,25 @@ func (future *DdosProtectionPlansDeleteFuture) Result(client DdosProtectionPlans // DdosProtectionPlansUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DdosProtectionPlansUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DdosProtectionPlansClient) (DdosProtectionPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DdosProtectionPlansUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DdosProtectionPlansUpdateTagsFuture) Result(client DdosProtectionPlansClient) (dpp DdosProtectionPlan, err error) { +// result is the default implementation for DdosProtectionPlansUpdateTagsFuture.Result. +func (future *DdosProtectionPlansUpdateTagsFuture) result(client DdosProtectionPlansClient) (dpp DdosProtectionPlan, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -9673,6 +8342,15 @@ type EffectiveNetworkSecurityGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for EffectiveNetworkSecurityGroupListResult. +func (ensglr EffectiveNetworkSecurityGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ensglr.Value != nil { + objectMap["value"] = ensglr.Value + } + return json.Marshal(objectMap) +} + // EffectiveNetworkSecurityRule effective network security rules. type EffectiveNetworkSecurityRule struct { // Name - The name of the security rule specified by the user (if created by the user). @@ -9734,6 +8412,15 @@ type EffectiveRouteListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for EffectiveRouteListResult. +func (erlr EffectiveRouteListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erlr.Value != nil { + objectMap["value"] = erlr.Value + } + return json.Marshal(objectMap) +} + // EndpointServiceResult endpoint service. type EndpointServiceResult struct { // Name - READ-ONLY; Name of the endpoint service. @@ -9744,6 +8431,15 @@ type EndpointServiceResult struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for EndpointServiceResult. +func (esr EndpointServiceResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esr.ID != nil { + objectMap["id"] = esr.ID + } + return json.Marshal(objectMap) +} + // EndpointServicesListResult response for the ListAvailableEndpointServices API service call. type EndpointServicesListResult struct { autorest.Response `json:"-"` @@ -9822,10 +8518,15 @@ func (eslr EndpointServicesListResult) IsEmpty() bool { return eslr.Value == nil || len(*eslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (eslr EndpointServicesListResult) hasNextLink() bool { + return eslr.NextLink != nil && len(*eslr.NextLink) != 0 +} + // endpointServicesListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (eslr EndpointServicesListResult) endpointServicesListResultPreparer(ctx context.Context) (*http.Request, error) { - if eslr.NextLink == nil || len(to.String(eslr.NextLink)) < 1 { + if !eslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -9853,11 +8554,16 @@ func (page *EndpointServicesListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.eslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.eslr) + if err != nil { + return err + } + page.eslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.eslr = next return nil } @@ -9887,8 +8593,11 @@ func (page EndpointServicesListResultPage) Values() []EndpointServiceResult { } // Creates a new instance of the EndpointServicesListResultPage type. -func NewEndpointServicesListResultPage(getNextPage func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error)) EndpointServicesListResultPage { - return EndpointServicesListResultPage{fn: getNextPage} +func NewEndpointServicesListResultPage(cur EndpointServicesListResult, getNextPage func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error)) EndpointServicesListResultPage { + return EndpointServicesListResultPage{ + fn: getNextPage, + eslr: cur, + } } // Error common error representation. @@ -9933,6 +8642,21 @@ type EvaluatedNetworkSecurityGroup struct { RulesEvaluationResult *[]SecurityRulesEvaluationResult `json:"rulesEvaluationResult,omitempty"` } +// MarshalJSON is the custom marshaler for EvaluatedNetworkSecurityGroup. +func (ensg EvaluatedNetworkSecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ensg.NetworkSecurityGroupID != nil { + objectMap["networkSecurityGroupId"] = ensg.NetworkSecurityGroupID + } + if ensg.AppliedTo != nil { + objectMap["appliedTo"] = ensg.AppliedTo + } + if ensg.MatchedRule != nil { + objectMap["matchedRule"] = ensg.MatchedRule + } + return json.Marshal(objectMap) +} + // ExpressRouteCircuit expressRouteCircuit resource. type ExpressRouteCircuit struct { autorest.Response `json:"-"` @@ -10167,12 +8891,25 @@ func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error { // ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitAuthorizationsClient) (ExpressRouteCircuitAuthorization, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) Result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) { +// result is the default implementation for ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.Result. +func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -10196,12 +8933,25 @@ func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) Result(clie // ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ExpressRouteCircuitAuthorizationsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitAuthorizationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) Result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) { +// result is the default implementation for ExpressRouteCircuitAuthorizationsDeleteFuture.Result. +func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -10386,10 +9136,15 @@ func (ercclr ExpressRouteCircuitConnectionListResult) IsEmpty() bool { return ercclr.Value == nil || len(*ercclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ercclr ExpressRouteCircuitConnectionListResult) hasNextLink() bool { + return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0 +} + // expressRouteCircuitConnectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ercclr ExpressRouteCircuitConnectionListResult) expressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if ercclr.NextLink == nil || len(to.String(ercclr.NextLink)) < 1 { + if !ercclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -10417,11 +9172,16 @@ func (page *ExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ercclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ercclr) + if err != nil { + return err + } + page.ercclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ercclr = next return nil } @@ -10451,8 +9211,11 @@ func (page ExpressRouteCircuitConnectionListResultPage) Values() []ExpressRouteC } // Creates a new instance of the ExpressRouteCircuitConnectionListResultPage type. -func NewExpressRouteCircuitConnectionListResultPage(getNextPage func(context.Context, ExpressRouteCircuitConnectionListResult) (ExpressRouteCircuitConnectionListResult, error)) ExpressRouteCircuitConnectionListResultPage { - return ExpressRouteCircuitConnectionListResultPage{fn: getNextPage} +func NewExpressRouteCircuitConnectionListResultPage(cur ExpressRouteCircuitConnectionListResult, getNextPage func(context.Context, ExpressRouteCircuitConnectionListResult) (ExpressRouteCircuitConnectionListResult, error)) ExpressRouteCircuitConnectionListResultPage { + return ExpressRouteCircuitConnectionListResultPage{ + fn: getNextPage, + ercclr: cur, + } } // ExpressRouteCircuitConnectionPropertiesFormat properties of the express route circuit connection. @@ -10471,15 +9234,49 @@ type ExpressRouteCircuitConnectionPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCircuitConnectionPropertiesFormat. +func (erccpf ExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccpf.ExpressRouteCircuitPeering != nil { + objectMap["expressRouteCircuitPeering"] = erccpf.ExpressRouteCircuitPeering + } + if erccpf.PeerExpressRouteCircuitPeering != nil { + objectMap["peerExpressRouteCircuitPeering"] = erccpf.PeerExpressRouteCircuitPeering + } + if erccpf.AddressPrefix != nil { + objectMap["addressPrefix"] = erccpf.AddressPrefix + } + if erccpf.AuthorizationKey != nil { + objectMap["authorizationKey"] = erccpf.AuthorizationKey + } + if erccpf.CircuitConnectionStatus != "" { + objectMap["circuitConnectionStatus"] = erccpf.CircuitConnectionStatus + } + return json.Marshal(objectMap) +} + // ExpressRouteCircuitConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ExpressRouteCircuitConnectionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitConnectionsClient) (ExpressRouteCircuitConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) Result(client ExpressRouteCircuitConnectionsClient) (ercc ExpressRouteCircuitConnection, err error) { +// result is the default implementation for ExpressRouteCircuitConnectionsCreateOrUpdateFuture.Result. +func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) result(client ExpressRouteCircuitConnectionsClient) (ercc ExpressRouteCircuitConnection, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -10503,12 +9300,25 @@ func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) Result(client // ExpressRouteCircuitConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteCircuitConnectionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitConnectionsDeleteFuture) Result(client ExpressRouteCircuitConnectionsClient) (ar autorest.Response, err error) { +// result is the default implementation for ExpressRouteCircuitConnectionsDeleteFuture.Result. +func (future *ExpressRouteCircuitConnectionsDeleteFuture) result(client ExpressRouteCircuitConnectionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -10601,10 +9411,15 @@ func (erclr ExpressRouteCircuitListResult) IsEmpty() bool { return erclr.Value == nil || len(*erclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erclr ExpressRouteCircuitListResult) hasNextLink() bool { + return erclr.NextLink != nil && len(*erclr.NextLink) != 0 +} + // expressRouteCircuitListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer(ctx context.Context) (*http.Request, error) { - if erclr.NextLink == nil || len(to.String(erclr.NextLink)) < 1 { + if !erclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -10632,11 +9447,16 @@ func (page *ExpressRouteCircuitListResultPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erclr) + if err != nil { + return err + } + page.erclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erclr = next return nil } @@ -10666,8 +9486,11 @@ func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit { } // Creates a new instance of the ExpressRouteCircuitListResultPage type. -func NewExpressRouteCircuitListResultPage(getNextPage func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)) ExpressRouteCircuitListResultPage { - return ExpressRouteCircuitListResultPage{fn: getNextPage} +func NewExpressRouteCircuitListResultPage(cur ExpressRouteCircuitListResult, getNextPage func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)) ExpressRouteCircuitListResultPage { + return ExpressRouteCircuitListResultPage{ + fn: getNextPage, + erclr: cur, + } } // ExpressRouteCircuitPeering peering in an ExpressRouteCircuit resource. @@ -10861,10 +9684,15 @@ func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool { return ercplr.Value == nil || len(*ercplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ercplr ExpressRouteCircuitPeeringListResult) hasNextLink() bool { + return ercplr.NextLink != nil && len(*ercplr.NextLink) != 0 +} + // expressRouteCircuitPeeringListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if ercplr.NextLink == nil || len(to.String(ercplr.NextLink)) < 1 { + if !ercplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -10892,11 +9720,16 @@ func (page *ExpressRouteCircuitPeeringListResultPage) NextWithContext(ctx contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ercplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ercplr) + if err != nil { + return err + } + page.ercplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ercplr = next return nil } @@ -10926,8 +9759,11 @@ func (page ExpressRouteCircuitPeeringListResultPage) Values() []ExpressRouteCirc } // Creates a new instance of the ExpressRouteCircuitPeeringListResultPage type. -func NewExpressRouteCircuitPeeringListResultPage(getNextPage func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)) ExpressRouteCircuitPeeringListResultPage { - return ExpressRouteCircuitPeeringListResultPage{fn: getNextPage} +func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringListResult, getNextPage func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)) ExpressRouteCircuitPeeringListResultPage { + return ExpressRouteCircuitPeeringListResultPage{ + fn: getNextPage, + ercplr: cur, + } } // ExpressRouteCircuitPeeringPropertiesFormat properties of the express route circuit peering. @@ -10974,15 +9810,91 @@ type ExpressRouteCircuitPeeringPropertiesFormat struct { PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeeringPropertiesFormat. +func (ercppf ExpressRouteCircuitPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ercppf.PeeringType != "" { + objectMap["peeringType"] = ercppf.PeeringType + } + if ercppf.State != "" { + objectMap["state"] = ercppf.State + } + if ercppf.AzureASN != nil { + objectMap["azureASN"] = ercppf.AzureASN + } + if ercppf.PeerASN != nil { + objectMap["peerASN"] = ercppf.PeerASN + } + if ercppf.PrimaryPeerAddressPrefix != nil { + objectMap["primaryPeerAddressPrefix"] = ercppf.PrimaryPeerAddressPrefix + } + if ercppf.SecondaryPeerAddressPrefix != nil { + objectMap["secondaryPeerAddressPrefix"] = ercppf.SecondaryPeerAddressPrefix + } + if ercppf.PrimaryAzurePort != nil { + objectMap["primaryAzurePort"] = ercppf.PrimaryAzurePort + } + if ercppf.SecondaryAzurePort != nil { + objectMap["secondaryAzurePort"] = ercppf.SecondaryAzurePort + } + if ercppf.SharedKey != nil { + objectMap["sharedKey"] = ercppf.SharedKey + } + if ercppf.VlanID != nil { + objectMap["vlanId"] = ercppf.VlanID + } + if ercppf.MicrosoftPeeringConfig != nil { + objectMap["microsoftPeeringConfig"] = ercppf.MicrosoftPeeringConfig + } + if ercppf.Stats != nil { + objectMap["stats"] = ercppf.Stats + } + if ercppf.ProvisioningState != nil { + objectMap["provisioningState"] = ercppf.ProvisioningState + } + if ercppf.GatewayManagerEtag != nil { + objectMap["gatewayManagerEtag"] = ercppf.GatewayManagerEtag + } + if ercppf.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = ercppf.LastModifiedBy + } + if ercppf.RouteFilter != nil { + objectMap["routeFilter"] = ercppf.RouteFilter + } + if ercppf.Ipv6PeeringConfig != nil { + objectMap["ipv6PeeringConfig"] = ercppf.Ipv6PeeringConfig + } + if ercppf.ExpressRouteConnection != nil { + objectMap["expressRouteConnection"] = ercppf.ExpressRouteConnection + } + if ercppf.Connections != nil { + objectMap["connections"] = ercppf.Connections + } + return json.Marshal(objectMap) +} + // ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitPeeringsClient) (ExpressRouteCircuitPeering, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) Result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExpressRouteCircuitPeeringsCreateOrUpdateFuture.Result. +func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11006,12 +9918,25 @@ func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) Result(client Exp // ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteCircuitPeeringsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitPeeringsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitPeeringsDeleteFuture) Result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) { +// result is the default implementation for ExpressRouteCircuitPeeringsDeleteFuture.Result. +func (future *ExpressRouteCircuitPeeringsDeleteFuture) result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11058,6 +9983,51 @@ type ExpressRouteCircuitPropertiesFormat struct { GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCircuitPropertiesFormat. +func (ercpf ExpressRouteCircuitPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ercpf.AllowClassicOperations != nil { + objectMap["allowClassicOperations"] = ercpf.AllowClassicOperations + } + if ercpf.CircuitProvisioningState != nil { + objectMap["circuitProvisioningState"] = ercpf.CircuitProvisioningState + } + if ercpf.ServiceProviderProvisioningState != "" { + objectMap["serviceProviderProvisioningState"] = ercpf.ServiceProviderProvisioningState + } + if ercpf.Authorizations != nil { + objectMap["authorizations"] = ercpf.Authorizations + } + if ercpf.Peerings != nil { + objectMap["peerings"] = ercpf.Peerings + } + if ercpf.ServiceKey != nil { + objectMap["serviceKey"] = ercpf.ServiceKey + } + if ercpf.ServiceProviderNotes != nil { + objectMap["serviceProviderNotes"] = ercpf.ServiceProviderNotes + } + if ercpf.ServiceProviderProperties != nil { + objectMap["serviceProviderProperties"] = ercpf.ServiceProviderProperties + } + if ercpf.ExpressRoutePort != nil { + objectMap["expressRoutePort"] = ercpf.ExpressRoutePort + } + if ercpf.BandwidthInGbps != nil { + objectMap["bandwidthInGbps"] = ercpf.BandwidthInGbps + } + if ercpf.ProvisioningState != nil { + objectMap["provisioningState"] = ercpf.ProvisioningState + } + if ercpf.GatewayManagerEtag != nil { + objectMap["gatewayManagerEtag"] = ercpf.GatewayManagerEtag + } + if ercpf.GlobalReachEnabled != nil { + objectMap["globalReachEnabled"] = ercpf.GlobalReachEnabled + } + return json.Marshal(objectMap) +} + // ExpressRouteCircuitReference reference to an express route circuit. type ExpressRouteCircuitReference struct { // ID - Corresponding Express Route Circuit Id. @@ -11105,12 +10075,25 @@ type ExpressRouteCircuitsArpTableListResult struct { // ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteCircuitsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitsCreateOrUpdateFuture) Result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { +// result is the default implementation for ExpressRouteCircuitsCreateOrUpdateFuture.Result. +func (future *ExpressRouteCircuitsCreateOrUpdateFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11134,12 +10117,25 @@ func (future *ExpressRouteCircuitsCreateOrUpdateFuture) Result(client ExpressRou // ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteCircuitsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitsDeleteFuture) Result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExpressRouteCircuitsDeleteFuture.Result. +func (future *ExpressRouteCircuitsDeleteFuture) result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11178,12 +10174,25 @@ type ExpressRouteCircuitSku struct { // ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteCircuitsListArpTableFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsArpTableListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitsListArpTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitsListArpTableFuture) Result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { +// result is the default implementation for ExpressRouteCircuitsListArpTableFuture.Result. +func (future *ExpressRouteCircuitsListArpTableFuture) result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11207,12 +10216,25 @@ func (future *ExpressRouteCircuitsListArpTableFuture) Result(client ExpressRoute // ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteCircuitsListRoutesTableFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitsListRoutesTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitsListRoutesTableFuture) Result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { +// result is the default implementation for ExpressRouteCircuitsListRoutesTableFuture.Result. +func (future *ExpressRouteCircuitsListRoutesTableFuture) result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11236,12 +10258,25 @@ func (future *ExpressRouteCircuitsListRoutesTableFuture) Result(client ExpressRo // ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ExpressRouteCircuitsListRoutesTableSummaryFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableSummaryListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) Result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { +// result is the default implementation for ExpressRouteCircuitsListRoutesTableSummaryFuture.Result. +func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11298,12 +10333,25 @@ type ExpressRouteCircuitStats struct { // ExpressRouteCircuitsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteCircuitsUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCircuitsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCircuitsUpdateTagsFuture) Result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { +// result is the default implementation for ExpressRouteCircuitsUpdateTagsFuture.Result. +func (future *ExpressRouteCircuitsUpdateTagsFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11420,12 +10468,25 @@ type ExpressRouteConnectionProperties struct { // ExpressRouteConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type ExpressRouteConnectionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteConnectionsClient) (ExpressRouteConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteConnectionsCreateOrUpdateFuture) Result(client ExpressRouteConnectionsClient) (erc ExpressRouteConnection, err error) { +// result is the default implementation for ExpressRouteConnectionsCreateOrUpdateFuture.Result. +func (future *ExpressRouteConnectionsCreateOrUpdateFuture) result(client ExpressRouteConnectionsClient) (erc ExpressRouteConnection, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11449,12 +10510,25 @@ func (future *ExpressRouteConnectionsCreateOrUpdateFuture) Result(client Express // ExpressRouteConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteConnectionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteConnectionsDeleteFuture) Result(client ExpressRouteConnectionsClient) (ar autorest.Response, err error) { +// result is the default implementation for ExpressRouteConnectionsDeleteFuture.Result. +func (future *ExpressRouteConnectionsDeleteFuture) result(client ExpressRouteConnectionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -11593,6 +10667,15 @@ type ExpressRouteCrossConnectionListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionListResult. +func (ercclr ExpressRouteCrossConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ercclr.Value != nil { + objectMap["value"] = ercclr.Value + } + return json.Marshal(objectMap) +} + // ExpressRouteCrossConnectionListResultIterator provides access to a complete listing of // ExpressRouteCrossConnection values. type ExpressRouteCrossConnectionListResultIterator struct { @@ -11662,10 +10745,15 @@ func (ercclr ExpressRouteCrossConnectionListResult) IsEmpty() bool { return ercclr.Value == nil || len(*ercclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ercclr ExpressRouteCrossConnectionListResult) hasNextLink() bool { + return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0 +} + // expressRouteCrossConnectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ercclr ExpressRouteCrossConnectionListResult) expressRouteCrossConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if ercclr.NextLink == nil || len(to.String(ercclr.NextLink)) < 1 { + if !ercclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11693,11 +10781,16 @@ func (page *ExpressRouteCrossConnectionListResultPage) NextWithContext(ctx conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ercclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ercclr) + if err != nil { + return err + } + page.ercclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ercclr = next return nil } @@ -11727,8 +10820,11 @@ func (page ExpressRouteCrossConnectionListResultPage) Values() []ExpressRouteCro } // Creates a new instance of the ExpressRouteCrossConnectionListResultPage type. -func NewExpressRouteCrossConnectionListResultPage(getNextPage func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error)) ExpressRouteCrossConnectionListResultPage { - return ExpressRouteCrossConnectionListResultPage{fn: getNextPage} +func NewExpressRouteCrossConnectionListResultPage(cur ExpressRouteCrossConnectionListResult, getNextPage func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error)) ExpressRouteCrossConnectionListResultPage { + return ExpressRouteCrossConnectionListResultPage{ + fn: getNextPage, + ercclr: cur, + } } // ExpressRouteCrossConnectionPeering peering in an ExpressRoute Cross Connection resource. @@ -11820,6 +10916,15 @@ type ExpressRouteCrossConnectionPeeringList struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringList. +func (erccpl ExpressRouteCrossConnectionPeeringList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccpl.Value != nil { + objectMap["value"] = erccpl.Value + } + return json.Marshal(objectMap) +} + // ExpressRouteCrossConnectionPeeringListIterator provides access to a complete listing of // ExpressRouteCrossConnectionPeering values. type ExpressRouteCrossConnectionPeeringListIterator struct { @@ -11889,10 +10994,15 @@ func (erccpl ExpressRouteCrossConnectionPeeringList) IsEmpty() bool { return erccpl.Value == nil || len(*erccpl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erccpl ExpressRouteCrossConnectionPeeringList) hasNextLink() bool { + return erccpl.NextLink != nil && len(*erccpl.NextLink) != 0 +} + // expressRouteCrossConnectionPeeringListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erccpl ExpressRouteCrossConnectionPeeringList) expressRouteCrossConnectionPeeringListPreparer(ctx context.Context) (*http.Request, error) { - if erccpl.NextLink == nil || len(to.String(erccpl.NextLink)) < 1 { + if !erccpl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11920,11 +11030,16 @@ func (page *ExpressRouteCrossConnectionPeeringListPage) NextWithContext(ctx cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erccpl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erccpl) + if err != nil { + return err + } + page.erccpl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erccpl = next return nil } @@ -11954,8 +11069,11 @@ func (page ExpressRouteCrossConnectionPeeringListPage) Values() []ExpressRouteCr } // Creates a new instance of the ExpressRouteCrossConnectionPeeringListPage type. -func NewExpressRouteCrossConnectionPeeringListPage(getNextPage func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error)) ExpressRouteCrossConnectionPeeringListPage { - return ExpressRouteCrossConnectionPeeringListPage{fn: getNextPage} +func NewExpressRouteCrossConnectionPeeringListPage(cur ExpressRouteCrossConnectionPeeringList, getNextPage func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error)) ExpressRouteCrossConnectionPeeringListPage { + return ExpressRouteCrossConnectionPeeringListPage{ + fn: getNextPage, + erccpl: cur, + } } // ExpressRouteCrossConnectionPeeringProperties properties of express route cross connection peering. @@ -11992,15 +11110,67 @@ type ExpressRouteCrossConnectionPeeringProperties struct { Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringProperties. +func (erccpp ExpressRouteCrossConnectionPeeringProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccpp.PeeringType != "" { + objectMap["peeringType"] = erccpp.PeeringType + } + if erccpp.State != "" { + objectMap["state"] = erccpp.State + } + if erccpp.PeerASN != nil { + objectMap["peerASN"] = erccpp.PeerASN + } + if erccpp.PrimaryPeerAddressPrefix != nil { + objectMap["primaryPeerAddressPrefix"] = erccpp.PrimaryPeerAddressPrefix + } + if erccpp.SecondaryPeerAddressPrefix != nil { + objectMap["secondaryPeerAddressPrefix"] = erccpp.SecondaryPeerAddressPrefix + } + if erccpp.SharedKey != nil { + objectMap["sharedKey"] = erccpp.SharedKey + } + if erccpp.VlanID != nil { + objectMap["vlanId"] = erccpp.VlanID + } + if erccpp.MicrosoftPeeringConfig != nil { + objectMap["microsoftPeeringConfig"] = erccpp.MicrosoftPeeringConfig + } + if erccpp.GatewayManagerEtag != nil { + objectMap["gatewayManagerEtag"] = erccpp.GatewayManagerEtag + } + if erccpp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = erccpp.LastModifiedBy + } + if erccpp.Ipv6PeeringConfig != nil { + objectMap["ipv6PeeringConfig"] = erccpp.Ipv6PeeringConfig + } + return json.Marshal(objectMap) +} + // ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCrossConnectionPeeringsClient) (ExpressRouteCrossConnectionPeering, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) Result(client ExpressRouteCrossConnectionPeeringsClient) (erccp ExpressRouteCrossConnectionPeering, err error) { +// result is the default implementation for ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture.Result. +func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (erccp ExpressRouteCrossConnectionPeering, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12024,12 +11194,25 @@ func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) Result(cl // ExpressRouteCrossConnectionPeeringsDeleteFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ExpressRouteCrossConnectionPeeringsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCrossConnectionPeeringsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) Result(client ExpressRouteCrossConnectionPeeringsClient) (ar autorest.Response, err error) { +// result is the default implementation for ExpressRouteCrossConnectionPeeringsDeleteFuture.Result. +func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12068,6 +11251,30 @@ type ExpressRouteCrossConnectionProperties struct { Peerings *[]ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionProperties. +func (erccp ExpressRouteCrossConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccp.PeeringLocation != nil { + objectMap["peeringLocation"] = erccp.PeeringLocation + } + if erccp.BandwidthInMbps != nil { + objectMap["bandwidthInMbps"] = erccp.BandwidthInMbps + } + if erccp.ExpressRouteCircuit != nil { + objectMap["expressRouteCircuit"] = erccp.ExpressRouteCircuit + } + if erccp.ServiceProviderProvisioningState != "" { + objectMap["serviceProviderProvisioningState"] = erccp.ServiceProviderProvisioningState + } + if erccp.ServiceProviderNotes != nil { + objectMap["serviceProviderNotes"] = erccp.ServiceProviderNotes + } + if erccp.Peerings != nil { + objectMap["peerings"] = erccp.Peerings + } + return json.Marshal(objectMap) +} + // ExpressRouteCrossConnectionRoutesTableSummary the routes table associated with the ExpressRouteCircuit. type ExpressRouteCrossConnectionRoutesTableSummary struct { // Neighbor - IP address of Neighbor router. @@ -12083,12 +11290,25 @@ type ExpressRouteCrossConnectionRoutesTableSummary struct { // ExpressRouteCrossConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ExpressRouteCrossConnectionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnection, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) Result(client ExpressRouteCrossConnectionsClient) (ercc ExpressRouteCrossConnection, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExpressRouteCrossConnectionsCreateOrUpdateFuture.Result. +func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionsClient) (ercc ExpressRouteCrossConnection, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12112,12 +11332,25 @@ func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) Result(client Ex // ExpressRouteCrossConnectionsListArpTableFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ExpressRouteCrossConnectionsListArpTableFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsArpTableListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCrossConnectionsListArpTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCrossConnectionsListArpTableFuture) Result(client ExpressRouteCrossConnectionsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { +// result is the default implementation for ExpressRouteCrossConnectionsListArpTableFuture.Result. +func (future *ExpressRouteCrossConnectionsListArpTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12141,12 +11374,25 @@ func (future *ExpressRouteCrossConnectionsListArpTableFuture) Result(client Expr // ExpressRouteCrossConnectionsListRoutesTableFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ExpressRouteCrossConnectionsListRoutesTableFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsRoutesTableListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) Result(client ExpressRouteCrossConnectionsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { +// result is the default implementation for ExpressRouteCrossConnectionsListRoutesTableFuture.Result. +func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12170,12 +11416,25 @@ func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) Result(client E // ExpressRouteCrossConnectionsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving // the results of a long-running operation. type ExpressRouteCrossConnectionsListRoutesTableSummaryFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnectionsRoutesTableSummaryListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) Result(client ExpressRouteCrossConnectionsClient) (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) { +// result is the default implementation for ExpressRouteCrossConnectionsListRoutesTableSummaryFuture.Result. +func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) result(client ExpressRouteCrossConnectionsClient) (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12206,15 +11465,37 @@ type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionsRoutesTableSummaryListResult. +func (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccrtslr.Value != nil { + objectMap["value"] = erccrtslr.Value + } + return json.Marshal(objectMap) +} + // ExpressRouteCrossConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type ExpressRouteCrossConnectionsUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteCrossConnectionsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteCrossConnectionsUpdateTagsFuture) Result(client ExpressRouteCrossConnectionsClient) (ercc ExpressRouteCrossConnection, err error) { +// result is the default implementation for ExpressRouteCrossConnectionsUpdateTagsFuture.Result. +func (future *ExpressRouteCrossConnectionsUpdateTagsFuture) result(client ExpressRouteCrossConnectionsClient) (ercc ExpressRouteCrossConnection, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12369,6 +11650,21 @@ type ExpressRouteGatewayProperties struct { VirtualHub *VirtualHubID `json:"virtualHub,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteGatewayProperties. +func (ergp ExpressRouteGatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ergp.AutoScaleConfiguration != nil { + objectMap["autoScaleConfiguration"] = ergp.AutoScaleConfiguration + } + if ergp.ProvisioningState != "" { + objectMap["provisioningState"] = ergp.ProvisioningState + } + if ergp.VirtualHub != nil { + objectMap["virtualHub"] = ergp.VirtualHub + } + return json.Marshal(objectMap) +} + // ExpressRouteGatewayPropertiesAutoScaleConfiguration configuration for auto scaling. type ExpressRouteGatewayPropertiesAutoScaleConfiguration struct { // Bounds - Minimum and maximum number of scale units to deploy. @@ -12387,12 +11683,25 @@ type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds struct { // ExpressRouteGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteGatewaysCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteGatewaysClient) (ExpressRouteGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteGatewaysCreateOrUpdateFuture) Result(client ExpressRouteGatewaysClient) (erg ExpressRouteGateway, err error) { +// result is the default implementation for ExpressRouteGatewaysCreateOrUpdateFuture.Result. +func (future *ExpressRouteGatewaysCreateOrUpdateFuture) result(client ExpressRouteGatewaysClient) (erg ExpressRouteGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12416,12 +11725,25 @@ func (future *ExpressRouteGatewaysCreateOrUpdateFuture) Result(client ExpressRou // ExpressRouteGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRouteGatewaysDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteGatewaysClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRouteGatewaysDeleteFuture) Result(client ExpressRouteGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for ExpressRouteGatewaysDeleteFuture.Result. +func (future *ExpressRouteGatewaysDeleteFuture) result(client ExpressRouteGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12592,10 +11914,15 @@ func (erllr ExpressRouteLinkListResult) IsEmpty() bool { return erllr.Value == nil || len(*erllr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erllr ExpressRouteLinkListResult) hasNextLink() bool { + return erllr.NextLink != nil && len(*erllr.NextLink) != 0 +} + // expressRouteLinkListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erllr ExpressRouteLinkListResult) expressRouteLinkListResultPreparer(ctx context.Context) (*http.Request, error) { - if erllr.NextLink == nil || len(to.String(erllr.NextLink)) < 1 { + if !erllr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -12623,11 +11950,16 @@ func (page *ExpressRouteLinkListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erllr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erllr) + if err != nil { + return err + } + page.erllr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erllr = next return nil } @@ -12657,8 +11989,11 @@ func (page ExpressRouteLinkListResultPage) Values() []ExpressRouteLink { } // Creates a new instance of the ExpressRouteLinkListResultPage type. -func NewExpressRouteLinkListResultPage(getNextPage func(context.Context, ExpressRouteLinkListResult) (ExpressRouteLinkListResult, error)) ExpressRouteLinkListResultPage { - return ExpressRouteLinkListResultPage{fn: getNextPage} +func NewExpressRouteLinkListResultPage(cur ExpressRouteLinkListResult, getNextPage func(context.Context, ExpressRouteLinkListResult) (ExpressRouteLinkListResult, error)) ExpressRouteLinkListResultPage { + return ExpressRouteLinkListResultPage{ + fn: getNextPage, + erllr: cur, + } } // ExpressRouteLinkPropertiesFormat properties specific to ExpressRouteLink resources. @@ -12679,6 +12014,15 @@ type ExpressRouteLinkPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteLinkPropertiesFormat. +func (erlpf ExpressRouteLinkPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erlpf.AdminState != "" { + objectMap["adminState"] = erlpf.AdminState + } + return json.Marshal(objectMap) +} + // ExpressRoutePort expressRoutePort resource definition. type ExpressRoutePort struct { autorest.Response `json:"-"` @@ -12871,10 +12215,15 @@ func (erplr ExpressRoutePortListResult) IsEmpty() bool { return erplr.Value == nil || len(*erplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erplr ExpressRoutePortListResult) hasNextLink() bool { + return erplr.NextLink != nil && len(*erplr.NextLink) != 0 +} + // expressRoutePortListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erplr ExpressRoutePortListResult) expressRoutePortListResultPreparer(ctx context.Context) (*http.Request, error) { - if erplr.NextLink == nil || len(to.String(erplr.NextLink)) < 1 { + if !erplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -12902,11 +12251,16 @@ func (page *ExpressRoutePortListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erplr) + if err != nil { + return err + } + page.erplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erplr = next return nil } @@ -12936,8 +12290,11 @@ func (page ExpressRoutePortListResultPage) Values() []ExpressRoutePort { } // Creates a new instance of the ExpressRoutePortListResultPage type. -func NewExpressRoutePortListResultPage(getNextPage func(context.Context, ExpressRoutePortListResult) (ExpressRoutePortListResult, error)) ExpressRoutePortListResultPage { - return ExpressRoutePortListResultPage{fn: getNextPage} +func NewExpressRoutePortListResultPage(cur ExpressRoutePortListResult, getNextPage func(context.Context, ExpressRoutePortListResult) (ExpressRoutePortListResult, error)) ExpressRoutePortListResultPage { + return ExpressRoutePortListResultPage{ + fn: getNextPage, + erplr: cur, + } } // ExpressRoutePortPropertiesFormat properties specific to ExpressRoutePort resources. @@ -12966,15 +12323,49 @@ type ExpressRoutePortPropertiesFormat struct { ResourceGUID *string `json:"resourceGuid,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRoutePortPropertiesFormat. +func (erppf ExpressRoutePortPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erppf.PeeringLocation != nil { + objectMap["peeringLocation"] = erppf.PeeringLocation + } + if erppf.BandwidthInGbps != nil { + objectMap["bandwidthInGbps"] = erppf.BandwidthInGbps + } + if erppf.Encapsulation != "" { + objectMap["encapsulation"] = erppf.Encapsulation + } + if erppf.Links != nil { + objectMap["links"] = erppf.Links + } + if erppf.ResourceGUID != nil { + objectMap["resourceGuid"] = erppf.ResourceGUID + } + return json.Marshal(objectMap) +} + // ExpressRoutePortsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRoutePortsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRoutePortsClient) (ExpressRoutePort, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRoutePortsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRoutePortsCreateOrUpdateFuture) Result(client ExpressRoutePortsClient) (erp ExpressRoutePort, err error) { +// result is the default implementation for ExpressRoutePortsCreateOrUpdateFuture.Result. +func (future *ExpressRoutePortsCreateOrUpdateFuture) result(client ExpressRoutePortsClient) (erp ExpressRoutePort, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -12998,12 +12389,25 @@ func (future *ExpressRoutePortsCreateOrUpdateFuture) Result(client ExpressRouteP // ExpressRoutePortsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ExpressRoutePortsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRoutePortsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRoutePortsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRoutePortsDeleteFuture) Result(client ExpressRoutePortsClient) (ar autorest.Response, err error) { +// result is the default implementation for ExpressRoutePortsDeleteFuture.Result. +func (future *ExpressRoutePortsDeleteFuture) result(client ExpressRoutePortsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13208,10 +12612,15 @@ func (erpllr ExpressRoutePortsLocationListResult) IsEmpty() bool { return erpllr.Value == nil || len(*erpllr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erpllr ExpressRoutePortsLocationListResult) hasNextLink() bool { + return erpllr.NextLink != nil && len(*erpllr.NextLink) != 0 +} + // expressRoutePortsLocationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erpllr ExpressRoutePortsLocationListResult) expressRoutePortsLocationListResultPreparer(ctx context.Context) (*http.Request, error) { - if erpllr.NextLink == nil || len(to.String(erpllr.NextLink)) < 1 { + if !erpllr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -13239,11 +12648,16 @@ func (page *ExpressRoutePortsLocationListResultPage) NextWithContext(ctx context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erpllr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erpllr) + if err != nil { + return err + } + page.erpllr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erpllr = next return nil } @@ -13273,8 +12687,11 @@ func (page ExpressRoutePortsLocationListResultPage) Values() []ExpressRoutePorts } // Creates a new instance of the ExpressRoutePortsLocationListResultPage type. -func NewExpressRoutePortsLocationListResultPage(getNextPage func(context.Context, ExpressRoutePortsLocationListResult) (ExpressRoutePortsLocationListResult, error)) ExpressRoutePortsLocationListResultPage { - return ExpressRoutePortsLocationListResultPage{fn: getNextPage} +func NewExpressRoutePortsLocationListResultPage(cur ExpressRoutePortsLocationListResult, getNextPage func(context.Context, ExpressRoutePortsLocationListResult) (ExpressRoutePortsLocationListResult, error)) ExpressRoutePortsLocationListResultPage { + return ExpressRoutePortsLocationListResultPage{ + fn: getNextPage, + erpllr: cur, + } } // ExpressRoutePortsLocationPropertiesFormat properties specific to ExpressRoutePorts peering location @@ -13290,15 +12707,37 @@ type ExpressRoutePortsLocationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRoutePortsLocationPropertiesFormat. +func (erplpf ExpressRoutePortsLocationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erplpf.AvailableBandwidths != nil { + objectMap["availableBandwidths"] = erplpf.AvailableBandwidths + } + return json.Marshal(objectMap) +} + // ExpressRoutePortsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRoutePortsUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRoutePortsClient) (ExpressRoutePort, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRoutePortsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ExpressRoutePortsUpdateTagsFuture) Result(client ExpressRoutePortsClient) (erp ExpressRoutePort, err error) { +// result is the default implementation for ExpressRoutePortsUpdateTagsFuture.Result. +func (future *ExpressRoutePortsUpdateTagsFuture) result(client ExpressRoutePortsClient) (erp ExpressRoutePort, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13509,10 +12948,15 @@ func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool { return ersplr.Value == nil || len(*ersplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ersplr ExpressRouteServiceProviderListResult) hasNextLink() bool { + return ersplr.NextLink != nil && len(*ersplr.NextLink) != 0 +} + // expressRouteServiceProviderListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer(ctx context.Context) (*http.Request, error) { - if ersplr.NextLink == nil || len(to.String(ersplr.NextLink)) < 1 { + if !ersplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -13540,11 +12984,16 @@ func (page *ExpressRouteServiceProviderListResultPage) NextWithContext(ctx conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ersplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ersplr) + if err != nil { + return err + } + page.ersplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ersplr = next return nil } @@ -13574,8 +13023,11 @@ func (page ExpressRouteServiceProviderListResultPage) Values() []ExpressRouteSer } // Creates a new instance of the ExpressRouteServiceProviderListResultPage type. -func NewExpressRouteServiceProviderListResultPage(getNextPage func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)) ExpressRouteServiceProviderListResultPage { - return ExpressRouteServiceProviderListResultPage{fn: getNextPage} +func NewExpressRouteServiceProviderListResultPage(cur ExpressRouteServiceProviderListResult, getNextPage func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)) ExpressRouteServiceProviderListResultPage { + return ExpressRouteServiceProviderListResultPage{ + fn: getNextPage, + ersplr: cur, + } } // ExpressRouteServiceProviderPropertiesFormat properties of ExpressRouteServiceProvider. @@ -13591,12 +13043,25 @@ type ExpressRouteServiceProviderPropertiesFormat struct { // FirewallPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type FirewallPoliciesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FirewallPoliciesClient) (FirewallPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FirewallPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FirewallPoliciesCreateOrUpdateFuture) Result(client FirewallPoliciesClient) (fp FirewallPolicy, err error) { +// result is the default implementation for FirewallPoliciesCreateOrUpdateFuture.Result. +func (future *FirewallPoliciesCreateOrUpdateFuture) result(client FirewallPoliciesClient) (fp FirewallPolicy, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13620,12 +13085,25 @@ func (future *FirewallPoliciesCreateOrUpdateFuture) Result(client FirewallPolici // FirewallPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type FirewallPoliciesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FirewallPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FirewallPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FirewallPoliciesDeleteFuture) Result(client FirewallPoliciesClient) (ar autorest.Response, err error) { +// result is the default implementation for FirewallPoliciesDeleteFuture.Result. +func (future *FirewallPoliciesDeleteFuture) result(client FirewallPoliciesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -13953,10 +13431,15 @@ func (fplr FirewallPolicyListResult) IsEmpty() bool { return fplr.Value == nil || len(*fplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (fplr FirewallPolicyListResult) hasNextLink() bool { + return fplr.NextLink != nil && len(*fplr.NextLink) != 0 +} + // firewallPolicyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (fplr FirewallPolicyListResult) firewallPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if fplr.NextLink == nil || len(to.String(fplr.NextLink)) < 1 { + if !fplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -13984,11 +13467,16 @@ func (page *FirewallPolicyListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.fplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.fplr) + if err != nil { + return err + } + page.fplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.fplr = next return nil } @@ -14018,8 +13506,11 @@ func (page FirewallPolicyListResultPage) Values() []FirewallPolicy { } // Creates a new instance of the FirewallPolicyListResultPage type. -func NewFirewallPolicyListResultPage(getNextPage func(context.Context, FirewallPolicyListResult) (FirewallPolicyListResult, error)) FirewallPolicyListResultPage { - return FirewallPolicyListResultPage{fn: getNextPage} +func NewFirewallPolicyListResultPage(cur FirewallPolicyListResult, getNextPage func(context.Context, FirewallPolicyListResult) (FirewallPolicyListResult, error)) FirewallPolicyListResultPage { + return FirewallPolicyListResultPage{ + fn: getNextPage, + fplr: cur, + } } // FirewallPolicyNatRule firewall Policy NAT Rule @@ -14185,6 +13676,21 @@ type FirewallPolicyPropertiesFormat struct { ThreatIntelMode AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` } +// MarshalJSON is the custom marshaler for FirewallPolicyPropertiesFormat. +func (fppf FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fppf.ProvisioningState != "" { + objectMap["provisioningState"] = fppf.ProvisioningState + } + if fppf.BasePolicy != nil { + objectMap["basePolicy"] = fppf.BasePolicy + } + if fppf.ThreatIntelMode != "" { + objectMap["threatIntelMode"] = fppf.ThreatIntelMode + } + return json.Marshal(objectMap) +} + // BasicFirewallPolicyRule properties of the rule. type BasicFirewallPolicyRule interface { AsFirewallPolicyNatRule() (*FirewallPolicyNatRule, bool) @@ -14549,10 +14055,15 @@ func (fprglr FirewallPolicyRuleGroupListResult) IsEmpty() bool { return fprglr.Value == nil || len(*fprglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (fprglr FirewallPolicyRuleGroupListResult) hasNextLink() bool { + return fprglr.NextLink != nil && len(*fprglr.NextLink) != 0 +} + // firewallPolicyRuleGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (fprglr FirewallPolicyRuleGroupListResult) firewallPolicyRuleGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if fprglr.NextLink == nil || len(to.String(fprglr.NextLink)) < 1 { + if !fprglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -14580,11 +14091,16 @@ func (page *FirewallPolicyRuleGroupListResultPage) NextWithContext(ctx context.C tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.fprglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.fprglr) + if err != nil { + return err + } + page.fprglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.fprglr = next return nil } @@ -14614,8 +14130,11 @@ func (page FirewallPolicyRuleGroupListResultPage) Values() []FirewallPolicyRuleG } // Creates a new instance of the FirewallPolicyRuleGroupListResultPage type. -func NewFirewallPolicyRuleGroupListResultPage(getNextPage func(context.Context, FirewallPolicyRuleGroupListResult) (FirewallPolicyRuleGroupListResult, error)) FirewallPolicyRuleGroupListResultPage { - return FirewallPolicyRuleGroupListResultPage{fn: getNextPage} +func NewFirewallPolicyRuleGroupListResultPage(cur FirewallPolicyRuleGroupListResult, getNextPage func(context.Context, FirewallPolicyRuleGroupListResult) (FirewallPolicyRuleGroupListResult, error)) FirewallPolicyRuleGroupListResultPage { + return FirewallPolicyRuleGroupListResultPage{ + fn: getNextPage, + fprglr: cur, + } } // FirewallPolicyRuleGroupProperties properties of the rule group. @@ -14672,12 +14191,25 @@ func (fprgp *FirewallPolicyRuleGroupProperties) UnmarshalJSON(body []byte) error // FirewallPolicyRuleGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type FirewallPolicyRuleGroupsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FirewallPolicyRuleGroupsClient) (FirewallPolicyRuleGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FirewallPolicyRuleGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FirewallPolicyRuleGroupsCreateOrUpdateFuture) Result(client FirewallPolicyRuleGroupsClient) (fprg FirewallPolicyRuleGroup, err error) { +// result is the default implementation for FirewallPolicyRuleGroupsCreateOrUpdateFuture.Result. +func (future *FirewallPolicyRuleGroupsCreateOrUpdateFuture) result(client FirewallPolicyRuleGroupsClient) (fprg FirewallPolicyRuleGroup, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14701,12 +14233,25 @@ func (future *FirewallPolicyRuleGroupsCreateOrUpdateFuture) Result(client Firewa // FirewallPolicyRuleGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type FirewallPolicyRuleGroupsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FirewallPolicyRuleGroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FirewallPolicyRuleGroupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FirewallPolicyRuleGroupsDeleteFuture) Result(client FirewallPolicyRuleGroupsClient) (ar autorest.Response, err error) { +// result is the default implementation for FirewallPolicyRuleGroupsDeleteFuture.Result. +func (future *FirewallPolicyRuleGroupsDeleteFuture) result(client FirewallPolicyRuleGroupsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -14949,6 +14494,33 @@ type FrontendIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for FrontendIPConfigurationPropertiesFormat. +func (ficpf FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ficpf.PrivateIPAddress != nil { + objectMap["privateIPAddress"] = ficpf.PrivateIPAddress + } + if ficpf.PrivateIPAllocationMethod != "" { + objectMap["privateIPAllocationMethod"] = ficpf.PrivateIPAllocationMethod + } + if ficpf.PrivateIPAddressVersion != "" { + objectMap["privateIPAddressVersion"] = ficpf.PrivateIPAddressVersion + } + if ficpf.Subnet != nil { + objectMap["subnet"] = ficpf.Subnet + } + if ficpf.PublicIPAddress != nil { + objectMap["publicIPAddress"] = ficpf.PublicIPAddress + } + if ficpf.PublicIPPrefix != nil { + objectMap["publicIPPrefix"] = ficpf.PublicIPPrefix + } + if ficpf.ProvisioningState != nil { + objectMap["provisioningState"] = ficpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // GatewayRoute gateway routing details. type GatewayRoute struct { // LocalAddress - READ-ONLY; The gateway's local address. @@ -15317,6 +14889,15 @@ type InboundNatRuleListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InboundNatRuleListResult. +func (inrlr InboundNatRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if inrlr.Value != nil { + objectMap["value"] = inrlr.Value + } + return json.Marshal(objectMap) +} + // InboundNatRuleListResultIterator provides access to a complete listing of InboundNatRule values. type InboundNatRuleListResultIterator struct { i int @@ -15385,10 +14966,15 @@ func (inrlr InboundNatRuleListResult) IsEmpty() bool { return inrlr.Value == nil || len(*inrlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (inrlr InboundNatRuleListResult) hasNextLink() bool { + return inrlr.NextLink != nil && len(*inrlr.NextLink) != 0 +} + // inboundNatRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (inrlr InboundNatRuleListResult) inboundNatRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if inrlr.NextLink == nil || len(to.String(inrlr.NextLink)) < 1 { + if !inrlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -15416,11 +15002,16 @@ func (page *InboundNatRuleListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.inrlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.inrlr) + if err != nil { + return err + } + page.inrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.inrlr = next return nil } @@ -15450,8 +15041,11 @@ func (page InboundNatRuleListResultPage) Values() []InboundNatRule { } // Creates a new instance of the InboundNatRuleListResultPage type. -func NewInboundNatRuleListResultPage(getNextPage func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error)) InboundNatRuleListResultPage { - return InboundNatRuleListResultPage{fn: getNextPage} +func NewInboundNatRuleListResultPage(cur InboundNatRuleListResult, getNextPage func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error)) InboundNatRuleListResultPage { + return InboundNatRuleListResultPage{ + fn: getNextPage, + inrlr: cur, + } } // InboundNatRulePropertiesFormat properties of the inbound NAT rule. @@ -15476,15 +15070,58 @@ type InboundNatRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for InboundNatRulePropertiesFormat. +func (inrpf InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if inrpf.FrontendIPConfiguration != nil { + objectMap["frontendIPConfiguration"] = inrpf.FrontendIPConfiguration + } + if inrpf.Protocol != "" { + objectMap["protocol"] = inrpf.Protocol + } + if inrpf.FrontendPort != nil { + objectMap["frontendPort"] = inrpf.FrontendPort + } + if inrpf.BackendPort != nil { + objectMap["backendPort"] = inrpf.BackendPort + } + if inrpf.IdleTimeoutInMinutes != nil { + objectMap["idleTimeoutInMinutes"] = inrpf.IdleTimeoutInMinutes + } + if inrpf.EnableFloatingIP != nil { + objectMap["enableFloatingIP"] = inrpf.EnableFloatingIP + } + if inrpf.EnableTCPReset != nil { + objectMap["enableTcpReset"] = inrpf.EnableTCPReset + } + if inrpf.ProvisioningState != nil { + objectMap["provisioningState"] = inrpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // InboundNatRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type InboundNatRulesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(InboundNatRulesClient) (InboundNatRule, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InboundNatRulesCreateOrUpdateFuture) Result(client InboundNatRulesClient) (inr InboundNatRule, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *InboundNatRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for InboundNatRulesCreateOrUpdateFuture.Result. +func (future *InboundNatRulesCreateOrUpdateFuture) result(client InboundNatRulesClient) (inr InboundNatRule, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -15508,12 +15145,25 @@ func (future *InboundNatRulesCreateOrUpdateFuture) Result(client InboundNatRules // InboundNatRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type InboundNatRulesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(InboundNatRulesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *InboundNatRulesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InboundNatRulesDeleteFuture) Result(client InboundNatRulesClient) (ar autorest.Response, err error) { +// result is the default implementation for InboundNatRulesDeleteFuture.Result. +func (future *InboundNatRulesDeleteFuture) result(client InboundNatRulesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -15696,6 +15346,15 @@ type InterfaceAssociation struct { SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceAssociation. +func (ia InterfaceAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ia.SecurityRules != nil { + objectMap["securityRules"] = ia.SecurityRules + } + return json.Marshal(objectMap) +} + // InterfaceDNSSettings DNS settings of a network interface. type InterfaceDNSSettings struct { // DNSServers - List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. @@ -15801,6 +15460,15 @@ type InterfaceIPConfigurationListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceIPConfigurationListResult. +func (iiclr InterfaceIPConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iiclr.Value != nil { + objectMap["value"] = iiclr.Value + } + return json.Marshal(objectMap) +} + // InterfaceIPConfigurationListResultIterator provides access to a complete listing of // InterfaceIPConfiguration values. type InterfaceIPConfigurationListResultIterator struct { @@ -15870,10 +15538,15 @@ func (iiclr InterfaceIPConfigurationListResult) IsEmpty() bool { return iiclr.Value == nil || len(*iiclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (iiclr InterfaceIPConfigurationListResult) hasNextLink() bool { + return iiclr.NextLink != nil && len(*iiclr.NextLink) != 0 +} + // interfaceIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (iiclr InterfaceIPConfigurationListResult) interfaceIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if iiclr.NextLink == nil || len(to.String(iiclr.NextLink)) < 1 { + if !iiclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -15901,11 +15574,16 @@ func (page *InterfaceIPConfigurationListResultPage) NextWithContext(ctx context. tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.iiclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.iiclr) + if err != nil { + return err + } + page.iiclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.iiclr = next return nil } @@ -15935,8 +15613,11 @@ func (page InterfaceIPConfigurationListResultPage) Values() []InterfaceIPConfigu } // Creates a new instance of the InterfaceIPConfigurationListResultPage type. -func NewInterfaceIPConfigurationListResultPage(getNextPage func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error)) InterfaceIPConfigurationListResultPage { - return InterfaceIPConfigurationListResultPage{fn: getNextPage} +func NewInterfaceIPConfigurationListResultPage(cur InterfaceIPConfigurationListResult, getNextPage func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error)) InterfaceIPConfigurationListResultPage { + return InterfaceIPConfigurationListResultPage{ + fn: getNextPage, + iiclr: cur, + } } // InterfaceIPConfigurationPropertiesFormat properties of IP configuration. @@ -15976,6 +15657,15 @@ type InterfaceListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceListResult. +func (ilr InterfaceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ilr.Value != nil { + objectMap["value"] = ilr.Value + } + return json.Marshal(objectMap) +} + // InterfaceListResultIterator provides access to a complete listing of Interface values. type InterfaceListResultIterator struct { i int @@ -16044,10 +15734,15 @@ func (ilr InterfaceListResult) IsEmpty() bool { return ilr.Value == nil || len(*ilr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ilr InterfaceListResult) hasNextLink() bool { + return ilr.NextLink != nil && len(*ilr.NextLink) != 0 +} + // interfaceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ilr InterfaceListResult) interfaceListResultPreparer(ctx context.Context) (*http.Request, error) { - if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 { + if !ilr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -16075,11 +15770,16 @@ func (page *InterfaceListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ilr) + if err != nil { + return err + } + page.ilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ilr = next return nil } @@ -16109,8 +15809,11 @@ func (page InterfaceListResultPage) Values() []Interface { } // Creates a new instance of the InterfaceListResultPage type. -func NewInterfaceListResultPage(getNextPage func(context.Context, InterfaceListResult) (InterfaceListResult, error)) InterfaceListResultPage { - return InterfaceListResultPage{fn: getNextPage} +func NewInterfaceListResultPage(cur InterfaceListResult, getNextPage func(context.Context, InterfaceListResult) (InterfaceListResult, error)) InterfaceListResultPage { + return InterfaceListResultPage{ + fn: getNextPage, + ilr: cur, + } } // InterfaceLoadBalancerListResult response for list ip configurations API service call. @@ -16122,6 +15825,15 @@ type InterfaceLoadBalancerListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceLoadBalancerListResult. +func (ilblr InterfaceLoadBalancerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ilblr.Value != nil { + objectMap["value"] = ilblr.Value + } + return json.Marshal(objectMap) +} + // InterfaceLoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. type InterfaceLoadBalancerListResultIterator struct { i int @@ -16190,10 +15902,15 @@ func (ilblr InterfaceLoadBalancerListResult) IsEmpty() bool { return ilblr.Value == nil || len(*ilblr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ilblr InterfaceLoadBalancerListResult) hasNextLink() bool { + return ilblr.NextLink != nil && len(*ilblr.NextLink) != 0 +} + // interfaceLoadBalancerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ilblr InterfaceLoadBalancerListResult) interfaceLoadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { - if ilblr.NextLink == nil || len(to.String(ilblr.NextLink)) < 1 { + if !ilblr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -16221,11 +15938,16 @@ func (page *InterfaceLoadBalancerListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ilblr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ilblr) + if err != nil { + return err + } + page.ilblr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ilblr = next return nil } @@ -16255,8 +15977,11 @@ func (page InterfaceLoadBalancerListResultPage) Values() []LoadBalancer { } // Creates a new instance of the InterfaceLoadBalancerListResultPage type. -func NewInterfaceLoadBalancerListResultPage(getNextPage func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error)) InterfaceLoadBalancerListResultPage { - return InterfaceLoadBalancerListResultPage{fn: getNextPage} +func NewInterfaceLoadBalancerListResultPage(cur InterfaceLoadBalancerListResult, getNextPage func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error)) InterfaceLoadBalancerListResultPage { + return InterfaceLoadBalancerListResultPage{ + fn: getNextPage, + ilblr: cur, + } } // InterfacePropertiesFormat networkInterface properties. @@ -16289,15 +16014,64 @@ type InterfacePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for InterfacePropertiesFormat. +func (ipf InterfacePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipf.NetworkSecurityGroup != nil { + objectMap["networkSecurityGroup"] = ipf.NetworkSecurityGroup + } + if ipf.IPConfigurations != nil { + objectMap["ipConfigurations"] = ipf.IPConfigurations + } + if ipf.TapConfigurations != nil { + objectMap["tapConfigurations"] = ipf.TapConfigurations + } + if ipf.DNSSettings != nil { + objectMap["dnsSettings"] = ipf.DNSSettings + } + if ipf.MacAddress != nil { + objectMap["macAddress"] = ipf.MacAddress + } + if ipf.Primary != nil { + objectMap["primary"] = ipf.Primary + } + if ipf.EnableAcceleratedNetworking != nil { + objectMap["enableAcceleratedNetworking"] = ipf.EnableAcceleratedNetworking + } + if ipf.EnableIPForwarding != nil { + objectMap["enableIPForwarding"] = ipf.EnableIPForwarding + } + if ipf.ResourceGUID != nil { + objectMap["resourceGuid"] = ipf.ResourceGUID + } + if ipf.ProvisioningState != nil { + objectMap["provisioningState"] = ipf.ProvisioningState + } + return json.Marshal(objectMap) +} + // InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type InterfacesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(InterfacesClient) (Interface, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *InterfacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InterfacesCreateOrUpdateFuture) Result(client InterfacesClient) (i Interface, err error) { +// result is the default implementation for InterfacesCreateOrUpdateFuture.Result. +func (future *InterfacesCreateOrUpdateFuture) result(client InterfacesClient) (i Interface, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -16321,12 +16095,25 @@ func (future *InterfacesCreateOrUpdateFuture) Result(client InterfacesClient) (i // InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type InterfacesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(InterfacesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *InterfacesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InterfacesDeleteFuture) Result(client InterfacesClient) (ar autorest.Response, err error) { +// result is the default implementation for InterfacesDeleteFuture.Result. +func (future *InterfacesDeleteFuture) result(client InterfacesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -16344,12 +16131,25 @@ func (future *InterfacesDeleteFuture) Result(client InterfacesClient) (ar autore // InterfacesGetEffectiveRouteTableFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type InterfacesGetEffectiveRouteTableFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(InterfacesClient) (EffectiveRouteListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *InterfacesGetEffectiveRouteTableFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InterfacesGetEffectiveRouteTableFuture) Result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) { +// result is the default implementation for InterfacesGetEffectiveRouteTableFuture.Result. +func (future *InterfacesGetEffectiveRouteTableFuture) result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -16373,12 +16173,25 @@ func (future *InterfacesGetEffectiveRouteTableFuture) Result(client InterfacesCl // InterfacesListEffectiveNetworkSecurityGroupsFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type InterfacesListEffectiveNetworkSecurityGroupsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(InterfacesClient) (EffectiveNetworkSecurityGroupListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) Result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) { +// result is the default implementation for InterfacesListEffectiveNetworkSecurityGroupsFuture.Result. +func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -16402,12 +16215,25 @@ func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) Result(client // InterfacesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type InterfacesUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(InterfacesClient) (Interface, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InterfacesUpdateTagsFuture) Result(client InterfacesClient) (i Interface, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *InterfacesUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for InterfacesUpdateTagsFuture.Result. +func (future *InterfacesUpdateTagsFuture) result(client InterfacesClient) (i Interface, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -16530,6 +16356,15 @@ type InterfaceTapConfigurationListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceTapConfigurationListResult. +func (itclr InterfaceTapConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itclr.Value != nil { + objectMap["value"] = itclr.Value + } + return json.Marshal(objectMap) +} + // InterfaceTapConfigurationListResultIterator provides access to a complete listing of // InterfaceTapConfiguration values. type InterfaceTapConfigurationListResultIterator struct { @@ -16599,10 +16434,15 @@ func (itclr InterfaceTapConfigurationListResult) IsEmpty() bool { return itclr.Value == nil || len(*itclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (itclr InterfaceTapConfigurationListResult) hasNextLink() bool { + return itclr.NextLink != nil && len(*itclr.NextLink) != 0 +} + // interfaceTapConfigurationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (itclr InterfaceTapConfigurationListResult) interfaceTapConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if itclr.NextLink == nil || len(to.String(itclr.NextLink)) < 1 { + if !itclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -16630,11 +16470,16 @@ func (page *InterfaceTapConfigurationListResultPage) NextWithContext(ctx context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.itclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.itclr) + if err != nil { + return err + } + page.itclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.itclr = next return nil } @@ -16664,8 +16509,11 @@ func (page InterfaceTapConfigurationListResultPage) Values() []InterfaceTapConfi } // Creates a new instance of the InterfaceTapConfigurationListResultPage type. -func NewInterfaceTapConfigurationListResultPage(getNextPage func(context.Context, InterfaceTapConfigurationListResult) (InterfaceTapConfigurationListResult, error)) InterfaceTapConfigurationListResultPage { - return InterfaceTapConfigurationListResultPage{fn: getNextPage} +func NewInterfaceTapConfigurationListResultPage(cur InterfaceTapConfigurationListResult, getNextPage func(context.Context, InterfaceTapConfigurationListResult) (InterfaceTapConfigurationListResult, error)) InterfaceTapConfigurationListResultPage { + return InterfaceTapConfigurationListResultPage{ + fn: getNextPage, + itclr: cur, + } } // InterfaceTapConfigurationPropertiesFormat properties of Virtual Network Tap configuration. @@ -16676,15 +16524,37 @@ type InterfaceTapConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceTapConfigurationPropertiesFormat. +func (itcpf InterfaceTapConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itcpf.VirtualNetworkTap != nil { + objectMap["virtualNetworkTap"] = itcpf.VirtualNetworkTap + } + return json.Marshal(objectMap) +} + // InterfaceTapConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type InterfaceTapConfigurationsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(InterfaceTapConfigurationsClient) (InterfaceTapConfiguration, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) Result(client InterfaceTapConfigurationsClient) (itc InterfaceTapConfiguration, err error) { +// result is the default implementation for InterfaceTapConfigurationsCreateOrUpdateFuture.Result. +func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) result(client InterfaceTapConfigurationsClient) (itc InterfaceTapConfiguration, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -16708,12 +16578,25 @@ func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) Result(client Inte // InterfaceTapConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type InterfaceTapConfigurationsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(InterfaceTapConfigurationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *InterfaceTapConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *InterfaceTapConfigurationsDeleteFuture) Result(client InterfaceTapConfigurationsClient) (ar autorest.Response, err error) { +// result is the default implementation for InterfaceTapConfigurationsDeleteFuture.Result. +func (future *InterfaceTapConfigurationsDeleteFuture) result(client InterfaceTapConfigurationsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -16918,6 +16801,15 @@ type IPConfigurationProfilePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for IPConfigurationProfilePropertiesFormat. +func (icppf IPConfigurationProfilePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if icppf.Subnet != nil { + objectMap["subnet"] = icppf.Subnet + } + return json.Marshal(objectMap) +} + // IPConfigurationPropertiesFormat properties of IP configuration. type IPConfigurationPropertiesFormat struct { // PrivateIPAddress - The private IP address of the IP configuration. @@ -17053,10 +16945,15 @@ func (lhvncr ListHubVirtualNetworkConnectionsResult) IsEmpty() bool { return lhvncr.Value == nil || len(*lhvncr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lhvncr ListHubVirtualNetworkConnectionsResult) hasNextLink() bool { + return lhvncr.NextLink != nil && len(*lhvncr.NextLink) != 0 +} + // listHubVirtualNetworkConnectionsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lhvncr ListHubVirtualNetworkConnectionsResult) listHubVirtualNetworkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if lhvncr.NextLink == nil || len(to.String(lhvncr.NextLink)) < 1 { + if !lhvncr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -17084,11 +16981,16 @@ func (page *ListHubVirtualNetworkConnectionsResultPage) NextWithContext(ctx cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lhvncr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lhvncr) + if err != nil { + return err + } + page.lhvncr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lhvncr = next return nil } @@ -17118,8 +17020,11 @@ func (page ListHubVirtualNetworkConnectionsResultPage) Values() []HubVirtualNetw } // Creates a new instance of the ListHubVirtualNetworkConnectionsResultPage type. -func NewListHubVirtualNetworkConnectionsResultPage(getNextPage func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error)) ListHubVirtualNetworkConnectionsResultPage { - return ListHubVirtualNetworkConnectionsResultPage{fn: getNextPage} +func NewListHubVirtualNetworkConnectionsResultPage(cur ListHubVirtualNetworkConnectionsResult, getNextPage func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error)) ListHubVirtualNetworkConnectionsResultPage { + return ListHubVirtualNetworkConnectionsResultPage{ + fn: getNextPage, + lhvncr: cur, + } } // ListP2SVpnGatewaysResult result of the request to list P2SVpnGateways. It contains a list of @@ -17200,10 +17105,15 @@ func (lpvgr ListP2SVpnGatewaysResult) IsEmpty() bool { return lpvgr.Value == nil || len(*lpvgr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lpvgr ListP2SVpnGatewaysResult) hasNextLink() bool { + return lpvgr.NextLink != nil && len(*lpvgr.NextLink) != 0 +} + // listP2SVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lpvgr ListP2SVpnGatewaysResult) listP2SVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) { - if lpvgr.NextLink == nil || len(to.String(lpvgr.NextLink)) < 1 { + if !lpvgr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -17231,11 +17141,16 @@ func (page *ListP2SVpnGatewaysResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lpvgr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lpvgr) + if err != nil { + return err + } + page.lpvgr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lpvgr = next return nil } @@ -17265,8 +17180,11 @@ func (page ListP2SVpnGatewaysResultPage) Values() []P2SVpnGateway { } // Creates a new instance of the ListP2SVpnGatewaysResultPage type. -func NewListP2SVpnGatewaysResultPage(getNextPage func(context.Context, ListP2SVpnGatewaysResult) (ListP2SVpnGatewaysResult, error)) ListP2SVpnGatewaysResultPage { - return ListP2SVpnGatewaysResultPage{fn: getNextPage} +func NewListP2SVpnGatewaysResultPage(cur ListP2SVpnGatewaysResult, getNextPage func(context.Context, ListP2SVpnGatewaysResult) (ListP2SVpnGatewaysResult, error)) ListP2SVpnGatewaysResultPage { + return ListP2SVpnGatewaysResultPage{ + fn: getNextPage, + lpvgr: cur, + } } // ListP2SVpnServerConfigurationsResult result of the request to list all P2SVpnServerConfigurations @@ -17349,10 +17267,15 @@ func (lpvscr ListP2SVpnServerConfigurationsResult) IsEmpty() bool { return lpvscr.Value == nil || len(*lpvscr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lpvscr ListP2SVpnServerConfigurationsResult) hasNextLink() bool { + return lpvscr.NextLink != nil && len(*lpvscr.NextLink) != 0 +} + // listP2SVpnServerConfigurationsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lpvscr ListP2SVpnServerConfigurationsResult) listP2SVpnServerConfigurationsResultPreparer(ctx context.Context) (*http.Request, error) { - if lpvscr.NextLink == nil || len(to.String(lpvscr.NextLink)) < 1 { + if !lpvscr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -17380,11 +17303,16 @@ func (page *ListP2SVpnServerConfigurationsResultPage) NextWithContext(ctx contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lpvscr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lpvscr) + if err != nil { + return err + } + page.lpvscr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lpvscr = next return nil } @@ -17414,8 +17342,11 @@ func (page ListP2SVpnServerConfigurationsResultPage) Values() []P2SVpnServerConf } // Creates a new instance of the ListP2SVpnServerConfigurationsResultPage type. -func NewListP2SVpnServerConfigurationsResultPage(getNextPage func(context.Context, ListP2SVpnServerConfigurationsResult) (ListP2SVpnServerConfigurationsResult, error)) ListP2SVpnServerConfigurationsResultPage { - return ListP2SVpnServerConfigurationsResultPage{fn: getNextPage} +func NewListP2SVpnServerConfigurationsResultPage(cur ListP2SVpnServerConfigurationsResult, getNextPage func(context.Context, ListP2SVpnServerConfigurationsResult) (ListP2SVpnServerConfigurationsResult, error)) ListP2SVpnServerConfigurationsResultPage { + return ListP2SVpnServerConfigurationsResultPage{ + fn: getNextPage, + lpvscr: cur, + } } // ListString ... @@ -17502,10 +17433,15 @@ func (lvhr ListVirtualHubsResult) IsEmpty() bool { return lvhr.Value == nil || len(*lvhr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvhr ListVirtualHubsResult) hasNextLink() bool { + return lvhr.NextLink != nil && len(*lvhr.NextLink) != 0 +} + // listVirtualHubsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvhr ListVirtualHubsResult) listVirtualHubsResultPreparer(ctx context.Context) (*http.Request, error) { - if lvhr.NextLink == nil || len(to.String(lvhr.NextLink)) < 1 { + if !lvhr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -17533,11 +17469,16 @@ func (page *ListVirtualHubsResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvhr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvhr) + if err != nil { + return err + } + page.lvhr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvhr = next return nil } @@ -17567,8 +17508,11 @@ func (page ListVirtualHubsResultPage) Values() []VirtualHub { } // Creates a new instance of the ListVirtualHubsResultPage type. -func NewListVirtualHubsResultPage(getNextPage func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error)) ListVirtualHubsResultPage { - return ListVirtualHubsResultPage{fn: getNextPage} +func NewListVirtualHubsResultPage(cur ListVirtualHubsResult, getNextPage func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error)) ListVirtualHubsResultPage { + return ListVirtualHubsResultPage{ + fn: getNextPage, + lvhr: cur, + } } // ListVirtualWANsResult result of the request to list VirtualWANs. It contains a list of VirtualWANs and a @@ -17649,10 +17593,15 @@ func (lvwnr ListVirtualWANsResult) IsEmpty() bool { return lvwnr.Value == nil || len(*lvwnr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvwnr ListVirtualWANsResult) hasNextLink() bool { + return lvwnr.NextLink != nil && len(*lvwnr.NextLink) != 0 +} + // listVirtualWANsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvwnr ListVirtualWANsResult) listVirtualWANsResultPreparer(ctx context.Context) (*http.Request, error) { - if lvwnr.NextLink == nil || len(to.String(lvwnr.NextLink)) < 1 { + if !lvwnr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -17680,11 +17629,16 @@ func (page *ListVirtualWANsResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvwnr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvwnr) + if err != nil { + return err + } + page.lvwnr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvwnr = next return nil } @@ -17714,8 +17668,11 @@ func (page ListVirtualWANsResultPage) Values() []VirtualWAN { } // Creates a new instance of the ListVirtualWANsResultPage type. -func NewListVirtualWANsResultPage(getNextPage func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error)) ListVirtualWANsResultPage { - return ListVirtualWANsResultPage{fn: getNextPage} +func NewListVirtualWANsResultPage(cur ListVirtualWANsResult, getNextPage func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error)) ListVirtualWANsResultPage { + return ListVirtualWANsResultPage{ + fn: getNextPage, + lvwnr: cur, + } } // ListVpnConnectionsResult result of the request to list all vpn connections to a virtual wan vpn gateway. @@ -17796,10 +17753,15 @@ func (lvcr ListVpnConnectionsResult) IsEmpty() bool { return lvcr.Value == nil || len(*lvcr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvcr ListVpnConnectionsResult) hasNextLink() bool { + return lvcr.NextLink != nil && len(*lvcr.NextLink) != 0 +} + // listVpnConnectionsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvcr ListVpnConnectionsResult) listVpnConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if lvcr.NextLink == nil || len(to.String(lvcr.NextLink)) < 1 { + if !lvcr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -17827,11 +17789,16 @@ func (page *ListVpnConnectionsResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvcr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvcr) + if err != nil { + return err + } + page.lvcr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvcr = next return nil } @@ -17861,8 +17828,11 @@ func (page ListVpnConnectionsResultPage) Values() []VpnConnection { } // Creates a new instance of the ListVpnConnectionsResultPage type. -func NewListVpnConnectionsResultPage(getNextPage func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error)) ListVpnConnectionsResultPage { - return ListVpnConnectionsResultPage{fn: getNextPage} +func NewListVpnConnectionsResultPage(cur ListVpnConnectionsResult, getNextPage func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error)) ListVpnConnectionsResultPage { + return ListVpnConnectionsResultPage{ + fn: getNextPage, + lvcr: cur, + } } // ListVpnGatewaysResult result of the request to list VpnGateways. It contains a list of VpnGateways and a @@ -17943,10 +17913,15 @@ func (lvgr ListVpnGatewaysResult) IsEmpty() bool { return lvgr.Value == nil || len(*lvgr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvgr ListVpnGatewaysResult) hasNextLink() bool { + return lvgr.NextLink != nil && len(*lvgr.NextLink) != 0 +} + // listVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvgr ListVpnGatewaysResult) listVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) { - if lvgr.NextLink == nil || len(to.String(lvgr.NextLink)) < 1 { + if !lvgr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -17974,11 +17949,16 @@ func (page *ListVpnGatewaysResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvgr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvgr) + if err != nil { + return err + } + page.lvgr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvgr = next return nil } @@ -18008,8 +17988,11 @@ func (page ListVpnGatewaysResultPage) Values() []VpnGateway { } // Creates a new instance of the ListVpnGatewaysResultPage type. -func NewListVpnGatewaysResultPage(getNextPage func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error)) ListVpnGatewaysResultPage { - return ListVpnGatewaysResultPage{fn: getNextPage} +func NewListVpnGatewaysResultPage(cur ListVpnGatewaysResult, getNextPage func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error)) ListVpnGatewaysResultPage { + return ListVpnGatewaysResultPage{ + fn: getNextPage, + lvgr: cur, + } } // ListVpnSiteLinkConnectionsResult result of the request to list all vpn connections to a virtual wan vpn @@ -18091,10 +18074,15 @@ func (lvslcr ListVpnSiteLinkConnectionsResult) IsEmpty() bool { return lvslcr.Value == nil || len(*lvslcr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvslcr ListVpnSiteLinkConnectionsResult) hasNextLink() bool { + return lvslcr.NextLink != nil && len(*lvslcr.NextLink) != 0 +} + // listVpnSiteLinkConnectionsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvslcr ListVpnSiteLinkConnectionsResult) listVpnSiteLinkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if lvslcr.NextLink == nil || len(to.String(lvslcr.NextLink)) < 1 { + if !lvslcr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -18122,11 +18110,16 @@ func (page *ListVpnSiteLinkConnectionsResultPage) NextWithContext(ctx context.Co tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvslcr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvslcr) + if err != nil { + return err + } + page.lvslcr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvslcr = next return nil } @@ -18156,8 +18149,11 @@ func (page ListVpnSiteLinkConnectionsResultPage) Values() []VpnSiteLinkConnectio } // Creates a new instance of the ListVpnSiteLinkConnectionsResultPage type. -func NewListVpnSiteLinkConnectionsResultPage(getNextPage func(context.Context, ListVpnSiteLinkConnectionsResult) (ListVpnSiteLinkConnectionsResult, error)) ListVpnSiteLinkConnectionsResultPage { - return ListVpnSiteLinkConnectionsResultPage{fn: getNextPage} +func NewListVpnSiteLinkConnectionsResultPage(cur ListVpnSiteLinkConnectionsResult, getNextPage func(context.Context, ListVpnSiteLinkConnectionsResult) (ListVpnSiteLinkConnectionsResult, error)) ListVpnSiteLinkConnectionsResultPage { + return ListVpnSiteLinkConnectionsResultPage{ + fn: getNextPage, + lvslcr: cur, + } } // ListVpnSiteLinksResult result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks @@ -18238,10 +18234,15 @@ func (lvslr ListVpnSiteLinksResult) IsEmpty() bool { return lvslr.Value == nil || len(*lvslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvslr ListVpnSiteLinksResult) hasNextLink() bool { + return lvslr.NextLink != nil && len(*lvslr.NextLink) != 0 +} + // listVpnSiteLinksResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvslr ListVpnSiteLinksResult) listVpnSiteLinksResultPreparer(ctx context.Context) (*http.Request, error) { - if lvslr.NextLink == nil || len(to.String(lvslr.NextLink)) < 1 { + if !lvslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -18269,11 +18270,16 @@ func (page *ListVpnSiteLinksResultPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvslr) + if err != nil { + return err + } + page.lvslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvslr = next return nil } @@ -18303,8 +18309,11 @@ func (page ListVpnSiteLinksResultPage) Values() []VpnSiteLink { } // Creates a new instance of the ListVpnSiteLinksResultPage type. -func NewListVpnSiteLinksResultPage(getNextPage func(context.Context, ListVpnSiteLinksResult) (ListVpnSiteLinksResult, error)) ListVpnSiteLinksResultPage { - return ListVpnSiteLinksResultPage{fn: getNextPage} +func NewListVpnSiteLinksResultPage(cur ListVpnSiteLinksResult, getNextPage func(context.Context, ListVpnSiteLinksResult) (ListVpnSiteLinksResult, error)) ListVpnSiteLinksResultPage { + return ListVpnSiteLinksResultPage{ + fn: getNextPage, + lvslr: cur, + } } // ListVpnSitesResult result of the request to list VpnSites. It contains a list of VpnSites and a URL @@ -18385,10 +18394,15 @@ func (lvsr ListVpnSitesResult) IsEmpty() bool { return lvsr.Value == nil || len(*lvsr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvsr ListVpnSitesResult) hasNextLink() bool { + return lvsr.NextLink != nil && len(*lvsr.NextLink) != 0 +} + // listVpnSitesResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvsr ListVpnSitesResult) listVpnSitesResultPreparer(ctx context.Context) (*http.Request, error) { - if lvsr.NextLink == nil || len(to.String(lvsr.NextLink)) < 1 { + if !lvsr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -18416,11 +18430,16 @@ func (page *ListVpnSitesResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvsr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvsr) + if err != nil { + return err + } + page.lvsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvsr = next return nil } @@ -18450,8 +18469,11 @@ func (page ListVpnSitesResultPage) Values() []VpnSite { } // Creates a new instance of the ListVpnSitesResultPage type. -func NewListVpnSitesResultPage(getNextPage func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error)) ListVpnSitesResultPage { - return ListVpnSitesResultPage{fn: getNextPage} +func NewListVpnSitesResultPage(cur ListVpnSitesResult, getNextPage func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error)) ListVpnSitesResultPage { + return ListVpnSitesResultPage{ + fn: getNextPage, + lvsr: cur, + } } // LoadBalancer loadBalancer resource. @@ -18595,6 +18617,15 @@ type LoadBalancerBackendAddressPoolListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerBackendAddressPoolListResult. +func (lbbaplr LoadBalancerBackendAddressPoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbbaplr.Value != nil { + objectMap["value"] = lbbaplr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerBackendAddressPoolListResultIterator provides access to a complete listing of // BackendAddressPool values. type LoadBalancerBackendAddressPoolListResultIterator struct { @@ -18664,10 +18695,15 @@ func (lbbaplr LoadBalancerBackendAddressPoolListResult) IsEmpty() bool { return lbbaplr.Value == nil || len(*lbbaplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lbbaplr LoadBalancerBackendAddressPoolListResult) hasNextLink() bool { + return lbbaplr.NextLink != nil && len(*lbbaplr.NextLink) != 0 +} + // loadBalancerBackendAddressPoolListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lbbaplr LoadBalancerBackendAddressPoolListResult) loadBalancerBackendAddressPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if lbbaplr.NextLink == nil || len(to.String(lbbaplr.NextLink)) < 1 { + if !lbbaplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -18695,11 +18731,16 @@ func (page *LoadBalancerBackendAddressPoolListResultPage) NextWithContext(ctx co tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lbbaplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lbbaplr) + if err != nil { + return err + } + page.lbbaplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lbbaplr = next return nil } @@ -18729,8 +18770,11 @@ func (page LoadBalancerBackendAddressPoolListResultPage) Values() []BackendAddre } // Creates a new instance of the LoadBalancerBackendAddressPoolListResultPage type. -func NewLoadBalancerBackendAddressPoolListResultPage(getNextPage func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error)) LoadBalancerBackendAddressPoolListResultPage { - return LoadBalancerBackendAddressPoolListResultPage{fn: getNextPage} +func NewLoadBalancerBackendAddressPoolListResultPage(cur LoadBalancerBackendAddressPoolListResult, getNextPage func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error)) LoadBalancerBackendAddressPoolListResultPage { + return LoadBalancerBackendAddressPoolListResultPage{ + fn: getNextPage, + lbbaplr: cur, + } } // LoadBalancerFrontendIPConfigurationListResult response for ListFrontendIPConfiguration API service call. @@ -18742,6 +18786,15 @@ type LoadBalancerFrontendIPConfigurationListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerFrontendIPConfigurationListResult. +func (lbficlr LoadBalancerFrontendIPConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbficlr.Value != nil { + objectMap["value"] = lbficlr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerFrontendIPConfigurationListResultIterator provides access to a complete listing of // FrontendIPConfiguration values. type LoadBalancerFrontendIPConfigurationListResultIterator struct { @@ -18811,10 +18864,15 @@ func (lbficlr LoadBalancerFrontendIPConfigurationListResult) IsEmpty() bool { return lbficlr.Value == nil || len(*lbficlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lbficlr LoadBalancerFrontendIPConfigurationListResult) hasNextLink() bool { + return lbficlr.NextLink != nil && len(*lbficlr.NextLink) != 0 +} + // loadBalancerFrontendIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lbficlr LoadBalancerFrontendIPConfigurationListResult) loadBalancerFrontendIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if lbficlr.NextLink == nil || len(to.String(lbficlr.NextLink)) < 1 { + if !lbficlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -18842,11 +18900,16 @@ func (page *LoadBalancerFrontendIPConfigurationListResultPage) NextWithContext(c tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lbficlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lbficlr) + if err != nil { + return err + } + page.lbficlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lbficlr = next return nil } @@ -18876,8 +18939,11 @@ func (page LoadBalancerFrontendIPConfigurationListResultPage) Values() []Fronten } // Creates a new instance of the LoadBalancerFrontendIPConfigurationListResultPage type. -func NewLoadBalancerFrontendIPConfigurationListResultPage(getNextPage func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error)) LoadBalancerFrontendIPConfigurationListResultPage { - return LoadBalancerFrontendIPConfigurationListResultPage{fn: getNextPage} +func NewLoadBalancerFrontendIPConfigurationListResultPage(cur LoadBalancerFrontendIPConfigurationListResult, getNextPage func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error)) LoadBalancerFrontendIPConfigurationListResultPage { + return LoadBalancerFrontendIPConfigurationListResultPage{ + fn: getNextPage, + lbficlr: cur, + } } // LoadBalancerListResult response for ListLoadBalancers API service call. @@ -18889,6 +18955,15 @@ type LoadBalancerListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerListResult. +func (lblr LoadBalancerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lblr.Value != nil { + objectMap["value"] = lblr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. type LoadBalancerListResultIterator struct { i int @@ -18957,10 +19032,15 @@ func (lblr LoadBalancerListResult) IsEmpty() bool { return lblr.Value == nil || len(*lblr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lblr LoadBalancerListResult) hasNextLink() bool { + return lblr.NextLink != nil && len(*lblr.NextLink) != 0 +} + // loadBalancerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lblr LoadBalancerListResult) loadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { - if lblr.NextLink == nil || len(to.String(lblr.NextLink)) < 1 { + if !lblr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -18988,11 +19068,16 @@ func (page *LoadBalancerListResultPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lblr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lblr) + if err != nil { + return err + } + page.lblr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lblr = next return nil } @@ -19022,8 +19107,11 @@ func (page LoadBalancerListResultPage) Values() []LoadBalancer { } // Creates a new instance of the LoadBalancerListResultPage type. -func NewLoadBalancerListResultPage(getNextPage func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)) LoadBalancerListResultPage { - return LoadBalancerListResultPage{fn: getNextPage} +func NewLoadBalancerListResultPage(cur LoadBalancerListResult, getNextPage func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)) LoadBalancerListResultPage { + return LoadBalancerListResultPage{ + fn: getNextPage, + lblr: cur, + } } // LoadBalancerLoadBalancingRuleListResult response for ListLoadBalancingRule API service call. @@ -19035,6 +19123,15 @@ type LoadBalancerLoadBalancingRuleListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerLoadBalancingRuleListResult. +func (lblbrlr LoadBalancerLoadBalancingRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lblbrlr.Value != nil { + objectMap["value"] = lblbrlr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerLoadBalancingRuleListResultIterator provides access to a complete listing of // LoadBalancingRule values. type LoadBalancerLoadBalancingRuleListResultIterator struct { @@ -19104,10 +19201,15 @@ func (lblbrlr LoadBalancerLoadBalancingRuleListResult) IsEmpty() bool { return lblbrlr.Value == nil || len(*lblbrlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lblbrlr LoadBalancerLoadBalancingRuleListResult) hasNextLink() bool { + return lblbrlr.NextLink != nil && len(*lblbrlr.NextLink) != 0 +} + // loadBalancerLoadBalancingRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lblbrlr LoadBalancerLoadBalancingRuleListResult) loadBalancerLoadBalancingRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if lblbrlr.NextLink == nil || len(to.String(lblbrlr.NextLink)) < 1 { + if !lblbrlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -19135,11 +19237,16 @@ func (page *LoadBalancerLoadBalancingRuleListResultPage) NextWithContext(ctx con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lblbrlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lblbrlr) + if err != nil { + return err + } + page.lblbrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lblbrlr = next return nil } @@ -19169,8 +19276,11 @@ func (page LoadBalancerLoadBalancingRuleListResultPage) Values() []LoadBalancing } // Creates a new instance of the LoadBalancerLoadBalancingRuleListResultPage type. -func NewLoadBalancerLoadBalancingRuleListResultPage(getNextPage func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error)) LoadBalancerLoadBalancingRuleListResultPage { - return LoadBalancerLoadBalancingRuleListResultPage{fn: getNextPage} +func NewLoadBalancerLoadBalancingRuleListResultPage(cur LoadBalancerLoadBalancingRuleListResult, getNextPage func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error)) LoadBalancerLoadBalancingRuleListResultPage { + return LoadBalancerLoadBalancingRuleListResultPage{ + fn: getNextPage, + lblbrlr: cur, + } } // LoadBalancerOutboundRuleListResult response for ListOutboundRule API service call. @@ -19182,6 +19292,15 @@ type LoadBalancerOutboundRuleListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerOutboundRuleListResult. +func (lborlr LoadBalancerOutboundRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lborlr.Value != nil { + objectMap["value"] = lborlr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerOutboundRuleListResultIterator provides access to a complete listing of OutboundRule values. type LoadBalancerOutboundRuleListResultIterator struct { i int @@ -19250,10 +19369,15 @@ func (lborlr LoadBalancerOutboundRuleListResult) IsEmpty() bool { return lborlr.Value == nil || len(*lborlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lborlr LoadBalancerOutboundRuleListResult) hasNextLink() bool { + return lborlr.NextLink != nil && len(*lborlr.NextLink) != 0 +} + // loadBalancerOutboundRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lborlr LoadBalancerOutboundRuleListResult) loadBalancerOutboundRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if lborlr.NextLink == nil || len(to.String(lborlr.NextLink)) < 1 { + if !lborlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -19281,11 +19405,16 @@ func (page *LoadBalancerOutboundRuleListResultPage) NextWithContext(ctx context. tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lborlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lborlr) + if err != nil { + return err + } + page.lborlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lborlr = next return nil } @@ -19315,8 +19444,11 @@ func (page LoadBalancerOutboundRuleListResultPage) Values() []OutboundRule { } // Creates a new instance of the LoadBalancerOutboundRuleListResultPage type. -func NewLoadBalancerOutboundRuleListResultPage(getNextPage func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error)) LoadBalancerOutboundRuleListResultPage { - return LoadBalancerOutboundRuleListResultPage{fn: getNextPage} +func NewLoadBalancerOutboundRuleListResultPage(cur LoadBalancerOutboundRuleListResult, getNextPage func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error)) LoadBalancerOutboundRuleListResultPage { + return LoadBalancerOutboundRuleListResultPage{ + fn: getNextPage, + lborlr: cur, + } } // LoadBalancerProbeListResult response for ListProbe API service call. @@ -19328,6 +19460,15 @@ type LoadBalancerProbeListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerProbeListResult. +func (lbplr LoadBalancerProbeListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbplr.Value != nil { + objectMap["value"] = lbplr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerProbeListResultIterator provides access to a complete listing of Probe values. type LoadBalancerProbeListResultIterator struct { i int @@ -19396,10 +19537,15 @@ func (lbplr LoadBalancerProbeListResult) IsEmpty() bool { return lbplr.Value == nil || len(*lbplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lbplr LoadBalancerProbeListResult) hasNextLink() bool { + return lbplr.NextLink != nil && len(*lbplr.NextLink) != 0 +} + // loadBalancerProbeListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lbplr LoadBalancerProbeListResult) loadBalancerProbeListResultPreparer(ctx context.Context) (*http.Request, error) { - if lbplr.NextLink == nil || len(to.String(lbplr.NextLink)) < 1 { + if !lbplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -19427,11 +19573,16 @@ func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lbplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lbplr) + if err != nil { + return err + } + page.lbplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lbplr = next return nil } @@ -19461,8 +19612,11 @@ func (page LoadBalancerProbeListResultPage) Values() []Probe { } // Creates a new instance of the LoadBalancerProbeListResultPage type. -func NewLoadBalancerProbeListResultPage(getNextPage func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error)) LoadBalancerProbeListResultPage { - return LoadBalancerProbeListResultPage{fn: getNextPage} +func NewLoadBalancerProbeListResultPage(cur LoadBalancerProbeListResult, getNextPage func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error)) LoadBalancerProbeListResultPage { + return LoadBalancerProbeListResultPage{ + fn: getNextPage, + lbplr: cur, + } } // LoadBalancerPropertiesFormat properties of the load balancer. @@ -19490,12 +19644,25 @@ type LoadBalancerPropertiesFormat struct { // LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type LoadBalancersCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LoadBalancersClient) (LoadBalancer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LoadBalancersCreateOrUpdateFuture) Result(client LoadBalancersClient) (lb LoadBalancer, err error) { +// result is the default implementation for LoadBalancersCreateOrUpdateFuture.Result. +func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -19519,12 +19686,25 @@ func (future *LoadBalancersCreateOrUpdateFuture) Result(client LoadBalancersClie // LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type LoadBalancersDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LoadBalancersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LoadBalancersDeleteFuture) Result(client LoadBalancersClient) (ar autorest.Response, err error) { +// result is the default implementation for LoadBalancersDeleteFuture.Result. +func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -19548,12 +19728,25 @@ type LoadBalancerSku struct { // LoadBalancersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type LoadBalancersUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LoadBalancersClient) (LoadBalancer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LoadBalancersUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LoadBalancersUpdateTagsFuture) Result(client LoadBalancersClient) (lb LoadBalancer, err error) { +// result is the default implementation for LoadBalancersUpdateTagsFuture.Result. +func (future *LoadBalancersUpdateTagsFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -19822,6 +20015,15 @@ type LocalNetworkGatewayListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LocalNetworkGatewayListResult. +func (lnglr LocalNetworkGatewayListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lnglr.Value != nil { + objectMap["value"] = lnglr.Value + } + return json.Marshal(objectMap) +} + // LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway // values. type LocalNetworkGatewayListResultIterator struct { @@ -19891,10 +20093,15 @@ func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { return lnglr.Value == nil || len(*lnglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool { + return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0 +} + // localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if lnglr.NextLink == nil || len(to.String(lnglr.NextLink)) < 1 { + if !lnglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -19922,11 +20129,16 @@ func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lnglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lnglr) + if err != nil { + return err + } + page.lnglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lnglr = next return nil } @@ -19956,8 +20168,11 @@ func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway { } // Creates a new instance of the LocalNetworkGatewayListResultPage type. -func NewLocalNetworkGatewayListResultPage(getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage { - return LocalNetworkGatewayListResultPage{fn: getNextPage} +func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage { + return LocalNetworkGatewayListResultPage{ + fn: getNextPage, + lnglr: cur, + } } // LocalNetworkGatewayPropertiesFormat localNetworkGateway properties. @@ -19974,15 +20189,46 @@ type LocalNetworkGatewayPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for LocalNetworkGatewayPropertiesFormat. +func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lngpf.LocalNetworkAddressSpace != nil { + objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace + } + if lngpf.GatewayIPAddress != nil { + objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress + } + if lngpf.BgpSettings != nil { + objectMap["bgpSettings"] = lngpf.BgpSettings + } + if lngpf.ResourceGUID != nil { + objectMap["resourceGuid"] = lngpf.ResourceGUID + } + return json.Marshal(objectMap) +} + // LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type LocalNetworkGatewaysCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LocalNetworkGatewaysCreateOrUpdateFuture) Result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LocalNetworkGatewaysCreateOrUpdateFuture.Result. +func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -20006,12 +20252,25 @@ func (future *LocalNetworkGatewaysCreateOrUpdateFuture) Result(client LocalNetwo // LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type LocalNetworkGatewaysDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LocalNetworkGatewaysClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LocalNetworkGatewaysDeleteFuture) Result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for LocalNetworkGatewaysDeleteFuture.Result. +func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -20029,12 +20288,25 @@ func (future *LocalNetworkGatewaysDeleteFuture) Result(client LocalNetworkGatewa // LocalNetworkGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type LocalNetworkGatewaysUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LocalNetworkGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *LocalNetworkGatewaysUpdateTagsFuture) Result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { +// result is the default implementation for LocalNetworkGatewaysUpdateTagsFuture.Result. +func (future *LocalNetworkGatewaysUpdateTagsFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -20382,10 +20654,15 @@ func (nglr NatGatewayListResult) IsEmpty() bool { return nglr.Value == nil || len(*nglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (nglr NatGatewayListResult) hasNextLink() bool { + return nglr.NextLink != nil && len(*nglr.NextLink) != 0 +} + // natGatewayListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (nglr NatGatewayListResult) natGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if nglr.NextLink == nil || len(to.String(nglr.NextLink)) < 1 { + if !nglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -20413,11 +20690,16 @@ func (page *NatGatewayListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.nglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.nglr) + if err != nil { + return err + } + page.nglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.nglr = next return nil } @@ -20447,8 +20729,11 @@ func (page NatGatewayListResultPage) Values() []NatGateway { } // Creates a new instance of the NatGatewayListResultPage type. -func NewNatGatewayListResultPage(getNextPage func(context.Context, NatGatewayListResult) (NatGatewayListResult, error)) NatGatewayListResultPage { - return NatGatewayListResultPage{fn: getNextPage} +func NewNatGatewayListResultPage(cur NatGatewayListResult, getNextPage func(context.Context, NatGatewayListResult) (NatGatewayListResult, error)) NatGatewayListResultPage { + return NatGatewayListResultPage{ + fn: getNextPage, + nglr: cur, + } } // NatGatewayPropertiesFormat nat Gateway properties. @@ -20467,15 +20752,49 @@ type NatGatewayPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for NatGatewayPropertiesFormat. +func (ngpf NatGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ngpf.IdleTimeoutInMinutes != nil { + objectMap["idleTimeoutInMinutes"] = ngpf.IdleTimeoutInMinutes + } + if ngpf.PublicIPAddresses != nil { + objectMap["publicIpAddresses"] = ngpf.PublicIPAddresses + } + if ngpf.PublicIPPrefixes != nil { + objectMap["publicIpPrefixes"] = ngpf.PublicIPPrefixes + } + if ngpf.ResourceGUID != nil { + objectMap["resourceGuid"] = ngpf.ResourceGUID + } + if ngpf.ProvisioningState != nil { + objectMap["provisioningState"] = ngpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // NatGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type NatGatewaysCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NatGatewaysClient) (NatGateway, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *NatGatewaysCreateOrUpdateFuture) Result(client NatGatewaysClient) (ng NatGateway, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NatGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NatGatewaysCreateOrUpdateFuture.Result. +func (future *NatGatewaysCreateOrUpdateFuture) result(client NatGatewaysClient) (ng NatGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -20499,12 +20818,25 @@ func (future *NatGatewaysCreateOrUpdateFuture) Result(client NatGatewaysClient) // NatGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type NatGatewaysDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NatGatewaysClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NatGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *NatGatewaysDeleteFuture) Result(client NatGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for NatGatewaysDeleteFuture.Result. +func (future *NatGatewaysDeleteFuture) result(client NatGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -20719,10 +21051,15 @@ func (olr OperationListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + if !olr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -20750,11 +21087,16 @@ func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.olr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.olr = next return nil } @@ -20784,8 +21126,11 @@ func (page OperationListResultPage) Values() []Operation { } // Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{fn: getNextPage} +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } } // OperationPropertiesFormat description of operation properties format. @@ -21046,15 +21391,52 @@ type P2SVpnGatewayProperties struct { VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnGatewayProperties. +func (pvgp P2SVpnGatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvgp.VirtualHub != nil { + objectMap["virtualHub"] = pvgp.VirtualHub + } + if pvgp.ProvisioningState != "" { + objectMap["provisioningState"] = pvgp.ProvisioningState + } + if pvgp.VpnGatewayScaleUnit != nil { + objectMap["vpnGatewayScaleUnit"] = pvgp.VpnGatewayScaleUnit + } + if pvgp.P2SVpnServerConfiguration != nil { + objectMap["p2SVpnServerConfiguration"] = pvgp.P2SVpnServerConfiguration + } + if pvgp.VpnClientAddressPool != nil { + objectMap["vpnClientAddressPool"] = pvgp.VpnClientAddressPool + } + if pvgp.CustomRoutes != nil { + objectMap["customRoutes"] = pvgp.CustomRoutes + } + return json.Marshal(objectMap) +} + // P2sVpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type P2sVpnGatewaysCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *P2sVpnGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *P2sVpnGatewaysCreateOrUpdateFuture) Result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { +// result is the default implementation for P2sVpnGatewaysCreateOrUpdateFuture.Result. +func (future *P2sVpnGatewaysCreateOrUpdateFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21078,12 +21460,25 @@ func (future *P2sVpnGatewaysCreateOrUpdateFuture) Result(client P2sVpnGatewaysCl // P2sVpnGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type P2sVpnGatewaysDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(P2sVpnGatewaysClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *P2sVpnGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *P2sVpnGatewaysDeleteFuture) Result(client P2sVpnGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for P2sVpnGatewaysDeleteFuture.Result. +func (future *P2sVpnGatewaysDeleteFuture) result(client P2sVpnGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21101,12 +21496,25 @@ func (future *P2sVpnGatewaysDeleteFuture) Result(client P2sVpnGatewaysClient) (a // P2sVpnGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type P2sVpnGatewaysGenerateVpnProfileFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(P2sVpnGatewaysClient) (VpnProfileResponse, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *P2sVpnGatewaysGenerateVpnProfileFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *P2sVpnGatewaysGenerateVpnProfileFuture) Result(client P2sVpnGatewaysClient) (vpr VpnProfileResponse, err error) { +// result is the default implementation for P2sVpnGatewaysGenerateVpnProfileFuture.Result. +func (future *P2sVpnGatewaysGenerateVpnProfileFuture) result(client P2sVpnGatewaysClient) (vpr VpnProfileResponse, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21130,12 +21538,25 @@ func (future *P2sVpnGatewaysGenerateVpnProfileFuture) Result(client P2sVpnGatewa // P2sVpnGatewaysGetP2sVpnConnectionHealthFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type P2sVpnGatewaysGetP2sVpnConnectionHealthFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) Result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { +// result is the default implementation for P2sVpnGatewaysGetP2sVpnConnectionHealthFuture.Result. +func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21159,12 +21580,25 @@ func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) Result(client P2sVp // P2sVpnGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type P2sVpnGatewaysUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *P2sVpnGatewaysUpdateTagsFuture) Result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *P2sVpnGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for P2sVpnGatewaysUpdateTagsFuture.Result. +func (future *P2sVpnGatewaysUpdateTagsFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21282,6 +21716,15 @@ type P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat. +func (pvscrcrcpf P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscrcrcpf.Thumbprint != nil { + objectMap["thumbprint"] = pvscrcrcpf.Thumbprint + } + return json.Marshal(objectMap) +} + // P2SVpnServerConfigRadiusServerRootCertificate radius Server root certificate of // P2SVpnServerConfiguration. type P2SVpnServerConfigRadiusServerRootCertificate struct { @@ -21373,6 +21816,15 @@ type P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat. +func (pvscrsrcpf P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscrsrcpf.PublicCertData != nil { + objectMap["publicCertData"] = pvscrsrcpf.PublicCertData + } + return json.Marshal(objectMap) +} + // P2SVpnServerConfiguration p2SVpnServerConfiguration Resource. type P2SVpnServerConfiguration struct { autorest.Response `json:"-"` @@ -21480,15 +21932,64 @@ type P2SVpnServerConfigurationProperties struct { Etag *string `json:"etag,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnServerConfigurationProperties. +func (pvscp P2SVpnServerConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscp.Name != nil { + objectMap["name"] = pvscp.Name + } + if pvscp.VpnProtocols != nil { + objectMap["vpnProtocols"] = pvscp.VpnProtocols + } + if pvscp.P2SVpnServerConfigVpnClientRootCertificates != nil { + objectMap["p2SVpnServerConfigVpnClientRootCertificates"] = pvscp.P2SVpnServerConfigVpnClientRootCertificates + } + if pvscp.P2SVpnServerConfigVpnClientRevokedCertificates != nil { + objectMap["p2SVpnServerConfigVpnClientRevokedCertificates"] = pvscp.P2SVpnServerConfigVpnClientRevokedCertificates + } + if pvscp.P2SVpnServerConfigRadiusServerRootCertificates != nil { + objectMap["p2SVpnServerConfigRadiusServerRootCertificates"] = pvscp.P2SVpnServerConfigRadiusServerRootCertificates + } + if pvscp.P2SVpnServerConfigRadiusClientRootCertificates != nil { + objectMap["p2SVpnServerConfigRadiusClientRootCertificates"] = pvscp.P2SVpnServerConfigRadiusClientRootCertificates + } + if pvscp.VpnClientIpsecPolicies != nil { + objectMap["vpnClientIpsecPolicies"] = pvscp.VpnClientIpsecPolicies + } + if pvscp.RadiusServerAddress != nil { + objectMap["radiusServerAddress"] = pvscp.RadiusServerAddress + } + if pvscp.RadiusServerSecret != nil { + objectMap["radiusServerSecret"] = pvscp.RadiusServerSecret + } + if pvscp.Etag != nil { + objectMap["etag"] = pvscp.Etag + } + return json.Marshal(objectMap) +} + // P2sVpnServerConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type P2sVpnServerConfigurationsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(P2sVpnServerConfigurationsClient) (P2SVpnServerConfiguration, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *P2sVpnServerConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *P2sVpnServerConfigurationsCreateOrUpdateFuture) Result(client P2sVpnServerConfigurationsClient) (pvsc P2SVpnServerConfiguration, err error) { +// result is the default implementation for P2sVpnServerConfigurationsCreateOrUpdateFuture.Result. +func (future *P2sVpnServerConfigurationsCreateOrUpdateFuture) result(client P2sVpnServerConfigurationsClient) (pvsc P2SVpnServerConfiguration, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21512,12 +22013,25 @@ func (future *P2sVpnServerConfigurationsCreateOrUpdateFuture) Result(client P2sV // P2sVpnServerConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type P2sVpnServerConfigurationsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(P2sVpnServerConfigurationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *P2sVpnServerConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *P2sVpnServerConfigurationsDeleteFuture) Result(client P2sVpnServerConfigurationsClient) (ar autorest.Response, err error) { +// result is the default implementation for P2sVpnServerConfigurationsDeleteFuture.Result. +func (future *P2sVpnServerConfigurationsDeleteFuture) result(client P2sVpnServerConfigurationsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21623,6 +22137,15 @@ type P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat. +func (pvscvcrcpf P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscvcrcpf.Thumbprint != nil { + objectMap["thumbprint"] = pvscvcrcpf.Thumbprint + } + return json.Marshal(objectMap) +} + // P2SVpnServerConfigVpnClientRootCertificate VPN client root certificate of P2SVpnServerConfiguration. type P2SVpnServerConfigVpnClientRootCertificate struct { // P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat - Properties of the P2SVpnServerConfiguration VPN client root certificate. @@ -21713,6 +22236,15 @@ type P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat. +func (pvscvcrcpf P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscvcrcpf.PublicCertData != nil { + objectMap["publicCertData"] = pvscvcrcpf.PublicCertData + } + return json.Marshal(objectMap) +} + // PacketCapture parameters that define the create packet capture operation. type PacketCapture struct { // PacketCaptureParameters - Properties of the packet capture. @@ -21903,12 +22435,25 @@ type PacketCaptureResultProperties struct { // PacketCapturesCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type PacketCapturesCreateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PacketCapturesClient) (PacketCaptureResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PacketCapturesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PacketCapturesCreateFuture) Result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) { +// result is the default implementation for PacketCapturesCreateFuture.Result. +func (future *PacketCapturesCreateFuture) result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21932,12 +22477,25 @@ func (future *PacketCapturesCreateFuture) Result(client PacketCapturesClient) (p // PacketCapturesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type PacketCapturesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PacketCapturesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PacketCapturesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PacketCapturesDeleteFuture) Result(client PacketCapturesClient) (ar autorest.Response, err error) { +// result is the default implementation for PacketCapturesDeleteFuture.Result. +func (future *PacketCapturesDeleteFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21955,12 +22513,25 @@ func (future *PacketCapturesDeleteFuture) Result(client PacketCapturesClient) (a // PacketCapturesGetStatusFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type PacketCapturesGetStatusFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PacketCapturesClient) (PacketCaptureQueryStatusResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PacketCapturesGetStatusFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PacketCapturesGetStatusFuture) Result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) { +// result is the default implementation for PacketCapturesGetStatusFuture.Result. +func (future *PacketCapturesGetStatusFuture) result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -21984,12 +22555,25 @@ func (future *PacketCapturesGetStatusFuture) Result(client PacketCapturesClient) // PacketCapturesStopFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type PacketCapturesStopFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PacketCapturesClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PacketCapturesStopFuture) Result(client PacketCapturesClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PacketCapturesStopFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PacketCapturesStopFuture.Result. +func (future *PacketCapturesStopFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -22360,10 +22944,15 @@ func (percclr PeerExpressRouteCircuitConnectionListResult) IsEmpty() bool { return percclr.Value == nil || len(*percclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (percclr PeerExpressRouteCircuitConnectionListResult) hasNextLink() bool { + return percclr.NextLink != nil && len(*percclr.NextLink) != 0 +} + // peerExpressRouteCircuitConnectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (percclr PeerExpressRouteCircuitConnectionListResult) peerExpressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if percclr.NextLink == nil || len(to.String(percclr.NextLink)) < 1 { + if !percclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -22392,11 +22981,16 @@ func (page *PeerExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.percclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.percclr) + if err != nil { + return err + } + page.percclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.percclr = next return nil } @@ -22426,8 +23020,11 @@ func (page PeerExpressRouteCircuitConnectionListResultPage) Values() []PeerExpre } // Creates a new instance of the PeerExpressRouteCircuitConnectionListResultPage type. -func NewPeerExpressRouteCircuitConnectionListResultPage(getNextPage func(context.Context, PeerExpressRouteCircuitConnectionListResult) (PeerExpressRouteCircuitConnectionListResult, error)) PeerExpressRouteCircuitConnectionListResultPage { - return PeerExpressRouteCircuitConnectionListResultPage{fn: getNextPage} +func NewPeerExpressRouteCircuitConnectionListResultPage(cur PeerExpressRouteCircuitConnectionListResult, getNextPage func(context.Context, PeerExpressRouteCircuitConnectionListResult) (PeerExpressRouteCircuitConnectionListResult, error)) PeerExpressRouteCircuitConnectionListResultPage { + return PeerExpressRouteCircuitConnectionListResultPage{ + fn: getNextPage, + percclr: cur, + } } // PeerExpressRouteCircuitConnectionPropertiesFormat properties of the peer express route circuit @@ -22449,6 +23046,30 @@ type PeerExpressRouteCircuitConnectionPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for PeerExpressRouteCircuitConnectionPropertiesFormat. +func (perccpf PeerExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if perccpf.ExpressRouteCircuitPeering != nil { + objectMap["expressRouteCircuitPeering"] = perccpf.ExpressRouteCircuitPeering + } + if perccpf.PeerExpressRouteCircuitPeering != nil { + objectMap["peerExpressRouteCircuitPeering"] = perccpf.PeerExpressRouteCircuitPeering + } + if perccpf.AddressPrefix != nil { + objectMap["addressPrefix"] = perccpf.AddressPrefix + } + if perccpf.CircuitConnectionStatus != "" { + objectMap["circuitConnectionStatus"] = perccpf.CircuitConnectionStatus + } + if perccpf.ConnectionName != nil { + objectMap["connectionName"] = perccpf.ConnectionName + } + if perccpf.AuthResourceGUID != nil { + objectMap["authResourceGuid"] = perccpf.AuthResourceGUID + } + return json.Marshal(objectMap) +} + // PolicySettings defines contents of a web application firewall global configuration. type PolicySettings struct { // EnabledState - Describes if the policy is in enabled state or disabled state. Possible values include: 'WebApplicationFirewallEnabledStateDisabled', 'WebApplicationFirewallEnabledStateEnabled' @@ -22692,6 +23313,15 @@ type PrivateEndpointListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for PrivateEndpointListResult. +func (pelr PrivateEndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pelr.Value != nil { + objectMap["value"] = pelr.Value + } + return json.Marshal(objectMap) +} + // PrivateEndpointListResultIterator provides access to a complete listing of PrivateEndpoint values. type PrivateEndpointListResultIterator struct { i int @@ -22760,10 +23390,15 @@ func (pelr PrivateEndpointListResult) IsEmpty() bool { return pelr.Value == nil || len(*pelr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (pelr PrivateEndpointListResult) hasNextLink() bool { + return pelr.NextLink != nil && len(*pelr.NextLink) != 0 +} + // privateEndpointListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (pelr PrivateEndpointListResult) privateEndpointListResultPreparer(ctx context.Context) (*http.Request, error) { - if pelr.NextLink == nil || len(to.String(pelr.NextLink)) < 1 { + if !pelr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -22791,11 +23426,16 @@ func (page *PrivateEndpointListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.pelr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.pelr) + if err != nil { + return err + } + page.pelr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.pelr = next return nil } @@ -22825,8 +23465,11 @@ func (page PrivateEndpointListResultPage) Values() []PrivateEndpoint { } // Creates a new instance of the PrivateEndpointListResultPage type. -func NewPrivateEndpointListResultPage(getNextPage func(context.Context, PrivateEndpointListResult) (PrivateEndpointListResult, error)) PrivateEndpointListResultPage { - return PrivateEndpointListResultPage{fn: getNextPage} +func NewPrivateEndpointListResultPage(cur PrivateEndpointListResult, getNextPage func(context.Context, PrivateEndpointListResult) (PrivateEndpointListResult, error)) PrivateEndpointListResultPage { + return PrivateEndpointListResultPage{ + fn: getNextPage, + pelr: cur, + } } // PrivateEndpointProperties properties of the private endpoint. @@ -22843,15 +23486,46 @@ type PrivateEndpointProperties struct { ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` } +// MarshalJSON is the custom marshaler for PrivateEndpointProperties. +func (pep PrivateEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pep.Subnet != nil { + objectMap["subnet"] = pep.Subnet + } + if pep.ProvisioningState != "" { + objectMap["provisioningState"] = pep.ProvisioningState + } + if pep.PrivateLinkServiceConnections != nil { + objectMap["privateLinkServiceConnections"] = pep.PrivateLinkServiceConnections + } + if pep.ManualPrivateLinkServiceConnections != nil { + objectMap["manualPrivateLinkServiceConnections"] = pep.ManualPrivateLinkServiceConnections + } + return json.Marshal(objectMap) +} + // PrivateEndpointsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type PrivateEndpointsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointsClient) (PrivateEndpoint, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PrivateEndpointsCreateOrUpdateFuture) Result(client PrivateEndpointsClient) (peVar PrivateEndpoint, err error) { +// result is the default implementation for PrivateEndpointsCreateOrUpdateFuture.Result. +func (future *PrivateEndpointsCreateOrUpdateFuture) result(client PrivateEndpointsClient) (peVar PrivateEndpoint, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -22875,12 +23549,25 @@ func (future *PrivateEndpointsCreateOrUpdateFuture) Result(client PrivateEndpoin // PrivateEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type PrivateEndpointsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PrivateEndpointsDeleteFuture) Result(client PrivateEndpointsClient) (ar autorest.Response, err error) { +// result is the default implementation for PrivateEndpointsDeleteFuture.Result. +func (future *PrivateEndpointsDeleteFuture) result(client PrivateEndpointsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -23241,6 +23928,15 @@ type PrivateLinkServiceListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for PrivateLinkServiceListResult. +func (plslr PrivateLinkServiceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plslr.Value != nil { + objectMap["value"] = plslr.Value + } + return json.Marshal(objectMap) +} + // PrivateLinkServiceListResultIterator provides access to a complete listing of PrivateLinkService values. type PrivateLinkServiceListResultIterator struct { i int @@ -23309,10 +24005,15 @@ func (plslr PrivateLinkServiceListResult) IsEmpty() bool { return plslr.Value == nil || len(*plslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (plslr PrivateLinkServiceListResult) hasNextLink() bool { + return plslr.NextLink != nil && len(*plslr.NextLink) != 0 +} + // privateLinkServiceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (plslr PrivateLinkServiceListResult) privateLinkServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if plslr.NextLink == nil || len(to.String(plslr.NextLink)) < 1 { + if !plslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -23340,11 +24041,16 @@ func (page *PrivateLinkServiceListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.plslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.plslr) + if err != nil { + return err + } + page.plslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.plslr = next return nil } @@ -23374,8 +24080,11 @@ func (page PrivateLinkServiceListResultPage) Values() []PrivateLinkService { } // Creates a new instance of the PrivateLinkServiceListResultPage type. -func NewPrivateLinkServiceListResultPage(getNextPage func(context.Context, PrivateLinkServiceListResult) (PrivateLinkServiceListResult, error)) PrivateLinkServiceListResultPage { - return PrivateLinkServiceListResultPage{fn: getNextPage} +func NewPrivateLinkServiceListResultPage(cur PrivateLinkServiceListResult, getNextPage func(context.Context, PrivateLinkServiceListResult) (PrivateLinkServiceListResult, error)) PrivateLinkServiceListResultPage { + return PrivateLinkServiceListResultPage{ + fn: getNextPage, + plslr: cur, + } } // PrivateLinkServiceProperties properties of the private link service. @@ -23400,6 +24109,33 @@ type PrivateLinkServiceProperties struct { Alias *string `json:"alias,omitempty"` } +// MarshalJSON is the custom marshaler for PrivateLinkServiceProperties. +func (plsp PrivateLinkServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plsp.LoadBalancerFrontendIPConfigurations != nil { + objectMap["loadBalancerFrontendIpConfigurations"] = plsp.LoadBalancerFrontendIPConfigurations + } + if plsp.IPConfigurations != nil { + objectMap["ipConfigurations"] = plsp.IPConfigurations + } + if plsp.ProvisioningState != "" { + objectMap["provisioningState"] = plsp.ProvisioningState + } + if plsp.PrivateEndpointConnections != nil { + objectMap["privateEndpointConnections"] = plsp.PrivateEndpointConnections + } + if plsp.Visibility != nil { + objectMap["visibility"] = plsp.Visibility + } + if plsp.AutoApproval != nil { + objectMap["autoApproval"] = plsp.AutoApproval + } + if plsp.Fqdns != nil { + objectMap["fqdns"] = plsp.Fqdns + } + return json.Marshal(objectMap) +} + // PrivateLinkServicePropertiesAutoApproval the auto-approval list of the private link service. type PrivateLinkServicePropertiesAutoApproval struct { // Subscriptions - The list of subscriptions. @@ -23412,15 +24148,112 @@ type PrivateLinkServicePropertiesVisibility struct { Subscriptions *[]string `json:"subscriptions,omitempty"` } +// PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture an abstraction for monitoring +// and retrieving the results of a long-running operation. +type PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateLinkServicesClient) (PrivateLinkServiceVisibility, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture.Result. +func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture) result(client PrivateLinkServicesClient) (plsv PrivateLinkServiceVisibility, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if plsv.Response.Response, err = future.GetResult(sender); err == nil && plsv.Response.Response.StatusCode != http.StatusNoContent { + plsv, err = client.CheckPrivateLinkServiceVisibilityByResourceGroupResponder(plsv.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture", "Result", plsv.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateLinkServicesClient) (PrivateLinkServiceVisibility, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture.Result. +func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture) result(client PrivateLinkServicesClient) (plsv PrivateLinkServiceVisibility, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if plsv.Response.Response, err = future.GetResult(sender); err == nil && plsv.Response.Response.StatusCode != http.StatusNoContent { + plsv, err = client.CheckPrivateLinkServiceVisibilityResponder(plsv.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture", "Result", plsv.Response.Response, "Failure responding to request") + } + } + return +} + // PrivateLinkServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type PrivateLinkServicesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateLinkServicesClient) (PrivateLinkService, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateLinkServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PrivateLinkServicesCreateOrUpdateFuture) Result(client PrivateLinkServicesClient) (pls PrivateLinkService, err error) { +// result is the default implementation for PrivateLinkServicesCreateOrUpdateFuture.Result. +func (future *PrivateLinkServicesCreateOrUpdateFuture) result(client PrivateLinkServicesClient) (pls PrivateLinkService, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -23444,12 +24277,25 @@ func (future *PrivateLinkServicesCreateOrUpdateFuture) Result(client PrivateLink // PrivateLinkServicesDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type PrivateLinkServicesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateLinkServicesClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PrivateLinkServicesDeleteFuture) Result(client PrivateLinkServicesClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateLinkServicesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateLinkServicesDeleteFuture.Result. +func (future *PrivateLinkServicesDeleteFuture) result(client PrivateLinkServicesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -23467,12 +24313,25 @@ func (future *PrivateLinkServicesDeleteFuture) Result(client PrivateLinkServices // PrivateLinkServicesDeletePrivateEndpointConnectionFuture an abstraction for monitoring and retrieving // the results of a long-running operation. type PrivateLinkServicesDeletePrivateEndpointConnectionFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateLinkServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) Result(client PrivateLinkServicesClient) (ar autorest.Response, err error) { +// result is the default implementation for PrivateLinkServicesDeletePrivateEndpointConnectionFuture.Result. +func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) result(client PrivateLinkServicesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -23605,6 +24464,30 @@ type ProbePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ProbePropertiesFormat. +func (ppf ProbePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppf.Protocol != "" { + objectMap["protocol"] = ppf.Protocol + } + if ppf.Port != nil { + objectMap["port"] = ppf.Port + } + if ppf.IntervalInSeconds != nil { + objectMap["intervalInSeconds"] = ppf.IntervalInSeconds + } + if ppf.NumberOfProbes != nil { + objectMap["numberOfProbes"] = ppf.NumberOfProbes + } + if ppf.RequestPath != nil { + objectMap["requestPath"] = ppf.RequestPath + } + if ppf.ProvisioningState != nil { + objectMap["provisioningState"] = ppf.ProvisioningState + } + return json.Marshal(objectMap) +} + // Profile network profile resource. type Profile struct { autorest.Response `json:"-"` @@ -23800,10 +24683,15 @@ func (plr ProfileListResult) IsEmpty() bool { return plr.Value == nil || len(*plr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (plr ProfileListResult) hasNextLink() bool { + return plr.NextLink != nil && len(*plr.NextLink) != 0 +} + // profileListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { - if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + if !plr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -23831,11 +24719,16 @@ func (page *ProfileListResultPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.plr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.plr = next return nil } @@ -23865,8 +24758,11 @@ func (page ProfileListResultPage) Values() []Profile { } // Creates a new instance of the ProfileListResultPage type. -func NewProfileListResultPage(getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage { - return ProfileListResultPage{fn: getNextPage} +func NewProfileListResultPage(cur ProfileListResult, getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage { + return ProfileListResultPage{ + fn: getNextPage, + plr: cur, + } } // ProfilePropertiesFormat network profile properties. @@ -23881,15 +24777,40 @@ type ProfilePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ProfilePropertiesFormat. +func (ppf ProfilePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppf.ContainerNetworkInterfaces != nil { + objectMap["containerNetworkInterfaces"] = ppf.ContainerNetworkInterfaces + } + if ppf.ContainerNetworkInterfaceConfigurations != nil { + objectMap["containerNetworkInterfaceConfigurations"] = ppf.ContainerNetworkInterfaceConfigurations + } + return json.Marshal(objectMap) +} + // ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ProfilesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ProfilesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ProfilesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ProfilesDeleteFuture) Result(client ProfilesClient) (ar autorest.Response, err error) { +// result is the default implementation for ProfilesDeleteFuture.Result. +func (future *ProfilesDeleteFuture) result(client ProfilesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -24081,12 +25002,25 @@ type PublicIPAddressDNSSettings struct { // PublicIPAddressesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type PublicIPAddressesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PublicIPAddressesClient) (PublicIPAddress, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PublicIPAddressesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PublicIPAddressesCreateOrUpdateFuture) Result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { +// result is the default implementation for PublicIPAddressesCreateOrUpdateFuture.Result. +func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -24110,12 +25044,25 @@ func (future *PublicIPAddressesCreateOrUpdateFuture) Result(client PublicIPAddre // PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type PublicIPAddressesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PublicIPAddressesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PublicIPAddressesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PublicIPAddressesDeleteFuture) Result(client PublicIPAddressesClient) (ar autorest.Response, err error) { +// result is the default implementation for PublicIPAddressesDeleteFuture.Result. +func (future *PublicIPAddressesDeleteFuture) result(client PublicIPAddressesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -24133,12 +25080,25 @@ func (future *PublicIPAddressesDeleteFuture) Result(client PublicIPAddressesClie // PublicIPAddressesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type PublicIPAddressesUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PublicIPAddressesClient) (PublicIPAddress, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PublicIPAddressesUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PublicIPAddressesUpdateTagsFuture) Result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { +// result is the default implementation for PublicIPAddressesUpdateTagsFuture.Result. +func (future *PublicIPAddressesUpdateTagsFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -24236,10 +25196,15 @@ func (pialr PublicIPAddressListResult) IsEmpty() bool { return pialr.Value == nil || len(*pialr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (pialr PublicIPAddressListResult) hasNextLink() bool { + return pialr.NextLink != nil && len(*pialr.NextLink) != 0 +} + // publicIPAddressListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer(ctx context.Context) (*http.Request, error) { - if pialr.NextLink == nil || len(to.String(pialr.NextLink)) < 1 { + if !pialr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -24267,11 +25232,16 @@ func (page *PublicIPAddressListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.pialr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.pialr) + if err != nil { + return err + } + page.pialr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.pialr = next return nil } @@ -24301,8 +25271,11 @@ func (page PublicIPAddressListResultPage) Values() []PublicIPAddress { } // Creates a new instance of the PublicIPAddressListResultPage type. -func NewPublicIPAddressListResultPage(getNextPage func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)) PublicIPAddressListResultPage { - return PublicIPAddressListResultPage{fn: getNextPage} +func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)) PublicIPAddressListResultPage { + return PublicIPAddressListResultPage{ + fn: getNextPage, + pialr: cur, + } } // PublicIPAddressPropertiesFormat public IP address properties. @@ -24331,6 +25304,42 @@ type PublicIPAddressPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for PublicIPAddressPropertiesFormat. +func (piapf PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if piapf.PublicIPAllocationMethod != "" { + objectMap["publicIPAllocationMethod"] = piapf.PublicIPAllocationMethod + } + if piapf.PublicIPAddressVersion != "" { + objectMap["publicIPAddressVersion"] = piapf.PublicIPAddressVersion + } + if piapf.DNSSettings != nil { + objectMap["dnsSettings"] = piapf.DNSSettings + } + if piapf.DdosSettings != nil { + objectMap["ddosSettings"] = piapf.DdosSettings + } + if piapf.IPTags != nil { + objectMap["ipTags"] = piapf.IPTags + } + if piapf.IPAddress != nil { + objectMap["ipAddress"] = piapf.IPAddress + } + if piapf.PublicIPPrefix != nil { + objectMap["publicIPPrefix"] = piapf.PublicIPPrefix + } + if piapf.IdleTimeoutInMinutes != nil { + objectMap["idleTimeoutInMinutes"] = piapf.IdleTimeoutInMinutes + } + if piapf.ResourceGUID != nil { + objectMap["resourceGuid"] = piapf.ResourceGUID + } + if piapf.ProvisioningState != nil { + objectMap["provisioningState"] = piapf.ProvisioningState + } + return json.Marshal(objectMap) +} + // PublicIPAddressSku SKU of a public IP address. type PublicIPAddressSku struct { // Name - Name of a public IP address SKU. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' @@ -24486,12 +25495,25 @@ func (pip *PublicIPPrefix) UnmarshalJSON(body []byte) error { // PublicIPPrefixesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type PublicIPPrefixesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PublicIPPrefixesClient) (PublicIPPrefix, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PublicIPPrefixesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PublicIPPrefixesCreateOrUpdateFuture) Result(client PublicIPPrefixesClient) (pip PublicIPPrefix, err error) { +// result is the default implementation for PublicIPPrefixesCreateOrUpdateFuture.Result. +func (future *PublicIPPrefixesCreateOrUpdateFuture) result(client PublicIPPrefixesClient) (pip PublicIPPrefix, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -24515,12 +25537,25 @@ func (future *PublicIPPrefixesCreateOrUpdateFuture) Result(client PublicIPPrefix // PublicIPPrefixesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type PublicIPPrefixesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PublicIPPrefixesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PublicIPPrefixesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PublicIPPrefixesDeleteFuture) Result(client PublicIPPrefixesClient) (ar autorest.Response, err error) { +// result is the default implementation for PublicIPPrefixesDeleteFuture.Result. +func (future *PublicIPPrefixesDeleteFuture) result(client PublicIPPrefixesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -24538,12 +25573,25 @@ func (future *PublicIPPrefixesDeleteFuture) Result(client PublicIPPrefixesClient // PublicIPPrefixesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type PublicIPPrefixesUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PublicIPPrefixesClient) (PublicIPPrefix, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PublicIPPrefixesUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PublicIPPrefixesUpdateTagsFuture) Result(client PublicIPPrefixesClient) (pip PublicIPPrefix, err error) { +// result is the default implementation for PublicIPPrefixesUpdateTagsFuture.Result. +func (future *PublicIPPrefixesUpdateTagsFuture) result(client PublicIPPrefixesClient) (pip PublicIPPrefix, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -24641,10 +25689,15 @@ func (piplr PublicIPPrefixListResult) IsEmpty() bool { return piplr.Value == nil || len(*piplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (piplr PublicIPPrefixListResult) hasNextLink() bool { + return piplr.NextLink != nil && len(*piplr.NextLink) != 0 +} + // publicIPPrefixListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (piplr PublicIPPrefixListResult) publicIPPrefixListResultPreparer(ctx context.Context) (*http.Request, error) { - if piplr.NextLink == nil || len(to.String(piplr.NextLink)) < 1 { + if !piplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -24672,11 +25725,16 @@ func (page *PublicIPPrefixListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.piplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.piplr) + if err != nil { + return err + } + page.piplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.piplr = next return nil } @@ -24706,8 +25764,11 @@ func (page PublicIPPrefixListResultPage) Values() []PublicIPPrefix { } // Creates a new instance of the PublicIPPrefixListResultPage type. -func NewPublicIPPrefixListResultPage(getNextPage func(context.Context, PublicIPPrefixListResult) (PublicIPPrefixListResult, error)) PublicIPPrefixListResultPage { - return PublicIPPrefixListResultPage{fn: getNextPage} +func NewPublicIPPrefixListResultPage(cur PublicIPPrefixListResult, getNextPage func(context.Context, PublicIPPrefixListResult) (PublicIPPrefixListResult, error)) PublicIPPrefixListResultPage { + return PublicIPPrefixListResultPage{ + fn: getNextPage, + piplr: cur, + } } // PublicIPPrefixPropertiesFormat public IP prefix properties. @@ -24730,6 +25791,33 @@ type PublicIPPrefixPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for PublicIPPrefixPropertiesFormat. +func (pippf PublicIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pippf.PublicIPAddressVersion != "" { + objectMap["publicIPAddressVersion"] = pippf.PublicIPAddressVersion + } + if pippf.IPTags != nil { + objectMap["ipTags"] = pippf.IPTags + } + if pippf.PrefixLength != nil { + objectMap["prefixLength"] = pippf.PrefixLength + } + if pippf.IPPrefix != nil { + objectMap["ipPrefix"] = pippf.IPPrefix + } + if pippf.PublicIPAddresses != nil { + objectMap["publicIPAddresses"] = pippf.PublicIPAddresses + } + if pippf.ResourceGUID != nil { + objectMap["resourceGuid"] = pippf.ResourceGUID + } + if pippf.ProvisioningState != nil { + objectMap["provisioningState"] = pippf.ProvisioningState + } + return json.Marshal(objectMap) +} + // PublicIPPrefixSku SKU of a public IP prefix. type PublicIPPrefixSku struct { // Name - Name of a public IP prefix SKU. Possible values include: 'PublicIPPrefixSkuNameStandard' @@ -24876,6 +25964,18 @@ type ResourceNavigationLinkFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceNavigationLinkFormat. +func (rnlf ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rnlf.LinkedResourceType != nil { + objectMap["linkedResourceType"] = rnlf.LinkedResourceType + } + if rnlf.Link != nil { + objectMap["link"] = rnlf.Link + } + return json.Marshal(objectMap) +} + // ResourceNavigationLinksListResult response for ResourceNavigationLinks_List operation. type ResourceNavigationLinksListResult struct { autorest.Response `json:"-"` @@ -24885,6 +25985,15 @@ type ResourceNavigationLinksListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceNavigationLinksListResult. +func (rnllr ResourceNavigationLinksListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rnllr.Value != nil { + objectMap["value"] = rnllr.Value + } + return json.Marshal(objectMap) +} + // ResourceSet the base resource set for visibility and auto-approval. type ResourceSet struct { // Subscriptions - The list of subscriptions. @@ -25173,10 +26282,15 @@ func (rflr RouteFilterListResult) IsEmpty() bool { return rflr.Value == nil || len(*rflr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rflr RouteFilterListResult) hasNextLink() bool { + return rflr.NextLink != nil && len(*rflr.NextLink) != 0 +} + // routeFilterListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rflr RouteFilterListResult) routeFilterListResultPreparer(ctx context.Context) (*http.Request, error) { - if rflr.NextLink == nil || len(to.String(rflr.NextLink)) < 1 { + if !rflr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -25204,11 +26318,16 @@ func (page *RouteFilterListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rflr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rflr) + if err != nil { + return err + } + page.rflr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rflr = next return nil } @@ -25238,8 +26357,11 @@ func (page RouteFilterListResultPage) Values() []RouteFilter { } // Creates a new instance of the RouteFilterListResultPage type. -func NewRouteFilterListResultPage(getNextPage func(context.Context, RouteFilterListResult) (RouteFilterListResult, error)) RouteFilterListResultPage { - return RouteFilterListResultPage{fn: getNextPage} +func NewRouteFilterListResultPage(cur RouteFilterListResult, getNextPage func(context.Context, RouteFilterListResult) (RouteFilterListResult, error)) RouteFilterListResultPage { + return RouteFilterListResultPage{ + fn: getNextPage, + rflr: cur, + } } // RouteFilterPropertiesFormat route Filter Resource. @@ -25254,6 +26376,21 @@ type RouteFilterPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for RouteFilterPropertiesFormat. +func (rfpf RouteFilterPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rfpf.Rules != nil { + objectMap["rules"] = rfpf.Rules + } + if rfpf.Peerings != nil { + objectMap["peerings"] = rfpf.Peerings + } + if rfpf.Ipv6Peerings != nil { + objectMap["ipv6Peerings"] = rfpf.Ipv6Peerings + } + return json.Marshal(objectMap) +} + // RouteFilterRule route Filter Rule Resource. type RouteFilterRule struct { autorest.Response `json:"-"` @@ -25424,10 +26561,15 @@ func (rfrlr RouteFilterRuleListResult) IsEmpty() bool { return rfrlr.Value == nil || len(*rfrlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rfrlr RouteFilterRuleListResult) hasNextLink() bool { + return rfrlr.NextLink != nil && len(*rfrlr.NextLink) != 0 +} + // routeFilterRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rfrlr RouteFilterRuleListResult) routeFilterRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if rfrlr.NextLink == nil || len(to.String(rfrlr.NextLink)) < 1 { + if !rfrlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -25455,11 +26597,16 @@ func (page *RouteFilterRuleListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rfrlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rfrlr) + if err != nil { + return err + } + page.rfrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rfrlr = next return nil } @@ -25489,8 +26636,11 @@ func (page RouteFilterRuleListResultPage) Values() []RouteFilterRule { } // Creates a new instance of the RouteFilterRuleListResultPage type. -func NewRouteFilterRuleListResultPage(getNextPage func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error)) RouteFilterRuleListResultPage { - return RouteFilterRuleListResultPage{fn: getNextPage} +func NewRouteFilterRuleListResultPage(cur RouteFilterRuleListResult, getNextPage func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error)) RouteFilterRuleListResultPage { + return RouteFilterRuleListResultPage{ + fn: getNextPage, + rfrlr: cur, + } } // RouteFilterRulePropertiesFormat route Filter Rule Resource. @@ -25505,15 +26655,43 @@ type RouteFilterRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for RouteFilterRulePropertiesFormat. +func (rfrpf RouteFilterRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rfrpf.Access != "" { + objectMap["access"] = rfrpf.Access + } + if rfrpf.RouteFilterRuleType != nil { + objectMap["routeFilterRuleType"] = rfrpf.RouteFilterRuleType + } + if rfrpf.Communities != nil { + objectMap["communities"] = rfrpf.Communities + } + return json.Marshal(objectMap) +} + // RouteFilterRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type RouteFilterRulesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteFilterRulesClient) (RouteFilterRule, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteFilterRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RouteFilterRulesCreateOrUpdateFuture) Result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { +// result is the default implementation for RouteFilterRulesCreateOrUpdateFuture.Result. +func (future *RouteFilterRulesCreateOrUpdateFuture) result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -25537,12 +26715,25 @@ func (future *RouteFilterRulesCreateOrUpdateFuture) Result(client RouteFilterRul // RouteFilterRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RouteFilterRulesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteFilterRulesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteFilterRulesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RouteFilterRulesDeleteFuture) Result(client RouteFilterRulesClient) (ar autorest.Response, err error) { +// result is the default implementation for RouteFilterRulesDeleteFuture.Result. +func (future *RouteFilterRulesDeleteFuture) result(client RouteFilterRulesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -25560,12 +26751,25 @@ func (future *RouteFilterRulesDeleteFuture) Result(client RouteFilterRulesClient // RouteFilterRulesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RouteFilterRulesUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteFilterRulesClient) (RouteFilterRule, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteFilterRulesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RouteFilterRulesUpdateFuture) Result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { +// result is the default implementation for RouteFilterRulesUpdateFuture.Result. +func (future *RouteFilterRulesUpdateFuture) result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -25589,12 +26793,25 @@ func (future *RouteFilterRulesUpdateFuture) Result(client RouteFilterRulesClient // RouteFiltersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type RouteFiltersCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteFiltersClient) (RouteFilter, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteFiltersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RouteFiltersCreateOrUpdateFuture) Result(client RouteFiltersClient) (rf RouteFilter, err error) { +// result is the default implementation for RouteFiltersCreateOrUpdateFuture.Result. +func (future *RouteFiltersCreateOrUpdateFuture) result(client RouteFiltersClient) (rf RouteFilter, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -25618,12 +26835,25 @@ func (future *RouteFiltersCreateOrUpdateFuture) Result(client RouteFiltersClient // RouteFiltersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RouteFiltersDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteFiltersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteFiltersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RouteFiltersDeleteFuture) Result(client RouteFiltersClient) (ar autorest.Response, err error) { +// result is the default implementation for RouteFiltersDeleteFuture.Result. +func (future *RouteFiltersDeleteFuture) result(client RouteFiltersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -25641,12 +26871,25 @@ func (future *RouteFiltersDeleteFuture) Result(client RouteFiltersClient) (ar au // RouteFiltersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RouteFiltersUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteFiltersClient) (RouteFilter, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RouteFiltersUpdateFuture) Result(client RouteFiltersClient) (rf RouteFilter, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteFiltersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RouteFiltersUpdateFuture.Result. +func (future *RouteFiltersUpdateFuture) result(client RouteFiltersClient) (rf RouteFilter, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -25744,10 +26987,15 @@ func (rlr RouteListResult) IsEmpty() bool { return rlr.Value == nil || len(*rlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rlr RouteListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + // routeListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) { - if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + if !rlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -25775,11 +27023,16 @@ func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rlr = next return nil } @@ -25809,8 +27062,11 @@ func (page RouteListResultPage) Values() []Route { } // Creates a new instance of the RouteListResultPage type. -func NewRouteListResultPage(getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage { - return RouteListResultPage{fn: getNextPage} +func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage { + return RouteListResultPage{ + fn: getNextPage, + rlr: cur, + } } // RoutePropertiesFormat route resource. @@ -25828,12 +27084,25 @@ type RoutePropertiesFormat struct { // RoutesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RoutesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RoutesClient) (Route, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RoutesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RoutesCreateOrUpdateFuture) Result(client RoutesClient) (r Route, err error) { +// result is the default implementation for RoutesCreateOrUpdateFuture.Result. +func (future *RoutesCreateOrUpdateFuture) result(client RoutesClient) (r Route, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -25856,12 +27125,25 @@ func (future *RoutesCreateOrUpdateFuture) Result(client RoutesClient) (r Route, // RoutesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type RoutesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RoutesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RoutesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RoutesDeleteFuture) Result(client RoutesClient) (ar autorest.Response, err error) { +// result is the default implementation for RoutesDeleteFuture.Result. +func (future *RoutesDeleteFuture) result(client RoutesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -26071,10 +27353,15 @@ func (rtlr RouteTableListResult) IsEmpty() bool { return rtlr.Value == nil || len(*rtlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rtlr RouteTableListResult) hasNextLink() bool { + return rtlr.NextLink != nil && len(*rtlr.NextLink) != 0 +} + // routeTableListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rtlr RouteTableListResult) routeTableListResultPreparer(ctx context.Context) (*http.Request, error) { - if rtlr.NextLink == nil || len(to.String(rtlr.NextLink)) < 1 { + if !rtlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -26102,11 +27389,16 @@ func (page *RouteTableListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rtlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rtlr) + if err != nil { + return err + } + page.rtlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rtlr = next return nil } @@ -26136,8 +27428,11 @@ func (page RouteTableListResultPage) Values() []RouteTable { } // Creates a new instance of the RouteTableListResultPage type. -func NewRouteTableListResultPage(getNextPage func(context.Context, RouteTableListResult) (RouteTableListResult, error)) RouteTableListResultPage { - return RouteTableListResultPage{fn: getNextPage} +func NewRouteTableListResultPage(cur RouteTableListResult, getNextPage func(context.Context, RouteTableListResult) (RouteTableListResult, error)) RouteTableListResultPage { + return RouteTableListResultPage{ + fn: getNextPage, + rtlr: cur, + } } // RouteTablePropertiesFormat route Table resource. @@ -26152,15 +27447,43 @@ type RouteTablePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for RouteTablePropertiesFormat. +func (rtpf RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rtpf.Routes != nil { + objectMap["routes"] = rtpf.Routes + } + if rtpf.DisableBgpRoutePropagation != nil { + objectMap["disableBgpRoutePropagation"] = rtpf.DisableBgpRoutePropagation + } + if rtpf.ProvisioningState != nil { + objectMap["provisioningState"] = rtpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type RouteTablesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteTablesClient) (RouteTable, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RouteTablesCreateOrUpdateFuture) Result(client RouteTablesClient) (rt RouteTable, err error) { +// result is the default implementation for RouteTablesCreateOrUpdateFuture.Result. +func (future *RouteTablesCreateOrUpdateFuture) result(client RouteTablesClient) (rt RouteTable, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -26184,12 +27507,25 @@ func (future *RouteTablesCreateOrUpdateFuture) Result(client RouteTablesClient) // RouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RouteTablesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteTablesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteTablesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RouteTablesDeleteFuture) Result(client RouteTablesClient) (ar autorest.Response, err error) { +// result is the default implementation for RouteTablesDeleteFuture.Result. +func (future *RouteTablesDeleteFuture) result(client RouteTablesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -26207,12 +27543,25 @@ func (future *RouteTablesDeleteFuture) Result(client RouteTablesClient) (ar auto // RouteTablesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RouteTablesUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteTablesClient) (RouteTable, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *RouteTablesUpdateTagsFuture) Result(client RouteTablesClient) (rt RouteTable, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteTablesUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RouteTablesUpdateTagsFuture.Result. +func (future *RouteTablesUpdateTagsFuture) result(client RouteTablesClient) (rt RouteTable, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -26494,10 +27843,15 @@ func (sglr SecurityGroupListResult) IsEmpty() bool { return sglr.Value == nil || len(*sglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sglr SecurityGroupListResult) hasNextLink() bool { + return sglr.NextLink != nil && len(*sglr.NextLink) != 0 +} + // securityGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sglr SecurityGroupListResult) securityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if sglr.NextLink == nil || len(to.String(sglr.NextLink)) < 1 { + if !sglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -26525,11 +27879,16 @@ func (page *SecurityGroupListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sglr) + if err != nil { + return err + } + page.sglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sglr = next return nil } @@ -26559,8 +27918,11 @@ func (page SecurityGroupListResultPage) Values() []SecurityGroup { } // Creates a new instance of the SecurityGroupListResultPage type. -func NewSecurityGroupListResultPage(getNextPage func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)) SecurityGroupListResultPage { - return SecurityGroupListResultPage{fn: getNextPage} +func NewSecurityGroupListResultPage(cur SecurityGroupListResult, getNextPage func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)) SecurityGroupListResultPage { + return SecurityGroupListResultPage{ + fn: getNextPage, + sglr: cur, + } } // SecurityGroupNetworkInterface network interface and all its associated security rules. @@ -26587,6 +27949,24 @@ type SecurityGroupPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for SecurityGroupPropertiesFormat. +func (sgpf SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sgpf.SecurityRules != nil { + objectMap["securityRules"] = sgpf.SecurityRules + } + if sgpf.DefaultSecurityRules != nil { + objectMap["defaultSecurityRules"] = sgpf.DefaultSecurityRules + } + if sgpf.ResourceGUID != nil { + objectMap["resourceGuid"] = sgpf.ResourceGUID + } + if sgpf.ProvisioningState != nil { + objectMap["provisioningState"] = sgpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // SecurityGroupResult network configuration diagnostic result corresponded provided traffic query. type SecurityGroupResult struct { // SecurityRuleAccessResult - The network traffic is allowed or denied. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' @@ -26595,15 +27975,37 @@ type SecurityGroupResult struct { EvaluatedNetworkSecurityGroups *[]EvaluatedNetworkSecurityGroup `json:"evaluatedNetworkSecurityGroups,omitempty"` } +// MarshalJSON is the custom marshaler for SecurityGroupResult. +func (sgr SecurityGroupResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sgr.SecurityRuleAccessResult != "" { + objectMap["securityRuleAccessResult"] = sgr.SecurityRuleAccessResult + } + return json.Marshal(objectMap) +} + // SecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type SecurityGroupsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SecurityGroupsClient) (SecurityGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SecurityGroupsCreateOrUpdateFuture) Result(client SecurityGroupsClient) (sg SecurityGroup, err error) { +// result is the default implementation for SecurityGroupsCreateOrUpdateFuture.Result. +func (future *SecurityGroupsCreateOrUpdateFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -26627,12 +28029,25 @@ func (future *SecurityGroupsCreateOrUpdateFuture) Result(client SecurityGroupsCl // SecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SecurityGroupsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SecurityGroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SecurityGroupsDeleteFuture) Result(client SecurityGroupsClient) (ar autorest.Response, err error) { +// result is the default implementation for SecurityGroupsDeleteFuture.Result. +func (future *SecurityGroupsDeleteFuture) result(client SecurityGroupsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -26650,12 +28065,25 @@ func (future *SecurityGroupsDeleteFuture) Result(client SecurityGroupsClient) (a // SecurityGroupsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type SecurityGroupsUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SecurityGroupsClient) (SecurityGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SecurityGroupsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SecurityGroupsUpdateTagsFuture) Result(client SecurityGroupsClient) (sg SecurityGroup, err error) { +// result is the default implementation for SecurityGroupsUpdateTagsFuture.Result. +func (future *SecurityGroupsUpdateTagsFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -26861,10 +28289,15 @@ func (srlr SecurityRuleListResult) IsEmpty() bool { return srlr.Value == nil || len(*srlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (srlr SecurityRuleListResult) hasNextLink() bool { + return srlr.NextLink != nil && len(*srlr.NextLink) != 0 +} + // securityRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (srlr SecurityRuleListResult) securityRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if srlr.NextLink == nil || len(to.String(srlr.NextLink)) < 1 { + if !srlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -26892,11 +28325,16 @@ func (page *SecurityRuleListResultPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.srlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.srlr) + if err != nil { + return err + } + page.srlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.srlr = next return nil } @@ -26926,8 +28364,11 @@ func (page SecurityRuleListResultPage) Values() []SecurityRule { } // Creates a new instance of the SecurityRuleListResultPage type. -func NewSecurityRuleListResultPage(getNextPage func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)) SecurityRuleListResultPage { - return SecurityRuleListResultPage{fn: getNextPage} +func NewSecurityRuleListResultPage(cur SecurityRuleListResult, getNextPage func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)) SecurityRuleListResultPage { + return SecurityRuleListResultPage{ + fn: getNextPage, + srlr: cur, + } } // SecurityRulePropertiesFormat security rule resource. @@ -26969,12 +28410,25 @@ type SecurityRulePropertiesFormat struct { // SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type SecurityRulesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SecurityRulesClient) (SecurityRule, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SecurityRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SecurityRulesCreateOrUpdateFuture) Result(client SecurityRulesClient) (sr SecurityRule, err error) { +// result is the default implementation for SecurityRulesCreateOrUpdateFuture.Result. +func (future *SecurityRulesCreateOrUpdateFuture) result(client SecurityRulesClient) (sr SecurityRule, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -26998,12 +28452,25 @@ func (future *SecurityRulesCreateOrUpdateFuture) Result(client SecurityRulesClie // SecurityRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SecurityRulesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SecurityRulesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SecurityRulesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SecurityRulesDeleteFuture) Result(client SecurityRulesClient) (ar autorest.Response, err error) { +// result is the default implementation for SecurityRulesDeleteFuture.Result. +func (future *SecurityRulesDeleteFuture) result(client SecurityRulesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -27140,6 +28607,24 @@ type ServiceAssociationLinkPropertiesFormat struct { Locations *[]string `json:"locations,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceAssociationLinkPropertiesFormat. +func (salpf ServiceAssociationLinkPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if salpf.LinkedResourceType != nil { + objectMap["linkedResourceType"] = salpf.LinkedResourceType + } + if salpf.Link != nil { + objectMap["link"] = salpf.Link + } + if salpf.AllowDelete != nil { + objectMap["allowDelete"] = salpf.AllowDelete + } + if salpf.Locations != nil { + objectMap["locations"] = salpf.Locations + } + return json.Marshal(objectMap) +} + // ServiceAssociationLinksListResult response for ServiceAssociationLinks_List operation. type ServiceAssociationLinksListResult struct { autorest.Response `json:"-"` @@ -27149,6 +28634,15 @@ type ServiceAssociationLinksListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceAssociationLinksListResult. +func (sallr ServiceAssociationLinksListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sallr.Value != nil { + objectMap["value"] = sallr.Value + } + return json.Marshal(objectMap) +} + // ServiceDelegationPropertiesFormat properties of a service delegation. type ServiceDelegationPropertiesFormat struct { // ServiceName - The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). @@ -27159,15 +28653,40 @@ type ServiceDelegationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceDelegationPropertiesFormat. +func (sdpf ServiceDelegationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdpf.ServiceName != nil { + objectMap["serviceName"] = sdpf.ServiceName + } + if sdpf.Actions != nil { + objectMap["actions"] = sdpf.Actions + } + return json.Marshal(objectMap) +} + // ServiceEndpointPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type ServiceEndpointPoliciesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceEndpointPoliciesClient) (ServiceEndpointPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) Result(client ServiceEndpointPoliciesClient) (sep ServiceEndpointPolicy, err error) { +// result is the default implementation for ServiceEndpointPoliciesCreateOrUpdateFuture.Result. +func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) result(client ServiceEndpointPoliciesClient) (sep ServiceEndpointPolicy, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -27191,12 +28710,25 @@ func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) Result(client Service // ServiceEndpointPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ServiceEndpointPoliciesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceEndpointPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceEndpointPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServiceEndpointPoliciesDeleteFuture) Result(client ServiceEndpointPoliciesClient) (ar autorest.Response, err error) { +// result is the default implementation for ServiceEndpointPoliciesDeleteFuture.Result. +func (future *ServiceEndpointPoliciesDeleteFuture) result(client ServiceEndpointPoliciesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -27214,12 +28746,25 @@ func (future *ServiceEndpointPoliciesDeleteFuture) Result(client ServiceEndpoint // ServiceEndpointPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ServiceEndpointPoliciesUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceEndpointPoliciesClient) (ServiceEndpointPolicy, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServiceEndpointPoliciesUpdateFuture) Result(client ServiceEndpointPoliciesClient) (sep ServiceEndpointPolicy, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceEndpointPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServiceEndpointPoliciesUpdateFuture.Result. +func (future *ServiceEndpointPoliciesUpdateFuture) result(client ServiceEndpointPoliciesClient) (sep ServiceEndpointPolicy, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -27519,10 +29064,15 @@ func (sepdlr ServiceEndpointPolicyDefinitionListResult) IsEmpty() bool { return sepdlr.Value == nil || len(*sepdlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sepdlr ServiceEndpointPolicyDefinitionListResult) hasNextLink() bool { + return sepdlr.NextLink != nil && len(*sepdlr.NextLink) != 0 +} + // serviceEndpointPolicyDefinitionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sepdlr ServiceEndpointPolicyDefinitionListResult) serviceEndpointPolicyDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { - if sepdlr.NextLink == nil || len(to.String(sepdlr.NextLink)) < 1 { + if !sepdlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -27550,11 +29100,16 @@ func (page *ServiceEndpointPolicyDefinitionListResultPage) NextWithContext(ctx c tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sepdlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sepdlr) + if err != nil { + return err + } + page.sepdlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sepdlr = next return nil } @@ -27584,8 +29139,11 @@ func (page ServiceEndpointPolicyDefinitionListResultPage) Values() []ServiceEndp } // Creates a new instance of the ServiceEndpointPolicyDefinitionListResultPage type. -func NewServiceEndpointPolicyDefinitionListResultPage(getNextPage func(context.Context, ServiceEndpointPolicyDefinitionListResult) (ServiceEndpointPolicyDefinitionListResult, error)) ServiceEndpointPolicyDefinitionListResultPage { - return ServiceEndpointPolicyDefinitionListResultPage{fn: getNextPage} +func NewServiceEndpointPolicyDefinitionListResultPage(cur ServiceEndpointPolicyDefinitionListResult, getNextPage func(context.Context, ServiceEndpointPolicyDefinitionListResult) (ServiceEndpointPolicyDefinitionListResult, error)) ServiceEndpointPolicyDefinitionListResultPage { + return ServiceEndpointPolicyDefinitionListResultPage{ + fn: getNextPage, + sepdlr: cur, + } } // ServiceEndpointPolicyDefinitionPropertiesFormat service Endpoint policy definition resource. @@ -27600,15 +29158,43 @@ type ServiceEndpointPolicyDefinitionPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceEndpointPolicyDefinitionPropertiesFormat. +func (sepdpf ServiceEndpointPolicyDefinitionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sepdpf.Description != nil { + objectMap["description"] = sepdpf.Description + } + if sepdpf.Service != nil { + objectMap["service"] = sepdpf.Service + } + if sepdpf.ServiceResources != nil { + objectMap["serviceResources"] = sepdpf.ServiceResources + } + return json.Marshal(objectMap) +} + // ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceEndpointPolicyDefinitionsClient) (ServiceEndpointPolicyDefinition, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) Result(client ServiceEndpointPolicyDefinitionsClient) (sepd ServiceEndpointPolicyDefinition, err error) { +// result is the default implementation for ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture.Result. +func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) result(client ServiceEndpointPolicyDefinitionsClient) (sepd ServiceEndpointPolicyDefinition, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -27632,12 +29218,25 @@ func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) Result(clien // ServiceEndpointPolicyDefinitionsDeleteFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type ServiceEndpointPolicyDefinitionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceEndpointPolicyDefinitionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) Result(client ServiceEndpointPolicyDefinitionsClient) (ar autorest.Response, err error) { +// result is the default implementation for ServiceEndpointPolicyDefinitionsDeleteFuture.Result. +func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) result(client ServiceEndpointPolicyDefinitionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -27661,6 +29260,15 @@ type ServiceEndpointPolicyListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceEndpointPolicyListResult. +func (seplr ServiceEndpointPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if seplr.Value != nil { + objectMap["value"] = seplr.Value + } + return json.Marshal(objectMap) +} + // ServiceEndpointPolicyListResultIterator provides access to a complete listing of ServiceEndpointPolicy // values. type ServiceEndpointPolicyListResultIterator struct { @@ -27730,10 +29338,15 @@ func (seplr ServiceEndpointPolicyListResult) IsEmpty() bool { return seplr.Value == nil || len(*seplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (seplr ServiceEndpointPolicyListResult) hasNextLink() bool { + return seplr.NextLink != nil && len(*seplr.NextLink) != 0 +} + // serviceEndpointPolicyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (seplr ServiceEndpointPolicyListResult) serviceEndpointPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if seplr.NextLink == nil || len(to.String(seplr.NextLink)) < 1 { + if !seplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -27761,11 +29374,16 @@ func (page *ServiceEndpointPolicyListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.seplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.seplr) + if err != nil { + return err + } + page.seplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.seplr = next return nil } @@ -27795,8 +29413,11 @@ func (page ServiceEndpointPolicyListResultPage) Values() []ServiceEndpointPolicy } // Creates a new instance of the ServiceEndpointPolicyListResultPage type. -func NewServiceEndpointPolicyListResultPage(getNextPage func(context.Context, ServiceEndpointPolicyListResult) (ServiceEndpointPolicyListResult, error)) ServiceEndpointPolicyListResultPage { - return ServiceEndpointPolicyListResultPage{fn: getNextPage} +func NewServiceEndpointPolicyListResultPage(cur ServiceEndpointPolicyListResult, getNextPage func(context.Context, ServiceEndpointPolicyListResult) (ServiceEndpointPolicyListResult, error)) ServiceEndpointPolicyListResultPage { + return ServiceEndpointPolicyListResultPage{ + fn: getNextPage, + seplr: cur, + } } // ServiceEndpointPolicyPropertiesFormat service Endpoint Policy resource. @@ -27811,6 +29432,15 @@ type ServiceEndpointPolicyPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceEndpointPolicyPropertiesFormat. +func (seppf ServiceEndpointPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if seppf.ServiceEndpointPolicyDefinitions != nil { + objectMap["serviceEndpointPolicyDefinitions"] = seppf.ServiceEndpointPolicyDefinitions + } + return json.Marshal(objectMap) +} + // ServiceEndpointPropertiesFormat the service endpoint properties. type ServiceEndpointPropertiesFormat struct { // Service - The type of the endpoint service. @@ -27956,6 +29586,15 @@ type SubnetAssociation struct { SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` } +// MarshalJSON is the custom marshaler for SubnetAssociation. +func (sa SubnetAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sa.SecurityRules != nil { + objectMap["securityRules"] = sa.SecurityRules + } + return json.Marshal(objectMap) +} + // SubnetListResult response for ListSubnets API service callRetrieves all subnet that belongs to a virtual // network. type SubnetListResult struct { @@ -28034,10 +29673,15 @@ func (slr SubnetListResult) IsEmpty() bool { return slr.Value == nil || len(*slr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (slr SubnetListResult) hasNextLink() bool { + return slr.NextLink != nil && len(*slr.NextLink) != 0 +} + // subnetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (slr SubnetListResult) subnetListResultPreparer(ctx context.Context) (*http.Request, error) { - if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + if !slr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -28065,11 +29709,16 @@ func (page *SubnetListResultPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.slr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.slr = next return nil } @@ -28099,8 +29748,11 @@ func (page SubnetListResultPage) Values() []Subnet { } // Creates a new instance of the SubnetListResultPage type. -func NewSubnetListResultPage(getNextPage func(context.Context, SubnetListResult) (SubnetListResult, error)) SubnetListResultPage { - return SubnetListResultPage{fn: getNextPage} +func NewSubnetListResultPage(cur SubnetListResult, getNextPage func(context.Context, SubnetListResult) (SubnetListResult, error)) SubnetListResultPage { + return SubnetListResultPage{ + fn: getNextPage, + slr: cur, + } } // SubnetPropertiesFormat properties of the subnet. @@ -28141,15 +29793,73 @@ type SubnetPropertiesFormat struct { PrivateLinkServiceNetworkPolicies *string `json:"privateLinkServiceNetworkPolicies,omitempty"` } +// MarshalJSON is the custom marshaler for SubnetPropertiesFormat. +func (spf SubnetPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spf.AddressPrefix != nil { + objectMap["addressPrefix"] = spf.AddressPrefix + } + if spf.AddressPrefixes != nil { + objectMap["addressPrefixes"] = spf.AddressPrefixes + } + if spf.NetworkSecurityGroup != nil { + objectMap["networkSecurityGroup"] = spf.NetworkSecurityGroup + } + if spf.RouteTable != nil { + objectMap["routeTable"] = spf.RouteTable + } + if spf.NatGateway != nil { + objectMap["natGateway"] = spf.NatGateway + } + if spf.ServiceEndpoints != nil { + objectMap["serviceEndpoints"] = spf.ServiceEndpoints + } + if spf.ServiceEndpointPolicies != nil { + objectMap["serviceEndpointPolicies"] = spf.ServiceEndpointPolicies + } + if spf.ResourceNavigationLinks != nil { + objectMap["resourceNavigationLinks"] = spf.ResourceNavigationLinks + } + if spf.ServiceAssociationLinks != nil { + objectMap["serviceAssociationLinks"] = spf.ServiceAssociationLinks + } + if spf.Delegations != nil { + objectMap["delegations"] = spf.Delegations + } + if spf.ProvisioningState != nil { + objectMap["provisioningState"] = spf.ProvisioningState + } + if spf.PrivateEndpointNetworkPolicies != nil { + objectMap["privateEndpointNetworkPolicies"] = spf.PrivateEndpointNetworkPolicies + } + if spf.PrivateLinkServiceNetworkPolicies != nil { + objectMap["privateLinkServiceNetworkPolicies"] = spf.PrivateLinkServiceNetworkPolicies + } + return json.Marshal(objectMap) +} + // SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SubnetsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubnetsClient) (Subnet, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubnetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SubnetsCreateOrUpdateFuture) Result(client SubnetsClient) (s Subnet, err error) { +// result is the default implementation for SubnetsCreateOrUpdateFuture.Result. +func (future *SubnetsCreateOrUpdateFuture) result(client SubnetsClient) (s Subnet, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -28173,12 +29883,25 @@ func (future *SubnetsCreateOrUpdateFuture) Result(client SubnetsClient) (s Subne // SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SubnetsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubnetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubnetsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SubnetsDeleteFuture) Result(client SubnetsClient) (ar autorest.Response, err error) { +// result is the default implementation for SubnetsDeleteFuture.Result. +func (future *SubnetsDeleteFuture) result(client SubnetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -28196,12 +29919,25 @@ func (future *SubnetsDeleteFuture) Result(client SubnetsClient) (ar autorest.Res // SubnetsPrepareNetworkPoliciesFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type SubnetsPrepareNetworkPoliciesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubnetsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SubnetsPrepareNetworkPoliciesFuture) Result(client SubnetsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubnetsPrepareNetworkPoliciesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SubnetsPrepareNetworkPoliciesFuture.Result. +func (future *SubnetsPrepareNetworkPoliciesFuture) result(client SubnetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -28219,12 +29955,25 @@ func (future *SubnetsPrepareNetworkPoliciesFuture) Result(client SubnetsClient) // SubnetsUnprepareNetworkPoliciesFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type SubnetsUnprepareNetworkPoliciesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubnetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubnetsUnprepareNetworkPoliciesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *SubnetsUnprepareNetworkPoliciesFuture) Result(client SubnetsClient) (ar autorest.Response, err error) { +// result is the default implementation for SubnetsUnprepareNetworkPoliciesFuture.Result. +func (future *SubnetsUnprepareNetworkPoliciesFuture) result(client SubnetsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -28273,6 +30022,15 @@ type Topology struct { Resources *[]TopologyResource `json:"resources,omitempty"` } +// MarshalJSON is the custom marshaler for Topology. +func (t Topology) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.Resources != nil { + objectMap["resources"] = t.Resources + } + return json.Marshal(objectMap) +} + // TopologyAssociation resources that have an association with the parent resource. type TopologyAssociation struct { // Name - The name of the resource that is associated with the parent resource. @@ -28459,6 +30217,24 @@ type Usage struct { Name *UsageName `json:"name,omitempty"` } +// MarshalJSON is the custom marshaler for Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.Unit != nil { + objectMap["unit"] = u.Unit + } + if u.CurrentValue != nil { + objectMap["currentValue"] = u.CurrentValue + } + if u.Limit != nil { + objectMap["limit"] = u.Limit + } + if u.Name != nil { + objectMap["name"] = u.Name + } + return json.Marshal(objectMap) +} + // UsageName the usage names. type UsageName struct { // Value - A string describing the resource name. @@ -28544,10 +30320,15 @@ func (ulr UsagesListResult) IsEmpty() bool { return ulr.Value == nil || len(*ulr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ulr UsagesListResult) hasNextLink() bool { + return ulr.NextLink != nil && len(*ulr.NextLink) != 0 +} + // usagesListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ulr UsagesListResult) usagesListResultPreparer(ctx context.Context) (*http.Request, error) { - if ulr.NextLink == nil || len(to.String(ulr.NextLink)) < 1 { + if !ulr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -28575,11 +30356,16 @@ func (page *UsagesListResultPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ulr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ulr) + if err != nil { + return err + } + page.ulr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ulr = next return nil } @@ -28609,8 +30395,11 @@ func (page UsagesListResultPage) Values() []Usage { } // Creates a new instance of the UsagesListResultPage type. -func NewUsagesListResultPage(getNextPage func(context.Context, UsagesListResult) (UsagesListResult, error)) UsagesListResultPage { - return UsagesListResultPage{fn: getNextPage} +func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Context, UsagesListResult) (UsagesListResult, error)) UsagesListResultPage { + return UsagesListResultPage{ + fn: getNextPage, + ulr: cur, + } } // VerificationIPFlowParameters parameters that define the IP flow to be verified. @@ -28800,12 +30589,25 @@ type VirtualHubRouteTable struct { // VirtualHubsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualHubsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualHubsClient) (VirtualHub, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualHubsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualHubsCreateOrUpdateFuture) Result(client VirtualHubsClient) (vh VirtualHub, err error) { +// result is the default implementation for VirtualHubsCreateOrUpdateFuture.Result. +func (future *VirtualHubsCreateOrUpdateFuture) result(client VirtualHubsClient) (vh VirtualHub, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -28829,12 +30631,25 @@ func (future *VirtualHubsCreateOrUpdateFuture) Result(client VirtualHubsClient) // VirtualHubsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualHubsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualHubsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualHubsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualHubsDeleteFuture) Result(client VirtualHubsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualHubsDeleteFuture.Result. +func (future *VirtualHubsDeleteFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -28852,12 +30667,25 @@ func (future *VirtualHubsDeleteFuture) Result(client VirtualHubsClient) (ar auto // VirtualHubsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualHubsUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualHubsClient) (VirtualHub, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualHubsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualHubsUpdateTagsFuture) Result(client VirtualHubsClient) (vh VirtualHub, err error) { +// result is the default implementation for VirtualHubsUpdateTagsFuture.Result. +func (future *VirtualHubsUpdateTagsFuture) result(client VirtualHubsClient) (vh VirtualHub, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -29398,6 +31226,54 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntityPropertiesFormat. +func (vngclepf VirtualNetworkGatewayConnectionListEntityPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngclepf.AuthorizationKey != nil { + objectMap["authorizationKey"] = vngclepf.AuthorizationKey + } + if vngclepf.VirtualNetworkGateway1 != nil { + objectMap["virtualNetworkGateway1"] = vngclepf.VirtualNetworkGateway1 + } + if vngclepf.VirtualNetworkGateway2 != nil { + objectMap["virtualNetworkGateway2"] = vngclepf.VirtualNetworkGateway2 + } + if vngclepf.LocalNetworkGateway2 != nil { + objectMap["localNetworkGateway2"] = vngclepf.LocalNetworkGateway2 + } + if vngclepf.ConnectionType != "" { + objectMap["connectionType"] = vngclepf.ConnectionType + } + if vngclepf.ConnectionProtocol != "" { + objectMap["connectionProtocol"] = vngclepf.ConnectionProtocol + } + if vngclepf.RoutingWeight != nil { + objectMap["routingWeight"] = vngclepf.RoutingWeight + } + if vngclepf.SharedKey != nil { + objectMap["sharedKey"] = vngclepf.SharedKey + } + if vngclepf.Peer != nil { + objectMap["peer"] = vngclepf.Peer + } + if vngclepf.EnableBgp != nil { + objectMap["enableBgp"] = vngclepf.EnableBgp + } + if vngclepf.UsePolicyBasedTrafficSelectors != nil { + objectMap["usePolicyBasedTrafficSelectors"] = vngclepf.UsePolicyBasedTrafficSelectors + } + if vngclepf.IpsecPolicies != nil { + objectMap["ipsecPolicies"] = vngclepf.IpsecPolicies + } + if vngclepf.ResourceGUID != nil { + objectMap["resourceGuid"] = vngclepf.ResourceGUID + } + if vngclepf.ExpressRouteGatewayBypass != nil { + objectMap["expressRouteGatewayBypass"] = vngclepf.ExpressRouteGatewayBypass + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayConnectionListResult response for the ListVirtualNetworkGatewayConnections API // service call. type VirtualNetworkGatewayConnectionListResult struct { @@ -29408,6 +31284,15 @@ type VirtualNetworkGatewayConnectionListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListResult. +func (vngclr VirtualNetworkGatewayConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngclr.Value != nil { + objectMap["value"] = vngclr.Value + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayConnectionListResultIterator provides access to a complete listing of // VirtualNetworkGatewayConnection values. type VirtualNetworkGatewayConnectionListResultIterator struct { @@ -29477,10 +31362,15 @@ func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool { return vngclr.Value == nil || len(*vngclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vngclr VirtualNetworkGatewayConnectionListResult) hasNextLink() bool { + return vngclr.NextLink != nil && len(*vngclr.NextLink) != 0 +} + // virtualNetworkGatewayConnectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if vngclr.NextLink == nil || len(to.String(vngclr.NextLink)) < 1 { + if !vngclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -29508,11 +31398,16 @@ func (page *VirtualNetworkGatewayConnectionListResultPage) NextWithContext(ctx c tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vngclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vngclr) + if err != nil { + return err + } + page.vngclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vngclr = next return nil } @@ -29542,8 +31437,11 @@ func (page VirtualNetworkGatewayConnectionListResultPage) Values() []VirtualNetw } // Creates a new instance of the VirtualNetworkGatewayConnectionListResultPage type. -func NewVirtualNetworkGatewayConnectionListResultPage(getNextPage func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)) VirtualNetworkGatewayConnectionListResultPage { - return VirtualNetworkGatewayConnectionListResultPage{fn: getNextPage} +func NewVirtualNetworkGatewayConnectionListResultPage(cur VirtualNetworkGatewayConnectionListResult, getNextPage func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)) VirtualNetworkGatewayConnectionListResultPage { + return VirtualNetworkGatewayConnectionListResultPage{ + fn: getNextPage, + vngclr: cur, + } } // VirtualNetworkGatewayConnectionPropertiesFormat virtualNetworkGatewayConnection properties. @@ -29588,15 +31486,76 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionPropertiesFormat. +func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngcpf.AuthorizationKey != nil { + objectMap["authorizationKey"] = vngcpf.AuthorizationKey + } + if vngcpf.VirtualNetworkGateway1 != nil { + objectMap["virtualNetworkGateway1"] = vngcpf.VirtualNetworkGateway1 + } + if vngcpf.VirtualNetworkGateway2 != nil { + objectMap["virtualNetworkGateway2"] = vngcpf.VirtualNetworkGateway2 + } + if vngcpf.LocalNetworkGateway2 != nil { + objectMap["localNetworkGateway2"] = vngcpf.LocalNetworkGateway2 + } + if vngcpf.ConnectionType != "" { + objectMap["connectionType"] = vngcpf.ConnectionType + } + if vngcpf.ConnectionProtocol != "" { + objectMap["connectionProtocol"] = vngcpf.ConnectionProtocol + } + if vngcpf.RoutingWeight != nil { + objectMap["routingWeight"] = vngcpf.RoutingWeight + } + if vngcpf.SharedKey != nil { + objectMap["sharedKey"] = vngcpf.SharedKey + } + if vngcpf.Peer != nil { + objectMap["peer"] = vngcpf.Peer + } + if vngcpf.EnableBgp != nil { + objectMap["enableBgp"] = vngcpf.EnableBgp + } + if vngcpf.UsePolicyBasedTrafficSelectors != nil { + objectMap["usePolicyBasedTrafficSelectors"] = vngcpf.UsePolicyBasedTrafficSelectors + } + if vngcpf.IpsecPolicies != nil { + objectMap["ipsecPolicies"] = vngcpf.IpsecPolicies + } + if vngcpf.ResourceGUID != nil { + objectMap["resourceGuid"] = vngcpf.ResourceGUID + } + if vngcpf.ExpressRouteGatewayBypass != nil { + objectMap["expressRouteGatewayBypass"] = vngcpf.ExpressRouteGatewayBypass + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) Result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { +// result is the default implementation for VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.Result. +func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -29620,12 +31579,25 @@ func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) Result(clien // VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type VirtualNetworkGatewayConnectionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewayConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewayConnectionsDeleteFuture) Result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualNetworkGatewayConnectionsDeleteFuture.Result. +func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -29643,12 +31615,25 @@ func (future *VirtualNetworkGatewayConnectionsDeleteFuture) Result(client Virtua // VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionResetSharedKey, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) Result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) { +// result is the default implementation for VirtualNetworkGatewayConnectionsResetSharedKeyFuture.Result. +func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -29672,12 +31657,25 @@ func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) Result(clien // VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionSharedKey, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) Result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) { +// result is the default implementation for VirtualNetworkGatewayConnectionsSetSharedKeyFuture.Result. +func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -29701,12 +31699,25 @@ func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) Result(client // VirtualNetworkGatewayConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewayConnectionsUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) Result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { +// result is the default implementation for VirtualNetworkGatewayConnectionsUpdateTagsFuture.Result. +func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -29820,6 +31831,21 @@ type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfigurationPropertiesFormat. +func (vngicpf VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngicpf.PrivateIPAllocationMethod != "" { + objectMap["privateIPAllocationMethod"] = vngicpf.PrivateIPAllocationMethod + } + if vngicpf.Subnet != nil { + objectMap["subnet"] = vngicpf.Subnet + } + if vngicpf.PublicIPAddress != nil { + objectMap["publicIPAddress"] = vngicpf.PublicIPAddress + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayListConnectionsResult response for the VirtualNetworkGatewayListConnections API // service call. type VirtualNetworkGatewayListConnectionsResult struct { @@ -29830,6 +31856,15 @@ type VirtualNetworkGatewayListConnectionsResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListConnectionsResult. +func (vnglcr VirtualNetworkGatewayListConnectionsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnglcr.Value != nil { + objectMap["value"] = vnglcr.Value + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayListConnectionsResultIterator provides access to a complete listing of // VirtualNetworkGatewayConnectionListEntity values. type VirtualNetworkGatewayListConnectionsResultIterator struct { @@ -29899,10 +31934,15 @@ func (vnglcr VirtualNetworkGatewayListConnectionsResult) IsEmpty() bool { return vnglcr.Value == nil || len(*vnglcr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnglcr VirtualNetworkGatewayListConnectionsResult) hasNextLink() bool { + return vnglcr.NextLink != nil && len(*vnglcr.NextLink) != 0 +} + // virtualNetworkGatewayListConnectionsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnglcr VirtualNetworkGatewayListConnectionsResult) virtualNetworkGatewayListConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if vnglcr.NextLink == nil || len(to.String(vnglcr.NextLink)) < 1 { + if !vnglcr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -29931,11 +31971,16 @@ func (page *VirtualNetworkGatewayListConnectionsResultPage) NextWithContext(ctx tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnglcr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnglcr) + if err != nil { + return err + } + page.vnglcr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnglcr = next return nil } @@ -29965,8 +32010,11 @@ func (page VirtualNetworkGatewayListConnectionsResultPage) Values() []VirtualNet } // Creates a new instance of the VirtualNetworkGatewayListConnectionsResultPage type. -func NewVirtualNetworkGatewayListConnectionsResultPage(getNextPage func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error)) VirtualNetworkGatewayListConnectionsResultPage { - return VirtualNetworkGatewayListConnectionsResultPage{fn: getNextPage} +func NewVirtualNetworkGatewayListConnectionsResultPage(cur VirtualNetworkGatewayListConnectionsResult, getNextPage func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error)) VirtualNetworkGatewayListConnectionsResultPage { + return VirtualNetworkGatewayListConnectionsResultPage{ + fn: getNextPage, + vnglcr: cur, + } } // VirtualNetworkGatewayListResult response for the ListVirtualNetworkGateways API service call. @@ -29978,6 +32026,15 @@ type VirtualNetworkGatewayListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListResult. +func (vnglr VirtualNetworkGatewayListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnglr.Value != nil { + objectMap["value"] = vnglr.Value + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayListResultIterator provides access to a complete listing of VirtualNetworkGateway // values. type VirtualNetworkGatewayListResultIterator struct { @@ -30047,10 +32104,15 @@ func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool { return vnglr.Value == nil || len(*vnglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnglr VirtualNetworkGatewayListResult) hasNextLink() bool { + return vnglr.NextLink != nil && len(*vnglr.NextLink) != 0 +} + // virtualNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if vnglr.NextLink == nil || len(to.String(vnglr.NextLink)) < 1 { + if !vnglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -30078,11 +32140,16 @@ func (page *VirtualNetworkGatewayListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnglr) + if err != nil { + return err + } + page.vnglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnglr = next return nil } @@ -30112,8 +32179,11 @@ func (page VirtualNetworkGatewayListResultPage) Values() []VirtualNetworkGateway } // Creates a new instance of the VirtualNetworkGatewayListResultPage type. -func NewVirtualNetworkGatewayListResultPage(getNextPage func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)) VirtualNetworkGatewayListResultPage { - return VirtualNetworkGatewayListResultPage{fn: getNextPage} +func NewVirtualNetworkGatewayListResultPage(cur VirtualNetworkGatewayListResult, getNextPage func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)) VirtualNetworkGatewayListResultPage { + return VirtualNetworkGatewayListResultPage{ + fn: getNextPage, + vnglr: cur, + } } // VirtualNetworkGatewayPropertiesFormat virtualNetworkGateway properties. @@ -30144,15 +32214,67 @@ type VirtualNetworkGatewayPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPropertiesFormat. +func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngpf.IPConfigurations != nil { + objectMap["ipConfigurations"] = vngpf.IPConfigurations + } + if vngpf.GatewayType != "" { + objectMap["gatewayType"] = vngpf.GatewayType + } + if vngpf.VpnType != "" { + objectMap["vpnType"] = vngpf.VpnType + } + if vngpf.EnableBgp != nil { + objectMap["enableBgp"] = vngpf.EnableBgp + } + if vngpf.ActiveActive != nil { + objectMap["activeActive"] = vngpf.ActiveActive + } + if vngpf.GatewayDefaultSite != nil { + objectMap["gatewayDefaultSite"] = vngpf.GatewayDefaultSite + } + if vngpf.Sku != nil { + objectMap["sku"] = vngpf.Sku + } + if vngpf.VpnClientConfiguration != nil { + objectMap["vpnClientConfiguration"] = vngpf.VpnClientConfiguration + } + if vngpf.BgpSettings != nil { + objectMap["bgpSettings"] = vngpf.BgpSettings + } + if vngpf.CustomRoutes != nil { + objectMap["customRoutes"] = vngpf.CustomRoutes + } + if vngpf.ResourceGUID != nil { + objectMap["resourceGuid"] = vngpf.ResourceGUID + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkGatewaysCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) Result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualNetworkGatewaysCreateOrUpdateFuture.Result. +func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30176,12 +32298,25 @@ func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) Result(client VirtualN // VirtualNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkGatewaysDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysDeleteFuture) Result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualNetworkGatewaysDeleteFuture.Result. +func (future *VirtualNetworkGatewaysDeleteFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30199,12 +32334,25 @@ func (future *VirtualNetworkGatewaysDeleteFuture) Result(client VirtualNetworkGa // VirtualNetworkGatewaysGeneratevpnclientpackageFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewaysGeneratevpnclientpackageFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (String, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) Result(client VirtualNetworkGatewaysClient) (s String, err error) { +// result is the default implementation for VirtualNetworkGatewaysGeneratevpnclientpackageFuture.Result. +func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30228,12 +32376,25 @@ func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) Result(clien // VirtualNetworkGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type VirtualNetworkGatewaysGenerateVpnProfileFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (String, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) Result(client VirtualNetworkGatewaysClient) (s String, err error) { +// result is the default implementation for VirtualNetworkGatewaysGenerateVpnProfileFuture.Result. +func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30257,12 +32418,25 @@ func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) Result(client Virt // VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) Result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { +// result is the default implementation for VirtualNetworkGatewaysGetAdvertisedRoutesFuture.Result. +func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30286,12 +32460,25 @@ func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) Result(client Vir // VirtualNetworkGatewaysGetBgpPeerStatusFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (BgpPeerStatusListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) Result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) { +// result is the default implementation for VirtualNetworkGatewaysGetBgpPeerStatusFuture.Result. +func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30315,12 +32502,25 @@ func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) Result(client Virtua // VirtualNetworkGatewaysGetLearnedRoutesFuture an abstraction for monitoring and retrieving the results of // a long-running operation. type VirtualNetworkGatewaysGetLearnedRoutesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) Result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { +// result is the default implementation for VirtualNetworkGatewaysGetLearnedRoutesFuture.Result. +func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30344,12 +32544,25 @@ func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) Result(client Virtua // VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture an abstraction for monitoring and retrieving // the results of a long-running operation. type VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (VpnClientConnectionHealthDetailListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) Result(client VirtualNetworkGatewaysClient) (vcchdlr VpnClientConnectionHealthDetailListResult, err error) { +// result is the default implementation for VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture.Result. +func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) result(client VirtualNetworkGatewaysClient) (vcchdlr VpnClientConnectionHealthDetailListResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30373,12 +32586,25 @@ func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) Result(c // VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) Result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture.Result. +func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30402,12 +32628,25 @@ func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) Result(cl // VirtualNetworkGatewaysGetVpnProfilePackageURLFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewaysGetVpnProfilePackageURLFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (String, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) Result(client VirtualNetworkGatewaysClient) (s String, err error) { +// result is the default implementation for VirtualNetworkGatewaysGetVpnProfilePackageURLFuture.Result. +func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30441,12 +32680,25 @@ type VirtualNetworkGatewaySku struct { // VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkGatewaysResetFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysResetFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysResetFuture) Result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { +// result is the default implementation for VirtualNetworkGatewaysResetFuture.Result. +func (future *VirtualNetworkGatewaysResetFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30470,12 +32722,25 @@ func (future *VirtualNetworkGatewaysResetFuture) Result(client VirtualNetworkGat // VirtualNetworkGatewaysResetVpnClientSharedKeyFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewaysResetVpnClientSharedKeyFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) Result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualNetworkGatewaysResetVpnClientSharedKeyFuture.Result. +func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30493,12 +32758,25 @@ func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) Result(client // VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) Result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { +// result is the default implementation for VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture.Result. +func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30522,12 +32800,25 @@ func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) Result(cl // VirtualNetworkGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkGatewaysUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkGatewaysUpdateTagsFuture) Result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { +// result is the default implementation for VirtualNetworkGatewaysUpdateTagsFuture.Result. +func (future *VirtualNetworkGatewaysUpdateTagsFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -30625,10 +32916,15 @@ func (vnlr VirtualNetworkListResult) IsEmpty() bool { return vnlr.Value == nil || len(*vnlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnlr VirtualNetworkListResult) hasNextLink() bool { + return vnlr.NextLink != nil && len(*vnlr.NextLink) != 0 +} + // virtualNetworkListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer(ctx context.Context) (*http.Request, error) { - if vnlr.NextLink == nil || len(to.String(vnlr.NextLink)) < 1 { + if !vnlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -30656,11 +32952,16 @@ func (page *VirtualNetworkListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnlr) + if err != nil { + return err + } + page.vnlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnlr = next return nil } @@ -30690,8 +32991,11 @@ func (page VirtualNetworkListResultPage) Values() []VirtualNetwork { } // Creates a new instance of the VirtualNetworkListResultPage type. -func NewVirtualNetworkListResultPage(getNextPage func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)) VirtualNetworkListResultPage { - return VirtualNetworkListResultPage{fn: getNextPage} +func NewVirtualNetworkListResultPage(cur VirtualNetworkListResult, getNextPage func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)) VirtualNetworkListResultPage { + return VirtualNetworkListResultPage{ + fn: getNextPage, + vnlr: cur, + } } // VirtualNetworkListUsageResult response for the virtual networks GetUsage API service call. @@ -30703,6 +33007,15 @@ type VirtualNetworkListUsageResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkListUsageResult. +func (vnlur VirtualNetworkListUsageResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnlur.NextLink != nil { + objectMap["nextLink"] = vnlur.NextLink + } + return json.Marshal(objectMap) +} + // VirtualNetworkListUsageResultIterator provides access to a complete listing of VirtualNetworkUsage // values. type VirtualNetworkListUsageResultIterator struct { @@ -30772,10 +33085,15 @@ func (vnlur VirtualNetworkListUsageResult) IsEmpty() bool { return vnlur.Value == nil || len(*vnlur.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnlur VirtualNetworkListUsageResult) hasNextLink() bool { + return vnlur.NextLink != nil && len(*vnlur.NextLink) != 0 +} + // virtualNetworkListUsageResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnlur VirtualNetworkListUsageResult) virtualNetworkListUsageResultPreparer(ctx context.Context) (*http.Request, error) { - if vnlur.NextLink == nil || len(to.String(vnlur.NextLink)) < 1 { + if !vnlur.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -30803,11 +33121,16 @@ func (page *VirtualNetworkListUsageResultPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnlur) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnlur) + if err != nil { + return err + } + page.vnlur = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnlur = next return nil } @@ -30837,8 +33160,11 @@ func (page VirtualNetworkListUsageResultPage) Values() []VirtualNetworkUsage { } // Creates a new instance of the VirtualNetworkListUsageResultPage type. -func NewVirtualNetworkListUsageResultPage(getNextPage func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error)) VirtualNetworkListUsageResultPage { - return VirtualNetworkListUsageResultPage{fn: getNextPage} +func NewVirtualNetworkListUsageResultPage(cur VirtualNetworkListUsageResult, getNextPage func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error)) VirtualNetworkListUsageResultPage { + return VirtualNetworkListUsageResultPage{ + fn: getNextPage, + vnlur: cur, + } } // VirtualNetworkPeering peerings in a virtual network resource. @@ -31002,10 +33328,15 @@ func (vnplr VirtualNetworkPeeringListResult) IsEmpty() bool { return vnplr.Value == nil || len(*vnplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnplr VirtualNetworkPeeringListResult) hasNextLink() bool { + return vnplr.NextLink != nil && len(*vnplr.NextLink) != 0 +} + // virtualNetworkPeeringListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnplr VirtualNetworkPeeringListResult) virtualNetworkPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if vnplr.NextLink == nil || len(to.String(vnplr.NextLink)) < 1 { + if !vnplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -31033,11 +33364,16 @@ func (page *VirtualNetworkPeeringListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnplr) + if err != nil { + return err + } + page.vnplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnplr = next return nil } @@ -31067,8 +33403,11 @@ func (page VirtualNetworkPeeringListResultPage) Values() []VirtualNetworkPeering } // Creates a new instance of the VirtualNetworkPeeringListResultPage type. -func NewVirtualNetworkPeeringListResultPage(getNextPage func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)) VirtualNetworkPeeringListResultPage { - return VirtualNetworkPeeringListResultPage{fn: getNextPage} +func NewVirtualNetworkPeeringListResultPage(cur VirtualNetworkPeeringListResult, getNextPage func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)) VirtualNetworkPeeringListResultPage { + return VirtualNetworkPeeringListResultPage{ + fn: getNextPage, + vnplr: cur, + } } // VirtualNetworkPeeringPropertiesFormat properties of the virtual network peering. @@ -31094,12 +33433,25 @@ type VirtualNetworkPeeringPropertiesFormat struct { // VirtualNetworkPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkPeeringsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkPeeringsClient) (VirtualNetworkPeering, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) Result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) { +// result is the default implementation for VirtualNetworkPeeringsCreateOrUpdateFuture.Result. +func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31123,12 +33475,25 @@ func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) Result(client VirtualN // VirtualNetworkPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkPeeringsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkPeeringsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkPeeringsDeleteFuture) Result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualNetworkPeeringsDeleteFuture.Result. +func (future *VirtualNetworkPeeringsDeleteFuture) result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31168,12 +33533,25 @@ type VirtualNetworkPropertiesFormat struct { // VirtualNetworksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworksCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworksClient) (VirtualNetwork, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworksCreateOrUpdateFuture) Result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { +// result is the default implementation for VirtualNetworksCreateOrUpdateFuture.Result. +func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31197,12 +33575,25 @@ func (future *VirtualNetworksCreateOrUpdateFuture) Result(client VirtualNetworks // VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualNetworksDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworksClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworksDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworksDeleteFuture) Result(client VirtualNetworksClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualNetworksDeleteFuture.Result. +func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31220,12 +33611,25 @@ func (future *VirtualNetworksDeleteFuture) Result(client VirtualNetworksClient) // VirtualNetworksUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworksUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworksClient) (VirtualNetwork, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworksUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworksUpdateTagsFuture) Result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { +// result is the default implementation for VirtualNetworksUpdateTagsFuture.Result. +func (future *VirtualNetworksUpdateTagsFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31441,10 +33845,15 @@ func (vntlr VirtualNetworkTapListResult) IsEmpty() bool { return vntlr.Value == nil || len(*vntlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vntlr VirtualNetworkTapListResult) hasNextLink() bool { + return vntlr.NextLink != nil && len(*vntlr.NextLink) != 0 +} + // virtualNetworkTapListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vntlr VirtualNetworkTapListResult) virtualNetworkTapListResultPreparer(ctx context.Context) (*http.Request, error) { - if vntlr.NextLink == nil || len(to.String(vntlr.NextLink)) < 1 { + if !vntlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -31472,11 +33881,16 @@ func (page *VirtualNetworkTapListResultPage) NextWithContext(ctx context.Context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vntlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vntlr) + if err != nil { + return err + } + page.vntlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vntlr = next return nil } @@ -31506,8 +33920,11 @@ func (page VirtualNetworkTapListResultPage) Values() []VirtualNetworkTap { } // Creates a new instance of the VirtualNetworkTapListResultPage type. -func NewVirtualNetworkTapListResultPage(getNextPage func(context.Context, VirtualNetworkTapListResult) (VirtualNetworkTapListResult, error)) VirtualNetworkTapListResultPage { - return VirtualNetworkTapListResultPage{fn: getNextPage} +func NewVirtualNetworkTapListResultPage(cur VirtualNetworkTapListResult, getNextPage func(context.Context, VirtualNetworkTapListResult) (VirtualNetworkTapListResult, error)) VirtualNetworkTapListResultPage { + return VirtualNetworkTapListResultPage{ + fn: getNextPage, + vntlr: cur, + } } // VirtualNetworkTapPropertiesFormat virtual Network Tap properties. @@ -31526,15 +33943,43 @@ type VirtualNetworkTapPropertiesFormat struct { DestinationPort *int32 `json:"destinationPort,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkTapPropertiesFormat. +func (vntpf VirtualNetworkTapPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vntpf.DestinationNetworkInterfaceIPConfiguration != nil { + objectMap["destinationNetworkInterfaceIPConfiguration"] = vntpf.DestinationNetworkInterfaceIPConfiguration + } + if vntpf.DestinationLoadBalancerFrontEndIPConfiguration != nil { + objectMap["destinationLoadBalancerFrontEndIPConfiguration"] = vntpf.DestinationLoadBalancerFrontEndIPConfiguration + } + if vntpf.DestinationPort != nil { + objectMap["destinationPort"] = vntpf.DestinationPort + } + return json.Marshal(objectMap) +} + // VirtualNetworkTapsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkTapsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkTapsClient) (VirtualNetworkTap, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkTapsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkTapsCreateOrUpdateFuture) Result(client VirtualNetworkTapsClient) (vnt VirtualNetworkTap, err error) { +// result is the default implementation for VirtualNetworkTapsCreateOrUpdateFuture.Result. +func (future *VirtualNetworkTapsCreateOrUpdateFuture) result(client VirtualNetworkTapsClient) (vnt VirtualNetworkTap, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31558,12 +34003,25 @@ func (future *VirtualNetworkTapsCreateOrUpdateFuture) Result(client VirtualNetwo // VirtualNetworkTapsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkTapsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkTapsClient) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkTapsDeleteFuture) Result(client VirtualNetworkTapsClient) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkTapsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualNetworkTapsDeleteFuture.Result. +func (future *VirtualNetworkTapsDeleteFuture) result(client VirtualNetworkTapsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31581,12 +34039,25 @@ func (future *VirtualNetworkTapsDeleteFuture) Result(client VirtualNetworkTapsCl // VirtualNetworkTapsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkTapsUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkTapsClient) (VirtualNetworkTap, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkTapsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualNetworkTapsUpdateTagsFuture) Result(client VirtualNetworkTapsClient) (vnt VirtualNetworkTap, err error) { +// result is the default implementation for VirtualNetworkTapsUpdateTagsFuture.Result. +func (future *VirtualNetworkTapsUpdateTagsFuture) result(client VirtualNetworkTapsClient) (vnt VirtualNetworkTap, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31766,15 +34237,55 @@ type VirtualWanProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualWanProperties. +func (vwp VirtualWanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vwp.DisableVpnEncryption != nil { + objectMap["disableVpnEncryption"] = vwp.DisableVpnEncryption + } + if vwp.SecurityProviderName != nil { + objectMap["securityProviderName"] = vwp.SecurityProviderName + } + if vwp.AllowBranchToBranchTraffic != nil { + objectMap["allowBranchToBranchTraffic"] = vwp.AllowBranchToBranchTraffic + } + if vwp.AllowVnetToVnetTraffic != nil { + objectMap["allowVnetToVnetTraffic"] = vwp.AllowVnetToVnetTraffic + } + if vwp.Office365LocalBreakoutCategory != "" { + objectMap["office365LocalBreakoutCategory"] = vwp.Office365LocalBreakoutCategory + } + if vwp.P2SVpnServerConfigurations != nil { + objectMap["p2SVpnServerConfigurations"] = vwp.P2SVpnServerConfigurations + } + if vwp.ProvisioningState != "" { + objectMap["provisioningState"] = vwp.ProvisioningState + } + return json.Marshal(objectMap) +} + // VirtualWansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualWansCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualWansClient) (VirtualWAN, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualWansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualWansCreateOrUpdateFuture) Result(client VirtualWansClient) (vw VirtualWAN, err error) { +// result is the default implementation for VirtualWansCreateOrUpdateFuture.Result. +func (future *VirtualWansCreateOrUpdateFuture) result(client VirtualWansClient) (vw VirtualWAN, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31798,12 +34309,25 @@ func (future *VirtualWansCreateOrUpdateFuture) Result(client VirtualWansClient) // VirtualWansDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualWansDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualWansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualWansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualWansDeleteFuture) Result(client VirtualWansClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualWansDeleteFuture.Result. +func (future *VirtualWansDeleteFuture) result(client VirtualWansClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31838,12 +34362,25 @@ type VirtualWanSecurityProviders struct { // VirtualWansUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualWansUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualWansClient) (VirtualWAN, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualWansUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VirtualWansUpdateTagsFuture) Result(client VirtualWansClient) (vw VirtualWAN, err error) { +// result is the default implementation for VirtualWansUpdateTagsFuture.Result. +func (future *VirtualWansUpdateTagsFuture) result(client VirtualWansClient) (vw VirtualWAN, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -31900,6 +34437,18 @@ type VpnClientConnectionHealth struct { AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` } +// MarshalJSON is the custom marshaler for VpnClientConnectionHealth. +func (vcch VpnClientConnectionHealth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcch.VpnClientConnectionsCount != nil { + objectMap["vpnClientConnectionsCount"] = vcch.VpnClientConnectionsCount + } + if vcch.AllocatedIPAddresses != nil { + objectMap["allocatedIpAddresses"] = vcch.AllocatedIPAddresses + } + return json.Marshal(objectMap) +} + // VpnClientConnectionHealthDetail VPN client connection health detail. type VpnClientConnectionHealthDetail struct { // VpnConnectionID - READ-ONLY; The vpn client Id. @@ -32058,6 +34607,15 @@ type VpnClientRevokedCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VpnClientRevokedCertificatePropertiesFormat. +func (vcrcpf VpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcrcpf.Thumbprint != nil { + objectMap["thumbprint"] = vcrcpf.Thumbprint + } + return json.Marshal(objectMap) +} + // VpnClientRootCertificate VPN client root certificate of virtual network gateway. type VpnClientRootCertificate struct { // VpnClientRootCertificatePropertiesFormat - Properties of the vpn client root certificate. @@ -32147,6 +34705,15 @@ type VpnClientRootCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VpnClientRootCertificatePropertiesFormat. +func (vcrcpf VpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcrcpf.PublicCertData != nil { + objectMap["publicCertData"] = vcrcpf.PublicCertData + } + return json.Marshal(objectMap) +} + // VpnConnection vpnConnection Resource. type VpnConnection struct { autorest.Response `json:"-"` @@ -32262,15 +34829,76 @@ type VpnConnectionProperties struct { VpnLinkConnections *[]VpnSiteLinkConnection `json:"vpnLinkConnections,omitempty"` } +// MarshalJSON is the custom marshaler for VpnConnectionProperties. +func (vcp VpnConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcp.RemoteVpnSite != nil { + objectMap["remoteVpnSite"] = vcp.RemoteVpnSite + } + if vcp.RoutingWeight != nil { + objectMap["routingWeight"] = vcp.RoutingWeight + } + if vcp.ConnectionStatus != "" { + objectMap["connectionStatus"] = vcp.ConnectionStatus + } + if vcp.VpnConnectionProtocolType != "" { + objectMap["vpnConnectionProtocolType"] = vcp.VpnConnectionProtocolType + } + if vcp.ConnectionBandwidth != nil { + objectMap["connectionBandwidth"] = vcp.ConnectionBandwidth + } + if vcp.SharedKey != nil { + objectMap["sharedKey"] = vcp.SharedKey + } + if vcp.EnableBgp != nil { + objectMap["enableBgp"] = vcp.EnableBgp + } + if vcp.UsePolicyBasedTrafficSelectors != nil { + objectMap["usePolicyBasedTrafficSelectors"] = vcp.UsePolicyBasedTrafficSelectors + } + if vcp.IpsecPolicies != nil { + objectMap["ipsecPolicies"] = vcp.IpsecPolicies + } + if vcp.EnableRateLimiting != nil { + objectMap["enableRateLimiting"] = vcp.EnableRateLimiting + } + if vcp.EnableInternetSecurity != nil { + objectMap["enableInternetSecurity"] = vcp.EnableInternetSecurity + } + if vcp.UseLocalAzureIPAddress != nil { + objectMap["useLocalAzureIpAddress"] = vcp.UseLocalAzureIPAddress + } + if vcp.ProvisioningState != "" { + objectMap["provisioningState"] = vcp.ProvisioningState + } + if vcp.VpnLinkConnections != nil { + objectMap["vpnLinkConnections"] = vcp.VpnLinkConnections + } + return json.Marshal(objectMap) +} + // VpnConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VpnConnectionsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnConnectionsClient) (VpnConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnConnectionsCreateOrUpdateFuture) Result(client VpnConnectionsClient) (vc VpnConnection, err error) { +// result is the default implementation for VpnConnectionsCreateOrUpdateFuture.Result. +func (future *VpnConnectionsCreateOrUpdateFuture) result(client VpnConnectionsClient) (vc VpnConnection, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -32294,12 +34922,25 @@ func (future *VpnConnectionsCreateOrUpdateFuture) Result(client VpnConnectionsCl // VpnConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VpnConnectionsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnConnectionsDeleteFuture) Result(client VpnConnectionsClient) (ar autorest.Response, err error) { +// result is the default implementation for VpnConnectionsDeleteFuture.Result. +func (future *VpnConnectionsDeleteFuture) result(client VpnConnectionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -32456,12 +35097,25 @@ type VpnGatewayProperties struct { // VpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VpnGatewaysCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnGatewaysClient) (VpnGateway, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnGatewaysCreateOrUpdateFuture) Result(client VpnGatewaysClient) (vg VpnGateway, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VpnGatewaysCreateOrUpdateFuture.Result. +func (future *VpnGatewaysCreateOrUpdateFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -32485,12 +35139,25 @@ func (future *VpnGatewaysCreateOrUpdateFuture) Result(client VpnGatewaysClient) // VpnGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VpnGatewaysDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnGatewaysClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnGatewaysDeleteFuture) Result(client VpnGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for VpnGatewaysDeleteFuture.Result. +func (future *VpnGatewaysDeleteFuture) result(client VpnGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -32508,12 +35175,25 @@ func (future *VpnGatewaysDeleteFuture) Result(client VpnGatewaysClient) (ar auto // VpnGatewaysResetFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VpnGatewaysResetFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnGatewaysClient) (VpnGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnGatewaysResetFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnGatewaysResetFuture) Result(client VpnGatewaysClient) (vg VpnGateway, err error) { +// result is the default implementation for VpnGatewaysResetFuture.Result. +func (future *VpnGatewaysResetFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -32537,12 +35217,25 @@ func (future *VpnGatewaysResetFuture) Result(client VpnGatewaysClient) (vg VpnGa // VpnGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VpnGatewaysUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnGatewaysClient) (VpnGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnGatewaysUpdateTagsFuture) Result(client VpnGatewaysClient) (vg VpnGateway, err error) { +// result is the default implementation for VpnGatewaysUpdateTagsFuture.Result. +func (future *VpnGatewaysUpdateTagsFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -32919,6 +35612,48 @@ type VpnSiteLinkConnectionProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VpnSiteLinkConnectionProperties. +func (vslcp VpnSiteLinkConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vslcp.VpnSiteLink != nil { + objectMap["vpnSiteLink"] = vslcp.VpnSiteLink + } + if vslcp.RoutingWeight != nil { + objectMap["routingWeight"] = vslcp.RoutingWeight + } + if vslcp.ConnectionStatus != "" { + objectMap["connectionStatus"] = vslcp.ConnectionStatus + } + if vslcp.VpnConnectionProtocolType != "" { + objectMap["vpnConnectionProtocolType"] = vslcp.VpnConnectionProtocolType + } + if vslcp.ConnectionBandwidth != nil { + objectMap["connectionBandwidth"] = vslcp.ConnectionBandwidth + } + if vslcp.SharedKey != nil { + objectMap["sharedKey"] = vslcp.SharedKey + } + if vslcp.EnableBgp != nil { + objectMap["enableBgp"] = vslcp.EnableBgp + } + if vslcp.UsePolicyBasedTrafficSelectors != nil { + objectMap["usePolicyBasedTrafficSelectors"] = vslcp.UsePolicyBasedTrafficSelectors + } + if vslcp.IpsecPolicies != nil { + objectMap["ipsecPolicies"] = vslcp.IpsecPolicies + } + if vslcp.EnableRateLimiting != nil { + objectMap["enableRateLimiting"] = vslcp.EnableRateLimiting + } + if vslcp.UseLocalAzureIPAddress != nil { + objectMap["useLocalAzureIpAddress"] = vslcp.UseLocalAzureIPAddress + } + if vslcp.ProvisioningState != "" { + objectMap["provisioningState"] = vslcp.ProvisioningState + } + return json.Marshal(objectMap) +} + // VpnSiteLinkProperties parameters for VpnSite. type VpnSiteLinkProperties struct { // LinkProperties - The link provider properties. @@ -32956,12 +35691,25 @@ type VpnSiteProperties struct { // VpnSitesConfigurationDownloadFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VpnSitesConfigurationDownloadFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnSitesConfigurationClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnSitesConfigurationDownloadFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnSitesConfigurationDownloadFuture) Result(client VpnSitesConfigurationClient) (ar autorest.Response, err error) { +// result is the default implementation for VpnSitesConfigurationDownloadFuture.Result. +func (future *VpnSitesConfigurationDownloadFuture) result(client VpnSitesConfigurationClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -32979,12 +35727,25 @@ func (future *VpnSitesConfigurationDownloadFuture) Result(client VpnSitesConfigu // VpnSitesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VpnSitesCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnSitesClient) (VpnSite, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnSitesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnSitesCreateOrUpdateFuture) Result(client VpnSitesClient) (vs VpnSite, err error) { +// result is the default implementation for VpnSitesCreateOrUpdateFuture.Result. +func (future *VpnSitesCreateOrUpdateFuture) result(client VpnSitesClient) (vs VpnSite, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33008,12 +35769,25 @@ func (future *VpnSitesCreateOrUpdateFuture) Result(client VpnSitesClient) (vs Vp // VpnSitesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VpnSitesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnSitesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnSitesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnSitesDeleteFuture) Result(client VpnSitesClient) (ar autorest.Response, err error) { +// result is the default implementation for VpnSitesDeleteFuture.Result. +func (future *VpnSitesDeleteFuture) result(client VpnSitesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33031,12 +35805,25 @@ func (future *VpnSitesDeleteFuture) Result(client VpnSitesClient) (ar autorest.R // VpnSitesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VpnSitesUpdateTagsFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnSitesClient) (VpnSite, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnSitesUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *VpnSitesUpdateTagsFuture) Result(client VpnSitesClient) (vs VpnSite, err error) { +// result is the default implementation for VpnSitesUpdateTagsFuture.Result. +func (future *VpnSitesUpdateTagsFuture) result(client VpnSitesClient) (vs VpnSite, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33191,12 +35978,25 @@ type WatcherPropertiesFormat struct { // WatchersCheckConnectivityFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WatchersCheckConnectivityFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (ConnectivityInformation, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersCheckConnectivityFuture) Result(client WatchersClient) (ci ConnectivityInformation, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersCheckConnectivityFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WatchersCheckConnectivityFuture.Result. +func (future *WatchersCheckConnectivityFuture) result(client WatchersClient) (ci ConnectivityInformation, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33220,12 +36020,25 @@ func (future *WatchersCheckConnectivityFuture) Result(client WatchersClient) (ci // WatchersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type WatchersDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersDeleteFuture) Result(client WatchersClient) (ar autorest.Response, err error) { +// result is the default implementation for WatchersDeleteFuture.Result. +func (future *WatchersDeleteFuture) result(client WatchersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33243,12 +36056,25 @@ func (future *WatchersDeleteFuture) Result(client WatchersClient) (ar autorest.R // WatchersGetAzureReachabilityReportFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WatchersGetAzureReachabilityReportFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (AzureReachabilityReport, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersGetAzureReachabilityReportFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersGetAzureReachabilityReportFuture) Result(client WatchersClient) (arr AzureReachabilityReport, err error) { +// result is the default implementation for WatchersGetAzureReachabilityReportFuture.Result. +func (future *WatchersGetAzureReachabilityReportFuture) result(client WatchersClient) (arr AzureReachabilityReport, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33272,12 +36098,25 @@ func (future *WatchersGetAzureReachabilityReportFuture) Result(client WatchersCl // WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WatchersGetFlowLogStatusFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (FlowLogInformation, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersGetFlowLogStatusFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersGetFlowLogStatusFuture) Result(client WatchersClient) (fli FlowLogInformation, err error) { +// result is the default implementation for WatchersGetFlowLogStatusFuture.Result. +func (future *WatchersGetFlowLogStatusFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33301,12 +36140,25 @@ func (future *WatchersGetFlowLogStatusFuture) Result(client WatchersClient) (fli // WatchersGetNetworkConfigurationDiagnosticFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type WatchersGetNetworkConfigurationDiagnosticFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (ConfigurationDiagnosticResponse, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersGetNetworkConfigurationDiagnosticFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersGetNetworkConfigurationDiagnosticFuture) Result(client WatchersClient) (cdr ConfigurationDiagnosticResponse, err error) { +// result is the default implementation for WatchersGetNetworkConfigurationDiagnosticFuture.Result. +func (future *WatchersGetNetworkConfigurationDiagnosticFuture) result(client WatchersClient) (cdr ConfigurationDiagnosticResponse, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33330,12 +36182,25 @@ func (future *WatchersGetNetworkConfigurationDiagnosticFuture) Result(client Wat // WatchersGetNextHopFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type WatchersGetNextHopFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (NextHopResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersGetNextHopFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersGetNextHopFuture) Result(client WatchersClient) (nhr NextHopResult, err error) { +// result is the default implementation for WatchersGetNextHopFuture.Result. +func (future *WatchersGetNextHopFuture) result(client WatchersClient) (nhr NextHopResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33359,12 +36224,25 @@ func (future *WatchersGetNextHopFuture) Result(client WatchersClient) (nhr NextH // WatchersGetTroubleshootingFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WatchersGetTroubleshootingFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (TroubleshootingResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersGetTroubleshootingFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersGetTroubleshootingFuture) Result(client WatchersClient) (tr TroubleshootingResult, err error) { +// result is the default implementation for WatchersGetTroubleshootingFuture.Result. +func (future *WatchersGetTroubleshootingFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33388,12 +36266,25 @@ func (future *WatchersGetTroubleshootingFuture) Result(client WatchersClient) (t // WatchersGetTroubleshootingResultFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WatchersGetTroubleshootingResultFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (TroubleshootingResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersGetTroubleshootingResultFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersGetTroubleshootingResultFuture) Result(client WatchersClient) (tr TroubleshootingResult, err error) { +// result is the default implementation for WatchersGetTroubleshootingResultFuture.Result. +func (future *WatchersGetTroubleshootingResultFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33417,12 +36308,25 @@ func (future *WatchersGetTroubleshootingResultFuture) Result(client WatchersClie // WatchersGetVMSecurityRulesFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WatchersGetVMSecurityRulesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (SecurityGroupViewResult, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersGetVMSecurityRulesFuture) Result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersGetVMSecurityRulesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WatchersGetVMSecurityRulesFuture.Result. +func (future *WatchersGetVMSecurityRulesFuture) result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33446,12 +36350,25 @@ func (future *WatchersGetVMSecurityRulesFuture) Result(client WatchersClient) (s // WatchersListAvailableProvidersFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WatchersListAvailableProvidersFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (AvailableProvidersList, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersListAvailableProvidersFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersListAvailableProvidersFuture) Result(client WatchersClient) (apl AvailableProvidersList, err error) { +// result is the default implementation for WatchersListAvailableProvidersFuture.Result. +func (future *WatchersListAvailableProvidersFuture) result(client WatchersClient) (apl AvailableProvidersList, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33475,12 +36392,25 @@ func (future *WatchersListAvailableProvidersFuture) Result(client WatchersClient // WatchersSetFlowLogConfigurationFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WatchersSetFlowLogConfigurationFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (FlowLogInformation, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersSetFlowLogConfigurationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersSetFlowLogConfigurationFuture) Result(client WatchersClient) (fli FlowLogInformation, err error) { +// result is the default implementation for WatchersSetFlowLogConfigurationFuture.Result. +func (future *WatchersSetFlowLogConfigurationFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33504,12 +36434,25 @@ func (future *WatchersSetFlowLogConfigurationFuture) Result(client WatchersClien // WatchersVerifyIPFlowFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type WatchersVerifyIPFlowFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WatchersClient) (VerificationIPFlowResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WatchersVerifyIPFlowFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WatchersVerifyIPFlowFuture) Result(client WatchersClient) (vifr VerificationIPFlowResult, err error) { +// result is the default implementation for WatchersVerifyIPFlowFuture.Result. +func (future *WatchersVerifyIPFlowFuture) result(client WatchersClient) (vifr VerificationIPFlowResult, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33546,15 +36489,49 @@ type WebApplicationFirewallCustomRule struct { Action WebApplicationFirewallAction `json:"action,omitempty"` } +// MarshalJSON is the custom marshaler for WebApplicationFirewallCustomRule. +func (wafcr WebApplicationFirewallCustomRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wafcr.Name != nil { + objectMap["name"] = wafcr.Name + } + if wafcr.Priority != nil { + objectMap["priority"] = wafcr.Priority + } + if wafcr.RuleType != "" { + objectMap["ruleType"] = wafcr.RuleType + } + if wafcr.MatchConditions != nil { + objectMap["matchConditions"] = wafcr.MatchConditions + } + if wafcr.Action != "" { + objectMap["action"] = wafcr.Action + } + return json.Marshal(objectMap) +} + // WebApplicationFirewallPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WebApplicationFirewallPoliciesDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WebApplicationFirewallPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WebApplicationFirewallPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *WebApplicationFirewallPoliciesDeleteFuture) Result(client WebApplicationFirewallPoliciesClient) (ar autorest.Response, err error) { +// result is the default implementation for WebApplicationFirewallPoliciesDeleteFuture.Result. +func (future *WebApplicationFirewallPoliciesDeleteFuture) result(client WebApplicationFirewallPoliciesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -33766,10 +36743,15 @@ func (wafplr WebApplicationFirewallPolicyListResult) IsEmpty() bool { return wafplr.Value == nil || len(*wafplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (wafplr WebApplicationFirewallPolicyListResult) hasNextLink() bool { + return wafplr.NextLink != nil && len(*wafplr.NextLink) != 0 +} + // webApplicationFirewallPolicyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (wafplr WebApplicationFirewallPolicyListResult) webApplicationFirewallPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if wafplr.NextLink == nil || len(to.String(wafplr.NextLink)) < 1 { + if !wafplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -33797,11 +36779,16 @@ func (page *WebApplicationFirewallPolicyListResultPage) NextWithContext(ctx cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.wafplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.wafplr) + if err != nil { + return err + } + page.wafplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.wafplr = next return nil } @@ -33831,8 +36818,11 @@ func (page WebApplicationFirewallPolicyListResultPage) Values() []WebApplication } // Creates a new instance of the WebApplicationFirewallPolicyListResultPage type. -func NewWebApplicationFirewallPolicyListResultPage(getNextPage func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error)) WebApplicationFirewallPolicyListResultPage { - return WebApplicationFirewallPolicyListResultPage{fn: getNextPage} +func NewWebApplicationFirewallPolicyListResultPage(cur WebApplicationFirewallPolicyListResult, getNextPage func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error)) WebApplicationFirewallPolicyListResultPage { + return WebApplicationFirewallPolicyListResultPage{ + fn: getNextPage, + wafplr: cur, + } } // WebApplicationFirewallPolicyPropertiesFormat defines web application firewall policy properties. @@ -33848,3 +36838,15 @@ type WebApplicationFirewallPolicyPropertiesFormat struct { // ResourceState - READ-ONLY; Resource status of the policy. Possible values include: 'WebApplicationFirewallPolicyResourceStateCreating', 'WebApplicationFirewallPolicyResourceStateEnabling', 'WebApplicationFirewallPolicyResourceStateEnabled', 'WebApplicationFirewallPolicyResourceStateDisabling', 'WebApplicationFirewallPolicyResourceStateDisabled', 'WebApplicationFirewallPolicyResourceStateDeleting' ResourceState WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty"` } + +// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyPropertiesFormat. +func (wafppf WebApplicationFirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wafppf.PolicySettings != nil { + objectMap["policySettings"] = wafppf.PolicySettings + } + if wafppf.CustomRules != nil { + objectMap["customRules"] = wafppf.CustomRules + } + return json.Marshal(objectMap) +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/natgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/natgateways.go index aa99dbc4ccbf..77c91c5608bf 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/natgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/natgateways.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client NatGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client NatGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGrou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -103,7 +92,10 @@ func (client NatGatewaysClient) CreateOrUpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -112,7 +104,6 @@ func (client NatGatewaysClient) CreateOrUpdateSender(req *http.Request) (future func (client NatGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result NatGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -129,8 +120,8 @@ func (client NatGatewaysClient) Delete(ctx context.Context, resourceGroupName st ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -143,7 +134,7 @@ func (client NatGatewaysClient) Delete(ctx context.Context, resourceGroupName st result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Delete", nil, "Failure sending request") return } @@ -179,7 +170,10 @@ func (client NatGatewaysClient) DeleteSender(req *http.Request) (future NatGatew if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -188,7 +182,6 @@ func (client NatGatewaysClient) DeleteSender(req *http.Request) (future NatGatew func (client NatGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client NatGatewaysClient) Get(ctx context.Context, resourceGroupName strin result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Get", resp, "Failure responding to request") + return } return @@ -267,7 +261,6 @@ func (client NatGatewaysClient) GetSender(req *http.Request) (*http.Response, er func (client NatGatewaysClient) GetResponder(resp *http.Response) (result NatGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +299,11 @@ func (client NatGatewaysClient) List(ctx context.Context, resourceGroupName stri result.nglr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "List", resp, "Failure responding to request") + return + } + if result.nglr.hasNextLink() && result.nglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -342,7 +340,6 @@ func (client NatGatewaysClient) ListSender(req *http.Request) (*http.Response, e func (client NatGatewaysClient) ListResponder(resp *http.Response) (result NatGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +413,11 @@ func (client NatGatewaysClient) ListAll(ctx context.Context) (result NatGatewayL result.nglr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "ListAll", resp, "Failure responding to request") + return + } + if result.nglr.hasNextLink() && result.nglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -451,7 +453,6 @@ func (client NatGatewaysClient) ListAllSender(req *http.Request) (*http.Response func (client NatGatewaysClient) ListAllResponder(resp *http.Response) (result NatGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -528,6 +529,7 @@ func (client NatGatewaysClient) UpdateTags(ctx context.Context, resourceGroupNam result, err = client.UpdateTagsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "UpdateTags", resp, "Failure responding to request") + return } return @@ -567,7 +569,6 @@ func (client NatGatewaysClient) UpdateTagsSender(req *http.Request) (*http.Respo func (client NatGatewaysClient) UpdateTagsResponder(resp *http.Response) (result NatGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/operations.go index 760f8b77312e..859658a8827c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/operations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/operations.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -70,6 +59,11 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result.olr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -101,7 +95,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/p2svpngateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/p2svpngateways.go index 409be904d936..e2b08fed3490 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/p2svpngateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/p2svpngateways.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client P2sVpnGatewaysClient) CreateOrUpdate(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client P2sVpnGatewaysClient) CreateOrUpdate(ctx context.Context, resourceG result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client P2sVpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client P2sVpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (futu func (client P2sVpnGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result P2SVpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client P2sVpnGatewaysClient) Delete(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client P2sVpnGatewaysClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client P2sVpnGatewaysClient) DeleteSender(req *http.Request) (future P2sVp if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client P2sVpnGatewaysClient) DeleteSender(req *http.Request) (future P2sVp func (client P2sVpnGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -206,8 +199,8 @@ func (client P2sVpnGatewaysClient) GenerateVpnProfile(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.GenerateVpnProfile") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -220,7 +213,7 @@ func (client P2sVpnGatewaysClient) GenerateVpnProfile(ctx context.Context, resou result, err = client.GenerateVpnProfileSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GenerateVpnProfile", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GenerateVpnProfile", nil, "Failure sending request") return } @@ -258,7 +251,10 @@ func (client P2sVpnGatewaysClient) GenerateVpnProfileSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -267,7 +263,6 @@ func (client P2sVpnGatewaysClient) GenerateVpnProfileSender(req *http.Request) ( func (client P2sVpnGatewaysClient) GenerateVpnProfileResponder(resp *http.Response) (result VpnProfileResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +301,7 @@ func (client P2sVpnGatewaysClient) Get(ctx context.Context, resourceGroupName st result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Get", resp, "Failure responding to request") + return } return @@ -343,7 +339,6 @@ func (client P2sVpnGatewaysClient) GetSender(req *http.Request) (*http.Response, func (client P2sVpnGatewaysClient) GetResponder(resp *http.Response) (result P2SVpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -361,8 +356,8 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealth(ctx context.Context ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.GetP2sVpnConnectionHealth") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -375,7 +370,7 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealth(ctx context.Context result, err = client.GetP2sVpnConnectionHealthSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealth", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealth", nil, "Failure sending request") return } @@ -411,7 +406,10 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthSender(req *http.Req if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -420,7 +418,6 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthSender(req *http.Req func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthResponder(resp *http.Response) (result P2SVpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -457,6 +454,11 @@ func (client P2sVpnGatewaysClient) List(ctx context.Context) (result ListP2SVpnG result.lpvgr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "List", resp, "Failure responding to request") + return + } + if result.lpvgr.hasNextLink() && result.lpvgr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -492,7 +494,6 @@ func (client P2sVpnGatewaysClient) ListSender(req *http.Request) (*http.Response func (client P2sVpnGatewaysClient) ListResponder(resp *http.Response) (result ListP2SVpnGatewaysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -568,6 +569,11 @@ func (client P2sVpnGatewaysClient) ListByResourceGroup(ctx context.Context, reso result.lpvgr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.lpvgr.hasNextLink() && result.lpvgr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -604,7 +610,6 @@ func (client P2sVpnGatewaysClient) ListByResourceGroupSender(req *http.Request) func (client P2sVpnGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ListP2SVpnGatewaysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -659,8 +664,8 @@ func (client P2sVpnGatewaysClient) UpdateTags(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -673,7 +678,7 @@ func (client P2sVpnGatewaysClient) UpdateTags(ctx context.Context, resourceGroup result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "UpdateTags", nil, "Failure sending request") return } @@ -711,7 +716,10 @@ func (client P2sVpnGatewaysClient) UpdateTagsSender(req *http.Request) (future P if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -720,7 +728,6 @@ func (client P2sVpnGatewaysClient) UpdateTagsSender(req *http.Request) (future P func (client P2sVpnGatewaysClient) UpdateTagsResponder(resp *http.Response) (result P2SVpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/p2svpnserverconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/p2svpnserverconfigurations.go index f51d562a8e6a..40262e72be59 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/p2svpnserverconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/p2svpnserverconfigurations.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client P2sVpnServerConfigurationsClient) CreateOrUpdate(ctx context.Contex ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnServerConfigurationsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -68,7 +57,7 @@ func (client P2sVpnServerConfigurationsClient) CreateOrUpdate(ctx context.Contex result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnServerConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.P2sVpnServerConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -108,7 +97,10 @@ func (client P2sVpnServerConfigurationsClient) CreateOrUpdateSender(req *http.Re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -117,7 +109,6 @@ func (client P2sVpnServerConfigurationsClient) CreateOrUpdateSender(req *http.Re func (client P2sVpnServerConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result P2SVpnServerConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -135,8 +126,8 @@ func (client P2sVpnServerConfigurationsClient) Delete(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnServerConfigurationsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -149,7 +140,7 @@ func (client P2sVpnServerConfigurationsClient) Delete(ctx context.Context, resou result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnServerConfigurationsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.P2sVpnServerConfigurationsClient", "Delete", nil, "Failure sending request") return } @@ -186,7 +177,10 @@ func (client P2sVpnServerConfigurationsClient) DeleteSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -195,7 +189,6 @@ func (client P2sVpnServerConfigurationsClient) DeleteSender(req *http.Request) ( func (client P2sVpnServerConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -234,6 +227,7 @@ func (client P2sVpnServerConfigurationsClient) Get(ctx context.Context, resource result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.P2sVpnServerConfigurationsClient", "Get", resp, "Failure responding to request") + return } return @@ -272,7 +266,6 @@ func (client P2sVpnServerConfigurationsClient) GetSender(req *http.Request) (*ht func (client P2sVpnServerConfigurationsClient) GetResponder(resp *http.Response) (result P2SVpnServerConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -312,6 +305,11 @@ func (client P2sVpnServerConfigurationsClient) ListByVirtualWan(ctx context.Cont result.lpvscr, err = client.ListByVirtualWanResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.P2sVpnServerConfigurationsClient", "ListByVirtualWan", resp, "Failure responding to request") + return + } + if result.lpvscr.hasNextLink() && result.lpvscr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -349,7 +347,6 @@ func (client P2sVpnServerConfigurationsClient) ListByVirtualWanSender(req *http. func (client P2sVpnServerConfigurationsClient) ListByVirtualWanResponder(resp *http.Response) (result ListP2SVpnServerConfigurationsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/packetcaptures.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/packetcaptures.go index 2d8408f5addf..80ab73eb3164 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/packetcaptures.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/packetcaptures.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client PacketCapturesClient) Create(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Create") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -76,7 +65,7 @@ func (client PacketCapturesClient) Create(ctx context.Context, resourceGroupName result, err = client.CreateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Create", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Create", nil, "Failure sending request") return } @@ -115,7 +104,10 @@ func (client PacketCapturesClient) CreateSender(req *http.Request) (future Packe if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -124,7 +116,6 @@ func (client PacketCapturesClient) CreateSender(req *http.Request) (future Packe func (client PacketCapturesClient) CreateResponder(resp *http.Response) (result PacketCaptureResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -142,8 +133,8 @@ func (client PacketCapturesClient) Delete(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -156,7 +147,7 @@ func (client PacketCapturesClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Delete", nil, "Failure sending request") return } @@ -193,7 +184,10 @@ func (client PacketCapturesClient) DeleteSender(req *http.Request) (future Packe if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -202,7 +196,6 @@ func (client PacketCapturesClient) DeleteSender(req *http.Request) (future Packe func (client PacketCapturesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -241,6 +234,7 @@ func (client PacketCapturesClient) Get(ctx context.Context, resourceGroupName st result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Get", resp, "Failure responding to request") + return } return @@ -279,7 +273,6 @@ func (client PacketCapturesClient) GetSender(req *http.Request) (*http.Response, func (client PacketCapturesClient) GetResponder(resp *http.Response) (result PacketCaptureResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -297,8 +290,8 @@ func (client PacketCapturesClient) GetStatus(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.GetStatus") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -311,7 +304,7 @@ func (client PacketCapturesClient) GetStatus(ctx context.Context, resourceGroupN result, err = client.GetStatusSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "GetStatus", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "GetStatus", nil, "Failure sending request") return } @@ -348,7 +341,10 @@ func (client PacketCapturesClient) GetStatusSender(req *http.Request) (future Pa if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -357,7 +353,6 @@ func (client PacketCapturesClient) GetStatusSender(req *http.Request) (future Pa func (client PacketCapturesClient) GetStatusResponder(resp *http.Response) (result PacketCaptureQueryStatusResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -396,6 +391,7 @@ func (client PacketCapturesClient) List(ctx context.Context, resourceGroupName s result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "List", resp, "Failure responding to request") + return } return @@ -433,7 +429,6 @@ func (client PacketCapturesClient) ListSender(req *http.Request) (*http.Response func (client PacketCapturesClient) ListResponder(resp *http.Response) (result PacketCaptureListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -451,8 +446,8 @@ func (client PacketCapturesClient) Stop(ctx context.Context, resourceGroupName s ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Stop") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -465,7 +460,7 @@ func (client PacketCapturesClient) Stop(ctx context.Context, resourceGroupName s result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Stop", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Stop", nil, "Failure sending request") return } @@ -502,7 +497,10 @@ func (client PacketCapturesClient) StopSender(req *http.Request) (future PacketC if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -511,7 +509,6 @@ func (client PacketCapturesClient) StopSender(req *http.Request) (future PacketC func (client PacketCapturesClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/peerexpressroutecircuitconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/peerexpressroutecircuitconnections.go index 300bbdee4ac5..c898aa5f6ac1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/peerexpressroutecircuitconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/peerexpressroutecircuitconnections.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -76,6 +65,7 @@ func (client PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -115,7 +105,6 @@ func (client PeerExpressRouteCircuitConnectionsClient) GetSender(req *http.Reque func (client PeerExpressRouteCircuitConnectionsClient) GetResponder(resp *http.Response) (result PeerExpressRouteCircuitConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -156,6 +145,11 @@ func (client PeerExpressRouteCircuitConnectionsClient) List(ctx context.Context, result.percclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "List", resp, "Failure responding to request") + return + } + if result.percclr.hasNextLink() && result.percclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -194,7 +188,6 @@ func (client PeerExpressRouteCircuitConnectionsClient) ListSender(req *http.Requ func (client PeerExpressRouteCircuitConnectionsClient) ListResponder(resp *http.Response) (result PeerExpressRouteCircuitConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/privateendpoints.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/privateendpoints.go index 2fb5f307b605..14ba5e54ab73 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/privateendpoints.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/privateendpoints.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client PrivateEndpointsClient) CreateOrUpdate(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client PrivateEndpointsClient) CreateOrUpdate(ctx context.Context, resourc result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client PrivateEndpointsClient) CreateOrUpdateSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client PrivateEndpointsClient) CreateOrUpdateSender(req *http.Request) (fu func (client PrivateEndpointsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client PrivateEndpointsClient) Delete(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client PrivateEndpointsClient) Delete(ctx context.Context, resourceGroupNa result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client PrivateEndpointsClient) DeleteSender(req *http.Request) (future Pri if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client PrivateEndpointsClient) DeleteSender(req *http.Request) (future Pri func (client PrivateEndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -228,6 +221,7 @@ func (client PrivateEndpointsClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Get", resp, "Failure responding to request") + return } return @@ -268,7 +262,6 @@ func (client PrivateEndpointsClient) GetSender(req *http.Request) (*http.Respons func (client PrivateEndpointsClient) GetResponder(resp *http.Response) (result PrivateEndpoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -307,6 +300,11 @@ func (client PrivateEndpointsClient) List(ctx context.Context, resourceGroupName result.pelr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "List", resp, "Failure responding to request") + return + } + if result.pelr.hasNextLink() && result.pelr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -343,7 +341,6 @@ func (client PrivateEndpointsClient) ListSender(req *http.Request) (*http.Respon func (client PrivateEndpointsClient) ListResponder(resp *http.Response) (result PrivateEndpointListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +414,11 @@ func (client PrivateEndpointsClient) ListBySubscription(ctx context.Context) (re result.pelr, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.pelr.hasNextLink() && result.pelr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -452,7 +454,6 @@ func (client PrivateEndpointsClient) ListBySubscriptionSender(req *http.Request) func (client PrivateEndpointsClient) ListBySubscriptionResponder(resp *http.Response) (result PrivateEndpointListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/privatelinkservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/privatelinkservices.go index 3562ec31d87b..325abb8f441b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/privatelinkservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/privatelinkservices.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -46,13 +35,13 @@ func NewPrivateLinkServicesClientWithBaseURI(baseURI string, subscriptionID stri // Parameters: // location - the location of the domain name. // parameters - the request body of CheckPrivateLinkService API call. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServiceVisibility, err error) { +func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CheckPrivateLinkServiceVisibility") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -63,18 +52,12 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibility(ctx co return } - resp, err := client.CheckPrivateLinkServiceVisibilitySender(req) + result, err = client.CheckPrivateLinkServiceVisibilitySender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibility", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibility", nil, "Failure sending request") return } - result, err = client.CheckPrivateLinkServiceVisibilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibility", resp, "Failure responding to request") - } - return } @@ -102,8 +85,17 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityPrepare // CheckPrivateLinkServiceVisibilitySender sends the CheckPrivateLinkServiceVisibility request. The method will close the // http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilitySender(req *http.Request) (future PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return } // CheckPrivateLinkServiceVisibilityResponder handles the response to the CheckPrivateLinkServiceVisibility request. The method always @@ -111,8 +103,7 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilitySender( func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityResponder(resp *http.Response) (result PrivateLinkServiceVisibility, err error) { err = autorest.Respond( resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -124,13 +115,13 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityRespond // location - the location of the domain name. // resourceGroupName - the name of the resource group. // parameters - the request body of CheckPrivateLinkService API call. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServiceVisibility, err error) { +func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CheckPrivateLinkServiceVisibilityByResourceGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -141,18 +132,12 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResou return } - resp, err := client.CheckPrivateLinkServiceVisibilityByResourceGroupSender(req) + result, err = client.CheckPrivateLinkServiceVisibilityByResourceGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibilityByResourceGroup", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibilityByResourceGroup", nil, "Failure sending request") return } - result, err = client.CheckPrivateLinkServiceVisibilityByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibilityByResourceGroup", resp, "Failure responding to request") - } - return } @@ -181,8 +166,17 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResou // CheckPrivateLinkServiceVisibilityByResourceGroupSender sends the CheckPrivateLinkServiceVisibilityByResourceGroup request. The method will close the // http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupSender(req *http.Request) (future PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return } // CheckPrivateLinkServiceVisibilityByResourceGroupResponder handles the response to the CheckPrivateLinkServiceVisibilityByResourceGroup request. The method always @@ -190,8 +184,7 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResou func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupResponder(resp *http.Response) (result PrivateLinkServiceVisibility, err error) { err = autorest.Respond( resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -208,8 +201,8 @@ func (client PrivateLinkServicesClient) CreateOrUpdate(ctx context.Context, reso ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -222,7 +215,7 @@ func (client PrivateLinkServicesClient) CreateOrUpdate(ctx context.Context, reso result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -260,7 +253,10 @@ func (client PrivateLinkServicesClient) CreateOrUpdateSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -269,7 +265,6 @@ func (client PrivateLinkServicesClient) CreateOrUpdateSender(req *http.Request) func (client PrivateLinkServicesClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateLinkService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -286,8 +281,8 @@ func (client PrivateLinkServicesClient) Delete(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -300,7 +295,7 @@ func (client PrivateLinkServicesClient) Delete(ctx context.Context, resourceGrou result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Delete", nil, "Failure sending request") return } @@ -336,7 +331,10 @@ func (client PrivateLinkServicesClient) DeleteSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -345,7 +343,6 @@ func (client PrivateLinkServicesClient) DeleteSender(req *http.Request) (future func (client PrivateLinkServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -362,8 +359,8 @@ func (client PrivateLinkServicesClient) DeletePrivateEndpointConnection(ctx cont ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.DeletePrivateEndpointConnection") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -376,7 +373,7 @@ func (client PrivateLinkServicesClient) DeletePrivateEndpointConnection(ctx cont result, err = client.DeletePrivateEndpointConnectionSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "DeletePrivateEndpointConnection", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "DeletePrivateEndpointConnection", nil, "Failure sending request") return } @@ -413,7 +410,10 @@ func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionSender(re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -422,7 +422,6 @@ func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionSender(re func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -461,6 +460,7 @@ func (client PrivateLinkServicesClient) Get(ctx context.Context, resourceGroupNa result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", resp, "Failure responding to request") + return } return @@ -501,7 +501,6 @@ func (client PrivateLinkServicesClient) GetSender(req *http.Request) (*http.Resp func (client PrivateLinkServicesClient) GetResponder(resp *http.Response) (result PrivateLinkService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -540,6 +539,11 @@ func (client PrivateLinkServicesClient) List(ctx context.Context, resourceGroupN result.plslr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", resp, "Failure responding to request") + return + } + if result.plslr.hasNextLink() && result.plslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -576,7 +580,6 @@ func (client PrivateLinkServicesClient) ListSender(req *http.Request) (*http.Res func (client PrivateLinkServicesClient) ListResponder(resp *http.Response) (result PrivateLinkServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -653,6 +656,11 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServices(ctx result.aaplsr, err = client.ListAutoApprovedPrivateLinkServicesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", resp, "Failure responding to request") + return + } + if result.aaplsr.hasNextLink() && result.aaplsr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -689,7 +697,6 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesSende func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesResponder(resp *http.Response) (result AutoApprovedPrivateLinkServicesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -767,6 +774,11 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByRes result.aaplsr, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", resp, "Failure responding to request") + return + } + if result.aaplsr.hasNextLink() && result.aaplsr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -804,7 +816,6 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByRes func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp *http.Response) (result AutoApprovedPrivateLinkServicesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -878,6 +889,11 @@ func (client PrivateLinkServicesClient) ListBySubscription(ctx context.Context) result.plslr, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.plslr.hasNextLink() && result.plslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -913,7 +929,6 @@ func (client PrivateLinkServicesClient) ListBySubscriptionSender(req *http.Reque func (client PrivateLinkServicesClient) ListBySubscriptionResponder(resp *http.Response) (result PrivateLinkServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -992,6 +1007,7 @@ func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx cont result, err = client.UpdatePrivateEndpointConnectionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", resp, "Failure responding to request") + return } return @@ -1034,7 +1050,6 @@ func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionSender(re func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/profiles.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/profiles.go index 1065bca51a23..139030f8044b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/profiles.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/profiles.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,7 @@ func (client ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ProfilesClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client ProfilesClient) CreateOrUpdateSender(req *http.Request) (*http.Resp func (client ProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result Profile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -129,8 +118,8 @@ func (client ProfilesClient) Delete(ctx context.Context, resourceGroupName strin ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -143,7 +132,7 @@ func (client ProfilesClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Delete", nil, "Failure sending request") return } @@ -179,7 +168,10 @@ func (client ProfilesClient) DeleteSender(req *http.Request) (future ProfilesDel if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -188,7 +180,6 @@ func (client ProfilesClient) DeleteSender(req *http.Request) (future ProfilesDel func (client ProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +218,7 @@ func (client ProfilesClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Get", resp, "Failure responding to request") + return } return @@ -267,7 +259,6 @@ func (client ProfilesClient) GetSender(req *http.Request) (*http.Response, error func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +297,11 @@ func (client ProfilesClient) List(ctx context.Context, resourceGroupName string) result.plr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ProfilesClient", "List", resp, "Failure responding to request") + return + } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -342,7 +338,6 @@ func (client ProfilesClient) ListSender(req *http.Request) (*http.Response, erro func (client ProfilesClient) ListResponder(resp *http.Response) (result ProfileListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +411,11 @@ func (client ProfilesClient) ListAll(ctx context.Context) (result ProfileListRes result.plr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ProfilesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -451,7 +451,6 @@ func (client ProfilesClient) ListAllSender(req *http.Request) (*http.Response, e func (client ProfilesClient) ListAllResponder(resp *http.Response) (result ProfileListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -528,6 +527,7 @@ func (client ProfilesClient) UpdateTags(ctx context.Context, resourceGroupName s result, err = client.UpdateTagsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ProfilesClient", "UpdateTags", resp, "Failure responding to request") + return } return @@ -567,7 +567,6 @@ func (client ProfilesClient) UpdateTagsSender(req *http.Request) (*http.Response func (client ProfilesClient) UpdateTagsResponder(resp *http.Response) (result Profile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/publicipaddresses.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/publicipaddresses.go index fc38f44ddcd6..6d39bdfd630f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/publicipaddresses.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/publicipaddresses.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client PublicIPAddressesClient) CreateOrUpdate(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -78,7 +67,7 @@ func (client PublicIPAddressesClient) CreateOrUpdate(ctx context.Context, resour result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -116,7 +105,10 @@ func (client PublicIPAddressesClient) CreateOrUpdateSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -125,7 +117,6 @@ func (client PublicIPAddressesClient) CreateOrUpdateSender(req *http.Request) (f func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Response) (result PublicIPAddress, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -142,8 +133,8 @@ func (client PublicIPAddressesClient) Delete(ctx context.Context, resourceGroupN ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -156,7 +147,7 @@ func (client PublicIPAddressesClient) Delete(ctx context.Context, resourceGroupN result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Delete", nil, "Failure sending request") return } @@ -192,7 +183,10 @@ func (client PublicIPAddressesClient) DeleteSender(req *http.Request) (future Pu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -201,7 +195,6 @@ func (client PublicIPAddressesClient) DeleteSender(req *http.Request) (future Pu func (client PublicIPAddressesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -240,6 +233,7 @@ func (client PublicIPAddressesClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", resp, "Failure responding to request") + return } return @@ -280,7 +274,6 @@ func (client PublicIPAddressesClient) GetSender(req *http.Request) (*http.Respon func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result PublicIPAddress, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -324,6 +317,7 @@ func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress(c result, err = client.GetVirtualMachineScaleSetPublicIPAddressResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", resp, "Failure responding to request") + return } return @@ -368,7 +362,6 @@ func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressSe func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressResponder(resp *http.Response) (result PublicIPAddress, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -407,6 +400,11 @@ func (client PublicIPAddressesClient) List(ctx context.Context, resourceGroupNam result.pialr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure responding to request") + return + } + if result.pialr.hasNextLink() && result.pialr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -443,7 +441,6 @@ func (client PublicIPAddressesClient) ListSender(req *http.Request) (*http.Respo func (client PublicIPAddressesClient) ListResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -517,6 +514,11 @@ func (client PublicIPAddressesClient) ListAll(ctx context.Context) (result Publi result.pialr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.pialr.hasNextLink() && result.pialr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -552,7 +554,6 @@ func (client PublicIPAddressesClient) ListAllSender(req *http.Request) (*http.Re func (client PublicIPAddressesClient) ListAllResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -630,6 +631,11 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresse result.pialr, err = client.ListVirtualMachineScaleSetPublicIPAddressesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure responding to request") + return + } + if result.pialr.hasNextLink() && result.pialr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -667,7 +673,6 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresse func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -748,6 +753,11 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddres result.pialr, err = client.ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure responding to request") + return + } + if result.pialr.hasNextLink() && result.pialr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -788,7 +798,6 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddres func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -843,8 +852,8 @@ func (client PublicIPAddressesClient) UpdateTags(ctx context.Context, resourceGr ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -857,7 +866,7 @@ func (client PublicIPAddressesClient) UpdateTags(ctx context.Context, resourceGr result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "UpdateTags", nil, "Failure sending request") return } @@ -895,7 +904,10 @@ func (client PublicIPAddressesClient) UpdateTagsSender(req *http.Request) (futur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -904,7 +916,6 @@ func (client PublicIPAddressesClient) UpdateTagsSender(req *http.Request) (futur func (client PublicIPAddressesClient) UpdateTagsResponder(resp *http.Response) (result PublicIPAddress, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/publicipprefixes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/publicipprefixes.go index c4ca5fb5dcc3..8c82696945c2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/publicipprefixes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/publicipprefixes.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client PublicIPPrefixesClient) CreateOrUpdate(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client PublicIPPrefixesClient) CreateOrUpdate(ctx context.Context, resourc result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client PublicIPPrefixesClient) CreateOrUpdateSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client PublicIPPrefixesClient) CreateOrUpdateSender(req *http.Request) (fu func (client PublicIPPrefixesClient) CreateOrUpdateResponder(resp *http.Response) (result PublicIPPrefix, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client PublicIPPrefixesClient) Delete(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client PublicIPPrefixesClient) Delete(ctx context.Context, resourceGroupNa result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client PublicIPPrefixesClient) DeleteSender(req *http.Request) (future Pub if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client PublicIPPrefixesClient) DeleteSender(req *http.Request) (future Pub func (client PublicIPPrefixesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -228,6 +221,7 @@ func (client PublicIPPrefixesClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Get", resp, "Failure responding to request") + return } return @@ -268,7 +262,6 @@ func (client PublicIPPrefixesClient) GetSender(req *http.Request) (*http.Respons func (client PublicIPPrefixesClient) GetResponder(resp *http.Response) (result PublicIPPrefix, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -307,6 +300,11 @@ func (client PublicIPPrefixesClient) List(ctx context.Context, resourceGroupName result.piplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "List", resp, "Failure responding to request") + return + } + if result.piplr.hasNextLink() && result.piplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -343,7 +341,6 @@ func (client PublicIPPrefixesClient) ListSender(req *http.Request) (*http.Respon func (client PublicIPPrefixesClient) ListResponder(resp *http.Response) (result PublicIPPrefixListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +414,11 @@ func (client PublicIPPrefixesClient) ListAll(ctx context.Context) (result Public result.piplr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.piplr.hasNextLink() && result.piplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -452,7 +454,6 @@ func (client PublicIPPrefixesClient) ListAllSender(req *http.Request) (*http.Res func (client PublicIPPrefixesClient) ListAllResponder(resp *http.Response) (result PublicIPPrefixListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -507,8 +508,8 @@ func (client PublicIPPrefixesClient) UpdateTags(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -521,7 +522,7 @@ func (client PublicIPPrefixesClient) UpdateTags(ctx context.Context, resourceGro result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "UpdateTags", nil, "Failure sending request") return } @@ -559,7 +560,10 @@ func (client PublicIPPrefixesClient) UpdateTagsSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -568,7 +572,6 @@ func (client PublicIPPrefixesClient) UpdateTagsSender(req *http.Request) (future func (client PublicIPPrefixesClient) UpdateTagsResponder(resp *http.Response) (result PublicIPPrefix, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/resourcenavigationlinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/resourcenavigationlinks.go index af9de96b5850..22f89957d620 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/resourcenavigationlinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/resourcenavigationlinks.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client ResourceNavigationLinksClient) List(ctx context.Context, resourceGr result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ResourceNavigationLinksClient", "List", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client ResourceNavigationLinksClient) ListSender(req *http.Request) (*http func (client ResourceNavigationLinksClient) ListResponder(resp *http.Response) (result ResourceNavigationLinksListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routefilterrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routefilterrules.go index 4dcb6313a6aa..7f9110bb552f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routefilterrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routefilterrules.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -77,7 +66,7 @@ func (client RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, resourc result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -117,7 +106,10 @@ func (client RouteFilterRulesClient) CreateOrUpdateSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -126,7 +118,6 @@ func (client RouteFilterRulesClient) CreateOrUpdateSender(req *http.Request) (fu func (client RouteFilterRulesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteFilterRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -144,8 +135,8 @@ func (client RouteFilterRulesClient) Delete(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -158,7 +149,7 @@ func (client RouteFilterRulesClient) Delete(ctx context.Context, resourceGroupNa result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Delete", nil, "Failure sending request") return } @@ -195,7 +186,10 @@ func (client RouteFilterRulesClient) DeleteSender(req *http.Request) (future Rou if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -204,7 +198,6 @@ func (client RouteFilterRulesClient) DeleteSender(req *http.Request) (future Rou func (client RouteFilterRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -243,6 +236,7 @@ func (client RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -281,7 +275,6 @@ func (client RouteFilterRulesClient) GetSender(req *http.Request) (*http.Respons func (client RouteFilterRulesClient) GetResponder(resp *http.Response) (result RouteFilterRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -321,6 +314,11 @@ func (client RouteFilterRulesClient) ListByRouteFilter(ctx context.Context, reso result.rfrlr, err = client.ListByRouteFilterResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", resp, "Failure responding to request") + return + } + if result.rfrlr.hasNextLink() && result.rfrlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -358,7 +356,6 @@ func (client RouteFilterRulesClient) ListByRouteFilterSender(req *http.Request) func (client RouteFilterRulesClient) ListByRouteFilterResponder(resp *http.Response) (result RouteFilterRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -414,8 +411,8 @@ func (client RouteFilterRulesClient) Update(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -428,7 +425,7 @@ func (client RouteFilterRulesClient) Update(ctx context.Context, resourceGroupNa result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Update", nil, "Failure sending request") return } @@ -469,7 +466,10 @@ func (client RouteFilterRulesClient) UpdateSender(req *http.Request) (future Rou if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -478,7 +478,6 @@ func (client RouteFilterRulesClient) UpdateSender(req *http.Request) (future Rou func (client RouteFilterRulesClient) UpdateResponder(resp *http.Response) (result RouteFilterRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routefilters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routefilters.go index 9fa46f80884a..c8409ea83470 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routefilters.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routefilters.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client RouteFiltersClient) CreateOrUpdate(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client RouteFiltersClient) CreateOrUpdate(ctx context.Context, resourceGro result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client RouteFiltersClient) CreateOrUpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client RouteFiltersClient) CreateOrUpdateSender(req *http.Request) (future func (client RouteFiltersClient) CreateOrUpdateResponder(resp *http.Response) (result RouteFilter, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client RouteFiltersClient) Delete(ctx context.Context, resourceGroupName s ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client RouteFiltersClient) Delete(ctx context.Context, resourceGroupName s result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client RouteFiltersClient) DeleteSender(req *http.Request) (future RouteFi if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client RouteFiltersClient) DeleteSender(req *http.Request) (future RouteFi func (client RouteFiltersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -228,6 +221,7 @@ func (client RouteFiltersClient) Get(ctx context.Context, resourceGroupName stri result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Get", resp, "Failure responding to request") + return } return @@ -268,7 +262,6 @@ func (client RouteFiltersClient) GetSender(req *http.Request) (*http.Response, e func (client RouteFiltersClient) GetResponder(resp *http.Response) (result RouteFilter, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -305,6 +298,11 @@ func (client RouteFiltersClient) List(ctx context.Context) (result RouteFilterLi result.rflr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "List", resp, "Failure responding to request") + return + } + if result.rflr.hasNextLink() && result.rflr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -340,7 +338,6 @@ func (client RouteFiltersClient) ListSender(req *http.Request) (*http.Response, func (client RouteFiltersClient) ListResponder(resp *http.Response) (result RouteFilterListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +413,11 @@ func (client RouteFiltersClient) ListByResourceGroup(ctx context.Context, resour result.rflr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.rflr.hasNextLink() && result.rflr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -452,7 +454,6 @@ func (client RouteFiltersClient) ListByResourceGroupSender(req *http.Request) (* func (client RouteFiltersClient) ListByResourceGroupResponder(resp *http.Response) (result RouteFilterListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -507,8 +508,8 @@ func (client RouteFiltersClient) Update(ctx context.Context, resourceGroupName s ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -521,7 +522,7 @@ func (client RouteFiltersClient) Update(ctx context.Context, resourceGroupName s result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Update", nil, "Failure sending request") return } @@ -562,7 +563,10 @@ func (client RouteFiltersClient) UpdateSender(req *http.Request) (future RouteFi if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -571,7 +575,6 @@ func (client RouteFiltersClient) UpdateSender(req *http.Request) (future RouteFi func (client RouteFiltersClient) UpdateResponder(resp *http.Response) (result RouteFilter, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routes.go index 683a73c5857c..67ee31c58474 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routes.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client RoutesClient) CreateOrUpdate(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client RoutesClient) CreateOrUpdate(ctx context.Context, resourceGroupName result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RoutesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -105,7 +94,10 @@ func (client RoutesClient) CreateOrUpdateSender(req *http.Request) (future Route if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -114,7 +106,6 @@ func (client RoutesClient) CreateOrUpdateSender(req *http.Request) (future Route func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result Route, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -132,8 +123,8 @@ func (client RoutesClient) Delete(ctx context.Context, resourceGroupName string, ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -146,7 +137,7 @@ func (client RoutesClient) Delete(ctx context.Context, resourceGroupName string, result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RoutesClient", "Delete", nil, "Failure sending request") return } @@ -183,7 +174,10 @@ func (client RoutesClient) DeleteSender(req *http.Request) (future RoutesDeleteF if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -192,7 +186,6 @@ func (client RoutesClient) DeleteSender(req *http.Request) (future RoutesDeleteF func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -231,6 +224,7 @@ func (client RoutesClient) Get(ctx context.Context, resourceGroupName string, ro result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RoutesClient", "Get", resp, "Failure responding to request") + return } return @@ -269,7 +263,6 @@ func (client RoutesClient) GetSender(req *http.Request) (*http.Response, error) func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -309,6 +302,11 @@ func (client RoutesClient) List(ctx context.Context, resourceGroupName string, r result.rlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -346,7 +344,6 @@ func (client RoutesClient) ListSender(req *http.Request) (*http.Response, error) func (client RoutesClient) ListResponder(resp *http.Response) (result RouteListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routetables.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routetables.go index 8c1e0a739932..20919bc8593a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routetables.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/routetables.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client RouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client RouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGrou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -103,7 +92,10 @@ func (client RouteTablesClient) CreateOrUpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -112,7 +104,6 @@ func (client RouteTablesClient) CreateOrUpdateSender(req *http.Request) (future func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteTable, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -129,8 +120,8 @@ func (client RouteTablesClient) Delete(ctx context.Context, resourceGroupName st ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -143,7 +134,7 @@ func (client RouteTablesClient) Delete(ctx context.Context, resourceGroupName st result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Delete", nil, "Failure sending request") return } @@ -179,7 +170,10 @@ func (client RouteTablesClient) DeleteSender(req *http.Request) (future RouteTab if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -188,7 +182,6 @@ func (client RouteTablesClient) DeleteSender(req *http.Request) (future RouteTab func (client RouteTablesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client RouteTablesClient) Get(ctx context.Context, resourceGroupName strin result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", resp, "Failure responding to request") + return } return @@ -267,7 +261,6 @@ func (client RouteTablesClient) GetSender(req *http.Request) (*http.Response, er func (client RouteTablesClient) GetResponder(resp *http.Response) (result RouteTable, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +299,11 @@ func (client RouteTablesClient) List(ctx context.Context, resourceGroupName stri result.rtlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure responding to request") + return + } + if result.rtlr.hasNextLink() && result.rtlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -342,7 +340,6 @@ func (client RouteTablesClient) ListSender(req *http.Request) (*http.Response, e func (client RouteTablesClient) ListResponder(resp *http.Response) (result RouteTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +413,11 @@ func (client RouteTablesClient) ListAll(ctx context.Context) (result RouteTableL result.rtlr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.rtlr.hasNextLink() && result.rtlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -451,7 +453,6 @@ func (client RouteTablesClient) ListAllSender(req *http.Request) (*http.Response func (client RouteTablesClient) ListAllResponder(resp *http.Response) (result RouteTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -506,8 +507,8 @@ func (client RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -520,7 +521,7 @@ func (client RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupNam result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "UpdateTags", nil, "Failure sending request") return } @@ -558,7 +559,10 @@ func (client RouteTablesClient) UpdateTagsSender(req *http.Request) (future Rout if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -567,7 +571,6 @@ func (client RouteTablesClient) UpdateTagsSender(req *http.Request) (future Rout func (client RouteTablesClient) UpdateTagsResponder(resp *http.Response) (result RouteTable, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/securitygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/securitygroups.go index d50d4e1b145f..19e52dbe79d1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/securitygroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/securitygroups.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client SecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client SecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceG result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -103,7 +92,10 @@ func (client SecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -112,7 +104,6 @@ func (client SecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (futu func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -129,8 +120,8 @@ func (client SecurityGroupsClient) Delete(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -143,7 +134,7 @@ func (client SecurityGroupsClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Delete", nil, "Failure sending request") return } @@ -179,7 +170,10 @@ func (client SecurityGroupsClient) DeleteSender(req *http.Request) (future Secur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -188,7 +182,6 @@ func (client SecurityGroupsClient) DeleteSender(req *http.Request) (future Secur func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client SecurityGroupsClient) Get(ctx context.Context, resourceGroupName st result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", resp, "Failure responding to request") + return } return @@ -267,7 +261,6 @@ func (client SecurityGroupsClient) GetSender(req *http.Request) (*http.Response, func (client SecurityGroupsClient) GetResponder(resp *http.Response) (result SecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +299,11 @@ func (client SecurityGroupsClient) List(ctx context.Context, resourceGroupName s result.sglr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure responding to request") + return + } + if result.sglr.hasNextLink() && result.sglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -342,7 +340,6 @@ func (client SecurityGroupsClient) ListSender(req *http.Request) (*http.Response func (client SecurityGroupsClient) ListResponder(resp *http.Response) (result SecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +413,11 @@ func (client SecurityGroupsClient) ListAll(ctx context.Context) (result Security result.sglr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure responding to request") + return + } + if result.sglr.hasNextLink() && result.sglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -451,7 +453,6 @@ func (client SecurityGroupsClient) ListAllSender(req *http.Request) (*http.Respo func (client SecurityGroupsClient) ListAllResponder(resp *http.Response) (result SecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -506,8 +507,8 @@ func (client SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -520,7 +521,7 @@ func (client SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroup result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "UpdateTags", nil, "Failure sending request") return } @@ -558,7 +559,10 @@ func (client SecurityGroupsClient) UpdateTagsSender(req *http.Request) (future S if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -567,7 +571,6 @@ func (client SecurityGroupsClient) UpdateTagsSender(req *http.Request) (future S func (client SecurityGroupsClient) UpdateTagsResponder(resp *http.Response) (result SecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/securityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/securityrules.go index 8ac672da35e3..1c081bf3f6f7 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/securityrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/securityrules.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client SecurityRulesClient) CreateOrUpdate(ctx context.Context, resourceGr ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client SecurityRulesClient) CreateOrUpdate(ctx context.Context, resourceGr result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -105,7 +94,10 @@ func (client SecurityRulesClient) CreateOrUpdateSender(req *http.Request) (futur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -114,7 +106,6 @@ func (client SecurityRulesClient) CreateOrUpdateSender(req *http.Request) (futur func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -132,8 +123,8 @@ func (client SecurityRulesClient) Delete(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -146,7 +137,7 @@ func (client SecurityRulesClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Delete", nil, "Failure sending request") return } @@ -183,7 +174,10 @@ func (client SecurityRulesClient) DeleteSender(req *http.Request) (future Securi if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -192,7 +186,6 @@ func (client SecurityRulesClient) DeleteSender(req *http.Request) (future Securi func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -231,6 +224,7 @@ func (client SecurityRulesClient) Get(ctx context.Context, resourceGroupName str result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", resp, "Failure responding to request") + return } return @@ -269,7 +263,6 @@ func (client SecurityRulesClient) GetSender(req *http.Request) (*http.Response, func (client SecurityRulesClient) GetResponder(resp *http.Response) (result SecurityRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -309,6 +302,11 @@ func (client SecurityRulesClient) List(ctx context.Context, resourceGroupName st result.srlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure responding to request") + return + } + if result.srlr.hasNextLink() && result.srlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -346,7 +344,6 @@ func (client SecurityRulesClient) ListSender(req *http.Request) (*http.Response, func (client SecurityRulesClient) ListResponder(resp *http.Response) (result SecurityRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceassociationlinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceassociationlinks.go index 30e88928f7c4..3b3fce7bfc24 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceassociationlinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceassociationlinks.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -74,6 +63,7 @@ func (client ServiceAssociationLinksClient) List(ctx context.Context, resourceGr result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceAssociationLinksClient", "List", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client ServiceAssociationLinksClient) ListSender(req *http.Request) (*http func (client ServiceAssociationLinksClient) ListResponder(resp *http.Response) (result ServiceAssociationLinksListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceendpointpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceendpointpolicies.go index 6ca72e59370e..0a4865111515 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceendpointpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceendpointpolicies.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client ServiceEndpointPoliciesClient) CreateOrUpdate(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client ServiceEndpointPoliciesClient) CreateOrUpdate(ctx context.Context, result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client ServiceEndpointPoliciesClient) CreateOrUpdateSender(req *http.Reque if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client ServiceEndpointPoliciesClient) CreateOrUpdateSender(req *http.Reque func (client ServiceEndpointPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client ServiceEndpointPoliciesClient) Delete(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client ServiceEndpointPoliciesClient) Delete(ctx context.Context, resource result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client ServiceEndpointPoliciesClient) DeleteSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client ServiceEndpointPoliciesClient) DeleteSender(req *http.Request) (fut func (client ServiceEndpointPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -228,6 +221,7 @@ func (client ServiceEndpointPoliciesClient) Get(ctx context.Context, resourceGro result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Get", resp, "Failure responding to request") + return } return @@ -268,7 +262,6 @@ func (client ServiceEndpointPoliciesClient) GetSender(req *http.Request) (*http. func (client ServiceEndpointPoliciesClient) GetResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -305,6 +298,11 @@ func (client ServiceEndpointPoliciesClient) List(ctx context.Context) (result Se result.seplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.seplr.hasNextLink() && result.seplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -340,7 +338,6 @@ func (client ServiceEndpointPoliciesClient) ListSender(req *http.Request) (*http func (client ServiceEndpointPoliciesClient) ListResponder(resp *http.Response) (result ServiceEndpointPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +413,11 @@ func (client ServiceEndpointPoliciesClient) ListByResourceGroup(ctx context.Cont result.seplr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.seplr.hasNextLink() && result.seplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -452,7 +454,6 @@ func (client ServiceEndpointPoliciesClient) ListByResourceGroupSender(req *http. func (client ServiceEndpointPoliciesClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceEndpointPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -507,8 +508,8 @@ func (client ServiceEndpointPoliciesClient) Update(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -521,7 +522,7 @@ func (client ServiceEndpointPoliciesClient) Update(ctx context.Context, resource result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Update", nil, "Failure sending request") return } @@ -559,7 +560,10 @@ func (client ServiceEndpointPoliciesClient) UpdateSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -568,7 +572,6 @@ func (client ServiceEndpointPoliciesClient) UpdateSender(req *http.Request) (fut func (client ServiceEndpointPoliciesClient) UpdateResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceendpointpolicydefinitions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceendpointpolicydefinitions.go index d819d08ec2ee..b5edd5f52cdd 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceendpointpolicydefinitions.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/serviceendpointpolicydefinitions.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdate(ctx context. ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -68,7 +57,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdate(ctx context. result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -107,7 +96,10 @@ func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateSender(req *h if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -116,7 +108,6 @@ func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateSender(req *h func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceEndpointPolicyDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -134,8 +125,8 @@ func (client ServiceEndpointPolicyDefinitionsClient) Delete(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -148,7 +139,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) Delete(ctx context.Context, result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Delete", nil, "Failure sending request") return } @@ -185,7 +176,10 @@ func (client ServiceEndpointPolicyDefinitionsClient) DeleteSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -194,7 +188,6 @@ func (client ServiceEndpointPolicyDefinitionsClient) DeleteSender(req *http.Requ func (client ServiceEndpointPolicyDefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -233,6 +226,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) Get(ctx context.Context, re result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Get", resp, "Failure responding to request") + return } return @@ -271,7 +265,6 @@ func (client ServiceEndpointPolicyDefinitionsClient) GetSender(req *http.Request func (client ServiceEndpointPolicyDefinitionsClient) GetResponder(resp *http.Response) (result ServiceEndpointPolicyDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -311,6 +304,11 @@ func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroup(ctx con result.sepdlr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.sepdlr.hasNextLink() && result.sepdlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -348,7 +346,6 @@ func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupSender(r func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceEndpointPolicyDefinitionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/servicetags.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/servicetags.go index 7c1ecee53959..d5bd97bb5567 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/servicetags.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/servicetags.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,7 @@ func (client ServiceTagsClient) List(ctx context.Context, location string) (resu result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceTagsClient", "List", resp, "Failure responding to request") + return } return @@ -109,7 +99,6 @@ func (client ServiceTagsClient) ListSender(req *http.Request) (*http.Response, e func (client ServiceTagsClient) ListResponder(resp *http.Response) (result ServiceTagsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/subnets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/subnets.go index 1839538c5ed4..acd0f116c835 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/subnets.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/subnets.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -52,8 +41,8 @@ func (client SubnetsClient) CreateOrUpdate(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -66,7 +55,7 @@ func (client SubnetsClient) CreateOrUpdate(ctx context.Context, resourceGroupNam result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -105,7 +94,10 @@ func (client SubnetsClient) CreateOrUpdateSender(req *http.Request) (future Subn if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -114,7 +106,6 @@ func (client SubnetsClient) CreateOrUpdateSender(req *http.Request) (future Subn func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result Subnet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -132,8 +123,8 @@ func (client SubnetsClient) Delete(ctx context.Context, resourceGroupName string ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -146,7 +137,7 @@ func (client SubnetsClient) Delete(ctx context.Context, resourceGroupName string result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Delete", nil, "Failure sending request") return } @@ -183,7 +174,10 @@ func (client SubnetsClient) DeleteSender(req *http.Request) (future SubnetsDelet if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -192,7 +186,6 @@ func (client SubnetsClient) DeleteSender(req *http.Request) (future SubnetsDelet func (client SubnetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -232,6 +225,7 @@ func (client SubnetsClient) Get(ctx context.Context, resourceGroupName string, v result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", resp, "Failure responding to request") + return } return @@ -273,7 +267,6 @@ func (client SubnetsClient) GetSender(req *http.Request) (*http.Response, error) func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -313,6 +306,11 @@ func (client SubnetsClient) List(ctx context.Context, resourceGroupName string, result.slr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure responding to request") + return + } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -350,7 +348,6 @@ func (client SubnetsClient) ListSender(req *http.Request) (*http.Response, error func (client SubnetsClient) ListResponder(resp *http.Response) (result SubnetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -407,8 +404,8 @@ func (client SubnetsClient) PrepareNetworkPolicies(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.PrepareNetworkPolicies") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -421,7 +418,7 @@ func (client SubnetsClient) PrepareNetworkPolicies(ctx context.Context, resource result, err = client.PrepareNetworkPoliciesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "PrepareNetworkPolicies", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.SubnetsClient", "PrepareNetworkPolicies", nil, "Failure sending request") return } @@ -460,7 +457,10 @@ func (client SubnetsClient) PrepareNetworkPoliciesSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -469,7 +469,6 @@ func (client SubnetsClient) PrepareNetworkPoliciesSender(req *http.Request) (fut func (client SubnetsClient) PrepareNetworkPoliciesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -488,8 +487,8 @@ func (client SubnetsClient) UnprepareNetworkPolicies(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.UnprepareNetworkPolicies") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -502,7 +501,7 @@ func (client SubnetsClient) UnprepareNetworkPolicies(ctx context.Context, resour result, err = client.UnprepareNetworkPoliciesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "UnprepareNetworkPolicies", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.SubnetsClient", "UnprepareNetworkPolicies", nil, "Failure sending request") return } @@ -541,7 +540,10 @@ func (client SubnetsClient) UnprepareNetworkPoliciesSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -550,7 +552,6 @@ func (client SubnetsClient) UnprepareNetworkPoliciesSender(req *http.Request) (f func (client SubnetsClient) UnprepareNetworkPoliciesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/usages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/usages.go index a73e8b911c2b..e42f1b0ede3f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/usages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/usages.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -79,6 +68,11 @@ func (client UsagesClient) List(ctx context.Context, location string) (result Us result.ulr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure responding to request") + return + } + if result.ulr.hasNextLink() && result.ulr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -115,7 +109,6 @@ func (client UsagesClient) ListSender(req *http.Request) (*http.Response, error) func (client UsagesClient) ListResponder(resp *http.Response) (result UsagesListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/version.go index 74c7d35e8314..2b9dc7989483 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/version.go @@ -2,19 +2,8 @@ package network import "github.com/Azure/azure-sdk-for-go/version" -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualhubs.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualhubs.go index 16fdbc9ef559..0aceb756531d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualhubs.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualhubs.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client VirtualHubsClient) CreateOrUpdate(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client VirtualHubsClient) CreateOrUpdate(ctx context.Context, resourceGrou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client VirtualHubsClient) CreateOrUpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client VirtualHubsClient) CreateOrUpdateSender(req *http.Request) (future func (client VirtualHubsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualHub, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client VirtualHubsClient) Delete(ctx context.Context, resourceGroupName st ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client VirtualHubsClient) Delete(ctx context.Context, resourceGroupName st result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client VirtualHubsClient) DeleteSender(req *http.Request) (future VirtualH if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client VirtualHubsClient) DeleteSender(req *http.Request) (future VirtualH func (client VirtualHubsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client VirtualHubsClient) Get(ctx context.Context, resourceGroupName strin result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", resp, "Failure responding to request") + return } return @@ -264,7 +258,6 @@ func (client VirtualHubsClient) GetSender(req *http.Request) (*http.Response, er func (client VirtualHubsClient) GetResponder(resp *http.Response) (result VirtualHub, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -301,6 +294,11 @@ func (client VirtualHubsClient) List(ctx context.Context) (result ListVirtualHub result.lvhr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", resp, "Failure responding to request") + return + } + if result.lvhr.hasNextLink() && result.lvhr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -336,7 +334,6 @@ func (client VirtualHubsClient) ListSender(req *http.Request) (*http.Response, e func (client VirtualHubsClient) ListResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -412,6 +409,11 @@ func (client VirtualHubsClient) ListByResourceGroup(ctx context.Context, resourc result.lvhr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.lvhr.hasNextLink() && result.lvhr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -448,7 +450,6 @@ func (client VirtualHubsClient) ListByResourceGroupSender(req *http.Request) (*h func (client VirtualHubsClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -503,8 +504,8 @@ func (client VirtualHubsClient) UpdateTags(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -517,7 +518,7 @@ func (client VirtualHubsClient) UpdateTags(ctx context.Context, resourceGroupNam result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", nil, "Failure sending request") return } @@ -555,7 +556,10 @@ func (client VirtualHubsClient) UpdateTagsSender(req *http.Request) (future Virt if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -564,7 +568,6 @@ func (client VirtualHubsClient) UpdateTagsSender(req *http.Request) (future Virt func (client VirtualHubsClient) UpdateTagsResponder(resp *http.Response) (result VirtualHub, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkgatewayconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkgatewayconnections.go index b0a58ff25b75..9ee758bd48ec 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkgatewayconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkgatewayconnections.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context. ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -80,7 +69,7 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context. result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -118,7 +107,10 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateSender(req *h if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -127,7 +119,6 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateSender(req *h func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -144,8 +135,8 @@ func (client VirtualNetworkGatewayConnectionsClient) Delete(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -158,7 +149,7 @@ func (client VirtualNetworkGatewayConnectionsClient) Delete(ctx context.Context, result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Delete", nil, "Failure sending request") return } @@ -194,7 +185,10 @@ func (client VirtualNetworkGatewayConnectionsClient) DeleteSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -203,7 +197,6 @@ func (client VirtualNetworkGatewayConnectionsClient) DeleteSender(req *http.Requ func (client VirtualNetworkGatewayConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -241,6 +234,7 @@ func (client VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, re result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -278,7 +272,6 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSender(req *http.Request func (client VirtualNetworkGatewayConnectionsClient) GetResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -318,6 +311,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.Co result, err = client.GetSharedKeyResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", resp, "Failure responding to request") + return } return @@ -355,7 +349,6 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeySender(req *htt func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -395,6 +388,11 @@ func (client VirtualNetworkGatewayConnectionsClient) List(ctx context.Context, r result.vngclr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure responding to request") + return + } + if result.vngclr.hasNextLink() && result.vngclr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -431,7 +429,6 @@ func (client VirtualNetworkGatewayConnectionsClient) ListSender(req *http.Reques func (client VirtualNetworkGatewayConnectionsClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -489,8 +486,8 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.ResetSharedKey") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -512,7 +509,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. result, err = client.ResetSharedKeySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", nil, "Failure sending request") return } @@ -550,7 +547,10 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeySender(req *h if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -559,7 +559,6 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeySender(req *h func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(resp *http.Response) (result ConnectionResetSharedKey, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -580,8 +579,8 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(ctx context.Co ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.SetSharedKey") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -600,7 +599,7 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(ctx context.Co result, err = client.SetSharedKeySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", nil, "Failure sending request") return } @@ -638,7 +637,10 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeySender(req *htt if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -647,7 +649,6 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeySender(req *htt func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -665,8 +666,8 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTags(ctx context.Cont ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -679,7 +680,7 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTags(ctx context.Cont result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "UpdateTags", nil, "Failure sending request") return } @@ -717,7 +718,10 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsSender(req *http. if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -726,7 +730,6 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsSender(req *http. func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkgateways.go index c841611e5d01..021c6c043303 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkgateways.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, r ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -73,7 +62,7 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, r result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -111,7 +100,10 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Reques if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -120,7 +112,6 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Reques func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -137,8 +128,8 @@ func (client VirtualNetworkGatewaysClient) Delete(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -151,7 +142,7 @@ func (client VirtualNetworkGatewaysClient) Delete(ctx context.Context, resourceG result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", nil, "Failure sending request") return } @@ -187,7 +178,10 @@ func (client VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -196,7 +190,6 @@ func (client VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (futu func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -214,8 +207,8 @@ func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context. ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Generatevpnclientpackage") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -228,7 +221,7 @@ func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context. result, err = client.GeneratevpnclientpackageSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure sending request") return } @@ -266,7 +259,10 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *h if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -275,7 +271,6 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *h func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -294,8 +289,8 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Contex ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GenerateVpnProfile") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -308,7 +303,7 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Contex result, err = client.GenerateVpnProfileSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", nil, "Failure sending request") return } @@ -346,7 +341,10 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfileSender(req *http.Re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -355,7 +353,6 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfileSender(req *http.Re func (client VirtualNetworkGatewaysClient) GenerateVpnProfileResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -394,6 +391,7 @@ func (client VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGrou result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure responding to request") + return } return @@ -431,7 +429,6 @@ func (client VirtualNetworkGatewaysClient) GetSender(req *http.Request) (*http.R func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -450,8 +447,8 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutes(ctx context.Conte ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetAdvertisedRoutes") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -464,7 +461,7 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutes(ctx context.Conte result, err = client.GetAdvertisedRoutesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetAdvertisedRoutes", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetAdvertisedRoutes", nil, "Failure sending request") return } @@ -501,7 +498,10 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesSender(req *http.R if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -510,7 +510,6 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesSender(req *http.R func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesResponder(resp *http.Response) (result GatewayRouteListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -528,8 +527,8 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatus(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetBgpPeerStatus") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -542,7 +541,7 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatus(ctx context.Context, result, err = client.GetBgpPeerStatusSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetBgpPeerStatus", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetBgpPeerStatus", nil, "Failure sending request") return } @@ -581,7 +580,10 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -590,7 +592,6 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusSender(req *http.Requ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusResponder(resp *http.Response) (result BgpPeerStatusListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -608,8 +609,8 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutes(ctx context.Context, ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetLearnedRoutes") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -622,7 +623,7 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutes(ctx context.Context, result, err = client.GetLearnedRoutesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetLearnedRoutes", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetLearnedRoutes", nil, "Failure sending request") return } @@ -658,7 +659,10 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesSender(req *http.Requ if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -667,7 +671,6 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesSender(req *http.Requ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesResponder(resp *http.Response) (result GatewayRouteListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -685,8 +688,8 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealth(ctx cont ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetVpnclientConnectionHealth") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -699,7 +702,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealth(ctx cont result, err = client.GetVpnclientConnectionHealthSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientConnectionHealth", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientConnectionHealth", nil, "Failure sending request") return } @@ -735,7 +738,10 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthSender(re if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -744,7 +750,6 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthSender(re func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthResponder(resp *http.Response) (result VpnClientConnectionHealthDetailListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -763,8 +768,8 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParameters(ctx conte ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetVpnclientIpsecParameters") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -777,7 +782,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParameters(ctx conte result, err = client.GetVpnclientIpsecParametersSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientIpsecParameters", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientIpsecParameters", nil, "Failure sending request") return } @@ -813,7 +818,10 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersSender(req if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -822,7 +830,6 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersSender(req func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersResponder(resp *http.Response) (result VpnClientIPsecParameters, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -840,8 +847,8 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.C ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetVpnProfilePackageURL") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -854,7 +861,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.C result, err = client.GetVpnProfilePackageURLSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnProfilePackageURL", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnProfilePackageURL", nil, "Failure sending request") return } @@ -890,7 +897,10 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLSender(req *ht if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -899,7 +909,6 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLSender(req *ht func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -938,6 +947,11 @@ func (client VirtualNetworkGatewaysClient) List(ctx context.Context, resourceGro result.vnglr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to request") + return + } + if result.vnglr.hasNextLink() && result.vnglr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -974,7 +988,6 @@ func (client VirtualNetworkGatewaysClient) ListSender(req *http.Request) (*http. func (client VirtualNetworkGatewaysClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1051,6 +1064,11 @@ func (client VirtualNetworkGatewaysClient) ListConnections(ctx context.Context, result.vnglcr, err = client.ListConnectionsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure responding to request") + return + } + if result.vnglcr.hasNextLink() && result.vnglcr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -1088,7 +1106,6 @@ func (client VirtualNetworkGatewaysClient) ListConnectionsSender(req *http.Reque func (client VirtualNetworkGatewaysClient) ListConnectionsResponder(resp *http.Response) (result VirtualNetworkGatewayListConnectionsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1144,8 +1161,8 @@ func (client VirtualNetworkGatewaysClient) Reset(ctx context.Context, resourceGr ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Reset") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1158,7 +1175,7 @@ func (client VirtualNetworkGatewaysClient) Reset(ctx context.Context, resourceGr result, err = client.ResetSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure sending request") return } @@ -1197,7 +1214,10 @@ func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (futur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1206,7 +1226,6 @@ func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (futur func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1224,8 +1243,8 @@ func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKey(ctx context.C ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.ResetVpnClientSharedKey") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1238,7 +1257,7 @@ func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKey(ctx context.C result, err = client.ResetVpnClientSharedKeySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ResetVpnClientSharedKey", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ResetVpnClientSharedKey", nil, "Failure sending request") return } @@ -1274,7 +1293,10 @@ func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeySender(req *ht if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1283,7 +1305,6 @@ func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeySender(req *ht func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1302,8 +1323,8 @@ func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParameters(ctx conte ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.SetVpnclientIpsecParameters") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1323,7 +1344,7 @@ func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParameters(ctx conte result, err = client.SetVpnclientIpsecParametersSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SetVpnclientIpsecParameters", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SetVpnclientIpsecParameters", nil, "Failure sending request") return } @@ -1361,7 +1382,10 @@ func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersSender(req if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1370,7 +1394,6 @@ func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersSender(req func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersResponder(resp *http.Response) (result VpnClientIPsecParameters, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1409,6 +1432,7 @@ func (client VirtualNetworkGatewaysClient) SupportedVpnDevices(ctx context.Conte result, err = client.SupportedVpnDevicesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", resp, "Failure responding to request") + return } return @@ -1446,7 +1470,6 @@ func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesSender(req *http.R func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -1464,8 +1487,8 @@ func (client VirtualNetworkGatewaysClient) UpdateTags(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1478,7 +1501,7 @@ func (client VirtualNetworkGatewaysClient) UpdateTags(ctx context.Context, resou result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "UpdateTags", nil, "Failure sending request") return } @@ -1516,7 +1539,10 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1525,7 +1551,6 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsSender(req *http.Request) ( func (client VirtualNetworkGatewaysClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1566,6 +1591,7 @@ func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScript(ctx cont result, err = client.VpnDeviceConfigurationScriptResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", resp, "Failure responding to request") + return } return @@ -1605,7 +1631,6 @@ func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptSender(re func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkpeerings.go index bd0380b24fa7..4f88aa1ca042 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworkpeerings.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -54,8 +43,8 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, r ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -68,7 +57,7 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, r result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -107,7 +96,10 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdateSender(req *http.Reques if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -116,7 +108,6 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdateSender(req *http.Reques func (client VirtualNetworkPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -134,8 +125,8 @@ func (client VirtualNetworkPeeringsClient) Delete(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -148,7 +139,7 @@ func (client VirtualNetworkPeeringsClient) Delete(ctx context.Context, resourceG result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Delete", nil, "Failure sending request") return } @@ -185,7 +176,10 @@ func (client VirtualNetworkPeeringsClient) DeleteSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -194,7 +188,6 @@ func (client VirtualNetworkPeeringsClient) DeleteSender(req *http.Request) (futu func (client VirtualNetworkPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -233,6 +226,7 @@ func (client VirtualNetworkPeeringsClient) Get(ctx context.Context, resourceGrou result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", resp, "Failure responding to request") + return } return @@ -271,7 +265,6 @@ func (client VirtualNetworkPeeringsClient) GetSender(req *http.Request) (*http.R func (client VirtualNetworkPeeringsClient) GetResponder(resp *http.Response) (result VirtualNetworkPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -311,6 +304,11 @@ func (client VirtualNetworkPeeringsClient) List(ctx context.Context, resourceGro result.vnplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure responding to request") + return + } + if result.vnplr.hasNextLink() && result.vnplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -348,7 +346,6 @@ func (client VirtualNetworkPeeringsClient) ListSender(req *http.Request) (*http. func (client VirtualNetworkPeeringsClient) ListResponder(resp *http.Response) (result VirtualNetworkPeeringListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworks.go index 48350c1d1a12..0760bc1a23ae 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworks.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,7 @@ func (client VirtualNetworksClient) CheckIPAddressAvailability(ctx context.Conte result, err = client.CheckIPAddressAvailabilityResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", resp, "Failure responding to request") + return } return @@ -111,7 +101,6 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilitySender(req *http.R func (client VirtualNetworksClient) CheckIPAddressAvailabilityResponder(resp *http.Response) (result IPAddressAvailabilityResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -129,8 +118,8 @@ func (client VirtualNetworksClient) CreateOrUpdate(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -143,7 +132,7 @@ func (client VirtualNetworksClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -181,7 +170,10 @@ func (client VirtualNetworksClient) CreateOrUpdateSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -190,7 +182,6 @@ func (client VirtualNetworksClient) CreateOrUpdateSender(req *http.Request) (fut func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetwork, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,8 +198,8 @@ func (client VirtualNetworksClient) Delete(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -221,7 +212,7 @@ func (client VirtualNetworksClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Delete", nil, "Failure sending request") return } @@ -257,7 +248,10 @@ func (client VirtualNetworksClient) DeleteSender(req *http.Request) (future Virt if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -266,7 +260,6 @@ func (client VirtualNetworksClient) DeleteSender(req *http.Request) (future Virt func (client VirtualNetworksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -305,6 +298,7 @@ func (client VirtualNetworksClient) Get(ctx context.Context, resourceGroupName s result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", resp, "Failure responding to request") + return } return @@ -345,7 +339,6 @@ func (client VirtualNetworksClient) GetSender(req *http.Request) (*http.Response func (client VirtualNetworksClient) GetResponder(resp *http.Response) (result VirtualNetwork, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -384,6 +377,11 @@ func (client VirtualNetworksClient) List(ctx context.Context, resourceGroupName result.vnlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure responding to request") + return + } + if result.vnlr.hasNextLink() && result.vnlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -420,7 +418,6 @@ func (client VirtualNetworksClient) ListSender(req *http.Request) (*http.Respons func (client VirtualNetworksClient) ListResponder(resp *http.Response) (result VirtualNetworkListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -494,6 +491,11 @@ func (client VirtualNetworksClient) ListAll(ctx context.Context) (result Virtual result.vnlr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure responding to request") + return + } + if result.vnlr.hasNextLink() && result.vnlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -529,7 +531,6 @@ func (client VirtualNetworksClient) ListAllSender(req *http.Request) (*http.Resp func (client VirtualNetworksClient) ListAllResponder(resp *http.Response) (result VirtualNetworkListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -606,6 +607,11 @@ func (client VirtualNetworksClient) ListUsage(ctx context.Context, resourceGroup result.vnlur, err = client.ListUsageResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure responding to request") + return + } + if result.vnlur.hasNextLink() && result.vnlur.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -643,7 +649,6 @@ func (client VirtualNetworksClient) ListUsageSender(req *http.Request) (*http.Re func (client VirtualNetworksClient) ListUsageResponder(resp *http.Response) (result VirtualNetworkListUsageResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -698,8 +703,8 @@ func (client VirtualNetworksClient) UpdateTags(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -712,7 +717,7 @@ func (client VirtualNetworksClient) UpdateTags(ctx context.Context, resourceGrou result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "UpdateTags", nil, "Failure sending request") return } @@ -750,7 +755,10 @@ func (client VirtualNetworksClient) UpdateTagsSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -759,7 +767,6 @@ func (client VirtualNetworksClient) UpdateTagsSender(req *http.Request) (future func (client VirtualNetworksClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetwork, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworktaps.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworktaps.go index d92b7724cb84..a70474f5dcbe 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworktaps.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualnetworktaps.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client VirtualNetworkTapsClient) CreateOrUpdate(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -98,7 +87,7 @@ func (client VirtualNetworkTapsClient) CreateOrUpdate(ctx context.Context, resou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -136,7 +125,10 @@ func (client VirtualNetworkTapsClient) CreateOrUpdateSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -145,7 +137,6 @@ func (client VirtualNetworkTapsClient) CreateOrUpdateSender(req *http.Request) ( func (client VirtualNetworkTapsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkTap, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -162,8 +153,8 @@ func (client VirtualNetworkTapsClient) Delete(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -176,7 +167,7 @@ func (client VirtualNetworkTapsClient) Delete(ctx context.Context, resourceGroup result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Delete", nil, "Failure sending request") return } @@ -212,7 +203,10 @@ func (client VirtualNetworkTapsClient) DeleteSender(req *http.Request) (future V if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -221,7 +215,6 @@ func (client VirtualNetworkTapsClient) DeleteSender(req *http.Request) (future V func (client VirtualNetworkTapsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -259,6 +252,7 @@ func (client VirtualNetworkTapsClient) Get(ctx context.Context, resourceGroupNam result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Get", resp, "Failure responding to request") + return } return @@ -296,7 +290,6 @@ func (client VirtualNetworkTapsClient) GetSender(req *http.Request) (*http.Respo func (client VirtualNetworkTapsClient) GetResponder(resp *http.Response) (result VirtualNetworkTap, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -333,6 +326,11 @@ func (client VirtualNetworkTapsClient) ListAll(ctx context.Context) (result Virt result.vntlr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListAll", resp, "Failure responding to request") + return + } + if result.vntlr.hasNextLink() && result.vntlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -368,7 +366,6 @@ func (client VirtualNetworkTapsClient) ListAllSender(req *http.Request) (*http.R func (client VirtualNetworkTapsClient) ListAllResponder(resp *http.Response) (result VirtualNetworkTapListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -444,6 +441,11 @@ func (client VirtualNetworkTapsClient) ListByResourceGroup(ctx context.Context, result.vntlr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.vntlr.hasNextLink() && result.vntlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -480,7 +482,6 @@ func (client VirtualNetworkTapsClient) ListByResourceGroupSender(req *http.Reque func (client VirtualNetworkTapsClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualNetworkTapListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -535,8 +536,8 @@ func (client VirtualNetworkTapsClient) UpdateTags(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -549,7 +550,7 @@ func (client VirtualNetworkTapsClient) UpdateTags(ctx context.Context, resourceG result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "UpdateTags", nil, "Failure sending request") return } @@ -587,7 +588,10 @@ func (client VirtualNetworkTapsClient) UpdateTagsSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -596,7 +600,6 @@ func (client VirtualNetworkTapsClient) UpdateTagsSender(req *http.Request) (futu func (client VirtualNetworkTapsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkTap, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualwans.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualwans.go index afbb5e75ee5c..ed22b5d5280e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualwans.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/virtualwans.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client VirtualWansClient) CreateOrUpdate(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client VirtualWansClient) CreateOrUpdate(ctx context.Context, resourceGrou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client VirtualWansClient) CreateOrUpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client VirtualWansClient) CreateOrUpdateSender(req *http.Request) (future func (client VirtualWansClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualWAN, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client VirtualWansClient) Delete(ctx context.Context, resourceGroupName st ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client VirtualWansClient) Delete(ctx context.Context, resourceGroupName st result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client VirtualWansClient) DeleteSender(req *http.Request) (future VirtualW if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client VirtualWansClient) DeleteSender(req *http.Request) (future VirtualW func (client VirtualWansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client VirtualWansClient) Get(ctx context.Context, resourceGroupName strin result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Get", resp, "Failure responding to request") + return } return @@ -264,7 +258,6 @@ func (client VirtualWansClient) GetSender(req *http.Request) (*http.Response, er func (client VirtualWansClient) GetResponder(resp *http.Response) (result VirtualWAN, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -301,6 +294,11 @@ func (client VirtualWansClient) List(ctx context.Context) (result ListVirtualWAN result.lvwnr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "List", resp, "Failure responding to request") + return + } + if result.lvwnr.hasNextLink() && result.lvwnr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -336,7 +334,6 @@ func (client VirtualWansClient) ListSender(req *http.Request) (*http.Response, e func (client VirtualWansClient) ListResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -412,6 +409,11 @@ func (client VirtualWansClient) ListByResourceGroup(ctx context.Context, resourc result.lvwnr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.lvwnr.hasNextLink() && result.lvwnr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -448,7 +450,6 @@ func (client VirtualWansClient) ListByResourceGroupSender(req *http.Request) (*h func (client VirtualWansClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -503,8 +504,8 @@ func (client VirtualWansClient) UpdateTags(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -517,7 +518,7 @@ func (client VirtualWansClient) UpdateTags(ctx context.Context, resourceGroupNam result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "UpdateTags", nil, "Failure sending request") return } @@ -555,7 +556,10 @@ func (client VirtualWansClient) UpdateTagsSender(req *http.Request) (future Virt if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -564,7 +568,6 @@ func (client VirtualWansClient) UpdateTagsSender(req *http.Request) (future Virt func (client VirtualWansClient) UpdateTagsResponder(resp *http.Response) (result VirtualWAN, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnconnections.go index df32537c53d9..a64a828bb3f6 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnconnections.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client VpnConnectionsClient) CreateOrUpdate(ctx context.Context, resourceG ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -67,7 +56,7 @@ func (client VpnConnectionsClient) CreateOrUpdate(ctx context.Context, resourceG result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -107,7 +96,10 @@ func (client VpnConnectionsClient) CreateOrUpdateSender(req *http.Request) (futu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -116,7 +108,6 @@ func (client VpnConnectionsClient) CreateOrUpdateSender(req *http.Request) (futu func (client VpnConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VpnConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -134,8 +125,8 @@ func (client VpnConnectionsClient) Delete(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -148,7 +139,7 @@ func (client VpnConnectionsClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Delete", nil, "Failure sending request") return } @@ -185,7 +176,10 @@ func (client VpnConnectionsClient) DeleteSender(req *http.Request) (future VpnCo if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -194,7 +188,6 @@ func (client VpnConnectionsClient) DeleteSender(req *http.Request) (future VpnCo func (client VpnConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -233,6 +226,7 @@ func (client VpnConnectionsClient) Get(ctx context.Context, resourceGroupName st result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -271,7 +265,6 @@ func (client VpnConnectionsClient) GetSender(req *http.Request) (*http.Response, func (client VpnConnectionsClient) GetResponder(resp *http.Response) (result VpnConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -311,6 +304,11 @@ func (client VpnConnectionsClient) ListByVpnGateway(ctx context.Context, resourc result.lvcr, err = client.ListByVpnGatewayResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", resp, "Failure responding to request") + return + } + if result.lvcr.hasNextLink() && result.lvcr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -348,7 +346,6 @@ func (client VpnConnectionsClient) ListByVpnGatewaySender(req *http.Request) (*h func (client VpnConnectionsClient) ListByVpnGatewayResponder(resp *http.Response) (result ListVpnConnectionsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpngateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpngateways.go index 7b62842cf7b0..675507453e06 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpngateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpngateways.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client VpnGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client VpnGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGrou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client VpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client VpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (future func (client VpnGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client VpnGatewaysClient) Delete(ctx context.Context, resourceGroupName st ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client VpnGatewaysClient) Delete(ctx context.Context, resourceGroupName st result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client VpnGatewaysClient) DeleteSender(req *http.Request) (future VpnGatew if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client VpnGatewaysClient) DeleteSender(req *http.Request) (future VpnGatew func (client VpnGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client VpnGatewaysClient) Get(ctx context.Context, resourceGroupName strin result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", resp, "Failure responding to request") + return } return @@ -264,7 +258,6 @@ func (client VpnGatewaysClient) GetSender(req *http.Request) (*http.Response, er func (client VpnGatewaysClient) GetResponder(resp *http.Response) (result VpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -301,6 +294,11 @@ func (client VpnGatewaysClient) List(ctx context.Context) (result ListVpnGateway result.lvgr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", resp, "Failure responding to request") + return + } + if result.lvgr.hasNextLink() && result.lvgr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -336,7 +334,6 @@ func (client VpnGatewaysClient) ListSender(req *http.Request) (*http.Response, e func (client VpnGatewaysClient) ListResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -412,6 +409,11 @@ func (client VpnGatewaysClient) ListByResourceGroup(ctx context.Context, resourc result.lvgr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.lvgr.hasNextLink() && result.lvgr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -448,7 +450,6 @@ func (client VpnGatewaysClient) ListByResourceGroupSender(req *http.Request) (*h func (client VpnGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -502,8 +503,8 @@ func (client VpnGatewaysClient) Reset(ctx context.Context, resourceGroupName str ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.Reset") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -516,7 +517,7 @@ func (client VpnGatewaysClient) Reset(ctx context.Context, resourceGroupName str result, err = client.ResetSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Reset", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Reset", nil, "Failure sending request") return } @@ -552,7 +553,10 @@ func (client VpnGatewaysClient) ResetSender(req *http.Request) (future VpnGatewa if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -561,7 +565,6 @@ func (client VpnGatewaysClient) ResetSender(req *http.Request) (future VpnGatewa func (client VpnGatewaysClient) ResetResponder(resp *http.Response) (result VpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -579,8 +582,8 @@ func (client VpnGatewaysClient) UpdateTags(ctx context.Context, resourceGroupNam ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -593,7 +596,7 @@ func (client VpnGatewaysClient) UpdateTags(ctx context.Context, resourceGroupNam result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "UpdateTags", nil, "Failure sending request") return } @@ -631,7 +634,10 @@ func (client VpnGatewaysClient) UpdateTagsSender(req *http.Request) (future VpnG if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -640,7 +646,6 @@ func (client VpnGatewaysClient) UpdateTagsSender(req *http.Request) (future VpnG func (client VpnGatewaysClient) UpdateTagsResponder(resp *http.Response) (result VpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnlinkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnlinkconnections.go index 994d65ea56f2..3fad7fe51080 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnlinkconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnlinkconnections.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -75,6 +64,11 @@ func (client VpnLinkConnectionsClient) ListByVpnConnection(ctx context.Context, result.lvslcr, err = client.ListByVpnConnectionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", resp, "Failure responding to request") + return + } + if result.lvslcr.hasNextLink() && result.lvslcr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -113,7 +107,6 @@ func (client VpnLinkConnectionsClient) ListByVpnConnectionSender(req *http.Reque func (client VpnLinkConnectionsClient) ListByVpnConnectionResponder(resp *http.Response) (result ListVpnSiteLinkConnectionsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitelinkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitelinkconnections.go index 040fe4f0908f..1e8b7ad67bbc 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitelinkconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitelinkconnections.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -75,6 +64,7 @@ func (client VpnSiteLinkConnectionsClient) Get(ctx context.Context, resourceGrou result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSiteLinkConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -114,7 +104,6 @@ func (client VpnSiteLinkConnectionsClient) GetSender(req *http.Request) (*http.R func (client VpnSiteLinkConnectionsClient) GetResponder(resp *http.Response) (result VpnSiteLinkConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitelinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitelinks.go index e29d38557fdb..d83c085329ae 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitelinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitelinks.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,7 @@ func (client VpnSiteLinksClient) Get(ctx context.Context, resourceGroupName stri result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "Get", resp, "Failure responding to request") + return } return @@ -111,7 +101,6 @@ func (client VpnSiteLinksClient) GetSender(req *http.Request) (*http.Response, e func (client VpnSiteLinksClient) GetResponder(resp *http.Response) (result VpnSiteLink, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -151,6 +140,11 @@ func (client VpnSiteLinksClient) ListByVpnSite(ctx context.Context, resourceGrou result.lvslr, err = client.ListByVpnSiteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "ListByVpnSite", resp, "Failure responding to request") + return + } + if result.lvslr.hasNextLink() && result.lvslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -188,7 +182,6 @@ func (client VpnSiteLinksClient) ListByVpnSiteSender(req *http.Request) (*http.R func (client VpnSiteLinksClient) ListByVpnSiteResponder(resp *http.Response) (result ListVpnSiteLinksResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsites.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsites.go index b8ccbd91b52a..28dd97d4db09 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsites.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsites.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,8 +40,8 @@ func (client VpnSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -65,7 +54,7 @@ func (client VpnSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -104,7 +93,10 @@ func (client VpnSitesClient) CreateOrUpdateSender(req *http.Request) (future Vpn if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -113,7 +105,6 @@ func (client VpnSitesClient) CreateOrUpdateSender(req *http.Request) (future Vpn func (client VpnSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnSite, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -130,8 +121,8 @@ func (client VpnSitesClient) Delete(ctx context.Context, resourceGroupName strin ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -144,7 +135,7 @@ func (client VpnSitesClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", nil, "Failure sending request") return } @@ -180,7 +171,10 @@ func (client VpnSitesClient) DeleteSender(req *http.Request) (future VpnSitesDel if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -189,7 +183,6 @@ func (client VpnSitesClient) DeleteSender(req *http.Request) (future VpnSitesDel func (client VpnSitesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -227,6 +220,7 @@ func (client VpnSitesClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure responding to request") + return } return @@ -264,7 +258,6 @@ func (client VpnSitesClient) GetSender(req *http.Request) (*http.Response, error func (client VpnSitesClient) GetResponder(resp *http.Response) (result VpnSite, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -301,6 +294,11 @@ func (client VpnSitesClient) List(ctx context.Context) (result ListVpnSitesResul result.lvsr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure responding to request") + return + } + if result.lvsr.hasNextLink() && result.lvsr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -336,7 +334,6 @@ func (client VpnSitesClient) ListSender(req *http.Request) (*http.Response, erro func (client VpnSitesClient) ListResponder(resp *http.Response) (result ListVpnSitesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -412,6 +409,11 @@ func (client VpnSitesClient) ListByResourceGroup(ctx context.Context, resourceGr result.lvsr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.lvsr.hasNextLink() && result.lvsr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -448,7 +450,6 @@ func (client VpnSitesClient) ListByResourceGroupSender(req *http.Request) (*http func (client VpnSitesClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnSitesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -503,8 +504,8 @@ func (client VpnSitesClient) UpdateTags(ctx context.Context, resourceGroupName s ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.UpdateTags") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -517,7 +518,7 @@ func (client VpnSitesClient) UpdateTags(ctx context.Context, resourceGroupName s result, err = client.UpdateTagsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", nil, "Failure sending request") return } @@ -555,7 +556,10 @@ func (client VpnSitesClient) UpdateTagsSender(req *http.Request) (future VpnSite if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -564,7 +568,6 @@ func (client VpnSitesClient) UpdateTagsSender(req *http.Request) (future VpnSite func (client VpnSitesClient) UpdateTagsResponder(resp *http.Response) (result VpnSite, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitesconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitesconfiguration.go index 2c03500d6111..c797858acda2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitesconfiguration.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/vpnsitesconfiguration.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client VpnSitesConfigurationClient) Download(ctx context.Context, resource ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesConfigurationClient.Download") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -73,7 +62,7 @@ func (client VpnSitesConfigurationClient) Download(ctx context.Context, resource result, err = client.DownloadSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationClient", "Download", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationClient", "Download", nil, "Failure sending request") return } @@ -111,7 +100,10 @@ func (client VpnSitesConfigurationClient) DownloadSender(req *http.Request) (fut if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -120,7 +112,6 @@ func (client VpnSitesConfigurationClient) DownloadSender(req *http.Request) (fut func (client VpnSitesConfigurationClient) DownloadResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/watchers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/watchers.go index bd9125a5072f..43a9eed3b9dd 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/watchers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/watchers.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -53,8 +42,8 @@ func (client WatchersClient) CheckConnectivity(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.CheckConnectivity") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -75,7 +64,7 @@ func (client WatchersClient) CheckConnectivity(ctx context.Context, resourceGrou result, err = client.CheckConnectivitySender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CheckConnectivity", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "CheckConnectivity", nil, "Failure sending request") return } @@ -113,7 +102,10 @@ func (client WatchersClient) CheckConnectivitySender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -122,7 +114,6 @@ func (client WatchersClient) CheckConnectivitySender(req *http.Request) (future func (client WatchersClient) CheckConnectivityResponder(resp *http.Response) (result ConnectivityInformation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -162,6 +153,7 @@ func (client WatchersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WatchersClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -201,7 +193,6 @@ func (client WatchersClient) CreateOrUpdateSender(req *http.Request) (*http.Resp func (client WatchersClient) CreateOrUpdateResponder(resp *http.Response) (result Watcher, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -218,8 +209,8 @@ func (client WatchersClient) Delete(ctx context.Context, resourceGroupName strin ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -232,7 +223,7 @@ func (client WatchersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "Delete", nil, "Failure sending request") return } @@ -268,7 +259,10 @@ func (client WatchersClient) DeleteSender(req *http.Request) (future WatchersDel if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -277,7 +271,6 @@ func (client WatchersClient) DeleteSender(req *http.Request) (future WatchersDel func (client WatchersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -315,6 +308,7 @@ func (client WatchersClient) Get(ctx context.Context, resourceGroupName string, result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WatchersClient", "Get", resp, "Failure responding to request") + return } return @@ -352,7 +346,6 @@ func (client WatchersClient) GetSender(req *http.Request) (*http.Response, error func (client WatchersClient) GetResponder(resp *http.Response) (result Watcher, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -371,8 +364,8 @@ func (client WatchersClient) GetAzureReachabilityReport(ctx context.Context, res ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetAzureReachabilityReport") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -394,7 +387,7 @@ func (client WatchersClient) GetAzureReachabilityReport(ctx context.Context, res result, err = client.GetAzureReachabilityReportSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetAzureReachabilityReport", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetAzureReachabilityReport", nil, "Failure sending request") return } @@ -432,7 +425,10 @@ func (client WatchersClient) GetAzureReachabilityReportSender(req *http.Request) if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -441,7 +437,6 @@ func (client WatchersClient) GetAzureReachabilityReportSender(req *http.Request) func (client WatchersClient) GetAzureReachabilityReportResponder(resp *http.Response) (result AzureReachabilityReport, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -459,8 +454,8 @@ func (client WatchersClient) GetFlowLogStatus(ctx context.Context, resourceGroup ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetFlowLogStatus") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -479,7 +474,7 @@ func (client WatchersClient) GetFlowLogStatus(ctx context.Context, resourceGroup result, err = client.GetFlowLogStatusSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetFlowLogStatus", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetFlowLogStatus", nil, "Failure sending request") return } @@ -517,7 +512,10 @@ func (client WatchersClient) GetFlowLogStatusSender(req *http.Request) (future W if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -526,7 +524,6 @@ func (client WatchersClient) GetFlowLogStatusSender(req *http.Request) (future W func (client WatchersClient) GetFlowLogStatusResponder(resp *http.Response) (result FlowLogInformation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -544,8 +541,8 @@ func (client WatchersClient) GetNetworkConfigurationDiagnostic(ctx context.Conte ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetNetworkConfigurationDiagnostic") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -565,7 +562,7 @@ func (client WatchersClient) GetNetworkConfigurationDiagnostic(ctx context.Conte result, err = client.GetNetworkConfigurationDiagnosticSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNetworkConfigurationDiagnostic", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNetworkConfigurationDiagnostic", nil, "Failure sending request") return } @@ -603,7 +600,10 @@ func (client WatchersClient) GetNetworkConfigurationDiagnosticSender(req *http.R if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -612,7 +612,6 @@ func (client WatchersClient) GetNetworkConfigurationDiagnosticSender(req *http.R func (client WatchersClient) GetNetworkConfigurationDiagnosticResponder(resp *http.Response) (result ConfigurationDiagnosticResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -630,8 +629,8 @@ func (client WatchersClient) GetNextHop(ctx context.Context, resourceGroupName s ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetNextHop") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -652,7 +651,7 @@ func (client WatchersClient) GetNextHop(ctx context.Context, resourceGroupName s result, err = client.GetNextHopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNextHop", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNextHop", nil, "Failure sending request") return } @@ -690,7 +689,10 @@ func (client WatchersClient) GetNextHopSender(req *http.Request) (future Watcher if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -699,7 +701,6 @@ func (client WatchersClient) GetNextHopSender(req *http.Request) (future Watcher func (client WatchersClient) GetNextHopResponder(resp *http.Response) (result NextHopResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -739,6 +740,7 @@ func (client WatchersClient) GetTopology(ctx context.Context, resourceGroupName result, err = client.GetTopologyResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTopology", resp, "Failure responding to request") + return } return @@ -778,7 +780,6 @@ func (client WatchersClient) GetTopologySender(req *http.Request) (*http.Respons func (client WatchersClient) GetTopologyResponder(resp *http.Response) (result Topology, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -796,8 +797,8 @@ func (client WatchersClient) GetTroubleshooting(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetTroubleshooting") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -820,7 +821,7 @@ func (client WatchersClient) GetTroubleshooting(ctx context.Context, resourceGro result, err = client.GetTroubleshootingSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshooting", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshooting", nil, "Failure sending request") return } @@ -858,7 +859,10 @@ func (client WatchersClient) GetTroubleshootingSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -867,7 +871,6 @@ func (client WatchersClient) GetTroubleshootingSender(req *http.Request) (future func (client WatchersClient) GetTroubleshootingResponder(resp *http.Response) (result TroubleshootingResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -885,8 +888,8 @@ func (client WatchersClient) GetTroubleshootingResult(ctx context.Context, resou ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetTroubleshootingResult") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -905,7 +908,7 @@ func (client WatchersClient) GetTroubleshootingResult(ctx context.Context, resou result, err = client.GetTroubleshootingResultSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshootingResult", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshootingResult", nil, "Failure sending request") return } @@ -943,7 +946,10 @@ func (client WatchersClient) GetTroubleshootingResultSender(req *http.Request) ( if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -952,7 +958,6 @@ func (client WatchersClient) GetTroubleshootingResultSender(req *http.Request) ( func (client WatchersClient) GetTroubleshootingResultResponder(resp *http.Response) (result TroubleshootingResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -970,8 +975,8 @@ func (client WatchersClient) GetVMSecurityRules(ctx context.Context, resourceGro ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetVMSecurityRules") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -990,7 +995,7 @@ func (client WatchersClient) GetVMSecurityRules(ctx context.Context, resourceGro result, err = client.GetVMSecurityRulesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetVMSecurityRules", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetVMSecurityRules", nil, "Failure sending request") return } @@ -1028,7 +1033,10 @@ func (client WatchersClient) GetVMSecurityRulesSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1037,7 +1045,6 @@ func (client WatchersClient) GetVMSecurityRulesSender(req *http.Request) (future func (client WatchersClient) GetVMSecurityRulesResponder(resp *http.Response) (result SecurityGroupViewResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1075,6 +1082,7 @@ func (client WatchersClient) List(ctx context.Context, resourceGroupName string) result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WatchersClient", "List", resp, "Failure responding to request") + return } return @@ -1111,7 +1119,6 @@ func (client WatchersClient) ListSender(req *http.Request) (*http.Response, erro func (client WatchersClient) ListResponder(resp *http.Response) (result WatcherListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1147,6 +1154,7 @@ func (client WatchersClient) ListAll(ctx context.Context) (result WatcherListRes result, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAll", resp, "Failure responding to request") + return } return @@ -1182,7 +1190,6 @@ func (client WatchersClient) ListAllSender(req *http.Request) (*http.Response, e func (client WatchersClient) ListAllResponder(resp *http.Response) (result WatcherListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1200,8 +1207,8 @@ func (client WatchersClient) ListAvailableProviders(ctx context.Context, resourc ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.ListAvailableProviders") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1214,7 +1221,7 @@ func (client WatchersClient) ListAvailableProviders(ctx context.Context, resourc result, err = client.ListAvailableProvidersSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAvailableProviders", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAvailableProviders", nil, "Failure sending request") return } @@ -1252,7 +1259,10 @@ func (client WatchersClient) ListAvailableProvidersSender(req *http.Request) (fu if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1261,7 +1271,6 @@ func (client WatchersClient) ListAvailableProvidersSender(req *http.Request) (fu func (client WatchersClient) ListAvailableProvidersResponder(resp *http.Response) (result AvailableProvidersList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1279,8 +1288,8 @@ func (client WatchersClient) SetFlowLogConfiguration(ctx context.Context, resour ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.SetFlowLogConfiguration") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1311,7 +1320,7 @@ func (client WatchersClient) SetFlowLogConfiguration(ctx context.Context, resour result, err = client.SetFlowLogConfigurationSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "SetFlowLogConfiguration", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "SetFlowLogConfiguration", nil, "Failure sending request") return } @@ -1349,7 +1358,10 @@ func (client WatchersClient) SetFlowLogConfigurationSender(req *http.Request) (f if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1358,7 +1370,6 @@ func (client WatchersClient) SetFlowLogConfigurationSender(req *http.Request) (f func (client WatchersClient) SetFlowLogConfigurationResponder(resp *http.Response) (result FlowLogInformation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1398,6 +1409,7 @@ func (client WatchersClient) UpdateTags(ctx context.Context, resourceGroupName s result, err = client.UpdateTagsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WatchersClient", "UpdateTags", resp, "Failure responding to request") + return } return @@ -1437,7 +1449,6 @@ func (client WatchersClient) UpdateTagsSender(req *http.Request) (*http.Response func (client WatchersClient) UpdateTagsResponder(resp *http.Response) (result Watcher, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1455,8 +1466,8 @@ func (client WatchersClient) VerifyIPFlow(ctx context.Context, resourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.VerifyIPFlow") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1479,7 +1490,7 @@ func (client WatchersClient) VerifyIPFlow(ctx context.Context, resourceGroupName result, err = client.VerifyIPFlowSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "VerifyIPFlow", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WatchersClient", "VerifyIPFlow", nil, "Failure sending request") return } @@ -1517,7 +1528,10 @@ func (client WatchersClient) VerifyIPFlowSender(req *http.Request) (future Watch if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1526,7 +1540,6 @@ func (client WatchersClient) VerifyIPFlowSender(req *http.Request) (future Watch func (client WatchersClient) VerifyIPFlowResponder(resp *http.Response) (result VerificationIPFlowResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/webapplicationfirewallpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/webapplicationfirewallpolicies.go index 5e04b4783541..36ffcde1dab8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/webapplicationfirewallpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/webapplicationfirewallpolicies.go @@ -1,18 +1,7 @@ package network -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -81,6 +70,7 @@ func (client WebApplicationFirewallPoliciesClient) CreateOrUpdate(ctx context.Co result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -120,7 +110,6 @@ func (client WebApplicationFirewallPoliciesClient) CreateOrUpdateSender(req *htt func (client WebApplicationFirewallPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -137,8 +126,8 @@ func (client WebApplicationFirewallPoliciesClient) Delete(ctx context.Context, r ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -157,7 +146,7 @@ func (client WebApplicationFirewallPoliciesClient) Delete(ctx context.Context, r result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Delete", nil, "Failure sending request") return } @@ -193,7 +182,10 @@ func (client WebApplicationFirewallPoliciesClient) DeleteSender(req *http.Reques if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -202,7 +194,6 @@ func (client WebApplicationFirewallPoliciesClient) DeleteSender(req *http.Reques func (client WebApplicationFirewallPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -246,6 +237,7 @@ func (client WebApplicationFirewallPoliciesClient) Get(ctx context.Context, reso result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Get", resp, "Failure responding to request") + return } return @@ -283,7 +275,6 @@ func (client WebApplicationFirewallPoliciesClient) GetSender(req *http.Request) func (client WebApplicationFirewallPoliciesClient) GetResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -322,6 +313,11 @@ func (client WebApplicationFirewallPoliciesClient) List(ctx context.Context, res result.wafplr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.wafplr.hasNextLink() && result.wafplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -358,7 +354,6 @@ func (client WebApplicationFirewallPoliciesClient) ListSender(req *http.Request) func (client WebApplicationFirewallPoliciesClient) ListResponder(resp *http.Response) (result WebApplicationFirewallPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -432,6 +427,11 @@ func (client WebApplicationFirewallPoliciesClient) ListAll(ctx context.Context) result.wafplr, err = client.ListAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.wafplr.hasNextLink() && result.wafplr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -467,7 +467,6 @@ func (client WebApplicationFirewallPoliciesClient) ListAllSender(req *http.Reque func (client WebApplicationFirewallPoliciesClient) ListAllResponder(resp *http.Response) (result WebApplicationFirewallPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/CHANGELOG.md new file mode 100644 index 000000000000..024d27202151 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/CHANGELOG.md @@ -0,0 +1,18 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/resources/resource-manager/readme.md tag: `package-resources-2017-05` + +Code generator @microsoft.azure/autorest.go@2.1.178 + + +### New Funcs + +1. *CreateOrUpdateByIDFuture.UnmarshalJSON([]byte) error +1. *CreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *DeleteByIDFuture.UnmarshalJSON([]byte) error +1. *DeleteFuture.UnmarshalJSON([]byte) error +1. *DeploymentsCreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *DeploymentsDeleteFuture.UnmarshalJSON([]byte) error +1. *GroupsDeleteFuture.UnmarshalJSON([]byte) error +1. *MoveResourcesFuture.UnmarshalJSON([]byte) error +1. *UpdateByIDFuture.UnmarshalJSON([]byte) error +1. *UpdateFuture.UnmarshalJSON([]byte) error +1. *ValidateMoveResourcesFuture.UnmarshalJSON([]byte) error diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/client.go index c3f35599a776..68623ec9cc91 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/client.go @@ -3,19 +3,8 @@ // Provides operations for working with resources and resource groups. package resources -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deploymentoperations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deploymentoperations.go index cca1c62267d5..c488760e5cb7 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deploymentoperations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deploymentoperations.go @@ -1,18 +1,7 @@ package resources -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -87,6 +76,7 @@ func (client DeploymentOperationsClient) Get(ctx context.Context, resourceGroupN result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "Get", resp, "Failure responding to request") + return } return @@ -125,7 +115,6 @@ func (client DeploymentOperationsClient) GetSender(req *http.Request) (*http.Res func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (result DeploymentOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -178,6 +167,11 @@ func (client DeploymentOperationsClient) List(ctx context.Context, resourceGroup result.dolr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure responding to request") + return + } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -218,7 +212,6 @@ func (client DeploymentOperationsClient) ListSender(req *http.Request) (*http.Re func (client DeploymentOperationsClient) ListResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deployments.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deployments.go index 3146ab9f26d5..f3adc571accd 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deployments.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deployments.go @@ -1,18 +1,7 @@ package resources -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -72,6 +61,7 @@ func (client DeploymentsClient) CalculateTemplateHash(ctx context.Context, templ result, err = client.CalculateTemplateHashResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CalculateTemplateHash", resp, "Failure responding to request") + return } return @@ -105,7 +95,6 @@ func (client DeploymentsClient) CalculateTemplateHashSender(req *http.Request) ( func (client DeploymentsClient) CalculateTemplateHashResponder(resp *http.Response) (result TemplateHashResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -158,6 +147,7 @@ func (client DeploymentsClient) Cancel(ctx context.Context, resourceGroupName st result, err = client.CancelResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Cancel", resp, "Failure responding to request") + return } return @@ -195,7 +185,6 @@ func (client DeploymentsClient) CancelSender(req *http.Request) (*http.Response, func (client DeploymentsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -246,6 +235,7 @@ func (client DeploymentsClient) CheckExistence(ctx context.Context, resourceGrou result, err = client.CheckExistenceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistence", resp, "Failure responding to request") + return } return @@ -283,7 +273,6 @@ func (client DeploymentsClient) CheckExistenceSender(req *http.Request) (*http.R func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -301,8 +290,8 @@ func (client DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -334,7 +323,7 @@ func (client DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGrou result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -372,7 +361,10 @@ func (client DeploymentsClient) CreateOrUpdateSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -381,7 +373,6 @@ func (client DeploymentsClient) CreateOrUpdateSender(req *http.Request) (future func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -405,8 +396,8 @@ func (client DeploymentsClient) Delete(ctx context.Context, resourceGroupName st ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -431,7 +422,7 @@ func (client DeploymentsClient) Delete(ctx context.Context, resourceGroupName st result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Delete", nil, "Failure sending request") return } @@ -467,7 +458,10 @@ func (client DeploymentsClient) DeleteSender(req *http.Request) (future Deployme if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -476,7 +470,6 @@ func (client DeploymentsClient) DeleteSender(req *http.Request) (future Deployme func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -526,6 +519,7 @@ func (client DeploymentsClient) ExportTemplate(ctx context.Context, resourceGrou result, err = client.ExportTemplateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", resp, "Failure responding to request") + return } return @@ -563,7 +557,6 @@ func (client DeploymentsClient) ExportTemplateSender(req *http.Request) (*http.R func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (result DeploymentExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -614,6 +607,7 @@ func (client DeploymentsClient) Get(ctx context.Context, resourceGroupName strin result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Get", resp, "Failure responding to request") + return } return @@ -651,7 +645,6 @@ func (client DeploymentsClient) GetSender(req *http.Request) (*http.Response, er func (client DeploymentsClient) GetResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -702,6 +695,11 @@ func (client DeploymentsClient) ListByResourceGroup(ctx context.Context, resourc result.dlr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -744,7 +742,6 @@ func (client DeploymentsClient) ListByResourceGroupSender(req *http.Request) (*h func (client DeploymentsClient) ListByResourceGroupResponder(resp *http.Response) (result DeploymentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -842,6 +839,7 @@ func (client DeploymentsClient) Validate(ctx context.Context, resourceGroupName result, err = client.ValidateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Validate", resp, "Failure responding to request") + return } return @@ -881,7 +879,6 @@ func (client DeploymentsClient) ValidateSender(req *http.Request) (*http.Respons func (client DeploymentsClient) ValidateResponder(resp *http.Response) (result DeploymentValidateResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/enums.go new file mode 100644 index 000000000000..8ae735f07feb --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/enums.go @@ -0,0 +1,35 @@ +package resources + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// DeploymentMode enumerates the values for deployment mode. +type DeploymentMode string + +const ( + // Complete ... + Complete DeploymentMode = "Complete" + // Incremental ... + Incremental DeploymentMode = "Incremental" +) + +// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type. +func PossibleDeploymentModeValues() []DeploymentMode { + return []DeploymentMode{Complete, Incremental} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{SystemAssigned} +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/groups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/groups.go index 2bf3bb986b31..8ce2479fca23 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/groups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/groups.go @@ -1,18 +1,7 @@ package resources -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -80,6 +69,7 @@ func (client GroupsClient) CheckExistence(ctx context.Context, resourceGroupName result, err = client.CheckExistenceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CheckExistence", resp, "Failure responding to request") + return } return @@ -116,7 +106,6 @@ func (client GroupsClient) CheckExistenceSender(req *http.Request) (*http.Respon func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -164,6 +153,7 @@ func (client GroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -203,7 +193,6 @@ func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Respon func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -220,8 +209,8 @@ func (client GroupsClient) Delete(ctx context.Context, resourceGroupName string) ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -242,7 +231,7 @@ func (client GroupsClient) Delete(ctx context.Context, resourceGroupName string) result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Delete", nil, "Failure sending request") return } @@ -277,7 +266,10 @@ func (client GroupsClient) DeleteSender(req *http.Request) (future GroupsDeleteF if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -286,7 +278,6 @@ func (client GroupsClient) DeleteSender(req *http.Request) (future GroupsDeleteF func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -332,6 +323,7 @@ func (client GroupsClient) ExportTemplate(ctx context.Context, resourceGroupName result, err = client.ExportTemplateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", resp, "Failure responding to request") + return } return @@ -370,7 +362,6 @@ func (client GroupsClient) ExportTemplateSender(req *http.Request) (*http.Respon func (client GroupsClient) ExportTemplateResponder(resp *http.Response) (result GroupExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +407,7 @@ func (client GroupsClient) Get(ctx context.Context, resourceGroupName string) (r result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Get", resp, "Failure responding to request") + return } return @@ -452,7 +444,6 @@ func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -492,6 +483,11 @@ func (client GroupsClient) List(ctx context.Context, filter string, top *int32) result.glr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure responding to request") + return + } + if result.glr.hasNextLink() && result.glr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -533,7 +529,6 @@ func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -618,6 +613,7 @@ func (client GroupsClient) Update(ctx context.Context, resourceGroupName string, result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Update", resp, "Failure responding to request") + return } return @@ -656,7 +652,6 @@ func (client GroupsClient) UpdateSender(req *http.Request) (*http.Response, erro func (client GroupsClient) UpdateResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go index 9434555ff898..cf6b3a1a3d85 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go @@ -1,18 +1,7 @@ package resources -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -31,34 +20,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources" -// DeploymentMode enumerates the values for deployment mode. -type DeploymentMode string - -const ( - // Complete ... - Complete DeploymentMode = "Complete" - // Incremental ... - Incremental DeploymentMode = "Incremental" -) - -// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type. -func PossibleDeploymentModeValues() []DeploymentMode { - return []DeploymentMode{Complete, Incremental} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // SystemAssigned ... - SystemAssigned ResourceIdentityType = "SystemAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{SystemAssigned} -} - // AliasPathType the type of the paths for alias. type AliasPathType struct { // Path - The path of an alias. @@ -93,12 +54,25 @@ type CloudError struct { // CreateOrUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type CreateOrUpdateByIDFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(Client) (GenericResource, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CreateOrUpdateByIDFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CreateOrUpdateByIDFuture.Result. +func (future *CreateOrUpdateByIDFuture) result(client Client) (gr GenericResource, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -122,12 +96,25 @@ func (future *CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResourc // CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type CreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(Client) (GenericResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *CreateOrUpdateFuture) Result(client Client) (gr GenericResource, err error) { +// result is the default implementation for CreateOrUpdateFuture.Result. +func (future *CreateOrUpdateFuture) result(client Client) (gr GenericResource, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -156,12 +143,25 @@ type DebugSetting struct { // DeleteByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation. type DeleteByIDFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(Client) (autorest.Response, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DeleteByIDFuture) Result(client Client) (ar autorest.Response, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DeleteByIDFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DeleteByIDFuture.Result. +func (future *DeleteByIDFuture) result(client Client) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -178,12 +178,25 @@ func (future *DeleteByIDFuture) Result(client Client) (ar autorest.Response, err // DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type DeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(Client) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DeleteFuture) Result(client Client) (ar autorest.Response, err error) { +// result is the default implementation for DeleteFuture.Result. +func (future *DeleteFuture) result(client Client) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -234,6 +247,18 @@ type DeploymentExtended struct { Properties *DeploymentPropertiesExtended `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentExtended. +func (de DeploymentExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if de.Name != nil { + objectMap["name"] = de.Name + } + if de.Properties != nil { + objectMap["properties"] = de.Properties + } + return json.Marshal(objectMap) +} + // DeploymentExtendedFilter deployment filter. type DeploymentExtendedFilter struct { // ProvisioningState - The provisioning state. @@ -249,6 +274,15 @@ type DeploymentListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentListResult. +func (dlr DeploymentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dlr.Value != nil { + objectMap["value"] = dlr.Value + } + return json.Marshal(objectMap) +} + // DeploymentListResultIterator provides access to a complete listing of DeploymentExtended values. type DeploymentListResultIterator struct { i int @@ -317,10 +351,15 @@ func (dlr DeploymentListResult) IsEmpty() bool { return dlr.Value == nil || len(*dlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dlr DeploymentListResult) hasNextLink() bool { + return dlr.NextLink != nil && len(*dlr.NextLink) != 0 +} + // deploymentListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dlr DeploymentListResult) deploymentListResultPreparer(ctx context.Context) (*http.Request, error) { - if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 { + if !dlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -348,11 +387,16 @@ func (page *DeploymentListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dlr) + if err != nil { + return err + } + page.dlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dlr = next return nil } @@ -382,8 +426,11 @@ func (page DeploymentListResultPage) Values() []DeploymentExtended { } // Creates a new instance of the DeploymentListResultPage type. -func NewDeploymentListResultPage(getNextPage func(context.Context, DeploymentListResult) (DeploymentListResult, error)) DeploymentListResultPage { - return DeploymentListResultPage{fn: getNextPage} +func NewDeploymentListResultPage(cur DeploymentListResult, getNextPage func(context.Context, DeploymentListResult) (DeploymentListResult, error)) DeploymentListResultPage { + return DeploymentListResultPage{ + fn: getNextPage, + dlr: cur, + } } // DeploymentOperation deployment operation information. @@ -397,6 +444,15 @@ type DeploymentOperation struct { Properties *DeploymentOperationProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentOperation. +func (do DeploymentOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if do.Properties != nil { + objectMap["properties"] = do.Properties + } + return json.Marshal(objectMap) +} + // DeploymentOperationProperties deployment operation properties. type DeploymentOperationProperties struct { // ProvisioningState - READ-ONLY; The state of the provisioning. @@ -426,6 +482,15 @@ type DeploymentOperationsListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentOperationsListResult. +func (dolr DeploymentOperationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dolr.Value != nil { + objectMap["value"] = dolr.Value + } + return json.Marshal(objectMap) +} + // DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation // values. type DeploymentOperationsListResultIterator struct { @@ -495,10 +560,15 @@ func (dolr DeploymentOperationsListResult) IsEmpty() bool { return dolr.Value == nil || len(*dolr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dolr DeploymentOperationsListResult) hasNextLink() bool { + return dolr.NextLink != nil && len(*dolr.NextLink) != 0 +} + // deploymentOperationsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer(ctx context.Context) (*http.Request, error) { - if dolr.NextLink == nil || len(to.String(dolr.NextLink)) < 1 { + if !dolr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -526,11 +596,16 @@ func (page *DeploymentOperationsListResultPage) NextWithContext(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dolr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dolr) + if err != nil { + return err + } + page.dolr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dolr = next return nil } @@ -560,8 +635,11 @@ func (page DeploymentOperationsListResultPage) Values() []DeploymentOperation { } // Creates a new instance of the DeploymentOperationsListResultPage type. -func NewDeploymentOperationsListResultPage(getNextPage func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)) DeploymentOperationsListResultPage { - return DeploymentOperationsListResultPage{fn: getNextPage} +func NewDeploymentOperationsListResultPage(cur DeploymentOperationsListResult, getNextPage func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)) DeploymentOperationsListResultPage { + return DeploymentOperationsListResultPage{ + fn: getNextPage, + dolr: cur, + } } // DeploymentProperties deployment properties. @@ -608,15 +686,61 @@ type DeploymentPropertiesExtended struct { DebugSetting *DebugSetting `json:"debugSetting,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentPropertiesExtended. +func (dpe DeploymentPropertiesExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpe.Outputs != nil { + objectMap["outputs"] = dpe.Outputs + } + if dpe.Providers != nil { + objectMap["providers"] = dpe.Providers + } + if dpe.Dependencies != nil { + objectMap["dependencies"] = dpe.Dependencies + } + if dpe.Template != nil { + objectMap["template"] = dpe.Template + } + if dpe.TemplateLink != nil { + objectMap["templateLink"] = dpe.TemplateLink + } + if dpe.Parameters != nil { + objectMap["parameters"] = dpe.Parameters + } + if dpe.ParametersLink != nil { + objectMap["parametersLink"] = dpe.ParametersLink + } + if dpe.Mode != "" { + objectMap["mode"] = dpe.Mode + } + if dpe.DebugSetting != nil { + objectMap["debugSetting"] = dpe.DebugSetting + } + return json.Marshal(objectMap) +} + // DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DeploymentsCreateOrUpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DeploymentsClient) (DeploymentExtended, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DeploymentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) (de DeploymentExtended, err error) { +// result is the default implementation for DeploymentsCreateOrUpdateFuture.Result. +func (future *DeploymentsCreateOrUpdateFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -640,12 +764,25 @@ func (future *DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) // DeploymentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DeploymentsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DeploymentsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DeploymentsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *DeploymentsDeleteFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) { +// result is the default implementation for DeploymentsDeleteFuture.Result. +func (future *DeploymentsDeleteFuture) result(client DeploymentsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -677,7 +814,8 @@ type ErrorAdditionalInfo struct { Info interface{} `json:"info,omitempty"` } -// ErrorResponse the resource management error response. +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.) type ErrorResponse struct { // Code - READ-ONLY; The error code. Code *string `json:"code,omitempty"` @@ -891,6 +1029,15 @@ type GroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for GroupListResult. +func (glr GroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if glr.Value != nil { + objectMap["value"] = glr.Value + } + return json.Marshal(objectMap) +} + // GroupListResultIterator provides access to a complete listing of Group values. type GroupListResultIterator struct { i int @@ -959,10 +1106,15 @@ func (glr GroupListResult) IsEmpty() bool { return glr.Value == nil || len(*glr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (glr GroupListResult) hasNextLink() bool { + return glr.NextLink != nil && len(*glr.NextLink) != 0 +} + // groupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (glr GroupListResult) groupListResultPreparer(ctx context.Context) (*http.Request, error) { - if glr.NextLink == nil || len(to.String(glr.NextLink)) < 1 { + if !glr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -990,11 +1142,16 @@ func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.glr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.glr) + if err != nil { + return err + } + page.glr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.glr = next return nil } @@ -1024,8 +1181,11 @@ func (page GroupListResultPage) Values() []Group { } // Creates a new instance of the GroupListResultPage type. -func NewGroupListResultPage(getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage { - return GroupListResultPage{fn: getNextPage} +func NewGroupListResultPage(cur GroupListResult, getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage { + return GroupListResultPage{ + fn: getNextPage, + glr: cur, + } } // GroupPatchable resource group information. @@ -1065,12 +1225,25 @@ type GroupProperties struct { // GroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type GroupsDeleteFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GroupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *GroupsDeleteFuture) Result(client GroupsClient) (ar autorest.Response, err error) { +// result is the default implementation for GroupsDeleteFuture.Result. +func (future *GroupsDeleteFuture) result(client GroupsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1101,6 +1274,15 @@ type Identity struct { Type ResourceIdentityType `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.Type != "" { + objectMap["type"] = i.Type + } + return json.Marshal(objectMap) +} + // ListResult list of resource groups. type ListResult struct { autorest.Response `json:"-"` @@ -1110,6 +1292,15 @@ type ListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ListResult. +func (lr ListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lr.Value != nil { + objectMap["value"] = lr.Value + } + return json.Marshal(objectMap) +} + // ListResultIterator provides access to a complete listing of GenericResourceExpanded values. type ListResultIterator struct { i int @@ -1178,10 +1369,15 @@ func (lr ListResult) IsEmpty() bool { return lr.Value == nil || len(*lr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lr ListResult) hasNextLink() bool { + return lr.NextLink != nil && len(*lr.NextLink) != 0 +} + // listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if !lr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1209,11 +1405,16 @@ func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lr = next return nil } @@ -1243,8 +1444,11 @@ func (page ListResultPage) Values() []GenericResourceExpanded { } // Creates a new instance of the ListResultPage type. -func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { - return ListResultPage{fn: getNextPage} +func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{ + fn: getNextPage, + lr: cur, + } } // ManagementErrorWithDetails the detailed error message of resource management. @@ -1270,12 +1474,25 @@ type MoveInfo struct { // MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type MoveResourcesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(Client) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MoveResourcesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *MoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) { +// result is the default implementation for MoveResourcesFuture.Result. +func (future *MoveResourcesFuture) result(client Client) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1325,6 +1542,15 @@ type Provider struct { ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"` } +// MarshalJSON is the custom marshaler for Provider. +func (p Provider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Namespace != nil { + objectMap["namespace"] = p.Namespace + } + return json.Marshal(objectMap) +} + // ProviderListResult list of resource providers. type ProviderListResult struct { autorest.Response `json:"-"` @@ -1334,6 +1560,15 @@ type ProviderListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ProviderListResult. +func (plr ProviderListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.Value != nil { + objectMap["value"] = plr.Value + } + return json.Marshal(objectMap) +} + // ProviderListResultIterator provides access to a complete listing of Provider values. type ProviderListResultIterator struct { i int @@ -1402,10 +1637,15 @@ func (plr ProviderListResult) IsEmpty() bool { return plr.Value == nil || len(*plr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (plr ProviderListResult) hasNextLink() bool { + return plr.NextLink != nil && len(*plr.NextLink) != 0 +} + // providerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (plr ProviderListResult) providerListResultPreparer(ctx context.Context) (*http.Request, error) { - if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + if !plr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1433,11 +1673,16 @@ func (page *ProviderListResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.plr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.plr = next return nil } @@ -1467,8 +1712,11 @@ func (page ProviderListResultPage) Values() []Provider { } // Creates a new instance of the ProviderListResultPage type. -func NewProviderListResultPage(getNextPage func(context.Context, ProviderListResult) (ProviderListResult, error)) ProviderListResultPage { - return ProviderListResultPage{fn: getNextPage} +func NewProviderListResultPage(cur ProviderListResult, getNextPage func(context.Context, ProviderListResult) (ProviderListResult, error)) ProviderListResultPage { + return ProviderListResultPage{ + fn: getNextPage, + plr: cur, + } } // ProviderOperationDisplayProperties resource provider operation's display properties. @@ -1589,6 +1837,21 @@ type TagDetails struct { Values *[]TagValue `json:"values,omitempty"` } +// MarshalJSON is the custom marshaler for TagDetails. +func (td TagDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if td.TagName != nil { + objectMap["tagName"] = td.TagName + } + if td.Count != nil { + objectMap["count"] = td.Count + } + if td.Values != nil { + objectMap["values"] = td.Values + } + return json.Marshal(objectMap) +} + // TagsListResult list of subscription tags. type TagsListResult struct { autorest.Response `json:"-"` @@ -1598,6 +1861,15 @@ type TagsListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for TagsListResult. +func (tlr TagsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tlr.Value != nil { + objectMap["value"] = tlr.Value + } + return json.Marshal(objectMap) +} + // TagsListResultIterator provides access to a complete listing of TagDetails values. type TagsListResultIterator struct { i int @@ -1666,10 +1938,15 @@ func (tlr TagsListResult) IsEmpty() bool { return tlr.Value == nil || len(*tlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (tlr TagsListResult) hasNextLink() bool { + return tlr.NextLink != nil && len(*tlr.NextLink) != 0 +} + // tagsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (tlr TagsListResult) tagsListResultPreparer(ctx context.Context) (*http.Request, error) { - if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { + if !tlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1697,11 +1974,16 @@ func (page *TagsListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.tlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.tlr) + if err != nil { + return err + } + page.tlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.tlr = next return nil } @@ -1731,8 +2013,11 @@ func (page TagsListResultPage) Values() []TagDetails { } // Creates a new instance of the TagsListResultPage type. -func NewTagsListResultPage(getNextPage func(context.Context, TagsListResult) (TagsListResult, error)) TagsListResultPage { - return TagsListResultPage{fn: getNextPage} +func NewTagsListResultPage(cur TagsListResult, getNextPage func(context.Context, TagsListResult) (TagsListResult, error)) TagsListResultPage { + return TagsListResultPage{ + fn: getNextPage, + tlr: cur, + } } // TagValue tag information. @@ -1746,6 +2031,18 @@ type TagValue struct { Count *TagCount `json:"count,omitempty"` } +// MarshalJSON is the custom marshaler for TagValue. +func (tv TagValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tv.TagValue != nil { + objectMap["tagValue"] = tv.TagValue + } + if tv.Count != nil { + objectMap["count"] = tv.Count + } + return json.Marshal(objectMap) +} + // TargetResource target resource. type TargetResource struct { // ID - The ID of the resource. @@ -1776,12 +2073,25 @@ type TemplateLink struct { // UpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation. type UpdateByIDFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(Client) (GenericResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *UpdateByIDFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *UpdateByIDFuture) Result(client Client) (gr GenericResource, err error) { +// result is the default implementation for UpdateByIDFuture.Result. +func (future *UpdateByIDFuture) result(client Client) (gr GenericResource, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1804,12 +2114,25 @@ func (future *UpdateByIDFuture) Result(client Client) (gr GenericResource, err e // UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type UpdateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(Client) (GenericResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *UpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *UpdateFuture) Result(client Client) (gr GenericResource, err error) { +// result is the default implementation for UpdateFuture.Result. +func (future *UpdateFuture) result(client Client) (gr GenericResource, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1833,12 +2156,25 @@ func (future *UpdateFuture) Result(client Client) (gr GenericResource, err error // ValidateMoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ValidateMoveResourcesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(Client) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ValidateMoveResourcesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ValidateMoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) { +// result is the default implementation for ValidateMoveResourcesFuture.Result. +func (future *ValidateMoveResourcesFuture) result(client Client) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/providers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/providers.go index f6f17c97ba01..129a99bda22e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/providers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/providers.go @@ -1,18 +1,7 @@ package resources -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -73,6 +62,7 @@ func (client ProvidersClient) Get(ctx context.Context, resourceProviderNamespace result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Get", resp, "Failure responding to request") + return } return @@ -112,7 +102,6 @@ func (client ProvidersClient) GetSender(req *http.Request) (*http.Response, erro func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -154,6 +143,11 @@ func (client ProvidersClient) List(ctx context.Context, top *int32, expand strin result.plr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure responding to request") + return + } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -195,7 +189,6 @@ func (client ProvidersClient) ListSender(req *http.Request) (*http.Response, err func (client ProvidersClient) ListResponder(resp *http.Response) (result ProviderListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -270,6 +263,7 @@ func (client ProvidersClient) Register(ctx context.Context, resourceProviderName result, err = client.RegisterResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Register", resp, "Failure responding to request") + return } return @@ -306,7 +300,6 @@ func (client ProvidersClient) RegisterSender(req *http.Request) (*http.Response, func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -344,6 +337,7 @@ func (client ProvidersClient) Unregister(ctx context.Context, resourceProviderNa result, err = client.UnregisterResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Unregister", resp, "Failure responding to request") + return } return @@ -380,7 +374,6 @@ func (client ProvidersClient) UnregisterSender(req *http.Request) (*http.Respons func (client ProvidersClient) UnregisterResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/resources.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/resources.go index 372114f85e0e..9488dea032c8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/resources.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/resources.go @@ -1,18 +1,7 @@ package resources -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -86,6 +75,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin result, err = client.CheckExistenceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", resp, "Failure responding to request") + return } return @@ -125,7 +115,6 @@ func (client Client) CheckExistenceSender(req *http.Request) (*http.Response, er func (client Client) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -165,6 +154,7 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string, result, err = client.CheckExistenceByIDResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", resp, "Failure responding to request") + return } return @@ -199,7 +189,6 @@ func (client Client) CheckExistenceByIDSender(req *http.Request) (*http.Response func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -220,8 +209,8 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -245,7 +234,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure sending request") return } @@ -285,7 +274,10 @@ func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpd if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -294,7 +286,6 @@ func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpd func (client Client) CreateOrUpdateResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -314,8 +305,8 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdateByID") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -335,7 +326,7 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, result, err = client.CreateOrUpdateByIDSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", nil, "Failure sending request") return } @@ -370,7 +361,10 @@ func (client Client) CreateOrUpdateByIDSender(req *http.Request) (future CreateO if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -379,7 +373,6 @@ func (client Client) CreateOrUpdateByIDSender(req *http.Request) (future CreateO func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -401,8 +394,8 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -423,7 +416,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.Client", "Delete", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure sending request") return } @@ -461,7 +454,10 @@ func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err e if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -470,7 +466,6 @@ func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err e func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -488,8 +483,8 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string, APIVersi ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteByID") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -502,7 +497,7 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string, APIVersi result, err = client.DeleteByIDSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", nil, "Failure sending request") return } @@ -535,7 +530,10 @@ func (client Client) DeleteByIDSender(req *http.Request) (future DeleteByIDFutur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -544,7 +542,6 @@ func (client Client) DeleteByIDSender(req *http.Request) (future DeleteByIDFutur func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -595,6 +592,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", resp, "Failure responding to request") + return } return @@ -634,7 +632,6 @@ func (client Client) GetSender(req *http.Request) (*http.Response, error) { func (client Client) GetResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -675,6 +672,7 @@ func (client Client) GetByID(ctx context.Context, resourceID string, APIVersion result, err = client.GetByIDResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", resp, "Failure responding to request") + return } return @@ -709,7 +707,6 @@ func (client Client) GetByIDSender(req *http.Request) (*http.Response, error) { func (client Client) GetByIDResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -751,6 +748,11 @@ func (client Client) List(ctx context.Context, filter string, expand string, top result.lr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure responding to request") + return + } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -795,7 +797,6 @@ func (client Client) ListSender(req *http.Request) (*http.Response, error) { func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -883,6 +884,11 @@ func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName result.lr, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -928,7 +934,6 @@ func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Respons func (client Client) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -984,8 +989,8 @@ func (client Client) MoveResources(ctx context.Context, sourceResourceGroupName ctx = tracing.StartSpan(ctx, fqdn+"/Client.MoveResources") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1006,7 +1011,7 @@ func (client Client) MoveResources(ctx context.Context, sourceResourceGroupName result, err = client.MoveResourcesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.Client", "MoveResources", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.Client", "MoveResources", nil, "Failure sending request") return } @@ -1043,7 +1048,10 @@ func (client Client) MoveResourcesSender(req *http.Request) (future MoveResource if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1052,7 +1060,6 @@ func (client Client) MoveResourcesSender(req *http.Request) (future MoveResource func (client Client) MoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1073,8 +1080,8 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1095,7 +1102,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.Client", "Update", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure sending request") return } @@ -1135,7 +1142,10 @@ func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err e if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1144,7 +1154,6 @@ func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err e func (client Client) UpdateResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1164,8 +1173,8 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, APIVersi ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateByID") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1178,7 +1187,7 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, APIVersi result, err = client.UpdateByIDSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", nil, "Failure sending request") return } @@ -1213,7 +1222,10 @@ func (client Client) UpdateByIDSender(req *http.Request) (future UpdateByIDFutur if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1222,7 +1234,6 @@ func (client Client) UpdateByIDSender(req *http.Request) (future UpdateByIDFutur func (client Client) UpdateByIDResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1243,8 +1254,8 @@ func (client Client) ValidateMoveResources(ctx context.Context, sourceResourceGr ctx = tracing.StartSpan(ctx, fqdn+"/Client.ValidateMoveResources") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1265,7 +1276,7 @@ func (client Client) ValidateMoveResources(ctx context.Context, sourceResourceGr result, err = client.ValidateMoveResourcesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "resources.Client", "ValidateMoveResources", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "resources.Client", "ValidateMoveResources", nil, "Failure sending request") return } @@ -1302,7 +1313,10 @@ func (client Client) ValidateMoveResourcesSender(req *http.Request) (future Vali if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1311,7 +1325,6 @@ func (client Client) ValidateMoveResourcesSender(req *http.Request) (future Vali func (client Client) ValidateMoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusConflict), autorest.ByClosing()) result.Response = resp diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/tags.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/tags.go index c8df47e692ca..c7ec58c86164 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/tags.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/tags.go @@ -1,18 +1,7 @@ package resources -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -72,6 +61,7 @@ func (client TagsClient) CreateOrUpdate(ctx context.Context, tagName string) (re result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -108,7 +98,6 @@ func (client TagsClient) CreateOrUpdateSender(req *http.Request) (*http.Response func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result TagDetails, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -147,6 +136,7 @@ func (client TagsClient) CreateOrUpdateValue(ctx context.Context, tagName string result, err = client.CreateOrUpdateValueResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdateValue", resp, "Failure responding to request") + return } return @@ -184,7 +174,6 @@ func (client TagsClient) CreateOrUpdateValueSender(req *http.Request) (*http.Res func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (result TagValue, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -222,6 +211,7 @@ func (client TagsClient) Delete(ctx context.Context, tagName string) (result aut result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "Delete", resp, "Failure responding to request") + return } return @@ -258,7 +248,6 @@ func (client TagsClient) DeleteSender(req *http.Request) (*http.Response, error) func (client TagsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -296,6 +285,7 @@ func (client TagsClient) DeleteValue(ctx context.Context, tagName string, tagVal result, err = client.DeleteValueResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "DeleteValue", resp, "Failure responding to request") + return } return @@ -333,7 +323,6 @@ func (client TagsClient) DeleteValueSender(req *http.Request) (*http.Response, e func (client TagsClient) DeleteValueResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -369,6 +358,11 @@ func (client TagsClient) List(ctx context.Context) (result TagsListResultPage, e result.tlr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure responding to request") + return + } + if result.tlr.hasNextLink() && result.tlr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -404,7 +398,6 @@ func (client TagsClient) ListSender(req *http.Request) (*http.Response, error) { func (client TagsClient) ListResponder(resp *http.Response) (result TagsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/version.go index 49538e1fc09f..d9ec40ceb55d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/version.go @@ -2,19 +2,8 @@ package resources import "github.com/Azure/azure-sdk-for-go/version" -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/accounts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/accounts.go deleted file mode 100644 index 4c3fe8e1dcd9..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/accounts.go +++ /dev/null @@ -1,1157 +0,0 @@ -package storage - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AccountsClient is the the Azure Storage Management API. -type AccountsClient struct { - BaseClient -} - -// NewAccountsClient creates an instance of the AccountsClient client. -func NewAccountsClient(subscriptionID string) AccountsClient { - return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { - return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckNameAvailability checks that the storage account name is valid and is not already in use. -// Parameters: -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) CheckNameAvailability(ctx context.Context, accountName AccountCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CheckNameAvailability") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "accountName.Type", Name: validation.Null, Rule: true, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "CheckNameAvailability", err.Error()) - } - - req, err := client.CheckNameAvailabilityPreparer(ctx, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckNameAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckNameAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", resp, "Failure responding to request") - } - - return -} - -// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. -func (client AccountsClient) CheckNameAvailabilityPreparer(ctx context.Context, accountName AccountCheckNameAvailabilityParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", pathParameters), - autorest.WithJSON(accountName), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always -// closes the http.Response Body. -func (client AccountsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Create asynchronously creates a new storage account with the specified parameters. If an account is already created -// and a subsequent create request is issued with different properties, the account properties will be updated. If an -// account is already created and a subsequent create or update request is issued with the exact same set of -// properties, the request will succeed. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// parameters - the parameters to provide for the created account. -func (client AccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters) (result AccountsCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Create") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Identity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Identity.Type", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.AccountPropertiesCreateParameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain.Name", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) CreateSender(req *http.Request) (future AccountsCreateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client AccountsClient) CreateResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a storage account in Microsoft Azure. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Failover failover request can be triggered for a storage account in case of availability issues. The failover occurs -// from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will -// become primary after failover. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) Failover(ctx context.Context, resourceGroupName string, accountName string) (result AccountsFailoverFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Failover") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "Failover", err.Error()) - } - - req, err := client.FailoverPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Failover", nil, "Failure preparing request") - return - } - - result, err = client.FailoverSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Failover", result.Response(), "Failure sending request") - return - } - - return -} - -// FailoverPreparer prepares the Failover request. -func (client AccountsClient) FailoverPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// FailoverSender sends the Failover request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) FailoverSender(req *http.Request) (future AccountsFailoverFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// FailoverResponder handles the response to the Failover request. The method always -// closes the http.Response Body. -func (client AccountsClient) FailoverResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetProperties returns the properties for the specified storage account including but not limited to name, SKU name, -// location, and account status. The ListKeys operation should be used to retrieve storage keys. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// expand - may be used to expand the properties within account's properties. By default, data is not included -// when fetching properties. Currently we only support geoReplicationStats. -func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupName string, accountName string, expand AccountExpand) (result Account, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.GetProperties") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "GetProperties", err.Error()) - } - - req, err := client.GetPropertiesPreparer(ctx, resourceGroupName, accountName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", nil, "Failure preparing request") - return - } - - resp, err := client.GetPropertiesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", resp, "Failure sending request") - return - } - - result, err = client.GetPropertiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", resp, "Failure responding to request") - } - - return -} - -// GetPropertiesPreparer prepares the GetProperties request. -func (client AccountsClient) GetPropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string, expand AccountExpand) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPropertiesSender sends the GetProperties request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) GetPropertiesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetPropertiesResponder handles the response to the GetProperties request. The method always -// closes the http.Response Body. -func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the storage accounts available under the subscription. Note that storage keys are not returned; use -// the ListKeys operation for this. -func (client AccountsClient) List(ctx context.Context) (result AccountListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AccountsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListResponder(resp *http.Response) (result AccountListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAccountSAS list SAS credentials of a storage account. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// parameters - the parameters to provide to list SAS credentials for the storage account. -func (client AccountsClient) ListAccountSAS(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters) (result ListAccountSasResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListAccountSAS") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.SharedAccessExpiryTime", Name: validation.Null, Rule: true, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "ListAccountSAS", err.Error()) - } - - req, err := client.ListAccountSASPreparer(ctx, resourceGroupName, accountName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListAccountSAS", nil, "Failure preparing request") - return - } - - resp, err := client.ListAccountSASSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListAccountSAS", resp, "Failure sending request") - return - } - - result, err = client.ListAccountSASResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListAccountSAS", resp, "Failure responding to request") - } - - return -} - -// ListAccountSASPreparer prepares the ListAccountSAS request. -func (client AccountsClient) ListAccountSASPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAccountSASSender sends the ListAccountSAS request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListAccountSASSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAccountSASResponder handles the response to the ListAccountSAS request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListAccountSASResponder(resp *http.Response) (result ListAccountSasResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all the storage accounts available under the given resource group. Note that storage keys -// are not returned; use the ListKeys operation for this. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "ListByResourceGroup", err.Error()) - } - - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request") - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AccountsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListKeys lists the access keys for the specified storage account. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountListKeysResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListKeys") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "ListKeys", err.Error()) - } - - req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", nil, "Failure preparing request") - return - } - - resp, err := client.ListKeysSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", resp, "Failure sending request") - return - } - - result, err = client.ListKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", resp, "Failure responding to request") - } - - return -} - -// ListKeysPreparer prepares the ListKeys request. -func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListKeysSender sends the ListKeys request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListKeysSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListKeysResponder handles the response to the ListKeys request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountListKeysResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListServiceSAS list service SAS credentials of a specific resource. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// parameters - the parameters to provide to list service SAS credentials. -func (client AccountsClient) ListServiceSAS(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters) (result ListServiceSasResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListServiceSAS") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.CanonicalizedResource", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Identifier", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Identifier", Name: validation.MaxLength, Rule: 64, Chain: nil}}}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "ListServiceSAS", err.Error()) - } - - req, err := client.ListServiceSASPreparer(ctx, resourceGroupName, accountName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListServiceSAS", nil, "Failure preparing request") - return - } - - resp, err := client.ListServiceSASSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListServiceSAS", resp, "Failure sending request") - return - } - - result, err = client.ListServiceSASResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListServiceSAS", resp, "Failure responding to request") - } - - return -} - -// ListServiceSASPreparer prepares the ListServiceSAS request. -func (client AccountsClient) ListServiceSASPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListServiceSASSender sends the ListServiceSAS request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListServiceSASSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListServiceSASResponder handles the response to the ListServiceSAS request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListServiceSASResponder(resp *http.Response) (result ListServiceSasResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// RegenerateKey regenerates one of the access keys for the specified storage account. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// regenerateKey - specifies name of the key which should be regenerated -- key1 or key2. -func (client AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.RegenerateKey") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: regenerateKey, - Constraints: []validation.Constraint{{Target: "regenerateKey.KeyName", Name: validation.Null, Rule: true, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "RegenerateKey", err.Error()) - } - - req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, accountName, regenerateKey) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", nil, "Failure preparing request") - return - } - - resp, err := client.RegenerateKeySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", resp, "Failure sending request") - return - } - - result, err = client.RegenerateKeyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", resp, "Failure responding to request") - } - - return -} - -// RegenerateKeyPreparer prepares the RegenerateKey request. -func (client AccountsClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", pathParameters), - autorest.WithJSON(regenerateKey), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RegenerateKeySender sends the RegenerateKey request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always -// closes the http.Response Body. -func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result AccountListKeysResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update the update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. -// It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; -// the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value -// must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This -// call does not change the storage keys for the account. If you want to change the storage account keys, use the -// regenerate keys operation. The location and name of the storage account cannot be changed after creation. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// parameters - the parameters to provide for the updated account. -func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.AccountsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/blobcontainers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/blobcontainers.go deleted file mode 100644 index 39072e5f49c1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/blobcontainers.go +++ /dev/null @@ -1,1405 +0,0 @@ -package storage - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// BlobContainersClient is the the Azure Storage Management API. -type BlobContainersClient struct { - BaseClient -} - -// NewBlobContainersClient creates an instance of the BlobContainersClient client. -func NewBlobContainersClient(subscriptionID string) BlobContainersClient { - return NewBlobContainersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBlobContainersClientWithBaseURI creates an instance of the BlobContainersClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewBlobContainersClientWithBaseURI(baseURI string, subscriptionID string) BlobContainersClient { - return BlobContainersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ClearLegalHold clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. -// ClearLegalHold clears out only the specified tags in the request. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// legalHold - the LegalHold property that will be clear from a blob container. -func (client BlobContainersClient) ClearLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold) (result LegalHold, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.ClearLegalHold") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: legalHold, - Constraints: []validation.Constraint{{Target: "legalHold.Tags", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "ClearLegalHold", err.Error()) - } - - req, err := client.ClearLegalHoldPreparer(ctx, resourceGroupName, accountName, containerName, legalHold) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ClearLegalHold", nil, "Failure preparing request") - return - } - - resp, err := client.ClearLegalHoldSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ClearLegalHold", resp, "Failure sending request") - return - } - - result, err = client.ClearLegalHoldResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ClearLegalHold", resp, "Failure responding to request") - } - - return -} - -// ClearLegalHoldPreparer prepares the ClearLegalHold request. -func (client BlobContainersClient) ClearLegalHoldPreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - legalHold.HasLegalHold = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold", pathParameters), - autorest.WithJSON(legalHold), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ClearLegalHoldSender sends the ClearLegalHold request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) ClearLegalHoldSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ClearLegalHoldResponder handles the response to the ClearLegalHold request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) ClearLegalHoldResponder(resp *http.Response) (result LegalHold, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Create creates a new container under the specified account as described by request body. The container resource -// includes metadata and properties for that container. It does not include a list of the blobs contained by the -// container. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// blobContainer - properties of the blob container to create. -func (client BlobContainersClient) Create(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer) (result BlobContainer, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: blobContainer, - Constraints: []validation.Constraint{{Target: "blobContainer.ContainerProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "blobContainer.ContainerProperties.ImmutabilityPolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "blobContainer.ContainerProperties.ImmutabilityPolicy.ImmutabilityPolicyProperty", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "blobContainer.ContainerProperties.ImmutabilityPolicy.ImmutabilityPolicyProperty.ImmutabilityPeriodSinceCreationInDays", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, containerName, blobContainer) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Create", resp, "Failure responding to request") - } - - return -} - -// CreatePreparer prepares the Create request. -func (client BlobContainersClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", pathParameters), - autorest.WithJSON(blobContainer), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) CreateResponder(resp *http.Response) (result BlobContainer, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdateImmutabilityPolicy creates or updates an unlocked immutability policy. ETag in If-Match is honored if -// given but not required for this operation. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// parameters - the ImmutabilityPolicy Properties that will be created or updated to a blob container. -// ifMatch - the entity state (ETag) version of the immutability policy to update. A value of "*" can be used -// to apply the operation only if the immutability policy already exists. If omitted, this operation will -// always be applied. -func (client BlobContainersClient) CreateOrUpdateImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters *ImmutabilityPolicy, ifMatch string) (result ImmutabilityPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.CreateOrUpdateImmutabilityPolicy") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ImmutabilityPolicyProperty", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ImmutabilityPolicyProperty.ImmutabilityPeriodSinceCreationInDays", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "CreateOrUpdateImmutabilityPolicy", err.Error()) - } - - req, err := client.CreateOrUpdateImmutabilityPolicyPreparer(ctx, resourceGroupName, accountName, containerName, parameters, ifMatch) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "CreateOrUpdateImmutabilityPolicy", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateImmutabilityPolicySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "CreateOrUpdateImmutabilityPolicy", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateImmutabilityPolicyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "CreateOrUpdateImmutabilityPolicy", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdateImmutabilityPolicyPreparer prepares the CreateOrUpdateImmutabilityPolicy request. -func (client BlobContainersClient) CreateOrUpdateImmutabilityPolicyPreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters *ImmutabilityPolicy, ifMatch string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "immutabilityPolicyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateImmutabilityPolicySender sends the CreateOrUpdateImmutabilityPolicy request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) CreateOrUpdateImmutabilityPolicySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateImmutabilityPolicyResponder handles the response to the CreateOrUpdateImmutabilityPolicy request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) CreateOrUpdateImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes specified container under its account. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -func (client BlobContainersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, containerName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client BlobContainersClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteImmutabilityPolicy aborts an unlocked immutability policy. The response of delete has -// immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked -// immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the -// container. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// ifMatch - the entity state (ETag) version of the immutability policy to update. A value of "*" can be used -// to apply the operation only if the immutability policy already exists. If omitted, this operation will -// always be applied. -func (client BlobContainersClient) DeleteImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result ImmutabilityPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.DeleteImmutabilityPolicy") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "DeleteImmutabilityPolicy", err.Error()) - } - - req, err := client.DeleteImmutabilityPolicyPreparer(ctx, resourceGroupName, accountName, containerName, ifMatch) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "DeleteImmutabilityPolicy", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteImmutabilityPolicySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "DeleteImmutabilityPolicy", resp, "Failure sending request") - return - } - - result, err = client.DeleteImmutabilityPolicyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "DeleteImmutabilityPolicy", resp, "Failure responding to request") - } - - return -} - -// DeleteImmutabilityPolicyPreparer prepares the DeleteImmutabilityPolicy request. -func (client BlobContainersClient) DeleteImmutabilityPolicyPreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "immutabilityPolicyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteImmutabilityPolicySender sends the DeleteImmutabilityPolicy request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) DeleteImmutabilityPolicySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteImmutabilityPolicyResponder handles the response to the DeleteImmutabilityPolicy request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) DeleteImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ExtendImmutabilityPolicy extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only -// action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// ifMatch - the entity state (ETag) version of the immutability policy to update. A value of "*" can be used -// to apply the operation only if the immutability policy already exists. If omitted, this operation will -// always be applied. -// parameters - the ImmutabilityPolicy Properties that will be extended for a blob container. -func (client BlobContainersClient) ExtendImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, parameters *ImmutabilityPolicy) (result ImmutabilityPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.ExtendImmutabilityPolicy") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ImmutabilityPolicyProperty", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ImmutabilityPolicyProperty.ImmutabilityPeriodSinceCreationInDays", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "ExtendImmutabilityPolicy", err.Error()) - } - - req, err := client.ExtendImmutabilityPolicyPreparer(ctx, resourceGroupName, accountName, containerName, ifMatch, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ExtendImmutabilityPolicy", nil, "Failure preparing request") - return - } - - resp, err := client.ExtendImmutabilityPolicySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ExtendImmutabilityPolicy", resp, "Failure sending request") - return - } - - result, err = client.ExtendImmutabilityPolicyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ExtendImmutabilityPolicy", resp, "Failure responding to request") - } - - return -} - -// ExtendImmutabilityPolicyPreparer prepares the ExtendImmutabilityPolicy request. -func (client BlobContainersClient) ExtendImmutabilityPolicyPreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, parameters *ImmutabilityPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExtendImmutabilityPolicySender sends the ExtendImmutabilityPolicy request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) ExtendImmutabilityPolicySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ExtendImmutabilityPolicyResponder handles the response to the ExtendImmutabilityPolicy request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) ExtendImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets properties of a specified container. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -func (client BlobContainersClient) Get(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result BlobContainer, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName, containerName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client BlobContainersClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) GetResponder(resp *http.Response) (result BlobContainer, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetImmutabilityPolicy gets the existing immutability policy along with the corresponding ETag in response headers -// and body. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// ifMatch - the entity state (ETag) version of the immutability policy to update. A value of "*" can be used -// to apply the operation only if the immutability policy already exists. If omitted, this operation will -// always be applied. -func (client BlobContainersClient) GetImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result ImmutabilityPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.GetImmutabilityPolicy") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "GetImmutabilityPolicy", err.Error()) - } - - req, err := client.GetImmutabilityPolicyPreparer(ctx, resourceGroupName, accountName, containerName, ifMatch) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "GetImmutabilityPolicy", nil, "Failure preparing request") - return - } - - resp, err := client.GetImmutabilityPolicySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "GetImmutabilityPolicy", resp, "Failure sending request") - return - } - - result, err = client.GetImmutabilityPolicyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "GetImmutabilityPolicy", resp, "Failure responding to request") - } - - return -} - -// GetImmutabilityPolicyPreparer prepares the GetImmutabilityPolicy request. -func (client BlobContainersClient) GetImmutabilityPolicyPreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "immutabilityPolicyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetImmutabilityPolicySender sends the GetImmutabilityPolicy request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) GetImmutabilityPolicySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetImmutabilityPolicyResponder handles the response to the GetImmutabilityPolicy request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) GetImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Lease the Lease Container operation establishes and manages a lock on a container for delete operations. The lock -// duration can be 15 to 60 seconds, or can be infinite. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// parameters - lease Container request body. -func (client BlobContainersClient) Lease(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters *LeaseContainerRequest) (result LeaseContainerResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.Lease") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "Lease", err.Error()) - } - - req, err := client.LeasePreparer(ctx, resourceGroupName, accountName, containerName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Lease", nil, "Failure preparing request") - return - } - - resp, err := client.LeaseSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Lease", resp, "Failure sending request") - return - } - - result, err = client.LeaseResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Lease", resp, "Failure responding to request") - } - - return -} - -// LeasePreparer prepares the Lease request. -func (client BlobContainersClient) LeasePreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters *LeaseContainerRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// LeaseSender sends the Lease request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) LeaseSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// LeaseResponder handles the response to the Lease request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) LeaseResponder(resp *http.Response) (result LeaseContainerResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation -// token. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client BlobContainersClient) List(ctx context.Context, resourceGroupName string, accountName string) (result ListContainerItems, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client BlobContainersClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) ListResponder(resp *http.Response) (result ListContainerItems, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// LockImmutabilityPolicy sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is -// ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// ifMatch - the entity state (ETag) version of the immutability policy to update. A value of "*" can be used -// to apply the operation only if the immutability policy already exists. If omitted, this operation will -// always be applied. -func (client BlobContainersClient) LockImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result ImmutabilityPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.LockImmutabilityPolicy") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "LockImmutabilityPolicy", err.Error()) - } - - req, err := client.LockImmutabilityPolicyPreparer(ctx, resourceGroupName, accountName, containerName, ifMatch) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "LockImmutabilityPolicy", nil, "Failure preparing request") - return - } - - resp, err := client.LockImmutabilityPolicySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "LockImmutabilityPolicy", resp, "Failure sending request") - return - } - - result, err = client.LockImmutabilityPolicyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "LockImmutabilityPolicy", resp, "Failure responding to request") - } - - return -} - -// LockImmutabilityPolicyPreparer prepares the LockImmutabilityPolicy request. -func (client BlobContainersClient) LockImmutabilityPolicyPreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// LockImmutabilityPolicySender sends the LockImmutabilityPolicy request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) LockImmutabilityPolicySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// LockImmutabilityPolicyResponder handles the response to the LockImmutabilityPolicy request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) LockImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SetLegalHold sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an -// append pattern and does not clear out the existing tags that are not specified in the request. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// legalHold - the LegalHold property that will be set to a blob container. -func (client BlobContainersClient) SetLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold) (result LegalHold, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.SetLegalHold") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: legalHold, - Constraints: []validation.Constraint{{Target: "legalHold.Tags", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "SetLegalHold", err.Error()) - } - - req, err := client.SetLegalHoldPreparer(ctx, resourceGroupName, accountName, containerName, legalHold) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "SetLegalHold", nil, "Failure preparing request") - return - } - - resp, err := client.SetLegalHoldSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "SetLegalHold", resp, "Failure sending request") - return - } - - result, err = client.SetLegalHoldResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "SetLegalHold", resp, "Failure responding to request") - } - - return -} - -// SetLegalHoldPreparer prepares the SetLegalHold request. -func (client BlobContainersClient) SetLegalHoldPreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - legalHold.HasLegalHold = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold", pathParameters), - autorest.WithJSON(legalHold), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetLegalHoldSender sends the SetLegalHold request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) SetLegalHoldSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SetLegalHoldResponder handles the response to the SetLegalHold request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) SetLegalHoldResponder(resp *http.Response) (result LegalHold, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update updates container properties as specified in request body. Properties not mentioned in the request will be -// unchanged. Update fails if the specified container doesn't already exist. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// containerName - the name of the blob container within the specified storage account. Blob container names -// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every -// dash (-) character must be immediately preceded and followed by a letter or number. -// blobContainer - properties to update for the blob container. -func (client BlobContainersClient) Update(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer) (result BlobContainer, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: containerName, - Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobContainersClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, containerName, blobContainer) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client BlobContainersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "containerName": autorest.Encode("path", containerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", pathParameters), - autorest.WithJSON(blobContainer), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client BlobContainersClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client BlobContainersClient) UpdateResponder(resp *http.Response) (result BlobContainer, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/blobservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/blobservices.go deleted file mode 100644 index a08d84b91e79..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/blobservices.go +++ /dev/null @@ -1,242 +0,0 @@ -package storage - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// BlobServicesClient is the the Azure Storage Management API. -type BlobServicesClient struct { - BaseClient -} - -// NewBlobServicesClient creates an instance of the BlobServicesClient client. -func NewBlobServicesClient(subscriptionID string) BlobServicesClient { - return NewBlobServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBlobServicesClientWithBaseURI creates an instance of the BlobServicesClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewBlobServicesClientWithBaseURI(baseURI string, subscriptionID string) BlobServicesClient { - return BlobServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetServiceProperties gets the properties of a storage account’s Blob service, including properties for Storage -// Analytics and CORS (Cross-Origin Resource Sharing) rules. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client BlobServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string) (result BlobServiceProperties, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobServicesClient.GetServiceProperties") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.BlobServicesClient", "GetServiceProperties", err.Error()) - } - - req, err := client.GetServicePropertiesPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "GetServiceProperties", nil, "Failure preparing request") - return - } - - resp, err := client.GetServicePropertiesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "GetServiceProperties", resp, "Failure sending request") - return - } - - result, err = client.GetServicePropertiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "GetServiceProperties", resp, "Failure responding to request") - } - - return -} - -// GetServicePropertiesPreparer prepares the GetServiceProperties request. -func (client BlobServicesClient) GetServicePropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "BlobServicesName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetServicePropertiesSender sends the GetServiceProperties request. The method will close the -// http.Response Body if it receives an error. -func (client BlobServicesClient) GetServicePropertiesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetServicePropertiesResponder handles the response to the GetServiceProperties request. The method always -// closes the http.Response Body. -func (client BlobServicesClient) GetServicePropertiesResponder(resp *http.Response) (result BlobServiceProperties, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SetServiceProperties sets the properties of a storage account’s Blob service, including properties for Storage -// Analytics and CORS (Cross-Origin Resource Sharing) rules. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// parameters - the properties of a storage account’s Blob service, including properties for Storage Analytics -// and CORS (Cross-Origin Resource Sharing) rules. -func (client BlobServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties) (result BlobServiceProperties, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BlobServicesClient.SetServiceProperties") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties.DeleteRetentionPolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties.DeleteRetentionPolicy.Days", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties.DeleteRetentionPolicy.Days", Name: validation.InclusiveMaximum, Rule: int64(365), Chain: nil}, - {Target: "parameters.BlobServicePropertiesProperties.DeleteRetentionPolicy.Days", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("storage.BlobServicesClient", "SetServiceProperties", err.Error()) - } - - req, err := client.SetServicePropertiesPreparer(ctx, resourceGroupName, accountName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "SetServiceProperties", nil, "Failure preparing request") - return - } - - resp, err := client.SetServicePropertiesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "SetServiceProperties", resp, "Failure sending request") - return - } - - result, err = client.SetServicePropertiesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "SetServiceProperties", resp, "Failure responding to request") - } - - return -} - -// SetServicePropertiesPreparer prepares the SetServiceProperties request. -func (client BlobServicesClient) SetServicePropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "BlobServicesName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetServicePropertiesSender sends the SetServiceProperties request. The method will close the -// http.Response Body if it receives an error. -func (client BlobServicesClient) SetServicePropertiesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SetServicePropertiesResponder handles the response to the SetServiceProperties request. The method always -// closes the http.Response Body. -func (client BlobServicesClient) SetServicePropertiesResponder(resp *http.Response) (result BlobServiceProperties, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/client.go deleted file mode 100644 index f606f71f2bae..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/client.go +++ /dev/null @@ -1,52 +0,0 @@ -// Package storage implements the Azure ARM Storage service API version . -// -// The Azure Storage Management API. -package storage - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Storage - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Storage. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/managementpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/managementpolicies.go deleted file mode 100644 index 317b8b2ff2a1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/managementpolicies.go +++ /dev/null @@ -1,322 +0,0 @@ -package storage - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ManagementPoliciesClient is the the Azure Storage Management API. -type ManagementPoliciesClient struct { - BaseClient -} - -// NewManagementPoliciesClient creates an instance of the ManagementPoliciesClient client. -func NewManagementPoliciesClient(subscriptionID string) ManagementPoliciesClient { - return NewManagementPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagementPoliciesClientWithBaseURI creates an instance of the ManagementPoliciesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewManagementPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ManagementPoliciesClient { - return ManagementPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate sets the data policy rules associated with the specified storage account. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// properties - the data policy rules to set to a storage account. -func (client ManagementPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, properties ManagementPoliciesRulesSetParameter) (result AccountManagementPolicies, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagementPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.ManagementPoliciesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, properties) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagementPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, properties ManagementPoliciesRulesSetParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "managementPolicyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", pathParameters), - autorest.WithJSON(properties), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ManagementPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ManagementPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result AccountManagementPolicies, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the data policy rules associated with the specified storage account. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client ManagementPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagementPoliciesClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.ManagementPoliciesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagementPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "managementPolicyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ManagementPoliciesClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ManagementPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the data policy rules associated with the specified storage account. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// accountName - the name of the storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client ManagementPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result AccountManagementPolicies, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagementPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: accountName, - Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.ManagementPoliciesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagementPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "managementPolicyName": autorest.Encode("path", "default"), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-03-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ManagementPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ManagementPoliciesClient) GetResponder(resp *http.Response) (result AccountManagementPolicies, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/models.go deleted file mode 100644 index fa9a8acbc7a4..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/models.go +++ /dev/null @@ -1,2187 +0,0 @@ -package storage - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage" - -// AccessTier enumerates the values for access tier. -type AccessTier string - -const ( - // Cool ... - Cool AccessTier = "Cool" - // Hot ... - Hot AccessTier = "Hot" -) - -// PossibleAccessTierValues returns an array of possible values for the AccessTier const type. -func PossibleAccessTierValues() []AccessTier { - return []AccessTier{Cool, Hot} -} - -// AccountExpand enumerates the values for account expand. -type AccountExpand string - -const ( - // AccountExpandGeoReplicationStats ... - AccountExpandGeoReplicationStats AccountExpand = "geoReplicationStats" -) - -// PossibleAccountExpandValues returns an array of possible values for the AccountExpand const type. -func PossibleAccountExpandValues() []AccountExpand { - return []AccountExpand{AccountExpandGeoReplicationStats} -} - -// AccountStatus enumerates the values for account status. -type AccountStatus string - -const ( - // Available ... - Available AccountStatus = "available" - // Unavailable ... - Unavailable AccountStatus = "unavailable" -) - -// PossibleAccountStatusValues returns an array of possible values for the AccountStatus const type. -func PossibleAccountStatusValues() []AccountStatus { - return []AccountStatus{Available, Unavailable} -} - -// Action enumerates the values for action. -type Action string - -const ( - // Allow ... - Allow Action = "Allow" -) - -// PossibleActionValues returns an array of possible values for the Action const type. -func PossibleActionValues() []Action { - return []Action{Allow} -} - -// Action1 enumerates the values for action 1. -type Action1 string - -const ( - // Acquire ... - Acquire Action1 = "Acquire" - // Break ... - Break Action1 = "Break" - // Change ... - Change Action1 = "Change" - // Release ... - Release Action1 = "Release" - // Renew ... - Renew Action1 = "Renew" -) - -// PossibleAction1Values returns an array of possible values for the Action1 const type. -func PossibleAction1Values() []Action1 { - return []Action1{Acquire, Break, Change, Release, Renew} -} - -// Bypass enumerates the values for bypass. -type Bypass string - -const ( - // AzureServices ... - AzureServices Bypass = "AzureServices" - // Logging ... - Logging Bypass = "Logging" - // Metrics ... - Metrics Bypass = "Metrics" - // None ... - None Bypass = "None" -) - -// PossibleBypassValues returns an array of possible values for the Bypass const type. -func PossibleBypassValues() []Bypass { - return []Bypass{AzureServices, Logging, Metrics, None} -} - -// DefaultAction enumerates the values for default action. -type DefaultAction string - -const ( - // DefaultActionAllow ... - DefaultActionAllow DefaultAction = "Allow" - // DefaultActionDeny ... - DefaultActionDeny DefaultAction = "Deny" -) - -// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. -func PossibleDefaultActionValues() []DefaultAction { - return []DefaultAction{DefaultActionAllow, DefaultActionDeny} -} - -// GeoReplicationStatus enumerates the values for geo replication status. -type GeoReplicationStatus string - -const ( - // GeoReplicationStatusBootstrap ... - GeoReplicationStatusBootstrap GeoReplicationStatus = "Bootstrap" - // GeoReplicationStatusLive ... - GeoReplicationStatusLive GeoReplicationStatus = "Live" - // GeoReplicationStatusUnavailable ... - GeoReplicationStatusUnavailable GeoReplicationStatus = "Unavailable" -) - -// PossibleGeoReplicationStatusValues returns an array of possible values for the GeoReplicationStatus const type. -func PossibleGeoReplicationStatusValues() []GeoReplicationStatus { - return []GeoReplicationStatus{GeoReplicationStatusBootstrap, GeoReplicationStatusLive, GeoReplicationStatusUnavailable} -} - -// HTTPProtocol enumerates the values for http protocol. -type HTTPProtocol string - -const ( - // HTTPS ... - HTTPS HTTPProtocol = "https" - // Httpshttp ... - Httpshttp HTTPProtocol = "https,http" -) - -// PossibleHTTPProtocolValues returns an array of possible values for the HTTPProtocol const type. -func PossibleHTTPProtocolValues() []HTTPProtocol { - return []HTTPProtocol{HTTPS, Httpshttp} -} - -// ImmutabilityPolicyState enumerates the values for immutability policy state. -type ImmutabilityPolicyState string - -const ( - // Locked ... - Locked ImmutabilityPolicyState = "Locked" - // Unlocked ... - Unlocked ImmutabilityPolicyState = "Unlocked" -) - -// PossibleImmutabilityPolicyStateValues returns an array of possible values for the ImmutabilityPolicyState const type. -func PossibleImmutabilityPolicyStateValues() []ImmutabilityPolicyState { - return []ImmutabilityPolicyState{Locked, Unlocked} -} - -// ImmutabilityPolicyUpdateType enumerates the values for immutability policy update type. -type ImmutabilityPolicyUpdateType string - -const ( - // Extend ... - Extend ImmutabilityPolicyUpdateType = "extend" - // Lock ... - Lock ImmutabilityPolicyUpdateType = "lock" - // Put ... - Put ImmutabilityPolicyUpdateType = "put" -) - -// PossibleImmutabilityPolicyUpdateTypeValues returns an array of possible values for the ImmutabilityPolicyUpdateType const type. -func PossibleImmutabilityPolicyUpdateTypeValues() []ImmutabilityPolicyUpdateType { - return []ImmutabilityPolicyUpdateType{Extend, Lock, Put} -} - -// KeyPermission enumerates the values for key permission. -type KeyPermission string - -const ( - // Full ... - Full KeyPermission = "Full" - // Read ... - Read KeyPermission = "Read" -) - -// PossibleKeyPermissionValues returns an array of possible values for the KeyPermission const type. -func PossibleKeyPermissionValues() []KeyPermission { - return []KeyPermission{Full, Read} -} - -// KeySource enumerates the values for key source. -type KeySource string - -const ( - // MicrosoftKeyvault ... - MicrosoftKeyvault KeySource = "Microsoft.Keyvault" - // MicrosoftStorage ... - MicrosoftStorage KeySource = "Microsoft.Storage" -) - -// PossibleKeySourceValues returns an array of possible values for the KeySource const type. -func PossibleKeySourceValues() []KeySource { - return []KeySource{MicrosoftKeyvault, MicrosoftStorage} -} - -// Kind enumerates the values for kind. -type Kind string - -const ( - // BlobStorage ... - BlobStorage Kind = "BlobStorage" - // BlockBlobStorage ... - BlockBlobStorage Kind = "BlockBlobStorage" - // FileStorage ... - FileStorage Kind = "FileStorage" - // Storage ... - Storage Kind = "Storage" - // StorageV2 ... - StorageV2 Kind = "StorageV2" -) - -// PossibleKindValues returns an array of possible values for the Kind const type. -func PossibleKindValues() []Kind { - return []Kind{BlobStorage, BlockBlobStorage, FileStorage, Storage, StorageV2} -} - -// LeaseDuration enumerates the values for lease duration. -type LeaseDuration string - -const ( - // Fixed ... - Fixed LeaseDuration = "Fixed" - // Infinite ... - Infinite LeaseDuration = "Infinite" -) - -// PossibleLeaseDurationValues returns an array of possible values for the LeaseDuration const type. -func PossibleLeaseDurationValues() []LeaseDuration { - return []LeaseDuration{Fixed, Infinite} -} - -// LeaseState enumerates the values for lease state. -type LeaseState string - -const ( - // LeaseStateAvailable ... - LeaseStateAvailable LeaseState = "Available" - // LeaseStateBreaking ... - LeaseStateBreaking LeaseState = "Breaking" - // LeaseStateBroken ... - LeaseStateBroken LeaseState = "Broken" - // LeaseStateExpired ... - LeaseStateExpired LeaseState = "Expired" - // LeaseStateLeased ... - LeaseStateLeased LeaseState = "Leased" -) - -// PossibleLeaseStateValues returns an array of possible values for the LeaseState const type. -func PossibleLeaseStateValues() []LeaseState { - return []LeaseState{LeaseStateAvailable, LeaseStateBreaking, LeaseStateBroken, LeaseStateExpired, LeaseStateLeased} -} - -// LeaseStatus enumerates the values for lease status. -type LeaseStatus string - -const ( - // LeaseStatusLocked ... - LeaseStatusLocked LeaseStatus = "Locked" - // LeaseStatusUnlocked ... - LeaseStatusUnlocked LeaseStatus = "Unlocked" -) - -// PossibleLeaseStatusValues returns an array of possible values for the LeaseStatus const type. -func PossibleLeaseStatusValues() []LeaseStatus { - return []LeaseStatus{LeaseStatusLocked, LeaseStatusUnlocked} -} - -// Permissions enumerates the values for permissions. -type Permissions string - -const ( - // A ... - A Permissions = "a" - // C ... - C Permissions = "c" - // D ... - D Permissions = "d" - // L ... - L Permissions = "l" - // P ... - P Permissions = "p" - // R ... - R Permissions = "r" - // U ... - U Permissions = "u" - // W ... - W Permissions = "w" -) - -// PossiblePermissionsValues returns an array of possible values for the Permissions const type. -func PossiblePermissionsValues() []Permissions { - return []Permissions{A, C, D, L, P, R, U, W} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Creating ... - Creating ProvisioningState = "Creating" - // ResolvingDNS ... - ResolvingDNS ProvisioningState = "ResolvingDNS" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Creating, ResolvingDNS, Succeeded} -} - -// PublicAccess enumerates the values for public access. -type PublicAccess string - -const ( - // PublicAccessBlob ... - PublicAccessBlob PublicAccess = "Blob" - // PublicAccessContainer ... - PublicAccessContainer PublicAccess = "Container" - // PublicAccessNone ... - PublicAccessNone PublicAccess = "None" -) - -// PossiblePublicAccessValues returns an array of possible values for the PublicAccess const type. -func PossiblePublicAccessValues() []PublicAccess { - return []PublicAccess{PublicAccessBlob, PublicAccessContainer, PublicAccessNone} -} - -// Reason enumerates the values for reason. -type Reason string - -const ( - // AccountNameInvalid ... - AccountNameInvalid Reason = "AccountNameInvalid" - // AlreadyExists ... - AlreadyExists Reason = "AlreadyExists" -) - -// PossibleReasonValues returns an array of possible values for the Reason const type. -func PossibleReasonValues() []Reason { - return []Reason{AccountNameInvalid, AlreadyExists} -} - -// ReasonCode enumerates the values for reason code. -type ReasonCode string - -const ( - // NotAvailableForSubscription ... - NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription" - // QuotaID ... - QuotaID ReasonCode = "QuotaId" -) - -// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type. -func PossibleReasonCodeValues() []ReasonCode { - return []ReasonCode{NotAvailableForSubscription, QuotaID} -} - -// Services enumerates the values for services. -type Services string - -const ( - // B ... - B Services = "b" - // F ... - F Services = "f" - // Q ... - Q Services = "q" - // T ... - T Services = "t" -) - -// PossibleServicesValues returns an array of possible values for the Services const type. -func PossibleServicesValues() []Services { - return []Services{B, F, Q, T} -} - -// SignedResource enumerates the values for signed resource. -type SignedResource string - -const ( - // SignedResourceB ... - SignedResourceB SignedResource = "b" - // SignedResourceC ... - SignedResourceC SignedResource = "c" - // SignedResourceF ... - SignedResourceF SignedResource = "f" - // SignedResourceS ... - SignedResourceS SignedResource = "s" -) - -// PossibleSignedResourceValues returns an array of possible values for the SignedResource const type. -func PossibleSignedResourceValues() []SignedResource { - return []SignedResource{SignedResourceB, SignedResourceC, SignedResourceF, SignedResourceS} -} - -// SignedResourceTypes enumerates the values for signed resource types. -type SignedResourceTypes string - -const ( - // SignedResourceTypesC ... - SignedResourceTypesC SignedResourceTypes = "c" - // SignedResourceTypesO ... - SignedResourceTypesO SignedResourceTypes = "o" - // SignedResourceTypesS ... - SignedResourceTypesS SignedResourceTypes = "s" -) - -// PossibleSignedResourceTypesValues returns an array of possible values for the SignedResourceTypes const type. -func PossibleSignedResourceTypesValues() []SignedResourceTypes { - return []SignedResourceTypes{SignedResourceTypesC, SignedResourceTypesO, SignedResourceTypesS} -} - -// SkuName enumerates the values for sku name. -type SkuName string - -const ( - // PremiumLRS ... - PremiumLRS SkuName = "Premium_LRS" - // PremiumZRS ... - PremiumZRS SkuName = "Premium_ZRS" - // StandardGRS ... - StandardGRS SkuName = "Standard_GRS" - // StandardLRS ... - StandardLRS SkuName = "Standard_LRS" - // StandardRAGRS ... - StandardRAGRS SkuName = "Standard_RAGRS" - // StandardZRS ... - StandardZRS SkuName = "Standard_ZRS" -) - -// PossibleSkuNameValues returns an array of possible values for the SkuName const type. -func PossibleSkuNameValues() []SkuName { - return []SkuName{PremiumLRS, PremiumZRS, StandardGRS, StandardLRS, StandardRAGRS, StandardZRS} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // Premium ... - Premium SkuTier = "Premium" - // Standard ... - Standard SkuTier = "Standard" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Premium, Standard} -} - -// State enumerates the values for state. -type State string - -const ( - // StateDeprovisioning ... - StateDeprovisioning State = "deprovisioning" - // StateFailed ... - StateFailed State = "failed" - // StateNetworkSourceDeleted ... - StateNetworkSourceDeleted State = "networkSourceDeleted" - // StateProvisioning ... - StateProvisioning State = "provisioning" - // StateSucceeded ... - StateSucceeded State = "succeeded" -) - -// PossibleStateValues returns an array of possible values for the State const type. -func PossibleStateValues() []State { - return []State{StateDeprovisioning, StateFailed, StateNetworkSourceDeleted, StateProvisioning, StateSucceeded} -} - -// UsageUnit enumerates the values for usage unit. -type UsageUnit string - -const ( - // Bytes ... - Bytes UsageUnit = "Bytes" - // BytesPerSecond ... - BytesPerSecond UsageUnit = "BytesPerSecond" - // Count ... - Count UsageUnit = "Count" - // CountsPerSecond ... - CountsPerSecond UsageUnit = "CountsPerSecond" - // Percent ... - Percent UsageUnit = "Percent" - // Seconds ... - Seconds UsageUnit = "Seconds" -) - -// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. -func PossibleUsageUnitValues() []UsageUnit { - return []UsageUnit{Bytes, BytesPerSecond, Count, CountsPerSecond, Percent, Seconds} -} - -// Account the storage account. -type Account struct { - autorest.Response `json:"-"` - // Sku - READ-ONLY; Gets the SKU. - Sku *Sku `json:"sku,omitempty"` - // Kind - READ-ONLY; Gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - Kind Kind `json:"kind,omitempty"` - // Identity - The identity of the resource. - Identity *Identity `json:"identity,omitempty"` - // AccountProperties - Properties of the storage account. - *AccountProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Account. -func (a Account) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.Identity != nil { - objectMap["identity"] = a.Identity - } - if a.AccountProperties != nil { - objectMap["properties"] = a.AccountProperties - } - if a.Tags != nil { - objectMap["tags"] = a.Tags - } - if a.Location != nil { - objectMap["location"] = a.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Account struct. -func (a *Account) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - a.Sku = &sku - } - case "kind": - if v != nil { - var kind Kind - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - a.Kind = kind - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - a.Identity = &identity - } - case "properties": - if v != nil { - var accountProperties AccountProperties - err = json.Unmarshal(*v, &accountProperties) - if err != nil { - return err - } - a.AccountProperties = &accountProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - a.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - a.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - a.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - a.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - a.Type = &typeVar - } - } - } - - return nil -} - -// AccountCheckNameAvailabilityParameters the parameters used to check the availability of the storage -// account name. -type AccountCheckNameAvailabilityParameters struct { - // Name - The storage account name. - Name *string `json:"name,omitempty"` - // Type - The type of resource, Microsoft.Storage/storageAccounts - Type *string `json:"type,omitempty"` -} - -// AccountCreateParameters the parameters used when creating a storage account. -type AccountCreateParameters struct { - // Sku - Required. Gets or sets the SKU name. - Sku *Sku `json:"sku,omitempty"` - // Kind - Required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - Kind Kind `json:"kind,omitempty"` - // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. - Location *string `json:"location,omitempty"` - // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. - Tags map[string]*string `json:"tags"` - // Identity - The identity of the resource. - Identity *Identity `json:"identity,omitempty"` - // AccountPropertiesCreateParameters - The parameters used to create the storage account. - *AccountPropertiesCreateParameters `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountCreateParameters. -func (acp AccountCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if acp.Sku != nil { - objectMap["sku"] = acp.Sku - } - if acp.Kind != "" { - objectMap["kind"] = acp.Kind - } - if acp.Location != nil { - objectMap["location"] = acp.Location - } - if acp.Tags != nil { - objectMap["tags"] = acp.Tags - } - if acp.Identity != nil { - objectMap["identity"] = acp.Identity - } - if acp.AccountPropertiesCreateParameters != nil { - objectMap["properties"] = acp.AccountPropertiesCreateParameters - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AccountCreateParameters struct. -func (acp *AccountCreateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - acp.Sku = &sku - } - case "kind": - if v != nil { - var kind Kind - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - acp.Kind = kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - acp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - acp.Tags = tags - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - acp.Identity = &identity - } - case "properties": - if v != nil { - var accountPropertiesCreateParameters AccountPropertiesCreateParameters - err = json.Unmarshal(*v, &accountPropertiesCreateParameters) - if err != nil { - return err - } - acp.AccountPropertiesCreateParameters = &accountPropertiesCreateParameters - } - } - } - - return nil -} - -// AccountKey an access key for the storage account. -type AccountKey struct { - // KeyName - READ-ONLY; Name of the key. - KeyName *string `json:"keyName,omitempty"` - // Value - READ-ONLY; Base 64-encoded value of the key. - Value *string `json:"value,omitempty"` - // Permissions - READ-ONLY; Permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full' - Permissions KeyPermission `json:"permissions,omitempty"` -} - -// AccountListKeysResult the response from the ListKeys operation. -type AccountListKeysResult struct { - autorest.Response `json:"-"` - // Keys - READ-ONLY; Gets the list of storage account keys and their properties for the specified storage account. - Keys *[]AccountKey `json:"keys,omitempty"` -} - -// AccountListResult the response from the List Storage Accounts operation. -type AccountListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Gets the list of storage accounts and their properties. - Value *[]Account `json:"value,omitempty"` -} - -// AccountManagementPolicies the Get Storage Account ManagementPolicies operation response. -type AccountManagementPolicies struct { - autorest.Response `json:"-"` - // AccountManagementPoliciesRulesProperty - READ-ONLY; Returns the Storage Account Data Policies Rules. - *AccountManagementPoliciesRulesProperty `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountManagementPolicies. -func (amp AccountManagementPolicies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AccountManagementPolicies struct. -func (amp *AccountManagementPolicies) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var accountManagementPoliciesRulesProperty AccountManagementPoliciesRulesProperty - err = json.Unmarshal(*v, &accountManagementPoliciesRulesProperty) - if err != nil { - return err - } - amp.AccountManagementPoliciesRulesProperty = &accountManagementPoliciesRulesProperty - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - amp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - amp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - amp.Type = &typeVar - } - } - } - - return nil -} - -// AccountManagementPoliciesRulesProperty the Storage Account Data Policies properties. -type AccountManagementPoliciesRulesProperty struct { - // LastModifiedTime - READ-ONLY; Returns the date and time the ManagementPolicies was last modified. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Policy - The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - Policy interface{} `json:"policy,omitempty"` -} - -// AccountProperties properties of the storage account. -type AccountProperties struct { - // ProvisioningState - READ-ONLY; Gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrimaryEndpoints - READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. - PrimaryEndpoints *Endpoints `json:"primaryEndpoints,omitempty"` - // PrimaryLocation - READ-ONLY; Gets the location of the primary data center for the storage account. - PrimaryLocation *string `json:"primaryLocation,omitempty"` - // StatusOfPrimary - READ-ONLY; Gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'Available', 'Unavailable' - StatusOfPrimary AccountStatus `json:"statusOfPrimary,omitempty"` - // LastGeoFailoverTime - READ-ONLY; Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. - LastGeoFailoverTime *date.Time `json:"lastGeoFailoverTime,omitempty"` - // SecondaryLocation - READ-ONLY; Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. - SecondaryLocation *string `json:"secondaryLocation,omitempty"` - // StatusOfSecondary - READ-ONLY; Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'Available', 'Unavailable' - StatusOfSecondary AccountStatus `json:"statusOfSecondary,omitempty"` - // CreationTime - READ-ONLY; Gets the creation date and time of the storage account in UTC. - CreationTime *date.Time `json:"creationTime,omitempty"` - // CustomDomain - READ-ONLY; Gets the custom domain the user assigned to this storage account. - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - // SecondaryEndpoints - READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. - SecondaryEndpoints *Endpoints `json:"secondaryEndpoints,omitempty"` - // Encryption - READ-ONLY; Gets the encryption settings on the account. If unspecified, the account is unencrypted. - Encryption *Encryption `json:"encryption,omitempty"` - // AccessTier - READ-ONLY; Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' - AccessTier AccessTier `json:"accessTier,omitempty"` - // EnableAzureFilesAadIntegration - Enables Azure Files AAD Integration for SMB if sets to true. - EnableAzureFilesAadIntegration *bool `json:"azureFilesAadIntegration,omitempty"` - // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. - EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` - // NetworkRuleSet - READ-ONLY; Network rule set - NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` - // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. - IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` - // GeoReplicationStats - READ-ONLY; Geo Replication Stats - GeoReplicationStats *GeoReplicationStats `json:"geoReplicationStats,omitempty"` - // FailoverInProgress - READ-ONLY; If the failover is in progress, the value will be true, otherwise, it will be null. - FailoverInProgress *bool `json:"failoverInProgress,omitempty"` -} - -// AccountPropertiesCreateParameters the parameters used to create the storage account. -type AccountPropertiesCreateParameters struct { - // CustomDomain - User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - // Encryption - Provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. - Encryption *Encryption `json:"encryption,omitempty"` - // NetworkRuleSet - Network rule set - NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` - // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' - AccessTier AccessTier `json:"accessTier,omitempty"` - // EnableAzureFilesAadIntegration - Enables Azure Files AAD Integration for SMB if sets to true. - EnableAzureFilesAadIntegration *bool `json:"azureFilesAadIntegration,omitempty"` - // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. - EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` - // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. - IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` -} - -// AccountPropertiesUpdateParameters the parameters used when updating a storage account. -type AccountPropertiesUpdateParameters struct { - // CustomDomain - Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - // Encryption - Provides the encryption settings on the account. The default setting is unencrypted. - Encryption *Encryption `json:"encryption,omitempty"` - // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' - AccessTier AccessTier `json:"accessTier,omitempty"` - // EnableAzureFilesAadIntegration - Enables Azure Files AAD Integration for SMB if sets to true. - EnableAzureFilesAadIntegration *bool `json:"azureFilesAadIntegration,omitempty"` - // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. - EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` - // NetworkRuleSet - Network rule set - NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` -} - -// AccountRegenerateKeyParameters the parameters used to regenerate the storage account key. -type AccountRegenerateKeyParameters struct { - // KeyName - The name of storage keys that want to be regenerated, possible values are key1, key2. - KeyName *string `json:"keyName,omitempty"` -} - -// AccountSasParameters the parameters to list SAS credentials of a storage account. -type AccountSasParameters struct { - // Services - The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'B', 'Q', 'T', 'F' - Services Services `json:"signedServices,omitempty"` - // ResourceTypes - The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 'SignedResourceTypesS', 'SignedResourceTypesC', 'SignedResourceTypesO' - ResourceTypes SignedResourceTypes `json:"signedResourceTypes,omitempty"` - // Permissions - The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P' - Permissions Permissions `json:"signedPermission,omitempty"` - // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests. - IPAddressOrRange *string `json:"signedIp,omitempty"` - // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS' - Protocols HTTPProtocol `json:"signedProtocol,omitempty"` - // SharedAccessStartTime - The time at which the SAS becomes valid. - SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` - // SharedAccessExpiryTime - The time at which the shared access signature becomes invalid. - SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` - // KeyToSign - The key to sign the account SAS token with. - KeyToSign *string `json:"keyToSign,omitempty"` -} - -// AccountsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type AccountsCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AccountsCreateFuture) Result(client AccountsClient) (a Account, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("storage.AccountsCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { - a, err = client.CreateResponder(a.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", a.Response.Response, "Failure responding to request") - } - } - return -} - -// AccountsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type AccountsFailoverFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AccountsFailoverFuture) Result(client AccountsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsFailoverFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("storage.AccountsFailoverFuture") - return - } - ar.Response = future.Response() - return -} - -// AccountUpdateParameters the parameters that can be provided when updating the storage account -// properties. -type AccountUpdateParameters struct { - // Sku - Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. - Sku *Sku `json:"sku,omitempty"` - // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. - Tags map[string]*string `json:"tags"` - // Identity - The identity of the resource. - Identity *Identity `json:"identity,omitempty"` - // AccountPropertiesUpdateParameters - The parameters used when updating a storage account. - *AccountPropertiesUpdateParameters `json:"properties,omitempty"` - // Kind - Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - Kind Kind `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountUpdateParameters. -func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aup.Sku != nil { - objectMap["sku"] = aup.Sku - } - if aup.Tags != nil { - objectMap["tags"] = aup.Tags - } - if aup.Identity != nil { - objectMap["identity"] = aup.Identity - } - if aup.AccountPropertiesUpdateParameters != nil { - objectMap["properties"] = aup.AccountPropertiesUpdateParameters - } - if aup.Kind != "" { - objectMap["kind"] = aup.Kind - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. -func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - aup.Sku = &sku - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - aup.Tags = tags - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - aup.Identity = &identity - } - case "properties": - if v != nil { - var accountPropertiesUpdateParameters AccountPropertiesUpdateParameters - err = json.Unmarshal(*v, &accountPropertiesUpdateParameters) - if err != nil { - return err - } - aup.AccountPropertiesUpdateParameters = &accountPropertiesUpdateParameters - } - case "kind": - if v != nil { - var kind Kind - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - aup.Kind = kind - } - } - } - - return nil -} - -// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. -type AzureEntityResource struct { - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// BlobContainer properties of the blob container, including Id, resource name, resource type, Etag. -type BlobContainer struct { - autorest.Response `json:"-"` - // ContainerProperties - Properties of the blob container. - *ContainerProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for BlobContainer. -func (bc BlobContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bc.ContainerProperties != nil { - objectMap["properties"] = bc.ContainerProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BlobContainer struct. -func (bc *BlobContainer) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerProperties ContainerProperties - err = json.Unmarshal(*v, &containerProperties) - if err != nil { - return err - } - bc.ContainerProperties = &containerProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bc.Type = &typeVar - } - } - } - - return nil -} - -// BlobServiceProperties the properties of a storage account’s Blob service. -type BlobServiceProperties struct { - autorest.Response `json:"-"` - // BlobServicePropertiesProperties - The properties of a storage account’s Blob service. - *BlobServicePropertiesProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for BlobServiceProperties. -func (bsp BlobServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bsp.BlobServicePropertiesProperties != nil { - objectMap["properties"] = bsp.BlobServicePropertiesProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BlobServiceProperties struct. -func (bsp *BlobServiceProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var blobServiceProperties BlobServicePropertiesProperties - err = json.Unmarshal(*v, &blobServiceProperties) - if err != nil { - return err - } - bsp.BlobServicePropertiesProperties = &blobServiceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bsp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bsp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bsp.Type = &typeVar - } - } - } - - return nil -} - -// BlobServicePropertiesProperties the properties of a storage account’s Blob service. -type BlobServicePropertiesProperties struct { - // Cors - Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. - Cors *CorsRules `json:"cors,omitempty"` - // DefaultServiceVersion - DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. - DefaultServiceVersion *string `json:"defaultServiceVersion,omitempty"` - // DeleteRetentionPolicy - The blob service properties for soft delete. - DeleteRetentionPolicy *DeleteRetentionPolicy `json:"deleteRetentionPolicy,omitempty"` -} - -// CheckNameAvailabilityResult the CheckNameAvailability operation response. -type CheckNameAvailabilityResult struct { - autorest.Response `json:"-"` - // NameAvailable - READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. - NameAvailable *bool `json:"nameAvailable,omitempty"` - // Reason - READ-ONLY; Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists' - Reason Reason `json:"reason,omitempty"` - // Message - READ-ONLY; Gets an error message explaining the Reason value in more detail. - Message *string `json:"message,omitempty"` -} - -// ContainerProperties the properties of a container. -type ContainerProperties struct { - // PublicAccess - Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'PublicAccessContainer', 'PublicAccessBlob', 'PublicAccessNone' - PublicAccess PublicAccess `json:"publicAccess,omitempty"` - // LastModifiedTime - READ-ONLY; Returns the date and time the container was last modified. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // LeaseStatus - READ-ONLY; The lease status of the container. Possible values include: 'LeaseStatusLocked', 'LeaseStatusUnlocked' - LeaseStatus LeaseStatus `json:"leaseStatus,omitempty"` - // LeaseState - READ-ONLY; Lease state of the container. Possible values include: 'LeaseStateAvailable', 'LeaseStateLeased', 'LeaseStateExpired', 'LeaseStateBreaking', 'LeaseStateBroken' - LeaseState LeaseState `json:"leaseState,omitempty"` - // LeaseDuration - READ-ONLY; Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed' - LeaseDuration LeaseDuration `json:"leaseDuration,omitempty"` - // Metadata - A name-value pair to associate with the container as metadata. - Metadata map[string]*string `json:"metadata"` - // ImmutabilityPolicy - READ-ONLY; The ImmutabilityPolicy property of the container. - ImmutabilityPolicy *ImmutabilityPolicyProperties `json:"immutabilityPolicy,omitempty"` - // LegalHold - READ-ONLY; The LegalHold property of the container. - LegalHold *LegalHoldProperties `json:"legalHold,omitempty"` - // HasLegalHold - READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. - HasLegalHold *bool `json:"hasLegalHold,omitempty"` - // HasImmutabilityPolicy - READ-ONLY; The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. - HasImmutabilityPolicy *bool `json:"hasImmutabilityPolicy,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerProperties. -func (cp ContainerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cp.PublicAccess != "" { - objectMap["publicAccess"] = cp.PublicAccess - } - if cp.Metadata != nil { - objectMap["metadata"] = cp.Metadata - } - return json.Marshal(objectMap) -} - -// CorsRule specifies a CORS rule for the Blob service. -type CorsRule struct { - // AllowedOrigins - Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains - AllowedOrigins *[]string `json:"allowedOrigins,omitempty"` - // AllowedMethods - Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. - AllowedMethods *[]string `json:"allowedMethods,omitempty"` - // MaxAgeInSeconds - Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response. - MaxAgeInSeconds *int32 `json:"maxAgeInSeconds,omitempty"` - // ExposedHeaders - Required if CorsRule element is present. A list of response headers to expose to CORS clients. - ExposedHeaders *[]string `json:"exposedHeaders,omitempty"` - // AllowedHeaders - Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. - AllowedHeaders *[]string `json:"allowedHeaders,omitempty"` -} - -// CorsRules sets the CORS rules. You can include up to five CorsRule elements in the request. -type CorsRules struct { - // CorsRules - The List of CORS rules. You can include up to five CorsRule elements in the request. - CorsRules *[]CorsRule `json:"corsRules,omitempty"` -} - -// CustomDomain the custom domain assigned to this storage account. This can be set via Update. -type CustomDomain struct { - // Name - Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. - Name *string `json:"name,omitempty"` - // UseSubDomainName - Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. - UseSubDomainName *bool `json:"useSubDomainName,omitempty"` -} - -// DeleteRetentionPolicy the blob service properties for soft delete. -type DeleteRetentionPolicy struct { - // Enabled - Indicates whether DeleteRetentionPolicy is enabled for the Blob service. - Enabled *bool `json:"enabled,omitempty"` - // Days - Indicates the number of days that the deleted blob should be retained. The minimum specified value can be 1 and the maximum value can be 365. - Days *int32 `json:"days,omitempty"` -} - -// Dimension dimension of blobs, possibly be blob type or access tier. -type Dimension struct { - // Name - Display name of dimension. - Name *string `json:"name,omitempty"` - // DisplayName - Display name of dimension. - DisplayName *string `json:"displayName,omitempty"` -} - -// Encryption the encryption settings on the storage account. -type Encryption struct { - // Services - List of services which support encryption. - Services *EncryptionServices `json:"services,omitempty"` - // KeySource - The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'MicrosoftStorage', 'MicrosoftKeyvault' - KeySource KeySource `json:"keySource,omitempty"` - // KeyVaultProperties - Properties provided by key vault. - KeyVaultProperties *KeyVaultProperties `json:"keyvaultproperties,omitempty"` -} - -// EncryptionService a service that allows server-side encryption to be used. -type EncryptionService struct { - // Enabled - A boolean indicating whether or not the service encrypts the data as it is stored. - Enabled *bool `json:"enabled,omitempty"` - // LastEnabledTime - READ-ONLY; Gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. - LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"` -} - -// EncryptionServices a list of services that support encryption. -type EncryptionServices struct { - // Blob - The encryption function of the blob storage service. - Blob *EncryptionService `json:"blob,omitempty"` - // File - The encryption function of the file storage service. - File *EncryptionService `json:"file,omitempty"` - // Table - READ-ONLY; The encryption function of the table storage service. - Table *EncryptionService `json:"table,omitempty"` - // Queue - READ-ONLY; The encryption function of the queue storage service. - Queue *EncryptionService `json:"queue,omitempty"` -} - -// Endpoints the URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs -// object. -type Endpoints struct { - // Blob - READ-ONLY; Gets the blob endpoint. - Blob *string `json:"blob,omitempty"` - // Queue - READ-ONLY; Gets the queue endpoint. - Queue *string `json:"queue,omitempty"` - // Table - READ-ONLY; Gets the table endpoint. - Table *string `json:"table,omitempty"` - // File - READ-ONLY; Gets the file endpoint. - File *string `json:"file,omitempty"` - // Web - READ-ONLY; Gets the web endpoint. - Web *string `json:"web,omitempty"` - // Dfs - READ-ONLY; Gets the dfs endpoint. - Dfs *string `json:"dfs,omitempty"` -} - -// GeoReplicationStats statistics related to replication for storage account's Blob, Table, Queue and File -// services. It is only available when geo-redundant replication is enabled for the storage account. -type GeoReplicationStats struct { - // Status - READ-ONLY; The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location is temporarily unavailable. Possible values include: 'GeoReplicationStatusLive', 'GeoReplicationStatusBootstrap', 'GeoReplicationStatusUnavailable' - Status GeoReplicationStatus `json:"status,omitempty"` - // LastSyncTime - READ-ONLY; All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap. - LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` - // CanFailover - READ-ONLY; A boolean flag which indicates whether or not account failover is supported for the account. - CanFailover *bool `json:"canFailover,omitempty"` -} - -// Identity identity for the resource. -type Identity struct { - // PrincipalID - READ-ONLY; The principal ID of resource identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant ID of resource. - TenantID *string `json:"tenantId,omitempty"` - // Type - The identity type. - Type *string `json:"type,omitempty"` -} - -// ImmutabilityPolicy the ImmutabilityPolicy property of a blob container, including Id, resource name, -// resource type, Etag. -type ImmutabilityPolicy struct { - autorest.Response `json:"-"` - // ImmutabilityPolicyProperty - The properties of an ImmutabilityPolicy of a blob container. - *ImmutabilityPolicyProperty `json:"properties,omitempty"` - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImmutabilityPolicy. -func (IP ImmutabilityPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if IP.ImmutabilityPolicyProperty != nil { - objectMap["properties"] = IP.ImmutabilityPolicyProperty - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ImmutabilityPolicy struct. -func (IP *ImmutabilityPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var immutabilityPolicyProperty ImmutabilityPolicyProperty - err = json.Unmarshal(*v, &immutabilityPolicyProperty) - if err != nil { - return err - } - IP.ImmutabilityPolicyProperty = &immutabilityPolicyProperty - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - IP.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - IP.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - IP.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - IP.Type = &typeVar - } - } - } - - return nil -} - -// ImmutabilityPolicyProperties the properties of an ImmutabilityPolicy of a blob container. -type ImmutabilityPolicyProperties struct { - // ImmutabilityPolicyProperty - The properties of an ImmutabilityPolicy of a blob container. - *ImmutabilityPolicyProperty `json:"properties,omitempty"` - // Etag - READ-ONLY; ImmutabilityPolicy Etag. - Etag *string `json:"etag,omitempty"` - // UpdateHistory - READ-ONLY; The ImmutabilityPolicy update history of the blob container. - UpdateHistory *[]UpdateHistoryProperty `json:"updateHistory,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImmutabilityPolicyProperties. -func (ipp ImmutabilityPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ipp.ImmutabilityPolicyProperty != nil { - objectMap["properties"] = ipp.ImmutabilityPolicyProperty - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ImmutabilityPolicyProperties struct. -func (ipp *ImmutabilityPolicyProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var immutabilityPolicyProperty ImmutabilityPolicyProperty - err = json.Unmarshal(*v, &immutabilityPolicyProperty) - if err != nil { - return err - } - ipp.ImmutabilityPolicyProperty = &immutabilityPolicyProperty - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ipp.Etag = &etag - } - case "updateHistory": - if v != nil { - var updateHistory []UpdateHistoryProperty - err = json.Unmarshal(*v, &updateHistory) - if err != nil { - return err - } - ipp.UpdateHistory = &updateHistory - } - } - } - - return nil -} - -// ImmutabilityPolicyProperty the properties of an ImmutabilityPolicy of a blob container. -type ImmutabilityPolicyProperty struct { - // ImmutabilityPeriodSinceCreationInDays - The immutability period for the blobs in the container since the policy creation, in days. - ImmutabilityPeriodSinceCreationInDays *int32 `json:"immutabilityPeriodSinceCreationInDays,omitempty"` - // State - READ-ONLY; The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked' - State ImmutabilityPolicyState `json:"state,omitempty"` -} - -// IPRule IP rule with specific IP or IP range in CIDR format. -type IPRule struct { - // IPAddressOrRange - Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. - IPAddressOrRange *string `json:"value,omitempty"` - // Action - The action of IP ACL rule. Possible values include: 'Allow' - Action Action `json:"action,omitempty"` -} - -// KeyVaultProperties properties of key vault. -type KeyVaultProperties struct { - // KeyName - The name of KeyVault key. - KeyName *string `json:"keyname,omitempty"` - // KeyVersion - The version of KeyVault key. - KeyVersion *string `json:"keyversion,omitempty"` - // KeyVaultURI - The Uri of KeyVault. - KeyVaultURI *string `json:"keyvaulturi,omitempty"` -} - -// LeaseContainerRequest lease Container request schema. -type LeaseContainerRequest struct { - // Action - Specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break' - Action Action1 `json:"action,omitempty"` - // LeaseID - Identifies the lease. Can be specified in any valid GUID string format. - LeaseID *string `json:"leaseId,omitempty"` - // BreakPeriod - Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. - BreakPeriod *int32 `json:"breakPeriod,omitempty"` - // LeaseDuration - Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. - LeaseDuration *int32 `json:"leaseDuration,omitempty"` - // ProposedLeaseID - Optional for acquire, required for change. Proposed lease ID, in a GUID string format. - ProposedLeaseID *string `json:"proposedLeaseId,omitempty"` -} - -// LeaseContainerResponse lease Container response schema. -type LeaseContainerResponse struct { - autorest.Response `json:"-"` - // LeaseID - Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. - LeaseID *string `json:"leaseId,omitempty"` - // LeaseTimeSeconds - Approximate time remaining in the lease period, in seconds. - LeaseTimeSeconds *string `json:"leaseTimeSeconds,omitempty"` -} - -// LegalHold the LegalHold property of a blob container. -type LegalHold struct { - autorest.Response `json:"-"` - // HasLegalHold - READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. - HasLegalHold *bool `json:"hasLegalHold,omitempty"` - // Tags - Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. - Tags *[]string `json:"tags,omitempty"` -} - -// LegalHoldProperties the LegalHold property of a blob container. -type LegalHoldProperties struct { - // HasLegalHold - READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. - HasLegalHold *bool `json:"hasLegalHold,omitempty"` - // Tags - The list of LegalHold tags of a blob container. - Tags *[]TagProperty `json:"tags,omitempty"` -} - -// ListAccountSasResponse the List SAS credentials operation response. -type ListAccountSasResponse struct { - autorest.Response `json:"-"` - // AccountSasToken - READ-ONLY; List SAS credentials of storage account. - AccountSasToken *string `json:"accountSasToken,omitempty"` -} - -// ListContainerItem the blob container properties be listed out. -type ListContainerItem struct { - // ContainerProperties - The blob container properties be listed out. - *ContainerProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ListContainerItem. -func (lci ListContainerItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lci.ContainerProperties != nil { - objectMap["properties"] = lci.ContainerProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ListContainerItem struct. -func (lci *ListContainerItem) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerProperties ContainerProperties - err = json.Unmarshal(*v, &containerProperties) - if err != nil { - return err - } - lci.ContainerProperties = &containerProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - lci.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lci.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lci.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lci.Type = &typeVar - } - } - } - - return nil -} - -// ListContainerItems the list of blob containers. -type ListContainerItems struct { - autorest.Response `json:"-"` - // Value - The list of blob containers. - Value *[]ListContainerItem `json:"value,omitempty"` -} - -// ListServiceSasResponse the List service SAS credentials operation response. -type ListServiceSasResponse struct { - autorest.Response `json:"-"` - // ServiceSasToken - READ-ONLY; List service SAS credentials of specific resource. - ServiceSasToken *string `json:"serviceSasToken,omitempty"` -} - -// ManagementPoliciesRules the Storage Account ManagementPolicies Rules, in JSON format. See more details -// in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. -type ManagementPoliciesRules struct { - // Policy - The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - Policy interface{} `json:"policy,omitempty"` -} - -// ManagementPoliciesRulesSetParameter the Storage Account ManagementPolicies Rules, in JSON format. See -// more details in: -// https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. -type ManagementPoliciesRulesSetParameter struct { - // ManagementPoliciesRules - The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - *ManagementPoliciesRules `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagementPoliciesRulesSetParameter. -func (mprsp ManagementPoliciesRulesSetParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mprsp.ManagementPoliciesRules != nil { - objectMap["properties"] = mprsp.ManagementPoliciesRules - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagementPoliciesRulesSetParameter struct. -func (mprsp *ManagementPoliciesRulesSetParameter) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var managementPoliciesRules ManagementPoliciesRules - err = json.Unmarshal(*v, &managementPoliciesRules) - if err != nil { - return err - } - mprsp.ManagementPoliciesRules = &managementPoliciesRules - } - } - } - - return nil -} - -// MetricSpecification metric specification of operation. -type MetricSpecification struct { - // Name - Name of metric specification. - Name *string `json:"name,omitempty"` - // DisplayName - Display name of metric specification. - DisplayName *string `json:"displayName,omitempty"` - // DisplayDescription - Display description of metric specification. - DisplayDescription *string `json:"displayDescription,omitempty"` - // Unit - Unit could be Bytes or Count. - Unit *string `json:"unit,omitempty"` - // Dimensions - Dimensions of blobs, including blob type and access tier. - Dimensions *[]Dimension `json:"dimensions,omitempty"` - // AggregationType - Aggregation type could be Average. - AggregationType *string `json:"aggregationType,omitempty"` - // FillGapWithZero - The property to decide fill gap with zero or not. - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` - // Category - The category this metric specification belong to, could be Capacity. - Category *string `json:"category,omitempty"` - // ResourceIDDimensionNameOverride - Account Resource Id. - ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` -} - -// NetworkRuleSet network rule set -type NetworkRuleSet struct { - // Bypass - Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices' - Bypass Bypass `json:"bypass,omitempty"` - // VirtualNetworkRules - Sets the virtual network rules - VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` - // IPRules - Sets the IP ACL rules - IPRules *[]IPRule `json:"ipRules,omitempty"` - // DefaultAction - Specifies the default action of allow or deny when no other rules match. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny' - DefaultAction DefaultAction `json:"defaultAction,omitempty"` -} - -// Operation storage REST API operation definition. -type Operation struct { - // Name - Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` - // Display - Display metadata associated with the operation. - Display *OperationDisplay `json:"display,omitempty"` - // Origin - The origin of operations. - Origin *string `json:"origin,omitempty"` - // OperationProperties - Properties of operation, include metric specifications. - *OperationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if o.Name != nil { - objectMap["name"] = o.Name - } - if o.Display != nil { - objectMap["display"] = o.Display - } - if o.Origin != nil { - objectMap["origin"] = o.Origin - } - if o.OperationProperties != nil { - objectMap["properties"] = o.OperationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Operation struct. -func (o *Operation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - o.Name = &name - } - case "display": - if v != nil { - var display OperationDisplay - err = json.Unmarshal(*v, &display) - if err != nil { - return err - } - o.Display = &display - } - case "origin": - if v != nil { - var origin string - err = json.Unmarshal(*v, &origin) - if err != nil { - return err - } - o.Origin = &origin - } - case "properties": - if v != nil { - var operationProperties OperationProperties - err = json.Unmarshal(*v, &operationProperties) - if err != nil { - return err - } - o.OperationProperties = &operationProperties - } - } - } - - return nil -} - -// OperationDisplay display metadata associated with the operation. -type OperationDisplay struct { - // Provider - Service provider: Microsoft Storage. - Provider *string `json:"provider,omitempty"` - // Resource - Resource on which the operation is performed etc. - Resource *string `json:"resource,omitempty"` - // Operation - Type of operation: get, read, delete, etc. - Operation *string `json:"operation,omitempty"` - // Description - Description of the operation. - Description *string `json:"description,omitempty"` -} - -// OperationListResult result of the request to list Storage operations. It contains a list of operations -// and a URL link to get the next set of results. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of Storage operations supported by the Storage resource provider. - Value *[]Operation `json:"value,omitempty"` -} - -// OperationProperties properties of operation, include metric specifications. -type OperationProperties struct { - // ServiceSpecification - One property of operation, include metric specifications. - ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than -// required location and tags -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// Resource ... -type Resource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// Restriction the restriction because of which SKU cannot be used. -type Restriction struct { - // Type - READ-ONLY; The type of restrictions. As of now only possible value for this is location. - Type *string `json:"type,omitempty"` - // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. - Values *[]string `json:"values,omitempty"` - // ReasonCode - The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaID', 'NotAvailableForSubscription' - ReasonCode ReasonCode `json:"reasonCode,omitempty"` -} - -// ServiceSasParameters the parameters to list service SAS credentials of a specific resource. -type ServiceSasParameters struct { - // CanonicalizedResource - The canonical path to the signed resource. - CanonicalizedResource *string `json:"canonicalizedResource,omitempty"` - // Resource - The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'SignedResourceB', 'SignedResourceC', 'SignedResourceF', 'SignedResourceS' - Resource SignedResource `json:"signedResource,omitempty"` - // Permissions - The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P' - Permissions Permissions `json:"signedPermission,omitempty"` - // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests. - IPAddressOrRange *string `json:"signedIp,omitempty"` - // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS' - Protocols HTTPProtocol `json:"signedProtocol,omitempty"` - // SharedAccessStartTime - The time at which the SAS becomes valid. - SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` - // SharedAccessExpiryTime - The time at which the shared access signature becomes invalid. - SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` - // Identifier - A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. - Identifier *string `json:"signedIdentifier,omitempty"` - // PartitionKeyStart - The start of partition key. - PartitionKeyStart *string `json:"startPk,omitempty"` - // PartitionKeyEnd - The end of partition key. - PartitionKeyEnd *string `json:"endPk,omitempty"` - // RowKeyStart - The start of row key. - RowKeyStart *string `json:"startRk,omitempty"` - // RowKeyEnd - The end of row key. - RowKeyEnd *string `json:"endRk,omitempty"` - // KeyToSign - The key to sign the account SAS token with. - KeyToSign *string `json:"keyToSign,omitempty"` - // CacheControl - The response header override for cache control. - CacheControl *string `json:"rscc,omitempty"` - // ContentDisposition - The response header override for content disposition. - ContentDisposition *string `json:"rscd,omitempty"` - // ContentEncoding - The response header override for content encoding. - ContentEncoding *string `json:"rsce,omitempty"` - // ContentLanguage - The response header override for content language. - ContentLanguage *string `json:"rscl,omitempty"` - // ContentType - The response header override for content type. - ContentType *string `json:"rsct,omitempty"` -} - -// ServiceSpecification one property of operation, include metric specifications. -type ServiceSpecification struct { - // MetricSpecifications - Metric specifications of operation. - MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` -} - -// Sku the SKU of the storage account. -type Sku struct { - // Name - Gets or sets the SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. Possible values include: 'StandardLRS', 'StandardGRS', 'StandardRAGRS', 'StandardZRS', 'PremiumLRS', 'PremiumZRS' - Name SkuName `json:"name,omitempty"` - // Tier - READ-ONLY; Gets the SKU tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' - Tier SkuTier `json:"tier,omitempty"` - // ResourceType - READ-ONLY; The type of the resource, usually it is 'storageAccounts'. - ResourceType *string `json:"resourceType,omitempty"` - // Kind - READ-ONLY; Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - Kind Kind `json:"kind,omitempty"` - // Locations - READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). - Locations *[]string `json:"locations,omitempty"` - // Capabilities - READ-ONLY; The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. - Capabilities *[]SKUCapability `json:"capabilities,omitempty"` - // Restrictions - The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions *[]Restriction `json:"restrictions,omitempty"` -} - -// SKUCapability the capability information in the specified SKU, including file encryption, network ACLs, -// change notification, etc. -type SKUCapability struct { - // Name - READ-ONLY; The name of capability, The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. - Name *string `json:"name,omitempty"` - // Value - READ-ONLY; A string value to indicate states of given capability. Possibly 'true' or 'false'. - Value *string `json:"value,omitempty"` -} - -// SkuListResult the response from the List Storage SKUs operation. -type SkuListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Get the list result of storage SKUs and their properties. - Value *[]Sku `json:"value,omitempty"` -} - -// TagProperty a tag of the LegalHold of a blob container. -type TagProperty struct { - // Tag - READ-ONLY; The tag value. - Tag *string `json:"tag,omitempty"` - // Timestamp - READ-ONLY; Returns the date and time the tag was added. - Timestamp *date.Time `json:"timestamp,omitempty"` - // ObjectIdentifier - READ-ONLY; Returns the Object ID of the user who added the tag. - ObjectIdentifier *string `json:"objectIdentifier,omitempty"` - // TenantID - READ-ONLY; Returns the Tenant ID that issued the token for the user who added the tag. - TenantID *string `json:"tenantId,omitempty"` - // Upn - READ-ONLY; Returns the User Principal Name of the user who added the tag. - Upn *string `json:"upn,omitempty"` -} - -// TrackedResource the resource model definition for a ARM tracked top level resource -type TrackedResource struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Tags != nil { - objectMap["tags"] = tr.Tags - } - if tr.Location != nil { - objectMap["location"] = tr.Location - } - return json.Marshal(objectMap) -} - -// UpdateHistoryProperty an update history of the ImmutabilityPolicy of a blob container. -type UpdateHistoryProperty struct { - // Update - READ-ONLY; The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. Possible values include: 'Put', 'Lock', 'Extend' - Update ImmutabilityPolicyUpdateType `json:"update,omitempty"` - // ImmutabilityPeriodSinceCreationInDays - READ-ONLY; The immutability period for the blobs in the container since the policy creation, in days. - ImmutabilityPeriodSinceCreationInDays *int32 `json:"immutabilityPeriodSinceCreationInDays,omitempty"` - // Timestamp - READ-ONLY; Returns the date and time the ImmutabilityPolicy was updated. - Timestamp *date.Time `json:"timestamp,omitempty"` - // ObjectIdentifier - READ-ONLY; Returns the Object ID of the user who updated the ImmutabilityPolicy. - ObjectIdentifier *string `json:"objectIdentifier,omitempty"` - // TenantID - READ-ONLY; Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. - TenantID *string `json:"tenantId,omitempty"` - // Upn - READ-ONLY; Returns the User Principal Name of the user who updated the ImmutabilityPolicy. - Upn *string `json:"upn,omitempty"` -} - -// Usage describes Storage Resource Usage. -type Usage struct { - // Unit - READ-ONLY; Gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond' - Unit UsageUnit `json:"unit,omitempty"` - // CurrentValue - READ-ONLY; Gets the current count of the allocated resources in the subscription. - CurrentValue *int32 `json:"currentValue,omitempty"` - // Limit - READ-ONLY; Gets the maximum count of the resources that can be allocated in the subscription. - Limit *int32 `json:"limit,omitempty"` - // Name - READ-ONLY; Gets the name of the type of usage. - Name *UsageName `json:"name,omitempty"` -} - -// UsageListResult the response from the List Usages operation. -type UsageListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets the list of Storage Resource Usages. - Value *[]Usage `json:"value,omitempty"` -} - -// UsageName the usage names that can be used; currently limited to StorageAccount. -type UsageName struct { - // Value - READ-ONLY; Gets a string describing the resource name. - Value *string `json:"value,omitempty"` - // LocalizedValue - READ-ONLY; Gets a localized string describing the resource name. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// VirtualNetworkRule virtual Network rule. -type VirtualNetworkRule struct { - // VirtualNetworkResourceID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - VirtualNetworkResourceID *string `json:"id,omitempty"` - // Action - The action of virtual network rule. Possible values include: 'Allow' - Action Action `json:"action,omitempty"` - // State - Gets the state of virtual network rule. Possible values include: 'StateProvisioning', 'StateDeprovisioning', 'StateSucceeded', 'StateFailed', 'StateNetworkSourceDeleted' - State State `json:"state,omitempty"` -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/operations.go deleted file mode 100644 index bc7d019419bf..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/operations.go +++ /dev/null @@ -1,109 +0,0 @@ -package storage - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the the Azure Storage Management API. -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all of the available Storage Rest API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Storage/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/skus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/skus.go deleted file mode 100644 index 879a4ded4652..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/skus.go +++ /dev/null @@ -1,120 +0,0 @@ -package storage - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SkusClient is the the Azure Storage Management API. -type SkusClient struct { - BaseClient -} - -// NewSkusClient creates an instance of the SkusClient client. -func NewSkusClient(subscriptionID string) SkusClient { - return NewSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSkusClientWithBaseURI creates an instance of the SkusClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { - return SkusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists the available SKUs supported by Microsoft.Storage for given subscription. -func (client SkusClient) List(ctx context.Context) (result SkuListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.SkusClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client SkusClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SkusClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SkusClient) ListResponder(resp *http.Response) (result SkuListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/usages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/usages.go deleted file mode 100644 index 9397264cee5b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/usages.go +++ /dev/null @@ -1,123 +0,0 @@ -package storage - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsagesClient is the the Azure Storage Management API. -type UsagesClient struct { - BaseClient -} - -// NewUsagesClient creates an instance of the UsagesClient client. -func NewUsagesClient(subscriptionID string) UsagesClient { - return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { - return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByLocation gets the current usage count and the limit for the resources of the location under the subscription. -// Parameters: -// location - the location of the Azure Storage resource. -func (client UsagesClient) ListByLocation(ctx context.Context, location string) (result UsageListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.ListByLocation") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("storage.UsagesClient", "ListByLocation", err.Error()) - } - - req, err := client.ListByLocationPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.UsagesClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.UsagesClient", "ListByLocation", resp, "Failure sending request") - return - } - - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.UsagesClient", "ListByLocation", resp, "Failure responding to request") - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client UsagesClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client UsagesClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client UsagesClient) ListByLocationResponder(resp *http.Response) (result UsageListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/version.go deleted file mode 100644 index 057f5706547a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage/version.go +++ /dev/null @@ -1,30 +0,0 @@ -package storage - -import "github.com/Azure/azure-sdk-for-go/version" - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " storage/2018-07-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/CHANGELOG.md new file mode 100644 index 000000000000..f455fd3a7344 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/CHANGELOG.md @@ -0,0 +1,10 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/storage/resource-manager/readme.md tag: `package-2019-06` + +Code generator @microsoft.azure/autorest.go@2.1.178 + + +### New Funcs + +1. *AccountsCreateFuture.UnmarshalJSON([]byte) error +1. *AccountsFailoverFuture.UnmarshalJSON([]byte) error +1. *AccountsRestoreBlobRangesFuture.UnmarshalJSON([]byte) error diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/accounts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/accounts.go index 6ac5d3235462..bb99b9e30fa0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/accounts.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/accounts.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -82,6 +71,7 @@ func (client AccountsClient) CheckNameAvailability(ctx context.Context, accountN result, err = client.CheckNameAvailabilityResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", resp, "Failure responding to request") + return } return @@ -119,7 +109,6 @@ func (client AccountsClient) CheckNameAvailabilitySender(req *http.Request) (*ht func (client AccountsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -142,8 +131,8 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Create") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -188,7 +177,7 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin result, err = client.CreateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", nil, "Failure sending request") return } @@ -226,7 +215,10 @@ func (client AccountsClient) CreateSender(req *http.Request) (future AccountsCre if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -235,7 +227,6 @@ func (client AccountsClient) CreateSender(req *http.Request) (future AccountsCre func (client AccountsClient) CreateResponder(resp *http.Response) (result Account, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -289,6 +280,7 @@ func (client AccountsClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", resp, "Failure responding to request") + return } return @@ -326,7 +318,6 @@ func (client AccountsClient) DeleteSender(req *http.Request) (*http.Response, er func (client AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -346,8 +337,8 @@ func (client AccountsClient) Failover(ctx context.Context, resourceGroupName str ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Failover") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -373,7 +364,7 @@ func (client AccountsClient) Failover(ctx context.Context, resourceGroupName str result, err = client.FailoverSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Failover", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Failover", nil, "Failure sending request") return } @@ -409,7 +400,10 @@ func (client AccountsClient) FailoverSender(req *http.Request) (future AccountsF if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -418,7 +412,6 @@ func (client AccountsClient) FailoverSender(req *http.Request) (future AccountsF func (client AccountsClient) FailoverResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -474,6 +467,7 @@ func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupNam result, err = client.GetPropertiesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", resp, "Failure responding to request") + return } return @@ -514,7 +508,6 @@ func (client AccountsClient) GetPropertiesSender(req *http.Request) (*http.Respo func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result Account, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -558,6 +551,11 @@ func (client AccountsClient) List(ctx context.Context) (result AccountListResult result.alr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", resp, "Failure responding to request") + return + } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -593,7 +591,6 @@ func (client AccountsClient) ListSender(req *http.Request) (*http.Response, erro func (client AccountsClient) ListResponder(resp *http.Response) (result AccountListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -687,6 +684,7 @@ func (client AccountsClient) ListAccountSAS(ctx context.Context, resourceGroupNa result, err = client.ListAccountSASResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListAccountSAS", resp, "Failure responding to request") + return } return @@ -726,7 +724,6 @@ func (client AccountsClient) ListAccountSASSender(req *http.Request) (*http.Resp func (client AccountsClient) ListAccountSASResponder(resp *http.Response) (result ListAccountSasResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -776,6 +773,7 @@ func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGr result, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + return } return @@ -812,7 +810,6 @@ func (client AccountsClient) ListByResourceGroupSender(req *http.Request) (*http func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -867,6 +864,7 @@ func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName str result, err = client.ListKeysResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", resp, "Failure responding to request") + return } return @@ -907,7 +905,6 @@ func (client AccountsClient) ListKeysSender(req *http.Request) (*http.Response, func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountListKeysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -966,6 +963,7 @@ func (client AccountsClient) ListServiceSAS(ctx context.Context, resourceGroupNa result, err = client.ListServiceSASResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListServiceSAS", resp, "Failure responding to request") + return } return @@ -1005,7 +1003,6 @@ func (client AccountsClient) ListServiceSASSender(req *http.Request) (*http.Resp func (client AccountsClient) ListServiceSASResponder(resp *http.Response) (result ListServiceSasResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1062,6 +1059,7 @@ func (client AccountsClient) RegenerateKey(ctx context.Context, resourceGroupNam result, err = client.RegenerateKeyResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", resp, "Failure responding to request") + return } return @@ -1101,7 +1099,6 @@ func (client AccountsClient) RegenerateKeySender(req *http.Request) (*http.Respo func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result AccountListKeysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1121,8 +1118,8 @@ func (client AccountsClient) RestoreBlobRanges(ctx context.Context, resourceGrou ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.RestoreBlobRanges") defer func() { sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -1151,7 +1148,7 @@ func (client AccountsClient) RestoreBlobRanges(ctx context.Context, resourceGrou result, err = client.RestoreBlobRangesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RestoreBlobRanges", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RestoreBlobRanges", nil, "Failure sending request") return } @@ -1189,7 +1186,10 @@ func (client AccountsClient) RestoreBlobRangesSender(req *http.Request) (future if err != nil { return } - future.Future, err = azure.NewFutureFromResponse(resp) + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result return } @@ -1198,7 +1198,6 @@ func (client AccountsClient) RestoreBlobRangesSender(req *http.Request) (future func (client AccountsClient) RestoreBlobRangesResponder(resp *http.Response) (result BlobRestoreStatus, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1252,6 +1251,7 @@ func (client AccountsClient) RevokeUserDelegationKeys(ctx context.Context, resou result, err = client.RevokeUserDelegationKeysResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RevokeUserDelegationKeys", resp, "Failure responding to request") + return } return @@ -1289,7 +1289,6 @@ func (client AccountsClient) RevokeUserDelegationKeysSender(req *http.Request) ( func (client AccountsClient) RevokeUserDelegationKeysResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -1348,6 +1347,7 @@ func (client AccountsClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", resp, "Failure responding to request") + return } return @@ -1387,7 +1387,6 @@ func (client AccountsClient) UpdateSender(req *http.Request) (*http.Response, er func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/blobcontainers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/blobcontainers.go index 79cd2688269e..6d09490a099c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/blobcontainers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/blobcontainers.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -98,6 +87,7 @@ func (client BlobContainersClient) ClearLegalHold(ctx context.Context, resourceG result, err = client.ClearLegalHoldResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ClearLegalHold", resp, "Failure responding to request") + return } return @@ -139,7 +129,6 @@ func (client BlobContainersClient) ClearLegalHoldSender(req *http.Request) (*htt func (client BlobContainersClient) ClearLegalHoldResponder(resp *http.Response) (result LegalHold, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -202,6 +191,7 @@ func (client BlobContainersClient) Create(ctx context.Context, resourceGroupName result, err = client.CreateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Create", resp, "Failure responding to request") + return } return @@ -242,7 +232,6 @@ func (client BlobContainersClient) CreateSender(req *http.Request) (*http.Respon func (client BlobContainersClient) CreateResponder(resp *http.Response) (result BlobContainer, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -310,6 +299,7 @@ func (client BlobContainersClient) CreateOrUpdateImmutabilityPolicy(ctx context. result, err = client.CreateOrUpdateImmutabilityPolicyResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "CreateOrUpdateImmutabilityPolicy", resp, "Failure responding to request") + return } return @@ -358,7 +348,6 @@ func (client BlobContainersClient) CreateOrUpdateImmutabilityPolicySender(req *h func (client BlobContainersClient) CreateOrUpdateImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -418,6 +407,7 @@ func (client BlobContainersClient) Delete(ctx context.Context, resourceGroupName result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Delete", resp, "Failure responding to request") + return } return @@ -456,7 +446,6 @@ func (client BlobContainersClient) DeleteSender(req *http.Request) (*http.Respon func (client BlobContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -465,8 +454,8 @@ func (client BlobContainersClient) DeleteResponder(resp *http.Response) (result // DeleteImmutabilityPolicy aborts an unlocked immutability policy. The response of delete has // immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked -// immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the -// container. +// immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside +// the policy locked container. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. @@ -521,6 +510,7 @@ func (client BlobContainersClient) DeleteImmutabilityPolicy(ctx context.Context, result, err = client.DeleteImmutabilityPolicyResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "DeleteImmutabilityPolicy", resp, "Failure responding to request") + return } return @@ -561,7 +551,6 @@ func (client BlobContainersClient) DeleteImmutabilityPolicySender(req *http.Requ func (client BlobContainersClient) DeleteImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -629,6 +618,7 @@ func (client BlobContainersClient) ExtendImmutabilityPolicy(ctx context.Context, result, err = client.ExtendImmutabilityPolicyResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ExtendImmutabilityPolicy", resp, "Failure responding to request") + return } return @@ -673,7 +663,6 @@ func (client BlobContainersClient) ExtendImmutabilityPolicySender(req *http.Requ func (client BlobContainersClient) ExtendImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -733,6 +722,7 @@ func (client BlobContainersClient) Get(ctx context.Context, resourceGroupName st result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Get", resp, "Failure responding to request") + return } return @@ -771,7 +761,6 @@ func (client BlobContainersClient) GetSender(req *http.Request) (*http.Response, func (client BlobContainersClient) GetResponder(resp *http.Response) (result BlobContainer, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -835,6 +824,7 @@ func (client BlobContainersClient) GetImmutabilityPolicy(ctx context.Context, re result, err = client.GetImmutabilityPolicyResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "GetImmutabilityPolicy", resp, "Failure responding to request") + return } return @@ -878,7 +868,6 @@ func (client BlobContainersClient) GetImmutabilityPolicySender(req *http.Request func (client BlobContainersClient) GetImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -940,6 +929,7 @@ func (client BlobContainersClient) Lease(ctx context.Context, resourceGroupName result, err = client.LeaseResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Lease", resp, "Failure responding to request") + return } return @@ -983,7 +973,6 @@ func (client BlobContainersClient) LeaseSender(req *http.Request) (*http.Respons func (client BlobContainersClient) LeaseResponder(resp *http.Response) (result LeaseContainerResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1042,6 +1031,11 @@ func (client BlobContainersClient) List(ctx context.Context, resourceGroupName s result.lci, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "List", resp, "Failure responding to request") + return + } + if result.lci.hasNextLink() && result.lci.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -1088,7 +1082,6 @@ func (client BlobContainersClient) ListSender(req *http.Request) (*http.Response func (client BlobContainersClient) ListResponder(resp *http.Response) (result ListContainerItems, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1189,6 +1182,7 @@ func (client BlobContainersClient) LockImmutabilityPolicy(ctx context.Context, r result, err = client.LockImmutabilityPolicyResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "LockImmutabilityPolicy", resp, "Failure responding to request") + return } return @@ -1228,7 +1222,6 @@ func (client BlobContainersClient) LockImmutabilityPolicySender(req *http.Reques func (client BlobContainersClient) LockImmutabilityPolicyResponder(resp *http.Response) (result ImmutabilityPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1292,6 +1285,7 @@ func (client BlobContainersClient) SetLegalHold(ctx context.Context, resourceGro result, err = client.SetLegalHoldResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "SetLegalHold", resp, "Failure responding to request") + return } return @@ -1333,7 +1327,6 @@ func (client BlobContainersClient) SetLegalHoldSender(req *http.Request) (*http. func (client BlobContainersClient) SetLegalHoldResponder(resp *http.Response) (result LegalHold, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1395,6 +1388,7 @@ func (client BlobContainersClient) Update(ctx context.Context, resourceGroupName result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "Update", resp, "Failure responding to request") + return } return @@ -1435,7 +1429,6 @@ func (client BlobContainersClient) UpdateSender(req *http.Request) (*http.Respon func (client BlobContainersClient) UpdateResponder(resp *http.Response) (result BlobContainer, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/blobservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/blobservices.go index 198ef47b2034..7eebcf4ad956 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/blobservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/blobservices.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -89,6 +78,7 @@ func (client BlobServicesClient) GetServiceProperties(ctx context.Context, resou result, err = client.GetServicePropertiesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "GetServiceProperties", resp, "Failure responding to request") + return } return @@ -127,7 +117,6 @@ func (client BlobServicesClient) GetServicePropertiesSender(req *http.Request) ( func (client BlobServicesClient) GetServicePropertiesResponder(resp *http.Response) (result BlobServiceProperties, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -181,6 +170,7 @@ func (client BlobServicesClient) List(ctx context.Context, resourceGroupName str result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "List", resp, "Failure responding to request") + return } return @@ -218,7 +208,6 @@ func (client BlobServicesClient) ListSender(req *http.Request) (*http.Response, func (client BlobServicesClient) ListResponder(resp *http.Response) (result BlobServiceItems, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -297,6 +286,7 @@ func (client BlobServicesClient) SetServiceProperties(ctx context.Context, resou result, err = client.SetServicePropertiesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobServicesClient", "SetServiceProperties", resp, "Failure responding to request") + return } return @@ -338,7 +328,6 @@ func (client BlobServicesClient) SetServicePropertiesSender(req *http.Request) ( func (client BlobServicesClient) SetServicePropertiesResponder(resp *http.Response) (result BlobServiceProperties, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/client.go index af6ab21c698f..689b44529880 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/client.go @@ -3,19 +3,8 @@ // The Azure Storage Management API. package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/encryptionscopes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/encryptionscopes.go index 23176009fd5c..aad90b84a290 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/encryptionscopes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/encryptionscopes.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -95,6 +84,7 @@ func (client EncryptionScopesClient) Get(ctx context.Context, resourceGroupName result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.EncryptionScopesClient", "Get", resp, "Failure responding to request") + return } return @@ -133,7 +123,6 @@ func (client EncryptionScopesClient) GetSender(req *http.Request) (*http.Respons func (client EncryptionScopesClient) GetResponder(resp *http.Response) (result EncryptionScope, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,6 +177,11 @@ func (client EncryptionScopesClient) List(ctx context.Context, resourceGroupName result.eslr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.EncryptionScopesClient", "List", resp, "Failure responding to request") + return + } + if result.eslr.hasNextLink() && result.eslr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -225,7 +219,6 @@ func (client EncryptionScopesClient) ListSender(req *http.Request) (*http.Respon func (client EncryptionScopesClient) ListResponder(resp *http.Response) (result EncryptionScopeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -324,6 +317,7 @@ func (client EncryptionScopesClient) Patch(ctx context.Context, resourceGroupNam result, err = client.PatchResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.EncryptionScopesClient", "Patch", resp, "Failure responding to request") + return } return @@ -364,7 +358,6 @@ func (client EncryptionScopesClient) PatchSender(req *http.Request) (*http.Respo func (client EncryptionScopesClient) PatchResponder(resp *http.Response) (result EncryptionScope, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -427,6 +420,7 @@ func (client EncryptionScopesClient) Put(ctx context.Context, resourceGroupName result, err = client.PutResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.EncryptionScopesClient", "Put", resp, "Failure responding to request") + return } return @@ -467,7 +461,6 @@ func (client EncryptionScopesClient) PutSender(req *http.Request) (*http.Respons func (client EncryptionScopesClient) PutResponder(resp *http.Response) (result EncryptionScope, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/enums.go new file mode 100644 index 000000000000..5dbcc9d0fd76 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/enums.go @@ -0,0 +1,784 @@ +package storage + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AccessTier enumerates the values for access tier. +type AccessTier string + +const ( + // Cool ... + Cool AccessTier = "Cool" + // Hot ... + Hot AccessTier = "Hot" +) + +// PossibleAccessTierValues returns an array of possible values for the AccessTier const type. +func PossibleAccessTierValues() []AccessTier { + return []AccessTier{Cool, Hot} +} + +// AccountExpand enumerates the values for account expand. +type AccountExpand string + +const ( + // AccountExpandBlobRestoreStatus ... + AccountExpandBlobRestoreStatus AccountExpand = "blobRestoreStatus" + // AccountExpandGeoReplicationStats ... + AccountExpandGeoReplicationStats AccountExpand = "geoReplicationStats" +) + +// PossibleAccountExpandValues returns an array of possible values for the AccountExpand const type. +func PossibleAccountExpandValues() []AccountExpand { + return []AccountExpand{AccountExpandBlobRestoreStatus, AccountExpandGeoReplicationStats} +} + +// AccountStatus enumerates the values for account status. +type AccountStatus string + +const ( + // Available ... + Available AccountStatus = "available" + // Unavailable ... + Unavailable AccountStatus = "unavailable" +) + +// PossibleAccountStatusValues returns an array of possible values for the AccountStatus const type. +func PossibleAccountStatusValues() []AccountStatus { + return []AccountStatus{Available, Unavailable} +} + +// Action enumerates the values for action. +type Action string + +const ( + // Allow ... + Allow Action = "Allow" +) + +// PossibleActionValues returns an array of possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{Allow} +} + +// Action1 enumerates the values for action 1. +type Action1 string + +const ( + // Acquire ... + Acquire Action1 = "Acquire" + // Break ... + Break Action1 = "Break" + // Change ... + Change Action1 = "Change" + // Release ... + Release Action1 = "Release" + // Renew ... + Renew Action1 = "Renew" +) + +// PossibleAction1Values returns an array of possible values for the Action1 const type. +func PossibleAction1Values() []Action1 { + return []Action1{Acquire, Break, Change, Release, Renew} +} + +// BlobRestoreProgressStatus enumerates the values for blob restore progress status. +type BlobRestoreProgressStatus string + +const ( + // Complete ... + Complete BlobRestoreProgressStatus = "Complete" + // Failed ... + Failed BlobRestoreProgressStatus = "Failed" + // InProgress ... + InProgress BlobRestoreProgressStatus = "InProgress" +) + +// PossibleBlobRestoreProgressStatusValues returns an array of possible values for the BlobRestoreProgressStatus const type. +func PossibleBlobRestoreProgressStatusValues() []BlobRestoreProgressStatus { + return []BlobRestoreProgressStatus{Complete, Failed, InProgress} +} + +// Bypass enumerates the values for bypass. +type Bypass string + +const ( + // AzureServices ... + AzureServices Bypass = "AzureServices" + // Logging ... + Logging Bypass = "Logging" + // Metrics ... + Metrics Bypass = "Metrics" + // None ... + None Bypass = "None" +) + +// PossibleBypassValues returns an array of possible values for the Bypass const type. +func PossibleBypassValues() []Bypass { + return []Bypass{AzureServices, Logging, Metrics, None} +} + +// DefaultAction enumerates the values for default action. +type DefaultAction string + +const ( + // DefaultActionAllow ... + DefaultActionAllow DefaultAction = "Allow" + // DefaultActionDeny ... + DefaultActionDeny DefaultAction = "Deny" +) + +// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. +func PossibleDefaultActionValues() []DefaultAction { + return []DefaultAction{DefaultActionAllow, DefaultActionDeny} +} + +// DirectoryServiceOptions enumerates the values for directory service options. +type DirectoryServiceOptions string + +const ( + // DirectoryServiceOptionsAADDS ... + DirectoryServiceOptionsAADDS DirectoryServiceOptions = "AADDS" + // DirectoryServiceOptionsAD ... + DirectoryServiceOptionsAD DirectoryServiceOptions = "AD" + // DirectoryServiceOptionsNone ... + DirectoryServiceOptionsNone DirectoryServiceOptions = "None" +) + +// PossibleDirectoryServiceOptionsValues returns an array of possible values for the DirectoryServiceOptions const type. +func PossibleDirectoryServiceOptionsValues() []DirectoryServiceOptions { + return []DirectoryServiceOptions{DirectoryServiceOptionsAADDS, DirectoryServiceOptionsAD, DirectoryServiceOptionsNone} +} + +// EnabledProtocols enumerates the values for enabled protocols. +type EnabledProtocols string + +const ( + // NFS ... + NFS EnabledProtocols = "NFS" + // SMB ... + SMB EnabledProtocols = "SMB" +) + +// PossibleEnabledProtocolsValues returns an array of possible values for the EnabledProtocols const type. +func PossibleEnabledProtocolsValues() []EnabledProtocols { + return []EnabledProtocols{NFS, SMB} +} + +// EncryptionScopeSource enumerates the values for encryption scope source. +type EncryptionScopeSource string + +const ( + // MicrosoftKeyVault ... + MicrosoftKeyVault EncryptionScopeSource = "Microsoft.KeyVault" + // MicrosoftStorage ... + MicrosoftStorage EncryptionScopeSource = "Microsoft.Storage" +) + +// PossibleEncryptionScopeSourceValues returns an array of possible values for the EncryptionScopeSource const type. +func PossibleEncryptionScopeSourceValues() []EncryptionScopeSource { + return []EncryptionScopeSource{MicrosoftKeyVault, MicrosoftStorage} +} + +// EncryptionScopeState enumerates the values for encryption scope state. +type EncryptionScopeState string + +const ( + // Disabled ... + Disabled EncryptionScopeState = "Disabled" + // Enabled ... + Enabled EncryptionScopeState = "Enabled" +) + +// PossibleEncryptionScopeStateValues returns an array of possible values for the EncryptionScopeState const type. +func PossibleEncryptionScopeStateValues() []EncryptionScopeState { + return []EncryptionScopeState{Disabled, Enabled} +} + +// GeoReplicationStatus enumerates the values for geo replication status. +type GeoReplicationStatus string + +const ( + // GeoReplicationStatusBootstrap ... + GeoReplicationStatusBootstrap GeoReplicationStatus = "Bootstrap" + // GeoReplicationStatusLive ... + GeoReplicationStatusLive GeoReplicationStatus = "Live" + // GeoReplicationStatusUnavailable ... + GeoReplicationStatusUnavailable GeoReplicationStatus = "Unavailable" +) + +// PossibleGeoReplicationStatusValues returns an array of possible values for the GeoReplicationStatus const type. +func PossibleGeoReplicationStatusValues() []GeoReplicationStatus { + return []GeoReplicationStatus{GeoReplicationStatusBootstrap, GeoReplicationStatusLive, GeoReplicationStatusUnavailable} +} + +// GetShareExpand enumerates the values for get share expand. +type GetShareExpand string + +const ( + // Stats ... + Stats GetShareExpand = "stats" +) + +// PossibleGetShareExpandValues returns an array of possible values for the GetShareExpand const type. +func PossibleGetShareExpandValues() []GetShareExpand { + return []GetShareExpand{Stats} +} + +// HTTPProtocol enumerates the values for http protocol. +type HTTPProtocol string + +const ( + // HTTPS ... + HTTPS HTTPProtocol = "https" + // Httpshttp ... + Httpshttp HTTPProtocol = "https,http" +) + +// PossibleHTTPProtocolValues returns an array of possible values for the HTTPProtocol const type. +func PossibleHTTPProtocolValues() []HTTPProtocol { + return []HTTPProtocol{HTTPS, Httpshttp} +} + +// ImmutabilityPolicyState enumerates the values for immutability policy state. +type ImmutabilityPolicyState string + +const ( + // Locked ... + Locked ImmutabilityPolicyState = "Locked" + // Unlocked ... + Unlocked ImmutabilityPolicyState = "Unlocked" +) + +// PossibleImmutabilityPolicyStateValues returns an array of possible values for the ImmutabilityPolicyState const type. +func PossibleImmutabilityPolicyStateValues() []ImmutabilityPolicyState { + return []ImmutabilityPolicyState{Locked, Unlocked} +} + +// ImmutabilityPolicyUpdateType enumerates the values for immutability policy update type. +type ImmutabilityPolicyUpdateType string + +const ( + // Extend ... + Extend ImmutabilityPolicyUpdateType = "extend" + // Lock ... + Lock ImmutabilityPolicyUpdateType = "lock" + // Put ... + Put ImmutabilityPolicyUpdateType = "put" +) + +// PossibleImmutabilityPolicyUpdateTypeValues returns an array of possible values for the ImmutabilityPolicyUpdateType const type. +func PossibleImmutabilityPolicyUpdateTypeValues() []ImmutabilityPolicyUpdateType { + return []ImmutabilityPolicyUpdateType{Extend, Lock, Put} +} + +// KeyPermission enumerates the values for key permission. +type KeyPermission string + +const ( + // Full ... + Full KeyPermission = "Full" + // Read ... + Read KeyPermission = "Read" +) + +// PossibleKeyPermissionValues returns an array of possible values for the KeyPermission const type. +func PossibleKeyPermissionValues() []KeyPermission { + return []KeyPermission{Full, Read} +} + +// KeySource enumerates the values for key source. +type KeySource string + +const ( + // KeySourceMicrosoftKeyvault ... + KeySourceMicrosoftKeyvault KeySource = "Microsoft.Keyvault" + // KeySourceMicrosoftStorage ... + KeySourceMicrosoftStorage KeySource = "Microsoft.Storage" +) + +// PossibleKeySourceValues returns an array of possible values for the KeySource const type. +func PossibleKeySourceValues() []KeySource { + return []KeySource{KeySourceMicrosoftKeyvault, KeySourceMicrosoftStorage} +} + +// KeyType enumerates the values for key type. +type KeyType string + +const ( + // KeyTypeAccount ... + KeyTypeAccount KeyType = "Account" + // KeyTypeService ... + KeyTypeService KeyType = "Service" +) + +// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{KeyTypeAccount, KeyTypeService} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // BlobStorage ... + BlobStorage Kind = "BlobStorage" + // BlockBlobStorage ... + BlockBlobStorage Kind = "BlockBlobStorage" + // FileStorage ... + FileStorage Kind = "FileStorage" + // Storage ... + Storage Kind = "Storage" + // StorageV2 ... + StorageV2 Kind = "StorageV2" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{BlobStorage, BlockBlobStorage, FileStorage, Storage, StorageV2} +} + +// LargeFileSharesState enumerates the values for large file shares state. +type LargeFileSharesState string + +const ( + // LargeFileSharesStateDisabled ... + LargeFileSharesStateDisabled LargeFileSharesState = "Disabled" + // LargeFileSharesStateEnabled ... + LargeFileSharesStateEnabled LargeFileSharesState = "Enabled" +) + +// PossibleLargeFileSharesStateValues returns an array of possible values for the LargeFileSharesState const type. +func PossibleLargeFileSharesStateValues() []LargeFileSharesState { + return []LargeFileSharesState{LargeFileSharesStateDisabled, LargeFileSharesStateEnabled} +} + +// LeaseDuration enumerates the values for lease duration. +type LeaseDuration string + +const ( + // Fixed ... + Fixed LeaseDuration = "Fixed" + // Infinite ... + Infinite LeaseDuration = "Infinite" +) + +// PossibleLeaseDurationValues returns an array of possible values for the LeaseDuration const type. +func PossibleLeaseDurationValues() []LeaseDuration { + return []LeaseDuration{Fixed, Infinite} +} + +// LeaseState enumerates the values for lease state. +type LeaseState string + +const ( + // LeaseStateAvailable ... + LeaseStateAvailable LeaseState = "Available" + // LeaseStateBreaking ... + LeaseStateBreaking LeaseState = "Breaking" + // LeaseStateBroken ... + LeaseStateBroken LeaseState = "Broken" + // LeaseStateExpired ... + LeaseStateExpired LeaseState = "Expired" + // LeaseStateLeased ... + LeaseStateLeased LeaseState = "Leased" +) + +// PossibleLeaseStateValues returns an array of possible values for the LeaseState const type. +func PossibleLeaseStateValues() []LeaseState { + return []LeaseState{LeaseStateAvailable, LeaseStateBreaking, LeaseStateBroken, LeaseStateExpired, LeaseStateLeased} +} + +// LeaseStatus enumerates the values for lease status. +type LeaseStatus string + +const ( + // LeaseStatusLocked ... + LeaseStatusLocked LeaseStatus = "Locked" + // LeaseStatusUnlocked ... + LeaseStatusUnlocked LeaseStatus = "Unlocked" +) + +// PossibleLeaseStatusValues returns an array of possible values for the LeaseStatus const type. +func PossibleLeaseStatusValues() []LeaseStatus { + return []LeaseStatus{LeaseStatusLocked, LeaseStatusUnlocked} +} + +// ListContainersInclude enumerates the values for list containers include. +type ListContainersInclude string + +const ( + // Deleted ... + Deleted ListContainersInclude = "deleted" +) + +// PossibleListContainersIncludeValues returns an array of possible values for the ListContainersInclude const type. +func PossibleListContainersIncludeValues() []ListContainersInclude { + return []ListContainersInclude{Deleted} +} + +// ListKeyExpand enumerates the values for list key expand. +type ListKeyExpand string + +const ( + // Kerb ... + Kerb ListKeyExpand = "kerb" +) + +// PossibleListKeyExpandValues returns an array of possible values for the ListKeyExpand const type. +func PossibleListKeyExpandValues() []ListKeyExpand { + return []ListKeyExpand{Kerb} +} + +// ListSharesExpand enumerates the values for list shares expand. +type ListSharesExpand string + +const ( + // ListSharesExpandDeleted ... + ListSharesExpandDeleted ListSharesExpand = "deleted" +) + +// PossibleListSharesExpandValues returns an array of possible values for the ListSharesExpand const type. +func PossibleListSharesExpandValues() []ListSharesExpand { + return []ListSharesExpand{ListSharesExpandDeleted} +} + +// MinimumTLSVersion enumerates the values for minimum tls version. +type MinimumTLSVersion string + +const ( + // TLS10 ... + TLS10 MinimumTLSVersion = "TLS1_0" + // TLS11 ... + TLS11 MinimumTLSVersion = "TLS1_1" + // TLS12 ... + TLS12 MinimumTLSVersion = "TLS1_2" +) + +// PossibleMinimumTLSVersionValues returns an array of possible values for the MinimumTLSVersion const type. +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return []MinimumTLSVersion{TLS10, TLS11, TLS12} +} + +// Permissions enumerates the values for permissions. +type Permissions string + +const ( + // A ... + A Permissions = "a" + // C ... + C Permissions = "c" + // D ... + D Permissions = "d" + // L ... + L Permissions = "l" + // P ... + P Permissions = "p" + // R ... + R Permissions = "r" + // U ... + U Permissions = "u" + // W ... + W Permissions = "w" +) + +// PossiblePermissionsValues returns an array of possible values for the Permissions const type. +func PossiblePermissionsValues() []Permissions { + return []Permissions{A, C, D, L, P, R, U, W} +} + +// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection +// provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + // PrivateEndpointConnectionProvisioningStateCreating ... + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + // PrivateEndpointConnectionProvisioningStateDeleting ... + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + // PrivateEndpointConnectionProvisioningStateFailed ... + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateSucceeded ... + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded} +} + +// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // Approved ... + Approved PrivateEndpointServiceConnectionStatus = "Approved" + // Pending ... + Pending PrivateEndpointServiceConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{Approved, Pending, Rejected} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Creating ... + Creating ProvisioningState = "Creating" + // ResolvingDNS ... + ResolvingDNS ProvisioningState = "ResolvingDNS" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Creating, ResolvingDNS, Succeeded} +} + +// PublicAccess enumerates the values for public access. +type PublicAccess string + +const ( + // PublicAccessBlob ... + PublicAccessBlob PublicAccess = "Blob" + // PublicAccessContainer ... + PublicAccessContainer PublicAccess = "Container" + // PublicAccessNone ... + PublicAccessNone PublicAccess = "None" +) + +// PossiblePublicAccessValues returns an array of possible values for the PublicAccess const type. +func PossiblePublicAccessValues() []PublicAccess { + return []PublicAccess{PublicAccessBlob, PublicAccessContainer, PublicAccessNone} +} + +// Reason enumerates the values for reason. +type Reason string + +const ( + // AccountNameInvalid ... + AccountNameInvalid Reason = "AccountNameInvalid" + // AlreadyExists ... + AlreadyExists Reason = "AlreadyExists" +) + +// PossibleReasonValues returns an array of possible values for the Reason const type. +func PossibleReasonValues() []Reason { + return []Reason{AccountNameInvalid, AlreadyExists} +} + +// ReasonCode enumerates the values for reason code. +type ReasonCode string + +const ( + // NotAvailableForSubscription ... + NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription" + // QuotaID ... + QuotaID ReasonCode = "QuotaId" +) + +// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type. +func PossibleReasonCodeValues() []ReasonCode { + return []ReasonCode{NotAvailableForSubscription, QuotaID} +} + +// RootSquashType enumerates the values for root squash type. +type RootSquashType string + +const ( + // AllSquash ... + AllSquash RootSquashType = "AllSquash" + // NoRootSquash ... + NoRootSquash RootSquashType = "NoRootSquash" + // RootSquash ... + RootSquash RootSquashType = "RootSquash" +) + +// PossibleRootSquashTypeValues returns an array of possible values for the RootSquashType const type. +func PossibleRootSquashTypeValues() []RootSquashType { + return []RootSquashType{AllSquash, NoRootSquash, RootSquash} +} + +// RoutingChoice enumerates the values for routing choice. +type RoutingChoice string + +const ( + // InternetRouting ... + InternetRouting RoutingChoice = "InternetRouting" + // MicrosoftRouting ... + MicrosoftRouting RoutingChoice = "MicrosoftRouting" +) + +// PossibleRoutingChoiceValues returns an array of possible values for the RoutingChoice const type. +func PossibleRoutingChoiceValues() []RoutingChoice { + return []RoutingChoice{InternetRouting, MicrosoftRouting} +} + +// Services enumerates the values for services. +type Services string + +const ( + // B ... + B Services = "b" + // F ... + F Services = "f" + // Q ... + Q Services = "q" + // T ... + T Services = "t" +) + +// PossibleServicesValues returns an array of possible values for the Services const type. +func PossibleServicesValues() []Services { + return []Services{B, F, Q, T} +} + +// ShareAccessTier enumerates the values for share access tier. +type ShareAccessTier string + +const ( + // ShareAccessTierCool ... + ShareAccessTierCool ShareAccessTier = "Cool" + // ShareAccessTierHot ... + ShareAccessTierHot ShareAccessTier = "Hot" + // ShareAccessTierPremium ... + ShareAccessTierPremium ShareAccessTier = "Premium" + // ShareAccessTierTransactionOptimized ... + ShareAccessTierTransactionOptimized ShareAccessTier = "TransactionOptimized" +) + +// PossibleShareAccessTierValues returns an array of possible values for the ShareAccessTier const type. +func PossibleShareAccessTierValues() []ShareAccessTier { + return []ShareAccessTier{ShareAccessTierCool, ShareAccessTierHot, ShareAccessTierPremium, ShareAccessTierTransactionOptimized} +} + +// SignedResource enumerates the values for signed resource. +type SignedResource string + +const ( + // SignedResourceB ... + SignedResourceB SignedResource = "b" + // SignedResourceC ... + SignedResourceC SignedResource = "c" + // SignedResourceF ... + SignedResourceF SignedResource = "f" + // SignedResourceS ... + SignedResourceS SignedResource = "s" +) + +// PossibleSignedResourceValues returns an array of possible values for the SignedResource const type. +func PossibleSignedResourceValues() []SignedResource { + return []SignedResource{SignedResourceB, SignedResourceC, SignedResourceF, SignedResourceS} +} + +// SignedResourceTypes enumerates the values for signed resource types. +type SignedResourceTypes string + +const ( + // SignedResourceTypesC ... + SignedResourceTypesC SignedResourceTypes = "c" + // SignedResourceTypesO ... + SignedResourceTypesO SignedResourceTypes = "o" + // SignedResourceTypesS ... + SignedResourceTypesS SignedResourceTypes = "s" +) + +// PossibleSignedResourceTypesValues returns an array of possible values for the SignedResourceTypes const type. +func PossibleSignedResourceTypesValues() []SignedResourceTypes { + return []SignedResourceTypes{SignedResourceTypesC, SignedResourceTypesO, SignedResourceTypesS} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // PremiumLRS ... + PremiumLRS SkuName = "Premium_LRS" + // PremiumZRS ... + PremiumZRS SkuName = "Premium_ZRS" + // StandardGRS ... + StandardGRS SkuName = "Standard_GRS" + // StandardGZRS ... + StandardGZRS SkuName = "Standard_GZRS" + // StandardLRS ... + StandardLRS SkuName = "Standard_LRS" + // StandardRAGRS ... + StandardRAGRS SkuName = "Standard_RAGRS" + // StandardRAGZRS ... + StandardRAGZRS SkuName = "Standard_RAGZRS" + // StandardZRS ... + StandardZRS SkuName = "Standard_ZRS" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{PremiumLRS, PremiumZRS, StandardGRS, StandardGZRS, StandardLRS, StandardRAGRS, StandardRAGZRS, StandardZRS} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // Premium ... + Premium SkuTier = "Premium" + // Standard ... + Standard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Premium, Standard} +} + +// State enumerates the values for state. +type State string + +const ( + // StateDeprovisioning ... + StateDeprovisioning State = "deprovisioning" + // StateFailed ... + StateFailed State = "failed" + // StateNetworkSourceDeleted ... + StateNetworkSourceDeleted State = "networkSourceDeleted" + // StateProvisioning ... + StateProvisioning State = "provisioning" + // StateSucceeded ... + StateSucceeded State = "succeeded" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{StateDeprovisioning, StateFailed, StateNetworkSourceDeleted, StateProvisioning, StateSucceeded} +} + +// UsageUnit enumerates the values for usage unit. +type UsageUnit string + +const ( + // Bytes ... + Bytes UsageUnit = "Bytes" + // BytesPerSecond ... + BytesPerSecond UsageUnit = "BytesPerSecond" + // Count ... + Count UsageUnit = "Count" + // CountsPerSecond ... + CountsPerSecond UsageUnit = "CountsPerSecond" + // Percent ... + Percent UsageUnit = "Percent" + // Seconds ... + Seconds UsageUnit = "Seconds" +) + +// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. +func PossibleUsageUnitValues() []UsageUnit { + return []UsageUnit{Bytes, BytesPerSecond, Count, CountsPerSecond, Percent, Seconds} +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/fileservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/fileservices.go index 7c3e7689b40a..6589e7d82724 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/fileservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/fileservices.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -89,6 +78,7 @@ func (client FileServicesClient) GetServiceProperties(ctx context.Context, resou result, err = client.GetServicePropertiesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "GetServiceProperties", resp, "Failure responding to request") + return } return @@ -127,7 +117,6 @@ func (client FileServicesClient) GetServicePropertiesSender(req *http.Request) ( func (client FileServicesClient) GetServicePropertiesResponder(resp *http.Response) (result FileServiceProperties, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -181,6 +170,7 @@ func (client FileServicesClient) List(ctx context.Context, resourceGroupName str result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "List", resp, "Failure responding to request") + return } return @@ -218,7 +208,6 @@ func (client FileServicesClient) ListSender(req *http.Request) (*http.Response, func (client FileServicesClient) ListResponder(resp *http.Response) (result FileServiceItems, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -284,6 +273,7 @@ func (client FileServicesClient) SetServiceProperties(ctx context.Context, resou result, err = client.SetServicePropertiesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.FileServicesClient", "SetServiceProperties", resp, "Failure responding to request") + return } return @@ -325,7 +315,6 @@ func (client FileServicesClient) SetServicePropertiesSender(req *http.Request) ( func (client FileServicesClient) SetServicePropertiesResponder(resp *http.Response) (result FileServiceProperties, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/fileshares.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/fileshares.go index 5991c6ffb42c..43bec0596f36 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/fileshares.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/fileshares.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -103,6 +92,7 @@ func (client FileSharesClient) Create(ctx context.Context, resourceGroupName str result, err = client.CreateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Create", resp, "Failure responding to request") + return } return @@ -143,7 +133,6 @@ func (client FileSharesClient) CreateSender(req *http.Request) (*http.Response, func (client FileSharesClient) CreateResponder(resp *http.Response) (result FileShare, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -203,6 +192,7 @@ func (client FileSharesClient) Delete(ctx context.Context, resourceGroupName str result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Delete", resp, "Failure responding to request") + return } return @@ -241,7 +231,6 @@ func (client FileSharesClient) DeleteSender(req *http.Request) (*http.Response, func (client FileSharesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -301,6 +290,7 @@ func (client FileSharesClient) Get(ctx context.Context, resourceGroupName string result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Get", resp, "Failure responding to request") + return } return @@ -342,7 +332,6 @@ func (client FileSharesClient) GetSender(req *http.Request) (*http.Response, err func (client FileSharesClient) GetResponder(resp *http.Response) (result FileShare, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -400,6 +389,11 @@ func (client FileSharesClient) List(ctx context.Context, resourceGroupName strin result.fsi, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "List", resp, "Failure responding to request") + return + } + if result.fsi.hasNextLink() && result.fsi.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -446,7 +440,6 @@ func (client FileSharesClient) ListSender(req *http.Request) (*http.Response, er func (client FileSharesClient) ListResponder(resp *http.Response) (result FileShareItems, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -546,6 +539,7 @@ func (client FileSharesClient) Restore(ctx context.Context, resourceGroupName st result, err = client.RestoreResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Restore", resp, "Failure responding to request") + return } return @@ -586,7 +580,6 @@ func (client FileSharesClient) RestoreSender(req *http.Request) (*http.Response, func (client FileSharesClient) RestoreResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -647,6 +640,7 @@ func (client FileSharesClient) Update(ctx context.Context, resourceGroupName str result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Update", resp, "Failure responding to request") + return } return @@ -687,7 +681,6 @@ func (client FileSharesClient) UpdateSender(req *http.Request) (*http.Response, func (client FileSharesClient) UpdateResponder(resp *http.Response) (result FileShare, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/managementpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/managementpolicies.go index bce44a99753f..2543202c4c8f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/managementpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/managementpolicies.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -95,6 +84,7 @@ func (client ManagementPoliciesClient) CreateOrUpdate(ctx context.Context, resou result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -135,7 +125,6 @@ func (client ManagementPoliciesClient) CreateOrUpdateSender(req *http.Request) ( func (client ManagementPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ManagementPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,6 +178,7 @@ func (client ManagementPoliciesClient) Delete(ctx context.Context, resourceGroup result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "Delete", resp, "Failure responding to request") + return } return @@ -227,7 +217,6 @@ func (client ManagementPoliciesClient) DeleteSender(req *http.Request) (*http.Re func (client ManagementPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -280,6 +269,7 @@ func (client ManagementPoliciesClient) Get(ctx context.Context, resourceGroupNam result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.ManagementPoliciesClient", "Get", resp, "Failure responding to request") + return } return @@ -318,7 +308,6 @@ func (client ManagementPoliciesClient) GetSender(req *http.Request) (*http.Respo func (client ManagementPoliciesClient) GetResponder(resp *http.Response) (result ManagementPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/models.go index 57db327f83bf..15dca422b61e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/models.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -31,766 +20,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage" -// AccessTier enumerates the values for access tier. -type AccessTier string - -const ( - // Cool ... - Cool AccessTier = "Cool" - // Hot ... - Hot AccessTier = "Hot" -) - -// PossibleAccessTierValues returns an array of possible values for the AccessTier const type. -func PossibleAccessTierValues() []AccessTier { - return []AccessTier{Cool, Hot} -} - -// AccountExpand enumerates the values for account expand. -type AccountExpand string - -const ( - // AccountExpandBlobRestoreStatus ... - AccountExpandBlobRestoreStatus AccountExpand = "blobRestoreStatus" - // AccountExpandGeoReplicationStats ... - AccountExpandGeoReplicationStats AccountExpand = "geoReplicationStats" -) - -// PossibleAccountExpandValues returns an array of possible values for the AccountExpand const type. -func PossibleAccountExpandValues() []AccountExpand { - return []AccountExpand{AccountExpandBlobRestoreStatus, AccountExpandGeoReplicationStats} -} - -// AccountStatus enumerates the values for account status. -type AccountStatus string - -const ( - // Available ... - Available AccountStatus = "available" - // Unavailable ... - Unavailable AccountStatus = "unavailable" -) - -// PossibleAccountStatusValues returns an array of possible values for the AccountStatus const type. -func PossibleAccountStatusValues() []AccountStatus { - return []AccountStatus{Available, Unavailable} -} - -// Action enumerates the values for action. -type Action string - -const ( - // Allow ... - Allow Action = "Allow" -) - -// PossibleActionValues returns an array of possible values for the Action const type. -func PossibleActionValues() []Action { - return []Action{Allow} -} - -// Action1 enumerates the values for action 1. -type Action1 string - -const ( - // Acquire ... - Acquire Action1 = "Acquire" - // Break ... - Break Action1 = "Break" - // Change ... - Change Action1 = "Change" - // Release ... - Release Action1 = "Release" - // Renew ... - Renew Action1 = "Renew" -) - -// PossibleAction1Values returns an array of possible values for the Action1 const type. -func PossibleAction1Values() []Action1 { - return []Action1{Acquire, Break, Change, Release, Renew} -} - -// BlobRestoreProgressStatus enumerates the values for blob restore progress status. -type BlobRestoreProgressStatus string - -const ( - // Complete ... - Complete BlobRestoreProgressStatus = "Complete" - // Failed ... - Failed BlobRestoreProgressStatus = "Failed" - // InProgress ... - InProgress BlobRestoreProgressStatus = "InProgress" -) - -// PossibleBlobRestoreProgressStatusValues returns an array of possible values for the BlobRestoreProgressStatus const type. -func PossibleBlobRestoreProgressStatusValues() []BlobRestoreProgressStatus { - return []BlobRestoreProgressStatus{Complete, Failed, InProgress} -} - -// Bypass enumerates the values for bypass. -type Bypass string - -const ( - // AzureServices ... - AzureServices Bypass = "AzureServices" - // Logging ... - Logging Bypass = "Logging" - // Metrics ... - Metrics Bypass = "Metrics" - // None ... - None Bypass = "None" -) - -// PossibleBypassValues returns an array of possible values for the Bypass const type. -func PossibleBypassValues() []Bypass { - return []Bypass{AzureServices, Logging, Metrics, None} -} - -// DefaultAction enumerates the values for default action. -type DefaultAction string - -const ( - // DefaultActionAllow ... - DefaultActionAllow DefaultAction = "Allow" - // DefaultActionDeny ... - DefaultActionDeny DefaultAction = "Deny" -) - -// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. -func PossibleDefaultActionValues() []DefaultAction { - return []DefaultAction{DefaultActionAllow, DefaultActionDeny} -} - -// DirectoryServiceOptions enumerates the values for directory service options. -type DirectoryServiceOptions string - -const ( - // DirectoryServiceOptionsAADDS ... - DirectoryServiceOptionsAADDS DirectoryServiceOptions = "AADDS" - // DirectoryServiceOptionsAD ... - DirectoryServiceOptionsAD DirectoryServiceOptions = "AD" - // DirectoryServiceOptionsNone ... - DirectoryServiceOptionsNone DirectoryServiceOptions = "None" -) - -// PossibleDirectoryServiceOptionsValues returns an array of possible values for the DirectoryServiceOptions const type. -func PossibleDirectoryServiceOptionsValues() []DirectoryServiceOptions { - return []DirectoryServiceOptions{DirectoryServiceOptionsAADDS, DirectoryServiceOptionsAD, DirectoryServiceOptionsNone} -} - -// EnabledProtocols enumerates the values for enabled protocols. -type EnabledProtocols string - -const ( - // NFS ... - NFS EnabledProtocols = "NFS" - // SMB ... - SMB EnabledProtocols = "SMB" -) - -// PossibleEnabledProtocolsValues returns an array of possible values for the EnabledProtocols const type. -func PossibleEnabledProtocolsValues() []EnabledProtocols { - return []EnabledProtocols{NFS, SMB} -} - -// EncryptionScopeSource enumerates the values for encryption scope source. -type EncryptionScopeSource string - -const ( - // MicrosoftKeyVault ... - MicrosoftKeyVault EncryptionScopeSource = "Microsoft.KeyVault" - // MicrosoftStorage ... - MicrosoftStorage EncryptionScopeSource = "Microsoft.Storage" -) - -// PossibleEncryptionScopeSourceValues returns an array of possible values for the EncryptionScopeSource const type. -func PossibleEncryptionScopeSourceValues() []EncryptionScopeSource { - return []EncryptionScopeSource{MicrosoftKeyVault, MicrosoftStorage} -} - -// EncryptionScopeState enumerates the values for encryption scope state. -type EncryptionScopeState string - -const ( - // Disabled ... - Disabled EncryptionScopeState = "Disabled" - // Enabled ... - Enabled EncryptionScopeState = "Enabled" -) - -// PossibleEncryptionScopeStateValues returns an array of possible values for the EncryptionScopeState const type. -func PossibleEncryptionScopeStateValues() []EncryptionScopeState { - return []EncryptionScopeState{Disabled, Enabled} -} - -// GeoReplicationStatus enumerates the values for geo replication status. -type GeoReplicationStatus string - -const ( - // GeoReplicationStatusBootstrap ... - GeoReplicationStatusBootstrap GeoReplicationStatus = "Bootstrap" - // GeoReplicationStatusLive ... - GeoReplicationStatusLive GeoReplicationStatus = "Live" - // GeoReplicationStatusUnavailable ... - GeoReplicationStatusUnavailable GeoReplicationStatus = "Unavailable" -) - -// PossibleGeoReplicationStatusValues returns an array of possible values for the GeoReplicationStatus const type. -func PossibleGeoReplicationStatusValues() []GeoReplicationStatus { - return []GeoReplicationStatus{GeoReplicationStatusBootstrap, GeoReplicationStatusLive, GeoReplicationStatusUnavailable} -} - -// GetShareExpand enumerates the values for get share expand. -type GetShareExpand string - -const ( - // Stats ... - Stats GetShareExpand = "stats" -) - -// PossibleGetShareExpandValues returns an array of possible values for the GetShareExpand const type. -func PossibleGetShareExpandValues() []GetShareExpand { - return []GetShareExpand{Stats} -} - -// HTTPProtocol enumerates the values for http protocol. -type HTTPProtocol string - -const ( - // HTTPS ... - HTTPS HTTPProtocol = "https" - // Httpshttp ... - Httpshttp HTTPProtocol = "https,http" -) - -// PossibleHTTPProtocolValues returns an array of possible values for the HTTPProtocol const type. -func PossibleHTTPProtocolValues() []HTTPProtocol { - return []HTTPProtocol{HTTPS, Httpshttp} -} - -// ImmutabilityPolicyState enumerates the values for immutability policy state. -type ImmutabilityPolicyState string - -const ( - // Locked ... - Locked ImmutabilityPolicyState = "Locked" - // Unlocked ... - Unlocked ImmutabilityPolicyState = "Unlocked" -) - -// PossibleImmutabilityPolicyStateValues returns an array of possible values for the ImmutabilityPolicyState const type. -func PossibleImmutabilityPolicyStateValues() []ImmutabilityPolicyState { - return []ImmutabilityPolicyState{Locked, Unlocked} -} - -// ImmutabilityPolicyUpdateType enumerates the values for immutability policy update type. -type ImmutabilityPolicyUpdateType string - -const ( - // Extend ... - Extend ImmutabilityPolicyUpdateType = "extend" - // Lock ... - Lock ImmutabilityPolicyUpdateType = "lock" - // Put ... - Put ImmutabilityPolicyUpdateType = "put" -) - -// PossibleImmutabilityPolicyUpdateTypeValues returns an array of possible values for the ImmutabilityPolicyUpdateType const type. -func PossibleImmutabilityPolicyUpdateTypeValues() []ImmutabilityPolicyUpdateType { - return []ImmutabilityPolicyUpdateType{Extend, Lock, Put} -} - -// KeyPermission enumerates the values for key permission. -type KeyPermission string - -const ( - // Full ... - Full KeyPermission = "Full" - // Read ... - Read KeyPermission = "Read" -) - -// PossibleKeyPermissionValues returns an array of possible values for the KeyPermission const type. -func PossibleKeyPermissionValues() []KeyPermission { - return []KeyPermission{Full, Read} -} - -// KeySource enumerates the values for key source. -type KeySource string - -const ( - // KeySourceMicrosoftKeyvault ... - KeySourceMicrosoftKeyvault KeySource = "Microsoft.Keyvault" - // KeySourceMicrosoftStorage ... - KeySourceMicrosoftStorage KeySource = "Microsoft.Storage" -) - -// PossibleKeySourceValues returns an array of possible values for the KeySource const type. -func PossibleKeySourceValues() []KeySource { - return []KeySource{KeySourceMicrosoftKeyvault, KeySourceMicrosoftStorage} -} - -// KeyType enumerates the values for key type. -type KeyType string - -const ( - // KeyTypeAccount ... - KeyTypeAccount KeyType = "Account" - // KeyTypeService ... - KeyTypeService KeyType = "Service" -) - -// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. -func PossibleKeyTypeValues() []KeyType { - return []KeyType{KeyTypeAccount, KeyTypeService} -} - -// Kind enumerates the values for kind. -type Kind string - -const ( - // BlobStorage ... - BlobStorage Kind = "BlobStorage" - // BlockBlobStorage ... - BlockBlobStorage Kind = "BlockBlobStorage" - // FileStorage ... - FileStorage Kind = "FileStorage" - // Storage ... - Storage Kind = "Storage" - // StorageV2 ... - StorageV2 Kind = "StorageV2" -) - -// PossibleKindValues returns an array of possible values for the Kind const type. -func PossibleKindValues() []Kind { - return []Kind{BlobStorage, BlockBlobStorage, FileStorage, Storage, StorageV2} -} - -// LargeFileSharesState enumerates the values for large file shares state. -type LargeFileSharesState string - -const ( - // LargeFileSharesStateDisabled ... - LargeFileSharesStateDisabled LargeFileSharesState = "Disabled" - // LargeFileSharesStateEnabled ... - LargeFileSharesStateEnabled LargeFileSharesState = "Enabled" -) - -// PossibleLargeFileSharesStateValues returns an array of possible values for the LargeFileSharesState const type. -func PossibleLargeFileSharesStateValues() []LargeFileSharesState { - return []LargeFileSharesState{LargeFileSharesStateDisabled, LargeFileSharesStateEnabled} -} - -// LeaseDuration enumerates the values for lease duration. -type LeaseDuration string - -const ( - // Fixed ... - Fixed LeaseDuration = "Fixed" - // Infinite ... - Infinite LeaseDuration = "Infinite" -) - -// PossibleLeaseDurationValues returns an array of possible values for the LeaseDuration const type. -func PossibleLeaseDurationValues() []LeaseDuration { - return []LeaseDuration{Fixed, Infinite} -} - -// LeaseState enumerates the values for lease state. -type LeaseState string - -const ( - // LeaseStateAvailable ... - LeaseStateAvailable LeaseState = "Available" - // LeaseStateBreaking ... - LeaseStateBreaking LeaseState = "Breaking" - // LeaseStateBroken ... - LeaseStateBroken LeaseState = "Broken" - // LeaseStateExpired ... - LeaseStateExpired LeaseState = "Expired" - // LeaseStateLeased ... - LeaseStateLeased LeaseState = "Leased" -) - -// PossibleLeaseStateValues returns an array of possible values for the LeaseState const type. -func PossibleLeaseStateValues() []LeaseState { - return []LeaseState{LeaseStateAvailable, LeaseStateBreaking, LeaseStateBroken, LeaseStateExpired, LeaseStateLeased} -} - -// LeaseStatus enumerates the values for lease status. -type LeaseStatus string - -const ( - // LeaseStatusLocked ... - LeaseStatusLocked LeaseStatus = "Locked" - // LeaseStatusUnlocked ... - LeaseStatusUnlocked LeaseStatus = "Unlocked" -) - -// PossibleLeaseStatusValues returns an array of possible values for the LeaseStatus const type. -func PossibleLeaseStatusValues() []LeaseStatus { - return []LeaseStatus{LeaseStatusLocked, LeaseStatusUnlocked} -} - -// ListContainersInclude enumerates the values for list containers include. -type ListContainersInclude string - -const ( - // Deleted ... - Deleted ListContainersInclude = "deleted" -) - -// PossibleListContainersIncludeValues returns an array of possible values for the ListContainersInclude const type. -func PossibleListContainersIncludeValues() []ListContainersInclude { - return []ListContainersInclude{Deleted} -} - -// ListKeyExpand enumerates the values for list key expand. -type ListKeyExpand string - -const ( - // Kerb ... - Kerb ListKeyExpand = "kerb" -) - -// PossibleListKeyExpandValues returns an array of possible values for the ListKeyExpand const type. -func PossibleListKeyExpandValues() []ListKeyExpand { - return []ListKeyExpand{Kerb} -} - -// ListSharesExpand enumerates the values for list shares expand. -type ListSharesExpand string - -const ( - // ListSharesExpandDeleted ... - ListSharesExpandDeleted ListSharesExpand = "deleted" -) - -// PossibleListSharesExpandValues returns an array of possible values for the ListSharesExpand const type. -func PossibleListSharesExpandValues() []ListSharesExpand { - return []ListSharesExpand{ListSharesExpandDeleted} -} - -// Permissions enumerates the values for permissions. -type Permissions string - -const ( - // A ... - A Permissions = "a" - // C ... - C Permissions = "c" - // D ... - D Permissions = "d" - // L ... - L Permissions = "l" - // P ... - P Permissions = "p" - // R ... - R Permissions = "r" - // U ... - U Permissions = "u" - // W ... - W Permissions = "w" -) - -// PossiblePermissionsValues returns an array of possible values for the Permissions const type. -func PossiblePermissionsValues() []Permissions { - return []Permissions{A, C, D, L, P, R, U, W} -} - -// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection -// provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - // PrivateEndpointConnectionProvisioningStateCreating ... - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - // PrivateEndpointConnectionProvisioningStateDeleting ... - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - // PrivateEndpointConnectionProvisioningStateFailed ... - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - // PrivateEndpointConnectionProvisioningStateSucceeded ... - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded} -} - -// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - // Approved ... - Approved PrivateEndpointServiceConnectionStatus = "Approved" - // Pending ... - Pending PrivateEndpointServiceConnectionStatus = "Pending" - // Rejected ... - Rejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{Approved, Pending, Rejected} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Creating ... - Creating ProvisioningState = "Creating" - // ResolvingDNS ... - ResolvingDNS ProvisioningState = "ResolvingDNS" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Creating, ResolvingDNS, Succeeded} -} - -// PublicAccess enumerates the values for public access. -type PublicAccess string - -const ( - // PublicAccessBlob ... - PublicAccessBlob PublicAccess = "Blob" - // PublicAccessContainer ... - PublicAccessContainer PublicAccess = "Container" - // PublicAccessNone ... - PublicAccessNone PublicAccess = "None" -) - -// PossiblePublicAccessValues returns an array of possible values for the PublicAccess const type. -func PossiblePublicAccessValues() []PublicAccess { - return []PublicAccess{PublicAccessBlob, PublicAccessContainer, PublicAccessNone} -} - -// Reason enumerates the values for reason. -type Reason string - -const ( - // AccountNameInvalid ... - AccountNameInvalid Reason = "AccountNameInvalid" - // AlreadyExists ... - AlreadyExists Reason = "AlreadyExists" -) - -// PossibleReasonValues returns an array of possible values for the Reason const type. -func PossibleReasonValues() []Reason { - return []Reason{AccountNameInvalid, AlreadyExists} -} - -// ReasonCode enumerates the values for reason code. -type ReasonCode string - -const ( - // NotAvailableForSubscription ... - NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription" - // QuotaID ... - QuotaID ReasonCode = "QuotaId" -) - -// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type. -func PossibleReasonCodeValues() []ReasonCode { - return []ReasonCode{NotAvailableForSubscription, QuotaID} -} - -// RootSquashType enumerates the values for root squash type. -type RootSquashType string - -const ( - // AllSquash ... - AllSquash RootSquashType = "AllSquash" - // NoRootSquash ... - NoRootSquash RootSquashType = "NoRootSquash" - // RootSquash ... - RootSquash RootSquashType = "RootSquash" -) - -// PossibleRootSquashTypeValues returns an array of possible values for the RootSquashType const type. -func PossibleRootSquashTypeValues() []RootSquashType { - return []RootSquashType{AllSquash, NoRootSquash, RootSquash} -} - -// RoutingChoice enumerates the values for routing choice. -type RoutingChoice string - -const ( - // InternetRouting ... - InternetRouting RoutingChoice = "InternetRouting" - // MicrosoftRouting ... - MicrosoftRouting RoutingChoice = "MicrosoftRouting" -) - -// PossibleRoutingChoiceValues returns an array of possible values for the RoutingChoice const type. -func PossibleRoutingChoiceValues() []RoutingChoice { - return []RoutingChoice{InternetRouting, MicrosoftRouting} -} - -// Services enumerates the values for services. -type Services string - -const ( - // B ... - B Services = "b" - // F ... - F Services = "f" - // Q ... - Q Services = "q" - // T ... - T Services = "t" -) - -// PossibleServicesValues returns an array of possible values for the Services const type. -func PossibleServicesValues() []Services { - return []Services{B, F, Q, T} -} - -// ShareAccessTier enumerates the values for share access tier. -type ShareAccessTier string - -const ( - // ShareAccessTierCool ... - ShareAccessTierCool ShareAccessTier = "Cool" - // ShareAccessTierHot ... - ShareAccessTierHot ShareAccessTier = "Hot" - // ShareAccessTierPremium ... - ShareAccessTierPremium ShareAccessTier = "Premium" - // ShareAccessTierTransactionOptimized ... - ShareAccessTierTransactionOptimized ShareAccessTier = "TransactionOptimized" -) - -// PossibleShareAccessTierValues returns an array of possible values for the ShareAccessTier const type. -func PossibleShareAccessTierValues() []ShareAccessTier { - return []ShareAccessTier{ShareAccessTierCool, ShareAccessTierHot, ShareAccessTierPremium, ShareAccessTierTransactionOptimized} -} - -// SignedResource enumerates the values for signed resource. -type SignedResource string - -const ( - // SignedResourceB ... - SignedResourceB SignedResource = "b" - // SignedResourceC ... - SignedResourceC SignedResource = "c" - // SignedResourceF ... - SignedResourceF SignedResource = "f" - // SignedResourceS ... - SignedResourceS SignedResource = "s" -) - -// PossibleSignedResourceValues returns an array of possible values for the SignedResource const type. -func PossibleSignedResourceValues() []SignedResource { - return []SignedResource{SignedResourceB, SignedResourceC, SignedResourceF, SignedResourceS} -} - -// SignedResourceTypes enumerates the values for signed resource types. -type SignedResourceTypes string - -const ( - // SignedResourceTypesC ... - SignedResourceTypesC SignedResourceTypes = "c" - // SignedResourceTypesO ... - SignedResourceTypesO SignedResourceTypes = "o" - // SignedResourceTypesS ... - SignedResourceTypesS SignedResourceTypes = "s" -) - -// PossibleSignedResourceTypesValues returns an array of possible values for the SignedResourceTypes const type. -func PossibleSignedResourceTypesValues() []SignedResourceTypes { - return []SignedResourceTypes{SignedResourceTypesC, SignedResourceTypesO, SignedResourceTypesS} -} - -// SkuName enumerates the values for sku name. -type SkuName string - -const ( - // PremiumLRS ... - PremiumLRS SkuName = "Premium_LRS" - // PremiumZRS ... - PremiumZRS SkuName = "Premium_ZRS" - // StandardGRS ... - StandardGRS SkuName = "Standard_GRS" - // StandardGZRS ... - StandardGZRS SkuName = "Standard_GZRS" - // StandardLRS ... - StandardLRS SkuName = "Standard_LRS" - // StandardRAGRS ... - StandardRAGRS SkuName = "Standard_RAGRS" - // StandardRAGZRS ... - StandardRAGZRS SkuName = "Standard_RAGZRS" - // StandardZRS ... - StandardZRS SkuName = "Standard_ZRS" -) - -// PossibleSkuNameValues returns an array of possible values for the SkuName const type. -func PossibleSkuNameValues() []SkuName { - return []SkuName{PremiumLRS, PremiumZRS, StandardGRS, StandardGZRS, StandardLRS, StandardRAGRS, StandardRAGZRS, StandardZRS} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // Premium ... - Premium SkuTier = "Premium" - // Standard ... - Standard SkuTier = "Standard" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Premium, Standard} -} - -// State enumerates the values for state. -type State string - -const ( - // StateDeprovisioning ... - StateDeprovisioning State = "deprovisioning" - // StateFailed ... - StateFailed State = "failed" - // StateNetworkSourceDeleted ... - StateNetworkSourceDeleted State = "networkSourceDeleted" - // StateProvisioning ... - StateProvisioning State = "provisioning" - // StateSucceeded ... - StateSucceeded State = "succeeded" -) - -// PossibleStateValues returns an array of possible values for the State const type. -func PossibleStateValues() []State { - return []State{StateDeprovisioning, StateFailed, StateNetworkSourceDeleted, StateProvisioning, StateSucceeded} -} - -// UsageUnit enumerates the values for usage unit. -type UsageUnit string - -const ( - // Bytes ... - Bytes UsageUnit = "Bytes" - // BytesPerSecond ... - BytesPerSecond UsageUnit = "BytesPerSecond" - // Count ... - Count UsageUnit = "Count" - // CountsPerSecond ... - CountsPerSecond UsageUnit = "CountsPerSecond" - // Percent ... - Percent UsageUnit = "Percent" - // Seconds ... - Seconds UsageUnit = "Seconds" -) - -// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. -func PossibleUsageUnitValues() []UsageUnit { - return []UsageUnit{Bytes, BytesPerSecond, Count, CountsPerSecond, Percent, Seconds} -} - // Account the storage account. type Account struct { autorest.Response `json:"-"` @@ -806,11 +35,11 @@ type Account struct { Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1153,10 +382,15 @@ func (alr AccountListResult) IsEmpty() bool { return alr.Value == nil || len(*alr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (alr AccountListResult) hasNextLink() bool { + return alr.NextLink != nil && len(*alr.NextLink) != 0 +} + // accountListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (alr AccountListResult) accountListResultPreparer(ctx context.Context) (*http.Request, error) { - if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + if !alr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1184,11 +418,16 @@ func (page *AccountListResultPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.alr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.alr = next return nil } @@ -1218,8 +457,11 @@ func (page AccountListResultPage) Values() []Account { } // Creates a new instance of the AccountListResultPage type. -func NewAccountListResultPage(getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { - return AccountListResultPage{fn: getNextPage} +func NewAccountListResultPage(cur AccountListResult, getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { + return AccountListResultPage{ + fn: getNextPage, + alr: cur, + } } // AccountMicrosoftEndpoints the URIs that are used to perform a retrieval of a public blob, queue, table, @@ -1285,6 +527,37 @@ type AccountProperties struct { RoutingPreference *RoutingPreference `json:"routingPreference,omitempty"` // BlobRestoreStatus - READ-ONLY; Blob restore status BlobRestoreStatus *BlobRestoreStatus `json:"blobRestoreStatus,omitempty"` + // AllowBlobPublicAccess - Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + AllowBlobPublicAccess *bool `json:"allowBlobPublicAccess,omitempty"` + // MinimumTLSVersion - Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS10', 'TLS11', 'TLS12' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountProperties. +func (ap AccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.AzureFilesIdentityBasedAuthentication != nil { + objectMap["azureFilesIdentityBasedAuthentication"] = ap.AzureFilesIdentityBasedAuthentication + } + if ap.EnableHTTPSTrafficOnly != nil { + objectMap["supportsHttpsTrafficOnly"] = ap.EnableHTTPSTrafficOnly + } + if ap.IsHnsEnabled != nil { + objectMap["isHnsEnabled"] = ap.IsHnsEnabled + } + if ap.LargeFileSharesState != "" { + objectMap["largeFileSharesState"] = ap.LargeFileSharesState + } + if ap.RoutingPreference != nil { + objectMap["routingPreference"] = ap.RoutingPreference + } + if ap.AllowBlobPublicAccess != nil { + objectMap["allowBlobPublicAccess"] = ap.AllowBlobPublicAccess + } + if ap.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = ap.MinimumTLSVersion + } + return json.Marshal(objectMap) } // AccountPropertiesCreateParameters the parameters used to create the storage account. @@ -1307,6 +580,10 @@ type AccountPropertiesCreateParameters struct { LargeFileSharesState LargeFileSharesState `json:"largeFileSharesState,omitempty"` // RoutingPreference - Maintains information about the network routing choice opted by the user for data transfer RoutingPreference *RoutingPreference `json:"routingPreference,omitempty"` + // AllowBlobPublicAccess - Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + AllowBlobPublicAccess *bool `json:"allowBlobPublicAccess,omitempty"` + // MinimumTLSVersion - Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS10', 'TLS11', 'TLS12' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` } // AccountPropertiesUpdateParameters the parameters used when updating a storage account. @@ -1327,6 +604,10 @@ type AccountPropertiesUpdateParameters struct { LargeFileSharesState LargeFileSharesState `json:"largeFileSharesState,omitempty"` // RoutingPreference - Maintains information about the network routing choice opted by the user for data transfer RoutingPreference *RoutingPreference `json:"routingPreference,omitempty"` + // AllowBlobPublicAccess - Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + AllowBlobPublicAccess *bool `json:"allowBlobPublicAccess,omitempty"` + // MinimumTLSVersion - Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS10', 'TLS11', 'TLS12' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` } // AccountRegenerateKeyParameters the parameters used to regenerate the storage account key. @@ -1358,12 +639,25 @@ type AccountSasParameters struct { // AccountsCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type AccountsCreateFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AccountsClient) (Account, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AccountsCreateFuture) Result(client AccountsClient) (a Account, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AccountsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AccountsCreateFuture.Result. +func (future *AccountsCreateFuture) result(client AccountsClient) (a Account, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1387,12 +681,25 @@ func (future *AccountsCreateFuture) Result(client AccountsClient) (a Account, er // AccountsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type AccountsFailoverFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AccountsFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AccountsFailoverFuture) Result(client AccountsClient) (ar autorest.Response, err error) { +// result is the default implementation for AccountsFailoverFuture.Result. +func (future *AccountsFailoverFuture) result(client AccountsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1410,12 +717,25 @@ func (future *AccountsFailoverFuture) Result(client AccountsClient) (ar autorest // AccountsRestoreBlobRangesFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type AccountsRestoreBlobRangesFuture struct { - azure.Future + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AccountsClient) (BlobRestoreStatus, error) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AccountsRestoreBlobRangesFuture) Result(client AccountsClient) (brs BlobRestoreStatus, err error) { +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AccountsRestoreBlobRangesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AccountsRestoreBlobRangesFuture.Result. +func (future *AccountsRestoreBlobRangesFuture) result(client AccountsClient) (brs BlobRestoreStatus, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { @@ -1548,15 +868,15 @@ type ActiveDirectoryProperties struct { AzureStorageSid *string `json:"azureStorageSid,omitempty"` } -// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. type AzureEntityResource struct { // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1575,11 +895,11 @@ type BlobContainer struct { *ContainerProperties `json:"properties,omitempty"` // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1695,11 +1015,11 @@ type BlobServiceProperties struct { *BlobServicePropertiesProperties `json:"properties,omitempty"` // Sku - READ-ONLY; Sku name and tier. Sku *Sku `json:"sku,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -1961,11 +1281,11 @@ type EncryptionScope struct { autorest.Response `json:"-"` // EncryptionScopeProperties - Properties of the encryption scope. *EncryptionScopeProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -2114,10 +1434,15 @@ func (eslr EncryptionScopeListResult) IsEmpty() bool { return eslr.Value == nil || len(*eslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (eslr EncryptionScopeListResult) hasNextLink() bool { + return eslr.NextLink != nil && len(*eslr.NextLink) != 0 +} + // encryptionScopeListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (eslr EncryptionScopeListResult) encryptionScopeListResultPreparer(ctx context.Context) (*http.Request, error) { - if eslr.NextLink == nil || len(to.String(eslr.NextLink)) < 1 { + if !eslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2145,11 +1470,16 @@ func (page *EncryptionScopeListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.eslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.eslr) + if err != nil { + return err + } + page.eslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.eslr = next return nil } @@ -2179,8 +1509,11 @@ func (page EncryptionScopeListResultPage) Values() []EncryptionScope { } // Creates a new instance of the EncryptionScopeListResultPage type. -func NewEncryptionScopeListResultPage(getNextPage func(context.Context, EncryptionScopeListResult) (EncryptionScopeListResult, error)) EncryptionScopeListResultPage { - return EncryptionScopeListResultPage{fn: getNextPage} +func NewEncryptionScopeListResultPage(cur EncryptionScopeListResult, getNextPage func(context.Context, EncryptionScopeListResult) (EncryptionScopeListResult, error)) EncryptionScopeListResultPage { + return EncryptionScopeListResultPage{ + fn: getNextPage, + eslr: cur, + } } // EncryptionScopeProperties properties of the encryption scope. @@ -2197,6 +1530,21 @@ type EncryptionScopeProperties struct { KeyVaultProperties *EncryptionScopeKeyVaultProperties `json:"keyVaultProperties,omitempty"` } +// MarshalJSON is the custom marshaler for EncryptionScopeProperties. +func (esp EncryptionScopeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esp.Source != "" { + objectMap["source"] = esp.Source + } + if esp.State != "" { + objectMap["state"] = esp.State + } + if esp.KeyVaultProperties != nil { + objectMap["keyVaultProperties"] = esp.KeyVaultProperties + } + return json.Marshal(objectMap) +} + // EncryptionService a service that allows server-side encryption to be used. type EncryptionService struct { // Enabled - A boolean indicating whether or not the service encrypts the data as it is stored. @@ -2207,6 +1555,18 @@ type EncryptionService struct { KeyType KeyType `json:"keyType,omitempty"` } +// MarshalJSON is the custom marshaler for EncryptionService. +func (es EncryptionService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if es.Enabled != nil { + objectMap["enabled"] = es.Enabled + } + if es.KeyType != "" { + objectMap["keyType"] = es.KeyType + } + return json.Marshal(objectMap) +} + // EncryptionServices a list of services that support encryption. type EncryptionServices struct { // Blob - The encryption function of the blob storage service. @@ -2240,6 +1600,18 @@ type Endpoints struct { InternetEndpoints *AccountInternetEndpoints `json:"internetEndpoints,omitempty"` } +// MarshalJSON is the custom marshaler for Endpoints. +func (e Endpoints) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.MicrosoftEndpoints != nil { + objectMap["microsoftEndpoints"] = e.MicrosoftEndpoints + } + if e.InternetEndpoints != nil { + objectMap["internetEndpoints"] = e.InternetEndpoints + } + return json.Marshal(objectMap) +} + // ErrorResponse an error response from the storage resource provider. type ErrorResponse struct { // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. @@ -2262,11 +1634,11 @@ type FileServiceProperties struct { *FileServicePropertiesProperties `json:"properties,omitempty"` // Sku - READ-ONLY; Sku name and tier. Sku *Sku `json:"sku,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -2354,11 +1726,11 @@ type FileShare struct { *FileShareProperties `json:"properties,omitempty"` // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -2437,11 +1809,11 @@ type FileShareItem struct { *FileShareProperties `json:"properties,omitempty"` // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -2592,10 +1964,15 @@ func (fsi FileShareItems) IsEmpty() bool { return fsi.Value == nil || len(*fsi.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (fsi FileShareItems) hasNextLink() bool { + return fsi.NextLink != nil && len(*fsi.NextLink) != 0 +} + // fileShareItemsPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (fsi FileShareItems) fileShareItemsPreparer(ctx context.Context) (*http.Request, error) { - if fsi.NextLink == nil || len(to.String(fsi.NextLink)) < 1 { + if !fsi.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2623,11 +2000,16 @@ func (page *FileShareItemsPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.fsi) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.fsi) + if err != nil { + return err + } + page.fsi = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.fsi = next return nil } @@ -2657,8 +2039,11 @@ func (page FileShareItemsPage) Values() []FileShareItem { } // Creates a new instance of the FileShareItemsPage type. -func NewFileShareItemsPage(getNextPage func(context.Context, FileShareItems) (FileShareItems, error)) FileShareItemsPage { - return FileShareItemsPage{fn: getNextPage} +func NewFileShareItemsPage(cur FileShareItems, getNextPage func(context.Context, FileShareItems) (FileShareItems, error)) FileShareItemsPage { + return FileShareItemsPage{ + fn: getNextPage, + fsi: cur, + } } // FileShareProperties the properties of the file share. @@ -2733,6 +2118,15 @@ type Identity struct { Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.Type != nil { + objectMap["type"] = i.Type + } + return json.Marshal(objectMap) +} + // ImmutabilityPolicy the ImmutabilityPolicy property of a blob container, including Id, resource name, // resource type, Etag. type ImmutabilityPolicy struct { @@ -2741,11 +2135,11 @@ type ImmutabilityPolicy struct { *ImmutabilityPolicyProperty `json:"properties,omitempty"` // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -2889,6 +2283,18 @@ type ImmutabilityPolicyProperty struct { AllowProtectedAppendWrites *bool `json:"allowProtectedAppendWrites,omitempty"` } +// MarshalJSON is the custom marshaler for ImmutabilityPolicyProperty. +func (ipp ImmutabilityPolicyProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipp.ImmutabilityPeriodSinceCreationInDays != nil { + objectMap["immutabilityPeriodSinceCreationInDays"] = ipp.ImmutabilityPeriodSinceCreationInDays + } + if ipp.AllowProtectedAppendWrites != nil { + objectMap["allowProtectedAppendWrites"] = ipp.AllowProtectedAppendWrites + } + return json.Marshal(objectMap) +} + // IPRule IP rule with specific IP or IP range in CIDR format. type IPRule struct { // IPAddressOrRange - Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. @@ -2911,6 +2317,21 @@ type KeyVaultProperties struct { LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"` } +// MarshalJSON is the custom marshaler for KeyVaultProperties. +func (kvp KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kvp.KeyName != nil { + objectMap["keyname"] = kvp.KeyName + } + if kvp.KeyVersion != nil { + objectMap["keyversion"] = kvp.KeyVersion + } + if kvp.KeyVaultURI != nil { + objectMap["keyvaulturi"] = kvp.KeyVaultURI + } + return json.Marshal(objectMap) +} + // LeaseContainerRequest lease Container request schema. type LeaseContainerRequest struct { // Action - Specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break' @@ -2943,6 +2364,15 @@ type LegalHold struct { Tags *[]string `json:"tags,omitempty"` } +// MarshalJSON is the custom marshaler for LegalHold. +func (lh LegalHold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lh.Tags != nil { + objectMap["tags"] = lh.Tags + } + return json.Marshal(objectMap) +} + // LegalHoldProperties the LegalHold property of a blob container. type LegalHoldProperties struct { // HasLegalHold - READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. @@ -2951,6 +2381,15 @@ type LegalHoldProperties struct { Tags *[]TagProperty `json:"tags,omitempty"` } +// MarshalJSON is the custom marshaler for LegalHoldProperties. +func (lhp LegalHoldProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lhp.Tags != nil { + objectMap["tags"] = lhp.Tags + } + return json.Marshal(objectMap) +} + // ListAccountSasResponse the List SAS credentials operation response. type ListAccountSasResponse struct { autorest.Response `json:"-"` @@ -2964,11 +2403,11 @@ type ListContainerItem struct { *ContainerProperties `json:"properties,omitempty"` // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -3119,10 +2558,15 @@ func (lci ListContainerItems) IsEmpty() bool { return lci.Value == nil || len(*lci.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lci ListContainerItems) hasNextLink() bool { + return lci.NextLink != nil && len(*lci.NextLink) != 0 +} + // listContainerItemsPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lci ListContainerItems) listContainerItemsPreparer(ctx context.Context) (*http.Request, error) { - if lci.NextLink == nil || len(to.String(lci.NextLink)) < 1 { + if !lci.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3150,11 +2594,16 @@ func (page *ListContainerItemsPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lci) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lci) + if err != nil { + return err + } + page.lci = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lci = next return nil } @@ -3184,19 +2633,22 @@ func (page ListContainerItemsPage) Values() []ListContainerItem { } // Creates a new instance of the ListContainerItemsPage type. -func NewListContainerItemsPage(getNextPage func(context.Context, ListContainerItems) (ListContainerItems, error)) ListContainerItemsPage { - return ListContainerItemsPage{fn: getNextPage} +func NewListContainerItemsPage(cur ListContainerItems, getNextPage func(context.Context, ListContainerItems) (ListContainerItems, error)) ListContainerItemsPage { + return ListContainerItemsPage{ + fn: getNextPage, + lci: cur, + } } // ListQueue ... type ListQueue struct { // ListQueueProperties - List Queue resource properties. *ListQueueProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -3352,10 +2804,15 @@ func (lqr ListQueueResource) IsEmpty() bool { return lqr.Value == nil || len(*lqr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lqr ListQueueResource) hasNextLink() bool { + return lqr.NextLink != nil && len(*lqr.NextLink) != 0 +} + // listQueueResourcePreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lqr ListQueueResource) listQueueResourcePreparer(ctx context.Context) (*http.Request, error) { - if lqr.NextLink == nil || len(to.String(lqr.NextLink)) < 1 { + if !lqr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3383,11 +2840,16 @@ func (page *ListQueueResourcePage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lqr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lqr) + if err != nil { + return err + } + page.lqr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lqr = next return nil } @@ -3417,8 +2879,11 @@ func (page ListQueueResourcePage) Values() []ListQueue { } // Creates a new instance of the ListQueueResourcePage type. -func NewListQueueResourcePage(getNextPage func(context.Context, ListQueueResource) (ListQueueResource, error)) ListQueueResourcePage { - return ListQueueResourcePage{fn: getNextPage} +func NewListQueueResourcePage(cur ListQueueResource, getNextPage func(context.Context, ListQueueResource) (ListQueueResource, error)) ListQueueResourcePage { + return ListQueueResourcePage{ + fn: getNextPage, + lqr: cur, + } } // ListQueueServices ... @@ -3512,10 +2977,15 @@ func (ltr ListTableResource) IsEmpty() bool { return ltr.Value == nil || len(*ltr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ltr ListTableResource) hasNextLink() bool { + return ltr.NextLink != nil && len(*ltr.NextLink) != 0 +} + // listTableResourcePreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ltr ListTableResource) listTableResourcePreparer(ctx context.Context) (*http.Request, error) { - if ltr.NextLink == nil || len(to.String(ltr.NextLink)) < 1 { + if !ltr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3543,11 +3013,16 @@ func (page *ListTableResourcePage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ltr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ltr) + if err != nil { + return err + } + page.ltr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ltr = next return nil } @@ -3577,8 +3052,11 @@ func (page ListTableResourcePage) Values() []Table { } // Creates a new instance of the ListTableResourcePage type. -func NewListTableResourcePage(getNextPage func(context.Context, ListTableResource) (ListTableResource, error)) ListTableResourcePage { - return ListTableResourcePage{fn: getNextPage} +func NewListTableResourcePage(cur ListTableResource, getNextPage func(context.Context, ListTableResource) (ListTableResource, error)) ListTableResourcePage { + return ListTableResourcePage{ + fn: getNextPage, + ltr: cur, + } } // ListTableServices ... @@ -3593,11 +3071,11 @@ type ManagementPolicy struct { autorest.Response `json:"-"` // ManagementPolicyProperties - Returns the Storage Account Data Policies Rules. *ManagementPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -3707,6 +3185,15 @@ type ManagementPolicyProperties struct { Policy *ManagementPolicySchema `json:"policy,omitempty"` } +// MarshalJSON is the custom marshaler for ManagementPolicyProperties. +func (mpp ManagementPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mpp.Policy != nil { + objectMap["policy"] = mpp.Policy + } + return json.Marshal(objectMap) +} + // ManagementPolicyRule an object that wraps the Lifecycle rule. Each rule is uniquely defined by name. type ManagementPolicyRule struct { // Enabled - Rule is enabled if set to true. @@ -3779,11 +3266,11 @@ type ObjectReplicationPolicy struct { autorest.Response `json:"-"` // ObjectReplicationPolicyProperties - Returns the Storage Account Object Replication Policy. *ObjectReplicationPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -3871,6 +3358,21 @@ type ObjectReplicationPolicyProperties struct { Rules *[]ObjectReplicationPolicyRule `json:"rules,omitempty"` } +// MarshalJSON is the custom marshaler for ObjectReplicationPolicyProperties. +func (orpp ObjectReplicationPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if orpp.SourceAccount != nil { + objectMap["sourceAccount"] = orpp.SourceAccount + } + if orpp.DestinationAccount != nil { + objectMap["destinationAccount"] = orpp.DestinationAccount + } + if orpp.Rules != nil { + objectMap["rules"] = orpp.Rules + } + return json.Marshal(objectMap) +} + // ObjectReplicationPolicyRule the replication policy rule between two containers. type ObjectReplicationPolicyRule struct { // RuleID - Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. @@ -4001,11 +3503,11 @@ type PrivateEndpointConnection struct { autorest.Response `json:"-"` // PrivateEndpointConnectionProperties - Resource properties. *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -4091,11 +3593,11 @@ type PrivateEndpointConnectionProperties struct { type PrivateLinkResource struct { // PrivateLinkResourceProperties - Resource properties. *PrivateLinkResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -4176,6 +3678,15 @@ type PrivateLinkResourceProperties struct { RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` } +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plrp.RequiredZoneNames != nil { + objectMap["requiredZoneNames"] = plrp.RequiredZoneNames + } + return json.Marshal(objectMap) +} + // PrivateLinkServiceConnectionState a collection of information about the state of the connection between // service consumer and provider. type PrivateLinkServiceConnectionState struct { @@ -4187,14 +3698,14 @@ type PrivateLinkServiceConnectionState struct { ActionRequired *string `json:"actionRequired,omitempty"` } -// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than -// required location and tags +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -4203,11 +3714,11 @@ type Queue struct { autorest.Response `json:"-"` // QueueProperties - Queue resource properties. *QueueProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -4293,11 +3804,11 @@ type QueueServiceProperties struct { autorest.Response `json:"-"` // QueueServicePropertiesProperties - The properties of a storage account’s Queue service. *QueueServicePropertiesProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -4367,13 +3878,13 @@ type QueueServicePropertiesProperties struct { Cors *CorsRules `json:"cors,omitempty"` } -// Resource ... +// Resource common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -4383,8 +3894,22 @@ type RestorePolicyProperties struct { Enabled *bool `json:"enabled,omitempty"` // Days - how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. Days *int32 `json:"days,omitempty"` - // LastEnabledTime - READ-ONLY; Returns the date and time the restore policy was last enabled. + // LastEnabledTime - READ-ONLY; Deprecated in favor of minRestoreTime property. LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"` + // MinRestoreTime - READ-ONLY; Returns the minimum date and time that the restore can be started. + MinRestoreTime *date.Time `json:"minRestoreTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorePolicyProperties. +func (rpp RestorePolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpp.Enabled != nil { + objectMap["enabled"] = rpp.Enabled + } + if rpp.Days != nil { + objectMap["days"] = rpp.Days + } + return json.Marshal(objectMap) } // Restriction the restriction because of which SKU cannot be used. @@ -4397,6 +3922,15 @@ type Restriction struct { ReasonCode ReasonCode `json:"reasonCode,omitempty"` } +// MarshalJSON is the custom marshaler for Restriction. +func (r Restriction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ReasonCode != "" { + objectMap["reasonCode"] = r.ReasonCode + } + return json.Marshal(objectMap) +} + // RoutingPreference routing preference defines the type of network, either microsoft or internet routing // to be used to deliver the user data, the default option is microsoft routing type RoutingPreference struct { @@ -4489,6 +4023,21 @@ type SkuInformation struct { Restrictions *[]Restriction `json:"restrictions,omitempty"` } +// MarshalJSON is the custom marshaler for SkuInformation. +func (si SkuInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si.Name != "" { + objectMap["name"] = si.Name + } + if si.Tier != "" { + objectMap["tier"] = si.Tier + } + if si.Restrictions != nil { + objectMap["restrictions"] = si.Restrictions + } + return json.Marshal(objectMap) +} + // SkuListResult the response from the List Storage SKUs operation. type SkuListResult struct { autorest.Response `json:"-"` @@ -4501,11 +4050,11 @@ type Table struct { autorest.Response `json:"-"` // TableProperties - Table resource properties. *TableProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -4580,11 +4129,11 @@ type TableServiceProperties struct { autorest.Response `json:"-"` // TableServicePropertiesProperties - The properties of a storage account’s Table service. *TableServicePropertiesProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -4678,17 +4227,18 @@ type TagProperty struct { Upn *string `json:"upn,omitempty"` } -// TrackedResource the resource model definition for a ARM tracked top level resource +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' type TrackedResource struct { // Tags - Resource tags. Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/objectreplicationpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/objectreplicationpolicies.go index 4e7a97eeabcf..4889447a5b12 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/objectreplicationpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/objectreplicationpolicies.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -99,6 +88,7 @@ func (client ObjectReplicationPoliciesClient) CreateOrUpdate(ctx context.Context result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.ObjectReplicationPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + return } return @@ -139,7 +129,6 @@ func (client ObjectReplicationPoliciesClient) CreateOrUpdateSender(req *http.Req func (client ObjectReplicationPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ObjectReplicationPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -196,6 +185,7 @@ func (client ObjectReplicationPoliciesClient) Delete(ctx context.Context, resour result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.ObjectReplicationPoliciesClient", "Delete", resp, "Failure responding to request") + return } return @@ -234,7 +224,6 @@ func (client ObjectReplicationPoliciesClient) DeleteSender(req *http.Request) (* func (client ObjectReplicationPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -290,6 +279,7 @@ func (client ObjectReplicationPoliciesClient) Get(ctx context.Context, resourceG result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.ObjectReplicationPoliciesClient", "Get", resp, "Failure responding to request") + return } return @@ -328,7 +318,6 @@ func (client ObjectReplicationPoliciesClient) GetSender(req *http.Request) (*htt func (client ObjectReplicationPoliciesClient) GetResponder(resp *http.Response) (result ObjectReplicationPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -382,6 +371,7 @@ func (client ObjectReplicationPoliciesClient) List(ctx context.Context, resource result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.ObjectReplicationPoliciesClient", "List", resp, "Failure responding to request") + return } return @@ -419,7 +409,6 @@ func (client ObjectReplicationPoliciesClient) ListSender(req *http.Request) (*ht func (client ObjectReplicationPoliciesClient) ListResponder(resp *http.Response) (result ObjectReplicationPolicies, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/operations.go index 7a5a9c7dfe6d..df3d803f11d9 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/operations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/operations.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -69,6 +58,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", resp, "Failure responding to request") + return } return @@ -100,7 +90,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/privateendpointconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/privateendpointconnections.go index 326ba923a452..f8a170017618 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/privateendpointconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/privateendpointconnections.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -91,6 +80,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.PrivateEndpointConnectionsClient", "Delete", resp, "Failure responding to request") + return } return @@ -129,7 +119,6 @@ func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) ( func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -184,6 +173,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return } return @@ -222,7 +212,6 @@ func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*ht func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -276,6 +265,7 @@ func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourc result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") + return } return @@ -313,7 +303,6 @@ func (client PrivateEndpointConnectionsClient) ListSender(req *http.Request) (*h func (client PrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -373,6 +362,7 @@ func (client PrivateEndpointConnectionsClient) Put(ctx context.Context, resource result, err = client.PutResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.PrivateEndpointConnectionsClient", "Put", resp, "Failure responding to request") + return } return @@ -413,7 +403,6 @@ func (client PrivateEndpointConnectionsClient) PutSender(req *http.Request) (*ht func (client PrivateEndpointConnectionsClient) PutResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/privatelinkresources.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/privatelinkresources.go index db93be64287e..baff8333a779 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/privatelinkresources.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/privatelinkresources.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -89,6 +78,7 @@ func (client PrivateLinkResourcesClient) ListByStorageAccount(ctx context.Contex result, err = client.ListByStorageAccountResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.PrivateLinkResourcesClient", "ListByStorageAccount", resp, "Failure responding to request") + return } return @@ -126,7 +116,6 @@ func (client PrivateLinkResourcesClient) ListByStorageAccountSender(req *http.Re func (client PrivateLinkResourcesClient) ListByStorageAccountResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/queue.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/queue.go index d44aaac7d1d0..b002fcf81c72 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/queue.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/queue.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -95,6 +84,7 @@ func (client QueueClient) Create(ctx context.Context, resourceGroupName string, result, err = client.CreateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.QueueClient", "Create", resp, "Failure responding to request") + return } return @@ -135,7 +125,6 @@ func (client QueueClient) CreateSender(req *http.Request) (*http.Response, error func (client QueueClient) CreateResponder(resp *http.Response) (result Queue, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -195,6 +184,7 @@ func (client QueueClient) Delete(ctx context.Context, resourceGroupName string, result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.QueueClient", "Delete", resp, "Failure responding to request") + return } return @@ -233,7 +223,6 @@ func (client QueueClient) DeleteSender(req *http.Request) (*http.Response, error func (client QueueClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -292,6 +281,7 @@ func (client QueueClient) Get(ctx context.Context, resourceGroupName string, acc result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.QueueClient", "Get", resp, "Failure responding to request") + return } return @@ -330,7 +320,6 @@ func (client QueueClient) GetSender(req *http.Request) (*http.Response, error) { func (client QueueClient) GetResponder(resp *http.Response) (result Queue, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -388,6 +377,11 @@ func (client QueueClient) List(ctx context.Context, resourceGroupName string, ac result.lqr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.QueueClient", "List", resp, "Failure responding to request") + return + } + if result.lqr.hasNextLink() && result.lqr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -431,7 +425,6 @@ func (client QueueClient) ListSender(req *http.Request) (*http.Response, error) func (client QueueClient) ListResponder(resp *http.Response) (result ListQueueResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -529,6 +522,7 @@ func (client QueueClient) Update(ctx context.Context, resourceGroupName string, result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.QueueClient", "Update", resp, "Failure responding to request") + return } return @@ -569,7 +563,6 @@ func (client QueueClient) UpdateSender(req *http.Request) (*http.Response, error func (client QueueClient) UpdateResponder(resp *http.Response) (result Queue, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/queueservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/queueservices.go index 100131162faf..8a1160036a92 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/queueservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/queueservices.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -89,6 +78,7 @@ func (client QueueServicesClient) GetServiceProperties(ctx context.Context, reso result, err = client.GetServicePropertiesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "GetServiceProperties", resp, "Failure responding to request") + return } return @@ -127,7 +117,6 @@ func (client QueueServicesClient) GetServicePropertiesSender(req *http.Request) func (client QueueServicesClient) GetServicePropertiesResponder(resp *http.Response) (result QueueServiceProperties, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -181,6 +170,7 @@ func (client QueueServicesClient) List(ctx context.Context, resourceGroupName st result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "List", resp, "Failure responding to request") + return } return @@ -218,7 +208,6 @@ func (client QueueServicesClient) ListSender(req *http.Request) (*http.Response, func (client QueueServicesClient) ListResponder(resp *http.Response) (result ListQueueServices, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -275,6 +264,7 @@ func (client QueueServicesClient) SetServiceProperties(ctx context.Context, reso result, err = client.SetServicePropertiesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "SetServiceProperties", resp, "Failure responding to request") + return } return @@ -315,7 +305,6 @@ func (client QueueServicesClient) SetServicePropertiesSender(req *http.Request) func (client QueueServicesClient) SetServicePropertiesResponder(resp *http.Response) (result QueueServiceProperties, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/skus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/skus.go index a207bb305a97..ffbbacd1efdb 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/skus.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/skus.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -76,6 +65,7 @@ func (client SkusClient) List(ctx context.Context) (result SkuListResult, err er result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", resp, "Failure responding to request") + return } return @@ -111,7 +101,6 @@ func (client SkusClient) ListSender(req *http.Request) (*http.Response, error) { func (client SkusClient) ListResponder(resp *http.Response) (result SkuListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/table.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/table.go index c484e37580aa..305f1888cd68 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/table.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/table.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -94,6 +83,7 @@ func (client TableClient) Create(ctx context.Context, resourceGroupName string, result, err = client.CreateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.TableClient", "Create", resp, "Failure responding to request") + return } return @@ -132,7 +122,6 @@ func (client TableClient) CreateSender(req *http.Request) (*http.Response, error func (client TableClient) CreateResponder(resp *http.Response) (result Table, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -192,6 +181,7 @@ func (client TableClient) Delete(ctx context.Context, resourceGroupName string, result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.TableClient", "Delete", resp, "Failure responding to request") + return } return @@ -230,7 +220,6 @@ func (client TableClient) DeleteSender(req *http.Request) (*http.Response, error func (client TableClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -289,6 +278,7 @@ func (client TableClient) Get(ctx context.Context, resourceGroupName string, acc result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.TableClient", "Get", resp, "Failure responding to request") + return } return @@ -327,7 +317,6 @@ func (client TableClient) GetSender(req *http.Request) (*http.Response, error) { func (client TableClient) GetResponder(resp *http.Response) (result Table, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -382,6 +371,11 @@ func (client TableClient) List(ctx context.Context, resourceGroupName string, ac result.ltr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.TableClient", "List", resp, "Failure responding to request") + return + } + if result.ltr.hasNextLink() && result.ltr.IsEmpty() { + err = result.NextWithContext(ctx) + return } return @@ -419,7 +413,6 @@ func (client TableClient) ListSender(req *http.Request) (*http.Response, error) func (client TableClient) ListResponder(resp *http.Response) (result ListTableResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -516,6 +509,7 @@ func (client TableClient) Update(ctx context.Context, resourceGroupName string, result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.TableClient", "Update", resp, "Failure responding to request") + return } return @@ -554,7 +548,6 @@ func (client TableClient) UpdateSender(req *http.Request) (*http.Response, error func (client TableClient) UpdateResponder(resp *http.Response) (result Table, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/tableservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/tableservices.go index 371904a222d9..bbb0a5753f16 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/tableservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/tableservices.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -89,6 +78,7 @@ func (client TableServicesClient) GetServiceProperties(ctx context.Context, reso result, err = client.GetServicePropertiesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "GetServiceProperties", resp, "Failure responding to request") + return } return @@ -127,7 +117,6 @@ func (client TableServicesClient) GetServicePropertiesSender(req *http.Request) func (client TableServicesClient) GetServicePropertiesResponder(resp *http.Response) (result TableServiceProperties, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -181,6 +170,7 @@ func (client TableServicesClient) List(ctx context.Context, resourceGroupName st result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "List", resp, "Failure responding to request") + return } return @@ -218,7 +208,6 @@ func (client TableServicesClient) ListSender(req *http.Request) (*http.Response, func (client TableServicesClient) ListResponder(resp *http.Response) (result ListTableServices, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -275,6 +264,7 @@ func (client TableServicesClient) SetServiceProperties(ctx context.Context, reso result, err = client.SetServicePropertiesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "SetServiceProperties", resp, "Failure responding to request") + return } return @@ -315,7 +305,6 @@ func (client TableServicesClient) SetServicePropertiesSender(req *http.Request) func (client TableServicesClient) SetServicePropertiesResponder(resp *http.Response) (result TableServiceProperties, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/usages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/usages.go index bea70e107b73..3672a72ce2c9 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/usages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/usages.go @@ -1,18 +1,7 @@ package storage -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -78,6 +67,7 @@ func (client UsagesClient) ListByLocation(ctx context.Context, location string) result, err = client.ListByLocationResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "storage.UsagesClient", "ListByLocation", resp, "Failure responding to request") + return } return @@ -114,7 +104,6 @@ func (client UsagesClient) ListByLocationSender(req *http.Request) (*http.Respon func (client UsagesClient) ListByLocationResponder(resp *http.Response) (result UsageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/version.go index 78053be11000..226079255d37 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/version.go @@ -2,19 +2,8 @@ package storage import "github.com/Azure/azure-sdk-for-go/version" -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md index 459b45831c0e..16f5dad1992a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md @@ -10,7 +10,7 @@ future. Please use one of the following packages instead. | Storage - Queues | [github.com/Azure/azure-storage-queue-go](https://github.com/Azure/azure-storage-queue-go) | The `github.com/Azure/azure-sdk-for-go/storage` package is used to manage -[Azure Storage](https://docs.microsoft.com/en-us/azure/storage/) data plane +[Azure Storage](https://docs.microsoft.com/azure/storage/) data plane resources: containers, blobs, tables, and queues. To manage storage *accounts* use Azure Resource Manager (ARM) via the packages diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/appendblob.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/appendblob.go index 8b5b96d48848..306dd1b711a3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/appendblob.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/appendblob.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "bytes" @@ -70,7 +59,6 @@ type AppendBlockOptions struct { func (b *Blob) AppendBlock(chunk []byte, options *AppendBlockOptions) error { params := url.Values{"comp": {"appendblock"}} headers := b.Container.bsc.client.getStandardHeaders() - headers["x-ms-blob-type"] = string(BlobTypeAppend) headers["Content-Length"] = fmt.Sprintf("%v", len(chunk)) if options != nil { diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/authorization.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/authorization.go index 76794c305182..01741524afdd 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/authorization.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/authorization.go @@ -1,19 +1,8 @@ // Package storage provides clients for Microsoft Azure Storage Services. package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "bytes" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go index 0b02e52bd7ae..462e3dcf2fb3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "encoding/xml" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blobsasuri.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blobsasuri.go index 62e461a5592f..89ab054ec2c0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blobsasuri.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blobsasuri.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "errors" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go index 02fa5929cc1b..0a985b22b0c6 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "encoding/xml" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blockblob.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blockblob.go index bd19eccc41e7..9d445decfd13 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blockblob.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/blockblob.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "bytes" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go index 98ca9bbaa895..0f4d6279e629 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go @@ -1,19 +1,8 @@ // Package storage provides clients for Microsoft Azure Storage Services. package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "bufio" @@ -85,6 +74,7 @@ const ( var ( validStorageAccount = regexp.MustCompile("^[0-9a-z]{3,24}$") + validCosmosAccount = regexp.MustCompile("^[0-9a-z-]{3,44}$") defaultValidStatusCodes = []int{ http.StatusRequestTimeout, // 408 http.StatusInternalServerError, // 500 @@ -175,6 +165,23 @@ type AzureStorageServiceError struct { APIVersion string } +// AzureTablesServiceError contains fields of the error response from +// Azure Table Storage Service REST API in Atom format. +// See https://msdn.microsoft.com/en-us/library/azure/dd179382.aspx +type AzureTablesServiceError struct { + Code string `xml:"code"` + Message string `xml:"message"` + StatusCode int + RequestID string + Date string + APIVersion string +} + +func (e AzureTablesServiceError) Error() string { + return fmt.Sprintf("storage: service returned error: StatusCode=%d, ErrorCode=%s, ErrorMessage=%s, RequestInitiated=%s, RequestId=%s, API Version=%s", + e.StatusCode, e.Code, e.Message, e.Date, e.RequestID, e.APIVersion) +} + type odataErrorMessage struct { Lang string `json:"lang"` Value string `json:"value"` @@ -309,10 +316,36 @@ func NewClient(accountName, accountKey, serviceBaseURL, apiVersion string, useHT return c, fmt.Errorf("azure: malformed storage account key: %v", err) } - c = Client{ + return newClient(accountName, key, serviceBaseURL, apiVersion, useHTTPS) +} + +// NewCosmosClient constructs a Client for Azure CosmosDB. This should be used if the caller wants +// to specify whether to use HTTPS, a specific REST API version or a custom +// cosmos endpoint than Azure Public Cloud. +func NewCosmosClient(accountName, accountKey, serviceBaseURL, apiVersion string, useHTTPS bool) (Client, error) { + var c Client + if !IsValidCosmosAccount(accountName) { + return c, fmt.Errorf("azure: account name is not valid: The name can contain only lowercase letters, numbers and the '-' character, and must be between 3 and 44 characters: %v", accountName) + } else if accountKey == "" { + return c, fmt.Errorf("azure: account key required") + } else if serviceBaseURL == "" { + return c, fmt.Errorf("azure: base storage service url required") + } + + key, err := base64.StdEncoding.DecodeString(accountKey) + if err != nil { + return c, fmt.Errorf("azure: malformed cosmos account key: %v", err) + } + + return newClient(accountName, key, serviceBaseURL, apiVersion, useHTTPS) +} + +// newClient constructs a Client with given parameters. +func newClient(accountName string, accountKey []byte, serviceBaseURL, apiVersion string, useHTTPS bool) (Client, error) { + c := Client{ HTTPClient: http.DefaultClient, accountName: accountName, - accountKey: key, + accountKey: accountKey, useHTTPS: useHTTPS, baseURL: serviceBaseURL, apiVersion: apiVersion, @@ -334,6 +367,12 @@ func IsValidStorageAccount(account string) bool { return validStorageAccount.MatchString(account) } +// IsValidCosmosAccount checks if the Cosmos account name is valid. +// See https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-manage-database-account +func IsValidCosmosAccount(account string) bool { + return validCosmosAccount.MatchString(account) +} + // NewAccountSASClient contructs a client that uses accountSAS authorization // for its operations. func NewAccountSASClient(account string, token url.Values, env azure.Environment) Client { @@ -795,8 +834,21 @@ func (c Client) execInternalJSONCommon(verb, url string, headers map[string]stri err = serviceErrFromStatusCode(resp.StatusCode, resp.Status, requestID, date, version) return respToRet, req, resp, err } - // try unmarshal as odata.error json - err = json.Unmarshal(respBody, &respToRet.odata) + // response contains storage service error object, unmarshal + if resp.Header.Get("Content-Type") == "application/xml" { + storageErr := AzureTablesServiceError{ + StatusCode: resp.StatusCode, + RequestID: requestID, + Date: date, + APIVersion: version, + } + if err := xml.Unmarshal(respBody, &storageErr); err != nil { + storageErr.Message = fmt.Sprintf("Response body could no be unmarshaled: %v. Body: %v.", err, string(respBody)) + } + err = storageErr + } else { + err = json.Unmarshal(respBody, &respToRet.odata) + } } return respToRet, req, resp, err diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/commonsasuri.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/commonsasuri.go index e898e9bfaf94..a203fce8d44f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/commonsasuri.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/commonsasuri.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "net/url" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/container.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/container.go index 056473d49a20..ae2862c86880 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/container.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/container.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "encoding/xml" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/copyblob.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/copyblob.go index 151e9a51072c..3696e804fe06 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/copyblob.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/copyblob.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "errors" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/directory.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/directory.go index 6c0c6caf7d3e..498e9837c514 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/directory.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/directory.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "encoding/xml" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go index 07dc0df1f527..9ef63c8dd97e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "bytes" @@ -27,7 +16,7 @@ import ( "strings" "time" - uuid "github.com/satori/go.uuid" + "github.com/gofrs/uuid" ) // Annotating as secure for gas scanning diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go index 6a480b12a802..9848025ccbe6 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "errors" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/fileserviceclient.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/fileserviceclient.go index 1db8e7da6103..6a12d6dcbaa8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/fileserviceclient.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/fileserviceclient.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "encoding/xml" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/leaseblob.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/leaseblob.go index 5b4a65145b61..6453477ba61f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/leaseblob.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/leaseblob.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "errors" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go index ffc183be6192..e5447e4a1380 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "encoding/xml" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/odata.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/odata.go index 0690e85ad9b7..3b057223875a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/odata.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/odata.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // MetadataLevel determines if operations should return a paylod, // and it level of detail. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/pageblob.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/pageblob.go index 7ffd63821d7a..ff93ec2ac9bf 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/pageblob.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/pageblob.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "encoding/xml" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go index f90050cb0029..7731e4ebc1e0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "encoding/xml" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queuesasuri.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queuesasuri.go index 28d9ab937e24..ab39f956fb0f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queuesasuri.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queuesasuri.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "errors" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queueserviceclient.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queueserviceclient.go index 29febe146f65..752701c3bdff 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queueserviceclient.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/queueserviceclient.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // QueueServiceClient contains operations for Microsoft Azure Queue Storage // Service. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/share.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/share.go index cf75a2659153..30f7c14350a5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/share.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/share.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "fmt" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/storagepolicy.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/storagepolicy.go index 056ab398a812..35d13670cb58 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/storagepolicy.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/storagepolicy.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "strings" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/storageservice.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/storageservice.go index dc41992227c7..d139db77653f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/storageservice.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/storageservice.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "net/http" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/table.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/table.go index 0febf077f6b7..fc8631ee20c3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/table.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/table.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "bytes" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go index 5b05e3e2afa5..b5aaefe4738c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "bytes" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/tableserviceclient.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/tableserviceclient.go index 1f063a395200..8eccd5927b54 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/tableserviceclient.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/tableserviceclient.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "encoding/json" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go index 677394790df5..47a871991dc3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go @@ -1,18 +1,7 @@ package storage -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. import ( "bytes" @@ -31,7 +20,7 @@ import ( "strings" "time" - uuid "github.com/satori/go.uuid" + "github.com/gofrs/uuid" ) var ( diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index ae1ef97e166e..4d306904f00a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v43.0.0" +const Number = "v53.1.0" diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go index b83f16a49a1f..addc91099970 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go @@ -30,6 +30,7 @@ import ( "net/http" "net/url" "os" + "strconv" "strings" "sync" "time" @@ -76,6 +77,15 @@ const ( // the API version to use for the App Service MSI endpoint appServiceAPIVersion = "2017-09-01" + + // secret header used when authenticating against app service MSI endpoint + secretHeader = "Secret" + + // the format for expires_on in UTC with AM/PM + expiresOnDateFormatPM = "1/2/2006 15:04:05 PM +00:00" + + // the format for expires_on in UTC without AM/PM + expiresOnDateFormat = "1/2/2006 15:04:05 +00:00" ) // OAuthTokenProvider is an interface which should be implemented by an access token retriever @@ -727,14 +737,16 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI v := url.Values{} v.Set("resource", resource) - // App Service MSI currently only supports token API version 2017-09-01 - if isAppService() { + // we only support token API version 2017-09-01 for app services + clientIDParam := "client_id" + if isASEEndpoint(*msiEndpointURL) { v.Set("api-version", appServiceAPIVersion) + clientIDParam = "clientid" } else { v.Set("api-version", msiAPIVersion) } if userAssignedID != nil { - v.Set("client_id", *userAssignedID) + v.Set(clientIDParam, *userAssignedID) } if identityResourceID != nil { v.Set("mi_res_id", *identityResourceID) @@ -892,7 +904,6 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource spt.inner.Token = *token return spt.InvokeRefreshCallbacks(spt.inner.Token) } - req, err := http.NewRequest(http.MethodPost, spt.inner.OauthConfig.TokenEndpoint.String(), nil) if err != nil { return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err) @@ -901,7 +912,7 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource // Add header when runtime is on App Service or Functions if isASEEndpoint(spt.inner.OauthConfig.TokenEndpoint) { asMSISecret, _ := os.LookupEnv(asMSISecretEnv) - req.Header.Add("Secret", asMSISecret) + req.Header.Add(secretHeader, asMSISecret) } req = req.WithContext(ctx) if !isIMDS(spt.inner.OauthConfig.TokenEndpoint) { @@ -937,7 +948,10 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource if _, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok { req.Method = http.MethodGet - req.Header.Set(metadataHeader, "true") + // the metadata header isn't applicable for ASE + if !isASEEndpoint(spt.inner.OauthConfig.TokenEndpoint) { + req.Header.Set(metadataHeader, "true") + } } var resp *http.Response @@ -964,9 +978,9 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource if resp.StatusCode != http.StatusOK { if err != nil { - return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Failed reading response body: %v", resp.StatusCode, err), resp) + return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Failed reading response body: %v Endpoint %s", resp.StatusCode, err, req.URL.String()), resp) } - return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Response body: %s", resp.StatusCode, string(rb)), resp) + return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Response body: %s Endpoint %s", resp.StatusCode, string(rb), req.URL.String()), resp) } // for the following error cases don't return a TokenRefreshError. the operation succeeded @@ -979,15 +993,60 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource if len(strings.Trim(string(rb), " ")) == 0 { return fmt.Errorf("adal: Empty service principal token received during refresh") } - var token Token + token := struct { + AccessToken string `json:"access_token"` + RefreshToken string `json:"refresh_token"` + + // AAD returns expires_in as a string, ADFS returns it as an int + ExpiresIn json.Number `json:"expires_in"` + // expires_on can be in two formats, a UTC time stamp or the number of seconds. + ExpiresOn string `json:"expires_on"` + NotBefore json.Number `json:"not_before"` + + Resource string `json:"resource"` + Type string `json:"token_type"` + }{} + // return a TokenRefreshError in the follow error cases as the token is in an unexpected format err = json.Unmarshal(rb, &token) if err != nil { - return fmt.Errorf("adal: Failed to unmarshal the service principal token during refresh. Error = '%v' JSON = '%s'", err, string(rb)) + return newTokenRefreshError(fmt.Sprintf("adal: Failed to unmarshal the service principal token during refresh. Error = '%v' JSON = '%s'", err, string(rb)), resp) + } + expiresOn := json.Number("") + // ADFS doesn't include the expires_on field + if token.ExpiresOn != "" { + if expiresOn, err = parseExpiresOn(token.ExpiresOn); err != nil { + return newTokenRefreshError(fmt.Sprintf("adal: failed to parse expires_on: %v value '%s'", err, token.ExpiresOn), resp) + } + } + spt.inner.Token.AccessToken = token.AccessToken + spt.inner.Token.RefreshToken = token.RefreshToken + spt.inner.Token.ExpiresIn = token.ExpiresIn + spt.inner.Token.ExpiresOn = expiresOn + spt.inner.Token.NotBefore = token.NotBefore + spt.inner.Token.Resource = token.Resource + spt.inner.Token.Type = token.Type + + return spt.InvokeRefreshCallbacks(spt.inner.Token) +} + +// converts expires_on to the number of seconds +func parseExpiresOn(s string) (json.Number, error) { + // convert the expiration date to the number of seconds from now + timeToDuration := func(t time.Time) json.Number { + dur := t.Sub(time.Now().UTC()) + return json.Number(strconv.FormatInt(int64(dur.Round(time.Second).Seconds()), 10)) + } + if _, err := strconv.ParseInt(s, 10, 64); err == nil { + // this is the number of seconds case, no conversion required + return json.Number(s), nil + } else if eo, err := time.Parse(expiresOnDateFormatPM, s); err == nil { + return timeToDuration(eo), nil + } else if eo, err := time.Parse(expiresOnDateFormat, s); err == nil { + return timeToDuration(eo), nil + } else { + // unknown format + return json.Number(""), err } - - spt.inner.Token = token - - return spt.InvokeRefreshCallbacks(token) } // retry logic specific to retrieving a token from the IMDS endpoint @@ -1118,68 +1177,77 @@ func (mt *MultiTenantServicePrincipalToken) AuxiliaryOAuthTokens() []string { return tokens } -// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by -// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. -func (mt *MultiTenantServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error { - if err := mt.PrimaryToken.EnsureFreshWithContext(ctx); err != nil { - return fmt.Errorf("failed to refresh primary token: %v", err) +// NewMultiTenantServicePrincipalToken creates a new MultiTenantServicePrincipalToken with the specified credentials and resource. +func NewMultiTenantServicePrincipalToken(multiTenantCfg MultiTenantOAuthConfig, clientID string, secret string, resource string) (*MultiTenantServicePrincipalToken, error) { + if err := validateStringParam(clientID, "clientID"); err != nil { + return nil, err } - for _, aux := range mt.AuxiliaryTokens { - if err := aux.EnsureFreshWithContext(ctx); err != nil { - return fmt.Errorf("failed to refresh auxiliary token: %v", err) - } + if err := validateStringParam(secret, "secret"); err != nil { + return nil, err } - return nil -} - -// RefreshWithContext obtains a fresh token for the Service Principal. -func (mt *MultiTenantServicePrincipalToken) RefreshWithContext(ctx context.Context) error { - if err := mt.PrimaryToken.RefreshWithContext(ctx); err != nil { - return fmt.Errorf("failed to refresh primary token: %v", err) + if err := validateStringParam(resource, "resource"); err != nil { + return nil, err } - for _, aux := range mt.AuxiliaryTokens { - if err := aux.RefreshWithContext(ctx); err != nil { - return fmt.Errorf("failed to refresh auxiliary token: %v", err) - } + auxTenants := multiTenantCfg.AuxiliaryTenants() + m := MultiTenantServicePrincipalToken{ + AuxiliaryTokens: make([]*ServicePrincipalToken, len(auxTenants)), } - return nil -} - -// RefreshExchangeWithContext refreshes the token, but for a different resource. -func (mt *MultiTenantServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error { - if err := mt.PrimaryToken.RefreshExchangeWithContext(ctx, resource); err != nil { - return fmt.Errorf("failed to refresh primary token: %v", err) + primary, err := NewServicePrincipalToken(*multiTenantCfg.PrimaryTenant(), clientID, secret, resource) + if err != nil { + return nil, fmt.Errorf("failed to create SPT for primary tenant: %v", err) } - for _, aux := range mt.AuxiliaryTokens { - if err := aux.RefreshExchangeWithContext(ctx, resource); err != nil { - return fmt.Errorf("failed to refresh auxiliary token: %v", err) + m.PrimaryToken = primary + for i := range auxTenants { + aux, err := NewServicePrincipalToken(*auxTenants[i], clientID, secret, resource) + if err != nil { + return nil, fmt.Errorf("failed to create SPT for auxiliary tenant: %v", err) } + m.AuxiliaryTokens[i] = aux } - return nil + return &m, nil } -// NewMultiTenantServicePrincipalToken creates a new MultiTenantServicePrincipalToken with the specified credentials and resource. -func NewMultiTenantServicePrincipalToken(multiTenantCfg MultiTenantOAuthConfig, clientID string, secret string, resource string) (*MultiTenantServicePrincipalToken, error) { +// NewMultiTenantServicePrincipalTokenFromCertificate creates a new MultiTenantServicePrincipalToken with the specified certificate credentials and resource. +func NewMultiTenantServicePrincipalTokenFromCertificate(multiTenantCfg MultiTenantOAuthConfig, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey, resource string) (*MultiTenantServicePrincipalToken, error) { if err := validateStringParam(clientID, "clientID"); err != nil { return nil, err } - if err := validateStringParam(secret, "secret"); err != nil { - return nil, err - } if err := validateStringParam(resource, "resource"); err != nil { return nil, err } + if certificate == nil { + return nil, fmt.Errorf("parameter 'certificate' cannot be nil") + } + if privateKey == nil { + return nil, fmt.Errorf("parameter 'privateKey' cannot be nil") + } auxTenants := multiTenantCfg.AuxiliaryTenants() m := MultiTenantServicePrincipalToken{ AuxiliaryTokens: make([]*ServicePrincipalToken, len(auxTenants)), } - primary, err := NewServicePrincipalToken(*multiTenantCfg.PrimaryTenant(), clientID, secret, resource) + primary, err := NewServicePrincipalTokenWithSecret( + *multiTenantCfg.PrimaryTenant(), + clientID, + resource, + &ServicePrincipalCertificateSecret{ + PrivateKey: privateKey, + Certificate: certificate, + }, + ) if err != nil { return nil, fmt.Errorf("failed to create SPT for primary tenant: %v", err) } m.PrimaryToken = primary for i := range auxTenants { - aux, err := NewServicePrincipalToken(*auxTenants[i], clientID, secret, resource) + aux, err := NewServicePrincipalTokenWithSecret( + *auxTenants[i], + clientID, + resource, + &ServicePrincipalCertificateSecret{ + PrivateKey: privateKey, + Certificate: certificate, + }, + ) if err != nil { return nil, fmt.Errorf("failed to create SPT for auxiliary tenant: %v", err) } diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go index 45e01a7eee8d..54b4defefd57 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go @@ -18,6 +18,7 @@ package adal import ( "context" + "fmt" "net/http" "time" ) @@ -34,3 +35,43 @@ func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) req.URL.RawQuery = q.Encode() return sender.Do(req) } + +// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by +// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. +func (mt *MultiTenantServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error { + if err := mt.PrimaryToken.EnsureFreshWithContext(ctx); err != nil { + return fmt.Errorf("failed to refresh primary token: %w", err) + } + for _, aux := range mt.AuxiliaryTokens { + if err := aux.EnsureFreshWithContext(ctx); err != nil { + return fmt.Errorf("failed to refresh auxiliary token: %w", err) + } + } + return nil +} + +// RefreshWithContext obtains a fresh token for the Service Principal. +func (mt *MultiTenantServicePrincipalToken) RefreshWithContext(ctx context.Context) error { + if err := mt.PrimaryToken.RefreshWithContext(ctx); err != nil { + return fmt.Errorf("failed to refresh primary token: %w", err) + } + for _, aux := range mt.AuxiliaryTokens { + if err := aux.RefreshWithContext(ctx); err != nil { + return fmt.Errorf("failed to refresh auxiliary token: %w", err) + } + } + return nil +} + +// RefreshExchangeWithContext refreshes the token, but for a different resource. +func (mt *MultiTenantServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error { + if err := mt.PrimaryToken.RefreshExchangeWithContext(ctx, resource); err != nil { + return fmt.Errorf("failed to refresh primary token: %w", err) + } + for _, aux := range mt.AuxiliaryTokens { + if err := aux.RefreshExchangeWithContext(ctx, resource); err != nil { + return fmt.Errorf("failed to refresh auxiliary token: %w", err) + } + } + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go index 6f7ad8078c15..6d73bae15e9d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go @@ -34,3 +34,43 @@ func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) req.URL.RawQuery = q.Encode() return sender.Do(req) } + +// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by +// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. +func (mt *MultiTenantServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error { + if err := mt.PrimaryToken.EnsureFreshWithContext(ctx); err != nil { + return err + } + for _, aux := range mt.AuxiliaryTokens { + if err := aux.EnsureFreshWithContext(ctx); err != nil { + return err + } + } + return nil +} + +// RefreshWithContext obtains a fresh token for the Service Principal. +func (mt *MultiTenantServicePrincipalToken) RefreshWithContext(ctx context.Context) error { + if err := mt.PrimaryToken.RefreshWithContext(ctx); err != nil { + return err + } + for _, aux := range mt.AuxiliaryTokens { + if err := aux.RefreshWithContext(ctx); err != nil { + return err + } + } + return nil +} + +// RefreshExchangeWithContext refreshes the token, but for a different resource. +func (mt *MultiTenantServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error { + if err := mt.PrimaryToken.RefreshExchangeWithContext(ctx, resource); err != nil { + return err + } + for _, aux := range mt.AuxiliaryTokens { + if err := aux.RefreshExchangeWithContext(ctx, resource); err != nil { + return err + } + } + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/async.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/async.go index 17fb4d8c5251..42e28cf2e4d3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/async.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/async.go @@ -42,6 +42,52 @@ const ( var pollingCodes = [...]int{http.StatusNoContent, http.StatusAccepted, http.StatusCreated, http.StatusOK} +// FutureAPI contains the set of methods on the Future type. +type FutureAPI interface { + // Response returns the last HTTP response. + Response() *http.Response + + // Status returns the last status message of the operation. + Status() string + + // PollingMethod returns the method used to monitor the status of the asynchronous operation. + PollingMethod() PollingMethodType + + // DoneWithContext queries the service to see if the operation has completed. + DoneWithContext(context.Context, autorest.Sender) (bool, error) + + // GetPollingDelay returns a duration the application should wait before checking + // the status of the asynchronous request and true; this value is returned from + // the service via the Retry-After response header. If the header wasn't returned + // then the function returns the zero-value time.Duration and false. + GetPollingDelay() (time.Duration, bool) + + // WaitForCompletionRef will return when one of the following conditions is met: the long + // running operation has completed, the provided context is cancelled, or the client's + // polling duration has been exceeded. It will retry failed polling attempts based on + // the retry value defined in the client up to the maximum retry attempts. + // If no deadline is specified in the context then the client.PollingDuration will be + // used to determine if a default deadline should be used. + // If PollingDuration is greater than zero the value will be used as the context's timeout. + // If PollingDuration is zero then no default deadline will be used. + WaitForCompletionRef(context.Context, autorest.Client) error + + // MarshalJSON implements the json.Marshaler interface. + MarshalJSON() ([]byte, error) + + // MarshalJSON implements the json.Unmarshaler interface. + UnmarshalJSON([]byte) error + + // PollingURL returns the URL used for retrieving the status of the long-running operation. + PollingURL() string + + // GetResult should be called once polling has completed successfully. + // It makes the final GET call to retrieve the resultant payload. + GetResult(autorest.Sender) (*http.Response, error) +} + +var _ FutureAPI = (*Future)(nil) + // Future provides a mechanism to access the status and results of an asynchronous request. // Since futures are stateful they should be passed by value to avoid race conditions. type Future struct { diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go index a0b969dffa45..0ded76bc6f1d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go @@ -37,6 +37,9 @@ const ( // should be included in the response. HeaderReturnClientID = "x-ms-return-client-request-id" + // HeaderContentType is the type of the content in the HTTP response. + HeaderContentType = "Content-Type" + // HeaderRequestID is the Azure extension header of the service generated request ID returned // in the response. HeaderRequestID = "x-ms-request-id" @@ -89,54 +92,85 @@ func (se ServiceError) Error() string { // UnmarshalJSON implements the json.Unmarshaler interface for the ServiceError type. func (se *ServiceError) UnmarshalJSON(b []byte) error { - // per the OData v4 spec the details field must be an array of JSON objects. - // unfortunately not all services adhear to the spec and just return a single - // object instead of an array with one object. so we have to perform some - // shenanigans to accommodate both cases. // http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091 - type serviceError1 struct { + type serviceErrorInternal struct { Code string `json:"code"` Message string `json:"message"` - Target *string `json:"target"` - Details []map[string]interface{} `json:"details"` - InnerError map[string]interface{} `json:"innererror"` - AdditionalInfo []map[string]interface{} `json:"additionalInfo"` + Target *string `json:"target,omitempty"` + AdditionalInfo []map[string]interface{} `json:"additionalInfo,omitempty"` + // not all services conform to the OData v4 spec. + // the following fields are where we've seen discrepancies + + // spec calls for []map[string]interface{} but have seen map[string]interface{} + Details interface{} `json:"details,omitempty"` + + // spec calls for map[string]interface{} but have seen []map[string]interface{} and string + InnerError interface{} `json:"innererror,omitempty"` } - type serviceError2 struct { - Code string `json:"code"` - Message string `json:"message"` - Target *string `json:"target"` - Details map[string]interface{} `json:"details"` - InnerError map[string]interface{} `json:"innererror"` - AdditionalInfo []map[string]interface{} `json:"additionalInfo"` + sei := serviceErrorInternal{} + if err := json.Unmarshal(b, &sei); err != nil { + return err } - se1 := serviceError1{} - err := json.Unmarshal(b, &se1) - if err == nil { - se.populate(se1.Code, se1.Message, se1.Target, se1.Details, se1.InnerError, se1.AdditionalInfo) - return nil + // copy the fields we know to be correct + se.AdditionalInfo = sei.AdditionalInfo + se.Code = sei.Code + se.Message = sei.Message + se.Target = sei.Target + + // converts an []interface{} to []map[string]interface{} + arrayOfObjs := func(v interface{}) ([]map[string]interface{}, bool) { + arrayOf, ok := v.([]interface{}) + if !ok { + return nil, false + } + final := []map[string]interface{}{} + for _, item := range arrayOf { + as, ok := item.(map[string]interface{}) + if !ok { + return nil, false + } + final = append(final, as) + } + return final, true } - se2 := serviceError2{} - err = json.Unmarshal(b, &se2) - if err == nil { - se.populate(se2.Code, se2.Message, se2.Target, nil, se2.InnerError, se2.AdditionalInfo) - se.Details = append(se.Details, se2.Details) - return nil + // convert the remaining fields, falling back to raw JSON if necessary + + if c, ok := arrayOfObjs(sei.Details); ok { + se.Details = c + } else if c, ok := sei.Details.(map[string]interface{}); ok { + se.Details = []map[string]interface{}{c} + } else if sei.Details != nil { + // stuff into Details + se.Details = []map[string]interface{}{ + {"raw": sei.Details}, + } } - return err -} -func (se *ServiceError) populate(code, message string, target *string, details []map[string]interface{}, inner map[string]interface{}, additional []map[string]interface{}) { - se.Code = code - se.Message = message - se.Target = target - se.Details = details - se.InnerError = inner - se.AdditionalInfo = additional + if c, ok := sei.InnerError.(map[string]interface{}); ok { + se.InnerError = c + } else if c, ok := arrayOfObjs(sei.InnerError); ok { + // if there's only one error extract it + if len(c) == 1 { + se.InnerError = c[0] + } else { + // multiple errors, stuff them into the value + se.InnerError = map[string]interface{}{ + "multi": c, + } + } + } else if c, ok := sei.InnerError.(string); ok { + se.InnerError = map[string]interface{}{"error": c} + } else if sei.InnerError != nil { + // stuff into InnerError + se.InnerError = map[string]interface{}{ + "raw": sei.InnerError, + } + } + return nil } // RequestError describes an error response returned by Azure service. @@ -307,16 +341,30 @@ func WithErrorUnlessStatusCode(codes ...int) autorest.RespondDecorator { // Check if error is unwrapped ServiceError decoder := autorest.NewDecoder(encodedAs, bytes.NewReader(b.Bytes())) if err := decoder.Decode(&e.ServiceError); err != nil { - return err + return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b.String(), err) + } + + // for example, should the API return the literal value `null` as the response + if e.ServiceError == nil { + e.ServiceError = &ServiceError{ + Code: "Unknown", + Message: "Unknown service error", + Details: []map[string]interface{}{ + { + "HttpResponse.Body": b.String(), + }, + }, + } } } - if e.ServiceError.Message == "" { + + if e.ServiceError != nil && e.ServiceError.Message == "" { // if we're here it means the returned error wasn't OData v4 compliant. // try to unmarshal the body in hopes of getting something. rawBody := map[string]interface{}{} decoder := autorest.NewDecoder(encodedAs, bytes.NewReader(b.Bytes())) if err := decoder.Decode(&rawBody); err != nil { - return err + return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b.String(), err) } e.ServiceError = &ServiceError{ diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/client.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/client.go index e04f9fd4ecd2..898db8b95424 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/client.go @@ -165,7 +165,8 @@ type Client struct { // Setting this to zero will use the provided context to control the duration. PollingDuration time.Duration - // RetryAttempts sets the default number of retry attempts for client. + // RetryAttempts sets the total number of times the client will attempt to make an HTTP request. + // Set the value to 1 to disable retries. DO NOT set the value to less than 1. RetryAttempts int // RetryDuration sets the delay duration for retries. diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/error.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/error.go index f724f33327ed..35098eda8e75 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/error.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/error.go @@ -96,3 +96,8 @@ func (e DetailedError) Error() string { } return fmt.Sprintf("%s#%s: %s: StatusCode=%d -- Original Error: %v", e.PackageType, e.Method, e.Message, e.StatusCode, e.Original) } + +// Unwrap returns the original error. +func (e DetailedError) Unwrap() error { + return e.Original +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility.go index 416041c3f333..3467b8fa6043 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility.go @@ -26,8 +26,6 @@ import ( "net/url" "reflect" "strings" - - "github.com/Azure/go-autorest/autorest/adal" ) // EncodedAs is a series of constants specifying various data encodings @@ -207,18 +205,6 @@ func ChangeToGet(req *http.Request) *http.Request { return req } -// IsTokenRefreshError returns true if the specified error implements the TokenRefreshError -// interface. If err is a DetailedError it will walk the chain of Original errors. -func IsTokenRefreshError(err error) bool { - if _, ok := err.(adal.TokenRefreshError); ok { - return true - } - if de, ok := err.(DetailedError); ok { - return IsTokenRefreshError(de.Original) - } - return false -} - // IsTemporaryNetworkError returns true if the specified error is a temporary network error or false // if it's not. If the error doesn't implement the net.Error interface the return value is true. func IsTemporaryNetworkError(err error) bool { diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go new file mode 100644 index 000000000000..4cb5e6849f6a --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go @@ -0,0 +1,29 @@ +// +build go1.13 + +// Copyright 2017 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package autorest + +import ( + "errors" + + "github.com/Azure/go-autorest/autorest/adal" +) + +// IsTokenRefreshError returns true if the specified error implements the TokenRefreshError interface. +func IsTokenRefreshError(err error) bool { + var tre adal.TokenRefreshError + return errors.As(err, &tre) +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go new file mode 100644 index 000000000000..ebb51b4f5319 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go @@ -0,0 +1,31 @@ +// +build !go1.13 + +// Copyright 2017 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package autorest + +import "github.com/Azure/go-autorest/autorest/adal" + +// IsTokenRefreshError returns true if the specified error implements the TokenRefreshError +// interface. If err is a DetailedError it will walk the chain of Original errors. +func IsTokenRefreshError(err error) bool { + if _, ok := err.(adal.TokenRefreshError); ok { + return true + } + if de, ok := err.(DetailedError); ok { + return IsTokenRefreshError(de.Original) + } + return false +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/.clang-format b/cluster-autoscaler/vendor/github.com/cilium/ebpf/.clang-format new file mode 100644 index 000000000000..4eb94b1baa87 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/.clang-format @@ -0,0 +1,17 @@ +--- +Language: Cpp +BasedOnStyle: LLVM +AlignAfterOpenBracket: DontAlign +AlignConsecutiveAssignments: true +AlignEscapedNewlines: DontAlign +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortFunctionsOnASingleLine: false +BreakBeforeBraces: Attach +IndentWidth: 4 +KeepEmptyLinesAtTheStartOfBlocks: false +TabWidth: 4 +UseTab: ForContinuationAndIndentation +ColumnLimit: 1000 +... diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/.gitignore b/cluster-autoscaler/vendor/github.com/cilium/ebpf/.gitignore index f1c181ec9c5c..38b15653c0f9 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/.gitignore +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/.gitignore @@ -4,6 +4,7 @@ *.dll *.so *.dylib +*.o # Test binary, build with `go test -c` *.test diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/abi.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/abi.go index d432eb46f420..f86a17ee7226 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/abi.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/abi.go @@ -88,12 +88,6 @@ type ProgramABI struct { Type ProgramType } -func newProgramABIFromSpec(spec *ProgramSpec) *ProgramABI { - return &ProgramABI{ - spec.Type, - } -} - func newProgramABIFromFd(fd *internal.FD) (string, *ProgramABI, error) { info, err := bpfGetProgInfoByFD(fd) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/instruction.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/instruction.go index 8fbcf56647c7..890dc008acf6 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/instruction.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/instruction.go @@ -12,6 +12,14 @@ import ( // InstructionSize is the size of a BPF instruction in bytes const InstructionSize = 8 +// RawInstructionOffset is an offset in units of raw BPF instructions. +type RawInstructionOffset uint64 + +// Bytes returns the offset of an instruction in bytes. +func (rio RawInstructionOffset) Bytes() uint64 { + return uint64(rio) * InstructionSize +} + // Instruction is a single eBPF instruction. type Instruction struct { OpCode OpCode @@ -155,6 +163,13 @@ func (ins *Instruction) isLoadFromMap() bool { return ins.OpCode == LoadImmOp(DWord) && (ins.Src == PseudoMapFD || ins.Src == PseudoMapValue) } +// IsFunctionCall returns true if the instruction calls another BPF function. +// +// This is not the same thing as a BPF helper call. +func (ins *Instruction) IsFunctionCall() bool { + return ins.OpCode.JumpOp() == Call && ins.Src == PseudoCall +} + // Format implements fmt.Formatter. func (ins Instruction) Format(f fmt.State, c rune) { if c != 'v' { @@ -310,28 +325,6 @@ func (insns Instructions) ReferenceOffsets() map[string][]int { return offsets } -func (insns Instructions) marshalledOffsets() (map[string]int, error) { - symbols := make(map[string]int) - - marshalledPos := 0 - for _, ins := range insns { - currentPos := marshalledPos - marshalledPos += ins.OpCode.marshalledInstructions() - - if ins.Symbol == "" { - continue - } - - if _, ok := symbols[ins.Symbol]; ok { - return nil, fmt.Errorf("duplicate symbol %s", ins.Symbol) - } - - symbols[ins.Symbol] = currentPos - } - - return symbols, nil -} - // Format implements fmt.Formatter. // // You can control indentation of symbols by @@ -370,21 +363,17 @@ func (insns Instructions) Format(f fmt.State, c rune) { symIndent = strings.Repeat(" ", symPadding) } - // Figure out how many digits we need to represent the highest - // offset. - highestOffset := 0 - for _, ins := range insns { - highestOffset += ins.OpCode.marshalledInstructions() - } + // Guess how many digits we need at most, by assuming that all instructions + // are double wide. + highestOffset := len(insns) * 2 offsetWidth := int(math.Ceil(math.Log10(float64(highestOffset)))) - offset := 0 - for _, ins := range insns { - if ins.Symbol != "" { - fmt.Fprintf(f, "%s%s:\n", symIndent, ins.Symbol) + iter := insns.Iterate() + for iter.Next() { + if iter.Ins.Symbol != "" { + fmt.Fprintf(f, "%s%s:\n", symIndent, iter.Ins.Symbol) } - fmt.Fprintf(f, "%s%*d: %v\n", indent, offsetWidth, offset, ins) - offset += ins.OpCode.marshalledInstructions() + fmt.Fprintf(f, "%s%*d: %v\n", indent, offsetWidth, iter.Offset, iter.Ins) } return @@ -392,43 +381,49 @@ func (insns Instructions) Format(f fmt.State, c rune) { // Marshal encodes a BPF program into the kernel format. func (insns Instructions) Marshal(w io.Writer, bo binary.ByteOrder) error { - absoluteOffsets, err := insns.marshalledOffsets() - if err != nil { - return err - } - - num := 0 for i, ins := range insns { - switch { - case ins.OpCode.JumpOp() == Call && ins.Src == PseudoCall && ins.Constant == -1: - // Rewrite bpf to bpf call - offset, ok := absoluteOffsets[ins.Reference] - if !ok { - return fmt.Errorf("instruction %d: reference to missing symbol %s", i, ins.Reference) - } - - ins.Constant = int64(offset - num - 1) - - case ins.OpCode.Class() == JumpClass && ins.Offset == -1: - // Rewrite jump to label - offset, ok := absoluteOffsets[ins.Reference] - if !ok { - return fmt.Errorf("instruction %d: reference to missing symbol %s", i, ins.Reference) - } - - ins.Offset = int16(offset - num - 1) - } - - n, err := ins.Marshal(w, bo) + _, err := ins.Marshal(w, bo) if err != nil { return fmt.Errorf("instruction %d: %w", i, err) } - - num += int(n / InstructionSize) } return nil } +// Iterate allows iterating a BPF program while keeping track of +// various offsets. +// +// Modifying the instruction slice will lead to undefined behaviour. +func (insns Instructions) Iterate() *InstructionIterator { + return &InstructionIterator{insns: insns} +} + +// InstructionIterator iterates over a BPF program. +type InstructionIterator struct { + insns Instructions + // The instruction in question. + Ins *Instruction + // The index of the instruction in the original instruction slice. + Index int + // The offset of the instruction in raw BPF instructions. This accounts + // for double-wide instructions. + Offset RawInstructionOffset +} + +// Next returns true as long as there are any instructions remaining. +func (iter *InstructionIterator) Next() bool { + if len(iter.insns) == 0 { + return false + } + + if iter.Ins != nil { + iter.Offset += RawInstructionOffset(iter.Ins.OpCode.rawInstructions()) + } + iter.Ins = &iter.insns[0] + iter.insns = iter.insns[1:] + return true +} + type bpfInstruction struct { OpCode OpCode Registers bpfRegisters diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/opcode.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/opcode.go index c99b6595ac58..dc4564a98d20 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/opcode.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/opcode.go @@ -66,10 +66,10 @@ type OpCode uint8 // InvalidOpCode is returned by setters on OpCode const InvalidOpCode OpCode = 0xff -// marshalledInstructions returns the number of BPF instructions required +// rawInstructions returns the number of BPF instructions required // to encode this opcode. -func (op OpCode) marshalledInstructions() int { - if op == LoadImmOp(DWord) { +func (op OpCode) rawInstructions() int { + if op.isDWordLoad() { return 2 } return 1 diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/collection.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/collection.go index 0c8b65d94de2..81ee2bd1a6bc 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/collection.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/collection.go @@ -4,6 +4,8 @@ import ( "errors" "fmt" "math" + "reflect" + "strings" "github.com/cilium/ebpf/asm" "github.com/cilium/ebpf/internal" @@ -11,7 +13,10 @@ import ( ) // CollectionOptions control loading a collection into the kernel. +// +// Maps and Programs are passed to NewMapWithOptions and NewProgramsWithOptions. type CollectionOptions struct { + Maps MapOptions Programs ProgramOptions } @@ -126,6 +131,65 @@ func (cs *CollectionSpec) RewriteConstants(consts map[string]interface{}) error return nil } +// Assign the contents of a collection spec to a struct. +// +// This function is a short-cut to manually checking the presence +// of maps and programs in a collection spec. +// +// The argument to must be a pointer to a struct. A field of the +// struct is updated with values from Programs or Maps if it +// has an `ebpf` tag and its type is *ProgramSpec or *MapSpec. +// The tag gives the name of the program or map as found in +// the CollectionSpec. +// +// struct { +// Foo *ebpf.ProgramSpec `ebpf:"xdp_foo"` +// Bar *ebpf.MapSpec `ebpf:"bar_map"` +// Ignored int +// } +// +// Returns an error if any of the fields can't be found, or +// if the same map or program is assigned multiple times. +func (cs *CollectionSpec) Assign(to interface{}) error { + valueOf := func(typ reflect.Type, name string) (reflect.Value, error) { + switch typ { + case reflect.TypeOf((*ProgramSpec)(nil)): + p := cs.Programs[name] + if p == nil { + return reflect.Value{}, fmt.Errorf("missing program %q", name) + } + return reflect.ValueOf(p), nil + case reflect.TypeOf((*MapSpec)(nil)): + m := cs.Maps[name] + if m == nil { + return reflect.Value{}, fmt.Errorf("missing map %q", name) + } + return reflect.ValueOf(m), nil + default: + return reflect.Value{}, fmt.Errorf("unsupported type %s", typ) + } + } + + return assignValues(to, valueOf) +} + +// LoadAndAssign creates a collection from a spec, and assigns it to a struct. +// +// See Collection.Assign for details. +func (cs *CollectionSpec) LoadAndAssign(to interface{}, opts *CollectionOptions) error { + if opts == nil { + opts = &CollectionOptions{} + } + + coll, err := NewCollectionWithOptions(cs, *opts) + if err != nil { + return err + } + defer coll.Close() + + return coll.Assign(to) +} + // Collection is a collection of Programs and Maps associated // with their symbols type Collection struct { @@ -191,7 +255,7 @@ func NewCollectionWithOptions(spec *CollectionSpec, opts CollectionOptions) (col } } - m, err := newMapWithBTF(mapSpec, handle) + m, err := newMapWithBTF(mapSpec, handle, opts.Maps) if err != nil { return nil, fmt.Errorf("map %s: %w", mapName, err) } @@ -292,3 +356,105 @@ func (coll *Collection) DetachProgram(name string) *Program { delete(coll.Programs, name) return p } + +// Assign the contents of a collection to a struct. +// +// `to` must be a pointer to a struct like the following: +// +// struct { +// Foo *ebpf.Program `ebpf:"xdp_foo"` +// Bar *ebpf.Map `ebpf:"bar_map"` +// Ignored int +// } +// +// See CollectionSpec.Assign for the semantics of this function. +// +// DetachMap and DetachProgram is invoked for all assigned elements +// if the function is successful. +func (coll *Collection) Assign(to interface{}) error { + assignedMaps := make(map[string]struct{}) + assignedPrograms := make(map[string]struct{}) + valueOf := func(typ reflect.Type, name string) (reflect.Value, error) { + switch typ { + case reflect.TypeOf((*Program)(nil)): + p := coll.Programs[name] + if p == nil { + return reflect.Value{}, fmt.Errorf("missing program %q", name) + } + assignedPrograms[name] = struct{}{} + return reflect.ValueOf(p), nil + case reflect.TypeOf((*Map)(nil)): + m := coll.Maps[name] + if m == nil { + return reflect.Value{}, fmt.Errorf("missing map %q", name) + } + assignedMaps[name] = struct{}{} + return reflect.ValueOf(m), nil + default: + return reflect.Value{}, fmt.Errorf("unsupported type %s", typ) + } + } + + if err := assignValues(to, valueOf); err != nil { + return err + } + + for name := range assignedPrograms { + coll.DetachProgram(name) + } + + for name := range assignedMaps { + coll.DetachMap(name) + } + + return nil +} + +func assignValues(to interface{}, valueOf func(reflect.Type, string) (reflect.Value, error)) error { + v := reflect.ValueOf(to) + if v.Kind() != reflect.Ptr || v.Elem().Kind() != reflect.Struct { + return fmt.Errorf("%T is not a pointer to a struct", to) + } + + type elem struct { + typ reflect.Type + name string + } + + var ( + s = v.Elem() + sT = s.Type() + assignedTo = make(map[elem]string) + ) + for i := 0; i < sT.NumField(); i++ { + field := sT.Field(i) + + name := field.Tag.Get("ebpf") + if name == "" { + continue + } + if strings.Contains(name, ",") { + return fmt.Errorf("field %s: ebpf tag contains a comma", field.Name) + } + + e := elem{field.Type, name} + if assignedField := assignedTo[e]; assignedField != "" { + return fmt.Errorf("field %s: %q was already assigned to %s", field.Name, name, assignedField) + } + + value, err := valueOf(field.Type, name) + if err != nil { + return fmt.Errorf("field %s: %w", field.Name, err) + } + + fieldValue := s.Field(i) + if !fieldValue.CanSet() { + return fmt.Errorf("can't set value of field %s", field.Name) + } + + fieldValue.Set(value) + assignedTo[e] = field.Name + } + + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/doc.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/doc.go index d96e6b1e6d93..f7f34da8f44c 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/doc.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/doc.go @@ -12,6 +12,5 @@ // eBPF code should be compiled ahead of time using clang, and shipped with // your application as any other resource. // -// This package doesn't include code required to attach eBPF to Linux -// subsystems, since this varies per subsystem. +// Use the link subpackage to attach a loaded program to a hook in the kernel. package ebpf diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader.go index 77acaed8d962..2b564dae047c 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader.go @@ -1,6 +1,7 @@ package ebpf import ( + "bufio" "bytes" "debug/elf" "encoding/binary" @@ -236,7 +237,7 @@ func (ec *elfCode) loadPrograms(progSections map[elf.SectionIndex]*elf.Section, func (ec *elfCode) loadInstructions(section *elf.Section, symbols, relocations map[uint64]elf.Symbol) (asm.Instructions, uint64, error) { var ( - r = section.Open() + r = bufio.NewReader(section.Open()) insns asm.Instructions offset uint64 ) @@ -389,7 +390,7 @@ func (ec *elfCode) loadMaps(maps map[string]*MapSpec, mapSections map[elf.Sectio } var ( - r = sec.Open() + r = bufio.NewReader(sec.Open()) size = sec.Size / uint64(len(syms)) ) for i, offset := 0, uint64(0); i < len(syms); i, offset = i+1, offset+size { @@ -482,6 +483,7 @@ func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) { var ( mapType, flags, maxEntries uint32 + pinType PinType ) for _, member := range btfMapMembers { switch member.Name { @@ -529,9 +531,7 @@ func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) { return nil, fmt.Errorf("can't get pinning: %w", err) } - if pinning != 0 { - return nil, fmt.Errorf("'pinning' attribute not supported: %w", ErrNotSupported) - } + pinType = PinType(pinning) case "key", "value": default: @@ -540,12 +540,14 @@ func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) { } return &MapSpec{ + Name: SanitizeName(name, -1), Type: MapType(mapType), KeySize: keySize, ValueSize: valueSize, MaxEntries: maxEntries, Flags: flags, BTF: btfMap, + Pinning: pinType, }, nil } @@ -636,6 +638,8 @@ func getProgType(sectionName string) (ProgramType, AttachType, string) { "lirc_mode2": {LircMode2, AttachLircMode2}, "flow_dissector": {FlowDissector, AttachFlowDissector}, "iter/": {Tracing, AttachTraceIter}, + "sk_lookup/": {SkLookup, AttachSkLookup}, + "lsm/": {LSM, AttachLSMMac}, "cgroup_skb/ingress": {CGroupSKB, AttachCGroupInetIngress}, "cgroup_skb/egress": {CGroupSKB, AttachCGroupInetEgress}, @@ -684,7 +688,7 @@ func (ec *elfCode) loadRelocations(sections map[elf.SectionIndex]*elf.Section) ( return nil, nil, fmt.Errorf("section %s: relocations are less than 16 bytes", sec.Name) } - r := sec.Open() + r := bufio.NewReader(sec.Open()) for off := uint64(0); off < sec.Size; off += sec.Entsize { ent := io.LimitReader(r, int64(sec.Entsize)) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.mod b/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.mod index a05cf85eddd3..2d1004425024 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.mod +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.mod @@ -1,5 +1,8 @@ module github.com/cilium/ebpf -go 1.13 +go 1.14 -require golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 +require ( + github.com/google/go-cmp v0.5.2 + golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 +) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.sum b/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.sum index e8b62417e811..47dd82f2921f 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.sum +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.sum @@ -1,2 +1,6 @@ +github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf.go index 3dd000a284e7..7a904a02c2c2 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf.go @@ -31,7 +31,7 @@ var ( type Spec struct { rawTypes []rawType strings stringTable - types map[string][]Type + types map[string][]namedType funcInfos map[string]extInfo lineInfos map[string]extInfo byteOrder binary.ByteOrder @@ -59,29 +59,9 @@ func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { } defer file.Close() - var ( - btfSection *elf.Section - btfExtSection *elf.Section - sectionSizes = make(map[string]uint32) - ) - - for _, sec := range file.Sections { - switch sec.Name { - case ".BTF": - btfSection = sec - case ".BTF.ext": - btfExtSection = sec - default: - if sec.Type != elf.SHT_PROGBITS && sec.Type != elf.SHT_NOBITS { - break - } - - if sec.Size > math.MaxUint32 { - return nil, fmt.Errorf("section %s exceeds maximum size", sec.Name) - } - - sectionSizes[sec.Name] = uint32(sec.Size) - } + btfSection, btfExtSection, sectionSizes, err := findBtfSections(file) + if err != nil { + return nil, err } if btfSection == nil { @@ -129,6 +109,51 @@ func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { return spec, nil } +func findBtfSections(file *elf.File) (*elf.Section, *elf.Section, map[string]uint32, error) { + var ( + btfSection *elf.Section + btfExtSection *elf.Section + sectionSizes = make(map[string]uint32) + ) + + for _, sec := range file.Sections { + switch sec.Name { + case ".BTF": + btfSection = sec + case ".BTF.ext": + btfExtSection = sec + default: + if sec.Type != elf.SHT_PROGBITS && sec.Type != elf.SHT_NOBITS { + break + } + + if sec.Size > math.MaxUint32 { + return nil, nil, nil, fmt.Errorf("section %s exceeds maximum size", sec.Name) + } + + sectionSizes[sec.Name] = uint32(sec.Size) + } + } + return btfSection, btfExtSection, sectionSizes, nil +} + +func loadSpecFromVmlinux(rd io.ReaderAt) (*Spec, error) { + file, err := elf.NewFile(rd) + if err != nil { + return nil, err + } + defer file.Close() + + btfSection, _, _, err := findBtfSections(file) + if err != nil { + return nil, fmt.Errorf(".BTF ELF section: %s", err) + } + if btfSection == nil { + return nil, fmt.Errorf("unable to find .BTF ELF section") + } + return loadNakedSpec(btfSection.Open(), file.ByteOrder, nil, nil) +} + func loadNakedSpec(btf io.ReadSeeker, bo binary.ByteOrder, sectionSizes map[string]uint32, variableOffsets map[variable]uint32) (*Spec, error) { rawTypes, rawStrings, err := parseBTF(btf, bo) if err != nil { @@ -176,16 +201,43 @@ func LoadKernelSpec() (*Spec, error) { } func loadKernelSpec() (*Spec, error) { + release, err := unix.KernelRelease() + if err != nil { + return nil, fmt.Errorf("can't read kernel release number: %w", err) + } + fh, err := os.Open("/sys/kernel/btf/vmlinux") - if os.IsNotExist(err) { - return nil, fmt.Errorf("can't open kernel BTF at /sys/kernel/btf/vmlinux: %w", ErrNotFound) + if err == nil { + defer fh.Close() + + return loadNakedSpec(fh, internal.NativeEndian, nil, nil) } - if err != nil { - return nil, fmt.Errorf("can't read kernel BTF: %s", err) + + // use same list of locations as libbpf + // https://github.com/libbpf/libbpf/blob/9a3a42608dbe3731256a5682a125ac1e23bced8f/src/btf.c#L3114-L3122 + locations := []string{ + "/boot/vmlinux-%s", + "/lib/modules/%s/vmlinux-%[1]s", + "/lib/modules/%s/build/vmlinux", + "/usr/lib/modules/%s/kernel/vmlinux", + "/usr/lib/debug/boot/vmlinux-%s", + "/usr/lib/debug/boot/vmlinux-%s.debug", + "/usr/lib/debug/lib/modules/%s/vmlinux", + } + + for _, loc := range locations { + path := fmt.Sprintf(loc, release) + + fh, err := os.Open(path) + if err != nil { + continue + } + defer fh.Close() + + return loadSpecFromVmlinux(fh) } - defer fh.Close() - return loadNakedSpec(fh, internal.NativeEndian, nil, nil) + return nil, fmt.Errorf("no BTF for kernel version %s: %w", release, internal.ErrNotSupported) } func parseBTF(btf io.ReadSeeker, bo binary.ByteOrder) ([]rawType, stringTable, error) { @@ -402,9 +454,19 @@ func (s *Spec) Map(name string) (*Map, []Member, error) { switch member.Name { case "key": key = member.Type + if pk, isPtr := key.(*Pointer); !isPtr { + return nil, nil, fmt.Errorf("key type is not a pointer: %T", key) + } else { + key = pk.Target + } case "value": value = member.Type + if vk, isPtr := value.(*Pointer); !isPtr { + return nil, nil, fmt.Errorf("value type is not a pointer: %T", value) + } else { + value = vk.Target + } } } @@ -441,11 +503,16 @@ func (s *Spec) FindType(name string, typ Type) error { candidate Type ) - for _, typ := range s.types[name] { + for _, typ := range s.types[essentialName(name)] { if reflect.TypeOf(typ) != wanted { continue } + // Match against the full name, not just the essential one. + if typ.name() != name { + continue + } + if candidate != nil { return fmt.Errorf("type %s: multiple candidates for %T", name, typ) } @@ -621,9 +688,7 @@ type bpfLoadBTFAttr struct { } func bpfLoadBTF(attr *bpfLoadBTFAttr) (*internal.FD, error) { - const _BTFLoad = 18 - - fd, err := internal.BPF(_BTFLoad, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) + fd, err := internal.BPF(internal.BPF_BTF_LOAD, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) if err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go index e34a87ecb457..a4cde3fe8270 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go @@ -40,10 +40,12 @@ const ( ) const ( - btfTypeKindShift = 24 - btfTypeKindLen = 4 - btfTypeVlenShift = 0 - btfTypeVlenMask = 16 + btfTypeKindShift = 24 + btfTypeKindLen = 4 + btfTypeVlenShift = 0 + btfTypeVlenMask = 16 + btfTypeKindFlagShift = 31 + btfTypeKindFlagMask = 1 ) // btfType is equivalent to struct btf_type in Documentation/bpf/btf.rst. @@ -136,6 +138,10 @@ func (bt *btfType) SetVlen(vlen int) { bt.setInfo(uint32(vlen), btfTypeVlenMask, btfTypeVlenShift) } +func (bt *btfType) KindFlag() bool { + return bt.info(btfTypeKindFlagMask, btfTypeKindFlagShift) == 1 +} + func (bt *btfType) Linkage() btfFuncLinkage { return btfFuncLinkage(bt.info(btfTypeVlenMask, btfTypeVlenShift)) } @@ -257,3 +263,7 @@ func readTypes(r io.Reader, bo binary.ByteOrder) ([]rawType, error) { types = append(types, rawType{header, data}) } } + +func intEncoding(raw uint32) (IntEncoding, uint32, byte) { + return IntEncoding((raw & 0x0f000000) >> 24), (raw & 0x00ff0000) >> 16, byte(raw & 0x000000ff) +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go index 28918ae9e0c8..c1c82ec7f802 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go @@ -1,6 +1,7 @@ package btf import ( + "bufio" "bytes" "encoding/binary" "errors" @@ -58,7 +59,8 @@ func parseExtInfos(r io.ReadSeeker, bo binary.ByteOrder, strings stringTable) (f return nil, nil, fmt.Errorf("can't seek to function info section: %v", err) } - funcInfo, err = parseExtInfo(io.LimitReader(r, int64(header.FuncInfoLen)), bo, strings) + buf := bufio.NewReader(io.LimitReader(r, int64(header.FuncInfoLen))) + funcInfo, err = parseExtInfo(buf, bo, strings) if err != nil { return nil, nil, fmt.Errorf("function info: %w", err) } @@ -67,7 +69,8 @@ func parseExtInfos(r io.ReadSeeker, bo binary.ByteOrder, strings stringTable) (f return nil, nil, fmt.Errorf("can't seek to line info section: %v", err) } - lineInfo, err = parseExtInfo(io.LimitReader(r, int64(header.LineInfoLen)), bo, strings) + buf = bufio.NewReader(io.LimitReader(r, int64(header.LineInfoLen))) + lineInfo, err = parseExtInfo(buf, bo, strings) if err != nil { return nil, nil, fmt.Errorf("line info: %w", err) } @@ -127,6 +130,8 @@ func (ei extInfo) MarshalBinary() ([]byte, error) { } func parseExtInfo(r io.Reader, bo binary.ByteOrder, strings stringTable) (map[string]extInfo, error) { + const maxRecordSize = 256 + var recordSize uint32 if err := binary.Read(r, bo, &recordSize); err != nil { return nil, fmt.Errorf("can't read record size: %v", err) @@ -136,6 +141,9 @@ func parseExtInfo(r io.Reader, bo binary.ByteOrder, strings stringTable) (map[st // Need at least insnOff return nil, errors.New("record size too short") } + if recordSize > maxRecordSize { + return nil, fmt.Errorf("record size %v exceeds %v", recordSize, maxRecordSize) + } result := make(map[string]extInfo) for { diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go new file mode 100644 index 000000000000..37e043fd378c --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go @@ -0,0 +1,49 @@ +// +build gofuzz + +// Use with https://github.com/dvyukov/go-fuzz + +package btf + +import ( + "bytes" + "encoding/binary" + + "github.com/cilium/ebpf/internal" +) + +func FuzzSpec(data []byte) int { + if len(data) < binary.Size(btfHeader{}) { + return -1 + } + + spec, err := loadNakedSpec(bytes.NewReader(data), internal.NativeEndian, nil, nil) + if err != nil { + if spec != nil { + panic("spec is not nil") + } + return 0 + } + if spec == nil { + panic("spec is nil") + } + return 1 +} + +func FuzzExtInfo(data []byte) int { + if len(data) < binary.Size(btfExtHeader{}) { + return -1 + } + + table := stringTable("\x00foo\x00barfoo\x00") + info, err := parseExtInfo(bytes.NewReader(data), internal.NativeEndian, table) + if err != nil { + if info != nil { + panic("info is not nil") + } + return 0 + } + if info == nil { + panic("info is nil") + } + return 1 +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/types.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/types.go index 264142abc0ad..a93039bd5183 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/types.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/types.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "math" + "strings" ) const maxTypeDepth = 32 @@ -23,9 +24,19 @@ type Type interface { // Make a copy of the type, without copying Type members. copy() Type + // Enumerate all nested Types. Repeated calls must visit nested + // types in the same order. walk(*copyStack) } +// namedType is a type with a name. +// +// Most named types simply embed Name. +type namedType interface { + Type + name() string +} + // Name identifies a type. // // Anonymous types have an empty name. @@ -43,15 +54,30 @@ func (v *Void) size() uint32 { return 0 } func (v *Void) copy() Type { return (*Void)(nil) } func (v *Void) walk(*copyStack) {} +type IntEncoding byte + +const ( + Signed IntEncoding = 1 << iota + Char + Bool +) + // Int is an integer of a given length. type Int struct { TypeID Name // The size of the integer in bytes. - Size uint32 + Size uint32 + Encoding IntEncoding + // Offset is the starting bit offset. Currently always 0. + // See https://www.kernel.org/doc/html/latest/bpf/btf.html#btf-kind-int + Offset uint32 + Bits byte } +var _ namedType = (*Int)(nil) + func (i *Int) size() uint32 { return i.Size } func (i *Int) walk(*copyStack) {} func (i *Int) copy() Type { @@ -109,6 +135,10 @@ func (s *Struct) copy() Type { return &cpy } +func (s *Struct) members() []Member { + return s.Members +} + // Union is a compound type where members occupy the same memory. type Union struct { TypeID @@ -133,25 +163,51 @@ func (u *Union) copy() Type { return &cpy } +func (u *Union) members() []Member { + return u.Members +} + +type composite interface { + members() []Member +} + +var ( + _ composite = (*Struct)(nil) + _ composite = (*Union)(nil) +) + // Member is part of a Struct or Union. // // It is not a valid Type. type Member struct { Name - Type Type - Offset uint32 + Type Type + // Offset is the bit offset of this member + Offset uint32 + BitfieldSize uint32 } // Enum lists possible values. type Enum struct { TypeID Name + Values []EnumValue +} + +// EnumValue is part of an Enum +// +// Is is not a valid Type +type EnumValue struct { + Name + Value int32 } func (e *Enum) size() uint32 { return 4 } func (e *Enum) walk(*copyStack) {} func (e *Enum) copy() Type { cpy := *e + cpy.Values = make([]EnumValue, len(e.Values)) + copy(cpy.Values, e.Values) return &cpy } @@ -180,36 +236,39 @@ func (td *Typedef) copy() Type { return &cpy } -// Volatile is a modifier. +// Volatile is a qualifier. type Volatile struct { TypeID Type Type } +func (v *Volatile) qualify() Type { return v.Type } func (v *Volatile) walk(cs *copyStack) { cs.push(&v.Type) } func (v *Volatile) copy() Type { cpy := *v return &cpy } -// Const is a modifier. +// Const is a qualifier. type Const struct { TypeID Type Type } +func (c *Const) qualify() Type { return c.Type } func (c *Const) walk(cs *copyStack) { cs.push(&c.Type) } func (c *Const) copy() Type { cpy := *c return &cpy } -// Restrict is a modifier. +// Restrict is a qualifier. type Restrict struct { TypeID Type Type } +func (r *Restrict) qualify() Type { return r.Type } func (r *Restrict) walk(cs *copyStack) { cs.push(&r.Type) } func (r *Restrict) copy() Type { cpy := *r @@ -233,15 +292,28 @@ func (f *Func) copy() Type { type FuncProto struct { TypeID Return Type - // Parameters not supported yet + Params []FuncParam +} + +func (fp *FuncProto) walk(cs *copyStack) { + cs.push(&fp.Return) + for i := range fp.Params { + cs.push(&fp.Params[i].Type) + } } -func (fp *FuncProto) walk(cs *copyStack) { cs.push(&fp.Return) } func (fp *FuncProto) copy() Type { cpy := *fp + cpy.Params = make([]FuncParam, len(fp.Params)) + copy(cpy.Params, fp.Params) return &cpy } +type FuncParam struct { + Name + Type Type +} + // Var is a global variable. type Var struct { TypeID @@ -298,6 +370,16 @@ var ( _ sizer = (*Datasec)(nil) ) +type qualifier interface { + qualify() Type +} + +var ( + _ qualifier = (*Const)(nil) + _ qualifier = (*Restrict)(nil) + _ qualifier = (*Volatile)(nil) +) + // Sizeof returns the size of a type in bytes. // // Returns an error if the size can't be computed. @@ -326,14 +408,9 @@ func Sizeof(typ Type) (int, error) { case *Typedef: typ = v.Type continue - case *Volatile: - typ = v.Type - continue - case *Const: - typ = v.Type - continue - case *Restrict: - typ = v.Type + + case qualifier: + typ = v.qualify() continue default: @@ -383,7 +460,7 @@ func copyType(typ Type) Type { } // copyStack keeps track of pointers to types which still -// need to be copied. +// need to be visited. type copyStack []*Type // push adds a type to the stack. @@ -403,19 +480,13 @@ func (cs *copyStack) pop() *Type { return t } -type namer interface { - name() string -} - -var _ namer = Name("") - // inflateRawTypes takes a list of raw btf types linked via type IDs, and turns // it into a graph of Types connected via pointers. // // Returns a map of named types (so, where NameOff is non-zero). Since BTF ignores // compilation units, multiple types may share the same name. A Type may form a // cyclic graph by pointing at itself. -func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map[string][]Type, err error) { +func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map[string][]namedType, err error) { type fixupDef struct { id TypeID expectedKind btfKind @@ -427,7 +498,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map fixups = append(fixups, fixupDef{id, expectedKind, typ}) } - convertMembers := func(raw []btfMember) ([]Member, error) { + convertMembers := func(raw []btfMember, kindFlag bool) ([]Member, error) { // NB: The fixup below relies on pre-allocating this array to // work, since otherwise append might re-allocate members. members := make([]Member, 0, len(raw)) @@ -436,10 +507,15 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map if err != nil { return nil, fmt.Errorf("can't get name for member %d: %w", i, err) } - members = append(members, Member{ + m := Member{ Name: name, Offset: btfMember.Offset, - }) + } + if kindFlag { + m.BitfieldSize = btfMember.Offset >> 24 + m.Offset &= 0xffffff + } + members = append(members, m) } for i := range members { fixup(raw[i].Type, kindUnknown, &members[i].Type) @@ -449,7 +525,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map types := make([]Type, 0, len(rawTypes)) types = append(types, (*Void)(nil)) - namedTypes = make(map[string][]Type) + namedTypes = make(map[string][]namedType) for i, raw := range rawTypes { var ( @@ -466,7 +542,8 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map switch raw.Kind() { case kindInt: - typ = &Int{id, name, raw.Size()} + encoding, offset, bits := intEncoding(*raw.data.(*uint32)) + typ = &Int{id, name, raw.Size(), encoding, offset, bits} case kindPointer: ptr := &Pointer{id, nil} @@ -483,21 +560,33 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map typ = arr case kindStruct: - members, err := convertMembers(raw.data.([]btfMember)) + members, err := convertMembers(raw.data.([]btfMember), raw.KindFlag()) if err != nil { return nil, fmt.Errorf("struct %s (id %d): %w", name, id, err) } typ = &Struct{id, name, raw.Size(), members} case kindUnion: - members, err := convertMembers(raw.data.([]btfMember)) + members, err := convertMembers(raw.data.([]btfMember), raw.KindFlag()) if err != nil { return nil, fmt.Errorf("union %s (id %d): %w", name, id, err) } typ = &Union{id, name, raw.Size(), members} case kindEnum: - typ = &Enum{id, name} + rawvals := raw.data.([]btfEnum) + vals := make([]EnumValue, 0, len(rawvals)) + for i, btfVal := range rawvals { + name, err := rawStrings.LookupName(btfVal.NameOff) + if err != nil { + return nil, fmt.Errorf("can't get name for enum value %d: %s", i, err) + } + vals = append(vals, EnumValue{ + Name: name, + Value: btfVal.Val, + }) + } + typ = &Enum{id, name, vals} case kindForward: typ = &Fwd{id, name} @@ -528,7 +617,22 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map typ = fn case kindFuncProto: - fp := &FuncProto{id, nil} + rawparams := raw.data.([]btfParam) + params := make([]FuncParam, 0, len(rawparams)) + for i, param := range rawparams { + name, err := rawStrings.LookupName(param.NameOff) + if err != nil { + return nil, fmt.Errorf("can't get name for func proto parameter %d: %s", i, err) + } + params = append(params, FuncParam{ + Name: name, + }) + } + for i := range params { + fixup(rawparams[i].Type, kindUnknown, ¶ms[i].Type) + } + + fp := &FuncProto{id, nil, params} fixup(raw.Type(), kindUnknown, &fp.Return) typ = fp @@ -557,9 +661,9 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map types = append(types, typ) - if namer, ok := typ.(namer); ok { - if name := namer.name(); name != "" { - namedTypes[name] = append(namedTypes[name], typ) + if named, ok := typ.(namedType); ok { + if name := essentialName(named.name()); name != "" { + namedTypes[name] = append(namedTypes[name], named) } } } @@ -585,3 +689,12 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map return namedTypes, nil } + +// essentialName returns name without a ___ suffix. +func essentialName(name string) string { + lastIdx := strings.LastIndex(name, "___") + if lastIdx > 0 { + return name[:lastIdx] + } + return name +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/feature.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/feature.go index 7375b21ef984..8f282db64dfa 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/feature.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/feature.go @@ -20,6 +20,9 @@ type UnsupportedFeatureError struct { } func (ufe *UnsupportedFeatureError) Error() string { + if ufe.MinimumVersion.Unspecified() { + return fmt.Sprintf("%s not supported", ufe.Name) + } return fmt.Sprintf("%s not supported (requires >= %s)", ufe.Name, ufe.MinimumVersion) } @@ -120,3 +123,8 @@ func (v Version) Less(other Version) bool { } return false } + +// Unspecified returns true if the version is all zero. +func (v Version) Unspecified() bool { + return v[0] == 0 && v[1] == 0 && v[2] == 0 +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/syscall.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/syscall.go index efbf40327c6b..9c5e0b3edd1d 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/syscall.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/syscall.go @@ -137,3 +137,30 @@ func BPFObjGet(fileName string) (*FD, error) { } return NewFD(uint32(ptr)), nil } + +type bpfObjGetInfoByFDAttr struct { + fd uint32 + infoLen uint32 + info Pointer +} + +// BPFObjGetInfoByFD wraps BPF_OBJ_GET_INFO_BY_FD. +// +// Available from 4.13. +func BPFObjGetInfoByFD(fd *FD, info unsafe.Pointer, size uintptr) error { + value, err := fd.Value() + if err != nil { + return err + } + + attr := bpfObjGetInfoByFDAttr{ + fd: value, + infoLen: uint32(size), + info: NewPointer(info), + } + _, err = BPF(BPF_OBJ_GET_INFO_BY_FD, unsafe.Pointer(&attr), unsafe.Sizeof(attr)) + if err != nil { + return fmt.Errorf("fd %v: %w", fd, err) + } + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go index 9363d0be81cf..d8135c1836be 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go @@ -3,6 +3,7 @@ package unix import ( + "bytes" "syscall" linux "golang.org/x/sys/unix" @@ -19,6 +20,7 @@ const ( EPERM = linux.EPERM ESRCH = linux.ESRCH ENODEV = linux.ENODEV + BPF_F_NUMA_NODE = linux.BPF_F_NUMA_NODE BPF_F_RDONLY_PROG = linux.BPF_F_RDONLY_PROG BPF_F_WRONLY_PROG = linux.BPF_F_WRONLY_PROG BPF_OBJ_NAME_LEN = linux.BPF_OBJ_NAME_LEN @@ -148,3 +150,15 @@ func Gettid() int { func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { return linux.Tgkill(tgid, tid, sig) } + +func KernelRelease() (string, error) { + var uname Utsname + err := Uname(&uname) + if err != nil { + return "", err + } + + end := bytes.IndexByte(uname.Release[:], 0) + release := string(uname.Release[:end]) + return release, nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_other.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_other.go index 2dea950f8881..416b8d2f5dea 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_other.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_other.go @@ -20,6 +20,7 @@ const ( EPERM = syscall.EPERM ESRCH = syscall.ESRCH ENODEV = syscall.ENODEV + BPF_F_NUMA_NODE = 0 BPF_F_RDONLY_PROG = 0 BPF_F_WRONLY_PROG = 0 BPF_OBJ_NAME_LEN = 0x10 @@ -215,3 +216,7 @@ func Gettid() int { func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { return errNonLinux } + +func KernelRelease() (string, error) { + return "", errNonLinux +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/linker.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/linker.go index 1bb8f61c25aa..fc4ad9dffa2a 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/linker.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/linker.go @@ -84,3 +84,50 @@ func needSection(insns, section asm.Instructions) (bool, error) { // None of the functions in the section are called. return false, nil } + +func fixupJumpsAndCalls(insns asm.Instructions) error { + symbolOffsets := make(map[string]asm.RawInstructionOffset) + iter := insns.Iterate() + for iter.Next() { + ins := iter.Ins + + if ins.Symbol == "" { + continue + } + + if _, ok := symbolOffsets[ins.Symbol]; ok { + return fmt.Errorf("duplicate symbol %s", ins.Symbol) + } + + symbolOffsets[ins.Symbol] = iter.Offset + } + + iter = insns.Iterate() + for iter.Next() { + i := iter.Index + offset := iter.Offset + ins := iter.Ins + + switch { + case ins.IsFunctionCall() && ins.Constant == -1: + // Rewrite bpf to bpf call + callOffset, ok := symbolOffsets[ins.Reference] + if !ok { + return fmt.Errorf("instruction %d: reference to missing symbol %s", i, ins.Reference) + } + + ins.Constant = int64(callOffset - offset - 1) + + case ins.OpCode.Class() == asm.JumpClass && ins.Offset == -1: + // Rewrite jump to label + jumpOffset, ok := symbolOffsets[ins.Reference] + if !ok { + return fmt.Errorf("instruction %d: reference to missing symbol %s", i, ins.Reference) + } + + ins.Offset = int16(jumpOffset - offset - 1) + } + } + + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/map.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/map.go index 461b995a54bb..5c9028d9de5f 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/map.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/map.go @@ -3,6 +3,8 @@ package ebpf import ( "errors" "fmt" + "io" + "path/filepath" "strings" "github.com/cilium/ebpf/internal" @@ -17,6 +19,14 @@ var ( ErrIterationAborted = errors.New("iteration aborted") ) +// MapOptions control loading a map into the kernel. +type MapOptions struct { + // The base path to pin maps in if requested via PinByName. + // Existing maps will be re-used if they are compatible, otherwise an + // error is returned. + PinPath string +} + // MapID represents the unique ID of an eBPF map type MapID uint32 @@ -31,6 +41,15 @@ type MapSpec struct { MaxEntries uint32 Flags uint32 + // Automatically pin and load a map from MapOptions.PinPath. + // Generates an error if an existing pinned map is incompatible with the MapSpec. + Pinning PinType + + // Specify numa node during map creation + // (effective only if unix.BPF_F_NUMA_NODE flag is set, + // which can be imported from golang.org/x/sys/unix) + NumaNode uint32 + // The initial contents of the map. May be nil. Contents []MapKV @@ -69,6 +88,26 @@ type MapKV struct { Value interface{} } +func (ms *MapSpec) checkCompatibility(m *Map) error { + switch { + case m.abi.Type != ms.Type: + return fmt.Errorf("expected type %v, got %v", ms.Type, m.abi.Type) + + case m.abi.KeySize != ms.KeySize: + return fmt.Errorf("expected key size %v, got %v", ms.KeySize, m.abi.KeySize) + + case m.abi.ValueSize != ms.ValueSize: + return fmt.Errorf("expected value size %v, got %v", ms.ValueSize, m.abi.ValueSize) + + case m.abi.MaxEntries != ms.MaxEntries: + return fmt.Errorf("expected max entries %v, got %v", ms.MaxEntries, m.abi.MaxEntries) + + case m.abi.Flags != ms.Flags: + return fmt.Errorf("expected flags %v, got %v", ms.Flags, m.abi.Flags) + } + return nil +} + // Map represents a Map file descriptor. // // It is not safe to close a map which is used by other goroutines. @@ -105,15 +144,22 @@ func NewMapFromFD(fd int) (*Map, error) { // NewMap creates a new Map. // +// It's equivalent to calling NewMapWithOptions with default options. +func NewMap(spec *MapSpec) (*Map, error) { + return NewMapWithOptions(spec, MapOptions{}) +} + +// NewMapWithOptions creates a new Map. +// // Creating a map for the first time will perform feature detection // by creating small, temporary maps. // // The caller is responsible for ensuring the process' rlimit is set // sufficiently high for locking memory during map creation. This can be done -// by calling unix.Setrlimit with unix.RLIMIT_MEMLOCK prior to calling NewMap. -func NewMap(spec *MapSpec) (*Map, error) { +// by calling unix.Setrlimit with unix.RLIMIT_MEMLOCK prior to calling NewMapWithOptions. +func NewMapWithOptions(spec *MapSpec, opts MapOptions) (*Map, error) { if spec.BTF == nil { - return newMapWithBTF(spec, nil) + return newMapWithBTF(spec, nil, opts) } handle, err := btf.NewHandle(btf.MapSpec(spec.BTF)) @@ -121,28 +167,75 @@ func NewMap(spec *MapSpec) (*Map, error) { return nil, fmt.Errorf("can't load BTF: %w", err) } - return newMapWithBTF(spec, handle) + return newMapWithBTF(spec, handle, opts) } -func newMapWithBTF(spec *MapSpec, handle *btf.Handle) (*Map, error) { - if spec.Type != ArrayOfMaps && spec.Type != HashOfMaps { - return createMap(spec, nil, handle) +func newMapWithBTF(spec *MapSpec, handle *btf.Handle, opts MapOptions) (*Map, error) { + switch spec.Pinning { + case PinByName: + if spec.Name == "" || opts.PinPath == "" { + return nil, fmt.Errorf("pin by name: missing Name or PinPath") + } + + m, err := LoadPinnedMap(filepath.Join(opts.PinPath, spec.Name)) + if errors.Is(err, unix.ENOENT) { + break + } + if err != nil { + return nil, fmt.Errorf("load pinned map: %s", err) + } + + if err := spec.checkCompatibility(m); err != nil { + m.Close() + return nil, fmt.Errorf("use pinned map %s: %s", spec.Name, err) + } + + return m, nil + + case PinNone: + // Nothing to do here + + default: + return nil, fmt.Errorf("unsupported pin type %d", int(spec.Pinning)) } - if spec.InnerMap == nil { - return nil, fmt.Errorf("%s requires InnerMap", spec.Type) + var innerFd *internal.FD + if spec.Type == ArrayOfMaps || spec.Type == HashOfMaps { + if spec.InnerMap == nil { + return nil, fmt.Errorf("%s requires InnerMap", spec.Type) + } + + template, err := createMap(spec.InnerMap, nil, handle, opts) + if err != nil { + return nil, err + } + defer template.Close() + + innerFd = template.fd } - template, err := createMap(spec.InnerMap, nil, handle) + m, err := createMap(spec, innerFd, handle, opts) if err != nil { return nil, err } - defer template.Close() - return createMap(spec, template.fd, handle) + if spec.Pinning == PinByName { + if err := m.Pin(filepath.Join(opts.PinPath, spec.Name)); err != nil { + m.Close() + return nil, fmt.Errorf("pin map: %s", err) + } + } + + return m, nil } -func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle) (*Map, error) { +func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle, opts MapOptions) (_ *Map, err error) { + closeOnError := func(closer io.Closer) { + if err != nil { + closer.Close() + } + } + abi := newMapABIFromSpec(spec) switch spec.Type { @@ -190,6 +283,7 @@ func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle) (*Map, err valueSize: abi.ValueSize, maxEntries: abi.MaxEntries, flags: abi.Flags, + numaNode: spec.NumaNode, } if inner != nil { @@ -214,6 +308,7 @@ func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle) (*Map, err if err != nil { return nil, fmt.Errorf("map create: %w", err) } + defer closeOnError(fd) m, err := newMap(fd, spec.Name, abi) if err != nil { @@ -221,13 +316,11 @@ func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle) (*Map, err } if err := m.populate(spec.Contents); err != nil { - m.Close() return nil, fmt.Errorf("map create: can't set initial contents: %w", err) } if spec.Freeze { if err := m.Freeze(); err != nil { - m.Close() return nil, fmt.Errorf("can't freeze map: %w", err) } } @@ -263,7 +356,34 @@ func (m *Map) String() string { return fmt.Sprintf("%s#%v", m.abi.Type, m.fd) } -// ABI gets the ABI of the Map +// Type returns the underlying type of the map. +func (m *Map) Type() MapType { + return m.abi.Type +} + +// KeySize returns the size of the map key in bytes. +func (m *Map) KeySize() uint32 { + return m.abi.KeySize +} + +// ValueSize returns the size of the map value in bytes. +func (m *Map) ValueSize() uint32 { + return m.abi.ValueSize +} + +// MaxEntries returns the maximum number of elements the map can hold. +func (m *Map) MaxEntries() uint32 { + return m.abi.MaxEntries +} + +// Flags returns the flags of the map. +func (m *Map) Flags() uint32 { + return m.abi.Flags +} + +// ABI gets the ABI of the Map. +// +// Deprecated: use Type, KeySize, ValueSize, MaxEntries and Flags instead. func (m *Map) ABI() MapABI { return m.abi } @@ -544,7 +664,7 @@ func (m *Map) Clone() (*Map, error) { // Pin persists the map past the lifetime of the process that created it. // -// This requires bpffs to be mounted above fileName. See http://cilium.readthedocs.io/en/doc-1.0/kubernetes/install/#mounting-the-bpf-fs-optional +// This requires bpffs to be mounted above fileName. See https://docs.cilium.io/en/k8s-doc/admin/#admin-mount-bpffs func (m *Map) Pin(fileName string) error { return internal.BPFObjPin(fileName, m.fd) } @@ -789,6 +909,8 @@ func NewMapFromID(id MapID) (*Map, error) { } // ID returns the systemwide unique ID of the map. +// +// Requires at least Linux 4.13. func (m *Map) ID() (MapID, error) { info, err := bpfGetMapInfoByFD(m.fd) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/prog.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/prog.go index 429203f07e85..67cfff67eb15 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/prog.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/prog.go @@ -208,8 +208,15 @@ func convertProgramSpec(spec *ProgramSpec, handle *btf.Handle) (*bpfProgLoadAttr return nil, fmt.Errorf("can't load %s program on %s", spec.ByteOrder, internal.NativeEndian) } + insns := make(asm.Instructions, len(spec.Instructions)) + copy(insns, spec.Instructions) + + if err := fixupJumpsAndCalls(insns); err != nil { + return nil, err + } + buf := bytes.NewBuffer(make([]byte, 0, len(spec.Instructions)*asm.InstructionSize)) - err := spec.Instructions.Marshal(buf, internal.NativeEndian) + err := insns.Marshal(buf, internal.NativeEndian) if err != nil { return nil, err } @@ -269,7 +276,14 @@ func (p *Program) String() string { return fmt.Sprintf("%s#%v", p.abi.Type, p.fd) } -// ABI gets the ABI of the Program +// Type returns the underlying type of the program. +func (p *Program) Type() ProgramType { + return p.abi.Type +} + +// ABI gets the ABI of the Program. +// +// Deprecated: use Type instead. func (p *Program) ABI() ProgramABI { return p.abi } @@ -308,7 +322,7 @@ func (p *Program) Clone() (*Program, error) { // Pin persists the Program past the lifetime of the process that created it // -// This requires bpffs to be mounted above fileName. See http://cilium.readthedocs.io/en/doc-1.0/kubernetes/install/#mounting-the-bpf-fs-optional +// This requires bpffs to be mounted above fileName. See https://docs.cilium.io/en/k8s-doc/admin/#admin-mount-bpffs func (p *Program) Pin(fileName string) error { if err := internal.BPFObjPin(fileName, p.fd); err != nil { return fmt.Errorf("can't pin program: %w", err) @@ -595,12 +609,16 @@ func (p *Program) ID() (ProgramID, error) { return ProgramID(info.id), nil } -func resolveBTFType(name string, progType ProgramType, attachType AttachType) (btf.Type, error) { +func findKernelType(name string, typ btf.Type) error { kernel, err := btf.LoadKernelSpec() if err != nil { - return nil, fmt.Errorf("can't resolve BTF type %s: %w", name, err) + return fmt.Errorf("can't load kernel spec: %w", err) } + return kernel.FindType(name, typ) +} + +func resolveBTFType(name string, progType ProgramType, attachType AttachType) (btf.Type, error) { type match struct { p ProgramType a AttachType @@ -608,10 +626,30 @@ func resolveBTFType(name string, progType ProgramType, attachType AttachType) (b target := match{progType, attachType} switch target { + case match{LSM, AttachLSMMac}: + var target btf.Func + err := findKernelType("bpf_lsm_"+name, &target) + if errors.Is(err, btf.ErrNotFound) { + return nil, &internal.UnsupportedFeatureError{ + Name: name + " LSM hook", + } + } + if err != nil { + return nil, fmt.Errorf("resolve BTF for LSM hook %s: %w", name, err) + } + + return &target, nil + case match{Tracing, AttachTraceIter}: var target btf.Func - if err := kernel.FindType("bpf_iter_"+name, &target); err != nil { - return nil, fmt.Errorf("can't resolve BTF for iterator %s: %w", name, err) + err := findKernelType("bpf_iter_"+name, &target) + if errors.Is(err, btf.ErrNotFound) { + return nil, &internal.UnsupportedFeatureError{ + Name: name + " iterator", + } + } + if err != nil { + return nil, fmt.Errorf("resolve BTF for iterator %s: %w", name, err) } return &target, nil diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/readme.md b/cluster-autoscaler/vendor/github.com/cilium/ebpf/readme.md index cc8e89c75a95..298db57c300b 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/readme.md +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/readme.md @@ -1,10 +1,13 @@ eBPF ------- -[![](https://godoc.org/github.com/cilium/ebpf?status.svg)](https://godoc.org/github.com/cilium/ebpf) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/cilium/ebpf)](https://pkg.go.dev/github.com/cilium/ebpf) eBPF is a pure Go library that provides utilities for loading, compiling, and debugging eBPF programs. It has minimal external dependencies and is intended to be used in long running processes. -[ebpf/asm](https://godoc.org/github.com/cilium/ebpf/asm) contains a basic assembler. +* [asm](https://pkg.go.dev/github.com/cilium/ebpf/asm) contains a basic assembler. +* [link](https://pkg.go.dev/github.com/cilium/ebpf/link) allows attaching eBPF to various hooks. +* [perf](https://pkg.go.dev/github.com/cilium/ebpf/perf) allows reading from a PERF_EVENT_ARRAY. +* [cmd/bpf2go](https://pkg.go.dev/github.com/cilium/ebpf/cmd/bpf2go) allows embedding eBPF in Go. The library is maintained by [Cloudflare](https://www.cloudflare.com) and [Cilium](https://www.cilium.io). Feel free to [join](https://cilium.herokuapp.com/) the [libbpf-go](https://cilium.slack.com/messages/libbpf-go) channel on Slack. @@ -20,6 +23,7 @@ right now**. Expect to update your code if you want to follow along. ## Useful resources -* [Cilium eBPF documentation](https://cilium.readthedocs.io/en/latest/bpf/#bpf-guide) (recommended) +* [eBPF.io](https://ebpf.io) (recommended) +* [Cilium eBPF documentation](https://docs.cilium.io/en/latest/bpf/#bpf-guide) (recommended) * [Linux documentation on BPF](http://elixir.free-electrons.com/linux/latest/source/Documentation/networking/filter.txt) * [eBPF features by Linux version](https://github.com/iovisor/bcc/blob/master/docs/kernel-versions.md) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/run-tests.sh b/cluster-autoscaler/vendor/github.com/cilium/ebpf/run-tests.sh index c43a90ddd0d9..bd349f95160e 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/run-tests.sh +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/run-tests.sh @@ -12,7 +12,8 @@ if [[ "${1:-}" = "--in-vm" ]]; then export CGO_ENABLED=0 export GOFLAGS=-mod=readonly export GOPATH=/run/go-path - export GOPROXY=file:///run/go-root/pkg/mod/cache/download + export GOPROXY=file:///run/go-path/pkg/mod/cache/download + export GOSUMDB=off export GOCACHE=/run/go-cache elfs="" @@ -21,7 +22,9 @@ if [[ "${1:-}" = "--in-vm" ]]; then fi echo Running tests... - /usr/local/bin/go test -coverprofile="$1/coverage.txt" -covermode=atomic -v -elfs "$elfs" ./... + # TestLibBPFCompat runs separately to pass the "-elfs" flag only for it: https://github.com/cilium/ebpf/pull/119 + go test -v -count 1 -run TestLibBPFCompat -elfs "$elfs" + go test -v -count 1 ./... touch "$1/success" exit 0 fi @@ -66,11 +69,12 @@ fi echo Testing on "${kernel_version}" $sudo virtme-run --kimg "${tmp_dir}/${kernel}" --memory 512M --pwd \ + --rw \ --rwdir=/run/input="${input}" \ --rwdir=/run/output="${output}" \ --rodir=/run/go-path="$(go env GOPATH)" \ --rwdir=/run/go-cache="$(go env GOCACHE)" \ - --script-sh "$(realpath "$0") --in-vm /run/output" \ + --script-sh "PATH=\"$PATH\" $(realpath "$0") --in-vm /run/output" \ --qemu-opts -smp 2 # need at least two CPUs for some tests if [[ ! -e "${output}/success" ]]; then @@ -78,11 +82,11 @@ if [[ ! -e "${output}/success" ]]; then exit 1 else echo "Test successful on ${kernel_version}" - if [[ -v CODECOV_TOKEN ]]; then - curl --fail -s https://codecov.io/bash > "${tmp_dir}/codecov.sh" - chmod +x "${tmp_dir}/codecov.sh" - "${tmp_dir}/codecov.sh" -f "${output}/coverage.txt" - fi +# if [[ -v CODECOV_TOKEN ]]; then +# curl --fail -s https://codecov.io/bash > "${tmp_dir}/codecov.sh" +# chmod +x "${tmp_dir}/codecov.sh" +# "${tmp_dir}/codecov.sh" -f "${output}/coverage.txt" +# fi fi $sudo rm -r "${input}" diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/syscalls.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/syscalls.go index 2b713d06a0c7..ff5c8e6c3c32 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/syscalls.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/syscalls.go @@ -129,12 +129,6 @@ type bpfProgTestRunAttr struct { duration uint32 } -type bpfObjGetInfoByFDAttr struct { - fd uint32 - infoLen uint32 - info internal.Pointer // May be either bpfMapInfo or bpfProgInfo -} - type bpfGetFDByIDAttr struct { id uint32 next uint32 @@ -353,28 +347,9 @@ func bpfMapFreeze(m *internal.FD) error { return err } -func bpfGetObjectInfoByFD(fd *internal.FD, info unsafe.Pointer, size uintptr) error { - value, err := fd.Value() - if err != nil { - return err - } - - // available from 4.13 - attr := bpfObjGetInfoByFDAttr{ - fd: value, - infoLen: uint32(size), - info: internal.NewPointer(info), - } - _, err = internal.BPF(internal.BPF_OBJ_GET_INFO_BY_FD, unsafe.Pointer(&attr), unsafe.Sizeof(attr)) - if err != nil { - return fmt.Errorf("fd %d: %w", fd, err) - } - return nil -} - func bpfGetProgInfoByFD(fd *internal.FD) (*bpfProgInfo, error) { var info bpfProgInfo - if err := bpfGetObjectInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)); err != nil { + if err := internal.BPFObjGetInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)); err != nil { return nil, fmt.Errorf("can't get program info: %w", err) } return &info, nil @@ -382,7 +357,7 @@ func bpfGetProgInfoByFD(fd *internal.FD) (*bpfProgInfo, error) { func bpfGetMapInfoByFD(fd *internal.FD) (*bpfMapInfo, error) { var info bpfMapInfo - err := bpfGetObjectInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)) + err := internal.BPFObjGetInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)) if err != nil { return nil, fmt.Errorf("can't get map info: %w", err) } diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/types.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/types.go index 1ffc62123be2..dd82dfd4d431 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/types.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/types.go @@ -1,6 +1,6 @@ package ebpf -//go:generate stringer -output types_string.go -type=MapType,ProgramType,AttachType +//go:generate stringer -output types_string.go -type=MapType,ProgramType,AttachType,PinType // MapType indicates the type map structure // that will be initialized in the kernel. @@ -96,60 +96,37 @@ type ProgramType uint32 // eBPF program types const ( - // Unrecognized program type UnspecifiedProgram ProgramType = iota - // SocketFilter socket or seccomp filter SocketFilter - // Kprobe program Kprobe - // SchedCLS traffic control shaper SchedCLS - // SchedACT routing control shaper SchedACT - // TracePoint program TracePoint - // XDP program XDP - // PerfEvent program PerfEvent - // CGroupSKB program CGroupSKB - // CGroupSock program CGroupSock - // LWTIn program LWTIn - // LWTOut program LWTOut - // LWTXmit program LWTXmit - // SockOps program SockOps - // SkSKB program SkSKB - // CGroupDevice program CGroupDevice - // SkMsg program SkMsg - // RawTracepoint program RawTracepoint - // CGroupSockAddr program CGroupSockAddr - // LWTSeg6Local program LWTSeg6Local - // LircMode2 program LircMode2 - // SkReuseport program SkReuseport - // FlowDissector program FlowDissector - // CGroupSysctl program CGroupSysctl - // RawTracepointWritable program RawTracepointWritable - // CGroupSockopt program CGroupSockopt - // Tracing program Tracing + StructOps + Extension + LSM + SkLookup ) // AttachType of the eBPF program, needed to differentiate allowed context accesses in @@ -190,7 +167,28 @@ const ( AttachModifyReturn AttachLSMMac AttachTraceIter + AttachCgroupInet4GetPeername + AttachCgroupInet6GetPeername + AttachCgroupInet4GetSockname + AttachCgroupInet6GetSockname + AttachXDPDevMap + AttachCgroupInetSockRelease + AttachXDPCPUMap + AttachSkLookup + AttachXDP ) // AttachFlags of the eBPF program used in BPF_PROG_ATTACH command type AttachFlags uint32 + +// PinType determines whether a map is pinned into a BPFFS. +type PinType int + +// Valid pin types. +// +// Mirrors enum libbpf_pin_type. +const ( + PinNone PinType = iota + // Pin an object by using its name as the filename. + PinByName +) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/types_string.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/types_string.go index c7139578ec6f..976bd76be010 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/types_string.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/types_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -output types_string.go -type=MapType,ProgramType,AttachType"; DO NOT EDIT. +// Code generated by "stringer -output types_string.go -type=MapType,ProgramType,AttachType,PinType"; DO NOT EDIT. package ebpf @@ -77,11 +77,15 @@ func _() { _ = x[RawTracepointWritable-24] _ = x[CGroupSockopt-25] _ = x[Tracing-26] + _ = x[StructOps-27] + _ = x[Extension-28] + _ = x[LSM-29] + _ = x[SkLookup-30] } -const _ProgramType_name = "UnspecifiedProgramSocketFilterKprobeSchedCLSSchedACTTracePointXDPPerfEventCGroupSKBCGroupSockLWTInLWTOutLWTXmitSockOpsSkSKBCGroupDeviceSkMsgRawTracepointCGroupSockAddrLWTSeg6LocalLircMode2SkReuseportFlowDissectorCGroupSysctlRawTracepointWritableCGroupSockoptTracing" +const _ProgramType_name = "UnspecifiedProgramSocketFilterKprobeSchedCLSSchedACTTracePointXDPPerfEventCGroupSKBCGroupSockLWTInLWTOutLWTXmitSockOpsSkSKBCGroupDeviceSkMsgRawTracepointCGroupSockAddrLWTSeg6LocalLircMode2SkReuseportFlowDissectorCGroupSysctlRawTracepointWritableCGroupSockoptTracingStructOpsExtensionLSMSkLookup" -var _ProgramType_index = [...]uint16{0, 18, 30, 36, 44, 52, 62, 65, 74, 83, 93, 98, 104, 111, 118, 123, 135, 140, 153, 167, 179, 188, 199, 212, 224, 245, 258, 265} +var _ProgramType_index = [...]uint16{0, 18, 30, 36, 44, 52, 62, 65, 74, 83, 93, 98, 104, 111, 118, 123, 135, 140, 153, 167, 179, 188, 199, 212, 224, 245, 258, 265, 274, 283, 286, 294} func (i ProgramType) String() string { if i >= ProgramType(len(_ProgramType_index)-1) { @@ -123,11 +127,20 @@ func _() { _ = x[AttachModifyReturn-26] _ = x[AttachLSMMac-27] _ = x[AttachTraceIter-28] + _ = x[AttachCgroupInet4GetPeername-29] + _ = x[AttachCgroupInet6GetPeername-30] + _ = x[AttachCgroupInet4GetSockname-31] + _ = x[AttachCgroupInet6GetSockname-32] + _ = x[AttachXDPDevMap-33] + _ = x[AttachCgroupInetSockRelease-34] + _ = x[AttachXDPCPUMap-35] + _ = x[AttachSkLookup-36] + _ = x[AttachXDP-37] } -const _AttachType_name = "AttachNoneAttachCGroupInetEgressAttachCGroupInetSockCreateAttachCGroupSockOpsAttachSkSKBStreamParserAttachSkSKBStreamVerdictAttachCGroupDeviceAttachSkMsgVerdictAttachCGroupInet4BindAttachCGroupInet6BindAttachCGroupInet4ConnectAttachCGroupInet6ConnectAttachCGroupInet4PostBindAttachCGroupInet6PostBindAttachCGroupUDP4SendmsgAttachCGroupUDP6SendmsgAttachLircMode2AttachFlowDissectorAttachCGroupSysctlAttachCGroupUDP4RecvmsgAttachCGroupUDP6RecvmsgAttachCGroupGetsockoptAttachCGroupSetsockoptAttachTraceRawTpAttachTraceFEntryAttachTraceFExitAttachModifyReturnAttachLSMMacAttachTraceIter" +const _AttachType_name = "AttachNoneAttachCGroupInetEgressAttachCGroupInetSockCreateAttachCGroupSockOpsAttachSkSKBStreamParserAttachSkSKBStreamVerdictAttachCGroupDeviceAttachSkMsgVerdictAttachCGroupInet4BindAttachCGroupInet6BindAttachCGroupInet4ConnectAttachCGroupInet6ConnectAttachCGroupInet4PostBindAttachCGroupInet6PostBindAttachCGroupUDP4SendmsgAttachCGroupUDP6SendmsgAttachLircMode2AttachFlowDissectorAttachCGroupSysctlAttachCGroupUDP4RecvmsgAttachCGroupUDP6RecvmsgAttachCGroupGetsockoptAttachCGroupSetsockoptAttachTraceRawTpAttachTraceFEntryAttachTraceFExitAttachModifyReturnAttachLSMMacAttachTraceIterAttachCgroupInet4GetPeernameAttachCgroupInet6GetPeernameAttachCgroupInet4GetSocknameAttachCgroupInet6GetSocknameAttachXDPDevMapAttachCgroupInetSockReleaseAttachXDPCPUMapAttachSkLookupAttachXDP" -var _AttachType_index = [...]uint16{0, 10, 32, 58, 77, 100, 124, 142, 160, 181, 202, 226, 250, 275, 300, 323, 346, 361, 380, 398, 421, 444, 466, 488, 504, 521, 537, 555, 567, 582} +var _AttachType_index = [...]uint16{0, 10, 32, 58, 77, 100, 124, 142, 160, 181, 202, 226, 250, 275, 300, 323, 346, 361, 380, 398, 421, 444, 466, 488, 504, 521, 537, 555, 567, 582, 610, 638, 666, 694, 709, 736, 751, 765, 774} func (i AttachType) String() string { if i >= AttachType(len(_AttachType_index)-1) { @@ -135,3 +148,21 @@ func (i AttachType) String() string { } return _AttachType_name[_AttachType_index[i]:_AttachType_index[i+1]] } +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[PinNone-0] + _ = x[PinByName-1] +} + +const _PinType_name = "PinNonePinByName" + +var _PinType_index = [...]uint8{0, 7, 16} + +func (i PinType) String() string { + if i < 0 || i >= PinType(len(_PinType_index)-1) { + return "PinType(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _PinType_name[_PinType_index[i]:_PinType_index[i+1]] +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/.golangci.yml b/cluster-autoscaler/vendor/github.com/containerd/console/.golangci.yml new file mode 100644 index 000000000000..fcba5e885f0a --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/console/.golangci.yml @@ -0,0 +1,20 @@ +linters: + enable: + - structcheck + - varcheck + - staticcheck + - unconvert + - gofmt + - goimports + - golint + - ineffassign + - vet + - unused + - misspell + disable: + - errcheck + +run: + timeout: 3m + skip-dirs: + - vendor diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/.travis.yml b/cluster-autoscaler/vendor/github.com/containerd/console/.travis.yml deleted file mode 100644 index 16827ec3e8f6..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/console/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: go -go: - - "1.12.x" - - "1.13.x" - -go_import_path: github.com/containerd/console - -env: - - GO111MODULE=on - -install: - - pushd ..; go get -u github.com/vbatts/git-validation; popd - - pushd ..; go get -u github.com/kunalkushwaha/ltag; popd - -before_script: - - pushd ..; git clone https://github.com/containerd/project; popd - -script: - - DCO_VERBOSITY=-q ../project/script/validate/dco - - ../project/script/validate/fileheader ../project/ - - travis_wait ../project/script/validate/vendor - - go test -race - - GOOS=openbsd go build - - GOOS=openbsd go test -c - - GOOS=solaris go build - - GOOS=solaris go test -c - - GOOS=windows go test diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/console.go b/cluster-autoscaler/vendor/github.com/containerd/console/console.go index 6a36d1477674..f989d28a41cd 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/console.go +++ b/cluster-autoscaler/vendor/github.com/containerd/console/console.go @@ -61,18 +61,24 @@ type WinSize struct { y uint16 } -// Current returns the current processes console -func Current() Console { - c, err := ConsoleFromFile(os.Stdin) - if err != nil { - // stdin should always be a console for the design - // of this function - panic(err) +// Current returns the current process' console +func Current() (c Console) { + var err error + // Usually all three streams (stdin, stdout, and stderr) + // are open to the same console, but some might be redirected, + // so try all three. + for _, s := range []*os.File{os.Stderr, os.Stdout, os.Stdin} { + if c, err = ConsoleFromFile(s); err == nil { + return c + } } - return c + // One of the std streams should always be a console + // for the design of this function. + panic(err) } // ConsoleFromFile returns a console using the provided file +// nolint:golint func ConsoleFromFile(f File) (Console, error) { if err := checkConsole(f); err != nil { return nil, err diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/console_unix.go b/cluster-autoscaler/vendor/github.com/containerd/console/console_unix.go index 315f1d0c90ec..a78687523a34 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/console_unix.go +++ b/cluster-autoscaler/vendor/github.com/containerd/console/console_unix.go @@ -1,4 +1,4 @@ -// +build darwin freebsd linux openbsd solaris +// +build darwin freebsd linux netbsd openbsd solaris /* Copyright The containerd Authors. diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/go.mod b/cluster-autoscaler/vendor/github.com/containerd/console/go.mod index 97b587d62d2a..60bf028ee523 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/go.mod +++ b/cluster-autoscaler/vendor/github.com/containerd/console/go.mod @@ -3,6 +3,6 @@ module github.com/containerd/console go 1.13 require ( - github.com/pkg/errors v0.8.1 - golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e + github.com/pkg/errors v0.9.1 + golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f ) diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/go.sum b/cluster-autoscaler/vendor/github.com/containerd/console/go.sum index 25205cc9b690..6b9363c40a93 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/go.sum +++ b/cluster-autoscaler/vendor/github.com/containerd/console/go.sum @@ -1,4 +1,4 @@ -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f h1:6Sc1XOXTulBN6imkqo6XoAXDEzoQ4/ro6xy7Vn8+rOM= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/tc_darwin.go b/cluster-autoscaler/vendor/github.com/containerd/console/tc_darwin.go index b0128abb0c62..787154580f6c 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/tc_darwin.go +++ b/cluster-autoscaler/vendor/github.com/containerd/console/tc_darwin.go @@ -19,7 +19,6 @@ package console import ( "fmt" "os" - "unsafe" "golang.org/x/sys/unix" ) @@ -29,18 +28,10 @@ const ( cmdTcSet = unix.TIOCSETA ) -func ioctl(fd, flag, data uintptr) error { - if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, flag, data); err != 0 { - return err - } - return nil -} - // unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. // unlockpt should be called before opening the slave side of a pty. func unlockpt(f *os.File) error { - var u int32 - return ioctl(f.Fd(), unix.TIOCPTYUNLK, uintptr(unsafe.Pointer(&u))) + return unix.IoctlSetPointerInt(int(f.Fd()), unix.TIOCPTYUNLK, 0) } // ptsname retrieves the name of the first available pts for the given master. diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/tc_linux.go b/cluster-autoscaler/vendor/github.com/containerd/console/tc_linux.go index 1bdd68e6d55b..75f8694f7fc8 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/tc_linux.go +++ b/cluster-autoscaler/vendor/github.com/containerd/console/tc_linux.go @@ -19,7 +19,6 @@ package console import ( "fmt" "os" - "unsafe" "golang.org/x/sys/unix" ) @@ -32,17 +31,13 @@ const ( // unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. // unlockpt should be called before opening the slave side of a pty. func unlockpt(f *os.File) error { - var u int32 - if _, _, err := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))); err != 0 { - return err - } - return nil + return unix.IoctlSetPointerInt(int(f.Fd()), unix.TIOCSPTLCK, 0) } // ptsname retrieves the name of the first available pts for the given master. func ptsname(f *os.File) (string, error) { - var u uint32 - if _, _, err := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.TIOCGPTN, uintptr(unsafe.Pointer(&u))); err != 0 { + u, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN) + if err != nil { return "", err } return fmt.Sprintf("/dev/pts/%d", u), nil diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/tc_netbsd.go b/cluster-autoscaler/vendor/github.com/containerd/console/tc_netbsd.go new file mode 100644 index 000000000000..71227aefdffd --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/console/tc_netbsd.go @@ -0,0 +1,45 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package console + +import ( + "bytes" + "os" + + "golang.org/x/sys/unix" +) + +const ( + cmdTcGet = unix.TIOCGETA + cmdTcSet = unix.TIOCSETA +) + +// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. +// unlockpt should be called before opening the slave side of a pty. +// This does not exist on NetBSD, it does not allocate controlling terminals on open +func unlockpt(f *os.File) error { + return nil +} + +// ptsname retrieves the name of the first available pts for the given master. +func ptsname(f *os.File) (string, error) { + ptm, err := unix.IoctlGetPtmget(int(f.Fd()), unix.TIOCPTSNAME) + if err != nil { + return "", err + } + return string(ptm.Sn[:bytes.IndexByte(ptm.Sn[:], 0)]), nil +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/tc_unix.go b/cluster-autoscaler/vendor/github.com/containerd/console/tc_unix.go index 7ae773c53eaa..5cd4c550ce88 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/tc_unix.go +++ b/cluster-autoscaler/vendor/github.com/containerd/console/tc_unix.go @@ -1,4 +1,4 @@ -// +build darwin freebsd linux openbsd solaris +// +build darwin freebsd linux netbsd openbsd solaris /* Copyright The containerd Authors. diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go index d951b2683258..af56c7de2bad 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go @@ -2106,7 +2106,7 @@ func (m *Container) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > postIndex { @@ -2469,7 +2469,7 @@ func (m *Container) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > postIndex { @@ -2486,10 +2486,7 @@ func (m *Container) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -2608,10 +2605,7 @@ func (m *Container_Runtime) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -2694,10 +2688,7 @@ func (m *GetContainerRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -2781,10 +2772,7 @@ func (m *GetContainerResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -2867,10 +2855,7 @@ func (m *ListContainersRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -2955,10 +2940,7 @@ func (m *ListContainersResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -3042,10 +3024,7 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -3129,10 +3108,7 @@ func (m *CreateContainerResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -3252,10 +3228,7 @@ func (m *UpdateContainerRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -3339,10 +3312,7 @@ func (m *UpdateContainerResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -3425,10 +3395,7 @@ func (m *DeleteContainerRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { @@ -3515,10 +3482,7 @@ func (m *ListContainerMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthContainers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthContainers } if (iNdEx + skippy) > l { diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go index 5ac5af11b92e..484b469c6e48 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go @@ -4347,10 +4347,7 @@ func (m *CreateTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -4452,10 +4449,7 @@ func (m *CreateTaskResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -4570,10 +4564,7 @@ func (m *StartRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -4643,10 +4634,7 @@ func (m *StartResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -4729,10 +4717,7 @@ func (m *DeleteTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -4886,10 +4871,7 @@ func (m *DeleteResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -5004,10 +4986,7 @@ func (m *DeleteProcessRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -5122,10 +5101,7 @@ func (m *GetRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -5212,10 +5188,7 @@ func (m *GetResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -5298,10 +5271,7 @@ func (m *ListTasksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -5386,10 +5356,7 @@ func (m *ListTasksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -5543,10 +5510,7 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -5813,10 +5777,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -5867,10 +5828,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6023,10 +5981,7 @@ func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6161,10 +6116,7 @@ func (m *CloseIORequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6247,10 +6199,7 @@ func (m *PauseTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6333,10 +6282,7 @@ func (m *ResumeTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6419,10 +6365,7 @@ func (m *ListPidsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6507,10 +6450,7 @@ func (m *ListPidsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6661,10 +6601,7 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6749,10 +6686,7 @@ func (m *CheckpointTaskResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6871,10 +6805,7 @@ func (m *UpdateTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -6957,10 +6888,7 @@ func (m *MetricsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -7045,10 +6973,7 @@ func (m *MetricsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -7163,10 +7088,7 @@ func (m *WaitRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { @@ -7269,10 +7191,7 @@ func (m *WaitResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTasks - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTasks } if (iNdEx + skippy) > l { diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go index 81b8c339539e..b742c6ae62f5 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go @@ -374,10 +374,7 @@ func (m *VersionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVersion - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVersion } if (iNdEx + skippy) > l { diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/descriptor.pb.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/descriptor.pb.go index 437d41f23ad8..fe71dbf43300 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/descriptor.pb.go +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/descriptor.pb.go @@ -479,7 +479,7 @@ func (m *Descriptor) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDescriptor } if (iNdEx + skippy) > postIndex { @@ -496,10 +496,7 @@ func (m *Descriptor) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDescriptor - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDescriptor } if (iNdEx + skippy) > l { diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/metrics.pb.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/metrics.pb.go index 89a8d9cd6ffd..75773e442ab7 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/metrics.pb.go +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/metrics.pb.go @@ -348,10 +348,7 @@ func (m *Metric) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/mount.pb.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/mount.pb.go index 6872e4120e1a..d0a0bee761f0 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/mount.pb.go +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/mount.pb.go @@ -392,10 +392,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMount - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMount } if (iNdEx + skippy) > l { diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/platform.pb.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/platform.pb.go index c03d8b077bf9..a0f78c8a769d 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/platform.pb.go +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/platform.pb.go @@ -333,10 +333,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthPlatform - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthPlatform } if (iNdEx + skippy) > l { diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/task/task.pb.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/task/task.pb.go index ae824ff45c4b..f511bbd058c8 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/task/task.pb.go +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/api/types/task/task.pb.go @@ -772,10 +772,7 @@ func (m *Process) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTask - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTask } if (iNdEx + skippy) > l { @@ -881,10 +878,7 @@ func (m *ProcessInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTask - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTask } if (iNdEx + skippy) > l { diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/log/context.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/log/context.go new file mode 100644 index 000000000000..21599c4fd646 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/log/context.go @@ -0,0 +1,60 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package log + +import ( + "context" + + "github.com/sirupsen/logrus" +) + +var ( + // G is an alias for GetLogger. + // + // We may want to define this locally to a package to get package tagged log + // messages. + G = GetLogger + + // L is an alias for the standard logger. + L = logrus.NewEntry(logrus.StandardLogger()) +) + +type ( + loggerKey struct{} +) + +// RFC3339NanoFixed is time.RFC3339Nano with nanoseconds padded using zeros to +// ensure the formatted time is always the same number of characters. +const RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00" + +// WithLogger returns a new context with the provided logger. Use in +// combination with logger.WithField(s) for great effect. +func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context { + return context.WithValue(ctx, loggerKey{}, logger) +} + +// GetLogger retrieves the current logger from the context. If no logger is +// available, the default logger is returned. +func GetLogger(ctx context.Context) *logrus.Entry { + logger := ctx.Value(loggerKey{}) + + if logger == nil { + return L + } + + return logger.(*logrus.Entry) +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/compare.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/compare.go new file mode 100644 index 000000000000..3ad22a10d0ce --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/compare.go @@ -0,0 +1,229 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package platforms + +import specs "github.com/opencontainers/image-spec/specs-go/v1" + +// MatchComparer is able to match and compare platforms to +// filter and sort platforms. +type MatchComparer interface { + Matcher + + Less(specs.Platform, specs.Platform) bool +} + +// Only returns a match comparer for a single platform +// using default resolution logic for the platform. +// +// For ARMv8, will also match ARMv7, ARMv6 and ARMv5 (for 32bit runtimes) +// For ARMv7, will also match ARMv6 and ARMv5 +// For ARMv6, will also match ARMv5 +func Only(platform specs.Platform) MatchComparer { + platform = Normalize(platform) + if platform.Architecture == "arm" { + if platform.Variant == "v8" { + return orderedPlatformComparer{ + matchers: []Matcher{ + &matcher{ + Platform: platform, + }, + &matcher{ + Platform: specs.Platform{ + Architecture: platform.Architecture, + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: "v7", + }, + }, + &matcher{ + Platform: specs.Platform{ + Architecture: platform.Architecture, + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: "v6", + }, + }, + &matcher{ + Platform: specs.Platform{ + Architecture: platform.Architecture, + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: "v5", + }, + }, + }, + } + } + if platform.Variant == "v7" { + return orderedPlatformComparer{ + matchers: []Matcher{ + &matcher{ + Platform: platform, + }, + &matcher{ + Platform: specs.Platform{ + Architecture: platform.Architecture, + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: "v6", + }, + }, + &matcher{ + Platform: specs.Platform{ + Architecture: platform.Architecture, + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: "v5", + }, + }, + }, + } + } + if platform.Variant == "v6" { + return orderedPlatformComparer{ + matchers: []Matcher{ + &matcher{ + Platform: platform, + }, + &matcher{ + Platform: specs.Platform{ + Architecture: platform.Architecture, + OS: platform.OS, + OSVersion: platform.OSVersion, + OSFeatures: platform.OSFeatures, + Variant: "v5", + }, + }, + }, + } + } + } + + return singlePlatformComparer{ + Matcher: &matcher{ + Platform: platform, + }, + } +} + +// Ordered returns a platform MatchComparer which matches any of the platforms +// but orders them in order they are provided. +func Ordered(platforms ...specs.Platform) MatchComparer { + matchers := make([]Matcher, len(platforms)) + for i := range platforms { + matchers[i] = NewMatcher(platforms[i]) + } + return orderedPlatformComparer{ + matchers: matchers, + } +} + +// Any returns a platform MatchComparer which matches any of the platforms +// with no preference for ordering. +func Any(platforms ...specs.Platform) MatchComparer { + matchers := make([]Matcher, len(platforms)) + for i := range platforms { + matchers[i] = NewMatcher(platforms[i]) + } + return anyPlatformComparer{ + matchers: matchers, + } +} + +// All is a platform MatchComparer which matches all platforms +// with preference for ordering. +var All MatchComparer = allPlatformComparer{} + +type singlePlatformComparer struct { + Matcher +} + +func (c singlePlatformComparer) Less(p1, p2 specs.Platform) bool { + return c.Match(p1) && !c.Match(p2) +} + +type orderedPlatformComparer struct { + matchers []Matcher +} + +func (c orderedPlatformComparer) Match(platform specs.Platform) bool { + for _, m := range c.matchers { + if m.Match(platform) { + return true + } + } + return false +} + +func (c orderedPlatformComparer) Less(p1 specs.Platform, p2 specs.Platform) bool { + for _, m := range c.matchers { + p1m := m.Match(p1) + p2m := m.Match(p2) + if p1m && !p2m { + return true + } + if p1m || p2m { + return false + } + } + return false +} + +type anyPlatformComparer struct { + matchers []Matcher +} + +func (c anyPlatformComparer) Match(platform specs.Platform) bool { + for _, m := range c.matchers { + if m.Match(platform) { + return true + } + } + return false +} + +func (c anyPlatformComparer) Less(p1, p2 specs.Platform) bool { + var p1m, p2m bool + for _, m := range c.matchers { + if !p1m && m.Match(p1) { + p1m = true + } + if !p2m && m.Match(p2) { + p2m = true + } + if p1m && p2m { + return false + } + } + // If one matches, and the other does, sort match first + return p1m && !p2m +} + +type allPlatformComparer struct{} + +func (allPlatformComparer) Match(specs.Platform) bool { + return true +} + +func (allPlatformComparer) Less(specs.Platform, specs.Platform) bool { + return false +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/cpuinfo.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/cpuinfo.go new file mode 100644 index 000000000000..db65a726b902 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/cpuinfo.go @@ -0,0 +1,122 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package platforms + +import ( + "bufio" + "os" + "runtime" + "strings" + + "github.com/containerd/containerd/errdefs" + "github.com/containerd/containerd/log" + "github.com/pkg/errors" +) + +// Present the ARM instruction set architecture, eg: v7, v8 +var cpuVariant string + +func init() { + if isArmArch(runtime.GOARCH) { + cpuVariant = getCPUVariant() + } else { + cpuVariant = "" + } +} + +// For Linux, the kernel has already detected the ABI, ISA and Features. +// So we don't need to access the ARM registers to detect platform information +// by ourselves. We can just parse these information from /proc/cpuinfo +func getCPUInfo(pattern string) (info string, err error) { + if !isLinuxOS(runtime.GOOS) { + return "", errors.Wrapf(errdefs.ErrNotImplemented, "getCPUInfo for OS %s", runtime.GOOS) + } + + cpuinfo, err := os.Open("/proc/cpuinfo") + if err != nil { + return "", err + } + defer cpuinfo.Close() + + // Start to Parse the Cpuinfo line by line. For SMP SoC, we parse + // the first core is enough. + scanner := bufio.NewScanner(cpuinfo) + for scanner.Scan() { + newline := scanner.Text() + list := strings.Split(newline, ":") + + if len(list) > 1 && strings.EqualFold(strings.TrimSpace(list[0]), pattern) { + return strings.TrimSpace(list[1]), nil + } + } + + // Check whether the scanner encountered errors + err = scanner.Err() + if err != nil { + return "", err + } + + return "", errors.Wrapf(errdefs.ErrNotFound, "getCPUInfo for pattern: %s", pattern) +} + +func getCPUVariant() string { + if runtime.GOOS == "windows" || runtime.GOOS == "darwin" { + // Windows/Darwin only supports v7 for ARM32 and v8 for ARM64 and so we can use + // runtime.GOARCH to determine the variants + var variant string + switch runtime.GOARCH { + case "arm64": + variant = "v8" + case "arm": + variant = "v7" + default: + variant = "unknown" + } + + return variant + } + + variant, err := getCPUInfo("Cpu architecture") + if err != nil { + log.L.WithError(err).Error("failure getting variant") + return "" + } + + switch strings.ToLower(variant) { + case "8", "aarch64": + // special case: if running a 32-bit userspace on aarch64, the variant should be "v7" + if runtime.GOARCH == "arm" { + variant = "v7" + } else { + variant = "v8" + } + case "7", "7m", "?(12)", "?(13)", "?(14)", "?(15)", "?(16)", "?(17)": + variant = "v7" + case "6", "6tej": + variant = "v6" + case "5", "5t", "5te", "5tej": + variant = "v5" + case "4", "4t": + variant = "v4" + case "3": + variant = "v3" + default: + variant = "unknown" + } + + return variant +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/database.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/database.go new file mode 100644 index 000000000000..6ede94061eb8 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/database.go @@ -0,0 +1,114 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package platforms + +import ( + "runtime" + "strings" +) + +// isLinuxOS returns true if the operating system is Linux. +// +// The OS value should be normalized before calling this function. +func isLinuxOS(os string) bool { + return os == "linux" +} + +// These function are generated from https://golang.org/src/go/build/syslist.go. +// +// We use switch statements because they are slightly faster than map lookups +// and use a little less memory. + +// isKnownOS returns true if we know about the operating system. +// +// The OS value should be normalized before calling this function. +func isKnownOS(os string) bool { + switch os { + case "aix", "android", "darwin", "dragonfly", "freebsd", "hurd", "illumos", "js", "linux", "nacl", "netbsd", "openbsd", "plan9", "solaris", "windows", "zos": + return true + } + return false +} + +// isArmArch returns true if the architecture is ARM. +// +// The arch value should be normalized before being passed to this function. +func isArmArch(arch string) bool { + switch arch { + case "arm", "arm64": + return true + } + return false +} + +// isKnownArch returns true if we know about the architecture. +// +// The arch value should be normalized before being passed to this function. +func isKnownArch(arch string) bool { + switch arch { + case "386", "amd64", "amd64p32", "arm", "armbe", "arm64", "arm64be", "ppc64", "ppc64le", "mips", "mipsle", "mips64", "mips64le", "mips64p32", "mips64p32le", "ppc", "riscv", "riscv64", "s390", "s390x", "sparc", "sparc64", "wasm": + return true + } + return false +} + +func normalizeOS(os string) string { + if os == "" { + return runtime.GOOS + } + os = strings.ToLower(os) + + switch os { + case "macos": + os = "darwin" + } + return os +} + +// normalizeArch normalizes the architecture. +func normalizeArch(arch, variant string) (string, string) { + arch, variant = strings.ToLower(arch), strings.ToLower(variant) + switch arch { + case "i386": + arch = "386" + variant = "" + case "x86_64", "x86-64": + arch = "amd64" + variant = "" + case "aarch64", "arm64": + arch = "arm64" + switch variant { + case "8", "v8": + variant = "" + } + case "armhf": + arch = "arm" + variant = "v7" + case "armel": + arch = "arm" + variant = "v6" + case "arm": + switch variant { + case "", "7": + variant = "v7" + case "5", "6", "8": + variant = "v" + variant + } + } + + return arch, variant +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults.go new file mode 100644 index 000000000000..a14d80e58cbf --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults.go @@ -0,0 +1,38 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package platforms + +import ( + "runtime" + + specs "github.com/opencontainers/image-spec/specs-go/v1" +) + +// DefaultString returns the default string specifier for the platform. +func DefaultString() string { + return Format(DefaultSpec()) +} + +// DefaultSpec returns the current platform's default platform specification. +func DefaultSpec() specs.Platform { + return specs.Platform{ + OS: runtime.GOOS, + Architecture: runtime.GOARCH, + // The Variant field will be empty if arch != ARM. + Variant: cpuVariant, + } +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults_unix.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults_unix.go new file mode 100644 index 000000000000..e8a7d5ffa0d6 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults_unix.go @@ -0,0 +1,24 @@ +// +build !windows + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package platforms + +// Default returns the default matcher for the platform. +func Default() MatchComparer { + return Only(DefaultSpec()) +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults_windows.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults_windows.go new file mode 100644 index 000000000000..0defbd36c042 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/defaults_windows.go @@ -0,0 +1,31 @@ +// +build windows + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package platforms + +import ( + specs "github.com/opencontainers/image-spec/specs-go/v1" +) + +// Default returns the default matcher for the platform. +func Default() MatchComparer { + return Ordered(DefaultSpec(), specs.Platform{ + OS: "linux", + Architecture: "amd64", + }) +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/platforms.go b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/platforms.go new file mode 100644 index 000000000000..77d3f184ec1b --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/containerd/platforms/platforms.go @@ -0,0 +1,278 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package platforms provides a toolkit for normalizing, matching and +// specifying container platforms. +// +// Centered around OCI platform specifications, we define a string-based +// specifier syntax that can be used for user input. With a specifier, users +// only need to specify the parts of the platform that are relevant to their +// context, providing an operating system or architecture or both. +// +// How do I use this package? +// +// The vast majority of use cases should simply use the match function with +// user input. The first step is to parse a specifier into a matcher: +// +// m, err := Parse("linux") +// if err != nil { ... } +// +// Once you have a matcher, use it to match against the platform declared by a +// component, typically from an image or runtime. Since extracting an images +// platform is a little more involved, we'll use an example against the +// platform default: +// +// if ok := m.Match(Default()); !ok { /* doesn't match */ } +// +// This can be composed in loops for resolving runtimes or used as a filter for +// fetch and select images. +// +// More details of the specifier syntax and platform spec follow. +// +// Declaring Platform Support +// +// Components that have strict platform requirements should use the OCI +// platform specification to declare their support. Typically, this will be +// images and runtimes that should make these declaring which platform they +// support specifically. This looks roughly as follows: +// +// type Platform struct { +// Architecture string +// OS string +// Variant string +// } +// +// Most images and runtimes should at least set Architecture and OS, according +// to their GOARCH and GOOS values, respectively (follow the OCI image +// specification when in doubt). ARM should set variant under certain +// discussions, which are outlined below. +// +// Platform Specifiers +// +// While the OCI platform specifications provide a tool for components to +// specify structured information, user input typically doesn't need the full +// context and much can be inferred. To solve this problem, we introduced +// "specifiers". A specifier has the format +// `||/[/]`. The user can provide either the +// operating system or the architecture or both. +// +// An example of a common specifier is `linux/amd64`. If the host has a default +// of runtime that matches this, the user can simply provide the component that +// matters. For example, if a image provides amd64 and arm64 support, the +// operating system, `linux` can be inferred, so they only have to provide +// `arm64` or `amd64`. Similar behavior is implemented for operating systems, +// where the architecture may be known but a runtime may support images from +// different operating systems. +// +// Normalization +// +// Because not all users are familiar with the way the Go runtime represents +// platforms, several normalizations have been provided to make this package +// easier to user. +// +// The following are performed for architectures: +// +// Value Normalized +// aarch64 arm64 +// armhf arm +// armel arm/v6 +// i386 386 +// x86_64 amd64 +// x86-64 amd64 +// +// We also normalize the operating system `macos` to `darwin`. +// +// ARM Support +// +// To qualify ARM architecture, the Variant field is used to qualify the arm +// version. The most common arm version, v7, is represented without the variant +// unless it is explicitly provided. This is treated as equivalent to armhf. A +// previous architecture, armel, will be normalized to arm/v6. +// +// While these normalizations are provided, their support on arm platforms has +// not yet been fully implemented and tested. +package platforms + +import ( + "regexp" + "runtime" + "strconv" + "strings" + + "github.com/containerd/containerd/errdefs" + specs "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/pkg/errors" +) + +var ( + specifierRe = regexp.MustCompile(`^[A-Za-z0-9_-]+$`) +) + +// Matcher matches platforms specifications, provided by an image or runtime. +type Matcher interface { + Match(platform specs.Platform) bool +} + +// NewMatcher returns a simple matcher based on the provided platform +// specification. The returned matcher only looks for equality based on os, +// architecture and variant. +// +// One may implement their own matcher if this doesn't provide the required +// functionality. +// +// Applications should opt to use `Match` over directly parsing specifiers. +func NewMatcher(platform specs.Platform) Matcher { + return &matcher{ + Platform: Normalize(platform), + } +} + +type matcher struct { + specs.Platform +} + +func (m *matcher) Match(platform specs.Platform) bool { + normalized := Normalize(platform) + return m.OS == normalized.OS && + m.Architecture == normalized.Architecture && + m.Variant == normalized.Variant +} + +func (m *matcher) String() string { + return Format(m.Platform) +} + +// Parse parses the platform specifier syntax into a platform declaration. +// +// Platform specifiers are in the format `||/[/]`. +// The minimum required information for a platform specifier is the operating +// system or architecture. If there is only a single string (no slashes), the +// value will be matched against the known set of operating systems, then fall +// back to the known set of architectures. The missing component will be +// inferred based on the local environment. +func Parse(specifier string) (specs.Platform, error) { + if strings.Contains(specifier, "*") { + // TODO(stevvooe): need to work out exact wildcard handling + return specs.Platform{}, errors.Wrapf(errdefs.ErrInvalidArgument, "%q: wildcards not yet supported", specifier) + } + + parts := strings.Split(specifier, "/") + + for _, part := range parts { + if !specifierRe.MatchString(part) { + return specs.Platform{}, errors.Wrapf(errdefs.ErrInvalidArgument, "%q is an invalid component of %q: platform specifier component must match %q", part, specifier, specifierRe.String()) + } + } + + var p specs.Platform + switch len(parts) { + case 1: + // in this case, we will test that the value might be an OS, then look + // it up. If it is not known, we'll treat it as an architecture. Since + // we have very little information about the platform here, we are + // going to be a little more strict if we don't know about the argument + // value. + p.OS = normalizeOS(parts[0]) + if isKnownOS(p.OS) { + // picks a default architecture + p.Architecture = runtime.GOARCH + if p.Architecture == "arm" && cpuVariant != "v7" { + p.Variant = cpuVariant + } + + return p, nil + } + + p.Architecture, p.Variant = normalizeArch(parts[0], "") + if p.Architecture == "arm" && p.Variant == "v7" { + p.Variant = "" + } + if isKnownArch(p.Architecture) { + p.OS = runtime.GOOS + return p, nil + } + + return specs.Platform{}, errors.Wrapf(errdefs.ErrInvalidArgument, "%q: unknown operating system or architecture", specifier) + case 2: + // In this case, we treat as a regular os/arch pair. We don't care + // about whether or not we know of the platform. + p.OS = normalizeOS(parts[0]) + p.Architecture, p.Variant = normalizeArch(parts[1], "") + if p.Architecture == "arm" && p.Variant == "v7" { + p.Variant = "" + } + + return p, nil + case 3: + // we have a fully specified variant, this is rare + p.OS = normalizeOS(parts[0]) + p.Architecture, p.Variant = normalizeArch(parts[1], parts[2]) + if p.Architecture == "arm64" && p.Variant == "" { + p.Variant = "v8" + } + + return p, nil + } + + return specs.Platform{}, errors.Wrapf(errdefs.ErrInvalidArgument, "%q: cannot parse platform specifier", specifier) +} + +// MustParse is like Parses but panics if the specifier cannot be parsed. +// Simplifies initialization of global variables. +func MustParse(specifier string) specs.Platform { + p, err := Parse(specifier) + if err != nil { + panic("platform: Parse(" + strconv.Quote(specifier) + "): " + err.Error()) + } + return p +} + +// Format returns a string specifier from the provided platform specification. +func Format(platform specs.Platform) string { + if platform.OS == "" { + return "unknown" + } + + return joinNotEmpty(platform.OS, platform.Architecture, platform.Variant) +} + +func joinNotEmpty(s ...string) string { + var ss []string + for _, s := range s { + if s == "" { + continue + } + + ss = append(ss, s) + } + + return strings.Join(ss, "/") +} + +// Normalize validates and translate the platform to the canonical value. +// +// For example, if "Aarch64" is encountered, we change it to "arm64" or if +// "x86_64" is encountered, it becomes "amd64". +func Normalize(platform specs.Platform) specs.Platform { + platform.OS = normalizeOS(platform.OS) + platform.Architecture, platform.Variant = normalizeArch(platform.Architecture, platform.Variant) + + // these fields are deprecated, remove them + platform.OSFeatures = nil + platform.OSVersion = "" + + return platform +} diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/AUTHORS b/cluster-autoscaler/vendor/github.com/docker/docker/AUTHORS index c5f725bc19d3..dffacff11202 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/AUTHORS +++ b/cluster-autoscaler/vendor/github.com/docker/docker/AUTHORS @@ -4,6 +4,7 @@ Aanand Prasad Aaron Davidson Aaron Feng +Aaron Hnatiw Aaron Huslage Aaron L. Xu Aaron Lehmann @@ -17,6 +18,7 @@ Abhishek Chanda Abhishek Sharma Abin Shahab Adam Avilla +Adam Dobrawy Adam Eijdenberg Adam Kunk Adam Miller @@ -43,6 +45,7 @@ AJ Bowen Ajey Charantimath ajneu Akash Gupta +Akhil Mohan Akihiro Matsushima Akihiro Suda Akim Demaille @@ -50,10 +53,12 @@ Akira Koyasu Akshay Karle Al Tobey alambike +Alan Hoyle Alan Scherger Alan Thompson Albert Callarisa Albert Zhang +Albin Kerouanton Alejandro González Hevia Aleksa Sarai Aleksandrs Fadins @@ -107,11 +112,13 @@ Amy Lindburg Anand Patil AnandkumarPatel Anatoly Borodin +Anca Iordache Anchal Agrawal Anda Xu Anders Janmyr Andre Dublin <81dublin@gmail.com> Andre Granovsky +Andrea Denisse Gómez Andrea Luzzardi Andrea Turli Andreas Elvers @@ -176,8 +183,10 @@ Anusha Ragunathan apocas Arash Deshmeh ArikaChen +Arko Dasgupta Arnaud Lefebvre Arnaud Porterie +Arnaud Rebillout Arthur Barr Arthur Gautier Artur Meyster @@ -210,10 +219,12 @@ Benjamin Atkin Benjamin Baker Benjamin Boudreau Benjamin Yolken +Benny Ng Benoit Chesneau Bernerd Schaefer Bernhard M. Wiedemann Bert Goethals +Bertrand Roussel Bevisy Zhang Bharath Thiruveedula Bhiraj Butala @@ -226,6 +237,7 @@ Bingshen Wang Blake Geno Boaz Shuster bobby abbott +Boqin Qin Boris Pruessmann Boshi Lian Bouke Haarsma @@ -279,6 +291,7 @@ Carl Loa Odin Carl X. Su Carlo Mion Carlos Alexandro Becker +Carlos de Paula Carlos Sanchez Carol Fager-Higgins Cary @@ -328,6 +341,7 @@ Chris Gibson Chris Khoo Chris McKinnel Chris McKinnel +Chris Price Chris Seto Chris Snow Chris St. Pierre @@ -354,7 +368,7 @@ Christopher Currie Christopher Jones Christopher Latham Christopher Rigor -Christy Perez +Christy Norman Chun Chen Ciro S. Costa Clayton Coleman @@ -374,8 +388,10 @@ Corey Farrell Cory Forsyth cressie176 CrimsonGlory +Cristian Ariza Cristian Staretu cristiano balducci +Cristina Yenyxe Gonzalez Garcia Cruceru Calin-Cristian CUI Wei Cyprian Gracz @@ -402,12 +418,14 @@ Dan Williams Dani Hodovic Dani Louca Daniel Antlinger +Daniel Black Daniel Dao Daniel Exner Daniel Farrell Daniel Garcia Daniel Gasienica Daniel Grunwell +Daniel Helfand Daniel Hiltgen Daniel J Walsh Daniel Menet @@ -417,12 +435,14 @@ Daniel Norberg Daniel Nordberg Daniel Robinson Daniel S +Daniel Sweet Daniel Von Fange Daniel Watkins Daniel X Moore Daniel YC Lin Daniel Zhang Danny Berger +Danny Milosavljevic Danny Yates Danyal Khaliq Darren Coxall @@ -487,6 +507,7 @@ Derek McGowan Deric Crago Deshi Xiao devmeyster +Devon Estes Devvyn Murphy Dharmit Shah Dhawal Yogesh Bhanushali @@ -516,6 +537,8 @@ Dmitry Smirnov Dmitry V. Krivenok Dmitry Vorobev Dolph Mathews +Dominic Tubach +Dominic Yin Dominik Dingel Dominik Finkbeiner Dominik Honnef @@ -534,7 +557,7 @@ Douglas Curtis Dr Nic Williams dragon788 Dražen Lučanin -Drew Erny +Drew Erny Drew Hubl Dustin Sallings Ed Costello @@ -584,6 +607,7 @@ Erik Weathers Erno Hopearuoho Erwin van der Koogh Ethan Bell +Ethan Mosbaugh Euan Kemp Eugen Krizo Eugene Yakubovich @@ -595,6 +619,7 @@ Evan Phoenix Evan Wies Evelyn Xu Everett Toews +Evgeniy Makhrov Evgeny Shmarnev Evgeny Vereshchagin Ewa Czechowska @@ -620,6 +645,7 @@ Fareed Dudhia Fathi Boudra Federico Gimenez Felipe Oliveira +Felipe Ruhland Felix Abecassis Felix Geisendörfer Felix Hupfeld @@ -640,6 +666,7 @@ Florian Florian Klein Florian Maier Florian Noeding +Florian Schmaus Florian Weingarten Florin Asavoaie Florin Patan @@ -654,6 +681,7 @@ Frank Groeneveld Frank Herrmann Frank Macreery Frank Rosquin +frankyang Fred Lifton Frederick F. Kautz IV Frederik Loeffert @@ -675,7 +703,7 @@ Gareth Rushgrove Garrett Barboza Gary Schaetz Gaurav -gautam, prasanna +Gaurav Singh Gaël PORTAY Genki Takiuchi GennadySpb @@ -701,11 +729,12 @@ Gleb M Borisov Glyn Normington GoBella Goffert van Gool +Goldwyn Rodrigues Gopikannan Venugopalsamy Gosuke Miyashita Gou Rao Govinda Fichtner -Grant Millar +Grant Millar Grant Reaber Graydon Hoare Greg Fausak @@ -724,14 +753,17 @@ Guruprasad Gustav Sinder gwx296173 Günter Zöchbauer +Haichao Yang haikuoliu Hakan Özler Hamish Hutchings +Hannes Ljungberg Hans Kristian Flaatten Hans Rødtang Hao Shu Wei Hao Zhang <21521210@zju.edu.cn> Harald Albers +Harald Niesche Harley Laue Harold Cooper Harrison Turton @@ -751,9 +783,13 @@ Hobofan Hollie Teal Hong Xu Hongbin Lu +Hongxu Jia +Honza Pokorny +Hsing-Hui Hsu hsinko <21551195@zju.edu.cn> Hu Keping Hu Tao +HuanHuan Ye Huanzhong Zhang Huayi Zhang Hugo Duncan @@ -790,6 +826,7 @@ Ingo Gottwald Innovimax Isaac Dupree Isabel Jimenez +Isaiah Grace Isao Jonas Iskander Sharipov Ivan Babrou @@ -805,6 +842,7 @@ Jacob Edelman Jacob Tomlinson Jacob Vallejo Jacob Wen +Jaime Cepeda Jaivish Kothari Jake Champlin Jake Moshenko @@ -819,12 +857,13 @@ James Kyburz James Kyle James Lal James Mills -James Nesbitt +James Nesbitt James Nugent James Turnbull James Watkins-Harvey Jamie Hannaford Jamshid Afshar +Jan Chren Jan Keromnes Jan Koprowski Jan Pazdziora @@ -839,6 +878,7 @@ Jared Hocutt Jaroslaw Zabiello jaseg Jasmine Hegman +Jason A. Donenfeld Jason Divock Jason Giedymin Jason Green @@ -886,7 +926,7 @@ Jeroen Franse Jeroen Jacobs Jesse Dearing Jesse Dubay -Jessica Frazelle +Jessica Frazelle Jezeniel Zapanta Jhon Honce Ji.Zhilong @@ -894,9 +934,11 @@ Jian Liao Jian Zhang Jiang Jinyang Jie Luo +Jie Ma Jihyun Hwang Jilles Oldenbeuving Jim Alateras +Jim Ehrismann Jim Galasyn Jim Minter Jim Perrin @@ -934,7 +976,7 @@ John Feminella John Gardiner Myers John Gossman John Harris -John Howard (VM) +John Howard John Laswell John Maguire John Mulhausen @@ -948,6 +990,8 @@ John Willis Jon Johnson Jon Surrell Jon Wedaman +Jonas Dohse +Jonas Heinrich Jonas Pfenniger Jonathan A. Schweder Jonathan A. Sternberg @@ -997,10 +1041,13 @@ Julien Dubois Julien Kassar Julien Maitrehenry Julien Pervillé +Julien Pivotto +Julio Guerra Julio Montes Jun-Ru Chang Jussi Nummelin Justas Brazauskas +Justen Martin Justin Cormack Justin Force Justin Menga @@ -1009,6 +1056,7 @@ Justin Simonelis Justin Terry Justyn Temme Jyrki Puttonen +Jérémy Leherpeur Jérôme Petazzoni Jörg Thalheim K. Heller @@ -1046,6 +1094,7 @@ Ken Reese Kenfe-Mickaël Laventure Kenjiro Nakayama Kent Johnson +Kenta Tada Kevin "qwazerty" Houdebert Kevin Burke Kevin Clark @@ -1056,6 +1105,7 @@ Kevin Kern Kevin Menard Kevin Meredith Kevin P. Kucharczyk +Kevin Parsons Kevin Richardson Kevin Shi Kevin Wallace @@ -1146,6 +1196,7 @@ longliqiang88 <394564827@qq.com> Lorenz Leutgeb Lorenzo Fontana Lotus Fenn +Louis Delossantos Louis Opter Luca Favatella Luca Marturana @@ -1154,9 +1205,11 @@ Luca-Bogdan Grigorescu Lucas Chan Lucas Chi Lucas Molas +Lucas Silvestre Luciano Mores Luis Martínez de Bartolomé Izquierdo Luiz Svoboda +Lukas Heeren Lukas Waslowski lukaspustina Lukasz Zajaczkowski @@ -1256,6 +1309,7 @@ Matthieu Hauglustaine Mattias Jernberg Mauricio Garavaglia mauriyouth +Max Harmathy Max Shytikov Maxim Fedchyshyn Maxim Ivanov @@ -1296,6 +1350,7 @@ Michael Stapelberg Michael Steinert Michael Thies Michael West +Michael Zhao Michal Fojtik Michal Gebauer Michal Jemala @@ -1312,6 +1367,7 @@ Miguel Morales Mihai Borobocea Mihuleacc Sergiu Mike Brown +Mike Bush Mike Casas Mike Chelen Mike Danese @@ -1380,6 +1436,7 @@ Neyazul Haque Nghia Tran Niall O'Higgins Nicholas E. Rabenau +Nick Adcock Nick DeCoursin Nick Irvine Nick Neisen @@ -1403,6 +1460,7 @@ Nik Nyby Nikhil Chawla NikolaMandic Nikolas Garofil +Nikolay Edigaryev Nikolay Milovanov Nirmal Mehta Nishant Totla @@ -1418,6 +1476,7 @@ Nuutti Kotivuori nzwsch O.S. Tezer objectified +Odin Ugedal Oguz Bilgic Oh Jinkyun Ohad Schneider @@ -1428,6 +1487,7 @@ Oliver Reason Olivier Gambier Olle Jonsson Olli Janatuinen +Olly Pomeroy Omri Shiv Oriol Francès Oskar Niburski @@ -1437,6 +1497,7 @@ Ovidio Mallo Panagiotis Moustafellos Paolo G. Giarrusso Pascal +Pascal Bach Pascal Borreli Pascal Hartig Patrick Böänziger @@ -1461,6 +1522,7 @@ Paul Nasrat Paul Weaver Paulo Ribeiro Pavel Lobashov +Pavel Matěja Pavel Pletenev Pavel Pospisil Pavel Sutyrin @@ -1572,6 +1634,7 @@ Riku Voipio Riley Guerin Ritesh H Shukla Riyaz Faizullabhoy +Rob Gulewich Rob Vesse Robert Bachmann Robert Bittle @@ -1580,11 +1643,13 @@ Robert Schneider Robert Stern Robert Terhaar Robert Wallis +Robert Wang Roberto G. Hashioka Roberto Muñoz Fernández Robin Naundorf Robin Schneider Robin Speekenbrink +Robin Thoni robpc Rodolfo Carvalho Rodrigo Vaz @@ -1599,6 +1664,7 @@ Roland Kammerer Roland Moriz Roma Sokolov Roman Dudin +Roman Mazur Roman Strashkin Ron Smits Ron Williams @@ -1618,6 +1684,7 @@ Rozhnov Alexandr Rudolph Gottesheim Rui Cao Rui Lopes +Ruilin Li Runshen Zhu Russ Magee Ryan Abrams @@ -1656,6 +1723,7 @@ Sam J Sharpe Sam Neirinck Sam Reis Sam Rijs +Sam Whited Sambuddha Basu Sami Wagiaalla Samuel Andaya @@ -1670,6 +1738,7 @@ sapphiredev Sargun Dhillon Sascha Andres Sascha Grunert +SataQiu Satnam Singh Satoshi Amemiya Satoshi Tagomori @@ -1718,6 +1787,7 @@ Shijun Qin Shishir Mahajan Shoubhik Bose Shourya Sarcar +Shu-Wai Chow shuai-z Shukui Yang Shuwei Hao @@ -1728,6 +1798,7 @@ Silas Sewell Silvan Jegen Simão Reis Simei He +Simon Barendse Simon Eskildsen Simon Ferquel Simon Leinen @@ -1736,6 +1807,7 @@ Simon Taranto Simon Vikstrom Sindhu S Sjoerd Langkemper +skanehira Solganik Alexander Solomon Hykes Song Gao @@ -1747,18 +1819,21 @@ Sridatta Thatipamala Sridhar Ratnakumar Srini Brahmaroutu Srinivasan Srivatsan +Staf Wagemakers Stanislav Bondarenko +Stanislav Levin Steeve Morin Stefan Berger Stefan J. Wernli Stefan Praszalowicz Stefan S. -Stefan Scherer +Stefan Scherer Stefan Staudenmeyer Stefan Weil Stephan Spindler +Stephen Benjamin Stephen Crosby -Stephen Day +Stephen Day Stephen Drake Stephen Rust Steve Desmond @@ -1773,10 +1848,12 @@ Steven Iveson Steven Merrill Steven Richards Steven Taylor +Stig Larsson Subhajit Ghosh Sujith Haridasan Sun Gengze <690388648@qq.com> Sun Jianbo +Sune Keller Sunny Gogoi Suryakumar Sudar Sven Dowideit @@ -1827,6 +1904,8 @@ Tianyi Wang Tibor Vass Tiffany Jernigan Tiffany Low +Till Wegmüller +Tim Tim Bart Tim Bosse Tim Dettrick @@ -1878,7 +1957,7 @@ Tony Miller toogley Torstein Husebø Tõnis Tiigi -tpng +Trace Andreason tracylihui <793912329@qq.com> Trapier Marshall Travis Cline @@ -1901,6 +1980,7 @@ Utz Bacher vagrant Vaidas Jablonskis vanderliang +Velko Ivanov Veres Lajos Victor Algaze Victor Coisne @@ -1912,11 +1992,13 @@ Victor Palma Victor Vieux Victoria Bialas Vijaya Kumar K +Vikram bir Singh Viktor Stanchev Viktor Vojnovski VinayRaghavanKS Vincent Batts Vincent Bernat +Vincent Boulineau Vincent Demeester Vincent Giersch Vincent Mayers @@ -1947,6 +2029,8 @@ Wang Long Wang Ping Wang Xing Wang Yuexiao +Wang Yumu <37442693@qq.com> +wanghuaiqing Ward Vandewege WarheadsSE Wassim Dhif @@ -1963,12 +2047,14 @@ Wen Cheng Ma Wendel Fleming Wenjun Tang Wenkai Yin +wenlxie Wentao Zhang Wenxuan Zhao Wenyu You <21551128@zju.edu.cn> Wenzhi Liang Wes Morgan Wewang Xiaorenfine +Wiktor Kwapisiewicz Will Dietz Will Rouesnel Will Weaver @@ -1979,6 +2065,8 @@ William Hubbs William Martin William Riancho William Thurston +Wilson Júnior +Wing-Kam Wong WiseTrem Wolfgang Powisch Wonjun Kim @@ -1988,6 +2076,7 @@ Xianglin Gao Xianlu Bird Xiao YongBiao XiaoBing Jiang +Xiaodong Liu Xiaodong Zhang Xiaoxi He Xiaoxu Chen @@ -1996,6 +2085,7 @@ xichengliudui <1693291525@qq.com> xiekeyang Ximo Guanter Gonzálbez Xinbo Weng +Xinfeng Liu Xinzi Zhou Xiuming Chen Xuecong Liao @@ -2010,6 +2100,7 @@ Yang Pengfei yangchenliang Yanqiang Miao Yao Zaiyong +Yash Murty Yassine Tijani Yasunori Mahata Yazhong Liu @@ -2024,6 +2115,7 @@ Yongxin Li Yongzhi Pan Yosef Fertel You-Sheng Yang (楊有勝) +youcai Youcef YEKHLEF Yu Changchun Yu Chengxia @@ -2055,11 +2147,13 @@ Zhenan Ye <21551168@zju.edu.cn> zhenghenghuo Zhenhai Gao Zhenkun Bi +zhipengzuo Zhou Hao Zhoulin Xie Zhu Guihua Zhu Kunjia Zhuoyun Wei +Ziheng Liu Zilin Du zimbatm Ziming Dong @@ -2068,12 +2162,13 @@ zmarouf Zoltan Tombol Zou Yu zqh -Zuhayr Elahi +Zuhayr Elahi Zunayed Ali Álex González Álvaro Lázaro Átila Camurça Alves 尹吉峰 +屈骏 徐俊杰 慕陶 搏通 diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/common.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/common.go index aa146cdaeb1a..1565e2af6474 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/common.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/common.go @@ -3,7 +3,7 @@ package api // import "github.com/docker/docker/api" // Common constants for daemon and client. const ( // DefaultVersion of Current REST API - DefaultVersion = "1.40" + DefaultVersion = "1.41" // NoBaseImageSpecifier is the symbol used by the FROM // command to specify that no base image is to be used. diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/swagger.yaml b/cluster-autoscaler/vendor/github.com/docker/docker/api/swagger.yaml index 70b09a0e3b73..9f1019681af5 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/swagger.yaml +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/swagger.yaml @@ -19,10 +19,10 @@ produces: consumes: - "application/json" - "text/plain" -basePath: "/v1.40" +basePath: "/v1.41" info: title: "Docker Engine API" - version: "1.40" + version: "1.41" x-logo: url: "https://docs.docker.com/images/logo-docker-main.png" description: | @@ -55,8 +55,8 @@ info: the URL is not supported by the daemon, a HTTP `400 Bad Request` error message is returned. - If you omit the version-prefix, the current version of the API (v1.40) is used. - For example, calling `/info` is the same as calling `/v1.40/info`. Using the + If you omit the version-prefix, the current version of the API (v1.41) is used. + For example, calling `/info` is the same as calling `/v1.41/info`. Using the API without a version-prefix is deprecated and will be removed in a future release. Engine releases in the near future should support this version of the API, @@ -528,7 +528,13 @@ definitions: items: $ref: "#/definitions/DeviceRequest" KernelMemory: - description: "Kernel memory limit in bytes." + description: | + Kernel memory limit in bytes. + +


+ + > **Deprecated**: This field is deprecated as the kernel 5.4 deprecated + > `kmem.limit_in_bytes`. type: "integer" format: "int64" example: 209715200 @@ -625,6 +631,27 @@ definitions: type: "integer" format: "int64" + Limit: + description: | + An object describing a limit on resources which can be requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + Pids: + description: | + Limits the maximum number of PIDs in the container. Set `0` for unlimited. + type: "integer" + format: "int64" + default: 0 + example: 100 + ResourceObject: description: | An object describing the resources which can be advertised by a node and @@ -885,15 +912,6 @@ definitions: $ref: "#/definitions/Mount" # Applicable to UNIX platforms - Capabilities: - type: "array" - description: | - A list of kernel capabilities to be available for container (this - overrides the default set). - - Conflicts with options 'CapAdd' and 'CapDrop'" - items: - type: "string" CapAdd: type: "array" description: | @@ -908,6 +926,19 @@ definitions: with option 'Capabilities'. items: type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. Dns: type: "array" description: "A list of DNS servers for the container to use." @@ -3253,6 +3284,44 @@ definitions: type: "object" additionalProperties: type: "string" + # This option is not used by Windows containers + CapabilityAdd: + type: "array" + description: | + A list of kernel capabilities to add to the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" + CapabilityDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + Ulimits: + description: | + A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" NetworkAttachmentSpec: description: | Read-only spec type for non-swarm containers attached to swarm overlay @@ -3277,7 +3346,7 @@ definitions: properties: Limits: description: "Define resources limits." - $ref: "#/definitions/ResourceObject" + $ref: "#/definitions/Limit" Reservation: description: "Define resources reservation." $ref: "#/definitions/ResourceObject" @@ -3487,6 +3556,12 @@ definitions: type: "integer" DesiredState: $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" example: ID: "0kzzo1i0y4jz6027t0k7aezc7" Version: @@ -3579,6 +3654,29 @@ definitions: format: "int64" Global: type: "object" + ReplicatedJob: + description: | + The mode used for services with a finite number of tasks that run + to a completed state. + type: "object" + properties: + MaxConcurrent: + description: | + The maximum number of replicas to run simultaneously. + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: | + The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + type: "integer" + format: "int64" + GlobalJob: + description: | + The mode used for services which run a task to the completed state + on each valid node. + type: "object" UpdateConfig: description: "Specification for the update strategy of the service." type: "object" @@ -3785,6 +3883,61 @@ definitions: format: "dateTime" Message: type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: | + The number of tasks for the service currently in the Running state. + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: | + The last time, as observed by the server, that this job was + started. + type: "string" + format: "dateTime" example: ID: "9mnpnzenvg8p8tdbtq4wvbkcz" Version: @@ -4288,44 +4441,6 @@ definitions: on Windows. type: "string" example: "/var/lib/docker" - SystemStatus: - description: | - Status information about this node (standalone Swarm API). - -


- - > **Note**: The information returned in this field is only propagated - > by the Swarm standalone API, and is empty (`null`) when using - > built-in swarm mode. - type: "array" - items: - type: "array" - items: - type: "string" - example: - - ["Role", "primary"] - - ["State", "Healthy"] - - ["Strategy", "spread"] - - ["Filters", "health, port, containerslots, dependency, affinity, constraint, whitelist"] - - ["Nodes", "2"] - - [" swarm-agent-00", "192.168.99.102:2376"] - - [" └ ID", "5CT6:FBGO:RVGO:CZL4:PB2K:WCYN:2JSV:KSHH:GGFW:QOPG:6J5Q:IOZ2|192.168.99.102:2376"] - - [" └ Status", "Healthy"] - - [" └ Containers", "1 (1 Running, 0 Paused, 0 Stopped)"] - - [" └ Reserved CPUs", "0 / 1"] - - [" └ Reserved Memory", "0 B / 1.021 GiB"] - - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"] - - [" └ UpdatedAt", "2017-08-09T10:03:46Z"] - - [" └ ServerVersion", "17.06.0-ce"] - - [" swarm-manager", "192.168.99.101:2376"] - - [" └ ID", "TAMD:7LL3:SEF7:LW2W:4Q2X:WVFH:RTXX:JSYS:XY2P:JEHL:ZMJK:JGIW|192.168.99.101:2376"] - - [" └ Status", "Healthy"] - - [" └ Containers", "2 (2 Running, 0 Paused, 0 Stopped)"] - - [" └ Reserved CPUs", "0 / 1"] - - [" └ Reserved Memory", "0 B / 1.021 GiB"] - - [" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"] - - [" └ UpdatedAt", "2017-08-09T10:04:11Z"] - - [" └ ServerVersion", "17.06.0-ce"] Plugins: $ref: "#/definitions/PluginsInfo" MemoryLimit: @@ -4337,7 +4452,13 @@ definitions: type: "boolean" example: true KernelMemory: - description: "Indicates if the host has kernel memory limit support enabled." + description: | + Indicates if the host has kernel memory limit support enabled. + +


+ + > **Deprecated**: This field is deprecated as the kernel 5.4 deprecated + > `kmem.limit_in_bytes`. type: "boolean" example: true CpuCfsPeriod: @@ -4420,6 +4541,13 @@ definitions: enum: ["cgroupfs", "systemd", "none"] default: "cgroupfs" example: "cgroupfs" + CgroupVersion: + description: | + The version of the cgroup. + type: "string" + enum: ["1", "2"] + default: "1" + example: "1" NEventsListener: description: "Number of event listeners subscribed." type: "integer" @@ -4439,6 +4567,17 @@ definitions: or "Windows Server 2016 Datacenter" type: "string" example: "Alpine Linux v3.5" + OSVersion: + description: | + Version of the host's operating system + +


+ + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "16.04" OSType: description: | Generic type of the operating system of the host, as returned by the @@ -4555,7 +4694,7 @@ definitions:


- > **Note**: This field is only propagated when using standalone Swarm + > **Deprecated**: This field is only propagated when using standalone Swarm > mode, and overlay networking using an external k/v store. Overlay > networks with Swarm mode enabled use the built-in raft store, and > this field will be empty. @@ -4569,7 +4708,7 @@ definitions:


- > **Note**: This field is only propagated when using standalone Swarm + > **Deprecated**: This field is only propagated when using standalone Swarm > mode, and overlay networking using an external k/v store. Overlay > networks with Swarm mode enabled use the built-in raft store, and > this field will be empty. @@ -4674,6 +4813,25 @@ definitions: such as number of nodes, and expiration are included. type: "string" example: "Community Engine" + DefaultAddressPools: + description: | + List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + type: "array" + items: + type: "object" + properties: + Base: + description: "The network address in CIDR format" + type: "string" + example: "10.10.0.0/16" + Size: + description: "The network pool size" + type: "integer" + example: "24" Warnings: description: | List of warnings / informational messages about missing features, or @@ -5482,9 +5640,6 @@ paths: type: "string" LogPath: type: "string" - Node: - description: "TODO" - type: "object" Name: type: "string" RestartCount: @@ -5971,6 +6126,12 @@ paths: nil then for compatibility with older daemons the length of the corresponding `cpu_usage.percpu_usage` array should be used. + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: * used_memory = `memory_stats.usage - memory_stats.stats.cache` @@ -6103,6 +6264,13 @@ paths: it will disconnect. type: "boolean" default: true + - name: "one-shot" + in: "query" + description: | + Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + type: "boolean" + default: false tags: ["Container"] /containers/{id}/resize: post: @@ -6755,7 +6923,7 @@ paths: type: "string" - name: "v" in: "query" - description: "Remove the volumes associated with the container." + description: "Remove anonymous volumes associated with the container." type: "boolean" default: false - name: "force" @@ -7855,7 +8023,7 @@ paths: API-Version: type: "string" description: "Max API Version the server supports" - BuildKit-Version: + Builder-Version: type: "string" description: "Default version of docker image builder" Docker-Experimental: @@ -7894,7 +8062,7 @@ paths: API-Version: type: "string" description: "Max API Version the server supports" - BuildKit-Version: + Builder-Version: type: "string" description: "Default version of docker image builder" Docker-Experimental: @@ -7979,13 +8147,13 @@ paths: Various objects within Docker report events when something happens to them. - Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, and `update` + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` - Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, and `untag` + Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` - Volumes report these events: `create`, `mount`, `unmount`, and `destroy` + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` - Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, and `remove` + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` The Docker daemon reports these events: `reload` @@ -7997,6 +8165,8 @@ paths: Configs report these events: `create`, `update`, and `remove` + The Builder reports `prune` events + operationId: "SystemEvents" produces: - "application/json" @@ -10071,6 +10241,11 @@ paths: - `label=` - `mode=["replicated"|"global"]` - `name=` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. tags: ["Service"] /services/create: post: diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/client.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/client.go index fe90617eec35..9c464b73e25d 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/client.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/client.go @@ -205,7 +205,7 @@ const ( // BuilderV1 is the first generation builder in docker daemon BuilderV1 BuilderVersion = "1" // BuilderBuildKit is builder based on moby/buildkit project - BuilderBuildKit = "2" + BuilderBuildKit BuilderVersion = "2" ) // ImageBuildResponse holds information @@ -265,7 +265,7 @@ type ImagePullOptions struct { // if the privilege request fails. type RequestPrivilegeFunc func() (string, error) -//ImagePushOptions holds information to push images. +// ImagePushOptions holds information to push images. type ImagePushOptions ImagePullOptions // ImageRemoveOptions holds parameters to remove images. @@ -363,6 +363,10 @@ type ServiceUpdateOptions struct { // ServiceListOptions holds parameters to list services with. type ServiceListOptions struct { Filters filters.Args + + // Status indicates whether the server should include the service task + // count of running and desired tasks. + Status bool } // ServiceInspectOptions holds parameters related to the "service inspect" diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/configs.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/configs.go index 178e911a7afc..3dd133a3a58a 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/configs.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/configs.go @@ -3,6 +3,7 @@ package types // import "github.com/docker/docker/api/types" import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" + specs "github.com/opencontainers/image-spec/specs-go/v1" ) // configs holds structs used for internal communication between the @@ -15,6 +16,7 @@ type ContainerCreateConfig struct { Config *container.Config HostConfig *container.HostConfig NetworkingConfig *network.NetworkingConfig + Platform *specs.Platform AdjustCPUShares bool } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_changes.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_changes.go index 222d141007ec..16dd5019eef8 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_changes.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_changes.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_create.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_create.go index 1ec9c3728ba8..d0c852f84d5c 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_create.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_create.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_top.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_top.go index bd34cd6b6928..63381da36749 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_top.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_top.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_update.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_update.go index 33addedf7791..c10f175ea82f 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_update.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_update.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_wait.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_wait.go index 94b6a20e159b..49e05ae66944 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_wait.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/container_wait.go @@ -1,8 +1,7 @@ package container // import "github.com/docker/docker/api/types/container" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/host_config.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/host_config.go index c3de3d976a57..2d1cbaa9abd9 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/host_config.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/container/host_config.go @@ -7,9 +7,32 @@ import ( "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/strslice" "github.com/docker/go-connections/nat" - "github.com/docker/go-units" + units "github.com/docker/go-units" ) +// CgroupnsMode represents the cgroup namespace mode of the container +type CgroupnsMode string + +// IsPrivate indicates whether the container uses its own private cgroup namespace +func (c CgroupnsMode) IsPrivate() bool { + return c == "private" +} + +// IsHost indicates whether the container shares the host's cgroup namespace +func (c CgroupnsMode) IsHost() bool { + return c == "host" +} + +// IsEmpty indicates whether the container cgroup namespace mode is unset +func (c CgroupnsMode) IsEmpty() bool { + return c == "" +} + +// Valid indicates whether the cgroup namespace mode is valid +func (c CgroupnsMode) Valid() bool { + return c.IsEmpty() || c.IsPrivate() || c.IsHost() +} + // Isolation represents the isolation technology of a container. The supported // values are platform specific type Isolation string @@ -122,7 +145,7 @@ func (n NetworkMode) ConnectedContainer() string { return "" } -//UserDefined indicates user-created network +// UserDefined indicates user-created network func (n NetworkMode) UserDefined() string { if n.IsUserDefined() { return string(n) @@ -338,7 +361,7 @@ type Resources struct { Devices []DeviceMapping // List of devices to map inside the container DeviceCgroupRules []string // List of rule to be added to the device cgroup DeviceRequests []DeviceRequest // List of device requests for device drivers - KernelMemory int64 // Kernel memory limit (in bytes) + KernelMemory int64 // Kernel memory limit (in bytes), Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes KernelMemoryTCP int64 // Hard limit for kernel TCP buffer memory (in bytes) MemoryReservation int64 // Memory soft limit (in bytes) MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap @@ -380,10 +403,10 @@ type HostConfig struct { // Applicable to UNIX platforms CapAdd strslice.StrSlice // List of kernel capabilities to add to the container CapDrop strslice.StrSlice // List of kernel capabilities to remove from the container - Capabilities []string `json:"Capabilities"` // List of kernel capabilities to be available for container (this overrides the default set) - DNS []string `json:"Dns"` // List of DNS server to lookup - DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for - DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for + CgroupnsMode CgroupnsMode // Cgroup namespace mode to use for the container + DNS []string `json:"Dns"` // List of DNS server to lookup + DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for + DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for ExtraHosts []string // List of extra hosts GroupAdd []string // List of additional groups that the container process will run as IpcMode IpcMode // IPC namespace to use for the container diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/error_response_ext.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/error_response_ext.go new file mode 100644 index 000000000000..f84f034cd545 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/error_response_ext.go @@ -0,0 +1,6 @@ +package types + +// Error returns the error message +func (e ErrorResponse) Error() string { + return e.Message +} diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/events/events.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/events/events.go index 027c6edb7223..aa8fba815484 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/events/events.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/events/events.go @@ -1,6 +1,8 @@ package events // import "github.com/docker/docker/api/types/events" const ( + // BuilderEventType is the event type that the builder generates + BuilderEventType = "builder" // ContainerEventType is the event type that containers generate ContainerEventType = "container" // DaemonEventType is the event type that daemon generate diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/filters/parse.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/filters/parse.go index 0bd2e1e1853b..4bc91cffd6e5 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/filters/parse.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/filters/parse.go @@ -66,7 +66,7 @@ func ToJSON(a Args) (string, error) { // then the encoded format will use an older legacy format where the values are a // list of strings, instead of a set. // -// Deprecated: Use ToJSON +// Deprecated: do not use in any new code; use ToJSON instead func ToParamWithVersion(version string, a Args) (string, error) { if a.Len() == 0 { return "", nil @@ -154,7 +154,7 @@ func (args Args) Len() int { func (args Args) MatchKVList(key string, sources map[string]string) bool { fieldValues := args.fields[key] - //do not filter if there is no filter set or cannot determine filter + // do not filter if there is no filter set or cannot determine filter if len(fieldValues) == 0 { return true } @@ -200,7 +200,7 @@ func (args Args) Match(field, source string) bool { // ExactMatch returns true if the source matches exactly one of the values. func (args Args) ExactMatch(key, source string) bool { fieldValues, ok := args.fields[key] - //do not filter if there is no filter set or cannot determine filter + // do not filter if there is no filter set or cannot determine filter if !ok || len(fieldValues) == 0 { return true } @@ -213,7 +213,7 @@ func (args Args) ExactMatch(key, source string) bool { // matches exactly the value. func (args Args) UniqueExactMatch(key, source string) bool { fieldValues := args.fields[key] - //do not filter if there is no filter set or cannot determine filter + // do not filter if there is no filter set or cannot determine filter if len(fieldValues) == 0 { return true } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/image/image_history.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/image/image_history.go index b5a7a0c4901b..e302bb0aebbe 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/image/image_history.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/image/image_history.go @@ -1,8 +1,7 @@ package image // import "github.com/docker/docker/api/types/image" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/mount/mount.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/mount/mount.go index ab4446b38f6c..443b8d07a9f3 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/mount/mount.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/mount/mount.go @@ -113,7 +113,7 @@ type TmpfsOptions struct { // TODO(stevvooe): There are several more tmpfs flags, specified in the // daemon, that are accepted. Only the most basic are added for now. // - // From docker/docker/pkg/mount/flags.go: + // From https://github.com/moby/sys/blob/mount/v0.1.1/mount/flags.go#L47-L56 // // var validFlags = map[string]bool{ // "": true, diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/network/network.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/network/network.go index 71e97338fdc8..437b184c67b5 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/network/network.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/network/network.go @@ -1,7 +1,6 @@ package network // import "github.com/docker/docker/api/types/network" import ( "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/errdefs" ) // Address represents an IP address @@ -13,7 +12,7 @@ type Address struct { // IPAM represents IP Address Management type IPAM struct { Driver string - Options map[string]string //Per network IPAM driver options + Options map[string]string // Per network IPAM driver options Config []IPAMConfig } @@ -123,5 +122,5 @@ var acceptedFilters = map[string]bool{ // ValidateFilters validates the list of filter args with the available filters. func ValidateFilters(filter filters.Args) error { - return errdefs.InvalidParameter(filter.Validate(acceptedFilters)) + return filter.Validate(acceptedFilters) } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/registry/registry.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/registry/registry.go index 8789ad3b3210..53e47084c8d5 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/registry/registry.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/registry/registry.go @@ -4,7 +4,7 @@ import ( "encoding/json" "net" - "github.com/opencontainers/image-spec/specs-go/v1" + v1 "github.com/opencontainers/image-spec/specs-go/v1" ) // ServiceConfig stores daemon registry services configuration. diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/seccomp.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/seccomp.go deleted file mode 100644 index 2259c6be1e65..000000000000 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/seccomp.go +++ /dev/null @@ -1,94 +0,0 @@ -package types // import "github.com/docker/docker/api/types" - -// Seccomp represents the config for a seccomp profile for syscall restriction. -type Seccomp struct { - DefaultAction Action `json:"defaultAction"` - // Architectures is kept to maintain backward compatibility with the old - // seccomp profile. - Architectures []Arch `json:"architectures,omitempty"` - ArchMap []Architecture `json:"archMap,omitempty"` - Syscalls []*Syscall `json:"syscalls"` -} - -// Architecture is used to represent a specific architecture -// and its sub-architectures -type Architecture struct { - Arch Arch `json:"architecture"` - SubArches []Arch `json:"subArchitectures"` -} - -// Arch used for architectures -type Arch string - -// Additional architectures permitted to be used for system calls -// By default only the native architecture of the kernel is permitted -const ( - ArchX86 Arch = "SCMP_ARCH_X86" - ArchX86_64 Arch = "SCMP_ARCH_X86_64" - ArchX32 Arch = "SCMP_ARCH_X32" - ArchARM Arch = "SCMP_ARCH_ARM" - ArchAARCH64 Arch = "SCMP_ARCH_AARCH64" - ArchMIPS Arch = "SCMP_ARCH_MIPS" - ArchMIPS64 Arch = "SCMP_ARCH_MIPS64" - ArchMIPS64N32 Arch = "SCMP_ARCH_MIPS64N32" - ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL" - ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64" - ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32" - ArchPPC Arch = "SCMP_ARCH_PPC" - ArchPPC64 Arch = "SCMP_ARCH_PPC64" - ArchPPC64LE Arch = "SCMP_ARCH_PPC64LE" - ArchS390 Arch = "SCMP_ARCH_S390" - ArchS390X Arch = "SCMP_ARCH_S390X" -) - -// Action taken upon Seccomp rule match -type Action string - -// Define actions for Seccomp rules -const ( - ActKill Action = "SCMP_ACT_KILL" - ActTrap Action = "SCMP_ACT_TRAP" - ActErrno Action = "SCMP_ACT_ERRNO" - ActTrace Action = "SCMP_ACT_TRACE" - ActAllow Action = "SCMP_ACT_ALLOW" -) - -// Operator used to match syscall arguments in Seccomp -type Operator string - -// Define operators for syscall arguments in Seccomp -const ( - OpNotEqual Operator = "SCMP_CMP_NE" - OpLessThan Operator = "SCMP_CMP_LT" - OpLessEqual Operator = "SCMP_CMP_LE" - OpEqualTo Operator = "SCMP_CMP_EQ" - OpGreaterEqual Operator = "SCMP_CMP_GE" - OpGreaterThan Operator = "SCMP_CMP_GT" - OpMaskedEqual Operator = "SCMP_CMP_MASKED_EQ" -) - -// Arg used for matching specific syscall arguments in Seccomp -type Arg struct { - Index uint `json:"index"` - Value uint64 `json:"value"` - ValueTwo uint64 `json:"valueTwo"` - Op Operator `json:"op"` -} - -// Filter is used to conditionally apply Seccomp rules -type Filter struct { - Caps []string `json:"caps,omitempty"` - Arches []string `json:"arches,omitempty"` - MinKernel string `json:"minKernel,omitempty"` -} - -// Syscall is used to match a group of syscalls in Seccomp -type Syscall struct { - Name string `json:"name,omitempty"` - Names []string `json:"names,omitempty"` - Action Action `json:"action"` - Args []*Arg `json:"args"` - Comment string `json:"comment"` - Includes Filter `json:"includes"` - Excludes Filter `json:"excludes"` -} diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/container.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/container.go index 48190c1762f1..af5e1c0bc279 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/container.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/container.go @@ -5,6 +5,7 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/mount" + "github.com/docker/go-units" ) // DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf) @@ -67,10 +68,13 @@ type ContainerSpec struct { // The format of extra hosts on swarmkit is specified in: // http://man7.org/linux/man-pages/man5/hosts.5.html // IP_address canonical_hostname [aliases...] - Hosts []string `json:",omitempty"` - DNSConfig *DNSConfig `json:",omitempty"` - Secrets []*SecretReference `json:",omitempty"` - Configs []*ConfigReference `json:",omitempty"` - Isolation container.Isolation `json:",omitempty"` - Sysctls map[string]string `json:",omitempty"` + Hosts []string `json:",omitempty"` + DNSConfig *DNSConfig `json:",omitempty"` + Secrets []*SecretReference `json:",omitempty"` + Configs []*ConfigReference `json:",omitempty"` + Isolation container.Isolation `json:",omitempty"` + Sysctls map[string]string `json:",omitempty"` + CapabilityAdd []string `json:",omitempty"` + CapabilityDrop []string `json:",omitempty"` + Ulimits []*units.Ulimit `json:",omitempty"` } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.pb.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.pb.go index 1fdc9b043613..e45045866a6e 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.pb.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-gogo. +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: plugin.proto -// DO NOT EDIT! /* Package runtime is a generated protocol buffer package. @@ -38,6 +37,7 @@ type PluginSpec struct { Remote string `protobuf:"bytes,2,opt,name=remote,proto3" json:"remote,omitempty"` Privileges []*PluginPrivilege `protobuf:"bytes,3,rep,name=privileges" json:"privileges,omitempty"` Disabled bool `protobuf:"varint,4,opt,name=disabled,proto3" json:"disabled,omitempty"` + Env []string `protobuf:"bytes,5,rep,name=env" json:"env,omitempty"` } func (m *PluginSpec) Reset() { *m = PluginSpec{} } @@ -73,6 +73,13 @@ func (m *PluginSpec) GetDisabled() bool { return false } +func (m *PluginSpec) GetEnv() []string { + if m != nil { + return m.Env + } + return nil +} + // PluginPrivilege describes a permission the user has to accept // upon installing a plugin. type PluginPrivilege struct { @@ -160,6 +167,21 @@ func (m *PluginSpec) MarshalTo(dAtA []byte) (int, error) { } i++ } + if len(m.Env) > 0 { + for _, s := range m.Env { + dAtA[i] = 0x2a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } return i, nil } @@ -208,24 +230,6 @@ func (m *PluginPrivilege) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func encodeFixed64Plugin(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Plugin(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} func encodeVarintPlugin(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -255,6 +259,12 @@ func (m *PluginSpec) Size() (n int) { if m.Disabled { n += 2 } + if len(m.Env) > 0 { + for _, s := range m.Env { + l = len(s) + n += 1 + l + sovPlugin(uint64(l)) + } + } return n } @@ -429,6 +439,35 @@ func (m *PluginSpec) Unmarshal(dAtA []byte) error { } } m.Disabled = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlugin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPlugin + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Env = append(m.Env, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPlugin(dAtA[iNdEx:]) @@ -695,18 +734,21 @@ var ( func init() { proto.RegisterFile("plugin.proto", fileDescriptorPlugin) } var fileDescriptorPlugin = []byte{ - // 196 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0xc8, 0x29, 0x4d, - 0xcf, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x6a, 0x63, 0xe4, 0xe2, 0x0a, 0x00, 0x0b, - 0x04, 0x17, 0xa4, 0x26, 0x0b, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, - 0x6a, 0x70, 0x06, 0x81, 0xd9, 0x42, 0x62, 0x5c, 0x6c, 0x45, 0xa9, 0xb9, 0xf9, 0x25, 0xa9, 0x12, - 0x4c, 0x60, 0x51, 0x28, 0x4f, 0xc8, 0x80, 0x8b, 0xab, 0xa0, 0x28, 0xb3, 0x2c, 0x33, 0x27, 0x35, - 0x3d, 0xb5, 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x40, 0x0f, 0x62, 0x58, 0x00, 0x4c, - 0x22, 0x08, 0x49, 0x8d, 0x90, 0x14, 0x17, 0x47, 0x4a, 0x66, 0x71, 0x62, 0x52, 0x4e, 0x6a, 0x8a, - 0x04, 0x8b, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x9c, 0xaf, 0x14, 0xcb, 0xc5, 0x8f, 0xa6, 0x15, 0xab, - 0x63, 0x14, 0xb8, 0xb8, 0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0x32, 0xf3, 0xf3, 0xa0, - 0x2e, 0x42, 0x16, 0x12, 0x12, 0xe1, 0x62, 0x2d, 0x4b, 0xcc, 0x29, 0x4d, 0x05, 0xbb, 0x88, 0x33, - 0x08, 0xc2, 0x71, 0xe2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, - 0x18, 0x93, 0xd8, 0xc0, 0x9e, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x84, 0xad, 0x79, - 0x0c, 0x01, 0x00, 0x00, + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x4d, 0x4b, 0xc3, 0x30, + 0x18, 0xc7, 0x89, 0xdd, 0xc6, 0xfa, 0x4c, 0x70, 0x04, 0x91, 0xe2, 0xa1, 0x94, 0x9d, 0x7a, 0x6a, + 0x45, 0x2f, 0x82, 0x37, 0x0f, 0x9e, 0x47, 0xbc, 0x09, 0x1e, 0xd2, 0xf6, 0xa1, 0x06, 0x9b, 0x17, + 0x92, 0xb4, 0xe2, 0x37, 0xf1, 0x23, 0x79, 0xf4, 0x23, 0x48, 0x3f, 0x89, 0x98, 0x75, 0x32, 0x64, + 0xa7, 0xff, 0x4b, 0xc2, 0x9f, 0x1f, 0x0f, 0x9c, 0x9a, 0xae, 0x6f, 0x85, 0x2a, 0x8c, 0xd5, 0x5e, + 0x6f, 0x3e, 0x08, 0xc0, 0x36, 0x14, 0x8f, 0x06, 0x6b, 0x4a, 0x61, 0xa6, 0xb8, 0xc4, 0x84, 0x64, + 0x24, 0x8f, 0x59, 0xf0, 0xf4, 0x02, 0x16, 0x16, 0xa5, 0xf6, 0x98, 0x9c, 0x84, 0x76, 0x4a, 0xf4, + 0x0a, 0xc0, 0x58, 0x31, 0x88, 0x0e, 0x5b, 0x74, 0x49, 0x94, 0x45, 0xf9, 0xea, 0x7a, 0x5d, 0xec, + 0xc6, 0xb6, 0xfb, 0x07, 0x76, 0xf0, 0x87, 0x5e, 0xc2, 0xb2, 0x11, 0x8e, 0x57, 0x1d, 0x36, 0xc9, + 0x2c, 0x23, 0xf9, 0x92, 0xfd, 0x65, 0xba, 0x86, 0x08, 0xd5, 0x90, 0xcc, 0xb3, 0x28, 0x8f, 0xd9, + 0xaf, 0xdd, 0x3c, 0xc3, 0xd9, 0xbf, 0xb1, 0xa3, 0x78, 0x19, 0xac, 0x1a, 0x74, 0xb5, 0x15, 0xc6, + 0x0b, 0xad, 0x26, 0xc6, 0xc3, 0x8a, 0x9e, 0xc3, 0x7c, 0xe0, 0x5d, 0x8f, 0x81, 0x31, 0x66, 0xbb, + 0x70, 0xff, 0xf0, 0x39, 0xa6, 0xe4, 0x6b, 0x4c, 0xc9, 0xf7, 0x98, 0x92, 0xa7, 0xdb, 0x56, 0xf8, + 0x97, 0xbe, 0x2a, 0x6a, 0x2d, 0xcb, 0x46, 0xd7, 0xaf, 0x68, 0xf7, 0xc2, 0x8d, 0x28, 0xfd, 0xbb, + 0x41, 0x57, 0xba, 0x37, 0x6e, 0x65, 0x69, 0x7b, 0xe5, 0x85, 0xc4, 0xbb, 0x49, 0xab, 0x45, 0x38, + 0xe4, 0xcd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0xa8, 0xd9, 0x9b, 0x58, 0x01, 0x00, 0x00, } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto index 6d63b7783fd9..9ef169046b4f 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto @@ -9,6 +9,7 @@ message PluginSpec { string remote = 2; repeated PluginPrivilege privileges = 3; bool disabled = 4; + repeated string env = 5; } // PluginPrivilege describes a permission the user has to accept diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/service.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/service.go index abf192e75941..6eb452d24d12 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/service.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/service.go @@ -10,6 +10,17 @@ type Service struct { PreviousSpec *ServiceSpec `json:",omitempty"` Endpoint Endpoint `json:",omitempty"` UpdateStatus *UpdateStatus `json:",omitempty"` + + // ServiceStatus is an optional, extra field indicating the number of + // desired and running tasks. It is provided primarily as a shortcut to + // calculating these values client-side, which otherwise would require + // listing all tasks for a service, an operation that could be + // computation and network expensive. + ServiceStatus *ServiceStatus `json:",omitempty"` + + // JobStatus is the status of a Service which is in one of ReplicatedJob or + // GlobalJob modes. It is absent on Replicated and Global services. + JobStatus *JobStatus `json:",omitempty"` } // ServiceSpec represents the spec of a service. @@ -32,8 +43,10 @@ type ServiceSpec struct { // ServiceMode represents the mode of a service. type ServiceMode struct { - Replicated *ReplicatedService `json:",omitempty"` - Global *GlobalService `json:",omitempty"` + Replicated *ReplicatedService `json:",omitempty"` + Global *GlobalService `json:",omitempty"` + ReplicatedJob *ReplicatedJob `json:",omitempty"` + GlobalJob *GlobalJob `json:",omitempty"` } // UpdateState is the state of a service update. @@ -70,6 +83,32 @@ type ReplicatedService struct { // GlobalService is a kind of ServiceMode. type GlobalService struct{} +// ReplicatedJob is the a type of Service which executes a defined Tasks +// in parallel until the specified number of Tasks have succeeded. +type ReplicatedJob struct { + // MaxConcurrent indicates the maximum number of Tasks that should be + // executing simultaneously for this job at any given time. There may be + // fewer Tasks that MaxConcurrent executing simultaneously; for example, if + // there are fewer than MaxConcurrent tasks needed to reach + // TotalCompletions. + // + // If this field is empty, it will default to a max concurrency of 1. + MaxConcurrent *uint64 `json:",omitempty"` + + // TotalCompletions is the total number of Tasks desired to run to + // completion. + // + // If this field is empty, the value of MaxConcurrent will be used. + TotalCompletions *uint64 `json:",omitempty"` +} + +// GlobalJob is the type of a Service which executes a Task on every Node +// matching the Service's placement constraints. These tasks run to completion +// and then exit. +// +// This type is deliberately empty. +type GlobalJob struct{} + const ( // UpdateFailureActionPause PAUSE UpdateFailureActionPause = "pause" @@ -122,3 +161,42 @@ type UpdateConfig struct { // started, or the new task is started before the old task is shut down. Order string } + +// ServiceStatus represents the number of running tasks in a service and the +// number of tasks desired to be running. +type ServiceStatus struct { + // RunningTasks is the number of tasks for the service actually in the + // Running state + RunningTasks uint64 + + // DesiredTasks is the number of tasks desired to be running by the + // service. For replicated services, this is the replica count. For global + // services, this is computed by taking the number of tasks with desired + // state of not-Shutdown. + DesiredTasks uint64 + + // CompletedTasks is the number of tasks in the state Completed, if this + // service is in ReplicatedJob or GlobalJob mode. This field must be + // cross-referenced with the service type, because the default value of 0 + // may mean that a service is not in a job mode, or it may mean that the + // job has yet to complete any tasks. + CompletedTasks uint64 +} + +// JobStatus is the status of a job-type service. +type JobStatus struct { + // JobIteration is a value increased each time a Job is executed, + // successfully or otherwise. "Executed", in this case, means the job as a + // whole has been started, not that an individual Task has been launched. A + // job is "Executed" when its ServiceSpec is updated. JobIteration can be + // used to disambiguate Tasks belonging to different executions of a job. + // + // Though JobIteration will increase with each subsequent execution, it may + // not necessarily increase by 1, and so JobIteration should not be used to + // keep track of the number of times a job has been executed. + JobIteration Version + + // LastExecution is the time that the job was last executed, as observed by + // Swarm manager. + LastExecution time.Time `json:",omitempty"` +} diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/task.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/task.go index d5a57df5db5a..a6f7ab7b5c79 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/task.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/swarm/task.go @@ -56,6 +56,12 @@ type Task struct { DesiredState TaskState `json:",omitempty"` NetworksAttachments []NetworkAttachment `json:",omitempty"` GenericResources []GenericResource `json:",omitempty"` + + // JobIteration is the JobIteration of the Service that this Task was + // spawned from, if the Service is a ReplicatedJob or GlobalJob. This is + // used to determine which Tasks belong to which run of the job. This field + // is absent if the Service mode is Replicated or Global. + JobIteration *Version `json:",omitempty"` } // TaskSpec represents the spec of a task. @@ -85,13 +91,21 @@ type TaskSpec struct { Runtime RuntimeType `json:",omitempty"` } -// Resources represents resources (CPU/Memory). +// Resources represents resources (CPU/Memory) which can be advertised by a +// node and requested to be reserved for a task. type Resources struct { NanoCPUs int64 `json:",omitempty"` MemoryBytes int64 `json:",omitempty"` GenericResources []GenericResource `json:",omitempty"` } +// Limit describes limits on resources which can be requested by a task. +type Limit struct { + NanoCPUs int64 `json:",omitempty"` + MemoryBytes int64 `json:",omitempty"` + Pids int64 `json:",omitempty"` +} + // GenericResource represents a "user defined" resource which can // be either an integer (e.g: SSD=3) or a string (e.g: SSD=sda1) type GenericResource struct { @@ -119,7 +133,7 @@ type DiscreteGenericResource struct { // ResourceRequirements represents resources requirements. type ResourceRequirements struct { - Limits *Resources `json:",omitempty"` + Limits *Limit `json:",omitempty"` Reservations *Resources `json:",omitempty"` } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/types.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/types.go index a39ffcb7be2d..e3a159912e22 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/types.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/types.go @@ -39,6 +39,7 @@ type ImageInspect struct { Author string Config *container.Config Architecture string + Variant string `json:",omitempty"` Os string OsVersion string `json:",omitempty"` Size int64 @@ -153,11 +154,11 @@ type Info struct { Images int Driver string DriverStatus [][2]string - SystemStatus [][2]string + SystemStatus [][2]string `json:",omitempty"` // SystemStatus is only propagated by the Swarm standalone API Plugins PluginsInfo MemoryLimit bool SwapLimit bool - KernelMemory bool + KernelMemory bool // Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes KernelMemoryTCP bool CPUCfsPeriod bool `json:"CpuCfsPeriod"` CPUCfsQuota bool `json:"CpuCfsQuota"` @@ -174,9 +175,11 @@ type Info struct { SystemTime string LoggingDriver string CgroupDriver string + CgroupVersion string `json:",omitempty"` NEventsListener int KernelVersion string OperatingSystem string + OSVersion string OSType string Architecture string IndexServerAddress string @@ -192,23 +195,24 @@ type Info struct { Labels []string ExperimentalBuild bool ServerVersion string - ClusterStore string - ClusterAdvertise string + ClusterStore string `json:",omitempty"` // Deprecated: host-discovery and overlay networks with external k/v stores are deprecated + ClusterAdvertise string `json:",omitempty"` // Deprecated: host-discovery and overlay networks with external k/v stores are deprecated Runtimes map[string]Runtime DefaultRuntime string Swarm swarm.Info // LiveRestoreEnabled determines whether containers should be kept // running when the daemon is shutdown or upon daemon start if // running containers are detected - LiveRestoreEnabled bool - Isolation container.Isolation - InitBinary string - ContainerdCommit Commit - RuncCommit Commit - InitCommit Commit - SecurityOptions []string - ProductLicense string `json:",omitempty"` - Warnings []string + LiveRestoreEnabled bool + Isolation container.Isolation + InitBinary string + ContainerdCommit Commit + RuncCommit Commit + InitCommit Commit + SecurityOptions []string + ProductLicense string `json:",omitempty"` + DefaultAddressPools []NetworkAddressPool `json:",omitempty"` + Warnings []string } // KeyValue holds a key/value pair @@ -216,6 +220,12 @@ type KeyValue struct { Key, Value string } +// NetworkAddressPool is a temp struct used by Info struct +type NetworkAddressPool struct { + Base string + Size int +} + // SecurityOpt contains the name and options of a security option type SecurityOpt struct { Name string @@ -316,7 +326,7 @@ type ContainerState struct { } // ContainerNode stores information about the node that a container -// is running on. It's only available in Docker Swarm +// is running on. It's only used by the Docker Swarm standalone API type ContainerNode struct { ID string IPAddress string `json:"IP"` @@ -340,7 +350,7 @@ type ContainerJSONBase struct { HostnamePath string HostsPath string LogPath string - Node *ContainerNode `json:",omitempty"` + Node *ContainerNode `json:",omitempty"` // Node is only propagated by Docker Swarm standalone API Name string RestartCount int Driver string @@ -508,6 +518,16 @@ type Checkpoint struct { type Runtime struct { Path string `json:"path"` Args []string `json:"runtimeArgs,omitempty"` + + // This is exposed here only for internal use + // It is not currently supported to specify custom shim configs + Shim *ShimConfig `json:"-"` +} + +// ShimConfig is used by runtime to configure containerd shims +type ShimConfig struct { + Binary string + Opts interface{} } // DiskUsage contains response of Engine API: diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/volume/volume_create.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/volume/volume_create.go index 700aa804f851..8538078dd663 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/volume/volume_create.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/volume/volume_create.go @@ -1,8 +1,7 @@ package volume // import "github.com/docker/docker/api/types/volume" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/volume/volume_list.go b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/volume/volume_list.go index 5a79ad64370f..be06179bf488 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/api/types/volume/volume_list.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/api/types/volume/volume_list.go @@ -1,8 +1,7 @@ package volume // import "github.com/docker/docker/api/types/volume" // ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` +// Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/client.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/client.go index b63d4d6d4986..68064ca9c5f7 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/client.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/client.go @@ -7,8 +7,8 @@ https://docs.docker.com/engine/reference/api/ Usage You use the library by creating a client object and calling methods on it. The -client can be created either from environment variables with NewEnvClient, or -configured manually with NewClient. +client can be created either from environment variables with NewClientWithOpts(client.FromEnv), +or configured manually with NewClient(). For example, to list running containers (the equivalent of "docker ps"): @@ -252,7 +252,8 @@ func (cli *Client) DaemonHost() string { // HTTPClient returns a copy of the HTTP client bound to the server func (cli *Client) HTTPClient() *http.Client { - return &*cli.client + c := *cli.client + return &c } // ParseHostURL parses a url string, validates the string is a host url, and diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/client_unix.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/client_unix.go index 178ff67409a1..9d0f0dcbf0ba 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/client_unix.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/client_unix.go @@ -1,4 +1,4 @@ -// +build linux freebsd openbsd netbsd darwin dragonfly +// +build linux freebsd openbsd netbsd darwin solaris illumos dragonfly package client // import "github.com/docker/docker/client" diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/container_create.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/container_create.go index 5b795e0c17ce..b1d5fea5bd50 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/container_create.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/container_create.go @@ -5,20 +5,23 @@ import ( "encoding/json" "net/url" + "github.com/containerd/containerd/platforms" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" "github.com/docker/docker/api/types/versions" + specs "github.com/opencontainers/image-spec/specs-go/v1" ) type configWrapper struct { *container.Config HostConfig *container.HostConfig NetworkingConfig *network.NetworkingConfig + Platform *specs.Platform } // ContainerCreate creates a new container based in the given configuration. // It can be associated with a name, but it's not mandatory. -func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error) { +func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.ContainerCreateCreatedBody, error) { var response container.ContainerCreateCreatedBody if err := cli.NewVersionError("1.25", "stop timeout"); config != nil && config.StopTimeout != nil && err != nil { @@ -30,7 +33,15 @@ func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config hostConfig.AutoRemove = false } + if err := cli.NewVersionError("1.41", "specify container image platform"); platform != nil && err != nil { + return response, err + } + query := url.Values{} + if platform != nil { + query.Set("platform", platforms.Format(*platform)) + } + if containerName != "" { query.Set("name", containerName) } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/container_list.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/container_list.go index 1e7a63a9c066..a973de597fdf 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/container_list.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/container_list.go @@ -35,6 +35,7 @@ func (cli *Client) ContainerList(ctx context.Context, options types.ContainerLis } if options.Filters.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/container_stats.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/container_stats.go index 6ef44c77480c..0a6488dde826 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/container_stats.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/container_stats.go @@ -24,3 +24,19 @@ func (cli *Client) ContainerStats(ctx context.Context, containerID string, strea osType := getDockerOS(resp.header.Get("Server")) return types.ContainerStats{Body: resp.body, OSType: osType}, err } + +// ContainerStatsOneShot gets a single stat entry from a container. +// It differs from `ContainerStats` in that the API should not wait to prime the stats +func (cli *Client) ContainerStatsOneShot(ctx context.Context, containerID string) (types.ContainerStats, error) { + query := url.Values{} + query.Set("stream", "0") + query.Set("one-shot", "1") + + resp, err := cli.get(ctx, "/containers/"+containerID+"/stats", query, nil) + if err != nil { + return types.ContainerStats{}, err + } + + osType := getDockerOS(resp.header.Get("Server")) + return types.ContainerStats{Body: resp.body, OSType: osType}, err +} diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/errors.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/errors.go index 001c10288141..041bc8d49c44 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/errors.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/errors.go @@ -24,8 +24,7 @@ func (err errConnectionFailed) Error() string { // IsErrConnectionFailed returns true if the error is caused by connection failed. func IsErrConnectionFailed(err error) bool { - _, ok := errors.Cause(err).(errConnectionFailed) - return ok + return errors.As(err, &errConnectionFailed{}) } // ErrorConnectionFailed returns an error with host in the error message when connection to docker daemon failed. @@ -42,8 +41,9 @@ type notFound interface { // IsErrNotFound returns true if the error is a NotFound error, which is returned // by the API when some object is not found. func IsErrNotFound(err error) bool { - if _, ok := err.(notFound); ok { - return ok + var e notFound + if errors.As(err, &e) { + return true } return errdefs.IsNotFound(err) } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/events.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/events.go index 6e56538955ee..f0dc9d9e12f3 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/events.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/events.go @@ -90,6 +90,7 @@ func buildEventsQueryParams(cliVersion string, options types.EventsOptions) (url } if options.Filters.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cliVersion, options.Filters) if err != nil { return nil, err diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/hijack.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/hijack.go index e9c9a752f83f..e1dc49ef0f66 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/hijack.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/hijack.go @@ -24,7 +24,7 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu } apiPath := cli.getAPIPath(ctx, path, query) - req, err := http.NewRequest("POST", apiPath, bodyEncoded) + req, err := http.NewRequest(http.MethodPost, apiPath, bodyEncoded) if err != nil { return types.HijackedResponse{}, err } @@ -40,7 +40,7 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu // DialHijack returns a hijacked connection with negotiated protocol proto. func (cli *Client) DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error) { - req, err := http.NewRequest("POST", url, nil) + req, err := http.NewRequest(http.MethodPost, url, nil) if err != nil { return nil, err } @@ -87,6 +87,8 @@ func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto // Server hijacks the connection, error 'connection closed' expected resp, err := clientconn.Do(req) + + //nolint:staticcheck // ignore SA1019 for connecting to old (pre go1.8) daemons if err != httputil.ErrPersistEOF { if err != nil { return nil, err diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/image_import.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/image_import.go index c2972ea950eb..d3336d4106a9 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/image_import.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/image_import.go @@ -14,7 +14,7 @@ import ( // It returns the JSON content in the response body. func (cli *Client) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { if ref != "" { - //Check if the given image name can be resolved + // Check if the given image name can be resolved if _, err := reference.ParseNormalizedNamed(ref); err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/image_list.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/image_list.go index 4fa8c006b2ea..a4d7505094cd 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/image_list.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/image_list.go @@ -24,6 +24,7 @@ func (cli *Client) ImageList(ctx context.Context, options types.ImageListOptions } } if optionFilters.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, optionFilters) if err != nil { return images, err diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/image_push.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/image_push.go index 49d412ee375c..845580d4a4cd 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/image_push.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/image_push.go @@ -25,15 +25,14 @@ func (cli *Client) ImagePush(ctx context.Context, image string, options types.Im return nil, errors.New("cannot push a digest reference") } - tag := "" name := reference.FamiliarName(ref) - - if nameTaggedRef, isNamedTagged := ref.(reference.NamedTagged); isNamedTagged { - tag = nameTaggedRef.Tag() - } - query := url.Values{} - query.Set("tag", tag) + if !options.All { + ref = reference.TagNameOnly(ref) + if tagged, ok := ref.(reference.Tagged); ok { + query.Set("tag", tagged.Tag()) + } + } resp, err := cli.tryImagePush(ctx, name, query, options.RegistryAuth) if errdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil { diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/interface.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/interface.go index cde64be4b56b..aabad4a91105 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/interface.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/interface.go @@ -16,6 +16,7 @@ import ( "github.com/docker/docker/api/types/registry" "github.com/docker/docker/api/types/swarm" volumetypes "github.com/docker/docker/api/types/volume" + specs "github.com/opencontainers/image-spec/specs-go/v1" ) // CommonAPIClient is the common methods between stable and experimental versions of APIClient. @@ -47,7 +48,7 @@ type CommonAPIClient interface { type ContainerAPIClient interface { ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error) - ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, containerName string) (containertypes.ContainerCreateCreatedBody, error) + ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, platform *specs.Platform, containerName string) (containertypes.ContainerCreateCreatedBody, error) ContainerDiff(ctx context.Context, container string) ([]containertypes.ContainerChangeResponseItem, error) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error) @@ -67,6 +68,7 @@ type ContainerAPIClient interface { ContainerRestart(ctx context.Context, container string, timeout *time.Duration) error ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error) + ContainerStatsOneShot(ctx context.Context, container string) (types.ContainerStats, error) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error ContainerStop(ctx context.Context, container string, timeout *time.Duration) error ContainerTop(ctx context.Context, container string, arguments []string) (containertypes.ContainerTopOKBody, error) diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/network_list.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/network_list.go index 7130c1364eb2..ed2acb55711d 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/network_list.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/network_list.go @@ -13,6 +13,7 @@ import ( func (cli *Client) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) { query := url.Values{} if options.Filters.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) if err != nil { return nil, err diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/ping.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/ping.go index 90f39ec14f92..a9af001ef46b 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/ping.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/ping.go @@ -17,9 +17,9 @@ func (cli *Client) Ping(ctx context.Context) (types.Ping, error) { var ping types.Ping // Using cli.buildRequest() + cli.doRequest() instead of cli.sendRequest() - // because ping requests are used during API version negotiation, so we want + // because ping requests are used during API version negotiation, so we want // to hit the non-versioned /_ping endpoint, not /v1.xx/_ping - req, err := cli.buildRequest("HEAD", path.Join(cli.basePath, "/_ping"), nil, nil) + req, err := cli.buildRequest(http.MethodHead, path.Join(cli.basePath, "/_ping"), nil, nil) if err != nil { return ping, err } @@ -35,7 +35,7 @@ func (cli *Client) Ping(ctx context.Context) (types.Ping, error) { return ping, err } - req, err = cli.buildRequest("GET", path.Join(cli.basePath, "/_ping"), nil, nil) + req, err = cli.buildRequest(http.MethodGet, path.Join(cli.basePath, "/_ping"), nil, nil) if err != nil { return ping, err } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/plugin_list.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/plugin_list.go index 8285cecd6e17..cf1935e2f5ee 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/plugin_list.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/plugin_list.go @@ -15,6 +15,7 @@ func (cli *Client) PluginList(ctx context.Context, filter filters.Args) (types.P query := url.Values{} if filter.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, filter) if err != nil { return plugins, err diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/request.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/request.go index 44e0a22c4f60..813eac2c9e0c 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/request.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/request.go @@ -29,12 +29,12 @@ type serverResponse struct { // head sends an http request to the docker API using the method HEAD. func (cli *Client) head(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "HEAD", path, query, nil, headers) + return cli.sendRequest(ctx, http.MethodHead, path, query, nil, headers) } // get sends an http request to the docker API using the method GET with a specific Go context. func (cli *Client) get(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "GET", path, query, nil, headers) + return cli.sendRequest(ctx, http.MethodGet, path, query, nil, headers) } // post sends an http request to the docker API using the method POST with a specific Go context. @@ -43,30 +43,21 @@ func (cli *Client) post(ctx context.Context, path string, query url.Values, obj if err != nil { return serverResponse{}, err } - return cli.sendRequest(ctx, "POST", path, query, body, headers) + return cli.sendRequest(ctx, http.MethodPost, path, query, body, headers) } func (cli *Client) postRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "POST", path, query, body, headers) -} - -// put sends an http request to the docker API using the method PUT. -func (cli *Client) put(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (serverResponse, error) { - body, headers, err := encodeBody(obj, headers) - if err != nil { - return serverResponse{}, err - } - return cli.sendRequest(ctx, "PUT", path, query, body, headers) + return cli.sendRequest(ctx, http.MethodPost, path, query, body, headers) } // putRaw sends an http request to the docker API using the method PUT. func (cli *Client) putRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "PUT", path, query, body, headers) + return cli.sendRequest(ctx, http.MethodPut, path, query, body, headers) } // delete sends an http request to the docker API using the method DELETE. func (cli *Client) delete(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "DELETE", path, query, nil, headers) + return cli.sendRequest(ctx, http.MethodDelete, path, query, nil, headers) } type headers map[string][]string @@ -88,7 +79,7 @@ func encodeBody(obj interface{}, headers headers) (io.Reader, headers, error) { } func (cli *Client) buildRequest(method, path string, body io.Reader, headers headers) (*http.Request, error) { - expectedPayload := (method == "POST" || method == "PUT") + expectedPayload := (method == http.MethodPost || method == http.MethodPut) if expectedPayload && body == nil { body = bytes.NewReader([]byte{}) } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/service_create.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/service_create.go index 620fc6cff757..e0428bf98b3c 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/service_create.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/service_create.go @@ -9,14 +9,13 @@ import ( "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "github.com/opencontainers/go-digest" + digest "github.com/opencontainers/go-digest" "github.com/pkg/errors" ) // ServiceCreate creates a new Service. func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) { - var distErr error - + var response types.ServiceCreateResponse headers := map[string][]string{ "version": {cli.version}, } @@ -31,46 +30,28 @@ func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, } if err := validateServiceSpec(service); err != nil { - return types.ServiceCreateResponse{}, err + return response, err } // ensure that the image is tagged - var imgPlatforms []swarm.Platform - if service.TaskTemplate.ContainerSpec != nil { + var resolveWarning string + switch { + case service.TaskTemplate.ContainerSpec != nil: if taggedImg := imageWithTagString(service.TaskTemplate.ContainerSpec.Image); taggedImg != "" { service.TaskTemplate.ContainerSpec.Image = taggedImg } if options.QueryRegistry { - var img string - img, imgPlatforms, distErr = imageDigestAndPlatforms(ctx, cli, service.TaskTemplate.ContainerSpec.Image, options.EncodedRegistryAuth) - if img != "" { - service.TaskTemplate.ContainerSpec.Image = img - } + resolveWarning = resolveContainerSpecImage(ctx, cli, &service.TaskTemplate, options.EncodedRegistryAuth) } - } - - // ensure that the image is tagged - if service.TaskTemplate.PluginSpec != nil { + case service.TaskTemplate.PluginSpec != nil: if taggedImg := imageWithTagString(service.TaskTemplate.PluginSpec.Remote); taggedImg != "" { service.TaskTemplate.PluginSpec.Remote = taggedImg } if options.QueryRegistry { - var img string - img, imgPlatforms, distErr = imageDigestAndPlatforms(ctx, cli, service.TaskTemplate.PluginSpec.Remote, options.EncodedRegistryAuth) - if img != "" { - service.TaskTemplate.PluginSpec.Remote = img - } + resolveWarning = resolvePluginSpecRemote(ctx, cli, &service.TaskTemplate, options.EncodedRegistryAuth) } } - if service.TaskTemplate.Placement == nil && len(imgPlatforms) > 0 { - service.TaskTemplate.Placement = &swarm.Placement{} - } - if len(imgPlatforms) > 0 { - service.TaskTemplate.Placement.Platforms = imgPlatforms - } - - var response types.ServiceCreateResponse resp, err := cli.post(ctx, "/services/create", nil, service, headers) defer ensureReaderClosed(resp) if err != nil { @@ -78,14 +59,45 @@ func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, } err = json.NewDecoder(resp.body).Decode(&response) - - if distErr != nil { - response.Warnings = append(response.Warnings, digestWarning(service.TaskTemplate.ContainerSpec.Image)) + if resolveWarning != "" { + response.Warnings = append(response.Warnings, resolveWarning) } return response, err } +func resolveContainerSpecImage(ctx context.Context, cli DistributionAPIClient, taskSpec *swarm.TaskSpec, encodedAuth string) string { + var warning string + if img, imgPlatforms, err := imageDigestAndPlatforms(ctx, cli, taskSpec.ContainerSpec.Image, encodedAuth); err != nil { + warning = digestWarning(taskSpec.ContainerSpec.Image) + } else { + taskSpec.ContainerSpec.Image = img + if len(imgPlatforms) > 0 { + if taskSpec.Placement == nil { + taskSpec.Placement = &swarm.Placement{} + } + taskSpec.Placement.Platforms = imgPlatforms + } + } + return warning +} + +func resolvePluginSpecRemote(ctx context.Context, cli DistributionAPIClient, taskSpec *swarm.TaskSpec, encodedAuth string) string { + var warning string + if img, imgPlatforms, err := imageDigestAndPlatforms(ctx, cli, taskSpec.PluginSpec.Remote, encodedAuth); err != nil { + warning = digestWarning(taskSpec.PluginSpec.Remote) + } else { + taskSpec.PluginSpec.Remote = img + if len(imgPlatforms) > 0 { + if taskSpec.Placement == nil { + taskSpec.Placement = &swarm.Placement{} + } + taskSpec.Placement.Platforms = imgPlatforms + } + } + return warning +} + func imageDigestAndPlatforms(ctx context.Context, cli DistributionAPIClient, image, encodedAuth string) (string, []swarm.Platform, error) { distributionInspect, err := cli.DistributionInspect(ctx, image, encodedAuth) var platforms []swarm.Platform @@ -119,7 +131,7 @@ func imageDigestAndPlatforms(ctx context.Context, cli DistributionAPIClient, ima // imageWithDigestString takes an image string and a digest, and updates // the image string if it didn't originally contain a digest. It returns -// an empty string if there are no updates. +// image unmodified in other situations. func imageWithDigestString(image string, dgst digest.Digest) string { namedRef, err := reference.ParseNormalizedNamed(image) if err == nil { @@ -131,7 +143,7 @@ func imageWithDigestString(image string, dgst digest.Digest) string { } } } - return "" + return image } // imageWithTagString takes an image string, and returns a tagged image diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/service_list.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/service_list.go index 64d35e715982..f97ec75a5cb7 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/service_list.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/service_list.go @@ -23,6 +23,10 @@ func (cli *Client) ServiceList(ctx context.Context, options types.ServiceListOpt query.Set("filters", filterJSON) } + if options.Status { + query.Set("status", "true") + } + resp, err := cli.get(ctx, "/services", query, nil) defer ensureReaderClosed(resp) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/service_update.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/service_update.go index cd0f59e21338..c63895f74f25 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/service_update.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/service_update.go @@ -15,8 +15,8 @@ import ( // of swarm.Service, which can be found using ServiceInspectWithRaw. func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) { var ( - query = url.Values{} - distErr error + query = url.Values{} + response = types.ServiceUpdateResponse{} ) headers := map[string][]string{ @@ -38,46 +38,28 @@ func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version query.Set("version", strconv.FormatUint(version.Index, 10)) if err := validateServiceSpec(service); err != nil { - return types.ServiceUpdateResponse{}, err + return response, err } - var imgPlatforms []swarm.Platform // ensure that the image is tagged - if service.TaskTemplate.ContainerSpec != nil { + var resolveWarning string + switch { + case service.TaskTemplate.ContainerSpec != nil: if taggedImg := imageWithTagString(service.TaskTemplate.ContainerSpec.Image); taggedImg != "" { service.TaskTemplate.ContainerSpec.Image = taggedImg } if options.QueryRegistry { - var img string - img, imgPlatforms, distErr = imageDigestAndPlatforms(ctx, cli, service.TaskTemplate.ContainerSpec.Image, options.EncodedRegistryAuth) - if img != "" { - service.TaskTemplate.ContainerSpec.Image = img - } + resolveWarning = resolveContainerSpecImage(ctx, cli, &service.TaskTemplate, options.EncodedRegistryAuth) } - } - - // ensure that the image is tagged - if service.TaskTemplate.PluginSpec != nil { + case service.TaskTemplate.PluginSpec != nil: if taggedImg := imageWithTagString(service.TaskTemplate.PluginSpec.Remote); taggedImg != "" { service.TaskTemplate.PluginSpec.Remote = taggedImg } if options.QueryRegistry { - var img string - img, imgPlatforms, distErr = imageDigestAndPlatforms(ctx, cli, service.TaskTemplate.PluginSpec.Remote, options.EncodedRegistryAuth) - if img != "" { - service.TaskTemplate.PluginSpec.Remote = img - } + resolveWarning = resolvePluginSpecRemote(ctx, cli, &service.TaskTemplate, options.EncodedRegistryAuth) } } - if service.TaskTemplate.Placement == nil && len(imgPlatforms) > 0 { - service.TaskTemplate.Placement = &swarm.Placement{} - } - if len(imgPlatforms) > 0 { - service.TaskTemplate.Placement.Platforms = imgPlatforms - } - - var response types.ServiceUpdateResponse resp, err := cli.post(ctx, "/services/"+serviceID+"/update", query, service, headers) defer ensureReaderClosed(resp) if err != nil { @@ -85,9 +67,8 @@ func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version } err = json.NewDecoder(resp.body).Decode(&response) - - if distErr != nil { - response.Warnings = append(response.Warnings, digestWarning(service.TaskTemplate.ContainerSpec.Image)) + if resolveWarning != "" { + response.Warnings = append(response.Warnings, resolveWarning) } return response, err diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/client/volume_list.go b/cluster-autoscaler/vendor/github.com/docker/docker/client/volume_list.go index 2380d5638215..942498dde2c7 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/client/volume_list.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/client/volume_list.go @@ -15,6 +15,7 @@ func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (volumet query := url.Values{} if filter.Len() > 0 { + //nolint:staticcheck // ignore SA1019 for old code filterJSON, err := filters.ToParamWithVersion(cli.version, filter) if err != nil { return volumes, err diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/errdefs/helpers.go b/cluster-autoscaler/vendor/github.com/docker/docker/errdefs/helpers.go index c9916e01354e..fe06fb6f703b 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/errdefs/helpers.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/errdefs/helpers.go @@ -10,6 +10,10 @@ func (e errNotFound) Cause() error { return e.error } +func (e errNotFound) Unwrap() error { + return e.error +} + // NotFound is a helper to create an error of the class with the same name from any error type func NotFound(err error) error { if err == nil || IsNotFound(err) { @@ -26,6 +30,10 @@ func (e errInvalidParameter) Cause() error { return e.error } +func (e errInvalidParameter) Unwrap() error { + return e.error +} + // InvalidParameter is a helper to create an error of the class with the same name from any error type func InvalidParameter(err error) error { if err == nil || IsInvalidParameter(err) { @@ -42,6 +50,10 @@ func (e errConflict) Cause() error { return e.error } +func (e errConflict) Unwrap() error { + return e.error +} + // Conflict is a helper to create an error of the class with the same name from any error type func Conflict(err error) error { if err == nil || IsConflict(err) { @@ -58,6 +70,10 @@ func (e errUnauthorized) Cause() error { return e.error } +func (e errUnauthorized) Unwrap() error { + return e.error +} + // Unauthorized is a helper to create an error of the class with the same name from any error type func Unauthorized(err error) error { if err == nil || IsUnauthorized(err) { @@ -74,6 +90,10 @@ func (e errUnavailable) Cause() error { return e.error } +func (e errUnavailable) Unwrap() error { + return e.error +} + // Unavailable is a helper to create an error of the class with the same name from any error type func Unavailable(err error) error { if err == nil || IsUnavailable(err) { @@ -90,6 +110,10 @@ func (e errForbidden) Cause() error { return e.error } +func (e errForbidden) Unwrap() error { + return e.error +} + // Forbidden is a helper to create an error of the class with the same name from any error type func Forbidden(err error) error { if err == nil || IsForbidden(err) { @@ -106,6 +130,10 @@ func (e errSystem) Cause() error { return e.error } +func (e errSystem) Unwrap() error { + return e.error +} + // System is a helper to create an error of the class with the same name from any error type func System(err error) error { if err == nil || IsSystem(err) { @@ -122,6 +150,10 @@ func (e errNotModified) Cause() error { return e.error } +func (e errNotModified) Unwrap() error { + return e.error +} + // NotModified is a helper to create an error of the class with the same name from any error type func NotModified(err error) error { if err == nil || IsNotModified(err) { @@ -138,6 +170,10 @@ func (e errNotImplemented) Cause() error { return e.error } +func (e errNotImplemented) Unwrap() error { + return e.error +} + // NotImplemented is a helper to create an error of the class with the same name from any error type func NotImplemented(err error) error { if err == nil || IsNotImplemented(err) { @@ -154,6 +190,10 @@ func (e errUnknown) Cause() error { return e.error } +func (e errUnknown) Unwrap() error { + return e.error +} + // Unknown is a helper to create an error of the class with the same name from any error type func Unknown(err error) error { if err == nil || IsUnknown(err) { @@ -170,6 +210,10 @@ func (e errCancelled) Cause() error { return e.error } +func (e errCancelled) Unwrap() error { + return e.error +} + // Cancelled is a helper to create an error of the class with the same name from any error type func Cancelled(err error) error { if err == nil || IsCancelled(err) { @@ -186,6 +230,10 @@ func (e errDeadline) Cause() error { return e.error } +func (e errDeadline) Unwrap() error { + return e.error +} + // Deadline is a helper to create an error of the class with the same name from any error type func Deadline(err error) error { if err == nil || IsDeadline(err) { @@ -202,6 +250,10 @@ func (e errDataLoss) Cause() error { return e.error } +func (e errDataLoss) Unwrap() error { + return e.error +} + // DataLoss is a helper to create an error of the class with the same name from any error type func DataLoss(err error) error { if err == nil || IsDataLoss(err) { diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/jsonmessage/jsonmessage.go b/cluster-autoscaler/vendor/github.com/docker/docker/pkg/jsonmessage/jsonmessage.go index a68b566cea2c..cf8d04b1b201 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/jsonmessage/jsonmessage.go +++ b/cluster-autoscaler/vendor/github.com/docker/docker/pkg/jsonmessage/jsonmessage.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/docker/docker/pkg/term" - "github.com/docker/go-units" + units "github.com/docker/go-units" + "github.com/moby/term" "github.com/morikuni/aec" ) @@ -139,13 +139,13 @@ type JSONMessage struct { Stream string `json:"stream,omitempty"` Status string `json:"status,omitempty"` Progress *JSONProgress `json:"progressDetail,omitempty"` - ProgressMessage string `json:"progress,omitempty"` //deprecated + ProgressMessage string `json:"progress,omitempty"` // deprecated ID string `json:"id,omitempty"` From string `json:"from,omitempty"` Time int64 `json:"time,omitempty"` TimeNano int64 `json:"timeNano,omitempty"` Error *JSONError `json:"errorDetail,omitempty"` - ErrorMessage string `json:"error,omitempty"` //deprecated + ErrorMessage string `json:"error,omitempty"` // deprecated // Aux contains out-of-band data, such as digests for push signing and image id after building. Aux *json.RawMessage `json:"aux,omitempty"` } @@ -177,8 +177,8 @@ func (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error { if isTerminal && jm.Stream == "" && jm.Progress != nil { clearLine(out) endl = "\r" - fmt.Fprintf(out, endl) - } else if jm.Progress != nil && jm.Progress.String() != "" { //disable progressbar in non-terminal + fmt.Fprint(out, endl) + } else if jm.Progress != nil && jm.Progress.String() != "" { // disable progressbar in non-terminal return nil } if jm.TimeNano != 0 { @@ -194,7 +194,7 @@ func (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error { } if jm.Progress != nil && isTerminal { fmt.Fprintf(out, "%s %s%s", jm.Status, jm.Progress.String(), endl) - } else if jm.ProgressMessage != "" { //deprecated + } else if jm.ProgressMessage != "" { // deprecated fmt.Fprintf(out, "%s %s%s", jm.Status, jm.ProgressMessage, endl) } else if jm.Stream != "" { fmt.Fprintf(out, "%s%s", jm.Stream, endl) diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/proxy.go b/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/proxy.go deleted file mode 100644 index da733e58484c..000000000000 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/proxy.go +++ /dev/null @@ -1,78 +0,0 @@ -package term // import "github.com/docker/docker/pkg/term" - -import ( - "io" -) - -// EscapeError is special error which returned by a TTY proxy reader's Read() -// method in case its detach escape sequence is read. -type EscapeError struct{} - -func (EscapeError) Error() string { - return "read escape sequence" -} - -// escapeProxy is used only for attaches with a TTY. It is used to proxy -// stdin keypresses from the underlying reader and look for the passed in -// escape key sequence to signal a detach. -type escapeProxy struct { - escapeKeys []byte - escapeKeyPos int - r io.Reader -} - -// NewEscapeProxy returns a new TTY proxy reader which wraps the given reader -// and detects when the specified escape keys are read, in which case the Read -// method will return an error of type EscapeError. -func NewEscapeProxy(r io.Reader, escapeKeys []byte) io.Reader { - return &escapeProxy{ - escapeKeys: escapeKeys, - r: r, - } -} - -func (r *escapeProxy) Read(buf []byte) (int, error) { - nr, err := r.r.Read(buf) - - if len(r.escapeKeys) == 0 { - return nr, err - } - - preserve := func() { - // this preserves the original key presses in the passed in buffer - nr += r.escapeKeyPos - preserve := make([]byte, 0, r.escapeKeyPos+len(buf)) - preserve = append(preserve, r.escapeKeys[:r.escapeKeyPos]...) - preserve = append(preserve, buf...) - r.escapeKeyPos = 0 - copy(buf[0:nr], preserve) - } - - if nr != 1 || err != nil { - if r.escapeKeyPos > 0 { - preserve() - } - return nr, err - } - - if buf[0] != r.escapeKeys[r.escapeKeyPos] { - if r.escapeKeyPos > 0 { - preserve() - } - return nr, nil - } - - if r.escapeKeyPos == len(r.escapeKeys)-1 { - return 0, EscapeError{} - } - - // Looks like we've got an escape key, but we need to match again on the next - // read. - // Store the current escape key we found so we can look for the next one on - // the next read. - // Since this is an escape key, make sure we don't let the caller read it - // If later on we find that this is not the escape sequence, we'll add the - // keys back - r.escapeKeyPos++ - return nr - r.escapeKeyPos, nil -} diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/tc.go b/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/tc.go deleted file mode 100644 index 01bcaa8abb18..000000000000 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/tc.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build !windows - -package term // import "github.com/docker/docker/pkg/term" - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/unix" -) - -func tcget(fd uintptr, p *Termios) syscall.Errno { - _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p))) - return err -} - -func tcset(fd uintptr, p *Termios) syscall.Errno { - _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p))) - return err -} diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/termios_bsd.go b/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/termios_bsd.go deleted file mode 100644 index 48b16f52039c..000000000000 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/termios_bsd.go +++ /dev/null @@ -1,42 +0,0 @@ -// +build darwin freebsd openbsd netbsd - -package term // import "github.com/docker/docker/pkg/term" - -import ( - "unsafe" - - "golang.org/x/sys/unix" -) - -const ( - getTermios = unix.TIOCGETA - setTermios = unix.TIOCSETA -) - -// Termios is the Unix API for terminal I/O. -type Termios unix.Termios - -// MakeRaw put the terminal connected to the given file descriptor into raw -// mode and returns the previous state of the terminal so that it can be -// restored. -func MakeRaw(fd uintptr) (*State, error) { - var oldState State - if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, getTermios, uintptr(unsafe.Pointer(&oldState.termios))); err != 0 { - return nil, err - } - - newState := oldState.termios - newState.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON) - newState.Oflag &^= unix.OPOST - newState.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN) - newState.Cflag &^= (unix.CSIZE | unix.PARENB) - newState.Cflag |= unix.CS8 - newState.Cc[unix.VMIN] = 1 - newState.Cc[unix.VTIME] = 0 - - if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(&newState))); err != 0 { - return nil, err - } - - return &oldState, nil -} diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/windows.go b/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/windows.go deleted file mode 100644 index 3e5593ca6a68..000000000000 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/windows.go +++ /dev/null @@ -1,33 +0,0 @@ -// These files implement ANSI-aware input and output streams for use by the Docker Windows client. -// When asked for the set of standard streams (e.g., stdin, stdout, stderr), the code will create -// and return pseudo-streams that convert ANSI sequences to / from Windows Console API calls. - -package windowsconsole // import "github.com/docker/docker/pkg/term/windows" - -import ( - "io/ioutil" - "os" - "sync" - - "github.com/Azure/go-ansiterm" - "github.com/sirupsen/logrus" -) - -var logger *logrus.Logger -var initOnce sync.Once - -func initLogger() { - initOnce.Do(func() { - logFile := ioutil.Discard - - if isDebugEnv := os.Getenv(ansiterm.LogEnv); isDebugEnv == "1" { - logFile, _ = os.Create("ansiReaderWriter.log") - } - - logger = &logrus.Logger{ - Out: logFile, - Formatter: new(logrus.TextFormatter), - Level: logrus.DebugLevel, - } - }) -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/.editorconfig b/cluster-autoscaler/vendor/github.com/go-openapi/spec/.editorconfig deleted file mode 100644 index 3152da69a5d7..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/.golangci.yml b/cluster-autoscaler/vendor/github.com/go-openapi/spec/.golangci.yml deleted file mode 100644 index 4e17ed4979b4..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/.golangci.yml +++ /dev/null @@ -1,28 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 45 - maligned: - suggest-new: true - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 2 - -linters: - enable-all: true - disable: - - maligned - - unparam - - lll - - gochecknoinits - - gochecknoglobals - - funlen - - godox - - gocognit - - whitespace - - wsl diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/.travis.yml b/cluster-autoscaler/vendor/github.com/go-openapi/spec/.travis.yml deleted file mode 100644 index aa26d8763aa3..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.11.x -- 1.12.x -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -env: -- GO111MODULE=on -language: go -notifications: - slack: - secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md b/cluster-autoscaler/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065e37a..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/README.md b/cluster-autoscaler/vendor/github.com/go-openapi/spec/README.md deleted file mode 100644 index 6354742cbf62..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# OAI object model [![Build Status](https://travis-ci.org/go-openapi/spec.svg?branch=master)](https://travis-ci.org/go-openapi/spec) [![codecov](https://codecov.io/gh/go-openapi/spec/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/spec) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/spec/master/LICENSE) -[![GoDoc](https://godoc.org/github.com/go-openapi/spec?status.svg)](http://godoc.org/github.com/go-openapi/spec) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/spec.svg)](https://golangci.com) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/spec)](https://goreportcard.com/report/github.com/go-openapi/spec) - -The object model for OpenAPI specification documents. - -Currently supports Swagger 2.0. diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/bindata.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/bindata.go deleted file mode 100644 index 66b1f32635d6..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/bindata.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by go-bindata. DO NOT EDIT. -// sources: -// schemas/jsonschema-draft-04.json (4.357kB) -// schemas/v2/schema.json (40.248kB) - -package spec - -import ( - "bytes" - "compress/gzip" - "crypto/sha256" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo - digest [sha256.Size]byte -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -func (fi bindataFileInfo) Name() string { - return fi.name -} -func (fi bindataFileInfo) Size() int64 { - return fi.size -} -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} -func (fi bindataFileInfo) IsDir() bool { - return false -} -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _jsonschemaDraft04Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x3d\x6f\xdb\x3c\x10\xde\xf3\x2b\x08\x26\x63\xf2\x2a\x2f\xd0\xc9\x5b\xd1\x2e\x01\x5a\x34\x43\x37\x23\x03\x6d\x9d\x6c\x06\x14\xa9\x50\x54\x60\xc3\xd0\x7f\x2f\x28\x4a\x14\x29\x91\x92\x2d\xa7\x8d\x97\x28\xbc\xaf\xe7\x8e\xf7\xc5\xd3\x0d\x42\x08\x61\x9a\xe2\x15\xc2\x7b\xa5\x8a\x55\x92\xbc\x96\x82\x3f\x94\xdb\x3d\xe4\xe4\x3f\x21\x77\x49\x2a\x49\xa6\x1e\x1e\xbf\x24\xe6\xec\x16\xdf\x1b\xa1\x3b\xf3\xff\x02\xc9\x14\xca\xad\xa4\x85\xa2\x82\x6b\xe9\x6f\x42\x02\x32\x2c\x28\x07\x45\x5a\x15\x3d\x77\x46\x39\xd5\xcc\x25\x5e\x21\x83\xb8\x21\x18\xb6\xaf\x52\x92\xa3\x47\x68\x88\xea\x58\x80\x56\x4e\x1a\xf2\xbd\x4f\xcc\x29\x7f\x52\x90\x6b\x7d\xff\x0f\x48\xb4\x3d\x3f\x21\x7c\x27\x21\xd3\x2a\x6e\x31\xaa\x2d\x53\xdd\xf3\xe3\x42\x94\x54\xd1\x77\x78\xe2\x0a\x76\x20\xe3\x20\x68\xcb\x30\x86\x41\xf3\x2a\xc7\x2b\xf4\x78\x8e\xfe\xef\x90\x91\x8a\xa9\xc7\xb1\x1d\xc2\xd8\x2f\x0d\x75\xed\xc1\x4e\x9c\xc8\x25\x43\xac\xa8\xbe\xd7\xcc\xa9\xd1\xa9\x21\xa0\x1a\xbd\x04\x61\x94\x34\x2f\x18\xfc\x3e\x16\x50\x8e\x4d\x03\x6f\x1c\x58\xdb\x48\x23\xbc\x11\x82\x01\xe1\xfa\xd3\x3a\x8e\x30\xaf\x18\x33\x7f\xf3\x8d\x39\x11\x9b\x57\xd8\x2a\xfd\x55\x2a\x49\xf9\x0e\xc7\xec\x37\xd4\x25\xf7\xec\x5c\x66\xc7\xd7\x99\xaa\xcf\x4f\x89\x8a\xd3\xb7\x0a\x3a\xaa\x92\x15\xf4\x30\x6f\x1c\xb0\xd6\x46\xe7\x98\x39\x2d\xa4\x28\x40\x2a\x3a\x88\x9e\x29\xba\x88\x37\x2d\xca\x60\x38\xfa\xba\x5b\x20\xac\xa8\x62\xb0\x4c\xd4\xaf\xda\x45\x0a\xba\x5c\x3b\xb9\xc7\x79\xc5\x14\x2d\x18\x34\x19\x1c\x51\xdb\x25\x4d\xb4\x7e\x06\x14\x38\x6c\x59\x55\xd2\x77\xf8\x69\x59\xfc\x7b\x73\xed\x93\x43\xcb\x32\x6d\x3c\x28\xdc\x1b\x9a\xd3\x62\xab\xc2\x27\xf7\x41\xc9\x08\x2b\x23\x08\xad\x13\x57\x21\x9c\xd3\x72\x0d\x42\x72\xf8\x01\x7c\xa7\xf6\x83\xce\x39\xd7\x82\x3c\x1f\x2f\xd6\x60\x1b\xa2\xdf\x35\x89\x52\x20\xe7\x73\x74\xe0\x66\x26\x64\x4e\xb4\x97\x58\xc2\x0e\x0e\xe1\x60\x92\x34\x6d\xa0\x10\xd6\xb5\x83\x61\x27\xe6\x47\xd3\x89\xbd\x63\xfd\x3b\x8d\x03\x3d\x6c\x42\x2d\x5b\x70\xee\xe8\xdf\x4b\xf4\x66\x4e\xe1\x01\x45\x17\x80\x74\xad\x4f\xc3\xf3\xae\xc6\x1d\xc6\xd7\xc2\xce\xc9\xe1\x29\x30\x86\x2f\x4a\xa6\x4b\x15\x84\x73\xc9\x6f\xfd\x7f\xa5\x6e\x9e\xbd\xf1\xb0\xd4\xdd\x45\x5a\xc2\x3e\x4b\x78\xab\xa8\x84\x74\x4a\x91\x3b\x92\x23\x05\xf2\x1c\x1e\x7b\xf3\x09\xf8\xcf\xab\x24\xb6\x60\xa2\xe8\x4c\x9f\x75\x77\xaa\x8c\xe6\x01\x45\x36\x86\xcf\xc3\x63\x3a\xea\xd4\x8d\x7e\x06\xac\x14\x0a\xe0\x29\xf0\xed\x07\x22\x1a\x65\xda\x44\xae\xa2\x73\x1a\xe6\x90\x69\xa2\x8c\x46\xb2\x2f\xde\x49\x38\x08\xed\xfe\xfd\x41\xaf\x9f\xa9\x55\xd7\xdd\x22\x8d\xfa\x45\x63\xc5\x0f\x80\xf3\xb4\x08\xd6\x79\x30\x9e\x93\xee\x59\xa6\xd0\x4b\xee\x22\xe3\x33\xc1\x3a\x27\x68\x36\x78\x7e\x87\x0a\x06\xd5\x2e\x20\xd3\xaf\x15\xfb\xd8\x3b\x73\x14\xbb\x92\xed\x05\x5d\x2e\x29\x38\x2c\x94\xe4\x42\x45\x5e\xd3\xb5\x7d\xdf\x47\xca\x38\xb4\x5c\xaf\xfb\x7d\xdd\x6d\xf4\xa1\x2d\x77\xdd\x2f\xce\x6d\xc4\x7b\x8b\x4e\x67\xa9\x6f\xfe\x04\x00\x00\xff\xff\xb1\xd1\x27\x78\x05\x11\x00\x00") - -func jsonschemaDraft04JsonBytes() ([]byte, error) { - return bindataRead( - _jsonschemaDraft04Json, - "jsonschema-draft-04.json", - ) -} - -func jsonschemaDraft04Json() (*asset, error) { - bytes, err := jsonschemaDraft04JsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(0640), modTime: time.Unix(1568963823, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe1, 0x48, 0x9d, 0xb, 0x47, 0x55, 0xf0, 0x27, 0x93, 0x30, 0x25, 0x91, 0xd3, 0xfc, 0xb8, 0xf0, 0x7b, 0x68, 0x93, 0xa8, 0x2a, 0x94, 0xf2, 0x48, 0x95, 0xf8, 0xe4, 0xed, 0xf1, 0x1b, 0x82, 0xe2}} - return a, nil -} - -var _v2SchemaJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\xe3\x08\xb5\x8b\x99\xbd\x82\xbc\x9e\xc2\xe8\x53\x46\x83\x3f\x33\x54\x2b\x5b\xad\x92\x79\xd9\x8f\x5d\x93\x98\xf2\xe6\xc6\x1c\xe6\x9a\x9e\xfc\x43\x82\x31\x66\x8e\x53\x77\xfe\x90\xe7\xf3\xf6\xe9\x62\x23\x3f\x10\x93\x18\xae\x72\x1a\x9d\xf9\x48\xcb\xcc\x5a\x65\xc7\x4a\x04\xf0\xf3\xd5\xd5\x05\x8a\x41\x08\xbc\x86\x86\x43\x51\x6c\xe0\x46\x57\xf6\x44\x40\x0d\xfb\xff\xa2\xc3\x7c\x3d\x39\x84\xdc\x09\x22\x64\x4f\x12\xd9\xba\xaa\xf6\xe3\xbd\x56\xdd\x91\x25\x6a\x14\x9c\x89\x34\x8e\x31\xdf\xee\x15\x7e\x2f\x39\x81\x15\x2a\x28\x95\x66\x51\xf5\xfd\x83\xc5\xfe\x15\x07\xcf\xf7\x08\xee\x1d\x8e\xb6\xc5\x52\xcc\x8c\x5a\x93\x66\xc5\xd8\x79\x38\x46\xd6\xa7\x88\x37\xc9\x2e\xe3\xd2\xa5\x7b\x4b\x3a\xdc\xa1\xdc\x9e\x29\xf1\x8c\x8a\x99\x16\x47\x8d\xd4\x78\x8b\xf6\x1c\xe9\x71\x54\x1b\x69\xa8\x4a\x93\x37\xe5\xb2\x2c\x4f\x0c\x92\xab\xa0\x73\x32\x72\x59\xd3\xf0\x2d\x8d\xed\xca\x37\x16\x19\x9e\xdb\x1c\xab\x17\x49\xc3\x0f\x37\xdc\x88\xb1\xb4\xd4\x42\xcb\x58\x5e\x6a\x52\x0b\x15\x10\x0a\xb0\x04\xe7\xf8\x58\x32\x16\x01\xa6\xcd\x01\xb2\xc2\x69\x24\x35\x38\x6f\x30\x6a\xae\x1b\xb4\x71\xaa\xad\x1d\xa0\xd6\x20\x2d\x8b\x3c\xc6\x82\x62\x27\x34\x6d\x15\x84\x7b\x43\xb1\x35\x78\xa6\x24\x77\x28\xc1\x6e\xfc\xe9\x48\x74\xf4\x15\xe3\xe1\x84\x42\x88\x40\x7a\x26\x49\x3b\x48\xb1\xa4\x19\x8e\x0c\xa7\xb5\x01\x6c\x0c\x97\x61\x8a\xc2\x32\xd8\x8c\x44\x69\x24\xbf\x65\x1d\x74\xd6\xe5\x44\xef\xec\x48\x5e\xb7\x8a\xa3\x29\x8e\x41\x64\xce\x1f\x88\xdc\x00\x47\x4b\x40\x98\x6e\xd1\x0d\x8e\x48\x98\x63\x5c\x21\xb1\x4c\x05\x0a\x58\x98\xc5\x6d\x4f\x0a\x77\x53\x4f\x8b\xc4\x44\x1f\xb2\xdf\x8d\x3b\xea\x9f\xfe\xf6\xf2\xc5\xff\x5d\x7f\xfe\x9f\xfb\x67\x8f\xff\xf3\xe9\x69\xd1\xfe\xb3\xc7\xfd\x3c\xf8\x3f\x71\x94\x82\x23\xd1\x72\x00\xb7\x42\x99\x6c\xc0\x60\x7b\x0f\x79\xea\xa8\x53\x4b\x56\x31\xfa\x0b\x52\x9f\x96\xdb\xcd\x2f\xd7\x67\xcd\x04\x19\x85\xfe\xdb\x02\x9a\x59\x03\xad\x63\x3c\xea\xff\x2e\x18\xfd\x00\xd9\xe2\x56\x60\x59\x93\xb9\xb6\xb2\x3e\x3c\x2c\xab\x0f\xa7\xb2\x89\x43\xc7\xf6\xd5\xce\x2e\xad\xa6\xa9\xed\xa6\xc6\x5a\xb4\xa6\x67\xdf\x8c\x26\x7b\x50\x5a\x91\x08\x2e\x6d\xd4\x3a\xc1\x9d\xf2\xdb\xde\x1e\xb2\x2c\x6c\xa5\x64\xc9\x16\xb4\x90\xaa\x4a\xb7\x0c\xde\x13\xc3\x2a\x9a\x11\x9b\x7a\x1b\x3d\x95\x97\x37\x31\x6b\x69\x7e\x34\xc0\x67\x1f\x66\x19\x49\xef\xf1\x25\xf5\xac\x0e\xea\x0a\x28\x8d\x4d\x7e\xd9\x57\x4b\x49\xe5\xc6\xb3\x25\xfd\xe6\x57\x42\x25\xac\xcd\xcf\x36\x74\x8e\xca\x24\x47\xe7\x80\xa8\x92\x72\xbd\x3d\x84\x2d\x65\xe2\x82\x1a\x9c\xc4\x44\x92\x1b\x10\x79\x8a\xc4\x4a\x2f\x60\x51\x04\x81\xaa\xf0\xa3\x95\x27\xd7\x12\x7b\xa3\x96\x03\x45\x96\xc1\x8a\x07\xc9\xb2\xb0\x95\x52\x8c\xef\x48\x9c\xc6\x7e\x94\xca\xc2\x0e\x07\x12\x44\xa9\x20\x37\xf0\xae\x0f\x49\xa3\x96\x9d\x4b\x42\x7b\x70\x59\x14\xee\xe0\xb2\x0f\x49\xa3\x96\x4b\x97\xbf\x00\x5d\x4b\x4f\xfc\xbb\x2b\xee\x92\xb9\x17\xb5\xaa\xb8\x0b\x97\x17\x9b\x43\xfd\xd6\xc2\xb2\xc2\x2e\x29\xcf\xfd\x87\x4a\x55\xda\x25\x63\x1f\x5a\x65\x69\x2b\x2d\x3d\x67\xe9\x41\xae\x5e\xc1\x6e\x2b\xd4\xdb\x3e\xa8\xd3\x26\xd2\x48\x92\x24\xca\x61\x86\x8f\x8c\xbb\xf2\x8e\x91\xdf\x1f\x06\x19\x33\xf3\x03\x4d\xba\xcd\xe2\x2d\xfb\x69\xe9\x16\x15\x13\xd5\x56\x85\x4e\x3c\x5b\x8a\xbf\x25\x72\x83\xee\x5e\x20\x22\xf2\xc8\xaa\x7b\xdb\x8e\xe4\x29\x58\xca\x38\xb7\x3f\x2e\x59\xb8\xbd\xa8\x16\x16\xf7\xdb\x79\x51\x9f\x5a\xb4\x8d\x87\x3a\x6e\xbc\x3e\xc5\xb4\xcd\x58\xf9\xf5\x3c\xb9\x6f\x49\xaf\x57\xc1\xfa\x1c\x5d\x6d\x88\x8a\x8b\xd3\x28\xcc\xb7\xef\x10\x8a\x4a\x74\xa9\x4a\xa7\x62\xbf\x0d\x76\x23\x6f\x59\xd9\x31\xee\x40\x11\xfb\x28\xec\x8d\x22\x1c\x13\x5a\x64\x94\x23\x16\x60\xbb\xd2\x7c\xa0\x98\xb2\xe5\x6e\xbc\x54\x33\xe0\x3e\xb9\x52\x17\xdb\xb7\x1b\xc8\x12\x20\x8c\x23\xca\x64\x7e\x78\xa3\x62\x5b\x75\x56\xd9\x9e\x2a\x91\x27\xb0\x70\x34\x1f\x90\x89\xb5\x86\x73\x7e\x71\xda\x1e\xfb\x3a\x72\xdc\x5e\x79\x88\xcb\x74\x79\xd9\x64\xe4\xd4\xc2\x9e\xce\xb1\xfe\x85\x5a\xc0\xe9\x0c\x34\x3d\xd0\x43\xce\xa1\x36\x39\xd5\xa1\x4e\xf5\xf8\xb1\xa9\x23\x08\x75\x84\xac\x53\x6c\x3a\xc5\xa6\x53\x6c\x3a\xc5\xa6\x7f\xc5\xd8\xf4\x51\xfd\xff\x25\x4e\xfa\x33\x05\xbe\x9d\x60\xd2\x04\x93\x6a\x5f\x33\x9b\x98\x50\xd2\xe1\x50\x52\xc6\xcc\xdb\x38\x91\xdb\xe6\xaa\xa2\x8f\xa1\x6a\xa6\xd4\xc6\x56\xd6\x8c\x40\x02\x68\x48\xe8\x1a\xe1\x9a\xd9\x2e\xb7\x05\xc3\x34\xda\x2a\xbb\xcd\x12\x36\x98\x22\x50\x4c\xa1\x1b\xc5\xd5\x84\xf0\xbe\x24\x84\xf7\x2f\x22\x37\xef\x94\xd7\x9f\xa0\xde\x04\xf5\x26\xa8\x37\x41\x3d\x64\x40\x3d\xe5\xf2\xde\x60\x89\x27\xb4\x37\xa1\xbd\xda\xd7\xd2\x2c\x26\xc0\x37\x01\x3e\x1b\xef\x5f\x06\xe0\x6b\x7c\x5c\x91\x08\x26\x10\x38\x81\xc0\x09\x04\x76\x4a\x3d\x81\xc0\xbf\x12\x08\x4c\xb0\xdc\x7c\x99\x00\xd0\x75\x70\xb4\xf8\x5a\x7c\xea\xde\x3e\x39\x08\x30\x5a\x27\x35\xed\xb4\x65\xad\x69\x74\x10\x88\x79\xe2\x30\x52\x19\xd6\x04\x21\xa7\x95\xd5\x0e\x03\xf8\xda\x20\xd7\x84\xb4\x26\xa4\x35\x21\xad\x09\x69\x21\x03\x69\x51\x46\xff\xff\x18\x9b\x54\xed\x87\x47\x06\x9d\x4e\x73\x6e\x9a\xb3\xa9\xce\x83\x5e\x4b\xc6\x71\x20\x45\xd7\x72\xf5\x40\x72\x0e\x34\x6c\xf4\x6c\xf3\xba\x5e\x4b\x97\x0e\x52\xb8\xbe\x8b\x79\xa0\x10\x86\xa1\x75\xb0\x6f\xec\xc8\xf4\x3d\x4d\x7b\x86\xc2\x02\x31\x12\x51\xbf\x07\x94\xad\x10\xd6\x2e\x79\xcf\xe9\x1c\xf5\x1e\x31\x23\x5c\x18\xfb\x9c\xfb\x70\xe0\x62\xbd\xf7\xb5\x94\xcf\xf3\xf6\xfa\xc5\x4e\x9c\x85\x76\x1d\xae\x37\xbc\xde\xa3\x41\xcb\x29\xd0\x5e\x70\x67\x50\x93\x6d\x98\xa8\xd3\x67\x0f\x68\xb1\xeb\x38\x47\x07\x10\x1b\xd2\xe2\x18\x68\x6d\x40\xbb\xa3\x40\xba\x21\xf2\x8e\x81\xfb\xf6\x92\x77\x2f\x70\xe8\xdb\xb2\x36\xbf\x30\x91\xc5\x21\xe7\x45\xcc\x34\x0c\x48\x8e\xd0\xf2\x9b\x7c\x3c\xbd\x1c\x04\x3e\x07\xe8\x7c\x2f\x84\x7a\x48\x4d\x1f\xba\xe1\x76\x45\x7b\x60\xe0\x01\xca\xee\x04\xca\x31\xbe\x73\x5f\xa3\x70\x0c\xad\x1f\xa5\xf5\x76\xd5\xbb\xd2\x7e\xfb\x30\x90\xcf\xfa\x67\x7a\xe6\xc3\x37\x42\x19\xe2\xc9\x9c\x61\x4c\xe7\xd1\x77\x55\x86\x6e\x8f\x7b\x85\x42\x33\xa3\xaa\x57\xae\xfd\xd5\xcc\x9c\x56\x68\xe2\xde\x0e\xa8\x2c\xa9\xb0\x7d\xf0\x54\x2d\x80\xf2\x48\x39\x3d\x98\x1a\x6d\x0b\x9d\xba\x53\xfb\xce\xf8\xd1\x7e\xbb\x60\x4f\x06\xf5\xce\xda\xab\xeb\xca\xcb\xd5\xac\x20\xda\x72\x3b\xa2\x4b\x38\xd7\xb5\x89\xbe\x42\xd9\xb9\x73\xc4\x0c\x6d\xb7\xd9\xf8\x8d\xbd\x3e\x9c\xf5\x53\x68\x48\x14\x36\x8f\x09\xc5\x92\xf1\x21\xd1\x09\x07\x1c\xbe\xa7\x91\xf3\x6a\xc8\xc1\x57\xb0\xdd\xc5\xc6\x1d\xad\x76\x1d\xa8\x82\x0e\x4c\x38\xfe\xa5\x8c\xc5\x0a\x40\x5d\xa1\xbb\x98\xd1\xfb\x74\x61\xed\x1a\x98\xaf\x3c\x8c\x1e\xe3\xc2\x92\x29\x74\x3e\x99\xd0\xf9\x41\x50\xd0\x38\x4b\x57\x7e\x5b\x7a\x0e\xe6\xce\x4e\xd7\x19\x35\x57\xbb\x3c\x3c\xd2\x5e\x4f\x4b\x4c\xf7\x0f\x4d\x2b\x91\x5d\x94\xa6\x95\xc8\x69\x25\x72\x5a\x89\x7c\xb8\x95\xc8\x07\x80\x8c\xda\x9c\x64\x7b\xb7\x71\xdf\x57\x12\x4b\x9a\x1f\x72\x0c\x13\x03\xad\x3c\xd5\x4e\xde\x8e\x57\x13\x6d\x34\x86\xcf\x97\xe6\xa4\x68\xc4\xb0\xf6\xc9\xc2\xeb\x8d\x0b\xd7\xcd\xfe\xba\xa6\xf5\x30\xeb\x30\x33\xbe\xc7\x56\x27\xab\x08\xd9\x6d\xbb\x09\xee\x7c\x2d\xcf\xee\x87\x38\xac\xc8\xdd\x90\x9a\x58\x4a\x4e\x96\xa9\x79\x79\xf3\xde\x20\xf0\x96\xe3\x24\x19\xeb\xba\xf2\x53\x19\xab\x12\xaf\x47\xb3\xa0\x3e\xef\x9b\x8d\x6d\x6d\x7b\xde\x3b\x3b\x1a\xc0\x3f\x95\x7e\xed\x78\xfb\x76\xb8\xaf\xb3\xdd\xc5\xeb\x95\xed\x5a\x62\x41\x82\xb3\x54\x6e\x80\x4a\x92\x6f\x36\xbd\x34\xae\xde\x6f\xa4\xc0\xbc\x08\xe3\x84\xfc\x1d\xb6\xe3\xd0\x62\x38\x95\x9b\x57\xe7\x71\x12\x91\x80\xc8\x31\x69\x5e\x60\x21\x6e\x19\x0f\xc7\xa4\x79\x96\x28\x3e\x47\x54\x65\x41\x36\x08\x40\x88\x1f\x58\x08\x56\xaa\xd5\xbf\xaf\xad\x96\xd7\xd6\xcf\x87\xf5\x34\x0f\x71\x93\x6e\x26\xed\x98\x5b\x9f\x4f\xcf\x95\x34\xc6\xd7\x11\xfa\xb0\x81\x22\x1a\xdb\xdf\x8e\xdc\xc3\xb9\xf8\xdd\x5d\x3c\x74\xe6\xea\xb7\x8b\xbf\xf5\x6e\xb3\x46\x2e\x64\xf4\xab\x3c\x4e\xcf\x36\x1d\xfe\xfa\xb8\x36\xba\x8a\xd8\xad\xf6\xc6\x41\x2a\x37\x8c\x17\x0f\xda\xfe\xda\xe7\x65\xbc\x71\x2c\x36\x57\x8a\x47\x12\x4c\xf1\xbd\x77\x6b\xa4\x50\x7e\x77\x7b\x22\x60\x89\xef\xcd\xf5\xb9\x0c\x97\x79\x0d\x2b\x35\x43\xcb\x3d\x24\xf1\x78\xfc\xf8\xcb\x1f\x15\x06\xe2\x78\xd8\x51\x21\xd9\x1f\xf0\xf5\x8f\x86\xa4\x50\xfa\xb1\x47\x43\xa5\xdd\x69\x14\xe8\xa3\xc0\x86\x91\xa7\x81\x50\xb4\x7c\xc0\x81\x80\x77\x7a\x9f\xc6\xc2\xa9\x8c\x05\x33\xb0\x3b\x31\xa4\xf4\xd7\x1b\x26\x55\x97\x7c\x65\xf8\x69\x1a\x84\x8e\x41\x78\xd9\xec\xc5\x11\x16\x1e\x74\x91\xf5\x56\xf5\x57\x49\x47\x5c\x92\xa9\x1e\x99\x36\xf4\xdb\xb1\x0e\xd3\x78\x02\xb0\x9b\x25\xcb\xe9\xe9\x1d\x0d\x44\x01\x42\x08\x91\x64\xd9\xdd\x37\x08\x17\xef\xf9\xe5\x0f\xbd\x46\x91\xf5\xf9\x89\x92\x37\xdd\x89\x59\x44\x1f\x9c\xee\x34\x1e\xbe\x47\x83\x32\x72\x8e\x37\xdf\xac\x69\x38\xef\x75\xb0\xda\xdb\xac\x83\x94\x2f\x39\xa6\x62\x05\x1c\x25\x9c\x49\x16\xb0\xa8\x3c\xc7\x7e\x76\x71\x3e\x6f\xb5\x24\xe7\xe8\xb7\xb9\xc7\x6c\x43\x92\xee\x21\xd4\x17\xa1\x7f\xba\x35\xfe\xae\x39\xbc\xde\xba\x69\xd9\x8e\xe1\x62\xde\x64\x7d\x16\x88\x1b\xed\x29\x11\xfd\x4f\xa9\xff\x99\x90\xc4\xf6\xf4\xf9\x6e\xe9\x28\x23\xd7\xca\xe5\xee\xee\x9f\x63\xb1\x5b\xfb\x10\xd7\x2f\x1d\xf2\xe3\xbf\xb9\xb5\x6f\xa4\x6d\x7d\x25\x79\xfb\x24\x31\xea\x56\xbe\x5d\x53\xcd\x2d\x36\xa3\x6d\xdf\xab\x1c\xb8\x6d\x6f\xc0\x98\xa7\xdd\xaa\x86\x8c\x1d\x39\xa3\x9d\x70\x2b\x9b\x68\xd9\xfd\x33\xfe\xa9\xb6\x4a\x2e\x63\x0f\xcf\x68\x27\xd9\x4c\xb9\x46\x6d\xcb\xbe\xa1\xa8\xd6\x5f\xc6\xd6\x9f\xf1\x4f\xf4\xd4\xb4\x78\xd0\xd6\xf4\x13\x3c\x3b\xac\xd0\xdc\x90\x34\xda\xc9\xb4\x9a\x1a\x8d\xbd\x93\x87\xd4\xe2\x21\x1b\xb3\x2b\xd1\xbe\xe7\x69\xd4\x53\x67\xd5\x40\xa0\xe3\x19\x3f\x6d\x1a\xbc\x0e\x86\x3c\x10\xb4\x3d\x2a\xcd\x78\x32\xe6\xab\xbd\x36\xc9\xf4\x3a\x58\xae\xc3\xf4\x47\xea\xbf\xfb\x47\xff\x0d\x00\x00\xff\xff\xd2\x32\x5a\x28\x38\x9d\x00\x00") - -func v2SchemaJsonBytes() ([]byte, error) { - return bindataRead( - _v2SchemaJson, - "v2/schema.json", - ) -} - -func v2SchemaJson() (*asset, error) { - bytes, err := v2SchemaJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "v2/schema.json", size: 40248, mode: os.FileMode(0640), modTime: time.Unix(1568964748, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x88, 0x5e, 0xf, 0xbf, 0x17, 0x74, 0x0, 0xb2, 0x5a, 0x7f, 0xbc, 0x58, 0xcd, 0xc, 0x25, 0x73, 0xd5, 0x29, 0x1c, 0x7a, 0xd0, 0xce, 0x79, 0xd4, 0x89, 0x31, 0x27, 0x90, 0xf2, 0xff, 0xe6}} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// AssetString returns the asset contents as a string (instead of a []byte). -func AssetString(name string) (string, error) { - data, err := Asset(name) - return string(data), err -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// MustAssetString is like AssetString but panics when Asset would return an -// error. It simplifies safe initialization of global variables. -func MustAssetString(name string) string { - return string(MustAsset(name)) -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetDigest returns the digest of the file with the given name. It returns an -// error if the asset could not be found or the digest could not be loaded. -func AssetDigest(name string) ([sha256.Size]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) - } - return a.digest, nil - } - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) -} - -// Digests returns a map of all known files and their checksums. -func Digests() (map[string][sha256.Size]byte, error) { - mp := make(map[string][sha256.Size]byte, len(_bindata)) - for name := range _bindata { - a, err := _bindata[name]() - if err != nil { - return nil, err - } - mp[name] = a.digest - } - return mp, nil -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "jsonschema-draft-04.json": jsonschemaDraft04Json, - - "v2/schema.json": v2SchemaJson, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"}, -// AssetDir("data/img") would return []string{"a.png", "b.png"}, -// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - canonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(canonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "jsonschema-draft-04.json": &bintree{jsonschemaDraft04Json, map[string]*bintree{}}, - "v2": &bintree{nil, map[string]*bintree{ - "schema.json": &bintree{v2SchemaJson, map[string]*bintree{}}, - }}, -}} - -// RestoreAsset restores an asset under the given directory. -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) -} - -// RestoreAssets restores an asset under the given directory recursively. -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - canonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/cache.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/cache.go deleted file mode 100644 index 3fada0daef1b..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/cache.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import "sync" - -// ResolutionCache a cache for resolving urls -type ResolutionCache interface { - Get(string) (interface{}, bool) - Set(string, interface{}) -} - -type simpleCache struct { - lock sync.RWMutex - store map[string]interface{} -} - -// Get retrieves a cached URI -func (s *simpleCache) Get(uri string) (interface{}, bool) { - debugLog("getting %q from resolution cache", uri) - s.lock.RLock() - v, ok := s.store[uri] - debugLog("got %q from resolution cache: %t", uri, ok) - - s.lock.RUnlock() - return v, ok -} - -// Set caches a URI -func (s *simpleCache) Set(uri string, data interface{}) { - s.lock.Lock() - s.store[uri] = data - s.lock.Unlock() -} - -var resCache ResolutionCache - -func init() { - resCache = initResolutionCache() -} - -// initResolutionCache initializes the URI resolution cache -func initResolutionCache() ResolutionCache { - return &simpleCache{store: map[string]interface{}{ - "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), - "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(), - }} -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/debug.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/debug.go deleted file mode 100644 index 389c528ff613..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/debug.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "fmt" - "log" - "os" - "path/filepath" - "runtime" -) - -var ( - // Debug is true when the SWAGGER_DEBUG env var is not empty. - // It enables a more verbose logging of this package. - Debug = os.Getenv("SWAGGER_DEBUG") != "" - // specLogger is a debug logger for this package - specLogger *log.Logger -) - -func init() { - debugOptions() -} - -func debugOptions() { - specLogger = log.New(os.Stdout, "spec:", log.LstdFlags) -} - -func debugLog(msg string, args ...interface{}) { - // A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog() - if Debug { - _, file1, pos1, _ := runtime.Caller(1) - specLogger.Printf("%s:%d: %s", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...)) - } -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/expander.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/expander.go deleted file mode 100644 index 043720d7d8ea..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/expander.go +++ /dev/null @@ -1,651 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "strings" -) - -// ExpandOptions provides options for spec expand -type ExpandOptions struct { - RelativeBase string - SkipSchemas bool - ContinueOnError bool - AbsoluteCircularRef bool -} - -// ResolveRefWithBase resolves a reference against a context root with preservation of base path -func ResolveRefWithBase(root interface{}, ref *Ref, opts *ExpandOptions) (*Schema, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - specBasePath := "" - if opts != nil && opts.RelativeBase != "" { - specBasePath, _ = absPath(opts.RelativeBase) - } - - result := new(Schema) - if err := resolver.Resolve(ref, result, specBasePath); err != nil { - return nil, err - } - return result, nil -} - -// ResolveRef resolves a reference against a context root -// ref is guaranteed to be in root (no need to go to external files) -// ResolveRef is ONLY called from the code generation module -func ResolveRef(root interface{}, ref *Ref) (*Schema, error) { - res, _, err := ref.GetPointer().Get(root) - if err != nil { - panic(err) - } - switch sch := res.(type) { - case Schema: - return &sch, nil - case *Schema: - return sch, nil - case map[string]interface{}: - b, _ := json.Marshal(sch) - newSch := new(Schema) - _ = json.Unmarshal(b, newSch) - return newSch, nil - default: - return nil, fmt.Errorf("unknown type for the resolved reference") - } -} - -// ResolveParameter resolves a parameter reference against a context root -func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) { - return ResolveParameterWithBase(root, ref, nil) -} - -// ResolveParameterWithBase resolves a parameter reference against a context root and base path -func ResolveParameterWithBase(root interface{}, ref Ref, opts *ExpandOptions) (*Parameter, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - - result := new(Parameter) - if err := resolver.Resolve(&ref, result, ""); err != nil { - return nil, err - } - return result, nil -} - -// ResolveResponse resolves response a reference against a context root -func ResolveResponse(root interface{}, ref Ref) (*Response, error) { - return ResolveResponseWithBase(root, ref, nil) -} - -// ResolveResponseWithBase resolves response a reference against a context root and base path -func ResolveResponseWithBase(root interface{}, ref Ref, opts *ExpandOptions) (*Response, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - - result := new(Response) - if err := resolver.Resolve(&ref, result, ""); err != nil { - return nil, err - } - return result, nil -} - -// ResolveItems resolves parameter items reference against a context root and base path. -// -// NOTE: stricly speaking, this construct is not supported by Swagger 2.0. -// Similarly, $ref are forbidden in response headers. -func ResolveItems(root interface{}, ref Ref, opts *ExpandOptions) (*Items, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - basePath := "" - if opts.RelativeBase != "" { - basePath = opts.RelativeBase - } - result := new(Items) - if err := resolver.Resolve(&ref, result, basePath); err != nil { - return nil, err - } - return result, nil -} - -// ResolvePathItem resolves response a path item against a context root and base path -func ResolvePathItem(root interface{}, ref Ref, opts *ExpandOptions) (*PathItem, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - basePath := "" - if opts.RelativeBase != "" { - basePath = opts.RelativeBase - } - result := new(PathItem) - if err := resolver.Resolve(&ref, result, basePath); err != nil { - return nil, err - } - return result, nil -} - -// ExpandSpec expands the references in a swagger spec -func ExpandSpec(spec *Swagger, options *ExpandOptions) error { - resolver, err := defaultSchemaLoader(spec, options, nil, nil) - // Just in case this ever returns an error. - if resolver.shouldStopOnError(err) { - return err - } - - // getting the base path of the spec to adjust all subsequent reference resolutions - specBasePath := "" - if options != nil && options.RelativeBase != "" { - specBasePath, _ = absPath(options.RelativeBase) - } - - if options == nil || !options.SkipSchemas { - for key, definition := range spec.Definitions { - var def *Schema - var err error - if def, err = expandSchema(definition, []string{fmt.Sprintf("#/definitions/%s", key)}, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - if def != nil { - spec.Definitions[key] = *def - } - } - } - - for key := range spec.Parameters { - parameter := spec.Parameters[key] - if err := expandParameterOrResponse(¶meter, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Parameters[key] = parameter - } - - for key := range spec.Responses { - response := spec.Responses[key] - if err := expandParameterOrResponse(&response, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Responses[key] = response - } - - if spec.Paths != nil { - for key := range spec.Paths.Paths { - path := spec.Paths.Paths[key] - if err := expandPathItem(&path, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Paths.Paths[key] = path - } - } - - return nil -} - -// baseForRoot loads in the cache the root document and produces a fake "root" base path entry -// for further $ref resolution -func baseForRoot(root interface{}, cache ResolutionCache) string { - // cache the root document to resolve $ref's - const rootBase = "root" - if root != nil { - base, _ := absPath(rootBase) - normalizedBase := normalizeAbsPath(base) - debugLog("setting root doc in cache at: %s", normalizedBase) - if cache == nil { - cache = resCache - } - cache.Set(normalizedBase, root) - return rootBase - } - return "" -} - -// ExpandSchema expands the refs in the schema object with reference to the root object -// go-openapi/validate uses this function -// notice that it is impossible to reference a json schema in a different file other than root -func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error { - opts := &ExpandOptions{ - // when a root is specified, cache the root as an in-memory document for $ref retrieval - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - // when no base path is specified, remaining $ref (circular) are rendered with an absolute path - AbsoluteCircularRef: true, - } - return ExpandSchemaWithBasePath(schema, cache, opts) -} - -// ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options -func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error { - if schema == nil { - return nil - } - - var basePath string - if opts.RelativeBase != "" { - basePath, _ = absPath(opts.RelativeBase) - } - - resolver, err := defaultSchemaLoader(nil, opts, cache, nil) - if err != nil { - return err - } - - refs := []string{""} - var s *Schema - if s, err = expandSchema(*schema, refs, resolver, basePath); err != nil { - return err - } - *schema = *s - return nil -} - -func expandItems(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Items != nil { - if target.Items.Schema != nil { - t, err := expandSchema(*target.Items.Schema, parentRefs, resolver, basePath) - if err != nil { - return nil, err - } - *target.Items.Schema = *t - } - for i := range target.Items.Schemas { - t, err := expandSchema(target.Items.Schemas[i], parentRefs, resolver, basePath) - if err != nil { - return nil, err - } - target.Items.Schemas[i] = *t - } - } - return &target, nil -} - -func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Ref.String() == "" && target.Ref.IsRoot() { - // normalizing is important - newRef := normalizeFileRef(&target.Ref, basePath) - target.Ref = *newRef - return &target, nil - - } - - // change the base path of resolution when an ID is encountered - // otherwise the basePath should inherit the parent's - // important: ID can be relative path - if target.ID != "" { - debugLog("schema has ID: %s", target.ID) - // handling the case when id is a folder - // remember that basePath has to be a file - refPath := target.ID - if strings.HasSuffix(target.ID, "/") { - // path.Clean here would not work correctly if basepath is http - refPath = fmt.Sprintf("%s%s", refPath, "placeholder.json") - } - basePath = normalizePaths(refPath, basePath) - } - - var t *Schema - // if Ref is found, everything else doesn't matter - // Ref also changes the resolution scope of children expandSchema - if target.Ref.String() != "" { - // here the resolution scope is changed because a $ref was encountered - normalizedRef := normalizeFileRef(&target.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if resolver.isCircular(normalizedRef, basePath, parentRefs...) { - // this means there is a cycle in the recursion tree: return the Ref - // - circular refs cannot be expanded. We leave them as ref. - // - denormalization means that a new local file ref is set relative to the original basePath - debugLog("shortcut circular ref: basePath: %s, normalizedPath: %s, normalized ref: %s", - basePath, normalizedBasePath, normalizedRef.String()) - if !resolver.options.AbsoluteCircularRef { - target.Ref = *denormalizeFileRef(normalizedRef, normalizedBasePath, resolver.context.basePath) - } else { - target.Ref = *normalizedRef - } - return &target, nil - } - - debugLog("basePath: %s: calling Resolve with target: %#v", basePath, target) - if err := resolver.Resolve(&target.Ref, &t, basePath); resolver.shouldStopOnError(err) { - return nil, err - } - - if t != nil { - parentRefs = append(parentRefs, normalizedRef.String()) - var err error - transitiveResolver, err := resolver.transitiveResolver(basePath, target.Ref) - if transitiveResolver.shouldStopOnError(err) { - return nil, err - } - - basePath = resolver.updateBasePath(transitiveResolver, normalizedBasePath) - - return expandSchema(*t, parentRefs, transitiveResolver, basePath) - } - } - - t, err := expandItems(target, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target = *t - } - - for i := range target.AllOf { - t, err := expandSchema(target.AllOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - target.AllOf[i] = *t - } - for i := range target.AnyOf { - t, err := expandSchema(target.AnyOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - target.AnyOf[i] = *t - } - for i := range target.OneOf { - t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.OneOf[i] = *t - } - } - if target.Not != nil { - t, err := expandSchema(*target.Not, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.Not = *t - } - } - for k := range target.Properties { - t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.Properties[k] = *t - } - } - if target.AdditionalProperties != nil && target.AdditionalProperties.Schema != nil { - t, err := expandSchema(*target.AdditionalProperties.Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.AdditionalProperties.Schema = *t - } - } - for k := range target.PatternProperties { - t, err := expandSchema(target.PatternProperties[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.PatternProperties[k] = *t - } - } - for k := range target.Dependencies { - if target.Dependencies[k].Schema != nil { - t, err := expandSchema(*target.Dependencies[k].Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.Dependencies[k].Schema = *t - } - } - } - if target.AdditionalItems != nil && target.AdditionalItems.Schema != nil { - t, err := expandSchema(*target.AdditionalItems.Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.AdditionalItems.Schema = *t - } - } - for k := range target.Definitions { - t, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.Definitions[k] = *t - } - } - return &target, nil -} - -func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error { - if pathItem == nil { - return nil - } - - parentRefs := []string{} - if err := resolver.deref(pathItem, parentRefs, basePath); resolver.shouldStopOnError(err) { - return err - } - if pathItem.Ref.String() != "" { - transitiveResolver, err := resolver.transitiveResolver(basePath, pathItem.Ref) - if transitiveResolver.shouldStopOnError(err) { - return err - } - basePath = transitiveResolver.updateBasePath(resolver, basePath) - resolver = transitiveResolver - } - pathItem.Ref = Ref{} - - for idx := range pathItem.Parameters { - if err := expandParameterOrResponse(&(pathItem.Parameters[idx]), resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - } - ops := []*Operation{ - pathItem.Get, - pathItem.Head, - pathItem.Options, - pathItem.Put, - pathItem.Post, - pathItem.Patch, - pathItem.Delete, - } - for _, op := range ops { - if err := expandOperation(op, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - } - return nil -} - -func expandOperation(op *Operation, resolver *schemaLoader, basePath string) error { - if op == nil { - return nil - } - - for i := range op.Parameters { - param := op.Parameters[i] - if err := expandParameterOrResponse(¶m, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - op.Parameters[i] = param - } - - if op.Responses != nil { - responses := op.Responses - if err := expandParameterOrResponse(responses.Default, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - for code := range responses.StatusCodeResponses { - response := responses.StatusCodeResponses[code] - if err := expandParameterOrResponse(&response, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - responses.StatusCodeResponses[code] = response - } - } - return nil -} - -// ExpandResponseWithRoot expands a response based on a root document, not a fetchable document -func ExpandResponseWithRoot(response *Response, root interface{}, cache ResolutionCache) error { - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - // when no base path is specified, remaining $ref (circular) are rendered with an absolute path - AbsoluteCircularRef: true, - } - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return err - } - - return expandParameterOrResponse(response, resolver, opts.RelativeBase) -} - -// ExpandResponse expands a response based on a basepath -// This is the exported version of expandResponse -// all refs inside response will be resolved relative to basePath -func ExpandResponse(response *Response, basePath string) error { - var specBasePath string - if basePath != "" { - specBasePath, _ = absPath(basePath) - } - opts := &ExpandOptions{ - RelativeBase: specBasePath, - } - resolver, err := defaultSchemaLoader(nil, opts, nil, nil) - if err != nil { - return err - } - - return expandParameterOrResponse(response, resolver, opts.RelativeBase) -} - -// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document -func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache ResolutionCache) error { - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - // when no base path is specified, remaining $ref (circular) are rendered with an absolute path - AbsoluteCircularRef: true, - } - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return err - } - - return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) -} - -// ExpandParameter expands a parameter based on a basepath. -// This is the exported version of expandParameter -// all refs inside parameter will be resolved relative to basePath -func ExpandParameter(parameter *Parameter, basePath string) error { - var specBasePath string - if basePath != "" { - specBasePath, _ = absPath(basePath) - } - opts := &ExpandOptions{ - RelativeBase: specBasePath, - } - resolver, err := defaultSchemaLoader(nil, opts, nil, nil) - if err != nil { - return err - } - - return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) -} - -func getRefAndSchema(input interface{}) (*Ref, *Schema, error) { - var ref *Ref - var sch *Schema - switch refable := input.(type) { - case *Parameter: - if refable == nil { - return nil, nil, nil - } - ref = &refable.Ref - sch = refable.Schema - case *Response: - if refable == nil { - return nil, nil, nil - } - ref = &refable.Ref - sch = refable.Schema - default: - return nil, nil, fmt.Errorf("expand: unsupported type %T. Input should be of type *Parameter or *Response", input) - } - return ref, sch, nil -} - -func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePath string) error { - ref, _, err := getRefAndSchema(input) - if err != nil { - return err - } - if ref == nil { - return nil - } - parentRefs := []string{} - if err := resolver.deref(input, parentRefs, basePath); resolver.shouldStopOnError(err) { - return err - } - ref, sch, _ := getRefAndSchema(input) - if ref.String() != "" { - transitiveResolver, err := resolver.transitiveResolver(basePath, *ref) - if transitiveResolver.shouldStopOnError(err) { - return err - } - basePath = resolver.updateBasePath(transitiveResolver, basePath) - resolver = transitiveResolver - } - - if sch != nil && sch.Ref.String() != "" { - // schema expanded to a $ref in another root - var ern error - sch.Ref, ern = NewRef(normalizePaths(sch.Ref.String(), ref.RemoteURI())) - if ern != nil { - return ern - } - } - if ref != nil { - *ref = Ref{} - } - - if !resolver.options.SkipSchemas && sch != nil { - s, err := expandSchema(*sch, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return err - } - *sch = *s - } - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/go.mod b/cluster-autoscaler/vendor/github.com/go-openapi/spec/go.mod deleted file mode 100644 index 14e5f2dac3aa..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module github.com/go-openapi/spec - -require ( - github.com/go-openapi/jsonpointer v0.19.3 - github.com/go-openapi/jsonreference v0.19.2 - github.com/go-openapi/swag v0.19.5 - github.com/stretchr/testify v1.3.0 - golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect - gopkg.in/yaml.v2 v2.2.4 -) - -go 1.13 diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/go.sum b/cluster-autoscaler/vendor/github.com/go-openapi/spec/go.sum deleted file mode 100644 index c209ff971206..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/go.sum +++ /dev/null @@ -1,49 +0,0 @@ -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -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/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/header.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/header.go deleted file mode 100644 index 39efe452bb09..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/header.go +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - jsonArray = "array" -) - -// HeaderProps describes a response header -type HeaderProps struct { - Description string `json:"description,omitempty"` -} - -// Header describes a header for a response of the API -// -// For more information: http://goo.gl/8us55a#headerObject -type Header struct { - CommonValidations - SimpleSchema - VendorExtensible - HeaderProps -} - -// ResponseHeader creates a new header instance for use in a response -func ResponseHeader() *Header { - return new(Header) -} - -// WithDescription sets the description on this response, allows for chaining -func (h *Header) WithDescription(description string) *Header { - h.Description = description - return h -} - -// Typed a fluent builder method for the type of parameter -func (h *Header) Typed(tpe, format string) *Header { - h.Type = tpe - h.Format = format - return h -} - -// CollectionOf a fluent builder method for an array item -func (h *Header) CollectionOf(items *Items, format string) *Header { - h.Type = jsonArray - h.Items = items - h.CollectionFormat = format - return h -} - -// WithDefault sets the default value on this item -func (h *Header) WithDefault(defaultValue interface{}) *Header { - h.Default = defaultValue - return h -} - -// WithMaxLength sets a max length value -func (h *Header) WithMaxLength(max int64) *Header { - h.MaxLength = &max - return h -} - -// WithMinLength sets a min length value -func (h *Header) WithMinLength(min int64) *Header { - h.MinLength = &min - return h -} - -// WithPattern sets a pattern value -func (h *Header) WithPattern(pattern string) *Header { - h.Pattern = pattern - return h -} - -// WithMultipleOf sets a multiple of value -func (h *Header) WithMultipleOf(number float64) *Header { - h.MultipleOf = &number - return h -} - -// WithMaximum sets a maximum number value -func (h *Header) WithMaximum(max float64, exclusive bool) *Header { - h.Maximum = &max - h.ExclusiveMaximum = exclusive - return h -} - -// WithMinimum sets a minimum number value -func (h *Header) WithMinimum(min float64, exclusive bool) *Header { - h.Minimum = &min - h.ExclusiveMinimum = exclusive - return h -} - -// WithEnum sets a the enum values (replace) -func (h *Header) WithEnum(values ...interface{}) *Header { - h.Enum = append([]interface{}{}, values...) - return h -} - -// WithMaxItems sets the max items -func (h *Header) WithMaxItems(size int64) *Header { - h.MaxItems = &size - return h -} - -// WithMinItems sets the min items -func (h *Header) WithMinItems(size int64) *Header { - h.MinItems = &size - return h -} - -// UniqueValues dictates that this array can only have unique items -func (h *Header) UniqueValues() *Header { - h.UniqueItems = true - return h -} - -// AllowDuplicates this array can have duplicates -func (h *Header) AllowDuplicates() *Header { - h.UniqueItems = false - return h -} - -// MarshalJSON marshal this to JSON -func (h Header) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(h.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(h.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(h.HeaderProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2, b3), nil -} - -// UnmarshalJSON unmarshals this header from JSON -func (h *Header) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &h.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &h.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &h.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &h.HeaderProps) -} - -// JSONLookup look up a value by the json property name -func (h Header) JSONLookup(token string) (interface{}, error) { - if ex, ok := h.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(h.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(h.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(h.HeaderProps, token) - return r, err -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/normalizer.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/normalizer.go deleted file mode 100644 index b8957e7c0c18..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/normalizer.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "fmt" - "net/url" - "os" - "path" - "path/filepath" - "strings" -) - -// normalize absolute path for cache. -// on Windows, drive letters should be converted to lower as scheme in net/url.URL -func normalizeAbsPath(path string) string { - u, err := url.Parse(path) - if err != nil { - debugLog("normalize absolute path failed: %s", err) - return path - } - return u.String() -} - -// base or refPath could be a file path or a URL -// given a base absolute path and a ref path, return the absolute path of refPath -// 1) if refPath is absolute, return it -// 2) if refPath is relative, join it with basePath keeping the scheme, hosts, and ports if exists -// base could be a directory or a full file path -func normalizePaths(refPath, base string) string { - refURL, _ := url.Parse(refPath) - if path.IsAbs(refURL.Path) || filepath.IsAbs(refPath) { - // refPath is actually absolute - if refURL.Host != "" { - return refPath - } - parts := strings.Split(refPath, "#") - result := filepath.FromSlash(parts[0]) - if len(parts) == 2 { - result += "#" + parts[1] - } - return result - } - - // relative refPath - baseURL, _ := url.Parse(base) - if !strings.HasPrefix(refPath, "#") { - // combining paths - if baseURL.Host != "" { - baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path) - } else { // base is a file - newBase := fmt.Sprintf("%s#%s", filepath.Join(filepath.Dir(base), filepath.FromSlash(refURL.Path)), refURL.Fragment) - return newBase - } - - } - // copying fragment from ref to base - baseURL.Fragment = refURL.Fragment - return baseURL.String() -} - -// denormalizePaths returns to simplest notation on file $ref, -// i.e. strips the absolute path and sets a path relative to the base path. -// -// This is currently used when we rewrite ref after a circular ref has been detected -func denormalizeFileRef(ref *Ref, relativeBase, originalRelativeBase string) *Ref { - debugLog("denormalizeFileRef for: %s", ref.String()) - - if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly { - return ref - } - // strip relativeBase from URI - relativeBaseURL, _ := url.Parse(relativeBase) - relativeBaseURL.Fragment = "" - - if relativeBaseURL.IsAbs() && strings.HasPrefix(ref.String(), relativeBase) { - // this should work for absolute URI (e.g. http://...): we have an exact match, just trim prefix - r, _ := NewRef(strings.TrimPrefix(ref.String(), relativeBase)) - return &r - } - - if relativeBaseURL.IsAbs() { - // other absolute URL get unchanged (i.e. with a non-empty scheme) - return ref - } - - // for relative file URIs: - originalRelativeBaseURL, _ := url.Parse(originalRelativeBase) - originalRelativeBaseURL.Fragment = "" - if strings.HasPrefix(ref.String(), originalRelativeBaseURL.String()) { - // the resulting ref is in the expanded spec: return a local ref - r, _ := NewRef(strings.TrimPrefix(ref.String(), originalRelativeBaseURL.String())) - return &r - } - - // check if we may set a relative path, considering the original base path for this spec. - // Example: - // spec is located at /mypath/spec.json - // my normalized ref points to: /mypath/item.json#/target - // expected result: item.json#/target - parts := strings.Split(ref.String(), "#") - relativePath, err := filepath.Rel(path.Dir(originalRelativeBaseURL.String()), parts[0]) - if err != nil { - // there is no common ancestor (e.g. different drives on windows) - // leaves the ref unchanged - return ref - } - if len(parts) == 2 { - relativePath += "#" + parts[1] - } - r, _ := NewRef(relativePath) - return &r -} - -// relativeBase could be an ABSOLUTE file path or an ABSOLUTE URL -func normalizeFileRef(ref *Ref, relativeBase string) *Ref { - // This is important for when the reference is pointing to the root schema - if ref.String() == "" { - r, _ := NewRef(relativeBase) - return &r - } - - debugLog("normalizing %s against %s", ref.String(), relativeBase) - - s := normalizePaths(ref.String(), relativeBase) - r, _ := NewRef(s) - return &r -} - -// absPath returns the absolute path of a file -func absPath(fname string) (string, error) { - if strings.HasPrefix(fname, "http") { - return fname, nil - } - if filepath.IsAbs(fname) { - return fname, nil - } - wd, err := os.Getwd() - return filepath.Join(wd, fname), err -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/operation.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/operation.go deleted file mode 100644 index b1ebd59945b7..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/operation.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "sort" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -func init() { - //gob.Register(map[string][]interface{}{}) - gob.Register(map[string]interface{}{}) - gob.Register([]interface{}{}) -} - -// OperationProps describes an operation -// -// NOTES: -// - schemes, when present must be from [http, https, ws, wss]: see validate -// - Security is handled as a special case: see MarshalJSON function -type OperationProps struct { - Description string `json:"description,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` - Tags []string `json:"tags,omitempty"` - Summary string `json:"summary,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` - ID string `json:"operationId,omitempty"` - Deprecated bool `json:"deprecated,omitempty"` - Security []map[string][]string `json:"security,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` - Responses *Responses `json:"responses,omitempty"` -} - -// MarshalJSON takes care of serializing operation properties to JSON -// -// We use a custom marhaller here to handle a special cases related to -// the Security field. We need to preserve zero length slice -// while omitting the field when the value is nil/unset. -func (op OperationProps) MarshalJSON() ([]byte, error) { - type Alias OperationProps - if op.Security == nil { - return json.Marshal(&struct { - Security []map[string][]string `json:"security,omitempty"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) - } - return json.Marshal(&struct { - Security []map[string][]string `json:"security"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) -} - -// Operation describes a single API operation on a path. -// -// For more information: http://goo.gl/8us55a#operationObject -type Operation struct { - VendorExtensible - OperationProps -} - -// SuccessResponse gets a success response model -func (o *Operation) SuccessResponse() (*Response, int, bool) { - if o.Responses == nil { - return nil, 0, false - } - - responseCodes := make([]int, 0, len(o.Responses.StatusCodeResponses)) - for k := range o.Responses.StatusCodeResponses { - if k >= 200 && k < 300 { - responseCodes = append(responseCodes, k) - } - } - if len(responseCodes) > 0 { - sort.Ints(responseCodes) - v := o.Responses.StatusCodeResponses[responseCodes[0]] - return &v, responseCodes[0], true - } - - return o.Responses.Default, 0, false -} - -// JSONLookup look up a value by the json property name -func (o Operation) JSONLookup(token string) (interface{}, error) { - if ex, ok := o.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(o.OperationProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (o *Operation) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &o.OperationProps); err != nil { - return err - } - return json.Unmarshal(data, &o.VendorExtensible) -} - -// MarshalJSON converts this items object to JSON -func (o Operation) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(o.OperationProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(o.VendorExtensible) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} - -// NewOperation creates a new operation instance. -// It expects an ID as parameter but not passing an ID is also valid. -func NewOperation(id string) *Operation { - op := new(Operation) - op.ID = id - return op -} - -// WithID sets the ID property on this operation, allows for chaining. -func (o *Operation) WithID(id string) *Operation { - o.ID = id - return o -} - -// WithDescription sets the description on this operation, allows for chaining -func (o *Operation) WithDescription(description string) *Operation { - o.Description = description - return o -} - -// WithSummary sets the summary on this operation, allows for chaining -func (o *Operation) WithSummary(summary string) *Operation { - o.Summary = summary - return o -} - -// WithExternalDocs sets/removes the external docs for/from this operation. -// When you pass empty strings as params the external documents will be removed. -// When you pass non-empty string as one value then those values will be used on the external docs object. -// So when you pass a non-empty description, you should also pass the url and vice versa. -func (o *Operation) WithExternalDocs(description, url string) *Operation { - if description == "" && url == "" { - o.ExternalDocs = nil - return o - } - - if o.ExternalDocs == nil { - o.ExternalDocs = &ExternalDocumentation{} - } - o.ExternalDocs.Description = description - o.ExternalDocs.URL = url - return o -} - -// Deprecate marks the operation as deprecated -func (o *Operation) Deprecate() *Operation { - o.Deprecated = true - return o -} - -// Undeprecate marks the operation as not deprected -func (o *Operation) Undeprecate() *Operation { - o.Deprecated = false - return o -} - -// WithConsumes adds media types for incoming body values -func (o *Operation) WithConsumes(mediaTypes ...string) *Operation { - o.Consumes = append(o.Consumes, mediaTypes...) - return o -} - -// WithProduces adds media types for outgoing body values -func (o *Operation) WithProduces(mediaTypes ...string) *Operation { - o.Produces = append(o.Produces, mediaTypes...) - return o -} - -// WithTags adds tags for this operation -func (o *Operation) WithTags(tags ...string) *Operation { - o.Tags = append(o.Tags, tags...) - return o -} - -// AddParam adds a parameter to this operation, when a parameter for that location -// and with that name already exists it will be replaced -func (o *Operation) AddParam(param *Parameter) *Operation { - if param == nil { - return o - } - - for i, p := range o.Parameters { - if p.Name == param.Name && p.In == param.In { - params := append(o.Parameters[:i], *param) - params = append(params, o.Parameters[i+1:]...) - o.Parameters = params - return o - } - } - - o.Parameters = append(o.Parameters, *param) - return o -} - -// RemoveParam removes a parameter from the operation -func (o *Operation) RemoveParam(name, in string) *Operation { - for i, p := range o.Parameters { - if p.Name == name && p.In == in { - o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...) - return o - } - } - return o -} - -// SecuredWith adds a security scope to this operation. -func (o *Operation) SecuredWith(name string, scopes ...string) *Operation { - o.Security = append(o.Security, map[string][]string{name: scopes}) - return o -} - -// WithDefaultResponse adds a default response to the operation. -// Passing a nil value will remove the response -func (o *Operation) WithDefaultResponse(response *Response) *Operation { - return o.RespondsWith(0, response) -} - -// RespondsWith adds a status code response to the operation. -// When the code is 0 the value of the response will be used as default response value. -// When the value of the response is nil it will be removed from the operation -func (o *Operation) RespondsWith(code int, response *Response) *Operation { - if o.Responses == nil { - o.Responses = new(Responses) - } - if code == 0 { - o.Responses.Default = response - return o - } - if response == nil { - delete(o.Responses.StatusCodeResponses, code) - return o - } - if o.Responses.StatusCodeResponses == nil { - o.Responses.StatusCodeResponses = make(map[int]Response) - } - o.Responses.StatusCodeResponses[code] = *response - return o -} - -type opsAlias OperationProps - -type gobAlias struct { - Security []map[string]struct { - List []string - Pad bool - } - Alias *opsAlias - SecurityIsEmpty bool -} - -// GobEncode provides a safe gob encoder for Operation, including empty security requirements -func (o Operation) GobEncode() ([]byte, error) { - raw := struct { - Ext VendorExtensible - Props OperationProps - }{ - Ext: o.VendorExtensible, - Props: o.OperationProps, - } - var b bytes.Buffer - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Operation, including empty security requirements -func (o *Operation) GobDecode(b []byte) error { - var raw struct { - Ext VendorExtensible - Props OperationProps - } - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - o.VendorExtensible = raw.Ext - o.OperationProps = raw.Props - return nil -} - -// GobEncode provides a safe gob encoder for Operation, including empty security requirements -func (op OperationProps) GobEncode() ([]byte, error) { - raw := gobAlias{ - Alias: (*opsAlias)(&op), - } - - var b bytes.Buffer - if op.Security == nil { - // nil security requirement - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - if len(op.Security) == 0 { - // empty, but non-nil security requirement - raw.SecurityIsEmpty = true - raw.Alias.Security = nil - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - raw.Security = make([]map[string]struct { - List []string - Pad bool - }, 0, len(op.Security)) - for _, req := range op.Security { - v := make(map[string]struct { - List []string - Pad bool - }, len(req)) - for k, val := range req { - v[k] = struct { - List []string - Pad bool - }{ - List: val, - } - } - raw.Security = append(raw.Security, v) - } - - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Operation, including empty security requirements -func (op *OperationProps) GobDecode(b []byte) error { - var raw gobAlias - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - if raw.Alias == nil { - return nil - } - - switch { - case raw.SecurityIsEmpty: - // empty, but non-nil security requirement - raw.Alias.Security = []map[string][]string{} - case len(raw.Alias.Security) == 0: - // nil security requirement - raw.Alias.Security = nil - default: - raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) - for _, req := range raw.Security { - v := make(map[string][]string, len(req)) - for k, val := range req { - v[k] = make([]string, 0, len(val.List)) - v[k] = append(v[k], val.List...) - } - raw.Alias.Security = append(raw.Alias.Security, v) - } - } - - *op = *(*OperationProps)(raw.Alias) - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/parameter.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/parameter.go deleted file mode 100644 index cecdff54568d..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/parameter.go +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// QueryParam creates a query parameter -func QueryParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "query"}} -} - -// HeaderParam creates a header parameter, this is always required by default -func HeaderParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "header", Required: true}} -} - -// PathParam creates a path parameter, this is always required -func PathParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "path", Required: true}} -} - -// BodyParam creates a body parameter -func BodyParam(name string, schema *Schema) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema}, - SimpleSchema: SimpleSchema{Type: "object"}} -} - -// FormDataParam creates a body parameter -func FormDataParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}} -} - -// FileParam creates a body parameter -func FileParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}, - SimpleSchema: SimpleSchema{Type: "file"}} -} - -// SimpleArrayParam creates a param for a simple array (string, int, date etc) -func SimpleArrayParam(name, tpe, fmt string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name}, - SimpleSchema: SimpleSchema{Type: jsonArray, CollectionFormat: "csv", - Items: &Items{SimpleSchema: SimpleSchema{Type: "string", Format: fmt}}}} -} - -// ParamRef creates a parameter that's a json reference -func ParamRef(uri string) *Parameter { - p := new(Parameter) - p.Ref = MustCreateRef(uri) - return p -} - -// ParamProps describes the specific attributes of an operation parameter -// -// NOTE: -// - Schema is defined when "in" == "body": see validate -// - AllowEmptyValue is allowed where "in" == "query" || "formData" -type ParamProps struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - In string `json:"in,omitempty"` - Required bool `json:"required,omitempty"` - Schema *Schema `json:"schema,omitempty"` - AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` -} - -// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). -// -// There are five possible parameter types. -// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part -// of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, -// the path parameter is `itemId`. -// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`. -// * Header - Custom headers that are expected as part of the request. -// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be -// _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for -// documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist -// together for the same operation. -// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or -// `multipart/form-data` are used as the content type of the request (in Swagger's definition, -// the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used -// to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be -// declared together with a body parameter for the same operation. Form parameters have a different format based on -// the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4). -// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. -// For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple -// parameters that are being transferred. -// * `multipart/form-data` - each parameter takes a section in the payload with an internal header. -// For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is -// `submit-name`. This type of form parameters is more commonly used for file transfers. -// -// For more information: http://goo.gl/8us55a#parameterObject -type Parameter struct { - Refable - CommonValidations - SimpleSchema - VendorExtensible - ParamProps -} - -// JSONLookup look up a value by the json property name -func (p Parameter) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == jsonRef { - return &p.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(p.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.ParamProps, token) - return r, err -} - -// WithDescription a fluent builder method for the description of the parameter -func (p *Parameter) WithDescription(description string) *Parameter { - p.Description = description - return p -} - -// Named a fluent builder method to override the name of the parameter -func (p *Parameter) Named(name string) *Parameter { - p.Name = name - return p -} - -// WithLocation a fluent builder method to override the location of the parameter -func (p *Parameter) WithLocation(in string) *Parameter { - p.In = in - return p -} - -// Typed a fluent builder method for the type of the parameter value -func (p *Parameter) Typed(tpe, format string) *Parameter { - p.Type = tpe - p.Format = format - return p -} - -// CollectionOf a fluent builder method for an array parameter -func (p *Parameter) CollectionOf(items *Items, format string) *Parameter { - p.Type = jsonArray - p.Items = items - p.CollectionFormat = format - return p -} - -// WithDefault sets the default value on this parameter -func (p *Parameter) WithDefault(defaultValue interface{}) *Parameter { - p.AsOptional() // with default implies optional - p.Default = defaultValue - return p -} - -// AllowsEmptyValues flags this parameter as being ok with empty values -func (p *Parameter) AllowsEmptyValues() *Parameter { - p.AllowEmptyValue = true - return p -} - -// NoEmptyValues flags this parameter as not liking empty values -func (p *Parameter) NoEmptyValues() *Parameter { - p.AllowEmptyValue = false - return p -} - -// AsOptional flags this parameter as optional -func (p *Parameter) AsOptional() *Parameter { - p.Required = false - return p -} - -// AsRequired flags this parameter as required -func (p *Parameter) AsRequired() *Parameter { - if p.Default != nil { // with a default required makes no sense - return p - } - p.Required = true - return p -} - -// WithMaxLength sets a max length value -func (p *Parameter) WithMaxLength(max int64) *Parameter { - p.MaxLength = &max - return p -} - -// WithMinLength sets a min length value -func (p *Parameter) WithMinLength(min int64) *Parameter { - p.MinLength = &min - return p -} - -// WithPattern sets a pattern value -func (p *Parameter) WithPattern(pattern string) *Parameter { - p.Pattern = pattern - return p -} - -// WithMultipleOf sets a multiple of value -func (p *Parameter) WithMultipleOf(number float64) *Parameter { - p.MultipleOf = &number - return p -} - -// WithMaximum sets a maximum number value -func (p *Parameter) WithMaximum(max float64, exclusive bool) *Parameter { - p.Maximum = &max - p.ExclusiveMaximum = exclusive - return p -} - -// WithMinimum sets a minimum number value -func (p *Parameter) WithMinimum(min float64, exclusive bool) *Parameter { - p.Minimum = &min - p.ExclusiveMinimum = exclusive - return p -} - -// WithEnum sets a the enum values (replace) -func (p *Parameter) WithEnum(values ...interface{}) *Parameter { - p.Enum = append([]interface{}{}, values...) - return p -} - -// WithMaxItems sets the max items -func (p *Parameter) WithMaxItems(size int64) *Parameter { - p.MaxItems = &size - return p -} - -// WithMinItems sets the min items -func (p *Parameter) WithMinItems(size int64) *Parameter { - p.MinItems = &size - return p -} - -// UniqueValues dictates that this array can only have unique items -func (p *Parameter) UniqueValues() *Parameter { - p.UniqueItems = true - return p -} - -// AllowDuplicates this array can have duplicates -func (p *Parameter) AllowDuplicates() *Parameter { - p.UniqueItems = false - return p -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *Parameter) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &p.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &p.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &p.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &p.ParamProps) -} - -// MarshalJSON converts this items object to JSON -func (p Parameter) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(p.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(p.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(p.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - b5, err := json.Marshal(p.ParamProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b3, b1, b2, b4, b5), nil -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/schema_loader.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/schema_loader.go deleted file mode 100644 index 961d477571a0..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/schema_loader.go +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "log" - "net/url" - "reflect" - "strings" - - "github.com/go-openapi/swag" -) - -// PathLoader function to use when loading remote refs -var PathLoader func(string) (json.RawMessage, error) - -func init() { - PathLoader = func(path string) (json.RawMessage, error) { - data, err := swag.LoadFromFileOrHTTP(path) - if err != nil { - return nil, err - } - return json.RawMessage(data), nil - } -} - -// resolverContext allows to share a context during spec processing. -// At the moment, it just holds the index of circular references found. -type resolverContext struct { - // circulars holds all visited circular references, which allows shortcuts. - // NOTE: this is not just a performance improvement: it is required to figure out - // circular references which participate several cycles. - // This structure is privately instantiated and needs not be locked against - // concurrent access, unless we chose to implement a parallel spec walking. - circulars map[string]bool - basePath string -} - -func newResolverContext(originalBasePath string) *resolverContext { - return &resolverContext{ - circulars: make(map[string]bool), - basePath: originalBasePath, // keep the root base path in context - } -} - -type schemaLoader struct { - root interface{} - options *ExpandOptions - cache ResolutionCache - context *resolverContext - loadDoc func(string) (json.RawMessage, error) -} - -func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) (*schemaLoader, error) { - if ref.IsRoot() || ref.HasFragmentOnly { - return r, nil - } - - baseRef, _ := NewRef(basePath) - currentRef := normalizeFileRef(&ref, basePath) - if strings.HasPrefix(currentRef.String(), baseRef.String()) { - return r, nil - } - - // Set a new root to resolve against - rootURL := currentRef.GetURL() - rootURL.Fragment = "" - root, _ := r.cache.Get(rootURL.String()) - - // shallow copy of resolver options to set a new RelativeBase when - // traversing multiple documents - newOptions := r.options - newOptions.RelativeBase = rootURL.String() - debugLog("setting new root: %s", newOptions.RelativeBase) - return defaultSchemaLoader(root, newOptions, r.cache, r.context) -} - -func (r *schemaLoader) updateBasePath(transitive *schemaLoader, basePath string) string { - if transitive != r { - debugLog("got a new resolver") - if transitive.options != nil && transitive.options.RelativeBase != "" { - basePath, _ = absPath(transitive.options.RelativeBase) - debugLog("new basePath = %s", basePath) - } - } - return basePath -} - -func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) error { - tgt := reflect.ValueOf(target) - if tgt.Kind() != reflect.Ptr { - return fmt.Errorf("resolve ref: target needs to be a pointer") - } - - refURL := ref.GetURL() - if refURL == nil { - return nil - } - - var res interface{} - var data interface{} - var err error - // Resolve against the root if it isn't nil, and if ref is pointing at the root, or has a fragment only which means - // it is pointing somewhere in the root. - root := r.root - if (ref.IsRoot() || ref.HasFragmentOnly) && root == nil && basePath != "" { - if baseRef, erb := NewRef(basePath); erb == nil { - root, _, _, _ = r.load(baseRef.GetURL()) - } - } - if (ref.IsRoot() || ref.HasFragmentOnly) && root != nil { - data = root - } else { - baseRef := normalizeFileRef(ref, basePath) - debugLog("current ref is: %s", ref.String()) - debugLog("current ref normalized file: %s", baseRef.String()) - data, _, _, err = r.load(baseRef.GetURL()) - if err != nil { - return err - } - } - - res = data - if ref.String() != "" { - res, _, err = ref.GetPointer().Get(data) - if err != nil { - return err - } - } - return swag.DynamicJSONToStruct(res, target) -} - -func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) { - debugLog("loading schema from url: %s", refURL) - toFetch := *refURL - toFetch.Fragment = "" - - normalized := normalizeAbsPath(toFetch.String()) - - data, fromCache := r.cache.Get(normalized) - if !fromCache { - b, err := r.loadDoc(normalized) - if err != nil { - debugLog("unable to load the document: %v", err) - return nil, url.URL{}, false, err - } - - if err := json.Unmarshal(b, &data); err != nil { - return nil, url.URL{}, false, err - } - r.cache.Set(normalized, data) - } - - return data, toFetch, fromCache, nil -} - -// isCircular detects cycles in sequences of $ref. -// It relies on a private context (which needs not be locked). -func (r *schemaLoader) isCircular(ref *Ref, basePath string, parentRefs ...string) (foundCycle bool) { - normalizedRef := normalizePaths(ref.String(), basePath) - if _, ok := r.context.circulars[normalizedRef]; ok { - // circular $ref has been already detected in another explored cycle - foundCycle = true - return - } - foundCycle = swag.ContainsStringsCI(parentRefs, normalizedRef) - if foundCycle { - r.context.circulars[normalizedRef] = true - } - return -} - -// Resolve resolves a reference against basePath and stores the result in target -// Resolve is not in charge of following references, it only resolves ref by following its URL -// if the schema that ref is referring to has more refs in it. Resolve doesn't resolve them -// if basePath is an empty string, ref is resolved against the root schema stored in the schemaLoader struct -func (r *schemaLoader) Resolve(ref *Ref, target interface{}, basePath string) error { - return r.resolveRef(ref, target, basePath) -} - -func (r *schemaLoader) deref(input interface{}, parentRefs []string, basePath string) error { - var ref *Ref - switch refable := input.(type) { - case *Schema: - ref = &refable.Ref - case *Parameter: - ref = &refable.Ref - case *Response: - ref = &refable.Ref - case *PathItem: - ref = &refable.Ref - default: - return fmt.Errorf("deref: unsupported type %T", input) - } - - curRef := ref.String() - if curRef != "" { - normalizedRef := normalizeFileRef(ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if r.isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := r.resolveRef(ref, input, basePath); r.shouldStopOnError(err) { - return err - } - - // NOTE(fredbi): removed basePath check => needs more testing - if ref.String() != "" && ref.String() != curRef { - parentRefs = append(parentRefs, normalizedRef.String()) - return r.deref(input, parentRefs, normalizedBasePath) - } - } - - return nil -} - -func (r *schemaLoader) shouldStopOnError(err error) bool { - if err != nil && !r.options.ContinueOnError { - return true - } - - if err != nil { - log.Println(err) - } - - return false -} - -func defaultSchemaLoader( - root interface{}, - expandOptions *ExpandOptions, - cache ResolutionCache, - context *resolverContext) (*schemaLoader, error) { - - if cache == nil { - cache = resCache - } - if expandOptions == nil { - expandOptions = &ExpandOptions{} - } - absBase, _ := absPath(expandOptions.RelativeBase) - if context == nil { - context = newResolverContext(absBase) - } - return &schemaLoader{ - root: root, - options: expandOptions, - cache: cache, - context: context, - loadDoc: func(path string) (json.RawMessage, error) { - debugLog("fetching document at %q", path) - return PathLoader(path) - }, - }, nil -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/spec.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/spec.go deleted file mode 100644 index 0bb045bc06ad..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/spec.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import "encoding/json" - -//go:generate curl -L --progress -o ./schemas/v2/schema.json http://swagger.io/v2/schema.json -//go:generate curl -L --progress -o ./schemas/jsonschema-draft-04.json http://json-schema.org/draft-04/schema -//go:generate go-bindata -pkg=spec -prefix=./schemas -ignore=.*\.md ./schemas/... -//go:generate perl -pi -e s,Json,JSON,g bindata.go - -const ( - // SwaggerSchemaURL the url for the swagger 2.0 schema to validate specs - SwaggerSchemaURL = "http://swagger.io/v2/schema.json#" - // JSONSchemaURL the url for the json schema schema - JSONSchemaURL = "http://json-schema.org/draft-04/schema#" -) - -var ( - jsonSchema *Schema - swaggerSchema *Schema -) - -func init() { - jsonSchema = MustLoadJSONSchemaDraft04() - swaggerSchema = MustLoadSwagger20Schema() -} - -// MustLoadJSONSchemaDraft04 panics when Swagger20Schema returns an error -func MustLoadJSONSchemaDraft04() *Schema { - d, e := JSONSchemaDraft04() - if e != nil { - panic(e) - } - return d -} - -// JSONSchemaDraft04 loads the json schema document for json shema draft04 -func JSONSchemaDraft04() (*Schema, error) { - b, err := Asset("jsonschema-draft-04.json") - if err != nil { - return nil, err - } - - schema := new(Schema) - if err := json.Unmarshal(b, schema); err != nil { - return nil, err - } - return schema, nil -} - -// MustLoadSwagger20Schema panics when Swagger20Schema returns an error -func MustLoadSwagger20Schema() *Schema { - d, e := Swagger20Schema() - if e != nil { - panic(e) - } - return d -} - -// Swagger20Schema loads the swagger 2.0 schema from the embedded assets -func Swagger20Schema() (*Schema, error) { - - b, err := Asset("v2/schema.json") - if err != nil { - return nil, err - } - - schema := new(Schema) - if err := json.Unmarshal(b, schema); err != nil { - return nil, err - } - return schema, nil -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/unused.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/unused.go deleted file mode 100644 index aa12b56f6e49..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/unused.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -/* - -import ( - "net/url" - "os" - "path" - "path/filepath" - - "github.com/go-openapi/jsonpointer" -) - - // Some currently unused functions and definitions that - // used to be part of the expander. - - // Moved here for the record and possible future reuse - -var ( - idPtr, _ = jsonpointer.New("/id") - refPtr, _ = jsonpointer.New("/$ref") -) - -func idFromNode(node interface{}) (*Ref, error) { - if idValue, _, err := idPtr.Get(node); err == nil { - if refStr, ok := idValue.(string); ok && refStr != "" { - idRef, err := NewRef(refStr) - if err != nil { - return nil, err - } - return &idRef, nil - } - } - return nil, nil -} - -func nextRef(startingNode interface{}, startingRef *Ref, ptr *jsonpointer.Pointer) *Ref { - if startingRef == nil { - return nil - } - - if ptr == nil { - return startingRef - } - - ret := startingRef - var idRef *Ref - node := startingNode - - for _, tok := range ptr.DecodedTokens() { - node, _, _ = jsonpointer.GetForToken(node, tok) - if node == nil { - break - } - - idRef, _ = idFromNode(node) - if idRef != nil { - nw, err := ret.Inherits(*idRef) - if err != nil { - break - } - ret = nw - } - - refRef, _, _ := refPtr.Get(node) - if refRef != nil { - var rf Ref - switch value := refRef.(type) { - case string: - rf, _ = NewRef(value) - } - nw, err := ret.Inherits(rf) - if err != nil { - break - } - nwURL := nw.GetURL() - if nwURL.Scheme == "file" || (nwURL.Scheme == "" && nwURL.Host == "") { - nwpt := filepath.ToSlash(nwURL.Path) - if filepath.IsAbs(nwpt) { - _, err := os.Stat(nwpt) - if err != nil { - nwURL.Path = filepath.Join(".", nwpt) - } - } - } - - ret = nw - } - - } - - return ret -} - -// basePathFromSchemaID returns a new basePath based on an existing basePath and a schema ID -func basePathFromSchemaID(oldBasePath, id string) string { - u, err := url.Parse(oldBasePath) - if err != nil { - panic(err) - } - uid, err := url.Parse(id) - if err != nil { - panic(err) - } - - if path.IsAbs(uid.Path) { - return id - } - u.Path = path.Join(path.Dir(u.Path), uid.Path) - return u.String() -} -*/ - -// type ExtraSchemaProps map[string]interface{} - -// // JSONSchema represents a structure that is a json schema draft 04 -// type JSONSchema struct { -// SchemaProps -// ExtraSchemaProps -// } - -// // MarshalJSON marshal this to JSON -// func (s JSONSchema) MarshalJSON() ([]byte, error) { -// b1, err := json.Marshal(s.SchemaProps) -// if err != nil { -// return nil, err -// } -// b2, err := s.Ref.MarshalJSON() -// if err != nil { -// return nil, err -// } -// b3, err := s.Schema.MarshalJSON() -// if err != nil { -// return nil, err -// } -// b4, err := json.Marshal(s.ExtraSchemaProps) -// if err != nil { -// return nil, err -// } -// return swag.ConcatJSON(b1, b2, b3, b4), nil -// } - -// // UnmarshalJSON marshal this from JSON -// func (s *JSONSchema) UnmarshalJSON(data []byte) error { -// var sch JSONSchema -// if err := json.Unmarshal(data, &sch.SchemaProps); err != nil { -// return err -// } -// if err := json.Unmarshal(data, &sch.Ref); err != nil { -// return err -// } -// if err := json.Unmarshal(data, &sch.Schema); err != nil { -// return err -// } -// if err := json.Unmarshal(data, &sch.ExtraSchemaProps); err != nil { -// return err -// } -// *s = sch -// return nil -// } diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/xml_object.go b/cluster-autoscaler/vendor/github.com/go-openapi/spec/xml_object.go deleted file mode 100644 index 945a46703d55..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/xml_object.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// XMLObject a metadata object that allows for more fine-tuned XML model definitions. -// -// For more information: http://goo.gl/8us55a#xmlObject -type XMLObject struct { - Name string `json:"name,omitempty"` - Namespace string `json:"namespace,omitempty"` - Prefix string `json:"prefix,omitempty"` - Attribute bool `json:"attribute,omitempty"` - Wrapped bool `json:"wrapped,omitempty"` -} - -// WithName sets the xml name for the object -func (x *XMLObject) WithName(name string) *XMLObject { - x.Name = name - return x -} - -// WithNamespace sets the xml namespace for the object -func (x *XMLObject) WithNamespace(namespace string) *XMLObject { - x.Namespace = namespace - return x -} - -// WithPrefix sets the xml prefix for the object -func (x *XMLObject) WithPrefix(prefix string) *XMLObject { - x.Prefix = prefix - return x -} - -// AsAttribute flags this object as xml attribute -func (x *XMLObject) AsAttribute() *XMLObject { - x.Attribute = true - return x -} - -// AsElement flags this object as an xml node -func (x *XMLObject) AsElement() *XMLObject { - x.Attribute = false - return x -} - -// AsWrapped flags this object as wrapped, this is mostly useful for array types -func (x *XMLObject) AsWrapped() *XMLObject { - x.Wrapped = true - return x -} - -// AsUnwrapped flags this object as an xml node -func (x *XMLObject) AsUnwrapped() *XMLObject { - x.Wrapped = false - return x -} diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/.gitignore b/cluster-autoscaler/vendor/github.com/gofrs/uuid/.gitignore new file mode 100644 index 000000000000..666dbbb5bcd3 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/.gitignore @@ -0,0 +1,15 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# binary bundle generated by go-fuzz +uuid-fuzz.zip diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/.travis.yml b/cluster-autoscaler/vendor/github.com/gofrs/uuid/.travis.yml new file mode 100644 index 000000000000..0783aaa9c4cf --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/.travis.yml @@ -0,0 +1,22 @@ +language: go +sudo: false +go: + - 1.7.x + - 1.8.x + - 1.9.x + - 1.10.x + - 1.11.x + - 1.12.x + - tip +matrix: + allow_failures: + - go: tip + fast_finish: true +before_install: + - go get golang.org/x/tools/cmd/cover +script: + - go test ./... -race -coverprofile=coverage.txt -covermode=atomic +after_success: + - bash <(curl -s https://codecov.io/bash) +notifications: + email: false diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/LICENSE b/cluster-autoscaler/vendor/github.com/gofrs/uuid/LICENSE new file mode 100644 index 000000000000..926d54987029 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/LICENSE @@ -0,0 +1,20 @@ +Copyright (C) 2013-2018 by Maxim Bublis + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/README.md b/cluster-autoscaler/vendor/github.com/gofrs/uuid/README.md new file mode 100644 index 000000000000..2685a832e384 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/README.md @@ -0,0 +1,108 @@ +# UUID + +[![License](https://img.shields.io/github/license/gofrs/uuid.svg)](https://github.com/gofrs/uuid/blob/master/LICENSE) +[![Build Status](https://travis-ci.org/gofrs/uuid.svg?branch=master)](https://travis-ci.org/gofrs/uuid) +[![GoDoc](http://godoc.org/github.com/gofrs/uuid?status.svg)](http://godoc.org/github.com/gofrs/uuid) +[![Coverage Status](https://codecov.io/gh/gofrs/uuid/branch/master/graphs/badge.svg?branch=master)](https://codecov.io/gh/gofrs/uuid/) +[![Go Report Card](https://goreportcard.com/badge/github.com/gofrs/uuid)](https://goreportcard.com/report/github.com/gofrs/uuid) + +Package uuid provides a pure Go implementation of Universally Unique Identifiers +(UUID) variant as defined in RFC-4122. This package supports both the creation +and parsing of UUIDs in different formats. + +This package supports the following UUID versions: +* Version 1, based on timestamp and MAC address (RFC-4122) +* Version 3, based on MD5 hashing of a named value (RFC-4122) +* Version 4, based on random numbers (RFC-4122) +* Version 5, based on SHA-1 hashing of a named value (RFC-4122) + +## Project History + +This project was originally forked from the +[github.com/satori/go.uuid](https://github.com/satori/go.uuid) repository after +it appeared to be no longer maintained, while exhibiting [critical +flaws](https://github.com/satori/go.uuid/issues/73). We have decided to take +over this project to ensure it receives regular maintenance for the benefit of +the larger Go community. + +We'd like to thank Maxim Bublis for his hard work on the original iteration of +the package. + +## License + +This source code of this package is released under the MIT License. Please see +the [LICENSE](https://github.com/gofrs/uuid/blob/master/LICENSE) for the full +content of the license. + +## Recommended Package Version + +We recommend using v2.0.0+ of this package, as versions prior to 2.0.0 were +created before our fork of the original package and have some known +deficiencies. + +## Installation + +It is recommended to use a package manager like `dep` that understands tagged +releases of a package, as well as semantic versioning. + +If you are unable to make use of a dependency manager with your project, you can +use the `go get` command to download it directly: + +```Shell +$ go get github.com/gofrs/uuid +``` + +## Requirements + +Due to subtests not being supported in older versions of Go, this package is +only regularly tested against Go 1.7+. This package may work perfectly fine with +Go 1.2+, but support for these older versions is not actively maintained. + +## Go 1.11 Modules + +As of v3.2.0, this repository no longer adopts Go modules, and v3.2.0 no longer has a `go.mod` file. As a result, v3.2.0 also drops support for the `github.com/gofrs/uuid/v3` import path. Only module-based consumers are impacted. With the v3.2.0 release, _all_ gofrs/uuid consumers should use the `github.com/gofrs/uuid` import path. + +An existing module-based consumer will continue to be able to build using the `github.com/gofrs/uuid/v3` import path using any valid consumer `go.mod` that worked prior to the publishing of v3.2.0, but any module-based consumer should start using the `github.com/gofrs/uuid` import path when possible and _must_ use the `github.com/gofrs/uuid` import path prior to upgrading to v3.2.0. + +Please refer to [Issue #61](https://github.com/gofrs/uuid/issues/61) and [Issue #66](https://github.com/gofrs/uuid/issues/66) for more details. + +## Usage + +Here is a quick overview of how to use this package. For more detailed +documentation, please see the [GoDoc Page](http://godoc.org/github.com/gofrs/uuid). + +```go +package main + +import ( + "log" + + "github.com/gofrs/uuid" +) + +// Create a Version 4 UUID, panicking on error. +// Use this form to initialize package-level variables. +var u1 = uuid.Must(uuid.NewV4()) + +func main() { + // Create a Version 4 UUID. + u2, err := uuid.NewV4() + if err != nil { + log.Fatalf("failed to generate UUID: %v", err) + } + log.Printf("generated Version 4 UUID %v", u2) + + // Parse a UUID from a string. + s := "6ba7b810-9dad-11d1-80b4-00c04fd430c8" + u3, err := uuid.FromString(s) + if err != nil { + log.Fatalf("failed to parse UUID %q: %v", s, err) + } + log.Printf("successfully parsed UUID %v", u3) +} +``` + +## References + +* [RFC-4122](https://tools.ietf.org/html/rfc4122) +* [DCE 1.1: Authentication and Security Services](http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01) diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/codec.go b/cluster-autoscaler/vendor/github.com/gofrs/uuid/codec.go new file mode 100644 index 000000000000..e3014c68c663 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/codec.go @@ -0,0 +1,212 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "bytes" + "encoding/hex" + "fmt" +) + +// FromBytes returns a UUID generated from the raw byte slice input. +// It will return an error if the slice isn't 16 bytes long. +func FromBytes(input []byte) (UUID, error) { + u := UUID{} + err := u.UnmarshalBinary(input) + return u, err +} + +// FromBytesOrNil returns a UUID generated from the raw byte slice input. +// Same behavior as FromBytes(), but returns uuid.Nil instead of an error. +func FromBytesOrNil(input []byte) UUID { + uuid, err := FromBytes(input) + if err != nil { + return Nil + } + return uuid +} + +// FromString returns a UUID parsed from the input string. +// Input is expected in a form accepted by UnmarshalText. +func FromString(input string) (UUID, error) { + u := UUID{} + err := u.UnmarshalText([]byte(input)) + return u, err +} + +// FromStringOrNil returns a UUID parsed from the input string. +// Same behavior as FromString(), but returns uuid.Nil instead of an error. +func FromStringOrNil(input string) UUID { + uuid, err := FromString(input) + if err != nil { + return Nil + } + return uuid +} + +// MarshalText implements the encoding.TextMarshaler interface. +// The encoding is the same as returned by the String() method. +func (u UUID) MarshalText() ([]byte, error) { + return []byte(u.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +// Following formats are supported: +// +// "6ba7b810-9dad-11d1-80b4-00c04fd430c8", +// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", +// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" +// "6ba7b8109dad11d180b400c04fd430c8" +// "{6ba7b8109dad11d180b400c04fd430c8}", +// "urn:uuid:6ba7b8109dad11d180b400c04fd430c8" +// +// ABNF for supported UUID text representation follows: +// +// URN := 'urn' +// UUID-NID := 'uuid' +// +// hexdig := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | +// 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | +// 'A' | 'B' | 'C' | 'D' | 'E' | 'F' +// +// hexoct := hexdig hexdig +// 2hexoct := hexoct hexoct +// 4hexoct := 2hexoct 2hexoct +// 6hexoct := 4hexoct 2hexoct +// 12hexoct := 6hexoct 6hexoct +// +// hashlike := 12hexoct +// canonical := 4hexoct '-' 2hexoct '-' 2hexoct '-' 6hexoct +// +// plain := canonical | hashlike +// uuid := canonical | hashlike | braced | urn +// +// braced := '{' plain '}' | '{' hashlike '}' +// urn := URN ':' UUID-NID ':' plain +// +func (u *UUID) UnmarshalText(text []byte) error { + switch len(text) { + case 32: + return u.decodeHashLike(text) + case 34, 38: + return u.decodeBraced(text) + case 36: + return u.decodeCanonical(text) + case 41, 45: + return u.decodeURN(text) + default: + return fmt.Errorf("uuid: incorrect UUID length %d in string %q", len(text), text) + } +} + +// decodeCanonical decodes UUID strings that are formatted as defined in RFC-4122 (section 3): +// "6ba7b810-9dad-11d1-80b4-00c04fd430c8". +func (u *UUID) decodeCanonical(t []byte) error { + if t[8] != '-' || t[13] != '-' || t[18] != '-' || t[23] != '-' { + return fmt.Errorf("uuid: incorrect UUID format in string %q", t) + } + + src := t + dst := u[:] + + for i, byteGroup := range byteGroups { + if i > 0 { + src = src[1:] // skip dash + } + _, err := hex.Decode(dst[:byteGroup/2], src[:byteGroup]) + if err != nil { + return err + } + src = src[byteGroup:] + dst = dst[byteGroup/2:] + } + + return nil +} + +// decodeHashLike decodes UUID strings that are using the following format: +// "6ba7b8109dad11d180b400c04fd430c8". +func (u *UUID) decodeHashLike(t []byte) error { + src := t[:] + dst := u[:] + + _, err := hex.Decode(dst, src) + return err +} + +// decodeBraced decodes UUID strings that are using the following formats: +// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}" +// "{6ba7b8109dad11d180b400c04fd430c8}". +func (u *UUID) decodeBraced(t []byte) error { + l := len(t) + + if t[0] != '{' || t[l-1] != '}' { + return fmt.Errorf("uuid: incorrect UUID format in string %q", t) + } + + return u.decodePlain(t[1 : l-1]) +} + +// decodeURN decodes UUID strings that are using the following formats: +// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" +// "urn:uuid:6ba7b8109dad11d180b400c04fd430c8". +func (u *UUID) decodeURN(t []byte) error { + total := len(t) + + urnUUIDPrefix := t[:9] + + if !bytes.Equal(urnUUIDPrefix, urnPrefix) { + return fmt.Errorf("uuid: incorrect UUID format in string %q", t) + } + + return u.decodePlain(t[9:total]) +} + +// decodePlain decodes UUID strings that are using the following formats: +// "6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in hash-like format +// "6ba7b8109dad11d180b400c04fd430c8". +func (u *UUID) decodePlain(t []byte) error { + switch len(t) { + case 32: + return u.decodeHashLike(t) + case 36: + return u.decodeCanonical(t) + default: + return fmt.Errorf("uuid: incorrect UUID length %d in string %q", len(t), t) + } +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface. +func (u UUID) MarshalBinary() ([]byte, error) { + return u.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +// It will return an error if the slice isn't 16 bytes long. +func (u *UUID) UnmarshalBinary(data []byte) error { + if len(data) != Size { + return fmt.Errorf("uuid: UUID must be exactly 16 bytes long, got %d bytes", len(data)) + } + copy(u[:], data) + + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/fuzz.go b/cluster-autoscaler/vendor/github.com/gofrs/uuid/fuzz.go new file mode 100644 index 000000000000..afaefbc8e399 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/fuzz.go @@ -0,0 +1,47 @@ +// Copyright (c) 2018 Andrei Tudor Călin +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// +build gofuzz + +package uuid + +// Fuzz implements a simple fuzz test for FromString / UnmarshalText. +// +// To run: +// +// $ go get github.com/dvyukov/go-fuzz/... +// $ cd $GOPATH/src/github.com/gofrs/uuid +// $ go-fuzz-build github.com/gofrs/uuid +// $ go-fuzz -bin=uuid-fuzz.zip -workdir=./testdata +// +// If you make significant changes to FromString / UnmarshalText and add +// new cases to fromStringTests (in codec_test.go), please run +// +// $ go test -seed_fuzz_corpus +// +// to seed the corpus with the new interesting inputs, then run the fuzzer. +func Fuzz(data []byte) int { + _, err := FromString(string(data)) + if err != nil { + return 0 + } + return 1 +} diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/generator.go b/cluster-autoscaler/vendor/github.com/gofrs/uuid/generator.go new file mode 100644 index 000000000000..2783d9e7787f --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/generator.go @@ -0,0 +1,265 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "crypto/md5" + "crypto/rand" + "crypto/sha1" + "encoding/binary" + "fmt" + "hash" + "io" + "net" + "sync" + "time" +) + +// Difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970). +const epochStart = 122192928000000000 + +type epochFunc func() time.Time + +// HWAddrFunc is the function type used to provide hardware (MAC) addresses. +type HWAddrFunc func() (net.HardwareAddr, error) + +// DefaultGenerator is the default UUID Generator used by this package. +var DefaultGenerator Generator = NewGen() + +// NewV1 returns a UUID based on the current timestamp and MAC address. +func NewV1() (UUID, error) { + return DefaultGenerator.NewV1() +} + +// NewV3 returns a UUID based on the MD5 hash of the namespace UUID and name. +func NewV3(ns UUID, name string) UUID { + return DefaultGenerator.NewV3(ns, name) +} + +// NewV4 returns a randomly generated UUID. +func NewV4() (UUID, error) { + return DefaultGenerator.NewV4() +} + +// NewV5 returns a UUID based on SHA-1 hash of the namespace UUID and name. +func NewV5(ns UUID, name string) UUID { + return DefaultGenerator.NewV5(ns, name) +} + +// Generator provides an interface for generating UUIDs. +type Generator interface { + NewV1() (UUID, error) + NewV3(ns UUID, name string) UUID + NewV4() (UUID, error) + NewV5(ns UUID, name string) UUID +} + +// Gen is a reference UUID generator based on the specifications laid out in +// RFC-4122 and DCE 1.1: Authentication and Security Services. This type +// satisfies the Generator interface as defined in this package. +// +// For consumers who are generating V1 UUIDs, but don't want to expose the MAC +// address of the node generating the UUIDs, the NewGenWithHWAF() function has been +// provided as a convenience. See the function's documentation for more info. +// +// The authors of this package do not feel that the majority of users will need +// to obfuscate their MAC address, and so we recommend using NewGen() to create +// a new generator. +type Gen struct { + clockSequenceOnce sync.Once + hardwareAddrOnce sync.Once + storageMutex sync.Mutex + + rand io.Reader + + epochFunc epochFunc + hwAddrFunc HWAddrFunc + lastTime uint64 + clockSequence uint16 + hardwareAddr [6]byte +} + +// interface check -- build will fail if *Gen doesn't satisfy Generator +var _ Generator = (*Gen)(nil) + +// NewGen returns a new instance of Gen with some default values set. Most +// people should use this. +func NewGen() *Gen { + return NewGenWithHWAF(defaultHWAddrFunc) +} + +// NewGenWithHWAF builds a new UUID generator with the HWAddrFunc provided. Most +// consumers should use NewGen() instead. +// +// This is used so that consumers can generate their own MAC addresses, for use +// in the generated UUIDs, if there is some concern about exposing the physical +// address of the machine generating the UUID. +// +// The Gen generator will only invoke the HWAddrFunc once, and cache that MAC +// address for all the future UUIDs generated by it. If you'd like to switch the +// MAC address being used, you'll need to create a new generator using this +// function. +func NewGenWithHWAF(hwaf HWAddrFunc) *Gen { + return &Gen{ + epochFunc: time.Now, + hwAddrFunc: hwaf, + rand: rand.Reader, + } +} + +// NewV1 returns a UUID based on the current timestamp and MAC address. +func (g *Gen) NewV1() (UUID, error) { + u := UUID{} + + timeNow, clockSeq, err := g.getClockSequence() + if err != nil { + return Nil, err + } + binary.BigEndian.PutUint32(u[0:], uint32(timeNow)) + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) + binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) + binary.BigEndian.PutUint16(u[8:], clockSeq) + + hardwareAddr, err := g.getHardwareAddr() + if err != nil { + return Nil, err + } + copy(u[10:], hardwareAddr) + + u.SetVersion(V1) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +// NewV3 returns a UUID based on the MD5 hash of the namespace UUID and name. +func (g *Gen) NewV3(ns UUID, name string) UUID { + u := newFromHash(md5.New(), ns, name) + u.SetVersion(V3) + u.SetVariant(VariantRFC4122) + + return u +} + +// NewV4 returns a randomly generated UUID. +func (g *Gen) NewV4() (UUID, error) { + u := UUID{} + if _, err := io.ReadFull(g.rand, u[:]); err != nil { + return Nil, err + } + u.SetVersion(V4) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +// NewV5 returns a UUID based on SHA-1 hash of the namespace UUID and name. +func (g *Gen) NewV5(ns UUID, name string) UUID { + u := newFromHash(sha1.New(), ns, name) + u.SetVersion(V5) + u.SetVariant(VariantRFC4122) + + return u +} + +// getClockSequence returns the epoch and clock sequence. +func (g *Gen) getClockSequence() (uint64, uint16, error) { + var err error + g.clockSequenceOnce.Do(func() { + buf := make([]byte, 2) + if _, err = io.ReadFull(g.rand, buf); err != nil { + return + } + g.clockSequence = binary.BigEndian.Uint16(buf) + }) + if err != nil { + return 0, 0, err + } + + g.storageMutex.Lock() + defer g.storageMutex.Unlock() + + timeNow := g.getEpoch() + // Clock didn't change since last UUID generation. + // Should increase clock sequence. + if timeNow <= g.lastTime { + g.clockSequence++ + } + g.lastTime = timeNow + + return timeNow, g.clockSequence, nil +} + +// Returns the hardware address. +func (g *Gen) getHardwareAddr() ([]byte, error) { + var err error + g.hardwareAddrOnce.Do(func() { + var hwAddr net.HardwareAddr + if hwAddr, err = g.hwAddrFunc(); err == nil { + copy(g.hardwareAddr[:], hwAddr) + return + } + + // Initialize hardwareAddr randomly in case + // of real network interfaces absence. + if _, err = io.ReadFull(g.rand, g.hardwareAddr[:]); err != nil { + return + } + // Set multicast bit as recommended by RFC-4122 + g.hardwareAddr[0] |= 0x01 + }) + if err != nil { + return []byte{}, err + } + return g.hardwareAddr[:], nil +} + +// Returns the difference between UUID epoch (October 15, 1582) +// and current time in 100-nanosecond intervals. +func (g *Gen) getEpoch() uint64 { + return epochStart + uint64(g.epochFunc().UnixNano()/100) +} + +// Returns the UUID based on the hashing of the namespace UUID and name. +func newFromHash(h hash.Hash, ns UUID, name string) UUID { + u := UUID{} + h.Write(ns[:]) + h.Write([]byte(name)) + copy(u[:], h.Sum(nil)) + + return u +} + +// Returns the hardware address. +func defaultHWAddrFunc() (net.HardwareAddr, error) { + ifaces, err := net.Interfaces() + if err != nil { + return []byte{}, err + } + for _, iface := range ifaces { + if len(iface.HardwareAddr) >= 6 { + return iface.HardwareAddr, nil + } + } + return []byte{}, fmt.Errorf("uuid: no HW address found") +} diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/sql.go b/cluster-autoscaler/vendor/github.com/gofrs/uuid/sql.go new file mode 100644 index 000000000000..6f254a4fd107 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/sql.go @@ -0,0 +1,109 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "bytes" + "database/sql/driver" + "encoding/json" + "fmt" +) + +// Value implements the driver.Valuer interface. +func (u UUID) Value() (driver.Value, error) { + return u.String(), nil +} + +// Scan implements the sql.Scanner interface. +// A 16-byte slice will be handled by UnmarshalBinary, while +// a longer byte slice or a string will be handled by UnmarshalText. +func (u *UUID) Scan(src interface{}) error { + switch src := src.(type) { + case UUID: // support gorm convert from UUID to NullUUID + *u = src + return nil + + case []byte: + if len(src) == Size { + return u.UnmarshalBinary(src) + } + return u.UnmarshalText(src) + + case string: + return u.UnmarshalText([]byte(src)) + } + + return fmt.Errorf("uuid: cannot convert %T to UUID", src) +} + +// NullUUID can be used with the standard sql package to represent a +// UUID value that can be NULL in the database. +type NullUUID struct { + UUID UUID + Valid bool +} + +// Value implements the driver.Valuer interface. +func (u NullUUID) Value() (driver.Value, error) { + if !u.Valid { + return nil, nil + } + // Delegate to UUID Value function + return u.UUID.Value() +} + +// Scan implements the sql.Scanner interface. +func (u *NullUUID) Scan(src interface{}) error { + if src == nil { + u.UUID, u.Valid = Nil, false + return nil + } + + // Delegate to UUID Scan function + u.Valid = true + return u.UUID.Scan(src) +} + +// MarshalJSON marshals the NullUUID as null or the nested UUID +func (u NullUUID) MarshalJSON() ([]byte, error) { + if !u.Valid { + return json.Marshal(nil) + } + + return json.Marshal(u.UUID) +} + +// UnmarshalJSON unmarshals a NullUUID +func (u *NullUUID) UnmarshalJSON(b []byte) error { + if bytes.Equal(b, []byte("null")) { + u.UUID, u.Valid = Nil, false + return nil + } + + if err := json.Unmarshal(b, &u.UUID); err != nil { + return err + } + + u.Valid = true + + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/uuid.go b/cluster-autoscaler/vendor/github.com/gofrs/uuid/uuid.go new file mode 100644 index 000000000000..78aed6e2539b --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/uuid.go @@ -0,0 +1,258 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// Package uuid provides implementations of the Universally Unique Identifier +// (UUID), as specified in RFC-4122, +// +// RFC-4122[1] provides the specification for versions 1, 3, 4, and 5. +// +// DCE 1.1[2] provides the specification for version 2, but version 2 support +// was removed from this package in v4 due to some concerns with the +// specification itself. Reading the spec, it seems that it would result in +// generating UUIDs that aren't very unique. In having read the spec it seemed +// that our implementation did not meet the spec. It also seems to be at-odds +// with RFC 4122, meaning we would need quite a bit of special code to support +// it. Lastly, there were no Version 2 implementations that we could find to +// ensure we were understanding the specification correctly. +// +// [1] https://tools.ietf.org/html/rfc4122 +// [2] http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01 +package uuid + +import ( + "encoding/binary" + "encoding/hex" + "fmt" + "io" + "strings" + "time" +) + +// Size of a UUID in bytes. +const Size = 16 + +// UUID is an array type to represent the value of a UUID, as defined in RFC-4122. +type UUID [Size]byte + +// UUID versions. +const ( + _ byte = iota + V1 // Version 1 (date-time and MAC address) + _ // Version 2 (date-time and MAC address, DCE security version) [removed] + V3 // Version 3 (namespace name-based) + V4 // Version 4 (random) + V5 // Version 5 (namespace name-based) +) + +// UUID layout variants. +const ( + VariantNCS byte = iota + VariantRFC4122 + VariantMicrosoft + VariantFuture +) + +// UUID DCE domains. +const ( + DomainPerson = iota + DomainGroup + DomainOrg +) + +// Timestamp is the count of 100-nanosecond intervals since 00:00:00.00, +// 15 October 1582 within a V1 UUID. This type has no meaning for other +// UUID versions since they don't have an embedded timestamp. +type Timestamp uint64 + +const _100nsPerSecond = 10000000 + +// Time returns the UTC time.Time representation of a Timestamp +func (t Timestamp) Time() (time.Time, error) { + secs := uint64(t) / _100nsPerSecond + nsecs := 100 * (uint64(t) % _100nsPerSecond) + return time.Unix(int64(secs)-(epochStart/_100nsPerSecond), int64(nsecs)), nil +} + +// TimestampFromV1 returns the Timestamp embedded within a V1 UUID. +// Returns an error if the UUID is any version other than 1. +func TimestampFromV1(u UUID) (Timestamp, error) { + if u.Version() != 1 { + err := fmt.Errorf("uuid: %s is version %d, not version 1", u, u.Version()) + return 0, err + } + low := binary.BigEndian.Uint32(u[0:4]) + mid := binary.BigEndian.Uint16(u[4:6]) + hi := binary.BigEndian.Uint16(u[6:8]) & 0xfff + return Timestamp(uint64(low) + (uint64(mid) << 32) + (uint64(hi) << 48)), nil +} + +// String parse helpers. +var ( + urnPrefix = []byte("urn:uuid:") + byteGroups = []int{8, 4, 4, 4, 12} +) + +// Nil is the nil UUID, as specified in RFC-4122, that has all 128 bits set to +// zero. +var Nil = UUID{} + +// Predefined namespace UUIDs. +var ( + NamespaceDNS = Must(FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8")) + NamespaceURL = Must(FromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8")) + NamespaceOID = Must(FromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8")) + NamespaceX500 = Must(FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8")) +) + +// Version returns the algorithm version used to generate the UUID. +func (u UUID) Version() byte { + return u[6] >> 4 +} + +// Variant returns the UUID layout variant. +func (u UUID) Variant() byte { + switch { + case (u[8] >> 7) == 0x00: + return VariantNCS + case (u[8] >> 6) == 0x02: + return VariantRFC4122 + case (u[8] >> 5) == 0x06: + return VariantMicrosoft + case (u[8] >> 5) == 0x07: + fallthrough + default: + return VariantFuture + } +} + +// Bytes returns a byte slice representation of the UUID. +func (u UUID) Bytes() []byte { + return u[:] +} + +// String returns a canonical RFC-4122 string representation of the UUID: +// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. +func (u UUID) String() string { + buf := make([]byte, 36) + + hex.Encode(buf[0:8], u[0:4]) + buf[8] = '-' + hex.Encode(buf[9:13], u[4:6]) + buf[13] = '-' + hex.Encode(buf[14:18], u[6:8]) + buf[18] = '-' + hex.Encode(buf[19:23], u[8:10]) + buf[23] = '-' + hex.Encode(buf[24:], u[10:]) + + return string(buf) +} + +// Format implements fmt.Formatter for UUID values. +// +// The behavior is as follows: +// The 'x' and 'X' verbs output only the hex digits of the UUID, using a-f for 'x' and A-F for 'X'. +// The 'v', '+v', 's' and 'q' verbs return the canonical RFC-4122 string representation. +// The 'S' verb returns the RFC-4122 format, but with capital hex digits. +// The '#v' verb returns the "Go syntax" representation, which is a 16 byte array initializer. +// All other verbs not handled directly by the fmt package (like '%p') are unsupported and will return +// "%!verb(uuid.UUID=value)" as recommended by the fmt package. +func (u UUID) Format(f fmt.State, c rune) { + switch c { + case 'x', 'X': + s := hex.EncodeToString(u.Bytes()) + if c == 'X' { + s = strings.Map(toCapitalHexDigits, s) + } + _, _ = io.WriteString(f, s) + case 'v': + var s string + if f.Flag('#') { + s = fmt.Sprintf("%#v", [Size]byte(u)) + } else { + s = u.String() + } + _, _ = io.WriteString(f, s) + case 's', 'S': + s := u.String() + if c == 'S' { + s = strings.Map(toCapitalHexDigits, s) + } + _, _ = io.WriteString(f, s) + case 'q': + _, _ = io.WriteString(f, `"`+u.String()+`"`) + default: + // invalid/unsupported format verb + fmt.Fprintf(f, "%%!%c(uuid.UUID=%s)", c, u.String()) + } +} + +func toCapitalHexDigits(ch rune) rune { + // convert a-f hex digits to A-F + switch ch { + case 'a': + return 'A' + case 'b': + return 'B' + case 'c': + return 'C' + case 'd': + return 'D' + case 'e': + return 'E' + case 'f': + return 'F' + default: + return ch + } +} + +// SetVersion sets the version bits. +func (u *UUID) SetVersion(v byte) { + u[6] = (u[6] & 0x0f) | (v << 4) +} + +// SetVariant sets the variant bits. +func (u *UUID) SetVariant(v byte) { + switch v { + case VariantNCS: + u[8] = (u[8]&(0xff>>1) | (0x00 << 7)) + case VariantRFC4122: + u[8] = (u[8]&(0xff>>2) | (0x02 << 6)) + case VariantMicrosoft: + u[8] = (u[8]&(0xff>>3) | (0x06 << 5)) + case VariantFuture: + fallthrough + default: + u[8] = (u[8]&(0xff>>3) | (0x07 << 5)) + } +} + +// Must is a helper that wraps a call to a function returning (UUID, error) +// and panics if the error is non-nil. It is intended for use in variable +// initializations such as +// var packageUUID = uuid.Must(uuid.FromString("123e4567-e89b-12d3-a456-426655440000")) +func Must(u UUID, err error) UUID { + if err != nil { + panic(err) + } + return u +} diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/common/helpers.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/common/helpers.go index 4382ffb7c0db..4eba4af2c3a4 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/common/helpers.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/common/helpers.go @@ -30,6 +30,7 @@ import ( "github.com/karrick/godirwalk" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/pkg/errors" + "golang.org/x/sys/unix" "k8s.io/klog/v2" ) @@ -68,6 +69,16 @@ func findFileInAncestorDir(current, file, limit string) (string, error) { } } +var bootTime = func() time.Time { + now := time.Now() + var sysinfo unix.Sysinfo_t + if err := unix.Sysinfo(&sysinfo); err != nil { + return now + } + sinceBoot := time.Duration(sysinfo.Uptime) * time.Second + return now.Add(-1 * sinceBoot).Truncate(time.Minute) +}() + func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoFactory, hasNetwork, hasFilesystem bool) (info.ContainerSpec, error) { var spec info.ContainerSpec @@ -75,17 +86,28 @@ func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoF // Get the lowest creation time from all hierarchies as the container creation time. now := time.Now() lowestTime := now - for _, cgroupPath := range cgroupPaths { - // The modified time of the cgroup directory changes whenever a subcontainer is created. + for _, cgroupPathDir := range cgroupPaths { + dir, err := os.Stat(cgroupPathDir) + if err == nil && dir.ModTime().Before(lowestTime) { + lowestTime = dir.ModTime() + } + // The modified time of the cgroup directory sometimes changes whenever a subcontainer is created. // eg. /docker will have creation time matching the creation of latest docker container. - // Use clone_children as a workaround as it isn't usually modified. It is only likely changed - // immediately after creating a container. - cgroupPath = path.Join(cgroupPath, "cgroup.clone_children") - fi, err := os.Stat(cgroupPath) + // Use clone_children/events as a workaround as it isn't usually modified. It is only likely changed + // immediately after creating a container. If the directory modified time is lower, we use that. + cgroupPathFile := path.Join(cgroupPathDir, "cgroup.clone_children") + if cgroups.IsCgroup2UnifiedMode() { + cgroupPathFile = path.Join(cgroupPathDir, "cgroup.events") + } + fi, err := os.Stat(cgroupPathFile) if err == nil && fi.ModTime().Before(lowestTime) { lowestTime = fi.ModTime() } } + if lowestTime.Before(bootTime) { + lowestTime = bootTime + } + if lowestTime != now { spec.CreationTime = lowestTime } diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/docker/factory.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/docker/factory.go index f0118166e2dd..1490a88f41b9 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/docker/factory.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/docker/factory.go @@ -347,23 +347,25 @@ func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, includedMetrics var ( thinPoolWatcher *devicemapper.ThinPoolWatcher thinPoolName string + zfsWatcher *zfs.ZfsWatcher ) - if storageDriver(dockerInfo.Driver) == devicemapperStorageDriver { - thinPoolWatcher, err = startThinPoolWatcher(dockerInfo) - if err != nil { - klog.Errorf("devicemapper filesystem stats will not be reported: %v", err) - } + if includedMetrics.Has(container.DiskUsageMetrics) { + if storageDriver(dockerInfo.Driver) == devicemapperStorageDriver { + thinPoolWatcher, err = startThinPoolWatcher(dockerInfo) + if err != nil { + klog.Errorf("devicemapper filesystem stats will not be reported: %v", err) + } - // Safe to ignore error - driver status should always be populated. - status, _ := StatusFromDockerInfo(*dockerInfo) - thinPoolName = status.DriverStatus[dockerutil.DriverStatusPoolName] - } + // Safe to ignore error - driver status should always be populated. + status, _ := StatusFromDockerInfo(*dockerInfo) + thinPoolName = status.DriverStatus[dockerutil.DriverStatusPoolName] + } - var zfsWatcher *zfs.ZfsWatcher - if storageDriver(dockerInfo.Driver) == zfsStorageDriver { - zfsWatcher, err = startZfsWatcher(dockerInfo) - if err != nil { - klog.Errorf("zfs filesystem stats will not be reported: %v", err) + if storageDriver(dockerInfo.Driver) == zfsStorageDriver { + zfsWatcher, err = startZfsWatcher(dockerInfo) + if err != nil { + klog.Errorf("zfs filesystem stats will not be reported: %v", err) + } } } diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/docker/handler.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/docker/handler.go index e2c904ca8863..e9afc7524462 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/docker/handler.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/docker/handler.go @@ -398,11 +398,14 @@ func (h *dockerContainerHandler) getFsStats(stats *info.ContainerStats) error { fsType string ) + var fsInfo *info.FsInfo + // Docker does not impose any filesystem limits for containers. So use capacity as limit. for _, fs := range mi.Filesystems { if fs.Device == device { limit = fs.Capacity fsType = fs.Type + fsInfo = &fs break } } @@ -413,11 +416,45 @@ func (h *dockerContainerHandler) getFsStats(stats *info.ContainerStats) error { fsStat.Usage = usage.TotalUsageBytes fsStat.Inodes = usage.InodeUsage + if fsInfo != nil { + fileSystems, err := h.fsInfo.GetGlobalFsInfo() + + if err == nil { + addDiskStats(fileSystems, fsInfo, &fsStat) + } else { + klog.Errorf("Unable to obtain diskstats for filesystem %s: %v", fsStat.Device, err) + } + } + stats.Filesystem = append(stats.Filesystem, fsStat) return nil } +func addDiskStats(fileSystems []fs.Fs, fsInfo *info.FsInfo, fsStats *info.FsStats) { + if fsInfo == nil { + return + } + + for _, fileSys := range fileSystems { + if fsInfo.DeviceMajor == fileSys.DiskStats.Major && + fsInfo.DeviceMinor == fileSys.DiskStats.Minor { + fsStats.ReadsCompleted = fileSys.DiskStats.ReadsCompleted + fsStats.ReadsMerged = fileSys.DiskStats.ReadsMerged + fsStats.SectorsRead = fileSys.DiskStats.SectorsRead + fsStats.ReadTime = fileSys.DiskStats.ReadTime + fsStats.WritesCompleted = fileSys.DiskStats.WritesCompleted + fsStats.WritesMerged = fileSys.DiskStats.WritesMerged + fsStats.SectorsWritten = fileSys.DiskStats.SectorsWritten + fsStats.WriteTime = fileSys.DiskStats.WriteTime + fsStats.IoInProgress = fileSys.DiskStats.IoInProgress + fsStats.IoTime = fileSys.DiskStats.IoTime + fsStats.WeightedIoTime = fileSys.DiskStats.WeightedIoTime + break + } + } +} + // TODO(vmarmol): Get from libcontainer API instead of cgroup manager when we don't have to support older Dockers. func (h *dockerContainerHandler) GetStats() (*info.ContainerStats, error) { stats, err := h.libcontainerHandler.GetStats() diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/factory.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/factory.go index 652070b1b483..56d198976ef9 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/factory.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/factory.go @@ -63,6 +63,7 @@ const ( ReferencedMemoryMetrics MetricKind = "referenced_memory" CPUTopologyMetrics MetricKind = "cpu_topology" ResctrlMetrics MetricKind = "resctrl" + CPUSetMetrics MetricKind = "cpuset" ) // AllMetrics represents all kinds of metrics that cAdvisor supported. @@ -87,6 +88,7 @@ var AllMetrics = MetricSet{ ReferencedMemoryMetrics: struct{}{}, CPUTopologyMetrics: struct{}{}, ResctrlMetrics: struct{}{}, + CPUSetMetrics: struct{}{}, } func (mk MetricKind) String() string { diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/libcontainer/handler.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/libcontainer/handler.go index 6e8a73432ae0..4bfb6aef88a2 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/libcontainer/handler.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/libcontainer/handler.go @@ -70,21 +70,22 @@ func NewHandler(cgroupManager cgroups.Manager, rootFs string, pid int, includedM // Get cgroup and networking stats of the specified container func (h *Handler) GetStats() (*info.ContainerStats, error) { - var cgroupStats *cgroups.Stats - readCgroupStats := true + ignoreStatsError := false if cgroups.IsCgroup2UnifiedMode() { - // On cgroup v2 there are no stats at the root cgroup - // so check whether it is the root cgroup + // On cgroup v2 the root cgroup stats have been introduced in recent kernel versions, + // so not all kernel versions have all the data. This means that stat fetching can fail + // due to lacking cgroup stat files, but that some data is provided. if h.cgroupManager.Path("") == fs2.UnifiedMountpoint { - readCgroupStats = false + ignoreStatsError = true } } - var err error - if readCgroupStats { - cgroupStats, err = h.cgroupManager.GetStats() - if err != nil { + + cgroupStats, err := h.cgroupManager.GetStats() + if err != nil { + if !ignoreStatsError { return nil, err } + klog.V(4).Infof("Ignoring errors when gathering stats for root cgroup since some controllers don't have stats on the root cgroup: %v", err) } libcontainerStats := &libcontainer.Stats{ CgroupStats: cgroupStats, @@ -793,7 +794,12 @@ func setMemoryStats(s *cgroups.Stats, ret *info.ContainerStats) { ret.Memory.MaxUsage = s.MemoryStats.Usage.MaxUsage ret.Memory.Failcnt = s.MemoryStats.Usage.Failcnt - if s.MemoryStats.UseHierarchy { + if cgroups.IsCgroup2UnifiedMode() { + ret.Memory.Cache = s.MemoryStats.Stats["file"] + ret.Memory.RSS = s.MemoryStats.Stats["anon"] + ret.Memory.Swap = s.MemoryStats.SwapUsage.Usage + ret.Memory.MappedFile = s.MemoryStats.Stats["file_mapped"] + } else if s.MemoryStats.UseHierarchy { ret.Memory.Cache = s.MemoryStats.Stats["total_cache"] ret.Memory.RSS = s.MemoryStats.Stats["total_rss"] ret.Memory.Swap = s.MemoryStats.Stats["total_swap"] @@ -829,6 +835,10 @@ func setMemoryStats(s *cgroups.Stats, ret *info.ContainerStats) { ret.Memory.WorkingSet = workingSet } +func setCPUSetStats(s *cgroups.Stats, ret *info.ContainerStats) { + ret.CpuSet.MemoryMigrate = s.CPUSetStats.MemoryMigrate +} + func getNumaStats(memoryStats map[uint8]uint64) map[uint8]uint64 { stats := make(map[uint8]uint64, len(memoryStats)) for node, usage := range memoryStats { @@ -906,6 +916,9 @@ func newContainerStats(libcontainerStats *libcontainer.Stats, includedMetrics co if includedMetrics.Has(container.HugetlbUsageMetrics) { setHugepageStats(s, ret) } + if includedMetrics.Has(container.CPUSetMetrics) { + setCPUSetStats(s, ret) + } } if len(libcontainerStats.Interfaces) > 0 { setNetworkStats(libcontainerStats, ret) diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/fs/fs.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/fs/fs.go index fd2772f99837..91a2d1f26491 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/fs/fs.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/fs/fs.go @@ -33,9 +33,9 @@ import ( "github.com/google/cadvisor/devicemapper" "github.com/google/cadvisor/utils" zfs "github.com/mistifyio/go-zfs" + mount "github.com/moby/sys/mountinfo" "k8s.io/klog/v2" - "k8s.io/utils/mount" ) const ( @@ -85,7 +85,7 @@ type RealFsInfo struct { // Labels are intent-specific tags that are auto-detected. labels map[string]string // Map from mountpoint to mount information. - mounts map[string]mount.MountInfo + mounts map[string]mount.Info // devicemapper client dmsetup devicemapper.DmsetupClient // fsUUIDToDeviceName is a map from the filesystem UUID to its device name. @@ -93,7 +93,11 @@ type RealFsInfo struct { } func NewFsInfo(context Context) (FsInfo, error) { - mounts, err := mount.ParseMountInfo("/proc/self/mountinfo") + fileReader, err := os.Open("/proc/self/mountinfo") + if err != nil { + return nil, err + } + mounts, err := mount.GetMountsFromReader(fileReader, nil) if err != nil { return nil, err } @@ -110,13 +114,13 @@ func NewFsInfo(context Context) (FsInfo, error) { fsInfo := &RealFsInfo{ partitions: processMounts(mounts, excluded), labels: make(map[string]string), - mounts: make(map[string]mount.MountInfo), + mounts: make(map[string]mount.Info), dmsetup: devicemapper.NewDmsetupClient(), fsUUIDToDeviceName: fsUUIDToDeviceName, } - for _, mount := range mounts { - fsInfo.mounts[mount.MountPoint] = mount + for _, mnt := range mounts { + fsInfo.mounts[mnt.Mountpoint] = *mnt } // need to call this before the log line below printing out the partitions, as this function may @@ -147,10 +151,10 @@ func getFsUUIDToDeviceNameMap() (map[string]string, error) { fsUUIDToDeviceName := make(map[string]string) for _, file := range files { - path := filepath.Join(dir, file.Name()) - target, err := os.Readlink(path) + fpath := filepath.Join(dir, file.Name()) + target, err := os.Readlink(fpath) if err != nil { - klog.Warningf("Failed to resolve symlink for %q", path) + klog.Warningf("Failed to resolve symlink for %q", fpath) continue } device, err := filepath.Abs(filepath.Join(dir, target)) @@ -162,11 +166,12 @@ func getFsUUIDToDeviceNameMap() (map[string]string, error) { return fsUUIDToDeviceName, nil } -func processMounts(mounts []mount.MountInfo, excludedMountpointPrefixes []string) map[string]partition { +func processMounts(mounts []*mount.Info, excludedMountpointPrefixes []string) map[string]partition { partitions := make(map[string]partition) supportedFsType := map[string]bool{ - // all ext systems are checked through prefix. + // all ext and nfs systems are checked through prefix + // because there are a number of families (e.g., ext3, ext4, nfs3, nfs4...) "btrfs": true, "overlay": true, "tmpfs": true, @@ -174,20 +179,21 @@ func processMounts(mounts []mount.MountInfo, excludedMountpointPrefixes []string "zfs": true, } - for _, mount := range mounts { - if !strings.HasPrefix(mount.FsType, "ext") && !supportedFsType[mount.FsType] { + for _, mnt := range mounts { + if !strings.HasPrefix(mnt.FSType, "ext") && !strings.HasPrefix(mnt.FSType, "nfs") && + !supportedFsType[mnt.FSType] { continue } // Avoid bind mounts, exclude tmpfs. - if _, ok := partitions[mount.Source]; ok { - if mount.FsType != "tmpfs" { + if _, ok := partitions[mnt.Source]; ok { + if mnt.FSType != "tmpfs" { continue } } hasPrefix := false for _, prefix := range excludedMountpointPrefixes { - if strings.HasPrefix(mount.MountPoint, prefix) { + if strings.HasPrefix(mnt.Mountpoint, prefix) { hasPrefix = true break } @@ -197,31 +203,31 @@ func processMounts(mounts []mount.MountInfo, excludedMountpointPrefixes []string } // using mountpoint to replace device once fstype it tmpfs - if mount.FsType == "tmpfs" { - mount.Source = mount.MountPoint + if mnt.FSType == "tmpfs" { + mnt.Source = mnt.Mountpoint } // btrfs fix: following workaround fixes wrong btrfs Major and Minor Ids reported in /proc/self/mountinfo. // instead of using values from /proc/self/mountinfo we use stat to get Ids from btrfs mount point - if mount.FsType == "btrfs" && mount.Major == 0 && strings.HasPrefix(mount.Source, "/dev/") { - major, minor, err := getBtrfsMajorMinorIds(&mount) + if mnt.FSType == "btrfs" && mnt.Major == 0 && strings.HasPrefix(mnt.Source, "/dev/") { + major, minor, err := getBtrfsMajorMinorIds(mnt) if err != nil { klog.Warningf("%s", err) } else { - mount.Major = major - mount.Minor = minor + mnt.Major = major + mnt.Minor = minor } } // overlay fix: Making mount source unique for all overlay mounts, using the mount's major and minor ids. - if mount.FsType == "overlay" { - mount.Source = fmt.Sprintf("%s_%d-%d", mount.Source, mount.Major, mount.Minor) + if mnt.FSType == "overlay" { + mnt.Source = fmt.Sprintf("%s_%d-%d", mnt.Source, mnt.Major, mnt.Minor) } - partitions[mount.Source] = partition{ - fsType: mount.FsType, - mountpoint: mount.MountPoint, - major: uint(mount.Major), - minor: uint(mount.Minor), + partitions[mnt.Source] = partition{ + fsType: mnt.FSType, + mountpoint: mnt.Mountpoint, + major: uint(mnt.Major), + minor: uint(mnt.Minor), } } @@ -256,12 +262,12 @@ func (i *RealFsInfo) getDockerDeviceMapperInfo(context DockerContext) (string, * } // addSystemRootLabel attempts to determine which device contains the mount for /. -func (i *RealFsInfo) addSystemRootLabel(mounts []mount.MountInfo) { +func (i *RealFsInfo) addSystemRootLabel(mounts []*mount.Info) { for _, m := range mounts { - if m.MountPoint == "/" { + if m.Mountpoint == "/" { i.partitions[m.Source] = partition{ - fsType: m.FsType, - mountpoint: m.MountPoint, + fsType: m.FSType, + mountpoint: m.Mountpoint, major: uint(m.Major), minor: uint(m.Minor), } @@ -272,7 +278,7 @@ func (i *RealFsInfo) addSystemRootLabel(mounts []mount.MountInfo) { } // addDockerImagesLabel attempts to determine which device contains the mount for docker images. -func (i *RealFsInfo) addDockerImagesLabel(context Context, mounts []mount.MountInfo) { +func (i *RealFsInfo) addDockerImagesLabel(context Context, mounts []*mount.Info) { dockerDev, dockerPartition, err := i.getDockerDeviceMapperInfo(context.Docker) if err != nil { klog.Warningf("Could not get Docker devicemapper device: %v", err) @@ -285,7 +291,7 @@ func (i *RealFsInfo) addDockerImagesLabel(context Context, mounts []mount.MountI } } -func (i *RealFsInfo) addCrioImagesLabel(context Context, mounts []mount.MountInfo) { +func (i *RealFsInfo) addCrioImagesLabel(context Context, mounts []*mount.Info) { if context.Crio.Root != "" { crioPath := context.Crio.Root crioImagePaths := map[string]struct{}{ @@ -324,20 +330,19 @@ func getDockerImagePaths(context Context) map[string]struct{} { // This method compares the mountpoints with possible container image mount points. If a match is found, // the label is added to the partition. -func (i *RealFsInfo) updateContainerImagesPath(label string, mounts []mount.MountInfo, containerImagePaths map[string]struct{}) { - var useMount *mount.MountInfo +func (i *RealFsInfo) updateContainerImagesPath(label string, mounts []*mount.Info, containerImagePaths map[string]struct{}) { + var useMount *mount.Info for _, m := range mounts { - if _, ok := containerImagePaths[m.MountPoint]; ok { - if useMount == nil || (len(useMount.MountPoint) < len(m.MountPoint)) { - useMount = new(mount.MountInfo) - *useMount = m + if _, ok := containerImagePaths[m.Mountpoint]; ok { + if useMount == nil || (len(useMount.Mountpoint) < len(m.Mountpoint)) { + useMount = m } } } if useMount != nil { i.partitions[useMount.Source] = partition{ - fsType: useMount.FsType, - mountpoint: useMount.MountPoint, + fsType: useMount.FSType, + mountpoint: useMount.Mountpoint, major: uint(useMount.Major), minor: uint(useMount.Minor), } @@ -354,7 +359,7 @@ func (i *RealFsInfo) GetDeviceForLabel(label string) (string, error) { } func (i *RealFsInfo) GetLabelsForDevice(device string) ([]string, error) { - labels := []string{} + var labels []string for label, dev := range i.labels { if dev == device { labels = append(labels, label) @@ -462,12 +467,12 @@ func getDiskStatsMap(diskStatsFile string) (map[string]DiskStats, error) { // 8 50 sdd2 40 0 280 223 7 0 22 108 0 330 330 deviceName := path.Join("/dev", words[2]) - var error error + var err error devInfo := make([]uint64, 2) for i := 0; i < len(devInfo); i++ { - devInfo[i], error = strconv.ParseUint(words[i], 10, 64) - if error != nil { - return nil, error + devInfo[i], err = strconv.ParseUint(words[i], 10, 64) + if err != nil { + return nil, err } } @@ -478,11 +483,22 @@ func getDiskStatsMap(diskStatsFile string) (map[string]DiskStats, error) { return nil, fmt.Errorf("could not parse all 11 columns of /proc/diskstats") } for i := offset; i < wordLength; i++ { - stats[i-offset], error = strconv.ParseUint(words[i], 10, 64) - if error != nil { - return nil, error + stats[i-offset], err = strconv.ParseUint(words[i], 10, 64) + if err != nil { + return nil, err } } + + major64, err := strconv.ParseUint(words[0], 10, 64) + if err != nil { + return nil, err + } + + minor64, err := strconv.ParseUint(words[1], 10, 64) + if err != nil { + return nil, err + } + diskStats := DiskStats{ MajorNum: devInfo[0], MinorNum: devInfo[1], @@ -497,6 +513,8 @@ func getDiskStatsMap(diskStatsFile string) (map[string]DiskStats, error) { IoInProgress: stats[8], IoTime: stats[9], WeightedIoTime: stats[10], + Major: major64, + Minor: minor64, } diskStatsMap[deviceName] = diskStats } @@ -527,8 +545,8 @@ func (i *RealFsInfo) GetDeviceInfoByFsUUID(uuid string) (*DeviceInfo, error) { return &DeviceInfo{deviceName, p.major, p.minor}, nil } -func (i *RealFsInfo) mountInfoFromDir(dir string) (*mount.MountInfo, bool) { - mount, found := i.mounts[dir] +func (i *RealFsInfo) mountInfoFromDir(dir string) (*mount.Info, bool) { + mnt, found := i.mounts[dir] // try the parent dir if not found until we reach the root dir // this is an issue on btrfs systems where the directory is not // the subvolume @@ -536,15 +554,15 @@ func (i *RealFsInfo) mountInfoFromDir(dir string) (*mount.MountInfo, bool) { pathdir, _ := filepath.Split(dir) // break when we reach root if pathdir == "/" { - mount, found = i.mounts["/"] + mnt, found = i.mounts["/"] break } // trim "/" from the new parent path otherwise the next possible // filepath.Split in the loop will not split the string any further dir = strings.TrimSuffix(pathdir, "/") - mount, found = i.mounts[dir] + mnt, found = i.mounts[dir] } - return &mount, found + return &mnt, found } func (i *RealFsInfo) GetDirFsDevice(dir string) (*DeviceInfo, error) { @@ -563,13 +581,13 @@ func (i *RealFsInfo) GetDirFsDevice(dir string) (*DeviceInfo, error) { } } - mount, found := i.mountInfoFromDir(dir) - if found && mount.FsType == "btrfs" && mount.Major == 0 && strings.HasPrefix(mount.Source, "/dev/") { - major, minor, err := getBtrfsMajorMinorIds(mount) + mnt, found := i.mountInfoFromDir(dir) + if found && mnt.FSType == "btrfs" && mnt.Major == 0 && strings.HasPrefix(mnt.Source, "/dev/") { + major, minor, err := getBtrfsMajorMinorIds(mnt) if err != nil { klog.Warningf("%s", err) } else { - return &DeviceInfo{mount.Source, uint(major), uint(minor)}, nil + return &DeviceInfo{mnt.Source, uint(major), uint(minor)}, nil } } return nil, fmt.Errorf("could not find device with major: %d, minor: %d in cached partitions map", major, minor) @@ -755,7 +773,7 @@ func getZfstats(poolName string) (uint64, uint64, uint64, error) { } // Get major and minor Ids for a mount point using btrfs as filesystem. -func getBtrfsMajorMinorIds(mount *mount.MountInfo) (int, int, error) { +func getBtrfsMajorMinorIds(mount *mount.Info) (int, int, error) { // btrfs fix: following workaround fixes wrong btrfs Major and Minor Ids reported in /proc/self/mountinfo. // instead of using values from /proc/self/mountinfo we use stat to get Ids from btrfs mount point @@ -768,9 +786,9 @@ func getBtrfsMajorMinorIds(mount *mount.MountInfo) (int, int, error) { klog.V(4).Infof("btrfs mount %#v", mount) if buf.Mode&syscall.S_IFMT == syscall.S_IFBLK { - err := syscall.Stat(mount.MountPoint, buf) + err := syscall.Stat(mount.Mountpoint, buf) if err != nil { - err = fmt.Errorf("stat failed on %s with error: %s", mount.MountPoint, err) + err = fmt.Errorf("stat failed on %s with error: %s", mount.Mountpoint, err) return 0, 0, err } diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/fs/types.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/fs/types.go index 93294ebcc27c..0445a17adbe3 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/fs/types.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/fs/types.go @@ -77,6 +77,8 @@ type DiskStats struct { IoInProgress uint64 IoTime uint64 WeightedIoTime uint64 + Major uint64 + Minor uint64 } type UsageInfo struct { diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/info/v1/container.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/info/v1/container.go index 08cff3940f1c..9fe04fddea25 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/info/v1/container.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/info/v1/container.go @@ -399,6 +399,10 @@ type MemoryStats struct { HierarchicalData MemoryStatsMemoryData `json:"hierarchical_data,omitempty"` } +type CPUSetStats struct { + MemoryMigrate uint64 `json:"memory_migrate"` +} + type MemoryNumaStats struct { File map[uint8]uint64 `json:"file,omitempty"` Anon map[uint8]uint64 `json:"anon,omitempty"` @@ -957,6 +961,8 @@ type ContainerStats struct { // Resource Control (resctrl) statistics Resctrl ResctrlStats `json:"resctrl,omitempty"` + + CpuSet CPUSetStats `json:"cpuset,omitempty"` } func timeEq(t1, t2 time.Time, tolerance time.Duration) bool { diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/machine/machine.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/machine/machine.go index 917569377ddd..706bba637823 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/machine/machine.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/machine/machine.go @@ -16,18 +16,15 @@ package machine import ( - "bytes" "fmt" "io/ioutil" "os" "path" - "path/filepath" "regexp" - "strconv" - "strings" - // s390/s390x changes "runtime" + "strconv" + "strings" info "github.com/google/cadvisor/info/v1" "github.com/google/cadvisor/utils" @@ -54,9 +51,6 @@ var ( maxFreqFile = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" ) -const sysFsCPUCoreID = "core_id" -const sysFsCPUPhysicalPackageID = "physical_package_id" -const sysFsCPUTopology = "topology" const memTypeFileName = "dimm_mem_type" const sizeFileName = "size" @@ -66,7 +60,7 @@ func GetPhysicalCores(procInfo []byte) int { if numCores == 0 { // read number of cores from /sys/bus/cpu/devices/cpu*/topology/core_id to deal with processors // for which 'core id' is not available in /proc/cpuinfo - numCores = getUniqueCPUPropertyCount(cpuBusPath, sysFsCPUCoreID) + numCores = sysfs.GetUniqueCPUPropertyCount(cpuBusPath, sysfs.CPUCoreID) } if numCores == 0 { klog.Errorf("Cannot read number of physical cores correctly, number of cores set to %d", numCores) @@ -80,7 +74,7 @@ func GetSockets(procInfo []byte) int { if numSocket == 0 { // read number of sockets from /sys/bus/cpu/devices/cpu*/topology/physical_package_id to deal with processors // for which 'physical id' is not available in /proc/cpuinfo - numSocket = getUniqueCPUPropertyCount(cpuBusPath, sysFsCPUPhysicalPackageID) + numSocket = sysfs.GetUniqueCPUPropertyCount(cpuBusPath, sysfs.CPUPhysicalPackageID) } if numSocket == 0 { klog.Errorf("Cannot read number of sockets correctly, number of sockets set to %d", numSocket) @@ -236,39 +230,6 @@ func parseCapacity(b []byte, r *regexp.Regexp) (uint64, error) { return m * 1024, err } -// Looks for sysfs cpu path containing given CPU property, e.g. core_id or physical_package_id -// and returns number of unique values of given property, exemplary usage: getting number of CPU physical cores -func getUniqueCPUPropertyCount(cpuBusPath string, propertyName string) int { - pathPattern := cpuBusPath + "cpu*[0-9]" - sysCPUPaths, err := filepath.Glob(pathPattern) - if err != nil { - klog.Errorf("Cannot find files matching pattern (pathPattern: %s), number of unique %s set to 0", pathPattern, propertyName) - return 0 - } - uniques := make(map[string]bool) - for _, sysCPUPath := range sysCPUPaths { - onlinePath := filepath.Join(sysCPUPath, "online") - onlineVal, err := ioutil.ReadFile(onlinePath) - if err != nil { - klog.Warningf("Cannot determine CPU %s online state, skipping", sysCPUPath) - continue - } - onlineVal = bytes.TrimSpace(onlineVal) - if len(onlineVal) == 0 || onlineVal[0] != 49 { - klog.Warningf("CPU %s is offline, skipping", sysCPUPath) - continue - } - propertyPath := filepath.Join(sysCPUPath, sysFsCPUTopology, propertyName) - propertyVal, err := ioutil.ReadFile(propertyPath) - if err != nil { - klog.Errorf("Cannot open %s, number of unique %s set to 0", propertyPath, propertyName) - return 0 - } - uniques[string(propertyVal)] = true - } - return len(uniques) -} - // getUniqueMatchesCount returns number of unique matches in given argument using provided regular expression func getUniqueMatchesCount(s string, r *regexp.Regexp) int { matches := r.FindAllString(s, -1) diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/manager/container.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/manager/container.go index c599300d84ba..c776e10d6406 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/manager/container.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/manager/container.go @@ -38,7 +38,7 @@ import ( "github.com/google/cadvisor/summary" "github.com/google/cadvisor/utils/cpuload" - units "github.com/docker/go-units" + "github.com/docker/go-units" "k8s.io/klog/v2" "k8s.io/utils/clock" ) @@ -47,9 +47,14 @@ import ( var enableLoadReader = flag.Bool("enable_load_reader", false, "Whether to enable cpu load reader") var HousekeepingInterval = flag.Duration("housekeeping_interval", 1*time.Second, "Interval between container housekeepings") +// TODO: replace regular expressions with something simpler, such as strings.Split(). // cgroup type chosen to fetch the cgroup path of a process. -// Memory has been chosen, as it is one of the default cgroups that is enabled for most containers. -var cgroupPathRegExp = regexp.MustCompile(`memory[^:]*:(.*?)[,;$]`) +// Memory has been chosen, as it is one of the default cgroups that is enabled for most containers... +var cgroupMemoryPathRegExp = regexp.MustCompile(`memory[^:]*:(.*?)[,;$]`) + +// ... but there are systems (e.g. Raspberry Pi 4) where memory cgroup controller is disabled by default. +// We should check cpu cgroup then. +var cgroupCPUPathRegExp = regexp.MustCompile(`cpu[^:]*:(.*?)[,;$]`) type containerInfo struct { info.ContainerReference @@ -138,7 +143,10 @@ func (cd *containerData) allowErrorLogging() bool { // periodic housekeeping to reset. This should be used sparingly, as calling OnDemandHousekeeping frequently // can have serious performance costs. func (cd *containerData) OnDemandHousekeeping(maxAge time.Duration) { - if cd.clock.Since(cd.statsLastUpdatedTime) > maxAge { + cd.lock.Lock() + timeSinceStatsLastUpdate := cd.clock.Since(cd.statsLastUpdatedTime) + cd.lock.Unlock() + if timeSinceStatsLastUpdate > maxAge { housekeepingFinishedChan := make(chan struct{}) cd.onDemandChan <- housekeepingFinishedChan select { @@ -195,20 +203,28 @@ func (cd *containerData) DerivedStats() (v2.DerivedStats, error) { return cd.summaryReader.DerivedStats() } -func (cd *containerData) getCgroupPath(cgroups string) (string, error) { +func (cd *containerData) getCgroupPath(cgroups string) string { if cgroups == "-" { - return "/", nil + return "/" } if strings.HasPrefix(cgroups, "0::") { - return cgroups[3:], nil + return cgroups[3:] } - matches := cgroupPathRegExp.FindSubmatch([]byte(cgroups)) + matches := cgroupMemoryPathRegExp.FindSubmatch([]byte(cgroups)) if len(matches) != 2 { - klog.V(3).Infof("failed to get memory cgroup path from %q", cgroups) - // return root in case of failures - memory hierarchy might not be enabled. - return "/", nil - } - return string(matches[1]), nil + klog.V(3).Infof( + "failed to get memory cgroup path from %q, will try to get cpu cgroup path", + cgroups, + ) + // On some systems (e.g. Raspberry PI 4) cgroup memory controlled is disabled by default. + matches = cgroupCPUPathRegExp.FindSubmatch([]byte(cgroups)) + if len(matches) != 2 { + klog.V(3).Infof("failed to get cpu cgroup path from %q; assuming root cgroup", cgroups) + // return root in case of failures - memory hierarchy might not be enabled. + return "/" + } + } + return string(matches[1]) } // Returns contents of a file inside the container root. @@ -271,10 +287,7 @@ func (cd *containerData) getContainerPids(inHostNamespace bool) ([]string, error return nil, fmt.Errorf("expected at least %d fields, found %d: output: %q", expectedFields, len(fields), line) } pid := fields[0] - cgroup, err := cd.getCgroupPath(fields[1]) - if err != nil { - return nil, fmt.Errorf("could not parse cgroup path from %q: %v", fields[1], err) - } + cgroup := cd.getCgroupPath(fields[1]) if cd.info.Name == cgroup { pids = append(pids, pid) } @@ -283,106 +296,130 @@ func (cd *containerData) getContainerPids(inHostNamespace bool) ([]string, error } func (cd *containerData) GetProcessList(cadvisorContainer string, inHostNamespace bool) ([]v2.ProcessInfo, error) { - // report all processes for root. - isRoot := cd.info.Name == "/" - rootfs := "/" - if !inHostNamespace { - rootfs = "/rootfs" - } format := "user,pid,ppid,stime,pcpu,pmem,rss,vsz,stat,time,comm,psr,cgroup" out, err := cd.getPsOutput(inHostNamespace, format) if err != nil { return nil, err } - expectedFields := 13 + return cd.parseProcessList(cadvisorContainer, inHostNamespace, out) +} + +func (cd *containerData) parseProcessList(cadvisorContainer string, inHostNamespace bool, out []byte) ([]v2.ProcessInfo, error) { + rootfs := "/" + if !inHostNamespace { + rootfs = "/rootfs" + } processes := []v2.ProcessInfo{} lines := strings.Split(string(out), "\n") for _, line := range lines[1:] { - if len(line) == 0 { - continue - } - fields := strings.Fields(line) - if len(fields) < expectedFields { - return nil, fmt.Errorf("expected at least %d fields, found %d: output: %q", expectedFields, len(fields), line) - } - pid, err := strconv.Atoi(fields[1]) - if err != nil { - return nil, fmt.Errorf("invalid pid %q: %v", fields[1], err) - } - ppid, err := strconv.Atoi(fields[2]) - if err != nil { - return nil, fmt.Errorf("invalid ppid %q: %v", fields[2], err) - } - percentCPU, err := strconv.ParseFloat(fields[4], 32) - if err != nil { - return nil, fmt.Errorf("invalid cpu percent %q: %v", fields[4], err) - } - percentMem, err := strconv.ParseFloat(fields[5], 32) - if err != nil { - return nil, fmt.Errorf("invalid memory percent %q: %v", fields[5], err) - } - rss, err := strconv.ParseUint(fields[6], 0, 64) - if err != nil { - return nil, fmt.Errorf("invalid rss %q: %v", fields[6], err) - } - // convert to bytes - rss *= 1024 - vs, err := strconv.ParseUint(fields[7], 0, 64) - if err != nil { - return nil, fmt.Errorf("invalid virtual size %q: %v", fields[7], err) - } - // convert to bytes - vs *= 1024 - psr, err := strconv.Atoi(fields[11]) - if err != nil { - return nil, fmt.Errorf("invalid pid %q: %v", fields[1], err) - } - - cgroup, err := cd.getCgroupPath(fields[12]) + processInfo, err := cd.parsePsLine(line, cadvisorContainer, inHostNamespace) if err != nil { - return nil, fmt.Errorf("could not parse cgroup path from %q: %v", fields[11], err) + return nil, fmt.Errorf("could not parse line %s: %v", line, err) } - // Remove the ps command we just ran from cadvisor container. - // Not necessary, but makes the cadvisor page look cleaner. - if !inHostNamespace && cadvisorContainer == cgroup && fields[10] == "ps" { + if processInfo == nil { continue } - var cgroupPath string - if isRoot { - cgroupPath = cgroup - } var fdCount int - dirPath := path.Join(rootfs, "/proc", strconv.Itoa(pid), "fd") + dirPath := path.Join(rootfs, "/proc", strconv.Itoa(processInfo.Pid), "fd") fds, err := ioutil.ReadDir(dirPath) if err != nil { klog.V(4).Infof("error while listing directory %q to measure fd count: %v", dirPath, err) continue } fdCount = len(fds) + processInfo.FdCount = fdCount - if isRoot || cd.info.Name == cgroup { - processes = append(processes, v2.ProcessInfo{ - User: fields[0], - Pid: pid, - Ppid: ppid, - StartTime: fields[3], - PercentCpu: float32(percentCPU), - PercentMemory: float32(percentMem), - RSS: rss, - VirtualSize: vs, - Status: fields[8], - RunningTime: fields[9], - Cmd: fields[10], - CgroupPath: cgroupPath, - FdCount: fdCount, - Psr: psr, - }) - } + processes = append(processes, *processInfo) } return processes, nil } +func (cd *containerData) isRoot() bool { + return cd.info.Name == "/" +} + +func (cd *containerData) parsePsLine(line, cadvisorContainer string, inHostNamespace bool) (*v2.ProcessInfo, error) { + const expectedFields = 13 + if len(line) == 0 { + return nil, nil + } + + info := v2.ProcessInfo{} + var err error + + fields := strings.Fields(line) + if len(fields) < expectedFields { + return nil, fmt.Errorf("expected at least %d fields, found %d: output: %q", expectedFields, len(fields), line) + } + info.User = fields[0] + info.StartTime = fields[3] + info.Status = fields[8] + info.RunningTime = fields[9] + + info.Pid, err = strconv.Atoi(fields[1]) + if err != nil { + return nil, fmt.Errorf("invalid pid %q: %v", fields[1], err) + } + info.Ppid, err = strconv.Atoi(fields[2]) + if err != nil { + return nil, fmt.Errorf("invalid ppid %q: %v", fields[2], err) + } + + percentCPU, err := strconv.ParseFloat(fields[4], 32) + if err != nil { + return nil, fmt.Errorf("invalid cpu percent %q: %v", fields[4], err) + } + info.PercentCpu = float32(percentCPU) + percentMem, err := strconv.ParseFloat(fields[5], 32) + if err != nil { + return nil, fmt.Errorf("invalid memory percent %q: %v", fields[5], err) + } + info.PercentMemory = float32(percentMem) + + info.RSS, err = strconv.ParseUint(fields[6], 0, 64) + if err != nil { + return nil, fmt.Errorf("invalid rss %q: %v", fields[6], err) + } + info.VirtualSize, err = strconv.ParseUint(fields[7], 0, 64) + if err != nil { + return nil, fmt.Errorf("invalid virtual size %q: %v", fields[7], err) + } + // convert to bytes + info.RSS *= 1024 + info.VirtualSize *= 1024 + + // According to `man ps`: The following user-defined format specifiers may contain spaces: args, cmd, comm, command, + // fname, ucmd, ucomm, lstart, bsdstart, start. + // Therefore we need to be able to parse comm that consists of multiple space-separated parts. + info.Cmd = strings.Join(fields[10:len(fields)-2], " ") + + // These are last two parts of the line. We create a subslice of `fields` to handle comm that includes spaces. + lastTwoFields := fields[len(fields)-2:] + info.Psr, err = strconv.Atoi(lastTwoFields[0]) + if err != nil { + return nil, fmt.Errorf("invalid psr %q: %v", lastTwoFields[0], err) + } + info.CgroupPath = cd.getCgroupPath(lastTwoFields[1]) + + // Remove the ps command we just ran from cadvisor container. + // Not necessary, but makes the cadvisor page look cleaner. + if !inHostNamespace && cadvisorContainer == info.CgroupPath && info.Cmd == "ps" { + return nil, nil + } + + // Do not report processes from other containers when non-root container requested. + if !cd.isRoot() && info.CgroupPath != cd.info.Name { + return nil, nil + } + + // Remove cgroup information when non-root container requested. + if !cd.isRoot() { + info.CgroupPath = "" + } + return &info, nil +} + func newContainerData(containerName string, memoryCache *memory.InMemoryCache, handler container.ContainerHandler, logUsage bool, collectorManager collector.CollectorManager, maxHousekeepingInterval time.Duration, allowDynamicHousekeeping bool, clock clock.Clock) (*containerData, error) { if memoryCache == nil { return nil, fmt.Errorf("nil memory storage") @@ -516,7 +553,7 @@ func (cd *containerData) housekeeping() { usageCPUNs := uint64(0) for i := range stats { if i > 0 { - usageCPUNs += (stats[i].Cpu.Usage.Total - stats[i-1].Cpu.Usage.Total) + usageCPUNs += stats[i].Cpu.Usage.Total - stats[i-1].Cpu.Usage.Total } } usageMemory := stats[numSamples-1].Memory.Usage @@ -555,6 +592,8 @@ func (cd *containerData) housekeepingTick(timer <-chan time.Time, longHousekeepi klog.V(3).Infof("[%s] Housekeeping took %s", cd.info.Name, duration) } cd.notifyOnDemand() + cd.lock.Lock() + defer cd.lock.Unlock() cd.statsLastUpdatedTime = cd.clock.Now() return true } diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/metrics/prometheus.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/metrics/prometheus.go index 1064e045a2c6..7d3f24a99dad 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/metrics/prometheus.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/metrics/prometheus.go @@ -455,6 +455,16 @@ func NewPrometheusCollector(i infoProvider, f ContainerLabelsFunc, includedMetri }, }...) } + if includedMetrics.Has(container.CPUSetMetrics) { + c.containerMetrics = append(c.containerMetrics, containerMetric{ + name: "container_memory_migrate", + help: "Memory migrate status.", + valueType: prometheus.GaugeValue, + getValues: func(s *info.ContainerStats) metricValues { + return metricValues{{value: float64(s.CpuSet.MemoryMigrate), timestamp: s.Timestamp}} + }, + }) + } if includedMetrics.Has(container.MemoryNumaMetrics) { c.containerMetrics = append(c.containerMetrics, []containerMetric{ { @@ -757,6 +767,28 @@ func NewPrometheusCollector(i infoProvider, f ContainerLabelsFunc, includedMetri }, s.Timestamp) }, }, + { + name: "container_blkio_device_usage_total", + help: "Blkio Device bytes usage", + valueType: prometheus.CounterValue, + extraLabels: []string{"device", "major", "minor", "operation"}, + getValues: func(s *info.ContainerStats) metricValues { + var values metricValues + for _, diskStat := range s.DiskIo.IoServiceBytes { + for operation, value := range diskStat.Stats { + values = append(values, metricValue{ + value: float64(value), + labels: []string{diskStat.Device, + strconv.Itoa(int(diskStat.Major)), + strconv.Itoa(int(diskStat.Minor)), + operation}, + timestamp: s.Timestamp, + }) + } + } + return values + }, + }, }...) } if includedMetrics.Has(container.NetworkUsageMetrics) { diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/metrics/prometheus_fake.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/metrics/prometheus_fake.go index 6368c0b75ebc..822b3f82c977 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/metrics/prometheus_fake.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/metrics/prometheus_fake.go @@ -524,6 +524,21 @@ func (p testSubcontainersInfoProvider) GetRequestedContainersInfo(string, v2.Req TxQueued: 0, }, }, + DiskIo: info.DiskIoStats{ + IoServiceBytes: []info.PerDiskStats{{ + Device: "/dev/sdb", + Major: 8, + Minor: 0, + Stats: map[string]uint64{ + "Async": 1, + "Discard": 2, + "Read": 3, + "Sync": 4, + "Total": 5, + "Write": 6, + }, + }}, + }, Filesystem: []info.FsStats{ { Device: "sda1", @@ -708,6 +723,7 @@ func (p testSubcontainersInfoProvider) GetRequestedContainersInfo(string, v2.Req }, }, }, + CpuSet: info.CPUSetStats{MemoryMigrate: 1}, }, }, }, diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/resctrl/collector.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/resctrl/collector.go index 210156a89b1c..f677b8d04414 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/resctrl/collector.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/resctrl/collector.go @@ -26,19 +26,19 @@ import ( ) type collector struct { - resctrl intelrdt.IntelRdtManager + resctrl intelrdt.Manager stats.NoopDestroy } func newCollector(id string, resctrlPath string) *collector { collector := &collector{ - resctrl: intelrdt.IntelRdtManager{ - Config: &configs.Config{ + resctrl: intelrdt.NewManager( + &configs.Config{ IntelRdt: &configs.IntelRdt{}, }, - Id: id, - Path: resctrlPath, - }, + id, + resctrlPath, + ), } return collector diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/oomparser/oomparser.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/oomparser/oomparser.go index e652874e52d0..32dc838fb919 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/oomparser/oomparser.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/oomparser/oomparser.go @@ -28,7 +28,7 @@ import ( var ( legacyContainerRegexp = regexp.MustCompile(`Task in (.*) killed as a result of limit of (.*)`) // Starting in 5.0 linux kernels, the OOM message changed - containerRegexp = regexp.MustCompile(`oom-kill:constraint=(.*),nodemask=(.*),cpuset=(.*),mems_allowed=(.*),oom_memcg=(.*) (.*),task_memcg=(.*),task=(.*),pid=(.*),uid=(.*)`) + containerRegexp = regexp.MustCompile(`oom-kill:constraint=(.*),nodemask=(.*),cpuset=(.*),mems_allowed=(.*),oom_memcg=(.*),task_memcg=(.*),task=(.*),pid=(.*),uid=(.*)`) lastLineRegexp = regexp.MustCompile(`Killed process ([0-9]+) \((.+)\)`) firstLineRegexp = regexp.MustCompile(`invoked oom-killer:`) ) @@ -76,15 +76,15 @@ func getContainerName(line string, currentOomInstance *OomInstance) (bool, error // Fall back to the legacy format if it isn't found here. return false, getLegacyContainerName(line, currentOomInstance) } - currentOomInstance.ContainerName = parsedLine[7] + currentOomInstance.ContainerName = parsedLine[6] currentOomInstance.VictimContainerName = parsedLine[5] currentOomInstance.Constraint = parsedLine[1] - pid, err := strconv.Atoi(parsedLine[9]) + pid, err := strconv.Atoi(parsedLine[8]) if err != nil { return false, err } currentOomInstance.Pid = pid - currentOomInstance.ProcessName = parsedLine[8] + currentOomInstance.ProcessName = parsedLine[7] return true, nil } diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs.go index becc4afc4751..1be228a0e5f6 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs.go @@ -16,7 +16,6 @@ package sysfs import ( "bytes" - "errors" "fmt" "io/ioutil" "os" @@ -37,9 +36,21 @@ const ( ppcDevTree = "/proc/device-tree" s390xDevTree = "/etc" // s390/s390x changes - coreIDFilePath = "/topology/core_id" - packageIDFilePath = "/topology/physical_package_id" - meminfoFile = "meminfo" + meminfoFile = "meminfo" + + sysFsCPUTopology = "topology" + + // CPUPhysicalPackageID is a physical package id of cpu#. Typically corresponds to a physical socket number, + // but the actual value is architecture and platform dependent. + CPUPhysicalPackageID = "physical_package_id" + // CPUCoreID is the CPU core ID of cpu#. Typically it is the hardware platform's identifier + // (rather than the kernel's). The actual value is architecture and platform dependent. + CPUCoreID = "core_id" + + coreIDFilePath = "/" + sysFsCPUTopology + "/core_id" + packageIDFilePath = "/" + sysFsCPUTopology + "/physical_package_id" + + // memory size calculations cpuDirPattern = "cpu*[0-9]" nodeDirPattern = "node*[0-9]" @@ -325,9 +336,9 @@ func (fs *realSysFs) GetSystemUUID() (string, error) { if id, err := ioutil.ReadFile(path.Join(dmiDir, "id", "product_uuid")); err == nil { return strings.TrimSpace(string(id)), nil } else if id, err = ioutil.ReadFile(path.Join(ppcDevTree, "system-id")); err == nil { - return strings.TrimSpace(string(id)), nil + return strings.TrimSpace(strings.TrimRight(string(id), "\000")), nil } else if id, err = ioutil.ReadFile(path.Join(ppcDevTree, "vm,uuid")); err == nil { - return strings.TrimSpace(string(id)), nil + return strings.TrimSpace(strings.TrimRight(string(id), "\000")), nil } else if id, err = ioutil.ReadFile(path.Join(s390xDevTree, "machine-id")); err == nil { return strings.TrimSpace(string(id)), nil } else { @@ -335,25 +346,152 @@ func (fs *realSysFs) GetSystemUUID() (string, error) { } } -func (fs *realSysFs) IsCPUOnline(dir string) bool { - cpuPath := fmt.Sprintf("%s/online", dir) - content, err := ioutil.ReadFile(cpuPath) +func (fs *realSysFs) IsCPUOnline(cpuPath string) bool { + onlinePath, err := filepath.Abs(cpuPath + "/../online") if err != nil { - pathErr, ok := err.(*os.PathError) - if ok { - if errors.Is(pathErr.Unwrap(), os.ErrNotExist) && isZeroCPU(dir) { - return true - } - } - klog.Warningf("unable to read %s: %s", cpuPath, err.Error()) + klog.V(1).Infof("Unable to get absolute path for %s", cpuPath) + return false + } + + // Quick check to determine if file exists: if it does not then kernel CPU hotplug is disabled and all CPUs are online. + _, err = os.Stat(onlinePath) + if err != nil && os.IsNotExist(err) { + return true + } + if err != nil { + klog.V(1).Infof("Unable to stat %s: %s", onlinePath, err) + } + + cpuID, err := getCPUID(cpuPath) + if err != nil { + klog.V(1).Infof("Unable to get CPU ID from path %s: %s", cpuPath, err) return false } - trimmed := bytes.TrimSpace(content) - return len(trimmed) == 1 && trimmed[0] == 49 + + isOnline, err := isCPUOnline(onlinePath, cpuID) + if err != nil { + klog.V(1).Infof("Unable to get online CPUs list: %s", err) + return false + } + return isOnline } -func isZeroCPU(dir string) bool { - regex := regexp.MustCompile("cpu([0-9]*)") +func getCPUID(dir string) (uint16, error) { + regex := regexp.MustCompile("cpu([0-9]+)") matches := regex.FindStringSubmatch(dir) - return len(matches) == 2 && matches[1] == "0" + if len(matches) == 2 { + id, err := strconv.Atoi(matches[1]) + if err != nil { + return 0, err + } + return uint16(id), nil + } + return 0, fmt.Errorf("can't get CPU ID from %s", dir) +} + +// isCPUOnline is copied from github.com/opencontainers/runc/libcontainer/cgroups/fs and modified to suite cAdvisor +// needs as Apache 2.0 license allows. +// It parses CPU list (such as: 0,3-5,10) into a struct that allows to determine quickly if CPU or particular ID is online. +// see: https://github.com/opencontainers/runc/blob/ab27e12cebf148aa5d1ee3ad13d9fc7ae12bf0b6/libcontainer/cgroups/fs/cpuset.go#L45 +func isCPUOnline(path string, cpuID uint16) (bool, error) { + fileContent, err := ioutil.ReadFile(path) + if err != nil { + return false, err + } + if len(fileContent) == 0 { + return false, fmt.Errorf("%s found to be empty", path) + } + + cpuList := strings.TrimSpace(string(fileContent)) + for _, s := range strings.Split(cpuList, ",") { + splitted := strings.SplitN(s, "-", 3) + switch len(splitted) { + case 3: + return false, fmt.Errorf("invalid values in %s", path) + case 2: + min, err := strconv.ParseUint(splitted[0], 10, 16) + if err != nil { + return false, err + } + max, err := strconv.ParseUint(splitted[1], 10, 16) + if err != nil { + return false, err + } + if min > max { + return false, fmt.Errorf("invalid values in %s", path) + } + for i := min; i <= max; i++ { + if uint16(i) == cpuID { + return true, nil + } + } + case 1: + value, err := strconv.ParseUint(s, 10, 16) + if err != nil { + return false, err + } + if uint16(value) == cpuID { + return true, nil + } + } + } + + return false, nil +} + +// Looks for sysfs cpu path containing given CPU property, e.g. core_id or physical_package_id +// and returns number of unique values of given property, exemplary usage: getting number of CPU physical cores +func GetUniqueCPUPropertyCount(cpuBusPath string, propertyName string) int { + absCPUBusPath, err := filepath.Abs(cpuBusPath) + if err != nil { + klog.Errorf("Cannot make %s absolute", cpuBusPath) + return 0 + } + pathPattern := absCPUBusPath + "/cpu*[0-9]" + sysCPUPaths, err := filepath.Glob(pathPattern) + if err != nil { + klog.Errorf("Cannot find files matching pattern (pathPattern: %s), number of unique %s set to 0", pathPattern, propertyName) + return 0 + } + onlinePath, err := filepath.Abs(cpuBusPath + "/online") + if err != nil { + klog.V(1).Infof("Unable to get absolute path for %s", cpuBusPath+"/../online") + return 0 + } + + if err != nil { + klog.V(1).Infof("Unable to get online CPUs list: %s", err) + return 0 + } + uniques := make(map[string]bool) + for _, sysCPUPath := range sysCPUPaths { + cpuID, err := getCPUID(sysCPUPath) + if err != nil { + klog.V(1).Infof("Unable to get CPU ID from path %s: %s", sysCPUPath, err) + return 0 + } + isOnline, err := isCPUOnline(onlinePath, cpuID) + if err != nil && !os.IsNotExist(err) { + klog.V(1).Infof("Unable to determine CPU online state: %s", err) + continue + } + if !isOnline && !os.IsNotExist(err) { + continue + } + propertyPath := filepath.Join(sysCPUPath, sysFsCPUTopology, propertyName) + propertyVal, err := ioutil.ReadFile(propertyPath) + if err != nil { + klog.Warningf("Cannot open %s, assuming 0 for %s of CPU %d", propertyPath, propertyName, cpuID) + propertyVal = []byte("0") + } + packagePath := filepath.Join(sysCPUPath, sysFsCPUTopology, CPUPhysicalPackageID) + packageVal, err := ioutil.ReadFile(packagePath) + if err != nil { + klog.Warningf("Cannot open %s, assuming 0 %s of CPU %d", packagePath, CPUPhysicalPackageID, cpuID) + packageVal = []byte("0") + + } + uniques[fmt.Sprintf("%s_%s", bytes.TrimSpace(propertyVal), bytes.TrimSpace(packageVal))] = true + } + return len(uniques) } diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs_notx86.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs_notx86.go new file mode 100644 index 000000000000..86b8d02467e6 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs_notx86.go @@ -0,0 +1,19 @@ +// +build !x86 + +// Copyright 2021 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package sysfs + +var isX86 = false diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs_x86.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs_x86.go new file mode 100644 index 000000000000..fd6ff358f6fc --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/utils/sysfs/sysfs_x86.go @@ -0,0 +1,19 @@ +// +build x86 + +// Copyright 2021 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package sysfs + +var isX86 = true diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/README.md b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/README.md index 848b16c69b80..ee9783d232f4 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/README.md +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/README.md @@ -1,3 +1,4 @@ # Compiler support code -This directory contains compiler support code used by Gnostic and Gnostic extensions. \ No newline at end of file +This directory contains compiler support code used by Gnostic and Gnostic +extensions. diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/context.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/context.go index a64c1b75db40..1250a6c592bd 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/context.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/context.go @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/error.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/error.go index d8672c1008b7..7db23997bad9 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/error.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/error.go @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/extension-handler.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/extension-handler.go deleted file mode 100644 index 1f85b650e817..000000000000 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/extension-handler.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package compiler - -import ( - "bytes" - "fmt" - "os/exec" - - "strings" - - "errors" - - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/any" - ext_plugin "github.com/googleapis/gnostic/extensions" - yaml "gopkg.in/yaml.v2" -) - -// ExtensionHandler describes a binary that is called by the compiler to handle specification extensions. -type ExtensionHandler struct { - Name string -} - -// HandleExtension calls a binary extension handler. -func HandleExtension(context *Context, in interface{}, extensionName string) (bool, *any.Any, error) { - handled := false - var errFromPlugin error - var outFromPlugin *any.Any - - if context != nil && context.ExtensionHandlers != nil && len(*(context.ExtensionHandlers)) != 0 { - for _, customAnyProtoGenerator := range *(context.ExtensionHandlers) { - outFromPlugin, errFromPlugin = customAnyProtoGenerator.handle(in, extensionName) - if outFromPlugin == nil { - continue - } else { - handled = true - break - } - } - } - return handled, outFromPlugin, errFromPlugin -} - -func (extensionHandlers *ExtensionHandler) handle(in interface{}, extensionName string) (*any.Any, error) { - if extensionHandlers.Name != "" { - binary, _ := yaml.Marshal(in) - - request := &ext_plugin.ExtensionHandlerRequest{} - - version := &ext_plugin.Version{} - version.Major = 0 - version.Minor = 1 - version.Patch = 0 - request.CompilerVersion = version - - request.Wrapper = &ext_plugin.Wrapper{} - - request.Wrapper.Version = "v2" - request.Wrapper.Yaml = string(binary) - request.Wrapper.ExtensionName = extensionName - - requestBytes, _ := proto.Marshal(request) - cmd := exec.Command(extensionHandlers.Name) - cmd.Stdin = bytes.NewReader(requestBytes) - output, err := cmd.Output() - - if err != nil { - fmt.Printf("Error: %+v\n", err) - return nil, err - } - response := &ext_plugin.ExtensionHandlerResponse{} - err = proto.Unmarshal(output, response) - if err != nil { - fmt.Printf("Error: %+v\n", err) - fmt.Printf("%s\n", string(output)) - return nil, err - } - if !response.Handled { - return nil, nil - } - if len(response.Error) != 0 { - message := fmt.Sprintf("Errors when parsing: %+v for field %s by vendor extension handler %s. Details %+v", in, extensionName, extensionHandlers.Name, strings.Join(response.Error, ",")) - return nil, errors.New(message) - } - return response.Value, nil - } - return nil, nil -} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/extensions.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/extensions.go new file mode 100644 index 000000000000..20848a0a1636 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/extensions.go @@ -0,0 +1,85 @@ +// Copyright 2017 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package compiler + +import ( + "bytes" + "fmt" + "os/exec" + "strings" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes/any" + extensions "github.com/googleapis/gnostic/extensions" + yaml "gopkg.in/yaml.v3" +) + +// ExtensionHandler describes a binary that is called by the compiler to handle specification extensions. +type ExtensionHandler struct { + Name string +} + +// CallExtension calls a binary extension handler. +func CallExtension(context *Context, in *yaml.Node, extensionName string) (handled bool, response *any.Any, err error) { + if context == nil || context.ExtensionHandlers == nil { + return false, nil, nil + } + handled = false + for _, handler := range *(context.ExtensionHandlers) { + response, err = handler.handle(in, extensionName) + if response == nil { + continue + } else { + handled = true + break + } + } + return handled, response, err +} + +func (extensionHandlers *ExtensionHandler) handle(in *yaml.Node, extensionName string) (*any.Any, error) { + if extensionHandlers.Name != "" { + yamlData, _ := yaml.Marshal(in) + request := &extensions.ExtensionHandlerRequest{ + CompilerVersion: &extensions.Version{ + Major: 0, + Minor: 1, + Patch: 0, + }, + Wrapper: &extensions.Wrapper{ + Version: "unknown", // TODO: set this to the type/version of spec being parsed. + Yaml: string(yamlData), + ExtensionName: extensionName, + }, + } + requestBytes, _ := proto.Marshal(request) + cmd := exec.Command(extensionHandlers.Name) + cmd.Stdin = bytes.NewReader(requestBytes) + output, err := cmd.Output() + if err != nil { + return nil, err + } + response := &extensions.ExtensionHandlerResponse{} + err = proto.Unmarshal(output, response) + if err != nil || !response.Handled { + return nil, err + } + if len(response.Errors) != 0 { + return nil, fmt.Errorf("Errors when parsing: %+v for field %s by vendor extension handler %s. Details %+v", in, extensionName, extensionHandlers.Name, strings.Join(response.Errors, ",")) + } + return response.Value, nil + } + return nil, nil +} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/helpers.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/helpers.go index 76df635ff9bf..a580f40ac311 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/helpers.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/helpers.go @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,56 +16,63 @@ package compiler import ( "fmt" - "gopkg.in/yaml.v2" "regexp" "sort" "strconv" + + "github.com/googleapis/gnostic/jsonschema" + "gopkg.in/yaml.v3" ) // compiler helper functions, usually called from generated code -// UnpackMap gets a yaml.MapSlice if possible. -func UnpackMap(in interface{}) (yaml.MapSlice, bool) { - m, ok := in.(yaml.MapSlice) - if ok { - return m, true - } - // do we have an empty array? - a, ok := in.([]interface{}) - if ok && len(a) == 0 { - // if so, return an empty map - return yaml.MapSlice{}, true +// UnpackMap gets a *yaml.Node if possible. +func UnpackMap(in *yaml.Node) (*yaml.Node, bool) { + if in == nil { + return nil, false } - return nil, false + return in, true } -// SortedKeysForMap returns the sorted keys of a yaml.MapSlice. -func SortedKeysForMap(m yaml.MapSlice) []string { +// SortedKeysForMap returns the sorted keys of a yamlv2.MapSlice. +func SortedKeysForMap(m *yaml.Node) []string { keys := make([]string, 0) - for _, item := range m { - keys = append(keys, item.Key.(string)) + if m.Kind == yaml.MappingNode { + for i := 0; i < len(m.Content); i += 2 { + keys = append(keys, m.Content[i].Value) + } } sort.Strings(keys) return keys } -// MapHasKey returns true if a yaml.MapSlice contains a specified key. -func MapHasKey(m yaml.MapSlice, key string) bool { - for _, item := range m { - itemKey, ok := item.Key.(string) - if ok && key == itemKey { - return true +// MapHasKey returns true if a yamlv2.MapSlice contains a specified key. +func MapHasKey(m *yaml.Node, key string) bool { + if m == nil { + return false + } + if m.Kind == yaml.MappingNode { + for i := 0; i < len(m.Content); i += 2 { + itemKey := m.Content[i].Value + if key == itemKey { + return true + } } } return false } // MapValueForKey gets the value of a map value for a specified key. -func MapValueForKey(m yaml.MapSlice, key string) interface{} { - for _, item := range m { - itemKey, ok := item.Key.(string) - if ok && key == itemKey { - return item.Value +func MapValueForKey(m *yaml.Node, key string) *yaml.Node { + if m == nil { + return nil + } + if m.Kind == yaml.MappingNode { + for i := 0; i < len(m.Content); i += 2 { + itemKey := m.Content[i].Value + if key == itemKey { + return m.Content[i+1] + } } } return nil @@ -83,8 +90,116 @@ func ConvertInterfaceArrayToStringArray(interfaceArray []interface{}) []string { return stringArray } +// SequenceNodeForNode returns a node if it is a SequenceNode. +func SequenceNodeForNode(node *yaml.Node) (*yaml.Node, bool) { + if node.Kind != yaml.SequenceNode { + return nil, false + } + return node, true +} + +// BoolForScalarNode returns the bool value of a node. +func BoolForScalarNode(node *yaml.Node) (bool, bool) { + if node == nil { + return false, false + } + if node.Kind == yaml.DocumentNode { + return BoolForScalarNode(node.Content[0]) + } + if node.Kind != yaml.ScalarNode { + return false, false + } + if node.Tag != "!!bool" { + return false, false + } + v, err := strconv.ParseBool(node.Value) + if err != nil { + return false, false + } + return v, true +} + +// IntForScalarNode returns the integer value of a node. +func IntForScalarNode(node *yaml.Node) (int64, bool) { + if node == nil { + return 0, false + } + if node.Kind == yaml.DocumentNode { + return IntForScalarNode(node.Content[0]) + } + if node.Kind != yaml.ScalarNode { + return 0, false + } + if node.Tag != "!!int" { + return 0, false + } + v, err := strconv.ParseInt(node.Value, 10, 64) + if err != nil { + return 0, false + } + return v, true +} + +// FloatForScalarNode returns the float value of a node. +func FloatForScalarNode(node *yaml.Node) (float64, bool) { + if node == nil { + return 0.0, false + } + if node.Kind == yaml.DocumentNode { + return FloatForScalarNode(node.Content[0]) + } + if node.Kind != yaml.ScalarNode { + return 0.0, false + } + if (node.Tag != "!!int") && (node.Tag != "!!float") { + return 0.0, false + } + v, err := strconv.ParseFloat(node.Value, 64) + if err != nil { + return 0.0, false + } + return v, true +} + +// StringForScalarNode returns the string value of a node. +func StringForScalarNode(node *yaml.Node) (string, bool) { + if node == nil { + return "", false + } + if node.Kind == yaml.DocumentNode { + return StringForScalarNode(node.Content[0]) + } + switch node.Kind { + case yaml.ScalarNode: + switch node.Tag { + case "!!int": + return node.Value, true + case "!!str": + return node.Value, true + case "!!null": + return "", true + default: + return "", false + } + default: + return "", false + } +} + +// StringArrayForSequenceNode converts a sequence node to an array of strings, if possible. +func StringArrayForSequenceNode(node *yaml.Node) []string { + stringArray := make([]string, 0) + for _, item := range node.Content { + v, ok := StringForScalarNode(item) + if ok { + stringArray = append(stringArray, v) + } + } + return stringArray +} + // MissingKeysInMap identifies which keys from a list of required keys are not in a map. -func MissingKeysInMap(m yaml.MapSlice, requiredKeys []string) []string { +func MissingKeysInMap(m *yaml.Node, requiredKeys []string) []string { missingKeys := make([]string, 0) for _, k := range requiredKeys { if !MapHasKey(m, k) { @@ -95,64 +210,100 @@ func MissingKeysInMap(m yaml.MapSlice, requiredKeys []string) []string { } // InvalidKeysInMap returns keys in a map that don't match a list of allowed keys and patterns. -func InvalidKeysInMap(m yaml.MapSlice, allowedKeys []string, allowedPatterns []*regexp.Regexp) []string { +func InvalidKeysInMap(m *yaml.Node, allowedKeys []string, allowedPatterns []*regexp.Regexp) []string { invalidKeys := make([]string, 0) - for _, item := range m { - itemKey, ok := item.Key.(string) - if ok { - key := itemKey - found := false - // does the key match an allowed key? - for _, allowedKey := range allowedKeys { - if key == allowedKey { + if m == nil || m.Kind != yaml.MappingNode { + return invalidKeys + } + for i := 0; i < len(m.Content); i += 2 { + key := m.Content[i].Value + found := false + // does the key match an allowed key? + for _, allowedKey := range allowedKeys { + if key == allowedKey { + found = true + break + } + } + if !found { + // does the key match an allowed pattern? + for _, allowedPattern := range allowedPatterns { + if allowedPattern.MatchString(key) { found = true break } } if !found { - // does the key match an allowed pattern? - for _, allowedPattern := range allowedPatterns { - if allowedPattern.MatchString(key) { - found = true - break - } - } - if !found { - invalidKeys = append(invalidKeys, key) - } + invalidKeys = append(invalidKeys, key) } } } return invalidKeys } -// DescribeMap describes a map (for debugging purposes). -func DescribeMap(in interface{}, indent string) string { - description := "" - m, ok := in.(map[string]interface{}) - if ok { - keys := make([]string, 0) - for k := range m { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - v := m[k] - description += fmt.Sprintf("%s%s:\n", indent, k) - description += DescribeMap(v, indent+" ") - } - return description +// NewMappingNode creates a new Mapping node. +func NewMappingNode() *yaml.Node { + return &yaml.Node{ + Kind: yaml.MappingNode, + Content: make([]*yaml.Node, 0), } - a, ok := in.([]interface{}) - if ok { - for i, v := range a { - description += fmt.Sprintf("%s%d:\n", indent, i) - description += DescribeMap(v, indent+" ") - } - return description +} + +// NewSequenceNode creates a new Sequence node. +func NewSequenceNode() *yaml.Node { + node := &yaml.Node{ + Kind: yaml.SequenceNode, + Content: make([]*yaml.Node, 0), + } + return node +} + +// NewScalarNodeForString creates a new node to hold a string. +func NewScalarNodeForString(s string) *yaml.Node { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: "!!str", + Value: s, + } +} + +// NewSequenceNodeForStringArray creates a new node to hold an array of strings. +func NewSequenceNodeForStringArray(strings []string) *yaml.Node { + node := &yaml.Node{ + Kind: yaml.SequenceNode, + Content: make([]*yaml.Node, 0), + } + for _, s := range strings { + node.Content = append(node.Content, NewScalarNodeForString(s)) + } + return node +} + +// NewScalarNodeForBool creates a new node to hold a bool. +func NewScalarNodeForBool(b bool) *yaml.Node { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: "!!bool", + Value: fmt.Sprintf("%t", b), + } +} + +// NewScalarNodeForFloat creates a new node to hold a float. +func NewScalarNodeForFloat(f float64) *yaml.Node { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: "!!float", + Value: fmt.Sprintf("%g", f), + } +} + +// NewScalarNodeForInt creates a new node to hold an integer. +func NewScalarNodeForInt(i int64) *yaml.Node { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: "!!int", + Value: fmt.Sprintf("%d", i), } - description += fmt.Sprintf("%s%+v\n", indent, in) - return description } // PluralProperties returns the string "properties" pluralized. @@ -195,3 +346,40 @@ func StringValue(item interface{}) (value string, ok bool) { } return "", false } + +// Description returns a human-readable represention of an item. +func Description(item interface{}) string { + value, ok := item.(*yaml.Node) + if ok { + return jsonschema.Render(value) + } + return fmt.Sprintf("%+v", item) +} + +// Display returns a description of a node for use in error messages. +func Display(node *yaml.Node) string { + switch node.Kind { + case yaml.ScalarNode: + switch node.Tag { + case "!!str": + return fmt.Sprintf("%s (string)", node.Value) + } + } + return fmt.Sprintf("%+v (%T)", node, node) +} + +// Marshal creates a yaml version of a structure in our preferred style +func Marshal(in *yaml.Node) []byte { + clearStyle(in) + //bytes, _ := yaml.Marshal(&yaml.Node{Kind: yaml.DocumentNode, Content: []*yaml.Node{in}}) + bytes, _ := yaml.Marshal(in) + + return bytes +} + +func clearStyle(node *yaml.Node) { + node.Style = 0 + for _, c := range node.Content { + clearStyle(c) + } +} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/main.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/main.go index 9713a21cca26..ce9fcc456cc4 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/main.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/main.go @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/reader.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/reader.go index 955b985b80fe..be0e8b40c8cd 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/reader.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/reader.go @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package compiler import ( - "errors" "fmt" "io/ioutil" "log" @@ -23,18 +22,30 @@ import ( "net/url" "path/filepath" "strings" + "sync" - yaml "gopkg.in/yaml.v2" + yaml "gopkg.in/yaml.v3" ) +var verboseReader = false + var fileCache map[string][]byte -var infoCache map[string]interface{} -var count int64 +var infoCache map[string]*yaml.Node -var verboseReader = false var fileCacheEnable = true var infoCacheEnable = true +// These locks are used to synchronize accesses to the fileCache and infoCache +// maps (above). They are global state and can throw thread-related errors +// when modified from separate goroutines. The general strategy is to protect +// all public functions in this file with mutex Lock() calls. As a result, to +// avoid deadlock, these public functions should not call other public +// functions, so some public functions have private equivalents. +// In the future, we might consider replacing the maps with sync.Map and +// eliminating these mutexes. +var fileCacheMutex sync.Mutex +var infoCacheMutex sync.Mutex + func initializeFileCache() { if fileCache == nil { fileCache = make(map[string][]byte, 0) @@ -43,27 +54,42 @@ func initializeFileCache() { func initializeInfoCache() { if infoCache == nil { - infoCache = make(map[string]interface{}, 0) + infoCache = make(map[string]*yaml.Node, 0) } } +// EnableFileCache turns on file caching. func EnableFileCache() { + fileCacheMutex.Lock() + defer fileCacheMutex.Unlock() fileCacheEnable = true } +// EnableInfoCache turns on parsed info caching. func EnableInfoCache() { + infoCacheMutex.Lock() + defer infoCacheMutex.Unlock() infoCacheEnable = true } +// DisableFileCache turns off file caching. func DisableFileCache() { + fileCacheMutex.Lock() + defer fileCacheMutex.Unlock() fileCacheEnable = false } +// DisableInfoCache turns off parsed info caching. func DisableInfoCache() { + infoCacheMutex.Lock() + defer infoCacheMutex.Unlock() infoCacheEnable = false } +// RemoveFromFileCache removes an entry from the file cache. func RemoveFromFileCache(fileurl string) { + fileCacheMutex.Lock() + defer fileCacheMutex.Unlock() if !fileCacheEnable { return } @@ -71,7 +97,10 @@ func RemoveFromFileCache(fileurl string) { delete(fileCache, fileurl) } +// RemoveFromInfoCache removes an entry from the info cache. func RemoveFromInfoCache(filename string) { + infoCacheMutex.Lock() + defer infoCacheMutex.Unlock() if !infoCacheEnable { return } @@ -79,21 +108,31 @@ func RemoveFromInfoCache(filename string) { delete(infoCache, filename) } -func GetInfoCache() map[string]interface{} { +// GetInfoCache returns the info cache map. +func GetInfoCache() map[string]*yaml.Node { + infoCacheMutex.Lock() + defer infoCacheMutex.Unlock() if infoCache == nil { initializeInfoCache() } return infoCache } +// ClearFileCache clears the file cache. func ClearFileCache() { + fileCacheMutex.Lock() + defer fileCacheMutex.Unlock() fileCache = make(map[string][]byte, 0) } +// ClearInfoCache clears the info cache. func ClearInfoCache() { - infoCache = make(map[string]interface{}) + infoCacheMutex.Lock() + defer infoCacheMutex.Unlock() + infoCache = make(map[string]*yaml.Node) } +// ClearCaches clears all caches. func ClearCaches() { ClearFileCache() ClearInfoCache() @@ -101,6 +140,12 @@ func ClearCaches() { // FetchFile gets a specified file from the local filesystem or a remote location. func FetchFile(fileurl string) ([]byte, error) { + fileCacheMutex.Lock() + defer fileCacheMutex.Unlock() + return fetchFile(fileurl) +} + +func fetchFile(fileurl string) ([]byte, error) { var bytes []byte initializeFileCache() if fileCacheEnable { @@ -121,7 +166,7 @@ func FetchFile(fileurl string) ([]byte, error) { } defer response.Body.Close() if response.StatusCode != 200 { - return nil, errors.New(fmt.Sprintf("Error downloading %s: %s", fileurl, response.Status)) + return nil, fmt.Errorf("Error downloading %s: %s", fileurl, response.Status) } bytes, err = ioutil.ReadAll(response.Body) if fileCacheEnable && err == nil { @@ -132,11 +177,17 @@ func FetchFile(fileurl string) ([]byte, error) { // ReadBytesForFile reads the bytes of a file. func ReadBytesForFile(filename string) ([]byte, error) { + fileCacheMutex.Lock() + defer fileCacheMutex.Unlock() + return readBytesForFile(filename) +} + +func readBytesForFile(filename string) ([]byte, error) { // is the filename a url? fileurl, _ := url.Parse(filename) if fileurl.Scheme != "" { // yes, fetch it - bytes, err := FetchFile(filename) + bytes, err := fetchFile(filename) if err != nil { return nil, err } @@ -150,8 +201,14 @@ func ReadBytesForFile(filename string) ([]byte, error) { return bytes, nil } -// ReadInfoFromBytes unmarshals a file as a yaml.MapSlice. -func ReadInfoFromBytes(filename string, bytes []byte) (interface{}, error) { +// ReadInfoFromBytes unmarshals a file as a *yaml.Node. +func ReadInfoFromBytes(filename string, bytes []byte) (*yaml.Node, error) { + infoCacheMutex.Lock() + defer infoCacheMutex.Unlock() + return readInfoFromBytes(filename, bytes) +} + +func readInfoFromBytes(filename string, bytes []byte) (*yaml.Node, error) { initializeInfoCache() if infoCacheEnable { cachedInfo, ok := infoCache[filename] @@ -165,19 +222,23 @@ func ReadInfoFromBytes(filename string, bytes []byte) (interface{}, error) { log.Printf("Reading info for file %s", filename) } } - var info yaml.MapSlice + var info yaml.Node err := yaml.Unmarshal(bytes, &info) if err != nil { return nil, err } if infoCacheEnable && len(filename) > 0 { - infoCache[filename] = info + infoCache[filename] = &info } - return info, nil + return &info, nil } // ReadInfoForRef reads a file and return the fragment needed to resolve a $ref. -func ReadInfoForRef(basefile string, ref string) (interface{}, error) { +func ReadInfoForRef(basefile string, ref string) (*yaml.Node, error) { + fileCacheMutex.Lock() + defer fileCacheMutex.Unlock() + infoCacheMutex.Lock() + defer infoCacheMutex.Unlock() initializeInfoCache() if infoCacheEnable { info, ok := infoCache[ref] @@ -191,7 +252,6 @@ func ReadInfoForRef(basefile string, ref string) (interface{}, error) { log.Printf("Reading info for ref %s#%s", basefile, ref) } } - count = count + 1 basedir, _ := filepath.Split(basefile) parts := strings.Split(ref, "#") var filename string @@ -204,24 +264,30 @@ func ReadInfoForRef(basefile string, ref string) (interface{}, error) { } else { filename = basefile } - bytes, err := ReadBytesForFile(filename) + bytes, err := readBytesForFile(filename) if err != nil { return nil, err } - info, err := ReadInfoFromBytes(filename, bytes) + info, err := readInfoFromBytes(filename, bytes) + if info != nil && info.Kind == yaml.DocumentNode { + info = info.Content[0] + } if err != nil { log.Printf("File error: %v\n", err) } else { + if info == nil { + return nil, NewError(nil, fmt.Sprintf("could not resolve %s", ref)) + } if len(parts) > 1 { path := strings.Split(parts[1], "/") for i, key := range path { if i > 0 { - m, ok := info.(yaml.MapSlice) - if ok { + m := info + if true { found := false - for _, section := range m { - if section.Key == key { - info = section.Value + for i := 0; i < len(m.Content); i += 2 { + if m.Content[i].Value == key { + info = m.Content[i+1] found = true } } diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/README.md b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/README.md index ff1c2eb1e3ad..4b5d63e5856d 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/README.md +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/README.md @@ -1,5 +1,13 @@ # Extensions -This directory contains support code for building Gnostic extensions and associated examples. +**Extension Support is experimental.** -Extensions are used to compile vendor or specification extensions into protocol buffer structures. +This directory contains support code for building Gnostic extensio handlers and +associated examples. + +Extension handlers can be used to compile vendor or specification extensions +into protocol buffer structures. + +Like plugins, extension handlers are built as separate executables. Extension +bodies are written to extension handlers as serialized +ExtensionHandlerRequests. diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go index 432dc06e6d08..4198fa17e9b4 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go @@ -1,148 +1,186 @@ +// Copyright 2017 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.12.3 // source: extensions/extension.proto -package openapiextension_v1 +package gnostic_extension_v1 import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" any "github.com/golang/protobuf/ptypes/any" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 -// The version number of OpenAPI compiler. +// The version number of Gnostic. type Version struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Major int32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` Minor int32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"` // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. - Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` } -func (m *Version) Reset() { *m = Version{} } -func (m *Version) String() string { return proto.CompactTextString(m) } -func (*Version) ProtoMessage() {} -func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_661e47e790f76671, []int{0} +func (x *Version) Reset() { + *x = Version{} + if protoimpl.UnsafeEnabled { + mi := &file_extensions_extension_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Version) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Version.Unmarshal(m, b) -} -func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Version.Marshal(b, m, deterministic) -} -func (m *Version) XXX_Merge(src proto.Message) { - xxx_messageInfo_Version.Merge(m, src) +func (x *Version) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Version) XXX_Size() int { - return xxx_messageInfo_Version.Size(m) -} -func (m *Version) XXX_DiscardUnknown() { - xxx_messageInfo_Version.DiscardUnknown(m) + +func (*Version) ProtoMessage() {} + +func (x *Version) ProtoReflect() protoreflect.Message { + mi := &file_extensions_extension_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) } -var xxx_messageInfo_Version proto.InternalMessageInfo +// Deprecated: Use Version.ProtoReflect.Descriptor instead. +func (*Version) Descriptor() ([]byte, []int) { + return file_extensions_extension_proto_rawDescGZIP(), []int{0} +} -func (m *Version) GetMajor() int32 { - if m != nil { - return m.Major +func (x *Version) GetMajor() int32 { + if x != nil { + return x.Major } return 0 } -func (m *Version) GetMinor() int32 { - if m != nil { - return m.Minor +func (x *Version) GetMinor() int32 { + if x != nil { + return x.Minor } return 0 } -func (m *Version) GetPatch() int32 { - if m != nil { - return m.Patch +func (x *Version) GetPatch() int32 { + if x != nil { + return x.Patch } return 0 } -func (m *Version) GetSuffix() string { - if m != nil { - return m.Suffix +func (x *Version) GetSuffix() string { + if x != nil { + return x.Suffix } return "" } // An encoded Request is written to the ExtensionHandler's stdin. type ExtensionHandlerRequest struct { - // The OpenAPI descriptions that were explicitly listed on the command line. - // The specifications will appear in the order they are specified to gnostic. + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The extension to process. Wrapper *Wrapper `protobuf:"bytes,1,opt,name=wrapper,proto3" json:"wrapper,omitempty"` - // The version number of openapi compiler. - CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion,proto3" json:"compiler_version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // The version number of Gnostic. + CompilerVersion *Version `protobuf:"bytes,2,opt,name=compiler_version,json=compilerVersion,proto3" json:"compiler_version,omitempty"` } -func (m *ExtensionHandlerRequest) Reset() { *m = ExtensionHandlerRequest{} } -func (m *ExtensionHandlerRequest) String() string { return proto.CompactTextString(m) } -func (*ExtensionHandlerRequest) ProtoMessage() {} -func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_661e47e790f76671, []int{1} +func (x *ExtensionHandlerRequest) Reset() { + *x = ExtensionHandlerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_extensions_extension_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ExtensionHandlerRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtensionHandlerRequest.Unmarshal(m, b) -} -func (m *ExtensionHandlerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtensionHandlerRequest.Marshal(b, m, deterministic) -} -func (m *ExtensionHandlerRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtensionHandlerRequest.Merge(m, src) -} -func (m *ExtensionHandlerRequest) XXX_Size() int { - return xxx_messageInfo_ExtensionHandlerRequest.Size(m) +func (x *ExtensionHandlerRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ExtensionHandlerRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ExtensionHandlerRequest.DiscardUnknown(m) + +func (*ExtensionHandlerRequest) ProtoMessage() {} + +func (x *ExtensionHandlerRequest) ProtoReflect() protoreflect.Message { + mi := &file_extensions_extension_proto_msgTypes[1] + 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) } -var xxx_messageInfo_ExtensionHandlerRequest proto.InternalMessageInfo +// Deprecated: Use ExtensionHandlerRequest.ProtoReflect.Descriptor instead. +func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int) { + return file_extensions_extension_proto_rawDescGZIP(), []int{1} +} -func (m *ExtensionHandlerRequest) GetWrapper() *Wrapper { - if m != nil { - return m.Wrapper +func (x *ExtensionHandlerRequest) GetWrapper() *Wrapper { + if x != nil { + return x.Wrapper } return nil } -func (m *ExtensionHandlerRequest) GetCompilerVersion() *Version { - if m != nil { - return m.CompilerVersion +func (x *ExtensionHandlerRequest) GetCompilerVersion() *Version { + if x != nil { + return x.CompilerVersion } return nil } // The extensions writes an encoded ExtensionHandlerResponse to stdout. type ExtensionHandlerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // true if the extension is handled by the extension handler; false otherwise Handled bool `protobuf:"varint,1,opt,name=handled,proto3" json:"handled,omitempty"` - // Error message. If non-empty, the extension handling failed. + // Error message(s). If non-empty, the extension handling failed. // The extension handler process should exit with status code zero // even if it reports an error in this way. // @@ -151,150 +189,277 @@ type ExtensionHandlerResponse struct { // itself -- such as the input Document being unparseable -- should be // reported by writing a message to stderr and exiting with a non-zero // status code. - Error []string `protobuf:"bytes,2,rep,name=error,proto3" json:"error,omitempty"` + Errors []string `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"` // text output - Value *any.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *any.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` } -func (m *ExtensionHandlerResponse) Reset() { *m = ExtensionHandlerResponse{} } -func (m *ExtensionHandlerResponse) String() string { return proto.CompactTextString(m) } -func (*ExtensionHandlerResponse) ProtoMessage() {} -func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_661e47e790f76671, []int{2} +func (x *ExtensionHandlerResponse) Reset() { + *x = ExtensionHandlerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_extensions_extension_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ExtensionHandlerResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtensionHandlerResponse.Unmarshal(m, b) -} -func (m *ExtensionHandlerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtensionHandlerResponse.Marshal(b, m, deterministic) -} -func (m *ExtensionHandlerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtensionHandlerResponse.Merge(m, src) +func (x *ExtensionHandlerResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ExtensionHandlerResponse) XXX_Size() int { - return xxx_messageInfo_ExtensionHandlerResponse.Size(m) -} -func (m *ExtensionHandlerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ExtensionHandlerResponse.DiscardUnknown(m) + +func (*ExtensionHandlerResponse) ProtoMessage() {} + +func (x *ExtensionHandlerResponse) ProtoReflect() protoreflect.Message { + mi := &file_extensions_extension_proto_msgTypes[2] + 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) } -var xxx_messageInfo_ExtensionHandlerResponse proto.InternalMessageInfo +// Deprecated: Use ExtensionHandlerResponse.ProtoReflect.Descriptor instead. +func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int) { + return file_extensions_extension_proto_rawDescGZIP(), []int{2} +} -func (m *ExtensionHandlerResponse) GetHandled() bool { - if m != nil { - return m.Handled +func (x *ExtensionHandlerResponse) GetHandled() bool { + if x != nil { + return x.Handled } return false } -func (m *ExtensionHandlerResponse) GetError() []string { - if m != nil { - return m.Error +func (x *ExtensionHandlerResponse) GetErrors() []string { + if x != nil { + return x.Errors } return nil } -func (m *ExtensionHandlerResponse) GetValue() *any.Any { - if m != nil { - return m.Value +func (x *ExtensionHandlerResponse) GetValue() *any.Any { + if x != nil { + return x.Value } return nil } type Wrapper struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // version of the OpenAPI specification in which this extension was written. Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Name of the extension + // Name of the extension. ExtensionName string `protobuf:"bytes,2,opt,name=extension_name,json=extensionName,proto3" json:"extension_name,omitempty"` - // Must be a valid yaml for the proto - Yaml string `protobuf:"bytes,3,opt,name=yaml,proto3" json:"yaml,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // YAML-formatted extension value. + Yaml string `protobuf:"bytes,3,opt,name=yaml,proto3" json:"yaml,omitempty"` } -func (m *Wrapper) Reset() { *m = Wrapper{} } -func (m *Wrapper) String() string { return proto.CompactTextString(m) } -func (*Wrapper) ProtoMessage() {} -func (*Wrapper) Descriptor() ([]byte, []int) { - return fileDescriptor_661e47e790f76671, []int{3} +func (x *Wrapper) Reset() { + *x = Wrapper{} + if protoimpl.UnsafeEnabled { + mi := &file_extensions_extension_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Wrapper) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Wrapper.Unmarshal(m, b) +func (x *Wrapper) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Wrapper) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Wrapper.Marshal(b, m, deterministic) -} -func (m *Wrapper) XXX_Merge(src proto.Message) { - xxx_messageInfo_Wrapper.Merge(m, src) -} -func (m *Wrapper) XXX_Size() int { - return xxx_messageInfo_Wrapper.Size(m) -} -func (m *Wrapper) XXX_DiscardUnknown() { - xxx_messageInfo_Wrapper.DiscardUnknown(m) + +func (*Wrapper) ProtoMessage() {} + +func (x *Wrapper) ProtoReflect() protoreflect.Message { + mi := &file_extensions_extension_proto_msgTypes[3] + 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) } -var xxx_messageInfo_Wrapper proto.InternalMessageInfo +// Deprecated: Use Wrapper.ProtoReflect.Descriptor instead. +func (*Wrapper) Descriptor() ([]byte, []int) { + return file_extensions_extension_proto_rawDescGZIP(), []int{3} +} -func (m *Wrapper) GetVersion() string { - if m != nil { - return m.Version +func (x *Wrapper) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (m *Wrapper) GetExtensionName() string { - if m != nil { - return m.ExtensionName +func (x *Wrapper) GetExtensionName() string { + if x != nil { + return x.ExtensionName } return "" } -func (m *Wrapper) GetYaml() string { - if m != nil { - return m.Yaml +func (x *Wrapper) GetYaml() string { + if x != nil { + return x.Yaml } return "" } -func init() { - proto.RegisterType((*Version)(nil), "openapiextension.v1.Version") - proto.RegisterType((*ExtensionHandlerRequest)(nil), "openapiextension.v1.ExtensionHandlerRequest") - proto.RegisterType((*ExtensionHandlerResponse)(nil), "openapiextension.v1.ExtensionHandlerResponse") - proto.RegisterType((*Wrapper)(nil), "openapiextension.v1.Wrapper") -} - -func init() { proto.RegisterFile("extensions/extension.proto", fileDescriptor_661e47e790f76671) } - -var fileDescriptor_661e47e790f76671 = []byte{ - // 362 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x4d, 0x4b, 0xeb, 0x40, - 0x18, 0x85, 0x49, 0xbf, 0x72, 0x33, 0x97, 0xdb, 0x2b, 0x63, 0xd1, 0x58, 0x5c, 0x94, 0x80, 0x50, - 0x44, 0xa6, 0x54, 0xc1, 0x7d, 0x0b, 0x45, 0xdd, 0xd8, 0x32, 0x8b, 0xba, 0xb3, 0x4c, 0xd3, 0xb7, - 0x69, 0x24, 0x99, 0x19, 0x27, 0x1f, 0xb6, 0x7f, 0xc5, 0xa5, 0xbf, 0x54, 0x32, 0x93, 0xc4, 0x85, - 0xba, 0x9b, 0xf3, 0x70, 0xda, 0xf7, 0x9c, 0x13, 0xd4, 0x87, 0x7d, 0x0a, 0x3c, 0x09, 0x05, 0x4f, - 0x46, 0xf5, 0x93, 0x48, 0x25, 0x52, 0x81, 0x8f, 0x85, 0x04, 0xce, 0x64, 0xf8, 0xc5, 0xf3, 0x71, - 0xff, 0x2c, 0x10, 0x22, 0x88, 0x60, 0xa4, 0x2d, 0xeb, 0x6c, 0x3b, 0x62, 0xfc, 0x60, 0xfc, 0x9e, - 0x8f, 0xec, 0x25, 0xa8, 0xc2, 0x88, 0x7b, 0xa8, 0x1d, 0xb3, 0x17, 0xa1, 0x5c, 0x6b, 0x60, 0x0d, - 0xdb, 0xd4, 0x08, 0x4d, 0x43, 0x2e, 0x94, 0xdb, 0x28, 0x69, 0x21, 0x0a, 0x2a, 0x59, 0xea, 0xef, - 0xdc, 0xa6, 0xa1, 0x5a, 0xe0, 0x13, 0xd4, 0x49, 0xb2, 0xed, 0x36, 0xdc, 0xbb, 0xad, 0x81, 0x35, - 0x74, 0x68, 0xa9, 0xbc, 0x77, 0x0b, 0x9d, 0xce, 0xaa, 0x40, 0xf7, 0x8c, 0x6f, 0x22, 0x50, 0x14, - 0x5e, 0x33, 0x48, 0x52, 0x7c, 0x8b, 0xec, 0x37, 0xc5, 0xa4, 0x04, 0x73, 0xf7, 0xef, 0xf5, 0x39, - 0xf9, 0xa1, 0x02, 0x79, 0x32, 0x1e, 0x5a, 0x99, 0xf1, 0x1d, 0x3a, 0xf2, 0x45, 0x2c, 0xc3, 0x08, - 0xd4, 0x2a, 0x37, 0x0d, 0x74, 0x98, 0xdf, 0xfe, 0xa0, 0x6c, 0x49, 0xff, 0x57, 0xbf, 0x2a, 0x81, - 0x97, 0x23, 0xf7, 0x7b, 0xb6, 0x44, 0x0a, 0x9e, 0x00, 0x76, 0x91, 0xbd, 0xd3, 0x68, 0xa3, 0xc3, - 0xfd, 0xa1, 0x95, 0x2c, 0x06, 0x00, 0xa5, 0xf4, 0x2c, 0xcd, 0xa1, 0x43, 0x8d, 0xc0, 0x97, 0xa8, - 0x9d, 0xb3, 0x28, 0x83, 0x32, 0x49, 0x8f, 0x98, 0xe1, 0x49, 0x35, 0x3c, 0x99, 0xf0, 0x03, 0x35, - 0x16, 0xef, 0x19, 0xd9, 0x65, 0xa9, 0xe2, 0x4c, 0x55, 0xc1, 0xd2, 0xc3, 0x55, 0x12, 0x5f, 0xa0, - 0x6e, 0xdd, 0x62, 0xc5, 0x59, 0x0c, 0xfa, 0x33, 0x38, 0xf4, 0x5f, 0x4d, 0x1f, 0x59, 0x0c, 0x18, - 0xa3, 0xd6, 0x81, 0xc5, 0x91, 0x3e, 0xeb, 0x50, 0xfd, 0x9e, 0x5e, 0xa1, 0xae, 0x50, 0x01, 0x09, - 0xb8, 0x48, 0xd2, 0xd0, 0x27, 0xf9, 0x78, 0x8a, 0xe7, 0x12, 0xf8, 0x64, 0xf1, 0x50, 0xd7, 0x5d, - 0x8e, 0x17, 0xd6, 0x47, 0xa3, 0x39, 0x9f, 0xcc, 0xd6, 0x1d, 0x1d, 0xf1, 0xe6, 0x33, 0x00, 0x00, - 0xff, 0xff, 0xeb, 0xf3, 0xfa, 0x65, 0x5c, 0x02, 0x00, 0x00, +var File_extensions_extension_proto protoreflect.FileDescriptor + +var file_extensions_extension_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6e, + 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x63, 0x0a, + 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, + 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, + 0x66, 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, + 0x69, 0x78, 0x22, 0x9c, 0x01, 0x0a, 0x17, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, + 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x07, + 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x69, + 0x6c, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x22, 0x78, 0x0a, 0x18, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, + 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5e, 0x0a, 0x07, 0x57, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 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, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x42, 0x4b, 0x0a, 0x0e, 0x6f, + 0x72, 0x67, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x47, + 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x50, + 0x01, 0x5a, 0x1f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x67, 0x6e, + 0x6f, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x4e, 0x58, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_extensions_extension_proto_rawDescOnce sync.Once + file_extensions_extension_proto_rawDescData = file_extensions_extension_proto_rawDesc +) + +func file_extensions_extension_proto_rawDescGZIP() []byte { + file_extensions_extension_proto_rawDescOnce.Do(func() { + file_extensions_extension_proto_rawDescData = protoimpl.X.CompressGZIP(file_extensions_extension_proto_rawDescData) + }) + return file_extensions_extension_proto_rawDescData +} + +var file_extensions_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_extensions_extension_proto_goTypes = []interface{}{ + (*Version)(nil), // 0: gnostic.extension.v1.Version + (*ExtensionHandlerRequest)(nil), // 1: gnostic.extension.v1.ExtensionHandlerRequest + (*ExtensionHandlerResponse)(nil), // 2: gnostic.extension.v1.ExtensionHandlerResponse + (*Wrapper)(nil), // 3: gnostic.extension.v1.Wrapper + (*any.Any)(nil), // 4: google.protobuf.Any +} +var file_extensions_extension_proto_depIdxs = []int32{ + 3, // 0: gnostic.extension.v1.ExtensionHandlerRequest.wrapper:type_name -> gnostic.extension.v1.Wrapper + 0, // 1: gnostic.extension.v1.ExtensionHandlerRequest.compiler_version:type_name -> gnostic.extension.v1.Version + 4, // 2: gnostic.extension.v1.ExtensionHandlerResponse.value:type_name -> google.protobuf.Any + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_extensions_extension_proto_init() } +func file_extensions_extension_proto_init() { + if File_extensions_extension_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_extensions_extension_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Version); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_extensions_extension_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtensionHandlerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_extensions_extension_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtensionHandlerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_extensions_extension_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Wrapper); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_extensions_extension_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_extensions_extension_proto_goTypes, + DependencyIndexes: file_extensions_extension_proto_depIdxs, + MessageInfos: file_extensions_extension_proto_msgTypes, + }.Build() + File_extensions_extension_proto = out.File + file_extensions_extension_proto_rawDesc = nil + file_extensions_extension_proto_goTypes = nil + file_extensions_extension_proto_depIdxs = nil } diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.proto b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.proto index 04856f913b17..8ac1faffc056 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.proto +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,8 +14,9 @@ syntax = "proto3"; +package gnostic.extension.v1; + import "google/protobuf/any.proto"; -package openapiextension.v1; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler @@ -26,7 +27,7 @@ option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. -option java_outer_classname = "OpenAPIExtensionV1"; +option java_outer_classname = "GnosticExtension"; // The Java package name must be proto package name with proper prefix. option java_package = "org.gnostic.v1"; @@ -37,9 +38,12 @@ option java_package = "org.gnostic.v1"; // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. // -option objc_class_prefix = "OAE"; // "OpenAPI Extension" +option objc_class_prefix = "GNX"; // "Gnostic Extension" + +// The Go package name. +option go_package = "extensions;gnostic_extension_v1"; -// The version number of OpenAPI compiler. +// The version number of Gnostic. message Version { int32 major = 1; int32 minor = 2; @@ -52,12 +56,11 @@ message Version { // An encoded Request is written to the ExtensionHandler's stdin. message ExtensionHandlerRequest { - // The OpenAPI descriptions that were explicitly listed on the command line. - // The specifications will appear in the order they are specified to gnostic. + // The extension to process. Wrapper wrapper = 1; - // The version number of openapi compiler. - Version compiler_version = 3; + // The version number of Gnostic. + Version compiler_version = 2; } // The extensions writes an encoded ExtensionHandlerResponse to stdout. @@ -66,7 +69,7 @@ message ExtensionHandlerResponse { // true if the extension is handled by the extension handler; false otherwise bool handled = 1; - // Error message. If non-empty, the extension handling failed. + // Error message(s). If non-empty, the extension handling failed. // The extension handler process should exit with status code zero // even if it reports an error in this way. // @@ -75,7 +78,7 @@ message ExtensionHandlerResponse { // itself -- such as the input Document being unparseable -- should be // reported by writing a message to stderr and exiting with a non-zero // status code. - repeated string error = 2; + repeated string errors = 2; // text output google.protobuf.Any value = 3; @@ -85,9 +88,9 @@ message Wrapper { // version of the OpenAPI specification in which this extension was written. string version = 1; - // Name of the extension + // Name of the extension. string extension_name = 2; - // Must be a valid yaml for the proto + // YAML-formatted extension value. string yaml = 3; } diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extensions.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extensions.go index 94a8e62a776e..ec8afd009239 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extensions.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extensions.go @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,71 +12,53 @@ // See the License for the specific language governing permissions and // limitations under the License. -package openapiextension_v1 +package gnostic_extension_v1 import ( - "fmt" "io/ioutil" + "log" "os" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" ) -type documentHandler func(version string, extensionName string, document string) type extensionHandler func(name string, yamlInput string) (bool, proto.Message, error) -func forInputYamlFromOpenapic(handler documentHandler) { +// Main implements the main program of an extension handler. +func Main(handler extensionHandler) { + // unpack the request data, err := ioutil.ReadAll(os.Stdin) if err != nil { - fmt.Println("File error:", err.Error()) + log.Println("File error:", err.Error()) os.Exit(1) } if len(data) == 0 { - fmt.Println("No input data.") + log.Println("No input data.") os.Exit(1) } request := &ExtensionHandlerRequest{} err = proto.Unmarshal(data, request) if err != nil { - fmt.Println("Input error:", err.Error()) + log.Println("Input error:", err.Error()) os.Exit(1) } - handler(request.Wrapper.Version, request.Wrapper.ExtensionName, request.Wrapper.Yaml) -} - -// ProcessExtension calles the handler for a specified extension. -func ProcessExtension(handleExtension extensionHandler) { - response := &ExtensionHandlerResponse{} - forInputYamlFromOpenapic( - func(version string, extensionName string, yamlInput string) { - var newObject proto.Message - var err error - - handled, newObject, err := handleExtension(extensionName, yamlInput) - if !handled { - responseBytes, _ := proto.Marshal(response) - os.Stdout.Write(responseBytes) - os.Exit(0) - } - - // If we reach here, then the extension is handled - response.Handled = true - if err != nil { - response.Error = append(response.Error, err.Error()) - responseBytes, _ := proto.Marshal(response) - os.Stdout.Write(responseBytes) - os.Exit(0) - } - response.Value, err = ptypes.MarshalAny(newObject) - if err != nil { - response.Error = append(response.Error, err.Error()) - responseBytes, _ := proto.Marshal(response) - os.Stdout.Write(responseBytes) - os.Exit(0) - } - }) - + // call the handler + handled, output, err := handler(request.Wrapper.ExtensionName, request.Wrapper.Yaml) + // respond with the output of the handler + response := &ExtensionHandlerResponse{ + Handled: false, // default assumption + Errors: make([]string, 0), + } + if err != nil { + response.Errors = append(response.Errors, err.Error()) + } else if handled { + response.Handled = true + response.Value, err = ptypes.MarshalAny(output) + if err != nil { + response.Errors = append(response.Errors, err.Error()) + } + } responseBytes, _ := proto.Marshal(response) os.Stdout.Write(responseBytes) } diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/README.md b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/README.md new file mode 100644 index 000000000000..6793c5179c80 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/README.md @@ -0,0 +1,4 @@ +# jsonschema + +This directory contains code for reading, writing, and manipulating JSON +schemas. diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/base.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/base.go new file mode 100644 index 000000000000..0af8b148b9c0 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/base.go @@ -0,0 +1,84 @@ + +// THIS FILE IS AUTOMATICALLY GENERATED. + +package jsonschema + +import ( + "encoding/base64" +) + +func baseSchemaBytes() ([]byte, error){ + return base64.StdEncoding.DecodeString( +`ewogICAgImlkIjogImh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvZHJhZnQtMDQvc2NoZW1hIyIsCiAgICAi +JHNjaGVtYSI6ICJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA0L3NjaGVtYSMiLAogICAgImRl +c2NyaXB0aW9uIjogIkNvcmUgc2NoZW1hIG1ldGEtc2NoZW1hIiwKICAgICJkZWZpbml0aW9ucyI6IHsK +ICAgICAgICAic2NoZW1hQXJyYXkiOiB7CiAgICAgICAgICAgICJ0eXBlIjogImFycmF5IiwKICAgICAg +ICAgICAgIm1pbkl0ZW1zIjogMSwKICAgICAgICAgICAgIml0ZW1zIjogeyAiJHJlZiI6ICIjIiB9CiAg +ICAgICAgfSwKICAgICAgICAicG9zaXRpdmVJbnRlZ2VyIjogewogICAgICAgICAgICAidHlwZSI6ICJp +bnRlZ2VyIiwKICAgICAgICAgICAgIm1pbmltdW0iOiAwCiAgICAgICAgfSwKICAgICAgICAicG9zaXRp +dmVJbnRlZ2VyRGVmYXVsdDAiOiB7CiAgICAgICAgICAgICJhbGxPZiI6IFsgeyAiJHJlZiI6ICIjL2Rl +ZmluaXRpb25zL3Bvc2l0aXZlSW50ZWdlciIgfSwgeyAiZGVmYXVsdCI6IDAgfSBdCiAgICAgICAgfSwK +ICAgICAgICAic2ltcGxlVHlwZXMiOiB7CiAgICAgICAgICAgICJlbnVtIjogWyAiYXJyYXkiLCAiYm9v +bGVhbiIsICJpbnRlZ2VyIiwgIm51bGwiLCAibnVtYmVyIiwgIm9iamVjdCIsICJzdHJpbmciIF0KICAg +ICAgICB9LAogICAgICAgICJzdHJpbmdBcnJheSI6IHsKICAgICAgICAgICAgInR5cGUiOiAiYXJyYXki +LAogICAgICAgICAgICAiaXRlbXMiOiB7ICJ0eXBlIjogInN0cmluZyIgfSwKICAgICAgICAgICAgIm1p +bkl0ZW1zIjogMSwKICAgICAgICAgICAgInVuaXF1ZUl0ZW1zIjogdHJ1ZQogICAgICAgIH0KICAgIH0s +CiAgICAidHlwZSI6ICJvYmplY3QiLAogICAgInByb3BlcnRpZXMiOiB7CiAgICAgICAgImlkIjogewog +ICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciLAogICAgICAgICAgICAiZm9ybWF0IjogInVyaSIKICAg +ICAgICB9LAogICAgICAgICIkc2NoZW1hIjogewogICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciLAog +ICAgICAgICAgICAiZm9ybWF0IjogInVyaSIKICAgICAgICB9LAogICAgICAgICJ0aXRsZSI6IHsKICAg +ICAgICAgICAgInR5cGUiOiAic3RyaW5nIgogICAgICAgIH0sCiAgICAgICAgImRlc2NyaXB0aW9uIjog +ewogICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciCiAgICAgICAgfSwKICAgICAgICAiZGVmYXVsdCI6 +IHt9LAogICAgICAgICJtdWx0aXBsZU9mIjogewogICAgICAgICAgICAidHlwZSI6ICJudW1iZXIiLAog +ICAgICAgICAgICAibWluaW11bSI6IDAsCiAgICAgICAgICAgICJleGNsdXNpdmVNaW5pbXVtIjogdHJ1 +ZQogICAgICAgIH0sCiAgICAgICAgIm1heGltdW0iOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm51bWJl +ciIKICAgICAgICB9LAogICAgICAgICJleGNsdXNpdmVNYXhpbXVtIjogewogICAgICAgICAgICAidHlw +ZSI6ICJib29sZWFuIiwKICAgICAgICAgICAgImRlZmF1bHQiOiBmYWxzZQogICAgICAgIH0sCiAgICAg +ICAgIm1pbmltdW0iOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm51bWJlciIKICAgICAgICB9LAogICAg +ICAgICJleGNsdXNpdmVNaW5pbXVtIjogewogICAgICAgICAgICAidHlwZSI6ICJib29sZWFuIiwKICAg +ICAgICAgICAgImRlZmF1bHQiOiBmYWxzZQogICAgICAgIH0sCiAgICAgICAgIm1heExlbmd0aCI6IHsg +IiRyZWYiOiAiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXIiIH0sCiAgICAgICAgIm1pbkxlbmd0 +aCI6IHsgIiRyZWYiOiAiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJEZWZhdWx0MCIgfSwKICAg +ICAgICAicGF0dGVybiI6IHsKICAgICAgICAgICAgInR5cGUiOiAic3RyaW5nIiwKICAgICAgICAgICAg +ImZvcm1hdCI6ICJyZWdleCIKICAgICAgICB9LAogICAgICAgICJhZGRpdGlvbmFsSXRlbXMiOiB7CiAg +ICAgICAgICAgICJhbnlPZiI6IFsKICAgICAgICAgICAgICAgIHsgInR5cGUiOiAiYm9vbGVhbiIgfSwK +ICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIyIgfQogICAgICAgICAgICBdLAogICAgICAgICAgICAi +ZGVmYXVsdCI6IHt9CiAgICAgICAgfSwKICAgICAgICAiaXRlbXMiOiB7CiAgICAgICAgICAgICJhbnlP +ZiI6IFsKICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIyIgfSwKICAgICAgICAgICAgICAgIHsgIiRy +ZWYiOiAiIy9kZWZpbml0aW9ucy9zY2hlbWFBcnJheSIgfQogICAgICAgICAgICBdLAogICAgICAgICAg +ICAiZGVmYXVsdCI6IHt9CiAgICAgICAgfSwKICAgICAgICAibWF4SXRlbXMiOiB7ICIkcmVmIjogIiMv +ZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyIiB9LAogICAgICAgICJtaW5JdGVtcyI6IHsgIiRyZWYi +OiAiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJEZWZhdWx0MCIgfSwKICAgICAgICAidW5pcXVl +SXRlbXMiOiB7CiAgICAgICAgICAgICJ0eXBlIjogImJvb2xlYW4iLAogICAgICAgICAgICAiZGVmYXVs +dCI6IGZhbHNlCiAgICAgICAgfSwKICAgICAgICAibWF4UHJvcGVydGllcyI6IHsgIiRyZWYiOiAiIy9k +ZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXIiIH0sCiAgICAgICAgIm1pblByb3BlcnRpZXMiOiB7ICIk +cmVmIjogIiMvZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyRGVmYXVsdDAiIH0sCiAgICAgICAgInJl +cXVpcmVkIjogeyAiJHJlZiI6ICIjL2RlZmluaXRpb25zL3N0cmluZ0FycmF5IiB9LAogICAgICAgICJh +ZGRpdGlvbmFsUHJvcGVydGllcyI6IHsKICAgICAgICAgICAgImFueU9mIjogWwogICAgICAgICAgICAg +ICAgeyAidHlwZSI6ICJib29sZWFuIiB9LAogICAgICAgICAgICAgICAgeyAiJHJlZiI6ICIjIiB9CiAg +ICAgICAgICAgIF0sCiAgICAgICAgICAgICJkZWZhdWx0Ijoge30KICAgICAgICB9LAogICAgICAgICJk +ZWZpbml0aW9ucyI6IHsKICAgICAgICAgICAgInR5cGUiOiAib2JqZWN0IiwKICAgICAgICAgICAgImFk +ZGl0aW9uYWxQcm9wZXJ0aWVzIjogeyAiJHJlZiI6ICIjIiB9LAogICAgICAgICAgICAiZGVmYXVsdCI6 +IHt9CiAgICAgICAgfSwKICAgICAgICAicHJvcGVydGllcyI6IHsKICAgICAgICAgICAgInR5cGUiOiAi +b2JqZWN0IiwKICAgICAgICAgICAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIjogeyAiJHJlZiI6ICIjIiB9 +LAogICAgICAgICAgICAiZGVmYXVsdCI6IHt9CiAgICAgICAgfSwKICAgICAgICAicGF0dGVyblByb3Bl +cnRpZXMiOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm9iamVjdCIsCiAgICAgICAgICAgICJhZGRpdGlv +bmFsUHJvcGVydGllcyI6IHsgIiRyZWYiOiAiIyIgfSwKICAgICAgICAgICAgImRlZmF1bHQiOiB7fQog +ICAgICAgIH0sCiAgICAgICAgImRlcGVuZGVuY2llcyI6IHsKICAgICAgICAgICAgInR5cGUiOiAib2Jq +ZWN0IiwKICAgICAgICAgICAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIjogewogICAgICAgICAgICAgICAg +ImFueU9mIjogWwogICAgICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIyIgfSwKICAgICAgICAgICAg +ICAgICAgICB7ICIkcmVmIjogIiMvZGVmaW5pdGlvbnMvc3RyaW5nQXJyYXkiIH0KICAgICAgICAgICAg +ICAgIF0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgImVudW0iOiB7CiAgICAgICAgICAg +ICJ0eXBlIjogImFycmF5IiwKICAgICAgICAgICAgIm1pbkl0ZW1zIjogMSwKICAgICAgICAgICAgInVu +aXF1ZUl0ZW1zIjogdHJ1ZQogICAgICAgIH0sCiAgICAgICAgInR5cGUiOiB7CiAgICAgICAgICAgICJh +bnlPZiI6IFsKICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIy9kZWZpbml0aW9ucy9zaW1wbGVUeXBl +cyIgfSwKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAidHlwZSI6ICJhcnJheSIs +CiAgICAgICAgICAgICAgICAgICAgIml0ZW1zIjogeyAiJHJlZiI6ICIjL2RlZmluaXRpb25zL3NpbXBs +ZVR5cGVzIiB9LAogICAgICAgICAgICAgICAgICAgICJtaW5JdGVtcyI6IDEsCiAgICAgICAgICAgICAg +ICAgICAgInVuaXF1ZUl0ZW1zIjogdHJ1ZQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICBdCiAg +ICAgICAgfSwKICAgICAgICAiYWxsT2YiOiB7ICIkcmVmIjogIiMvZGVmaW5pdGlvbnMvc2NoZW1hQXJy +YXkiIH0sCiAgICAgICAgImFueU9mIjogeyAiJHJlZiI6ICIjL2RlZmluaXRpb25zL3NjaGVtYUFycmF5 +IiB9LAogICAgICAgICJvbmVPZiI6IHsgIiRyZWYiOiAiIy9kZWZpbml0aW9ucy9zY2hlbWFBcnJheSIg +fSwKICAgICAgICAibm90IjogeyAiJHJlZiI6ICIjIiB9CiAgICB9LAogICAgImRlcGVuZGVuY2llcyI6 +IHsKICAgICAgICAiZXhjbHVzaXZlTWF4aW11bSI6IFsgIm1heGltdW0iIF0sCiAgICAgICAgImV4Y2x1 +c2l2ZU1pbmltdW0iOiBbICJtaW5pbXVtIiBdCiAgICB9LAogICAgImRlZmF1bHQiOiB7fQp9Cg==`)} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/display.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/display.go new file mode 100644 index 000000000000..028a760a91b5 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/display.go @@ -0,0 +1,229 @@ +// Copyright 2017 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package jsonschema + +import ( + "fmt" + "strings" +) + +// +// DISPLAY +// The following methods display Schemas. +// + +// Description returns a string representation of a string or string array. +func (s *StringOrStringArray) Description() string { + if s.String != nil { + return *s.String + } + if s.StringArray != nil { + return strings.Join(*s.StringArray, ", ") + } + return "" +} + +// Returns a string representation of a Schema. +func (schema *Schema) String() string { + return schema.describeSchema("") +} + +// Helper: Returns a string representation of a Schema indented by a specified string. +func (schema *Schema) describeSchema(indent string) string { + result := "" + if schema.Schema != nil { + result += indent + "$schema: " + *(schema.Schema) + "\n" + } + if schema.ID != nil { + result += indent + "id: " + *(schema.ID) + "\n" + } + if schema.MultipleOf != nil { + result += indent + fmt.Sprintf("multipleOf: %+v\n", *(schema.MultipleOf)) + } + if schema.Maximum != nil { + result += indent + fmt.Sprintf("maximum: %+v\n", *(schema.Maximum)) + } + if schema.ExclusiveMaximum != nil { + result += indent + fmt.Sprintf("exclusiveMaximum: %+v\n", *(schema.ExclusiveMaximum)) + } + if schema.Minimum != nil { + result += indent + fmt.Sprintf("minimum: %+v\n", *(schema.Minimum)) + } + if schema.ExclusiveMinimum != nil { + result += indent + fmt.Sprintf("exclusiveMinimum: %+v\n", *(schema.ExclusiveMinimum)) + } + if schema.MaxLength != nil { + result += indent + fmt.Sprintf("maxLength: %+v\n", *(schema.MaxLength)) + } + if schema.MinLength != nil { + result += indent + fmt.Sprintf("minLength: %+v\n", *(schema.MinLength)) + } + if schema.Pattern != nil { + result += indent + fmt.Sprintf("pattern: %+v\n", *(schema.Pattern)) + } + if schema.AdditionalItems != nil { + s := schema.AdditionalItems.Schema + if s != nil { + result += indent + "additionalItems:\n" + result += s.describeSchema(indent + " ") + } else { + b := *(schema.AdditionalItems.Boolean) + result += indent + fmt.Sprintf("additionalItems: %+v\n", b) + } + } + if schema.Items != nil { + result += indent + "items:\n" + items := schema.Items + if items.SchemaArray != nil { + for i, s := range *(items.SchemaArray) { + result += indent + " " + fmt.Sprintf("%d", i) + ":\n" + result += s.describeSchema(indent + " " + " ") + } + } else if items.Schema != nil { + result += items.Schema.describeSchema(indent + " " + " ") + } + } + if schema.MaxItems != nil { + result += indent + fmt.Sprintf("maxItems: %+v\n", *(schema.MaxItems)) + } + if schema.MinItems != nil { + result += indent + fmt.Sprintf("minItems: %+v\n", *(schema.MinItems)) + } + if schema.UniqueItems != nil { + result += indent + fmt.Sprintf("uniqueItems: %+v\n", *(schema.UniqueItems)) + } + if schema.MaxProperties != nil { + result += indent + fmt.Sprintf("maxProperties: %+v\n", *(schema.MaxProperties)) + } + if schema.MinProperties != nil { + result += indent + fmt.Sprintf("minProperties: %+v\n", *(schema.MinProperties)) + } + if schema.Required != nil { + result += indent + fmt.Sprintf("required: %+v\n", *(schema.Required)) + } + if schema.AdditionalProperties != nil { + s := schema.AdditionalProperties.Schema + if s != nil { + result += indent + "additionalProperties:\n" + result += s.describeSchema(indent + " ") + } else { + b := *(schema.AdditionalProperties.Boolean) + result += indent + fmt.Sprintf("additionalProperties: %+v\n", b) + } + } + if schema.Properties != nil { + result += indent + "properties:\n" + for _, pair := range *(schema.Properties) { + name := pair.Name + s := pair.Value + result += indent + " " + name + ":\n" + result += s.describeSchema(indent + " " + " ") + } + } + if schema.PatternProperties != nil { + result += indent + "patternProperties:\n" + for _, pair := range *(schema.PatternProperties) { + name := pair.Name + s := pair.Value + result += indent + " " + name + ":\n" + result += s.describeSchema(indent + " " + " ") + } + } + if schema.Dependencies != nil { + result += indent + "dependencies:\n" + for _, pair := range *(schema.Dependencies) { + name := pair.Name + schemaOrStringArray := pair.Value + s := schemaOrStringArray.Schema + if s != nil { + result += indent + " " + name + ":\n" + result += s.describeSchema(indent + " " + " ") + } else { + a := schemaOrStringArray.StringArray + if a != nil { + result += indent + " " + name + ":\n" + for _, s2 := range *a { + result += indent + " " + " " + s2 + "\n" + } + } + } + + } + } + if schema.Enumeration != nil { + result += indent + "enumeration:\n" + for _, value := range *(schema.Enumeration) { + if value.String != nil { + result += indent + " " + fmt.Sprintf("%+v\n", *value.String) + } else { + result += indent + " " + fmt.Sprintf("%+v\n", *value.Bool) + } + } + } + if schema.Type != nil { + result += indent + fmt.Sprintf("type: %+v\n", schema.Type.Description()) + } + if schema.AllOf != nil { + result += indent + "allOf:\n" + for _, s := range *(schema.AllOf) { + result += s.describeSchema(indent + " ") + result += indent + "-\n" + } + } + if schema.AnyOf != nil { + result += indent + "anyOf:\n" + for _, s := range *(schema.AnyOf) { + result += s.describeSchema(indent + " ") + result += indent + "-\n" + } + } + if schema.OneOf != nil { + result += indent + "oneOf:\n" + for _, s := range *(schema.OneOf) { + result += s.describeSchema(indent + " ") + result += indent + "-\n" + } + } + if schema.Not != nil { + result += indent + "not:\n" + result += schema.Not.describeSchema(indent + " ") + } + if schema.Definitions != nil { + result += indent + "definitions:\n" + for _, pair := range *(schema.Definitions) { + name := pair.Name + s := pair.Value + result += indent + " " + name + ":\n" + result += s.describeSchema(indent + " " + " ") + } + } + if schema.Title != nil { + result += indent + "title: " + *(schema.Title) + "\n" + } + if schema.Description != nil { + result += indent + "description: " + *(schema.Description) + "\n" + } + if schema.Default != nil { + result += indent + "default:\n" + result += indent + fmt.Sprintf(" %+v\n", *(schema.Default)) + } + if schema.Format != nil { + result += indent + "format: " + *(schema.Format) + "\n" + } + if schema.Ref != nil { + result += indent + "$ref: " + *(schema.Ref) + "\n" + } + return result +} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/models.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/models.go new file mode 100644 index 000000000000..4781bdc5f500 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/models.go @@ -0,0 +1,228 @@ +// Copyright 2017 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package jsonschema supports the reading, writing, and manipulation +// of JSON Schemas. +package jsonschema + +import "gopkg.in/yaml.v3" + +// The Schema struct models a JSON Schema and, because schemas are +// defined hierarchically, contains many references to itself. +// All fields are pointers and are nil if the associated values +// are not specified. +type Schema struct { + Schema *string // $schema + ID *string // id keyword used for $ref resolution scope + Ref *string // $ref, i.e. JSON Pointers + + // http://json-schema.org/latest/json-schema-validation.html + // 5.1. Validation keywords for numeric instances (number and integer) + MultipleOf *SchemaNumber + Maximum *SchemaNumber + ExclusiveMaximum *bool + Minimum *SchemaNumber + ExclusiveMinimum *bool + + // 5.2. Validation keywords for strings + MaxLength *int64 + MinLength *int64 + Pattern *string + + // 5.3. Validation keywords for arrays + AdditionalItems *SchemaOrBoolean + Items *SchemaOrSchemaArray + MaxItems *int64 + MinItems *int64 + UniqueItems *bool + + // 5.4. Validation keywords for objects + MaxProperties *int64 + MinProperties *int64 + Required *[]string + AdditionalProperties *SchemaOrBoolean + Properties *[]*NamedSchema + PatternProperties *[]*NamedSchema + Dependencies *[]*NamedSchemaOrStringArray + + // 5.5. Validation keywords for any instance type + Enumeration *[]SchemaEnumValue + Type *StringOrStringArray + AllOf *[]*Schema + AnyOf *[]*Schema + OneOf *[]*Schema + Not *Schema + Definitions *[]*NamedSchema + + // 6. Metadata keywords + Title *string + Description *string + Default *yaml.Node + + // 7. Semantic validation with "format" + Format *string +} + +// These helper structs represent "combination" types that generally can +// have values of one type or another. All are used to represent parts +// of Schemas. + +// SchemaNumber represents a value that can be either an Integer or a Float. +type SchemaNumber struct { + Integer *int64 + Float *float64 +} + +// NewSchemaNumberWithInteger creates and returns a new object +func NewSchemaNumberWithInteger(i int64) *SchemaNumber { + result := &SchemaNumber{} + result.Integer = &i + return result +} + +// NewSchemaNumberWithFloat creates and returns a new object +func NewSchemaNumberWithFloat(f float64) *SchemaNumber { + result := &SchemaNumber{} + result.Float = &f + return result +} + +// SchemaOrBoolean represents a value that can be either a Schema or a Boolean. +type SchemaOrBoolean struct { + Schema *Schema + Boolean *bool +} + +// NewSchemaOrBooleanWithSchema creates and returns a new object +func NewSchemaOrBooleanWithSchema(s *Schema) *SchemaOrBoolean { + result := &SchemaOrBoolean{} + result.Schema = s + return result +} + +// NewSchemaOrBooleanWithBoolean creates and returns a new object +func NewSchemaOrBooleanWithBoolean(b bool) *SchemaOrBoolean { + result := &SchemaOrBoolean{} + result.Boolean = &b + return result +} + +// StringOrStringArray represents a value that can be either +// a String or an Array of Strings. +type StringOrStringArray struct { + String *string + StringArray *[]string +} + +// NewStringOrStringArrayWithString creates and returns a new object +func NewStringOrStringArrayWithString(s string) *StringOrStringArray { + result := &StringOrStringArray{} + result.String = &s + return result +} + +// NewStringOrStringArrayWithStringArray creates and returns a new object +func NewStringOrStringArrayWithStringArray(a []string) *StringOrStringArray { + result := &StringOrStringArray{} + result.StringArray = &a + return result +} + +// SchemaOrStringArray represents a value that can be either +// a Schema or an Array of Strings. +type SchemaOrStringArray struct { + Schema *Schema + StringArray *[]string +} + +// SchemaOrSchemaArray represents a value that can be either +// a Schema or an Array of Schemas. +type SchemaOrSchemaArray struct { + Schema *Schema + SchemaArray *[]*Schema +} + +// NewSchemaOrSchemaArrayWithSchema creates and returns a new object +func NewSchemaOrSchemaArrayWithSchema(s *Schema) *SchemaOrSchemaArray { + result := &SchemaOrSchemaArray{} + result.Schema = s + return result +} + +// NewSchemaOrSchemaArrayWithSchemaArray creates and returns a new object +func NewSchemaOrSchemaArrayWithSchemaArray(a []*Schema) *SchemaOrSchemaArray { + result := &SchemaOrSchemaArray{} + result.SchemaArray = &a + return result +} + +// SchemaEnumValue represents a value that can be part of an +// enumeration in a Schema. +type SchemaEnumValue struct { + String *string + Bool *bool +} + +// NamedSchema is a name-value pair that is used to emulate maps +// with ordered keys. +type NamedSchema struct { + Name string + Value *Schema +} + +// NewNamedSchema creates and returns a new object +func NewNamedSchema(name string, value *Schema) *NamedSchema { + return &NamedSchema{Name: name, Value: value} +} + +// NamedSchemaOrStringArray is a name-value pair that is used +// to emulate maps with ordered keys. +type NamedSchemaOrStringArray struct { + Name string + Value *SchemaOrStringArray +} + +// Access named subschemas by name + +func namedSchemaArrayElementWithName(array *[]*NamedSchema, name string) *Schema { + if array == nil { + return nil + } + for _, pair := range *array { + if pair.Name == name { + return pair.Value + } + } + return nil +} + +// PropertyWithName returns the selected element. +func (s *Schema) PropertyWithName(name string) *Schema { + return namedSchemaArrayElementWithName(s.Properties, name) +} + +// PatternPropertyWithName returns the selected element. +func (s *Schema) PatternPropertyWithName(name string) *Schema { + return namedSchemaArrayElementWithName(s.PatternProperties, name) +} + +// DefinitionWithName returns the selected element. +func (s *Schema) DefinitionWithName(name string) *Schema { + return namedSchemaArrayElementWithName(s.Definitions, name) +} + +// AddProperty adds a named property. +func (s *Schema) AddProperty(name string, property *Schema) { + *s.Properties = append(*s.Properties, NewNamedSchema(name, property)) +} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/operations.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/operations.go new file mode 100644 index 000000000000..ba8dd4a91b9e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/operations.go @@ -0,0 +1,394 @@ +// Copyright 2017 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package jsonschema + +import ( + "fmt" + "log" + "strings" +) + +// +// OPERATIONS +// The following methods perform operations on Schemas. +// + +// IsEmpty returns true if no members of the Schema are specified. +func (schema *Schema) IsEmpty() bool { + return (schema.Schema == nil) && + (schema.ID == nil) && + (schema.MultipleOf == nil) && + (schema.Maximum == nil) && + (schema.ExclusiveMaximum == nil) && + (schema.Minimum == nil) && + (schema.ExclusiveMinimum == nil) && + (schema.MaxLength == nil) && + (schema.MinLength == nil) && + (schema.Pattern == nil) && + (schema.AdditionalItems == nil) && + (schema.Items == nil) && + (schema.MaxItems == nil) && + (schema.MinItems == nil) && + (schema.UniqueItems == nil) && + (schema.MaxProperties == nil) && + (schema.MinProperties == nil) && + (schema.Required == nil) && + (schema.AdditionalProperties == nil) && + (schema.Properties == nil) && + (schema.PatternProperties == nil) && + (schema.Dependencies == nil) && + (schema.Enumeration == nil) && + (schema.Type == nil) && + (schema.AllOf == nil) && + (schema.AnyOf == nil) && + (schema.OneOf == nil) && + (schema.Not == nil) && + (schema.Definitions == nil) && + (schema.Title == nil) && + (schema.Description == nil) && + (schema.Default == nil) && + (schema.Format == nil) && + (schema.Ref == nil) +} + +// IsEqual returns true if two schemas are equal. +func (schema *Schema) IsEqual(schema2 *Schema) bool { + return schema.String() == schema2.String() +} + +// SchemaOperation represents a function that can be applied to a Schema. +type SchemaOperation func(schema *Schema, context string) + +// Applies a specified function to a Schema and all of the Schemas that it contains. +func (schema *Schema) applyToSchemas(operation SchemaOperation, context string) { + + if schema.AdditionalItems != nil { + s := schema.AdditionalItems.Schema + if s != nil { + s.applyToSchemas(operation, "AdditionalItems") + } + } + + if schema.Items != nil { + if schema.Items.SchemaArray != nil { + for _, s := range *(schema.Items.SchemaArray) { + s.applyToSchemas(operation, "Items.SchemaArray") + } + } else if schema.Items.Schema != nil { + schema.Items.Schema.applyToSchemas(operation, "Items.Schema") + } + } + + if schema.AdditionalProperties != nil { + s := schema.AdditionalProperties.Schema + if s != nil { + s.applyToSchemas(operation, "AdditionalProperties") + } + } + + if schema.Properties != nil { + for _, pair := range *(schema.Properties) { + s := pair.Value + s.applyToSchemas(operation, "Properties") + } + } + if schema.PatternProperties != nil { + for _, pair := range *(schema.PatternProperties) { + s := pair.Value + s.applyToSchemas(operation, "PatternProperties") + } + } + + if schema.Dependencies != nil { + for _, pair := range *(schema.Dependencies) { + schemaOrStringArray := pair.Value + s := schemaOrStringArray.Schema + if s != nil { + s.applyToSchemas(operation, "Dependencies") + } + } + } + + if schema.AllOf != nil { + for _, s := range *(schema.AllOf) { + s.applyToSchemas(operation, "AllOf") + } + } + if schema.AnyOf != nil { + for _, s := range *(schema.AnyOf) { + s.applyToSchemas(operation, "AnyOf") + } + } + if schema.OneOf != nil { + for _, s := range *(schema.OneOf) { + s.applyToSchemas(operation, "OneOf") + } + } + if schema.Not != nil { + schema.Not.applyToSchemas(operation, "Not") + } + + if schema.Definitions != nil { + for _, pair := range *(schema.Definitions) { + s := pair.Value + s.applyToSchemas(operation, "Definitions") + } + } + + operation(schema, context) +} + +// CopyProperties copies all non-nil properties from the source Schema to the schema Schema. +func (schema *Schema) CopyProperties(source *Schema) { + if source.Schema != nil { + schema.Schema = source.Schema + } + if source.ID != nil { + schema.ID = source.ID + } + if source.MultipleOf != nil { + schema.MultipleOf = source.MultipleOf + } + if source.Maximum != nil { + schema.Maximum = source.Maximum + } + if source.ExclusiveMaximum != nil { + schema.ExclusiveMaximum = source.ExclusiveMaximum + } + if source.Minimum != nil { + schema.Minimum = source.Minimum + } + if source.ExclusiveMinimum != nil { + schema.ExclusiveMinimum = source.ExclusiveMinimum + } + if source.MaxLength != nil { + schema.MaxLength = source.MaxLength + } + if source.MinLength != nil { + schema.MinLength = source.MinLength + } + if source.Pattern != nil { + schema.Pattern = source.Pattern + } + if source.AdditionalItems != nil { + schema.AdditionalItems = source.AdditionalItems + } + if source.Items != nil { + schema.Items = source.Items + } + if source.MaxItems != nil { + schema.MaxItems = source.MaxItems + } + if source.MinItems != nil { + schema.MinItems = source.MinItems + } + if source.UniqueItems != nil { + schema.UniqueItems = source.UniqueItems + } + if source.MaxProperties != nil { + schema.MaxProperties = source.MaxProperties + } + if source.MinProperties != nil { + schema.MinProperties = source.MinProperties + } + if source.Required != nil { + schema.Required = source.Required + } + if source.AdditionalProperties != nil { + schema.AdditionalProperties = source.AdditionalProperties + } + if source.Properties != nil { + schema.Properties = source.Properties + } + if source.PatternProperties != nil { + schema.PatternProperties = source.PatternProperties + } + if source.Dependencies != nil { + schema.Dependencies = source.Dependencies + } + if source.Enumeration != nil { + schema.Enumeration = source.Enumeration + } + if source.Type != nil { + schema.Type = source.Type + } + if source.AllOf != nil { + schema.AllOf = source.AllOf + } + if source.AnyOf != nil { + schema.AnyOf = source.AnyOf + } + if source.OneOf != nil { + schema.OneOf = source.OneOf + } + if source.Not != nil { + schema.Not = source.Not + } + if source.Definitions != nil { + schema.Definitions = source.Definitions + } + if source.Title != nil { + schema.Title = source.Title + } + if source.Description != nil { + schema.Description = source.Description + } + if source.Default != nil { + schema.Default = source.Default + } + if source.Format != nil { + schema.Format = source.Format + } + if source.Ref != nil { + schema.Ref = source.Ref + } +} + +// TypeIs returns true if the Type of a Schema includes the specified type +func (schema *Schema) TypeIs(typeName string) bool { + if schema.Type != nil { + // the schema Type is either a string or an array of strings + if schema.Type.String != nil { + return (*(schema.Type.String) == typeName) + } else if schema.Type.StringArray != nil { + for _, n := range *(schema.Type.StringArray) { + if n == typeName { + return true + } + } + } + } + return false +} + +// ResolveRefs resolves "$ref" elements in a Schema and its children. +// But if a reference refers to an object type, is inside a oneOf, or contains a oneOf, +// the reference is kept and we expect downstream tools to separately model these +// referenced schemas. +func (schema *Schema) ResolveRefs() { + rootSchema := schema + count := 1 + for count > 0 { + count = 0 + schema.applyToSchemas( + func(schema *Schema, context string) { + if schema.Ref != nil { + resolvedRef, err := rootSchema.resolveJSONPointer(*(schema.Ref)) + if err != nil { + log.Printf("%+v", err) + } else if resolvedRef.TypeIs("object") { + // don't substitute for objects, we'll model the referenced schema with a class + } else if context == "OneOf" { + // don't substitute for references inside oneOf declarations + } else if resolvedRef.OneOf != nil { + // don't substitute for references that contain oneOf declarations + } else if resolvedRef.AdditionalProperties != nil { + // don't substitute for references that look like objects + } else { + schema.Ref = nil + schema.CopyProperties(resolvedRef) + count++ + } + } + }, "") + } +} + +// resolveJSONPointer resolves JSON pointers. +// This current implementation is very crude and custom for OpenAPI 2.0 schemas. +// It panics for any pointer that it is unable to resolve. +func (schema *Schema) resolveJSONPointer(ref string) (result *Schema, err error) { + parts := strings.Split(ref, "#") + if len(parts) == 2 { + documentName := parts[0] + "#" + if documentName == "#" && schema.ID != nil { + documentName = *(schema.ID) + } + path := parts[1] + document := schemas[documentName] + pathParts := strings.Split(path, "/") + + // we currently do a very limited (hard-coded) resolution of certain paths and log errors for missed cases + if len(pathParts) == 1 { + return document, nil + } else if len(pathParts) == 3 { + switch pathParts[1] { + case "definitions": + dictionary := document.Definitions + for _, pair := range *dictionary { + if pair.Name == pathParts[2] { + result = pair.Value + } + } + case "properties": + dictionary := document.Properties + for _, pair := range *dictionary { + if pair.Name == pathParts[2] { + result = pair.Value + } + } + default: + break + } + } + } + if result == nil { + return nil, fmt.Errorf("unresolved pointer: %+v", ref) + } + return result, nil +} + +// ResolveAllOfs replaces "allOf" elements by merging their properties into the parent Schema. +func (schema *Schema) ResolveAllOfs() { + schema.applyToSchemas( + func(schema *Schema, context string) { + if schema.AllOf != nil { + for _, allOf := range *(schema.AllOf) { + schema.CopyProperties(allOf) + } + schema.AllOf = nil + } + }, "resolveAllOfs") +} + +// ResolveAnyOfs replaces all "anyOf" elements with "oneOf". +func (schema *Schema) ResolveAnyOfs() { + schema.applyToSchemas( + func(schema *Schema, context string) { + if schema.AnyOf != nil { + schema.OneOf = schema.AnyOf + schema.AnyOf = nil + } + }, "resolveAnyOfs") +} + +// return a pointer to a copy of a passed-in string +func stringptr(input string) (output *string) { + return &input +} + +// CopyOfficialSchemaProperty copies a named property from the official JSON Schema definition +func (schema *Schema) CopyOfficialSchemaProperty(name string) { + *schema.Properties = append(*schema.Properties, + NewNamedSchema(name, + &Schema{Ref: stringptr("http://json-schema.org/draft-04/schema#/properties/" + name)})) +} + +// CopyOfficialSchemaProperties copies named properties from the official JSON Schema definition +func (schema *Schema) CopyOfficialSchemaProperties(names []string) { + for _, name := range names { + schema.CopyOfficialSchemaProperty(name) + } +} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/reader.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/reader.go new file mode 100644 index 000000000000..b8583d466023 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/reader.go @@ -0,0 +1,442 @@ +// Copyright 2017 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:generate go run generate-base.go + +package jsonschema + +import ( + "fmt" + "io/ioutil" + "strconv" + + "gopkg.in/yaml.v3" +) + +// This is a global map of all known Schemas. +// It is initialized when the first Schema is created and inserted. +var schemas map[string]*Schema + +// NewBaseSchema builds a schema object from an embedded json representation. +func NewBaseSchema() (schema *Schema, err error) { + b, err := baseSchemaBytes() + if err != nil { + return nil, err + } + var node yaml.Node + err = yaml.Unmarshal(b, &node) + if err != nil { + return nil, err + } + return NewSchemaFromObject(&node), nil +} + +// NewSchemaFromFile reads a schema from a file. +// Currently this assumes that schemas are stored in the source distribution of this project. +func NewSchemaFromFile(filename string) (schema *Schema, err error) { + file, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + var node yaml.Node + err = yaml.Unmarshal(file, &node) + if err != nil { + return nil, err + } + return NewSchemaFromObject(&node), nil +} + +// NewSchemaFromObject constructs a schema from a parsed JSON object. +// Due to the complexity of the schema representation, this is a +// custom reader and not the standard Go JSON reader (encoding/json). +func NewSchemaFromObject(jsonData *yaml.Node) *Schema { + switch jsonData.Kind { + case yaml.DocumentNode: + return NewSchemaFromObject(jsonData.Content[0]) + case yaml.MappingNode: + schema := &Schema{} + + for i := 0; i < len(jsonData.Content); i += 2 { + k := jsonData.Content[i].Value + v := jsonData.Content[i+1] + + switch k { + case "$schema": + schema.Schema = schema.stringValue(v) + case "id": + schema.ID = schema.stringValue(v) + + case "multipleOf": + schema.MultipleOf = schema.numberValue(v) + case "maximum": + schema.Maximum = schema.numberValue(v) + case "exclusiveMaximum": + schema.ExclusiveMaximum = schema.boolValue(v) + case "minimum": + schema.Minimum = schema.numberValue(v) + case "exclusiveMinimum": + schema.ExclusiveMinimum = schema.boolValue(v) + + case "maxLength": + schema.MaxLength = schema.intValue(v) + case "minLength": + schema.MinLength = schema.intValue(v) + case "pattern": + schema.Pattern = schema.stringValue(v) + + case "additionalItems": + schema.AdditionalItems = schema.schemaOrBooleanValue(v) + case "items": + schema.Items = schema.schemaOrSchemaArrayValue(v) + case "maxItems": + schema.MaxItems = schema.intValue(v) + case "minItems": + schema.MinItems = schema.intValue(v) + case "uniqueItems": + schema.UniqueItems = schema.boolValue(v) + + case "maxProperties": + schema.MaxProperties = schema.intValue(v) + case "minProperties": + schema.MinProperties = schema.intValue(v) + case "required": + schema.Required = schema.arrayOfStringsValue(v) + case "additionalProperties": + schema.AdditionalProperties = schema.schemaOrBooleanValue(v) + case "properties": + schema.Properties = schema.mapOfSchemasValue(v) + case "patternProperties": + schema.PatternProperties = schema.mapOfSchemasValue(v) + case "dependencies": + schema.Dependencies = schema.mapOfSchemasOrStringArraysValue(v) + + case "enum": + schema.Enumeration = schema.arrayOfEnumValuesValue(v) + + case "type": + schema.Type = schema.stringOrStringArrayValue(v) + case "allOf": + schema.AllOf = schema.arrayOfSchemasValue(v) + case "anyOf": + schema.AnyOf = schema.arrayOfSchemasValue(v) + case "oneOf": + schema.OneOf = schema.arrayOfSchemasValue(v) + case "not": + schema.Not = NewSchemaFromObject(v) + case "definitions": + schema.Definitions = schema.mapOfSchemasValue(v) + + case "title": + schema.Title = schema.stringValue(v) + case "description": + schema.Description = schema.stringValue(v) + + case "default": + schema.Default = v + + case "format": + schema.Format = schema.stringValue(v) + case "$ref": + schema.Ref = schema.stringValue(v) + default: + fmt.Printf("UNSUPPORTED (%s)\n", k) + } + } + + // insert schema in global map + if schema.ID != nil { + if schemas == nil { + schemas = make(map[string]*Schema, 0) + } + schemas[*(schema.ID)] = schema + } + return schema + + default: + fmt.Printf("schemaValue: unexpected node %+v\n", jsonData) + return nil + } + + return nil +} + +// +// BUILDERS +// The following methods build elements of Schemas from interface{} values. +// Each returns nil if it is unable to build the desired element. +// + +// Gets the string value of an interface{} value if possible. +func (schema *Schema) stringValue(v *yaml.Node) *string { + switch v.Kind { + case yaml.ScalarNode: + return &v.Value + default: + fmt.Printf("stringValue: unexpected node %+v\n", v) + } + return nil +} + +// Gets the numeric value of an interface{} value if possible. +func (schema *Schema) numberValue(v *yaml.Node) *SchemaNumber { + number := &SchemaNumber{} + switch v.Kind { + case yaml.ScalarNode: + switch v.Tag { + case "!!float": + v2, _ := strconv.ParseFloat(v.Value, 64) + number.Float = &v2 + return number + case "!!int": + v2, _ := strconv.ParseInt(v.Value, 10, 64) + number.Integer = &v2 + return number + default: + fmt.Printf("stringValue: unexpected node %+v\n", v) + } + default: + fmt.Printf("stringValue: unexpected node %+v\n", v) + } + return nil +} + +// Gets the integer value of an interface{} value if possible. +func (schema *Schema) intValue(v *yaml.Node) *int64 { + switch v.Kind { + case yaml.ScalarNode: + switch v.Tag { + case "!!float": + v2, _ := strconv.ParseFloat(v.Value, 64) + v3 := int64(v2) + return &v3 + case "!!int": + v2, _ := strconv.ParseInt(v.Value, 10, 64) + return &v2 + default: + fmt.Printf("intValue: unexpected node %+v\n", v) + } + default: + fmt.Printf("intValue: unexpected node %+v\n", v) + } + return nil +} + +// Gets the bool value of an interface{} value if possible. +func (schema *Schema) boolValue(v *yaml.Node) *bool { + switch v.Kind { + case yaml.ScalarNode: + switch v.Tag { + case "!!bool": + v2, _ := strconv.ParseBool(v.Value) + return &v2 + default: + fmt.Printf("boolValue: unexpected node %+v\n", v) + } + default: + fmt.Printf("boolValue: unexpected node %+v\n", v) + } + return nil +} + +// Gets a map of Schemas from an interface{} value if possible. +func (schema *Schema) mapOfSchemasValue(v *yaml.Node) *[]*NamedSchema { + switch v.Kind { + case yaml.MappingNode: + m := make([]*NamedSchema, 0) + for i := 0; i < len(v.Content); i += 2 { + k2 := v.Content[i].Value + v2 := v.Content[i+1] + pair := &NamedSchema{Name: k2, Value: NewSchemaFromObject(v2)} + m = append(m, pair) + } + return &m + default: + fmt.Printf("mapOfSchemasValue: unexpected node %+v\n", v) + } + return nil +} + +// Gets an array of Schemas from an interface{} value if possible. +func (schema *Schema) arrayOfSchemasValue(v *yaml.Node) *[]*Schema { + switch v.Kind { + case yaml.SequenceNode: + m := make([]*Schema, 0) + for _, v2 := range v.Content { + switch v2.Kind { + case yaml.MappingNode: + s := NewSchemaFromObject(v2) + m = append(m, s) + default: + fmt.Printf("arrayOfSchemasValue: unexpected node %+v\n", v2) + } + } + return &m + case yaml.MappingNode: + m := make([]*Schema, 0) + s := NewSchemaFromObject(v) + m = append(m, s) + return &m + default: + fmt.Printf("arrayOfSchemasValue: unexpected node %+v\n", v) + } + return nil +} + +// Gets a Schema or an array of Schemas from an interface{} value if possible. +func (schema *Schema) schemaOrSchemaArrayValue(v *yaml.Node) *SchemaOrSchemaArray { + switch v.Kind { + case yaml.SequenceNode: + m := make([]*Schema, 0) + for _, v2 := range v.Content { + switch v2.Kind { + case yaml.MappingNode: + s := NewSchemaFromObject(v2) + m = append(m, s) + default: + fmt.Printf("schemaOrSchemaArrayValue: unexpected node %+v\n", v2) + } + } + return &SchemaOrSchemaArray{SchemaArray: &m} + case yaml.MappingNode: + s := NewSchemaFromObject(v) + return &SchemaOrSchemaArray{Schema: s} + default: + fmt.Printf("schemaOrSchemaArrayValue: unexpected node %+v\n", v) + } + return nil +} + +// Gets an array of strings from an interface{} value if possible. +func (schema *Schema) arrayOfStringsValue(v *yaml.Node) *[]string { + switch v.Kind { + case yaml.ScalarNode: + a := []string{v.Value} + return &a + case yaml.SequenceNode: + a := make([]string, 0) + for _, v2 := range v.Content { + switch v2.Kind { + case yaml.ScalarNode: + a = append(a, v2.Value) + default: + fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v2) + } + } + return &a + default: + fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v) + } + return nil +} + +// Gets a string or an array of strings from an interface{} value if possible. +func (schema *Schema) stringOrStringArrayValue(v *yaml.Node) *StringOrStringArray { + switch v.Kind { + case yaml.ScalarNode: + s := &StringOrStringArray{} + s.String = &v.Value + return s + case yaml.SequenceNode: + a := make([]string, 0) + for _, v2 := range v.Content { + switch v2.Kind { + case yaml.ScalarNode: + a = append(a, v2.Value) + default: + fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v2) + } + } + s := &StringOrStringArray{} + s.StringArray = &a + return s + default: + fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v) + } + return nil +} + +// Gets an array of enum values from an interface{} value if possible. +func (schema *Schema) arrayOfEnumValuesValue(v *yaml.Node) *[]SchemaEnumValue { + a := make([]SchemaEnumValue, 0) + switch v.Kind { + case yaml.SequenceNode: + for _, v2 := range v.Content { + switch v2.Kind { + case yaml.ScalarNode: + switch v2.Tag { + case "!!str": + a = append(a, SchemaEnumValue{String: &v2.Value}) + case "!!bool": + v3, _ := strconv.ParseBool(v2.Value) + a = append(a, SchemaEnumValue{Bool: &v3}) + default: + fmt.Printf("arrayOfEnumValuesValue: unexpected type %s\n", v2.Tag) + } + default: + fmt.Printf("arrayOfEnumValuesValue: unexpected node %+v\n", v2) + } + } + default: + fmt.Printf("arrayOfEnumValuesValue: unexpected node %+v\n", v) + } + return &a +} + +// Gets a map of schemas or string arrays from an interface{} value if possible. +func (schema *Schema) mapOfSchemasOrStringArraysValue(v *yaml.Node) *[]*NamedSchemaOrStringArray { + m := make([]*NamedSchemaOrStringArray, 0) + switch v.Kind { + case yaml.MappingNode: + for i := 0; i < len(v.Content); i += 2 { + k2 := v.Content[i].Value + v2 := v.Content[i+1] + switch v2.Kind { + case yaml.SequenceNode: + a := make([]string, 0) + for _, v3 := range v2.Content { + switch v3.Kind { + case yaml.ScalarNode: + a = append(a, v3.Value) + default: + fmt.Printf("mapOfSchemasOrStringArraysValue: unexpected node %+v\n", v3) + } + } + s := &SchemaOrStringArray{} + s.StringArray = &a + pair := &NamedSchemaOrStringArray{Name: k2, Value: s} + m = append(m, pair) + default: + fmt.Printf("mapOfSchemasOrStringArraysValue: unexpected node %+v\n", v2) + } + } + default: + fmt.Printf("mapOfSchemasOrStringArraysValue: unexpected node %+v\n", v) + } + return &m +} + +// Gets a schema or a boolean value from an interface{} value if possible. +func (schema *Schema) schemaOrBooleanValue(v *yaml.Node) *SchemaOrBoolean { + schemaOrBoolean := &SchemaOrBoolean{} + switch v.Kind { + case yaml.ScalarNode: + v2, _ := strconv.ParseBool(v.Value) + schemaOrBoolean.Boolean = &v2 + case yaml.MappingNode: + schemaOrBoolean.Schema = NewSchemaFromObject(v) + default: + fmt.Printf("schemaOrBooleanValue: unexpected node %+v\n", v) + } + return schemaOrBoolean +} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/schema.json b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/schema.json new file mode 100644 index 000000000000..85eb502a680e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/schema.json @@ -0,0 +1,150 @@ +{ + "id": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "positiveInteger": { + "type": "integer", + "minimum": 0 + }, + "positiveIntegerDefault0": { + "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] + }, + "simpleTypes": { + "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "minItems": 1, + "uniqueItems": true + } + }, + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uri" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "multipleOf": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { "$ref": "#/definitions/positiveInteger" }, + "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": {} + }, + "maxItems": { "$ref": "#/definitions/positiveInteger" }, + "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { "$ref": "#/definitions/positiveInteger" }, + "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "dependencies": { + "exclusiveMaximum": [ "maximum" ], + "exclusiveMinimum": [ "minimum" ] + }, + "default": {} +} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/writer.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/writer.go new file mode 100644 index 000000000000..340dc5f93306 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/jsonschema/writer.go @@ -0,0 +1,369 @@ +// Copyright 2017 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package jsonschema + +import ( + "fmt" + + "gopkg.in/yaml.v3" +) + +const indentation = " " + +func renderMappingNode(node *yaml.Node, indent string) (result string) { + result = "{\n" + innerIndent := indent + indentation + for i := 0; i < len(node.Content); i += 2 { + // first print the key + key := node.Content[i].Value + result += fmt.Sprintf("%s\"%+v\": ", innerIndent, key) + // then the value + value := node.Content[i+1] + switch value.Kind { + case yaml.ScalarNode: + result += "\"" + value.Value + "\"" + case yaml.MappingNode: + result += renderMappingNode(value, innerIndent) + case yaml.SequenceNode: + result += renderSequenceNode(value, innerIndent) + default: + result += fmt.Sprintf("???MapItem(Key:%+v, Value:%T)", value, value) + } + if i < len(node.Content)-2 { + result += "," + } + result += "\n" + } + + result += indent + "}" + return result +} + +func renderSequenceNode(node *yaml.Node, indent string) (result string) { + result = "[\n" + innerIndent := indent + indentation + for i := 0; i < len(node.Content); i++ { + item := node.Content[i] + switch item.Kind { + case yaml.ScalarNode: + result += innerIndent + "\"" + item.Value + "\"" + case yaml.MappingNode: + result += innerIndent + renderMappingNode(item, innerIndent) + "" + default: + result += innerIndent + fmt.Sprintf("???ArrayItem(%+v)", item) + } + if i < len(node.Content)-1 { + result += "," + } + result += "\n" + } + result += indent + "]" + return result +} + +func renderStringArray(array []string, indent string) (result string) { + result = "[\n" + innerIndent := indent + indentation + for i, item := range array { + result += innerIndent + "\"" + item + "\"" + if i < len(array)-1 { + result += "," + } + result += "\n" + } + result += indent + "]" + return result +} + +// Render renders a yaml.Node as JSON +func Render(node *yaml.Node) string { + if node.Kind == yaml.DocumentNode { + if len(node.Content) == 1 { + return Render(node.Content[0]) + } + } else if node.Kind == yaml.MappingNode { + return renderMappingNode(node, "") + "\n" + } else if node.Kind == yaml.SequenceNode { + return renderSequenceNode(node, "") + "\n" + } + return "" +} + +func (object *SchemaNumber) nodeValue() *yaml.Node { + if object.Integer != nil { + return nodeForInt64(*object.Integer) + } else if object.Float != nil { + return nodeForFloat64(*object.Float) + } else { + return nil + } +} + +func (object *SchemaOrBoolean) nodeValue() *yaml.Node { + if object.Schema != nil { + return object.Schema.nodeValue() + } else if object.Boolean != nil { + return nodeForBoolean(*object.Boolean) + } else { + return nil + } +} + +func nodeForStringArray(array []string) *yaml.Node { + content := make([]*yaml.Node, 0) + for _, item := range array { + content = append(content, nodeForString(item)) + } + return nodeForSequence(content) +} + +func nodeForSchemaArray(array []*Schema) *yaml.Node { + content := make([]*yaml.Node, 0) + for _, item := range array { + content = append(content, item.nodeValue()) + } + return nodeForSequence(content) +} + +func (object *StringOrStringArray) nodeValue() *yaml.Node { + if object.String != nil { + return nodeForString(*object.String) + } else if object.StringArray != nil { + return nodeForStringArray(*(object.StringArray)) + } else { + return nil + } +} + +func (object *SchemaOrStringArray) nodeValue() *yaml.Node { + if object.Schema != nil { + return object.Schema.nodeValue() + } else if object.StringArray != nil { + return nodeForStringArray(*(object.StringArray)) + } else { + return nil + } +} + +func (object *SchemaOrSchemaArray) nodeValue() *yaml.Node { + if object.Schema != nil { + return object.Schema.nodeValue() + } else if object.SchemaArray != nil { + return nodeForSchemaArray(*(object.SchemaArray)) + } else { + return nil + } +} + +func (object *SchemaEnumValue) nodeValue() *yaml.Node { + if object.String != nil { + return nodeForString(*object.String) + } else if object.Bool != nil { + return nodeForBoolean(*object.Bool) + } else { + return nil + } +} + +func nodeForNamedSchemaArray(array *[]*NamedSchema) *yaml.Node { + content := make([]*yaml.Node, 0) + for _, pair := range *(array) { + content = appendPair(content, pair.Name, pair.Value.nodeValue()) + } + return nodeForMapping(content) +} + +func nodeForNamedSchemaOrStringArray(array *[]*NamedSchemaOrStringArray) *yaml.Node { + content := make([]*yaml.Node, 0) + for _, pair := range *(array) { + content = appendPair(content, pair.Name, pair.Value.nodeValue()) + } + return nodeForMapping(content) +} + +func nodeForSchemaEnumArray(array *[]SchemaEnumValue) *yaml.Node { + content := make([]*yaml.Node, 0) + for _, item := range *array { + content = append(content, item.nodeValue()) + } + return nodeForSequence(content) +} + +func nodeForMapping(content []*yaml.Node) *yaml.Node { + return &yaml.Node{ + Kind: yaml.MappingNode, + Content: content, + } +} + +func nodeForSequence(content []*yaml.Node) *yaml.Node { + return &yaml.Node{ + Kind: yaml.SequenceNode, + Content: content, + } +} + +func nodeForString(value string) *yaml.Node { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: "!!str", + Value: value, + } +} + +func nodeForBoolean(value bool) *yaml.Node { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: "!!bool", + Value: fmt.Sprintf("%t", value), + } +} + +func nodeForInt64(value int64) *yaml.Node { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: "!!int", + Value: fmt.Sprintf("%d", value), + } +} + +func nodeForFloat64(value float64) *yaml.Node { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: "!!float", + Value: fmt.Sprintf("%f", value), + } +} + +func appendPair(nodes []*yaml.Node, name string, value *yaml.Node) []*yaml.Node { + nodes = append(nodes, nodeForString(name)) + nodes = append(nodes, value) + return nodes +} + +func (schema *Schema) nodeValue() *yaml.Node { + n := &yaml.Node{Kind: yaml.MappingNode} + content := make([]*yaml.Node, 0) + if schema.Title != nil { + content = appendPair(content, "title", nodeForString(*schema.Title)) + } + if schema.ID != nil { + content = appendPair(content, "id", nodeForString(*schema.ID)) + } + if schema.Schema != nil { + content = appendPair(content, "$schema", nodeForString(*schema.Schema)) + } + if schema.Type != nil { + content = appendPair(content, "type", schema.Type.nodeValue()) + } + if schema.Items != nil { + content = appendPair(content, "items", schema.Items.nodeValue()) + } + if schema.Description != nil { + content = appendPair(content, "description", nodeForString(*schema.Description)) + } + if schema.Required != nil { + content = appendPair(content, "required", nodeForStringArray(*schema.Required)) + } + if schema.AdditionalProperties != nil { + content = appendPair(content, "additionalProperties", schema.AdditionalProperties.nodeValue()) + } + if schema.PatternProperties != nil { + content = appendPair(content, "patternProperties", nodeForNamedSchemaArray(schema.PatternProperties)) + } + if schema.Properties != nil { + content = appendPair(content, "properties", nodeForNamedSchemaArray(schema.Properties)) + } + if schema.Dependencies != nil { + content = appendPair(content, "dependencies", nodeForNamedSchemaOrStringArray(schema.Dependencies)) + } + if schema.Ref != nil { + content = appendPair(content, "$ref", nodeForString(*schema.Ref)) + } + if schema.MultipleOf != nil { + content = appendPair(content, "multipleOf", schema.MultipleOf.nodeValue()) + } + if schema.Maximum != nil { + content = appendPair(content, "maximum", schema.Maximum.nodeValue()) + } + if schema.ExclusiveMaximum != nil { + content = appendPair(content, "exclusiveMaximum", nodeForBoolean(*schema.ExclusiveMaximum)) + } + if schema.Minimum != nil { + content = appendPair(content, "minimum", schema.Minimum.nodeValue()) + } + if schema.ExclusiveMinimum != nil { + content = appendPair(content, "exclusiveMinimum", nodeForBoolean(*schema.ExclusiveMinimum)) + } + if schema.MaxLength != nil { + content = appendPair(content, "maxLength", nodeForInt64(*schema.MaxLength)) + } + if schema.MinLength != nil { + content = appendPair(content, "minLength", nodeForInt64(*schema.MinLength)) + } + if schema.Pattern != nil { + content = appendPair(content, "pattern", nodeForString(*schema.Pattern)) + } + if schema.AdditionalItems != nil { + content = appendPair(content, "additionalItems", schema.AdditionalItems.nodeValue()) + } + if schema.MaxItems != nil { + content = appendPair(content, "maxItems", nodeForInt64(*schema.MaxItems)) + } + if schema.MinItems != nil { + content = appendPair(content, "minItems", nodeForInt64(*schema.MinItems)) + } + if schema.UniqueItems != nil { + content = appendPair(content, "uniqueItems", nodeForBoolean(*schema.UniqueItems)) + } + if schema.MaxProperties != nil { + content = appendPair(content, "maxProperties", nodeForInt64(*schema.MaxProperties)) + } + if schema.MinProperties != nil { + content = appendPair(content, "minProperties", nodeForInt64(*schema.MinProperties)) + } + if schema.Enumeration != nil { + content = appendPair(content, "enum", nodeForSchemaEnumArray(schema.Enumeration)) + } + if schema.AllOf != nil { + content = appendPair(content, "allOf", nodeForSchemaArray(*schema.AllOf)) + } + if schema.AnyOf != nil { + content = appendPair(content, "anyOf", nodeForSchemaArray(*schema.AnyOf)) + } + if schema.OneOf != nil { + content = appendPair(content, "oneOf", nodeForSchemaArray(*schema.OneOf)) + } + if schema.Not != nil { + content = appendPair(content, "not", schema.Not.nodeValue()) + } + if schema.Definitions != nil { + content = appendPair(content, "definitions", nodeForNamedSchemaArray(schema.Definitions)) + } + if schema.Default != nil { + // m = append(m, yaml.MapItem{Key: "default", Value: *schema.Default}) + } + if schema.Format != nil { + content = appendPair(content, "format", nodeForString(*schema.Format)) + } + n.Content = content + return n +} + +// JSONString returns a json representation of a schema. +func (schema *Schema) JSONString() string { + node := schema.nodeValue() + return Render(node) +} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.go index 4fd44c45e228..af6c0eee0797 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.go @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ package openapi_v2 import ( "fmt" "github.com/googleapis/gnostic/compiler" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" "regexp" "strings" ) @@ -30,7 +30,7 @@ func Version() string { } // NewAdditionalPropertiesItem creates an object of type AdditionalPropertiesItem if possible, returning an error if not. -func NewAdditionalPropertiesItem(in interface{}, context *compiler.Context) (*AdditionalPropertiesItem, error) { +func NewAdditionalPropertiesItem(in *yaml.Node, context *compiler.Context) (*AdditionalPropertiesItem, error) { errors := make([]error, 0) x := &AdditionalPropertiesItem{} matched := false @@ -49,9 +49,10 @@ func NewAdditionalPropertiesItem(in interface{}, context *compiler.Context) (*Ad } } // bool boolean = 2; - boolValue, ok := in.(bool) + boolValue, ok := compiler.BoolForScalarNode(in) if ok { x.Oneof = &AdditionalPropertiesItem_Boolean{Boolean: boolValue} + matched = true } if matched { // since the oneof matched one of its possibilities, discard any matching errors @@ -61,16 +62,16 @@ func NewAdditionalPropertiesItem(in interface{}, context *compiler.Context) (*Ad } // NewAny creates an object of type Any if possible, returning an error if not. -func NewAny(in interface{}, context *compiler.Context) (*Any, error) { +func NewAny(in *yaml.Node, context *compiler.Context) (*Any, error) { errors := make([]error, 0) x := &Any{} - bytes, _ := yaml.Marshal(in) + bytes := compiler.Marshal(in) x.Yaml = string(bytes) return x, compiler.NewErrorGroupOrNil(errors) } // NewApiKeySecurity creates an object of type ApiKeySecurity if possible, returning an error if not. -func NewApiKeySecurity(in interface{}, context *compiler.Context) (*ApiKeySecurity, error) { +func NewApiKeySecurity(in *yaml.Node, context *compiler.Context) (*ApiKeySecurity, error) { errors := make([]error, 0) x := &ApiKeySecurity{} m, ok := compiler.UnpackMap(in) @@ -94,68 +95,68 @@ func NewApiKeySecurity(in interface{}, context *compiler.Context) (*ApiKeySecuri // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { - x.Type, ok = v1.(string) + x.Type, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [apiKey] if ok && !compiler.StringArrayContainsValue([]string{"apiKey"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 2; v2 := compiler.MapValueForKey(m, "name") if v2 != nil { - x.Name, ok = v2.(string) + x.Name, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 3; v3 := compiler.MapValueForKey(m, "in") if v3 != nil { - x.In, ok = v3.(string) + x.In, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [header query] if ok && !compiler.StringArrayContainsValue([]string{"header", "query"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 4; v4 := compiler.MapValueForKey(m, "description") if v4 != nil { - x.Description, ok = v4.(string) + x.Description, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 5; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -175,7 +176,7 @@ func NewApiKeySecurity(in interface{}, context *compiler.Context) (*ApiKeySecuri } // NewBasicAuthenticationSecurity creates an object of type BasicAuthenticationSecurity if possible, returning an error if not. -func NewBasicAuthenticationSecurity(in interface{}, context *compiler.Context) (*BasicAuthenticationSecurity, error) { +func NewBasicAuthenticationSecurity(in *yaml.Node, context *compiler.Context) (*BasicAuthenticationSecurity, error) { errors := make([]error, 0) x := &BasicAuthenticationSecurity{} m, ok := compiler.UnpackMap(in) @@ -199,44 +200,44 @@ func NewBasicAuthenticationSecurity(in interface{}, context *compiler.Context) ( // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { - x.Type, ok = v1.(string) + x.Type, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [basic] if ok && !compiler.StringArrayContainsValue([]string{"basic"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 2; v2 := compiler.MapValueForKey(m, "description") if v2 != nil { - x.Description, ok = v2.(string) + x.Description, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 3; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -256,7 +257,7 @@ func NewBasicAuthenticationSecurity(in interface{}, context *compiler.Context) ( } // NewBodyParameter creates an object of type BodyParameter if possible, returning an error if not. -func NewBodyParameter(in interface{}, context *compiler.Context) (*BodyParameter, error) { +func NewBodyParameter(in *yaml.Node, context *compiler.Context) (*BodyParameter, error) { errors := make([]error, 0) x := &BodyParameter{} m, ok := compiler.UnpackMap(in) @@ -280,42 +281,42 @@ func NewBodyParameter(in interface{}, context *compiler.Context) (*BodyParameter // string description = 1; v1 := compiler.MapValueForKey(m, "description") if v1 != nil { - x.Description, ok = v1.(string) + x.Description, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 2; v2 := compiler.MapValueForKey(m, "name") if v2 != nil { - x.Name, ok = v2.(string) + x.Name, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 3; v3 := compiler.MapValueForKey(m, "in") if v3 != nil { - x.In, ok = v3.(string) + x.In, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [body] if ok && !compiler.StringArrayContainsValue([]string{"body"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // bool required = 4; v4 := compiler.MapValueForKey(m, "required") if v4 != nil { - x.Required, ok = v4.(bool) + x.Required, ok = compiler.BoolForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } @@ -331,20 +332,20 @@ func NewBodyParameter(in interface{}, context *compiler.Context) (*BodyParameter // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -364,7 +365,7 @@ func NewBodyParameter(in interface{}, context *compiler.Context) (*BodyParameter } // NewContact creates an object of type Contact if possible, returning an error if not. -func NewContact(in interface{}, context *compiler.Context) (*Contact, error) { +func NewContact(in *yaml.Node, context *compiler.Context) (*Contact, error) { errors := make([]error, 0) x := &Contact{} m, ok := compiler.UnpackMap(in) @@ -382,47 +383,47 @@ func NewContact(in interface{}, context *compiler.Context) (*Contact, error) { // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string url = 2; v2 := compiler.MapValueForKey(m, "url") if v2 != nil { - x.Url, ok = v2.(string) + x.Url, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for url: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string email = 3; v3 := compiler.MapValueForKey(m, "email") if v3 != nil { - x.Email, ok = v3.(string) + x.Email, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for email: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for email: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 4; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -442,7 +443,7 @@ func NewContact(in interface{}, context *compiler.Context) (*Contact, error) { } // NewDefault creates an object of type Default if possible, returning an error if not. -func NewDefault(in interface{}, context *compiler.Context) (*Default, error) { +func NewDefault(in *yaml.Node, context *compiler.Context) (*Default, error) { errors := make([]error, 0) x := &Default{} m, ok := compiler.UnpackMap(in) @@ -453,19 +454,19 @@ func NewDefault(in interface{}, context *compiler.Context) (*Default, error) { // repeated NamedAny additional_properties = 1; // MAP: Any x.AdditionalProperties = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -484,7 +485,7 @@ func NewDefault(in interface{}, context *compiler.Context) (*Default, error) { } // NewDefinitions creates an object of type Definitions if possible, returning an error if not. -func NewDefinitions(in interface{}, context *compiler.Context) (*Definitions, error) { +func NewDefinitions(in *yaml.Node, context *compiler.Context) (*Definitions, error) { errors := make([]error, 0) x := &Definitions{} m, ok := compiler.UnpackMap(in) @@ -495,10 +496,10 @@ func NewDefinitions(in interface{}, context *compiler.Context) (*Definitions, er // repeated NamedSchema additional_properties = 1; // MAP: Schema x.AdditionalProperties = make([]*NamedSchema, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedSchema{} pair.Name = k var err error @@ -514,7 +515,7 @@ func NewDefinitions(in interface{}, context *compiler.Context) (*Definitions, er } // NewDocument creates an object of type Document if possible, returning an error if not. -func NewDocument(in interface{}, context *compiler.Context) (*Document, error) { +func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { errors := make([]error, 0) x := &Document{} m, ok := compiler.UnpackMap(in) @@ -538,15 +539,15 @@ func NewDocument(in interface{}, context *compiler.Context) (*Document, error) { // string swagger = 1; v1 := compiler.MapValueForKey(m, "swagger") if v1 != nil { - x.Swagger, ok = v1.(string) + x.Swagger, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for swagger: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for swagger: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [2.0] if ok && !compiler.StringArrayContainsValue([]string{"2.0"}, x.Swagger) { - message := fmt.Sprintf("has unexpected value for swagger: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for swagger: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -562,57 +563,57 @@ func NewDocument(in interface{}, context *compiler.Context) (*Document, error) { // string host = 3; v3 := compiler.MapValueForKey(m, "host") if v3 != nil { - x.Host, ok = v3.(string) + x.Host, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for host: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for host: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string base_path = 4; v4 := compiler.MapValueForKey(m, "basePath") if v4 != nil { - x.BasePath, ok = v4.(string) + x.BasePath, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for basePath: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for basePath: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string schemes = 5; v5 := compiler.MapValueForKey(m, "schemes") if v5 != nil { - v, ok := v5.([]interface{}) + v, ok := compiler.SequenceNodeForNode(v5) if ok { - x.Schemes = compiler.ConvertInterfaceArrayToStringArray(v) + x.Schemes = compiler.StringArrayForSequenceNode(v) } else { - message := fmt.Sprintf("has unexpected value for schemes: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [http https ws wss] if ok && !compiler.StringArrayContainsValues([]string{"http", "https", "ws", "wss"}, x.Schemes) { - message := fmt.Sprintf("has unexpected value for schemes: %+v", v5) + message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string consumes = 6; v6 := compiler.MapValueForKey(m, "consumes") if v6 != nil { - v, ok := v6.([]interface{}) + v, ok := compiler.SequenceNodeForNode(v6) if ok { - x.Consumes = compiler.ConvertInterfaceArrayToStringArray(v) + x.Consumes = compiler.StringArrayForSequenceNode(v) } else { - message := fmt.Sprintf("has unexpected value for consumes: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for consumes: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string produces = 7; v7 := compiler.MapValueForKey(m, "produces") if v7 != nil { - v, ok := v7.([]interface{}) + v, ok := compiler.SequenceNodeForNode(v7) if ok { - x.Produces = compiler.ConvertInterfaceArrayToStringArray(v) + x.Produces = compiler.StringArrayForSequenceNode(v) } else { - message := fmt.Sprintf("has unexpected value for produces: %+v (%T)", v7, v7) + message := fmt.Sprintf("has unexpected value for produces: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } @@ -657,9 +658,9 @@ func NewDocument(in interface{}, context *compiler.Context) (*Document, error) { if v12 != nil { // repeated SecurityRequirement x.Security = make([]*SecurityRequirement, 0) - a, ok := v12.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v12) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewSecurityRequirement(item, compiler.NewContext("security", context)) if err != nil { errors = append(errors, err) @@ -682,9 +683,9 @@ func NewDocument(in interface{}, context *compiler.Context) (*Document, error) { if v14 != nil { // repeated Tag x.Tags = make([]*Tag, 0) - a, ok := v14.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v14) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewTag(item, compiler.NewContext("tags", context)) if err != nil { errors = append(errors, err) @@ -705,20 +706,20 @@ func NewDocument(in interface{}, context *compiler.Context) (*Document, error) { // repeated NamedAny vendor_extension = 16; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -738,7 +739,7 @@ func NewDocument(in interface{}, context *compiler.Context) (*Document, error) { } // NewExamples creates an object of type Examples if possible, returning an error if not. -func NewExamples(in interface{}, context *compiler.Context) (*Examples, error) { +func NewExamples(in *yaml.Node, context *compiler.Context) (*Examples, error) { errors := make([]error, 0) x := &Examples{} m, ok := compiler.UnpackMap(in) @@ -749,19 +750,19 @@ func NewExamples(in interface{}, context *compiler.Context) (*Examples, error) { // repeated NamedAny additional_properties = 1; // MAP: Any x.AdditionalProperties = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -780,7 +781,7 @@ func NewExamples(in interface{}, context *compiler.Context) (*Examples, error) { } // NewExternalDocs creates an object of type ExternalDocs if possible, returning an error if not. -func NewExternalDocs(in interface{}, context *compiler.Context) (*ExternalDocs, error) { +func NewExternalDocs(in *yaml.Node, context *compiler.Context) (*ExternalDocs, error) { errors := make([]error, 0) x := &ExternalDocs{} m, ok := compiler.UnpackMap(in) @@ -804,38 +805,38 @@ func NewExternalDocs(in interface{}, context *compiler.Context) (*ExternalDocs, // string description = 1; v1 := compiler.MapValueForKey(m, "description") if v1 != nil { - x.Description, ok = v1.(string) + x.Description, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string url = 2; v2 := compiler.MapValueForKey(m, "url") if v2 != nil { - x.Url, ok = v2.(string) + x.Url, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for url: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 3; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -855,7 +856,7 @@ func NewExternalDocs(in interface{}, context *compiler.Context) (*ExternalDocs, } // NewFileSchema creates an object of type FileSchema if possible, returning an error if not. -func NewFileSchema(in interface{}, context *compiler.Context) (*FileSchema, error) { +func NewFileSchema(in *yaml.Node, context *compiler.Context) (*FileSchema, error) { errors := make([]error, 0) x := &FileSchema{} m, ok := compiler.UnpackMap(in) @@ -879,27 +880,27 @@ func NewFileSchema(in interface{}, context *compiler.Context) (*FileSchema, erro // string format = 1; v1 := compiler.MapValueForKey(m, "format") if v1 != nil { - x.Format, ok = v1.(string) + x.Format, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string title = 2; v2 := compiler.MapValueForKey(m, "title") if v2 != nil { - x.Title, ok = v2.(string) + x.Title, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for title: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { - x.Description, ok = v3.(string) + x.Description, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } @@ -915,35 +916,35 @@ func NewFileSchema(in interface{}, context *compiler.Context) (*FileSchema, erro // repeated string required = 5; v5 := compiler.MapValueForKey(m, "required") if v5 != nil { - v, ok := v5.([]interface{}) + v, ok := compiler.SequenceNodeForNode(v5) if ok { - x.Required = compiler.ConvertInterfaceArrayToStringArray(v) + x.Required = compiler.StringArrayForSequenceNode(v) } else { - message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 6; v6 := compiler.MapValueForKey(m, "type") if v6 != nil { - x.Type, ok = v6.(string) + x.Type, ok = compiler.StringForScalarNode(v6) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [file] if ok && !compiler.StringArrayContainsValue([]string{"file"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // bool read_only = 7; v7 := compiler.MapValueForKey(m, "readOnly") if v7 != nil { - x.ReadOnly, ok = v7.(bool) + x.ReadOnly, ok = compiler.BoolForScalarNode(v7) if !ok { - message := fmt.Sprintf("has unexpected value for readOnly: %+v (%T)", v7, v7) + message := fmt.Sprintf("has unexpected value for readOnly: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } @@ -968,20 +969,20 @@ func NewFileSchema(in interface{}, context *compiler.Context) (*FileSchema, erro // repeated NamedAny vendor_extension = 10; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -1001,7 +1002,7 @@ func NewFileSchema(in interface{}, context *compiler.Context) (*FileSchema, erro } // NewFormDataParameterSubSchema creates an object of type FormDataParameterSubSchema if possible, returning an error if not. -func NewFormDataParameterSubSchema(in interface{}, context *compiler.Context) (*FormDataParameterSubSchema, error) { +func NewFormDataParameterSubSchema(in *yaml.Node, context *compiler.Context) (*FormDataParameterSubSchema, error) { errors := make([]error, 0) x := &FormDataParameterSubSchema{} m, ok := compiler.UnpackMap(in) @@ -1019,75 +1020,75 @@ func NewFormDataParameterSubSchema(in interface{}, context *compiler.Context) (* // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { - x.Required, ok = v1.(bool) + x.Required, ok = compiler.BoolForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { - x.In, ok = v2.(string) + x.In, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [formData] if ok && !compiler.StringArrayContainsValue([]string{"formData"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { - x.Description, ok = v3.(string) + x.Description, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { - x.Name, ok = v4.(string) + x.Name, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // bool allow_empty_value = 5; v5 := compiler.MapValueForKey(m, "allowEmptyValue") if v5 != nil { - x.AllowEmptyValue, ok = v5.(bool) + x.AllowEmptyValue, ok = compiler.BoolForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for allowEmptyValue: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for allowEmptyValue: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 6; v6 := compiler.MapValueForKey(m, "type") if v6 != nil { - x.Type, ok = v6.(string) + x.Type, ok = compiler.StringForScalarNode(v6) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array file] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array", "file"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 7; v7 := compiler.MapValueForKey(m, "format") if v7 != nil { - x.Format, ok = v7.(string) + x.Format, ok = compiler.StringForScalarNode(v7) if !ok { - message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v7, v7) + message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } @@ -1103,15 +1104,15 @@ func NewFormDataParameterSubSchema(in interface{}, context *compiler.Context) (* // string collection_format = 9; v9 := compiler.MapValueForKey(m, "collectionFormat") if v9 != nil { - x.CollectionFormat, ok = v9.(string) + x.CollectionFormat, ok = compiler.StringForScalarNode(v9) if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes multi] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes", "multi"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } @@ -1127,126 +1128,102 @@ func NewFormDataParameterSubSchema(in interface{}, context *compiler.Context) (* // float maximum = 11; v11 := compiler.MapValueForKey(m, "maximum") if v11 != nil { - switch v11 := v11.(type) { - case float64: - x.Maximum = v11 - case float32: - x.Maximum = float64(v11) - case uint64: - x.Maximum = float64(v11) - case uint32: - x.Maximum = float64(v11) - case int64: - x.Maximum = float64(v11) - case int32: - x.Maximum = float64(v11) - case int: - x.Maximum = float64(v11) - default: - message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v11, v11) + v, ok := compiler.FloatForScalarNode(v11) + if ok { + x.Maximum = v + } else { + message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 12; v12 := compiler.MapValueForKey(m, "exclusiveMaximum") if v12 != nil { - x.ExclusiveMaximum, ok = v12.(bool) + x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v12) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v12, v12) + message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 13; v13 := compiler.MapValueForKey(m, "minimum") if v13 != nil { - switch v13 := v13.(type) { - case float64: - x.Minimum = v13 - case float32: - x.Minimum = float64(v13) - case uint64: - x.Minimum = float64(v13) - case uint32: - x.Minimum = float64(v13) - case int64: - x.Minimum = float64(v13) - case int32: - x.Minimum = float64(v13) - case int: - x.Minimum = float64(v13) - default: - message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v13, v13) + v, ok := compiler.FloatForScalarNode(v13) + if ok { + x.Minimum = v + } else { + message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 14; v14 := compiler.MapValueForKey(m, "exclusiveMinimum") if v14 != nil { - x.ExclusiveMinimum, ok = v14.(bool) + x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v14) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v14, v14) + message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 15; v15 := compiler.MapValueForKey(m, "maxLength") if v15 != nil { - t, ok := v15.(int) + t, ok := compiler.IntForScalarNode(v15) if ok { x.MaxLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v15, v15) + message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 16; v16 := compiler.MapValueForKey(m, "minLength") if v16 != nil { - t, ok := v16.(int) + t, ok := compiler.IntForScalarNode(v16) if ok { x.MinLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v16, v16) + message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 17; v17 := compiler.MapValueForKey(m, "pattern") if v17 != nil { - x.Pattern, ok = v17.(string) + x.Pattern, ok = compiler.StringForScalarNode(v17) if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v17, v17) + message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 18; v18 := compiler.MapValueForKey(m, "maxItems") if v18 != nil { - t, ok := v18.(int) + t, ok := compiler.IntForScalarNode(v18) if ok { x.MaxItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v18, v18) + message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 19; v19 := compiler.MapValueForKey(m, "minItems") if v19 != nil { - t, ok := v19.(int) + t, ok := compiler.IntForScalarNode(v19) if ok { x.MinItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v19, v19) + message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 20; v20 := compiler.MapValueForKey(m, "uniqueItems") if v20 != nil { - x.UniqueItems, ok = v20.(bool) + x.UniqueItems, ok = compiler.BoolForScalarNode(v20) if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v20, v20) + message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v20)) errors = append(errors, compiler.NewError(context, message)) } } @@ -1255,9 +1232,9 @@ func NewFormDataParameterSubSchema(in interface{}, context *compiler.Context) (* if v21 != nil { // repeated Any x.Enum = make([]*Any, 0) - a, ok := v21.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v21) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) @@ -1269,43 +1246,31 @@ func NewFormDataParameterSubSchema(in interface{}, context *compiler.Context) (* // float multiple_of = 22; v22 := compiler.MapValueForKey(m, "multipleOf") if v22 != nil { - switch v22 := v22.(type) { - case float64: - x.MultipleOf = v22 - case float32: - x.MultipleOf = float64(v22) - case uint64: - x.MultipleOf = float64(v22) - case uint32: - x.MultipleOf = float64(v22) - case int64: - x.MultipleOf = float64(v22) - case int32: - x.MultipleOf = float64(v22) - case int: - x.MultipleOf = float64(v22) - default: - message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v22, v22) + v, ok := compiler.FloatForScalarNode(v22) + if ok { + x.MultipleOf = v + } else { + message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v22)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 23; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -1325,7 +1290,7 @@ func NewFormDataParameterSubSchema(in interface{}, context *compiler.Context) (* } // NewHeader creates an object of type Header if possible, returning an error if not. -func NewHeader(in interface{}, context *compiler.Context) (*Header, error) { +func NewHeader(in *yaml.Node, context *compiler.Context) (*Header, error) { errors := make([]error, 0) x := &Header{} m, ok := compiler.UnpackMap(in) @@ -1349,24 +1314,24 @@ func NewHeader(in interface{}, context *compiler.Context) (*Header, error) { // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { - x.Type, ok = v1.(string) + x.Type, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number integer boolean array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "integer", "boolean", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 2; v2 := compiler.MapValueForKey(m, "format") if v2 != nil { - x.Format, ok = v2.(string) + x.Format, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } @@ -1382,15 +1347,15 @@ func NewHeader(in interface{}, context *compiler.Context) (*Header, error) { // string collection_format = 4; v4 := compiler.MapValueForKey(m, "collectionFormat") if v4 != nil { - x.CollectionFormat, ok = v4.(string) + x.CollectionFormat, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } @@ -1406,126 +1371,102 @@ func NewHeader(in interface{}, context *compiler.Context) (*Header, error) { // float maximum = 6; v6 := compiler.MapValueForKey(m, "maximum") if v6 != nil { - switch v6 := v6.(type) { - case float64: - x.Maximum = v6 - case float32: - x.Maximum = float64(v6) - case uint64: - x.Maximum = float64(v6) - case uint32: - x.Maximum = float64(v6) - case int64: - x.Maximum = float64(v6) - case int32: - x.Maximum = float64(v6) - case int: - x.Maximum = float64(v6) - default: - message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v6, v6) + v, ok := compiler.FloatForScalarNode(v6) + if ok { + x.Maximum = v + } else { + message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 7; v7 := compiler.MapValueForKey(m, "exclusiveMaximum") if v7 != nil { - x.ExclusiveMaximum, ok = v7.(bool) + x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v7) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v7, v7) + message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 8; v8 := compiler.MapValueForKey(m, "minimum") if v8 != nil { - switch v8 := v8.(type) { - case float64: - x.Minimum = v8 - case float32: - x.Minimum = float64(v8) - case uint64: - x.Minimum = float64(v8) - case uint32: - x.Minimum = float64(v8) - case int64: - x.Minimum = float64(v8) - case int32: - x.Minimum = float64(v8) - case int: - x.Minimum = float64(v8) - default: - message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v8, v8) + v, ok := compiler.FloatForScalarNode(v8) + if ok { + x.Minimum = v + } else { + message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 9; v9 := compiler.MapValueForKey(m, "exclusiveMinimum") if v9 != nil { - x.ExclusiveMinimum, ok = v9.(bool) + x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v9) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v9, v9) + message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 10; v10 := compiler.MapValueForKey(m, "maxLength") if v10 != nil { - t, ok := v10.(int) + t, ok := compiler.IntForScalarNode(v10) if ok { x.MaxLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v10, v10) + message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 11; v11 := compiler.MapValueForKey(m, "minLength") if v11 != nil { - t, ok := v11.(int) + t, ok := compiler.IntForScalarNode(v11) if ok { x.MinLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v11, v11) + message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 12; v12 := compiler.MapValueForKey(m, "pattern") if v12 != nil { - x.Pattern, ok = v12.(string) + x.Pattern, ok = compiler.StringForScalarNode(v12) if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v12, v12) + message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 13; v13 := compiler.MapValueForKey(m, "maxItems") if v13 != nil { - t, ok := v13.(int) + t, ok := compiler.IntForScalarNode(v13) if ok { x.MaxItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v13, v13) + message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 14; v14 := compiler.MapValueForKey(m, "minItems") if v14 != nil { - t, ok := v14.(int) + t, ok := compiler.IntForScalarNode(v14) if ok { x.MinItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v14, v14) + message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 15; v15 := compiler.MapValueForKey(m, "uniqueItems") if v15 != nil { - x.UniqueItems, ok = v15.(bool) + x.UniqueItems, ok = compiler.BoolForScalarNode(v15) if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v15, v15) + message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } @@ -1534,9 +1475,9 @@ func NewHeader(in interface{}, context *compiler.Context) (*Header, error) { if v16 != nil { // repeated Any x.Enum = make([]*Any, 0) - a, ok := v16.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v16) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) @@ -1548,52 +1489,40 @@ func NewHeader(in interface{}, context *compiler.Context) (*Header, error) { // float multiple_of = 17; v17 := compiler.MapValueForKey(m, "multipleOf") if v17 != nil { - switch v17 := v17.(type) { - case float64: - x.MultipleOf = v17 - case float32: - x.MultipleOf = float64(v17) - case uint64: - x.MultipleOf = float64(v17) - case uint32: - x.MultipleOf = float64(v17) - case int64: - x.MultipleOf = float64(v17) - case int32: - x.MultipleOf = float64(v17) - case int: - x.MultipleOf = float64(v17) - default: - message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v17, v17) + v, ok := compiler.FloatForScalarNode(v17) + if ok { + x.MultipleOf = v + } else { + message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 18; v18 := compiler.MapValueForKey(m, "description") if v18 != nil { - x.Description, ok = v18.(string) + x.Description, ok = compiler.StringForScalarNode(v18) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v18, v18) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 19; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -1613,7 +1542,7 @@ func NewHeader(in interface{}, context *compiler.Context) (*Header, error) { } // NewHeaderParameterSubSchema creates an object of type HeaderParameterSubSchema if possible, returning an error if not. -func NewHeaderParameterSubSchema(in interface{}, context *compiler.Context) (*HeaderParameterSubSchema, error) { +func NewHeaderParameterSubSchema(in *yaml.Node, context *compiler.Context) (*HeaderParameterSubSchema, error) { errors := make([]error, 0) x := &HeaderParameterSubSchema{} m, ok := compiler.UnpackMap(in) @@ -1631,66 +1560,66 @@ func NewHeaderParameterSubSchema(in interface{}, context *compiler.Context) (*He // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { - x.Required, ok = v1.(bool) + x.Required, ok = compiler.BoolForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { - x.In, ok = v2.(string) + x.In, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [header] if ok && !compiler.StringArrayContainsValue([]string{"header"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { - x.Description, ok = v3.(string) + x.Description, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { - x.Name, ok = v4.(string) + x.Name, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 5; v5 := compiler.MapValueForKey(m, "type") if v5 != nil { - x.Type, ok = v5.(string) + x.Type, ok = compiler.StringForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 6; v6 := compiler.MapValueForKey(m, "format") if v6 != nil { - x.Format, ok = v6.(string) + x.Format, ok = compiler.StringForScalarNode(v6) if !ok { - message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } @@ -1706,15 +1635,15 @@ func NewHeaderParameterSubSchema(in interface{}, context *compiler.Context) (*He // string collection_format = 8; v8 := compiler.MapValueForKey(m, "collectionFormat") if v8 != nil { - x.CollectionFormat, ok = v8.(string) + x.CollectionFormat, ok = compiler.StringForScalarNode(v8) if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } @@ -1730,126 +1659,102 @@ func NewHeaderParameterSubSchema(in interface{}, context *compiler.Context) (*He // float maximum = 10; v10 := compiler.MapValueForKey(m, "maximum") if v10 != nil { - switch v10 := v10.(type) { - case float64: - x.Maximum = v10 - case float32: - x.Maximum = float64(v10) - case uint64: - x.Maximum = float64(v10) - case uint32: - x.Maximum = float64(v10) - case int64: - x.Maximum = float64(v10) - case int32: - x.Maximum = float64(v10) - case int: - x.Maximum = float64(v10) - default: - message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v10, v10) + v, ok := compiler.FloatForScalarNode(v10) + if ok { + x.Maximum = v + } else { + message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 11; v11 := compiler.MapValueForKey(m, "exclusiveMaximum") if v11 != nil { - x.ExclusiveMaximum, ok = v11.(bool) + x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v11) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v11, v11) + message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 12; v12 := compiler.MapValueForKey(m, "minimum") if v12 != nil { - switch v12 := v12.(type) { - case float64: - x.Minimum = v12 - case float32: - x.Minimum = float64(v12) - case uint64: - x.Minimum = float64(v12) - case uint32: - x.Minimum = float64(v12) - case int64: - x.Minimum = float64(v12) - case int32: - x.Minimum = float64(v12) - case int: - x.Minimum = float64(v12) - default: - message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v12, v12) + v, ok := compiler.FloatForScalarNode(v12) + if ok { + x.Minimum = v + } else { + message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 13; v13 := compiler.MapValueForKey(m, "exclusiveMinimum") if v13 != nil { - x.ExclusiveMinimum, ok = v13.(bool) + x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v13) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v13, v13) + message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 14; v14 := compiler.MapValueForKey(m, "maxLength") if v14 != nil { - t, ok := v14.(int) + t, ok := compiler.IntForScalarNode(v14) if ok { x.MaxLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v14, v14) + message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 15; v15 := compiler.MapValueForKey(m, "minLength") if v15 != nil { - t, ok := v15.(int) + t, ok := compiler.IntForScalarNode(v15) if ok { x.MinLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v15, v15) + message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 16; v16 := compiler.MapValueForKey(m, "pattern") if v16 != nil { - x.Pattern, ok = v16.(string) + x.Pattern, ok = compiler.StringForScalarNode(v16) if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v16, v16) + message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 17; v17 := compiler.MapValueForKey(m, "maxItems") if v17 != nil { - t, ok := v17.(int) + t, ok := compiler.IntForScalarNode(v17) if ok { x.MaxItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v17, v17) + message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 18; v18 := compiler.MapValueForKey(m, "minItems") if v18 != nil { - t, ok := v18.(int) + t, ok := compiler.IntForScalarNode(v18) if ok { x.MinItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v18, v18) + message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 19; v19 := compiler.MapValueForKey(m, "uniqueItems") if v19 != nil { - x.UniqueItems, ok = v19.(bool) + x.UniqueItems, ok = compiler.BoolForScalarNode(v19) if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v19, v19) + message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } @@ -1858,9 +1763,9 @@ func NewHeaderParameterSubSchema(in interface{}, context *compiler.Context) (*He if v20 != nil { // repeated Any x.Enum = make([]*Any, 0) - a, ok := v20.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v20) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) @@ -1872,43 +1777,31 @@ func NewHeaderParameterSubSchema(in interface{}, context *compiler.Context) (*He // float multiple_of = 21; v21 := compiler.MapValueForKey(m, "multipleOf") if v21 != nil { - switch v21 := v21.(type) { - case float64: - x.MultipleOf = v21 - case float32: - x.MultipleOf = float64(v21) - case uint64: - x.MultipleOf = float64(v21) - case uint32: - x.MultipleOf = float64(v21) - case int64: - x.MultipleOf = float64(v21) - case int32: - x.MultipleOf = float64(v21) - case int: - x.MultipleOf = float64(v21) - default: - message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v21, v21) + v, ok := compiler.FloatForScalarNode(v21) + if ok { + x.MultipleOf = v + } else { + message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v21)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 22; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -1928,7 +1821,7 @@ func NewHeaderParameterSubSchema(in interface{}, context *compiler.Context) (*He } // NewHeaders creates an object of type Headers if possible, returning an error if not. -func NewHeaders(in interface{}, context *compiler.Context) (*Headers, error) { +func NewHeaders(in *yaml.Node, context *compiler.Context) (*Headers, error) { errors := make([]error, 0) x := &Headers{} m, ok := compiler.UnpackMap(in) @@ -1939,10 +1832,10 @@ func NewHeaders(in interface{}, context *compiler.Context) (*Headers, error) { // repeated NamedHeader additional_properties = 1; // MAP: Header x.AdditionalProperties = make([]*NamedHeader, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedHeader{} pair.Name = k var err error @@ -1958,7 +1851,7 @@ func NewHeaders(in interface{}, context *compiler.Context) (*Headers, error) { } // NewInfo creates an object of type Info if possible, returning an error if not. -func NewInfo(in interface{}, context *compiler.Context) (*Info, error) { +func NewInfo(in *yaml.Node, context *compiler.Context) (*Info, error) { errors := make([]error, 0) x := &Info{} m, ok := compiler.UnpackMap(in) @@ -1982,36 +1875,36 @@ func NewInfo(in interface{}, context *compiler.Context) (*Info, error) { // string title = 1; v1 := compiler.MapValueForKey(m, "title") if v1 != nil { - x.Title, ok = v1.(string) + x.Title, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for title: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string version = 2; v2 := compiler.MapValueForKey(m, "version") if v2 != nil { - x.Version, ok = v2.(string) + x.Version, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for version: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for version: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { - x.Description, ok = v3.(string) + x.Description, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string terms_of_service = 4; v4 := compiler.MapValueForKey(m, "termsOfService") if v4 != nil { - x.TermsOfService, ok = v4.(string) + x.TermsOfService, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for termsOfService: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for termsOfService: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2036,20 +1929,20 @@ func NewInfo(in interface{}, context *compiler.Context) (*Info, error) { // repeated NamedAny vendor_extension = 7; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -2069,7 +1962,7 @@ func NewInfo(in interface{}, context *compiler.Context) (*Info, error) { } // NewItemsItem creates an object of type ItemsItem if possible, returning an error if not. -func NewItemsItem(in interface{}, context *compiler.Context) (*ItemsItem, error) { +func NewItemsItem(in *yaml.Node, context *compiler.Context) (*ItemsItem, error) { errors := make([]error, 0) x := &ItemsItem{} m, ok := compiler.UnpackMap(in) @@ -2088,7 +1981,7 @@ func NewItemsItem(in interface{}, context *compiler.Context) (*ItemsItem, error) } // NewJsonReference creates an object of type JsonReference if possible, returning an error if not. -func NewJsonReference(in interface{}, context *compiler.Context) (*JsonReference, error) { +func NewJsonReference(in *yaml.Node, context *compiler.Context) (*JsonReference, error) { errors := make([]error, 0) x := &JsonReference{} m, ok := compiler.UnpackMap(in) @@ -2102,28 +1995,21 @@ func NewJsonReference(in interface{}, context *compiler.Context) (*JsonReference message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } - allowedKeys := []string{"$ref", "description"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } // string _ref = 1; v1 := compiler.MapValueForKey(m, "$ref") if v1 != nil { - x.XRef, ok = v1.(string) + x.XRef, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for $ref: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 2; v2 := compiler.MapValueForKey(m, "description") if v2 != nil { - x.Description, ok = v2.(string) + x.Description, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2132,7 +2018,7 @@ func NewJsonReference(in interface{}, context *compiler.Context) (*JsonReference } // NewLicense creates an object of type License if possible, returning an error if not. -func NewLicense(in interface{}, context *compiler.Context) (*License, error) { +func NewLicense(in *yaml.Node, context *compiler.Context) (*License, error) { errors := make([]error, 0) x := &License{} m, ok := compiler.UnpackMap(in) @@ -2156,38 +2042,38 @@ func NewLicense(in interface{}, context *compiler.Context) (*License, error) { // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string url = 2; v2 := compiler.MapValueForKey(m, "url") if v2 != nil { - x.Url, ok = v2.(string) + x.Url, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for url: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 3; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -2207,7 +2093,7 @@ func NewLicense(in interface{}, context *compiler.Context) (*License, error) { } // NewNamedAny creates an object of type NamedAny if possible, returning an error if not. -func NewNamedAny(in interface{}, context *compiler.Context) (*NamedAny, error) { +func NewNamedAny(in *yaml.Node, context *compiler.Context) (*NamedAny, error) { errors := make([]error, 0) x := &NamedAny{} m, ok := compiler.UnpackMap(in) @@ -2225,9 +2111,9 @@ func NewNamedAny(in interface{}, context *compiler.Context) (*NamedAny, error) { // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2245,7 +2131,7 @@ func NewNamedAny(in interface{}, context *compiler.Context) (*NamedAny, error) { } // NewNamedHeader creates an object of type NamedHeader if possible, returning an error if not. -func NewNamedHeader(in interface{}, context *compiler.Context) (*NamedHeader, error) { +func NewNamedHeader(in *yaml.Node, context *compiler.Context) (*NamedHeader, error) { errors := make([]error, 0) x := &NamedHeader{} m, ok := compiler.UnpackMap(in) @@ -2263,9 +2149,9 @@ func NewNamedHeader(in interface{}, context *compiler.Context) (*NamedHeader, er // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2283,7 +2169,7 @@ func NewNamedHeader(in interface{}, context *compiler.Context) (*NamedHeader, er } // NewNamedParameter creates an object of type NamedParameter if possible, returning an error if not. -func NewNamedParameter(in interface{}, context *compiler.Context) (*NamedParameter, error) { +func NewNamedParameter(in *yaml.Node, context *compiler.Context) (*NamedParameter, error) { errors := make([]error, 0) x := &NamedParameter{} m, ok := compiler.UnpackMap(in) @@ -2301,9 +2187,9 @@ func NewNamedParameter(in interface{}, context *compiler.Context) (*NamedParamet // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2321,7 +2207,7 @@ func NewNamedParameter(in interface{}, context *compiler.Context) (*NamedParamet } // NewNamedPathItem creates an object of type NamedPathItem if possible, returning an error if not. -func NewNamedPathItem(in interface{}, context *compiler.Context) (*NamedPathItem, error) { +func NewNamedPathItem(in *yaml.Node, context *compiler.Context) (*NamedPathItem, error) { errors := make([]error, 0) x := &NamedPathItem{} m, ok := compiler.UnpackMap(in) @@ -2339,9 +2225,9 @@ func NewNamedPathItem(in interface{}, context *compiler.Context) (*NamedPathItem // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2359,7 +2245,7 @@ func NewNamedPathItem(in interface{}, context *compiler.Context) (*NamedPathItem } // NewNamedResponse creates an object of type NamedResponse if possible, returning an error if not. -func NewNamedResponse(in interface{}, context *compiler.Context) (*NamedResponse, error) { +func NewNamedResponse(in *yaml.Node, context *compiler.Context) (*NamedResponse, error) { errors := make([]error, 0) x := &NamedResponse{} m, ok := compiler.UnpackMap(in) @@ -2377,9 +2263,9 @@ func NewNamedResponse(in interface{}, context *compiler.Context) (*NamedResponse // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2397,7 +2283,7 @@ func NewNamedResponse(in interface{}, context *compiler.Context) (*NamedResponse } // NewNamedResponseValue creates an object of type NamedResponseValue if possible, returning an error if not. -func NewNamedResponseValue(in interface{}, context *compiler.Context) (*NamedResponseValue, error) { +func NewNamedResponseValue(in *yaml.Node, context *compiler.Context) (*NamedResponseValue, error) { errors := make([]error, 0) x := &NamedResponseValue{} m, ok := compiler.UnpackMap(in) @@ -2415,9 +2301,9 @@ func NewNamedResponseValue(in interface{}, context *compiler.Context) (*NamedRes // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2435,7 +2321,7 @@ func NewNamedResponseValue(in interface{}, context *compiler.Context) (*NamedRes } // NewNamedSchema creates an object of type NamedSchema if possible, returning an error if not. -func NewNamedSchema(in interface{}, context *compiler.Context) (*NamedSchema, error) { +func NewNamedSchema(in *yaml.Node, context *compiler.Context) (*NamedSchema, error) { errors := make([]error, 0) x := &NamedSchema{} m, ok := compiler.UnpackMap(in) @@ -2453,9 +2339,9 @@ func NewNamedSchema(in interface{}, context *compiler.Context) (*NamedSchema, er // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2473,7 +2359,7 @@ func NewNamedSchema(in interface{}, context *compiler.Context) (*NamedSchema, er } // NewNamedSecurityDefinitionsItem creates an object of type NamedSecurityDefinitionsItem if possible, returning an error if not. -func NewNamedSecurityDefinitionsItem(in interface{}, context *compiler.Context) (*NamedSecurityDefinitionsItem, error) { +func NewNamedSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*NamedSecurityDefinitionsItem, error) { errors := make([]error, 0) x := &NamedSecurityDefinitionsItem{} m, ok := compiler.UnpackMap(in) @@ -2491,9 +2377,9 @@ func NewNamedSecurityDefinitionsItem(in interface{}, context *compiler.Context) // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2511,7 +2397,7 @@ func NewNamedSecurityDefinitionsItem(in interface{}, context *compiler.Context) } // NewNamedString creates an object of type NamedString if possible, returning an error if not. -func NewNamedString(in interface{}, context *compiler.Context) (*NamedString, error) { +func NewNamedString(in *yaml.Node, context *compiler.Context) (*NamedString, error) { errors := make([]error, 0) x := &NamedString{} m, ok := compiler.UnpackMap(in) @@ -2529,18 +2415,18 @@ func NewNamedString(in interface{}, context *compiler.Context) (*NamedString, er // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { - x.Value, ok = v2.(string) + x.Value, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for value: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for value: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2549,7 +2435,7 @@ func NewNamedString(in interface{}, context *compiler.Context) (*NamedString, er } // NewNamedStringArray creates an object of type NamedStringArray if possible, returning an error if not. -func NewNamedStringArray(in interface{}, context *compiler.Context) (*NamedStringArray, error) { +func NewNamedStringArray(in *yaml.Node, context *compiler.Context) (*NamedStringArray, error) { errors := make([]error, 0) x := &NamedStringArray{} m, ok := compiler.UnpackMap(in) @@ -2567,9 +2453,9 @@ func NewNamedStringArray(in interface{}, context *compiler.Context) (*NamedStrin // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2587,7 +2473,7 @@ func NewNamedStringArray(in interface{}, context *compiler.Context) (*NamedStrin } // NewNonBodyParameter creates an object of type NonBodyParameter if possible, returning an error if not. -func NewNonBodyParameter(in interface{}, context *compiler.Context) (*NonBodyParameter, error) { +func NewNonBodyParameter(in *yaml.Node, context *compiler.Context) (*NonBodyParameter, error) { errors := make([]error, 0) x := &NonBodyParameter{} matched := false @@ -2655,7 +2541,7 @@ func NewNonBodyParameter(in interface{}, context *compiler.Context) (*NonBodyPar } // NewOauth2AccessCodeSecurity creates an object of type Oauth2AccessCodeSecurity if possible, returning an error if not. -func NewOauth2AccessCodeSecurity(in interface{}, context *compiler.Context) (*Oauth2AccessCodeSecurity, error) { +func NewOauth2AccessCodeSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2AccessCodeSecurity, error) { errors := make([]error, 0) x := &Oauth2AccessCodeSecurity{} m, ok := compiler.UnpackMap(in) @@ -2679,30 +2565,30 @@ func NewOauth2AccessCodeSecurity(in interface{}, context *compiler.Context) (*Oa // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { - x.Type, ok = v1.(string) + x.Type, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { - x.Flow, ok = v2.(string) + x.Flow, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [accessCode] if ok && !compiler.StringArrayContainsValue([]string{"accessCode"}, x.Flow) { - message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2718,47 +2604,47 @@ func NewOauth2AccessCodeSecurity(in interface{}, context *compiler.Context) (*Oa // string authorization_url = 4; v4 := compiler.MapValueForKey(m, "authorizationUrl") if v4 != nil { - x.AuthorizationUrl, ok = v4.(string) + x.AuthorizationUrl, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for authorizationUrl: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for authorizationUrl: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string token_url = 5; v5 := compiler.MapValueForKey(m, "tokenUrl") if v5 != nil { - x.TokenUrl, ok = v5.(string) + x.TokenUrl, ok = compiler.StringForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for tokenUrl: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 6; v6 := compiler.MapValueForKey(m, "description") if v6 != nil { - x.Description, ok = v6.(string) + x.Description, ok = compiler.StringForScalarNode(v6) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 7; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -2778,7 +2664,7 @@ func NewOauth2AccessCodeSecurity(in interface{}, context *compiler.Context) (*Oa } // NewOauth2ApplicationSecurity creates an object of type Oauth2ApplicationSecurity if possible, returning an error if not. -func NewOauth2ApplicationSecurity(in interface{}, context *compiler.Context) (*Oauth2ApplicationSecurity, error) { +func NewOauth2ApplicationSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2ApplicationSecurity, error) { errors := make([]error, 0) x := &Oauth2ApplicationSecurity{} m, ok := compiler.UnpackMap(in) @@ -2802,30 +2688,30 @@ func NewOauth2ApplicationSecurity(in interface{}, context *compiler.Context) (*O // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { - x.Type, ok = v1.(string) + x.Type, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { - x.Flow, ok = v2.(string) + x.Flow, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [application] if ok && !compiler.StringArrayContainsValue([]string{"application"}, x.Flow) { - message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2841,38 +2727,38 @@ func NewOauth2ApplicationSecurity(in interface{}, context *compiler.Context) (*O // string token_url = 4; v4 := compiler.MapValueForKey(m, "tokenUrl") if v4 != nil { - x.TokenUrl, ok = v4.(string) + x.TokenUrl, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for tokenUrl: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 5; v5 := compiler.MapValueForKey(m, "description") if v5 != nil { - x.Description, ok = v5.(string) + x.Description, ok = compiler.StringForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -2892,7 +2778,7 @@ func NewOauth2ApplicationSecurity(in interface{}, context *compiler.Context) (*O } // NewOauth2ImplicitSecurity creates an object of type Oauth2ImplicitSecurity if possible, returning an error if not. -func NewOauth2ImplicitSecurity(in interface{}, context *compiler.Context) (*Oauth2ImplicitSecurity, error) { +func NewOauth2ImplicitSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2ImplicitSecurity, error) { errors := make([]error, 0) x := &Oauth2ImplicitSecurity{} m, ok := compiler.UnpackMap(in) @@ -2916,30 +2802,30 @@ func NewOauth2ImplicitSecurity(in interface{}, context *compiler.Context) (*Oaut // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { - x.Type, ok = v1.(string) + x.Type, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { - x.Flow, ok = v2.(string) + x.Flow, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [implicit] if ok && !compiler.StringArrayContainsValue([]string{"implicit"}, x.Flow) { - message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } @@ -2955,38 +2841,38 @@ func NewOauth2ImplicitSecurity(in interface{}, context *compiler.Context) (*Oaut // string authorization_url = 4; v4 := compiler.MapValueForKey(m, "authorizationUrl") if v4 != nil { - x.AuthorizationUrl, ok = v4.(string) + x.AuthorizationUrl, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for authorizationUrl: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for authorizationUrl: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 5; v5 := compiler.MapValueForKey(m, "description") if v5 != nil { - x.Description, ok = v5.(string) + x.Description, ok = compiler.StringForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -3006,7 +2892,7 @@ func NewOauth2ImplicitSecurity(in interface{}, context *compiler.Context) (*Oaut } // NewOauth2PasswordSecurity creates an object of type Oauth2PasswordSecurity if possible, returning an error if not. -func NewOauth2PasswordSecurity(in interface{}, context *compiler.Context) (*Oauth2PasswordSecurity, error) { +func NewOauth2PasswordSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2PasswordSecurity, error) { errors := make([]error, 0) x := &Oauth2PasswordSecurity{} m, ok := compiler.UnpackMap(in) @@ -3030,30 +2916,30 @@ func NewOauth2PasswordSecurity(in interface{}, context *compiler.Context) (*Oaut // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { - x.Type, ok = v1.(string) + x.Type, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { - x.Flow, ok = v2.(string) + x.Flow, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [password] if ok && !compiler.StringArrayContainsValue([]string{"password"}, x.Flow) { - message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } @@ -3069,38 +2955,38 @@ func NewOauth2PasswordSecurity(in interface{}, context *compiler.Context) (*Oaut // string token_url = 4; v4 := compiler.MapValueForKey(m, "tokenUrl") if v4 != nil { - x.TokenUrl, ok = v4.(string) + x.TokenUrl, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for tokenUrl: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 5; v5 := compiler.MapValueForKey(m, "description") if v5 != nil { - x.Description, ok = v5.(string) + x.Description, ok = compiler.StringForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -3120,7 +3006,7 @@ func NewOauth2PasswordSecurity(in interface{}, context *compiler.Context) (*Oaut } // NewOauth2Scopes creates an object of type Oauth2Scopes if possible, returning an error if not. -func NewOauth2Scopes(in interface{}, context *compiler.Context) (*Oauth2Scopes, error) { +func NewOauth2Scopes(in *yaml.Node, context *compiler.Context) (*Oauth2Scopes, error) { errors := make([]error, 0) x := &Oauth2Scopes{} m, ok := compiler.UnpackMap(in) @@ -3131,13 +3017,13 @@ func NewOauth2Scopes(in interface{}, context *compiler.Context) (*Oauth2Scopes, // repeated NamedString additional_properties = 1; // MAP: string x.AdditionalProperties = make([]*NamedString, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedString{} pair.Name = k - pair.Value = v.(string) + pair.Value, _ = compiler.StringForScalarNode(v) x.AdditionalProperties = append(x.AdditionalProperties, pair) } } @@ -3146,7 +3032,7 @@ func NewOauth2Scopes(in interface{}, context *compiler.Context) (*Oauth2Scopes, } // NewOperation creates an object of type Operation if possible, returning an error if not. -func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) { +func NewOperation(in *yaml.Node, context *compiler.Context) (*Operation, error) { errors := make([]error, 0) x := &Operation{} m, ok := compiler.UnpackMap(in) @@ -3170,29 +3056,29 @@ func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) // repeated string tags = 1; v1 := compiler.MapValueForKey(m, "tags") if v1 != nil { - v, ok := v1.([]interface{}) + v, ok := compiler.SequenceNodeForNode(v1) if ok { - x.Tags = compiler.ConvertInterfaceArrayToStringArray(v) + x.Tags = compiler.StringArrayForSequenceNode(v) } else { - message := fmt.Sprintf("has unexpected value for tags: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for tags: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string summary = 2; v2 := compiler.MapValueForKey(m, "summary") if v2 != nil { - x.Summary, ok = v2.(string) + x.Summary, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for summary: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for summary: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { - x.Description, ok = v3.(string) + x.Description, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } @@ -3208,31 +3094,31 @@ func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) // string operation_id = 5; v5 := compiler.MapValueForKey(m, "operationId") if v5 != nil { - x.OperationId, ok = v5.(string) + x.OperationId, ok = compiler.StringForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for operationId: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for operationId: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string produces = 6; v6 := compiler.MapValueForKey(m, "produces") if v6 != nil { - v, ok := v6.([]interface{}) + v, ok := compiler.SequenceNodeForNode(v6) if ok { - x.Produces = compiler.ConvertInterfaceArrayToStringArray(v) + x.Produces = compiler.StringArrayForSequenceNode(v) } else { - message := fmt.Sprintf("has unexpected value for produces: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for produces: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string consumes = 7; v7 := compiler.MapValueForKey(m, "consumes") if v7 != nil { - v, ok := v7.([]interface{}) + v, ok := compiler.SequenceNodeForNode(v7) if ok { - x.Consumes = compiler.ConvertInterfaceArrayToStringArray(v) + x.Consumes = compiler.StringArrayForSequenceNode(v) } else { - message := fmt.Sprintf("has unexpected value for consumes: %+v (%T)", v7, v7) + message := fmt.Sprintf("has unexpected value for consumes: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } @@ -3241,9 +3127,9 @@ func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) if v8 != nil { // repeated ParametersItem x.Parameters = make([]*ParametersItem, 0) - a, ok := v8.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v8) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewParametersItem(item, compiler.NewContext("parameters", context)) if err != nil { errors = append(errors, err) @@ -3264,26 +3150,26 @@ func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) // repeated string schemes = 10; v10 := compiler.MapValueForKey(m, "schemes") if v10 != nil { - v, ok := v10.([]interface{}) + v, ok := compiler.SequenceNodeForNode(v10) if ok { - x.Schemes = compiler.ConvertInterfaceArrayToStringArray(v) + x.Schemes = compiler.StringArrayForSequenceNode(v) } else { - message := fmt.Sprintf("has unexpected value for schemes: %+v (%T)", v10, v10) + message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [http https ws wss] if ok && !compiler.StringArrayContainsValues([]string{"http", "https", "ws", "wss"}, x.Schemes) { - message := fmt.Sprintf("has unexpected value for schemes: %+v", v10) + message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // bool deprecated = 11; v11 := compiler.MapValueForKey(m, "deprecated") if v11 != nil { - x.Deprecated, ok = v11.(bool) + x.Deprecated, ok = compiler.BoolForScalarNode(v11) if !ok { - message := fmt.Sprintf("has unexpected value for deprecated: %+v (%T)", v11, v11) + message := fmt.Sprintf("has unexpected value for deprecated: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } @@ -3292,9 +3178,9 @@ func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) if v12 != nil { // repeated SecurityRequirement x.Security = make([]*SecurityRequirement, 0) - a, ok := v12.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v12) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewSecurityRequirement(item, compiler.NewContext("security", context)) if err != nil { errors = append(errors, err) @@ -3306,20 +3192,20 @@ func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) // repeated NamedAny vendor_extension = 13; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -3339,7 +3225,7 @@ func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) } // NewParameter creates an object of type Parameter if possible, returning an error if not. -func NewParameter(in interface{}, context *compiler.Context) (*Parameter, error) { +func NewParameter(in *yaml.Node, context *compiler.Context) (*Parameter, error) { errors := make([]error, 0) x := &Parameter{} matched := false @@ -3379,7 +3265,7 @@ func NewParameter(in interface{}, context *compiler.Context) (*Parameter, error) } // NewParameterDefinitions creates an object of type ParameterDefinitions if possible, returning an error if not. -func NewParameterDefinitions(in interface{}, context *compiler.Context) (*ParameterDefinitions, error) { +func NewParameterDefinitions(in *yaml.Node, context *compiler.Context) (*ParameterDefinitions, error) { errors := make([]error, 0) x := &ParameterDefinitions{} m, ok := compiler.UnpackMap(in) @@ -3390,10 +3276,10 @@ func NewParameterDefinitions(in interface{}, context *compiler.Context) (*Parame // repeated NamedParameter additional_properties = 1; // MAP: Parameter x.AdditionalProperties = make([]*NamedParameter, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedParameter{} pair.Name = k var err error @@ -3409,7 +3295,7 @@ func NewParameterDefinitions(in interface{}, context *compiler.Context) (*Parame } // NewParametersItem creates an object of type ParametersItem if possible, returning an error if not. -func NewParametersItem(in interface{}, context *compiler.Context) (*ParametersItem, error) { +func NewParametersItem(in *yaml.Node, context *compiler.Context) (*ParametersItem, error) { errors := make([]error, 0) x := &ParametersItem{} matched := false @@ -3449,7 +3335,7 @@ func NewParametersItem(in interface{}, context *compiler.Context) (*ParametersIt } // NewPathItem creates an object of type PathItem if possible, returning an error if not. -func NewPathItem(in interface{}, context *compiler.Context) (*PathItem, error) { +func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { errors := make([]error, 0) x := &PathItem{} m, ok := compiler.UnpackMap(in) @@ -3467,9 +3353,9 @@ func NewPathItem(in interface{}, context *compiler.Context) (*PathItem, error) { // string _ref = 1; v1 := compiler.MapValueForKey(m, "$ref") if v1 != nil { - x.XRef, ok = v1.(string) + x.XRef, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for $ref: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -3541,9 +3427,9 @@ func NewPathItem(in interface{}, context *compiler.Context) (*PathItem, error) { if v9 != nil { // repeated ParametersItem x.Parameters = make([]*ParametersItem, 0) - a, ok := v9.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v9) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewParametersItem(item, compiler.NewContext("parameters", context)) if err != nil { errors = append(errors, err) @@ -3555,20 +3441,20 @@ func NewPathItem(in interface{}, context *compiler.Context) (*PathItem, error) { // repeated NamedAny vendor_extension = 10; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -3588,7 +3474,7 @@ func NewPathItem(in interface{}, context *compiler.Context) (*PathItem, error) { } // NewPathParameterSubSchema creates an object of type PathParameterSubSchema if possible, returning an error if not. -func NewPathParameterSubSchema(in interface{}, context *compiler.Context) (*PathParameterSubSchema, error) { +func NewPathParameterSubSchema(in *yaml.Node, context *compiler.Context) (*PathParameterSubSchema, error) { errors := make([]error, 0) x := &PathParameterSubSchema{} m, ok := compiler.UnpackMap(in) @@ -3612,66 +3498,66 @@ func NewPathParameterSubSchema(in interface{}, context *compiler.Context) (*Path // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { - x.Required, ok = v1.(bool) + x.Required, ok = compiler.BoolForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { - x.In, ok = v2.(string) + x.In, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [path] if ok && !compiler.StringArrayContainsValue([]string{"path"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { - x.Description, ok = v3.(string) + x.Description, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { - x.Name, ok = v4.(string) + x.Name, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 5; v5 := compiler.MapValueForKey(m, "type") if v5 != nil { - x.Type, ok = v5.(string) + x.Type, ok = compiler.StringForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 6; v6 := compiler.MapValueForKey(m, "format") if v6 != nil { - x.Format, ok = v6.(string) + x.Format, ok = compiler.StringForScalarNode(v6) if !ok { - message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } @@ -3687,15 +3573,15 @@ func NewPathParameterSubSchema(in interface{}, context *compiler.Context) (*Path // string collection_format = 8; v8 := compiler.MapValueForKey(m, "collectionFormat") if v8 != nil { - x.CollectionFormat, ok = v8.(string) + x.CollectionFormat, ok = compiler.StringForScalarNode(v8) if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } @@ -3711,126 +3597,102 @@ func NewPathParameterSubSchema(in interface{}, context *compiler.Context) (*Path // float maximum = 10; v10 := compiler.MapValueForKey(m, "maximum") if v10 != nil { - switch v10 := v10.(type) { - case float64: - x.Maximum = v10 - case float32: - x.Maximum = float64(v10) - case uint64: - x.Maximum = float64(v10) - case uint32: - x.Maximum = float64(v10) - case int64: - x.Maximum = float64(v10) - case int32: - x.Maximum = float64(v10) - case int: - x.Maximum = float64(v10) - default: - message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v10, v10) + v, ok := compiler.FloatForScalarNode(v10) + if ok { + x.Maximum = v + } else { + message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 11; v11 := compiler.MapValueForKey(m, "exclusiveMaximum") if v11 != nil { - x.ExclusiveMaximum, ok = v11.(bool) + x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v11) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v11, v11) + message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 12; v12 := compiler.MapValueForKey(m, "minimum") if v12 != nil { - switch v12 := v12.(type) { - case float64: - x.Minimum = v12 - case float32: - x.Minimum = float64(v12) - case uint64: - x.Minimum = float64(v12) - case uint32: - x.Minimum = float64(v12) - case int64: - x.Minimum = float64(v12) - case int32: - x.Minimum = float64(v12) - case int: - x.Minimum = float64(v12) - default: - message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v12, v12) + v, ok := compiler.FloatForScalarNode(v12) + if ok { + x.Minimum = v + } else { + message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 13; v13 := compiler.MapValueForKey(m, "exclusiveMinimum") if v13 != nil { - x.ExclusiveMinimum, ok = v13.(bool) + x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v13) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v13, v13) + message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 14; v14 := compiler.MapValueForKey(m, "maxLength") if v14 != nil { - t, ok := v14.(int) + t, ok := compiler.IntForScalarNode(v14) if ok { x.MaxLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v14, v14) + message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 15; v15 := compiler.MapValueForKey(m, "minLength") if v15 != nil { - t, ok := v15.(int) + t, ok := compiler.IntForScalarNode(v15) if ok { x.MinLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v15, v15) + message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 16; v16 := compiler.MapValueForKey(m, "pattern") if v16 != nil { - x.Pattern, ok = v16.(string) + x.Pattern, ok = compiler.StringForScalarNode(v16) if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v16, v16) + message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 17; v17 := compiler.MapValueForKey(m, "maxItems") if v17 != nil { - t, ok := v17.(int) + t, ok := compiler.IntForScalarNode(v17) if ok { x.MaxItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v17, v17) + message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 18; v18 := compiler.MapValueForKey(m, "minItems") if v18 != nil { - t, ok := v18.(int) + t, ok := compiler.IntForScalarNode(v18) if ok { x.MinItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v18, v18) + message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 19; v19 := compiler.MapValueForKey(m, "uniqueItems") if v19 != nil { - x.UniqueItems, ok = v19.(bool) + x.UniqueItems, ok = compiler.BoolForScalarNode(v19) if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v19, v19) + message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } @@ -3839,9 +3701,9 @@ func NewPathParameterSubSchema(in interface{}, context *compiler.Context) (*Path if v20 != nil { // repeated Any x.Enum = make([]*Any, 0) - a, ok := v20.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v20) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) @@ -3853,43 +3715,31 @@ func NewPathParameterSubSchema(in interface{}, context *compiler.Context) (*Path // float multiple_of = 21; v21 := compiler.MapValueForKey(m, "multipleOf") if v21 != nil { - switch v21 := v21.(type) { - case float64: - x.MultipleOf = v21 - case float32: - x.MultipleOf = float64(v21) - case uint64: - x.MultipleOf = float64(v21) - case uint32: - x.MultipleOf = float64(v21) - case int64: - x.MultipleOf = float64(v21) - case int32: - x.MultipleOf = float64(v21) - case int: - x.MultipleOf = float64(v21) - default: - message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v21, v21) + v, ok := compiler.FloatForScalarNode(v21) + if ok { + x.MultipleOf = v + } else { + message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v21)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 22; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -3909,7 +3759,7 @@ func NewPathParameterSubSchema(in interface{}, context *compiler.Context) (*Path } // NewPaths creates an object of type Paths if possible, returning an error if not. -func NewPaths(in interface{}, context *compiler.Context) (*Paths, error) { +func NewPaths(in *yaml.Node, context *compiler.Context) (*Paths, error) { errors := make([]error, 0) x := &Paths{} m, ok := compiler.UnpackMap(in) @@ -3927,20 +3777,20 @@ func NewPaths(in interface{}, context *compiler.Context) (*Paths, error) { // repeated NamedAny vendor_extension = 1; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -3958,10 +3808,10 @@ func NewPaths(in interface{}, context *compiler.Context) (*Paths, error) { // repeated NamedPathItem path = 2; // MAP: PathItem ^/ x.Path = make([]*NamedPathItem, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "/") { pair := &NamedPathItem{} pair.Name = k @@ -3979,7 +3829,7 @@ func NewPaths(in interface{}, context *compiler.Context) (*Paths, error) { } // NewPrimitivesItems creates an object of type PrimitivesItems if possible, returning an error if not. -func NewPrimitivesItems(in interface{}, context *compiler.Context) (*PrimitivesItems, error) { +func NewPrimitivesItems(in *yaml.Node, context *compiler.Context) (*PrimitivesItems, error) { errors := make([]error, 0) x := &PrimitivesItems{} m, ok := compiler.UnpackMap(in) @@ -3997,24 +3847,24 @@ func NewPrimitivesItems(in interface{}, context *compiler.Context) (*PrimitivesI // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { - x.Type, ok = v1.(string) + x.Type, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number integer boolean array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "integer", "boolean", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 2; v2 := compiler.MapValueForKey(m, "format") if v2 != nil { - x.Format, ok = v2.(string) + x.Format, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } @@ -4030,15 +3880,15 @@ func NewPrimitivesItems(in interface{}, context *compiler.Context) (*PrimitivesI // string collection_format = 4; v4 := compiler.MapValueForKey(m, "collectionFormat") if v4 != nil { - x.CollectionFormat, ok = v4.(string) + x.CollectionFormat, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } @@ -4054,126 +3904,102 @@ func NewPrimitivesItems(in interface{}, context *compiler.Context) (*PrimitivesI // float maximum = 6; v6 := compiler.MapValueForKey(m, "maximum") if v6 != nil { - switch v6 := v6.(type) { - case float64: - x.Maximum = v6 - case float32: - x.Maximum = float64(v6) - case uint64: - x.Maximum = float64(v6) - case uint32: - x.Maximum = float64(v6) - case int64: - x.Maximum = float64(v6) - case int32: - x.Maximum = float64(v6) - case int: - x.Maximum = float64(v6) - default: - message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v6, v6) + v, ok := compiler.FloatForScalarNode(v6) + if ok { + x.Maximum = v + } else { + message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 7; v7 := compiler.MapValueForKey(m, "exclusiveMaximum") if v7 != nil { - x.ExclusiveMaximum, ok = v7.(bool) + x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v7) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v7, v7) + message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 8; v8 := compiler.MapValueForKey(m, "minimum") if v8 != nil { - switch v8 := v8.(type) { - case float64: - x.Minimum = v8 - case float32: - x.Minimum = float64(v8) - case uint64: - x.Minimum = float64(v8) - case uint32: - x.Minimum = float64(v8) - case int64: - x.Minimum = float64(v8) - case int32: - x.Minimum = float64(v8) - case int: - x.Minimum = float64(v8) - default: - message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v8, v8) + v, ok := compiler.FloatForScalarNode(v8) + if ok { + x.Minimum = v + } else { + message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 9; v9 := compiler.MapValueForKey(m, "exclusiveMinimum") if v9 != nil { - x.ExclusiveMinimum, ok = v9.(bool) + x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v9) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v9, v9) + message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 10; v10 := compiler.MapValueForKey(m, "maxLength") if v10 != nil { - t, ok := v10.(int) + t, ok := compiler.IntForScalarNode(v10) if ok { x.MaxLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v10, v10) + message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 11; v11 := compiler.MapValueForKey(m, "minLength") if v11 != nil { - t, ok := v11.(int) + t, ok := compiler.IntForScalarNode(v11) if ok { x.MinLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v11, v11) + message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 12; v12 := compiler.MapValueForKey(m, "pattern") if v12 != nil { - x.Pattern, ok = v12.(string) + x.Pattern, ok = compiler.StringForScalarNode(v12) if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v12, v12) + message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 13; v13 := compiler.MapValueForKey(m, "maxItems") if v13 != nil { - t, ok := v13.(int) + t, ok := compiler.IntForScalarNode(v13) if ok { x.MaxItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v13, v13) + message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 14; v14 := compiler.MapValueForKey(m, "minItems") if v14 != nil { - t, ok := v14.(int) + t, ok := compiler.IntForScalarNode(v14) if ok { x.MinItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v14, v14) + message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 15; v15 := compiler.MapValueForKey(m, "uniqueItems") if v15 != nil { - x.UniqueItems, ok = v15.(bool) + x.UniqueItems, ok = compiler.BoolForScalarNode(v15) if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v15, v15) + message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } @@ -4182,9 +4008,9 @@ func NewPrimitivesItems(in interface{}, context *compiler.Context) (*PrimitivesI if v16 != nil { // repeated Any x.Enum = make([]*Any, 0) - a, ok := v16.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v16) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) @@ -4196,43 +4022,31 @@ func NewPrimitivesItems(in interface{}, context *compiler.Context) (*PrimitivesI // float multiple_of = 17; v17 := compiler.MapValueForKey(m, "multipleOf") if v17 != nil { - switch v17 := v17.(type) { - case float64: - x.MultipleOf = v17 - case float32: - x.MultipleOf = float64(v17) - case uint64: - x.MultipleOf = float64(v17) - case uint32: - x.MultipleOf = float64(v17) - case int64: - x.MultipleOf = float64(v17) - case int32: - x.MultipleOf = float64(v17) - case int: - x.MultipleOf = float64(v17) - default: - message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v17, v17) + v, ok := compiler.FloatForScalarNode(v17) + if ok { + x.MultipleOf = v + } else { + message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 18; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -4252,7 +4066,7 @@ func NewPrimitivesItems(in interface{}, context *compiler.Context) (*PrimitivesI } // NewProperties creates an object of type Properties if possible, returning an error if not. -func NewProperties(in interface{}, context *compiler.Context) (*Properties, error) { +func NewProperties(in *yaml.Node, context *compiler.Context) (*Properties, error) { errors := make([]error, 0) x := &Properties{} m, ok := compiler.UnpackMap(in) @@ -4263,10 +4077,10 @@ func NewProperties(in interface{}, context *compiler.Context) (*Properties, erro // repeated NamedSchema additional_properties = 1; // MAP: Schema x.AdditionalProperties = make([]*NamedSchema, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedSchema{} pair.Name = k var err error @@ -4282,7 +4096,7 @@ func NewProperties(in interface{}, context *compiler.Context) (*Properties, erro } // NewQueryParameterSubSchema creates an object of type QueryParameterSubSchema if possible, returning an error if not. -func NewQueryParameterSubSchema(in interface{}, context *compiler.Context) (*QueryParameterSubSchema, error) { +func NewQueryParameterSubSchema(in *yaml.Node, context *compiler.Context) (*QueryParameterSubSchema, error) { errors := make([]error, 0) x := &QueryParameterSubSchema{} m, ok := compiler.UnpackMap(in) @@ -4300,75 +4114,75 @@ func NewQueryParameterSubSchema(in interface{}, context *compiler.Context) (*Que // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { - x.Required, ok = v1.(bool) + x.Required, ok = compiler.BoolForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { - x.In, ok = v2.(string) + x.In, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [query] if ok && !compiler.StringArrayContainsValue([]string{"query"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { - x.Description, ok = v3.(string) + x.Description, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { - x.Name, ok = v4.(string) + x.Name, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // bool allow_empty_value = 5; v5 := compiler.MapValueForKey(m, "allowEmptyValue") if v5 != nil { - x.AllowEmptyValue, ok = v5.(bool) + x.AllowEmptyValue, ok = compiler.BoolForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for allowEmptyValue: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for allowEmptyValue: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 6; v6 := compiler.MapValueForKey(m, "type") if v6 != nil { - x.Type, ok = v6.(string) + x.Type, ok = compiler.StringForScalarNode(v6) if !ok { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) + message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 7; v7 := compiler.MapValueForKey(m, "format") if v7 != nil { - x.Format, ok = v7.(string) + x.Format, ok = compiler.StringForScalarNode(v7) if !ok { - message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v7, v7) + message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } @@ -4384,15 +4198,15 @@ func NewQueryParameterSubSchema(in interface{}, context *compiler.Context) (*Que // string collection_format = 9; v9 := compiler.MapValueForKey(m, "collectionFormat") if v9 != nil { - x.CollectionFormat, ok = v9.(string) + x.CollectionFormat, ok = compiler.StringForScalarNode(v9) if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes multi] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes", "multi"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9) + message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } @@ -4408,126 +4222,102 @@ func NewQueryParameterSubSchema(in interface{}, context *compiler.Context) (*Que // float maximum = 11; v11 := compiler.MapValueForKey(m, "maximum") if v11 != nil { - switch v11 := v11.(type) { - case float64: - x.Maximum = v11 - case float32: - x.Maximum = float64(v11) - case uint64: - x.Maximum = float64(v11) - case uint32: - x.Maximum = float64(v11) - case int64: - x.Maximum = float64(v11) - case int32: - x.Maximum = float64(v11) - case int: - x.Maximum = float64(v11) - default: - message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v11, v11) + v, ok := compiler.FloatForScalarNode(v11) + if ok { + x.Maximum = v + } else { + message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 12; v12 := compiler.MapValueForKey(m, "exclusiveMaximum") if v12 != nil { - x.ExclusiveMaximum, ok = v12.(bool) + x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v12) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v12, v12) + message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 13; v13 := compiler.MapValueForKey(m, "minimum") if v13 != nil { - switch v13 := v13.(type) { - case float64: - x.Minimum = v13 - case float32: - x.Minimum = float64(v13) - case uint64: - x.Minimum = float64(v13) - case uint32: - x.Minimum = float64(v13) - case int64: - x.Minimum = float64(v13) - case int32: - x.Minimum = float64(v13) - case int: - x.Minimum = float64(v13) - default: - message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v13, v13) + v, ok := compiler.FloatForScalarNode(v13) + if ok { + x.Minimum = v + } else { + message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 14; v14 := compiler.MapValueForKey(m, "exclusiveMinimum") if v14 != nil { - x.ExclusiveMinimum, ok = v14.(bool) + x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v14) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v14, v14) + message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 15; v15 := compiler.MapValueForKey(m, "maxLength") if v15 != nil { - t, ok := v15.(int) + t, ok := compiler.IntForScalarNode(v15) if ok { x.MaxLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v15, v15) + message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 16; v16 := compiler.MapValueForKey(m, "minLength") if v16 != nil { - t, ok := v16.(int) + t, ok := compiler.IntForScalarNode(v16) if ok { x.MinLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v16, v16) + message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 17; v17 := compiler.MapValueForKey(m, "pattern") if v17 != nil { - x.Pattern, ok = v17.(string) + x.Pattern, ok = compiler.StringForScalarNode(v17) if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v17, v17) + message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 18; v18 := compiler.MapValueForKey(m, "maxItems") if v18 != nil { - t, ok := v18.(int) + t, ok := compiler.IntForScalarNode(v18) if ok { x.MaxItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v18, v18) + message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 19; v19 := compiler.MapValueForKey(m, "minItems") if v19 != nil { - t, ok := v19.(int) + t, ok := compiler.IntForScalarNode(v19) if ok { x.MinItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v19, v19) + message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 20; v20 := compiler.MapValueForKey(m, "uniqueItems") if v20 != nil { - x.UniqueItems, ok = v20.(bool) + x.UniqueItems, ok = compiler.BoolForScalarNode(v20) if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v20, v20) + message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v20)) errors = append(errors, compiler.NewError(context, message)) } } @@ -4536,9 +4326,9 @@ func NewQueryParameterSubSchema(in interface{}, context *compiler.Context) (*Que if v21 != nil { // repeated Any x.Enum = make([]*Any, 0) - a, ok := v21.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v21) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) @@ -4550,43 +4340,31 @@ func NewQueryParameterSubSchema(in interface{}, context *compiler.Context) (*Que // float multiple_of = 22; v22 := compiler.MapValueForKey(m, "multipleOf") if v22 != nil { - switch v22 := v22.(type) { - case float64: - x.MultipleOf = v22 - case float32: - x.MultipleOf = float64(v22) - case uint64: - x.MultipleOf = float64(v22) - case uint32: - x.MultipleOf = float64(v22) - case int64: - x.MultipleOf = float64(v22) - case int32: - x.MultipleOf = float64(v22) - case int: - x.MultipleOf = float64(v22) - default: - message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v22, v22) + v, ok := compiler.FloatForScalarNode(v22) + if ok { + x.MultipleOf = v + } else { + message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v22)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 23; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -4606,7 +4384,7 @@ func NewQueryParameterSubSchema(in interface{}, context *compiler.Context) (*Que } // NewResponse creates an object of type Response if possible, returning an error if not. -func NewResponse(in interface{}, context *compiler.Context) (*Response, error) { +func NewResponse(in *yaml.Node, context *compiler.Context) (*Response, error) { errors := make([]error, 0) x := &Response{} m, ok := compiler.UnpackMap(in) @@ -4630,9 +4408,9 @@ func NewResponse(in interface{}, context *compiler.Context) (*Response, error) { // string description = 1; v1 := compiler.MapValueForKey(m, "description") if v1 != nil { - x.Description, ok = v1.(string) + x.Description, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } @@ -4666,20 +4444,20 @@ func NewResponse(in interface{}, context *compiler.Context) (*Response, error) { // repeated NamedAny vendor_extension = 5; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -4699,7 +4477,7 @@ func NewResponse(in interface{}, context *compiler.Context) (*Response, error) { } // NewResponseDefinitions creates an object of type ResponseDefinitions if possible, returning an error if not. -func NewResponseDefinitions(in interface{}, context *compiler.Context) (*ResponseDefinitions, error) { +func NewResponseDefinitions(in *yaml.Node, context *compiler.Context) (*ResponseDefinitions, error) { errors := make([]error, 0) x := &ResponseDefinitions{} m, ok := compiler.UnpackMap(in) @@ -4710,10 +4488,10 @@ func NewResponseDefinitions(in interface{}, context *compiler.Context) (*Respons // repeated NamedResponse additional_properties = 1; // MAP: Response x.AdditionalProperties = make([]*NamedResponse, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedResponse{} pair.Name = k var err error @@ -4729,7 +4507,7 @@ func NewResponseDefinitions(in interface{}, context *compiler.Context) (*Respons } // NewResponseValue creates an object of type ResponseValue if possible, returning an error if not. -func NewResponseValue(in interface{}, context *compiler.Context) (*ResponseValue, error) { +func NewResponseValue(in *yaml.Node, context *compiler.Context) (*ResponseValue, error) { errors := make([]error, 0) x := &ResponseValue{} matched := false @@ -4769,7 +4547,7 @@ func NewResponseValue(in interface{}, context *compiler.Context) (*ResponseValue } // NewResponses creates an object of type Responses if possible, returning an error if not. -func NewResponses(in interface{}, context *compiler.Context) (*Responses, error) { +func NewResponses(in *yaml.Node, context *compiler.Context) (*Responses, error) { errors := make([]error, 0) x := &Responses{} m, ok := compiler.UnpackMap(in) @@ -4787,10 +4565,10 @@ func NewResponses(in interface{}, context *compiler.Context) (*Responses, error) // repeated NamedResponseValue response_code = 1; // MAP: ResponseValue ^([0-9]{3})$|^(default)$ x.ResponseCode = make([]*NamedResponseValue, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if pattern2.MatchString(k) { pair := &NamedResponseValue{} pair.Name = k @@ -4806,20 +4584,20 @@ func NewResponses(in interface{}, context *compiler.Context) (*Responses, error) // repeated NamedAny vendor_extension = 2; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -4839,7 +4617,7 @@ func NewResponses(in interface{}, context *compiler.Context) (*Responses, error) } // NewSchema creates an object of type Schema if possible, returning an error if not. -func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) { +func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { errors := make([]error, 0) x := &Schema{} m, ok := compiler.UnpackMap(in) @@ -4857,36 +4635,36 @@ func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) { // string _ref = 1; v1 := compiler.MapValueForKey(m, "$ref") if v1 != nil { - x.XRef, ok = v1.(string) + x.XRef, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for $ref: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 2; v2 := compiler.MapValueForKey(m, "format") if v2 != nil { - x.Format, ok = v2.(string) + x.Format, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string title = 3; v3 := compiler.MapValueForKey(m, "title") if v3 != nil { - x.Title, ok = v3.(string) + x.Title, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for title: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 4; v4 := compiler.MapValueForKey(m, "description") if v4 != nil { - x.Description, ok = v4.(string) + x.Description, ok = compiler.StringForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } @@ -4902,182 +4680,146 @@ func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) { // float multiple_of = 6; v6 := compiler.MapValueForKey(m, "multipleOf") if v6 != nil { - switch v6 := v6.(type) { - case float64: - x.MultipleOf = v6 - case float32: - x.MultipleOf = float64(v6) - case uint64: - x.MultipleOf = float64(v6) - case uint32: - x.MultipleOf = float64(v6) - case int64: - x.MultipleOf = float64(v6) - case int32: - x.MultipleOf = float64(v6) - case int: - x.MultipleOf = float64(v6) - default: - message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v6, v6) + v, ok := compiler.FloatForScalarNode(v6) + if ok { + x.MultipleOf = v + } else { + message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // float maximum = 7; v7 := compiler.MapValueForKey(m, "maximum") if v7 != nil { - switch v7 := v7.(type) { - case float64: - x.Maximum = v7 - case float32: - x.Maximum = float64(v7) - case uint64: - x.Maximum = float64(v7) - case uint32: - x.Maximum = float64(v7) - case int64: - x.Maximum = float64(v7) - case int32: - x.Maximum = float64(v7) - case int: - x.Maximum = float64(v7) - default: - message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v7, v7) + v, ok := compiler.FloatForScalarNode(v7) + if ok { + x.Maximum = v + } else { + message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 8; v8 := compiler.MapValueForKey(m, "exclusiveMaximum") if v8 != nil { - x.ExclusiveMaximum, ok = v8.(bool) + x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v8) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v8, v8) + message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 9; v9 := compiler.MapValueForKey(m, "minimum") if v9 != nil { - switch v9 := v9.(type) { - case float64: - x.Minimum = v9 - case float32: - x.Minimum = float64(v9) - case uint64: - x.Minimum = float64(v9) - case uint32: - x.Minimum = float64(v9) - case int64: - x.Minimum = float64(v9) - case int32: - x.Minimum = float64(v9) - case int: - x.Minimum = float64(v9) - default: - message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v9, v9) + v, ok := compiler.FloatForScalarNode(v9) + if ok { + x.Minimum = v + } else { + message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 10; v10 := compiler.MapValueForKey(m, "exclusiveMinimum") if v10 != nil { - x.ExclusiveMinimum, ok = v10.(bool) + x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v10) if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v10, v10) + message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 11; v11 := compiler.MapValueForKey(m, "maxLength") if v11 != nil { - t, ok := v11.(int) + t, ok := compiler.IntForScalarNode(v11) if ok { x.MaxLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v11, v11) + message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 12; v12 := compiler.MapValueForKey(m, "minLength") if v12 != nil { - t, ok := v12.(int) + t, ok := compiler.IntForScalarNode(v12) if ok { x.MinLength = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v12, v12) + message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 13; v13 := compiler.MapValueForKey(m, "pattern") if v13 != nil { - x.Pattern, ok = v13.(string) + x.Pattern, ok = compiler.StringForScalarNode(v13) if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v13, v13) + message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 14; v14 := compiler.MapValueForKey(m, "maxItems") if v14 != nil { - t, ok := v14.(int) + t, ok := compiler.IntForScalarNode(v14) if ok { x.MaxItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v14, v14) + message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 15; v15 := compiler.MapValueForKey(m, "minItems") if v15 != nil { - t, ok := v15.(int) + t, ok := compiler.IntForScalarNode(v15) if ok { x.MinItems = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v15, v15) + message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 16; v16 := compiler.MapValueForKey(m, "uniqueItems") if v16 != nil { - x.UniqueItems, ok = v16.(bool) + x.UniqueItems, ok = compiler.BoolForScalarNode(v16) if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v16, v16) + message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_properties = 17; v17 := compiler.MapValueForKey(m, "maxProperties") if v17 != nil { - t, ok := v17.(int) + t, ok := compiler.IntForScalarNode(v17) if ok { x.MaxProperties = int64(t) } else { - message := fmt.Sprintf("has unexpected value for maxProperties: %+v (%T)", v17, v17) + message := fmt.Sprintf("has unexpected value for maxProperties: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_properties = 18; v18 := compiler.MapValueForKey(m, "minProperties") if v18 != nil { - t, ok := v18.(int) + t, ok := compiler.IntForScalarNode(v18) if ok { x.MinProperties = int64(t) } else { - message := fmt.Sprintf("has unexpected value for minProperties: %+v (%T)", v18, v18) + message := fmt.Sprintf("has unexpected value for minProperties: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string required = 19; v19 := compiler.MapValueForKey(m, "required") if v19 != nil { - v, ok := v19.([]interface{}) + v, ok := compiler.SequenceNodeForNode(v19) if ok { - x.Required = compiler.ConvertInterfaceArrayToStringArray(v) + x.Required = compiler.StringArrayForSequenceNode(v) } else { - message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v19, v19) + message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } @@ -5086,9 +4828,9 @@ func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) { if v20 != nil { // repeated Any x.Enum = make([]*Any, 0) - a, ok := v20.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v20) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) @@ -5129,9 +4871,9 @@ func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) { if v24 != nil { // repeated Schema x.AllOf = make([]*Schema, 0) - a, ok := v24.([]interface{}) + a, ok := compiler.SequenceNodeForNode(v24) if ok { - for _, item := range a { + for _, item := range a.Content { y, err := NewSchema(item, compiler.NewContext("allOf", context)) if err != nil { errors = append(errors, err) @@ -5152,18 +4894,18 @@ func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) { // string discriminator = 26; v26 := compiler.MapValueForKey(m, "discriminator") if v26 != nil { - x.Discriminator, ok = v26.(string) + x.Discriminator, ok = compiler.StringForScalarNode(v26) if !ok { - message := fmt.Sprintf("has unexpected value for discriminator: %+v (%T)", v26, v26) + message := fmt.Sprintf("has unexpected value for discriminator: %s", compiler.Display(v26)) errors = append(errors, compiler.NewError(context, message)) } } // bool read_only = 27; v27 := compiler.MapValueForKey(m, "readOnly") if v27 != nil { - x.ReadOnly, ok = v27.(bool) + x.ReadOnly, ok = compiler.BoolForScalarNode(v27) if !ok { - message := fmt.Sprintf("has unexpected value for readOnly: %+v (%T)", v27, v27) + message := fmt.Sprintf("has unexpected value for readOnly: %s", compiler.Display(v27)) errors = append(errors, compiler.NewError(context, message)) } } @@ -5197,20 +4939,20 @@ func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) { // repeated NamedAny vendor_extension = 31; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -5230,7 +4972,7 @@ func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) { } // NewSchemaItem creates an object of type SchemaItem if possible, returning an error if not. -func NewSchemaItem(in interface{}, context *compiler.Context) (*SchemaItem, error) { +func NewSchemaItem(in *yaml.Node, context *compiler.Context) (*SchemaItem, error) { errors := make([]error, 0) x := &SchemaItem{} matched := false @@ -5270,7 +5012,7 @@ func NewSchemaItem(in interface{}, context *compiler.Context) (*SchemaItem, erro } // NewSecurityDefinitions creates an object of type SecurityDefinitions if possible, returning an error if not. -func NewSecurityDefinitions(in interface{}, context *compiler.Context) (*SecurityDefinitions, error) { +func NewSecurityDefinitions(in *yaml.Node, context *compiler.Context) (*SecurityDefinitions, error) { errors := make([]error, 0) x := &SecurityDefinitions{} m, ok := compiler.UnpackMap(in) @@ -5281,10 +5023,10 @@ func NewSecurityDefinitions(in interface{}, context *compiler.Context) (*Securit // repeated NamedSecurityDefinitionsItem additional_properties = 1; // MAP: SecurityDefinitionsItem x.AdditionalProperties = make([]*NamedSecurityDefinitionsItem, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedSecurityDefinitionsItem{} pair.Name = k var err error @@ -5300,7 +5042,7 @@ func NewSecurityDefinitions(in interface{}, context *compiler.Context) (*Securit } // NewSecurityDefinitionsItem creates an object of type SecurityDefinitionsItem if possible, returning an error if not. -func NewSecurityDefinitionsItem(in interface{}, context *compiler.Context) (*SecurityDefinitionsItem, error) { +func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*SecurityDefinitionsItem, error) { errors := make([]error, 0) x := &SecurityDefinitionsItem{} matched := false @@ -5396,7 +5138,7 @@ func NewSecurityDefinitionsItem(in interface{}, context *compiler.Context) (*Sec } // NewSecurityRequirement creates an object of type SecurityRequirement if possible, returning an error if not. -func NewSecurityRequirement(in interface{}, context *compiler.Context) (*SecurityRequirement, error) { +func NewSecurityRequirement(in *yaml.Node, context *compiler.Context) (*SecurityRequirement, error) { errors := make([]error, 0) x := &SecurityRequirement{} m, ok := compiler.UnpackMap(in) @@ -5407,10 +5149,10 @@ func NewSecurityRequirement(in interface{}, context *compiler.Context) (*Securit // repeated NamedStringArray additional_properties = 1; // MAP: StringArray x.AdditionalProperties = make([]*NamedStringArray, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedStringArray{} pair.Name = k var err error @@ -5426,24 +5168,19 @@ func NewSecurityRequirement(in interface{}, context *compiler.Context) (*Securit } // NewStringArray creates an object of type StringArray if possible, returning an error if not. -func NewStringArray(in interface{}, context *compiler.Context) (*StringArray, error) { +func NewStringArray(in *yaml.Node, context *compiler.Context) (*StringArray, error) { errors := make([]error, 0) x := &StringArray{} - a, ok := in.([]interface{}) - if !ok { - message := fmt.Sprintf("has unexpected value for StringArray: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - x.Value = make([]string, 0) - for _, s := range a { - x.Value = append(x.Value, s.(string)) - } + x.Value = make([]string, 0) + for _, node := range in.Content { + s, _ := compiler.StringForScalarNode(node) + x.Value = append(x.Value, s) } return x, compiler.NewErrorGroupOrNil(errors) } // NewTag creates an object of type Tag if possible, returning an error if not. -func NewTag(in interface{}, context *compiler.Context) (*Tag, error) { +func NewTag(in *yaml.Node, context *compiler.Context) (*Tag, error) { errors := make([]error, 0) x := &Tag{} m, ok := compiler.UnpackMap(in) @@ -5467,18 +5204,18 @@ func NewTag(in interface{}, context *compiler.Context) (*Tag, error) { // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 2; v2 := compiler.MapValueForKey(m, "description") if v2 != nil { - x.Description, ok = v2.(string) + x.Description, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } @@ -5494,20 +5231,20 @@ func NewTag(in interface{}, context *compiler.Context) (*Tag, error) { // repeated NamedAny vendor_extension = 4; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -5527,17 +5264,19 @@ func NewTag(in interface{}, context *compiler.Context) (*Tag, error) { } // NewTypeItem creates an object of type TypeItem if possible, returning an error if not. -func NewTypeItem(in interface{}, context *compiler.Context) (*TypeItem, error) { +func NewTypeItem(in *yaml.Node, context *compiler.Context) (*TypeItem, error) { errors := make([]error, 0) x := &TypeItem{} - switch in := in.(type) { - case string: + v1 := in + switch v1.Kind { + case yaml.ScalarNode: x.Value = make([]string, 0) - x.Value = append(x.Value, in) - case []interface{}: + x.Value = append(x.Value, v1.Value) + case yaml.SequenceNode: x.Value = make([]string, 0) - for _, v := range in { - value, ok := v.(string) + for _, v := range v1.Content { + value := v.Value + ok := v.Kind == yaml.ScalarNode if ok { x.Value = append(x.Value, value) } else { @@ -5553,7 +5292,7 @@ func NewTypeItem(in interface{}, context *compiler.Context) (*TypeItem, error) { } // NewVendorExtension creates an object of type VendorExtension if possible, returning an error if not. -func NewVendorExtension(in interface{}, context *compiler.Context) (*VendorExtension, error) { +func NewVendorExtension(in *yaml.Node, context *compiler.Context) (*VendorExtension, error) { errors := make([]error, 0) x := &VendorExtension{} m, ok := compiler.UnpackMap(in) @@ -5564,19 +5303,19 @@ func NewVendorExtension(in interface{}, context *compiler.Context) (*VendorExten // repeated NamedAny additional_properties = 1; // MAP: Any x.AdditionalProperties = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -5595,7 +5334,7 @@ func NewVendorExtension(in interface{}, context *compiler.Context) (*VendorExten } // NewXml creates an object of type Xml if possible, returning an error if not. -func NewXml(in interface{}, context *compiler.Context) (*Xml, error) { +func NewXml(in *yaml.Node, context *compiler.Context) (*Xml, error) { errors := make([]error, 0) x := &Xml{} m, ok := compiler.UnpackMap(in) @@ -5613,65 +5352,65 @@ func NewXml(in interface{}, context *compiler.Context) (*Xml, error) { // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { - x.Name, ok = v1.(string) + x.Name, ok = compiler.StringForScalarNode(v1) if !ok { - message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) + message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string namespace = 2; v2 := compiler.MapValueForKey(m, "namespace") if v2 != nil { - x.Namespace, ok = v2.(string) + x.Namespace, ok = compiler.StringForScalarNode(v2) if !ok { - message := fmt.Sprintf("has unexpected value for namespace: %+v (%T)", v2, v2) + message := fmt.Sprintf("has unexpected value for namespace: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string prefix = 3; v3 := compiler.MapValueForKey(m, "prefix") if v3 != nil { - x.Prefix, ok = v3.(string) + x.Prefix, ok = compiler.StringForScalarNode(v3) if !ok { - message := fmt.Sprintf("has unexpected value for prefix: %+v (%T)", v3, v3) + message := fmt.Sprintf("has unexpected value for prefix: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // bool attribute = 4; v4 := compiler.MapValueForKey(m, "attribute") if v4 != nil { - x.Attribute, ok = v4.(bool) + x.Attribute, ok = compiler.BoolForScalarNode(v4) if !ok { - message := fmt.Sprintf("has unexpected value for attribute: %+v (%T)", v4, v4) + message := fmt.Sprintf("has unexpected value for attribute: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // bool wrapped = 5; v5 := compiler.MapValueForKey(m, "wrapped") if v5 != nil { - x.Wrapped, ok = v5.(bool) + x.Wrapped, ok = compiler.BoolForScalarNode(v5) if !ok { - message := fmt.Sprintf("has unexpected value for wrapped: %+v (%T)", v5, v5) + message := fmt.Sprintf("has unexpected value for wrapped: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) - for _, item := range m { - k, ok := compiler.StringValue(item.Key) + for i := 0; i < len(m.Content); i += 2 { + k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { - v := item.Value + v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} - handled, resultFromExt, err := compiler.HandleExtension(context, v, k) + handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { - bytes, _ := yaml.Marshal(v) + bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result @@ -5691,7 +5430,7 @@ func NewXml(in interface{}, context *compiler.Context) (*Xml, error) { } // ResolveReferences resolves references found inside AdditionalPropertiesItem objects. -func (m *AdditionalPropertiesItem) ResolveReferences(root string) (interface{}, error) { +func (m *AdditionalPropertiesItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*AdditionalPropertiesItem_Schema) @@ -5706,13 +5445,13 @@ func (m *AdditionalPropertiesItem) ResolveReferences(root string) (interface{}, } // ResolveReferences resolves references found inside Any objects. -func (m *Any) ResolveReferences(root string) (interface{}, error) { +func (m *Any) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ApiKeySecurity objects. -func (m *ApiKeySecurity) ResolveReferences(root string) (interface{}, error) { +func (m *ApiKeySecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { @@ -5726,7 +5465,7 @@ func (m *ApiKeySecurity) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside BasicAuthenticationSecurity objects. -func (m *BasicAuthenticationSecurity) ResolveReferences(root string) (interface{}, error) { +func (m *BasicAuthenticationSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { @@ -5740,7 +5479,7 @@ func (m *BasicAuthenticationSecurity) ResolveReferences(root string) (interface{ } // ResolveReferences resolves references found inside BodyParameter objects. -func (m *BodyParameter) ResolveReferences(root string) (interface{}, error) { +func (m *BodyParameter) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Schema != nil { _, err := m.Schema.ResolveReferences(root) @@ -5760,7 +5499,7 @@ func (m *BodyParameter) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Contact objects. -func (m *Contact) ResolveReferences(root string) (interface{}, error) { +func (m *Contact) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { @@ -5774,7 +5513,7 @@ func (m *Contact) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Default objects. -func (m *Default) ResolveReferences(root string) (interface{}, error) { +func (m *Default) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -5788,7 +5527,7 @@ func (m *Default) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Definitions objects. -func (m *Definitions) ResolveReferences(root string) (interface{}, error) { +func (m *Definitions) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -5802,7 +5541,7 @@ func (m *Definitions) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Document objects. -func (m *Document) ResolveReferences(root string) (interface{}, error) { +func (m *Document) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Info != nil { _, err := m.Info.ResolveReferences(root) @@ -5874,7 +5613,7 @@ func (m *Document) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Examples objects. -func (m *Examples) ResolveReferences(root string) (interface{}, error) { +func (m *Examples) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -5888,7 +5627,7 @@ func (m *Examples) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside ExternalDocs objects. -func (m *ExternalDocs) ResolveReferences(root string) (interface{}, error) { +func (m *ExternalDocs) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { @@ -5902,7 +5641,7 @@ func (m *ExternalDocs) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside FileSchema objects. -func (m *FileSchema) ResolveReferences(root string) (interface{}, error) { +func (m *FileSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Default != nil { _, err := m.Default.ResolveReferences(root) @@ -5934,7 +5673,7 @@ func (m *FileSchema) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside FormDataParameterSubSchema objects. -func (m *FormDataParameterSubSchema) ResolveReferences(root string) (interface{}, error) { +func (m *FormDataParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) @@ -5968,7 +5707,7 @@ func (m *FormDataParameterSubSchema) ResolveReferences(root string) (interface{} } // ResolveReferences resolves references found inside Header objects. -func (m *Header) ResolveReferences(root string) (interface{}, error) { +func (m *Header) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) @@ -6002,7 +5741,7 @@ func (m *Header) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside HeaderParameterSubSchema objects. -func (m *HeaderParameterSubSchema) ResolveReferences(root string) (interface{}, error) { +func (m *HeaderParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) @@ -6036,7 +5775,7 @@ func (m *HeaderParameterSubSchema) ResolveReferences(root string) (interface{}, } // ResolveReferences resolves references found inside Headers objects. -func (m *Headers) ResolveReferences(root string) (interface{}, error) { +func (m *Headers) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -6050,7 +5789,7 @@ func (m *Headers) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Info objects. -func (m *Info) ResolveReferences(root string) (interface{}, error) { +func (m *Info) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Contact != nil { _, err := m.Contact.ResolveReferences(root) @@ -6076,7 +5815,7 @@ func (m *Info) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside ItemsItem objects. -func (m *ItemsItem) ResolveReferences(root string) (interface{}, error) { +func (m *ItemsItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.Schema { if item != nil { @@ -6090,7 +5829,7 @@ func (m *ItemsItem) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside JsonReference objects. -func (m *JsonReference) ResolveReferences(root string) (interface{}, error) { +func (m *JsonReference) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.XRef != "" { info, err := compiler.ReadInfoForRef(root, m.XRef) @@ -6110,7 +5849,7 @@ func (m *JsonReference) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside License objects. -func (m *License) ResolveReferences(root string) (interface{}, error) { +func (m *License) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { @@ -6124,7 +5863,7 @@ func (m *License) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside NamedAny objects. -func (m *NamedAny) ResolveReferences(root string) (interface{}, error) { +func (m *NamedAny) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) @@ -6136,7 +5875,7 @@ func (m *NamedAny) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside NamedHeader objects. -func (m *NamedHeader) ResolveReferences(root string) (interface{}, error) { +func (m *NamedHeader) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) @@ -6148,7 +5887,7 @@ func (m *NamedHeader) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside NamedParameter objects. -func (m *NamedParameter) ResolveReferences(root string) (interface{}, error) { +func (m *NamedParameter) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) @@ -6160,7 +5899,7 @@ func (m *NamedParameter) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside NamedPathItem objects. -func (m *NamedPathItem) ResolveReferences(root string) (interface{}, error) { +func (m *NamedPathItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) @@ -6172,7 +5911,7 @@ func (m *NamedPathItem) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside NamedResponse objects. -func (m *NamedResponse) ResolveReferences(root string) (interface{}, error) { +func (m *NamedResponse) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) @@ -6184,7 +5923,7 @@ func (m *NamedResponse) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside NamedResponseValue objects. -func (m *NamedResponseValue) ResolveReferences(root string) (interface{}, error) { +func (m *NamedResponseValue) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) @@ -6196,7 +5935,7 @@ func (m *NamedResponseValue) ResolveReferences(root string) (interface{}, error) } // ResolveReferences resolves references found inside NamedSchema objects. -func (m *NamedSchema) ResolveReferences(root string) (interface{}, error) { +func (m *NamedSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) @@ -6208,7 +5947,7 @@ func (m *NamedSchema) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside NamedSecurityDefinitionsItem objects. -func (m *NamedSecurityDefinitionsItem) ResolveReferences(root string) (interface{}, error) { +func (m *NamedSecurityDefinitionsItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) @@ -6220,13 +5959,13 @@ func (m *NamedSecurityDefinitionsItem) ResolveReferences(root string) (interface } // ResolveReferences resolves references found inside NamedString objects. -func (m *NamedString) ResolveReferences(root string) (interface{}, error) { +func (m *NamedString) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedStringArray objects. -func (m *NamedStringArray) ResolveReferences(root string) (interface{}, error) { +func (m *NamedStringArray) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) @@ -6238,7 +5977,7 @@ func (m *NamedStringArray) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside NonBodyParameter objects. -func (m *NonBodyParameter) ResolveReferences(root string) (interface{}, error) { +func (m *NonBodyParameter) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*NonBodyParameter_HeaderParameterSubSchema) @@ -6280,7 +6019,7 @@ func (m *NonBodyParameter) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Oauth2AccessCodeSecurity objects. -func (m *Oauth2AccessCodeSecurity) ResolveReferences(root string) (interface{}, error) { +func (m *Oauth2AccessCodeSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) @@ -6300,7 +6039,7 @@ func (m *Oauth2AccessCodeSecurity) ResolveReferences(root string) (interface{}, } // ResolveReferences resolves references found inside Oauth2ApplicationSecurity objects. -func (m *Oauth2ApplicationSecurity) ResolveReferences(root string) (interface{}, error) { +func (m *Oauth2ApplicationSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) @@ -6320,7 +6059,7 @@ func (m *Oauth2ApplicationSecurity) ResolveReferences(root string) (interface{}, } // ResolveReferences resolves references found inside Oauth2ImplicitSecurity objects. -func (m *Oauth2ImplicitSecurity) ResolveReferences(root string) (interface{}, error) { +func (m *Oauth2ImplicitSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) @@ -6340,7 +6079,7 @@ func (m *Oauth2ImplicitSecurity) ResolveReferences(root string) (interface{}, er } // ResolveReferences resolves references found inside Oauth2PasswordSecurity objects. -func (m *Oauth2PasswordSecurity) ResolveReferences(root string) (interface{}, error) { +func (m *Oauth2PasswordSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) @@ -6360,7 +6099,7 @@ func (m *Oauth2PasswordSecurity) ResolveReferences(root string) (interface{}, er } // ResolveReferences resolves references found inside Oauth2Scopes objects. -func (m *Oauth2Scopes) ResolveReferences(root string) (interface{}, error) { +func (m *Oauth2Scopes) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -6374,7 +6113,7 @@ func (m *Oauth2Scopes) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Operation objects. -func (m *Operation) ResolveReferences(root string) (interface{}, error) { +func (m *Operation) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) @@ -6416,7 +6155,7 @@ func (m *Operation) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Parameter objects. -func (m *Parameter) ResolveReferences(root string) (interface{}, error) { +func (m *Parameter) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*Parameter_BodyParameter) @@ -6440,7 +6179,7 @@ func (m *Parameter) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside ParameterDefinitions objects. -func (m *ParameterDefinitions) ResolveReferences(root string) (interface{}, error) { +func (m *ParameterDefinitions) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -6454,7 +6193,7 @@ func (m *ParameterDefinitions) ResolveReferences(root string) (interface{}, erro } // ResolveReferences resolves references found inside ParametersItem objects. -func (m *ParametersItem) ResolveReferences(root string) (interface{}, error) { +func (m *ParametersItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*ParametersItem_Parameter) @@ -6486,7 +6225,7 @@ func (m *ParametersItem) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside PathItem objects. -func (m *PathItem) ResolveReferences(root string) (interface{}, error) { +func (m *PathItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.XRef != "" { info, err := compiler.ReadInfoForRef(root, m.XRef) @@ -6564,7 +6303,7 @@ func (m *PathItem) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside PathParameterSubSchema objects. -func (m *PathParameterSubSchema) ResolveReferences(root string) (interface{}, error) { +func (m *PathParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) @@ -6598,7 +6337,7 @@ func (m *PathParameterSubSchema) ResolveReferences(root string) (interface{}, er } // ResolveReferences resolves references found inside Paths objects. -func (m *Paths) ResolveReferences(root string) (interface{}, error) { +func (m *Paths) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { @@ -6620,7 +6359,7 @@ func (m *Paths) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside PrimitivesItems objects. -func (m *PrimitivesItems) ResolveReferences(root string) (interface{}, error) { +func (m *PrimitivesItems) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) @@ -6654,7 +6393,7 @@ func (m *PrimitivesItems) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Properties objects. -func (m *Properties) ResolveReferences(root string) (interface{}, error) { +func (m *Properties) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -6668,7 +6407,7 @@ func (m *Properties) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside QueryParameterSubSchema objects. -func (m *QueryParameterSubSchema) ResolveReferences(root string) (interface{}, error) { +func (m *QueryParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) @@ -6702,7 +6441,7 @@ func (m *QueryParameterSubSchema) ResolveReferences(root string) (interface{}, e } // ResolveReferences resolves references found inside Response objects. -func (m *Response) ResolveReferences(root string) (interface{}, error) { +func (m *Response) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Schema != nil { _, err := m.Schema.ResolveReferences(root) @@ -6734,7 +6473,7 @@ func (m *Response) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside ResponseDefinitions objects. -func (m *ResponseDefinitions) ResolveReferences(root string) (interface{}, error) { +func (m *ResponseDefinitions) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -6748,7 +6487,7 @@ func (m *ResponseDefinitions) ResolveReferences(root string) (interface{}, error } // ResolveReferences resolves references found inside ResponseValue objects. -func (m *ResponseValue) ResolveReferences(root string) (interface{}, error) { +func (m *ResponseValue) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*ResponseValue_Response) @@ -6780,7 +6519,7 @@ func (m *ResponseValue) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Responses objects. -func (m *Responses) ResolveReferences(root string) (interface{}, error) { +func (m *Responses) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.ResponseCode { if item != nil { @@ -6802,7 +6541,7 @@ func (m *Responses) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Schema objects. -func (m *Schema) ResolveReferences(root string) (interface{}, error) { +func (m *Schema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.XRef != "" { info, err := compiler.ReadInfoForRef(root, m.XRef) @@ -6894,7 +6633,7 @@ func (m *Schema) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside SchemaItem objects. -func (m *SchemaItem) ResolveReferences(root string) (interface{}, error) { +func (m *SchemaItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*SchemaItem_Schema) @@ -6918,7 +6657,7 @@ func (m *SchemaItem) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside SecurityDefinitions objects. -func (m *SecurityDefinitions) ResolveReferences(root string) (interface{}, error) { +func (m *SecurityDefinitions) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -6932,7 +6671,7 @@ func (m *SecurityDefinitions) ResolveReferences(root string) (interface{}, error } // ResolveReferences resolves references found inside SecurityDefinitionsItem objects. -func (m *SecurityDefinitionsItem) ResolveReferences(root string) (interface{}, error) { +func (m *SecurityDefinitionsItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*SecurityDefinitionsItem_BasicAuthenticationSecurity) @@ -6992,7 +6731,7 @@ func (m *SecurityDefinitionsItem) ResolveReferences(root string) (interface{}, e } // ResolveReferences resolves references found inside SecurityRequirement objects. -func (m *SecurityRequirement) ResolveReferences(root string) (interface{}, error) { +func (m *SecurityRequirement) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -7006,13 +6745,13 @@ func (m *SecurityRequirement) ResolveReferences(root string) (interface{}, error } // ResolveReferences resolves references found inside StringArray objects. -func (m *StringArray) ResolveReferences(root string) (interface{}, error) { +func (m *StringArray) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Tag objects. -func (m *Tag) ResolveReferences(root string) (interface{}, error) { +func (m *Tag) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) @@ -7032,13 +6771,13 @@ func (m *Tag) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside TypeItem objects. -func (m *TypeItem) ResolveReferences(root string) (interface{}, error) { +func (m *TypeItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside VendorExtension objects. -func (m *VendorExtension) ResolveReferences(root string) (interface{}, error) { +func (m *VendorExtension) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { @@ -7052,7 +6791,7 @@ func (m *VendorExtension) ResolveReferences(root string) (interface{}, error) { } // ResolveReferences resolves references found inside Xml objects. -func (m *Xml) ResolveReferences(root string) (interface{}, error) { +func (m *Xml) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { @@ -7066,7 +6805,7 @@ func (m *Xml) ResolveReferences(root string) (interface{}, error) { } // ToRawInfo returns a description of AdditionalPropertiesItem suitable for JSON or YAML export. -func (m *AdditionalPropertiesItem) ToRawInfo() interface{} { +func (m *AdditionalPropertiesItem) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // AdditionalPropertiesItem // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} @@ -7076,792 +6815,885 @@ func (m *AdditionalPropertiesItem) ToRawInfo() interface{} { } // {Name:boolean Type:bool StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if v1, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { - return v1.Boolean + return compiler.NewScalarNodeForBool(v1.Boolean) } return nil } // ToRawInfo returns a description of Any suitable for JSON or YAML export. -func (m *Any) ToRawInfo() interface{} { +func (m *Any) ToRawInfo() *yaml.Node { var err error - var info1 []yaml.MapSlice - err = yaml.Unmarshal([]byte(m.Yaml), &info1) + var node yaml.Node + err = yaml.Unmarshal([]byte(m.Yaml), &node) if err == nil { - return info1 - } - var info2 yaml.MapSlice - err = yaml.Unmarshal([]byte(m.Yaml), &info2) - if err == nil { - return info2 - } - var info3 interface{} - err = yaml.Unmarshal([]byte(m.Yaml), &info3) - if err == nil { - return info3 + if node.Kind == yaml.DocumentNode { + return node.Content[0] + } + return &node + } else { + return nil } return nil } // ToRawInfo returns a description of ApiKeySecurity suitable for JSON or YAML export. -func (m *ApiKeySecurity) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *ApiKeySecurity) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) // always include this required field. - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of BasicAuthenticationSecurity suitable for JSON or YAML export. -func (m *BasicAuthenticationSecurity) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *BasicAuthenticationSecurity) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of BodyParameter suitable for JSON or YAML export. -func (m *BodyParameter) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *BodyParameter) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } // always include this required field. - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) // always include this required field. - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) if m.Required != false { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) } // always include this required field. - info = append(info, yaml.MapItem{Key: "schema", Value: m.Schema.ToRawInfo()}) - // &{Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} + info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) + info.Content = append(info.Content, m.Schema.ToRawInfo()) if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Contact suitable for JSON or YAML export. -func (m *Contact) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Contact) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Url != "" { - info = append(info, yaml.MapItem{Key: "url", Value: m.Url}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) } if m.Email != "" { - info = append(info, yaml.MapItem{Key: "email", Value: m.Email}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("email")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Email)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Default suitable for JSON or YAML export. -func (m *Default) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Default) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:false Description:} return info } // ToRawInfo returns a description of Definitions suitable for JSON or YAML export. -func (m *Definitions) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Definitions) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedSchema StringEnumValues:[] MapType:Schema Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of Document suitable for JSON or YAML export. -func (m *Document) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Document) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "swagger", Value: m.Swagger}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("swagger")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Swagger)) // always include this required field. - info = append(info, yaml.MapItem{Key: "info", Value: m.Info.ToRawInfo()}) - // &{Name:info Type:Info StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} + info.Content = append(info.Content, compiler.NewScalarNodeForString("info")) + info.Content = append(info.Content, m.Info.ToRawInfo()) if m.Host != "" { - info = append(info, yaml.MapItem{Key: "host", Value: m.Host}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("host")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Host)) } if m.BasePath != "" { - info = append(info, yaml.MapItem{Key: "basePath", Value: m.BasePath}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("basePath")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.BasePath)) } if len(m.Schemes) != 0 { - info = append(info, yaml.MapItem{Key: "schemes", Value: m.Schemes}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("schemes")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Schemes)) } if len(m.Consumes) != 0 { - info = append(info, yaml.MapItem{Key: "consumes", Value: m.Consumes}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("consumes")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Consumes)) } if len(m.Produces) != 0 { - info = append(info, yaml.MapItem{Key: "produces", Value: m.Produces}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("produces")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Produces)) } // always include this required field. - info = append(info, yaml.MapItem{Key: "paths", Value: m.Paths.ToRawInfo()}) - // &{Name:paths Type:Paths StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} + info.Content = append(info.Content, compiler.NewScalarNodeForString("paths")) + info.Content = append(info.Content, m.Paths.ToRawInfo()) if m.Definitions != nil { - info = append(info, yaml.MapItem{Key: "definitions", Value: m.Definitions.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("definitions")) + info.Content = append(info.Content, m.Definitions.ToRawInfo()) } - // &{Name:definitions Type:Definitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Parameters != nil { - info = append(info, yaml.MapItem{Key: "parameters", Value: m.Parameters.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) + info.Content = append(info.Content, m.Parameters.ToRawInfo()) } - // &{Name:parameters Type:ParameterDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Responses != nil { - info = append(info, yaml.MapItem{Key: "responses", Value: m.Responses.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("responses")) + info.Content = append(info.Content, m.Responses.ToRawInfo()) } - // &{Name:responses Type:ResponseDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Security) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Security { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "security", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("security")) + info.Content = append(info.Content, items) } - // &{Name:security Type:SecurityRequirement StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.SecurityDefinitions != nil { - info = append(info, yaml.MapItem{Key: "securityDefinitions", Value: m.SecurityDefinitions.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("securityDefinitions")) + info.Content = append(info.Content, m.SecurityDefinitions.ToRawInfo()) } - // &{Name:securityDefinitions Type:SecurityDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Tags) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Tags { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "tags", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("tags")) + info.Content = append(info.Content, items) } - // &{Name:tags Type:Tag StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) + info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } - // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Examples suitable for JSON or YAML export. -func (m *Examples) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Examples) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of ExternalDocs suitable for JSON or YAML export. -func (m *ExternalDocs) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *ExternalDocs) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } // always include this required field. - info = append(info, yaml.MapItem{Key: "url", Value: m.Url}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of FileSchema suitable for JSON or YAML export. -func (m *FileSchema) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *FileSchema) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Title != "" { - info = append(info, yaml.MapItem{Key: "title", Value: m.Title}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) + info.Content = append(info.Content, m.Default.ToRawInfo()) } - // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Required) != 0 { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Required)) } // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) if m.ReadOnly != false { - info = append(info, yaml.MapItem{Key: "readOnly", Value: m.ReadOnly}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("readOnly")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ReadOnly)) } if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) + info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } - // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Example != nil { - info = append(info, yaml.MapItem{Key: "example", Value: m.Example.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) + info.Content = append(info.Content, m.Example.ToRawInfo()) } - // &{Name:example Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of FormDataParameterSubSchema suitable for JSON or YAML export. -func (m *FormDataParameterSubSchema) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *FormDataParameterSubSchema) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Required != false { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) } if m.In != "" { - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.AllowEmptyValue != false { - info = append(info, yaml.MapItem{Key: "allowEmptyValue", Value: m.AllowEmptyValue}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("allowEmptyValue")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowEmptyValue)) } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) + info.Content = append(info.Content, m.Items.ToRawInfo()) } - // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) + info.Content = append(info.Content, m.Default.ToRawInfo()) } - // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Enum { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) + info.Content = append(info.Content, items) } - // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Header suitable for JSON or YAML export. -func (m *Header) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Header) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) + info.Content = append(info.Content, m.Items.ToRawInfo()) } - // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) + info.Content = append(info.Content, m.Default.ToRawInfo()) } - // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Enum { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) + info.Content = append(info.Content, items) } - // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of HeaderParameterSubSchema suitable for JSON or YAML export. -func (m *HeaderParameterSubSchema) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *HeaderParameterSubSchema) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Required != false { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) } if m.In != "" { - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) + info.Content = append(info.Content, m.Items.ToRawInfo()) } - // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) + info.Content = append(info.Content, m.Default.ToRawInfo()) } - // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Enum { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) + info.Content = append(info.Content, items) } - // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Headers suitable for JSON or YAML export. -func (m *Headers) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Headers) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedHeader StringEnumValues:[] MapType:Header Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of Info suitable for JSON or YAML export. -func (m *Info) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Info) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "title", Value: m.Title}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) // always include this required field. - info = append(info, yaml.MapItem{Key: "version", Value: m.Version}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("version")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Version)) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.TermsOfService != "" { - info = append(info, yaml.MapItem{Key: "termsOfService", Value: m.TermsOfService}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("termsOfService")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TermsOfService)) } if m.Contact != nil { - info = append(info, yaml.MapItem{Key: "contact", Value: m.Contact.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("contact")) + info.Content = append(info.Content, m.Contact.ToRawInfo()) } - // &{Name:contact Type:Contact StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.License != nil { - info = append(info, yaml.MapItem{Key: "license", Value: m.License.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("license")) + info.Content = append(info.Content, m.License.ToRawInfo()) } - // &{Name:license Type:License StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of ItemsItem suitable for JSON or YAML export. -func (m *ItemsItem) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *ItemsItem) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if len(m.Schema) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Schema { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "schema", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) + info.Content = append(info.Content, items) } - // &{Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} return info } // ToRawInfo returns a description of JsonReference suitable for JSON or YAML export. -func (m *JsonReference) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *JsonReference) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "$ref", Value: m.XRef}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } return info } // ToRawInfo returns a description of License suitable for JSON or YAML export. -func (m *License) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *License) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) if m.Url != "" { - info = append(info, yaml.MapItem{Key: "url", Value: m.Url}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of NamedAny suitable for JSON or YAML export. -func (m *NamedAny) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedAny) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedHeader suitable for JSON or YAML export. -func (m *NamedHeader) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedHeader) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Header StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedParameter suitable for JSON or YAML export. -func (m *NamedParameter) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedParameter) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedPathItem suitable for JSON or YAML export. -func (m *NamedPathItem) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedPathItem) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:PathItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedResponse suitable for JSON or YAML export. -func (m *NamedResponse) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedResponse) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedResponseValue suitable for JSON or YAML export. -func (m *NamedResponseValue) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedResponseValue) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:ResponseValue StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedSchema suitable for JSON or YAML export. -func (m *NamedSchema) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedSchema) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedSecurityDefinitionsItem suitable for JSON or YAML export. -func (m *NamedSecurityDefinitionsItem) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedSecurityDefinitionsItem) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:SecurityDefinitionsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedString suitable for JSON or YAML export. -func (m *NamedString) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedString) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Value != "" { - info = append(info, yaml.MapItem{Key: "value", Value: m.Value}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Value)) } return info } // ToRawInfo returns a description of NamedStringArray suitable for JSON or YAML export. -func (m *NamedStringArray) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *NamedStringArray) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:StringArray StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NonBodyParameter suitable for JSON or YAML export. -func (m *NonBodyParameter) ToRawInfo() interface{} { +func (m *NonBodyParameter) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // NonBodyParameter // {Name:headerParameterSubSchema Type:HeaderParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} @@ -7888,122 +7720,139 @@ func (m *NonBodyParameter) ToRawInfo() interface{} { } // ToRawInfo returns a description of Oauth2AccessCodeSecurity suitable for JSON or YAML export. -func (m *Oauth2AccessCodeSecurity) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Oauth2AccessCodeSecurity) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. - info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) if m.Scopes != nil { - info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) + info.Content = append(info.Content, m.Scopes.ToRawInfo()) } - // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} // always include this required field. - info = append(info, yaml.MapItem{Key: "authorizationUrl", Value: m.AuthorizationUrl}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("authorizationUrl")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.AuthorizationUrl)) // always include this required field. - info = append(info, yaml.MapItem{Key: "tokenUrl", Value: m.TokenUrl}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Oauth2ApplicationSecurity suitable for JSON or YAML export. -func (m *Oauth2ApplicationSecurity) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Oauth2ApplicationSecurity) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. - info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) if m.Scopes != nil { - info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) + info.Content = append(info.Content, m.Scopes.ToRawInfo()) } - // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} // always include this required field. - info = append(info, yaml.MapItem{Key: "tokenUrl", Value: m.TokenUrl}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Oauth2ImplicitSecurity suitable for JSON or YAML export. -func (m *Oauth2ImplicitSecurity) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Oauth2ImplicitSecurity) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. - info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) if m.Scopes != nil { - info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) + info.Content = append(info.Content, m.Scopes.ToRawInfo()) } - // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} // always include this required field. - info = append(info, yaml.MapItem{Key: "authorizationUrl", Value: m.AuthorizationUrl}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("authorizationUrl")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.AuthorizationUrl)) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Oauth2PasswordSecurity suitable for JSON or YAML export. -func (m *Oauth2PasswordSecurity) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Oauth2PasswordSecurity) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. - info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) if m.Scopes != nil { - info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) + info.Content = append(info.Content, m.Scopes.ToRawInfo()) } - // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} // always include this required field. - info = append(info, yaml.MapItem{Key: "tokenUrl", Value: m.TokenUrl}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Oauth2Scopes suitable for JSON or YAML export. -func (m *Oauth2Scopes) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Oauth2Scopes) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } @@ -8012,69 +7861,77 @@ func (m *Oauth2Scopes) ToRawInfo() interface{} { } // ToRawInfo returns a description of Operation suitable for JSON or YAML export. -func (m *Operation) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Operation) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if len(m.Tags) != 0 { - info = append(info, yaml.MapItem{Key: "tags", Value: m.Tags}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("tags")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Tags)) } if m.Summary != "" { - info = append(info, yaml.MapItem{Key: "summary", Value: m.Summary}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("summary")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Summary)) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) + info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } - // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.OperationId != "" { - info = append(info, yaml.MapItem{Key: "operationId", Value: m.OperationId}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("operationId")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.OperationId)) } if len(m.Produces) != 0 { - info = append(info, yaml.MapItem{Key: "produces", Value: m.Produces}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("produces")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Produces)) } if len(m.Consumes) != 0 { - info = append(info, yaml.MapItem{Key: "consumes", Value: m.Consumes}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("consumes")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Consumes)) } if len(m.Parameters) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Parameters { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "parameters", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) + info.Content = append(info.Content, items) } - // &{Name:parameters Type:ParametersItem StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:The parameters needed to send a valid API call.} // always include this required field. - info = append(info, yaml.MapItem{Key: "responses", Value: m.Responses.ToRawInfo()}) - // &{Name:responses Type:Responses StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} + info.Content = append(info.Content, compiler.NewScalarNodeForString("responses")) + info.Content = append(info.Content, m.Responses.ToRawInfo()) if len(m.Schemes) != 0 { - info = append(info, yaml.MapItem{Key: "schemes", Value: m.Schemes}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("schemes")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Schemes)) } if m.Deprecated != false { - info = append(info, yaml.MapItem{Key: "deprecated", Value: m.Deprecated}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("deprecated")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Deprecated)) } if len(m.Security) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Security { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "security", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("security")) + info.Content = append(info.Content, items) } - // &{Name:security Type:SecurityRequirement StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Parameter suitable for JSON or YAML export. -func (m *Parameter) ToRawInfo() interface{} { +func (m *Parameter) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // Parameter // {Name:bodyParameter Type:BodyParameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} @@ -8091,22 +7948,22 @@ func (m *Parameter) ToRawInfo() interface{} { } // ToRawInfo returns a description of ParameterDefinitions suitable for JSON or YAML export. -func (m *ParameterDefinitions) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *ParameterDefinitions) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedParameter StringEnumValues:[] MapType:Parameter Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of ParametersItem suitable for JSON or YAML export. -func (m *ParametersItem) ToRawInfo() interface{} { +func (m *ParametersItem) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // ParametersItem // {Name:parameter Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} @@ -8123,386 +7980,439 @@ func (m *ParametersItem) ToRawInfo() interface{} { } // ToRawInfo returns a description of PathItem suitable for JSON or YAML export. -func (m *PathItem) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *PathItem) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.XRef != "" { - info = append(info, yaml.MapItem{Key: "$ref", Value: m.XRef}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) } if m.Get != nil { - info = append(info, yaml.MapItem{Key: "get", Value: m.Get.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("get")) + info.Content = append(info.Content, m.Get.ToRawInfo()) } - // &{Name:get Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Put != nil { - info = append(info, yaml.MapItem{Key: "put", Value: m.Put.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("put")) + info.Content = append(info.Content, m.Put.ToRawInfo()) } - // &{Name:put Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Post != nil { - info = append(info, yaml.MapItem{Key: "post", Value: m.Post.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("post")) + info.Content = append(info.Content, m.Post.ToRawInfo()) } - // &{Name:post Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Delete != nil { - info = append(info, yaml.MapItem{Key: "delete", Value: m.Delete.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("delete")) + info.Content = append(info.Content, m.Delete.ToRawInfo()) } - // &{Name:delete Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Options != nil { - info = append(info, yaml.MapItem{Key: "options", Value: m.Options.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("options")) + info.Content = append(info.Content, m.Options.ToRawInfo()) } - // &{Name:options Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Head != nil { - info = append(info, yaml.MapItem{Key: "head", Value: m.Head.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("head")) + info.Content = append(info.Content, m.Head.ToRawInfo()) } - // &{Name:head Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Patch != nil { - info = append(info, yaml.MapItem{Key: "patch", Value: m.Patch.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("patch")) + info.Content = append(info.Content, m.Patch.ToRawInfo()) } - // &{Name:patch Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Parameters) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Parameters { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "parameters", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) + info.Content = append(info.Content, items) } - // &{Name:parameters Type:ParametersItem StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:The parameters needed to send a valid API call.} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of PathParameterSubSchema suitable for JSON or YAML export. -func (m *PathParameterSubSchema) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *PathParameterSubSchema) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) if m.In != "" { - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) + info.Content = append(info.Content, m.Items.ToRawInfo()) } - // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) + info.Content = append(info.Content, m.Default.ToRawInfo()) } - // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Enum { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) + info.Content = append(info.Content, items) } - // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Paths suitable for JSON or YAML export. -func (m *Paths) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Paths) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} if m.Path != nil { for _, item := range m.Path { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:Path Type:NamedPathItem StringEnumValues:[] MapType:PathItem Repeated:true Pattern:^/ Implicit:true Description:} return info } // ToRawInfo returns a description of PrimitivesItems suitable for JSON or YAML export. -func (m *PrimitivesItems) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *PrimitivesItems) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) + info.Content = append(info.Content, m.Items.ToRawInfo()) } - // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) + info.Content = append(info.Content, m.Default.ToRawInfo()) } - // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Enum { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) + info.Content = append(info.Content, items) } - // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Properties suitable for JSON or YAML export. -func (m *Properties) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Properties) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedSchema StringEnumValues:[] MapType:Schema Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of QueryParameterSubSchema suitable for JSON or YAML export. -func (m *QueryParameterSubSchema) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *QueryParameterSubSchema) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Required != false { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) } if m.In != "" { - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.AllowEmptyValue != false { - info = append(info, yaml.MapItem{Key: "allowEmptyValue", Value: m.AllowEmptyValue}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("allowEmptyValue")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowEmptyValue)) } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) + info.Content = append(info.Content, m.Items.ToRawInfo()) } - // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) + info.Content = append(info.Content, m.Default.ToRawInfo()) } - // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Enum { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) + info.Content = append(info.Content, items) } - // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Response suitable for JSON or YAML export. -func (m *Response) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Response) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) if m.Schema != nil { - info = append(info, yaml.MapItem{Key: "schema", Value: m.Schema.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) + info.Content = append(info.Content, m.Schema.ToRawInfo()) } - // &{Name:schema Type:SchemaItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Headers != nil { - info = append(info, yaml.MapItem{Key: "headers", Value: m.Headers.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("headers")) + info.Content = append(info.Content, m.Headers.ToRawInfo()) } - // &{Name:headers Type:Headers StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Examples != nil { - info = append(info, yaml.MapItem{Key: "examples", Value: m.Examples.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("examples")) + info.Content = append(info.Content, m.Examples.ToRawInfo()) } - // &{Name:examples Type:Examples StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of ResponseDefinitions suitable for JSON or YAML export. -func (m *ResponseDefinitions) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *ResponseDefinitions) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedResponse StringEnumValues:[] MapType:Response Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of ResponseValue suitable for JSON or YAML export. -func (m *ResponseValue) ToRawInfo() interface{} { +func (m *ResponseValue) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // ResponseValue // {Name:response Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} @@ -8519,159 +8429,183 @@ func (m *ResponseValue) ToRawInfo() interface{} { } // ToRawInfo returns a description of Responses suitable for JSON or YAML export. -func (m *Responses) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Responses) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.ResponseCode != nil { for _, item := range m.ResponseCode { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:ResponseCode Type:NamedResponseValue StringEnumValues:[] MapType:ResponseValue Repeated:true Pattern:^([0-9]{3})$|^(default)$ Implicit:true Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Schema suitable for JSON or YAML export. -func (m *Schema) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Schema) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.XRef != "" { - info = append(info, yaml.MapItem{Key: "$ref", Value: m.XRef}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Title != "" { - info = append(info, yaml.MapItem{Key: "title", Value: m.Title}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) + info.Content = append(info.Content, m.Default.ToRawInfo()) } - // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if m.MaxProperties != 0 { - info = append(info, yaml.MapItem{Key: "maxProperties", Value: m.MaxProperties}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("maxProperties")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxProperties)) } if m.MinProperties != 0 { - info = append(info, yaml.MapItem{Key: "minProperties", Value: m.MinProperties}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("minProperties")) + info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinProperties)) } if len(m.Required) != 0 { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Required)) } if len(m.Enum) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Enum { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) + info.Content = append(info.Content, items) } - // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.AdditionalProperties != nil { - info = append(info, yaml.MapItem{Key: "additionalProperties", Value: m.AdditionalProperties.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("additionalProperties")) + info.Content = append(info.Content, m.AdditionalProperties.ToRawInfo()) } - // &{Name:additionalProperties Type:AdditionalPropertiesItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Type != nil { if len(m.Type.Value) == 1 { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type.Value[0]}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type.Value[0])) } else { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type.Value}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Type.Value)) } } - // &{Name:type Type:TypeItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Items != nil { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.Items.Schema { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) + } + if len(items.Content) == 1 { + items = items.Content[0] } - info = append(info, yaml.MapItem{Key: "items", Value: items[0]}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) + info.Content = append(info.Content, items) } - // &{Name:items Type:ItemsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.AllOf) != 0 { - items := make([]interface{}, 0) + items := compiler.NewSequenceNode() for _, item := range m.AllOf { - items = append(items, item.ToRawInfo()) + items.Content = append(items.Content, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "allOf", Value: items}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("allOf")) + info.Content = append(info.Content, items) } - // &{Name:allOf Type:Schema StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.Properties != nil { - info = append(info, yaml.MapItem{Key: "properties", Value: m.Properties.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("properties")) + info.Content = append(info.Content, m.Properties.ToRawInfo()) } - // &{Name:properties Type:Properties StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Discriminator != "" { - info = append(info, yaml.MapItem{Key: "discriminator", Value: m.Discriminator}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("discriminator")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Discriminator)) } if m.ReadOnly != false { - info = append(info, yaml.MapItem{Key: "readOnly", Value: m.ReadOnly}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("readOnly")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ReadOnly)) } if m.Xml != nil { - info = append(info, yaml.MapItem{Key: "xml", Value: m.Xml.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("xml")) + info.Content = append(info.Content, m.Xml.ToRawInfo()) } - // &{Name:xml Type:Xml StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) + info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } - // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Example != nil { - info = append(info, yaml.MapItem{Key: "example", Value: m.Example.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) + info.Content = append(info.Content, m.Example.ToRawInfo()) } - // &{Name:example Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of SchemaItem suitable for JSON or YAML export. -func (m *SchemaItem) ToRawInfo() interface{} { +func (m *SchemaItem) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // SchemaItem // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} @@ -8688,22 +8622,22 @@ func (m *SchemaItem) ToRawInfo() interface{} { } // ToRawInfo returns a description of SecurityDefinitions suitable for JSON or YAML export. -func (m *SecurityDefinitions) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *SecurityDefinitions) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedSecurityDefinitionsItem StringEnumValues:[] MapType:SecurityDefinitionsItem Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of SecurityDefinitionsItem suitable for JSON or YAML export. -func (m *SecurityDefinitionsItem) ToRawInfo() interface{} { +func (m *SecurityDefinitionsItem) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // SecurityDefinitionsItem // {Name:basicAuthenticationSecurity Type:BasicAuthenticationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} @@ -8740,103 +8674,111 @@ func (m *SecurityDefinitionsItem) ToRawInfo() interface{} { } // ToRawInfo returns a description of SecurityRequirement suitable for JSON or YAML export. -func (m *SecurityRequirement) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *SecurityRequirement) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedStringArray StringEnumValues:[] MapType:StringArray Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of StringArray suitable for JSON or YAML export. -func (m *StringArray) ToRawInfo() interface{} { - return m.Value +func (m *StringArray) ToRawInfo() *yaml.Node { + return compiler.NewSequenceNodeForStringArray(m.Value) } // ToRawInfo returns a description of Tag suitable for JSON or YAML export. -func (m *Tag) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Tag) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) + info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } - // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of TypeItem suitable for JSON or YAML export. -func (m *TypeItem) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *TypeItem) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if len(m.Value) != 0 { - info = append(info, yaml.MapItem{Key: "value", Value: m.Value}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) + info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Value)) } return info } // ToRawInfo returns a description of VendorExtension suitable for JSON or YAML export. -func (m *VendorExtension) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *VendorExtension) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of Xml suitable for JSON or YAML export. -func (m *Xml) ToRawInfo() interface{} { - info := yaml.MapSlice{} +func (m *Xml) ToRawInfo() *yaml.Node { + info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Namespace != "" { - info = append(info, yaml.MapItem{Key: "namespace", Value: m.Namespace}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("namespace")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Namespace)) } if m.Prefix != "" { - info = append(info, yaml.MapItem{Key: "prefix", Value: m.Prefix}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("prefix")) + info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Prefix)) } if m.Attribute != false { - info = append(info, yaml.MapItem{Key: "attribute", Value: m.Attribute}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("attribute")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Attribute)) } if m.Wrapped != false { - info = append(info, yaml.MapItem{Key: "wrapped", Value: m.Wrapped}) + info.Content = append(info.Content, compiler.NewScalarNodeForString("wrapped")) + info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Wrapped)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) + info.Content = append(info.Content, item.Value.ToRawInfo()) } } - // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go index 55a6cb51604c..559ddea1ab8d 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go @@ -1,77 +1,90 @@ +// Copyright 2020 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// THIS FILE IS AUTOMATICALLY GENERATED. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.12.3 // source: openapiv2/OpenAPIv2.proto package openapi_v2 import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" any "github.com/golang/protobuf/ptypes/any" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type AdditionalPropertiesItem struct { - // Types that are valid to be assigned to Oneof: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Oneof: // *AdditionalPropertiesItem_Schema // *AdditionalPropertiesItem_Boolean - Oneof isAdditionalPropertiesItem_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isAdditionalPropertiesItem_Oneof `protobuf_oneof:"oneof"` } -func (m *AdditionalPropertiesItem) Reset() { *m = AdditionalPropertiesItem{} } -func (m *AdditionalPropertiesItem) String() string { return proto.CompactTextString(m) } -func (*AdditionalPropertiesItem) ProtoMessage() {} -func (*AdditionalPropertiesItem) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{0} +func (x *AdditionalPropertiesItem) Reset() { + *x = AdditionalPropertiesItem{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AdditionalPropertiesItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AdditionalPropertiesItem.Unmarshal(m, b) -} -func (m *AdditionalPropertiesItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AdditionalPropertiesItem.Marshal(b, m, deterministic) -} -func (m *AdditionalPropertiesItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_AdditionalPropertiesItem.Merge(m, src) -} -func (m *AdditionalPropertiesItem) XXX_Size() int { - return xxx_messageInfo_AdditionalPropertiesItem.Size(m) +func (x *AdditionalPropertiesItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AdditionalPropertiesItem) XXX_DiscardUnknown() { - xxx_messageInfo_AdditionalPropertiesItem.DiscardUnknown(m) -} - -var xxx_messageInfo_AdditionalPropertiesItem proto.InternalMessageInfo -type isAdditionalPropertiesItem_Oneof interface { - isAdditionalPropertiesItem_Oneof() -} +func (*AdditionalPropertiesItem) ProtoMessage() {} -type AdditionalPropertiesItem_Schema struct { - Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` +func (x *AdditionalPropertiesItem) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_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) } -type AdditionalPropertiesItem_Boolean struct { - Boolean bool `protobuf:"varint,2,opt,name=boolean,proto3,oneof"` +// Deprecated: Use AdditionalPropertiesItem.ProtoReflect.Descriptor instead. +func (*AdditionalPropertiesItem) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{0} } -func (*AdditionalPropertiesItem_Schema) isAdditionalPropertiesItem_Oneof() {} - -func (*AdditionalPropertiesItem_Boolean) isAdditionalPropertiesItem_Oneof() {} - func (m *AdditionalPropertiesItem) GetOneof() isAdditionalPropertiesItem_Oneof { if m != nil { return m.Oneof @@ -79,202 +92,238 @@ func (m *AdditionalPropertiesItem) GetOneof() isAdditionalPropertiesItem_Oneof { return nil } -func (m *AdditionalPropertiesItem) GetSchema() *Schema { - if x, ok := m.GetOneof().(*AdditionalPropertiesItem_Schema); ok { +func (x *AdditionalPropertiesItem) GetSchema() *Schema { + if x, ok := x.GetOneof().(*AdditionalPropertiesItem_Schema); ok { return x.Schema } return nil } -func (m *AdditionalPropertiesItem) GetBoolean() bool { - if x, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { +func (x *AdditionalPropertiesItem) GetBoolean() bool { + if x, ok := x.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { return x.Boolean } return false } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*AdditionalPropertiesItem) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*AdditionalPropertiesItem_Schema)(nil), - (*AdditionalPropertiesItem_Boolean)(nil), - } +type isAdditionalPropertiesItem_Oneof interface { + isAdditionalPropertiesItem_Oneof() } -type Any struct { - Value *any.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type AdditionalPropertiesItem_Schema struct { + Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` } -func (m *Any) Reset() { *m = Any{} } -func (m *Any) String() string { return proto.CompactTextString(m) } -func (*Any) ProtoMessage() {} -func (*Any) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{1} +type AdditionalPropertiesItem_Boolean struct { + Boolean bool `protobuf:"varint,2,opt,name=boolean,proto3,oneof"` } -func (m *Any) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Any.Unmarshal(m, b) -} -func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Any.Marshal(b, m, deterministic) +func (*AdditionalPropertiesItem_Schema) isAdditionalPropertiesItem_Oneof() {} + +func (*AdditionalPropertiesItem_Boolean) isAdditionalPropertiesItem_Oneof() {} + +type Any struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *any.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` } -func (m *Any) XXX_Merge(src proto.Message) { - xxx_messageInfo_Any.Merge(m, src) + +func (x *Any) Reset() { + *x = Any{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Any) XXX_Size() int { - return xxx_messageInfo_Any.Size(m) + +func (x *Any) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Any) XXX_DiscardUnknown() { - xxx_messageInfo_Any.DiscardUnknown(m) + +func (*Any) ProtoMessage() {} + +func (x *Any) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[1] + 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) } -var xxx_messageInfo_Any proto.InternalMessageInfo +// Deprecated: Use Any.ProtoReflect.Descriptor instead. +func (*Any) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{1} +} -func (m *Any) GetValue() *any.Any { - if m != nil { - return m.Value +func (x *Any) GetValue() *any.Any { + if x != nil { + return x.Value } return nil } -func (m *Any) GetYaml() string { - if m != nil { - return m.Yaml +func (x *Any) GetYaml() string { + if x != nil { + return x.Yaml } return "" } type ApiKeySecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ApiKeySecurity) Reset() { *m = ApiKeySecurity{} } -func (m *ApiKeySecurity) String() string { return proto.CompactTextString(m) } -func (*ApiKeySecurity) ProtoMessage() {} -func (*ApiKeySecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{2} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ApiKeySecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ApiKeySecurity.Unmarshal(m, b) -} -func (m *ApiKeySecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ApiKeySecurity.Marshal(b, m, deterministic) + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *ApiKeySecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApiKeySecurity.Merge(m, src) + +func (x *ApiKeySecurity) Reset() { + *x = ApiKeySecurity{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ApiKeySecurity) XXX_Size() int { - return xxx_messageInfo_ApiKeySecurity.Size(m) + +func (x *ApiKeySecurity) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ApiKeySecurity) XXX_DiscardUnknown() { - xxx_messageInfo_ApiKeySecurity.DiscardUnknown(m) + +func (*ApiKeySecurity) ProtoMessage() {} + +func (x *ApiKeySecurity) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[2] + 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) } -var xxx_messageInfo_ApiKeySecurity proto.InternalMessageInfo +// Deprecated: Use ApiKeySecurity.ProtoReflect.Descriptor instead. +func (*ApiKeySecurity) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{2} +} -func (m *ApiKeySecurity) GetType() string { - if m != nil { - return m.Type +func (x *ApiKeySecurity) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *ApiKeySecurity) GetName() string { - if m != nil { - return m.Name +func (x *ApiKeySecurity) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *ApiKeySecurity) GetIn() string { - if m != nil { - return m.In +func (x *ApiKeySecurity) GetIn() string { + if x != nil { + return x.In } return "" } -func (m *ApiKeySecurity) GetDescription() string { - if m != nil { - return m.Description +func (x *ApiKeySecurity) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *ApiKeySecurity) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *ApiKeySecurity) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type BasicAuthenticationSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BasicAuthenticationSecurity) Reset() { *m = BasicAuthenticationSecurity{} } -func (m *BasicAuthenticationSecurity) String() string { return proto.CompactTextString(m) } -func (*BasicAuthenticationSecurity) ProtoMessage() {} -func (*BasicAuthenticationSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{3} + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *BasicAuthenticationSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BasicAuthenticationSecurity.Unmarshal(m, b) -} -func (m *BasicAuthenticationSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BasicAuthenticationSecurity.Marshal(b, m, deterministic) -} -func (m *BasicAuthenticationSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_BasicAuthenticationSecurity.Merge(m, src) +func (x *BasicAuthenticationSecurity) Reset() { + *x = BasicAuthenticationSecurity{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BasicAuthenticationSecurity) XXX_Size() int { - return xxx_messageInfo_BasicAuthenticationSecurity.Size(m) + +func (x *BasicAuthenticationSecurity) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BasicAuthenticationSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_BasicAuthenticationSecurity.DiscardUnknown(m) + +func (*BasicAuthenticationSecurity) ProtoMessage() {} + +func (x *BasicAuthenticationSecurity) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[3] + 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) } -var xxx_messageInfo_BasicAuthenticationSecurity proto.InternalMessageInfo +// Deprecated: Use BasicAuthenticationSecurity.ProtoReflect.Descriptor instead. +func (*BasicAuthenticationSecurity) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{3} +} -func (m *BasicAuthenticationSecurity) GetType() string { - if m != nil { - return m.Type +func (x *BasicAuthenticationSecurity) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *BasicAuthenticationSecurity) GetDescription() string { - if m != nil { - return m.Description +func (x *BasicAuthenticationSecurity) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *BasicAuthenticationSecurity) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *BasicAuthenticationSecurity) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type BodyParameter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` // The name of the parameter. @@ -282,228 +331,260 @@ type BodyParameter struct { // Determines the location of the parameter. In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"` // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` - Schema *Schema `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` + Schema *Schema `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *BodyParameter) Reset() { *m = BodyParameter{} } -func (m *BodyParameter) String() string { return proto.CompactTextString(m) } -func (*BodyParameter) ProtoMessage() {} -func (*BodyParameter) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{4} +func (x *BodyParameter) Reset() { + *x = BodyParameter{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BodyParameter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BodyParameter.Unmarshal(m, b) +func (x *BodyParameter) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BodyParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BodyParameter.Marshal(b, m, deterministic) -} -func (m *BodyParameter) XXX_Merge(src proto.Message) { - xxx_messageInfo_BodyParameter.Merge(m, src) -} -func (m *BodyParameter) XXX_Size() int { - return xxx_messageInfo_BodyParameter.Size(m) -} -func (m *BodyParameter) XXX_DiscardUnknown() { - xxx_messageInfo_BodyParameter.DiscardUnknown(m) + +func (*BodyParameter) ProtoMessage() {} + +func (x *BodyParameter) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[4] + 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) } -var xxx_messageInfo_BodyParameter proto.InternalMessageInfo +// Deprecated: Use BodyParameter.ProtoReflect.Descriptor instead. +func (*BodyParameter) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{4} +} -func (m *BodyParameter) GetDescription() string { - if m != nil { - return m.Description +func (x *BodyParameter) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *BodyParameter) GetName() string { - if m != nil { - return m.Name +func (x *BodyParameter) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *BodyParameter) GetIn() string { - if m != nil { - return m.In +func (x *BodyParameter) GetIn() string { + if x != nil { + return x.In } return "" } -func (m *BodyParameter) GetRequired() bool { - if m != nil { - return m.Required +func (x *BodyParameter) GetRequired() bool { + if x != nil { + return x.Required } return false } -func (m *BodyParameter) GetSchema() *Schema { - if m != nil { - return m.Schema +func (x *BodyParameter) GetSchema() *Schema { + if x != nil { + return x.Schema } return nil } -func (m *BodyParameter) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *BodyParameter) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } // Contact information for the owners of the API. type Contact struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The identifying name of the contact person/organization. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The URL pointing to the contact information. Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` // The email address of the contact person/organization. - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Contact) Reset() { *m = Contact{} } -func (m *Contact) String() string { return proto.CompactTextString(m) } -func (*Contact) ProtoMessage() {} -func (*Contact) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{5} +func (x *Contact) Reset() { + *x = Contact{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Contact) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Contact.Unmarshal(m, b) -} -func (m *Contact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Contact.Marshal(b, m, deterministic) -} -func (m *Contact) XXX_Merge(src proto.Message) { - xxx_messageInfo_Contact.Merge(m, src) +func (x *Contact) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Contact) XXX_Size() int { - return xxx_messageInfo_Contact.Size(m) -} -func (m *Contact) XXX_DiscardUnknown() { - xxx_messageInfo_Contact.DiscardUnknown(m) + +func (*Contact) ProtoMessage() {} + +func (x *Contact) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[5] + 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) } -var xxx_messageInfo_Contact proto.InternalMessageInfo +// Deprecated: Use Contact.ProtoReflect.Descriptor instead. +func (*Contact) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{5} +} -func (m *Contact) GetName() string { - if m != nil { - return m.Name +func (x *Contact) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *Contact) GetUrl() string { - if m != nil { - return m.Url +func (x *Contact) GetUrl() string { + if x != nil { + return x.Url } return "" } -func (m *Contact) GetEmail() string { - if m != nil { - return m.Email +func (x *Contact) GetEmail() string { + if x != nil { + return x.Email } return "" } -func (m *Contact) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Contact) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Default struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Default) Reset() { *m = Default{} } -func (m *Default) String() string { return proto.CompactTextString(m) } -func (*Default) ProtoMessage() {} -func (*Default) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{6} +func (x *Default) Reset() { + *x = Default{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Default) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Default.Unmarshal(m, b) -} -func (m *Default) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Default.Marshal(b, m, deterministic) -} -func (m *Default) XXX_Merge(src proto.Message) { - xxx_messageInfo_Default.Merge(m, src) -} -func (m *Default) XXX_Size() int { - return xxx_messageInfo_Default.Size(m) +func (x *Default) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Default) XXX_DiscardUnknown() { - xxx_messageInfo_Default.DiscardUnknown(m) + +func (*Default) ProtoMessage() {} + +func (x *Default) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[6] + 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) } -var xxx_messageInfo_Default proto.InternalMessageInfo +// Deprecated: Use Default.ProtoReflect.Descriptor instead. +func (*Default) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{6} +} -func (m *Default) GetAdditionalProperties() []*NamedAny { - if m != nil { - return m.AdditionalProperties +func (x *Default) GetAdditionalProperties() []*NamedAny { + if x != nil { + return x.AdditionalProperties } return nil } // One or more JSON objects describing the schemas being consumed and produced by the API. type Definitions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Definitions) Reset() { *m = Definitions{} } -func (m *Definitions) String() string { return proto.CompactTextString(m) } -func (*Definitions) ProtoMessage() {} -func (*Definitions) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{7} +func (x *Definitions) Reset() { + *x = Definitions{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Definitions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Definitions.Unmarshal(m, b) -} -func (m *Definitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Definitions.Marshal(b, m, deterministic) -} -func (m *Definitions) XXX_Merge(src proto.Message) { - xxx_messageInfo_Definitions.Merge(m, src) -} -func (m *Definitions) XXX_Size() int { - return xxx_messageInfo_Definitions.Size(m) +func (x *Definitions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Definitions) XXX_DiscardUnknown() { - xxx_messageInfo_Definitions.DiscardUnknown(m) + +func (*Definitions) ProtoMessage() {} + +func (x *Definitions) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[7] + 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) } -var xxx_messageInfo_Definitions proto.InternalMessageInfo +// Deprecated: Use Definitions.ProtoReflect.Descriptor instead. +func (*Definitions) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{7} +} -func (m *Definitions) GetAdditionalProperties() []*NamedSchema { - if m != nil { - return m.AdditionalProperties +func (x *Definitions) GetAdditionalProperties() []*NamedSchema { + if x != nil { + return x.AdditionalProperties } return nil } type Document struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The Swagger version of this document. Swagger string `protobuf:"bytes,1,opt,name=swagger,proto3" json:"swagger,omitempty"` Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` @@ -516,366 +597,398 @@ type Document struct { // A list of MIME types accepted by the API. Consumes []string `protobuf:"bytes,6,rep,name=consumes,proto3" json:"consumes,omitempty"` // A list of MIME types the API can produce. - Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"` - Paths *Paths `protobuf:"bytes,8,opt,name=paths,proto3" json:"paths,omitempty"` - Definitions *Definitions `protobuf:"bytes,9,opt,name=definitions,proto3" json:"definitions,omitempty"` - Parameters *ParameterDefinitions `protobuf:"bytes,10,opt,name=parameters,proto3" json:"parameters,omitempty"` - Responses *ResponseDefinitions `protobuf:"bytes,11,opt,name=responses,proto3" json:"responses,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` - SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,13,opt,name=security_definitions,json=securityDefinitions,proto3" json:"security_definitions,omitempty"` - Tags []*Tag `protobuf:"bytes,14,rep,name=tags,proto3" json:"tags,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,15,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,16,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Document) Reset() { *m = Document{} } -func (m *Document) String() string { return proto.CompactTextString(m) } -func (*Document) ProtoMessage() {} -func (*Document) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{8} + Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"` + Paths *Paths `protobuf:"bytes,8,opt,name=paths,proto3" json:"paths,omitempty"` + Definitions *Definitions `protobuf:"bytes,9,opt,name=definitions,proto3" json:"definitions,omitempty"` + Parameters *ParameterDefinitions `protobuf:"bytes,10,opt,name=parameters,proto3" json:"parameters,omitempty"` + Responses *ResponseDefinitions `protobuf:"bytes,11,opt,name=responses,proto3" json:"responses,omitempty"` + Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` + SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,13,opt,name=security_definitions,json=securityDefinitions,proto3" json:"security_definitions,omitempty"` + Tags []*Tag `protobuf:"bytes,14,rep,name=tags,proto3" json:"tags,omitempty"` + ExternalDocs *ExternalDocs `protobuf:"bytes,15,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,16,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Document) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Document.Unmarshal(m, b) -} -func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Document.Marshal(b, m, deterministic) -} -func (m *Document) XXX_Merge(src proto.Message) { - xxx_messageInfo_Document.Merge(m, src) +func (x *Document) Reset() { + *x = Document{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Document) XXX_Size() int { - return xxx_messageInfo_Document.Size(m) + +func (x *Document) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Document) XXX_DiscardUnknown() { - xxx_messageInfo_Document.DiscardUnknown(m) + +func (*Document) ProtoMessage() {} + +func (x *Document) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[8] + 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) } -var xxx_messageInfo_Document proto.InternalMessageInfo +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{8} +} -func (m *Document) GetSwagger() string { - if m != nil { - return m.Swagger +func (x *Document) GetSwagger() string { + if x != nil { + return x.Swagger } return "" } -func (m *Document) GetInfo() *Info { - if m != nil { - return m.Info +func (x *Document) GetInfo() *Info { + if x != nil { + return x.Info } return nil } -func (m *Document) GetHost() string { - if m != nil { - return m.Host +func (x *Document) GetHost() string { + if x != nil { + return x.Host } return "" } -func (m *Document) GetBasePath() string { - if m != nil { - return m.BasePath +func (x *Document) GetBasePath() string { + if x != nil { + return x.BasePath } return "" } -func (m *Document) GetSchemes() []string { - if m != nil { - return m.Schemes +func (x *Document) GetSchemes() []string { + if x != nil { + return x.Schemes } return nil } -func (m *Document) GetConsumes() []string { - if m != nil { - return m.Consumes +func (x *Document) GetConsumes() []string { + if x != nil { + return x.Consumes } return nil } -func (m *Document) GetProduces() []string { - if m != nil { - return m.Produces +func (x *Document) GetProduces() []string { + if x != nil { + return x.Produces } return nil } -func (m *Document) GetPaths() *Paths { - if m != nil { - return m.Paths +func (x *Document) GetPaths() *Paths { + if x != nil { + return x.Paths } return nil } -func (m *Document) GetDefinitions() *Definitions { - if m != nil { - return m.Definitions +func (x *Document) GetDefinitions() *Definitions { + if x != nil { + return x.Definitions } return nil } -func (m *Document) GetParameters() *ParameterDefinitions { - if m != nil { - return m.Parameters +func (x *Document) GetParameters() *ParameterDefinitions { + if x != nil { + return x.Parameters } return nil } -func (m *Document) GetResponses() *ResponseDefinitions { - if m != nil { - return m.Responses +func (x *Document) GetResponses() *ResponseDefinitions { + if x != nil { + return x.Responses } return nil } -func (m *Document) GetSecurity() []*SecurityRequirement { - if m != nil { - return m.Security +func (x *Document) GetSecurity() []*SecurityRequirement { + if x != nil { + return x.Security } return nil } -func (m *Document) GetSecurityDefinitions() *SecurityDefinitions { - if m != nil { - return m.SecurityDefinitions +func (x *Document) GetSecurityDefinitions() *SecurityDefinitions { + if x != nil { + return x.SecurityDefinitions } return nil } -func (m *Document) GetTags() []*Tag { - if m != nil { - return m.Tags +func (x *Document) GetTags() []*Tag { + if x != nil { + return x.Tags } return nil } -func (m *Document) GetExternalDocs() *ExternalDocs { - if m != nil { - return m.ExternalDocs +func (x *Document) GetExternalDocs() *ExternalDocs { + if x != nil { + return x.ExternalDocs } return nil } -func (m *Document) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Document) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Examples struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Examples) Reset() { *m = Examples{} } -func (m *Examples) String() string { return proto.CompactTextString(m) } -func (*Examples) ProtoMessage() {} -func (*Examples) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{9} +func (x *Examples) Reset() { + *x = Examples{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Examples) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Examples.Unmarshal(m, b) +func (x *Examples) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Examples) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Examples.Marshal(b, m, deterministic) -} -func (m *Examples) XXX_Merge(src proto.Message) { - xxx_messageInfo_Examples.Merge(m, src) -} -func (m *Examples) XXX_Size() int { - return xxx_messageInfo_Examples.Size(m) -} -func (m *Examples) XXX_DiscardUnknown() { - xxx_messageInfo_Examples.DiscardUnknown(m) + +func (*Examples) ProtoMessage() {} + +func (x *Examples) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[9] + 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) } -var xxx_messageInfo_Examples proto.InternalMessageInfo +// Deprecated: Use Examples.ProtoReflect.Descriptor instead. +func (*Examples) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{9} +} -func (m *Examples) GetAdditionalProperties() []*NamedAny { - if m != nil { - return m.AdditionalProperties +func (x *Examples) GetAdditionalProperties() []*NamedAny { + if x != nil { + return x.AdditionalProperties } return nil } // information about external documentation type ExternalDocs struct { - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ExternalDocs) Reset() { *m = ExternalDocs{} } -func (m *ExternalDocs) String() string { return proto.CompactTextString(m) } -func (*ExternalDocs) ProtoMessage() {} -func (*ExternalDocs) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{10} + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *ExternalDocs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExternalDocs.Unmarshal(m, b) -} -func (m *ExternalDocs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExternalDocs.Marshal(b, m, deterministic) -} -func (m *ExternalDocs) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExternalDocs.Merge(m, src) +func (x *ExternalDocs) Reset() { + *x = ExternalDocs{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ExternalDocs) XXX_Size() int { - return xxx_messageInfo_ExternalDocs.Size(m) + +func (x *ExternalDocs) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ExternalDocs) XXX_DiscardUnknown() { - xxx_messageInfo_ExternalDocs.DiscardUnknown(m) + +func (*ExternalDocs) ProtoMessage() {} + +func (x *ExternalDocs) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[10] + 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) } -var xxx_messageInfo_ExternalDocs proto.InternalMessageInfo +// Deprecated: Use ExternalDocs.ProtoReflect.Descriptor instead. +func (*ExternalDocs) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{10} +} -func (m *ExternalDocs) GetDescription() string { - if m != nil { - return m.Description +func (x *ExternalDocs) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *ExternalDocs) GetUrl() string { - if m != nil { - return m.Url +func (x *ExternalDocs) GetUrl() string { + if x != nil { + return x.Url } return "" } -func (m *ExternalDocs) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *ExternalDocs) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } // A deterministic version of a JSON Schema object. type FileSchema struct { - Format string `protobuf:"bytes,1,opt,name=format,proto3" json:"format,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Default *Any `protobuf:"bytes,4,opt,name=default,proto3" json:"default,omitempty"` - Required []string `protobuf:"bytes,5,rep,name=required,proto3" json:"required,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,8,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - Example *Any `protobuf:"bytes,9,opt,name=example,proto3" json:"example,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileSchema) Reset() { *m = FileSchema{} } -func (m *FileSchema) String() string { return proto.CompactTextString(m) } -func (*FileSchema) ProtoMessage() {} -func (*FileSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{11} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *FileSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileSchema.Unmarshal(m, b) -} -func (m *FileSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileSchema.Marshal(b, m, deterministic) + Format string `protobuf:"bytes,1,opt,name=format,proto3" json:"format,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Default *Any `protobuf:"bytes,4,opt,name=default,proto3" json:"default,omitempty"` + Required []string `protobuf:"bytes,5,rep,name=required,proto3" json:"required,omitempty"` + Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` + ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` + ExternalDocs *ExternalDocs `protobuf:"bytes,8,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` + Example *Any `protobuf:"bytes,9,opt,name=example,proto3" json:"example,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *FileSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileSchema.Merge(m, src) + +func (x *FileSchema) Reset() { + *x = FileSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *FileSchema) XXX_Size() int { - return xxx_messageInfo_FileSchema.Size(m) + +func (x *FileSchema) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *FileSchema) XXX_DiscardUnknown() { - xxx_messageInfo_FileSchema.DiscardUnknown(m) + +func (*FileSchema) ProtoMessage() {} + +func (x *FileSchema) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[11] + 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) } -var xxx_messageInfo_FileSchema proto.InternalMessageInfo +// Deprecated: Use FileSchema.ProtoReflect.Descriptor instead. +func (*FileSchema) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{11} +} -func (m *FileSchema) GetFormat() string { - if m != nil { - return m.Format +func (x *FileSchema) GetFormat() string { + if x != nil { + return x.Format } return "" } -func (m *FileSchema) GetTitle() string { - if m != nil { - return m.Title +func (x *FileSchema) GetTitle() string { + if x != nil { + return x.Title } return "" } -func (m *FileSchema) GetDescription() string { - if m != nil { - return m.Description +func (x *FileSchema) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *FileSchema) GetDefault() *Any { - if m != nil { - return m.Default +func (x *FileSchema) GetDefault() *Any { + if x != nil { + return x.Default } return nil } -func (m *FileSchema) GetRequired() []string { - if m != nil { - return m.Required +func (x *FileSchema) GetRequired() []string { + if x != nil { + return x.Required } return nil } -func (m *FileSchema) GetType() string { - if m != nil { - return m.Type +func (x *FileSchema) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *FileSchema) GetReadOnly() bool { - if m != nil { - return m.ReadOnly +func (x *FileSchema) GetReadOnly() bool { + if x != nil { + return x.ReadOnly } return false } -func (m *FileSchema) GetExternalDocs() *ExternalDocs { - if m != nil { - return m.ExternalDocs +func (x *FileSchema) GetExternalDocs() *ExternalDocs { + if x != nil { + return x.ExternalDocs } return nil } -func (m *FileSchema) GetExample() *Any { - if m != nil { - return m.Example +func (x *FileSchema) GetExample() *Any { + if x != nil { + return x.Example } return nil } -func (m *FileSchema) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *FileSchema) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type FormDataParameterSubSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Determines the location of the parameter. @@ -885,400 +998,416 @@ type FormDataParameterSubSchema struct { // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // allows sending a parameter by name only or with an empty value. - AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FormDataParameterSubSchema) Reset() { *m = FormDataParameterSubSchema{} } -func (m *FormDataParameterSubSchema) String() string { return proto.CompactTextString(m) } -func (*FormDataParameterSubSchema) ProtoMessage() {} + AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` + Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` + Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` +} + +func (x *FormDataParameterSubSchema) Reset() { + *x = FormDataParameterSubSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormDataParameterSubSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormDataParameterSubSchema) ProtoMessage() {} + +func (x *FormDataParameterSubSchema) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[12] + 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 FormDataParameterSubSchema.ProtoReflect.Descriptor instead. func (*FormDataParameterSubSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{12} -} - -func (m *FormDataParameterSubSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FormDataParameterSubSchema.Unmarshal(m, b) -} -func (m *FormDataParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FormDataParameterSubSchema.Marshal(b, m, deterministic) + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{12} } -func (m *FormDataParameterSubSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_FormDataParameterSubSchema.Merge(m, src) -} -func (m *FormDataParameterSubSchema) XXX_Size() int { - return xxx_messageInfo_FormDataParameterSubSchema.Size(m) -} -func (m *FormDataParameterSubSchema) XXX_DiscardUnknown() { - xxx_messageInfo_FormDataParameterSubSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_FormDataParameterSubSchema proto.InternalMessageInfo -func (m *FormDataParameterSubSchema) GetRequired() bool { - if m != nil { - return m.Required +func (x *FormDataParameterSubSchema) GetRequired() bool { + if x != nil { + return x.Required } return false } -func (m *FormDataParameterSubSchema) GetIn() string { - if m != nil { - return m.In +func (x *FormDataParameterSubSchema) GetIn() string { + if x != nil { + return x.In } return "" } -func (m *FormDataParameterSubSchema) GetDescription() string { - if m != nil { - return m.Description +func (x *FormDataParameterSubSchema) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *FormDataParameterSubSchema) GetName() string { - if m != nil { - return m.Name +func (x *FormDataParameterSubSchema) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *FormDataParameterSubSchema) GetAllowEmptyValue() bool { - if m != nil { - return m.AllowEmptyValue +func (x *FormDataParameterSubSchema) GetAllowEmptyValue() bool { + if x != nil { + return x.AllowEmptyValue } return false } -func (m *FormDataParameterSubSchema) GetType() string { - if m != nil { - return m.Type +func (x *FormDataParameterSubSchema) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *FormDataParameterSubSchema) GetFormat() string { - if m != nil { - return m.Format +func (x *FormDataParameterSubSchema) GetFormat() string { + if x != nil { + return x.Format } return "" } -func (m *FormDataParameterSubSchema) GetItems() *PrimitivesItems { - if m != nil { - return m.Items +func (x *FormDataParameterSubSchema) GetItems() *PrimitivesItems { + if x != nil { + return x.Items } return nil } -func (m *FormDataParameterSubSchema) GetCollectionFormat() string { - if m != nil { - return m.CollectionFormat +func (x *FormDataParameterSubSchema) GetCollectionFormat() string { + if x != nil { + return x.CollectionFormat } return "" } -func (m *FormDataParameterSubSchema) GetDefault() *Any { - if m != nil { - return m.Default +func (x *FormDataParameterSubSchema) GetDefault() *Any { + if x != nil { + return x.Default } return nil } -func (m *FormDataParameterSubSchema) GetMaximum() float64 { - if m != nil { - return m.Maximum +func (x *FormDataParameterSubSchema) GetMaximum() float64 { + if x != nil { + return x.Maximum } return 0 } -func (m *FormDataParameterSubSchema) GetExclusiveMaximum() bool { - if m != nil { - return m.ExclusiveMaximum +func (x *FormDataParameterSubSchema) GetExclusiveMaximum() bool { + if x != nil { + return x.ExclusiveMaximum } return false } -func (m *FormDataParameterSubSchema) GetMinimum() float64 { - if m != nil { - return m.Minimum +func (x *FormDataParameterSubSchema) GetMinimum() float64 { + if x != nil { + return x.Minimum } return 0 } -func (m *FormDataParameterSubSchema) GetExclusiveMinimum() bool { - if m != nil { - return m.ExclusiveMinimum +func (x *FormDataParameterSubSchema) GetExclusiveMinimum() bool { + if x != nil { + return x.ExclusiveMinimum } return false } -func (m *FormDataParameterSubSchema) GetMaxLength() int64 { - if m != nil { - return m.MaxLength +func (x *FormDataParameterSubSchema) GetMaxLength() int64 { + if x != nil { + return x.MaxLength } return 0 } -func (m *FormDataParameterSubSchema) GetMinLength() int64 { - if m != nil { - return m.MinLength +func (x *FormDataParameterSubSchema) GetMinLength() int64 { + if x != nil { + return x.MinLength } return 0 } -func (m *FormDataParameterSubSchema) GetPattern() string { - if m != nil { - return m.Pattern +func (x *FormDataParameterSubSchema) GetPattern() string { + if x != nil { + return x.Pattern } return "" } -func (m *FormDataParameterSubSchema) GetMaxItems() int64 { - if m != nil { - return m.MaxItems +func (x *FormDataParameterSubSchema) GetMaxItems() int64 { + if x != nil { + return x.MaxItems } return 0 } -func (m *FormDataParameterSubSchema) GetMinItems() int64 { - if m != nil { - return m.MinItems +func (x *FormDataParameterSubSchema) GetMinItems() int64 { + if x != nil { + return x.MinItems } return 0 } -func (m *FormDataParameterSubSchema) GetUniqueItems() bool { - if m != nil { - return m.UniqueItems +func (x *FormDataParameterSubSchema) GetUniqueItems() bool { + if x != nil { + return x.UniqueItems } return false } -func (m *FormDataParameterSubSchema) GetEnum() []*Any { - if m != nil { - return m.Enum +func (x *FormDataParameterSubSchema) GetEnum() []*Any { + if x != nil { + return x.Enum } return nil } -func (m *FormDataParameterSubSchema) GetMultipleOf() float64 { - if m != nil { - return m.MultipleOf +func (x *FormDataParameterSubSchema) GetMultipleOf() float64 { + if x != nil { + return x.MultipleOf } return 0 } -func (m *FormDataParameterSubSchema) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *FormDataParameterSubSchema) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Header struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - Description string `protobuf:"bytes,18,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,19,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` + Description string `protobuf:"bytes,18,opt,name=description,proto3" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,19,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` +} + +func (x *Header) Reset() { + *x = Header{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header) ProtoMessage() {} + +func (x *Header) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[13] + 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 Header.ProtoReflect.Descriptor instead. func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{13} -} - -func (m *Header) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Header.Unmarshal(m, b) -} -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Header.Marshal(b, m, deterministic) -} -func (m *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(m, src) -} -func (m *Header) XXX_Size() int { - return xxx_messageInfo_Header.Size(m) + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{13} } -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_Header proto.InternalMessageInfo -func (m *Header) GetType() string { - if m != nil { - return m.Type +func (x *Header) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *Header) GetFormat() string { - if m != nil { - return m.Format +func (x *Header) GetFormat() string { + if x != nil { + return x.Format } return "" } -func (m *Header) GetItems() *PrimitivesItems { - if m != nil { - return m.Items +func (x *Header) GetItems() *PrimitivesItems { + if x != nil { + return x.Items } return nil } -func (m *Header) GetCollectionFormat() string { - if m != nil { - return m.CollectionFormat +func (x *Header) GetCollectionFormat() string { + if x != nil { + return x.CollectionFormat } return "" } -func (m *Header) GetDefault() *Any { - if m != nil { - return m.Default +func (x *Header) GetDefault() *Any { + if x != nil { + return x.Default } return nil } -func (m *Header) GetMaximum() float64 { - if m != nil { - return m.Maximum +func (x *Header) GetMaximum() float64 { + if x != nil { + return x.Maximum } return 0 } -func (m *Header) GetExclusiveMaximum() bool { - if m != nil { - return m.ExclusiveMaximum +func (x *Header) GetExclusiveMaximum() bool { + if x != nil { + return x.ExclusiveMaximum } return false } -func (m *Header) GetMinimum() float64 { - if m != nil { - return m.Minimum +func (x *Header) GetMinimum() float64 { + if x != nil { + return x.Minimum } return 0 } -func (m *Header) GetExclusiveMinimum() bool { - if m != nil { - return m.ExclusiveMinimum +func (x *Header) GetExclusiveMinimum() bool { + if x != nil { + return x.ExclusiveMinimum } return false } -func (m *Header) GetMaxLength() int64 { - if m != nil { - return m.MaxLength +func (x *Header) GetMaxLength() int64 { + if x != nil { + return x.MaxLength } return 0 } -func (m *Header) GetMinLength() int64 { - if m != nil { - return m.MinLength +func (x *Header) GetMinLength() int64 { + if x != nil { + return x.MinLength } return 0 } -func (m *Header) GetPattern() string { - if m != nil { - return m.Pattern +func (x *Header) GetPattern() string { + if x != nil { + return x.Pattern } return "" } -func (m *Header) GetMaxItems() int64 { - if m != nil { - return m.MaxItems +func (x *Header) GetMaxItems() int64 { + if x != nil { + return x.MaxItems } return 0 } -func (m *Header) GetMinItems() int64 { - if m != nil { - return m.MinItems +func (x *Header) GetMinItems() int64 { + if x != nil { + return x.MinItems } return 0 } -func (m *Header) GetUniqueItems() bool { - if m != nil { - return m.UniqueItems +func (x *Header) GetUniqueItems() bool { + if x != nil { + return x.UniqueItems } return false } -func (m *Header) GetEnum() []*Any { - if m != nil { - return m.Enum +func (x *Header) GetEnum() []*Any { + if x != nil { + return x.Enum } return nil } -func (m *Header) GetMultipleOf() float64 { - if m != nil { - return m.MultipleOf +func (x *Header) GetMultipleOf() float64 { + if x != nil { + return x.MultipleOf } return 0 } -func (m *Header) GetDescription() string { - if m != nil { - return m.Description +func (x *Header) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Header) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Header) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type HeaderParameterSubSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Determines the location of the parameter. @@ -1286,250 +1415,266 @@ type HeaderParameterSubSchema struct { // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HeaderParameterSubSchema) Reset() { *m = HeaderParameterSubSchema{} } -func (m *HeaderParameterSubSchema) String() string { return proto.CompactTextString(m) } -func (*HeaderParameterSubSchema) ProtoMessage() {} + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` +} + +func (x *HeaderParameterSubSchema) Reset() { + *x = HeaderParameterSubSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeaderParameterSubSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeaderParameterSubSchema) ProtoMessage() {} + +func (x *HeaderParameterSubSchema) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[14] + 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 HeaderParameterSubSchema.ProtoReflect.Descriptor instead. func (*HeaderParameterSubSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{14} -} - -func (m *HeaderParameterSubSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HeaderParameterSubSchema.Unmarshal(m, b) -} -func (m *HeaderParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HeaderParameterSubSchema.Marshal(b, m, deterministic) -} -func (m *HeaderParameterSubSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeaderParameterSubSchema.Merge(m, src) -} -func (m *HeaderParameterSubSchema) XXX_Size() int { - return xxx_messageInfo_HeaderParameterSubSchema.Size(m) -} -func (m *HeaderParameterSubSchema) XXX_DiscardUnknown() { - xxx_messageInfo_HeaderParameterSubSchema.DiscardUnknown(m) + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{14} } -var xxx_messageInfo_HeaderParameterSubSchema proto.InternalMessageInfo - -func (m *HeaderParameterSubSchema) GetRequired() bool { - if m != nil { - return m.Required +func (x *HeaderParameterSubSchema) GetRequired() bool { + if x != nil { + return x.Required } return false } -func (m *HeaderParameterSubSchema) GetIn() string { - if m != nil { - return m.In +func (x *HeaderParameterSubSchema) GetIn() string { + if x != nil { + return x.In } return "" } -func (m *HeaderParameterSubSchema) GetDescription() string { - if m != nil { - return m.Description +func (x *HeaderParameterSubSchema) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *HeaderParameterSubSchema) GetName() string { - if m != nil { - return m.Name +func (x *HeaderParameterSubSchema) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *HeaderParameterSubSchema) GetType() string { - if m != nil { - return m.Type +func (x *HeaderParameterSubSchema) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *HeaderParameterSubSchema) GetFormat() string { - if m != nil { - return m.Format +func (x *HeaderParameterSubSchema) GetFormat() string { + if x != nil { + return x.Format } return "" } -func (m *HeaderParameterSubSchema) GetItems() *PrimitivesItems { - if m != nil { - return m.Items +func (x *HeaderParameterSubSchema) GetItems() *PrimitivesItems { + if x != nil { + return x.Items } return nil } -func (m *HeaderParameterSubSchema) GetCollectionFormat() string { - if m != nil { - return m.CollectionFormat +func (x *HeaderParameterSubSchema) GetCollectionFormat() string { + if x != nil { + return x.CollectionFormat } return "" } -func (m *HeaderParameterSubSchema) GetDefault() *Any { - if m != nil { - return m.Default +func (x *HeaderParameterSubSchema) GetDefault() *Any { + if x != nil { + return x.Default } return nil } -func (m *HeaderParameterSubSchema) GetMaximum() float64 { - if m != nil { - return m.Maximum +func (x *HeaderParameterSubSchema) GetMaximum() float64 { + if x != nil { + return x.Maximum } return 0 } -func (m *HeaderParameterSubSchema) GetExclusiveMaximum() bool { - if m != nil { - return m.ExclusiveMaximum +func (x *HeaderParameterSubSchema) GetExclusiveMaximum() bool { + if x != nil { + return x.ExclusiveMaximum } return false } -func (m *HeaderParameterSubSchema) GetMinimum() float64 { - if m != nil { - return m.Minimum +func (x *HeaderParameterSubSchema) GetMinimum() float64 { + if x != nil { + return x.Minimum } return 0 } -func (m *HeaderParameterSubSchema) GetExclusiveMinimum() bool { - if m != nil { - return m.ExclusiveMinimum +func (x *HeaderParameterSubSchema) GetExclusiveMinimum() bool { + if x != nil { + return x.ExclusiveMinimum } return false } -func (m *HeaderParameterSubSchema) GetMaxLength() int64 { - if m != nil { - return m.MaxLength +func (x *HeaderParameterSubSchema) GetMaxLength() int64 { + if x != nil { + return x.MaxLength } return 0 } -func (m *HeaderParameterSubSchema) GetMinLength() int64 { - if m != nil { - return m.MinLength +func (x *HeaderParameterSubSchema) GetMinLength() int64 { + if x != nil { + return x.MinLength } return 0 } -func (m *HeaderParameterSubSchema) GetPattern() string { - if m != nil { - return m.Pattern +func (x *HeaderParameterSubSchema) GetPattern() string { + if x != nil { + return x.Pattern } return "" } -func (m *HeaderParameterSubSchema) GetMaxItems() int64 { - if m != nil { - return m.MaxItems +func (x *HeaderParameterSubSchema) GetMaxItems() int64 { + if x != nil { + return x.MaxItems } return 0 } -func (m *HeaderParameterSubSchema) GetMinItems() int64 { - if m != nil { - return m.MinItems +func (x *HeaderParameterSubSchema) GetMinItems() int64 { + if x != nil { + return x.MinItems } return 0 } -func (m *HeaderParameterSubSchema) GetUniqueItems() bool { - if m != nil { - return m.UniqueItems +func (x *HeaderParameterSubSchema) GetUniqueItems() bool { + if x != nil { + return x.UniqueItems } return false } -func (m *HeaderParameterSubSchema) GetEnum() []*Any { - if m != nil { - return m.Enum +func (x *HeaderParameterSubSchema) GetEnum() []*Any { + if x != nil { + return x.Enum } return nil } -func (m *HeaderParameterSubSchema) GetMultipleOf() float64 { - if m != nil { - return m.MultipleOf +func (x *HeaderParameterSubSchema) GetMultipleOf() float64 { + if x != nil { + return x.MultipleOf } return 0 } -func (m *HeaderParameterSubSchema) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *HeaderParameterSubSchema) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Headers struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + AdditionalProperties []*NamedHeader `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Headers) Reset() { *m = Headers{} } -func (m *Headers) String() string { return proto.CompactTextString(m) } -func (*Headers) ProtoMessage() {} -func (*Headers) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{15} +func (x *Headers) Reset() { + *x = Headers{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Headers) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Headers.Unmarshal(m, b) -} -func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Headers.Marshal(b, m, deterministic) -} -func (m *Headers) XXX_Merge(src proto.Message) { - xxx_messageInfo_Headers.Merge(m, src) +func (x *Headers) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Headers) XXX_Size() int { - return xxx_messageInfo_Headers.Size(m) -} -func (m *Headers) XXX_DiscardUnknown() { - xxx_messageInfo_Headers.DiscardUnknown(m) + +func (*Headers) ProtoMessage() {} + +func (x *Headers) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[15] + 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) } -var xxx_messageInfo_Headers proto.InternalMessageInfo +// Deprecated: Use Headers.ProtoReflect.Descriptor instead. +func (*Headers) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{15} +} -func (m *Headers) GetAdditionalProperties() []*NamedHeader { - if m != nil { - return m.AdditionalProperties +func (x *Headers) GetAdditionalProperties() []*NamedHeader { + if x != nil { + return x.AdditionalProperties } return nil } // General information about the API. type Info struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // A unique and precise title of the API. Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // A semantic version number of the API. @@ -1537,797 +1682,885 @@ type Info struct { // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // The terms of service for the API. - TermsOfService string `protobuf:"bytes,4,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"` - Contact *Contact `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` - License *License `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Info) Reset() { *m = Info{} } -func (m *Info) String() string { return proto.CompactTextString(m) } -func (*Info) ProtoMessage() {} -func (*Info) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{16} + TermsOfService string `protobuf:"bytes,4,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"` + Contact *Contact `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` + License *License `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Info) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Info.Unmarshal(m, b) -} -func (m *Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Info.Marshal(b, m, deterministic) -} -func (m *Info) XXX_Merge(src proto.Message) { - xxx_messageInfo_Info.Merge(m, src) +func (x *Info) Reset() { + *x = Info{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Info) XXX_Size() int { - return xxx_messageInfo_Info.Size(m) + +func (x *Info) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Info) XXX_DiscardUnknown() { - xxx_messageInfo_Info.DiscardUnknown(m) + +func (*Info) ProtoMessage() {} + +func (x *Info) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[16] + 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) } -var xxx_messageInfo_Info proto.InternalMessageInfo +// Deprecated: Use Info.ProtoReflect.Descriptor instead. +func (*Info) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{16} +} -func (m *Info) GetTitle() string { - if m != nil { - return m.Title +func (x *Info) GetTitle() string { + if x != nil { + return x.Title } return "" } -func (m *Info) GetVersion() string { - if m != nil { - return m.Version +func (x *Info) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (m *Info) GetDescription() string { - if m != nil { - return m.Description +func (x *Info) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Info) GetTermsOfService() string { - if m != nil { - return m.TermsOfService +func (x *Info) GetTermsOfService() string { + if x != nil { + return x.TermsOfService } return "" } -func (m *Info) GetContact() *Contact { - if m != nil { - return m.Contact +func (x *Info) GetContact() *Contact { + if x != nil { + return x.Contact } return nil } -func (m *Info) GetLicense() *License { - if m != nil { - return m.License +func (x *Info) GetLicense() *License { + if x != nil { + return x.License } return nil } -func (m *Info) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Info) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type ItemsItem struct { - Schema []*Schema `protobuf:"bytes,1,rep,name=schema,proto3" json:"schema,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ItemsItem) Reset() { *m = ItemsItem{} } -func (m *ItemsItem) String() string { return proto.CompactTextString(m) } -func (*ItemsItem) ProtoMessage() {} -func (*ItemsItem) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{17} + Schema []*Schema `protobuf:"bytes,1,rep,name=schema,proto3" json:"schema,omitempty"` } -func (m *ItemsItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ItemsItem.Unmarshal(m, b) -} -func (m *ItemsItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ItemsItem.Marshal(b, m, deterministic) -} -func (m *ItemsItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_ItemsItem.Merge(m, src) +func (x *ItemsItem) Reset() { + *x = ItemsItem{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ItemsItem) XXX_Size() int { - return xxx_messageInfo_ItemsItem.Size(m) + +func (x *ItemsItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ItemsItem) XXX_DiscardUnknown() { - xxx_messageInfo_ItemsItem.DiscardUnknown(m) + +func (*ItemsItem) ProtoMessage() {} + +func (x *ItemsItem) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[17] + 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) } -var xxx_messageInfo_ItemsItem proto.InternalMessageInfo +// Deprecated: Use ItemsItem.ProtoReflect.Descriptor instead. +func (*ItemsItem) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{17} +} -func (m *ItemsItem) GetSchema() []*Schema { - if m != nil { - return m.Schema +func (x *ItemsItem) GetSchema() []*Schema { + if x != nil { + return x.Schema } return nil } type JsonReference struct { - XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *JsonReference) Reset() { *m = JsonReference{} } -func (m *JsonReference) String() string { return proto.CompactTextString(m) } -func (*JsonReference) ProtoMessage() {} -func (*JsonReference) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{18} + XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` } -func (m *JsonReference) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_JsonReference.Unmarshal(m, b) -} -func (m *JsonReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_JsonReference.Marshal(b, m, deterministic) -} -func (m *JsonReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_JsonReference.Merge(m, src) +func (x *JsonReference) Reset() { + *x = JsonReference{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *JsonReference) XXX_Size() int { - return xxx_messageInfo_JsonReference.Size(m) + +func (x *JsonReference) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *JsonReference) XXX_DiscardUnknown() { - xxx_messageInfo_JsonReference.DiscardUnknown(m) + +func (*JsonReference) ProtoMessage() {} + +func (x *JsonReference) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[18] + 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) } -var xxx_messageInfo_JsonReference proto.InternalMessageInfo +// Deprecated: Use JsonReference.ProtoReflect.Descriptor instead. +func (*JsonReference) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{18} +} -func (m *JsonReference) GetXRef() string { - if m != nil { - return m.XRef +func (x *JsonReference) GetXRef() string { + if x != nil { + return x.XRef } return "" } -func (m *JsonReference) GetDescription() string { - if m != nil { - return m.Description +func (x *JsonReference) GetDescription() string { + if x != nil { + return x.Description } return "" } type License struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The name of the license type. It's encouraged to use an OSI compatible license. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The URL pointing to the license. - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *License) Reset() { *m = License{} } -func (m *License) String() string { return proto.CompactTextString(m) } -func (*License) ProtoMessage() {} -func (*License) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{19} +func (x *License) Reset() { + *x = License{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *License) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_License.Unmarshal(m, b) -} -func (m *License) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_License.Marshal(b, m, deterministic) -} -func (m *License) XXX_Merge(src proto.Message) { - xxx_messageInfo_License.Merge(m, src) +func (x *License) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *License) XXX_Size() int { - return xxx_messageInfo_License.Size(m) -} -func (m *License) XXX_DiscardUnknown() { - xxx_messageInfo_License.DiscardUnknown(m) + +func (*License) ProtoMessage() {} + +func (x *License) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[19] + 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) } -var xxx_messageInfo_License proto.InternalMessageInfo +// Deprecated: Use License.ProtoReflect.Descriptor instead. +func (*License) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{19} +} -func (m *License) GetName() string { - if m != nil { - return m.Name +func (x *License) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *License) GetUrl() string { - if m != nil { - return m.Url +func (x *License) GetUrl() string { + if x != nil { + return x.Url } return "" } -func (m *License) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *License) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. type NamedAny struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedAny) Reset() { *m = NamedAny{} } -func (m *NamedAny) String() string { return proto.CompactTextString(m) } -func (*NamedAny) ProtoMessage() {} -func (*NamedAny) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{20} +func (x *NamedAny) Reset() { + *x = NamedAny{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedAny) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedAny.Unmarshal(m, b) +func (x *NamedAny) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedAny) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedAny.Marshal(b, m, deterministic) -} -func (m *NamedAny) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedAny.Merge(m, src) -} -func (m *NamedAny) XXX_Size() int { - return xxx_messageInfo_NamedAny.Size(m) -} -func (m *NamedAny) XXX_DiscardUnknown() { - xxx_messageInfo_NamedAny.DiscardUnknown(m) + +func (*NamedAny) ProtoMessage() {} + +func (x *NamedAny) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[20] + 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) } -var xxx_messageInfo_NamedAny proto.InternalMessageInfo +// Deprecated: Use NamedAny.ProtoReflect.Descriptor instead. +func (*NamedAny) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{20} +} -func (m *NamedAny) GetName() string { - if m != nil { - return m.Name +func (x *NamedAny) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedAny) GetValue() *Any { - if m != nil { - return m.Value +func (x *NamedAny) GetValue() *Any { + if x != nil { + return x.Value } return nil } // Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. type NamedHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value *Header `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *Header `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedHeader) Reset() { *m = NamedHeader{} } -func (m *NamedHeader) String() string { return proto.CompactTextString(m) } -func (*NamedHeader) ProtoMessage() {} -func (*NamedHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{21} +func (x *NamedHeader) Reset() { + *x = NamedHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedHeader.Unmarshal(m, b) -} -func (m *NamedHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedHeader.Marshal(b, m, deterministic) -} -func (m *NamedHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedHeader.Merge(m, src) -} -func (m *NamedHeader) XXX_Size() int { - return xxx_messageInfo_NamedHeader.Size(m) +func (x *NamedHeader) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedHeader) XXX_DiscardUnknown() { - xxx_messageInfo_NamedHeader.DiscardUnknown(m) + +func (*NamedHeader) ProtoMessage() {} + +func (x *NamedHeader) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[21] + 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) } -var xxx_messageInfo_NamedHeader proto.InternalMessageInfo +// Deprecated: Use NamedHeader.ProtoReflect.Descriptor instead. +func (*NamedHeader) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{21} +} -func (m *NamedHeader) GetName() string { - if m != nil { - return m.Name +func (x *NamedHeader) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedHeader) GetValue() *Header { - if m != nil { - return m.Value +func (x *NamedHeader) GetValue() *Header { + if x != nil { + return x.Value } return nil } // Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. type NamedParameter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value *Parameter `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *Parameter `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedParameter) Reset() { *m = NamedParameter{} } -func (m *NamedParameter) String() string { return proto.CompactTextString(m) } -func (*NamedParameter) ProtoMessage() {} -func (*NamedParameter) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{22} +func (x *NamedParameter) Reset() { + *x = NamedParameter{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedParameter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedParameter.Unmarshal(m, b) -} -func (m *NamedParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedParameter.Marshal(b, m, deterministic) -} -func (m *NamedParameter) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedParameter.Merge(m, src) +func (x *NamedParameter) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedParameter) XXX_Size() int { - return xxx_messageInfo_NamedParameter.Size(m) -} -func (m *NamedParameter) XXX_DiscardUnknown() { - xxx_messageInfo_NamedParameter.DiscardUnknown(m) + +func (*NamedParameter) ProtoMessage() {} + +func (x *NamedParameter) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[22] + 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) } -var xxx_messageInfo_NamedParameter proto.InternalMessageInfo +// Deprecated: Use NamedParameter.ProtoReflect.Descriptor instead. +func (*NamedParameter) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{22} +} -func (m *NamedParameter) GetName() string { - if m != nil { - return m.Name +func (x *NamedParameter) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedParameter) GetValue() *Parameter { - if m != nil { - return m.Value +func (x *NamedParameter) GetValue() *Parameter { + if x != nil { + return x.Value } return nil } // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. type NamedPathItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value *PathItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *PathItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedPathItem) Reset() { *m = NamedPathItem{} } -func (m *NamedPathItem) String() string { return proto.CompactTextString(m) } -func (*NamedPathItem) ProtoMessage() {} -func (*NamedPathItem) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{23} +func (x *NamedPathItem) Reset() { + *x = NamedPathItem{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedPathItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedPathItem.Unmarshal(m, b) -} -func (m *NamedPathItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedPathItem.Marshal(b, m, deterministic) +func (x *NamedPathItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedPathItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedPathItem.Merge(m, src) -} -func (m *NamedPathItem) XXX_Size() int { - return xxx_messageInfo_NamedPathItem.Size(m) -} -func (m *NamedPathItem) XXX_DiscardUnknown() { - xxx_messageInfo_NamedPathItem.DiscardUnknown(m) + +func (*NamedPathItem) ProtoMessage() {} + +func (x *NamedPathItem) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[23] + 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) } -var xxx_messageInfo_NamedPathItem proto.InternalMessageInfo +// Deprecated: Use NamedPathItem.ProtoReflect.Descriptor instead. +func (*NamedPathItem) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{23} +} -func (m *NamedPathItem) GetName() string { - if m != nil { - return m.Name +func (x *NamedPathItem) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedPathItem) GetValue() *PathItem { - if m != nil { - return m.Value +func (x *NamedPathItem) GetValue() *PathItem { + if x != nil { + return x.Value } return nil } // Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. type NamedResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value *Response `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *Response `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedResponse) Reset() { *m = NamedResponse{} } -func (m *NamedResponse) String() string { return proto.CompactTextString(m) } -func (*NamedResponse) ProtoMessage() {} -func (*NamedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{24} +func (x *NamedResponse) Reset() { + *x = NamedResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedResponse.Unmarshal(m, b) +func (x *NamedResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedResponse.Marshal(b, m, deterministic) -} -func (m *NamedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResponse.Merge(m, src) -} -func (m *NamedResponse) XXX_Size() int { - return xxx_messageInfo_NamedResponse.Size(m) -} -func (m *NamedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResponse.DiscardUnknown(m) + +func (*NamedResponse) ProtoMessage() {} + +func (x *NamedResponse) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[24] + 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) } -var xxx_messageInfo_NamedResponse proto.InternalMessageInfo +// Deprecated: Use NamedResponse.ProtoReflect.Descriptor instead. +func (*NamedResponse) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{24} +} -func (m *NamedResponse) GetName() string { - if m != nil { - return m.Name +func (x *NamedResponse) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedResponse) GetValue() *Response { - if m != nil { - return m.Value +func (x *NamedResponse) GetValue() *Response { + if x != nil { + return x.Value } return nil } // Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. type NamedResponseValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value *ResponseValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *ResponseValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedResponseValue) Reset() { *m = NamedResponseValue{} } -func (m *NamedResponseValue) String() string { return proto.CompactTextString(m) } -func (*NamedResponseValue) ProtoMessage() {} -func (*NamedResponseValue) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{25} +func (x *NamedResponseValue) Reset() { + *x = NamedResponseValue{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedResponseValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedResponseValue.Unmarshal(m, b) -} -func (m *NamedResponseValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedResponseValue.Marshal(b, m, deterministic) -} -func (m *NamedResponseValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResponseValue.Merge(m, src) -} -func (m *NamedResponseValue) XXX_Size() int { - return xxx_messageInfo_NamedResponseValue.Size(m) +func (x *NamedResponseValue) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedResponseValue) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResponseValue.DiscardUnknown(m) + +func (*NamedResponseValue) ProtoMessage() {} + +func (x *NamedResponseValue) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[25] + 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) } -var xxx_messageInfo_NamedResponseValue proto.InternalMessageInfo +// Deprecated: Use NamedResponseValue.ProtoReflect.Descriptor instead. +func (*NamedResponseValue) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{25} +} -func (m *NamedResponseValue) GetName() string { - if m != nil { - return m.Name +func (x *NamedResponseValue) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedResponseValue) GetValue() *ResponseValue { - if m != nil { - return m.Value +func (x *NamedResponseValue) GetValue() *ResponseValue { + if x != nil { + return x.Value } return nil } // Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. type NamedSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value *Schema `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *Schema `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedSchema) Reset() { *m = NamedSchema{} } -func (m *NamedSchema) String() string { return proto.CompactTextString(m) } -func (*NamedSchema) ProtoMessage() {} -func (*NamedSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{26} +func (x *NamedSchema) Reset() { + *x = NamedSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedSchema.Unmarshal(m, b) -} -func (m *NamedSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedSchema.Marshal(b, m, deterministic) -} -func (m *NamedSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedSchema.Merge(m, src) +func (x *NamedSchema) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedSchema) XXX_Size() int { - return xxx_messageInfo_NamedSchema.Size(m) -} -func (m *NamedSchema) XXX_DiscardUnknown() { - xxx_messageInfo_NamedSchema.DiscardUnknown(m) + +func (*NamedSchema) ProtoMessage() {} + +func (x *NamedSchema) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[26] + 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) } -var xxx_messageInfo_NamedSchema proto.InternalMessageInfo +// Deprecated: Use NamedSchema.ProtoReflect.Descriptor instead. +func (*NamedSchema) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{26} +} -func (m *NamedSchema) GetName() string { - if m != nil { - return m.Name +func (x *NamedSchema) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedSchema) GetValue() *Schema { - if m != nil { - return m.Value +func (x *NamedSchema) GetValue() *Schema { + if x != nil { + return x.Value } return nil } // Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. type NamedSecurityDefinitionsItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value *SecurityDefinitionsItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *SecurityDefinitionsItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedSecurityDefinitionsItem) Reset() { *m = NamedSecurityDefinitionsItem{} } -func (m *NamedSecurityDefinitionsItem) String() string { return proto.CompactTextString(m) } -func (*NamedSecurityDefinitionsItem) ProtoMessage() {} -func (*NamedSecurityDefinitionsItem) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{27} +func (x *NamedSecurityDefinitionsItem) Reset() { + *x = NamedSecurityDefinitionsItem{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedSecurityDefinitionsItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedSecurityDefinitionsItem.Unmarshal(m, b) -} -func (m *NamedSecurityDefinitionsItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedSecurityDefinitionsItem.Marshal(b, m, deterministic) +func (x *NamedSecurityDefinitionsItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedSecurityDefinitionsItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedSecurityDefinitionsItem.Merge(m, src) -} -func (m *NamedSecurityDefinitionsItem) XXX_Size() int { - return xxx_messageInfo_NamedSecurityDefinitionsItem.Size(m) -} -func (m *NamedSecurityDefinitionsItem) XXX_DiscardUnknown() { - xxx_messageInfo_NamedSecurityDefinitionsItem.DiscardUnknown(m) + +func (*NamedSecurityDefinitionsItem) ProtoMessage() {} + +func (x *NamedSecurityDefinitionsItem) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[27] + 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) } -var xxx_messageInfo_NamedSecurityDefinitionsItem proto.InternalMessageInfo +// Deprecated: Use NamedSecurityDefinitionsItem.ProtoReflect.Descriptor instead. +func (*NamedSecurityDefinitionsItem) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{27} +} -func (m *NamedSecurityDefinitionsItem) GetName() string { - if m != nil { - return m.Name +func (x *NamedSecurityDefinitionsItem) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedSecurityDefinitionsItem) GetValue() *SecurityDefinitionsItem { - if m != nil { - return m.Value +func (x *NamedSecurityDefinitionsItem) GetValue() *SecurityDefinitionsItem { + if x != nil { + return x.Value } return nil } // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. type NamedString struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedString) Reset() { *m = NamedString{} } -func (m *NamedString) String() string { return proto.CompactTextString(m) } -func (*NamedString) ProtoMessage() {} -func (*NamedString) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{28} +func (x *NamedString) Reset() { + *x = NamedString{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedString) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedString.Unmarshal(m, b) +func (x *NamedString) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedString.Marshal(b, m, deterministic) -} -func (m *NamedString) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedString.Merge(m, src) -} -func (m *NamedString) XXX_Size() int { - return xxx_messageInfo_NamedString.Size(m) -} -func (m *NamedString) XXX_DiscardUnknown() { - xxx_messageInfo_NamedString.DiscardUnknown(m) + +func (*NamedString) ProtoMessage() {} + +func (x *NamedString) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[28] + 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) } -var xxx_messageInfo_NamedString proto.InternalMessageInfo +// Deprecated: Use NamedString.ProtoReflect.Descriptor instead. +func (*NamedString) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{28} +} -func (m *NamedString) GetName() string { - if m != nil { - return m.Name +func (x *NamedString) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedString) GetValue() string { - if m != nil { - return m.Value +func (x *NamedString) GetValue() string { + if x != nil { + return x.Value } return "" } // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. type NamedStringArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value - Value *StringArray `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *StringArray `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *NamedStringArray) Reset() { *m = NamedStringArray{} } -func (m *NamedStringArray) String() string { return proto.CompactTextString(m) } -func (*NamedStringArray) ProtoMessage() {} -func (*NamedStringArray) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{29} +func (x *NamedStringArray) Reset() { + *x = NamedStringArray{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamedStringArray) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedStringArray.Unmarshal(m, b) -} -func (m *NamedStringArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedStringArray.Marshal(b, m, deterministic) -} -func (m *NamedStringArray) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedStringArray.Merge(m, src) -} -func (m *NamedStringArray) XXX_Size() int { - return xxx_messageInfo_NamedStringArray.Size(m) +func (x *NamedStringArray) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamedStringArray) XXX_DiscardUnknown() { - xxx_messageInfo_NamedStringArray.DiscardUnknown(m) + +func (*NamedStringArray) ProtoMessage() {} + +func (x *NamedStringArray) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[29] + 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) } -var xxx_messageInfo_NamedStringArray proto.InternalMessageInfo +// Deprecated: Use NamedStringArray.ProtoReflect.Descriptor instead. +func (*NamedStringArray) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{29} +} -func (m *NamedStringArray) GetName() string { - if m != nil { - return m.Name +func (x *NamedStringArray) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *NamedStringArray) GetValue() *StringArray { - if m != nil { - return m.Value +func (x *NamedStringArray) GetValue() *StringArray { + if x != nil { + return x.Value } return nil } type NonBodyParameter struct { - // Types that are valid to be assigned to Oneof: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Oneof: // *NonBodyParameter_HeaderParameterSubSchema // *NonBodyParameter_FormDataParameterSubSchema // *NonBodyParameter_QueryParameterSubSchema // *NonBodyParameter_PathParameterSubSchema - Oneof isNonBodyParameter_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isNonBodyParameter_Oneof `protobuf_oneof:"oneof"` } -func (m *NonBodyParameter) Reset() { *m = NonBodyParameter{} } -func (m *NonBodyParameter) String() string { return proto.CompactTextString(m) } -func (*NonBodyParameter) ProtoMessage() {} -func (*NonBodyParameter) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{30} +func (x *NonBodyParameter) Reset() { + *x = NonBodyParameter{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NonBodyParameter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NonBodyParameter.Unmarshal(m, b) -} -func (m *NonBodyParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NonBodyParameter.Marshal(b, m, deterministic) -} -func (m *NonBodyParameter) XXX_Merge(src proto.Message) { - xxx_messageInfo_NonBodyParameter.Merge(m, src) -} -func (m *NonBodyParameter) XXX_Size() int { - return xxx_messageInfo_NonBodyParameter.Size(m) -} -func (m *NonBodyParameter) XXX_DiscardUnknown() { - xxx_messageInfo_NonBodyParameter.DiscardUnknown(m) +func (x *NonBodyParameter) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_NonBodyParameter proto.InternalMessageInfo +func (*NonBodyParameter) ProtoMessage() {} -type isNonBodyParameter_Oneof interface { - isNonBodyParameter_Oneof() +func (x *NonBodyParameter) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[30] + 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) } -type NonBodyParameter_HeaderParameterSubSchema struct { - HeaderParameterSubSchema *HeaderParameterSubSchema `protobuf:"bytes,1,opt,name=header_parameter_sub_schema,json=headerParameterSubSchema,proto3,oneof"` +// Deprecated: Use NonBodyParameter.ProtoReflect.Descriptor instead. +func (*NonBodyParameter) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{30} } -type NonBodyParameter_FormDataParameterSubSchema struct { - FormDataParameterSubSchema *FormDataParameterSubSchema `protobuf:"bytes,2,opt,name=form_data_parameter_sub_schema,json=formDataParameterSubSchema,proto3,oneof"` -} - -type NonBodyParameter_QueryParameterSubSchema struct { - QueryParameterSubSchema *QueryParameterSubSchema `protobuf:"bytes,3,opt,name=query_parameter_sub_schema,json=queryParameterSubSchema,proto3,oneof"` -} - -type NonBodyParameter_PathParameterSubSchema struct { - PathParameterSubSchema *PathParameterSubSchema `protobuf:"bytes,4,opt,name=path_parameter_sub_schema,json=pathParameterSubSchema,proto3,oneof"` -} - -func (*NonBodyParameter_HeaderParameterSubSchema) isNonBodyParameter_Oneof() {} - -func (*NonBodyParameter_FormDataParameterSubSchema) isNonBodyParameter_Oneof() {} - -func (*NonBodyParameter_QueryParameterSubSchema) isNonBodyParameter_Oneof() {} - -func (*NonBodyParameter_PathParameterSubSchema) isNonBodyParameter_Oneof() {} - func (m *NonBodyParameter) GetOneof() isNonBodyParameter_Oneof { if m != nil { return m.Oneof @@ -2335,408 +2568,470 @@ func (m *NonBodyParameter) GetOneof() isNonBodyParameter_Oneof { return nil } -func (m *NonBodyParameter) GetHeaderParameterSubSchema() *HeaderParameterSubSchema { - if x, ok := m.GetOneof().(*NonBodyParameter_HeaderParameterSubSchema); ok { +func (x *NonBodyParameter) GetHeaderParameterSubSchema() *HeaderParameterSubSchema { + if x, ok := x.GetOneof().(*NonBodyParameter_HeaderParameterSubSchema); ok { return x.HeaderParameterSubSchema } return nil } -func (m *NonBodyParameter) GetFormDataParameterSubSchema() *FormDataParameterSubSchema { - if x, ok := m.GetOneof().(*NonBodyParameter_FormDataParameterSubSchema); ok { +func (x *NonBodyParameter) GetFormDataParameterSubSchema() *FormDataParameterSubSchema { + if x, ok := x.GetOneof().(*NonBodyParameter_FormDataParameterSubSchema); ok { return x.FormDataParameterSubSchema } return nil } -func (m *NonBodyParameter) GetQueryParameterSubSchema() *QueryParameterSubSchema { - if x, ok := m.GetOneof().(*NonBodyParameter_QueryParameterSubSchema); ok { +func (x *NonBodyParameter) GetQueryParameterSubSchema() *QueryParameterSubSchema { + if x, ok := x.GetOneof().(*NonBodyParameter_QueryParameterSubSchema); ok { return x.QueryParameterSubSchema } return nil } -func (m *NonBodyParameter) GetPathParameterSubSchema() *PathParameterSubSchema { - if x, ok := m.GetOneof().(*NonBodyParameter_PathParameterSubSchema); ok { +func (x *NonBodyParameter) GetPathParameterSubSchema() *PathParameterSubSchema { + if x, ok := x.GetOneof().(*NonBodyParameter_PathParameterSubSchema); ok { return x.PathParameterSubSchema } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*NonBodyParameter) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*NonBodyParameter_HeaderParameterSubSchema)(nil), - (*NonBodyParameter_FormDataParameterSubSchema)(nil), - (*NonBodyParameter_QueryParameterSubSchema)(nil), - (*NonBodyParameter_PathParameterSubSchema)(nil), - } +type isNonBodyParameter_Oneof interface { + isNonBodyParameter_Oneof() } -type Oauth2AccessCodeSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` - TokenUrl string `protobuf:"bytes,5,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Oauth2AccessCodeSecurity) Reset() { *m = Oauth2AccessCodeSecurity{} } -func (m *Oauth2AccessCodeSecurity) String() string { return proto.CompactTextString(m) } -func (*Oauth2AccessCodeSecurity) ProtoMessage() {} -func (*Oauth2AccessCodeSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{31} +type NonBodyParameter_HeaderParameterSubSchema struct { + HeaderParameterSubSchema *HeaderParameterSubSchema `protobuf:"bytes,1,opt,name=header_parameter_sub_schema,json=headerParameterSubSchema,proto3,oneof"` +} + +type NonBodyParameter_FormDataParameterSubSchema struct { + FormDataParameterSubSchema *FormDataParameterSubSchema `protobuf:"bytes,2,opt,name=form_data_parameter_sub_schema,json=formDataParameterSubSchema,proto3,oneof"` +} + +type NonBodyParameter_QueryParameterSubSchema struct { + QueryParameterSubSchema *QueryParameterSubSchema `protobuf:"bytes,3,opt,name=query_parameter_sub_schema,json=queryParameterSubSchema,proto3,oneof"` } -func (m *Oauth2AccessCodeSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2AccessCodeSecurity.Unmarshal(m, b) +type NonBodyParameter_PathParameterSubSchema struct { + PathParameterSubSchema *PathParameterSubSchema `protobuf:"bytes,4,opt,name=path_parameter_sub_schema,json=pathParameterSubSchema,proto3,oneof"` } -func (m *Oauth2AccessCodeSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2AccessCodeSecurity.Marshal(b, m, deterministic) + +func (*NonBodyParameter_HeaderParameterSubSchema) isNonBodyParameter_Oneof() {} + +func (*NonBodyParameter_FormDataParameterSubSchema) isNonBodyParameter_Oneof() {} + +func (*NonBodyParameter_QueryParameterSubSchema) isNonBodyParameter_Oneof() {} + +func (*NonBodyParameter_PathParameterSubSchema) isNonBodyParameter_Oneof() {} + +type Oauth2AccessCodeSecurity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` + Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` + AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` + TokenUrl string `protobuf:"bytes,5,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Oauth2AccessCodeSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2AccessCodeSecurity.Merge(m, src) + +func (x *Oauth2AccessCodeSecurity) Reset() { + *x = Oauth2AccessCodeSecurity{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Oauth2AccessCodeSecurity) XXX_Size() int { - return xxx_messageInfo_Oauth2AccessCodeSecurity.Size(m) + +func (x *Oauth2AccessCodeSecurity) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Oauth2AccessCodeSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2AccessCodeSecurity.DiscardUnknown(m) + +func (*Oauth2AccessCodeSecurity) ProtoMessage() {} + +func (x *Oauth2AccessCodeSecurity) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[31] + 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) } -var xxx_messageInfo_Oauth2AccessCodeSecurity proto.InternalMessageInfo +// Deprecated: Use Oauth2AccessCodeSecurity.ProtoReflect.Descriptor instead. +func (*Oauth2AccessCodeSecurity) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{31} +} -func (m *Oauth2AccessCodeSecurity) GetType() string { - if m != nil { - return m.Type +func (x *Oauth2AccessCodeSecurity) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *Oauth2AccessCodeSecurity) GetFlow() string { - if m != nil { - return m.Flow +func (x *Oauth2AccessCodeSecurity) GetFlow() string { + if x != nil { + return x.Flow } return "" } -func (m *Oauth2AccessCodeSecurity) GetScopes() *Oauth2Scopes { - if m != nil { - return m.Scopes +func (x *Oauth2AccessCodeSecurity) GetScopes() *Oauth2Scopes { + if x != nil { + return x.Scopes } return nil } -func (m *Oauth2AccessCodeSecurity) GetAuthorizationUrl() string { - if m != nil { - return m.AuthorizationUrl +func (x *Oauth2AccessCodeSecurity) GetAuthorizationUrl() string { + if x != nil { + return x.AuthorizationUrl } return "" } -func (m *Oauth2AccessCodeSecurity) GetTokenUrl() string { - if m != nil { - return m.TokenUrl +func (x *Oauth2AccessCodeSecurity) GetTokenUrl() string { + if x != nil { + return x.TokenUrl } return "" } -func (m *Oauth2AccessCodeSecurity) GetDescription() string { - if m != nil { - return m.Description +func (x *Oauth2AccessCodeSecurity) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Oauth2AccessCodeSecurity) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Oauth2AccessCodeSecurity) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Oauth2ApplicationSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Oauth2ApplicationSecurity) Reset() { *m = Oauth2ApplicationSecurity{} } -func (m *Oauth2ApplicationSecurity) String() string { return proto.CompactTextString(m) } -func (*Oauth2ApplicationSecurity) ProtoMessage() {} -func (*Oauth2ApplicationSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{32} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Oauth2ApplicationSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2ApplicationSecurity.Unmarshal(m, b) -} -func (m *Oauth2ApplicationSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2ApplicationSecurity.Marshal(b, m, deterministic) + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` + Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` + TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Oauth2ApplicationSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2ApplicationSecurity.Merge(m, src) + +func (x *Oauth2ApplicationSecurity) Reset() { + *x = Oauth2ApplicationSecurity{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Oauth2ApplicationSecurity) XXX_Size() int { - return xxx_messageInfo_Oauth2ApplicationSecurity.Size(m) + +func (x *Oauth2ApplicationSecurity) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Oauth2ApplicationSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2ApplicationSecurity.DiscardUnknown(m) + +func (*Oauth2ApplicationSecurity) ProtoMessage() {} + +func (x *Oauth2ApplicationSecurity) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[32] + 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) } -var xxx_messageInfo_Oauth2ApplicationSecurity proto.InternalMessageInfo +// Deprecated: Use Oauth2ApplicationSecurity.ProtoReflect.Descriptor instead. +func (*Oauth2ApplicationSecurity) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{32} +} -func (m *Oauth2ApplicationSecurity) GetType() string { - if m != nil { - return m.Type +func (x *Oauth2ApplicationSecurity) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *Oauth2ApplicationSecurity) GetFlow() string { - if m != nil { - return m.Flow +func (x *Oauth2ApplicationSecurity) GetFlow() string { + if x != nil { + return x.Flow } return "" } -func (m *Oauth2ApplicationSecurity) GetScopes() *Oauth2Scopes { - if m != nil { - return m.Scopes +func (x *Oauth2ApplicationSecurity) GetScopes() *Oauth2Scopes { + if x != nil { + return x.Scopes } return nil } -func (m *Oauth2ApplicationSecurity) GetTokenUrl() string { - if m != nil { - return m.TokenUrl +func (x *Oauth2ApplicationSecurity) GetTokenUrl() string { + if x != nil { + return x.TokenUrl } return "" } -func (m *Oauth2ApplicationSecurity) GetDescription() string { - if m != nil { - return m.Description +func (x *Oauth2ApplicationSecurity) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Oauth2ApplicationSecurity) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Oauth2ApplicationSecurity) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Oauth2ImplicitSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Oauth2ImplicitSecurity) Reset() { *m = Oauth2ImplicitSecurity{} } -func (m *Oauth2ImplicitSecurity) String() string { return proto.CompactTextString(m) } -func (*Oauth2ImplicitSecurity) ProtoMessage() {} -func (*Oauth2ImplicitSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{33} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Oauth2ImplicitSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2ImplicitSecurity.Unmarshal(m, b) + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` + Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` + AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Oauth2ImplicitSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2ImplicitSecurity.Marshal(b, m, deterministic) -} -func (m *Oauth2ImplicitSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2ImplicitSecurity.Merge(m, src) + +func (x *Oauth2ImplicitSecurity) Reset() { + *x = Oauth2ImplicitSecurity{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Oauth2ImplicitSecurity) XXX_Size() int { - return xxx_messageInfo_Oauth2ImplicitSecurity.Size(m) + +func (x *Oauth2ImplicitSecurity) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Oauth2ImplicitSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2ImplicitSecurity.DiscardUnknown(m) + +func (*Oauth2ImplicitSecurity) ProtoMessage() {} + +func (x *Oauth2ImplicitSecurity) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[33] + 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) } -var xxx_messageInfo_Oauth2ImplicitSecurity proto.InternalMessageInfo +// Deprecated: Use Oauth2ImplicitSecurity.ProtoReflect.Descriptor instead. +func (*Oauth2ImplicitSecurity) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{33} +} -func (m *Oauth2ImplicitSecurity) GetType() string { - if m != nil { - return m.Type +func (x *Oauth2ImplicitSecurity) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *Oauth2ImplicitSecurity) GetFlow() string { - if m != nil { - return m.Flow +func (x *Oauth2ImplicitSecurity) GetFlow() string { + if x != nil { + return x.Flow } return "" } -func (m *Oauth2ImplicitSecurity) GetScopes() *Oauth2Scopes { - if m != nil { - return m.Scopes +func (x *Oauth2ImplicitSecurity) GetScopes() *Oauth2Scopes { + if x != nil { + return x.Scopes } return nil } -func (m *Oauth2ImplicitSecurity) GetAuthorizationUrl() string { - if m != nil { - return m.AuthorizationUrl +func (x *Oauth2ImplicitSecurity) GetAuthorizationUrl() string { + if x != nil { + return x.AuthorizationUrl } return "" } -func (m *Oauth2ImplicitSecurity) GetDescription() string { - if m != nil { - return m.Description +func (x *Oauth2ImplicitSecurity) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Oauth2ImplicitSecurity) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Oauth2ImplicitSecurity) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Oauth2PasswordSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Oauth2PasswordSecurity) Reset() { *m = Oauth2PasswordSecurity{} } -func (m *Oauth2PasswordSecurity) String() string { return proto.CompactTextString(m) } -func (*Oauth2PasswordSecurity) ProtoMessage() {} -func (*Oauth2PasswordSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{34} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Oauth2PasswordSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2PasswordSecurity.Unmarshal(m, b) -} -func (m *Oauth2PasswordSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2PasswordSecurity.Marshal(b, m, deterministic) + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` + Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` + TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Oauth2PasswordSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2PasswordSecurity.Merge(m, src) + +func (x *Oauth2PasswordSecurity) Reset() { + *x = Oauth2PasswordSecurity{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Oauth2PasswordSecurity) XXX_Size() int { - return xxx_messageInfo_Oauth2PasswordSecurity.Size(m) + +func (x *Oauth2PasswordSecurity) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Oauth2PasswordSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2PasswordSecurity.DiscardUnknown(m) + +func (*Oauth2PasswordSecurity) ProtoMessage() {} + +func (x *Oauth2PasswordSecurity) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[34] + 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) } -var xxx_messageInfo_Oauth2PasswordSecurity proto.InternalMessageInfo +// Deprecated: Use Oauth2PasswordSecurity.ProtoReflect.Descriptor instead. +func (*Oauth2PasswordSecurity) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{34} +} -func (m *Oauth2PasswordSecurity) GetType() string { - if m != nil { - return m.Type +func (x *Oauth2PasswordSecurity) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *Oauth2PasswordSecurity) GetFlow() string { - if m != nil { - return m.Flow +func (x *Oauth2PasswordSecurity) GetFlow() string { + if x != nil { + return x.Flow } return "" } -func (m *Oauth2PasswordSecurity) GetScopes() *Oauth2Scopes { - if m != nil { - return m.Scopes +func (x *Oauth2PasswordSecurity) GetScopes() *Oauth2Scopes { + if x != nil { + return x.Scopes } return nil } -func (m *Oauth2PasswordSecurity) GetTokenUrl() string { - if m != nil { - return m.TokenUrl +func (x *Oauth2PasswordSecurity) GetTokenUrl() string { + if x != nil { + return x.TokenUrl } return "" } -func (m *Oauth2PasswordSecurity) GetDescription() string { - if m != nil { - return m.Description +func (x *Oauth2PasswordSecurity) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Oauth2PasswordSecurity) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Oauth2PasswordSecurity) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Oauth2Scopes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + AdditionalProperties []*NamedString `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Oauth2Scopes) Reset() { *m = Oauth2Scopes{} } -func (m *Oauth2Scopes) String() string { return proto.CompactTextString(m) } -func (*Oauth2Scopes) ProtoMessage() {} -func (*Oauth2Scopes) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{35} +func (x *Oauth2Scopes) Reset() { + *x = Oauth2Scopes{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Oauth2Scopes) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2Scopes.Unmarshal(m, b) -} -func (m *Oauth2Scopes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2Scopes.Marshal(b, m, deterministic) -} -func (m *Oauth2Scopes) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2Scopes.Merge(m, src) -} -func (m *Oauth2Scopes) XXX_Size() int { - return xxx_messageInfo_Oauth2Scopes.Size(m) +func (x *Oauth2Scopes) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Oauth2Scopes) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2Scopes.DiscardUnknown(m) + +func (*Oauth2Scopes) ProtoMessage() {} + +func (x *Oauth2Scopes) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[35] + 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) } -var xxx_messageInfo_Oauth2Scopes proto.InternalMessageInfo +// Deprecated: Use Oauth2Scopes.ProtoReflect.Descriptor instead. +func (*Oauth2Scopes) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{35} +} -func (m *Oauth2Scopes) GetAdditionalProperties() []*NamedString { - if m != nil { - return m.AdditionalProperties +func (x *Oauth2Scopes) GetAdditionalProperties() []*NamedString { + if x != nil { + return x.AdditionalProperties } return nil } type Operation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Tags []string `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"` // A brief summary of the operation. Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` @@ -2753,182 +3048,178 @@ type Operation struct { Parameters []*ParametersItem `protobuf:"bytes,8,rep,name=parameters,proto3" json:"parameters,omitempty"` Responses *Responses `protobuf:"bytes,9,opt,name=responses,proto3" json:"responses,omitempty"` // The transfer protocol of the API. - Schemes []string `protobuf:"bytes,10,rep,name=schemes,proto3" json:"schemes,omitempty"` - Deprecated bool `protobuf:"varint,11,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,13,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Operation) Reset() { *m = Operation{} } -func (m *Operation) String() string { return proto.CompactTextString(m) } -func (*Operation) ProtoMessage() {} -func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{36} + Schemes []string `protobuf:"bytes,10,rep,name=schemes,proto3" json:"schemes,omitempty"` + Deprecated bool `protobuf:"varint,11,opt,name=deprecated,proto3" json:"deprecated,omitempty"` + Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,13,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Operation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Operation.Unmarshal(m, b) -} -func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Operation.Marshal(b, m, deterministic) -} -func (m *Operation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation.Merge(m, src) +func (x *Operation) Reset() { + *x = Operation{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Operation) XXX_Size() int { - return xxx_messageInfo_Operation.Size(m) + +func (x *Operation) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Operation) XXX_DiscardUnknown() { - xxx_messageInfo_Operation.DiscardUnknown(m) + +func (*Operation) ProtoMessage() {} + +func (x *Operation) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[36] + 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) } -var xxx_messageInfo_Operation proto.InternalMessageInfo +// Deprecated: Use Operation.ProtoReflect.Descriptor instead. +func (*Operation) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{36} +} -func (m *Operation) GetTags() []string { - if m != nil { - return m.Tags +func (x *Operation) GetTags() []string { + if x != nil { + return x.Tags } return nil } -func (m *Operation) GetSummary() string { - if m != nil { - return m.Summary +func (x *Operation) GetSummary() string { + if x != nil { + return x.Summary } return "" } -func (m *Operation) GetDescription() string { - if m != nil { - return m.Description +func (x *Operation) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Operation) GetExternalDocs() *ExternalDocs { - if m != nil { - return m.ExternalDocs +func (x *Operation) GetExternalDocs() *ExternalDocs { + if x != nil { + return x.ExternalDocs } return nil } -func (m *Operation) GetOperationId() string { - if m != nil { - return m.OperationId +func (x *Operation) GetOperationId() string { + if x != nil { + return x.OperationId } return "" } -func (m *Operation) GetProduces() []string { - if m != nil { - return m.Produces +func (x *Operation) GetProduces() []string { + if x != nil { + return x.Produces } return nil } -func (m *Operation) GetConsumes() []string { - if m != nil { - return m.Consumes +func (x *Operation) GetConsumes() []string { + if x != nil { + return x.Consumes } return nil } -func (m *Operation) GetParameters() []*ParametersItem { - if m != nil { - return m.Parameters +func (x *Operation) GetParameters() []*ParametersItem { + if x != nil { + return x.Parameters } return nil } -func (m *Operation) GetResponses() *Responses { - if m != nil { - return m.Responses +func (x *Operation) GetResponses() *Responses { + if x != nil { + return x.Responses } return nil } -func (m *Operation) GetSchemes() []string { - if m != nil { - return m.Schemes +func (x *Operation) GetSchemes() []string { + if x != nil { + return x.Schemes } return nil } -func (m *Operation) GetDeprecated() bool { - if m != nil { - return m.Deprecated +func (x *Operation) GetDeprecated() bool { + if x != nil { + return x.Deprecated } return false } -func (m *Operation) GetSecurity() []*SecurityRequirement { - if m != nil { - return m.Security +func (x *Operation) GetSecurity() []*SecurityRequirement { + if x != nil { + return x.Security } return nil } -func (m *Operation) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Operation) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Parameter struct { - // Types that are valid to be assigned to Oneof: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Oneof: // *Parameter_BodyParameter // *Parameter_NonBodyParameter - Oneof isParameter_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isParameter_Oneof `protobuf_oneof:"oneof"` } -func (m *Parameter) Reset() { *m = Parameter{} } -func (m *Parameter) String() string { return proto.CompactTextString(m) } -func (*Parameter) ProtoMessage() {} -func (*Parameter) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{37} +func (x *Parameter) Reset() { + *x = Parameter{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Parameter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Parameter.Unmarshal(m, b) -} -func (m *Parameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Parameter.Marshal(b, m, deterministic) -} -func (m *Parameter) XXX_Merge(src proto.Message) { - xxx_messageInfo_Parameter.Merge(m, src) -} -func (m *Parameter) XXX_Size() int { - return xxx_messageInfo_Parameter.Size(m) +func (x *Parameter) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Parameter) XXX_DiscardUnknown() { - xxx_messageInfo_Parameter.DiscardUnknown(m) -} - -var xxx_messageInfo_Parameter proto.InternalMessageInfo -type isParameter_Oneof interface { - isParameter_Oneof() -} +func (*Parameter) ProtoMessage() {} -type Parameter_BodyParameter struct { - BodyParameter *BodyParameter `protobuf:"bytes,1,opt,name=body_parameter,json=bodyParameter,proto3,oneof"` +func (x *Parameter) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[37] + 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) } -type Parameter_NonBodyParameter struct { - NonBodyParameter *NonBodyParameter `protobuf:"bytes,2,opt,name=non_body_parameter,json=nonBodyParameter,proto3,oneof"` +// Deprecated: Use Parameter.ProtoReflect.Descriptor instead. +func (*Parameter) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{37} } -func (*Parameter_BodyParameter) isParameter_Oneof() {} - -func (*Parameter_NonBodyParameter) isParameter_Oneof() {} - func (m *Parameter) GetOneof() isParameter_Oneof { if m != nil { return m.Oneof @@ -2936,119 +3227,127 @@ func (m *Parameter) GetOneof() isParameter_Oneof { return nil } -func (m *Parameter) GetBodyParameter() *BodyParameter { - if x, ok := m.GetOneof().(*Parameter_BodyParameter); ok { +func (x *Parameter) GetBodyParameter() *BodyParameter { + if x, ok := x.GetOneof().(*Parameter_BodyParameter); ok { return x.BodyParameter } return nil } -func (m *Parameter) GetNonBodyParameter() *NonBodyParameter { - if x, ok := m.GetOneof().(*Parameter_NonBodyParameter); ok { +func (x *Parameter) GetNonBodyParameter() *NonBodyParameter { + if x, ok := x.GetOneof().(*Parameter_NonBodyParameter); ok { return x.NonBodyParameter } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Parameter) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Parameter_BodyParameter)(nil), - (*Parameter_NonBodyParameter)(nil), - } +type isParameter_Oneof interface { + isParameter_Oneof() +} + +type Parameter_BodyParameter struct { + BodyParameter *BodyParameter `protobuf:"bytes,1,opt,name=body_parameter,json=bodyParameter,proto3,oneof"` } +type Parameter_NonBodyParameter struct { + NonBodyParameter *NonBodyParameter `protobuf:"bytes,2,opt,name=non_body_parameter,json=nonBodyParameter,proto3,oneof"` +} + +func (*Parameter_BodyParameter) isParameter_Oneof() {} + +func (*Parameter_NonBodyParameter) isParameter_Oneof() {} + // One or more JSON representations for parameters type ParameterDefinitions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + AdditionalProperties []*NamedParameter `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *ParameterDefinitions) Reset() { *m = ParameterDefinitions{} } -func (m *ParameterDefinitions) String() string { return proto.CompactTextString(m) } -func (*ParameterDefinitions) ProtoMessage() {} -func (*ParameterDefinitions) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{38} +func (x *ParameterDefinitions) Reset() { + *x = ParameterDefinitions{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ParameterDefinitions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ParameterDefinitions.Unmarshal(m, b) -} -func (m *ParameterDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ParameterDefinitions.Marshal(b, m, deterministic) +func (x *ParameterDefinitions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ParameterDefinitions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParameterDefinitions.Merge(m, src) -} -func (m *ParameterDefinitions) XXX_Size() int { - return xxx_messageInfo_ParameterDefinitions.Size(m) -} -func (m *ParameterDefinitions) XXX_DiscardUnknown() { - xxx_messageInfo_ParameterDefinitions.DiscardUnknown(m) + +func (*ParameterDefinitions) ProtoMessage() {} + +func (x *ParameterDefinitions) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[38] + 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) } -var xxx_messageInfo_ParameterDefinitions proto.InternalMessageInfo +// Deprecated: Use ParameterDefinitions.ProtoReflect.Descriptor instead. +func (*ParameterDefinitions) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{38} +} -func (m *ParameterDefinitions) GetAdditionalProperties() []*NamedParameter { - if m != nil { - return m.AdditionalProperties +func (x *ParameterDefinitions) GetAdditionalProperties() []*NamedParameter { + if x != nil { + return x.AdditionalProperties } return nil } type ParametersItem struct { - // Types that are valid to be assigned to Oneof: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Oneof: // *ParametersItem_Parameter // *ParametersItem_JsonReference - Oneof isParametersItem_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isParametersItem_Oneof `protobuf_oneof:"oneof"` } -func (m *ParametersItem) Reset() { *m = ParametersItem{} } -func (m *ParametersItem) String() string { return proto.CompactTextString(m) } -func (*ParametersItem) ProtoMessage() {} -func (*ParametersItem) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{39} +func (x *ParametersItem) Reset() { + *x = ParametersItem{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ParametersItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ParametersItem.Unmarshal(m, b) -} -func (m *ParametersItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ParametersItem.Marshal(b, m, deterministic) +func (x *ParametersItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ParametersItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParametersItem.Merge(m, src) -} -func (m *ParametersItem) XXX_Size() int { - return xxx_messageInfo_ParametersItem.Size(m) -} -func (m *ParametersItem) XXX_DiscardUnknown() { - xxx_messageInfo_ParametersItem.DiscardUnknown(m) -} - -var xxx_messageInfo_ParametersItem proto.InternalMessageInfo -type isParametersItem_Oneof interface { - isParametersItem_Oneof() -} +func (*ParametersItem) ProtoMessage() {} -type ParametersItem_Parameter struct { - Parameter *Parameter `protobuf:"bytes,1,opt,name=parameter,proto3,oneof"` +func (x *ParametersItem) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[39] + 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) } -type ParametersItem_JsonReference struct { - JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` +// Deprecated: Use ParametersItem.ProtoReflect.Descriptor instead. +func (*ParametersItem) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{39} } -func (*ParametersItem_Parameter) isParametersItem_Oneof() {} - -func (*ParametersItem_JsonReference) isParametersItem_Oneof() {} - func (m *ParametersItem) GetOneof() isParametersItem_Oneof { if m != nil { return m.Oneof @@ -3056,29 +3355,41 @@ func (m *ParametersItem) GetOneof() isParametersItem_Oneof { return nil } -func (m *ParametersItem) GetParameter() *Parameter { - if x, ok := m.GetOneof().(*ParametersItem_Parameter); ok { +func (x *ParametersItem) GetParameter() *Parameter { + if x, ok := x.GetOneof().(*ParametersItem_Parameter); ok { return x.Parameter } return nil } -func (m *ParametersItem) GetJsonReference() *JsonReference { - if x, ok := m.GetOneof().(*ParametersItem_JsonReference); ok { +func (x *ParametersItem) GetJsonReference() *JsonReference { + if x, ok := x.GetOneof().(*ParametersItem_JsonReference); ok { return x.JsonReference } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ParametersItem) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ParametersItem_Parameter)(nil), - (*ParametersItem_JsonReference)(nil), - } +type isParametersItem_Oneof interface { + isParametersItem_Oneof() +} + +type ParametersItem_Parameter struct { + Parameter *Parameter `protobuf:"bytes,1,opt,name=parameter,proto3,oneof"` +} + +type ParametersItem_JsonReference struct { + JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` } +func (*ParametersItem_Parameter) isParametersItem_Oneof() {} + +func (*ParametersItem_JsonReference) isParametersItem_Oneof() {} + type PathItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` Get *Operation `protobuf:"bytes,2,opt,name=get,proto3" json:"get,omitempty"` Put *Operation `protobuf:"bytes,3,opt,name=put,proto3" json:"put,omitempty"` @@ -3088,109 +3399,117 @@ type PathItem struct { Head *Operation `protobuf:"bytes,7,opt,name=head,proto3" json:"head,omitempty"` Patch *Operation `protobuf:"bytes,8,opt,name=patch,proto3" json:"patch,omitempty"` // The parameters needed to send a valid API call. - Parameters []*ParametersItem `protobuf:"bytes,9,rep,name=parameters,proto3" json:"parameters,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Parameters []*ParametersItem `protobuf:"bytes,9,rep,name=parameters,proto3" json:"parameters,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *PathItem) Reset() { *m = PathItem{} } -func (m *PathItem) String() string { return proto.CompactTextString(m) } -func (*PathItem) ProtoMessage() {} -func (*PathItem) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{40} +func (x *PathItem) Reset() { + *x = PathItem{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PathItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PathItem.Unmarshal(m, b) -} -func (m *PathItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PathItem.Marshal(b, m, deterministic) -} -func (m *PathItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_PathItem.Merge(m, src) -} -func (m *PathItem) XXX_Size() int { - return xxx_messageInfo_PathItem.Size(m) +func (x *PathItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PathItem) XXX_DiscardUnknown() { - xxx_messageInfo_PathItem.DiscardUnknown(m) + +func (*PathItem) ProtoMessage() {} + +func (x *PathItem) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[40] + 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) } -var xxx_messageInfo_PathItem proto.InternalMessageInfo +// Deprecated: Use PathItem.ProtoReflect.Descriptor instead. +func (*PathItem) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{40} +} -func (m *PathItem) GetXRef() string { - if m != nil { - return m.XRef +func (x *PathItem) GetXRef() string { + if x != nil { + return x.XRef } return "" } -func (m *PathItem) GetGet() *Operation { - if m != nil { - return m.Get +func (x *PathItem) GetGet() *Operation { + if x != nil { + return x.Get } return nil } -func (m *PathItem) GetPut() *Operation { - if m != nil { - return m.Put +func (x *PathItem) GetPut() *Operation { + if x != nil { + return x.Put } return nil } -func (m *PathItem) GetPost() *Operation { - if m != nil { - return m.Post +func (x *PathItem) GetPost() *Operation { + if x != nil { + return x.Post } return nil } -func (m *PathItem) GetDelete() *Operation { - if m != nil { - return m.Delete +func (x *PathItem) GetDelete() *Operation { + if x != nil { + return x.Delete } return nil } -func (m *PathItem) GetOptions() *Operation { - if m != nil { - return m.Options +func (x *PathItem) GetOptions() *Operation { + if x != nil { + return x.Options } return nil } -func (m *PathItem) GetHead() *Operation { - if m != nil { - return m.Head +func (x *PathItem) GetHead() *Operation { + if x != nil { + return x.Head } return nil } -func (m *PathItem) GetPatch() *Operation { - if m != nil { - return m.Patch +func (x *PathItem) GetPatch() *Operation { + if x != nil { + return x.Patch } return nil } -func (m *PathItem) GetParameters() []*ParametersItem { - if m != nil { - return m.Parameters +func (x *PathItem) GetParameters() []*ParametersItem { + if x != nil { + return x.Parameters } return nil } -func (m *PathItem) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *PathItem) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type PathParameterSubSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Determines the location of the parameter. @@ -3198,472 +3517,504 @@ type PathParameterSubSchema struct { // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PathParameterSubSchema) Reset() { *m = PathParameterSubSchema{} } -func (m *PathParameterSubSchema) String() string { return proto.CompactTextString(m) } -func (*PathParameterSubSchema) ProtoMessage() {} + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` +} + +func (x *PathParameterSubSchema) Reset() { + *x = PathParameterSubSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PathParameterSubSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PathParameterSubSchema) ProtoMessage() {} + +func (x *PathParameterSubSchema) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[41] + 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 PathParameterSubSchema.ProtoReflect.Descriptor instead. func (*PathParameterSubSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{41} + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{41} } -func (m *PathParameterSubSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PathParameterSubSchema.Unmarshal(m, b) -} -func (m *PathParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PathParameterSubSchema.Marshal(b, m, deterministic) -} -func (m *PathParameterSubSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_PathParameterSubSchema.Merge(m, src) -} -func (m *PathParameterSubSchema) XXX_Size() int { - return xxx_messageInfo_PathParameterSubSchema.Size(m) -} -func (m *PathParameterSubSchema) XXX_DiscardUnknown() { - xxx_messageInfo_PathParameterSubSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_PathParameterSubSchema proto.InternalMessageInfo - -func (m *PathParameterSubSchema) GetRequired() bool { - if m != nil { - return m.Required +func (x *PathParameterSubSchema) GetRequired() bool { + if x != nil { + return x.Required } return false } -func (m *PathParameterSubSchema) GetIn() string { - if m != nil { - return m.In +func (x *PathParameterSubSchema) GetIn() string { + if x != nil { + return x.In } return "" } -func (m *PathParameterSubSchema) GetDescription() string { - if m != nil { - return m.Description +func (x *PathParameterSubSchema) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *PathParameterSubSchema) GetName() string { - if m != nil { - return m.Name +func (x *PathParameterSubSchema) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *PathParameterSubSchema) GetType() string { - if m != nil { - return m.Type +func (x *PathParameterSubSchema) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *PathParameterSubSchema) GetFormat() string { - if m != nil { - return m.Format +func (x *PathParameterSubSchema) GetFormat() string { + if x != nil { + return x.Format } return "" } -func (m *PathParameterSubSchema) GetItems() *PrimitivesItems { - if m != nil { - return m.Items +func (x *PathParameterSubSchema) GetItems() *PrimitivesItems { + if x != nil { + return x.Items } return nil } -func (m *PathParameterSubSchema) GetCollectionFormat() string { - if m != nil { - return m.CollectionFormat +func (x *PathParameterSubSchema) GetCollectionFormat() string { + if x != nil { + return x.CollectionFormat } return "" } -func (m *PathParameterSubSchema) GetDefault() *Any { - if m != nil { - return m.Default +func (x *PathParameterSubSchema) GetDefault() *Any { + if x != nil { + return x.Default } return nil } -func (m *PathParameterSubSchema) GetMaximum() float64 { - if m != nil { - return m.Maximum +func (x *PathParameterSubSchema) GetMaximum() float64 { + if x != nil { + return x.Maximum } return 0 } -func (m *PathParameterSubSchema) GetExclusiveMaximum() bool { - if m != nil { - return m.ExclusiveMaximum +func (x *PathParameterSubSchema) GetExclusiveMaximum() bool { + if x != nil { + return x.ExclusiveMaximum } return false } -func (m *PathParameterSubSchema) GetMinimum() float64 { - if m != nil { - return m.Minimum +func (x *PathParameterSubSchema) GetMinimum() float64 { + if x != nil { + return x.Minimum } return 0 } -func (m *PathParameterSubSchema) GetExclusiveMinimum() bool { - if m != nil { - return m.ExclusiveMinimum +func (x *PathParameterSubSchema) GetExclusiveMinimum() bool { + if x != nil { + return x.ExclusiveMinimum } return false } -func (m *PathParameterSubSchema) GetMaxLength() int64 { - if m != nil { - return m.MaxLength +func (x *PathParameterSubSchema) GetMaxLength() int64 { + if x != nil { + return x.MaxLength } return 0 } -func (m *PathParameterSubSchema) GetMinLength() int64 { - if m != nil { - return m.MinLength +func (x *PathParameterSubSchema) GetMinLength() int64 { + if x != nil { + return x.MinLength } return 0 } -func (m *PathParameterSubSchema) GetPattern() string { - if m != nil { - return m.Pattern +func (x *PathParameterSubSchema) GetPattern() string { + if x != nil { + return x.Pattern } return "" } -func (m *PathParameterSubSchema) GetMaxItems() int64 { - if m != nil { - return m.MaxItems +func (x *PathParameterSubSchema) GetMaxItems() int64 { + if x != nil { + return x.MaxItems } return 0 } -func (m *PathParameterSubSchema) GetMinItems() int64 { - if m != nil { - return m.MinItems +func (x *PathParameterSubSchema) GetMinItems() int64 { + if x != nil { + return x.MinItems } return 0 } -func (m *PathParameterSubSchema) GetUniqueItems() bool { - if m != nil { - return m.UniqueItems +func (x *PathParameterSubSchema) GetUniqueItems() bool { + if x != nil { + return x.UniqueItems } return false } -func (m *PathParameterSubSchema) GetEnum() []*Any { - if m != nil { - return m.Enum +func (x *PathParameterSubSchema) GetEnum() []*Any { + if x != nil { + return x.Enum } return nil } -func (m *PathParameterSubSchema) GetMultipleOf() float64 { - if m != nil { - return m.MultipleOf +func (x *PathParameterSubSchema) GetMultipleOf() float64 { + if x != nil { + return x.MultipleOf } return 0 } -func (m *PathParameterSubSchema) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *PathParameterSubSchema) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } // Relative paths to the individual endpoints. They must be relative to the 'basePath'. type Paths struct { - VendorExtension []*NamedAny `protobuf:"bytes,1,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - Path []*NamedPathItem `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Paths) Reset() { *m = Paths{} } -func (m *Paths) String() string { return proto.CompactTextString(m) } -func (*Paths) ProtoMessage() {} -func (*Paths) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{42} + VendorExtension []*NamedAny `protobuf:"bytes,1,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` + Path []*NamedPathItem `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"` } -func (m *Paths) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Paths.Unmarshal(m, b) -} -func (m *Paths) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Paths.Marshal(b, m, deterministic) -} -func (m *Paths) XXX_Merge(src proto.Message) { - xxx_messageInfo_Paths.Merge(m, src) +func (x *Paths) Reset() { + *x = Paths{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Paths) XXX_Size() int { - return xxx_messageInfo_Paths.Size(m) + +func (x *Paths) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Paths) XXX_DiscardUnknown() { - xxx_messageInfo_Paths.DiscardUnknown(m) + +func (*Paths) ProtoMessage() {} + +func (x *Paths) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[42] + 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) } -var xxx_messageInfo_Paths proto.InternalMessageInfo +// Deprecated: Use Paths.ProtoReflect.Descriptor instead. +func (*Paths) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{42} +} -func (m *Paths) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Paths) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } -func (m *Paths) GetPath() []*NamedPathItem { - if m != nil { - return m.Path +func (x *Paths) GetPath() []*NamedPathItem { + if x != nil { + return x.Path } return nil } type PrimitivesItems struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,18,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PrimitivesItems) Reset() { *m = PrimitivesItems{} } -func (m *PrimitivesItems) String() string { return proto.CompactTextString(m) } -func (*PrimitivesItems) ProtoMessage() {} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,18,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` +} + +func (x *PrimitivesItems) Reset() { + *x = PrimitivesItems{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrimitivesItems) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrimitivesItems) ProtoMessage() {} + +func (x *PrimitivesItems) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[43] + 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 PrimitivesItems.ProtoReflect.Descriptor instead. func (*PrimitivesItems) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{43} -} - -func (m *PrimitivesItems) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PrimitivesItems.Unmarshal(m, b) -} -func (m *PrimitivesItems) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PrimitivesItems.Marshal(b, m, deterministic) -} -func (m *PrimitivesItems) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrimitivesItems.Merge(m, src) -} -func (m *PrimitivesItems) XXX_Size() int { - return xxx_messageInfo_PrimitivesItems.Size(m) -} -func (m *PrimitivesItems) XXX_DiscardUnknown() { - xxx_messageInfo_PrimitivesItems.DiscardUnknown(m) + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{43} } -var xxx_messageInfo_PrimitivesItems proto.InternalMessageInfo - -func (m *PrimitivesItems) GetType() string { - if m != nil { - return m.Type +func (x *PrimitivesItems) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *PrimitivesItems) GetFormat() string { - if m != nil { - return m.Format +func (x *PrimitivesItems) GetFormat() string { + if x != nil { + return x.Format } return "" } -func (m *PrimitivesItems) GetItems() *PrimitivesItems { - if m != nil { - return m.Items +func (x *PrimitivesItems) GetItems() *PrimitivesItems { + if x != nil { + return x.Items } return nil } -func (m *PrimitivesItems) GetCollectionFormat() string { - if m != nil { - return m.CollectionFormat +func (x *PrimitivesItems) GetCollectionFormat() string { + if x != nil { + return x.CollectionFormat } return "" } -func (m *PrimitivesItems) GetDefault() *Any { - if m != nil { - return m.Default +func (x *PrimitivesItems) GetDefault() *Any { + if x != nil { + return x.Default } return nil } -func (m *PrimitivesItems) GetMaximum() float64 { - if m != nil { - return m.Maximum +func (x *PrimitivesItems) GetMaximum() float64 { + if x != nil { + return x.Maximum } return 0 } -func (m *PrimitivesItems) GetExclusiveMaximum() bool { - if m != nil { - return m.ExclusiveMaximum +func (x *PrimitivesItems) GetExclusiveMaximum() bool { + if x != nil { + return x.ExclusiveMaximum } return false } -func (m *PrimitivesItems) GetMinimum() float64 { - if m != nil { - return m.Minimum +func (x *PrimitivesItems) GetMinimum() float64 { + if x != nil { + return x.Minimum } return 0 } -func (m *PrimitivesItems) GetExclusiveMinimum() bool { - if m != nil { - return m.ExclusiveMinimum +func (x *PrimitivesItems) GetExclusiveMinimum() bool { + if x != nil { + return x.ExclusiveMinimum } return false } -func (m *PrimitivesItems) GetMaxLength() int64 { - if m != nil { - return m.MaxLength +func (x *PrimitivesItems) GetMaxLength() int64 { + if x != nil { + return x.MaxLength } return 0 } -func (m *PrimitivesItems) GetMinLength() int64 { - if m != nil { - return m.MinLength +func (x *PrimitivesItems) GetMinLength() int64 { + if x != nil { + return x.MinLength } return 0 } -func (m *PrimitivesItems) GetPattern() string { - if m != nil { - return m.Pattern +func (x *PrimitivesItems) GetPattern() string { + if x != nil { + return x.Pattern } return "" } -func (m *PrimitivesItems) GetMaxItems() int64 { - if m != nil { - return m.MaxItems +func (x *PrimitivesItems) GetMaxItems() int64 { + if x != nil { + return x.MaxItems } return 0 } -func (m *PrimitivesItems) GetMinItems() int64 { - if m != nil { - return m.MinItems +func (x *PrimitivesItems) GetMinItems() int64 { + if x != nil { + return x.MinItems } return 0 } -func (m *PrimitivesItems) GetUniqueItems() bool { - if m != nil { - return m.UniqueItems +func (x *PrimitivesItems) GetUniqueItems() bool { + if x != nil { + return x.UniqueItems } return false } -func (m *PrimitivesItems) GetEnum() []*Any { - if m != nil { - return m.Enum +func (x *PrimitivesItems) GetEnum() []*Any { + if x != nil { + return x.Enum } return nil } -func (m *PrimitivesItems) GetMultipleOf() float64 { - if m != nil { - return m.MultipleOf +func (x *PrimitivesItems) GetMultipleOf() float64 { + if x != nil { + return x.MultipleOf } return 0 } -func (m *PrimitivesItems) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *PrimitivesItems) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Properties struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Properties) Reset() { *m = Properties{} } -func (m *Properties) String() string { return proto.CompactTextString(m) } -func (*Properties) ProtoMessage() {} -func (*Properties) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{44} +func (x *Properties) Reset() { + *x = Properties{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Properties) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Properties.Unmarshal(m, b) -} -func (m *Properties) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Properties.Marshal(b, m, deterministic) -} -func (m *Properties) XXX_Merge(src proto.Message) { - xxx_messageInfo_Properties.Merge(m, src) -} -func (m *Properties) XXX_Size() int { - return xxx_messageInfo_Properties.Size(m) +func (x *Properties) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Properties) XXX_DiscardUnknown() { - xxx_messageInfo_Properties.DiscardUnknown(m) + +func (*Properties) ProtoMessage() {} + +func (x *Properties) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[44] + 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) } -var xxx_messageInfo_Properties proto.InternalMessageInfo +// Deprecated: Use Properties.ProtoReflect.Descriptor instead. +func (*Properties) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{44} +} -func (m *Properties) GetAdditionalProperties() []*NamedSchema { - if m != nil { - return m.AdditionalProperties +func (x *Properties) GetAdditionalProperties() []*NamedSchema { + if x != nil { + return x.AdditionalProperties } return nil } type QueryParameterSubSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Determines the location of the parameter. @@ -3673,378 +4024,390 @@ type QueryParameterSubSchema struct { // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // allows sending a parameter by name only or with an empty value. - AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryParameterSubSchema) Reset() { *m = QueryParameterSubSchema{} } -func (m *QueryParameterSubSchema) String() string { return proto.CompactTextString(m) } -func (*QueryParameterSubSchema) ProtoMessage() {} + AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` + Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` + Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` +} + +func (x *QueryParameterSubSchema) Reset() { + *x = QueryParameterSubSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParameterSubSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParameterSubSchema) ProtoMessage() {} + +func (x *QueryParameterSubSchema) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[45] + 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 QueryParameterSubSchema.ProtoReflect.Descriptor instead. func (*QueryParameterSubSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{45} + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{45} } -func (m *QueryParameterSubSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryParameterSubSchema.Unmarshal(m, b) -} -func (m *QueryParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryParameterSubSchema.Marshal(b, m, deterministic) -} -func (m *QueryParameterSubSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParameterSubSchema.Merge(m, src) -} -func (m *QueryParameterSubSchema) XXX_Size() int { - return xxx_messageInfo_QueryParameterSubSchema.Size(m) -} -func (m *QueryParameterSubSchema) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParameterSubSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParameterSubSchema proto.InternalMessageInfo - -func (m *QueryParameterSubSchema) GetRequired() bool { - if m != nil { - return m.Required +func (x *QueryParameterSubSchema) GetRequired() bool { + if x != nil { + return x.Required } return false } -func (m *QueryParameterSubSchema) GetIn() string { - if m != nil { - return m.In +func (x *QueryParameterSubSchema) GetIn() string { + if x != nil { + return x.In } return "" } -func (m *QueryParameterSubSchema) GetDescription() string { - if m != nil { - return m.Description +func (x *QueryParameterSubSchema) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *QueryParameterSubSchema) GetName() string { - if m != nil { - return m.Name +func (x *QueryParameterSubSchema) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *QueryParameterSubSchema) GetAllowEmptyValue() bool { - if m != nil { - return m.AllowEmptyValue +func (x *QueryParameterSubSchema) GetAllowEmptyValue() bool { + if x != nil { + return x.AllowEmptyValue } return false } -func (m *QueryParameterSubSchema) GetType() string { - if m != nil { - return m.Type +func (x *QueryParameterSubSchema) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *QueryParameterSubSchema) GetFormat() string { - if m != nil { - return m.Format +func (x *QueryParameterSubSchema) GetFormat() string { + if x != nil { + return x.Format } return "" } -func (m *QueryParameterSubSchema) GetItems() *PrimitivesItems { - if m != nil { - return m.Items +func (x *QueryParameterSubSchema) GetItems() *PrimitivesItems { + if x != nil { + return x.Items } return nil } -func (m *QueryParameterSubSchema) GetCollectionFormat() string { - if m != nil { - return m.CollectionFormat +func (x *QueryParameterSubSchema) GetCollectionFormat() string { + if x != nil { + return x.CollectionFormat } return "" } -func (m *QueryParameterSubSchema) GetDefault() *Any { - if m != nil { - return m.Default +func (x *QueryParameterSubSchema) GetDefault() *Any { + if x != nil { + return x.Default } return nil } -func (m *QueryParameterSubSchema) GetMaximum() float64 { - if m != nil { - return m.Maximum +func (x *QueryParameterSubSchema) GetMaximum() float64 { + if x != nil { + return x.Maximum } return 0 } -func (m *QueryParameterSubSchema) GetExclusiveMaximum() bool { - if m != nil { - return m.ExclusiveMaximum +func (x *QueryParameterSubSchema) GetExclusiveMaximum() bool { + if x != nil { + return x.ExclusiveMaximum } return false } -func (m *QueryParameterSubSchema) GetMinimum() float64 { - if m != nil { - return m.Minimum +func (x *QueryParameterSubSchema) GetMinimum() float64 { + if x != nil { + return x.Minimum } return 0 } -func (m *QueryParameterSubSchema) GetExclusiveMinimum() bool { - if m != nil { - return m.ExclusiveMinimum +func (x *QueryParameterSubSchema) GetExclusiveMinimum() bool { + if x != nil { + return x.ExclusiveMinimum } return false } -func (m *QueryParameterSubSchema) GetMaxLength() int64 { - if m != nil { - return m.MaxLength +func (x *QueryParameterSubSchema) GetMaxLength() int64 { + if x != nil { + return x.MaxLength } return 0 } -func (m *QueryParameterSubSchema) GetMinLength() int64 { - if m != nil { - return m.MinLength +func (x *QueryParameterSubSchema) GetMinLength() int64 { + if x != nil { + return x.MinLength } return 0 } -func (m *QueryParameterSubSchema) GetPattern() string { - if m != nil { - return m.Pattern +func (x *QueryParameterSubSchema) GetPattern() string { + if x != nil { + return x.Pattern } return "" } -func (m *QueryParameterSubSchema) GetMaxItems() int64 { - if m != nil { - return m.MaxItems +func (x *QueryParameterSubSchema) GetMaxItems() int64 { + if x != nil { + return x.MaxItems } return 0 } -func (m *QueryParameterSubSchema) GetMinItems() int64 { - if m != nil { - return m.MinItems +func (x *QueryParameterSubSchema) GetMinItems() int64 { + if x != nil { + return x.MinItems } return 0 } -func (m *QueryParameterSubSchema) GetUniqueItems() bool { - if m != nil { - return m.UniqueItems +func (x *QueryParameterSubSchema) GetUniqueItems() bool { + if x != nil { + return x.UniqueItems } return false } -func (m *QueryParameterSubSchema) GetEnum() []*Any { - if m != nil { - return m.Enum +func (x *QueryParameterSubSchema) GetEnum() []*Any { + if x != nil { + return x.Enum } return nil } -func (m *QueryParameterSubSchema) GetMultipleOf() float64 { - if m != nil { - return m.MultipleOf +func (x *QueryParameterSubSchema) GetMultipleOf() float64 { + if x != nil { + return x.MultipleOf } return 0 } -func (m *QueryParameterSubSchema) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *QueryParameterSubSchema) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type Response struct { - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Schema *SchemaItem `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - Headers *Headers `protobuf:"bytes,3,opt,name=headers,proto3" json:"headers,omitempty"` - Examples *Examples `protobuf:"bytes,4,opt,name=examples,proto3" json:"examples,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{46} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Response) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Response.Unmarshal(m, b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + Schema *SchemaItem `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` + Headers *Headers `protobuf:"bytes,3,opt,name=headers,proto3" json:"headers,omitempty"` + Examples *Examples `protobuf:"bytes,4,opt,name=examples,proto3" json:"examples,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) + +func (x *Response) Reset() { + *x = Response{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Response) XXX_Size() int { - return xxx_messageInfo_Response.Size(m) + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[46] + 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) } -var xxx_messageInfo_Response proto.InternalMessageInfo +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{46} +} -func (m *Response) GetDescription() string { - if m != nil { - return m.Description +func (x *Response) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Response) GetSchema() *SchemaItem { - if m != nil { - return m.Schema +func (x *Response) GetSchema() *SchemaItem { + if x != nil { + return x.Schema } return nil } -func (m *Response) GetHeaders() *Headers { - if m != nil { - return m.Headers +func (x *Response) GetHeaders() *Headers { + if x != nil { + return x.Headers } return nil } -func (m *Response) GetExamples() *Examples { - if m != nil { - return m.Examples +func (x *Response) GetExamples() *Examples { + if x != nil { + return x.Examples } return nil } -func (m *Response) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Response) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } -// One or more JSON representations for parameters +// One or more JSON representations for responses type ResponseDefinitions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + AdditionalProperties []*NamedResponse `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *ResponseDefinitions) Reset() { *m = ResponseDefinitions{} } -func (m *ResponseDefinitions) String() string { return proto.CompactTextString(m) } -func (*ResponseDefinitions) ProtoMessage() {} -func (*ResponseDefinitions) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{47} +func (x *ResponseDefinitions) Reset() { + *x = ResponseDefinitions{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ResponseDefinitions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResponseDefinitions.Unmarshal(m, b) -} -func (m *ResponseDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResponseDefinitions.Marshal(b, m, deterministic) +func (x *ResponseDefinitions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ResponseDefinitions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseDefinitions.Merge(m, src) -} -func (m *ResponseDefinitions) XXX_Size() int { - return xxx_messageInfo_ResponseDefinitions.Size(m) -} -func (m *ResponseDefinitions) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseDefinitions.DiscardUnknown(m) + +func (*ResponseDefinitions) ProtoMessage() {} + +func (x *ResponseDefinitions) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[47] + 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) } -var xxx_messageInfo_ResponseDefinitions proto.InternalMessageInfo +// Deprecated: Use ResponseDefinitions.ProtoReflect.Descriptor instead. +func (*ResponseDefinitions) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{47} +} -func (m *ResponseDefinitions) GetAdditionalProperties() []*NamedResponse { - if m != nil { - return m.AdditionalProperties +func (x *ResponseDefinitions) GetAdditionalProperties() []*NamedResponse { + if x != nil { + return x.AdditionalProperties } return nil } type ResponseValue struct { - // Types that are valid to be assigned to Oneof: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Oneof: // *ResponseValue_Response // *ResponseValue_JsonReference - Oneof isResponseValue_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isResponseValue_Oneof `protobuf_oneof:"oneof"` } -func (m *ResponseValue) Reset() { *m = ResponseValue{} } -func (m *ResponseValue) String() string { return proto.CompactTextString(m) } -func (*ResponseValue) ProtoMessage() {} -func (*ResponseValue) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{48} +func (x *ResponseValue) Reset() { + *x = ResponseValue{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ResponseValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResponseValue.Unmarshal(m, b) -} -func (m *ResponseValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResponseValue.Marshal(b, m, deterministic) -} -func (m *ResponseValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseValue.Merge(m, src) -} -func (m *ResponseValue) XXX_Size() int { - return xxx_messageInfo_ResponseValue.Size(m) -} -func (m *ResponseValue) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseValue.DiscardUnknown(m) +func (x *ResponseValue) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_ResponseValue proto.InternalMessageInfo +func (*ResponseValue) ProtoMessage() {} -type isResponseValue_Oneof interface { - isResponseValue_Oneof() -} - -type ResponseValue_Response struct { - Response *Response `protobuf:"bytes,1,opt,name=response,proto3,oneof"` +func (x *ResponseValue) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[48] + 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) } -type ResponseValue_JsonReference struct { - JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` +// Deprecated: Use ResponseValue.ProtoReflect.Descriptor instead. +func (*ResponseValue) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{48} } -func (*ResponseValue_Response) isResponseValue_Oneof() {} - -func (*ResponseValue_JsonReference) isResponseValue_Oneof() {} - func (m *ResponseValue) GetOneof() isResponseValue_Oneof { if m != nil { return m.Oneof @@ -4052,78 +4415,98 @@ func (m *ResponseValue) GetOneof() isResponseValue_Oneof { return nil } -func (m *ResponseValue) GetResponse() *Response { - if x, ok := m.GetOneof().(*ResponseValue_Response); ok { +func (x *ResponseValue) GetResponse() *Response { + if x, ok := x.GetOneof().(*ResponseValue_Response); ok { return x.Response } return nil } -func (m *ResponseValue) GetJsonReference() *JsonReference { - if x, ok := m.GetOneof().(*ResponseValue_JsonReference); ok { +func (x *ResponseValue) GetJsonReference() *JsonReference { + if x, ok := x.GetOneof().(*ResponseValue_JsonReference); ok { return x.JsonReference } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ResponseValue) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ResponseValue_Response)(nil), - (*ResponseValue_JsonReference)(nil), - } +type isResponseValue_Oneof interface { + isResponseValue_Oneof() } -// Response objects names can either be any valid HTTP status code or 'default'. -type Responses struct { - ResponseCode []*NamedResponseValue `protobuf:"bytes,1,rep,name=response_code,json=responseCode,proto3" json:"response_code,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,2,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type ResponseValue_Response struct { + Response *Response `protobuf:"bytes,1,opt,name=response,proto3,oneof"` } -func (m *Responses) Reset() { *m = Responses{} } -func (m *Responses) String() string { return proto.CompactTextString(m) } -func (*Responses) ProtoMessage() {} -func (*Responses) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{49} +type ResponseValue_JsonReference struct { + JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` } -func (m *Responses) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Responses.Unmarshal(m, b) -} -func (m *Responses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Responses.Marshal(b, m, deterministic) +func (*ResponseValue_Response) isResponseValue_Oneof() {} + +func (*ResponseValue_JsonReference) isResponseValue_Oneof() {} + +// Response objects names can either be any valid HTTP status code or 'default'. +type Responses struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResponseCode []*NamedResponseValue `protobuf:"bytes,1,rep,name=response_code,json=responseCode,proto3" json:"response_code,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,2,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Responses) XXX_Merge(src proto.Message) { - xxx_messageInfo_Responses.Merge(m, src) + +func (x *Responses) Reset() { + *x = Responses{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Responses) XXX_Size() int { - return xxx_messageInfo_Responses.Size(m) + +func (x *Responses) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Responses) XXX_DiscardUnknown() { - xxx_messageInfo_Responses.DiscardUnknown(m) + +func (*Responses) ProtoMessage() {} + +func (x *Responses) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[49] + 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) } -var xxx_messageInfo_Responses proto.InternalMessageInfo +// Deprecated: Use Responses.ProtoReflect.Descriptor instead. +func (*Responses) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{49} +} -func (m *Responses) GetResponseCode() []*NamedResponseValue { - if m != nil { - return m.ResponseCode +func (x *Responses) GetResponseCode() []*NamedResponseValue { + if x != nil { + return x.ResponseCode } return nil } -func (m *Responses) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Responses) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } // A deterministic version of a JSON Schema object. type Schema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` @@ -4155,304 +4538,300 @@ type Schema struct { ExternalDocs *ExternalDocs `protobuf:"bytes,29,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` Example *Any `protobuf:"bytes,30,opt,name=example,proto3" json:"example,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,31,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Schema) Reset() { *m = Schema{} } -func (m *Schema) String() string { return proto.CompactTextString(m) } -func (*Schema) ProtoMessage() {} -func (*Schema) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{50} +func (x *Schema) Reset() { + *x = Schema{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Schema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Schema.Unmarshal(m, b) -} -func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Schema.Marshal(b, m, deterministic) -} -func (m *Schema) XXX_Merge(src proto.Message) { - xxx_messageInfo_Schema.Merge(m, src) -} -func (m *Schema) XXX_Size() int { - return xxx_messageInfo_Schema.Size(m) +func (x *Schema) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Schema) XXX_DiscardUnknown() { - xxx_messageInfo_Schema.DiscardUnknown(m) + +func (*Schema) ProtoMessage() {} + +func (x *Schema) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[50] + 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) } -var xxx_messageInfo_Schema proto.InternalMessageInfo +// Deprecated: Use Schema.ProtoReflect.Descriptor instead. +func (*Schema) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{50} +} -func (m *Schema) GetXRef() string { - if m != nil { - return m.XRef +func (x *Schema) GetXRef() string { + if x != nil { + return x.XRef } return "" } -func (m *Schema) GetFormat() string { - if m != nil { - return m.Format +func (x *Schema) GetFormat() string { + if x != nil { + return x.Format } return "" } -func (m *Schema) GetTitle() string { - if m != nil { - return m.Title +func (x *Schema) GetTitle() string { + if x != nil { + return x.Title } return "" } -func (m *Schema) GetDescription() string { - if m != nil { - return m.Description +func (x *Schema) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Schema) GetDefault() *Any { - if m != nil { - return m.Default +func (x *Schema) GetDefault() *Any { + if x != nil { + return x.Default } return nil } -func (m *Schema) GetMultipleOf() float64 { - if m != nil { - return m.MultipleOf +func (x *Schema) GetMultipleOf() float64 { + if x != nil { + return x.MultipleOf } return 0 } -func (m *Schema) GetMaximum() float64 { - if m != nil { - return m.Maximum +func (x *Schema) GetMaximum() float64 { + if x != nil { + return x.Maximum } return 0 } -func (m *Schema) GetExclusiveMaximum() bool { - if m != nil { - return m.ExclusiveMaximum +func (x *Schema) GetExclusiveMaximum() bool { + if x != nil { + return x.ExclusiveMaximum } return false } -func (m *Schema) GetMinimum() float64 { - if m != nil { - return m.Minimum +func (x *Schema) GetMinimum() float64 { + if x != nil { + return x.Minimum } return 0 } -func (m *Schema) GetExclusiveMinimum() bool { - if m != nil { - return m.ExclusiveMinimum +func (x *Schema) GetExclusiveMinimum() bool { + if x != nil { + return x.ExclusiveMinimum } return false } -func (m *Schema) GetMaxLength() int64 { - if m != nil { - return m.MaxLength +func (x *Schema) GetMaxLength() int64 { + if x != nil { + return x.MaxLength } return 0 } -func (m *Schema) GetMinLength() int64 { - if m != nil { - return m.MinLength +func (x *Schema) GetMinLength() int64 { + if x != nil { + return x.MinLength } return 0 } -func (m *Schema) GetPattern() string { - if m != nil { - return m.Pattern +func (x *Schema) GetPattern() string { + if x != nil { + return x.Pattern } return "" } -func (m *Schema) GetMaxItems() int64 { - if m != nil { - return m.MaxItems +func (x *Schema) GetMaxItems() int64 { + if x != nil { + return x.MaxItems } return 0 } -func (m *Schema) GetMinItems() int64 { - if m != nil { - return m.MinItems +func (x *Schema) GetMinItems() int64 { + if x != nil { + return x.MinItems } return 0 } -func (m *Schema) GetUniqueItems() bool { - if m != nil { - return m.UniqueItems +func (x *Schema) GetUniqueItems() bool { + if x != nil { + return x.UniqueItems } return false } -func (m *Schema) GetMaxProperties() int64 { - if m != nil { - return m.MaxProperties +func (x *Schema) GetMaxProperties() int64 { + if x != nil { + return x.MaxProperties } return 0 } -func (m *Schema) GetMinProperties() int64 { - if m != nil { - return m.MinProperties +func (x *Schema) GetMinProperties() int64 { + if x != nil { + return x.MinProperties } return 0 } -func (m *Schema) GetRequired() []string { - if m != nil { - return m.Required +func (x *Schema) GetRequired() []string { + if x != nil { + return x.Required } return nil } -func (m *Schema) GetEnum() []*Any { - if m != nil { - return m.Enum +func (x *Schema) GetEnum() []*Any { + if x != nil { + return x.Enum } return nil } -func (m *Schema) GetAdditionalProperties() *AdditionalPropertiesItem { - if m != nil { - return m.AdditionalProperties +func (x *Schema) GetAdditionalProperties() *AdditionalPropertiesItem { + if x != nil { + return x.AdditionalProperties } return nil } -func (m *Schema) GetType() *TypeItem { - if m != nil { - return m.Type +func (x *Schema) GetType() *TypeItem { + if x != nil { + return x.Type } return nil } -func (m *Schema) GetItems() *ItemsItem { - if m != nil { - return m.Items +func (x *Schema) GetItems() *ItemsItem { + if x != nil { + return x.Items } return nil } -func (m *Schema) GetAllOf() []*Schema { - if m != nil { - return m.AllOf +func (x *Schema) GetAllOf() []*Schema { + if x != nil { + return x.AllOf } return nil } -func (m *Schema) GetProperties() *Properties { - if m != nil { - return m.Properties +func (x *Schema) GetProperties() *Properties { + if x != nil { + return x.Properties } return nil } -func (m *Schema) GetDiscriminator() string { - if m != nil { - return m.Discriminator +func (x *Schema) GetDiscriminator() string { + if x != nil { + return x.Discriminator } return "" } -func (m *Schema) GetReadOnly() bool { - if m != nil { - return m.ReadOnly +func (x *Schema) GetReadOnly() bool { + if x != nil { + return x.ReadOnly } return false } -func (m *Schema) GetXml() *Xml { - if m != nil { - return m.Xml +func (x *Schema) GetXml() *Xml { + if x != nil { + return x.Xml } return nil } -func (m *Schema) GetExternalDocs() *ExternalDocs { - if m != nil { - return m.ExternalDocs +func (x *Schema) GetExternalDocs() *ExternalDocs { + if x != nil { + return x.ExternalDocs } return nil } -func (m *Schema) GetExample() *Any { - if m != nil { - return m.Example +func (x *Schema) GetExample() *Any { + if x != nil { + return x.Example } return nil } -func (m *Schema) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Schema) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type SchemaItem struct { - // Types that are valid to be assigned to Oneof: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Oneof: // *SchemaItem_Schema // *SchemaItem_FileSchema - Oneof isSchemaItem_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isSchemaItem_Oneof `protobuf_oneof:"oneof"` } -func (m *SchemaItem) Reset() { *m = SchemaItem{} } -func (m *SchemaItem) String() string { return proto.CompactTextString(m) } -func (*SchemaItem) ProtoMessage() {} -func (*SchemaItem) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{51} +func (x *SchemaItem) Reset() { + *x = SchemaItem{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SchemaItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SchemaItem.Unmarshal(m, b) -} -func (m *SchemaItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SchemaItem.Marshal(b, m, deterministic) -} -func (m *SchemaItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_SchemaItem.Merge(m, src) +func (x *SchemaItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SchemaItem) XXX_Size() int { - return xxx_messageInfo_SchemaItem.Size(m) -} -func (m *SchemaItem) XXX_DiscardUnknown() { - xxx_messageInfo_SchemaItem.DiscardUnknown(m) -} - -var xxx_messageInfo_SchemaItem proto.InternalMessageInfo -type isSchemaItem_Oneof interface { - isSchemaItem_Oneof() -} +func (*SchemaItem) ProtoMessage() {} -type SchemaItem_Schema struct { - Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` +func (x *SchemaItem) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[51] + 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) } -type SchemaItem_FileSchema struct { - FileSchema *FileSchema `protobuf:"bytes,2,opt,name=file_schema,json=fileSchema,proto3,oneof"` +// Deprecated: Use SchemaItem.ProtoReflect.Descriptor instead. +func (*SchemaItem) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{51} } -func (*SchemaItem_Schema) isSchemaItem_Oneof() {} - -func (*SchemaItem_FileSchema) isSchemaItem_Oneof() {} - func (m *SchemaItem) GetOneof() isSchemaItem_Oneof { if m != nil { return m.Oneof @@ -4460,105 +4839,178 @@ func (m *SchemaItem) GetOneof() isSchemaItem_Oneof { return nil } -func (m *SchemaItem) GetSchema() *Schema { - if x, ok := m.GetOneof().(*SchemaItem_Schema); ok { +func (x *SchemaItem) GetSchema() *Schema { + if x, ok := x.GetOneof().(*SchemaItem_Schema); ok { return x.Schema } return nil } -func (m *SchemaItem) GetFileSchema() *FileSchema { - if x, ok := m.GetOneof().(*SchemaItem_FileSchema); ok { +func (x *SchemaItem) GetFileSchema() *FileSchema { + if x, ok := x.GetOneof().(*SchemaItem_FileSchema); ok { return x.FileSchema } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SchemaItem) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SchemaItem_Schema)(nil), - (*SchemaItem_FileSchema)(nil), - } +type isSchemaItem_Oneof interface { + isSchemaItem_Oneof() } -type SecurityDefinitions struct { - AdditionalProperties []*NamedSecurityDefinitionsItem `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type SchemaItem_Schema struct { + Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` } -func (m *SecurityDefinitions) Reset() { *m = SecurityDefinitions{} } -func (m *SecurityDefinitions) String() string { return proto.CompactTextString(m) } -func (*SecurityDefinitions) ProtoMessage() {} -func (*SecurityDefinitions) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{52} +type SchemaItem_FileSchema struct { + FileSchema *FileSchema `protobuf:"bytes,2,opt,name=file_schema,json=fileSchema,proto3,oneof"` } -func (m *SecurityDefinitions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityDefinitions.Unmarshal(m, b) -} -func (m *SecurityDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityDefinitions.Marshal(b, m, deterministic) +func (*SchemaItem_Schema) isSchemaItem_Oneof() {} + +func (*SchemaItem_FileSchema) isSchemaItem_Oneof() {} + +type SecurityDefinitions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AdditionalProperties []*NamedSecurityDefinitionsItem `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } -func (m *SecurityDefinitions) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityDefinitions.Merge(m, src) + +func (x *SecurityDefinitions) Reset() { + *x = SecurityDefinitions{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SecurityDefinitions) XXX_Size() int { - return xxx_messageInfo_SecurityDefinitions.Size(m) + +func (x *SecurityDefinitions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SecurityDefinitions) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityDefinitions.DiscardUnknown(m) + +func (*SecurityDefinitions) ProtoMessage() {} + +func (x *SecurityDefinitions) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[52] + 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) } -var xxx_messageInfo_SecurityDefinitions proto.InternalMessageInfo +// Deprecated: Use SecurityDefinitions.ProtoReflect.Descriptor instead. +func (*SecurityDefinitions) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{52} +} -func (m *SecurityDefinitions) GetAdditionalProperties() []*NamedSecurityDefinitionsItem { - if m != nil { - return m.AdditionalProperties +func (x *SecurityDefinitions) GetAdditionalProperties() []*NamedSecurityDefinitionsItem { + if x != nil { + return x.AdditionalProperties } return nil } type SecurityDefinitionsItem struct { - // Types that are valid to be assigned to Oneof: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Oneof: // *SecurityDefinitionsItem_BasicAuthenticationSecurity // *SecurityDefinitionsItem_ApiKeySecurity // *SecurityDefinitionsItem_Oauth2ImplicitSecurity // *SecurityDefinitionsItem_Oauth2PasswordSecurity // *SecurityDefinitionsItem_Oauth2ApplicationSecurity // *SecurityDefinitionsItem_Oauth2AccessCodeSecurity - Oneof isSecurityDefinitionsItem_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isSecurityDefinitionsItem_Oneof `protobuf_oneof:"oneof"` } -func (m *SecurityDefinitionsItem) Reset() { *m = SecurityDefinitionsItem{} } -func (m *SecurityDefinitionsItem) String() string { return proto.CompactTextString(m) } -func (*SecurityDefinitionsItem) ProtoMessage() {} +func (x *SecurityDefinitionsItem) Reset() { + *x = SecurityDefinitionsItem{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SecurityDefinitionsItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecurityDefinitionsItem) ProtoMessage() {} + +func (x *SecurityDefinitionsItem) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[53] + 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 SecurityDefinitionsItem.ProtoReflect.Descriptor instead. func (*SecurityDefinitionsItem) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{53} + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{53} } -func (m *SecurityDefinitionsItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityDefinitionsItem.Unmarshal(m, b) +func (m *SecurityDefinitionsItem) GetOneof() isSecurityDefinitionsItem_Oneof { + if m != nil { + return m.Oneof + } + return nil } -func (m *SecurityDefinitionsItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityDefinitionsItem.Marshal(b, m, deterministic) + +func (x *SecurityDefinitionsItem) GetBasicAuthenticationSecurity() *BasicAuthenticationSecurity { + if x, ok := x.GetOneof().(*SecurityDefinitionsItem_BasicAuthenticationSecurity); ok { + return x.BasicAuthenticationSecurity + } + return nil +} + +func (x *SecurityDefinitionsItem) GetApiKeySecurity() *ApiKeySecurity { + if x, ok := x.GetOneof().(*SecurityDefinitionsItem_ApiKeySecurity); ok { + return x.ApiKeySecurity + } + return nil } -func (m *SecurityDefinitionsItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityDefinitionsItem.Merge(m, src) + +func (x *SecurityDefinitionsItem) GetOauth2ImplicitSecurity() *Oauth2ImplicitSecurity { + if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2ImplicitSecurity); ok { + return x.Oauth2ImplicitSecurity + } + return nil } -func (m *SecurityDefinitionsItem) XXX_Size() int { - return xxx_messageInfo_SecurityDefinitionsItem.Size(m) + +func (x *SecurityDefinitionsItem) GetOauth2PasswordSecurity() *Oauth2PasswordSecurity { + if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2PasswordSecurity); ok { + return x.Oauth2PasswordSecurity + } + return nil } -func (m *SecurityDefinitionsItem) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityDefinitionsItem.DiscardUnknown(m) + +func (x *SecurityDefinitionsItem) GetOauth2ApplicationSecurity() *Oauth2ApplicationSecurity { + if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2ApplicationSecurity); ok { + return x.Oauth2ApplicationSecurity + } + return nil } -var xxx_messageInfo_SecurityDefinitionsItem proto.InternalMessageInfo +func (x *SecurityDefinitionsItem) GetOauth2AccessCodeSecurity() *Oauth2AccessCodeSecurity { + if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity); ok { + return x.Oauth2AccessCodeSecurity + } + return nil +} type isSecurityDefinitionsItem_Oneof interface { isSecurityDefinitionsItem_Oneof() @@ -4600,627 +5052,2296 @@ func (*SecurityDefinitionsItem_Oauth2ApplicationSecurity) isSecurityDefinitionsI func (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) isSecurityDefinitionsItem_Oneof() {} -func (m *SecurityDefinitionsItem) GetOneof() isSecurityDefinitionsItem_Oneof { - if m != nil { - return m.Oneof - } - return nil +type SecurityRequirement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AdditionalProperties []*NamedStringArray `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } -func (m *SecurityDefinitionsItem) GetBasicAuthenticationSecurity() *BasicAuthenticationSecurity { - if x, ok := m.GetOneof().(*SecurityDefinitionsItem_BasicAuthenticationSecurity); ok { - return x.BasicAuthenticationSecurity +func (x *SecurityRequirement) Reset() { + *x = SecurityRequirement{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (m *SecurityDefinitionsItem) GetApiKeySecurity() *ApiKeySecurity { - if x, ok := m.GetOneof().(*SecurityDefinitionsItem_ApiKeySecurity); ok { - return x.ApiKeySecurity - } - return nil +func (x *SecurityRequirement) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SecurityDefinitionsItem) GetOauth2ImplicitSecurity() *Oauth2ImplicitSecurity { - if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2ImplicitSecurity); ok { - return x.Oauth2ImplicitSecurity +func (*SecurityRequirement) ProtoMessage() {} + +func (x *SecurityRequirement) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[54] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (m *SecurityDefinitionsItem) GetOauth2PasswordSecurity() *Oauth2PasswordSecurity { - if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2PasswordSecurity); ok { - return x.Oauth2PasswordSecurity - } - return nil +// Deprecated: Use SecurityRequirement.ProtoReflect.Descriptor instead. +func (*SecurityRequirement) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{54} } -func (m *SecurityDefinitionsItem) GetOauth2ApplicationSecurity() *Oauth2ApplicationSecurity { - if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2ApplicationSecurity); ok { - return x.Oauth2ApplicationSecurity +func (x *SecurityRequirement) GetAdditionalProperties() []*NamedStringArray { + if x != nil { + return x.AdditionalProperties } return nil } -func (m *SecurityDefinitionsItem) GetOauth2AccessCodeSecurity() *Oauth2AccessCodeSecurity { - if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity); ok { - return x.Oauth2AccessCodeSecurity - } - return nil +type StringArray struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SecurityDefinitionsItem) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SecurityDefinitionsItem_BasicAuthenticationSecurity)(nil), - (*SecurityDefinitionsItem_ApiKeySecurity)(nil), - (*SecurityDefinitionsItem_Oauth2ImplicitSecurity)(nil), - (*SecurityDefinitionsItem_Oauth2PasswordSecurity)(nil), - (*SecurityDefinitionsItem_Oauth2ApplicationSecurity)(nil), - (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity)(nil), +func (x *StringArray) Reset() { + *x = StringArray{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -type SecurityRequirement struct { - AdditionalProperties []*NamedStringArray `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *StringArray) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SecurityRequirement) Reset() { *m = SecurityRequirement{} } -func (m *SecurityRequirement) String() string { return proto.CompactTextString(m) } -func (*SecurityRequirement) ProtoMessage() {} -func (*SecurityRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{54} -} +func (*StringArray) ProtoMessage() {} -func (m *SecurityRequirement) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityRequirement.Unmarshal(m, b) -} -func (m *SecurityRequirement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityRequirement.Marshal(b, m, deterministic) -} -func (m *SecurityRequirement) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityRequirement.Merge(m, src) -} -func (m *SecurityRequirement) XXX_Size() int { - return xxx_messageInfo_SecurityRequirement.Size(m) -} -func (m *SecurityRequirement) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityRequirement.DiscardUnknown(m) +func (x *StringArray) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[55] + 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) } -var xxx_messageInfo_SecurityRequirement proto.InternalMessageInfo +// Deprecated: Use StringArray.ProtoReflect.Descriptor instead. +func (*StringArray) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{55} +} -func (m *SecurityRequirement) GetAdditionalProperties() []*NamedStringArray { - if m != nil { - return m.AdditionalProperties +func (x *StringArray) GetValue() []string { + if x != nil { + return x.Value } return nil } -type StringArray struct { - Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type Tag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *StringArray) Reset() { *m = StringArray{} } -func (m *StringArray) String() string { return proto.CompactTextString(m) } -func (*StringArray) ProtoMessage() {} -func (*StringArray) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{55} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *StringArray) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StringArray.Unmarshal(m, b) -} -func (m *StringArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StringArray.Marshal(b, m, deterministic) -} -func (m *StringArray) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringArray.Merge(m, src) -} -func (m *StringArray) XXX_Size() int { - return xxx_messageInfo_StringArray.Size(m) +func (x *Tag) Reset() { + *x = Tag{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *StringArray) XXX_DiscardUnknown() { - xxx_messageInfo_StringArray.DiscardUnknown(m) + +func (x *Tag) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_StringArray proto.InternalMessageInfo +func (*Tag) ProtoMessage() {} -func (m *StringArray) GetValue() []string { - if m != nil { - return m.Value +func (x *Tag) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[56] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -type Tag struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Tag) Reset() { *m = Tag{} } -func (m *Tag) String() string { return proto.CompactTextString(m) } -func (*Tag) ProtoMessage() {} +// Deprecated: Use Tag.ProtoReflect.Descriptor instead. func (*Tag) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{56} + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{56} } -func (m *Tag) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Tag.Unmarshal(m, b) -} -func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Tag.Marshal(b, m, deterministic) -} -func (m *Tag) XXX_Merge(src proto.Message) { - xxx_messageInfo_Tag.Merge(m, src) -} -func (m *Tag) XXX_Size() int { - return xxx_messageInfo_Tag.Size(m) -} -func (m *Tag) XXX_DiscardUnknown() { - xxx_messageInfo_Tag.DiscardUnknown(m) -} - -var xxx_messageInfo_Tag proto.InternalMessageInfo - -func (m *Tag) GetName() string { - if m != nil { - return m.Name +func (x *Tag) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *Tag) GetDescription() string { - if m != nil { - return m.Description +func (x *Tag) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Tag) GetExternalDocs() *ExternalDocs { - if m != nil { - return m.ExternalDocs +func (x *Tag) GetExternalDocs() *ExternalDocs { + if x != nil { + return x.ExternalDocs } return nil } -func (m *Tag) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension +func (x *Tag) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension } return nil } type TypeItem struct { - Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TypeItem) Reset() { *m = TypeItem{} } -func (m *TypeItem) String() string { return proto.CompactTextString(m) } -func (*TypeItem) ProtoMessage() {} -func (*TypeItem) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{57} + Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` } -func (m *TypeItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TypeItem.Unmarshal(m, b) -} -func (m *TypeItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TypeItem.Marshal(b, m, deterministic) -} -func (m *TypeItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_TypeItem.Merge(m, src) +func (x *TypeItem) Reset() { + *x = TypeItem{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TypeItem) XXX_Size() int { - return xxx_messageInfo_TypeItem.Size(m) + +func (x *TypeItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TypeItem) XXX_DiscardUnknown() { - xxx_messageInfo_TypeItem.DiscardUnknown(m) + +func (*TypeItem) ProtoMessage() {} + +func (x *TypeItem) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[57] + 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) } -var xxx_messageInfo_TypeItem proto.InternalMessageInfo +// Deprecated: Use TypeItem.ProtoReflect.Descriptor instead. +func (*TypeItem) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{57} +} -func (m *TypeItem) GetValue() []string { - if m != nil { - return m.Value +func (x *TypeItem) GetValue() []string { + if x != nil { + return x.Value } return nil } // Any property starting with x- is valid. type VendorExtension struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *VendorExtension) Reset() { *m = VendorExtension{} } -func (m *VendorExtension) String() string { return proto.CompactTextString(m) } -func (*VendorExtension) ProtoMessage() {} -func (*VendorExtension) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{58} +func (x *VendorExtension) Reset() { + *x = VendorExtension{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *VendorExtension) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VendorExtension.Unmarshal(m, b) -} -func (m *VendorExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VendorExtension.Marshal(b, m, deterministic) +func (x *VendorExtension) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VendorExtension) XXX_Merge(src proto.Message) { - xxx_messageInfo_VendorExtension.Merge(m, src) -} -func (m *VendorExtension) XXX_Size() int { - return xxx_messageInfo_VendorExtension.Size(m) -} -func (m *VendorExtension) XXX_DiscardUnknown() { - xxx_messageInfo_VendorExtension.DiscardUnknown(m) + +func (*VendorExtension) ProtoMessage() {} + +func (x *VendorExtension) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[58] + 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) } -var xxx_messageInfo_VendorExtension proto.InternalMessageInfo +// Deprecated: Use VendorExtension.ProtoReflect.Descriptor instead. +func (*VendorExtension) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{58} +} -func (m *VendorExtension) GetAdditionalProperties() []*NamedAny { - if m != nil { - return m.AdditionalProperties +func (x *VendorExtension) GetAdditionalProperties() []*NamedAny { + if x != nil { + return x.AdditionalProperties } return nil } type Xml struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - Attribute bool `protobuf:"varint,4,opt,name=attribute,proto3" json:"attribute,omitempty"` - Wrapped bool `protobuf:"varint,5,opt,name=wrapped,proto3" json:"wrapped,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Xml) Reset() { *m = Xml{} } -func (m *Xml) String() string { return proto.CompactTextString(m) } -func (*Xml) ProtoMessage() {} -func (*Xml) Descriptor() ([]byte, []int) { - return fileDescriptor_a43d10d209cd31c2, []int{59} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Xml) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Xml.Unmarshal(m, b) -} -func (m *Xml) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Xml.Marshal(b, m, deterministic) + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` + Attribute bool `protobuf:"varint,4,opt,name=attribute,proto3" json:"attribute,omitempty"` + Wrapped bool `protobuf:"varint,5,opt,name=wrapped,proto3" json:"wrapped,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } -func (m *Xml) XXX_Merge(src proto.Message) { - xxx_messageInfo_Xml.Merge(m, src) + +func (x *Xml) Reset() { + *x = Xml{} + if protoimpl.UnsafeEnabled { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Xml) XXX_Size() int { - return xxx_messageInfo_Xml.Size(m) + +func (x *Xml) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Xml) XXX_DiscardUnknown() { - xxx_messageInfo_Xml.DiscardUnknown(m) + +func (*Xml) ProtoMessage() {} + +func (x *Xml) ProtoReflect() protoreflect.Message { + mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[59] + 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) } -var xxx_messageInfo_Xml proto.InternalMessageInfo +// Deprecated: Use Xml.ProtoReflect.Descriptor instead. +func (*Xml) Descriptor() ([]byte, []int) { + return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{59} +} -func (m *Xml) GetName() string { - if m != nil { - return m.Name +func (x *Xml) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *Xml) GetNamespace() string { - if m != nil { - return m.Namespace +func (x *Xml) GetNamespace() string { + if x != nil { + return x.Namespace } return "" } -func (m *Xml) GetPrefix() string { - if m != nil { - return m.Prefix +func (x *Xml) GetPrefix() string { + if x != nil { + return x.Prefix } return "" } -func (m *Xml) GetAttribute() bool { - if m != nil { - return m.Attribute +func (x *Xml) GetAttribute() bool { + if x != nil { + return x.Attribute } return false } -func (m *Xml) GetWrapped() bool { - if m != nil { - return m.Wrapped +func (x *Xml) GetWrapped() bool { + if x != nil { + return x.Wrapped } return false } -func (m *Xml) GetVendorExtension() []*NamedAny { - if m != nil { - return m.VendorExtension - } - return nil -} - -func init() { - proto.RegisterType((*AdditionalPropertiesItem)(nil), "openapi.v2.AdditionalPropertiesItem") - proto.RegisterType((*Any)(nil), "openapi.v2.Any") - proto.RegisterType((*ApiKeySecurity)(nil), "openapi.v2.ApiKeySecurity") - proto.RegisterType((*BasicAuthenticationSecurity)(nil), "openapi.v2.BasicAuthenticationSecurity") - proto.RegisterType((*BodyParameter)(nil), "openapi.v2.BodyParameter") - proto.RegisterType((*Contact)(nil), "openapi.v2.Contact") - proto.RegisterType((*Default)(nil), "openapi.v2.Default") - proto.RegisterType((*Definitions)(nil), "openapi.v2.Definitions") - proto.RegisterType((*Document)(nil), "openapi.v2.Document") - proto.RegisterType((*Examples)(nil), "openapi.v2.Examples") - proto.RegisterType((*ExternalDocs)(nil), "openapi.v2.ExternalDocs") - proto.RegisterType((*FileSchema)(nil), "openapi.v2.FileSchema") - proto.RegisterType((*FormDataParameterSubSchema)(nil), "openapi.v2.FormDataParameterSubSchema") - proto.RegisterType((*Header)(nil), "openapi.v2.Header") - proto.RegisterType((*HeaderParameterSubSchema)(nil), "openapi.v2.HeaderParameterSubSchema") - proto.RegisterType((*Headers)(nil), "openapi.v2.Headers") - proto.RegisterType((*Info)(nil), "openapi.v2.Info") - proto.RegisterType((*ItemsItem)(nil), "openapi.v2.ItemsItem") - proto.RegisterType((*JsonReference)(nil), "openapi.v2.JsonReference") - proto.RegisterType((*License)(nil), "openapi.v2.License") - proto.RegisterType((*NamedAny)(nil), "openapi.v2.NamedAny") - proto.RegisterType((*NamedHeader)(nil), "openapi.v2.NamedHeader") - proto.RegisterType((*NamedParameter)(nil), "openapi.v2.NamedParameter") - proto.RegisterType((*NamedPathItem)(nil), "openapi.v2.NamedPathItem") - proto.RegisterType((*NamedResponse)(nil), "openapi.v2.NamedResponse") - proto.RegisterType((*NamedResponseValue)(nil), "openapi.v2.NamedResponseValue") - proto.RegisterType((*NamedSchema)(nil), "openapi.v2.NamedSchema") - proto.RegisterType((*NamedSecurityDefinitionsItem)(nil), "openapi.v2.NamedSecurityDefinitionsItem") - proto.RegisterType((*NamedString)(nil), "openapi.v2.NamedString") - proto.RegisterType((*NamedStringArray)(nil), "openapi.v2.NamedStringArray") - proto.RegisterType((*NonBodyParameter)(nil), "openapi.v2.NonBodyParameter") - proto.RegisterType((*Oauth2AccessCodeSecurity)(nil), "openapi.v2.Oauth2AccessCodeSecurity") - proto.RegisterType((*Oauth2ApplicationSecurity)(nil), "openapi.v2.Oauth2ApplicationSecurity") - proto.RegisterType((*Oauth2ImplicitSecurity)(nil), "openapi.v2.Oauth2ImplicitSecurity") - proto.RegisterType((*Oauth2PasswordSecurity)(nil), "openapi.v2.Oauth2PasswordSecurity") - proto.RegisterType((*Oauth2Scopes)(nil), "openapi.v2.Oauth2Scopes") - proto.RegisterType((*Operation)(nil), "openapi.v2.Operation") - proto.RegisterType((*Parameter)(nil), "openapi.v2.Parameter") - proto.RegisterType((*ParameterDefinitions)(nil), "openapi.v2.ParameterDefinitions") - proto.RegisterType((*ParametersItem)(nil), "openapi.v2.ParametersItem") - proto.RegisterType((*PathItem)(nil), "openapi.v2.PathItem") - proto.RegisterType((*PathParameterSubSchema)(nil), "openapi.v2.PathParameterSubSchema") - proto.RegisterType((*Paths)(nil), "openapi.v2.Paths") - proto.RegisterType((*PrimitivesItems)(nil), "openapi.v2.PrimitivesItems") - proto.RegisterType((*Properties)(nil), "openapi.v2.Properties") - proto.RegisterType((*QueryParameterSubSchema)(nil), "openapi.v2.QueryParameterSubSchema") - proto.RegisterType((*Response)(nil), "openapi.v2.Response") - proto.RegisterType((*ResponseDefinitions)(nil), "openapi.v2.ResponseDefinitions") - proto.RegisterType((*ResponseValue)(nil), "openapi.v2.ResponseValue") - proto.RegisterType((*Responses)(nil), "openapi.v2.Responses") - proto.RegisterType((*Schema)(nil), "openapi.v2.Schema") - proto.RegisterType((*SchemaItem)(nil), "openapi.v2.SchemaItem") - proto.RegisterType((*SecurityDefinitions)(nil), "openapi.v2.SecurityDefinitions") - proto.RegisterType((*SecurityDefinitionsItem)(nil), "openapi.v2.SecurityDefinitionsItem") - proto.RegisterType((*SecurityRequirement)(nil), "openapi.v2.SecurityRequirement") - proto.RegisterType((*StringArray)(nil), "openapi.v2.StringArray") - proto.RegisterType((*Tag)(nil), "openapi.v2.Tag") - proto.RegisterType((*TypeItem)(nil), "openapi.v2.TypeItem") - proto.RegisterType((*VendorExtension)(nil), "openapi.v2.VendorExtension") - proto.RegisterType((*Xml)(nil), "openapi.v2.Xml") -} - -func init() { proto.RegisterFile("openapiv2/OpenAPIv2.proto", fileDescriptor_a43d10d209cd31c2) } - -var fileDescriptor_a43d10d209cd31c2 = []byte{ - // 3130 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3b, 0x4b, 0x73, 0x1c, 0x57, - 0xd5, 0xf3, 0x7e, 0x1c, 0x69, 0x46, 0xa3, 0x96, 0x2c, 0xb7, 0x24, 0xc7, 0x71, 0xe4, 0x3c, 0x6c, - 0xe7, 0xb3, 0x9c, 0x4f, 0x29, 0x48, 0x05, 0x2a, 0x05, 0xf2, 0xab, 0xc6, 0xc4, 0x44, 0x4a, 0xcb, - 0x0e, 0x09, 0x04, 0xba, 0xae, 0x66, 0xee, 0x48, 0x9d, 0x74, 0xf7, 0x6d, 0x77, 0xf7, 0xc8, 0x1a, - 0x16, 0x2c, 0xa0, 0x8a, 0x35, 0x50, 0x59, 0x53, 0x15, 0x16, 0x14, 0x55, 0x59, 0xb0, 0x62, 0xc5, - 0x1f, 0x60, 0xc7, 0x3f, 0x60, 0x0d, 0x5b, 0xaa, 0x58, 0x51, 0x3c, 0xea, 0xbe, 0xa6, 0x5f, 0xb7, - 0xe7, 0x61, 0xb9, 0x80, 0x02, 0xad, 0x66, 0xee, 0x3d, 0xe7, 0x9e, 0x7b, 0xfa, 0xf4, 0x79, 0xdd, - 0x73, 0x6e, 0xc3, 0x3a, 0xf1, 0xb0, 0x8b, 0x3c, 0xeb, 0x64, 0xe7, 0xd6, 0x9e, 0x87, 0xdd, 0xdd, - 0xfd, 0x07, 0x27, 0x3b, 0xdb, 0x9e, 0x4f, 0x42, 0xa2, 0x81, 0x00, 0x6d, 0x9f, 0xec, 0x6c, 0xac, - 0x1f, 0x11, 0x72, 0x64, 0xe3, 0x5b, 0x0c, 0x72, 0x38, 0x1c, 0xdc, 0x42, 0xee, 0x88, 0xa3, 0x6d, - 0x39, 0xa0, 0xef, 0xf6, 0xfb, 0x56, 0x68, 0x11, 0x17, 0xd9, 0xfb, 0x3e, 0xf1, 0xb0, 0x1f, 0x5a, - 0x38, 0x78, 0x10, 0x62, 0x47, 0xfb, 0x3f, 0xa8, 0x05, 0xbd, 0x63, 0xec, 0x20, 0xbd, 0x78, 0xa5, - 0x78, 0x6d, 0x61, 0x47, 0xdb, 0x8e, 0x68, 0x6e, 0x1f, 0x30, 0x48, 0xb7, 0x60, 0x08, 0x1c, 0x6d, - 0x03, 0xea, 0x87, 0x84, 0xd8, 0x18, 0xb9, 0x7a, 0xe9, 0x4a, 0xf1, 0x5a, 0xa3, 0x5b, 0x30, 0xe4, - 0xc4, 0xed, 0x3a, 0x54, 0x89, 0x8b, 0xc9, 0x60, 0xeb, 0x1e, 0x94, 0x77, 0xdd, 0x91, 0x76, 0x03, - 0xaa, 0x27, 0xc8, 0x1e, 0x62, 0x41, 0x78, 0x75, 0x9b, 0x33, 0xb8, 0x2d, 0x19, 0xdc, 0xde, 0x75, - 0x47, 0x06, 0x47, 0xd1, 0x34, 0xa8, 0x8c, 0x90, 0x63, 0x33, 0xa2, 0x4d, 0x83, 0xfd, 0xdf, 0xfa, - 0xa2, 0x08, 0xed, 0x5d, 0xcf, 0x7a, 0x17, 0x8f, 0x0e, 0x70, 0x6f, 0xe8, 0x5b, 0xe1, 0x88, 0xa2, - 0x85, 0x23, 0x8f, 0x53, 0x6c, 0x1a, 0xec, 0x3f, 0x9d, 0x73, 0x91, 0x83, 0xe5, 0x52, 0xfa, 0x5f, - 0x6b, 0x43, 0xc9, 0x72, 0xf5, 0x32, 0x9b, 0x29, 0x59, 0xae, 0x76, 0x05, 0x16, 0xfa, 0x38, 0xe8, - 0xf9, 0x96, 0x47, 0x65, 0xa0, 0x57, 0x18, 0x20, 0x3e, 0xa5, 0x7d, 0x0d, 0x3a, 0x27, 0xd8, 0xed, - 0x13, 0xdf, 0xc4, 0xa7, 0x21, 0x76, 0x03, 0x8a, 0x56, 0xbd, 0x52, 0x66, 0x7c, 0xc7, 0x04, 0xf2, - 0x1e, 0x72, 0x70, 0x9f, 0xf2, 0xbd, 0xc4, 0xb1, 0xef, 0x49, 0xe4, 0xad, 0xcf, 0x8a, 0xb0, 0x79, - 0x1b, 0x05, 0x56, 0x6f, 0x77, 0x18, 0x1e, 0x63, 0x37, 0xb4, 0x7a, 0x88, 0x12, 0x9e, 0xc8, 0x7a, - 0x8a, 0xad, 0xd2, 0x6c, 0x6c, 0x95, 0xe7, 0x61, 0xeb, 0x0f, 0x45, 0x68, 0xdd, 0x26, 0xfd, 0xd1, - 0x3e, 0xf2, 0x91, 0x83, 0x43, 0xec, 0xa7, 0x37, 0x2d, 0x66, 0x37, 0x9d, 0x45, 0xa2, 0x1b, 0xd0, - 0xf0, 0xf1, 0x93, 0xa1, 0xe5, 0xe3, 0x3e, 0x13, 0x67, 0xc3, 0x18, 0x8f, 0xb5, 0x1b, 0x63, 0x95, - 0xaa, 0xe6, 0xa9, 0xd4, 0x58, 0xa1, 0x54, 0x0f, 0x58, 0x9b, 0xe7, 0x01, 0x7f, 0x5c, 0x84, 0xfa, - 0x1d, 0xe2, 0x86, 0xa8, 0x17, 0x8e, 0x19, 0x2f, 0xc6, 0x18, 0xef, 0x40, 0x79, 0xe8, 0x4b, 0xc5, - 0xa2, 0x7f, 0xb5, 0x55, 0xa8, 0x62, 0x07, 0x59, 0xb6, 0x78, 0x1a, 0x3e, 0x50, 0x32, 0x52, 0x99, - 0x87, 0x91, 0x47, 0x50, 0xbf, 0x8b, 0x07, 0x68, 0x68, 0x87, 0xda, 0x03, 0xb8, 0x80, 0xc6, 0xf6, - 0x66, 0x7a, 0x63, 0x83, 0xd3, 0x8b, 0x13, 0x08, 0xae, 0x22, 0x85, 0x89, 0x6e, 0x7d, 0x07, 0x16, - 0xee, 0xe2, 0x81, 0xe5, 0x32, 0x48, 0xa0, 0x3d, 0x9c, 0x4c, 0xf9, 0x62, 0x86, 0xb2, 0x10, 0xb7, - 0x9a, 0xf8, 0x1f, 0xab, 0xd0, 0xb8, 0x4b, 0x7a, 0x43, 0x07, 0xbb, 0xa1, 0xa6, 0x43, 0x3d, 0x78, - 0x8a, 0x8e, 0x8e, 0xb0, 0x2f, 0xe4, 0x27, 0x87, 0xda, 0xcb, 0x50, 0xb1, 0xdc, 0x01, 0x61, 0x32, - 0x5c, 0xd8, 0xe9, 0xc4, 0xf7, 0x78, 0xe0, 0x0e, 0x88, 0xc1, 0xa0, 0x54, 0xf8, 0xc7, 0x24, 0x08, - 0x85, 0x54, 0xd9, 0x7f, 0x6d, 0x13, 0x9a, 0x87, 0x28, 0xc0, 0xa6, 0x87, 0xc2, 0x63, 0x61, 0x75, - 0x0d, 0x3a, 0xb1, 0x8f, 0xc2, 0x63, 0xb6, 0x21, 0xe5, 0x0e, 0x07, 0xcc, 0xd2, 0xe8, 0x86, 0x7c, - 0x48, 0x95, 0xab, 0x47, 0xdc, 0x60, 0x48, 0x41, 0x35, 0x06, 0x1a, 0x8f, 0x29, 0xcc, 0xf3, 0x49, - 0x7f, 0xd8, 0xc3, 0x81, 0x5e, 0xe7, 0x30, 0x39, 0xd6, 0x5e, 0x83, 0x2a, 0xdd, 0x29, 0xd0, 0x1b, - 0x8c, 0xd3, 0xe5, 0x38, 0xa7, 0x74, 0xcb, 0xc0, 0xe0, 0x70, 0xed, 0x6d, 0x6a, 0x03, 0x63, 0xa9, - 0xea, 0x4d, 0x86, 0x9e, 0x10, 0x5e, 0x4c, 0xe8, 0x46, 0x1c, 0x57, 0xfb, 0x3a, 0x80, 0x27, 0x6d, - 0x29, 0xd0, 0x81, 0xad, 0xbc, 0x92, 0xdc, 0x48, 0x40, 0xe3, 0x24, 0x62, 0x6b, 0xb4, 0x77, 0xa0, - 0xe9, 0xe3, 0xc0, 0x23, 0x6e, 0x80, 0x03, 0x7d, 0x81, 0x11, 0x78, 0x31, 0x4e, 0xc0, 0x10, 0xc0, - 0xf8, 0xfa, 0x68, 0x85, 0xf6, 0x55, 0x68, 0x04, 0xc2, 0xa9, 0xe8, 0x8b, 0xec, 0xad, 0x27, 0x56, - 0x4b, 0x87, 0x63, 0x70, 0x6b, 0xa4, 0xaf, 0xd6, 0x18, 0x2f, 0xd0, 0x0c, 0x58, 0x95, 0xff, 0xcd, - 0xb8, 0x04, 0x5a, 0x59, 0x36, 0x24, 0xa1, 0x38, 0x1b, 0x2b, 0x41, 0x76, 0x52, 0xbb, 0x0a, 0x95, - 0x10, 0x1d, 0x05, 0x7a, 0x9b, 0x31, 0xb3, 0x14, 0xa7, 0xf1, 0x08, 0x1d, 0x19, 0x0c, 0xa8, 0xbd, - 0x03, 0x2d, 0x6a, 0x57, 0x3e, 0x55, 0xdb, 0x3e, 0xe9, 0x05, 0xfa, 0x12, 0xdb, 0x51, 0x8f, 0x63, - 0xdf, 0x13, 0x08, 0x77, 0x49, 0x2f, 0x30, 0x16, 0x71, 0x6c, 0xa4, 0xb4, 0xce, 0xce, 0x3c, 0xd6, - 0xf9, 0x18, 0x1a, 0xf7, 0x4e, 0x91, 0xe3, 0xd9, 0x38, 0x78, 0x9e, 0xe6, 0xf9, 0xa3, 0x22, 0x2c, - 0xc6, 0xd9, 0x9e, 0xc1, 0xbb, 0x66, 0x1d, 0xd2, 0x99, 0x9d, 0xfc, 0x3f, 0x4a, 0x00, 0xf7, 0x2d, - 0x1b, 0x73, 0x63, 0xd7, 0xd6, 0xa0, 0x36, 0x20, 0xbe, 0x83, 0x42, 0xb1, 0xbd, 0x18, 0x51, 0xc7, - 0x17, 0x5a, 0xa1, 0x2d, 0x1d, 0x3b, 0x1f, 0xa4, 0x39, 0x2e, 0x67, 0x39, 0xbe, 0x0e, 0xf5, 0x3e, - 0xf7, 0x6c, 0xcc, 0x86, 0x53, 0xef, 0x98, 0x72, 0x24, 0xe1, 0x89, 0xb0, 0xc0, 0x8d, 0x3a, 0x0a, - 0x0b, 0x32, 0x02, 0xd6, 0x62, 0x11, 0x70, 0x93, 0xda, 0x02, 0xea, 0x9b, 0xc4, 0xb5, 0x47, 0x7a, - 0x5d, 0xc6, 0x11, 0xd4, 0xdf, 0x73, 0xed, 0x51, 0x56, 0x67, 0x1a, 0x73, 0xe9, 0xcc, 0x75, 0xa8, - 0x63, 0xfe, 0xca, 0x85, 0x81, 0x67, 0xd9, 0x16, 0x70, 0xe5, 0x1b, 0x80, 0x79, 0xde, 0xc0, 0x17, - 0x35, 0xd8, 0xb8, 0x4f, 0x7c, 0xe7, 0x2e, 0x0a, 0xd1, 0xd8, 0x01, 0x1c, 0x0c, 0x0f, 0x0f, 0x64, - 0xda, 0x14, 0x89, 0xa5, 0x98, 0x8a, 0x96, 0x3c, 0xb2, 0x96, 0xf2, 0x72, 0x95, 0x72, 0x7e, 0x7c, - 0xae, 0xc4, 0xc2, 0xdc, 0x0d, 0x58, 0x46, 0xb6, 0x4d, 0x9e, 0x9a, 0xd8, 0xf1, 0xc2, 0x91, 0xc9, - 0x13, 0xaf, 0x2a, 0xdb, 0x6a, 0x89, 0x01, 0xee, 0xd1, 0xf9, 0x0f, 0x64, 0xb2, 0x95, 0x79, 0x11, - 0x91, 0xce, 0xd4, 0x13, 0x3a, 0xf3, 0xff, 0x50, 0xb5, 0x42, 0xec, 0x48, 0xd9, 0x6f, 0x26, 0x3c, - 0x9d, 0x6f, 0x39, 0x56, 0x68, 0x9d, 0xf0, 0x4c, 0x32, 0x30, 0x38, 0xa6, 0xf6, 0x3a, 0x2c, 0xf7, - 0x88, 0x6d, 0xe3, 0x1e, 0x65, 0xd6, 0x14, 0x54, 0x9b, 0x8c, 0x6a, 0x27, 0x02, 0xdc, 0xe7, 0xf4, - 0x63, 0xba, 0x05, 0x53, 0x74, 0x4b, 0x87, 0xba, 0x83, 0x4e, 0x2d, 0x67, 0xe8, 0x30, 0xaf, 0x59, - 0x34, 0xe4, 0x90, 0xee, 0x88, 0x4f, 0x7b, 0xf6, 0x30, 0xb0, 0x4e, 0xb0, 0x29, 0x71, 0x16, 0xd9, - 0xc3, 0x77, 0xc6, 0x80, 0x6f, 0x0a, 0x64, 0x4a, 0xc6, 0x72, 0x19, 0x4a, 0x4b, 0x90, 0xe1, 0xc3, - 0x14, 0x19, 0x81, 0xd3, 0x4e, 0x93, 0x11, 0xc8, 0x2f, 0x00, 0x38, 0xe8, 0xd4, 0xb4, 0xb1, 0x7b, - 0x14, 0x1e, 0x33, 0x6f, 0x56, 0x36, 0x9a, 0x0e, 0x3a, 0x7d, 0xc8, 0x26, 0x18, 0xd8, 0x72, 0x25, - 0xb8, 0x23, 0xc0, 0x96, 0x2b, 0xc0, 0x3a, 0xd4, 0x3d, 0x14, 0x52, 0x65, 0xd5, 0x97, 0x79, 0xb0, - 0x15, 0x43, 0x6a, 0x11, 0x94, 0x2e, 0x17, 0xba, 0xc6, 0xd6, 0x35, 0x1c, 0x74, 0xca, 0x24, 0xcc, - 0x80, 0x96, 0x2b, 0x80, 0x2b, 0x02, 0x68, 0xb9, 0x1c, 0xf8, 0x12, 0x2c, 0x0e, 0x5d, 0xeb, 0xc9, - 0x10, 0x0b, 0xf8, 0x2a, 0xe3, 0x7c, 0x81, 0xcf, 0x71, 0x94, 0xab, 0x50, 0xc1, 0xee, 0xd0, 0xd1, - 0x2f, 0x64, 0x5d, 0x35, 0x15, 0x35, 0x03, 0x6a, 0x2f, 0xc2, 0x82, 0x33, 0xb4, 0x43, 0xcb, 0xb3, - 0xb1, 0x49, 0x06, 0xfa, 0x1a, 0x13, 0x12, 0xc8, 0xa9, 0xbd, 0x81, 0xd2, 0x5a, 0x2e, 0xce, 0x65, - 0x2d, 0x55, 0xa8, 0x75, 0x31, 0xea, 0x63, 0x5f, 0x99, 0x16, 0x47, 0xba, 0x58, 0x52, 0xeb, 0x62, - 0xf9, 0x6c, 0xba, 0x58, 0x99, 0xae, 0x8b, 0xd5, 0xd9, 0x75, 0xb1, 0x36, 0x83, 0x2e, 0xd6, 0xa7, - 0xeb, 0x62, 0x63, 0x06, 0x5d, 0x6c, 0xce, 0xa4, 0x8b, 0x30, 0x59, 0x17, 0x17, 0x26, 0xe8, 0xe2, - 0xe2, 0x04, 0x5d, 0x6c, 0x4d, 0xd2, 0xc5, 0xf6, 0x14, 0x5d, 0x5c, 0xca, 0xd7, 0xc5, 0xce, 0x1c, - 0xba, 0xb8, 0x9c, 0xd1, 0xc5, 0x94, 0xb7, 0xd4, 0x66, 0x3b, 0x42, 0xad, 0xcc, 0xa3, 0xad, 0x7f, - 0xab, 0x82, 0xce, 0xb5, 0xf5, 0xdf, 0xe2, 0xd9, 0xa5, 0x85, 0x54, 0x95, 0x16, 0x52, 0x53, 0x5b, - 0x48, 0xfd, 0x6c, 0x16, 0xd2, 0x98, 0x6e, 0x21, 0xcd, 0xd9, 0x2d, 0x04, 0x66, 0xb0, 0x90, 0x85, - 0xe9, 0x16, 0xb2, 0x38, 0x83, 0x85, 0xb4, 0x66, 0xb2, 0x90, 0xf6, 0x64, 0x0b, 0x59, 0x9a, 0x60, - 0x21, 0x9d, 0x09, 0x16, 0xb2, 0x3c, 0xc9, 0x42, 0xb4, 0x29, 0x16, 0xb2, 0x92, 0x6f, 0x21, 0xab, - 0x73, 0x58, 0xc8, 0x85, 0x99, 0xbc, 0xf5, 0xda, 0x3c, 0xfa, 0xff, 0x2d, 0xa8, 0x73, 0xf5, 0x7f, - 0x86, 0xe3, 0x27, 0x5f, 0x98, 0x93, 0x3c, 0x7f, 0x5e, 0x82, 0x0a, 0x3d, 0x40, 0x46, 0x89, 0x69, - 0x31, 0x9e, 0x98, 0xea, 0x50, 0x3f, 0xc1, 0x7e, 0x10, 0x55, 0x46, 0xe4, 0x70, 0x06, 0x43, 0xba, - 0x06, 0x9d, 0x10, 0xfb, 0x4e, 0x60, 0x92, 0x81, 0x19, 0x60, 0xff, 0xc4, 0xea, 0x49, 0xa3, 0x6a, - 0xb3, 0xf9, 0xbd, 0xc1, 0x01, 0x9f, 0xd5, 0x6e, 0x42, 0xbd, 0xc7, 0xcb, 0x07, 0xc2, 0xe9, 0xaf, - 0xc4, 0x1f, 0x42, 0x54, 0x16, 0x0c, 0x89, 0x43, 0xd1, 0x6d, 0xab, 0x87, 0xdd, 0x80, 0xa7, 0x4f, - 0x29, 0xf4, 0x87, 0x1c, 0x64, 0x48, 0x1c, 0xa5, 0xf0, 0xeb, 0xf3, 0x08, 0xff, 0x2d, 0x68, 0x32, - 0x65, 0x60, 0xb5, 0xba, 0x1b, 0xb1, 0x5a, 0x5d, 0x79, 0x72, 0x61, 0x65, 0xeb, 0x2e, 0xb4, 0xbe, - 0x11, 0x10, 0xd7, 0xc0, 0x03, 0xec, 0x63, 0xb7, 0x87, 0xb5, 0x65, 0xa8, 0x98, 0x3e, 0x1e, 0x08, - 0x19, 0x97, 0x0d, 0x3c, 0x98, 0x5e, 0x7f, 0xda, 0xf2, 0xa0, 0x2e, 0x9e, 0x69, 0xc6, 0xe2, 0xca, - 0x99, 0xcf, 0x32, 0xf7, 0xa0, 0x21, 0x81, 0xca, 0x2d, 0x5f, 0x91, 0x55, 0xc5, 0x92, 0xda, 0x01, - 0x71, 0xe8, 0xd6, 0xbb, 0xb0, 0x10, 0x53, 0x40, 0x25, 0xa5, 0x6b, 0x49, 0x4a, 0x09, 0x61, 0x0a, - 0xbd, 0x15, 0xc4, 0xde, 0x87, 0x36, 0x23, 0x16, 0x15, 0xd1, 0x54, 0xf4, 0x5e, 0x4f, 0xd2, 0xbb, - 0xa0, 0x2c, 0x0a, 0x48, 0x92, 0x7b, 0xd0, 0x12, 0x24, 0xc3, 0x63, 0xf6, 0x6e, 0x55, 0x14, 0x6f, - 0x24, 0x29, 0xae, 0xa6, 0xeb, 0x19, 0x74, 0x61, 0x9a, 0xa0, 0xac, 0x1e, 0xcc, 0x4d, 0x50, 0x2e, - 0x94, 0x04, 0x3f, 0x02, 0x2d, 0x41, 0x70, 0x7c, 0x76, 0xc8, 0x50, 0xbd, 0x95, 0xa4, 0xba, 0xae, - 0xa2, 0xca, 0x56, 0xa7, 0x5f, 0x8e, 0x88, 0xa1, 0xf3, 0xbe, 0x1c, 0xa1, 0xe9, 0x82, 0x98, 0x03, - 0x97, 0x38, 0xb1, 0x6c, 0x69, 0x22, 0x57, 0xb0, 0x6f, 0x27, 0xa9, 0x5f, 0x9d, 0x52, 0xf7, 0x88, - 0xcb, 0xf9, 0x2d, 0xc9, 0x7b, 0xe8, 0x5b, 0xee, 0x91, 0x92, 0xfa, 0x6a, 0x9c, 0x7a, 0x53, 0x2e, - 0x7c, 0x0c, 0x9d, 0xd8, 0xc2, 0x5d, 0xdf, 0x47, 0x6a, 0x05, 0xbf, 0x99, 0xe4, 0x2d, 0xe1, 0x53, - 0x63, 0x6b, 0x25, 0xd9, 0xdf, 0x94, 0xa1, 0xf3, 0x1e, 0x71, 0x93, 0x35, 0x5e, 0x0c, 0x9b, 0xc7, - 0x4c, 0x83, 0xcd, 0x71, 0xdd, 0xc9, 0x0c, 0x86, 0x87, 0x66, 0xa2, 0xd2, 0xff, 0x72, 0x56, 0xe1, - 0xb3, 0x09, 0x4e, 0xb7, 0x60, 0xe8, 0xc7, 0x79, 0xc9, 0x8f, 0x0d, 0x97, 0x69, 0xc2, 0x60, 0xf6, - 0x51, 0x88, 0xd4, 0x3b, 0xf1, 0x67, 0x78, 0x35, 0xbe, 0x53, 0xfe, 0x31, 0xb9, 0x5b, 0x30, 0x36, - 0x06, 0xf9, 0x87, 0xe8, 0x43, 0xd8, 0x78, 0x32, 0xc4, 0xfe, 0x48, 0xbd, 0x53, 0x39, 0xfb, 0x26, - 0xdf, 0xa7, 0xd8, 0xca, 0x6d, 0x2e, 0x3e, 0x51, 0x83, 0x34, 0x13, 0xd6, 0x3d, 0x14, 0x1e, 0xab, - 0xb7, 0xe0, 0xc5, 0x8f, 0xad, 0xb4, 0x15, 0x2a, 0x77, 0x58, 0xf3, 0x94, 0x90, 0xa8, 0x49, 0xf2, - 0x79, 0x09, 0xf4, 0x3d, 0x34, 0x0c, 0x8f, 0x77, 0x76, 0x7b, 0x3d, 0x1c, 0x04, 0x77, 0x48, 0x1f, - 0x4f, 0xeb, 0x73, 0x0c, 0x6c, 0xf2, 0x54, 0x56, 0xe5, 0xe9, 0x7f, 0xed, 0x0d, 0x1a, 0x10, 0x88, - 0x87, 0xe5, 0x91, 0x28, 0x51, 0x1a, 0xe1, 0xd4, 0x0f, 0x18, 0xdc, 0x10, 0x78, 0x34, 0x6b, 0xa2, - 0xd3, 0xc4, 0xb7, 0xbe, 0xcf, 0xfa, 0x13, 0x26, 0xf5, 0xdf, 0xe2, 0x40, 0x94, 0x00, 0x3c, 0xf6, - 0x6d, 0x9a, 0xc0, 0x84, 0xe4, 0x53, 0xcc, 0x91, 0x78, 0xfe, 0xd9, 0x60, 0x13, 0x14, 0x98, 0x0a, - 0x1e, 0xb5, 0xd9, 0x32, 0xef, 0xb9, 0x82, 0xdf, 0x5f, 0x8a, 0xb0, 0x2e, 0x64, 0xe4, 0x79, 0xf6, - 0x2c, 0x1d, 0x95, 0xe7, 0x23, 0xa4, 0xc4, 0x73, 0x57, 0x26, 0x3f, 0x77, 0x75, 0xb6, 0xe7, 0x9e, - 0xab, 0xa7, 0xf1, 0xc3, 0x12, 0xac, 0x71, 0xc6, 0x1e, 0x38, 0xf4, 0xb9, 0xad, 0xf0, 0x3f, 0x4d, - 0x33, 0xfe, 0x05, 0x42, 0xf8, 0x73, 0x51, 0x0a, 0x61, 0x1f, 0x05, 0xc1, 0x53, 0xe2, 0xf7, 0xff, - 0x07, 0xde, 0xfc, 0xc7, 0xb0, 0x18, 0xe7, 0xeb, 0x19, 0xfa, 0x3d, 0x2c, 0x42, 0xe4, 0x24, 0xdc, - 0x3f, 0xaf, 0x40, 0x73, 0xcf, 0xc3, 0x3e, 0x92, 0x87, 0x4d, 0x56, 0xb7, 0x2f, 0xb2, 0x3a, 0x2d, - 0x2f, 0xd3, 0xeb, 0x50, 0x0f, 0x86, 0x8e, 0x83, 0xfc, 0x91, 0xcc, 0xb9, 0xc5, 0x70, 0x86, 0x9c, - 0x3b, 0x53, 0xae, 0xad, 0xcc, 0x55, 0xae, 0x7d, 0x09, 0x16, 0x89, 0xe4, 0xcd, 0xb4, 0xfa, 0x52, - 0xbc, 0xe3, 0xb9, 0x07, 0xfd, 0x44, 0xef, 0xa7, 0x96, 0xea, 0xfd, 0xc4, 0x7b, 0x46, 0xf5, 0x54, - 0xcf, 0xe8, 0x2b, 0x89, 0x9e, 0x4d, 0x83, 0x89, 0x6e, 0x43, 0x99, 0x9e, 0xf1, 0x50, 0x1f, 0xef, - 0xd6, 0xbc, 0x19, 0xef, 0xd6, 0x34, 0xb3, 0x99, 0x9d, 0x4c, 0x70, 0x12, 0x3d, 0x9a, 0x58, 0x6b, - 0x0b, 0x92, 0xad, 0xad, 0xcb, 0x00, 0x7d, 0xec, 0xf9, 0xb8, 0x87, 0x42, 0xdc, 0x17, 0xa7, 0xde, - 0xd8, 0xcc, 0xd9, 0xba, 0x3b, 0x2a, 0xf5, 0x6b, 0xcd, 0xa3, 0x7e, 0xbf, 0x2c, 0x42, 0x33, 0xca, - 0x22, 0x6e, 0x43, 0xfb, 0x90, 0xf4, 0x63, 0xf1, 0x56, 0x24, 0x0e, 0x89, 0x04, 0x2f, 0x91, 0x78, - 0x74, 0x0b, 0x46, 0xeb, 0x30, 0x91, 0x89, 0x3c, 0x04, 0xcd, 0x25, 0xae, 0x99, 0xa2, 0xc3, 0xd3, - 0x82, 0x4b, 0x09, 0xa6, 0x52, 0x39, 0x4c, 0xb7, 0x60, 0x74, 0xdc, 0xd4, 0x5c, 0x14, 0x3d, 0x8f, - 0x60, 0x55, 0xd5, 0x67, 0xd3, 0xf6, 0x26, 0xdb, 0xcb, 0x46, 0x46, 0x0c, 0x51, 0x62, 0xae, 0x36, - 0x99, 0xcf, 0x8a, 0xd0, 0x4e, 0x6a, 0x87, 0xf6, 0x25, 0x68, 0xa6, 0x25, 0xa2, 0xce, 0xf5, 0xbb, - 0x05, 0x23, 0xc2, 0xa4, 0xd2, 0xfc, 0x24, 0x20, 0x2e, 0x3d, 0x83, 0xf1, 0x13, 0x99, 0x2a, 0x5d, - 0x4e, 0x1c, 0xd9, 0xa8, 0x34, 0x3f, 0x89, 0x4f, 0x44, 0xcf, 0xff, 0xfb, 0x32, 0x34, 0xc6, 0x47, - 0x07, 0xc5, 0xc9, 0xee, 0x35, 0x28, 0x1f, 0xe1, 0x50, 0x75, 0x12, 0x19, 0xdb, 0xbf, 0x41, 0x31, - 0x28, 0xa2, 0x37, 0x0c, 0x85, 0x7f, 0xcc, 0x43, 0xf4, 0x86, 0xa1, 0x76, 0x1d, 0x2a, 0x1e, 0x09, - 0x64, 0x07, 0x28, 0x07, 0x93, 0xa1, 0x68, 0x37, 0xa1, 0xd6, 0xc7, 0x36, 0x0e, 0xb1, 0x38, 0x51, - 0xe7, 0x20, 0x0b, 0x24, 0xed, 0x16, 0xd4, 0x89, 0xc7, 0xdb, 0x90, 0xb5, 0x49, 0xf8, 0x12, 0x8b, - 0xb2, 0x42, 0x53, 0x52, 0x51, 0xe4, 0xca, 0x63, 0x85, 0xa2, 0xd0, 0x33, 0x99, 0x87, 0xc2, 0xde, - 0xb1, 0x68, 0x5f, 0xe4, 0xe0, 0x72, 0x9c, 0x94, 0x9b, 0x68, 0xce, 0xe5, 0x26, 0xce, 0xdc, 0x41, - 0xfa, 0x6b, 0x15, 0xd6, 0xd4, 0xd9, 0xe4, 0x79, 0x8d, 0xf1, 0xbc, 0xc6, 0xf8, 0xdf, 0x5e, 0x63, - 0x7c, 0x0a, 0x55, 0x76, 0x41, 0x43, 0x49, 0xa9, 0x38, 0x07, 0x25, 0xed, 0x26, 0x54, 0xd8, 0x6d, - 0x93, 0x12, 0x5b, 0xb4, 0xae, 0x70, 0xf8, 0xa2, 0x6e, 0xc2, 0xd0, 0xb6, 0x7e, 0x56, 0x85, 0xa5, - 0x94, 0xd6, 0x9e, 0xf7, 0xa4, 0xce, 0x7b, 0x52, 0x67, 0xea, 0x49, 0xa9, 0x74, 0x58, 0x9b, 0xc7, - 0x1a, 0xbe, 0x0d, 0x10, 0xa5, 0x20, 0xcf, 0xf9, 0xce, 0xd7, 0xaf, 0x6a, 0x70, 0x31, 0xa7, 0x30, - 0x72, 0x7e, 0x4d, 0xe1, 0xfc, 0x9a, 0xc2, 0xf9, 0x35, 0x85, 0xc8, 0x0c, 0xff, 0x5e, 0x84, 0xc6, - 0xb8, 0x9c, 0x3e, 0xfd, 0x62, 0xd7, 0xf6, 0xb8, 0x3b, 0xc3, 0xd3, 0xee, 0xb5, 0x6c, 0xcd, 0x9a, - 0x05, 0x1e, 0x79, 0xf5, 0xf5, 0x26, 0xd4, 0x79, 0x65, 0x55, 0x06, 0x8f, 0x95, 0x6c, 0x41, 0x36, - 0x30, 0x24, 0x8e, 0xf6, 0x06, 0x34, 0xc4, 0x75, 0x25, 0x79, 0xb2, 0x5e, 0x4d, 0x9e, 0xac, 0x39, - 0xcc, 0x18, 0x63, 0x9d, 0xfd, 0x4e, 0x33, 0x86, 0x15, 0xc5, 0x65, 0x44, 0xed, 0xbd, 0xc9, 0x0e, - 0x29, 0x1b, 0x73, 0xc7, 0xad, 0x05, 0xb5, 0x4b, 0xfa, 0x49, 0x11, 0x5a, 0xc9, 0x2e, 0xc3, 0x0e, - 0x75, 0x44, 0x7c, 0x62, 0x7c, 0x7b, 0x5c, 0x71, 0xe6, 0xee, 0x16, 0x8c, 0x31, 0xde, 0xf3, 0x3d, - 0x5f, 0xfd, 0xb4, 0x08, 0xcd, 0xf1, 0xc9, 0x5e, 0xbb, 0x03, 0x2d, 0xb9, 0x8d, 0xd9, 0x23, 0x7d, - 0x2c, 0x1e, 0xf4, 0x72, 0xee, 0x83, 0xf2, 0x6e, 0xc7, 0xa2, 0x5c, 0x74, 0x87, 0xf4, 0xd5, 0xad, - 0xc0, 0xd2, 0x3c, 0x6f, 0xe3, 0xd7, 0x4d, 0xa8, 0x09, 0x47, 0xad, 0x38, 0xf1, 0xe5, 0x25, 0x28, - 0xe3, 0xde, 0x6a, 0x79, 0xc2, 0xa5, 0xbf, 0xca, 0xc4, 0x4b, 0x7f, 0xd3, 0x12, 0x8f, 0x94, 0x25, - 0xd6, 0x32, 0x96, 0x18, 0x73, 0x89, 0xf5, 0x19, 0x5c, 0x62, 0x63, 0xba, 0x4b, 0x6c, 0xce, 0xe0, - 0x12, 0x61, 0x26, 0x97, 0xb8, 0x30, 0xd9, 0x25, 0x2e, 0x4e, 0x70, 0x89, 0xad, 0x09, 0x2e, 0xb1, - 0x3d, 0xc9, 0x25, 0x2e, 0x4d, 0x71, 0x89, 0x9d, 0xac, 0x4b, 0x7c, 0x05, 0xda, 0x94, 0x78, 0xcc, - 0xd8, 0xf8, 0x49, 0xa0, 0xe5, 0xa0, 0xd3, 0x58, 0xae, 0x40, 0xd1, 0x2c, 0x37, 0x8e, 0xa6, 0x09, - 0x34, 0xcb, 0x8d, 0xa1, 0xc5, 0x03, 0xfd, 0x4a, 0xea, 0x9a, 0xe6, 0x4c, 0x27, 0x82, 0x8f, 0xf2, - 0x5c, 0xc0, 0x85, 0x6c, 0x6b, 0x29, 0xef, 0xd3, 0x13, 0xb5, 0x37, 0xd0, 0xae, 0x89, 0xb0, 0xbf, - 0x96, 0xb5, 0xfb, 0x47, 0x23, 0x0f, 0xf3, 0xdc, 0x9d, 0x25, 0x03, 0xaf, 0xcb, 0xa0, 0x7f, 0x31, - 0x7b, 0xb8, 0x1f, 0x37, 0xcd, 0x65, 0xb8, 0xbf, 0x0e, 0x35, 0x64, 0xdb, 0x54, 0x3f, 0xf5, 0xdc, - 0xde, 0x79, 0x15, 0xd9, 0xf6, 0xde, 0x40, 0xfb, 0x32, 0x40, 0xec, 0x89, 0xd6, 0xb3, 0xce, 0x3c, - 0xe2, 0xd6, 0x88, 0x61, 0x6a, 0x2f, 0x43, 0xab, 0x6f, 0x51, 0x0b, 0x72, 0x2c, 0x17, 0x85, 0xc4, - 0xd7, 0x37, 0x98, 0x82, 0x24, 0x27, 0x93, 0x57, 0x5e, 0x37, 0x53, 0x57, 0x5e, 0x5f, 0x82, 0xf2, - 0xa9, 0x63, 0xeb, 0x97, 0xb2, 0x16, 0xf7, 0xa1, 0x63, 0x1b, 0x14, 0x96, 0x2d, 0xb3, 0xbe, 0xf0, - 0xac, 0xb7, 0x62, 0x2f, 0x3f, 0xc3, 0xad, 0xd8, 0x17, 0xe7, 0xf1, 0x58, 0x3f, 0x00, 0x88, 0xe2, - 0xde, 0x9c, 0x5f, 0x1a, 0xbd, 0x0d, 0x0b, 0x03, 0xcb, 0xc6, 0x66, 0x7e, 0x48, 0x8d, 0x6e, 0x3c, - 0x77, 0x0b, 0x06, 0x0c, 0xc6, 0xa3, 0xc8, 0x8b, 0x87, 0xb0, 0xa2, 0xe8, 0xe6, 0x6a, 0xdf, 0x9d, - 0x1c, 0xbf, 0xae, 0x65, 0x13, 0xea, 0x9c, 0x96, 0xb0, 0x3a, 0x9c, 0xfd, 0xa9, 0x02, 0x17, 0xf3, - 0x9a, 0xd1, 0x0e, 0xbc, 0x70, 0x88, 0x02, 0xab, 0x67, 0xa2, 0xc4, 0x57, 0x42, 0xe6, 0xb8, 0xe6, - 0xcb, 0x45, 0xf3, 0x5a, 0xa2, 0xc2, 0x9a, 0xff, 0x55, 0x51, 0xb7, 0x60, 0x6c, 0x1e, 0x4e, 0xf8, - 0xe8, 0xe8, 0x3e, 0x74, 0x90, 0x67, 0x99, 0x9f, 0xe2, 0x51, 0xb4, 0x03, 0x97, 0x64, 0xa2, 0xae, - 0x95, 0xfc, 0xca, 0xaa, 0x5b, 0x30, 0xda, 0x28, 0xf9, 0xdd, 0xd5, 0xf7, 0x40, 0x27, 0xac, 0x2d, - 0x61, 0x5a, 0xa2, 0x21, 0x15, 0xd1, 0x2b, 0x67, 0xbb, 0xa2, 0xea, 0xde, 0x55, 0xb7, 0x60, 0xac, - 0x11, 0x75, 0x57, 0x2b, 0xa2, 0xef, 0x89, 0x5e, 0x4f, 0x44, 0xbf, 0x92, 0x47, 0x3f, 0xdd, 0x16, - 0x8a, 0xe8, 0x67, 0x1a, 0x46, 0x47, 0xb0, 0x29, 0xe8, 0xa3, 0xa8, 0x91, 0x18, 0x6d, 0xc1, 0x03, - 0xdc, 0x2b, 0xd9, 0x2d, 0x14, 0x6d, 0xc7, 0x6e, 0xc1, 0x58, 0x27, 0xb9, 0x3d, 0x49, 0x1c, 0x6d, - 0xc4, 0xba, 0xba, 0x2c, 0x5d, 0x88, 0x36, 0xaa, 0x65, 0xbd, 0x63, 0x5e, 0x0f, 0xb8, 0x5b, 0x30, - 0x84, 0x4c, 0xb2, 0xb0, 0x48, 0xc3, 0x8f, 0x23, 0x0d, 0x8f, 0xb5, 0x04, 0xb4, 0xf7, 0x27, 0x6b, - 0xf8, 0xa5, 0x9c, 0xb6, 0x11, 0xbf, 0x58, 0xa0, 0xd6, 0xea, 0xab, 0xb0, 0x10, 0xbf, 0xb9, 0xb0, - 0x1a, 0x7d, 0xdc, 0x57, 0x8e, 0xee, 0x38, 0xfc, 0xb6, 0x08, 0xe5, 0x47, 0x48, 0x7d, 0x2b, 0x62, - 0xfa, 0xc7, 0x6e, 0x19, 0xcf, 0x56, 0x3e, 0xf3, 0x37, 0x22, 0x73, 0x7d, 0xc1, 0x75, 0x05, 0x1a, - 0x32, 0xc2, 0xe4, 0x3c, 0xdf, 0xc7, 0xb0, 0xf4, 0x41, 0xaa, 0xde, 0xf4, 0x1c, 0x3f, 0x26, 0xf9, - 0x5d, 0x11, 0xca, 0x1f, 0x3a, 0xb6, 0x52, 0x7a, 0x97, 0xa0, 0x49, 0x7f, 0x03, 0x0f, 0xf5, 0xe4, - 0xbd, 0x92, 0x68, 0x82, 0x26, 0x7f, 0x9e, 0x8f, 0x07, 0xd6, 0xa9, 0xc8, 0xf2, 0xc4, 0x88, 0xae, - 0x42, 0x61, 0xe8, 0x5b, 0x87, 0xc3, 0x10, 0x8b, 0xcf, 0xf4, 0xa2, 0x09, 0x9a, 0xca, 0x3c, 0xf5, - 0x91, 0xe7, 0xe1, 0xbe, 0x38, 0x82, 0xcb, 0xe1, 0x99, 0xfb, 0x98, 0xb7, 0x5f, 0x85, 0x36, 0xf1, - 0x8f, 0x24, 0xae, 0x79, 0xb2, 0x73, 0x7b, 0x51, 0x7c, 0xbb, 0xba, 0xef, 0x93, 0x90, 0xec, 0x17, - 0x7f, 0x51, 0x2a, 0xef, 0xed, 0x1e, 0x1c, 0xd6, 0xd8, 0xc7, 0xa0, 0x6f, 0xfe, 0x33, 0x00, 0x00, - 0xff, 0xff, 0xdc, 0xb2, 0x46, 0x98, 0xe4, 0x3a, 0x00, 0x00, +func (x *Xml) GetVendorExtension() []*NamedAny { + if x != nil { + return x.VendorExtension + } + return nil +} + +var File_openapiv2_OpenAPIv2_proto protoreflect.FileDescriptor + +var file_openapiv2_OpenAPIv2_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x4f, 0x70, 0x65, 0x6e, + 0x41, 0x50, 0x49, 0x76, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x6d, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2c, + 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x07, + 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, + 0x66, 0x22, 0x45, 0x0a, 0x03, 0x41, 0x6e, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x22, 0xab, 0x01, 0x0a, 0x0e, 0x41, 0x70, 0x69, + 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, + 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x01, 0x0a, 0x1b, 0x42, 0x61, 0x73, 0x69, 0x63, + 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, + 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xde, 0x01, + 0x0a, 0x0d, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x3f, 0x0a, + 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x86, + 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, + 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x54, 0x0a, 0x07, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x12, 0x49, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, + 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x5b, 0x0a, + 0x0b, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x15, + 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xe8, 0x05, 0x0a, 0x08, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x77, 0x61, 0x67, 0x67, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, + 0x72, 0x12, 0x24, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, + 0x61, 0x73, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x62, 0x61, 0x73, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x05, 0x70, 0x61, + 0x74, 0x68, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x73, 0x52, 0x05, 0x70, 0x61, + 0x74, 0x68, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x40, + 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x12, 0x3d, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, + 0x3b, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x52, 0x0a, 0x14, + 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x13, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, + 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x44, 0x6f, 0x63, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, + 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x55, 0x0a, 0x08, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x73, 0x12, 0x49, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x83, 0x01, 0x0a, + 0x0c, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, + 0x6c, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, + 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0xff, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, + 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xab, 0x06, 0x0a, 0x1a, 0x46, 0x6f, 0x72, 0x6d, 0x44, 0x61, 0x74, + 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, + 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, + 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, + 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, + 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, + 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, + 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, + 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, + 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, + 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, + 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, + 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, + 0x6e, 0x75, 0x6d, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, + 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, + 0x16, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, + 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, + 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0xab, 0x05, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, + 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, + 0x6d, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, + 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, + 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, + 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, + 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, + 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, + 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, + 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, + 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, + 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, + 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, + 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, + 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x22, 0xfd, 0x05, 0x0a, 0x18, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, + 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, + 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, + 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, + 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, + 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, + 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, + 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, + 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, + 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, + 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, + 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, + 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, + 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, + 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, + 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, + 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, + 0x6d, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, + 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x15, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, + 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, + 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x22, 0x57, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x15, 0x61, + 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xa1, 0x02, 0x0a, 0x04, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x5f, 0x6f, 0x66, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x74, 0x65, 0x72, 0x6d, 0x73, 0x4f, 0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2d, + 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x2d, 0x0a, + 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x63, 0x65, + 0x6e, 0x73, 0x65, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x10, + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, + 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x37, 0x0a, + 0x09, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x44, 0x0a, 0x0d, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x70, 0x0a, 0x07, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x3f, 0x0a, + 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x45, + 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4b, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x51, 0x0a, 0x0e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, + 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x59, 0x0a, 0x12, 0x4e, 0x61, 0x6d, 0x65, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x4b, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x6d, 0x0a, 0x1c, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x37, + 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x55, 0x0a, 0x10, 0x4e, 0x61, 0x6d, 0x65, 0x64, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb5, + 0x03, 0x0a, 0x10, 0x4e, 0x6f, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x1b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, + 0x52, 0x18, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x6c, 0x0a, 0x1e, 0x66, 0x6f, + 0x72, 0x6d, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x46, 0x6f, 0x72, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x1a, 0x66, 0x6f, + 0x72, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, + 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x62, 0x0a, 0x1a, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x48, 0x00, 0x52, 0x17, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x5f, 0x0a, 0x19, + 0x70, 0x61, 0x74, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, + 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x74, + 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x16, 0x70, 0x61, 0x74, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x07, 0x0a, + 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xa1, 0x02, 0x0a, 0x18, 0x4f, 0x61, 0x75, 0x74, 0x68, + 0x32, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2b, 0x0a, + 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, + 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xf5, 0x01, 0x0a, 0x19, 0x4f, + 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, + 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, + 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, + 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x49, 0x6d, 0x70, + 0x6c, 0x69, 0x63, 0x69, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, + 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, + 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xf2, 0x01, 0x0a, 0x16, 0x4f, 0x61, 0x75, 0x74, + 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, + 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x0c, + 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x15, + 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x9e, 0x04, 0x0a, 0x09, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, + 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, + 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x49, 0x74, + 0x65, 0x6d, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x33, + 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x18, 0x0a, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x12, 0x1e, 0x0a, + 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x3b, 0x0a, + 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, + 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0d, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, + 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa6, 0x01, 0x0a, 0x09, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0e, 0x62, 0x6f, 0x64, + 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0d, + 0x62, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x4c, 0x0a, + 0x12, 0x6e, 0x6f, 0x6e, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x6f, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x10, 0x6e, 0x6f, 0x6e, 0x42, 0x6f, + 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x6f, + 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x67, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4f, 0x0a, 0x15, + 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x94, 0x01, + 0x0a, 0x0e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x49, 0x74, 0x65, 0x6d, + 0x12, 0x35, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x09, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0e, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4a, 0x73, 0x6f, + 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x6a, 0x73, + 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, + 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xcf, 0x03, 0x0a, 0x08, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x52, 0x65, 0x66, 0x12, 0x27, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, + 0x03, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x03, 0x70, 0x75, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x70, 0x6f, 0x73, + 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x29, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x2b, 0x0a, 0x05, + 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, + 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfb, 0x05, 0x0a, 0x16, 0x50, 0x61, 0x74, 0x68, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, + 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, + 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, + 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, + 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, + 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, + 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, + 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, + 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, + 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, + 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, + 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, + 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, + 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, + 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x11, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, + 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, + 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, + 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, + 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, + 0x66, 0x18, 0x15, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, + 0x65, 0x4f, 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, + 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x77, 0x0a, 0x05, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x3f, 0x0a, + 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, + 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x92, 0x05, + 0x0a, 0x0f, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, + 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, + 0x6d, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, + 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, + 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, + 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, + 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, + 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, + 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, + 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, + 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, + 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, + 0x6e, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, + 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, + 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, + 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x12, 0x4c, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, + 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xa8, + 0x06, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, + 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, + 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, + 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, + 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, + 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, + 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, + 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, + 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, + 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, + 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, + 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, + 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, + 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, + 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, + 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x16, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, + 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, + 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x17, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfe, 0x01, 0x0a, 0x08, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x2d, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x07, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x30, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, + 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, + 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x65, 0x0a, 0x13, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x4e, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, + 0x73, 0x22, 0x90, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0e, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4a, 0x73, 0x6f, + 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x6a, 0x73, + 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, + 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x91, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, + 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xaf, 0x09, 0x0a, 0x06, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, + 0x4f, 0x66, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, + 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, + 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, + 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, + 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, + 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, + 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, + 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, + 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, + 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, + 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, + 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, + 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, + 0x61, 0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, + 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x69, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, + 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, + 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, + 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x59, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x15, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x69, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, + 0x28, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x49, + 0x74, 0x65, 0x6d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x6c, 0x6c, 0x5f, 0x6f, 0x66, + 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x4f, + 0x66, 0x12, 0x36, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, + 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x69, 0x73, + 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x1b, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x21, 0x0a, 0x03, + 0x78, 0x6d, 0x6c, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x58, 0x6d, 0x6c, 0x52, 0x03, 0x78, 0x6d, 0x6c, 0x12, + 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, + 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, + 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x29, + 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, + 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, + 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x1f, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x7e, 0x0a, 0x0a, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x39, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x74, 0x0a, 0x13, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x5d, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x22, 0xe9, 0x04, 0x0a, 0x17, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x6d, 0x0a, 0x1d, + 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x1b, + 0x62, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x10, 0x61, + 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x48, 0x00, 0x52, 0x0e, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x5e, 0x0a, 0x18, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x69, 0x6d, + 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x49, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, + 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x16, 0x6f, 0x61, 0x75, + 0x74, 0x68, 0x32, 0x49, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x5e, 0x0a, 0x18, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x16, 0x6f, 0x61, 0x75, + 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x67, 0x0a, 0x1b, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, + 0x00, 0x52, 0x19, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x65, 0x0a, 0x1b, + 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, + 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x53, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x18, 0x6f, 0x61, 0x75, 0x74, 0x68, + 0x32, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x68, 0x0a, 0x13, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, + 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x23, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x03, + 0x54, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, + 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x0a, 0x08, 0x54, 0x79, 0x70, + 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5c, 0x0a, 0x0f, 0x56, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x49, + 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, + 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xc8, 0x01, 0x0a, 0x03, 0x58, 0x6d, + 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x72, 0x61, + 0x70, 0x70, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, + 0x70, 0x65, 0x64, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, + 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x3c, 0x0a, 0x0e, 0x6f, 0x72, 0x67, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x5f, 0x76, 0x32, 0x42, 0x0c, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x14, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, + 0x32, 0x3b, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4f, + 0x41, 0x53, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_openapiv2_OpenAPIv2_proto_rawDescOnce sync.Once + file_openapiv2_OpenAPIv2_proto_rawDescData = file_openapiv2_OpenAPIv2_proto_rawDesc +) + +func file_openapiv2_OpenAPIv2_proto_rawDescGZIP() []byte { + file_openapiv2_OpenAPIv2_proto_rawDescOnce.Do(func() { + file_openapiv2_OpenAPIv2_proto_rawDescData = protoimpl.X.CompressGZIP(file_openapiv2_OpenAPIv2_proto_rawDescData) + }) + return file_openapiv2_OpenAPIv2_proto_rawDescData +} + +var file_openapiv2_OpenAPIv2_proto_msgTypes = make([]protoimpl.MessageInfo, 60) +var file_openapiv2_OpenAPIv2_proto_goTypes = []interface{}{ + (*AdditionalPropertiesItem)(nil), // 0: openapi.v2.AdditionalPropertiesItem + (*Any)(nil), // 1: openapi.v2.Any + (*ApiKeySecurity)(nil), // 2: openapi.v2.ApiKeySecurity + (*BasicAuthenticationSecurity)(nil), // 3: openapi.v2.BasicAuthenticationSecurity + (*BodyParameter)(nil), // 4: openapi.v2.BodyParameter + (*Contact)(nil), // 5: openapi.v2.Contact + (*Default)(nil), // 6: openapi.v2.Default + (*Definitions)(nil), // 7: openapi.v2.Definitions + (*Document)(nil), // 8: openapi.v2.Document + (*Examples)(nil), // 9: openapi.v2.Examples + (*ExternalDocs)(nil), // 10: openapi.v2.ExternalDocs + (*FileSchema)(nil), // 11: openapi.v2.FileSchema + (*FormDataParameterSubSchema)(nil), // 12: openapi.v2.FormDataParameterSubSchema + (*Header)(nil), // 13: openapi.v2.Header + (*HeaderParameterSubSchema)(nil), // 14: openapi.v2.HeaderParameterSubSchema + (*Headers)(nil), // 15: openapi.v2.Headers + (*Info)(nil), // 16: openapi.v2.Info + (*ItemsItem)(nil), // 17: openapi.v2.ItemsItem + (*JsonReference)(nil), // 18: openapi.v2.JsonReference + (*License)(nil), // 19: openapi.v2.License + (*NamedAny)(nil), // 20: openapi.v2.NamedAny + (*NamedHeader)(nil), // 21: openapi.v2.NamedHeader + (*NamedParameter)(nil), // 22: openapi.v2.NamedParameter + (*NamedPathItem)(nil), // 23: openapi.v2.NamedPathItem + (*NamedResponse)(nil), // 24: openapi.v2.NamedResponse + (*NamedResponseValue)(nil), // 25: openapi.v2.NamedResponseValue + (*NamedSchema)(nil), // 26: openapi.v2.NamedSchema + (*NamedSecurityDefinitionsItem)(nil), // 27: openapi.v2.NamedSecurityDefinitionsItem + (*NamedString)(nil), // 28: openapi.v2.NamedString + (*NamedStringArray)(nil), // 29: openapi.v2.NamedStringArray + (*NonBodyParameter)(nil), // 30: openapi.v2.NonBodyParameter + (*Oauth2AccessCodeSecurity)(nil), // 31: openapi.v2.Oauth2AccessCodeSecurity + (*Oauth2ApplicationSecurity)(nil), // 32: openapi.v2.Oauth2ApplicationSecurity + (*Oauth2ImplicitSecurity)(nil), // 33: openapi.v2.Oauth2ImplicitSecurity + (*Oauth2PasswordSecurity)(nil), // 34: openapi.v2.Oauth2PasswordSecurity + (*Oauth2Scopes)(nil), // 35: openapi.v2.Oauth2Scopes + (*Operation)(nil), // 36: openapi.v2.Operation + (*Parameter)(nil), // 37: openapi.v2.Parameter + (*ParameterDefinitions)(nil), // 38: openapi.v2.ParameterDefinitions + (*ParametersItem)(nil), // 39: openapi.v2.ParametersItem + (*PathItem)(nil), // 40: openapi.v2.PathItem + (*PathParameterSubSchema)(nil), // 41: openapi.v2.PathParameterSubSchema + (*Paths)(nil), // 42: openapi.v2.Paths + (*PrimitivesItems)(nil), // 43: openapi.v2.PrimitivesItems + (*Properties)(nil), // 44: openapi.v2.Properties + (*QueryParameterSubSchema)(nil), // 45: openapi.v2.QueryParameterSubSchema + (*Response)(nil), // 46: openapi.v2.Response + (*ResponseDefinitions)(nil), // 47: openapi.v2.ResponseDefinitions + (*ResponseValue)(nil), // 48: openapi.v2.ResponseValue + (*Responses)(nil), // 49: openapi.v2.Responses + (*Schema)(nil), // 50: openapi.v2.Schema + (*SchemaItem)(nil), // 51: openapi.v2.SchemaItem + (*SecurityDefinitions)(nil), // 52: openapi.v2.SecurityDefinitions + (*SecurityDefinitionsItem)(nil), // 53: openapi.v2.SecurityDefinitionsItem + (*SecurityRequirement)(nil), // 54: openapi.v2.SecurityRequirement + (*StringArray)(nil), // 55: openapi.v2.StringArray + (*Tag)(nil), // 56: openapi.v2.Tag + (*TypeItem)(nil), // 57: openapi.v2.TypeItem + (*VendorExtension)(nil), // 58: openapi.v2.VendorExtension + (*Xml)(nil), // 59: openapi.v2.Xml + (*any.Any)(nil), // 60: google.protobuf.Any +} +var file_openapiv2_OpenAPIv2_proto_depIdxs = []int32{ + 50, // 0: openapi.v2.AdditionalPropertiesItem.schema:type_name -> openapi.v2.Schema + 60, // 1: openapi.v2.Any.value:type_name -> google.protobuf.Any + 20, // 2: openapi.v2.ApiKeySecurity.vendor_extension:type_name -> openapi.v2.NamedAny + 20, // 3: openapi.v2.BasicAuthenticationSecurity.vendor_extension:type_name -> openapi.v2.NamedAny + 50, // 4: openapi.v2.BodyParameter.schema:type_name -> openapi.v2.Schema + 20, // 5: openapi.v2.BodyParameter.vendor_extension:type_name -> openapi.v2.NamedAny + 20, // 6: openapi.v2.Contact.vendor_extension:type_name -> openapi.v2.NamedAny + 20, // 7: openapi.v2.Default.additional_properties:type_name -> openapi.v2.NamedAny + 26, // 8: openapi.v2.Definitions.additional_properties:type_name -> openapi.v2.NamedSchema + 16, // 9: openapi.v2.Document.info:type_name -> openapi.v2.Info + 42, // 10: openapi.v2.Document.paths:type_name -> openapi.v2.Paths + 7, // 11: openapi.v2.Document.definitions:type_name -> openapi.v2.Definitions + 38, // 12: openapi.v2.Document.parameters:type_name -> openapi.v2.ParameterDefinitions + 47, // 13: openapi.v2.Document.responses:type_name -> openapi.v2.ResponseDefinitions + 54, // 14: openapi.v2.Document.security:type_name -> openapi.v2.SecurityRequirement + 52, // 15: openapi.v2.Document.security_definitions:type_name -> openapi.v2.SecurityDefinitions + 56, // 16: openapi.v2.Document.tags:type_name -> openapi.v2.Tag + 10, // 17: openapi.v2.Document.external_docs:type_name -> openapi.v2.ExternalDocs + 20, // 18: openapi.v2.Document.vendor_extension:type_name -> openapi.v2.NamedAny + 20, // 19: openapi.v2.Examples.additional_properties:type_name -> openapi.v2.NamedAny + 20, // 20: openapi.v2.ExternalDocs.vendor_extension:type_name -> openapi.v2.NamedAny + 1, // 21: openapi.v2.FileSchema.default:type_name -> openapi.v2.Any + 10, // 22: openapi.v2.FileSchema.external_docs:type_name -> openapi.v2.ExternalDocs + 1, // 23: openapi.v2.FileSchema.example:type_name -> openapi.v2.Any + 20, // 24: openapi.v2.FileSchema.vendor_extension:type_name -> openapi.v2.NamedAny + 43, // 25: openapi.v2.FormDataParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems + 1, // 26: openapi.v2.FormDataParameterSubSchema.default:type_name -> openapi.v2.Any + 1, // 27: openapi.v2.FormDataParameterSubSchema.enum:type_name -> openapi.v2.Any + 20, // 28: openapi.v2.FormDataParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny + 43, // 29: openapi.v2.Header.items:type_name -> openapi.v2.PrimitivesItems + 1, // 30: openapi.v2.Header.default:type_name -> openapi.v2.Any + 1, // 31: openapi.v2.Header.enum:type_name -> openapi.v2.Any + 20, // 32: openapi.v2.Header.vendor_extension:type_name -> openapi.v2.NamedAny + 43, // 33: openapi.v2.HeaderParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems + 1, // 34: openapi.v2.HeaderParameterSubSchema.default:type_name -> openapi.v2.Any + 1, // 35: openapi.v2.HeaderParameterSubSchema.enum:type_name -> openapi.v2.Any + 20, // 36: openapi.v2.HeaderParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny + 21, // 37: openapi.v2.Headers.additional_properties:type_name -> openapi.v2.NamedHeader + 5, // 38: openapi.v2.Info.contact:type_name -> openapi.v2.Contact + 19, // 39: openapi.v2.Info.license:type_name -> openapi.v2.License + 20, // 40: openapi.v2.Info.vendor_extension:type_name -> openapi.v2.NamedAny + 50, // 41: openapi.v2.ItemsItem.schema:type_name -> openapi.v2.Schema + 20, // 42: openapi.v2.License.vendor_extension:type_name -> openapi.v2.NamedAny + 1, // 43: openapi.v2.NamedAny.value:type_name -> openapi.v2.Any + 13, // 44: openapi.v2.NamedHeader.value:type_name -> openapi.v2.Header + 37, // 45: openapi.v2.NamedParameter.value:type_name -> openapi.v2.Parameter + 40, // 46: openapi.v2.NamedPathItem.value:type_name -> openapi.v2.PathItem + 46, // 47: openapi.v2.NamedResponse.value:type_name -> openapi.v2.Response + 48, // 48: openapi.v2.NamedResponseValue.value:type_name -> openapi.v2.ResponseValue + 50, // 49: openapi.v2.NamedSchema.value:type_name -> openapi.v2.Schema + 53, // 50: openapi.v2.NamedSecurityDefinitionsItem.value:type_name -> openapi.v2.SecurityDefinitionsItem + 55, // 51: openapi.v2.NamedStringArray.value:type_name -> openapi.v2.StringArray + 14, // 52: openapi.v2.NonBodyParameter.header_parameter_sub_schema:type_name -> openapi.v2.HeaderParameterSubSchema + 12, // 53: openapi.v2.NonBodyParameter.form_data_parameter_sub_schema:type_name -> openapi.v2.FormDataParameterSubSchema + 45, // 54: openapi.v2.NonBodyParameter.query_parameter_sub_schema:type_name -> openapi.v2.QueryParameterSubSchema + 41, // 55: openapi.v2.NonBodyParameter.path_parameter_sub_schema:type_name -> openapi.v2.PathParameterSubSchema + 35, // 56: openapi.v2.Oauth2AccessCodeSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes + 20, // 57: openapi.v2.Oauth2AccessCodeSecurity.vendor_extension:type_name -> openapi.v2.NamedAny + 35, // 58: openapi.v2.Oauth2ApplicationSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes + 20, // 59: openapi.v2.Oauth2ApplicationSecurity.vendor_extension:type_name -> openapi.v2.NamedAny + 35, // 60: openapi.v2.Oauth2ImplicitSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes + 20, // 61: openapi.v2.Oauth2ImplicitSecurity.vendor_extension:type_name -> openapi.v2.NamedAny + 35, // 62: openapi.v2.Oauth2PasswordSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes + 20, // 63: openapi.v2.Oauth2PasswordSecurity.vendor_extension:type_name -> openapi.v2.NamedAny + 28, // 64: openapi.v2.Oauth2Scopes.additional_properties:type_name -> openapi.v2.NamedString + 10, // 65: openapi.v2.Operation.external_docs:type_name -> openapi.v2.ExternalDocs + 39, // 66: openapi.v2.Operation.parameters:type_name -> openapi.v2.ParametersItem + 49, // 67: openapi.v2.Operation.responses:type_name -> openapi.v2.Responses + 54, // 68: openapi.v2.Operation.security:type_name -> openapi.v2.SecurityRequirement + 20, // 69: openapi.v2.Operation.vendor_extension:type_name -> openapi.v2.NamedAny + 4, // 70: openapi.v2.Parameter.body_parameter:type_name -> openapi.v2.BodyParameter + 30, // 71: openapi.v2.Parameter.non_body_parameter:type_name -> openapi.v2.NonBodyParameter + 22, // 72: openapi.v2.ParameterDefinitions.additional_properties:type_name -> openapi.v2.NamedParameter + 37, // 73: openapi.v2.ParametersItem.parameter:type_name -> openapi.v2.Parameter + 18, // 74: openapi.v2.ParametersItem.json_reference:type_name -> openapi.v2.JsonReference + 36, // 75: openapi.v2.PathItem.get:type_name -> openapi.v2.Operation + 36, // 76: openapi.v2.PathItem.put:type_name -> openapi.v2.Operation + 36, // 77: openapi.v2.PathItem.post:type_name -> openapi.v2.Operation + 36, // 78: openapi.v2.PathItem.delete:type_name -> openapi.v2.Operation + 36, // 79: openapi.v2.PathItem.options:type_name -> openapi.v2.Operation + 36, // 80: openapi.v2.PathItem.head:type_name -> openapi.v2.Operation + 36, // 81: openapi.v2.PathItem.patch:type_name -> openapi.v2.Operation + 39, // 82: openapi.v2.PathItem.parameters:type_name -> openapi.v2.ParametersItem + 20, // 83: openapi.v2.PathItem.vendor_extension:type_name -> openapi.v2.NamedAny + 43, // 84: openapi.v2.PathParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems + 1, // 85: openapi.v2.PathParameterSubSchema.default:type_name -> openapi.v2.Any + 1, // 86: openapi.v2.PathParameterSubSchema.enum:type_name -> openapi.v2.Any + 20, // 87: openapi.v2.PathParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny + 20, // 88: openapi.v2.Paths.vendor_extension:type_name -> openapi.v2.NamedAny + 23, // 89: openapi.v2.Paths.path:type_name -> openapi.v2.NamedPathItem + 43, // 90: openapi.v2.PrimitivesItems.items:type_name -> openapi.v2.PrimitivesItems + 1, // 91: openapi.v2.PrimitivesItems.default:type_name -> openapi.v2.Any + 1, // 92: openapi.v2.PrimitivesItems.enum:type_name -> openapi.v2.Any + 20, // 93: openapi.v2.PrimitivesItems.vendor_extension:type_name -> openapi.v2.NamedAny + 26, // 94: openapi.v2.Properties.additional_properties:type_name -> openapi.v2.NamedSchema + 43, // 95: openapi.v2.QueryParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems + 1, // 96: openapi.v2.QueryParameterSubSchema.default:type_name -> openapi.v2.Any + 1, // 97: openapi.v2.QueryParameterSubSchema.enum:type_name -> openapi.v2.Any + 20, // 98: openapi.v2.QueryParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny + 51, // 99: openapi.v2.Response.schema:type_name -> openapi.v2.SchemaItem + 15, // 100: openapi.v2.Response.headers:type_name -> openapi.v2.Headers + 9, // 101: openapi.v2.Response.examples:type_name -> openapi.v2.Examples + 20, // 102: openapi.v2.Response.vendor_extension:type_name -> openapi.v2.NamedAny + 24, // 103: openapi.v2.ResponseDefinitions.additional_properties:type_name -> openapi.v2.NamedResponse + 46, // 104: openapi.v2.ResponseValue.response:type_name -> openapi.v2.Response + 18, // 105: openapi.v2.ResponseValue.json_reference:type_name -> openapi.v2.JsonReference + 25, // 106: openapi.v2.Responses.response_code:type_name -> openapi.v2.NamedResponseValue + 20, // 107: openapi.v2.Responses.vendor_extension:type_name -> openapi.v2.NamedAny + 1, // 108: openapi.v2.Schema.default:type_name -> openapi.v2.Any + 1, // 109: openapi.v2.Schema.enum:type_name -> openapi.v2.Any + 0, // 110: openapi.v2.Schema.additional_properties:type_name -> openapi.v2.AdditionalPropertiesItem + 57, // 111: openapi.v2.Schema.type:type_name -> openapi.v2.TypeItem + 17, // 112: openapi.v2.Schema.items:type_name -> openapi.v2.ItemsItem + 50, // 113: openapi.v2.Schema.all_of:type_name -> openapi.v2.Schema + 44, // 114: openapi.v2.Schema.properties:type_name -> openapi.v2.Properties + 59, // 115: openapi.v2.Schema.xml:type_name -> openapi.v2.Xml + 10, // 116: openapi.v2.Schema.external_docs:type_name -> openapi.v2.ExternalDocs + 1, // 117: openapi.v2.Schema.example:type_name -> openapi.v2.Any + 20, // 118: openapi.v2.Schema.vendor_extension:type_name -> openapi.v2.NamedAny + 50, // 119: openapi.v2.SchemaItem.schema:type_name -> openapi.v2.Schema + 11, // 120: openapi.v2.SchemaItem.file_schema:type_name -> openapi.v2.FileSchema + 27, // 121: openapi.v2.SecurityDefinitions.additional_properties:type_name -> openapi.v2.NamedSecurityDefinitionsItem + 3, // 122: openapi.v2.SecurityDefinitionsItem.basic_authentication_security:type_name -> openapi.v2.BasicAuthenticationSecurity + 2, // 123: openapi.v2.SecurityDefinitionsItem.api_key_security:type_name -> openapi.v2.ApiKeySecurity + 33, // 124: openapi.v2.SecurityDefinitionsItem.oauth2_implicit_security:type_name -> openapi.v2.Oauth2ImplicitSecurity + 34, // 125: openapi.v2.SecurityDefinitionsItem.oauth2_password_security:type_name -> openapi.v2.Oauth2PasswordSecurity + 32, // 126: openapi.v2.SecurityDefinitionsItem.oauth2_application_security:type_name -> openapi.v2.Oauth2ApplicationSecurity + 31, // 127: openapi.v2.SecurityDefinitionsItem.oauth2_access_code_security:type_name -> openapi.v2.Oauth2AccessCodeSecurity + 29, // 128: openapi.v2.SecurityRequirement.additional_properties:type_name -> openapi.v2.NamedStringArray + 10, // 129: openapi.v2.Tag.external_docs:type_name -> openapi.v2.ExternalDocs + 20, // 130: openapi.v2.Tag.vendor_extension:type_name -> openapi.v2.NamedAny + 20, // 131: openapi.v2.VendorExtension.additional_properties:type_name -> openapi.v2.NamedAny + 20, // 132: openapi.v2.Xml.vendor_extension:type_name -> openapi.v2.NamedAny + 133, // [133:133] is the sub-list for method output_type + 133, // [133:133] is the sub-list for method input_type + 133, // [133:133] is the sub-list for extension type_name + 133, // [133:133] is the sub-list for extension extendee + 0, // [0:133] is the sub-list for field type_name +} + +func init() { file_openapiv2_OpenAPIv2_proto_init() } +func file_openapiv2_OpenAPIv2_proto_init() { + if File_openapiv2_OpenAPIv2_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_openapiv2_OpenAPIv2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdditionalPropertiesItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Any); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApiKeySecurity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BasicAuthenticationSecurity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BodyParameter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Contact); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Default); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Definitions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Document); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Examples); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExternalDocs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FileSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormDataParameterSubSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeaderParameterSubSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Headers); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Info); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemsItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JsonReference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*License); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedAny); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedParameter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedPathItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedResponseValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedSecurityDefinitionsItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedString); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamedStringArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NonBodyParameter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Oauth2AccessCodeSecurity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Oauth2ApplicationSecurity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Oauth2ImplicitSecurity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Oauth2PasswordSecurity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Oauth2Scopes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Operation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Parameter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParameterDefinitions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParametersItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PathItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PathParameterSubSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Paths); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrimitivesItems); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Properties); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParameterSubSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResponseDefinitions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResponseValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Responses); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SchemaItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecurityDefinitions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecurityDefinitionsItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecurityRequirement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StringArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TypeItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VendorExtension); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Xml); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_openapiv2_OpenAPIv2_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*AdditionalPropertiesItem_Schema)(nil), + (*AdditionalPropertiesItem_Boolean)(nil), + } + file_openapiv2_OpenAPIv2_proto_msgTypes[30].OneofWrappers = []interface{}{ + (*NonBodyParameter_HeaderParameterSubSchema)(nil), + (*NonBodyParameter_FormDataParameterSubSchema)(nil), + (*NonBodyParameter_QueryParameterSubSchema)(nil), + (*NonBodyParameter_PathParameterSubSchema)(nil), + } + file_openapiv2_OpenAPIv2_proto_msgTypes[37].OneofWrappers = []interface{}{ + (*Parameter_BodyParameter)(nil), + (*Parameter_NonBodyParameter)(nil), + } + file_openapiv2_OpenAPIv2_proto_msgTypes[39].OneofWrappers = []interface{}{ + (*ParametersItem_Parameter)(nil), + (*ParametersItem_JsonReference)(nil), + } + file_openapiv2_OpenAPIv2_proto_msgTypes[48].OneofWrappers = []interface{}{ + (*ResponseValue_Response)(nil), + (*ResponseValue_JsonReference)(nil), + } + file_openapiv2_OpenAPIv2_proto_msgTypes[51].OneofWrappers = []interface{}{ + (*SchemaItem_Schema)(nil), + (*SchemaItem_FileSchema)(nil), + } + file_openapiv2_OpenAPIv2_proto_msgTypes[53].OneofWrappers = []interface{}{ + (*SecurityDefinitionsItem_BasicAuthenticationSecurity)(nil), + (*SecurityDefinitionsItem_ApiKeySecurity)(nil), + (*SecurityDefinitionsItem_Oauth2ImplicitSecurity)(nil), + (*SecurityDefinitionsItem_Oauth2PasswordSecurity)(nil), + (*SecurityDefinitionsItem_Oauth2ApplicationSecurity)(nil), + (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_openapiv2_OpenAPIv2_proto_rawDesc, + NumEnums: 0, + NumMessages: 60, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_openapiv2_OpenAPIv2_proto_goTypes, + DependencyIndexes: file_openapiv2_OpenAPIv2_proto_depIdxs, + MessageInfos: file_openapiv2_OpenAPIv2_proto_msgTypes, + }.Build() + File_openapiv2_OpenAPIv2_proto = out.File + file_openapiv2_OpenAPIv2_proto_rawDesc = nil + file_openapiv2_OpenAPIv2_proto_goTypes = nil + file_openapiv2_OpenAPIv2_proto_depIdxs = nil } diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto index 557c88072cd8..00ac1b0a080e 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All Rights Reserved. +// Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,6 +41,9 @@ option java_package = "org.openapi_v2"; // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; +// The Go package name. +option go_package = "openapiv2;openapi_v2"; + message AdditionalPropertiesItem { oneof oneof { Schema schema = 1; @@ -553,7 +556,7 @@ message Response { repeated NamedAny vendor_extension = 5; } -// One or more JSON representations for parameters +// One or more JSON representations for responses message ResponseDefinitions { repeated NamedResponse additional_properties = 1; } diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/README.md b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/README.md index 836fb32a7ef0..5276128d3b8e 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/README.md +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/README.md @@ -1,16 +1,14 @@ # OpenAPI v2 Protocol Buffer Models -This directory contains a Protocol Buffer-language model -and related code for supporting OpenAPI v2. +This directory contains a Protocol Buffer-language model and related code for +supporting OpenAPI v2. -Gnostic applications and plugins can use OpenAPIv2.proto -to generate Protocol Buffer support code for their preferred languages. +Gnostic applications and plugins can use OpenAPIv2.proto to generate Protocol +Buffer support code for their preferred languages. -OpenAPIv2.go is used by Gnostic to read JSON and YAML OpenAPI -descriptions into the Protocol Buffer-based datastructures -generated from OpenAPIv2.proto. +OpenAPIv2.go is used by Gnostic to read JSON and YAML OpenAPI descriptions into +the Protocol Buffer-based datastructures generated from OpenAPIv2.proto. -OpenAPIv2.proto and OpenAPIv2.go are generated by the Gnostic -compiler generator, and OpenAPIv2.pb.go is generated by -protoc, the Protocol Buffer compiler, and protoc-gen-go, the -Protocol Buffer Go code generation plugin. +OpenAPIv2.proto and OpenAPIv2.go are generated by the Gnostic compiler +generator, and OpenAPIv2.pb.go is generated by protoc, the Protocol Buffer +compiler, and protoc-gen-go, the Protocol Buffer Go code generation plugin. diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/document.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/document.go new file mode 100644 index 000000000000..ddeed5c89721 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/document.go @@ -0,0 +1,26 @@ +// Copyright 2020 Google LLC. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package openapi_v2 + +import "github.com/googleapis/gnostic/compiler" + +// ParseDocument reads an OpenAPI v2 description from a YAML/JSON representation. +func ParseDocument(b []byte) (*Document, error) { + info, err := compiler.ReadInfoFromBytes("", b) + if err != nil { + return nil, err + } + return NewDocument(info.Content[0], compiler.NewContextWithExtensions("$root", nil, nil)) +} diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/openapi-2.0.json b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/openapi-2.0.json index 2815a26ea718..afa12b79b8fe 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/openapi-2.0.json +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/openapi-2.0.json @@ -203,7 +203,7 @@ "additionalProperties": { "$ref": "#/definitions/response" }, - "description": "One or more JSON representations for parameters" + "description": "One or more JSON representations for responses" }, "externalDocs": { "type": "object", @@ -1607,4 +1607,4 @@ } } } -} +} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE b/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE deleted file mode 100644 index 14127cd831ec..000000000000 --- a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -(The MIT License) - -Copyright (c) 2017 marvin + konsorten GmbH (open-source@konsorten.de) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md b/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md deleted file mode 100644 index 09a4a35c9bb7..000000000000 --- a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Windows Terminal Sequences - -This library allow for enabling Windows terminal color support for Go. - -See [Console Virtual Terminal Sequences](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences) for details. - -## Usage - -```go -import ( - "syscall" - - sequences "github.com/konsorten/go-windows-terminal-sequences" -) - -func main() { - sequences.EnableVirtualTerminalProcessing(syscall.Stdout, true) -} - -``` - -## Authors - -The tool is sponsored by the [marvin + konsorten GmbH](http://www.konsorten.de). - -We thank all the authors who provided code to this library: - -* Felix Kollmann -* Nicolas Perraut -* @dirty49374 - -## License - -(The MIT License) - -Copyright (c) 2018 marvin + konsorten GmbH (open-source@konsorten.de) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod b/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod deleted file mode 100644 index 716c6131256f..000000000000 --- a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/konsorten/go-windows-terminal-sequences diff --git a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go b/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go deleted file mode 100644 index 57f530ae83f6..000000000000 --- a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build windows - -package sequences - -import ( - "syscall" -) - -var ( - kernel32Dll *syscall.LazyDLL = syscall.NewLazyDLL("Kernel32.dll") - setConsoleMode *syscall.LazyProc = kernel32Dll.NewProc("SetConsoleMode") -) - -func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error { - const ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x4 - - var mode uint32 - err := syscall.GetConsoleMode(syscall.Stdout, &mode) - if err != nil { - return err - } - - if enable { - mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING - } else { - mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING - } - - ret, _, err := setConsoleMode.Call(uintptr(stream), uintptr(mode)) - if ret == 0 { - return err - } - - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go b/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go deleted file mode 100644 index df61a6f2f6fe..000000000000 --- a/cluster-autoscaler/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build linux darwin - -package sequences - -import ( - "fmt" -) - -func EnableVirtualTerminalProcessing(stream uintptr, enable bool) error { - return fmt.Errorf("windows only package") -} diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/doc.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/doc.go new file mode 100644 index 000000000000..b80e05efd056 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/doc.go @@ -0,0 +1,44 @@ +// Package mountinfo provides a set of functions to retrieve information about OS mounts. +// +// Currently it supports Linux. For historical reasons, there is also some support for FreeBSD and OpenBSD, +// and a shallow implementation for Windows, but in general this is Linux-only package, so +// the rest of the document only applies to Linux, unless explicitly specified otherwise. +// +// In Linux, information about mounts seen by the current process is available from +// /proc/self/mountinfo. Note that due to mount namespaces, different processes can +// see different mounts. A per-process mountinfo table is available from /proc//mountinfo, +// where is a numerical process identifier. +// +// In general, /proc is not a very efficient interface, and mountinfo is not an exception. +// For example, there is no way to get information about a specific mount point (i.e. it +// is all-or-nothing). This package tries to hide the /proc ineffectiveness by using +// parse filters while reading mountinfo. A filter can skip some entries, or stop +// processing the rest of the file once the needed information is found. +// +// For mountinfo filters that accept path as an argument, the path must be absolute, +// having all symlinks resolved, and being cleaned (i.e. no extra slashes or dots). +// One way to achieve all of the above is to employ filepath.Abs followed by +// filepath.EvalSymlinks (the latter calls filepath.Clean on the result so +// there is no need to explicitly call filepath.Clean). +// +// NOTE that in many cases there is no need to consult mountinfo at all. Here are some +// of the cases where mountinfo should not be parsed: +// +// 1. Before performing a mount. Usually, this is not needed, but if required (say to +// prevent over-mounts), to check whether a directory is mounted, call os.Lstat +// on it and its parent directory, and compare their st.Sys().(*syscall.Stat_t).Dev +// fields -- if they differ, then the directory is the mount point. NOTE this does +// not work for bind mounts. Optionally, the filesystem type can also be checked +// by calling unix.Statfs and checking the Type field (i.e. filesystem type). +// +// 2. After performing a mount. If there is no error returned, the mount succeeded; +// checking the mount table for a new mount is redundant and expensive. +// +// 3. Before performing an unmount. It is more efficient to do an unmount and ignore +// a specific error (EINVAL) which tells the directory is not mounted. +// +// 4. After performing an unmount. If there is no error returned, the unmount succeeded. +// +// 5. To find the mount point root of a specific directory. You can perform os.Stat() +// on the directory and traverse up until the Dev field of a parent directory differs. +package mountinfo diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/go.mod b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/go.mod index 10d9a15a6c75..9749ea96d9d5 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/go.mod +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/go.mod @@ -1,3 +1,5 @@ module github.com/moby/sys/mountinfo go 1.14 + +require golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/go.sum b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/go.sum new file mode 100644 index 000000000000..2a5be7ea8438 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/go.sum @@ -0,0 +1,2 @@ +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 h1:W0lCpv29Hv0UaM1LXb9QlBHLNP8UFfcKjblhVCWftOM= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mounted_linux.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mounted_linux.go new file mode 100644 index 000000000000..bc9f6b2ad3d7 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mounted_linux.go @@ -0,0 +1,58 @@ +package mountinfo + +import ( + "os" + "path/filepath" + + "golang.org/x/sys/unix" +) + +// mountedByOpenat2 is a method of detecting a mount that works for all kinds +// of mounts (incl. bind mounts), but requires a recent (v5.6+) linux kernel. +func mountedByOpenat2(path string) (bool, error) { + dir, last := filepath.Split(path) + + dirfd, err := unix.Openat2(unix.AT_FDCWD, dir, &unix.OpenHow{ + Flags: unix.O_PATH | unix.O_CLOEXEC, + }) + if err != nil { + if err == unix.ENOENT { // not a mount + return false, nil + } + return false, &os.PathError{Op: "openat2", Path: dir, Err: err} + } + fd, err := unix.Openat2(dirfd, last, &unix.OpenHow{ + Flags: unix.O_PATH | unix.O_CLOEXEC | unix.O_NOFOLLOW, + Resolve: unix.RESOLVE_NO_XDEV, + }) + _ = unix.Close(dirfd) + switch err { + case nil: // definitely not a mount + _ = unix.Close(fd) + return false, nil + case unix.EXDEV: // definitely a mount + return true, nil + case unix.ENOENT: // not a mount + return false, nil + } + // not sure + return false, &os.PathError{Op: "openat2", Path: path, Err: err} +} + +func mounted(path string) (bool, error) { + // Try a fast path, using openat2() with RESOLVE_NO_XDEV. + mounted, err := mountedByOpenat2(path) + if err == nil { + return mounted, nil + } + // Another fast path: compare st.st_dev fields. + mounted, err = mountedByStat(path) + // This does not work for bind mounts, so false negative + // is possible, therefore only trust if return is true. + if mounted && err == nil { + return mounted, nil + } + + // Fallback to parsing mountinfo + return mountedByMountinfo(path) +} diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mounted_unix.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mounted_unix.go new file mode 100644 index 000000000000..efb03978b1e3 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mounted_unix.go @@ -0,0 +1,66 @@ +// +build linux freebsd,cgo openbsd,cgo + +package mountinfo + +import ( + "errors" + "fmt" + "os" + "path/filepath" + + "golang.org/x/sys/unix" +) + +func mountedByStat(path string) (bool, error) { + var st unix.Stat_t + + if err := unix.Lstat(path, &st); err != nil { + if err == unix.ENOENT { + // Treat ENOENT as "not mounted". + return false, nil + } + return false, &os.PathError{Op: "stat", Path: path, Err: err} + } + dev := st.Dev + parent := filepath.Dir(path) + if err := unix.Lstat(parent, &st); err != nil { + return false, &os.PathError{Op: "stat", Path: parent, Err: err} + } + if dev != st.Dev { + // Device differs from that of parent, + // so definitely a mount point. + return true, nil + } + // NB: this does not detect bind mounts on Linux. + return false, nil +} + +func normalizePath(path string) (realPath string, err error) { + if realPath, err = filepath.Abs(path); err != nil { + return "", fmt.Errorf("unable to get absolute path for %q: %w", path, err) + } + if realPath, err = filepath.EvalSymlinks(realPath); err != nil { + return "", fmt.Errorf("failed to canonicalise path for %q: %w", path, err) + } + if _, err := os.Stat(realPath); err != nil { + return "", fmt.Errorf("failed to stat target of %q: %w", path, err) + } + return realPath, nil +} + +func mountedByMountinfo(path string) (bool, error) { + path, err := normalizePath(path) + if err != nil { + if errors.Is(err, unix.ENOENT) { + // treat ENOENT as "not mounted" + return false, nil + } + return false, err + } + entries, err := GetMounts(SingleEntryFilter(path)) + if err != nil { + return false, err + } + + return len(entries) > 0, nil +} diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo.go index 136b14167b24..fe828c8f583d 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo.go +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo.go @@ -1,6 +1,8 @@ package mountinfo -import "io" +import ( + "os" +) // GetMounts retrieves a list of mounts for the current running process, // with an optional filter applied (use nil for no filter). @@ -8,23 +10,17 @@ func GetMounts(f FilterFunc) ([]*Info, error) { return parseMountTable(f) } -// GetMountsFromReader retrieves a list of mounts from the -// reader provided, with an optional filter applied (use nil -// for no filter). This can be useful in tests or benchmarks -// that provide a fake mountinfo data. -func GetMountsFromReader(reader io.Reader, f FilterFunc) ([]*Info, error) { - return parseInfoFile(reader, f) -} - -// Mounted determines if a specified mountpoint has been mounted. -// On Linux it looks at /proc/self/mountinfo. -func Mounted(mountpoint string) (bool, error) { - entries, err := GetMounts(SingleEntryFilter(mountpoint)) - if err != nil { - return false, err +// Mounted determines if a specified path is a mount point. +// +// The argument must be an absolute path, with all symlinks resolved, and clean. +// One way to ensure it is to process the path using filepath.Abs followed by +// filepath.EvalSymlinks before calling this function. +func Mounted(path string) (bool, error) { + // root is always mounted + if path == string(os.PathSeparator) { + return true, nil } - - return len(entries) > 0, nil + return mounted(path) } // Info reveals information about a particular mounted filesystem. This @@ -50,18 +46,18 @@ type Info struct { // Mountpoint indicates the mount point relative to the process's root. Mountpoint string - // Opts represents mount-specific options. - Opts string + // Options represents mount-specific options. + Options string // Optional represents optional fields. Optional string - // Fstype indicates the type of filesystem, such as EXT3. - Fstype string + // FSType indicates the type of filesystem, such as EXT3. + FSType string // Source indicates filesystem specific information or "none". Source string - // VfsOpts represents per super block options. - VfsOpts string + // VFSOptions represents per super block options. + VFSOptions string } diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_freebsd.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go similarity index 73% rename from cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_freebsd.go rename to cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go index a7dbb1b46b74..b1c12d02b51e 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_freebsd.go +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go @@ -1,3 +1,5 @@ +// +build freebsd,cgo openbsd,cgo + package mountinfo /* @@ -33,7 +35,7 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) { var mountinfo Info var skip, stop bool mountinfo.Mountpoint = C.GoString(&entry.f_mntonname[0]) - mountinfo.Fstype = C.GoString(&entry.f_fstypename[0]) + mountinfo.FSType = C.GoString(&entry.f_fstypename[0]) mountinfo.Source = C.GoString(&entry.f_mntfromname[0]) if filter != nil { @@ -51,3 +53,15 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) { } return out, nil } + +func mounted(path string) (bool, error) { + // Fast path: compare st.st_dev fields. + // This should always work for FreeBSD and OpenBSD. + mounted, err := mountedByStat(path) + if err == nil { + return mounted, nil + } + + // Fallback to parsing mountinfo + return mountedByMountinfo(path) +} diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_filters.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_filters.go index 79502646597c..5869b2cee391 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_filters.go +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_filters.go @@ -6,16 +6,16 @@ import "strings" // used to filter out mountinfo entries we're not interested in, // and/or stop further processing if we found what we wanted. // -// It takes a pointer to the Info struct (not fully populated, -// currently only Mountpoint, Fstype, Source, and (on Linux) -// VfsOpts are filled in), and returns two booleans: +// It takes a pointer to the Info struct (fully populated with all available +// fields on the GOOS platform), and returns two booleans: // -// - skip: true if the entry should be skipped -// - stop: true if parsing should be stopped after the entry +// skip: true if the entry should be skipped; +// +// stop: true if parsing should be stopped after the entry. type FilterFunc func(*Info) (skip, stop bool) // PrefixFilter discards all entries whose mount points -// do not start with a specific prefix +// do not start with a specific prefix. func PrefixFilter(prefix string) FilterFunc { return func(m *Info) (bool, bool) { skip := !strings.HasPrefix(m.Mountpoint, prefix) @@ -23,7 +23,7 @@ func PrefixFilter(prefix string) FilterFunc { } } -// SingleEntryFilter looks for a specific entry +// SingleEntryFilter looks for a specific entry. func SingleEntryFilter(mp string) FilterFunc { return func(m *Info) (bool, bool) { if m.Mountpoint == mp { @@ -36,8 +36,8 @@ func SingleEntryFilter(mp string) FilterFunc { // ParentsFilter returns all entries whose mount points // can be parents of a path specified, discarding others. // -// For example, given `/var/lib/docker/something`, entries -// like `/var/lib/docker`, `/var` and `/` are returned. +// For example, given /var/lib/docker/something, entries +// like /var/lib/docker, /var and / are returned. func ParentsFilter(path string) FilterFunc { return func(m *Info) (bool, bool) { skip := !strings.HasPrefix(path, m.Mountpoint) @@ -45,12 +45,12 @@ func ParentsFilter(path string) FilterFunc { } } -// FstypeFilter returns all entries that match provided fstype(s). -func FstypeFilter(fstype ...string) FilterFunc { +// FSTypeFilter returns all entries that match provided fstype(s). +func FSTypeFilter(fstype ...string) FilterFunc { return func(m *Info) (bool, bool) { for _, t := range fstype { - if m.Fstype == t { - return false, false // don't skeep, keep going + if m.FSType == t { + return false, false // don't skip, keep going } } return true, false // skip, keep going diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go index 2d630c8dc589..e591c8365389 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go @@ -1,5 +1,3 @@ -// +build go1.13 - package mountinfo import ( @@ -11,14 +9,18 @@ import ( "strings" ) -func parseInfoFile(r io.Reader, filter FilterFunc) ([]*Info, error) { +// GetMountsFromReader retrieves a list of mounts from the +// reader provided, with an optional filter applied (use nil +// for no filter). This can be useful in tests or benchmarks +// that provide a fake mountinfo data. +// +// This function is Linux-specific. +func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) { s := bufio.NewScanner(r) out := []*Info{} - var err error for s.Scan() { - if err = s.Err(); err != nil { - return nil, err - } + var err error + /* See http://man7.org/linux/man-pages/man5/proc.5.html @@ -70,26 +72,19 @@ func parseInfoFile(r io.Reader, filter FilterFunc) ([]*Info, error) { p := &Info{} - // Fill in the fields that a filter might check - p.Mountpoint, err = strconv.Unquote(`"` + fields[4] + `"`) + p.Mountpoint, err = unescape(fields[4]) if err != nil { - return nil, fmt.Errorf("Parsing '%s' failed: unable to unquote mount point field: %w", fields[4], err) + return nil, fmt.Errorf("Parsing '%s' failed: mount point: %w", fields[4], err) } - p.Fstype = fields[sepIdx+1] - p.Source = fields[sepIdx+2] - p.VfsOpts = fields[sepIdx+3] - - // Run a filter soon so we can skip parsing/adding entries - // the caller is not interested in - var skip, stop bool - if filter != nil { - skip, stop = filter(p) - if skip { - continue - } + p.FSType, err = unescape(fields[sepIdx+1]) + if err != nil { + return nil, fmt.Errorf("Parsing '%s' failed: fstype: %w", fields[sepIdx+1], err) } - - // Fill in the rest of the fields + p.Source, err = unescape(fields[sepIdx+2]) + if err != nil { + return nil, fmt.Errorf("Parsing '%s' failed: source: %w", fields[sepIdx+2], err) + } + p.VFSOptions = fields[sepIdx+3] // ignore any numbers parsing errors, as there should not be any p.ID, _ = strconv.Atoi(fields[0]) @@ -101,12 +96,12 @@ func parseInfoFile(r io.Reader, filter FilterFunc) ([]*Info, error) { p.Major, _ = strconv.Atoi(mm[0]) p.Minor, _ = strconv.Atoi(mm[1]) - p.Root, err = strconv.Unquote(`"` + fields[3] + `"`) + p.Root, err = unescape(fields[3]) if err != nil { - return nil, fmt.Errorf("Parsing '%s' failed: unable to unquote root field: %w", fields[3], err) + return nil, fmt.Errorf("Parsing '%s' failed: root: %w", fields[3], err) } - p.Opts = fields[5] + p.Options = fields[5] // zero or more optional fields switch { @@ -118,11 +113,23 @@ func parseInfoFile(r io.Reader, filter FilterFunc) ([]*Info, error) { p.Optional = strings.Join(fields[6:sepIdx-1], " ") } + // Run the filter after parsing all of the fields. + var skip, stop bool + if filter != nil { + skip, stop = filter(p) + if skip { + continue + } + } + out = append(out, p) if stop { break } } + if err := s.Err(); err != nil { + return nil, err + } return out, nil } @@ -135,12 +142,17 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) { } defer f.Close() - return parseInfoFile(f, filter) + return GetMountsFromReader(f, filter) } -// PidMountInfo collects the mounts for a specific process ID. If the process -// ID is unknown, it is better to use `GetMounts` which will inspect -// "/proc/self/mountinfo" instead. +// PidMountInfo retrieves the list of mounts from a given process' mount +// namespace. Unless there is a need to get mounts from a mount namespace +// different from that of a calling process, use GetMounts. +// +// This function is Linux-specific. +// +// Deprecated: this will be removed before v1; use GetMountsFromReader with +// opened /proc//mountinfo as an argument instead. func PidMountInfo(pid int) ([]*Info, error) { f, err := os.Open(fmt.Sprintf("/proc/%d/mountinfo", pid)) if err != nil { @@ -148,5 +160,63 @@ func PidMountInfo(pid int) ([]*Info, error) { } defer f.Close() - return parseInfoFile(f, nil) + return GetMountsFromReader(f, nil) +} + +// A few specific characters in mountinfo path entries (root and mountpoint) +// are escaped using a backslash followed by a character's ascii code in octal. +// +// space -- as \040 +// tab (aka \t) -- as \011 +// newline (aka \n) -- as \012 +// backslash (aka \\) -- as \134 +// +// This function converts path from mountinfo back, i.e. it unescapes the above sequences. +func unescape(path string) (string, error) { + // try to avoid copying + if strings.IndexByte(path, '\\') == -1 { + return path, nil + } + + // The following code is UTF-8 transparent as it only looks for some + // specific characters (backslash and 0..7) with values < utf8.RuneSelf, + // and everything else is passed through as is. + buf := make([]byte, len(path)) + bufLen := 0 + for i := 0; i < len(path); i++ { + if path[i] != '\\' { + buf[bufLen] = path[i] + bufLen++ + continue + } + s := path[i:] + if len(s) < 4 { + // too short + return "", fmt.Errorf("bad escape sequence %q: too short", s) + } + c := s[1] + switch c { + case '0', '1', '2', '3', '4', '5', '6', '7': + v := c - '0' + for j := 2; j < 4; j++ { // one digit already; two more + if s[j] < '0' || s[j] > '7' { + return "", fmt.Errorf("bad escape sequence %q: not a digit", s[:3]) + } + x := s[j] - '0' + v = (v << 3) | x + } + if v > 255 { + return "", fmt.Errorf("bad escape sequence %q: out of range" + s[:3]) + } + buf[bufLen] = v + bufLen++ + i += 3 + continue + default: + return "", fmt.Errorf("bad escape sequence %q: not a digit" + s[:3]) + + } + } + + return string(buf[:bufLen]), nil } diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go index dc1869211895..d33ebca09688 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go @@ -1,17 +1,18 @@ -// +build !windows,!linux,!freebsd freebsd,!cgo +// +build !windows,!linux,!freebsd,!openbsd freebsd,!cgo openbsd,!cgo package mountinfo import ( "fmt" - "io" "runtime" ) +var errNotImplemented = fmt.Errorf("not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) + func parseMountTable(_ FilterFunc) ([]*Info, error) { - return nil, fmt.Errorf("mount.parseMountTable is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) + return nil, errNotImplemented } -func parseInfoFile(_ io.Reader, f FilterFunc) ([]*Info, error) { - return parseMountTable(f) +func mounted(path string) (bool, error) { + return false, errNotImplemented } diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_windows.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_windows.go index 69ffdc52b6b6..13fad165e5d3 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_windows.go +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_windows.go @@ -1,12 +1,10 @@ package mountinfo -import "io" - func parseMountTable(_ FilterFunc) ([]*Info, error) { // Do NOT return an error! return nil, nil } -func parseInfoFile(_ io.Reader, f FilterFunc) ([]*Info, error) { - return parseMountTable(f) +func mounted(_ string) (bool, error) { + return false, nil } diff --git a/cluster-autoscaler/vendor/github.com/moby/term/.gitignore b/cluster-autoscaler/vendor/github.com/moby/term/.gitignore new file mode 100644 index 000000000000..b0747ff010a7 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/term/.gitignore @@ -0,0 +1,8 @@ +# if you want to ignore files created by your editor/tools, consider using a +# global .gitignore or .git/info/exclude see https://help.github.com/articles/ignoring-files +.* +!.github +!.gitignore +profile.out +# support running go modules in vendor mode for local development +vendor/ diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/LICENSE b/cluster-autoscaler/vendor/github.com/moby/term/LICENSE similarity index 93% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/LICENSE rename to cluster-autoscaler/vendor/github.com/moby/term/LICENSE index 047555ec7e58..6d8d58fb676b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/LICENSE +++ b/cluster-autoscaler/vendor/github.com/moby/term/LICENSE @@ -1,7 +1,7 @@ Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -176,24 +176,13 @@ END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020 Microsoft Corporation + Copyright 2013-2018 Docker, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/cluster-autoscaler/vendor/github.com/moby/term/README.md b/cluster-autoscaler/vendor/github.com/moby/term/README.md new file mode 100644 index 000000000000..0ce92cc33980 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/term/README.md @@ -0,0 +1,36 @@ +# term - utilities for dealing with terminals + +![Test](https://github.com/moby/term/workflows/Test/badge.svg) [![GoDoc](https://godoc.org/github.com/moby/term?status.svg)](https://godoc.org/github.com/moby/term) [![Go Report Card](https://goreportcard.com/badge/github.com/moby/term)](https://goreportcard.com/report/github.com/moby/term) + +term provides structures and helper functions to work with terminal (state, sizes). + +#### Using term + +```go +package main + +import ( + "log" + "os" + + "github.com/moby/term" +) + +func main() { + fd := os.Stdin.Fd() + if term.IsTerminal(fd) { + ws, err := term.GetWinsize(fd) + if err != nil { + log.Fatalf("term.GetWinsize: %s", err) + } + log.Printf("%d:%d\n", ws.Height, ws.Width) + } +} +``` + +## Contributing + +Want to hack on term? [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) apply. + +## Copyright and license +Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons. diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/ascii.go b/cluster-autoscaler/vendor/github.com/moby/term/ascii.go similarity index 94% rename from cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/ascii.go rename to cluster-autoscaler/vendor/github.com/moby/term/ascii.go index 87bca8d4acdb..55873c0556c9 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/ascii.go +++ b/cluster-autoscaler/vendor/github.com/moby/term/ascii.go @@ -1,4 +1,4 @@ -package term // import "github.com/docker/docker/pkg/term" +package term import ( "fmt" diff --git a/cluster-autoscaler/vendor/github.com/moby/term/go.mod b/cluster-autoscaler/vendor/github.com/moby/term/go.mod new file mode 100644 index 000000000000..f453204333a8 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/term/go.mod @@ -0,0 +1,12 @@ +module github.com/moby/term + +go 1.13 + +require ( + github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 + github.com/creack/pty v1.1.11 + github.com/google/go-cmp v0.4.0 + github.com/pkg/errors v0.9.1 // indirect + golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a + gotest.tools/v3 v3.0.2 +) diff --git a/cluster-autoscaler/vendor/github.com/moby/term/go.sum b/cluster-autoscaler/vendor/github.com/moby/term/go.sum new file mode 100644 index 000000000000..441e06137acd --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/term/go.sum @@ -0,0 +1,23 @@ +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a h1:i47hUS795cOydZI4AwJQCKXOr4BvxzvikwDoDtHhP2Y= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= diff --git a/cluster-autoscaler/vendor/github.com/moby/term/proxy.go b/cluster-autoscaler/vendor/github.com/moby/term/proxy.go new file mode 100644 index 000000000000..c47756b89a9c --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/term/proxy.go @@ -0,0 +1,88 @@ +package term + +import ( + "io" +) + +// EscapeError is special error which returned by a TTY proxy reader's Read() +// method in case its detach escape sequence is read. +type EscapeError struct{} + +func (EscapeError) Error() string { + return "read escape sequence" +} + +// escapeProxy is used only for attaches with a TTY. It is used to proxy +// stdin keypresses from the underlying reader and look for the passed in +// escape key sequence to signal a detach. +type escapeProxy struct { + escapeKeys []byte + escapeKeyPos int + r io.Reader + buf []byte +} + +// NewEscapeProxy returns a new TTY proxy reader which wraps the given reader +// and detects when the specified escape keys are read, in which case the Read +// method will return an error of type EscapeError. +func NewEscapeProxy(r io.Reader, escapeKeys []byte) io.Reader { + return &escapeProxy{ + escapeKeys: escapeKeys, + r: r, + } +} + +func (r *escapeProxy) Read(buf []byte) (n int, err error) { + if len(r.escapeKeys) > 0 && r.escapeKeyPos == len(r.escapeKeys) { + return 0, EscapeError{} + } + + if len(r.buf) > 0 { + n = copy(buf, r.buf) + r.buf = r.buf[n:] + } + + nr, err := r.r.Read(buf[n:]) + n += nr + if len(r.escapeKeys) == 0 { + return n, err + } + + for i := 0; i < n; i++ { + if buf[i] == r.escapeKeys[r.escapeKeyPos] { + r.escapeKeyPos++ + + // Check if the full escape sequence is matched. + if r.escapeKeyPos == len(r.escapeKeys) { + n = i + 1 - r.escapeKeyPos + if n < 0 { + n = 0 + } + return n, EscapeError{} + } + continue + } + + // If we need to prepend a partial escape sequence from the previous + // read, make sure the new buffer size doesn't exceed len(buf). + // Otherwise, preserve any extra data in a buffer for the next read. + if i < r.escapeKeyPos { + preserve := make([]byte, 0, r.escapeKeyPos+n) + preserve = append(preserve, r.escapeKeys[:r.escapeKeyPos]...) + preserve = append(preserve, buf[:n]...) + n = copy(buf, preserve) + i += r.escapeKeyPos + r.buf = append(r.buf, preserve[n:]...) + } + r.escapeKeyPos = 0 + } + + // If we're in the middle of reading an escape sequence, make sure we don't + // let the caller read it. If later on we find that this is not the escape + // sequence, we'll prepend it back to buf. + n -= r.escapeKeyPos + if n < 0 { + n = 0 + } + return n, err +} diff --git a/cluster-autoscaler/vendor/github.com/moby/term/tc.go b/cluster-autoscaler/vendor/github.com/moby/term/tc.go new file mode 100644 index 000000000000..65556027a6d3 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/term/tc.go @@ -0,0 +1,19 @@ +// +build !windows + +package term + +import ( + "golang.org/x/sys/unix" +) + +func tcget(fd uintptr) (*Termios, error) { + p, err := unix.IoctlGetTermios(int(fd), getTermios) + if err != nil { + return nil, err + } + return p, nil +} + +func tcset(fd uintptr, p *Termios) error { + return unix.IoctlSetTermios(int(fd), setTermios, p) +} diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/term.go b/cluster-autoscaler/vendor/github.com/moby/term/term.go similarity index 89% rename from cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/term.go rename to cluster-autoscaler/vendor/github.com/moby/term/term.go index 0589a955194b..29c6acf1c7ef 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/term.go +++ b/cluster-autoscaler/vendor/github.com/moby/term/term.go @@ -2,7 +2,7 @@ // Package term provides structures and helper functions to work with // terminal (state, sizes). -package term // import "github.com/docker/docker/pkg/term" +package term import ( "errors" @@ -50,8 +50,8 @@ func GetFdInfo(in interface{}) (uintptr, bool) { // IsTerminal returns true if the given file descriptor is a terminal. func IsTerminal(fd uintptr) bool { - var termios Termios - return tcget(fd, &termios) == 0 + _, err := tcget(fd) + return err == nil } // RestoreTerminal restores the terminal connected to the given file descriptor @@ -60,20 +60,16 @@ func RestoreTerminal(fd uintptr, state *State) error { if state == nil { return ErrInvalidState } - if err := tcset(fd, &state.termios); err != 0 { - return err - } - return nil + return tcset(fd, &state.termios) } // SaveState saves the state of the terminal connected to the given file descriptor. func SaveState(fd uintptr) (*State, error) { - var oldState State - if err := tcget(fd, &oldState.termios); err != 0 { + termios, err := tcget(fd) + if err != nil { return nil, err } - - return &oldState, nil + return &State{termios: *termios}, nil } // DisableEcho applies the specified state to the terminal connected to the file @@ -82,7 +78,7 @@ func DisableEcho(fd uintptr, state *State) error { newState := state.termios newState.Lflag &^= unix.ECHO - if err := tcset(fd, &newState); err != 0 { + if err := tcset(fd, &newState); err != nil { return err } handleInterrupt(fd, state) diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/term_windows.go b/cluster-autoscaler/vendor/github.com/moby/term/term_windows.go similarity index 67% rename from cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/term_windows.go rename to cluster-autoscaler/vendor/github.com/moby/term/term_windows.go index a3c3db131574..ba82960d4a6d 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/term_windows.go +++ b/cluster-autoscaler/vendor/github.com/moby/term/term_windows.go @@ -1,13 +1,12 @@ -package term // import "github.com/docker/docker/pkg/term" +package term import ( "io" "os" "os/signal" - "syscall" // used for STD_INPUT_HANDLE, STD_OUTPUT_HANDLE and STD_ERROR_HANDLE - "github.com/Azure/go-ansiterm/winterm" - "github.com/docker/docker/pkg/term/windows" + windowsconsole "github.com/moby/term/windows" + "golang.org/x/sys/windows" ) // State holds the console mode for the terminal. @@ -28,37 +27,42 @@ var vtInputSupported bool func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) { // Turn on VT handling on all std handles, if possible. This might // fail, in which case we will fall back to terminal emulation. - var emulateStdin, emulateStdout, emulateStderr bool - fd := os.Stdin.Fd() - if mode, err := winterm.GetConsoleMode(fd); err == nil { + var ( + emulateStdin, emulateStdout, emulateStderr bool + + mode uint32 + ) + + fd := windows.Handle(os.Stdin.Fd()) + if err := windows.GetConsoleMode(fd, &mode); err == nil { // Validate that winterm.ENABLE_VIRTUAL_TERMINAL_INPUT is supported, but do not set it. - if err = winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_INPUT); err != nil { + if err = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_INPUT); err != nil { emulateStdin = true } else { vtInputSupported = true } // Unconditionally set the console mode back even on failure because SetConsoleMode // remembers invalid bits on input handles. - winterm.SetConsoleMode(fd, mode) + _ = windows.SetConsoleMode(fd, mode) } - fd = os.Stdout.Fd() - if mode, err := winterm.GetConsoleMode(fd); err == nil { + fd = windows.Handle(os.Stdout.Fd()) + if err := windows.GetConsoleMode(fd, &mode); err == nil { // Validate winterm.DISABLE_NEWLINE_AUTO_RETURN is supported, but do not set it. - if err = winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_PROCESSING|winterm.DISABLE_NEWLINE_AUTO_RETURN); err != nil { + if err = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING|windows.DISABLE_NEWLINE_AUTO_RETURN); err != nil { emulateStdout = true } else { - winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_PROCESSING) + _ = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING) } } - fd = os.Stderr.Fd() - if mode, err := winterm.GetConsoleMode(fd); err == nil { + fd = windows.Handle(os.Stderr.Fd()) + if err := windows.GetConsoleMode(fd, &mode); err == nil { // Validate winterm.DISABLE_NEWLINE_AUTO_RETURN is supported, but do not set it. - if err = winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_PROCESSING|winterm.DISABLE_NEWLINE_AUTO_RETURN); err != nil { + if err = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING|windows.DISABLE_NEWLINE_AUTO_RETURN); err != nil { emulateStderr = true } else { - winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_PROCESSING) + _ = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING) } } @@ -67,19 +71,22 @@ func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) { // go-ansiterm hasn't switch to x/sys/windows. // TODO: switch back to x/sys/windows once go-ansiterm has switched if emulateStdin { - stdIn = windowsconsole.NewAnsiReader(syscall.STD_INPUT_HANDLE) + h := uint32(windows.STD_INPUT_HANDLE) + stdIn = windowsconsole.NewAnsiReader(int(h)) } else { stdIn = os.Stdin } if emulateStdout { - stdOut = windowsconsole.NewAnsiWriter(syscall.STD_OUTPUT_HANDLE) + h := uint32(windows.STD_OUTPUT_HANDLE) + stdOut = windowsconsole.NewAnsiWriter(int(h)) } else { stdOut = os.Stdout } if emulateStderr { - stdErr = windowsconsole.NewAnsiWriter(syscall.STD_ERROR_HANDLE) + h := uint32(windows.STD_ERROR_HANDLE) + stdErr = windowsconsole.NewAnsiWriter(int(h)) } else { stdErr = os.Stderr } @@ -94,8 +101,8 @@ func GetFdInfo(in interface{}) (uintptr, bool) { // GetWinsize returns the window size based on the specified file descriptor. func GetWinsize(fd uintptr) (*Winsize, error) { - info, err := winterm.GetConsoleScreenBufferInfo(fd) - if err != nil { + var info windows.ConsoleScreenBufferInfo + if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil { return nil, err } @@ -109,20 +116,23 @@ func GetWinsize(fd uintptr) (*Winsize, error) { // IsTerminal returns true if the given file descriptor is a terminal. func IsTerminal(fd uintptr) bool { - return windowsconsole.IsConsole(fd) + var mode uint32 + err := windows.GetConsoleMode(windows.Handle(fd), &mode) + return err == nil } // RestoreTerminal restores the terminal connected to the given file descriptor // to a previous state. func RestoreTerminal(fd uintptr, state *State) error { - return winterm.SetConsoleMode(fd, state.mode) + return windows.SetConsoleMode(windows.Handle(fd), state.mode) } // SaveState saves the state of the terminal connected to the given file descriptor. func SaveState(fd uintptr) (*State, error) { - mode, e := winterm.GetConsoleMode(fd) - if e != nil { - return nil, e + var mode uint32 + + if err := windows.GetConsoleMode(windows.Handle(fd), &mode); err != nil { + return nil, err } return &State{mode: mode}, nil @@ -132,9 +142,9 @@ func SaveState(fd uintptr) (*State, error) { // -- See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx func DisableEcho(fd uintptr, state *State) error { mode := state.mode - mode &^= winterm.ENABLE_ECHO_INPUT - mode |= winterm.ENABLE_PROCESSED_INPUT | winterm.ENABLE_LINE_INPUT - err := winterm.SetConsoleMode(fd, mode) + mode &^= windows.ENABLE_ECHO_INPUT + mode |= windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT + err := windows.SetConsoleMode(windows.Handle(fd), mode) if err != nil { return err } @@ -169,7 +179,7 @@ func SetRawTerminalOutput(fd uintptr) (*State, error) { // Ignore failures, since winterm.DISABLE_NEWLINE_AUTO_RETURN might not be supported on this // version of Windows. - winterm.SetConsoleMode(fd, state.mode|winterm.DISABLE_NEWLINE_AUTO_RETURN) + _ = windows.SetConsoleMode(windows.Handle(fd), state.mode|windows.DISABLE_NEWLINE_AUTO_RETURN) return state, err } @@ -188,21 +198,21 @@ func MakeRaw(fd uintptr) (*State, error) { // -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx // Disable these modes - mode &^= winterm.ENABLE_ECHO_INPUT - mode &^= winterm.ENABLE_LINE_INPUT - mode &^= winterm.ENABLE_MOUSE_INPUT - mode &^= winterm.ENABLE_WINDOW_INPUT - mode &^= winterm.ENABLE_PROCESSED_INPUT + mode &^= windows.ENABLE_ECHO_INPUT + mode &^= windows.ENABLE_LINE_INPUT + mode &^= windows.ENABLE_MOUSE_INPUT + mode &^= windows.ENABLE_WINDOW_INPUT + mode &^= windows.ENABLE_PROCESSED_INPUT // Enable these modes - mode |= winterm.ENABLE_EXTENDED_FLAGS - mode |= winterm.ENABLE_INSERT_MODE - mode |= winterm.ENABLE_QUICK_EDIT_MODE + mode |= windows.ENABLE_EXTENDED_FLAGS + mode |= windows.ENABLE_INSERT_MODE + mode |= windows.ENABLE_QUICK_EDIT_MODE if vtInputSupported { - mode |= winterm.ENABLE_VIRTUAL_TERMINAL_INPUT + mode |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT } - err = winterm.SetConsoleMode(fd, mode) + err = windows.SetConsoleMode(windows.Handle(fd), mode) if err != nil { return nil, err } @@ -215,7 +225,7 @@ func restoreAtInterrupt(fd uintptr, state *State) { go func() { _ = <-sigchan - RestoreTerminal(fd, state) + _ = RestoreTerminal(fd, state) os.Exit(0) }() } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/termios_linux.go b/cluster-autoscaler/vendor/github.com/moby/term/termios.go similarity index 61% rename from cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/termios_linux.go rename to cluster-autoscaler/vendor/github.com/moby/term/termios.go index 6d4c63fdb75e..0f028e2273ac 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/termios_linux.go +++ b/cluster-autoscaler/vendor/github.com/moby/term/termios.go @@ -1,28 +1,24 @@ -package term // import "github.com/docker/docker/pkg/term" +// +build !windows + +package term import ( "golang.org/x/sys/unix" ) -const ( - getTermios = unix.TCGETS - setTermios = unix.TCSETS -) - // Termios is the Unix API for terminal I/O. -type Termios unix.Termios +type Termios = unix.Termios -// MakeRaw put the terminal connected to the given file descriptor into raw +// MakeRaw puts the terminal connected to the given file descriptor into raw // mode and returns the previous state of the terminal so that it can be // restored. func MakeRaw(fd uintptr) (*State, error) { - termios, err := unix.IoctlGetTermios(int(fd), getTermios) + termios, err := tcget(fd) if err != nil { return nil, err } - var oldState State - oldState.termios = Termios(*termios) + oldState := State{termios: *termios} termios.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON) termios.Oflag &^= unix.OPOST @@ -32,7 +28,7 @@ func MakeRaw(fd uintptr) (*State, error) { termios.Cc[unix.VMIN] = 1 termios.Cc[unix.VTIME] = 0 - if err := unix.IoctlSetTermios(int(fd), setTermios, termios); err != nil { + if err := tcset(fd, termios); err != nil { return nil, err } return &oldState, nil diff --git a/cluster-autoscaler/vendor/github.com/moby/term/termios_bsd.go b/cluster-autoscaler/vendor/github.com/moby/term/termios_bsd.go new file mode 100644 index 000000000000..922dd4baab04 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/term/termios_bsd.go @@ -0,0 +1,12 @@ +// +build darwin freebsd openbsd netbsd + +package term + +import ( + "golang.org/x/sys/unix" +) + +const ( + getTermios = unix.TIOCGETA + setTermios = unix.TIOCSETA +) diff --git a/cluster-autoscaler/vendor/github.com/moby/term/termios_nonbsd.go b/cluster-autoscaler/vendor/github.com/moby/term/termios_nonbsd.go new file mode 100644 index 000000000000..038fd61ba1eb --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/term/termios_nonbsd.go @@ -0,0 +1,12 @@ +//+build !darwin,!freebsd,!netbsd,!openbsd,!windows + +package term + +import ( + "golang.org/x/sys/unix" +) + +const ( + getTermios = unix.TCGETS + setTermios = unix.TCSETS +) diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/ansi_reader.go b/cluster-autoscaler/vendor/github.com/moby/term/windows/ansi_reader.go similarity index 87% rename from cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/ansi_reader.go rename to cluster-autoscaler/vendor/github.com/moby/term/windows/ansi_reader.go index 1d7c452cc845..155251521b09 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/ansi_reader.go +++ b/cluster-autoscaler/vendor/github.com/moby/term/windows/ansi_reader.go @@ -1,6 +1,6 @@ // +build windows -package windowsconsole // import "github.com/docker/docker/pkg/term/windows" +package windowsconsole import ( "bytes" @@ -31,7 +31,6 @@ type ansiReader struct { // NewAnsiReader returns an io.ReadCloser that provides VT100 terminal emulation on top of a // Windows console input handle. func NewAnsiReader(nFile int) io.ReadCloser { - initLogger() file, fd := winterm.GetStdFile(nFile) return &ansiReader{ file: file, @@ -59,8 +58,6 @@ func (ar *ansiReader) Read(p []byte) (int, error) { // Previously read bytes exist, read as much as we can and return if len(ar.buffer) > 0 { - logger.Debugf("Reading previously cached bytes") - originalLength := len(ar.buffer) copiedLength := copy(p, ar.buffer) @@ -70,16 +67,14 @@ func (ar *ansiReader) Read(p []byte) (int, error) { ar.buffer = ar.buffer[copiedLength:] } - logger.Debugf("Read from cache p[%d]: % x", copiedLength, p) return copiedLength, nil } // Read and translate key events - events, err := readInputEvents(ar.fd, len(p)) + events, err := readInputEvents(ar, len(p)) if err != nil { return 0, err } else if len(events) == 0 { - logger.Debug("No input events detected") return 0, nil } @@ -87,11 +82,9 @@ func (ar *ansiReader) Read(p []byte) (int, error) { // Save excess bytes and right-size keyBytes if len(keyBytes) > len(p) { - logger.Debugf("Received %d keyBytes, only room for %d bytes", len(keyBytes), len(p)) ar.buffer = keyBytes[len(p):] keyBytes = keyBytes[:len(p)] } else if len(keyBytes) == 0 { - logger.Debug("No key bytes returned from the translator") return 0, nil } @@ -100,13 +93,11 @@ func (ar *ansiReader) Read(p []byte) (int, error) { return 0, errors.New("unexpected copy length encountered") } - logger.Debugf("Read p[%d]: % x", copiedLength, p) - logger.Debugf("Read keyBytes[%d]: % x", copiedLength, keyBytes) return copiedLength, nil } // readInputEvents polls until at least one event is available. -func readInputEvents(fd uintptr, maxBytes int) ([]winterm.INPUT_RECORD, error) { +func readInputEvents(ar *ansiReader, maxBytes int) ([]winterm.INPUT_RECORD, error) { // Determine the maximum number of records to retrieve // -- Cast around the type system to obtain the size of a single INPUT_RECORD. // unsafe.Sizeof requires an expression vs. a type-reference; the casting @@ -118,25 +109,23 @@ func readInputEvents(fd uintptr, maxBytes int) ([]winterm.INPUT_RECORD, error) { } else if countRecords == 0 { countRecords = 1 } - logger.Debugf("[windows] readInputEvents: Reading %v records (buffer size %v, record size %v)", countRecords, maxBytes, recordSize) // Wait for and read input events events := make([]winterm.INPUT_RECORD, countRecords) nEvents := uint32(0) - eventsExist, err := winterm.WaitForSingleObject(fd, winterm.WAIT_INFINITE) + eventsExist, err := winterm.WaitForSingleObject(ar.fd, winterm.WAIT_INFINITE) if err != nil { return nil, err } if eventsExist { - err = winterm.ReadConsoleInput(fd, events, &nEvents) + err = winterm.ReadConsoleInput(ar.fd, events, &nEvents) if err != nil { return nil, err } } // Return a slice restricted to the number of returned records - logger.Debugf("[windows] readInputEvents: Read %v events", nEvents) return events[:nEvents], nil } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/ansi_writer.go b/cluster-autoscaler/vendor/github.com/moby/term/windows/ansi_writer.go similarity index 79% rename from cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/ansi_writer.go rename to cluster-autoscaler/vendor/github.com/moby/term/windows/ansi_writer.go index 7799a03fc59e..ccb5ef07757f 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/ansi_writer.go +++ b/cluster-autoscaler/vendor/github.com/moby/term/windows/ansi_writer.go @@ -1,6 +1,6 @@ // +build windows -package windowsconsole // import "github.com/docker/docker/pkg/term/windows" +package windowsconsole import ( "io" @@ -24,7 +24,6 @@ type ansiWriter struct { // NewAnsiWriter returns an io.Writer that provides VT100 terminal emulation on top of a // Windows console output handle. func NewAnsiWriter(nFile int) io.Writer { - initLogger() file, fd := winterm.GetStdFile(nFile) info, err := winterm.GetConsoleScreenBufferInfo(fd) if err != nil { @@ -32,9 +31,8 @@ func NewAnsiWriter(nFile int) io.Writer { } parser := ansiterm.CreateParser("Ground", winterm.CreateWinEventHandler(fd, file)) - logger.Infof("newAnsiWriter: parser %p", parser) - aw := &ansiWriter{ + return &ansiWriter{ file: file, fd: fd, infoReset: info, @@ -42,10 +40,6 @@ func NewAnsiWriter(nFile int) io.Writer { escapeSequence: []byte(ansiterm.KEY_ESC_CSI), parser: parser, } - - logger.Infof("newAnsiWriter: aw.parser %p", aw.parser) - logger.Infof("newAnsiWriter: %v", aw) - return aw } func (aw *ansiWriter) Fd() uintptr { @@ -58,7 +52,5 @@ func (aw *ansiWriter) Write(p []byte) (total int, err error) { return 0, nil } - logger.Infof("Write: % x", p) - logger.Infof("Write: %s", string(p)) return aw.parser.Parse(p) } diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/console.go b/cluster-autoscaler/vendor/github.com/moby/term/windows/console.go similarity index 64% rename from cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/console.go rename to cluster-autoscaler/vendor/github.com/moby/term/windows/console.go index 527401975805..993694ddcd99 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/windows/console.go +++ b/cluster-autoscaler/vendor/github.com/moby/term/windows/console.go @@ -1,11 +1,11 @@ // +build windows -package windowsconsole // import "github.com/docker/docker/pkg/term/windows" +package windowsconsole import ( "os" - "github.com/Azure/go-ansiterm/winterm" + "golang.org/x/sys/windows" ) // GetHandleInfo returns file descriptor and bool indicating whether the file is a console. @@ -22,14 +22,18 @@ func GetHandleInfo(in interface{}) (uintptr, bool) { if file, ok := in.(*os.File); ok { inFd = file.Fd() - isTerminal = IsConsole(inFd) + isTerminal = isConsole(inFd) } return inFd, isTerminal } // IsConsole returns true if the given file descriptor is a Windows Console. // The code assumes that GetConsoleMode will return an error for file descriptors that are not a console. -func IsConsole(fd uintptr) bool { - _, e := winterm.GetConsoleMode(fd) - return e == nil +// Deprecated: use golang.org/x/sys/windows.GetConsoleMode() or golang.org/x/term.IsTerminal() +var IsConsole = isConsole + +func isConsole(fd uintptr) bool { + var mode uint32 + err := windows.GetConsoleMode(windows.Handle(fd), &mode) + return err == nil } diff --git a/cluster-autoscaler/vendor/github.com/moby/term/windows/doc.go b/cluster-autoscaler/vendor/github.com/moby/term/windows/doc.go new file mode 100644 index 000000000000..54265fffaffd --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/moby/term/windows/doc.go @@ -0,0 +1,5 @@ +// These files implement ANSI-aware input and output streams for use by the Docker Windows client. +// When asked for the set of standard streams (e.g., stdin, stdout, stderr), the code will create +// and return pseudo-streams that convert ANSI sequences to / from Windows Console API calls. + +package windowsconsole diff --git a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/winsize.go b/cluster-autoscaler/vendor/github.com/moby/term/winsize.go similarity index 91% rename from cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/winsize.go rename to cluster-autoscaler/vendor/github.com/moby/term/winsize.go index a19663ad834b..1ef98d59961e 100644 --- a/cluster-autoscaler/vendor/github.com/docker/docker/pkg/term/winsize.go +++ b/cluster-autoscaler/vendor/github.com/moby/term/winsize.go @@ -1,6 +1,6 @@ // +build !windows -package term // import "github.com/docker/docker/pkg/term" +package term import ( "golang.org/x/sys/unix" diff --git a/cluster-autoscaler/vendor/github.com/mrunalp/fileutils/fileutils.go b/cluster-autoscaler/vendor/github.com/mrunalp/fileutils/fileutils.go index 136bbd9fb241..7421e6207f6b 100644 --- a/cluster-autoscaler/vendor/github.com/mrunalp/fileutils/fileutils.go +++ b/cluster-autoscaler/vendor/github.com/mrunalp/fileutils/fileutils.go @@ -22,7 +22,7 @@ func CopyFile(source string, dest string) error { uid := int(st.Uid) gid := int(st.Gid) - modeType := si.Mode()&os.ModeType + modeType := si.Mode() & os.ModeType // Handle symlinks if modeType == os.ModeSymlink { @@ -52,19 +52,7 @@ func CopyFile(source string, dest string) error { // Handle regular files if si.Mode().IsRegular() { - sf, err := os.Open(source) - if err != nil { - return err - } - defer sf.Close() - - df, err := os.Create(dest) - if err != nil { - return err - } - defer df.Close() - - _, err = io.Copy(df, sf) + err = copyInternal(source, dest) if err != nil { return err } @@ -85,6 +73,28 @@ func CopyFile(source string, dest string) error { return nil } +func copyInternal(source, dest string) (retErr error) { + sf, err := os.Open(source) + if err != nil { + return err + } + defer sf.Close() + + df, err := os.Create(dest) + if err != nil { + return err + } + defer func() { + err := df.Close() + if retErr == nil { + retErr = err + } + }() + + _, err = io.Copy(df, sf) + return err +} + // CopyDirectory copies the files under the source directory // to dest directory. The dest directory is created if it // does not exist. diff --git a/cluster-autoscaler/vendor/github.com/mrunalp/fileutils/go.mod b/cluster-autoscaler/vendor/github.com/mrunalp/fileutils/go.mod new file mode 100644 index 000000000000..d8971cabc469 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/mrunalp/fileutils/go.mod @@ -0,0 +1,3 @@ +module github.com/mrunalp/fileutils + +go 1.13 diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/README.md b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/README.md index 6803ef56c5ba..8b25d5c1c014 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/README.md +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/README.md @@ -60,87 +60,87 @@ defaultMountFlags := unix.MS_NOEXEC | unix.MS_NOSUID | unix.MS_NODEV config := &configs.Config{ Rootfs: "/your/path/to/rootfs", Capabilities: &configs.Capabilities{ - Bounding: []string{ - "CAP_CHOWN", - "CAP_DAC_OVERRIDE", - "CAP_FSETID", - "CAP_FOWNER", - "CAP_MKNOD", - "CAP_NET_RAW", - "CAP_SETGID", - "CAP_SETUID", - "CAP_SETFCAP", - "CAP_SETPCAP", - "CAP_NET_BIND_SERVICE", - "CAP_SYS_CHROOT", - "CAP_KILL", - "CAP_AUDIT_WRITE", - }, - Effective: []string{ - "CAP_CHOWN", - "CAP_DAC_OVERRIDE", - "CAP_FSETID", - "CAP_FOWNER", - "CAP_MKNOD", - "CAP_NET_RAW", - "CAP_SETGID", - "CAP_SETUID", - "CAP_SETFCAP", - "CAP_SETPCAP", - "CAP_NET_BIND_SERVICE", - "CAP_SYS_CHROOT", - "CAP_KILL", - "CAP_AUDIT_WRITE", - }, - Inheritable: []string{ - "CAP_CHOWN", - "CAP_DAC_OVERRIDE", - "CAP_FSETID", - "CAP_FOWNER", - "CAP_MKNOD", - "CAP_NET_RAW", - "CAP_SETGID", - "CAP_SETUID", - "CAP_SETFCAP", - "CAP_SETPCAP", - "CAP_NET_BIND_SERVICE", - "CAP_SYS_CHROOT", - "CAP_KILL", - "CAP_AUDIT_WRITE", - }, - Permitted: []string{ - "CAP_CHOWN", - "CAP_DAC_OVERRIDE", - "CAP_FSETID", - "CAP_FOWNER", - "CAP_MKNOD", - "CAP_NET_RAW", - "CAP_SETGID", - "CAP_SETUID", - "CAP_SETFCAP", - "CAP_SETPCAP", - "CAP_NET_BIND_SERVICE", - "CAP_SYS_CHROOT", - "CAP_KILL", - "CAP_AUDIT_WRITE", - }, - Ambient: []string{ - "CAP_CHOWN", - "CAP_DAC_OVERRIDE", - "CAP_FSETID", - "CAP_FOWNER", - "CAP_MKNOD", - "CAP_NET_RAW", - "CAP_SETGID", - "CAP_SETUID", - "CAP_SETFCAP", - "CAP_SETPCAP", - "CAP_NET_BIND_SERVICE", - "CAP_SYS_CHROOT", - "CAP_KILL", - "CAP_AUDIT_WRITE", - }, - }, + Bounding: []string{ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE", + }, + Effective: []string{ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE", + }, + Inheritable: []string{ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE", + }, + Permitted: []string{ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE", + }, + Ambient: []string{ + "CAP_CHOWN", + "CAP_DAC_OVERRIDE", + "CAP_FSETID", + "CAP_FOWNER", + "CAP_MKNOD", + "CAP_NET_RAW", + "CAP_SETGID", + "CAP_SETUID", + "CAP_SETFCAP", + "CAP_SETPCAP", + "CAP_NET_BIND_SERVICE", + "CAP_SYS_CHROOT", + "CAP_KILL", + "CAP_AUDIT_WRITE", + }, + }, Namespaces: configs.Namespaces([]configs.Namespace{ {Type: configs.NEWNS}, {Type: configs.NEWUTS}, diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go similarity index 67% rename from cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor.go rename to cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go index debfc1e489ed..73965f12d83b 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go @@ -1,8 +1,7 @@ -// +build apparmor,linux - package apparmor import ( + "bytes" "fmt" "io/ioutil" "os" @@ -12,11 +11,9 @@ import ( // IsEnabled returns true if apparmor is enabled for the host. func IsEnabled() bool { - if _, err := os.Stat("/sys/kernel/security/apparmor"); err == nil && os.Getenv("container") == "" { - if _, err = os.Stat("/sbin/apparmor_parser"); err == nil { - buf, err := ioutil.ReadFile("/sys/module/apparmor/parameters/enabled") - return err == nil && len(buf) > 1 && buf[0] == 'Y' - } + if _, err := os.Stat("/sys/kernel/security/apparmor"); err == nil { + buf, err := ioutil.ReadFile("/sys/module/apparmor/parameters/enabled") + return err == nil && bytes.HasPrefix(buf, []byte("Y")) } return false } @@ -24,9 +21,7 @@ func IsEnabled() bool { func setProcAttr(attr, value string) error { // Under AppArmor you can only change your own attr, so use /proc/self/ // instead of /proc// like libapparmor does - path := fmt.Sprintf("/proc/self/attr/%s", attr) - - f, err := os.OpenFile(path, os.O_WRONLY, 0) + f, err := os.OpenFile("/proc/self/attr/"+attr, os.O_WRONLY, 0) if err != nil { return err } @@ -36,14 +31,13 @@ func setProcAttr(attr, value string) error { return err } - _, err = fmt.Fprintf(f, "%s", value) + _, err = f.WriteString(value) return err } // changeOnExec reimplements aa_change_onexec from libapparmor in Go func changeOnExec(name string) error { - value := "exec " + name - if err := setProcAttr("exec", value); err != nil { + if err := setProcAttr("exec", "exec "+name); err != nil { return fmt.Errorf("apparmor failed to apply profile: %s", err) } return nil diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_disabled.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_unsupported.go similarity index 91% rename from cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_disabled.go rename to cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_unsupported.go index d4110cf0bc6d..0bc473f810bc 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_disabled.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_unsupported.go @@ -1,4 +1,4 @@ -// +build !apparmor !linux +// +build !linux package apparmor diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities.go new file mode 100644 index 000000000000..adbf6330c48e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities.go @@ -0,0 +1,96 @@ +// +build linux + +package capabilities + +import ( + "fmt" + "strings" + + "github.com/opencontainers/runc/libcontainer/configs" + "github.com/syndtr/gocapability/capability" +) + +const allCapabilityTypes = capability.CAPS | capability.BOUNDS | capability.AMBS + +var capabilityMap map[string]capability.Cap + +func init() { + capabilityMap = make(map[string]capability.Cap, capability.CAP_LAST_CAP+1) + for _, c := range capability.List() { + if c > capability.CAP_LAST_CAP { + continue + } + capabilityMap["CAP_"+strings.ToUpper(c.String())] = c + } +} + +// New creates a new Caps from the given Capabilities config. +func New(capConfig *configs.Capabilities) (*Caps, error) { + var ( + err error + caps Caps + ) + + if caps.bounding, err = capSlice(capConfig.Bounding); err != nil { + return nil, err + } + if caps.effective, err = capSlice(capConfig.Effective); err != nil { + return nil, err + } + if caps.inheritable, err = capSlice(capConfig.Inheritable); err != nil { + return nil, err + } + if caps.permitted, err = capSlice(capConfig.Permitted); err != nil { + return nil, err + } + if caps.ambient, err = capSlice(capConfig.Ambient); err != nil { + return nil, err + } + if caps.pid, err = capability.NewPid2(0); err != nil { + return nil, err + } + if err = caps.pid.Load(); err != nil { + return nil, err + } + return &caps, nil +} + +func capSlice(caps []string) ([]capability.Cap, error) { + out := make([]capability.Cap, len(caps)) + for i, c := range caps { + v, ok := capabilityMap[c] + if !ok { + return nil, fmt.Errorf("unknown capability %q", c) + } + out[i] = v + } + return out, nil +} + +// Caps holds the capabilities for a container. +type Caps struct { + pid capability.Capabilities + bounding []capability.Cap + effective []capability.Cap + inheritable []capability.Cap + permitted []capability.Cap + ambient []capability.Cap +} + +// ApplyBoundingSet sets the capability bounding set to those specified in the whitelist. +func (c *Caps) ApplyBoundingSet() error { + c.pid.Clear(capability.BOUNDS) + c.pid.Set(capability.BOUNDS, c.bounding...) + return c.pid.Apply(capability.BOUNDS) +} + +// Apply sets all the capabilities for the current process in the config. +func (c *Caps) ApplyCaps() error { + c.pid.Clear(allCapabilityTypes) + c.pid.Set(capability.BOUNDS, c.bounding...) + c.pid.Set(capability.PERMITTED, c.permitted...) + c.pid.Set(capability.INHERITABLE, c.inheritable...) + c.pid.Set(capability.EFFECTIVE, c.effective...) + c.pid.Set(capability.AMBIENT, c.ambient...) + return c.pid.Apply(allCapabilityTypes) +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities_unsupported.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities_unsupported.go new file mode 100644 index 000000000000..a3e82ac1fd4d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities_unsupported.go @@ -0,0 +1,3 @@ +// +build !linux + +package capabilities diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities_linux.go deleted file mode 100644 index 9daef29e480a..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities_linux.go +++ /dev/null @@ -1,117 +0,0 @@ -// +build linux - -package libcontainer - -import ( - "fmt" - "strings" - - "github.com/opencontainers/runc/libcontainer/configs" - "github.com/syndtr/gocapability/capability" -) - -const allCapabilityTypes = capability.CAPS | capability.BOUNDS | capability.AMBS - -var capabilityMap map[string]capability.Cap - -func init() { - capabilityMap = make(map[string]capability.Cap) - last := capability.CAP_LAST_CAP - // workaround for RHEL6 which has no /proc/sys/kernel/cap_last_cap - if last == capability.Cap(63) { - last = capability.CAP_BLOCK_SUSPEND - } - for _, cap := range capability.List() { - if cap > last { - continue - } - capKey := fmt.Sprintf("CAP_%s", strings.ToUpper(cap.String())) - capabilityMap[capKey] = cap - } -} - -func newContainerCapList(capConfig *configs.Capabilities) (*containerCapabilities, error) { - bounding := []capability.Cap{} - for _, c := range capConfig.Bounding { - v, ok := capabilityMap[c] - if !ok { - return nil, fmt.Errorf("unknown capability %q", c) - } - bounding = append(bounding, v) - } - effective := []capability.Cap{} - for _, c := range capConfig.Effective { - v, ok := capabilityMap[c] - if !ok { - return nil, fmt.Errorf("unknown capability %q", c) - } - effective = append(effective, v) - } - inheritable := []capability.Cap{} - for _, c := range capConfig.Inheritable { - v, ok := capabilityMap[c] - if !ok { - return nil, fmt.Errorf("unknown capability %q", c) - } - inheritable = append(inheritable, v) - } - permitted := []capability.Cap{} - for _, c := range capConfig.Permitted { - v, ok := capabilityMap[c] - if !ok { - return nil, fmt.Errorf("unknown capability %q", c) - } - permitted = append(permitted, v) - } - ambient := []capability.Cap{} - for _, c := range capConfig.Ambient { - v, ok := capabilityMap[c] - if !ok { - return nil, fmt.Errorf("unknown capability %q", c) - } - ambient = append(ambient, v) - } - pid, err := capability.NewPid2(0) - if err != nil { - return nil, err - } - err = pid.Load() - if err != nil { - return nil, err - } - return &containerCapabilities{ - bounding: bounding, - effective: effective, - inheritable: inheritable, - permitted: permitted, - ambient: ambient, - pid: pid, - }, nil -} - -type containerCapabilities struct { - pid capability.Capabilities - bounding []capability.Cap - effective []capability.Cap - inheritable []capability.Cap - permitted []capability.Cap - ambient []capability.Cap -} - -// ApplyBoundingSet sets the capability bounding set to those specified in the whitelist. -func (c *containerCapabilities) ApplyBoundingSet() error { - c.pid.Clear(capability.BOUNDS) - c.pid.Set(capability.BOUNDS, c.bounding...) - return c.pid.Apply(capability.BOUNDS) -} - -// Apply sets all the capabilities for the current process in the config. -func (c *containerCapabilities) ApplyCaps() error { - c.pid.Clear(allCapabilityTypes) - c.pid.Set(capability.BOUNDS, c.bounding...) - c.pid.Set(capability.PERMITTED, c.permitted...) - c.pid.Set(capability.INHERITABLE, c.inheritable...) - c.pid.Set(capability.EFFECTIVE, c.effective...) - c.pid.Set(capability.AMBIENT, c.ambient...) - return c.pid.Apply(allCapabilityTypes) -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/devices/devices_emulator.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/devices/devices_emulator.go index 6afedbc6e731..3572a5eae8ee 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/devices/devices_emulator.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/devices/devices_emulator.go @@ -27,29 +27,29 @@ import ( "sort" "strconv" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/runc/libcontainer/devices" "github.com/pkg/errors" ) -// deviceMeta is a DeviceRule without the Allow or Permissions fields, and no +// deviceMeta is a Rule without the Allow or Permissions fields, and no // wildcard-type support. It's effectively the "match" portion of a metadata // rule, for the purposes of our emulation. type deviceMeta struct { - node configs.DeviceType + node devices.Type major int64 minor int64 } -// deviceRule is effectively the tuple (deviceMeta, DevicePermissions). +// deviceRule is effectively the tuple (deviceMeta, Permissions). type deviceRule struct { meta deviceMeta - perms configs.DevicePermissions + perms devices.Permissions } // deviceRules is a mapping of device metadata rules to the associated // permissions in the ruleset. -type deviceRules map[deviceMeta]configs.DevicePermissions +type deviceRules map[deviceMeta]devices.Permissions func (r deviceRules) orderedEntries() []deviceRule { var rules []deviceRule @@ -103,9 +103,9 @@ func parseLine(line string) (*deviceRule, error) { // TODO: Double-check that the entire file is "a *:* rwm". return nil, nil case "b": - rule.meta.node = configs.BlockDevice + rule.meta.node = devices.BlockDevice case "c": - rule.meta.node = configs.CharDevice + rule.meta.node = devices.CharDevice default: // Should never happen! return nil, errors.Errorf("unknown device type %q", node) @@ -113,7 +113,7 @@ func parseLine(line string) (*deviceRule, error) { // Parse the major number. if major == "*" { - rule.meta.major = configs.Wildcard + rule.meta.major = devices.Wildcard } else { val, err := strconv.ParseUint(major, 10, 32) if err != nil { @@ -124,7 +124,7 @@ func parseLine(line string) (*deviceRule, error) { // Parse the minor number. if minor == "*" { - rule.meta.minor = configs.Wildcard + rule.meta.minor = devices.Wildcard } else { val, err := strconv.ParseUint(minor, 10, 32) if err != nil { @@ -134,7 +134,7 @@ func parseLine(line string) (*deviceRule, error) { } // Parse the access permissions. - rule.perms = configs.DevicePermissions(perms) + rule.perms = devices.Permissions(perms) if !rule.perms.IsValid() || rule.perms.IsEmpty() { // Should never happen! return nil, errors.Errorf("parse access mode: contained unknown modes or is empty: %q", perms) @@ -144,7 +144,7 @@ func parseLine(line string) (*deviceRule, error) { func (e *Emulator) addRule(rule deviceRule) error { if e.rules == nil { - e.rules = make(map[deviceMeta]configs.DevicePermissions) + e.rules = make(map[deviceMeta]devices.Permissions) } // Merge with any pre-existing permissions. @@ -169,9 +169,9 @@ func (e *Emulator) rmRule(rule deviceRule) error { // to mention it'd be really slow (the kernel side is implemented as a // linked-list of exceptions). for _, partialMeta := range []deviceMeta{ - {node: rule.meta.node, major: configs.Wildcard, minor: rule.meta.minor}, - {node: rule.meta.node, major: rule.meta.major, minor: configs.Wildcard}, - {node: rule.meta.node, major: configs.Wildcard, minor: configs.Wildcard}, + {node: rule.meta.node, major: devices.Wildcard, minor: rule.meta.minor}, + {node: rule.meta.node, major: rule.meta.major, minor: devices.Wildcard}, + {node: rule.meta.node, major: devices.Wildcard, minor: devices.Wildcard}, } { // This wildcard rule is equivalent to the requested rule, so skip it. if rule.meta == partialMeta { @@ -202,7 +202,7 @@ func (e *Emulator) rmRule(rule deviceRule) error { func (e *Emulator) allow(rule *deviceRule) error { // This cgroup is configured as a black-list. Reset the entire emulator, // and put is into black-list mode. - if rule == nil || rule.meta.node == configs.WildcardDevice { + if rule == nil || rule.meta.node == devices.WildcardDevice { *e = Emulator{ defaultAllow: true, rules: nil, @@ -222,7 +222,7 @@ func (e *Emulator) allow(rule *deviceRule) error { func (e *Emulator) deny(rule *deviceRule) error { // This cgroup is configured as a white-list. Reset the entire emulator, // and put is into white-list mode. - if rule == nil || rule.meta.node == configs.WildcardDevice { + if rule == nil || rule.meta.node == devices.WildcardDevice { *e = Emulator{ defaultAllow: false, rules: nil, @@ -239,7 +239,7 @@ func (e *Emulator) deny(rule *deviceRule) error { return err } -func (e *Emulator) Apply(rule configs.DeviceRule) error { +func (e *Emulator) Apply(rule devices.Rule) error { if !rule.Type.CanCgroup() { return errors.Errorf("cannot add rule [%#v] with non-cgroup type %q", rule, rule.Type) } @@ -252,7 +252,7 @@ func (e *Emulator) Apply(rule configs.DeviceRule) error { }, perms: rule.Permissions, } - if innerRule.meta.node == configs.WildcardDevice { + if innerRule.meta.node == devices.WildcardDevice { innerRule = nil } @@ -307,8 +307,8 @@ func EmulatorFromList(list io.Reader) (*Emulator, error) { // This function is the sole reason for all of Emulator -- to allow us // to figure out how to update a containers' cgroups without causing spurrious // device errors (if possible). -func (source *Emulator) Transition(target *Emulator) ([]*configs.DeviceRule, error) { - var transitionRules []*configs.DeviceRule +func (source *Emulator) Transition(target *Emulator) ([]*devices.Rule, error) { + var transitionRules []*devices.Rule oldRules := source.rules // If the default policy doesn't match, we need to include a "disruptive" @@ -319,11 +319,11 @@ func (source *Emulator) Transition(target *Emulator) ([]*configs.DeviceRule, err // deny rules are in place in a black-list cgroup. Thus if the source is a // black-list we also have to include a disruptive rule. if source.IsBlacklist() || source.defaultAllow != target.defaultAllow { - transitionRules = append(transitionRules, &configs.DeviceRule{ + transitionRules = append(transitionRules, &devices.Rule{ Type: 'a', Major: -1, Minor: -1, - Permissions: configs.DevicePermissions("rwm"), + Permissions: devices.Permissions("rwm"), Allow: target.defaultAllow, }) // The old rules are only relevant if we aren't starting out with a @@ -342,7 +342,7 @@ func (source *Emulator) Transition(target *Emulator) ([]*configs.DeviceRule, err newPerms := target.rules[meta] droppedPerms := oldPerms.Difference(newPerms) if !droppedPerms.IsEmpty() { - transitionRules = append(transitionRules, &configs.DeviceRule{ + transitionRules = append(transitionRules, &devices.Rule{ Type: meta.node, Major: meta.major, Minor: meta.minor, @@ -360,7 +360,7 @@ func (source *Emulator) Transition(target *Emulator) ([]*configs.DeviceRule, err oldPerms := oldRules[meta] gainedPerms := newPerms.Difference(oldPerms) if !gainedPerms.IsEmpty() { - transitionRules = append(transitionRules, &configs.DeviceRule{ + transitionRules = append(transitionRules, &devices.Rule{ Type: meta.node, Major: meta.major, Minor: meta.minor, diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go index b593eb43e177..a173fd4a16f7 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go @@ -1,4 +1,4 @@ -// Package devicefilter containes eBPF device filter program +// Package devicefilter contains eBPF device filter program // // The implementation is based on https://github.com/containers/crun/blob/0.10.2/src/libcrun/ebpf.c // @@ -7,11 +7,11 @@ package devicefilter import ( - "fmt" "math" + "strconv" "github.com/cilium/ebpf/asm" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/runc/libcontainer/devices" "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -22,7 +22,7 @@ const ( ) // DeviceFilter returns eBPF device filter program and its license string -func DeviceFilter(devices []*configs.DeviceRule) (asm.Instructions, string, error) { +func DeviceFilter(devices []*devices.Rule) (asm.Instructions, string, error) { p := &program{} p.init() for i := len(devices) - 1; i >= 0; i-- { @@ -68,7 +68,7 @@ func (p *program) init() { } // appendDevice needs to be called from the last element of OCI linux.resources.devices to the head element. -func (p *program) appendDevice(dev *configs.DeviceRule) error { +func (p *program) appendDevice(dev *devices.Rule) error { if p.blockID < 0 { return errors.New("the program is finalized") } @@ -88,7 +88,7 @@ func (p *program) appendDevice(dev *configs.DeviceRule) error { hasType = false default: // if not specified in OCI json, typ is set to DeviceTypeAll - return errors.Errorf("invalid DeviceType %q", string(dev.Type)) + return errors.Errorf("invalid Type %q", string(dev.Type)) } if dev.Major > math.MaxUint32 { return errors.Errorf("invalid major %d", dev.Major) @@ -114,9 +114,11 @@ func (p *program) appendDevice(dev *configs.DeviceRule) error { // If the access is rwm, skip the check. hasAccess := bpfAccess != (unix.BPF_DEVCG_ACC_READ | unix.BPF_DEVCG_ACC_WRITE | unix.BPF_DEVCG_ACC_MKNOD) - blockSym := fmt.Sprintf("block-%d", p.blockID) - nextBlockSym := fmt.Sprintf("block-%d", p.blockID+1) - prevBlockLastIdx := len(p.insts) - 1 + var ( + blockSym = "block-" + strconv.Itoa(p.blockID) + nextBlockSym = "block-" + strconv.Itoa(p.blockID+1) + prevBlockLastIdx = len(p.insts) - 1 + ) if hasType { p.insts = append(p.insts, // if (R2 != bpfType) goto next @@ -158,7 +160,7 @@ func (p *program) finalize() (asm.Instructions, error) { // acceptBlock with asm.Return() is already inserted return p.insts, nil } - blockSym := fmt.Sprintf("block-%d", p.blockID) + blockSym := "block-" + strconv.Itoa(p.blockID) p.insts = append(p.insts, // R0 <- 0 asm.Mov.Imm32(asm.R0, 0).Sym(blockSym), diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go index 031a6bbdab20..dca2a6220785 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go @@ -6,7 +6,6 @@ import ( "bufio" "fmt" "os" - "path/filepath" "strconv" "strings" @@ -105,9 +104,9 @@ func splitBlkioStatLine(r rune) bool { return r == ' ' || r == ':' } -func getBlkioStat(path string) ([]cgroups.BlkioStatEntry, error) { +func getBlkioStat(dir, file string) ([]cgroups.BlkioStatEntry, error) { var blkioStats []cgroups.BlkioStatEntry - f, err := os.Open(path) + f, err := fscommon.OpenFile(dir, file, os.O_RDONLY) if err != nil { if os.IsNotExist(err) { return blkioStats, nil @@ -125,7 +124,7 @@ func getBlkioStat(path string) ([]cgroups.BlkioStatEntry, error) { // skip total line continue } else { - return nil, fmt.Errorf("Invalid line found while parsing %s: %s", path, sc.Text()) + return nil, fmt.Errorf("Invalid line found while parsing %s/%s: %s", dir, file, sc.Text()) } } @@ -158,73 +157,134 @@ func getBlkioStat(path string) ([]cgroups.BlkioStatEntry, error) { } func (s *BlkioGroup) GetStats(path string, stats *cgroups.Stats) error { - // Try to read CFQ stats available on all CFQ enabled kernels first - if blkioStats, err := getBlkioStat(filepath.Join(path, "blkio.io_serviced_recursive")); err == nil && blkioStats != nil { - return getCFQStats(path, stats) + type blkioStatInfo struct { + filename string + blkioStatEntriesPtr *[]cgroups.BlkioStatEntry } - return getStats(path, stats) // Use generic stats as fallback -} - -func getCFQStats(path string, stats *cgroups.Stats) error { - var blkioStats []cgroups.BlkioStatEntry - var err error - - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.sectors_recursive")); err != nil { - return err - } - stats.BlkioStats.SectorsRecursive = blkioStats - - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_service_bytes_recursive")); err != nil { - return err + var bfqDebugStats = []blkioStatInfo{ + { + filename: "blkio.bfq.sectors_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.SectorsRecursive, + }, + { + filename: "blkio.bfq.io_service_time_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServiceTimeRecursive, + }, + { + filename: "blkio.bfq.io_wait_time_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoWaitTimeRecursive, + }, + { + filename: "blkio.bfq.io_merged_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoMergedRecursive, + }, + { + filename: "blkio.bfq.io_queued_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoQueuedRecursive, + }, + { + filename: "blkio.bfq.time_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoTimeRecursive, + }, + { + filename: "blkio.bfq.io_serviced_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServicedRecursive, + }, + { + filename: "blkio.bfq.io_service_bytes_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServiceBytesRecursive, + }, } - stats.BlkioStats.IoServiceBytesRecursive = blkioStats - - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_serviced_recursive")); err != nil { - return err + var bfqStats = []blkioStatInfo{ + { + filename: "blkio.bfq.io_serviced_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServicedRecursive, + }, + { + filename: "blkio.bfq.io_service_bytes_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServiceBytesRecursive, + }, } - stats.BlkioStats.IoServicedRecursive = blkioStats - - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_queued_recursive")); err != nil { - return err + var cfqStats = []blkioStatInfo{ + { + filename: "blkio.sectors_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.SectorsRecursive, + }, + { + filename: "blkio.io_service_time_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServiceTimeRecursive, + }, + { + filename: "blkio.io_wait_time_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoWaitTimeRecursive, + }, + { + filename: "blkio.io_merged_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoMergedRecursive, + }, + { + filename: "blkio.io_queued_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoQueuedRecursive, + }, + { + filename: "blkio.time_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoTimeRecursive, + }, + { + filename: "blkio.io_serviced_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServicedRecursive, + }, + { + filename: "blkio.io_service_bytes_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServiceBytesRecursive, + }, } - stats.BlkioStats.IoQueuedRecursive = blkioStats - - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_service_time_recursive")); err != nil { - return err + var throttleRecursiveStats = []blkioStatInfo{ + { + filename: "blkio.throttle.io_serviced_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServicedRecursive, + }, + { + filename: "blkio.throttle.io_service_bytes_recursive", + blkioStatEntriesPtr: &stats.BlkioStats.IoServiceBytesRecursive, + }, } - stats.BlkioStats.IoServiceTimeRecursive = blkioStats - - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_wait_time_recursive")); err != nil { - return err + var baseStats = []blkioStatInfo{ + { + filename: "blkio.throttle.io_serviced", + blkioStatEntriesPtr: &stats.BlkioStats.IoServicedRecursive, + }, + { + filename: "blkio.throttle.io_service_bytes", + blkioStatEntriesPtr: &stats.BlkioStats.IoServiceBytesRecursive, + }, } - stats.BlkioStats.IoWaitTimeRecursive = blkioStats - - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.io_merged_recursive")); err != nil { - return err + var orderedStats = [][]blkioStatInfo{ + bfqDebugStats, + bfqStats, + cfqStats, + throttleRecursiveStats, + baseStats, } - stats.BlkioStats.IoMergedRecursive = blkioStats - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.time_recursive")); err != nil { - return err - } - stats.BlkioStats.IoTimeRecursive = blkioStats - - return nil -} - -func getStats(path string, stats *cgroups.Stats) error { var blkioStats []cgroups.BlkioStatEntry var err error - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.throttle.io_service_bytes")); err != nil { - return err - } - stats.BlkioStats.IoServiceBytesRecursive = blkioStats - - if blkioStats, err = getBlkioStat(filepath.Join(path, "blkio.throttle.io_serviced")); err != nil { - return err + for _, statGroup := range orderedStats { + for i, statInfo := range statGroup { + if blkioStats, err = getBlkioStat(path, statInfo.filename); err != nil || blkioStats == nil { + // if error occurs on first file, move to next group + if i == 0 { + break + } + return err + } + *statInfo.blkioStatEntriesPtr = blkioStats + //finish if all stats are gathered + if i == len(statGroup)-1 { + return nil + } + } } - stats.BlkioStats.IoServicedRecursive = blkioStats - return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go index 6fb1c2078a50..1d5f455d6a40 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go @@ -6,7 +6,6 @@ import ( "bufio" "fmt" "os" - "path/filepath" "strconv" "github.com/opencontainers/runc/libcontainer/cgroups" @@ -87,7 +86,7 @@ func (s *CpuGroup) Set(path string, cgroup *configs.Cgroup) error { } func (s *CpuGroup) GetStats(path string, stats *cgroups.Stats) error { - f, err := os.Open(filepath.Join(path, "cpu.stat")) + f, err := fscommon.OpenFile(path, "cpu.stat", os.O_RDONLY) if err != nil { if os.IsNotExist(err) { return nil diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go index 1a18971bc5a7..129de6a01cd1 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go @@ -5,7 +5,6 @@ package fs import ( "bufio" "fmt" - "io/ioutil" "os" "path/filepath" "strconv" @@ -83,8 +82,7 @@ func (s *CpuacctGroup) GetStats(path string, stats *cgroups.Stats) error { // Returns user and kernel usage breakdown in nanoseconds. func getCpuUsageBreakdown(path string) (uint64, uint64, error) { - userModeUsage := uint64(0) - kernelModeUsage := uint64(0) + var userModeUsage, kernelModeUsage uint64 const ( userField = "user" systemField = "system" @@ -93,11 +91,11 @@ func getCpuUsageBreakdown(path string) (uint64, uint64, error) { // Expected format: // user // system - data, err := ioutil.ReadFile(filepath.Join(path, cgroupCpuacctStat)) + data, err := fscommon.ReadFile(path, cgroupCpuacctStat) if err != nil { return 0, 0, err } - fields := strings.Fields(string(data)) + fields := strings.Fields(data) if len(fields) < 4 { return 0, 0, fmt.Errorf("failure - %s is expected to have at least 4 fields", filepath.Join(path, cgroupCpuacctStat)) } @@ -119,11 +117,11 @@ func getCpuUsageBreakdown(path string) (uint64, uint64, error) { func getPercpuUsage(path string) ([]uint64, error) { percpuUsage := []uint64{} - data, err := ioutil.ReadFile(filepath.Join(path, "cpuacct.usage_percpu")) + data, err := fscommon.ReadFile(path, "cpuacct.usage_percpu") if err != nil { return percpuUsage, err } - for _, value := range strings.Fields(string(data)) { + for _, value := range strings.Fields(data) { value, err := strconv.ParseUint(value, 10, 64) if err != nil { return percpuUsage, fmt.Errorf("Unable to convert param value to uint64: %s", err) @@ -137,7 +135,7 @@ func getPercpuUsageInModes(path string) ([]uint64, []uint64, error) { usageKernelMode := []uint64{} usageUserMode := []uint64{} - file, err := os.Open(filepath.Join(path, cgroupCpuacctUsageAll)) + file, err := fscommon.OpenFile(path, cgroupCpuacctUsageAll, os.O_RDONLY) if os.IsNotExist(err) { return usageKernelMode, usageUserMode, nil } else if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go index ba17519baea2..5bde025b4b91 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go @@ -3,17 +3,17 @@ package fs import ( - "bytes" - "io/ioutil" + "fmt" "os" "path/filepath" + "strconv" + "strings" - "github.com/moby/sys/mountinfo" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" - libcontainerUtils "github.com/opencontainers/runc/libcontainer/utils" "github.com/pkg/errors" + "golang.org/x/sys/unix" ) type CpusetGroup struct { @@ -41,30 +41,107 @@ func (s *CpusetGroup) Set(path string, cgroup *configs.Cgroup) error { return nil } -func (s *CpusetGroup) GetStats(path string, stats *cgroups.Stats) error { - return nil +func getCpusetStat(path string, filename string) ([]uint16, error) { + var extracted []uint16 + fileContent, err := fscommon.GetCgroupParamString(path, filename) + if err != nil { + return extracted, err + } + if len(fileContent) == 0 { + return extracted, fmt.Errorf("%s found to be empty", filepath.Join(path, filename)) + } + + for _, s := range strings.Split(fileContent, ",") { + splitted := strings.SplitN(s, "-", 3) + switch len(splitted) { + case 3: + return extracted, fmt.Errorf("invalid values in %s", filepath.Join(path, filename)) + case 2: + min, err := strconv.ParseUint(splitted[0], 10, 16) + if err != nil { + return extracted, err + } + max, err := strconv.ParseUint(splitted[1], 10, 16) + if err != nil { + return extracted, err + } + if min > max { + return extracted, fmt.Errorf("invalid values in %s", filepath.Join(path, filename)) + } + for i := min; i <= max; i++ { + extracted = append(extracted, uint16(i)) + } + case 1: + value, err := strconv.ParseUint(s, 10, 16) + if err != nil { + return extracted, err + } + extracted = append(extracted, uint16(value)) + } + } + + return extracted, nil } -// Get the source mount point of directory passed in as argument. -func getMount(dir string) (string, error) { - mi, err := mountinfo.GetMounts(mountinfo.ParentsFilter(dir)) - if err != nil { - return "", err +func (s *CpusetGroup) GetStats(path string, stats *cgroups.Stats) error { + var err error + + stats.CPUSetStats.CPUs, err = getCpusetStat(path, "cpuset.cpus") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + + stats.CPUSetStats.CPUExclusive, err = fscommon.GetCgroupParamUint(path, "cpuset.cpu_exclusive") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err } - if len(mi) < 1 { - return "", errors.Errorf("Can't find mount point of %s", dir) + + stats.CPUSetStats.Mems, err = getCpusetStat(path, "cpuset.mems") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err } - // find the longest mount point - var idx, maxlen int - for i := range mi { - if len(mi[i].Mountpoint) > maxlen { - maxlen = len(mi[i].Mountpoint) - idx = i - } + stats.CPUSetStats.MemHardwall, err = fscommon.GetCgroupParamUint(path, "cpuset.mem_hardwall") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + + stats.CPUSetStats.MemExclusive, err = fscommon.GetCgroupParamUint(path, "cpuset.mem_exclusive") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + + stats.CPUSetStats.MemoryMigrate, err = fscommon.GetCgroupParamUint(path, "cpuset.memory_migrate") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err } - return mi[idx].Mountpoint, nil + stats.CPUSetStats.MemorySpreadPage, err = fscommon.GetCgroupParamUint(path, "cpuset.memory_spread_page") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + + stats.CPUSetStats.MemorySpreadSlab, err = fscommon.GetCgroupParamUint(path, "cpuset.memory_spread_slab") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + + stats.CPUSetStats.MemoryPressure, err = fscommon.GetCgroupParamUint(path, "cpuset.memory_pressure") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + + stats.CPUSetStats.SchedLoadBalance, err = fscommon.GetCgroupParamUint(path, "cpuset.sched_load_balance") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + + stats.CPUSetStats.SchedRelaxDomainLevel, err = fscommon.GetCgroupParamInt(path, "cpuset.sched_relax_domain_level") + if err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + + return nil } func (s *CpusetGroup) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) error { @@ -73,18 +150,13 @@ func (s *CpusetGroup) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) erro if dir == "" { return nil } - root, err := getMount(dir) - if err != nil { - return err - } - root = filepath.Dir(root) // 'ensureParent' start with parent because we don't want to // explicitly inherit from parent, it could conflict with // 'cpuset.cpu_exclusive'. - if err := s.ensureParent(filepath.Dir(dir), root); err != nil { + if err := cpusetEnsureParent(filepath.Dir(dir)); err != nil { return err } - if err := os.MkdirAll(dir, 0755); err != nil { + if err := os.Mkdir(dir, 0755); err != nil && !os.IsExist(err) { return err } // We didn't inherit cpuset configs from parent, but we have @@ -103,59 +175,61 @@ func (s *CpusetGroup) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) erro return cgroups.WriteCgroupProc(dir, pid) } -func (s *CpusetGroup) getSubsystemSettings(parent string) (cpus []byte, mems []byte, err error) { - if cpus, err = ioutil.ReadFile(filepath.Join(parent, "cpuset.cpus")); err != nil { +func getCpusetSubsystemSettings(parent string) (cpus, mems string, err error) { + if cpus, err = fscommon.ReadFile(parent, "cpuset.cpus"); err != nil { return } - if mems, err = ioutil.ReadFile(filepath.Join(parent, "cpuset.mems")); err != nil { + if mems, err = fscommon.ReadFile(parent, "cpuset.mems"); err != nil { return } return cpus, mems, nil } -// ensureParent makes sure that the parent directory of current is created -// and populated with the proper cpus and mems files copied from -// it's parent. -func (s *CpusetGroup) ensureParent(current, root string) error { +// cpusetEnsureParent makes sure that the parent directories of current +// are created and populated with the proper cpus and mems files copied +// from their respective parent. It does that recursively, starting from +// the top of the cpuset hierarchy (i.e. cpuset cgroup mount point). +func cpusetEnsureParent(current string) error { + var st unix.Statfs_t + parent := filepath.Dir(current) - if libcontainerUtils.CleanPath(parent) == root { + err := unix.Statfs(parent, &st) + if err == nil && st.Type != unix.CGROUP_SUPER_MAGIC { return nil } - // Avoid infinite recursion. - if parent == current { - return errors.New("cpuset: cgroup parent path outside cgroup root") + // Treat non-existing directory as cgroupfs as it will be created, + // and the root cpuset directory obviously exists. + if err != nil && err != unix.ENOENT { + return &os.PathError{Op: "statfs", Path: parent, Err: err} } - if err := s.ensureParent(parent, root); err != nil { + + if err := cpusetEnsureParent(parent); err != nil { return err } - if err := os.MkdirAll(current, 0755); err != nil { + if err := os.Mkdir(current, 0755); err != nil && !os.IsExist(err) { return err } - return s.copyIfNeeded(current, parent) + return cpusetCopyIfNeeded(current, parent) } -// copyIfNeeded copies the cpuset.cpus and cpuset.mems from the parent +// cpusetCopyIfNeeded copies the cpuset.cpus and cpuset.mems from the parent // directory to the current directory if the file's contents are 0 -func (s *CpusetGroup) copyIfNeeded(current, parent string) error { - var ( - err error - currentCpus, currentMems []byte - parentCpus, parentMems []byte - ) - - if currentCpus, currentMems, err = s.getSubsystemSettings(current); err != nil { +func cpusetCopyIfNeeded(current, parent string) error { + currentCpus, currentMems, err := getCpusetSubsystemSettings(current) + if err != nil { return err } - if parentCpus, parentMems, err = s.getSubsystemSettings(parent); err != nil { + parentCpus, parentMems, err := getCpusetSubsystemSettings(parent) + if err != nil { return err } - if s.isEmpty(currentCpus) { + if isEmptyCpuset(currentCpus) { if err := fscommon.WriteFile(current, "cpuset.cpus", string(parentCpus)); err != nil { return err } } - if s.isEmpty(currentMems) { + if isEmptyCpuset(currentMems) { if err := fscommon.WriteFile(current, "cpuset.mems", string(parentMems)); err != nil { return err } @@ -163,13 +237,13 @@ func (s *CpusetGroup) copyIfNeeded(current, parent string) error { return nil } -func (s *CpusetGroup) isEmpty(b []byte) bool { - return len(bytes.Trim(b, "\n")) == 0 +func isEmptyCpuset(str string) bool { + return str == "" || str == "\n" } func (s *CpusetGroup) ensureCpusAndMems(path string, cgroup *configs.Cgroup) error { if err := s.Set(path, cgroup); err != nil { return err } - return s.copyIfNeeded(path, filepath.Dir(path)) + return cpusetCopyIfNeeded(path, filepath.Dir(path)) } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go index fd8f00d5bfd0..9a37e68ec651 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go @@ -8,9 +8,10 @@ import ( "reflect" "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/devices" + cgroupdevices "github.com/opencontainers/runc/libcontainer/cgroups/devices" "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/runc/libcontainer/devices" "github.com/opencontainers/runc/libcontainer/system" ) @@ -34,17 +35,17 @@ func (s *DevicesGroup) Apply(path string, d *cgroupData) error { return join(path, d.pid) } -func loadEmulator(path string) (*devices.Emulator, error) { +func loadEmulator(path string) (*cgroupdevices.Emulator, error) { list, err := fscommon.ReadFile(path, "devices.list") if err != nil { return nil, err } - return devices.EmulatorFromList(bytes.NewBufferString(list)) + return cgroupdevices.EmulatorFromList(bytes.NewBufferString(list)) } -func buildEmulator(rules []*configs.DeviceRule) (*devices.Emulator, error) { +func buildEmulator(rules []*devices.Rule) (*cgroupdevices.Emulator, error) { // This defaults to a white-list -- which is what we want! - emu := &devices.Emulator{} + emu := &cgroupdevices.Emulator{} for _, rule := range rules { if err := emu.Apply(*rule); err != nil { return nil, err diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go index 11cb1646f482..25aff4f863fd 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go @@ -28,33 +28,54 @@ func (s *FreezerGroup) Apply(path string, d *cgroupData) error { func (s *FreezerGroup) Set(path string, cgroup *configs.Cgroup) error { switch cgroup.Resources.Freezer { - case configs.Frozen, configs.Thawed: - for { - // In case this loop does not exit because it doesn't get the expected - // state, let's write again this state, hoping it's going to be properly - // set this time. Otherwise, this loop could run infinitely, waiting for - // a state change that would never happen. - if err := fscommon.WriteFile(path, "freezer.state", string(cgroup.Resources.Freezer)); err != nil { + case configs.Frozen: + // As per older kernel docs (freezer-subsystem.txt before + // kernel commit ef9fe980c6fcc1821), if FREEZING is seen, + // userspace should either retry or thaw. While current + // kernel cgroup v1 docs no longer mention a need to retry, + // the kernel (tested on v5.4, Ubuntu 20.04) can't reliably + // freeze a cgroup while new processes keep appearing in it + // (either via fork/clone or by writing new PIDs to + // cgroup.procs). + // + // The number of retries below is chosen to have a decent + // chance to succeed even in the worst case scenario (runc + // pause/unpause with parallel runc exec). + // + // Adding any amount of sleep in between retries did not + // increase the chances of successful freeze. + for i := 0; i < 1000; i++ { + if err := fscommon.WriteFile(path, "freezer.state", string(configs.Frozen)); err != nil { return err } - state, err := s.GetState(path) + state, err := fscommon.ReadFile(path, "freezer.state") if err != nil { return err } - if state == cgroup.Resources.Freezer { - break + state = strings.TrimSpace(state) + switch state { + case "FREEZING": + continue + case string(configs.Frozen): + return nil + default: + // should never happen + return fmt.Errorf("unexpected state %s while freezing", strings.TrimSpace(state)) } - - time.Sleep(1 * time.Millisecond) } + // Despite our best efforts, it got stuck in FREEZING. + // Leaving it in this state is bad and dangerous, so + // let's (try to) thaw it back and error out. + _ = fscommon.WriteFile(path, "freezer.state", string(configs.Thawed)) + return errors.New("unable to freeze") + case configs.Thawed: + return fscommon.WriteFile(path, "freezer.state", string(configs.Thawed)) case configs.Undefined: return nil default: return fmt.Errorf("Invalid argument '%s' to freezer.state", string(cgroup.Resources.Freezer)) } - - return nil } func (s *FreezerGroup) GetStats(path string, stats *cgroups.Stats) error { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go index 3ccf3a3c61d6..a42ce4535e97 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go @@ -3,11 +3,9 @@ package fs import ( - "bufio" "fmt" "os" "path/filepath" - "strings" "sync" "github.com/opencontainers/runc/libcontainer/cgroups" @@ -133,46 +131,19 @@ func getCgroupRoot() (string, error) { return cgroupRoot, nil } - // slow path: parse mountinfo, find the first mount where fs=cgroup - // (e.g. "/sys/fs/cgroup/memory"), use its parent. - f, err := os.Open("/proc/self/mountinfo") + // slow path: parse mountinfo + mi, err := cgroups.GetCgroupMounts(false) if err != nil { return "", err } - defer f.Close() - - var root string - scanner := bufio.NewScanner(f) - for scanner.Scan() { - text := scanner.Text() - fields := strings.Split(text, " ") - // Safe as mountinfo encodes mountpoints with spaces as \040. - index := strings.Index(text, " - ") - postSeparatorFields := strings.Fields(text[index+3:]) - numPostFields := len(postSeparatorFields) - - // This is an error as we can't detect if the mount is for "cgroup" - if numPostFields == 0 { - return "", fmt.Errorf("mountinfo: found no fields post '-' in %q", text) - } - - if postSeparatorFields[0] == "cgroup" { - // Check that the mount is properly formatted. - if numPostFields < 3 { - return "", fmt.Errorf("Error found less than 3 fields post '-' in %q", text) - } - - root = filepath.Dir(fields[4]) - break - } - } - if err := scanner.Err(); err != nil { - return "", err - } - if root == "" { + if len(mi) < 1 { return "", errors.New("no cgroup mount found in mountinfo") } + // Get the first cgroup mount (e.g. "/sys/fs/cgroup/memory"), + // use its parent directory. + root := filepath.Dir(mi[0].Mountpoint) + if _, err := os.Stat(root); err != nil { return "", err } @@ -218,28 +189,31 @@ func (m *manager) Apply(pid int) (err error) { m.mu.Lock() defer m.mu.Unlock() - var c = m.cgroups - - d, err := getCgroupData(m.cgroups, pid) - if err != nil { - return err + c := m.cgroups + if c.Resources.Unified != nil { + return cgroups.ErrV1NoUnified } m.paths = make(map[string]string) if c.Paths != nil { + cgMap, err := cgroups.ParseCgroupFile("/proc/self/cgroup") + if err != nil { + return err + } for name, path := range c.Paths { - _, err := d.path(name) - if err != nil { - if cgroups.IsNotFound(err) { - continue - } - return err + // XXX(kolyshkin@): why this check is needed? + if _, ok := cgMap[name]; ok { + m.paths[name] = path } - m.paths[name] = path } return cgroups.EnterPid(m.paths, pid) } + d, err := getCgroupData(m.cgroups, pid) + if err != nil { + return err + } + for _, sys := range subsystems { p, err := d.path(sys.Name()) if err != nil { @@ -274,11 +248,7 @@ func (m *manager) Destroy() error { } m.mu.Lock() defer m.mu.Unlock() - if err := cgroups.RemovePaths(m.paths); err != nil { - return err - } - m.paths = make(map[string]string) - return nil + return cgroups.RemovePaths(m.paths) } func (m *manager) Path(subsys string) string { @@ -313,6 +283,9 @@ func (m *manager) Set(container *configs.Config) error { if m.cgroups != nil && m.cgroups.Paths != nil { return nil } + if container.Cgroups.Resources.Unified != nil { + return cgroups.ErrV1NoUnified + } m.mu.Lock() defer m.mu.Unlock() @@ -425,16 +398,6 @@ func join(path string, pid int) error { return cgroups.WriteCgroupProc(path, pid) } -func removePath(p string, err error) error { - if err != nil { - return err - } - if p != "" { - return os.RemoveAll(p) - } - return nil -} - func (m *manager) GetPaths() map[string]string { m.mu.Lock() defer m.mu.Unlock() diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go index d32d02da1ca9..861793411e6a 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go @@ -5,7 +5,6 @@ package fs import ( "fmt" "strconv" - "strings" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" @@ -25,7 +24,7 @@ func (s *HugetlbGroup) Apply(path string, d *cgroupData) error { func (s *HugetlbGroup) Set(path string, cgroup *configs.Cgroup) error { for _, hugetlb := range cgroup.Resources.HugetlbLimit { - if err := fscommon.WriteFile(path, strings.Join([]string{"hugetlb", hugetlb.Pagesize, "limit_in_bytes"}, "."), strconv.FormatUint(hugetlb.Limit, 10)); err != nil { + if err := fscommon.WriteFile(path, "hugetlb."+hugetlb.Pagesize+".limit_in_bytes", strconv.FormatUint(hugetlb.Limit, 10)); err != nil { return err } } @@ -39,21 +38,21 @@ func (s *HugetlbGroup) GetStats(path string, stats *cgroups.Stats) error { return nil } for _, pageSize := range HugePageSizes { - usage := strings.Join([]string{"hugetlb", pageSize, "usage_in_bytes"}, ".") + usage := "hugetlb." + pageSize + ".usage_in_bytes" value, err := fscommon.GetCgroupParamUint(path, usage) if err != nil { return fmt.Errorf("failed to parse %s - %v", usage, err) } hugetlbStats.Usage = value - maxUsage := strings.Join([]string{"hugetlb", pageSize, "max_usage_in_bytes"}, ".") + maxUsage := "hugetlb." + pageSize + ".max_usage_in_bytes" value, err = fscommon.GetCgroupParamUint(path, maxUsage) if err != nil { return fmt.Errorf("failed to parse %s - %v", maxUsage, err) } hugetlbStats.MaxUsage = value - failcnt := strings.Join([]string{"hugetlb", pageSize, "failcnt"}, ".") + failcnt := "hugetlb." + pageSize + ".failcnt" value, err = fscommon.GetCgroupParamUint(path, failcnt) if err != nil { return fmt.Errorf("failed to parse %s - %v", failcnt, err) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem.go index 8d97a6791a43..86858f9083e9 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem.go @@ -5,11 +5,11 @@ package fs import ( "errors" "fmt" - "io/ioutil" "path/filepath" "strconv" "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "golang.org/x/sys/unix" ) @@ -42,7 +42,7 @@ func setKernelMemory(path string, kernelMemoryLimit int64) error { // doesn't support it we *must* error out. return errors.New("kernel memory accounting not supported by this kernel") } - if err := ioutil.WriteFile(filepath.Join(path, cgroupKernelMemoryLimit), []byte(strconv.FormatInt(kernelMemoryLimit, 10)), 0700); err != nil { + if err := fscommon.WriteFile(path, cgroupKernelMemoryLimit, strconv.FormatInt(kernelMemoryLimit, 10)); err != nil { // Check if the error number returned by the syscall is "EBUSY" // The EBUSY signal is returned on attempts to write to the // memory.kmem.limit_in_bytes file if the cgroup has children or @@ -50,7 +50,7 @@ func setKernelMemory(path string, kernelMemoryLimit int64) error { if errors.Is(err, unix.EBUSY) { return fmt.Errorf("failed to set %s, because either tasks have already joined this cgroup or it has children", cgroupKernelMemoryLimit) } - return fmt.Errorf("failed to write %v to %v: %v", kernelMemoryLimit, cgroupKernelMemoryLimit, err) + return err } return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go index 41adcd38f47c..61be6d7e9a6d 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go @@ -7,7 +7,6 @@ import ( "fmt" "math" "os" - "path" "path/filepath" "strconv" "strings" @@ -18,16 +17,8 @@ import ( ) const ( - numaNodeSymbol = "N" - numaStatColumnSeparator = " " - numaStatKeyValueSeparator = "=" - numaStatMaxColumns = math.MaxUint8 + 1 - numaStatValueIndex = 1 - numaStatTypeIndex = 0 - numaStatColumnSliceLength = 2 - cgroupMemorySwapLimit = "memory.memsw.limit_in_bytes" - cgroupMemoryLimit = "memory.limit_in_bytes" - cgroupMemoryPagesByNuma = "memory.numa_stat" + cgroupMemorySwapLimit = "memory.memsw.limit_in_bytes" + cgroupMemoryLimit = "memory.limit_in_bytes" ) type MemoryGroup struct { @@ -160,7 +151,7 @@ func (s *MemoryGroup) Set(path string, cgroup *configs.Cgroup) error { func (s *MemoryGroup) GetStats(path string, stats *cgroups.Stats) error { // Set stats from memory.stat. - statsFile, err := os.Open(filepath.Join(path, "memory.stat")) + statsFile, err := fscommon.OpenFile(path, "memory.stat", os.O_RDONLY) if err != nil { if os.IsNotExist(err) { return nil @@ -200,8 +191,7 @@ func (s *MemoryGroup) GetStats(path string, stats *cgroups.Stats) error { } stats.MemoryStats.KernelTCPUsage = kernelTCPUsage - useHierarchy := strings.Join([]string{"memory", "use_hierarchy"}, ".") - value, err := fscommon.GetCgroupParamUint(path, useHierarchy) + value, err := fscommon.GetCgroupParamUint(path, "memory.use_hierarchy") if err != nil { return err } @@ -233,12 +223,14 @@ func getMemoryData(path, name string) (cgroups.MemoryData, error) { moduleName := "memory" if name != "" { - moduleName = strings.Join([]string{"memory", name}, ".") + moduleName = "memory." + name } - usage := strings.Join([]string{moduleName, "usage_in_bytes"}, ".") - maxUsage := strings.Join([]string{moduleName, "max_usage_in_bytes"}, ".") - failcnt := strings.Join([]string{moduleName, "failcnt"}, ".") - limit := strings.Join([]string{moduleName, "limit_in_bytes"}, ".") + var ( + usage = moduleName + ".usage_in_bytes" + maxUsage = moduleName + ".max_usage_in_bytes" + failcnt = moduleName + ".failcnt" + limit = moduleName + ".limit_in_bytes" + ) value, err := fscommon.GetCgroupParamUint(path, usage) if err != nil { @@ -277,47 +269,81 @@ func getMemoryData(path, name string) (cgroups.MemoryData, error) { } func getPageUsageByNUMA(cgroupPath string) (cgroups.PageUsageByNUMA, error) { + const ( + maxColumns = math.MaxUint8 + 1 + filename = "memory.numa_stat" + ) stats := cgroups.PageUsageByNUMA{} - file, err := os.Open(path.Join(cgroupPath, cgroupMemoryPagesByNuma)) + file, err := fscommon.OpenFile(cgroupPath, filename, os.O_RDONLY) if os.IsNotExist(err) { return stats, nil } else if err != nil { return stats, err } + // File format is documented in linux/Documentation/cgroup-v1/memory.txt + // and it looks like this: + // + // total= N0= N1= ... + // file= N0= N1= ... + // anon= N0= N1= ... + // unevictable= N0= N1= ... + // hierarchical_= N0= N1= ... + scanner := bufio.NewScanner(file) for scanner.Scan() { - var statsType string - statsByType := cgroups.PageStats{Nodes: map[uint8]uint64{}} - columns := strings.SplitN(scanner.Text(), numaStatColumnSeparator, numaStatMaxColumns) - - for _, column := range columns { - pagesByNode := strings.SplitN(column, numaStatKeyValueSeparator, numaStatColumnSliceLength) - - if strings.HasPrefix(pagesByNode[numaStatTypeIndex], numaNodeSymbol) { - nodeID, err := strconv.ParseUint(pagesByNode[numaStatTypeIndex][1:], 10, 8) + var field *cgroups.PageStats + + line := scanner.Text() + columns := strings.SplitN(line, " ", maxColumns) + for i, column := range columns { + byNode := strings.SplitN(column, "=", 2) + // Some custom kernels have non-standard fields, like + // numa_locality 0 0 0 0 0 0 0 0 0 0 + // numa_exectime 0 + if len(byNode) < 2 { + if i == 0 { + // Ignore/skip those. + break + } else { + // The first column was already validated, + // so be strict to the rest. + return stats, fmt.Errorf("malformed line %q in %s", + line, filename) + } + } + key, val := byNode[0], byNode[1] + if i == 0 { // First column: key is name, val is total. + field = getNUMAField(&stats, key) + if field == nil { // unknown field (new kernel?) + break + } + field.Total, err = strconv.ParseUint(val, 0, 64) if err != nil { - return cgroups.PageUsageByNUMA{}, err + return stats, err + } + field.Nodes = map[uint8]uint64{} + } else { // Subsequent columns: key is N, val is usage. + if len(key) < 2 || key[0] != 'N' { + // This is definitely an error. + return stats, fmt.Errorf("malformed line %q in %s", + line, filename) } - statsByType.Nodes[uint8(nodeID)], err = strconv.ParseUint(pagesByNode[numaStatValueIndex], 0, 64) + n, err := strconv.ParseUint(key[1:], 10, 8) if err != nil { return cgroups.PageUsageByNUMA{}, err } - } else { - statsByType.Total, err = strconv.ParseUint(pagesByNode[numaStatValueIndex], 0, 64) + + usage, err := strconv.ParseUint(val, 10, 64) if err != nil { return cgroups.PageUsageByNUMA{}, err } - statsType = pagesByNode[numaStatTypeIndex] + field.Nodes[uint8(n)] = usage } - err := addNUMAStatsByType(&stats, statsByType, statsType) - if err != nil { - return cgroups.PageUsageByNUMA{}, err - } } } err = scanner.Err() @@ -328,26 +354,24 @@ func getPageUsageByNUMA(cgroupPath string) (cgroups.PageUsageByNUMA, error) { return stats, nil } -func addNUMAStatsByType(stats *cgroups.PageUsageByNUMA, byTypeStats cgroups.PageStats, statsType string) error { - switch statsType { +func getNUMAField(stats *cgroups.PageUsageByNUMA, name string) *cgroups.PageStats { + switch name { case "total": - stats.Total = byTypeStats + return &stats.Total case "file": - stats.File = byTypeStats + return &stats.File case "anon": - stats.Anon = byTypeStats + return &stats.Anon case "unevictable": - stats.Unevictable = byTypeStats + return &stats.Unevictable case "hierarchical_total": - stats.Hierarchical.Total = byTypeStats + return &stats.Hierarchical.Total case "hierarchical_file": - stats.Hierarchical.File = byTypeStats + return &stats.Hierarchical.File case "hierarchical_anon": - stats.Hierarchical.Anon = byTypeStats + return &stats.Hierarchical.Anon case "hierarchical_unevictable": - stats.Hierarchical.Unevictable = byTypeStats - default: - return fmt.Errorf("unsupported NUMA page type found: %s", statsType) + return &stats.Hierarchical.Unevictable } return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go index 9a5af709d249..7cada9149d46 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go @@ -19,7 +19,7 @@ func (s *NameGroup) Name() string { func (s *NameGroup) Apply(path string, d *cgroupData) error { if s.Join { // ignore errors if the named cgroup does not exist - join(path, d.pid) + _ = join(path, d.pid) } return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go index edf1060ecb4a..0dffe6648e97 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go @@ -5,7 +5,6 @@ package fs2 import ( "bufio" "os" - "path/filepath" "strconv" "github.com/opencontainers/runc/libcontainer/cgroups" @@ -50,7 +49,7 @@ func setCpu(dirPath string, cgroup *configs.Cgroup) error { return nil } func statCpu(dirPath string, stats *cgroups.Stats) error { - f, err := os.Open(filepath.Join(dirPath, "cpu.stat")) + f, err := fscommon.OpenFile(dirPath, "cpu.stat", os.O_RDONLY) if err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go index 7be9ece0bf4f..30cf51ee68b6 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go @@ -1,19 +1,17 @@ package fs2 import ( - "bytes" "fmt" - "io/ioutil" "os" "path/filepath" "strings" + "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" ) -func supportedControllers(cgroup *configs.Cgroup) ([]byte, error) { - const file = UnifiedMountpoint + "/cgroup.controllers" - return ioutil.ReadFile(file) +func supportedControllers(cgroup *configs.Cgroup) (string, error) { + return fscommon.ReadFile(UnifiedMountpoint, "/cgroup.controllers") } // needAnyControllers returns whether we enable some supported controllers or not, @@ -31,7 +29,7 @@ func needAnyControllers(cgroup *configs.Cgroup) (bool, error) { return false, err } avail := make(map[string]struct{}) - for _, ctr := range strings.Fields(string(content)) { + for _, ctr := range strings.Fields(content) { avail[ctr] = struct{}{} } @@ -81,8 +79,12 @@ func CreateCgroupPath(path string, c *configs.Cgroup) (Err error) { return err } - ctrs := bytes.Fields(content) - res := append([]byte("+"), bytes.Join(ctrs, []byte(" +"))...) + const ( + cgTypeFile = "cgroup.type" + cgStCtlFile = "cgroup.subtree_control" + ) + ctrs := strings.Fields(content) + res := "+" + strings.Join(ctrs, " +") elements := strings.Split(path, "/") elements = elements[3:] @@ -103,9 +105,9 @@ func CreateCgroupPath(path string, c *configs.Cgroup) (Err error) { } }() } - cgTypeFile := filepath.Join(current, "cgroup.type") - cgType, _ := ioutil.ReadFile(cgTypeFile) - switch strings.TrimSpace(string(cgType)) { + cgType, _ := fscommon.ReadFile(current, cgTypeFile) + cgType = strings.TrimSpace(cgType) + switch cgType { // If the cgroup is in an invalid mode (usually this means there's an internal // process in the cgroup tree, because we created a cgroup under an // already-populated-by-other-processes cgroup), then we have to error out if @@ -120,7 +122,7 @@ func CreateCgroupPath(path string, c *configs.Cgroup) (Err error) { // since that means we're a properly delegated cgroup subtree) but in // this case there's not much we can do and it's better than giving an // error. - _ = ioutil.WriteFile(cgTypeFile, []byte("threaded"), 0644) + _ = fscommon.WriteFile(current, cgTypeFile, "threaded") } // If the cgroup is in (threaded) or (domain threaded) mode, we can only use thread-aware controllers // (and you cannot usually take a cgroup out of threaded mode). @@ -128,18 +130,17 @@ func CreateCgroupPath(path string, c *configs.Cgroup) (Err error) { fallthrough case "threaded": if containsDomainController(c) { - return fmt.Errorf("cannot enter cgroupv2 %q with domain controllers -- it is in %s mode", current, strings.TrimSpace(string(cgType))) + return fmt.Errorf("cannot enter cgroupv2 %q with domain controllers -- it is in %s mode", current, cgType) } } } // enable all supported controllers if i < len(elements)-1 { - file := filepath.Join(current, "cgroup.subtree_control") - if err := ioutil.WriteFile(file, res, 0644); err != nil { + if err := fscommon.WriteFile(current, cgStCtlFile, res); err != nil { // try write one by one - allCtrs := bytes.Split(res, []byte(" ")) + allCtrs := strings.Split(res, " ") for _, ctr := range allCtrs { - _ = ioutil.WriteFile(file, ctr, 0644) + _ = fscommon.WriteFile(current, cgStCtlFile, ctr) } } // Some controllers might not be enabled when rootless or containerized, diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/devices.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/devices.go index 053ec33e01a6..4c793a1cc1ad 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/devices.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/devices.go @@ -6,11 +6,12 @@ import ( "github.com/opencontainers/runc/libcontainer/cgroups/ebpf" "github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter" "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/runc/libcontainer/devices" "github.com/pkg/errors" "golang.org/x/sys/unix" ) -func isRWM(perms configs.DevicePermissions) bool { +func isRWM(perms devices.Permissions) bool { var r, w, m bool for _, perm := range perms { switch perm { @@ -61,7 +62,7 @@ func setDevices(dirPath string, cgroup *configs.Cgroup) error { // // The real issue is that BPF_F_ALLOW_MULTI makes it hard to have a // race-free blacklist because it acts as a whitelist by default, and - // having a deny-everything program cannot be overriden by other + // having a deny-everything program cannot be overridden by other // programs. You could temporarily insert a deny-everything program // but that would result in spurrious failures during updates. if _, err := ebpf.LoadAttachCgroupDeviceFilter(insts, license, dirFD); err != nil { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/freezer.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/freezer.go index 213ff65a1114..441531fd77d9 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/freezer.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/freezer.go @@ -19,7 +19,7 @@ func setFreezer(dirPath string, state configs.FreezerState) error { // freeze the container (since without the freezer cgroup, that's a // no-op). if state == configs.Undefined || state == configs.Thawed { - err = nil + return nil } return errors.Wrap(err, "freezer not supported") } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go index 7be26211a3dd..3f0b9e0d7e17 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go @@ -3,15 +3,14 @@ package fs2 import ( - "io/ioutil" + "fmt" "os" - "path/filepath" "strings" "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" "github.com/pkg/errors" - "golang.org/x/sys/unix" ) type manager struct { @@ -52,15 +51,14 @@ func (m *manager) getControllers() error { return nil } - file := filepath.Join(m.dirPath, "cgroup.controllers") - data, err := ioutil.ReadFile(file) + data, err := fscommon.ReadFile(m.dirPath, "cgroup.controllers") if err != nil { if m.rootless && m.config.Path == "" { return nil } return err } - fields := strings.Fields(string(data)) + fields := strings.Fields(data) m.controllers = make(map[string]struct{}, len(fields)) for _, c := range fields { m.controllers[c] = struct{}{} @@ -157,45 +155,8 @@ func (m *manager) Freeze(state configs.FreezerState) error { return nil } -func rmdir(path string) error { - err := unix.Rmdir(path) - if err == nil || err == unix.ENOENT { - return nil - } - return &os.PathError{Op: "rmdir", Path: path, Err: err} -} - -// removeCgroupPath aims to remove cgroup path recursively -// Because there may be subcgroups in it. -func removeCgroupPath(path string) error { - // try the fast path first - if err := rmdir(path); err == nil { - return nil - } - - infos, err := ioutil.ReadDir(path) - if err != nil { - if os.IsNotExist(err) { - err = nil - } - return err - } - for _, info := range infos { - if info.IsDir() { - // We should remove subcgroups dir first - if err = removeCgroupPath(filepath.Join(path, info.Name())); err != nil { - break - } - } - } - if err == nil { - err = rmdir(path) - } - return err -} - func (m *manager) Destroy() error { - return removeCgroupPath(m.dirPath) + return cgroups.RemovePath(m.dirPath) } func (m *manager) Path(_ string) string { @@ -245,10 +206,40 @@ func (m *manager) Set(container *configs.Config) error { if err := setFreezer(m.dirPath, container.Cgroups.Freezer); err != nil { return err } + if err := m.setUnified(container.Cgroups.Unified); err != nil { + return err + } m.config = container.Cgroups return nil } +func (m *manager) setUnified(res map[string]string) error { + for k, v := range res { + if strings.Contains(k, "/") { + return fmt.Errorf("unified resource %q must be a file name (no slashes)", k) + } + if err := fscommon.WriteFile(m.dirPath, k, v); err != nil { + errC := errors.Cause(err) + // Check for both EPERM and ENOENT since O_CREAT is used by WriteFile. + if errors.Is(errC, os.ErrPermission) || errors.Is(errC, os.ErrNotExist) { + // Check if a controller is available, + // to give more specific error if not. + sk := strings.SplitN(k, ".", 2) + if len(sk) != 2 { + return fmt.Errorf("unified resource %q must be in the form CONTROLLER.PARAMETER", k) + } + c := sk[0] + if _, ok := m.controllers[c]; !ok && c != "cgroup" { + return fmt.Errorf("unified resource %q can't be set: controller %q not available", k, c) + } + } + return errors.Wrapf(err, "can't set unified resource %q", k) + } + } + + return nil +} + func (m *manager) GetPaths() map[string]string { paths := make(map[string]string, 1) paths[""] = m.dirPath diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go index 4a399aaecd5c..18cd411ce08b 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go @@ -3,10 +3,7 @@ package fs2 import ( - "io/ioutil" - "path/filepath" "strconv" - "strings" "github.com/pkg/errors" @@ -24,7 +21,7 @@ func setHugeTlb(dirPath string, cgroup *configs.Cgroup) error { return nil } for _, hugetlb := range cgroup.Resources.HugetlbLimit { - if err := fscommon.WriteFile(dirPath, strings.Join([]string{"hugetlb", hugetlb.Pagesize, "max"}, "."), strconv.FormatUint(hugetlb.Limit, 10)); err != nil { + if err := fscommon.WriteFile(dirPath, "hugetlb."+hugetlb.Pagesize+".max", strconv.FormatUint(hugetlb.Limit, 10)); err != nil { return err } } @@ -40,22 +37,20 @@ func statHugeTlb(dirPath string, stats *cgroups.Stats) error { hugetlbStats := cgroups.HugetlbStats{} for _, pagesize := range hugePageSizes { - usage := strings.Join([]string{"hugetlb", pagesize, "current"}, ".") - value, err := fscommon.GetCgroupParamUint(dirPath, usage) + value, err := fscommon.GetCgroupParamUint(dirPath, "hugetlb."+pagesize+".current") if err != nil { - return errors.Wrapf(err, "failed to parse hugetlb.%s.current file", pagesize) + return err } hugetlbStats.Usage = value - fileName := strings.Join([]string{"hugetlb", pagesize, "events"}, ".") - filePath := filepath.Join(dirPath, fileName) - contents, err := ioutil.ReadFile(filePath) + fileName := "hugetlb." + pagesize + ".events" + contents, err := fscommon.ReadFile(dirPath, fileName) if err != nil { - return errors.Wrapf(err, "failed to parse hugetlb.%s.events file", pagesize) + return errors.Wrap(err, "failed to read stats") } - _, value, err = fscommon.GetCgroupParamKeyValue(string(contents)) + _, value, err = fscommon.GetCgroupParamKeyValue(contents) if err != nil { - return errors.Wrapf(err, "failed to parse hugetlb.%s.events file", pagesize) + return errors.Wrap(err, "failed to parse "+fileName) } hugetlbStats.Failcnt = value diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go index bbe3ac064b36..e01ea001b352 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go @@ -5,7 +5,6 @@ package fs2 import ( "bufio" "os" - "path/filepath" "strconv" "strings" @@ -60,8 +59,7 @@ func setIo(dirPath string, cgroup *configs.Cgroup) error { func readCgroup2MapFile(dirPath string, name string) (map[string][]string, error) { ret := map[string][]string{} - p := filepath.Join(dirPath, name) - f, err := os.Open(p) + f, err := fscommon.OpenFile(dirPath, name, os.O_RDONLY) if err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go index 51d12c08653f..1c6913bf0f51 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go @@ -5,9 +5,7 @@ package fs2 import ( "bufio" "os" - "path/filepath" "strconv" - "strings" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" @@ -76,7 +74,7 @@ func setMemory(dirPath string, cgroup *configs.Cgroup) error { func statMemory(dirPath string, stats *cgroups.Stats) error { // Set stats from memory.stat. - statsFile, err := os.Open(filepath.Join(dirPath, "memory.stat")) + statsFile, err := fscommon.OpenFile(dirPath, "memory.stat", os.O_RDONLY) if err != nil { return err } @@ -112,10 +110,10 @@ func getMemoryDataV2(path, name string) (cgroups.MemoryData, error) { moduleName := "memory" if name != "" { - moduleName = strings.Join([]string{"memory", name}, ".") + moduleName = "memory." + name } - usage := strings.Join([]string{moduleName, "current"}, ".") - limit := strings.Join([]string{moduleName, "max"}, ".") + usage := moduleName + ".current" + limit := moduleName + ".max" value, err := fscommon.GetCgroupParamUint(path, usage) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go index b8153d283985..16e1c21957ad 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go @@ -3,7 +3,6 @@ package fs2 import ( - "io/ioutil" "path/filepath" "strings" @@ -34,15 +33,15 @@ func setPids(dirPath string, cgroup *configs.Cgroup) error { func statPidsWithoutController(dirPath string, stats *cgroups.Stats) error { // if the controller is not enabled, let's read PIDS from cgroups.procs // (or threads if cgroup.threads is enabled) - contents, err := ioutil.ReadFile(filepath.Join(dirPath, "cgroup.procs")) + contents, err := fscommon.ReadFile(dirPath, "cgroup.procs") if errors.Is(err, unix.ENOTSUP) { - contents, err = ioutil.ReadFile(filepath.Join(dirPath, "cgroup.threads")) + contents, err = fscommon.ReadFile(dirPath, "cgroup.threads") } if err != nil { return err } pids := make(map[string]string) - for _, i := range strings.Split(string(contents), "\n") { + for _, i := range strings.Split(contents, "\n") { if i != "" { pids[i] = i } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go index 46e06dc62d36..ae2613cdbd1e 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/fscommon.go @@ -3,46 +3,47 @@ package fscommon import ( - "io/ioutil" + "bytes" "os" - securejoin "github.com/cyphar/filepath-securejoin" "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) +// WriteFile writes data to a cgroup file in dir. +// It is supposed to be used for cgroup files only. func WriteFile(dir, file, data string) error { - if dir == "" { - return errors.Errorf("no directory specified for %s", file) - } - path, err := securejoin.SecureJoin(dir, file) + fd, err := OpenFile(dir, file, unix.O_WRONLY) if err != nil { return err } - if err := retryingWriteFile(path, []byte(data), 0700); err != nil { - return errors.Wrapf(err, "failed to write %q to %q", data, path) + defer fd.Close() + if err := retryingWriteFile(fd, data); err != nil { + return errors.Wrapf(err, "failed to write %q", data) } return nil } +// ReadFile reads data from a cgroup file in dir. +// It is supposed to be used for cgroup files only. func ReadFile(dir, file string) (string, error) { - if dir == "" { - return "", errors.Errorf("no directory specified for %s", file) - } - path, err := securejoin.SecureJoin(dir, file) + fd, err := OpenFile(dir, file, unix.O_RDONLY) if err != nil { return "", err } - data, err := ioutil.ReadFile(path) - return string(data), err + defer fd.Close() + var buf bytes.Buffer + + _, err = buf.ReadFrom(fd) + return buf.String(), err } -func retryingWriteFile(filename string, data []byte, perm os.FileMode) error { +func retryingWriteFile(fd *os.File, data string) error { for { - err := ioutil.WriteFile(filename, data, perm) + _, err := fd.Write([]byte(data)) if errors.Is(err, unix.EINTR) { - logrus.Infof("interrupted while writing %s to %s", string(data), filename) + logrus.Infof("interrupted while writing %s to %s", data, fd.Name()) continue } return err diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/open.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/open.go new file mode 100644 index 000000000000..0a7e3d952820 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/open.go @@ -0,0 +1,103 @@ +package fscommon + +import ( + "os" + "strings" + "sync" + + securejoin "github.com/cyphar/filepath-securejoin" + "github.com/pkg/errors" + "github.com/sirupsen/logrus" + "golang.org/x/sys/unix" +) + +const ( + cgroupfsDir = "/sys/fs/cgroup" + cgroupfsPrefix = cgroupfsDir + "/" +) + +var ( + // Set to true by fs unit tests + TestMode bool + + cgroupFd int = -1 + prepOnce sync.Once + prepErr error + resolveFlags uint64 +) + +func prepareOpenat2() error { + prepOnce.Do(func() { + fd, err := unix.Openat2(-1, cgroupfsDir, &unix.OpenHow{ + Flags: unix.O_DIRECTORY | unix.O_PATH}) + if err != nil { + prepErr = &os.PathError{Op: "openat2", Path: cgroupfsDir, Err: err} + if err != unix.ENOSYS { + logrus.Warnf("falling back to securejoin: %s", prepErr) + } else { + logrus.Debug("openat2 not available, falling back to securejoin") + } + return + } + var st unix.Statfs_t + if err = unix.Fstatfs(fd, &st); err != nil { + prepErr = &os.PathError{Op: "statfs", Path: cgroupfsDir, Err: err} + logrus.Warnf("falling back to securejoin: %s", prepErr) + return + } + + cgroupFd = fd + + resolveFlags = unix.RESOLVE_BENEATH | unix.RESOLVE_NO_MAGICLINKS + if st.Type == unix.CGROUP2_SUPER_MAGIC { + // cgroupv2 has a single mountpoint and no "cpu,cpuacct" symlinks + resolveFlags |= unix.RESOLVE_NO_XDEV | unix.RESOLVE_NO_SYMLINKS + } + + }) + + return prepErr +} + +// OpenFile opens a cgroup file in a given dir with given flags. +// It is supposed to be used for cgroup files only. +func OpenFile(dir, file string, flags int) (*os.File, error) { + if dir == "" { + return nil, errors.Errorf("no directory specified for %s", file) + } + mode := os.FileMode(0) + if TestMode && flags&os.O_WRONLY != 0 { + // "emulate" cgroup fs for unit tests + flags |= os.O_TRUNC | os.O_CREATE + mode = 0o600 + } + reldir := strings.TrimPrefix(dir, cgroupfsPrefix) + if len(reldir) == len(dir) { // non-standard path, old system? + return openWithSecureJoin(dir, file, flags, mode) + } + if prepareOpenat2() != nil { + return openWithSecureJoin(dir, file, flags, mode) + } + + relname := reldir + "/" + file + fd, err := unix.Openat2(cgroupFd, relname, + &unix.OpenHow{ + Resolve: resolveFlags, + Flags: uint64(flags) | unix.O_CLOEXEC, + Mode: uint64(mode), + }) + if err != nil { + return nil, &os.PathError{Op: "openat2", Path: dir + "/" + file, Err: err} + } + + return os.NewFile(uintptr(fd), cgroupfsPrefix+relname), nil +} + +func openWithSecureJoin(dir, file string, flags int, mode os.FileMode) (*os.File, error) { + path, err := securejoin.SecureJoin(dir, file) + if err != nil { + return nil, err + } + + return os.OpenFile(path, flags, mode) +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go index 46c3c7799ee5..2e4e837f2b8e 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go @@ -5,9 +5,7 @@ package fscommon import ( "errors" "fmt" - "io/ioutil" "math" - "path/filepath" "strconv" "strings" ) @@ -16,8 +14,9 @@ var ( ErrNotValidFormat = errors.New("line is not a valid key value format") ) -// Saturates negative values at zero and returns a uint64. -// Due to kernel bugs, some of the memory cgroup stats can be negative. +// ParseUint converts a string to an uint64 integer. +// Negative values are returned at zero as, due to kernel bugs, +// some of the memory cgroup stats can be negative. func ParseUint(s string, base, bitSize int) (uint64, error) { value, err := strconv.ParseUint(s, base, bitSize) if err != nil { @@ -36,15 +35,16 @@ func ParseUint(s string, base, bitSize int) (uint64, error) { return value, nil } -// Parses a cgroup param and returns as name, value -// i.e. "io_service_bytes 1234" will return as io_service_bytes, 1234 +// GetCgroupParamKeyValue parses a space-separated "name value" kind of cgroup +// parameter and returns its components. For example, "io_service_bytes 1234" +// will return as "io_service_bytes", 1234. func GetCgroupParamKeyValue(t string) (string, uint64, error) { parts := strings.Fields(t) switch len(parts) { case 2: value, err := ParseUint(parts[1], 10, 64) if err != nil { - return "", 0, fmt.Errorf("unable to convert param value (%q) to uint64: %v", parts[1], err) + return "", 0, fmt.Errorf("unable to convert to uint64: %v", err) } return parts[0], value, nil @@ -53,31 +53,50 @@ func GetCgroupParamKeyValue(t string) (string, uint64, error) { } } -// Gets a single uint64 value from the specified cgroup file. -func GetCgroupParamUint(cgroupPath, cgroupFile string) (uint64, error) { - fileName := filepath.Join(cgroupPath, cgroupFile) - contents, err := ioutil.ReadFile(fileName) +// GetCgroupParamUint reads a single uint64 value from the specified cgroup file. +// If the value read is "max", the math.MaxUint64 is returned. +func GetCgroupParamUint(path, file string) (uint64, error) { + contents, err := GetCgroupParamString(path, file) if err != nil { return 0, err } - trimmed := strings.TrimSpace(string(contents)) - if trimmed == "max" { + contents = strings.TrimSpace(contents) + if contents == "max" { return math.MaxUint64, nil } - res, err := ParseUint(trimmed, 10, 64) + res, err := ParseUint(contents, 10, 64) if err != nil { - return res, fmt.Errorf("unable to parse %q as a uint from Cgroup file %q", string(contents), fileName) + return res, fmt.Errorf("unable to parse file %q", path+"/"+file) } return res, nil } -// Gets a string value from the specified cgroup file -func GetCgroupParamString(cgroupPath, cgroupFile string) (string, error) { - contents, err := ioutil.ReadFile(filepath.Join(cgroupPath, cgroupFile)) +// GetCgroupParamInt reads a single int64 value from specified cgroup file. +// If the value read is "max", the math.MaxInt64 is returned. +func GetCgroupParamInt(path, file string) (int64, error) { + contents, err := ReadFile(path, file) + if err != nil { + return 0, err + } + contents = strings.TrimSpace(contents) + if contents == "max" { + return math.MaxInt64, nil + } + + res, err := strconv.ParseInt(contents, 10, 64) + if err != nil { + return res, fmt.Errorf("unable to parse %q as a int from Cgroup file %q", contents, path+"/"+file) + } + return res, nil +} + +// GetCgroupParamString reads a string from the specified cgroup file. +func GetCgroupParamString(path, file string) (string, error) { + contents, err := ReadFile(path, file) if err != nil { return "", err } - return strings.TrimSpace(string(contents)), nil + return strings.TrimSpace(contents), nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go index 7ac81660595e..e7f9c462635c 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go @@ -39,6 +39,33 @@ type CpuStats struct { ThrottlingData ThrottlingData `json:"throttling_data,omitempty"` } +type CPUSetStats struct { + // List of the physical numbers of the CPUs on which processes + // in that cpuset are allowed to execute + CPUs []uint16 `json:"cpus,omitempty"` + // cpu_exclusive flag + CPUExclusive uint64 `json:"cpu_exclusive"` + // List of memory nodes on which processes in that cpuset + // are allowed to allocate memory + Mems []uint16 `json:"mems,omitempty"` + // mem_hardwall flag + MemHardwall uint64 `json:"mem_hardwall"` + // mem_exclusive flag + MemExclusive uint64 `json:"mem_exclusive"` + // memory_migrate flag + MemoryMigrate uint64 `json:"memory_migrate"` + // memory_spread page flag + MemorySpreadPage uint64 `json:"memory_spread_page"` + // memory_spread slab flag + MemorySpreadSlab uint64 `json:"memory_spread_slab"` + // memory_pressure + MemoryPressure uint64 `json:"memory_pressure"` + // sched_load balance flag + SchedLoadBalance uint64 `json:"sched_load_balance"` + // sched_relax_domain_level + SchedRelaxDomainLevel int64 `json:"sched_relax_domain_level"` +} + type MemoryData struct { Usage uint64 `json:"usage,omitempty"` MaxUsage uint64 `json:"max_usage,omitempty"` @@ -121,6 +148,7 @@ type HugetlbStats struct { type Stats struct { CpuStats CpuStats `json:"cpu_stats,omitempty"` + CPUSetStats CPUSetStats `json:"cpuset_stats,omitempty"` MemoryStats MemoryStats `json:"memory_stats,omitempty"` PidsStats PidsStats `json:"pids_stats,omitempty"` BlkioStats BlkioStats `json:"blkio_stats,omitempty"` diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go index b567f3e1fcb0..6d5def71257c 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go @@ -13,12 +13,20 @@ import ( systemdDbus "github.com/coreos/go-systemd/v22/dbus" dbus "github.com/godbus/dbus/v5" - "github.com/opencontainers/runc/libcontainer/cgroups/devices" + cgroupdevices "github.com/opencontainers/runc/libcontainer/cgroups/devices" "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/runc/libcontainer/devices" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) +const ( + // Default kernel value for cpu quota period is 100000 us (100 ms), same for v1 and v2. + // v1: https://www.kernel.org/doc/html/latest/scheduler/sched-bwc.html and + // v2: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html + defCPUQuotaPeriod = uint64(100000) +) + var ( connOnce sync.Once connDbus *systemdDbus.Conn @@ -26,7 +34,6 @@ var ( versionOnce sync.Once version int - versionErr error isRunningSystemdOnce sync.Once isRunningSystemd bool @@ -81,11 +88,11 @@ func ExpandSlice(slice string) (string, error) { return path, nil } -func groupPrefix(ruleType configs.DeviceType) (string, error) { +func groupPrefix(ruleType devices.Type) (string, error) { switch ruleType { - case configs.BlockDevice: + case devices.BlockDevice: return "block-", nil - case configs.CharDevice: + case devices.CharDevice: return "char-", nil default: return "", errors.Errorf("device type %v has no group prefix", ruleType) @@ -93,10 +100,10 @@ func groupPrefix(ruleType configs.DeviceType) (string, error) { } // findDeviceGroup tries to find the device group name (as listed in -// /proc/devices) with the type prefixed as requried for DeviceAllow, for a +// /proc/devices) with the type prefixed as required for DeviceAllow, for a // given (type, major) combination. If more than one device group exists, an // arbitrary one is chosen. -func findDeviceGroup(ruleType configs.DeviceType, ruleMajor int64) (string, error) { +func findDeviceGroup(ruleType devices.Type, ruleMajor int64) (string, error) { fh, err := os.Open("/proc/devices") if err != nil { return "", err @@ -109,7 +116,7 @@ func findDeviceGroup(ruleType configs.DeviceType, ruleMajor int64) (string, erro } scanner := bufio.NewScanner(fh) - var currentType configs.DeviceType + var currentType devices.Type for scanner.Scan() { // We need to strip spaces because the first number is column-aligned. line := strings.TrimSpace(scanner.Text()) @@ -117,10 +124,10 @@ func findDeviceGroup(ruleType configs.DeviceType, ruleMajor int64) (string, erro // Handle the "header" lines. switch line { case "Block devices:": - currentType = configs.BlockDevice + currentType = devices.BlockDevice continue case "Character devices:": - currentType = configs.CharDevice + currentType = devices.CharDevice continue case "": continue @@ -156,7 +163,7 @@ func findDeviceGroup(ruleType configs.DeviceType, ruleMajor int64) (string, erro // generateDeviceProperties takes the configured device rules and generates a // corresponding set of systemd properties to configure the devices correctly. -func generateDeviceProperties(rules []*configs.DeviceRule) ([]systemdDbus.Property, error) { +func generateDeviceProperties(rules []*devices.Rule) ([]systemdDbus.Property, error) { // DeviceAllow is the type "a(ss)" which means we need a temporary struct // to represent it in Go. type deviceAllowEntry struct { @@ -172,7 +179,7 @@ func generateDeviceProperties(rules []*configs.DeviceRule) ([]systemdDbus.Proper } // Figure out the set of rules. - configEmu := &devices.Emulator{} + configEmu := &cgroupdevices.Emulator{} for _, rule := range rules { if err := configEmu.Apply(*rule); err != nil { return nil, errors.Wrap(err, "apply rule for systemd") @@ -199,7 +206,7 @@ func generateDeviceProperties(rules []*configs.DeviceRule) ([]systemdDbus.Proper // Now generate the set of rules we actually need to apply. Unlike the // normal devices cgroup, in "strict" mode systemd defaults to a deny-all // whitelist which is the default for devices.Emulator. - baseEmu := &devices.Emulator{} + baseEmu := &cgroupdevices.Emulator{} finalRules, err := baseEmu.Transition(configEmu) if err != nil { return nil, errors.Wrap(err, "get simplified rules for systemd") @@ -211,7 +218,7 @@ func generateDeviceProperties(rules []*configs.DeviceRule) ([]systemdDbus.Proper return nil, errors.Errorf("[internal error] cannot add deny rule to systemd DeviceAllow list: %v", *rule) } switch rule.Type { - case configs.BlockDevice, configs.CharDevice: + case devices.BlockDevice, devices.CharDevice: default: // Should never happen. return nil, errors.Errorf("invalid device type for DeviceAllow: %v", rule.Type) @@ -243,9 +250,9 @@ func generateDeviceProperties(rules []*configs.DeviceRule) ([]systemdDbus.Proper // so we'll give a warning in that case (note that the fallback code // will insert any rules systemd couldn't handle). What amazing fun. - if rule.Major == configs.Wildcard { + if rule.Major == devices.Wildcard { // "_ *:n _" rules aren't supported by systemd. - if rule.Minor != configs.Wildcard { + if rule.Minor != devices.Wildcard { logrus.Warnf("systemd doesn't support '*:n' device rules -- temporarily ignoring rule: %v", *rule) continue } @@ -256,7 +263,7 @@ func generateDeviceProperties(rules []*configs.DeviceRule) ([]systemdDbus.Proper return nil, err } entry.Path = prefix + "*" - } else if rule.Minor == configs.Wildcard { + } else if rule.Minor == devices.Wildcard { // "_ n:* _" rules require a device group from /proc/devices. group, err := findDeviceGroup(rule.Type, rule.Major) if err != nil { @@ -271,9 +278,9 @@ func generateDeviceProperties(rules []*configs.DeviceRule) ([]systemdDbus.Proper } else { // "_ n:m _" rules are just a path in /dev/{block,char}/. switch rule.Type { - case configs.BlockDevice: + case devices.BlockDevice: entry.Path = fmt.Sprintf("/dev/block/%d:%d", rule.Major, rule.Minor) - case configs.CharDevice: + case devices.CharDevice: entry.Path = fmt.Sprintf("/dev/char/%d:%d", rule.Major, rule.Minor) } } @@ -307,7 +314,7 @@ func newProp(name string, units interface{}) systemdDbus.Property { func getUnitName(c *configs.Cgroup) string { // by default, we create a scope unless the user explicitly asks for a slice. if !strings.HasSuffix(c.Name, ".slice") { - return fmt.Sprintf("%s-%s.scope", c.ScopePrefix, c.Name) + return c.ScopePrefix + "-" + c.Name + ".scope" } return c.Name } @@ -325,6 +332,9 @@ func isUnitExists(err error) bool { func startUnit(dbusConnection *systemdDbus.Conn, unitName string, properties []systemdDbus.Property) error { statusChan := make(chan string, 1) if _, err := dbusConnection.StartTransientUnit(unitName, "replace", properties, statusChan); err == nil { + timeout := time.NewTimer(30 * time.Second) + defer timeout.Stop() + select { case s := <-statusChan: close(statusChan) @@ -333,8 +343,9 @@ func startUnit(dbusConnection *systemdDbus.Conn, unitName string, properties []s dbusConnection.ResetFailedUnit(unitName) return errors.Errorf("error creating systemd unit `%s`: got `%s`", unitName, s) } - case <-time.After(time.Second): - logrus.Warnf("Timed out while waiting for StartTransientUnit(%s) completion signal from dbus. Continuing...", unitName) + case <-timeout.C: + dbusConnection.ResetFailedUnit(unitName) + return errors.New("Timeout waiting for systemd to create " + unitName) } } else if !isUnitExists(err) { return err @@ -360,20 +371,20 @@ func stopUnit(dbusConnection *systemdDbus.Conn, unitName string) error { return nil } -func systemdVersion(conn *systemdDbus.Conn) (int, error) { +func systemdVersion(conn *systemdDbus.Conn) int { versionOnce.Do(func() { version = -1 verStr, err := conn.GetManagerProperty("Version") - if err != nil { - versionErr = err - return + if err == nil { + version, err = systemdVersionAtoi(verStr) } - version, versionErr = systemdVersionAtoi(verStr) - return + if err != nil { + logrus.WithError(err).Error("unable to get systemd version") + } }) - return version, versionErr + return version } func systemdVersionAtoi(verStr string) (int, error) { @@ -394,12 +405,13 @@ func systemdVersionAtoi(verStr string) (int, error) { func addCpuQuota(conn *systemdDbus.Conn, properties *[]systemdDbus.Property, quota int64, period uint64) { if period != 0 { // systemd only supports CPUQuotaPeriodUSec since v242 - sdVer, err := systemdVersion(conn) - if err != nil { - logrus.Warnf("systemdVersion: %s", err) - } else if sdVer >= 242 { + sdVer := systemdVersion(conn) + if sdVer >= 242 { *properties = append(*properties, newProp("CPUQuotaPeriodUSec", period)) + } else { + logrus.Debugf("systemd v%d is too old to support CPUQuotaPeriodSec "+ + " (setting will still be applied to cgroupfs)", sdVer) } } if quota != 0 || period != 0 { @@ -407,10 +419,8 @@ func addCpuQuota(conn *systemdDbus.Conn, properties *[]systemdDbus.Property, quo cpuQuotaPerSecUSec := uint64(math.MaxUint64) if quota > 0 { if period == 0 { - // assume the default kernel value of 100000 us (100 ms), same for v1 and v2. - // v1: https://www.kernel.org/doc/html/latest/scheduler/sched-bwc.html and - // v2: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html - period = 100000 + // assume the default + period = defCPUQuotaPeriod } // systemd converts CPUQuotaPerSecUSec (microseconds per CPU second) to CPUQuota // (integer percentage of CPU) internally. This means that if a fractional percent of @@ -425,3 +435,37 @@ func addCpuQuota(conn *systemdDbus.Conn, properties *[]systemdDbus.Property, quo newProp("CPUQuotaPerSecUSec", cpuQuotaPerSecUSec)) } } + +func addCpuset(conn *systemdDbus.Conn, props *[]systemdDbus.Property, cpus, mems string) error { + if cpus == "" && mems == "" { + return nil + } + + // systemd only supports AllowedCPUs/AllowedMemoryNodes since v244 + sdVer := systemdVersion(conn) + if sdVer < 244 { + logrus.Debugf("systemd v%d is too old to support AllowedCPUs/AllowedMemoryNodes"+ + " (settings will still be applied to cgroupfs)", sdVer) + return nil + } + + if cpus != "" { + bits, err := rangeToBits(cpus) + if err != nil { + return fmt.Errorf("resources.CPU.Cpus=%q conversion error: %w", + cpus, err) + } + *props = append(*props, + newProp("AllowedCPUs", bits)) + } + if mems != "" { + bits, err := rangeToBits(mems) + if err != nil { + return fmt.Errorf("resources.CPU.Mems=%q conversion error: %w", + mems, err) + } + *props = append(*props, + newProp("AllowedMemoryNodes", bits)) + } + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/cpuset.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/cpuset.go new file mode 100644 index 000000000000..070982188831 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/cpuset.go @@ -0,0 +1,67 @@ +package systemd + +import ( + "encoding/binary" + "strconv" + "strings" + + "github.com/pkg/errors" + "github.com/willf/bitset" +) + +// rangeToBits converts a text representation of a CPU mask (as written to +// or read from cgroups' cpuset.* files, e.g. "1,3-5") to a slice of bytes +// with the corresponding bits set (as consumed by systemd over dbus as +// AllowedCPUs/AllowedMemoryNodes unit property value). +func rangeToBits(str string) ([]byte, error) { + bits := &bitset.BitSet{} + + for _, r := range strings.Split(str, ",") { + // allow extra spaces around + r = strings.TrimSpace(r) + // allow empty elements (extra commas) + if r == "" { + continue + } + ranges := strings.SplitN(r, "-", 2) + if len(ranges) > 1 { + start, err := strconv.ParseUint(ranges[0], 10, 32) + if err != nil { + return nil, err + } + end, err := strconv.ParseUint(ranges[1], 10, 32) + if err != nil { + return nil, err + } + if start > end { + return nil, errors.New("invalid range: " + r) + } + for i := uint(start); i <= uint(end); i++ { + bits.Set(i) + } + } else { + val, err := strconv.ParseUint(ranges[0], 10, 32) + if err != nil { + return nil, err + } + bits.Set(uint(val)) + } + } + + val := bits.Bytes() + if len(val) == 0 { + // do not allow empty values + return nil, errors.New("empty value") + } + ret := make([]byte, len(val)*8) + for i := range val { + // bitset uses BigEndian internally + binary.BigEndian.PutUint64(ret[i*8:], val[len(val)-1-i]) + } + // remove upper all-zero bytes + for ret[0] == 0 { + ret = ret[1:] + } + + return ret, nil +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go index cb070cec8b72..8fe91688477b 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go @@ -57,7 +57,7 @@ func DetectUID() (int, error) { } b, err := exec.Command("busctl", "--user", "--no-pager", "status").CombinedOutput() if err != nil { - return -1, errors.Wrap(err, "could not execute `busctl --user --no-pager status`") + return -1, errors.Wrapf(err, "could not execute `busctl --user --no-pager status`: %q", string(b)) } scanner := bufio.NewScanner(bytes.NewReader(b)) for scanner.Scan() { @@ -102,5 +102,5 @@ func DetectUserDbusSessionBusAddress() (string, error) { return strings.TrimPrefix(s, "DBUS_SESSION_BUS_ADDRESS="), nil } } - return "", errors.New("could not detect DBUS_SESSION_BUS_ADDRESS from `systemctl --user --no-pager show-environment`") + return "", errors.New("could not detect DBUS_SESSION_BUS_ADDRESS from `systemctl --user --no-pager show-environment`. Make sure you have installed the dbus-user-session or dbus-daemon package and then run: `systemctl --user start dbus`") } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go index 7217b0af79cb..64af1d94b3e3 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go @@ -4,7 +4,6 @@ package systemd import ( "errors" - "io/ioutil" "os" "path/filepath" "strings" @@ -13,6 +12,7 @@ import ( systemdDbus "github.com/coreos/go-systemd/v22/dbus" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fs" + "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" "github.com/sirupsen/logrus" ) @@ -90,6 +90,11 @@ func genV1ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]syst newProp("TasksMax", uint64(r.PidsLimit))) } + err = addCpuset(conn, &properties, r.CpusetCpus, r.CpusetMems) + if err != nil { + return nil, err + } + return properties, nil } @@ -101,20 +106,23 @@ func (m *legacyManager) Apply(pid int) error { properties []systemdDbus.Property ) + if c.Resources.Unified != nil { + return cgroups.ErrV1NoUnified + } + m.mu.Lock() defer m.mu.Unlock() if c.Paths != nil { paths := make(map[string]string) + cgMap, err := cgroups.ParseCgroupFile("/proc/self/cgroup") + if err != nil { + return err + } + // XXX(kolyshkin@): why this check is needed? for name, path := range c.Paths { - _, err := getSubsystemPath(m.cgroups, name) - if err != nil { - // Don't fail if a cgroup hierarchy was not found, just skip this subsystem - if cgroups.IsNotFound(err) { - continue - } - return err + if _, ok := cgMap[name]; ok { + paths[name] = path } - paths[name] = path } m.paths = paths return cgroups.EnterPid(m.paths, pid) @@ -179,14 +187,16 @@ func (m *legacyManager) Apply(pid int) error { return err } - if err := joinCgroups(c, pid); err != nil { - return err - } - paths := make(map[string]string) for _, s := range legacySubsystems { subsystemPath, err := getSubsystemPath(m.cgroups, s.Name()) if err != nil { + // Even if it's `not found` error, we'll return err + // because devices cgroup is hard requirement for + // container security. + if s.Name() == "devices" { + return err + } // Don't fail if a cgroup hierarchy was not found, just skip this subsystem if cgroups.IsNotFound(err) { continue @@ -196,6 +206,11 @@ func (m *legacyManager) Apply(pid int) error { paths[s.Name()] = subsystemPath } m.paths = paths + + if err := m.joinCgroups(pid); err != nil { + return err + } + return nil } @@ -212,17 +227,14 @@ func (m *legacyManager) Destroy() error { } unitName := getUnitName(m.cgroups) - err = stopUnit(dbusConnection, unitName) + stopErr := stopUnit(dbusConnection, unitName) // Both on success and on error, cleanup all the cgroups we are aware of. // Some of them were created directly by Apply() and are not managed by systemd. if err := cgroups.RemovePaths(m.paths); err != nil { return err } - if err != nil { - return err - } - m.paths = make(map[string]string) - return nil + + return stopErr } func (m *legacyManager) Path(subsys string) string { @@ -231,48 +243,25 @@ func (m *legacyManager) Path(subsys string) string { return m.paths[subsys] } -func join(c *configs.Cgroup, subsystem string, pid int) (string, error) { - path, err := getSubsystemPath(c, subsystem) - if err != nil { - return "", err - } - - if err := os.MkdirAll(path, 0755); err != nil { - return "", err - } - if err := cgroups.WriteCgroupProc(path, pid); err != nil { - return "", err - } - return path, nil -} - -func joinCgroups(c *configs.Cgroup, pid int) error { +func (m *legacyManager) joinCgroups(pid int) error { for _, sys := range legacySubsystems { name := sys.Name() switch name { case "name=systemd": // let systemd handle this case "cpuset": - path, err := getSubsystemPath(c, name) - if err != nil && !cgroups.IsNotFound(err) { - return err - } - s := &fs.CpusetGroup{} - if err := s.ApplyDir(path, c, pid); err != nil { - return err + if path, ok := m.paths[name]; ok { + s := &fs.CpusetGroup{} + if err := s.ApplyDir(path, m.cgroups, pid); err != nil { + return err + } } default: - _, err := join(c, name, pid) - if err != nil { - // Even if it's `not found` error, we'll return err - // because devices cgroup is hard requirement for - // container security. - if name == "devices" { + if path, ok := m.paths[name]; ok { + if err := os.MkdirAll(path, 0755); err != nil { return err } - // For other subsystems, omit the `not found` error - // because they are optional. - if !cgroups.IsNotFound(err) { + if err := cgroups.WriteCgroupProc(path, pid); err != nil { return err } } @@ -283,7 +272,7 @@ func joinCgroups(c *configs.Cgroup, pid int) error { } func getSubsystemPath(c *configs.Cgroup, subsystem string) (string, error) { - mountpoint, err := cgroups.FindCgroupMountpoint(c.Path, subsystem) + mountpoint, err := cgroups.FindCgroupMountpoint("", subsystem) if err != nil { return "", err } @@ -309,15 +298,14 @@ func getSubsystemPath(c *configs.Cgroup, subsystem string) (string, error) { } func (m *legacyManager) Freeze(state configs.FreezerState) error { - path, err := getSubsystemPath(m.cgroups, "freezer") - if err != nil { - return err + path, ok := m.paths["freezer"] + if !ok { + return errSubsystemDoesNotExist } prevState := m.cgroups.Resources.Freezer m.cgroups.Resources.Freezer = state freezer := &fs.FreezerGroup{} - err = freezer.Set(path, m.cgroups) - if err != nil { + if err := freezer.Set(path, m.cgroups); err != nil { m.cgroups.Resources.Freezer = prevState return err } @@ -325,17 +313,17 @@ func (m *legacyManager) Freeze(state configs.FreezerState) error { } func (m *legacyManager) GetPids() ([]int, error) { - path, err := getSubsystemPath(m.cgroups, "devices") - if err != nil { - return nil, err + path, ok := m.paths["devices"] + if !ok { + return nil, errSubsystemDoesNotExist } return cgroups.GetPids(path) } func (m *legacyManager) GetAllPids() ([]int, error) { - path, err := getSubsystemPath(m.cgroups, "devices") - if err != nil { - return nil, err + path, ok := m.paths["devices"] + if !ok { + return nil, errSubsystemDoesNotExist } return cgroups.GetAllPids(path) } @@ -363,6 +351,9 @@ func (m *legacyManager) Set(container *configs.Config) error { if m.cgroups.Paths != nil { return nil } + if container.Cgroups.Resources.Unified != nil { + return cgroups.ErrV1NoUnified + } dbusConnection, err := getDbusConnection(false) if err != nil { return err @@ -406,9 +397,9 @@ func (m *legacyManager) Set(container *configs.Config) error { for _, sys := range legacySubsystems { // Get the subsystem path, but don't error out for not found cgroups. - path, err := getSubsystemPath(container.Cgroups, sys.Name()) - if err != nil && !cgroups.IsNotFound(err) { - return err + path, ok := m.paths[sys.Name()] + if !ok { + continue } if err := sys.Set(path, container.Cgroups); err != nil { return err @@ -420,7 +411,10 @@ func (m *legacyManager) Set(container *configs.Config) error { func enableKmem(c *configs.Cgroup) error { path, err := getSubsystemPath(c, "memory") - if err != nil && !cgroups.IsNotFound(err) { + if err != nil { + if cgroups.IsNotFound(err) { + return nil + } return err } @@ -429,7 +423,7 @@ func enableKmem(c *configs.Cgroup) error { } // do not try to enable the kernel memory if we already have // tasks in the cgroup. - content, err := ioutil.ReadFile(filepath.Join(path, "tasks")) + content, err := fscommon.ReadFile(path, "tasks") if err != nil { return err } @@ -450,9 +444,9 @@ func (m *legacyManager) GetCgroups() (*configs.Cgroup, error) { } func (m *legacyManager) GetFreezerState() (configs.FreezerState, error) { - path, err := getSubsystemPath(m.cgroups, "freezer") - if err != nil && !cgroups.IsNotFound(err) { - return configs.Undefined, err + path, ok := m.paths["freezer"] + if !ok { + return configs.Undefined, nil } freezer := &fs.FreezerGroup{} return freezer.GetState(path) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go index e1a6622a0d3d..70b5b368e862 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go @@ -3,6 +3,8 @@ package systemd import ( + "fmt" + "math" "os" "path/filepath" "strconv" @@ -34,6 +36,133 @@ func NewUnifiedManager(config *configs.Cgroup, path string, rootless bool) cgrou } } +// unifiedResToSystemdProps tries to convert from Cgroup.Resources.Unified +// key/value map (where key is cgroupfs file name) to systemd unit properties. +// This is on a best-effort basis, so the properties that are not known +// (to this function and/or systemd) are ignored (but logged with "debug" +// log level). +// +// For the list of keys, see https://www.kernel.org/doc/Documentation/cgroup-v2.txt +// +// For the list of systemd unit properties, see systemd.resource-control(5). +func unifiedResToSystemdProps(conn *systemdDbus.Conn, res map[string]string) (props []systemdDbus.Property, _ error) { + var err error + + for k, v := range res { + if strings.Contains(k, "/") { + return nil, fmt.Errorf("unified resource %q must be a file name (no slashes)", k) + } + sk := strings.SplitN(k, ".", 2) + if len(sk) != 2 { + return nil, fmt.Errorf("unified resource %q must be in the form CONTROLLER.PARAMETER", k) + } + // Kernel is quite forgiving to extra whitespace + // around the value, and so should we. + v = strings.TrimSpace(v) + // Please keep cases in alphabetical order. + switch k { + case "cpu.max": + // value: quota [period] + quota := int64(0) // 0 means "unlimited" for addCpuQuota, if period is set + period := defCPUQuotaPeriod + sv := strings.Fields(v) + if len(sv) < 1 || len(sv) > 2 { + return nil, fmt.Errorf("unified resource %q value invalid: %q", k, v) + } + // quota + if sv[0] != "max" { + quota, err = strconv.ParseInt(sv[0], 10, 64) + if err != nil { + return nil, fmt.Errorf("unified resource %q period value conversion error: %w", k, err) + } + } + // period + if len(sv) == 2 { + period, err = strconv.ParseUint(sv[1], 10, 64) + if err != nil { + return nil, fmt.Errorf("unified resource %q quota value conversion error: %w", k, err) + } + } + addCpuQuota(conn, &props, quota, period) + + case "cpu.weight": + num, err := strconv.ParseUint(v, 10, 64) + if err != nil { + return nil, fmt.Errorf("unified resource %q value conversion error: %w", k, err) + } + props = append(props, + newProp("CPUWeight", num)) + + case "cpuset.cpus", "cpuset.mems": + bits, err := rangeToBits(v) + if err != nil { + return nil, fmt.Errorf("unified resource %q=%q conversion error: %w", k, v, err) + } + m := map[string]string{ + "cpuset.cpus": "AllowedCPUs", + "cpuset.mems": "AllowedMemoryNodes", + } + // systemd only supports these properties since v244 + sdVer := systemdVersion(conn) + if sdVer >= 244 { + props = append(props, + newProp(m[k], bits)) + } else { + logrus.Debugf("systemd v%d is too old to support %s"+ + " (setting will still be applied to cgroupfs)", + sdVer, m[k]) + } + + case "memory.high", "memory.low", "memory.min", "memory.max", "memory.swap.max": + num := uint64(math.MaxUint64) + if v != "max" { + num, err = strconv.ParseUint(v, 10, 64) + if err != nil { + return nil, fmt.Errorf("unified resource %q value conversion error: %w", k, err) + } + } + m := map[string]string{ + "memory.high": "MemoryHigh", + "memory.low": "MemoryLow", + "memory.min": "MemoryMin", + "memory.max": "MemoryMax", + "memory.swap.max": "MemorySwapMax", + } + props = append(props, + newProp(m[k], num)) + + case "pids.max": + num := uint64(math.MaxUint64) + if v != "max" { + var err error + num, err = strconv.ParseUint(v, 10, 64) + if err != nil { + return nil, fmt.Errorf("unified resource %q value conversion error: %w", k, err) + } + } + props = append(props, + newProp("TasksAccounting", true), + newProp("TasksMax", num)) + + case "memory.oom.group": + // Setting this to 1 is roughly equivalent to OOMPolicy=kill + // (as per systemd.service(5) and + // https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html), + // but it's not clear what to do if it is unset or set + // to 0 in runc update, as there are two other possible + // values for OOMPolicy (continue/stop). + fallthrough + + default: + // Ignore the unknown resource here -- will still be + // applied in Set which calls fs2.Set. + logrus.Debugf("don't know how to convert unified resource %q=%q to systemd unit property; skipping (will still be applied to cgroupfs)", k, v) + } + } + + return props, nil +} + func genV2ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]systemdDbus.Property, error) { var properties []systemdDbus.Property r := c.Resources @@ -80,8 +209,22 @@ func genV2ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]syst newProp("TasksMax", uint64(r.PidsLimit))) } + err = addCpuset(conn, &properties, r.CpusetCpus, r.CpusetMems) + if err != nil { + return nil, err + } + // ignore r.KernelMemory + // convert Resources.Unified map to systemd properties + if r.Unified != nil { + unifiedProps, err := unifiedResToSystemdProps(conn, r.Unified) + if err != nil { + return nil, err + } + properties = append(properties, unifiedProps...) + } + return properties, nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go index 6e88b5dff6ff..840817e398a8 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go @@ -15,7 +15,9 @@ import ( "sync" "time" - units "github.com/docker/go-units" + "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" + "github.com/opencontainers/runc/libcontainer/system" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -29,19 +31,19 @@ var ( isUnified bool ) -// HugePageSizeUnitList is a list of the units used by the linux kernel when -// naming the HugePage control files. -// https://www.kernel.org/doc/Documentation/cgroup-v1/hugetlb.txt -// TODO Since the kernel only use KB, MB and GB; TB and PB should be removed, -// depends on https://github.com/docker/go-units/commit/a09cd47f892041a4fac473133d181f5aea6fa393 -var HugePageSizeUnitList = []string{"B", "KB", "MB", "GB", "TB", "PB"} - // IsCgroup2UnifiedMode returns whether we are running in cgroup v2 unified mode. func IsCgroup2UnifiedMode() bool { isUnifiedOnce.Do(func() { var st unix.Statfs_t - if err := unix.Statfs(unifiedMountpoint, &st); err != nil { - panic("cannot statfs cgroup root") + err := unix.Statfs(unifiedMountpoint, &st) + if err != nil { + if os.IsNotExist(err) && system.RunningInUserNS() { + // ignore the "not found" error if running in userns + logrus.WithError(err).Debugf("%s missing, assuming cgroup v1", unifiedMountpoint) + isUnified = false + return + } + panic(fmt.Sprintf("cannot statfs cgroup root: %s", err)) } isUnified = st.Type == unix.CGROUP2_SUPER_MAGIC }) @@ -86,11 +88,11 @@ func GetAllSubsystems() ([]string, error) { // - freezer: implemented in kernel 5.2 // We assume these are always available, as it is hard to detect availability. pseudo := []string{"devices", "freezer"} - data, err := ioutil.ReadFile("/sys/fs/cgroup/cgroup.controllers") + data, err := fscommon.ReadFile("/sys/fs/cgroup", "cgroup.controllers") if err != nil { return nil, err } - subsystems := append(pseudo, strings.Fields(string(data))...) + subsystems := append(pseudo, strings.Fields(data)...) return subsystems, nil } f, err := os.Open("/proc/cgroups") @@ -207,20 +209,66 @@ func EnterPid(cgroupPaths map[string]string, pid int) error { return nil } +func rmdir(path string) error { + err := unix.Rmdir(path) + if err == nil || err == unix.ENOENT { + return nil + } + return &os.PathError{Op: "rmdir", Path: path, Err: err} +} + +// RemovePath aims to remove cgroup path. It does so recursively, +// by removing any subdirectories (sub-cgroups) first. +func RemovePath(path string) error { + // try the fast path first + if err := rmdir(path); err == nil { + return nil + } + + infos, err := ioutil.ReadDir(path) + if err != nil { + if os.IsNotExist(err) { + err = nil + } + return err + } + for _, info := range infos { + if info.IsDir() { + // We should remove subcgroups dir first + if err = RemovePath(filepath.Join(path, info.Name())); err != nil { + break + } + } + } + if err == nil { + err = rmdir(path) + } + return err +} + // RemovePaths iterates over the provided paths removing them. // We trying to remove all paths five times with increasing delay between tries. // If after all there are not removed cgroups - appropriate error will be // returned. func RemovePaths(paths map[string]string) (err error) { + const retries = 5 delay := 10 * time.Millisecond - for i := 0; i < 5; i++ { + for i := 0; i < retries; i++ { if i != 0 { time.Sleep(delay) delay *= 2 } for s, p := range paths { - os.RemoveAll(p) - // TODO: here probably should be logging + if err := RemovePath(p); err != nil { + // do not log intermediate iterations + switch i { + case 0: + logrus.WithError(err).Warnf("Failed to remove cgroup (will retry)") + case retries - 1: + logrus.WithError(err).Error("Failed to remove cgroup") + } + + } _, err := os.Stat(p) // We need this strange way of checking cgroups existence because // RemoveAll almost always returns error, even on already removed @@ -230,6 +278,8 @@ func RemovePaths(paths map[string]string) (err error) { } } if len(paths) == 0 { + //nolint:ineffassign,staticcheck // done to help garbage collecting: opencontainers/runc#2506 + paths = make(map[string]string) return nil } } @@ -237,27 +287,50 @@ func RemovePaths(paths map[string]string) (err error) { } func GetHugePageSize() ([]string, error) { - files, err := ioutil.ReadDir("/sys/kernel/mm/hugepages") + dir, err := os.OpenFile("/sys/kernel/mm/hugepages", unix.O_DIRECTORY|unix.O_RDONLY, 0) if err != nil { - return []string{}, err + return nil, err } - var fileNames []string - for _, st := range files { - fileNames = append(fileNames, st.Name()) + files, err := dir.Readdirnames(0) + dir.Close() + if err != nil { + return nil, err } - return getHugePageSizeFromFilenames(fileNames) + + return getHugePageSizeFromFilenames(files) } func getHugePageSizeFromFilenames(fileNames []string) ([]string, error) { - var pageSizes []string - for _, fileName := range fileNames { - nameArray := strings.Split(fileName, "-") - pageSize, err := units.RAMInBytes(nameArray[1]) + pageSizes := make([]string, 0, len(fileNames)) + + for _, file := range fileNames { + // example: hugepages-1048576kB + val := strings.TrimPrefix(file, "hugepages-") + if len(val) == len(file) { + // unexpected file name: no prefix found + continue + } + // The suffix is always "kB" (as of Linux 5.9) + eLen := len(val) - 2 + val = strings.TrimSuffix(val, "kB") + if len(val) != eLen { + logrus.Warnf("GetHugePageSize: %s: invalid filename suffix (expected \"kB\")", file) + continue + } + size, err := strconv.Atoi(val) if err != nil { - return []string{}, err + return nil, err + } + // Model after https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/hugetlb_cgroup.c?id=eff48ddeab782e35e58ccc8853f7386bbae9dec4#n574 + // but in our case the size is in KB already. + if size >= (1 << 20) { + val = strconv.Itoa(size>>20) + "GB" + } else if size >= (1 << 10) { + val = strconv.Itoa(size>>10) + "MB" + } else { + val += "KB" } - sizeString := units.CustomSize("%g%s", float64(pageSize), 1024.0, HugePageSizeUnitList) - pageSizes = append(pageSizes, sizeString) + pageSizes = append(pageSizes, val) } return pageSizes, nil @@ -303,14 +376,14 @@ func WriteCgroupProc(dir string, pid int) error { return nil } - cgroupProcessesFile, err := os.OpenFile(filepath.Join(dir, CgroupProcesses), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0700) + file, err := fscommon.OpenFile(dir, CgroupProcesses, os.O_WRONLY) if err != nil { return fmt.Errorf("failed to write %v to %v: %v", pid, CgroupProcesses, err) } - defer cgroupProcessesFile.Close() + defer file.Close() for i := 0; i < 5; i++ { - _, err = cgroupProcessesFile.WriteString(strconv.Itoa(pid)) + _, err = file.WriteString(strconv.Itoa(pid)) if err == nil { return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/v1_utils.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/v1_utils.go index a94f208616e5..95ec9dff0284 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/v1_utils.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/v1_utils.go @@ -1,16 +1,16 @@ package cgroups import ( - "bufio" "errors" "fmt" - "io" "os" "path/filepath" "strings" + "sync" "syscall" securejoin "github.com/cyphar/filepath-securejoin" + "github.com/moby/sys/mountinfo" "golang.org/x/sys/unix" ) @@ -23,7 +23,12 @@ const ( ) var ( - errUnified = errors.New("not implemented for cgroup v2 unified hierarchy") + errUnified = errors.New("not implemented for cgroup v2 unified hierarchy") + ErrV1NoUnified = errors.New("invalid configuration: cannot use unified on cgroup v1") + + readMountinfoOnce sync.Once + readMountinfoErr error + cgroupMountinfo []*mountinfo.Info ) type NotFoundError struct { @@ -90,6 +95,21 @@ func tryDefaultPath(cgroupPath, subsystem string) string { return path } +// readCgroupMountinfo returns a list of cgroup v1 mounts (i.e. the ones +// with fstype of "cgroup") for the current running process. +// +// The results are cached (to avoid re-reading mountinfo which is relatively +// expensive), so it is assumed that cgroup mounts are not being changed. +func readCgroupMountinfo() ([]*mountinfo.Info, error) { + readMountinfoOnce.Do(func() { + cgroupMountinfo, readMountinfoErr = mountinfo.GetMounts( + mountinfo.FSTypeFilter("cgroup"), + ) + }) + + return cgroupMountinfo, readMountinfoErr +} + // https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt func FindCgroupMountpoint(cgroupPath, subsystem string) (string, error) { if IsCgroup2UnifiedMode() { @@ -110,56 +130,28 @@ func FindCgroupMountpointAndRoot(cgroupPath, subsystem string) (string, string, return "", "", errUnified } - // Avoid parsing mountinfo by checking if subsystem is valid/available. - if !isSubsystemAvailable(subsystem) { - return "", "", NewNotFoundError(subsystem) - } - - f, err := os.Open("/proc/self/mountinfo") + mi, err := readCgroupMountinfo() if err != nil { return "", "", err } - defer f.Close() - return findCgroupMountpointAndRootFromReader(f, cgroupPath, subsystem) + return findCgroupMountpointAndRootFromMI(mi, cgroupPath, subsystem) } -func findCgroupMountpointAndRootFromReader(reader io.Reader, cgroupPath, subsystem string) (string, string, error) { - scanner := bufio.NewScanner(reader) - for scanner.Scan() { - txt := scanner.Text() - fields := strings.Fields(txt) - if len(fields) < 9 { - continue - } - if strings.HasPrefix(fields[4], cgroupPath) { - for _, opt := range strings.Split(fields[len(fields)-1], ",") { +func findCgroupMountpointAndRootFromMI(mounts []*mountinfo.Info, cgroupPath, subsystem string) (string, string, error) { + for _, mi := range mounts { + if strings.HasPrefix(mi.Mountpoint, cgroupPath) { + for _, opt := range strings.Split(mi.VFSOptions, ",") { if opt == subsystem { - return fields[4], fields[3], nil + return mi.Mountpoint, mi.Root, nil } } } } - if err := scanner.Err(); err != nil { - return "", "", err - } return "", "", NewNotFoundError(subsystem) } -func isSubsystemAvailable(subsystem string) bool { - if IsCgroup2UnifiedMode() { - panic("don't call isSubsystemAvailable from cgroupv2 code") - } - - cgroups, err := ParseCgroupFile("/proc/self/cgroup") - if err != nil { - return false - } - _, avail := cgroups[subsystem] - return avail -} - func (m Mount) GetOwnCgroup(cgroups map[string]string) (string, error) { if len(m.Subsystems) == 0 { return "", fmt.Errorf("no subsystem for mount") @@ -168,25 +160,15 @@ func (m Mount) GetOwnCgroup(cgroups map[string]string) (string, error) { return getControllerPath(m.Subsystems[0], cgroups) } -func getCgroupMountsHelper(ss map[string]bool, mi io.Reader, all bool) ([]Mount, error) { +func getCgroupMountsHelper(ss map[string]bool, mounts []*mountinfo.Info, all bool) ([]Mount, error) { res := make([]Mount, 0, len(ss)) - scanner := bufio.NewScanner(mi) numFound := 0 - for scanner.Scan() && numFound < len(ss) { - txt := scanner.Text() - sepIdx := strings.Index(txt, " - ") - if sepIdx == -1 { - return nil, fmt.Errorf("invalid mountinfo format") - } - if txt[sepIdx+3:sepIdx+10] == "cgroup2" || txt[sepIdx+3:sepIdx+9] != "cgroup" { - continue - } - fields := strings.Split(txt, " ") + for _, mi := range mounts { m := Mount{ - Mountpoint: fields[4], - Root: fields[3], + Mountpoint: mi.Mountpoint, + Root: mi.Root, } - for _, opt := range strings.Split(fields[len(fields)-1], ",") { + for _, opt := range strings.Split(mi.VFSOptions, ",") { seen, known := ss[opt] if !known || (!all && seen) { continue @@ -199,19 +181,18 @@ func getCgroupMountsHelper(ss map[string]bool, mi io.Reader, all bool) ([]Mount, if len(m.Subsystems) > 0 || all { res = append(res, m) } - } - if err := scanner.Err(); err != nil { - return nil, err + if !all && numFound >= len(ss) { + break + } } return res, nil } func getCgroupMountsV1(all bool) ([]Mount, error) { - f, err := os.Open("/proc/self/mountinfo") + mi, err := readCgroupMountinfo() if err != nil { return nil, err } - defer f.Close() allSubsystems, err := ParseCgroupFile("/proc/self/cgroup") if err != nil { @@ -222,7 +203,8 @@ func getCgroupMountsV1(all bool) ([]Mount, error) { for s := range allSubsystems { allMap[s] = false } - return getCgroupMountsHelper(allMap, f, all) + + return getCgroupMountsHelper(allMap, mi, all) } // GetOwnCgroup returns the relative path to the cgroup docker is running in. diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go index 6e90ae16b506..aada5d62f199 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go @@ -2,6 +2,7 @@ package configs import ( systemdDbus "github.com/coreos/go-systemd/v22/dbus" + "github.com/opencontainers/runc/libcontainer/devices" ) type FreezerState string @@ -42,7 +43,7 @@ type Cgroup struct { type Resources struct { // Devices is the set of access rules for devices in the container. - Devices []*DeviceRule `json:"devices"` + Devices []*devices.Rule `json:"devices"` // Memory limit (in bytes) Memory int64 `json:"memory"` @@ -127,6 +128,9 @@ type Resources struct { // CpuWeight sets a proportional bandwidth limit. CpuWeight uint64 `json:"cpu_weight"` + // Unified is cgroupv2-only key-value map. + Unified map[string]string `json:"unified"` + // SkipDevices allows to skip configuring device permissions. // Used by e.g. kubelet while creating a parent cgroup (kubepods) // common for many containers. diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go index 540f0f85d29b..e1cd1626565a 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go @@ -7,6 +7,7 @@ import ( "os/exec" "time" + "github.com/opencontainers/runc/libcontainer/devices" "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -92,6 +93,9 @@ type Config struct { // Path to a directory containing the container's root filesystem. Rootfs string `json:"rootfs"` + // Umask is the umask to use inside of the container. + Umask *uint32 `json:"umask"` + // Readonlyfs will remount the container's rootfs as readonly where only externally mounted // bind mounts are writtable. Readonlyfs bool `json:"readonlyfs"` @@ -104,7 +108,7 @@ type Config struct { Mounts []*Mount `json:"mounts"` // The device nodes that should be automatically created within the container upon container start. Note, make sure that the node is marked as allowed in the cgroup as well! - Devices []*Device `json:"devices"` + Devices []*devices.Device `json:"devices"` MountLabel string `json:"mount_label"` diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device_windows.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device_windows.go deleted file mode 100644 index 729289393fe4..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device_windows.go +++ /dev/null @@ -1,5 +0,0 @@ -package configs - -func (d *DeviceRule) Mkdev() (uint64, error) { - return 0, nil -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/devices.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/devices.go new file mode 100644 index 000000000000..b9e3664ceaa5 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/devices.go @@ -0,0 +1,17 @@ +package configs + +import "github.com/opencontainers/runc/libcontainer/devices" + +type ( + // Deprecated: use libcontainer/devices.Device + Device = devices.Device + + // Deprecated: use libcontainer/devices.Rule + DeviceRule = devices.Rule + + // Deprecated: use libcontainer/devices.Type + DeviceType = devices.Type + + // Deprecated: use libcontainer/devices.Permissions + DevicePermissions = devices.Permissions +) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_linux.go index 1bbaef9bd941..d52d6fcd1478 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_linux.go @@ -56,7 +56,7 @@ func IsNamespaceSupported(ns NamespaceType) bool { if nsFile == "" { return false } - _, err := os.Stat(fmt.Sprintf("/proc/self/ns/%s", nsFile)) + _, err := os.Stat("/proc/self/ns/" + nsFile) // a namespace is supported if it exists and we have permissions to read it supported = err == nil supportedNamespaces[ns] = supported diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/validator.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/validator.go index 49b5f4c69fe1..63abdb00cb07 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/validator.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/validator.go @@ -6,10 +6,12 @@ import ( "os" "path/filepath" "strings" + "sync" "github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/intelrdt" selinux "github.com/opencontainers/selinux/go-selinux" + "golang.org/x/sys/unix" ) type Validator interface { @@ -144,6 +146,12 @@ func (v *ConfigValidator) sysctl(config *configs.Config) error { "kernel.shm_rmid_forced": true, } + var ( + netOnce sync.Once + hostnet bool + hostnetErr error + ) + for s := range config.Sysctl { if validSysctlMap[s] || strings.HasPrefix(s, "fs.mqueue.") { if config.Namespaces.Contains(configs.NEWIPC) { @@ -153,16 +161,27 @@ func (v *ConfigValidator) sysctl(config *configs.Config) error { } } if strings.HasPrefix(s, "net.") { - if config.Namespaces.Contains(configs.NEWNET) { - if path := config.Namespaces.PathOf(configs.NEWNET); path != "" { - if err := checkHostNs(s, path); err != nil { - return err - } + // Is container using host netns? + // Here "host" means "current", not "initial". + netOnce.Do(func() { + if !config.Namespaces.Contains(configs.NEWNET) { + hostnet = true + return } - continue - } else { - return fmt.Errorf("sysctl %q is not allowed in the hosts network namespace", s) + path := config.Namespaces.PathOf(configs.NEWNET) + if path == "" { + // own netns, so hostnet = false + return + } + hostnet, hostnetErr = isHostNetNS(path) + }) + if hostnetErr != nil { + return hostnetErr + } + if hostnet { + return fmt.Errorf("sysctl %q not allowed in host network namespace", s) } + continue } if config.Namespaces.Contains(configs.NEWUTS) { switch s { @@ -182,21 +201,21 @@ func (v *ConfigValidator) sysctl(config *configs.Config) error { func (v *ConfigValidator) intelrdt(config *configs.Config) error { if config.IntelRdt != nil { - if !intelrdt.IsCatEnabled() && !intelrdt.IsMbaEnabled() { + if !intelrdt.IsCATEnabled() && !intelrdt.IsMBAEnabled() { return errors.New("intelRdt is specified in config, but Intel RDT is not supported or enabled") } - if !intelrdt.IsCatEnabled() && config.IntelRdt.L3CacheSchema != "" { + if !intelrdt.IsCATEnabled() && config.IntelRdt.L3CacheSchema != "" { return errors.New("intelRdt.l3CacheSchema is specified in config, but Intel RDT/CAT is not enabled") } - if !intelrdt.IsMbaEnabled() && config.IntelRdt.MemBwSchema != "" { + if !intelrdt.IsMBAEnabled() && config.IntelRdt.MemBwSchema != "" { return errors.New("intelRdt.memBwSchema is specified in config, but Intel RDT/MBA is not enabled") } - if intelrdt.IsCatEnabled() && config.IntelRdt.L3CacheSchema == "" { + if intelrdt.IsCATEnabled() && config.IntelRdt.L3CacheSchema == "" { return errors.New("Intel RDT/CAT is enabled and intelRdt is specified in config, but intelRdt.l3CacheSchema is empty") } - if intelrdt.IsMbaEnabled() && config.IntelRdt.MemBwSchema == "" { + if intelrdt.IsMBAEnabled() && config.IntelRdt.MemBwSchema == "" { return errors.New("Intel RDT/MBA is enabled and intelRdt is specified in config, but intelRdt.memBwSchema is empty") } } @@ -204,43 +223,17 @@ func (v *ConfigValidator) intelrdt(config *configs.Config) error { return nil } -func isSymbolicLink(path string) (bool, error) { - fi, err := os.Lstat(path) - if err != nil { - return false, err - } +func isHostNetNS(path string) (bool, error) { + const currentProcessNetns = "/proc/self/ns/net" - return fi.Mode()&os.ModeSymlink == os.ModeSymlink, nil -} + var st1, st2 unix.Stat_t -// checkHostNs checks whether network sysctl is used in host namespace. -func checkHostNs(sysctlConfig string, path string) error { - var currentProcessNetns = "/proc/self/ns/net" - // readlink on the current processes network namespace - destOfCurrentProcess, err := os.Readlink(currentProcessNetns) - if err != nil { - return fmt.Errorf("read soft link %q error", currentProcessNetns) + if err := unix.Stat(currentProcessNetns, &st1); err != nil { + return false, fmt.Errorf("unable to stat %q: %s", currentProcessNetns, err) } - - // First check if the provided path is a symbolic link - symLink, err := isSymbolicLink(path) - if err != nil { - return fmt.Errorf("could not check that %q is a symlink: %v", path, err) - } - - if symLink == false { - // The provided namespace is not a symbolic link, - // it is not the host namespace. - return nil + if err := unix.Stat(path, &st2); err != nil { + return false, fmt.Errorf("unable to stat %q: %s", path, err) } - // readlink on the path provided in the struct - destOfContainer, err := os.Readlink(path) - if err != nil { - return fmt.Errorf("read soft link %q error", path) - } - if destOfContainer == destOfCurrentProcess { - return fmt.Errorf("sysctl %q is not allowed in the hosts network namespace", sysctlConfig) - } - return nil + return (st1.Dev == st2.Dev) && (st1.Ino == st2.Ino), nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/container_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/container_linux.go index e2f64fcb9fe5..3dca29e4c3f2 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/container_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/container_linux.go @@ -14,6 +14,7 @@ import ( "os/exec" "path/filepath" "reflect" + "strconv" "strings" "sync" "time" @@ -363,24 +364,10 @@ func (c *linuxContainer) start(process *Process) error { } parent.forwardChildLogs() if err := parent.start(); err != nil { - // terminate the process to ensure that it properly is reaped. - if err := ignoreTerminateErrors(parent.terminate()); err != nil { - logrus.Warn(err) - } return newSystemErrorWithCause(err, "starting container process") } - // generate a timestamp indicating when the container was started - c.created = time.Now().UTC() - if process.Init { - c.state = &createdState{ - c: c, - } - state, err := c.updateState(parent) - if err != nil { - return err - } - c.initProcessStartTime = state.InitProcessStartTime + if process.Init { if c.config.Hooks != nil { s, err := c.currentOCIState() if err != nil { @@ -463,7 +450,7 @@ func (c *linuxContainer) includeExecFifo(cmd *exec.Cmd) error { cmd.ExtraFiles = append(cmd.ExtraFiles, os.NewFile(uintptr(fifoFd), fifoName)) cmd.Env = append(cmd.Env, - fmt.Sprintf("_LIBCONTAINER_FIFOFD=%d", stdioFdCount+len(cmd.ExtraFiles)-1)) + "_LIBCONTAINER_FIFOFD="+strconv.Itoa(stdioFdCount+len(cmd.ExtraFiles)-1)) return nil } @@ -506,24 +493,24 @@ func (c *linuxContainer) commandTemplate(p *Process, childInitPipe *os.File, chi if cmd.SysProcAttr == nil { cmd.SysProcAttr = &unix.SysProcAttr{} } - cmd.Env = append(cmd.Env, fmt.Sprintf("GOMAXPROCS=%s", os.Getenv("GOMAXPROCS"))) + cmd.Env = append(cmd.Env, "GOMAXPROCS="+os.Getenv("GOMAXPROCS")) cmd.ExtraFiles = append(cmd.ExtraFiles, p.ExtraFiles...) if p.ConsoleSocket != nil { cmd.ExtraFiles = append(cmd.ExtraFiles, p.ConsoleSocket) cmd.Env = append(cmd.Env, - fmt.Sprintf("_LIBCONTAINER_CONSOLE=%d", stdioFdCount+len(cmd.ExtraFiles)-1), + "_LIBCONTAINER_CONSOLE="+strconv.Itoa(stdioFdCount+len(cmd.ExtraFiles)-1), ) } cmd.ExtraFiles = append(cmd.ExtraFiles, childInitPipe) cmd.Env = append(cmd.Env, - fmt.Sprintf("_LIBCONTAINER_INITPIPE=%d", stdioFdCount+len(cmd.ExtraFiles)-1), - fmt.Sprintf("_LIBCONTAINER_STATEDIR=%s", c.root), + "_LIBCONTAINER_INITPIPE="+strconv.Itoa(stdioFdCount+len(cmd.ExtraFiles)-1), + "_LIBCONTAINER_STATEDIR="+c.root, ) cmd.ExtraFiles = append(cmd.ExtraFiles, childLogPipe) cmd.Env = append(cmd.Env, - fmt.Sprintf("_LIBCONTAINER_LOGPIPE=%d", stdioFdCount+len(cmd.ExtraFiles)-1), - fmt.Sprintf("_LIBCONTAINER_LOGLEVEL=%s", p.LogLevel), + "_LIBCONTAINER_LOGPIPE="+strconv.Itoa(stdioFdCount+len(cmd.ExtraFiles)-1), + "_LIBCONTAINER_LOGLEVEL="+p.LogLevel, ) // NOTE: when running a container with no PID namespace and the parent process spawning the container is @@ -693,8 +680,7 @@ var criuFeatures *criurpc.CriuFeatures func (c *linuxContainer) checkCriuFeatures(criuOpts *CriuOpts, rpcOpts *criurpc.CriuOpts, criuFeat *criurpc.CriuFeatures) error { - var t criurpc.CriuReqType - t = criurpc.CriuReqType_FEATURE_CHECK + t := criurpc.CriuReqType_FEATURE_CHECK // make sure the features we are looking for are really not from // some previous check @@ -777,11 +763,7 @@ func (c *linuxContainer) checkCriuVersion(minVersion int) error { const descriptorsFilename = "descriptors.json" func (c *linuxContainer) addCriuDumpMount(req *criurpc.CriuReq, m *configs.Mount) { - mountDest := m.Destination - if strings.HasPrefix(mountDest, c.config.Rootfs) { - mountDest = mountDest[len(c.config.Rootfs):] - } - + mountDest := strings.TrimPrefix(m.Destination, c.config.Rootfs) extMnt := &criurpc.ExtMountMap{ Key: proto.String(mountDest), Val: proto.String(mountDest), @@ -853,7 +835,7 @@ func (c *linuxContainer) criuSupportsExtNS(t configs.NamespaceType) bool { return c.checkCriuVersion(minVersion) == nil } -func (c *linuxContainer) criuNsToKey(t configs.NamespaceType) string { +func criuNsToKey(t configs.NamespaceType) string { return "extRoot" + strings.Title(configs.NsName(t)) + "NS" } @@ -873,12 +855,50 @@ func (c *linuxContainer) handleCheckpointingExternalNamespaces(rpcOpts *criurpc. if err := unix.Stat(nsPath, &ns); err != nil { return err } - criuExternal := fmt.Sprintf("%s[%d]:%s", configs.NsName(t), ns.Ino, c.criuNsToKey(t)) + criuExternal := fmt.Sprintf("%s[%d]:%s", configs.NsName(t), ns.Ino, criuNsToKey(t)) rpcOpts.External = append(rpcOpts.External, criuExternal) return nil } +func (c *linuxContainer) handleRestoringNamespaces(rpcOpts *criurpc.CriuOpts, extraFiles *[]*os.File) error { + for _, ns := range c.config.Namespaces { + switch ns.Type { + case configs.NEWNET, configs.NEWPID: + // If the container is running in a network or PID namespace and has + // a path to the network or PID namespace configured, we will dump + // that network or PID namespace as an external namespace and we + // will expect that the namespace exists during restore. + // This basically means that CRIU will ignore the namespace + // and expect it to be setup correctly. + if err := c.handleRestoringExternalNamespaces(rpcOpts, extraFiles, ns.Type); err != nil { + return err + } + default: + // For all other namespaces except NET and PID CRIU has + // a simpler way of joining the existing namespace if set + nsPath := c.config.Namespaces.PathOf(ns.Type) + if nsPath == "" { + continue + } + if ns.Type == configs.NEWCGROUP { + // CRIU has no code to handle NEWCGROUP + return fmt.Errorf("Do not know how to handle namespace %v", ns.Type) + } + // CRIU has code to handle NEWTIME, but it does not seem to be defined in runc + + // CRIU will issue a warning for NEWUSER: + // criu/namespaces.c: 'join-ns with user-namespace is not fully tested and dangerous' + rpcOpts.JoinNs = append(rpcOpts.JoinNs, &criurpc.JoinNamespace{ + Ns: proto.String(configs.NsName(ns.Type)), + NsFile: proto.String(nsPath), + }) + } + } + + return nil +} + func (c *linuxContainer) handleRestoringExternalNamespaces(rpcOpts *criurpc.CriuOpts, extraFiles *[]*os.File, t configs.NamespaceType) error { if !c.criuSupportsExtNS(t) { return nil @@ -897,11 +917,12 @@ func (c *linuxContainer) handleRestoringExternalNamespaces(rpcOpts *criurpc.Criu logrus.Errorf("If a specific network namespace is defined it must exist: %s", err) return fmt.Errorf("Requested network namespace %v does not exist", nsPath) } - inheritFd := new(criurpc.InheritFd) - inheritFd.Key = proto.String(c.criuNsToKey(t)) - // The offset of four is necessary because 0, 1, 2 and 3 is already - // used by stdin, stdout, stderr, 'criu swrk' socket. - inheritFd.Fd = proto.Int32(int32(4 + len(*extraFiles))) + inheritFd := &criurpc.InheritFd{ + Key: proto.String(criuNsToKey(t)), + // The offset of four is necessary because 0, 1, 2 and 3 are + // already used by stdin, stdout, stderr, 'criu swrk' socket. + Fd: proto.Int32(int32(4 + len(*extraFiles))), + } rpcOpts.InheritFd = append(rpcOpts.InheritFd, inheritFd) // All open FDs need to be transferred to CRIU via extraFiles *extraFiles = append(*extraFiles, nsFd) @@ -1120,11 +1141,7 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error { } func (c *linuxContainer) addCriuRestoreMount(req *criurpc.CriuReq, m *configs.Mount) { - mountDest := m.Destination - if strings.HasPrefix(mountDest, c.config.Rootfs) { - mountDest = mountDest[len(c.config.Rootfs):] - } - + mountDest := strings.TrimPrefix(m.Destination, c.config.Rootfs) extMnt := &criurpc.ExtMountMap{ Key: proto.String(mountDest), Val: proto.String(m.Source), @@ -1309,15 +1326,7 @@ func (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error { c.handleCriuConfigurationFile(req.Opts) - // Same as during checkpointing. If the container has a specific network namespace - // assigned to it, this now expects that the checkpoint will be restored in a - // already created network namespace. - if err := c.handleRestoringExternalNamespaces(req.Opts, &extraFiles, configs.NEWNET); err != nil { - return err - } - - // Same for PID namespaces. - if err := c.handleRestoringExternalNamespaces(req.Opts, &extraFiles, configs.NEWPID); err != nil { + if err := c.handleRestoringNamespaces(req.Opts, &extraFiles); err != nil { return err } @@ -1540,7 +1549,7 @@ func (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts * buf := make([]byte, 10*4096) oob := make([]byte, 4096) - for true { + for { n, oobn, _, _, err := criuClientCon.ReadMsgUnix(buf, oob) if req.Opts != nil && req.Opts.StatusFd != nil { // Close status_fd as soon as we got something back from criu, @@ -1792,10 +1801,6 @@ func (c *linuxContainer) saveState(s *State) (retErr error) { return os.Rename(tmpFile.Name(), stateFilePath) } -func (c *linuxContainer) deleteState() error { - return os.Remove(filepath.Join(c.root, stateFilename)) -} - func (c *linuxContainer) currentStatus() (Status, error) { if err := c.refreshState(); err != nil { return -1, err @@ -2042,7 +2047,7 @@ func (c *linuxContainer) bootstrapData(cloneFlags uintptr, nsMaps map[configs.Na // write oom_score_adj r.AddData(&Bytemsg{ Type: OomScoreAdjAttr, - Value: []byte(fmt.Sprintf("%d", *c.config.OomScoreAdj)), + Value: []byte(strconv.Itoa(*c.config.OomScoreAdj)), }) } @@ -2062,9 +2067,21 @@ func ignoreTerminateErrors(err error) error { if err == nil { return nil } + // terminate() might return an error from ether Kill or Wait. + // The (*Cmd).Wait documentation says: "If the command fails to run + // or doesn't complete successfully, the error is of type *ExitError". + // Filter out such errors (like "exit status 1" or "signal: killed"). + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { + return nil + } + // TODO: use errors.Is(err, os.ErrProcessDone) here and + // remove "process already finished" string comparison below + // once go 1.16 is minimally supported version. + s := err.Error() - switch { - case strings.Contains(s, "process already finished"), strings.Contains(s, "Wait was already called"): + if strings.Contains(s, "process already finished") || + strings.Contains(s, "Wait was already called") { return nil } return err diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/criu_opts_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/criu_opts_linux.go index 1d119246d1ef..11cbdb2db982 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/criu_opts_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/criu_opts_linux.go @@ -1,14 +1,6 @@ package libcontainer -// cgroup restoring strategy provided by criu -type cgMode uint32 - -const ( - CRIU_CG_MODE_SOFT cgMode = 3 + iota // restore cgroup properties if only dir created by criu - CRIU_CG_MODE_FULL // always restore all cgroups and their properties - CRIU_CG_MODE_STRICT // restore all, requiring them to not present in the system - CRIU_CG_MODE_DEFAULT // the same as CRIU_CG_MODE_SOFT -) +import criu "github.com/checkpoint-restore/go-criu/v4/rpc" type CriuPageServerInfo struct { Address string // IP address of CRIU page server @@ -32,7 +24,7 @@ type CriuOpts struct { PreDump bool // call criu predump to perform iterative checkpoint PageServer CriuPageServerInfo // allow to dump to criu page server VethPairs []VethPairName // pass the veth to criu when restore - ManageCgroupsMode cgMode // dump or restore cgroup mode + ManageCgroupsMode criu.CriuCgMode // dump or restore cgroup mode EmptyNs uint32 // don't c/r properties for namespace from this mask AutoDedup bool // auto deduplication for incremental dumps LazyPages bool // restore memory pages lazily using userfaultfd diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go similarity index 63% rename from cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device.go rename to cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go index 632bf6ac49cc..3eb73cc7c762 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go @@ -1,4 +1,4 @@ -package configs +package devices import ( "fmt" @@ -11,7 +11,7 @@ const ( ) type Device struct { - DeviceRule + Rule // Path to the device. Path string `json:"path"` @@ -26,10 +26,10 @@ type Device struct { Gid uint32 `json:"gid"` } -// DevicePermissions is a cgroupv1-style string to represent device access. It +// Permissions is a cgroupv1-style string to represent device access. It // has to be a string for backward compatibility reasons, hence why it has // methods to do set operations. -type DevicePermissions string +type Permissions string const ( deviceRead uint = (1 << iota) @@ -37,7 +37,7 @@ const ( deviceMknod ) -func (p DevicePermissions) toSet() uint { +func (p Permissions) toSet() uint { var set uint for _, perm := range p { switch perm { @@ -52,7 +52,7 @@ func (p DevicePermissions) toSet() uint { return set } -func fromSet(set uint) DevicePermissions { +func fromSet(set uint) Permissions { var perm string if set&deviceRead == deviceRead { perm += "r" @@ -63,53 +63,53 @@ func fromSet(set uint) DevicePermissions { if set&deviceMknod == deviceMknod { perm += "m" } - return DevicePermissions(perm) + return Permissions(perm) } -// Union returns the union of the two sets of DevicePermissions. -func (p DevicePermissions) Union(o DevicePermissions) DevicePermissions { +// Union returns the union of the two sets of Permissions. +func (p Permissions) Union(o Permissions) Permissions { lhs := p.toSet() rhs := o.toSet() return fromSet(lhs | rhs) } -// Difference returns the set difference of the two sets of DevicePermissions. +// Difference returns the set difference of the two sets of Permissions. // In set notation, A.Difference(B) gives you A\B. -func (p DevicePermissions) Difference(o DevicePermissions) DevicePermissions { +func (p Permissions) Difference(o Permissions) Permissions { lhs := p.toSet() rhs := o.toSet() return fromSet(lhs &^ rhs) } -// Intersection computes the intersection of the two sets of DevicePermissions. -func (p DevicePermissions) Intersection(o DevicePermissions) DevicePermissions { +// Intersection computes the intersection of the two sets of Permissions. +func (p Permissions) Intersection(o Permissions) Permissions { lhs := p.toSet() rhs := o.toSet() return fromSet(lhs & rhs) } -// IsEmpty returns whether the set of permissions in a DevicePermissions is +// IsEmpty returns whether the set of permissions in a Permissions is // empty. -func (p DevicePermissions) IsEmpty() bool { - return p == DevicePermissions("") +func (p Permissions) IsEmpty() bool { + return p == Permissions("") } // IsValid returns whether the set of permissions is a subset of valid // permissions (namely, {r,w,m}). -func (p DevicePermissions) IsValid() bool { +func (p Permissions) IsValid() bool { return p == fromSet(p.toSet()) } -type DeviceType rune +type Type rune const ( - WildcardDevice DeviceType = 'a' - BlockDevice DeviceType = 'b' - CharDevice DeviceType = 'c' // or 'u' - FifoDevice DeviceType = 'p' + WildcardDevice Type = 'a' + BlockDevice Type = 'b' + CharDevice Type = 'c' // or 'u' + FifoDevice Type = 'p' ) -func (t DeviceType) IsValid() bool { +func (t Type) IsValid() bool { switch t { case WildcardDevice, BlockDevice, CharDevice, FifoDevice: return true @@ -118,7 +118,7 @@ func (t DeviceType) IsValid() bool { } } -func (t DeviceType) CanMknod() bool { +func (t Type) CanMknod() bool { switch t { case BlockDevice, CharDevice, FifoDevice: return true @@ -127,7 +127,7 @@ func (t DeviceType) CanMknod() bool { } } -func (t DeviceType) CanCgroup() bool { +func (t Type) CanCgroup() bool { switch t { case WildcardDevice, BlockDevice, CharDevice: return true @@ -136,10 +136,10 @@ func (t DeviceType) CanCgroup() bool { } } -type DeviceRule struct { +type Rule struct { // Type of device ('c' for char, 'b' for block). If set to 'a', this rule // acts as a wildcard and all fields other than Allow are ignored. - Type DeviceType `json:"type"` + Type Type `json:"type"` // Major is the device's major number. Major int64 `json:"major"` @@ -149,13 +149,13 @@ type DeviceRule struct { // Permissions is the set of permissions that this rule applies to (in the // cgroupv1 format -- any combination of "rwm"). - Permissions DevicePermissions `json:"permissions"` + Permissions Permissions `json:"permissions"` // Allow specifies whether this rule is allowed. Allow bool `json:"allow"` } -func (d *DeviceRule) CgroupString() string { +func (d *Rule) CgroupString() string { var ( major = strconv.FormatInt(d.Major, 10) minor = strconv.FormatInt(d.Minor, 10) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device_unix.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go similarity index 79% rename from cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device_unix.go rename to cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go index 650c46848a10..a400341e440f 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/device_unix.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go @@ -1,6 +1,6 @@ // +build !windows -package configs +package devices import ( "errors" @@ -8,7 +8,7 @@ import ( "golang.org/x/sys/unix" ) -func (d *DeviceRule) Mkdev() (uint64, error) { +func (d *Rule) Mkdev() (uint64, error) { if d.Major == Wildcard || d.Minor == Wildcard { return 0, errors.New("cannot mkdev() device with wildcards") } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_windows.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_windows.go new file mode 100644 index 000000000000..8511bf00e076 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_windows.go @@ -0,0 +1,5 @@ +package devices + +func (d *Rule) Mkdev() (uint64, error) { + return 0, nil +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/devices.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/devices.go new file mode 100644 index 000000000000..5011f373d2c3 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/devices.go @@ -0,0 +1,112 @@ +package devices + +import ( + "errors" + "io/ioutil" + "os" + "path/filepath" + + "golang.org/x/sys/unix" +) + +var ( + // ErrNotADevice denotes that a file is not a valid linux device. + ErrNotADevice = errors.New("not a device node") +) + +// Testing dependencies +var ( + unixLstat = unix.Lstat + ioutilReadDir = ioutil.ReadDir +) + +// Given the path to a device and its cgroup_permissions(which cannot be easily queried) look up the +// information about a linux device and return that information as a Device struct. +func DeviceFromPath(path, permissions string) (*Device, error) { + var stat unix.Stat_t + err := unixLstat(path, &stat) + if err != nil { + return nil, err + } + + var ( + devType Type + mode = stat.Mode + devNumber = uint64(stat.Rdev) + major = unix.Major(devNumber) + minor = unix.Minor(devNumber) + ) + switch mode & unix.S_IFMT { + case unix.S_IFBLK: + devType = BlockDevice + case unix.S_IFCHR: + devType = CharDevice + case unix.S_IFIFO: + devType = FifoDevice + default: + return nil, ErrNotADevice + } + return &Device{ + Rule: Rule{ + Type: devType, + Major: int64(major), + Minor: int64(minor), + Permissions: Permissions(permissions), + }, + Path: path, + FileMode: os.FileMode(mode), + Uid: stat.Uid, + Gid: stat.Gid, + }, nil +} + +// HostDevices returns all devices that can be found under /dev directory. +func HostDevices() ([]*Device, error) { + return GetDevices("/dev") +} + +// GetDevices recursively traverses a directory specified by path +// and returns all devices found there. +func GetDevices(path string) ([]*Device, error) { + files, err := ioutilReadDir(path) + if err != nil { + return nil, err + } + var out []*Device + for _, f := range files { + switch { + case f.IsDir(): + switch f.Name() { + // ".lxc" & ".lxd-mounts" added to address https://github.com/lxc/lxd/issues/2825 + // ".udev" added to address https://github.com/opencontainers/runc/issues/2093 + case "pts", "shm", "fd", "mqueue", ".lxc", ".lxd-mounts", ".udev": + continue + default: + sub, err := GetDevices(filepath.Join(path, f.Name())) + if err != nil { + return nil, err + } + + out = append(out, sub...) + continue + } + case f.Name() == "console": + continue + } + device, err := DeviceFromPath(filepath.Join(path, f.Name()), "rwm") + if err != nil { + if err == ErrNotADevice { + continue + } + if os.IsNotExist(err) { + continue + } + return nil, err + } + if device.Type == FifoDevice { + continue + } + out = append(out, device) + } + return out, nil +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/factory_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/factory_linux.go index 59548ef88195..5cd374162b93 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/factory_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/factory_linux.go @@ -148,11 +148,11 @@ func RootlessCgroupfs(l *LinuxFactory) error { // containers that use the Intel RDT "resource control" filesystem to // create and manage Intel RDT resources (e.g., L3 cache, memory bandwidth). func IntelRdtFs(l *LinuxFactory) error { - l.NewIntelRdtManager = func(config *configs.Config, id string, path string) intelrdt.Manager { - return &intelrdt.IntelRdtManager{ - Config: config, - Id: id, - Path: path, + if !intelrdt.IsCATEnabled() && !intelrdt.IsMBAEnabled() { + l.NewIntelRdtManager = nil + } else { + l.NewIntelRdtManager = func(config *configs.Config, id string, path string) intelrdt.Manager { + return intelrdt.NewManager(config, id, path) } } return nil @@ -276,7 +276,7 @@ func (l *LinuxFactory) Create(id string, config *configs.Config) (Container, err newgidmapPath: l.NewgidmapPath, cgroupManager: l.NewCgroupsManager(config.Cgroups, nil), } - if intelrdt.IsCatEnabled() || intelrdt.IsMbaEnabled() { + if l.NewIntelRdtManager != nil { c.intelRdtManager = l.NewIntelRdtManager(config, id, "") } c.state = &stoppedState{c: c} @@ -318,13 +318,13 @@ func (l *LinuxFactory) Load(id string) (Container, error) { root: containerRoot, created: state.Created, } + if l.NewIntelRdtManager != nil { + c.intelRdtManager = l.NewIntelRdtManager(&state.Config, id, state.IntelRdtPath) + } c.state = &loadedState{c: c} if err := c.refreshState(); err != nil { return nil, err } - if intelrdt.IsCatEnabled() || intelrdt.IsMbaEnabled() { - c.intelRdtManager = l.NewIntelRdtManager(&state.Config, id, state.IntelRdtPath) - } return c, nil } @@ -335,35 +335,28 @@ func (l *LinuxFactory) Type() string { // StartInitialization loads a container by opening the pipe fd from the parent to read the configuration and state // This is a low level implementation detail of the reexec and should not be consumed externally func (l *LinuxFactory) StartInitialization() (err error) { - var ( - pipefd, fifofd int - consoleSocket *os.File - envInitPipe = os.Getenv("_LIBCONTAINER_INITPIPE") - envFifoFd = os.Getenv("_LIBCONTAINER_FIFOFD") - envConsole = os.Getenv("_LIBCONTAINER_CONSOLE") - ) - // Get the INITPIPE. - pipefd, err = strconv.Atoi(envInitPipe) + envInitPipe := os.Getenv("_LIBCONTAINER_INITPIPE") + pipefd, err := strconv.Atoi(envInitPipe) if err != nil { return fmt.Errorf("unable to convert _LIBCONTAINER_INITPIPE=%s to int: %s", envInitPipe, err) } - - var ( - pipe = os.NewFile(uintptr(pipefd), "pipe") - it = initType(os.Getenv("_LIBCONTAINER_INITTYPE")) - ) + pipe := os.NewFile(uintptr(pipefd), "pipe") defer pipe.Close() // Only init processes have FIFOFD. - fifofd = -1 + fifofd := -1 + envInitType := os.Getenv("_LIBCONTAINER_INITTYPE") + it := initType(envInitType) if it == initStandard { + envFifoFd := os.Getenv("_LIBCONTAINER_FIFOFD") if fifofd, err = strconv.Atoi(envFifoFd); err != nil { return fmt.Errorf("unable to convert _LIBCONTAINER_FIFOFD=%s to int: %s", envFifoFd, err) } } - if envConsole != "" { + var consoleSocket *os.File + if envConsole := os.Getenv("_LIBCONTAINER_CONSOLE"); envConsole != "" { console, err := strconv.Atoi(envConsole) if err != nil { return fmt.Errorf("unable to convert _LIBCONTAINER_CONSOLE=%s to int: %s", envConsole, err) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/init_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/init_linux.go index f2dc17e00e93..c57af0eebb8b 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/init_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/init_linux.go @@ -3,6 +3,7 @@ package libcontainer import ( + "bytes" "encoding/json" "fmt" "io" @@ -12,9 +13,8 @@ import ( "strings" "unsafe" - "golang.org/x/sys/unix" - "github.com/containerd/console" + "github.com/opencontainers/runc/libcontainer/capabilities" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/system" @@ -24,6 +24,7 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" + "golang.org/x/sys/unix" ) type initType string @@ -128,19 +129,13 @@ func finalizeNamespace(config *initConfig) error { return errors.Wrap(err, "close exec fds") } - if config.Cwd != "" { - if err := unix.Chdir(config.Cwd); err != nil { - return fmt.Errorf("chdir to cwd (%q) set in config.json failed: %v", config.Cwd, err) - } - } - - capabilities := &configs.Capabilities{} + caps := &configs.Capabilities{} if config.Capabilities != nil { - capabilities = config.Capabilities + caps = config.Capabilities } else if config.Config.Capabilities != nil { - capabilities = config.Config.Capabilities + caps = config.Config.Capabilities } - w, err := newContainerCapList(capabilities) + w, err := capabilities.New(caps) if err != nil { return err } @@ -155,6 +150,14 @@ func finalizeNamespace(config *initConfig) error { if err := setupUser(config); err != nil { return errors.Wrap(err, "setup user") } + // Change working directory AFTER the user has been set up. + // Otherwise, if the cwd is also a volume that's been chowned to the container user (and not the user running runc), + // this command will EPERM. + if config.Cwd != "" { + if err := unix.Chdir(config.Cwd); err != nil { + return fmt.Errorf("chdir to cwd (%q) set in config.json failed: %v", config.Cwd, err) + } + } if err := system.ClearKeepCaps(); err != nil { return errors.Wrap(err, "clear keep caps") } @@ -304,7 +307,7 @@ func setupUser(config *initConfig) error { // There's nothing we can do about /etc/group entries, so we silently // ignore setting groups here (since the user didn't explicitly ask us to // set the group). - allowSupGroups := !config.RootlessEUID && strings.TrimSpace(string(setgroups)) != "deny" + allowSupGroups := !config.RootlessEUID && string(bytes.TrimSpace(setgroups)) != "deny" if allowSupGroups { suppGroups := append(execUser.Sgids, addGroups...) @@ -431,6 +434,7 @@ func setupRlimits(limits []configs.Rlimit, pid int) error { const _P_PID = 1 +//nolint:structcheck,unused type siginfo struct { si_signo int32 si_errno int32 @@ -480,7 +484,9 @@ func signalAllProcesses(m cgroups.Manager, s os.Signal) error { } pids, err := m.GetAllPids() if err != nil { - m.Freeze(configs.Thawed) + if err := m.Freeze(configs.Thawed); err != nil { + logrus.Warn(err) + } return err } for _, pid := range pids { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/cmt.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/cmt.go index 5c406e102077..ed950973f080 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/cmt.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/cmt.go @@ -6,17 +6,20 @@ var ( // Check if Intel RDT/CMT is enabled. func IsCMTEnabled() bool { + featuresInit() return cmtEnabled } func getCMTNumaNodeStats(numaPath string) (*CMTNumaNodeStats, error) { stats := &CMTNumaNodeStats{} - llcOccupancy, err := getIntelRdtParamUint(numaPath, "llc_occupancy") - if err != nil { - return nil, err + if enabledMonFeatures.llcOccupancy { + llcOccupancy, err := getIntelRdtParamUint(numaPath, "llc_occupancy") + if err != nil { + return nil, err + } + stats.LLCOccupancy = llcOccupancy } - stats.LLCOccupancy = llcOccupancy return stats, nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/intelrdt.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/intelrdt.go index 5b19d55a2d7f..3fa11b8002d3 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/intelrdt.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/intelrdt.go @@ -4,7 +4,9 @@ package intelrdt import ( "bufio" + "bytes" "fmt" + "io" "io/ioutil" "os" "path/filepath" @@ -12,6 +14,7 @@ import ( "strings" "sync" + "github.com/moby/sys/mountinfo" "github.com/opencontainers/runc/libcontainer/configs" ) @@ -162,11 +165,19 @@ type Manager interface { } // This implements interface Manager -type IntelRdtManager struct { +type intelRdtManager struct { mu sync.Mutex - Config *configs.Config - Id string - Path string + config *configs.Config + id string + path string +} + +func NewManager(config *configs.Config, id string, path string) Manager { + return &intelRdtManager{ + config: config, + id: id, + path: path, + } } const ( @@ -179,11 +190,14 @@ var ( intelRdtRootLock sync.Mutex // The flag to indicate if Intel RDT/CAT is enabled - isCatEnabled bool + catEnabled bool // The flag to indicate if Intel RDT/MBA is enabled - isMbaEnabled bool + mbaEnabled bool // The flag to indicate if Intel RDT/MBA Software Controller is enabled - isMbaScEnabled bool + mbaScEnabled bool + + // For Intel RDT initialization + initOnce sync.Once ) type intelRdtData struct { @@ -192,94 +206,80 @@ type intelRdtData struct { pid int } -// Check if Intel RDT sub-features are enabled in init() -func init() { - // 1. Check if hardware and kernel support Intel RDT sub-features - flagsSet, err := parseCpuInfoFile("/proc/cpuinfo") - if err != nil { - return - } - - // 2. Check if Intel RDT "resource control" filesystem is mounted - // The user guarantees to mount the filesystem - if !isIntelRdtMounted() { - return - } - - // 3. Double check if Intel RDT sub-features are available in - // "resource control" filesystem. Intel RDT sub-features can be - // selectively disabled or enabled by kernel command line - // (e.g., rdt=!l3cat,mba) in 4.14 and newer kernel - if flagsSet.CAT { - if _, err := os.Stat(filepath.Join(intelRdtRoot, "info", "L3")); err == nil { - isCatEnabled = true - } - } - if isMbaScEnabled { - // We confirm MBA Software Controller is enabled in step 2, - // MBA should be enabled because MBA Software Controller - // depends on MBA - isMbaEnabled = true - } else if flagsSet.MBA { - if _, err := os.Stat(filepath.Join(intelRdtRoot, "info", "MB")); err == nil { - isMbaEnabled = true +// Check if Intel RDT sub-features are enabled in featuresInit() +func featuresInit() { + initOnce.Do(func() { + // 1. Check if hardware and kernel support Intel RDT sub-features + flagsSet, err := parseCpuInfoFile("/proc/cpuinfo") + if err != nil { + return } - } - if flagsSet.MBMTotal || flagsSet.MBMLocal { - if _, err := os.Stat(filepath.Join(intelRdtRoot, "info", "L3_MON")); err == nil { - mbmEnabled = true - cmtEnabled = true + // 2. Check if Intel RDT "resource control" filesystem is mounted + // The user guarantees to mount the filesystem + if !isIntelRdtMounted() { + return } - enabledMonFeatures, err = getMonFeatures(intelRdtRoot) - if err != nil { - return + // 3. Double check if Intel RDT sub-features are available in + // "resource control" filesystem. Intel RDT sub-features can be + // selectively disabled or enabled by kernel command line + // (e.g., rdt=!l3cat,mba) in 4.14 and newer kernel + if flagsSet.CAT { + if _, err := os.Stat(filepath.Join(intelRdtRoot, "info", "L3")); err == nil { + catEnabled = true + } } - } + if mbaScEnabled { + // We confirm MBA Software Controller is enabled in step 2, + // MBA should be enabled because MBA Software Controller + // depends on MBA + mbaEnabled = true + } else if flagsSet.MBA { + if _, err := os.Stat(filepath.Join(intelRdtRoot, "info", "MB")); err == nil { + mbaEnabled = true + } + } + if flagsSet.MBMTotal || flagsSet.MBMLocal || flagsSet.CMT { + if _, err := os.Stat(filepath.Join(intelRdtRoot, "info", "L3_MON")); err != nil { + return + } + enabledMonFeatures, err = getMonFeatures(intelRdtRoot) + if err != nil { + return + } + if enabledMonFeatures.mbmTotalBytes || enabledMonFeatures.mbmLocalBytes { + mbmEnabled = true + } + if enabledMonFeatures.llcOccupancy { + cmtEnabled = true + } + } + }) } // Return the mount point path of Intel RDT "resource control" filesysem -func findIntelRdtMountpointDir() (string, error) { - f, err := os.Open("/proc/self/mountinfo") +func findIntelRdtMountpointDir(f io.Reader) (string, error) { + mi, err := mountinfo.GetMountsFromReader(f, func(m *mountinfo.Info) (bool, bool) { + // similar to mountinfo.FSTypeFilter but stops after the first match + if m.FSType == "resctrl" { + return false, true // don't skip, stop + } + return true, false // skip, keep going + }) if err != nil { return "", err } - defer f.Close() - - s := bufio.NewScanner(f) - for s.Scan() { - text := s.Text() - fields := strings.Split(text, " ") - // Safe as mountinfo encodes mountpoints with spaces as \040. - index := strings.Index(text, " - ") - postSeparatorFields := strings.Fields(text[index+3:]) - numPostFields := len(postSeparatorFields) - - // This is an error as we can't detect if the mount is for "Intel RDT" - if numPostFields == 0 { - return "", fmt.Errorf("Found no fields post '-' in %q", text) - } - - if postSeparatorFields[0] == "resctrl" { - // Check that the mount is properly formatted. - if numPostFields < 3 { - return "", fmt.Errorf("Error found less than 3 fields post '-' in %q", text) - } - - // Check if MBA Software Controller is enabled through mount option "-o mba_MBps" - if strings.Contains(postSeparatorFields[2], "mba_MBps") { - isMbaScEnabled = true - } - - return fields[4], nil - } + if len(mi) < 1 { + return "", NewNotFoundError("Intel RDT") } - if err := s.Err(); err != nil { - return "", err + + // Check if MBA Software Controller is enabled through mount option "-o mba_MBps" + if strings.Contains(","+mi[0].VFSOptions+",", ",mba_MBps,") { + mbaScEnabled = true } - return "", NewNotFoundError("Intel RDT") + return mi[0].Mountpoint, nil } // Gets the root path of Intel RDT "resource control" filesystem @@ -291,7 +291,12 @@ func getIntelRdtRoot() (string, error) { return intelRdtRoot, nil } - root, err := findIntelRdtMountpointDir() + f, err := os.Open("/proc/self/mountinfo") + if err != nil { + return "", err + } + root, err := findIntelRdtMountpointDir(f) + f.Close() if err != nil { return "", err } @@ -306,11 +311,7 @@ func getIntelRdtRoot() (string, error) { func isIntelRdtMounted() bool { _, err := getIntelRdtRoot() - if err != nil { - return false - } - - return true + return err == nil } type cpuInfoFlags struct { @@ -320,6 +321,8 @@ type cpuInfoFlags struct { // Memory Bandwidth Monitoring related. MBMTotal bool MBMLocal bool + + CMT bool // Cache Monitoring Technology } func parseCpuInfoFile(path string) (cpuInfoFlags, error) { @@ -349,6 +352,8 @@ func parseCpuInfoFile(path string) (cpuInfoFlags, error) { infoFlags.MBMTotal = true case "cqm_mbm_local": infoFlags.MBMLocal = true + case "cqm_occup_llc": + infoFlags.CMT = true } } return infoFlags, nil @@ -387,7 +392,7 @@ func getIntelRdtParamUint(path, file string) (uint64, error) { return 0, err } - res, err := parseUint(strings.TrimSpace(string(contents)), 10, 64) + res, err := parseUint(string(bytes.TrimSpace(contents)), 10, 64) if err != nil { return res, fmt.Errorf("unable to parse %q as a uint from file %q", string(contents), fileName) } @@ -401,14 +406,14 @@ func getIntelRdtParamString(path, file string) (string, error) { return "", err } - return strings.TrimSpace(string(contents)), nil + return string(bytes.TrimSpace(contents)), nil } func writeFile(dir, file, data string) error { if dir == "" { return fmt.Errorf("no such directory for %s", file) } - if err := ioutil.WriteFile(filepath.Join(dir, file), []byte(data+"\n"), 0700); err != nil { + if err := ioutil.WriteFile(filepath.Join(dir, file), []byte(data+"\n"), 0o600); err != nil { return fmt.Errorf("failed to write %v to %v: %v", data, file, err) } return nil @@ -515,7 +520,7 @@ func WriteIntelRdtTasks(dir string, pid int) error { // Don't attach any pid if -1 is specified as a pid if pid != -1 { - if err := ioutil.WriteFile(filepath.Join(dir, IntelRdtTasks), []byte(strconv.Itoa(pid)), 0700); err != nil { + if err := ioutil.WriteFile(filepath.Join(dir, IntelRdtTasks), []byte(strconv.Itoa(pid)), 0o600); err != nil { return fmt.Errorf("failed to write %v to %v: %v", pid, IntelRdtTasks, err) } } @@ -523,18 +528,21 @@ func WriteIntelRdtTasks(dir string, pid int) error { } // Check if Intel RDT/CAT is enabled -func IsCatEnabled() bool { - return isCatEnabled +func IsCATEnabled() bool { + featuresInit() + return catEnabled } // Check if Intel RDT/MBA is enabled -func IsMbaEnabled() bool { - return isMbaEnabled +func IsMBAEnabled() bool { + featuresInit() + return mbaEnabled } // Check if Intel RDT/MBA Software Controller is enabled -func IsMbaScEnabled() bool { - return isMbaScEnabled +func IsMBAScEnabled() bool { + featuresInit() + return mbaScEnabled } // Get the 'container_id' path in Intel RDT "resource control" filesystem @@ -549,51 +557,51 @@ func GetIntelRdtPath(id string) (string, error) { } // Applies Intel RDT configuration to the process with the specified pid -func (m *IntelRdtManager) Apply(pid int) (err error) { +func (m *intelRdtManager) Apply(pid int) (err error) { // If intelRdt is not specified in config, we do nothing - if m.Config.IntelRdt == nil { + if m.config.IntelRdt == nil { return nil } - d, err := getIntelRdtData(m.Config, pid) + d, err := getIntelRdtData(m.config, pid) if err != nil && !IsNotFound(err) { return err } m.mu.Lock() defer m.mu.Unlock() - path, err := d.join(m.Id) + path, err := d.join(m.id) if err != nil { return err } - m.Path = path + m.path = path return nil } // Destroys the Intel RDT 'container_id' group -func (m *IntelRdtManager) Destroy() error { +func (m *intelRdtManager) Destroy() error { m.mu.Lock() defer m.mu.Unlock() if err := os.RemoveAll(m.GetPath()); err != nil { return err } - m.Path = "" + m.path = "" return nil } // Returns Intel RDT path to save in a state file and to be able to // restore the object later -func (m *IntelRdtManager) GetPath() string { - if m.Path == "" { - m.Path, _ = GetIntelRdtPath(m.Id) +func (m *intelRdtManager) GetPath() string { + if m.path == "" { + m.path, _ = GetIntelRdtPath(m.id) } - return m.Path + return m.path } // Returns statistics for Intel RDT -func (m *IntelRdtManager) GetStats() (*Stats, error) { +func (m *intelRdtManager) GetStats() (*Stats, error) { // If intelRdt is not specified in config - if m.Config.IntelRdt == nil { + if m.config.IntelRdt == nil { return nil, nil } @@ -620,7 +628,7 @@ func (m *IntelRdtManager) GetStats() (*Stats, error) { } schemaStrings := strings.Split(tmpStrings, "\n") - if IsCatEnabled() { + if IsCATEnabled() { // The read-only L3 cache information l3CacheInfo, err := getL3CacheInfo() if err != nil { @@ -643,7 +651,7 @@ func (m *IntelRdtManager) GetStats() (*Stats, error) { } } - if IsMbaEnabled() { + if IsMBAEnabled() { // The read-only memory bandwidth information memBwInfo, err := getMemBwInfo() if err != nil { @@ -666,16 +674,18 @@ func (m *IntelRdtManager) GetStats() (*Stats, error) { } } - err = getMonitoringStats(containerPath, stats) - if err != nil { - return nil, err + if IsMBMEnabled() || IsCMTEnabled() { + err = getMonitoringStats(containerPath, stats) + if err != nil { + return nil, err + } } return stats, nil } // Set Intel RDT "resource control" filesystem as configured. -func (m *IntelRdtManager) Set(container *configs.Config) error { +func (m *intelRdtManager) Set(container *configs.Config) error { // About L3 cache schema: // It has allocation bitmasks/values for L3 cache on each socket, // which contains L3 cache id and capacity bitmask (CBM). @@ -753,7 +763,7 @@ func (m *IntelRdtManager) Set(container *configs.Config) error { func (raw *intelRdtData) join(id string) (string, error) { path := filepath.Join(raw.root, id) - if err := os.MkdirAll(path, 0755); err != nil { + if err := os.MkdirAll(path, 0o755); err != nil { return "", NewLastCmdError(err) } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/mbm.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/mbm.go index 3730bab56448..93063ee01905 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/mbm.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/mbm.go @@ -9,6 +9,7 @@ var ( // Check if Intel RDT/MBM is enabled. func IsMBMEnabled() bool { + featuresInit() return mbmEnabled } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/monitoring.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/monitoring.go index 4ccc8eae050c..78c2f624c960 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/monitoring.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/monitoring.go @@ -2,11 +2,12 @@ package intelrdt import ( "bufio" - "github.com/sirupsen/logrus" "io" "io/ioutil" "os" "path/filepath" + + "github.com/sirupsen/logrus" ) var ( @@ -21,10 +22,10 @@ type monFeatures struct { func getMonFeatures(intelRdtRoot string) (monFeatures, error) { file, err := os.Open(filepath.Join(intelRdtRoot, "info", "L3_MON", "mon_features")) - defer file.Close() if err != nil { return monFeatures{}, err } + defer file.Close() return parseMonFeatures(file) } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/stats.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/stats.go index eeb0ee9f0d8e..70df0d14e6ce 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/stats.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/stats.go @@ -17,15 +17,15 @@ type MemBwInfo struct { type MBMNumaNodeStats struct { // The 'mbm_total_bytes' in 'container_id' group. - MBMTotalBytes uint64 `json:"mbm_total_bytes,omitempty"` + MBMTotalBytes uint64 `json:"mbm_total_bytes"` // The 'mbm_local_bytes' in 'container_id' group. - MBMLocalBytes uint64 `json:"mbm_local_bytes,omitempty"` + MBMLocalBytes uint64 `json:"mbm_local_bytes"` } type CMTNumaNodeStats struct { // The 'llc_occupancy' in 'container_id' group. - LLCOccupancy uint64 `json:"llc_occupancy,omitempty"` + LLCOccupancy uint64 `json:"llc_occupancy"` } type Stats struct { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/network_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/network_linux.go index 938d8ce0640f..a0a87b9842af 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/network_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/network_linux.go @@ -3,11 +3,11 @@ package libcontainer import ( + "bytes" "fmt" "io/ioutil" "path/filepath" "strconv" - "strings" "github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/types" @@ -79,7 +79,7 @@ func readSysfsNetworkStats(ethInterface, statsFile string) (uint64, error) { if err != nil { return 0, err } - return strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64) + return strconv.ParseUint(string(bytes.TrimSpace(data)), 10, 64) } // loopback is a network strategy that provides a basic loopback device diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/process_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/process_linux.go index cb8c724a206e..834268b99571 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/process_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/process_linux.go @@ -11,6 +11,7 @@ import ( "os/exec" "path/filepath" "strconv" + "time" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fs2" @@ -85,21 +86,29 @@ func (p *setnsProcess) signal(sig os.Signal) error { return unix.Kill(p.pid(), s) } -func (p *setnsProcess) start() (err error) { +func (p *setnsProcess) start() (retErr error) { defer p.messageSockPair.parent.Close() - err = p.cmd.Start() + err := p.cmd.Start() // close the write-side of the pipes (controlled by child) p.messageSockPair.child.Close() p.logFilePair.child.Close() if err != nil { return newSystemErrorWithCause(err, "starting setns process") } + defer func() { + if retErr != nil { + err := ignoreTerminateErrors(p.terminate()) + if err != nil { + logrus.WithError(err).Warn("unable to terminate setnsProcess") + } + } + }() if p.bootstrapData != nil { if _, err := io.Copy(p.messageSockPair.parent, p.bootstrapData); err != nil { return newSystemErrorWithCause(err, "copying bootstrap data to pipe") } } - if err = p.execSetns(); err != nil { + if err := p.execSetns(); err != nil { return newSystemErrorWithCause(err, "executing setns process") } if len(p.cgroupPaths) > 0 { @@ -312,6 +321,11 @@ func (p *initProcess) start() (retErr error) { } defer func() { if retErr != nil { + // terminate the process to ensure we can remove cgroups + if err := ignoreTerminateErrors(p.terminate()); err != nil { + logrus.WithError(err).Warn("unable to terminate initProcess") + } + p.manager.Destroy() if p.intelRdtManager != nil { p.intelRdtManager.Destroy() @@ -411,6 +425,28 @@ func (p *initProcess) start() (retErr error) { } } } + + // generate a timestamp indicating when the container was started + p.container.created = time.Now().UTC() + p.container.state = &createdState{ + c: p.container, + } + + // NOTE: If the procRun state has been synced and the + // runc-create process has been killed for some reason, + // the runc-init[2:stage] process will be leaky. And + // the runc command also fails to parse root directory + // because the container doesn't have state.json. + // + // In order to cleanup the runc-init[2:stage] by + // runc-delete/stop, we should store the status before + // procRun sync. + state, uerr := p.container.updateState(p) + if uerr != nil { + return newSystemErrorWithCause(err, "store init state") + } + p.container.initProcessStartTime = state.InitProcessStartTime + // Sync with child. if err := writeSync(p.messageSockPair.parent, procRun); err != nil { return newSystemErrorWithCause(err, "writing syncT 'run'") @@ -475,14 +511,11 @@ func (p *initProcess) start() (retErr error) { func (p *initProcess) wait() (*os.ProcessState, error) { err := p.cmd.Wait() - if err != nil { - return p.cmd.ProcessState, err - } // we should kill all processes in cgroup when init is died if we use host PID namespace if p.sharePidns { signalAllProcesses(p.manager, unix.SIGKILL) } - return p.cmd.ProcessState, nil + return p.cmd.ProcessState, err } func (p *initProcess) terminate() error { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux.go index e00df0a2c123..411496ab7c6d 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux.go @@ -18,11 +18,12 @@ import ( "github.com/mrunalp/fileutils" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/runc/libcontainer/devices" "github.com/opencontainers/runc/libcontainer/system" + "github.com/opencontainers/runc/libcontainer/utils" libcontainerUtils "github.com/opencontainers/runc/libcontainer/utils" "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/selinux/go-selinux/label" - "golang.org/x/sys/unix" ) @@ -156,7 +157,11 @@ func finalizeRootfs(config *configs.Config) (err error) { } } - unix.Umask(0022) + if config.Umask != nil { + unix.Umask(int(*config.Umask)) + } else { + unix.Umask(0022) + } return nil } @@ -328,17 +333,20 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string, enableCgroupns b if err := os.MkdirAll(dest, 0755); err != nil { return err } - if err := mountPropagate(m, rootfs, mountLabel); err != nil { - // older kernels do not support labeling of /dev/mqueue - if err := mountPropagate(m, rootfs, ""); err != nil { - return err - } - return label.SetFileLabel(dest, mountLabel) + if err := mountPropagate(m, rootfs, ""); err != nil { + return err } - return nil + return label.SetFileLabel(dest, mountLabel) case "tmpfs": copyUp := m.Extensions&configs.EXT_COPYUP == configs.EXT_COPYUP tmpDir := "" + // dest might be an absolute symlink, so it needs + // to be resolved under rootfs. + dest, err := securejoin.SecureJoin(rootfs, m.Destination) + if err != nil { + return err + } + m.Destination = dest stat, err := os.Stat(dest) if err != nil { if err := os.MkdirAll(dest, 0755); err != nil { @@ -382,6 +390,12 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string, enableCgroupns b return err } } + // Initially mounted rw in mountPropagate, remount to ro if flag set. + if m.Flags&unix.MS_RDONLY != 0 { + if err := remount(m, rootfs); err != nil { + return err + } + } return nil case "bind": if err := prepareBindMount(m, rootfs); err != nil { @@ -475,28 +489,6 @@ func getCgroupMounts(m *configs.Mount) ([]*configs.Mount, error) { // if source is nil, don't stat the filesystem. This is used for restore of a checkpoint. func checkProcMount(rootfs, dest, source string) error { const procPath = "/proc" - // White list, it should be sub directories of invalid destinations - validDestinations := []string{ - // These entries can be bind mounted by files emulated by fuse, - // so commands like top, free displays stats in container. - "/proc/cpuinfo", - "/proc/diskstats", - "/proc/meminfo", - "/proc/stat", - "/proc/swaps", - "/proc/uptime", - "/proc/loadavg", - "/proc/net/dev", - } - for _, valid := range validDestinations { - path, err := filepath.Rel(filepath.Join(rootfs, valid), dest) - if err != nil { - return err - } - if path == "." { - return nil - } - } path, err := filepath.Rel(filepath.Join(rootfs, procPath), dest) if err != nil { return err @@ -522,6 +514,30 @@ func checkProcMount(rootfs, dest, source string) error { } return fmt.Errorf("%q cannot be mounted because it is not of type proc", dest) } + + // Here dest is definitely under /proc. Do not allow those, + // except for a few specific entries emulated by lxcfs. + validProcMounts := []string{ + "/proc/cpuinfo", + "/proc/diskstats", + "/proc/meminfo", + "/proc/stat", + "/proc/swaps", + "/proc/uptime", + "/proc/loadavg", + "/proc/slabinfo", + "/proc/net/dev", + } + for _, valid := range validProcMounts { + path, err := filepath.Rel(filepath.Join(rootfs, valid), dest) + if err != nil { + return err + } + if path == "." { + return nil + } + } + return fmt.Errorf("%q cannot be mounted because it is inside /proc", dest) } @@ -590,6 +606,12 @@ func createDevices(config *configs.Config) error { useBindMount := system.RunningInUserNS() || config.Namespaces.Contains(configs.NEWUSER) oldMask := unix.Umask(0000) for _, node := range config.Devices { + + // The /dev/ptmx device is setup by setupPtmx() + if utils.CleanPath(node.Path) == "/dev/ptmx" { + continue + } + // containers running in a user namespace are not allowed to mknod // devices so we can just bind mount it from the host. if err := createDeviceNode(config.Rootfs, node, useBindMount); err != nil { @@ -601,7 +623,7 @@ func createDevices(config *configs.Config) error { return nil } -func bindMountDeviceNode(dest string, node *configs.Device) error { +func bindMountDeviceNode(dest string, node *devices.Device) error { f, err := os.Create(dest) if err != nil && !os.IsExist(err) { return err @@ -613,7 +635,7 @@ func bindMountDeviceNode(dest string, node *configs.Device) error { } // Creates the device node in the rootfs of the container. -func createDeviceNode(rootfs string, node *configs.Device, bind bool) error { +func createDeviceNode(rootfs string, node *devices.Device, bind bool) error { if node.Path == "" { // The node only exists for cgroup reasons, ignore it here. return nil @@ -636,14 +658,14 @@ func createDeviceNode(rootfs string, node *configs.Device, bind bool) error { return nil } -func mknodDevice(dest string, node *configs.Device) error { +func mknodDevice(dest string, node *devices.Device) error { fileMode := node.FileMode switch node.Type { - case configs.BlockDevice: + case devices.BlockDevice: fileMode |= unix.S_IFBLK - case configs.CharDevice: + case devices.CharDevice: fileMode |= unix.S_IFCHR - case configs.FifoDevice: + case devices.FifoDevice: fileMode |= unix.S_IFIFO default: return fmt.Errorf("%c is not a valid device type for device %s", node.Type, node.Path) @@ -728,7 +750,19 @@ func prepareRoot(config *configs.Config) error { } func setReadonly() error { - return unix.Mount("/", "/", "bind", unix.MS_BIND|unix.MS_REMOUNT|unix.MS_RDONLY|unix.MS_REC, "") + flags := uintptr(unix.MS_BIND | unix.MS_REMOUNT | unix.MS_RDONLY) + + err := unix.Mount("", "/", "", flags, "") + if err == nil { + return nil + } + var s unix.Statfs_t + if err := unix.Statfs("/", &s); err != nil { + return &os.PathError{Op: "statfs", Path: "/", Err: err} + } + flags |= uintptr(s.Flags) + return unix.Mount("", "/", "", flags, "") + } func setupPtmx(config *configs.Config) error { @@ -802,24 +836,46 @@ func pivotRoot(rootfs string) error { } func msMoveRoot(rootfs string) error { + // Before we move the root and chroot we have to mask all "full" sysfs and + // procfs mounts which exist on the host. This is because while the kernel + // has protections against mounting procfs if it has masks, when using + // chroot(2) the *host* procfs mount is still reachable in the mount + // namespace and the kernel permits procfs mounts inside --no-pivot + // containers. + // + // Users shouldn't be using --no-pivot except in exceptional circumstances, + // but to avoid such a trivial security flaw we apply a best-effort + // protection here. The kernel only allows a mount of a pseudo-filesystem + // like procfs or sysfs if there is a *full* mount (the root of the + // filesystem is mounted) without any other locked mount points covering a + // subtree of the mount. + // + // So we try to unmount (or mount tmpfs on top of) any mountpoint which is + // a full mount of either sysfs or procfs (since those are the most + // concerning filesystems to us). mountinfos, err := mountinfo.GetMounts(func(info *mountinfo.Info) (skip, stop bool) { - skip = false - stop = false - // Collect every sysfs and proc file systems, except those under the container rootfs - if (info.Fstype != "proc" && info.Fstype != "sysfs") || strings.HasPrefix(info.Mountpoint, rootfs) { + // Collect every sysfs and procfs filesystem, except for those which + // are non-full mounts or are inside the rootfs of the container. + if info.Root != "/" || + (info.FSType != "proc" && info.FSType != "sysfs") || + strings.HasPrefix(info.Mountpoint, rootfs) { skip = true - return } return }) if err != nil { return err } - for _, info := range mountinfos { p := info.Mountpoint // Be sure umount events are not propagated to the host. if err := unix.Mount("", p, "", unix.MS_SLAVE|unix.MS_REC, ""); err != nil { + if err == unix.ENOENT { + // If the mountpoint doesn't exist that means that we've + // already blasted away some parent directory of the mountpoint + // and so we don't care about this error. + continue + } return err } if err := unix.Unmount(p, unix.MNT_DETACH); err != nil { @@ -834,6 +890,8 @@ func msMoveRoot(rootfs string) error { } } } + + // Move the rootfs on top of "/" in our mount namespace. if err := unix.Mount(rootfs, "/", "", unix.MS_MOVE, ""); err != nil { return err } @@ -950,6 +1008,12 @@ func mountPropagate(m *configs.Mount, rootfs string, mountLabel string) error { flags &= ^unix.MS_RDONLY } + // Mount it rw to allow chmod operation. A remount will be performed + // later to make it ro if set. + if m.Device == "tmpfs" { + flags &= ^unix.MS_RDONLY + } + copyUp := m.Extensions&configs.EXT_COPYUP == configs.EXT_COPYUP if !(copyUp || strings.HasPrefix(dest, rootfs)) { dest = filepath.Join(rootfs, dest) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/config.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/config.go index c32122798759..b54b7eead3b7 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/config.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/config.go @@ -49,7 +49,7 @@ var archs = map[string]string{ // Attempting to convert a string that is not a valid operator results in an // error. func ConvertStringToOperator(in string) (configs.Operator, error) { - if op, ok := operators[in]; ok == true { + if op, ok := operators[in]; ok { return op, nil } return 0, fmt.Errorf("string %s is not a valid operator for seccomp", in) @@ -62,7 +62,7 @@ func ConvertStringToOperator(in string) (configs.Operator, error) { // Attempting to convert a string that is not a valid action results in an // error. func ConvertStringToAction(in string) (configs.Action, error) { - if act, ok := actions[in]; ok == true { + if act, ok := actions[in]; ok { return act, nil } return 0, fmt.Errorf("string %s is not a valid action for seccomp", in) @@ -70,7 +70,7 @@ func ConvertStringToAction(in string) (configs.Action, error) { // ConvertStringToArch converts a string into a Seccomp comparison arch. func ConvertStringToArch(in string) (string, error) { - if arch, ok := archs[in]; ok == true { + if arch, ok := archs[in]; ok { return arch, nil } return "", fmt.Errorf("string %s is not a valid arch for seccomp", in) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go new file mode 100644 index 000000000000..cdbd59da0952 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go @@ -0,0 +1,628 @@ +// +build linux,cgo,seccomp + +package patchbpf + +import ( + "encoding/binary" + "io" + "os" + "runtime" + "unsafe" + + "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/runc/libcontainer/utils" + + "github.com/pkg/errors" + libseccomp "github.com/seccomp/libseccomp-golang" + "github.com/sirupsen/logrus" + "golang.org/x/net/bpf" + "golang.org/x/sys/unix" +) + +// #cgo pkg-config: libseccomp +/* +#include +#include +#include +#include + +const uint32_t C_ACT_ERRNO_ENOSYS = SCMP_ACT_ERRNO(ENOSYS); + +// Copied from . + +#ifndef SECCOMP_SET_MODE_FILTER +# define SECCOMP_SET_MODE_FILTER 1 +#endif +const uintptr_t C_SET_MODE_FILTER = SECCOMP_SET_MODE_FILTER; + +#ifndef SECCOMP_FILTER_FLAG_LOG +# define SECCOMP_FILTER_FLAG_LOG (1UL << 1) +#endif +const uintptr_t C_FILTER_FLAG_LOG = SECCOMP_FILTER_FLAG_LOG; + +// We use the AUDIT_ARCH_* values because those are the ones used by the kernel +// and SCMP_ARCH_* sometimes has fake values (such as SCMP_ARCH_X32). But we +// use so we get libseccomp's fallback definitions of AUDIT_ARCH_*. + +const uint32_t C_AUDIT_ARCH_I386 = AUDIT_ARCH_I386; +const uint32_t C_AUDIT_ARCH_X86_64 = AUDIT_ARCH_X86_64; +const uint32_t C_AUDIT_ARCH_ARM = AUDIT_ARCH_ARM; +const uint32_t C_AUDIT_ARCH_AARCH64 = AUDIT_ARCH_AARCH64; +const uint32_t C_AUDIT_ARCH_MIPS = AUDIT_ARCH_MIPS; +const uint32_t C_AUDIT_ARCH_MIPS64 = AUDIT_ARCH_MIPS64; +const uint32_t C_AUDIT_ARCH_MIPS64N32 = AUDIT_ARCH_MIPS64N32; +const uint32_t C_AUDIT_ARCH_MIPSEL = AUDIT_ARCH_MIPSEL; +const uint32_t C_AUDIT_ARCH_MIPSEL64 = AUDIT_ARCH_MIPSEL64; +const uint32_t C_AUDIT_ARCH_MIPSEL64N32 = AUDIT_ARCH_MIPSEL64N32; +const uint32_t C_AUDIT_ARCH_PPC = AUDIT_ARCH_PPC; +const uint32_t C_AUDIT_ARCH_PPC64 = AUDIT_ARCH_PPC64; +const uint32_t C_AUDIT_ARCH_PPC64LE = AUDIT_ARCH_PPC64LE; +const uint32_t C_AUDIT_ARCH_S390 = AUDIT_ARCH_S390; +const uint32_t C_AUDIT_ARCH_S390X = AUDIT_ARCH_S390X; +*/ +import "C" + +var retErrnoEnosys = uint32(C.C_ACT_ERRNO_ENOSYS) + +func isAllowAction(action configs.Action) bool { + switch action { + // Trace is considered an "allow" action because a good tracer should + // support future syscalls (by handling -ENOSYS on its own), and giving + // -ENOSYS will be disruptive for emulation. + case configs.Allow, configs.Log, configs.Trace: + return true + default: + return false + } +} + +func parseProgram(rdr io.Reader) ([]bpf.RawInstruction, error) { + var program []bpf.RawInstruction +loop: + for { + // Read the next instruction. We have to use NativeEndian because + // seccomp_export_bpf outputs the program in *host* endian-ness. + var insn unix.SockFilter + if err := binary.Read(rdr, utils.NativeEndian, &insn); err != nil { + switch err { + case io.EOF: + // Parsing complete. + break loop + case io.ErrUnexpectedEOF: + // Parsing stopped mid-instruction. + return nil, errors.Wrap(err, "program parsing halted mid-instruction") + default: + // All other errors. + return nil, errors.Wrap(err, "parsing instructions") + } + } + program = append(program, bpf.RawInstruction{ + Op: insn.Code, + Jt: insn.Jt, + Jf: insn.Jf, + K: insn.K, + }) + } + return program, nil +} + +func disassembleFilter(filter *libseccomp.ScmpFilter) ([]bpf.Instruction, error) { + rdr, wtr, err := os.Pipe() + if err != nil { + return nil, errors.Wrap(err, "creating scratch pipe") + } + defer wtr.Close() + defer rdr.Close() + + if err := filter.ExportBPF(wtr); err != nil { + return nil, errors.Wrap(err, "exporting BPF") + } + // Close so that the reader actually gets EOF. + _ = wtr.Close() + + // Parse the instructions. + rawProgram, err := parseProgram(rdr) + if err != nil { + return nil, errors.Wrap(err, "parsing generated BPF filter") + } + program, ok := bpf.Disassemble(rawProgram) + if !ok { + return nil, errors.Errorf("could not disassemble entire BPF filter") + } + return program, nil +} + +type nativeArch uint32 + +const invalidArch nativeArch = 0 + +func archToNative(arch libseccomp.ScmpArch) (nativeArch, error) { + switch arch { + case libseccomp.ArchNative: + // Convert to actual native architecture. + arch, err := libseccomp.GetNativeArch() + if err != nil { + return invalidArch, errors.Wrap(err, "get native arch") + } + return archToNative(arch) + case libseccomp.ArchX86: + return nativeArch(C.C_AUDIT_ARCH_I386), nil + case libseccomp.ArchAMD64, libseccomp.ArchX32: + // NOTE: x32 is treated like x86_64 except all x32 syscalls have the + // 30th bit of the syscall number set to indicate that it's not a + // normal x86_64 syscall. + return nativeArch(C.C_AUDIT_ARCH_X86_64), nil + case libseccomp.ArchARM: + return nativeArch(C.C_AUDIT_ARCH_ARM), nil + case libseccomp.ArchARM64: + return nativeArch(C.C_AUDIT_ARCH_AARCH64), nil + case libseccomp.ArchMIPS: + return nativeArch(C.C_AUDIT_ARCH_MIPS), nil + case libseccomp.ArchMIPS64: + return nativeArch(C.C_AUDIT_ARCH_MIPS64), nil + case libseccomp.ArchMIPS64N32: + return nativeArch(C.C_AUDIT_ARCH_MIPS64N32), nil + case libseccomp.ArchMIPSEL: + return nativeArch(C.C_AUDIT_ARCH_MIPSEL), nil + case libseccomp.ArchMIPSEL64: + return nativeArch(C.C_AUDIT_ARCH_MIPSEL64), nil + case libseccomp.ArchMIPSEL64N32: + return nativeArch(C.C_AUDIT_ARCH_MIPSEL64N32), nil + case libseccomp.ArchPPC: + return nativeArch(C.C_AUDIT_ARCH_PPC), nil + case libseccomp.ArchPPC64: + return nativeArch(C.C_AUDIT_ARCH_PPC64), nil + case libseccomp.ArchPPC64LE: + return nativeArch(C.C_AUDIT_ARCH_PPC64LE), nil + case libseccomp.ArchS390: + return nativeArch(C.C_AUDIT_ARCH_S390), nil + case libseccomp.ArchS390X: + return nativeArch(C.C_AUDIT_ARCH_S390X), nil + default: + return invalidArch, errors.Errorf("unknown architecture: %v", arch) + } +} + +type lastSyscallMap map[nativeArch]map[libseccomp.ScmpArch]libseccomp.ScmpSyscall + +// Figure out largest syscall number referenced in the filter for each +// architecture. We will be generating code based on the native architecture +// representation, but SCMP_ARCH_X32 means we have to track cases where the +// same architecture has different largest syscalls based on the mode. +func findLastSyscalls(config *configs.Seccomp) (lastSyscallMap, error) { + lastSyscalls := make(lastSyscallMap) + // Only loop over architectures which are present in the filter. Any other + // architectures will get the libseccomp bad architecture action anyway. + for _, ociArch := range config.Architectures { + arch, err := libseccomp.GetArchFromString(ociArch) + if err != nil { + return nil, errors.Wrap(err, "validating seccomp architecture") + } + + // Map native architecture to a real architecture value to avoid + // doubling-up the lastSyscall mapping. + if arch == libseccomp.ArchNative { + nativeArch, err := libseccomp.GetNativeArch() + if err != nil { + return nil, errors.Wrap(err, "get native arch") + } + arch = nativeArch + } + + // Figure out native architecture representation of the architecture. + nativeArch, err := archToNative(arch) + if err != nil { + return nil, errors.Wrapf(err, "cannot map architecture %v to AUDIT_ARCH_ constant", arch) + } + + if _, ok := lastSyscalls[nativeArch]; !ok { + lastSyscalls[nativeArch] = map[libseccomp.ScmpArch]libseccomp.ScmpSyscall{} + } + if _, ok := lastSyscalls[nativeArch][arch]; ok { + // Because of ArchNative we may hit the same entry multiple times. + // Just skip it if we've seen this (nativeArch, ScmpArch) + // combination before. + continue + } + + // Find the largest syscall in the filter for this architecture. + var largestSyscall libseccomp.ScmpSyscall + for _, rule := range config.Syscalls { + sysno, err := libseccomp.GetSyscallFromNameByArch(rule.Name, arch) + if err != nil { + // Ignore unknown syscalls. + continue + } + if sysno > largestSyscall { + largestSyscall = sysno + } + } + if largestSyscall != 0 { + lastSyscalls[nativeArch][arch] = largestSyscall + } else { + logrus.Warnf("could not find any syscalls for arch %s", ociArch) + delete(lastSyscalls[nativeArch], arch) + } + } + return lastSyscalls, nil +} + +// FIXME FIXME FIXME +// +// This solution is less than ideal. In the future it would be great to have +// per-arch information about which syscalls were added in which kernel +// versions so we can create far more accurate filter rules (handling holes in +// the syscall table and determining -ENOSYS requirements based on kernel +// minimum version alone. +// +// This implementation can in principle cause issues with syscalls like +// close_range(2) which were added out-of-order in the syscall table between +// kernel releases. +func generateEnosysStub(lastSyscalls lastSyscallMap) ([]bpf.Instruction, error) { + // A jump-table for each nativeArch used to generate the initial + // conditional jumps -- measured from the *END* of the program so they + // remain valid after prepending to the tail. + archJumpTable := map[nativeArch]uint32{} + + // Generate our own -ENOSYS rules for each architecture. They have to be + // generated in reverse (prepended to the tail of the program) because the + // JumpIf jumps need to be computed from the end of the program. + programTail := []bpf.Instruction{ + // Fall-through rules jump into the filter. + bpf.Jump{Skip: 1}, + // Rules which jump to here get -ENOSYS. + bpf.RetConstant{Val: retErrnoEnosys}, + } + + // Generate the syscall -ENOSYS rules. + for nativeArch, maxSyscalls := range lastSyscalls { + // The number of instructions from the tail of this section which need + // to be jumped in order to reach the -ENOSYS return. If the section + // does not jump, it will fall through to the actual filter. + baseJumpEnosys := uint32(len(programTail) - 1) + baseJumpFilter := baseJumpEnosys + 1 + + // Add the load instruction for the syscall number -- we jump here + // directly from the arch code so we need to do it here. Sadly we can't + // share this code between architecture branches. + section := []bpf.Instruction{ + // load [0] + bpf.LoadAbsolute{Off: 0, Size: 4}, // NOTE: We assume sizeof(int) == 4. + } + + switch len(maxSyscalls) { + case 0: + // No syscalls found for this arch -- skip it and move on. + continue + case 1: + // Get the only syscall in the map. + var sysno libseccomp.ScmpSyscall + for _, no := range maxSyscalls { + sysno = no + } + + // The simplest case just boils down to a single jgt instruction, + // with special handling if baseJumpEnosys is larger than 255 (and + // thus a long jump is required). + var sectionTail []bpf.Instruction + if baseJumpEnosys+1 <= 255 { + sectionTail = []bpf.Instruction{ + // jgt [syscall],[baseJumpEnosys+1] + bpf.JumpIf{ + Cond: bpf.JumpGreaterThan, + Val: uint32(sysno), + SkipTrue: uint8(baseJumpEnosys + 1)}, + // ja [baseJumpFilter] + bpf.Jump{Skip: baseJumpFilter}, + } + } else { + sectionTail = []bpf.Instruction{ + // jle [syscall],1 + bpf.JumpIf{Cond: bpf.JumpLessOrEqual, Val: uint32(sysno), SkipTrue: 1}, + // ja [baseJumpEnosys+1] + bpf.Jump{Skip: baseJumpEnosys + 1}, + // ja [baseJumpFilter] + bpf.Jump{Skip: baseJumpFilter}, + } + } + + // If we're on x86 we need to add a check for x32 and if we're in + // the wrong mode we jump over the section. + if uint32(nativeArch) == uint32(C.C_AUDIT_ARCH_X86_64) { + // Grab the only architecture in the map. + var scmpArch libseccomp.ScmpArch + for arch := range maxSyscalls { + scmpArch = arch + } + + // Generate a prefix to check the mode. + switch scmpArch { + case libseccomp.ArchAMD64: + sectionTail = append([]bpf.Instruction{ + // jset (1<<30),[len(tail)-1] + bpf.JumpIf{Cond: bpf.JumpBitsSet, + Val: 1 << 30, + SkipTrue: uint8(len(sectionTail) - 1)}, + }, sectionTail...) + case libseccomp.ArchX32: + sectionTail = append([]bpf.Instruction{ + // jset (1<<30),0,[len(tail)-1] + bpf.JumpIf{Cond: bpf.JumpBitsNotSet, + Val: 1 << 30, + SkipTrue: uint8(len(sectionTail) - 1)}, + }, sectionTail...) + default: + return nil, errors.Errorf("unknown amd64 native architecture %#x", scmpArch) + } + } + + section = append(section, sectionTail...) + case 2: + // x32 and x86_64 are a unique case, we can't handle any others. + if uint32(nativeArch) != uint32(C.C_AUDIT_ARCH_X86_64) { + return nil, errors.Errorf("unknown architecture overlap on native arch %#x", nativeArch) + } + + x32sysno, ok := maxSyscalls[libseccomp.ArchX32] + if !ok { + return nil, errors.Errorf("missing %v in overlapping x86_64 arch: %v", libseccomp.ArchX32, maxSyscalls) + } + x86sysno, ok := maxSyscalls[libseccomp.ArchAMD64] + if !ok { + return nil, errors.Errorf("missing %v in overlapping x86_64 arch: %v", libseccomp.ArchAMD64, maxSyscalls) + } + + // The x32 ABI indicates that a syscall is being made by an x32 + // process by setting the 30th bit of the syscall number, but we + // need to do some special-casing depending on whether we need to + // do long jumps. + if baseJumpEnosys+2 <= 255 { + // For the simple case we want to have something like: + // jset (1<<30),1 + // jgt [x86 syscall],[baseJumpEnosys+2],1 + // jgt [x32 syscall],[baseJumpEnosys+1] + // ja [baseJumpFilter] + section = append(section, []bpf.Instruction{ + // jset (1<<30),1 + bpf.JumpIf{Cond: bpf.JumpBitsSet, Val: 1 << 30, SkipTrue: 1}, + // jgt [x86 syscall],[baseJumpEnosys+1],1 + bpf.JumpIf{ + Cond: bpf.JumpGreaterThan, + Val: uint32(x86sysno), + SkipTrue: uint8(baseJumpEnosys + 2), SkipFalse: 1}, + // jgt [x32 syscall],[baseJumpEnosys] + bpf.JumpIf{ + Cond: bpf.JumpGreaterThan, + Val: uint32(x32sysno), + SkipTrue: uint8(baseJumpEnosys + 1)}, + // ja [baseJumpFilter] + bpf.Jump{Skip: baseJumpFilter}, + }...) + } else { + // But if the [baseJumpEnosys+2] jump is larger than 255 we + // need to do a long jump like so: + // jset (1<<30),1 + // jgt [x86 syscall],1,2 + // jle [x32 syscall],1 + // ja [baseJumpEnosys+1] + // ja [baseJumpFilter] + section = append(section, []bpf.Instruction{ + // jset (1<<30),1 + bpf.JumpIf{Cond: bpf.JumpBitsSet, Val: 1 << 30, SkipTrue: 1}, + // jgt [x86 syscall],1,2 + bpf.JumpIf{ + Cond: bpf.JumpGreaterThan, + Val: uint32(x86sysno), + SkipTrue: 1, SkipFalse: 2}, + // jle [x32 syscall],[baseJumpEnosys] + bpf.JumpIf{ + Cond: bpf.JumpLessOrEqual, + Val: uint32(x32sysno), + SkipTrue: 1}, + // ja [baseJumpEnosys+1] + bpf.Jump{Skip: baseJumpEnosys + 1}, + // ja [baseJumpFilter] + bpf.Jump{Skip: baseJumpFilter}, + }...) + } + default: + return nil, errors.Errorf("invalid number of architecture overlaps: %v", len(maxSyscalls)) + } + + // Prepend this section to the tail. + programTail = append(section, programTail...) + + // Update jump table. + archJumpTable[nativeArch] = uint32(len(programTail)) + } + + // Add a dummy "jump to filter" for any architecture we might miss below. + // Such architectures will probably get the BadArch action of the filter + // regardless. + programTail = append([]bpf.Instruction{ + // ja [end of stub and start of filter] + bpf.Jump{Skip: uint32(len(programTail))}, + }, programTail...) + + // Generate the jump rules for each architecture. This has to be done in + // reverse as well for the same reason as above. We add to programTail + // directly because the jumps are impacted by each architecture rule we add + // as well. + // + // TODO: Maybe we want to optimise to avoid long jumps here? So sort the + // architectures based on how large the jumps are going to be, or + // re-sort the candidate architectures each time to make sure that we + // pick the largest jump which is going to be smaller than 255. + for nativeArch := range lastSyscalls { + // We jump forwards but the jump table is calculated from the *END*. + jump := uint32(len(programTail)) - archJumpTable[nativeArch] + + // Same routine as above -- this is a basic jeq check, complicated + // slightly if it turns out that we need to do a long jump. + if jump <= 255 { + programTail = append([]bpf.Instruction{ + // jeq [arch],[jump] + bpf.JumpIf{ + Cond: bpf.JumpEqual, + Val: uint32(nativeArch), + SkipTrue: uint8(jump)}, + }, programTail...) + } else { + programTail = append([]bpf.Instruction{ + // jne [arch],1 + bpf.JumpIf{ + Cond: bpf.JumpNotEqual, + Val: uint32(nativeArch), + SkipTrue: 1}, + // ja [jump] + bpf.Jump{Skip: jump}, + }, programTail...) + } + } + + // Prepend the load instruction for the architecture. + programTail = append([]bpf.Instruction{ + // load [4] + bpf.LoadAbsolute{Off: 4, Size: 4}, // NOTE: We assume sizeof(int) == 4. + }, programTail...) + + // And that's all folks! + return programTail, nil +} + +func assemble(program []bpf.Instruction) ([]unix.SockFilter, error) { + rawProgram, err := bpf.Assemble(program) + if err != nil { + return nil, errors.Wrap(err, "assembling program") + } + + // Convert to []unix.SockFilter for unix.SockFilter. + var filter []unix.SockFilter + for _, insn := range rawProgram { + filter = append(filter, unix.SockFilter{ + Code: insn.Op, + Jt: insn.Jt, + Jf: insn.Jf, + K: insn.K, + }) + } + return filter, nil +} + +func generatePatch(config *configs.Seccomp) ([]bpf.Instruction, error) { + // We only add the stub if the default action is not permissive. + if isAllowAction(config.DefaultAction) { + logrus.Debugf("seccomp: skipping -ENOSYS stub filter generation") + return nil, nil + } + + lastSyscalls, err := findLastSyscalls(config) + if err != nil { + return nil, errors.Wrap(err, "finding last syscalls for -ENOSYS stub") + } + stubProgram, err := generateEnosysStub(lastSyscalls) + if err != nil { + return nil, errors.Wrap(err, "generating -ENOSYS stub") + } + return stubProgram, nil +} + +func enosysPatchFilter(config *configs.Seccomp, filter *libseccomp.ScmpFilter) ([]unix.SockFilter, error) { + program, err := disassembleFilter(filter) + if err != nil { + return nil, errors.Wrap(err, "disassembling original filter") + } + + patch, err := generatePatch(config) + if err != nil { + return nil, errors.Wrap(err, "generating patch for filter") + } + fullProgram := append(patch, program...) + + logrus.Debugf("seccomp: prepending -ENOSYS stub filter to user filter...") + for idx, insn := range patch { + logrus.Debugf(" [%4.1d] %s", idx, insn) + } + logrus.Debugf(" [....] --- original filter ---") + + fprog, err := assemble(fullProgram) + if err != nil { + return nil, errors.Wrap(err, "assembling modified filter") + } + return fprog, nil +} + +func filterFlags(filter *libseccomp.ScmpFilter) (flags uint, noNewPrivs bool, err error) { + // Ignore the error since pre-2.4 libseccomp is treated as API level 0. + apiLevel, _ := libseccomp.GetApi() + + noNewPrivs, err = filter.GetNoNewPrivsBit() + if err != nil { + return 0, false, errors.Wrap(err, "fetch no_new_privs filter bit") + } + + if apiLevel >= 3 { + if logBit, err := filter.GetLogBit(); err != nil { + return 0, false, errors.Wrap(err, "fetch SECCOMP_FILTER_FLAG_LOG bit") + } else if logBit { + flags |= uint(C.C_FILTER_FLAG_LOG) + } + } + + // TODO: Support seccomp flags not yet added to libseccomp-golang... + return +} + +func sysSeccompSetFilter(flags uint, filter []unix.SockFilter) (err error) { + fprog := unix.SockFprog{ + Len: uint16(len(filter)), + Filter: &filter[0], + } + // If no seccomp flags were requested we can use the old-school prctl(2). + if flags == 0 { + err = unix.Prctl(unix.PR_SET_SECCOMP, + unix.SECCOMP_MODE_FILTER, + uintptr(unsafe.Pointer(&fprog)), 0, 0) + } else { + _, _, err = unix.RawSyscall(unix.SYS_SECCOMP, + uintptr(C.C_SET_MODE_FILTER), + uintptr(flags), uintptr(unsafe.Pointer(&fprog))) + } + runtime.KeepAlive(filter) + runtime.KeepAlive(fprog) + return +} + +// PatchAndLoad takes a seccomp configuration and a libseccomp filter which has +// been pre-configured with the set of rules in the seccomp config. It then +// patches said filter to handle -ENOSYS in a much nicer manner than the +// default libseccomp default action behaviour, and loads the patched filter +// into the kernel for the current process. +func PatchAndLoad(config *configs.Seccomp, filter *libseccomp.ScmpFilter) error { + // Generate a patched filter. + fprog, err := enosysPatchFilter(config, filter) + if err != nil { + return errors.Wrap(err, "patching filter") + } + + // Get the set of libseccomp flags set. + seccompFlags, noNewPrivs, err := filterFlags(filter) + if err != nil { + return errors.Wrap(err, "fetch seccomp filter flags") + } + + // Set no_new_privs if it was requested, though in runc we handle + // no_new_privs separately so warn if we hit this path. + if noNewPrivs { + logrus.Warnf("potentially misconfigured filter -- setting no_new_privs in seccomp path") + if err := unix.Prctl(unix.PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil { + return errors.Wrap(err, "enable no_new_privs bit") + } + } + + // Finally, load the filter. + if err := sysSeccompSetFilter(seccompFlags, fprog); err != nil { + return errors.Wrap(err, "loading seccomp filter") + } + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_unsupported.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_unsupported.go new file mode 100644 index 000000000000..682131e49cc6 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_unsupported.go @@ -0,0 +1,3 @@ +// +build !linux !cgo !seccomp + +package patchbpf diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_linux.go index 73ddf3d1827c..5e7b365c563a 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_linux.go @@ -10,8 +10,9 @@ import ( "strings" "github.com/opencontainers/runc/libcontainer/configs" - libseccomp "github.com/seccomp/libseccomp-golang" + "github.com/opencontainers/runc/libcontainer/seccomp/patchbpf" + libseccomp "github.com/seccomp/libseccomp-golang" "golang.org/x/sys/unix" ) @@ -54,7 +55,6 @@ func InitSeccomp(config *configs.Seccomp) error { if err != nil { return fmt.Errorf("error validating Seccomp architecture: %s", err) } - if err := filter.AddArch(scmpArch); err != nil { return fmt.Errorf("error adding architecture to seccomp filter: %s", err) } @@ -70,16 +70,13 @@ func InitSeccomp(config *configs.Seccomp) error { if call == nil { return errors.New("encountered nil syscall while initializing Seccomp") } - - if err = matchCall(filter, call); err != nil { + if err := matchCall(filter, call); err != nil { return err } } - - if err = filter.Load(); err != nil { + if err := patchbpf.PatchAndLoad(config, filter); err != nil { return fmt.Errorf("error loading seccomp filter into kernel: %s", err) } - return nil } @@ -190,7 +187,7 @@ func matchCall(filter *libseccomp.ScmpFilter, call *configs.Syscall) error { // Unconditional match - just add the rule if len(call.Args) == 0 { - if err = filter.AddRule(callNum, callAct); err != nil { + if err := filter.AddRule(callNum, callAct); err != nil { return fmt.Errorf("error adding seccomp filter rule for syscall %s: %s", call.Name, err) } } else { @@ -224,14 +221,14 @@ func matchCall(filter *libseccomp.ScmpFilter, call *configs.Syscall) error { for _, cond := range conditions { condArr := []libseccomp.ScmpCondition{cond} - if err = filter.AddRuleConditional(callNum, callAct, condArr); err != nil { + if err := filter.AddRuleConditional(callNum, callAct, condArr); err != nil { return fmt.Errorf("error adding seccomp rule for syscall %s: %s", call.Name, err) } } } else { // No conditions share same argument // Use new, proper behavior - if err = filter.AddRuleConditional(callNum, callAct, conditions); err != nil { + if err := filter.AddRuleConditional(callNum, callAct, conditions); err != nil { return fmt.Errorf("error adding seccomp rule for syscall %s: %s", call.Name, err) } } @@ -266,3 +263,8 @@ func parseStatusFile(path string) (map[string]string, error) { return status, nil } + +// Version returns major, minor, and micro. +func Version() (uint, uint, uint) { + return libseccomp.GetLibraryVersion() +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_unsupported.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_unsupported.go index 44df1ad4c269..244886a42e54 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_unsupported.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_unsupported.go @@ -22,3 +22,8 @@ func InitSeccomp(config *configs.Seccomp) error { func IsEnabled() bool { return false } + +// Version returns major, minor, and micro. +func Version() (uint, uint, uint) { + return 0, 0, 0 +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/setns_init_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/setns_init_linux.go index 0b9cd885208c..6b1e9a6e97c8 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/setns_init_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/setns_init_linux.go @@ -3,7 +3,6 @@ package libcontainer import ( - "fmt" "os" "runtime" @@ -25,7 +24,7 @@ type linuxSetnsInit struct { } func (l *linuxSetnsInit) getSessionRingName() string { - return fmt.Sprintf("_ses.%s", l.config.ContainerId) + return "_ses." + l.config.ContainerId } func (l *linuxSetnsInit) Init() error { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/standard_init_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/standard_init_linux.go index b20ce1485f8c..7ec506c462ed 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/standard_init_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/standard_init_linux.go @@ -3,10 +3,10 @@ package libcontainer import ( - "fmt" "os" "os/exec" "runtime" + "strconv" "github.com/opencontainers/runc/libcontainer/apparmor" "github.com/opencontainers/runc/libcontainer/configs" @@ -40,7 +40,7 @@ func (l *linuxStandardInit) getSessionRingParams() (string, uint32, uint32) { // Create a unique per session container name that we can join in setns; // However, other containers can also join it. - return fmt.Sprintf("_ses.%s", l.config.ContainerId), 0xffffffff, newperms + return "_ses." + l.config.ContainerId, 0xffffffff, newperms } func (l *linuxStandardInit) Init() error { @@ -185,7 +185,7 @@ func (l *linuxStandardInit) Init() error { // user process. We open it through /proc/self/fd/$fd, because the fd that // was given to us was an O_PATH fd to the fifo itself. Linux allows us to // re-open an O_PATH fd through /proc. - fd, err := unix.Open(fmt.Sprintf("/proc/self/fd/%d", l.fifoFd), unix.O_WRONLY|unix.O_CLOEXEC, 0) + fd, err := unix.Open("/proc/self/fd/"+strconv.Itoa(l.fifoFd), unix.O_WRONLY|unix.O_CLOEXEC, 0) if err != nil { return newSystemErrorWithCause(err, "open exec fifo") } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/state_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/state_linux.go index 0deb22d1f940..02ff06ea9cc2 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/state_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/state_linux.go @@ -38,7 +38,8 @@ type containerState interface { } func destroy(c *linuxContainer) error { - if !c.config.Namespaces.Contains(configs.NEWPID) { + if !c.config.Namespaces.Contains(configs.NEWPID) || + c.config.Namespaces.PathOf(configs.NEWPID) != "" { if err := signalAllProcesses(c.cgroupManager, unix.SIGKILL); err != nil { logrus.Warn(err) } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/proc.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/proc.go index 79232a43715b..b73cf70b4344 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/proc.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/proc.go @@ -71,16 +71,6 @@ func Stat(pid int) (stat Stat_t, err error) { return parseStat(string(bytes)) } -// GetProcessStartTime is deprecated. Use Stat(pid) and -// Stat_t.StartTime instead. -func GetProcessStartTime(pid int) (string, error) { - stat, err := Stat(pid) - if err != nil { - return "", err - } - return fmt.Sprintf("%d", stat.StartTime), nil -} - func parseStat(data string) (stat Stat_t, err error) { // From proc(5), field 2 could contain space and is inside `(` and `)`. // The following is an example: diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go index 65cd40e9287b..f19333e61eb1 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go @@ -3,8 +3,8 @@ package user import ( - "fmt" "os/user" + "strconv" ) func lookupUser(username string) (User, error) { @@ -16,7 +16,7 @@ func lookupUser(username string) (User, error) { } func lookupUid(uid int) (User, error) { - u, err := user.LookupId(fmt.Sprintf("%d", uid)) + u, err := user.LookupId(strconv.Itoa(uid)) if err != nil { return User{}, err } @@ -32,7 +32,7 @@ func lookupGroup(groupname string) (Group, error) { } func lookupGid(gid int) (Group, error) { - g, err := user.LookupGroupId(fmt.Sprintf("%d", gid)) + g, err := user.LookupGroupId(strconv.Itoa(gid)) if err != nil { return Group{}, err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user.go index 4b89dad73761..a533bf5e6686 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user.go @@ -466,7 +466,7 @@ func GetAdditionalGroups(additionalGroups []string, group io.Reader) ([]int, err // we asked for a group but didn't find it. let's check to see // if we wanted a numeric group if !found { - gid, err := strconv.Atoi(ag) + gid, err := strconv.ParseInt(ag, 10, 64) if err != nil { return nil, fmt.Errorf("Unable to find group %s", ag) } @@ -474,7 +474,7 @@ func GetAdditionalGroups(additionalGroups []string, group io.Reader) ([]int, err if gid < minId || gid > maxId { return nil, ErrRange } - gidMap[gid] = struct{}{} + gidMap[int(gid)] = struct{}{} } } gids := []int{} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go index 40ccfaa1a01a..1b72b7a1c1ba 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go @@ -1,6 +1,7 @@ package utils import ( + "encoding/binary" "encoding/json" "io" "os" @@ -15,6 +16,20 @@ const ( exitSignalOffset = 128 ) +// NativeEndian is the native byte order of the host system. +var NativeEndian binary.ByteOrder + +func init() { + // Copied from . + i := uint32(1) + b := (*[4]byte)(unsafe.Pointer(&i)) + if b[0] == 1 { + NativeEndian = binary.LittleEndian + } else { + NativeEndian = binary.BigEndian + } +} + // ResolveRootfs ensures that the current working directory is // not a symlink and returns the absolute path to the rootfs func ResolveRootfs(uncleanRootfs string) (string, error) { @@ -106,7 +121,3 @@ func Annotations(labels []string) (bundle string, userAnnotations map[string]str } return } - -func GetIntSize() int { - return int(unsafe.Sizeof(1)) -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/types/events.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/types/events.go index 6f9a12f15964..81bde829da59 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/types/events.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/types/events.go @@ -12,6 +12,7 @@ type Event struct { // stats is the runc specific stats structure for stability when encoding and decoding stats. type Stats struct { CPU Cpu `json:"cpu"` + CPUSet CPUSet `json:"cpuset"` Memory Memory `json:"memory"` Pids Pids `json:"pids"` Blkio Blkio `json:"blkio"` @@ -70,6 +71,20 @@ type Cpu struct { Throttling Throttling `json:"throttling,omitempty"` } +type CPUSet struct { + CPUs []uint16 `json:"cpus,omitempty"` + CPUExclusive uint64 `json:"cpu_exclusive"` + Mems []uint16 `json:"mems,omitempty"` + MemHardwall uint64 `json:"mem_hardwall"` + MemExclusive uint64 `json:"mem_exclusive"` + MemoryMigrate uint64 `json:"memory_migrate"` + MemorySpreadPage uint64 `json:"memory_spread_page"` + MemorySpreadSlab uint64 `json:"memory_spread_slab"` + MemoryPressure uint64 `json:"memory_pressure"` + SchedLoadBalance uint64 `json:"sched_load_balance"` + SchedRelaxDomainLevel int64 `json:"sched_relax_domain_level"` +} + type MemoryEntry struct { Limit uint64 `json:"limit"` Usage uint64 `json:"usage,omitempty"` diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go index 3dc9efd23e68..5fceeb63533e 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go @@ -60,7 +60,7 @@ type Process struct { SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` } -// LinuxCapabilities specifies the whitelist of capabilities that are kept for a process. +// LinuxCapabilities specifies the list of allowed capabilities that are kept for a process. // http://man7.org/linux/man-pages/man7/capabilities.7.html type LinuxCapabilities struct { // Bounding is the set of capabilities checked by the kernel. @@ -354,7 +354,7 @@ type LinuxRdma struct { // LinuxResources has container runtime resource constraints type LinuxResources struct { - // Devices configures the device whitelist. + // Devices configures the device allowlist. Devices []LinuxDeviceCgroup `json:"devices,omitempty"` // Memory restriction configuration Memory *LinuxMemory `json:"memory,omitempty"` @@ -372,6 +372,8 @@ type LinuxResources struct { // Limits are a set of key value pairs that define RDMA resource limits, // where the key is device name and value is resource limits. Rdma map[string]LinuxRdma `json:"rdma,omitempty"` + // Unified resources. + Unified map[string]string `json:"unified,omitempty"` } // LinuxDevice represents the mknod information for a Linux special device file @@ -392,7 +394,8 @@ type LinuxDevice struct { GID *uint32 `json:"gid,omitempty"` } -// LinuxDeviceCgroup represents a device rule for the whitelist controller +// LinuxDeviceCgroup represents a device rule for the devices specified to +// the device controller type LinuxDeviceCgroup struct { // Allow or deny Allow bool `json:"allow"` @@ -628,6 +631,7 @@ const ( ArchS390X Arch = "SCMP_ARCH_S390X" ArchPARISC Arch = "SCMP_ARCH_PARISC" ArchPARISC64 Arch = "SCMP_ARCH_PARISC64" + ArchRISCV64 Arch = "SCMP_ARCH_RISCV64" ) // LinuxSeccompAction taken upon Seccomp rule match diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/doc.go b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/doc.go index 79a8e6446db6..9c9cbd120aa1 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/doc.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/doc.go @@ -5,9 +5,6 @@ This package uses a selinux build tag to enable the selinux functionality. This allows non-linux and linux users who do not have selinux support to still use tools that rely on this library. -To compile with full selinux support use the -tags=selinux option in your build -and test commands. - Usage: import "github.com/opencontainers/selinux/go-selinux" diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go similarity index 98% rename from cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go rename to cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go index 10ac15a8524d..43945551172b 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go @@ -1,5 +1,3 @@ -// +build selinux,linux - package label import ( @@ -27,14 +25,14 @@ var ErrIncompatibleLabel = errors.New("Bad SELinux option z and Z can not be use // the container. A list of options can be passed into this function to alter // the labels. The labels returned will include a random MCS String, that is // guaranteed to be unique. -func InitLabels(options []string) (plabel string, mlabel string, Err error) { +func InitLabels(options []string) (plabel string, mlabel string, retErr error) { if !selinux.GetEnabled() { return "", "", nil } processLabel, mountLabel := selinux.ContainerLabels() if processLabel != "" { defer func() { - if Err != nil { + if retErr != nil { selinux.ReleaseLabel(mountLabel) } }() @@ -57,7 +55,6 @@ func InitLabels(options []string) (plabel string, mlabel string, Err error) { con := strings.SplitN(opt, ":", 2) if !validOptions[con[0]] { return "", "", errors.Errorf("Bad label option %q, valid options 'disable, user, role, level, type, filetype'", con[0]) - } if con[0] == "filetype" { mcon["type"] = con[1] diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go index a7d2d5e342bb..02d206239c7e 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go @@ -1,4 +1,4 @@ -// +build !selinux !linux +// +build !linux package label diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go index 50760dc93e76..d9119908b782 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux.go @@ -30,6 +30,11 @@ var ( // ErrLevelSyntax is returned when a sensitivity or category do not have correct syntax in a level ErrLevelSyntax = errors.New("invalid level syntax") + // ErrContextMissing is returned if a requested context is not found in a file. + ErrContextMissing = errors.New("context does not have a match") + // ErrVerifierNil is returned when a context verifier function is nil. + ErrVerifierNil = errors.New("verifier function is nil") + // CategoryRange allows the upper bound on the category range to be adjusted CategoryRange = DefaultCategoryRange ) @@ -63,8 +68,12 @@ func FileLabel(fpath string) (string, error) { return fileLabel(fpath) } -// SetFSCreateLabel tells kernel the label to create all file system objects -// created by this task. Setting label="" to return to default. +// SetFSCreateLabel tells the kernel what label to use for all file system objects +// created by this task. +// Set the label to an empty string to return to the default label. Calls to SetFSCreateLabel +// should be wrapped in runtime.LockOSThread()/runtime.UnlockOSThread() until file system +// objects created by this task are finished to guarantee another goroutine does not migrate +// to the current thread before execution is complete. func SetFSCreateLabel(label string) error { return setFSCreateLabel(label) } @@ -113,19 +122,27 @@ func CalculateGlbLub(sourceRange, targetRange string) (string, error) { } // SetExecLabel sets the SELinux label that the kernel will use for any programs -// that are executed by the current process thread, or an error. +// that are executed by the current process thread, or an error. Calls to SetExecLabel +// should be wrapped in runtime.LockOSThread()/runtime.UnlockOSThread() until execution +// of the program is finished to guarantee another goroutine does not migrate to the current +// thread before execution is complete. func SetExecLabel(label string) error { return setExecLabel(label) } // SetTaskLabel sets the SELinux label for the current thread, or an error. -// This requires the dyntransition permission. +// This requires the dyntransition permission. Calls to SetTaskLabel should +// be wrapped in runtime.LockOSThread()/runtime.UnlockOSThread() to guarantee +// the current thread does not run in a new mislabeled thread. func SetTaskLabel(label string) error { return setTaskLabel(label) } // SetSocketLabel takes a process label and tells the kernel to assign the -// label to the next socket that gets created +// label to the next socket that gets created. Calls to SetSocketLabel +// should be wrapped in runtime.LockOSThread()/runtime.UnlockOSThread() until +// the the socket is created to guarantee another goroutine does not migrate +// to the current thread before execution is complete. func SetSocketLabel(label string) error { return setSocketLabel(label) } @@ -141,7 +158,10 @@ func PeerLabel(fd uintptr) (string, error) { } // SetKeyLabel takes a process label and tells the kernel to assign the -// label to the next kernel keyring that gets created +// label to the next kernel keyring that gets created. Calls to SetKeyLabel +// should be wrapped in runtime.LockOSThread()/runtime.UnlockOSThread() until +// the kernel keyring is created to guarantee another goroutine does not migrate +// to the current thread before execution is complete. func SetKeyLabel(label string) error { return setKeyLabel(label) } @@ -247,3 +267,12 @@ func DupSecOpt(src string) ([]string, error) { func DisableSecOpt() []string { return disableSecOpt() } + +// GetDefaultContextWithLevel gets a single context for the specified SELinux user +// identity that is reachable from the specified scon context. The context is based +// on the per-user /etc/selinux/{SELINUXTYPE}/contexts/users/ if it exists, +// and falls back to the global /etc/selinux/{SELINUXTYPE}/contexts/default_contexts +// file. +func GetDefaultContextWithLevel(user, level, scon string) (string, error) { + return getDefaultContextWithLevel(user, level, scon) +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go index d6b0d49db658..5bfcc0490269 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go @@ -1,5 +1,3 @@ -// +build selinux,linux - package selinux import ( @@ -28,6 +26,8 @@ const ( minSensLen = 2 contextFile = "/usr/share/containers/selinux/contexts" selinuxDir = "/etc/selinux/" + selinuxUsersDir = "contexts/users" + defaultContexts = "contexts/default_contexts" selinuxConfig = selinuxDir + "config" selinuxfsMount = "/sys/fs/selinux" selinuxTypeTag = "SELINUXTYPE" @@ -35,6 +35,8 @@ const ( xattrNameSelinux = "security.selinux" ) +var policyRoot = filepath.Join(selinuxDir, readConfig(selinuxTypeTag)) + type selinuxState struct { enabledSet bool enabled bool @@ -54,6 +56,13 @@ type mlsRange struct { high *level } +type defaultSECtx struct { + user, level, scon string + userRdr, defaultRdr io.Reader + + verifier func(string) error +} + type levelItem byte const ( @@ -111,7 +120,7 @@ func verifySELinuxfsMount(mnt string) bool { if err == nil { break } - if err == unix.EAGAIN { + if err == unix.EAGAIN || err == unix.EINTR { continue } return false @@ -205,28 +214,16 @@ func getEnabled() bool { } func readConfig(target string) string { - var ( - val, key string - bufin *bufio.Reader - ) - in, err := os.Open(selinuxConfig) if err != nil { return "" } defer in.Close() - bufin = bufio.NewReader(in) + scanner := bufio.NewScanner(in) - for done := false; !done; { - var line string - if line, err = bufin.ReadString('\n'); err != nil { - if err != io.EOF { - return "" - } - done = true - } - line = strings.TrimSpace(line) + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) if len(line) == 0 { // Skip blank lines continue @@ -236,7 +233,7 @@ func readConfig(target string) string { continue } if groups := assignRegex.FindStringSubmatch(line); groups != nil { - key, val = strings.TrimSpace(groups[1]), strings.TrimSpace(groups[2]) + key, val := strings.TrimSpace(groups[1]), strings.TrimSpace(groups[2]) if key == target { return strings.Trim(val, "\"") } @@ -245,15 +242,17 @@ func readConfig(target string) string { return "" } -func getSELinuxPolicyRoot() string { - return filepath.Join(selinuxDir, readConfig(selinuxTypeTag)) -} - func isProcHandle(fh *os.File) error { var buf unix.Statfs_t - err := unix.Fstatfs(int(fh.Fd()), &buf) - if err != nil { - return errors.Wrapf(err, "statfs(%q) failed", fh.Name()) + + for { + err := unix.Fstatfs(int(fh.Fd()), &buf) + if err == nil { + break + } + if err != unix.EINTR { + return errors.Wrapf(err, "statfs(%q) failed", fh.Name()) + } } if buf.Type != unix.PROC_SUPER_MAGIC { return errors.Errorf("file %q is not on procfs", fh.Name()) @@ -307,9 +306,16 @@ func setFileLabel(fpath string, label string) error { if fpath == "" { return ErrEmptyPath } - if err := unix.Lsetxattr(fpath, xattrNameSelinux, []byte(label), 0); err != nil { - return errors.Wrapf(err, "failed to set file label on %s", fpath) + for { + err := unix.Lsetxattr(fpath, xattrNameSelinux, []byte(label), 0) + if err == nil { + break + } + if err != unix.EINTR { + return errors.Wrapf(err, "failed to set file label on %s", fpath) + } } + return nil } @@ -751,7 +757,7 @@ func reserveLabel(label string) { if len(label) != 0 { con := strings.SplitN(label, ":", 4) if len(con) > 3 { - mcsAdd(con[3]) + _ = mcsAdd(con[3]) } } } @@ -828,11 +834,11 @@ func intToMcs(id int, catRange uint32) string { } for ORD > TIER { - ORD = ORD - TIER + ORD -= TIER TIER-- } TIER = SETSIZE - TIER - ORD = ORD + TIER + ORD += TIER return fmt.Sprintf("s0:c%d,c%d", TIER, ORD) } @@ -844,16 +850,14 @@ func uniqMcs(catRange uint32) string { ) for { - binary.Read(rand.Reader, binary.LittleEndian, &n) + _ = binary.Read(rand.Reader, binary.LittleEndian, &n) c1 = n % catRange - binary.Read(rand.Reader, binary.LittleEndian, &n) + _ = binary.Read(rand.Reader, binary.LittleEndian, &n) c2 = n % catRange if c1 == c2 { continue - } else { - if c1 > c2 { - c1, c2 = c2, c1 - } + } else if c1 > c2 { + c1, c2 = c2, c1 } mcs = fmt.Sprintf("s0:c%d,c%d", c1, c2) if err := mcsAdd(mcs); err != nil { @@ -884,18 +888,13 @@ func openContextFile() (*os.File, error) { if f, err := os.Open(contextFile); err == nil { return f, nil } - lxcPath := filepath.Join(getSELinuxPolicyRoot(), "/contexts/lxc_contexts") + lxcPath := filepath.Join(policyRoot, "/contexts/lxc_contexts") return os.Open(lxcPath) } var labels = loadLabels() func loadLabels() map[string]string { - var ( - val, key string - bufin *bufio.Reader - ) - labels := make(map[string]string) in, err := openContextFile() if err != nil { @@ -903,18 +902,10 @@ func loadLabels() map[string]string { } defer in.Close() - bufin = bufio.NewReader(in) + scanner := bufio.NewScanner(in) - for done := false; !done; { - var line string - if line, err = bufin.ReadString('\n'); err != nil { - if err == io.EOF { - done = true - } else { - break - } - } - line = strings.TrimSpace(line) + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) if len(line) == 0 { // Skip blank lines continue @@ -924,7 +915,7 @@ func loadLabels() map[string]string { continue } if groups := assignRegex.FindStringSubmatch(line); groups != nil { - key, val = strings.TrimSpace(groups[1]), strings.TrimSpace(groups[2]) + key, val := strings.TrimSpace(groups[1]), strings.TrimSpace(groups[2]) labels[key] = strings.Trim(val, "\"") } } @@ -1015,7 +1006,7 @@ func copyLevel(src, dest string) (string, error) { return "", err } mcsDelete(tcon["level"]) - mcsAdd(scon["level"]) + _ = mcsAdd(scon["level"]) tcon["level"] = scon["level"] return tcon.Get(), nil } @@ -1095,3 +1086,124 @@ func dupSecOpt(src string) ([]string, error) { func disableSecOpt() []string { return []string{"disable"} } + +// findUserInContext scans the reader for a valid SELinux context +// match that is verified with the verifier. Invalid contexts are +// skipped. It returns a matched context or an empty string if no +// match is found. If a scanner error occurs, it is returned. +func findUserInContext(context Context, r io.Reader, verifier func(string) error) (string, error) { + fromRole := context["role"] + fromType := context["type"] + scanner := bufio.NewScanner(r) + + for scanner.Scan() { + fromConns := strings.Fields(scanner.Text()) + if len(fromConns) == 0 { + // Skip blank lines + continue + } + + line := fromConns[0] + + if line[0] == ';' || line[0] == '#' { + // Skip comments + continue + } + + // user context files contexts are formatted as + // role_r:type_t:s0 where the user is missing. + lineArr := strings.SplitN(line, ":", 4) + // skip context with typo, or role and type do not match + if len(lineArr) != 3 || + lineArr[0] != fromRole || + lineArr[1] != fromType { + continue + } + + for _, cc := range fromConns[1:] { + toConns := strings.SplitN(cc, ":", 4) + if len(toConns) != 3 { + continue + } + + context["role"] = toConns[0] + context["type"] = toConns[1] + + outConn := context.get() + if err := verifier(outConn); err != nil { + continue + } + + return outConn, nil + } + } + + if err := scanner.Err(); err != nil { + return "", errors.Wrap(err, "failed to scan for context") + } + + return "", nil +} + +func getDefaultContextFromReaders(c *defaultSECtx) (string, error) { + if c.verifier == nil { + return "", ErrVerifierNil + } + + context, err := newContext(c.scon) + if err != nil { + return "", errors.Wrapf(err, "failed to create label for %s", c.scon) + } + + // set so the verifier validates the matched context with the provided user and level. + context["user"] = c.user + context["level"] = c.level + + conn, err := findUserInContext(context, c.userRdr, c.verifier) + if err != nil { + return "", err + } + + if conn != "" { + return conn, nil + } + + conn, err = findUserInContext(context, c.defaultRdr, c.verifier) + if err != nil { + return "", err + } + + if conn != "" { + return conn, nil + } + + return "", errors.Wrapf(ErrContextMissing, "context not found: %q", c.scon) +} + +func getDefaultContextWithLevel(user, level, scon string) (string, error) { + userPath := filepath.Join(policyRoot, selinuxUsersDir, user) + defaultPath := filepath.Join(policyRoot, defaultContexts) + + fu, err := os.Open(userPath) + if err != nil { + return "", err + } + defer fu.Close() + + fd, err := os.Open(defaultPath) + if err != nil { + return "", err + } + defer fd.Close() + + c := defaultSECtx{ + user: user, + level: level, + scon: scon, + userRdr: fu, + defaultRdr: fd, + verifier: securityCheckContext, + } + + return getDefaultContextFromReaders(&c) +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go index c526b210f9c2..70b7b7c8519d 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/selinux_stub.go @@ -1,4 +1,4 @@ -// +build !selinux !linux +// +build !linux package selinux @@ -146,3 +146,7 @@ func dupSecOpt(src string) ([]string, error) { func disableSecOpt() []string { return []string{"disable"} } + +func getDefaultContextWithLevel(user, level, scon string) (string, error) { + return "", nil +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/xattrs.go b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/xattrs.go deleted file mode 100644 index de5c80ef3a93..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/xattrs.go +++ /dev/null @@ -1,30 +0,0 @@ -// +build selinux,linux - -package selinux - -import ( - "golang.org/x/sys/unix" -) - -// Returns a []byte slice if the xattr is set and nil otherwise -// Requires path and its attribute as arguments -func lgetxattr(path string, attr string) ([]byte, error) { - // Start with a 128 length byte array - dest := make([]byte, 128) - sz, errno := unix.Lgetxattr(path, attr, dest) - for errno == unix.ERANGE { - // Buffer too small, use zero-sized buffer to get the actual size - sz, errno = unix.Lgetxattr(path, attr, []byte{}) - if errno != nil { - return nil, errno - } - - dest = make([]byte, sz) - sz, errno = unix.Lgetxattr(path, attr, dest) - } - if errno != nil { - return nil, errno - } - - return dest[:sz], nil -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go new file mode 100644 index 000000000000..117c255be201 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go @@ -0,0 +1,38 @@ +package selinux + +import ( + "golang.org/x/sys/unix" +) + +// lgetxattr returns a []byte slice containing the value of +// an extended attribute attr set for path. +func lgetxattr(path, attr string) ([]byte, error) { + // Start with a 128 length byte array + dest := make([]byte, 128) + sz, errno := doLgetxattr(path, attr, dest) + for errno == unix.ERANGE { + // Buffer too small, use zero-sized buffer to get the actual size + sz, errno = doLgetxattr(path, attr, []byte{}) + if errno != nil { + return nil, errno + } + + dest = make([]byte, sz) + sz, errno = doLgetxattr(path, attr, dest) + } + if errno != nil { + return nil, errno + } + + return dest[:sz], nil +} + +// doLgetxattr is a wrapper that retries on EINTR +func doLgetxattr(path, attr string, dest []byte) (int, error) { + for { + sz, err := unix.Lgetxattr(path, attr, dest) + if err != unix.EINTR { + return sz, err + } + } +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/pkg/pwalk/pwalk.go b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/pkg/pwalk/pwalk.go index 63fde18429ae..437b12b3e289 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/selinux/pkg/pwalk/pwalk.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/selinux/pkg/pwalk/pwalk.go @@ -20,17 +20,16 @@ type WalkFunc = filepath.WalkFunc // // Note that this implementation only supports primitive error handling: // -// * no errors are ever passed to WalkFn +// - no errors are ever passed to WalkFn; // -// * once a walkFn returns any error, all further processing stops -// and the error is returned to the caller of Walk; +// - once a walkFn returns any error, all further processing stops +// and the error is returned to the caller of Walk; // -// * filepath.SkipDir is not supported; -// -// * if more than one walkFn instance will return an error, only one -// of such errors will be propagated and returned by Walk, others -// will be silently discarded. +// - filepath.SkipDir is not supported; // +// - if more than one walkFn instance will return an error, only one +// of such errors will be propagated and returned by Walk, others +// will be silently discarded. func Walk(root string, walkFn WalkFunc) error { return WalkN(root, walkFn, runtime.NumCPU()*2) } @@ -38,6 +37,8 @@ func Walk(root string, walkFn WalkFunc) error { // WalkN is a wrapper for filepath.Walk which can call multiple walkFn // in parallel, allowing to handle each item concurrently. A maximum of // num walkFn will be called at any one time. +// +// Please see Walk documentation for caveats of using this function. func WalkN(root string, walkFn WalkFunc, num int) error { // make sure limit is sensible if num < 1 { diff --git a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/.gitignore b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/.gitignore index 6b7d7d1e8b90..1fb13abebe72 100644 --- a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/.gitignore +++ b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/.gitignore @@ -1,2 +1,4 @@ logrus vendor + +.idea/ diff --git a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/buffer_pool.go b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/buffer_pool.go new file mode 100644 index 000000000000..4545dec07d8b --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/buffer_pool.go @@ -0,0 +1,52 @@ +package logrus + +import ( + "bytes" + "sync" +) + +var ( + bufferPool BufferPool +) + +type BufferPool interface { + Put(*bytes.Buffer) + Get() *bytes.Buffer +} + +type defaultPool struct { + pool *sync.Pool +} + +func (p *defaultPool) Put(buf *bytes.Buffer) { + p.pool.Put(buf) +} + +func (p *defaultPool) Get() *bytes.Buffer { + return p.pool.Get().(*bytes.Buffer) +} + +func getBuffer() *bytes.Buffer { + return bufferPool.Get() +} + +func putBuffer(buf *bytes.Buffer) { + buf.Reset() + bufferPool.Put(buf) +} + +// SetBufferPool allows to replace the default logrus buffer pool +// to better meets the specific needs of an application. +func SetBufferPool(bp BufferPool) { + bufferPool = bp +} + +func init() { + SetBufferPool(&defaultPool{ + pool: &sync.Pool{ + New: func() interface{} { + return new(bytes.Buffer) + }, + }, + }) +} diff --git a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/entry.go b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/entry.go index f6e062a3466c..5a5cbfe7c897 100644 --- a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/entry.go +++ b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/entry.go @@ -13,7 +13,6 @@ import ( ) var ( - bufferPool *sync.Pool // qualified package name, cached at first use logrusPackage string @@ -31,12 +30,6 @@ const ( ) func init() { - bufferPool = &sync.Pool{ - New: func() interface{} { - return new(bytes.Buffer) - }, - } - // start at the bottom of the stack before the package-name cache is primed minimumCallerDepth = 1 } @@ -243,9 +236,12 @@ func (entry Entry) log(level Level, msg string) { entry.fireHooks() - buffer = bufferPool.Get().(*bytes.Buffer) + buffer = getBuffer() + defer func() { + entry.Buffer = nil + putBuffer(buffer) + }() buffer.Reset() - defer bufferPool.Put(buffer) entry.Buffer = buffer entry.write() diff --git a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/exported.go b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/exported.go index 42b04f6c8094..017c30ce6783 100644 --- a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/exported.go +++ b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/exported.go @@ -134,6 +134,51 @@ func Fatal(args ...interface{}) { std.Fatal(args...) } +// TraceFn logs a message from a func at level Trace on the standard logger. +func TraceFn(fn LogFunction) { + std.TraceFn(fn) +} + +// DebugFn logs a message from a func at level Debug on the standard logger. +func DebugFn(fn LogFunction) { + std.DebugFn(fn) +} + +// PrintFn logs a message from a func at level Info on the standard logger. +func PrintFn(fn LogFunction) { + std.PrintFn(fn) +} + +// InfoFn logs a message from a func at level Info on the standard logger. +func InfoFn(fn LogFunction) { + std.InfoFn(fn) +} + +// WarnFn logs a message from a func at level Warn on the standard logger. +func WarnFn(fn LogFunction) { + std.WarnFn(fn) +} + +// WarningFn logs a message from a func at level Warn on the standard logger. +func WarningFn(fn LogFunction) { + std.WarningFn(fn) +} + +// ErrorFn logs a message from a func at level Error on the standard logger. +func ErrorFn(fn LogFunction) { + std.ErrorFn(fn) +} + +// PanicFn logs a message from a func at level Panic on the standard logger. +func PanicFn(fn LogFunction) { + std.PanicFn(fn) +} + +// FatalFn logs a message from a func at level Fatal on the standard logger then the process will exit with status set to 1. +func FatalFn(fn LogFunction) { + std.FatalFn(fn) +} + // Tracef logs a message at level Trace on the standard logger. func Tracef(format string, args ...interface{}) { std.Tracef(format, args...) diff --git a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/go.mod b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/go.mod index d41329679f83..b3919d5eabf8 100644 --- a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/go.mod +++ b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/go.mod @@ -2,10 +2,9 @@ module github.com/sirupsen/logrus require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.3 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.2.2 - golang.org/x/sys v0.0.0-20190422165155-953cdadca894 + golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 ) go 1.13 diff --git a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/go.sum b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/go.sum index 49c690f23837..1edc143bed02 100644 --- a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/go.sum +++ b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/go.sum @@ -1,12 +1,10 @@ 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/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 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/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/logger.go b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/logger.go index 6fdda748e4db..dbf627c97541 100644 --- a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/logger.go +++ b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/logger.go @@ -9,6 +9,11 @@ import ( "time" ) +// LogFunction For big messages, it can be more efficient to pass a function +// and only call it if the log level is actually enables rather than +// generating the log message and then checking if the level is enabled +type LogFunction func()[]interface{} + type Logger struct { // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a // file, or leave it default which is `os.Stderr`. You can also set this to @@ -70,7 +75,7 @@ func (mw *MutexWrap) Disable() { // // var log = &logrus.Logger{ // Out: os.Stderr, -// Formatter: new(logrus.JSONFormatter), +// Formatter: new(logrus.TextFormatter), // Hooks: make(logrus.LevelHooks), // Level: logrus.DebugLevel, // } @@ -195,6 +200,14 @@ func (logger *Logger) Log(level Level, args ...interface{}) { } } +func (logger *Logger) LogFn(level Level, fn LogFunction) { + if logger.IsLevelEnabled(level) { + entry := logger.newEntry() + entry.Log(level, fn()...) + logger.releaseEntry(entry) + } +} + func (logger *Logger) Trace(args ...interface{}) { logger.Log(TraceLevel, args...) } @@ -234,6 +247,45 @@ func (logger *Logger) Panic(args ...interface{}) { logger.Log(PanicLevel, args...) } +func (logger *Logger) TraceFn(fn LogFunction) { + logger.LogFn(TraceLevel, fn) +} + +func (logger *Logger) DebugFn(fn LogFunction) { + logger.LogFn(DebugLevel, fn) +} + +func (logger *Logger) InfoFn(fn LogFunction) { + logger.LogFn(InfoLevel, fn) +} + +func (logger *Logger) PrintFn(fn LogFunction) { + entry := logger.newEntry() + entry.Print(fn()...) + logger.releaseEntry(entry) +} + +func (logger *Logger) WarnFn(fn LogFunction) { + logger.LogFn(WarnLevel, fn) +} + +func (logger *Logger) WarningFn(fn LogFunction) { + logger.WarnFn(fn) +} + +func (logger *Logger) ErrorFn(fn LogFunction) { + logger.LogFn(ErrorLevel, fn) +} + +func (logger *Logger) FatalFn(fn LogFunction) { + logger.LogFn(FatalLevel, fn) + logger.Exit(1) +} + +func (logger *Logger) PanicFn(fn LogFunction) { + logger.LogFn(PanicLevel, fn) +} + func (logger *Logger) Logln(level Level, args ...interface{}) { if logger.IsLevelEnabled(level) { entry := logger.newEntry() diff --git a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/terminal_check_windows.go b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/terminal_check_windows.go index 572889db2162..2879eb50ea6d 100644 --- a/cluster-autoscaler/vendor/github.com/sirupsen/logrus/terminal_check_windows.go +++ b/cluster-autoscaler/vendor/github.com/sirupsen/logrus/terminal_check_windows.go @@ -5,30 +5,23 @@ package logrus import ( "io" "os" - "syscall" - sequences "github.com/konsorten/go-windows-terminal-sequences" + "golang.org/x/sys/windows" ) -func initTerminal(w io.Writer) { - switch v := w.(type) { - case *os.File: - sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) - } -} - func checkIfTerminal(w io.Writer) bool { - var ret bool switch v := w.(type) { case *os.File: + handle := windows.Handle(v.Fd()) var mode uint32 - err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode) - ret = (err == nil) - default: - ret = false - } - if ret { - initTerminal(w) + if err := windows.GetConsoleMode(handle, &mode); err != nil { + return false + } + mode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING + if err := windows.SetConsoleMode(handle, mode); err != nil { + return false + } + return true } - return ret + return false } diff --git a/cluster-autoscaler/vendor/github.com/syndtr/gocapability/capability/enum.go b/cluster-autoscaler/vendor/github.com/syndtr/gocapability/capability/enum.go index 693817317bd0..ad10785314de 100644 --- a/cluster-autoscaler/vendor/github.com/syndtr/gocapability/capability/enum.go +++ b/cluster-autoscaler/vendor/github.com/syndtr/gocapability/capability/enum.go @@ -41,7 +41,9 @@ const ( //go:generate go run enumgen/gen.go type Cap int -// POSIX-draft defined capabilities. +// POSIX-draft defined capabilities and Linux extensions. +// +// Defined in https://github.com/torvalds/linux/blob/master/include/uapi/linux/capability.h const ( // In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this // overrides the restriction of changing file ownership and group @@ -187,6 +189,7 @@ const ( // arbitrary SCSI commands // Allow setting encryption key on loopback filesystem // Allow setting zone reclaim policy + // Allow everything under CAP_BPF and CAP_PERFMON for backward compatibility CAP_SYS_ADMIN = Cap(21) // Allow use of reboot() @@ -211,6 +214,7 @@ const ( // Allow more than 64hz interrupts from the real-time clock // Override max number of consoles on console allocation // Override max number of keymaps + // Control memory reclaim behavior CAP_SYS_RESOURCE = Cap(24) // Allow manipulation of system clock @@ -256,8 +260,45 @@ const ( // Allow preventing system suspends CAP_BLOCK_SUSPEND = Cap(36) - // Allow reading audit messages from the kernel + // Allow reading the audit log via multicast netlink socket CAP_AUDIT_READ = Cap(37) + + // Allow system performance and observability privileged operations + // using perf_events, i915_perf and other kernel subsystems + CAP_PERFMON = Cap(38) + + // CAP_BPF allows the following BPF operations: + // - Creating all types of BPF maps + // - Advanced verifier features + // - Indirect variable access + // - Bounded loops + // - BPF to BPF function calls + // - Scalar precision tracking + // - Larger complexity limits + // - Dead code elimination + // - And potentially other features + // - Loading BPF Type Format (BTF) data + // - Retrieve xlated and JITed code of BPF programs + // - Use bpf_spin_lock() helper + // + // CAP_PERFMON relaxes the verifier checks further: + // - BPF progs can use of pointer-to-integer conversions + // - speculation attack hardening measures are bypassed + // - bpf_probe_read to read arbitrary kernel memory is allowed + // - bpf_trace_printk to print kernel memory is allowed + // + // CAP_SYS_ADMIN is required to use bpf_probe_write_user. + // + // CAP_SYS_ADMIN is required to iterate system wide loaded + // programs, maps, links, BTFs and convert their IDs to file descriptors. + // + // CAP_PERFMON and CAP_BPF are required to load tracing programs. + // CAP_NET_ADMIN and CAP_BPF are required to load networking programs. + CAP_BPF = Cap(39) + + // Allow checkpoint/restore related operations. + // Introduced in kernel 5.9 + CAP_CHECKPOINT_RESTORE = Cap(40) ) var ( diff --git a/cluster-autoscaler/vendor/github.com/syndtr/gocapability/capability/enum_gen.go b/cluster-autoscaler/vendor/github.com/syndtr/gocapability/capability/enum_gen.go index b9e6d2d5e1ee..2ff9bf4d8879 100644 --- a/cluster-autoscaler/vendor/github.com/syndtr/gocapability/capability/enum_gen.go +++ b/cluster-autoscaler/vendor/github.com/syndtr/gocapability/capability/enum_gen.go @@ -80,6 +80,12 @@ func (c Cap) String() string { return "block_suspend" case CAP_AUDIT_READ: return "audit_read" + case CAP_PERFMON: + return "perfmon" + case CAP_BPF: + return "bpf" + case CAP_CHECKPOINT_RESTORE: + return "checkpoint_restore" } return "unknown" } @@ -125,5 +131,8 @@ func List() []Cap { CAP_WAKE_ALARM, CAP_BLOCK_SUSPEND, CAP_AUDIT_READ, + CAP_PERFMON, + CAP_BPF, + CAP_CHECKPOINT_RESTORE, } } diff --git a/cluster-autoscaler/vendor/github.com/willf/bitset/Makefile b/cluster-autoscaler/vendor/github.com/willf/bitset/Makefile deleted file mode 100644 index db8377106f61..000000000000 --- a/cluster-autoscaler/vendor/github.com/willf/bitset/Makefile +++ /dev/null @@ -1,191 +0,0 @@ -# MAKEFILE -# -# @author Nicola Asuni -# @link https://github.com/willf/bitset -# ------------------------------------------------------------------------------ - -# List special make targets that are not associated with files -.PHONY: help all test format fmtcheck vet lint coverage cyclo ineffassign misspell structcheck varcheck errcheck gosimple astscan qa deps clean nuke - -# Use bash as shell (Note: Ubuntu now uses dash which doesn't support PIPESTATUS). -SHELL=/bin/bash - -# CVS path (path to the parent dir containing the project) -CVSPATH=github.com/willf - -# Project owner -OWNER=willf - -# Project vendor -VENDOR=willf - -# Project name -PROJECT=bitset - -# Project version -VERSION=$(shell cat VERSION) - -# Name of RPM or DEB package -PKGNAME=${VENDOR}-${PROJECT} - -# Current directory -CURRENTDIR=$(shell pwd) - -# GO lang path -ifneq ($(GOPATH),) - ifeq ($(findstring $(GOPATH),$(CURRENTDIR)),) - # the defined GOPATH is not valid - GOPATH= - endif -endif -ifeq ($(GOPATH),) - # extract the GOPATH - GOPATH=$(firstword $(subst /src/, ,$(CURRENTDIR))) -endif - -# --- MAKE TARGETS --- - -# Display general help about this command -help: - @echo "" - @echo "$(PROJECT) Makefile." - @echo "GOPATH=$(GOPATH)" - @echo "The following commands are available:" - @echo "" - @echo " make qa : Run all the tests" - @echo " make test : Run the unit tests" - @echo "" - @echo " make format : Format the source code" - @echo " make fmtcheck : Check if the source code has been formatted" - @echo " make vet : Check for suspicious constructs" - @echo " make lint : Check for style errors" - @echo " make coverage : Generate the coverage report" - @echo " make cyclo : Generate the cyclomatic complexity report" - @echo " make ineffassign : Detect ineffectual assignments" - @echo " make misspell : Detect commonly misspelled words in source files" - @echo " make structcheck : Find unused struct fields" - @echo " make varcheck : Find unused global variables and constants" - @echo " make errcheck : Check that error return values are used" - @echo " make gosimple : Suggest code simplifications" - @echo " make astscan : GO AST scanner" - @echo "" - @echo " make docs : Generate source code documentation" - @echo "" - @echo " make deps : Get the dependencies" - @echo " make clean : Remove any build artifact" - @echo " make nuke : Deletes any intermediate file" - @echo "" - -# Alias for help target -all: help - -# Run the unit tests -test: - @mkdir -p target/test - @mkdir -p target/report - GOPATH=$(GOPATH) \ - go test \ - -covermode=atomic \ - -bench=. \ - -race \ - -cpuprofile=target/report/cpu.out \ - -memprofile=target/report/mem.out \ - -mutexprofile=target/report/mutex.out \ - -coverprofile=target/report/coverage.out \ - -v ./... | \ - tee >(PATH=$(GOPATH)/bin:$(PATH) go-junit-report > target/test/report.xml); \ - test $${PIPESTATUS[0]} -eq 0 - -# Format the source code -format: - @find . -type f -name "*.go" -exec gofmt -s -w {} \; - -# Check if the source code has been formatted -fmtcheck: - @mkdir -p target - @find . -type f -name "*.go" -exec gofmt -s -d {} \; | tee target/format.diff - @test ! -s target/format.diff || { echo "ERROR: the source code has not been formatted - please use 'make format' or 'gofmt'"; exit 1; } - -# Check for syntax errors -vet: - GOPATH=$(GOPATH) go vet . - -# Check for style errors -lint: - GOPATH=$(GOPATH) PATH=$(GOPATH)/bin:$(PATH) golint . - -# Generate the coverage report -coverage: - @mkdir -p target/report - GOPATH=$(GOPATH) \ - go tool cover -html=target/report/coverage.out -o target/report/coverage.html - -# Report cyclomatic complexity -cyclo: - @mkdir -p target/report - GOPATH=$(GOPATH) gocyclo -avg ./ | tee target/report/cyclo.txt ; test $${PIPESTATUS[0]} -eq 0 - -# Detect ineffectual assignments -ineffassign: - @mkdir -p target/report - GOPATH=$(GOPATH) ineffassign ./ | tee target/report/ineffassign.txt ; test $${PIPESTATUS[0]} -eq 0 - -# Detect commonly misspelled words in source files -misspell: - @mkdir -p target/report - GOPATH=$(GOPATH) misspell -error ./ | tee target/report/misspell.txt ; test $${PIPESTATUS[0]} -eq 0 - -# Find unused struct fields -structcheck: - @mkdir -p target/report - GOPATH=$(GOPATH) structcheck -a ./ | tee target/report/structcheck.txt - -# Find unused global variables and constants -varcheck: - @mkdir -p target/report - GOPATH=$(GOPATH) varcheck -e ./ | tee target/report/varcheck.txt - -# Check that error return values are used -errcheck: - @mkdir -p target/report - GOPATH=$(GOPATH) errcheck ./ | tee target/report/errcheck.txt - -# AST scanner -astscan: - @mkdir -p target/report - GOPATH=$(GOPATH) gosec . | tee target/report/astscan.txt ; test $${PIPESTATUS[0]} -eq 0 || true - -# Generate source docs -docs: - @mkdir -p target/docs - nohup sh -c 'GOPATH=$(GOPATH) godoc -http=127.0.0.1:6060' > target/godoc_server.log 2>&1 & - wget --directory-prefix=target/docs/ --execute robots=off --retry-connrefused --recursive --no-parent --adjust-extension --page-requisites --convert-links http://127.0.0.1:6060/pkg/github.com/${VENDOR}/${PROJECT}/ ; kill -9 `lsof -ti :6060` - @echo ''${PKGNAME}' Documentation ...' > target/docs/index.html - -# Alias to run all quality-assurance checks -qa: fmtcheck test vet lint coverage cyclo ineffassign misspell structcheck varcheck errcheck gosimple astscan - -# --- INSTALL --- - -# Get the dependencies -deps: - GOPATH=$(GOPATH) go get ./... - GOPATH=$(GOPATH) go get golang.org/x/lint/golint - GOPATH=$(GOPATH) go get github.com/jstemmer/go-junit-report - GOPATH=$(GOPATH) go get github.com/axw/gocov/gocov - GOPATH=$(GOPATH) go get github.com/fzipp/gocyclo - GOPATH=$(GOPATH) go get github.com/gordonklaus/ineffassign - GOPATH=$(GOPATH) go get github.com/client9/misspell/cmd/misspell - GOPATH=$(GOPATH) go get github.com/opennota/check/cmd/structcheck - GOPATH=$(GOPATH) go get github.com/opennota/check/cmd/varcheck - GOPATH=$(GOPATH) go get github.com/kisielk/errcheck - GOPATH=$(GOPATH) go get github.com/securego/gosec/cmd/gosec/... - -# Remove any build artifact -clean: - GOPATH=$(GOPATH) go clean ./... - -# Deletes any intermediate file -nuke: - rm -rf ./target - GOPATH=$(GOPATH) go clean -i ./... diff --git a/cluster-autoscaler/vendor/github.com/willf/bitset/README.md b/cluster-autoscaler/vendor/github.com/willf/bitset/README.md index 6c62b20c6c80..50338e71dfdb 100644 --- a/cluster-autoscaler/vendor/github.com/willf/bitset/README.md +++ b/cluster-autoscaler/vendor/github.com/willf/bitset/README.md @@ -2,10 +2,10 @@ *Go language library to map between non-negative integers and boolean values* -[![Master Build Status](https://secure.travis-ci.org/willf/bitset.png?branch=master)](https://travis-ci.org/willf/bitset?branch=master) +[![Test](https://github.com/willf/bitset/workflows/Test/badge.svg)](https://github.com/willf/bitset/actions?query=workflow%3ATest) [![Master Coverage Status](https://coveralls.io/repos/willf/bitset/badge.svg?branch=master&service=github)](https://coveralls.io/github/willf/bitset?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/willf/bitset)](https://goreportcard.com/report/github.com/willf/bitset) -[![GoDoc](https://godoc.org/github.com/willf/bitset?status.svg)](http://godoc.org/github.com/willf/bitset) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/willf/bitset?tab=doc)](https://pkg.go.dev/github.com/willf/bitset?tab=doc) ## Description @@ -63,8 +63,11 @@ func main() { As an alternative to BitSets, one should check out the 'big' package, which provides a (less set-theoretical) view of bitsets. -Godoc documentation is at: https://godoc.org/github.com/willf/bitset +Package documentation is at: https://pkg.go.dev/github.com/willf/bitset?tab=doc +## Memory Usage + +The memory usage of a bitset using N bits is at least N/8 bytes. The number of bits in a bitset is at least as large as one plus the greatest bit index you have accessed. Thus it is possible to run out of memory while using a bitset. If you have lots of bits, you might prefer compressed bitsets, like the [Roaring bitmaps](http://roaringbitmap.org) and its [Go implementation](https://github.com/RoaringBitmap/roaring). ## Implementation Note @@ -82,15 +85,10 @@ go get github.com/willf/bitset If you wish to contribute to this project, please branch and issue a pull request against master ("[GitHub Flow](https://guides.github.com/introduction/flow/)") -This project include a Makefile that allows you to test and build the project with simple commands. -To see all available options: -```bash -make help -``` - ## Running all tests -Before committing the code, please check if it passes all tests using (note: this will install some dependencies): +Before committing the code, please check if it passes tests, has adequate coverage, etc. ```bash -make qa +go test +go test -cover ``` diff --git a/cluster-autoscaler/vendor/github.com/willf/bitset/bitset.go b/cluster-autoscaler/vendor/github.com/willf/bitset/bitset.go index 22e5d42e5d6d..21e889da2e06 100644 --- a/cluster-autoscaler/vendor/github.com/willf/bitset/bitset.go +++ b/cluster-autoscaler/vendor/github.com/willf/bitset/bitset.go @@ -138,6 +138,9 @@ func (b *BitSet) Len() uint { // extendSetMaybe adds additional words to incorporate new bits if needed func (b *BitSet) extendSetMaybe(i uint) { if i >= b.length { // if we need more bits, make 'em + if i >= Cap() { + panic("You are exceeding the capacity") + } nsize := wordsNeeded(i + 1) if b.set == nil { b.set = make([]uint64, nsize) @@ -160,7 +163,12 @@ func (b *BitSet) Test(i uint) bool { return b.set[i>>log2WordSize]&(1<<(i&(wordSize-1))) != 0 } -// Set bit i to 1 +// Set bit i to 1, the capacity of the bitset is automatically +// increased accordingly. +// If i>= Cap(), this function will panic. +// Warning: using a very large value for 'i' +// may lead to a memory shortage and a panic: the caller is responsible +// for providing sensible parameters in line with their memory capacity. func (b *BitSet) Set(i uint) *BitSet { b.extendSetMaybe(i) b.set[i>>log2WordSize] |= 1 << (i & (wordSize - 1)) @@ -176,7 +184,11 @@ func (b *BitSet) Clear(i uint) *BitSet { return b } -// SetTo sets bit i to value +// SetTo sets bit i to value. +// If i>= Cap(), this function will panic. +// Warning: using a very large value for 'i' +// may lead to a memory shortage and a panic: the caller is responsible +// for providing sensible parameters in line with their memory capacity. func (b *BitSet) SetTo(i uint, value bool) *BitSet { if value { return b.Set(i) @@ -184,7 +196,11 @@ func (b *BitSet) SetTo(i uint, value bool) *BitSet { return b.Clear(i) } -// Flip bit at i +// Flip bit at i. +// If i>= Cap(), this function will panic. +// Warning: using a very large value for 'i' +// may lead to a memory shortage and a panic: the caller is responsible +// for providing sensible parameters in line with their memory capacity. func (b *BitSet) Flip(i uint) *BitSet { if i >= b.length { return b.Set(i) @@ -193,26 +209,51 @@ func (b *BitSet) Flip(i uint) *BitSet { return b } -// Shrink shrinks BitSet to desired length in bits. It clears all bits > length -// and reduces the size and length of the set. +// Shrink shrinks BitSet so that the provided value is the last possible +// set value. It clears all bits > the provided index and reduces the size +// and length of the set. +// +// Note that the parameter value is not the new length in bits: it is the +// maximal value that can be stored in the bitset after the function call. +// The new length in bits is the parameter value + 1. Thus it is not possible +// to use this function to set the length to 0, the minimal value of the length +// after this function call is 1. // // A new slice is allocated to store the new bits, so you may see an increase in // memory usage until the GC runs. Normally this should not be a problem, but if you // have an extremely large BitSet its important to understand that the old BitSet will // remain in memory until the GC frees it. -func (b *BitSet) Shrink(length uint) *BitSet { - idx := wordsNeeded(length + 1) +func (b *BitSet) Shrink(lastbitindex uint) *BitSet { + length := lastbitindex + 1 + idx := wordsNeeded(length) if idx > len(b.set) { return b } shrunk := make([]uint64, idx) copy(shrunk, b.set[:idx]) b.set = shrunk - b.length = length + 1 - b.set[idx-1] &= (allBits >> (uint64(64) - uint64(length&(wordSize-1)) - 1)) + b.length = length + b.set[idx-1] &= (allBits >> (uint64(64) - uint64(length&(wordSize-1)))) return b } +// Compact shrinks BitSet to so that we preserve all set bits, while minimizing +// memory usage. Compact calls Shrink. +func (b *BitSet) Compact() *BitSet { + idx := len(b.set) - 1 + for ; idx >= 0 && b.set[idx] == 0; idx-- { + } + newlength := uint((idx + 1) << log2WordSize) + if newlength >= b.length { + return b // nothing to do + } + if newlength > 0 { + return b.Shrink(newlength - 1) + } + // We preserve one word + return b.Shrink(63) +} + // InsertAt takes an index which indicates where a bit should be // inserted. Then it shifts all the bits in the set to the left by 1, starting // from the given index position, and sets the index position to 0. @@ -323,6 +364,9 @@ func (b *BitSet) DeleteAt(i uint) *BitSet { // including possibly the current index // along with an error code (true = valid, false = no set bit found) // for i,e := v.NextSet(0); e; i,e = v.NextSet(i + 1) {...} +// +// Users concerned with performance may want to use NextSetMany to +// retrieve several values at once. func (b *BitSet) NextSet(i uint) (uint, bool) { x := int(i >> log2WordSize) if x >= len(b.set) { @@ -358,6 +402,14 @@ func (b *BitSet) NextSet(i uint) (uint, bool) { // j += 1 // } // +// +// It is possible to retrieve all set bits as follow: +// +// indices := make([]uint, bitmap.Count()) +// bitmap.NextSetMany(0, indices) +// +// However if bitmap.Count() is large, it might be preferable to +// use several calls to NextSetMany, for performance reasons. func (b *BitSet) NextSetMany(i uint, buffer []uint) (uint, []uint) { myanswer := buffer capacity := cap(buffer) @@ -809,7 +861,7 @@ func (b *BitSet) ReadFrom(stream io.Reader) (int64, error) { newset := New(uint(length)) if uint64(newset.length) != length { - return 0, errors.New("Unmarshalling error: type mismatch") + return 0, errors.New("unmarshalling error: type mismatch") } // Read remaining bytes as set diff --git a/cluster-autoscaler/vendor/github.com/willf/bitset/go.mod b/cluster-autoscaler/vendor/github.com/willf/bitset/go.mod new file mode 100644 index 000000000000..583ecab78f74 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/willf/bitset/go.mod @@ -0,0 +1,3 @@ +module github.com/willf/bitset + +go 1.14 diff --git a/cluster-autoscaler/vendor/github.com/willf/bitset/go.sum b/cluster-autoscaler/vendor/github.com/willf/bitset/go.sum new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/.gitignore b/cluster-autoscaler/vendor/go.uber.org/atomic/.gitignore index 0a4504f11095..c3fa253893f0 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/.gitignore +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/.gitignore @@ -1,6 +1,7 @@ +/bin .DS_Store /vendor -/cover +cover.html cover.out lint.log diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/.travis.yml b/cluster-autoscaler/vendor/go.uber.org/atomic/.travis.yml index 0f3769e5fa6b..4e73268b6029 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/.travis.yml +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/.travis.yml @@ -2,26 +2,26 @@ sudo: false language: go go_import_path: go.uber.org/atomic -go: - - 1.11.x - - 1.12.x +env: + global: + - GO111MODULE=on matrix: include: - go: 1.12.x - env: NO_TEST=yes LINT=yes + - go: 1.13.x + env: LINT=1 cache: directories: - vendor -install: - - make install_ci +before_install: + - go version script: - - test -n "$NO_TEST" || make test_ci - - test -n "$NO_TEST" || scripts/test-ubergo.sh - - test -z "$LINT" || make install_lint lint + - test -z "$LINT" || make lint + - make cover after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/CHANGELOG.md b/cluster-autoscaler/vendor/go.uber.org/atomic/CHANGELOG.md new file mode 100644 index 000000000000..aef8b6ebc418 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/CHANGELOG.md @@ -0,0 +1,64 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.6.0] - 2020-02-24 +### Changed +- Drop library dependency on `golang.org/x/{lint, tools}`. + +## [1.5.1] - 2019-11-19 +- Fix bug where `Bool.CAS` and `Bool.Toggle` do work correctly together + causing `CAS` to fail even though the old value matches. + +## [1.5.0] - 2019-10-29 +### Changed +- With Go modules, only the `go.uber.org/atomic` import path is supported now. + If you need to use the old import path, please add a `replace` directive to + your `go.mod`. + +## [1.4.0] - 2019-05-01 +### Added + - Add `atomic.Error` type for atomic operations on `error` values. + +## [1.3.2] - 2018-05-02 +### Added +- Add `atomic.Duration` type for atomic operations on `time.Duration` values. + +## [1.3.1] - 2017-11-14 +### Fixed +- Revert optimization for `atomic.String.Store("")` which caused data races. + +## [1.3.0] - 2017-11-13 +### Added +- Add `atomic.Bool.CAS` for compare-and-swap semantics on bools. + +### Changed +- Optimize `atomic.String.Store("")` by avoiding an allocation. + +## [1.2.0] - 2017-04-12 +### Added +- Shadow `atomic.Value` from `sync/atomic`. + +## [1.1.0] - 2017-03-10 +### Added +- Add atomic `Float64` type. + +### Changed +- Support new `go.uber.org/atomic` import path. + +## [1.0.0] - 2016-07-18 + +- Initial release. + +[1.6.0]: https://github.com/uber-go/atomic/compare/v1.5.1...v1.6.0 +[1.5.1]: https://github.com/uber-go/atomic/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/uber-go/atomic/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/uber-go/atomic/compare/v1.3.2...v1.4.0 +[1.3.2]: https://github.com/uber-go/atomic/compare/v1.3.1...v1.3.2 +[1.3.1]: https://github.com/uber-go/atomic/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/uber-go/atomic/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/uber-go/atomic/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/uber-go/atomic/compare/v1.0.0...v1.1.0 +[1.0.0]: https://github.com/uber-go/atomic/releases/tag/v1.0.0 diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/Makefile b/cluster-autoscaler/vendor/go.uber.org/atomic/Makefile index 1ef263075d76..39af0fb63f2f 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/Makefile +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/Makefile @@ -1,51 +1,35 @@ -# Many Go tools take file globs or directories as arguments instead of packages. -PACKAGE_FILES ?= *.go +# Directory to place `go install`ed binaries into. +export GOBIN ?= $(shell pwd)/bin -# For pre go1.6 -export GO15VENDOREXPERIMENT=1 +GOLINT = $(GOBIN)/golint +GO_FILES ?= *.go .PHONY: build build: - go build -i ./... - - -.PHONY: install -install: - glide --version || go get github.com/Masterminds/glide - glide install - + go build ./... .PHONY: test test: - go test -cover -race ./... + go test -race ./... +.PHONY: gofmt +gofmt: + $(eval FMT_LOG := $(shell mktemp -t gofmt.XXXXX)) + gofmt -e -s -l $(GO_FILES) > $(FMT_LOG) || true + @[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" && cat $(FMT_LOG) && false) -.PHONY: install_ci -install_ci: install - go get github.com/wadey/gocovmerge - go get github.com/mattn/goveralls - go get golang.org/x/tools/cmd/cover - -.PHONY: install_lint -install_lint: - go get golang.org/x/lint/golint +$(GOLINT): + go install golang.org/x/lint/golint +.PHONY: golint +golint: $(GOLINT) + $(GOLINT) ./... .PHONY: lint -lint: - @rm -rf lint.log - @echo "Checking formatting..." - @gofmt -d -s $(PACKAGE_FILES) 2>&1 | tee lint.log - @echo "Checking vet..." - @go vet ./... 2>&1 | tee -a lint.log;) - @echo "Checking lint..." - @golint $$(go list ./...) 2>&1 | tee -a lint.log - @echo "Checking for unresolved FIXMEs..." - @git grep -i fixme | grep -v -e vendor -e Makefile | tee -a lint.log - @[ ! -s lint.log ] - - -.PHONY: test_ci -test_ci: install_ci build - ./scripts/cover.sh $(shell go list $(PACKAGES)) +lint: gofmt golint + +.PHONY: cover +cover: + go test -coverprofile=cover.out -coverpkg ./... -v ./... + go tool cover -html=cover.out -o cover.html diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/README.md b/cluster-autoscaler/vendor/go.uber.org/atomic/README.md index 62eb8e576096..ade0c20f16b4 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/README.md +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/README.md @@ -3,9 +3,34 @@ Simple wrappers for primitive types to enforce atomic access. ## Installation -`go get -u go.uber.org/atomic` + +```shell +$ go get -u go.uber.org/atomic@v1 +``` + +### Legacy Import Path + +As of v1.5.0, the import path `go.uber.org/atomic` is the only supported way +of using this package. If you are using Go modules, this package will fail to +compile with the legacy import path path `github.com/uber-go/atomic`. + +We recommend migrating your code to the new import path but if you're unable +to do so, or if your dependencies are still using the old import path, you +will have to add a `replace` directive to your `go.mod` file downgrading the +legacy import path to an older version. + +``` +replace github.com/uber-go/atomic => github.com/uber-go/atomic v1.4.0 +``` + +You can do so automatically by running the following command. + +```shell +$ go mod edit -replace github.com/uber-go/atomic=github.com/uber-go/atomic@v1.4.0 +``` ## Usage + The standard library's `sync/atomic` is powerful, but it's easy to forget which variables must be accessed atomically. `go.uber.org/atomic` preserves all the functionality of the standard library, but wraps the primitive types to @@ -21,9 +46,11 @@ atom.CAS(40, 11) See the [documentation][doc] for a complete API specification. ## Development Status + Stable. -___ +--- + Released under the [MIT License](LICENSE.txt). [doc-img]: https://godoc.org/github.com/uber-go/atomic?status.svg diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/atomic.go b/cluster-autoscaler/vendor/go.uber.org/atomic/atomic.go index 1db6849fca0a..ad5fa0980a7e 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/atomic.go +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/atomic.go @@ -250,11 +250,16 @@ func (b *Bool) Swap(new bool) bool { // Toggle atomically negates the Boolean and returns the previous value. func (b *Bool) Toggle() bool { - return truthy(atomic.AddUint32(&b.v, 1) - 1) + for { + old := b.Load() + if b.CAS(old, !old) { + return old + } + } } func truthy(n uint32) bool { - return n&1 == 1 + return n == 1 } func boolToInt(b bool) uint32 { diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/glide.lock b/cluster-autoscaler/vendor/go.uber.org/atomic/glide.lock deleted file mode 100644 index 3c72c59976da..000000000000 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/glide.lock +++ /dev/null @@ -1,17 +0,0 @@ -hash: f14d51408e3e0e4f73b34e4039484c78059cd7fc5f4996fdd73db20dc8d24f53 -updated: 2016-10-27T00:10:51.16960137-07:00 -imports: [] -testImports: -- name: github.com/davecgh/go-spew - version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d - subpackages: - - spew -- name: github.com/pmezard/go-difflib - version: d8ed2627bdf02c080bf22230dbb337003b7aba2d - subpackages: - - difflib -- name: github.com/stretchr/testify - version: d77da356e56a7428ad25149ca77381849a6a5232 - subpackages: - - assert - - require diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/glide.yaml b/cluster-autoscaler/vendor/go.uber.org/atomic/glide.yaml deleted file mode 100644 index 4cf608ec0f89..000000000000 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/glide.yaml +++ /dev/null @@ -1,6 +0,0 @@ -package: go.uber.org/atomic -testImport: -- package: github.com/stretchr/testify - subpackages: - - assert - - require diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/go.mod b/cluster-autoscaler/vendor/go.uber.org/atomic/go.mod new file mode 100644 index 000000000000..a935daebb9f4 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/go.mod @@ -0,0 +1,10 @@ +module go.uber.org/atomic + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/stretchr/testify v1.3.0 + golang.org/x/lint v0.0.0-20190930215403-16217165b5de + golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c // indirect +) + +go 1.13 diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/go.sum b/cluster-autoscaler/vendor/go.uber.org/atomic/go.sum new file mode 100644 index 000000000000..51b2b62afbcf --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/go.sum @@ -0,0 +1,22 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c h1:IGkKhmfzcztjm6gYkykvu/NiS8kaqbCWAEWWAyf8J5U= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/.gitignore b/cluster-autoscaler/vendor/go.uber.org/multierr/.gitignore index 61ead86667ca..b9a05e3da0d2 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/.gitignore +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/.gitignore @@ -1 +1,4 @@ /vendor +cover.html +cover.out +/bin diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/.travis.yml b/cluster-autoscaler/vendor/go.uber.org/multierr/.travis.yml index 5ffa8fed4853..786c917a397e 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/.travis.yml +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/.travis.yml @@ -5,11 +5,12 @@ go_import_path: go.uber.org/multierr env: global: - GO15VENDOREXPERIMENT=1 + - GO111MODULE=on go: - - 1.7 - - 1.8 - - tip + - 1.11.x + - 1.12.x + - 1.13.x cache: directories: @@ -18,16 +19,11 @@ cache: before_install: - go version -install: -- | - set -e - make install_ci - script: - | set -e make lint - make test_ci + make cover after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/CHANGELOG.md b/cluster-autoscaler/vendor/go.uber.org/multierr/CHANGELOG.md index 898445d06325..3110c5af0b3a 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/CHANGELOG.md +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/CHANGELOG.md @@ -1,6 +1,32 @@ Releases ======== +v1.5.0 (2020-02-24) +=================== + +- Drop library dependency on development-time tooling. + + +v1.4.0 (2019-11-04) +=================== + +- Add `AppendInto` function to more ergonomically build errors inside a + loop. + + +v1.3.0 (2019-10-29) +=================== + +- Switch to Go modules. + + +v1.2.0 (2019-09-26) +=================== + +- Support extracting and matching against wrapped errors with `errors.As` + and `errors.Is`. + + v1.1.0 (2017-06-30) =================== diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/Makefile b/cluster-autoscaler/vendor/go.uber.org/multierr/Makefile index a7437d061fc6..416018237e32 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/Makefile +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/Makefile @@ -1,23 +1,17 @@ -export GO15VENDOREXPERIMENT=1 - -PACKAGES := $(shell glide nv) +# Directory to put `go install`ed binaries in. +export GOBIN ?= $(shell pwd)/bin GO_FILES := $(shell \ find . '(' -path '*/.*' -o -path './vendor' ')' -prune \ -o -name '*.go' -print | cut -b3-) -.PHONY: install -install: - glide --version || go get github.com/Masterminds/glide - glide install - .PHONY: build build: - go build -i $(PACKAGES) + go build ./... .PHONY: test test: - go test -cover -race $(PACKAGES) + go test -race ./... .PHONY: gofmt gofmt: @@ -25,50 +19,24 @@ gofmt: @gofmt -e -s -l $(GO_FILES) > $(FMT_LOG) || true @[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" | cat - $(FMT_LOG) && false) -.PHONY: govet -govet: - $(eval VET_LOG := $(shell mktemp -t govet.XXXXX)) - @go vet $(PACKAGES) 2>&1 \ - | grep -v '^exit status' > $(VET_LOG) || true - @[ ! -s "$(VET_LOG)" ] || (echo "govet failed:" | cat - $(VET_LOG) && false) - .PHONY: golint golint: - @go get github.com/golang/lint/golint - $(eval LINT_LOG := $(shell mktemp -t golint.XXXXX)) - @cat /dev/null > $(LINT_LOG) - @$(foreach pkg, $(PACKAGES), golint $(pkg) >> $(LINT_LOG) || true;) - @[ ! -s "$(LINT_LOG)" ] || (echo "golint failed:" | cat - $(LINT_LOG) && false) + @go install golang.org/x/lint/golint + @$(GOBIN)/golint ./... .PHONY: staticcheck staticcheck: - @go get honnef.co/go/tools/cmd/staticcheck - $(eval STATICCHECK_LOG := $(shell mktemp -t staticcheck.XXXXX)) - @staticcheck $(PACKAGES) 2>&1 > $(STATICCHECK_LOG) || true - @[ ! -s "$(STATICCHECK_LOG)" ] || (echo "staticcheck failed:" | cat - $(STATICCHECK_LOG) && false) + @go install honnef.co/go/tools/cmd/staticcheck + @$(GOBIN)/staticcheck ./... .PHONY: lint -lint: gofmt govet golint staticcheck +lint: gofmt golint staticcheck .PHONY: cover cover: - ./scripts/cover.sh $(shell go list $(PACKAGES)) + go test -coverprofile=cover.out -coverpkg=./... -v ./... go tool cover -html=cover.out -o cover.html update-license: - @go get go.uber.org/tools/update-license - @update-license \ - $(shell go list -json $(PACKAGES) | \ - jq -r '.Dir + "/" + (.GoFiles | .[])') - -############################################################################## - -.PHONY: install_ci -install_ci: install - go get github.com/wadey/gocovmerge - go get github.com/mattn/goveralls - go get golang.org/x/tools/cmd/cover - -.PHONY: test_ci -test_ci: install_ci - ./scripts/cover.sh $(shell go list $(PACKAGES)) + @go install go.uber.org/tools/update-license + @$(GOBIN)/update-license $(GO_FILES) diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/README.md b/cluster-autoscaler/vendor/go.uber.org/multierr/README.md index 065088f641ef..751bd65e5811 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/README.md +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/README.md @@ -17,7 +17,7 @@ Released under the [MIT License]. [MIT License]: LICENSE.txt [doc-img]: https://godoc.org/go.uber.org/multierr?status.svg [doc]: https://godoc.org/go.uber.org/multierr -[ci-img]: https://travis-ci.org/uber-go/multierr.svg?branch=master +[ci-img]: https://travis-ci.com/uber-go/multierr.svg?branch=master [cov-img]: https://codecov.io/gh/uber-go/multierr/branch/master/graph/badge.svg -[ci]: https://travis-ci.org/uber-go/multierr +[ci]: https://travis-ci.com/uber-go/multierr [cov]: https://codecov.io/gh/uber-go/multierr diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/error.go b/cluster-autoscaler/vendor/go.uber.org/multierr/error.go index de6ce4736c8c..04eb9618c10b 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/error.go +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/error.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Uber Technologies, Inc. +// Copyright (c) 2019 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -33,7 +33,7 @@ // If only two errors are being combined, the Append function may be used // instead. // -// err = multierr.Combine(reader.Close(), writer.Close()) +// err = multierr.Append(reader.Close(), writer.Close()) // // This makes it possible to record resource cleanup failures from deferred // blocks with the help of named return values. @@ -99,8 +99,6 @@ var ( // Separator for single-line error messages. _singlelineSeparator = []byte("; ") - _newline = []byte("\n") - // Prefix for multi-line messages _multilinePrefix = []byte("the following errors occurred:") @@ -132,7 +130,7 @@ type errorGroup interface { } // Errors returns a slice containing zero or more errors that the supplied -// error is composed of. If the error is nil, the returned slice is empty. +// error is composed of. If the error is nil, a nil slice is returned. // // err := multierr.Append(r.Close(), w.Close()) // errors := multierr.Errors(err) @@ -399,3 +397,53 @@ func Append(left error, right error) error { errors := [2]error{left, right} return fromSlice(errors[0:]) } + +// AppendInto appends an error into the destination of an error pointer and +// returns whether the error being appended was non-nil. +// +// var err error +// multierr.AppendInto(&err, r.Close()) +// multierr.AppendInto(&err, w.Close()) +// +// The above is equivalent to, +// +// err := multierr.Append(r.Close(), w.Close()) +// +// As AppendInto reports whether the provided error was non-nil, it may be +// used to build a multierr error in a loop more ergonomically. For example: +// +// var err error +// for line := range lines { +// var item Item +// if multierr.AppendInto(&err, parse(line, &item)) { +// continue +// } +// items = append(items, item) +// } +// +// Compare this with a verison that relies solely on Append: +// +// var err error +// for line := range lines { +// var item Item +// if parseErr := parse(line, &item); parseErr != nil { +// err = multierr.Append(err, parseErr) +// continue +// } +// items = append(items, item) +// } +func AppendInto(into *error, err error) (errored bool) { + if into == nil { + // We panic if 'into' is nil. This is not documented above + // because suggesting that the pointer must be non-nil may + // confuse users into thinking that the error that it points + // to must be non-nil. + panic("misuse of multierr.AppendInto: into pointer must not be nil") + } + + if err == nil { + return false + } + *into = Append(*into, err) + return true +} diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/glide.lock b/cluster-autoscaler/vendor/go.uber.org/multierr/glide.lock deleted file mode 100644 index f9ea94c33487..000000000000 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/glide.lock +++ /dev/null @@ -1,19 +0,0 @@ -hash: b53b5e9a84b9cb3cc4b2d0499e23da2feca1eec318ce9bb717ecf35bf24bf221 -updated: 2017-04-10T13:34:45.671678062-07:00 -imports: -- name: go.uber.org/atomic - version: 3b8db5e93c4c02efbc313e17b2e796b0914a01fb -testImports: -- name: github.com/davecgh/go-spew - version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9 - subpackages: - - spew -- name: github.com/pmezard/go-difflib - version: d8ed2627bdf02c080bf22230dbb337003b7aba2d - subpackages: - - difflib -- name: github.com/stretchr/testify - version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0 - subpackages: - - assert - - require diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/go.mod b/cluster-autoscaler/vendor/go.uber.org/multierr/go.mod new file mode 100644 index 000000000000..58d5f90bbd7f --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/go.mod @@ -0,0 +1,12 @@ +module go.uber.org/multierr + +go 1.12 + +require ( + github.com/stretchr/testify v1.3.0 + go.uber.org/atomic v1.6.0 + go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee + golang.org/x/lint v0.0.0-20190930215403-16217165b5de + golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 // indirect + honnef.co/go/tools v0.0.1-2019.2.3 +) diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/go.sum b/cluster-autoscaler/vendor/go.uber.org/multierr/go.sum new file mode 100644 index 000000000000..557fbba28f8a --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/go.sum @@ -0,0 +1,45 @@ +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +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/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +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/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c h1:IGkKhmfzcztjm6gYkykvu/NiS8kaqbCWAEWWAyf8J5U= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/go113.go b/cluster-autoscaler/vendor/go.uber.org/multierr/go113.go new file mode 100644 index 000000000000..264b0eac0ddc --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/go113.go @@ -0,0 +1,52 @@ +// Copyright (c) 2019 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// +build go1.13 + +package multierr + +import "errors" + +// As attempts to find the first error in the error list that matches the type +// of the value that target points to. +// +// This function allows errors.As to traverse the values stored on the +// multierr error. +func (merr *multiError) As(target interface{}) bool { + for _, err := range merr.Errors() { + if errors.As(err, target) { + return true + } + } + return false +} + +// Is attempts to match the provided error against errors in the error list. +// +// This function allows errors.Is to traverse the values stored on the +// multierr error. +func (merr *multiError) Is(target error) bool { + for _, err := range merr.Errors() { + if errors.Is(err, target) { + return true + } + } + return false +} diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/.gitignore b/cluster-autoscaler/vendor/go.uber.org/zap/.gitignore index 08fbde6ce294..da9d9d00b474 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/.gitignore +++ b/cluster-autoscaler/vendor/go.uber.org/zap/.gitignore @@ -26,3 +26,7 @@ _testmain.go *.pprof *.out *.log + +/bin +cover.out +cover.html diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/.readme.tmpl b/cluster-autoscaler/vendor/go.uber.org/zap/.readme.tmpl index c6440db8eb07..3154a1e64cf2 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/.readme.tmpl +++ b/cluster-autoscaler/vendor/go.uber.org/zap/.readme.tmpl @@ -100,9 +100,10 @@ pinned in zap's [glide.lock][] file. [↩](#anchor-versions) [doc-img]: https://godoc.org/go.uber.org/zap?status.svg [doc]: https://godoc.org/go.uber.org/zap -[ci-img]: https://travis-ci.org/uber-go/zap.svg?branch=master -[ci]: https://travis-ci.org/uber-go/zap +[ci-img]: https://travis-ci.com/uber-go/zap.svg?branch=master +[ci]: https://travis-ci.com/uber-go/zap [cov-img]: https://codecov.io/gh/uber-go/zap/branch/master/graph/badge.svg [cov]: https://codecov.io/gh/uber-go/zap [benchmarking suite]: https://github.com/uber-go/zap/tree/master/benchmarks [glide.lock]: https://github.com/uber-go/zap/blob/master/glide.lock + diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/.travis.yml b/cluster-autoscaler/vendor/go.uber.org/zap/.travis.yml index ada5ebdcc9c6..cfdc69f413e7 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/.travis.yml +++ b/cluster-autoscaler/vendor/go.uber.org/zap/.travis.yml @@ -1,21 +1,23 @@ language: go sudo: false -go: - - 1.11.x - - 1.12.x + go_import_path: go.uber.org/zap env: global: - TEST_TIMEOUT_SCALE=10 -cache: - directories: - - vendor -install: - - make dependencies + - GO111MODULE=on + +matrix: + include: + - go: 1.13.x + - go: 1.14.x + env: LINT=1 + script: - - make lint + - test -z "$LINT" || make lint - make test - make bench + after_success: - make cover - bash <(curl -s https://codecov.io/bash) diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/CHANGELOG.md b/cluster-autoscaler/vendor/go.uber.org/zap/CHANGELOG.md index 28d10677eb68..fa817e6a1036 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/CHANGELOG.md +++ b/cluster-autoscaler/vendor/go.uber.org/zap/CHANGELOG.md @@ -1,5 +1,85 @@ # Changelog +## 1.16.0 (1 Sep 2020) + +Bugfixes: +* [#828][]: Fix missing newline in IncreaseLevel error messages. +* [#835][]: Fix panic in JSON encoder when encoding times or durations + without specifying a time or duration encoder. +* [#843][]: Honor CallerSkip when taking stack traces. +* [#862][]: Fix the default file permissions to use `0666` and rely on the umask instead. +* [#854][]: Encode `` for nil `Stringer` instead of a panic error log. + +Enhancements: +* [#629][]: Added `zapcore.TimeEncoderOfLayout` to easily create time encoders + for custom layouts. +* [#697][]: Added support for a configurable delimiter in the console encoder. +* [#852][]: Optimize console encoder by pooling the underlying JSON encoder. +* [#844][]: Add ability to include the calling function as part of logs. +* [#843][]: Add `StackSkip` for including truncated stacks as a field. +* [#861][]: Add options to customize Fatal behaviour for better testability. + +Thanks to @SteelPhase, @tmshn, @lixingwang, @wyxloading, @moul, @segevfiner, @andy-retailnext and @jcorbin for their contributions to this release. + +## 1.15.0 (23 Apr 2020) + +Bugfixes: +* [#804][]: Fix handling of `Time` values out of `UnixNano` range. +* [#812][]: Fix `IncreaseLevel` being reset after a call to `With`. + +Enhancements: +* [#806][]: Add `WithCaller` option to supersede the `AddCaller` option. This + allows disabling annotation of log entries with caller information if + previously enabled with `AddCaller`. +* [#813][]: Deprecate `NewSampler` constructor in favor of + `NewSamplerWithOptions` which supports a `SamplerHook` option. This option + adds support for monitoring sampling decisions through a hook. + +Thanks to @danielbprice for their contributions to this release. + +## 1.14.1 (14 Mar 2020) + +Bugfixes: +* [#791][]: Fix panic on attempting to build a logger with an invalid Config. +* [#795][]: Vendoring Zap with `go mod vendor` no longer includes Zap's + development-time dependencies. +* [#799][]: Fix issue introduced in 1.14.0 that caused invalid JSON output to + be generated for arrays of `time.Time` objects when using string-based time + formats. + +Thanks to @YashishDua for their contributions to this release. + +## 1.14.0 (20 Feb 2020) + +Enhancements: +* [#771][]: Optimize calls for disabled log levels. +* [#773][]: Add millisecond duration encoder. +* [#775][]: Add option to increase the level of a logger. +* [#786][]: Optimize time formatters using `Time.AppendFormat` where possible. + +Thanks to @caibirdme for their contributions to this release. + +## 1.13.0 (13 Nov 2019) + +Enhancements: +* [#758][]: Add `Intp`, `Stringp`, and other similar `*p` field constructors + to log pointers to primitives with support for `nil` values. + +Thanks to @jbizzle for their contributions to this release. + +## 1.12.0 (29 Oct 2019) + +Enhancements: +* [#751][]: Migrate to Go modules. + +## 1.11.0 (21 Oct 2019) + +Enhancements: +* [#725][]: Add `zapcore.OmitKey` to omit keys in an `EncoderConfig`. +* [#736][]: Add `RFC3339` and `RFC3339Nano` time encoders. + +Thanks to @juicemia, @uhthomas for their contributions to this release. + ## 1.10.0 (29 Apr 2019) Bugfixes: @@ -325,3 +405,28 @@ upgrade to the upcoming stable release. [#610]: https://github.com/uber-go/zap/pull/610 [#675]: https://github.com/uber-go/zap/pull/675 [#704]: https://github.com/uber-go/zap/pull/704 +[#725]: https://github.com/uber-go/zap/pull/725 +[#736]: https://github.com/uber-go/zap/pull/736 +[#751]: https://github.com/uber-go/zap/pull/751 +[#758]: https://github.com/uber-go/zap/pull/758 +[#771]: https://github.com/uber-go/zap/pull/771 +[#773]: https://github.com/uber-go/zap/pull/773 +[#775]: https://github.com/uber-go/zap/pull/775 +[#786]: https://github.com/uber-go/zap/pull/786 +[#791]: https://github.com/uber-go/zap/pull/791 +[#795]: https://github.com/uber-go/zap/pull/795 +[#799]: https://github.com/uber-go/zap/pull/799 +[#804]: https://github.com/uber-go/zap/pull/804 +[#812]: https://github.com/uber-go/zap/pull/812 +[#806]: https://github.com/uber-go/zap/pull/806 +[#813]: https://github.com/uber-go/zap/pull/813 +[#629]: https://github.com/uber-go/zap/pull/629 +[#697]: https://github.com/uber-go/zap/pull/697 +[#828]: https://github.com/uber-go/zap/pull/828 +[#835]: https://github.com/uber-go/zap/pull/835 +[#843]: https://github.com/uber-go/zap/pull/843 +[#844]: https://github.com/uber-go/zap/pull/844 +[#852]: https://github.com/uber-go/zap/pull/852 +[#854]: https://github.com/uber-go/zap/pull/854 +[#861]: https://github.com/uber-go/zap/pull/861 +[#862]: https://github.com/uber-go/zap/pull/862 diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/FAQ.md b/cluster-autoscaler/vendor/go.uber.org/zap/FAQ.md index 4256d35c76bf..5ec728875076 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/FAQ.md +++ b/cluster-autoscaler/vendor/go.uber.org/zap/FAQ.md @@ -149,6 +149,7 @@ We're aware of the following extensions, but haven't used them ourselves: | `github.com/tchap/zapext` | Sentry, syslog | | `github.com/fgrosse/zaptest` | Ginkgo | | `github.com/blendle/zapdriver` | Stackdriver | +| `github.com/moul/zapgorm` | Gorm | [go-proverbs]: https://go-proverbs.github.io/ [import-path]: https://golang.org/cmd/go/#hdr-Remote_import_paths diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/Makefile b/cluster-autoscaler/vendor/go.uber.org/zap/Makefile index 073e9aa910a8..dfaf6406e974 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/Makefile +++ b/cluster-autoscaler/vendor/go.uber.org/zap/Makefile @@ -1,74 +1,61 @@ -export GO15VENDOREXPERIMENT=1 +export GOBIN ?= $(shell pwd)/bin +GOLINT = $(GOBIN)/golint +STATICCHECK = $(GOBIN)/staticcheck BENCH_FLAGS ?= -cpuprofile=cpu.pprof -memprofile=mem.pprof -benchmem -PKGS ?= $(shell glide novendor) -# Many Go tools take file globs or directories as arguments instead of packages. -PKG_FILES ?= *.go zapcore benchmarks buffer zapgrpc zaptest zaptest/observer internal/bufferpool internal/exit internal/color internal/ztest -# The linting tools evolve with each Go version, so run them only on the latest -# stable release. -GO_VERSION := $(shell go version | cut -d " " -f 3) -GO_MINOR_VERSION := $(word 2,$(subst ., ,$(GO_VERSION))) -LINTABLE_MINOR_VERSIONS := 12 -ifneq ($(filter $(LINTABLE_MINOR_VERSIONS),$(GO_MINOR_VERSION)),) -SHOULD_LINT := true -endif +# Directories containing independent Go modules. +# +# We track coverage only for the main module. +MODULE_DIRS = . ./benchmarks +# Many Go tools take file globs or directories as arguments instead of packages. +GO_FILES := $(shell \ + find . '(' -path '*/.*' -o -path './vendor' ')' -prune \ + -o -name '*.go' -print | cut -b3-) .PHONY: all all: lint test -.PHONY: dependencies -dependencies: - @echo "Installing Glide and locked dependencies..." - glide --version || go get -u -f github.com/Masterminds/glide - glide install - @echo "Installing test dependencies..." - go install ./vendor/github.com/axw/gocov/gocov - go install ./vendor/github.com/mattn/goveralls -ifdef SHOULD_LINT - @echo "Installing golint..." - go install ./vendor/github.com/golang/lint/golint -else - @echo "Not installing golint, since we don't expect to lint on" $(GO_VERSION) -endif - -# Disable printf-like invocation checking due to testify.assert.Error() -VET_RULES := -printf=false - .PHONY: lint -lint: -ifdef SHOULD_LINT +lint: $(GOLINT) $(STATICCHECK) @rm -rf lint.log @echo "Checking formatting..." - @gofmt -d -s $(PKG_FILES) 2>&1 | tee lint.log - @echo "Installing test dependencies for vet..." - @go test -i $(PKGS) + @gofmt -d -s $(GO_FILES) 2>&1 | tee lint.log @echo "Checking vet..." - @go vet $(VET_RULES) $(PKGS) 2>&1 | tee -a lint.log + @$(foreach dir,$(MODULE_DIRS),(cd $(dir) && go vet ./... 2>&1) &&) true | tee -a lint.log @echo "Checking lint..." - @$(foreach dir,$(PKGS),golint $(dir) 2>&1 | tee -a lint.log;) + @$(foreach dir,$(MODULE_DIRS),(cd $(dir) && $(GOLINT) ./... 2>&1) &&) true | tee -a lint.log + @echo "Checking staticcheck..." + @$(foreach dir,$(MODULE_DIRS),(cd $(dir) && $(STATICCHECK) ./... 2>&1) &&) true | tee -a lint.log @echo "Checking for unresolved FIXMEs..." - @git grep -i fixme | grep -v -e vendor -e Makefile | tee -a lint.log + @git grep -i fixme | grep -v -e Makefile | tee -a lint.log @echo "Checking for license headers..." - @./check_license.sh | tee -a lint.log + @./checklicense.sh | tee -a lint.log @[ ! -s lint.log ] -else - @echo "Skipping linters on" $(GO_VERSION) -endif + +$(GOLINT): + go install golang.org/x/lint/golint + +$(STATICCHECK): + go install honnef.co/go/tools/cmd/staticcheck .PHONY: test test: - go test -race $(PKGS) + @$(foreach dir,$(MODULE_DIRS),(cd $(dir) && go test -race ./...) &&) true .PHONY: cover cover: - ./scripts/cover.sh $(PKGS) + go test -race -coverprofile=cover.out -coverpkg=./... ./... + go tool cover -html=cover.out -o cover.html .PHONY: bench BENCH ?= . bench: - @$(foreach pkg,$(PKGS),go test -bench=$(BENCH) -run="^$$" $(BENCH_FLAGS) $(pkg);) + @$(foreach dir,$(MODULE_DIRS), ( \ + cd $(dir) && \ + go list ./... | xargs -n1 go test -bench=$(BENCH) -run="^$$" $(BENCH_FLAGS) \ + ) &&) true .PHONY: updatereadme updatereadme: diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/README.md b/cluster-autoscaler/vendor/go.uber.org/zap/README.md index f4fd1cb4441c..bcea28a196f0 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/README.md +++ b/cluster-autoscaler/vendor/go.uber.org/zap/README.md @@ -64,43 +64,40 @@ id="anchor-versions">[1](#footnote-versions) Log a message and 10 fields: -| Package | Time | Objects Allocated | -| :--- | :---: | :---: | -| :zap: zap | 3131 ns/op | 5 allocs/op | -| :zap: zap (sugared) | 4173 ns/op | 21 allocs/op | -| zerolog | 16154 ns/op | 90 allocs/op | -| lion | 16341 ns/op | 111 allocs/op | -| go-kit | 17049 ns/op | 126 allocs/op | -| logrus | 23662 ns/op | 142 allocs/op | -| log15 | 36351 ns/op | 149 allocs/op | -| apex/log | 42530 ns/op | 126 allocs/op | +| Package | Time | Time % to zap | Objects Allocated | +| :------ | :--: | :-----------: | :---------------: | +| :zap: zap | 862 ns/op | +0% | 5 allocs/op +| :zap: zap (sugared) | 1250 ns/op | +45% | 11 allocs/op +| zerolog | 4021 ns/op | +366% | 76 allocs/op +| go-kit | 4542 ns/op | +427% | 105 allocs/op +| apex/log | 26785 ns/op | +3007% | 115 allocs/op +| logrus | 29501 ns/op | +3322% | 125 allocs/op +| log15 | 29906 ns/op | +3369% | 122 allocs/op Log a message with a logger that already has 10 fields of context: -| Package | Time | Objects Allocated | -| :--- | :---: | :---: | -| :zap: zap | 380 ns/op | 0 allocs/op | -| :zap: zap (sugared) | 564 ns/op | 2 allocs/op | -| zerolog | 321 ns/op | 0 allocs/op | -| lion | 7092 ns/op | 39 allocs/op | -| go-kit | 20226 ns/op | 115 allocs/op | -| logrus | 22312 ns/op | 130 allocs/op | -| log15 | 28788 ns/op | 79 allocs/op | -| apex/log | 42063 ns/op | 115 allocs/op | +| Package | Time | Time % to zap | Objects Allocated | +| :------ | :--: | :-----------: | :---------------: | +| :zap: zap | 126 ns/op | +0% | 0 allocs/op +| :zap: zap (sugared) | 187 ns/op | +48% | 2 allocs/op +| zerolog | 88 ns/op | -30% | 0 allocs/op +| go-kit | 5087 ns/op | +3937% | 103 allocs/op +| log15 | 18548 ns/op | +14621% | 73 allocs/op +| apex/log | 26012 ns/op | +20544% | 104 allocs/op +| logrus | 27236 ns/op | +21516% | 113 allocs/op Log a static string, without any context or `printf`-style templating: -| Package | Time | Objects Allocated | -| :--- | :---: | :---: | -| :zap: zap | 361 ns/op | 0 allocs/op | -| :zap: zap (sugared) | 534 ns/op | 2 allocs/op | -| zerolog | 323 ns/op | 0 allocs/op | -| standard library | 575 ns/op | 2 allocs/op | -| go-kit | 922 ns/op | 13 allocs/op | -| lion | 1413 ns/op | 10 allocs/op | -| logrus | 2291 ns/op | 27 allocs/op | -| apex/log | 3690 ns/op | 11 allocs/op | -| log15 | 5954 ns/op | 26 allocs/op | +| Package | Time | Time % to zap | Objects Allocated | +| :------ | :--: | :-----------: | :---------------: | +| :zap: zap | 118 ns/op | +0% | 0 allocs/op +| :zap: zap (sugared) | 191 ns/op | +62% | 2 allocs/op +| zerolog | 93 ns/op | -21% | 0 allocs/op +| go-kit | 280 ns/op | +137% | 11 allocs/op +| standard library | 499 ns/op | +323% | 2 allocs/op +| apex/log | 1990 ns/op | +1586% | 10 allocs/op +| logrus | 3129 ns/op | +2552% | 24 allocs/op +| log15 | 3887 ns/op | +3194% | 23 allocs/op ## Development Status: Stable @@ -124,13 +121,14 @@ Released under the [MIT License](LICENSE.txt). 1 In particular, keep in mind that we may be benchmarking against slightly older versions of other packages. Versions are -pinned in zap's [glide.lock][] file. [↩](#anchor-versions) +pinned in the [benchmarks/go.mod][] file. [↩](#anchor-versions) [doc-img]: https://godoc.org/go.uber.org/zap?status.svg [doc]: https://godoc.org/go.uber.org/zap -[ci-img]: https://travis-ci.org/uber-go/zap.svg?branch=master -[ci]: https://travis-ci.org/uber-go/zap +[ci-img]: https://travis-ci.com/uber-go/zap.svg?branch=master +[ci]: https://travis-ci.com/uber-go/zap [cov-img]: https://codecov.io/gh/uber-go/zap/branch/master/graph/badge.svg [cov]: https://codecov.io/gh/uber-go/zap [benchmarking suite]: https://github.com/uber-go/zap/tree/master/benchmarks -[glide.lock]: https://github.com/uber-go/zap/blob/master/glide.lock +[benchmarks/go.mod]: https://github.com/uber-go/zap/blob/master/benchmarks/go.mod + diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/buffer/buffer.go b/cluster-autoscaler/vendor/go.uber.org/zap/buffer/buffer.go index 7592e8c63f66..3f4b86e081f6 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/buffer/buffer.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/buffer/buffer.go @@ -23,7 +23,10 @@ // package's zero-allocation formatters. package buffer // import "go.uber.org/zap/buffer" -import "strconv" +import ( + "strconv" + "time" +) const _size = 1024 // by default, create 1 KiB buffers @@ -49,6 +52,11 @@ func (b *Buffer) AppendInt(i int64) { b.bs = strconv.AppendInt(b.bs, i, 10) } +// AppendTime appends the time formatted using the specified layout. +func (b *Buffer) AppendTime(t time.Time, layout string) { + b.bs = t.AppendFormat(b.bs, layout) +} + // AppendUint appends an unsigned integer to the underlying buffer (assuming // base 10). func (b *Buffer) AppendUint(i uint64) { diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/check_license.sh b/cluster-autoscaler/vendor/go.uber.org/zap/checklicense.sh similarity index 100% rename from cluster-autoscaler/vendor/go.uber.org/zap/check_license.sh rename to cluster-autoscaler/vendor/go.uber.org/zap/checklicense.sh diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/config.go b/cluster-autoscaler/vendor/go.uber.org/zap/config.go index 6fe17d9e0f56..55637fb0b4b1 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/config.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/config.go @@ -21,6 +21,7 @@ package zap import ( + "fmt" "sort" "time" @@ -31,10 +32,14 @@ import ( // global CPU and I/O load that logging puts on your process while attempting // to preserve a representative subset of your logs. // -// Values configured here are per-second. See zapcore.NewSampler for details. +// If specified, the Sampler will invoke the Hook after each decision. +// +// Values configured here are per-second. See zapcore.NewSamplerWithOptions for +// details. type SamplingConfig struct { - Initial int `json:"initial" yaml:"initial"` - Thereafter int `json:"thereafter" yaml:"thereafter"` + Initial int `json:"initial" yaml:"initial"` + Thereafter int `json:"thereafter" yaml:"thereafter"` + Hook func(zapcore.Entry, zapcore.SamplingDecision) `json:"-" yaml:"-"` } // Config offers a declarative way to construct a logger. It doesn't do @@ -96,6 +101,7 @@ func NewProductionEncoderConfig() zapcore.EncoderConfig { LevelKey: "level", NameKey: "logger", CallerKey: "caller", + FunctionKey: zapcore.OmitKey, MessageKey: "msg", StacktraceKey: "stacktrace", LineEnding: zapcore.DefaultLineEnding, @@ -135,6 +141,7 @@ func NewDevelopmentEncoderConfig() zapcore.EncoderConfig { LevelKey: "L", NameKey: "N", CallerKey: "C", + FunctionKey: zapcore.OmitKey, MessageKey: "M", StacktraceKey: "S", LineEnding: zapcore.DefaultLineEnding, @@ -174,6 +181,10 @@ func (cfg Config) Build(opts ...Option) (*Logger, error) { return nil, err } + if cfg.Level == (AtomicLevel{}) { + return nil, fmt.Errorf("missing Level") + } + log := New( zapcore.NewCore(enc, sink, cfg.Level), cfg.buildOptions(errSink)..., @@ -203,9 +214,19 @@ func (cfg Config) buildOptions(errSink zapcore.WriteSyncer) []Option { opts = append(opts, AddStacktrace(stackLevel)) } - if cfg.Sampling != nil { + if scfg := cfg.Sampling; scfg != nil { opts = append(opts, WrapCore(func(core zapcore.Core) zapcore.Core { - return zapcore.NewSampler(core, time.Second, int(cfg.Sampling.Initial), int(cfg.Sampling.Thereafter)) + var samplerOpts []zapcore.SamplerOption + if scfg.Hook != nil { + samplerOpts = append(samplerOpts, zapcore.SamplerHook(scfg.Hook)) + } + return zapcore.NewSamplerWithOptions( + core, + time.Second, + cfg.Sampling.Initial, + cfg.Sampling.Thereafter, + samplerOpts..., + ) })) } diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/encoder.go b/cluster-autoscaler/vendor/go.uber.org/zap/encoder.go index 2e9d3c341521..08ed83354360 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/encoder.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/encoder.go @@ -62,6 +62,10 @@ func RegisterEncoder(name string, constructor func(zapcore.EncoderConfig) (zapco } func newEncoder(name string, encoderConfig zapcore.EncoderConfig) (zapcore.Encoder, error) { + if encoderConfig.TimeKey != "" && encoderConfig.EncodeTime == nil { + return nil, fmt.Errorf("missing EncodeTime in EncoderConfig") + } + _encoderMutex.RLock() defer _encoderMutex.RUnlock() if name == "" { diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/field.go b/cluster-autoscaler/vendor/go.uber.org/zap/field.go index 5130e134771c..3c0d7d957870 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/field.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/field.go @@ -32,12 +32,23 @@ import ( // improves the navigability of this package's API documentation. type Field = zapcore.Field +var ( + _minTimeInt64 = time.Unix(0, math.MinInt64) + _maxTimeInt64 = time.Unix(0, math.MaxInt64) +) + // Skip constructs a no-op field, which is often useful when handling invalid // inputs in other Field constructors. func Skip() Field { return Field{Type: zapcore.SkipType} } +// nilField returns a field which will marshal explicitly as nil. See motivation +// in https://github.com/uber-go/zap/issues/753 . If we ever make breaking +// changes and add zapcore.NilType and zapcore.ObjectEncoder.AddNil, the +// implementation here should be changed to reflect that. +func nilField(key string) Field { return Reflect(key, nil) } + // Binary constructs a field that carries an opaque binary blob. // // Binary data is serialized in an encoding-appropriate format. For example, @@ -56,6 +67,15 @@ func Bool(key string, val bool) Field { return Field{Key: key, Type: zapcore.BoolType, Integer: ival} } +// Boolp constructs a field that carries a *bool. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Boolp(key string, val *bool) Field { + if val == nil { + return nilField(key) + } + return Bool(key, *val) +} + // ByteString constructs a field that carries UTF-8 encoded text as a []byte. // To log opaque binary blobs (which aren't necessarily valid UTF-8), use // Binary. @@ -70,6 +90,15 @@ func Complex128(key string, val complex128) Field { return Field{Key: key, Type: zapcore.Complex128Type, Interface: val} } +// Complex128p constructs a field that carries a *complex128. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Complex128p(key string, val *complex128) Field { + if val == nil { + return nilField(key) + } + return Complex128(key, *val) +} + // Complex64 constructs a field that carries a complex number. Unlike most // numeric fields, this costs an allocation (to convert the complex64 to // interface{}). @@ -77,6 +106,15 @@ func Complex64(key string, val complex64) Field { return Field{Key: key, Type: zapcore.Complex64Type, Interface: val} } +// Complex64p constructs a field that carries a *complex64. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Complex64p(key string, val *complex64) Field { + if val == nil { + return nilField(key) + } + return Complex64(key, *val) +} + // Float64 constructs a field that carries a float64. The way the // floating-point value is represented is encoder-dependent, so marshaling is // necessarily lazy. @@ -84,6 +122,15 @@ func Float64(key string, val float64) Field { return Field{Key: key, Type: zapcore.Float64Type, Integer: int64(math.Float64bits(val))} } +// Float64p constructs a field that carries a *float64. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Float64p(key string, val *float64) Field { + if val == nil { + return nilField(key) + } + return Float64(key, *val) +} + // Float32 constructs a field that carries a float32. The way the // floating-point value is represented is encoder-dependent, so marshaling is // necessarily lazy. @@ -91,66 +138,183 @@ func Float32(key string, val float32) Field { return Field{Key: key, Type: zapcore.Float32Type, Integer: int64(math.Float32bits(val))} } +// Float32p constructs a field that carries a *float32. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Float32p(key string, val *float32) Field { + if val == nil { + return nilField(key) + } + return Float32(key, *val) +} + // Int constructs a field with the given key and value. func Int(key string, val int) Field { return Int64(key, int64(val)) } +// Intp constructs a field that carries a *int. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Intp(key string, val *int) Field { + if val == nil { + return nilField(key) + } + return Int(key, *val) +} + // Int64 constructs a field with the given key and value. func Int64(key string, val int64) Field { return Field{Key: key, Type: zapcore.Int64Type, Integer: val} } +// Int64p constructs a field that carries a *int64. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Int64p(key string, val *int64) Field { + if val == nil { + return nilField(key) + } + return Int64(key, *val) +} + // Int32 constructs a field with the given key and value. func Int32(key string, val int32) Field { return Field{Key: key, Type: zapcore.Int32Type, Integer: int64(val)} } +// Int32p constructs a field that carries a *int32. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Int32p(key string, val *int32) Field { + if val == nil { + return nilField(key) + } + return Int32(key, *val) +} + // Int16 constructs a field with the given key and value. func Int16(key string, val int16) Field { return Field{Key: key, Type: zapcore.Int16Type, Integer: int64(val)} } +// Int16p constructs a field that carries a *int16. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Int16p(key string, val *int16) Field { + if val == nil { + return nilField(key) + } + return Int16(key, *val) +} + // Int8 constructs a field with the given key and value. func Int8(key string, val int8) Field { return Field{Key: key, Type: zapcore.Int8Type, Integer: int64(val)} } +// Int8p constructs a field that carries a *int8. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Int8p(key string, val *int8) Field { + if val == nil { + return nilField(key) + } + return Int8(key, *val) +} + // String constructs a field with the given key and value. func String(key string, val string) Field { return Field{Key: key, Type: zapcore.StringType, String: val} } +// Stringp constructs a field that carries a *string. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Stringp(key string, val *string) Field { + if val == nil { + return nilField(key) + } + return String(key, *val) +} + // Uint constructs a field with the given key and value. func Uint(key string, val uint) Field { return Uint64(key, uint64(val)) } +// Uintp constructs a field that carries a *uint. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Uintp(key string, val *uint) Field { + if val == nil { + return nilField(key) + } + return Uint(key, *val) +} + // Uint64 constructs a field with the given key and value. func Uint64(key string, val uint64) Field { return Field{Key: key, Type: zapcore.Uint64Type, Integer: int64(val)} } +// Uint64p constructs a field that carries a *uint64. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Uint64p(key string, val *uint64) Field { + if val == nil { + return nilField(key) + } + return Uint64(key, *val) +} + // Uint32 constructs a field with the given key and value. func Uint32(key string, val uint32) Field { return Field{Key: key, Type: zapcore.Uint32Type, Integer: int64(val)} } +// Uint32p constructs a field that carries a *uint32. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Uint32p(key string, val *uint32) Field { + if val == nil { + return nilField(key) + } + return Uint32(key, *val) +} + // Uint16 constructs a field with the given key and value. func Uint16(key string, val uint16) Field { return Field{Key: key, Type: zapcore.Uint16Type, Integer: int64(val)} } +// Uint16p constructs a field that carries a *uint16. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Uint16p(key string, val *uint16) Field { + if val == nil { + return nilField(key) + } + return Uint16(key, *val) +} + // Uint8 constructs a field with the given key and value. func Uint8(key string, val uint8) Field { return Field{Key: key, Type: zapcore.Uint8Type, Integer: int64(val)} } +// Uint8p constructs a field that carries a *uint8. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Uint8p(key string, val *uint8) Field { + if val == nil { + return nilField(key) + } + return Uint8(key, *val) +} + // Uintptr constructs a field with the given key and value. func Uintptr(key string, val uintptr) Field { return Field{Key: key, Type: zapcore.UintptrType, Integer: int64(val)} } +// Uintptrp constructs a field that carries a *uintptr. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Uintptrp(key string, val *uintptr) Field { + if val == nil { + return nilField(key) + } + return Uintptr(key, *val) +} + // Reflect constructs a field with the given key and an arbitrary object. It uses // an encoding-appropriate, reflection-based function to lazily serialize nearly // any object into the logging context, but it's relatively slow and @@ -180,19 +344,37 @@ func Stringer(key string, val fmt.Stringer) Field { // Time constructs a Field with the given key and value. The encoder // controls how the time is serialized. func Time(key string, val time.Time) Field { + if val.Before(_minTimeInt64) || val.After(_maxTimeInt64) { + return Field{Key: key, Type: zapcore.TimeFullType, Interface: val} + } return Field{Key: key, Type: zapcore.TimeType, Integer: val.UnixNano(), Interface: val.Location()} } +// Timep constructs a field that carries a *time.Time. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Timep(key string, val *time.Time) Field { + if val == nil { + return nilField(key) + } + return Time(key, *val) +} + // Stack constructs a field that stores a stacktrace of the current goroutine // under provided key. Keep in mind that taking a stacktrace is eager and // expensive (relatively speaking); this function both makes an allocation and // takes about two microseconds. func Stack(key string) Field { + return StackSkip(key, 1) // skip Stack +} + +// StackSkip constructs a field similarly to Stack, but also skips the given +// number of frames from the top of the stacktrace. +func StackSkip(key string, skip int) Field { // Returning the stacktrace as a string costs an allocation, but saves us // from expanding the zapcore.Field union struct to include a byte slice. Since // taking a stacktrace is already so expensive (~10us), the extra allocation // is okay. - return String(key, takeStacktrace()) + return String(key, takeStacktrace(skip+1)) // skip StackSkip } // Duration constructs a field with the given key and value. The encoder @@ -201,6 +383,15 @@ func Duration(key string, val time.Duration) Field { return Field{Key: key, Type: zapcore.DurationType, Integer: int64(val)} } +// Durationp constructs a field that carries a *time.Duration. The returned Field will safely +// and explicitly represent `nil` when appropriate. +func Durationp(key string, val *time.Duration) Field { + if val == nil { + return nilField(key) + } + return Duration(key, *val) +} + // Object constructs a field with the given key and ObjectMarshaler. It // provides a flexible, but still type-safe and efficient, way to add map- or // struct-like user-defined types to the logging context. The struct's @@ -224,78 +415,116 @@ func Any(key string, value interface{}) Field { return Array(key, val) case bool: return Bool(key, val) + case *bool: + return Boolp(key, val) case []bool: return Bools(key, val) case complex128: return Complex128(key, val) + case *complex128: + return Complex128p(key, val) case []complex128: return Complex128s(key, val) case complex64: return Complex64(key, val) + case *complex64: + return Complex64p(key, val) case []complex64: return Complex64s(key, val) case float64: return Float64(key, val) + case *float64: + return Float64p(key, val) case []float64: return Float64s(key, val) case float32: return Float32(key, val) + case *float32: + return Float32p(key, val) case []float32: return Float32s(key, val) case int: return Int(key, val) + case *int: + return Intp(key, val) case []int: return Ints(key, val) case int64: return Int64(key, val) + case *int64: + return Int64p(key, val) case []int64: return Int64s(key, val) case int32: return Int32(key, val) + case *int32: + return Int32p(key, val) case []int32: return Int32s(key, val) case int16: return Int16(key, val) + case *int16: + return Int16p(key, val) case []int16: return Int16s(key, val) case int8: return Int8(key, val) + case *int8: + return Int8p(key, val) case []int8: return Int8s(key, val) case string: return String(key, val) + case *string: + return Stringp(key, val) case []string: return Strings(key, val) case uint: return Uint(key, val) + case *uint: + return Uintp(key, val) case []uint: return Uints(key, val) case uint64: return Uint64(key, val) + case *uint64: + return Uint64p(key, val) case []uint64: return Uint64s(key, val) case uint32: return Uint32(key, val) + case *uint32: + return Uint32p(key, val) case []uint32: return Uint32s(key, val) case uint16: return Uint16(key, val) + case *uint16: + return Uint16p(key, val) case []uint16: return Uint16s(key, val) case uint8: return Uint8(key, val) + case *uint8: + return Uint8p(key, val) case []byte: return Binary(key, val) case uintptr: return Uintptr(key, val) + case *uintptr: + return Uintptrp(key, val) case []uintptr: return Uintptrs(key, val) case time.Time: return Time(key, val) + case *time.Time: + return Timep(key, val) case []time.Time: return Times(key, val) case time.Duration: return Duration(key, val) + case *time.Duration: + return Durationp(key, val) case []time.Duration: return Durations(key, val) case error: diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/glide.lock b/cluster-autoscaler/vendor/go.uber.org/zap/glide.lock deleted file mode 100644 index 881b462c0ea0..000000000000 --- a/cluster-autoscaler/vendor/go.uber.org/zap/glide.lock +++ /dev/null @@ -1,76 +0,0 @@ -hash: f073ba522c06c88ea3075bde32a8aaf0969a840a66cab6318a0897d141ffee92 -updated: 2017-07-22T18:06:49.598185334-07:00 -imports: -- name: go.uber.org/atomic - version: 4e336646b2ef9fc6e47be8e21594178f98e5ebcf -- name: go.uber.org/multierr - version: 3c4937480c32f4c13a875a1829af76c98ca3d40a -testImports: -- name: github.com/apex/log - version: d9b960447bfa720077b2da653cc79e533455b499 - subpackages: - - handlers/json -- name: github.com/axw/gocov - version: 3a69a0d2a4ef1f263e2d92b041a69593d6964fe8 - subpackages: - - gocov -- name: github.com/davecgh/go-spew - version: 04cdfd42973bb9c8589fd6a731800cf222fde1a9 - subpackages: - - spew -- name: github.com/fatih/color - version: 62e9147c64a1ed519147b62a56a14e83e2be02c1 -- name: github.com/go-kit/kit - version: e10f5bf035be9af21fd5b2fb4469d5716c6ab07d - subpackages: - - log -- name: github.com/go-logfmt/logfmt - version: 390ab7935ee28ec6b286364bba9b4dd6410cb3d5 -- name: github.com/go-stack/stack - version: 54be5f394ed2c3e19dac9134a40a95ba5a017f7b -- name: github.com/golang/lint - version: c5fb716d6688a859aae56d26d3e6070808df29f7 - subpackages: - - golint -- name: github.com/kr/logfmt - version: b84e30acd515aadc4b783ad4ff83aff3299bdfe0 -- name: github.com/mattn/go-colorable - version: 3fa8c76f9daed4067e4a806fb7e4dc86455c6d6a -- name: github.com/mattn/go-isatty - version: fc9e8d8ef48496124e79ae0df75490096eccf6fe -- name: github.com/mattn/goveralls - version: 6efce81852ad1b7567c17ad71b03aeccc9dd9ae0 -- name: github.com/pborman/uuid - version: e790cca94e6cc75c7064b1332e63811d4aae1a53 -- name: github.com/pkg/errors - version: 645ef00459ed84a119197bfb8d8205042c6df63d -- name: github.com/pmezard/go-difflib - version: d8ed2627bdf02c080bf22230dbb337003b7aba2d - subpackages: - - difflib -- name: github.com/rs/zerolog - version: eed4c2b94d945e0b2456ad6aa518a443986b5f22 -- name: github.com/satori/go.uuid - version: 5bf94b69c6b68ee1b541973bb8e1144db23a194b -- name: github.com/sirupsen/logrus - version: 7dd06bf38e1e13df288d471a57d5adbac106be9e -- name: github.com/stretchr/testify - version: f6abca593680b2315d2075e0f5e2a9751e3f431a - subpackages: - - assert - - require -- name: go.pedge.io/lion - version: 87958e8713f1fa138d993087133b97e976642159 -- name: golang.org/x/sys - version: c4489faa6e5ab84c0ef40d6ee878f7a030281f0f - subpackages: - - unix -- name: golang.org/x/tools - version: 496819729719f9d07692195e0a94d6edd2251389 - subpackages: - - cover -- name: gopkg.in/inconshreveable/log15.v2 - version: b105bd37f74e5d9dc7b6ad7806715c7a2b83fd3f - subpackages: - - stack - - term diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/glide.yaml b/cluster-autoscaler/vendor/go.uber.org/zap/glide.yaml index 94412594ca43..8e1d05e9abdf 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/glide.yaml +++ b/cluster-autoscaler/vendor/go.uber.org/zap/glide.yaml @@ -22,12 +22,11 @@ testImport: - package: github.com/mattn/goveralls - package: github.com/pborman/uuid - package: github.com/pkg/errors -- package: go.pedge.io/lion - package: github.com/rs/zerolog - package: golang.org/x/tools subpackages: - cover -- package: github.com/golang/lint +- package: golang.org/x/lint subpackages: - golint - package: github.com/axw/gocov diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/go.mod b/cluster-autoscaler/vendor/go.uber.org/zap/go.mod new file mode 100644 index 000000000000..6ef4db70edd5 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/zap/go.mod @@ -0,0 +1,13 @@ +module go.uber.org/zap + +go 1.13 + +require ( + github.com/pkg/errors v0.8.1 + github.com/stretchr/testify v1.4.0 + go.uber.org/atomic v1.6.0 + go.uber.org/multierr v1.5.0 + golang.org/x/lint v0.0.0-20190930215403-16217165b5de + gopkg.in/yaml.v2 v2.2.2 + honnef.co/go/tools v0.0.1-2019.2.3 +) diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/go.sum b/cluster-autoscaler/vendor/go.uber.org/zap/go.sum new file mode 100644 index 000000000000..99cdb93ea0a2 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/zap/go.sum @@ -0,0 +1,56 @@ +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +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/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.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/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c h1:IGkKhmfzcztjm6gYkykvu/NiS8kaqbCWAEWWAyf8J5U= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/logger.go b/cluster-autoscaler/vendor/go.uber.org/zap/logger.go index dc8f6e3a4bd6..ea484aed1021 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/logger.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/logger.go @@ -49,6 +49,7 @@ type Logger struct { addStack zapcore.LevelEnabler callerSkip int + onFatal zapcore.CheckWriteAction // default is WriteThenFatal } // New constructs a new Logger from the provided zapcore.Core and Options. If @@ -258,6 +259,12 @@ func (log *Logger) check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry { // (e.g., Check, Info, Fatal). const callerSkipOffset = 2 + // Check the level first to reduce the cost of disabled log calls. + // Since Panic and higher may exit, we skip the optimization for those levels. + if lvl < zapcore.DPanicLevel && !log.core.Enabled(lvl) { + return nil + } + // Create basic checked entry thru the core; this will be non-nil if the // log message will actually be written somewhere. ent := zapcore.Entry{ @@ -274,7 +281,13 @@ func (log *Logger) check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry { case zapcore.PanicLevel: ce = ce.Should(ent, zapcore.WriteThenPanic) case zapcore.FatalLevel: - ce = ce.Should(ent, zapcore.WriteThenFatal) + onFatal := log.onFatal + // Noop is the default value for CheckWriteAction, and it leads to + // continued execution after a Fatal which is unexpected. + if onFatal == zapcore.WriteThenNoop { + onFatal = zapcore.WriteThenFatal + } + ce = ce.Should(ent, onFatal) case zapcore.DPanicLevel: if log.development { ce = ce.Should(ent, zapcore.WriteThenPanic) @@ -291,15 +304,41 @@ func (log *Logger) check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry { // Thread the error output through to the CheckedEntry. ce.ErrorOutput = log.errorOutput if log.addCaller { - ce.Entry.Caller = zapcore.NewEntryCaller(runtime.Caller(log.callerSkip + callerSkipOffset)) - if !ce.Entry.Caller.Defined { + frame, defined := getCallerFrame(log.callerSkip + callerSkipOffset) + if !defined { fmt.Fprintf(log.errorOutput, "%v Logger.check error: failed to get caller\n", time.Now().UTC()) log.errorOutput.Sync() } + + ce.Entry.Caller = zapcore.EntryCaller{ + Defined: defined, + PC: frame.PC, + File: frame.File, + Line: frame.Line, + Function: frame.Function, + } } if log.addStack.Enabled(ce.Entry.Level) { - ce.Entry.Stack = Stack("").String + ce.Entry.Stack = StackSkip("", log.callerSkip+callerSkipOffset).String } return ce } + +// getCallerFrame gets caller frame. The argument skip is the number of stack +// frames to ascend, with 0 identifying the caller of getCallerFrame. The +// boolean ok is false if it was not possible to recover the information. +// +// Note: This implementation is similar to runtime.Caller, but it returns the whole frame. +func getCallerFrame(skip int) (frame runtime.Frame, ok bool) { + const skipOffset = 2 // skip getCallerFrame and Callers + + pc := make([]uintptr, 1) + numFrames := runtime.Callers(skip+skipOffset, pc[:]) + if numFrames < 1 { + return + } + + frame, _ = runtime.CallersFrames(pc).Next() + return frame, frame.PC != 0 +} diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/options.go b/cluster-autoscaler/vendor/go.uber.org/zap/options.go index 7a6b0fca1b88..0135c20923f0 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/options.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/options.go @@ -20,7 +20,11 @@ package zap -import "go.uber.org/zap/zapcore" +import ( + "fmt" + + "go.uber.org/zap/zapcore" +) // An Option configures a Logger. type Option interface { @@ -82,11 +86,18 @@ func Development() Option { }) } -// AddCaller configures the Logger to annotate each message with the filename -// and line number of zap's caller. +// AddCaller configures the Logger to annotate each message with the filename, +// line number, and function name of zap's caller. See also WithCaller. func AddCaller() Option { + return WithCaller(true) +} + +// WithCaller configures the Logger to annotate each message with the filename, +// line number, and function name of zap's caller, or not, depending on the +// value of enabled. This is a generalized form of AddCaller. +func WithCaller(enabled bool) Option { return optionFunc(func(log *Logger) { - log.addCaller = true + log.addCaller = enabled }) } @@ -107,3 +118,23 @@ func AddStacktrace(lvl zapcore.LevelEnabler) Option { log.addStack = lvl }) } + +// IncreaseLevel increase the level of the logger. It has no effect if +// the passed in level tries to decrease the level of the logger. +func IncreaseLevel(lvl zapcore.LevelEnabler) Option { + return optionFunc(func(log *Logger) { + core, err := zapcore.NewIncreaseLevelCore(log.core, lvl) + if err != nil { + fmt.Fprintf(log.errorOutput, "failed to IncreaseLevel: %v\n", err) + } else { + log.core = core + } + }) +} + +// OnFatal sets the action to take on fatal logs. +func OnFatal(action zapcore.CheckWriteAction) Option { + return optionFunc(func(log *Logger) { + log.onFatal = action + }) +} diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/sink.go b/cluster-autoscaler/vendor/go.uber.org/zap/sink.go index ff0becfe5d07..df46fa87a70a 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/sink.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/sink.go @@ -136,7 +136,7 @@ func newFileSink(u *url.URL) (Sink, error) { case "stderr": return nopCloserSink{os.Stderr}, nil } - return os.OpenFile(u.Path, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644) + return os.OpenFile(u.Path, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666) } func normalizeScheme(s string) (string, error) { diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/stacktrace.go b/cluster-autoscaler/vendor/go.uber.org/zap/stacktrace.go index 100fac216852..0cf8c1ddffa1 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/stacktrace.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/stacktrace.go @@ -22,28 +22,20 @@ package zap import ( "runtime" - "strings" "sync" "go.uber.org/zap/internal/bufferpool" ) -const _zapPackage = "go.uber.org/zap" - var ( _stacktracePool = sync.Pool{ New: func() interface{} { return newProgramCounters(64) }, } - - // We add "." and "/" suffixes to the package name to ensure we only match - // the exact package and not any package with the same prefix. - _zapStacktracePrefixes = addPrefix(_zapPackage, ".", "/") - _zapStacktraceVendorContains = addPrefix("/vendor/", _zapStacktracePrefixes...) ) -func takeStacktrace() string { +func takeStacktrace(skip int) string { buffer := bufferpool.Get() defer buffer.Free() programCounters := _stacktracePool.Get().(*programCounters) @@ -51,9 +43,9 @@ func takeStacktrace() string { var numFrames int for { - // Skip the call to runtime.Counters and takeStacktrace so that the + // Skip the call to runtime.Callers and takeStacktrace so that the // program counters start at the caller of takeStacktrace. - numFrames = runtime.Callers(2, programCounters.pcs) + numFrames = runtime.Callers(skip+2, programCounters.pcs) if numFrames < len(programCounters.pcs) { break } @@ -63,19 +55,12 @@ func takeStacktrace() string { } i := 0 - skipZapFrames := true // skip all consecutive zap frames at the beginning. frames := runtime.CallersFrames(programCounters.pcs[:numFrames]) // Note: On the last iteration, frames.Next() returns false, with a valid // frame, but we ignore this frame. The last frame is a a runtime frame which // adds noise, since it's only either runtime.main or runtime.goexit. for frame, more := frames.Next(); more; frame, more = frames.Next() { - if skipZapFrames && isZapFrame(frame.Function) { - continue - } else { - skipZapFrames = false - } - if i != 0 { buffer.AppendByte('\n') } @@ -91,24 +76,6 @@ func takeStacktrace() string { return buffer.String() } -func isZapFrame(function string) bool { - for _, prefix := range _zapStacktracePrefixes { - if strings.HasPrefix(function, prefix) { - return true - } - } - - // We can't use a prefix match here since the location of the vendor - // directory affects the prefix. Instead we do a contains match. - for _, contains := range _zapStacktraceVendorContains { - if strings.Contains(function, contains) { - return true - } - } - - return false -} - type programCounters struct { pcs []uintptr } @@ -116,11 +83,3 @@ type programCounters struct { func newProgramCounters(size int) *programCounters { return &programCounters{make([]uintptr, size)} } - -func addPrefix(prefix string, ss ...string) []string { - withPrefix := make([]string, len(ss)) - for i, s := range ss { - withPrefix[i] = prefix + s - } - return withPrefix -} diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/console_encoder.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/console_encoder.go index b7875966f49c..3b68f8c0c51c 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/console_encoder.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/console_encoder.go @@ -56,6 +56,10 @@ type consoleEncoder struct { // encoder configuration, it will omit any element whose key is set to the empty // string. func NewConsoleEncoder(cfg EncoderConfig) Encoder { + if len(cfg.ConsoleSeparator) == 0 { + // Use a default delimiter of '\t' for backwards compatibility + cfg.ConsoleSeparator = "\t" + } return consoleEncoder{newJSONEncoder(cfg, true)} } @@ -89,12 +93,17 @@ func (c consoleEncoder) EncodeEntry(ent Entry, fields []Field) (*buffer.Buffer, nameEncoder(ent.LoggerName, arr) } - if ent.Caller.Defined && c.CallerKey != "" && c.EncodeCaller != nil { - c.EncodeCaller(ent.Caller, arr) + if ent.Caller.Defined { + if c.CallerKey != "" && c.EncodeCaller != nil { + c.EncodeCaller(ent.Caller, arr) + } + if c.FunctionKey != "" { + arr.AppendString(ent.Caller.Function) + } } for i := range arr.elems { if i > 0 { - line.AppendByte('\t') + line.AppendString(c.ConsoleSeparator) } fmt.Fprint(line, arr.elems[i]) } @@ -102,7 +111,7 @@ func (c consoleEncoder) EncodeEntry(ent Entry, fields []Field) (*buffer.Buffer, // Add the message itself. if c.MessageKey != "" { - c.addTabIfNecessary(line) + c.addSeparatorIfNecessary(line) line.AppendString(ent.Message) } @@ -126,7 +135,12 @@ func (c consoleEncoder) EncodeEntry(ent Entry, fields []Field) (*buffer.Buffer, func (c consoleEncoder) writeContext(line *buffer.Buffer, extra []Field) { context := c.jsonEncoder.Clone().(*jsonEncoder) - defer context.buf.Free() + defer func() { + // putJSONEncoder assumes the buffer is still used, but we write out the buffer so + // we can free it. + context.buf.Free() + putJSONEncoder(context) + }() addFields(context, extra) context.closeOpenNamespaces() @@ -134,14 +148,14 @@ func (c consoleEncoder) writeContext(line *buffer.Buffer, extra []Field) { return } - c.addTabIfNecessary(line) + c.addSeparatorIfNecessary(line) line.AppendByte('{') line.Write(context.buf.Bytes()) line.AppendByte('}') } -func (c consoleEncoder) addTabIfNecessary(line *buffer.Buffer) { +func (c consoleEncoder) addSeparatorIfNecessary(line *buffer.Buffer) { if line.Len() > 0 { - line.AppendByte('\t') + line.AppendString(c.ConsoleSeparator) } } diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/encoder.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/encoder.go index f0509522b5ff..6601ca166c64 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/encoder.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/encoder.go @@ -21,6 +21,7 @@ package zapcore import ( + "encoding/json" "time" "go.uber.org/zap/buffer" @@ -31,6 +32,9 @@ import ( // behavior. const DefaultLineEnding = "\n" +// OmitKey defines the key to use when callers want to remove a key from log output. +const OmitKey = "" + // A LevelEncoder serializes a Level to a primitive type. type LevelEncoder func(Level, PrimitiveArrayEncoder) @@ -109,17 +113,66 @@ func EpochNanosTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { enc.AppendInt64(t.UnixNano()) } +func encodeTimeLayout(t time.Time, layout string, enc PrimitiveArrayEncoder) { + type appendTimeEncoder interface { + AppendTimeLayout(time.Time, string) + } + + if enc, ok := enc.(appendTimeEncoder); ok { + enc.AppendTimeLayout(t, layout) + return + } + + enc.AppendString(t.Format(layout)) +} + // ISO8601TimeEncoder serializes a time.Time to an ISO8601-formatted string // with millisecond precision. +// +// If enc supports AppendTimeLayout(t time.Time,layout string), it's used +// instead of appending a pre-formatted string value. func ISO8601TimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { - enc.AppendString(t.Format("2006-01-02T15:04:05.000Z0700")) + encodeTimeLayout(t, "2006-01-02T15:04:05.000Z0700", enc) +} + +// RFC3339TimeEncoder serializes a time.Time to an RFC3339-formatted string. +// +// If enc supports AppendTimeLayout(t time.Time,layout string), it's used +// instead of appending a pre-formatted string value. +func RFC3339TimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { + encodeTimeLayout(t, time.RFC3339, enc) +} + +// RFC3339NanoTimeEncoder serializes a time.Time to an RFC3339-formatted string +// with nanosecond precision. +// +// If enc supports AppendTimeLayout(t time.Time,layout string), it's used +// instead of appending a pre-formatted string value. +func RFC3339NanoTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { + encodeTimeLayout(t, time.RFC3339Nano, enc) } -// UnmarshalText unmarshals text to a TimeEncoder. "iso8601" and "ISO8601" are -// unmarshaled to ISO8601TimeEncoder, "millis" is unmarshaled to -// EpochMillisTimeEncoder, and anything else is unmarshaled to EpochTimeEncoder. +// TimeEncoderOfLayout returns TimeEncoder which serializes a time.Time using +// given layout. +func TimeEncoderOfLayout(layout string) TimeEncoder { + return func(t time.Time, enc PrimitiveArrayEncoder) { + encodeTimeLayout(t, layout, enc) + } +} + +// UnmarshalText unmarshals text to a TimeEncoder. +// "rfc3339nano" and "RFC3339Nano" are unmarshaled to RFC3339NanoTimeEncoder. +// "rfc3339" and "RFC3339" are unmarshaled to RFC3339TimeEncoder. +// "iso8601" and "ISO8601" are unmarshaled to ISO8601TimeEncoder. +// "millis" is unmarshaled to EpochMillisTimeEncoder. +// "nanos" is unmarshaled to EpochNanosEncoder. +// Anything else is unmarshaled to EpochTimeEncoder. func (e *TimeEncoder) UnmarshalText(text []byte) error { switch string(text) { + case "rfc3339nano", "RFC3339Nano": + *e = RFC3339NanoTimeEncoder + case "rfc3339", "RFC3339": + *e = RFC3339TimeEncoder case "iso8601", "ISO8601": *e = ISO8601TimeEncoder case "millis": @@ -132,6 +185,35 @@ func (e *TimeEncoder) UnmarshalText(text []byte) error { return nil } +// UnmarshalYAML unmarshals YAML to a TimeEncoder. +// If value is an object with a "layout" field, it will be unmarshaled to TimeEncoder with given layout. +// timeEncoder: +// layout: 06/01/02 03:04pm +// If value is string, it uses UnmarshalText. +// timeEncoder: iso8601 +func (e *TimeEncoder) UnmarshalYAML(unmarshal func(interface{}) error) error { + var o struct { + Layout string `json:"layout" yaml:"layout"` + } + if err := unmarshal(&o); err == nil { + *e = TimeEncoderOfLayout(o.Layout) + return nil + } + + var s string + if err := unmarshal(&s); err != nil { + return err + } + return e.UnmarshalText([]byte(s)) +} + +// UnmarshalJSON unmarshals JSON to a TimeEncoder as same way UnmarshalYAML does. +func (e *TimeEncoder) UnmarshalJSON(data []byte) error { + return e.UnmarshalYAML(func(v interface{}) error { + return json.Unmarshal(data, v) + }) +} + // A DurationEncoder serializes a time.Duration to a primitive type. type DurationEncoder func(time.Duration, PrimitiveArrayEncoder) @@ -146,6 +228,12 @@ func NanosDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { enc.AppendInt64(int64(d)) } +// MillisDurationEncoder serializes a time.Duration to an integer number of +// milliseconds elapsed. +func MillisDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { + enc.AppendInt64(d.Nanoseconds() / 1e6) +} + // StringDurationEncoder serializes a time.Duration using its built-in String // method. func StringDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { @@ -161,6 +249,8 @@ func (e *DurationEncoder) UnmarshalText(text []byte) error { *e = StringDurationEncoder case "nanos": *e = NanosDurationEncoder + case "ms": + *e = MillisDurationEncoder default: *e = SecondsDurationEncoder } @@ -227,6 +317,7 @@ type EncoderConfig struct { TimeKey string `json:"timeKey" yaml:"timeKey"` NameKey string `json:"nameKey" yaml:"nameKey"` CallerKey string `json:"callerKey" yaml:"callerKey"` + FunctionKey string `json:"functionKey" yaml:"functionKey"` StacktraceKey string `json:"stacktraceKey" yaml:"stacktraceKey"` LineEnding string `json:"lineEnding" yaml:"lineEnding"` // Configure the primitive representations of common complex types. For @@ -239,6 +330,9 @@ type EncoderConfig struct { // Unlike the other primitive type encoders, EncodeName is optional. The // zero value falls back to FullNameEncoder. EncodeName NameEncoder `json:"nameEncoder" yaml:"nameEncoder"` + // Configures the field separator used by the console encoder. Defaults + // to tab. + ConsoleSeparator string `json:"consoleSeparator" yaml:"consoleSeparator"` } // ObjectEncoder is a strongly-typed, encoding-agnostic interface for adding a @@ -272,8 +366,8 @@ type ObjectEncoder interface { AddUint8(key string, value uint8) AddUintptr(key string, value uintptr) - // AddReflected uses reflection to serialize arbitrary objects, so it's slow - // and allocation-heavy. + // AddReflected uses reflection to serialize arbitrary objects, so it can be + // slow and allocation-heavy. AddReflected(key string, value interface{}) error // OpenNamespace opens an isolated namespace where all subsequent fields will // be added. Applications can use namespaces to prevent key collisions when @@ -343,6 +437,7 @@ type Encoder interface { Clone() Encoder // EncodeEntry encodes an entry and fields, along with any accumulated - // context, into a byte buffer and returns it. + // context, into a byte buffer and returns it. Any fields that are empty, + // including fields on the `Entry` type, should be omitted. EncodeEntry(Entry, []Field) (*buffer.Buffer, error) } diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/entry.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/entry.go index 7d9893f3313e..4aa8b4f90bd0 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/entry.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/entry.go @@ -22,6 +22,7 @@ package zapcore import ( "fmt" + "runtime" "strings" "sync" "time" @@ -70,10 +71,11 @@ func NewEntryCaller(pc uintptr, file string, line int, ok bool) EntryCaller { // EntryCaller represents the caller of a logging function. type EntryCaller struct { - Defined bool - PC uintptr - File string - Line int + Defined bool + PC uintptr + File string + Line int + Function string } // String returns the full path and line number of the caller. @@ -136,7 +138,8 @@ func (ec EntryCaller) TrimmedPath() string { // An Entry represents a complete log message. The entry's structured context // is already serialized, but the log level, time, message, and call site -// information are available for inspection and modification. +// information are available for inspection and modification. Any fields left +// empty will be omitted when encoding. // // Entries are pooled, so any functions that accept them MUST be careful not to // retain references to them. @@ -157,6 +160,8 @@ const ( // WriteThenNoop indicates that nothing special needs to be done. It's the // default behavior. WriteThenNoop CheckWriteAction = iota + // WriteThenGoexit runs runtime.Goexit after Write. + WriteThenGoexit // WriteThenPanic causes a panic after Write. WriteThenPanic // WriteThenFatal causes a fatal os.Exit after Write. @@ -229,6 +234,8 @@ func (ce *CheckedEntry) Write(fields ...Field) { panic(msg) case WriteThenFatal: exit.Exit() + case WriteThenGoexit: + runtime.Goexit() } } diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/error.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/error.go index a67c7bacc985..9ba2272c3f76 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/error.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/error.go @@ -66,11 +66,6 @@ type errorGroup interface { Errors() []error } -type causer interface { - // Provides access to the error that caused this error. - Cause() error -} - // Note that errArry and errArrayElem are very similar to the version // implemented in the top-level error.go file. We can't re-use this because // that would require exporting errArray as part of the zapcore API. diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/field.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/field.go index ae772e4a1707..7e255d63e0dd 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/field.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/field.go @@ -65,8 +65,11 @@ const ( Int8Type // StringType indicates that the field carries a string. StringType - // TimeType indicates that the field carries a time.Time. + // TimeType indicates that the field carries a time.Time that is + // representable by a UnixNano() stored as an int64. TimeType + // TimeFullType indicates that the field carries a time.Time stored as-is. + TimeFullType // Uint64Type indicates that the field carries a uint64. Uint64Type // Uint32Type indicates that the field carries a uint32. @@ -145,6 +148,8 @@ func (f Field) AddTo(enc ObjectEncoder) { // Fall back to UTC if location is nil. enc.AddTime(f.Key, time.Unix(0, f.Integer)) } + case TimeFullType: + enc.AddTime(f.Key, f.Interface.(time.Time)) case Uint64Type: enc.AddUint64(f.Key, uint64(f.Integer)) case Uint32Type: @@ -200,13 +205,23 @@ func addFields(enc ObjectEncoder, fields []Field) { } } -func encodeStringer(key string, stringer interface{}, enc ObjectEncoder) (err error) { +func encodeStringer(key string, stringer interface{}, enc ObjectEncoder) (retErr error) { + // Try to capture panics (from nil references or otherwise) when calling + // the String() method, similar to https://golang.org/src/fmt/print.go#L540 defer func() { - if v := recover(); v != nil { - err = fmt.Errorf("PANIC=%v", v) + if err := recover(); err != nil { + // If it's a nil pointer, just say "". The likeliest causes are a + // Stringer that fails to guard against nil or a nil pointer for a + // value receiver, and in either case, "" is a nice result. + if v := reflect.ValueOf(stringer); v.Kind() == reflect.Ptr && v.IsNil() { + enc.AddString(key, "") + return + } + + retErr = fmt.Errorf("PANIC=%v", err) } }() enc.AddString(key, stringer.(fmt.Stringer).String()) - return + return nil } diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/increase_level.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/increase_level.go new file mode 100644 index 000000000000..5a1749261ab2 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/increase_level.go @@ -0,0 +1,66 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package zapcore + +import "fmt" + +type levelFilterCore struct { + core Core + level LevelEnabler +} + +// NewIncreaseLevelCore creates a core that can be used to increase the level of +// an existing Core. It cannot be used to decrease the logging level, as it acts +// as a filter before calling the underlying core. If level decreases the log level, +// an error is returned. +func NewIncreaseLevelCore(core Core, level LevelEnabler) (Core, error) { + for l := _maxLevel; l >= _minLevel; l-- { + if !core.Enabled(l) && level.Enabled(l) { + return nil, fmt.Errorf("invalid increase level, as level %q is allowed by increased level, but not by existing core", l) + } + } + + return &levelFilterCore{core, level}, nil +} + +func (c *levelFilterCore) Enabled(lvl Level) bool { + return c.level.Enabled(lvl) +} + +func (c *levelFilterCore) With(fields []Field) Core { + return &levelFilterCore{c.core.With(fields), c.level} +} + +func (c *levelFilterCore) Check(ent Entry, ce *CheckedEntry) *CheckedEntry { + if !c.Enabled(ent.Level) { + return ce + } + + return c.core.Check(ent, ce) +} + +func (c *levelFilterCore) Write(ent Entry, fields []Field) error { + return c.core.Write(ent, fields) +} + +func (c *levelFilterCore) Sync() error { + return c.core.Sync() +} diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/json_encoder.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/json_encoder.go index 9aec4eada31c..5cf7d917e92c 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/json_encoder.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/json_encoder.go @@ -145,15 +145,29 @@ func (enc *jsonEncoder) resetReflectBuf() { } } -func (enc *jsonEncoder) AddReflected(key string, obj interface{}) error { +var nullLiteralBytes = []byte("null") + +// Only invoke the standard JSON encoder if there is actually something to +// encode; otherwise write JSON null literal directly. +func (enc *jsonEncoder) encodeReflected(obj interface{}) ([]byte, error) { + if obj == nil { + return nullLiteralBytes, nil + } enc.resetReflectBuf() - err := enc.reflectEnc.Encode(obj) + if err := enc.reflectEnc.Encode(obj); err != nil { + return nil, err + } + enc.reflectBuf.TrimNewline() + return enc.reflectBuf.Bytes(), nil +} + +func (enc *jsonEncoder) AddReflected(key string, obj interface{}) error { + valueBytes, err := enc.encodeReflected(obj) if err != nil { return err } - enc.reflectBuf.TrimNewline() enc.addKey(key) - _, err = enc.buf.Write(enc.reflectBuf.Bytes()) + _, err = enc.buf.Write(valueBytes) return err } @@ -222,7 +236,9 @@ func (enc *jsonEncoder) AppendComplex128(val complex128) { func (enc *jsonEncoder) AppendDuration(val time.Duration) { cur := enc.buf.Len() - enc.EncodeDuration(val, enc) + if e := enc.EncodeDuration; e != nil { + e(val, enc) + } if cur == enc.buf.Len() { // User-supplied EncodeDuration is a no-op. Fall back to nanoseconds to keep // JSON valid. @@ -236,14 +252,12 @@ func (enc *jsonEncoder) AppendInt64(val int64) { } func (enc *jsonEncoder) AppendReflected(val interface{}) error { - enc.resetReflectBuf() - err := enc.reflectEnc.Encode(val) + valueBytes, err := enc.encodeReflected(val) if err != nil { return err } - enc.reflectBuf.TrimNewline() enc.addElementSeparator() - _, err = enc.buf.Write(enc.reflectBuf.Bytes()) + _, err = enc.buf.Write(valueBytes) return err } @@ -254,9 +268,18 @@ func (enc *jsonEncoder) AppendString(val string) { enc.buf.AppendByte('"') } +func (enc *jsonEncoder) AppendTimeLayout(time time.Time, layout string) { + enc.addElementSeparator() + enc.buf.AppendByte('"') + enc.buf.AppendTime(time, layout) + enc.buf.AppendByte('"') +} + func (enc *jsonEncoder) AppendTime(val time.Time) { cur := enc.buf.Len() - enc.EncodeTime(val, enc) + if e := enc.EncodeTime; e != nil { + e(val, enc) + } if cur == enc.buf.Len() { // User-supplied EncodeTime is a no-op. Fall back to nanos since epoch to keep // output JSON valid. @@ -343,14 +366,20 @@ func (enc *jsonEncoder) EncodeEntry(ent Entry, fields []Field) (*buffer.Buffer, final.AppendString(ent.LoggerName) } } - if ent.Caller.Defined && final.CallerKey != "" { - final.addKey(final.CallerKey) - cur := final.buf.Len() - final.EncodeCaller(ent.Caller, final) - if cur == final.buf.Len() { - // User-supplied EncodeCaller was a no-op. Fall back to strings to - // keep output JSON valid. - final.AppendString(ent.Caller.String()) + if ent.Caller.Defined { + if final.CallerKey != "" { + final.addKey(final.CallerKey) + cur := final.buf.Len() + final.EncodeCaller(ent.Caller, final) + if cur == final.buf.Len() { + // User-supplied EncodeCaller was a no-op. Fall back to strings to + // keep output JSON valid. + final.AppendString(ent.Caller.String()) + } + } + if final.FunctionKey != "" { + final.addKey(final.FunctionKey) + final.AppendString(ent.Caller.Function) } } if final.MessageKey != "" { diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/marshaler.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/marshaler.go index 2627a653dfd3..c3c55ba0d9c8 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/marshaler.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/marshaler.go @@ -23,6 +23,10 @@ package zapcore // ObjectMarshaler allows user-defined types to efficiently add themselves to the // logging context, and to selectively omit information which shouldn't be // included in logs (e.g., passwords). +// +// Note: ObjectMarshaler is only used when zap.Object is used or when +// passed directly to zap.Any. It is not used when reflection-based +// encoding is used. type ObjectMarshaler interface { MarshalLogObject(ObjectEncoder) error } @@ -39,6 +43,10 @@ func (f ObjectMarshalerFunc) MarshalLogObject(enc ObjectEncoder) error { // ArrayMarshaler allows user-defined types to efficiently add themselves to the // logging context, and to selectively omit information which shouldn't be // included in logs (e.g., passwords). +// +// Note: ArrayMarshaler is only used when zap.Array is used or when +// passed directly to zap.Any. It is not used when reflection-based +// encoding is used. type ArrayMarshaler interface { MarshalLogArray(ArrayEncoder) error } diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/sampler.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/sampler.go index e3164186367d..25f10ca1d750 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/sampler.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/sampler.go @@ -81,33 +81,104 @@ func (c *counter) IncCheckReset(t time.Time, tick time.Duration) uint64 { return 1 } -type sampler struct { - Core +// SamplingDecision is a decision represented as a bit field made by sampler. +// More decisions may be added in the future. +type SamplingDecision uint32 - counts *counters - tick time.Duration - first, thereafter uint64 +const ( + // LogDropped indicates that the Sampler dropped a log entry. + LogDropped SamplingDecision = 1 << iota + // LogSampled indicates that the Sampler sampled a log entry. + LogSampled +) + +// optionFunc wraps a func so it satisfies the SamplerOption interface. +type optionFunc func(*sampler) + +func (f optionFunc) apply(s *sampler) { + f(s) +} + +// SamplerOption configures a Sampler. +type SamplerOption interface { + apply(*sampler) } -// NewSampler creates a Core that samples incoming entries, which caps the CPU -// and I/O load of logging while attempting to preserve a representative subset -// of your logs. +// nopSamplingHook is the default hook used by sampler. +func nopSamplingHook(Entry, SamplingDecision) {} + +// SamplerHook registers a function which will be called when Sampler makes a +// decision. +// +// This hook may be used to get visibility into the performance of the sampler. +// For example, use it to track metrics of dropped versus sampled logs. +// +// var dropped atomic.Int64 +// zapcore.SamplerHook(func(ent zapcore.Entry, dec zapcore.SamplingDecision) { +// if dec&zapcore.LogDropped > 0 { +// dropped.Inc() +// } +// }) +func SamplerHook(hook func(entry Entry, dec SamplingDecision)) SamplerOption { + return optionFunc(func(s *sampler) { + s.hook = hook + }) +} + +// NewSamplerWithOptions creates a Core that samples incoming entries, which +// caps the CPU and I/O load of logging while attempting to preserve a +// representative subset of your logs. // // Zap samples by logging the first N entries with a given level and message // each tick. If more Entries with the same level and message are seen during // the same interval, every Mth message is logged and the rest are dropped. // +// Sampler can be configured to report sampling decisions with the SamplerHook +// option. +// // Keep in mind that zap's sampling implementation is optimized for speed over // absolute precision; under load, each tick may be slightly over- or // under-sampled. -func NewSampler(core Core, tick time.Duration, first, thereafter int) Core { - return &sampler{ +func NewSamplerWithOptions(core Core, tick time.Duration, first, thereafter int, opts ...SamplerOption) Core { + s := &sampler{ Core: core, tick: tick, counts: newCounters(), first: uint64(first), thereafter: uint64(thereafter), + hook: nopSamplingHook, } + for _, opt := range opts { + opt.apply(s) + } + + return s +} + +type sampler struct { + Core + + counts *counters + tick time.Duration + first, thereafter uint64 + hook func(Entry, SamplingDecision) +} + +// NewSampler creates a Core that samples incoming entries, which +// caps the CPU and I/O load of logging while attempting to preserve a +// representative subset of your logs. +// +// Zap samples by logging the first N entries with a given level and message +// each tick. If more Entries with the same level and message are seen during +// the same interval, every Mth message is logged and the rest are dropped. +// +// Keep in mind that zap's sampling implementation is optimized for speed over +// absolute precision; under load, each tick may be slightly over- or +// under-sampled. +// +// Deprecated: use NewSamplerWithOptions. +func NewSampler(core Core, tick time.Duration, first, thereafter int) Core { + return NewSamplerWithOptions(core, tick, first, thereafter) } func (s *sampler) With(fields []Field) Core { @@ -117,6 +188,7 @@ func (s *sampler) With(fields []Field) Core { counts: s.counts, first: s.first, thereafter: s.thereafter, + hook: s.hook, } } @@ -128,7 +200,9 @@ func (s *sampler) Check(ent Entry, ce *CheckedEntry) *CheckedEntry { counter := s.counts.get(ent.Level, ent.Message) n := counter.IncCheckReset(ent.Time, s.tick) if n > s.first && (n-s.first)%s.thereafter != 0 { + s.hook(ent, LogDropped) return ce } + s.hook(ent, LogSampled) return s.Core.Check(ent, ce) } diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/.travis.yml b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/.travis.yml index 04d4dae09c78..a130fe883ce8 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/.travis.yml +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/.travis.yml @@ -11,6 +11,7 @@ go: - "1.11.x" - "1.12.x" - "1.13.x" + - "1.14.x" - "tip" go_import_path: gopkg.in/yaml.v3 diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/apic.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/apic.go index 65846e674979..ae7d049f182a 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/apic.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/apic.go @@ -108,6 +108,7 @@ func yaml_emitter_initialize(emitter *yaml_emitter_t) { raw_buffer: make([]byte, 0, output_raw_buffer_size), states: make([]yaml_emitter_state_t, 0, initial_stack_size), events: make([]yaml_event_t, 0, initial_queue_size), + best_width: -1, } } diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/decode.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/decode.go index be63169b7194..21c0dacfdff2 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/decode.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/decode.go @@ -35,6 +35,7 @@ type parser struct { doc *Node anchors map[string]*Node doneInit bool + textless bool } func newParser(b []byte) *parser { @@ -108,14 +109,18 @@ func (p *parser) peek() yaml_event_type_t { func (p *parser) fail() { var where string var line int - if p.parser.problem_mark.line != 0 { + if p.parser.context_mark.line != 0 { + line = p.parser.context_mark.line + // Scanner errors don't iterate line before returning error + if p.parser.error == yaml_SCANNER_ERROR { + line++ + } + } else if p.parser.problem_mark.line != 0 { line = p.parser.problem_mark.line // Scanner errors don't iterate line before returning error if p.parser.error == yaml_SCANNER_ERROR { line++ } - } else if p.parser.context_mark.line != 0 { - line = p.parser.context_mark.line } if line != 0 { where = "line " + strconv.Itoa(line) + ": " @@ -169,17 +174,20 @@ func (p *parser) node(kind Kind, defaultTag, tag, value string) *Node { } else if kind == ScalarNode { tag, _ = resolve("", value) } - return &Node{ - Kind: kind, - Tag: tag, - Value: value, - Style: style, - Line: p.event.start_mark.line + 1, - Column: p.event.start_mark.column + 1, - HeadComment: string(p.event.head_comment), - LineComment: string(p.event.line_comment), - FootComment: string(p.event.foot_comment), + n := &Node{ + Kind: kind, + Tag: tag, + Value: value, + Style: style, + } + if !p.textless { + n.Line = p.event.start_mark.line + 1 + n.Column = p.event.start_mark.column + 1 + n.HeadComment = string(p.event.head_comment) + n.LineComment = string(p.event.line_comment) + n.FootComment = string(p.event.foot_comment) } + return n } func (p *parser) parseChild(parent *Node) *Node { @@ -391,7 +399,7 @@ func (d *decoder) callObsoleteUnmarshaler(n *Node, u obsoleteUnmarshaler) (good // // If n holds a null value, prepare returns before doing anything. func (d *decoder) prepare(n *Node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) { - if n.ShortTag() == nullTag { + if n.ShortTag() == nullTag || n.Kind == 0 && n.IsZero() { return out, false, false } again := true @@ -497,8 +505,13 @@ func (d *decoder) unmarshal(n *Node, out reflect.Value) (good bool) { good = d.mapping(n, out) case SequenceNode: good = d.sequence(n, out) + case 0: + if n.IsZero() { + return d.null(out) + } + fallthrough default: - panic("internal error: unknown node kind: " + strconv.Itoa(int(n.Kind))) + failf("cannot decode node with unknown kind %d", n.Kind) } return good } @@ -533,6 +546,17 @@ func resetMap(out reflect.Value) { } } +func (d *decoder) null(out reflect.Value) bool { + if out.CanAddr() { + switch out.Kind() { + case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: + out.Set(reflect.Zero(out.Type())) + return true + } + } + return false +} + func (d *decoder) scalar(n *Node, out reflect.Value) bool { var tag string var resolved interface{} @@ -550,14 +574,7 @@ func (d *decoder) scalar(n *Node, out reflect.Value) bool { } } if resolved == nil { - if out.CanAddr() { - switch out.Kind() { - case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: - out.Set(reflect.Zero(out.Type())) - return true - } - } - return false + return d.null(out) } if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() { // We've resolved to exactly the type we want, so use that. diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/emitterc.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/emitterc.go index ab2a066194cb..c29217ef54b6 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/emitterc.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/emitterc.go @@ -235,10 +235,13 @@ func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool emitter.indent = 0 } } else if !indentless { - emitter.indent += emitter.best_indent - // [Go] If inside a block sequence item, discount the space taken by the indicator. - if emitter.best_indent > 2 && emitter.states[len(emitter.states)-1] == yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE { - emitter.indent -= 2 + // [Go] This was changed so that indentations are more regular. + if emitter.states[len(emitter.states)-1] == yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE { + // The first indent inside a sequence will just skip the "- " indicator. + emitter.indent += 2 + } else { + // Everything else aligns to the chosen indentation. + emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent) } } return true @@ -725,16 +728,9 @@ func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_e // Expect a block item node. func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { if first { - // [Go] The original logic here would not indent the sequence when inside a mapping. - // In Go we always indent it, but take the sequence indicator out of the indentation. - indentless := emitter.best_indent == 2 && emitter.mapping_context && (emitter.column == 0 || !emitter.indention) - original := emitter.indent - if !yaml_emitter_increase_indent(emitter, false, indentless) { + if !yaml_emitter_increase_indent(emitter, false, false) { return false } - if emitter.indent > original+2 { - emitter.indent -= 2 - } } if event.typ == yaml_SEQUENCE_END_EVENT { emitter.indent = emitter.indents[len(emitter.indents)-1] @@ -785,6 +781,13 @@ func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_ev if !yaml_emitter_write_indent(emitter) { return false } + if len(emitter.line_comment) > 0 { + // [Go] A line comment was provided for the key. That's unusual as the + // scanner associates line comments with the value. Either way, + // save the line comment and render it appropriately later. + emitter.key_line_comment = emitter.line_comment + emitter.line_comment = nil + } if yaml_emitter_check_simple_key(emitter) { emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE) return yaml_emitter_emit_node(emitter, event, false, false, true, true) @@ -810,6 +813,29 @@ func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_ return false } } + if len(emitter.key_line_comment) > 0 { + // [Go] A line comment was previously provided for the key. Handle it before + // the value so the inline comments are placed correctly. + if yaml_emitter_silent_nil_event(emitter, event) && len(emitter.line_comment) == 0 { + // Nothing other than the line comment will be written on the line. + emitter.line_comment = emitter.key_line_comment + emitter.key_line_comment = nil + } else { + // An actual value is coming, so emit the comment line. + emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment + if !yaml_emitter_process_line_comment(emitter) { + return false + } + emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment + // Indent in unless it's a block that will reindent anyway. + if event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE || (event.typ != yaml_MAPPING_START_EVENT && event.typ != yaml_SEQUENCE_START_EVENT) { + emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent) + if !yaml_emitter_write_indent(emitter) { + return false + } + } + } + } emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE) if !yaml_emitter_emit_node(emitter, event, false, false, true, false) { return false @@ -823,6 +849,10 @@ func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_ return true } +func yaml_emitter_silent_nil_event(emitter *yaml_emitter_t, event *yaml_event_t) bool { + return event.typ == yaml_SCALAR_EVENT && event.implicit && !emitter.canonical && len(emitter.scalar_data.value) == 0 +} + // Expect a node. func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t, root bool, sequence bool, mapping bool, simple_key bool) bool { diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/encode.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/encode.go index 1f37271ce452..45e8d1e1b9f2 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/encode.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/encode.go @@ -119,6 +119,9 @@ func (e *encoder) marshal(tag string, in reflect.Value) { case *Node: e.nodev(in) return + case Node: + e.nodev(in.Addr()) + return case time.Time: e.timev(tag, in) return @@ -422,18 +425,23 @@ func (e *encoder) nodev(in reflect.Value) { } func (e *encoder) node(node *Node, tail string) { + // Zero nodes behave as nil. + if node.Kind == 0 && node.IsZero() { + e.nilv() + return + } + // If the tag was not explicitly requested, and dropping it won't change the // implicit tag of the value, don't include it in the presentation. var tag = node.Tag var stag = shortTag(tag) - var rtag string var forceQuoting bool if tag != "" && node.Style&TaggedStyle == 0 { if node.Kind == ScalarNode { if stag == strTag && node.Style&(SingleQuotedStyle|DoubleQuotedStyle|LiteralStyle|FoldedStyle) != 0 { tag = "" } else { - rtag, _ = resolve("", node.Value) + rtag, _ := resolve("", node.Value) if rtag == stag { tag = "" } else if stag == strTag { @@ -442,6 +450,7 @@ func (e *encoder) node(node *Node, tail string) { } } } else { + var rtag string switch node.Kind { case MappingNode: rtag = mapTag @@ -471,7 +480,7 @@ func (e *encoder) node(node *Node, tail string) { if node.Style&FlowStyle != 0 { style = yaml_FLOW_SEQUENCE_STYLE } - e.must(yaml_sequence_start_event_initialize(&e.event, []byte(node.Anchor), []byte(tag), tag == "", style)) + e.must(yaml_sequence_start_event_initialize(&e.event, []byte(node.Anchor), []byte(longTag(tag)), tag == "", style)) e.event.head_comment = []byte(node.HeadComment) e.emit() for _, node := range node.Content { @@ -487,7 +496,7 @@ func (e *encoder) node(node *Node, tail string) { if node.Style&FlowStyle != 0 { style = yaml_FLOW_MAPPING_STYLE } - yaml_mapping_start_event_initialize(&e.event, []byte(node.Anchor), []byte(tag), tag == "", style) + yaml_mapping_start_event_initialize(&e.event, []byte(node.Anchor), []byte(longTag(tag)), tag == "", style) e.event.tail_comment = []byte(tail) e.event.head_comment = []byte(node.HeadComment) e.emit() @@ -528,11 +537,11 @@ func (e *encoder) node(node *Node, tail string) { case ScalarNode: value := node.Value if !utf8.ValidString(value) { - if tag == binaryTag { + if stag == binaryTag { failf("explicitly tagged !!binary data must be base64-encoded") } - if tag != "" { - failf("cannot marshal invalid UTF-8 data as %s", shortTag(tag)) + if stag != "" { + failf("cannot marshal invalid UTF-8 data as %s", stag) } // It can't be encoded directly as YAML so use a binary tag // and encode it as base64. @@ -557,5 +566,7 @@ func (e *encoder) node(node *Node, tail string) { } e.emitScalar(value, node.Anchor, tag, style, []byte(node.HeadComment), []byte(node.LineComment), []byte(node.FootComment), []byte(tail)) + default: + failf("cannot encode node with unknown kind %d", node.Kind) } } diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/parserc.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/parserc.go index aea9050b833a..ac66fccc059e 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/parserc.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/parserc.go @@ -648,6 +648,10 @@ func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, i implicit: implicit, style: yaml_style_t(yaml_BLOCK_MAPPING_STYLE), } + if parser.stem_comment != nil { + event.head_comment = parser.stem_comment + parser.stem_comment = nil + } return true } if len(anchor) > 0 || len(tag) > 0 { @@ -694,25 +698,13 @@ func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_e if token.typ == yaml_BLOCK_ENTRY_TOKEN { mark := token.end_mark - prior_head := len(parser.head_comment) + prior_head_len := len(parser.head_comment) skip_token(parser) + yaml_parser_split_stem_comment(parser, prior_head_len) token = peek_token(parser) if token == nil { return false } - if prior_head > 0 && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN { - // [Go] It's a sequence under a sequence entry, so the former head comment - // is for the list itself, not the first list item under it. - parser.stem_comment = parser.head_comment[:prior_head] - if len(parser.head_comment) == prior_head { - parser.head_comment = nil - } else { - // Copy suffix to prevent very strange bugs if someone ever appends - // further bytes to the prefix in the stem_comment slice above. - parser.head_comment = append([]byte(nil), parser.head_comment[prior_head+1:]...) - } - - } if token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE) return yaml_parser_parse_node(parser, event, true, false) @@ -754,7 +746,9 @@ func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *y if token.typ == yaml_BLOCK_ENTRY_TOKEN { mark := token.end_mark + prior_head_len := len(parser.head_comment) skip_token(parser) + yaml_parser_split_stem_comment(parser, prior_head_len) token = peek_token(parser) if token == nil { return false @@ -780,6 +774,32 @@ func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *y return true } +// Split stem comment from head comment. +// +// When a sequence or map is found under a sequence entry, the former head comment +// is assigned to the underlying sequence or map as a whole, not the individual +// sequence or map entry as would be expected otherwise. To handle this case the +// previous head comment is moved aside as the stem comment. +func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) { + if stem_len == 0 { + return + } + + token := peek_token(parser) + if token.typ != yaml_BLOCK_SEQUENCE_START_TOKEN && token.typ != yaml_BLOCK_MAPPING_START_TOKEN { + return + } + + parser.stem_comment = parser.head_comment[:stem_len] + if len(parser.head_comment) == stem_len { + parser.head_comment = nil + } else { + // Copy suffix to prevent very strange bugs if someone ever appends + // further bytes to the prefix in the stem_comment slice above. + parser.head_comment = append([]byte(nil), parser.head_comment[stem_len+1:]...) + } +} + // Parse the productions: // block_mapping ::= BLOCK-MAPPING_START // ******************* diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/scannerc.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/scannerc.go index 57e954ca53df..d9a539c39aec 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/scannerc.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/scannerc.go @@ -749,6 +749,11 @@ func yaml_parser_fetch_next_token(parser *yaml_parser_t) (ok bool) { if !ok { return } + if len(parser.tokens) > 0 && parser.tokens[len(parser.tokens)-1].typ == yaml_BLOCK_ENTRY_TOKEN { + // Sequence indicators alone have no line comments. It becomes + // a head comment for whatever follows. + return + } if !yaml_parser_scan_line_comment(parser, comment_mark) { ok = false return @@ -2856,13 +2861,12 @@ func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t return false } skip_line(parser) - } else { - if parser.mark.index >= seen { - if len(text) == 0 { - start_mark = parser.mark - } - text = append(text, parser.buffer[parser.buffer_pos]) + } else if parser.mark.index >= seen { + if len(text) == 0 { + start_mark = parser.mark } + text = read(parser, text) + } else { skip(parser) } } @@ -2999,10 +3003,9 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo return false } skip_line(parser) + } else if parser.mark.index >= seen { + text = read(parser, text) } else { - if parser.mark.index >= seen { - text = append(text, parser.buffer[parser.buffer_pos]) - } skip(parser) } } diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/yaml.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/yaml.go index b5d35a50ded6..56e8a849031f 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/yaml.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/yaml.go @@ -89,7 +89,7 @@ func Unmarshal(in []byte, out interface{}) (err error) { return unmarshal(in, out, false) } -// A Decorder reads and decodes YAML values from an input stream. +// A Decoder reads and decodes YAML values from an input stream. type Decoder struct { parser *parser knownFields bool @@ -194,7 +194,7 @@ func unmarshal(in []byte, out interface{}, strict bool) (err error) { // Zero valued structs will be omitted if all their public // fields are zero, unless they implement an IsZero // method (see the IsZeroer interface type), in which -// case the field will be included if that method returns true. +// case the field will be excluded if IsZero returns true. // // flow Marshal using a flow style (useful for structs, // sequences and maps). @@ -252,6 +252,24 @@ func (e *Encoder) Encode(v interface{}) (err error) { return nil } +// Encode encodes value v and stores its representation in n. +// +// See the documentation for Marshal for details about the +// conversion of Go values into YAML. +func (n *Node) Encode(v interface{}) (err error) { + defer handleErr(&err) + e := newEncoder() + defer e.destroy() + e.marshalDoc("", reflect.ValueOf(v)) + e.finish() + p := newParser(e.out) + p.textless = true + defer p.destroy() + doc := p.parse() + *n = *doc.Content[0] + return nil +} + // SetIndent changes the used indentation used when encoding. func (e *Encoder) SetIndent(spaces int) { if spaces < 0 { @@ -328,6 +346,12 @@ const ( // and maps, Node is an intermediate representation that allows detailed // control over the content being decoded or encoded. // +// It's worth noting that although Node offers access into details such as +// line numbers, colums, and comments, the content when re-encoded will not +// have its original textual representation preserved. An effort is made to +// render the data plesantly, and to preserve comments near the data they +// describe, though. +// // Values that make use of the Node type interact with the yaml package in the // same way any other type would do, by encoding and decoding yaml data // directly or indirectly into them. @@ -391,6 +415,13 @@ type Node struct { Column int } +// IsZero returns whether the node has all of its fields unset. +func (n *Node) IsZero() bool { + return n.Kind == 0 && n.Style == 0 && n.Tag == "" && n.Value == "" && n.Anchor == "" && n.Alias == nil && n.Content == nil && + n.HeadComment == "" && n.LineComment == "" && n.FootComment == "" && n.Line == 0 && n.Column == 0 +} + + // LongTag returns the long form of the tag that indicates the data type for // the node. If the Tag field isn't explicitly defined, one will be computed // based on the node properties. diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/yamlh.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/yamlh.go index 2719cfbb0b75..7c6d00770619 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/yamlh.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/yamlh.go @@ -787,6 +787,8 @@ type yaml_emitter_t struct { foot_comment []byte tail_comment []byte + key_line_comment []byte + // Dumper stuff opened bool // If the stream was already opened? diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types.go index 48299f18ecbb..e2c8961aa55e 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types.go @@ -34,6 +34,7 @@ const ( // +genclient // +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale // +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale +// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // StatefulSet represents a set of pods with consistent identities. @@ -248,6 +249,7 @@ type StatefulSetList struct { // +genclient // +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale // +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale +// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Deployment enables declarative updates for Pods and ReplicaSets. @@ -682,6 +684,7 @@ type DaemonSetList struct { // +genclient // +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale // +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale +// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ReplicaSet ensures that a specified number of pod replicas are running at any given time. diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.proto index ff306ba6a9a9..8940f6426907 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.proto @@ -592,6 +592,7 @@ message ScaleStatus { // label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // +optional + // +mapType=atomic map selector = 2; // label selector for pods that should match the replicas count. This is a serializated diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types.go index 316a0ad24d25..be3744ef04c6 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types.go @@ -45,6 +45,7 @@ type ScaleStatus struct { // label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // +optional + // +mapType=atomic Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` // label selector for pods that should match the replicas count. This is a serializated @@ -82,6 +83,7 @@ type Scale struct { // +genclient // +genclient:method=GetScale,verb=get,subresource=scale,result=Scale // +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale +// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=Scale,result=Scale // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.8 // +k8s:prerelease-lifecycle-gen:deprecated=1.9 diff --git a/cluster-autoscaler/vendor/k8s.io/api/autoscaling/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/autoscaling/v1/generated.proto index 08b8667c8d51..606a50da5607 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/autoscaling/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/autoscaling/v1/generated.proto @@ -85,6 +85,7 @@ message ContainerResourceMetricStatus { } // CrossVersionObjectReference contains enough information to let you identify the referred resource. +// +structType=atomic message CrossVersionObjectReference { // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" optional string kind = 1; diff --git a/cluster-autoscaler/vendor/k8s.io/api/autoscaling/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/autoscaling/v1/types.go index 3343177b2ad9..93b1efb51cc0 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/autoscaling/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/autoscaling/v1/types.go @@ -23,6 +23,7 @@ import ( ) // CrossVersionObjectReference contains enough information to let you identify the referred resource. +// +structType=atomic type CrossVersionObjectReference struct { // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` diff --git a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.pb.go index ef1c0bce6dbe..1407caebc61f 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.pb.go @@ -344,89 +344,89 @@ func init() { } var fileDescriptor_3b52da57c93de713 = []byte{ - // 1307 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcf, 0x8f, 0xdb, 0xc4, - 0x17, 0x5f, 0x6f, 0x36, 0x9b, 0x64, 0xb2, 0xbb, 0x4d, 0xa7, 0xdf, 0xb6, 0xf9, 0x86, 0x2a, 0x5e, - 0xc2, 0x0f, 0x2d, 0x08, 0x1c, 0xb6, 0xac, 0x10, 0x42, 0x80, 0xb4, 0xde, 0xaa, 0xa2, 0x4b, 0x56, - 0x5d, 0x26, 0x5b, 0x21, 0x41, 0x41, 0x4c, 0xec, 0x49, 0xd6, 0x5d, 0xdb, 0x63, 0x79, 0x26, 0x11, - 0xb9, 0xf1, 0x27, 0xf0, 0x57, 0x20, 0x4e, 0x5c, 0xe0, 0xcc, 0x11, 0xf5, 0xd8, 0x63, 0x4f, 0x16, - 0x35, 0x37, 0x2e, 0xdc, 0x97, 0x0b, 0xf2, 0x78, 0x62, 0x3b, 0x89, 0xbd, 0xb4, 0x3d, 0x54, 0xdc, - 0xe2, 0x37, 0x9f, 0xcf, 0x67, 0x5e, 0xde, 0x7b, 0xf3, 0xde, 0x03, 0x1f, 0x9e, 0xbd, 0xcf, 0x34, - 0x8b, 0x76, 0xcf, 0xc6, 0x03, 0xe2, 0xbb, 0x84, 0x13, 0xd6, 0x9d, 0x10, 0xd7, 0xa4, 0x7e, 0x57, - 0x1e, 0x60, 0xcf, 0xea, 0x0e, 0x30, 0x37, 0x4e, 0xbb, 0x93, 0xdd, 0xee, 0x88, 0xb8, 0xc4, 0xc7, - 0x9c, 0x98, 0x9a, 0xe7, 0x53, 0x4e, 0xe1, 0x95, 0x18, 0xa4, 0x61, 0xcf, 0xd2, 0x04, 0x48, 0x9b, - 0xec, 0xb6, 0xde, 0x1e, 0x59, 0xfc, 0x74, 0x3c, 0xd0, 0x0c, 0xea, 0x74, 0x47, 0x74, 0x44, 0xbb, - 0x02, 0x3b, 0x18, 0x0f, 0xc5, 0x97, 0xf8, 0x10, 0xbf, 0x62, 0x8d, 0x56, 0x27, 0x73, 0x91, 0x41, - 0x7d, 0x92, 0x73, 0x4f, 0x6b, 0x2f, 0xc5, 0x38, 0xd8, 0x38, 0xb5, 0x5c, 0xe2, 0x4f, 0xbb, 0xde, - 0xd9, 0x28, 0x32, 0xb0, 0xae, 0x43, 0x38, 0xce, 0x63, 0x75, 0x8b, 0x58, 0xfe, 0xd8, 0xe5, 0x96, - 0x43, 0x96, 0x08, 0xef, 0xfd, 0x1b, 0x81, 0x19, 0xa7, 0xc4, 0xc1, 0x8b, 0xbc, 0xce, 0xdf, 0x0a, - 0xa8, 0x1c, 0xf8, 0xd4, 0x3d, 0xa4, 0x03, 0xf8, 0x0d, 0xa8, 0x46, 0xfe, 0x98, 0x98, 0xe3, 0xa6, - 0xb2, 0xad, 0xec, 0xd4, 0x6f, 0xbe, 0xa3, 0xa5, 0x51, 0x4a, 0x64, 0x35, 0xef, 0x6c, 0x14, 0x19, - 0x98, 0x16, 0xa1, 0xb5, 0xc9, 0xae, 0x76, 0x77, 0xf0, 0x80, 0x18, 0xfc, 0x88, 0x70, 0xac, 0xc3, - 0x87, 0x81, 0xba, 0x12, 0x06, 0x2a, 0x48, 0x6d, 0x28, 0x51, 0x85, 0x3a, 0x58, 0x63, 0x1e, 0x31, - 0x9a, 0xab, 0x42, 0x7d, 0x5b, 0xcb, 0xc9, 0x81, 0x26, 0xbd, 0xe9, 0x7b, 0xc4, 0xd0, 0x37, 0xa4, - 0xda, 0x5a, 0xf4, 0x85, 0x04, 0x17, 0x1e, 0x82, 0x75, 0xc6, 0x31, 0x1f, 0xb3, 0x66, 0x49, 0xa8, - 0x74, 0x2e, 0x54, 0x11, 0x48, 0x7d, 0x4b, 0xea, 0xac, 0xc7, 0xdf, 0x48, 0x2a, 0x74, 0x7e, 0x52, - 0x40, 0x5d, 0x22, 0x7b, 0x16, 0xe3, 0xf0, 0xfe, 0x52, 0x04, 0xb4, 0xa7, 0x8b, 0x40, 0xc4, 0x16, - 0xff, 0xbf, 0x21, 0x6f, 0xaa, 0xce, 0x2c, 0x99, 0x7f, 0xbf, 0x0f, 0xca, 0x16, 0x27, 0x0e, 0x6b, - 0xae, 0x6e, 0x97, 0x76, 0xea, 0x37, 0x6f, 0x5c, 0xe4, 0xb8, 0xbe, 0x29, 0x85, 0xca, 0x77, 0x22, - 0x0a, 0x8a, 0x99, 0x9d, 0x1f, 0xd7, 0x12, 0x87, 0xa3, 0x90, 0xc0, 0xb7, 0x40, 0x35, 0x4a, 0xac, - 0x39, 0xb6, 0x89, 0x70, 0xb8, 0x96, 0x3a, 0xd0, 0x97, 0x76, 0x94, 0x20, 0xe0, 0x3d, 0x70, 0x9d, - 0x71, 0xec, 0x73, 0xcb, 0x1d, 0xdd, 0x22, 0xd8, 0xb4, 0x2d, 0x97, 0xf4, 0x89, 0x41, 0x5d, 0x93, - 0x89, 0x8c, 0x94, 0xf4, 0x97, 0xc2, 0x40, 0xbd, 0xde, 0xcf, 0x87, 0xa0, 0x22, 0x2e, 0xbc, 0x0f, - 0x2e, 0x1b, 0xd4, 0x35, 0xc6, 0xbe, 0x4f, 0x5c, 0x63, 0x7a, 0x4c, 0x6d, 0xcb, 0x98, 0x8a, 0xe4, - 0xd4, 0x74, 0x4d, 0x7a, 0x73, 0xf9, 0x60, 0x11, 0x70, 0x9e, 0x67, 0x44, 0xcb, 0x42, 0xf0, 0x35, - 0x50, 0x61, 0x63, 0xe6, 0x11, 0xd7, 0x6c, 0xae, 0x6d, 0x2b, 0x3b, 0x55, 0xbd, 0x1e, 0x06, 0x6a, - 0xa5, 0x1f, 0x9b, 0xd0, 0xec, 0x0c, 0x7e, 0x09, 0xea, 0x0f, 0xe8, 0xe0, 0x84, 0x38, 0x9e, 0x8d, - 0x39, 0x69, 0x96, 0x45, 0xf6, 0x5e, 0xcd, 0x0d, 0xf1, 0x61, 0x8a, 0x13, 0x55, 0x76, 0x45, 0x3a, - 0x59, 0xcf, 0x1c, 0xa0, 0xac, 0x1a, 0xfc, 0x1a, 0xb4, 0xd8, 0xd8, 0x30, 0x08, 0x63, 0xc3, 0xb1, - 0x7d, 0x48, 0x07, 0xec, 0x13, 0x8b, 0x71, 0xea, 0x4f, 0x7b, 0x96, 0x63, 0xf1, 0xe6, 0xfa, 0xb6, - 0xb2, 0x53, 0xd6, 0xdb, 0x61, 0xa0, 0xb6, 0xfa, 0x85, 0x28, 0x74, 0x81, 0x02, 0x44, 0xe0, 0xda, - 0x10, 0x5b, 0x36, 0x31, 0x97, 0xb4, 0x2b, 0x42, 0xbb, 0x15, 0x06, 0xea, 0xb5, 0xdb, 0xb9, 0x08, - 0x54, 0xc0, 0xec, 0xfc, 0xba, 0x0a, 0x36, 0xe7, 0x5e, 0x01, 0xfc, 0x14, 0xac, 0x63, 0x83, 0x5b, - 0x93, 0xa8, 0x54, 0xa2, 0x02, 0x7c, 0x25, 0x1b, 0x9d, 0xa8, 0x7f, 0xa5, 0x6f, 0x19, 0x91, 0x21, - 0x89, 0x92, 0x40, 0xd2, 0xa7, 0xb3, 0x2f, 0xa8, 0x48, 0x4a, 0x40, 0x1b, 0x34, 0x6c, 0xcc, 0xf8, - 0xac, 0xca, 0x4e, 0x2c, 0x87, 0x88, 0xfc, 0xd4, 0x6f, 0xbe, 0xf9, 0x74, 0x4f, 0x26, 0x62, 0xe8, - 0xff, 0x0b, 0x03, 0xb5, 0xd1, 0x5b, 0xd0, 0x41, 0x4b, 0xca, 0xd0, 0x07, 0x50, 0xd8, 0x92, 0x10, - 0x8a, 0xfb, 0xca, 0xcf, 0x7c, 0xdf, 0xb5, 0x30, 0x50, 0x61, 0x6f, 0x49, 0x09, 0xe5, 0xa8, 0x77, - 0xfe, 0x52, 0x40, 0xe9, 0xc5, 0xb4, 0xc5, 0x8f, 0xe7, 0xda, 0xe2, 0x8d, 0xa2, 0xa2, 0x2d, 0x6c, - 0x89, 0xb7, 0x17, 0x5a, 0x62, 0xbb, 0x50, 0xe1, 0xe2, 0x76, 0xf8, 0x5b, 0x09, 0x6c, 0x1c, 0xd2, - 0xc1, 0x01, 0x75, 0x4d, 0x8b, 0x5b, 0xd4, 0x85, 0x7b, 0x60, 0x8d, 0x4f, 0xbd, 0x59, 0x6b, 0xd9, - 0x9e, 0x5d, 0x7d, 0x32, 0xf5, 0xc8, 0x79, 0xa0, 0x36, 0xb2, 0xd8, 0xc8, 0x86, 0x04, 0x1a, 0xf6, - 0x12, 0x77, 0x56, 0x05, 0x6f, 0x6f, 0xfe, 0xba, 0xf3, 0x40, 0xcd, 0x19, 0x9c, 0x5a, 0xa2, 0x34, - 0xef, 0x14, 0x1c, 0x81, 0xcd, 0x28, 0x39, 0xc7, 0x3e, 0x1d, 0xc4, 0x55, 0x56, 0x7a, 0xe6, 0xac, - 0x5f, 0x95, 0x0e, 0x6c, 0xf6, 0xb2, 0x42, 0x68, 0x5e, 0x17, 0x4e, 0xe2, 0x1a, 0x3b, 0xf1, 0xb1, - 0xcb, 0xe2, 0xbf, 0xf4, 0x7c, 0x35, 0xdd, 0x92, 0xb7, 0x89, 0x3a, 0x9b, 0x57, 0x43, 0x39, 0x37, - 0xc0, 0xd7, 0xc1, 0xba, 0x4f, 0x30, 0xa3, 0xae, 0xa8, 0xe7, 0x5a, 0x9a, 0x1d, 0x24, 0xac, 0x48, - 0x9e, 0xc2, 0x37, 0x40, 0xc5, 0x21, 0x8c, 0xe1, 0x11, 0x11, 0x1d, 0xa7, 0xa6, 0x5f, 0x92, 0xc0, - 0xca, 0x51, 0x6c, 0x46, 0xb3, 0xf3, 0xce, 0x0f, 0x0a, 0xa8, 0xbc, 0x98, 0x99, 0xf6, 0xd1, 0xfc, - 0x4c, 0x6b, 0x16, 0x55, 0x5e, 0xc1, 0x3c, 0xfb, 0xa5, 0x2c, 0x1c, 0x15, 0xb3, 0x6c, 0x17, 0xd4, - 0x3d, 0xec, 0x63, 0xdb, 0x26, 0xb6, 0xc5, 0x1c, 0xe1, 0x6b, 0x59, 0xbf, 0x14, 0xf5, 0xe5, 0xe3, - 0xd4, 0x8c, 0xb2, 0x98, 0x88, 0x62, 0x50, 0xc7, 0xb3, 0x49, 0x14, 0xcc, 0xb8, 0xdc, 0x24, 0xe5, - 0x20, 0x35, 0xa3, 0x2c, 0x06, 0xde, 0x05, 0x57, 0xe3, 0x0e, 0xb6, 0x38, 0x01, 0x4b, 0x62, 0x02, - 0xfe, 0x3f, 0x0c, 0xd4, 0xab, 0xfb, 0x79, 0x00, 0x94, 0xcf, 0x83, 0x7b, 0x60, 0x63, 0x80, 0x8d, - 0x33, 0x3a, 0x1c, 0x66, 0x3b, 0x76, 0x23, 0x0c, 0xd4, 0x0d, 0x3d, 0x63, 0x47, 0x73, 0x28, 0xf8, - 0x15, 0xa8, 0x32, 0x62, 0x13, 0x83, 0x53, 0x5f, 0x96, 0xd8, 0xbb, 0x4f, 0x99, 0x15, 0x3c, 0x20, - 0x76, 0x5f, 0x52, 0xf5, 0x0d, 0x31, 0xe9, 0xe5, 0x17, 0x4a, 0x24, 0xe1, 0x07, 0x60, 0xcb, 0xc1, - 0xee, 0x18, 0x27, 0x48, 0x51, 0x5b, 0x55, 0x1d, 0x86, 0x81, 0xba, 0x75, 0x34, 0x77, 0x82, 0x16, - 0x90, 0xf0, 0x33, 0x50, 0xe5, 0xb3, 0x31, 0xba, 0x2e, 0x5c, 0xcb, 0x1d, 0x14, 0xc7, 0xd4, 0x9c, - 0x9b, 0xa2, 0x49, 0x95, 0x24, 0x23, 0x34, 0x91, 0x89, 0x16, 0x0f, 0xce, 0x6d, 0x19, 0xb1, 0xfd, - 0x21, 0x27, 0xfe, 0x6d, 0xcb, 0xb5, 0xd8, 0x29, 0x31, 0x9b, 0x55, 0x11, 0x2e, 0xb1, 0x78, 0x9c, - 0x9c, 0xf4, 0xf2, 0x20, 0xa8, 0x88, 0x0b, 0x8f, 0xc1, 0x56, 0x9a, 0xda, 0x23, 0x6a, 0x92, 0x66, - 0x4d, 0x3c, 0x8c, 0x1d, 0xe9, 0xca, 0xd6, 0xc1, 0xdc, 0xe9, 0xf9, 0x92, 0x05, 0x2d, 0xf0, 0xb3, - 0xcb, 0x06, 0x28, 0x5e, 0x36, 0x3a, 0x7f, 0x96, 0x40, 0x2d, 0x9d, 0xab, 0xf7, 0x00, 0x30, 0x66, - 0xcd, 0x8b, 0xc9, 0xd9, 0xfa, 0x72, 0xd1, 0x43, 0x48, 0xda, 0x5c, 0x3a, 0x13, 0x12, 0x13, 0x43, - 0x19, 0x21, 0xf8, 0x39, 0xa8, 0x89, 0x8d, 0x4b, 0xb4, 0xa1, 0xd5, 0x67, 0x6e, 0x43, 0x9b, 0x61, - 0xa0, 0xd6, 0xfa, 0x33, 0x01, 0x94, 0x6a, 0xc1, 0x61, 0x36, 0x6c, 0xcf, 0xd9, 0x52, 0xe1, 0x7c, - 0x78, 0xc5, 0x15, 0x0b, 0xaa, 0x51, 0x63, 0x93, 0xfb, 0xc6, 0x9a, 0x48, 0x72, 0xd1, 0x2a, 0xd1, - 0x05, 0x35, 0xb1, 0x1b, 0x11, 0x93, 0x98, 0xa2, 0x4e, 0xcb, 0xfa, 0x65, 0x09, 0xad, 0xf5, 0x67, - 0x07, 0x28, 0xc5, 0x44, 0xc2, 0xf1, 0xd2, 0x23, 0x57, 0xaf, 0x44, 0x38, 0x5e, 0x91, 0x90, 0x3c, - 0x85, 0xb7, 0x40, 0x43, 0xba, 0x44, 0xcc, 0x3b, 0xae, 0x49, 0xbe, 0x25, 0x4c, 0x3c, 0xcf, 0x9a, - 0xde, 0x94, 0x8c, 0xc6, 0xc1, 0xc2, 0x39, 0x5a, 0x62, 0x74, 0x7e, 0x56, 0xc0, 0xa5, 0x85, 0x95, - 0xf1, 0xbf, 0xbf, 0x13, 0xe8, 0x3b, 0x0f, 0x9f, 0xb4, 0x57, 0x1e, 0x3d, 0x69, 0xaf, 0x3c, 0x7e, - 0xd2, 0x5e, 0xf9, 0x2e, 0x6c, 0x2b, 0x0f, 0xc3, 0xb6, 0xf2, 0x28, 0x6c, 0x2b, 0x8f, 0xc3, 0xb6, - 0xf2, 0x7b, 0xd8, 0x56, 0xbe, 0xff, 0xa3, 0xbd, 0xf2, 0xc5, 0xea, 0x64, 0xf7, 0x9f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x3d, 0x6d, 0x62, 0x04, 0x48, 0x0f, 0x00, 0x00, + // 1304 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xc6, 0x71, 0x6c, 0x8f, 0x93, 0xd4, 0x9d, 0xd2, 0xd6, 0x98, 0xca, 0x1b, 0x4c, 0x41, + 0x01, 0xc1, 0x9a, 0x94, 0x08, 0x21, 0x04, 0x48, 0xd9, 0x54, 0x15, 0x0d, 0x8e, 0x1a, 0xc6, 0xa9, + 0x90, 0xa0, 0x20, 0xc6, 0xbb, 0x63, 0x67, 0x9b, 0xdd, 0x9d, 0xd5, 0xce, 0xd8, 0x22, 0x37, 0x7e, + 0x02, 0xbf, 0x02, 0x71, 0x42, 0x48, 0xdc, 0x39, 0xa2, 0x1e, 0x7b, 0xec, 0x69, 0x45, 0x97, 0x1b, + 0x17, 0xee, 0xe1, 0x82, 0x76, 0x76, 0xbc, 0xbb, 0xb6, 0x77, 0x43, 0xd3, 0x43, 0xc5, 0xcd, 0xfb, + 0xe6, 0xfb, 0xbe, 0x79, 0x7e, 0xef, 0xcd, 0x7b, 0x0f, 0x7c, 0x74, 0xf2, 0x01, 0xd3, 0x2c, 0xda, + 0x3d, 0x19, 0x0f, 0x88, 0xef, 0x12, 0x4e, 0x58, 0x77, 0x42, 0x5c, 0x93, 0xfa, 0x5d, 0x79, 0x80, + 0x3d, 0xab, 0x3b, 0xc0, 0xdc, 0x38, 0xee, 0x4e, 0xb6, 0xbb, 0x23, 0xe2, 0x12, 0x1f, 0x73, 0x62, + 0x6a, 0x9e, 0x4f, 0x39, 0x85, 0x57, 0x62, 0x90, 0x86, 0x3d, 0x4b, 0x13, 0x20, 0x6d, 0xb2, 0xdd, + 0x7a, 0x67, 0x64, 0xf1, 0xe3, 0xf1, 0x40, 0x33, 0xa8, 0xd3, 0x1d, 0xd1, 0x11, 0xed, 0x0a, 0xec, + 0x60, 0x3c, 0x14, 0x5f, 0xe2, 0x43, 0xfc, 0x8a, 0x35, 0x5a, 0x9d, 0xcc, 0x45, 0x06, 0xf5, 0x49, + 0xce, 0x3d, 0xad, 0x9d, 0x14, 0xe3, 0x60, 0xe3, 0xd8, 0x72, 0x89, 0x7f, 0xda, 0xf5, 0x4e, 0x46, + 0x91, 0x81, 0x75, 0x1d, 0xc2, 0x71, 0x1e, 0xab, 0x5b, 0xc4, 0xf2, 0xc7, 0x2e, 0xb7, 0x1c, 0xb2, + 0x40, 0x78, 0xff, 0xbf, 0x08, 0xcc, 0x38, 0x26, 0x0e, 0x9e, 0xe7, 0x75, 0xfe, 0x51, 0x40, 0x65, + 0xcf, 0xa7, 0xee, 0x3e, 0x1d, 0xc0, 0x6f, 0x41, 0x35, 0xf2, 0xc7, 0xc4, 0x1c, 0x37, 0x95, 0x4d, + 0x65, 0xab, 0x7e, 0xeb, 0x5d, 0x2d, 0x8d, 0x52, 0x22, 0xab, 0x79, 0x27, 0xa3, 0xc8, 0xc0, 0xb4, + 0x08, 0xad, 0x4d, 0xb6, 0xb5, 0x7b, 0x83, 0x87, 0xc4, 0xe0, 0x07, 0x84, 0x63, 0x1d, 0x3e, 0x0a, + 0xd4, 0xa5, 0x30, 0x50, 0x41, 0x6a, 0x43, 0x89, 0x2a, 0xd4, 0xc1, 0x0a, 0xf3, 0x88, 0xd1, 0x5c, + 0x16, 0xea, 0x9b, 0x5a, 0x4e, 0x0e, 0x34, 0xe9, 0x4d, 0xdf, 0x23, 0x86, 0xbe, 0x26, 0xd5, 0x56, + 0xa2, 0x2f, 0x24, 0xb8, 0x70, 0x1f, 0xac, 0x32, 0x8e, 0xf9, 0x98, 0x35, 0x4b, 0x42, 0xa5, 0x73, + 0xae, 0x8a, 0x40, 0xea, 0x1b, 0x52, 0x67, 0x35, 0xfe, 0x46, 0x52, 0xa1, 0xf3, 0xb3, 0x02, 0xea, + 0x12, 0xd9, 0xb3, 0x18, 0x87, 0x0f, 0x16, 0x22, 0xa0, 0x3d, 0x5b, 0x04, 0x22, 0xb6, 0xf8, 0xff, + 0x0d, 0x79, 0x53, 0x75, 0x6a, 0xc9, 0xfc, 0xfb, 0x5d, 0x50, 0xb6, 0x38, 0x71, 0x58, 0x73, 0x79, + 0xb3, 0xb4, 0x55, 0xbf, 0x75, 0xe3, 0x3c, 0xc7, 0xf5, 0x75, 0x29, 0x54, 0xbe, 0x1b, 0x51, 0x50, + 0xcc, 0xec, 0xfc, 0xb4, 0x92, 0x38, 0x1c, 0x85, 0x04, 0xbe, 0x0d, 0xaa, 0x51, 0x62, 0xcd, 0xb1, + 0x4d, 0x84, 0xc3, 0xb5, 0xd4, 0x81, 0xbe, 0xb4, 0xa3, 0x04, 0x01, 0xef, 0x83, 0xeb, 0x8c, 0x63, + 0x9f, 0x5b, 0xee, 0xe8, 0x36, 0xc1, 0xa6, 0x6d, 0xb9, 0xa4, 0x4f, 0x0c, 0xea, 0x9a, 0x4c, 0x64, + 0xa4, 0xa4, 0xbf, 0x12, 0x06, 0xea, 0xf5, 0x7e, 0x3e, 0x04, 0x15, 0x71, 0xe1, 0x03, 0x70, 0xd9, + 0xa0, 0xae, 0x31, 0xf6, 0x7d, 0xe2, 0x1a, 0xa7, 0x87, 0xd4, 0xb6, 0x8c, 0x53, 0x91, 0x9c, 0x9a, + 0xae, 0x49, 0x6f, 0x2e, 0xef, 0xcd, 0x03, 0xce, 0xf2, 0x8c, 0x68, 0x51, 0x08, 0xbe, 0x0e, 0x2a, + 0x6c, 0xcc, 0x3c, 0xe2, 0x9a, 0xcd, 0x95, 0x4d, 0x65, 0xab, 0xaa, 0xd7, 0xc3, 0x40, 0xad, 0xf4, + 0x63, 0x13, 0x9a, 0x9e, 0xc1, 0xaf, 0x40, 0xfd, 0x21, 0x1d, 0x1c, 0x11, 0xc7, 0xb3, 0x31, 0x27, + 0xcd, 0xb2, 0xc8, 0xde, 0xcd, 0xdc, 0x10, 0xef, 0xa7, 0x38, 0x51, 0x65, 0x57, 0xa4, 0x93, 0xf5, + 0xcc, 0x01, 0xca, 0xaa, 0xc1, 0x6f, 0x40, 0x8b, 0x8d, 0x0d, 0x83, 0x30, 0x36, 0x1c, 0xdb, 0xfb, + 0x74, 0xc0, 0x3e, 0xb5, 0x18, 0xa7, 0xfe, 0x69, 0xcf, 0x72, 0x2c, 0xde, 0x5c, 0xdd, 0x54, 0xb6, + 0xca, 0x7a, 0x3b, 0x0c, 0xd4, 0x56, 0xbf, 0x10, 0x85, 0xce, 0x51, 0x80, 0x08, 0x5c, 0x1b, 0x62, + 0xcb, 0x26, 0xe6, 0x82, 0x76, 0x45, 0x68, 0xb7, 0xc2, 0x40, 0xbd, 0x76, 0x27, 0x17, 0x81, 0x0a, + 0x98, 0x9d, 0xdf, 0x96, 0xc1, 0xfa, 0xcc, 0x2b, 0x80, 0x9f, 0x81, 0x55, 0x6c, 0x70, 0x6b, 0x12, + 0x95, 0x4a, 0x54, 0x80, 0xaf, 0x65, 0xa3, 0x13, 0xf5, 0xaf, 0xf4, 0x2d, 0x23, 0x32, 0x24, 0x51, + 0x12, 0x48, 0xfa, 0x74, 0x76, 0x05, 0x15, 0x49, 0x09, 0x68, 0x83, 0x86, 0x8d, 0x19, 0x9f, 0x56, + 0xd9, 0x91, 0xe5, 0x10, 0x91, 0x9f, 0xfa, 0xad, 0xb7, 0x9e, 0xed, 0xc9, 0x44, 0x0c, 0xfd, 0xa5, + 0x30, 0x50, 0x1b, 0xbd, 0x39, 0x1d, 0xb4, 0xa0, 0x0c, 0x7d, 0x00, 0x85, 0x2d, 0x09, 0xa1, 0xb8, + 0xaf, 0x7c, 0xe1, 0xfb, 0xae, 0x85, 0x81, 0x0a, 0x7b, 0x0b, 0x4a, 0x28, 0x47, 0xbd, 0xf3, 0xb7, + 0x02, 0x4a, 0x2f, 0xa6, 0x2d, 0x7e, 0x32, 0xd3, 0x16, 0x6f, 0x14, 0x15, 0x6d, 0x61, 0x4b, 0xbc, + 0x33, 0xd7, 0x12, 0xdb, 0x85, 0x0a, 0xe7, 0xb7, 0xc3, 0xdf, 0x4b, 0x60, 0x6d, 0x9f, 0x0e, 0xf6, + 0xa8, 0x6b, 0x5a, 0xdc, 0xa2, 0x2e, 0xdc, 0x01, 0x2b, 0xfc, 0xd4, 0x9b, 0xb6, 0x96, 0xcd, 0xe9, + 0xd5, 0x47, 0xa7, 0x1e, 0x39, 0x0b, 0xd4, 0x46, 0x16, 0x1b, 0xd9, 0x90, 0x40, 0xc3, 0x5e, 0xe2, + 0xce, 0xb2, 0xe0, 0xed, 0xcc, 0x5e, 0x77, 0x16, 0xa8, 0x39, 0x83, 0x53, 0x4b, 0x94, 0x66, 0x9d, + 0x82, 0x23, 0xb0, 0x1e, 0x25, 0xe7, 0xd0, 0xa7, 0x83, 0xb8, 0xca, 0x4a, 0x17, 0xce, 0xfa, 0x55, + 0xe9, 0xc0, 0x7a, 0x2f, 0x2b, 0x84, 0x66, 0x75, 0xe1, 0x24, 0xae, 0xb1, 0x23, 0x1f, 0xbb, 0x2c, + 0xfe, 0x4b, 0xcf, 0x57, 0xd3, 0x2d, 0x79, 0x9b, 0xa8, 0xb3, 0x59, 0x35, 0x94, 0x73, 0x03, 0x7c, + 0x03, 0xac, 0xfa, 0x04, 0x33, 0xea, 0x8a, 0x7a, 0xae, 0xa5, 0xd9, 0x41, 0xc2, 0x8a, 0xe4, 0x29, + 0x7c, 0x13, 0x54, 0x1c, 0xc2, 0x18, 0x1e, 0x11, 0xd1, 0x71, 0x6a, 0xfa, 0x25, 0x09, 0xac, 0x1c, + 0xc4, 0x66, 0x34, 0x3d, 0xef, 0xfc, 0xa8, 0x80, 0xca, 0x8b, 0x99, 0x69, 0x1f, 0xcf, 0xce, 0xb4, + 0x66, 0x51, 0xe5, 0x15, 0xcc, 0xb3, 0x5f, 0xca, 0xc2, 0x51, 0x31, 0xcb, 0xb6, 0x41, 0xdd, 0xc3, + 0x3e, 0xb6, 0x6d, 0x62, 0x5b, 0xcc, 0x11, 0xbe, 0x96, 0xf5, 0x4b, 0x51, 0x5f, 0x3e, 0x4c, 0xcd, + 0x28, 0x8b, 0x89, 0x28, 0x06, 0x75, 0x3c, 0x9b, 0x44, 0xc1, 0x8c, 0xcb, 0x4d, 0x52, 0xf6, 0x52, + 0x33, 0xca, 0x62, 0xe0, 0x3d, 0x70, 0x35, 0xee, 0x60, 0xf3, 0x13, 0xb0, 0x24, 0x26, 0xe0, 0xcb, + 0x61, 0xa0, 0x5e, 0xdd, 0xcd, 0x03, 0xa0, 0x7c, 0x1e, 0xdc, 0x01, 0x6b, 0x03, 0x6c, 0x9c, 0xd0, + 0xe1, 0x30, 0xdb, 0xb1, 0x1b, 0x61, 0xa0, 0xae, 0xe9, 0x19, 0x3b, 0x9a, 0x41, 0xc1, 0xaf, 0x41, + 0x95, 0x11, 0x9b, 0x18, 0x9c, 0xfa, 0xb2, 0xc4, 0xde, 0x7b, 0xc6, 0xac, 0xe0, 0x01, 0xb1, 0xfb, + 0x92, 0xaa, 0xaf, 0x89, 0x49, 0x2f, 0xbf, 0x50, 0x22, 0x09, 0x3f, 0x04, 0x1b, 0x0e, 0x76, 0xc7, + 0x38, 0x41, 0x8a, 0xda, 0xaa, 0xea, 0x30, 0x0c, 0xd4, 0x8d, 0x83, 0x99, 0x13, 0x34, 0x87, 0x84, + 0x9f, 0x83, 0x2a, 0x9f, 0x8e, 0xd1, 0x55, 0xe1, 0x5a, 0xee, 0xa0, 0x38, 0xa4, 0xe6, 0xcc, 0x14, + 0x4d, 0xaa, 0x24, 0x19, 0xa1, 0x89, 0x4c, 0xb4, 0x78, 0x70, 0x6e, 0xcb, 0x88, 0xed, 0x0e, 0x39, + 0xf1, 0xef, 0x58, 0xae, 0xc5, 0x8e, 0x89, 0xd9, 0xac, 0x8a, 0x70, 0x89, 0xc5, 0xe3, 0xe8, 0xa8, + 0x97, 0x07, 0x41, 0x45, 0x5c, 0xd8, 0x03, 0x1b, 0x69, 0x6a, 0x0f, 0xa8, 0x49, 0x9a, 0x35, 0xf1, + 0x30, 0x6e, 0x46, 0xff, 0x72, 0x6f, 0xe6, 0xe4, 0x6c, 0xc1, 0x82, 0xe6, 0xb8, 0xd9, 0x45, 0x03, + 0x14, 0x2f, 0x1a, 0x9d, 0xbf, 0x4a, 0xa0, 0x96, 0xce, 0xd4, 0xfb, 0x00, 0x18, 0xd3, 0xc6, 0xc5, + 0xe4, 0x5c, 0x7d, 0xb5, 0xe8, 0x11, 0x24, 0x2d, 0x2e, 0x9d, 0x07, 0x89, 0x89, 0xa1, 0x8c, 0x10, + 0xfc, 0x02, 0xd4, 0xc4, 0xb6, 0x25, 0x5a, 0xd0, 0xf2, 0x85, 0x5b, 0xd0, 0x7a, 0x18, 0xa8, 0xb5, + 0xfe, 0x54, 0x00, 0xa5, 0x5a, 0x70, 0x98, 0x0d, 0xd9, 0x73, 0xb6, 0x53, 0x38, 0x1b, 0x5e, 0x71, + 0xc5, 0x9c, 0x6a, 0xd4, 0xd4, 0xe4, 0xae, 0xb1, 0x22, 0x12, 0x5c, 0xb4, 0x46, 0x74, 0x41, 0x4d, + 0xec, 0x45, 0xc4, 0x24, 0xa6, 0xa8, 0xd1, 0xb2, 0x7e, 0x59, 0x42, 0x6b, 0xfd, 0xe9, 0x01, 0x4a, + 0x31, 0x91, 0x70, 0xbc, 0xf0, 0xc8, 0xb5, 0x2b, 0x11, 0x8e, 0xd7, 0x23, 0x24, 0x4f, 0xe1, 0x6d, + 0xd0, 0x90, 0x2e, 0x11, 0xf3, 0xae, 0x6b, 0x92, 0xef, 0x08, 0x13, 0x4f, 0xb3, 0xa6, 0x37, 0x25, + 0xa3, 0xb1, 0x37, 0x77, 0x8e, 0x16, 0x18, 0x9d, 0x5f, 0x15, 0x70, 0x69, 0x6e, 0x5d, 0xfc, 0xff, + 0xef, 0x03, 0xfa, 0xd6, 0xa3, 0xa7, 0xed, 0xa5, 0xc7, 0x4f, 0xdb, 0x4b, 0x4f, 0x9e, 0xb6, 0x97, + 0xbe, 0x0f, 0xdb, 0xca, 0xa3, 0xb0, 0xad, 0x3c, 0x0e, 0xdb, 0xca, 0x93, 0xb0, 0xad, 0xfc, 0x11, + 0xb6, 0x95, 0x1f, 0xfe, 0x6c, 0x2f, 0x7d, 0xb9, 0x3c, 0xd9, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, + 0x5a, 0x54, 0xec, 0x5f, 0x44, 0x0f, 0x00, 0x00, } func (m *CronJob) Marshal() (dAtA []byte, err error) { @@ -851,11 +851,13 @@ func (m *JobSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x50 } - i -= len(m.CompletionMode) - copy(dAtA[i:], m.CompletionMode) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.CompletionMode))) - i-- - dAtA[i] = 0x4a + if m.CompletionMode != nil { + i -= len(*m.CompletionMode) + copy(dAtA[i:], *m.CompletionMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.CompletionMode))) + i-- + dAtA[i] = 0x4a + } if m.TTLSecondsAfterFinished != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.TTLSecondsAfterFinished)) i-- @@ -1210,8 +1212,10 @@ func (m *JobSpec) Size() (n int) { if m.TTLSecondsAfterFinished != nil { n += 1 + sovGenerated(uint64(*m.TTLSecondsAfterFinished)) } - l = len(m.CompletionMode) - n += 1 + l + sovGenerated(uint64(l)) + if m.CompletionMode != nil { + l = len(*m.CompletionMode) + n += 1 + l + sovGenerated(uint64(l)) + } if m.Suspend != nil { n += 2 } @@ -1382,7 +1386,7 @@ func (this *JobSpec) String() string { `Template:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Template), "PodTemplateSpec", "v11.PodTemplateSpec", 1), `&`, ``, 1) + `,`, `BackoffLimit:` + valueToStringGenerated(this.BackoffLimit) + `,`, `TTLSecondsAfterFinished:` + valueToStringGenerated(this.TTLSecondsAfterFinished) + `,`, - `CompletionMode:` + fmt.Sprintf("%v", this.CompletionMode) + `,`, + `CompletionMode:` + valueToStringGenerated(this.CompletionMode) + `,`, `Suspend:` + valueToStringGenerated(this.Suspend) + `,`, `}`, }, "") @@ -2837,7 +2841,8 @@ func (m *JobSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CompletionMode = CompletionMode(dAtA[iNdEx:postIndex]) + s := CompletionMode(dAtA[iNdEx:postIndex]) + m.CompletionMode = &s iNdEx = postIndex case 10: if wireType != 0 { diff --git a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.proto index 54cfbb1b4c67..04f0e7ea7e69 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.proto @@ -241,7 +241,7 @@ message JobSpec { // // `Indexed` means that the Pods of a // Job get an associated completion index from 0 to (.spec.completions - 1), - // available in the annotation batch.alpha.kubernetes.io/job-completion-index. + // available in the annotation batch.kubernetes.io/job-completion-index. // The Job is considered complete when there is one successfully completed Pod // for each index. // When value is `Indexed`, .spec.completions must be specified and diff --git a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types.go index 0140c76b72d6..12f4b04cbd9a 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types.go @@ -21,7 +21,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -const JobCompletionIndexAnnotationAlpha = "batch.alpha.kubernetes.io/job-completion-index" +const JobCompletionIndexAnnotationAlpha = "batch.kubernetes.io/job-completion-index" // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -157,7 +157,7 @@ type JobSpec struct { // // `Indexed` means that the Pods of a // Job get an associated completion index from 0 to (.spec.completions - 1), - // available in the annotation batch.alpha.kubernetes.io/job-completion-index. + // available in the annotation batch.kubernetes.io/job-completion-index. // The Job is considered complete when there is one successfully completed Pod // for each index. // When value is `Indexed`, .spec.completions must be specified and @@ -168,7 +168,7 @@ type JobSpec struct { // If the Job controller observes a mode that it doesn't recognize, the // controller skips updates for the Job. // +optional - CompletionMode CompletionMode `json:"completionMode,omitempty" protobuf:"bytes,9,opt,name=completionMode,casttype=CompletionMode"` + CompletionMode *CompletionMode `json:"completionMode,omitempty" protobuf:"bytes,9,opt,name=completionMode,casttype=CompletionMode"` // Suspend specifies whether the Job controller should create Pods or not. If // a Job is created with suspend set to true, no Pods are created by the Job diff --git a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go index 78b41f6b169b..d98c5edeb1e6 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go @@ -119,7 +119,7 @@ var map_JobSpec = map[string]string{ "manualSelector": "manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector", "template": "Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", "ttlSecondsAfterFinished": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature.", - "completionMode": "CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.alpha.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5.\n\nThis field is alpha-level and is only honored by servers that enable the IndexedJob feature gate. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.", + "completionMode": "CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5.\n\nThis field is alpha-level and is only honored by servers that enable the IndexedJob feature gate. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.", "suspend": "Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. This is an alpha field and requires the SuspendJob feature gate to be enabled; otherwise this field may not be set to true. Defaults to false.", } diff --git a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go index 96f012532f5d..6018ad1d3c01 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go +++ b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go @@ -271,6 +271,11 @@ func (in *JobSpec) DeepCopyInto(out *JobSpec) { *out = new(int32) **out = **in } + if in.CompletionMode != nil { + in, out := &in.CompletionMode, &out.CompletionMode + *out = new(CompletionMode) + **out = **in + } if in.Suspend != nil { in, out := &in.Suspend, &out.Suspend *out = new(bool) diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/annotation_key_constants.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/annotation_key_constants.go index b3902b6d16fc..a3802f0c3632 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/annotation_key_constants.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/annotation_key_constants.go @@ -123,6 +123,14 @@ const ( // https://github.com/kubernetes/community/blob/master/sig-scalability/slos/network_programming_latency.md EndpointsLastChangeTriggerTime = "endpoints.kubernetes.io/last-change-trigger-time" + // EndpointsOverCapacity will be set on an Endpoints resource when it + // exceeds the maximum capacity of 1000 addresses. Inititially the Endpoints + // controller will set this annotation with a value of "warning". In a + // future release, the controller may set this annotation with a value of + // "truncated" to indicate that any addresses exceeding the limit of 1000 + // have been truncated from the Endpoints resource. + EndpointsOverCapacity = "endpoints.kubernetes.io/over-capacity" + // MigratedPluginsAnnotationKey is the annotation key, set for CSINode objects, that is a comma-separated // list of in-tree plugins that will be serviced by the CSI backend on the Node represented by CSINode. // This annotation is used by the Attach Detach Controller to determine whether to use the in-tree or @@ -136,6 +144,11 @@ const ( // pod deletion order. // The implicit deletion cost for pods that don't set the annotation is 0, negative values are permitted. // - // This annotation is alpha-level and is only honored when PodDeletionCost feature is enabled. + // This annotation is beta-level and is only honored when PodDeletionCost feature is enabled. PodDeletionCost = "controller.kubernetes.io/pod-deletion-cost" + + // AnnotationTopologyAwareHints can be used to enable or disable Topology + // Aware Hints for a Service. This may be set to "Auto" or "Disabled". Any + // other value is treated as "Disabled". + AnnotationTopologyAwareHints = "service.kubernetes.io/topology-aware-hints" ) diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.pb.go index 13815c0b9999..bc5bcbd607db 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.pb.go @@ -1421,38 +1421,10 @@ func (m *EphemeralContainerCommon) XXX_DiscardUnknown() { var xxx_messageInfo_EphemeralContainerCommon proto.InternalMessageInfo -func (m *EphemeralContainers) Reset() { *m = EphemeralContainers{} } -func (*EphemeralContainers) ProtoMessage() {} -func (*EphemeralContainers) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{49} -} -func (m *EphemeralContainers) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EphemeralContainers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EphemeralContainers) XXX_Merge(src proto.Message) { - xxx_messageInfo_EphemeralContainers.Merge(m, src) -} -func (m *EphemeralContainers) XXX_Size() int { - return m.Size() -} -func (m *EphemeralContainers) XXX_DiscardUnknown() { - xxx_messageInfo_EphemeralContainers.DiscardUnknown(m) -} - -var xxx_messageInfo_EphemeralContainers proto.InternalMessageInfo - func (m *EphemeralVolumeSource) Reset() { *m = EphemeralVolumeSource{} } func (*EphemeralVolumeSource) ProtoMessage() {} func (*EphemeralVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{50} + return fileDescriptor_83c10c24ec417dc9, []int{49} } func (m *EphemeralVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1480,7 +1452,7 @@ var xxx_messageInfo_EphemeralVolumeSource proto.InternalMessageInfo func (m *Event) Reset() { *m = Event{} } func (*Event) ProtoMessage() {} func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{51} + return fileDescriptor_83c10c24ec417dc9, []int{50} } func (m *Event) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1508,7 +1480,7 @@ var xxx_messageInfo_Event proto.InternalMessageInfo func (m *EventList) Reset() { *m = EventList{} } func (*EventList) ProtoMessage() {} func (*EventList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{52} + return fileDescriptor_83c10c24ec417dc9, []int{51} } func (m *EventList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1536,7 +1508,7 @@ var xxx_messageInfo_EventList proto.InternalMessageInfo func (m *EventSeries) Reset() { *m = EventSeries{} } func (*EventSeries) ProtoMessage() {} func (*EventSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{53} + return fileDescriptor_83c10c24ec417dc9, []int{52} } func (m *EventSeries) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1564,7 +1536,7 @@ var xxx_messageInfo_EventSeries proto.InternalMessageInfo func (m *EventSource) Reset() { *m = EventSource{} } func (*EventSource) ProtoMessage() {} func (*EventSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{54} + return fileDescriptor_83c10c24ec417dc9, []int{53} } func (m *EventSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1592,7 +1564,7 @@ var xxx_messageInfo_EventSource proto.InternalMessageInfo func (m *ExecAction) Reset() { *m = ExecAction{} } func (*ExecAction) ProtoMessage() {} func (*ExecAction) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{55} + return fileDescriptor_83c10c24ec417dc9, []int{54} } func (m *ExecAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1620,7 +1592,7 @@ var xxx_messageInfo_ExecAction proto.InternalMessageInfo func (m *FCVolumeSource) Reset() { *m = FCVolumeSource{} } func (*FCVolumeSource) ProtoMessage() {} func (*FCVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{56} + return fileDescriptor_83c10c24ec417dc9, []int{55} } func (m *FCVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1648,7 +1620,7 @@ var xxx_messageInfo_FCVolumeSource proto.InternalMessageInfo func (m *FlexPersistentVolumeSource) Reset() { *m = FlexPersistentVolumeSource{} } func (*FlexPersistentVolumeSource) ProtoMessage() {} func (*FlexPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{57} + return fileDescriptor_83c10c24ec417dc9, []int{56} } func (m *FlexPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1676,7 +1648,7 @@ var xxx_messageInfo_FlexPersistentVolumeSource proto.InternalMessageInfo func (m *FlexVolumeSource) Reset() { *m = FlexVolumeSource{} } func (*FlexVolumeSource) ProtoMessage() {} func (*FlexVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{58} + return fileDescriptor_83c10c24ec417dc9, []int{57} } func (m *FlexVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1704,7 +1676,7 @@ var xxx_messageInfo_FlexVolumeSource proto.InternalMessageInfo func (m *FlockerVolumeSource) Reset() { *m = FlockerVolumeSource{} } func (*FlockerVolumeSource) ProtoMessage() {} func (*FlockerVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{59} + return fileDescriptor_83c10c24ec417dc9, []int{58} } func (m *FlockerVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1732,7 +1704,7 @@ var xxx_messageInfo_FlockerVolumeSource proto.InternalMessageInfo func (m *GCEPersistentDiskVolumeSource) Reset() { *m = GCEPersistentDiskVolumeSource{} } func (*GCEPersistentDiskVolumeSource) ProtoMessage() {} func (*GCEPersistentDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{60} + return fileDescriptor_83c10c24ec417dc9, []int{59} } func (m *GCEPersistentDiskVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1760,7 +1732,7 @@ var xxx_messageInfo_GCEPersistentDiskVolumeSource proto.InternalMessageInfo func (m *GitRepoVolumeSource) Reset() { *m = GitRepoVolumeSource{} } func (*GitRepoVolumeSource) ProtoMessage() {} func (*GitRepoVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{61} + return fileDescriptor_83c10c24ec417dc9, []int{60} } func (m *GitRepoVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1788,7 +1760,7 @@ var xxx_messageInfo_GitRepoVolumeSource proto.InternalMessageInfo func (m *GlusterfsPersistentVolumeSource) Reset() { *m = GlusterfsPersistentVolumeSource{} } func (*GlusterfsPersistentVolumeSource) ProtoMessage() {} func (*GlusterfsPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{62} + return fileDescriptor_83c10c24ec417dc9, []int{61} } func (m *GlusterfsPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1816,7 +1788,7 @@ var xxx_messageInfo_GlusterfsPersistentVolumeSource proto.InternalMessageInfo func (m *GlusterfsVolumeSource) Reset() { *m = GlusterfsVolumeSource{} } func (*GlusterfsVolumeSource) ProtoMessage() {} func (*GlusterfsVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{63} + return fileDescriptor_83c10c24ec417dc9, []int{62} } func (m *GlusterfsVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1844,7 +1816,7 @@ var xxx_messageInfo_GlusterfsVolumeSource proto.InternalMessageInfo func (m *HTTPGetAction) Reset() { *m = HTTPGetAction{} } func (*HTTPGetAction) ProtoMessage() {} func (*HTTPGetAction) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{64} + return fileDescriptor_83c10c24ec417dc9, []int{63} } func (m *HTTPGetAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1872,7 +1844,7 @@ var xxx_messageInfo_HTTPGetAction proto.InternalMessageInfo func (m *HTTPHeader) Reset() { *m = HTTPHeader{} } func (*HTTPHeader) ProtoMessage() {} func (*HTTPHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{65} + return fileDescriptor_83c10c24ec417dc9, []int{64} } func (m *HTTPHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1900,7 +1872,7 @@ var xxx_messageInfo_HTTPHeader proto.InternalMessageInfo func (m *Handler) Reset() { *m = Handler{} } func (*Handler) ProtoMessage() {} func (*Handler) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{66} + return fileDescriptor_83c10c24ec417dc9, []int{65} } func (m *Handler) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1928,7 +1900,7 @@ var xxx_messageInfo_Handler proto.InternalMessageInfo func (m *HostAlias) Reset() { *m = HostAlias{} } func (*HostAlias) ProtoMessage() {} func (*HostAlias) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{67} + return fileDescriptor_83c10c24ec417dc9, []int{66} } func (m *HostAlias) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1956,7 +1928,7 @@ var xxx_messageInfo_HostAlias proto.InternalMessageInfo func (m *HostPathVolumeSource) Reset() { *m = HostPathVolumeSource{} } func (*HostPathVolumeSource) ProtoMessage() {} func (*HostPathVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{68} + return fileDescriptor_83c10c24ec417dc9, []int{67} } func (m *HostPathVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1984,7 +1956,7 @@ var xxx_messageInfo_HostPathVolumeSource proto.InternalMessageInfo func (m *ISCSIPersistentVolumeSource) Reset() { *m = ISCSIPersistentVolumeSource{} } func (*ISCSIPersistentVolumeSource) ProtoMessage() {} func (*ISCSIPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{69} + return fileDescriptor_83c10c24ec417dc9, []int{68} } func (m *ISCSIPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2012,7 +1984,7 @@ var xxx_messageInfo_ISCSIPersistentVolumeSource proto.InternalMessageInfo func (m *ISCSIVolumeSource) Reset() { *m = ISCSIVolumeSource{} } func (*ISCSIVolumeSource) ProtoMessage() {} func (*ISCSIVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{70} + return fileDescriptor_83c10c24ec417dc9, []int{69} } func (m *ISCSIVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2040,7 +2012,7 @@ var xxx_messageInfo_ISCSIVolumeSource proto.InternalMessageInfo func (m *KeyToPath) Reset() { *m = KeyToPath{} } func (*KeyToPath) ProtoMessage() {} func (*KeyToPath) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{71} + return fileDescriptor_83c10c24ec417dc9, []int{70} } func (m *KeyToPath) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2068,7 +2040,7 @@ var xxx_messageInfo_KeyToPath proto.InternalMessageInfo func (m *Lifecycle) Reset() { *m = Lifecycle{} } func (*Lifecycle) ProtoMessage() {} func (*Lifecycle) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{72} + return fileDescriptor_83c10c24ec417dc9, []int{71} } func (m *Lifecycle) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2096,7 +2068,7 @@ var xxx_messageInfo_Lifecycle proto.InternalMessageInfo func (m *LimitRange) Reset() { *m = LimitRange{} } func (*LimitRange) ProtoMessage() {} func (*LimitRange) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{73} + return fileDescriptor_83c10c24ec417dc9, []int{72} } func (m *LimitRange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2124,7 +2096,7 @@ var xxx_messageInfo_LimitRange proto.InternalMessageInfo func (m *LimitRangeItem) Reset() { *m = LimitRangeItem{} } func (*LimitRangeItem) ProtoMessage() {} func (*LimitRangeItem) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{74} + return fileDescriptor_83c10c24ec417dc9, []int{73} } func (m *LimitRangeItem) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2152,7 +2124,7 @@ var xxx_messageInfo_LimitRangeItem proto.InternalMessageInfo func (m *LimitRangeList) Reset() { *m = LimitRangeList{} } func (*LimitRangeList) ProtoMessage() {} func (*LimitRangeList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{75} + return fileDescriptor_83c10c24ec417dc9, []int{74} } func (m *LimitRangeList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2180,7 +2152,7 @@ var xxx_messageInfo_LimitRangeList proto.InternalMessageInfo func (m *LimitRangeSpec) Reset() { *m = LimitRangeSpec{} } func (*LimitRangeSpec) ProtoMessage() {} func (*LimitRangeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{76} + return fileDescriptor_83c10c24ec417dc9, []int{75} } func (m *LimitRangeSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2208,7 +2180,7 @@ var xxx_messageInfo_LimitRangeSpec proto.InternalMessageInfo func (m *List) Reset() { *m = List{} } func (*List) ProtoMessage() {} func (*List) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{77} + return fileDescriptor_83c10c24ec417dc9, []int{76} } func (m *List) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2236,7 +2208,7 @@ var xxx_messageInfo_List proto.InternalMessageInfo func (m *LoadBalancerIngress) Reset() { *m = LoadBalancerIngress{} } func (*LoadBalancerIngress) ProtoMessage() {} func (*LoadBalancerIngress) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{78} + return fileDescriptor_83c10c24ec417dc9, []int{77} } func (m *LoadBalancerIngress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2264,7 +2236,7 @@ var xxx_messageInfo_LoadBalancerIngress proto.InternalMessageInfo func (m *LoadBalancerStatus) Reset() { *m = LoadBalancerStatus{} } func (*LoadBalancerStatus) ProtoMessage() {} func (*LoadBalancerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{79} + return fileDescriptor_83c10c24ec417dc9, []int{78} } func (m *LoadBalancerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2292,7 +2264,7 @@ var xxx_messageInfo_LoadBalancerStatus proto.InternalMessageInfo func (m *LocalObjectReference) Reset() { *m = LocalObjectReference{} } func (*LocalObjectReference) ProtoMessage() {} func (*LocalObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{80} + return fileDescriptor_83c10c24ec417dc9, []int{79} } func (m *LocalObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2320,7 +2292,7 @@ var xxx_messageInfo_LocalObjectReference proto.InternalMessageInfo func (m *LocalVolumeSource) Reset() { *m = LocalVolumeSource{} } func (*LocalVolumeSource) ProtoMessage() {} func (*LocalVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{81} + return fileDescriptor_83c10c24ec417dc9, []int{80} } func (m *LocalVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2348,7 +2320,7 @@ var xxx_messageInfo_LocalVolumeSource proto.InternalMessageInfo func (m *NFSVolumeSource) Reset() { *m = NFSVolumeSource{} } func (*NFSVolumeSource) ProtoMessage() {} func (*NFSVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{82} + return fileDescriptor_83c10c24ec417dc9, []int{81} } func (m *NFSVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2376,7 +2348,7 @@ var xxx_messageInfo_NFSVolumeSource proto.InternalMessageInfo func (m *Namespace) Reset() { *m = Namespace{} } func (*Namespace) ProtoMessage() {} func (*Namespace) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{83} + return fileDescriptor_83c10c24ec417dc9, []int{82} } func (m *Namespace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2404,7 +2376,7 @@ var xxx_messageInfo_Namespace proto.InternalMessageInfo func (m *NamespaceCondition) Reset() { *m = NamespaceCondition{} } func (*NamespaceCondition) ProtoMessage() {} func (*NamespaceCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{84} + return fileDescriptor_83c10c24ec417dc9, []int{83} } func (m *NamespaceCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2432,7 +2404,7 @@ var xxx_messageInfo_NamespaceCondition proto.InternalMessageInfo func (m *NamespaceList) Reset() { *m = NamespaceList{} } func (*NamespaceList) ProtoMessage() {} func (*NamespaceList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{85} + return fileDescriptor_83c10c24ec417dc9, []int{84} } func (m *NamespaceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2460,7 +2432,7 @@ var xxx_messageInfo_NamespaceList proto.InternalMessageInfo func (m *NamespaceSpec) Reset() { *m = NamespaceSpec{} } func (*NamespaceSpec) ProtoMessage() {} func (*NamespaceSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{86} + return fileDescriptor_83c10c24ec417dc9, []int{85} } func (m *NamespaceSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2488,7 +2460,7 @@ var xxx_messageInfo_NamespaceSpec proto.InternalMessageInfo func (m *NamespaceStatus) Reset() { *m = NamespaceStatus{} } func (*NamespaceStatus) ProtoMessage() {} func (*NamespaceStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{87} + return fileDescriptor_83c10c24ec417dc9, []int{86} } func (m *NamespaceStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2516,7 +2488,7 @@ var xxx_messageInfo_NamespaceStatus proto.InternalMessageInfo func (m *Node) Reset() { *m = Node{} } func (*Node) ProtoMessage() {} func (*Node) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{88} + return fileDescriptor_83c10c24ec417dc9, []int{87} } func (m *Node) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2544,7 +2516,7 @@ var xxx_messageInfo_Node proto.InternalMessageInfo func (m *NodeAddress) Reset() { *m = NodeAddress{} } func (*NodeAddress) ProtoMessage() {} func (*NodeAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{89} + return fileDescriptor_83c10c24ec417dc9, []int{88} } func (m *NodeAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2572,7 +2544,7 @@ var xxx_messageInfo_NodeAddress proto.InternalMessageInfo func (m *NodeAffinity) Reset() { *m = NodeAffinity{} } func (*NodeAffinity) ProtoMessage() {} func (*NodeAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{90} + return fileDescriptor_83c10c24ec417dc9, []int{89} } func (m *NodeAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2600,7 +2572,7 @@ var xxx_messageInfo_NodeAffinity proto.InternalMessageInfo func (m *NodeCondition) Reset() { *m = NodeCondition{} } func (*NodeCondition) ProtoMessage() {} func (*NodeCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{91} + return fileDescriptor_83c10c24ec417dc9, []int{90} } func (m *NodeCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2628,7 +2600,7 @@ var xxx_messageInfo_NodeCondition proto.InternalMessageInfo func (m *NodeConfigSource) Reset() { *m = NodeConfigSource{} } func (*NodeConfigSource) ProtoMessage() {} func (*NodeConfigSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{92} + return fileDescriptor_83c10c24ec417dc9, []int{91} } func (m *NodeConfigSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2656,7 +2628,7 @@ var xxx_messageInfo_NodeConfigSource proto.InternalMessageInfo func (m *NodeConfigStatus) Reset() { *m = NodeConfigStatus{} } func (*NodeConfigStatus) ProtoMessage() {} func (*NodeConfigStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{93} + return fileDescriptor_83c10c24ec417dc9, []int{92} } func (m *NodeConfigStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2684,7 +2656,7 @@ var xxx_messageInfo_NodeConfigStatus proto.InternalMessageInfo func (m *NodeDaemonEndpoints) Reset() { *m = NodeDaemonEndpoints{} } func (*NodeDaemonEndpoints) ProtoMessage() {} func (*NodeDaemonEndpoints) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{94} + return fileDescriptor_83c10c24ec417dc9, []int{93} } func (m *NodeDaemonEndpoints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2712,7 +2684,7 @@ var xxx_messageInfo_NodeDaemonEndpoints proto.InternalMessageInfo func (m *NodeList) Reset() { *m = NodeList{} } func (*NodeList) ProtoMessage() {} func (*NodeList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{95} + return fileDescriptor_83c10c24ec417dc9, []int{94} } func (m *NodeList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2740,7 +2712,7 @@ var xxx_messageInfo_NodeList proto.InternalMessageInfo func (m *NodeProxyOptions) Reset() { *m = NodeProxyOptions{} } func (*NodeProxyOptions) ProtoMessage() {} func (*NodeProxyOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{96} + return fileDescriptor_83c10c24ec417dc9, []int{95} } func (m *NodeProxyOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2768,7 +2740,7 @@ var xxx_messageInfo_NodeProxyOptions proto.InternalMessageInfo func (m *NodeResources) Reset() { *m = NodeResources{} } func (*NodeResources) ProtoMessage() {} func (*NodeResources) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{97} + return fileDescriptor_83c10c24ec417dc9, []int{96} } func (m *NodeResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2796,7 +2768,7 @@ var xxx_messageInfo_NodeResources proto.InternalMessageInfo func (m *NodeSelector) Reset() { *m = NodeSelector{} } func (*NodeSelector) ProtoMessage() {} func (*NodeSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{98} + return fileDescriptor_83c10c24ec417dc9, []int{97} } func (m *NodeSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2824,7 +2796,7 @@ var xxx_messageInfo_NodeSelector proto.InternalMessageInfo func (m *NodeSelectorRequirement) Reset() { *m = NodeSelectorRequirement{} } func (*NodeSelectorRequirement) ProtoMessage() {} func (*NodeSelectorRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{99} + return fileDescriptor_83c10c24ec417dc9, []int{98} } func (m *NodeSelectorRequirement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2852,7 +2824,7 @@ var xxx_messageInfo_NodeSelectorRequirement proto.InternalMessageInfo func (m *NodeSelectorTerm) Reset() { *m = NodeSelectorTerm{} } func (*NodeSelectorTerm) ProtoMessage() {} func (*NodeSelectorTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{100} + return fileDescriptor_83c10c24ec417dc9, []int{99} } func (m *NodeSelectorTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2880,7 +2852,7 @@ var xxx_messageInfo_NodeSelectorTerm proto.InternalMessageInfo func (m *NodeSpec) Reset() { *m = NodeSpec{} } func (*NodeSpec) ProtoMessage() {} func (*NodeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{101} + return fileDescriptor_83c10c24ec417dc9, []int{100} } func (m *NodeSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2908,7 +2880,7 @@ var xxx_messageInfo_NodeSpec proto.InternalMessageInfo func (m *NodeStatus) Reset() { *m = NodeStatus{} } func (*NodeStatus) ProtoMessage() {} func (*NodeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{102} + return fileDescriptor_83c10c24ec417dc9, []int{101} } func (m *NodeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2936,7 +2908,7 @@ var xxx_messageInfo_NodeStatus proto.InternalMessageInfo func (m *NodeSystemInfo) Reset() { *m = NodeSystemInfo{} } func (*NodeSystemInfo) ProtoMessage() {} func (*NodeSystemInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{103} + return fileDescriptor_83c10c24ec417dc9, []int{102} } func (m *NodeSystemInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2964,7 +2936,7 @@ var xxx_messageInfo_NodeSystemInfo proto.InternalMessageInfo func (m *ObjectFieldSelector) Reset() { *m = ObjectFieldSelector{} } func (*ObjectFieldSelector) ProtoMessage() {} func (*ObjectFieldSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{104} + return fileDescriptor_83c10c24ec417dc9, []int{103} } func (m *ObjectFieldSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2992,7 +2964,7 @@ var xxx_messageInfo_ObjectFieldSelector proto.InternalMessageInfo func (m *ObjectReference) Reset() { *m = ObjectReference{} } func (*ObjectReference) ProtoMessage() {} func (*ObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{105} + return fileDescriptor_83c10c24ec417dc9, []int{104} } func (m *ObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3020,7 +2992,7 @@ var xxx_messageInfo_ObjectReference proto.InternalMessageInfo func (m *PersistentVolume) Reset() { *m = PersistentVolume{} } func (*PersistentVolume) ProtoMessage() {} func (*PersistentVolume) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{106} + return fileDescriptor_83c10c24ec417dc9, []int{105} } func (m *PersistentVolume) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3048,7 +3020,7 @@ var xxx_messageInfo_PersistentVolume proto.InternalMessageInfo func (m *PersistentVolumeClaim) Reset() { *m = PersistentVolumeClaim{} } func (*PersistentVolumeClaim) ProtoMessage() {} func (*PersistentVolumeClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{107} + return fileDescriptor_83c10c24ec417dc9, []int{106} } func (m *PersistentVolumeClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3076,7 +3048,7 @@ var xxx_messageInfo_PersistentVolumeClaim proto.InternalMessageInfo func (m *PersistentVolumeClaimCondition) Reset() { *m = PersistentVolumeClaimCondition{} } func (*PersistentVolumeClaimCondition) ProtoMessage() {} func (*PersistentVolumeClaimCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{108} + return fileDescriptor_83c10c24ec417dc9, []int{107} } func (m *PersistentVolumeClaimCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3104,7 +3076,7 @@ var xxx_messageInfo_PersistentVolumeClaimCondition proto.InternalMessageInfo func (m *PersistentVolumeClaimList) Reset() { *m = PersistentVolumeClaimList{} } func (*PersistentVolumeClaimList) ProtoMessage() {} func (*PersistentVolumeClaimList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{109} + return fileDescriptor_83c10c24ec417dc9, []int{108} } func (m *PersistentVolumeClaimList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3132,7 +3104,7 @@ var xxx_messageInfo_PersistentVolumeClaimList proto.InternalMessageInfo func (m *PersistentVolumeClaimSpec) Reset() { *m = PersistentVolumeClaimSpec{} } func (*PersistentVolumeClaimSpec) ProtoMessage() {} func (*PersistentVolumeClaimSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{110} + return fileDescriptor_83c10c24ec417dc9, []int{109} } func (m *PersistentVolumeClaimSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3160,7 +3132,7 @@ var xxx_messageInfo_PersistentVolumeClaimSpec proto.InternalMessageInfo func (m *PersistentVolumeClaimStatus) Reset() { *m = PersistentVolumeClaimStatus{} } func (*PersistentVolumeClaimStatus) ProtoMessage() {} func (*PersistentVolumeClaimStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{111} + return fileDescriptor_83c10c24ec417dc9, []int{110} } func (m *PersistentVolumeClaimStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3188,7 +3160,7 @@ var xxx_messageInfo_PersistentVolumeClaimStatus proto.InternalMessageInfo func (m *PersistentVolumeClaimTemplate) Reset() { *m = PersistentVolumeClaimTemplate{} } func (*PersistentVolumeClaimTemplate) ProtoMessage() {} func (*PersistentVolumeClaimTemplate) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{112} + return fileDescriptor_83c10c24ec417dc9, []int{111} } func (m *PersistentVolumeClaimTemplate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3216,7 +3188,7 @@ var xxx_messageInfo_PersistentVolumeClaimTemplate proto.InternalMessageInfo func (m *PersistentVolumeClaimVolumeSource) Reset() { *m = PersistentVolumeClaimVolumeSource{} } func (*PersistentVolumeClaimVolumeSource) ProtoMessage() {} func (*PersistentVolumeClaimVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{113} + return fileDescriptor_83c10c24ec417dc9, []int{112} } func (m *PersistentVolumeClaimVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3244,7 +3216,7 @@ var xxx_messageInfo_PersistentVolumeClaimVolumeSource proto.InternalMessageInfo func (m *PersistentVolumeList) Reset() { *m = PersistentVolumeList{} } func (*PersistentVolumeList) ProtoMessage() {} func (*PersistentVolumeList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{114} + return fileDescriptor_83c10c24ec417dc9, []int{113} } func (m *PersistentVolumeList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3272,7 +3244,7 @@ var xxx_messageInfo_PersistentVolumeList proto.InternalMessageInfo func (m *PersistentVolumeSource) Reset() { *m = PersistentVolumeSource{} } func (*PersistentVolumeSource) ProtoMessage() {} func (*PersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{115} + return fileDescriptor_83c10c24ec417dc9, []int{114} } func (m *PersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3300,7 +3272,7 @@ var xxx_messageInfo_PersistentVolumeSource proto.InternalMessageInfo func (m *PersistentVolumeSpec) Reset() { *m = PersistentVolumeSpec{} } func (*PersistentVolumeSpec) ProtoMessage() {} func (*PersistentVolumeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{116} + return fileDescriptor_83c10c24ec417dc9, []int{115} } func (m *PersistentVolumeSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3328,7 +3300,7 @@ var xxx_messageInfo_PersistentVolumeSpec proto.InternalMessageInfo func (m *PersistentVolumeStatus) Reset() { *m = PersistentVolumeStatus{} } func (*PersistentVolumeStatus) ProtoMessage() {} func (*PersistentVolumeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{117} + return fileDescriptor_83c10c24ec417dc9, []int{116} } func (m *PersistentVolumeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3356,7 +3328,7 @@ var xxx_messageInfo_PersistentVolumeStatus proto.InternalMessageInfo func (m *PhotonPersistentDiskVolumeSource) Reset() { *m = PhotonPersistentDiskVolumeSource{} } func (*PhotonPersistentDiskVolumeSource) ProtoMessage() {} func (*PhotonPersistentDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{118} + return fileDescriptor_83c10c24ec417dc9, []int{117} } func (m *PhotonPersistentDiskVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3384,7 +3356,7 @@ var xxx_messageInfo_PhotonPersistentDiskVolumeSource proto.InternalMessageInfo func (m *Pod) Reset() { *m = Pod{} } func (*Pod) ProtoMessage() {} func (*Pod) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{119} + return fileDescriptor_83c10c24ec417dc9, []int{118} } func (m *Pod) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3412,7 +3384,7 @@ var xxx_messageInfo_Pod proto.InternalMessageInfo func (m *PodAffinity) Reset() { *m = PodAffinity{} } func (*PodAffinity) ProtoMessage() {} func (*PodAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{120} + return fileDescriptor_83c10c24ec417dc9, []int{119} } func (m *PodAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3440,7 +3412,7 @@ var xxx_messageInfo_PodAffinity proto.InternalMessageInfo func (m *PodAffinityTerm) Reset() { *m = PodAffinityTerm{} } func (*PodAffinityTerm) ProtoMessage() {} func (*PodAffinityTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{121} + return fileDescriptor_83c10c24ec417dc9, []int{120} } func (m *PodAffinityTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3468,7 +3440,7 @@ var xxx_messageInfo_PodAffinityTerm proto.InternalMessageInfo func (m *PodAntiAffinity) Reset() { *m = PodAntiAffinity{} } func (*PodAntiAffinity) ProtoMessage() {} func (*PodAntiAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{122} + return fileDescriptor_83c10c24ec417dc9, []int{121} } func (m *PodAntiAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3496,7 +3468,7 @@ var xxx_messageInfo_PodAntiAffinity proto.InternalMessageInfo func (m *PodAttachOptions) Reset() { *m = PodAttachOptions{} } func (*PodAttachOptions) ProtoMessage() {} func (*PodAttachOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{123} + return fileDescriptor_83c10c24ec417dc9, []int{122} } func (m *PodAttachOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3524,7 +3496,7 @@ var xxx_messageInfo_PodAttachOptions proto.InternalMessageInfo func (m *PodCondition) Reset() { *m = PodCondition{} } func (*PodCondition) ProtoMessage() {} func (*PodCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{124} + return fileDescriptor_83c10c24ec417dc9, []int{123} } func (m *PodCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3552,7 +3524,7 @@ var xxx_messageInfo_PodCondition proto.InternalMessageInfo func (m *PodDNSConfig) Reset() { *m = PodDNSConfig{} } func (*PodDNSConfig) ProtoMessage() {} func (*PodDNSConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{125} + return fileDescriptor_83c10c24ec417dc9, []int{124} } func (m *PodDNSConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3580,7 +3552,7 @@ var xxx_messageInfo_PodDNSConfig proto.InternalMessageInfo func (m *PodDNSConfigOption) Reset() { *m = PodDNSConfigOption{} } func (*PodDNSConfigOption) ProtoMessage() {} func (*PodDNSConfigOption) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{126} + return fileDescriptor_83c10c24ec417dc9, []int{125} } func (m *PodDNSConfigOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3608,7 +3580,7 @@ var xxx_messageInfo_PodDNSConfigOption proto.InternalMessageInfo func (m *PodExecOptions) Reset() { *m = PodExecOptions{} } func (*PodExecOptions) ProtoMessage() {} func (*PodExecOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{127} + return fileDescriptor_83c10c24ec417dc9, []int{126} } func (m *PodExecOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3636,7 +3608,7 @@ var xxx_messageInfo_PodExecOptions proto.InternalMessageInfo func (m *PodIP) Reset() { *m = PodIP{} } func (*PodIP) ProtoMessage() {} func (*PodIP) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{128} + return fileDescriptor_83c10c24ec417dc9, []int{127} } func (m *PodIP) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3664,7 +3636,7 @@ var xxx_messageInfo_PodIP proto.InternalMessageInfo func (m *PodList) Reset() { *m = PodList{} } func (*PodList) ProtoMessage() {} func (*PodList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{129} + return fileDescriptor_83c10c24ec417dc9, []int{128} } func (m *PodList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3692,7 +3664,7 @@ var xxx_messageInfo_PodList proto.InternalMessageInfo func (m *PodLogOptions) Reset() { *m = PodLogOptions{} } func (*PodLogOptions) ProtoMessage() {} func (*PodLogOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{130} + return fileDescriptor_83c10c24ec417dc9, []int{129} } func (m *PodLogOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3720,7 +3692,7 @@ var xxx_messageInfo_PodLogOptions proto.InternalMessageInfo func (m *PodPortForwardOptions) Reset() { *m = PodPortForwardOptions{} } func (*PodPortForwardOptions) ProtoMessage() {} func (*PodPortForwardOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{131} + return fileDescriptor_83c10c24ec417dc9, []int{130} } func (m *PodPortForwardOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3748,7 +3720,7 @@ var xxx_messageInfo_PodPortForwardOptions proto.InternalMessageInfo func (m *PodProxyOptions) Reset() { *m = PodProxyOptions{} } func (*PodProxyOptions) ProtoMessage() {} func (*PodProxyOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{132} + return fileDescriptor_83c10c24ec417dc9, []int{131} } func (m *PodProxyOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3776,7 +3748,7 @@ var xxx_messageInfo_PodProxyOptions proto.InternalMessageInfo func (m *PodReadinessGate) Reset() { *m = PodReadinessGate{} } func (*PodReadinessGate) ProtoMessage() {} func (*PodReadinessGate) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{133} + return fileDescriptor_83c10c24ec417dc9, []int{132} } func (m *PodReadinessGate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3804,7 +3776,7 @@ var xxx_messageInfo_PodReadinessGate proto.InternalMessageInfo func (m *PodSecurityContext) Reset() { *m = PodSecurityContext{} } func (*PodSecurityContext) ProtoMessage() {} func (*PodSecurityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{134} + return fileDescriptor_83c10c24ec417dc9, []int{133} } func (m *PodSecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3832,7 +3804,7 @@ var xxx_messageInfo_PodSecurityContext proto.InternalMessageInfo func (m *PodSignature) Reset() { *m = PodSignature{} } func (*PodSignature) ProtoMessage() {} func (*PodSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{135} + return fileDescriptor_83c10c24ec417dc9, []int{134} } func (m *PodSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3860,7 +3832,7 @@ var xxx_messageInfo_PodSignature proto.InternalMessageInfo func (m *PodSpec) Reset() { *m = PodSpec{} } func (*PodSpec) ProtoMessage() {} func (*PodSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{136} + return fileDescriptor_83c10c24ec417dc9, []int{135} } func (m *PodSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3888,7 +3860,7 @@ var xxx_messageInfo_PodSpec proto.InternalMessageInfo func (m *PodStatus) Reset() { *m = PodStatus{} } func (*PodStatus) ProtoMessage() {} func (*PodStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{137} + return fileDescriptor_83c10c24ec417dc9, []int{136} } func (m *PodStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3916,7 +3888,7 @@ var xxx_messageInfo_PodStatus proto.InternalMessageInfo func (m *PodStatusResult) Reset() { *m = PodStatusResult{} } func (*PodStatusResult) ProtoMessage() {} func (*PodStatusResult) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{138} + return fileDescriptor_83c10c24ec417dc9, []int{137} } func (m *PodStatusResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3944,7 +3916,7 @@ var xxx_messageInfo_PodStatusResult proto.InternalMessageInfo func (m *PodTemplate) Reset() { *m = PodTemplate{} } func (*PodTemplate) ProtoMessage() {} func (*PodTemplate) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{139} + return fileDescriptor_83c10c24ec417dc9, []int{138} } func (m *PodTemplate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3972,7 +3944,7 @@ var xxx_messageInfo_PodTemplate proto.InternalMessageInfo func (m *PodTemplateList) Reset() { *m = PodTemplateList{} } func (*PodTemplateList) ProtoMessage() {} func (*PodTemplateList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{140} + return fileDescriptor_83c10c24ec417dc9, []int{139} } func (m *PodTemplateList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4000,7 +3972,7 @@ var xxx_messageInfo_PodTemplateList proto.InternalMessageInfo func (m *PodTemplateSpec) Reset() { *m = PodTemplateSpec{} } func (*PodTemplateSpec) ProtoMessage() {} func (*PodTemplateSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{141} + return fileDescriptor_83c10c24ec417dc9, []int{140} } func (m *PodTemplateSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4028,7 +4000,7 @@ var xxx_messageInfo_PodTemplateSpec proto.InternalMessageInfo func (m *PortStatus) Reset() { *m = PortStatus{} } func (*PortStatus) ProtoMessage() {} func (*PortStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{142} + return fileDescriptor_83c10c24ec417dc9, []int{141} } func (m *PortStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4056,7 +4028,7 @@ var xxx_messageInfo_PortStatus proto.InternalMessageInfo func (m *PortworxVolumeSource) Reset() { *m = PortworxVolumeSource{} } func (*PortworxVolumeSource) ProtoMessage() {} func (*PortworxVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{143} + return fileDescriptor_83c10c24ec417dc9, []int{142} } func (m *PortworxVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4084,7 +4056,7 @@ var xxx_messageInfo_PortworxVolumeSource proto.InternalMessageInfo func (m *Preconditions) Reset() { *m = Preconditions{} } func (*Preconditions) ProtoMessage() {} func (*Preconditions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{144} + return fileDescriptor_83c10c24ec417dc9, []int{143} } func (m *Preconditions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4112,7 +4084,7 @@ var xxx_messageInfo_Preconditions proto.InternalMessageInfo func (m *PreferAvoidPodsEntry) Reset() { *m = PreferAvoidPodsEntry{} } func (*PreferAvoidPodsEntry) ProtoMessage() {} func (*PreferAvoidPodsEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{145} + return fileDescriptor_83c10c24ec417dc9, []int{144} } func (m *PreferAvoidPodsEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4140,7 +4112,7 @@ var xxx_messageInfo_PreferAvoidPodsEntry proto.InternalMessageInfo func (m *PreferredSchedulingTerm) Reset() { *m = PreferredSchedulingTerm{} } func (*PreferredSchedulingTerm) ProtoMessage() {} func (*PreferredSchedulingTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{146} + return fileDescriptor_83c10c24ec417dc9, []int{145} } func (m *PreferredSchedulingTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4168,7 +4140,7 @@ var xxx_messageInfo_PreferredSchedulingTerm proto.InternalMessageInfo func (m *Probe) Reset() { *m = Probe{} } func (*Probe) ProtoMessage() {} func (*Probe) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{147} + return fileDescriptor_83c10c24ec417dc9, []int{146} } func (m *Probe) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4196,7 +4168,7 @@ var xxx_messageInfo_Probe proto.InternalMessageInfo func (m *ProjectedVolumeSource) Reset() { *m = ProjectedVolumeSource{} } func (*ProjectedVolumeSource) ProtoMessage() {} func (*ProjectedVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{148} + return fileDescriptor_83c10c24ec417dc9, []int{147} } func (m *ProjectedVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4224,7 +4196,7 @@ var xxx_messageInfo_ProjectedVolumeSource proto.InternalMessageInfo func (m *QuobyteVolumeSource) Reset() { *m = QuobyteVolumeSource{} } func (*QuobyteVolumeSource) ProtoMessage() {} func (*QuobyteVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{149} + return fileDescriptor_83c10c24ec417dc9, []int{148} } func (m *QuobyteVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4252,7 +4224,7 @@ var xxx_messageInfo_QuobyteVolumeSource proto.InternalMessageInfo func (m *RBDPersistentVolumeSource) Reset() { *m = RBDPersistentVolumeSource{} } func (*RBDPersistentVolumeSource) ProtoMessage() {} func (*RBDPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{150} + return fileDescriptor_83c10c24ec417dc9, []int{149} } func (m *RBDPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4280,7 +4252,7 @@ var xxx_messageInfo_RBDPersistentVolumeSource proto.InternalMessageInfo func (m *RBDVolumeSource) Reset() { *m = RBDVolumeSource{} } func (*RBDVolumeSource) ProtoMessage() {} func (*RBDVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{151} + return fileDescriptor_83c10c24ec417dc9, []int{150} } func (m *RBDVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4308,7 +4280,7 @@ var xxx_messageInfo_RBDVolumeSource proto.InternalMessageInfo func (m *RangeAllocation) Reset() { *m = RangeAllocation{} } func (*RangeAllocation) ProtoMessage() {} func (*RangeAllocation) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{152} + return fileDescriptor_83c10c24ec417dc9, []int{151} } func (m *RangeAllocation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4336,7 +4308,7 @@ var xxx_messageInfo_RangeAllocation proto.InternalMessageInfo func (m *ReplicationController) Reset() { *m = ReplicationController{} } func (*ReplicationController) ProtoMessage() {} func (*ReplicationController) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{153} + return fileDescriptor_83c10c24ec417dc9, []int{152} } func (m *ReplicationController) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4364,7 +4336,7 @@ var xxx_messageInfo_ReplicationController proto.InternalMessageInfo func (m *ReplicationControllerCondition) Reset() { *m = ReplicationControllerCondition{} } func (*ReplicationControllerCondition) ProtoMessage() {} func (*ReplicationControllerCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{154} + return fileDescriptor_83c10c24ec417dc9, []int{153} } func (m *ReplicationControllerCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4392,7 +4364,7 @@ var xxx_messageInfo_ReplicationControllerCondition proto.InternalMessageInfo func (m *ReplicationControllerList) Reset() { *m = ReplicationControllerList{} } func (*ReplicationControllerList) ProtoMessage() {} func (*ReplicationControllerList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{155} + return fileDescriptor_83c10c24ec417dc9, []int{154} } func (m *ReplicationControllerList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4420,7 +4392,7 @@ var xxx_messageInfo_ReplicationControllerList proto.InternalMessageInfo func (m *ReplicationControllerSpec) Reset() { *m = ReplicationControllerSpec{} } func (*ReplicationControllerSpec) ProtoMessage() {} func (*ReplicationControllerSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{156} + return fileDescriptor_83c10c24ec417dc9, []int{155} } func (m *ReplicationControllerSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4448,7 +4420,7 @@ var xxx_messageInfo_ReplicationControllerSpec proto.InternalMessageInfo func (m *ReplicationControllerStatus) Reset() { *m = ReplicationControllerStatus{} } func (*ReplicationControllerStatus) ProtoMessage() {} func (*ReplicationControllerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{157} + return fileDescriptor_83c10c24ec417dc9, []int{156} } func (m *ReplicationControllerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4476,7 +4448,7 @@ var xxx_messageInfo_ReplicationControllerStatus proto.InternalMessageInfo func (m *ResourceFieldSelector) Reset() { *m = ResourceFieldSelector{} } func (*ResourceFieldSelector) ProtoMessage() {} func (*ResourceFieldSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{158} + return fileDescriptor_83c10c24ec417dc9, []int{157} } func (m *ResourceFieldSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4504,7 +4476,7 @@ var xxx_messageInfo_ResourceFieldSelector proto.InternalMessageInfo func (m *ResourceQuota) Reset() { *m = ResourceQuota{} } func (*ResourceQuota) ProtoMessage() {} func (*ResourceQuota) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{159} + return fileDescriptor_83c10c24ec417dc9, []int{158} } func (m *ResourceQuota) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4532,7 +4504,7 @@ var xxx_messageInfo_ResourceQuota proto.InternalMessageInfo func (m *ResourceQuotaList) Reset() { *m = ResourceQuotaList{} } func (*ResourceQuotaList) ProtoMessage() {} func (*ResourceQuotaList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{160} + return fileDescriptor_83c10c24ec417dc9, []int{159} } func (m *ResourceQuotaList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4560,7 +4532,7 @@ var xxx_messageInfo_ResourceQuotaList proto.InternalMessageInfo func (m *ResourceQuotaSpec) Reset() { *m = ResourceQuotaSpec{} } func (*ResourceQuotaSpec) ProtoMessage() {} func (*ResourceQuotaSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{161} + return fileDescriptor_83c10c24ec417dc9, []int{160} } func (m *ResourceQuotaSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4588,7 +4560,7 @@ var xxx_messageInfo_ResourceQuotaSpec proto.InternalMessageInfo func (m *ResourceQuotaStatus) Reset() { *m = ResourceQuotaStatus{} } func (*ResourceQuotaStatus) ProtoMessage() {} func (*ResourceQuotaStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{162} + return fileDescriptor_83c10c24ec417dc9, []int{161} } func (m *ResourceQuotaStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4616,7 +4588,7 @@ var xxx_messageInfo_ResourceQuotaStatus proto.InternalMessageInfo func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} } func (*ResourceRequirements) ProtoMessage() {} func (*ResourceRequirements) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{163} + return fileDescriptor_83c10c24ec417dc9, []int{162} } func (m *ResourceRequirements) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4644,7 +4616,7 @@ var xxx_messageInfo_ResourceRequirements proto.InternalMessageInfo func (m *SELinuxOptions) Reset() { *m = SELinuxOptions{} } func (*SELinuxOptions) ProtoMessage() {} func (*SELinuxOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{164} + return fileDescriptor_83c10c24ec417dc9, []int{163} } func (m *SELinuxOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4672,7 +4644,7 @@ var xxx_messageInfo_SELinuxOptions proto.InternalMessageInfo func (m *ScaleIOPersistentVolumeSource) Reset() { *m = ScaleIOPersistentVolumeSource{} } func (*ScaleIOPersistentVolumeSource) ProtoMessage() {} func (*ScaleIOPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{165} + return fileDescriptor_83c10c24ec417dc9, []int{164} } func (m *ScaleIOPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4700,7 +4672,7 @@ var xxx_messageInfo_ScaleIOPersistentVolumeSource proto.InternalMessageInfo func (m *ScaleIOVolumeSource) Reset() { *m = ScaleIOVolumeSource{} } func (*ScaleIOVolumeSource) ProtoMessage() {} func (*ScaleIOVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{166} + return fileDescriptor_83c10c24ec417dc9, []int{165} } func (m *ScaleIOVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4728,7 +4700,7 @@ var xxx_messageInfo_ScaleIOVolumeSource proto.InternalMessageInfo func (m *ScopeSelector) Reset() { *m = ScopeSelector{} } func (*ScopeSelector) ProtoMessage() {} func (*ScopeSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{167} + return fileDescriptor_83c10c24ec417dc9, []int{166} } func (m *ScopeSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4756,7 +4728,7 @@ var xxx_messageInfo_ScopeSelector proto.InternalMessageInfo func (m *ScopedResourceSelectorRequirement) Reset() { *m = ScopedResourceSelectorRequirement{} } func (*ScopedResourceSelectorRequirement) ProtoMessage() {} func (*ScopedResourceSelectorRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{168} + return fileDescriptor_83c10c24ec417dc9, []int{167} } func (m *ScopedResourceSelectorRequirement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4784,7 +4756,7 @@ var xxx_messageInfo_ScopedResourceSelectorRequirement proto.InternalMessageInfo func (m *SeccompProfile) Reset() { *m = SeccompProfile{} } func (*SeccompProfile) ProtoMessage() {} func (*SeccompProfile) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{169} + return fileDescriptor_83c10c24ec417dc9, []int{168} } func (m *SeccompProfile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4812,7 +4784,7 @@ var xxx_messageInfo_SeccompProfile proto.InternalMessageInfo func (m *Secret) Reset() { *m = Secret{} } func (*Secret) ProtoMessage() {} func (*Secret) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{170} + return fileDescriptor_83c10c24ec417dc9, []int{169} } func (m *Secret) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4840,7 +4812,7 @@ var xxx_messageInfo_Secret proto.InternalMessageInfo func (m *SecretEnvSource) Reset() { *m = SecretEnvSource{} } func (*SecretEnvSource) ProtoMessage() {} func (*SecretEnvSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{171} + return fileDescriptor_83c10c24ec417dc9, []int{170} } func (m *SecretEnvSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4868,7 +4840,7 @@ var xxx_messageInfo_SecretEnvSource proto.InternalMessageInfo func (m *SecretKeySelector) Reset() { *m = SecretKeySelector{} } func (*SecretKeySelector) ProtoMessage() {} func (*SecretKeySelector) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{172} + return fileDescriptor_83c10c24ec417dc9, []int{171} } func (m *SecretKeySelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4896,7 +4868,7 @@ var xxx_messageInfo_SecretKeySelector proto.InternalMessageInfo func (m *SecretList) Reset() { *m = SecretList{} } func (*SecretList) ProtoMessage() {} func (*SecretList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{173} + return fileDescriptor_83c10c24ec417dc9, []int{172} } func (m *SecretList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4924,7 +4896,7 @@ var xxx_messageInfo_SecretList proto.InternalMessageInfo func (m *SecretProjection) Reset() { *m = SecretProjection{} } func (*SecretProjection) ProtoMessage() {} func (*SecretProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{174} + return fileDescriptor_83c10c24ec417dc9, []int{173} } func (m *SecretProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4952,7 +4924,7 @@ var xxx_messageInfo_SecretProjection proto.InternalMessageInfo func (m *SecretReference) Reset() { *m = SecretReference{} } func (*SecretReference) ProtoMessage() {} func (*SecretReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{175} + return fileDescriptor_83c10c24ec417dc9, []int{174} } func (m *SecretReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4980,7 +4952,7 @@ var xxx_messageInfo_SecretReference proto.InternalMessageInfo func (m *SecretVolumeSource) Reset() { *m = SecretVolumeSource{} } func (*SecretVolumeSource) ProtoMessage() {} func (*SecretVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{176} + return fileDescriptor_83c10c24ec417dc9, []int{175} } func (m *SecretVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5008,7 +4980,7 @@ var xxx_messageInfo_SecretVolumeSource proto.InternalMessageInfo func (m *SecurityContext) Reset() { *m = SecurityContext{} } func (*SecurityContext) ProtoMessage() {} func (*SecurityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{177} + return fileDescriptor_83c10c24ec417dc9, []int{176} } func (m *SecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5036,7 +5008,7 @@ var xxx_messageInfo_SecurityContext proto.InternalMessageInfo func (m *SerializedReference) Reset() { *m = SerializedReference{} } func (*SerializedReference) ProtoMessage() {} func (*SerializedReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{178} + return fileDescriptor_83c10c24ec417dc9, []int{177} } func (m *SerializedReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5064,7 +5036,7 @@ var xxx_messageInfo_SerializedReference proto.InternalMessageInfo func (m *Service) Reset() { *m = Service{} } func (*Service) ProtoMessage() {} func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{179} + return fileDescriptor_83c10c24ec417dc9, []int{178} } func (m *Service) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5092,7 +5064,7 @@ var xxx_messageInfo_Service proto.InternalMessageInfo func (m *ServiceAccount) Reset() { *m = ServiceAccount{} } func (*ServiceAccount) ProtoMessage() {} func (*ServiceAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{180} + return fileDescriptor_83c10c24ec417dc9, []int{179} } func (m *ServiceAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5120,7 +5092,7 @@ var xxx_messageInfo_ServiceAccount proto.InternalMessageInfo func (m *ServiceAccountList) Reset() { *m = ServiceAccountList{} } func (*ServiceAccountList) ProtoMessage() {} func (*ServiceAccountList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{181} + return fileDescriptor_83c10c24ec417dc9, []int{180} } func (m *ServiceAccountList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5148,7 +5120,7 @@ var xxx_messageInfo_ServiceAccountList proto.InternalMessageInfo func (m *ServiceAccountTokenProjection) Reset() { *m = ServiceAccountTokenProjection{} } func (*ServiceAccountTokenProjection) ProtoMessage() {} func (*ServiceAccountTokenProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{182} + return fileDescriptor_83c10c24ec417dc9, []int{181} } func (m *ServiceAccountTokenProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5176,7 +5148,7 @@ var xxx_messageInfo_ServiceAccountTokenProjection proto.InternalMessageInfo func (m *ServiceList) Reset() { *m = ServiceList{} } func (*ServiceList) ProtoMessage() {} func (*ServiceList) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{183} + return fileDescriptor_83c10c24ec417dc9, []int{182} } func (m *ServiceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5204,7 +5176,7 @@ var xxx_messageInfo_ServiceList proto.InternalMessageInfo func (m *ServicePort) Reset() { *m = ServicePort{} } func (*ServicePort) ProtoMessage() {} func (*ServicePort) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{184} + return fileDescriptor_83c10c24ec417dc9, []int{183} } func (m *ServicePort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5232,7 +5204,7 @@ var xxx_messageInfo_ServicePort proto.InternalMessageInfo func (m *ServiceProxyOptions) Reset() { *m = ServiceProxyOptions{} } func (*ServiceProxyOptions) ProtoMessage() {} func (*ServiceProxyOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{185} + return fileDescriptor_83c10c24ec417dc9, []int{184} } func (m *ServiceProxyOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5260,7 +5232,7 @@ var xxx_messageInfo_ServiceProxyOptions proto.InternalMessageInfo func (m *ServiceSpec) Reset() { *m = ServiceSpec{} } func (*ServiceSpec) ProtoMessage() {} func (*ServiceSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{186} + return fileDescriptor_83c10c24ec417dc9, []int{185} } func (m *ServiceSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5288,7 +5260,7 @@ var xxx_messageInfo_ServiceSpec proto.InternalMessageInfo func (m *ServiceStatus) Reset() { *m = ServiceStatus{} } func (*ServiceStatus) ProtoMessage() {} func (*ServiceStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{187} + return fileDescriptor_83c10c24ec417dc9, []int{186} } func (m *ServiceStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5316,7 +5288,7 @@ var xxx_messageInfo_ServiceStatus proto.InternalMessageInfo func (m *SessionAffinityConfig) Reset() { *m = SessionAffinityConfig{} } func (*SessionAffinityConfig) ProtoMessage() {} func (*SessionAffinityConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{188} + return fileDescriptor_83c10c24ec417dc9, []int{187} } func (m *SessionAffinityConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5344,7 +5316,7 @@ var xxx_messageInfo_SessionAffinityConfig proto.InternalMessageInfo func (m *StorageOSPersistentVolumeSource) Reset() { *m = StorageOSPersistentVolumeSource{} } func (*StorageOSPersistentVolumeSource) ProtoMessage() {} func (*StorageOSPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{189} + return fileDescriptor_83c10c24ec417dc9, []int{188} } func (m *StorageOSPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5372,7 +5344,7 @@ var xxx_messageInfo_StorageOSPersistentVolumeSource proto.InternalMessageInfo func (m *StorageOSVolumeSource) Reset() { *m = StorageOSVolumeSource{} } func (*StorageOSVolumeSource) ProtoMessage() {} func (*StorageOSVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{190} + return fileDescriptor_83c10c24ec417dc9, []int{189} } func (m *StorageOSVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5400,7 +5372,7 @@ var xxx_messageInfo_StorageOSVolumeSource proto.InternalMessageInfo func (m *Sysctl) Reset() { *m = Sysctl{} } func (*Sysctl) ProtoMessage() {} func (*Sysctl) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{191} + return fileDescriptor_83c10c24ec417dc9, []int{190} } func (m *Sysctl) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5428,7 +5400,7 @@ var xxx_messageInfo_Sysctl proto.InternalMessageInfo func (m *TCPSocketAction) Reset() { *m = TCPSocketAction{} } func (*TCPSocketAction) ProtoMessage() {} func (*TCPSocketAction) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{192} + return fileDescriptor_83c10c24ec417dc9, []int{191} } func (m *TCPSocketAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5456,7 +5428,7 @@ var xxx_messageInfo_TCPSocketAction proto.InternalMessageInfo func (m *Taint) Reset() { *m = Taint{} } func (*Taint) ProtoMessage() {} func (*Taint) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{193} + return fileDescriptor_83c10c24ec417dc9, []int{192} } func (m *Taint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5484,7 +5456,7 @@ var xxx_messageInfo_Taint proto.InternalMessageInfo func (m *Toleration) Reset() { *m = Toleration{} } func (*Toleration) ProtoMessage() {} func (*Toleration) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{194} + return fileDescriptor_83c10c24ec417dc9, []int{193} } func (m *Toleration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5512,7 +5484,7 @@ var xxx_messageInfo_Toleration proto.InternalMessageInfo func (m *TopologySelectorLabelRequirement) Reset() { *m = TopologySelectorLabelRequirement{} } func (*TopologySelectorLabelRequirement) ProtoMessage() {} func (*TopologySelectorLabelRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{195} + return fileDescriptor_83c10c24ec417dc9, []int{194} } func (m *TopologySelectorLabelRequirement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5540,7 +5512,7 @@ var xxx_messageInfo_TopologySelectorLabelRequirement proto.InternalMessageInfo func (m *TopologySelectorTerm) Reset() { *m = TopologySelectorTerm{} } func (*TopologySelectorTerm) ProtoMessage() {} func (*TopologySelectorTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{196} + return fileDescriptor_83c10c24ec417dc9, []int{195} } func (m *TopologySelectorTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5568,7 +5540,7 @@ var xxx_messageInfo_TopologySelectorTerm proto.InternalMessageInfo func (m *TopologySpreadConstraint) Reset() { *m = TopologySpreadConstraint{} } func (*TopologySpreadConstraint) ProtoMessage() {} func (*TopologySpreadConstraint) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{197} + return fileDescriptor_83c10c24ec417dc9, []int{196} } func (m *TopologySpreadConstraint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5596,7 +5568,7 @@ var xxx_messageInfo_TopologySpreadConstraint proto.InternalMessageInfo func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} } func (*TypedLocalObjectReference) ProtoMessage() {} func (*TypedLocalObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{198} + return fileDescriptor_83c10c24ec417dc9, []int{197} } func (m *TypedLocalObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5624,7 +5596,7 @@ var xxx_messageInfo_TypedLocalObjectReference proto.InternalMessageInfo func (m *Volume) Reset() { *m = Volume{} } func (*Volume) ProtoMessage() {} func (*Volume) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{199} + return fileDescriptor_83c10c24ec417dc9, []int{198} } func (m *Volume) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5652,7 +5624,7 @@ var xxx_messageInfo_Volume proto.InternalMessageInfo func (m *VolumeDevice) Reset() { *m = VolumeDevice{} } func (*VolumeDevice) ProtoMessage() {} func (*VolumeDevice) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{200} + return fileDescriptor_83c10c24ec417dc9, []int{199} } func (m *VolumeDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5680,7 +5652,7 @@ var xxx_messageInfo_VolumeDevice proto.InternalMessageInfo func (m *VolumeMount) Reset() { *m = VolumeMount{} } func (*VolumeMount) ProtoMessage() {} func (*VolumeMount) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{201} + return fileDescriptor_83c10c24ec417dc9, []int{200} } func (m *VolumeMount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5708,7 +5680,7 @@ var xxx_messageInfo_VolumeMount proto.InternalMessageInfo func (m *VolumeNodeAffinity) Reset() { *m = VolumeNodeAffinity{} } func (*VolumeNodeAffinity) ProtoMessage() {} func (*VolumeNodeAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{202} + return fileDescriptor_83c10c24ec417dc9, []int{201} } func (m *VolumeNodeAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5736,7 +5708,7 @@ var xxx_messageInfo_VolumeNodeAffinity proto.InternalMessageInfo func (m *VolumeProjection) Reset() { *m = VolumeProjection{} } func (*VolumeProjection) ProtoMessage() {} func (*VolumeProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{203} + return fileDescriptor_83c10c24ec417dc9, []int{202} } func (m *VolumeProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5764,7 +5736,7 @@ var xxx_messageInfo_VolumeProjection proto.InternalMessageInfo func (m *VolumeSource) Reset() { *m = VolumeSource{} } func (*VolumeSource) ProtoMessage() {} func (*VolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{204} + return fileDescriptor_83c10c24ec417dc9, []int{203} } func (m *VolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5792,7 +5764,7 @@ var xxx_messageInfo_VolumeSource proto.InternalMessageInfo func (m *VsphereVirtualDiskVolumeSource) Reset() { *m = VsphereVirtualDiskVolumeSource{} } func (*VsphereVirtualDiskVolumeSource) ProtoMessage() {} func (*VsphereVirtualDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{205} + return fileDescriptor_83c10c24ec417dc9, []int{204} } func (m *VsphereVirtualDiskVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5820,7 +5792,7 @@ var xxx_messageInfo_VsphereVirtualDiskVolumeSource proto.InternalMessageInfo func (m *WeightedPodAffinityTerm) Reset() { *m = WeightedPodAffinityTerm{} } func (*WeightedPodAffinityTerm) ProtoMessage() {} func (*WeightedPodAffinityTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{206} + return fileDescriptor_83c10c24ec417dc9, []int{205} } func (m *WeightedPodAffinityTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5848,7 +5820,7 @@ var xxx_messageInfo_WeightedPodAffinityTerm proto.InternalMessageInfo func (m *WindowsSecurityContextOptions) Reset() { *m = WindowsSecurityContextOptions{} } func (*WindowsSecurityContextOptions) ProtoMessage() {} func (*WindowsSecurityContextOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_83c10c24ec417dc9, []int{207} + return fileDescriptor_83c10c24ec417dc9, []int{206} } func (m *WindowsSecurityContextOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5927,7 +5899,6 @@ func init() { proto.RegisterType((*EnvVarSource)(nil), "k8s.io.api.core.v1.EnvVarSource") proto.RegisterType((*EphemeralContainer)(nil), "k8s.io.api.core.v1.EphemeralContainer") proto.RegisterType((*EphemeralContainerCommon)(nil), "k8s.io.api.core.v1.EphemeralContainerCommon") - proto.RegisterType((*EphemeralContainers)(nil), "k8s.io.api.core.v1.EphemeralContainers") proto.RegisterType((*EphemeralVolumeSource)(nil), "k8s.io.api.core.v1.EphemeralVolumeSource") proto.RegisterType((*Event)(nil), "k8s.io.api.core.v1.Event") proto.RegisterType((*EventList)(nil), "k8s.io.api.core.v1.EventList") @@ -6116,886 +6087,885 @@ func init() { } var fileDescriptor_83c10c24ec417dc9 = []byte{ - // 14061 bytes of a gzipped FileDescriptorProto + // 14043 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x6b, 0x70, 0x1c, 0xd9, 0x75, 0x18, 0xac, 0x9e, 0xc1, 0x6b, 0x0e, 0xde, 0x17, 0x24, 0x17, 0xc4, 0x2e, 0x09, 0x6e, 0x53, 0xe2, 0x72, 0xb5, 0xbb, 0xa0, 0xb8, 0x0f, 0x69, 0xbd, 0x2b, 0xad, 0x05, 0x60, 0x00, 0x72, 0x96, 0x04, 0x38, 0x7b, 0x07, 0x24, 0x25, 0x79, 0xa5, 0x52, 0x63, 0xe6, 0x02, 0x68, 0x61, 0xa6, 0x7b, - 0xb6, 0xbb, 0x07, 0x24, 0xf6, 0x93, 0xeb, 0xf3, 0x27, 0x3f, 0xe5, 0xc7, 0x57, 0xaa, 0x94, 0x2b, - 0x0f, 0xdb, 0xe5, 0x4a, 0x39, 0x4e, 0xd9, 0x8a, 0x93, 0x54, 0x1c, 0x3b, 0xb6, 0x63, 0x39, 0xb1, - 0x13, 0xe7, 0xe1, 0xe4, 0x87, 0xe3, 0xb8, 0x12, 0xcb, 0x55, 0xae, 0x20, 0x36, 0x9d, 0x94, 0x4b, - 0x3f, 0x62, 0x3b, 0xb1, 0xf3, 0x23, 0x88, 0x2b, 0x4e, 0xdd, 0x67, 0xdf, 0xdb, 0x8f, 0x99, 0x01, - 0x17, 0x84, 0x56, 0xaa, 0xfd, 0x37, 0x73, 0xcf, 0xb9, 0xe7, 0xde, 0xbe, 0xcf, 0x73, 0xcf, 0x13, - 0x5e, 0xdd, 0x7d, 0x39, 0x5c, 0x70, 0xfd, 0x2b, 0xbb, 0x9d, 0x4d, 0x12, 0x78, 0x24, 0x22, 0xe1, - 0x95, 0x3d, 0xe2, 0x35, 0xfc, 0xe0, 0x8a, 0x00, 0x38, 0x6d, 0xf7, 0x4a, 0xdd, 0x0f, 0xc8, 0x95, - 0xbd, 0xab, 0x57, 0xb6, 0x89, 0x47, 0x02, 0x27, 0x22, 0x8d, 0x85, 0x76, 0xe0, 0x47, 0x3e, 0x42, - 0x1c, 0x67, 0xc1, 0x69, 0xbb, 0x0b, 0x14, 0x67, 0x61, 0xef, 0xea, 0xdc, 0x73, 0xdb, 0x6e, 0xb4, - 0xd3, 0xd9, 0x5c, 0xa8, 0xfb, 0xad, 0x2b, 0xdb, 0xfe, 0xb6, 0x7f, 0x85, 0xa1, 0x6e, 0x76, 0xb6, - 0xd8, 0x3f, 0xf6, 0x87, 0xfd, 0xe2, 0x24, 0xe6, 0x5e, 0x8c, 0x9b, 0x69, 0x39, 0xf5, 0x1d, 0xd7, - 0x23, 0xc1, 0xfe, 0x95, 0xf6, 0xee, 0x36, 0x6b, 0x37, 0x20, 0xa1, 0xdf, 0x09, 0xea, 0x24, 0xd9, - 0x70, 0xd7, 0x5a, 0xe1, 0x95, 0x16, 0x89, 0x9c, 0x8c, 0xee, 0xce, 0x5d, 0xc9, 0xab, 0x15, 0x74, - 0xbc, 0xc8, 0x6d, 0xa5, 0x9b, 0xf9, 0x70, 0xaf, 0x0a, 0x61, 0x7d, 0x87, 0xb4, 0x9c, 0x54, 0xbd, - 0x17, 0xf2, 0xea, 0x75, 0x22, 0xb7, 0x79, 0xc5, 0xf5, 0xa2, 0x30, 0x0a, 0x92, 0x95, 0xec, 0xaf, - 0x5a, 0x70, 0x61, 0xf1, 0x6e, 0x6d, 0xa5, 0xe9, 0x84, 0x91, 0x5b, 0x5f, 0x6a, 0xfa, 0xf5, 0xdd, - 0x5a, 0xe4, 0x07, 0xe4, 0x8e, 0xdf, 0xec, 0xb4, 0x48, 0x8d, 0x0d, 0x04, 0x7a, 0x16, 0x46, 0xf6, - 0xd8, 0xff, 0x4a, 0x79, 0xd6, 0xba, 0x60, 0x5d, 0x2e, 0x2d, 0x4d, 0xfd, 0xc6, 0xc1, 0xfc, 0xfb, - 0x1e, 0x1c, 0xcc, 0x8f, 0xdc, 0x11, 0xe5, 0x58, 0x61, 0xa0, 0x4b, 0x30, 0xb4, 0x15, 0x6e, 0xec, - 0xb7, 0xc9, 0x6c, 0x81, 0xe1, 0x4e, 0x08, 0xdc, 0xa1, 0xd5, 0x1a, 0x2d, 0xc5, 0x02, 0x8a, 0xae, - 0x40, 0xa9, 0xed, 0x04, 0x91, 0x1b, 0xb9, 0xbe, 0x37, 0x5b, 0xbc, 0x60, 0x5d, 0x1e, 0x5c, 0x9a, - 0x16, 0xa8, 0xa5, 0xaa, 0x04, 0xe0, 0x18, 0x87, 0x76, 0x23, 0x20, 0x4e, 0xe3, 0x96, 0xd7, 0xdc, - 0x9f, 0x1d, 0xb8, 0x60, 0x5d, 0x1e, 0x89, 0xbb, 0x81, 0x45, 0x39, 0x56, 0x18, 0xf6, 0x8f, 0x14, - 0x60, 0x64, 0x71, 0x6b, 0xcb, 0xf5, 0xdc, 0x68, 0x1f, 0xdd, 0x81, 0x31, 0xcf, 0x6f, 0x10, 0xf9, - 0x9f, 0x7d, 0xc5, 0xe8, 0xf3, 0x17, 0x16, 0xd2, 0x4b, 0x69, 0x61, 0x5d, 0xc3, 0x5b, 0x9a, 0x7a, - 0x70, 0x30, 0x3f, 0xa6, 0x97, 0x60, 0x83, 0x0e, 0xc2, 0x30, 0xda, 0xf6, 0x1b, 0x8a, 0x6c, 0x81, - 0x91, 0x9d, 0xcf, 0x22, 0x5b, 0x8d, 0xd1, 0x96, 0x26, 0x1f, 0x1c, 0xcc, 0x8f, 0x6a, 0x05, 0x58, - 0x27, 0x82, 0x36, 0x61, 0x92, 0xfe, 0xf5, 0x22, 0x57, 0xd1, 0x2d, 0x32, 0xba, 0x17, 0xf3, 0xe8, - 0x6a, 0xa8, 0x4b, 0x33, 0x0f, 0x0e, 0xe6, 0x27, 0x13, 0x85, 0x38, 0x49, 0xd0, 0x7e, 0x1b, 0x26, - 0x16, 0xa3, 0xc8, 0xa9, 0xef, 0x90, 0x06, 0x9f, 0x41, 0xf4, 0x22, 0x0c, 0x78, 0x4e, 0x8b, 0x88, - 0xf9, 0xbd, 0x20, 0x06, 0x76, 0x60, 0xdd, 0x69, 0x91, 0xc3, 0x83, 0xf9, 0xa9, 0xdb, 0x9e, 0xfb, - 0x56, 0x47, 0xac, 0x0a, 0x5a, 0x86, 0x19, 0x36, 0x7a, 0x1e, 0xa0, 0x41, 0xf6, 0xdc, 0x3a, 0xa9, - 0x3a, 0xd1, 0x8e, 0x98, 0x6f, 0x24, 0xea, 0x42, 0x59, 0x41, 0xb0, 0x86, 0x65, 0xdf, 0x87, 0xd2, - 0xe2, 0x9e, 0xef, 0x36, 0xaa, 0x7e, 0x23, 0x44, 0xbb, 0x30, 0xd9, 0x0e, 0xc8, 0x16, 0x09, 0x54, - 0xd1, 0xac, 0x75, 0xa1, 0x78, 0x79, 0xf4, 0xf9, 0xcb, 0x99, 0x1f, 0x6b, 0xa2, 0xae, 0x78, 0x51, - 0xb0, 0xbf, 0xf4, 0x98, 0x68, 0x6f, 0x32, 0x01, 0xc5, 0x49, 0xca, 0xf6, 0xbf, 0x28, 0xc0, 0xe9, - 0xc5, 0xb7, 0x3b, 0x01, 0x29, 0xbb, 0xe1, 0x6e, 0x72, 0x85, 0x37, 0xdc, 0x70, 0x77, 0x3d, 0x1e, - 0x01, 0xb5, 0xb4, 0xca, 0xa2, 0x1c, 0x2b, 0x0c, 0xf4, 0x1c, 0x0c, 0xd3, 0xdf, 0xb7, 0x71, 0x45, - 0x7c, 0xf2, 0x8c, 0x40, 0x1e, 0x2d, 0x3b, 0x91, 0x53, 0xe6, 0x20, 0x2c, 0x71, 0xd0, 0x1a, 0x8c, - 0xd6, 0xd9, 0x86, 0xdc, 0x5e, 0xf3, 0x1b, 0x84, 0x4d, 0x66, 0x69, 0xe9, 0x19, 0x8a, 0xbe, 0x1c, - 0x17, 0x1f, 0x1e, 0xcc, 0xcf, 0xf2, 0xbe, 0x09, 0x12, 0x1a, 0x0c, 0xeb, 0xf5, 0x91, 0xad, 0xf6, - 0xd7, 0x00, 0xa3, 0x04, 0x19, 0x7b, 0xeb, 0xb2, 0xb6, 0x55, 0x06, 0xd9, 0x56, 0x19, 0xcb, 0xde, - 0x26, 0xe8, 0x2a, 0x0c, 0xec, 0xba, 0x5e, 0x63, 0x76, 0x88, 0xd1, 0x3a, 0x47, 0xe7, 0xfc, 0x86, - 0xeb, 0x35, 0x0e, 0x0f, 0xe6, 0xa7, 0x8d, 0xee, 0xd0, 0x42, 0xcc, 0x50, 0xed, 0x3f, 0xb3, 0x60, - 0x9e, 0xc1, 0x56, 0xdd, 0x26, 0xa9, 0x92, 0x20, 0x74, 0xc3, 0x88, 0x78, 0x91, 0x31, 0xa0, 0xcf, - 0x03, 0x84, 0xa4, 0x1e, 0x90, 0x48, 0x1b, 0x52, 0xb5, 0x30, 0x6a, 0x0a, 0x82, 0x35, 0x2c, 0x7a, - 0x20, 0x84, 0x3b, 0x4e, 0xc0, 0xd6, 0x97, 0x18, 0x58, 0x75, 0x20, 0xd4, 0x24, 0x00, 0xc7, 0x38, - 0xc6, 0x81, 0x50, 0xec, 0x75, 0x20, 0xa0, 0x8f, 0xc1, 0x64, 0xdc, 0x58, 0xd8, 0x76, 0xea, 0x72, - 0x00, 0xd9, 0x96, 0xa9, 0x99, 0x20, 0x9c, 0xc4, 0xb5, 0xff, 0x8e, 0x25, 0x16, 0x0f, 0xfd, 0xea, - 0x77, 0xf9, 0xb7, 0xda, 0xbf, 0x64, 0xc1, 0xf0, 0x92, 0xeb, 0x35, 0x5c, 0x6f, 0x1b, 0x7d, 0x16, - 0x46, 0xe8, 0xdd, 0xd4, 0x70, 0x22, 0x47, 0x9c, 0x7b, 0x1f, 0xd2, 0xf6, 0x96, 0xba, 0x2a, 0x16, - 0xda, 0xbb, 0xdb, 0xb4, 0x20, 0x5c, 0xa0, 0xd8, 0x74, 0xb7, 0xdd, 0xda, 0xfc, 0x1c, 0xa9, 0x47, - 0x6b, 0x24, 0x72, 0xe2, 0xcf, 0x89, 0xcb, 0xb0, 0xa2, 0x8a, 0x6e, 0xc0, 0x50, 0xe4, 0x04, 0xdb, - 0x24, 0x12, 0x07, 0x60, 0xe6, 0x41, 0xc5, 0x6b, 0x62, 0xba, 0x23, 0x89, 0x57, 0x27, 0xf1, 0xb5, - 0xb0, 0xc1, 0xaa, 0x62, 0x41, 0xc2, 0xfe, 0xa1, 0x61, 0x38, 0xbb, 0x5c, 0xab, 0xe4, 0xac, 0xab, - 0x4b, 0x30, 0xd4, 0x08, 0xdc, 0x3d, 0x12, 0x88, 0x71, 0x56, 0x54, 0xca, 0xac, 0x14, 0x0b, 0x28, - 0x7a, 0x19, 0xc6, 0xf8, 0x85, 0x74, 0xdd, 0xf1, 0x1a, 0x4d, 0x39, 0xc4, 0xa7, 0x04, 0xf6, 0xd8, - 0x1d, 0x0d, 0x86, 0x0d, 0xcc, 0x23, 0x2e, 0xaa, 0x4b, 0x89, 0xcd, 0x98, 0x77, 0xd9, 0x7d, 0xd1, - 0x82, 0x29, 0xde, 0xcc, 0x62, 0x14, 0x05, 0xee, 0x66, 0x27, 0x22, 0xe1, 0xec, 0x20, 0x3b, 0xe9, - 0x96, 0xb3, 0x46, 0x2b, 0x77, 0x04, 0x16, 0xee, 0x24, 0xa8, 0xf0, 0x43, 0x70, 0x56, 0xb4, 0x3b, - 0x95, 0x04, 0xe3, 0x54, 0xb3, 0xe8, 0x3b, 0x2d, 0x98, 0xab, 0xfb, 0x5e, 0x14, 0xf8, 0xcd, 0x26, - 0x09, 0xaa, 0x9d, 0xcd, 0xa6, 0x1b, 0xee, 0xf0, 0x75, 0x8a, 0xc9, 0x16, 0x3b, 0x09, 0x72, 0xe6, - 0x50, 0x21, 0x89, 0x39, 0x3c, 0xff, 0xe0, 0x60, 0x7e, 0x6e, 0x39, 0x97, 0x14, 0xee, 0xd2, 0x0c, - 0xda, 0x05, 0x44, 0xaf, 0xd2, 0x5a, 0xe4, 0x6c, 0x93, 0xb8, 0xf1, 0xe1, 0xfe, 0x1b, 0x3f, 0xf3, - 0xe0, 0x60, 0x1e, 0xad, 0xa7, 0x48, 0xe0, 0x0c, 0xb2, 0xe8, 0x2d, 0x38, 0x45, 0x4b, 0x53, 0xdf, - 0x3a, 0xd2, 0x7f, 0x73, 0xb3, 0x0f, 0x0e, 0xe6, 0x4f, 0xad, 0x67, 0x10, 0xc1, 0x99, 0xa4, 0xd1, - 0x77, 0x58, 0x70, 0x36, 0xfe, 0xfc, 0x95, 0xfb, 0x6d, 0xc7, 0x6b, 0xc4, 0x0d, 0x97, 0xfa, 0x6f, - 0x98, 0x9e, 0xc9, 0x67, 0x97, 0xf3, 0x28, 0xe1, 0xfc, 0x46, 0xe6, 0x96, 0xe1, 0x74, 0xe6, 0x6a, - 0x41, 0x53, 0x50, 0xdc, 0x25, 0x9c, 0x0b, 0x2a, 0x61, 0xfa, 0x13, 0x9d, 0x82, 0xc1, 0x3d, 0xa7, - 0xd9, 0x11, 0x1b, 0x05, 0xf3, 0x3f, 0xaf, 0x14, 0x5e, 0xb6, 0xec, 0x7f, 0x59, 0x84, 0xc9, 0xe5, - 0x5a, 0xe5, 0xa1, 0x76, 0xa1, 0x7e, 0x0d, 0x15, 0xba, 0x5e, 0x43, 0xf1, 0xa5, 0x56, 0xcc, 0xbd, - 0xd4, 0xfe, 0xdf, 0x8c, 0x2d, 0x34, 0xc0, 0xb6, 0xd0, 0xb7, 0xe4, 0x6c, 0xa1, 0x63, 0xde, 0x38, - 0x7b, 0x39, 0xab, 0x68, 0x90, 0x4d, 0x66, 0x26, 0xc7, 0x72, 0xd3, 0xaf, 0x3b, 0xcd, 0xe4, 0xd1, - 0x77, 0xc4, 0xa5, 0x74, 0x3c, 0xf3, 0x58, 0x87, 0xb1, 0x65, 0xa7, 0xed, 0x6c, 0xba, 0x4d, 0x37, - 0x72, 0x49, 0x88, 0x9e, 0x82, 0xa2, 0xd3, 0x68, 0x30, 0x6e, 0xab, 0xb4, 0x74, 0xfa, 0xc1, 0xc1, - 0x7c, 0x71, 0xb1, 0x41, 0xaf, 0x7d, 0x50, 0x58, 0xfb, 0x98, 0x62, 0xa0, 0x0f, 0xc2, 0x40, 0x23, - 0xf0, 0xdb, 0xb3, 0x05, 0x86, 0x49, 0x77, 0xdd, 0x40, 0x39, 0xf0, 0xdb, 0x09, 0x54, 0x86, 0x63, - 0xff, 0x5a, 0x01, 0x9e, 0x58, 0x26, 0xed, 0x9d, 0xd5, 0x5a, 0xce, 0xf9, 0x7d, 0x19, 0x46, 0x5a, - 0xbe, 0xe7, 0x46, 0x7e, 0x10, 0x8a, 0xa6, 0xd9, 0x8a, 0x58, 0x13, 0x65, 0x58, 0x41, 0xd1, 0x05, - 0x18, 0x68, 0xc7, 0x4c, 0xe5, 0x98, 0x64, 0x48, 0x19, 0x3b, 0xc9, 0x20, 0x14, 0xa3, 0x13, 0x92, - 0x40, 0xac, 0x18, 0x85, 0x71, 0x3b, 0x24, 0x01, 0x66, 0x90, 0xf8, 0x66, 0xa6, 0x77, 0xb6, 0x38, - 0xa1, 0x13, 0x37, 0x33, 0x85, 0x60, 0x0d, 0x0b, 0x55, 0xa1, 0x14, 0x26, 0x66, 0xb6, 0xaf, 0x6d, - 0x3a, 0xce, 0xae, 0x6e, 0x35, 0x93, 0x31, 0x11, 0xe3, 0x46, 0x19, 0xea, 0x79, 0x75, 0x7f, 0xa5, - 0x00, 0x88, 0x0f, 0xe1, 0x37, 0xd8, 0xc0, 0xdd, 0x4e, 0x0f, 0x5c, 0xff, 0x5b, 0xe2, 0xb8, 0x46, - 0xef, 0xcf, 0x2d, 0x78, 0x62, 0xd9, 0xf5, 0x1a, 0x24, 0xc8, 0x59, 0x80, 0x8f, 0xe6, 0x2d, 0x7b, - 0x34, 0xa6, 0xc1, 0x58, 0x62, 0x03, 0xc7, 0xb0, 0xc4, 0xec, 0x3f, 0xb1, 0x00, 0xf1, 0xcf, 0x7e, - 0xd7, 0x7d, 0xec, 0xed, 0xf4, 0xc7, 0x1e, 0xc3, 0xb2, 0xb0, 0x6f, 0xc2, 0xc4, 0x72, 0xd3, 0x25, - 0x5e, 0x54, 0xa9, 0x2e, 0xfb, 0xde, 0x96, 0xbb, 0x8d, 0x5e, 0x81, 0x89, 0xc8, 0x6d, 0x11, 0xbf, - 0x13, 0xd5, 0x48, 0xdd, 0xf7, 0xd8, 0x4b, 0xd2, 0xba, 0x3c, 0xb8, 0x84, 0x1e, 0x1c, 0xcc, 0x4f, - 0x6c, 0x18, 0x10, 0x9c, 0xc0, 0xb4, 0x7f, 0x8f, 0x8e, 0x9f, 0xdf, 0x6a, 0xfb, 0x1e, 0xf1, 0xa2, - 0x65, 0xdf, 0x6b, 0x70, 0x89, 0xc3, 0x2b, 0x30, 0x10, 0xd1, 0xf1, 0xe0, 0x63, 0x77, 0x49, 0x6e, - 0x14, 0x3a, 0x0a, 0x87, 0x07, 0xf3, 0x67, 0xd2, 0x35, 0xd8, 0x38, 0xb1, 0x3a, 0xe8, 0x5b, 0x60, - 0x28, 0x8c, 0x9c, 0xa8, 0x13, 0x8a, 0xd1, 0x7c, 0x52, 0x8e, 0x66, 0x8d, 0x95, 0x1e, 0x1e, 0xcc, - 0x4f, 0xaa, 0x6a, 0xbc, 0x08, 0x8b, 0x0a, 0xe8, 0x69, 0x18, 0x6e, 0x91, 0x30, 0x74, 0xb6, 0xe5, - 0x6d, 0x38, 0x29, 0xea, 0x0e, 0xaf, 0xf1, 0x62, 0x2c, 0xe1, 0xe8, 0x22, 0x0c, 0x92, 0x20, 0xf0, - 0x03, 0xb1, 0x47, 0xc7, 0x05, 0xe2, 0xe0, 0x0a, 0x2d, 0xc4, 0x1c, 0x66, 0xff, 0x3b, 0x0b, 0x26, - 0x55, 0x5f, 0x79, 0x5b, 0x27, 0xf0, 0x2a, 0xf8, 0x14, 0x40, 0x5d, 0x7e, 0x60, 0xc8, 0x6e, 0x8f, - 0xd1, 0xe7, 0x2f, 0x65, 0x5e, 0xd4, 0xa9, 0x61, 0x8c, 0x29, 0xab, 0xa2, 0x10, 0x6b, 0xd4, 0xec, - 0x7f, 0x62, 0xc1, 0x4c, 0xe2, 0x8b, 0x6e, 0xba, 0x61, 0x84, 0xde, 0x4c, 0x7d, 0xd5, 0x42, 0x7f, - 0x5f, 0x45, 0x6b, 0xb3, 0x6f, 0x52, 0x4b, 0x59, 0x96, 0x68, 0x5f, 0x74, 0x1d, 0x06, 0xdd, 0x88, - 0xb4, 0xe4, 0xc7, 0x5c, 0xec, 0xfa, 0x31, 0xbc, 0x57, 0xf1, 0x8c, 0x54, 0x68, 0x4d, 0xcc, 0x09, - 0xd8, 0xbf, 0x56, 0x84, 0x12, 0x5f, 0xb6, 0x6b, 0x4e, 0xfb, 0x04, 0xe6, 0xe2, 0x19, 0x28, 0xb9, - 0xad, 0x56, 0x27, 0x72, 0x36, 0xc5, 0x71, 0x3e, 0xc2, 0xb7, 0x56, 0x45, 0x16, 0xe2, 0x18, 0x8e, - 0x2a, 0x30, 0xc0, 0xba, 0xc2, 0xbf, 0xf2, 0xa9, 0xec, 0xaf, 0x14, 0x7d, 0x5f, 0x28, 0x3b, 0x91, - 0xc3, 0x39, 0x29, 0x75, 0x8f, 0xd0, 0x22, 0xcc, 0x48, 0x20, 0x07, 0x60, 0xd3, 0xf5, 0x9c, 0x60, - 0x9f, 0x96, 0xcd, 0x16, 0x19, 0xc1, 0xe7, 0xba, 0x13, 0x5c, 0x52, 0xf8, 0x9c, 0xac, 0xfa, 0xb0, - 0x18, 0x80, 0x35, 0xa2, 0x73, 0x1f, 0x81, 0x92, 0x42, 0x3e, 0x0a, 0x43, 0x34, 0xf7, 0x31, 0x98, - 0x4c, 0xb4, 0xd5, 0xab, 0xfa, 0x98, 0xce, 0x4f, 0xfd, 0x32, 0x3b, 0x32, 0x44, 0xaf, 0x57, 0xbc, - 0x3d, 0x71, 0xe4, 0xbe, 0x0d, 0xa7, 0x9a, 0x19, 0x27, 0x99, 0x98, 0xd7, 0xfe, 0x4f, 0xbe, 0x27, - 0xc4, 0x67, 0x9f, 0xca, 0x82, 0xe2, 0xcc, 0x36, 0x28, 0x8f, 0xe0, 0xb7, 0xe9, 0x06, 0x71, 0x9a, - 0x3a, 0xbb, 0x7d, 0x4b, 0x94, 0x61, 0x05, 0xa5, 0xe7, 0xdd, 0x29, 0xd5, 0xf9, 0x1b, 0x64, 0xbf, - 0x46, 0x9a, 0xa4, 0x1e, 0xf9, 0xc1, 0xd7, 0xb5, 0xfb, 0xe7, 0xf8, 0xe8, 0xf3, 0xe3, 0x72, 0x54, - 0x10, 0x28, 0xde, 0x20, 0xfb, 0x7c, 0x2a, 0xf4, 0xaf, 0x2b, 0x76, 0xfd, 0xba, 0x9f, 0xb5, 0x60, - 0x5c, 0x7d, 0xdd, 0x09, 0x9c, 0x0b, 0x4b, 0xe6, 0xb9, 0x70, 0xae, 0xeb, 0x02, 0xcf, 0x39, 0x11, - 0xbe, 0x52, 0x80, 0xb3, 0x0a, 0x87, 0xbe, 0x0d, 0xf8, 0x1f, 0xb1, 0xaa, 0xae, 0x40, 0xc9, 0x53, - 0x52, 0x2b, 0xcb, 0x14, 0x17, 0xc5, 0x32, 0xab, 0x18, 0x87, 0xb2, 0x78, 0x5e, 0x2c, 0x5a, 0x1a, - 0xd3, 0xc5, 0xb9, 0x42, 0x74, 0xbb, 0x04, 0xc5, 0x8e, 0xdb, 0x10, 0x17, 0xcc, 0x87, 0xe4, 0x68, - 0xdf, 0xae, 0x94, 0x0f, 0x0f, 0xe6, 0x9f, 0xcc, 0x53, 0x25, 0xd0, 0x9b, 0x2d, 0x5c, 0xb8, 0x5d, - 0x29, 0x63, 0x5a, 0x19, 0x2d, 0xc2, 0xa4, 0xd4, 0x96, 0xdc, 0xa1, 0xec, 0x96, 0xef, 0x89, 0x7b, - 0x48, 0xc9, 0x64, 0xb1, 0x09, 0xc6, 0x49, 0x7c, 0x54, 0x86, 0xa9, 0xdd, 0xce, 0x26, 0x69, 0x92, - 0x88, 0x7f, 0xf0, 0x0d, 0xc2, 0x25, 0x96, 0xa5, 0xf8, 0x65, 0x76, 0x23, 0x01, 0xc7, 0xa9, 0x1a, - 0xf6, 0x5f, 0xb2, 0xfb, 0x40, 0x8c, 0x5e, 0x35, 0xf0, 0xe9, 0xc2, 0xa2, 0xd4, 0xbf, 0x9e, 0xcb, - 0xb9, 0x9f, 0x55, 0x71, 0x83, 0xec, 0x6f, 0xf8, 0x94, 0x33, 0xcf, 0x5e, 0x15, 0xc6, 0x9a, 0x1f, - 0xe8, 0xba, 0xe6, 0x7f, 0xbe, 0x00, 0xa7, 0xd5, 0x08, 0x18, 0x4c, 0xe0, 0x37, 0xfa, 0x18, 0x5c, - 0x85, 0xd1, 0x06, 0xd9, 0x72, 0x3a, 0xcd, 0x48, 0x89, 0xcf, 0x07, 0xb9, 0x0a, 0xa5, 0x1c, 0x17, - 0x63, 0x1d, 0xe7, 0x08, 0xc3, 0xf6, 0x3f, 0x47, 0xd9, 0x45, 0x1c, 0x39, 0x74, 0x8d, 0xab, 0x5d, - 0x63, 0xe5, 0xee, 0x9a, 0x8b, 0x30, 0xe8, 0xb6, 0x28, 0x63, 0x56, 0x30, 0xf9, 0xad, 0x0a, 0x2d, - 0xc4, 0x1c, 0x86, 0x3e, 0x00, 0xc3, 0x75, 0xbf, 0xd5, 0x72, 0xbc, 0x06, 0xbb, 0xf2, 0x4a, 0x4b, - 0xa3, 0x94, 0x77, 0x5b, 0xe6, 0x45, 0x58, 0xc2, 0xd0, 0x13, 0x30, 0xe0, 0x04, 0xdb, 0x5c, 0x86, - 0x51, 0x5a, 0x1a, 0xa1, 0x2d, 0x2d, 0x06, 0xdb, 0x21, 0x66, 0xa5, 0xf4, 0x09, 0x76, 0xcf, 0x0f, - 0x76, 0x5d, 0x6f, 0xbb, 0xec, 0x06, 0x62, 0x4b, 0xa8, 0xbb, 0xf0, 0xae, 0x82, 0x60, 0x0d, 0x0b, - 0xad, 0xc2, 0x60, 0xdb, 0x0f, 0xa2, 0x70, 0x76, 0x88, 0x0d, 0xf7, 0x93, 0x39, 0x07, 0x11, 0xff, - 0xda, 0xaa, 0x1f, 0x44, 0xf1, 0x07, 0xd0, 0x7f, 0x21, 0xe6, 0xd5, 0xd1, 0x4d, 0x18, 0x26, 0xde, - 0xde, 0x6a, 0xe0, 0xb7, 0x66, 0x67, 0xf2, 0x29, 0xad, 0x70, 0x14, 0xbe, 0xcc, 0x62, 0x1e, 0x55, - 0x14, 0x63, 0x49, 0x02, 0x7d, 0x0b, 0x14, 0x89, 0xb7, 0x37, 0x3b, 0xcc, 0x28, 0xcd, 0xe5, 0x50, - 0xba, 0xe3, 0x04, 0xf1, 0x99, 0xbf, 0xe2, 0xed, 0x61, 0x5a, 0x07, 0x7d, 0x12, 0x4a, 0xf2, 0xc0, - 0x08, 0x85, 0xb0, 0x2e, 0x73, 0xc1, 0xca, 0x63, 0x06, 0x93, 0xb7, 0x3a, 0x6e, 0x40, 0x5a, 0xc4, - 0x8b, 0xc2, 0xf8, 0x84, 0x94, 0xd0, 0x10, 0xc7, 0xd4, 0xd0, 0x27, 0xa5, 0x84, 0x78, 0xcd, 0xef, - 0x78, 0x51, 0x38, 0x5b, 0x62, 0xdd, 0xcb, 0xd4, 0xdd, 0xdd, 0x89, 0xf1, 0x92, 0x22, 0x64, 0x5e, - 0x19, 0x1b, 0xa4, 0xd0, 0xa7, 0x61, 0x9c, 0xff, 0xe7, 0x1a, 0xb0, 0x70, 0xf6, 0x34, 0xa3, 0x7d, - 0x21, 0x9f, 0x36, 0x47, 0x5c, 0x3a, 0x2d, 0x88, 0x8f, 0xeb, 0xa5, 0x21, 0x36, 0xa9, 0x21, 0x0c, - 0xe3, 0x4d, 0x77, 0x8f, 0x78, 0x24, 0x0c, 0xab, 0x81, 0xbf, 0x49, 0x66, 0x81, 0x0d, 0xcc, 0xd9, - 0x6c, 0x8d, 0x99, 0xbf, 0x49, 0x96, 0xa6, 0x29, 0xcd, 0x9b, 0x7a, 0x1d, 0x6c, 0x92, 0x40, 0xb7, - 0x61, 0x82, 0xbe, 0xd8, 0xdc, 0x98, 0xe8, 0x68, 0x2f, 0xa2, 0xec, 0x5d, 0x85, 0x8d, 0x4a, 0x38, - 0x41, 0x04, 0xdd, 0x82, 0xb1, 0x30, 0x72, 0x82, 0xa8, 0xd3, 0xe6, 0x44, 0xcf, 0xf4, 0x22, 0xca, - 0x14, 0xae, 0x35, 0xad, 0x0a, 0x36, 0x08, 0xa0, 0xd7, 0xa1, 0xd4, 0x74, 0xb7, 0x48, 0x7d, 0xbf, - 0xde, 0x24, 0xb3, 0x63, 0x8c, 0x5a, 0xe6, 0xa1, 0x72, 0x53, 0x22, 0x71, 0x3e, 0x57, 0xfd, 0xc5, - 0x71, 0x75, 0x74, 0x07, 0xce, 0x44, 0x24, 0x68, 0xb9, 0x9e, 0x43, 0x0f, 0x03, 0xf1, 0xb4, 0x62, - 0x8a, 0xcc, 0x71, 0xb6, 0xdb, 0xce, 0x8b, 0xd9, 0x38, 0xb3, 0x91, 0x89, 0x85, 0x73, 0x6a, 0xa3, - 0xfb, 0x30, 0x9b, 0x01, 0xf1, 0x9b, 0x6e, 0x7d, 0x7f, 0xf6, 0x14, 0xa3, 0xfc, 0x51, 0x41, 0x79, - 0x76, 0x23, 0x07, 0xef, 0xb0, 0x0b, 0x0c, 0xe7, 0x52, 0x47, 0xb7, 0x60, 0x92, 0x9d, 0x40, 0xd5, - 0x4e, 0xb3, 0x29, 0x1a, 0x9c, 0x60, 0x0d, 0x7e, 0x40, 0xde, 0xc7, 0x15, 0x13, 0x7c, 0x78, 0x30, - 0x0f, 0xf1, 0x3f, 0x9c, 0xac, 0x8d, 0x36, 0x99, 0xce, 0xac, 0x13, 0xb8, 0xd1, 0x3e, 0x3d, 0x37, - 0xc8, 0xfd, 0x68, 0x76, 0xb2, 0xab, 0xbc, 0x42, 0x47, 0x55, 0x8a, 0x35, 0xbd, 0x10, 0x27, 0x09, - 0xd2, 0x23, 0x35, 0x8c, 0x1a, 0xae, 0x37, 0x3b, 0xc5, 0xdf, 0x25, 0xf2, 0x44, 0xaa, 0xd1, 0x42, - 0xcc, 0x61, 0x4c, 0x5f, 0x46, 0x7f, 0xdc, 0xa2, 0x37, 0xd7, 0x34, 0x43, 0x8c, 0xf5, 0x65, 0x12, - 0x80, 0x63, 0x1c, 0xca, 0x4c, 0x46, 0xd1, 0xfe, 0x2c, 0x62, 0xa8, 0xea, 0x60, 0xd9, 0xd8, 0xf8, - 0x24, 0xa6, 0xe5, 0xf6, 0x26, 0x4c, 0xa8, 0x83, 0x90, 0x8d, 0x09, 0x9a, 0x87, 0x41, 0xc6, 0x3e, - 0x09, 0xe9, 0x5a, 0x89, 0x76, 0x81, 0xb1, 0x56, 0x98, 0x97, 0xb3, 0x2e, 0xb8, 0x6f, 0x93, 0xa5, - 0xfd, 0x88, 0xf0, 0x37, 0x7d, 0x51, 0xeb, 0x82, 0x04, 0xe0, 0x18, 0xc7, 0xfe, 0x3f, 0x9c, 0x0d, - 0x8d, 0x4f, 0xdb, 0x3e, 0xee, 0x97, 0x67, 0x61, 0x64, 0xc7, 0x0f, 0x23, 0x8a, 0xcd, 0xda, 0x18, - 0x8c, 0x19, 0xcf, 0xeb, 0xa2, 0x1c, 0x2b, 0x0c, 0xf4, 0x2a, 0x8c, 0xd7, 0xf5, 0x06, 0xc4, 0xe5, - 0xa8, 0x8e, 0x11, 0xa3, 0x75, 0x6c, 0xe2, 0xa2, 0x97, 0x61, 0x84, 0xd9, 0x80, 0xd4, 0xfd, 0xa6, - 0xe0, 0xda, 0xe4, 0x0d, 0x3f, 0x52, 0x15, 0xe5, 0x87, 0xda, 0x6f, 0xac, 0xb0, 0xd1, 0x25, 0x18, - 0xa2, 0x5d, 0xa8, 0x54, 0xc5, 0xb5, 0xa4, 0x04, 0x45, 0xd7, 0x59, 0x29, 0x16, 0x50, 0xfb, 0xaf, - 0x14, 0xb4, 0x51, 0xa6, 0xef, 0x61, 0x82, 0xaa, 0x30, 0x7c, 0xcf, 0x71, 0x23, 0xd7, 0xdb, 0x16, - 0xfc, 0xc7, 0xd3, 0x5d, 0xef, 0x28, 0x56, 0xe9, 0x2e, 0xaf, 0xc0, 0x6f, 0x51, 0xf1, 0x07, 0x4b, - 0x32, 0x94, 0x62, 0xd0, 0xf1, 0x3c, 0x4a, 0xb1, 0xd0, 0x2f, 0x45, 0xcc, 0x2b, 0x70, 0x8a, 0xe2, - 0x0f, 0x96, 0x64, 0xd0, 0x9b, 0x00, 0x72, 0x87, 0x91, 0x86, 0xb0, 0xbd, 0x78, 0xb6, 0x37, 0xd1, - 0x0d, 0x55, 0x67, 0x69, 0x82, 0xde, 0xd1, 0xf1, 0x7f, 0xac, 0xd1, 0xb3, 0x23, 0xc6, 0xa7, 0xa5, - 0x3b, 0x83, 0xbe, 0x8d, 0x2e, 0x71, 0x27, 0x88, 0x48, 0x63, 0x31, 0x12, 0x83, 0xf3, 0xc1, 0xfe, - 0x1e, 0x29, 0x1b, 0x6e, 0x8b, 0xe8, 0xdb, 0x41, 0x10, 0xc1, 0x31, 0x3d, 0xfb, 0x17, 0x8b, 0x30, - 0x9b, 0xd7, 0x5d, 0xba, 0xe8, 0xc8, 0x7d, 0x37, 0x5a, 0xa6, 0xec, 0x95, 0x65, 0x2e, 0xba, 0x15, - 0x51, 0x8e, 0x15, 0x06, 0x9d, 0xfd, 0xd0, 0xdd, 0x96, 0x6f, 0xcc, 0xc1, 0x78, 0xf6, 0x6b, 0xac, - 0x14, 0x0b, 0x28, 0xc5, 0x0b, 0x88, 0x13, 0x0a, 0xe3, 0x1e, 0x6d, 0x95, 0x60, 0x56, 0x8a, 0x05, - 0x54, 0x97, 0x76, 0x0d, 0xf4, 0x90, 0x76, 0x19, 0x43, 0x34, 0x78, 0xbc, 0x43, 0x84, 0x3e, 0x03, - 0xb0, 0xe5, 0x7a, 0x6e, 0xb8, 0xc3, 0xa8, 0x0f, 0x1d, 0x99, 0xba, 0x62, 0xce, 0x56, 0x15, 0x15, - 0xac, 0x51, 0x44, 0x2f, 0xc1, 0xa8, 0xda, 0x80, 0x95, 0x32, 0xd3, 0x74, 0x6a, 0x96, 0x23, 0xf1, - 0x69, 0x54, 0xc6, 0x3a, 0x9e, 0xfd, 0xb9, 0xe4, 0x7a, 0x11, 0x3b, 0x40, 0x1b, 0x5f, 0xab, 0xdf, - 0xf1, 0x2d, 0x74, 0x1f, 0x5f, 0xfb, 0x6b, 0x45, 0x98, 0x34, 0x1a, 0xeb, 0x84, 0x7d, 0x9c, 0x59, - 0xd7, 0xe8, 0x01, 0xee, 0x44, 0x44, 0xec, 0x3f, 0xbb, 0xf7, 0x56, 0xd1, 0x0f, 0x79, 0xba, 0x03, - 0x78, 0x7d, 0xf4, 0x19, 0x28, 0x35, 0x9d, 0x90, 0x49, 0xce, 0x88, 0xd8, 0x77, 0xfd, 0x10, 0x8b, - 0x1f, 0x26, 0x4e, 0x18, 0x69, 0xb7, 0x26, 0xa7, 0x1d, 0x93, 0xa4, 0x37, 0x0d, 0xe5, 0x4f, 0xa4, - 0xf5, 0x98, 0xea, 0x04, 0x65, 0x62, 0xf6, 0x31, 0x87, 0xa1, 0x97, 0x61, 0x2c, 0x20, 0x6c, 0x55, - 0x2c, 0x53, 0x6e, 0x8e, 0x2d, 0xb3, 0xc1, 0x98, 0xed, 0xc3, 0x1a, 0x0c, 0x1b, 0x98, 0xf1, 0xdb, - 0x60, 0xa8, 0xcb, 0xdb, 0xe0, 0x69, 0x18, 0x66, 0x3f, 0xd4, 0x0a, 0x50, 0xb3, 0x51, 0xe1, 0xc5, - 0x58, 0xc2, 0x93, 0x0b, 0x66, 0xa4, 0xbf, 0x05, 0x43, 0x5f, 0x1f, 0x62, 0x51, 0x33, 0x2d, 0xf3, - 0x08, 0x3f, 0xe5, 0xc4, 0x92, 0xc7, 0x12, 0x66, 0x7f, 0x10, 0x26, 0xca, 0x0e, 0x69, 0xf9, 0xde, - 0x8a, 0xd7, 0x68, 0xfb, 0xae, 0x17, 0xa1, 0x59, 0x18, 0x60, 0x97, 0x08, 0x3f, 0x02, 0x06, 0x68, - 0x43, 0x98, 0x95, 0xd8, 0xdb, 0x70, 0xba, 0xec, 0xdf, 0xf3, 0xee, 0x39, 0x41, 0x63, 0xb1, 0x5a, - 0xd1, 0xde, 0xd7, 0xeb, 0xf2, 0x7d, 0xc7, 0x8d, 0xb6, 0x32, 0x8f, 0x5e, 0xad, 0x26, 0x67, 0x6b, - 0x57, 0xdd, 0x26, 0xc9, 0x91, 0x82, 0xfc, 0xb5, 0x82, 0xd1, 0x52, 0x8c, 0xaf, 0xb4, 0x5a, 0x56, - 0xae, 0x56, 0xeb, 0x0d, 0x18, 0xd9, 0x72, 0x49, 0xb3, 0x81, 0xc9, 0x96, 0x58, 0x89, 0x4f, 0xe5, - 0xdb, 0xa1, 0xac, 0x52, 0x4c, 0x29, 0xf5, 0xe2, 0xaf, 0xc3, 0x55, 0x51, 0x19, 0x2b, 0x32, 0x68, - 0x17, 0xa6, 0xe4, 0x83, 0x41, 0x42, 0xc5, 0xba, 0x7c, 0xba, 0xdb, 0x2b, 0xc4, 0x24, 0x7e, 0xea, - 0xc1, 0xc1, 0xfc, 0x14, 0x4e, 0x90, 0xc1, 0x29, 0xc2, 0xf4, 0x39, 0xd8, 0xa2, 0x27, 0xf0, 0x00, - 0x1b, 0x7e, 0xf6, 0x1c, 0x64, 0x2f, 0x5b, 0x56, 0x6a, 0xff, 0x98, 0x05, 0x8f, 0xa5, 0x46, 0x46, - 0xbc, 0xf0, 0x8f, 0x79, 0x16, 0x92, 0x2f, 0xee, 0x42, 0xef, 0x17, 0xb7, 0xfd, 0x77, 0x2d, 0x38, - 0xb5, 0xd2, 0x6a, 0x47, 0xfb, 0x65, 0xd7, 0x54, 0x41, 0x7d, 0x04, 0x86, 0x5a, 0xa4, 0xe1, 0x76, - 0x5a, 0x62, 0xe6, 0xe6, 0xe5, 0x29, 0xb5, 0xc6, 0x4a, 0x0f, 0x0f, 0xe6, 0xc7, 0x6b, 0x91, 0x1f, - 0x38, 0xdb, 0x84, 0x17, 0x60, 0x81, 0xce, 0xce, 0x7a, 0xf7, 0x6d, 0x72, 0xd3, 0x6d, 0xb9, 0xd2, - 0xae, 0xa8, 0xab, 0xcc, 0x6e, 0x41, 0x0e, 0xe8, 0xc2, 0x1b, 0x1d, 0xc7, 0x8b, 0xdc, 0x68, 0x5f, - 0x68, 0x8f, 0x24, 0x11, 0x1c, 0xd3, 0xb3, 0xbf, 0x6a, 0xc1, 0xa4, 0x5c, 0xf7, 0x8b, 0x8d, 0x46, - 0x40, 0xc2, 0x10, 0xcd, 0x41, 0xc1, 0x6d, 0x8b, 0x5e, 0x82, 0xe8, 0x65, 0xa1, 0x52, 0xc5, 0x05, - 0xb7, 0x2d, 0xd9, 0x32, 0x76, 0x10, 0x16, 0x4d, 0x45, 0xda, 0x75, 0x51, 0x8e, 0x15, 0x06, 0xba, - 0x0c, 0x23, 0x9e, 0xdf, 0xe0, 0xb6, 0x5d, 0xfc, 0x4a, 0x63, 0x0b, 0x6c, 0x5d, 0x94, 0x61, 0x05, - 0x45, 0x55, 0x28, 0x71, 0xb3, 0xa7, 0x78, 0xd1, 0xf6, 0x65, 0x3c, 0xc5, 0xbe, 0x6c, 0x43, 0xd6, - 0xc4, 0x31, 0x11, 0xfb, 0x57, 0x2d, 0x18, 0x93, 0x5f, 0xd6, 0x27, 0xcf, 0x49, 0xb7, 0x56, 0xcc, - 0x6f, 0xc6, 0x5b, 0x8b, 0xf2, 0x8c, 0x0c, 0x62, 0xb0, 0x8a, 0xc5, 0x23, 0xb1, 0x8a, 0x57, 0x61, - 0xd4, 0x69, 0xb7, 0xab, 0x26, 0x9f, 0xc9, 0x96, 0xd2, 0x62, 0x5c, 0x8c, 0x75, 0x1c, 0xfb, 0x47, - 0x0b, 0x30, 0x21, 0xbf, 0xa0, 0xd6, 0xd9, 0x0c, 0x49, 0x84, 0x36, 0xa0, 0xe4, 0xf0, 0x59, 0x22, - 0x72, 0x91, 0x5f, 0xcc, 0x96, 0x23, 0x18, 0x53, 0x1a, 0x5f, 0xf8, 0x8b, 0xb2, 0x36, 0x8e, 0x09, - 0xa1, 0x26, 0x4c, 0x7b, 0x7e, 0xc4, 0x0e, 0x7f, 0x05, 0xef, 0xa6, 0xda, 0x49, 0x52, 0x3f, 0x2b, - 0xa8, 0x4f, 0xaf, 0x27, 0xa9, 0xe0, 0x34, 0x61, 0xb4, 0x22, 0x65, 0x33, 0xc5, 0x7c, 0x61, 0x80, - 0x3e, 0x71, 0xd9, 0xa2, 0x19, 0xfb, 0x57, 0x2c, 0x28, 0x49, 0xb4, 0x93, 0xd0, 0xe2, 0xad, 0xc1, - 0x70, 0xc8, 0x26, 0x41, 0x0e, 0x8d, 0xdd, 0xad, 0xe3, 0x7c, 0xbe, 0xe2, 0x3b, 0x8d, 0xff, 0x0f, - 0xb1, 0xa4, 0xc1, 0x44, 0xf3, 0xaa, 0xfb, 0xef, 0x12, 0xd1, 0xbc, 0xea, 0x4f, 0xce, 0xa5, 0xf4, - 0x47, 0xac, 0xcf, 0x9a, 0xac, 0x8b, 0xb2, 0x5e, 0xed, 0x80, 0x6c, 0xb9, 0xf7, 0x93, 0xac, 0x57, - 0x95, 0x95, 0x62, 0x01, 0x45, 0x6f, 0xc2, 0x58, 0x5d, 0xca, 0x64, 0xe3, 0x1d, 0x7e, 0xa9, 0xab, - 0x7e, 0x40, 0xa9, 0x92, 0xb8, 0x2c, 0x64, 0x59, 0xab, 0x8f, 0x0d, 0x6a, 0xa6, 0x19, 0x41, 0xb1, - 0x97, 0x19, 0x41, 0x4c, 0x37, 0x5f, 0xa9, 0xfe, 0xe3, 0x16, 0x0c, 0x71, 0x59, 0x5c, 0x7f, 0xa2, - 0x50, 0x4d, 0xb3, 0x16, 0x8f, 0xdd, 0x1d, 0x5a, 0x28, 0x34, 0x65, 0x68, 0x0d, 0x4a, 0xec, 0x07, - 0x93, 0x25, 0x16, 0xf3, 0xad, 0xee, 0x79, 0xab, 0x7a, 0x07, 0xef, 0xc8, 0x6a, 0x38, 0xa6, 0x60, - 0xff, 0x70, 0x91, 0x9e, 0x6e, 0x31, 0xaa, 0x71, 0xe9, 0x5b, 0x8f, 0xee, 0xd2, 0x2f, 0x3c, 0xaa, - 0x4b, 0x7f, 0x1b, 0x26, 0xeb, 0x9a, 0x1e, 0x2e, 0x9e, 0xc9, 0xcb, 0x5d, 0x17, 0x89, 0xa6, 0xb2, - 0xe3, 0x52, 0x96, 0x65, 0x93, 0x08, 0x4e, 0x52, 0x45, 0xdf, 0x06, 0x63, 0x7c, 0x9e, 0x45, 0x2b, - 0xdc, 0x12, 0xe3, 0x03, 0xf9, 0xeb, 0x45, 0x6f, 0x82, 0x4b, 0xe5, 0xb4, 0xea, 0xd8, 0x20, 0x66, - 0xff, 0xa9, 0x05, 0x68, 0xa5, 0xbd, 0x43, 0x5a, 0x24, 0x70, 0x9a, 0xb1, 0x38, 0xfd, 0xfb, 0x2d, - 0x98, 0x25, 0xa9, 0xe2, 0x65, 0xbf, 0xd5, 0x12, 0x8f, 0x96, 0x9c, 0x77, 0xf5, 0x4a, 0x4e, 0x1d, - 0xe5, 0x96, 0x30, 0x9b, 0x87, 0x81, 0x73, 0xdb, 0x43, 0x6b, 0x30, 0xc3, 0x6f, 0x49, 0x05, 0xd0, - 0x6c, 0xaf, 0x1f, 0x17, 0x84, 0x67, 0x36, 0xd2, 0x28, 0x38, 0xab, 0x9e, 0xfd, 0x5d, 0x63, 0x90, - 0xdb, 0x8b, 0xf7, 0xf4, 0x08, 0xef, 0xe9, 0x11, 0xde, 0xd3, 0x23, 0xbc, 0xa7, 0x47, 0x78, 0x4f, - 0x8f, 0xf0, 0x4d, 0xaf, 0x47, 0xf8, 0x63, 0x0b, 0x66, 0xd2, 0xd7, 0xc0, 0x49, 0x30, 0xe6, 0x1d, - 0x98, 0x49, 0xdf, 0x75, 0x5d, 0xed, 0xec, 0xd2, 0xfd, 0x8c, 0xef, 0xbd, 0x8c, 0x6f, 0xc0, 0x59, - 0xf4, 0xed, 0x5f, 0xb7, 0xe0, 0xb4, 0x42, 0x36, 0x5e, 0xfa, 0x9f, 0x87, 0x19, 0x7e, 0xbe, 0x2c, - 0x37, 0x1d, 0xb7, 0xb5, 0x41, 0x5a, 0xed, 0xa6, 0x13, 0x49, 0x33, 0x83, 0xab, 0x99, 0x5b, 0x35, - 0x61, 0xa2, 0x6b, 0x54, 0x5c, 0x7a, 0x8c, 0xf6, 0x2b, 0x03, 0x80, 0xb3, 0x9a, 0x31, 0x8c, 0x52, - 0x0b, 0x3d, 0xcd, 0x84, 0x7f, 0x71, 0x04, 0x06, 0x57, 0xf6, 0x88, 0x17, 0x9d, 0xc0, 0x44, 0xd5, - 0x61, 0xc2, 0xf5, 0xf6, 0xfc, 0xe6, 0x1e, 0x69, 0x70, 0xf8, 0x51, 0x1e, 0xfa, 0x67, 0x04, 0xe9, - 0x89, 0x8a, 0x41, 0x02, 0x27, 0x48, 0x3e, 0x0a, 0x61, 0xfb, 0x35, 0x18, 0xe2, 0x77, 0x9c, 0x90, - 0xb4, 0x67, 0x5e, 0x69, 0x6c, 0x10, 0xc5, 0xcd, 0x1d, 0x2b, 0x02, 0xf8, 0x1d, 0x2a, 0xaa, 0xa3, - 0xcf, 0xc1, 0xc4, 0x96, 0x1b, 0x84, 0xd1, 0x86, 0xdb, 0x22, 0x61, 0xe4, 0xb4, 0xda, 0x0f, 0x21, - 0x5c, 0x57, 0xe3, 0xb0, 0x6a, 0x50, 0xc2, 0x09, 0xca, 0x68, 0x1b, 0xc6, 0x9b, 0x8e, 0xde, 0xd4, - 0xf0, 0x91, 0x9b, 0x52, 0x97, 0xe7, 0x4d, 0x9d, 0x10, 0x36, 0xe9, 0xd2, 0xd3, 0xa6, 0xce, 0xe4, - 0xc3, 0x23, 0x4c, 0x6a, 0xa2, 0x4e, 0x1b, 0x2e, 0x18, 0xe6, 0x30, 0xca, 0x07, 0x32, 0xfb, 0xe1, - 0x92, 0xc9, 0x07, 0x6a, 0x56, 0xc2, 0x9f, 0x85, 0x12, 0xa1, 0x43, 0x48, 0x09, 0x8b, 0xfb, 0xf7, - 0x4a, 0x7f, 0x7d, 0x5d, 0x73, 0xeb, 0x81, 0x6f, 0xaa, 0x35, 0x56, 0x24, 0x25, 0x1c, 0x13, 0x45, - 0xcb, 0x30, 0x14, 0x92, 0xc0, 0x25, 0xa1, 0xb8, 0x89, 0xbb, 0x4c, 0x23, 0x43, 0xe3, 0xae, 0x37, - 0xfc, 0x37, 0x16, 0x55, 0xe9, 0xf2, 0x72, 0x98, 0xc4, 0x97, 0xdd, 0x95, 0xda, 0xf2, 0x5a, 0x64, - 0xa5, 0x58, 0x40, 0xd1, 0xeb, 0x30, 0x1c, 0x90, 0x26, 0xd3, 0x9b, 0x8d, 0xf7, 0xbf, 0xc8, 0xb9, - 0x1a, 0x8e, 0xd7, 0xc3, 0x92, 0x00, 0xba, 0x01, 0x28, 0x20, 0x94, 0x8f, 0x74, 0xbd, 0x6d, 0x65, - 0x55, 0x2b, 0xee, 0x21, 0x75, 0x6e, 0xe1, 0x18, 0x43, 0x7a, 0x41, 0xe1, 0x8c, 0x6a, 0xe8, 0x1a, - 0x4c, 0xab, 0xd2, 0x8a, 0x17, 0x46, 0x0e, 0x3d, 0xff, 0x27, 0x19, 0x2d, 0x25, 0xc6, 0xc1, 0x49, - 0x04, 0x9c, 0xae, 0x63, 0x7f, 0xd9, 0x02, 0x3e, 0xce, 0x27, 0x20, 0xbc, 0x78, 0xcd, 0x14, 0x5e, - 0x9c, 0xcd, 0x9d, 0xb9, 0x1c, 0xc1, 0xc5, 0x97, 0x2d, 0x18, 0xd5, 0x66, 0x36, 0x5e, 0xb3, 0x56, - 0x97, 0x35, 0xdb, 0x81, 0x29, 0xba, 0xd2, 0x6f, 0x6d, 0x86, 0x24, 0xd8, 0x23, 0x0d, 0xb6, 0x30, - 0x0b, 0x0f, 0xb7, 0x30, 0x95, 0x05, 0xdf, 0xcd, 0x04, 0x41, 0x9c, 0x6a, 0xc2, 0xfe, 0xac, 0xec, - 0xaa, 0x32, 0x78, 0xac, 0xab, 0x39, 0x4f, 0x18, 0x3c, 0xaa, 0x59, 0xc5, 0x31, 0x0e, 0xdd, 0x6a, - 0x3b, 0x7e, 0x18, 0x25, 0x0d, 0x1e, 0xaf, 0xfb, 0x61, 0x84, 0x19, 0xc4, 0x7e, 0x01, 0x60, 0xe5, - 0x3e, 0xa9, 0xf3, 0x15, 0xab, 0xbf, 0xad, 0xac, 0xfc, 0xb7, 0x95, 0xfd, 0xdb, 0x16, 0x4c, 0xac, - 0x2e, 0x1b, 0xf7, 0xdc, 0x02, 0x00, 0x7f, 0x10, 0xde, 0xbd, 0xbb, 0x2e, 0xad, 0x05, 0xb8, 0xc2, - 0x57, 0x95, 0x62, 0x0d, 0x03, 0x9d, 0x85, 0x62, 0xb3, 0xe3, 0x09, 0xe9, 0xea, 0x30, 0xe5, 0x1e, - 0x6e, 0x76, 0x3c, 0x4c, 0xcb, 0x34, 0x8f, 0x8b, 0x62, 0xdf, 0x1e, 0x17, 0x3d, 0x23, 0x1f, 0xa0, - 0x79, 0x18, 0xbc, 0x77, 0xcf, 0x6d, 0x70, 0xff, 0x52, 0x61, 0xc9, 0x70, 0xf7, 0x6e, 0xa5, 0x1c, - 0x62, 0x5e, 0x6e, 0x7f, 0xa9, 0x08, 0x73, 0xab, 0x4d, 0x72, 0xff, 0x1d, 0xfa, 0xd8, 0xf6, 0xeb, - 0x2f, 0x72, 0x34, 0x39, 0xd5, 0x51, 0x7d, 0x82, 0x7a, 0x8f, 0xc7, 0x16, 0x0c, 0x73, 0x7b, 0x3f, - 0xe9, 0x71, 0xfb, 0x6a, 0x56, 0xeb, 0xf9, 0x03, 0xb2, 0xc0, 0xed, 0x06, 0x85, 0xc3, 0xa0, 0xba, - 0x30, 0x45, 0x29, 0x96, 0xc4, 0xe7, 0x5e, 0x81, 0x31, 0x1d, 0xf3, 0x48, 0xde, 0x79, 0xff, 0x5f, - 0x11, 0xa6, 0x68, 0x0f, 0x1e, 0xe9, 0x44, 0xdc, 0x4e, 0x4f, 0xc4, 0x71, 0x7b, 0x68, 0xf5, 0x9e, - 0x8d, 0x37, 0x93, 0xb3, 0x71, 0x35, 0x6f, 0x36, 0x4e, 0x7a, 0x0e, 0xbe, 0xd3, 0x82, 0x99, 0xd5, - 0xa6, 0x5f, 0xdf, 0x4d, 0x78, 0x51, 0xbd, 0x04, 0xa3, 0xf4, 0x38, 0x0e, 0x0d, 0x07, 0x7f, 0x23, - 0xe4, 0x83, 0x00, 0x61, 0x1d, 0x4f, 0xab, 0x76, 0xfb, 0x76, 0xa5, 0x9c, 0x15, 0x29, 0x42, 0x80, - 0xb0, 0x8e, 0x67, 0xff, 0xa6, 0x05, 0xe7, 0xae, 0x2d, 0xaf, 0xc4, 0x4b, 0x31, 0x15, 0xac, 0xe2, - 0x12, 0x0c, 0xb5, 0x1b, 0x5a, 0x57, 0x62, 0xe9, 0x73, 0x99, 0xf5, 0x42, 0x40, 0xdf, 0x2d, 0x81, - 0x58, 0x7e, 0xda, 0x82, 0x99, 0x6b, 0x6e, 0x44, 0x6f, 0xd7, 0x64, 0xd8, 0x04, 0x7a, 0xbd, 0x86, - 0x6e, 0xe4, 0x07, 0xfb, 0xc9, 0xb0, 0x09, 0x58, 0x41, 0xb0, 0x86, 0xc5, 0x5b, 0xde, 0x73, 0x99, - 0xa5, 0x79, 0xc1, 0xd4, 0xc3, 0x61, 0x51, 0x8e, 0x15, 0x06, 0xfd, 0xb0, 0x86, 0x1b, 0x30, 0x11, - 0xe6, 0xbe, 0x38, 0x61, 0xd5, 0x87, 0x95, 0x25, 0x00, 0xc7, 0x38, 0xf4, 0x35, 0x37, 0x7f, 0xad, - 0xd9, 0x09, 0x23, 0x12, 0x6c, 0x85, 0x39, 0xa7, 0xe3, 0x0b, 0x50, 0x22, 0x52, 0x61, 0x20, 0x7a, - 0xad, 0x38, 0x46, 0xa5, 0x49, 0xe0, 0xd1, 0x1b, 0x14, 0x5e, 0x1f, 0x3e, 0x99, 0x47, 0x73, 0xaa, - 0x5b, 0x05, 0x44, 0xf4, 0xb6, 0xf4, 0x70, 0x16, 0xcc, 0x2f, 0x7e, 0x25, 0x05, 0xc5, 0x19, 0x35, - 0xec, 0x1f, 0xb3, 0xe0, 0xb4, 0xfa, 0xe0, 0x77, 0xdd, 0x67, 0xda, 0x3f, 0x57, 0x80, 0xf1, 0xeb, - 0x1b, 0x1b, 0xd5, 0x6b, 0x24, 0x12, 0xd7, 0x76, 0x6f, 0x33, 0x00, 0xac, 0x69, 0x33, 0xbb, 0x3d, - 0xe6, 0x3a, 0x91, 0xdb, 0x5c, 0xe0, 0x51, 0x91, 0x16, 0x2a, 0x5e, 0x74, 0x2b, 0xa8, 0x45, 0x81, - 0xeb, 0x6d, 0x67, 0xea, 0x3f, 0x25, 0x73, 0x51, 0xcc, 0x63, 0x2e, 0xd0, 0x0b, 0x30, 0xc4, 0xc2, - 0x32, 0xc9, 0x49, 0x78, 0x5c, 0xbd, 0x85, 0x58, 0xe9, 0xe1, 0xc1, 0x7c, 0xe9, 0x36, 0xae, 0xf0, - 0x3f, 0x58, 0xa0, 0xa2, 0xdb, 0x30, 0xba, 0x13, 0x45, 0xed, 0xeb, 0xc4, 0x69, 0xd0, 0xa7, 0x3b, - 0x3f, 0x0e, 0xcf, 0x67, 0x1d, 0x87, 0x74, 0x10, 0x38, 0x5a, 0x7c, 0x82, 0xc4, 0x65, 0x21, 0xd6, - 0xe9, 0xd8, 0x35, 0x80, 0x18, 0x76, 0x4c, 0x8a, 0x1c, 0xfb, 0x0f, 0x2d, 0x18, 0xe6, 0x11, 0x32, - 0x02, 0xf4, 0x51, 0x18, 0x20, 0xf7, 0x49, 0x5d, 0x70, 0xbc, 0x99, 0x1d, 0x8e, 0x39, 0x2d, 0x2e, - 0x90, 0xa6, 0xff, 0x31, 0xab, 0x85, 0xae, 0xc3, 0x30, 0xed, 0xed, 0x35, 0x15, 0x2e, 0xe4, 0xc9, - 0xbc, 0x2f, 0x56, 0xd3, 0xce, 0x99, 0x33, 0x51, 0x84, 0x65, 0x75, 0xa6, 0x3d, 0xaf, 0xb7, 0x6b, - 0xf4, 0xc4, 0x8e, 0xba, 0x31, 0x16, 0x1b, 0xcb, 0x55, 0x8e, 0x24, 0xa8, 0x71, 0xed, 0xb9, 0x2c, - 0xc4, 0x31, 0x11, 0x7b, 0x03, 0x4a, 0x74, 0x52, 0x17, 0x9b, 0xae, 0xd3, 0xdd, 0x20, 0xe0, 0x19, - 0x28, 0x49, 0x75, 0x7f, 0x28, 0x3c, 0xe3, 0x19, 0x55, 0x69, 0x0d, 0x10, 0xe2, 0x18, 0x6e, 0x6f, - 0xc1, 0x29, 0x66, 0xbc, 0xe9, 0x44, 0x3b, 0xc6, 0x1e, 0xeb, 0xbd, 0x98, 0x9f, 0x15, 0x0f, 0x48, - 0x3e, 0x33, 0xb3, 0x9a, 0xf3, 0xe9, 0x98, 0xa4, 0x18, 0x3f, 0x26, 0xed, 0xaf, 0x0d, 0xc0, 0xe3, - 0x95, 0x5a, 0x7e, 0xf0, 0x94, 0x97, 0x61, 0x8c, 0xf3, 0xa5, 0x74, 0x69, 0x3b, 0x4d, 0xd1, 0xae, - 0x92, 0x44, 0x6f, 0x68, 0x30, 0x6c, 0x60, 0xa2, 0x73, 0x50, 0x74, 0xdf, 0xf2, 0x92, 0xae, 0x59, - 0x95, 0x37, 0xd6, 0x31, 0x2d, 0xa7, 0x60, 0xca, 0xe2, 0xf2, 0xbb, 0x43, 0x81, 0x15, 0x9b, 0xfb, - 0x1a, 0x4c, 0xb8, 0x61, 0x3d, 0x74, 0x2b, 0x1e, 0x3d, 0x67, 0xb4, 0x93, 0x4a, 0x09, 0x37, 0x68, - 0xa7, 0x15, 0x14, 0x27, 0xb0, 0xb5, 0x8b, 0x6c, 0xb0, 0x6f, 0x36, 0xb9, 0xa7, 0xab, 0x38, 0x7d, - 0x01, 0xb4, 0xd9, 0xd7, 0x85, 0x4c, 0xa5, 0x20, 0x5e, 0x00, 0xfc, 0x83, 0x43, 0x2c, 0x61, 0xf4, - 0xe5, 0x58, 0xdf, 0x71, 0xda, 0x8b, 0x9d, 0x68, 0xa7, 0xec, 0x86, 0x75, 0x7f, 0x8f, 0x04, 0xfb, - 0xec, 0xd1, 0x3f, 0x12, 0xbf, 0x1c, 0x15, 0x60, 0xf9, 0xfa, 0x62, 0x95, 0x62, 0xe2, 0x74, 0x1d, - 0xb4, 0x08, 0x93, 0xb2, 0xb0, 0x46, 0x42, 0x76, 0x85, 0x8d, 0x32, 0x32, 0xca, 0x59, 0x4a, 0x14, - 0x2b, 0x22, 0x49, 0x7c, 0x93, 0x93, 0x86, 0xe3, 0xe0, 0xa4, 0x3f, 0x02, 0xe3, 0xae, 0xe7, 0x46, - 0xae, 0x13, 0xf9, 0x5c, 0x1f, 0xc6, 0xdf, 0xf7, 0x4c, 0xd0, 0x5f, 0xd1, 0x01, 0xd8, 0xc4, 0xb3, - 0xff, 0xcb, 0x00, 0x4c, 0xb3, 0x69, 0x7b, 0x6f, 0x85, 0x7d, 0x33, 0xad, 0xb0, 0xdb, 0xe9, 0x15, - 0x76, 0x1c, 0x4f, 0x84, 0x87, 0x5e, 0x66, 0x9f, 0x83, 0x92, 0xf2, 0x0f, 0x93, 0x0e, 0xa2, 0x56, - 0x8e, 0x83, 0x68, 0x6f, 0xee, 0x43, 0x9a, 0xd8, 0x15, 0x33, 0x4d, 0xec, 0xfe, 0x86, 0x05, 0xb1, - 0x82, 0x07, 0x5d, 0x87, 0x52, 0xdb, 0x67, 0x96, 0xa3, 0x81, 0x34, 0xc7, 0x7e, 0x3c, 0xf3, 0xa2, - 0xe2, 0x97, 0x22, 0xff, 0xf8, 0xaa, 0xac, 0x81, 0xe3, 0xca, 0x68, 0x09, 0x86, 0xdb, 0x01, 0xa9, - 0x45, 0x2c, 0x86, 0x4a, 0x4f, 0x3a, 0x7c, 0x8d, 0x70, 0x7c, 0x2c, 0x2b, 0xda, 0x3f, 0x6f, 0x01, - 0x70, 0x2b, 0x36, 0xc7, 0xdb, 0x26, 0x27, 0x20, 0xb5, 0x2e, 0xc3, 0x40, 0xd8, 0x26, 0xf5, 0x6e, - 0x36, 0xbd, 0x71, 0x7f, 0x6a, 0x6d, 0x52, 0x8f, 0x07, 0x9c, 0xfe, 0xc3, 0xac, 0xb6, 0xfd, 0xdd, - 0x00, 0x13, 0x31, 0x5a, 0x25, 0x22, 0x2d, 0xf4, 0x9c, 0x11, 0x53, 0xe1, 0x6c, 0x22, 0xa6, 0x42, - 0x89, 0x61, 0x6b, 0x02, 0xd2, 0xcf, 0x41, 0xb1, 0xe5, 0xdc, 0x17, 0x12, 0xb0, 0x67, 0xba, 0x77, - 0x83, 0xd2, 0x5f, 0x58, 0x73, 0xee, 0xf3, 0x47, 0xe2, 0x33, 0x72, 0x81, 0xac, 0x39, 0xf7, 0x0f, - 0xb9, 0xe5, 0x2e, 0x3b, 0xa4, 0x6e, 0xba, 0x61, 0xf4, 0x85, 0xff, 0x1c, 0xff, 0x67, 0xcb, 0x8e, - 0x36, 0xc2, 0xda, 0x72, 0x3d, 0x61, 0xa0, 0xd5, 0x57, 0x5b, 0xae, 0x97, 0x6c, 0xcb, 0xf5, 0xfa, - 0x68, 0xcb, 0xf5, 0xd0, 0xdb, 0x30, 0x2c, 0xec, 0x27, 0x45, 0x0c, 0xa3, 0x2b, 0x7d, 0xb4, 0x27, - 0xcc, 0x2f, 0x79, 0x9b, 0x57, 0xe4, 0x23, 0x58, 0x94, 0xf6, 0x6c, 0x57, 0x36, 0x88, 0xfe, 0xaa, - 0x05, 0x13, 0xe2, 0x37, 0x26, 0x6f, 0x75, 0x48, 0x18, 0x09, 0xde, 0xf3, 0xc3, 0xfd, 0xf7, 0x41, - 0x54, 0xe4, 0x5d, 0xf9, 0xb0, 0x3c, 0x66, 0x4d, 0x60, 0xcf, 0x1e, 0x25, 0x7a, 0x81, 0xfe, 0xbe, - 0x05, 0xa7, 0x5a, 0xce, 0x7d, 0xde, 0x22, 0x2f, 0xc3, 0x4e, 0xe4, 0xfa, 0xc2, 0x0e, 0xe1, 0xa3, - 0xfd, 0x4d, 0x7f, 0xaa, 0x3a, 0xef, 0xa4, 0x54, 0x96, 0x9e, 0xca, 0x42, 0xe9, 0xd9, 0xd5, 0xcc, - 0x7e, 0xcd, 0x6d, 0xc1, 0x88, 0x5c, 0x6f, 0x19, 0xa2, 0x86, 0xb2, 0xce, 0x58, 0x1f, 0xd9, 0x7c, - 0x55, 0x8f, 0x55, 0x40, 0xdb, 0x11, 0x6b, 0xed, 0x91, 0xb6, 0xf3, 0x39, 0x18, 0xd3, 0xd7, 0xd8, - 0x23, 0x6d, 0xeb, 0x2d, 0x98, 0xc9, 0x58, 0x4b, 0x8f, 0xb4, 0xc9, 0x7b, 0x70, 0x36, 0x77, 0x7d, - 0x3c, 0xca, 0x86, 0xed, 0x9f, 0xb3, 0xf4, 0x73, 0xf0, 0x04, 0x54, 0x07, 0xcb, 0xa6, 0xea, 0xe0, - 0x7c, 0xf7, 0x9d, 0x93, 0xa3, 0x3f, 0x78, 0x53, 0xef, 0x34, 0x3d, 0xd5, 0xd1, 0xeb, 0x30, 0xd4, - 0xa4, 0x25, 0xd2, 0x0a, 0xd7, 0xee, 0xbd, 0x23, 0x63, 0x5e, 0x8a, 0x95, 0x87, 0x58, 0x50, 0xb0, - 0x7f, 0xc9, 0x82, 0x81, 0x13, 0x18, 0x09, 0x6c, 0x8e, 0xc4, 0x73, 0xb9, 0xa4, 0x45, 0x78, 0xe5, - 0x05, 0xec, 0xdc, 0x5b, 0xb9, 0x1f, 0x11, 0x2f, 0x64, 0x4f, 0xc5, 0xcc, 0x81, 0xf9, 0x49, 0x0b, - 0x66, 0x6e, 0xfa, 0x4e, 0x63, 0xc9, 0x69, 0x3a, 0x5e, 0x9d, 0x04, 0x15, 0x6f, 0xfb, 0x48, 0x26, - 0xe4, 0x85, 0x9e, 0x26, 0xe4, 0xcb, 0xd2, 0x02, 0x6b, 0x20, 0x7f, 0xfe, 0x28, 0x23, 0x99, 0x8c, - 0x32, 0x63, 0xd8, 0x0a, 0xef, 0x00, 0xd2, 0x7b, 0x29, 0x1c, 0x7a, 0x30, 0x0c, 0xbb, 0xbc, 0xbf, - 0x62, 0x12, 0x9f, 0xca, 0x66, 0xf0, 0x52, 0x9f, 0xa7, 0xb9, 0xaa, 0xf0, 0x02, 0x2c, 0x09, 0xd9, - 0x2f, 0x43, 0x66, 0x54, 0x80, 0xde, 0xc2, 0x07, 0xfb, 0x93, 0x30, 0xcd, 0x6a, 0x1e, 0xf1, 0x61, - 0x6c, 0x27, 0x64, 0x9b, 0x19, 0xf1, 0x02, 0xed, 0x2f, 0x5a, 0x30, 0xb9, 0x9e, 0x08, 0xa3, 0x76, - 0x89, 0x69, 0x43, 0x33, 0x44, 0xea, 0x35, 0x56, 0x8a, 0x05, 0xf4, 0xd8, 0x25, 0x59, 0x7f, 0x69, - 0x41, 0x1c, 0xa8, 0xe3, 0x04, 0xd8, 0xb7, 0x65, 0x83, 0x7d, 0xcb, 0x94, 0xb0, 0xa8, 0xee, 0xe4, - 0x71, 0x6f, 0xe8, 0x86, 0x0a, 0x61, 0xd5, 0x45, 0xb8, 0x12, 0x93, 0xe1, 0x4b, 0x71, 0xc2, 0x8c, - 0x73, 0x25, 0x83, 0x5a, 0xd9, 0xbf, 0x53, 0x00, 0xa4, 0x70, 0xfb, 0x0e, 0xb1, 0x95, 0xae, 0x71, - 0x3c, 0x21, 0xb6, 0xf6, 0x00, 0x31, 0x7d, 0x7e, 0xe0, 0x78, 0x21, 0x27, 0xeb, 0x0a, 0xd9, 0xdd, - 0xd1, 0x8c, 0x05, 0xe6, 0x44, 0x93, 0xe8, 0x66, 0x8a, 0x1a, 0xce, 0x68, 0x41, 0xb3, 0xd3, 0x18, - 0xec, 0xd7, 0x4e, 0x63, 0xa8, 0x87, 0xd3, 0xde, 0xcf, 0x5a, 0x30, 0xae, 0x86, 0xe9, 0x5d, 0x62, - 0x52, 0xaf, 0xfa, 0x93, 0x73, 0x80, 0x56, 0xb5, 0x2e, 0xb3, 0x8b, 0xe5, 0x5b, 0x99, 0xf3, 0xa5, - 0xd3, 0x74, 0xdf, 0x26, 0x2a, 0xc0, 0xe1, 0xbc, 0x70, 0xa6, 0x14, 0xa5, 0x87, 0x07, 0xf3, 0xe3, - 0xea, 0x1f, 0x0f, 0xa8, 0x1c, 0x57, 0xa1, 0x47, 0xf2, 0x64, 0x62, 0x29, 0xa2, 0x97, 0x60, 0xb0, - 0xbd, 0xe3, 0x84, 0x24, 0xe1, 0x7a, 0x34, 0x58, 0xa5, 0x85, 0x87, 0x07, 0xf3, 0x13, 0xaa, 0x02, - 0x2b, 0xc1, 0x1c, 0xbb, 0xff, 0xc0, 0x65, 0xe9, 0xc5, 0xd9, 0x33, 0x70, 0xd9, 0x9f, 0x5a, 0x30, - 0xb0, 0xee, 0x37, 0x4e, 0xe2, 0x08, 0x78, 0xcd, 0x38, 0x02, 0x9e, 0xc8, 0x8b, 0x75, 0x9f, 0xbb, - 0xfb, 0x57, 0x13, 0xbb, 0xff, 0x7c, 0x2e, 0x85, 0xee, 0x1b, 0xbf, 0x05, 0xa3, 0x2c, 0x82, 0xbe, - 0x70, 0xb3, 0x7a, 0xc1, 0xd8, 0xf0, 0xf3, 0x89, 0x0d, 0x3f, 0xa9, 0xa1, 0x6a, 0x3b, 0xfd, 0x69, - 0x18, 0x16, 0x7e, 0x3b, 0x49, 0x1f, 0x56, 0x81, 0x8b, 0x25, 0xdc, 0xfe, 0xf1, 0x22, 0x18, 0x11, - 0xfb, 0xd1, 0xaf, 0x58, 0xb0, 0x10, 0x70, 0x7b, 0xde, 0x46, 0xb9, 0x13, 0xb8, 0xde, 0x76, 0xad, - 0xbe, 0x43, 0x1a, 0x9d, 0xa6, 0xeb, 0x6d, 0x57, 0xb6, 0x3d, 0x5f, 0x15, 0xaf, 0xdc, 0x27, 0xf5, - 0x0e, 0x53, 0x82, 0xf5, 0x48, 0x0f, 0xa0, 0xec, 0xe2, 0x9f, 0x7f, 0x70, 0x30, 0xbf, 0x80, 0x8f, - 0x44, 0x1b, 0x1f, 0xb1, 0x2f, 0xe8, 0x37, 0x2d, 0xb8, 0xc2, 0x03, 0xd9, 0xf7, 0xdf, 0xff, 0x2e, - 0xaf, 0xe5, 0xaa, 0x24, 0x15, 0x13, 0xd9, 0x20, 0x41, 0x6b, 0xe9, 0x23, 0x62, 0x40, 0xaf, 0x54, - 0x8f, 0xd6, 0x16, 0x3e, 0x6a, 0xe7, 0xec, 0x7f, 0x56, 0x84, 0x71, 0x11, 0xe0, 0x4a, 0xdc, 0x01, - 0x2f, 0x19, 0x4b, 0xe2, 0xc9, 0xc4, 0x92, 0x98, 0x36, 0x90, 0x8f, 0xe7, 0xf8, 0x0f, 0x61, 0x9a, - 0x1e, 0xce, 0xd7, 0x89, 0x13, 0x44, 0x9b, 0xc4, 0xe1, 0xe6, 0x57, 0xc5, 0x23, 0x9f, 0xfe, 0x4a, - 0x3c, 0x77, 0x33, 0x49, 0x0c, 0xa7, 0xe9, 0x7f, 0x33, 0xdd, 0x39, 0x1e, 0x4c, 0xa5, 0x62, 0x94, - 0x7d, 0x0a, 0x4a, 0xca, 0xe9, 0x44, 0x1c, 0x3a, 0xdd, 0x43, 0xfd, 0x25, 0x29, 0x70, 0x11, 0x5a, - 0xec, 0xf0, 0x14, 0x93, 0xb3, 0xff, 0x41, 0xc1, 0x68, 0x90, 0x4f, 0xe2, 0x3a, 0x8c, 0x38, 0x61, - 0xe8, 0x6e, 0x7b, 0xa4, 0x21, 0x76, 0xec, 0xfb, 0xf3, 0x76, 0xac, 0xd1, 0x0c, 0x73, 0xfc, 0x59, - 0x14, 0x35, 0xb1, 0xa2, 0x81, 0xae, 0x73, 0x23, 0xb7, 0x3d, 0xf9, 0xde, 0xeb, 0x8f, 0x1a, 0x48, - 0x33, 0xb8, 0x3d, 0x82, 0x45, 0x7d, 0xf4, 0x69, 0x6e, 0x85, 0x78, 0xc3, 0xf3, 0xef, 0x79, 0xd7, - 0x7c, 0x5f, 0x06, 0x91, 0xe8, 0x8f, 0xe0, 0xb4, 0xb4, 0x3d, 0x54, 0xd5, 0xb1, 0x49, 0xad, 0xbf, - 0xa0, 0x9f, 0x9f, 0x87, 0x19, 0x4a, 0xda, 0xf4, 0xf1, 0x0e, 0x11, 0x81, 0x49, 0x11, 0x3d, 0x4d, - 0x96, 0x89, 0xb1, 0xcb, 0x7c, 0xca, 0x99, 0xb5, 0x63, 0x39, 0xf2, 0x0d, 0x93, 0x04, 0x4e, 0xd2, - 0xb4, 0x7f, 0xca, 0x02, 0xe6, 0xef, 0x7a, 0x02, 0xfc, 0xc8, 0xc7, 0x4c, 0x7e, 0x64, 0x36, 0x6f, - 0x90, 0x73, 0x58, 0x91, 0x17, 0xf9, 0xca, 0xaa, 0x06, 0xfe, 0xfd, 0x7d, 0x61, 0x3a, 0xd2, 0xfb, - 0xfd, 0x61, 0xff, 0x6f, 0x8b, 0x1f, 0x62, 0xca, 0x25, 0x04, 0x7d, 0x3b, 0x8c, 0xd4, 0x9d, 0xb6, - 0x53, 0xe7, 0xe9, 0x65, 0x72, 0x25, 0x7a, 0x46, 0xa5, 0x85, 0x65, 0x51, 0x83, 0x4b, 0xa8, 0x64, - 0x14, 0xbe, 0x11, 0x59, 0xdc, 0x53, 0x2a, 0xa5, 0x9a, 0x9c, 0xdb, 0x85, 0x71, 0x83, 0xd8, 0x23, - 0x15, 0x67, 0x7c, 0x3b, 0xbf, 0x62, 0x55, 0xd4, 0xc8, 0x16, 0x4c, 0x7b, 0xda, 0x7f, 0x7a, 0xa1, - 0xc8, 0xc7, 0xe5, 0xfb, 0x7b, 0x5d, 0xa2, 0xec, 0xf6, 0xd1, 0x5c, 0x69, 0x13, 0x64, 0x70, 0x9a, - 0xb2, 0xfd, 0x13, 0x16, 0x3c, 0xa6, 0x23, 0x6a, 0xde, 0x3a, 0xbd, 0x74, 0x04, 0x65, 0x18, 0xf1, - 0xdb, 0x24, 0x70, 0x22, 0x3f, 0x10, 0xb7, 0xc6, 0x65, 0x39, 0xe8, 0xb7, 0x44, 0xf9, 0xa1, 0x08, - 0xce, 0x2e, 0xa9, 0xcb, 0x72, 0xac, 0x6a, 0xd2, 0xd7, 0x27, 0x1b, 0x8c, 0x50, 0xf8, 0x65, 0xb1, - 0x33, 0x80, 0xa9, 0xcb, 0x43, 0x2c, 0x20, 0xf6, 0xd7, 0x2c, 0xbe, 0xb0, 0xf4, 0xae, 0xa3, 0xb7, - 0x60, 0xaa, 0xe5, 0x44, 0xf5, 0x9d, 0x95, 0xfb, 0xed, 0x80, 0x6b, 0x5c, 0xe4, 0x38, 0x3d, 0xd3, - 0x6b, 0x9c, 0xb4, 0x8f, 0x8c, 0x0d, 0x2b, 0xd7, 0x12, 0xc4, 0x70, 0x8a, 0x3c, 0xda, 0x84, 0x51, - 0x56, 0xc6, 0x5c, 0x0e, 0xc3, 0x6e, 0xac, 0x41, 0x5e, 0x6b, 0xca, 0xe2, 0x60, 0x2d, 0xa6, 0x83, - 0x75, 0xa2, 0xf6, 0xcf, 0x14, 0xf9, 0x6e, 0x67, 0xac, 0xfc, 0xd3, 0x30, 0xdc, 0xf6, 0x1b, 0xcb, - 0x95, 0x32, 0x16, 0xb3, 0xa0, 0xae, 0x91, 0x2a, 0x2f, 0xc6, 0x12, 0x8e, 0x2e, 0xc3, 0x88, 0xf8, - 0x29, 0x35, 0x64, 0xec, 0x6c, 0x16, 0x78, 0x21, 0x56, 0x50, 0xf4, 0x3c, 0x40, 0x3b, 0xf0, 0xf7, - 0xdc, 0x06, 0x0b, 0x85, 0x51, 0x34, 0x8d, 0x85, 0xaa, 0x0a, 0x82, 0x35, 0x2c, 0xf4, 0x2a, 0x8c, - 0x77, 0xbc, 0x90, 0xb3, 0x23, 0x5a, 0xe0, 0x5b, 0x65, 0xc6, 0x72, 0x5b, 0x07, 0x62, 0x13, 0x17, - 0x2d, 0xc2, 0x50, 0xe4, 0x30, 0xe3, 0x97, 0xc1, 0x7c, 0xe3, 0xdb, 0x0d, 0x8a, 0xa1, 0x67, 0x32, - 0xa1, 0x15, 0xb0, 0xa8, 0x88, 0x3e, 0x25, 0xbd, 0x7f, 0xf9, 0xc1, 0x2e, 0xac, 0xde, 0xfb, 0xbb, - 0x04, 0x34, 0xdf, 0x5f, 0x61, 0x4d, 0x6f, 0xd0, 0x42, 0xaf, 0x00, 0x90, 0xfb, 0x11, 0x09, 0x3c, - 0xa7, 0xa9, 0x6c, 0xcb, 0x14, 0x5f, 0x50, 0xf6, 0xd7, 0xfd, 0xe8, 0x76, 0x48, 0x56, 0x14, 0x06, - 0xd6, 0xb0, 0xed, 0xdf, 0x2c, 0x01, 0xc4, 0x7c, 0x3b, 0x7a, 0x3b, 0x75, 0x70, 0x3d, 0xdb, 0x9d, - 0xd3, 0x3f, 0xbe, 0x53, 0x0b, 0x7d, 0x8f, 0x05, 0xa3, 0x4e, 0xb3, 0xe9, 0xd7, 0x1d, 0x1e, 0x9a, - 0xb8, 0xd0, 0xfd, 0xe0, 0x14, 0xed, 0x2f, 0xc6, 0x35, 0x78, 0x17, 0x5e, 0x90, 0x2b, 0x54, 0x83, - 0xf4, 0xec, 0x85, 0xde, 0x30, 0xfa, 0x90, 0x7c, 0x2a, 0x16, 0x8d, 0xa1, 0x54, 0x4f, 0xc5, 0x12, - 0xbb, 0x23, 0xf4, 0x57, 0xe2, 0x6d, 0xe3, 0x95, 0x38, 0x90, 0xef, 0xde, 0x68, 0xb0, 0xaf, 0xbd, - 0x1e, 0x88, 0xa8, 0xaa, 0x87, 0x3a, 0x18, 0xcc, 0xf7, 0x25, 0xd4, 0xde, 0x49, 0x3d, 0xc2, 0x1c, - 0x7c, 0x0e, 0x26, 0x1b, 0x26, 0x13, 0x20, 0x56, 0xe2, 0x53, 0x79, 0x74, 0x13, 0x3c, 0x43, 0x7c, - 0xed, 0x27, 0x00, 0x38, 0x49, 0x18, 0x55, 0x79, 0xe4, 0x8b, 0x8a, 0xb7, 0xe5, 0x0b, 0xcf, 0x0b, - 0x3b, 0x77, 0x2e, 0xf7, 0xc3, 0x88, 0xb4, 0x28, 0x66, 0x7c, 0xbb, 0xaf, 0x8b, 0xba, 0x58, 0x51, - 0x41, 0xaf, 0xc3, 0x10, 0x73, 0x26, 0x0b, 0x67, 0x47, 0xf2, 0x25, 0xce, 0x66, 0x28, 0xb7, 0x78, - 0x43, 0xb2, 0xbf, 0x21, 0x16, 0x14, 0xd0, 0x75, 0xe9, 0xaa, 0x19, 0x56, 0xbc, 0xdb, 0x21, 0x61, - 0xae, 0x9a, 0xa5, 0xa5, 0xf7, 0xc7, 0x5e, 0x98, 0xbc, 0x3c, 0x33, 0xdf, 0x99, 0x51, 0x93, 0x72, - 0x51, 0xe2, 0xbf, 0x4c, 0xa3, 0x36, 0x0b, 0xf9, 0xdd, 0x33, 0x53, 0xad, 0xc5, 0xc3, 0x79, 0xc7, - 0x24, 0x81, 0x93, 0x34, 0x29, 0x47, 0xca, 0x77, 0xbd, 0xf0, 0xdd, 0xe8, 0x75, 0x76, 0xf0, 0x87, - 0x38, 0xbb, 0x8d, 0x78, 0x09, 0x16, 0xf5, 0x4f, 0x94, 0x3d, 0x98, 0xf3, 0x60, 0x2a, 0xb9, 0x45, - 0x1f, 0x29, 0x3b, 0xf2, 0x87, 0x03, 0x30, 0x61, 0x2e, 0x29, 0x74, 0x05, 0x4a, 0x82, 0x88, 0x4a, - 0x7d, 0xa0, 0x76, 0xc9, 0x9a, 0x04, 0xe0, 0x18, 0x87, 0x65, 0xbc, 0x60, 0xd5, 0x35, 0x63, 0xdd, - 0x38, 0xe3, 0x85, 0x82, 0x60, 0x0d, 0x8b, 0x3e, 0xac, 0x36, 0x7d, 0x3f, 0x52, 0x17, 0x92, 0x5a, - 0x77, 0x4b, 0xac, 0x14, 0x0b, 0x28, 0xbd, 0x88, 0x76, 0x49, 0xe0, 0x91, 0xa6, 0x19, 0x24, 0x59, - 0x5d, 0x44, 0x37, 0x74, 0x20, 0x36, 0x71, 0xe9, 0x75, 0xea, 0x87, 0x6c, 0x21, 0x8b, 0xe7, 0x5b, - 0x6c, 0xfc, 0x5c, 0xe3, 0xde, 0xe2, 0x12, 0x8e, 0x3e, 0x09, 0x8f, 0xa9, 0x40, 0x50, 0x98, 0x6b, - 0x33, 0x64, 0x8b, 0x43, 0x86, 0xb4, 0xe5, 0xb1, 0xe5, 0x6c, 0x34, 0x9c, 0x57, 0x1f, 0xbd, 0x06, - 0x13, 0x82, 0xc5, 0x97, 0x14, 0x87, 0x4d, 0x03, 0x9b, 0x1b, 0x06, 0x14, 0x27, 0xb0, 0x65, 0x98, - 0x67, 0xc6, 0x65, 0x4b, 0x0a, 0x23, 0xe9, 0x30, 0xcf, 0x3a, 0x1c, 0xa7, 0x6a, 0xa0, 0x45, 0x98, - 0xe4, 0x3c, 0x98, 0xeb, 0x6d, 0xf3, 0x39, 0x11, 0xae, 0x55, 0x6a, 0x4b, 0xdd, 0x32, 0xc1, 0x38, - 0x89, 0x8f, 0x5e, 0x86, 0x31, 0x27, 0xa8, 0xef, 0xb8, 0x11, 0xa9, 0x47, 0x9d, 0x80, 0xfb, 0x5c, - 0x69, 0x16, 0x4a, 0x8b, 0x1a, 0x0c, 0x1b, 0x98, 0xf6, 0xdb, 0x30, 0x93, 0x11, 0x46, 0x82, 0x2e, - 0x1c, 0xa7, 0xed, 0xca, 0x6f, 0x4a, 0x98, 0x31, 0x2f, 0x56, 0x2b, 0xf2, 0x6b, 0x34, 0x2c, 0xba, - 0x3a, 0x59, 0xb8, 0x09, 0x2d, 0x6b, 0xa2, 0x5a, 0x9d, 0xab, 0x12, 0x80, 0x63, 0x1c, 0xfb, 0x7f, - 0x14, 0x60, 0x32, 0x43, 0xb7, 0xc2, 0x32, 0xf7, 0x25, 0x1e, 0x29, 0x71, 0xa2, 0x3e, 0x33, 0x6a, - 0x78, 0xe1, 0x08, 0x51, 0xc3, 0x8b, 0xbd, 0xa2, 0x86, 0x0f, 0xbc, 0x93, 0xa8, 0xe1, 0xe6, 0x88, - 0x0d, 0xf6, 0x35, 0x62, 0x19, 0x91, 0xc6, 0x87, 0x8e, 0x18, 0x69, 0xdc, 0x18, 0xf4, 0xe1, 0x3e, - 0x06, 0xfd, 0x87, 0x0b, 0x30, 0x95, 0xb4, 0xa4, 0x3c, 0x01, 0xb9, 0xed, 0xeb, 0x86, 0xdc, 0xf6, - 0x72, 0x3f, 0x8e, 0xb3, 0xb9, 0x32, 0x5c, 0x9c, 0x90, 0xe1, 0x7e, 0xb0, 0x2f, 0x6a, 0xdd, 0xe5, - 0xb9, 0x7f, 0xab, 0x00, 0xa7, 0x33, 0x3d, 0x77, 0x4f, 0x60, 0x6c, 0x6e, 0x19, 0x63, 0xf3, 0x5c, - 0xdf, 0x4e, 0xc5, 0xb9, 0x03, 0x74, 0x37, 0x31, 0x40, 0x57, 0xfa, 0x27, 0xd9, 0x7d, 0x94, 0xbe, - 0x5a, 0x84, 0xf3, 0x99, 0xf5, 0x62, 0xb1, 0xe7, 0xaa, 0x21, 0xf6, 0x7c, 0x3e, 0x21, 0xf6, 0xb4, - 0xbb, 0xd7, 0x3e, 0x1e, 0x39, 0xa8, 0x70, 0x97, 0x65, 0x31, 0x11, 0x1e, 0x52, 0x06, 0x6a, 0xb8, - 0xcb, 0x2a, 0x42, 0xd8, 0xa4, 0xfb, 0xcd, 0x24, 0xfb, 0xfc, 0x37, 0x16, 0x9c, 0xcd, 0x9c, 0x9b, - 0x13, 0x90, 0x75, 0xad, 0x9b, 0xb2, 0xae, 0xa7, 0xfb, 0x5e, 0xad, 0x39, 0xc2, 0xaf, 0x5f, 0x1f, - 0xc8, 0xf9, 0x16, 0xf6, 0x92, 0xbf, 0x05, 0xa3, 0x4e, 0xbd, 0x4e, 0xc2, 0x70, 0xcd, 0x6f, 0xa8, - 0xc0, 0xc8, 0xcf, 0xb1, 0x77, 0x56, 0x5c, 0x7c, 0x78, 0x30, 0x3f, 0x97, 0x24, 0x11, 0x83, 0xb1, - 0x4e, 0x01, 0x7d, 0x1a, 0x46, 0x42, 0x71, 0x6f, 0x8a, 0xb9, 0x7f, 0xa1, 0xcf, 0xc1, 0x71, 0x36, - 0x49, 0xd3, 0x8c, 0xdc, 0xa4, 0x24, 0x15, 0x8a, 0xa4, 0x19, 0xe5, 0xa5, 0x70, 0xac, 0x51, 0x5e, - 0x9e, 0x07, 0xd8, 0x53, 0x8f, 0x81, 0xa4, 0xfc, 0x41, 0x7b, 0x26, 0x68, 0x58, 0xe8, 0xe3, 0x30, - 0x15, 0xf2, 0xd0, 0x86, 0xcb, 0x4d, 0x27, 0x64, 0xce, 0x32, 0x62, 0x15, 0xb2, 0xe8, 0x50, 0xb5, - 0x04, 0x0c, 0xa7, 0xb0, 0xd1, 0xaa, 0x6c, 0x95, 0xc5, 0x61, 0xe4, 0x0b, 0xf3, 0x52, 0xdc, 0xa2, - 0xc8, 0x1b, 0x7c, 0x2a, 0x39, 0xfc, 0x6c, 0xe0, 0xb5, 0x9a, 0xe8, 0xd3, 0x00, 0x74, 0xf9, 0x08, - 0x39, 0xc4, 0x70, 0xfe, 0xe1, 0x49, 0x4f, 0x95, 0x46, 0xa6, 0x6d, 0x2f, 0xf3, 0x70, 0x2d, 0x2b, - 0x22, 0x58, 0x23, 0x68, 0xff, 0xf0, 0x00, 0x3c, 0xde, 0xe5, 0x8c, 0x44, 0x8b, 0xa6, 0x1e, 0xf6, - 0x99, 0xe4, 0xe3, 0x7a, 0x2e, 0xb3, 0xb2, 0xf1, 0xda, 0x4e, 0x2c, 0xc5, 0xc2, 0x3b, 0x5e, 0x8a, - 0x3f, 0x60, 0x69, 0x62, 0x0f, 0x6e, 0xf1, 0xf9, 0xb1, 0x23, 0x9e, 0xfd, 0xc7, 0x28, 0x07, 0xd9, - 0xca, 0x10, 0x26, 0x3c, 0xdf, 0x77, 0x77, 0xfa, 0x96, 0x2e, 0x9c, 0xac, 0x94, 0xf8, 0xb7, 0x2d, - 0x38, 0xd7, 0x35, 0xc4, 0xc7, 0x37, 0x20, 0xc3, 0x60, 0x7f, 0xc1, 0x82, 0x27, 0x33, 0x6b, 0x18, - 0x66, 0x46, 0x57, 0xa0, 0x54, 0xa7, 0x85, 0x9a, 0x97, 0x66, 0xec, 0xbe, 0x2e, 0x01, 0x38, 0xc6, - 0x39, 0x62, 0xf8, 0x92, 0x5f, 0xb5, 0x20, 0xb5, 0xe9, 0x4f, 0xe0, 0xf6, 0xa9, 0x98, 0xb7, 0xcf, - 0xfb, 0xfb, 0x19, 0xcd, 0x9c, 0x8b, 0xe7, 0x4f, 0x26, 0xe1, 0x4c, 0x8e, 0x97, 0xd2, 0x1e, 0x4c, - 0x6f, 0xd7, 0x89, 0xe9, 0xff, 0xda, 0x2d, 0x8a, 0x4c, 0x57, 0x67, 0x59, 0x96, 0xd9, 0x74, 0x3a, - 0x85, 0x82, 0xd3, 0x4d, 0xa0, 0x2f, 0x58, 0x70, 0xca, 0xb9, 0x17, 0xae, 0x50, 0x2e, 0xc2, 0xad, - 0x2f, 0x35, 0xfd, 0xfa, 0x2e, 0x3d, 0xa2, 0xe5, 0x46, 0x78, 0x31, 0x53, 0xb2, 0x73, 0xb7, 0x96, - 0xc2, 0x37, 0x9a, 0x67, 0xa9, 0x5e, 0xb3, 0xb0, 0x70, 0x66, 0x5b, 0x08, 0x8b, 0xf8, 0xff, 0xf4, - 0x8d, 0xd2, 0xc5, 0x43, 0x3b, 0xcb, 0x9d, 0x8c, 0x5f, 0x8b, 0x12, 0x82, 0x15, 0x1d, 0xf4, 0x59, - 0x28, 0x6d, 0x4b, 0x1f, 0xcf, 0x8c, 0x6b, 0x37, 0x1e, 0xc8, 0xee, 0x9e, 0xaf, 0x5c, 0x3d, 0xab, - 0x90, 0x70, 0x4c, 0x14, 0xbd, 0x06, 0x45, 0x6f, 0x2b, 0xec, 0x96, 0x2d, 0x35, 0x61, 0x87, 0xc7, - 0xe3, 0x20, 0xac, 0xaf, 0xd6, 0x30, 0xad, 0x88, 0xae, 0x43, 0x31, 0xd8, 0x6c, 0x08, 0xb1, 0x64, - 0xe6, 0x26, 0xc5, 0x4b, 0xe5, 0x9c, 0x5e, 0x31, 0x4a, 0x78, 0xa9, 0x8c, 0x29, 0x09, 0x54, 0x85, - 0x41, 0xe6, 0xda, 0x23, 0x2e, 0xb9, 0x4c, 0x76, 0xbe, 0x8b, 0x8b, 0x1c, 0x0f, 0x96, 0xc0, 0x10, - 0x30, 0x27, 0x84, 0x36, 0x60, 0xa8, 0xce, 0x32, 0x6b, 0x8a, 0xb8, 0x71, 0x1f, 0xca, 0x14, 0x40, - 0x76, 0x49, 0x39, 0x2a, 0xe4, 0x71, 0x0c, 0x03, 0x0b, 0x5a, 0x8c, 0x2a, 0x69, 0xef, 0x6c, 0x85, - 0x22, 0x13, 0x74, 0x36, 0xd5, 0x2e, 0x99, 0x74, 0x05, 0x55, 0x86, 0x81, 0x05, 0x2d, 0xf4, 0x0a, - 0x14, 0xb6, 0xea, 0xc2, 0x6d, 0x27, 0x53, 0x12, 0x69, 0x86, 0xb2, 0x58, 0x1a, 0x7a, 0x70, 0x30, - 0x5f, 0x58, 0x5d, 0xc6, 0x85, 0xad, 0x3a, 0x5a, 0x87, 0xe1, 0x2d, 0xee, 0xfc, 0x2e, 0x84, 0x8d, - 0x4f, 0x65, 0xfb, 0xe5, 0xa7, 0xfc, 0xe3, 0xb9, 0xc7, 0x8a, 0x00, 0x60, 0x49, 0x84, 0x85, 0xd3, - 0x57, 0x4e, 0xfc, 0x22, 0xc4, 0xda, 0xc2, 0xd1, 0x02, 0x2f, 0x70, 0xa6, 0x23, 0x0e, 0x05, 0x80, - 0x35, 0x8a, 0x74, 0x55, 0x3b, 0x32, 0x1d, 0xbf, 0x08, 0x36, 0x93, 0xb9, 0xaa, 0x55, 0xce, 0xfe, - 0x6e, 0xab, 0x5a, 0x21, 0xe1, 0x98, 0x28, 0xda, 0x85, 0xf1, 0xbd, 0xb0, 0xbd, 0x43, 0xe4, 0x96, - 0x66, 0xb1, 0x67, 0x72, 0xee, 0xe5, 0x3b, 0x02, 0xd1, 0x0d, 0xa2, 0x8e, 0xd3, 0x4c, 0x9d, 0x42, - 0x4c, 0xa7, 0x7f, 0x47, 0x27, 0x86, 0x4d, 0xda, 0x74, 0xf8, 0xdf, 0xea, 0xf8, 0x9b, 0xfb, 0x11, - 0x11, 0x91, 0xd1, 0x32, 0x87, 0xff, 0x0d, 0x8e, 0x92, 0x1e, 0x7e, 0x01, 0xc0, 0x92, 0x08, 0xba, - 0x23, 0x86, 0x87, 0x9d, 0x9e, 0x53, 0xf9, 0xe1, 0x4b, 0x17, 0x25, 0x52, 0xce, 0xa0, 0xb0, 0xd3, - 0x32, 0x26, 0xc5, 0x4e, 0xc9, 0xf6, 0x8e, 0x1f, 0xf9, 0x5e, 0xe2, 0x84, 0x9e, 0xce, 0x3f, 0x25, - 0xab, 0x19, 0xf8, 0xe9, 0x53, 0x32, 0x0b, 0x0b, 0x67, 0xb6, 0x85, 0x1a, 0x30, 0xd1, 0xf6, 0x83, - 0xe8, 0x9e, 0x1f, 0xc8, 0xf5, 0x85, 0xba, 0x08, 0x4b, 0x0c, 0x4c, 0xd1, 0x22, 0x0b, 0x3a, 0x68, - 0x42, 0x70, 0x82, 0x26, 0xfa, 0x04, 0x0c, 0x87, 0x75, 0xa7, 0x49, 0x2a, 0xb7, 0x66, 0x67, 0xf2, - 0xaf, 0x9f, 0x1a, 0x47, 0xc9, 0x59, 0x5d, 0x3c, 0xf6, 0x3e, 0x47, 0xc1, 0x92, 0x1c, 0x5a, 0x85, - 0x41, 0x96, 0x2e, 0x8d, 0x85, 0xf1, 0xcb, 0x89, 0xc2, 0x9a, 0xb2, 0x8a, 0xe6, 0x67, 0x13, 0x2b, - 0xc6, 0xbc, 0x3a, 0xdd, 0x03, 0xe2, 0xcd, 0xe0, 0x87, 0xb3, 0xa7, 0xf3, 0xf7, 0x80, 0x78, 0x6a, - 0xdc, 0xaa, 0x75, 0xdb, 0x03, 0x0a, 0x09, 0xc7, 0x44, 0xe9, 0xc9, 0x4c, 0x4f, 0xd3, 0x33, 0x5d, - 0xcc, 0x79, 0x72, 0xcf, 0x52, 0x76, 0x32, 0xd3, 0x93, 0x94, 0x92, 0xb0, 0x7f, 0x7f, 0x38, 0xcd, - 0xb3, 0xb0, 0x57, 0xe6, 0x77, 0x59, 0x29, 0x05, 0xe4, 0x87, 0xfb, 0x15, 0x7a, 0x1d, 0x23, 0x0b, - 0xfe, 0x05, 0x0b, 0xce, 0xb4, 0x33, 0x3f, 0x44, 0x30, 0x00, 0xfd, 0xc9, 0xce, 0xf8, 0xa7, 0xab, - 0x90, 0x8f, 0xd9, 0x70, 0x9c, 0xd3, 0x52, 0xf2, 0x99, 0x53, 0x7c, 0xc7, 0xcf, 0x9c, 0x35, 0x18, - 0x61, 0x4c, 0x66, 0x8f, 0x4c, 0xd3, 0xc9, 0xd7, 0x1e, 0x63, 0x25, 0x96, 0x45, 0x45, 0xac, 0x48, - 0xa0, 0x1f, 0xb4, 0xe0, 0x5c, 0xb2, 0xeb, 0x98, 0x30, 0xb0, 0x88, 0x13, 0xc9, 0x1f, 0xb8, 0xab, - 0xe2, 0xfb, 0x53, 0xfc, 0xbf, 0x81, 0x7c, 0xd8, 0x0b, 0x01, 0x77, 0x6f, 0x0c, 0x95, 0x33, 0x5e, - 0xd8, 0x43, 0xa6, 0x56, 0xa1, 0x8f, 0x57, 0xf6, 0x8b, 0x30, 0xd6, 0xf2, 0x3b, 0x5e, 0x24, 0xac, - 0x7f, 0x84, 0x25, 0x02, 0xd3, 0xc0, 0xaf, 0x69, 0xe5, 0xd8, 0xc0, 0x4a, 0xbc, 0xcd, 0x47, 0x1e, - 0xfa, 0x6d, 0xfe, 0x26, 0x8c, 0x79, 0x9a, 0xb9, 0xaa, 0xe0, 0x07, 0x2e, 0xe5, 0xc7, 0x78, 0xd5, - 0x8d, 0x5b, 0x79, 0x2f, 0xf5, 0x12, 0x6c, 0x50, 0x3b, 0xd9, 0x07, 0xdf, 0x97, 0xad, 0x0c, 0xa6, - 0x9e, 0x8b, 0x00, 0x3e, 0x6a, 0x8a, 0x00, 0x2e, 0x25, 0x45, 0x00, 0x29, 0x89, 0xb2, 0xf1, 0xfa, - 0xef, 0x3f, 0x85, 0x4d, 0xbf, 0x81, 0x10, 0xed, 0x26, 0x5c, 0xe8, 0x75, 0x2d, 0x31, 0x33, 0xb0, - 0x86, 0xd2, 0x1f, 0xc6, 0x66, 0x60, 0x8d, 0x4a, 0x19, 0x33, 0x48, 0xbf, 0x21, 0x76, 0xec, 0xff, - 0x66, 0x41, 0xb1, 0xea, 0x37, 0x4e, 0xe0, 0xc1, 0xfb, 0x31, 0xe3, 0xc1, 0xfb, 0x78, 0xf6, 0x85, - 0xd8, 0xc8, 0x95, 0x87, 0xaf, 0x24, 0xe4, 0xe1, 0xe7, 0xf2, 0x08, 0x74, 0x97, 0x7e, 0xff, 0x64, - 0x11, 0x46, 0xab, 0x7e, 0x43, 0xd9, 0x60, 0xff, 0xfa, 0xc3, 0xd8, 0x60, 0xe7, 0x26, 0x62, 0xd0, - 0x28, 0x33, 0xeb, 0x31, 0xe9, 0x7e, 0xfa, 0x0d, 0x66, 0x8a, 0x7d, 0x97, 0xb8, 0xdb, 0x3b, 0x11, - 0x69, 0x24, 0x3f, 0xe7, 0xe4, 0x4c, 0xb1, 0x7f, 0xbf, 0x00, 0x93, 0x89, 0xd6, 0x51, 0x13, 0xc6, - 0x9b, 0xba, 0xb4, 0x55, 0xac, 0xd3, 0x87, 0x12, 0xd4, 0x0a, 0x53, 0x56, 0xad, 0x08, 0x9b, 0xc4, - 0xd1, 0x02, 0x80, 0x52, 0x3f, 0x4a, 0xb1, 0x1e, 0xe3, 0xfa, 0x95, 0x7e, 0x32, 0xc4, 0x1a, 0x06, - 0x7a, 0x09, 0x46, 0x23, 0xbf, 0xed, 0x37, 0xfd, 0xed, 0xfd, 0x1b, 0x44, 0x06, 0x75, 0x52, 0x06, - 0x6a, 0x1b, 0x31, 0x08, 0xeb, 0x78, 0xe8, 0x3e, 0x4c, 0x2b, 0x22, 0xb5, 0x63, 0x90, 0x40, 0x33, - 0xa9, 0xc2, 0x7a, 0x92, 0x22, 0x4e, 0x37, 0x62, 0xff, 0x74, 0x91, 0x0f, 0xb1, 0x17, 0xb9, 0xef, - 0xed, 0x86, 0x77, 0xf7, 0x6e, 0xf8, 0xaa, 0x05, 0x53, 0xb4, 0x75, 0x66, 0x7d, 0x23, 0xaf, 0x79, - 0x15, 0x55, 0xda, 0xea, 0x12, 0x55, 0xfa, 0x12, 0x3d, 0x35, 0x1b, 0x7e, 0x27, 0x12, 0xb2, 0x3b, - 0xed, 0x58, 0xa4, 0xa5, 0x58, 0x40, 0x05, 0x1e, 0x09, 0x02, 0xe1, 0x31, 0xa8, 0xe3, 0x91, 0x20, - 0xc0, 0x02, 0x2a, 0x83, 0x4e, 0x0f, 0x64, 0x07, 0x9d, 0xe6, 0xc1, 0x31, 0x85, 0x9d, 0x86, 0x60, - 0xb8, 0xb4, 0xe0, 0x98, 0xd2, 0x80, 0x23, 0xc6, 0xb1, 0x7f, 0xae, 0x08, 0x63, 0x55, 0xbf, 0x11, - 0xab, 0x1e, 0x5f, 0x34, 0x54, 0x8f, 0x17, 0x12, 0xaa, 0xc7, 0x29, 0x1d, 0xf7, 0x3d, 0x45, 0xe3, - 0xd7, 0x4b, 0xd1, 0xf8, 0x4f, 0x2d, 0x36, 0x6b, 0xe5, 0xf5, 0x1a, 0x37, 0xe6, 0x42, 0x57, 0x61, - 0x94, 0x1d, 0x30, 0xcc, 0x45, 0x55, 0xea, 0xe3, 0x58, 0x32, 0xa5, 0xf5, 0xb8, 0x18, 0xeb, 0x38, - 0xe8, 0x32, 0x8c, 0x84, 0xc4, 0x09, 0xea, 0x3b, 0xea, 0x74, 0x15, 0xca, 0x33, 0x5e, 0x86, 0x15, - 0x14, 0xbd, 0x11, 0xc7, 0x65, 0x2c, 0xe6, 0xbb, 0xbc, 0xe9, 0xfd, 0xe1, 0x5b, 0x24, 0x3f, 0x18, - 0xa3, 0x7d, 0x17, 0x50, 0x1a, 0xbf, 0x8f, 0x80, 0x64, 0xf3, 0x66, 0x40, 0xb2, 0x52, 0x2a, 0x18, - 0xd9, 0x5f, 0x58, 0x30, 0x51, 0xf5, 0x1b, 0x74, 0xeb, 0x7e, 0x33, 0xed, 0x53, 0x3d, 0x28, 0xed, - 0x50, 0x97, 0xa0, 0xb4, 0x17, 0x61, 0xb0, 0xea, 0x37, 0x2a, 0xd5, 0x6e, 0xfe, 0xe6, 0xf6, 0xdf, - 0xb6, 0x60, 0xb8, 0xea, 0x37, 0x4e, 0x40, 0x2d, 0xf0, 0x51, 0x53, 0x2d, 0xf0, 0x58, 0xce, 0xba, - 0xc9, 0xd1, 0x04, 0xfc, 0xcd, 0x01, 0x18, 0xa7, 0xfd, 0xf4, 0xb7, 0xe5, 0x54, 0x1a, 0xc3, 0x66, - 0xf5, 0x31, 0x6c, 0x94, 0x0b, 0xf7, 0x9b, 0x4d, 0xff, 0x5e, 0x72, 0x5a, 0x57, 0x59, 0x29, 0x16, - 0x50, 0xf4, 0x2c, 0x8c, 0xb4, 0x03, 0xb2, 0xe7, 0xfa, 0x82, 0xbd, 0xd5, 0x94, 0x2c, 0x55, 0x51, - 0x8e, 0x15, 0x06, 0x7d, 0x16, 0x86, 0xae, 0x47, 0xaf, 0xf2, 0xba, 0xef, 0x35, 0xb8, 0xe4, 0xbc, - 0x28, 0x12, 0x4b, 0x68, 0xe5, 0xd8, 0xc0, 0x42, 0x77, 0xa1, 0xc4, 0xfe, 0xb3, 0x63, 0xe7, 0xe8, - 0x29, 0x4a, 0x45, 0xca, 0x3a, 0x41, 0x00, 0xc7, 0xb4, 0xd0, 0xf3, 0x00, 0x91, 0x8c, 0x3e, 0x1e, - 0x8a, 0xe0, 0x53, 0xea, 0x29, 0xa0, 0xe2, 0x92, 0x87, 0x58, 0xc3, 0x42, 0xcf, 0x40, 0x29, 0x72, - 0xdc, 0xe6, 0x4d, 0xd7, 0x23, 0x21, 0x93, 0x88, 0x17, 0x65, 0xe6, 0x38, 0x51, 0x88, 0x63, 0x38, - 0x65, 0xc5, 0x58, 0x64, 0x06, 0x9e, 0xe0, 0x78, 0x84, 0x61, 0x33, 0x56, 0xec, 0xa6, 0x2a, 0xc5, - 0x1a, 0x06, 0xda, 0x81, 0x27, 0x5c, 0x8f, 0x25, 0x61, 0x20, 0xb5, 0x5d, 0xb7, 0xbd, 0x71, 0xb3, - 0x76, 0x87, 0x04, 0xee, 0xd6, 0xfe, 0x92, 0x53, 0xdf, 0x25, 0x9e, 0x4c, 0x3e, 0xf9, 0x7e, 0xd1, - 0xc5, 0x27, 0x2a, 0x5d, 0x70, 0x71, 0x57, 0x4a, 0xf6, 0xcb, 0x70, 0xba, 0xea, 0x37, 0xaa, 0x7e, - 0x10, 0xad, 0xfa, 0xc1, 0x3d, 0x27, 0x68, 0xc8, 0x95, 0x32, 0x2f, 0xa3, 0x24, 0xd0, 0xa3, 0x70, - 0x90, 0x1f, 0x14, 0x46, 0x04, 0x84, 0x17, 0x18, 0xf3, 0x75, 0x44, 0xdf, 0x9e, 0x3a, 0x63, 0x03, - 0x54, 0x46, 0x92, 0x6b, 0x4e, 0x44, 0xd0, 0x2d, 0x96, 0x69, 0x39, 0xbe, 0x11, 0x45, 0xf5, 0xa7, - 0xb5, 0x4c, 0xcb, 0x31, 0x30, 0xf3, 0x0a, 0x35, 0xeb, 0xdb, 0xff, 0x7d, 0x90, 0x1d, 0x8e, 0x89, - 0xac, 0x16, 0xe8, 0x33, 0x30, 0x11, 0x92, 0x9b, 0xae, 0xd7, 0xb9, 0x2f, 0xa5, 0x11, 0x5d, 0xbc, - 0xb3, 0x6a, 0x2b, 0x3a, 0x26, 0x97, 0x69, 0x9a, 0x65, 0x38, 0x41, 0x0d, 0xb5, 0x60, 0xe2, 0x9e, - 0xeb, 0x35, 0xfc, 0x7b, 0xa1, 0xa4, 0x3f, 0x92, 0x2f, 0xda, 0xbc, 0xcb, 0x31, 0x13, 0x7d, 0x34, - 0x9a, 0xbb, 0x6b, 0x10, 0xc3, 0x09, 0xe2, 0x74, 0x01, 0x06, 0x1d, 0x6f, 0x31, 0xbc, 0x1d, 0x92, - 0x40, 0xe4, 0xcc, 0x66, 0x0b, 0x10, 0xcb, 0x42, 0x1c, 0xc3, 0xe9, 0x02, 0x64, 0x7f, 0xae, 0x05, - 0x7e, 0x87, 0xe7, 0x08, 0x10, 0x0b, 0x10, 0xab, 0x52, 0xac, 0x61, 0xd0, 0x0d, 0xca, 0xfe, 0xad, - 0xfb, 0x1e, 0xf6, 0xfd, 0x48, 0x6e, 0x69, 0x96, 0xa5, 0x55, 0x2b, 0xc7, 0x06, 0x16, 0x5a, 0x05, - 0x14, 0x76, 0xda, 0xed, 0x26, 0x33, 0xfb, 0x70, 0x9a, 0x8c, 0x14, 0x57, 0xb9, 0x17, 0x79, 0xe8, - 0xd4, 0x5a, 0x0a, 0x8a, 0x33, 0x6a, 0xd0, 0xb3, 0x7a, 0x4b, 0x74, 0x75, 0x90, 0x75, 0x95, 0xab, - 0x41, 0x6a, 0xbc, 0x9f, 0x12, 0x86, 0x56, 0x60, 0x38, 0xdc, 0x0f, 0xeb, 0x91, 0x88, 0x01, 0x97, - 0x93, 0xb8, 0xa8, 0xc6, 0x50, 0xb4, 0xbc, 0x79, 0xbc, 0x0a, 0x96, 0x75, 0x51, 0x1d, 0x66, 0x04, - 0xc5, 0xe5, 0x1d, 0xc7, 0x53, 0x69, 0x60, 0xb8, 0xf5, 0xeb, 0xd5, 0x07, 0x07, 0xf3, 0x33, 0xa2, - 0x65, 0x1d, 0x7c, 0x78, 0x30, 0x7f, 0xa6, 0xea, 0x37, 0x32, 0x20, 0x38, 0x8b, 0x1a, 0x5f, 0x7c, - 0xf5, 0xba, 0xdf, 0x6a, 0x57, 0x03, 0x7f, 0xcb, 0x6d, 0x92, 0x6e, 0xaa, 0xa4, 0x9a, 0x81, 0x29, - 0x16, 0x9f, 0x51, 0x86, 0x13, 0xd4, 0xec, 0x6f, 0x67, 0xfc, 0x0c, 0x4b, 0x13, 0x1d, 0x75, 0x02, - 0x82, 0x5a, 0x30, 0xde, 0x66, 0xdb, 0x44, 0x44, 0xee, 0x17, 0x6b, 0xfd, 0xc5, 0x3e, 0x45, 0x22, - 0xf7, 0xe8, 0x35, 0xa0, 0x44, 0x96, 0xec, 0xad, 0x59, 0xd5, 0xc9, 0x61, 0x93, 0xba, 0xfd, 0x63, - 0x8f, 0xb1, 0x1b, 0xb1, 0xc6, 0xe5, 0x1c, 0xc3, 0xc2, 0xd8, 0x5e, 0x3c, 0xad, 0xe6, 0xf2, 0x05, - 0x6e, 0xf1, 0xb4, 0x08, 0x83, 0x7d, 0x2c, 0xeb, 0xa2, 0x4f, 0xc3, 0x04, 0x7d, 0xa9, 0x68, 0xf9, - 0x57, 0x4e, 0xe5, 0x07, 0x45, 0x88, 0xd3, 0xae, 0x68, 0x59, 0x3d, 0xf4, 0xca, 0x38, 0x41, 0x0c, - 0xbd, 0xc1, 0xcc, 0x42, 0xcc, 0xd4, 0x2e, 0x3d, 0x48, 0xeb, 0x16, 0x20, 0x92, 0xac, 0x46, 0x24, - 0x2f, 0x6d, 0x8c, 0xfd, 0x68, 0xd3, 0xc6, 0xa0, 0x9b, 0x30, 0x2e, 0x72, 0x25, 0x8b, 0x95, 0x5b, - 0x34, 0xe4, 0x80, 0xe3, 0x58, 0x07, 0x1e, 0x26, 0x0b, 0xb0, 0x59, 0x19, 0x6d, 0xc3, 0x39, 0x2d, - 0x77, 0xd1, 0xb5, 0xc0, 0x61, 0xca, 0x7c, 0x97, 0x1d, 0xa7, 0xda, 0x5d, 0xfd, 0xe4, 0x83, 0x83, - 0xf9, 0x73, 0x1b, 0xdd, 0x10, 0x71, 0x77, 0x3a, 0xe8, 0x16, 0x9c, 0xe6, 0x2e, 0xbd, 0x65, 0xe2, - 0x34, 0x9a, 0xae, 0xa7, 0x98, 0x01, 0xbe, 0xe5, 0xcf, 0x3e, 0x38, 0x98, 0x3f, 0xbd, 0x98, 0x85, - 0x80, 0xb3, 0xeb, 0xa1, 0x8f, 0x42, 0xa9, 0xe1, 0x85, 0x62, 0x0c, 0x86, 0x8c, 0xf4, 0x50, 0xa5, - 0xf2, 0x7a, 0x4d, 0x7d, 0x7f, 0xfc, 0x07, 0xc7, 0x15, 0xd0, 0x36, 0x97, 0x15, 0x2b, 0x09, 0xc6, - 0x70, 0x2a, 0xa4, 0x51, 0x52, 0xc8, 0x67, 0x38, 0xf5, 0x71, 0x25, 0x89, 0xb2, 0x75, 0x37, 0xfc, - 0xfd, 0x0c, 0xc2, 0xe8, 0x75, 0x40, 0xf4, 0x05, 0xe1, 0xd6, 0xc9, 0x62, 0x9d, 0xa5, 0x85, 0x60, - 0xa2, 0xf5, 0x11, 0xd3, 0xcd, 0xac, 0x96, 0xc2, 0xc0, 0x19, 0xb5, 0xd0, 0x75, 0x7a, 0xaa, 0xe8, - 0xa5, 0xe2, 0xd4, 0x52, 0xc9, 0xfc, 0xca, 0xa4, 0x1d, 0x90, 0xba, 0x13, 0x91, 0x86, 0x49, 0x11, - 0x27, 0xea, 0xa1, 0x06, 0x3c, 0xe1, 0x74, 0x22, 0x9f, 0x89, 0xe1, 0x4d, 0xd4, 0x0d, 0x7f, 0x97, - 0x78, 0x4c, 0x03, 0x36, 0xb2, 0x74, 0x81, 0x72, 0x1b, 0x8b, 0x5d, 0xf0, 0x70, 0x57, 0x2a, 0x94, - 0x4b, 0x54, 0xd9, 0x7b, 0xc1, 0x0c, 0xd4, 0x94, 0x91, 0xc1, 0xf7, 0x25, 0x18, 0xdd, 0xf1, 0xc3, - 0x68, 0x9d, 0x44, 0xf7, 0xfc, 0x60, 0x57, 0xc4, 0xdb, 0x8c, 0x63, 0x34, 0xc7, 0x20, 0xac, 0xe3, - 0xd1, 0x67, 0x20, 0xb3, 0xcf, 0xa8, 0x94, 0x99, 0x6a, 0x7c, 0x24, 0x3e, 0x63, 0xae, 0xf3, 0x62, - 0x2c, 0xe1, 0x12, 0xb5, 0x52, 0x5d, 0x66, 0x6a, 0xee, 0x04, 0x6a, 0xa5, 0xba, 0x8c, 0x25, 0x9c, - 0x2e, 0xd7, 0x70, 0xc7, 0x09, 0x48, 0x35, 0xf0, 0xeb, 0x24, 0xd4, 0x22, 0x83, 0x3f, 0xce, 0xa3, - 0x89, 0xd2, 0xe5, 0x5a, 0xcb, 0x42, 0xc0, 0xd9, 0xf5, 0x10, 0x49, 0xe7, 0xed, 0x9a, 0xc8, 0xd7, - 0x4f, 0xa4, 0xf9, 0x99, 0x3e, 0x53, 0x77, 0x79, 0x30, 0xa5, 0x32, 0x86, 0xf1, 0xf8, 0xa1, 0xe1, - 0xec, 0x24, 0x5b, 0xdb, 0xfd, 0x07, 0x1f, 0x55, 0x1a, 0x9f, 0x4a, 0x82, 0x12, 0x4e, 0xd1, 0x36, - 0x62, 0x71, 0x4d, 0xf5, 0x8c, 0xc5, 0x75, 0x05, 0x4a, 0x61, 0x67, 0xb3, 0xe1, 0xb7, 0x1c, 0xd7, - 0x63, 0x6a, 0x6e, 0xed, 0x3d, 0x52, 0x93, 0x00, 0x1c, 0xe3, 0xa0, 0x55, 0x18, 0x71, 0xa4, 0x3a, - 0x07, 0xe5, 0x47, 0x5f, 0x51, 0x4a, 0x1c, 0x1e, 0x90, 0x40, 0x2a, 0x70, 0x54, 0x5d, 0xf4, 0x2a, - 0x8c, 0x0b, 0x97, 0x54, 0x91, 0xac, 0x72, 0xc6, 0xf4, 0x1b, 0xaa, 0xe9, 0x40, 0x6c, 0xe2, 0xa2, - 0xdb, 0x30, 0x1a, 0xf9, 0x4d, 0xe6, 0xfc, 0x42, 0xd9, 0xbc, 0x33, 0xf9, 0x71, 0xc4, 0x36, 0x14, - 0x9a, 0x2e, 0x49, 0x55, 0x55, 0xb1, 0x4e, 0x07, 0x6d, 0xf0, 0xf5, 0xce, 0x22, 0x64, 0x93, 0x70, - 0xf6, 0xb1, 0xfc, 0x3b, 0x49, 0x05, 0xd2, 0x36, 0xb7, 0x83, 0xa8, 0x89, 0x75, 0x32, 0xe8, 0x1a, - 0x4c, 0xb7, 0x03, 0xd7, 0x67, 0x6b, 0x42, 0x69, 0xf2, 0x66, 0xcd, 0xf4, 0x3c, 0xd5, 0x24, 0x02, - 0x4e, 0xd7, 0x61, 0x1e, 0xc5, 0xa2, 0x70, 0xf6, 0x2c, 0xcf, 0x67, 0xcd, 0x9f, 0x77, 0xbc, 0x0c, - 0x2b, 0x28, 0x5a, 0x63, 0x27, 0x31, 0x97, 0x4c, 0xcc, 0xce, 0xe5, 0x07, 0x7c, 0xd1, 0x25, 0x18, - 0x9c, 0x79, 0x55, 0x7f, 0x71, 0x4c, 0x01, 0x35, 0xb4, 0xc4, 0x87, 0xf4, 0xc5, 0x10, 0xce, 0x3e, - 0xd1, 0xc5, 0x48, 0x2e, 0xf1, 0xbc, 0x88, 0x19, 0x02, 0xa3, 0x38, 0xc4, 0x09, 0x9a, 0xe8, 0xe3, - 0x30, 0x25, 0xc2, 0xd4, 0xc5, 0xc3, 0x74, 0x2e, 0x36, 0x29, 0xc6, 0x09, 0x18, 0x4e, 0x61, 0xf3, - 0xcc, 0x01, 0xce, 0x66, 0x93, 0x88, 0xa3, 0xef, 0xa6, 0xeb, 0xed, 0x86, 0xb3, 0xe7, 0xd9, 0xf9, - 0x20, 0x32, 0x07, 0x24, 0xa1, 0x38, 0xa3, 0x06, 0xda, 0x80, 0xa9, 0x76, 0x40, 0x48, 0x8b, 0x31, - 0xfa, 0xe2, 0x3e, 0x9b, 0xe7, 0x0e, 0xf5, 0xb4, 0x27, 0xd5, 0x04, 0xec, 0x30, 0xa3, 0x0c, 0xa7, - 0x28, 0xa0, 0x7b, 0x30, 0xe2, 0xef, 0x91, 0x60, 0x87, 0x38, 0x8d, 0xd9, 0x0b, 0x5d, 0x4c, 0xdc, - 0xc5, 0xe5, 0x76, 0x4b, 0xe0, 0x26, 0xb4, 0xff, 0xb2, 0xb8, 0xb7, 0xf6, 0x5f, 0x36, 0x86, 0x7e, - 0xc8, 0x82, 0xb3, 0x52, 0x61, 0x50, 0x6b, 0xd3, 0x51, 0x5f, 0xf6, 0xbd, 0x30, 0x0a, 0xb8, 0x0b, - 0xf8, 0x93, 0xf9, 0x6e, 0xd1, 0x1b, 0x39, 0x95, 0x94, 0x70, 0xf4, 0x6c, 0x1e, 0x46, 0x88, 0xf3, - 0x5b, 0x44, 0xcb, 0x30, 0x1d, 0x92, 0x48, 0x1e, 0x46, 0x8b, 0xe1, 0xea, 0x1b, 0xe5, 0xf5, 0xd9, - 0x8b, 0xdc, 0x7f, 0x9d, 0x6e, 0x86, 0x5a, 0x12, 0x88, 0xd3, 0xf8, 0x73, 0xdf, 0x0a, 0xd3, 0xa9, - 0xeb, 0xff, 0x28, 0x19, 0x51, 0xe6, 0x76, 0x61, 0xdc, 0x18, 0xe2, 0x47, 0xaa, 0x3d, 0xfe, 0x57, - 0xc3, 0x50, 0x52, 0x9a, 0x45, 0x74, 0xc5, 0x54, 0x18, 0x9f, 0x4d, 0x2a, 0x8c, 0x47, 0xe8, 0xbb, - 0x5e, 0xd7, 0x11, 0x6f, 0x64, 0x44, 0xed, 0xca, 0xdb, 0xd0, 0xfd, 0xbb, 0x63, 0x6b, 0xe2, 0xda, - 0x62, 0xdf, 0x9a, 0xe7, 0x81, 0xae, 0x12, 0xe0, 0x6b, 0x30, 0xed, 0xf9, 0x8c, 0xe7, 0x24, 0x0d, - 0xc9, 0x50, 0x30, 0xbe, 0xa1, 0xa4, 0x87, 0xc1, 0x48, 0x20, 0xe0, 0x74, 0x1d, 0xda, 0x20, 0xbf, - 0xf8, 0x93, 0x22, 0x67, 0xce, 0x17, 0x60, 0x01, 0x45, 0x17, 0x61, 0xb0, 0xed, 0x37, 0x2a, 0x55, - 0xc1, 0x6f, 0x6a, 0xb1, 0x22, 0x1b, 0x95, 0x2a, 0xe6, 0x30, 0xb4, 0x08, 0x43, 0xec, 0x47, 0x38, - 0x3b, 0x96, 0x1f, 0xef, 0x80, 0xd5, 0xd0, 0xf2, 0xcd, 0xb0, 0x0a, 0x58, 0x54, 0x64, 0xa2, 0x2f, - 0xca, 0xa4, 0x33, 0xd1, 0xd7, 0xf0, 0x43, 0x8a, 0xbe, 0x24, 0x01, 0x1c, 0xd3, 0x42, 0xf7, 0xe1, - 0xb4, 0xf1, 0x30, 0xe2, 0x4b, 0x84, 0x84, 0xc2, 0xe7, 0xfa, 0x62, 0xd7, 0x17, 0x91, 0xd0, 0x54, - 0x9f, 0x13, 0x9d, 0x3e, 0x5d, 0xc9, 0xa2, 0x84, 0xb3, 0x1b, 0x40, 0x4d, 0x98, 0xae, 0xa7, 0x5a, - 0x1d, 0xe9, 0xbf, 0x55, 0x35, 0xa1, 0xe9, 0x16, 0xd3, 0x84, 0xd1, 0xab, 0x30, 0xf2, 0x96, 0x1f, - 0xb2, 0xb3, 0x5a, 0xf0, 0xc8, 0xd2, 0x61, 0x77, 0xe4, 0x8d, 0x5b, 0x35, 0x56, 0x7e, 0x78, 0x30, - 0x3f, 0x5a, 0xf5, 0x1b, 0xf2, 0x2f, 0x56, 0x15, 0xd0, 0xf7, 0x5a, 0x30, 0x97, 0x7e, 0x79, 0xa9, - 0x4e, 0x8f, 0xf7, 0xdf, 0x69, 0x5b, 0x34, 0x3a, 0xb7, 0x92, 0x4b, 0x0e, 0x77, 0x69, 0xca, 0xfe, - 0x65, 0x8b, 0x49, 0xdd, 0x84, 0x06, 0x88, 0x84, 0x9d, 0xe6, 0x49, 0xa4, 0xd9, 0x5c, 0x31, 0x94, - 0x53, 0x0f, 0x6d, 0xb9, 0xf0, 0xcf, 0x2d, 0x66, 0xb9, 0x70, 0x82, 0x2e, 0x0a, 0x6f, 0xc0, 0x48, - 0x24, 0x93, 0xa5, 0x76, 0xc9, 0x0c, 0xaa, 0x75, 0x8a, 0x59, 0x6f, 0x28, 0x8e, 0x55, 0xe5, 0x45, - 0x55, 0x64, 0xec, 0x7f, 0xc4, 0x67, 0x40, 0x42, 0x4e, 0x40, 0x07, 0x50, 0x36, 0x75, 0x00, 0xf3, - 0x3d, 0xbe, 0x20, 0x47, 0x17, 0xf0, 0x0f, 0xcd, 0x7e, 0x33, 0x49, 0xcd, 0xbb, 0xdd, 0x64, 0xc6, - 0xfe, 0xa2, 0x05, 0x10, 0x87, 0xe2, 0x65, 0xf2, 0x65, 0x3f, 0x90, 0x39, 0x16, 0xb3, 0xb2, 0x09, - 0xbd, 0x4c, 0x79, 0x54, 0x3f, 0xf2, 0xeb, 0x7e, 0x53, 0x68, 0xb8, 0x9e, 0x88, 0xd5, 0x10, 0xbc, - 0xfc, 0x50, 0xfb, 0x8d, 0x15, 0x36, 0x9a, 0x97, 0x81, 0xbf, 0x8a, 0xb1, 0x62, 0xcc, 0x08, 0xfa, - 0xf5, 0x23, 0x16, 0x9c, 0xca, 0xb2, 0x77, 0xa5, 0x2f, 0x1e, 0x2e, 0xb3, 0x52, 0xe6, 0x4c, 0x6a, - 0x36, 0xef, 0x88, 0x72, 0xac, 0x30, 0xfa, 0xce, 0x1c, 0x76, 0xb4, 0x18, 0xb8, 0xb7, 0x60, 0xbc, - 0x1a, 0x10, 0xed, 0x72, 0x7d, 0x8d, 0x3b, 0x93, 0xf3, 0xfe, 0x3c, 0x7b, 0x64, 0x47, 0x72, 0xfb, - 0x67, 0x0a, 0x70, 0x8a, 0x5b, 0x05, 0x2c, 0xee, 0xf9, 0x6e, 0xa3, 0xea, 0x37, 0x44, 0xd6, 0xb7, - 0x4f, 0xc1, 0x58, 0x5b, 0x13, 0x34, 0x76, 0x8b, 0xe7, 0xa8, 0x0b, 0x24, 0x63, 0xd1, 0x88, 0x5e, - 0x8a, 0x0d, 0x5a, 0xa8, 0x01, 0x63, 0x64, 0xcf, 0xad, 0x2b, 0xd5, 0x72, 0xe1, 0xc8, 0x17, 0x9d, - 0x6a, 0x65, 0x45, 0xa3, 0x83, 0x0d, 0xaa, 0x8f, 0x20, 0x9f, 0xaf, 0xfd, 0xa3, 0x16, 0x3c, 0x96, - 0x13, 0xfd, 0x91, 0x36, 0x77, 0x8f, 0xd9, 0x5f, 0x88, 0x65, 0xab, 0x9a, 0xe3, 0x56, 0x19, 0x58, - 0x40, 0xd1, 0x27, 0x00, 0xb8, 0x55, 0x05, 0x7d, 0x72, 0xf7, 0x0a, 0x93, 0x67, 0x44, 0xf8, 0xd2, - 0x82, 0x35, 0xc9, 0xfa, 0x58, 0xa3, 0x65, 0xff, 0x54, 0x11, 0x06, 0x79, 0x6a, 0xf6, 0x55, 0x18, - 0xde, 0xe1, 0xb9, 0x30, 0xfa, 0x49, 0xbb, 0x11, 0x0b, 0x43, 0x78, 0x01, 0x96, 0x95, 0xd1, 0x1a, - 0xcc, 0xf0, 0x5c, 0x22, 0xcd, 0x32, 0x69, 0x3a, 0xfb, 0x52, 0x72, 0xc7, 0xf3, 0x70, 0x2a, 0x09, - 0x66, 0x25, 0x8d, 0x82, 0xb3, 0xea, 0xa1, 0xd7, 0x60, 0x82, 0xbe, 0xa4, 0xfc, 0x4e, 0x24, 0x29, - 0xf1, 0x2c, 0x22, 0xea, 0xe9, 0xb6, 0x61, 0x40, 0x71, 0x02, 0x9b, 0x3e, 0xe6, 0xdb, 0x29, 0x19, - 0xe5, 0x60, 0xfc, 0x98, 0x37, 0xe5, 0x92, 0x26, 0x2e, 0x33, 0x74, 0xed, 0x30, 0xb3, 0xde, 0x8d, - 0x9d, 0x80, 0x84, 0x3b, 0x7e, 0xb3, 0xc1, 0x98, 0xbe, 0x41, 0xcd, 0xd0, 0x35, 0x01, 0xc7, 0xa9, - 0x1a, 0x94, 0xca, 0x96, 0xe3, 0x36, 0x3b, 0x01, 0x89, 0xa9, 0x0c, 0x99, 0x54, 0x56, 0x13, 0x70, - 0x9c, 0xaa, 0x41, 0xd7, 0xd1, 0xe9, 0x6a, 0xe0, 0xd3, 0x83, 0x54, 0x86, 0xb4, 0x51, 0xd6, 0xcb, - 0xc3, 0xd2, 0xfb, 0xb6, 0x4b, 0xf0, 0x37, 0x61, 0xdf, 0xc9, 0x29, 0x18, 0x06, 0x04, 0x35, 0xe1, - 0x77, 0x2b, 0xa9, 0xa0, 0xab, 0x30, 0x2a, 0x32, 0x44, 0x30, 0x23, 0x5b, 0x3e, 0x75, 0xcc, 0xe0, - 0xa1, 0x1c, 0x17, 0x63, 0x1d, 0xc7, 0xfe, 0xbe, 0x02, 0xcc, 0x64, 0x78, 0x49, 0xf0, 0xa3, 0x6a, - 0xdb, 0x0d, 0x23, 0x95, 0x6b, 0x50, 0x3b, 0xaa, 0x78, 0x39, 0x56, 0x18, 0x74, 0x3f, 0xf0, 0xc3, - 0x30, 0x79, 0x00, 0x0a, 0x2b, 0x64, 0x01, 0x3d, 0x62, 0xd6, 0xbe, 0x0b, 0x30, 0xd0, 0x09, 0x89, - 0x0c, 0xdb, 0xa8, 0xae, 0x06, 0xa6, 0x07, 0x63, 0x10, 0xca, 0xaa, 0x6f, 0x2b, 0x95, 0x92, 0xc6, - 0xaa, 0x73, 0xa5, 0x12, 0x87, 0xd1, 0xce, 0x45, 0xc4, 0x73, 0xbc, 0x48, 0x30, 0xf4, 0x71, 0xfc, - 0x31, 0x56, 0x8a, 0x05, 0xd4, 0xfe, 0x52, 0x11, 0xce, 0xe6, 0xfa, 0x4d, 0xd1, 0xae, 0xb7, 0x7c, - 0xcf, 0x8d, 0x7c, 0x65, 0x49, 0xc2, 0x63, 0x8e, 0x91, 0xf6, 0xce, 0x9a, 0x28, 0xc7, 0x0a, 0x03, - 0x5d, 0x82, 0x41, 0x26, 0x45, 0x4b, 0x65, 0x5d, 0x5c, 0x2a, 0xf3, 0x20, 0x34, 0x1c, 0xdc, 0x77, - 0x46, 0xdb, 0x8b, 0xf4, 0x96, 0xf4, 0x9b, 0xc9, 0x43, 0x8b, 0x76, 0xd7, 0xf7, 0x9b, 0x98, 0x01, - 0xd1, 0x07, 0xc4, 0x78, 0x25, 0x4c, 0x27, 0xb0, 0xd3, 0xf0, 0x43, 0x6d, 0xd0, 0x9e, 0x86, 0xe1, - 0x5d, 0xb2, 0x1f, 0xb8, 0xde, 0x76, 0xd2, 0xa4, 0xe6, 0x06, 0x2f, 0xc6, 0x12, 0x6e, 0x26, 0xd0, - 0x1a, 0x3e, 0xee, 0x54, 0xb4, 0x23, 0x3d, 0xaf, 0xc0, 0x1f, 0x28, 0xc2, 0x24, 0x5e, 0x2a, 0xbf, - 0x37, 0x11, 0xb7, 0xd3, 0x13, 0x71, 0xdc, 0xa9, 0x68, 0x7b, 0xcf, 0xc6, 0x2f, 0x58, 0x30, 0xc9, - 0xf2, 0x54, 0x88, 0x68, 0x55, 0xae, 0xef, 0x9d, 0x00, 0xbb, 0x79, 0x11, 0x06, 0x03, 0xda, 0x68, - 0x32, 0xdd, 0x22, 0xeb, 0x09, 0xe6, 0x30, 0xf4, 0x04, 0x0c, 0xb0, 0x2e, 0xd0, 0xc9, 0x1b, 0xe3, - 0x99, 0xaa, 0xca, 0x4e, 0xe4, 0x60, 0x56, 0xca, 0x42, 0xb0, 0x60, 0xd2, 0x6e, 0xba, 0xbc, 0xd3, - 0xb1, 0x8e, 0xf3, 0xdd, 0xe1, 0x51, 0x9d, 0xd9, 0xb5, 0x77, 0x16, 0x82, 0x25, 0x9b, 0x64, 0xf7, - 0xa7, 0xdc, 0x1f, 0x17, 0xe0, 0x7c, 0x66, 0xbd, 0xbe, 0x43, 0xb0, 0x74, 0xaf, 0xfd, 0x28, 0x33, - 0x11, 0x14, 0x4f, 0xd0, 0x60, 0x71, 0xa0, 0x5f, 0x0e, 0x73, 0xb0, 0x8f, 0xc8, 0x28, 0x99, 0x43, - 0xf6, 0x2e, 0x89, 0x8c, 0x92, 0xd9, 0xb7, 0x9c, 0xa7, 0xe8, 0x5f, 0x16, 0x72, 0xbe, 0x85, 0x3d, - 0x4a, 0x2f, 0xd3, 0x73, 0x86, 0x01, 0x43, 0xf9, 0xd0, 0xe3, 0x67, 0x0c, 0x2f, 0xc3, 0x0a, 0x8a, - 0x16, 0x61, 0xb2, 0xe5, 0x7a, 0xf4, 0xf0, 0xd9, 0x37, 0x19, 0x3f, 0x15, 0xb8, 0x6a, 0xcd, 0x04, - 0xe3, 0x24, 0x3e, 0x72, 0xb5, 0xa8, 0x29, 0x85, 0xfc, 0x04, 0xe6, 0xb9, 0xbd, 0x5d, 0x30, 0xf5, - 0xbf, 0x6a, 0x14, 0x33, 0x22, 0xa8, 0xac, 0x69, 0xb2, 0x88, 0x62, 0xff, 0xb2, 0x88, 0xb1, 0x6c, - 0x39, 0xc4, 0xdc, 0xab, 0x30, 0xfe, 0xd0, 0xc2, 0x67, 0xfb, 0xab, 0x45, 0x78, 0xbc, 0xcb, 0xb6, - 0xe7, 0x67, 0xbd, 0x31, 0x07, 0xda, 0x59, 0x9f, 0x9a, 0x87, 0x2a, 0x9c, 0xda, 0xea, 0x34, 0x9b, - 0xfb, 0xcc, 0x8e, 0x9f, 0x34, 0x24, 0x86, 0xe0, 0x29, 0xe5, 0x03, 0xfc, 0xd4, 0x6a, 0x06, 0x0e, - 0xce, 0xac, 0x49, 0x19, 0x7a, 0x7a, 0x93, 0xec, 0x2b, 0x52, 0x09, 0x86, 0x1e, 0xeb, 0x40, 0x6c, - 0xe2, 0xa2, 0x6b, 0x30, 0xed, 0xec, 0x39, 0x2e, 0x0f, 0x3d, 0x2b, 0x09, 0x70, 0x8e, 0x5e, 0xc9, - 0x0c, 0x17, 0x93, 0x08, 0x38, 0x5d, 0x07, 0xbd, 0x0e, 0xc8, 0xdf, 0x64, 0xd6, 0xbe, 0x8d, 0x6b, - 0xc4, 0x13, 0x6a, 0x3a, 0x36, 0x77, 0xc5, 0xf8, 0x48, 0xb8, 0x95, 0xc2, 0xc0, 0x19, 0xb5, 0x12, - 0x51, 0x48, 0x86, 0xf2, 0xa3, 0x90, 0x74, 0x3f, 0x17, 0x7b, 0x26, 0xc1, 0xf8, 0x4f, 0x16, 0xbd, - 0xbe, 0x38, 0x93, 0x6f, 0x06, 0xd3, 0x7b, 0x95, 0x99, 0xd9, 0x71, 0x79, 0xa2, 0x16, 0x3b, 0xe3, - 0xb4, 0x66, 0x66, 0x17, 0x03, 0xb1, 0x89, 0xcb, 0x17, 0x44, 0x18, 0xbb, 0x6c, 0x1a, 0x2c, 0xbe, - 0x88, 0xf8, 0xa3, 0x30, 0xd0, 0x27, 0x61, 0xb8, 0xe1, 0xee, 0xb9, 0xa1, 0x90, 0xa6, 0x1c, 0x59, - 0x75, 0x11, 0x9f, 0x83, 0x65, 0x4e, 0x06, 0x4b, 0x7a, 0xf6, 0x0f, 0x14, 0x60, 0x5c, 0xb6, 0xf8, - 0x46, 0xc7, 0x8f, 0x9c, 0x13, 0xb8, 0x96, 0xaf, 0x19, 0xd7, 0xf2, 0x07, 0xba, 0x85, 0x3d, 0x62, - 0x5d, 0xca, 0xbd, 0x8e, 0x6f, 0x25, 0xae, 0xe3, 0xa7, 0x7a, 0x93, 0xea, 0x7e, 0x0d, 0xff, 0x63, - 0x0b, 0xa6, 0x0d, 0xfc, 0x13, 0xb8, 0x0d, 0x56, 0xcd, 0xdb, 0xe0, 0xc9, 0x9e, 0xdf, 0x90, 0x73, - 0x0b, 0x7c, 0x77, 0x31, 0xd1, 0x77, 0x76, 0xfa, 0xbf, 0x05, 0x03, 0x3b, 0x4e, 0xd0, 0xe8, 0x16, - 0xe6, 0x3d, 0x55, 0x69, 0xe1, 0xba, 0x13, 0x08, 0x3d, 0xe5, 0xb3, 0x2a, 0x7f, 0xb8, 0x13, 0xf4, - 0xd6, 0x51, 0xb2, 0xa6, 0xd0, 0xcb, 0x30, 0x14, 0xd6, 0xfd, 0xb6, 0xb2, 0xe2, 0xbf, 0xc0, 0x73, - 0x8b, 0xd3, 0x92, 0xc3, 0x83, 0x79, 0x64, 0x36, 0x47, 0x8b, 0xb1, 0xc0, 0x47, 0x9f, 0x82, 0x71, - 0xf6, 0x4b, 0x19, 0x0d, 0x15, 0xf3, 0x53, 0x42, 0xd5, 0x74, 0x44, 0x6e, 0x51, 0x67, 0x14, 0x61, - 0x93, 0xd4, 0xdc, 0x36, 0x94, 0xd4, 0x67, 0x3d, 0x52, 0xdd, 0xe0, 0xbf, 0x2f, 0xc2, 0x4c, 0xc6, - 0x9a, 0x43, 0xa1, 0x31, 0x13, 0x57, 0xfb, 0x5c, 0xaa, 0xef, 0x70, 0x2e, 0x42, 0xf6, 0x1a, 0x6a, - 0x88, 0xb5, 0xd5, 0x77, 0xa3, 0xb7, 0x43, 0x92, 0x6c, 0x94, 0x16, 0xf5, 0x6e, 0x94, 0x36, 0x76, - 0x62, 0x43, 0x4d, 0x1b, 0x52, 0x3d, 0x7d, 0xa4, 0x73, 0xfa, 0x67, 0x45, 0x38, 0x95, 0x15, 0x89, - 0x0d, 0x7d, 0x3e, 0x91, 0x64, 0xf0, 0xc5, 0x7e, 0x63, 0xb8, 0xf1, 0xcc, 0x83, 0x5c, 0x06, 0xbc, - 0xb4, 0x60, 0xa6, 0x1d, 0xec, 0x39, 0xcc, 0xa2, 0x4d, 0x16, 0x8e, 0x20, 0xe0, 0xc9, 0x21, 0xe5, - 0xf1, 0xf1, 0xe1, 0xbe, 0x3b, 0x20, 0xb2, 0x4a, 0x86, 0x09, 0x83, 0x04, 0x59, 0xdc, 0xdb, 0x20, - 0x41, 0xb6, 0x3c, 0xe7, 0xc2, 0xa8, 0xf6, 0x35, 0x8f, 0x74, 0xc6, 0x77, 0xe9, 0x6d, 0xa5, 0xf5, - 0xfb, 0x91, 0xce, 0xfa, 0x8f, 0x5a, 0x90, 0xb0, 0x51, 0x57, 0x62, 0x31, 0x2b, 0x57, 0x2c, 0x76, - 0x01, 0x06, 0x02, 0xbf, 0x49, 0x92, 0xd9, 0xf8, 0xb0, 0xdf, 0x24, 0x98, 0x41, 0x28, 0x46, 0x14, - 0x0b, 0x3b, 0xc6, 0xf4, 0x87, 0x9c, 0x78, 0xa2, 0x5d, 0x84, 0xc1, 0x26, 0xd9, 0x23, 0xcd, 0x64, - 0xd2, 0x94, 0x9b, 0xb4, 0x10, 0x73, 0x98, 0xfd, 0x0b, 0x03, 0x70, 0xae, 0x6b, 0x40, 0x0f, 0xfa, - 0x1c, 0xda, 0x76, 0x22, 0x72, 0xcf, 0xd9, 0x4f, 0x66, 0x37, 0xb8, 0xc6, 0x8b, 0xb1, 0x84, 0x33, - 0x2f, 0x22, 0x1e, 0xa4, 0x38, 0x21, 0x44, 0x14, 0xb1, 0x89, 0x05, 0xd4, 0x14, 0x4a, 0x15, 0x8f, - 0x43, 0x28, 0xf5, 0x3c, 0x40, 0x18, 0x36, 0xb9, 0x25, 0x4f, 0x43, 0xb8, 0x27, 0xc5, 0xc1, 0xac, - 0x6b, 0x37, 0x05, 0x04, 0x6b, 0x58, 0xa8, 0x0c, 0x53, 0xed, 0xc0, 0x8f, 0xb8, 0x4c, 0xb6, 0xcc, - 0x8d, 0xdd, 0x06, 0xcd, 0x58, 0x0a, 0xd5, 0x04, 0x1c, 0xa7, 0x6a, 0xa0, 0x97, 0x60, 0x54, 0xc4, - 0x57, 0xa8, 0xfa, 0x7e, 0x53, 0x88, 0x81, 0x94, 0xfd, 0x57, 0x2d, 0x06, 0x61, 0x1d, 0x4f, 0xab, - 0xc6, 0x04, 0xbd, 0xc3, 0x99, 0xd5, 0xb8, 0xb0, 0x57, 0xc3, 0x4b, 0x44, 0x65, 0x1c, 0xe9, 0x2b, - 0x2a, 0x63, 0x2c, 0x18, 0x2b, 0xf5, 0xad, 0xdb, 0x82, 0x9e, 0xa2, 0xa4, 0x9f, 0x1d, 0x80, 0x19, - 0xb1, 0x70, 0x1e, 0xf5, 0x72, 0xb9, 0x9d, 0x5e, 0x2e, 0xc7, 0x21, 0x3a, 0x7b, 0x6f, 0xcd, 0x9c, - 0xf4, 0x9a, 0xf9, 0x41, 0x0b, 0x4c, 0xf6, 0x0a, 0xfd, 0x3f, 0xb9, 0xe9, 0x61, 0x5e, 0xca, 0x65, - 0xd7, 0x1a, 0xf2, 0x02, 0x79, 0x87, 0x89, 0x62, 0xec, 0xff, 0x68, 0xc1, 0x93, 0x3d, 0x29, 0xa2, - 0x15, 0x28, 0x31, 0x1e, 0x50, 0x7b, 0x9d, 0x3d, 0xa5, 0x8c, 0x61, 0x25, 0x20, 0x87, 0x25, 0x8d, - 0x6b, 0xa2, 0x95, 0x54, 0x1e, 0x9e, 0xa7, 0x33, 0xf2, 0xf0, 0x9c, 0x36, 0x86, 0xe7, 0x21, 0x13, - 0xf1, 0x7c, 0x3f, 0xbd, 0x71, 0x0c, 0x47, 0x14, 0xf4, 0x61, 0x43, 0xec, 0x67, 0x27, 0xc4, 0x7e, - 0xc8, 0xc4, 0xd6, 0xee, 0x90, 0x8f, 0xc3, 0x14, 0x0b, 0xbc, 0xc4, 0x4c, 0xb3, 0x85, 0x8b, 0x4c, - 0x21, 0x36, 0xbf, 0xbc, 0x99, 0x80, 0xe1, 0x14, 0xb6, 0xfd, 0x47, 0x45, 0x18, 0xe2, 0xdb, 0xef, - 0x04, 0xde, 0x84, 0xcf, 0x40, 0xc9, 0x6d, 0xb5, 0x3a, 0x3c, 0xb5, 0xca, 0x20, 0xf7, 0x8b, 0xa5, - 0xf3, 0x54, 0x91, 0x85, 0x38, 0x86, 0xa3, 0x55, 0x21, 0x71, 0xee, 0x12, 0xdb, 0x91, 0x77, 0x7c, - 0xa1, 0xec, 0x44, 0x0e, 0x67, 0x70, 0xd4, 0x3d, 0x1b, 0xcb, 0xa6, 0xd1, 0x67, 0x00, 0xc2, 0x28, - 0x70, 0xbd, 0x6d, 0x5a, 0x26, 0x42, 0x99, 0x7e, 0xb0, 0x0b, 0xb5, 0x9a, 0x42, 0xe6, 0x34, 0xe3, - 0x33, 0x47, 0x01, 0xb0, 0x46, 0x11, 0x2d, 0x18, 0x37, 0xfd, 0x5c, 0x62, 0xee, 0x80, 0x53, 0x8d, - 0xe7, 0x6c, 0xee, 0x23, 0x50, 0x52, 0xc4, 0x7b, 0xc9, 0x9f, 0xc6, 0x74, 0xb6, 0xe8, 0x63, 0x30, - 0x99, 0xe8, 0xdb, 0x91, 0xc4, 0x57, 0xbf, 0x68, 0xc1, 0x24, 0xef, 0xcc, 0x8a, 0xb7, 0x27, 0x6e, - 0x83, 0xb7, 0xe1, 0x54, 0x33, 0xe3, 0x54, 0x16, 0xd3, 0xdf, 0xff, 0x29, 0xae, 0xc4, 0x55, 0x59, - 0x50, 0x9c, 0xd9, 0x06, 0xba, 0x4c, 0x77, 0x1c, 0x3d, 0x75, 0x9d, 0xa6, 0x70, 0x93, 0x1d, 0xe3, - 0xbb, 0x8d, 0x97, 0x61, 0x05, 0xb5, 0x7f, 0xd7, 0x82, 0x69, 0xde, 0xf3, 0x1b, 0x64, 0x5f, 0x9d, - 0x4d, 0x5f, 0xcf, 0xbe, 0x8b, 0xa4, 0x5e, 0x85, 0x9c, 0xa4, 0x5e, 0xfa, 0xa7, 0x15, 0xbb, 0x7e, - 0xda, 0xcf, 0x58, 0x20, 0x56, 0xc8, 0x09, 0x08, 0x21, 0xbe, 0xd5, 0x14, 0x42, 0xcc, 0xe5, 0x6f, - 0x82, 0x1c, 0xe9, 0xc3, 0x5f, 0x58, 0x30, 0xc5, 0x11, 0x62, 0x6d, 0xf9, 0xd7, 0x75, 0x1e, 0xfa, - 0x49, 0xfd, 0x7b, 0x83, 0xec, 0x6f, 0xf8, 0x55, 0x27, 0xda, 0xc9, 0xfe, 0x28, 0x63, 0xb2, 0x06, - 0xba, 0x4e, 0x56, 0x43, 0x6e, 0xa0, 0x23, 0xe4, 0x13, 0x3f, 0x72, 0xce, 0x0b, 0xfb, 0x6b, 0x16, - 0x20, 0xde, 0x8c, 0xc1, 0xb8, 0x51, 0x76, 0x88, 0x95, 0x6a, 0x17, 0x5d, 0x7c, 0x34, 0x29, 0x08, - 0xd6, 0xb0, 0x8e, 0x65, 0x78, 0x12, 0x26, 0x0f, 0xc5, 0xde, 0x26, 0x0f, 0x47, 0x18, 0xd1, 0x7f, - 0x3d, 0x04, 0x49, 0x67, 0x1c, 0x74, 0x07, 0xc6, 0xea, 0x4e, 0xdb, 0xd9, 0x74, 0x9b, 0x6e, 0xe4, - 0x92, 0xb0, 0x9b, 0xad, 0xd4, 0xb2, 0x86, 0x27, 0x94, 0xd4, 0x5a, 0x09, 0x36, 0xe8, 0xa0, 0x05, - 0x80, 0x76, 0xe0, 0xee, 0xb9, 0x4d, 0xb2, 0xcd, 0x64, 0x25, 0xcc, 0x31, 0x9f, 0x1b, 0x00, 0xc9, - 0x52, 0xac, 0x61, 0x64, 0x78, 0x3e, 0x17, 0x1f, 0xb1, 0xe7, 0x33, 0x9c, 0x98, 0xe7, 0xf3, 0xc0, - 0x91, 0x3c, 0x9f, 0x47, 0x8e, 0xec, 0xf9, 0x3c, 0xd8, 0x97, 0xe7, 0x33, 0x86, 0x33, 0x92, 0xf7, - 0xa4, 0xff, 0x57, 0xdd, 0x26, 0x11, 0x0f, 0x0e, 0x1e, 0x4d, 0x60, 0xee, 0xc1, 0xc1, 0xfc, 0x19, - 0x9c, 0x89, 0x81, 0x73, 0x6a, 0xa2, 0x4f, 0xc0, 0xac, 0xd3, 0x6c, 0xfa, 0xf7, 0xd4, 0xa4, 0xae, - 0x84, 0x75, 0xa7, 0xc9, 0x95, 0x10, 0xc3, 0x8c, 0xea, 0x13, 0x0f, 0x0e, 0xe6, 0x67, 0x17, 0x73, - 0x70, 0x70, 0x6e, 0x6d, 0xf4, 0x51, 0x28, 0xb5, 0x03, 0xbf, 0xbe, 0xa6, 0x79, 0x0c, 0x9e, 0xa7, - 0x03, 0x58, 0x95, 0x85, 0x87, 0x07, 0xf3, 0xe3, 0xea, 0x0f, 0xbb, 0xf0, 0xe3, 0x0a, 0x19, 0xae, - 0xcc, 0xa3, 0xc7, 0xea, 0xca, 0xbc, 0x0b, 0x33, 0x35, 0x12, 0xb8, 0x2c, 0xfb, 0x78, 0x23, 0x3e, - 0x9f, 0x36, 0xa0, 0x14, 0x24, 0x4e, 0xe4, 0xbe, 0xe2, 0x2d, 0x6a, 0xc9, 0x07, 0xe4, 0x09, 0x1c, - 0x13, 0xb2, 0xff, 0x97, 0x05, 0xc3, 0xc2, 0xf9, 0xe6, 0x04, 0xb8, 0xc6, 0x45, 0x43, 0x93, 0x30, - 0x9f, 0x3d, 0x60, 0xac, 0x33, 0xb9, 0x3a, 0x84, 0x4a, 0x42, 0x87, 0xf0, 0x64, 0x37, 0x22, 0xdd, - 0xb5, 0x07, 0x7f, 0xbd, 0x48, 0xb9, 0x77, 0xc3, 0x0d, 0xf4, 0xd1, 0x0f, 0xc1, 0x3a, 0x0c, 0x87, - 0xc2, 0x0d, 0xb1, 0x90, 0x6f, 0x37, 0x9f, 0x9c, 0xc4, 0xd8, 0x8e, 0x4d, 0x38, 0x1e, 0x4a, 0x22, - 0x99, 0xfe, 0x8d, 0xc5, 0x47, 0xe8, 0xdf, 0xd8, 0xcb, 0x51, 0x76, 0xe0, 0x38, 0x1c, 0x65, 0xed, - 0xaf, 0xb0, 0x9b, 0x53, 0x2f, 0x3f, 0x01, 0xa6, 0xea, 0x9a, 0x79, 0xc7, 0xda, 0x5d, 0x56, 0x96, - 0xe8, 0x54, 0x0e, 0x73, 0xf5, 0xf3, 0x16, 0x9c, 0xcb, 0xf8, 0x2a, 0x8d, 0xd3, 0x7a, 0x16, 0x46, - 0x9c, 0x4e, 0xc3, 0x55, 0x7b, 0x59, 0xd3, 0x27, 0x2e, 0x8a, 0x72, 0xac, 0x30, 0xd0, 0x32, 0x4c, - 0x93, 0xfb, 0x6d, 0x97, 0xab, 0x52, 0x75, 0x63, 0xd3, 0x22, 0xf7, 0xd8, 0x5a, 0x49, 0x02, 0x71, - 0x1a, 0x5f, 0x05, 0x27, 0x29, 0xe6, 0x06, 0x27, 0xf9, 0x7b, 0x16, 0x8c, 0x2a, 0x47, 0xbc, 0x47, - 0x3e, 0xda, 0x1f, 0x37, 0x47, 0xfb, 0xf1, 0x2e, 0xa3, 0x9d, 0x33, 0xcc, 0xbf, 0x5d, 0x50, 0xfd, - 0xad, 0xfa, 0x41, 0xd4, 0x07, 0x07, 0xf7, 0xf0, 0xe6, 0xf1, 0x57, 0x61, 0xd4, 0x69, 0xb7, 0x25, - 0x40, 0xda, 0xa0, 0xb1, 0xe8, 0xb9, 0x71, 0x31, 0xd6, 0x71, 0x94, 0xb5, 0x7e, 0x31, 0xd7, 0x5a, - 0xbf, 0x01, 0x10, 0x39, 0xc1, 0x36, 0x89, 0x68, 0x99, 0x08, 0x24, 0x96, 0x7f, 0xde, 0x74, 0x22, - 0xb7, 0xb9, 0xe0, 0x7a, 0x51, 0x18, 0x05, 0x0b, 0x15, 0x2f, 0xba, 0x15, 0xf0, 0x27, 0xa4, 0x16, - 0xa9, 0x47, 0xd1, 0xc2, 0x1a, 0x5d, 0xe9, 0x74, 0xce, 0xda, 0x18, 0x34, 0x8d, 0x19, 0xd6, 0x45, - 0x39, 0x56, 0x18, 0xf6, 0x47, 0xd8, 0xed, 0xc3, 0xc6, 0xf4, 0x68, 0xa1, 0x6d, 0xfe, 0xeb, 0x98, - 0x9a, 0x0d, 0xa6, 0xc9, 0x2c, 0xeb, 0x01, 0x74, 0xba, 0x1f, 0xf6, 0xb4, 0x61, 0xdd, 0x77, 0x2c, - 0x8e, 0xb2, 0x83, 0xbe, 0x2d, 0x65, 0xa0, 0xf2, 0x5c, 0x8f, 0x5b, 0xe3, 0x08, 0x26, 0x29, 0x2c, - 0x95, 0x06, 0x4b, 0x34, 0x50, 0xa9, 0x8a, 0x7d, 0xa1, 0xa5, 0xd2, 0x10, 0x00, 0x1c, 0xe3, 0x50, - 0x66, 0x4a, 0xfd, 0x09, 0x67, 0x51, 0x1c, 0x52, 0x52, 0x61, 0x87, 0x58, 0xc3, 0x40, 0x57, 0x84, - 0x40, 0x81, 0xeb, 0x05, 0x1e, 0x4f, 0x08, 0x14, 0xe4, 0x70, 0x69, 0x52, 0xa0, 0xab, 0x30, 0xaa, - 0xb2, 0xe9, 0x56, 0x79, 0x92, 0x56, 0xb1, 0xcc, 0x56, 0xe2, 0x62, 0xac, 0xe3, 0xa0, 0x0d, 0x98, - 0x0c, 0xb9, 0x9c, 0x4d, 0xc5, 0xf9, 0xe5, 0xf2, 0xca, 0x0f, 0x4a, 0x2b, 0xa0, 0x9a, 0x09, 0x3e, - 0x64, 0x45, 0xfc, 0x74, 0x92, 0x8e, 0xe1, 0x49, 0x12, 0xe8, 0x35, 0x98, 0x68, 0xfa, 0x4e, 0x63, - 0xc9, 0x69, 0x3a, 0x5e, 0x9d, 0x8d, 0xcf, 0x88, 0x99, 0x94, 0xf1, 0xa6, 0x01, 0xc5, 0x09, 0x6c, - 0xca, 0xbc, 0xe9, 0x25, 0x22, 0x36, 0xb5, 0xe3, 0x6d, 0x93, 0x50, 0xe4, 0x46, 0x65, 0xcc, 0xdb, - 0xcd, 0x1c, 0x1c, 0x9c, 0x5b, 0x1b, 0xbd, 0x0c, 0x63, 0xf2, 0xf3, 0xb5, 0x38, 0x0a, 0xb1, 0xe3, - 0x83, 0x06, 0xc3, 0x06, 0x26, 0xba, 0x07, 0xa7, 0xe5, 0xff, 0x8d, 0xc0, 0xd9, 0xda, 0x72, 0xeb, - 0xc2, 0xb9, 0x98, 0x7b, 0x48, 0x2e, 0x4a, 0x37, 0xbe, 0x95, 0x2c, 0xa4, 0xc3, 0x83, 0xf9, 0x0b, - 0x62, 0xd4, 0x32, 0xe1, 0x6c, 0x12, 0xb3, 0xe9, 0xa3, 0x35, 0x98, 0xd9, 0x21, 0x4e, 0x33, 0xda, - 0x59, 0xde, 0x21, 0xf5, 0x5d, 0xb9, 0xe9, 0x58, 0x74, 0x06, 0xcd, 0x5d, 0xe0, 0x7a, 0x1a, 0x05, - 0x67, 0xd5, 0x43, 0x6f, 0xc2, 0x6c, 0xbb, 0xb3, 0xd9, 0x74, 0xc3, 0x9d, 0x75, 0x3f, 0x62, 0xa6, - 0x40, 0x2a, 0x39, 0xaf, 0x08, 0xe3, 0xa0, 0xe2, 0x5f, 0x54, 0x73, 0xf0, 0x70, 0x2e, 0x05, 0xf4, - 0x36, 0x9c, 0x4e, 0x2c, 0x06, 0xe1, 0xc8, 0x3e, 0x91, 0x1f, 0xe9, 0xbf, 0x96, 0x55, 0x41, 0xc4, - 0x84, 0xc8, 0x02, 0xe1, 0xec, 0x26, 0xe8, 0xe3, 0x43, 0x0b, 0xad, 0x1a, 0xce, 0x4e, 0xc5, 0x36, - 0xcb, 0x5a, 0xfc, 0xd5, 0x10, 0x1b, 0x58, 0xe8, 0x15, 0x00, 0xb7, 0xbd, 0xea, 0xb4, 0xdc, 0x26, - 0x7d, 0x64, 0xce, 0xb0, 0x3a, 0xf4, 0xc1, 0x01, 0x95, 0xaa, 0x2c, 0xa5, 0xa7, 0xba, 0xf8, 0xb7, - 0x8f, 0x35, 0x6c, 0x54, 0x85, 0x09, 0xf1, 0x6f, 0x5f, 0x2c, 0x86, 0x69, 0xe5, 0x69, 0x3e, 0x21, - 0x6b, 0xa8, 0x15, 0x80, 0xcc, 0x12, 0x36, 0xe7, 0x89, 0xfa, 0x68, 0x1b, 0xce, 0x89, 0xec, 0xcf, - 0x44, 0x5f, 0xdd, 0x72, 0xf6, 0x42, 0x16, 0x98, 0x7f, 0x84, 0x07, 0x90, 0x59, 0xec, 0x86, 0x88, - 0xbb, 0xd3, 0xa1, 0x5c, 0x81, 0xbe, 0x49, 0xb8, 0x6f, 0xe7, 0x69, 0x6e, 0xd4, 0x44, 0xb9, 0x82, - 0x9b, 0x49, 0x20, 0x4e, 0xe3, 0xa3, 0x10, 0x4e, 0xbb, 0x5e, 0xd6, 0x9e, 0x38, 0xc3, 0x08, 0x7d, - 0x8c, 0xbb, 0xb5, 0x76, 0xdf, 0x0f, 0x99, 0x70, 0xbe, 0x1f, 0x32, 0x69, 0xbf, 0x33, 0xdb, 0xbd, - 0xdf, 0xb1, 0x68, 0x6d, 0x8d, 0xbf, 0x47, 0x9f, 0x85, 0x31, 0xfd, 0xc3, 0x04, 0xaf, 0x72, 0x29, - 0x9b, 0xfd, 0xd5, 0x4e, 0x15, 0xfe, 0x3a, 0x50, 0x27, 0x87, 0x0e, 0xc3, 0x06, 0x45, 0x54, 0xcf, - 0x70, 0x00, 0xbf, 0xd2, 0x1f, 0x2f, 0xd4, 0xbf, 0xe9, 0x1a, 0x81, 0xec, 0xcd, 0x82, 0x6e, 0xc2, - 0x48, 0xbd, 0xe9, 0x12, 0x2f, 0xaa, 0x54, 0xbb, 0x85, 0x6c, 0x5b, 0x16, 0x38, 0x62, 0xf7, 0x89, - 0x38, 0xfb, 0xbc, 0x0c, 0x2b, 0x0a, 0xf6, 0xaf, 0x15, 0x60, 0xbe, 0x47, 0xd2, 0x86, 0x84, 0x22, - 0xcb, 0xea, 0x4b, 0x91, 0xb5, 0x28, 0xf3, 0x56, 0xaf, 0x27, 0x64, 0x64, 0x89, 0x9c, 0xd4, 0xb1, - 0xa4, 0x2c, 0x89, 0xdf, 0xb7, 0x63, 0x81, 0xae, 0x0b, 0x1b, 0xe8, 0xe9, 0x1a, 0x63, 0xe8, 0xc0, - 0x07, 0xfb, 0x7f, 0x38, 0xe7, 0xea, 0x33, 0xed, 0xaf, 0x14, 0xe0, 0xb4, 0x1a, 0xc2, 0x6f, 0xde, - 0x81, 0xbb, 0x9d, 0x1e, 0xb8, 0x63, 0xd0, 0x06, 0xdb, 0xb7, 0x60, 0x88, 0xc7, 0xa0, 0xeb, 0x83, - 0x61, 0xbf, 0x68, 0x86, 0x6b, 0x55, 0x3c, 0xa2, 0x11, 0xb2, 0xf5, 0x7b, 0x2d, 0x98, 0xdc, 0x58, - 0xae, 0xd6, 0xfc, 0xfa, 0x2e, 0x89, 0x16, 0xf9, 0x03, 0x0b, 0x6b, 0xae, 0xb2, 0x0f, 0xc3, 0x54, - 0x67, 0xb1, 0xeb, 0x17, 0x60, 0x60, 0xc7, 0x0f, 0xa3, 0xa4, 0xa9, 0xc8, 0x75, 0x3f, 0x8c, 0x30, - 0x83, 0xd8, 0xbf, 0x67, 0xc1, 0xe0, 0x86, 0xe3, 0x7a, 0x91, 0x54, 0x2b, 0x58, 0x39, 0x6a, 0x85, - 0x7e, 0xbe, 0x0b, 0xbd, 0x04, 0x43, 0x64, 0x6b, 0x8b, 0xd4, 0x23, 0x31, 0xab, 0x32, 0xce, 0xc0, - 0xd0, 0x0a, 0x2b, 0xa5, 0x1c, 0x24, 0x6b, 0x8c, 0xff, 0xc5, 0x02, 0x19, 0xdd, 0x85, 0x52, 0xe4, - 0xb6, 0xc8, 0x62, 0xa3, 0x21, 0x94, 0xed, 0x0f, 0x11, 0x2b, 0x61, 0x43, 0x12, 0xc0, 0x31, 0x2d, - 0xfb, 0x4b, 0x05, 0x80, 0x38, 0x78, 0x4f, 0xaf, 0x4f, 0x5c, 0x4a, 0xa9, 0x61, 0x2f, 0x65, 0xa8, - 0x61, 0x51, 0x4c, 0x30, 0x43, 0x07, 0xab, 0x86, 0xa9, 0xd8, 0xd7, 0x30, 0x0d, 0x1c, 0x65, 0x98, - 0x96, 0x61, 0x3a, 0x0e, 0x3e, 0x64, 0xc6, 0x5e, 0x63, 0xd7, 0xe7, 0x46, 0x12, 0x88, 0xd3, 0xf8, - 0x36, 0x81, 0x0b, 0x2a, 0x06, 0x8b, 0xb8, 0xd1, 0x98, 0x2d, 0xb7, 0xae, 0xd6, 0xee, 0x31, 0x4e, - 0xb1, 0x9e, 0xb9, 0x90, 0xab, 0x67, 0xfe, 0x09, 0x0b, 0x4e, 0x25, 0xdb, 0x61, 0xce, 0xb5, 0x5f, - 0xb4, 0xe0, 0x34, 0xd3, 0xb6, 0xb3, 0x56, 0xd3, 0xba, 0xfd, 0x17, 0xbb, 0xc6, 0x95, 0xc9, 0xe9, - 0x71, 0x1c, 0xd0, 0x62, 0x2d, 0x8b, 0x34, 0xce, 0x6e, 0xd1, 0xfe, 0x0f, 0x05, 0x98, 0xcd, 0x0b, - 0x48, 0xc3, 0x5c, 0x3d, 0x9c, 0xfb, 0xb5, 0x5d, 0x72, 0x4f, 0x18, 0xd4, 0xc7, 0xae, 0x1e, 0xbc, - 0x18, 0x4b, 0x78, 0x32, 0x0e, 0x7f, 0xa1, 0xcf, 0x38, 0xfc, 0x3b, 0x30, 0x7d, 0x6f, 0x87, 0x78, - 0xb7, 0xbd, 0xd0, 0x89, 0xdc, 0x70, 0xcb, 0x65, 0x9a, 0x69, 0xbe, 0x6e, 0x5e, 0x91, 0x66, 0xef, - 0x77, 0x93, 0x08, 0x87, 0x07, 0xf3, 0xe7, 0x8c, 0x82, 0xb8, 0xcb, 0xfc, 0x20, 0xc1, 0x69, 0xa2, - 0xe9, 0x34, 0x06, 0x03, 0x8f, 0x30, 0x8d, 0x81, 0xfd, 0x45, 0x0b, 0xce, 0xe6, 0xe6, 0x4e, 0x45, - 0x97, 0x61, 0xc4, 0x69, 0xbb, 0x5c, 0xb8, 0x2f, 0x8e, 0x51, 0x26, 0x44, 0xaa, 0x56, 0xb8, 0x68, - 0x5f, 0x41, 0x55, 0x4e, 0xf7, 0x42, 0x6e, 0x4e, 0xf7, 0x9e, 0x29, 0xda, 0xed, 0xef, 0xb1, 0x40, - 0xb8, 0xa9, 0xf6, 0x71, 0x76, 0x7f, 0x0a, 0xc6, 0xf6, 0xd2, 0xa9, 0x8e, 0x2e, 0xe4, 0xfb, 0xed, - 0x8a, 0x04, 0x47, 0x8a, 0x21, 0x33, 0xd2, 0x1a, 0x19, 0xb4, 0xec, 0x06, 0x08, 0x68, 0x99, 0x30, - 0xd1, 0x75, 0xef, 0xde, 0x3c, 0x0f, 0xd0, 0x60, 0xb8, 0x5a, 0x62, 0x7c, 0x75, 0x33, 0x97, 0x15, - 0x04, 0x6b, 0x58, 0xf6, 0xbf, 0x2d, 0xc0, 0xa8, 0x4c, 0xad, 0xd3, 0xf1, 0xfa, 0x11, 0x30, 0x1d, - 0x29, 0xd7, 0x26, 0xba, 0x02, 0x25, 0x26, 0x01, 0xad, 0xc6, 0x72, 0x39, 0x25, 0x7f, 0x58, 0x93, - 0x00, 0x1c, 0xe3, 0xd0, 0x5d, 0x14, 0x76, 0x36, 0x19, 0x7a, 0xc2, 0xa9, 0xb2, 0xc6, 0x8b, 0xb1, - 0x84, 0xa3, 0x4f, 0xc0, 0x14, 0xaf, 0x17, 0xf8, 0x6d, 0x67, 0x9b, 0x6b, 0x4d, 0x06, 0x55, 0x34, - 0x84, 0xa9, 0xb5, 0x04, 0xec, 0xf0, 0x60, 0xfe, 0x54, 0xb2, 0x8c, 0xa9, 0x03, 0x53, 0x54, 0x98, - 0x71, 0x14, 0x6f, 0x84, 0xee, 0xfe, 0x94, 0x4d, 0x55, 0x0c, 0xc2, 0x3a, 0x9e, 0xfd, 0x59, 0x40, - 0xe9, 0x24, 0x43, 0xe8, 0x75, 0x6e, 0x11, 0xeb, 0x06, 0xa4, 0xd1, 0x4d, 0x3d, 0xa8, 0xfb, 0xfc, - 0x4b, 0x7f, 0x28, 0x5e, 0x0b, 0xab, 0xfa, 0xf6, 0xff, 0x5f, 0x84, 0xa9, 0xa4, 0x07, 0x38, 0xba, - 0x0e, 0x43, 0x9c, 0xf5, 0x10, 0xe4, 0xbb, 0x58, 0x9f, 0x68, 0x7e, 0xe3, 0xec, 0x10, 0x16, 0xdc, - 0x8b, 0xa8, 0x8f, 0xde, 0x84, 0xd1, 0x86, 0x7f, 0xcf, 0xbb, 0xe7, 0x04, 0x8d, 0xc5, 0x6a, 0x45, - 0x2c, 0xe7, 0xcc, 0xe7, 0x70, 0x39, 0x46, 0xd3, 0x7d, 0xd1, 0x99, 0xa6, 0x35, 0x06, 0x61, 0x9d, - 0x1c, 0xda, 0x60, 0x91, 0xc9, 0xb7, 0xdc, 0xed, 0x35, 0xa7, 0xdd, 0xcd, 0x3d, 0x62, 0x59, 0x22, - 0x69, 0x94, 0xc7, 0x45, 0xf8, 0x72, 0x0e, 0xc0, 0x31, 0x21, 0xf4, 0x79, 0x98, 0x09, 0x73, 0x84, - 0xf4, 0x79, 0x39, 0xe7, 0xba, 0xc9, 0xad, 0x97, 0x1e, 0x7b, 0x70, 0x30, 0x3f, 0x93, 0x25, 0xce, - 0xcf, 0x6a, 0xc6, 0xfe, 0x91, 0x53, 0x60, 0x6c, 0x62, 0x23, 0x05, 0xa9, 0x75, 0x4c, 0x29, 0x48, - 0x31, 0x8c, 0x90, 0x56, 0x3b, 0xda, 0x2f, 0xbb, 0x41, 0xb7, 0xc4, 0xdc, 0x2b, 0x02, 0x27, 0x4d, - 0x53, 0x42, 0xb0, 0xa2, 0x93, 0x9d, 0x27, 0xb6, 0xf8, 0x75, 0xcc, 0x13, 0x3b, 0x70, 0x82, 0x79, - 0x62, 0xd7, 0x61, 0x78, 0xdb, 0x8d, 0x30, 0x69, 0xfb, 0x82, 0xe9, 0xcf, 0x5c, 0x87, 0xd7, 0x38, - 0x4a, 0x3a, 0x23, 0xa1, 0x00, 0x60, 0x49, 0x04, 0xbd, 0xae, 0x76, 0xe0, 0x50, 0xfe, 0xc3, 0x3c, - 0x6d, 0x26, 0x91, 0xb9, 0x07, 0x45, 0x36, 0xd8, 0xe1, 0x87, 0xcd, 0x06, 0xbb, 0x2a, 0x73, 0xb8, - 0x8e, 0xe4, 0xfb, 0x32, 0xb1, 0x14, 0xad, 0x3d, 0x32, 0xb7, 0xde, 0xd1, 0xf3, 0xde, 0x96, 0xf2, - 0x4f, 0x02, 0x95, 0xd2, 0xb6, 0xcf, 0x6c, 0xb7, 0xdf, 0x63, 0xc1, 0xe9, 0x76, 0x56, 0x0a, 0x68, - 0x61, 0x51, 0xf0, 0x52, 0xdf, 0x59, 0xa6, 0x8d, 0x06, 0x99, 0x24, 0x2e, 0x13, 0x0d, 0x67, 0x37, - 0x47, 0x07, 0x3a, 0xd8, 0x6c, 0x08, 0xcd, 0xf6, 0xc5, 0x9c, 0xb4, 0xb9, 0x5d, 0x92, 0xe5, 0x6e, - 0x64, 0xa4, 0x68, 0x7d, 0x7f, 0x5e, 0x8a, 0xd6, 0xbe, 0x13, 0xb3, 0xbe, 0xae, 0x12, 0xe6, 0x8e, - 0xe7, 0x2f, 0x25, 0x9e, 0x0e, 0xb7, 0x67, 0x9a, 0xdc, 0xd7, 0x55, 0x9a, 0xdc, 0x2e, 0x61, 0x67, - 0x79, 0x12, 0xdc, 0x9e, 0xc9, 0x71, 0xb5, 0x04, 0xb7, 0x93, 0xc7, 0x93, 0xe0, 0xd6, 0xb8, 0x6a, - 0x78, 0x8e, 0xd5, 0x67, 0x7a, 0x5c, 0x35, 0x06, 0xdd, 0xee, 0x97, 0x0d, 0x4f, 0xe6, 0x3b, 0xfd, - 0x50, 0xc9, 0x7c, 0xef, 0xe8, 0xc9, 0x71, 0x51, 0x8f, 0xec, 0xaf, 0x14, 0xa9, 0xcf, 0x94, 0xb8, - 0x77, 0xf4, 0x0b, 0x70, 0x26, 0x9f, 0xae, 0xba, 0xe7, 0xd2, 0x74, 0x33, 0xaf, 0xc0, 0x54, 0xaa, - 0xdd, 0x53, 0x27, 0x93, 0x6a, 0xf7, 0xf4, 0xb1, 0xa7, 0xda, 0x3d, 0x73, 0x02, 0xa9, 0x76, 0x1f, - 0x3b, 0xc1, 0x54, 0xbb, 0x77, 0x98, 0x19, 0x0e, 0x0f, 0xf6, 0x23, 0xc2, 0xe4, 0x66, 0x87, 0x64, - 0xcd, 0x8a, 0x08, 0xc4, 0x3f, 0x4e, 0x81, 0x70, 0x4c, 0x2a, 0x23, 0x85, 0xef, 0xec, 0x23, 0x48, - 0xe1, 0xbb, 0x1e, 0xa7, 0xf0, 0x3d, 0x9b, 0x3f, 0xd5, 0x19, 0x8e, 0x1b, 0x39, 0x89, 0x7b, 0xef, - 0xe8, 0x09, 0x77, 0x1f, 0xef, 0xa2, 0x6b, 0xc9, 0x12, 0x3c, 0x76, 0x49, 0xb3, 0xfb, 0x1a, 0x4f, - 0xb3, 0xfb, 0x44, 0xfe, 0x49, 0x9e, 0xbc, 0xee, 0x8c, 0xe4, 0xba, 0xb4, 0x5f, 0x2a, 0x20, 0x23, - 0x0b, 0x08, 0x9c, 0xd3, 0x2f, 0x15, 0xd1, 0x31, 0xdd, 0x2f, 0x05, 0xc2, 0x31, 0x29, 0xfb, 0xfb, - 0x0a, 0x70, 0xbe, 0xfb, 0x7e, 0x8b, 0xa5, 0xa9, 0xd5, 0x58, 0xf5, 0x9c, 0x90, 0xa6, 0xf2, 0x37, - 0x5b, 0x8c, 0xd5, 0x77, 0x7c, 0xb9, 0x6b, 0x30, 0xad, 0x3c, 0x3e, 0x9a, 0x6e, 0x7d, 0x7f, 0x3d, - 0x7e, 0xf9, 0x2a, 0x2f, 0xf9, 0x5a, 0x12, 0x01, 0xa7, 0xeb, 0xa0, 0x45, 0x98, 0x34, 0x0a, 0x2b, - 0x65, 0xf1, 0x36, 0x53, 0xe2, 0xdb, 0x9a, 0x09, 0xc6, 0x49, 0x7c, 0xfb, 0xcb, 0x16, 0x3c, 0x96, - 0x93, 0xa3, 0xae, 0xef, 0xf0, 0x69, 0x5b, 0x30, 0xd9, 0x36, 0xab, 0xf6, 0x88, 0xf8, 0x68, 0x64, - 0xc2, 0x53, 0x7d, 0x4d, 0x00, 0x70, 0x92, 0xa8, 0xfd, 0xe7, 0x16, 0x9c, 0xeb, 0x6a, 0xc2, 0x88, - 0x30, 0x9c, 0xd9, 0x6e, 0x85, 0xce, 0x72, 0x40, 0x1a, 0xc4, 0x8b, 0x5c, 0xa7, 0x59, 0x6b, 0x93, - 0xba, 0x26, 0x0f, 0x67, 0xb6, 0x80, 0xd7, 0xd6, 0x6a, 0x8b, 0x69, 0x0c, 0x9c, 0x53, 0x13, 0xad, - 0x02, 0x4a, 0x43, 0xc4, 0x0c, 0xb3, 0xd0, 0xd2, 0x69, 0x7a, 0x38, 0xa3, 0x06, 0xfa, 0x08, 0x8c, - 0x2b, 0xd3, 0x48, 0x6d, 0xc6, 0xd9, 0xc1, 0x8e, 0x75, 0x00, 0x36, 0xf1, 0x96, 0x2e, 0xff, 0xc6, - 0x1f, 0x9c, 0x7f, 0xdf, 0x6f, 0xfd, 0xc1, 0xf9, 0xf7, 0xfd, 0xee, 0x1f, 0x9c, 0x7f, 0xdf, 0x77, - 0x3c, 0x38, 0x6f, 0xfd, 0xc6, 0x83, 0xf3, 0xd6, 0x6f, 0x3d, 0x38, 0x6f, 0xfd, 0xee, 0x83, 0xf3, - 0xd6, 0xef, 0x3f, 0x38, 0x6f, 0x7d, 0xe9, 0x0f, 0xcf, 0xbf, 0xef, 0x53, 0x85, 0xbd, 0xab, 0xff, - 0x37, 0x00, 0x00, 0xff, 0xff, 0x61, 0xb3, 0xf6, 0x22, 0x81, 0x04, 0x01, 0x00, + 0xb6, 0xbb, 0x07, 0x24, 0xf6, 0x93, 0xeb, 0xf3, 0x27, 0x3f, 0xe5, 0xc7, 0x57, 0xaa, 0x94, 0xf3, + 0xb2, 0x5d, 0xae, 0x94, 0xe3, 0x54, 0xac, 0x38, 0x49, 0xc5, 0xb1, 0x63, 0x3b, 0x96, 0x13, 0x3b, + 0x71, 0x1e, 0x4e, 0x7e, 0x38, 0x8e, 0x2b, 0xb1, 0x5c, 0xe5, 0x0a, 0x62, 0xd3, 0x49, 0xb9, 0xf4, + 0x23, 0xb6, 0x13, 0x3b, 0x3f, 0x82, 0xb8, 0xe2, 0xd4, 0x7d, 0xf6, 0xbd, 0xfd, 0x98, 0x19, 0x70, + 0x41, 0x68, 0xa5, 0xda, 0x7f, 0x33, 0xf7, 0x9c, 0x7b, 0xee, 0xed, 0xfb, 0x3c, 0xf7, 0x3c, 0xe1, + 0xd5, 0xdd, 0x97, 0xc3, 0x05, 0xd7, 0xbf, 0xb2, 0xdb, 0xd9, 0x24, 0x81, 0x47, 0x22, 0x12, 0x5e, + 0xd9, 0x23, 0x5e, 0xc3, 0x0f, 0xae, 0x08, 0x80, 0xd3, 0x76, 0xaf, 0xd4, 0xfd, 0x80, 0x5c, 0xd9, + 0xbb, 0x7a, 0x65, 0x9b, 0x78, 0x24, 0x70, 0x22, 0xd2, 0x58, 0x68, 0x07, 0x7e, 0xe4, 0x23, 0xc4, + 0x71, 0x16, 0x9c, 0xb6, 0xbb, 0x40, 0x71, 0x16, 0xf6, 0xae, 0xce, 0x3d, 0xb7, 0xed, 0x46, 0x3b, + 0x9d, 0xcd, 0x85, 0xba, 0xdf, 0xba, 0xb2, 0xed, 0x6f, 0xfb, 0x57, 0x18, 0xea, 0x66, 0x67, 0x8b, + 0xfd, 0x63, 0x7f, 0xd8, 0x2f, 0x4e, 0x62, 0xee, 0xc5, 0xb8, 0x99, 0x96, 0x53, 0xdf, 0x71, 0x3d, + 0x12, 0xec, 0x5f, 0x69, 0xef, 0x6e, 0xb3, 0x76, 0x03, 0x12, 0xfa, 0x9d, 0xa0, 0x4e, 0x92, 0x0d, + 0x77, 0xad, 0x15, 0x5e, 0x69, 0x91, 0xc8, 0xc9, 0xe8, 0xee, 0xdc, 0x95, 0xbc, 0x5a, 0x41, 0xc7, + 0x8b, 0xdc, 0x56, 0xba, 0x99, 0x0f, 0xf7, 0xaa, 0x10, 0xd6, 0x77, 0x48, 0xcb, 0x49, 0xd5, 0x7b, + 0x21, 0xaf, 0x5e, 0x27, 0x72, 0x9b, 0x57, 0x5c, 0x2f, 0x0a, 0xa3, 0x20, 0x59, 0xc9, 0xfe, 0xaa, + 0x05, 0x17, 0x16, 0xef, 0xd6, 0x56, 0x9a, 0x4e, 0x18, 0xb9, 0xf5, 0xa5, 0xa6, 0x5f, 0xdf, 0xad, + 0x45, 0x7e, 0x40, 0xee, 0xf8, 0xcd, 0x4e, 0x8b, 0xd4, 0xd8, 0x40, 0xa0, 0x67, 0x61, 0x64, 0x8f, + 0xfd, 0xaf, 0x94, 0x67, 0xad, 0x0b, 0xd6, 0xe5, 0xd2, 0xd2, 0xd4, 0xaf, 0x1f, 0xcc, 0xbf, 0xef, + 0xc1, 0xc1, 0xfc, 0xc8, 0x1d, 0x51, 0x8e, 0x15, 0x06, 0xba, 0x04, 0x43, 0x5b, 0xe1, 0xc6, 0x7e, + 0x9b, 0xcc, 0x16, 0x18, 0xee, 0x84, 0xc0, 0x1d, 0x5a, 0xad, 0xd1, 0x52, 0x2c, 0xa0, 0xe8, 0x0a, + 0x94, 0xda, 0x4e, 0x10, 0xb9, 0x91, 0xeb, 0x7b, 0xb3, 0xc5, 0x0b, 0xd6, 0xe5, 0xc1, 0xa5, 0x69, + 0x81, 0x5a, 0xaa, 0x4a, 0x00, 0x8e, 0x71, 0x68, 0x37, 0x02, 0xe2, 0x34, 0x6e, 0x79, 0xcd, 0xfd, + 0xd9, 0x81, 0x0b, 0xd6, 0xe5, 0x91, 0xb8, 0x1b, 0x58, 0x94, 0x63, 0x85, 0x61, 0xff, 0x48, 0x01, + 0x46, 0x16, 0xb7, 0xb6, 0x5c, 0xcf, 0x8d, 0xf6, 0xd1, 0x1d, 0x18, 0xf3, 0xfc, 0x06, 0x91, 0xff, + 0xd9, 0x57, 0x8c, 0x3e, 0x7f, 0x61, 0x21, 0xbd, 0x94, 0x16, 0xd6, 0x35, 0xbc, 0xa5, 0xa9, 0x07, + 0x07, 0xf3, 0x63, 0x7a, 0x09, 0x36, 0xe8, 0x20, 0x0c, 0xa3, 0x6d, 0xbf, 0xa1, 0xc8, 0x16, 0x18, + 0xd9, 0xf9, 0x2c, 0xb2, 0xd5, 0x18, 0x6d, 0x69, 0xf2, 0xc1, 0xc1, 0xfc, 0xa8, 0x56, 0x80, 0x75, + 0x22, 0x68, 0x13, 0x26, 0xe9, 0x5f, 0x2f, 0x72, 0x15, 0xdd, 0x22, 0xa3, 0x7b, 0x31, 0x8f, 0xae, + 0x86, 0xba, 0x34, 0xf3, 0xe0, 0x60, 0x7e, 0x32, 0x51, 0x88, 0x93, 0x04, 0xed, 0xb7, 0x61, 0x62, + 0x31, 0x8a, 0x9c, 0xfa, 0x0e, 0x69, 0xf0, 0x19, 0x44, 0x2f, 0xc2, 0x80, 0xe7, 0xb4, 0x88, 0x98, + 0xdf, 0x0b, 0x62, 0x60, 0x07, 0xd6, 0x9d, 0x16, 0x39, 0x3c, 0x98, 0x9f, 0xba, 0xed, 0xb9, 0x6f, + 0x75, 0xc4, 0xaa, 0xa0, 0x65, 0x98, 0x61, 0xa3, 0xe7, 0x01, 0x1a, 0x64, 0xcf, 0xad, 0x93, 0xaa, + 0x13, 0xed, 0x88, 0xf9, 0x46, 0xa2, 0x2e, 0x94, 0x15, 0x04, 0x6b, 0x58, 0xf6, 0x7d, 0x28, 0x2d, + 0xee, 0xf9, 0x6e, 0xa3, 0xea, 0x37, 0x42, 0xb4, 0x0b, 0x93, 0xed, 0x80, 0x6c, 0x91, 0x40, 0x15, + 0xcd, 0x5a, 0x17, 0x8a, 0x97, 0x47, 0x9f, 0xbf, 0x9c, 0xf9, 0xb1, 0x26, 0xea, 0x8a, 0x17, 0x05, + 0xfb, 0x4b, 0x8f, 0x89, 0xf6, 0x26, 0x13, 0x50, 0x9c, 0xa4, 0x6c, 0xff, 0x8b, 0x02, 0x9c, 0x5e, + 0x7c, 0xbb, 0x13, 0x90, 0xb2, 0x1b, 0xee, 0x26, 0x57, 0x78, 0xc3, 0x0d, 0x77, 0xd7, 0xe3, 0x11, + 0x50, 0x4b, 0xab, 0x2c, 0xca, 0xb1, 0xc2, 0x40, 0xcf, 0xc1, 0x30, 0xfd, 0x7d, 0x1b, 0x57, 0xc4, + 0x27, 0xcf, 0x08, 0xe4, 0xd1, 0xb2, 0x13, 0x39, 0x65, 0x0e, 0xc2, 0x12, 0x07, 0xad, 0xc1, 0x68, + 0x9d, 0x6d, 0xc8, 0xed, 0x35, 0xbf, 0x41, 0xd8, 0x64, 0x96, 0x96, 0x9e, 0xa1, 0xe8, 0xcb, 0x71, + 0xf1, 0xe1, 0xc1, 0xfc, 0x2c, 0xef, 0x9b, 0x20, 0xa1, 0xc1, 0xb0, 0x5e, 0x1f, 0xd9, 0x6a, 0x7f, + 0x0d, 0x30, 0x4a, 0x90, 0xb1, 0xb7, 0x2e, 0x6b, 0x5b, 0x65, 0x90, 0x6d, 0x95, 0xb1, 0xec, 0x6d, + 0x82, 0xae, 0xc2, 0xc0, 0xae, 0xeb, 0x35, 0x66, 0x87, 0x18, 0xad, 0x73, 0x74, 0xce, 0x6f, 0xb8, + 0x5e, 0xe3, 0xf0, 0x60, 0x7e, 0xda, 0xe8, 0x0e, 0x2d, 0xc4, 0x0c, 0xd5, 0xfe, 0x53, 0x0b, 0xe6, + 0x19, 0x6c, 0xd5, 0x6d, 0x92, 0x2a, 0x09, 0x42, 0x37, 0x8c, 0x88, 0x17, 0x19, 0x03, 0xfa, 0x3c, + 0x40, 0x48, 0xea, 0x01, 0x89, 0xb4, 0x21, 0x55, 0x0b, 0xa3, 0xa6, 0x20, 0x58, 0xc3, 0xa2, 0x07, + 0x42, 0xb8, 0xe3, 0x04, 0x6c, 0x7d, 0x89, 0x81, 0x55, 0x07, 0x42, 0x4d, 0x02, 0x70, 0x8c, 0x63, + 0x1c, 0x08, 0xc5, 0x5e, 0x07, 0x02, 0xfa, 0x18, 0x4c, 0xc6, 0x8d, 0x85, 0x6d, 0xa7, 0x2e, 0x07, + 0x90, 0x6d, 0x99, 0x9a, 0x09, 0xc2, 0x49, 0x5c, 0xfb, 0xef, 0x58, 0x62, 0xf1, 0xd0, 0xaf, 0x7e, + 0x97, 0x7f, 0xab, 0xfd, 0x8b, 0x16, 0x0c, 0x2f, 0xb9, 0x5e, 0xc3, 0xf5, 0xb6, 0xd1, 0x67, 0x61, + 0x84, 0xde, 0x4d, 0x0d, 0x27, 0x72, 0xc4, 0xb9, 0xf7, 0x21, 0x6d, 0x6f, 0xa9, 0xab, 0x62, 0xa1, + 0xbd, 0xbb, 0x4d, 0x0b, 0xc2, 0x05, 0x8a, 0x4d, 0x77, 0xdb, 0xad, 0xcd, 0xcf, 0x91, 0x7a, 0xb4, + 0x46, 0x22, 0x27, 0xfe, 0x9c, 0xb8, 0x0c, 0x2b, 0xaa, 0xe8, 0x06, 0x0c, 0x45, 0x4e, 0xb0, 0x4d, + 0x22, 0x71, 0x00, 0x66, 0x1e, 0x54, 0xbc, 0x26, 0xa6, 0x3b, 0x92, 0x78, 0x75, 0x12, 0x5f, 0x0b, + 0x1b, 0xac, 0x2a, 0x16, 0x24, 0xec, 0x1f, 0x1a, 0x86, 0xb3, 0xcb, 0xb5, 0x4a, 0xce, 0xba, 0xba, + 0x04, 0x43, 0x8d, 0xc0, 0xdd, 0x23, 0x81, 0x18, 0x67, 0x45, 0xa5, 0xcc, 0x4a, 0xb1, 0x80, 0xa2, + 0x97, 0x61, 0x8c, 0x5f, 0x48, 0xd7, 0x1d, 0xaf, 0xd1, 0x94, 0x43, 0x7c, 0x4a, 0x60, 0x8f, 0xdd, + 0xd1, 0x60, 0xd8, 0xc0, 0x3c, 0xe2, 0xa2, 0xba, 0x94, 0xd8, 0x8c, 0x79, 0x97, 0xdd, 0x17, 0x2d, + 0x98, 0xe2, 0xcd, 0x2c, 0x46, 0x51, 0xe0, 0x6e, 0x76, 0x22, 0x12, 0xce, 0x0e, 0xb2, 0x93, 0x6e, + 0x39, 0x6b, 0xb4, 0x72, 0x47, 0x60, 0xe1, 0x4e, 0x82, 0x0a, 0x3f, 0x04, 0x67, 0x45, 0xbb, 0x53, + 0x49, 0x30, 0x4e, 0x35, 0x8b, 0xbe, 0xd3, 0x82, 0xb9, 0xba, 0xef, 0x45, 0x81, 0xdf, 0x6c, 0x92, + 0xa0, 0xda, 0xd9, 0x6c, 0xba, 0xe1, 0x0e, 0x5f, 0xa7, 0x98, 0x6c, 0xb1, 0x93, 0x20, 0x67, 0x0e, + 0x15, 0x92, 0x98, 0xc3, 0xf3, 0x0f, 0x0e, 0xe6, 0xe7, 0x96, 0x73, 0x49, 0xe1, 0x2e, 0xcd, 0xa0, + 0x5d, 0x40, 0xf4, 0x2a, 0xad, 0x45, 0xce, 0x36, 0x89, 0x1b, 0x1f, 0xee, 0xbf, 0xf1, 0x33, 0x0f, + 0x0e, 0xe6, 0xd1, 0x7a, 0x8a, 0x04, 0xce, 0x20, 0x8b, 0xde, 0x82, 0x53, 0xb4, 0x34, 0xf5, 0xad, + 0x23, 0xfd, 0x37, 0x37, 0xfb, 0xe0, 0x60, 0xfe, 0xd4, 0x7a, 0x06, 0x11, 0x9c, 0x49, 0x1a, 0x7d, + 0x87, 0x05, 0x67, 0xe3, 0xcf, 0x5f, 0xb9, 0xdf, 0x76, 0xbc, 0x46, 0xdc, 0x70, 0xa9, 0xff, 0x86, + 0xe9, 0x99, 0x7c, 0x76, 0x39, 0x8f, 0x12, 0xce, 0x6f, 0x64, 0x6e, 0x19, 0x4e, 0x67, 0xae, 0x16, + 0x34, 0x05, 0xc5, 0x5d, 0xc2, 0xb9, 0xa0, 0x12, 0xa6, 0x3f, 0xd1, 0x29, 0x18, 0xdc, 0x73, 0x9a, + 0x1d, 0xb1, 0x51, 0x30, 0xff, 0xf3, 0x4a, 0xe1, 0x65, 0xcb, 0xfe, 0x97, 0x45, 0x98, 0x5c, 0xae, + 0x55, 0x1e, 0x6a, 0x17, 0xea, 0xd7, 0x50, 0xa1, 0xeb, 0x35, 0x14, 0x5f, 0x6a, 0xc5, 0xdc, 0x4b, + 0xed, 0xff, 0xcd, 0xd8, 0x42, 0x03, 0x6c, 0x0b, 0x7d, 0x4b, 0xce, 0x16, 0x3a, 0xe6, 0x8d, 0xb3, + 0x97, 0xb3, 0x8a, 0x06, 0xd9, 0x64, 0x66, 0x72, 0x2c, 0x37, 0xfd, 0xba, 0xd3, 0x4c, 0x1e, 0x7d, + 0x47, 0x5c, 0x4a, 0xc7, 0x33, 0x8f, 0x75, 0x18, 0x5b, 0x76, 0xda, 0xce, 0xa6, 0xdb, 0x74, 0x23, + 0x97, 0x84, 0xe8, 0x29, 0x28, 0x3a, 0x8d, 0x06, 0xe3, 0xb6, 0x4a, 0x4b, 0xa7, 0x1f, 0x1c, 0xcc, + 0x17, 0x17, 0x1b, 0xf4, 0xda, 0x07, 0x85, 0xb5, 0x8f, 0x29, 0x06, 0xfa, 0x20, 0x0c, 0x34, 0x02, + 0xbf, 0x3d, 0x5b, 0x60, 0x98, 0x74, 0xd7, 0x0d, 0x94, 0x03, 0xbf, 0x9d, 0x40, 0x65, 0x38, 0xf6, + 0xaf, 0x16, 0xe0, 0x89, 0x65, 0xd2, 0xde, 0x59, 0xad, 0xe5, 0x9c, 0xdf, 0x97, 0x61, 0xa4, 0xe5, + 0x7b, 0x6e, 0xe4, 0x07, 0xa1, 0x68, 0x9a, 0xad, 0x88, 0x35, 0x51, 0x86, 0x15, 0x14, 0x5d, 0x80, + 0x81, 0x76, 0xcc, 0x54, 0x8e, 0x49, 0x86, 0x94, 0xb1, 0x93, 0x0c, 0x42, 0x31, 0x3a, 0x21, 0x09, + 0xc4, 0x8a, 0x51, 0x18, 0xb7, 0x43, 0x12, 0x60, 0x06, 0x89, 0x6f, 0x66, 0x7a, 0x67, 0x8b, 0x13, + 0x3a, 0x71, 0x33, 0x53, 0x08, 0xd6, 0xb0, 0x50, 0x15, 0x4a, 0x61, 0x62, 0x66, 0xfb, 0xda, 0xa6, + 0xe3, 0xec, 0xea, 0x56, 0x33, 0x19, 0x13, 0x31, 0x6e, 0x94, 0xa1, 0x9e, 0x57, 0xf7, 0x57, 0x0a, + 0x80, 0xf8, 0x10, 0x7e, 0x83, 0x0d, 0xdc, 0xed, 0xf4, 0xc0, 0xf5, 0xbf, 0x25, 0x8e, 0x6b, 0xf4, + 0xfe, 0xcc, 0x82, 0x27, 0x96, 0x5d, 0xaf, 0x41, 0x82, 0x9c, 0x05, 0xf8, 0x68, 0xde, 0xb2, 0x47, + 0x63, 0x1a, 0x8c, 0x25, 0x36, 0x70, 0x0c, 0x4b, 0xcc, 0xfe, 0x63, 0x0b, 0x10, 0xff, 0xec, 0x77, + 0xdd, 0xc7, 0xde, 0x4e, 0x7f, 0xec, 0x31, 0x2c, 0x0b, 0xfb, 0x26, 0x4c, 0x2c, 0x37, 0x5d, 0xe2, + 0x45, 0x95, 0xea, 0xb2, 0xef, 0x6d, 0xb9, 0xdb, 0xe8, 0x15, 0x98, 0x88, 0xdc, 0x16, 0xf1, 0x3b, + 0x51, 0x8d, 0xd4, 0x7d, 0x8f, 0xbd, 0x24, 0xad, 0xcb, 0x83, 0x4b, 0xe8, 0xc1, 0xc1, 0xfc, 0xc4, + 0x86, 0x01, 0xc1, 0x09, 0x4c, 0xfb, 0x77, 0xe9, 0xf8, 0xf9, 0xad, 0xb6, 0xef, 0x11, 0x2f, 0x5a, + 0xf6, 0xbd, 0x06, 0x97, 0x38, 0xbc, 0x02, 0x03, 0x11, 0x1d, 0x0f, 0x3e, 0x76, 0x97, 0xe4, 0x46, + 0xa1, 0xa3, 0x70, 0x78, 0x30, 0x7f, 0x26, 0x5d, 0x83, 0x8d, 0x13, 0xab, 0x83, 0xbe, 0x05, 0x86, + 0xc2, 0xc8, 0x89, 0x3a, 0xa1, 0x18, 0xcd, 0x27, 0xe5, 0x68, 0xd6, 0x58, 0xe9, 0xe1, 0xc1, 0xfc, + 0xa4, 0xaa, 0xc6, 0x8b, 0xb0, 0xa8, 0x80, 0x9e, 0x86, 0xe1, 0x16, 0x09, 0x43, 0x67, 0x5b, 0xde, + 0x86, 0x93, 0xa2, 0xee, 0xf0, 0x1a, 0x2f, 0xc6, 0x12, 0x8e, 0x2e, 0xc2, 0x20, 0x09, 0x02, 0x3f, + 0x10, 0x7b, 0x74, 0x5c, 0x20, 0x0e, 0xae, 0xd0, 0x42, 0xcc, 0x61, 0xf6, 0xbf, 0xb3, 0x60, 0x52, + 0xf5, 0x95, 0xb7, 0x75, 0x02, 0xaf, 0x82, 0x4f, 0x01, 0xd4, 0xe5, 0x07, 0x86, 0xec, 0xf6, 0x18, + 0x7d, 0xfe, 0x52, 0xe6, 0x45, 0x9d, 0x1a, 0xc6, 0x98, 0xb2, 0x2a, 0x0a, 0xb1, 0x46, 0xcd, 0xfe, + 0x27, 0x16, 0xcc, 0x24, 0xbe, 0xe8, 0xa6, 0x1b, 0x46, 0xe8, 0xcd, 0xd4, 0x57, 0x2d, 0xf4, 0xf7, + 0x55, 0xb4, 0x36, 0xfb, 0x26, 0xb5, 0x94, 0x65, 0x89, 0xf6, 0x45, 0xd7, 0x61, 0xd0, 0x8d, 0x48, + 0x4b, 0x7e, 0xcc, 0xc5, 0xae, 0x1f, 0xc3, 0x7b, 0x15, 0xcf, 0x48, 0x85, 0xd6, 0xc4, 0x9c, 0x80, + 0xfd, 0xab, 0x45, 0x28, 0xf1, 0x65, 0xbb, 0xe6, 0xb4, 0x4f, 0x60, 0x2e, 0x9e, 0x81, 0x92, 0xdb, + 0x6a, 0x75, 0x22, 0x67, 0x53, 0x1c, 0xe7, 0x23, 0x7c, 0x6b, 0x55, 0x64, 0x21, 0x8e, 0xe1, 0xa8, + 0x02, 0x03, 0xac, 0x2b, 0xfc, 0x2b, 0x9f, 0xca, 0xfe, 0x4a, 0xd1, 0xf7, 0x85, 0xb2, 0x13, 0x39, + 0x9c, 0x93, 0x52, 0xf7, 0x08, 0x2d, 0xc2, 0x8c, 0x04, 0x72, 0x00, 0x36, 0x5d, 0xcf, 0x09, 0xf6, + 0x69, 0xd9, 0x6c, 0x91, 0x11, 0x7c, 0xae, 0x3b, 0xc1, 0x25, 0x85, 0xcf, 0xc9, 0xaa, 0x0f, 0x8b, + 0x01, 0x58, 0x23, 0x3a, 0xf7, 0x11, 0x28, 0x29, 0xe4, 0xa3, 0x30, 0x44, 0x73, 0x1f, 0x83, 0xc9, + 0x44, 0x5b, 0xbd, 0xaa, 0x8f, 0xe9, 0xfc, 0xd4, 0x2f, 0xb1, 0x23, 0x43, 0xf4, 0x7a, 0xc5, 0xdb, + 0x13, 0x47, 0xee, 0xdb, 0x70, 0xaa, 0x99, 0x71, 0x92, 0x89, 0x79, 0xed, 0xff, 0xe4, 0x7b, 0x42, + 0x7c, 0xf6, 0xa9, 0x2c, 0x28, 0xce, 0x6c, 0x83, 0xf2, 0x08, 0x7e, 0x9b, 0x6e, 0x10, 0xa7, 0xa9, + 0xb3, 0xdb, 0xb7, 0x44, 0x19, 0x56, 0x50, 0x7a, 0xde, 0x9d, 0x52, 0x9d, 0xbf, 0x41, 0xf6, 0x6b, + 0xa4, 0x49, 0xea, 0x91, 0x1f, 0x7c, 0x5d, 0xbb, 0x7f, 0x8e, 0x8f, 0x3e, 0x3f, 0x2e, 0x47, 0x05, + 0x81, 0xe2, 0x0d, 0xb2, 0xcf, 0xa7, 0x42, 0xff, 0xba, 0x62, 0xd7, 0xaf, 0xfb, 0x19, 0x0b, 0xc6, + 0xd5, 0xd7, 0x9d, 0xc0, 0xb9, 0xb0, 0x64, 0x9e, 0x0b, 0xe7, 0xba, 0x2e, 0xf0, 0x9c, 0x13, 0xe1, + 0x2b, 0x05, 0x38, 0xab, 0x70, 0xe8, 0xdb, 0x80, 0xff, 0x11, 0xab, 0xea, 0x0a, 0x94, 0x3c, 0x25, + 0xb5, 0xb2, 0x4c, 0x71, 0x51, 0x2c, 0xb3, 0x8a, 0x71, 0x28, 0x8b, 0xe7, 0xc5, 0xa2, 0xa5, 0x31, + 0x5d, 0x9c, 0x2b, 0x44, 0xb7, 0x4b, 0x50, 0xec, 0xb8, 0x0d, 0x71, 0xc1, 0x7c, 0x48, 0x8e, 0xf6, + 0xed, 0x4a, 0xf9, 0xf0, 0x60, 0xfe, 0xc9, 0x3c, 0x55, 0x02, 0xbd, 0xd9, 0xc2, 0x85, 0xdb, 0x95, + 0x32, 0xa6, 0x95, 0xd1, 0x22, 0x4c, 0x4a, 0x6d, 0xc9, 0x1d, 0xca, 0x6e, 0xf9, 0x9e, 0xb8, 0x87, + 0x94, 0x4c, 0x16, 0x9b, 0x60, 0x9c, 0xc4, 0x47, 0x65, 0x98, 0xda, 0xed, 0x6c, 0x92, 0x26, 0x89, + 0xf8, 0x07, 0xdf, 0x20, 0x5c, 0x62, 0x59, 0x8a, 0x5f, 0x66, 0x37, 0x12, 0x70, 0x9c, 0xaa, 0x61, + 0xff, 0x05, 0xbb, 0x0f, 0xc4, 0xe8, 0x55, 0x03, 0x9f, 0x2e, 0x2c, 0x4a, 0xfd, 0xeb, 0xb9, 0x9c, + 0xfb, 0x59, 0x15, 0x37, 0xc8, 0xfe, 0x86, 0x4f, 0x39, 0xf3, 0xec, 0x55, 0x61, 0xac, 0xf9, 0x81, + 0xae, 0x6b, 0xfe, 0xe7, 0x0a, 0x70, 0x5a, 0x8d, 0x80, 0xc1, 0x04, 0x7e, 0xa3, 0x8f, 0xc1, 0x55, + 0x18, 0x6d, 0x90, 0x2d, 0xa7, 0xd3, 0x8c, 0x94, 0xf8, 0x7c, 0x90, 0xab, 0x50, 0xca, 0x71, 0x31, + 0xd6, 0x71, 0x8e, 0x30, 0x6c, 0xff, 0x73, 0x94, 0x5d, 0xc4, 0x91, 0x43, 0xd7, 0xb8, 0xda, 0x35, + 0x56, 0xee, 0xae, 0xb9, 0x08, 0x83, 0x6e, 0x8b, 0x32, 0x66, 0x05, 0x93, 0xdf, 0xaa, 0xd0, 0x42, + 0xcc, 0x61, 0xe8, 0x03, 0x30, 0x5c, 0xf7, 0x5b, 0x2d, 0xc7, 0x6b, 0xb0, 0x2b, 0xaf, 0xb4, 0x34, + 0x4a, 0x79, 0xb7, 0x65, 0x5e, 0x84, 0x25, 0x0c, 0x3d, 0x01, 0x03, 0x4e, 0xb0, 0xcd, 0x65, 0x18, + 0xa5, 0xa5, 0x11, 0xda, 0xd2, 0x62, 0xb0, 0x1d, 0x62, 0x56, 0x4a, 0x9f, 0x60, 0xf7, 0xfc, 0x60, + 0xd7, 0xf5, 0xb6, 0xcb, 0x6e, 0x20, 0xb6, 0x84, 0xba, 0x0b, 0xef, 0x2a, 0x08, 0xd6, 0xb0, 0xd0, + 0x2a, 0x0c, 0xb6, 0xfd, 0x20, 0x0a, 0x67, 0x87, 0xd8, 0x70, 0x3f, 0x99, 0x73, 0x10, 0xf1, 0xaf, + 0xad, 0xfa, 0x41, 0x14, 0x7f, 0x00, 0xfd, 0x17, 0x62, 0x5e, 0x1d, 0xdd, 0x84, 0x61, 0xe2, 0xed, + 0xad, 0x06, 0x7e, 0x6b, 0x76, 0x26, 0x9f, 0xd2, 0x0a, 0x47, 0xe1, 0xcb, 0x2c, 0xe6, 0x51, 0x45, + 0x31, 0x96, 0x24, 0xd0, 0xb7, 0x40, 0x91, 0x78, 0x7b, 0xb3, 0xc3, 0x8c, 0xd2, 0x5c, 0x0e, 0xa5, + 0x3b, 0x4e, 0x10, 0x9f, 0xf9, 0x2b, 0xde, 0x1e, 0xa6, 0x75, 0xd0, 0x27, 0xa1, 0x24, 0x0f, 0x8c, + 0x50, 0x08, 0xeb, 0x32, 0x17, 0xac, 0x3c, 0x66, 0x30, 0x79, 0xab, 0xe3, 0x06, 0xa4, 0x45, 0xbc, + 0x28, 0x8c, 0x4f, 0x48, 0x09, 0x0d, 0x71, 0x4c, 0x0d, 0x7d, 0x52, 0x4a, 0x88, 0xd7, 0xfc, 0x8e, + 0x17, 0x85, 0xb3, 0x25, 0xd6, 0xbd, 0x4c, 0xdd, 0xdd, 0x9d, 0x18, 0x2f, 0x29, 0x42, 0xe6, 0x95, + 0xb1, 0x41, 0x0a, 0x7d, 0x1a, 0xc6, 0xf9, 0x7f, 0xae, 0x01, 0x0b, 0x67, 0x4f, 0x33, 0xda, 0x17, + 0xf2, 0x69, 0x73, 0xc4, 0xa5, 0xd3, 0x82, 0xf8, 0xb8, 0x5e, 0x1a, 0x62, 0x93, 0x1a, 0xc2, 0x30, + 0xde, 0x74, 0xf7, 0x88, 0x47, 0xc2, 0xb0, 0x1a, 0xf8, 0x9b, 0x64, 0x16, 0xd8, 0xc0, 0x9c, 0xcd, + 0xd6, 0x98, 0xf9, 0x9b, 0x64, 0x69, 0x9a, 0xd2, 0xbc, 0xa9, 0xd7, 0xc1, 0x26, 0x09, 0x74, 0x1b, + 0x26, 0xe8, 0x8b, 0xcd, 0x8d, 0x89, 0x8e, 0xf6, 0x22, 0xca, 0xde, 0x55, 0xd8, 0xa8, 0x84, 0x13, + 0x44, 0xd0, 0x2d, 0x18, 0x0b, 0x23, 0x27, 0x88, 0x3a, 0x6d, 0x4e, 0xf4, 0x4c, 0x2f, 0xa2, 0x4c, + 0xe1, 0x5a, 0xd3, 0xaa, 0x60, 0x83, 0x00, 0x7a, 0x1d, 0x4a, 0x4d, 0x77, 0x8b, 0xd4, 0xf7, 0xeb, + 0x4d, 0x32, 0x3b, 0xc6, 0xa8, 0x65, 0x1e, 0x2a, 0x37, 0x25, 0x12, 0xe7, 0x73, 0xd5, 0x5f, 0x1c, + 0x57, 0x47, 0x77, 0xe0, 0x4c, 0x44, 0x82, 0x96, 0xeb, 0x39, 0xf4, 0x30, 0x10, 0x4f, 0x2b, 0xa6, + 0xc8, 0x1c, 0x67, 0xbb, 0xed, 0xbc, 0x98, 0x8d, 0x33, 0x1b, 0x99, 0x58, 0x38, 0xa7, 0x36, 0xba, + 0x0f, 0xb3, 0x19, 0x10, 0xbf, 0xe9, 0xd6, 0xf7, 0x67, 0x4f, 0x31, 0xca, 0x1f, 0x15, 0x94, 0x67, + 0x37, 0x72, 0xf0, 0x0e, 0xbb, 0xc0, 0x70, 0x2e, 0x75, 0x74, 0x0b, 0x26, 0xd9, 0x09, 0x54, 0xed, + 0x34, 0x9b, 0xa2, 0xc1, 0x09, 0xd6, 0xe0, 0x07, 0xe4, 0x7d, 0x5c, 0x31, 0xc1, 0x87, 0x07, 0xf3, + 0x10, 0xff, 0xc3, 0xc9, 0xda, 0x68, 0x93, 0xe9, 0xcc, 0x3a, 0x81, 0x1b, 0xed, 0xd3, 0x73, 0x83, + 0xdc, 0x8f, 0x66, 0x27, 0xbb, 0xca, 0x2b, 0x74, 0x54, 0xa5, 0x58, 0xd3, 0x0b, 0x71, 0x92, 0x20, + 0x3d, 0x52, 0xc3, 0xa8, 0xe1, 0x7a, 0xb3, 0x53, 0xfc, 0x5d, 0x22, 0x4f, 0xa4, 0x1a, 0x2d, 0xc4, + 0x1c, 0xc6, 0xf4, 0x65, 0xf4, 0xc7, 0x2d, 0x7a, 0x73, 0x4d, 0x33, 0xc4, 0x58, 0x5f, 0x26, 0x01, + 0x38, 0xc6, 0xa1, 0xcc, 0x64, 0x14, 0xed, 0xcf, 0x22, 0x86, 0xaa, 0x0e, 0x96, 0x8d, 0x8d, 0x4f, + 0x62, 0x5a, 0x6e, 0x6f, 0xc2, 0x84, 0x3a, 0x08, 0xd9, 0x98, 0xa0, 0x79, 0x18, 0x64, 0xec, 0x93, + 0x90, 0xae, 0x95, 0x68, 0x17, 0x18, 0x6b, 0x85, 0x79, 0x39, 0xeb, 0x82, 0xfb, 0x36, 0x59, 0xda, + 0x8f, 0x08, 0x7f, 0xd3, 0x17, 0xb5, 0x2e, 0x48, 0x00, 0x8e, 0x71, 0xec, 0xff, 0xc3, 0xd9, 0xd0, + 0xf8, 0xb4, 0xed, 0xe3, 0x7e, 0x79, 0x16, 0x46, 0x76, 0xfc, 0x30, 0xa2, 0xd8, 0xac, 0x8d, 0xc1, + 0x98, 0xf1, 0xbc, 0x2e, 0xca, 0xb1, 0xc2, 0x40, 0xaf, 0xc2, 0x78, 0x5d, 0x6f, 0x40, 0x5c, 0x8e, + 0xea, 0x18, 0x31, 0x5a, 0xc7, 0x26, 0x2e, 0x7a, 0x19, 0x46, 0x98, 0x0d, 0x48, 0xdd, 0x6f, 0x0a, + 0xae, 0x4d, 0xde, 0xf0, 0x23, 0x55, 0x51, 0x7e, 0xa8, 0xfd, 0xc6, 0x0a, 0x1b, 0x5d, 0x82, 0x21, + 0xda, 0x85, 0x4a, 0x55, 0x5c, 0x4b, 0x4a, 0x50, 0x74, 0x9d, 0x95, 0x62, 0x01, 0xb5, 0xff, 0x52, + 0x41, 0x1b, 0x65, 0xfa, 0x1e, 0x26, 0xa8, 0x0a, 0xc3, 0xf7, 0x1c, 0x37, 0x72, 0xbd, 0x6d, 0xc1, + 0x7f, 0x3c, 0xdd, 0xf5, 0x8e, 0x62, 0x95, 0xee, 0xf2, 0x0a, 0xfc, 0x16, 0x15, 0x7f, 0xb0, 0x24, + 0x43, 0x29, 0x06, 0x1d, 0xcf, 0xa3, 0x14, 0x0b, 0xfd, 0x52, 0xc4, 0xbc, 0x02, 0xa7, 0x28, 0xfe, + 0x60, 0x49, 0x06, 0xbd, 0x09, 0x20, 0x77, 0x18, 0x69, 0x08, 0xdb, 0x8b, 0x67, 0x7b, 0x13, 0xdd, + 0x50, 0x75, 0x96, 0x26, 0xe8, 0x1d, 0x1d, 0xff, 0xc7, 0x1a, 0x3d, 0x3b, 0x62, 0x7c, 0x5a, 0xba, + 0x33, 0xe8, 0xdb, 0xe8, 0x12, 0x77, 0x82, 0x88, 0x34, 0x16, 0x23, 0x31, 0x38, 0x1f, 0xec, 0xef, + 0x91, 0xb2, 0xe1, 0xb6, 0x88, 0xbe, 0x1d, 0x04, 0x11, 0x1c, 0xd3, 0xb3, 0x7f, 0xa1, 0x08, 0xb3, + 0x79, 0xdd, 0xa5, 0x8b, 0x8e, 0xdc, 0x77, 0xa3, 0x65, 0xca, 0x5e, 0x59, 0xe6, 0xa2, 0x5b, 0x11, + 0xe5, 0x58, 0x61, 0xd0, 0xd9, 0x0f, 0xdd, 0x6d, 0xf9, 0xc6, 0x1c, 0x8c, 0x67, 0xbf, 0xc6, 0x4a, + 0xb1, 0x80, 0x52, 0xbc, 0x80, 0x38, 0xa1, 0x30, 0xee, 0xd1, 0x56, 0x09, 0x66, 0xa5, 0x58, 0x40, + 0x75, 0x69, 0xd7, 0x40, 0x0f, 0x69, 0x97, 0x31, 0x44, 0x83, 0xc7, 0x3b, 0x44, 0xe8, 0x33, 0x00, + 0x5b, 0xae, 0xe7, 0x86, 0x3b, 0x8c, 0xfa, 0xd0, 0x91, 0xa9, 0x2b, 0xe6, 0x6c, 0x55, 0x51, 0xc1, + 0x1a, 0x45, 0xf4, 0x12, 0x8c, 0xaa, 0x0d, 0x58, 0x29, 0x33, 0x4d, 0xa7, 0x66, 0x39, 0x12, 0x9f, + 0x46, 0x65, 0xac, 0xe3, 0xd9, 0x9f, 0x4b, 0xae, 0x17, 0xb1, 0x03, 0xb4, 0xf1, 0xb5, 0xfa, 0x1d, + 0xdf, 0x42, 0xf7, 0xf1, 0xb5, 0xbf, 0x56, 0x84, 0x49, 0xa3, 0xb1, 0x4e, 0xd8, 0xc7, 0x99, 0x75, + 0x8d, 0x1e, 0xe0, 0x4e, 0x44, 0xc4, 0xfe, 0xb3, 0x7b, 0x6f, 0x15, 0xfd, 0x90, 0xa7, 0x3b, 0x80, + 0xd7, 0x47, 0x9f, 0x81, 0x52, 0xd3, 0x09, 0x99, 0xe4, 0x8c, 0x88, 0x7d, 0xd7, 0x0f, 0xb1, 0xf8, + 0x61, 0xe2, 0x84, 0x91, 0x76, 0x6b, 0x72, 0xda, 0x31, 0x49, 0x7a, 0xd3, 0x50, 0xfe, 0x44, 0x5a, + 0x8f, 0xa9, 0x4e, 0x50, 0x26, 0x66, 0x1f, 0x73, 0x18, 0x7a, 0x19, 0xc6, 0x02, 0xc2, 0x56, 0xc5, + 0x32, 0xe5, 0xe6, 0xd8, 0x32, 0x1b, 0x8c, 0xd9, 0x3e, 0xac, 0xc1, 0xb0, 0x81, 0x19, 0xbf, 0x0d, + 0x86, 0xba, 0xbc, 0x0d, 0x9e, 0x86, 0x61, 0xf6, 0x43, 0xad, 0x00, 0x35, 0x1b, 0x15, 0x5e, 0x8c, + 0x25, 0x3c, 0xb9, 0x60, 0x46, 0xfa, 0x5b, 0x30, 0xf4, 0xf5, 0x21, 0x16, 0x35, 0xd3, 0x32, 0x8f, + 0xf0, 0x53, 0x4e, 0x2c, 0x79, 0x2c, 0x61, 0xf6, 0x07, 0x61, 0xa2, 0xec, 0x90, 0x96, 0xef, 0xad, + 0x78, 0x8d, 0xb6, 0xef, 0x7a, 0x11, 0x9a, 0x85, 0x01, 0x76, 0x89, 0xf0, 0x23, 0x60, 0x80, 0x36, + 0x84, 0x59, 0x89, 0xbd, 0x0d, 0xa7, 0xcb, 0xfe, 0x3d, 0xef, 0x9e, 0x13, 0x34, 0x16, 0xab, 0x15, + 0xed, 0x7d, 0xbd, 0x2e, 0xdf, 0x77, 0xdc, 0x68, 0x2b, 0xf3, 0xe8, 0xd5, 0x6a, 0x72, 0xb6, 0x76, + 0xd5, 0x6d, 0x92, 0x1c, 0x29, 0xc8, 0x5f, 0x2d, 0x18, 0x2d, 0xc5, 0xf8, 0x4a, 0xab, 0x65, 0xe5, + 0x6a, 0xb5, 0xde, 0x80, 0x91, 0x2d, 0x97, 0x34, 0x1b, 0x98, 0x6c, 0x89, 0x95, 0xf8, 0x54, 0xbe, + 0x1d, 0xca, 0x2a, 0xc5, 0x94, 0x52, 0x2f, 0xfe, 0x3a, 0x5c, 0x15, 0x95, 0xb1, 0x22, 0x83, 0x76, + 0x61, 0x4a, 0x3e, 0x18, 0x24, 0x54, 0xac, 0xcb, 0xa7, 0xbb, 0xbd, 0x42, 0x4c, 0xe2, 0xa7, 0x1e, + 0x1c, 0xcc, 0x4f, 0xe1, 0x04, 0x19, 0x9c, 0x22, 0x4c, 0x9f, 0x83, 0x2d, 0x7a, 0x02, 0x0f, 0xb0, + 0xe1, 0x67, 0xcf, 0x41, 0xf6, 0xb2, 0x65, 0xa5, 0xf6, 0x8f, 0x59, 0xf0, 0x58, 0x6a, 0x64, 0xc4, + 0x0b, 0xff, 0x98, 0x67, 0x21, 0xf9, 0xe2, 0x2e, 0xf4, 0x7e, 0x71, 0xdb, 0x7f, 0xd7, 0x82, 0x53, + 0x2b, 0xad, 0x76, 0xb4, 0x5f, 0x76, 0x4d, 0x15, 0xd4, 0x47, 0x60, 0xa8, 0x45, 0x1a, 0x6e, 0xa7, + 0x25, 0x66, 0x6e, 0x5e, 0x9e, 0x52, 0x6b, 0xac, 0xf4, 0xf0, 0x60, 0x7e, 0xbc, 0x16, 0xf9, 0x81, + 0xb3, 0x4d, 0x78, 0x01, 0x16, 0xe8, 0xec, 0xac, 0x77, 0xdf, 0x26, 0x37, 0xdd, 0x96, 0x2b, 0xed, + 0x8a, 0xba, 0xca, 0xec, 0x16, 0xe4, 0x80, 0x2e, 0xbc, 0xd1, 0x71, 0xbc, 0xc8, 0x8d, 0xf6, 0x85, + 0xf6, 0x48, 0x12, 0xc1, 0x31, 0x3d, 0xfb, 0xab, 0x16, 0x4c, 0xca, 0x75, 0xbf, 0xd8, 0x68, 0x04, + 0x24, 0x0c, 0xd1, 0x1c, 0x14, 0xdc, 0xb6, 0xe8, 0x25, 0x88, 0x5e, 0x16, 0x2a, 0x55, 0x5c, 0x70, + 0xdb, 0x92, 0x2d, 0x63, 0x07, 0x61, 0xd1, 0x54, 0xa4, 0x5d, 0x17, 0xe5, 0x58, 0x61, 0xa0, 0xcb, + 0x30, 0xe2, 0xf9, 0x0d, 0x6e, 0xdb, 0xc5, 0xaf, 0x34, 0xb6, 0xc0, 0xd6, 0x45, 0x19, 0x56, 0x50, + 0x54, 0x85, 0x12, 0x37, 0x7b, 0x8a, 0x17, 0x6d, 0x5f, 0xc6, 0x53, 0xec, 0xcb, 0x36, 0x64, 0x4d, + 0x1c, 0x13, 0xb1, 0x7f, 0xc5, 0x82, 0x31, 0xf9, 0x65, 0x7d, 0xf2, 0x9c, 0x74, 0x6b, 0xc5, 0xfc, + 0x66, 0xbc, 0xb5, 0x28, 0xcf, 0xc8, 0x20, 0x06, 0xab, 0x58, 0x3c, 0x12, 0xab, 0x78, 0x15, 0x46, + 0x9d, 0x76, 0xbb, 0x6a, 0xf2, 0x99, 0x6c, 0x29, 0x2d, 0xc6, 0xc5, 0x58, 0xc7, 0xb1, 0x7f, 0xb4, + 0x00, 0x13, 0xf2, 0x0b, 0x6a, 0x9d, 0xcd, 0x90, 0x44, 0x68, 0x03, 0x4a, 0x0e, 0x9f, 0x25, 0x22, + 0x17, 0xf9, 0xc5, 0x6c, 0x39, 0x82, 0x31, 0xa5, 0xf1, 0x85, 0xbf, 0x28, 0x6b, 0xe3, 0x98, 0x10, + 0x6a, 0xc2, 0xb4, 0xe7, 0x47, 0xec, 0xf0, 0x57, 0xf0, 0x6e, 0xaa, 0x9d, 0x24, 0xf5, 0xb3, 0x82, + 0xfa, 0xf4, 0x7a, 0x92, 0x0a, 0x4e, 0x13, 0x46, 0x2b, 0x52, 0x36, 0x53, 0xcc, 0x17, 0x06, 0xe8, + 0x13, 0x97, 0x2d, 0x9a, 0xb1, 0x7f, 0xd9, 0x82, 0x92, 0x44, 0x3b, 0x09, 0x2d, 0xde, 0x1a, 0x0c, + 0x87, 0x6c, 0x12, 0xe4, 0xd0, 0xd8, 0xdd, 0x3a, 0xce, 0xe7, 0x2b, 0xbe, 0xd3, 0xf8, 0xff, 0x10, + 0x4b, 0x1a, 0x4c, 0x34, 0xaf, 0xba, 0xff, 0x2e, 0x11, 0xcd, 0xab, 0xfe, 0xe4, 0x5c, 0x4a, 0x7f, + 0xc8, 0xfa, 0xac, 0xc9, 0xba, 0x28, 0xeb, 0xd5, 0x0e, 0xc8, 0x96, 0x7b, 0x3f, 0xc9, 0x7a, 0x55, + 0x59, 0x29, 0x16, 0x50, 0xf4, 0x26, 0x8c, 0xd5, 0xa5, 0x4c, 0x36, 0xde, 0xe1, 0x97, 0xba, 0xea, + 0x07, 0x94, 0x2a, 0x89, 0xcb, 0x42, 0x96, 0xb5, 0xfa, 0xd8, 0xa0, 0x66, 0x9a, 0x11, 0x14, 0x7b, + 0x99, 0x11, 0xc4, 0x74, 0xf3, 0x95, 0xea, 0x3f, 0x6e, 0xc1, 0x10, 0x97, 0xc5, 0xf5, 0x27, 0x0a, + 0xd5, 0x34, 0x6b, 0xf1, 0xd8, 0xdd, 0xa1, 0x85, 0x42, 0x53, 0x86, 0xd6, 0xa0, 0xc4, 0x7e, 0x30, + 0x59, 0x62, 0x31, 0xdf, 0xea, 0x9e, 0xb7, 0xaa, 0x77, 0xf0, 0x8e, 0xac, 0x86, 0x63, 0x0a, 0xf6, + 0x0f, 0x17, 0xe9, 0xe9, 0x16, 0xa3, 0x1a, 0x97, 0xbe, 0xf5, 0xe8, 0x2e, 0xfd, 0xc2, 0xa3, 0xba, + 0xf4, 0xb7, 0x61, 0xb2, 0xae, 0xe9, 0xe1, 0xe2, 0x99, 0xbc, 0xdc, 0x75, 0x91, 0x68, 0x2a, 0x3b, + 0x2e, 0x65, 0x59, 0x36, 0x89, 0xe0, 0x24, 0x55, 0xf4, 0x6d, 0x30, 0xc6, 0xe7, 0x59, 0xb4, 0xc2, + 0x2d, 0x31, 0x3e, 0x90, 0xbf, 0x5e, 0xf4, 0x26, 0xb8, 0x54, 0x4e, 0xab, 0x8e, 0x0d, 0x62, 0xf6, + 0x9f, 0x58, 0x80, 0x56, 0xda, 0x3b, 0xa4, 0x45, 0x02, 0xa7, 0x19, 0x8b, 0xd3, 0xbf, 0xdf, 0x82, + 0x59, 0x92, 0x2a, 0x5e, 0xf6, 0x5b, 0x2d, 0xf1, 0x68, 0xc9, 0x79, 0x57, 0xaf, 0xe4, 0xd4, 0x51, + 0x6e, 0x09, 0xb3, 0x79, 0x18, 0x38, 0xb7, 0x3d, 0xb4, 0x06, 0x33, 0xfc, 0x96, 0x54, 0x00, 0xcd, + 0xf6, 0xfa, 0x71, 0x41, 0x78, 0x66, 0x23, 0x8d, 0x82, 0xb3, 0xea, 0xd9, 0xdf, 0x35, 0x06, 0xb9, + 0xbd, 0x78, 0x4f, 0x8f, 0xf0, 0x9e, 0x1e, 0xe1, 0x3d, 0x3d, 0xc2, 0x7b, 0x7a, 0x84, 0xf7, 0xf4, + 0x08, 0xdf, 0xf4, 0x7a, 0x84, 0xbf, 0x6c, 0xc1, 0x69, 0x75, 0x0d, 0x18, 0x0f, 0xdf, 0xcf, 0xc3, + 0x0c, 0xdf, 0x6e, 0xcb, 0x4d, 0xc7, 0x6d, 0x6d, 0x90, 0x56, 0xbb, 0xe9, 0x44, 0x52, 0xeb, 0x7e, + 0x35, 0x73, 0xe5, 0x26, 0x2c, 0x56, 0x8d, 0x8a, 0x4b, 0x8f, 0xd1, 0xeb, 0x29, 0x03, 0x80, 0xb3, + 0x9a, 0xb1, 0x7f, 0x61, 0x04, 0x06, 0x57, 0xf6, 0x88, 0x17, 0x9d, 0xc0, 0x13, 0xa1, 0x0e, 0x13, + 0xae, 0xb7, 0xe7, 0x37, 0xf7, 0x48, 0x83, 0xc3, 0x8f, 0xf2, 0x92, 0x3d, 0x23, 0x48, 0x4f, 0x54, + 0x0c, 0x12, 0x38, 0x41, 0xf2, 0x51, 0x48, 0x93, 0xaf, 0xc1, 0x10, 0x3f, 0xc4, 0x85, 0x28, 0x39, + 0xf3, 0xcc, 0x66, 0x83, 0x28, 0xae, 0xa6, 0x58, 0xd2, 0xcd, 0x2f, 0x09, 0x51, 0x1d, 0x7d, 0x0e, + 0x26, 0xb6, 0xdc, 0x20, 0x8c, 0x36, 0xdc, 0x16, 0x09, 0x23, 0xa7, 0xd5, 0x7e, 0x08, 0xe9, 0xb1, + 0x1a, 0x87, 0x55, 0x83, 0x12, 0x4e, 0x50, 0x46, 0xdb, 0x30, 0xde, 0x74, 0xf4, 0xa6, 0x86, 0x8f, + 0xdc, 0x94, 0xba, 0x1d, 0x6e, 0xea, 0x84, 0xb0, 0x49, 0x97, 0x6e, 0xa7, 0x3a, 0x13, 0x80, 0x8e, + 0x30, 0xb1, 0x80, 0xda, 0x4e, 0x5c, 0xf2, 0xc9, 0x61, 0x94, 0xd1, 0x61, 0x06, 0xb2, 0x25, 0x93, + 0xd1, 0xd1, 0xcc, 0x60, 0x3f, 0x0b, 0x25, 0x42, 0x87, 0x90, 0x12, 0x16, 0x17, 0xcc, 0x95, 0xfe, + 0xfa, 0xba, 0xe6, 0xd6, 0x03, 0xdf, 0x94, 0xdb, 0xaf, 0x48, 0x4a, 0x38, 0x26, 0x8a, 0x96, 0x61, + 0x28, 0x24, 0x81, 0x4b, 0x42, 0x71, 0xd5, 0x74, 0x99, 0x46, 0x86, 0xc6, 0x7d, 0x4b, 0xf8, 0x6f, + 0x2c, 0xaa, 0xd2, 0xe5, 0xe5, 0x30, 0x91, 0x26, 0xbb, 0x0c, 0xb4, 0xe5, 0xb5, 0xc8, 0x4a, 0xb1, + 0x80, 0xa2, 0xd7, 0x61, 0x38, 0x20, 0x4d, 0xa6, 0x18, 0x1a, 0xef, 0x7f, 0x91, 0x73, 0x3d, 0x13, + 0xaf, 0x87, 0x25, 0x01, 0x74, 0x03, 0x50, 0x40, 0x28, 0xa3, 0xe4, 0x7a, 0xdb, 0xca, 0x6c, 0x54, + 0x1c, 0xb4, 0x8a, 0x21, 0xc5, 0x31, 0x86, 0x74, 0xf3, 0xc1, 0x19, 0xd5, 0xd0, 0x35, 0x98, 0x56, + 0xa5, 0x15, 0x2f, 0x8c, 0x1c, 0x7a, 0xc0, 0x4d, 0x32, 0x5a, 0x4a, 0x4e, 0x81, 0x93, 0x08, 0x38, + 0x5d, 0xc7, 0xfe, 0xb2, 0x05, 0x7c, 0x9c, 0x4f, 0xe0, 0x75, 0xfe, 0x9a, 0xf9, 0x3a, 0x3f, 0x9b, + 0x3b, 0x73, 0x39, 0x2f, 0xf3, 0x2f, 0x5b, 0x30, 0xaa, 0xcd, 0x6c, 0xbc, 0x66, 0xad, 0x2e, 0x6b, + 0xb6, 0x03, 0x53, 0x74, 0xa5, 0xdf, 0xda, 0x0c, 0x49, 0xb0, 0x47, 0x1a, 0x6c, 0x61, 0x16, 0x1e, + 0x6e, 0x61, 0x2a, 0x13, 0xb5, 0x9b, 0x09, 0x82, 0x38, 0xd5, 0x84, 0xfd, 0x59, 0xd9, 0x55, 0x65, + 0xd1, 0x57, 0x57, 0x73, 0x9e, 0xb0, 0xe8, 0x53, 0xb3, 0x8a, 0x63, 0x1c, 0xba, 0xd5, 0x76, 0xfc, + 0x30, 0x4a, 0x5a, 0xf4, 0x5d, 0xf7, 0xc3, 0x08, 0x33, 0x88, 0xfd, 0x02, 0xc0, 0xca, 0x7d, 0x52, + 0xe7, 0x2b, 0x56, 0x7f, 0x3c, 0x58, 0xf9, 0x8f, 0x07, 0xfb, 0xb7, 0x2c, 0x98, 0x58, 0x5d, 0x36, + 0x6e, 0xae, 0x05, 0x00, 0xfe, 0xe2, 0xb9, 0x7b, 0x77, 0x5d, 0xaa, 0xc3, 0xb9, 0x46, 0x53, 0x95, + 0x62, 0x0d, 0x03, 0x9d, 0x85, 0x62, 0xb3, 0xe3, 0x09, 0xf1, 0xe1, 0x30, 0xbd, 0x1e, 0x6f, 0x76, + 0x3c, 0x4c, 0xcb, 0x34, 0x97, 0x82, 0x62, 0xdf, 0x2e, 0x05, 0x3d, 0x5d, 0xfb, 0xd1, 0x3c, 0x0c, + 0xde, 0xbb, 0xe7, 0x36, 0xb8, 0x03, 0xa5, 0x50, 0xd5, 0xdf, 0xbd, 0x5b, 0x29, 0x87, 0x98, 0x97, + 0xdb, 0x5f, 0x2a, 0xc2, 0xdc, 0x6a, 0x93, 0xdc, 0x7f, 0x87, 0x4e, 0xa4, 0xfd, 0x3a, 0x44, 0x1c, + 0x4d, 0x10, 0x73, 0x54, 0xa7, 0x97, 0xde, 0xe3, 0xb1, 0x05, 0xc3, 0xdc, 0xa0, 0x4d, 0xba, 0x94, + 0xbe, 0x9a, 0xd5, 0x7a, 0xfe, 0x80, 0x2c, 0x70, 0xc3, 0x38, 0xe1, 0x11, 0xa7, 0x2e, 0x4c, 0x51, + 0x8a, 0x25, 0xf1, 0xb9, 0x57, 0x60, 0x4c, 0xc7, 0x3c, 0x92, 0xfb, 0xd9, 0xff, 0x57, 0x84, 0x29, + 0xda, 0x83, 0x47, 0x3a, 0x11, 0xb7, 0xd3, 0x13, 0x71, 0xdc, 0x2e, 0x48, 0xbd, 0x67, 0xe3, 0xcd, + 0xe4, 0x6c, 0x5c, 0xcd, 0x9b, 0x8d, 0x93, 0x9e, 0x83, 0xef, 0xb4, 0x60, 0x66, 0xb5, 0xe9, 0xd7, + 0x77, 0x13, 0x6e, 0x42, 0x2f, 0xc1, 0x28, 0x3d, 0x8e, 0x43, 0xc3, 0x83, 0xdd, 0x88, 0x69, 0x20, + 0x40, 0x58, 0xc7, 0xd3, 0xaa, 0xdd, 0xbe, 0x5d, 0x29, 0x67, 0x85, 0x42, 0x10, 0x20, 0xac, 0xe3, + 0xd9, 0xbf, 0x61, 0xc1, 0xb9, 0x6b, 0xcb, 0x2b, 0xf1, 0x52, 0x4c, 0x45, 0x63, 0xb8, 0x04, 0x43, + 0xed, 0x86, 0xd6, 0x95, 0x58, 0xbc, 0x5a, 0x66, 0xbd, 0x10, 0xd0, 0x77, 0x4b, 0xa4, 0x91, 0x9f, + 0xb2, 0x60, 0xe6, 0x9a, 0x1b, 0xd1, 0xdb, 0x35, 0x19, 0x17, 0x80, 0x5e, 0xaf, 0xa1, 0x1b, 0xf9, + 0xc1, 0x7e, 0x32, 0x2e, 0x00, 0x56, 0x10, 0xac, 0x61, 0xf1, 0x96, 0xf7, 0x5c, 0x66, 0x4a, 0x5d, + 0x30, 0x15, 0x4d, 0x58, 0x94, 0x63, 0x85, 0x41, 0x3f, 0xac, 0xe1, 0x06, 0x4c, 0x46, 0xb7, 0x2f, + 0x4e, 0x58, 0xf5, 0x61, 0x65, 0x09, 0xc0, 0x31, 0x8e, 0xfd, 0x47, 0x16, 0xcc, 0x5f, 0x6b, 0x76, + 0xc2, 0x88, 0x04, 0x5b, 0x61, 0xce, 0xe9, 0xf8, 0x02, 0x94, 0x88, 0x94, 0x88, 0x8b, 0x5e, 0x2b, + 0x8e, 0x51, 0x89, 0xca, 0x79, 0x78, 0x02, 0x85, 0xd7, 0x87, 0xd3, 0xe1, 0xd1, 0xbc, 0xc6, 0x56, + 0x01, 0x11, 0xbd, 0x2d, 0x3d, 0x5e, 0x03, 0x73, 0xfc, 0x5e, 0x49, 0x41, 0x71, 0x46, 0x0d, 0xfb, + 0xc7, 0x2c, 0x38, 0xad, 0x3e, 0xf8, 0x5d, 0xf7, 0x99, 0xf6, 0xcf, 0x16, 0x60, 0xfc, 0xfa, 0xc6, + 0x46, 0xf5, 0x1a, 0x89, 0xc4, 0xb5, 0xdd, 0x5b, 0xcf, 0x8d, 0x35, 0x75, 0x5d, 0xb7, 0xc7, 0x5c, + 0x27, 0x72, 0x9b, 0x0b, 0x3c, 0xec, 0xcf, 0x42, 0xc5, 0x8b, 0x6e, 0x05, 0xb5, 0x28, 0x70, 0xbd, + 0xed, 0x4c, 0x05, 0x9f, 0x64, 0x2e, 0x8a, 0x79, 0xcc, 0x05, 0x7a, 0x01, 0x86, 0x58, 0xdc, 0x21, + 0x39, 0x09, 0x8f, 0xab, 0xb7, 0x10, 0x2b, 0x3d, 0x3c, 0x98, 0x2f, 0xdd, 0xc6, 0x15, 0xfe, 0x07, + 0x0b, 0x54, 0x74, 0x1b, 0x46, 0x77, 0xa2, 0xa8, 0x7d, 0x9d, 0x38, 0x0d, 0x12, 0xc8, 0xe3, 0xf0, + 0x7c, 0xd6, 0x71, 0x48, 0x07, 0x81, 0xa3, 0xc5, 0x27, 0x48, 0x5c, 0x16, 0x62, 0x9d, 0x8e, 0x5d, + 0x03, 0x88, 0x61, 0xc7, 0xa4, 0xa9, 0xb0, 0xff, 0xc0, 0x82, 0x61, 0x1e, 0x02, 0x22, 0x40, 0x1f, + 0x85, 0x01, 0x72, 0x9f, 0xd4, 0x05, 0xc7, 0x9b, 0xd9, 0xe1, 0x98, 0xd3, 0xe2, 0x12, 0x57, 0xfa, + 0x1f, 0xb3, 0x5a, 0xe8, 0x3a, 0x0c, 0xd3, 0xde, 0x5e, 0x53, 0xf1, 0x30, 0x9e, 0xcc, 0xfb, 0x62, + 0x35, 0xed, 0x9c, 0x39, 0x13, 0x45, 0x58, 0x56, 0x67, 0xea, 0xe1, 0x7a, 0xbb, 0x46, 0x4f, 0xec, + 0xa8, 0x1b, 0x63, 0xb1, 0xb1, 0x5c, 0xe5, 0x48, 0x82, 0x1a, 0x57, 0x0f, 0xcb, 0x42, 0x1c, 0x13, + 0xb1, 0x37, 0xa0, 0x44, 0x27, 0x75, 0xb1, 0xe9, 0x3a, 0xdd, 0x35, 0xde, 0xcf, 0x40, 0x49, 0xea, + 0xb3, 0x43, 0xe1, 0xfa, 0xcd, 0xa8, 0x4a, 0x75, 0x77, 0x88, 0x63, 0xb8, 0xbd, 0x05, 0xa7, 0x98, + 0x75, 0xa2, 0x13, 0xed, 0x18, 0x7b, 0xac, 0xf7, 0x62, 0x7e, 0x56, 0x3c, 0x20, 0xf9, 0xcc, 0xcc, + 0x6a, 0xde, 0x95, 0x63, 0x92, 0x62, 0xfc, 0x98, 0xb4, 0xbf, 0x36, 0x00, 0x8f, 0x57, 0x6a, 0xf9, + 0xd1, 0x41, 0x5e, 0x86, 0x31, 0xce, 0x97, 0xd2, 0xa5, 0xed, 0x34, 0x45, 0xbb, 0x4a, 0xd4, 0xba, + 0xa1, 0xc1, 0xb0, 0x81, 0x89, 0xce, 0x41, 0xd1, 0x7d, 0xcb, 0x4b, 0xfa, 0x1e, 0x55, 0xde, 0x58, + 0xc7, 0xb4, 0x9c, 0x82, 0x29, 0x8b, 0xcb, 0xef, 0x0e, 0x05, 0x56, 0x6c, 0xee, 0x6b, 0x30, 0xe1, + 0x86, 0xf5, 0xd0, 0xad, 0x78, 0xf4, 0x9c, 0xd1, 0x4e, 0x2a, 0x25, 0xdc, 0xa0, 0x9d, 0x56, 0x50, + 0x9c, 0xc0, 0xd6, 0x2e, 0xb2, 0xc1, 0xbe, 0xd9, 0xe4, 0x9e, 0xbe, 0xd0, 0xf4, 0x05, 0xd0, 0x66, + 0x5f, 0x17, 0x32, 0x99, 0xb9, 0x78, 0x01, 0xf0, 0x0f, 0x0e, 0xb1, 0x84, 0xd1, 0x97, 0x63, 0x7d, + 0xc7, 0x69, 0x2f, 0x76, 0xa2, 0x9d, 0xb2, 0x1b, 0xd6, 0xfd, 0x3d, 0x12, 0xec, 0xb3, 0x47, 0xff, + 0x48, 0xfc, 0x72, 0x54, 0x80, 0xe5, 0xeb, 0x8b, 0x55, 0x8a, 0x89, 0xd3, 0x75, 0xd0, 0x22, 0x4c, + 0xca, 0xc2, 0x1a, 0x09, 0xd9, 0x15, 0x36, 0xca, 0xc8, 0x28, 0x6f, 0x20, 0x51, 0xac, 0x88, 0x24, + 0xf1, 0x4d, 0x4e, 0x1a, 0x8e, 0x83, 0x93, 0xfe, 0x08, 0x8c, 0xbb, 0x9e, 0x1b, 0xb9, 0x4e, 0xe4, + 0x73, 0x85, 0x0f, 0x7f, 0xdf, 0x33, 0x49, 0x76, 0x45, 0x07, 0x60, 0x13, 0xcf, 0xfe, 0x2f, 0x03, + 0x30, 0xcd, 0xa6, 0xed, 0xbd, 0x15, 0xf6, 0xcd, 0xb4, 0xc2, 0x6e, 0xa7, 0x57, 0xd8, 0x71, 0x3c, + 0x11, 0x1e, 0x7a, 0x99, 0x7d, 0x0e, 0x4a, 0xca, 0x01, 0x4a, 0x7a, 0x40, 0x5a, 0x39, 0x1e, 0x90, + 0xbd, 0xb9, 0x0f, 0x69, 0x43, 0x56, 0xcc, 0xb4, 0x21, 0xfb, 0xeb, 0x16, 0xc4, 0x1a, 0x0c, 0x74, + 0x1d, 0x4a, 0x6d, 0x9f, 0x99, 0x46, 0x06, 0xd2, 0xde, 0xf8, 0xf1, 0xcc, 0x8b, 0x8a, 0x5f, 0x8a, + 0xfc, 0xe3, 0xab, 0xb2, 0x06, 0x8e, 0x2b, 0xa3, 0x25, 0x18, 0x6e, 0x07, 0xa4, 0x16, 0xb1, 0x20, + 0x21, 0x3d, 0xe9, 0xf0, 0x35, 0xc2, 0xf1, 0xb1, 0xac, 0x68, 0xff, 0x9c, 0x05, 0xc0, 0xcd, 0xb4, + 0x1c, 0x6f, 0x9b, 0x9c, 0x80, 0xd4, 0xba, 0x0c, 0x03, 0x61, 0x9b, 0xd4, 0xbb, 0x19, 0xad, 0xc6, + 0xfd, 0xa9, 0xb5, 0x49, 0x3d, 0x1e, 0x70, 0xfa, 0x0f, 0xb3, 0xda, 0xf6, 0x77, 0x03, 0x4c, 0xc4, + 0x68, 0x95, 0x88, 0xb4, 0xd0, 0x73, 0x46, 0xd0, 0x80, 0xb3, 0x89, 0xa0, 0x01, 0x25, 0x86, 0xad, + 0x09, 0x48, 0x3f, 0x07, 0xc5, 0x96, 0x73, 0x5f, 0x48, 0xc0, 0x9e, 0xe9, 0xde, 0x0d, 0x4a, 0x7f, + 0x61, 0xcd, 0xb9, 0xcf, 0x1f, 0x89, 0xcf, 0xc8, 0x05, 0xb2, 0xe6, 0xdc, 0x3f, 0xe4, 0xa6, 0xa9, + 0xec, 0x90, 0xba, 0xe9, 0x86, 0xd1, 0x17, 0xfe, 0x73, 0xfc, 0x9f, 0x2d, 0x3b, 0xda, 0x08, 0x6b, + 0xcb, 0xf5, 0x84, 0x05, 0x52, 0x5f, 0x6d, 0xb9, 0x5e, 0xb2, 0x2d, 0xd7, 0xeb, 0xa3, 0x2d, 0xd7, + 0x43, 0x6f, 0xc3, 0xb0, 0x30, 0x10, 0x14, 0x41, 0x7a, 0xae, 0xf4, 0xd1, 0x9e, 0xb0, 0x2f, 0xe4, + 0x6d, 0x5e, 0x91, 0x8f, 0x60, 0x51, 0xda, 0xb3, 0x5d, 0xd9, 0x20, 0xfa, 0x2b, 0x16, 0x4c, 0x88, + 0xdf, 0x98, 0xbc, 0xd5, 0x21, 0x61, 0x24, 0x78, 0xcf, 0x0f, 0xf7, 0xdf, 0x07, 0x51, 0x91, 0x77, + 0xe5, 0xc3, 0xf2, 0x98, 0x35, 0x81, 0x3d, 0x7b, 0x94, 0xe8, 0x05, 0xfa, 0xfb, 0x16, 0x9c, 0x6a, + 0x39, 0xf7, 0x79, 0x8b, 0xbc, 0x0c, 0x3b, 0x91, 0xeb, 0x0b, 0x45, 0xfb, 0x47, 0xfb, 0x9b, 0xfe, + 0x54, 0x75, 0xde, 0x49, 0xa9, 0x0d, 0x3c, 0x95, 0x85, 0xd2, 0xb3, 0xab, 0x99, 0xfd, 0x9a, 0xdb, + 0x82, 0x11, 0xb9, 0xde, 0x32, 0x44, 0x0d, 0x65, 0x9d, 0xb1, 0x3e, 0xb2, 0x7d, 0xa6, 0xee, 0x8c, + 0x4f, 0xdb, 0x11, 0x6b, 0xed, 0x91, 0xb6, 0xf3, 0x39, 0x18, 0xd3, 0xd7, 0xd8, 0x23, 0x6d, 0xeb, + 0x2d, 0x98, 0xc9, 0x58, 0x4b, 0x8f, 0xb4, 0xc9, 0x7b, 0x70, 0x36, 0x77, 0x7d, 0x3c, 0xca, 0x86, + 0xed, 0x9f, 0xb5, 0xf4, 0x73, 0xf0, 0x04, 0x54, 0x07, 0xcb, 0xa6, 0xea, 0xe0, 0x7c, 0xf7, 0x9d, + 0x93, 0xa3, 0x3f, 0x78, 0x53, 0xef, 0x34, 0x3d, 0xd5, 0xd1, 0xeb, 0x30, 0xd4, 0xa4, 0x25, 0xd2, + 0xcc, 0xd4, 0xee, 0xbd, 0x23, 0x63, 0x5e, 0x8a, 0x95, 0x87, 0x58, 0x50, 0xb0, 0x7f, 0xd1, 0x82, + 0x81, 0x13, 0x18, 0x09, 0x6c, 0x8e, 0xc4, 0x73, 0xb9, 0xa4, 0x45, 0xfc, 0xe0, 0x05, 0xec, 0xdc, + 0x5b, 0xb9, 0x1f, 0x11, 0x2f, 0x64, 0x4f, 0xc5, 0xcc, 0x81, 0xf9, 0x49, 0x0b, 0x66, 0x6e, 0xfa, + 0x4e, 0x63, 0xc9, 0x69, 0x3a, 0x5e, 0x9d, 0x04, 0x15, 0x6f, 0xfb, 0x48, 0x36, 0xd2, 0x85, 0x9e, + 0x36, 0xd2, 0xcb, 0xd2, 0xc4, 0x68, 0x20, 0x7f, 0xfe, 0x28, 0x23, 0x99, 0x0c, 0xa3, 0x62, 0x18, + 0xc3, 0xee, 0x00, 0xd2, 0x7b, 0x29, 0x3c, 0x56, 0x30, 0x0c, 0xbb, 0xbc, 0xbf, 0x62, 0x12, 0x9f, + 0xca, 0x66, 0xf0, 0x52, 0x9f, 0xa7, 0xf9, 0x62, 0xf0, 0x02, 0x2c, 0x09, 0xd9, 0x2f, 0x43, 0xa6, + 0xdb, 0x7b, 0x6f, 0xe1, 0x83, 0xfd, 0x49, 0x98, 0x66, 0x35, 0x8f, 0xf8, 0x30, 0xb6, 0x13, 0xb2, + 0xcd, 0x8c, 0x80, 0x78, 0xf6, 0x17, 0x2d, 0x98, 0x5c, 0x4f, 0xc4, 0x09, 0xbb, 0xc4, 0xb4, 0xa1, + 0x19, 0x22, 0xf5, 0x1a, 0x2b, 0xc5, 0x02, 0x7a, 0xec, 0x92, 0xac, 0xbf, 0xb0, 0x20, 0x8e, 0x44, + 0x71, 0x02, 0xec, 0xdb, 0xb2, 0xc1, 0xbe, 0x65, 0x4a, 0x58, 0x54, 0x77, 0xf2, 0xb8, 0x37, 0x74, + 0x43, 0xc5, 0x68, 0xea, 0x22, 0x5c, 0x89, 0xc9, 0xf0, 0xa5, 0x38, 0x61, 0x06, 0x72, 0x92, 0x51, + 0x9b, 0xec, 0xdf, 0x2e, 0x00, 0x52, 0xb8, 0x7d, 0xc7, 0x90, 0x4a, 0xd7, 0x38, 0x9e, 0x18, 0x52, + 0x7b, 0x80, 0x98, 0x3e, 0x3f, 0x70, 0xbc, 0x90, 0x93, 0x75, 0x85, 0xec, 0xee, 0x68, 0xc6, 0x02, + 0x73, 0xa2, 0x49, 0x74, 0x33, 0x45, 0x0d, 0x67, 0xb4, 0xa0, 0xd9, 0x69, 0x0c, 0xf6, 0x6b, 0xa7, + 0x31, 0xd4, 0xc3, 0x2b, 0xed, 0x67, 0x2c, 0x18, 0x57, 0xc3, 0xf4, 0x2e, 0xb1, 0x19, 0x57, 0xfd, + 0xc9, 0x39, 0x40, 0xab, 0x5a, 0x97, 0xd9, 0xc5, 0xf2, 0xad, 0xcc, 0xbb, 0xd0, 0x69, 0xba, 0x6f, + 0x13, 0x15, 0xc1, 0x6f, 0x5e, 0x78, 0x0b, 0x8a, 0xd2, 0xc3, 0x83, 0xf9, 0x71, 0xf5, 0x8f, 0x47, + 0x0c, 0x8e, 0xab, 0xd0, 0x23, 0x79, 0x32, 0xb1, 0x14, 0xd1, 0x4b, 0x30, 0xd8, 0xde, 0x71, 0x42, + 0x92, 0xf0, 0xad, 0x19, 0xac, 0xd2, 0xc2, 0xc3, 0x83, 0xf9, 0x09, 0x55, 0x81, 0x95, 0x60, 0x8e, + 0xdd, 0x7f, 0x64, 0xae, 0xf4, 0xe2, 0xec, 0x19, 0x99, 0xeb, 0x4f, 0x2c, 0x18, 0x58, 0xf7, 0x1b, + 0x27, 0x71, 0x04, 0xbc, 0x66, 0x1c, 0x01, 0x4f, 0xe4, 0x05, 0x73, 0xcf, 0xdd, 0xfd, 0xab, 0x89, + 0xdd, 0x7f, 0x3e, 0x97, 0x42, 0xf7, 0x8d, 0xdf, 0x82, 0x51, 0x16, 0x22, 0x5e, 0xf8, 0x11, 0xbd, + 0x60, 0x6c, 0xf8, 0xf9, 0xc4, 0x86, 0x9f, 0xd4, 0x50, 0xb5, 0x9d, 0xfe, 0x34, 0x0c, 0x0b, 0xc7, + 0x94, 0xa4, 0x93, 0xa6, 0xc0, 0xc5, 0x12, 0x6e, 0xff, 0x78, 0x11, 0x8c, 0x90, 0xf4, 0xe8, 0x97, + 0x2d, 0x58, 0x08, 0xb8, 0xc1, 0x6a, 0xa3, 0xdc, 0x09, 0x5c, 0x6f, 0xbb, 0x56, 0xdf, 0x21, 0x8d, + 0x4e, 0xd3, 0xf5, 0xb6, 0x2b, 0xdb, 0x9e, 0xaf, 0x8a, 0x57, 0xee, 0x93, 0x7a, 0x87, 0x29, 0xc1, + 0x7a, 0xc4, 0xbf, 0x57, 0x86, 0xdf, 0xcf, 0x3f, 0x38, 0x98, 0x5f, 0xc0, 0x47, 0xa2, 0x8d, 0x8f, + 0xd8, 0x17, 0xf4, 0x1b, 0x16, 0x5c, 0xe1, 0x91, 0xda, 0xfb, 0xef, 0x7f, 0x97, 0xd7, 0x72, 0x55, + 0x92, 0x8a, 0x89, 0x6c, 0x90, 0xa0, 0xb5, 0xf4, 0x11, 0x31, 0xa0, 0x57, 0xaa, 0x47, 0x6b, 0x0b, + 0x1f, 0xb5, 0x73, 0xf6, 0x3f, 0x2b, 0xc2, 0xb8, 0x88, 0xe0, 0x24, 0xee, 0x80, 0x97, 0x8c, 0x25, + 0xf1, 0x64, 0x62, 0x49, 0x4c, 0x1b, 0xc8, 0xc7, 0x73, 0xfc, 0x87, 0x30, 0x4d, 0x0f, 0xe7, 0xeb, + 0xc4, 0x09, 0xa2, 0x4d, 0xe2, 0x70, 0xf3, 0xab, 0xe2, 0x91, 0x4f, 0x7f, 0x25, 0x9e, 0xbb, 0x99, + 0x24, 0x86, 0xd3, 0xf4, 0xbf, 0x99, 0xee, 0x1c, 0x0f, 0xa6, 0x52, 0x41, 0xb8, 0x3e, 0x05, 0x25, + 0xe5, 0x55, 0x21, 0x0e, 0x9d, 0xee, 0xb1, 0xec, 0x92, 0x14, 0xb8, 0x08, 0x2d, 0xf6, 0xe8, 0x89, + 0xc9, 0xd9, 0xff, 0xa0, 0x60, 0x34, 0xc8, 0x27, 0x71, 0x1d, 0x46, 0x9c, 0x30, 0x74, 0xb7, 0x3d, + 0xd2, 0x10, 0x3b, 0xf6, 0xfd, 0x79, 0x3b, 0xd6, 0x68, 0x86, 0x79, 0xb6, 0x2c, 0x8a, 0x9a, 0x58, + 0xd1, 0x40, 0xd7, 0xb9, 0x91, 0xdb, 0x9e, 0x7c, 0xef, 0xf5, 0x47, 0x0d, 0xa4, 0x19, 0xdc, 0x1e, + 0xc1, 0xa2, 0x3e, 0xfa, 0x34, 0xb7, 0x42, 0xbc, 0xe1, 0xf9, 0xf7, 0xbc, 0x6b, 0xbe, 0x2f, 0xa3, + 0x24, 0xf4, 0x47, 0x70, 0x5a, 0xda, 0x1e, 0xaa, 0xea, 0xd8, 0xa4, 0xd6, 0x5f, 0x54, 0xcb, 0xcf, + 0xc3, 0x0c, 0x25, 0x6d, 0x3a, 0x31, 0x87, 0x88, 0xc0, 0xa4, 0x08, 0x0f, 0x26, 0xcb, 0xc4, 0xd8, + 0x65, 0x3e, 0xe5, 0xcc, 0xda, 0xb1, 0x1c, 0xf9, 0x86, 0x49, 0x02, 0x27, 0x69, 0xda, 0x7f, 0xdb, + 0x02, 0xe6, 0xd0, 0x79, 0x02, 0xfc, 0xc8, 0xc7, 0x4c, 0x7e, 0x64, 0x36, 0x6f, 0x90, 0x73, 0x58, + 0x91, 0x17, 0xf9, 0xca, 0xaa, 0x06, 0xfe, 0xfd, 0x7d, 0x61, 0x3a, 0xd2, 0xfb, 0xfd, 0x61, 0xff, + 0x6f, 0x8b, 0x1f, 0x62, 0xca, 0xe7, 0x01, 0x7d, 0x3b, 0x8c, 0xd4, 0x9d, 0xb6, 0x53, 0xe7, 0xf9, + 0x53, 0x72, 0x25, 0x7a, 0x46, 0xa5, 0x85, 0x65, 0x51, 0x83, 0x4b, 0xa8, 0x64, 0x98, 0xb9, 0x11, + 0x59, 0xdc, 0x53, 0x2a, 0xa5, 0x9a, 0x9c, 0xdb, 0x85, 0x71, 0x83, 0xd8, 0x23, 0x15, 0x67, 0x7c, + 0x3b, 0xbf, 0x62, 0x55, 0x58, 0xc4, 0x16, 0x4c, 0x7b, 0xda, 0x7f, 0x7a, 0xa1, 0xc8, 0xc7, 0xe5, + 0xfb, 0x7b, 0x5d, 0xa2, 0xec, 0xf6, 0xd1, 0x7c, 0x45, 0x13, 0x64, 0x70, 0x9a, 0xb2, 0xfd, 0x13, + 0x16, 0x3c, 0xa6, 0x23, 0x6a, 0xee, 0x28, 0xbd, 0x74, 0x04, 0x65, 0x18, 0xf1, 0xdb, 0x24, 0x70, + 0x22, 0x3f, 0x10, 0xb7, 0xc6, 0x65, 0x39, 0xe8, 0xb7, 0x44, 0xf9, 0xa1, 0x88, 0x3e, 0x2e, 0xa9, + 0xcb, 0x72, 0xac, 0x6a, 0xd2, 0xd7, 0x27, 0x1b, 0x8c, 0x50, 0x38, 0x1e, 0xb1, 0x33, 0x80, 0xa9, + 0xcb, 0x43, 0x2c, 0x20, 0xf6, 0xd7, 0x2c, 0xbe, 0xb0, 0xf4, 0xae, 0xa3, 0xb7, 0x60, 0xaa, 0xe5, + 0x44, 0xf5, 0x9d, 0x95, 0xfb, 0xed, 0x80, 0x6b, 0x5c, 0xe4, 0x38, 0x3d, 0xd3, 0x6b, 0x9c, 0xb4, + 0x8f, 0x8c, 0x0d, 0x2b, 0xd7, 0x12, 0xc4, 0x70, 0x8a, 0x3c, 0xda, 0x84, 0x51, 0x56, 0xc6, 0x7c, + 0xea, 0xc2, 0x6e, 0xac, 0x41, 0x5e, 0x6b, 0xca, 0xe2, 0x60, 0x2d, 0xa6, 0x83, 0x75, 0xa2, 0xf6, + 0x4f, 0x17, 0xf9, 0x6e, 0x67, 0xac, 0xfc, 0xd3, 0x30, 0xdc, 0xf6, 0x1b, 0xcb, 0x95, 0x32, 0x16, + 0xb3, 0xa0, 0xae, 0x91, 0x2a, 0x2f, 0xc6, 0x12, 0x8e, 0x2e, 0xc3, 0x88, 0xf8, 0x29, 0x35, 0x64, + 0xec, 0x6c, 0x16, 0x78, 0x21, 0x56, 0x50, 0xf4, 0x3c, 0x40, 0x3b, 0xf0, 0xf7, 0xdc, 0x06, 0x8b, + 0xf5, 0x50, 0x34, 0x8d, 0x85, 0xaa, 0x0a, 0x82, 0x35, 0x2c, 0xf4, 0x2a, 0x8c, 0x77, 0xbc, 0x90, + 0xb3, 0x23, 0x5a, 0x64, 0x57, 0x65, 0xc6, 0x72, 0x5b, 0x07, 0x62, 0x13, 0x17, 0x2d, 0xc2, 0x50, + 0xe4, 0x30, 0xe3, 0x97, 0xc1, 0x7c, 0xe3, 0xdb, 0x0d, 0x8a, 0xa1, 0xa7, 0xea, 0xa0, 0x15, 0xb0, + 0xa8, 0x88, 0x3e, 0x25, 0xdd, 0x5b, 0xf9, 0xc1, 0x2e, 0xac, 0xde, 0xfb, 0xbb, 0x04, 0x34, 0xe7, + 0x56, 0x61, 0x4d, 0x6f, 0xd0, 0x42, 0xaf, 0x00, 0x90, 0xfb, 0x11, 0x09, 0x3c, 0xa7, 0xa9, 0x6c, + 0xcb, 0x14, 0x5f, 0x50, 0xf6, 0xd7, 0xfd, 0xe8, 0x76, 0x48, 0x56, 0x14, 0x06, 0xd6, 0xb0, 0xed, + 0xdf, 0x28, 0x01, 0xc4, 0x7c, 0x3b, 0x7a, 0x3b, 0x75, 0x70, 0x3d, 0xdb, 0x9d, 0xd3, 0x3f, 0xbe, + 0x53, 0x0b, 0x7d, 0x8f, 0x05, 0xa3, 0x4e, 0xb3, 0xe9, 0xd7, 0x1d, 0x1e, 0x7b, 0xb7, 0xd0, 0xfd, + 0xe0, 0x14, 0xed, 0x2f, 0xc6, 0x35, 0x78, 0x17, 0x5e, 0x90, 0x2b, 0x54, 0x83, 0xf4, 0xec, 0x85, + 0xde, 0x30, 0xfa, 0x90, 0x7c, 0x2a, 0x16, 0x8d, 0xa1, 0x54, 0x4f, 0xc5, 0x12, 0xbb, 0x23, 0xf4, + 0x57, 0xe2, 0x6d, 0xe3, 0x95, 0x38, 0x90, 0xef, 0xbf, 0x67, 0xb0, 0xaf, 0xbd, 0x1e, 0x88, 0xa8, + 0xaa, 0xfb, 0xf2, 0x0f, 0xe6, 0x3b, 0xcb, 0x69, 0xef, 0xa4, 0x1e, 0x7e, 0xfc, 0x9f, 0x83, 0xc9, + 0x86, 0xc9, 0x04, 0x88, 0x95, 0xf8, 0x54, 0x1e, 0xdd, 0x04, 0xcf, 0x10, 0x5f, 0xfb, 0x09, 0x00, + 0x4e, 0x12, 0x46, 0x55, 0x1e, 0xda, 0xa1, 0xe2, 0x6d, 0xf9, 0xc2, 0xf3, 0xc2, 0xce, 0x9d, 0xcb, + 0xfd, 0x30, 0x22, 0x2d, 0x8a, 0x19, 0xdf, 0xee, 0xeb, 0xa2, 0x2e, 0x56, 0x54, 0xd0, 0xeb, 0x30, + 0xc4, 0xbc, 0xa5, 0xc2, 0xd9, 0x91, 0x7c, 0x89, 0xb3, 0x19, 0xab, 0x2c, 0xde, 0x90, 0xec, 0x6f, + 0x88, 0x05, 0x05, 0x74, 0x5d, 0xfa, 0x22, 0x86, 0x15, 0xef, 0x76, 0x48, 0x98, 0x2f, 0x62, 0x69, + 0xe9, 0xfd, 0xb1, 0x9b, 0x21, 0x2f, 0xcf, 0x4c, 0xe8, 0x65, 0xd4, 0xa4, 0x5c, 0x94, 0xf8, 0x2f, + 0xf3, 0x84, 0xcd, 0x42, 0x7e, 0xf7, 0xcc, 0x5c, 0x62, 0xf1, 0x70, 0xde, 0x31, 0x49, 0xe0, 0x24, + 0x4d, 0xca, 0x91, 0xf2, 0x5d, 0x2f, 0x7c, 0x37, 0x7a, 0x9d, 0x1d, 0xfc, 0x21, 0xce, 0x6e, 0x23, + 0x5e, 0x82, 0x45, 0xfd, 0x13, 0x65, 0x0f, 0xe6, 0x3c, 0x98, 0x4a, 0x6e, 0xd1, 0x47, 0xca, 0x8e, + 0xfc, 0xc1, 0x00, 0x4c, 0x98, 0x4b, 0x0a, 0x5d, 0x81, 0x92, 0x20, 0xa2, 0x62, 0xfb, 0xab, 0x5d, + 0xb2, 0x26, 0x01, 0x38, 0xc6, 0x61, 0x29, 0x1d, 0x58, 0x75, 0xcd, 0x58, 0x37, 0x4e, 0xe9, 0xa0, + 0x20, 0x58, 0xc3, 0xa2, 0x0f, 0xab, 0x4d, 0xdf, 0x8f, 0xd4, 0x85, 0xa4, 0xd6, 0xdd, 0x12, 0x2b, + 0xc5, 0x02, 0x4a, 0x2f, 0xa2, 0x5d, 0x12, 0x78, 0xa4, 0x69, 0x46, 0x01, 0x56, 0x17, 0xd1, 0x0d, + 0x1d, 0x88, 0x4d, 0x5c, 0x7a, 0x9d, 0xfa, 0x21, 0x5b, 0xc8, 0xe2, 0xf9, 0x16, 0x1b, 0x3f, 0xd7, + 0xb8, 0x3b, 0xb4, 0x84, 0xa3, 0x4f, 0xc2, 0x63, 0x2a, 0xd2, 0x11, 0xe6, 0xda, 0x0c, 0xd9, 0xe2, + 0x90, 0x21, 0x6d, 0x79, 0x6c, 0x39, 0x1b, 0x0d, 0xe7, 0xd5, 0x47, 0xaf, 0xc1, 0x84, 0x60, 0xf1, + 0x25, 0xc5, 0x61, 0xd3, 0xc0, 0xe6, 0x86, 0x01, 0xc5, 0x09, 0x6c, 0x19, 0xc7, 0x98, 0x71, 0xd9, + 0x92, 0xc2, 0x48, 0x3a, 0x8e, 0xb1, 0x0e, 0xc7, 0xa9, 0x1a, 0x68, 0x11, 0x26, 0x39, 0x0f, 0xe6, + 0x7a, 0xdb, 0x7c, 0x4e, 0x84, 0x6b, 0x95, 0xda, 0x52, 0xb7, 0x4c, 0x30, 0x4e, 0xe2, 0xa3, 0x97, + 0x61, 0xcc, 0x09, 0xea, 0x3b, 0x6e, 0x44, 0xea, 0x51, 0x27, 0xe0, 0x3e, 0x57, 0x9a, 0x85, 0xd2, + 0xa2, 0x06, 0xc3, 0x06, 0xa6, 0xfd, 0x36, 0xcc, 0x64, 0xc4, 0x49, 0xa0, 0x0b, 0xc7, 0x69, 0xbb, + 0xf2, 0x9b, 0x12, 0x66, 0xcc, 0x8b, 0xd5, 0x8a, 0xfc, 0x1a, 0x0d, 0x8b, 0xae, 0x4e, 0x16, 0x4f, + 0x41, 0x4b, 0x0b, 0xa8, 0x56, 0xe7, 0xaa, 0x04, 0xe0, 0x18, 0xc7, 0xfe, 0x1f, 0x05, 0x98, 0xcc, + 0xd0, 0xad, 0xb0, 0xd4, 0x74, 0x89, 0x47, 0x4a, 0x9c, 0x89, 0xce, 0x0c, 0x8b, 0x5d, 0x38, 0x42, + 0x58, 0xec, 0x62, 0xaf, 0xb0, 0xd8, 0x03, 0xef, 0x24, 0x2c, 0xb6, 0x39, 0x62, 0x83, 0x7d, 0x8d, + 0x58, 0x46, 0x28, 0xed, 0xa1, 0x23, 0x86, 0xd2, 0x36, 0x06, 0x7d, 0xb8, 0x8f, 0x41, 0xff, 0xe1, + 0x02, 0x4c, 0x25, 0x2d, 0x29, 0x4f, 0x40, 0x6e, 0xfb, 0xba, 0x21, 0xb7, 0xbd, 0xdc, 0x8f, 0x2b, + 0x6c, 0xae, 0x0c, 0x17, 0x27, 0x64, 0xb8, 0x1f, 0xec, 0x8b, 0x5a, 0x77, 0x79, 0xee, 0xdf, 0x2c, + 0xc0, 0xe9, 0x4c, 0x5f, 0xdc, 0x13, 0x18, 0x9b, 0x5b, 0xc6, 0xd8, 0x3c, 0xd7, 0xb7, 0x9b, 0x70, + 0xee, 0x00, 0xdd, 0x4d, 0x0c, 0xd0, 0x95, 0xfe, 0x49, 0x76, 0x1f, 0xa5, 0xaf, 0x16, 0xe1, 0x7c, + 0x66, 0xbd, 0x58, 0xec, 0xb9, 0x6a, 0x88, 0x3d, 0x9f, 0x4f, 0x88, 0x3d, 0xed, 0xee, 0xb5, 0x8f, + 0x47, 0x0e, 0x2a, 0xdc, 0x65, 0x99, 0xd3, 0xff, 0x43, 0xca, 0x40, 0x0d, 0x77, 0x59, 0x45, 0x08, + 0x9b, 0x74, 0xbf, 0x99, 0x64, 0x9f, 0xff, 0xc6, 0x82, 0xb3, 0x99, 0x73, 0x73, 0x02, 0xb2, 0xae, + 0x75, 0x53, 0xd6, 0xf5, 0x74, 0xdf, 0xab, 0x35, 0x47, 0xf8, 0xf5, 0x6b, 0x03, 0x39, 0xdf, 0xc2, + 0x5e, 0xf2, 0xb7, 0x60, 0xd4, 0xa9, 0xd7, 0x49, 0x18, 0xae, 0xf9, 0x0d, 0x15, 0xf9, 0xf7, 0x39, + 0xf6, 0xce, 0x8a, 0x8b, 0x0f, 0x0f, 0xe6, 0xe7, 0x92, 0x24, 0x62, 0x30, 0xd6, 0x29, 0xa0, 0x4f, + 0xc3, 0x48, 0x28, 0xee, 0x4d, 0x31, 0xf7, 0x2f, 0xf4, 0x39, 0x38, 0xce, 0x26, 0x69, 0x9a, 0xa1, + 0x89, 0x94, 0xa4, 0x42, 0x91, 0x34, 0xc3, 0x98, 0x14, 0x8e, 0x35, 0x8c, 0xc9, 0xf3, 0x00, 0x7b, + 0xea, 0x31, 0x90, 0x94, 0x3f, 0x68, 0xcf, 0x04, 0x0d, 0x0b, 0x7d, 0x1c, 0xa6, 0x42, 0x1e, 0xbb, + 0x6f, 0xb9, 0xe9, 0x84, 0xcc, 0x59, 0x46, 0xac, 0x42, 0x16, 0xfe, 0xa8, 0x96, 0x80, 0xe1, 0x14, + 0x36, 0x5a, 0x95, 0xad, 0xb2, 0x40, 0x83, 0x7c, 0x61, 0x5e, 0x8a, 0x5b, 0x14, 0x89, 0x71, 0x4f, + 0x25, 0x87, 0x9f, 0x0d, 0xbc, 0x56, 0x13, 0x7d, 0x1a, 0x80, 0x2e, 0x1f, 0x21, 0x87, 0x18, 0xce, + 0x3f, 0x3c, 0xe9, 0xa9, 0xd2, 0xc8, 0xb4, 0xed, 0x65, 0x1e, 0xae, 0x65, 0x45, 0x04, 0x6b, 0x04, + 0xed, 0x1f, 0x1e, 0x80, 0xc7, 0xbb, 0x9c, 0x91, 0x68, 0xd1, 0xd4, 0xc3, 0x3e, 0x93, 0x7c, 0x5c, + 0xcf, 0x65, 0x56, 0x36, 0x5e, 0xdb, 0x89, 0xa5, 0x58, 0x78, 0xc7, 0x4b, 0xf1, 0x07, 0x2c, 0x4d, + 0xec, 0xc1, 0x2d, 0x3e, 0x3f, 0x76, 0xc4, 0xb3, 0xff, 0x18, 0xe5, 0x20, 0x5b, 0x19, 0xc2, 0x84, + 0xe7, 0xfb, 0xee, 0x4e, 0xdf, 0xd2, 0x85, 0x93, 0x95, 0x12, 0xff, 0x96, 0x05, 0xe7, 0xba, 0x06, + 0xed, 0xf8, 0x06, 0x64, 0x18, 0xec, 0x2f, 0x58, 0xf0, 0x64, 0x66, 0x0d, 0xc3, 0xcc, 0xe8, 0x0a, + 0x94, 0xea, 0xb4, 0x50, 0xf3, 0xd2, 0x8c, 0xdd, 0xd7, 0x25, 0x00, 0xc7, 0x38, 0x86, 0x35, 0x51, + 0xa1, 0xa7, 0x35, 0xd1, 0xaf, 0x58, 0x90, 0xda, 0xf4, 0x27, 0x70, 0xfb, 0x54, 0xcc, 0xdb, 0xe7, + 0xfd, 0xfd, 0x8c, 0x66, 0xce, 0xc5, 0xf3, 0xc7, 0x93, 0x70, 0x26, 0xc7, 0x4b, 0x69, 0x0f, 0xa6, + 0xb7, 0xeb, 0xc4, 0xf4, 0x7f, 0xed, 0x16, 0x17, 0xa6, 0xab, 0xb3, 0x2c, 0x4b, 0xdd, 0x39, 0x9d, + 0x42, 0xc1, 0xe9, 0x26, 0xd0, 0x17, 0x2c, 0x38, 0xe5, 0xdc, 0x0b, 0x53, 0xb9, 0xfe, 0xc5, 0xda, + 0x79, 0x31, 0x53, 0xb2, 0x73, 0xb7, 0x96, 0xc2, 0x37, 0x9a, 0x67, 0xb9, 0x4c, 0xb3, 0xb0, 0x70, + 0x66, 0x5b, 0x08, 0x8b, 0x00, 0xf7, 0xf4, 0x8d, 0xd2, 0xc5, 0x43, 0x3b, 0xcb, 0x9d, 0x8c, 0x5f, + 0x8b, 0x12, 0x82, 0x15, 0x1d, 0xf4, 0x59, 0x28, 0x6d, 0x4b, 0x1f, 0xcf, 0x8c, 0x6b, 0x37, 0x1e, + 0xc8, 0xee, 0x9e, 0xaf, 0x5c, 0x3d, 0xab, 0x90, 0x70, 0x4c, 0x14, 0xbd, 0x06, 0x45, 0x6f, 0x2b, + 0xec, 0x96, 0x0e, 0x34, 0x61, 0x87, 0xc7, 0xe3, 0x20, 0xac, 0xaf, 0xd6, 0x30, 0xad, 0x88, 0xae, + 0x43, 0x31, 0xd8, 0x6c, 0x08, 0xb1, 0x64, 0xe6, 0x26, 0xc5, 0x4b, 0xe5, 0x9c, 0x5e, 0x31, 0x4a, + 0x78, 0xa9, 0x8c, 0x29, 0x09, 0x54, 0x85, 0x41, 0xe6, 0xda, 0x23, 0x2e, 0xb9, 0x4c, 0x76, 0xbe, + 0x8b, 0x8b, 0x1c, 0x0f, 0x96, 0xc0, 0x10, 0x30, 0x27, 0x84, 0x36, 0x60, 0xa8, 0xce, 0x52, 0x47, + 0x8a, 0xc0, 0x68, 0x1f, 0xca, 0x14, 0x40, 0x76, 0xc9, 0xa9, 0x29, 0xe4, 0x71, 0x0c, 0x03, 0x0b, + 0x5a, 0x8c, 0x2a, 0x69, 0xef, 0x6c, 0x85, 0x22, 0xd5, 0x71, 0x36, 0xd5, 0x2e, 0xa9, 0x62, 0x05, + 0x55, 0x86, 0x81, 0x05, 0x2d, 0xf4, 0x0a, 0x14, 0xb6, 0xea, 0xc2, 0x6d, 0x27, 0x53, 0x12, 0x69, + 0x86, 0xb2, 0x58, 0x1a, 0x7a, 0x70, 0x30, 0x5f, 0x58, 0x5d, 0xc6, 0x85, 0xad, 0x3a, 0x5a, 0x87, + 0xe1, 0x2d, 0xee, 0xfc, 0x2e, 0x84, 0x8d, 0x4f, 0x65, 0xfb, 0xe5, 0xa7, 0xfc, 0xe3, 0xb9, 0xc7, + 0x8a, 0x00, 0x60, 0x49, 0x84, 0xc5, 0x8b, 0x57, 0x4e, 0xfc, 0x22, 0x86, 0xd8, 0xc2, 0xd1, 0x02, + 0x2f, 0x70, 0xa6, 0x23, 0x0e, 0x05, 0x80, 0x35, 0x8a, 0x74, 0x55, 0x3b, 0x32, 0xdf, 0xbc, 0x08, + 0x36, 0x93, 0xb9, 0xaa, 0x7b, 0xa4, 0xe2, 0xe7, 0xab, 0x5a, 0x21, 0xe1, 0x98, 0x28, 0xda, 0x85, + 0xf1, 0xbd, 0xb0, 0xbd, 0x43, 0xe4, 0x96, 0x66, 0xb1, 0x67, 0x72, 0xee, 0xe5, 0x3b, 0x02, 0xd1, + 0x0d, 0xa2, 0x8e, 0xd3, 0x4c, 0x9d, 0x42, 0x4c, 0xa7, 0x7f, 0x47, 0x27, 0x86, 0x4d, 0xda, 0x74, + 0xf8, 0xdf, 0xea, 0xf8, 0x9b, 0xfb, 0x11, 0x11, 0xa1, 0xbf, 0x32, 0x87, 0xff, 0x0d, 0x8e, 0x92, + 0x1e, 0x7e, 0x01, 0xc0, 0x92, 0x08, 0xba, 0x23, 0x86, 0x87, 0x9d, 0x9e, 0x53, 0xf9, 0xf1, 0x39, + 0x17, 0x25, 0x52, 0xce, 0xa0, 0xb0, 0xd3, 0x32, 0x26, 0xc5, 0x4e, 0xc9, 0xf6, 0x8e, 0x1f, 0xf9, + 0x5e, 0xe2, 0x84, 0x9e, 0xce, 0x3f, 0x25, 0xab, 0x19, 0xf8, 0xe9, 0x53, 0x32, 0x0b, 0x0b, 0x67, + 0xb6, 0x85, 0x1a, 0x30, 0xd1, 0xf6, 0x83, 0xe8, 0x9e, 0x1f, 0xc8, 0xf5, 0x85, 0xba, 0x08, 0x4b, + 0x0c, 0x4c, 0xd1, 0x22, 0x8b, 0xaa, 0x67, 0x42, 0x70, 0x82, 0x26, 0xfa, 0x04, 0x0c, 0x87, 0x75, + 0xa7, 0x49, 0x2a, 0xb7, 0x66, 0x67, 0xf2, 0xaf, 0x9f, 0x1a, 0x47, 0xc9, 0x59, 0x5d, 0x3c, 0xb8, + 0x3c, 0x47, 0xc1, 0x92, 0x1c, 0x5a, 0x85, 0x41, 0x96, 0x0f, 0x8c, 0xc5, 0xa9, 0xcb, 0x09, 0x33, + 0x9a, 0xb2, 0x8a, 0xe6, 0x67, 0x13, 0x2b, 0xc6, 0xbc, 0x3a, 0xdd, 0x03, 0xe2, 0xcd, 0xe0, 0x87, + 0xb3, 0xa7, 0xf3, 0xf7, 0x80, 0x78, 0x6a, 0xdc, 0xaa, 0x75, 0xdb, 0x03, 0x0a, 0x09, 0xc7, 0x44, + 0xe9, 0xc9, 0x4c, 0x4f, 0xd3, 0x33, 0x5d, 0xcc, 0x79, 0x72, 0xcf, 0x52, 0x76, 0x32, 0xd3, 0x93, + 0x94, 0x92, 0xb0, 0x7f, 0x6f, 0x38, 0xcd, 0xb3, 0xb0, 0x57, 0xe6, 0x77, 0x59, 0x29, 0x05, 0xe4, + 0x87, 0xfb, 0x15, 0x7a, 0x1d, 0x23, 0x0b, 0xfe, 0x05, 0x0b, 0xce, 0xb4, 0x33, 0x3f, 0x44, 0x30, + 0x00, 0xfd, 0xc9, 0xce, 0xf8, 0xa7, 0xab, 0x98, 0x86, 0xd9, 0x70, 0x9c, 0xd3, 0x52, 0xf2, 0x99, + 0x53, 0x7c, 0xc7, 0xcf, 0x9c, 0x35, 0x18, 0x61, 0x4c, 0x66, 0x8f, 0x54, 0xca, 0xc9, 0xd7, 0x1e, + 0x63, 0x25, 0x96, 0x45, 0x45, 0xac, 0x48, 0xa0, 0x1f, 0xb4, 0xe0, 0x5c, 0xb2, 0xeb, 0x98, 0x30, + 0xb0, 0x08, 0x84, 0xc8, 0x1f, 0xb8, 0xab, 0xe2, 0xfb, 0x53, 0xfc, 0xbf, 0x81, 0x7c, 0xd8, 0x0b, + 0x01, 0x77, 0x6f, 0x0c, 0x95, 0x33, 0x5e, 0xd8, 0x43, 0xa6, 0x56, 0xa1, 0x8f, 0x57, 0xf6, 0x8b, + 0x30, 0xd6, 0xf2, 0x3b, 0x5e, 0x24, 0xac, 0x7f, 0x84, 0x25, 0x02, 0xd3, 0xc0, 0xaf, 0x69, 0xe5, + 0xd8, 0xc0, 0x4a, 0xbc, 0xcd, 0x47, 0x1e, 0xfa, 0x6d, 0xfe, 0x26, 0x8c, 0x79, 0x9a, 0xb9, 0xaa, + 0xe0, 0x07, 0x2e, 0xe5, 0x07, 0x31, 0xd5, 0x8d, 0x5b, 0x79, 0x2f, 0xf5, 0x12, 0x6c, 0x50, 0x3b, + 0xd9, 0x07, 0xdf, 0x97, 0xad, 0x0c, 0xa6, 0x9e, 0x8b, 0x00, 0x3e, 0x6a, 0x8a, 0x00, 0x2e, 0x25, + 0x45, 0x00, 0x29, 0x89, 0xb2, 0xf1, 0xfa, 0xef, 0x3f, 0x47, 0x4b, 0xbf, 0x81, 0x10, 0xed, 0x26, + 0x5c, 0xe8, 0x75, 0x2d, 0x31, 0x33, 0xb0, 0x86, 0xd2, 0x1f, 0xc6, 0x66, 0x60, 0x8d, 0x4a, 0x19, + 0x33, 0x48, 0xbf, 0x21, 0x76, 0xec, 0xff, 0x66, 0x41, 0xb1, 0xea, 0x37, 0x4e, 0xe0, 0xc1, 0xfb, + 0x31, 0xe3, 0xc1, 0xfb, 0x78, 0xf6, 0x85, 0xd8, 0xc8, 0x95, 0x87, 0xaf, 0x24, 0xe4, 0xe1, 0xe7, + 0xf2, 0x08, 0x74, 0x97, 0x7e, 0xff, 0x64, 0x11, 0x46, 0xab, 0x7e, 0x43, 0xd9, 0x60, 0xff, 0xda, + 0xc3, 0xd8, 0x60, 0xe7, 0x66, 0x1a, 0xd0, 0x28, 0x33, 0xeb, 0x31, 0xe9, 0x7e, 0xfa, 0x0d, 0x66, + 0x8a, 0x7d, 0x97, 0xb8, 0xdb, 0x3b, 0x11, 0x69, 0x24, 0x3f, 0xe7, 0xe4, 0x4c, 0xb1, 0x7f, 0xaf, + 0x00, 0x93, 0x89, 0xd6, 0x51, 0x13, 0xc6, 0x9b, 0xba, 0xb4, 0x55, 0xac, 0xd3, 0x87, 0x12, 0xd4, + 0x0a, 0x53, 0x56, 0xad, 0x08, 0x9b, 0xc4, 0xd1, 0x02, 0x80, 0x52, 0x3f, 0x4a, 0xb1, 0x1e, 0xe3, + 0xfa, 0x95, 0x7e, 0x32, 0xc4, 0x1a, 0x06, 0x7a, 0x09, 0x46, 0x23, 0xbf, 0xed, 0x37, 0xfd, 0xed, + 0xfd, 0x1b, 0x44, 0x06, 0x75, 0x52, 0x06, 0x6a, 0x1b, 0x31, 0x08, 0xeb, 0x78, 0xe8, 0x3e, 0x4c, + 0x2b, 0x22, 0xb5, 0x63, 0x90, 0x40, 0x33, 0xa9, 0xc2, 0x7a, 0x92, 0x22, 0x4e, 0x37, 0x62, 0xff, + 0x54, 0x91, 0x0f, 0xb1, 0x17, 0xb9, 0xef, 0xed, 0x86, 0x77, 0xf7, 0x6e, 0xf8, 0xaa, 0x05, 0x53, + 0xb4, 0x75, 0x66, 0x7d, 0x23, 0xaf, 0x79, 0x15, 0x36, 0xd9, 0xea, 0x12, 0x36, 0xf9, 0x12, 0x3d, + 0x35, 0x1b, 0x7e, 0x27, 0x12, 0xb2, 0x3b, 0xed, 0x58, 0xa4, 0xa5, 0x58, 0x40, 0x05, 0x1e, 0x09, + 0x02, 0xe1, 0x31, 0xa8, 0xe3, 0x91, 0x20, 0xc0, 0x02, 0x2a, 0xa3, 0x2a, 0x0f, 0x64, 0x47, 0x55, + 0xe6, 0xc1, 0x31, 0x85, 0x9d, 0x86, 0x60, 0xb8, 0xb4, 0xe0, 0x98, 0xd2, 0x80, 0x23, 0xc6, 0xb1, + 0x7f, 0xb6, 0x08, 0x63, 0x55, 0xbf, 0x11, 0xab, 0x1e, 0x5f, 0x34, 0x54, 0x8f, 0x17, 0x12, 0xaa, + 0xc7, 0x29, 0x1d, 0xf7, 0x3d, 0x45, 0xe3, 0xd7, 0x4b, 0xd1, 0xf8, 0x4f, 0x2d, 0x36, 0x6b, 0xe5, + 0xf5, 0x1a, 0x37, 0xe6, 0x42, 0x57, 0x61, 0x94, 0x1d, 0x30, 0xcc, 0x45, 0x55, 0xea, 0xe3, 0x58, + 0xb6, 0xa0, 0xf5, 0xb8, 0x18, 0xeb, 0x38, 0xe8, 0x32, 0x8c, 0x84, 0xc4, 0x09, 0xea, 0x3b, 0xea, + 0x74, 0x15, 0xca, 0x33, 0x5e, 0x86, 0x15, 0x14, 0xbd, 0x11, 0xc7, 0x65, 0x2c, 0xe6, 0xbb, 0xbc, + 0xe9, 0xfd, 0xe1, 0x5b, 0x24, 0x3f, 0x18, 0xa3, 0x7d, 0x17, 0x50, 0x1a, 0xbf, 0x8f, 0x80, 0x64, + 0xf3, 0x66, 0x40, 0xb2, 0x52, 0x2a, 0x18, 0xd9, 0x9f, 0x5b, 0x30, 0x51, 0xf5, 0x1b, 0x74, 0xeb, + 0x7e, 0x33, 0xed, 0x53, 0x3d, 0x28, 0xed, 0x50, 0x97, 0xa0, 0xb4, 0x17, 0x61, 0xb0, 0xea, 0x37, + 0x2a, 0xd5, 0x6e, 0xfe, 0xe6, 0xf6, 0xdf, 0xb2, 0x60, 0xb8, 0xea, 0x37, 0x4e, 0x40, 0x2d, 0xf0, + 0x51, 0x53, 0x2d, 0xf0, 0x58, 0xce, 0xba, 0xc9, 0xd1, 0x04, 0xfc, 0x8d, 0x01, 0x18, 0xa7, 0xfd, + 0xf4, 0xb7, 0xe5, 0x54, 0x1a, 0xc3, 0x66, 0xf5, 0x31, 0x6c, 0x94, 0x0b, 0xf7, 0x9b, 0x4d, 0xff, + 0x5e, 0x72, 0x5a, 0x57, 0x59, 0x29, 0x16, 0x50, 0xf4, 0x2c, 0x8c, 0xb4, 0x03, 0xb2, 0xe7, 0xfa, + 0x82, 0xbd, 0xd5, 0x94, 0x2c, 0x55, 0x51, 0x8e, 0x15, 0x06, 0x7d, 0x16, 0x86, 0xae, 0x47, 0xaf, + 0xf2, 0xba, 0xef, 0x35, 0xb8, 0xe4, 0xbc, 0x28, 0x32, 0x27, 0x68, 0xe5, 0xd8, 0xc0, 0x42, 0x77, + 0xa1, 0xc4, 0xfe, 0xb3, 0x63, 0xe7, 0xe8, 0x39, 0x38, 0x45, 0x4e, 0x36, 0x41, 0x00, 0xc7, 0xb4, + 0xd0, 0xf3, 0x00, 0x91, 0x8c, 0x3e, 0x1e, 0x8a, 0xe0, 0x53, 0xea, 0x29, 0xa0, 0xe2, 0x92, 0x87, + 0x58, 0xc3, 0x42, 0xcf, 0x40, 0x29, 0x72, 0xdc, 0xe6, 0x4d, 0xd7, 0x23, 0x21, 0x93, 0x88, 0x17, + 0x65, 0x6a, 0x34, 0x51, 0x88, 0x63, 0x38, 0x65, 0xc5, 0x58, 0x64, 0x06, 0x9e, 0xc1, 0x77, 0x84, + 0x61, 0x33, 0x56, 0xec, 0xa6, 0x2a, 0xc5, 0x1a, 0x06, 0xda, 0x81, 0x27, 0x5c, 0x8f, 0x65, 0x19, + 0x20, 0xb5, 0x5d, 0xb7, 0xbd, 0x71, 0xb3, 0x76, 0x87, 0x04, 0xee, 0xd6, 0xfe, 0x92, 0x53, 0xdf, + 0x25, 0x9e, 0xcc, 0xae, 0xf8, 0x7e, 0xd1, 0xc5, 0x27, 0x2a, 0x5d, 0x70, 0x71, 0x57, 0x4a, 0xf6, + 0xcb, 0x70, 0xba, 0xea, 0x37, 0xaa, 0x7e, 0x10, 0xad, 0xfa, 0xc1, 0x3d, 0x27, 0x68, 0xc8, 0x95, + 0x32, 0x2f, 0xa3, 0x24, 0xd0, 0xa3, 0x70, 0x90, 0x1f, 0x14, 0x46, 0x04, 0x84, 0x17, 0x18, 0xf3, + 0x75, 0x44, 0xdf, 0x9e, 0x3a, 0x63, 0x03, 0x54, 0xca, 0x8d, 0x6b, 0x4e, 0x44, 0xd0, 0x2d, 0x96, + 0x4a, 0x38, 0xbe, 0x11, 0x45, 0xf5, 0xa7, 0xb5, 0x54, 0xc2, 0x31, 0x30, 0xf3, 0x0a, 0x35, 0xeb, + 0xdb, 0xff, 0x7d, 0x90, 0x1d, 0x8e, 0x89, 0xb4, 0x0d, 0xe8, 0x33, 0x30, 0x11, 0x92, 0x9b, 0xae, + 0xd7, 0xb9, 0x2f, 0xa5, 0x11, 0x5d, 0xbc, 0xb3, 0x6a, 0x2b, 0x3a, 0x26, 0x97, 0x69, 0x9a, 0x65, + 0x38, 0x41, 0x0d, 0xb5, 0x60, 0xe2, 0x9e, 0xeb, 0x35, 0xfc, 0x7b, 0xa1, 0xa4, 0x3f, 0x92, 0x2f, + 0xda, 0xbc, 0xcb, 0x31, 0x13, 0x7d, 0x34, 0x9a, 0xbb, 0x6b, 0x10, 0xc3, 0x09, 0xe2, 0x74, 0x01, + 0x06, 0x1d, 0x6f, 0x31, 0xbc, 0x1d, 0x92, 0x40, 0x24, 0x85, 0x66, 0x0b, 0x10, 0xcb, 0x42, 0x1c, + 0xc3, 0xe9, 0x02, 0x64, 0x7f, 0xae, 0x05, 0x7e, 0x87, 0xe7, 0x08, 0x10, 0x0b, 0x10, 0xab, 0x52, + 0xac, 0x61, 0xd0, 0x0d, 0xca, 0xfe, 0xad, 0xfb, 0x1e, 0xf6, 0xfd, 0x48, 0x6e, 0x69, 0x96, 0x86, + 0x54, 0x2b, 0xc7, 0x06, 0x16, 0x5a, 0x05, 0x14, 0x76, 0xda, 0xed, 0x26, 0x33, 0xfb, 0x70, 0x9a, + 0x8c, 0x14, 0x57, 0xb9, 0x17, 0x79, 0xe8, 0xd4, 0x5a, 0x0a, 0x8a, 0x33, 0x6a, 0xd0, 0xb3, 0x7a, + 0x4b, 0x74, 0x75, 0x90, 0x75, 0x95, 0xab, 0x41, 0x6a, 0xbc, 0x9f, 0x12, 0x86, 0x56, 0x60, 0x38, + 0xdc, 0x0f, 0xeb, 0x91, 0x88, 0x01, 0x97, 0x93, 0x99, 0xa7, 0xc6, 0x50, 0xb4, 0xc4, 0x70, 0xbc, + 0x0a, 0x96, 0x75, 0x51, 0x1d, 0x66, 0x04, 0xc5, 0xe5, 0x1d, 0xc7, 0x53, 0x79, 0x4e, 0xb8, 0xf5, + 0xeb, 0xd5, 0x07, 0x07, 0xf3, 0x33, 0xa2, 0x65, 0x1d, 0x7c, 0x78, 0x30, 0x7f, 0xa6, 0xea, 0x37, + 0x32, 0x20, 0x38, 0x8b, 0x1a, 0x5f, 0x7c, 0xf5, 0xba, 0xdf, 0x6a, 0x57, 0x03, 0x7f, 0xcb, 0x6d, + 0x92, 0x6e, 0xaa, 0xa4, 0x9a, 0x81, 0x29, 0x16, 0x9f, 0x51, 0x86, 0x13, 0xd4, 0xec, 0x6f, 0x67, + 0xfc, 0x0c, 0xcb, 0x83, 0x1c, 0x75, 0x02, 0x82, 0x5a, 0x30, 0xde, 0x66, 0xdb, 0x44, 0x44, 0xee, + 0x17, 0x6b, 0xfd, 0xc5, 0x3e, 0x45, 0x22, 0xf7, 0xe8, 0x35, 0xa0, 0x44, 0x96, 0xec, 0xad, 0x59, + 0xd5, 0xc9, 0x61, 0x93, 0xba, 0xfd, 0x63, 0x8f, 0xb1, 0x1b, 0xb1, 0xc6, 0xe5, 0x1c, 0xc3, 0xc2, + 0xd8, 0x5e, 0x3c, 0xad, 0xe6, 0xf2, 0x05, 0x6e, 0xf1, 0xb4, 0x08, 0x83, 0x7d, 0x2c, 0xeb, 0xa2, + 0x4f, 0xc3, 0x04, 0x7d, 0xa9, 0xa8, 0x5b, 0x29, 0x9c, 0x3d, 0x95, 0x1f, 0x14, 0x41, 0x61, 0xe9, + 0x59, 0x3d, 0xf4, 0xca, 0x38, 0x41, 0x0c, 0xbd, 0xc1, 0xcc, 0x42, 0x24, 0xe9, 0x42, 0x3f, 0xa4, + 0x75, 0x0b, 0x10, 0x49, 0x56, 0x23, 0x82, 0x3a, 0x30, 0x93, 0xce, 0x01, 0x16, 0xce, 0xda, 0xf9, + 0x2c, 0x5f, 0x3a, 0x8d, 0x57, 0x9c, 0x7e, 0x21, 0x0d, 0x0b, 0x71, 0x16, 0x7d, 0x74, 0x13, 0xc6, + 0x45, 0x32, 0x60, 0xb1, 0x72, 0x8b, 0x86, 0x1c, 0x70, 0x1c, 0xeb, 0xc0, 0xc3, 0x64, 0x01, 0x36, + 0x2b, 0xa3, 0x6d, 0x38, 0xa7, 0x25, 0xe7, 0xb9, 0x16, 0x38, 0x4c, 0x99, 0xef, 0xb2, 0xe3, 0x54, + 0xbb, 0xab, 0x9f, 0x7c, 0x70, 0x30, 0x7f, 0x6e, 0xa3, 0x1b, 0x22, 0xee, 0x4e, 0x07, 0xdd, 0x82, + 0xd3, 0xdc, 0xa5, 0xb7, 0x4c, 0x9c, 0x46, 0xd3, 0xf5, 0x14, 0x33, 0xc0, 0xb7, 0xfc, 0xd9, 0x07, + 0x07, 0xf3, 0xa7, 0x17, 0xb3, 0x10, 0x70, 0x76, 0x3d, 0xf4, 0x51, 0x28, 0x35, 0xbc, 0x50, 0x8c, + 0xc1, 0x90, 0x91, 0xff, 0xa8, 0x54, 0x5e, 0xaf, 0xa9, 0xef, 0x8f, 0xff, 0xe0, 0xb8, 0x02, 0xda, + 0xe6, 0xb2, 0x62, 0x25, 0xc1, 0x18, 0x4e, 0x85, 0x34, 0x4a, 0x0a, 0xf9, 0x0c, 0xa7, 0x3e, 0xae, + 0x24, 0x51, 0xb6, 0xee, 0x86, 0xbf, 0x9f, 0x41, 0x18, 0xbd, 0x0e, 0x88, 0xbe, 0x20, 0xdc, 0x3a, + 0x59, 0xac, 0xb3, 0xb4, 0x10, 0x4c, 0xb4, 0x3e, 0x62, 0xba, 0x99, 0xd5, 0x52, 0x18, 0x38, 0xa3, + 0x16, 0xba, 0x4e, 0x4f, 0x15, 0xbd, 0x54, 0x9c, 0x5a, 0x2a, 0x5b, 0x5d, 0x99, 0xb4, 0x03, 0x52, + 0x77, 0x22, 0xd2, 0x30, 0x29, 0xe2, 0x44, 0x3d, 0xd4, 0x80, 0x27, 0x9c, 0x4e, 0xe4, 0x33, 0x31, + 0xbc, 0x89, 0xba, 0xe1, 0xef, 0x12, 0x8f, 0x69, 0xc0, 0x46, 0x96, 0x2e, 0x50, 0x6e, 0x63, 0xb1, + 0x0b, 0x1e, 0xee, 0x4a, 0x85, 0x72, 0x89, 0x2a, 0x3d, 0x2d, 0x98, 0x81, 0x9a, 0x32, 0x52, 0xd4, + 0xbe, 0x04, 0xa3, 0x3b, 0x7e, 0x18, 0xad, 0x93, 0xe8, 0x9e, 0x1f, 0xec, 0x8a, 0x78, 0x9b, 0x71, + 0x8c, 0xe6, 0x18, 0x84, 0x75, 0x3c, 0xfa, 0x0c, 0x64, 0xf6, 0x19, 0x95, 0x32, 0x53, 0x8d, 0x8f, + 0xc4, 0x67, 0xcc, 0x75, 0x5e, 0x8c, 0x25, 0x5c, 0xa2, 0x56, 0xaa, 0xcb, 0x4c, 0xcd, 0x9d, 0x40, + 0xad, 0x54, 0x97, 0xb1, 0x84, 0xd3, 0xe5, 0x1a, 0xee, 0x38, 0x01, 0xa9, 0x06, 0x7e, 0x9d, 0x84, + 0x5a, 0x64, 0xf0, 0xc7, 0x79, 0x34, 0x51, 0xba, 0x5c, 0x6b, 0x59, 0x08, 0x38, 0xbb, 0x1e, 0x22, + 0xe9, 0xc4, 0x54, 0x13, 0xf9, 0xfa, 0x89, 0x34, 0x3f, 0xd3, 0x67, 0x6e, 0x2a, 0x0f, 0xa6, 0x54, + 0x4a, 0x2c, 0x1e, 0x3f, 0x34, 0x9c, 0x9d, 0x64, 0x6b, 0xbb, 0xff, 0xe0, 0xa3, 0x4a, 0xe3, 0x53, + 0x49, 0x50, 0xc2, 0x29, 0xda, 0x46, 0x2c, 0xae, 0xa9, 0x9e, 0xb1, 0xb8, 0xae, 0x40, 0x29, 0xec, + 0x6c, 0x36, 0xfc, 0x96, 0xe3, 0x7a, 0x4c, 0xcd, 0xad, 0xbd, 0x47, 0x6a, 0x12, 0x80, 0x63, 0x1c, + 0xb4, 0x0a, 0x23, 0x8e, 0x54, 0xe7, 0xa0, 0xfc, 0xe8, 0x2b, 0x4a, 0x89, 0xc3, 0x03, 0x12, 0x48, + 0x05, 0x8e, 0xaa, 0x8b, 0x5e, 0x85, 0x71, 0xe1, 0x92, 0x2a, 0xb2, 0x31, 0xce, 0x98, 0x7e, 0x43, + 0x35, 0x1d, 0x88, 0x4d, 0x5c, 0x74, 0x1b, 0x46, 0x23, 0xbf, 0xc9, 0x9c, 0x5f, 0x28, 0x9b, 0x77, + 0x26, 0x3f, 0x8e, 0xd8, 0x86, 0x42, 0xd3, 0x25, 0xa9, 0xaa, 0x2a, 0xd6, 0xe9, 0xa0, 0x0d, 0xbe, + 0xde, 0x59, 0x84, 0x6c, 0x12, 0xce, 0x3e, 0x96, 0x7f, 0x27, 0xa9, 0x40, 0xda, 0xe6, 0x76, 0x10, + 0x35, 0xb1, 0x4e, 0x06, 0x5d, 0x83, 0xe9, 0x76, 0xe0, 0xfa, 0x6c, 0x4d, 0x28, 0x4d, 0xde, 0xac, + 0x99, 0x9e, 0xa7, 0x9a, 0x44, 0xc0, 0xe9, 0x3a, 0xcc, 0xa3, 0x58, 0x14, 0xce, 0x9e, 0xe5, 0x09, + 0x9b, 0xf9, 0xf3, 0x8e, 0x97, 0x61, 0x05, 0x45, 0x6b, 0xec, 0x24, 0xe6, 0x92, 0x89, 0xd9, 0xb9, + 0xfc, 0x80, 0x2f, 0xba, 0x04, 0x83, 0x33, 0xaf, 0xea, 0x2f, 0x8e, 0x29, 0xa0, 0x86, 0x96, 0xd9, + 0x8f, 0xbe, 0x18, 0xc2, 0xd9, 0x27, 0xba, 0x18, 0xc9, 0x25, 0x9e, 0x17, 0x31, 0x43, 0x60, 0x14, + 0x87, 0x38, 0x41, 0x13, 0x7d, 0x1c, 0xa6, 0x44, 0x98, 0xba, 0x78, 0x98, 0xce, 0xc5, 0x26, 0xc5, + 0x38, 0x01, 0xc3, 0x29, 0x6c, 0x9e, 0x39, 0xc0, 0xd9, 0x6c, 0x12, 0x71, 0xf4, 0xdd, 0x74, 0xbd, + 0xdd, 0x70, 0xf6, 0x3c, 0x3b, 0x1f, 0x44, 0xe6, 0x80, 0x24, 0x14, 0x67, 0xd4, 0x40, 0x1b, 0x30, + 0xd5, 0x0e, 0x08, 0x69, 0x31, 0x46, 0x5f, 0xdc, 0x67, 0xf3, 0xdc, 0xa1, 0x9e, 0xf6, 0xa4, 0x9a, + 0x80, 0x1d, 0x66, 0x94, 0xe1, 0x14, 0x05, 0x74, 0x0f, 0x46, 0xfc, 0x3d, 0x12, 0xec, 0x10, 0xa7, + 0x31, 0x7b, 0xa1, 0x8b, 0x89, 0xbb, 0xb8, 0xdc, 0x6e, 0x09, 0xdc, 0x84, 0xf6, 0x5f, 0x16, 0xf7, + 0xd6, 0xfe, 0xcb, 0xc6, 0xd0, 0x0f, 0x59, 0x70, 0x56, 0x2a, 0x0c, 0x6a, 0x6d, 0x3a, 0xea, 0xcb, + 0xbe, 0x17, 0x46, 0x01, 0x77, 0x01, 0x7f, 0x32, 0xdf, 0x2d, 0x7a, 0x23, 0xa7, 0x92, 0x12, 0x8e, + 0x9e, 0xcd, 0xc3, 0x08, 0x71, 0x7e, 0x8b, 0x68, 0x19, 0xa6, 0x43, 0x12, 0xc9, 0xc3, 0x68, 0x31, + 0x5c, 0x7d, 0xa3, 0xbc, 0x3e, 0x7b, 0x91, 0xfb, 0xaf, 0xd3, 0xcd, 0x50, 0x4b, 0x02, 0x71, 0x1a, + 0x7f, 0xee, 0x5b, 0x61, 0x3a, 0x75, 0xfd, 0x1f, 0x25, 0x23, 0xca, 0xdc, 0x2e, 0x8c, 0x1b, 0x43, + 0xfc, 0x48, 0xb5, 0xc7, 0xff, 0x6a, 0x18, 0x4a, 0x4a, 0xb3, 0x88, 0xae, 0x98, 0x0a, 0xe3, 0xb3, + 0x49, 0x85, 0xf1, 0x08, 0x7d, 0xd7, 0xeb, 0x3a, 0xe2, 0x8d, 0x8c, 0xa8, 0x5d, 0x79, 0x1b, 0xba, + 0x7f, 0x77, 0x6c, 0x4d, 0x5c, 0x5b, 0xec, 0x5b, 0xf3, 0x3c, 0xd0, 0x55, 0x02, 0x7c, 0x0d, 0xa6, + 0x3d, 0x9f, 0xf1, 0x9c, 0xa4, 0x21, 0x19, 0x0a, 0xc6, 0x37, 0x94, 0xf4, 0x30, 0x18, 0x09, 0x04, + 0x9c, 0xae, 0x43, 0x1b, 0xe4, 0x17, 0x7f, 0x52, 0xe4, 0xcc, 0xf9, 0x02, 0x2c, 0xa0, 0xe8, 0x22, + 0x0c, 0xb6, 0xfd, 0x46, 0xa5, 0x2a, 0xf8, 0x4d, 0x2d, 0x56, 0x64, 0xa3, 0x52, 0xc5, 0x1c, 0x86, + 0x16, 0x61, 0x88, 0xfd, 0x08, 0x67, 0xc7, 0xf2, 0xe3, 0x1d, 0xb0, 0x1a, 0x5a, 0xbe, 0x19, 0x56, + 0x01, 0x8b, 0x8a, 0x4c, 0xf4, 0x45, 0x99, 0x74, 0x26, 0xfa, 0x1a, 0x7e, 0x48, 0xd1, 0x97, 0x24, + 0x80, 0x63, 0x5a, 0xe8, 0x3e, 0x9c, 0x36, 0x1e, 0x46, 0x7c, 0x89, 0x90, 0x50, 0xf8, 0x5c, 0x5f, + 0xec, 0xfa, 0x22, 0x12, 0x9a, 0xea, 0x73, 0xa2, 0xd3, 0xa7, 0x2b, 0x59, 0x94, 0x70, 0x76, 0x03, + 0xa8, 0x09, 0xd3, 0xf5, 0x54, 0xab, 0x23, 0xfd, 0xb7, 0xaa, 0x26, 0x34, 0xdd, 0x62, 0x9a, 0x30, + 0x7a, 0x15, 0x46, 0xde, 0xf2, 0x43, 0x76, 0x56, 0x0b, 0x1e, 0x59, 0x3a, 0xec, 0x8e, 0xbc, 0x71, + 0xab, 0xc6, 0xca, 0x0f, 0x0f, 0xe6, 0x47, 0xab, 0x7e, 0x43, 0xfe, 0xc5, 0xaa, 0x02, 0xfa, 0x5e, + 0x0b, 0xe6, 0xd2, 0x2f, 0x2f, 0xd5, 0xe9, 0xf1, 0xfe, 0x3b, 0x6d, 0x8b, 0x46, 0xe7, 0x56, 0x72, + 0xc9, 0xe1, 0x2e, 0x4d, 0xd9, 0xbf, 0x64, 0x31, 0xa9, 0x9b, 0xd0, 0x00, 0x91, 0xb0, 0xd3, 0x3c, + 0x89, 0x34, 0x9b, 0x2b, 0x86, 0x72, 0xea, 0xa1, 0x2d, 0x17, 0xfe, 0xb9, 0xc5, 0x2c, 0x17, 0x4e, + 0xd0, 0x45, 0xe1, 0x0d, 0x18, 0x89, 0x64, 0xfa, 0xd3, 0x2e, 0x99, 0x41, 0xb5, 0x4e, 0x31, 0xeb, + 0x0d, 0xc5, 0xb1, 0xaa, 0x4c, 0xa7, 0x8a, 0x8c, 0xfd, 0x8f, 0xf8, 0x0c, 0x48, 0xc8, 0x09, 0xe8, + 0x00, 0xca, 0xa6, 0x0e, 0x60, 0xbe, 0xc7, 0x17, 0xe4, 0xe8, 0x02, 0xfe, 0xa1, 0xd9, 0x6f, 0x26, + 0xa9, 0x79, 0xb7, 0x9b, 0xcc, 0xd8, 0x5f, 0xb4, 0x00, 0xe2, 0x50, 0xbc, 0x4c, 0xbe, 0xec, 0x07, + 0x32, 0xc7, 0x62, 0x56, 0x36, 0xa1, 0x97, 0x29, 0x8f, 0xea, 0x47, 0x7e, 0xdd, 0x6f, 0x0a, 0x0d, + 0xd7, 0x13, 0xb1, 0x1a, 0x82, 0x97, 0x1f, 0x6a, 0xbf, 0xb1, 0xc2, 0x46, 0xf3, 0x32, 0xf0, 0x57, + 0x31, 0x56, 0x8c, 0x19, 0x41, 0xbf, 0x7e, 0xc4, 0x82, 0x53, 0x59, 0xf6, 0xae, 0xf4, 0xc5, 0xc3, + 0x65, 0x56, 0xca, 0x9c, 0x49, 0xcd, 0xe6, 0x1d, 0x51, 0x8e, 0x15, 0x46, 0xdf, 0x99, 0xc3, 0x8e, + 0x16, 0x03, 0xf7, 0x16, 0x8c, 0x57, 0x03, 0xa2, 0x5d, 0xae, 0xaf, 0x71, 0x67, 0x72, 0xde, 0x9f, + 0x67, 0x8f, 0xec, 0x48, 0x6e, 0xff, 0x74, 0x01, 0x4e, 0x71, 0xab, 0x80, 0xc5, 0x3d, 0xdf, 0x6d, + 0x54, 0xfd, 0x86, 0xc8, 0xfa, 0xf6, 0x29, 0x18, 0x6b, 0x6b, 0x82, 0xc6, 0x6e, 0xf1, 0x1c, 0x75, + 0x81, 0x64, 0x2c, 0x1a, 0xd1, 0x4b, 0xb1, 0x41, 0x0b, 0x35, 0x60, 0x8c, 0xec, 0xb9, 0x75, 0xa5, + 0x5a, 0x2e, 0x1c, 0xf9, 0xa2, 0x53, 0xad, 0xac, 0x68, 0x74, 0xb0, 0x41, 0xf5, 0x11, 0xe4, 0xf3, + 0xb5, 0x7f, 0xd4, 0x82, 0xc7, 0x72, 0xa2, 0x3f, 0xd2, 0xe6, 0xee, 0x31, 0xfb, 0x0b, 0xb1, 0x6c, + 0x55, 0x73, 0xdc, 0x2a, 0x03, 0x0b, 0x28, 0xfa, 0x04, 0x00, 0xb7, 0xaa, 0xa0, 0x4f, 0xee, 0x5e, + 0x61, 0xf2, 0x8c, 0x08, 0x5f, 0x5a, 0xb0, 0x26, 0x59, 0x1f, 0x6b, 0xb4, 0xec, 0x2f, 0x0d, 0xc0, + 0x20, 0xcf, 0x3d, 0xbe, 0x0a, 0xc3, 0x3b, 0x3c, 0x17, 0x46, 0x3f, 0x69, 0x37, 0x62, 0x61, 0x08, + 0x2f, 0xc0, 0xb2, 0x32, 0x5a, 0x83, 0x19, 0x9e, 0x4b, 0xa4, 0x59, 0x26, 0x4d, 0x67, 0x5f, 0x4a, + 0xee, 0x78, 0x1e, 0x4e, 0x25, 0xc1, 0xac, 0xa4, 0x51, 0x70, 0x56, 0x3d, 0xf4, 0x1a, 0x4c, 0xd0, + 0x97, 0x94, 0xdf, 0x89, 0x24, 0x25, 0x9e, 0x45, 0x44, 0x3d, 0xdd, 0x36, 0x0c, 0x28, 0x4e, 0x60, + 0xd3, 0xc7, 0x7c, 0x3b, 0x25, 0xa3, 0x1c, 0x8c, 0x1f, 0xf3, 0xa6, 0x5c, 0xd2, 0xc4, 0x65, 0x86, + 0xae, 0x1d, 0x66, 0xd6, 0xbb, 0xb1, 0x13, 0x90, 0x70, 0xc7, 0x6f, 0x36, 0x18, 0xd3, 0x37, 0xa8, + 0x19, 0xba, 0x26, 0xe0, 0x38, 0x55, 0x83, 0x52, 0xd9, 0x72, 0xdc, 0x66, 0x27, 0x20, 0x31, 0x95, + 0x21, 0x93, 0xca, 0x6a, 0x02, 0x8e, 0x53, 0x35, 0x7a, 0x0b, 0x5f, 0x87, 0x8f, 0x47, 0xf8, 0x4a, + 0x17, 0xec, 0xe9, 0x6a, 0xe0, 0xd3, 0x13, 0x5b, 0xc6, 0xce, 0x51, 0x66, 0xd2, 0xc3, 0xd2, 0xcd, + 0xb7, 0x4b, 0x94, 0x39, 0x61, 0x48, 0xca, 0x29, 0x18, 0x96, 0x0a, 0x35, 0xe1, 0xe0, 0x2b, 0xa9, + 0xa0, 0xab, 0x30, 0x2a, 0x52, 0x51, 0x30, 0x6b, 0x5e, 0xbe, 0x46, 0x98, 0x65, 0x45, 0x39, 0x2e, + 0xc6, 0x3a, 0x8e, 0xfd, 0x7d, 0x05, 0x98, 0xc9, 0x70, 0xc7, 0xe0, 0x67, 0xe2, 0xb6, 0x1b, 0x46, + 0x2a, 0xa9, 0xa1, 0x76, 0x26, 0xf2, 0x72, 0xac, 0x30, 0xe8, 0xc6, 0xe3, 0xa7, 0x6e, 0xf2, 0xa4, + 0x15, 0xe6, 0xce, 0x02, 0x7a, 0xc4, 0xf4, 0x80, 0x17, 0x60, 0xa0, 0x13, 0x12, 0x19, 0x1f, 0x52, + 0xdd, 0x41, 0x4c, 0xe1, 0xc6, 0x20, 0xf4, 0x4d, 0xb0, 0xad, 0x74, 0x57, 0xda, 0x9b, 0x80, 0x6b, + 0xaf, 0x38, 0x8c, 0x76, 0x2e, 0x22, 0x9e, 0xe3, 0x45, 0xe2, 0xe5, 0x10, 0x07, 0x3a, 0x63, 0xa5, + 0x58, 0x40, 0xed, 0x2f, 0x15, 0xe1, 0x6c, 0xae, 0x83, 0x16, 0xed, 0x7a, 0xcb, 0xf7, 0xdc, 0xc8, + 0x57, 0x26, 0x2b, 0x3c, 0xb8, 0x19, 0x69, 0xef, 0xac, 0x89, 0x72, 0xac, 0x30, 0xd0, 0x25, 0x18, + 0x64, 0xe2, 0xba, 0x54, 0x7a, 0xc7, 0xa5, 0x32, 0x8f, 0x76, 0xc3, 0xc1, 0x7d, 0xa7, 0xce, 0xbd, + 0x48, 0xaf, 0x63, 0xbf, 0x99, 0x3c, 0x1d, 0x69, 0x77, 0x7d, 0xbf, 0x89, 0x19, 0x10, 0x7d, 0x40, + 0x8c, 0x57, 0xc2, 0x46, 0x03, 0x3b, 0x0d, 0x3f, 0xd4, 0x06, 0xed, 0x69, 0x18, 0xde, 0x25, 0xfb, + 0x81, 0xeb, 0x6d, 0x27, 0x6d, 0x77, 0x6e, 0xf0, 0x62, 0x2c, 0xe1, 0x66, 0xa6, 0xae, 0xe1, 0xe3, + 0xce, 0x79, 0x3b, 0xd2, 0xf3, 0xae, 0xfd, 0x81, 0x22, 0x4c, 0xe2, 0xa5, 0xf2, 0x7b, 0x13, 0x71, + 0x3b, 0x3d, 0x11, 0xc7, 0x9d, 0xf3, 0xb6, 0xf7, 0x6c, 0xfc, 0xbc, 0x05, 0x93, 0x2c, 0x21, 0x86, + 0x08, 0x8b, 0xe5, 0xfa, 0xde, 0x09, 0xf0, 0xb5, 0x17, 0x61, 0x30, 0xa0, 0x8d, 0x26, 0xf3, 0x3a, + 0xb2, 0x9e, 0x60, 0x0e, 0x43, 0x4f, 0xc0, 0x00, 0xeb, 0x02, 0x9d, 0xbc, 0x31, 0x9e, 0x12, 0xab, + 0xec, 0x44, 0x0e, 0x66, 0xa5, 0x2c, 0xd6, 0x0b, 0x26, 0xed, 0xa6, 0xcb, 0x3b, 0x1d, 0x2b, 0x53, + 0xdf, 0x1d, 0xae, 0xdb, 0x99, 0x5d, 0x7b, 0x67, 0xb1, 0x5e, 0xb2, 0x49, 0x76, 0x7f, 0x33, 0xfe, + 0x51, 0x01, 0xce, 0x67, 0xd6, 0xeb, 0x3b, 0xd6, 0x4b, 0xf7, 0xda, 0x8f, 0x32, 0xe5, 0x41, 0xf1, + 0x04, 0x2d, 0x23, 0x07, 0xfa, 0x65, 0x65, 0x07, 0xfb, 0x08, 0xc1, 0x92, 0x39, 0x64, 0xef, 0x92, + 0x10, 0x2c, 0x99, 0x7d, 0xcb, 0x79, 0xf3, 0xfe, 0x45, 0x21, 0xe7, 0x5b, 0xd8, 0xeb, 0xf7, 0x32, + 0x3d, 0x67, 0x18, 0x30, 0x94, 0x2f, 0x4a, 0x7e, 0xc6, 0xf0, 0x32, 0xac, 0xa0, 0x68, 0x11, 0x26, + 0x5b, 0xae, 0x47, 0x0f, 0x9f, 0x7d, 0x93, 0xc3, 0x54, 0x11, 0xb2, 0xd6, 0x4c, 0x30, 0x4e, 0xe2, + 0x23, 0x57, 0x0b, 0xcf, 0x52, 0xc8, 0xcf, 0x94, 0x9e, 0xdb, 0xdb, 0x05, 0x53, 0xd1, 0xac, 0x46, + 0x31, 0x23, 0x54, 0xcb, 0x9a, 0x26, 0xf4, 0x28, 0xf6, 0x2f, 0xf4, 0x18, 0xcb, 0x16, 0x78, 0xcc, + 0xbd, 0x0a, 0xe3, 0x0f, 0x2d, 0xe5, 0xb6, 0xbf, 0x5a, 0x84, 0xc7, 0xbb, 0x6c, 0x7b, 0x7e, 0xd6, + 0x1b, 0x73, 0xa0, 0x9d, 0xf5, 0xa9, 0x79, 0xa8, 0xc2, 0xa9, 0xad, 0x4e, 0xb3, 0xb9, 0xcf, 0x1c, + 0x06, 0x48, 0x43, 0x62, 0x08, 0x9e, 0x52, 0xbe, 0xf4, 0x4f, 0xad, 0x66, 0xe0, 0xe0, 0xcc, 0x9a, + 0xf4, 0xe5, 0x40, 0x6f, 0x92, 0x7d, 0x45, 0x2a, 0xf1, 0x72, 0xc0, 0x3a, 0x10, 0x9b, 0xb8, 0xe8, + 0x1a, 0x4c, 0x3b, 0x7b, 0x8e, 0xcb, 0x63, 0xdc, 0x4a, 0x02, 0xfc, 0xe9, 0xa0, 0x84, 0x93, 0x8b, + 0x49, 0x04, 0x9c, 0xae, 0x83, 0x5e, 0x07, 0xe4, 0x6f, 0x32, 0xb3, 0xe2, 0xc6, 0x35, 0xe2, 0x09, + 0x7d, 0x20, 0x9b, 0xbb, 0x62, 0x7c, 0x24, 0xdc, 0x4a, 0x61, 0xe0, 0x8c, 0x5a, 0x89, 0x70, 0x27, + 0x43, 0xf9, 0xe1, 0x4e, 0xba, 0x9f, 0x8b, 0x3d, 0xb3, 0x6d, 0xfc, 0x27, 0x8b, 0x5e, 0x5f, 0x9c, + 0xc9, 0x37, 0xa3, 0xf6, 0xbd, 0xca, 0xec, 0xf9, 0xb8, 0xe0, 0x52, 0x0b, 0xd2, 0x71, 0x5a, 0xb3, + 0xe7, 0x8b, 0x81, 0xd8, 0xc4, 0xe5, 0x0b, 0x22, 0x8c, 0x7d, 0x43, 0x0d, 0x16, 0x5f, 0x84, 0x16, + 0x52, 0x18, 0xe8, 0x93, 0x30, 0xdc, 0x70, 0xf7, 0xdc, 0x50, 0x88, 0x6d, 0x8e, 0xac, 0x23, 0x89, + 0xcf, 0xc1, 0x32, 0x27, 0x83, 0x25, 0x3d, 0xfb, 0x07, 0x0a, 0x30, 0x2e, 0x5b, 0x7c, 0xa3, 0xe3, + 0x47, 0xce, 0x09, 0x5c, 0xcb, 0xd7, 0x8c, 0x6b, 0xf9, 0x03, 0xdd, 0xe2, 0x2b, 0xb1, 0x2e, 0xe5, + 0x5e, 0xc7, 0xb7, 0x12, 0xd7, 0xf1, 0x53, 0xbd, 0x49, 0x75, 0xbf, 0x86, 0xff, 0xb1, 0x05, 0xd3, + 0x06, 0xfe, 0x09, 0xdc, 0x06, 0xab, 0xe6, 0x6d, 0xf0, 0x64, 0xcf, 0x6f, 0xc8, 0xb9, 0x05, 0xbe, + 0xbb, 0x98, 0xe8, 0x3b, 0x3b, 0xfd, 0xdf, 0x82, 0x81, 0x1d, 0x27, 0x68, 0x74, 0x8b, 0x27, 0x9f, + 0xaa, 0xb4, 0x70, 0xdd, 0x09, 0x84, 0x42, 0xf4, 0x59, 0x95, 0xa8, 0xdc, 0x09, 0x7a, 0x2b, 0x43, + 0x59, 0x53, 0xe8, 0x65, 0x18, 0x0a, 0xeb, 0x7e, 0x5b, 0xb9, 0x0b, 0x5c, 0xe0, 0x49, 0xcc, 0x69, + 0xc9, 0xe1, 0xc1, 0x3c, 0x32, 0x9b, 0xa3, 0xc5, 0x58, 0xe0, 0xa3, 0x4f, 0xc1, 0x38, 0xfb, 0xa5, + 0xac, 0x93, 0x8a, 0xf9, 0xb9, 0xa7, 0x6a, 0x3a, 0x22, 0x37, 0xdd, 0x33, 0x8a, 0xb0, 0x49, 0x6a, + 0x6e, 0x1b, 0x4a, 0xea, 0xb3, 0x1e, 0xa9, 0x12, 0xf2, 0xdf, 0x17, 0x61, 0x26, 0x63, 0xcd, 0xa1, + 0xd0, 0x98, 0x89, 0xab, 0x7d, 0x2e, 0xd5, 0x77, 0x38, 0x17, 0x21, 0x7b, 0x0d, 0x35, 0xc4, 0xda, + 0xea, 0xbb, 0xd1, 0xdb, 0x21, 0x49, 0x36, 0x4a, 0x8b, 0x7a, 0x37, 0x4a, 0x1b, 0x3b, 0xb1, 0xa1, + 0xa6, 0x0d, 0xa9, 0x9e, 0x3e, 0xd2, 0x39, 0xfd, 0xd3, 0x22, 0x9c, 0xca, 0x0a, 0xf9, 0x86, 0x3e, + 0x9f, 0xc8, 0x66, 0xf8, 0x62, 0xbf, 0xc1, 0xe2, 0x78, 0x8a, 0x43, 0x2e, 0x6c, 0x5e, 0x5a, 0x30, + 0xf3, 0x1b, 0xf6, 0x1c, 0x66, 0xd1, 0x26, 0x8b, 0x7b, 0x10, 0xf0, 0x2c, 0x94, 0xf2, 0xf8, 0xf8, + 0x70, 0xdf, 0x1d, 0x10, 0xe9, 0x2b, 0xc3, 0x84, 0xe5, 0x83, 0x2c, 0xee, 0x6d, 0xf9, 0x20, 0x5b, + 0x9e, 0x73, 0x61, 0x54, 0xfb, 0x9a, 0x47, 0x3a, 0xe3, 0xbb, 0xf4, 0xb6, 0xd2, 0xfa, 0xfd, 0x48, + 0x67, 0xfd, 0x47, 0x2d, 0x48, 0x18, 0xc3, 0x2b, 0xb1, 0x98, 0x95, 0x2b, 0x16, 0xbb, 0x00, 0x03, + 0x81, 0xdf, 0x24, 0xc9, 0xb4, 0x7f, 0xd8, 0x6f, 0x12, 0xcc, 0x20, 0x14, 0x23, 0x8a, 0x85, 0x1d, + 0x63, 0xfa, 0x43, 0x4e, 0x3c, 0xd1, 0x2e, 0xc2, 0x60, 0x93, 0xec, 0x91, 0x66, 0x32, 0x3b, 0xcb, + 0x4d, 0x5a, 0x88, 0x39, 0xcc, 0xfe, 0xf9, 0x01, 0x38, 0xd7, 0x35, 0x72, 0x08, 0x7d, 0x0e, 0x6d, + 0x3b, 0x11, 0xb9, 0xe7, 0xec, 0x27, 0xd3, 0x28, 0x5c, 0xe3, 0xc5, 0x58, 0xc2, 0x99, 0xbb, 0x12, + 0x8f, 0x86, 0x9c, 0x10, 0x22, 0x8a, 0x20, 0xc8, 0x02, 0x6a, 0x0a, 0xa5, 0x8a, 0xc7, 0x21, 0x94, + 0x7a, 0x1e, 0x20, 0x0c, 0x9b, 0xdc, 0x64, 0xa8, 0x21, 0xfc, 0xa0, 0xe2, 0xa8, 0xd9, 0xb5, 0x9b, + 0x02, 0x82, 0x35, 0x2c, 0x54, 0x86, 0xa9, 0x76, 0xe0, 0x47, 0x5c, 0x26, 0x5b, 0xe6, 0x56, 0x75, + 0x83, 0x66, 0xd0, 0x86, 0x6a, 0x02, 0x8e, 0x53, 0x35, 0xd0, 0x4b, 0x30, 0x2a, 0x02, 0x39, 0x54, + 0x7d, 0xbf, 0x29, 0xc4, 0x40, 0xca, 0xd0, 0xac, 0x16, 0x83, 0xb0, 0x8e, 0xa7, 0x55, 0x63, 0x82, + 0xde, 0xe1, 0xcc, 0x6a, 0x5c, 0xd8, 0xab, 0xe1, 0x25, 0xc2, 0x3f, 0x8e, 0xf4, 0x15, 0xfe, 0x31, + 0x16, 0x8c, 0x95, 0xfa, 0x56, 0xa2, 0x41, 0x4f, 0x51, 0xd2, 0xcf, 0x0c, 0xc0, 0x8c, 0x58, 0x38, + 0x8f, 0x7a, 0xb9, 0xdc, 0x4e, 0x2f, 0x97, 0xe3, 0x10, 0x9d, 0xbd, 0xb7, 0x66, 0x4e, 0x7a, 0xcd, + 0xfc, 0xa0, 0x05, 0x26, 0x7b, 0x85, 0xfe, 0x9f, 0xdc, 0x3c, 0x34, 0x2f, 0xe5, 0xb2, 0x6b, 0x0d, + 0x79, 0x81, 0xbc, 0xc3, 0x8c, 0x34, 0xf6, 0x7f, 0xb4, 0xe0, 0xc9, 0x9e, 0x14, 0xd1, 0x0a, 0x94, + 0x18, 0x0f, 0xa8, 0xbd, 0xce, 0x9e, 0x52, 0x56, 0xb7, 0x12, 0x90, 0xc3, 0x92, 0xc6, 0x35, 0xd1, + 0x4a, 0x2a, 0xe1, 0xcf, 0xd3, 0x19, 0x09, 0x7f, 0x4e, 0x1b, 0xc3, 0xf3, 0x90, 0x19, 0x7f, 0xbe, + 0x9f, 0xde, 0x38, 0x86, 0xc7, 0x0b, 0xfa, 0xb0, 0x21, 0xf6, 0xb3, 0x13, 0x62, 0x3f, 0x64, 0x62, + 0x6b, 0x77, 0xc8, 0xc7, 0x61, 0x8a, 0x45, 0x78, 0x62, 0x36, 0xe0, 0xc2, 0x17, 0xa7, 0x10, 0xdb, + 0x79, 0xde, 0x4c, 0xc0, 0x70, 0x0a, 0xdb, 0xfe, 0xc3, 0x22, 0x0c, 0xf1, 0xed, 0x77, 0x02, 0x6f, + 0xc2, 0x67, 0xa0, 0xe4, 0xb6, 0x5a, 0x1d, 0x9e, 0xc3, 0x65, 0x90, 0x3b, 0xe0, 0xd2, 0x79, 0xaa, + 0xc8, 0x42, 0x1c, 0xc3, 0xd1, 0xaa, 0x90, 0x38, 0x77, 0x09, 0x22, 0xc9, 0x3b, 0xbe, 0x50, 0x76, + 0x22, 0x87, 0x33, 0x38, 0xea, 0x9e, 0x8d, 0x65, 0xd3, 0xe8, 0x33, 0x00, 0x61, 0x14, 0xb8, 0xde, + 0x36, 0x2d, 0x13, 0x31, 0x53, 0x3f, 0xd8, 0x85, 0x5a, 0x4d, 0x21, 0x73, 0x9a, 0xf1, 0x99, 0xa3, + 0x00, 0x58, 0xa3, 0x88, 0x16, 0x8c, 0x9b, 0x7e, 0x2e, 0x31, 0x77, 0xc0, 0xa9, 0xc6, 0x73, 0x36, + 0xf7, 0x11, 0x28, 0x29, 0xe2, 0xbd, 0xe4, 0x4f, 0x63, 0x3a, 0x5b, 0xf4, 0x31, 0x98, 0x4c, 0xf4, + 0xed, 0x48, 0xe2, 0xab, 0x5f, 0xb0, 0x60, 0x92, 0x77, 0x66, 0xc5, 0xdb, 0x13, 0xb7, 0xc1, 0xdb, + 0x70, 0xaa, 0x99, 0x71, 0x2a, 0x8b, 0xe9, 0xef, 0xff, 0x14, 0x57, 0xe2, 0xaa, 0x2c, 0x28, 0xce, + 0x6c, 0x03, 0x5d, 0xa6, 0x3b, 0x8e, 0x9e, 0xba, 0x4e, 0x53, 0xf8, 0xe3, 0x8e, 0xf1, 0xdd, 0xc6, + 0xcb, 0xb0, 0x82, 0xda, 0xbf, 0x63, 0xc1, 0x34, 0xef, 0xf9, 0x0d, 0xb2, 0xaf, 0xce, 0xa6, 0xaf, + 0x67, 0xdf, 0x45, 0xf6, 0xb0, 0x42, 0x4e, 0xf6, 0x30, 0xfd, 0xd3, 0x8a, 0x5d, 0x3f, 0xed, 0xa7, + 0x2d, 0x10, 0x2b, 0xe4, 0x04, 0x84, 0x10, 0xdf, 0x6a, 0x0a, 0x21, 0xe6, 0xf2, 0x37, 0x41, 0x8e, + 0xf4, 0xe1, 0xcf, 0x2d, 0x98, 0xe2, 0x08, 0xb1, 0xb6, 0xfc, 0xeb, 0x3a, 0x0f, 0xfd, 0xe4, 0x18, + 0xbe, 0x41, 0xf6, 0x37, 0xfc, 0xaa, 0x13, 0xed, 0x64, 0x7f, 0x94, 0x31, 0x59, 0x03, 0x5d, 0x27, + 0xab, 0x21, 0x37, 0xd0, 0x11, 0x12, 0x97, 0x1f, 0x39, 0xb9, 0x86, 0xfd, 0x35, 0x0b, 0x10, 0x6f, + 0xc6, 0x60, 0xdc, 0x28, 0x3b, 0xc4, 0x4a, 0xb5, 0x8b, 0x2e, 0x3e, 0x9a, 0x14, 0x04, 0x6b, 0x58, + 0xc7, 0x32, 0x3c, 0x09, 0x93, 0x87, 0x62, 0x6f, 0x93, 0x87, 0x23, 0x8c, 0xe8, 0xbf, 0x1e, 0x82, + 0xa4, 0xd7, 0x0f, 0xba, 0x03, 0x63, 0x75, 0xa7, 0xed, 0x6c, 0xba, 0x4d, 0x37, 0x72, 0x49, 0xd8, + 0xcd, 0x28, 0x6b, 0x59, 0xc3, 0x13, 0x4a, 0x6a, 0xad, 0x04, 0x1b, 0x74, 0xd0, 0x02, 0x40, 0x3b, + 0x70, 0xf7, 0xdc, 0x26, 0xd9, 0x66, 0xb2, 0x12, 0x16, 0x01, 0x80, 0x5b, 0x1a, 0xc9, 0x52, 0xac, + 0x61, 0x64, 0xb8, 0x58, 0x17, 0x1f, 0xb1, 0x8b, 0x35, 0x9c, 0x98, 0x8b, 0xf5, 0xc0, 0x91, 0x5c, + 0xac, 0x47, 0x8e, 0xec, 0x62, 0x3d, 0xd8, 0x97, 0x8b, 0x35, 0x86, 0x33, 0x92, 0xf7, 0xa4, 0xff, + 0x57, 0xdd, 0x26, 0x11, 0x0f, 0x0e, 0x1e, 0xb6, 0x60, 0xee, 0xc1, 0xc1, 0xfc, 0x19, 0x9c, 0x89, + 0x81, 0x73, 0x6a, 0xa2, 0x4f, 0xc0, 0xac, 0xd3, 0x6c, 0xfa, 0xf7, 0xd4, 0xa4, 0xae, 0x84, 0x75, + 0xa7, 0xc9, 0x95, 0x10, 0xc3, 0x8c, 0xea, 0x13, 0x0f, 0x0e, 0xe6, 0x67, 0x17, 0x73, 0x70, 0x70, + 0x6e, 0x6d, 0xf4, 0x51, 0x28, 0xb5, 0x03, 0xbf, 0xbe, 0xa6, 0xb9, 0x26, 0x9e, 0xa7, 0x03, 0x58, + 0x95, 0x85, 0x87, 0x07, 0xf3, 0xe3, 0xea, 0x0f, 0xbb, 0xf0, 0xe3, 0x0a, 0x19, 0x3e, 0xd3, 0xa3, + 0xc7, 0xea, 0x33, 0xbd, 0x0b, 0x33, 0x35, 0x12, 0xb8, 0x2c, 0xcd, 0x79, 0x23, 0x3e, 0x9f, 0x36, + 0xa0, 0x14, 0x24, 0x4e, 0xe4, 0xbe, 0x02, 0x3b, 0x6a, 0x59, 0x0e, 0xe4, 0x09, 0x1c, 0x13, 0xb2, + 0xff, 0x97, 0x05, 0xc3, 0xc2, 0xcb, 0xe7, 0x04, 0xb8, 0xc6, 0x45, 0x43, 0x93, 0x30, 0x9f, 0x3d, + 0x60, 0xac, 0x33, 0xb9, 0x3a, 0x84, 0x4a, 0x42, 0x87, 0xf0, 0x64, 0x37, 0x22, 0xdd, 0xb5, 0x07, + 0x7f, 0xad, 0x48, 0xb9, 0x77, 0xc3, 0xdf, 0xf4, 0xd1, 0x0f, 0xc1, 0x3a, 0x0c, 0x87, 0xc2, 0xdf, + 0xb1, 0x90, 0x6f, 0xa0, 0x9f, 0x9c, 0xc4, 0xd8, 0x8e, 0x4d, 0x78, 0x38, 0x4a, 0x22, 0x99, 0x8e, + 0x94, 0xc5, 0x47, 0xe8, 0x48, 0xd9, 0xcb, 0x23, 0x77, 0xe0, 0x38, 0x3c, 0x72, 0xed, 0xaf, 0xb0, + 0x9b, 0x53, 0x2f, 0x3f, 0x01, 0xa6, 0xea, 0x9a, 0x79, 0xc7, 0xda, 0x5d, 0x56, 0x96, 0xe8, 0x54, + 0x0e, 0x73, 0xf5, 0x73, 0x16, 0x9c, 0xcb, 0xf8, 0x2a, 0x8d, 0xd3, 0x7a, 0x16, 0x46, 0x9c, 0x4e, + 0xc3, 0x55, 0x7b, 0x59, 0xd3, 0x27, 0x2e, 0x8a, 0x72, 0xac, 0x30, 0xd0, 0x32, 0x4c, 0x93, 0xfb, + 0x6d, 0x97, 0xab, 0x52, 0x75, 0xab, 0xd6, 0x22, 0x77, 0x0d, 0x5b, 0x49, 0x02, 0x71, 0x1a, 0x5f, + 0x45, 0x41, 0x29, 0xe6, 0x46, 0x41, 0xf9, 0x7b, 0x16, 0x8c, 0x2a, 0x8f, 0xbf, 0x47, 0x3e, 0xda, + 0x1f, 0x37, 0x47, 0xfb, 0xf1, 0x2e, 0xa3, 0x9d, 0x33, 0xcc, 0xbf, 0x55, 0x50, 0xfd, 0xad, 0xfa, + 0x41, 0xd4, 0x07, 0x07, 0xf7, 0xf0, 0x76, 0xf8, 0x57, 0x61, 0xd4, 0x69, 0xb7, 0x25, 0x40, 0xda, + 0xa0, 0xb1, 0x30, 0xbd, 0x71, 0x31, 0xd6, 0x71, 0x94, 0x5b, 0x40, 0x31, 0xd7, 0x2d, 0xa0, 0x01, + 0x10, 0x39, 0xc1, 0x36, 0x89, 0x68, 0x99, 0x88, 0x58, 0x96, 0x7f, 0xde, 0x74, 0x22, 0xb7, 0xb9, + 0xe0, 0x7a, 0x51, 0x18, 0x05, 0x0b, 0x15, 0x2f, 0xba, 0x15, 0xf0, 0x27, 0xa4, 0x16, 0x12, 0x48, + 0xd1, 0xc2, 0x1a, 0x5d, 0xe9, 0xdd, 0xce, 0xda, 0x18, 0x34, 0x8d, 0x19, 0xd6, 0x45, 0x39, 0x56, + 0x18, 0xf6, 0x47, 0xd8, 0xed, 0xc3, 0xc6, 0xf4, 0x68, 0x31, 0x74, 0xfe, 0xeb, 0x98, 0x9a, 0x0d, + 0xa6, 0xc9, 0x2c, 0xeb, 0x91, 0x7a, 0xba, 0x1f, 0xf6, 0xb4, 0x61, 0xdd, 0x49, 0x2d, 0x0e, 0xe7, + 0x83, 0xbe, 0x2d, 0x65, 0xa0, 0xf2, 0x5c, 0x8f, 0x5b, 0xe3, 0x08, 0x26, 0x29, 0x2c, 0x67, 0x07, + 0xcb, 0x68, 0x50, 0xa9, 0x8a, 0x7d, 0xa1, 0xe5, 0xec, 0x10, 0x00, 0x1c, 0xe3, 0x50, 0x66, 0x4a, + 0xfd, 0x09, 0x67, 0x51, 0x1c, 0xbb, 0x52, 0x61, 0x87, 0x58, 0xc3, 0x40, 0x57, 0x84, 0x40, 0x81, + 0xeb, 0x05, 0x1e, 0x4f, 0x08, 0x14, 0xe4, 0x70, 0x69, 0x52, 0xa0, 0xab, 0x30, 0xaa, 0xd2, 0xf6, + 0x56, 0x79, 0x36, 0x58, 0xb1, 0xcc, 0x56, 0xe2, 0x62, 0xac, 0xe3, 0xa0, 0x0d, 0x98, 0x0c, 0xb9, + 0x9c, 0x4d, 0x05, 0x14, 0xe6, 0xf2, 0xca, 0x0f, 0x4a, 0x2b, 0xa0, 0x9a, 0x09, 0x3e, 0x64, 0x45, + 0xfc, 0x74, 0x92, 0x1e, 0xe8, 0x49, 0x12, 0xe8, 0x35, 0x98, 0x68, 0xfa, 0x4e, 0x63, 0xc9, 0x69, + 0x3a, 0x5e, 0x9d, 0x8d, 0xcf, 0x88, 0x99, 0xfd, 0xf1, 0xa6, 0x01, 0xc5, 0x09, 0x6c, 0xca, 0xbc, + 0xe9, 0x25, 0x22, 0x08, 0xb6, 0xe3, 0x6d, 0x93, 0x50, 0x24, 0x61, 0x65, 0xcc, 0xdb, 0xcd, 0x1c, + 0x1c, 0x9c, 0x5b, 0x1b, 0xbd, 0x0c, 0x63, 0xf2, 0xf3, 0xb5, 0x80, 0x0d, 0xb1, 0x87, 0x85, 0x06, + 0xc3, 0x06, 0x26, 0xba, 0x07, 0xa7, 0xe5, 0xff, 0x8d, 0xc0, 0xd9, 0xda, 0x72, 0xeb, 0xc2, 0x8b, + 0x99, 0xbb, 0x62, 0x2e, 0x4a, 0x7f, 0xc1, 0x95, 0x2c, 0xa4, 0xc3, 0x83, 0xf9, 0x0b, 0x62, 0xd4, + 0x32, 0xe1, 0x6c, 0x12, 0xb3, 0xe9, 0xa3, 0x35, 0x98, 0xd9, 0x21, 0x4e, 0x33, 0xda, 0x59, 0xde, + 0x21, 0xf5, 0x5d, 0xb9, 0xe9, 0x58, 0x18, 0x08, 0xcd, 0x2f, 0xe1, 0x7a, 0x1a, 0x05, 0x67, 0xd5, + 0x43, 0x6f, 0xc2, 0x6c, 0xbb, 0xb3, 0xd9, 0x74, 0xc3, 0x9d, 0x75, 0x3f, 0x62, 0xa6, 0x40, 0x2a, + 0x0b, 0xb0, 0x88, 0x17, 0xa1, 0x02, 0x6d, 0x54, 0x73, 0xf0, 0x70, 0x2e, 0x05, 0xf4, 0x36, 0x9c, + 0x4e, 0x2c, 0x06, 0xe1, 0x31, 0x3f, 0x91, 0x9f, 0x52, 0xa0, 0x96, 0x55, 0x41, 0x04, 0x9f, 0xc8, + 0x02, 0xe1, 0xec, 0x26, 0xe8, 0xe3, 0x43, 0x8b, 0xe1, 0x1a, 0xce, 0x4e, 0xc5, 0x36, 0xcb, 0x5a, + 0xa0, 0xd7, 0x10, 0x1b, 0x58, 0xe8, 0x15, 0x00, 0xb7, 0xbd, 0xea, 0xb4, 0xdc, 0x26, 0x7d, 0x64, + 0xce, 0xb0, 0x3a, 0xf4, 0xc1, 0x01, 0x95, 0xaa, 0x2c, 0xa5, 0xa7, 0xba, 0xf8, 0xb7, 0x8f, 0x35, + 0x6c, 0x54, 0x85, 0x09, 0xf1, 0x6f, 0x5f, 0x2c, 0x86, 0x69, 0xe5, 0xd2, 0x3e, 0x21, 0x6b, 0xa8, + 0x15, 0x80, 0xcc, 0x12, 0x36, 0xe7, 0x89, 0xfa, 0x68, 0x1b, 0xce, 0x89, 0x34, 0xd3, 0x44, 0x5f, + 0xdd, 0x72, 0xf6, 0x42, 0x96, 0x01, 0x60, 0x84, 0x3b, 0x4b, 0x2c, 0x76, 0x43, 0xc4, 0xdd, 0xe9, + 0x50, 0xae, 0x40, 0xdf, 0x24, 0xdc, 0x89, 0xf4, 0x34, 0x37, 0x6a, 0xa2, 0x5c, 0xc1, 0xcd, 0x24, + 0x10, 0xa7, 0xf1, 0x51, 0x08, 0xa7, 0x5d, 0x2f, 0x6b, 0x4f, 0x9c, 0x61, 0x84, 0x3e, 0xc6, 0xfd, + 0x67, 0xbb, 0xef, 0x87, 0x4c, 0x38, 0xdf, 0x0f, 0x99, 0xb4, 0xdf, 0x99, 0xed, 0xde, 0x6f, 0x5b, + 0xb4, 0xb6, 0xc6, 0xdf, 0xa3, 0xcf, 0xc2, 0x98, 0xfe, 0x61, 0x82, 0x57, 0xb9, 0x94, 0xcd, 0xfe, + 0x6a, 0xa7, 0x0a, 0x7f, 0x1d, 0xa8, 0x93, 0x43, 0x87, 0x61, 0x83, 0x22, 0xaa, 0x67, 0x78, 0x9a, + 0x5f, 0xe9, 0x8f, 0x17, 0xea, 0xdf, 0x74, 0x8d, 0x40, 0xf6, 0x66, 0x41, 0x37, 0x61, 0xa4, 0xde, + 0x74, 0x89, 0x17, 0x55, 0xaa, 0xdd, 0x62, 0xc3, 0x2d, 0x0b, 0x1c, 0xb1, 0xfb, 0x44, 0x40, 0x7f, + 0x5e, 0x86, 0x15, 0x05, 0xfb, 0x57, 0x0b, 0x30, 0xdf, 0x23, 0x3b, 0x44, 0x42, 0x91, 0x65, 0xf5, + 0xa5, 0xc8, 0x5a, 0x94, 0x09, 0xb2, 0xd7, 0x13, 0x32, 0xb2, 0x44, 0xf2, 0xeb, 0x58, 0x52, 0x96, + 0xc4, 0xef, 0xdb, 0xb1, 0x40, 0xd7, 0x85, 0x0d, 0xf4, 0x74, 0x8d, 0x31, 0x74, 0xe0, 0x83, 0xfd, + 0x3f, 0x9c, 0x73, 0xf5, 0x99, 0xf6, 0x57, 0x0a, 0x70, 0x5a, 0x0d, 0xe1, 0x37, 0xef, 0xc0, 0xdd, + 0x4e, 0x0f, 0xdc, 0x31, 0x68, 0x83, 0xed, 0x5b, 0x30, 0xc4, 0x83, 0xdd, 0xf5, 0xc1, 0xb0, 0x5f, + 0x34, 0xe3, 0xc2, 0x2a, 0x1e, 0xd1, 0x88, 0x0d, 0xfb, 0xbd, 0x16, 0x4c, 0x6e, 0x2c, 0x57, 0x6b, + 0x7e, 0x7d, 0x97, 0x44, 0x8b, 0xfc, 0x81, 0x85, 0x35, 0x9f, 0xdc, 0x87, 0x61, 0xaa, 0xb3, 0xd8, + 0xf5, 0x0b, 0x30, 0xb0, 0xe3, 0x87, 0x51, 0xd2, 0x54, 0xe4, 0xba, 0x1f, 0x46, 0x98, 0x41, 0xec, + 0xdf, 0xb5, 0x60, 0x70, 0xc3, 0x71, 0xbd, 0x48, 0xaa, 0x15, 0xac, 0x1c, 0xb5, 0x42, 0x3f, 0xdf, + 0x85, 0x5e, 0x82, 0x21, 0xb2, 0xb5, 0x45, 0xea, 0x91, 0x98, 0x55, 0x19, 0xd0, 0x60, 0x68, 0x85, + 0x95, 0x52, 0x0e, 0x92, 0x35, 0xc6, 0xff, 0x62, 0x81, 0x8c, 0xee, 0x42, 0x29, 0x72, 0x5b, 0x64, + 0xb1, 0xd1, 0x10, 0xca, 0xf6, 0x87, 0x08, 0xca, 0xb0, 0x21, 0x09, 0xe0, 0x98, 0x96, 0xfd, 0xa5, + 0x02, 0x40, 0x1c, 0x25, 0xa8, 0xd7, 0x27, 0x2e, 0xa5, 0xd4, 0xb0, 0x97, 0x32, 0xd4, 0xb0, 0x28, + 0x26, 0x98, 0xa1, 0x83, 0x55, 0xc3, 0x54, 0xec, 0x6b, 0x98, 0x06, 0x8e, 0x32, 0x4c, 0xcb, 0x30, + 0x1d, 0x47, 0x39, 0x32, 0x83, 0xbc, 0xb1, 0xeb, 0x73, 0x23, 0x09, 0xc4, 0x69, 0x7c, 0x9b, 0xc0, + 0x05, 0x15, 0xec, 0x45, 0xdc, 0x68, 0xcc, 0x96, 0x5b, 0x57, 0x6b, 0xf7, 0x18, 0xa7, 0x58, 0xcf, + 0x5c, 0xc8, 0xd5, 0x33, 0xff, 0x84, 0x05, 0xa7, 0x92, 0xed, 0x30, 0x2f, 0xde, 0x2f, 0x5a, 0x70, + 0x9a, 0x69, 0xdb, 0x59, 0xab, 0x69, 0xdd, 0xfe, 0x8b, 0x5d, 0x03, 0xd8, 0xe4, 0xf4, 0x38, 0x8e, + 0x9c, 0xb1, 0x96, 0x45, 0x1a, 0x67, 0xb7, 0x68, 0xff, 0x87, 0x02, 0xcc, 0xe6, 0x45, 0xbe, 0x61, + 0xae, 0x1e, 0xce, 0xfd, 0xda, 0x2e, 0xb9, 0x27, 0x0c, 0xea, 0x63, 0x57, 0x0f, 0x5e, 0x8c, 0x25, + 0x3c, 0x19, 0xf0, 0xbf, 0xd0, 0x67, 0xc0, 0xff, 0x1d, 0x98, 0xbe, 0xb7, 0x43, 0xbc, 0xdb, 0x5e, + 0xe8, 0x44, 0x6e, 0xb8, 0xe5, 0x32, 0xcd, 0x34, 0x5f, 0x37, 0xaf, 0x48, 0xb3, 0xf7, 0xbb, 0x49, + 0x84, 0xc3, 0x83, 0xf9, 0x73, 0x46, 0x41, 0xdc, 0x65, 0x7e, 0x90, 0xe0, 0x34, 0xd1, 0x74, 0xbe, + 0x84, 0x81, 0x47, 0x98, 0x2f, 0xc1, 0xfe, 0xa2, 0x05, 0x67, 0x73, 0x93, 0xb4, 0xa2, 0xcb, 0x30, + 0xe2, 0xb4, 0x5d, 0x2e, 0xdc, 0x17, 0xc7, 0x28, 0x13, 0x22, 0x55, 0x2b, 0x5c, 0xb4, 0xaf, 0xa0, + 0x2a, 0x79, 0x7c, 0x21, 0x37, 0x79, 0x7c, 0xcf, 0x5c, 0xf0, 0xf6, 0xf7, 0x58, 0x20, 0xdc, 0x54, + 0xfb, 0x38, 0xbb, 0x3f, 0x05, 0x63, 0x7b, 0xe9, 0x9c, 0x4a, 0x17, 0xf2, 0xfd, 0x76, 0x45, 0x26, + 0x25, 0xc5, 0x90, 0x19, 0xf9, 0x93, 0x0c, 0x5a, 0x76, 0x03, 0x04, 0xb4, 0x4c, 0x98, 0xe8, 0xba, + 0x77, 0x6f, 0x9e, 0x07, 0x68, 0x30, 0x5c, 0x2d, 0x03, 0xbf, 0xba, 0x99, 0xcb, 0x0a, 0x82, 0x35, + 0x2c, 0xfb, 0xdf, 0x16, 0x60, 0x54, 0xe6, 0xf0, 0xe9, 0x78, 0xfd, 0x08, 0x98, 0x8e, 0x94, 0xd4, + 0x13, 0x5d, 0x81, 0x12, 0x93, 0x80, 0x56, 0x63, 0xb9, 0x9c, 0x92, 0x3f, 0xac, 0x49, 0x00, 0x8e, + 0x71, 0xe8, 0x2e, 0x0a, 0x3b, 0x9b, 0x0c, 0x3d, 0xe1, 0x54, 0x59, 0xe3, 0xc5, 0x58, 0xc2, 0xd1, + 0x27, 0x60, 0x8a, 0xd7, 0x0b, 0xfc, 0xb6, 0xb3, 0xcd, 0xb5, 0x26, 0x83, 0x2a, 0xec, 0xc2, 0xd4, + 0x5a, 0x02, 0x76, 0x78, 0x30, 0x7f, 0x2a, 0x59, 0xc6, 0xd4, 0x81, 0x29, 0x2a, 0xcc, 0x38, 0x8a, + 0x37, 0x42, 0x77, 0x7f, 0xca, 0xa6, 0x2a, 0x06, 0x61, 0x1d, 0xcf, 0xfe, 0x2c, 0xa0, 0x74, 0x36, + 0x23, 0xf4, 0x3a, 0xb7, 0x88, 0x75, 0x03, 0xd2, 0xe8, 0xa6, 0x1e, 0xd4, 0x83, 0x0b, 0x48, 0x7f, + 0x28, 0x5e, 0x0b, 0xab, 0xfa, 0xf6, 0xff, 0x5f, 0x84, 0xa9, 0xa4, 0x07, 0x38, 0xba, 0x0e, 0x43, + 0x9c, 0xf5, 0x10, 0xe4, 0xbb, 0x58, 0x9f, 0x68, 0x7e, 0xe3, 0xec, 0x10, 0x16, 0xdc, 0x8b, 0xa8, + 0x8f, 0xde, 0x84, 0xd1, 0x86, 0x7f, 0xcf, 0xbb, 0xe7, 0x04, 0x8d, 0xc5, 0x6a, 0x45, 0x2c, 0xe7, + 0xcc, 0xe7, 0x70, 0x39, 0x46, 0xd3, 0x7d, 0xd1, 0x99, 0xa6, 0x35, 0x06, 0x61, 0x9d, 0x1c, 0xda, + 0x60, 0x21, 0xd0, 0xb7, 0xdc, 0xed, 0x35, 0xa7, 0xdd, 0xcd, 0x3d, 0x62, 0x59, 0x22, 0x69, 0x94, + 0xc7, 0x45, 0x9c, 0x74, 0x0e, 0xc0, 0x31, 0x21, 0xf4, 0x79, 0x98, 0x09, 0x73, 0x84, 0xf4, 0x79, + 0xc9, 0xed, 0xba, 0xc9, 0xad, 0x97, 0x1e, 0x7b, 0x70, 0x30, 0x3f, 0x93, 0x25, 0xce, 0xcf, 0x6a, + 0xc6, 0xfe, 0x91, 0x53, 0x60, 0x6c, 0x62, 0x23, 0xd7, 0xa9, 0x75, 0x4c, 0xb9, 0x4e, 0x31, 0x8c, + 0x90, 0x56, 0x3b, 0xda, 0x2f, 0xbb, 0x41, 0xb7, 0x0c, 0xe0, 0x2b, 0x02, 0x27, 0x4d, 0x53, 0x42, + 0xb0, 0xa2, 0x93, 0x9d, 0x90, 0xb6, 0xf8, 0x75, 0x4c, 0x48, 0x3b, 0x70, 0x82, 0x09, 0x69, 0xd7, + 0x61, 0x78, 0xdb, 0x8d, 0x30, 0x69, 0xfb, 0x82, 0xe9, 0xcf, 0x5c, 0x87, 0xd7, 0x38, 0x4a, 0x3a, + 0xf5, 0xa1, 0x00, 0x60, 0x49, 0x04, 0xbd, 0xae, 0x76, 0xe0, 0x50, 0xfe, 0xc3, 0x3c, 0x6d, 0x26, + 0x91, 0xb9, 0x07, 0x45, 0xda, 0xd9, 0xe1, 0x87, 0x4d, 0x3b, 0xbb, 0x2a, 0x93, 0xc5, 0x8e, 0xe4, + 0xfb, 0x32, 0xb1, 0x5c, 0xb0, 0x3d, 0x52, 0xc4, 0xde, 0xd1, 0x13, 0xec, 0x96, 0xf2, 0x4f, 0x02, + 0x95, 0x3b, 0xb7, 0xcf, 0xb4, 0xba, 0xdf, 0x63, 0xc1, 0xe9, 0x76, 0x56, 0xae, 0x69, 0x61, 0x51, + 0xf0, 0x52, 0xdf, 0xe9, 0xac, 0x8d, 0x06, 0x99, 0x24, 0x2e, 0x13, 0x0d, 0x67, 0x37, 0x47, 0x07, + 0x3a, 0xd8, 0x6c, 0x08, 0xcd, 0xf6, 0xc5, 0x9c, 0xfc, 0xbc, 0x5d, 0xb2, 0xf2, 0x6e, 0x64, 0xe4, + 0x82, 0x7d, 0x7f, 0x5e, 0x2e, 0xd8, 0xbe, 0x33, 0xc0, 0xbe, 0xae, 0x32, 0xf3, 0x8e, 0xe7, 0x2f, + 0x25, 0x9e, 0x77, 0xb7, 0x67, 0x3e, 0xde, 0xd7, 0x55, 0x3e, 0xde, 0x2e, 0xf1, 0x6d, 0x79, 0xb6, + 0xdd, 0x9e, 0x59, 0x78, 0xb5, 0x4c, 0xba, 0x93, 0xc7, 0x93, 0x49, 0xd7, 0xb8, 0x6a, 0x78, 0x32, + 0xd7, 0x67, 0x7a, 0x5c, 0x35, 0x06, 0xdd, 0xee, 0x97, 0x0d, 0xcf, 0x1a, 0x3c, 0xfd, 0x50, 0x59, + 0x83, 0xef, 0xe8, 0x59, 0x78, 0x51, 0x8f, 0x34, 0xb3, 0x14, 0xa9, 0xcf, 0xdc, 0xbb, 0x77, 0xf4, + 0x0b, 0x70, 0x26, 0x9f, 0xae, 0xba, 0xe7, 0xd2, 0x74, 0x33, 0xaf, 0xc0, 0x54, 0x4e, 0xdf, 0x53, + 0x27, 0x93, 0xd3, 0xf7, 0xf4, 0xb1, 0xe7, 0xf4, 0x3d, 0x73, 0x02, 0x39, 0x7d, 0x1f, 0x3b, 0xc1, + 0x9c, 0xbe, 0x77, 0x98, 0x19, 0x0e, 0x0f, 0xf6, 0x23, 0xe2, 0xf1, 0x66, 0xc7, 0x7e, 0xcd, 0x8a, + 0x08, 0xc4, 0x3f, 0x4e, 0x81, 0x70, 0x4c, 0x2a, 0x23, 0x57, 0xf0, 0xec, 0x23, 0xc8, 0x15, 0xbc, + 0x1e, 0xe7, 0x0a, 0x3e, 0x9b, 0x3f, 0xd5, 0x19, 0x8e, 0x1b, 0x39, 0x19, 0x82, 0xef, 0xe8, 0x99, + 0x7d, 0x1f, 0xef, 0xa2, 0x6b, 0xc9, 0x12, 0x3c, 0x76, 0xc9, 0xe7, 0xfb, 0x1a, 0xcf, 0xe7, 0xfb, + 0x44, 0xfe, 0x49, 0x9e, 0xbc, 0xee, 0x8c, 0x2c, 0xbe, 0xb4, 0x5f, 0x2a, 0xf2, 0x23, 0x8b, 0x3c, + 0x9c, 0xd3, 0x2f, 0x15, 0x3a, 0x32, 0xdd, 0x2f, 0x05, 0xc2, 0x31, 0x29, 0xfb, 0xfb, 0x0a, 0x70, + 0xbe, 0xfb, 0x7e, 0x8b, 0xa5, 0xa9, 0xd5, 0x58, 0xf5, 0x9c, 0x90, 0xa6, 0xf2, 0x37, 0x5b, 0x8c, + 0xd5, 0x77, 0x20, 0xbb, 0x6b, 0x30, 0xad, 0x3c, 0x3e, 0x9a, 0x6e, 0x7d, 0x7f, 0x3d, 0x7e, 0xf9, + 0x2a, 0x2f, 0xf9, 0x5a, 0x12, 0x01, 0xa7, 0xeb, 0xa0, 0x45, 0x98, 0x34, 0x0a, 0x2b, 0x65, 0xf1, + 0x36, 0x53, 0xe2, 0xdb, 0x9a, 0x09, 0xc6, 0x49, 0x7c, 0xfb, 0xcb, 0x16, 0x3c, 0x96, 0x93, 0x0c, + 0xaf, 0xef, 0x38, 0x6d, 0x5b, 0x30, 0xd9, 0x36, 0xab, 0xf6, 0x08, 0x2d, 0x69, 0xa4, 0xdc, 0x53, + 0x7d, 0x4d, 0x00, 0x70, 0x92, 0xa8, 0xfd, 0x67, 0x16, 0x9c, 0xeb, 0x6a, 0xc2, 0x88, 0x30, 0x9c, + 0xd9, 0x6e, 0x85, 0xce, 0x72, 0x40, 0x1a, 0xc4, 0x8b, 0x5c, 0xa7, 0x59, 0x6b, 0x93, 0xba, 0x26, + 0x0f, 0x67, 0xb6, 0x80, 0xd7, 0xd6, 0x6a, 0x8b, 0x69, 0x0c, 0x9c, 0x53, 0x13, 0xad, 0x02, 0x4a, + 0x43, 0xc4, 0x0c, 0xb3, 0x18, 0xd6, 0x69, 0x7a, 0x38, 0xa3, 0x06, 0xfa, 0x08, 0x8c, 0x2b, 0xd3, + 0x48, 0x6d, 0xc6, 0xd9, 0xc1, 0x8e, 0x75, 0x00, 0x36, 0xf1, 0x96, 0x2e, 0xff, 0xfa, 0xef, 0x9f, + 0x7f, 0xdf, 0x6f, 0xfe, 0xfe, 0xf9, 0xf7, 0xfd, 0xce, 0xef, 0x9f, 0x7f, 0xdf, 0x77, 0x3c, 0x38, + 0x6f, 0xfd, 0xfa, 0x83, 0xf3, 0xd6, 0x6f, 0x3e, 0x38, 0x6f, 0xfd, 0xce, 0x83, 0xf3, 0xd6, 0xef, + 0x3d, 0x38, 0x6f, 0x7d, 0xe9, 0x0f, 0xce, 0xbf, 0xef, 0x53, 0x85, 0xbd, 0xab, 0xff, 0x37, 0x00, + 0x00, 0xff, 0xff, 0x6d, 0xc2, 0x10, 0x4f, 0xcb, 0x03, 0x01, 0x00, } func (m *AWSElasticBlockStoreVolumeSource) Marshal() (dAtA []byte, err error) { @@ -9922,53 +9892,6 @@ func (m *EphemeralContainerCommon) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *EphemeralContainers) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EphemeralContainers) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EphemeralContainers) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.EphemeralContainers) > 0 { - for iNdEx := len(m.EphemeralContainers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EphemeralContainers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *EphemeralVolumeSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -9989,14 +9912,6 @@ func (m *EphemeralVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - i-- - if m.ReadOnly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 if m.VolumeClaimTemplate != nil { { size, err := m.VolumeClaimTemplate.MarshalToSizedBuffer(dAtA[:i]) @@ -15844,6 +15759,11 @@ func (m *Probe) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TerminationGracePeriodSeconds != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TerminationGracePeriodSeconds)) + i-- + dAtA[i] = 0x38 + } i = encodeVarintGenerated(dAtA, i, uint64(m.FailureThreshold)) i-- dAtA[i] = 0x30 @@ -20610,23 +20530,6 @@ func (m *EphemeralContainerCommon) Size() (n int) { return n } -func (m *EphemeralContainers) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.EphemeralContainers) > 0 { - for _, e := range m.EphemeralContainers { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - func (m *EphemeralVolumeSource) Size() (n int) { if m == nil { return 0 @@ -20637,7 +20540,6 @@ func (m *EphemeralVolumeSource) Size() (n int) { l = m.VolumeClaimTemplate.Size() n += 1 + l + sovGenerated(uint64(l)) } - n += 2 return n } @@ -22765,6 +22667,9 @@ func (m *Probe) Size() (n int) { n += 1 + sovGenerated(uint64(m.PeriodSeconds)) n += 1 + sovGenerated(uint64(m.SuccessThreshold)) n += 1 + sovGenerated(uint64(m.FailureThreshold)) + if m.TerminationGracePeriodSeconds != nil { + n += 1 + sovGenerated(uint64(*m.TerminationGracePeriodSeconds)) + } return n } @@ -24906,29 +24811,12 @@ func (this *EphemeralContainerCommon) String() string { }, "") return s } -func (this *EphemeralContainers) String() string { - if this == nil { - return "nil" - } - repeatedStringForEphemeralContainers := "[]EphemeralContainer{" - for _, f := range this.EphemeralContainers { - repeatedStringForEphemeralContainers += strings.Replace(strings.Replace(f.String(), "EphemeralContainer", "EphemeralContainer", 1), `&`, ``, 1) + "," - } - repeatedStringForEphemeralContainers += "}" - s := strings.Join([]string{`&EphemeralContainers{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `EphemeralContainers:` + repeatedStringForEphemeralContainers + `,`, - `}`, - }, "") - return s -} func (this *EphemeralVolumeSource) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&EphemeralVolumeSource{`, `VolumeClaimTemplate:` + strings.Replace(this.VolumeClaimTemplate.String(), "PersistentVolumeClaimTemplate", "PersistentVolumeClaimTemplate", 1) + `,`, - `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, `}`, }, "") return s @@ -26559,6 +26447,7 @@ func (this *Probe) String() string { `PeriodSeconds:` + fmt.Sprintf("%v", this.PeriodSeconds) + `,`, `SuccessThreshold:` + fmt.Sprintf("%v", this.SuccessThreshold) + `,`, `FailureThreshold:` + fmt.Sprintf("%v", this.FailureThreshold) + `,`, + `TerminationGracePeriodSeconds:` + valueToStringGenerated(this.TerminationGracePeriodSeconds) + `,`, `}`, }, "") return s @@ -36642,123 +36531,6 @@ func (m *EphemeralContainerCommon) Unmarshal(dAtA []byte) error { } return nil } -func (m *EphemeralContainers) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EphemeralContainers: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EphemeralContainers: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EphemeralContainers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EphemeralContainers = append(m.EphemeralContainers, EphemeralContainer{}) - if err := m.EphemeralContainers[len(m.EphemeralContainers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *EphemeralVolumeSource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -36824,26 +36596,6 @@ func (m *EphemeralVolumeSource) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ReadOnly = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -55503,6 +55255,26 @@ func (m *Probe) Unmarshal(dAtA []byte) error { break } } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TerminationGracePeriodSeconds", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TerminationGracePeriodSeconds = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.proto index 83cba97d6fc8..eb54bd424ee7 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.proto @@ -498,6 +498,7 @@ message ConfigMapEnvSource { } // Selects a key from a ConfigMap. +// +structType=atomic message ConfigMapKeySelector { // The ConfigMap to select from. optional LocalObjectReference localObjectReference = 1; @@ -1010,6 +1011,7 @@ message EmptyDirVolumeSource { } // EndpointAddress is a tuple that describes single IP address. +// +structType=atomic message EndpointAddress { // The IP of this endpoint. // May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), @@ -1033,6 +1035,7 @@ message EndpointAddress { } // EndpointPort is a tuple that describes a single port. +// +structType=atomic message EndpointPort { // The name of this port. This must match the 'name' field in the // corresponding ServicePort. @@ -1359,19 +1362,6 @@ message EphemeralContainerCommon { optional bool tty = 18; } -// A list of ephemeral containers used with the Pod ephemeralcontainers subresource. -message EphemeralContainers { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // A list of ephemeral containers associated with this pod. New ephemeral containers - // may be appended to this list, but existing ephemeral containers may not be removed - // or modified. - // +patchMergeKey=name - // +patchStrategy=merge - repeated EphemeralContainer ephemeralContainers = 2; -} - // Represents an ephemeral volume that is handled by a normal storage driver. message EphemeralVolumeSource { // Will be used to create a stand-alone PVC to provision the volume. @@ -1396,11 +1386,6 @@ message EphemeralVolumeSource { // // Required, must not be nil. optional PersistentVolumeClaimTemplate volumeClaimTemplate = 1; - - // Specifies a read-only configuration for the volume. - // Defaults to false (read/write). - // +optional - optional bool readOnly = 2; } // Event is a report of an event somewhere in the cluster. Events @@ -2054,6 +2039,7 @@ message LoadBalancerStatus { // LocalObjectReference contains enough information to let you locate the // referenced object inside the same namespace. +// +structType=atomic message LocalObjectReference { // Name of the referent. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names @@ -2335,6 +2321,7 @@ message NodeResources { // A node selector represents the union of the results of one or more label queries // over a set of nodes; that is, it represents the OR of the selectors represented // by the node selector terms. +// +structType=atomic message NodeSelector { // Required. A list of node selector terms. The terms are ORed. repeated NodeSelectorTerm nodeSelectorTerms = 1; @@ -2362,6 +2349,7 @@ message NodeSelectorRequirement { // A null or empty node selector term matches no objects. The requirements of // them are ANDed. // The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. +// +structType=atomic message NodeSelectorTerm { // A list of node selector requirements by node's labels. // +optional @@ -2509,6 +2497,7 @@ message NodeSystemInfo { } // ObjectFieldSelector selects an APIVersioned field of an object. +// +structType=atomic message ObjectFieldSelector { // Version of the schema the FieldPath is written in terms of, defaults to "v1". // +optional @@ -2534,6 +2523,7 @@ message ObjectFieldSelector { // Instead of using this type, create a locally provided and used type that is well-focused on your reference. // For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 . // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +structType=atomic message ObjectReference { // Kind of the referent. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds @@ -3426,7 +3416,8 @@ message PodSpec { optional string restartPolicy = 3; // Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. - // Value must be non-negative integer. The value zero indicates delete immediately. + // Value must be non-negative integer. The value zero indicates stop immediately via + // the kill signal (no opportunity to shut down). // If this value is nil, the default grace period will be used instead. // The grace period is the duration in seconds after the processes running in the pod are sent // a termination signal and the time when the processes are forcibly halted with a kill signal. @@ -3454,6 +3445,7 @@ message PodSpec { // Selector which must match a node's labels for the pod to be scheduled on that node. // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ // +optional + // +mapType=atomic map nodeSelector = 7; // ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -3607,8 +3599,8 @@ message PodSpec { // The RuntimeClass admission controller will reject Pod create requests which have the overhead already // set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value // defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. - // More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature. + // More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md + // This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature. // +optional map overhead = 32; @@ -3888,6 +3880,18 @@ message Probe { // Defaults to 3. Minimum value is 1. // +optional optional int32 failureThreshold = 6; + + // Optional duration in seconds the pod needs to terminate gracefully upon probe failure. + // The grace period is the duration in seconds after the processes running in the pod are sent + // a termination signal and the time when the processes are forcibly halted with a kill signal. + // Set this value longer than the expected cleanup time for your process. + // If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this + // value overrides the value provided by the pod spec. + // Value must be non-negative integer. The value zero indicates stop immediately via + // the kill signal (no opportunity to shut down). + // This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. + // +optional + optional int64 terminationGracePeriodSeconds = 7; } // Represents a projected volume source @@ -4130,6 +4134,7 @@ message ReplicationControllerSpec { // controller, if empty defaulted to labels on Pod template. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors // +optional + // +mapType=atomic map selector = 2; // Template is the object that describes the pod that will be created if @@ -4170,6 +4175,7 @@ message ReplicationControllerStatus { } // ResourceFieldSelector represents container resources (cpu, memory) and their output format +// +structType=atomic message ResourceFieldSelector { // Container name: required for volumes, optional for env vars // +optional @@ -4372,6 +4378,7 @@ message ScaleIOVolumeSource { // A scope selector represents the AND of the selectors represented // by the scoped-resource selector requirements. +// +structType=atomic message ScopeSelector { // A list of scope selector requirements by scope of the resources. // +optional @@ -4467,6 +4474,7 @@ message SecretEnvSource { } // SecretKeySelector selects a key of a Secret. +// +structType=atomic message SecretKeySelector { // The name of the secret in the pod's namespace to select from. optional LocalObjectReference localObjectReference = 1; @@ -4517,6 +4525,7 @@ message SecretProjection { // SecretReference represents a Secret Reference. It has enough information to retrieve secret // in any namespace +// +structType=atomic message SecretReference { // Name is unique within a namespace to reference a secret resource. // +optional @@ -4833,6 +4842,7 @@ message ServiceSpec { // Ignored if type is ExternalName. // More info: https://kubernetes.io/docs/concepts/services-networking/service/ // +optional + // +mapType=atomic map selector = 2; // clusterIP is the IP address of the service and is usually assigned @@ -5238,6 +5248,7 @@ message TopologySelectorLabelRequirement { // The requirements of them are ANDed. // It provides a subset of functionality as NodeSelectorTerm. // This is an alpha feature and may change in the future. +// +structType=atomic message TopologySelectorTerm { // A list of topology selector requirements by labels. // +optional @@ -5304,6 +5315,7 @@ message TopologySpreadConstraint { // TypedLocalObjectReference contains enough information to let you locate the // typed referenced object inside the same namespace. +// +structType=atomic message TypedLocalObjectReference { // APIGroup is the group for the resource being referenced. // If APIGroup is not specified, the specified Kind must be in the core API group. @@ -5537,7 +5549,7 @@ message VolumeSource { // +optional optional CSIVolumeSource csi = 28; - // Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). + // Ephemeral represents a volume that is handled by a cluster storage driver. // The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, // and deleted when the pod is removed. // @@ -5562,6 +5574,9 @@ message VolumeSource { // A pod can use both types of ephemeral volumes and // persistent volumes at the same time. // + // This is a beta feature and only available when the GenericEphemeralVolume + // feature gate is enabled. + // // +optional optional EphemeralVolumeSource ephemeral = 29; } diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/register.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/register.go index 8da1ddeade1f..1aac0cb41e0d 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/register.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/register.go @@ -88,7 +88,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &RangeAllocation{}, &ConfigMap{}, &ConfigMapList{}, - &EphemeralContainers{}, ) // Add common types diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/types.go index e759f00b8cdb..3cbdd3c20cdf 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/types.go @@ -156,7 +156,7 @@ type VolumeSource struct { // CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). // +optional CSI *CSIVolumeSource `json:"csi,omitempty" protobuf:"bytes,28,opt,name=csi"` - // Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). + // Ephemeral represents a volume that is handled by a cluster storage driver. // The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, // and deleted when the pod is removed. // @@ -181,6 +181,9 @@ type VolumeSource struct { // A pod can use both types of ephemeral volumes and // persistent volumes at the same time. // + // This is a beta feature and only available when the GenericEphemeralVolume + // feature gate is enabled. + // // +optional Ephemeral *EphemeralVolumeSource `json:"ephemeral,omitempty" protobuf:"bytes,29,opt,name=ephemeral"` } @@ -858,6 +861,7 @@ type CephFSVolumeSource struct { // SecretReference represents a Secret Reference. It has enough information to retrieve secret // in any namespace +// +structType=atomic type SecretReference struct { // Name is unique within a namespace to reference a secret resource. // +optional @@ -1795,10 +1799,8 @@ type EphemeralVolumeSource struct { // Required, must not be nil. VolumeClaimTemplate *PersistentVolumeClaimTemplate `json:"volumeClaimTemplate,omitempty" protobuf:"bytes,1,opt,name=volumeClaimTemplate"` - // Specifies a read-only configuration for the volume. - // Defaults to false (read/write). - // +optional - ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` + // ReadOnly is tombstoned to show why 2 is a reserved protobuf tag. + // ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` } // PersistentVolumeClaimTemplate is used to produce @@ -1947,6 +1949,7 @@ type EnvVarSource struct { } // ObjectFieldSelector selects an APIVersioned field of an object. +// +structType=atomic type ObjectFieldSelector struct { // Version of the schema the FieldPath is written in terms of, defaults to "v1". // +optional @@ -1956,6 +1959,7 @@ type ObjectFieldSelector struct { } // ResourceFieldSelector represents container resources (cpu, memory) and their output format +// +structType=atomic type ResourceFieldSelector struct { // Container name: required for volumes, optional for env vars // +optional @@ -1968,6 +1972,7 @@ type ResourceFieldSelector struct { } // Selects a key from a ConfigMap. +// +structType=atomic type ConfigMapKeySelector struct { // The ConfigMap to select from. LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` @@ -1979,6 +1984,7 @@ type ConfigMapKeySelector struct { } // SecretKeySelector selects a key of a Secret. +// +structType=atomic type SecretKeySelector struct { // The name of the secret in the pod's namespace to select from. LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` @@ -2116,6 +2122,17 @@ type Probe struct { // Defaults to 3. Minimum value is 1. // +optional FailureThreshold int32 `json:"failureThreshold,omitempty" protobuf:"varint,6,opt,name=failureThreshold"` + // Optional duration in seconds the pod needs to terminate gracefully upon probe failure. + // The grace period is the duration in seconds after the processes running in the pod are sent + // a termination signal and the time when the processes are forcibly halted with a kill signal. + // Set this value longer than the expected cleanup time for your process. + // If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this + // value overrides the value provided by the pod spec. + // Value must be non-negative integer. The value zero indicates stop immediately via + // the kill signal (no opportunity to shut down). + // This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. + // +optional + TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty" protobuf:"varint,7,opt,name=terminationGracePeriodSeconds"` } // PullPolicy describes a policy for if/when to pull a container image @@ -2510,6 +2527,7 @@ const ( PodFailed PodPhase = "Failed" // PodUnknown means that for some reason the state of the pod could not be obtained, typically due // to an error in communicating with the host of the pod. + // Deprecated: It isn't being set since 2015 (74da3b14b0c0f658b3bb8d2def5094686d0e9095) PodUnknown PodPhase = "Unknown" ) @@ -2604,6 +2622,7 @@ const ( // A node selector represents the union of the results of one or more label queries // over a set of nodes; that is, it represents the OR of the selectors represented // by the node selector terms. +// +structType=atomic type NodeSelector struct { //Required. A list of node selector terms. The terms are ORed. NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms" protobuf:"bytes,1,rep,name=nodeSelectorTerms"` @@ -2612,6 +2631,7 @@ type NodeSelector struct { // A null or empty node selector term matches no objects. The requirements of // them are ANDed. // The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. +// +structType=atomic type NodeSelectorTerm struct { // A list of node selector requirements by node's labels. // +optional @@ -2656,7 +2676,10 @@ const ( // The requirements of them are ANDed. // It provides a subset of functionality as NodeSelectorTerm. // This is an alpha feature and may change in the future. +// +structType=atomic type TopologySelectorTerm struct { + // Usage: Fields of type []TopologySelectorTerm must be listType=atomic. + // A list of topology selector requirements by labels. // +optional MatchLabelExpressions []TopologySelectorLabelRequirement `json:"matchLabelExpressions,omitempty" protobuf:"bytes,1,rep,name=matchLabelExpressions"` @@ -2967,7 +2990,8 @@ type PodSpec struct { // +optional RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" protobuf:"bytes,3,opt,name=restartPolicy,casttype=RestartPolicy"` // Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. - // Value must be non-negative integer. The value zero indicates delete immediately. + // Value must be non-negative integer. The value zero indicates stop immediately via + // the kill signal (no opportunity to shut down). // If this value is nil, the default grace period will be used instead. // The grace period is the duration in seconds after the processes running in the pod are sent // a termination signal and the time when the processes are forcibly halted with a kill signal. @@ -2992,6 +3016,7 @@ type PodSpec struct { // Selector which must match a node's labels for the pod to be scheduled on that node. // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ // +optional + // +mapType=atomic NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"` // ServiceAccountName is the name of the ServiceAccount to use to run this pod. @@ -3123,8 +3148,8 @@ type PodSpec struct { // The RuntimeClass admission controller will reject Pod create requests which have the overhead already // set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value // defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. - // More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature. + // More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md + // This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature. // +optional Overhead ResourceList `json:"overhead,omitempty" protobuf:"bytes,32,opt,name=overhead"` // TopologySpreadConstraints describes how a group of pods ought to spread across topology @@ -3665,8 +3690,7 @@ type PodStatusResult struct { } // +genclient -// +genclient:method=GetEphemeralContainers,verb=get,subresource=ephemeralcontainers,result=EphemeralContainers -// +genclient:method=UpdateEphemeralContainers,verb=update,subresource=ephemeralcontainers,input=EphemeralContainers,result=EphemeralContainers +// +genclient:method=UpdateEphemeralContainers,verb=update,subresource=ephemeralcontainers // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Pod is a collection of containers that can run on a host. This resource is created @@ -3772,6 +3796,7 @@ type ReplicationControllerSpec struct { // controller, if empty defaulted to labels on Pod template. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors // +optional + // +mapType=atomic Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` // TemplateRef is a reference to an object that describes the pod that will be created if @@ -4070,6 +4095,7 @@ type ServiceSpec struct { // Ignored if type is ExternalName. // More info: https://kubernetes.io/docs/concepts/services-networking/service/ // +optional + // +mapType=atomic Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` // clusterIP is the IP address of the service and is usually assigned @@ -4510,6 +4536,7 @@ type EndpointSubset struct { } // EndpointAddress is a tuple that describes single IP address. +// +structType=atomic type EndpointAddress struct { // The IP of this endpoint. // May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), @@ -4530,6 +4557,7 @@ type EndpointAddress struct { } // EndpointPort is a tuple that describes a single port. +// +structType=atomic type EndpointPort struct { // The name of this port. This must match the 'name' field in the // corresponding ServicePort. @@ -5122,22 +5150,6 @@ type Binding struct { Target ObjectReference `json:"target" protobuf:"bytes,2,opt,name=target"` } -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// A list of ephemeral containers used with the Pod ephemeralcontainers subresource. -type EphemeralContainers struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // A list of ephemeral containers associated with this pod. New ephemeral containers - // may be appended to this list, but existing ephemeral containers may not be removed - // or modified. - // +patchMergeKey=name - // +patchStrategy=merge - EphemeralContainers []EphemeralContainer `json:"ephemeralContainers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=ephemeralContainers"` -} - // Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. // +k8s:openapi-gen=false type Preconditions struct { @@ -5349,6 +5361,7 @@ type ServiceProxyOptions struct { // Instead of using this type, create a locally provided and used type that is well-focused on your reference. // For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 . // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +structType=atomic type ObjectReference struct { // Kind of the referent. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds @@ -5388,6 +5401,7 @@ type ObjectReference struct { // LocalObjectReference contains enough information to let you locate the // referenced object inside the same namespace. +// +structType=atomic type LocalObjectReference struct { // Name of the referent. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names @@ -5398,6 +5412,7 @@ type LocalObjectReference struct { // TypedLocalObjectReference contains enough information to let you locate the // typed referenced object inside the same namespace. +// +structType=atomic type TypedLocalObjectReference struct { // APIGroup is the group for the resource being referenced. // If APIGroup is not specified, the specified Kind must be in the core API group. @@ -5696,6 +5711,7 @@ type ResourceQuotaSpec struct { // A scope selector represents the AND of the selectors represented // by the scoped-resource selector requirements. +// +structType=atomic type ScopeSelector struct { // A list of scope selector requirements by scope of the resources. // +optional @@ -5893,7 +5909,7 @@ const ( // TODO: Consider supporting different formats, specifying CA/destinationCA. SecretTypeTLS SecretType = "kubernetes.io/tls" - // TLSCertKey is the key for tls certificates in a TLS secert. + // TLSCertKey is the key for tls certificates in a TLS secret. TLSCertKey = "tls.crt" // TLSPrivateKeyKey is the key for the private key field in a TLS secret. TLSPrivateKeyKey = "tls.key" diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go index ced047763891..51d17c6deb13 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -617,19 +617,9 @@ func (EphemeralContainerCommon) SwaggerDoc() map[string]string { return map_EphemeralContainerCommon } -var map_EphemeralContainers = map[string]string{ - "": "A list of ephemeral containers used with the Pod ephemeralcontainers subresource.", - "ephemeralContainers": "A list of ephemeral containers associated with this pod. New ephemeral containers may be appended to this list, but existing ephemeral containers may not be removed or modified.", -} - -func (EphemeralContainers) SwaggerDoc() map[string]string { - return map_EphemeralContainers -} - var map_EphemeralVolumeSource = map[string]string{ "": "Represents an ephemeral volume that is handled by a normal storage driver.", "volumeClaimTemplate": "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.", - "readOnly": "Specifies a read-only configuration for the volume. Defaults to false (read/write).", } func (EphemeralVolumeSource) SwaggerDoc() map[string]string { @@ -1628,7 +1618,7 @@ var map_PodSpec = map[string]string{ "containers": "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.", "ephemeralContainers": "List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature.", "restartPolicy": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", - "terminationGracePeriodSeconds": "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.", + "terminationGracePeriodSeconds": "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.", "activeDeadlineSeconds": "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", "dnsPolicy": "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.", "nodeSelector": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", @@ -1655,7 +1645,7 @@ var map_PodSpec = map[string]string{ "runtimeClassName": "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md This is a beta feature as of Kubernetes v1.14.", "enableServiceLinks": "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.", "preemptionPolicy": "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is beta-level, gated by the NonPreemptingPriority feature-gate.", - "overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature.", + "overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.", "topologySpreadConstraints": "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.", "setHostnameAsFQDN": "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", } @@ -1778,12 +1768,13 @@ func (PreferredSchedulingTerm) SwaggerDoc() map[string]string { } var map_Probe = map[string]string{ - "": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", - "initialDelaySeconds": "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - "timeoutSeconds": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - "periodSeconds": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.", - "successThreshold": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", - "failureThreshold": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.", + "": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", + "initialDelaySeconds": "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "timeoutSeconds": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "periodSeconds": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.", + "successThreshold": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", + "failureThreshold": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.", + "terminationGracePeriodSeconds": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate.", } func (Probe) SwaggerDoc() map[string]string { @@ -2481,7 +2472,7 @@ var map_VolumeSource = map[string]string{ "scaleIO": "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", "storageos": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.", "csi": "CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).", - "ephemeral": "Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.", + "ephemeral": "Ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.\n\nThis is a beta feature and only available when the GenericEphemeralVolume feature gate is enabled.", } func (VolumeSource) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go index 6cb291b71be9..aff3c6894e82 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go @@ -1400,39 +1400,6 @@ func (in *EphemeralContainerCommon) DeepCopy() *EphemeralContainerCommon { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EphemeralContainers) DeepCopyInto(out *EphemeralContainers) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.EphemeralContainers != nil { - in, out := &in.EphemeralContainers, &out.EphemeralContainers - *out = make([]EphemeralContainer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EphemeralContainers. -func (in *EphemeralContainers) DeepCopy() *EphemeralContainers { - if in == nil { - return nil - } - out := new(EphemeralContainers) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *EphemeralContainers) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EphemeralVolumeSource) DeepCopyInto(out *EphemeralVolumeSource) { *out = *in @@ -4190,6 +4157,11 @@ func (in *PreferredSchedulingTerm) DeepCopy() *PreferredSchedulingTerm { func (in *Probe) DeepCopyInto(out *Probe) { *out = *in in.Handler.DeepCopyInto(&out.Handler) + if in.TerminationGracePeriodSeconds != nil { + in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds + *out = new(int64) + **out = **in + } return } diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/generated.pb.go index 34d0b385b7de..38bdb02a52bb 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/generated.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/generated.pb.go @@ -102,10 +102,38 @@ func (m *EndpointConditions) XXX_DiscardUnknown() { var xxx_messageInfo_EndpointConditions proto.InternalMessageInfo +func (m *EndpointHints) Reset() { *m = EndpointHints{} } +func (*EndpointHints) ProtoMessage() {} +func (*EndpointHints) Descriptor() ([]byte, []int) { + return fileDescriptor_3a5d310fb1396ddf, []int{2} +} +func (m *EndpointHints) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointHints) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointHints.Merge(m, src) +} +func (m *EndpointHints) XXX_Size() int { + return m.Size() +} +func (m *EndpointHints) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointHints.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointHints proto.InternalMessageInfo + func (m *EndpointPort) Reset() { *m = EndpointPort{} } func (*EndpointPort) ProtoMessage() {} func (*EndpointPort) Descriptor() ([]byte, []int) { - return fileDescriptor_3a5d310fb1396ddf, []int{2} + return fileDescriptor_3a5d310fb1396ddf, []int{3} } func (m *EndpointPort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -133,7 +161,7 @@ var xxx_messageInfo_EndpointPort proto.InternalMessageInfo func (m *EndpointSlice) Reset() { *m = EndpointSlice{} } func (*EndpointSlice) ProtoMessage() {} func (*EndpointSlice) Descriptor() ([]byte, []int) { - return fileDescriptor_3a5d310fb1396ddf, []int{3} + return fileDescriptor_3a5d310fb1396ddf, []int{4} } func (m *EndpointSlice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -161,7 +189,7 @@ var xxx_messageInfo_EndpointSlice proto.InternalMessageInfo func (m *EndpointSliceList) Reset() { *m = EndpointSliceList{} } func (*EndpointSliceList) ProtoMessage() {} func (*EndpointSliceList) Descriptor() ([]byte, []int) { - return fileDescriptor_3a5d310fb1396ddf, []int{4} + return fileDescriptor_3a5d310fb1396ddf, []int{5} } func (m *EndpointSliceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -186,13 +214,43 @@ func (m *EndpointSliceList) XXX_DiscardUnknown() { var xxx_messageInfo_EndpointSliceList proto.InternalMessageInfo +func (m *ForZone) Reset() { *m = ForZone{} } +func (*ForZone) ProtoMessage() {} +func (*ForZone) Descriptor() ([]byte, []int) { + return fileDescriptor_3a5d310fb1396ddf, []int{6} +} +func (m *ForZone) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ForZone) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ForZone) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForZone.Merge(m, src) +} +func (m *ForZone) XXX_Size() int { + return m.Size() +} +func (m *ForZone) XXX_DiscardUnknown() { + xxx_messageInfo_ForZone.DiscardUnknown(m) +} + +var xxx_messageInfo_ForZone proto.InternalMessageInfo + func init() { proto.RegisterType((*Endpoint)(nil), "k8s.io.api.discovery.v1.Endpoint") proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.discovery.v1.Endpoint.DeprecatedTopologyEntry") proto.RegisterType((*EndpointConditions)(nil), "k8s.io.api.discovery.v1.EndpointConditions") + proto.RegisterType((*EndpointHints)(nil), "k8s.io.api.discovery.v1.EndpointHints") proto.RegisterType((*EndpointPort)(nil), "k8s.io.api.discovery.v1.EndpointPort") proto.RegisterType((*EndpointSlice)(nil), "k8s.io.api.discovery.v1.EndpointSlice") proto.RegisterType((*EndpointSliceList)(nil), "k8s.io.api.discovery.v1.EndpointSliceList") + proto.RegisterType((*ForZone)(nil), "k8s.io.api.discovery.v1.ForZone") } func init() { @@ -200,59 +258,63 @@ func init() { } var fileDescriptor_3a5d310fb1396ddf = []byte{ - // 823 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x9b, 0x86, 0xda, 0x93, 0xad, 0xd8, 0x1d, 0x21, 0x6d, 0x14, 0x90, 0x5d, 0x82, 0x16, - 0x45, 0xaa, 0xb0, 0x69, 0x85, 0xd0, 0xc2, 0x89, 0x9a, 0xad, 0xf8, 0xbd, 0x54, 0xb3, 0x3d, 0xad, - 0x90, 0x60, 0x6a, 0xbf, 0x75, 0x4d, 0xe2, 0x19, 0x6b, 0x66, 0x12, 0x29, 0x9c, 0xb8, 0x70, 0x86, - 0xff, 0x83, 0xff, 0x81, 0x23, 0xea, 0x71, 0x6f, 0xec, 0xc9, 0xa2, 0xe6, 0xbf, 0xd8, 0x13, 0x9a, - 0xb1, 0x1d, 0x7b, 0x49, 0xab, 0x70, 0xf3, 0x7c, 0xef, 0x7d, 0xdf, 0x7b, 0xef, 0x9b, 0x79, 0x46, - 0x9f, 0xcc, 0x1e, 0x4a, 0x3f, 0xe5, 0xc1, 0x6c, 0x71, 0x01, 0x82, 0x81, 0x02, 0x19, 0x2c, 0x81, - 0xc5, 0x5c, 0x04, 0x75, 0x80, 0xe6, 0x69, 0x10, 0xa7, 0x32, 0xe2, 0x4b, 0x10, 0xab, 0x60, 0x79, - 0x14, 0x24, 0xc0, 0x40, 0x50, 0x05, 0xb1, 0x9f, 0x0b, 0xae, 0x38, 0xbe, 0x5f, 0x25, 0xfa, 0x34, - 0x4f, 0xfd, 0x75, 0xa2, 0xbf, 0x3c, 0x1a, 0xbf, 0x97, 0xa4, 0xea, 0x72, 0x71, 0xe1, 0x47, 0x3c, - 0x0b, 0x12, 0x9e, 0xf0, 0xc0, 0xe4, 0x5f, 0x2c, 0x9e, 0x99, 0x93, 0x39, 0x98, 0xaf, 0x4a, 0x67, - 0x3c, 0xe9, 0x14, 0x8c, 0xb8, 0x80, 0x1b, 0x6a, 0x8d, 0x3f, 0x68, 0x73, 0x32, 0x1a, 0x5d, 0xa6, - 0x4c, 0xf7, 0x94, 0xcf, 0x12, 0x0d, 0xc8, 0x20, 0x03, 0x45, 0x6f, 0x62, 0x05, 0xb7, 0xb1, 0xc4, - 0x82, 0xa9, 0x34, 0x83, 0x0d, 0xc2, 0x87, 0xdb, 0x08, 0x32, 0xba, 0x84, 0x8c, 0xfe, 0x97, 0x37, - 0xf9, 0x7d, 0x17, 0xd9, 0xa7, 0x2c, 0xce, 0x79, 0xca, 0x14, 0x3e, 0x44, 0x0e, 0x8d, 0x63, 0x01, - 0x52, 0x82, 0x1c, 0x59, 0x07, 0xfd, 0xa9, 0x13, 0xee, 0x97, 0x85, 0xe7, 0x9c, 0x34, 0x20, 0x69, - 0xe3, 0xf8, 0x7b, 0x84, 0x22, 0xce, 0xe2, 0x54, 0xa5, 0x9c, 0xc9, 0xd1, 0xce, 0x81, 0x35, 0x1d, - 0x1e, 0x1f, 0xfa, 0xb7, 0x38, 0xeb, 0x37, 0x35, 0x3e, 0x5d, 0x53, 0x42, 0x7c, 0x55, 0x78, 0xbd, - 0xb2, 0xf0, 0x50, 0x8b, 0x91, 0x8e, 0x24, 0x9e, 0x22, 0xfb, 0x92, 0x4b, 0xc5, 0x68, 0x06, 0xa3, - 0xfe, 0x81, 0x35, 0x75, 0xc2, 0x3b, 0x65, 0xe1, 0xd9, 0x9f, 0xd7, 0x18, 0x59, 0x47, 0xf1, 0x19, - 0x72, 0x14, 0x15, 0x09, 0x28, 0x02, 0xcf, 0x46, 0xbb, 0xa6, 0x93, 0x77, 0xba, 0x9d, 0xe8, 0xbb, - 0xd1, 0x4d, 0x7c, 0x7b, 0xf1, 0x23, 0x44, 0x3a, 0x09, 0x04, 0xb0, 0x08, 0xaa, 0xe1, 0xce, 0x1b, - 0x26, 0x69, 0x45, 0xf0, 0x2f, 0x16, 0xc2, 0x31, 0xe4, 0x02, 0x22, 0xed, 0xd5, 0x39, 0xcf, 0xf9, - 0x9c, 0x27, 0xab, 0xd1, 0xe0, 0xa0, 0x3f, 0x1d, 0x1e, 0x7f, 0xb4, 0x75, 0x4a, 0xff, 0xd1, 0x06, - 0xf7, 0x94, 0x29, 0xb1, 0x0a, 0xc7, 0xf5, 0xcc, 0x78, 0x33, 0x81, 0xdc, 0x50, 0x50, 0x7b, 0xc0, - 0x78, 0x0c, 0x8f, 0xb5, 0x07, 0xaf, 0xb5, 0x1e, 0x3c, 0xae, 0x31, 0xb2, 0x8e, 0xe2, 0xb7, 0xd0, - 0xee, 0x4f, 0x9c, 0xc1, 0x68, 0xcf, 0x64, 0xd9, 0x65, 0xe1, 0xed, 0x3e, 0xe5, 0x0c, 0x88, 0x41, - 0xc7, 0xa7, 0xe8, 0xfe, 0x2d, 0x2d, 0xe1, 0xbb, 0xa8, 0x3f, 0x83, 0xd5, 0xc8, 0xd2, 0x3c, 0xa2, - 0x3f, 0xf1, 0x1b, 0x68, 0xb0, 0xa4, 0xf3, 0x05, 0x98, 0x4b, 0x75, 0x48, 0x75, 0xf8, 0x78, 0xe7, - 0xa1, 0x35, 0xf9, 0xd5, 0x42, 0x78, 0xf3, 0x26, 0xb1, 0x87, 0x06, 0x02, 0x68, 0x5c, 0x89, 0xd8, - 0xa1, 0x53, 0x16, 0xde, 0x80, 0x68, 0x80, 0x54, 0x38, 0x7e, 0x80, 0xf6, 0x24, 0x88, 0x65, 0xca, - 0x12, 0xa3, 0x69, 0x87, 0xc3, 0xb2, 0xf0, 0xf6, 0x9e, 0x54, 0x10, 0x69, 0x62, 0xf8, 0x08, 0x0d, - 0x15, 0x88, 0x2c, 0x65, 0x54, 0xe9, 0xd4, 0xbe, 0x49, 0x7d, 0xbd, 0x2c, 0xbc, 0xe1, 0x79, 0x0b, - 0x93, 0x6e, 0xce, 0xe4, 0x4f, 0x0b, 0xdd, 0x69, 0x3a, 0x3a, 0xe3, 0x42, 0x69, 0x1f, 0xcc, 0x8b, - 0xb1, 0x5a, 0x1f, 0x8c, 0x53, 0x06, 0xc5, 0x9f, 0x21, 0xdb, 0xbc, 0xfb, 0x88, 0xcf, 0xab, 0xe9, - 0xc2, 0x43, 0xed, 0xe7, 0x59, 0x8d, 0xbd, 0x2c, 0xbc, 0x37, 0x37, 0x77, 0xda, 0x6f, 0xc2, 0x64, - 0x4d, 0xd6, 0x65, 0x72, 0x2e, 0x94, 0xe9, 0x71, 0x50, 0x95, 0xd1, 0xe5, 0x89, 0x41, 0xf5, 0x20, - 0x34, 0xcf, 0x1b, 0x9a, 0x79, 0x92, 0x4e, 0x35, 0xc8, 0x49, 0x0b, 0x93, 0x6e, 0xce, 0xe4, 0xaf, - 0x1d, 0xb4, 0xdf, 0x0c, 0xf2, 0x64, 0x9e, 0x46, 0x80, 0x7f, 0x40, 0xb6, 0xfe, 0x3d, 0xc4, 0x54, - 0x51, 0x33, 0xcd, 0xf0, 0xf8, 0xfd, 0xce, 0xc3, 0x5b, 0x6f, 0xb9, 0x9f, 0xcf, 0x12, 0x0d, 0x48, - 0x5f, 0x67, 0xb7, 0xcf, 0xfc, 0x1b, 0x50, 0xb4, 0xdd, 0xb1, 0x16, 0x23, 0x6b, 0x55, 0xfc, 0x08, - 0x0d, 0xeb, 0x7d, 0x3e, 0x5f, 0xe5, 0x50, 0xb7, 0x39, 0xa9, 0x29, 0xc3, 0x93, 0x36, 0xf4, 0xf2, - 0xd5, 0x23, 0xe9, 0xd2, 0x30, 0x41, 0x0e, 0xd4, 0x8d, 0xeb, 0xff, 0x80, 0xde, 0x90, 0xb7, 0xb7, - 0x6e, 0x48, 0x78, 0xaf, 0x2e, 0xe3, 0x34, 0x88, 0x24, 0xad, 0x0c, 0xfe, 0x12, 0x0d, 0xb4, 0x91, - 0x72, 0xd4, 0x37, 0x7a, 0x0f, 0xb6, 0xea, 0x69, 0xf3, 0xc3, 0xfd, 0x5a, 0x73, 0xa0, 0x4f, 0x92, - 0x54, 0x12, 0x93, 0x3f, 0x2c, 0x74, 0xef, 0x15, 0x67, 0xbf, 0x4e, 0xa5, 0xc2, 0xdf, 0x6d, 0xb8, - 0xeb, 0xff, 0x3f, 0x77, 0x35, 0xdb, 0x78, 0x7b, 0xb7, 0xae, 0x66, 0x37, 0x48, 0xc7, 0xd9, 0xaf, - 0xd0, 0x20, 0x55, 0x90, 0x35, 0x7e, 0xbc, 0xbb, 0xb5, 0x7f, 0xd3, 0x58, 0x3b, 0xc0, 0x17, 0x9a, - 0x4c, 0x2a, 0x8d, 0x70, 0x7a, 0x75, 0xed, 0xf6, 0x9e, 0x5f, 0xbb, 0xbd, 0x17, 0xd7, 0x6e, 0xef, - 0xe7, 0xd2, 0xb5, 0xae, 0x4a, 0xd7, 0x7a, 0x5e, 0xba, 0xd6, 0x8b, 0xd2, 0xb5, 0xfe, 0x2e, 0x5d, - 0xeb, 0xb7, 0x7f, 0xdc, 0xde, 0xd3, 0x9d, 0xe5, 0xd1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x34, - 0x9c, 0x0c, 0xa4, 0x1b, 0x07, 0x00, 0x00, + // 889 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x6f, 0xe3, 0x44, + 0x18, 0x8e, 0x9b, 0x86, 0xda, 0x93, 0x56, 0xec, 0x8e, 0x90, 0x36, 0x0a, 0x28, 0x0e, 0x46, 0x8b, + 0x22, 0x55, 0xd8, 0xb4, 0x42, 0x68, 0xe1, 0x44, 0xcd, 0x96, 0x5d, 0xbe, 0x4a, 0x35, 0xdb, 0xd3, + 0x0a, 0x69, 0x71, 0xed, 0xb7, 0x8e, 0x49, 0x33, 0x63, 0xcd, 0x4c, 0x22, 0x85, 0x13, 0x17, 0xce, + 0xf0, 0x8b, 0x38, 0xa2, 0x1e, 0xf7, 0xc6, 0x9e, 0x2c, 0x6a, 0xfe, 0x02, 0xa7, 0x3d, 0xa1, 0x19, + 0x7f, 0x96, 0xb4, 0x0a, 0xb7, 0x99, 0x67, 0x9e, 0xe7, 0xfd, 0x78, 0x66, 0xe6, 0x45, 0x9f, 0xcd, + 0x1e, 0x09, 0x37, 0x61, 0xde, 0x6c, 0x71, 0x0e, 0x9c, 0x82, 0x04, 0xe1, 0x2d, 0x81, 0x46, 0x8c, + 0x7b, 0xe5, 0x41, 0x90, 0x26, 0x5e, 0x94, 0x88, 0x90, 0x2d, 0x81, 0xaf, 0xbc, 0xe5, 0x81, 0x17, + 0x03, 0x05, 0x1e, 0x48, 0x88, 0xdc, 0x94, 0x33, 0xc9, 0xf0, 0x83, 0x82, 0xe8, 0x06, 0x69, 0xe2, + 0xd6, 0x44, 0x77, 0x79, 0x30, 0xfc, 0x20, 0x4e, 0xe4, 0x74, 0x71, 0xee, 0x86, 0x6c, 0xee, 0xc5, + 0x2c, 0x66, 0x9e, 0xe6, 0x9f, 0x2f, 0x2e, 0xf4, 0x4e, 0x6f, 0xf4, 0xaa, 0x88, 0x33, 0x74, 0x5a, + 0x09, 0x43, 0xc6, 0xe1, 0x96, 0x5c, 0xc3, 0x8f, 0x1a, 0xce, 0x3c, 0x08, 0xa7, 0x09, 0x55, 0x35, + 0xa5, 0xb3, 0x58, 0x01, 0xc2, 0x9b, 0x83, 0x0c, 0x6e, 0x53, 0x79, 0x77, 0xa9, 0xf8, 0x82, 0xca, + 0x64, 0x0e, 0x6b, 0x82, 0x8f, 0x37, 0x09, 0x44, 0x38, 0x85, 0x79, 0xf0, 0x5f, 0x9d, 0xf3, 0xcf, + 0x36, 0x32, 0x8f, 0x69, 0x94, 0xb2, 0x84, 0x4a, 0xbc, 0x8f, 0xac, 0x20, 0x8a, 0x38, 0x08, 0x01, + 0x62, 0x60, 0x8c, 0xbb, 0x13, 0xcb, 0xdf, 0xcb, 0x33, 0xdb, 0x3a, 0xaa, 0x40, 0xd2, 0x9c, 0xe3, + 0x17, 0x08, 0x85, 0x8c, 0x46, 0x89, 0x4c, 0x18, 0x15, 0x83, 0xad, 0xb1, 0x31, 0xe9, 0x1f, 0xee, + 0xbb, 0x77, 0x38, 0xeb, 0x56, 0x39, 0x3e, 0xaf, 0x25, 0x3e, 0xbe, 0xca, 0xec, 0x4e, 0x9e, 0xd9, + 0xa8, 0xc1, 0x48, 0x2b, 0x24, 0x9e, 0x20, 0x73, 0xca, 0x84, 0xa4, 0xc1, 0x1c, 0x06, 0xdd, 0xb1, + 0x31, 0xb1, 0xfc, 0xdd, 0x3c, 0xb3, 0xcd, 0xa7, 0x25, 0x46, 0xea, 0x53, 0x7c, 0x8a, 0x2c, 0x19, + 0xf0, 0x18, 0x24, 0x81, 0x8b, 0xc1, 0xb6, 0xae, 0xe4, 0xbd, 0x76, 0x25, 0xea, 0x6e, 0x54, 0x11, + 0xdf, 0x9d, 0xff, 0x08, 0xa1, 0x22, 0x01, 0x07, 0x1a, 0x42, 0xd1, 0xdc, 0x59, 0xa5, 0x24, 0x4d, + 0x10, 0xfc, 0x8b, 0x81, 0x70, 0x04, 0x29, 0x87, 0x50, 0x79, 0x75, 0xc6, 0x52, 0x76, 0xc9, 0xe2, + 0xd5, 0xa0, 0x37, 0xee, 0x4e, 0xfa, 0x87, 0x9f, 0x6c, 0xec, 0xd2, 0x7d, 0xbc, 0xa6, 0x3d, 0xa6, + 0x92, 0xaf, 0xfc, 0x61, 0xd9, 0x33, 0x5e, 0x27, 0x90, 0x5b, 0x12, 0x2a, 0x0f, 0x28, 0x8b, 0xe0, + 0x44, 0x79, 0xf0, 0x46, 0xe3, 0xc1, 0x49, 0x89, 0x91, 0xfa, 0x14, 0xbf, 0x83, 0xb6, 0x7f, 0x62, + 0x14, 0x06, 0x3b, 0x9a, 0x65, 0xe6, 0x99, 0xbd, 0xfd, 0x9c, 0x51, 0x20, 0x1a, 0xc5, 0x4f, 0x50, + 0x6f, 0x9a, 0x50, 0x29, 0x06, 0xa6, 0x76, 0xe7, 0xfd, 0x8d, 0x1d, 0x3c, 0x55, 0x6c, 0xdf, 0xca, + 0x33, 0xbb, 0xa7, 0x97, 0xa4, 0xd0, 0x0f, 0x8f, 0xd1, 0x83, 0x3b, 0x7a, 0xc3, 0xf7, 0x50, 0x77, + 0x06, 0xab, 0x81, 0xa1, 0x0a, 0x20, 0x6a, 0x89, 0xdf, 0x42, 0xbd, 0x65, 0x70, 0xb9, 0x00, 0xfd, + 0x3a, 0x2c, 0x52, 0x6c, 0x3e, 0xdd, 0x7a, 0x64, 0x38, 0xbf, 0x1a, 0x08, 0xaf, 0x3f, 0x09, 0x6c, + 0xa3, 0x1e, 0x87, 0x20, 0x2a, 0x82, 0x98, 0x45, 0x7a, 0xa2, 0x00, 0x52, 0xe0, 0xf8, 0x21, 0xda, + 0x11, 0xc0, 0x97, 0x09, 0x8d, 0x75, 0x4c, 0xd3, 0xef, 0xe7, 0x99, 0xbd, 0xf3, 0xac, 0x80, 0x48, + 0x75, 0x86, 0x0f, 0x50, 0x5f, 0x02, 0x9f, 0x27, 0x34, 0x90, 0x8a, 0xda, 0xd5, 0xd4, 0x37, 0xf3, + 0xcc, 0xee, 0x9f, 0x35, 0x30, 0x69, 0x73, 0x9c, 0x17, 0x68, 0xef, 0x46, 0xef, 0xf8, 0x04, 0x99, + 0x17, 0x8c, 0x2b, 0x0f, 0x8b, 0xbf, 0xd0, 0x3f, 0x1c, 0xdf, 0xe9, 0xda, 0x17, 0x05, 0xd1, 0xbf, + 0x57, 0x5e, 0xaf, 0x59, 0x02, 0x82, 0xd4, 0x31, 0x9c, 0x3f, 0x0c, 0xb4, 0x5b, 0x65, 0x38, 0x65, + 0x5c, 0xaa, 0x1b, 0xd3, 0x6f, 0xdb, 0x68, 0x6e, 0x4c, 0xdf, 0xa9, 0x46, 0xf1, 0x13, 0x64, 0xea, + 0x1f, 0x1a, 0xb2, 0xcb, 0xc2, 0x3e, 0x7f, 0x5f, 0x05, 0x3e, 0x2d, 0xb1, 0xd7, 0x99, 0xfd, 0xf6, + 0xfa, 0xf4, 0x71, 0xab, 0x63, 0x52, 0x8b, 0x55, 0x9a, 0x94, 0x71, 0xa9, 0x4d, 0xe8, 0x15, 0x69, + 0x54, 0x7a, 0xa2, 0x51, 0xe5, 0x54, 0x90, 0xa6, 0x95, 0x4c, 0x7f, 0x1e, 0xab, 0x70, 0xea, 0xa8, + 0x81, 0x49, 0x9b, 0xe3, 0xfc, 0xb9, 0xd5, 0x58, 0xf5, 0xec, 0x32, 0x09, 0x01, 0xff, 0x80, 0x4c, + 0x35, 0xc8, 0xa2, 0x40, 0x06, 0xba, 0x9b, 0xfe, 0xe1, 0x87, 0x2d, 0xab, 0xea, 0x79, 0xe4, 0xa6, + 0xb3, 0x58, 0x01, 0xc2, 0x55, 0xec, 0xe6, 0x43, 0x7e, 0x0b, 0x32, 0x68, 0xa6, 0x41, 0x83, 0x91, + 0x3a, 0x2a, 0x7e, 0x8c, 0xfa, 0xe5, 0xe4, 0x39, 0x5b, 0xa5, 0x50, 0x96, 0xe9, 0x94, 0x92, 0xfe, + 0x51, 0x73, 0xf4, 0xfa, 0xe6, 0x96, 0xb4, 0x65, 0x98, 0x20, 0x0b, 0xca, 0xc2, 0xd5, 0xc4, 0x52, + 0x77, 0xfa, 0xee, 0xc6, 0x9f, 0xe0, 0xdf, 0x2f, 0xd3, 0x58, 0x15, 0x22, 0x48, 0x13, 0x06, 0x7f, + 0x85, 0x7a, 0xca, 0x48, 0x31, 0xe8, 0xea, 0x78, 0x0f, 0x37, 0xc6, 0x53, 0xe6, 0xfb, 0x7b, 0x65, + 0xcc, 0x9e, 0xda, 0x09, 0x52, 0x84, 0x70, 0x7e, 0x37, 0xd0, 0xfd, 0x1b, 0xce, 0x7e, 0x93, 0x08, + 0x89, 0xbf, 0x5f, 0x73, 0xd7, 0xfd, 0x7f, 0xee, 0x2a, 0xb5, 0xf6, 0xb6, 0x7e, 0x96, 0x15, 0xd2, + 0x72, 0xf6, 0x6b, 0xd4, 0x4b, 0x24, 0xcc, 0x2b, 0x3f, 0x36, 0x4f, 0x06, 0x5d, 0x58, 0xd3, 0xc0, + 0x97, 0x4a, 0x4c, 0x8a, 0x18, 0xce, 0x3e, 0xda, 0x29, 0x5f, 0x3e, 0x1e, 0xdf, 0x78, 0xdd, 0xbb, + 0x25, 0xbd, 0xf5, 0xc2, 0xfd, 0xc9, 0xd5, 0xf5, 0xa8, 0xf3, 0xf2, 0x7a, 0xd4, 0x79, 0x75, 0x3d, + 0xea, 0xfc, 0x9c, 0x8f, 0x8c, 0xab, 0x7c, 0x64, 0xbc, 0xcc, 0x47, 0xc6, 0xab, 0x7c, 0x64, 0xfc, + 0x95, 0x8f, 0x8c, 0xdf, 0xfe, 0x1e, 0x75, 0x9e, 0x6f, 0x2d, 0x0f, 0xfe, 0x0d, 0x00, 0x00, 0xff, + 0xff, 0x66, 0x0f, 0x26, 0x7b, 0xf2, 0x07, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { @@ -275,6 +337,18 @@ func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Hints != nil { + { + size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } if m.Zone != nil { i -= len(*m.Zone) copy(dAtA[i:], *m.Zone) @@ -407,6 +481,43 @@ func (m *EndpointConditions) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EndpointHints) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointHints) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ForZones) > 0 { + for iNdEx := len(m.ForZones) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ForZones[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *EndpointPort) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -569,6 +680,34 @@ func (m *EndpointSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ForZone) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ForZone) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ForZone) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { offset -= sovGenerated(v) base := offset @@ -618,6 +757,10 @@ func (m *Endpoint) Size() (n int) { l = len(*m.Zone) n += 1 + l + sovGenerated(uint64(l)) } + if m.Hints != nil { + l = m.Hints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -639,6 +782,21 @@ func (m *EndpointConditions) Size() (n int) { return n } +func (m *EndpointHints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ForZones) > 0 { + for _, e := range m.ForZones { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func (m *EndpointPort) Size() (n int) { if m == nil { return 0 @@ -705,6 +863,17 @@ func (m *EndpointSliceList) Size() (n int) { return n } +func (m *ForZone) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func sovGenerated(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -733,6 +902,7 @@ func (this *Endpoint) String() string { `DeprecatedTopology:` + mapStringForDeprecatedTopology + `,`, `NodeName:` + valueToStringGenerated(this.NodeName) + `,`, `Zone:` + valueToStringGenerated(this.Zone) + `,`, + `Hints:` + strings.Replace(this.Hints.String(), "EndpointHints", "EndpointHints", 1) + `,`, `}`, }, "") return s @@ -749,6 +919,21 @@ func (this *EndpointConditions) String() string { }, "") return s } +func (this *EndpointHints) String() string { + if this == nil { + return "nil" + } + repeatedStringForForZones := "[]ForZone{" + for _, f := range this.ForZones { + repeatedStringForForZones += strings.Replace(strings.Replace(f.String(), "ForZone", "ForZone", 1), `&`, ``, 1) + "," + } + repeatedStringForForZones += "}" + s := strings.Join([]string{`&EndpointHints{`, + `ForZones:` + repeatedStringForForZones + `,`, + `}`, + }, "") + return s +} func (this *EndpointPort) String() string { if this == nil { return "nil" @@ -801,6 +986,16 @@ func (this *EndpointSliceList) String() string { }, "") return s } +func (this *ForZone) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ForZone{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -1165,6 +1360,42 @@ func (m *Endpoint) Unmarshal(dAtA []byte) error { s := string(dAtA[iNdEx:postIndex]) m.Zone = &s iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hints == nil { + m.Hints = &EndpointHints{} + } + if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -1299,6 +1530,90 @@ func (m *EndpointConditions) Unmarshal(dAtA []byte) error { } return nil } +func (m *EndpointHints) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForZones", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ForZones = append(m.ForZones, ForZone{}) + if err := m.ForZones[len(m.ForZones)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *EndpointPort) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1768,6 +2083,88 @@ func (m *EndpointSliceList) Unmarshal(dAtA []byte) error { } return nil } +func (m *ForZone) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ForZone: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ForZone: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/generated.proto index 689f2a8127f8..0e1e4a8c37d5 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/generated.proto @@ -73,6 +73,11 @@ message Endpoint { // zone is the name of the Zone this endpoint exists in. // +optional optional string zone = 7; + + // hints contains information associated with how an endpoint should be + // consumed. + // +optional + optional EndpointHints hints = 8; } // EndpointConditions represents the current condition of an endpoint. @@ -101,7 +106,16 @@ message EndpointConditions { optional bool terminating = 3; } +// EndpointHints provides hints describing how an endpoint should be consumed. +message EndpointHints { + // forZones indicates the zone(s) this endpoint should be consumed by to + // enable topology aware routing. + // +listType=atomic + repeated ForZone forZones = 1; +} + // EndpointPort represents a Port used by an EndpointSlice +// +structType=atomic message EndpointPort { // The name of this port. All ports in an EndpointSlice must have a unique // name. If the EndpointSlice is dervied from a Kubernetes service, this @@ -175,3 +189,9 @@ message EndpointSliceList { repeated EndpointSlice items = 2; } +// ForZone provides information about which zones should consume this endpoint. +message ForZone { + // name represents the name of the zone. + optional string name = 1; +} + diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/types.go index a8b145f3f5f1..b66fdd884954 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/types.go @@ -106,6 +106,10 @@ type Endpoint struct { // zone is the name of the Zone this endpoint exists in. // +optional Zone *string `json:"zone,omitempty" protobuf:"bytes,7,opt,name=zone"` + // hints contains information associated with how an endpoint should be + // consumed. + // +optional + Hints *EndpointHints `json:"hints,omitempty" protobuf:"bytes,8,opt,name=hints"` } // EndpointConditions represents the current condition of an endpoint. @@ -134,7 +138,22 @@ type EndpointConditions struct { Terminating *bool `json:"terminating,omitempty" protobuf:"bytes,3,name=terminating"` } +// EndpointHints provides hints describing how an endpoint should be consumed. +type EndpointHints struct { + // forZones indicates the zone(s) this endpoint should be consumed by to + // enable topology aware routing. + // +listType=atomic + ForZones []ForZone `json:"forZones,omitempty" protobuf:"bytes,1,name=forZones"` +} + +// ForZone provides information about which zones should consume this endpoint. +type ForZone struct { + // name represents the name of the zone. + Name string `json:"name" protobuf:"bytes,1,name=name"` +} + // EndpointPort represents a Port used by an EndpointSlice +// +structType=atomic type EndpointPort struct { // The name of this port. All ports in an EndpointSlice must have a unique // name. If the EndpointSlice is dervied from a Kubernetes service, this diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go index cc51e2f3ee19..b424a1cf0466 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go @@ -36,6 +36,7 @@ var map_Endpoint = map[string]string{ "deprecatedTopology": "deprecatedTopology contains topology information part of the v1beta1 API. This field is deprecated, and will be removed when the v1beta1 API is removed (no sooner than kubernetes v1.24). While this field can hold values, it is not writable through the v1 API, and any attempts to write to it will be silently ignored. Topology information can be found in the zone and nodeName fields instead.", "nodeName": "nodeName represents the name of the Node hosting this endpoint. This can be used to determine endpoints local to a Node. This field can be enabled with the EndpointSliceNodeName feature gate.", "zone": "zone is the name of the Zone this endpoint exists in.", + "hints": "hints contains information associated with how an endpoint should be consumed.", } func (Endpoint) SwaggerDoc() map[string]string { @@ -53,6 +54,15 @@ func (EndpointConditions) SwaggerDoc() map[string]string { return map_EndpointConditions } +var map_EndpointHints = map[string]string{ + "": "EndpointHints provides hints describing how an endpoint should be consumed.", + "forZones": "forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing.", +} + +func (EndpointHints) SwaggerDoc() map[string]string { + return map_EndpointHints +} + var map_EndpointPort = map[string]string{ "": "EndpointPort represents a Port used by an EndpointSlice", "name": "The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", @@ -87,4 +97,13 @@ func (EndpointSliceList) SwaggerDoc() map[string]string { return map_EndpointSliceList } +var map_ForZone = map[string]string{ + "": "ForZone provides information about which zones should consume this endpoint.", + "name": "name represents the name of the zone.", +} + +func (ForZone) SwaggerDoc() map[string]string { + return map_ForZone +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/zz_generated.deepcopy.go index a052e9039990..31a912386f19 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/zz_generated.deepcopy.go +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1/zz_generated.deepcopy.go @@ -61,6 +61,11 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = new(string) **out = **in } + if in.Hints != nil { + in, out := &in.Hints, &out.Hints + *out = new(EndpointHints) + (*in).DeepCopyInto(*out) + } return } @@ -105,6 +110,27 @@ func (in *EndpointConditions) DeepCopy() *EndpointConditions { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointHints) DeepCopyInto(out *EndpointHints) { + *out = *in + if in.ForZones != nil { + in, out := &in.ForZones, &out.ForZones + *out = make([]ForZone, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointHints. +func (in *EndpointHints) DeepCopy() *EndpointHints { + if in == nil { + return nil + } + out := new(EndpointHints) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EndpointPort) DeepCopyInto(out *EndpointPort) { *out = *in @@ -213,3 +239,19 @@ func (in *EndpointSliceList) DeepCopyObject() runtime.Object { } return nil } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ForZone) DeepCopyInto(out *ForZone) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForZone. +func (in *ForZone) DeepCopy() *ForZone { + if in == nil { + return nil + } + out := new(ForZone) + in.DeepCopyInto(out) + return out +} diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go index 1fdb8ddb77d3..e024cc0a16db 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go @@ -102,10 +102,38 @@ func (m *EndpointConditions) XXX_DiscardUnknown() { var xxx_messageInfo_EndpointConditions proto.InternalMessageInfo +func (m *EndpointHints) Reset() { *m = EndpointHints{} } +func (*EndpointHints) ProtoMessage() {} +func (*EndpointHints) Descriptor() ([]byte, []int) { + return fileDescriptor_ece80bbc872d519b, []int{2} +} +func (m *EndpointHints) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointHints) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointHints.Merge(m, src) +} +func (m *EndpointHints) XXX_Size() int { + return m.Size() +} +func (m *EndpointHints) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointHints.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointHints proto.InternalMessageInfo + func (m *EndpointPort) Reset() { *m = EndpointPort{} } func (*EndpointPort) ProtoMessage() {} func (*EndpointPort) Descriptor() ([]byte, []int) { - return fileDescriptor_ece80bbc872d519b, []int{2} + return fileDescriptor_ece80bbc872d519b, []int{3} } func (m *EndpointPort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -133,7 +161,7 @@ var xxx_messageInfo_EndpointPort proto.InternalMessageInfo func (m *EndpointSlice) Reset() { *m = EndpointSlice{} } func (*EndpointSlice) ProtoMessage() {} func (*EndpointSlice) Descriptor() ([]byte, []int) { - return fileDescriptor_ece80bbc872d519b, []int{3} + return fileDescriptor_ece80bbc872d519b, []int{4} } func (m *EndpointSlice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -161,7 +189,7 @@ var xxx_messageInfo_EndpointSlice proto.InternalMessageInfo func (m *EndpointSliceList) Reset() { *m = EndpointSliceList{} } func (*EndpointSliceList) ProtoMessage() {} func (*EndpointSliceList) Descriptor() ([]byte, []int) { - return fileDescriptor_ece80bbc872d519b, []int{4} + return fileDescriptor_ece80bbc872d519b, []int{5} } func (m *EndpointSliceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -186,13 +214,43 @@ func (m *EndpointSliceList) XXX_DiscardUnknown() { var xxx_messageInfo_EndpointSliceList proto.InternalMessageInfo +func (m *ForZone) Reset() { *m = ForZone{} } +func (*ForZone) ProtoMessage() {} +func (*ForZone) Descriptor() ([]byte, []int) { + return fileDescriptor_ece80bbc872d519b, []int{6} +} +func (m *ForZone) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ForZone) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ForZone) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForZone.Merge(m, src) +} +func (m *ForZone) XXX_Size() int { + return m.Size() +} +func (m *ForZone) XXX_DiscardUnknown() { + xxx_messageInfo_ForZone.DiscardUnknown(m) +} + +var xxx_messageInfo_ForZone proto.InternalMessageInfo + func init() { proto.RegisterType((*Endpoint)(nil), "k8s.io.api.discovery.v1beta1.Endpoint") proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.discovery.v1beta1.Endpoint.TopologyEntry") proto.RegisterType((*EndpointConditions)(nil), "k8s.io.api.discovery.v1beta1.EndpointConditions") + proto.RegisterType((*EndpointHints)(nil), "k8s.io.api.discovery.v1beta1.EndpointHints") proto.RegisterType((*EndpointPort)(nil), "k8s.io.api.discovery.v1beta1.EndpointPort") proto.RegisterType((*EndpointSlice)(nil), "k8s.io.api.discovery.v1beta1.EndpointSlice") proto.RegisterType((*EndpointSliceList)(nil), "k8s.io.api.discovery.v1beta1.EndpointSliceList") + proto.RegisterType((*ForZone)(nil), "k8s.io.api.discovery.v1beta1.ForZone") } func init() { @@ -200,57 +258,62 @@ func init() { } var fileDescriptor_ece80bbc872d519b = []byte{ - // 798 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x8f, 0xe3, 0x44, - 0x10, 0x8d, 0x27, 0x63, 0xc6, 0xee, 0xec, 0x88, 0xdd, 0x16, 0x87, 0x68, 0x58, 0xd9, 0xa3, 0x20, - 0x50, 0xc4, 0x68, 0x6d, 0x66, 0xb5, 0x42, 0x2b, 0x38, 0x8d, 0x61, 0x04, 0x48, 0xb0, 0x1b, 0xf5, - 0x46, 0x42, 0x42, 0x1c, 0xe8, 0xd8, 0xb5, 0x8e, 0x49, 0xec, 0xb6, 0xba, 0x3b, 0x91, 0x72, 0xe3, - 0x1f, 0xc0, 0x7f, 0x42, 0x42, 0x73, 0xdc, 0xe3, 0x9e, 0x2c, 0x62, 0xf8, 0x15, 0x7b, 0x42, 0xdd, - 0xfe, 0x4a, 0x08, 0x1f, 0xb9, 0x75, 0xbf, 0xaa, 0xf7, 0xaa, 0x5e, 0x75, 0x17, 0xba, 0x5d, 0x3c, - 0x15, 0x5e, 0xc2, 0xfc, 0xc5, 0x6a, 0x06, 0x3c, 0x03, 0x09, 0xc2, 0x5f, 0x43, 0x16, 0x31, 0xee, - 0xd7, 0x01, 0x9a, 0x27, 0x7e, 0x94, 0x88, 0x90, 0xad, 0x81, 0x6f, 0xfc, 0xf5, 0xf5, 0x0c, 0x24, - 0xbd, 0xf6, 0x63, 0xc8, 0x80, 0x53, 0x09, 0x91, 0x97, 0x73, 0x26, 0x19, 0x7e, 0x58, 0x65, 0x7b, - 0x34, 0x4f, 0xbc, 0x36, 0xdb, 0xab, 0xb3, 0x2f, 0x1e, 0xc5, 0x89, 0x9c, 0xaf, 0x66, 0x5e, 0xc8, - 0x52, 0x3f, 0x66, 0x31, 0xf3, 0x35, 0x69, 0xb6, 0x7a, 0xa9, 0x6f, 0xfa, 0xa2, 0x4f, 0x95, 0xd8, - 0xc5, 0x68, 0xa7, 0x74, 0xc8, 0x38, 0xf8, 0xeb, 0x83, 0x82, 0x17, 0x4f, 0xba, 0x9c, 0x94, 0x86, - 0xf3, 0x24, 0x53, 0xdd, 0xe5, 0x8b, 0x58, 0x01, 0xc2, 0x4f, 0x41, 0xd2, 0x7f, 0x62, 0xf9, 0xff, - 0xc6, 0xe2, 0xab, 0x4c, 0x26, 0x29, 0x1c, 0x10, 0x3e, 0xfe, 0x3f, 0x82, 0x08, 0xe7, 0x90, 0xd2, - 0xbf, 0xf3, 0x46, 0x7f, 0xf6, 0x91, 0x75, 0x9b, 0x45, 0x39, 0x4b, 0x32, 0x89, 0xaf, 0x90, 0x4d, - 0xa3, 0x88, 0x83, 0x10, 0x20, 0x86, 0xc6, 0x65, 0x7f, 0x6c, 0x07, 0xe7, 0x65, 0xe1, 0xda, 0x37, - 0x0d, 0x48, 0xba, 0x38, 0x8e, 0x10, 0x0a, 0x59, 0x16, 0x25, 0x32, 0x61, 0x99, 0x18, 0x9e, 0x5c, - 0x1a, 0xe3, 0xc1, 0xe3, 0x8f, 0xbc, 0xff, 0x1a, 0xaf, 0xd7, 0x14, 0xfa, 0xac, 0xe5, 0x05, 0xf8, - 0xae, 0x70, 0x7b, 0x65, 0xe1, 0xa2, 0x0e, 0x23, 0x3b, 0xba, 0x78, 0x8c, 0xac, 0x39, 0x13, 0x32, - 0xa3, 0x29, 0x0c, 0xfb, 0x97, 0xc6, 0xd8, 0x0e, 0xee, 0x95, 0x85, 0x6b, 0x7d, 0x59, 0x63, 0xa4, - 0x8d, 0xe2, 0x09, 0xb2, 0x25, 0xe5, 0x31, 0x48, 0x02, 0x2f, 0x87, 0xa7, 0xba, 0x9d, 0xf7, 0x76, - 0xdb, 0x51, 0x0f, 0xe4, 0xad, 0xaf, 0xbd, 0xe7, 0xb3, 0x1f, 0x21, 0x54, 0x49, 0xc0, 0x21, 0x0b, - 0xa1, 0x72, 0x38, 0x6d, 0x98, 0xa4, 0x13, 0xc1, 0x33, 0x64, 0x49, 0x96, 0xb3, 0x25, 0x8b, 0x37, - 0x43, 0xf3, 0xb2, 0x3f, 0x1e, 0x3c, 0x7e, 0x72, 0x9c, 0x3f, 0x6f, 0x5a, 0xd3, 0x6e, 0x33, 0xc9, - 0x37, 0xc1, 0xfd, 0xda, 0xa3, 0xd5, 0xc0, 0xa4, 0xd5, 0x55, 0xfe, 0x32, 0x16, 0xc1, 0x33, 0xe5, - 0xef, 0xad, 0xce, 0xdf, 0xb3, 0x1a, 0x23, 0x6d, 0xf4, 0xe2, 0x53, 0x74, 0xbe, 0x27, 0x8b, 0xef, - 0xa3, 0xfe, 0x02, 0x36, 0x43, 0x43, 0xb1, 0x88, 0x3a, 0xe2, 0x77, 0x90, 0xb9, 0xa6, 0xcb, 0x15, - 0xe8, 0xd7, 0xb0, 0x49, 0x75, 0xf9, 0xe4, 0xe4, 0xa9, 0x31, 0xfa, 0xd9, 0x40, 0xf8, 0x70, 0xfa, - 0xd8, 0x45, 0x26, 0x07, 0x1a, 0x55, 0x22, 0x56, 0x60, 0x97, 0x85, 0x6b, 0x12, 0x05, 0x90, 0x0a, - 0xc7, 0xef, 0xa3, 0x33, 0x01, 0x7c, 0x9d, 0x64, 0xb1, 0xd6, 0xb4, 0x82, 0x41, 0x59, 0xb8, 0x67, - 0x2f, 0x2a, 0x88, 0x34, 0x31, 0x7c, 0x8d, 0x06, 0x12, 0x78, 0x9a, 0x64, 0x54, 0xaa, 0xd4, 0xbe, - 0x4e, 0x7d, 0xbb, 0x2c, 0xdc, 0xc1, 0xb4, 0x83, 0xc9, 0x6e, 0xce, 0xe8, 0x37, 0x03, 0xdd, 0x6b, - 0x3a, 0x9a, 0x30, 0x2e, 0xf1, 0x43, 0x74, 0xaa, 0x5f, 0x59, 0xfb, 0x09, 0xac, 0xb2, 0x70, 0x4f, - 0xf5, 0x04, 0x34, 0x8a, 0xbf, 0x40, 0x96, 0xfe, 0xb0, 0x21, 0x5b, 0x56, 0xee, 0x82, 0x2b, 0x35, - 0xa7, 0x49, 0x8d, 0xbd, 0x29, 0xdc, 0x77, 0x0f, 0x97, 0xd1, 0x6b, 0xc2, 0xa4, 0x25, 0xab, 0x32, - 0x39, 0xe3, 0x52, 0xf7, 0x68, 0x56, 0x65, 0x54, 0x79, 0xa2, 0x51, 0x65, 0x84, 0xe6, 0x79, 0x43, - 0xd3, 0xdf, 0xc8, 0xae, 0x8c, 0xdc, 0x74, 0x30, 0xd9, 0xcd, 0x19, 0x6d, 0x4f, 0xd0, 0x79, 0x63, - 0xe4, 0xc5, 0x32, 0x09, 0x01, 0xff, 0x80, 0x2c, 0xb5, 0xd7, 0x11, 0x95, 0x54, 0xbb, 0xd9, 0xdf, - 0x8b, 0x76, 0x3d, 0xbd, 0x7c, 0x11, 0x2b, 0x40, 0x78, 0x2a, 0xbb, 0xfb, 0x9a, 0xdf, 0x80, 0xa4, - 0xdd, 0x5e, 0x74, 0x18, 0x69, 0x55, 0xf1, 0xe7, 0x68, 0x50, 0x2f, 0xe2, 0x74, 0x93, 0x43, 0xdd, - 0xe6, 0xa8, 0xa6, 0x0c, 0x6e, 0xba, 0xd0, 0x9b, 0xfd, 0x2b, 0xd9, 0xa5, 0xe1, 0x6f, 0x91, 0x0d, - 0x75, 0xe3, 0x6a, 0x81, 0xd5, 0x07, 0xff, 0xe0, 0xb8, 0x0f, 0x1e, 0x3c, 0xa8, 0x6b, 0xd9, 0x0d, - 0x22, 0x48, 0xa7, 0x85, 0x9f, 0x23, 0x53, 0x4d, 0x53, 0x0c, 0xfb, 0x5a, 0xf4, 0xc3, 0xe3, 0x44, - 0xd5, 0x33, 0x04, 0xe7, 0xb5, 0xb0, 0xa9, 0x6e, 0x82, 0x54, 0x3a, 0xa3, 0x5f, 0x0d, 0xf4, 0x60, - 0x6f, 0xc6, 0x5f, 0x27, 0x42, 0xe2, 0xef, 0x0f, 0xe6, 0xec, 0x1d, 0x37, 0x67, 0xc5, 0xd6, 0x53, - 0x6e, 0x37, 0xb3, 0x41, 0x76, 0x66, 0x3c, 0x41, 0x66, 0x22, 0x21, 0x6d, 0x26, 0x73, 0x75, 0x9c, - 0x09, 0xdd, 0x5d, 0xe7, 0xe2, 0x2b, 0xa5, 0x40, 0x2a, 0xa1, 0xe0, 0xd1, 0xdd, 0xd6, 0xe9, 0xbd, - 0xda, 0x3a, 0xbd, 0xd7, 0x5b, 0xa7, 0xf7, 0x53, 0xe9, 0x18, 0x77, 0xa5, 0x63, 0xbc, 0x2a, 0x1d, - 0xe3, 0x75, 0xe9, 0x18, 0xbf, 0x97, 0x8e, 0xf1, 0xcb, 0x1f, 0x4e, 0xef, 0xbb, 0xb3, 0x5a, 0xf2, - 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa6, 0x35, 0xe6, 0xf5, 0xf2, 0x06, 0x00, 0x00, + // 870 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x41, 0x8f, 0xe3, 0x34, + 0x14, 0x6e, 0xa6, 0x53, 0x9a, 0xb8, 0x33, 0x62, 0xd7, 0xe2, 0x50, 0x0d, 0xab, 0xa4, 0x0a, 0x5a, + 0x54, 0x31, 0xda, 0x84, 0x19, 0xad, 0xd0, 0x0a, 0x4e, 0x13, 0x18, 0x58, 0xa4, 0x65, 0x77, 0xe4, + 0x19, 0x09, 0x69, 0xc5, 0x01, 0x37, 0xf1, 0xa4, 0xa1, 0x53, 0x3b, 0xb2, 0xdd, 0x4a, 0xbd, 0xf1, + 0x0f, 0xe0, 0xb7, 0xf0, 0x17, 0x90, 0xd0, 0x1c, 0xf7, 0xb8, 0xa7, 0x88, 0x09, 0xff, 0x62, 0x4f, + 0xc8, 0x8e, 0x93, 0xb4, 0x14, 0x86, 0xde, 0xec, 0xcf, 0xef, 0xfb, 0xde, 0x7b, 0xdf, 0xb3, 0x0d, + 0xce, 0x67, 0xcf, 0x44, 0x90, 0xb1, 0x70, 0xb6, 0x98, 0x10, 0x4e, 0x89, 0x24, 0x22, 0x5c, 0x12, + 0x9a, 0x30, 0x1e, 0x9a, 0x03, 0x9c, 0x67, 0x61, 0x92, 0x89, 0x98, 0x2d, 0x09, 0x5f, 0x85, 0xcb, + 0x93, 0x09, 0x91, 0xf8, 0x24, 0x4c, 0x09, 0x25, 0x1c, 0x4b, 0x92, 0x04, 0x39, 0x67, 0x92, 0xc1, + 0x47, 0x55, 0x74, 0x80, 0xf3, 0x2c, 0x68, 0xa2, 0x03, 0x13, 0x7d, 0xf4, 0x24, 0xcd, 0xe4, 0x74, + 0x31, 0x09, 0x62, 0x36, 0x0f, 0x53, 0x96, 0xb2, 0x50, 0x93, 0x26, 0x8b, 0x6b, 0xbd, 0xd3, 0x1b, + 0xbd, 0xaa, 0xc4, 0x8e, 0xfc, 0xb5, 0xd4, 0x31, 0xe3, 0x24, 0x5c, 0x6e, 0x25, 0x3c, 0x7a, 0xda, + 0xc6, 0xcc, 0x71, 0x3c, 0xcd, 0xa8, 0xaa, 0x2e, 0x9f, 0xa5, 0x0a, 0x10, 0xe1, 0x9c, 0x48, 0xfc, + 0x6f, 0xac, 0xf0, 0xbf, 0x58, 0x7c, 0x41, 0x65, 0x36, 0x27, 0x5b, 0x84, 0xcf, 0xfe, 0x8f, 0x20, + 0xe2, 0x29, 0x99, 0xe3, 0x7f, 0xf2, 0xfc, 0xdf, 0xf6, 0x81, 0x7d, 0x4e, 0x93, 0x9c, 0x65, 0x54, + 0xc2, 0x63, 0xe0, 0xe0, 0x24, 0xe1, 0x44, 0x08, 0x22, 0x86, 0xd6, 0xa8, 0x3b, 0x76, 0xa2, 0xc3, + 0xb2, 0xf0, 0x9c, 0xb3, 0x1a, 0x44, 0xed, 0x39, 0x4c, 0x00, 0x88, 0x19, 0x4d, 0x32, 0x99, 0x31, + 0x2a, 0x86, 0x7b, 0x23, 0x6b, 0x3c, 0x38, 0xfd, 0x34, 0xb8, 0xcf, 0xde, 0xa0, 0x4e, 0xf4, 0x65, + 0xc3, 0x8b, 0xe0, 0x6d, 0xe1, 0x75, 0xca, 0xc2, 0x03, 0x2d, 0x86, 0xd6, 0x74, 0xe1, 0x18, 0xd8, + 0x53, 0x26, 0x24, 0xc5, 0x73, 0x32, 0xec, 0x8e, 0xac, 0xb1, 0x13, 0x1d, 0x94, 0x85, 0x67, 0x3f, + 0x37, 0x18, 0x6a, 0x4e, 0xe1, 0x05, 0x70, 0x24, 0xe6, 0x29, 0x91, 0x88, 0x5c, 0x0f, 0xf7, 0x75, + 0x39, 0x1f, 0xad, 0x97, 0xa3, 0x06, 0x14, 0x2c, 0x4f, 0x82, 0x57, 0x93, 0x9f, 0x48, 0xac, 0x82, + 0x08, 0x27, 0x34, 0x26, 0x55, 0x87, 0x57, 0x35, 0x13, 0xb5, 0x22, 0x70, 0x02, 0x6c, 0xc9, 0x72, + 0x76, 0xc3, 0xd2, 0xd5, 0xb0, 0x37, 0xea, 0x8e, 0x07, 0xa7, 0x4f, 0x77, 0xeb, 0x2f, 0xb8, 0x32, + 0xb4, 0x73, 0x2a, 0xf9, 0x2a, 0x7a, 0x60, 0x7a, 0xb4, 0x6b, 0x18, 0x35, 0xba, 0xaa, 0x3f, 0xca, + 0x12, 0xf2, 0x52, 0xf5, 0xf7, 0x5e, 0xdb, 0xdf, 0x4b, 0x83, 0xa1, 0xe6, 0x14, 0xbe, 0x00, 0xbd, + 0x69, 0x46, 0xa5, 0x18, 0xf6, 0x75, 0x6f, 0xc7, 0xbb, 0x95, 0xf2, 0x5c, 0x51, 0x22, 0xa7, 0x2c, + 0xbc, 0x9e, 0x5e, 0xa2, 0x4a, 0xe4, 0xe8, 0x0b, 0x70, 0xb8, 0x51, 0x24, 0x7c, 0x00, 0xba, 0x33, + 0xb2, 0x1a, 0x5a, 0xaa, 0x06, 0xa4, 0x96, 0xf0, 0x03, 0xd0, 0x5b, 0xe2, 0x9b, 0x05, 0xd1, 0xb3, + 0x75, 0x50, 0xb5, 0xf9, 0x7c, 0xef, 0x99, 0xe5, 0xff, 0x62, 0x01, 0xb8, 0x3d, 0x4b, 0xe8, 0x81, + 0x1e, 0x27, 0x38, 0xa9, 0x44, 0xec, 0x2a, 0x29, 0x52, 0x00, 0xaa, 0x70, 0xf8, 0x18, 0xf4, 0x05, + 0xe1, 0xcb, 0x8c, 0xa6, 0x5a, 0xd3, 0x8e, 0x06, 0x65, 0xe1, 0xf5, 0x2f, 0x2b, 0x08, 0xd5, 0x67, + 0xf0, 0x04, 0x0c, 0x24, 0xe1, 0xf3, 0x8c, 0x62, 0xa9, 0x42, 0xbb, 0x3a, 0xf4, 0xfd, 0xb2, 0xf0, + 0x06, 0x57, 0x2d, 0x8c, 0xd6, 0x63, 0xfc, 0x04, 0x1c, 0x6e, 0x74, 0x0c, 0x2f, 0x81, 0x7d, 0xcd, + 0xf8, 0x6b, 0x46, 0xcd, 0x4d, 0x1e, 0x9c, 0x3e, 0xbe, 0xdf, 0xb0, 0xaf, 0xab, 0xe8, 0x76, 0x58, + 0x06, 0x10, 0xa8, 0x11, 0xf2, 0xff, 0xb0, 0xc0, 0x41, 0x9d, 0xe6, 0x82, 0x71, 0x09, 0x1f, 0x81, + 0x7d, 0x7d, 0x33, 0xb5, 0x6b, 0x91, 0x5d, 0x16, 0xde, 0xbe, 0x9e, 0x9a, 0x46, 0xe1, 0x37, 0xc0, + 0xd6, 0x8f, 0x2c, 0x66, 0x37, 0x95, 0x87, 0xd1, 0xb1, 0x12, 0xbe, 0x30, 0xd8, 0xbb, 0xc2, 0xfb, + 0x70, 0xfb, 0x03, 0x09, 0xea, 0x63, 0xd4, 0x90, 0x55, 0x9a, 0x9c, 0x71, 0xa9, 0x9d, 0xe8, 0x55, + 0x69, 0x54, 0x7a, 0xa4, 0x51, 0x65, 0x17, 0xce, 0xf3, 0x9a, 0xa6, 0xaf, 0xbe, 0x53, 0xd9, 0x75, + 0xd6, 0xc2, 0x68, 0x3d, 0xc6, 0xbf, 0xdb, 0x6b, 0xfd, 0xba, 0xbc, 0xc9, 0x62, 0x02, 0x7f, 0x04, + 0xb6, 0xfa, 0x8b, 0x12, 0x2c, 0xb1, 0xee, 0x66, 0xf3, 0x2d, 0x37, 0x5f, 0x4a, 0x90, 0xcf, 0x52, + 0x05, 0x88, 0x40, 0x45, 0xb7, 0xcf, 0xe9, 0x3b, 0x22, 0x71, 0xfb, 0x96, 0x5b, 0x0c, 0x35, 0xaa, + 0xf0, 0x2b, 0x30, 0x30, 0x9f, 0xc7, 0xd5, 0x2a, 0x27, 0xa6, 0x4c, 0xdf, 0x50, 0x06, 0x67, 0xed, + 0xd1, 0xbb, 0xcd, 0x2d, 0x5a, 0xa7, 0xc1, 0xef, 0x81, 0x43, 0x4c, 0xe1, 0xea, 0xd3, 0x51, 0x83, + 0xfd, 0x78, 0xb7, 0x97, 0x10, 0x3d, 0x34, 0xb9, 0x9c, 0x1a, 0x11, 0xa8, 0xd5, 0x82, 0xaf, 0x40, + 0x4f, 0xb9, 0x29, 0x86, 0x5d, 0x2d, 0xfa, 0xc9, 0x6e, 0xa2, 0x6a, 0x0c, 0xd1, 0xa1, 0x11, 0xee, + 0xa9, 0x9d, 0x40, 0x95, 0x8e, 0xff, 0xbb, 0x05, 0x1e, 0x6e, 0x78, 0xfc, 0x22, 0x13, 0x12, 0xfe, + 0xb0, 0xe5, 0x73, 0xb0, 0x9b, 0xcf, 0x8a, 0xad, 0x5d, 0x6e, 0x2e, 0x68, 0x8d, 0xac, 0x79, 0x7c, + 0x01, 0x7a, 0x99, 0x24, 0xf3, 0xda, 0x99, 0x1d, 0xff, 0x08, 0x5d, 0x5d, 0xdb, 0xc5, 0xb7, 0x4a, + 0x01, 0x55, 0x42, 0xfe, 0x31, 0xe8, 0x9b, 0x87, 0x00, 0x47, 0x1b, 0x97, 0xfd, 0xc0, 0x84, 0xaf, + 0x5d, 0xf8, 0xe8, 0xc9, 0xed, 0x9d, 0xdb, 0x79, 0x73, 0xe7, 0x76, 0xde, 0xde, 0xb9, 0x9d, 0x9f, + 0x4b, 0xd7, 0xba, 0x2d, 0x5d, 0xeb, 0x4d, 0xe9, 0x5a, 0x6f, 0x4b, 0xd7, 0xfa, 0xb3, 0x74, 0xad, + 0x5f, 0xff, 0x72, 0x3b, 0xaf, 0xfb, 0x26, 0xff, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x0d, + 0x6f, 0x98, 0xd3, 0x07, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { @@ -273,6 +336,18 @@ func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Hints != nil { + { + size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } if m.NodeName != nil { i -= len(*m.NodeName) copy(dAtA[i:], *m.NodeName) @@ -398,6 +473,43 @@ func (m *EndpointConditions) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EndpointHints) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointHints) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ForZones) > 0 { + for iNdEx := len(m.ForZones) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ForZones[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *EndpointPort) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -560,6 +672,34 @@ func (m *EndpointSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ForZone) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ForZone) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ForZone) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { offset -= sovGenerated(v) base := offset @@ -605,6 +745,10 @@ func (m *Endpoint) Size() (n int) { l = len(*m.NodeName) n += 1 + l + sovGenerated(uint64(l)) } + if m.Hints != nil { + l = m.Hints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -626,6 +770,21 @@ func (m *EndpointConditions) Size() (n int) { return n } +func (m *EndpointHints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ForZones) > 0 { + for _, e := range m.ForZones { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func (m *EndpointPort) Size() (n int) { if m == nil { return 0 @@ -692,6 +851,17 @@ func (m *EndpointSliceList) Size() (n int) { return n } +func (m *ForZone) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func sovGenerated(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -719,6 +889,7 @@ func (this *Endpoint) String() string { `TargetRef:` + strings.Replace(fmt.Sprintf("%v", this.TargetRef), "ObjectReference", "v1.ObjectReference", 1) + `,`, `Topology:` + mapStringForTopology + `,`, `NodeName:` + valueToStringGenerated(this.NodeName) + `,`, + `Hints:` + strings.Replace(this.Hints.String(), "EndpointHints", "EndpointHints", 1) + `,`, `}`, }, "") return s @@ -735,6 +906,21 @@ func (this *EndpointConditions) String() string { }, "") return s } +func (this *EndpointHints) String() string { + if this == nil { + return "nil" + } + repeatedStringForForZones := "[]ForZone{" + for _, f := range this.ForZones { + repeatedStringForForZones += strings.Replace(strings.Replace(f.String(), "ForZone", "ForZone", 1), `&`, ``, 1) + "," + } + repeatedStringForForZones += "}" + s := strings.Join([]string{`&EndpointHints{`, + `ForZones:` + repeatedStringForForZones + `,`, + `}`, + }, "") + return s +} func (this *EndpointPort) String() string { if this == nil { return "nil" @@ -787,6 +973,16 @@ func (this *EndpointSliceList) String() string { }, "") return s } +func (this *ForZone) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ForZone{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -1118,6 +1314,42 @@ func (m *Endpoint) Unmarshal(dAtA []byte) error { s := string(dAtA[iNdEx:postIndex]) m.NodeName = &s iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hints == nil { + m.Hints = &EndpointHints{} + } + if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -1252,6 +1484,90 @@ func (m *EndpointConditions) Unmarshal(dAtA []byte) error { } return nil } +func (m *EndpointHints) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointHints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointHints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForZones", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ForZones = append(m.ForZones, ForZone{}) + if err := m.ForZones[len(m.ForZones)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *EndpointPort) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1721,6 +2037,88 @@ func (m *EndpointSliceList) Unmarshal(dAtA []byte) error { } return nil } +func (m *ForZone) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ForZone: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ForZone: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/generated.proto index e5d21caadf29..6925f7ce3b09 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/generated.proto @@ -76,6 +76,12 @@ message Endpoint { // with the EndpointSliceNodeName feature gate. // +optional optional string nodeName = 6; + + // hints contains information associated with how an endpoint should be + // consumed. + // +featureGate=TopologyAwareHints + // +optional + optional EndpointHints hints = 7; } // EndpointConditions represents the current condition of an endpoint. @@ -104,6 +110,14 @@ message EndpointConditions { optional bool terminating = 3; } +// EndpointHints provides hints describing how an endpoint should be consumed. +message EndpointHints { + // forZones indicates the zone(s) this endpoint should be consumed by to + // enable topology aware routing. May contain a maximum of 8 entries. + // +listType=atomic + repeated ForZone forZones = 1; +} + // EndpointPort represents a Port used by an EndpointSlice message EndpointPort { // The name of this port. All ports in an EndpointSlice must have a unique @@ -178,3 +192,9 @@ message EndpointSliceList { repeated EndpointSlice items = 2; } +// ForZone provides information about which zones should consume this endpoint. +message ForZone { + // name represents the name of the zone. + optional string name = 1; +} + diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/types.go index e14088e8b2ce..eeb46e175a14 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/types.go @@ -24,7 +24,9 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.16 -// +k8s:prerelease-lifecycle-gen:deprecated=1.22 +// +k8s:prerelease-lifecycle-gen:deprecated=1.21 +// +k8s:prerelease-lifecycle-gen:removed=1.25 +// +k8s:prerelease-lifecycle-gen:replacement=discovery.k8s.io,v1,EndpointSlice // EndpointSlice represents a subset of the endpoints that implement a service. // For a given service there may be multiple EndpointSlice objects, selected by @@ -110,6 +112,11 @@ type Endpoint struct { // with the EndpointSliceNodeName feature gate. // +optional NodeName *string `json:"nodeName,omitempty" protobuf:"bytes,6,opt,name=nodeName"` + // hints contains information associated with how an endpoint should be + // consumed. + // +featureGate=TopologyAwareHints + // +optional + Hints *EndpointHints `json:"hints,omitempty" protobuf:"bytes,7,opt,name=hints"` } // EndpointConditions represents the current condition of an endpoint. @@ -138,6 +145,20 @@ type EndpointConditions struct { Terminating *bool `json:"terminating,omitempty" protobuf:"bytes,3,name=terminating"` } +// EndpointHints provides hints describing how an endpoint should be consumed. +type EndpointHints struct { + // forZones indicates the zone(s) this endpoint should be consumed by to + // enable topology aware routing. May contain a maximum of 8 entries. + // +listType=atomic + ForZones []ForZone `json:"forZones,omitempty" protobuf:"bytes,1,name=forZones"` +} + +// ForZone provides information about which zones should consume this endpoint. +type ForZone struct { + // name represents the name of the zone. + Name string `json:"name" protobuf:"bytes,1,name=name"` +} + // EndpointPort represents a Port used by an EndpointSlice type EndpointPort struct { // The name of this port. All ports in an EndpointSlice must have a unique @@ -169,7 +190,9 @@ type EndpointPort struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.16 -// +k8s:prerelease-lifecycle-gen:deprecated=1.22 +// +k8s:prerelease-lifecycle-gen:deprecated=1.21 +// +k8s:prerelease-lifecycle-gen:removed=1.25 +// +k8s:prerelease-lifecycle-gen:replacement=discovery.k8s.io,v1,EndpointSlice // EndpointSliceList represents a list of endpoint slices type EndpointSliceList struct { diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go index d48b93d8b502..b4c221999ada 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go @@ -35,6 +35,7 @@ var map_Endpoint = map[string]string{ "targetRef": "targetRef is a reference to a Kubernetes object that represents this endpoint.", "topology": "topology contains arbitrary topology information associated with the endpoint. These key/value pairs must conform with the label format. https://kubernetes.io/docs/concepts/overview/working-with-objects/labels Topology may include a maximum of 16 key/value pairs. This includes, but is not limited to the following well known keys: * kubernetes.io/hostname: the value indicates the hostname of the node\n where the endpoint is located. This should match the corresponding\n node label.\n* topology.kubernetes.io/zone: the value indicates the zone where the\n endpoint is located. This should match the corresponding node label.\n* topology.kubernetes.io/region: the value indicates the region where the\n endpoint is located. This should match the corresponding node label.\nThis field is deprecated and will be removed in future api versions.", "nodeName": "nodeName represents the name of the Node hosting this endpoint. This can be used to determine endpoints local to a Node. This field can be enabled with the EndpointSliceNodeName feature gate.", + "hints": "hints contains information associated with how an endpoint should be consumed.", } func (Endpoint) SwaggerDoc() map[string]string { @@ -52,6 +53,15 @@ func (EndpointConditions) SwaggerDoc() map[string]string { return map_EndpointConditions } +var map_EndpointHints = map[string]string{ + "": "EndpointHints provides hints describing how an endpoint should be consumed.", + "forZones": "forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing. May contain a maximum of 8 entries.", +} + +func (EndpointHints) SwaggerDoc() map[string]string { + return map_EndpointHints +} + var map_EndpointPort = map[string]string{ "": "EndpointPort represents a Port used by an EndpointSlice", "name": "The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", @@ -86,4 +96,13 @@ func (EndpointSliceList) SwaggerDoc() map[string]string { return map_EndpointSliceList } +var map_ForZone = map[string]string{ + "": "ForZone provides information about which zones should consume this endpoint.", + "name": "name represents the name of the zone.", +} + +func (ForZone) SwaggerDoc() map[string]string { + return map_ForZone +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go index 7076553d291b..f13536b4bc6e 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go @@ -56,6 +56,11 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = new(string) **out = **in } + if in.Hints != nil { + in, out := &in.Hints, &out.Hints + *out = new(EndpointHints) + (*in).DeepCopyInto(*out) + } return } @@ -100,6 +105,27 @@ func (in *EndpointConditions) DeepCopy() *EndpointConditions { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointHints) DeepCopyInto(out *EndpointHints) { + *out = *in + if in.ForZones != nil { + in, out := &in.ForZones, &out.ForZones + *out = make([]ForZone, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointHints. +func (in *EndpointHints) DeepCopy() *EndpointHints { + if in == nil { + return nil + } + out := new(EndpointHints) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EndpointPort) DeepCopyInto(out *EndpointPort) { *out = *in @@ -208,3 +234,19 @@ func (in *EndpointSliceList) DeepCopyObject() runtime.Object { } return nil } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ForZone) DeepCopyInto(out *ForZone) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForZone. +func (in *ForZone) DeepCopy() *ForZone { + if in == nil { + return nil + } + out := new(ForZone) + in.DeepCopyInto(out) + return out +} diff --git a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/zz_generated.prerelease-lifecycle.go b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/zz_generated.prerelease-lifecycle.go index 09e94d0e8bb0..c0f2c63f09ac 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/zz_generated.prerelease-lifecycle.go +++ b/cluster-autoscaler/vendor/k8s.io/api/discovery/v1beta1/zz_generated.prerelease-lifecycle.go @@ -20,6 +20,10 @@ limitations under the License. package v1beta1 +import ( + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *EndpointSlice) APILifecycleIntroduced() (major, minor int) { @@ -29,7 +33,13 @@ func (in *EndpointSlice) APILifecycleIntroduced() (major, minor int) { // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. func (in *EndpointSlice) APILifecycleDeprecated() (major, minor int) { - return 1, 22 + return 1, 21 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *EndpointSlice) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "discovery.k8s.io", Version: "v1", Kind: "EndpointSlice"} } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. @@ -47,7 +57,13 @@ func (in *EndpointSliceList) APILifecycleIntroduced() (major, minor int) { // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. func (in *EndpointSliceList) APILifecycleDeprecated() (major, minor int) { - return 1, 22 + return 1, 21 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *EndpointSliceList) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "discovery.k8s.io", Version: "v1", Kind: "EndpointSlice"} } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. diff --git a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/generated.proto index 5e3d165ebe6a..a3e54810d627 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/generated.proto @@ -1237,6 +1237,7 @@ message ScaleStatus { // label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // +optional + // +mapType=atomic map selector = 2; // label selector for pods that should match the replicas count. This is a serializated diff --git a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types.go index f3479713c537..f9e7012ebe22 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types.go @@ -37,6 +37,7 @@ type ScaleStatus struct { // label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // +optional + // +mapType=atomic Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` // label selector for pods that should match the replicas count. This is a serializated @@ -73,6 +74,7 @@ type Scale struct { // +genclient // +genclient:method=GetScale,verb=get,subresource=scale,result=Scale // +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale +// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=Scale,result=Scale // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.1 // +k8s:prerelease-lifecycle-gen:deprecated=1.8 @@ -827,6 +829,7 @@ type IngressBackend struct { // +genclient // +genclient:method=GetScale,verb=get,subresource=scale,result=Scale // +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale +// +genclient:method=ApplyScale,verb=apply,subresource=scale,input=Scale,result=Scale // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.2 // +k8s:prerelease-lifecycle-gen:deprecated=1.8 diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/node/v1/generated.proto index 4a86999f1472..0b98cabb2f6f 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1/generated.proto @@ -97,6 +97,7 @@ message Scheduling { // with a pod's existing nodeSelector. Any conflicts will cause the pod to // be rejected in admission. // +optional + // +mapType=atomic map nodeSelector = 1; // tolerations are appended (excluding duplicates) to pods running with this diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/node/v1/types.go index b32cc36c4960..bfe947e1fcd4 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1/types.go @@ -82,6 +82,7 @@ type Scheduling struct { // with a pod's existing nodeSelector. Any conflicts will cause the pod to // be rejected in admission. // +optional + // +mapType=atomic NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,1,opt,name=nodeSelector"` // tolerations are appended (excluding duplicates) to pods running with this diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/generated.proto index 310ad490bf98..f88ae6f41a68 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/generated.proto @@ -84,8 +84,8 @@ message RuntimeClassSpec { // Overhead represents the resource overhead associated with running a pod for a // given RuntimeClass. For more details, see - // https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature. + // https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md + // This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature. // +optional optional Overhead overhead = 2; @@ -106,6 +106,7 @@ message Scheduling { // with a pod's existing nodeSelector. Any conflicts will cause the pod to // be rejected in admission. // +optional + // +mapType=atomic map nodeSelector = 1; // tolerations are appended (excluding duplicates) to pods running with this diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types.go b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types.go index 03e7e6f333bc..d0dd281bde27 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types.go @@ -62,8 +62,8 @@ type RuntimeClassSpec struct { // Overhead represents the resource overhead associated with running a pod for a // given RuntimeClass. For more details, see - // https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature. + // https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md + // This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature. // +optional Overhead *Overhead `json:"overhead,omitempty" protobuf:"bytes,2,opt,name=overhead"` @@ -91,6 +91,7 @@ type Scheduling struct { // with a pod's existing nodeSelector. Any conflicts will cause the pod to // be rejected in admission. // +optional + // +mapType=atomic NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,1,opt,name=nodeSelector"` // tolerations are appended (excluding duplicates) to pods running with this diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go index d3011466bb4c..244077e20f32 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go @@ -59,7 +59,7 @@ func (RuntimeClassList) SwaggerDoc() map[string]string { var map_RuntimeClassSpec = map[string]string{ "": "RuntimeClassSpec is a specification of a RuntimeClass. It contains parameters that are required to describe the RuntimeClass to the Container Runtime Interface (CRI) implementation, as well as any other components that need to understand how the pod will be run. The RuntimeClassSpec is immutable.", "runtimeHandler": "RuntimeHandler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The RuntimeHandler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.", - "overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature.", + "overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.", "scheduling": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.", } diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/generated.proto index 5c2d9d50afa0..1166e525b391 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/generated.proto @@ -63,8 +63,8 @@ message RuntimeClass { // Overhead represents the resource overhead associated with running a pod for a // given RuntimeClass. For more details, see - // https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature. + // https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md + // This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature. // +optional optional Overhead overhead = 3; @@ -96,6 +96,7 @@ message Scheduling { // with a pod's existing nodeSelector. Any conflicts will cause the pod to // be rejected in admission. // +optional + // +mapType=atomic map nodeSelector = 1; // tolerations are appended (excluding duplicates) to pods running with this diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types.go index 89559949ca5e..d2741bf626b7 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types.go @@ -54,8 +54,8 @@ type RuntimeClass struct { // Overhead represents the resource overhead associated with running a pod for a // given RuntimeClass. For more details, see - // https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature. + // https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md + // This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature. // +optional Overhead *Overhead `json:"overhead,omitempty" protobuf:"bytes,3,opt,name=overhead"` @@ -83,6 +83,7 @@ type Scheduling struct { // with a pod's existing nodeSelector. Any conflicts will cause the pod to // be rejected in admission. // +optional + // +mapType=atomic NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,1,opt,name=nodeSelector"` // tolerations are appended (excluding duplicates) to pods running with this diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go index a486147f0333..5a5422f94fcc 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go @@ -40,7 +40,7 @@ var map_RuntimeClass = map[string]string{ "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md", "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "handler": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.", - "overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature.", + "overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.", "scheduling": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.", } diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1/doc.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/doc.go new file mode 100644 index 000000000000..b46af58e43c4 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/doc.go @@ -0,0 +1,24 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:protobuf-gen=package +// +k8s:openapi-gen=true + +// Package policy is for any kind of policy object. Suitable examples, even if +// they aren't all here, are PodDisruptionBudget, PodSecurityPolicy, +// NetworkPolicy, etc. +package v1 // import "k8s.io/api/policy/v1" diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/generated.pb.go new file mode 100644 index 000000000000..183db076aa58 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/generated.pb.go @@ -0,0 +1,1681 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: k8s.io/kubernetes/vendor/k8s.io/api/policy/v1/generated.proto + +package v1 + +import ( + fmt "fmt" + + io "io" + + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func (m *Eviction) Reset() { *m = Eviction{} } +func (*Eviction) ProtoMessage() {} +func (*Eviction) Descriptor() ([]byte, []int) { + return fileDescriptor_2d50488813b2d18e, []int{0} +} +func (m *Eviction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Eviction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Eviction) XXX_Merge(src proto.Message) { + xxx_messageInfo_Eviction.Merge(m, src) +} +func (m *Eviction) XXX_Size() int { + return m.Size() +} +func (m *Eviction) XXX_DiscardUnknown() { + xxx_messageInfo_Eviction.DiscardUnknown(m) +} + +var xxx_messageInfo_Eviction proto.InternalMessageInfo + +func (m *PodDisruptionBudget) Reset() { *m = PodDisruptionBudget{} } +func (*PodDisruptionBudget) ProtoMessage() {} +func (*PodDisruptionBudget) Descriptor() ([]byte, []int) { + return fileDescriptor_2d50488813b2d18e, []int{1} +} +func (m *PodDisruptionBudget) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodDisruptionBudget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PodDisruptionBudget) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodDisruptionBudget.Merge(m, src) +} +func (m *PodDisruptionBudget) XXX_Size() int { + return m.Size() +} +func (m *PodDisruptionBudget) XXX_DiscardUnknown() { + xxx_messageInfo_PodDisruptionBudget.DiscardUnknown(m) +} + +var xxx_messageInfo_PodDisruptionBudget proto.InternalMessageInfo + +func (m *PodDisruptionBudgetList) Reset() { *m = PodDisruptionBudgetList{} } +func (*PodDisruptionBudgetList) ProtoMessage() {} +func (*PodDisruptionBudgetList) Descriptor() ([]byte, []int) { + return fileDescriptor_2d50488813b2d18e, []int{2} +} +func (m *PodDisruptionBudgetList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodDisruptionBudgetList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PodDisruptionBudgetList) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodDisruptionBudgetList.Merge(m, src) +} +func (m *PodDisruptionBudgetList) XXX_Size() int { + return m.Size() +} +func (m *PodDisruptionBudgetList) XXX_DiscardUnknown() { + xxx_messageInfo_PodDisruptionBudgetList.DiscardUnknown(m) +} + +var xxx_messageInfo_PodDisruptionBudgetList proto.InternalMessageInfo + +func (m *PodDisruptionBudgetSpec) Reset() { *m = PodDisruptionBudgetSpec{} } +func (*PodDisruptionBudgetSpec) ProtoMessage() {} +func (*PodDisruptionBudgetSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_2d50488813b2d18e, []int{3} +} +func (m *PodDisruptionBudgetSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodDisruptionBudgetSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PodDisruptionBudgetSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodDisruptionBudgetSpec.Merge(m, src) +} +func (m *PodDisruptionBudgetSpec) XXX_Size() int { + return m.Size() +} +func (m *PodDisruptionBudgetSpec) XXX_DiscardUnknown() { + xxx_messageInfo_PodDisruptionBudgetSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_PodDisruptionBudgetSpec proto.InternalMessageInfo + +func (m *PodDisruptionBudgetStatus) Reset() { *m = PodDisruptionBudgetStatus{} } +func (*PodDisruptionBudgetStatus) ProtoMessage() {} +func (*PodDisruptionBudgetStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_2d50488813b2d18e, []int{4} +} +func (m *PodDisruptionBudgetStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodDisruptionBudgetStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PodDisruptionBudgetStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodDisruptionBudgetStatus.Merge(m, src) +} +func (m *PodDisruptionBudgetStatus) XXX_Size() int { + return m.Size() +} +func (m *PodDisruptionBudgetStatus) XXX_DiscardUnknown() { + xxx_messageInfo_PodDisruptionBudgetStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_PodDisruptionBudgetStatus proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Eviction)(nil), "k8s.io.api.policy.v1.Eviction") + proto.RegisterType((*PodDisruptionBudget)(nil), "k8s.io.api.policy.v1.PodDisruptionBudget") + proto.RegisterType((*PodDisruptionBudgetList)(nil), "k8s.io.api.policy.v1.PodDisruptionBudgetList") + proto.RegisterType((*PodDisruptionBudgetSpec)(nil), "k8s.io.api.policy.v1.PodDisruptionBudgetSpec") + proto.RegisterType((*PodDisruptionBudgetStatus)(nil), "k8s.io.api.policy.v1.PodDisruptionBudgetStatus") + proto.RegisterMapType((map[string]v1.Time)(nil), "k8s.io.api.policy.v1.PodDisruptionBudgetStatus.DisruptedPodsEntry") +} + +func init() { + proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/policy/v1/generated.proto", fileDescriptor_2d50488813b2d18e) +} + +var fileDescriptor_2d50488813b2d18e = []byte{ + // 805 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0xdf, 0x8e, 0xdb, 0x44, + 0x14, 0xc6, 0xe3, 0x64, 0xb3, 0x2c, 0xd3, 0x24, 0x5a, 0x86, 0x02, 0x4b, 0x2e, 0x1c, 0x94, 0xab, + 0x05, 0xa9, 0x63, 0xb6, 0x45, 0x68, 0x85, 0x04, 0xa2, 0x6e, 0x56, 0x50, 0xd4, 0x25, 0xd5, 0x2c, + 0x08, 0x09, 0x81, 0xc4, 0xc4, 0x3e, 0xcd, 0x0e, 0xb1, 0x3d, 0xd6, 0xcc, 0xd8, 0x34, 0x57, 0xf0, + 0x08, 0xbc, 0x02, 0x8f, 0xc2, 0x15, 0x7b, 0x85, 0x7a, 0x59, 0x71, 0x11, 0xb1, 0xe6, 0x45, 0x90, + 0xc7, 0xce, 0x1f, 0x27, 0x59, 0x35, 0xe5, 0x82, 0x3b, 0xcf, 0x99, 0xf3, 0xfd, 0x8e, 0xcf, 0x37, + 0x67, 0x06, 0x7d, 0x3c, 0x39, 0x55, 0x84, 0x0b, 0x67, 0x92, 0x8c, 0x40, 0x46, 0xa0, 0x41, 0x39, + 0x29, 0x44, 0xbe, 0x90, 0x4e, 0xb9, 0xc1, 0x62, 0xee, 0xc4, 0x22, 0xe0, 0xde, 0xd4, 0x49, 0x4f, + 0x9c, 0x31, 0x44, 0x20, 0x99, 0x06, 0x9f, 0xc4, 0x52, 0x68, 0x81, 0x6f, 0x17, 0x59, 0x84, 0xc5, + 0x9c, 0x14, 0x59, 0x24, 0x3d, 0xe9, 0xde, 0x19, 0x73, 0x7d, 0x99, 0x8c, 0x88, 0x27, 0x42, 0x67, + 0x2c, 0xc6, 0xc2, 0x31, 0xc9, 0xa3, 0xe4, 0x89, 0x59, 0x99, 0x85, 0xf9, 0x2a, 0x20, 0xdd, 0x0f, + 0x96, 0xa5, 0x42, 0xe6, 0x5d, 0xf2, 0x08, 0xe4, 0xd4, 0x89, 0x27, 0xe3, 0x3c, 0xa0, 0x9c, 0x10, + 0x34, 0xdb, 0x52, 0xba, 0xeb, 0xdc, 0xa4, 0x92, 0x49, 0xa4, 0x79, 0x08, 0x1b, 0x82, 0x0f, 0x5f, + 0x24, 0x50, 0xde, 0x25, 0x84, 0x6c, 0x43, 0x77, 0xef, 0x26, 0x5d, 0xa2, 0x79, 0xe0, 0xf0, 0x48, + 0x2b, 0x2d, 0xd7, 0x45, 0xfd, 0xbf, 0x2c, 0x74, 0x70, 0x96, 0x72, 0x4f, 0x73, 0x11, 0xe1, 0x1f, + 0xd0, 0x41, 0xde, 0x85, 0xcf, 0x34, 0x3b, 0xb2, 0xde, 0xb1, 0x8e, 0x6f, 0xdd, 0x7d, 0x9f, 0x2c, + 0x8d, 0x5b, 0x40, 0x49, 0x3c, 0x19, 0xe7, 0x01, 0x45, 0xf2, 0x6c, 0x92, 0x9e, 0x90, 0xe1, 0xe8, + 0x47, 0xf0, 0xf4, 0x39, 0x68, 0xe6, 0xe2, 0xab, 0x59, 0xaf, 0x96, 0xcd, 0x7a, 0x68, 0x19, 0xa3, + 0x0b, 0x2a, 0x0e, 0x50, 0xdb, 0x87, 0x00, 0x34, 0x0c, 0xe3, 0xbc, 0xa2, 0x3a, 0xaa, 0x9b, 0x32, + 0xf7, 0x76, 0x2b, 0x33, 0x58, 0x95, 0xba, 0xaf, 0x65, 0xb3, 0x5e, 0xbb, 0x12, 0xa2, 0x55, 0x78, + 0xff, 0xb7, 0x3a, 0x7a, 0xfd, 0xb1, 0xf0, 0x07, 0x5c, 0xc9, 0xc4, 0x84, 0xdc, 0xc4, 0x1f, 0x83, + 0xfe, 0x1f, 0xfa, 0x1c, 0xa2, 0x3d, 0x15, 0x83, 0x57, 0xb6, 0x77, 0x87, 0x6c, 0x1b, 0x3f, 0xb2, + 0xe5, 0xd7, 0x2e, 0x62, 0xf0, 0xdc, 0x56, 0x89, 0xde, 0xcb, 0x57, 0xd4, 0x80, 0xf0, 0x37, 0x68, + 0x5f, 0x69, 0xa6, 0x13, 0x75, 0xd4, 0x30, 0x48, 0x67, 0x77, 0xa4, 0x91, 0xb9, 0x9d, 0x12, 0xba, + 0x5f, 0xac, 0x69, 0x89, 0xeb, 0xff, 0x61, 0xa1, 0xb7, 0xb6, 0xa8, 0x1e, 0x71, 0xa5, 0xf1, 0x77, + 0x1b, 0x3e, 0x91, 0xdd, 0x7c, 0xca, 0xd5, 0xc6, 0xa5, 0xc3, 0xb2, 0xea, 0xc1, 0x3c, 0xb2, 0xe2, + 0xd1, 0x97, 0xa8, 0xc9, 0x35, 0x84, 0xf9, 0x0c, 0x34, 0x8e, 0x6f, 0xdd, 0x7d, 0x77, 0xe7, 0x8e, + 0xdc, 0x76, 0x49, 0x6d, 0x3e, 0xcc, 0xf5, 0xb4, 0xc0, 0xf4, 0xff, 0xac, 0x6f, 0xed, 0x24, 0x37, + 0x11, 0x3f, 0x41, 0xad, 0x90, 0x47, 0xf7, 0x53, 0xc6, 0x03, 0x36, 0x0a, 0xe0, 0x85, 0xa7, 0x9e, + 0x5f, 0x19, 0x52, 0x5c, 0x19, 0xf2, 0x30, 0xd2, 0x43, 0x79, 0xa1, 0x25, 0x8f, 0xc6, 0xee, 0x61, + 0x36, 0xeb, 0xb5, 0xce, 0x57, 0x48, 0xb4, 0xc2, 0xc5, 0xdf, 0xa3, 0x03, 0x05, 0x01, 0x78, 0x5a, + 0xc8, 0x97, 0x1b, 0xed, 0x47, 0x6c, 0x04, 0xc1, 0x45, 0x29, 0x75, 0x5b, 0xb9, 0x65, 0xf3, 0x15, + 0x5d, 0x20, 0x71, 0x80, 0x3a, 0x21, 0x7b, 0xfa, 0x75, 0xc4, 0x16, 0x8d, 0x34, 0xfe, 0x63, 0x23, + 0x38, 0x9b, 0xf5, 0x3a, 0xe7, 0x15, 0x16, 0x5d, 0x63, 0xf7, 0x7f, 0x6f, 0xa2, 0xb7, 0x6f, 0x1c, + 0x28, 0xfc, 0x05, 0xc2, 0x62, 0xa4, 0x40, 0xa6, 0xe0, 0x7f, 0x56, 0x3c, 0x2a, 0x5c, 0x44, 0xc6, + 0xd8, 0x86, 0xdb, 0x2d, 0x0f, 0x08, 0x0f, 0x37, 0x32, 0xe8, 0x16, 0x15, 0xfe, 0x19, 0xb5, 0xfd, + 0xa2, 0x0a, 0xf8, 0x8f, 0x85, 0x3f, 0x1f, 0x09, 0xf7, 0x25, 0x87, 0x9c, 0x0c, 0x56, 0x21, 0x67, + 0x91, 0x96, 0x53, 0xf7, 0x8d, 0xf2, 0x57, 0xda, 0x95, 0x3d, 0x5a, 0xad, 0x97, 0x37, 0xe3, 0x2f, + 0x90, 0xea, 0x7e, 0x10, 0x88, 0x9f, 0xc0, 0x37, 0xe6, 0x36, 0x97, 0xcd, 0x0c, 0x36, 0x32, 0xe8, + 0x16, 0x15, 0xfe, 0x04, 0x75, 0xbc, 0x44, 0x4a, 0x88, 0xf4, 0xe7, 0xc0, 0x02, 0x7d, 0x39, 0x3d, + 0xda, 0x33, 0x9c, 0x37, 0x4b, 0x4e, 0xe7, 0x41, 0x65, 0x97, 0xae, 0x65, 0xe7, 0x7a, 0x1f, 0x14, + 0x97, 0xe0, 0xcf, 0xf5, 0xcd, 0xaa, 0x7e, 0x50, 0xd9, 0xa5, 0x6b, 0xd9, 0xf8, 0x14, 0xb5, 0xe0, + 0x69, 0x0c, 0xde, 0xdc, 0xcb, 0x7d, 0xa3, 0xbe, 0x5d, 0xaa, 0x5b, 0x67, 0x2b, 0x7b, 0xb4, 0x92, + 0x89, 0x3d, 0x84, 0x3c, 0x11, 0xf9, 0xbc, 0x78, 0x9a, 0x5f, 0x31, 0x67, 0xe0, 0xec, 0x36, 0xbf, + 0x0f, 0xe6, 0xba, 0xe5, 0xc3, 0xb8, 0x08, 0x29, 0xba, 0x82, 0xed, 0x06, 0x08, 0x6f, 0x1e, 0x13, + 0x3e, 0x44, 0x8d, 0x09, 0x4c, 0xcd, 0xf8, 0xbc, 0x4a, 0xf3, 0x4f, 0xfc, 0x29, 0x6a, 0xa6, 0x2c, + 0x48, 0xa0, 0xbc, 0x47, 0xef, 0xed, 0xf6, 0x1f, 0x5f, 0xf1, 0x10, 0x68, 0x21, 0xfc, 0xa8, 0x7e, + 0x6a, 0xb9, 0xc7, 0x57, 0xd7, 0x76, 0xed, 0xd9, 0xb5, 0x5d, 0x7b, 0x7e, 0x6d, 0xd7, 0x7e, 0xc9, + 0x6c, 0xeb, 0x2a, 0xb3, 0xad, 0x67, 0x99, 0x6d, 0x3d, 0xcf, 0x6c, 0xeb, 0xef, 0xcc, 0xb6, 0x7e, + 0xfd, 0xc7, 0xae, 0x7d, 0x5b, 0x4f, 0x4f, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xce, 0x1b, 0x9d, + 0x9f, 0x62, 0x08, 0x00, 0x00, +} + +func (m *Eviction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Eviction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Eviction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DeleteOptions != nil { + { + size, err := m.DeleteOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodDisruptionBudget) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodDisruptionBudget) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodDisruptionBudget) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodDisruptionBudgetList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodDisruptionBudgetList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodDisruptionBudgetList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodDisruptionBudgetSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodDisruptionBudgetSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodDisruptionBudgetSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxUnavailable != nil { + { + size, err := m.MaxUnavailable.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Selector != nil { + { + size, err := m.Selector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.MinAvailable != nil { + { + size, err := m.MinAvailable.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PodDisruptionBudgetStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodDisruptionBudgetStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodDisruptionBudgetStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.ExpectedPods)) + i-- + dAtA[i] = 0x30 + i = encodeVarintGenerated(dAtA, i, uint64(m.DesiredHealthy)) + i-- + dAtA[i] = 0x28 + i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentHealthy)) + i-- + dAtA[i] = 0x20 + i = encodeVarintGenerated(dAtA, i, uint64(m.DisruptionsAllowed)) + i-- + dAtA[i] = 0x18 + if len(m.DisruptedPods) > 0 { + keysForDisruptedPods := make([]string, 0, len(m.DisruptedPods)) + for k := range m.DisruptedPods { + keysForDisruptedPods = append(keysForDisruptedPods, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForDisruptedPods) + for iNdEx := len(keysForDisruptedPods) - 1; iNdEx >= 0; iNdEx-- { + v := m.DisruptedPods[string(keysForDisruptedPods[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForDisruptedPods[iNdEx]) + copy(dAtA[i:], keysForDisruptedPods[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForDisruptedPods[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.ObservedGeneration)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Eviction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.DeleteOptions != nil { + l = m.DeleteOptions.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodDisruptionBudget) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PodDisruptionBudgetList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodDisruptionBudgetSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinAvailable != nil { + l = m.MinAvailable.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Selector != nil { + l = m.Selector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MaxUnavailable != nil { + l = m.MaxUnavailable.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodDisruptionBudgetStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.ObservedGeneration)) + if len(m.DisruptedPods) > 0 { + for k, v := range m.DisruptedPods { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + n += 1 + sovGenerated(uint64(m.DisruptionsAllowed)) + n += 1 + sovGenerated(uint64(m.CurrentHealthy)) + n += 1 + sovGenerated(uint64(m.DesiredHealthy)) + n += 1 + sovGenerated(uint64(m.ExpectedPods)) + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Eviction) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Eviction{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `DeleteOptions:` + strings.Replace(fmt.Sprintf("%v", this.DeleteOptions), "DeleteOptions", "v1.DeleteOptions", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudget) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodDisruptionBudget{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodDisruptionBudgetSpec", "PodDisruptionBudgetSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodDisruptionBudgetStatus", "PodDisruptionBudgetStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudgetList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]PodDisruptionBudget{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PodDisruptionBudget", "PodDisruptionBudget", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&PodDisruptionBudgetList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudgetSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodDisruptionBudgetSpec{`, + `MinAvailable:` + strings.Replace(fmt.Sprintf("%v", this.MinAvailable), "IntOrString", "intstr.IntOrString", 1) + `,`, + `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "v1.LabelSelector", 1) + `,`, + `MaxUnavailable:` + strings.Replace(fmt.Sprintf("%v", this.MaxUnavailable), "IntOrString", "intstr.IntOrString", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudgetStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + keysForDisruptedPods := make([]string, 0, len(this.DisruptedPods)) + for k := range this.DisruptedPods { + keysForDisruptedPods = append(keysForDisruptedPods, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForDisruptedPods) + mapStringForDisruptedPods := "map[string]v1.Time{" + for _, k := range keysForDisruptedPods { + mapStringForDisruptedPods += fmt.Sprintf("%v: %v,", k, this.DisruptedPods[k]) + } + mapStringForDisruptedPods += "}" + s := strings.Join([]string{`&PodDisruptionBudgetStatus{`, + `ObservedGeneration:` + fmt.Sprintf("%v", this.ObservedGeneration) + `,`, + `DisruptedPods:` + mapStringForDisruptedPods + `,`, + `DisruptionsAllowed:` + fmt.Sprintf("%v", this.DisruptionsAllowed) + `,`, + `CurrentHealthy:` + fmt.Sprintf("%v", this.CurrentHealthy) + `,`, + `DesiredHealthy:` + fmt.Sprintf("%v", this.DesiredHealthy) + `,`, + `ExpectedPods:` + fmt.Sprintf("%v", this.ExpectedPods) + `,`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Eviction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Eviction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Eviction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DeleteOptions == nil { + m.DeleteOptions = &v1.DeleteOptions{} + } + if err := m.DeleteOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudget: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudget: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudgetList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudgetList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PodDisruptionBudget{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudgetSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudgetSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinAvailable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MinAvailable == nil { + m.MinAvailable = &intstr.IntOrString{} + } + if err := m.MinAvailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Selector == nil { + m.Selector = &v1.LabelSelector{} + } + if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxUnavailable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MaxUnavailable == nil { + m.MaxUnavailable = &intstr.IntOrString{} + } + if err := m.MaxUnavailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudgetStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudgetStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) + } + m.ObservedGeneration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ObservedGeneration |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptedPods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptedPods == nil { + m.DisruptedPods = make(map[string]v1.Time) + } + var mapkey string + mapvalue := &v1.Time{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &v1.Time{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.DisruptedPods[mapkey] = *mapvalue + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionsAllowed", wireType) + } + m.DisruptionsAllowed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DisruptionsAllowed |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentHealthy", wireType) + } + m.CurrentHealthy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentHealthy |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DesiredHealthy", wireType) + } + m.DesiredHealthy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DesiredHealthy |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedPods", wireType) + } + m.ExpectedPods = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpectedPods |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") +) diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/generated.proto new file mode 100644 index 000000000000..5b798423564c --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/generated.proto @@ -0,0 +1,151 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +syntax = "proto2"; + +package k8s.io.api.policy.v1; + +import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; +import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; + +// Package-wide variables from generator "generated". +option go_package = "v1"; + +// Eviction evicts a pod from its node subject to certain policies and safety constraints. +// This is a subresource of Pod. A request to cause such an eviction is +// created by POSTing to .../pods//evictions. +message Eviction { + // ObjectMeta describes the pod that is being evicted. + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // DeleteOptions may be provided + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2; +} + +// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods +message PodDisruptionBudget { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Specification of the desired behavior of the PodDisruptionBudget. + // +optional + optional PodDisruptionBudgetSpec spec = 2; + + // Most recently observed status of the PodDisruptionBudget. + // +optional + optional PodDisruptionBudgetStatus status = 3; +} + +// PodDisruptionBudgetList is a collection of PodDisruptionBudgets. +message PodDisruptionBudgetList { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is a list of PodDisruptionBudgets + repeated PodDisruptionBudget items = 2; +} + +// PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. +message PodDisruptionBudgetSpec { + // An eviction is allowed if at least "minAvailable" pods selected by + // "selector" will still be available after the eviction, i.e. even in the + // absence of the evicted pod. So for example you can prevent all voluntary + // evictions by specifying "100%". + // +optional + optional k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1; + + // Label query over pods whose evictions are managed by the disruption + // budget. + // A null selector will match no pods, while an empty ({}) selector will select + // all pods within the namespace. + // +patchStrategy=replace + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; + + // An eviction is allowed if at most "maxUnavailable" pods selected by + // "selector" are unavailable after the eviction, i.e. even in absence of + // the evicted pod. For example, one can prevent all voluntary evictions + // by specifying 0. This is a mutually exclusive setting with "minAvailable". + // +optional + optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3; +} + +// PodDisruptionBudgetStatus represents information about the status of a +// PodDisruptionBudget. Status may trail the actual state of a system. +message PodDisruptionBudgetStatus { + // Most recent generation observed when updating this PDB status. DisruptionsAllowed and other + // status information is valid only if observedGeneration equals to PDB's object generation. + // +optional + optional int64 observedGeneration = 1; + + // DisruptedPods contains information about pods whose eviction was + // processed by the API server eviction subresource handler but has not + // yet been observed by the PodDisruptionBudget controller. + // A pod will be in this map from the time when the API server processed the + // eviction request to the time when the pod is seen by PDB controller + // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod + // and the value is the time when the API server processed the eviction request. If + // the deletion didn't occur and a pod is still there it will be removed from + // the list automatically by PodDisruptionBudget controller after some time. + // If everything goes smooth this map should be empty for the most of the time. + // Large number of entries in the map may indicate problems with pod deletions. + // +optional + map disruptedPods = 2; + + // Number of pod disruptions that are currently allowed. + optional int32 disruptionsAllowed = 3; + + // current number of healthy pods + optional int32 currentHealthy = 4; + + // minimum desired number of healthy pods + optional int32 desiredHealthy = 5; + + // total number of pods counted by this disruption budget + optional int32 expectedPods = 6; + + // Conditions contain conditions for PDB. The disruption controller sets the + // DisruptionAllowed condition. The following are known values for the reason field + // (additional reasons could be added in the future): + // - SyncFailed: The controller encountered an error and wasn't able to compute + // the number of allowed disruptions. Therefore no disruptions are + // allowed and the status of the condition will be False. + // - InsufficientPods: The number of pods are either at or below the number + // required by the PodDisruptionBudget. No disruptions are + // allowed and the status of the condition will be False. + // - SufficientPods: There are more pods than required by the PodDisruptionBudget. + // The condition will be True, and the number of allowed + // disruptions are provided by the disruptionsAllowed property. + // + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7; +} + diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1/register.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/register.go new file mode 100644 index 000000000000..7fb9fd3e1f11 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/register.go @@ -0,0 +1,52 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name use in this package +const GroupName = "policy" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &PodDisruptionBudget{}, + &PodDisruptionBudgetList{}, + &Eviction{}, + ) + // Add the watch version that applies + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/types.go new file mode 100644 index 000000000000..4a03696f000d --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/types.go @@ -0,0 +1,172 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" +) + +// DisruptionBudgetCause is the status cause returned for eviction failures caused by PodDisruptionBudget violations. +const DisruptionBudgetCause metav1.CauseType = "DisruptionBudget" + +// PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. +type PodDisruptionBudgetSpec struct { + // An eviction is allowed if at least "minAvailable" pods selected by + // "selector" will still be available after the eviction, i.e. even in the + // absence of the evicted pod. So for example you can prevent all voluntary + // evictions by specifying "100%". + // +optional + MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty" protobuf:"bytes,1,opt,name=minAvailable"` + + // Label query over pods whose evictions are managed by the disruption + // budget. + // A null selector will match no pods, while an empty ({}) selector will select + // all pods within the namespace. + // +patchStrategy=replace + // +optional + Selector *metav1.LabelSelector `json:"selector,omitempty" patchStrategy:"replace" protobuf:"bytes,2,opt,name=selector"` + + // An eviction is allowed if at most "maxUnavailable" pods selected by + // "selector" are unavailable after the eviction, i.e. even in absence of + // the evicted pod. For example, one can prevent all voluntary evictions + // by specifying 0. This is a mutually exclusive setting with "minAvailable". + // +optional + MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,3,opt,name=maxUnavailable"` +} + +// PodDisruptionBudgetStatus represents information about the status of a +// PodDisruptionBudget. Status may trail the actual state of a system. +type PodDisruptionBudgetStatus struct { + // Most recent generation observed when updating this PDB status. DisruptionsAllowed and other + // status information is valid only if observedGeneration equals to PDB's object generation. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"` + + // DisruptedPods contains information about pods whose eviction was + // processed by the API server eviction subresource handler but has not + // yet been observed by the PodDisruptionBudget controller. + // A pod will be in this map from the time when the API server processed the + // eviction request to the time when the pod is seen by PDB controller + // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod + // and the value is the time when the API server processed the eviction request. If + // the deletion didn't occur and a pod is still there it will be removed from + // the list automatically by PodDisruptionBudget controller after some time. + // If everything goes smooth this map should be empty for the most of the time. + // Large number of entries in the map may indicate problems with pod deletions. + // +optional + DisruptedPods map[string]metav1.Time `json:"disruptedPods,omitempty" protobuf:"bytes,2,rep,name=disruptedPods"` + + // Number of pod disruptions that are currently allowed. + DisruptionsAllowed int32 `json:"disruptionsAllowed" protobuf:"varint,3,opt,name=disruptionsAllowed"` + + // current number of healthy pods + CurrentHealthy int32 `json:"currentHealthy" protobuf:"varint,4,opt,name=currentHealthy"` + + // minimum desired number of healthy pods + DesiredHealthy int32 `json:"desiredHealthy" protobuf:"varint,5,opt,name=desiredHealthy"` + + // total number of pods counted by this disruption budget + ExpectedPods int32 `json:"expectedPods" protobuf:"varint,6,opt,name=expectedPods"` + + // Conditions contain conditions for PDB. The disruption controller sets the + // DisruptionAllowed condition. The following are known values for the reason field + // (additional reasons could be added in the future): + // - SyncFailed: The controller encountered an error and wasn't able to compute + // the number of allowed disruptions. Therefore no disruptions are + // allowed and the status of the condition will be False. + // - InsufficientPods: The number of pods are either at or below the number + // required by the PodDisruptionBudget. No disruptions are + // allowed and the status of the condition will be False. + // - SufficientPods: There are more pods than required by the PodDisruptionBudget. + // The condition will be True, and the number of allowed + // disruptions are provided by the disruptionsAllowed property. + // + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,7,rep,name=conditions"` +} + +const ( + // DisruptionAllowedCondition is a condition set by the disruption controller + // that signal whether any of the pods covered by the PDB can be disrupted. + DisruptionAllowedCondition = "DisruptionAllowed" + + // SyncFailedReason is set on the DisruptionAllowed condition if reconcile + // of the PDB failed and therefore disruption of pods are not allowed. + SyncFailedReason = "SyncFailed" + // SufficientPodsReason is set on the DisruptionAllowed condition if there are + // more pods covered by the PDB than required and at least one can be disrupted. + SufficientPodsReason = "SufficientPods" + // InsufficientPodsReason is set on the DisruptionAllowed condition if the number + // of pods are equal to or fewer than required by the PDB. + InsufficientPodsReason = "InsufficientPods" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods +type PodDisruptionBudget struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Specification of the desired behavior of the PodDisruptionBudget. + // +optional + Spec PodDisruptionBudgetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + // Most recently observed status of the PodDisruptionBudget. + // +optional + Status PodDisruptionBudgetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PodDisruptionBudgetList is a collection of PodDisruptionBudgets. +type PodDisruptionBudgetList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // Items is a list of PodDisruptionBudgets + Items []PodDisruptionBudget `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +genclient +// +genclient:noVerbs +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Eviction evicts a pod from its node subject to certain policies and safety constraints. +// This is a subresource of Pod. A request to cause such an eviction is +// created by POSTing to .../pods//evictions. +type Eviction struct { + metav1.TypeMeta `json:",inline"` + + // ObjectMeta describes the pod that is being evicted. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // DeleteOptions may be provided + // +optional + DeleteOptions *metav1.DeleteOptions `json:"deleteOptions,omitempty" protobuf:"bytes,2,opt,name=deleteOptions"` +} diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go new file mode 100644 index 000000000000..3208392e8808 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-generated-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_Eviction = map[string]string{ + "": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions.", + "metadata": "ObjectMeta describes the pod that is being evicted.", + "deleteOptions": "DeleteOptions may be provided", +} + +func (Eviction) SwaggerDoc() map[string]string { + return map_Eviction +} + +var map_PodDisruptionBudget = map[string]string{ + "": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Specification of the desired behavior of the PodDisruptionBudget.", + "status": "Most recently observed status of the PodDisruptionBudget.", +} + +func (PodDisruptionBudget) SwaggerDoc() map[string]string { + return map_PodDisruptionBudget +} + +var map_PodDisruptionBudgetList = map[string]string{ + "": "PodDisruptionBudgetList is a collection of PodDisruptionBudgets.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "Items is a list of PodDisruptionBudgets", +} + +func (PodDisruptionBudgetList) SwaggerDoc() map[string]string { + return map_PodDisruptionBudgetList +} + +var map_PodDisruptionBudgetSpec = map[string]string{ + "": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.", + "minAvailable": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".", + "selector": "Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.", + "maxUnavailable": "An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".", +} + +func (PodDisruptionBudgetSpec) SwaggerDoc() map[string]string { + return map_PodDisruptionBudgetSpec +} + +var map_PodDisruptionBudgetStatus = map[string]string{ + "": "PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.", + "observedGeneration": "Most recent generation observed when updating this PDB status. DisruptionsAllowed and other status information is valid only if observedGeneration equals to PDB's object generation.", + "disruptedPods": "DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by PDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn't occur and a pod is still there it will be removed from the list automatically by PodDisruptionBudget controller after some time. If everything goes smooth this map should be empty for the most of the time. Large number of entries in the map may indicate problems with pod deletions.", + "disruptionsAllowed": "Number of pod disruptions that are currently allowed.", + "currentHealthy": "current number of healthy pods", + "desiredHealthy": "minimum desired number of healthy pods", + "expectedPods": "total number of pods counted by this disruption budget", + "conditions": "Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute\n the number of allowed disruptions. Therefore no disruptions are\n allowed and the status of the condition will be False.\n- InsufficientPods: The number of pods are either at or below the number\n required by the PodDisruptionBudget. No disruptions are\n allowed and the status of the condition will be False.\n- SufficientPods: There are more pods than required by the PodDisruptionBudget.\n The condition will be True, and the number of allowed\n disruptions are provided by the disruptionsAllowed property.", +} + +func (PodDisruptionBudgetStatus) SwaggerDoc() map[string]string { + return map_PodDisruptionBudgetStatus +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..9b7aac2f1984 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1/zz_generated.deepcopy.go @@ -0,0 +1,180 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Eviction) DeepCopyInto(out *Eviction) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.DeleteOptions != nil { + in, out := &in.DeleteOptions, &out.DeleteOptions + *out = new(metav1.DeleteOptions) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Eviction. +func (in *Eviction) DeepCopy() *Eviction { + if in == nil { + return nil + } + out := new(Eviction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Eviction) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodDisruptionBudget) DeepCopyInto(out *PodDisruptionBudget) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDisruptionBudget. +func (in *PodDisruptionBudget) DeepCopy() *PodDisruptionBudget { + if in == nil { + return nil + } + out := new(PodDisruptionBudget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodDisruptionBudget) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodDisruptionBudgetList) DeepCopyInto(out *PodDisruptionBudgetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PodDisruptionBudget, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDisruptionBudgetList. +func (in *PodDisruptionBudgetList) DeepCopy() *PodDisruptionBudgetList { + if in == nil { + return nil + } + out := new(PodDisruptionBudgetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodDisruptionBudgetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodDisruptionBudgetSpec) DeepCopyInto(out *PodDisruptionBudgetSpec) { + *out = *in + if in.MinAvailable != nil { + in, out := &in.MinAvailable, &out.MinAvailable + *out = new(intstr.IntOrString) + **out = **in + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.MaxUnavailable != nil { + in, out := &in.MaxUnavailable, &out.MaxUnavailable + *out = new(intstr.IntOrString) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDisruptionBudgetSpec. +func (in *PodDisruptionBudgetSpec) DeepCopy() *PodDisruptionBudgetSpec { + if in == nil { + return nil + } + out := new(PodDisruptionBudgetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodDisruptionBudgetStatus) DeepCopyInto(out *PodDisruptionBudgetStatus) { + *out = *in + if in.DisruptedPods != nil { + in, out := &in.DisruptedPods, &out.DisruptedPods + *out = make(map[string]metav1.Time, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodDisruptionBudgetStatus. +func (in *PodDisruptionBudgetStatus) DeepCopy() *PodDisruptionBudgetStatus { + if in == nil { + return nil + } + out := new(PodDisruptionBudgetStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/generated.proto index b42ca8d05acc..a47212142dc7 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/generated.proto @@ -136,6 +136,10 @@ message PodDisruptionBudgetSpec { // Label query over pods whose evictions are managed by the disruption // budget. + // A null selector selects no pods. + // An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. + // In policy/v1, an empty selector will select all pods in the namespace. + // +patchStrategy=replace // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types.go index 84c9eacf7f0f..2811044518e2 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types.go @@ -33,8 +33,12 @@ type PodDisruptionBudgetSpec struct { // Label query over pods whose evictions are managed by the disruption // budget. + // A null selector selects no pods. + // An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. + // In policy/v1, an empty selector will select all pods in the namespace. + // +patchStrategy=replace // +optional - Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"` + Selector *metav1.LabelSelector `json:"selector,omitempty" patchStrategy:"replace" protobuf:"bytes,2,opt,name=selector"` // An eviction is allowed if at most "maxUnavailable" pods selected by // "selector" are unavailable after the eviction, i.e. even in absence of @@ -118,7 +122,9 @@ const ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.5 -// +k8s:prerelease-lifecycle-gen:deprecated=1.22 +// +k8s:prerelease-lifecycle-gen:deprecated=1.21 +// +k8s:prerelease-lifecycle-gen:removed=1.25 +// +k8s:prerelease-lifecycle-gen:replacement=policy,v1,PodDisruptionBudget // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudget struct { @@ -136,7 +142,9 @@ type PodDisruptionBudget struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.5 -// +k8s:prerelease-lifecycle-gen:deprecated=1.22 +// +k8s:prerelease-lifecycle-gen:deprecated=1.21 +// +k8s:prerelease-lifecycle-gen:removed=1.25 +// +k8s:prerelease-lifecycle-gen:replacement=policy,v1,PodDisruptionBudgetList // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. type PodDisruptionBudgetList struct { diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go index 590d8721c486..0853a5e99669 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go @@ -116,7 +116,7 @@ func (PodDisruptionBudgetList) SwaggerDoc() map[string]string { var map_PodDisruptionBudgetSpec = map[string]string{ "": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.", "minAvailable": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".", - "selector": "Label query over pods whose evictions are managed by the disruption budget.", + "selector": "Label query over pods whose evictions are managed by the disruption budget. A null selector selects no pods. An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. In policy/v1, an empty selector will select all pods in the namespace.", "maxUnavailable": "An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".", } diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/zz_generated.prerelease-lifecycle.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/zz_generated.prerelease-lifecycle.go index 18936137efda..8bda4b00f24f 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/zz_generated.prerelease-lifecycle.go +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/zz_generated.prerelease-lifecycle.go @@ -20,6 +20,10 @@ limitations under the License. package v1beta1 +import ( + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *Eviction) APILifecycleIntroduced() (major, minor int) { @@ -47,7 +51,13 @@ func (in *PodDisruptionBudget) APILifecycleIntroduced() (major, minor int) { // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. func (in *PodDisruptionBudget) APILifecycleDeprecated() (major, minor int) { - return 1, 22 + return 1, 21 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *PodDisruptionBudget) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "policy", Version: "v1", Kind: "PodDisruptionBudget"} } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. @@ -65,7 +75,13 @@ func (in *PodDisruptionBudgetList) APILifecycleIntroduced() (major, minor int) { // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. func (in *PodDisruptionBudgetList) APILifecycleDeprecated() (major, minor int) { - return 1, 22 + return 1, 21 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *PodDisruptionBudgetList) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "policy", Version: "v1", Kind: "PodDisruptionBudgetList"} } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. diff --git a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/generated.proto index 22c6dae4b035..db8fd427cdc0 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/generated.proto @@ -92,7 +92,7 @@ message ClusterRoleList { // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. message PolicyRule { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. + // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs. repeated string verbs = 1; // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of @@ -100,7 +100,7 @@ message PolicyRule { // +optional repeated string apiGroups = 2; - // Resources is a list of resources this rule applies to. ResourceAll represents all resources. + // Resources is a list of resources this rule applies to. '*' represents all resources. // +optional repeated string resources = 3; @@ -164,6 +164,7 @@ message RoleList { } // RoleRef contains information that points to the role being used +// +structType=atomic message RoleRef { // APIGroup is the group for the resource being referenced optional string apiGroup = 1; @@ -177,6 +178,7 @@ message RoleRef { // Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, // or a value for non-objects such as user and group names. +// +structType=atomic message Subject { // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. diff --git a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/types.go index 7ba7d05435e1..038baf61b531 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/types.go @@ -47,14 +47,14 @@ const ( // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. type PolicyRule struct { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. + // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs. Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. // +optional APIGroups []string `json:"apiGroups,omitempty" protobuf:"bytes,2,rep,name=apiGroups"` - // Resources is a list of resources this rule applies to. ResourceAll represents all resources. + // Resources is a list of resources this rule applies to. '*' represents all resources. // +optional Resources []string `json:"resources,omitempty" protobuf:"bytes,3,rep,name=resources"` // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. @@ -70,6 +70,7 @@ type PolicyRule struct { // Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, // or a value for non-objects such as user and group names. +// +structType=atomic type Subject struct { // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. @@ -88,6 +89,7 @@ type Subject struct { } // RoleRef contains information that points to the role being used +// +structType=atomic type RoleRef struct { // APIGroup is the group for the resource being referenced APIGroup string `json:"apiGroup" protobuf:"bytes,1,opt,name=apiGroup"` diff --git a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/types_swagger_doc_generated.go index 83ce310e6fa3..664cf95f84e3 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1/types_swagger_doc_generated.go @@ -80,9 +80,9 @@ func (ClusterRoleList) SwaggerDoc() map[string]string { var map_PolicyRule = map[string]string{ "": "PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.", - "verbs": "Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds.", + "verbs": "Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs.", "apiGroups": "APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed.", - "resources": "Resources is a list of resources this rule applies to. ResourceAll represents all resources.", + "resources": "Resources is a list of resources this rule applies to. '*' represents all resources.", "resourceNames": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", "nonResourceURLs": "NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.", } diff --git a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/generated.proto index caed7ec3069d..9dea00e05e7f 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/generated.proto @@ -96,7 +96,7 @@ message ClusterRoleList { // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. message PolicyRule { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. + // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs. repeated string verbs = 1; // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of @@ -104,7 +104,7 @@ message PolicyRule { // +optional repeated string apiGroups = 3; - // Resources is a list of resources this rule applies to. ResourceAll represents all resources. + // Resources is a list of resources this rule applies to. '*' represents all resources. // +optional repeated string resources = 4; diff --git a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/types.go b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/types.go index 538ae4c9b0aa..57d993caab9a 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/types.go @@ -47,14 +47,14 @@ const ( // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. type PolicyRule struct { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. + // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs. Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. // +optional APIGroups []string `json:"apiGroups,omitempty" protobuf:"bytes,3,rep,name=apiGroups"` - // Resources is a list of resources this rule applies to. ResourceAll represents all resources. + // Resources is a list of resources this rule applies to. '*' represents all resources. // +optional Resources []string `json:"resources,omitempty" protobuf:"bytes,4,rep,name=resources"` // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. diff --git a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go index acb84478253b..8fc984ad565f 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go @@ -80,9 +80,9 @@ func (ClusterRoleList) SwaggerDoc() map[string]string { var map_PolicyRule = map[string]string{ "": "PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.", - "verbs": "Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds.", + "verbs": "Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs.", "apiGroups": "APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed.", - "resources": "Resources is a list of resources this rule applies to. ResourceAll represents all resources.", + "resources": "Resources is a list of resources this rule applies to. '*' represents all resources.", "resourceNames": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", "nonResourceURLs": "NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.", } diff --git a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/generated.proto index 17d3741f0c80..fb975e2eab8a 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/generated.proto @@ -96,7 +96,7 @@ message ClusterRoleList { // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. message PolicyRule { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. + // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs. repeated string verbs = 1; // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of diff --git a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/types.go index f16788811951..ad8391fd71fe 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/types.go @@ -47,7 +47,7 @@ const ( // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. type PolicyRule struct { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. + // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs. Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of diff --git a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go index 0512301f5af5..eef80f834c89 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go @@ -80,7 +80,7 @@ func (ClusterRoleList) SwaggerDoc() map[string]string { var map_PolicyRule = map[string]string{ "": "PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.", - "verbs": "Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds.", + "verbs": "Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs.", "apiGroups": "APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed.", "resources": "Resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. '*/foo' represents the subresource 'foo' for all resources in the specified apiGroups.", "resourceNames": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", diff --git a/cluster-autoscaler/vendor/k8s.io/api/storage/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/storage/v1/generated.proto index 46ac1fcb814d..a24e5df6449c 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/storage/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/storage/v1/generated.proto @@ -72,6 +72,9 @@ message CSIDriverSpec { // If the CSIDriverRegistry feature gate is enabled and the value is // specified to false, the attach operation will be skipped. // Otherwise the attach operation will be called. + // + // This field is immutable. + // // +optional optional bool attachRequired = 1; @@ -99,6 +102,9 @@ message CSIDriverSpec { // As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when // deployed on such a cluster and the deployment determines which mode that is, for example // via a command line parameter of the driver. + // + // This field is immutable. + // // +optional optional bool podInfoOnMount = 2; @@ -115,6 +121,9 @@ message CSIDriverSpec { // A driver can support one or more of these modes and // more modes may be added in the future. // This field is beta. + // + // This field is immutable. + // // +optional // +listType=set repeated string volumeLifecycleModes = 3; @@ -133,6 +142,8 @@ message CSIDriverSpec { // unset or false and it can be flipped later when storage // capacity information has been published. // + // This field is immutable. + // // This is a beta field and only available when the CSIStorageCapacity // feature is enabled. The default is false. // @@ -143,8 +154,15 @@ message CSIDriverSpec { // Defines if the underlying volume supports changing ownership and // permission of the volume before being mounted. // Refer to the specific FSGroupPolicy values for additional details. - // This field is alpha-level, and is only honored by servers + // This field is beta, and is only honored by servers // that enable the CSIVolumeFSGroupPolicy feature gate. + // + // This field is immutable. + // + // Defaults to ReadWriteOnceWithFSType, which will examine each volume + // to determine if Kubernetes should modify ownership and permissions of the volume. + // With the default policy the defined fsGroup will only be applied + // if a fstype is defined and the volume's access mode contains ReadWriteOnce. // +optional optional string fsGroupPolicy = 5; @@ -164,7 +182,7 @@ message CSIDriverSpec { // most one token is empty string. To receive a new token after expiry, // RequiresRepublish can be used to trigger NodePublishVolume periodically. // - // This is an alpha feature and only available when the + // This is a beta feature and only available when the // CSIServiceAccountToken feature is enabled. // // +optional @@ -179,7 +197,7 @@ message CSIDriverSpec { // to NodePublishVolume should only update the contents of the volume. New // mount points will not be seen by a running container. // - // This is an alpha feature and only available when the + // This is a beta feature and only available when the // CSIServiceAccountToken feature is enabled. // // +optional @@ -305,6 +323,7 @@ message StorageClass { // An empty TopologySelectorTerm list means there is no topology restriction. // This field is only honored by servers that enable the VolumeScheduling feature. // +optional + // +listType=atomic repeated k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8; } diff --git a/cluster-autoscaler/vendor/k8s.io/api/storage/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/storage/v1/types.go index ba27fa36852f..d03a7417da03 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/storage/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/storage/v1/types.go @@ -71,6 +71,7 @@ type StorageClass struct { // An empty TopologySelectorTerm list means there is no topology restriction. // This field is only honored by servers that enable the VolumeScheduling feature. // +optional + // +listType=atomic AllowedTopologies []v1.TopologySelectorTerm `json:"allowedTopologies,omitempty" protobuf:"bytes,8,rep,name=allowedTopologies"` } @@ -270,6 +271,9 @@ type CSIDriverSpec struct { // If the CSIDriverRegistry feature gate is enabled and the value is // specified to false, the attach operation will be skipped. // Otherwise the attach operation will be called. + // + // This field is immutable. + // // +optional AttachRequired *bool `json:"attachRequired,omitempty" protobuf:"varint,1,opt,name=attachRequired"` @@ -297,6 +301,9 @@ type CSIDriverSpec struct { // As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when // deployed on such a cluster and the deployment determines which mode that is, for example // via a command line parameter of the driver. + // + // This field is immutable. + // // +optional PodInfoOnMount *bool `json:"podInfoOnMount,omitempty" protobuf:"bytes,2,opt,name=podInfoOnMount"` @@ -313,6 +320,9 @@ type CSIDriverSpec struct { // A driver can support one or more of these modes and // more modes may be added in the future. // This field is beta. + // + // This field is immutable. + // // +optional // +listType=set VolumeLifecycleModes []VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty" protobuf:"bytes,3,opt,name=volumeLifecycleModes"` @@ -331,6 +341,8 @@ type CSIDriverSpec struct { // unset or false and it can be flipped later when storage // capacity information has been published. // + // This field is immutable. + // // This is a beta field and only available when the CSIStorageCapacity // feature is enabled. The default is false. // @@ -341,8 +353,15 @@ type CSIDriverSpec struct { // Defines if the underlying volume supports changing ownership and // permission of the volume before being mounted. // Refer to the specific FSGroupPolicy values for additional details. - // This field is alpha-level, and is only honored by servers + // This field is beta, and is only honored by servers // that enable the CSIVolumeFSGroupPolicy feature gate. + // + // This field is immutable. + // + // Defaults to ReadWriteOnceWithFSType, which will examine each volume + // to determine if Kubernetes should modify ownership and permissions of the volume. + // With the default policy the defined fsGroup will only be applied + // if a fstype is defined and the volume's access mode contains ReadWriteOnce. // +optional FSGroupPolicy *FSGroupPolicy `json:"fsGroupPolicy,omitempty" protobuf:"bytes,5,opt,name=fsGroupPolicy"` @@ -362,7 +381,7 @@ type CSIDriverSpec struct { // most one token is empty string. To receive a new token after expiry, // RequiresRepublish can be used to trigger NodePublishVolume periodically. // - // This is an alpha feature and only available when the + // This is a beta feature and only available when the // CSIServiceAccountToken feature is enabled. // // +optional @@ -377,7 +396,7 @@ type CSIDriverSpec struct { // to NodePublishVolume should only update the contents of the volume. New // mount points will not be seen by a running container. // - // This is an alpha feature and only available when the + // This is a beta feature and only available when the // CSIServiceAccountToken feature is enabled. // // +optional @@ -400,10 +419,11 @@ const ( ReadWriteOnceWithFSTypeFSGroupPolicy FSGroupPolicy = "ReadWriteOnceWithFSType" // FileFSGroupPolicy indicates that CSI driver supports volume ownership - // and permission change via fsGroup, and Kubernetes may use fsGroup - // to change permissions and ownership of the volume to match user requested fsGroup in + // and permission change via fsGroup, and Kubernetes will change the permissions + // and ownership of every file in the volume to match the user requested fsGroup in // the pod's SecurityPolicy regardless of fstype or access mode. - // This mode should be defined if the fsGroup is expected to always change on mount + // Use this mode if Kubernetes should modify the permissions and ownership + // of the volume. FileFSGroupPolicy FSGroupPolicy = "File" // NoneFSGroupPolicy indicates that volumes will be mounted without performing diff --git a/cluster-autoscaler/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go index c8b3c63f3f51..ea212e9f9558 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go @@ -49,13 +49,13 @@ func (CSIDriverList) SwaggerDoc() map[string]string { var map_CSIDriverSpec = map[string]string{ "": "CSIDriverSpec is the specification of a CSIDriver.", - "attachRequired": "attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the CSIDriverRegistry feature gate is enabled and the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called.", - "podInfoOnMount": "If set to true, podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeConext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume\n defined by a CSIVolumeSource, otherwise \"false\"\n\n\"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.", - "volumeLifecycleModes": "volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism. The other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume. For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future. This field is beta.", - "storageCapacity": "If set to true, storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information.\n\nThe check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object.\n\nAlternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published.\n\nThis is a beta field and only available when the CSIStorageCapacity feature is enabled. The default is false.", - "fsGroupPolicy": "Defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details. This field is alpha-level, and is only honored by servers that enable the CSIVolumeFSGroupPolicy feature gate.", - "tokenRequests": "TokenRequests indicates the CSI driver needs pods' service account tokens it is mounting volume for to do necessary authentication. Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls. The CSI driver should parse and validate the following VolumeContext: \"csi.storage.k8s.io/serviceAccount.tokens\": {\n \"\": {\n \"token\": ,\n \"expirationTimestamp\": ,\n },\n ...\n}\n\nNote: Audience in each TokenRequest should be different and at most one token is empty string. To receive a new token after expiry, RequiresRepublish can be used to trigger NodePublishVolume periodically.\n\nThis is an alpha feature and only available when the CSIServiceAccountToken feature is enabled.", - "requiresRepublish": "RequiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false.\n\nNote: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container.\n\nThis is an alpha feature and only available when the CSIServiceAccountToken feature is enabled.", + "attachRequired": "attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the CSIDriverRegistry feature gate is enabled and the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called.\n\nThis field is immutable.", + "podInfoOnMount": "If set to true, podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeConext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume\n defined by a CSIVolumeSource, otherwise \"false\"\n\n\"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.\n\nThis field is immutable.", + "volumeLifecycleModes": "volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism. The other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume. For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future. This field is beta.\n\nThis field is immutable.", + "storageCapacity": "If set to true, storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information.\n\nThe check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object.\n\nAlternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published.\n\nThis field is immutable.\n\nThis is a beta field and only available when the CSIStorageCapacity feature is enabled. The default is false.", + "fsGroupPolicy": "Defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details. This field is beta, and is only honored by servers that enable the CSIVolumeFSGroupPolicy feature gate.\n\nThis field is immutable.\n\nDefaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce.", + "tokenRequests": "TokenRequests indicates the CSI driver needs pods' service account tokens it is mounting volume for to do necessary authentication. Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls. The CSI driver should parse and validate the following VolumeContext: \"csi.storage.k8s.io/serviceAccount.tokens\": {\n \"\": {\n \"token\": ,\n \"expirationTimestamp\": ,\n },\n ...\n}\n\nNote: Audience in each TokenRequest should be different and at most one token is empty string. To receive a new token after expiry, RequiresRepublish can be used to trigger NodePublishVolume periodically.\n\nThis is a beta feature and only available when the CSIServiceAccountToken feature is enabled.", + "requiresRepublish": "RequiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false.\n\nNote: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container.\n\nThis is a beta feature and only available when the CSIServiceAccountToken feature is enabled.", } func (CSIDriverSpec) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/generated.proto index a1555ee31d88..6311e7ca4c8b 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/generated.proto @@ -76,6 +76,9 @@ message CSIDriverSpec { // If the CSIDriverRegistry feature gate is enabled and the value is // specified to false, the attach operation will be skipped. // Otherwise the attach operation will be called. + // + // This field is immutable. + // // +optional optional bool attachRequired = 1; @@ -103,6 +106,9 @@ message CSIDriverSpec { // As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when // deployed on such a cluster and the deployment determines which mode that is, for example // via a command line parameter of the driver. + // + // This field is immutable. + // // +optional optional bool podInfoOnMount = 2; @@ -118,6 +124,9 @@ message CSIDriverSpec { // https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html // A driver can support one or more of these modes and // more modes may be added in the future. + // + // This field is immutable. + // // +optional repeated string volumeLifecycleModes = 3; @@ -135,6 +144,8 @@ message CSIDriverSpec { // unset or false and it can be flipped later when storage // capacity information has been published. // + // This field is immutable. + // // This is a beta field and only available when the CSIStorageCapacity // feature is enabled. The default is false. // @@ -145,8 +156,15 @@ message CSIDriverSpec { // Defines if the underlying volume supports changing ownership and // permission of the volume before being mounted. // Refer to the specific FSGroupPolicy values for additional details. - // This field is alpha-level, and is only honored by servers + // This field is beta, and is only honored by servers // that enable the CSIVolumeFSGroupPolicy feature gate. + // + // This field is immutable. + // + // Defaults to ReadWriteOnceWithFSType, which will examine each volume + // to determine if Kubernetes should modify ownership and permissions of the volume. + // With the default policy the defined fsGroup will only be applied + // if a fstype is defined and the volume's access mode contains ReadWriteOnce. // +optional optional string fsGroupPolicy = 5; @@ -166,7 +184,7 @@ message CSIDriverSpec { // most one token is empty string. To receive a new token after expiry, // RequiresRepublish can be used to trigger NodePublishVolume periodically. // - // This is an alpha feature and only available when the + // This is a beta feature and only available when the // CSIServiceAccountToken feature is enabled. // // +optional @@ -181,7 +199,7 @@ message CSIDriverSpec { // to NodePublishVolume should only update the contents of the volume. New // mount points will not be seen by a running container. // - // This is an alpha feature and only available when the + // This is a beta feature and only available when the // CSIServiceAccountToken feature is enabled. // // +optional @@ -398,6 +416,7 @@ message StorageClass { // An empty TopologySelectorTerm list means there is no topology restriction. // This field is only honored by servers that enable the VolumeScheduling feature. // +optional + // +listType=atomic repeated k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8; } diff --git a/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/types.go index 1a20de64ecb7..d1bcbffc6ab9 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/types.go @@ -75,6 +75,7 @@ type StorageClass struct { // An empty TopologySelectorTerm list means there is no topology restriction. // This field is only honored by servers that enable the VolumeScheduling feature. // +optional + // +listType=atomic AllowedTopologies []v1.TopologySelectorTerm `json:"allowedTopologies,omitempty" protobuf:"bytes,8,rep,name=allowedTopologies"` } @@ -292,6 +293,9 @@ type CSIDriverSpec struct { // If the CSIDriverRegistry feature gate is enabled and the value is // specified to false, the attach operation will be skipped. // Otherwise the attach operation will be called. + // + // This field is immutable. + // // +optional AttachRequired *bool `json:"attachRequired,omitempty" protobuf:"varint,1,opt,name=attachRequired"` @@ -319,6 +323,9 @@ type CSIDriverSpec struct { // As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when // deployed on such a cluster and the deployment determines which mode that is, for example // via a command line parameter of the driver. + // + // This field is immutable. + // // +optional PodInfoOnMount *bool `json:"podInfoOnMount,omitempty" protobuf:"bytes,2,opt,name=podInfoOnMount"` @@ -334,6 +341,9 @@ type CSIDriverSpec struct { // https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html // A driver can support one or more of these modes and // more modes may be added in the future. + // + // This field is immutable. + // // +optional VolumeLifecycleModes []VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty" protobuf:"bytes,3,opt,name=volumeLifecycleModes"` @@ -352,6 +362,8 @@ type CSIDriverSpec struct { // unset or false and it can be flipped later when storage // capacity information has been published. // + // This field is immutable. + // // This is a beta field and only available when the CSIStorageCapacity // feature is enabled. The default is false. // @@ -362,8 +374,15 @@ type CSIDriverSpec struct { // Defines if the underlying volume supports changing ownership and // permission of the volume before being mounted. // Refer to the specific FSGroupPolicy values for additional details. - // This field is alpha-level, and is only honored by servers + // This field is beta, and is only honored by servers // that enable the CSIVolumeFSGroupPolicy feature gate. + // + // This field is immutable. + // + // Defaults to ReadWriteOnceWithFSType, which will examine each volume + // to determine if Kubernetes should modify ownership and permissions of the volume. + // With the default policy the defined fsGroup will only be applied + // if a fstype is defined and the volume's access mode contains ReadWriteOnce. // +optional FSGroupPolicy *FSGroupPolicy `json:"fsGroupPolicy,omitempty" protobuf:"bytes,5,opt,name=fsGroupPolicy"` @@ -383,7 +402,7 @@ type CSIDriverSpec struct { // most one token is empty string. To receive a new token after expiry, // RequiresRepublish can be used to trigger NodePublishVolume periodically. // - // This is an alpha feature and only available when the + // This is a beta feature and only available when the // CSIServiceAccountToken feature is enabled. // // +optional @@ -398,7 +417,7 @@ type CSIDriverSpec struct { // to NodePublishVolume should only update the contents of the volume. New // mount points will not be seen by a running container. // - // This is an alpha feature and only available when the + // This is a beta feature and only available when the // CSIServiceAccountToken feature is enabled. // // +optional @@ -419,9 +438,11 @@ const ( ReadWriteOnceWithFSTypeFSGroupPolicy FSGroupPolicy = "ReadWriteOnceWithFSType" // FileFSGroupPolicy indicates that CSI driver supports volume ownership - // and permission change via fsGroup, and Kubernetes may use fsGroup - // to change permissions and ownership of the volume to match user requested fsGroup in + // and permission change via fsGroup, and Kubernetes will change the permissions + // and ownership of every file in the volume to match the user requested fsGroup in // the pod's SecurityPolicy regardless of fstype or access mode. + // Use this mode if Kubernetes should modify the permissions and ownership + // of the volume. FileFSGroupPolicy FSGroupPolicy = "File" // None indicates that volumes will be mounted without performing diff --git a/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go index a12c9bf3a107..b8d0f74a14cb 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go @@ -49,13 +49,13 @@ func (CSIDriverList) SwaggerDoc() map[string]string { var map_CSIDriverSpec = map[string]string{ "": "CSIDriverSpec is the specification of a CSIDriver.", - "attachRequired": "attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the CSIDriverRegistry feature gate is enabled and the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called.", - "podInfoOnMount": "If set to true, podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeConext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume\n defined by a CSIVolumeSource, otherwise \"false\"\n\n\"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.", - "volumeLifecycleModes": "VolumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism. The other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume. For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future.", - "storageCapacity": "If set to true, storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information.\n\nThe check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object.\n\nAlternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published.\n\nThis is a beta field and only available when the CSIStorageCapacity feature is enabled. The default is false.", - "fsGroupPolicy": "Defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details. This field is alpha-level, and is only honored by servers that enable the CSIVolumeFSGroupPolicy feature gate.", - "tokenRequests": "TokenRequests indicates the CSI driver needs pods' service account tokens it is mounting volume for to do necessary authentication. Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls. The CSI driver should parse and validate the following VolumeContext: \"csi.storage.k8s.io/serviceAccount.tokens\": {\n \"\": {\n \"token\": ,\n \"expirationTimestamp\": ,\n },\n ...\n}\n\nNote: Audience in each TokenRequest should be different and at most one token is empty string. To receive a new token after expiry, RequiresRepublish can be used to trigger NodePublishVolume periodically.\n\nThis is an alpha feature and only available when the CSIServiceAccountToken feature is enabled.", - "requiresRepublish": "RequiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false.\n\nNote: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container.\n\nThis is an alpha feature and only available when the CSIServiceAccountToken feature is enabled.", + "attachRequired": "attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the CSIDriverRegistry feature gate is enabled and the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called.\n\nThis field is immutable.", + "podInfoOnMount": "If set to true, podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeConext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume\n defined by a CSIVolumeSource, otherwise \"false\"\n\n\"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.\n\nThis field is immutable.", + "volumeLifecycleModes": "VolumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism. The other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume. For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future.\n\nThis field is immutable.", + "storageCapacity": "If set to true, storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information.\n\nThe check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object.\n\nAlternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published.\n\nThis field is immutable.\n\nThis is a beta field and only available when the CSIStorageCapacity feature is enabled. The default is false.", + "fsGroupPolicy": "Defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details. This field is beta, and is only honored by servers that enable the CSIVolumeFSGroupPolicy feature gate.\n\nThis field is immutable.\n\nDefaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce.", + "tokenRequests": "TokenRequests indicates the CSI driver needs pods' service account tokens it is mounting volume for to do necessary authentication. Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls. The CSI driver should parse and validate the following VolumeContext: \"csi.storage.k8s.io/serviceAccount.tokens\": {\n \"\": {\n \"token\": ,\n \"expirationTimestamp\": ,\n },\n ...\n}\n\nNote: Audience in each TokenRequest should be different and at most one token is empty string. To receive a new token after expiry, RequiresRepublish can be used to trigger NodePublishVolume periodically.\n\nThis is a beta feature and only available when the CSIServiceAccountToken feature is enabled.", + "requiresRepublish": "RequiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false.\n\nNote: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container.\n\nThis is a beta feature and only available when the CSIServiceAccountToken feature is enabled.", } func (CSIDriverSpec) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS index 4ba4022b6ea5..d4c73022fe88 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS @@ -11,7 +11,6 @@ reviewers: - caesarxuchao - mikedanese - liggitt -- erictune - saad-ali - janetkuo - tallclair diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/errors/errors.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/errors/errors.go index d3927d817382..31eddfc1ea01 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/errors/errors.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/errors/errors.go @@ -274,7 +274,7 @@ func NewBadRequest(reason string) *StatusError { // NewTooManyRequests creates an error that indicates that the client must try again later because // the specified endpoint is not accepting requests. More specific details should be provided -// if client should know why the failure was limited4. +// if client should know why the failure was limited. func NewTooManyRequests(message string, retryAfterSeconds int) *StatusError { return &StatusError{metav1.Status{ Status: metav1.StatusFailure, diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go index f89ca163cd39..3e0cdb10d409 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go @@ -166,7 +166,7 @@ func (m *Quantity) Unmarshal(data []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenerated } if (iNdEx + skippy) > l { diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS index 579af62ba76a..5731b9ee20a2 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS @@ -8,7 +8,6 @@ reviewers: - brendandburns - caesarxuchao - liggitt -- erictune - davidopp - sttts - quinton-hoole @@ -20,6 +19,5 @@ reviewers: - dims - hongchaodeng - krousey -- mml - therc - kevin-wangzefeng diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go index 55945badab47..326f68812d79 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go @@ -1326,183 +1326,184 @@ func init() { } var fileDescriptor_cf52fa777ced5367 = []byte{ - // 2813 bytes of a gzipped FileDescriptorProto + // 2829 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x3a, 0xcb, 0x6f, 0x24, 0x47, 0xf9, 0xee, 0x19, 0x8f, 0x3d, 0xf3, 0x8d, 0xc7, 0x8f, 0x5a, 0xef, 0xef, 0x37, 0x6b, 0x84, 0xc7, 0xe9, 0xa0, 0x68, 0x03, 0xc9, 0x38, 0x5e, 0x42, 0xb4, 0xd9, 0x90, 0x80, 0xc7, 0xb3, 0xde, 0x98, 0xac, 0x63, 0xab, 0xbc, 0xbb, 0x40, 0x88, 0x50, 0xda, 0xdd, 0xe5, 0x71, 0xe3, 0x9e, 0xee, 0x49, - 0x55, 0x8f, 0x37, 0x03, 0x07, 0x72, 0x00, 0x01, 0x12, 0x44, 0xe1, 0x86, 0x38, 0xa0, 0x44, 0xf0, - 0x17, 0x70, 0x81, 0x3f, 0x00, 0x89, 0x1c, 0x23, 0x71, 0x89, 0x04, 0x1a, 0x25, 0xe6, 0xc0, 0x11, - 0x71, 0xf5, 0x05, 0x54, 0x8f, 0xee, 0xae, 0x9e, 0xc7, 0xba, 0x27, 0xbb, 0x44, 0xdc, 0xa6, 0xbf, - 0x77, 0x55, 0x7d, 0xf5, 0xbd, 0x6a, 0x60, 0xf7, 0xe4, 0x3a, 0xab, 0xbb, 0xc1, 0xfa, 0x49, 0xf7, - 0x90, 0x50, 0x9f, 0x84, 0x84, 0xad, 0x9f, 0x12, 0xdf, 0x09, 0xe8, 0xba, 0x42, 0x58, 0x1d, 0xb7, - 0x6d, 0xd9, 0xc7, 0xae, 0x4f, 0x68, 0x6f, 0xbd, 0x73, 0xd2, 0xe2, 0x00, 0xb6, 0xde, 0x26, 0xa1, - 0xb5, 0x7e, 0xba, 0xb1, 0xde, 0x22, 0x3e, 0xa1, 0x56, 0x48, 0x9c, 0x7a, 0x87, 0x06, 0x61, 0x80, - 0xbe, 0x20, 0xb9, 0xea, 0x3a, 0x57, 0xbd, 0x73, 0xd2, 0xe2, 0x00, 0x56, 0xe7, 0x5c, 0xf5, 0xd3, - 0x8d, 0x95, 0xa7, 0x5b, 0x6e, 0x78, 0xdc, 0x3d, 0xac, 0xdb, 0x41, 0x7b, 0xbd, 0x15, 0xb4, 0x82, - 0x75, 0xc1, 0x7c, 0xd8, 0x3d, 0x12, 0x5f, 0xe2, 0x43, 0xfc, 0x92, 0x42, 0x57, 0xc6, 0x9a, 0x42, - 0xbb, 0x7e, 0xe8, 0xb6, 0xc9, 0xa0, 0x15, 0x2b, 0xcf, 0x5d, 0xc4, 0xc0, 0xec, 0x63, 0xd2, 0xb6, - 0x06, 0xf9, 0xcc, 0x3f, 0xe7, 0xa1, 0xb8, 0xb9, 0xbf, 0x73, 0x8b, 0x06, 0xdd, 0x0e, 0x5a, 0x83, - 0x69, 0xdf, 0x6a, 0x93, 0xaa, 0xb1, 0x66, 0x5c, 0x2d, 0x35, 0xe6, 0x3e, 0xe8, 0xd7, 0xa6, 0xce, - 0xfa, 0xb5, 0xe9, 0x57, 0xad, 0x36, 0xc1, 0x02, 0x83, 0x3c, 0x28, 0x9e, 0x12, 0xca, 0xdc, 0xc0, - 0x67, 0xd5, 0xdc, 0x5a, 0xfe, 0x6a, 0xf9, 0xda, 0x4b, 0xf5, 0x2c, 0xeb, 0xaf, 0x0b, 0x05, 0xf7, - 0x24, 0xeb, 0x76, 0x40, 0x9b, 0x2e, 0xb3, 0x83, 0x53, 0x42, 0x7b, 0x8d, 0x45, 0xa5, 0xa5, 0xa8, - 0x90, 0x0c, 0xc7, 0x1a, 0xd0, 0x8f, 0x0c, 0x58, 0xec, 0x50, 0x72, 0x44, 0x28, 0x25, 0x8e, 0xc2, - 0x57, 0xf3, 0x6b, 0xc6, 0x23, 0x50, 0x5b, 0x55, 0x6a, 0x17, 0xf7, 0x07, 0xe4, 0xe3, 0x21, 0x8d, - 0xe8, 0xb7, 0x06, 0xac, 0x30, 0x42, 0x4f, 0x09, 0xdd, 0x74, 0x1c, 0x4a, 0x18, 0x6b, 0xf4, 0xb6, - 0x3c, 0x97, 0xf8, 0xe1, 0xd6, 0x4e, 0x13, 0xb3, 0xea, 0xb4, 0xd8, 0x87, 0xaf, 0x65, 0x33, 0xe8, - 0x60, 0x9c, 0x9c, 0x86, 0xa9, 0x2c, 0x5a, 0x19, 0x4b, 0xc2, 0xf0, 0x03, 0xcc, 0x30, 0x8f, 0x60, - 0x2e, 0x3a, 0xc8, 0xdb, 0x2e, 0x0b, 0xd1, 0x3d, 0x98, 0x69, 0xf1, 0x0f, 0x56, 0x35, 0x84, 0x81, - 0xf5, 0x6c, 0x06, 0x46, 0x32, 0x1a, 0xf3, 0xca, 0x9e, 0x19, 0xf1, 0xc9, 0xb0, 0x92, 0x66, 0xfe, - 0x6c, 0x1a, 0xca, 0x9b, 0xfb, 0x3b, 0x98, 0xb0, 0xa0, 0x4b, 0x6d, 0x92, 0xc1, 0x69, 0xae, 0xc3, - 0x1c, 0x73, 0xfd, 0x56, 0xd7, 0xb3, 0x28, 0x87, 0x56, 0x67, 0x04, 0xe5, 0xb2, 0xa2, 0x9c, 0x3b, - 0xd0, 0x70, 0x38, 0x45, 0x89, 0xae, 0x01, 0x70, 0x09, 0xac, 0x63, 0xd9, 0xc4, 0xa9, 0xe6, 0xd6, - 0x8c, 0xab, 0xc5, 0x06, 0x52, 0x7c, 0xf0, 0x6a, 0x8c, 0xc1, 0x1a, 0x15, 0x7a, 0x1c, 0x0a, 0xc2, - 0xd2, 0x6a, 0x51, 0xa8, 0xa9, 0x28, 0xf2, 0x82, 0x58, 0x06, 0x96, 0x38, 0xf4, 0x24, 0xcc, 0x2a, - 0x2f, 0xab, 0x96, 0x04, 0xd9, 0x82, 0x22, 0x9b, 0x8d, 0xdc, 0x20, 0xc2, 0xf3, 0xf5, 0x9d, 0xb8, - 0xbe, 0x23, 0xfc, 0x4e, 0x5b, 0xdf, 0x2b, 0xae, 0xef, 0x60, 0x81, 0x41, 0xb7, 0xa1, 0x70, 0x4a, - 0xe8, 0x21, 0xf7, 0x04, 0xee, 0x9a, 0x5f, 0xca, 0xb6, 0xd1, 0xf7, 0x38, 0x4b, 0xa3, 0xc4, 0x4d, - 0x13, 0x3f, 0xb1, 0x14, 0x82, 0xea, 0x00, 0xec, 0x38, 0xa0, 0xa1, 0x58, 0x5e, 0xb5, 0xb0, 0x96, - 0xbf, 0x5a, 0x6a, 0xcc, 0xf3, 0xf5, 0x1e, 0xc4, 0x50, 0xac, 0x51, 0x70, 0x7a, 0xdb, 0x0a, 0x49, - 0x2b, 0xa0, 0x2e, 0x61, 0xd5, 0xd9, 0x84, 0x7e, 0x2b, 0x86, 0x62, 0x8d, 0x02, 0x7d, 0x03, 0x10, - 0x0b, 0x03, 0x6a, 0xb5, 0x88, 0x5a, 0xea, 0xcb, 0x16, 0x3b, 0xae, 0x82, 0x58, 0xdd, 0x8a, 0x5a, - 0x1d, 0x3a, 0x18, 0xa2, 0xc0, 0x23, 0xb8, 0xcc, 0xdf, 0x1b, 0xb0, 0xa0, 0xf9, 0x82, 0xf0, 0xbb, - 0xeb, 0x30, 0xd7, 0xd2, 0x6e, 0x9d, 0xf2, 0x8b, 0xf8, 0xb4, 0xf5, 0x1b, 0x89, 0x53, 0x94, 0x88, - 0x40, 0x89, 0x2a, 0x49, 0x51, 0x74, 0xd9, 0xc8, 0xec, 0xb4, 0x91, 0x0d, 0x89, 0x26, 0x0d, 0xc8, - 0x70, 0x22, 0xd9, 0xfc, 0x87, 0x21, 0x1c, 0x38, 0x8a, 0x37, 0xe8, 0xaa, 0x16, 0xd3, 0x0c, 0xb1, - 0x7d, 0x73, 0x63, 0xe2, 0xd1, 0x05, 0x81, 0x20, 0xf7, 0x3f, 0x11, 0x08, 0x6e, 0x14, 0x7f, 0xf5, - 0x5e, 0x6d, 0xea, 0xed, 0xbf, 0xad, 0x4d, 0x99, 0xbf, 0x34, 0x60, 0x6e, 0xb3, 0xd3, 0xf1, 0x7a, - 0x7b, 0x9d, 0x50, 0x2c, 0xc0, 0x84, 0x19, 0x87, 0xf6, 0x70, 0xd7, 0x57, 0x0b, 0x05, 0x7e, 0xbf, - 0x9b, 0x02, 0x82, 0x15, 0x86, 0xdf, 0x9f, 0xa3, 0x80, 0xda, 0x44, 0x5d, 0xb7, 0xf8, 0xfe, 0x6c, - 0x73, 0x20, 0x96, 0x38, 0x7e, 0xc8, 0x47, 0x2e, 0xf1, 0x9c, 0x5d, 0xcb, 0xb7, 0x5a, 0x84, 0xaa, - 0xcb, 0x11, 0x6f, 0xfd, 0xb6, 0x86, 0xc3, 0x29, 0x4a, 0xf3, 0xdf, 0x39, 0x28, 0x6d, 0x05, 0xbe, - 0xe3, 0x86, 0xea, 0x72, 0x85, 0xbd, 0xce, 0x50, 0xf0, 0xb8, 0xd3, 0xeb, 0x10, 0x2c, 0x30, 0xe8, - 0x79, 0x98, 0x61, 0xa1, 0x15, 0x76, 0x99, 0xb0, 0xa7, 0xd4, 0x78, 0x2c, 0x0a, 0x4b, 0x07, 0x02, - 0x7a, 0xde, 0xaf, 0x2d, 0xc4, 0xe2, 0x24, 0x08, 0x2b, 0x06, 0xee, 0xe9, 0xc1, 0xa1, 0xd8, 0x28, - 0xe7, 0x96, 0x4c, 0x7b, 0x51, 0xfe, 0xc8, 0x27, 0x9e, 0xbe, 0x37, 0x44, 0x81, 0x47, 0x70, 0xa1, - 0x53, 0x40, 0x9e, 0xc5, 0xc2, 0x3b, 0xd4, 0xf2, 0x99, 0xd0, 0x75, 0xc7, 0x6d, 0x13, 0x75, 0xe1, - 0xbf, 0x98, 0xed, 0xc4, 0x39, 0x47, 0xa2, 0xf7, 0xf6, 0x90, 0x34, 0x3c, 0x42, 0x03, 0x7a, 0x02, - 0x66, 0x28, 0xb1, 0x58, 0xe0, 0x57, 0x0b, 0x62, 0xf9, 0x71, 0x54, 0xc6, 0x02, 0x8a, 0x15, 0x96, - 0x07, 0xb4, 0x36, 0x61, 0xcc, 0x6a, 0x45, 0xe1, 0x35, 0x0e, 0x68, 0xbb, 0x12, 0x8c, 0x23, 0xbc, - 0xd9, 0x86, 0xca, 0x16, 0x25, 0x56, 0x48, 0x26, 0xf1, 0x8a, 0x4f, 0x7f, 0xe0, 0x3f, 0xc9, 0x43, - 0xa5, 0x49, 0x3c, 0x92, 0xe8, 0xdb, 0x06, 0xd4, 0xa2, 0x96, 0x4d, 0xf6, 0x09, 0x75, 0x03, 0xe7, - 0x80, 0xd8, 0x81, 0xef, 0x30, 0xe1, 0x02, 0xf9, 0xc6, 0xff, 0xf1, 0xbd, 0xb9, 0x35, 0x84, 0xc5, - 0x23, 0x38, 0x90, 0x07, 0x95, 0x0e, 0x15, 0xbf, 0xc5, 0x7e, 0x49, 0x0f, 0x29, 0x5f, 0xfb, 0x72, - 0xb6, 0xe3, 0xd8, 0xd7, 0x59, 0x1b, 0x4b, 0x67, 0xfd, 0x5a, 0x25, 0x05, 0xc2, 0x69, 0xe1, 0xe8, - 0xeb, 0xb0, 0x18, 0xd0, 0xce, 0xb1, 0xe5, 0x37, 0x49, 0x87, 0xf8, 0x0e, 0xf1, 0x43, 0x26, 0x76, - 0xa1, 0xd8, 0x58, 0xe6, 0x75, 0xc4, 0xde, 0x00, 0x0e, 0x0f, 0x51, 0xa3, 0xd7, 0x60, 0xa9, 0x43, - 0x83, 0x8e, 0xd5, 0x12, 0x2e, 0xb5, 0x1f, 0x78, 0xae, 0xdd, 0x13, 0x2e, 0x54, 0x6a, 0x3c, 0x75, - 0xd6, 0xaf, 0x2d, 0xed, 0x0f, 0x22, 0xcf, 0xfb, 0xb5, 0x4b, 0x62, 0xeb, 0x38, 0x24, 0x41, 0xe2, - 0x61, 0x31, 0xda, 0x19, 0x16, 0xc6, 0x9d, 0xa1, 0xb9, 0x03, 0xc5, 0x66, 0x57, 0xf9, 0xf3, 0x8b, - 0x50, 0x74, 0xd4, 0x6f, 0xb5, 0xf3, 0xd1, 0xc5, 0x8a, 0x69, 0xce, 0xfb, 0xb5, 0x0a, 0x2f, 0x1d, - 0xeb, 0x11, 0x00, 0xc7, 0x2c, 0xe6, 0x13, 0x50, 0x14, 0x47, 0xce, 0xee, 0x6d, 0xa0, 0x45, 0xc8, - 0x63, 0xeb, 0xbe, 0x90, 0x32, 0x87, 0xf9, 0x4f, 0x2d, 0x02, 0xed, 0x01, 0xdc, 0x22, 0x61, 0x74, - 0xf0, 0x9b, 0xb0, 0x10, 0x85, 0xe1, 0x74, 0x76, 0xf8, 0x7f, 0xa5, 0x7b, 0x01, 0xa7, 0xd1, 0x78, - 0x90, 0xde, 0x7c, 0x1d, 0x4a, 0x22, 0x83, 0xf0, 0xf4, 0x9b, 0xa4, 0x7a, 0xe3, 0x01, 0xa9, 0x3e, - 0xca, 0xdf, 0xb9, 0x71, 0xf9, 0x5b, 0x33, 0xd7, 0x83, 0x8a, 0xe4, 0x8d, 0x8a, 0x9b, 0x4c, 0x1a, - 0x9e, 0x82, 0x62, 0x64, 0xa6, 0xd2, 0x12, 0x17, 0xb5, 0x91, 0x20, 0x1c, 0x53, 0x68, 0xda, 0x8e, - 0x21, 0x95, 0x0d, 0xb3, 0x29, 0xd3, 0x2a, 0x97, 0xdc, 0x83, 0x2b, 0x17, 0x4d, 0xd3, 0x0f, 0xa1, - 0x3a, 0xae, 0x12, 0x7e, 0x88, 0x7c, 0x9d, 0xdd, 0x14, 0xf3, 0x1d, 0x03, 0x16, 0x75, 0x49, 0xd9, - 0x8f, 0x2f, 0xbb, 0x92, 0x8b, 0x2b, 0x35, 0x6d, 0x47, 0x7e, 0x63, 0xc0, 0x72, 0x6a, 0x69, 0x13, - 0x9d, 0xf8, 0x04, 0x46, 0xe9, 0xce, 0x91, 0x9f, 0xc0, 0x39, 0xfe, 0x92, 0x83, 0xca, 0x6d, 0xeb, - 0x90, 0x78, 0x07, 0xc4, 0x23, 0x76, 0x18, 0x50, 0xf4, 0x03, 0x28, 0xb7, 0xad, 0xd0, 0x3e, 0x16, - 0xd0, 0xa8, 0xaa, 0x6f, 0x66, 0x0b, 0x76, 0x29, 0x49, 0xf5, 0xdd, 0x44, 0xcc, 0x4d, 0x3f, 0xa4, - 0xbd, 0xc6, 0x25, 0x65, 0x52, 0x59, 0xc3, 0x60, 0x5d, 0x9b, 0x68, 0xc5, 0xc4, 0xf7, 0xcd, 0xb7, - 0x3a, 0xbc, 0xe4, 0x98, 0xbc, 0x03, 0x4c, 0x99, 0x80, 0xc9, 0x9b, 0x5d, 0x97, 0x92, 0x36, 0xf1, - 0xc3, 0xa4, 0x15, 0xdb, 0x1d, 0x90, 0x8f, 0x87, 0x34, 0xae, 0xbc, 0x04, 0x8b, 0x83, 0xc6, 0xf3, - 0xf8, 0x73, 0x42, 0x7a, 0xf2, 0xbc, 0x30, 0xff, 0x89, 0x96, 0xa1, 0x70, 0x6a, 0x79, 0x5d, 0x75, - 0x1b, 0xb1, 0xfc, 0xb8, 0x91, 0xbb, 0x6e, 0x98, 0xbf, 0x33, 0xa0, 0x3a, 0xce, 0x10, 0xf4, 0x79, - 0x4d, 0x50, 0xa3, 0xac, 0xac, 0xca, 0xbf, 0x42, 0x7a, 0x52, 0xea, 0x4d, 0x28, 0x06, 0x1d, 0x5e, - 0x0f, 0x04, 0x54, 0x9d, 0xfa, 0x93, 0xd1, 0x49, 0xee, 0x29, 0xf8, 0x79, 0xbf, 0x76, 0x39, 0x25, - 0x3e, 0x42, 0xe0, 0x98, 0x95, 0x47, 0x6a, 0x61, 0x0f, 0xcf, 0x1e, 0x71, 0xa4, 0xbe, 0x27, 0x20, - 0x58, 0x61, 0xcc, 0x3f, 0x1a, 0x30, 0x2d, 0x8a, 0xe9, 0xd7, 0xa1, 0xc8, 0xf7, 0xcf, 0xb1, 0x42, - 0x4b, 0xd8, 0x95, 0xb9, 0x8d, 0xe3, 0xdc, 0xbb, 0x24, 0xb4, 0x12, 0x6f, 0x8b, 0x20, 0x38, 0x96, - 0x88, 0x30, 0x14, 0xdc, 0x90, 0xb4, 0xa3, 0x83, 0x7c, 0x7a, 0xac, 0x68, 0x35, 0x44, 0xa8, 0x63, - 0xeb, 0xfe, 0xcd, 0xb7, 0x42, 0xe2, 0xf3, 0xc3, 0x48, 0xae, 0xc6, 0x0e, 0x97, 0x81, 0xa5, 0x28, - 0xf3, 0x5f, 0x06, 0xc4, 0xaa, 0xb8, 0xf3, 0x33, 0xe2, 0x1d, 0xdd, 0x76, 0xfd, 0x13, 0xb5, 0xad, - 0xb1, 0x39, 0x07, 0x0a, 0x8e, 0x63, 0x8a, 0x51, 0xe9, 0x21, 0x37, 0x59, 0x7a, 0xe0, 0x0a, 0xed, - 0xc0, 0x0f, 0x5d, 0xbf, 0x3b, 0x74, 0xdb, 0xb6, 0x14, 0x1c, 0xc7, 0x14, 0xbc, 0x10, 0xa1, 0xa4, - 0x6d, 0xb9, 0xbe, 0xeb, 0xb7, 0xf8, 0x22, 0xb6, 0x82, 0xae, 0x1f, 0x8a, 0x8c, 0xac, 0x0a, 0x11, - 0x3c, 0x84, 0xc5, 0x23, 0x38, 0xcc, 0x3f, 0x4c, 0x43, 0x99, 0xaf, 0x39, 0xca, 0x73, 0x2f, 0x40, - 0xc5, 0xd3, 0xbd, 0x40, 0xad, 0xfd, 0xb2, 0x32, 0x25, 0x7d, 0xaf, 0x71, 0x9a, 0x96, 0x33, 0x8b, - 0xfa, 0x29, 0x66, 0xce, 0xa5, 0x99, 0xb7, 0x75, 0x24, 0x4e, 0xd3, 0xf2, 0xe8, 0x75, 0x9f, 0xdf, - 0x0f, 0x55, 0x99, 0xc4, 0x47, 0xf4, 0x4d, 0x0e, 0xc4, 0x12, 0x87, 0x76, 0xe1, 0x92, 0xe5, 0x79, - 0xc1, 0x7d, 0x01, 0x6c, 0x04, 0xc1, 0x49, 0xdb, 0xa2, 0x27, 0x4c, 0x34, 0xc2, 0xc5, 0xc6, 0xe7, - 0x14, 0xcb, 0xa5, 0xcd, 0x61, 0x12, 0x3c, 0x8a, 0x6f, 0xd4, 0xb1, 0x4d, 0x4f, 0x78, 0x6c, 0xc7, - 0xb0, 0x3c, 0x00, 0x12, 0xb7, 0x5c, 0x75, 0xa5, 0xcf, 0x2a, 0x39, 0xcb, 0x78, 0x04, 0xcd, 0xf9, - 0x18, 0x38, 0x1e, 0x29, 0x11, 0xdd, 0x80, 0x79, 0xee, 0xc9, 0x41, 0x37, 0x8c, 0xea, 0xce, 0x82, - 0x38, 0x6e, 0x74, 0xd6, 0xaf, 0xcd, 0xdf, 0x49, 0x61, 0xf0, 0x00, 0x25, 0xdf, 0x5c, 0xcf, 0x6d, - 0xbb, 0x61, 0x75, 0x56, 0xb0, 0xc4, 0x9b, 0x7b, 0x9b, 0x03, 0xb1, 0xc4, 0xa5, 0x3c, 0xb0, 0x78, - 0x91, 0x07, 0x9a, 0xbf, 0xce, 0x03, 0x92, 0x85, 0xb2, 0x23, 0xeb, 0x29, 0x19, 0xd2, 0x78, 0x35, - 0xaf, 0x0a, 0x6d, 0x63, 0xa0, 0x9a, 0x57, 0x35, 0x76, 0x84, 0x47, 0xbb, 0x50, 0x92, 0xa1, 0x25, - 0xb9, 0x2e, 0xeb, 0x8a, 0xb8, 0xb4, 0x17, 0x21, 0xce, 0xfb, 0xb5, 0x95, 0x94, 0x9a, 0x18, 0x23, - 0x3a, 0xad, 0x44, 0x02, 0xba, 0x06, 0x60, 0x75, 0x5c, 0x7d, 0xd6, 0x56, 0x4a, 0x26, 0x2e, 0x49, - 0xd7, 0x8c, 0x35, 0x2a, 0xf4, 0x32, 0x4c, 0x87, 0x9f, 0xae, 0x1b, 0x2a, 0x8a, 0x66, 0x8f, 0xf7, - 0x3e, 0x42, 0x02, 0xd7, 0x2e, 0xfc, 0x99, 0x71, 0xb3, 0x54, 0x23, 0x13, 0x6b, 0xdf, 0x8e, 0x31, - 0x58, 0xa3, 0x42, 0xdf, 0x82, 0xe2, 0x91, 0x2a, 0x45, 0xc5, 0xc1, 0x64, 0x0e, 0x91, 0x51, 0x01, - 0x2b, 0xdb, 0xfd, 0xe8, 0x0b, 0xc7, 0xd2, 0xcc, 0x37, 0xa1, 0xb4, 0xeb, 0xda, 0x34, 0x10, 0x8d, - 0xd8, 0x93, 0x30, 0xcb, 0x52, 0x9d, 0x4a, 0x7c, 0x24, 0x91, 0xbb, 0x44, 0x78, 0xee, 0x27, 0xbe, - 0xe5, 0x07, 0xb2, 0x1f, 0x29, 0x24, 0x7e, 0xf2, 0x2a, 0x07, 0x62, 0x89, 0xbb, 0xb1, 0xcc, 0x33, - 0xfd, 0x4f, 0xdf, 0xaf, 0x4d, 0xbd, 0xfb, 0x7e, 0x6d, 0xea, 0xbd, 0xf7, 0x55, 0xd6, 0x3f, 0x07, - 0x80, 0xbd, 0xc3, 0xef, 0x11, 0x5b, 0xc6, 0xcf, 0x4c, 0xb3, 0xb5, 0x68, 0xa4, 0x2b, 0x66, 0x6b, - 0xb9, 0x81, 0xea, 0x4d, 0xc3, 0xe1, 0x14, 0x25, 0x5a, 0x87, 0x52, 0x3c, 0x35, 0x53, 0x07, 0xbd, - 0x14, 0x39, 0x4e, 0x3c, 0x5a, 0xc3, 0x09, 0x4d, 0x2a, 0x98, 0x4f, 0x5f, 0x18, 0xcc, 0x1b, 0x90, - 0xef, 0xba, 0x8e, 0xea, 0x5a, 0x9f, 0x89, 0x92, 0xe9, 0xdd, 0x9d, 0xe6, 0x79, 0xbf, 0xf6, 0xd8, - 0xb8, 0x61, 0x35, 0xef, 0xf8, 0x59, 0xfd, 0xee, 0x4e, 0x13, 0x73, 0xe6, 0x51, 0x91, 0x65, 0x66, - 0xc2, 0xc8, 0x72, 0x0d, 0xa0, 0x95, 0xf4, 0xfe, 0xf2, 0xe2, 0xc6, 0x1e, 0xa5, 0xf5, 0xfc, 0x1a, - 0x15, 0x62, 0xb0, 0x64, 0xf3, 0x06, 0x59, 0xf5, 0xe0, 0x2c, 0xb4, 0xda, 0x72, 0x9a, 0x38, 0x99, - 0x73, 0x5f, 0x51, 0x6a, 0x96, 0xb6, 0x06, 0x85, 0xe1, 0x61, 0xf9, 0x28, 0x80, 0x25, 0x47, 0xb5, - 0x7a, 0x89, 0xd2, 0xd2, 0xc4, 0x4a, 0x2f, 0x73, 0x85, 0xcd, 0x41, 0x41, 0x78, 0x58, 0x36, 0xfa, - 0x2e, 0xac, 0x44, 0xc0, 0xe1, 0x7e, 0x5b, 0x44, 0xde, 0x7c, 0x63, 0xf5, 0xac, 0x5f, 0x5b, 0x69, - 0x8e, 0xa5, 0xc2, 0x0f, 0x90, 0x80, 0x1c, 0x98, 0xf1, 0x64, 0xa5, 0x5a, 0x16, 0xd5, 0xc5, 0x57, - 0xb3, 0xad, 0x22, 0xf1, 0xfe, 0xba, 0x5e, 0xa1, 0xc6, 0x73, 0x0f, 0x55, 0x9c, 0x2a, 0xd9, 0xe8, - 0x2d, 0x28, 0x5b, 0xbe, 0x1f, 0x84, 0x96, 0x9c, 0x00, 0xcc, 0x09, 0x55, 0x9b, 0x13, 0xab, 0xda, - 0x4c, 0x64, 0x0c, 0x54, 0xc4, 0x1a, 0x06, 0xeb, 0xaa, 0xd0, 0x7d, 0x58, 0x08, 0xee, 0xfb, 0x84, - 0x62, 0x72, 0x44, 0x28, 0xf1, 0x6d, 0xc2, 0xaa, 0x15, 0xa1, 0xfd, 0xd9, 0x8c, 0xda, 0x53, 0xcc, - 0x89, 0x4b, 0xa7, 0xe1, 0x0c, 0x0f, 0x6a, 0x41, 0x75, 0x1e, 0x24, 0x7d, 0xcb, 0x73, 0xbf, 0x4f, - 0x28, 0xab, 0xce, 0x27, 0x03, 0xdf, 0xed, 0x18, 0x8a, 0x35, 0x0a, 0xf4, 0x15, 0x28, 0xdb, 0x5e, - 0x97, 0x85, 0x44, 0x4e, 0xdf, 0x17, 0xc4, 0x0d, 0x8a, 0xd7, 0xb7, 0x95, 0xa0, 0xb0, 0x4e, 0x87, - 0xba, 0x50, 0x69, 0xeb, 0x29, 0xa3, 0xba, 0x24, 0x56, 0x77, 0x3d, 0xdb, 0xea, 0x86, 0x93, 0x5a, - 0x52, 0xc1, 0xa4, 0x70, 0x38, 0xad, 0x65, 0xe5, 0x79, 0x28, 0x7f, 0xca, 0xe2, 0x9e, 0x37, 0x07, - 0x83, 0xe7, 0x38, 0x51, 0x73, 0xf0, 0xa7, 0x1c, 0xcc, 0xa7, 0x77, 0x7f, 0x20, 0x1d, 0x16, 0x32, - 0xa5, 0xc3, 0xa8, 0x0d, 0x35, 0xc6, 0x3e, 0x18, 0x44, 0x61, 0x3d, 0x3f, 0x36, 0xac, 0xab, 0xe8, - 0x39, 0xfd, 0x30, 0xd1, 0xb3, 0x0e, 0xc0, 0xeb, 0x0c, 0x1a, 0x78, 0x1e, 0xa1, 0x22, 0x70, 0x16, - 0xd5, 0xc3, 0x40, 0x0c, 0xc5, 0x1a, 0x05, 0xaf, 0x86, 0x0f, 0xbd, 0xc0, 0x3e, 0x11, 0x5b, 0x10, - 0x5d, 0x7a, 0x11, 0x32, 0x8b, 0xb2, 0x1a, 0x6e, 0x0c, 0x61, 0xf1, 0x08, 0x0e, 0xb3, 0x07, 0x97, - 0xf7, 0x2d, 0x1a, 0xba, 0x96, 0x97, 0x5c, 0x30, 0xd1, 0x6e, 0xbc, 0x31, 0xd4, 0xcc, 0x3c, 0x33, - 0xe9, 0x45, 0x4d, 0x36, 0x3f, 0x81, 0x25, 0x0d, 0x8d, 0xf9, 0x57, 0x03, 0xae, 0x8c, 0xd4, 0xfd, - 0x19, 0x34, 0x53, 0x6f, 0xa4, 0x9b, 0xa9, 0x17, 0x32, 0x4e, 0x21, 0x47, 0x59, 0x3b, 0xa6, 0xb5, - 0x9a, 0x85, 0xc2, 0x3e, 0x2f, 0x62, 0xcd, 0x5f, 0x18, 0x30, 0x27, 0x7e, 0x4d, 0x32, 0xc1, 0xad, - 0xa5, 0xe7, 0xfa, 0xa5, 0x47, 0x38, 0xd3, 0x7f, 0xc7, 0x80, 0xf4, 0xec, 0x14, 0xbd, 0x24, 0xfd, - 0xd7, 0x88, 0x87, 0x9b, 0x13, 0xfa, 0xee, 0x8b, 0xe3, 0x5a, 0xc1, 0x4b, 0x99, 0xa6, 0x84, 0x4f, - 0x41, 0x09, 0x07, 0x41, 0xb8, 0x6f, 0x85, 0xc7, 0x8c, 0x2f, 0xbc, 0xc3, 0x7f, 0xa8, 0xbd, 0x11, - 0x0b, 0x17, 0x18, 0x2c, 0xe1, 0xe6, 0xcf, 0x0d, 0xb8, 0x32, 0xf6, 0xad, 0x85, 0x87, 0x00, 0x3b, - 0xfe, 0x52, 0x2b, 0x8a, 0xbd, 0x30, 0xa1, 0xc3, 0x1a, 0x15, 0xef, 0xe1, 0x52, 0x0f, 0x34, 0x83, - 0x3d, 0x5c, 0x4a, 0x1b, 0x4e, 0xd3, 0x9a, 0xff, 0xcc, 0x81, 0x7a, 0xdc, 0xf8, 0x2f, 0x7b, 0xec, - 0x13, 0x03, 0x4f, 0x2b, 0xf3, 0xe9, 0xa7, 0x95, 0xf8, 0x1d, 0x45, 0x7b, 0x5b, 0xc8, 0x3f, 0xf8, - 0x6d, 0x01, 0x3d, 0x17, 0x3f, 0x57, 0xc8, 0xd0, 0xb5, 0x9a, 0x7e, 0xae, 0x38, 0xef, 0xd7, 0xe6, - 0x94, 0xf0, 0xf4, 0xf3, 0xc5, 0x6b, 0x30, 0xeb, 0x90, 0xd0, 0x72, 0x3d, 0xd9, 0x8f, 0x65, 0x1e, - 0xe2, 0x4b, 0x61, 0x4d, 0xc9, 0xda, 0x28, 0x73, 0x9b, 0xd4, 0x07, 0x8e, 0x04, 0xf2, 0x68, 0x6b, - 0x07, 0x8e, 0x6c, 0x27, 0x0a, 0x49, 0xb4, 0xdd, 0x0a, 0x1c, 0x82, 0x05, 0xc6, 0x7c, 0xd7, 0x80, - 0xb2, 0x94, 0xb4, 0x65, 0x75, 0x19, 0x41, 0x1b, 0xf1, 0x2a, 0xe4, 0x71, 0x5f, 0xd1, 0xdf, 0xa5, - 0xce, 0xfb, 0xb5, 0x92, 0x20, 0x13, 0x9d, 0xc8, 0x88, 0xf7, 0x97, 0xdc, 0x05, 0x7b, 0xf4, 0x38, - 0x14, 0xc4, 0xed, 0x51, 0x9b, 0x99, 0x3c, 0xb0, 0x71, 0x20, 0x96, 0x38, 0xf3, 0xe3, 0x1c, 0x54, - 0x52, 0x8b, 0xcb, 0xd0, 0x0b, 0xc4, 0xa3, 0xcb, 0x5c, 0x86, 0x71, 0xf8, 0xf8, 0xe7, 0x6c, 0x95, - 0x7b, 0x66, 0x1e, 0x26, 0xf7, 0x7c, 0x1b, 0x66, 0x6c, 0xbe, 0x47, 0xd1, 0xbf, 0x23, 0x36, 0x26, - 0x39, 0x4e, 0xb1, 0xbb, 0x89, 0x37, 0x8a, 0x4f, 0x86, 0x95, 0x40, 0x74, 0x0b, 0x96, 0x28, 0x09, - 0x69, 0x6f, 0xf3, 0x28, 0x24, 0x54, 0x6f, 0xe2, 0x0b, 0x49, 0xc5, 0x8d, 0x07, 0x09, 0xf0, 0x30, - 0x8f, 0x79, 0x08, 0x73, 0x77, 0xac, 0x43, 0x2f, 0x7e, 0x96, 0xc2, 0x50, 0x71, 0x7d, 0xdb, 0xeb, - 0x3a, 0x44, 0x46, 0xe3, 0x28, 0x7a, 0x45, 0x97, 0x76, 0x47, 0x47, 0x9e, 0xf7, 0x6b, 0x97, 0x52, - 0x00, 0xf9, 0x0e, 0x83, 0xd3, 0x22, 0x4c, 0x0f, 0xa6, 0x3f, 0xc3, 0xee, 0xf1, 0x3b, 0x50, 0x4a, - 0xea, 0xfb, 0x47, 0xac, 0xd2, 0x7c, 0x03, 0x8a, 0xdc, 0xe3, 0xa3, 0xbe, 0xf4, 0x82, 0x12, 0x27, - 0x5d, 0x38, 0xe5, 0xb2, 0x14, 0x4e, 0x66, 0x1b, 0x2a, 0x77, 0x3b, 0xce, 0x43, 0x3e, 0x4c, 0xe6, - 0x32, 0x67, 0xad, 0x6b, 0x20, 0xff, 0x78, 0xc1, 0x13, 0x84, 0xcc, 0xdc, 0x5a, 0x82, 0xd0, 0x13, - 0xaf, 0x36, 0x95, 0xff, 0xb1, 0x01, 0x20, 0xc6, 0x5f, 0x37, 0x4f, 0x89, 0x1f, 0x66, 0x78, 0xbe, - 0xbe, 0x0b, 0x33, 0x81, 0xf4, 0x26, 0xf9, 0x38, 0x39, 0xe1, 0x8c, 0x35, 0xbe, 0x04, 0xd2, 0x9f, - 0xb0, 0x12, 0xd6, 0xb8, 0xfa, 0xc1, 0x27, 0xab, 0x53, 0x1f, 0x7e, 0xb2, 0x3a, 0xf5, 0xd1, 0x27, - 0xab, 0x53, 0x6f, 0x9f, 0xad, 0x1a, 0x1f, 0x9c, 0xad, 0x1a, 0x1f, 0x9e, 0xad, 0x1a, 0x1f, 0x9d, - 0xad, 0x1a, 0x1f, 0x9f, 0xad, 0x1a, 0xef, 0xfe, 0x7d, 0x75, 0xea, 0xb5, 0xdc, 0xe9, 0xc6, 0x7f, - 0x02, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xee, 0x35, 0x7b, 0xee, 0x26, 0x00, 0x00, + 0x55, 0x8f, 0x37, 0x03, 0x07, 0x72, 0x00, 0x01, 0x12, 0x44, 0xe1, 0xc6, 0x09, 0x25, 0x82, 0xbf, + 0x80, 0x0b, 0xfc, 0x01, 0x48, 0xe4, 0x18, 0xc4, 0x25, 0x12, 0x68, 0x94, 0x98, 0x03, 0x47, 0xc4, + 0xd5, 0x17, 0x50, 0x3d, 0xba, 0xbb, 0x7a, 0x1e, 0xeb, 0x9e, 0xec, 0x12, 0x71, 0x9b, 0xfe, 0xde, + 0x55, 0xf5, 0xd5, 0xf7, 0xaa, 0x81, 0xdd, 0x93, 0xeb, 0xac, 0xee, 0x06, 0xeb, 0x27, 0xdd, 0x43, + 0x42, 0x7d, 0x12, 0x12, 0xb6, 0x7e, 0x4a, 0x7c, 0x27, 0xa0, 0xeb, 0x0a, 0x61, 0x75, 0xdc, 0xb6, + 0x65, 0x1f, 0xbb, 0x3e, 0xa1, 0xbd, 0xf5, 0xce, 0x49, 0x8b, 0x03, 0xd8, 0x7a, 0x9b, 0x84, 0xd6, + 0xfa, 0xe9, 0xc6, 0x7a, 0x8b, 0xf8, 0x84, 0x5a, 0x21, 0x71, 0xea, 0x1d, 0x1a, 0x84, 0x01, 0xfa, + 0x82, 0xe4, 0xaa, 0xeb, 0x5c, 0xf5, 0xce, 0x49, 0x8b, 0x03, 0x58, 0x9d, 0x73, 0xd5, 0x4f, 0x37, + 0x56, 0x9e, 0x6e, 0xb9, 0xe1, 0x71, 0xf7, 0xb0, 0x6e, 0x07, 0xed, 0xf5, 0x56, 0xd0, 0x0a, 0xd6, + 0x05, 0xf3, 0x61, 0xf7, 0x48, 0x7c, 0x89, 0x0f, 0xf1, 0x4b, 0x0a, 0x5d, 0x19, 0x6b, 0x0a, 0xed, + 0xfa, 0xa1, 0xdb, 0x26, 0x83, 0x56, 0xac, 0x3c, 0x77, 0x11, 0x03, 0xb3, 0x8f, 0x49, 0xdb, 0x1a, + 0xe4, 0x33, 0xff, 0x94, 0x87, 0xe2, 0xe6, 0xfe, 0xce, 0x2d, 0x1a, 0x74, 0x3b, 0x68, 0x0d, 0xa6, + 0x7d, 0xab, 0x4d, 0xaa, 0xc6, 0x9a, 0x71, 0xb5, 0xd4, 0x98, 0xfb, 0xa0, 0x5f, 0x9b, 0x3a, 0xeb, + 0xd7, 0xa6, 0x5f, 0xb5, 0xda, 0x04, 0x0b, 0x0c, 0xf2, 0xa0, 0x78, 0x4a, 0x28, 0x73, 0x03, 0x9f, + 0x55, 0x73, 0x6b, 0xf9, 0xab, 0xe5, 0x6b, 0x2f, 0xd5, 0xb3, 0xac, 0xbf, 0x2e, 0x14, 0xdc, 0x93, + 0xac, 0xdb, 0x01, 0x6d, 0xba, 0xcc, 0x0e, 0x4e, 0x09, 0xed, 0x35, 0x16, 0x95, 0x96, 0xa2, 0x42, + 0x32, 0x1c, 0x6b, 0x40, 0x3f, 0x32, 0x60, 0xb1, 0x43, 0xc9, 0x11, 0xa1, 0x94, 0x38, 0x0a, 0x5f, + 0xcd, 0xaf, 0x19, 0x8f, 0x40, 0x6d, 0x55, 0xa9, 0x5d, 0xdc, 0x1f, 0x90, 0x8f, 0x87, 0x34, 0xa2, + 0xdf, 0x18, 0xb0, 0xc2, 0x08, 0x3d, 0x25, 0x74, 0xd3, 0x71, 0x28, 0x61, 0xac, 0xd1, 0xdb, 0xf2, + 0x5c, 0xe2, 0x87, 0x5b, 0x3b, 0x4d, 0xcc, 0xaa, 0xd3, 0x62, 0x1f, 0xbe, 0x96, 0xcd, 0xa0, 0x83, + 0x71, 0x72, 0x1a, 0xa6, 0xb2, 0x68, 0x65, 0x2c, 0x09, 0xc3, 0x0f, 0x30, 0xc3, 0x3c, 0x82, 0xb9, + 0xe8, 0x20, 0x6f, 0xbb, 0x2c, 0x44, 0xf7, 0x60, 0xa6, 0xc5, 0x3f, 0x58, 0xd5, 0x10, 0x06, 0xd6, + 0xb3, 0x19, 0x18, 0xc9, 0x68, 0xcc, 0x2b, 0x7b, 0x66, 0xc4, 0x27, 0xc3, 0x4a, 0x9a, 0xf9, 0xb3, + 0x69, 0x28, 0x6f, 0xee, 0xef, 0x60, 0xc2, 0x82, 0x2e, 0xb5, 0x49, 0x06, 0xa7, 0xb9, 0x0e, 0x73, + 0xcc, 0xf5, 0x5b, 0x5d, 0xcf, 0xa2, 0x1c, 0x5a, 0x9d, 0x11, 0x94, 0xcb, 0x8a, 0x72, 0xee, 0x40, + 0xc3, 0xe1, 0x14, 0x25, 0xba, 0x06, 0xc0, 0x25, 0xb0, 0x8e, 0x65, 0x13, 0xa7, 0x9a, 0x5b, 0x33, + 0xae, 0x16, 0x1b, 0x48, 0xf1, 0xc1, 0xab, 0x31, 0x06, 0x6b, 0x54, 0xe8, 0x71, 0x28, 0x08, 0x4b, + 0xab, 0x45, 0xa1, 0xa6, 0xa2, 0xc8, 0x0b, 0x62, 0x19, 0x58, 0xe2, 0xd0, 0x93, 0x30, 0xab, 0xbc, + 0xac, 0x5a, 0x12, 0x64, 0x0b, 0x8a, 0x6c, 0x36, 0x72, 0x83, 0x08, 0xcf, 0xd7, 0x77, 0xe2, 0xfa, + 0x8e, 0xf0, 0x3b, 0x6d, 0x7d, 0xaf, 0xb8, 0xbe, 0x83, 0x05, 0x06, 0xdd, 0x86, 0xc2, 0x29, 0xa1, + 0x87, 0xdc, 0x13, 0xb8, 0x6b, 0x7e, 0x29, 0xdb, 0x46, 0xdf, 0xe3, 0x2c, 0x8d, 0x12, 0x37, 0x4d, + 0xfc, 0xc4, 0x52, 0x08, 0xaa, 0x03, 0xb0, 0xe3, 0x80, 0x86, 0x62, 0x79, 0xd5, 0xc2, 0x5a, 0xfe, + 0x6a, 0xa9, 0x31, 0xcf, 0xd7, 0x7b, 0x10, 0x43, 0xb1, 0x46, 0xc1, 0xe9, 0x6d, 0x2b, 0x24, 0xad, + 0x80, 0xba, 0x84, 0x55, 0x67, 0x13, 0xfa, 0xad, 0x18, 0x8a, 0x35, 0x0a, 0xf4, 0x0d, 0x40, 0x2c, + 0x0c, 0xa8, 0xd5, 0x22, 0x6a, 0xa9, 0x2f, 0x5b, 0xec, 0xb8, 0x0a, 0x62, 0x75, 0x2b, 0x6a, 0x75, + 0xe8, 0x60, 0x88, 0x02, 0x8f, 0xe0, 0x32, 0x7f, 0x67, 0xc0, 0x82, 0xe6, 0x0b, 0xc2, 0xef, 0xae, + 0xc3, 0x5c, 0x4b, 0xbb, 0x75, 0xca, 0x2f, 0xe2, 0xd3, 0xd6, 0x6f, 0x24, 0x4e, 0x51, 0x22, 0x02, + 0x25, 0xaa, 0x24, 0x45, 0xd1, 0x65, 0x23, 0xb3, 0xd3, 0x46, 0x36, 0x24, 0x9a, 0x34, 0x20, 0xc3, + 0x89, 0x64, 0xf3, 0x1f, 0x86, 0x70, 0xe0, 0x28, 0xde, 0xa0, 0xab, 0x5a, 0x4c, 0x33, 0xc4, 0xf6, + 0xcd, 0x8d, 0x89, 0x47, 0x17, 0x04, 0x82, 0xdc, 0xff, 0x44, 0x20, 0xb8, 0x51, 0xfc, 0xd5, 0x7b, + 0xb5, 0xa9, 0xb7, 0xff, 0xb6, 0x36, 0x65, 0xfe, 0xd2, 0x80, 0xb9, 0xcd, 0x4e, 0xc7, 0xeb, 0xed, + 0x75, 0x42, 0xb1, 0x00, 0x13, 0x66, 0x1c, 0xda, 0xc3, 0x5d, 0x5f, 0x2d, 0x14, 0xf8, 0xfd, 0x6e, + 0x0a, 0x08, 0x56, 0x18, 0x7e, 0x7f, 0x8e, 0x02, 0x6a, 0x13, 0x75, 0xdd, 0xe2, 0xfb, 0xb3, 0xcd, + 0x81, 0x58, 0xe2, 0xf8, 0x21, 0x1f, 0xb9, 0xc4, 0x73, 0x76, 0x2d, 0xdf, 0x6a, 0x11, 0xaa, 0x2e, + 0x47, 0xbc, 0xf5, 0xdb, 0x1a, 0x0e, 0xa7, 0x28, 0xcd, 0x7f, 0xe7, 0xa0, 0xb4, 0x15, 0xf8, 0x8e, + 0x1b, 0xaa, 0xcb, 0x15, 0xf6, 0x3a, 0x43, 0xc1, 0xe3, 0x4e, 0xaf, 0x43, 0xb0, 0xc0, 0xa0, 0xe7, + 0x61, 0x86, 0x85, 0x56, 0xd8, 0x65, 0xc2, 0x9e, 0x52, 0xe3, 0xb1, 0x28, 0x2c, 0x1d, 0x08, 0xe8, + 0x79, 0xbf, 0xb6, 0x10, 0x8b, 0x93, 0x20, 0xac, 0x18, 0xb8, 0xa7, 0x07, 0x87, 0x62, 0xa3, 0x9c, + 0x5b, 0x32, 0xed, 0x45, 0xf9, 0x23, 0x9f, 0x78, 0xfa, 0xde, 0x10, 0x05, 0x1e, 0xc1, 0x85, 0x4e, + 0x01, 0x79, 0x16, 0x0b, 0xef, 0x50, 0xcb, 0x67, 0x42, 0xd7, 0x1d, 0xb7, 0x4d, 0xd4, 0x85, 0xff, + 0x62, 0xb6, 0x13, 0xe7, 0x1c, 0x89, 0xde, 0xdb, 0x43, 0xd2, 0xf0, 0x08, 0x0d, 0xe8, 0x09, 0x98, + 0xa1, 0xc4, 0x62, 0x81, 0x5f, 0x2d, 0x88, 0xe5, 0xc7, 0x51, 0x19, 0x0b, 0x28, 0x56, 0x58, 0x1e, + 0xd0, 0xda, 0x84, 0x31, 0xab, 0x15, 0x85, 0xd7, 0x38, 0xa0, 0xed, 0x4a, 0x30, 0x8e, 0xf0, 0x66, + 0x1b, 0x2a, 0x5b, 0x94, 0x58, 0x21, 0x99, 0xc4, 0x2b, 0x3e, 0xfd, 0x81, 0xff, 0x24, 0x0f, 0x95, + 0x26, 0xf1, 0x48, 0xa2, 0x6f, 0x1b, 0x50, 0x8b, 0x5a, 0x36, 0xd9, 0x27, 0xd4, 0x0d, 0x9c, 0x03, + 0x62, 0x07, 0xbe, 0xc3, 0x84, 0x0b, 0xe4, 0x1b, 0xff, 0xc7, 0xf7, 0xe6, 0xd6, 0x10, 0x16, 0x8f, + 0xe0, 0x40, 0x1e, 0x54, 0x3a, 0x54, 0xfc, 0x16, 0xfb, 0x25, 0x3d, 0xa4, 0x7c, 0xed, 0xcb, 0xd9, + 0x8e, 0x63, 0x5f, 0x67, 0x6d, 0x2c, 0x9d, 0xf5, 0x6b, 0x95, 0x14, 0x08, 0xa7, 0x85, 0xa3, 0xaf, + 0xc3, 0x62, 0x40, 0x3b, 0xc7, 0x96, 0xdf, 0x24, 0x1d, 0xe2, 0x3b, 0xc4, 0x0f, 0x99, 0xd8, 0x85, + 0x62, 0x63, 0x99, 0xd7, 0x11, 0x7b, 0x03, 0x38, 0x3c, 0x44, 0x8d, 0x5e, 0x83, 0xa5, 0x0e, 0x0d, + 0x3a, 0x56, 0x4b, 0xb8, 0xd4, 0x7e, 0xe0, 0xb9, 0x76, 0x4f, 0xb8, 0x50, 0xa9, 0xf1, 0xd4, 0x59, + 0xbf, 0xb6, 0xb4, 0x3f, 0x88, 0x3c, 0xef, 0xd7, 0x2e, 0x89, 0xad, 0xe3, 0x90, 0x04, 0x89, 0x87, + 0xc5, 0x68, 0x67, 0x58, 0x18, 0x77, 0x86, 0xe6, 0x0e, 0x14, 0x9b, 0x5d, 0xe5, 0xcf, 0x2f, 0x42, + 0xd1, 0x51, 0xbf, 0xd5, 0xce, 0x47, 0x17, 0x2b, 0xa6, 0x39, 0xef, 0xd7, 0x2a, 0xbc, 0x74, 0xac, + 0x47, 0x00, 0x1c, 0xb3, 0x98, 0x4f, 0x40, 0x51, 0x1c, 0x39, 0xbb, 0xb7, 0x81, 0x16, 0x21, 0x8f, + 0xad, 0xfb, 0x42, 0xca, 0x1c, 0xe6, 0x3f, 0xb5, 0x08, 0xb4, 0x07, 0x70, 0x8b, 0x84, 0xd1, 0xc1, + 0x6f, 0xc2, 0x42, 0x14, 0x86, 0xd3, 0xd9, 0xe1, 0xff, 0x95, 0xee, 0x05, 0x9c, 0x46, 0xe3, 0x41, + 0x7a, 0xf3, 0x75, 0x28, 0x89, 0x0c, 0xc2, 0xd3, 0x6f, 0x92, 0xea, 0x8d, 0x07, 0xa4, 0xfa, 0x28, + 0x7f, 0xe7, 0xc6, 0xe5, 0x6f, 0xcd, 0x5c, 0x0f, 0x2a, 0x92, 0x37, 0x2a, 0x6e, 0x32, 0x69, 0x78, + 0x0a, 0x8a, 0x91, 0x99, 0x4a, 0x4b, 0x5c, 0xd4, 0x46, 0x82, 0x70, 0x4c, 0xa1, 0x69, 0x3b, 0x86, + 0x54, 0x36, 0xcc, 0xa6, 0x4c, 0xab, 0x5c, 0x72, 0x0f, 0xae, 0x5c, 0x34, 0x4d, 0x3f, 0x84, 0xea, + 0xb8, 0x4a, 0xf8, 0x21, 0xf2, 0x75, 0x76, 0x53, 0xcc, 0x77, 0x0c, 0x58, 0xd4, 0x25, 0x65, 0x3f, + 0xbe, 0xec, 0x4a, 0x2e, 0xae, 0xd4, 0xb4, 0x1d, 0xf9, 0xb5, 0x01, 0xcb, 0xa9, 0xa5, 0x4d, 0x74, + 0xe2, 0x13, 0x18, 0xa5, 0x3b, 0x47, 0x7e, 0x02, 0xe7, 0xf8, 0x4b, 0x0e, 0x2a, 0xb7, 0xad, 0x43, + 0xe2, 0x1d, 0x10, 0x8f, 0xd8, 0x61, 0x40, 0xd1, 0x0f, 0xa0, 0xdc, 0xb6, 0x42, 0xfb, 0x58, 0x40, + 0xa3, 0xaa, 0xbe, 0x99, 0x2d, 0xd8, 0xa5, 0x24, 0xd5, 0x77, 0x13, 0x31, 0x37, 0xfd, 0x90, 0xf6, + 0x1a, 0x97, 0x94, 0x49, 0x65, 0x0d, 0x83, 0x75, 0x6d, 0xa2, 0x15, 0x13, 0xdf, 0x37, 0xdf, 0xea, + 0xf0, 0x92, 0x63, 0xf2, 0x0e, 0x30, 0x65, 0x02, 0x26, 0x6f, 0x76, 0x5d, 0x4a, 0xda, 0xc4, 0x0f, + 0x93, 0x56, 0x6c, 0x77, 0x40, 0x3e, 0x1e, 0xd2, 0xb8, 0xf2, 0x12, 0x2c, 0x0e, 0x1a, 0xcf, 0xe3, + 0xcf, 0x09, 0xe9, 0xc9, 0xf3, 0xc2, 0xfc, 0x27, 0x5a, 0x86, 0xc2, 0xa9, 0xe5, 0x75, 0xd5, 0x6d, + 0xc4, 0xf2, 0xe3, 0x46, 0xee, 0xba, 0x61, 0xfe, 0xd6, 0x80, 0xea, 0x38, 0x43, 0xd0, 0xe7, 0x35, + 0x41, 0x8d, 0xb2, 0xb2, 0x2a, 0xff, 0x0a, 0xe9, 0x49, 0xa9, 0x37, 0xa1, 0x18, 0x74, 0x78, 0x3d, + 0x10, 0x50, 0x75, 0xea, 0x4f, 0x46, 0x27, 0xb9, 0xa7, 0xe0, 0xe7, 0xfd, 0xda, 0xe5, 0x94, 0xf8, + 0x08, 0x81, 0x63, 0x56, 0x1e, 0xa9, 0x85, 0x3d, 0x3c, 0x7b, 0xc4, 0x91, 0xfa, 0x9e, 0x80, 0x60, + 0x85, 0x31, 0xff, 0x60, 0xc0, 0xb4, 0x28, 0xa6, 0x5f, 0x87, 0x22, 0xdf, 0x3f, 0xc7, 0x0a, 0x2d, + 0x61, 0x57, 0xe6, 0x36, 0x8e, 0x73, 0xef, 0x92, 0xd0, 0x4a, 0xbc, 0x2d, 0x82, 0xe0, 0x58, 0x22, + 0xc2, 0x50, 0x70, 0x43, 0xd2, 0x8e, 0x0e, 0xf2, 0xe9, 0xb1, 0xa2, 0xd5, 0x10, 0xa1, 0x8e, 0xad, + 0xfb, 0x37, 0xdf, 0x0a, 0x89, 0xcf, 0x0f, 0x23, 0xb9, 0x1a, 0x3b, 0x5c, 0x06, 0x96, 0xa2, 0xcc, + 0x7f, 0x19, 0x10, 0xab, 0xe2, 0xce, 0xcf, 0x88, 0x77, 0x74, 0xdb, 0xf5, 0x4f, 0xd4, 0xb6, 0xc6, + 0xe6, 0x1c, 0x28, 0x38, 0x8e, 0x29, 0x46, 0xa5, 0x87, 0xdc, 0x64, 0xe9, 0x81, 0x2b, 0xb4, 0x03, + 0x3f, 0x74, 0xfd, 0xee, 0xd0, 0x6d, 0xdb, 0x52, 0x70, 0x1c, 0x53, 0xf0, 0x42, 0x84, 0x92, 0xb6, + 0xe5, 0xfa, 0xae, 0xdf, 0xe2, 0x8b, 0xd8, 0x0a, 0xba, 0x7e, 0x28, 0x32, 0xb2, 0x2a, 0x44, 0xf0, + 0x10, 0x16, 0x8f, 0xe0, 0x30, 0x7f, 0x3f, 0x0d, 0x65, 0xbe, 0xe6, 0x28, 0xcf, 0xbd, 0x00, 0x15, + 0x4f, 0xf7, 0x02, 0xb5, 0xf6, 0xcb, 0xca, 0x94, 0xf4, 0xbd, 0xc6, 0x69, 0x5a, 0xce, 0x2c, 0xea, + 0xa7, 0x98, 0x39, 0x97, 0x66, 0xde, 0xd6, 0x91, 0x38, 0x4d, 0xcb, 0xa3, 0xd7, 0x7d, 0x7e, 0x3f, + 0x54, 0x65, 0x12, 0x1f, 0xd1, 0x37, 0x39, 0x10, 0x4b, 0x1c, 0xda, 0x85, 0x4b, 0x96, 0xe7, 0x05, + 0xf7, 0x05, 0xb0, 0x11, 0x04, 0x27, 0x6d, 0x8b, 0x9e, 0x30, 0xd1, 0x08, 0x17, 0x1b, 0x9f, 0x53, + 0x2c, 0x97, 0x36, 0x87, 0x49, 0xf0, 0x28, 0xbe, 0x51, 0xc7, 0x36, 0x3d, 0xe1, 0xb1, 0x1d, 0xc3, + 0xf2, 0x00, 0x48, 0xdc, 0x72, 0xd5, 0x95, 0x3e, 0xab, 0xe4, 0x2c, 0xe3, 0x11, 0x34, 0xe7, 0x63, + 0xe0, 0x78, 0xa4, 0x44, 0x74, 0x03, 0xe6, 0xb9, 0x27, 0x07, 0xdd, 0x30, 0xaa, 0x3b, 0x0b, 0xe2, + 0xb8, 0xd1, 0x59, 0xbf, 0x36, 0x7f, 0x27, 0x85, 0xc1, 0x03, 0x94, 0x7c, 0x73, 0x3d, 0xb7, 0xed, + 0x86, 0xd5, 0x59, 0xc1, 0x12, 0x6f, 0xee, 0x6d, 0x0e, 0xc4, 0x12, 0x97, 0xf2, 0xc0, 0xe2, 0x45, + 0x1e, 0x68, 0xfe, 0x39, 0x0f, 0x48, 0x16, 0xca, 0x8e, 0xac, 0xa7, 0x64, 0x48, 0xe3, 0xd5, 0xbc, + 0x2a, 0xb4, 0x8d, 0x81, 0x6a, 0x5e, 0xd5, 0xd8, 0x11, 0x1e, 0xed, 0x42, 0x49, 0x86, 0x96, 0xe4, + 0xba, 0xac, 0x2b, 0xe2, 0xd2, 0x5e, 0x84, 0x38, 0xef, 0xd7, 0x56, 0x52, 0x6a, 0x62, 0x8c, 0xe8, + 0xb4, 0x12, 0x09, 0xe8, 0x1a, 0x80, 0xd5, 0x71, 0xf5, 0x59, 0x5b, 0x29, 0x99, 0xb8, 0x24, 0x5d, + 0x33, 0xd6, 0xa8, 0xd0, 0xcb, 0x30, 0x1d, 0x7e, 0xba, 0x6e, 0xa8, 0x28, 0x9a, 0x3d, 0xde, 0xfb, + 0x08, 0x09, 0x5c, 0xbb, 0xf0, 0x67, 0xc6, 0xcd, 0x52, 0x8d, 0x4c, 0xac, 0x7d, 0x3b, 0xc6, 0x60, + 0x8d, 0x0a, 0x7d, 0x0b, 0x8a, 0x47, 0xaa, 0x14, 0x15, 0x07, 0x93, 0x39, 0x44, 0x46, 0x05, 0xac, + 0x6c, 0xf7, 0xa3, 0x2f, 0x1c, 0x4b, 0x43, 0x5f, 0x81, 0x32, 0xeb, 0x1e, 0xc6, 0xd9, 0x5b, 0x9e, + 0x66, 0x9c, 0x2a, 0x0f, 0x12, 0x14, 0xd6, 0xe9, 0xcc, 0x37, 0xa1, 0xb4, 0xeb, 0xda, 0x34, 0x10, + 0xfd, 0xdb, 0x93, 0x30, 0xcb, 0x52, 0x0d, 0x4e, 0x7c, 0x92, 0x91, 0x97, 0x45, 0x78, 0xee, 0x5e, + 0xbe, 0xe5, 0x07, 0xb2, 0x8d, 0x29, 0x24, 0xee, 0xf5, 0x2a, 0x07, 0x62, 0x89, 0xbb, 0xb1, 0xcc, + 0x0b, 0x84, 0x9f, 0xbe, 0x5f, 0x9b, 0x7a, 0xf7, 0xfd, 0xda, 0xd4, 0x7b, 0xef, 0xab, 0x62, 0xe1, + 0x1c, 0x00, 0xf6, 0x0e, 0xbf, 0x47, 0x6c, 0x19, 0x76, 0x33, 0x8d, 0xe4, 0xa2, 0x49, 0xb0, 0x18, + 0xc9, 0xe5, 0x06, 0x8a, 0x3e, 0x0d, 0x87, 0x53, 0x94, 0x68, 0x1d, 0x4a, 0xf1, 0xb0, 0x4d, 0xf9, + 0xc7, 0x52, 0xe4, 0x6f, 0xf1, 0x44, 0x0e, 0x27, 0x34, 0xa9, 0x1c, 0x30, 0x7d, 0x61, 0x0e, 0x68, + 0x40, 0xbe, 0xeb, 0x3a, 0xaa, 0xd9, 0x7d, 0x26, 0xca, 0xc1, 0x77, 0x77, 0x9a, 0xe7, 0xfd, 0xda, + 0x63, 0xe3, 0x66, 0xdc, 0x61, 0xaf, 0x43, 0x58, 0xfd, 0xee, 0x4e, 0x13, 0x73, 0xe6, 0x51, 0x01, + 0x69, 0x66, 0xc2, 0x80, 0x74, 0x0d, 0xa0, 0x95, 0x8c, 0x0c, 0xe4, 0x7d, 0x8f, 0x1d, 0x51, 0x1b, + 0x15, 0x68, 0x54, 0x88, 0xc1, 0x92, 0xcd, 0xfb, 0x6a, 0xd5, 0xba, 0xb3, 0xd0, 0x6a, 0xcb, 0x21, + 0xe4, 0x64, 0x77, 0xe2, 0x8a, 0x52, 0xb3, 0xb4, 0x35, 0x28, 0x0c, 0x0f, 0xcb, 0x47, 0x01, 0x2c, + 0x39, 0xaa, 0x43, 0x4c, 0x94, 0x96, 0x26, 0x56, 0x7a, 0x99, 0x2b, 0x6c, 0x0e, 0x0a, 0xc2, 0xc3, + 0xb2, 0xd1, 0x77, 0x61, 0x25, 0x02, 0x0e, 0xb7, 0xe9, 0x22, 0x60, 0xe7, 0x1b, 0xab, 0x67, 0xfd, + 0xda, 0x4a, 0x73, 0x2c, 0x15, 0x7e, 0x80, 0x04, 0xe4, 0xc0, 0x8c, 0x27, 0x0b, 0xdc, 0xb2, 0x28, + 0x4a, 0xbe, 0x9a, 0x6d, 0x15, 0x89, 0xf7, 0xd7, 0xf5, 0xc2, 0x36, 0x1e, 0x97, 0xa8, 0x9a, 0x56, + 0xc9, 0x46, 0x6f, 0x41, 0xd9, 0xf2, 0xfd, 0x20, 0xb4, 0xe4, 0xe0, 0x60, 0x4e, 0xa8, 0xda, 0x9c, + 0x58, 0xd5, 0x66, 0x22, 0x63, 0xa0, 0x90, 0xd6, 0x30, 0x58, 0x57, 0x85, 0xee, 0xc3, 0x42, 0x70, + 0xdf, 0x27, 0x14, 0x93, 0x23, 0x42, 0x89, 0x6f, 0x13, 0x56, 0xad, 0x08, 0xed, 0xcf, 0x66, 0xd4, + 0x9e, 0x62, 0x4e, 0x5c, 0x3a, 0x0d, 0x67, 0x78, 0x50, 0x0b, 0xaa, 0xf3, 0xd8, 0xea, 0x5b, 0x9e, + 0xfb, 0x7d, 0x42, 0x59, 0x75, 0x3e, 0x99, 0x13, 0x6f, 0xc7, 0x50, 0xac, 0x51, 0xf0, 0xe8, 0x67, + 0x7b, 0x5d, 0x16, 0x12, 0x39, 0xb4, 0x5f, 0x48, 0x47, 0xbf, 0xad, 0x04, 0x85, 0x75, 0x3a, 0xd4, + 0x85, 0x4a, 0x5b, 0xcf, 0x34, 0xd5, 0x25, 0xb1, 0xba, 0xeb, 0xd9, 0x56, 0x37, 0x9c, 0x0b, 0x93, + 0xc2, 0x27, 0x85, 0xc3, 0x69, 0x2d, 0x2b, 0xcf, 0x43, 0xf9, 0x53, 0xf6, 0x04, 0xbc, 0xa7, 0x18, + 0x3c, 0xc7, 0x89, 0x7a, 0x8a, 0x3f, 0xe6, 0x60, 0x3e, 0xbd, 0xfb, 0x03, 0x59, 0xb4, 0x90, 0x29, + 0x8b, 0x46, 0xdd, 0xab, 0x31, 0xf6, 0x9d, 0x21, 0x0a, 0xeb, 0xf9, 0xb1, 0x61, 0x5d, 0x45, 0xcf, + 0xe9, 0x87, 0x89, 0x9e, 0x75, 0x00, 0x5e, 0x9e, 0xd0, 0xc0, 0xf3, 0x08, 0x15, 0x81, 0xb3, 0xa8, + 0xde, 0x13, 0x62, 0x28, 0xd6, 0x28, 0x78, 0x11, 0x7d, 0xe8, 0x05, 0xf6, 0x89, 0xd8, 0x82, 0xe8, + 0xd2, 0x8b, 0x90, 0x59, 0x94, 0x45, 0x74, 0x63, 0x08, 0x8b, 0x47, 0x70, 0x98, 0x3d, 0xb8, 0xbc, + 0x6f, 0xd1, 0xd0, 0xb5, 0xbc, 0xe4, 0x82, 0x89, 0x2e, 0xe5, 0x8d, 0xa1, 0x1e, 0xe8, 0x99, 0x49, + 0x2f, 0x6a, 0xb2, 0xf9, 0x09, 0x2c, 0xe9, 0x83, 0xcc, 0xbf, 0x1a, 0x70, 0x65, 0xa4, 0xee, 0xcf, + 0xa0, 0x07, 0x7b, 0x23, 0xdd, 0x83, 0xbd, 0x90, 0x71, 0x78, 0x39, 0xca, 0xda, 0x31, 0x1d, 0xd9, + 0x2c, 0x14, 0xf6, 0x79, 0xed, 0x6b, 0xfe, 0xc2, 0x80, 0x39, 0xf1, 0x6b, 0x92, 0xc1, 0x6f, 0x2d, + 0xfd, 0x1c, 0x50, 0x7a, 0x84, 0x4f, 0x01, 0xef, 0x18, 0x90, 0x1e, 0xb9, 0xa2, 0x97, 0xa4, 0xff, + 0x1a, 0xf1, 0x4c, 0x74, 0x42, 0xdf, 0x7d, 0x71, 0x5c, 0x07, 0x79, 0x29, 0xd3, 0x70, 0xf1, 0x29, + 0x28, 0xe1, 0x20, 0x08, 0xf7, 0xad, 0xf0, 0x98, 0xf1, 0x85, 0x77, 0xf8, 0x0f, 0xb5, 0x37, 0x62, + 0xe1, 0x02, 0x83, 0x25, 0xdc, 0xfc, 0xb9, 0x01, 0x57, 0xc6, 0x3e, 0xd1, 0xf0, 0x10, 0x60, 0xc7, + 0x5f, 0x6a, 0x45, 0xb1, 0x17, 0x26, 0x74, 0x58, 0xa3, 0xe2, 0xad, 0x5f, 0xea, 0x5d, 0x67, 0xb0, + 0xf5, 0x4b, 0x69, 0xc3, 0x69, 0x5a, 0xf3, 0x9f, 0x39, 0x50, 0x6f, 0x22, 0xff, 0x65, 0x8f, 0x7d, + 0x62, 0xe0, 0x45, 0x66, 0x3e, 0xfd, 0x22, 0x13, 0x3f, 0xbf, 0x68, 0x4f, 0x12, 0xf9, 0x07, 0x3f, + 0x49, 0xa0, 0xe7, 0xe2, 0x57, 0x0e, 0x19, 0xba, 0x56, 0xd3, 0xaf, 0x1c, 0xe7, 0xfd, 0xda, 0x9c, + 0x12, 0x9e, 0x7e, 0xf5, 0x78, 0x0d, 0x66, 0x1d, 0x12, 0x5a, 0xae, 0x27, 0xdb, 0xb8, 0xcc, 0xb3, + 0x7f, 0x29, 0xac, 0x29, 0x59, 0x1b, 0x65, 0x6e, 0x93, 0xfa, 0xc0, 0x91, 0x40, 0x1e, 0x6d, 0xed, + 0xc0, 0x91, 0x5d, 0x48, 0x21, 0x89, 0xb6, 0x5b, 0x81, 0x43, 0xb0, 0xc0, 0x98, 0xef, 0x1a, 0x50, + 0x96, 0x92, 0xb6, 0xac, 0x2e, 0x23, 0x68, 0x23, 0x5e, 0x85, 0x3c, 0xee, 0x2b, 0xfa, 0x73, 0xd6, + 0x79, 0xbf, 0x56, 0x12, 0x64, 0xa2, 0x81, 0x19, 0xf1, 0x6c, 0x93, 0xbb, 0x60, 0x8f, 0x1e, 0x87, + 0x82, 0xb8, 0x3d, 0x6a, 0x33, 0x93, 0x77, 0x39, 0x0e, 0xc4, 0x12, 0x67, 0x7e, 0x9c, 0x83, 0x4a, + 0x6a, 0x71, 0x19, 0x7a, 0x81, 0x78, 0xe2, 0x99, 0xcb, 0x30, 0x45, 0x1f, 0xff, 0x0a, 0xae, 0x72, + 0xcf, 0xcc, 0xc3, 0xe4, 0x9e, 0x6f, 0xc3, 0x8c, 0xcd, 0xf7, 0x28, 0xfa, 0x53, 0xc5, 0xc6, 0x24, + 0xc7, 0x29, 0x76, 0x37, 0xf1, 0x46, 0xf1, 0xc9, 0xb0, 0x12, 0x88, 0x6e, 0xc1, 0x12, 0x25, 0x21, + 0xed, 0x6d, 0x1e, 0x85, 0x84, 0xea, 0xbd, 0x7f, 0x21, 0xa9, 0xb8, 0xf1, 0x20, 0x01, 0x1e, 0xe6, + 0x31, 0x0f, 0x61, 0xee, 0x8e, 0x75, 0xe8, 0xc5, 0xaf, 0x59, 0x18, 0x2a, 0xae, 0x6f, 0x7b, 0x5d, + 0x87, 0xc8, 0x68, 0x1c, 0x45, 0xaf, 0xe8, 0xd2, 0xee, 0xe8, 0xc8, 0xf3, 0x7e, 0xed, 0x52, 0x0a, + 0x20, 0x9f, 0x6f, 0x70, 0x5a, 0x84, 0xe9, 0xc1, 0xf4, 0x67, 0xd8, 0x3d, 0x7e, 0x07, 0x4a, 0x49, + 0x7d, 0xff, 0x88, 0x55, 0x9a, 0x6f, 0x40, 0x91, 0x7b, 0x7c, 0xd4, 0x97, 0x5e, 0x50, 0xe2, 0xa4, + 0x0b, 0xa7, 0x5c, 0x96, 0xc2, 0xc9, 0x6c, 0x43, 0xe5, 0x6e, 0xc7, 0x79, 0xc8, 0xf7, 0xcc, 0x5c, + 0xe6, 0xac, 0x75, 0x0d, 0xe4, 0xff, 0x35, 0x78, 0x82, 0x90, 0x99, 0x5b, 0x4b, 0x10, 0x7a, 0xe2, + 0xd5, 0x86, 0xf9, 0x3f, 0x36, 0x00, 0xc4, 0xd4, 0xec, 0xe6, 0x29, 0xf1, 0xc3, 0x0c, 0xaf, 0xde, + 0x77, 0x61, 0x26, 0x90, 0xde, 0x24, 0xdf, 0x34, 0x27, 0x1c, 0xcd, 0xc6, 0x97, 0x40, 0xfa, 0x13, + 0x56, 0xc2, 0x1a, 0x57, 0x3f, 0xf8, 0x64, 0x75, 0xea, 0xc3, 0x4f, 0x56, 0xa7, 0x3e, 0xfa, 0x64, + 0x75, 0xea, 0xed, 0xb3, 0x55, 0xe3, 0x83, 0xb3, 0x55, 0xe3, 0xc3, 0xb3, 0x55, 0xe3, 0xa3, 0xb3, + 0x55, 0xe3, 0xe3, 0xb3, 0x55, 0xe3, 0xdd, 0xbf, 0xaf, 0x4e, 0xbd, 0x96, 0x3b, 0xdd, 0xf8, 0x4f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x18, 0xc5, 0x8c, 0x25, 0x27, 0x00, 0x00, } func (m *APIGroup) Marshal() (dAtA []byte, err error) { @@ -2568,6 +2569,11 @@ func (m *ManagedFieldsEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i -= len(m.Subresource) + copy(dAtA[i:], m.Subresource) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subresource))) + i-- + dAtA[i] = 0x42 if m.FieldsV1 != nil { { size, err := m.FieldsV1.MarshalToSizedBuffer(dAtA[:i]) @@ -3914,6 +3920,8 @@ func (m *ManagedFieldsEntry) Size() (n int) { l = m.FieldsV1.Size() n += 1 + l + sovGenerated(uint64(l)) } + l = len(m.Subresource) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -4508,6 +4516,7 @@ func (this *ManagedFieldsEntry) String() string { `Time:` + strings.Replace(fmt.Sprintf("%v", this.Time), "Time", "Time", 1) + `,`, `FieldsType:` + fmt.Sprintf("%v", this.FieldsType) + `,`, `FieldsV1:` + strings.Replace(fmt.Sprintf("%v", this.FieldsV1), "FieldsV1", "FieldsV1", 1) + `,`, + `Subresource:` + fmt.Sprintf("%v", this.Subresource) + `,`, `}`, }, "") return s @@ -8442,6 +8451,38 @@ func (m *ManagedFieldsEntry) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subresource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subresource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto index 4f41504f3ff3..f1cb025a3170 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto @@ -589,6 +589,15 @@ message ManagedFieldsEntry { // FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. // +optional optional FieldsV1 fieldsV1 = 7; + + // Subresource is the name of the subresource used to update that object, or + // empty string if the object was updated through the main resource. The + // value of this field is used to distinguish between managers, even if they + // share the same name. For example, a status update will be distinct from a + // regular update using the same manager name. + // Note that the APIVersion field is not related to the Subresource field and + // it always corresponds to the version of the main resource. + optional string subresource = 8; } // MicroTime is version of Time with microsecond level precision. @@ -788,6 +797,7 @@ message ObjectMeta { // OwnerReference contains enough information to let you identify an owning // object. An owning object must be in the same namespace as the dependent, or // be cluster-scoped, so there is no namespace field. +// +structType=atomic message OwnerReference { // API version of the referent. optional string apiVersion = 5; diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go index 79e2ad48a040..fb680a44bdf9 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go @@ -303,6 +303,7 @@ const ( // OwnerReference contains enough information to let you identify an owning // object. An owning object must be in the same namespace as the dependent, or // be cluster-scoped, so there is no namespace field. +// +structType=atomic type OwnerReference struct { // API version of the referent. APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"` @@ -1180,6 +1181,15 @@ type ManagedFieldsEntry struct { // FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. // +optional FieldsV1 *FieldsV1 `json:"fieldsV1,omitempty" protobuf:"bytes,7,opt,name=fieldsV1"` + + // Subresource is the name of the subresource used to update that object, or + // empty string if the object was updated through the main resource. The + // value of this field is used to distinguish between managers, even if they + // share the same name. For example, a status update will be distinct from a + // regular update using the same manager name. + // Note that the APIVersion field is not related to the Subresource field and + // it always corresponds to the version of the main resource. + Subresource string `json:"subresource,omitempty" protobuf:"bytes,8,opt,name=subresource"` } // ManagedFieldsOperationType is the type of operation which lead to a ManagedFieldsEntry being created. diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go index c33d8ffa7387..b5c43cca7d15 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go @@ -222,13 +222,14 @@ func (ListOptions) SwaggerDoc() map[string]string { } var map_ManagedFieldsEntry = map[string]string{ - "": "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", - "manager": "Manager is an identifier of the workflow managing these fields.", - "operation": "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", - "apiVersion": "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", - "time": "Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply'", - "fieldsType": "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", - "fieldsV1": "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.", + "": "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", + "manager": "Manager is an identifier of the workflow managing these fields.", + "operation": "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", + "apiVersion": "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", + "time": "Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply'", + "fieldsType": "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", + "fieldsV1": "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.", + "subresource": "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", } func (ManagedFieldsEntry) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go index a5a7f144addb..6706103ee182 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go @@ -171,6 +171,8 @@ func ValidateTableOptions(opts *metav1.TableOptions) field.ErrorList { return allErrs } +const MaxSubresourceNameLength = 256 + func ValidateManagedFields(fieldsList []metav1.ManagedFieldsEntry, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList for i, fields := range fieldsList { @@ -184,6 +186,10 @@ func ValidateManagedFields(fieldsList []metav1.ManagedFieldsEntry, fldPath *fiel allErrs = append(allErrs, field.Invalid(fldPath.Child("fieldsType"), fields.FieldsType, "must be `FieldsV1`")) } allErrs = append(allErrs, ValidateFieldManager(fields.Manager, fldPath.Child("manager"))...) + + if len(fields.Subresource) > MaxSubresourceNameLength { + allErrs = append(allErrs, field.TooLong(fldPath.Child("subresource"), fields.Subresource, MaxSubresourceNameLength)) + } } return allErrs } diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/labels/selector.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/labels/selector.go index b0865777a29a..4b8ca3ec2f67 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/labels/selector.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/labels/selector.go @@ -31,12 +31,15 @@ import ( ) var ( - validRequirementOperators = []string{ + unaryOperators = []string{ + string(selection.Exists), string(selection.DoesNotExist), + } + binaryOperators = []string{ string(selection.In), string(selection.NotIn), string(selection.Equals), string(selection.DoubleEquals), string(selection.NotEquals), - string(selection.Exists), string(selection.DoesNotExist), string(selection.GreaterThan), string(selection.LessThan), } + validRequirementOperators = append(binaryOperators, unaryOperators...) ) // Requirements is AND of all requirements. @@ -140,7 +143,7 @@ type Requirement struct { // NewRequirement is the constructor for a Requirement. // If any of these rules is violated, an error is returned: -// (1) The operator can only be In, NotIn, Equals, DoubleEquals, NotEquals, Exists, or DoesNotExist. +// (1) The operator can only be In, NotIn, Equals, DoubleEquals, Gt, Lt, NotEquals, Exists, or DoesNotExist. // (2) If the operator is In or NotIn, the values set must be non-empty. // (3) If the operator is Equals, DoubleEquals, or NotEquals, the values set must contain one value. // (4) If the operator is Exists or DoesNotExist, the value set must be empty. @@ -753,7 +756,7 @@ func (p *Parser) parseOperator() (op selection.Operator, err error) { case NotEqualsToken: op = selection.NotEquals default: - return "", fmt.Errorf("found '%s', expected: '=', '!=', '==', 'in', notin'", lit) + return "", fmt.Errorf("found '%s', expected: %v", lit, strings.Join(binaryOperators, ", ")) } return op, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go index 14cfef5cad64..ae47ab3abae4 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go @@ -229,6 +229,32 @@ func (s *Scheme) KnownTypes(gv schema.GroupVersion) map[string]reflect.Type { return types } +// VersionsForGroupKind returns the versions that a particular GroupKind can be converted to within the given group. +// A GroupKind might be converted to a different group. That information is available in EquivalentResourceMapper. +func (s *Scheme) VersionsForGroupKind(gk schema.GroupKind) []schema.GroupVersion { + availableVersions := []schema.GroupVersion{} + for gvk := range s.gvkToType { + if gk != gvk.GroupKind() { + continue + } + + availableVersions = append(availableVersions, gvk.GroupVersion()) + } + + // order the return for stability + ret := []schema.GroupVersion{} + for _, version := range s.PrioritizedVersionsForGroup(gk.Group) { + for _, availableVersion := range availableVersions { + if version != availableVersion { + continue + } + ret = append(ret, availableVersion) + } + } + + return ret +} + // AllKnownTypes returns the all known types. func (s *Scheme) AllKnownTypes() map[schema.GroupVersionKind]reflect.Type { return s.gvkToType diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go index 00ce5f785c8b..32f075782a9a 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go @@ -78,6 +78,8 @@ type Connection interface { // SetIdleTimeout sets the amount of time the connection may remain idle before // it is automatically closed. SetIdleTimeout(timeout time.Duration) + // RemoveStreams can be used to remove a set of streams from the Connection. + RemoveStreams(streams ...Stream) } // Stream represents a bidirectional communications channel that is part of an diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go index 21b2568d9003..3da7457f4827 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go @@ -31,7 +31,7 @@ import ( // streams. type connection struct { conn *spdystream.Connection - streams []httpstream.Stream + streams map[uint32]httpstream.Stream streamLock sync.Mutex newStreamHandler httpstream.NewStreamHandler ping func() (time.Duration, error) @@ -85,7 +85,12 @@ func NewServerConnectionWithPings(conn net.Conn, newStreamHandler httpstream.New // will be invoked when the server receives a newly created stream from the // client. func newConnection(conn *spdystream.Connection, newStreamHandler httpstream.NewStreamHandler, pingPeriod time.Duration, pingFn func() (time.Duration, error)) httpstream.Connection { - c := &connection{conn: conn, newStreamHandler: newStreamHandler, ping: pingFn} + c := &connection{ + conn: conn, + newStreamHandler: newStreamHandler, + ping: pingFn, + streams: make(map[uint32]httpstream.Stream), + } go conn.Serve(c.newSpdyStream) if pingPeriod > 0 && pingFn != nil { go c.sendPings(pingPeriod) @@ -105,7 +110,7 @@ func (c *connection) Close() error { // calling Reset instead of Close ensures that all streams are fully torn down s.Reset() } - c.streams = make([]httpstream.Stream, 0) + c.streams = make(map[uint32]httpstream.Stream, 0) c.streamLock.Unlock() // now that all streams are fully torn down, it's safe to call close on the underlying connection, @@ -114,6 +119,15 @@ func (c *connection) Close() error { return c.conn.Close() } +// RemoveStreams can be used to removes a set of streams from the Connection. +func (c *connection) RemoveStreams(streams ...httpstream.Stream) { + c.streamLock.Lock() + for _, stream := range streams { + delete(c.streams, stream.Identifier()) + } + c.streamLock.Unlock() +} + // CreateStream creates a new stream with the specified headers and registers // it with the connection. func (c *connection) CreateStream(headers http.Header) (httpstream.Stream, error) { @@ -133,7 +147,7 @@ func (c *connection) CreateStream(headers http.Header) (httpstream.Stream, error // it owns. func (c *connection) registerStream(s httpstream.Stream) { c.streamLock.Lock() - c.streams = append(c.streams, s) + c.streams[s.Identifier()] = s c.streamLock.Unlock() } diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/managedfields/extract.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/managedfields/extract.go new file mode 100644 index 000000000000..590c168670f9 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/managedfields/extract.go @@ -0,0 +1,101 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package managedfields + +import ( + "bytes" + "fmt" + + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" + "sigs.k8s.io/structured-merge-diff/v4/typed" + + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" +) + +// ExtractInto extracts the applied configuration state from object for fieldManager +// into applyConfiguration. If no managed fields are found for the given fieldManager, +// no error is returned, but applyConfiguration is left unpopulated. It is possible +// that no managed fields were found for the fieldManager because other field managers +// have taken ownership of all the fields previously owned by the fieldManager. It is +// also possible the fieldManager never owned fields. +// +// The provided object MUST bo a root resource object since subresource objects +// do not contain their own managed fields. For example, an autoscaling.Scale +// object read from a "scale" subresource does not have any managed fields and so +// cannot be used as the object. +// +// If the fields of a subresource are a subset of the fields of the root object, +// and their field paths and types are exactly the same, then ExtractInto can be +// called with the root resource as the object and the subresource as the +// applyConfiguration. This works for "status", obviously, because status is +// represented by the exact same object as the root resource. This this does NOT +// work, for example, with the "scale" subresources of Deployment, ReplicaSet and +// StatefulSet. While the spec.replicas, status.replicas fields are in the same +// exact field path locations as they are in autoscaling.Scale, the selector +// fields are in different locations, and are a different type. +func ExtractInto(object runtime.Object, objectType typed.ParseableType, fieldManager string, applyConfiguration interface{}, subresource string) error { + typedObj, err := toTyped(object, objectType) + if err != nil { + return fmt.Errorf("error converting obj to typed: %w", err) + } + + accessor, err := meta.Accessor(object) + if err != nil { + return fmt.Errorf("error accessing metadata: %w", err) + } + fieldsEntry, ok := findManagedFields(accessor, fieldManager, subresource) + if !ok { + return nil + } + fieldset := &fieldpath.Set{} + err = fieldset.FromJSON(bytes.NewReader(fieldsEntry.FieldsV1.Raw)) + if err != nil { + return fmt.Errorf("error marshalling FieldsV1 to JSON: %w", err) + } + + u := typedObj.ExtractItems(fieldset.Leaves()).AsValue().Unstructured() + m, ok := u.(map[string]interface{}) + if !ok { + return fmt.Errorf("unable to convert managed fields for %s to unstructured, expected map, got %T", fieldManager, u) + } + if err := runtime.DefaultUnstructuredConverter.FromUnstructured(m, applyConfiguration); err != nil { + return fmt.Errorf("error extracting into obj from unstructured: %w", err) + } + return nil +} + +func findManagedFields(accessor metav1.Object, fieldManager string, subresource string) (metav1.ManagedFieldsEntry, bool) { + objManagedFields := accessor.GetManagedFields() + for _, mf := range objManagedFields { + if mf.Manager == fieldManager && mf.Operation == metav1.ManagedFieldsOperationApply && mf.Subresource == subresource { + return mf, true + } + } + return metav1.ManagedFieldsEntry{}, false +} + +func toTyped(obj runtime.Object, objectType typed.ParseableType) (*typed.TypedValue, error) { + switch o := obj.(type) { + case *unstructured.Unstructured: + return objectType.FromUnstructured(o.Object) + default: + return objectType.FromStructured(o) + } +} diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go index cf8023da7836..28c654676eef 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go @@ -32,6 +32,7 @@ import ( "golang.org/x/net/html/atom" "k8s.io/klog/v2" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/sets" ) @@ -101,7 +102,7 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { resp, err := rt.RoundTrip(req) if err != nil { - return nil, fmt.Errorf("error trying to reach service: %w", err) + return nil, errors.NewServiceUnavailable(fmt.Sprintf("error trying to reach service: %v", err)) } if redirect := resp.Header.Get("Location"); redirect != "" { diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go index 0cd5d65775a7..c283ad189a0e 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go @@ -181,7 +181,7 @@ func Invalid(field *Path, value interface{}, detail string) *Error { // valid values). func NotSupported(field *Path, value interface{}, validValues []string) *Error { detail := "" - if validValues != nil && len(validValues) > 0 { + if len(validValues) > 0 { quotedValues := make([]string, len(validValues)) for i, v := range validValues { quotedValues[i] = strconv.Quote(v) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager.go index d9b28ad78566..ae57e6739a28 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager.go @@ -36,6 +36,11 @@ type mutatingWebhookConfigurationManager struct { configuration *atomic.Value lister admissionregistrationlisters.MutatingWebhookConfigurationLister hasSynced func() bool + // initialConfigurationSynced stores a boolean value, which tracks if + // the existing webhook configs have been synced (honored) by the + // manager at startup-- the informer has synced and either has no items + // or has finished executing updateConfiguration() once. + initialConfigurationSynced *atomic.Value } var _ generic.Source = &mutatingWebhookConfigurationManager{} @@ -43,13 +48,15 @@ var _ generic.Source = &mutatingWebhookConfigurationManager{} func NewMutatingWebhookConfigurationManager(f informers.SharedInformerFactory) generic.Source { informer := f.Admissionregistration().V1().MutatingWebhookConfigurations() manager := &mutatingWebhookConfigurationManager{ - configuration: &atomic.Value{}, - lister: informer.Lister(), - hasSynced: informer.Informer().HasSynced, + configuration: &atomic.Value{}, + lister: informer.Lister(), + hasSynced: informer.Informer().HasSynced, + initialConfigurationSynced: &atomic.Value{}, } // Start with an empty list manager.configuration.Store([]webhook.WebhookAccessor{}) + manager.initialConfigurationSynced.Store(false) // On any change, rebuild the config informer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ @@ -66,8 +73,27 @@ func (m *mutatingWebhookConfigurationManager) Webhooks() []webhook.WebhookAccess return m.configuration.Load().([]webhook.WebhookAccessor) } +// HasSynced returns true when the manager is synced with existing webhookconfig +// objects at startup-- which means the informer is synced and either has no items +// or updateConfiguration() has completed. func (m *mutatingWebhookConfigurationManager) HasSynced() bool { - return m.hasSynced() + if !m.hasSynced() { + return false + } + if m.initialConfigurationSynced.Load().(bool) { + // the informer has synced and configuration has been updated + return true + } + if configurations, err := m.lister.List(labels.Everything()); err == nil && len(configurations) == 0 { + // the empty list we initially stored is valid to use. + // Setting initialConfigurationSynced to true, so subsequent checks + // would be able to take the fast path on the atomic boolean in a + // cluster without any admission webhooks configured. + m.initialConfigurationSynced.Store(true) + // the informer has synced and we don't have any items + return true + } + return false } func (m *mutatingWebhookConfigurationManager) updateConfiguration() { @@ -77,6 +103,7 @@ func (m *mutatingWebhookConfigurationManager) updateConfiguration() { return } m.configuration.Store(mergeMutatingWebhookConfigurations(configurations)) + m.initialConfigurationSynced.Store(true) } func mergeMutatingWebhookConfigurations(configurations []*v1.MutatingWebhookConfiguration) []webhook.WebhookAccessor { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager.go index 37062b082e1e..b8c1904ea8a1 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager.go @@ -36,6 +36,11 @@ type validatingWebhookConfigurationManager struct { configuration *atomic.Value lister admissionregistrationlisters.ValidatingWebhookConfigurationLister hasSynced func() bool + // initialConfigurationSynced stores a boolean value, which tracks if + // the existing webhook configs have been synced (honored) by the + // manager at startup-- the informer has synced and either has no items + // or has finished executing updateConfiguration() once. + initialConfigurationSynced *atomic.Value } var _ generic.Source = &validatingWebhookConfigurationManager{} @@ -43,13 +48,15 @@ var _ generic.Source = &validatingWebhookConfigurationManager{} func NewValidatingWebhookConfigurationManager(f informers.SharedInformerFactory) generic.Source { informer := f.Admissionregistration().V1().ValidatingWebhookConfigurations() manager := &validatingWebhookConfigurationManager{ - configuration: &atomic.Value{}, - lister: informer.Lister(), - hasSynced: informer.Informer().HasSynced, + configuration: &atomic.Value{}, + lister: informer.Lister(), + hasSynced: informer.Informer().HasSynced, + initialConfigurationSynced: &atomic.Value{}, } // Start with an empty list manager.configuration.Store([]webhook.WebhookAccessor{}) + manager.initialConfigurationSynced.Store(false) // On any change, rebuild the config informer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ @@ -66,9 +73,28 @@ func (v *validatingWebhookConfigurationManager) Webhooks() []webhook.WebhookAcce return v.configuration.Load().([]webhook.WebhookAccessor) } -// HasSynced returns true if the shared informers have synced. +// HasSynced returns true when the manager is synced with existing webhookconfig +// objects at startup-- which means the informer is synced and either has no items +// or updateConfiguration() has completed. func (v *validatingWebhookConfigurationManager) HasSynced() bool { - return v.hasSynced() + if !v.hasSynced() { + return false + } + if v.initialConfigurationSynced.Load().(bool) { + // the informer has synced and configuration has been updated + return true + } + if configurations, err := v.lister.List(labels.Everything()); err == nil && len(configurations) == 0 { + // the empty list we initially stored is valid to use. + // Setting initialConfigurationSynced to true, so subsequent checks + // would be able to take the fast path on the atomic boolean in a + // cluster without any admission webhooks configured. + v.initialConfigurationSynced.Store(true) + // the informer has synced and we don't have any items + return true + } + return false + } func (v *validatingWebhookConfigurationManager) updateConfiguration() { @@ -78,6 +104,7 @@ func (v *validatingWebhookConfigurationManager) updateConfiguration() { return } v.configuration.Store(mergeValidatingWebhookConfigurations(configurations)) + v.initialConfigurationSynced.Store(true) } func mergeValidatingWebhookConfigurations(configurations []*v1.ValidatingWebhookConfiguration) []webhook.WebhookAccessor { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go index 0410d0378595..fc636601b5d7 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go @@ -214,12 +214,12 @@ func (a *mutatingDispatcher) callAttrMutatingHook(ctx context.Context, h *admiss uid, request, response, err := webhookrequest.CreateAdmissionObjects(attr, invocation) if err != nil { - return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: err} + return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: fmt.Errorf("could not create admission objects: %w", err)} } // Make the webhook request client, err := invocation.Webhook.GetRESTClient(a.cm) if err != nil { - return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: err} + return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: fmt.Errorf("could not get REST client: %w", err)} } trace := utiltrace.New("Call mutating webhook", utiltrace.Field{"configuration", configurationName}, @@ -253,13 +253,13 @@ func (a *mutatingDispatcher) callAttrMutatingHook(ctx context.Context, h *admiss } if err := r.Do(ctx).Into(response); err != nil { - return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: err} + return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: fmt.Errorf("failed to call webhook: %w", err)} } trace.Step("Request completed") result, err := webhookrequest.VerifyAdmissionResponse(uid, true, response) if err != nil { - return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: err} + return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: fmt.Errorf("received invalid webhook response: %w", err)} } for k, v := range result.AuditAnnotations { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/types.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/types.go index b497be6df270..e94a60093fd2 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/types.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/types.go @@ -62,15 +62,15 @@ type Stage string const ( // The stage for events generated as soon as the audit handler receives the request, and before it // is delegated down the handler chain. - StageRequestReceived = "RequestReceived" + StageRequestReceived Stage = "RequestReceived" // The stage for events generated once the response headers are sent, but before the response body // is sent. This stage is only generated for long-running requests (e.g. watch). - StageResponseStarted = "ResponseStarted" + StageResponseStarted Stage = "ResponseStarted" // The stage for events generated once the response body has been completed, and no more bytes // will be sent. - StageResponseComplete = "ResponseComplete" + StageResponseComplete Stage = "ResponseComplete" // The stage for events generated when a panic occurred. - StagePanic = "Panic" + StagePanic Stage = "Panic" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1/types.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1/types.go index cf6bb1a01950..dace73ed9514 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1/types.go @@ -55,15 +55,15 @@ type Stage string const ( // The stage for events generated as soon as the audit handler receives the request, and before it // is delegated down the handler chain. - StageRequestReceived = "RequestReceived" + StageRequestReceived Stage = "RequestReceived" // The stage for events generated once the response headers are sent, but before the response body // is sent. This stage is only generated for long-running requests (e.g. watch). - StageResponseStarted = "ResponseStarted" + StageResponseStarted Stage = "ResponseStarted" // The stage for events generated once the response body has been completed, and no more bytes // will be sent. - StageResponseComplete = "ResponseComplete" + StageResponseComplete Stage = "ResponseComplete" // The stage for events generated when a panic occurred. - StagePanic = "Panic" + StagePanic Stage = "Panic" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go index 3e4eca4821a8..2616f5fe7090 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go @@ -62,15 +62,15 @@ type Stage string const ( // The stage for events generated as soon as the audit handler receives the request, and before it // is delegated down the handler chain. - StageRequestReceived = "RequestReceived" + StageRequestReceived Stage = "RequestReceived" // The stage for events generated once the response headers are sent, but before the response body // is sent. This stage is only generated for long-running requests (e.g. watch). - StageResponseStarted = "ResponseStarted" + StageResponseStarted Stage = "ResponseStarted" // The stage for events generated once the response body has been completed, and no more bytes // will be sent. - StageResponseComplete = "ResponseComplete" + StageResponseComplete Stage = "ResponseComplete" // The stage for events generated when a panic occurred. - StagePanic = "Panic" + StagePanic Stage = "Panic" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go index 0bf6bfcb98d1..eb538bc176df 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go @@ -55,15 +55,15 @@ type Stage string const ( // The stage for events generated as soon as the audit handler receives the request, and before it // is delegated down the handler chain. - StageRequestReceived = "RequestReceived" + StageRequestReceived Stage = "RequestReceived" // The stage for events generated once the response headers are sent, but before the response body // is sent. This stage is only generated for long-running requests (e.g. watch). - StageResponseStarted = "ResponseStarted" + StageResponseStarted Stage = "ResponseStarted" // The stage for events generated once the response body has been completed, and no more bytes // will be sent. - StageResponseComplete = "ResponseComplete" + StageResponseComplete Stage = "ResponseComplete" // The stage for events generated when a panic occurred. - StagePanic = "Panic" + StagePanic Stage = "Panic" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go index b4fbb28c384f..64600beca317 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go @@ -48,6 +48,11 @@ var ( // cluster and the availability of those running pods in the cluster, including kubelet and // kube-proxy. SuggestedPriorityLevelConfigurationSystem, + // "node-high" priority-level is for the node health reporting. It is separated from "system" + // to make sure that nodes are able to report their health even if kube-apiserver is not capable of + // handling load caused by pod startup (fetching secrets, events etc). + // NOTE: In large clusters 50% - 90% of all API calls use this priority-level. + SuggestedPriorityLevelConfigurationNodeHigh, // "leader-election" is dedicated for controllers' leader-election, which majorly affects the // availability of any controller runs in the cluster. SuggestedPriorityLevelConfigurationLeaderElection, @@ -64,6 +69,8 @@ var ( } SuggestedFlowSchemas = []*flowcontrol.FlowSchema{ SuggestedFlowSchemaSystemNodes, // references "system" priority-level + SuggestedFlowSchemaSystemNodeHigh, // references "node-high" priority-level + SuggestedFlowSchemaProbes, // references "exempt" priority-level SuggestedFlowSchemaSystemLeaderElection, // references "leader-election" priority-level SuggestedFlowSchemaWorkloadLeaderElection, // references "leader-election" priority-level SuggestedFlowSchemaKubeControllerManager, // references "workload-high" priority-level @@ -170,6 +177,22 @@ var ( }, }, }) + SuggestedPriorityLevelConfigurationNodeHigh = newPriorityLevelConfiguration( + "node-high", + flowcontrol.PriorityLevelConfigurationSpec{ + Type: flowcontrol.PriorityLevelEnablementLimited, + Limited: &flowcontrol.LimitedPriorityLevelConfiguration{ + AssuredConcurrencyShares: 40, + LimitResponse: flowcontrol.LimitResponse{ + Type: flowcontrol.LimitResponseTypeQueue, + Queuing: &flowcontrol.QueuingConfiguration{ + Queues: 64, + HandSize: 6, + QueueLengthLimit: 50, + }, + }, + }, + }) // leader-election priority-level SuggestedPriorityLevelConfigurationLeaderElection = newPriorityLevelConfiguration( "leader-election", @@ -260,6 +283,27 @@ var ( }, }, ) + SuggestedFlowSchemaSystemNodeHigh = newFlowSchema( + "system-node-high", "node-high", 400, + flowcontrol.FlowDistinguisherMethodByUserType, + flowcontrol.PolicyRulesWithSubjects{ + Subjects: groups(user.NodesGroup), // the nodes group + ResourceRules: []flowcontrol.ResourcePolicyRule{ + resourceRule( + []string{flowcontrol.VerbAll}, + []string{corev1.GroupName}, + []string{"nodes", "nodes/status"}, + []string{flowcontrol.NamespaceEvery}, + true), + resourceRule( + []string{flowcontrol.VerbAll}, + []string{coordinationv1.GroupName}, + []string{"leases"}, + []string{flowcontrol.NamespaceEvery}, + false), + }, + }, + ) SuggestedFlowSchemaSystemLeaderElection = newFlowSchema( "system-leader-election", "leader-election", 100, flowcontrol.FlowDistinguisherMethodByUserType, @@ -394,6 +438,19 @@ var ( }, }, ) + // the following flow schema exempts probes + SuggestedFlowSchemaProbes = newFlowSchema( + "probes", "exempt", 2, + "", // distinguisherMethodType + flowcontrol.PolicyRulesWithSubjects{ + Subjects: groups(user.AllUnauthenticated, user.AllAuthenticated), + NonResourceRules: []flowcontrol.NonResourcePolicyRule{ + nonResourceRule( + []string{"get"}, + []string{"/healthz", "/readyz", "/livez"}), + }, + }, + ) ) func newPriorityLevelConfiguration(name string, spec flowcontrol.PriorityLevelConfigurationSpec) *flowcontrol.PriorityLevelConfiguration { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/format.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/format.go index bf805f525734..9c0784a31680 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/format.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/format.go @@ -60,8 +60,8 @@ func EventString(ev *auditinternal.Event) string { ip = ev.SourceIPs[0] } - return fmt.Sprintf("%s AUDIT: id=%q stage=%q ip=%q method=%q user=%q groups=%q as=%q asgroups=%q namespace=%q uri=%q response=\"%s\"", - ev.RequestReceivedTimestamp.Format(time.RFC3339Nano), ev.AuditID, ev.Stage, ip, ev.Verb, username, groups, asuser, asgroups, namespace, ev.RequestURI, response) + return fmt.Sprintf("%s AUDIT: id=%q stage=%q ip=%q method=%q user=%q groups=%q as=%q asgroups=%q user-agent=%q namespace=%q uri=%q response=\"%s\"", + ev.RequestReceivedTimestamp.Format(time.RFC3339Nano), ev.AuditID, ev.Stage, ip, ev.Verb, username, groups, asuser, asgroups, ev.UserAgent, namespace, ev.RequestURI, response) } func auditStringSlice(inList []string) string { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/policy/util.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/policy/util.go index 29be912303c0..555386756dd3 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/policy/util.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/policy/util.go @@ -24,10 +24,10 @@ import ( // AllStages returns all possible stages func AllStages() sets.String { return sets.NewString( - audit.StageRequestReceived, - audit.StageResponseStarted, - audit.StageResponseComplete, - audit.StagePanic, + string(audit.StageRequestReceived), + string(audit.StageResponseStarted), + string(audit.StageResponseComplete), + string(audit.StagePanic), ) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/request.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/request.go index 205bf25c8b56..960ec93211f6 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/request.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/request.go @@ -23,9 +23,6 @@ import ( "reflect" "time" - "github.com/google/uuid" - "k8s.io/klog/v2" - authnv1 "k8s.io/api/authentication/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -36,6 +33,10 @@ import ( auditinternal "k8s.io/apiserver/pkg/apis/audit" "k8s.io/apiserver/pkg/authentication/user" "k8s.io/apiserver/pkg/authorization/authorizer" + "k8s.io/apiserver/pkg/endpoints/request" + "k8s.io/klog/v2" + + "github.com/google/uuid" ) const ( @@ -52,14 +53,11 @@ func NewEventFromRequest(req *http.Request, requestReceivedTimestamp time.Time, Level: level, } - // prefer the id from the headers. If not available, create a new one. - // TODO(audit): do we want to forbid the header for non-front-proxy users? - ids := req.Header.Get(auditinternal.HeaderAuditID) - if ids != "" { - ev.AuditID = types.UID(ids) - } else { - ev.AuditID = types.UID(uuid.New().String()) + auditID, found := request.AuditIDFrom(req.Context()) + if !found { + auditID = types.UID(uuid.New().String()) } + ev.AuditID = auditID ips := utilnet.SourceIPs(req) ev.SourceIPs = make([]string, len(ips)) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/delegating.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/delegating.go index 83697bb5470b..a386deb3e68c 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/delegating.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/delegating.go @@ -20,8 +20,6 @@ import ( "errors" "time" - "github.com/go-openapi/spec" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apiserver/pkg/authentication/authenticator" "k8s.io/apiserver/pkg/authentication/group" @@ -32,8 +30,10 @@ import ( "k8s.io/apiserver/pkg/authentication/request/websocket" "k8s.io/apiserver/pkg/authentication/request/x509" "k8s.io/apiserver/pkg/authentication/token/cache" + "k8s.io/apiserver/pkg/server/dynamiccertificates" webhooktoken "k8s.io/apiserver/plugin/pkg/authenticator/token/webhook" authenticationclient "k8s.io/client-go/kubernetes/typed/authentication/v1" + "k8s.io/kube-openapi/pkg/validation/spec" ) // DelegatingAuthenticatorConfig is the minimal configuration needed to create an authenticator @@ -44,6 +44,9 @@ type DelegatingAuthenticatorConfig struct { // TokenAccessReviewClient is a client to do token review. It can be nil. Then every token is ignored. TokenAccessReviewClient authenticationclient.TokenReviewInterface + // TokenAccessReviewTimeout specifies a time limit for requests made by the authorization webhook client. + TokenAccessReviewTimeout time.Duration + // WebhookRetryBackoff specifies the backoff parameters for the authentication webhook retry logic. // This allows us to configure the sleep time at each iteration and the maximum number of retries allowed // before we fail the webhook call in order to limit the fan out that ensues when the system is degraded. @@ -55,7 +58,7 @@ type DelegatingAuthenticatorConfig struct { // CAContentProvider are the options for verifying incoming connections using mTLS and directly assigning to users. // Generally this is the CA bundle file used to authenticate client certificates // If this is nil, then mTLS will not be used. - ClientCertificateCAContentProvider CAContentProvider + ClientCertificateCAContentProvider dynamiccertificates.CAContentProvider APIAudiences authenticator.Audiences @@ -88,7 +91,7 @@ func (c DelegatingAuthenticatorConfig) New() (authenticator.Request, *spec.Secur if c.WebhookRetryBackoff == nil { return nil, nil, errors.New("retry backoff parameters for delegating authentication webhook has not been specified") } - tokenAuth, err := webhooktoken.NewFromInterface(c.TokenAccessReviewClient, c.APIAudiences, *c.WebhookRetryBackoff) + tokenAuth, err := webhooktoken.NewFromInterface(c.TokenAccessReviewClient, c.APIAudiences, *c.WebhookRetryBackoff, c.TokenAccessReviewTimeout) if err != nil { return nil, nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/loopback.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/loopback.go index f31656529fe1..fe51afcbc244 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/loopback.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/loopback.go @@ -24,6 +24,6 @@ import ( ) // NewFromTokens returns an authenticator.Request or an error -func NewFromTokens(tokens map[string]*user.DefaultInfo) authenticator.Request { - return bearertoken.New(tokenfile.New(tokens)) +func NewFromTokens(tokens map[string]*user.DefaultInfo, audiences authenticator.Audiences) authenticator.Request { + return bearertoken.New(authenticator.WrapAudienceAgnosticToken(audiences, tokenfile.New(tokens))) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/requestheader.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/requestheader.go index b5aa1c524a7e..766bde517270 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/requestheader.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/requestheader.go @@ -17,9 +17,8 @@ limitations under the License. package authenticatorfactory import ( - "crypto/x509" - "k8s.io/apiserver/pkg/authentication/request/headerrequest" + "k8s.io/apiserver/pkg/server/dynamiccertificates" ) type RequestHeaderConfig struct { @@ -32,17 +31,7 @@ type RequestHeaderConfig struct { ExtraHeaderPrefixes headerrequest.StringSliceProvider // CAContentProvider the options for verifying incoming connections using mTLS. Generally this points to CA bundle file which is used verify the identity of the front proxy. // It may produce different options at will. - CAContentProvider CAContentProvider + CAContentProvider dynamiccertificates.CAContentProvider // AllowedClientNames is a list of common names that may be presented by the authenticating front proxy. Empty means: accept any. AllowedClientNames headerrequest.StringSliceProvider } - -// CAContentProvider provides ca bundle byte content -type CAContentProvider interface { - // Name is just an identifier - Name() string - // CurrentCABundleContent provides ca bundle byte content - CurrentCABundleContent() []byte - // VerifyOptions provides VerifyOptions for authenticators - VerifyOptions() (x509.VerifyOptions, bool) -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go index ce70710fa3b3..2a826981cfd4 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go @@ -71,10 +71,10 @@ type Authorizer interface { Authorize(ctx context.Context, a Attributes) (authorized Decision, reason string, err error) } -type AuthorizerFunc func(a Attributes) (Decision, string, error) +type AuthorizerFunc func(ctx context.Context, a Attributes) (Decision, string, error) func (f AuthorizerFunc) Authorize(ctx context.Context, a Attributes) (Decision, string, error) { - return f(a) + return f(ctx, a) } // RuleResolver provides a mechanism for resolving the list of rules that apply to a given user within a namespace. diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/OWNERS b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/OWNERS deleted file mode 100644 index a5ccdcbd1b0c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- deads2k -- dims diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/path/path.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/path/path.go index 03f524b38cfe..0e1ec2338735 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/path/path.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/path/path.go @@ -17,6 +17,7 @@ limitations under the License. package path import ( + "context" "fmt" "strings" @@ -46,7 +47,7 @@ func NewAuthorizer(alwaysAllowPaths []string) (authorizer.Authorizer, error) { } } - return authorizer.AuthorizerFunc(func(a authorizer.Attributes) (authorizer.Decision, string, error) { + return authorizer.AuthorizerFunc(func(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) { if a.IsResourceRequest() { return authorizer.DecisionNoOpinion, "", nil } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit.go index 2f78ff1de642..853d1da9fd47 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit.go @@ -195,10 +195,6 @@ type auditResponseWriter struct { omitStages []auditinternal.Stage } -func (a *auditResponseWriter) setHttpHeader() { - a.ResponseWriter.Header().Set(auditinternal.HeaderAuditID, string(a.event.AuditID)) -} - func (a *auditResponseWriter) processCode(code int) { a.once.Do(func() { if a.event.ResponseStatus == nil { @@ -216,13 +212,11 @@ func (a *auditResponseWriter) processCode(code int) { func (a *auditResponseWriter) Write(bs []byte) (int, error) { // the Go library calls WriteHeader internally if no code was written yet. But this will go unnoticed for us a.processCode(http.StatusOK) - a.setHttpHeader() return a.ResponseWriter.Write(bs) } func (a *auditResponseWriter) WriteHeader(code int) { a.processCode(code) - a.setHttpHeader() a.ResponseWriter.WriteHeader(code) } @@ -245,12 +239,6 @@ func (f *fancyResponseWriterDelegator) Hijack() (net.Conn, *bufio.ReadWriter, er // fake a response status before protocol switch happens f.processCode(http.StatusSwitchingProtocols) - // This will be ignored if WriteHeader() function has already been called. - // It's not guaranteed Audit-ID http header is sent for all requests. - // For example, when user run "kubectl exec", apiserver uses a proxy handler - // to deal with the request, users can only get http headers returned by kubelet node. - f.setHttpHeader() - return f.ResponseWriter.(http.Hijacker).Hijack() } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go index 54e77467c0bd..d69cfef32d1b 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go @@ -17,6 +17,7 @@ limitations under the License. package filters import ( + "context" "errors" "fmt" "net/http" @@ -31,11 +32,17 @@ import ( "k8s.io/klog/v2" ) +type recordMetrics func(context.Context, *authenticator.Response, bool, error, authenticator.Audiences, time.Time, time.Time) + // WithAuthentication creates an http handler that tries to authenticate the given request as a user, and then // stores any such user found onto the provided context for the request. If authentication fails or returns an error // the failed handler is used. On success, "Authorization" header is removed from the request and handler // is invoked to serve the request. func WithAuthentication(handler http.Handler, auth authenticator.Request, failed http.Handler, apiAuds authenticator.Audiences) http.Handler { + return withAuthentication(handler, auth, failed, apiAuds, recordAuthMetrics) +} + +func withAuthentication(handler http.Handler, auth authenticator.Request, failed http.Handler, apiAuds authenticator.Audiences, metrics recordMetrics) http.Handler { if auth == nil { klog.Warning("Authentication is disabled") return handler @@ -47,7 +54,10 @@ func WithAuthentication(handler http.Handler, auth authenticator.Request, failed req = req.WithContext(authenticator.WithAudiences(req.Context(), apiAuds)) } resp, ok, err := auth.AuthenticateRequest(req) - defer recordAuthMetrics(req.Context(), resp, ok, err, apiAuds, authenticationStart) + authenticationFinish := time.Now() + defer func() { + metrics(req.Context(), resp, ok, err, apiAuds, authenticationStart, authenticationFinish) + }() if err != nil || !ok { if err != nil { klog.ErrorS(err, "Unable to authenticate the request") diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/metrics.go index 23bd46fe9732..31ead93d51a4 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/metrics.go @@ -76,7 +76,7 @@ func init() { legacyregistry.MustRegister(authenticationLatency) } -func recordAuthMetrics(ctx context.Context, resp *authenticator.Response, ok bool, err error, apiAudiences authenticator.Audiences, authStart time.Time) { +func recordAuthMetrics(ctx context.Context, resp *authenticator.Response, ok bool, err error, apiAudiences authenticator.Audiences, authStart time.Time, authFinish time.Time) { var resultLabel string switch { @@ -90,7 +90,7 @@ func recordAuthMetrics(ctx context.Context, resp *authenticator.Response, ok boo } authenticatedAttemptsCounter.WithContext(ctx).WithLabelValues(resultLabel).Inc() - authenticationLatency.WithContext(ctx).WithLabelValues(resultLabel).Observe(time.Since(authStart).Seconds()) + authenticationLatency.WithContext(ctx).WithLabelValues(resultLabel).Observe(authFinish.Sub(authStart).Seconds()) } // compressUsername maps all possible usernames onto a small set of categories diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/with_auditid.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/with_auditid.go new file mode 100644 index 000000000000..a7e8c7e4a585 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/with_auditid.go @@ -0,0 +1,68 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package filters + +import ( + "net/http" + + "k8s.io/apimachinery/pkg/types" + auditinternal "k8s.io/apiserver/pkg/apis/audit" + "k8s.io/apiserver/pkg/endpoints/request" + + "github.com/google/uuid" +) + +// WithAuditID attaches the Audit-ID associated with a request to the context. +// +// a. If the caller does not specify a value for Audit-ID in the request header, we generate a new audit ID +// b. We echo the Audit-ID value to the caller via the response Header 'Audit-ID'. +func WithAuditID(handler http.Handler) http.Handler { + return withAuditID(handler, func() string { + return uuid.New().String() + }) +} + +func withAuditID(handler http.Handler, newAuditIDFunc func() string) http.Handler { + if newAuditIDFunc == nil { + return handler + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + auditID := r.Header.Get(auditinternal.HeaderAuditID) + if len(auditID) == 0 { + auditID = newAuditIDFunc() + } + + // Note: we save the user specified value of the Audit-ID header as is, no truncation is performed. + r = r.WithContext(request.WithAuditID(ctx, types.UID(auditID))) + + // We echo the Audit-ID in to the response header. + // It's not guaranteed Audit-ID http header is sent for all requests. + // For example, when user run "kubectl exec", apiserver uses a proxy handler + // to deal with the request, users can only get http headers returned by kubelet node. + // + // This filter will also be used by other aggregated api server(s). For an aggregated API + // we don't want to see the same audit ID appearing more than once. + if value := w.Header().Get(auditinternal.HeaderAuditID); len(value) == 0 { + w.Header().Set(auditinternal.HeaderAuditID, auditID) + } + + handler.ServeHTTP(w, r) + }) +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/groupversion.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/groupversion.go index 22b97366142c..a6f17e84acb7 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/groupversion.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/groupversion.go @@ -36,6 +36,13 @@ import ( openapiproto "k8s.io/kube-openapi/pkg/util/proto" ) +// ConvertabilityChecker indicates what versions a GroupKind is available in. +type ConvertabilityChecker interface { + // VersionsForGroupKind indicates what versions are available to convert a group kind. This determines + // what our decoding abilities are. + VersionsForGroupKind(gk schema.GroupKind) []schema.GroupVersion +} + // APIGroupVersion is a helper for exposing rest.Storage objects as http.Handlers via go-restful // It handles URLs of the form: // /${storage_key}[/${object_name}] @@ -67,13 +74,14 @@ type APIGroupVersion struct { Serializer runtime.NegotiatedSerializer ParameterCodec runtime.ParameterCodec - Typer runtime.ObjectTyper - Creater runtime.ObjectCreater - Convertor runtime.ObjectConvertor - Defaulter runtime.ObjectDefaulter - Linker runtime.SelfLinker - UnsafeConvertor runtime.ObjectConvertor - TypeConverter fieldmanager.TypeConverter + Typer runtime.ObjectTyper + Creater runtime.ObjectCreater + Convertor runtime.ObjectConvertor + ConvertabilityChecker ConvertabilityChecker + Defaulter runtime.ObjectDefaulter + Linker runtime.SelfLinker + UnsafeConvertor runtime.ObjectConvertor + TypeConverter fieldmanager.TypeConverter EquivalentResourceRegistry runtime.EquivalentResourceRegistry diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go index b2e167f26fd1..d6f8025e39a5 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go @@ -36,6 +36,7 @@ import ( "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/audit" "k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager" + "k8s.io/apiserver/pkg/endpoints/handlers/finisher" "k8s.io/apiserver/pkg/endpoints/handlers/negotiation" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/features" @@ -122,7 +123,7 @@ func createHandler(r rest.NamedCreater, scope *RequestScope, admit admission.Int scope.err(err, w, req) return } - if gvk.GroupVersion() != gv { + if !scope.AcceptsGroupVersion(gvk.GroupVersion()) { err = errors.NewBadRequest(fmt.Sprintf("the API version in the data (%s) does not match the expected API version (%v)", gvk.GroupVersion().String(), gv.String())) scope.err(err, w, req) return @@ -157,7 +158,7 @@ func createHandler(r rest.NamedCreater, scope *RequestScope, admit admission.Int } // Dedup owner references before updating managed fields dedupOwnerReferencesAndAddWarning(obj, req.Context(), false) - result, err := finishRequest(ctx, func() (runtime.Object, error) { + result, err := finisher.FinishRequest(ctx, func() (runtime.Object, error) { if scope.FieldManager != nil { liveObj, err := scope.Creater.New(scope.Kind) if err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go index 545ed897c2bf..c1a1fc987eee 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go @@ -32,6 +32,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/audit" + "k8s.io/apiserver/pkg/endpoints/handlers/finisher" "k8s.io/apiserver/pkg/endpoints/handlers/negotiation" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/features" @@ -124,7 +125,7 @@ func DeleteResource(r rest.GracefulDeleter, allowsOptions bool, scope *RequestSc wasDeleted := true userInfo, _ := request.UserFrom(ctx) staticAdmissionAttrs := admission.NewAttributesRecord(nil, nil, scope.Kind, namespace, name, scope.Resource, scope.Subresource, admission.Delete, options, dryrun.IsDryRun(options.DryRun), userInfo) - result, err := finishRequest(ctx, func() (runtime.Object, error) { + result, err := finisher.FinishRequest(ctx, func() (runtime.Object, error) { obj, deleted, err := r.Delete(ctx, name, rest.AdmissionToValidateObjectDeleteFunc(admit, staticAdmissionAttrs, scope), options) wasDeleted = deleted return obj, err @@ -267,7 +268,7 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope *RequestSc admit = admission.WithAudit(admit, ae) userInfo, _ := request.UserFrom(ctx) staticAdmissionAttrs := admission.NewAttributesRecord(nil, nil, scope.Kind, namespace, "", scope.Resource, scope.Subresource, admission.Delete, options, dryrun.IsDryRun(options.DryRun), userInfo) - result, err := finishRequest(ctx, func() (runtime.Object, error) { + result, err := finisher.FinishRequest(ctx, func() (runtime.Object, error) { return r.DeleteCollection(ctx, rest.AdmissionToValidateObjectDeleteFunc(admit, staticAdmissionAttrs, scope), options, &listOptions) }) if err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/buildmanagerinfo.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/buildmanagerinfo.go index fc471e797592..58b87eb38869 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/buildmanagerinfo.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/buildmanagerinfo.go @@ -28,16 +28,18 @@ import ( type buildManagerInfoManager struct { fieldManager Manager groupVersion schema.GroupVersion + subresource string } var _ Manager = &buildManagerInfoManager{} // NewBuildManagerInfoManager creates a new Manager that converts the manager name into a unique identifier // combining operation and version for update requests, and just operation for apply requests. -func NewBuildManagerInfoManager(f Manager, gv schema.GroupVersion) Manager { +func NewBuildManagerInfoManager(f Manager, gv schema.GroupVersion, subresource string) Manager { return &buildManagerInfoManager{ fieldManager: f, groupVersion: gv, + subresource: subresource, } } @@ -61,9 +63,10 @@ func (f *buildManagerInfoManager) Apply(liveObj, appliedObj runtime.Object, mana func (f *buildManagerInfoManager) buildManagerInfo(prefix string, operation metav1.ManagedFieldsOperationType) (string, error) { managerInfo := metav1.ManagedFieldsEntry{ - Manager: prefix, - Operation: operation, - APIVersion: f.groupVersion.String(), + Manager: prefix, + Operation: operation, + APIVersion: f.groupVersion.String(), + Subresource: f.subresource, } if managerInfo.Manager == "" { managerInfo.Manager = "unknown" diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/fieldmanager.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/fieldmanager.go index 71a4eff8e80f..a4023a0e767b 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/fieldmanager.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/fieldmanager.go @@ -66,48 +66,53 @@ type Manager interface { // FieldManager updates the managed fields and merge applied // configurations. type FieldManager struct { - fieldManager Manager - ignoreManagedFieldsFromRequestObject bool + fieldManager Manager + subresource string } // NewFieldManager creates a new FieldManager that decodes, manages, then re-encodes managedFields // on update and apply requests. -func NewFieldManager(f Manager, ignoreManagedFieldsFromRequestObject bool) *FieldManager { - return &FieldManager{fieldManager: f, ignoreManagedFieldsFromRequestObject: ignoreManagedFieldsFromRequestObject} +func NewFieldManager(f Manager, subresource string) *FieldManager { + return &FieldManager{fieldManager: f, subresource: subresource} } // NewDefaultFieldManager creates a new FieldManager that merges apply requests // and update managed fields for other types of requests. -func NewDefaultFieldManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, hub schema.GroupVersion, ignoreManagedFieldsFromRequestObject bool) (*FieldManager, error) { - f, err := NewStructuredMergeManager(typeConverter, objectConverter, objectDefaulter, kind.GroupVersion(), hub) +func NewDefaultFieldManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, hub schema.GroupVersion, subresource string, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (*FieldManager, error) { + f, err := NewStructuredMergeManager(typeConverter, objectConverter, objectDefaulter, kind.GroupVersion(), hub, resetFields) if err != nil { return nil, fmt.Errorf("failed to create field manager: %v", err) } - return newDefaultFieldManager(f, typeConverter, objectConverter, objectCreater, kind, ignoreManagedFieldsFromRequestObject), nil + return newDefaultFieldManager(f, typeConverter, objectConverter, objectCreater, kind, subresource), nil } // NewDefaultCRDFieldManager creates a new FieldManager specifically for // CRDs. This allows for the possibility of fields which are not defined // in models, as well as having no models defined at all. -func NewDefaultCRDFieldManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, hub schema.GroupVersion, ignoreManagedFieldsFromRequestObject bool) (_ *FieldManager, err error) { - f, err := NewCRDStructuredMergeManager(typeConverter, objectConverter, objectDefaulter, kind.GroupVersion(), hub) +func NewDefaultCRDFieldManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, hub schema.GroupVersion, subresource string, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (_ *FieldManager, err error) { + f, err := NewCRDStructuredMergeManager(typeConverter, objectConverter, objectDefaulter, kind.GroupVersion(), hub, resetFields) if err != nil { return nil, fmt.Errorf("failed to create field manager: %v", err) } - return newDefaultFieldManager(f, typeConverter, objectConverter, objectCreater, kind, ignoreManagedFieldsFromRequestObject), nil + return newDefaultFieldManager(f, typeConverter, objectConverter, objectCreater, kind, subresource), nil } // newDefaultFieldManager is a helper function which wraps a Manager with certain default logic. -func newDefaultFieldManager(f Manager, typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, ignoreManagedFieldsFromRequestObject bool) *FieldManager { - f = NewStripMetaManager(f) - f = NewManagedFieldsUpdater(f) - f = NewBuildManagerInfoManager(f, kind.GroupVersion()) - f = NewCapManagersManager(f, DefaultMaxUpdateManagers) - f = NewProbabilisticSkipNonAppliedManager(f, objectCreater, kind, DefaultTrackOnCreateProbability) - f = NewLastAppliedManager(f, typeConverter, objectConverter, kind.GroupVersion()) - f = NewLastAppliedUpdater(f) - - return NewFieldManager(f, ignoreManagedFieldsFromRequestObject) +func newDefaultFieldManager(f Manager, typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, subresource string) *FieldManager { + return NewFieldManager( + NewLastAppliedUpdater( + NewLastAppliedManager( + NewProbabilisticSkipNonAppliedManager( + NewCapManagersManager( + NewBuildManagerInfoManager( + NewManagedFieldsUpdater( + NewStripMetaManager(f), + ), kind.GroupVersion(), subresource, + ), DefaultMaxUpdateManagers, + ), objectCreater, kind, DefaultTrackOnCreateProbability, + ), typeConverter, objectConverter, kind.GroupVersion()), + ), subresource, + ) } // DecodeManagedFields converts ManagedFields from the wire format (api format) @@ -162,7 +167,8 @@ func emptyManagedFieldsOnErr(managed Managed, err error) (Managed, error) { func (f *FieldManager) Update(liveObj, newObj runtime.Object, manager string) (object runtime.Object, err error) { // First try to decode the managed fields provided in the update, // This is necessary to allow directly updating managed fields. - managed, err := decodeLiveOrNew(liveObj, newObj, f.ignoreManagedFieldsFromRequestObject) + isSubresource := f.subresource != "" + managed, err := decodeLiveOrNew(liveObj, newObj, isSubresource) if err != nil { return newObj, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/conflict.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/conflict.go index cfa19d8d9aa1..8c044c915708 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/conflict.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/conflict.go @@ -75,11 +75,15 @@ func printManager(manager string) string { if err := json.Unmarshal([]byte(manager), encodedManager); err != nil { return fmt.Sprintf("%q", manager) } + managerStr := fmt.Sprintf("%q", encodedManager.Manager) + if encodedManager.Subresource != "" { + managerStr = fmt.Sprintf("%s with subresource %q", managerStr, encodedManager.Subresource) + } if encodedManager.Operation == metav1.ManagedFieldsOperationUpdate { if encodedManager.Time == nil { - return fmt.Sprintf("%q using %v", encodedManager.Manager, encodedManager.APIVersion) + return fmt.Sprintf("%s using %v", managerStr, encodedManager.APIVersion) } - return fmt.Sprintf("%q using %v at %v", encodedManager.Manager, encodedManager.APIVersion, encodedManager.Time.UTC().Format(time.RFC3339)) + return fmt.Sprintf("%s using %v at %v", managerStr, encodedManager.APIVersion, encodedManager.Time.UTC().Format(time.RFC3339)) } - return fmt.Sprintf("%q", encodedManager.Manager) + return managerStr } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go index 40237cdc6607..9b4c20326284 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go @@ -213,7 +213,11 @@ func sortEncodedManagedFields(encodedManagedFields []metav1.ManagedFieldsEntry) if p.Manager != q.Manager { return p.Manager < q.Manager } - return p.APIVersion < q.APIVersion + + if p.APIVersion != q.APIVersion { + return p.APIVersion < q.APIVersion + } + return p.Subresource < q.Subresource }) return encodedManagedFields, nil diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/scalehandler.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/scalehandler.go new file mode 100644 index 000000000000..d81383628c79 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/scalehandler.go @@ -0,0 +1,174 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fieldmanager + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" +) + +var ( + scaleGroupVersion = schema.GroupVersion{Group: "autoscaling", Version: "v1"} + replicasPathInScale = fieldpath.MakePathOrDie("spec", "replicas") +) + +// ResourcePathMappings maps a group/version to its replicas path. The +// assumption is that all the paths correspond to leaf fields. +type ResourcePathMappings map[string]fieldpath.Path + +// ScaleHandler manages the conversion of managed fields between a main +// resource and the scale subresource +type ScaleHandler struct { + parentEntries []metav1.ManagedFieldsEntry + groupVersion schema.GroupVersion + mappings ResourcePathMappings +} + +// NewScaleHandler creates a new ScaleHandler +func NewScaleHandler(parentEntries []metav1.ManagedFieldsEntry, groupVersion schema.GroupVersion, mappings ResourcePathMappings) *ScaleHandler { + return &ScaleHandler{ + parentEntries: parentEntries, + groupVersion: groupVersion, + mappings: mappings, + } +} + +// ToSubresource filter the managed fields of the main resource and convert +// them so that they can be handled by scale. +// For the managed fields that have a replicas path it performs two changes: +// 1. APIVersion is changed to the APIVersion of the scale subresource +// 2. Replicas path of the main resource is transformed to the replicas path of +// the scale subresource +func (h *ScaleHandler) ToSubresource() ([]metav1.ManagedFieldsEntry, error) { + managed, err := DecodeManagedFields(h.parentEntries) + if err != nil { + return nil, err + } + + f := fieldpath.ManagedFields{} + t := map[string]*metav1.Time{} + for manager, versionedSet := range managed.Fields() { + path, ok := h.mappings[string(versionedSet.APIVersion())] + // Skip the entry if the APIVersion is unknown + if !ok || path == nil { + continue + } + + if versionedSet.Set().Has(path) { + newVersionedSet := fieldpath.NewVersionedSet( + fieldpath.NewSet(replicasPathInScale), + fieldpath.APIVersion(scaleGroupVersion.String()), + versionedSet.Applied(), + ) + + f[manager] = newVersionedSet + t[manager] = managed.Times()[manager] + } + } + + return managedFieldsEntries(internal.NewManaged(f, t)) +} + +// ToParent merges `scaleEntries` with the entries of the main resource and +// transforms them accordingly +func (h *ScaleHandler) ToParent(scaleEntries []metav1.ManagedFieldsEntry) ([]metav1.ManagedFieldsEntry, error) { + decodedParentEntries, err := DecodeManagedFields(h.parentEntries) + if err != nil { + return nil, err + } + parentFields := decodedParentEntries.Fields() + + decodedScaleEntries, err := DecodeManagedFields(scaleEntries) + if err != nil { + return nil, err + } + scaleFields := decodedScaleEntries.Fields() + + f := fieldpath.ManagedFields{} + t := map[string]*metav1.Time{} + + for manager, versionedSet := range parentFields { + // Get the main resource "replicas" path + path, ok := h.mappings[string(versionedSet.APIVersion())] + // Drop the entry if the APIVersion is unknown. + if !ok { + continue + } + + // If the parent entry does not have the replicas path or it is nil, just + // keep it as it is. The path is nil for Custom Resources without scale + // subresource. + if path == nil || !versionedSet.Set().Has(path) { + f[manager] = versionedSet + t[manager] = decodedParentEntries.Times()[manager] + continue + } + + if _, ok := scaleFields[manager]; !ok { + // "Steal" the replicas path from the main resource entry + newSet := versionedSet.Set().Difference(fieldpath.NewSet(path)) + + if !newSet.Empty() { + newVersionedSet := fieldpath.NewVersionedSet( + newSet, + versionedSet.APIVersion(), + versionedSet.Applied(), + ) + f[manager] = newVersionedSet + t[manager] = decodedParentEntries.Times()[manager] + } + } else { + // Field wasn't stolen, let's keep the entry as it is. + f[manager] = versionedSet + t[manager] = decodedParentEntries.Times()[manager] + delete(scaleFields, manager) + } + } + + for manager, versionedSet := range scaleFields { + if !versionedSet.Set().Has(replicasPathInScale) { + continue + } + newVersionedSet := fieldpath.NewVersionedSet( + fieldpath.NewSet(h.mappings[h.groupVersion.String()]), + fieldpath.APIVersion(h.groupVersion.String()), + versionedSet.Applied(), + ) + f[manager] = newVersionedSet + t[manager] = decodedParentEntries.Times()[manager] + } + + return managedFieldsEntries(internal.NewManaged(f, t)) +} + +func managedFieldsEntries(entries internal.ManagedInterface) ([]metav1.ManagedFieldsEntry, error) { + obj := &unstructured.Unstructured{Object: map[string]interface{}{}} + if err := internal.EncodeObjectManagedFields(obj, entries); err != nil { + return nil, err + } + accessor, err := meta.Accessor(obj) + if err != nil { + panic(fmt.Sprintf("couldn't get accessor: %v", err)) + } + return accessor.GetManagedFields(), nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/structuredmerge.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/structuredmerge.go index b801d3d47171..1be9e763af45 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/structuredmerge.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/structuredmerge.go @@ -41,7 +41,7 @@ var _ Manager = &structuredMergeManager{} // NewStructuredMergeManager creates a new Manager that merges apply requests // and update managed fields for other types of requests. -func NewStructuredMergeManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, gv schema.GroupVersion, hub schema.GroupVersion) (Manager, error) { +func NewStructuredMergeManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, gv schema.GroupVersion, hub schema.GroupVersion, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (Manager, error) { return &structuredMergeManager{ typeConverter: typeConverter, objectConverter: objectConverter, @@ -49,7 +49,8 @@ func NewStructuredMergeManager(typeConverter TypeConverter, objectConverter runt groupVersion: gv, hubVersion: hub, updater: merge.Updater{ - Converter: newVersionConverter(typeConverter, objectConverter, hub), // This is the converter provided to SMD from k8s + Converter: newVersionConverter(typeConverter, objectConverter, hub), // This is the converter provided to SMD from k8s + IgnoredFields: resetFields, }, }, nil } @@ -57,7 +58,7 @@ func NewStructuredMergeManager(typeConverter TypeConverter, objectConverter runt // NewCRDStructuredMergeManager creates a new Manager specifically for // CRDs. This allows for the possibility of fields which are not defined // in models, as well as having no models defined at all. -func NewCRDStructuredMergeManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, gv schema.GroupVersion, hub schema.GroupVersion) (_ Manager, err error) { +func NewCRDStructuredMergeManager(typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectDefaulter runtime.ObjectDefaulter, gv schema.GroupVersion, hub schema.GroupVersion, resetFields map[fieldpath.APIVersion]*fieldpath.Set) (_ Manager, err error) { return &structuredMergeManager{ typeConverter: typeConverter, objectConverter: objectConverter, @@ -65,7 +66,8 @@ func NewCRDStructuredMergeManager(typeConverter TypeConverter, objectConverter r groupVersion: gv, hubVersion: hub, updater: merge.Updater{ - Converter: newCRDVersionConverter(typeConverter, objectConverter, hub), + Converter: newCRDVersionConverter(typeConverter, objectConverter, hub), + IgnoredFields: resetFields, }, }, nil } @@ -74,7 +76,7 @@ func NewCRDStructuredMergeManager(typeConverter TypeConverter, objectConverter r func (f *structuredMergeManager) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { newObjVersioned, err := f.toVersioned(newObj) if err != nil { - return nil, nil, fmt.Errorf("failed to convert new object to proper version: %v", err) + return nil, nil, fmt.Errorf("failed to convert new object to proper version: %v (from %v to %v)", err, newObj.GetObjectKind().GroupVersionKind(), f.groupVersion) } liveObjVersioned, err := f.toVersioned(liveObj) if err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go new file mode 100644 index 000000000000..42b81c7f7034 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go @@ -0,0 +1,109 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package finisher + +import ( + "context" + "fmt" + "net/http" + goruntime "runtime" + + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// ResultFunc is a function that returns a rest result and can be run in a goroutine +type ResultFunc func() (runtime.Object, error) + +// result stores the return values or panic from a ResultFunc function +type result struct { + // object stores the response returned by the ResultFunc function + object runtime.Object + // err stores the error returned by the ResultFunc function + err error + // reason stores the reason from a panic thrown by the ResultFunc function + reason interface{} +} + +// Return processes the result returned by a ResultFunc function +func (r *result) Return() (runtime.Object, error) { + switch { + case r.reason != nil: + // panic has higher precedence, the goroutine executing ResultFunc has panic'd, + // so propagate a panic to the caller. + panic(r.reason) + case r.err != nil: + return nil, r.err + default: + // if we are here, it means neither a panic, nor an error + if status, ok := r.object.(*metav1.Status); ok { + // An api.Status object with status != success is considered an "error", + // which interrupts the normal response flow. + if status.Status != metav1.StatusSuccess { + return nil, errors.FromObject(status) + } + } + return r.object, nil + } +} + +// FinishRequest makes a given ResultFunc asynchronous and handles errors returned by the response. +func FinishRequest(ctx context.Context, fn ResultFunc) (runtime.Object, error) { + // the channel needs to be buffered to prevent the goroutine below from hanging indefinitely + // when the select statement reads something other than the one the goroutine sends on. + resultCh := make(chan *result, 1) + + go func() { + result := &result{} + + // panics don't cross goroutine boundaries, so we have to handle ourselves + defer func() { + reason := recover() + if reason != nil { + // do not wrap the sentinel ErrAbortHandler panic value + if reason != http.ErrAbortHandler { + // Same as stdlib http server code. Manually allocate stack + // trace buffer size to prevent excessively large logs + const size = 64 << 10 + buf := make([]byte, size) + buf = buf[:goruntime.Stack(buf, false)] + reason = fmt.Sprintf("%v\n%s", reason, buf) + } + + // store the panic reason into the result. + result.reason = reason + } + + // Propagate the result to the parent goroutine + resultCh <- result + }() + + if object, err := fn(); err != nil { + result.err = err + } else { + result.object = object + } + }() + + select { + case result := <-resultCh: + return result.Return() + case <-ctx.Done(): + return nil, errors.NewTimeoutError(fmt.Sprintf("request did not complete within requested timeout %s", ctx.Err()), 0) + } +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/helpers.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/helpers.go index 244a3fd0a510..3fb7beccad10 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/helpers.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/helpers.go @@ -20,6 +20,7 @@ import ( "net/http" utilnet "k8s.io/apimachinery/pkg/util/net" + "k8s.io/apiserver/pkg/endpoints/request" ) const ( @@ -73,3 +74,17 @@ func (lazy *lazyAccept) String() string { return "unknown" } + +// lazyAuditID implements Stringer interface to lazily retrieve +// the audit ID associated with the request. +type lazyAuditID struct { + req *http.Request +} + +func (lazy *lazyAuditID) String() string { + if lazy.req != nil { + return request.GetAuditIDTruncated(lazy.req) + } + + return "unknown" +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go index 903307fc2852..1abcccaa1700 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go @@ -43,6 +43,7 @@ import ( "k8s.io/apiserver/pkg/audit" "k8s.io/apiserver/pkg/authorization/authorizer" "k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager" + "k8s.io/apiserver/pkg/endpoints/handlers/finisher" "k8s.io/apiserver/pkg/endpoints/handlers/negotiation" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/features" @@ -590,7 +591,7 @@ func (p *patcher) patchResource(ctx context.Context, scope *RequestScope) (runti wasCreated = created return updateObject, updateErr } - result, err := finishRequest(ctx, func() (runtime.Object, error) { + result, err := finisher.FinishRequest(ctx, func() (runtime.Object, error) { result, err := requestFunc() // If the object wasn't committed to storage because it's serialized size was too large, // it is safe to remove managedFields (which can be large) and try again. diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go index 783ab96b9b98..4c2e63e10c0d 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go @@ -24,7 +24,6 @@ import ( "io/ioutil" "net/http" "net/url" - goruntime "runtime" "strings" "time" @@ -90,8 +89,14 @@ type RequestScope struct { TableConvertor rest.TableConvertor FieldManager *fieldmanager.FieldManager - Resource schema.GroupVersionResource - Kind schema.GroupVersionKind + Resource schema.GroupVersionResource + Kind schema.GroupVersionKind + + // AcceptsGroupVersionDelegate is an optional delegate that can be queried about whether a given GVK + // can be accepted in create or update requests. If nil, only scope.Kind is accepted. + // Note that this does not enable multi-version support for reads from a single endpoint. + AcceptsGroupVersionDelegate rest.GroupVersionAcceptor + Subresource string MetaGroupVersion schema.GroupVersion @@ -106,6 +111,17 @@ func (scope *RequestScope) err(err error, w http.ResponseWriter, req *http.Reque responsewriters.ErrorNegotiated(err, scope.Serializer, scope.Kind.GroupVersion(), w, req) } +// AcceptsGroupVersion returns true if the specified GroupVersion is allowed +// in create and update requests. +func (scope *RequestScope) AcceptsGroupVersion(gv schema.GroupVersion) bool { + // If there's a custom acceptor, delegate to it. This is extremely rare. + if scope.AcceptsGroupVersionDelegate != nil { + return scope.AcceptsGroupVersionDelegate.AcceptsGroupVersion(gv) + } + // Fall back to only allowing the singular Kind. This is the typical behavior. + return gv == scope.Kind.GroupVersion() +} + func (scope *RequestScope) AllowsMediaTypeTransform(mimeType, mimeSubType string, gvk *schema.GroupVersionKind) bool { // some handlers like CRDs can't serve all the mime types that PartialObjectMetadata or Table can - if // gvk is nil (no conversion) allow StandardSerializers to further restrict the set of mime types. @@ -225,60 +241,6 @@ func (r *responder) Error(err error) { r.scope.err(err, r.w, r.req) } -// resultFunc is a function that returns a rest result and can be run in a goroutine -type resultFunc func() (runtime.Object, error) - -// finishRequest makes a given resultFunc asynchronous and handles errors returned by the response. -// An api.Status object with status != success is considered an "error", which interrupts the normal response flow. -func finishRequest(ctx context.Context, fn resultFunc) (result runtime.Object, err error) { - // these channels need to be buffered to prevent the goroutine below from hanging indefinitely - // when the select statement reads something other than the one the goroutine sends on. - ch := make(chan runtime.Object, 1) - errCh := make(chan error, 1) - panicCh := make(chan interface{}, 1) - go func() { - // panics don't cross goroutine boundaries, so we have to handle ourselves - defer func() { - panicReason := recover() - if panicReason != nil { - // do not wrap the sentinel ErrAbortHandler panic value - if panicReason != http.ErrAbortHandler { - // Same as stdlib http server code. Manually allocate stack - // trace buffer size to prevent excessively large logs - const size = 64 << 10 - buf := make([]byte, size) - buf = buf[:goruntime.Stack(buf, false)] - panicReason = fmt.Sprintf("%v\n%s", panicReason, buf) - } - // Propagate to parent goroutine - panicCh <- panicReason - } - }() - - if result, err := fn(); err != nil { - errCh <- err - } else { - ch <- result - } - }() - - select { - case result = <-ch: - if status, ok := result.(*metav1.Status); ok { - if status.Status != metav1.StatusSuccess { - return nil, errors.FromObject(status) - } - } - return result, nil - case err = <-errCh: - return nil, err - case p := <-panicCh: - panic(p) - case <-ctx.Done(): - return nil, errors.NewTimeoutError(fmt.Sprintf("request did not complete within requested timeout %s", ctx.Err()), 0) - } -} - // transformDecodeError adds additional information into a bad-request api error when a decode fails. func transformDecodeError(typer runtime.ObjectTyper, baseErr error, into runtime.Object, gvk *schema.GroupVersionKind, body []byte) error { objGVKs, _, err := typer.ObjectKinds(into) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/trace_util.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/trace_util.go index 69b41fac4e31..8d7c4e1b5263 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/trace_util.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/trace_util.go @@ -26,6 +26,7 @@ func traceFields(req *http.Request) []utiltrace.Field { return []utiltrace.Field{ {Key: "url", Value: req.URL.Path}, {Key: "user-agent", Value: &lazyTruncatedUserAgent{req: req}}, + {Key: "audit-id", Value: &lazyAuditID{req: req}}, {Key: "client", Value: &lazyClientIP{req: req}}, {Key: "accept", Value: &lazyAccept{req: req}}, {Key: "protocol", Value: req.Proto}} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go index 57daefd9cf1e..ceae03eee395 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go @@ -34,6 +34,7 @@ import ( "k8s.io/apiserver/pkg/audit" "k8s.io/apiserver/pkg/authorization/authorizer" "k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager" + "k8s.io/apiserver/pkg/endpoints/handlers/finisher" "k8s.io/apiserver/pkg/endpoints/handlers/negotiation" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/features" @@ -109,7 +110,7 @@ func UpdateResource(r rest.Updater, scope *RequestScope, admit admission.Interfa scope.err(err, w, req) return } - if gvk.GroupVersion() != defaultGVK.GroupVersion() { + if !scope.AcceptsGroupVersion(gvk.GroupVersion()) { err = errors.NewBadRequest(fmt.Sprintf("the API version in the data (%s) does not match the expected API version (%s)", gvk.GroupVersion(), defaultGVK.GroupVersion())) scope.err(err, w, req) return @@ -198,7 +199,7 @@ func UpdateResource(r rest.Updater, scope *RequestScope, admit admission.Interfa } // Dedup owner references before updating managed fields dedupOwnerReferencesAndAddWarning(obj, req.Context(), false) - result, err := finishRequest(ctx, func() (runtime.Object, error) { + result, err := finisher.FinishRequest(ctx, func() (runtime.Object, error) { result, err := requestFunc() // If the object wasn't committed to storage because it's serialized size was too large, // it is safe to remove managedFields (which can be large) and try again. diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/installer.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/installer.go index ec09454ed8d2..eb100646538a 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/installer.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/installer.go @@ -46,6 +46,7 @@ import ( "k8s.io/apiserver/pkg/storageversion" utilfeature "k8s.io/apiserver/pkg/util/feature" versioninfo "k8s.io/component-base/version" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" ) const ( @@ -250,6 +251,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag connecter, isConnecter := storage.(rest.Connecter) storageMeta, isMetadata := storage.(rest.StorageMetadata) storageVersionProvider, isStorageVersionProvider := storage.(rest.StorageVersionProvider) + gvAcceptor, _ := storage.(rest.GroupVersionAcceptor) if !isMetadata { storageMeta = defaultStorageMetadata{} } @@ -258,6 +260,13 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag isCreater = true } + var resetFields map[fieldpath.APIVersion]*fieldpath.Set + if a.group.OpenAPIModels != nil && utilfeature.DefaultFeatureGate.Enabled(features.ServerSideApply) { + if resetFieldsStrategy, isResetFieldsStrategy := storage.(rest.ResetFieldsStrategy); isResetFieldsStrategy { + resetFields = resetFieldsStrategy.GetResetFields() + } + } + var versionedList interface{} if isLister { list := lister.NewList() @@ -513,6 +522,10 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if err != nil { return nil, nil, err } + decodableVersions := []schema.GroupVersion{} + if a.group.ConvertabilityChecker != nil { + decodableVersions = a.group.ConvertabilityChecker.VersionsForGroupKind(fqKindToRegister.GroupKind()) + } resourceInfo = &storageversion.ResourceInfo{ GroupResource: schema.GroupResource{ Group: a.group.GroupVersion.Group, @@ -523,6 +536,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag // DecodableVersions immediately because API installation must // be completed first for us to know equivalent APIs EquivalentResourceMapper: a.group.EquivalentResourceRegistry, + + DirectlyDecodableVersions: decodableVersions, } } @@ -573,6 +588,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag Subresource: subresource, Kind: fqKindToRegister, + AcceptsGroupVersionDelegate: gvAcceptor, + HubGroupVersion: schema.GroupVersion{Group: fqKindToRegister.Group, Version: runtime.APIVersionInternal}, MetaGroupVersion: metav1.SchemeGroupVersion, @@ -590,7 +607,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag a.group.Creater, fqKindToRegister, reqScope.HubGroupVersion, - isSubresource, + subresource, + resetFields, ) if err != nil { return nil, nil, fmt.Errorf("failed to create field manager: %v", err) @@ -790,6 +808,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag Operation("patch"+namespaced+kind+strings.Title(subresource)+operationSuffix). Produces(append(storageMeta.ProducesMIMETypes(action.Verb), mediaTypes...)...). Returns(http.StatusOK, "OK", producedObject). + // Patch can return 201 when a server side apply is requested + Returns(http.StatusCreated, "Created", producedObject). Reads(metav1.Patch{}). Writes(producedObject) if err := AddObjectParams(ws, route, versionedPatchOptions); err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go index e3bd028bbf91..b1f53df0d383 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go @@ -25,12 +25,12 @@ import ( "unicode" restful "github.com/emicklei/go-restful" - "github.com/go-openapi/spec" - "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/kube-openapi/pkg/util" + "k8s.io/kube-openapi/pkg/validation/spec" ) var verbs = util.NewTrie([]string{"get", "log", "read", "replace", "patch", "delete", "deletecollection", "watch", "connect", "proxy", "list", "create", "patch"}) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/request/auditid.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/request/auditid.go new file mode 100644 index 000000000000..a7b3d84addb1 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/request/auditid.go @@ -0,0 +1,66 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package request + +import ( + "context" + "net/http" + + "k8s.io/apimachinery/pkg/types" +) + +type auditIDKeyType int + +// auditIDKey is the key to associate the Audit-ID value of a request. +const auditIDKey auditIDKeyType = iota + +// WithAuditID returns a copy of the parent context into which the Audit-ID +// associated with the request is set. +// +// If the specified auditID is empty, no value is set and the parent context is returned as is. +func WithAuditID(parent context.Context, auditID types.UID) context.Context { + if auditID == "" { + return parent + } + return WithValue(parent, auditIDKey, auditID) +} + +// AuditIDFrom returns the value of the audit ID from the request context. +func AuditIDFrom(ctx context.Context) (types.UID, bool) { + auditID, ok := ctx.Value(auditIDKey).(types.UID) + return auditID, ok +} + +// GetAuditIDTruncated returns the audit ID (truncated) associated with a request. +// If the length of the Audit-ID value exceeds the limit, we truncate it to keep +// the first N (maxAuditIDLength) characters. +// This is intended to be used in logging only. +func GetAuditIDTruncated(req *http.Request) string { + auditID, ok := AuditIDFrom(req.Context()) + if !ok { + return "" + } + + // if the user has specified a very long audit ID then we will use the first N characters + // Note: assuming Audit-ID header is in ASCII + const maxAuditIDLength = 64 + if len(auditID) > maxAuditIDLength { + auditID = auditID[0:maxAuditIDLength] + } + + return string(auditID) +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/features/kube_features.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/features/kube_features.go index f7706c248154..6b7747fd9c7e 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/features/kube_features.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/features/kube_features.go @@ -95,6 +95,7 @@ const ( // owner: @apelisse, @lavalamp // alpha: v1.14 // beta: v1.16 + // stable: v1.22 // // Server-side apply. Merging happens on the server. ServerSideApply featuregate.Feature = "ServerSideApply" @@ -178,7 +179,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS APIListChunking: {Default: true, PreRelease: featuregate.Beta}, DryRun: {Default: true, PreRelease: featuregate.GA}, RemainingItemCount: {Default: true, PreRelease: featuregate.Beta}, - ServerSideApply: {Default: true, PreRelease: featuregate.Beta}, + ServerSideApply: {Default: true, PreRelease: featuregate.GA}, StorageVersionHash: {Default: true, PreRelease: featuregate.Beta}, StorageVersionAPI: {Default: false, PreRelease: featuregate.Alpha}, WatchBookmark: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/quota/v1/interfaces.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/quota/v1/interfaces.go index 15f8b7613d31..511e8818c736 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/quota/v1/interfaces.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/quota/v1/interfaces.go @@ -54,7 +54,7 @@ type Evaluator interface { Matches(resourceQuota *corev1.ResourceQuota, item runtime.Object) (bool, error) // MatchingScopes takes the input specified list of scopes and input object and returns the set of scopes that matches input object. MatchingScopes(item runtime.Object, scopes []corev1.ScopedResourceSelectorRequirement) ([]corev1.ScopedResourceSelectorRequirement, error) - // UncoveredQuotaScopes takes the input matched scopes which are limited by configuration and the matched quota scopes. It returns the scopes which are in limited scopes but dont have a corresponding covering quota scope + // UncoveredQuotaScopes takes the input matched scopes which are limited by configuration and the matched quota scopes. It returns the scopes which are in limited scopes but don't have a corresponding covering quota scope UncoveredQuotaScopes(limitedScopes []corev1.ScopedResourceSelectorRequirement, matchedQuotaScopes []corev1.ScopedResourceSelectorRequirement) ([]corev1.ScopedResourceSelectorRequirement, error) // MatchingResources takes the input specified list of resources and returns the set of resources evaluator matches. MatchingResources(input []corev1.ResourceName) []corev1.ResourceName diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go index c2eec48b8395..d40214f9db9b 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go @@ -45,6 +45,7 @@ import ( "k8s.io/apiserver/pkg/storage/etcd3/metrics" "k8s.io/apiserver/pkg/util/dryrun" "k8s.io/client-go/tools/cache" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" "k8s.io/klog/v2" ) @@ -201,6 +202,10 @@ type Store struct { // of items into tabular output. If unset, the default will be used. TableConvertor rest.TableConvertor + // ResetFieldsStrategy provides the fields reset by the strategy that + // should not be modified by the user. + ResetFieldsStrategy rest.ResetFieldsStrategy + // Storage is the interface for the underlying storage for the // resource. It is wrapped into a "DryRunnableStorage" that will // either pass-through or simply dry-run. @@ -1445,6 +1450,14 @@ func (e *Store) StorageVersion() runtime.GroupVersioner { return e.StorageVersioner } +// GetResetFields implements rest.ResetFieldsStrategy +func (e *Store) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { + if e.ResetFieldsStrategy == nil { + return nil + } + return e.ResetFieldsStrategy.GetResetFields() +} + // validateIndexers will check the prefix of indexers. func validateIndexers(indexers *cache.Indexers) error { if indexers == nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go index 66e7844a277f..a489095d6e08 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go @@ -27,6 +27,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/watch" + "sigs.k8s.io/structured-merge-diff/v4/fieldpath" ) //TODO: @@ -91,6 +92,13 @@ type GroupVersionKindProvider interface { GroupVersionKind(containingGV schema.GroupVersion) schema.GroupVersionKind } +// GroupVersionAcceptor is used to determine if a particular GroupVersion is acceptable to send to an endpoint. +// This is used for endpoints which accept multiple versions (which is extremely rare). +// The only known instance is pods/evictions which accepts policy/v1, but also policy/v1beta1 for backwards compatibility. +type GroupVersionAcceptor interface { + AcceptsGroupVersion(gv schema.GroupVersion) bool +} + // Lister is an object that can retrieve resources that match the provided field and label criteria. type Lister interface { // NewList returns an empty object that can be used with the List call. @@ -339,3 +347,23 @@ type StorageVersionProvider interface { // list of kinds the object might belong to. StorageVersion() runtime.GroupVersioner } + +// ResetFieldsStrategy is an optional interface that a storage object can +// implement if it wishes to provide the fields reset by its strategies. +type ResetFieldsStrategy interface { + GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set +} + +// CreateUpdateResetFieldsStrategy is a union of RESTCreateUpdateStrategy +// and ResetFieldsStrategy. +type CreateUpdateResetFieldsStrategy interface { + RESTCreateUpdateStrategy + ResetFieldsStrategy +} + +// UpdateResetFieldsStrategy is a union of RESTUpdateStrategy +// and ResetFieldsStrategy. +type UpdateResetFieldsStrategy interface { + RESTUpdateStrategy + ResetFieldsStrategy +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config.go index d1bbc27017d1..a02958e29ece 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config.go @@ -29,7 +29,6 @@ import ( "time" jsonpatch "github.com/evanphx/json-patch" - "github.com/go-openapi/spec" "github.com/google/uuid" "k8s.io/apimachinery/pkg/runtime" @@ -70,6 +69,7 @@ import ( "k8s.io/component-base/logs" "k8s.io/klog/v2" openapicommon "k8s.io/kube-openapi/pkg/common" + "k8s.io/kube-openapi/pkg/validation/spec" utilsnet "k8s.io/utils/net" // install apis @@ -165,6 +165,8 @@ type Config struct { Serializer runtime.NegotiatedSerializer // OpenAPIConfig will be used in generating OpenAPI spec. This is nil by default. Use DefaultOpenAPIConfig for "working" defaults. OpenAPIConfig *openapicommon.Config + // SkipOpenAPIInstallation avoids installing the OpenAPI handler if set to true. + SkipOpenAPIInstallation bool // RESTOptionsGetter is used to construct RESTStorage types via the generic registry. RESTOptionsGetter genericregistry.RESTOptionsGetter @@ -571,7 +573,8 @@ func (c completedConfig) New(name string, delegationTarget DelegationTarget) (*G listedPathProvider: apiServerHandler, - openAPIConfig: c.OpenAPIConfig, + openAPIConfig: c.OpenAPIConfig, + skipOpenAPIInstallation: c.SkipOpenAPIInstallation, postStartHooks: map[string]postStartHookEntry{}, preShutdownHooks: map[string]preShutdownHookEntry{}, @@ -762,8 +765,10 @@ func DefaultBuildHandlerChain(apiHandler http.Handler, c *Config) http.Handler { handler = genericapifilters.WithWarningRecorder(handler) handler = genericapifilters.WithCacheControl(handler) handler = genericfilters.WithHSTS(handler, c.HSTSDirectives) + handler = genericfilters.WithHTTPLogging(handler) handler = genericapifilters.WithRequestReceivedTimestamp(handler) handler = genericfilters.WithPanicRecovery(handler, c.RequestInfoResolver) + handler = genericapifilters.WithAuditID(handler) return handler } @@ -853,7 +858,7 @@ func AuthorizeClientBearerToken(loopback *restclient.Config, authn *Authenticati Groups: []string{user.SystemPrivilegedGroup}, } - tokenAuthenticator := authenticatorfactory.NewFromTokens(tokens) + tokenAuthenticator := authenticatorfactory.NewFromTokens(tokens, authn.APIAudiences) authn.Authenticator = authenticatorunion.New(tokenAuthenticator, authn.Authenticator) tokenAuthorizer := authorizerfactory.NewPrivilegedGroups(user.SystemPrivilegedGroup) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/cert_key.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/cert_key.go index 114002b1a07a..6a7b93ad2b47 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/cert_key.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/cert_key.go @@ -20,21 +20,6 @@ import ( "bytes" ) -// CertKeyContentProvider provides a certificate and matching private key -type CertKeyContentProvider interface { - // Name is just an identifier - Name() string - // CurrentCertKeyContent provides cert and key byte content - CurrentCertKeyContent() ([]byte, []byte) -} - -// SNICertKeyContentProvider provides a certificate and matching private key as well as optional explicit names -type SNICertKeyContentProvider interface { - CertKeyContentProvider - // SNINames provides names used for SNI. May return nil. - SNINames() []string -} - // certKeyContent holds the content for the cert and key type certKeyContent struct { cert []byte diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/client_ca.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/client_ca.go index 4348fa387842..2c950f236155 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/client_ca.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/client_ca.go @@ -18,20 +18,8 @@ package dynamiccertificates import ( "bytes" - "crypto/x509" ) -// CAContentProvider provides ca bundle byte content -type CAContentProvider interface { - // Name is just an identifier - Name() string - // CurrentCABundleContent provides ca bundle byte content. Errors can be contained to the controllers initializing - // the value. By the time you get here, you should always be returning a value that won't fail. - CurrentCABundleContent() []byte - // VerifyOptions provides VerifyOptions for authenticators - VerifyOptions() (x509.VerifyOptions, bool) -} - // dynamicCertificateContent holds the content that overrides the baseTLSConfig type dynamicCertificateContent struct { // clientCA holds the content for the clientCA bundle diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go index ec0fc5096a29..f3d6b9680eed 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go @@ -58,7 +58,6 @@ type ConfigMapCAController struct { preRunCaches []cache.InformerSynced } -var _ Notifier = &ConfigMapCAController{} var _ CAContentProvider = &ConfigMapCAController{} var _ ControllerRunner = &ConfigMapCAController{} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go index 756289a802da..6995334b37a6 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go @@ -35,18 +35,6 @@ import ( // FileRefreshDuration is exposed so that integration tests can crank up the reload speed. var FileRefreshDuration = 1 * time.Minute -// Listener is an interface to use to notify interested parties of a change. -type Listener interface { - // Enqueue should be called when an input may have changed - Enqueue() -} - -// Notifier is a way to add listeners -type Notifier interface { - // AddListener is adds a listener to be notified of potential input changes - AddListener(listener Listener) -} - // ControllerRunner is a generic interface for starting a controller type ControllerRunner interface { // RunOnce runs the sync loop a single time. This useful for synchronous priming diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go index 3b7f34738b29..9a5dc0f4b50f 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go @@ -47,7 +47,6 @@ type DynamicCertKeyPairContent struct { queue workqueue.RateLimitingInterface } -var _ Notifier = &DynamicCertKeyPairContent{} var _ CertKeyContentProvider = &DynamicCertKeyPairContent{} var _ ControllerRunner = &DynamicCertKeyPairContent{} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_sni_content.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_sni_content.go index 161fa1ca759e..621fc9ff0b8f 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_sni_content.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_sni_content.go @@ -22,7 +22,6 @@ type DynamicFileSNIContent struct { sniNames []string } -var _ Notifier = &DynamicFileSNIContent{} var _ SNICertKeyContentProvider = &DynamicFileSNIContent{} var _ ControllerRunner = &DynamicFileSNIContent{} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/interfaces.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/interfaces.go new file mode 100644 index 000000000000..7811c5d8bfed --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/interfaces.go @@ -0,0 +1,68 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package dynamiccertificates + +import ( + "crypto/x509" +) + +// Listener is an interface to use to notify interested parties of a change. +type Listener interface { + // Enqueue should be called when an input may have changed + Enqueue() +} + +// Notifier is a way to add listeners +type Notifier interface { + // AddListener is adds a listener to be notified of potential input changes. + // This is a noop on static providers. + AddListener(listener Listener) +} + +// CAContentProvider provides ca bundle byte content +type CAContentProvider interface { + Notifier + + // Name is just an identifier. + Name() string + // CurrentCABundleContent provides ca bundle byte content. Errors can be + // contained to the controllers initializing the value. By the time you get + // here, you should always be returning a value that won't fail. + CurrentCABundleContent() []byte + // VerifyOptions provides VerifyOptions for authenticators. + VerifyOptions() (x509.VerifyOptions, bool) +} + +// CertKeyContentProvider provides a certificate and matching private key. +type CertKeyContentProvider interface { + Notifier + + // Name is just an identifier. + Name() string + // CurrentCertKeyContent provides cert and key byte content. + CurrentCertKeyContent() ([]byte, []byte) +} + +// SNICertKeyContentProvider provides a certificate and matching private key as +// well as optional explicit names. +type SNICertKeyContentProvider interface { + Notifier + + CertKeyContentProvider + // SNINames provides names used for SNI. May return nil. + SNINames() []string +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/static_content.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/static_content.go index c877dfe6c6cf..1934ed1d8860 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/static_content.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/static_content.go @@ -46,6 +46,8 @@ func (c *staticCAContent) Name() string { return c.name } +func (c *staticCAContent) AddListener(Listener) {} + // CurrentCABundleContent provides ca bundle byte content func (c *staticCAContent) CurrentCABundleContent() (cabundle []byte) { return c.caBundle.caBundle @@ -61,11 +63,6 @@ type staticCertKeyContent struct { key []byte } -type staticSNICertKeyContent struct { - staticCertKeyContent - sniNames []string -} - // NewStaticCertKeyContent returns a CertKeyContentProvider that always returns the same value func NewStaticCertKeyContent(name string, cert, key []byte) (CertKeyContentProvider, error) { // Ensure that the key matches the cert and both are valid @@ -81,6 +78,23 @@ func NewStaticCertKeyContent(name string, cert, key []byte) (CertKeyContentProvi }, nil } +// Name is just an identifier +func (c *staticCertKeyContent) Name() string { + return c.name +} + +func (c *staticCertKeyContent) AddListener(Listener) {} + +// CurrentCertKeyContent provides cert and key content +func (c *staticCertKeyContent) CurrentCertKeyContent() ([]byte, []byte) { + return c.cert, c.key +} + +type staticSNICertKeyContent struct { + staticCertKeyContent + sniNames []string +} + // NewStaticSNICertKeyContent returns a SNICertKeyContentProvider that always returns the same value func NewStaticSNICertKeyContent(name string, cert, key []byte, sniNames ...string) (SNICertKeyContentProvider, error) { // Ensure that the key matches the cert and both are valid @@ -99,16 +113,8 @@ func NewStaticSNICertKeyContent(name string, cert, key []byte, sniNames ...strin }, nil } -// Name is just an identifier -func (c *staticCertKeyContent) Name() string { - return c.name -} - -// CurrentCertKeyContent provides cert and key content -func (c *staticCertKeyContent) CurrentCertKeyContent() ([]byte, []byte) { - return c.cert, c.key -} - func (c *staticSNICertKeyContent) SNINames() []string { return c.sniNames } + +func (c *staticSNICertKeyContent) AddListener(Listener) {} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/union_content.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/union_content.go index 89e19ea5a3a1..e10b112bc074 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/union_content.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/union_content.go @@ -26,7 +26,6 @@ import ( type unionCAContent []CAContentProvider -var _ Notifier = &unionCAContent{} var _ CAContentProvider = &unionCAContent{} var _ ControllerRunner = &unionCAContent{} @@ -77,9 +76,7 @@ func (c unionCAContent) VerifyOptions() (x509.VerifyOptions, bool) { // AddListener adds a listener to be notified when the CA content changes. func (c unionCAContent) AddListener(listener Listener) { for _, curr := range c { - if notifier, ok := curr.(Notifier); ok { - notifier.AddListener(listener) - } + curr.AddListener(listener) } } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go index 34c5398dba98..d9e7b8d296ee 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go @@ -51,16 +51,20 @@ func WithPanicRecovery(handler http.Handler, resolver request.RequestInfoResolve // This call can have different handlers, but the default chain rate limits. Call it after the metrics are updated // in case the rate limit delays it. If you outrun the rate for this one timed out requests, something has gone // seriously wrong with your server, but generally having a logging signal for timeouts is useful. - runtime.HandleError(fmt.Errorf("timeout or abort while handling: %v %q", req.Method, req.URL.Path)) + runtime.HandleError(fmt.Errorf("timeout or abort while handling: method=%v URI=%q audit-ID=%q", req.Method, req.RequestURI, request.GetAuditIDTruncated(req))) return } http.Error(w, "This request caused apiserver to panic. Look in the logs for details.", http.StatusInternalServerError) - klog.Errorf("apiserver panic'd on %v %v", req.Method, req.RequestURI) + klog.ErrorS(nil, "apiserver panic'd", "method", req.Method, "URI", req.RequestURI, "audit-ID", request.GetAuditIDTruncated(req)) }) } +// WithHTTPLogging enables logging of incoming requests. +func WithHTTPLogging(handler http.Handler) http.Handler { + return httplog.WithLogging(handler, httplog.DefaultStacktracePred) +} + func withPanicRecovery(handler http.Handler, crashHandler func(http.ResponseWriter, *http.Request, interface{})) http.Handler { - handler = httplog.WithLogging(handler, httplog.DefaultStacktracePred) return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { defer runtime.HandleCrash(func(err interface{}) { crashHandler(w, req, err) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go index d7d60b213de8..e780b8e4d052 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go @@ -25,7 +25,6 @@ import ( "time" systemd "github.com/coreos/go-systemd/daemon" - "github.com/go-openapi/spec" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -55,6 +54,7 @@ import ( "k8s.io/kube-openapi/pkg/handler" openapiutil "k8s.io/kube-openapi/pkg/util" openapiproto "k8s.io/kube-openapi/pkg/util/proto" + "k8s.io/kube-openapi/pkg/validation/spec" ) // Info about an API group. @@ -133,8 +133,14 @@ type GenericAPIServer struct { // Enable swagger and/or OpenAPI if these configs are non-nil. openAPIConfig *openapicommon.Config + // SkipOpenAPIInstallation indicates not to install the OpenAPI handler + // during PrepareRun. + // Set this to true when the specific API Server has its own OpenAPI handler + // (e.g. kube-aggregator) + skipOpenAPIInstallation bool + // OpenAPIVersionedService controls the /openapi/v2 endpoint, and can be used to update the served spec. - // It is set during PrepareRun. + // It is set during PrepareRun if `openAPIConfig` is non-nil unless `skipOpenAPIInstallation` is true. OpenAPIVersionedService *handler.OpenAPIService // StaticOpenAPISpec is the spec derived from the restful container endpoints. @@ -289,7 +295,7 @@ type preparedGenericAPIServer struct { func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer { s.delegationTarget.PrepareRun() - if s.openAPIConfig != nil { + if s.openAPIConfig != nil && !s.skipOpenAPIInstallation { s.OpenAPIVersionedService, s.StaticOpenAPISpec = routes.OpenAPI{ Config: s.openAPIConfig, }.Install(s.Handler.GoRestfulContainer, s.Handler.NonGoRestfulMux) @@ -549,14 +555,15 @@ func (s *GenericAPIServer) newAPIGroupVersion(apiGroupInfo *APIGroupInfo, groupV GroupVersion: groupVersion, MetaGroupVersion: apiGroupInfo.MetaGroupVersion, - ParameterCodec: apiGroupInfo.ParameterCodec, - Serializer: apiGroupInfo.NegotiatedSerializer, - Creater: apiGroupInfo.Scheme, - Convertor: apiGroupInfo.Scheme, - UnsafeConvertor: runtime.UnsafeObjectConvertor(apiGroupInfo.Scheme), - Defaulter: apiGroupInfo.Scheme, - Typer: apiGroupInfo.Scheme, - Linker: runtime.SelfLinker(meta.NewAccessor()), + ParameterCodec: apiGroupInfo.ParameterCodec, + Serializer: apiGroupInfo.NegotiatedSerializer, + Creater: apiGroupInfo.Scheme, + Convertor: apiGroupInfo.Scheme, + ConvertabilityChecker: apiGroupInfo.Scheme, + UnsafeConvertor: runtime.UnsafeObjectConvertor(apiGroupInfo.Scheme), + Defaulter: apiGroupInfo.Scheme, + Typer: apiGroupInfo.Scheme, + Linker: runtime.SelfLinker(meta.NewAccessor()), EquivalentResourceRegistry: s.EquivalentResourceRegistry, diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go index 4cb5306672bc..386d5b9ca2b5 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go @@ -25,6 +25,7 @@ import ( "runtime" "time" + "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/klog/v2" ) @@ -82,7 +83,13 @@ func WithLogging(handler http.Handler, pred StacktracePred) http.Handler { if old := respLoggerFromContext(req); old != nil { panic("multiple WithLogging calls!") } - rl := newLogged(req, w).StacktraceWhen(pred) + + startTime := time.Now() + if receivedTimestamp, ok := request.ReceivedTimestampFrom(ctx); ok { + startTime = receivedTimestamp + } + + rl := newLoggedWithStartTime(req, w, startTime).StacktraceWhen(pred) req = req.WithContext(context.WithValue(ctx, respLoggerContextKey, rl)) if klog.V(3).Enabled() { @@ -102,16 +109,20 @@ func respLoggerFromContext(req *http.Request) *respLogger { return nil } -// newLogged turns a normal response writer into a logged response writer. -func newLogged(req *http.Request, w http.ResponseWriter) *respLogger { +func newLoggedWithStartTime(req *http.Request, w http.ResponseWriter, startTime time.Time) *respLogger { return &respLogger{ - startTime: time.Now(), + startTime: startTime, req: req, w: w, logStacktracePred: DefaultStacktracePred, } } +// newLogged turns a normal response writer into a logged response writer. +func newLogged(req *http.Request, w http.ResponseWriter) *respLogger { + return newLoggedWithStartTime(req, w, time.Now()) +} + // LogOf returns the logger hiding in w. If there is not an existing logger // then a passthroughLogger will be created which will log to stdout immediately // when Addf is called. @@ -157,12 +168,14 @@ func (rl *respLogger) Addf(format string, data ...interface{}) { func (rl *respLogger) LogArgs() []interface{} { latency := time.Since(rl.startTime) + auditID := request.GetAuditIDTruncated(rl.req) if rl.hijacked { return []interface{}{ "verb", rl.req.Method, "URI", rl.req.RequestURI, "latency", latency, "userAgent", rl.req.UserAgent(), + "audit-ID", auditID, "srcIP", rl.req.RemoteAddr, "hijacked", true, } @@ -172,6 +185,7 @@ func (rl *respLogger) LogArgs() []interface{} { "URI", rl.req.RequestURI, "latency", latency, "userAgent", rl.req.UserAgent(), + "audit-ID", auditID, "srcIP", rl.req.RemoteAddr, "resp", rl.status, } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/audit.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/audit.go index ba79eb466425..81fa7bae8310 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/audit.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/audit.go @@ -29,6 +29,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" utilnet "k8s.io/apimachinery/pkg/util/net" + "k8s.io/apimachinery/pkg/util/sets" auditinternal "k8s.io/apiserver/pkg/apis/audit" auditv1 "k8s.io/apiserver/pkg/apis/audit/v1" auditv1alpha1 "k8s.io/apiserver/pkg/apis/audit/v1alpha1" @@ -296,7 +297,11 @@ func (o *AuditOptions) ApplyTo( // 2. Build log backend var logBackend audit.Backend - if w := o.LogOptions.getWriter(); w != nil { + w, err := o.LogOptions.getWriter() + if err != nil { + return err + } + if w != nil { if checker == nil { klog.V(2).Info("No audit policy file provided, no events will be recorded for log backend") } else { @@ -478,14 +483,7 @@ func (o *AuditLogOptions) Validate() []error { } // Check log format - validFormat := false - for _, f := range pluginlog.AllowedFormats { - if f == o.Format { - validFormat = true - break - } - } - if !validFormat { + if !sets.NewString(pluginlog.AllowedFormats...).Has(o.Format) { allErrors = append(allErrors, fmt.Errorf("invalid audit log format %s, allowed formats are %q", o.Format, strings.Join(pluginlog.AllowedFormats, ","))) } @@ -508,9 +506,13 @@ func (o *AuditLogOptions) enabled() bool { return o != nil && o.Path != "" } -func (o *AuditLogOptions) getWriter() io.Writer { +func (o *AuditLogOptions) getWriter() (io.Writer, error) { if !o.enabled() { - return nil + return nil, nil + } + + if err := o.ensureLogFile(); err != nil { + return nil, err } var w io.Writer = os.Stdout @@ -523,7 +525,16 @@ func (o *AuditLogOptions) getWriter() io.Writer { Compress: o.Compress, } } - return w + return w, nil +} + +func (o *AuditLogOptions) ensureLogFile() error { + mode := os.FileMode(0600) + f, err := os.OpenFile(o.Path, os.O_CREATE|os.O_APPEND|os.O_RDWR, mode) + if err != nil { + return err + } + return f.Close() } func (o *AuditLogOptions) newBackend(w io.Writer) audit.Backend { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authentication.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authentication.go index 46130aad4e93..c76e79c7844b 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authentication.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authentication.go @@ -21,8 +21,6 @@ import ( "strings" "time" - "k8s.io/apiserver/pkg/server/dynamiccertificates" - "github.com/spf13/pflag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -30,9 +28,11 @@ import ( "k8s.io/apiserver/pkg/authentication/authenticatorfactory" "k8s.io/apiserver/pkg/authentication/request/headerrequest" "k8s.io/apiserver/pkg/server" + "k8s.io/apiserver/pkg/server/dynamiccertificates" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + "k8s.io/client-go/transport" "k8s.io/klog/v2" openapicommon "k8s.io/kube-openapi/pkg/common" ) @@ -195,9 +195,12 @@ type DelegatingAuthenticationOptions struct { // before we fail the webhook call in order to limit the fan out that ensues when the system is degraded. WebhookRetryBackoff *wait.Backoff - // ClientTimeout specifies a time limit for requests made by the authorization webhook client. + // TokenRequestTimeout specifies a time limit for requests made by the authorization webhook client. // The default value is set to 10 seconds. - ClientTimeout time.Duration + TokenRequestTimeout time.Duration + + // CustomRoundTripperFn allows for specifying a middleware function for custom HTTP behaviour for the authentication webhook client. + CustomRoundTripperFn transport.WrapperFunc } func NewDelegatingAuthenticationOptions() *DelegatingAuthenticationOptions { @@ -211,7 +214,7 @@ func NewDelegatingAuthenticationOptions() *DelegatingAuthenticationOptions { ExtraHeaderPrefixes: []string{"x-remote-extra-"}, }, WebhookRetryBackoff: DefaultAuthWebhookRetryBackoff(), - ClientTimeout: 10 * time.Second, + TokenRequestTimeout: 10 * time.Second, } } @@ -220,9 +223,14 @@ func (s *DelegatingAuthenticationOptions) WithCustomRetryBackoff(backoff wait.Ba s.WebhookRetryBackoff = &backoff } -// WithClientTimeout sets the given timeout for the authentication webhook client. -func (s *DelegatingAuthenticationOptions) WithClientTimeout(timeout time.Duration) { - s.ClientTimeout = timeout +// WithRequestTimeout sets the given timeout for requests made by the authentication webhook client. +func (s *DelegatingAuthenticationOptions) WithRequestTimeout(timeout time.Duration) { + s.TokenRequestTimeout = timeout +} + +// WithCustomRoundTripper allows for specifying a middleware function for custom HTTP behaviour for the authentication webhook client. +func (s *DelegatingAuthenticationOptions) WithCustomRoundTripper(rt transport.WrapperFunc) { + s.CustomRoundTripperFn = rt } func (s *DelegatingAuthenticationOptions) Validate() []error { @@ -274,9 +282,10 @@ func (s *DelegatingAuthenticationOptions) ApplyTo(authenticationInfo *server.Aut } cfg := authenticatorfactory.DelegatingAuthenticatorConfig{ - Anonymous: true, - CacheTTL: s.CacheTTL, - WebhookRetryBackoff: s.WebhookRetryBackoff, + Anonymous: true, + CacheTTL: s.CacheTTL, + WebhookRetryBackoff: s.WebhookRetryBackoff, + TokenAccessReviewTimeout: s.TokenRequestTimeout, } client, err := s.getClient() @@ -290,16 +299,16 @@ func (s *DelegatingAuthenticationOptions) ApplyTo(authenticationInfo *server.Aut } // get the clientCA information - clientCAFileSpecified := len(s.ClientCert.ClientCA) > 0 + clientCASpecified := s.ClientCert != ClientCertAuthenticationOptions{} var clientCAProvider dynamiccertificates.CAContentProvider - if clientCAFileSpecified { + if clientCASpecified { clientCAProvider, err = s.ClientCert.GetClientCAContentProvider() if err != nil { - return fmt.Errorf("unable to load client CA file %q: %v", s.ClientCert.ClientCA, err) + return fmt.Errorf("unable to load client CA provider: %v", err) } cfg.ClientCertificateCAContentProvider = clientCAProvider if err = authenticationInfo.ApplyClientCert(cfg.ClientCertificateCAContentProvider, servingInfo); err != nil { - return fmt.Errorf("unable to assign client CA file: %v", err) + return fmt.Errorf("unable to assign client CA provider: %v", err) } } else if !s.SkipInClusterLookup { @@ -419,7 +428,13 @@ func (s *DelegatingAuthenticationOptions) getClient() (kubernetes.Interface, err // set high qps/burst limits since this will effectively limit API server responsiveness clientConfig.QPS = 200 clientConfig.Burst = 400 - clientConfig.Timeout = s.ClientTimeout + // do not set a timeout on the http client, instead use context for cancellation + // if multiple timeouts were set, the request will pick the smaller timeout to be applied, leaving other useless. + // + // see https://github.com/golang/go/blob/a937729c2c2f6950a32bc5cd0f5b88700882f078/src/net/http/client.go#L364 + if s.CustomRoundTripperFn != nil { + clientConfig.Wrap(s.CustomRoundTripperFn) + } return kubernetes.NewForConfig(clientConfig) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authentication_dynamic_request_header.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authentication_dynamic_request_header.go index 5c558b06d68c..e2beb5c23824 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authentication_dynamic_request_header.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authentication_dynamic_request_header.go @@ -26,7 +26,6 @@ import ( ) var _ dynamiccertificates.ControllerRunner = &DynamicRequestHeaderController{} -var _ dynamiccertificates.Notifier = &DynamicRequestHeaderController{} var _ dynamiccertificates.CAContentProvider = &DynamicRequestHeaderController{} var _ headerrequest.RequestHeaderAuthRequestProvider = &DynamicRequestHeaderController{} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authorization.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authorization.go index 796514e91067..ad7ce4b3ca06 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authorization.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/authorization.go @@ -21,7 +21,6 @@ import ( "time" "github.com/spf13/pflag" - "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apiserver/pkg/authorization/authorizer" @@ -32,6 +31,8 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + "k8s.io/client-go/transport" + "k8s.io/klog/v2" ) // DelegatingAuthorizationOptions provides an easy way for composing API servers to delegate their authorization to @@ -69,6 +70,9 @@ type DelegatingAuthorizationOptions struct { // This allows us to configure the sleep time at each iteration and the maximum number of retries allowed // before we fail the webhook call in order to limit the fan out that ensues when the system is degraded. WebhookRetryBackoff *wait.Backoff + + // CustomRoundTripperFn allows for specifying a middleware function for custom HTTP behaviour for the authorization webhook client. + CustomRoundTripperFn transport.WrapperFunc } func NewDelegatingAuthorizationOptions() *DelegatingAuthorizationOptions { @@ -111,6 +115,11 @@ func (s *DelegatingAuthorizationOptions) WithCustomRetryBackoff(backoff wait.Bac s.WebhookRetryBackoff = &backoff } +// WithCustomRoundTripper allows for specifying a middleware function for custom HTTP behaviour for the authorization webhook client. +func (s *DelegatingAuthorizationOptions) WithCustomRoundTripper(rt transport.WrapperFunc) { + s.CustomRoundTripperFn = rt +} + func (s *DelegatingAuthorizationOptions) Validate() []error { if s == nil { return nil @@ -226,6 +235,9 @@ func (s *DelegatingAuthorizationOptions) getClient() (kubernetes.Interface, erro clientConfig.QPS = 200 clientConfig.Burst = 400 clientConfig.Timeout = s.ClientTimeout + if s.CustomRoundTripperFn != nil { + clientConfig.Wrap(s.CustomRoundTripperFn) + } return kubernetes.NewForConfig(clientConfig) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go index c9fb43b9598c..4be4d03fc216 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go @@ -18,13 +18,13 @@ package routes import ( restful "github.com/emicklei/go-restful" - "github.com/go-openapi/spec" "k8s.io/klog/v2" "k8s.io/apiserver/pkg/server/mux" "k8s.io/kube-openapi/pkg/builder" "k8s.io/kube-openapi/pkg/common" "k8s.io/kube-openapi/pkg/handler" + "k8s.io/kube-openapi/pkg/validation/spec" ) // OpenAPI installs spec endpoints for each web service. diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/secure_serving.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/secure_serving.go index 38341eb03bd6..356bd3a2fe8e 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/secure_serving.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/secure_serving.go @@ -86,13 +86,14 @@ func (s *SecureServingInfo) tlsConfig(stopCh <-chan struct{}) (*tls.Config, erro s.SNICerts, nil, // TODO see how to plumb an event recorder down in here. For now this results in simply klog messages. ) - // register if possible - if notifier, ok := s.ClientCA.(dynamiccertificates.Notifier); ok { - notifier.AddListener(dynamicCertificateController) + + if s.ClientCA != nil { + s.ClientCA.AddListener(dynamicCertificateController) } - if notifier, ok := s.Cert.(dynamiccertificates.Notifier); ok { - notifier.AddListener(dynamicCertificateController) + if s.Cert != nil { + s.Cert.AddListener(dynamicCertificateController) } + // start controllers if possible if controller, ok := s.ClientCA.(dynamiccertificates.ControllerRunner); ok { // runonce to try to prime data. If this fails, it's ok because we fail closed. @@ -113,10 +114,7 @@ func (s *SecureServingInfo) tlsConfig(stopCh <-chan struct{}) (*tls.Config, erro go controller.Run(1, stopCh) } for _, sniCert := range s.SNICerts { - if notifier, ok := sniCert.(dynamiccertificates.Notifier); ok { - notifier.AddListener(dynamicCertificateController) - } - + sniCert.AddListener(dynamicCertificateController) if controller, ok := sniCert.(dynamiccertificates.ControllerRunner); ok { // runonce to try to prime data. If this fails, it's ok because we fail closed. // Files are required to be populated already, so this is for convenience. diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/OWNERS b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/OWNERS index 68f98b61a24f..2426b1c0c203 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/OWNERS @@ -19,7 +19,6 @@ reviewers: - hongchaodeng - krousey - xiang90 -- mml - ingvagabund - resouer - enj diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go index 1ab266c8593e..c97a4afc8231 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go @@ -43,11 +43,20 @@ var ( }, []string{"operation", "type"}, ) + etcdObjectCounts = compbasemetrics.NewGaugeVec( + &compbasemetrics.GaugeOpts{ + Name: "etcd_object_counts", + DeprecatedVersion: "1.22.0", + Help: "Number of stored objects at the time of last check split by kind. This metric is replaced by apiserver_storage_object_counts.", + StabilityLevel: compbasemetrics.ALPHA, + }, + []string{"resource"}, + ) objectCounts = compbasemetrics.NewGaugeVec( &compbasemetrics.GaugeOpts{ - Name: "etcd_object_counts", + Name: "apiserver_storage_objects", Help: "Number of stored objects at the time of last check split by kind.", - StabilityLevel: compbasemetrics.ALPHA, + StabilityLevel: compbasemetrics.STABLE, }, []string{"resource"}, ) @@ -86,15 +95,17 @@ func Register() { registerMetrics.Do(func() { legacyregistry.MustRegister(etcdRequestLatency) legacyregistry.MustRegister(objectCounts) + legacyregistry.MustRegister(etcdObjectCounts) legacyregistry.MustRegister(dbTotalSize) legacyregistry.MustRegister(etcdBookmarkCounts) legacyregistry.MustRegister(etcdLeaseObjectCounts) }) } -// UpdateObjectCount sets the etcd_object_counts metric. +// UpdateObjectCount sets the apiserver_storage_object_counts and etcd_object_counts (deprecated) metric. func UpdateObjectCount(resourcePrefix string, count int64) { objectCounts.WithLabelValues(resourcePrefix).Set(float64(count)) + etcdObjectCounts.WithLabelValues(resourcePrefix).Set(float64(count)) } // RecordEtcdRequestLatency sets the etcd_request_duration_seconds metrics. diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storageversion/manager.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storageversion/manager.go index 03e21a4d6d31..c5ec9da1dd8d 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storageversion/manager.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storageversion/manager.go @@ -40,6 +40,10 @@ type ResourceInfo struct { // Used to calculate decodable versions. Can only be used after all // equivalent versions are registered by InstallREST. EquivalentResourceMapper runtime.EquivalentResourceRegistry + + // DirectlyDecodableVersions is a list of versions that the converter for REST storage knows how to convert. This + // contains items like apiextensions.k8s.io/v1beta1 even if we don't serve that version. + DirectlyDecodableVersions []schema.GroupVersion } // Manager records the resources whose StorageVersions need updates, and provides a method to update those StorageVersions. @@ -133,13 +137,13 @@ func (s *defaultManager) UpdateStorageVersions(kubeAPIServerClientConfig *rest.C // StorageVersion objects have CommonEncodingVersion (each with one server registered). sortResourceInfosByGroupResource(resources) for _, r := range dedupResourceInfos(resources) { - dv := decodableVersions(r.EquivalentResourceMapper, r.GroupResource) + decodableVersions := decodableVersions(r.DirectlyDecodableVersions, r.EquivalentResourceMapper, r.GroupResource) gr := r.GroupResource // Group must be a valid subdomain in DNS (RFC 1123) if len(gr.Group) == 0 { gr.Group = "core" } - if err := updateStorageVersionFor(sc, serverID, gr, r.EncodingVersion, dv); err != nil { + if err := updateStorageVersionFor(sc, serverID, gr, r.EncodingVersion, decodableVersions); err != nil { utilruntime.HandleError(fmt.Errorf("failed to update storage version for %v: %v", r.GroupResource, err)) s.recordStatusFailure(&r, err) hasFailure = true @@ -267,10 +271,23 @@ func (s *defaultManager) Completed() bool { return s.completed.Load().(bool) } -func decodableVersions(e runtime.EquivalentResourceRegistry, gr schema.GroupResource) []string { +func decodableVersions(directlyDecodableVersions []schema.GroupVersion, e runtime.EquivalentResourceRegistry, gr schema.GroupResource) []string { var versions []string + for _, decodableVersions := range directlyDecodableVersions { + versions = append(versions, decodableVersions.String()) + } + decodingGVRs := e.EquivalentResourcesFor(gr.WithVersion(""), "") for _, v := range decodingGVRs { + found := false + for _, existingVersion := range versions { + if existingVersion == v.GroupVersion().String() { + found = true + } + } + if found { + continue + } versions = append(versions, v.GroupVersion().String()) } return versions diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go index 8c34b2b06155..3ee3867456d5 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go @@ -23,6 +23,7 @@ import ( "encoding/json" "fmt" "math" + "math/rand" "sort" "sync" "time" @@ -34,8 +35,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" apitypes "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/clock" utilerrors "k8s.io/apimachinery/pkg/util/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" fcboot "k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap" "k8s.io/apiserver/pkg/authentication/user" @@ -53,6 +56,8 @@ import ( flowcontrollister "k8s.io/client-go/listers/flowcontrol/v1beta1" ) +const timeFmt = "2006-01-02T15:04:05.999" + // This file contains a simple local (to the apiserver) controller // that digests API Priority and Fairness config objects (FlowSchema // and PriorityLevelConfiguration) into the data structure that the @@ -85,9 +90,19 @@ type RequestDigest struct { // this type and cfgMeal follow the convention that the suffix // "Locked" means that the caller must hold the configController lock. type configController struct { + name string // varies in tests of fighting controllers + clock clock.PassiveClock queueSetFactory fq.QueueSetFactory obsPairGenerator metrics.TimedObserverPairGenerator + // How this controller appears in an ObjectMeta ManagedFieldsEntry.Manager + asFieldManager string + + // Given a boolean indicating whether a FlowSchema's referenced + // PriorityLevelConfig exists, return a boolean indicating whether + // the reference is dangling + foundToDangling func(bool) bool + // configQueue holds `(interface{})(0)` when the configuration // objects need to be reprocessed. configQueue workqueue.RateLimitingInterface @@ -122,6 +137,18 @@ type configController struct { // name to the state for that level. Every name referenced from a // member of `flowSchemas` has an entry here. priorityLevelStates map[string]*priorityLevelState + + // the most recent update attempts, ordered by increasing age. + // Consumer trims to keep only the last minute's worth of entries. + // The controller uses this to limit itself to at most six updates + // to a given FlowSchema in any minute. + // This may only be accessed from the one and only worker goroutine. + mostRecentUpdates []updateAttempt +} + +type updateAttempt struct { + timeUpdated time.Time + updatedItems sets.String // FlowSchema names } // priorityLevelState holds the state specific to a priority level. @@ -154,14 +181,18 @@ type priorityLevelState struct { // NewTestableController is extra flexible to facilitate testing func newTestableController(config TestableConfig) *configController { cfgCtlr := &configController{ + name: config.Name, + clock: config.Clock, queueSetFactory: config.QueueSetFactory, obsPairGenerator: config.ObsPairGenerator, + asFieldManager: config.AsFieldManager, + foundToDangling: config.FoundToDangling, serverConcurrencyLimit: config.ServerConcurrencyLimit, requestWaitLimit: config.RequestWaitLimit, flowcontrolClient: config.FlowcontrolClient, priorityLevelStates: make(map[string]*priorityLevelState), } - klog.V(2).Infof("NewTestableController with serverConcurrencyLimit=%d, requestWaitLimit=%s", cfgCtlr.serverConcurrencyLimit, cfgCtlr.requestWaitLimit) + klog.V(2).Infof("NewTestableController %q with serverConcurrencyLimit=%d, requestWaitLimit=%s, name=%s, asFieldManager=%q", cfgCtlr.name, cfgCtlr.serverConcurrencyLimit, cfgCtlr.requestWaitLimit, cfgCtlr.name, cfgCtlr.asFieldManager) // Start with longish delay because conflicts will be between // different processes, so take some time to go away. cfgCtlr.configQueue = workqueue.NewNamedRateLimitingQueue(workqueue.NewItemExponentialFailureRateLimiter(200*time.Millisecond, 8*time.Hour), "priority_and_fairness_config_queue") @@ -177,40 +208,60 @@ func newTestableController(config TestableConfig) *configController { pli.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { pl := obj.(*flowcontrol.PriorityLevelConfiguration) - klog.V(7).Infof("Triggered API priority and fairness config reloading due to creation of PLC %s", pl.Name) + klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to creation of PLC %s", cfgCtlr.name, pl.Name) cfgCtlr.configQueue.Add(0) }, UpdateFunc: func(oldObj, newObj interface{}) { newPL := newObj.(*flowcontrol.PriorityLevelConfiguration) oldPL := oldObj.(*flowcontrol.PriorityLevelConfiguration) if !apiequality.Semantic.DeepEqual(oldPL.Spec, newPL.Spec) { - klog.V(7).Infof("Triggered API priority and fairness config reloading due to spec update of PLC %s", newPL.Name) + klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to spec update of PLC %s", cfgCtlr.name, newPL.Name) cfgCtlr.configQueue.Add(0) + } else { + klog.V(7).Infof("No trigger API priority and fairness config reloading in %s due to spec non-change of PLC %s", cfgCtlr.name, newPL.Name) } }, DeleteFunc: func(obj interface{}) { name, _ := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) - klog.V(7).Infof("Triggered API priority and fairness config reloading due to deletion of PLC %s", name) + klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to deletion of PLC %s", cfgCtlr.name, name) cfgCtlr.configQueue.Add(0) }}) fsi.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { fs := obj.(*flowcontrol.FlowSchema) - klog.V(7).Infof("Triggered API priority and fairness config reloading due to creation of FS %s", fs.Name) + klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to creation of FS %s", cfgCtlr.name, fs.Name) cfgCtlr.configQueue.Add(0) }, UpdateFunc: func(oldObj, newObj interface{}) { newFS := newObj.(*flowcontrol.FlowSchema) oldFS := oldObj.(*flowcontrol.FlowSchema) - if !apiequality.Semantic.DeepEqual(oldFS.Spec, newFS.Spec) { - klog.V(7).Infof("Triggered API priority and fairness config reloading due to spec update of FS %s", newFS.Name) + // Changes to either Spec or Status are relevant. The + // concern is that we might, in some future release, want + // different behavior than is implemented now. One of the + // hardest questions is how does an operator roll out the + // new release in a cluster with multiple kube-apiservers + // --- in a way that works no matter what servers crash + // and restart when. If this handler reacts only to + // changes in Spec then we have a scenario in which the + // rollout leaves the old Status in place. The scenario + // ends with this subsequence: deploy the last new server + // before deleting the last old server, and in between + // those two operations the last old server crashes and + // recovers. The chosen solution is making this controller + // insist on maintaining the particular state that it + // establishes. + if !(apiequality.Semantic.DeepEqual(oldFS.Spec, newFS.Spec) && + apiequality.Semantic.DeepEqual(oldFS.Status, newFS.Status)) { + klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to spec and/or status update of FS %s", cfgCtlr.name, newFS.Name) cfgCtlr.configQueue.Add(0) + } else { + klog.V(7).Infof("No trigger of API priority and fairness config reloading in %s due to spec and status non-change of FS %s", cfgCtlr.name, newFS.Name) } }, DeleteFunc: func(obj interface{}) { name, _ := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) - klog.V(7).Infof("Triggered API priority and fairness config reloading due to deletion of FS %s", name) + klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to deletion of FS %s", cfgCtlr.name, name) cfgCtlr.configQueue.Add(0) }}) @@ -253,11 +304,16 @@ func (cfgCtlr *configController) Run(stopCh <-chan struct{}) error { return nil } +// runWorker is the logic of the one and only worker goroutine. We +// limit the number to one in order to obviate explicit +// synchronization around access to `cfgCtlr.mostRecentUpdates`. func (cfgCtlr *configController) runWorker() { for cfgCtlr.processNextWorkItem() { } } +// processNextWorkItem works on one entry from the work queue. +// Only invoke this in the one and only worker goroutine. func (cfgCtlr *configController) processNextWorkItem() bool { obj, shutdown := cfgCtlr.configQueue.Get() if shutdown { @@ -266,9 +322,14 @@ func (cfgCtlr *configController) processNextWorkItem() bool { func(obj interface{}) { defer cfgCtlr.configQueue.Done(obj) - if !cfgCtlr.syncOne() { + specificDelay, err := cfgCtlr.syncOne(map[string]string{}) + switch { + case err != nil: + klog.Error(err) cfgCtlr.configQueue.AddRateLimited(obj) - } else { + case specificDelay > 0: + cfgCtlr.configQueue.AddAfter(obj, specificDelay) + default: cfgCtlr.configQueue.Forget(obj) } }(obj) @@ -276,27 +337,22 @@ func (cfgCtlr *configController) processNextWorkItem() bool { return true } -// syncOne attempts to sync all the API Priority and Fairness config -// objects. It either succeeds and returns `true` or logs an error -// and returns `false`. -func (cfgCtlr *configController) syncOne() bool { +// syncOne does one full synchronization. It reads all the API +// objects that configure API Priority and Fairness and updates the +// local configController accordingly. +// Only invoke this in the one and only worker goroutine +func (cfgCtlr *configController) syncOne(flowSchemaRVs map[string]string) (specificDelay time.Duration, err error) { + klog.V(5).Infof("%s syncOne at %s", cfgCtlr.name, cfgCtlr.clock.Now().Format(timeFmt)) all := labels.Everything() newPLs, err := cfgCtlr.plLister.List(all) if err != nil { - klog.Errorf("Unable to list PriorityLevelConfiguration objects: %s", err.Error()) - return false + return 0, fmt.Errorf("unable to list PriorityLevelConfiguration objects: %w", err) } newFSs, err := cfgCtlr.fsLister.List(all) if err != nil { - klog.Errorf("Unable to list FlowSchema objects: %s", err.Error()) - return false + return 0, fmt.Errorf("unable to list FlowSchema objects: %w", err) } - err = cfgCtlr.digestConfigObjects(newPLs, newFSs) - if err == nil { - return true - } - klog.Error(err) - return false + return cfgCtlr.digestConfigObjects(newPLs, newFSs, flowSchemaRVs) } // cfgMeal is the data involved in the process of digesting the API @@ -336,35 +392,79 @@ type fsStatusUpdate struct { // digestConfigObjects is given all the API objects that configure // cfgCtlr and writes its consequent new configState. -func (cfgCtlr *configController) digestConfigObjects(newPLs []*flowcontrol.PriorityLevelConfiguration, newFSs []*flowcontrol.FlowSchema) error { +// Only invoke this in the one and only worker goroutine +func (cfgCtlr *configController) digestConfigObjects(newPLs []*flowcontrol.PriorityLevelConfiguration, newFSs []*flowcontrol.FlowSchema, flowSchemaRVs map[string]string) (time.Duration, error) { fsStatusUpdates := cfgCtlr.lockAndDigestConfigObjects(newPLs, newFSs) var errs []error + currResult := updateAttempt{ + timeUpdated: cfgCtlr.clock.Now(), + updatedItems: sets.String{}, + } + var suggestedDelay time.Duration for _, fsu := range fsStatusUpdates { + // if we should skip this name, indicate we will need a delay, but continue with other entries + if cfgCtlr.shouldDelayUpdate(fsu.flowSchema.Name) { + if suggestedDelay == 0 { + suggestedDelay = time.Duration(30+rand.Intn(45)) * time.Second + } + continue + } + + // if we are going to issue an update, be sure we track every name we update so we know if we update it too often. + currResult.updatedItems.Insert(fsu.flowSchema.Name) + enc, err := json.Marshal(fsu.condition) if err != nil { // should never happen because these conditions are created here and well formed panic(fmt.Sprintf("Failed to json.Marshall(%#+v): %s", fsu.condition, err.Error())) } - klog.V(4).Infof("Writing Condition %s to FlowSchema %s because its previous value was %s", string(enc), fsu.flowSchema.Name, fcfmt.Fmt(fsu.oldValue)) + klog.V(4).Infof("%s writing Condition %s to FlowSchema %s, which had ResourceVersion=%s, because its previous value was %s", cfgCtlr.name, string(enc), fsu.flowSchema.Name, fsu.flowSchema.ResourceVersion, fcfmt.Fmt(fsu.oldValue)) fsIfc := cfgCtlr.flowcontrolClient.FlowSchemas() patchBytes := []byte(fmt.Sprintf(`{"status": {"conditions": [ %s ] } }`, string(enc))) - patchOptions := metav1.PatchOptions{FieldManager: ConfigConsumerAsFieldManager} - _, err = fsIfc.Patch(context.TODO(), fsu.flowSchema.Name, apitypes.StrategicMergePatchType, patchBytes, patchOptions, "status") + patchOptions := metav1.PatchOptions{FieldManager: cfgCtlr.asFieldManager} + patchedFlowSchema, err := fsIfc.Patch(context.TODO(), fsu.flowSchema.Name, apitypes.StrategicMergePatchType, patchBytes, patchOptions, "status") if err == nil { - continue - } - if apierrors.IsNotFound(err) { + key, _ := cache.MetaNamespaceKeyFunc(patchedFlowSchema) + flowSchemaRVs[key] = patchedFlowSchema.ResourceVersion + } else if apierrors.IsNotFound(err) { // This object has been deleted. A notification is coming // and nothing more needs to be done here. - klog.V(5).Infof("Attempted update of concurrently deleted FlowSchema %s; nothing more needs to be done", fsu.flowSchema.Name) + klog.V(5).Infof("%s at %s: attempted update of concurrently deleted FlowSchema %s; nothing more needs to be done", cfgCtlr.name, cfgCtlr.clock.Now().Format(timeFmt), fsu.flowSchema.Name) } else { errs = append(errs, errors.Wrap(err, fmt.Sprintf("failed to set a status.condition for FlowSchema %s", fsu.flowSchema.Name))) } } - if len(errs) == 0 { - return nil + cfgCtlr.addUpdateResult(currResult) + + return suggestedDelay, utilerrors.NewAggregate(errs) +} + +// shouldDelayUpdate checks to see if a flowschema has been updated too often and returns true if a delay is needed. +// Only invoke this in the one and only worker goroutine +func (cfgCtlr *configController) shouldDelayUpdate(flowSchemaName string) bool { + numUpdatesInPastMinute := 0 + oneMinuteAgo := cfgCtlr.clock.Now().Add(-1 * time.Minute) + for idx, update := range cfgCtlr.mostRecentUpdates { + if oneMinuteAgo.After(update.timeUpdated) { + // this and the remaining items are no longer relevant + cfgCtlr.mostRecentUpdates = cfgCtlr.mostRecentUpdates[:idx] + return false + } + if update.updatedItems.Has(flowSchemaName) { + numUpdatesInPastMinute++ + if numUpdatesInPastMinute > 5 { + return true + } + } } - return utilerrors.NewAggregate(errs) + return false +} + +// addUpdateResult adds the result. It isn't a ring buffer because +// this is small and rate limited. +// Only invoke this in the one and only worker goroutine +func (cfgCtlr *configController) addUpdateResult(result updateAttempt) { + cfgCtlr.mostRecentUpdates = append([]updateAttempt{result}, cfgCtlr.mostRecentUpdates...) } func (cfgCtlr *configController) lockAndDigestConfigObjects(newPLs []*flowcontrol.PriorityLevelConfiguration, newFSs []*flowcontrol.FlowSchema) []fsStatusUpdate { @@ -448,7 +548,7 @@ func (meal *cfgMeal) digestFlowSchemasLocked(newFSs []*flowcontrol.FlowSchema) { // // TODO: consider not even trying if server is not handling // requests yet. - meal.presyncFlowSchemaStatus(fs, !goodPriorityRef, fs.Spec.PriorityLevelConfiguration.Name) + meal.presyncFlowSchemaStatus(fs, meal.cfgCtlr.foundToDangling(goodPriorityRef), fs.Spec.PriorityLevelConfiguration.Name) if !goodPriorityRef { klog.V(6).Infof("Ignoring FlowSchema %s because of bad priority level reference %q", fs.Name, fs.Spec.PriorityLevelConfiguration.Name) @@ -612,12 +712,13 @@ func (meal *cfgMeal) presyncFlowSchemaStatus(fs *flowcontrol.FlowSchema, isDangl if danglingCondition.Status == desiredStatus && danglingCondition.Reason == desiredReason && danglingCondition.Message == desiredMessage { return } + now := meal.cfgCtlr.clock.Now() meal.fsStatusUpdates = append(meal.fsStatusUpdates, fsStatusUpdate{ flowSchema: fs, condition: flowcontrol.FlowSchemaCondition{ Type: flowcontrol.FlowSchemaConditionDangling, Status: desiredStatus, - LastTransitionTime: metav1.Now(), + LastTransitionTime: metav1.NewTime(now), Reason: desiredReason, Message: desiredMessage, }, @@ -710,7 +811,9 @@ func (cfgCtlr *configController) startRequest(ctx context.Context, rd RequestDig return selectedFlowSchema, plState.pl, false, req, startWaitingTime } -// Call this after getting a clue that the given priority level is undesired and idle +// maybeReap will remove the last internal traces of the named +// priority level if it has no more use. Call this after getting a +// clue that the given priority level is undesired and idle. func (cfgCtlr *configController) maybeReap(plName string) { cfgCtlr.lock.Lock() defer cfgCtlr.lock.Unlock() @@ -730,8 +833,11 @@ func (cfgCtlr *configController) maybeReap(plName string) { cfgCtlr.configQueue.Add(0) } -// Call this if both (1) plState.queues is non-nil and reported being -// idle, and (2) cfgCtlr's lock has not been released since then. +// maybeReapLocked requires the cfgCtlr's lock to already be held and +// will remove the last internal traces of the named priority level if +// it has no more use. Call this if both (1) plState.queues is +// non-nil and reported being idle, and (2) cfgCtlr's lock has not +// been released since then. func (cfgCtlr *configController) maybeReapLocked(plName string, plState *priorityLevelState) { if !(plState.quiescing && plState.numPending == 0) { return diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_filter.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_filter.go index e9564d4d51c6..825ae09ce3dc 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_filter.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_filter.go @@ -78,18 +78,43 @@ func New( requestWaitLimit time.Duration, ) Interface { grc := counter.NoOp{} + clk := clock.RealClock{} return NewTestable(TestableConfig{ + Name: "Controller", + Clock: clk, + AsFieldManager: ConfigConsumerAsFieldManager, + FoundToDangling: func(found bool) bool { return !found }, InformerFactory: informerFactory, FlowcontrolClient: flowcontrolClient, ServerConcurrencyLimit: serverConcurrencyLimit, RequestWaitLimit: requestWaitLimit, ObsPairGenerator: metrics.PriorityLevelConcurrencyObserverPairGenerator, - QueueSetFactory: fqs.NewQueueSetFactory(&clock.RealClock{}, grc), + QueueSetFactory: fqs.NewQueueSetFactory(clk, grc), }) } // TestableConfig carries the parameters to an implementation that is testable type TestableConfig struct { + // Name of the controller + Name string + + // Clock to use in timing deliberate delays + Clock clock.PassiveClock + + // AsFieldManager is the string to use in the metadata for + // server-side apply. Normally this is + // `ConfigConsumerAsFieldManager`. This is exposed as a parameter + // so that a test of competing controllers can supply different + // values. + AsFieldManager string + + // FoundToDangling maps the boolean indicating whether a + // FlowSchema's referenced PLC exists to the boolean indicating + // that FlowSchema's status should indicate a dangling reference. + // This is a parameter so that we can write tests of what happens + // when servers disagree on that bit of Status. + FoundToDangling func(bool) bool + // InformerFactory to use in building the controller InformerFactory kubeinformers.SharedInformerFactory diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go index 6a85bb589900..8229ccbbb4b3 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go @@ -285,6 +285,11 @@ func (qs *queueSet) StartRequest(ctx context.Context, hashValue uint64, flowDist // request's context's Done channel gets closed by the time // the request is done being processed. doneCh := ctx.Done() + + // Retrieve the queueset configuration name while we have the lock + // and use it in the goroutine below. + configName := qs.qCfg.Name + if doneCh != nil { qs.preCreateOrUnblockGoroutine() go func() { @@ -297,7 +302,7 @@ func (qs *queueSet) StartRequest(ctx context.Context, hashValue uint64, flowDist // known that the count does not need to be accurate. // BTW, the count only needs to be accurate in a test that // uses FakeEventClock::Run(). - klog.V(6).Infof("QS(%s): Context of request %q %#+v %#+v is Done", qs.qCfg.Name, fsName, descr1, descr2) + klog.V(6).Infof("QS(%s): Context of request %q %#+v %#+v is Done", configName, fsName, descr1, descr2) qs.cancelWait(req) qs.goroutineDoneOrBlocked() }() diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/openapi/proto.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/openapi/proto.go index 0f95a5f79463..49c76fa8b68d 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/openapi/proto.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/openapi/proto.go @@ -19,12 +19,10 @@ package openapi import ( "encoding/json" - "github.com/go-openapi/spec" - "github.com/googleapis/gnostic/compiler" openapi_v2 "github.com/googleapis/gnostic/openapiv2" - yaml "gopkg.in/yaml.v2" "k8s.io/kube-openapi/pkg/util/proto" + "k8s.io/kube-openapi/pkg/validation/spec" ) // ToProtoModels builds the proto formatted models from OpenAPI spec @@ -34,13 +32,7 @@ func ToProtoModels(openAPISpec *spec.Swagger) (proto.Models, error) { return nil, err } - var info yaml.MapSlice - err = yaml.Unmarshal(specBytes, &info) - if err != nil { - return nil, err - } - - doc, err := openapi_v2.NewDocument(info, compiler.NewContext("$root", nil)) + doc, err := openapi_v2.ParseDocument(specBytes) if err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go b/cluster-autoscaler/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go index 5bedf4e5985f..41dd7a69e9b9 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go @@ -52,17 +52,18 @@ type tokenReviewer interface { } type WebhookTokenAuthenticator struct { - tokenReview tokenReviewer - retryBackoff wait.Backoff - implicitAuds authenticator.Audiences + tokenReview tokenReviewer + retryBackoff wait.Backoff + implicitAuds authenticator.Audiences + requestTimeout time.Duration } // NewFromInterface creates a webhook authenticator using the given tokenReview // client. It is recommend to wrap this authenticator with the token cache // authenticator implemented in // k8s.io/apiserver/pkg/authentication/token/cache. -func NewFromInterface(tokenReview authenticationv1client.TokenReviewInterface, implicitAuds authenticator.Audiences, retryBackoff wait.Backoff) (*WebhookTokenAuthenticator, error) { - return newWithBackoff(tokenReview, retryBackoff, implicitAuds) +func NewFromInterface(tokenReview authenticationv1client.TokenReviewInterface, implicitAuds authenticator.Audiences, retryBackoff wait.Backoff, requestTimeout time.Duration) (*WebhookTokenAuthenticator, error) { + return newWithBackoff(tokenReview, retryBackoff, implicitAuds, requestTimeout) } // New creates a new WebhookTokenAuthenticator from the provided kubeconfig @@ -74,12 +75,12 @@ func New(kubeConfigFile string, version string, implicitAuds authenticator.Audie if err != nil { return nil, err } - return newWithBackoff(tokenReview, retryBackoff, implicitAuds) + return newWithBackoff(tokenReview, retryBackoff, implicitAuds, time.Duration(0)) } // newWithBackoff allows tests to skip the sleep. -func newWithBackoff(tokenReview tokenReviewer, retryBackoff wait.Backoff, implicitAuds authenticator.Audiences) (*WebhookTokenAuthenticator, error) { - return &WebhookTokenAuthenticator{tokenReview, retryBackoff, implicitAuds}, nil +func newWithBackoff(tokenReview tokenReviewer, retryBackoff wait.Backoff, implicitAuds authenticator.Audiences, requestTimeout time.Duration) (*WebhookTokenAuthenticator, error) { + return &WebhookTokenAuthenticator{tokenReview, retryBackoff, implicitAuds, requestTimeout}, nil } // AuthenticateToken implements the authenticator.Token interface. @@ -105,7 +106,17 @@ func (w *WebhookTokenAuthenticator) AuthenticateToken(ctx context.Context, token var ( result *authenticationv1.TokenReview auds authenticator.Audiences + cancel context.CancelFunc ) + + // set a hard timeout if it was defined + // if the child has a shorter deadline then it will expire first, + // otherwise if the parent has a shorter deadline then the parent will expire and it will be propagate to the child + if w.requestTimeout > 0 { + ctx, cancel = context.WithTimeout(ctx, w.requestTimeout) + defer cancel() + } + // WithExponentialBackoff will return tokenreview create error (tokenReviewErr) if any. if err := webhook.WithExponentialBackoff(ctx, w.retryBackoff, func() error { var tokenReviewErr error diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go index ccaad034c5b8..f30894bd3d68 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationAppl return b } +// ExtractMutatingWebhookConfiguration extracts the applied configuration owned by fieldManager from +// mutatingWebhookConfiguration. If no managedFields are found in mutatingWebhookConfiguration for fieldManager, a +// MutatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// mutatingWebhookConfiguration must be a unmodified MutatingWebhookConfiguration API object that was retrieved from the Kubernetes API. +// ExtractMutatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractMutatingWebhookConfiguration(mutatingWebhookConfiguration *apiadmissionregistrationv1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) { + return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "") +} + +// ExtractMutatingWebhookConfigurationStatus is the same as ExtractMutatingWebhookConfiguration except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractMutatingWebhookConfigurationStatus(mutatingWebhookConfiguration *apiadmissionregistrationv1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) { + return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "status") +} + +func extractMutatingWebhookConfiguration(mutatingWebhookConfiguration *apiadmissionregistrationv1.MutatingWebhookConfiguration, fieldManager string, subresource string) (*MutatingWebhookConfigurationApplyConfiguration, error) { + b := &MutatingWebhookConfigurationApplyConfiguration{} + err := managedfields.ExtractInto(mutatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1.MutatingWebhookConfiguration"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(mutatingWebhookConfiguration.Name) + + b.WithKind("MutatingWebhookConfiguration") + b.WithAPIVersion("admissionregistration.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go index 1ea8f12ce0d7..7b781a879d71 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfiguration return b } +// ExtractValidatingWebhookConfiguration extracts the applied configuration owned by fieldManager from +// validatingWebhookConfiguration. If no managedFields are found in validatingWebhookConfiguration for fieldManager, a +// ValidatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// validatingWebhookConfiguration must be a unmodified ValidatingWebhookConfiguration API object that was retrieved from the Kubernetes API. +// ExtractValidatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractValidatingWebhookConfiguration(validatingWebhookConfiguration *apiadmissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { + return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "") +} + +// ExtractValidatingWebhookConfigurationStatus is the same as ExtractValidatingWebhookConfiguration except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractValidatingWebhookConfigurationStatus(validatingWebhookConfiguration *apiadmissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { + return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "status") +} + +func extractValidatingWebhookConfiguration(validatingWebhookConfiguration *apiadmissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string, subresource string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { + b := &ValidatingWebhookConfigurationApplyConfiguration{} + err := managedfields.ExtractInto(validatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingWebhookConfiguration"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(validatingWebhookConfiguration.Name) + + b.WithKind("ValidatingWebhookConfiguration") + b.WithAPIVersion("admissionregistration.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index b357852b2d07..00e11dea3f9f 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationAppl return b } +// ExtractMutatingWebhookConfiguration extracts the applied configuration owned by fieldManager from +// mutatingWebhookConfiguration. If no managedFields are found in mutatingWebhookConfiguration for fieldManager, a +// MutatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// mutatingWebhookConfiguration must be a unmodified MutatingWebhookConfiguration API object that was retrieved from the Kubernetes API. +// ExtractMutatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) { + return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "") +} + +// ExtractMutatingWebhookConfigurationStatus is the same as ExtractMutatingWebhookConfiguration except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractMutatingWebhookConfigurationStatus(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) { + return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "status") +} + +func extractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string, subresource string) (*MutatingWebhookConfigurationApplyConfiguration, error) { + b := &MutatingWebhookConfigurationApplyConfiguration{} + err := managedfields.ExtractInto(mutatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.MutatingWebhookConfiguration"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(mutatingWebhookConfiguration.Name) + + b.WithKind("MutatingWebhookConfiguration") + b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 46b2789b4fea..be3d68f5df9a 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfiguration return b } +// ExtractValidatingWebhookConfiguration extracts the applied configuration owned by fieldManager from +// validatingWebhookConfiguration. If no managedFields are found in validatingWebhookConfiguration for fieldManager, a +// ValidatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// validatingWebhookConfiguration must be a unmodified ValidatingWebhookConfiguration API object that was retrieved from the Kubernetes API. +// ExtractValidatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { + return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "") +} + +// ExtractValidatingWebhookConfigurationStatus is the same as ExtractValidatingWebhookConfiguration except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractValidatingWebhookConfigurationStatus(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { + return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "status") +} + +func extractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string, subresource string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { + b := &ValidatingWebhookConfigurationApplyConfiguration{} + err := managedfields.ExtractInto(validatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.ValidatingWebhookConfiguration"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(validatingWebhookConfiguration.Name) + + b.WithKind("ValidatingWebhookConfiguration") + b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go index cf1e32a835a0..d0eb73767d08 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go @@ -22,6 +22,8 @@ import ( v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +46,41 @@ func StorageVersion(name string) *StorageVersionApplyConfiguration { return b } +// ExtractStorageVersion extracts the applied configuration owned by fieldManager from +// storageVersion. If no managedFields are found in storageVersion for fieldManager, a +// StorageVersionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// storageVersion must be a unmodified StorageVersion API object that was retrieved from the Kubernetes API. +// ExtractStorageVersion provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractStorageVersion(storageVersion *v1alpha1.StorageVersion, fieldManager string) (*StorageVersionApplyConfiguration, error) { + return extractStorageVersion(storageVersion, fieldManager, "") +} + +// ExtractStorageVersionStatus is the same as ExtractStorageVersion except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractStorageVersionStatus(storageVersion *v1alpha1.StorageVersion, fieldManager string) (*StorageVersionApplyConfiguration, error) { + return extractStorageVersion(storageVersion, fieldManager, "status") +} + +func extractStorageVersion(storageVersion *v1alpha1.StorageVersion, fieldManager string, subresource string) (*StorageVersionApplyConfiguration, error) { + b := &StorageVersionApplyConfiguration{} + err := managedfields.ExtractInto(storageVersion, internal.Parser().Type("io.k8s.api.apiserverinternal.v1alpha1.StorageVersion"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(storageVersion.Name) + + b.WithKind("StorageVersion") + b.WithAPIVersion("internal.apiserver.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/controllerrevision.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/controllerrevision.go index 4b533dbdbbee..6924fb6ffb36 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/controllerrevision.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/controllerrevision.go @@ -19,9 +19,12 @@ limitations under the License. package v1 import ( + appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -45,6 +48,42 @@ func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfigur return b } +// ExtractControllerRevision extracts the applied configuration owned by fieldManager from +// controllerRevision. If no managedFields are found in controllerRevision for fieldManager, a +// ControllerRevisionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// controllerRevision must be a unmodified ControllerRevision API object that was retrieved from the Kubernetes API. +// ExtractControllerRevision provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractControllerRevision(controllerRevision *appsv1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { + return extractControllerRevision(controllerRevision, fieldManager, "") +} + +// ExtractControllerRevisionStatus is the same as ExtractControllerRevision except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractControllerRevisionStatus(controllerRevision *appsv1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { + return extractControllerRevision(controllerRevision, fieldManager, "status") +} + +func extractControllerRevision(controllerRevision *appsv1.ControllerRevision, fieldManager string, subresource string) (*ControllerRevisionApplyConfiguration, error) { + b := &ControllerRevisionApplyConfiguration{} + err := managedfields.ExtractInto(controllerRevision, internal.Parser().Type("io.k8s.api.apps.v1.ControllerRevision"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(controllerRevision.Name) + b.WithNamespace(controllerRevision.Namespace) + + b.WithKind("ControllerRevision") + b.WithAPIVersion("apps/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/daemonset.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/daemonset.go index 9ed87e2634a2..7d0253d6c4dc 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/daemonset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/daemonset.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apiappsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func DaemonSet(name, namespace string) *DaemonSetApplyConfiguration { return b } +// ExtractDaemonSet extracts the applied configuration owned by fieldManager from +// daemonSet. If no managedFields are found in daemonSet for fieldManager, a +// DaemonSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// daemonSet must be a unmodified DaemonSet API object that was retrieved from the Kubernetes API. +// ExtractDaemonSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDaemonSet(daemonSet *apiappsv1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { + return extractDaemonSet(daemonSet, fieldManager, "") +} + +// ExtractDaemonSetStatus is the same as ExtractDaemonSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDaemonSetStatus(daemonSet *apiappsv1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { + return extractDaemonSet(daemonSet, fieldManager, "status") +} + +func extractDaemonSet(daemonSet *apiappsv1.DaemonSet, fieldManager string, subresource string) (*DaemonSetApplyConfiguration, error) { + b := &DaemonSetApplyConfiguration{} + err := managedfields.ExtractInto(daemonSet, internal.Parser().Type("io.k8s.api.apps.v1.DaemonSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(daemonSet.Name) + b.WithNamespace(daemonSet.Namespace) + + b.WithKind("DaemonSet") + b.WithAPIVersion("apps/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deployment.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deployment.go index cb57053e0920..02e0bb4723ad 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deployment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deployment.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apiappsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Deployment(name, namespace string) *DeploymentApplyConfiguration { return b } +// ExtractDeployment extracts the applied configuration owned by fieldManager from +// deployment. If no managedFields are found in deployment for fieldManager, a +// DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API. +// ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDeployment(deployment *apiappsv1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { + return extractDeployment(deployment, fieldManager, "") +} + +// ExtractDeploymentStatus is the same as ExtractDeployment except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDeploymentStatus(deployment *apiappsv1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { + return extractDeployment(deployment, fieldManager, "status") +} + +func extractDeployment(deployment *apiappsv1.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) { + b := &DeploymentApplyConfiguration{} + err := managedfields.ExtractInto(deployment, internal.Parser().Type("io.k8s.api.apps.v1.Deployment"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(deployment.Name) + b.WithNamespace(deployment.Namespace) + + b.WithKind("Deployment") + b.WithAPIVersion("apps/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicaset.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicaset.go index 48696f3d0cdc..2eeb35cc75c2 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicaset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicaset.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apiappsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration { return b } +// ExtractReplicaSet extracts the applied configuration owned by fieldManager from +// replicaSet. If no managedFields are found in replicaSet for fieldManager, a +// ReplicaSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// replicaSet must be a unmodified ReplicaSet API object that was retrieved from the Kubernetes API. +// ExtractReplicaSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractReplicaSet(replicaSet *apiappsv1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { + return extractReplicaSet(replicaSet, fieldManager, "") +} + +// ExtractReplicaSetStatus is the same as ExtractReplicaSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractReplicaSetStatus(replicaSet *apiappsv1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { + return extractReplicaSet(replicaSet, fieldManager, "status") +} + +func extractReplicaSet(replicaSet *apiappsv1.ReplicaSet, fieldManager string, subresource string) (*ReplicaSetApplyConfiguration, error) { + b := &ReplicaSetApplyConfiguration{} + err := managedfields.ExtractInto(replicaSet, internal.Parser().Type("io.k8s.api.apps.v1.ReplicaSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(replicaSet.Name) + b.WithNamespace(replicaSet.Namespace) + + b.WithKind("ReplicaSet") + b.WithAPIVersion("apps/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulset.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulset.go index b455ec991f92..e925d87b963c 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulset.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apiappsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func StatefulSet(name, namespace string) *StatefulSetApplyConfiguration { return b } +// ExtractStatefulSet extracts the applied configuration owned by fieldManager from +// statefulSet. If no managedFields are found in statefulSet for fieldManager, a +// StatefulSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// statefulSet must be a unmodified StatefulSet API object that was retrieved from the Kubernetes API. +// ExtractStatefulSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractStatefulSet(statefulSet *apiappsv1.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { + return extractStatefulSet(statefulSet, fieldManager, "") +} + +// ExtractStatefulSetStatus is the same as ExtractStatefulSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractStatefulSetStatus(statefulSet *apiappsv1.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { + return extractStatefulSet(statefulSet, fieldManager, "status") +} + +func extractStatefulSet(statefulSet *apiappsv1.StatefulSet, fieldManager string, subresource string) (*StatefulSetApplyConfiguration, error) { + b := &StatefulSetApplyConfiguration{} + err := managedfields.ExtractInto(statefulSet, internal.Parser().Type("io.k8s.api.apps.v1.StatefulSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(statefulSet.Name) + b.WithNamespace(statefulSet.Namespace) + + b.WithKind("StatefulSet") + b.WithAPIVersion("apps/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/controllerrevision.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/controllerrevision.go index 11e66020f693..a9c672288d87 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/controllerrevision.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/controllerrevision.go @@ -19,9 +19,12 @@ limitations under the License. package v1beta1 import ( + v1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -45,6 +48,42 @@ func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfigur return b } +// ExtractControllerRevision extracts the applied configuration owned by fieldManager from +// controllerRevision. If no managedFields are found in controllerRevision for fieldManager, a +// ControllerRevisionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// controllerRevision must be a unmodified ControllerRevision API object that was retrieved from the Kubernetes API. +// ExtractControllerRevision provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractControllerRevision(controllerRevision *v1beta1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { + return extractControllerRevision(controllerRevision, fieldManager, "") +} + +// ExtractControllerRevisionStatus is the same as ExtractControllerRevision except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractControllerRevisionStatus(controllerRevision *v1beta1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { + return extractControllerRevision(controllerRevision, fieldManager, "status") +} + +func extractControllerRevision(controllerRevision *v1beta1.ControllerRevision, fieldManager string, subresource string) (*ControllerRevisionApplyConfiguration, error) { + b := &ControllerRevisionApplyConfiguration{} + err := managedfields.ExtractInto(controllerRevision, internal.Parser().Type("io.k8s.api.apps.v1beta1.ControllerRevision"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(controllerRevision.Name) + b.WithNamespace(controllerRevision.Namespace) + + b.WithKind("ControllerRevision") + b.WithAPIVersion("apps/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deployment.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deployment.go index 3416029e16f6..f41e454131e3 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deployment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deployment.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Deployment(name, namespace string) *DeploymentApplyConfiguration { return b } +// ExtractDeployment extracts the applied configuration owned by fieldManager from +// deployment. If no managedFields are found in deployment for fieldManager, a +// DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API. +// ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDeployment(deployment *appsv1beta1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { + return extractDeployment(deployment, fieldManager, "") +} + +// ExtractDeploymentStatus is the same as ExtractDeployment except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDeploymentStatus(deployment *appsv1beta1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { + return extractDeployment(deployment, fieldManager, "status") +} + +func extractDeployment(deployment *appsv1beta1.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) { + b := &DeploymentApplyConfiguration{} + err := managedfields.ExtractInto(deployment, internal.Parser().Type("io.k8s.api.apps.v1beta1.Deployment"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(deployment.Name) + b.WithNamespace(deployment.Namespace) + + b.WithKind("Deployment") + b.WithAPIVersion("apps/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulset.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulset.go index 82c8dde5dcf2..ca71e9817b1d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulset.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func StatefulSet(name, namespace string) *StatefulSetApplyConfiguration { return b } +// ExtractStatefulSet extracts the applied configuration owned by fieldManager from +// statefulSet. If no managedFields are found in statefulSet for fieldManager, a +// StatefulSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// statefulSet must be a unmodified StatefulSet API object that was retrieved from the Kubernetes API. +// ExtractStatefulSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractStatefulSet(statefulSet *appsv1beta1.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { + return extractStatefulSet(statefulSet, fieldManager, "") +} + +// ExtractStatefulSetStatus is the same as ExtractStatefulSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractStatefulSetStatus(statefulSet *appsv1beta1.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { + return extractStatefulSet(statefulSet, fieldManager, "status") +} + +func extractStatefulSet(statefulSet *appsv1beta1.StatefulSet, fieldManager string, subresource string) (*StatefulSetApplyConfiguration, error) { + b := &StatefulSetApplyConfiguration{} + err := managedfields.ExtractInto(statefulSet, internal.Parser().Type("io.k8s.api.apps.v1beta1.StatefulSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(statefulSet.Name) + b.WithNamespace(statefulSet.Namespace) + + b.WithKind("StatefulSet") + b.WithAPIVersion("apps/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/controllerrevision.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/controllerrevision.go index f5f55a5d3c72..d866b6cc8f95 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/controllerrevision.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/controllerrevision.go @@ -19,9 +19,12 @@ limitations under the License. package v1beta2 import ( + v1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -45,6 +48,42 @@ func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfigur return b } +// ExtractControllerRevision extracts the applied configuration owned by fieldManager from +// controllerRevision. If no managedFields are found in controllerRevision for fieldManager, a +// ControllerRevisionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// controllerRevision must be a unmodified ControllerRevision API object that was retrieved from the Kubernetes API. +// ExtractControllerRevision provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractControllerRevision(controllerRevision *v1beta2.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { + return extractControllerRevision(controllerRevision, fieldManager, "") +} + +// ExtractControllerRevisionStatus is the same as ExtractControllerRevision except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractControllerRevisionStatus(controllerRevision *v1beta2.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { + return extractControllerRevision(controllerRevision, fieldManager, "status") +} + +func extractControllerRevision(controllerRevision *v1beta2.ControllerRevision, fieldManager string, subresource string) (*ControllerRevisionApplyConfiguration, error) { + b := &ControllerRevisionApplyConfiguration{} + err := managedfields.ExtractInto(controllerRevision, internal.Parser().Type("io.k8s.api.apps.v1beta2.ControllerRevision"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(controllerRevision.Name) + b.WithNamespace(controllerRevision.Namespace) + + b.WithKind("ControllerRevision") + b.WithAPIVersion("apps/v1beta2") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/daemonset.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/daemonset.go index d2e2c77f0c18..b7068f82ca4e 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/daemonset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/daemonset.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta2 import ( + appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func DaemonSet(name, namespace string) *DaemonSetApplyConfiguration { return b } +// ExtractDaemonSet extracts the applied configuration owned by fieldManager from +// daemonSet. If no managedFields are found in daemonSet for fieldManager, a +// DaemonSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// daemonSet must be a unmodified DaemonSet API object that was retrieved from the Kubernetes API. +// ExtractDaemonSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDaemonSet(daemonSet *appsv1beta2.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { + return extractDaemonSet(daemonSet, fieldManager, "") +} + +// ExtractDaemonSetStatus is the same as ExtractDaemonSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDaemonSetStatus(daemonSet *appsv1beta2.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { + return extractDaemonSet(daemonSet, fieldManager, "status") +} + +func extractDaemonSet(daemonSet *appsv1beta2.DaemonSet, fieldManager string, subresource string) (*DaemonSetApplyConfiguration, error) { + b := &DaemonSetApplyConfiguration{} + err := managedfields.ExtractInto(daemonSet, internal.Parser().Type("io.k8s.api.apps.v1beta2.DaemonSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(daemonSet.Name) + b.WithNamespace(daemonSet.Namespace) + + b.WithKind("DaemonSet") + b.WithAPIVersion("apps/v1beta2") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deployment.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deployment.go index af0bc077d3f3..e315b9888e59 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deployment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deployment.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta2 import ( + appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Deployment(name, namespace string) *DeploymentApplyConfiguration { return b } +// ExtractDeployment extracts the applied configuration owned by fieldManager from +// deployment. If no managedFields are found in deployment for fieldManager, a +// DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API. +// ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDeployment(deployment *appsv1beta2.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { + return extractDeployment(deployment, fieldManager, "") +} + +// ExtractDeploymentStatus is the same as ExtractDeployment except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDeploymentStatus(deployment *appsv1beta2.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { + return extractDeployment(deployment, fieldManager, "status") +} + +func extractDeployment(deployment *appsv1beta2.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) { + b := &DeploymentApplyConfiguration{} + err := managedfields.ExtractInto(deployment, internal.Parser().Type("io.k8s.api.apps.v1beta2.Deployment"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(deployment.Name) + b.WithNamespace(deployment.Namespace) + + b.WithKind("Deployment") + b.WithAPIVersion("apps/v1beta2") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicaset.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicaset.go index b02e9e0eaf6a..3329d53c3227 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicaset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicaset.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta2 import ( + appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration { return b } +// ExtractReplicaSet extracts the applied configuration owned by fieldManager from +// replicaSet. If no managedFields are found in replicaSet for fieldManager, a +// ReplicaSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// replicaSet must be a unmodified ReplicaSet API object that was retrieved from the Kubernetes API. +// ExtractReplicaSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractReplicaSet(replicaSet *appsv1beta2.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { + return extractReplicaSet(replicaSet, fieldManager, "") +} + +// ExtractReplicaSetStatus is the same as ExtractReplicaSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractReplicaSetStatus(replicaSet *appsv1beta2.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { + return extractReplicaSet(replicaSet, fieldManager, "status") +} + +func extractReplicaSet(replicaSet *appsv1beta2.ReplicaSet, fieldManager string, subresource string) (*ReplicaSetApplyConfiguration, error) { + b := &ReplicaSetApplyConfiguration{} + err := managedfields.ExtractInto(replicaSet, internal.Parser().Type("io.k8s.api.apps.v1beta2.ReplicaSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(replicaSet.Name) + b.WithNamespace(replicaSet.Namespace) + + b.WithKind("ReplicaSet") + b.WithAPIVersion("apps/v1beta2") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/scale.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/scale.go new file mode 100644 index 000000000000..d4901edf9beb --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/scale.go @@ -0,0 +1,233 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1beta2 "k8s.io/api/apps/v1beta2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ScaleApplyConfiguration represents an declarative configuration of the Scale type for use +// with apply. +type ScaleApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *v1beta2.ScaleSpec `json:"spec,omitempty"` + Status *v1beta2.ScaleStatus `json:"status,omitempty"` +} + +// ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with +// apply. +func Scale() *ScaleApplyConfiguration { + return &ScaleApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithSelfLink sets the SelfLink field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SelfLink field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithSelfLink(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.SelfLink = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithClusterName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ClusterName = &value + return b +} + +func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithSpec(value v1beta2.ScaleSpec) *ScaleApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithStatus(value v1beta2.ScaleStatus) *ScaleApplyConfiguration { + b.Status = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulset.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulset.go index c480ba23c67c..dc9750bc3649 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulset.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta2 import ( + appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func StatefulSet(name, namespace string) *StatefulSetApplyConfiguration { return b } +// ExtractStatefulSet extracts the applied configuration owned by fieldManager from +// statefulSet. If no managedFields are found in statefulSet for fieldManager, a +// StatefulSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// statefulSet must be a unmodified StatefulSet API object that was retrieved from the Kubernetes API. +// ExtractStatefulSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractStatefulSet(statefulSet *appsv1beta2.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { + return extractStatefulSet(statefulSet, fieldManager, "") +} + +// ExtractStatefulSetStatus is the same as ExtractStatefulSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractStatefulSetStatus(statefulSet *appsv1beta2.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { + return extractStatefulSet(statefulSet, fieldManager, "status") +} + +func extractStatefulSet(statefulSet *appsv1beta2.StatefulSet, fieldManager string, subresource string) (*StatefulSetApplyConfiguration, error) { + b := &StatefulSetApplyConfiguration{} + err := managedfields.ExtractInto(statefulSet, internal.Parser().Type("io.k8s.api.apps.v1beta2.StatefulSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(statefulSet.Name) + b.WithNamespace(statefulSet.Namespace) + + b.WithKind("StatefulSet") + b.WithAPIVersion("apps/v1beta2") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go index 5d625303ea26..dfbad332d1bf 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apiautoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApp return b } +// ExtractHorizontalPodAutoscaler extracts the applied configuration owned by fieldManager from +// horizontalPodAutoscaler. If no managedFields are found in horizontalPodAutoscaler for fieldManager, a +// HorizontalPodAutoscalerApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// horizontalPodAutoscaler must be a unmodified HorizontalPodAutoscaler API object that was retrieved from the Kubernetes API. +// ExtractHorizontalPodAutoscaler provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractHorizontalPodAutoscaler(horizontalPodAutoscaler *apiautoscalingv1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "") +} + +// ExtractHorizontalPodAutoscalerStatus is the same as ExtractHorizontalPodAutoscaler except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractHorizontalPodAutoscalerStatus(horizontalPodAutoscaler *apiautoscalingv1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "status") +} + +func extractHorizontalPodAutoscaler(horizontalPodAutoscaler *apiautoscalingv1.HorizontalPodAutoscaler, fieldManager string, subresource string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + b := &HorizontalPodAutoscalerApplyConfiguration{} + err := managedfields.ExtractInto(horizontalPodAutoscaler, internal.Parser().Type("io.k8s.api.autoscaling.v1.HorizontalPodAutoscaler"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(horizontalPodAutoscaler.Name) + b.WithNamespace(horizontalPodAutoscaler.Namespace) + + b.WithKind("HorizontalPodAutoscaler") + b.WithAPIVersion("autoscaling/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scale.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scale.go new file mode 100644 index 000000000000..2d2cfeb972fc --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scale.go @@ -0,0 +1,232 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ScaleApplyConfiguration represents an declarative configuration of the Scale type for use +// with apply. +type ScaleApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ScaleSpecApplyConfiguration `json:"spec,omitempty"` + Status *ScaleStatusApplyConfiguration `json:"status,omitempty"` +} + +// ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with +// apply. +func Scale() *ScaleApplyConfiguration { + return &ScaleApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithSelfLink sets the SelfLink field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SelfLink field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithSelfLink(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.SelfLink = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithClusterName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ClusterName = &value + return b +} + +func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithSpec(value *ScaleSpecApplyConfiguration) *ScaleApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithStatus(value *ScaleStatusApplyConfiguration) *ScaleApplyConfiguration { + b.Status = value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scalespec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scalespec.go new file mode 100644 index 000000000000..2339a8fef2f6 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scalespec.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ScaleSpecApplyConfiguration represents an declarative configuration of the ScaleSpec type for use +// with apply. +type ScaleSpecApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` +} + +// ScaleSpecApplyConfiguration constructs an declarative configuration of the ScaleSpec type for use with +// apply. +func ScaleSpec() *ScaleSpecApplyConfiguration { + return &ScaleSpecApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ScaleSpecApplyConfiguration) WithReplicas(value int32) *ScaleSpecApplyConfiguration { + b.Replicas = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scalestatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scalestatus.go new file mode 100644 index 000000000000..81c8d1b30a10 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scalestatus.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ScaleStatusApplyConfiguration represents an declarative configuration of the ScaleStatus type for use +// with apply. +type ScaleStatusApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + Selector *string `json:"selector,omitempty"` +} + +// ScaleStatusApplyConfiguration constructs an declarative configuration of the ScaleStatus type for use with +// apply. +func ScaleStatus() *ScaleStatusApplyConfiguration { + return &ScaleStatusApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ScaleStatusApplyConfiguration) WithReplicas(value int32) *ScaleStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *ScaleStatusApplyConfiguration) WithSelector(value string) *ScaleStatusApplyConfiguration { + b.Selector = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go index 039baef771c7..0d673dc1d4b5 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -19,8 +19,11 @@ limitations under the License. package v2beta1 import ( + autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApp return b } +// ExtractHorizontalPodAutoscaler extracts the applied configuration owned by fieldManager from +// horizontalPodAutoscaler. If no managedFields are found in horizontalPodAutoscaler for fieldManager, a +// HorizontalPodAutoscalerApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// horizontalPodAutoscaler must be a unmodified HorizontalPodAutoscaler API object that was retrieved from the Kubernetes API. +// ExtractHorizontalPodAutoscaler provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "") +} + +// ExtractHorizontalPodAutoscalerStatus is the same as ExtractHorizontalPodAutoscaler except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractHorizontalPodAutoscalerStatus(horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "status") +} + +func extractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscaler, fieldManager string, subresource string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + b := &HorizontalPodAutoscalerApplyConfiguration{} + err := managedfields.ExtractInto(horizontalPodAutoscaler, internal.Parser().Type("io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscaler"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(horizontalPodAutoscaler.Name) + b.WithNamespace(horizontalPodAutoscaler.Namespace) + + b.WithKind("HorizontalPodAutoscaler") + b.WithAPIVersion("autoscaling/v2beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go index be0aba120ac3..4f469692a5e4 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -19,8 +19,11 @@ limitations under the License. package v2beta2 import ( + autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApp return b } +// ExtractHorizontalPodAutoscaler extracts the applied configuration owned by fieldManager from +// horizontalPodAutoscaler. If no managedFields are found in horizontalPodAutoscaler for fieldManager, a +// HorizontalPodAutoscalerApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// horizontalPodAutoscaler must be a unmodified HorizontalPodAutoscaler API object that was retrieved from the Kubernetes API. +// ExtractHorizontalPodAutoscaler provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "") +} + +// ExtractHorizontalPodAutoscalerStatus is the same as ExtractHorizontalPodAutoscaler except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractHorizontalPodAutoscalerStatus(horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "status") +} + +func extractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, fieldManager string, subresource string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + b := &HorizontalPodAutoscalerApplyConfiguration{} + err := managedfields.ExtractInto(horizontalPodAutoscaler, internal.Parser().Type("io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(horizontalPodAutoscaler.Name) + b.WithNamespace(horizontalPodAutoscaler.Namespace) + + b.WithKind("HorizontalPodAutoscaler") + b.WithAPIVersion("autoscaling/v2beta2") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1/cronjob.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1/cronjob.go index 6457c43d4c27..95e62677a6a1 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1/cronjob.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1/cronjob.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apibatchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func CronJob(name, namespace string) *CronJobApplyConfiguration { return b } +// ExtractCronJob extracts the applied configuration owned by fieldManager from +// cronJob. If no managedFields are found in cronJob for fieldManager, a +// CronJobApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// cronJob must be a unmodified CronJob API object that was retrieved from the Kubernetes API. +// ExtractCronJob provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCronJob(cronJob *apibatchv1.CronJob, fieldManager string) (*CronJobApplyConfiguration, error) { + return extractCronJob(cronJob, fieldManager, "") +} + +// ExtractCronJobStatus is the same as ExtractCronJob except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCronJobStatus(cronJob *apibatchv1.CronJob, fieldManager string) (*CronJobApplyConfiguration, error) { + return extractCronJob(cronJob, fieldManager, "status") +} + +func extractCronJob(cronJob *apibatchv1.CronJob, fieldManager string, subresource string) (*CronJobApplyConfiguration, error) { + b := &CronJobApplyConfiguration{} + err := managedfields.ExtractInto(cronJob, internal.Parser().Type("io.k8s.api.batch.v1.CronJob"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(cronJob.Name) + b.WithNamespace(cronJob.Namespace) + + b.WithKind("CronJob") + b.WithAPIVersion("batch/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1/job.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1/job.go index 0632743b2fbc..1376f33c4b55 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1/job.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1/job.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apibatchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Job(name, namespace string) *JobApplyConfiguration { return b } +// ExtractJob extracts the applied configuration owned by fieldManager from +// job. If no managedFields are found in job for fieldManager, a +// JobApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// job must be a unmodified Job API object that was retrieved from the Kubernetes API. +// ExtractJob provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractJob(job *apibatchv1.Job, fieldManager string) (*JobApplyConfiguration, error) { + return extractJob(job, fieldManager, "") +} + +// ExtractJobStatus is the same as ExtractJob except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractJobStatus(job *apibatchv1.Job, fieldManager string) (*JobApplyConfiguration, error) { + return extractJob(job, fieldManager, "status") +} + +func extractJob(job *apibatchv1.Job, fieldManager string, subresource string) (*JobApplyConfiguration, error) { + b := &JobApplyConfiguration{} + err := managedfields.ExtractInto(job, internal.Parser().Type("io.k8s.api.batch.v1.Job"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(job.Name) + b.WithNamespace(job.Namespace) + + b.WithKind("Job") + b.WithAPIVersion("batch/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1beta1/cronjob.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1beta1/cronjob.go index 7aad597ec129..b13ac901ea62 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1beta1/cronjob.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/batch/v1beta1/cronjob.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + batchv1beta1 "k8s.io/api/batch/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func CronJob(name, namespace string) *CronJobApplyConfiguration { return b } +// ExtractCronJob extracts the applied configuration owned by fieldManager from +// cronJob. If no managedFields are found in cronJob for fieldManager, a +// CronJobApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// cronJob must be a unmodified CronJob API object that was retrieved from the Kubernetes API. +// ExtractCronJob provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCronJob(cronJob *batchv1beta1.CronJob, fieldManager string) (*CronJobApplyConfiguration, error) { + return extractCronJob(cronJob, fieldManager, "") +} + +// ExtractCronJobStatus is the same as ExtractCronJob except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCronJobStatus(cronJob *batchv1beta1.CronJob, fieldManager string) (*CronJobApplyConfiguration, error) { + return extractCronJob(cronJob, fieldManager, "status") +} + +func extractCronJob(cronJob *batchv1beta1.CronJob, fieldManager string, subresource string) (*CronJobApplyConfiguration, error) { + b := &CronJobApplyConfiguration{} + err := managedfields.ExtractInto(cronJob, internal.Parser().Type("io.k8s.api.batch.v1beta1.CronJob"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(cronJob.Name) + b.WithNamespace(cronJob.Namespace) + + b.WithKind("CronJob") + b.WithAPIVersion("batch/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/certificatesigningrequest.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/certificatesigningrequest.go index 075acf3e1fdb..e3e21ac6862a 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/certificatesigningrequest.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/certificatesigningrequest.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicertificatesv1 "k8s.io/api/certificates/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func CertificateSigningRequest(name string) *CertificateSigningRequestApplyConfi return b } +// ExtractCertificateSigningRequest extracts the applied configuration owned by fieldManager from +// certificateSigningRequest. If no managedFields are found in certificateSigningRequest for fieldManager, a +// CertificateSigningRequestApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// certificateSigningRequest must be a unmodified CertificateSigningRequest API object that was retrieved from the Kubernetes API. +// ExtractCertificateSigningRequest provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCertificateSigningRequest(certificateSigningRequest *apicertificatesv1.CertificateSigningRequest, fieldManager string) (*CertificateSigningRequestApplyConfiguration, error) { + return extractCertificateSigningRequest(certificateSigningRequest, fieldManager, "") +} + +// ExtractCertificateSigningRequestStatus is the same as ExtractCertificateSigningRequest except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCertificateSigningRequestStatus(certificateSigningRequest *apicertificatesv1.CertificateSigningRequest, fieldManager string) (*CertificateSigningRequestApplyConfiguration, error) { + return extractCertificateSigningRequest(certificateSigningRequest, fieldManager, "status") +} + +func extractCertificateSigningRequest(certificateSigningRequest *apicertificatesv1.CertificateSigningRequest, fieldManager string, subresource string) (*CertificateSigningRequestApplyConfiguration, error) { + b := &CertificateSigningRequestApplyConfiguration{} + err := managedfields.ExtractInto(certificateSigningRequest, internal.Parser().Type("io.k8s.api.certificates.v1.CertificateSigningRequest"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(certificateSigningRequest.Name) + + b.WithKind("CertificateSigningRequest") + b.WithAPIVersion("certificates.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go index 064525eef6f3..8a88f06364ef 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + certificatesv1beta1 "k8s.io/api/certificates/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func CertificateSigningRequest(name string) *CertificateSigningRequestApplyConfi return b } +// ExtractCertificateSigningRequest extracts the applied configuration owned by fieldManager from +// certificateSigningRequest. If no managedFields are found in certificateSigningRequest for fieldManager, a +// CertificateSigningRequestApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// certificateSigningRequest must be a unmodified CertificateSigningRequest API object that was retrieved from the Kubernetes API. +// ExtractCertificateSigningRequest provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCertificateSigningRequest(certificateSigningRequest *certificatesv1beta1.CertificateSigningRequest, fieldManager string) (*CertificateSigningRequestApplyConfiguration, error) { + return extractCertificateSigningRequest(certificateSigningRequest, fieldManager, "") +} + +// ExtractCertificateSigningRequestStatus is the same as ExtractCertificateSigningRequest except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCertificateSigningRequestStatus(certificateSigningRequest *certificatesv1beta1.CertificateSigningRequest, fieldManager string) (*CertificateSigningRequestApplyConfiguration, error) { + return extractCertificateSigningRequest(certificateSigningRequest, fieldManager, "status") +} + +func extractCertificateSigningRequest(certificateSigningRequest *certificatesv1beta1.CertificateSigningRequest, fieldManager string, subresource string) (*CertificateSigningRequestApplyConfiguration, error) { + b := &CertificateSigningRequestApplyConfiguration{} + err := managedfields.ExtractInto(certificateSigningRequest, internal.Parser().Type("io.k8s.api.certificates.v1beta1.CertificateSigningRequest"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(certificateSigningRequest.Name) + + b.WithKind("CertificateSigningRequest") + b.WithAPIVersion("certificates.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/lease.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/lease.go index 30682d89ad7b..63b3a491b18a 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/lease.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/lease.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicoordinationv1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func Lease(name, namespace string) *LeaseApplyConfiguration { return b } +// ExtractLease extracts the applied configuration owned by fieldManager from +// lease. If no managedFields are found in lease for fieldManager, a +// LeaseApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// lease must be a unmodified Lease API object that was retrieved from the Kubernetes API. +// ExtractLease provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractLease(lease *apicoordinationv1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { + return extractLease(lease, fieldManager, "") +} + +// ExtractLeaseStatus is the same as ExtractLease except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractLeaseStatus(lease *apicoordinationv1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { + return extractLease(lease, fieldManager, "status") +} + +func extractLease(lease *apicoordinationv1.Lease, fieldManager string, subresource string) (*LeaseApplyConfiguration, error) { + b := &LeaseApplyConfiguration{} + err := managedfields.ExtractInto(lease, internal.Parser().Type("io.k8s.api.coordination.v1.Lease"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(lease.Name) + b.WithNamespace(lease.Namespace) + + b.WithKind("Lease") + b.WithAPIVersion("coordination.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/lease.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/lease.go index fc5e833b31d8..345ef28b60bf 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/lease.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/lease.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + coordinationv1beta1 "k8s.io/api/coordination/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func Lease(name, namespace string) *LeaseApplyConfiguration { return b } +// ExtractLease extracts the applied configuration owned by fieldManager from +// lease. If no managedFields are found in lease for fieldManager, a +// LeaseApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// lease must be a unmodified Lease API object that was retrieved from the Kubernetes API. +// ExtractLease provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractLease(lease *coordinationv1beta1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { + return extractLease(lease, fieldManager, "") +} + +// ExtractLeaseStatus is the same as ExtractLease except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractLeaseStatus(lease *coordinationv1beta1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { + return extractLease(lease, fieldManager, "status") +} + +func extractLease(lease *coordinationv1beta1.Lease, fieldManager string, subresource string) (*LeaseApplyConfiguration, error) { + b := &LeaseApplyConfiguration{} + err := managedfields.ExtractInto(lease, internal.Parser().Type("io.k8s.api.coordination.v1beta1.Lease"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(lease.Name) + b.WithNamespace(lease.Namespace) + + b.WithKind("Lease") + b.WithAPIVersion("coordination.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/componentstatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/componentstatus.go index b9e441c9f694..a0be653874bf 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/componentstatus.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/componentstatus.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func ComponentStatus(name string) *ComponentStatusApplyConfiguration { return b } +// ExtractComponentStatus extracts the applied configuration owned by fieldManager from +// componentStatus. If no managedFields are found in componentStatus for fieldManager, a +// ComponentStatusApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// componentStatus must be a unmodified ComponentStatus API object that was retrieved from the Kubernetes API. +// ExtractComponentStatus provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractComponentStatus(componentStatus *apicorev1.ComponentStatus, fieldManager string) (*ComponentStatusApplyConfiguration, error) { + return extractComponentStatus(componentStatus, fieldManager, "") +} + +// ExtractComponentStatusStatus is the same as ExtractComponentStatus except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractComponentStatusStatus(componentStatus *apicorev1.ComponentStatus, fieldManager string) (*ComponentStatusApplyConfiguration, error) { + return extractComponentStatus(componentStatus, fieldManager, "status") +} + +func extractComponentStatus(componentStatus *apicorev1.ComponentStatus, fieldManager string, subresource string) (*ComponentStatusApplyConfiguration, error) { + b := &ComponentStatusApplyConfiguration{} + err := managedfields.ExtractInto(componentStatus, internal.Parser().Type("io.k8s.api.core.v1.ComponentStatus"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(componentStatus.Name) + + b.WithKind("ComponentStatus") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmap.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmap.go index eceba85072de..4673e7184f1b 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmap.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmap.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -45,6 +48,42 @@ func ConfigMap(name, namespace string) *ConfigMapApplyConfiguration { return b } +// ExtractConfigMap extracts the applied configuration owned by fieldManager from +// configMap. If no managedFields are found in configMap for fieldManager, a +// ConfigMapApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// configMap must be a unmodified ConfigMap API object that was retrieved from the Kubernetes API. +// ExtractConfigMap provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConfigMap(configMap *corev1.ConfigMap, fieldManager string) (*ConfigMapApplyConfiguration, error) { + return extractConfigMap(configMap, fieldManager, "") +} + +// ExtractConfigMapStatus is the same as ExtractConfigMap except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConfigMapStatus(configMap *corev1.ConfigMap, fieldManager string) (*ConfigMapApplyConfiguration, error) { + return extractConfigMap(configMap, fieldManager, "status") +} + +func extractConfigMap(configMap *corev1.ConfigMap, fieldManager string, subresource string) (*ConfigMapApplyConfiguration, error) { + b := &ConfigMapApplyConfiguration{} + err := managedfields.ExtractInto(configMap, internal.Parser().Type("io.k8s.api.core.v1.ConfigMap"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(configMap.Name) + b.WithNamespace(configMap.Namespace) + + b.WithKind("ConfigMap") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/endpoints.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/endpoints.go index c69a79d0d90e..0e769f90e0ad 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/endpoints.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/endpoints.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func Endpoints(name, namespace string) *EndpointsApplyConfiguration { return b } +// ExtractEndpoints extracts the applied configuration owned by fieldManager from +// endpoints. If no managedFields are found in endpoints for fieldManager, a +// EndpointsApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// endpoints must be a unmodified Endpoints API object that was retrieved from the Kubernetes API. +// ExtractEndpoints provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEndpoints(endpoints *apicorev1.Endpoints, fieldManager string) (*EndpointsApplyConfiguration, error) { + return extractEndpoints(endpoints, fieldManager, "") +} + +// ExtractEndpointsStatus is the same as ExtractEndpoints except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEndpointsStatus(endpoints *apicorev1.Endpoints, fieldManager string) (*EndpointsApplyConfiguration, error) { + return extractEndpoints(endpoints, fieldManager, "status") +} + +func extractEndpoints(endpoints *apicorev1.Endpoints, fieldManager string, subresource string) (*EndpointsApplyConfiguration, error) { + b := &EndpointsApplyConfiguration{} + err := managedfields.ExtractInto(endpoints, internal.Parser().Type("io.k8s.api.core.v1.Endpoints"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(endpoints.Name) + b.WithNamespace(endpoints.Namespace) + + b.WithKind("Endpoints") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/ephemeralvolumesource.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/ephemeralvolumesource.go index 90d86ed165f3..31859404ccff 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/ephemeralvolumesource.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/ephemeralvolumesource.go @@ -22,7 +22,6 @@ package v1 // with apply. type EphemeralVolumeSourceApplyConfiguration struct { VolumeClaimTemplate *PersistentVolumeClaimTemplateApplyConfiguration `json:"volumeClaimTemplate,omitempty"` - ReadOnly *bool `json:"readOnly,omitempty"` } // EphemeralVolumeSourceApplyConfiguration constructs an declarative configuration of the EphemeralVolumeSource type for use with @@ -38,11 +37,3 @@ func (b *EphemeralVolumeSourceApplyConfiguration) WithVolumeClaimTemplate(value b.VolumeClaimTemplate = value return b } - -// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ReadOnly field is set to the value of the last call. -func (b *EphemeralVolumeSourceApplyConfiguration) WithReadOnly(value bool) *EphemeralVolumeSourceApplyConfiguration { - b.ReadOnly = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/event.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/event.go index 81594d0a5099..9b9474c0a95b 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/event.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/event.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -56,6 +59,42 @@ func Event(name, namespace string) *EventApplyConfiguration { return b } +// ExtractEvent extracts the applied configuration owned by fieldManager from +// event. If no managedFields are found in event for fieldManager, a +// EventApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// event must be a unmodified Event API object that was retrieved from the Kubernetes API. +// ExtractEvent provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEvent(event *apicorev1.Event, fieldManager string) (*EventApplyConfiguration, error) { + return extractEvent(event, fieldManager, "") +} + +// ExtractEventStatus is the same as ExtractEvent except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEventStatus(event *apicorev1.Event, fieldManager string) (*EventApplyConfiguration, error) { + return extractEvent(event, fieldManager, "status") +} + +func extractEvent(event *apicorev1.Event, fieldManager string, subresource string) (*EventApplyConfiguration, error) { + b := &EventApplyConfiguration{} + err := managedfields.ExtractInto(event, internal.Parser().Type("io.k8s.api.core.v1.Event"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(event.Name) + b.WithNamespace(event.Namespace) + + b.WithKind("Event") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/limitrange.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/limitrange.go index 2463c74b82f0..360c82105905 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/limitrange.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/limitrange.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func LimitRange(name, namespace string) *LimitRangeApplyConfiguration { return b } +// ExtractLimitRange extracts the applied configuration owned by fieldManager from +// limitRange. If no managedFields are found in limitRange for fieldManager, a +// LimitRangeApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// limitRange must be a unmodified LimitRange API object that was retrieved from the Kubernetes API. +// ExtractLimitRange provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractLimitRange(limitRange *apicorev1.LimitRange, fieldManager string) (*LimitRangeApplyConfiguration, error) { + return extractLimitRange(limitRange, fieldManager, "") +} + +// ExtractLimitRangeStatus is the same as ExtractLimitRange except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractLimitRangeStatus(limitRange *apicorev1.LimitRange, fieldManager string) (*LimitRangeApplyConfiguration, error) { + return extractLimitRange(limitRange, fieldManager, "status") +} + +func extractLimitRange(limitRange *apicorev1.LimitRange, fieldManager string, subresource string) (*LimitRangeApplyConfiguration, error) { + b := &LimitRangeApplyConfiguration{} + err := managedfields.ExtractInto(limitRange, internal.Parser().Type("io.k8s.api.core.v1.LimitRange"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(limitRange.Name) + b.WithNamespace(limitRange.Namespace) + + b.WithKind("LimitRange") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/namespace.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/namespace.go index 313d328d43f5..7d05b0ca69ba 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/namespace.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/namespace.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func Namespace(name string) *NamespaceApplyConfiguration { return b } +// ExtractNamespace extracts the applied configuration owned by fieldManager from +// namespace. If no managedFields are found in namespace for fieldManager, a +// NamespaceApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// namespace must be a unmodified Namespace API object that was retrieved from the Kubernetes API. +// ExtractNamespace provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractNamespace(namespace *apicorev1.Namespace, fieldManager string) (*NamespaceApplyConfiguration, error) { + return extractNamespace(namespace, fieldManager, "") +} + +// ExtractNamespaceStatus is the same as ExtractNamespace except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractNamespaceStatus(namespace *apicorev1.Namespace, fieldManager string) (*NamespaceApplyConfiguration, error) { + return extractNamespace(namespace, fieldManager, "status") +} + +func extractNamespace(namespace *apicorev1.Namespace, fieldManager string, subresource string) (*NamespaceApplyConfiguration, error) { + b := &NamespaceApplyConfiguration{} + err := managedfields.ExtractInto(namespace, internal.Parser().Type("io.k8s.api.core.v1.Namespace"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(namespace.Name) + + b.WithKind("Namespace") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/node.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/node.go index 3cdc2f9e9eee..57318f235382 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/node.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/node.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func Node(name string) *NodeApplyConfiguration { return b } +// ExtractNode extracts the applied configuration owned by fieldManager from +// node. If no managedFields are found in node for fieldManager, a +// NodeApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// node must be a unmodified Node API object that was retrieved from the Kubernetes API. +// ExtractNode provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractNode(node *apicorev1.Node, fieldManager string) (*NodeApplyConfiguration, error) { + return extractNode(node, fieldManager, "") +} + +// ExtractNodeStatus is the same as ExtractNode except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractNodeStatus(node *apicorev1.Node, fieldManager string) (*NodeApplyConfiguration, error) { + return extractNode(node, fieldManager, "status") +} + +func extractNode(node *apicorev1.Node, fieldManager string, subresource string) (*NodeApplyConfiguration, error) { + b := &NodeApplyConfiguration{} + err := managedfields.ExtractInto(node, internal.Parser().Type("io.k8s.api.core.v1.Node"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(node.Name) + + b.WithKind("Node") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolume.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolume.go index dc511d19bdc9..f77922db67a7 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolume.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolume.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func PersistentVolume(name string) *PersistentVolumeApplyConfiguration { return b } +// ExtractPersistentVolume extracts the applied configuration owned by fieldManager from +// persistentVolume. If no managedFields are found in persistentVolume for fieldManager, a +// PersistentVolumeApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// persistentVolume must be a unmodified PersistentVolume API object that was retrieved from the Kubernetes API. +// ExtractPersistentVolume provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPersistentVolume(persistentVolume *apicorev1.PersistentVolume, fieldManager string) (*PersistentVolumeApplyConfiguration, error) { + return extractPersistentVolume(persistentVolume, fieldManager, "") +} + +// ExtractPersistentVolumeStatus is the same as ExtractPersistentVolume except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPersistentVolumeStatus(persistentVolume *apicorev1.PersistentVolume, fieldManager string) (*PersistentVolumeApplyConfiguration, error) { + return extractPersistentVolume(persistentVolume, fieldManager, "status") +} + +func extractPersistentVolume(persistentVolume *apicorev1.PersistentVolume, fieldManager string, subresource string) (*PersistentVolumeApplyConfiguration, error) { + b := &PersistentVolumeApplyConfiguration{} + err := managedfields.ExtractInto(persistentVolume, internal.Parser().Type("io.k8s.api.core.v1.PersistentVolume"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(persistentVolume.Name) + + b.WithKind("PersistentVolume") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaim.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaim.go index b45145c3550b..891d7d498b13 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaim.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaim.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func PersistentVolumeClaim(name, namespace string) *PersistentVolumeClaimApplyCo return b } +// ExtractPersistentVolumeClaim extracts the applied configuration owned by fieldManager from +// persistentVolumeClaim. If no managedFields are found in persistentVolumeClaim for fieldManager, a +// PersistentVolumeClaimApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// persistentVolumeClaim must be a unmodified PersistentVolumeClaim API object that was retrieved from the Kubernetes API. +// ExtractPersistentVolumeClaim provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPersistentVolumeClaim(persistentVolumeClaim *apicorev1.PersistentVolumeClaim, fieldManager string) (*PersistentVolumeClaimApplyConfiguration, error) { + return extractPersistentVolumeClaim(persistentVolumeClaim, fieldManager, "") +} + +// ExtractPersistentVolumeClaimStatus is the same as ExtractPersistentVolumeClaim except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPersistentVolumeClaimStatus(persistentVolumeClaim *apicorev1.PersistentVolumeClaim, fieldManager string) (*PersistentVolumeClaimApplyConfiguration, error) { + return extractPersistentVolumeClaim(persistentVolumeClaim, fieldManager, "status") +} + +func extractPersistentVolumeClaim(persistentVolumeClaim *apicorev1.PersistentVolumeClaim, fieldManager string, subresource string) (*PersistentVolumeClaimApplyConfiguration, error) { + b := &PersistentVolumeClaimApplyConfiguration{} + err := managedfields.ExtractInto(persistentVolumeClaim, internal.Parser().Type("io.k8s.api.core.v1.PersistentVolumeClaim"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(persistentVolumeClaim.Name) + b.WithNamespace(persistentVolumeClaim.Namespace) + + b.WithKind("PersistentVolumeClaim") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/pod.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/pod.go index 5e39f4ed90fb..060cfcc06f63 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/pod.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/pod.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Pod(name, namespace string) *PodApplyConfiguration { return b } +// ExtractPod extracts the applied configuration owned by fieldManager from +// pod. If no managedFields are found in pod for fieldManager, a +// PodApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// pod must be a unmodified Pod API object that was retrieved from the Kubernetes API. +// ExtractPod provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPod(pod *apicorev1.Pod, fieldManager string) (*PodApplyConfiguration, error) { + return extractPod(pod, fieldManager, "") +} + +// ExtractPodStatus is the same as ExtractPod except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPodStatus(pod *apicorev1.Pod, fieldManager string) (*PodApplyConfiguration, error) { + return extractPod(pod, fieldManager, "status") +} + +func extractPod(pod *apicorev1.Pod, fieldManager string, subresource string) (*PodApplyConfiguration, error) { + b := &PodApplyConfiguration{} + err := managedfields.ExtractInto(pod, internal.Parser().Type("io.k8s.api.core.v1.Pod"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(pod.Name) + b.WithNamespace(pod.Namespace) + + b.WithKind("Pod") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/podtemplate.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/podtemplate.go index a8d8cc9b64ac..885bab721b46 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/podtemplate.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/podtemplate.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func PodTemplate(name, namespace string) *PodTemplateApplyConfiguration { return b } +// ExtractPodTemplate extracts the applied configuration owned by fieldManager from +// podTemplate. If no managedFields are found in podTemplate for fieldManager, a +// PodTemplateApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// podTemplate must be a unmodified PodTemplate API object that was retrieved from the Kubernetes API. +// ExtractPodTemplate provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPodTemplate(podTemplate *apicorev1.PodTemplate, fieldManager string) (*PodTemplateApplyConfiguration, error) { + return extractPodTemplate(podTemplate, fieldManager, "") +} + +// ExtractPodTemplateStatus is the same as ExtractPodTemplate except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPodTemplateStatus(podTemplate *apicorev1.PodTemplate, fieldManager string) (*PodTemplateApplyConfiguration, error) { + return extractPodTemplate(podTemplate, fieldManager, "status") +} + +func extractPodTemplate(podTemplate *apicorev1.PodTemplate, fieldManager string, subresource string) (*PodTemplateApplyConfiguration, error) { + b := &PodTemplateApplyConfiguration{} + err := managedfields.ExtractInto(podTemplate, internal.Parser().Type("io.k8s.api.core.v1.PodTemplate"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(podTemplate.Name) + b.WithNamespace(podTemplate.Namespace) + + b.WithKind("PodTemplate") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/probe.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/probe.go index 5fb05e658edf..f87adcd5f32a 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/probe.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/probe.go @@ -21,12 +21,13 @@ package v1 // ProbeApplyConfiguration represents an declarative configuration of the Probe type for use // with apply. type ProbeApplyConfiguration struct { - HandlerApplyConfiguration `json:",inline"` - InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` - TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` - PeriodSeconds *int32 `json:"periodSeconds,omitempty"` - SuccessThreshold *int32 `json:"successThreshold,omitempty"` - FailureThreshold *int32 `json:"failureThreshold,omitempty"` + HandlerApplyConfiguration `json:",inline"` + InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` + PeriodSeconds *int32 `json:"periodSeconds,omitempty"` + SuccessThreshold *int32 `json:"successThreshold,omitempty"` + FailureThreshold *int32 `json:"failureThreshold,omitempty"` + TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` } // ProbeApplyConfiguration constructs an declarative configuration of the Probe type for use with @@ -98,3 +99,11 @@ func (b *ProbeApplyConfiguration) WithFailureThreshold(value int32) *ProbeApplyC b.FailureThreshold = &value return b } + +// WithTerminationGracePeriodSeconds sets the TerminationGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminationGracePeriodSeconds field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithTerminationGracePeriodSeconds(value int64) *ProbeApplyConfiguration { + b.TerminationGracePeriodSeconds = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/replicationcontroller.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/replicationcontroller.go index e4f8aead25bb..349377e7daf4 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/replicationcontroller.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/replicationcontroller.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func ReplicationController(name, namespace string) *ReplicationControllerApplyCo return b } +// ExtractReplicationController extracts the applied configuration owned by fieldManager from +// replicationController. If no managedFields are found in replicationController for fieldManager, a +// ReplicationControllerApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// replicationController must be a unmodified ReplicationController API object that was retrieved from the Kubernetes API. +// ExtractReplicationController provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractReplicationController(replicationController *apicorev1.ReplicationController, fieldManager string) (*ReplicationControllerApplyConfiguration, error) { + return extractReplicationController(replicationController, fieldManager, "") +} + +// ExtractReplicationControllerStatus is the same as ExtractReplicationController except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractReplicationControllerStatus(replicationController *apicorev1.ReplicationController, fieldManager string) (*ReplicationControllerApplyConfiguration, error) { + return extractReplicationController(replicationController, fieldManager, "status") +} + +func extractReplicationController(replicationController *apicorev1.ReplicationController, fieldManager string, subresource string) (*ReplicationControllerApplyConfiguration, error) { + b := &ReplicationControllerApplyConfiguration{} + err := managedfields.ExtractInto(replicationController, internal.Parser().Type("io.k8s.api.core.v1.ReplicationController"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(replicationController.Name) + b.WithNamespace(replicationController.Namespace) + + b.WithKind("ReplicationController") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcequota.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcequota.go index 3b91e9d0e7ad..104559c997cd 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcequota.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcequota.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func ResourceQuota(name, namespace string) *ResourceQuotaApplyConfiguration { return b } +// ExtractResourceQuota extracts the applied configuration owned by fieldManager from +// resourceQuota. If no managedFields are found in resourceQuota for fieldManager, a +// ResourceQuotaApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// resourceQuota must be a unmodified ResourceQuota API object that was retrieved from the Kubernetes API. +// ExtractResourceQuota provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractResourceQuota(resourceQuota *apicorev1.ResourceQuota, fieldManager string) (*ResourceQuotaApplyConfiguration, error) { + return extractResourceQuota(resourceQuota, fieldManager, "") +} + +// ExtractResourceQuotaStatus is the same as ExtractResourceQuota except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractResourceQuotaStatus(resourceQuota *apicorev1.ResourceQuota, fieldManager string) (*ResourceQuotaApplyConfiguration, error) { + return extractResourceQuota(resourceQuota, fieldManager, "status") +} + +func extractResourceQuota(resourceQuota *apicorev1.ResourceQuota, fieldManager string, subresource string) (*ResourceQuotaApplyConfiguration, error) { + b := &ResourceQuotaApplyConfiguration{} + err := managedfields.ExtractInto(resourceQuota, internal.Parser().Type("io.k8s.api.core.v1.ResourceQuota"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(resourceQuota.Name) + b.WithNamespace(resourceQuota.Namespace) + + b.WithKind("ResourceQuota") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/secret.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/secret.go index 0ffbb74f41e5..732a0d6aa10d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/secret.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/secret.go @@ -22,6 +22,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -47,6 +49,42 @@ func Secret(name, namespace string) *SecretApplyConfiguration { return b } +// ExtractSecret extracts the applied configuration owned by fieldManager from +// secret. If no managedFields are found in secret for fieldManager, a +// SecretApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// secret must be a unmodified Secret API object that was retrieved from the Kubernetes API. +// ExtractSecret provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractSecret(secret *corev1.Secret, fieldManager string) (*SecretApplyConfiguration, error) { + return extractSecret(secret, fieldManager, "") +} + +// ExtractSecretStatus is the same as ExtractSecret except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractSecretStatus(secret *corev1.Secret, fieldManager string) (*SecretApplyConfiguration, error) { + return extractSecret(secret, fieldManager, "status") +} + +func extractSecret(secret *corev1.Secret, fieldManager string, subresource string) (*SecretApplyConfiguration, error) { + b := &SecretApplyConfiguration{} + err := managedfields.ExtractInto(secret, internal.Parser().Type("io.k8s.api.core.v1.Secret"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(secret.Name) + b.WithNamespace(secret.Namespace) + + b.WithKind("Secret") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/service.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/service.go index 1a2a42203cf5..dc865705ed72 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/service.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/service.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Service(name, namespace string) *ServiceApplyConfiguration { return b } +// ExtractService extracts the applied configuration owned by fieldManager from +// service. If no managedFields are found in service for fieldManager, a +// ServiceApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// service must be a unmodified Service API object that was retrieved from the Kubernetes API. +// ExtractService provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractService(service *apicorev1.Service, fieldManager string) (*ServiceApplyConfiguration, error) { + return extractService(service, fieldManager, "") +} + +// ExtractServiceStatus is the same as ExtractService except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractServiceStatus(service *apicorev1.Service, fieldManager string) (*ServiceApplyConfiguration, error) { + return extractService(service, fieldManager, "status") +} + +func extractService(service *apicorev1.Service, fieldManager string, subresource string) (*ServiceApplyConfiguration, error) { + b := &ServiceApplyConfiguration{} + err := managedfields.ExtractInto(service, internal.Parser().Type("io.k8s.api.core.v1.Service"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(service.Name) + b.WithNamespace(service.Namespace) + + b.WithKind("Service") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccount.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccount.go index 68d8acb413d3..2f1601881ffd 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccount.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccount.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -45,6 +48,42 @@ func ServiceAccount(name, namespace string) *ServiceAccountApplyConfiguration { return b } +// ExtractServiceAccount extracts the applied configuration owned by fieldManager from +// serviceAccount. If no managedFields are found in serviceAccount for fieldManager, a +// ServiceAccountApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// serviceAccount must be a unmodified ServiceAccount API object that was retrieved from the Kubernetes API. +// ExtractServiceAccount provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractServiceAccount(serviceAccount *apicorev1.ServiceAccount, fieldManager string) (*ServiceAccountApplyConfiguration, error) { + return extractServiceAccount(serviceAccount, fieldManager, "") +} + +// ExtractServiceAccountStatus is the same as ExtractServiceAccount except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractServiceAccountStatus(serviceAccount *apicorev1.ServiceAccount, fieldManager string) (*ServiceAccountApplyConfiguration, error) { + return extractServiceAccount(serviceAccount, fieldManager, "status") +} + +func extractServiceAccount(serviceAccount *apicorev1.ServiceAccount, fieldManager string, subresource string) (*ServiceAccountApplyConfiguration, error) { + b := &ServiceAccountApplyConfiguration{} + err := managedfields.ExtractInto(serviceAccount, internal.Parser().Type("io.k8s.api.core.v1.ServiceAccount"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(serviceAccount.Name) + b.WithNamespace(serviceAccount.Namespace) + + b.WithKind("ServiceAccount") + b.WithAPIVersion("v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpoint.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpoint.go index 9930326687a4..d8c2359a3b72 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpoint.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpoint.go @@ -32,6 +32,7 @@ type EndpointApplyConfiguration struct { DeprecatedTopology map[string]string `json:"deprecatedTopology,omitempty"` NodeName *string `json:"nodeName,omitempty"` Zone *string `json:"zone,omitempty"` + Hints *EndpointHintsApplyConfiguration `json:"hints,omitempty"` } // EndpointApplyConfiguration constructs an declarative configuration of the Endpoint type for use with @@ -103,3 +104,11 @@ func (b *EndpointApplyConfiguration) WithZone(value string) *EndpointApplyConfig b.Zone = &value return b } + +// WithHints sets the Hints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hints field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithHints(value *EndpointHintsApplyConfiguration) *EndpointApplyConfiguration { + b.Hints = value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointhints.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointhints.go new file mode 100644 index 000000000000..6eb9f21a5130 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointhints.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EndpointHintsApplyConfiguration represents an declarative configuration of the EndpointHints type for use +// with apply. +type EndpointHintsApplyConfiguration struct { + ForZones []ForZoneApplyConfiguration `json:"forZones,omitempty"` +} + +// EndpointHintsApplyConfiguration constructs an declarative configuration of the EndpointHints type for use with +// apply. +func EndpointHints() *EndpointHintsApplyConfiguration { + return &EndpointHintsApplyConfiguration{} +} + +// WithForZones adds the given value to the ForZones field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ForZones field. +func (b *EndpointHintsApplyConfiguration) WithForZones(values ...*ForZoneApplyConfiguration) *EndpointHintsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithForZones") + } + b.ForZones = append(b.ForZones, *values[i]) + } + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointslice.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointslice.go index f80c0dedc3ba..ff765de7f290 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointslice.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointslice.go @@ -22,6 +22,8 @@ import ( discoveryv1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -46,6 +48,42 @@ func EndpointSlice(name, namespace string) *EndpointSliceApplyConfiguration { return b } +// ExtractEndpointSlice extracts the applied configuration owned by fieldManager from +// endpointSlice. If no managedFields are found in endpointSlice for fieldManager, a +// EndpointSliceApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// endpointSlice must be a unmodified EndpointSlice API object that was retrieved from the Kubernetes API. +// ExtractEndpointSlice provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEndpointSlice(endpointSlice *discoveryv1.EndpointSlice, fieldManager string) (*EndpointSliceApplyConfiguration, error) { + return extractEndpointSlice(endpointSlice, fieldManager, "") +} + +// ExtractEndpointSliceStatus is the same as ExtractEndpointSlice except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEndpointSliceStatus(endpointSlice *discoveryv1.EndpointSlice, fieldManager string) (*EndpointSliceApplyConfiguration, error) { + return extractEndpointSlice(endpointSlice, fieldManager, "status") +} + +func extractEndpointSlice(endpointSlice *discoveryv1.EndpointSlice, fieldManager string, subresource string) (*EndpointSliceApplyConfiguration, error) { + b := &EndpointSliceApplyConfiguration{} + err := managedfields.ExtractInto(endpointSlice, internal.Parser().Type("io.k8s.api.discovery.v1.EndpointSlice"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(endpointSlice.Name) + b.WithNamespace(endpointSlice.Namespace) + + b.WithKind("EndpointSlice") + b.WithAPIVersion("discovery.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/forzone.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/forzone.go new file mode 100644 index 000000000000..192a5ad2e8ce --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/forzone.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ForZoneApplyConfiguration represents an declarative configuration of the ForZone type for use +// with apply. +type ForZoneApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// ForZoneApplyConfiguration constructs an declarative configuration of the ForZone type for use with +// apply. +func ForZone() *ForZoneApplyConfiguration { + return &ForZoneApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ForZoneApplyConfiguration) WithName(value string) *ForZoneApplyConfiguration { + b.Name = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpoint.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpoint.go index f3dfd2ab8b2f..724c2d007c0b 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpoint.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpoint.go @@ -31,6 +31,7 @@ type EndpointApplyConfiguration struct { TargetRef *v1.ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"` Topology map[string]string `json:"topology,omitempty"` NodeName *string `json:"nodeName,omitempty"` + Hints *EndpointHintsApplyConfiguration `json:"hints,omitempty"` } // EndpointApplyConfiguration constructs an declarative configuration of the Endpoint type for use with @@ -94,3 +95,11 @@ func (b *EndpointApplyConfiguration) WithNodeName(value string) *EndpointApplyCo b.NodeName = &value return b } + +// WithHints sets the Hints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hints field is set to the value of the last call. +func (b *EndpointApplyConfiguration) WithHints(value *EndpointHintsApplyConfiguration) *EndpointApplyConfiguration { + b.Hints = value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointhints.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointhints.go new file mode 100644 index 000000000000..41d80206b3b9 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointhints.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// EndpointHintsApplyConfiguration represents an declarative configuration of the EndpointHints type for use +// with apply. +type EndpointHintsApplyConfiguration struct { + ForZones []ForZoneApplyConfiguration `json:"forZones,omitempty"` +} + +// EndpointHintsApplyConfiguration constructs an declarative configuration of the EndpointHints type for use with +// apply. +func EndpointHints() *EndpointHintsApplyConfiguration { + return &EndpointHintsApplyConfiguration{} +} + +// WithForZones adds the given value to the ForZones field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ForZones field. +func (b *EndpointHintsApplyConfiguration) WithForZones(values ...*ForZoneApplyConfiguration) *EndpointHintsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithForZones") + } + b.ForZones = append(b.ForZones, *values[i]) + } + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointslice.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointslice.go index 03d525fae0d7..c6067f1a57be 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointslice.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointslice.go @@ -22,6 +22,8 @@ import ( v1beta1 "k8s.io/api/discovery/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -46,6 +48,42 @@ func EndpointSlice(name, namespace string) *EndpointSliceApplyConfiguration { return b } +// ExtractEndpointSlice extracts the applied configuration owned by fieldManager from +// endpointSlice. If no managedFields are found in endpointSlice for fieldManager, a +// EndpointSliceApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// endpointSlice must be a unmodified EndpointSlice API object that was retrieved from the Kubernetes API. +// ExtractEndpointSlice provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEndpointSlice(endpointSlice *v1beta1.EndpointSlice, fieldManager string) (*EndpointSliceApplyConfiguration, error) { + return extractEndpointSlice(endpointSlice, fieldManager, "") +} + +// ExtractEndpointSliceStatus is the same as ExtractEndpointSlice except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEndpointSliceStatus(endpointSlice *v1beta1.EndpointSlice, fieldManager string) (*EndpointSliceApplyConfiguration, error) { + return extractEndpointSlice(endpointSlice, fieldManager, "status") +} + +func extractEndpointSlice(endpointSlice *v1beta1.EndpointSlice, fieldManager string, subresource string) (*EndpointSliceApplyConfiguration, error) { + b := &EndpointSliceApplyConfiguration{} + err := managedfields.ExtractInto(endpointSlice, internal.Parser().Type("io.k8s.api.discovery.v1beta1.EndpointSlice"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(endpointSlice.Name) + b.WithNamespace(endpointSlice.Namespace) + + b.WithKind("EndpointSlice") + b.WithAPIVersion("discovery.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/forzone.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/forzone.go new file mode 100644 index 000000000000..4d1455ed3849 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/forzone.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ForZoneApplyConfiguration represents an declarative configuration of the ForZone type for use +// with apply. +type ForZoneApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// ForZoneApplyConfiguration constructs an declarative configuration of the ForZone type for use with +// apply. +func ForZone() *ForZoneApplyConfiguration { + return &ForZoneApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ForZoneApplyConfiguration) WithName(value string) *ForZoneApplyConfiguration { + b.Name = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/events/v1/event.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/events/v1/event.go index cc3c12584666..178f8a3aa32f 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/events/v1/event.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/events/v1/event.go @@ -19,9 +19,12 @@ limitations under the License. package v1 import ( + apieventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -57,6 +60,42 @@ func Event(name, namespace string) *EventApplyConfiguration { return b } +// ExtractEvent extracts the applied configuration owned by fieldManager from +// event. If no managedFields are found in event for fieldManager, a +// EventApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// event must be a unmodified Event API object that was retrieved from the Kubernetes API. +// ExtractEvent provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEvent(event *apieventsv1.Event, fieldManager string) (*EventApplyConfiguration, error) { + return extractEvent(event, fieldManager, "") +} + +// ExtractEventStatus is the same as ExtractEvent except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEventStatus(event *apieventsv1.Event, fieldManager string) (*EventApplyConfiguration, error) { + return extractEvent(event, fieldManager, "status") +} + +func extractEvent(event *apieventsv1.Event, fieldManager string, subresource string) (*EventApplyConfiguration, error) { + b := &EventApplyConfiguration{} + err := managedfields.ExtractInto(event, internal.Parser().Type("io.k8s.api.events.v1.Event"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(event.Name) + b.WithNamespace(event.Namespace) + + b.WithKind("Event") + b.WithAPIVersion("events.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/events/v1beta1/event.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/events/v1beta1/event.go index e4db39428eb8..6fbd45bb264a 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/events/v1beta1/event.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/events/v1beta1/event.go @@ -19,9 +19,12 @@ limitations under the License. package v1beta1 import ( + eventsv1beta1 "k8s.io/api/events/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -57,6 +60,42 @@ func Event(name, namespace string) *EventApplyConfiguration { return b } +// ExtractEvent extracts the applied configuration owned by fieldManager from +// event. If no managedFields are found in event for fieldManager, a +// EventApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// event must be a unmodified Event API object that was retrieved from the Kubernetes API. +// ExtractEvent provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEvent(event *eventsv1beta1.Event, fieldManager string) (*EventApplyConfiguration, error) { + return extractEvent(event, fieldManager, "") +} + +// ExtractEventStatus is the same as ExtractEvent except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEventStatus(event *eventsv1beta1.Event, fieldManager string) (*EventApplyConfiguration, error) { + return extractEvent(event, fieldManager, "status") +} + +func extractEvent(event *eventsv1beta1.Event, fieldManager string, subresource string) (*EventApplyConfiguration, error) { + b := &EventApplyConfiguration{} + err := managedfields.ExtractInto(event, internal.Parser().Type("io.k8s.api.events.v1beta1.Event"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(event.Name) + b.WithNamespace(event.Namespace) + + b.WithKind("Event") + b.WithAPIVersion("events.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/daemonset.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/daemonset.go index d54920020706..06edfbce7a77 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/daemonset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/daemonset.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func DaemonSet(name, namespace string) *DaemonSetApplyConfiguration { return b } +// ExtractDaemonSet extracts the applied configuration owned by fieldManager from +// daemonSet. If no managedFields are found in daemonSet for fieldManager, a +// DaemonSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// daemonSet must be a unmodified DaemonSet API object that was retrieved from the Kubernetes API. +// ExtractDaemonSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDaemonSet(daemonSet *extensionsv1beta1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { + return extractDaemonSet(daemonSet, fieldManager, "") +} + +// ExtractDaemonSetStatus is the same as ExtractDaemonSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDaemonSetStatus(daemonSet *extensionsv1beta1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { + return extractDaemonSet(daemonSet, fieldManager, "status") +} + +func extractDaemonSet(daemonSet *extensionsv1beta1.DaemonSet, fieldManager string, subresource string) (*DaemonSetApplyConfiguration, error) { + b := &DaemonSetApplyConfiguration{} + err := managedfields.ExtractInto(daemonSet, internal.Parser().Type("io.k8s.api.extensions.v1beta1.DaemonSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(daemonSet.Name) + b.WithNamespace(daemonSet.Namespace) + + b.WithKind("DaemonSet") + b.WithAPIVersion("extensions/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deployment.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deployment.go index 57d6c4b0d6fd..264f54f612c5 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deployment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deployment.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Deployment(name, namespace string) *DeploymentApplyConfiguration { return b } +// ExtractDeployment extracts the applied configuration owned by fieldManager from +// deployment. If no managedFields are found in deployment for fieldManager, a +// DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API. +// ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDeployment(deployment *extensionsv1beta1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { + return extractDeployment(deployment, fieldManager, "") +} + +// ExtractDeploymentStatus is the same as ExtractDeployment except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDeploymentStatus(deployment *extensionsv1beta1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { + return extractDeployment(deployment, fieldManager, "status") +} + +func extractDeployment(deployment *extensionsv1beta1.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) { + b := &DeploymentApplyConfiguration{} + err := managedfields.ExtractInto(deployment, internal.Parser().Type("io.k8s.api.extensions.v1beta1.Deployment"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(deployment.Name) + b.WithNamespace(deployment.Namespace) + + b.WithKind("Deployment") + b.WithAPIVersion("extensions/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingress.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingress.go index 2c66d1dcc8ef..9c82894d6584 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingress.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingress.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Ingress(name, namespace string) *IngressApplyConfiguration { return b } +// ExtractIngress extracts the applied configuration owned by fieldManager from +// ingress. If no managedFields are found in ingress for fieldManager, a +// IngressApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// ingress must be a unmodified Ingress API object that was retrieved from the Kubernetes API. +// ExtractIngress provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractIngress(ingress *extensionsv1beta1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { + return extractIngress(ingress, fieldManager, "") +} + +// ExtractIngressStatus is the same as ExtractIngress except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractIngressStatus(ingress *extensionsv1beta1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { + return extractIngress(ingress, fieldManager, "status") +} + +func extractIngress(ingress *extensionsv1beta1.Ingress, fieldManager string, subresource string) (*IngressApplyConfiguration, error) { + b := &IngressApplyConfiguration{} + err := managedfields.ExtractInto(ingress, internal.Parser().Type("io.k8s.api.extensions.v1beta1.Ingress"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(ingress.Name) + b.WithNamespace(ingress.Namespace) + + b.WithKind("Ingress") + b.WithAPIVersion("extensions/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/networkpolicy.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/networkpolicy.go index b08bb4045b5b..e5a72411d81c 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/networkpolicy.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/networkpolicy.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func NetworkPolicy(name, namespace string) *NetworkPolicyApplyConfiguration { return b } +// ExtractNetworkPolicy extracts the applied configuration owned by fieldManager from +// networkPolicy. If no managedFields are found in networkPolicy for fieldManager, a +// NetworkPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// networkPolicy must be a unmodified NetworkPolicy API object that was retrieved from the Kubernetes API. +// ExtractNetworkPolicy provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractNetworkPolicy(networkPolicy *extensionsv1beta1.NetworkPolicy, fieldManager string) (*NetworkPolicyApplyConfiguration, error) { + return extractNetworkPolicy(networkPolicy, fieldManager, "") +} + +// ExtractNetworkPolicyStatus is the same as ExtractNetworkPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractNetworkPolicyStatus(networkPolicy *extensionsv1beta1.NetworkPolicy, fieldManager string) (*NetworkPolicyApplyConfiguration, error) { + return extractNetworkPolicy(networkPolicy, fieldManager, "status") +} + +func extractNetworkPolicy(networkPolicy *extensionsv1beta1.NetworkPolicy, fieldManager string, subresource string) (*NetworkPolicyApplyConfiguration, error) { + b := &NetworkPolicyApplyConfiguration{} + err := managedfields.ExtractInto(networkPolicy, internal.Parser().Type("io.k8s.api.extensions.v1beta1.NetworkPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(networkPolicy.Name) + b.WithNamespace(networkPolicy.Namespace) + + b.WithKind("NetworkPolicy") + b.WithAPIVersion("extensions/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/podsecuritypolicy.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/podsecuritypolicy.go index 544915d3656c..1c8c9ea1079e 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/podsecuritypolicy.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/podsecuritypolicy.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func PodSecurityPolicy(name string) *PodSecurityPolicyApplyConfiguration { return b } +// ExtractPodSecurityPolicy extracts the applied configuration owned by fieldManager from +// podSecurityPolicy. If no managedFields are found in podSecurityPolicy for fieldManager, a +// PodSecurityPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// podSecurityPolicy must be a unmodified PodSecurityPolicy API object that was retrieved from the Kubernetes API. +// ExtractPodSecurityPolicy provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPodSecurityPolicy(podSecurityPolicy *extensionsv1beta1.PodSecurityPolicy, fieldManager string) (*PodSecurityPolicyApplyConfiguration, error) { + return extractPodSecurityPolicy(podSecurityPolicy, fieldManager, "") +} + +// ExtractPodSecurityPolicyStatus is the same as ExtractPodSecurityPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPodSecurityPolicyStatus(podSecurityPolicy *extensionsv1beta1.PodSecurityPolicy, fieldManager string) (*PodSecurityPolicyApplyConfiguration, error) { + return extractPodSecurityPolicy(podSecurityPolicy, fieldManager, "status") +} + +func extractPodSecurityPolicy(podSecurityPolicy *extensionsv1beta1.PodSecurityPolicy, fieldManager string, subresource string) (*PodSecurityPolicyApplyConfiguration, error) { + b := &PodSecurityPolicyApplyConfiguration{} + err := managedfields.ExtractInto(podSecurityPolicy, internal.Parser().Type("io.k8s.api.extensions.v1beta1.PodSecurityPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(podSecurityPolicy.Name) + + b.WithKind("PodSecurityPolicy") + b.WithAPIVersion("extensions/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicaset.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicaset.go index 1172f2bc3999..48b7be0a6c4d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicaset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicaset.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration { return b } +// ExtractReplicaSet extracts the applied configuration owned by fieldManager from +// replicaSet. If no managedFields are found in replicaSet for fieldManager, a +// ReplicaSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// replicaSet must be a unmodified ReplicaSet API object that was retrieved from the Kubernetes API. +// ExtractReplicaSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractReplicaSet(replicaSet *extensionsv1beta1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { + return extractReplicaSet(replicaSet, fieldManager, "") +} + +// ExtractReplicaSetStatus is the same as ExtractReplicaSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractReplicaSetStatus(replicaSet *extensionsv1beta1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { + return extractReplicaSet(replicaSet, fieldManager, "status") +} + +func extractReplicaSet(replicaSet *extensionsv1beta1.ReplicaSet, fieldManager string, subresource string) (*ReplicaSetApplyConfiguration, error) { + b := &ReplicaSetApplyConfiguration{} + err := managedfields.ExtractInto(replicaSet, internal.Parser().Type("io.k8s.api.extensions.v1beta1.ReplicaSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(replicaSet.Name) + b.WithNamespace(replicaSet.Namespace) + + b.WithKind("ReplicaSet") + b.WithAPIVersion("extensions/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/scale.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/scale.go new file mode 100644 index 000000000000..701145825dab --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/scale.go @@ -0,0 +1,233 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/extensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ScaleApplyConfiguration represents an declarative configuration of the Scale type for use +// with apply. +type ScaleApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *v1beta1.ScaleSpec `json:"spec,omitempty"` + Status *v1beta1.ScaleStatus `json:"status,omitempty"` +} + +// ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with +// apply. +func Scale() *ScaleApplyConfiguration { + return &ScaleApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithSelfLink sets the SelfLink field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SelfLink field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithSelfLink(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.SelfLink = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithClusterName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ClusterName = &value + return b +} + +func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithSpec(value v1beta1.ScaleSpec) *ScaleApplyConfiguration { + b.Spec = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithStatus(value v1beta1.ScaleStatus) *ScaleApplyConfiguration { + b.Status = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschema.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschema.go index d7f835624f4d..a7ff3902d952 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschema.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/flowschema.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func FlowSchema(name string) *FlowSchemaApplyConfiguration { return b } +// ExtractFlowSchema extracts the applied configuration owned by fieldManager from +// flowSchema. If no managedFields are found in flowSchema for fieldManager, a +// FlowSchemaApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// flowSchema must be a unmodified FlowSchema API object that was retrieved from the Kubernetes API. +// ExtractFlowSchema provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractFlowSchema(flowSchema *flowcontrolv1alpha1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { + return extractFlowSchema(flowSchema, fieldManager, "") +} + +// ExtractFlowSchemaStatus is the same as ExtractFlowSchema except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractFlowSchemaStatus(flowSchema *flowcontrolv1alpha1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { + return extractFlowSchema(flowSchema, fieldManager, "status") +} + +func extractFlowSchema(flowSchema *flowcontrolv1alpha1.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { + b := &FlowSchemaApplyConfiguration{} + err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1alpha1.FlowSchema"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(flowSchema.Name) + + b.WithKind("FlowSchema") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfiguration.go index a5f0663d4cb9..c61d7f5fca5f 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyCon return b } +// ExtractPriorityLevelConfiguration extracts the applied configuration owned by fieldManager from +// priorityLevelConfiguration. If no managedFields are found in priorityLevelConfiguration for fieldManager, a +// PriorityLevelConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// priorityLevelConfiguration must be a unmodified PriorityLevelConfiguration API object that was retrieved from the Kubernetes API. +// ExtractPriorityLevelConfiguration provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { + return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "") +} + +// ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { + return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status") +} + +func extractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { + b := &PriorityLevelConfigurationApplyConfiguration{} + err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfiguration"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(priorityLevelConfiguration.Name) + + b.WithKind("PriorityLevelConfiguration") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschema.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschema.go index d7c4beb18e9a..94cc31b15e89 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschema.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschema.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func FlowSchema(name string) *FlowSchemaApplyConfiguration { return b } +// ExtractFlowSchema extracts the applied configuration owned by fieldManager from +// flowSchema. If no managedFields are found in flowSchema for fieldManager, a +// FlowSchemaApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// flowSchema must be a unmodified FlowSchema API object that was retrieved from the Kubernetes API. +// ExtractFlowSchema provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractFlowSchema(flowSchema *flowcontrolv1beta1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { + return extractFlowSchema(flowSchema, fieldManager, "") +} + +// ExtractFlowSchemaStatus is the same as ExtractFlowSchema except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractFlowSchemaStatus(flowSchema *flowcontrolv1beta1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { + return extractFlowSchema(flowSchema, fieldManager, "status") +} + +func extractFlowSchema(flowSchema *flowcontrolv1beta1.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { + b := &FlowSchemaApplyConfiguration{} + err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta1.FlowSchema"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(flowSchema.Name) + + b.WithKind("FlowSchema") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go index 438f10b85323..5f58006df651 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyCon return b } +// ExtractPriorityLevelConfiguration extracts the applied configuration owned by fieldManager from +// priorityLevelConfiguration. If no managedFields are found in priorityLevelConfiguration for fieldManager, a +// PriorityLevelConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// priorityLevelConfiguration must be a unmodified PriorityLevelConfiguration API object that was retrieved from the Kubernetes API. +// ExtractPriorityLevelConfiguration provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { + return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "") +} + +// ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { + return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status") +} + +func extractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { + b := &PriorityLevelConfigurationApplyConfiguration{} + err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfiguration"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(priorityLevelConfiguration.Name) + + b.WithKind("PriorityLevelConfiguration") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go new file mode 100644 index 000000000000..66b23cbfe3d2 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go @@ -0,0 +1,10806 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + "fmt" + "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: io.k8s.api.admissionregistration.v1.MutatingWebhook + map: + fields: + - name: admissionReviewVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: clientConfig + type: + namedType: io.k8s.api.admissionregistration.v1.WebhookClientConfig + default: {} + - name: failurePolicy + type: + scalar: string + - name: matchPolicy + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: objectSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: reinvocationPolicy + type: + scalar: string + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.RuleWithOperations + elementRelationship: atomic + - name: sideEffects + type: + scalar: string + - name: timeoutSeconds + type: + scalar: numeric +- name: io.k8s.api.admissionregistration.v1.MutatingWebhookConfiguration + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: webhooks + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.MutatingWebhook + elementRelationship: associative + keys: + - name +- name: io.k8s.api.admissionregistration.v1.RuleWithOperations + map: + fields: + - name: apiGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: apiVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: operations + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resources + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: scope + type: + scalar: string +- name: io.k8s.api.admissionregistration.v1.ServiceReference + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" + - name: path + type: + scalar: string + - name: port + type: + scalar: numeric +- name: io.k8s.api.admissionregistration.v1.ValidatingWebhook + map: + fields: + - name: admissionReviewVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: clientConfig + type: + namedType: io.k8s.api.admissionregistration.v1.WebhookClientConfig + default: {} + - name: failurePolicy + type: + scalar: string + - name: matchPolicy + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: objectSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.RuleWithOperations + elementRelationship: atomic + - name: sideEffects + type: + scalar: string + - name: timeoutSeconds + type: + scalar: numeric +- name: io.k8s.api.admissionregistration.v1.ValidatingWebhookConfiguration + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: webhooks + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1.ValidatingWebhook + elementRelationship: associative + keys: + - name +- name: io.k8s.api.admissionregistration.v1.WebhookClientConfig + map: + fields: + - name: caBundle + type: + scalar: string + - name: service + type: + namedType: io.k8s.api.admissionregistration.v1.ServiceReference + - name: url + type: + scalar: string +- name: io.k8s.api.admissionregistration.v1beta1.MutatingWebhook + map: + fields: + - name: admissionReviewVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: clientConfig + type: + namedType: io.k8s.api.admissionregistration.v1beta1.WebhookClientConfig + default: {} + - name: failurePolicy + type: + scalar: string + - name: matchPolicy + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: objectSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: reinvocationPolicy + type: + scalar: string + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1beta1.RuleWithOperations + elementRelationship: atomic + - name: sideEffects + type: + scalar: string + - name: timeoutSeconds + type: + scalar: numeric +- name: io.k8s.api.admissionregistration.v1beta1.MutatingWebhookConfiguration + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: webhooks + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1beta1.MutatingWebhook + elementRelationship: associative + keys: + - name +- name: io.k8s.api.admissionregistration.v1beta1.RuleWithOperations + map: + fields: + - name: apiGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: apiVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: operations + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resources + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: scope + type: + scalar: string +- name: io.k8s.api.admissionregistration.v1beta1.ServiceReference + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" + - name: path + type: + scalar: string + - name: port + type: + scalar: numeric +- name: io.k8s.api.admissionregistration.v1beta1.ValidatingWebhook + map: + fields: + - name: admissionReviewVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: clientConfig + type: + namedType: io.k8s.api.admissionregistration.v1beta1.WebhookClientConfig + default: {} + - name: failurePolicy + type: + scalar: string + - name: matchPolicy + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: objectSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1beta1.RuleWithOperations + elementRelationship: atomic + - name: sideEffects + type: + scalar: string + - name: timeoutSeconds + type: + scalar: numeric +- name: io.k8s.api.admissionregistration.v1beta1.ValidatingWebhookConfiguration + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: webhooks + type: + list: + elementType: + namedType: io.k8s.api.admissionregistration.v1beta1.ValidatingWebhook + elementRelationship: associative + keys: + - name +- name: io.k8s.api.admissionregistration.v1beta1.WebhookClientConfig + map: + fields: + - name: caBundle + type: + scalar: string + - name: service + type: + namedType: io.k8s.api.admissionregistration.v1beta1.ServiceReference + - name: url + type: + scalar: string +- name: io.k8s.api.apiserverinternal.v1alpha1.ServerStorageVersion + map: + fields: + - name: apiServerID + type: + scalar: string + - name: decodableVersions + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: encodingVersion + type: + scalar: string +- name: io.k8s.api.apiserverinternal.v1alpha1.StorageVersion + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionStatus + default: {} +- name: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: observedGeneration + type: + scalar: numeric + - name: reason + type: + scalar: string + default: "" + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionSpec + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionStatus + map: + fields: + - name: commonEncodingVersion + type: + scalar: string + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionCondition + elementRelationship: associative + keys: + - type + - name: storageVersions + type: + list: + elementType: + namedType: io.k8s.api.apiserverinternal.v1alpha1.ServerStorageVersion + elementRelationship: associative + keys: + - apiServerID +- name: io.k8s.api.apps.v1.ControllerRevision + map: + fields: + - name: apiVersion + type: + scalar: string + - name: data + type: + namedType: __untyped_atomic_ + default: {} + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: revision + type: + scalar: numeric + default: 0 +- name: io.k8s.api.apps.v1.DaemonSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1.DaemonSetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1.DaemonSetStatus + default: {} +- name: io.k8s.api.apps.v1.DaemonSetCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1.DaemonSetSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} + - name: updateStrategy + type: + namedType: io.k8s.api.apps.v1.DaemonSetUpdateStrategy + default: {} +- name: io.k8s.api.apps.v1.DaemonSetStatus + map: + fields: + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1.DaemonSetCondition + elementRelationship: associative + keys: + - type + - name: currentNumberScheduled + type: + scalar: numeric + default: 0 + - name: desiredNumberScheduled + type: + scalar: numeric + default: 0 + - name: numberAvailable + type: + scalar: numeric + - name: numberMisscheduled + type: + scalar: numeric + default: 0 + - name: numberReady + type: + scalar: numeric + default: 0 + - name: numberUnavailable + type: + scalar: numeric + - name: observedGeneration + type: + scalar: numeric + - name: updatedNumberScheduled + type: + scalar: numeric +- name: io.k8s.api.apps.v1.DaemonSetUpdateStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.apps.v1.RollingUpdateDaemonSet + - name: type + type: + scalar: string +- name: io.k8s.api.apps.v1.Deployment + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1.DeploymentSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1.DeploymentStatus + default: {} +- name: io.k8s.api.apps.v1.DeploymentCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastUpdateTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1.DeploymentSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: paused + type: + scalar: boolean + - name: progressDeadlineSeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: strategy + type: + namedType: io.k8s.api.apps.v1.DeploymentStrategy + default: {} + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} +- name: io.k8s.api.apps.v1.DeploymentStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1.DeploymentCondition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: unavailableReplicas + type: + scalar: numeric + - name: updatedReplicas + type: + scalar: numeric +- name: io.k8s.api.apps.v1.DeploymentStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.apps.v1.RollingUpdateDeployment + - name: type + type: + scalar: string +- name: io.k8s.api.apps.v1.ReplicaSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1.ReplicaSetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1.ReplicaSetStatus + default: {} +- name: io.k8s.api.apps.v1.ReplicaSetCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1.ReplicaSetSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} +- name: io.k8s.api.apps.v1.ReplicaSetStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1.ReplicaSetCondition + elementRelationship: associative + keys: + - type + - name: fullyLabeledReplicas + type: + scalar: numeric + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + default: 0 +- name: io.k8s.api.apps.v1.RollingUpdateDaemonSet + map: + fields: + - name: maxSurge + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: maxUnavailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString +- name: io.k8s.api.apps.v1.RollingUpdateDeployment + map: + fields: + - name: maxSurge + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: maxUnavailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString +- name: io.k8s.api.apps.v1.RollingUpdateStatefulSetStrategy + map: + fields: + - name: partition + type: + scalar: numeric +- name: io.k8s.api.apps.v1.StatefulSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1.StatefulSetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1.StatefulSetStatus + default: {} +- name: io.k8s.api.apps.v1.StatefulSetCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1.StatefulSetSpec + map: + fields: + - name: podManagementPolicy + type: + scalar: string + - name: replicas + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: serviceName + type: + scalar: string + default: "" + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} + - name: updateStrategy + type: + namedType: io.k8s.api.apps.v1.StatefulSetUpdateStrategy + default: {} + - name: volumeClaimTemplates + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PersistentVolumeClaim + elementRelationship: atomic +- name: io.k8s.api.apps.v1.StatefulSetStatus + map: + fields: + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1.StatefulSetCondition + elementRelationship: associative + keys: + - type + - name: currentReplicas + type: + scalar: numeric + - name: currentRevision + type: + scalar: string + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + default: 0 + - name: updateRevision + type: + scalar: string + - name: updatedReplicas + type: + scalar: numeric +- name: io.k8s.api.apps.v1.StatefulSetUpdateStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.apps.v1.RollingUpdateStatefulSetStrategy + - name: type + type: + scalar: string +- name: io.k8s.api.apps.v1beta1.ControllerRevision + map: + fields: + - name: apiVersion + type: + scalar: string + - name: data + type: + namedType: __untyped_atomic_ + default: {} + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: revision + type: + scalar: numeric + default: 0 +- name: io.k8s.api.apps.v1beta1.Deployment + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1beta1.DeploymentSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1beta1.DeploymentStatus + default: {} +- name: io.k8s.api.apps.v1beta1.DeploymentCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastUpdateTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1beta1.DeploymentSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: paused + type: + scalar: boolean + - name: progressDeadlineSeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: rollbackTo + type: + namedType: io.k8s.api.apps.v1beta1.RollbackConfig + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: strategy + type: + namedType: io.k8s.api.apps.v1beta1.DeploymentStrategy + default: {} + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} +- name: io.k8s.api.apps.v1beta1.DeploymentStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1beta1.DeploymentCondition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: unavailableReplicas + type: + scalar: numeric + - name: updatedReplicas + type: + scalar: numeric +- name: io.k8s.api.apps.v1beta1.DeploymentStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.apps.v1beta1.RollingUpdateDeployment + - name: type + type: + scalar: string +- name: io.k8s.api.apps.v1beta1.RollbackConfig + map: + fields: + - name: revision + type: + scalar: numeric +- name: io.k8s.api.apps.v1beta1.RollingUpdateDeployment + map: + fields: + - name: maxSurge + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: maxUnavailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString +- name: io.k8s.api.apps.v1beta1.RollingUpdateStatefulSetStrategy + map: + fields: + - name: partition + type: + scalar: numeric +- name: io.k8s.api.apps.v1beta1.StatefulSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1beta1.StatefulSetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1beta1.StatefulSetStatus + default: {} +- name: io.k8s.api.apps.v1beta1.StatefulSetCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1beta1.StatefulSetSpec + map: + fields: + - name: podManagementPolicy + type: + scalar: string + - name: replicas + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: serviceName + type: + scalar: string + default: "" + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} + - name: updateStrategy + type: + namedType: io.k8s.api.apps.v1beta1.StatefulSetUpdateStrategy + default: {} + - name: volumeClaimTemplates + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PersistentVolumeClaim + elementRelationship: atomic +- name: io.k8s.api.apps.v1beta1.StatefulSetStatus + map: + fields: + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1beta1.StatefulSetCondition + elementRelationship: associative + keys: + - type + - name: currentReplicas + type: + scalar: numeric + - name: currentRevision + type: + scalar: string + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + default: 0 + - name: updateRevision + type: + scalar: string + - name: updatedReplicas + type: + scalar: numeric +- name: io.k8s.api.apps.v1beta1.StatefulSetUpdateStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.apps.v1beta1.RollingUpdateStatefulSetStrategy + - name: type + type: + scalar: string +- name: io.k8s.api.apps.v1beta2.ControllerRevision + map: + fields: + - name: apiVersion + type: + scalar: string + - name: data + type: + namedType: __untyped_atomic_ + default: {} + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: revision + type: + scalar: numeric + default: 0 +- name: io.k8s.api.apps.v1beta2.DaemonSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1beta2.DaemonSetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1beta2.DaemonSetStatus + default: {} +- name: io.k8s.api.apps.v1beta2.DaemonSetCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1beta2.DaemonSetSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} + - name: updateStrategy + type: + namedType: io.k8s.api.apps.v1beta2.DaemonSetUpdateStrategy + default: {} +- name: io.k8s.api.apps.v1beta2.DaemonSetStatus + map: + fields: + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1beta2.DaemonSetCondition + elementRelationship: associative + keys: + - type + - name: currentNumberScheduled + type: + scalar: numeric + default: 0 + - name: desiredNumberScheduled + type: + scalar: numeric + default: 0 + - name: numberAvailable + type: + scalar: numeric + - name: numberMisscheduled + type: + scalar: numeric + default: 0 + - name: numberReady + type: + scalar: numeric + default: 0 + - name: numberUnavailable + type: + scalar: numeric + - name: observedGeneration + type: + scalar: numeric + - name: updatedNumberScheduled + type: + scalar: numeric +- name: io.k8s.api.apps.v1beta2.DaemonSetUpdateStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.apps.v1beta2.RollingUpdateDaemonSet + - name: type + type: + scalar: string +- name: io.k8s.api.apps.v1beta2.Deployment + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1beta2.DeploymentSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1beta2.DeploymentStatus + default: {} +- name: io.k8s.api.apps.v1beta2.DeploymentCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastUpdateTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1beta2.DeploymentSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: paused + type: + scalar: boolean + - name: progressDeadlineSeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: strategy + type: + namedType: io.k8s.api.apps.v1beta2.DeploymentStrategy + default: {} + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} +- name: io.k8s.api.apps.v1beta2.DeploymentStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1beta2.DeploymentCondition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: unavailableReplicas + type: + scalar: numeric + - name: updatedReplicas + type: + scalar: numeric +- name: io.k8s.api.apps.v1beta2.DeploymentStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.apps.v1beta2.RollingUpdateDeployment + - name: type + type: + scalar: string +- name: io.k8s.api.apps.v1beta2.ReplicaSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1beta2.ReplicaSetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1beta2.ReplicaSetStatus + default: {} +- name: io.k8s.api.apps.v1beta2.ReplicaSetCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1beta2.ReplicaSetSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} +- name: io.k8s.api.apps.v1beta2.ReplicaSetStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1beta2.ReplicaSetCondition + elementRelationship: associative + keys: + - type + - name: fullyLabeledReplicas + type: + scalar: numeric + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + default: 0 +- name: io.k8s.api.apps.v1beta2.RollingUpdateDaemonSet + map: + fields: + - name: maxSurge + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: maxUnavailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString +- name: io.k8s.api.apps.v1beta2.RollingUpdateDeployment + map: + fields: + - name: maxSurge + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: maxUnavailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString +- name: io.k8s.api.apps.v1beta2.RollingUpdateStatefulSetStrategy + map: + fields: + - name: partition + type: + scalar: numeric +- name: io.k8s.api.apps.v1beta2.StatefulSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.apps.v1beta2.StatefulSetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.apps.v1beta2.StatefulSetStatus + default: {} +- name: io.k8s.api.apps.v1beta2.StatefulSetCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.apps.v1beta2.StatefulSetSpec + map: + fields: + - name: podManagementPolicy + type: + scalar: string + - name: replicas + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: serviceName + type: + scalar: string + default: "" + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} + - name: updateStrategy + type: + namedType: io.k8s.api.apps.v1beta2.StatefulSetUpdateStrategy + default: {} + - name: volumeClaimTemplates + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PersistentVolumeClaim + elementRelationship: atomic +- name: io.k8s.api.apps.v1beta2.StatefulSetStatus + map: + fields: + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.apps.v1beta2.StatefulSetCondition + elementRelationship: associative + keys: + - type + - name: currentReplicas + type: + scalar: numeric + - name: currentRevision + type: + scalar: string + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + default: 0 + - name: updateRevision + type: + scalar: string + - name: updatedReplicas + type: + scalar: numeric +- name: io.k8s.api.apps.v1beta2.StatefulSetUpdateStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.apps.v1beta2.RollingUpdateStatefulSetStrategy + - name: type + type: + scalar: string +- name: io.k8s.api.autoscaling.v1.CrossVersionObjectReference + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.autoscaling.v1.HorizontalPodAutoscaler + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerSpec + default: {} + - name: status + type: + namedType: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerStatus + default: {} +- name: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerSpec + map: + fields: + - name: maxReplicas + type: + scalar: numeric + default: 0 + - name: minReplicas + type: + scalar: numeric + - name: scaleTargetRef + type: + namedType: io.k8s.api.autoscaling.v1.CrossVersionObjectReference + default: {} + - name: targetCPUUtilizationPercentage + type: + scalar: numeric +- name: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerStatus + map: + fields: + - name: currentCPUUtilizationPercentage + type: + scalar: numeric + - name: currentReplicas + type: + scalar: numeric + default: 0 + - name: desiredReplicas + type: + scalar: numeric + default: 0 + - name: lastScaleTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: observedGeneration + type: + scalar: numeric +- name: io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricSource + map: + fields: + - name: container + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: targetAverageUtilization + type: + scalar: numeric + - name: targetAverageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricStatus + map: + fields: + - name: container + type: + scalar: string + default: "" + - name: currentAverageUtilization + type: + scalar: numeric + - name: currentAverageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta1.ExternalMetricSource + map: + fields: + - name: metricName + type: + scalar: string + default: "" + - name: metricSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: targetAverageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: targetValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.autoscaling.v2beta1.ExternalMetricStatus + map: + fields: + - name: currentAverageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: currentValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} + - name: metricName + type: + scalar: string + default: "" + - name: metricSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector +- name: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscaler + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerSpec + default: {} + - name: status + type: + namedType: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerStatus + default: {} +- name: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerSpec + map: + fields: + - name: maxReplicas + type: + scalar: numeric + default: 0 + - name: metrics + type: + list: + elementType: + namedType: io.k8s.api.autoscaling.v2beta1.MetricSpec + elementRelationship: atomic + - name: minReplicas + type: + scalar: numeric + - name: scaleTargetRef + type: + namedType: io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference + default: {} +- name: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerCondition + elementRelationship: atomic + - name: currentMetrics + type: + list: + elementType: + namedType: io.k8s.api.autoscaling.v2beta1.MetricStatus + elementRelationship: atomic + - name: currentReplicas + type: + scalar: numeric + default: 0 + - name: desiredReplicas + type: + scalar: numeric + default: 0 + - name: lastScaleTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: observedGeneration + type: + scalar: numeric +- name: io.k8s.api.autoscaling.v2beta1.MetricSpec + map: + fields: + - name: containerResource + type: + namedType: io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricSource + - name: external + type: + namedType: io.k8s.api.autoscaling.v2beta1.ExternalMetricSource + - name: object + type: + namedType: io.k8s.api.autoscaling.v2beta1.ObjectMetricSource + - name: pods + type: + namedType: io.k8s.api.autoscaling.v2beta1.PodsMetricSource + - name: resource + type: + namedType: io.k8s.api.autoscaling.v2beta1.ResourceMetricSource + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta1.MetricStatus + map: + fields: + - name: containerResource + type: + namedType: io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricStatus + - name: external + type: + namedType: io.k8s.api.autoscaling.v2beta1.ExternalMetricStatus + - name: object + type: + namedType: io.k8s.api.autoscaling.v2beta1.ObjectMetricStatus + - name: pods + type: + namedType: io.k8s.api.autoscaling.v2beta1.PodsMetricStatus + - name: resource + type: + namedType: io.k8s.api.autoscaling.v2beta1.ResourceMetricStatus + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta1.ObjectMetricSource + map: + fields: + - name: averageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: metricName + type: + scalar: string + default: "" + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: target + type: + namedType: io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference + default: {} + - name: targetValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} +- name: io.k8s.api.autoscaling.v2beta1.ObjectMetricStatus + map: + fields: + - name: averageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: currentValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} + - name: metricName + type: + scalar: string + default: "" + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: target + type: + namedType: io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference + default: {} +- name: io.k8s.api.autoscaling.v2beta1.PodsMetricSource + map: + fields: + - name: metricName + type: + scalar: string + default: "" + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: targetAverageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} +- name: io.k8s.api.autoscaling.v2beta1.PodsMetricStatus + map: + fields: + - name: currentAverageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} + - name: metricName + type: + scalar: string + default: "" + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector +- name: io.k8s.api.autoscaling.v2beta1.ResourceMetricSource + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: targetAverageUtilization + type: + scalar: numeric + - name: targetAverageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.autoscaling.v2beta1.ResourceMetricStatus + map: + fields: + - name: currentAverageUtilization + type: + scalar: numeric + - name: currentAverageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricSource + map: + fields: + - name: container + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: target + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget + default: {} +- name: io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricStatus + map: + fields: + - name: container + type: + scalar: string + default: "" + - name: current + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus + default: {} + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta2.ExternalMetricSource + map: + fields: + - name: metric + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier + default: {} + - name: target + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget + default: {} +- name: io.k8s.api.autoscaling.v2beta2.ExternalMetricStatus + map: + fields: + - name: current + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus + default: {} + - name: metric + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier + default: {} +- name: io.k8s.api.autoscaling.v2beta2.HPAScalingPolicy + map: + fields: + - name: periodSeconds + type: + scalar: numeric + default: 0 + - name: type + type: + scalar: string + default: "" + - name: value + type: + scalar: numeric + default: 0 +- name: io.k8s.api.autoscaling.v2beta2.HPAScalingRules + map: + fields: + - name: policies + type: + list: + elementType: + namedType: io.k8s.api.autoscaling.v2beta2.HPAScalingPolicy + elementRelationship: atomic + - name: selectPolicy + type: + scalar: string + - name: stabilizationWindowSeconds + type: + scalar: numeric +- name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerSpec + default: {} + - name: status + type: + namedType: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerStatus + default: {} +- name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerBehavior + map: + fields: + - name: scaleDown + type: + namedType: io.k8s.api.autoscaling.v2beta2.HPAScalingRules + - name: scaleUp + type: + namedType: io.k8s.api.autoscaling.v2beta2.HPAScalingRules +- name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerSpec + map: + fields: + - name: behavior + type: + namedType: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerBehavior + - name: maxReplicas + type: + scalar: numeric + default: 0 + - name: metrics + type: + list: + elementType: + namedType: io.k8s.api.autoscaling.v2beta2.MetricSpec + elementRelationship: atomic + - name: minReplicas + type: + scalar: numeric + - name: scaleTargetRef + type: + namedType: io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference + default: {} +- name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerCondition + elementRelationship: atomic + - name: currentMetrics + type: + list: + elementType: + namedType: io.k8s.api.autoscaling.v2beta2.MetricStatus + elementRelationship: atomic + - name: currentReplicas + type: + scalar: numeric + default: 0 + - name: desiredReplicas + type: + scalar: numeric + default: 0 + - name: lastScaleTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: observedGeneration + type: + scalar: numeric +- name: io.k8s.api.autoscaling.v2beta2.MetricIdentifier + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector +- name: io.k8s.api.autoscaling.v2beta2.MetricSpec + map: + fields: + - name: containerResource + type: + namedType: io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricSource + - name: external + type: + namedType: io.k8s.api.autoscaling.v2beta2.ExternalMetricSource + - name: object + type: + namedType: io.k8s.api.autoscaling.v2beta2.ObjectMetricSource + - name: pods + type: + namedType: io.k8s.api.autoscaling.v2beta2.PodsMetricSource + - name: resource + type: + namedType: io.k8s.api.autoscaling.v2beta2.ResourceMetricSource + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta2.MetricStatus + map: + fields: + - name: containerResource + type: + namedType: io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricStatus + - name: external + type: + namedType: io.k8s.api.autoscaling.v2beta2.ExternalMetricStatus + - name: object + type: + namedType: io.k8s.api.autoscaling.v2beta2.ObjectMetricStatus + - name: pods + type: + namedType: io.k8s.api.autoscaling.v2beta2.PodsMetricStatus + - name: resource + type: + namedType: io.k8s.api.autoscaling.v2beta2.ResourceMetricStatus + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.autoscaling.v2beta2.MetricTarget + map: + fields: + - name: averageUtilization + type: + scalar: numeric + - name: averageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: type + type: + scalar: string + default: "" + - name: value + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.autoscaling.v2beta2.MetricValueStatus + map: + fields: + - name: averageUtilization + type: + scalar: numeric + - name: averageValue + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: value + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.autoscaling.v2beta2.ObjectMetricSource + map: + fields: + - name: describedObject + type: + namedType: io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference + default: {} + - name: metric + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier + default: {} + - name: target + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget + default: {} +- name: io.k8s.api.autoscaling.v2beta2.ObjectMetricStatus + map: + fields: + - name: current + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus + default: {} + - name: describedObject + type: + namedType: io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference + default: {} + - name: metric + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier + default: {} +- name: io.k8s.api.autoscaling.v2beta2.PodsMetricSource + map: + fields: + - name: metric + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier + default: {} + - name: target + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget + default: {} +- name: io.k8s.api.autoscaling.v2beta2.PodsMetricStatus + map: + fields: + - name: current + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus + default: {} + - name: metric + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier + default: {} +- name: io.k8s.api.autoscaling.v2beta2.ResourceMetricSource + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: target + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget + default: {} +- name: io.k8s.api.autoscaling.v2beta2.ResourceMetricStatus + map: + fields: + - name: current + type: + namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus + default: {} + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.batch.v1.CronJob + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.batch.v1.CronJobSpec + default: {} + - name: status + type: + namedType: io.k8s.api.batch.v1.CronJobStatus + default: {} +- name: io.k8s.api.batch.v1.CronJobSpec + map: + fields: + - name: concurrencyPolicy + type: + scalar: string + - name: failedJobsHistoryLimit + type: + scalar: numeric + - name: jobTemplate + type: + namedType: io.k8s.api.batch.v1.JobTemplateSpec + default: {} + - name: schedule + type: + scalar: string + default: "" + - name: startingDeadlineSeconds + type: + scalar: numeric + - name: successfulJobsHistoryLimit + type: + scalar: numeric + - name: suspend + type: + scalar: boolean +- name: io.k8s.api.batch.v1.CronJobStatus + map: + fields: + - name: active + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ObjectReference + elementRelationship: atomic + - name: lastScheduleTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: lastSuccessfulTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.api.batch.v1.Job + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.batch.v1.JobSpec + default: {} + - name: status + type: + namedType: io.k8s.api.batch.v1.JobStatus + default: {} +- name: io.k8s.api.batch.v1.JobCondition + map: + fields: + - name: lastProbeTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.batch.v1.JobSpec + map: + fields: + - name: activeDeadlineSeconds + type: + scalar: numeric + - name: backoffLimit + type: + scalar: numeric + - name: completionMode + type: + scalar: string + - name: completions + type: + scalar: numeric + - name: manualSelector + type: + scalar: boolean + - name: parallelism + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: suspend + type: + scalar: boolean + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} + - name: ttlSecondsAfterFinished + type: + scalar: numeric +- name: io.k8s.api.batch.v1.JobStatus + map: + fields: + - name: active + type: + scalar: numeric + - name: completedIndexes + type: + scalar: string + - name: completionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.batch.v1.JobCondition + elementRelationship: atomic + - name: failed + type: + scalar: numeric + - name: startTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: succeeded + type: + scalar: numeric +- name: io.k8s.api.batch.v1.JobTemplateSpec + map: + fields: + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.batch.v1.JobSpec + default: {} +- name: io.k8s.api.batch.v1beta1.CronJob + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.batch.v1beta1.CronJobSpec + default: {} + - name: status + type: + namedType: io.k8s.api.batch.v1beta1.CronJobStatus + default: {} +- name: io.k8s.api.batch.v1beta1.CronJobSpec + map: + fields: + - name: concurrencyPolicy + type: + scalar: string + - name: failedJobsHistoryLimit + type: + scalar: numeric + - name: jobTemplate + type: + namedType: io.k8s.api.batch.v1beta1.JobTemplateSpec + default: {} + - name: schedule + type: + scalar: string + default: "" + - name: startingDeadlineSeconds + type: + scalar: numeric + - name: successfulJobsHistoryLimit + type: + scalar: numeric + - name: suspend + type: + scalar: boolean +- name: io.k8s.api.batch.v1beta1.CronJobStatus + map: + fields: + - name: active + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ObjectReference + elementRelationship: atomic + - name: lastScheduleTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: lastSuccessfulTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.api.batch.v1beta1.JobTemplateSpec + map: + fields: + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.batch.v1.JobSpec + default: {} +- name: io.k8s.api.certificates.v1.CertificateSigningRequest + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.certificates.v1.CertificateSigningRequestSpec + default: {} + - name: status + type: + namedType: io.k8s.api.certificates.v1.CertificateSigningRequestStatus + default: {} +- name: io.k8s.api.certificates.v1.CertificateSigningRequestCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastUpdateTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.certificates.v1.CertificateSigningRequestSpec + map: + fields: + - name: extra + type: + map: + elementType: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: groups + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: request + type: + scalar: string + - name: signerName + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + - name: usages + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: username + type: + scalar: string +- name: io.k8s.api.certificates.v1.CertificateSigningRequestStatus + map: + fields: + - name: certificate + type: + scalar: string + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.certificates.v1.CertificateSigningRequestCondition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.certificates.v1beta1.CertificateSigningRequest + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.certificates.v1beta1.CertificateSigningRequestSpec + default: {} + - name: status + type: + namedType: io.k8s.api.certificates.v1beta1.CertificateSigningRequestStatus + default: {} +- name: io.k8s.api.certificates.v1beta1.CertificateSigningRequestCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastUpdateTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.certificates.v1beta1.CertificateSigningRequestSpec + map: + fields: + - name: extra + type: + map: + elementType: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: groups + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: request + type: + scalar: string + - name: signerName + type: + scalar: string + - name: uid + type: + scalar: string + - name: usages + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: username + type: + scalar: string +- name: io.k8s.api.certificates.v1beta1.CertificateSigningRequestStatus + map: + fields: + - name: certificate + type: + scalar: string + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.certificates.v1beta1.CertificateSigningRequestCondition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.coordination.v1.Lease + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.coordination.v1.LeaseSpec + default: {} +- name: io.k8s.api.coordination.v1.LeaseSpec + map: + fields: + - name: acquireTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + - name: holderIdentity + type: + scalar: string + - name: leaseDurationSeconds + type: + scalar: numeric + - name: leaseTransitions + type: + scalar: numeric + - name: renewTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime +- name: io.k8s.api.coordination.v1beta1.Lease + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.coordination.v1beta1.LeaseSpec + default: {} +- name: io.k8s.api.coordination.v1beta1.LeaseSpec + map: + fields: + - name: acquireTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + - name: holderIdentity + type: + scalar: string + - name: leaseDurationSeconds + type: + scalar: numeric + - name: leaseTransitions + type: + scalar: numeric + - name: renewTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime +- name: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: partition + type: + scalar: numeric + - name: readOnly + type: + scalar: boolean + - name: volumeID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.Affinity + map: + fields: + - name: nodeAffinity + type: + namedType: io.k8s.api.core.v1.NodeAffinity + - name: podAffinity + type: + namedType: io.k8s.api.core.v1.PodAffinity + - name: podAntiAffinity + type: + namedType: io.k8s.api.core.v1.PodAntiAffinity +- name: io.k8s.api.core.v1.AttachedVolume + map: + fields: + - name: devicePath + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.AzureDiskVolumeSource + map: + fields: + - name: cachingMode + type: + scalar: string + - name: diskName + type: + scalar: string + default: "" + - name: diskURI + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: kind + type: + scalar: string + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.AzureFilePersistentVolumeSource + map: + fields: + - name: readOnly + type: + scalar: boolean + - name: secretName + type: + scalar: string + default: "" + - name: secretNamespace + type: + scalar: string + - name: shareName + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.AzureFileVolumeSource + map: + fields: + - name: readOnly + type: + scalar: boolean + - name: secretName + type: + scalar: string + default: "" + - name: shareName + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.CSIPersistentVolumeSource + map: + fields: + - name: controllerExpandSecretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: controllerPublishSecretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: driver + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: nodePublishSecretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: nodeStageSecretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: readOnly + type: + scalar: boolean + - name: volumeAttributes + type: + map: + elementType: + scalar: string + - name: volumeHandle + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.CSIVolumeSource + map: + fields: + - name: driver + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: nodePublishSecretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: readOnly + type: + scalar: boolean + - name: volumeAttributes + type: + map: + elementType: + scalar: string +- name: io.k8s.api.core.v1.Capabilities + map: + fields: + - name: add + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: drop + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.CephFSPersistentVolumeSource + map: + fields: + - name: monitors + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: path + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretFile + type: + scalar: string + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.CephFSVolumeSource + map: + fields: + - name: monitors + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: path + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretFile + type: + scalar: string + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.CinderPersistentVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: volumeID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.CinderVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: volumeID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ClientIPConfig + map: + fields: + - name: timeoutSeconds + type: + scalar: numeric +- name: io.k8s.api.core.v1.ComponentCondition + map: + fields: + - name: error + type: + scalar: string + - name: message + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ComponentStatus + map: + fields: + - name: apiVersion + type: + scalar: string + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ComponentCondition + elementRelationship: associative + keys: + - type + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} +- name: io.k8s.api.core.v1.ConfigMap + map: + fields: + - name: apiVersion + type: + scalar: string + - name: binaryData + type: + map: + elementType: + scalar: string + - name: data + type: + map: + elementType: + scalar: string + - name: immutable + type: + scalar: boolean + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} +- name: io.k8s.api.core.v1.ConfigMapEnvSource + map: + fields: + - name: name + type: + scalar: string + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.ConfigMapKeySelector + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: name + type: + scalar: string + - name: optional + type: + scalar: boolean + elementRelationship: atomic +- name: io.k8s.api.core.v1.ConfigMapNodeConfigSource + map: + fields: + - name: kubeletConfigKey + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" + - name: resourceVersion + type: + scalar: string + - name: uid + type: + scalar: string +- name: io.k8s.api.core.v1.ConfigMapProjection + map: + fields: + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.KeyToPath + elementRelationship: atomic + - name: name + type: + scalar: string + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.ConfigMapVolumeSource + map: + fields: + - name: defaultMode + type: + scalar: numeric + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.KeyToPath + elementRelationship: atomic + - name: name + type: + scalar: string + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.Container + map: + fields: + - name: args + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: command + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: env + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EnvVar + elementRelationship: associative + keys: + - name + - name: envFrom + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EnvFromSource + elementRelationship: atomic + - name: image + type: + scalar: string + - name: imagePullPolicy + type: + scalar: string + - name: lifecycle + type: + namedType: io.k8s.api.core.v1.Lifecycle + - name: livenessProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: name + type: + scalar: string + default: "" + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerPort + elementRelationship: associative + keys: + - containerPort + - protocol + - name: readinessProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: resources + type: + namedType: io.k8s.api.core.v1.ResourceRequirements + default: {} + - name: securityContext + type: + namedType: io.k8s.api.core.v1.SecurityContext + - name: startupProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: stdin + type: + scalar: boolean + - name: stdinOnce + type: + scalar: boolean + - name: terminationMessagePath + type: + scalar: string + - name: terminationMessagePolicy + type: + scalar: string + - name: tty + type: + scalar: boolean + - name: volumeDevices + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeDevice + elementRelationship: associative + keys: + - devicePath + - name: volumeMounts + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeMount + elementRelationship: associative + keys: + - mountPath + - name: workingDir + type: + scalar: string +- name: io.k8s.api.core.v1.ContainerImage + map: + fields: + - name: names + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: sizeBytes + type: + scalar: numeric +- name: io.k8s.api.core.v1.ContainerPort + map: + fields: + - name: containerPort + type: + scalar: numeric + default: 0 + - name: hostIP + type: + scalar: string + - name: hostPort + type: + scalar: numeric + - name: name + type: + scalar: string + - name: protocol + type: + scalar: string + default: TCP +- name: io.k8s.api.core.v1.ContainerState + map: + fields: + - name: running + type: + namedType: io.k8s.api.core.v1.ContainerStateRunning + - name: terminated + type: + namedType: io.k8s.api.core.v1.ContainerStateTerminated + - name: waiting + type: + namedType: io.k8s.api.core.v1.ContainerStateWaiting +- name: io.k8s.api.core.v1.ContainerStateRunning + map: + fields: + - name: startedAt + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} +- name: io.k8s.api.core.v1.ContainerStateTerminated + map: + fields: + - name: containerID + type: + scalar: string + - name: exitCode + type: + scalar: numeric + default: 0 + - name: finishedAt + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: signal + type: + scalar: numeric + - name: startedAt + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} +- name: io.k8s.api.core.v1.ContainerStateWaiting + map: + fields: + - name: message + type: + scalar: string + - name: reason + type: + scalar: string +- name: io.k8s.api.core.v1.ContainerStatus + map: + fields: + - name: containerID + type: + scalar: string + - name: image + type: + scalar: string + default: "" + - name: imageID + type: + scalar: string + default: "" + - name: lastState + type: + namedType: io.k8s.api.core.v1.ContainerState + default: {} + - name: name + type: + scalar: string + default: "" + - name: ready + type: + scalar: boolean + default: false + - name: restartCount + type: + scalar: numeric + default: 0 + - name: started + type: + scalar: boolean + - name: state + type: + namedType: io.k8s.api.core.v1.ContainerState + default: {} +- name: io.k8s.api.core.v1.DaemonEndpoint + map: + fields: + - name: Port + type: + scalar: numeric + default: 0 +- name: io.k8s.api.core.v1.DownwardAPIProjection + map: + fields: + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.DownwardAPIVolumeFile + elementRelationship: atomic +- name: io.k8s.api.core.v1.DownwardAPIVolumeFile + map: + fields: + - name: fieldRef + type: + namedType: io.k8s.api.core.v1.ObjectFieldSelector + - name: mode + type: + scalar: numeric + - name: path + type: + scalar: string + default: "" + - name: resourceFieldRef + type: + namedType: io.k8s.api.core.v1.ResourceFieldSelector +- name: io.k8s.api.core.v1.DownwardAPIVolumeSource + map: + fields: + - name: defaultMode + type: + scalar: numeric + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.DownwardAPIVolumeFile + elementRelationship: atomic +- name: io.k8s.api.core.v1.EmptyDirVolumeSource + map: + fields: + - name: medium + type: + scalar: string + - name: sizeLimit + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.EndpointAddress + map: + fields: + - name: hostname + type: + scalar: string + - name: ip + type: + scalar: string + default: "" + - name: nodeName + type: + scalar: string + - name: targetRef + type: + namedType: io.k8s.api.core.v1.ObjectReference + elementRelationship: atomic +- name: io.k8s.api.core.v1.EndpointPort + map: + fields: + - name: appProtocol + type: + scalar: string + - name: name + type: + scalar: string + - name: port + type: + scalar: numeric + default: 0 + - name: protocol + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.EndpointSubset + map: + fields: + - name: addresses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EndpointAddress + elementRelationship: atomic + - name: notReadyAddresses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EndpointAddress + elementRelationship: atomic + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EndpointPort + elementRelationship: atomic +- name: io.k8s.api.core.v1.Endpoints + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: subsets + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EndpointSubset + elementRelationship: atomic +- name: io.k8s.api.core.v1.EnvFromSource + map: + fields: + - name: configMapRef + type: + namedType: io.k8s.api.core.v1.ConfigMapEnvSource + - name: prefix + type: + scalar: string + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretEnvSource +- name: io.k8s.api.core.v1.EnvVar + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: value + type: + scalar: string + - name: valueFrom + type: + namedType: io.k8s.api.core.v1.EnvVarSource +- name: io.k8s.api.core.v1.EnvVarSource + map: + fields: + - name: configMapKeyRef + type: + namedType: io.k8s.api.core.v1.ConfigMapKeySelector + - name: fieldRef + type: + namedType: io.k8s.api.core.v1.ObjectFieldSelector + - name: resourceFieldRef + type: + namedType: io.k8s.api.core.v1.ResourceFieldSelector + - name: secretKeyRef + type: + namedType: io.k8s.api.core.v1.SecretKeySelector +- name: io.k8s.api.core.v1.EphemeralContainer + map: + fields: + - name: args + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: command + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: env + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EnvVar + elementRelationship: associative + keys: + - name + - name: envFrom + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EnvFromSource + elementRelationship: atomic + - name: image + type: + scalar: string + - name: imagePullPolicy + type: + scalar: string + - name: lifecycle + type: + namedType: io.k8s.api.core.v1.Lifecycle + - name: livenessProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: name + type: + scalar: string + default: "" + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerPort + elementRelationship: atomic + - name: readinessProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: resources + type: + namedType: io.k8s.api.core.v1.ResourceRequirements + default: {} + - name: securityContext + type: + namedType: io.k8s.api.core.v1.SecurityContext + - name: startupProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: stdin + type: + scalar: boolean + - name: stdinOnce + type: + scalar: boolean + - name: targetContainerName + type: + scalar: string + - name: terminationMessagePath + type: + scalar: string + - name: terminationMessagePolicy + type: + scalar: string + - name: tty + type: + scalar: boolean + - name: volumeDevices + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeDevice + elementRelationship: associative + keys: + - devicePath + - name: volumeMounts + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeMount + elementRelationship: associative + keys: + - mountPath + - name: workingDir + type: + scalar: string +- name: io.k8s.api.core.v1.EphemeralVolumeSource + map: + fields: + - name: volumeClaimTemplate + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimTemplate +- name: io.k8s.api.core.v1.Event + map: + fields: + - name: action + type: + scalar: string + - name: apiVersion + type: + scalar: string + - name: count + type: + scalar: numeric + - name: eventTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} + - name: firstTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: involvedObject + type: + namedType: io.k8s.api.core.v1.ObjectReference + default: {} + - name: kind + type: + scalar: string + - name: lastTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: reason + type: + scalar: string + - name: related + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: reportingComponent + type: + scalar: string + default: "" + - name: reportingInstance + type: + scalar: string + default: "" + - name: series + type: + namedType: io.k8s.api.core.v1.EventSeries + - name: source + type: + namedType: io.k8s.api.core.v1.EventSource + default: {} + - name: type + type: + scalar: string +- name: io.k8s.api.core.v1.EventSeries + map: + fields: + - name: count + type: + scalar: numeric + - name: lastObservedTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} +- name: io.k8s.api.core.v1.EventSource + map: + fields: + - name: component + type: + scalar: string + - name: host + type: + scalar: string +- name: io.k8s.api.core.v1.ExecAction + map: + fields: + - name: command + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.FCVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: lun + type: + scalar: numeric + - name: readOnly + type: + scalar: boolean + - name: targetWWNs + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: wwids + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.FlexPersistentVolumeSource + map: + fields: + - name: driver + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: options + type: + map: + elementType: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference +- name: io.k8s.api.core.v1.FlexVolumeSource + map: + fields: + - name: driver + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: options + type: + map: + elementType: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference +- name: io.k8s.api.core.v1.FlockerVolumeSource + map: + fields: + - name: datasetName + type: + scalar: string + - name: datasetUUID + type: + scalar: string +- name: io.k8s.api.core.v1.GCEPersistentDiskVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: partition + type: + scalar: numeric + - name: pdName + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.GitRepoVolumeSource + map: + fields: + - name: directory + type: + scalar: string + - name: repository + type: + scalar: string + default: "" + - name: revision + type: + scalar: string +- name: io.k8s.api.core.v1.GlusterfsPersistentVolumeSource + map: + fields: + - name: endpoints + type: + scalar: string + default: "" + - name: endpointsNamespace + type: + scalar: string + - name: path + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.GlusterfsVolumeSource + map: + fields: + - name: endpoints + type: + scalar: string + default: "" + - name: path + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.HTTPGetAction + map: + fields: + - name: host + type: + scalar: string + - name: httpHeaders + type: + list: + elementType: + namedType: io.k8s.api.core.v1.HTTPHeader + elementRelationship: atomic + - name: path + type: + scalar: string + - name: port + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} + - name: scheme + type: + scalar: string +- name: io.k8s.api.core.v1.HTTPHeader + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: value + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.Handler + map: + fields: + - name: exec + type: + namedType: io.k8s.api.core.v1.ExecAction + - name: httpGet + type: + namedType: io.k8s.api.core.v1.HTTPGetAction + - name: tcpSocket + type: + namedType: io.k8s.api.core.v1.TCPSocketAction +- name: io.k8s.api.core.v1.HostAlias + map: + fields: + - name: hostnames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: ip + type: + scalar: string +- name: io.k8s.api.core.v1.HostPathVolumeSource + map: + fields: + - name: path + type: + scalar: string + default: "" + - name: type + type: + scalar: string +- name: io.k8s.api.core.v1.ISCSIPersistentVolumeSource + map: + fields: + - name: chapAuthDiscovery + type: + scalar: boolean + - name: chapAuthSession + type: + scalar: boolean + - name: fsType + type: + scalar: string + - name: initiatorName + type: + scalar: string + - name: iqn + type: + scalar: string + default: "" + - name: iscsiInterface + type: + scalar: string + - name: lun + type: + scalar: numeric + default: 0 + - name: portals + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: targetPortal + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ISCSIVolumeSource + map: + fields: + - name: chapAuthDiscovery + type: + scalar: boolean + - name: chapAuthSession + type: + scalar: boolean + - name: fsType + type: + scalar: string + - name: initiatorName + type: + scalar: string + - name: iqn + type: + scalar: string + default: "" + - name: iscsiInterface + type: + scalar: string + - name: lun + type: + scalar: numeric + default: 0 + - name: portals + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: targetPortal + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.KeyToPath + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: mode + type: + scalar: numeric + - name: path + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.Lifecycle + map: + fields: + - name: postStart + type: + namedType: io.k8s.api.core.v1.Handler + - name: preStop + type: + namedType: io.k8s.api.core.v1.Handler +- name: io.k8s.api.core.v1.LimitRange + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.LimitRangeSpec + default: {} +- name: io.k8s.api.core.v1.LimitRangeItem + map: + fields: + - name: default + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: defaultRequest + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: max + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: maxLimitRequestRatio + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: min + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.LimitRangeSpec + map: + fields: + - name: limits + type: + list: + elementType: + namedType: io.k8s.api.core.v1.LimitRangeItem + elementRelationship: atomic +- name: io.k8s.api.core.v1.LoadBalancerIngress + map: + fields: + - name: hostname + type: + scalar: string + - name: ip + type: + scalar: string + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PortStatus + elementRelationship: atomic +- name: io.k8s.api.core.v1.LoadBalancerStatus + map: + fields: + - name: ingress + type: + list: + elementType: + namedType: io.k8s.api.core.v1.LoadBalancerIngress + elementRelationship: atomic +- name: io.k8s.api.core.v1.LocalObjectReference + map: + fields: + - name: name + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.LocalVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: path + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NFSVolumeSource + map: + fields: + - name: path + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean + - name: server + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.Namespace + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.NamespaceSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.NamespaceStatus + default: {} +- name: io.k8s.api.core.v1.NamespaceCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NamespaceSpec + map: + fields: + - name: finalizers + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.NamespaceStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NamespaceCondition + elementRelationship: associative + keys: + - type + - name: phase + type: + scalar: string +- name: io.k8s.api.core.v1.Node + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.NodeSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.NodeStatus + default: {} +- name: io.k8s.api.core.v1.NodeAddress + map: + fields: + - name: address + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NodeAffinity + map: + fields: + - name: preferredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PreferredSchedulingTerm + elementRelationship: atomic + - name: requiredDuringSchedulingIgnoredDuringExecution + type: + namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.core.v1.NodeCondition + map: + fields: + - name: lastHeartbeatTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NodeConfigSource + map: + fields: + - name: configMap + type: + namedType: io.k8s.api.core.v1.ConfigMapNodeConfigSource +- name: io.k8s.api.core.v1.NodeConfigStatus + map: + fields: + - name: active + type: + namedType: io.k8s.api.core.v1.NodeConfigSource + - name: assigned + type: + namedType: io.k8s.api.core.v1.NodeConfigSource + - name: error + type: + scalar: string + - name: lastKnownGood + type: + namedType: io.k8s.api.core.v1.NodeConfigSource +- name: io.k8s.api.core.v1.NodeDaemonEndpoints + map: + fields: + - name: kubeletEndpoint + type: + namedType: io.k8s.api.core.v1.DaemonEndpoint + default: {} +- name: io.k8s.api.core.v1.NodeSelector + map: + fields: + - name: nodeSelectorTerms + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeSelectorTerm + elementRelationship: atomic + elementRelationship: atomic +- name: io.k8s.api.core.v1.NodeSelectorRequirement + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: operator + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.NodeSelectorTerm + map: + fields: + - name: matchExpressions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeSelectorRequirement + elementRelationship: atomic + - name: matchFields + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeSelectorRequirement + elementRelationship: atomic + elementRelationship: atomic +- name: io.k8s.api.core.v1.NodeSpec + map: + fields: + - name: configSource + type: + namedType: io.k8s.api.core.v1.NodeConfigSource + - name: externalID + type: + scalar: string + - name: podCIDR + type: + scalar: string + - name: podCIDRs + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: providerID + type: + scalar: string + - name: taints + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Taint + elementRelationship: atomic + - name: unschedulable + type: + scalar: boolean +- name: io.k8s.api.core.v1.NodeStatus + map: + fields: + - name: addresses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeAddress + elementRelationship: associative + keys: + - type + - name: allocatable + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: capacity + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeCondition + elementRelationship: associative + keys: + - type + - name: config + type: + namedType: io.k8s.api.core.v1.NodeConfigStatus + - name: daemonEndpoints + type: + namedType: io.k8s.api.core.v1.NodeDaemonEndpoints + default: {} + - name: images + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerImage + elementRelationship: atomic + - name: nodeInfo + type: + namedType: io.k8s.api.core.v1.NodeSystemInfo + default: {} + - name: phase + type: + scalar: string + - name: volumesAttached + type: + list: + elementType: + namedType: io.k8s.api.core.v1.AttachedVolume + elementRelationship: atomic + - name: volumesInUse + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.NodeSystemInfo + map: + fields: + - name: architecture + type: + scalar: string + default: "" + - name: bootID + type: + scalar: string + default: "" + - name: containerRuntimeVersion + type: + scalar: string + default: "" + - name: kernelVersion + type: + scalar: string + default: "" + - name: kubeProxyVersion + type: + scalar: string + default: "" + - name: kubeletVersion + type: + scalar: string + default: "" + - name: machineID + type: + scalar: string + default: "" + - name: operatingSystem + type: + scalar: string + default: "" + - name: osImage + type: + scalar: string + default: "" + - name: systemUUID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ObjectFieldSelector + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldPath + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.core.v1.ObjectReference + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldPath + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: resourceVersion + type: + scalar: string + - name: uid + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.PersistentVolume + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PersistentVolumeSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.PersistentVolumeStatus + default: {} +- name: io.k8s.api.core.v1.PersistentVolumeClaim + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimStatus + default: {} +- name: io.k8s.api.core.v1.PersistentVolumeClaimCondition + map: + fields: + - name: lastProbeTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PersistentVolumeClaimSpec + map: + fields: + - name: accessModes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: dataSource + type: + namedType: io.k8s.api.core.v1.TypedLocalObjectReference + - name: resources + type: + namedType: io.k8s.api.core.v1.ResourceRequirements + default: {} + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: storageClassName + type: + scalar: string + - name: volumeMode + type: + scalar: string + - name: volumeName + type: + scalar: string +- name: io.k8s.api.core.v1.PersistentVolumeClaimStatus + map: + fields: + - name: accessModes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: capacity + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimCondition + elementRelationship: associative + keys: + - type + - name: phase + type: + scalar: string +- name: io.k8s.api.core.v1.PersistentVolumeClaimTemplate + map: + fields: + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimSpec + default: {} +- name: io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource + map: + fields: + - name: claimName + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.PersistentVolumeSpec + map: + fields: + - name: accessModes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: awsElasticBlockStore + type: + namedType: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource + - name: azureDisk + type: + namedType: io.k8s.api.core.v1.AzureDiskVolumeSource + - name: azureFile + type: + namedType: io.k8s.api.core.v1.AzureFilePersistentVolumeSource + - name: capacity + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: cephfs + type: + namedType: io.k8s.api.core.v1.CephFSPersistentVolumeSource + - name: cinder + type: + namedType: io.k8s.api.core.v1.CinderPersistentVolumeSource + - name: claimRef + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: csi + type: + namedType: io.k8s.api.core.v1.CSIPersistentVolumeSource + - name: fc + type: + namedType: io.k8s.api.core.v1.FCVolumeSource + - name: flexVolume + type: + namedType: io.k8s.api.core.v1.FlexPersistentVolumeSource + - name: flocker + type: + namedType: io.k8s.api.core.v1.FlockerVolumeSource + - name: gcePersistentDisk + type: + namedType: io.k8s.api.core.v1.GCEPersistentDiskVolumeSource + - name: glusterfs + type: + namedType: io.k8s.api.core.v1.GlusterfsPersistentVolumeSource + - name: hostPath + type: + namedType: io.k8s.api.core.v1.HostPathVolumeSource + - name: iscsi + type: + namedType: io.k8s.api.core.v1.ISCSIPersistentVolumeSource + - name: local + type: + namedType: io.k8s.api.core.v1.LocalVolumeSource + - name: mountOptions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: nfs + type: + namedType: io.k8s.api.core.v1.NFSVolumeSource + - name: nodeAffinity + type: + namedType: io.k8s.api.core.v1.VolumeNodeAffinity + - name: persistentVolumeReclaimPolicy + type: + scalar: string + - name: photonPersistentDisk + type: + namedType: io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource + - name: portworxVolume + type: + namedType: io.k8s.api.core.v1.PortworxVolumeSource + - name: quobyte + type: + namedType: io.k8s.api.core.v1.QuobyteVolumeSource + - name: rbd + type: + namedType: io.k8s.api.core.v1.RBDPersistentVolumeSource + - name: scaleIO + type: + namedType: io.k8s.api.core.v1.ScaleIOPersistentVolumeSource + - name: storageClassName + type: + scalar: string + - name: storageos + type: + namedType: io.k8s.api.core.v1.StorageOSPersistentVolumeSource + - name: volumeMode + type: + scalar: string + - name: vsphereVolume + type: + namedType: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource +- name: io.k8s.api.core.v1.PersistentVolumeStatus + map: + fields: + - name: message + type: + scalar: string + - name: phase + type: + scalar: string + - name: reason + type: + scalar: string +- name: io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: pdID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.Pod + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PodSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.PodStatus + default: {} +- name: io.k8s.api.core.v1.PodAffinity + map: + fields: + - name: preferredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.WeightedPodAffinityTerm + elementRelationship: atomic + - name: requiredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodAffinityTerm + elementRelationship: atomic +- name: io.k8s.api.core.v1.PodAffinityTerm + map: + fields: + - name: labelSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: namespaces + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: topologyKey + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PodAntiAffinity + map: + fields: + - name: preferredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.WeightedPodAffinityTerm + elementRelationship: atomic + - name: requiredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodAffinityTerm + elementRelationship: atomic +- name: io.k8s.api.core.v1.PodCondition + map: + fields: + - name: lastProbeTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PodDNSConfig + map: + fields: + - name: nameservers + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: options + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodDNSConfigOption + elementRelationship: atomic + - name: searches + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.PodDNSConfigOption + map: + fields: + - name: name + type: + scalar: string + - name: value + type: + scalar: string +- name: io.k8s.api.core.v1.PodIP + map: + fields: + - name: ip + type: + scalar: string +- name: io.k8s.api.core.v1.PodReadinessGate + map: + fields: + - name: conditionType + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PodSecurityContext + map: + fields: + - name: fsGroup + type: + scalar: numeric + - name: fsGroupChangePolicy + type: + scalar: string + - name: runAsGroup + type: + scalar: numeric + - name: runAsNonRoot + type: + scalar: boolean + - name: runAsUser + type: + scalar: numeric + - name: seLinuxOptions + type: + namedType: io.k8s.api.core.v1.SELinuxOptions + - name: seccompProfile + type: + namedType: io.k8s.api.core.v1.SeccompProfile + - name: supplementalGroups + type: + list: + elementType: + scalar: numeric + elementRelationship: atomic + - name: sysctls + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Sysctl + elementRelationship: atomic + - name: windowsOptions + type: + namedType: io.k8s.api.core.v1.WindowsSecurityContextOptions +- name: io.k8s.api.core.v1.PodSpec + map: + fields: + - name: activeDeadlineSeconds + type: + scalar: numeric + - name: affinity + type: + namedType: io.k8s.api.core.v1.Affinity + - name: automountServiceAccountToken + type: + scalar: boolean + - name: containers + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Container + elementRelationship: associative + keys: + - name + - name: dnsConfig + type: + namedType: io.k8s.api.core.v1.PodDNSConfig + - name: dnsPolicy + type: + scalar: string + - name: enableServiceLinks + type: + scalar: boolean + - name: ephemeralContainers + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EphemeralContainer + elementRelationship: associative + keys: + - name + - name: hostAliases + type: + list: + elementType: + namedType: io.k8s.api.core.v1.HostAlias + elementRelationship: associative + keys: + - ip + - name: hostIPC + type: + scalar: boolean + - name: hostNetwork + type: + scalar: boolean + - name: hostPID + type: + scalar: boolean + - name: hostname + type: + scalar: string + - name: imagePullSecrets + type: + list: + elementType: + namedType: io.k8s.api.core.v1.LocalObjectReference + elementRelationship: associative + keys: + - name + - name: initContainers + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Container + elementRelationship: associative + keys: + - name + - name: nodeName + type: + scalar: string + - name: nodeSelector + type: + map: + elementType: + scalar: string + elementRelationship: atomic + - name: overhead + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: readinessGates + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodReadinessGate + elementRelationship: atomic + - name: restartPolicy + type: + scalar: string + - name: runtimeClassName + type: + scalar: string + - name: schedulerName + type: + scalar: string + - name: securityContext + type: + namedType: io.k8s.api.core.v1.PodSecurityContext + - name: serviceAccount + type: + scalar: string + - name: serviceAccountName + type: + scalar: string + - name: setHostnameAsFQDN + type: + scalar: boolean + - name: shareProcessNamespace + type: + scalar: boolean + - name: subdomain + type: + scalar: string + - name: terminationGracePeriodSeconds + type: + scalar: numeric + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Toleration + elementRelationship: atomic + - name: topologySpreadConstraints + type: + list: + elementType: + namedType: io.k8s.api.core.v1.TopologySpreadConstraint + elementRelationship: associative + keys: + - topologyKey + - whenUnsatisfiable + - name: volumes + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Volume + elementRelationship: associative + keys: + - name +- name: io.k8s.api.core.v1.PodStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodCondition + elementRelationship: associative + keys: + - type + - name: containerStatuses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerStatus + elementRelationship: atomic + - name: ephemeralContainerStatuses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerStatus + elementRelationship: atomic + - name: hostIP + type: + scalar: string + - name: initContainerStatuses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerStatus + elementRelationship: atomic + - name: message + type: + scalar: string + - name: nominatedNodeName + type: + scalar: string + - name: phase + type: + scalar: string + - name: podIP + type: + scalar: string + - name: podIPs + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodIP + elementRelationship: associative + keys: + - ip + - name: qosClass + type: + scalar: string + - name: reason + type: + scalar: string + - name: startTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.api.core.v1.PodTemplate + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} +- name: io.k8s.api.core.v1.PodTemplateSpec + map: + fields: + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PodSpec + default: {} +- name: io.k8s.api.core.v1.PortStatus + map: + fields: + - name: error + type: + scalar: string + - name: port + type: + scalar: numeric + default: 0 + - name: protocol + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PortworxVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: volumeID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PreferredSchedulingTerm + map: + fields: + - name: preference + type: + namedType: io.k8s.api.core.v1.NodeSelectorTerm + default: {} + - name: weight + type: + scalar: numeric + default: 0 +- name: io.k8s.api.core.v1.Probe + map: + fields: + - name: exec + type: + namedType: io.k8s.api.core.v1.ExecAction + - name: failureThreshold + type: + scalar: numeric + - name: httpGet + type: + namedType: io.k8s.api.core.v1.HTTPGetAction + - name: initialDelaySeconds + type: + scalar: numeric + - name: periodSeconds + type: + scalar: numeric + - name: successThreshold + type: + scalar: numeric + - name: tcpSocket + type: + namedType: io.k8s.api.core.v1.TCPSocketAction + - name: terminationGracePeriodSeconds + type: + scalar: numeric + - name: timeoutSeconds + type: + scalar: numeric +- name: io.k8s.api.core.v1.ProjectedVolumeSource + map: + fields: + - name: defaultMode + type: + scalar: numeric + - name: sources + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeProjection + elementRelationship: atomic +- name: io.k8s.api.core.v1.QuobyteVolumeSource + map: + fields: + - name: group + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: registry + type: + scalar: string + default: "" + - name: tenant + type: + scalar: string + - name: user + type: + scalar: string + - name: volume + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.RBDPersistentVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: image + type: + scalar: string + default: "" + - name: keyring + type: + scalar: string + - name: monitors + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: pool + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.RBDVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: image + type: + scalar: string + default: "" + - name: keyring + type: + scalar: string + - name: monitors + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: pool + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.ReplicationController + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.ReplicationControllerSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.ReplicationControllerStatus + default: {} +- name: io.k8s.api.core.v1.ReplicationControllerCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ReplicationControllerSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: selector + type: + map: + elementType: + scalar: string + elementRelationship: atomic + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec +- name: io.k8s.api.core.v1.ReplicationControllerStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ReplicationControllerCondition + elementRelationship: associative + keys: + - type + - name: fullyLabeledReplicas + type: + scalar: numeric + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + default: 0 +- name: io.k8s.api.core.v1.ResourceFieldSelector + map: + fields: + - name: containerName + type: + scalar: string + - name: divisor + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + default: {} + - name: resource + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.core.v1.ResourceQuota + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.ResourceQuotaSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.ResourceQuotaStatus + default: {} +- name: io.k8s.api.core.v1.ResourceQuotaSpec + map: + fields: + - name: hard + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: scopeSelector + type: + namedType: io.k8s.api.core.v1.ScopeSelector + - name: scopes + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.ResourceQuotaStatus + map: + fields: + - name: hard + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: used + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.ResourceRequirements + map: + fields: + - name: limits + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: requests + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.SELinuxOptions + map: + fields: + - name: level + type: + scalar: string + - name: role + type: + scalar: string + - name: type + type: + scalar: string + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.ScaleIOPersistentVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: gateway + type: + scalar: string + default: "" + - name: protectionDomain + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: sslEnabled + type: + scalar: boolean + - name: storageMode + type: + scalar: string + - name: storagePool + type: + scalar: string + - name: system + type: + scalar: string + default: "" + - name: volumeName + type: + scalar: string +- name: io.k8s.api.core.v1.ScaleIOVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: gateway + type: + scalar: string + default: "" + - name: protectionDomain + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: sslEnabled + type: + scalar: boolean + - name: storageMode + type: + scalar: string + - name: storagePool + type: + scalar: string + - name: system + type: + scalar: string + default: "" + - name: volumeName + type: + scalar: string +- name: io.k8s.api.core.v1.ScopeSelector + map: + fields: + - name: matchExpressions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ScopedResourceSelectorRequirement + elementRelationship: atomic + elementRelationship: atomic +- name: io.k8s.api.core.v1.ScopedResourceSelectorRequirement + map: + fields: + - name: operator + type: + scalar: string + default: "" + - name: scopeName + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.SeccompProfile + map: + fields: + - name: localhostProfile + type: + scalar: string + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: localhostProfile + discriminatorValue: LocalhostProfile +- name: io.k8s.api.core.v1.Secret + map: + fields: + - name: apiVersion + type: + scalar: string + - name: data + type: + map: + elementType: + scalar: string + - name: immutable + type: + scalar: boolean + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: stringData + type: + map: + elementType: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.api.core.v1.SecretEnvSource + map: + fields: + - name: name + type: + scalar: string + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.SecretKeySelector + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: name + type: + scalar: string + - name: optional + type: + scalar: boolean + elementRelationship: atomic +- name: io.k8s.api.core.v1.SecretProjection + map: + fields: + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.KeyToPath + elementRelationship: atomic + - name: name + type: + scalar: string + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.SecretReference + map: + fields: + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.SecretVolumeSource + map: + fields: + - name: defaultMode + type: + scalar: numeric + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.KeyToPath + elementRelationship: atomic + - name: optional + type: + scalar: boolean + - name: secretName + type: + scalar: string +- name: io.k8s.api.core.v1.SecurityContext + map: + fields: + - name: allowPrivilegeEscalation + type: + scalar: boolean + - name: capabilities + type: + namedType: io.k8s.api.core.v1.Capabilities + - name: privileged + type: + scalar: boolean + - name: procMount + type: + scalar: string + - name: readOnlyRootFilesystem + type: + scalar: boolean + - name: runAsGroup + type: + scalar: numeric + - name: runAsNonRoot + type: + scalar: boolean + - name: runAsUser + type: + scalar: numeric + - name: seLinuxOptions + type: + namedType: io.k8s.api.core.v1.SELinuxOptions + - name: seccompProfile + type: + namedType: io.k8s.api.core.v1.SeccompProfile + - name: windowsOptions + type: + namedType: io.k8s.api.core.v1.WindowsSecurityContextOptions +- name: io.k8s.api.core.v1.Service + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.ServiceSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.ServiceStatus + default: {} +- name: io.k8s.api.core.v1.ServiceAccount + map: + fields: + - name: apiVersion + type: + scalar: string + - name: automountServiceAccountToken + type: + scalar: boolean + - name: imagePullSecrets + type: + list: + elementType: + namedType: io.k8s.api.core.v1.LocalObjectReference + elementRelationship: atomic + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: secrets + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ObjectReference + elementRelationship: associative + keys: + - name +- name: io.k8s.api.core.v1.ServiceAccountTokenProjection + map: + fields: + - name: audience + type: + scalar: string + - name: expirationSeconds + type: + scalar: numeric + - name: path + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ServicePort + map: + fields: + - name: appProtocol + type: + scalar: string + - name: name + type: + scalar: string + - name: nodePort + type: + scalar: numeric + - name: port + type: + scalar: numeric + default: 0 + - name: protocol + type: + scalar: string + default: TCP + - name: targetPort + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} +- name: io.k8s.api.core.v1.ServiceSpec + map: + fields: + - name: allocateLoadBalancerNodePorts + type: + scalar: boolean + - name: clusterIP + type: + scalar: string + - name: clusterIPs + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: externalIPs + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: externalName + type: + scalar: string + - name: externalTrafficPolicy + type: + scalar: string + - name: healthCheckNodePort + type: + scalar: numeric + - name: internalTrafficPolicy + type: + scalar: string + - name: ipFamilies + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: ipFamilyPolicy + type: + scalar: string + - name: loadBalancerClass + type: + scalar: string + - name: loadBalancerIP + type: + scalar: string + - name: loadBalancerSourceRanges + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ServicePort + elementRelationship: associative + keys: + - port + - protocol + - name: publishNotReadyAddresses + type: + scalar: boolean + - name: selector + type: + map: + elementType: + scalar: string + elementRelationship: atomic + - name: sessionAffinity + type: + scalar: string + - name: sessionAffinityConfig + type: + namedType: io.k8s.api.core.v1.SessionAffinityConfig + - name: topologyKeys + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: type + type: + scalar: string +- name: io.k8s.api.core.v1.ServiceStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: loadBalancer + type: + namedType: io.k8s.api.core.v1.LoadBalancerStatus + default: {} +- name: io.k8s.api.core.v1.SessionAffinityConfig + map: + fields: + - name: clientIP + type: + namedType: io.k8s.api.core.v1.ClientIPConfig +- name: io.k8s.api.core.v1.StorageOSPersistentVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: volumeName + type: + scalar: string + - name: volumeNamespace + type: + scalar: string +- name: io.k8s.api.core.v1.StorageOSVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: volumeName + type: + scalar: string + - name: volumeNamespace + type: + scalar: string +- name: io.k8s.api.core.v1.Sysctl + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: value + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.TCPSocketAction + map: + fields: + - name: host + type: + scalar: string + - name: port + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} +- name: io.k8s.api.core.v1.Taint + map: + fields: + - name: effect + type: + scalar: string + default: "" + - name: key + type: + scalar: string + default: "" + - name: timeAdded + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: value + type: + scalar: string +- name: io.k8s.api.core.v1.Toleration + map: + fields: + - name: effect + type: + scalar: string + - name: key + type: + scalar: string + - name: operator + type: + scalar: string + - name: tolerationSeconds + type: + scalar: numeric + - name: value + type: + scalar: string +- name: io.k8s.api.core.v1.TopologySelectorLabelRequirement + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.TopologySelectorTerm + map: + fields: + - name: matchLabelExpressions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.TopologySelectorLabelRequirement + elementRelationship: atomic + elementRelationship: atomic +- name: io.k8s.api.core.v1.TopologySpreadConstraint + map: + fields: + - name: labelSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: maxSkew + type: + scalar: numeric + default: 0 + - name: topologyKey + type: + scalar: string + default: "" + - name: whenUnsatisfiable + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.TypedLocalObjectReference + map: + fields: + - name: apiGroup + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.core.v1.Volume + map: + fields: + - name: awsElasticBlockStore + type: + namedType: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource + - name: azureDisk + type: + namedType: io.k8s.api.core.v1.AzureDiskVolumeSource + - name: azureFile + type: + namedType: io.k8s.api.core.v1.AzureFileVolumeSource + - name: cephfs + type: + namedType: io.k8s.api.core.v1.CephFSVolumeSource + - name: cinder + type: + namedType: io.k8s.api.core.v1.CinderVolumeSource + - name: configMap + type: + namedType: io.k8s.api.core.v1.ConfigMapVolumeSource + - name: csi + type: + namedType: io.k8s.api.core.v1.CSIVolumeSource + - name: downwardAPI + type: + namedType: io.k8s.api.core.v1.DownwardAPIVolumeSource + - name: emptyDir + type: + namedType: io.k8s.api.core.v1.EmptyDirVolumeSource + - name: ephemeral + type: + namedType: io.k8s.api.core.v1.EphemeralVolumeSource + - name: fc + type: + namedType: io.k8s.api.core.v1.FCVolumeSource + - name: flexVolume + type: + namedType: io.k8s.api.core.v1.FlexVolumeSource + - name: flocker + type: + namedType: io.k8s.api.core.v1.FlockerVolumeSource + - name: gcePersistentDisk + type: + namedType: io.k8s.api.core.v1.GCEPersistentDiskVolumeSource + - name: gitRepo + type: + namedType: io.k8s.api.core.v1.GitRepoVolumeSource + - name: glusterfs + type: + namedType: io.k8s.api.core.v1.GlusterfsVolumeSource + - name: hostPath + type: + namedType: io.k8s.api.core.v1.HostPathVolumeSource + - name: iscsi + type: + namedType: io.k8s.api.core.v1.ISCSIVolumeSource + - name: name + type: + scalar: string + default: "" + - name: nfs + type: + namedType: io.k8s.api.core.v1.NFSVolumeSource + - name: persistentVolumeClaim + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource + - name: photonPersistentDisk + type: + namedType: io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource + - name: portworxVolume + type: + namedType: io.k8s.api.core.v1.PortworxVolumeSource + - name: projected + type: + namedType: io.k8s.api.core.v1.ProjectedVolumeSource + - name: quobyte + type: + namedType: io.k8s.api.core.v1.QuobyteVolumeSource + - name: rbd + type: + namedType: io.k8s.api.core.v1.RBDVolumeSource + - name: scaleIO + type: + namedType: io.k8s.api.core.v1.ScaleIOVolumeSource + - name: secret + type: + namedType: io.k8s.api.core.v1.SecretVolumeSource + - name: storageos + type: + namedType: io.k8s.api.core.v1.StorageOSVolumeSource + - name: vsphereVolume + type: + namedType: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource +- name: io.k8s.api.core.v1.VolumeDevice + map: + fields: + - name: devicePath + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.VolumeMount + map: + fields: + - name: mountPath + type: + scalar: string + default: "" + - name: mountPropagation + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean + - name: subPath + type: + scalar: string + - name: subPathExpr + type: + scalar: string +- name: io.k8s.api.core.v1.VolumeNodeAffinity + map: + fields: + - name: required + type: + namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.core.v1.VolumeProjection + map: + fields: + - name: configMap + type: + namedType: io.k8s.api.core.v1.ConfigMapProjection + - name: downwardAPI + type: + namedType: io.k8s.api.core.v1.DownwardAPIProjection + - name: secret + type: + namedType: io.k8s.api.core.v1.SecretProjection + - name: serviceAccountToken + type: + namedType: io.k8s.api.core.v1.ServiceAccountTokenProjection +- name: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: storagePolicyID + type: + scalar: string + - name: storagePolicyName + type: + scalar: string + - name: volumePath + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.WeightedPodAffinityTerm + map: + fields: + - name: podAffinityTerm + type: + namedType: io.k8s.api.core.v1.PodAffinityTerm + default: {} + - name: weight + type: + scalar: numeric + default: 0 +- name: io.k8s.api.core.v1.WindowsSecurityContextOptions + map: + fields: + - name: gmsaCredentialSpec + type: + scalar: string + - name: gmsaCredentialSpecName + type: + scalar: string + - name: runAsUserName + type: + scalar: string +- name: io.k8s.api.discovery.v1.Endpoint + map: + fields: + - name: addresses + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: conditions + type: + namedType: io.k8s.api.discovery.v1.EndpointConditions + default: {} + - name: deprecatedTopology + type: + map: + elementType: + scalar: string + - name: hints + type: + namedType: io.k8s.api.discovery.v1.EndpointHints + - name: hostname + type: + scalar: string + - name: nodeName + type: + scalar: string + - name: targetRef + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: zone + type: + scalar: string +- name: io.k8s.api.discovery.v1.EndpointConditions + map: + fields: + - name: ready + type: + scalar: boolean + - name: serving + type: + scalar: boolean + - name: terminating + type: + scalar: boolean +- name: io.k8s.api.discovery.v1.EndpointHints + map: + fields: + - name: forZones + type: + list: + elementType: + namedType: io.k8s.api.discovery.v1.ForZone + elementRelationship: atomic +- name: io.k8s.api.discovery.v1.EndpointPort + map: + fields: + - name: appProtocol + type: + scalar: string + - name: name + type: + scalar: string + - name: port + type: + scalar: numeric + - name: protocol + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.discovery.v1.EndpointSlice + map: + fields: + - name: addressType + type: + scalar: string + default: "" + - name: apiVersion + type: + scalar: string + - name: endpoints + type: + list: + elementType: + namedType: io.k8s.api.discovery.v1.Endpoint + elementRelationship: atomic + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.discovery.v1.EndpointPort + elementRelationship: atomic +- name: io.k8s.api.discovery.v1.ForZone + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.discovery.v1beta1.Endpoint + map: + fields: + - name: addresses + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: conditions + type: + namedType: io.k8s.api.discovery.v1beta1.EndpointConditions + default: {} + - name: hints + type: + namedType: io.k8s.api.discovery.v1beta1.EndpointHints + - name: hostname + type: + scalar: string + - name: nodeName + type: + scalar: string + - name: targetRef + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: topology + type: + map: + elementType: + scalar: string +- name: io.k8s.api.discovery.v1beta1.EndpointConditions + map: + fields: + - name: ready + type: + scalar: boolean + - name: serving + type: + scalar: boolean + - name: terminating + type: + scalar: boolean +- name: io.k8s.api.discovery.v1beta1.EndpointHints + map: + fields: + - name: forZones + type: + list: + elementType: + namedType: io.k8s.api.discovery.v1beta1.ForZone + elementRelationship: atomic +- name: io.k8s.api.discovery.v1beta1.EndpointPort + map: + fields: + - name: appProtocol + type: + scalar: string + - name: name + type: + scalar: string + - name: port + type: + scalar: numeric + - name: protocol + type: + scalar: string +- name: io.k8s.api.discovery.v1beta1.EndpointSlice + map: + fields: + - name: addressType + type: + scalar: string + default: "" + - name: apiVersion + type: + scalar: string + - name: endpoints + type: + list: + elementType: + namedType: io.k8s.api.discovery.v1beta1.Endpoint + elementRelationship: atomic + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.discovery.v1beta1.EndpointPort + elementRelationship: atomic +- name: io.k8s.api.discovery.v1beta1.ForZone + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.events.v1.Event + map: + fields: + - name: action + type: + scalar: string + - name: apiVersion + type: + scalar: string + - name: deprecatedCount + type: + scalar: numeric + - name: deprecatedFirstTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: deprecatedLastTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: deprecatedSource + type: + namedType: io.k8s.api.core.v1.EventSource + default: {} + - name: eventTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: note + type: + scalar: string + - name: reason + type: + scalar: string + - name: regarding + type: + namedType: io.k8s.api.core.v1.ObjectReference + default: {} + - name: related + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: reportingController + type: + scalar: string + - name: reportingInstance + type: + scalar: string + - name: series + type: + namedType: io.k8s.api.events.v1.EventSeries + - name: type + type: + scalar: string +- name: io.k8s.api.events.v1.EventSeries + map: + fields: + - name: count + type: + scalar: numeric + default: 0 + - name: lastObservedTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} +- name: io.k8s.api.events.v1beta1.Event + map: + fields: + - name: action + type: + scalar: string + - name: apiVersion + type: + scalar: string + - name: deprecatedCount + type: + scalar: numeric + - name: deprecatedFirstTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: deprecatedLastTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: deprecatedSource + type: + namedType: io.k8s.api.core.v1.EventSource + default: {} + - name: eventTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: note + type: + scalar: string + - name: reason + type: + scalar: string + - name: regarding + type: + namedType: io.k8s.api.core.v1.ObjectReference + default: {} + - name: related + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: reportingController + type: + scalar: string + - name: reportingInstance + type: + scalar: string + - name: series + type: + namedType: io.k8s.api.events.v1beta1.EventSeries + - name: type + type: + scalar: string +- name: io.k8s.api.events.v1beta1.EventSeries + map: + fields: + - name: count + type: + scalar: numeric + default: 0 + - name: lastObservedTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + default: {} +- name: io.k8s.api.extensions.v1beta1.AllowedCSIDriver + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.extensions.v1beta1.AllowedFlexVolume + map: + fields: + - name: driver + type: + scalar: string + default: "" +- name: io.k8s.api.extensions.v1beta1.AllowedHostPath + map: + fields: + - name: pathPrefix + type: + scalar: string + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.extensions.v1beta1.DaemonSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.extensions.v1beta1.DaemonSetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.extensions.v1beta1.DaemonSetStatus + default: {} +- name: io.k8s.api.extensions.v1beta1.DaemonSetCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.extensions.v1beta1.DaemonSetSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} + - name: templateGeneration + type: + scalar: numeric + - name: updateStrategy + type: + namedType: io.k8s.api.extensions.v1beta1.DaemonSetUpdateStrategy + default: {} +- name: io.k8s.api.extensions.v1beta1.DaemonSetStatus + map: + fields: + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.DaemonSetCondition + elementRelationship: associative + keys: + - type + - name: currentNumberScheduled + type: + scalar: numeric + default: 0 + - name: desiredNumberScheduled + type: + scalar: numeric + default: 0 + - name: numberAvailable + type: + scalar: numeric + - name: numberMisscheduled + type: + scalar: numeric + default: 0 + - name: numberReady + type: + scalar: numeric + default: 0 + - name: numberUnavailable + type: + scalar: numeric + - name: observedGeneration + type: + scalar: numeric + - name: updatedNumberScheduled + type: + scalar: numeric +- name: io.k8s.api.extensions.v1beta1.DaemonSetUpdateStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.extensions.v1beta1.RollingUpdateDaemonSet + - name: type + type: + scalar: string +- name: io.k8s.api.extensions.v1beta1.Deployment + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.extensions.v1beta1.DeploymentSpec + default: {} + - name: status + type: + namedType: io.k8s.api.extensions.v1beta1.DeploymentStatus + default: {} +- name: io.k8s.api.extensions.v1beta1.DeploymentCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: lastUpdateTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.extensions.v1beta1.DeploymentSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: paused + type: + scalar: boolean + - name: progressDeadlineSeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: revisionHistoryLimit + type: + scalar: numeric + - name: rollbackTo + type: + namedType: io.k8s.api.extensions.v1beta1.RollbackConfig + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: strategy + type: + namedType: io.k8s.api.extensions.v1beta1.DeploymentStrategy + default: {} + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} +- name: io.k8s.api.extensions.v1beta1.DeploymentStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: collisionCount + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.DeploymentCondition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: unavailableReplicas + type: + scalar: numeric + - name: updatedReplicas + type: + scalar: numeric +- name: io.k8s.api.extensions.v1beta1.DeploymentStrategy + map: + fields: + - name: rollingUpdate + type: + namedType: io.k8s.api.extensions.v1beta1.RollingUpdateDeployment + - name: type + type: + scalar: string +- name: io.k8s.api.extensions.v1beta1.FSGroupStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string +- name: io.k8s.api.extensions.v1beta1.HTTPIngressPath + map: + fields: + - name: backend + type: + namedType: io.k8s.api.extensions.v1beta1.IngressBackend + default: {} + - name: path + type: + scalar: string + - name: pathType + type: + scalar: string +- name: io.k8s.api.extensions.v1beta1.HTTPIngressRuleValue + map: + fields: + - name: paths + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.HTTPIngressPath + elementRelationship: atomic +- name: io.k8s.api.extensions.v1beta1.HostPortRange + map: + fields: + - name: max + type: + scalar: numeric + default: 0 + - name: min + type: + scalar: numeric + default: 0 +- name: io.k8s.api.extensions.v1beta1.IDRange + map: + fields: + - name: max + type: + scalar: numeric + default: 0 + - name: min + type: + scalar: numeric + default: 0 +- name: io.k8s.api.extensions.v1beta1.IPBlock + map: + fields: + - name: cidr + type: + scalar: string + default: "" + - name: except + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.extensions.v1beta1.Ingress + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.extensions.v1beta1.IngressSpec + default: {} + - name: status + type: + namedType: io.k8s.api.extensions.v1beta1.IngressStatus + default: {} +- name: io.k8s.api.extensions.v1beta1.IngressBackend + map: + fields: + - name: resource + type: + namedType: io.k8s.api.core.v1.TypedLocalObjectReference + - name: serviceName + type: + scalar: string + - name: servicePort + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} +- name: io.k8s.api.extensions.v1beta1.IngressRule + map: + fields: + - name: host + type: + scalar: string + - name: http + type: + namedType: io.k8s.api.extensions.v1beta1.HTTPIngressRuleValue +- name: io.k8s.api.extensions.v1beta1.IngressSpec + map: + fields: + - name: backend + type: + namedType: io.k8s.api.extensions.v1beta1.IngressBackend + - name: ingressClassName + type: + scalar: string + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.IngressRule + elementRelationship: atomic + - name: tls + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.IngressTLS + elementRelationship: atomic +- name: io.k8s.api.extensions.v1beta1.IngressStatus + map: + fields: + - name: loadBalancer + type: + namedType: io.k8s.api.core.v1.LoadBalancerStatus + default: {} +- name: io.k8s.api.extensions.v1beta1.IngressTLS + map: + fields: + - name: hosts + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: secretName + type: + scalar: string +- name: io.k8s.api.extensions.v1beta1.NetworkPolicy + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.extensions.v1beta1.NetworkPolicySpec + default: {} +- name: io.k8s.api.extensions.v1beta1.NetworkPolicyEgressRule + map: + fields: + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyPort + elementRelationship: atomic + - name: to + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyPeer + elementRelationship: atomic +- name: io.k8s.api.extensions.v1beta1.NetworkPolicyIngressRule + map: + fields: + - name: from + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyPeer + elementRelationship: atomic + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyPort + elementRelationship: atomic +- name: io.k8s.api.extensions.v1beta1.NetworkPolicyPeer + map: + fields: + - name: ipBlock + type: + namedType: io.k8s.api.extensions.v1beta1.IPBlock + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: podSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector +- name: io.k8s.api.extensions.v1beta1.NetworkPolicyPort + map: + fields: + - name: endPort + type: + scalar: numeric + - name: port + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: protocol + type: + scalar: string +- name: io.k8s.api.extensions.v1beta1.NetworkPolicySpec + map: + fields: + - name: egress + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyEgressRule + elementRelationship: atomic + - name: ingress + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyIngressRule + elementRelationship: atomic + - name: podSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + default: {} + - name: policyTypes + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.extensions.v1beta1.PodSecurityPolicy + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.extensions.v1beta1.PodSecurityPolicySpec + default: {} +- name: io.k8s.api.extensions.v1beta1.PodSecurityPolicySpec + map: + fields: + - name: allowPrivilegeEscalation + type: + scalar: boolean + - name: allowedCSIDrivers + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.AllowedCSIDriver + elementRelationship: atomic + - name: allowedCapabilities + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: allowedFlexVolumes + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.AllowedFlexVolume + elementRelationship: atomic + - name: allowedHostPaths + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.AllowedHostPath + elementRelationship: atomic + - name: allowedProcMountTypes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: allowedUnsafeSysctls + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: defaultAddCapabilities + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: defaultAllowPrivilegeEscalation + type: + scalar: boolean + - name: forbiddenSysctls + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: fsGroup + type: + namedType: io.k8s.api.extensions.v1beta1.FSGroupStrategyOptions + default: {} + - name: hostIPC + type: + scalar: boolean + - name: hostNetwork + type: + scalar: boolean + - name: hostPID + type: + scalar: boolean + - name: hostPorts + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.HostPortRange + elementRelationship: atomic + - name: privileged + type: + scalar: boolean + - name: readOnlyRootFilesystem + type: + scalar: boolean + - name: requiredDropCapabilities + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: runAsGroup + type: + namedType: io.k8s.api.extensions.v1beta1.RunAsGroupStrategyOptions + - name: runAsUser + type: + namedType: io.k8s.api.extensions.v1beta1.RunAsUserStrategyOptions + default: {} + - name: runtimeClass + type: + namedType: io.k8s.api.extensions.v1beta1.RuntimeClassStrategyOptions + - name: seLinux + type: + namedType: io.k8s.api.extensions.v1beta1.SELinuxStrategyOptions + default: {} + - name: supplementalGroups + type: + namedType: io.k8s.api.extensions.v1beta1.SupplementalGroupsStrategyOptions + default: {} + - name: volumes + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.extensions.v1beta1.ReplicaSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.extensions.v1beta1.ReplicaSetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.extensions.v1beta1.ReplicaSetStatus + default: {} +- name: io.k8s.api.extensions.v1beta1.ReplicaSetCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.extensions.v1beta1.ReplicaSetSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} +- name: io.k8s.api.extensions.v1beta1.ReplicaSetStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.ReplicaSetCondition + elementRelationship: associative + keys: + - type + - name: fullyLabeledReplicas + type: + scalar: numeric + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + default: 0 +- name: io.k8s.api.extensions.v1beta1.RollbackConfig + map: + fields: + - name: revision + type: + scalar: numeric +- name: io.k8s.api.extensions.v1beta1.RollingUpdateDaemonSet + map: + fields: + - name: maxSurge + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: maxUnavailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString +- name: io.k8s.api.extensions.v1beta1.RollingUpdateDeployment + map: + fields: + - name: maxSurge + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: maxUnavailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString +- name: io.k8s.api.extensions.v1beta1.RunAsGroupStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string + default: "" +- name: io.k8s.api.extensions.v1beta1.RunAsUserStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string + default: "" +- name: io.k8s.api.extensions.v1beta1.RuntimeClassStrategyOptions + map: + fields: + - name: allowedRuntimeClassNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: defaultRuntimeClassName + type: + scalar: string +- name: io.k8s.api.extensions.v1beta1.SELinuxStrategyOptions + map: + fields: + - name: rule + type: + scalar: string + default: "" + - name: seLinuxOptions + type: + namedType: io.k8s.api.core.v1.SELinuxOptions +- name: io.k8s.api.extensions.v1beta1.SupplementalGroupsStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.extensions.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string +- name: io.k8s.api.flowcontrol.v1alpha1.FlowDistinguisherMethod + map: + fields: + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1alpha1.FlowSchema + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaSpec + default: {} + - name: status + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaStatus + default: {} +- name: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaSpec + map: + fields: + - name: distinguisherMethod + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.FlowDistinguisherMethod + - name: matchingPrecedence + type: + scalar: numeric + default: 0 + - name: priorityLevelConfiguration + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationReference + default: {} + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1alpha1.PolicyRulesWithSubjects + elementRelationship: atomic +- name: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1alpha1.FlowSchemaCondition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.flowcontrol.v1alpha1.GroupSubject + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1alpha1.LimitResponse + map: + fields: + - name: queuing + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.QueuingConfiguration + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: queuing + discriminatorValue: Queuing +- name: io.k8s.api.flowcontrol.v1alpha1.LimitedPriorityLevelConfiguration + map: + fields: + - name: assuredConcurrencyShares + type: + scalar: numeric + default: 0 + - name: limitResponse + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.LimitResponse + default: {} +- name: io.k8s.api.flowcontrol.v1alpha1.NonResourcePolicyRule + map: + fields: + - name: nonResourceURLs + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: verbs + type: + list: + elementType: + scalar: string + elementRelationship: associative +- name: io.k8s.api.flowcontrol.v1alpha1.PolicyRulesWithSubjects + map: + fields: + - name: nonResourceRules + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1alpha1.NonResourcePolicyRule + elementRelationship: atomic + - name: resourceRules + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1alpha1.ResourcePolicyRule + elementRelationship: atomic + - name: subjects + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1alpha1.Subject + elementRelationship: atomic +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfiguration + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationSpec + default: {} + - name: status + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationStatus + default: {} +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationReference + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationSpec + map: + fields: + - name: limited + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.LimitedPriorityLevelConfiguration + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: limited + discriminatorValue: Limited +- name: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1alpha1.PriorityLevelConfigurationCondition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.flowcontrol.v1alpha1.QueuingConfiguration + map: + fields: + - name: handSize + type: + scalar: numeric + default: 0 + - name: queueLengthLimit + type: + scalar: numeric + default: 0 + - name: queues + type: + scalar: numeric + default: 0 +- name: io.k8s.api.flowcontrol.v1alpha1.ResourcePolicyRule + map: + fields: + - name: apiGroups + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: clusterScope + type: + scalar: boolean + - name: namespaces + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: resources + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: verbs + type: + list: + elementType: + scalar: string + elementRelationship: associative +- name: io.k8s.api.flowcontrol.v1alpha1.ServiceAccountSubject + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1alpha1.Subject + map: + fields: + - name: group + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.GroupSubject + - name: kind + type: + scalar: string + default: "" + - name: serviceAccount + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.ServiceAccountSubject + - name: user + type: + namedType: io.k8s.api.flowcontrol.v1alpha1.UserSubject + unions: + - discriminator: kind + fields: + - fieldName: group + discriminatorValue: Group + - fieldName: serviceAccount + discriminatorValue: ServiceAccount + - fieldName: user + discriminatorValue: User +- name: io.k8s.api.flowcontrol.v1alpha1.UserSubject + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1beta1.FlowDistinguisherMethod + map: + fields: + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1beta1.FlowSchema + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.flowcontrol.v1beta1.FlowSchemaSpec + default: {} + - name: status + type: + namedType: io.k8s.api.flowcontrol.v1beta1.FlowSchemaStatus + default: {} +- name: io.k8s.api.flowcontrol.v1beta1.FlowSchemaCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.api.flowcontrol.v1beta1.FlowSchemaSpec + map: + fields: + - name: distinguisherMethod + type: + namedType: io.k8s.api.flowcontrol.v1beta1.FlowDistinguisherMethod + - name: matchingPrecedence + type: + scalar: numeric + default: 0 + - name: priorityLevelConfiguration + type: + namedType: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationReference + default: {} + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1beta1.PolicyRulesWithSubjects + elementRelationship: atomic +- name: io.k8s.api.flowcontrol.v1beta1.FlowSchemaStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1beta1.FlowSchemaCondition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.flowcontrol.v1beta1.GroupSubject + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1beta1.LimitResponse + map: + fields: + - name: queuing + type: + namedType: io.k8s.api.flowcontrol.v1beta1.QueuingConfiguration + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: queuing + discriminatorValue: Queuing +- name: io.k8s.api.flowcontrol.v1beta1.LimitedPriorityLevelConfiguration + map: + fields: + - name: assuredConcurrencyShares + type: + scalar: numeric + default: 0 + - name: limitResponse + type: + namedType: io.k8s.api.flowcontrol.v1beta1.LimitResponse + default: {} +- name: io.k8s.api.flowcontrol.v1beta1.NonResourcePolicyRule + map: + fields: + - name: nonResourceURLs + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: verbs + type: + list: + elementType: + scalar: string + elementRelationship: associative +- name: io.k8s.api.flowcontrol.v1beta1.PolicyRulesWithSubjects + map: + fields: + - name: nonResourceRules + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1beta1.NonResourcePolicyRule + elementRelationship: atomic + - name: resourceRules + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1beta1.ResourcePolicyRule + elementRelationship: atomic + - name: subjects + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1beta1.Subject + elementRelationship: atomic +- name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfiguration + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationSpec + default: {} + - name: status + type: + namedType: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationStatus + default: {} +- name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationReference + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationSpec + map: + fields: + - name: limited + type: + namedType: io.k8s.api.flowcontrol.v1beta1.LimitedPriorityLevelConfiguration + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: limited + discriminatorValue: Limited +- name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationCondition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.flowcontrol.v1beta1.QueuingConfiguration + map: + fields: + - name: handSize + type: + scalar: numeric + default: 0 + - name: queueLengthLimit + type: + scalar: numeric + default: 0 + - name: queues + type: + scalar: numeric + default: 0 +- name: io.k8s.api.flowcontrol.v1beta1.ResourcePolicyRule + map: + fields: + - name: apiGroups + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: clusterScope + type: + scalar: boolean + - name: namespaces + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: resources + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: verbs + type: + list: + elementType: + scalar: string + elementRelationship: associative +- name: io.k8s.api.flowcontrol.v1beta1.ServiceAccountSubject + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1beta1.Subject + map: + fields: + - name: group + type: + namedType: io.k8s.api.flowcontrol.v1beta1.GroupSubject + - name: kind + type: + scalar: string + default: "" + - name: serviceAccount + type: + namedType: io.k8s.api.flowcontrol.v1beta1.ServiceAccountSubject + - name: user + type: + namedType: io.k8s.api.flowcontrol.v1beta1.UserSubject + unions: + - discriminator: kind + fields: + - fieldName: group + discriminatorValue: Group + - fieldName: serviceAccount + discriminatorValue: ServiceAccount + - fieldName: user + discriminatorValue: User +- name: io.k8s.api.flowcontrol.v1beta1.UserSubject + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.imagepolicy.v1alpha1.ImageReview + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.imagepolicy.v1alpha1.ImageReviewSpec + default: {} + - name: status + type: + namedType: io.k8s.api.imagepolicy.v1alpha1.ImageReviewStatus + default: {} +- name: io.k8s.api.imagepolicy.v1alpha1.ImageReviewContainerSpec + map: + fields: + - name: image + type: + scalar: string +- name: io.k8s.api.imagepolicy.v1alpha1.ImageReviewSpec + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: containers + type: + list: + elementType: + namedType: io.k8s.api.imagepolicy.v1alpha1.ImageReviewContainerSpec + elementRelationship: atomic + - name: namespace + type: + scalar: string +- name: io.k8s.api.imagepolicy.v1alpha1.ImageReviewStatus + map: + fields: + - name: allowed + type: + scalar: boolean + default: false + - name: auditAnnotations + type: + map: + elementType: + scalar: string + - name: reason + type: + scalar: string +- name: io.k8s.api.networking.v1.HTTPIngressPath + map: + fields: + - name: backend + type: + namedType: io.k8s.api.networking.v1.IngressBackend + default: {} + - name: path + type: + scalar: string + - name: pathType + type: + scalar: string +- name: io.k8s.api.networking.v1.HTTPIngressRuleValue + map: + fields: + - name: paths + type: + list: + elementType: + namedType: io.k8s.api.networking.v1.HTTPIngressPath + elementRelationship: atomic +- name: io.k8s.api.networking.v1.IPBlock + map: + fields: + - name: cidr + type: + scalar: string + default: "" + - name: except + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.networking.v1.Ingress + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.networking.v1.IngressSpec + default: {} + - name: status + type: + namedType: io.k8s.api.networking.v1.IngressStatus + default: {} +- name: io.k8s.api.networking.v1.IngressBackend + map: + fields: + - name: resource + type: + namedType: io.k8s.api.core.v1.TypedLocalObjectReference + - name: service + type: + namedType: io.k8s.api.networking.v1.IngressServiceBackend +- name: io.k8s.api.networking.v1.IngressClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.networking.v1.IngressClassSpec + default: {} +- name: io.k8s.api.networking.v1.IngressClassParametersReference + map: + fields: + - name: apiGroup + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + - name: scope + type: + scalar: string +- name: io.k8s.api.networking.v1.IngressClassSpec + map: + fields: + - name: controller + type: + scalar: string + - name: parameters + type: + namedType: io.k8s.api.networking.v1.IngressClassParametersReference +- name: io.k8s.api.networking.v1.IngressRule + map: + fields: + - name: host + type: + scalar: string + - name: http + type: + namedType: io.k8s.api.networking.v1.HTTPIngressRuleValue +- name: io.k8s.api.networking.v1.IngressServiceBackend + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: port + type: + namedType: io.k8s.api.networking.v1.ServiceBackendPort + default: {} +- name: io.k8s.api.networking.v1.IngressSpec + map: + fields: + - name: defaultBackend + type: + namedType: io.k8s.api.networking.v1.IngressBackend + - name: ingressClassName + type: + scalar: string + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.networking.v1.IngressRule + elementRelationship: atomic + - name: tls + type: + list: + elementType: + namedType: io.k8s.api.networking.v1.IngressTLS + elementRelationship: atomic +- name: io.k8s.api.networking.v1.IngressStatus + map: + fields: + - name: loadBalancer + type: + namedType: io.k8s.api.core.v1.LoadBalancerStatus + default: {} +- name: io.k8s.api.networking.v1.IngressTLS + map: + fields: + - name: hosts + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: secretName + type: + scalar: string +- name: io.k8s.api.networking.v1.NetworkPolicy + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.networking.v1.NetworkPolicySpec + default: {} +- name: io.k8s.api.networking.v1.NetworkPolicyEgressRule + map: + fields: + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.networking.v1.NetworkPolicyPort + elementRelationship: atomic + - name: to + type: + list: + elementType: + namedType: io.k8s.api.networking.v1.NetworkPolicyPeer + elementRelationship: atomic +- name: io.k8s.api.networking.v1.NetworkPolicyIngressRule + map: + fields: + - name: from + type: + list: + elementType: + namedType: io.k8s.api.networking.v1.NetworkPolicyPeer + elementRelationship: atomic + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.networking.v1.NetworkPolicyPort + elementRelationship: atomic +- name: io.k8s.api.networking.v1.NetworkPolicyPeer + map: + fields: + - name: ipBlock + type: + namedType: io.k8s.api.networking.v1.IPBlock + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: podSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector +- name: io.k8s.api.networking.v1.NetworkPolicyPort + map: + fields: + - name: endPort + type: + scalar: numeric + - name: port + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: protocol + type: + scalar: string +- name: io.k8s.api.networking.v1.NetworkPolicySpec + map: + fields: + - name: egress + type: + list: + elementType: + namedType: io.k8s.api.networking.v1.NetworkPolicyEgressRule + elementRelationship: atomic + - name: ingress + type: + list: + elementType: + namedType: io.k8s.api.networking.v1.NetworkPolicyIngressRule + elementRelationship: atomic + - name: podSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + default: {} + - name: policyTypes + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.networking.v1.ServiceBackendPort + map: + fields: + - name: name + type: + scalar: string + - name: number + type: + scalar: numeric +- name: io.k8s.api.networking.v1beta1.HTTPIngressPath + map: + fields: + - name: backend + type: + namedType: io.k8s.api.networking.v1beta1.IngressBackend + default: {} + - name: path + type: + scalar: string + - name: pathType + type: + scalar: string +- name: io.k8s.api.networking.v1beta1.HTTPIngressRuleValue + map: + fields: + - name: paths + type: + list: + elementType: + namedType: io.k8s.api.networking.v1beta1.HTTPIngressPath + elementRelationship: atomic +- name: io.k8s.api.networking.v1beta1.Ingress + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.networking.v1beta1.IngressSpec + default: {} + - name: status + type: + namedType: io.k8s.api.networking.v1beta1.IngressStatus + default: {} +- name: io.k8s.api.networking.v1beta1.IngressBackend + map: + fields: + - name: resource + type: + namedType: io.k8s.api.core.v1.TypedLocalObjectReference + - name: serviceName + type: + scalar: string + - name: servicePort + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + default: {} +- name: io.k8s.api.networking.v1beta1.IngressClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.networking.v1beta1.IngressClassSpec + default: {} +- name: io.k8s.api.networking.v1beta1.IngressClassParametersReference + map: + fields: + - name: apiGroup + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + - name: scope + type: + scalar: string +- name: io.k8s.api.networking.v1beta1.IngressClassSpec + map: + fields: + - name: controller + type: + scalar: string + - name: parameters + type: + namedType: io.k8s.api.networking.v1beta1.IngressClassParametersReference +- name: io.k8s.api.networking.v1beta1.IngressRule + map: + fields: + - name: host + type: + scalar: string + - name: http + type: + namedType: io.k8s.api.networking.v1beta1.HTTPIngressRuleValue +- name: io.k8s.api.networking.v1beta1.IngressSpec + map: + fields: + - name: backend + type: + namedType: io.k8s.api.networking.v1beta1.IngressBackend + - name: ingressClassName + type: + scalar: string + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.networking.v1beta1.IngressRule + elementRelationship: atomic + - name: tls + type: + list: + elementType: + namedType: io.k8s.api.networking.v1beta1.IngressTLS + elementRelationship: atomic +- name: io.k8s.api.networking.v1beta1.IngressStatus + map: + fields: + - name: loadBalancer + type: + namedType: io.k8s.api.core.v1.LoadBalancerStatus + default: {} +- name: io.k8s.api.networking.v1beta1.IngressTLS + map: + fields: + - name: hosts + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: secretName + type: + scalar: string +- name: io.k8s.api.node.v1.Overhead + map: + fields: + - name: podFixed + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.node.v1.RuntimeClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: handler + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: overhead + type: + namedType: io.k8s.api.node.v1.Overhead + - name: scheduling + type: + namedType: io.k8s.api.node.v1.Scheduling +- name: io.k8s.api.node.v1.Scheduling + map: + fields: + - name: nodeSelector + type: + map: + elementType: + scalar: string + elementRelationship: atomic + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Toleration + elementRelationship: atomic +- name: io.k8s.api.node.v1alpha1.Overhead + map: + fields: + - name: podFixed + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.node.v1alpha1.RuntimeClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.node.v1alpha1.RuntimeClassSpec + default: {} +- name: io.k8s.api.node.v1alpha1.RuntimeClassSpec + map: + fields: + - name: overhead + type: + namedType: io.k8s.api.node.v1alpha1.Overhead + - name: runtimeHandler + type: + scalar: string + default: "" + - name: scheduling + type: + namedType: io.k8s.api.node.v1alpha1.Scheduling +- name: io.k8s.api.node.v1alpha1.Scheduling + map: + fields: + - name: nodeSelector + type: + map: + elementType: + scalar: string + elementRelationship: atomic + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Toleration + elementRelationship: atomic +- name: io.k8s.api.node.v1beta1.Overhead + map: + fields: + - name: podFixed + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.node.v1beta1.RuntimeClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: handler + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: overhead + type: + namedType: io.k8s.api.node.v1beta1.Overhead + - name: scheduling + type: + namedType: io.k8s.api.node.v1beta1.Scheduling +- name: io.k8s.api.node.v1beta1.Scheduling + map: + fields: + - name: nodeSelector + type: + map: + elementType: + scalar: string + elementRelationship: atomic + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Toleration + elementRelationship: atomic +- name: io.k8s.api.policy.v1.Eviction + map: + fields: + - name: apiVersion + type: + scalar: string + - name: deleteOptions + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} +- name: io.k8s.api.policy.v1.PodDisruptionBudget + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.policy.v1.PodDisruptionBudgetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.policy.v1.PodDisruptionBudgetStatus + default: {} +- name: io.k8s.api.policy.v1.PodDisruptionBudgetSpec + map: + fields: + - name: maxUnavailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: minAvailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector +- name: io.k8s.api.policy.v1.PodDisruptionBudgetStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: currentHealthy + type: + scalar: numeric + default: 0 + - name: desiredHealthy + type: + scalar: numeric + default: 0 + - name: disruptedPods + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: disruptionsAllowed + type: + scalar: numeric + default: 0 + - name: expectedPods + type: + scalar: numeric + default: 0 + - name: observedGeneration + type: + scalar: numeric +- name: io.k8s.api.policy.v1beta1.AllowedCSIDriver + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.policy.v1beta1.AllowedFlexVolume + map: + fields: + - name: driver + type: + scalar: string + default: "" +- name: io.k8s.api.policy.v1beta1.AllowedHostPath + map: + fields: + - name: pathPrefix + type: + scalar: string + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.policy.v1beta1.Eviction + map: + fields: + - name: apiVersion + type: + scalar: string + - name: deleteOptions + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} +- name: io.k8s.api.policy.v1beta1.FSGroupStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string +- name: io.k8s.api.policy.v1beta1.HostPortRange + map: + fields: + - name: max + type: + scalar: numeric + default: 0 + - name: min + type: + scalar: numeric + default: 0 +- name: io.k8s.api.policy.v1beta1.IDRange + map: + fields: + - name: max + type: + scalar: numeric + default: 0 + - name: min + type: + scalar: numeric + default: 0 +- name: io.k8s.api.policy.v1beta1.PodDisruptionBudget + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.policy.v1beta1.PodDisruptionBudgetSpec + default: {} + - name: status + type: + namedType: io.k8s.api.policy.v1beta1.PodDisruptionBudgetStatus + default: {} +- name: io.k8s.api.policy.v1beta1.PodDisruptionBudgetSpec + map: + fields: + - name: maxUnavailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: minAvailable + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector +- name: io.k8s.api.policy.v1beta1.PodDisruptionBudgetStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: currentHealthy + type: + scalar: numeric + default: 0 + - name: desiredHealthy + type: + scalar: numeric + default: 0 + - name: disruptedPods + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: disruptionsAllowed + type: + scalar: numeric + default: 0 + - name: expectedPods + type: + scalar: numeric + default: 0 + - name: observedGeneration + type: + scalar: numeric +- name: io.k8s.api.policy.v1beta1.PodSecurityPolicy + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.policy.v1beta1.PodSecurityPolicySpec + default: {} +- name: io.k8s.api.policy.v1beta1.PodSecurityPolicySpec + map: + fields: + - name: allowPrivilegeEscalation + type: + scalar: boolean + - name: allowedCSIDrivers + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.AllowedCSIDriver + elementRelationship: atomic + - name: allowedCapabilities + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: allowedFlexVolumes + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.AllowedFlexVolume + elementRelationship: atomic + - name: allowedHostPaths + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.AllowedHostPath + elementRelationship: atomic + - name: allowedProcMountTypes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: allowedUnsafeSysctls + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: defaultAddCapabilities + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: defaultAllowPrivilegeEscalation + type: + scalar: boolean + - name: forbiddenSysctls + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: fsGroup + type: + namedType: io.k8s.api.policy.v1beta1.FSGroupStrategyOptions + default: {} + - name: hostIPC + type: + scalar: boolean + - name: hostNetwork + type: + scalar: boolean + - name: hostPID + type: + scalar: boolean + - name: hostPorts + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.HostPortRange + elementRelationship: atomic + - name: privileged + type: + scalar: boolean + - name: readOnlyRootFilesystem + type: + scalar: boolean + - name: requiredDropCapabilities + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: runAsGroup + type: + namedType: io.k8s.api.policy.v1beta1.RunAsGroupStrategyOptions + - name: runAsUser + type: + namedType: io.k8s.api.policy.v1beta1.RunAsUserStrategyOptions + default: {} + - name: runtimeClass + type: + namedType: io.k8s.api.policy.v1beta1.RuntimeClassStrategyOptions + - name: seLinux + type: + namedType: io.k8s.api.policy.v1beta1.SELinuxStrategyOptions + default: {} + - name: supplementalGroups + type: + namedType: io.k8s.api.policy.v1beta1.SupplementalGroupsStrategyOptions + default: {} + - name: volumes + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.policy.v1beta1.RunAsGroupStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string + default: "" +- name: io.k8s.api.policy.v1beta1.RunAsUserStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string + default: "" +- name: io.k8s.api.policy.v1beta1.RuntimeClassStrategyOptions + map: + fields: + - name: allowedRuntimeClassNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: defaultRuntimeClassName + type: + scalar: string +- name: io.k8s.api.policy.v1beta1.SELinuxStrategyOptions + map: + fields: + - name: rule + type: + scalar: string + default: "" + - name: seLinuxOptions + type: + namedType: io.k8s.api.core.v1.SELinuxOptions +- name: io.k8s.api.policy.v1beta1.SupplementalGroupsStrategyOptions + map: + fields: + - name: ranges + type: + list: + elementType: + namedType: io.k8s.api.policy.v1beta1.IDRange + elementRelationship: atomic + - name: rule + type: + scalar: string +- name: io.k8s.api.rbac.v1.AggregationRule + map: + fields: + - name: clusterRoleSelectors + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + elementRelationship: atomic +- name: io.k8s.api.rbac.v1.ClusterRole + map: + fields: + - name: aggregationRule + type: + namedType: io.k8s.api.rbac.v1.AggregationRule + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1.PolicyRule + elementRelationship: atomic +- name: io.k8s.api.rbac.v1.ClusterRoleBinding + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: roleRef + type: + namedType: io.k8s.api.rbac.v1.RoleRef + default: {} + - name: subjects + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1.Subject + elementRelationship: atomic +- name: io.k8s.api.rbac.v1.PolicyRule + map: + fields: + - name: apiGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: nonResourceURLs + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resourceNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resources + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: verbs + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.rbac.v1.Role + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1.PolicyRule + elementRelationship: atomic +- name: io.k8s.api.rbac.v1.RoleBinding + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: roleRef + type: + namedType: io.k8s.api.rbac.v1.RoleRef + default: {} + - name: subjects + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1.Subject + elementRelationship: atomic +- name: io.k8s.api.rbac.v1.RoleRef + map: + fields: + - name: apiGroup + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.rbac.v1.Subject + map: + fields: + - name: apiGroup + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.rbac.v1alpha1.AggregationRule + map: + fields: + - name: clusterRoleSelectors + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + elementRelationship: atomic +- name: io.k8s.api.rbac.v1alpha1.ClusterRole + map: + fields: + - name: aggregationRule + type: + namedType: io.k8s.api.rbac.v1alpha1.AggregationRule + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1alpha1.PolicyRule + elementRelationship: atomic +- name: io.k8s.api.rbac.v1alpha1.ClusterRoleBinding + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: roleRef + type: + namedType: io.k8s.api.rbac.v1alpha1.RoleRef + default: {} + - name: subjects + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1alpha1.Subject + elementRelationship: atomic +- name: io.k8s.api.rbac.v1alpha1.PolicyRule + map: + fields: + - name: apiGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: nonResourceURLs + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resourceNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resources + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: verbs + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.rbac.v1alpha1.Role + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1alpha1.PolicyRule + elementRelationship: atomic +- name: io.k8s.api.rbac.v1alpha1.RoleBinding + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: roleRef + type: + namedType: io.k8s.api.rbac.v1alpha1.RoleRef + default: {} + - name: subjects + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1alpha1.Subject + elementRelationship: atomic +- name: io.k8s.api.rbac.v1alpha1.RoleRef + map: + fields: + - name: apiGroup + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.rbac.v1alpha1.Subject + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string +- name: io.k8s.api.rbac.v1beta1.AggregationRule + map: + fields: + - name: clusterRoleSelectors + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + elementRelationship: atomic +- name: io.k8s.api.rbac.v1beta1.ClusterRole + map: + fields: + - name: aggregationRule + type: + namedType: io.k8s.api.rbac.v1beta1.AggregationRule + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1beta1.PolicyRule + elementRelationship: atomic +- name: io.k8s.api.rbac.v1beta1.ClusterRoleBinding + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: roleRef + type: + namedType: io.k8s.api.rbac.v1beta1.RoleRef + default: {} + - name: subjects + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1beta1.Subject + elementRelationship: atomic +- name: io.k8s.api.rbac.v1beta1.PolicyRule + map: + fields: + - name: apiGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: nonResourceURLs + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resourceNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: resources + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: verbs + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.rbac.v1beta1.Role + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1beta1.PolicyRule + elementRelationship: atomic +- name: io.k8s.api.rbac.v1beta1.RoleBinding + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: roleRef + type: + namedType: io.k8s.api.rbac.v1beta1.RoleRef + default: {} + - name: subjects + type: + list: + elementType: + namedType: io.k8s.api.rbac.v1beta1.Subject + elementRelationship: atomic +- name: io.k8s.api.rbac.v1beta1.RoleRef + map: + fields: + - name: apiGroup + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.rbac.v1beta1.Subject + map: + fields: + - name: apiGroup + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string +- name: io.k8s.api.scheduling.v1.PriorityClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: description + type: + scalar: string + - name: globalDefault + type: + scalar: boolean + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: preemptionPolicy + type: + scalar: string + - name: value + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1alpha1.PriorityClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: description + type: + scalar: string + - name: globalDefault + type: + scalar: boolean + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: preemptionPolicy + type: + scalar: string + - name: value + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1beta1.PriorityClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: description + type: + scalar: string + - name: globalDefault + type: + scalar: boolean + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: preemptionPolicy + type: + scalar: string + - name: value + type: + scalar: numeric + default: 0 +- name: io.k8s.api.storage.v1.CSIDriver + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.storage.v1.CSIDriverSpec + default: {} +- name: io.k8s.api.storage.v1.CSIDriverSpec + map: + fields: + - name: attachRequired + type: + scalar: boolean + - name: fsGroupPolicy + type: + scalar: string + - name: podInfoOnMount + type: + scalar: boolean + - name: requiresRepublish + type: + scalar: boolean + - name: storageCapacity + type: + scalar: boolean + - name: tokenRequests + type: + list: + elementType: + namedType: io.k8s.api.storage.v1.TokenRequest + elementRelationship: atomic + - name: volumeLifecycleModes + type: + list: + elementType: + scalar: string + elementRelationship: associative +- name: io.k8s.api.storage.v1.CSINode + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.storage.v1.CSINodeSpec + default: {} +- name: io.k8s.api.storage.v1.CSINodeDriver + map: + fields: + - name: allocatable + type: + namedType: io.k8s.api.storage.v1.VolumeNodeResources + - name: name + type: + scalar: string + default: "" + - name: nodeID + type: + scalar: string + default: "" + - name: topologyKeys + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.storage.v1.CSINodeSpec + map: + fields: + - name: drivers + type: + list: + elementType: + namedType: io.k8s.api.storage.v1.CSINodeDriver + elementRelationship: associative + keys: + - name +- name: io.k8s.api.storage.v1.StorageClass + map: + fields: + - name: allowVolumeExpansion + type: + scalar: boolean + - name: allowedTopologies + type: + list: + elementType: + namedType: io.k8s.api.core.v1.TopologySelectorTerm + elementRelationship: atomic + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: mountOptions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: parameters + type: + map: + elementType: + scalar: string + - name: provisioner + type: + scalar: string + default: "" + - name: reclaimPolicy + type: + scalar: string + - name: volumeBindingMode + type: + scalar: string +- name: io.k8s.api.storage.v1.TokenRequest + map: + fields: + - name: audience + type: + scalar: string + default: "" + - name: expirationSeconds + type: + scalar: numeric +- name: io.k8s.api.storage.v1.VolumeAttachment + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.storage.v1.VolumeAttachmentSpec + default: {} + - name: status + type: + namedType: io.k8s.api.storage.v1.VolumeAttachmentStatus + default: {} +- name: io.k8s.api.storage.v1.VolumeAttachmentSource + map: + fields: + - name: inlineVolumeSpec + type: + namedType: io.k8s.api.core.v1.PersistentVolumeSpec + - name: persistentVolumeName + type: + scalar: string +- name: io.k8s.api.storage.v1.VolumeAttachmentSpec + map: + fields: + - name: attacher + type: + scalar: string + default: "" + - name: nodeName + type: + scalar: string + default: "" + - name: source + type: + namedType: io.k8s.api.storage.v1.VolumeAttachmentSource + default: {} +- name: io.k8s.api.storage.v1.VolumeAttachmentStatus + map: + fields: + - name: attachError + type: + namedType: io.k8s.api.storage.v1.VolumeError + - name: attached + type: + scalar: boolean + default: false + - name: attachmentMetadata + type: + map: + elementType: + scalar: string + - name: detachError + type: + namedType: io.k8s.api.storage.v1.VolumeError +- name: io.k8s.api.storage.v1.VolumeError + map: + fields: + - name: message + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} +- name: io.k8s.api.storage.v1.VolumeNodeResources + map: + fields: + - name: count + type: + scalar: numeric +- name: io.k8s.api.storage.v1alpha1.CSIStorageCapacity + map: + fields: + - name: apiVersion + type: + scalar: string + - name: capacity + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: kind + type: + scalar: string + - name: maximumVolumeSize + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: nodeTopology + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: storageClassName + type: + scalar: string + default: "" +- name: io.k8s.api.storage.v1alpha1.VolumeAttachment + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.storage.v1alpha1.VolumeAttachmentSpec + default: {} + - name: status + type: + namedType: io.k8s.api.storage.v1alpha1.VolumeAttachmentStatus + default: {} +- name: io.k8s.api.storage.v1alpha1.VolumeAttachmentSource + map: + fields: + - name: inlineVolumeSpec + type: + namedType: io.k8s.api.core.v1.PersistentVolumeSpec + - name: persistentVolumeName + type: + scalar: string +- name: io.k8s.api.storage.v1alpha1.VolumeAttachmentSpec + map: + fields: + - name: attacher + type: + scalar: string + default: "" + - name: nodeName + type: + scalar: string + default: "" + - name: source + type: + namedType: io.k8s.api.storage.v1alpha1.VolumeAttachmentSource + default: {} +- name: io.k8s.api.storage.v1alpha1.VolumeAttachmentStatus + map: + fields: + - name: attachError + type: + namedType: io.k8s.api.storage.v1alpha1.VolumeError + - name: attached + type: + scalar: boolean + default: false + - name: attachmentMetadata + type: + map: + elementType: + scalar: string + - name: detachError + type: + namedType: io.k8s.api.storage.v1alpha1.VolumeError +- name: io.k8s.api.storage.v1alpha1.VolumeError + map: + fields: + - name: message + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} +- name: io.k8s.api.storage.v1beta1.CSIDriver + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.storage.v1beta1.CSIDriverSpec + default: {} +- name: io.k8s.api.storage.v1beta1.CSIDriverSpec + map: + fields: + - name: attachRequired + type: + scalar: boolean + - name: fsGroupPolicy + type: + scalar: string + - name: podInfoOnMount + type: + scalar: boolean + - name: requiresRepublish + type: + scalar: boolean + - name: storageCapacity + type: + scalar: boolean + - name: tokenRequests + type: + list: + elementType: + namedType: io.k8s.api.storage.v1beta1.TokenRequest + elementRelationship: atomic + - name: volumeLifecycleModes + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.storage.v1beta1.CSINode + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.storage.v1beta1.CSINodeSpec + default: {} +- name: io.k8s.api.storage.v1beta1.CSINodeDriver + map: + fields: + - name: allocatable + type: + namedType: io.k8s.api.storage.v1beta1.VolumeNodeResources + - name: name + type: + scalar: string + default: "" + - name: nodeID + type: + scalar: string + default: "" + - name: topologyKeys + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.storage.v1beta1.CSINodeSpec + map: + fields: + - name: drivers + type: + list: + elementType: + namedType: io.k8s.api.storage.v1beta1.CSINodeDriver + elementRelationship: associative + keys: + - name +- name: io.k8s.api.storage.v1beta1.CSIStorageCapacity + map: + fields: + - name: apiVersion + type: + scalar: string + - name: capacity + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: kind + type: + scalar: string + - name: maximumVolumeSize + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: nodeTopology + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: storageClassName + type: + scalar: string + default: "" +- name: io.k8s.api.storage.v1beta1.StorageClass + map: + fields: + - name: allowVolumeExpansion + type: + scalar: boolean + - name: allowedTopologies + type: + list: + elementType: + namedType: io.k8s.api.core.v1.TopologySelectorTerm + elementRelationship: atomic + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: mountOptions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: parameters + type: + map: + elementType: + scalar: string + - name: provisioner + type: + scalar: string + default: "" + - name: reclaimPolicy + type: + scalar: string + - name: volumeBindingMode + type: + scalar: string +- name: io.k8s.api.storage.v1beta1.TokenRequest + map: + fields: + - name: audience + type: + scalar: string + default: "" + - name: expirationSeconds + type: + scalar: numeric +- name: io.k8s.api.storage.v1beta1.VolumeAttachment + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.storage.v1beta1.VolumeAttachmentSpec + default: {} + - name: status + type: + namedType: io.k8s.api.storage.v1beta1.VolumeAttachmentStatus + default: {} +- name: io.k8s.api.storage.v1beta1.VolumeAttachmentSource + map: + fields: + - name: inlineVolumeSpec + type: + namedType: io.k8s.api.core.v1.PersistentVolumeSpec + - name: persistentVolumeName + type: + scalar: string +- name: io.k8s.api.storage.v1beta1.VolumeAttachmentSpec + map: + fields: + - name: attacher + type: + scalar: string + default: "" + - name: nodeName + type: + scalar: string + default: "" + - name: source + type: + namedType: io.k8s.api.storage.v1beta1.VolumeAttachmentSource + default: {} +- name: io.k8s.api.storage.v1beta1.VolumeAttachmentStatus + map: + fields: + - name: attachError + type: + namedType: io.k8s.api.storage.v1beta1.VolumeError + - name: attached + type: + scalar: boolean + default: false + - name: attachmentMetadata + type: + map: + elementType: + scalar: string + - name: detachError + type: + namedType: io.k8s.api.storage.v1beta1.VolumeError +- name: io.k8s.api.storage.v1beta1.VolumeError + map: + fields: + - name: message + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} +- name: io.k8s.api.storage.v1beta1.VolumeNodeResources + map: + fields: + - name: count + type: + scalar: numeric +- name: io.k8s.apimachinery.pkg.api.resource.Quantity + scalar: untyped +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + default: "" + - name: observedGeneration + type: + scalar: numeric + - name: reason + type: + scalar: string + default: "" + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions + map: + fields: + - name: apiVersion + type: + scalar: string + - name: dryRun + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: gracePeriodSeconds + type: + scalar: numeric + - name: kind + type: + scalar: string + - name: orphanDependents + type: + scalar: boolean + - name: preconditions + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions + - name: propagationPolicy + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + map: + fields: + - name: matchExpressions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + elementRelationship: atomic + - name: matchLabels + type: + map: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: operator + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldsType + type: + scalar: string + - name: fieldsV1 + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + - name: manager + type: + scalar: string + - name: operation + type: + scalar: string + - name: subresource + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + scalar: untyped +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: clusterName + type: + scalar: string + - name: creationTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: deletionGracePeriodSeconds + type: + scalar: numeric + - name: deletionTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: finalizers + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: generateName + type: + scalar: string + - name: generation + type: + scalar: numeric + - name: labels + type: + map: + elementType: + scalar: string + - name: managedFields + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + elementRelationship: atomic + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: ownerReferences + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + elementRelationship: associative + keys: + - uid + - name: resourceVersion + type: + scalar: string + - name: selfLink + type: + scalar: string + - name: uid + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + map: + fields: + - name: apiVersion + type: + scalar: string + default: "" + - name: blockOwnerDeletion + type: + scalar: boolean + - name: controller + type: + scalar: boolean + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions + map: + fields: + - name: resourceVersion + type: + scalar: string + - name: uid + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Time + scalar: untyped +- name: io.k8s.apimachinery.pkg.runtime.RawExtension + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.util.intstr.IntOrString + scalar: untyped +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/meta/v1/managedfieldsentry.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/meta/v1/managedfieldsentry.go index 919ad9f12cc9..f4d7e2681236 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/meta/v1/managedfieldsentry.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/meta/v1/managedfieldsentry.go @@ -25,12 +25,13 @@ import ( // ManagedFieldsEntryApplyConfiguration represents an declarative configuration of the ManagedFieldsEntry type for use // with apply. type ManagedFieldsEntryApplyConfiguration struct { - Manager *string `json:"manager,omitempty"` - Operation *v1.ManagedFieldsOperationType `json:"operation,omitempty"` - APIVersion *string `json:"apiVersion,omitempty"` - Time *v1.Time `json:"time,omitempty"` - FieldsType *string `json:"fieldsType,omitempty"` - FieldsV1 *v1.FieldsV1 `json:"fieldsV1,omitempty"` + Manager *string `json:"manager,omitempty"` + Operation *v1.ManagedFieldsOperationType `json:"operation,omitempty"` + APIVersion *string `json:"apiVersion,omitempty"` + Time *v1.Time `json:"time,omitempty"` + FieldsType *string `json:"fieldsType,omitempty"` + FieldsV1 *v1.FieldsV1 `json:"fieldsV1,omitempty"` + Subresource *string `json:"subresource,omitempty"` } // ManagedFieldsEntryApplyConfiguration constructs an declarative configuration of the ManagedFieldsEntry type for use with @@ -86,3 +87,11 @@ func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsV1(value v1.FieldsV1) * b.FieldsV1 = &value return b } + +// WithSubresource sets the Subresource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Subresource field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithSubresource(value string) *ManagedFieldsEntryApplyConfiguration { + b.Subresource = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingress.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingress.go index e0bc6103c777..547e65d094ec 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingress.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingress.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apinetworkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Ingress(name, namespace string) *IngressApplyConfiguration { return b } +// ExtractIngress extracts the applied configuration owned by fieldManager from +// ingress. If no managedFields are found in ingress for fieldManager, a +// IngressApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// ingress must be a unmodified Ingress API object that was retrieved from the Kubernetes API. +// ExtractIngress provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractIngress(ingress *apinetworkingv1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { + return extractIngress(ingress, fieldManager, "") +} + +// ExtractIngressStatus is the same as ExtractIngress except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractIngressStatus(ingress *apinetworkingv1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { + return extractIngress(ingress, fieldManager, "status") +} + +func extractIngress(ingress *apinetworkingv1.Ingress, fieldManager string, subresource string) (*IngressApplyConfiguration, error) { + b := &IngressApplyConfiguration{} + err := managedfields.ExtractInto(ingress, internal.Parser().Type("io.k8s.api.networking.v1.Ingress"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(ingress.Name) + b.WithNamespace(ingress.Namespace) + + b.WithKind("Ingress") + b.WithAPIVersion("networking.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressclass.go index de3cdbeeba37..ecf8aa7a5216 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressclass.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apinetworkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func IngressClass(name string) *IngressClassApplyConfiguration { return b } +// ExtractIngressClass extracts the applied configuration owned by fieldManager from +// ingressClass. If no managedFields are found in ingressClass for fieldManager, a +// IngressClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// ingressClass must be a unmodified IngressClass API object that was retrieved from the Kubernetes API. +// ExtractIngressClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractIngressClass(ingressClass *apinetworkingv1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { + return extractIngressClass(ingressClass, fieldManager, "") +} + +// ExtractIngressClassStatus is the same as ExtractIngressClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractIngressClassStatus(ingressClass *apinetworkingv1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { + return extractIngressClass(ingressClass, fieldManager, "status") +} + +func extractIngressClass(ingressClass *apinetworkingv1.IngressClass, fieldManager string, subresource string) (*IngressClassApplyConfiguration, error) { + b := &IngressClassApplyConfiguration{} + err := managedfields.ExtractInto(ingressClass, internal.Parser().Type("io.k8s.api.networking.v1.IngressClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(ingressClass.Name) + + b.WithKind("IngressClass") + b.WithAPIVersion("networking.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/networkpolicy.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/networkpolicy.go index 5d2b6862972a..8287e9ae94e7 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/networkpolicy.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1/networkpolicy.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apinetworkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func NetworkPolicy(name, namespace string) *NetworkPolicyApplyConfiguration { return b } +// ExtractNetworkPolicy extracts the applied configuration owned by fieldManager from +// networkPolicy. If no managedFields are found in networkPolicy for fieldManager, a +// NetworkPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// networkPolicy must be a unmodified NetworkPolicy API object that was retrieved from the Kubernetes API. +// ExtractNetworkPolicy provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractNetworkPolicy(networkPolicy *apinetworkingv1.NetworkPolicy, fieldManager string) (*NetworkPolicyApplyConfiguration, error) { + return extractNetworkPolicy(networkPolicy, fieldManager, "") +} + +// ExtractNetworkPolicyStatus is the same as ExtractNetworkPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractNetworkPolicyStatus(networkPolicy *apinetworkingv1.NetworkPolicy, fieldManager string) (*NetworkPolicyApplyConfiguration, error) { + return extractNetworkPolicy(networkPolicy, fieldManager, "status") +} + +func extractNetworkPolicy(networkPolicy *apinetworkingv1.NetworkPolicy, fieldManager string, subresource string) (*NetworkPolicyApplyConfiguration, error) { + b := &NetworkPolicyApplyConfiguration{} + err := managedfields.ExtractInto(networkPolicy, internal.Parser().Type("io.k8s.api.networking.v1.NetworkPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(networkPolicy.Name) + b.WithNamespace(networkPolicy.Namespace) + + b.WithKind("NetworkPolicy") + b.WithAPIVersion("networking.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingress.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingress.go index df7ac4caf923..425228db8f74 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingress.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingress.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func Ingress(name, namespace string) *IngressApplyConfiguration { return b } +// ExtractIngress extracts the applied configuration owned by fieldManager from +// ingress. If no managedFields are found in ingress for fieldManager, a +// IngressApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// ingress must be a unmodified Ingress API object that was retrieved from the Kubernetes API. +// ExtractIngress provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractIngress(ingress *networkingv1beta1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { + return extractIngress(ingress, fieldManager, "") +} + +// ExtractIngressStatus is the same as ExtractIngress except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractIngressStatus(ingress *networkingv1beta1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { + return extractIngress(ingress, fieldManager, "status") +} + +func extractIngress(ingress *networkingv1beta1.Ingress, fieldManager string, subresource string) (*IngressApplyConfiguration, error) { + b := &IngressApplyConfiguration{} + err := managedfields.ExtractInto(ingress, internal.Parser().Type("io.k8s.api.networking.v1beta1.Ingress"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(ingress.Name) + b.WithNamespace(ingress.Namespace) + + b.WithKind("Ingress") + b.WithAPIVersion("networking.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclass.go index 40c4bb3be40c..89276e4cfa94 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclass.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func IngressClass(name string) *IngressClassApplyConfiguration { return b } +// ExtractIngressClass extracts the applied configuration owned by fieldManager from +// ingressClass. If no managedFields are found in ingressClass for fieldManager, a +// IngressClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// ingressClass must be a unmodified IngressClass API object that was retrieved from the Kubernetes API. +// ExtractIngressClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractIngressClass(ingressClass *networkingv1beta1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { + return extractIngressClass(ingressClass, fieldManager, "") +} + +// ExtractIngressClassStatus is the same as ExtractIngressClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractIngressClassStatus(ingressClass *networkingv1beta1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { + return extractIngressClass(ingressClass, fieldManager, "status") +} + +func extractIngressClass(ingressClass *networkingv1beta1.IngressClass, fieldManager string, subresource string) (*IngressClassApplyConfiguration, error) { + b := &IngressClassApplyConfiguration{} + err := managedfields.ExtractInto(ingressClass, internal.Parser().Type("io.k8s.api.networking.v1beta1.IngressClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(ingressClass.Name) + + b.WithKind("IngressClass") + b.WithAPIVersion("networking.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1/runtimeclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1/runtimeclass.go index ce1d77e0d87b..3c4a94508fac 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1/runtimeclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1/runtimeclass.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apinodev1 "k8s.io/api/node/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,41 @@ func RuntimeClass(name string) *RuntimeClassApplyConfiguration { return b } +// ExtractRuntimeClass extracts the applied configuration owned by fieldManager from +// runtimeClass. If no managedFields are found in runtimeClass for fieldManager, a +// RuntimeClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// runtimeClass must be a unmodified RuntimeClass API object that was retrieved from the Kubernetes API. +// ExtractRuntimeClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractRuntimeClass(runtimeClass *apinodev1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { + return extractRuntimeClass(runtimeClass, fieldManager, "") +} + +// ExtractRuntimeClassStatus is the same as ExtractRuntimeClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractRuntimeClassStatus(runtimeClass *apinodev1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { + return extractRuntimeClass(runtimeClass, fieldManager, "status") +} + +func extractRuntimeClass(runtimeClass *apinodev1.RuntimeClass, fieldManager string, subresource string) (*RuntimeClassApplyConfiguration, error) { + b := &RuntimeClassApplyConfiguration{} + err := managedfields.ExtractInto(runtimeClass, internal.Parser().Type("io.k8s.api.node.v1.RuntimeClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(runtimeClass.Name) + + b.WithKind("RuntimeClass") + b.WithAPIVersion("node.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1alpha1/runtimeclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1alpha1/runtimeclass.go index e1f4d8b069dc..05a0c84757a0 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1alpha1/runtimeclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1alpha1/runtimeclass.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + nodev1alpha1 "k8s.io/api/node/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func RuntimeClass(name string) *RuntimeClassApplyConfiguration { return b } +// ExtractRuntimeClass extracts the applied configuration owned by fieldManager from +// runtimeClass. If no managedFields are found in runtimeClass for fieldManager, a +// RuntimeClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// runtimeClass must be a unmodified RuntimeClass API object that was retrieved from the Kubernetes API. +// ExtractRuntimeClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractRuntimeClass(runtimeClass *nodev1alpha1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { + return extractRuntimeClass(runtimeClass, fieldManager, "") +} + +// ExtractRuntimeClassStatus is the same as ExtractRuntimeClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractRuntimeClassStatus(runtimeClass *nodev1alpha1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { + return extractRuntimeClass(runtimeClass, fieldManager, "status") +} + +func extractRuntimeClass(runtimeClass *nodev1alpha1.RuntimeClass, fieldManager string, subresource string) (*RuntimeClassApplyConfiguration, error) { + b := &RuntimeClassApplyConfiguration{} + err := managedfields.ExtractInto(runtimeClass, internal.Parser().Type("io.k8s.api.node.v1alpha1.RuntimeClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(runtimeClass.Name) + + b.WithKind("RuntimeClass") + b.WithAPIVersion("node.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1beta1/runtimeclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1beta1/runtimeclass.go index 787da5131509..fb5d30e45660 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1beta1/runtimeclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/node/v1beta1/runtimeclass.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + nodev1beta1 "k8s.io/api/node/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,41 @@ func RuntimeClass(name string) *RuntimeClassApplyConfiguration { return b } +// ExtractRuntimeClass extracts the applied configuration owned by fieldManager from +// runtimeClass. If no managedFields are found in runtimeClass for fieldManager, a +// RuntimeClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// runtimeClass must be a unmodified RuntimeClass API object that was retrieved from the Kubernetes API. +// ExtractRuntimeClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractRuntimeClass(runtimeClass *nodev1beta1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { + return extractRuntimeClass(runtimeClass, fieldManager, "") +} + +// ExtractRuntimeClassStatus is the same as ExtractRuntimeClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractRuntimeClassStatus(runtimeClass *nodev1beta1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { + return extractRuntimeClass(runtimeClass, fieldManager, "status") +} + +func extractRuntimeClass(runtimeClass *nodev1beta1.RuntimeClass, fieldManager string, subresource string) (*RuntimeClassApplyConfiguration, error) { + b := &RuntimeClassApplyConfiguration{} + err := managedfields.ExtractInto(runtimeClass, internal.Parser().Type("io.k8s.api.node.v1beta1.RuntimeClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(runtimeClass.Name) + + b.WithKind("RuntimeClass") + b.WithAPIVersion("node.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/eviction.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/eviction.go new file mode 100644 index 000000000000..79b8735fbb7d --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/eviction.go @@ -0,0 +1,267 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + policyv1 "k8s.io/api/policy/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// EvictionApplyConfiguration represents an declarative configuration of the Eviction type for use +// with apply. +type EvictionApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + DeleteOptions *v1.DeleteOptionsApplyConfiguration `json:"deleteOptions,omitempty"` +} + +// Eviction constructs an declarative configuration of the Eviction type for use with +// apply. +func Eviction(name, namespace string) *EvictionApplyConfiguration { + b := &EvictionApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Eviction") + b.WithAPIVersion("policy/v1") + return b +} + +// ExtractEviction extracts the applied configuration owned by fieldManager from +// eviction. If no managedFields are found in eviction for fieldManager, a +// EvictionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// eviction must be a unmodified Eviction API object that was retrieved from the Kubernetes API. +// ExtractEviction provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEviction(eviction *policyv1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { + return extractEviction(eviction, fieldManager, "") +} + +// ExtractEvictionStatus is the same as ExtractEviction except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEvictionStatus(eviction *policyv1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { + return extractEviction(eviction, fieldManager, "status") +} + +func extractEviction(eviction *policyv1.Eviction, fieldManager string, subresource string) (*EvictionApplyConfiguration, error) { + b := &EvictionApplyConfiguration{} + err := managedfields.ExtractInto(eviction, internal.Parser().Type("io.k8s.api.policy.v1.Eviction"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(eviction.Name) + b.WithNamespace(eviction.Namespace) + + b.WithKind("Eviction") + b.WithAPIVersion("policy/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithKind(value string) *EvictionApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithAPIVersion(value string) *EvictionApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithName(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithGenerateName(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithNamespace(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithSelfLink sets the SelfLink field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SelfLink field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithSelfLink(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.SelfLink = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithUID(value types.UID) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithResourceVersion(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithGeneration(value int64) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *EvictionApplyConfiguration) WithLabels(entries map[string]string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *EvictionApplyConfiguration) WithAnnotations(entries map[string]string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *EvictionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *EvictionApplyConfiguration) WithFinalizers(values ...string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithClusterName(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ClusterName = &value + return b +} + +func (b *EvictionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithDeleteOptions sets the DeleteOptions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeleteOptions field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithDeleteOptions(value *v1.DeleteOptionsApplyConfiguration) *EvictionApplyConfiguration { + b.DeleteOptions = value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudget.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudget.go new file mode 100644 index 000000000000..037f265014ed --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudget.go @@ -0,0 +1,276 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apipolicyv1 "k8s.io/api/policy/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PodDisruptionBudgetApplyConfiguration represents an declarative configuration of the PodDisruptionBudget type for use +// with apply. +type PodDisruptionBudgetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PodDisruptionBudgetSpecApplyConfiguration `json:"spec,omitempty"` + Status *PodDisruptionBudgetStatusApplyConfiguration `json:"status,omitempty"` +} + +// PodDisruptionBudget constructs an declarative configuration of the PodDisruptionBudget type for use with +// apply. +func PodDisruptionBudget(name, namespace string) *PodDisruptionBudgetApplyConfiguration { + b := &PodDisruptionBudgetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("PodDisruptionBudget") + b.WithAPIVersion("policy/v1") + return b +} + +// ExtractPodDisruptionBudget extracts the applied configuration owned by fieldManager from +// podDisruptionBudget. If no managedFields are found in podDisruptionBudget for fieldManager, a +// PodDisruptionBudgetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// podDisruptionBudget must be a unmodified PodDisruptionBudget API object that was retrieved from the Kubernetes API. +// ExtractPodDisruptionBudget provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPodDisruptionBudget(podDisruptionBudget *apipolicyv1.PodDisruptionBudget, fieldManager string) (*PodDisruptionBudgetApplyConfiguration, error) { + return extractPodDisruptionBudget(podDisruptionBudget, fieldManager, "") +} + +// ExtractPodDisruptionBudgetStatus is the same as ExtractPodDisruptionBudget except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPodDisruptionBudgetStatus(podDisruptionBudget *apipolicyv1.PodDisruptionBudget, fieldManager string) (*PodDisruptionBudgetApplyConfiguration, error) { + return extractPodDisruptionBudget(podDisruptionBudget, fieldManager, "status") +} + +func extractPodDisruptionBudget(podDisruptionBudget *apipolicyv1.PodDisruptionBudget, fieldManager string, subresource string) (*PodDisruptionBudgetApplyConfiguration, error) { + b := &PodDisruptionBudgetApplyConfiguration{} + err := managedfields.ExtractInto(podDisruptionBudget, internal.Parser().Type("io.k8s.api.policy.v1.PodDisruptionBudget"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(podDisruptionBudget.Name) + b.WithNamespace(podDisruptionBudget.Namespace) + + b.WithKind("PodDisruptionBudget") + b.WithAPIVersion("policy/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithKind(value string) *PodDisruptionBudgetApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithAPIVersion(value string) *PodDisruptionBudgetApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithName(value string) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithGenerateName(value string) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithNamespace(value string) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithSelfLink sets the SelfLink field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SelfLink field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithSelfLink(value string) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.SelfLink = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithUID(value types.UID) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithResourceVersion(value string) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithGeneration(value int64) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PodDisruptionBudgetApplyConfiguration) WithLabels(entries map[string]string) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PodDisruptionBudgetApplyConfiguration) WithAnnotations(entries map[string]string) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PodDisruptionBudgetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PodDisruptionBudgetApplyConfiguration) WithFinalizers(values ...string) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithClusterName(value string) *PodDisruptionBudgetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ClusterName = &value + return b +} + +func (b *PodDisruptionBudgetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithSpec(value *PodDisruptionBudgetSpecApplyConfiguration) *PodDisruptionBudgetApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PodDisruptionBudgetApplyConfiguration) WithStatus(value *PodDisruptionBudgetStatusApplyConfiguration) *PodDisruptionBudgetApplyConfiguration { + b.Status = value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetspec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetspec.go new file mode 100644 index 000000000000..e2f49f528cd4 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetspec.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PodDisruptionBudgetSpecApplyConfiguration represents an declarative configuration of the PodDisruptionBudgetSpec type for use +// with apply. +type PodDisruptionBudgetSpecApplyConfiguration struct { + MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` + Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` + MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` +} + +// PodDisruptionBudgetSpecApplyConfiguration constructs an declarative configuration of the PodDisruptionBudgetSpec type for use with +// apply. +func PodDisruptionBudgetSpec() *PodDisruptionBudgetSpecApplyConfiguration { + return &PodDisruptionBudgetSpecApplyConfiguration{} +} + +// WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinAvailable field is set to the value of the last call. +func (b *PodDisruptionBudgetSpecApplyConfiguration) WithMinAvailable(value intstr.IntOrString) *PodDisruptionBudgetSpecApplyConfiguration { + b.MinAvailable = &value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *PodDisruptionBudgetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *PodDisruptionBudgetSpecApplyConfiguration { + b.Selector = value + return b +} + +// WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxUnavailable field is set to the value of the last call. +func (b *PodDisruptionBudgetSpecApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *PodDisruptionBudgetSpecApplyConfiguration { + b.MaxUnavailable = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetstatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetstatus.go new file mode 100644 index 000000000000..2dd427b9e182 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetstatus.go @@ -0,0 +1,109 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PodDisruptionBudgetStatusApplyConfiguration represents an declarative configuration of the PodDisruptionBudgetStatus type for use +// with apply. +type PodDisruptionBudgetStatusApplyConfiguration struct { + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + DisruptedPods map[string]v1.Time `json:"disruptedPods,omitempty"` + DisruptionsAllowed *int32 `json:"disruptionsAllowed,omitempty"` + CurrentHealthy *int32 `json:"currentHealthy,omitempty"` + DesiredHealthy *int32 `json:"desiredHealthy,omitempty"` + ExpectedPods *int32 `json:"expectedPods,omitempty"` + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// PodDisruptionBudgetStatusApplyConfiguration constructs an declarative configuration of the PodDisruptionBudgetStatus type for use with +// apply. +func PodDisruptionBudgetStatus() *PodDisruptionBudgetStatusApplyConfiguration { + return &PodDisruptionBudgetStatusApplyConfiguration{} +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *PodDisruptionBudgetStatusApplyConfiguration) WithObservedGeneration(value int64) *PodDisruptionBudgetStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithDisruptedPods puts the entries into the DisruptedPods field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the DisruptedPods field, +// overwriting an existing map entries in DisruptedPods field with the same key. +func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptedPods(entries map[string]v1.Time) *PodDisruptionBudgetStatusApplyConfiguration { + if b.DisruptedPods == nil && len(entries) > 0 { + b.DisruptedPods = make(map[string]v1.Time, len(entries)) + } + for k, v := range entries { + b.DisruptedPods[k] = v + } + return b +} + +// WithDisruptionsAllowed sets the DisruptionsAllowed field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisruptionsAllowed field is set to the value of the last call. +func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptionsAllowed(value int32) *PodDisruptionBudgetStatusApplyConfiguration { + b.DisruptionsAllowed = &value + return b +} + +// WithCurrentHealthy sets the CurrentHealthy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CurrentHealthy field is set to the value of the last call. +func (b *PodDisruptionBudgetStatusApplyConfiguration) WithCurrentHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration { + b.CurrentHealthy = &value + return b +} + +// WithDesiredHealthy sets the DesiredHealthy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DesiredHealthy field is set to the value of the last call. +func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDesiredHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration { + b.DesiredHealthy = &value + return b +} + +// WithExpectedPods sets the ExpectedPods field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExpectedPods field is set to the value of the last call. +func (b *PodDisruptionBudgetStatusApplyConfiguration) WithExpectedPods(value int32) *PodDisruptionBudgetStatusApplyConfiguration { + b.ExpectedPods = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *PodDisruptionBudgetStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *PodDisruptionBudgetStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/eviction.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/eviction.go index 4aaeafe1b5e2..5f231b66fec2 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/eviction.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/eviction.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + v1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func Eviction(name, namespace string) *EvictionApplyConfiguration { return b } +// ExtractEviction extracts the applied configuration owned by fieldManager from +// eviction. If no managedFields are found in eviction for fieldManager, a +// EvictionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// eviction must be a unmodified Eviction API object that was retrieved from the Kubernetes API. +// ExtractEviction provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEviction(eviction *v1beta1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { + return extractEviction(eviction, fieldManager, "") +} + +// ExtractEvictionStatus is the same as ExtractEviction except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEvictionStatus(eviction *v1beta1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { + return extractEviction(eviction, fieldManager, "status") +} + +func extractEviction(eviction *v1beta1.Eviction, fieldManager string, subresource string) (*EvictionApplyConfiguration, error) { + b := &EvictionApplyConfiguration{} + err := managedfields.ExtractInto(eviction, internal.Parser().Type("io.k8s.api.policy.v1beta1.Eviction"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(eviction.Name) + b.WithNamespace(eviction.Namespace) + + b.WithKind("Eviction") + b.WithAPIVersion("policy/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudget.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudget.go index 6cb9d03a4c42..b6d125d3390b 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudget.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudget.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func PodDisruptionBudget(name, namespace string) *PodDisruptionBudgetApplyConfig return b } +// ExtractPodDisruptionBudget extracts the applied configuration owned by fieldManager from +// podDisruptionBudget. If no managedFields are found in podDisruptionBudget for fieldManager, a +// PodDisruptionBudgetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// podDisruptionBudget must be a unmodified PodDisruptionBudget API object that was retrieved from the Kubernetes API. +// ExtractPodDisruptionBudget provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPodDisruptionBudget(podDisruptionBudget *policyv1beta1.PodDisruptionBudget, fieldManager string) (*PodDisruptionBudgetApplyConfiguration, error) { + return extractPodDisruptionBudget(podDisruptionBudget, fieldManager, "") +} + +// ExtractPodDisruptionBudgetStatus is the same as ExtractPodDisruptionBudget except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPodDisruptionBudgetStatus(podDisruptionBudget *policyv1beta1.PodDisruptionBudget, fieldManager string) (*PodDisruptionBudgetApplyConfiguration, error) { + return extractPodDisruptionBudget(podDisruptionBudget, fieldManager, "status") +} + +func extractPodDisruptionBudget(podDisruptionBudget *policyv1beta1.PodDisruptionBudget, fieldManager string, subresource string) (*PodDisruptionBudgetApplyConfiguration, error) { + b := &PodDisruptionBudgetApplyConfiguration{} + err := managedfields.ExtractInto(podDisruptionBudget, internal.Parser().Type("io.k8s.api.policy.v1beta1.PodDisruptionBudget"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(podDisruptionBudget.Name) + b.WithNamespace(podDisruptionBudget.Namespace) + + b.WithKind("PodDisruptionBudget") + b.WithAPIVersion("policy/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicy.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicy.go index 41eafed26686..169c2951add7 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicy.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/podsecuritypolicy.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func PodSecurityPolicy(name string) *PodSecurityPolicyApplyConfiguration { return b } +// ExtractPodSecurityPolicy extracts the applied configuration owned by fieldManager from +// podSecurityPolicy. If no managedFields are found in podSecurityPolicy for fieldManager, a +// PodSecurityPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// podSecurityPolicy must be a unmodified PodSecurityPolicy API object that was retrieved from the Kubernetes API. +// ExtractPodSecurityPolicy provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPodSecurityPolicy(podSecurityPolicy *policyv1beta1.PodSecurityPolicy, fieldManager string) (*PodSecurityPolicyApplyConfiguration, error) { + return extractPodSecurityPolicy(podSecurityPolicy, fieldManager, "") +} + +// ExtractPodSecurityPolicyStatus is the same as ExtractPodSecurityPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPodSecurityPolicyStatus(podSecurityPolicy *policyv1beta1.PodSecurityPolicy, fieldManager string) (*PodSecurityPolicyApplyConfiguration, error) { + return extractPodSecurityPolicy(podSecurityPolicy, fieldManager, "status") +} + +func extractPodSecurityPolicy(podSecurityPolicy *policyv1beta1.PodSecurityPolicy, fieldManager string, subresource string) (*PodSecurityPolicyApplyConfiguration, error) { + b := &PodSecurityPolicyApplyConfiguration{} + err := managedfields.ExtractInto(podSecurityPolicy, internal.Parser().Type("io.k8s.api.policy.v1beta1.PodSecurityPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(podSecurityPolicy.Name) + + b.WithKind("PodSecurityPolicy") + b.WithAPIVersion("policy/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrole.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrole.go index 5b392089e5dd..3f7ceffee1e8 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrole.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrole.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apirbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func ClusterRole(name string) *ClusterRoleApplyConfiguration { return b } +// ExtractClusterRole extracts the applied configuration owned by fieldManager from +// clusterRole. If no managedFields are found in clusterRole for fieldManager, a +// ClusterRoleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// clusterRole must be a unmodified ClusterRole API object that was retrieved from the Kubernetes API. +// ExtractClusterRole provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractClusterRole(clusterRole *apirbacv1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { + return extractClusterRole(clusterRole, fieldManager, "") +} + +// ExtractClusterRoleStatus is the same as ExtractClusterRole except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractClusterRoleStatus(clusterRole *apirbacv1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { + return extractClusterRole(clusterRole, fieldManager, "status") +} + +func extractClusterRole(clusterRole *apirbacv1.ClusterRole, fieldManager string, subresource string) (*ClusterRoleApplyConfiguration, error) { + b := &ClusterRoleApplyConfiguration{} + err := managedfields.ExtractInto(clusterRole, internal.Parser().Type("io.k8s.api.rbac.v1.ClusterRole"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(clusterRole.Name) + + b.WithKind("ClusterRole") + b.WithAPIVersion("rbac.authorization.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrolebinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrolebinding.go index 879b03f52eaf..e1b0261d302c 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrolebinding.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrolebinding.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apirbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func ClusterRoleBinding(name string) *ClusterRoleBindingApplyConfiguration { return b } +// ExtractClusterRoleBinding extracts the applied configuration owned by fieldManager from +// clusterRoleBinding. If no managedFields are found in clusterRoleBinding for fieldManager, a +// ClusterRoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// clusterRoleBinding must be a unmodified ClusterRoleBinding API object that was retrieved from the Kubernetes API. +// ExtractClusterRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractClusterRoleBinding(clusterRoleBinding *apirbacv1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { + return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "") +} + +// ExtractClusterRoleBindingStatus is the same as ExtractClusterRoleBinding except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractClusterRoleBindingStatus(clusterRoleBinding *apirbacv1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { + return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "status") +} + +func extractClusterRoleBinding(clusterRoleBinding *apirbacv1.ClusterRoleBinding, fieldManager string, subresource string) (*ClusterRoleBindingApplyConfiguration, error) { + b := &ClusterRoleBindingApplyConfiguration{} + err := managedfields.ExtractInto(clusterRoleBinding, internal.Parser().Type("io.k8s.api.rbac.v1.ClusterRoleBinding"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(clusterRoleBinding.Name) + + b.WithKind("ClusterRoleBinding") + b.WithAPIVersion("rbac.authorization.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/role.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/role.go index 010ac3ac99ab..e1a1b9d3832d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/role.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/role.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apirbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func Role(name, namespace string) *RoleApplyConfiguration { return b } +// ExtractRole extracts the applied configuration owned by fieldManager from +// role. If no managedFields are found in role for fieldManager, a +// RoleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// role must be a unmodified Role API object that was retrieved from the Kubernetes API. +// ExtractRole provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractRole(role *apirbacv1.Role, fieldManager string) (*RoleApplyConfiguration, error) { + return extractRole(role, fieldManager, "") +} + +// ExtractRoleStatus is the same as ExtractRole except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractRoleStatus(role *apirbacv1.Role, fieldManager string) (*RoleApplyConfiguration, error) { + return extractRole(role, fieldManager, "status") +} + +func extractRole(role *apirbacv1.Role, fieldManager string, subresource string) (*RoleApplyConfiguration, error) { + b := &RoleApplyConfiguration{} + err := managedfields.ExtractInto(role, internal.Parser().Type("io.k8s.api.rbac.v1.Role"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(role.Name) + b.WithNamespace(role.Namespace) + + b.WithKind("Role") + b.WithAPIVersion("rbac.authorization.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/rolebinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/rolebinding.go index eb9c245bcbfc..41de2da40dd2 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/rolebinding.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/rolebinding.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apirbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func RoleBinding(name, namespace string) *RoleBindingApplyConfiguration { return b } +// ExtractRoleBinding extracts the applied configuration owned by fieldManager from +// roleBinding. If no managedFields are found in roleBinding for fieldManager, a +// RoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// roleBinding must be a unmodified RoleBinding API object that was retrieved from the Kubernetes API. +// ExtractRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractRoleBinding(roleBinding *apirbacv1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { + return extractRoleBinding(roleBinding, fieldManager, "") +} + +// ExtractRoleBindingStatus is the same as ExtractRoleBinding except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractRoleBindingStatus(roleBinding *apirbacv1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { + return extractRoleBinding(roleBinding, fieldManager, "status") +} + +func extractRoleBinding(roleBinding *apirbacv1.RoleBinding, fieldManager string, subresource string) (*RoleBindingApplyConfiguration, error) { + b := &RoleBindingApplyConfiguration{} + err := managedfields.ExtractInto(roleBinding, internal.Parser().Type("io.k8s.api.rbac.v1.RoleBinding"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(roleBinding.Name) + b.WithNamespace(roleBinding.Namespace) + + b.WithKind("RoleBinding") + b.WithAPIVersion("rbac.authorization.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrole.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrole.go index 246297738976..82e3b7fc5672 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrole.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrole.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func ClusterRole(name string) *ClusterRoleApplyConfiguration { return b } +// ExtractClusterRole extracts the applied configuration owned by fieldManager from +// clusterRole. If no managedFields are found in clusterRole for fieldManager, a +// ClusterRoleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// clusterRole must be a unmodified ClusterRole API object that was retrieved from the Kubernetes API. +// ExtractClusterRole provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractClusterRole(clusterRole *rbacv1alpha1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { + return extractClusterRole(clusterRole, fieldManager, "") +} + +// ExtractClusterRoleStatus is the same as ExtractClusterRole except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractClusterRoleStatus(clusterRole *rbacv1alpha1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { + return extractClusterRole(clusterRole, fieldManager, "status") +} + +func extractClusterRole(clusterRole *rbacv1alpha1.ClusterRole, fieldManager string, subresource string) (*ClusterRoleApplyConfiguration, error) { + b := &ClusterRoleApplyConfiguration{} + err := managedfields.ExtractInto(clusterRole, internal.Parser().Type("io.k8s.api.rbac.v1alpha1.ClusterRole"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(clusterRole.Name) + + b.WithKind("ClusterRole") + b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go index b89540c845e0..54c10cef5f9e 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func ClusterRoleBinding(name string) *ClusterRoleBindingApplyConfiguration { return b } +// ExtractClusterRoleBinding extracts the applied configuration owned by fieldManager from +// clusterRoleBinding. If no managedFields are found in clusterRoleBinding for fieldManager, a +// ClusterRoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// clusterRoleBinding must be a unmodified ClusterRoleBinding API object that was retrieved from the Kubernetes API. +// ExtractClusterRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractClusterRoleBinding(clusterRoleBinding *rbacv1alpha1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { + return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "") +} + +// ExtractClusterRoleBindingStatus is the same as ExtractClusterRoleBinding except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractClusterRoleBindingStatus(clusterRoleBinding *rbacv1alpha1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { + return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "status") +} + +func extractClusterRoleBinding(clusterRoleBinding *rbacv1alpha1.ClusterRoleBinding, fieldManager string, subresource string) (*ClusterRoleBindingApplyConfiguration, error) { + b := &ClusterRoleBindingApplyConfiguration{} + err := managedfields.ExtractInto(clusterRoleBinding, internal.Parser().Type("io.k8s.api.rbac.v1alpha1.ClusterRoleBinding"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(clusterRoleBinding.Name) + + b.WithKind("ClusterRoleBinding") + b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/role.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/role.go index 7ead337c9ce5..ad03749fc015 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/role.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/role.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func Role(name, namespace string) *RoleApplyConfiguration { return b } +// ExtractRole extracts the applied configuration owned by fieldManager from +// role. If no managedFields are found in role for fieldManager, a +// RoleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// role must be a unmodified Role API object that was retrieved from the Kubernetes API. +// ExtractRole provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractRole(role *rbacv1alpha1.Role, fieldManager string) (*RoleApplyConfiguration, error) { + return extractRole(role, fieldManager, "") +} + +// ExtractRoleStatus is the same as ExtractRole except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractRoleStatus(role *rbacv1alpha1.Role, fieldManager string) (*RoleApplyConfiguration, error) { + return extractRole(role, fieldManager, "status") +} + +func extractRole(role *rbacv1alpha1.Role, fieldManager string, subresource string) (*RoleApplyConfiguration, error) { + b := &RoleApplyConfiguration{} + err := managedfields.ExtractInto(role, internal.Parser().Type("io.k8s.api.rbac.v1alpha1.Role"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(role.Name) + b.WithNamespace(role.Namespace) + + b.WithKind("Role") + b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/rolebinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/rolebinding.go index c8d5e9402067..66a799111292 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/rolebinding.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/rolebinding.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func RoleBinding(name, namespace string) *RoleBindingApplyConfiguration { return b } +// ExtractRoleBinding extracts the applied configuration owned by fieldManager from +// roleBinding. If no managedFields are found in roleBinding for fieldManager, a +// RoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// roleBinding must be a unmodified RoleBinding API object that was retrieved from the Kubernetes API. +// ExtractRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractRoleBinding(roleBinding *rbacv1alpha1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { + return extractRoleBinding(roleBinding, fieldManager, "") +} + +// ExtractRoleBindingStatus is the same as ExtractRoleBinding except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractRoleBindingStatus(roleBinding *rbacv1alpha1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { + return extractRoleBinding(roleBinding, fieldManager, "status") +} + +func extractRoleBinding(roleBinding *rbacv1alpha1.RoleBinding, fieldManager string, subresource string) (*RoleBindingApplyConfiguration, error) { + b := &RoleBindingApplyConfiguration{} + err := managedfields.ExtractInto(roleBinding, internal.Parser().Type("io.k8s.api.rbac.v1alpha1.RoleBinding"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(roleBinding.Name) + b.WithNamespace(roleBinding.Namespace) + + b.WithKind("RoleBinding") + b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrole.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrole.go index 312e43c94806..04ab4e0298af 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrole.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrole.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func ClusterRole(name string) *ClusterRoleApplyConfiguration { return b } +// ExtractClusterRole extracts the applied configuration owned by fieldManager from +// clusterRole. If no managedFields are found in clusterRole for fieldManager, a +// ClusterRoleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// clusterRole must be a unmodified ClusterRole API object that was retrieved from the Kubernetes API. +// ExtractClusterRole provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractClusterRole(clusterRole *rbacv1beta1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { + return extractClusterRole(clusterRole, fieldManager, "") +} + +// ExtractClusterRoleStatus is the same as ExtractClusterRole except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractClusterRoleStatus(clusterRole *rbacv1beta1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { + return extractClusterRole(clusterRole, fieldManager, "status") +} + +func extractClusterRole(clusterRole *rbacv1beta1.ClusterRole, fieldManager string, subresource string) (*ClusterRoleApplyConfiguration, error) { + b := &ClusterRoleApplyConfiguration{} + err := managedfields.ExtractInto(clusterRole, internal.Parser().Type("io.k8s.api.rbac.v1beta1.ClusterRole"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(clusterRole.Name) + + b.WithKind("ClusterRole") + b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrolebinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrolebinding.go index edf5325d122e..41599998cb41 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrolebinding.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrolebinding.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func ClusterRoleBinding(name string) *ClusterRoleBindingApplyConfiguration { return b } +// ExtractClusterRoleBinding extracts the applied configuration owned by fieldManager from +// clusterRoleBinding. If no managedFields are found in clusterRoleBinding for fieldManager, a +// ClusterRoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// clusterRoleBinding must be a unmodified ClusterRoleBinding API object that was retrieved from the Kubernetes API. +// ExtractClusterRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractClusterRoleBinding(clusterRoleBinding *rbacv1beta1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { + return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "") +} + +// ExtractClusterRoleBindingStatus is the same as ExtractClusterRoleBinding except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractClusterRoleBindingStatus(clusterRoleBinding *rbacv1beta1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { + return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "status") +} + +func extractClusterRoleBinding(clusterRoleBinding *rbacv1beta1.ClusterRoleBinding, fieldManager string, subresource string) (*ClusterRoleBindingApplyConfiguration, error) { + b := &ClusterRoleBindingApplyConfiguration{} + err := managedfields.ExtractInto(clusterRoleBinding, internal.Parser().Type("io.k8s.api.rbac.v1beta1.ClusterRoleBinding"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(clusterRoleBinding.Name) + + b.WithKind("ClusterRoleBinding") + b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/role.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/role.go index f4876deed3eb..0f2f35ffd571 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/role.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/role.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,42 @@ func Role(name, namespace string) *RoleApplyConfiguration { return b } +// ExtractRole extracts the applied configuration owned by fieldManager from +// role. If no managedFields are found in role for fieldManager, a +// RoleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// role must be a unmodified Role API object that was retrieved from the Kubernetes API. +// ExtractRole provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractRole(role *rbacv1beta1.Role, fieldManager string) (*RoleApplyConfiguration, error) { + return extractRole(role, fieldManager, "") +} + +// ExtractRoleStatus is the same as ExtractRole except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractRoleStatus(role *rbacv1beta1.Role, fieldManager string) (*RoleApplyConfiguration, error) { + return extractRole(role, fieldManager, "status") +} + +func extractRole(role *rbacv1beta1.Role, fieldManager string, subresource string) (*RoleApplyConfiguration, error) { + b := &RoleApplyConfiguration{} + err := managedfields.ExtractInto(role, internal.Parser().Type("io.k8s.api.rbac.v1beta1.Role"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(role.Name) + b.WithNamespace(role.Namespace) + + b.WithKind("Role") + b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/rolebinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/rolebinding.go index e2b955727a54..b2995e8c6d34 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/rolebinding.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/rolebinding.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -44,6 +47,42 @@ func RoleBinding(name, namespace string) *RoleBindingApplyConfiguration { return b } +// ExtractRoleBinding extracts the applied configuration owned by fieldManager from +// roleBinding. If no managedFields are found in roleBinding for fieldManager, a +// RoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// roleBinding must be a unmodified RoleBinding API object that was retrieved from the Kubernetes API. +// ExtractRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractRoleBinding(roleBinding *rbacv1beta1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { + return extractRoleBinding(roleBinding, fieldManager, "") +} + +// ExtractRoleBindingStatus is the same as ExtractRoleBinding except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractRoleBindingStatus(roleBinding *rbacv1beta1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { + return extractRoleBinding(roleBinding, fieldManager, "status") +} + +func extractRoleBinding(roleBinding *rbacv1beta1.RoleBinding, fieldManager string, subresource string) (*RoleBindingApplyConfiguration, error) { + b := &RoleBindingApplyConfiguration{} + err := managedfields.ExtractInto(roleBinding, internal.Parser().Type("io.k8s.api.rbac.v1beta1.RoleBinding"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(roleBinding.Name) + b.WithNamespace(roleBinding.Namespace) + + b.WithKind("RoleBinding") + b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1/priorityclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1/priorityclass.go index 1f9ec9645ece..0bf294fd16df 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1/priorityclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1/priorityclass.go @@ -20,8 +20,11 @@ package v1 import ( corev1 "k8s.io/api/core/v1" + schedulingv1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -46,6 +49,41 @@ func PriorityClass(name string) *PriorityClassApplyConfiguration { return b } +// ExtractPriorityClass extracts the applied configuration owned by fieldManager from +// priorityClass. If no managedFields are found in priorityClass for fieldManager, a +// PriorityClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API. +// ExtractPriorityClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPriorityClass(priorityClass *schedulingv1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { + return extractPriorityClass(priorityClass, fieldManager, "") +} + +// ExtractPriorityClassStatus is the same as ExtractPriorityClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPriorityClassStatus(priorityClass *schedulingv1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { + return extractPriorityClass(priorityClass, fieldManager, "status") +} + +func extractPriorityClass(priorityClass *schedulingv1.PriorityClass, fieldManager string, subresource string) (*PriorityClassApplyConfiguration, error) { + b := &PriorityClassApplyConfiguration{} + err := managedfields.ExtractInto(priorityClass, internal.Parser().Type("io.k8s.api.scheduling.v1.PriorityClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(priorityClass.Name) + + b.WithKind("PriorityClass") + b.WithAPIVersion("scheduling.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha1/priorityclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha1/priorityclass.go index b8b86ed07c00..e9d28331294e 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha1/priorityclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha1/priorityclass.go @@ -20,8 +20,11 @@ package v1alpha1 import ( corev1 "k8s.io/api/core/v1" + v1alpha1 "k8s.io/api/scheduling/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -46,6 +49,41 @@ func PriorityClass(name string) *PriorityClassApplyConfiguration { return b } +// ExtractPriorityClass extracts the applied configuration owned by fieldManager from +// priorityClass. If no managedFields are found in priorityClass for fieldManager, a +// PriorityClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API. +// ExtractPriorityClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPriorityClass(priorityClass *v1alpha1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { + return extractPriorityClass(priorityClass, fieldManager, "") +} + +// ExtractPriorityClassStatus is the same as ExtractPriorityClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPriorityClassStatus(priorityClass *v1alpha1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { + return extractPriorityClass(priorityClass, fieldManager, "status") +} + +func extractPriorityClass(priorityClass *v1alpha1.PriorityClass, fieldManager string, subresource string) (*PriorityClassApplyConfiguration, error) { + b := &PriorityClassApplyConfiguration{} + err := managedfields.ExtractInto(priorityClass, internal.Parser().Type("io.k8s.api.scheduling.v1alpha1.PriorityClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(priorityClass.Name) + + b.WithKind("PriorityClass") + b.WithAPIVersion("scheduling.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/priorityclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/priorityclass.go index d4754a16d76d..935ab43d56e0 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/priorityclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/priorityclass.go @@ -20,8 +20,11 @@ package v1beta1 import ( corev1 "k8s.io/api/core/v1" + v1beta1 "k8s.io/api/scheduling/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -46,6 +49,41 @@ func PriorityClass(name string) *PriorityClassApplyConfiguration { return b } +// ExtractPriorityClass extracts the applied configuration owned by fieldManager from +// priorityClass. If no managedFields are found in priorityClass for fieldManager, a +// PriorityClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API. +// ExtractPriorityClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPriorityClass(priorityClass *v1beta1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { + return extractPriorityClass(priorityClass, fieldManager, "") +} + +// ExtractPriorityClassStatus is the same as ExtractPriorityClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPriorityClassStatus(priorityClass *v1beta1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { + return extractPriorityClass(priorityClass, fieldManager, "status") +} + +func extractPriorityClass(priorityClass *v1beta1.PriorityClass, fieldManager string, subresource string) (*PriorityClassApplyConfiguration, error) { + b := &PriorityClassApplyConfiguration{} + err := managedfields.ExtractInto(priorityClass, internal.Parser().Type("io.k8s.api.scheduling.v1beta1.PriorityClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(priorityClass.Name) + + b.WithKind("PriorityClass") + b.WithAPIVersion("scheduling.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriver.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriver.go index 3654e7a0ff73..66c78860c043 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriver.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriver.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apistoragev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func CSIDriver(name string) *CSIDriverApplyConfiguration { return b } +// ExtractCSIDriver extracts the applied configuration owned by fieldManager from +// cSIDriver. If no managedFields are found in cSIDriver for fieldManager, a +// CSIDriverApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// cSIDriver must be a unmodified CSIDriver API object that was retrieved from the Kubernetes API. +// ExtractCSIDriver provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCSIDriver(cSIDriver *apistoragev1.CSIDriver, fieldManager string) (*CSIDriverApplyConfiguration, error) { + return extractCSIDriver(cSIDriver, fieldManager, "") +} + +// ExtractCSIDriverStatus is the same as ExtractCSIDriver except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCSIDriverStatus(cSIDriver *apistoragev1.CSIDriver, fieldManager string) (*CSIDriverApplyConfiguration, error) { + return extractCSIDriver(cSIDriver, fieldManager, "status") +} + +func extractCSIDriver(cSIDriver *apistoragev1.CSIDriver, fieldManager string, subresource string) (*CSIDriverApplyConfiguration, error) { + b := &CSIDriverApplyConfiguration{} + err := managedfields.ExtractInto(cSIDriver, internal.Parser().Type("io.k8s.api.storage.v1.CSIDriver"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(cSIDriver.Name) + + b.WithKind("CSIDriver") + b.WithAPIVersion("storage.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinode.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinode.go index a2952f36a06d..f2150672dc7f 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinode.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinode.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apistoragev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func CSINode(name string) *CSINodeApplyConfiguration { return b } +// ExtractCSINode extracts the applied configuration owned by fieldManager from +// cSINode. If no managedFields are found in cSINode for fieldManager, a +// CSINodeApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// cSINode must be a unmodified CSINode API object that was retrieved from the Kubernetes API. +// ExtractCSINode provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCSINode(cSINode *apistoragev1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { + return extractCSINode(cSINode, fieldManager, "") +} + +// ExtractCSINodeStatus is the same as ExtractCSINode except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCSINodeStatus(cSINode *apistoragev1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { + return extractCSINode(cSINode, fieldManager, "status") +} + +func extractCSINode(cSINode *apistoragev1.CSINode, fieldManager string, subresource string) (*CSINodeApplyConfiguration, error) { + b := &CSINodeApplyConfiguration{} + err := managedfields.ExtractInto(cSINode, internal.Parser().Type("io.k8s.api.storage.v1.CSINode"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(cSINode.Name) + + b.WithKind("CSINode") + b.WithAPIVersion("storage.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storageclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storageclass.go index 6f143a0669a2..4b956044efff 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storageclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storageclass.go @@ -23,7 +23,9 @@ import ( storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -51,6 +53,41 @@ func StorageClass(name string) *StorageClassApplyConfiguration { return b } +// ExtractStorageClass extracts the applied configuration owned by fieldManager from +// storageClass. If no managedFields are found in storageClass for fieldManager, a +// StorageClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// storageClass must be a unmodified StorageClass API object that was retrieved from the Kubernetes API. +// ExtractStorageClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractStorageClass(storageClass *storagev1.StorageClass, fieldManager string) (*StorageClassApplyConfiguration, error) { + return extractStorageClass(storageClass, fieldManager, "") +} + +// ExtractStorageClassStatus is the same as ExtractStorageClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractStorageClassStatus(storageClass *storagev1.StorageClass, fieldManager string) (*StorageClassApplyConfiguration, error) { + return extractStorageClass(storageClass, fieldManager, "status") +} + +func extractStorageClass(storageClass *storagev1.StorageClass, fieldManager string, subresource string) (*StorageClassApplyConfiguration, error) { + b := &StorageClassApplyConfiguration{} + err := managedfields.ExtractInto(storageClass, internal.Parser().Type("io.k8s.api.storage.v1.StorageClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(storageClass.Name) + + b.WithKind("StorageClass") + b.WithAPIVersion("storage.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattachment.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattachment.go index 4b8842477601..301b8ff2172c 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattachment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattachment.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apistoragev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func VolumeAttachment(name string) *VolumeAttachmentApplyConfiguration { return b } +// ExtractVolumeAttachment extracts the applied configuration owned by fieldManager from +// volumeAttachment. If no managedFields are found in volumeAttachment for fieldManager, a +// VolumeAttachmentApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// volumeAttachment must be a unmodified VolumeAttachment API object that was retrieved from the Kubernetes API. +// ExtractVolumeAttachment provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractVolumeAttachment(volumeAttachment *apistoragev1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { + return extractVolumeAttachment(volumeAttachment, fieldManager, "") +} + +// ExtractVolumeAttachmentStatus is the same as ExtractVolumeAttachment except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractVolumeAttachmentStatus(volumeAttachment *apistoragev1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { + return extractVolumeAttachment(volumeAttachment, fieldManager, "status") +} + +func extractVolumeAttachment(volumeAttachment *apistoragev1.VolumeAttachment, fieldManager string, subresource string) (*VolumeAttachmentApplyConfiguration, error) { + b := &VolumeAttachmentApplyConfiguration{} + err := managedfields.ExtractInto(volumeAttachment, internal.Parser().Type("io.k8s.api.storage.v1.VolumeAttachment"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(volumeAttachment.Name) + + b.WithKind("VolumeAttachment") + b.WithAPIVersion("storage.k8s.io/v1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/csistoragecapacity.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/csistoragecapacity.go index 75d4bd0de09b..db703b0c1dbd 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/csistoragecapacity.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/csistoragecapacity.go @@ -19,9 +19,12 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "k8s.io/api/storage/v1alpha1" resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -47,6 +50,42 @@ func CSIStorageCapacity(name, namespace string) *CSIStorageCapacityApplyConfigur return b } +// ExtractCSIStorageCapacity extracts the applied configuration owned by fieldManager from +// cSIStorageCapacity. If no managedFields are found in cSIStorageCapacity for fieldManager, a +// CSIStorageCapacityApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// cSIStorageCapacity must be a unmodified CSIStorageCapacity API object that was retrieved from the Kubernetes API. +// ExtractCSIStorageCapacity provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCSIStorageCapacity(cSIStorageCapacity *v1alpha1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { + return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "") +} + +// ExtractCSIStorageCapacityStatus is the same as ExtractCSIStorageCapacity except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCSIStorageCapacityStatus(cSIStorageCapacity *v1alpha1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { + return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "status") +} + +func extractCSIStorageCapacity(cSIStorageCapacity *v1alpha1.CSIStorageCapacity, fieldManager string, subresource string) (*CSIStorageCapacityApplyConfiguration, error) { + b := &CSIStorageCapacityApplyConfiguration{} + err := managedfields.ExtractInto(cSIStorageCapacity, internal.Parser().Type("io.k8s.api.storage.v1alpha1.CSIStorageCapacity"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(cSIStorageCapacity.Name) + b.WithNamespace(cSIStorageCapacity.Namespace) + + b.WithKind("CSIStorageCapacity") + b.WithAPIVersion("storage.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattachment.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattachment.go index bf7ee0ba883c..42a3ca3ebf56 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattachment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattachment.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + storagev1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func VolumeAttachment(name string) *VolumeAttachmentApplyConfiguration { return b } +// ExtractVolumeAttachment extracts the applied configuration owned by fieldManager from +// volumeAttachment. If no managedFields are found in volumeAttachment for fieldManager, a +// VolumeAttachmentApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// volumeAttachment must be a unmodified VolumeAttachment API object that was retrieved from the Kubernetes API. +// ExtractVolumeAttachment provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractVolumeAttachment(volumeAttachment *storagev1alpha1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { + return extractVolumeAttachment(volumeAttachment, fieldManager, "") +} + +// ExtractVolumeAttachmentStatus is the same as ExtractVolumeAttachment except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractVolumeAttachmentStatus(volumeAttachment *storagev1alpha1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { + return extractVolumeAttachment(volumeAttachment, fieldManager, "status") +} + +func extractVolumeAttachment(volumeAttachment *storagev1alpha1.VolumeAttachment, fieldManager string, subresource string) (*VolumeAttachmentApplyConfiguration, error) { + b := &VolumeAttachmentApplyConfiguration{} + err := managedfields.ExtractInto(volumeAttachment, internal.Parser().Type("io.k8s.api.storage.v1alpha1.VolumeAttachment"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(volumeAttachment.Name) + + b.WithKind("VolumeAttachment") + b.WithAPIVersion("storage.k8s.io/v1alpha1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriver.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriver.go index 81b799ab1bf0..3cb6b41d7def 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriver.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriver.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func CSIDriver(name string) *CSIDriverApplyConfiguration { return b } +// ExtractCSIDriver extracts the applied configuration owned by fieldManager from +// cSIDriver. If no managedFields are found in cSIDriver for fieldManager, a +// CSIDriverApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// cSIDriver must be a unmodified CSIDriver API object that was retrieved from the Kubernetes API. +// ExtractCSIDriver provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCSIDriver(cSIDriver *storagev1beta1.CSIDriver, fieldManager string) (*CSIDriverApplyConfiguration, error) { + return extractCSIDriver(cSIDriver, fieldManager, "") +} + +// ExtractCSIDriverStatus is the same as ExtractCSIDriver except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCSIDriverStatus(cSIDriver *storagev1beta1.CSIDriver, fieldManager string) (*CSIDriverApplyConfiguration, error) { + return extractCSIDriver(cSIDriver, fieldManager, "status") +} + +func extractCSIDriver(cSIDriver *storagev1beta1.CSIDriver, fieldManager string, subresource string) (*CSIDriverApplyConfiguration, error) { + b := &CSIDriverApplyConfiguration{} + err := managedfields.ExtractInto(cSIDriver, internal.Parser().Type("io.k8s.api.storage.v1beta1.CSIDriver"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(cSIDriver.Name) + + b.WithKind("CSIDriver") + b.WithAPIVersion("storage.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinode.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinode.go index eff563349fcf..0fbd8b775355 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinode.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinode.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -42,6 +45,41 @@ func CSINode(name string) *CSINodeApplyConfiguration { return b } +// ExtractCSINode extracts the applied configuration owned by fieldManager from +// cSINode. If no managedFields are found in cSINode for fieldManager, a +// CSINodeApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// cSINode must be a unmodified CSINode API object that was retrieved from the Kubernetes API. +// ExtractCSINode provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCSINode(cSINode *storagev1beta1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { + return extractCSINode(cSINode, fieldManager, "") +} + +// ExtractCSINodeStatus is the same as ExtractCSINode except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCSINodeStatus(cSINode *storagev1beta1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { + return extractCSINode(cSINode, fieldManager, "status") +} + +func extractCSINode(cSINode *storagev1beta1.CSINode, fieldManager string, subresource string) (*CSINodeApplyConfiguration, error) { + b := &CSINodeApplyConfiguration{} + err := managedfields.ExtractInto(cSINode, internal.Parser().Type("io.k8s.api.storage.v1beta1.CSINode"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(cSINode.Name) + + b.WithKind("CSINode") + b.WithAPIVersion("storage.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csistoragecapacity.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csistoragecapacity.go index 20cdba118cb7..6b7205e6d17a 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csistoragecapacity.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csistoragecapacity.go @@ -19,9 +19,12 @@ limitations under the License. package v1beta1 import ( + v1beta1 "k8s.io/api/storage/v1beta1" resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -47,6 +50,42 @@ func CSIStorageCapacity(name, namespace string) *CSIStorageCapacityApplyConfigur return b } +// ExtractCSIStorageCapacity extracts the applied configuration owned by fieldManager from +// cSIStorageCapacity. If no managedFields are found in cSIStorageCapacity for fieldManager, a +// CSIStorageCapacityApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// cSIStorageCapacity must be a unmodified CSIStorageCapacity API object that was retrieved from the Kubernetes API. +// ExtractCSIStorageCapacity provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCSIStorageCapacity(cSIStorageCapacity *v1beta1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { + return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "") +} + +// ExtractCSIStorageCapacityStatus is the same as ExtractCSIStorageCapacity except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCSIStorageCapacityStatus(cSIStorageCapacity *v1beta1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { + return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "status") +} + +func extractCSIStorageCapacity(cSIStorageCapacity *v1beta1.CSIStorageCapacity, fieldManager string, subresource string) (*CSIStorageCapacityApplyConfiguration, error) { + b := &CSIStorageCapacityApplyConfiguration{} + err := managedfields.ExtractInto(cSIStorageCapacity, internal.Parser().Type("io.k8s.api.storage.v1beta1.CSIStorageCapacity"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(cSIStorageCapacity.Name) + b.WithNamespace(cSIStorageCapacity.Namespace) + + b.WithKind("CSIStorageCapacity") + b.WithAPIVersion("storage.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storageclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storageclass.go index 16f7d315cce4..d2c96ddb2ba1 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storageclass.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storageclass.go @@ -23,7 +23,9 @@ import ( v1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -51,6 +53,41 @@ func StorageClass(name string) *StorageClassApplyConfiguration { return b } +// ExtractStorageClass extracts the applied configuration owned by fieldManager from +// storageClass. If no managedFields are found in storageClass for fieldManager, a +// StorageClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// storageClass must be a unmodified StorageClass API object that was retrieved from the Kubernetes API. +// ExtractStorageClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractStorageClass(storageClass *v1beta1.StorageClass, fieldManager string) (*StorageClassApplyConfiguration, error) { + return extractStorageClass(storageClass, fieldManager, "") +} + +// ExtractStorageClassStatus is the same as ExtractStorageClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractStorageClassStatus(storageClass *v1beta1.StorageClass, fieldManager string) (*StorageClassApplyConfiguration, error) { + return extractStorageClass(storageClass, fieldManager, "status") +} + +func extractStorageClass(storageClass *v1beta1.StorageClass, fieldManager string, subresource string) (*StorageClassApplyConfiguration, error) { + b := &StorageClassApplyConfiguration{} + err := managedfields.ExtractInto(storageClass, internal.Parser().Type("io.k8s.api.storage.v1beta1.StorageClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(storageClass.Name) + + b.WithKind("StorageClass") + b.WithAPIVersion("storage.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattachment.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattachment.go index 1522328875e2..03756aac004b 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattachment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattachment.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -43,6 +46,41 @@ func VolumeAttachment(name string) *VolumeAttachmentApplyConfiguration { return b } +// ExtractVolumeAttachment extracts the applied configuration owned by fieldManager from +// volumeAttachment. If no managedFields are found in volumeAttachment for fieldManager, a +// VolumeAttachmentApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. Is is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// volumeAttachment must be a unmodified VolumeAttachment API object that was retrieved from the Kubernetes API. +// ExtractVolumeAttachment provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractVolumeAttachment(volumeAttachment *storagev1beta1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { + return extractVolumeAttachment(volumeAttachment, fieldManager, "") +} + +// ExtractVolumeAttachmentStatus is the same as ExtractVolumeAttachment except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractVolumeAttachmentStatus(volumeAttachment *storagev1beta1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { + return extractVolumeAttachment(volumeAttachment, fieldManager, "status") +} + +func extractVolumeAttachment(volumeAttachment *storagev1beta1.VolumeAttachment, fieldManager string, subresource string) (*VolumeAttachmentApplyConfiguration, error) { + b := &VolumeAttachmentApplyConfiguration{} + err := managedfields.ExtractInto(volumeAttachment, internal.Parser().Type("io.k8s.api.storage.v1beta1.VolumeAttachment"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(volumeAttachment.Name) + + b.WithKind("VolumeAttachment") + b.WithAPIVersion("storage.k8s.io/v1beta1") + return b, nil +} + // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/discovery/discovery_client.go b/cluster-autoscaler/vendor/k8s.io/client-go/discovery/discovery_client.go index 57404e0b2b71..ec09616b58e9 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/discovery/discovery_client.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/discovery/discovery_client.go @@ -26,6 +26,7 @@ import ( "sync" "time" + //lint:ignore SA1019 Keep using module since it's still being maintained and the api of google.golang.org/protobuf/proto differs "github.com/golang/protobuf/proto" openapi_v2 "github.com/googleapis/gnostic/openapiv2" @@ -41,7 +42,7 @@ import ( ) const ( - // defaultRetries is the number of times a resource discovery is repeated if an api group disappears on the fly (e.g. ThirdPartyResources). + // defaultRetries is the number of times a resource discovery is repeated if an api group disappears on the fly (e.g. CustomResourceDefinitions). defaultRetries = 2 // protobuf mime type mimePb = "application/com.github.proto-openapi.spec.v2@v1.0+protobuf" diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/dynamic/fake/simple.go b/cluster-autoscaler/vendor/k8s.io/client-go/dynamic/fake/simple.go index 622995776a58..1891998f6570 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/dynamic/fake/simple.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/dynamic/fake/simple.go @@ -83,7 +83,7 @@ func NewSimpleDynamicClientWithCustomListKinds(scheme *runtime.Scheme, gvrToList } } - cs := &FakeDynamicClient{scheme: scheme, gvrToListKind: completeGVRToListKind} + cs := &FakeDynamicClient{scheme: scheme, gvrToListKind: completeGVRToListKind, tracker: o} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { gvr := action.GetResource() @@ -105,6 +105,7 @@ type FakeDynamicClient struct { testing.Fake scheme *runtime.Scheme gvrToListKind map[schema.GroupVersionResource]string + tracker testing.ObjectTracker } type dynamicResourceClient struct { @@ -114,6 +115,10 @@ type dynamicResourceClient struct { listKind string } +func (c *FakeDynamicClient) Tracker() testing.ObjectTracker { + return c.tracker +} + var _ dynamic.Interface = &FakeDynamicClient{} func (c *FakeDynamicClient) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface { diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/generic.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/generic.go index b9f4f0e50526..aede51a5e6d5 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/informers/generic.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/informers/generic.go @@ -49,6 +49,7 @@ import ( nodev1 "k8s.io/api/node/v1" nodev1alpha1 "k8s.io/api/node/v1alpha1" nodev1beta1 "k8s.io/api/node/v1beta1" + policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -277,6 +278,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case nodev1beta1.SchemeGroupVersion.WithResource("runtimeclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Node().V1beta1().RuntimeClasses().Informer()}, nil + // Group=policy, Version=v1 + case policyv1.SchemeGroupVersion.WithResource("poddisruptionbudgets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1().PodDisruptionBudgets().Informer()}, nil + // Group=policy, Version=v1beta1 case policyv1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodDisruptionBudgets().Informer()}, nil diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/interface.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/interface.go index 1859fca821b7..889cb8152c96 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/interface.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/interface.go @@ -20,11 +20,14 @@ package policy import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + v1 "k8s.io/client-go/informers/policy/v1" v1beta1 "k8s.io/client-go/informers/policy/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } @@ -40,6 +43,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} + // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/v1/interface.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/v1/interface.go new file mode 100644 index 000000000000..2c42e1993c4a --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/v1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. + PodDisruptionBudgets() PodDisruptionBudgetInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// PodDisruptionBudgets returns a PodDisruptionBudgetInformer. +func (v *version) PodDisruptionBudgets() PodDisruptionBudgetInformer { + return &podDisruptionBudgetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go new file mode 100644 index 000000000000..436598512af2 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + policyv1 "k8s.io/api/policy/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1 "k8s.io/client-go/listers/policy/v1" + cache "k8s.io/client-go/tools/cache" +) + +// PodDisruptionBudgetInformer provides access to a shared informer and lister for +// PodDisruptionBudgets. +type PodDisruptionBudgetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PodDisruptionBudgetLister +} + +type podDisruptionBudgetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPodDisruptionBudgetInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PolicyV1().PodDisruptionBudgets(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PolicyV1().PodDisruptionBudgets(namespace).Watch(context.TODO(), options) + }, + }, + &policyv1.PodDisruptionBudget{}, + resyncPeriod, + indexers, + ) +} + +func (f *podDisruptionBudgetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPodDisruptionBudgetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *podDisruptionBudgetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&policyv1.PodDisruptionBudget{}, f.defaultInformer) +} + +func (f *podDisruptionBudgetInformer) Lister() v1.PodDisruptionBudgetLister { + return v1.NewPodDisruptionBudgetLister(f.Informer().GetIndexer()) +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/clientset.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/clientset.go index a9b74459b2be..55a236fac5d1 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/clientset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/clientset.go @@ -54,6 +54,7 @@ import ( nodev1 "k8s.io/client-go/kubernetes/typed/node/v1" nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" + policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1" policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" @@ -102,6 +103,7 @@ type Interface interface { NodeV1() nodev1.NodeV1Interface NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface NodeV1beta1() nodev1beta1.NodeV1beta1Interface + PolicyV1() policyv1.PolicyV1Interface PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface RbacV1() rbacv1.RbacV1Interface RbacV1beta1() rbacv1beta1.RbacV1beta1Interface @@ -150,6 +152,7 @@ type Clientset struct { nodeV1 *nodev1.NodeV1Client nodeV1alpha1 *nodev1alpha1.NodeV1alpha1Client nodeV1beta1 *nodev1beta1.NodeV1beta1Client + policyV1 *policyv1.PolicyV1Client policyV1beta1 *policyv1beta1.PolicyV1beta1Client rbacV1 *rbacv1.RbacV1Client rbacV1beta1 *rbacv1beta1.RbacV1beta1Client @@ -322,6 +325,11 @@ func (c *Clientset) NodeV1beta1() nodev1beta1.NodeV1beta1Interface { return c.nodeV1beta1 } +// PolicyV1 retrieves the PolicyV1Client +func (c *Clientset) PolicyV1() policyv1.PolicyV1Interface { + return c.policyV1 +} + // PolicyV1beta1 retrieves the PolicyV1beta1Client func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface { return c.policyV1beta1 @@ -521,6 +529,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } + cs.policyV1, err = policyv1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.policyV1beta1, err = policyv1beta1.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -605,6 +617,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { cs.nodeV1 = nodev1.NewForConfigOrDie(c) cs.nodeV1alpha1 = nodev1alpha1.NewForConfigOrDie(c) cs.nodeV1beta1 = nodev1beta1.NewForConfigOrDie(c) + cs.policyV1 = policyv1.NewForConfigOrDie(c) cs.policyV1beta1 = policyv1beta1.NewForConfigOrDie(c) cs.rbacV1 = rbacv1.NewForConfigOrDie(c) cs.rbacV1beta1 = rbacv1beta1.NewForConfigOrDie(c) @@ -655,6 +668,7 @@ func New(c rest.Interface) *Clientset { cs.nodeV1 = nodev1.New(c) cs.nodeV1alpha1 = nodev1alpha1.New(c) cs.nodeV1beta1 = nodev1beta1.New(c) + cs.policyV1 = policyv1.New(c) cs.policyV1beta1 = policyv1beta1.New(c) cs.rbacV1 = rbacv1.New(c) cs.rbacV1beta1 = rbacv1beta1.New(c) diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go index 8169545af87d..c09d8999f828 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go @@ -88,6 +88,8 @@ import ( fakenodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake" nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" fakenodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1/fake" + policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1" + fakepolicyv1 "k8s.io/client-go/kubernetes/typed/policy/v1/fake" policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" fakepolicyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake" rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" @@ -318,6 +320,11 @@ func (c *Clientset) NodeV1beta1() nodev1beta1.NodeV1beta1Interface { return &fakenodev1beta1.FakeNodeV1beta1{Fake: &c.Fake} } +// PolicyV1 retrieves the PolicyV1Client +func (c *Clientset) PolicyV1() policyv1.PolicyV1Interface { + return &fakepolicyv1.FakePolicyV1{Fake: &c.Fake} +} + // PolicyV1beta1 retrieves the PolicyV1beta1Client func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface { return &fakepolicyv1beta1.FakePolicyV1beta1{Fake: &c.Fake} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/register.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/register.go index dbcf08527bb6..789d6428fe52 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/register.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/register.go @@ -51,6 +51,7 @@ import ( nodev1 "k8s.io/api/node/v1" nodev1alpha1 "k8s.io/api/node/v1alpha1" nodev1beta1 "k8s.io/api/node/v1beta1" + policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -104,6 +105,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ nodev1.AddToScheme, nodev1alpha1.AddToScheme, nodev1beta1.AddToScheme, + policyv1.AddToScheme, policyv1beta1.AddToScheme, rbacv1.AddToScheme, rbacv1beta1.AddToScheme, diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/scheme/register.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/scheme/register.go index b8b34fad13e6..a46fb296291d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/scheme/register.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/scheme/register.go @@ -51,6 +51,7 @@ import ( nodev1 "k8s.io/api/node/v1" nodev1alpha1 "k8s.io/api/node/v1alpha1" nodev1beta1 "k8s.io/api/node/v1beta1" + policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -104,6 +105,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ nodev1.AddToScheme, nodev1alpha1.AddToScheme, nodev1beta1.AddToScheme, + policyv1.AddToScheme, policyv1beta1.AddToScheme, rbacv1.AddToScheme, rbacv1beta1.AddToScheme, diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go index 51545107d526..ccc2049ff7f4 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go @@ -30,6 +30,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" + applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -55,6 +56,7 @@ type DeploymentInterface interface { ApplyStatus(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) + ApplyScale(ctx context.Context, deploymentName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (*autoscalingv1.Scale, error) DeploymentExpansion } @@ -287,3 +289,28 @@ func (c *deployments) UpdateScale(ctx context.Context, deploymentName string, sc Into(result) return } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *deployments) ApplyScale(ctx context.Context, deploymentName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + + result = &autoscalingv1.Scale{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("deployments"). + Name(deploymentName). + SubResource("scale"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go index 3fe07c77859a..72587cc3f582 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go @@ -31,6 +31,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" + applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" testing "k8s.io/client-go/testing" ) @@ -211,3 +212,22 @@ func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string } return obj.(*autoscalingv1.Scale), err } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *autoscalingv1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{}) + + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go index a84d1bdf6eb9..674b134871ff 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go @@ -31,6 +31,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" + applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" testing "k8s.io/client-go/testing" ) @@ -211,3 +212,22 @@ func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string } return obj.(*autoscalingv1.Scale), err } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *autoscalingv1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{}) + + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go index 44a3a5e09f8d..14ba5fb9a381 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go @@ -31,6 +31,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" + applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" testing "k8s.io/client-go/testing" ) @@ -211,3 +212,22 @@ func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName stri } return obj.(*autoscalingv1.Scale), err } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *autoscalingv1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{}) + + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go index 7a8f0cd84c83..917ed521f4f3 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go @@ -30,6 +30,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" + applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -55,6 +56,7 @@ type ReplicaSetInterface interface { ApplyStatus(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) + ApplyScale(ctx context.Context, replicaSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (*autoscalingv1.Scale, error) ReplicaSetExpansion } @@ -287,3 +289,28 @@ func (c *replicaSets) UpdateScale(ctx context.Context, replicaSetName string, sc Into(result) return } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *replicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + + result = &autoscalingv1.Scale{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("replicasets"). + Name(replicaSetName). + SubResource("scale"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go index 5626e2baacc3..d1fbb915d82d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go @@ -30,6 +30,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" + applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -55,6 +56,7 @@ type StatefulSetInterface interface { ApplyStatus(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) + ApplyScale(ctx context.Context, statefulSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (*autoscalingv1.Scale, error) StatefulSetExpansion } @@ -287,3 +289,28 @@ func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, Into(result) return } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *statefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + + result = &autoscalingv1.Scale{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("statefulsets"). + Name(statefulSetName). + SubResource("scale"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go index 6b996d4f33fb..681132307645 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go @@ -210,3 +210,22 @@ func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName stri } return obj.(*v1beta2.Scale), err } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), &v1beta2.Scale{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta2.Scale), err +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go index 73a12c9966c7..0416675d6d89 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go @@ -54,6 +54,7 @@ type StatefulSetInterface interface { ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (*v1beta2.Scale, error) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (*v1beta2.Scale, error) + ApplyScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.ScaleApplyConfiguration, opts v1.ApplyOptions) (*v1beta2.Scale, error) StatefulSetExpansion } @@ -286,3 +287,28 @@ func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, Into(result) return } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *statefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + + result = &v1beta2.Scale{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("statefulsets"). + Name(statefulSetName). + SubResource("scale"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go index 601cc82d48f3..94312ce3353a 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go @@ -189,24 +189,13 @@ func (c *FakePods) ApplyStatus(ctx context.Context, pod *applyconfigurationscore return obj.(*corev1.Pod), err } -// GetEphemeralContainers takes name of the pod, and returns the corresponding ephemeralContainers object, and an error if there is any. -func (c *FakePods) GetEphemeralContainers(ctx context.Context, podName string, options v1.GetOptions) (result *corev1.EphemeralContainers, err error) { +// UpdateEphemeralContainers takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. +func (c *FakePods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *corev1.Pod, opts v1.UpdateOptions) (result *corev1.Pod, err error) { obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(podsResource, c.ns, "ephemeralcontainers", podName), &corev1.EphemeralContainers{}) + Invokes(testing.NewUpdateSubresourceAction(podsResource, "ephemeralcontainers", c.ns, pod), &corev1.Pod{}) if obj == nil { return nil, err } - return obj.(*corev1.EphemeralContainers), err -} - -// UpdateEphemeralContainers takes the representation of a ephemeralContainers and updates it. Returns the server's representation of the ephemeralContainers, and an error, if there is any. -func (c *FakePods) UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *corev1.EphemeralContainers, opts v1.UpdateOptions) (result *corev1.EphemeralContainers, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(podsResource, "ephemeralcontainers", c.ns, ephemeralContainers), &corev1.EphemeralContainers{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.EphemeralContainers), err + return obj.(*corev1.Pod), err } diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go index d9a718a56f34..31f71b0e48e9 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go @@ -24,7 +24,8 @@ import ( "strings" v1 "k8s.io/api/core/v1" - policy "k8s.io/api/policy/v1beta1" + policyv1 "k8s.io/api/policy/v1" + policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" restclient "k8s.io/client-go/rest" @@ -78,7 +79,23 @@ func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Requ return fakeClient.Request() } -func (c *FakePods) Evict(ctx context.Context, eviction *policy.Eviction) error { +func (c *FakePods) Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error { + return c.EvictV1beta1(ctx, eviction) +} + +func (c *FakePods) EvictV1(ctx context.Context, eviction *policyv1.Eviction) error { + action := core.CreateActionImpl{} + action.Verb = "create" + action.Namespace = c.ns + action.Resource = podsResource + action.Subresource = "eviction" + action.Object = eviction + + _, err := c.Fake.Invokes(action, eviction) + return err +} + +func (c *FakePods) EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error { action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = c.ns diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go index 14b7bd0f04a8..63122cf3fb47 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -52,8 +52,7 @@ type PodInterface interface { Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) - GetEphemeralContainers(ctx context.Context, podName string, options metav1.GetOptions) (*v1.EphemeralContainers, error) - UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *v1.EphemeralContainers, opts metav1.UpdateOptions) (*v1.EphemeralContainers, error) + UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) PodExpansion } @@ -258,30 +257,16 @@ func (c *pods) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguratio return } -// GetEphemeralContainers takes name of the pod, and returns the corresponding v1.EphemeralContainers object, and an error if there is any. -func (c *pods) GetEphemeralContainers(ctx context.Context, podName string, options metav1.GetOptions) (result *v1.EphemeralContainers, err error) { - result = &v1.EphemeralContainers{} - err = c.client.Get(). - Namespace(c.ns). - Resource("pods"). - Name(podName). - SubResource("ephemeralcontainers"). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// UpdateEphemeralContainers takes the top resource name and the representation of a ephemeralContainers and updates it. Returns the server's representation of the ephemeralContainers, and an error, if there is any. -func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *v1.EphemeralContainers, opts metav1.UpdateOptions) (result *v1.EphemeralContainers, err error) { - result = &v1.EphemeralContainers{} +// UpdateEphemeralContainers takes the top resource name and the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. +func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { + result = &v1.Pod{} err = c.client.Put(). Namespace(c.ns). Resource("pods"). Name(podName). SubResource("ephemeralcontainers"). VersionedParams(&opts, scheme.ParameterCodec). - Body(ephemeralContainers). + Body(pod). Do(ctx). Into(result) return diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go index 759fe0ff4a2d..8b6e0e932f92 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go @@ -20,7 +20,8 @@ import ( "context" v1 "k8s.io/api/core/v1" - policy "k8s.io/api/policy/v1beta1" + policyv1 "k8s.io/api/policy/v1" + policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/net" "k8s.io/client-go/kubernetes/scheme" @@ -30,7 +31,16 @@ import ( // The PodExpansion interface allows manually adding extra methods to the PodInterface. type PodExpansion interface { Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error - Evict(ctx context.Context, eviction *policy.Eviction) error + // Evict submits a policy/v1beta1 Eviction request to the pod's eviction subresource. + // Equivalent to calling EvictV1beta1. + // Deprecated: Use EvictV1() (supported in 1.22+) or EvictV1beta1(). + Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error + // EvictV1 submits a policy/v1 Eviction request to the pod's eviction subresource. + // Supported in 1.22+. + EvictV1(ctx context.Context, eviction *policyv1.Eviction) error + // EvictV1beta1 submits a policy/v1beta1 Eviction request to the pod's eviction subresource. + // Supported in 1.22+. + EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper } @@ -40,7 +50,18 @@ func (c *pods) Bind(ctx context.Context, binding *v1.Binding, opts metav1.Create return c.client.Post().Namespace(c.ns).Resource("pods").Name(binding.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("binding").Body(binding).Do(ctx).Error() } -func (c *pods) Evict(ctx context.Context, eviction *policy.Eviction) error { +// Evict submits a policy/v1beta1 Eviction request to the pod's eviction subresource. +// Equivalent to calling EvictV1beta1. +// Deprecated: Use EvictV1() (supported in 1.22+) or EvictV1beta1(). +func (c *pods) Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error { + return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() +} + +func (c *pods) EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error { + return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() +} + +func (c *pods) EvictV1(ctx context.Context, eviction *policyv1.Eviction) error { return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() } diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go index 45c90aca3da7..c41d8dbc2609 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go @@ -54,6 +54,7 @@ type DeploymentInterface interface { ApplyStatus(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error) + ApplyScale(ctx context.Context, deploymentName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (*v1beta1.Scale, error) DeploymentExpansion } @@ -286,3 +287,28 @@ func (c *deployments) UpdateScale(ctx context.Context, deploymentName string, sc Into(result) return } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *deployments) ApplyScale(ctx context.Context, deploymentName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + + result = &v1beta1.Scale{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("deployments"). + Name(deploymentName). + SubResource("scale"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index 97511d300eae..d9506650d1cc 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -210,3 +210,22 @@ func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string } return obj.(*v1beta1.Scale), err } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), &v1beta1.Scale{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Scale), err +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index cf0310acb7bd..a93deca7ef72 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -210,3 +210,22 @@ func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string } return obj.(*v1beta1.Scale), err } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), &v1beta1.Scale{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Scale), err +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go index ee897f75adf4..3c907a3a048f 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -54,6 +54,7 @@ type ReplicaSetInterface interface { ApplyStatus(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error) + ApplyScale(ctx context.Context, replicaSetName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (*v1beta1.Scale, error) ReplicaSetExpansion } @@ -286,3 +287,28 @@ func (c *replicaSets) UpdateScale(ctx context.Context, replicaSetName string, sc Into(result) return } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *replicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + + result = &v1beta1.Scale{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("replicasets"). + Name(replicaSetName). + SubResource("scale"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/doc.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/doc.go new file mode 100644 index 000000000000..3af5d054f102 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/eviction.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/eviction.go new file mode 100644 index 000000000000..cd1aac9c29a3 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/eviction.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + rest "k8s.io/client-go/rest" +) + +// EvictionsGetter has a method to return a EvictionInterface. +// A group's client should implement this interface. +type EvictionsGetter interface { + Evictions(namespace string) EvictionInterface +} + +// EvictionInterface has methods to work with Eviction resources. +type EvictionInterface interface { + EvictionExpansion +} + +// evictions implements EvictionInterface +type evictions struct { + client rest.Interface + ns string +} + +// newEvictions returns a Evictions +func newEvictions(c *PolicyV1Client, namespace string) *evictions { + return &evictions{ + client: c.RESTClient(), + ns: namespace, + } +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/eviction_expansion.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/eviction_expansion.go new file mode 100644 index 000000000000..853187feb5d1 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/eviction_expansion.go @@ -0,0 +1,40 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + "context" + + policy "k8s.io/api/policy/v1" +) + +// The EvictionExpansion interface allows manually adding extra methods to the ScaleInterface. +type EvictionExpansion interface { + Evict(ctx context.Context, eviction *policy.Eviction) error +} + +func (c *evictions) Evict(ctx context.Context, eviction *policy.Eviction) error { + return c.client.Post(). + AbsPath("/api/v1"). + Namespace(eviction.Namespace). + Resource("pods"). + Name(eviction.Name). + SubResource("eviction"). + Body(eviction). + Do(ctx). + Error() +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/doc.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/doc.go new file mode 100644 index 000000000000..16f44399065e --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction.go new file mode 100644 index 000000000000..a579067ce83d --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction.go @@ -0,0 +1,25 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +// FakeEvictions implements EvictionInterface +type FakeEvictions struct { + Fake *FakePolicyV1 + ns string +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go new file mode 100644 index 000000000000..1b6b4ade17eb --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go @@ -0,0 +1,37 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + "context" + + policy "k8s.io/api/policy/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + core "k8s.io/client-go/testing" +) + +func (c *FakeEvictions) Evict(ctx context.Context, eviction *policy.Eviction) error { + action := core.CreateActionImpl{} + action.Verb = "create" + action.Namespace = c.ns + action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} + action.Subresource = "eviction" + action.Object = eviction + + _, err := c.Fake.Invokes(action, eviction) + return err +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go new file mode 100644 index 000000000000..5763782a9018 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go @@ -0,0 +1,190 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + policyv1 "k8s.io/api/policy/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationspolicyv1 "k8s.io/client-go/applyconfigurations/policy/v1" + testing "k8s.io/client-go/testing" +) + +// FakePodDisruptionBudgets implements PodDisruptionBudgetInterface +type FakePodDisruptionBudgets struct { + Fake *FakePolicyV1 + ns string +} + +var poddisruptionbudgetsResource = schema.GroupVersionResource{Group: "policy", Version: "v1", Resource: "poddisruptionbudgets"} + +var poddisruptionbudgetsKind = schema.GroupVersionKind{Group: "policy", Version: "v1", Kind: "PodDisruptionBudget"} + +// Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. +func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options v1.GetOptions) (result *policyv1.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(poddisruptionbudgetsResource, c.ns, name), &policyv1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policyv1.PodDisruptionBudget), err +} + +// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. +func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (result *policyv1.PodDisruptionBudgetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), &policyv1.PodDisruptionBudgetList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &policyv1.PodDisruptionBudgetList{ListMeta: obj.(*policyv1.PodDisruptionBudgetList).ListMeta} + for _, item := range obj.(*policyv1.PodDisruptionBudgetList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested podDisruptionBudgets. +func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(poddisruptionbudgetsResource, c.ns, opts)) + +} + +// Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. +func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudget, opts v1.CreateOptions) (result *policyv1.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &policyv1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policyv1.PodDisruptionBudget), err +} + +// Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. +func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudget, opts v1.UpdateOptions) (result *policyv1.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &policyv1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policyv1.PodDisruptionBudget), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudget, opts v1.UpdateOptions) (*policyv1.PodDisruptionBudget, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget), &policyv1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policyv1.PodDisruptionBudget), err +} + +// Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. +func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(poddisruptionbudgetsResource, c.ns, name), &policyv1.PodDisruptionBudget{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(poddisruptionbudgetsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &policyv1.PodDisruptionBudgetList{}) + return err +} + +// Patch applies the patch and returns the patched podDisruptionBudget. +func (c *FakePodDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *policyv1.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, pt, data, subresources...), &policyv1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policyv1.PodDisruptionBudget), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied podDisruptionBudget. +func (c *FakePodDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *applyconfigurationspolicyv1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *policyv1.PodDisruptionBudget, err error) { + if podDisruptionBudget == nil { + return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") + } + data, err := json.Marshal(podDisruptionBudget) + if err != nil { + return nil, err + } + name := podDisruptionBudget.Name + if name == nil { + return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data), &policyv1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policyv1.PodDisruptionBudget), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakePodDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *applyconfigurationspolicyv1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *policyv1.PodDisruptionBudget, err error) { + if podDisruptionBudget == nil { + return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") + } + data, err := json.Marshal(podDisruptionBudget) + if err != nil { + return nil, err + } + name := podDisruptionBudget.Name + if name == nil { + return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &policyv1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policyv1.PodDisruptionBudget), err +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_policy_client.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_policy_client.go new file mode 100644 index 000000000000..d5bb3d549ae1 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_policy_client.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/client-go/kubernetes/typed/policy/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakePolicyV1 struct { + *testing.Fake +} + +func (c *FakePolicyV1) Evictions(namespace string) v1.EvictionInterface { + return &FakeEvictions{c, namespace} +} + +func (c *FakePolicyV1) PodDisruptionBudgets(namespace string) v1.PodDisruptionBudgetInterface { + return &FakePodDisruptionBudgets{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakePolicyV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/generated_expansion.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/generated_expansion.go new file mode 100644 index 000000000000..e07093d79f8a --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type PodDisruptionBudgetExpansion interface{} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/poddisruptionbudget.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/poddisruptionbudget.go new file mode 100644 index 000000000000..58db3acf9ec6 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/poddisruptionbudget.go @@ -0,0 +1,256 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "k8s.io/api/policy/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + policyv1 "k8s.io/client-go/applyconfigurations/policy/v1" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. +// A group's client should implement this interface. +type PodDisruptionBudgetsGetter interface { + PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface +} + +// PodDisruptionBudgetInterface has methods to work with PodDisruptionBudget resources. +type PodDisruptionBudgetInterface interface { + Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (*v1.PodDisruptionBudget, error) + Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (*v1.PodDisruptionBudget, error) + UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (*v1.PodDisruptionBudget, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PodDisruptionBudget, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PodDisruptionBudgetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) + Apply(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) + ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) + PodDisruptionBudgetExpansion +} + +// podDisruptionBudgets implements PodDisruptionBudgetInterface +type podDisruptionBudgets struct { + client rest.Interface + ns string +} + +// newPodDisruptionBudgets returns a PodDisruptionBudgets +func newPodDisruptionBudgets(c *PolicyV1Client, namespace string) *podDisruptionBudgets { + return &podDisruptionBudgets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. +func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodDisruptionBudget, err error) { + result = &v1.PodDisruptionBudget{} + err = c.client.Get(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. +func (c *podDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PodDisruptionBudgetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested podDisruptionBudgets. +func (c *podDisruptionBudgets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. +func (c *podDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (result *v1.PodDisruptionBudget, err error) { + result = &v1.PodDisruptionBudget{} + err = c.client.Post(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podDisruptionBudget). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. +func (c *podDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { + result = &v1.PodDisruptionBudget{} + err = c.client.Put(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(podDisruptionBudget.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podDisruptionBudget). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *podDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { + result = &v1.PodDisruptionBudget{} + err = c.client.Put(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(podDisruptionBudget.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podDisruptionBudget). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. +func (c *podDisruptionBudgets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *podDisruptionBudgets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched podDisruptionBudget. +func (c *podDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) { + result = &v1.PodDisruptionBudget{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied podDisruptionBudget. +func (c *podDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) { + if podDisruptionBudget == nil { + return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(podDisruptionBudget) + if err != nil { + return nil, err + } + name := podDisruptionBudget.Name + if name == nil { + return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") + } + result = &v1.PodDisruptionBudget{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *podDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) { + if podDisruptionBudget == nil { + return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(podDisruptionBudget) + if err != nil { + return nil, err + } + + name := podDisruptionBudget.Name + if name == nil { + return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") + } + + result = &v1.PodDisruptionBudget{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/policy_client.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/policy_client.go new file mode 100644 index 000000000000..ecd29deb87e1 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/policy_client.go @@ -0,0 +1,94 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/policy/v1" + "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type PolicyV1Interface interface { + RESTClient() rest.Interface + EvictionsGetter + PodDisruptionBudgetsGetter +} + +// PolicyV1Client is used to interact with features provided by the policy group. +type PolicyV1Client struct { + restClient rest.Interface +} + +func (c *PolicyV1Client) Evictions(namespace string) EvictionInterface { + return newEvictions(c, namespace) +} + +func (c *PolicyV1Client) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface { + return newPodDisruptionBudgets(c, namespace) +} + +// NewForConfig creates a new PolicyV1Client for the given config. +func NewForConfig(c *rest.Config) (*PolicyV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &PolicyV1Client{client}, nil +} + +// NewForConfigOrDie creates a new PolicyV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *PolicyV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new PolicyV1Client for the given RESTClient. +func New(c rest.Interface) *PolicyV1Client { + return &PolicyV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *PolicyV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/eviction.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/eviction.go new file mode 100644 index 000000000000..dc5ffa0740f3 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/eviction.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/policy/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// EvictionLister helps list Evictions. +// All objects returned here must be treated as read-only. +type EvictionLister interface { + // List lists all Evictions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Eviction, err error) + // Evictions returns an object that can list and get Evictions. + Evictions(namespace string) EvictionNamespaceLister + EvictionListerExpansion +} + +// evictionLister implements the EvictionLister interface. +type evictionLister struct { + indexer cache.Indexer +} + +// NewEvictionLister returns a new EvictionLister. +func NewEvictionLister(indexer cache.Indexer) EvictionLister { + return &evictionLister{indexer: indexer} +} + +// List lists all Evictions in the indexer. +func (s *evictionLister) List(selector labels.Selector) (ret []*v1.Eviction, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Eviction)) + }) + return ret, err +} + +// Evictions returns an object that can list and get Evictions. +func (s *evictionLister) Evictions(namespace string) EvictionNamespaceLister { + return evictionNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// EvictionNamespaceLister helps list and get Evictions. +// All objects returned here must be treated as read-only. +type EvictionNamespaceLister interface { + // List lists all Evictions in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.Eviction, err error) + // Get retrieves the Eviction from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.Eviction, error) + EvictionNamespaceListerExpansion +} + +// evictionNamespaceLister implements the EvictionNamespaceLister +// interface. +type evictionNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Evictions in the indexer for a given namespace. +func (s evictionNamespaceLister) List(selector labels.Selector) (ret []*v1.Eviction, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Eviction)) + }) + return ret, err +} + +// Get retrieves the Eviction from the indexer for a given namespace and name. +func (s evictionNamespaceLister) Get(name string) (*v1.Eviction, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("eviction"), name) + } + return obj.(*v1.Eviction), nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/expansion_generated.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/expansion_generated.go new file mode 100644 index 000000000000..8e2d55a9117e --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// EvictionListerExpansion allows custom methods to be added to +// EvictionLister. +type EvictionListerExpansion interface{} + +// EvictionNamespaceListerExpansion allows custom methods to be added to +// EvictionNamespaceLister. +type EvictionNamespaceListerExpansion interface{} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/poddisruptionbudget.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/poddisruptionbudget.go new file mode 100644 index 000000000000..8470d38bb299 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/poddisruptionbudget.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/policy/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PodDisruptionBudgetLister helps list PodDisruptionBudgets. +// All objects returned here must be treated as read-only. +type PodDisruptionBudgetLister interface { + // List lists all PodDisruptionBudgets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PodDisruptionBudget, err error) + // PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets. + PodDisruptionBudgets(namespace string) PodDisruptionBudgetNamespaceLister + PodDisruptionBudgetListerExpansion +} + +// podDisruptionBudgetLister implements the PodDisruptionBudgetLister interface. +type podDisruptionBudgetLister struct { + indexer cache.Indexer +} + +// NewPodDisruptionBudgetLister returns a new PodDisruptionBudgetLister. +func NewPodDisruptionBudgetLister(indexer cache.Indexer) PodDisruptionBudgetLister { + return &podDisruptionBudgetLister{indexer: indexer} +} + +// List lists all PodDisruptionBudgets in the indexer. +func (s *podDisruptionBudgetLister) List(selector labels.Selector) (ret []*v1.PodDisruptionBudget, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PodDisruptionBudget)) + }) + return ret, err +} + +// PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets. +func (s *podDisruptionBudgetLister) PodDisruptionBudgets(namespace string) PodDisruptionBudgetNamespaceLister { + return podDisruptionBudgetNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// PodDisruptionBudgetNamespaceLister helps list and get PodDisruptionBudgets. +// All objects returned here must be treated as read-only. +type PodDisruptionBudgetNamespaceLister interface { + // List lists all PodDisruptionBudgets in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PodDisruptionBudget, err error) + // Get retrieves the PodDisruptionBudget from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PodDisruptionBudget, error) + PodDisruptionBudgetNamespaceListerExpansion +} + +// podDisruptionBudgetNamespaceLister implements the PodDisruptionBudgetNamespaceLister +// interface. +type podDisruptionBudgetNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all PodDisruptionBudgets in the indexer for a given namespace. +func (s podDisruptionBudgetNamespaceLister) List(selector labels.Selector) (ret []*v1.PodDisruptionBudget, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PodDisruptionBudget)) + }) + return ret, err +} + +// Get retrieves the PodDisruptionBudget from the indexer for a given namespace and name. +func (s podDisruptionBudgetNamespaceLister) Get(name string) (*v1.PodDisruptionBudget, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("poddisruptionbudget"), name) + } + return obj.(*v1.PodDisruptionBudget), nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/poddisruptionbudget_expansion.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/poddisruptionbudget_expansion.go new file mode 100644 index 000000000000..f63851ad48be --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1/poddisruptionbudget_expansion.go @@ -0,0 +1,69 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + "fmt" + + "k8s.io/api/core/v1" + policy "k8s.io/api/policy/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/klog/v2" +) + +// PodDisruptionBudgetListerExpansion allows custom methods to be added to +// PodDisruptionBudgetLister. +type PodDisruptionBudgetListerExpansion interface { + GetPodPodDisruptionBudgets(pod *v1.Pod) ([]*policy.PodDisruptionBudget, error) +} + +// PodDisruptionBudgetNamespaceListerExpansion allows custom methods to be added to +// PodDisruptionBudgetNamespaceLister. +type PodDisruptionBudgetNamespaceListerExpansion interface{} + +// GetPodPodDisruptionBudgets returns a list of PodDisruptionBudgets matching a pod. +func (s *podDisruptionBudgetLister) GetPodPodDisruptionBudgets(pod *v1.Pod) ([]*policy.PodDisruptionBudget, error) { + var selector labels.Selector + + list, err := s.PodDisruptionBudgets(pod.Namespace).List(labels.Everything()) + if err != nil { + return nil, err + } + + var pdbList []*policy.PodDisruptionBudget + for i := range list { + pdb := list[i] + selector, err = metav1.LabelSelectorAsSelector(pdb.Spec.Selector) + if err != nil { + klog.Warningf("invalid selector: %v", err) + continue + } + + // Unlike the v1beta version, here we let an empty selector match everything. + if !selector.Matches(labels.Set(pod.Labels)) { + continue + } + pdbList = append(pdbList, pdb) + } + + if len(pdbList) == 0 { + return nil, fmt.Errorf("could not find PodDisruptionBudget for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) + } + + return pdbList, nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget_expansion.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget_expansion.go index e93c3647b52d..dce5dca82083 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget_expansion.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget_expansion.go @@ -40,10 +40,6 @@ type PodDisruptionBudgetNamespaceListerExpansion interface{} func (s *podDisruptionBudgetLister) GetPodPodDisruptionBudgets(pod *v1.Pod) ([]*policy.PodDisruptionBudget, error) { var selector labels.Selector - if len(pod.Labels) == 0 { - return nil, fmt.Errorf("no PodDisruptionBudgets found for pod %v because it has no labels", pod.Name) - } - list, err := s.PodDisruptionBudgets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go b/cluster-autoscaler/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go index b23e57dde636..52655c0bcb33 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go @@ -461,7 +461,7 @@ func (a *Authenticator) refreshCredsLocked(r *clientauthentication.Response) err if oldCreds != nil && !reflect.DeepEqual(oldCreds.cert, a.cachedCreds.cert) { // Can be nil if the exec auth plugin only returned token auth. if oldCreds.cert != nil && oldCreds.cert.Leaf != nil { - metrics.ClientCertRotationAge.Observe(time.Now().Sub(oldCreds.cert.Leaf.NotBefore)) + metrics.ClientCertRotationAge.Observe(time.Since(oldCreds.cert.Leaf.NotBefore)) } a.connTracker.CloseAll() } diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/rest/OWNERS b/cluster-autoscaler/vendor/k8s.io/client-go/rest/OWNERS index 0d574e0568e9..597484b4a4df 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/rest/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/client-go/rest/OWNERS @@ -8,7 +8,6 @@ reviewers: - deads2k - brendandburns - liggitt -- erictune - sttts - luxas - dims diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/rest/request.go b/cluster-autoscaler/vendor/k8s.io/client-go/rest/request.go index 0ac0e8eab854..6f4c0b054af1 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/rest/request.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/rest/request.go @@ -602,7 +602,7 @@ func (r *Request) tryThrottleWithInfo(ctx context.Context, retryInfo string) err if latency > extraLongThrottleLatency { // If the rate limiter latency is very high, the log message should be printed at a higher log level, // but we use a throttled logger to prevent spamming. - globalThrottledLogger.Infof(message) + globalThrottledLogger.Infof("%s", message) } metrics.RateLimiterLatency.Observe(ctx, r.verb, r.finalURLTemplate(), latency) diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/OWNERS b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/OWNERS index 6562ee5c7aa0..c4824d6bcefd 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/OWNERS @@ -20,7 +20,6 @@ reviewers: - caesarxuchao - mikedanese - liggitt -- erictune - davidopp - pmorie - janetkuo @@ -31,7 +30,6 @@ reviewers: - hongchaodeng - krousey - xiang90 -- mml - ingvagabund - resouer - jessfraz diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/delta_fifo.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/delta_fifo.go index f648673e1118..1464d34c62d8 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/delta_fifo.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/delta_fifo.go @@ -340,7 +340,7 @@ func (f *DeltaFIFO) AddIfNotPresent(obj interface{}) error { if !ok { return fmt.Errorf("object must be of type deltas, but got: %#v", obj) } - id, err := f.KeyOf(deltas.Newest().Object) + id, err := f.KeyOf(deltas) if err != nil { return KeyError{obj, err} } @@ -373,13 +373,8 @@ func dedupDeltas(deltas Deltas) Deltas { a := &deltas[n-1] b := &deltas[n-2] if out := isDup(a, b); out != nil { - // `a` and `b` are duplicates. Only keep the one returned from isDup(). - // TODO: This extra array allocation and copy seems unnecessary if - // all we do to dedup is compare the new delta with the last element - // in `items`, which could be done by mutating `items` directly. - // Might be worth profiling and investigating if it is safe to optimize. - d := append(Deltas{}, deltas[:n-2]...) - return append(d, *out) + deltas[n-2] = *out + return deltas[:n-1] } return deltas } diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/mutation_detector.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/mutation_detector.go index 4611e80ff0a8..b37537cbd89d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/mutation_detector.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/mutation_detector.go @@ -99,7 +99,7 @@ func (d *defaultCacheMutationDetector) Run(stopCh <-chan struct{}) { for { if d.lastRotated.IsZero() { d.lastRotated = time.Now() - } else if time.Now().Sub(d.lastRotated) > d.retainDuration { + } else if time.Since(d.lastRotated) > d.retainDuration { d.retainedCachedObjs = d.cachedObjs d.cachedObjs = nil d.lastRotated = time.Now() diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/reflector.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/reflector.go index 360d7304b7ff..c732c782207b 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/reflector.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/reflector.go @@ -417,7 +417,8 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { // It doesn't make sense to re-list all objects because most likely we will be able to restart // watch where we ended. // If that's the case begin exponentially backing off and resend watch request. - if utilnet.IsConnectionRefused(err) { + // Do the same for "429" errors. + if utilnet.IsConnectionRefused(err) || apierrors.IsTooManyRequests(err) { <-r.initConnBackoffManager.Backoff().C() continue } @@ -432,6 +433,10 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { // has a semantic that it returns data at least as fresh as provided RV. // So first try to LIST with setting RV to resource version of last observed object. klog.V(4).Infof("%s: watch of %v closed with: %v", r.name, r.expectedTypeName, err) + case apierrors.IsTooManyRequests(err): + klog.V(2).Infof("%s: watch of %v returned 429 - backing off", r.name, r.expectedTypeName) + <-r.initConnBackoffManager.Backoff().C() + continue default: klog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedTypeName, err) } diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/store.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/store.go index 886e95d2deb6..24ffabab7b51 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/store.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/store.go @@ -85,6 +85,11 @@ func (k KeyError) Error() string { return fmt.Sprintf("couldn't create key for object %+v: %v", k.Obj, k.Err) } +// Unwrap implements errors.Unwrap +func (k KeyError) Unwrap() error { + return k.Err +} + // ExplicitKey can be passed to MetaNamespaceKeyFunc if you have the key for // the object but not the object itself. type ExplicitKey string diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/events/OWNERS b/cluster-autoscaler/vendor/k8s.io/client-go/tools/events/OWNERS index fbd0a6a013d7..05d68e687f31 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/events/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/events/OWNERS @@ -1,8 +1,10 @@ # See the OWNERS docs at https://go.k8s.io/owners approvers: +- sig-instrumentation-approvers - yastij - wojtek-t reviewers: +- sig-instrumentation-reviewers - yastij - wojtek-t diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go index 3f6b898e37ac..55f34fd3e798 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go @@ -56,6 +56,7 @@ import ( "bytes" "context" "fmt" + "sync" "time" "k8s.io/apimachinery/pkg/api/errors" @@ -187,6 +188,9 @@ type LeaderElector struct { // clock is wrapper around time to allow for less flaky testing clock clock.Clock + // used to lock the observedRecord + observedRecordLock sync.Mutex + metrics leaderMetricsAdapter } @@ -224,13 +228,14 @@ func RunOrDie(ctx context.Context, lec LeaderElectionConfig) { // GetLeader returns the identity of the last observed leader or returns the empty string if // no leader has yet been observed. +// This function is for informational purposes. (e.g. monitoring, logs, etc.) func (le *LeaderElector) GetLeader() string { - return le.observedRecord.HolderIdentity + return le.getObservedRecord().HolderIdentity } // IsLeader returns true if the last observed leader was this client else returns false. func (le *LeaderElector) IsLeader() bool { - return le.observedRecord.HolderIdentity == le.config.Lock.Identity() + return le.getObservedRecord().HolderIdentity == le.config.Lock.Identity() } // acquire loops calling tryAcquireOrRenew and returns true immediately when tryAcquireOrRenew succeeds. @@ -301,8 +306,8 @@ func (le *LeaderElector) release() bool { klog.Errorf("Failed to release lock: %v", err) return false } - le.observedRecord = leaderElectionRecord - le.observedTime = le.clock.Now() + + le.setObservedRecord(&leaderElectionRecord) return true } @@ -329,16 +334,17 @@ func (le *LeaderElector) tryAcquireOrRenew(ctx context.Context) bool { klog.Errorf("error initially creating leader election record: %v", err) return false } - le.observedRecord = leaderElectionRecord - le.observedTime = le.clock.Now() + + le.setObservedRecord(&leaderElectionRecord) + return true } // 2. Record obtained, check the Identity & Time if !bytes.Equal(le.observedRawRecord, oldLeaderElectionRawRecord) { - le.observedRecord = *oldLeaderElectionRecord + le.setObservedRecord(oldLeaderElectionRecord) + le.observedRawRecord = oldLeaderElectionRawRecord - le.observedTime = le.clock.Now() } if len(oldLeaderElectionRecord.HolderIdentity) > 0 && le.observedTime.Add(le.config.LeaseDuration).After(now.Time) && @@ -362,8 +368,7 @@ func (le *LeaderElector) tryAcquireOrRenew(ctx context.Context) bool { return false } - le.observedRecord = leaderElectionRecord - le.observedTime = le.clock.Now() + le.setObservedRecord(&leaderElectionRecord) return true } @@ -392,3 +397,22 @@ func (le *LeaderElector) Check(maxTolerableExpiredLease time.Duration) error { return nil } + +// setObservedRecord will set a new observedRecord and update observedTime to the current time. +// Protect critical sections with lock. +func (le *LeaderElector) setObservedRecord(observedRecord *rl.LeaderElectionRecord) { + le.observedRecordLock.Lock() + defer le.observedRecordLock.Unlock() + + le.observedRecord = *observedRecord + le.observedTime = le.clock.Now() +} + +// getObservedRecord returns observersRecord. +// Protect critical sections with lock. +func (le *LeaderElector) getObservedRecord() rl.LeaderElectionRecord { + le.observedRecordLock.Lock() + defer le.observedRecordLock.Unlock() + + return le.observedRecord +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/OWNERS b/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/OWNERS index 00f97896a07d..e7e739b1503d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/OWNERS @@ -1,27 +1,6 @@ # See the OWNERS docs at https://go.k8s.io/owners reviewers: -- lavalamp -- smarterclayton -- wojtek-t -- deads2k -- derekwaynecarr -- caesarxuchao -- vishh -- mikedanese -- liggitt -- erictune -- pmorie -- dchen1107 -- saad-ali -- luxas -- yifan-gu -- mwielgus -- timothysc -- jsafrane -- dims -- krousey -- a-robinson -- aveshagarwal -- resouer -- cjcullen +- sig-instrumentation-reviewers +approvers: +- sig-instrumentation-approvers diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/events_cache.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/events_cache.go index 9374612f2628..329c7ce57530 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/events_cache.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/events_cache.go @@ -25,7 +25,7 @@ import ( "github.com/golang/groupcache/lru" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apimachinery/pkg/util/sets" @@ -175,7 +175,7 @@ func EventAggregatorByReasonFunc(event *v1.Event) (string, string) { // EventAggregatorMessageFunc is responsible for producing an aggregation message type EventAggregatorMessageFunc func(event *v1.Event) string -// EventAggregratorByReasonMessageFunc returns an aggregate message by prefixing the incoming message +// EventAggregatorByReasonMessageFunc returns an aggregate message by prefixing the incoming message func EventAggregatorByReasonMessageFunc(event *v1.Event) string { return "(combined from similar events): " + event.Message } @@ -420,7 +420,7 @@ type EventCorrelateResult struct { // prior to interacting with the API server to record the event. // // The default behavior is as follows: -// * Aggregation is performed if a similar event is recorded 10 times in a +// * Aggregation is performed if a similar event is recorded 10 times // in a 10 minute rolling interval. A similar event is an event that varies only by // the Event.Message field. Rather than recording the precise event, aggregation // will create a new event whose message reports that it has combined events with diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/watch/until.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/watch/until.go index b644fe7c059d..bf74837d3626 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/watch/until.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/watch/until.go @@ -95,7 +95,7 @@ func UntilWithoutRetry(ctx context.Context, watcher watch.Interface, conditions // Until wraps the watcherClient's watch function with RetryWatcher making sure that watcher gets restarted in case of errors. // The initialResourceVersion will be given to watch method when first called. It shall not be "" or "0" -// given the underlying WATCH call issues (#74022). If you want the initial list ("", "0") done for you use ListWatchUntil instead. +// given the underlying WATCH call issues (#74022). // Remaining behaviour is identical to function UntilWithoutRetry. (See above.) // Until can deal with API timeouts and lost connections. // It guarantees you to see all events and in the order they happened. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/transport/transport.go b/cluster-autoscaler/vendor/k8s.io/client-go/transport/transport.go index 88d89494d728..083364fd6de4 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/transport/transport.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/transport/transport.go @@ -269,7 +269,7 @@ type certificateCacheEntry struct { // isStale returns true when this cache entry is too old to be usable func (c *certificateCacheEntry) isStale() bool { - return time.Now().Sub(c.birth) > time.Second + return time.Since(c.birth) > time.Second } func newCertificateCacheEntry(certFile, keyFile string) certificateCacheEntry { diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/util/certificate/certificate_manager.go b/cluster-autoscaler/vendor/k8s.io/client-go/util/certificate/certificate_manager.go index 1afa1c1c21c5..26a01a1d2ca0 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/util/certificate/certificate_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/util/certificate/certificate_manager.go @@ -124,6 +124,14 @@ type Config struct { // CertifcateRenewFailure will record a metric that keeps track of // certificate renewal failures. CertificateRenewFailure Counter + // Name is an optional string that will be used when writing log output + // or returning errors from manager methods. If not set, SignerName will + // be used, if SignerName is not set, if Usages includes client auth the + // name will be "client auth", otherwise the value will be "server". + Name string + // Logf is an optional function that log output will be sent to from the + // certificate manager. If not set it will use klog.V(2) + Logf func(format string, args ...interface{}) } // Store is responsible for getting and updating the current certificate. @@ -199,6 +207,9 @@ type manager struct { // Set to time.Now but can be stubbed out for testing now func() time.Time + + name string + logf func(format string, args ...interface{}) } // NewManager returns a new certificate manager. A certificate manager is @@ -233,6 +244,25 @@ func NewManager(config *Config) (Manager, error) { now: time.Now, } + name := config.Name + if len(name) == 0 { + name = m.signerName + } + if len(name) == 0 { + switch { + case hasKeyUsage(config.Usages, certificates.UsageClientAuth): + name = string(certificates.UsageClientAuth) + default: + name = "certificate" + } + } + + m.name = name + m.logf = config.Logf + if m.logf == nil { + m.logf = func(format string, args ...interface{}) { klog.V(2).Infof(format, args...) } + } + return &m, nil } @@ -244,7 +274,7 @@ func (m *manager) Current() *tls.Certificate { m.certAccessLock.RLock() defer m.certAccessLock.RUnlock() if m.cert != nil && m.cert.Leaf != nil && m.now().After(m.cert.Leaf.NotAfter) { - klog.V(2).Infof("Current certificate is expired.") + m.logf("%s: Current certificate is expired", m.name) return nil } return m.cert @@ -275,17 +305,16 @@ func (m *manager) Start() { // signing API, so don't start the certificate manager if we don't have a // client. if m.clientsetFn == nil { - klog.V(2).Infof("Certificate rotation is not enabled, no connection to the apiserver.") + m.logf("%s: Certificate rotation is not enabled, no connection to the apiserver", m.name) return } - - klog.V(2).Infof("Certificate rotation is enabled.") + m.logf("%s: Certificate rotation is enabled", m.name) templateChanged := make(chan struct{}) go wait.Until(func() { deadline := m.nextRotationDeadline() if sleepInterval := deadline.Sub(m.now()); sleepInterval > 0 { - klog.V(2).Infof("Waiting %v for next certificate rotation", sleepInterval) + m.logf("%s: Waiting %v for next certificate rotation", m.name, sleepInterval) timer := time.NewTimer(sleepInterval) defer timer.Stop() @@ -299,7 +328,7 @@ func (m *manager) Start() { // if the template now matches what we last requested, restart the rotation deadline loop return } - klog.V(2).Infof("Certificate template changed, rotating") + m.logf("%s: Certificate template changed, rotating", m.name) } } @@ -315,7 +344,7 @@ func (m *manager) Start() { Steps: 5, } if err := wait.ExponentialBackoff(backoff, m.rotateCerts); err != nil { - utilruntime.HandleError(fmt.Errorf("Reached backoff limit, still unable to rotate certs: %v", err)) + utilruntime.HandleError(fmt.Errorf("%s: Reached backoff limit, still unable to rotate certs: %v", m.name, err)) wait.PollInfinite(32*time.Second, m.rotateCerts) } }, time.Second, m.stopCh) @@ -381,8 +410,6 @@ func getCurrentCertificateOrBootstrap( if _, err := store.Update(bootstrapCertificatePEM, bootstrapKeyPEM); err != nil { utilruntime.HandleError(fmt.Errorf("Unable to set the cert/key pair to the bootstrap certificate: %v", err)) - } else { - klog.V(4).Infof("Updated the store to contain the initial bootstrap certificate") } return &bootstrapCert, true, nil @@ -409,11 +436,11 @@ func (m *manager) RotateCerts() (bool, error) { // from the server on the various calls it makes. // TODO: return errors, have callers handle and log them correctly func (m *manager) rotateCerts() (bool, error) { - klog.V(2).Infof("Rotating certificates") + m.logf("%s: Rotating certificates", m.name) template, csrPEM, keyPEM, privateKey, err := m.generateCSR() if err != nil { - utilruntime.HandleError(fmt.Errorf("Unable to generate a certificate signing request: %v", err)) + utilruntime.HandleError(fmt.Errorf("%s: Unable to generate a certificate signing request: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } @@ -423,7 +450,7 @@ func (m *manager) rotateCerts() (bool, error) { // request the client each time clientSet, err := m.getClientset() if err != nil { - utilruntime.HandleError(fmt.Errorf("Unable to load a client to request certificates: %v", err)) + utilruntime.HandleError(fmt.Errorf("%s: Unable to load a client to request certificates: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } @@ -434,7 +461,7 @@ func (m *manager) rotateCerts() (bool, error) { // new private key. reqName, reqUID, err := csr.RequestCertificate(clientSet, csrPEM, "", m.signerName, m.usages, privateKey) if err != nil { - utilruntime.HandleError(fmt.Errorf("Failed while requesting a signed certificate from the master: %v", err)) + utilruntime.HandleError(fmt.Errorf("%s: Failed while requesting a signed certificate from the control plane: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } @@ -451,7 +478,7 @@ func (m *manager) rotateCerts() (bool, error) { // is a remainder after the old design using raw watch wrapped with backoff. crtPEM, err := csr.WaitForCertificate(ctx, clientSet, reqName, reqUID) if err != nil { - utilruntime.HandleError(fmt.Errorf("certificate request was not signed: %v", err)) + utilruntime.HandleError(fmt.Errorf("%s: certificate request was not signed: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } @@ -460,7 +487,7 @@ func (m *manager) rotateCerts() (bool, error) { cert, err := m.certStore.Update(crtPEM, keyPEM) if err != nil { - utilruntime.HandleError(fmt.Errorf("Unable to store the new cert/key pair: %v", err)) + utilruntime.HandleError(fmt.Errorf("%s: Unable to store the new cert/key pair: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } @@ -488,7 +515,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { if template := m.getTemplate(); template != nil { if template.Subject.CommonName != m.cert.Leaf.Subject.CommonName { - klog.V(2).Infof("Current certificate CN (%s) does not match requested CN (%s)", m.cert.Leaf.Subject.CommonName, template.Subject.CommonName) + m.logf("%s: Current certificate CN (%s) does not match requested CN (%s)", m.name, m.cert.Leaf.Subject.CommonName, template.Subject.CommonName) return false } @@ -496,7 +523,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { desiredDNSNames := sets.NewString(template.DNSNames...) missingDNSNames := desiredDNSNames.Difference(currentDNSNames) if len(missingDNSNames) > 0 { - klog.V(2).Infof("Current certificate is missing requested DNS names %v", missingDNSNames.List()) + m.logf("%s: Current certificate is missing requested DNS names %v", m.name, missingDNSNames.List()) return false } @@ -510,7 +537,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { } missingIPs := desiredIPs.Difference(currentIPs) if len(missingIPs) > 0 { - klog.V(2).Infof("Current certificate is missing requested IP addresses %v", missingIPs.List()) + m.logf("%s: Current certificate is missing requested IP addresses %v", m.name, missingIPs.List()) return false } @@ -518,7 +545,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { desiredOrgs := sets.NewString(template.Subject.Organization...) missingOrgs := desiredOrgs.Difference(currentOrgs) if len(missingOrgs) > 0 { - klog.V(2).Infof("Current certificate is missing requested orgs %v", missingOrgs.List()) + m.logf("%s: Current certificate is missing requested orgs %v", m.name, missingOrgs.List()) return false } } @@ -553,7 +580,7 @@ func (m *manager) nextRotationDeadline() time.Time { totalDuration := float64(notAfter.Sub(m.cert.Leaf.NotBefore)) deadline := m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration)) - klog.V(2).Infof("Certificate expiration is %v, rotation deadline is %v", notAfter, deadline) + m.logf("%s: Certificate expiration is %v, rotation deadline is %v", m.name, notAfter, deadline) return deadline } @@ -607,22 +634,22 @@ func (m *manager) generateCSR() (template *x509.CertificateRequest, csrPEM []byt // Generate a new private key. privateKey, err := ecdsa.GenerateKey(elliptic.P256(), cryptorand.Reader) if err != nil { - return nil, nil, nil, nil, fmt.Errorf("unable to generate a new private key: %v", err) + return nil, nil, nil, nil, fmt.Errorf("%s: unable to generate a new private key: %v", m.name, err) } der, err := x509.MarshalECPrivateKey(privateKey) if err != nil { - return nil, nil, nil, nil, fmt.Errorf("unable to marshal the new key to DER: %v", err) + return nil, nil, nil, nil, fmt.Errorf("%s: unable to marshal the new key to DER: %v", m.name, err) } keyPEM = pem.EncodeToMemory(&pem.Block{Type: keyutil.ECPrivateKeyBlockType, Bytes: der}) template = m.getTemplate() if template == nil { - return nil, nil, nil, nil, fmt.Errorf("unable to create a csr, no template available") + return nil, nil, nil, nil, fmt.Errorf("%s: unable to create a csr, no template available", m.name) } csrPEM, err = cert.MakeCSRFromTemplate(privateKey, template) if err != nil { - return nil, nil, nil, nil, fmt.Errorf("unable to create a csr from the private key: %v", err) + return nil, nil, nil, nil, fmt.Errorf("%s: unable to create a csr from the private key: %v", m.name, err) } return template, csrPEM, keyPEM, privateKey, nil } @@ -639,3 +666,12 @@ func (m *manager) setLastRequest(cancel context.CancelFunc, r *x509.CertificateR m.lastRequestCancel = cancel m.lastRequest = r } + +func hasKeyUsage(usages []certificates.KeyUsage, usage certificates.KeyUsage) bool { + for _, u := range usages { + if u == usage { + return true + } + } + return false +} diff --git a/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.mod b/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.mod index 08fc2cafbb4a..23f18fec9954 100644 --- a/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.mod +++ b/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.mod @@ -9,21 +9,21 @@ require ( github.com/spf13/cobra v1.1.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.6.1 - k8s.io/api v0.21.0-beta.1 - k8s.io/apimachinery v0.21.0-beta.1 - k8s.io/apiserver v0.21.0-beta.1 - k8s.io/client-go v0.21.0-beta.1 - k8s.io/component-base v0.21.0-beta.1 - k8s.io/controller-manager v0.21.0-beta.1 - k8s.io/klog/v2 v2.5.0 + k8s.io/api v0.22.0-alpha.1 + k8s.io/apimachinery v0.22.0-alpha.1 + k8s.io/apiserver v0.22.0-alpha.1 + k8s.io/client-go v0.22.0-alpha.1 + k8s.io/component-base v0.22.0-alpha.1 + k8s.io/controller-manager v0.22.0-alpha.1 + k8s.io/klog/v2 v2.8.0 k8s.io/utils v0.0.0-20201110183641-67b214c5f920 ) replace ( - k8s.io/api => k8s.io/api v0.21.0-beta.1 - k8s.io/apimachinery => k8s.io/apimachinery v0.21.0-beta.1 - k8s.io/apiserver => k8s.io/apiserver v0.21.0-beta.1 - k8s.io/client-go => k8s.io/client-go v0.21.0-beta.1 - k8s.io/component-base => k8s.io/component-base v0.21.0-beta.1 - k8s.io/controller-manager => k8s.io/controller-manager v0.21.0-beta.1 + k8s.io/api => k8s.io/api v0.22.0-alpha.1 + k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.1 + k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.1 + k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.1 + k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.1 + k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.1 ) diff --git a/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.sum b/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.sum index 2982a30b2069..2aca3ed8424e 100644 --- a/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.sum +++ b/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.sum @@ -25,8 +25,9 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= +github.com/Azure/go-autorest/autorest v0.11.17/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.10/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= @@ -84,6 +85,8 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -116,16 +119,10 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.5 h1:Xm0Ao53uqnk9QE/LlYV5DEU09UAgpliA85QoT9LzqPw= -github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -186,8 +183,8 @@ github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= +github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= @@ -243,13 +240,10 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -275,8 +269,8 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd h1:aY7OQNf2XqY/JQ6qREWamhI/81os/agb2BAGpcx5yWI= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -340,8 +334,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= @@ -361,12 +355,13 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn 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/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -389,18 +384,22 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= +go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -427,6 +426,7 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -436,6 +436,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ= +golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -493,7 +495,6 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -510,8 +511,10 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -543,13 +546,14 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -568,6 +572,8 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -656,29 +662,37 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/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 h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.21.0-beta.1/go.mod h1:8A+GKfJYDnFlmsIqnwi7z2l5+GwI3fbIdAkPu3xiZKA= -k8s.io/apimachinery v0.21.0-beta.1/go.mod h1:ZaN7d/yx5I8h2mk8Nu08sdLigsmkt4flkTxCTc9LElI= -k8s.io/apiserver v0.21.0-beta.1/go.mod h1:nl/H4DPS1abtRhCj8bhosbyU9XOgnMt0QFK3fAFEhSE= -k8s.io/client-go v0.21.0-beta.1/go.mod h1:SsWZEBajlozcXLnUS7OD47n9MtuzduVt02GMQO2/DIA= -k8s.io/component-base v0.21.0-beta.1/go.mod h1:WPMZyV0sNk3ruzA8cWt1EO2KWAnLDK2docEC14JWbTM= -k8s.io/controller-manager v0.21.0-beta.1/go.mod h1:n1shQUgOvkQZiXMsQ9b1VziquCUPn4RNuWLw9zAgZeY= +k8s.io/api v0.22.0-alpha.1 h1:LuUYyELM7hm5I7B8pjn8dhZHQTcw86C/bFBNNu0/QoY= +k8s.io/api v0.22.0-alpha.1/go.mod h1:vQHAkhGeeRA6zI8QNe3tcuQqGXanfyk6mehgpyIHcpY= +k8s.io/apimachinery v0.22.0-alpha.1 h1:5H8J1su7o60La1W4iOytFrsn2DeRxd9NXVxulXWOdOE= +k8s.io/apimachinery v0.22.0-alpha.1/go.mod h1:fBRSkoylGO2QUTae8Wb2wac6pZ83/r+tL6HFSXGbzfs= +k8s.io/apiserver v0.22.0-alpha.1 h1:1KEDWuHHLCbH+Q/qR8gZRCJdbmoEcRanjsvTvG/AAR0= +k8s.io/apiserver v0.22.0-alpha.1/go.mod h1:EBtDCYoV1+DxaNcB9OD61zUUyWlUaJ5a9CHwQKTD5Qg= +k8s.io/client-go v0.22.0-alpha.1 h1:RHT0MJXzZLwNhL8lluEko7zQ4n0fRn2TtmiZPiQI/fY= +k8s.io/client-go v0.22.0-alpha.1/go.mod h1:9onZcKpTRbDD0wiJC/T1toeVMYPyCQPgWHDn4xpQsHA= +k8s.io/component-base v0.22.0-alpha.1 h1:X33MURXK6wXVMH4u28ckqXakOv1YBaB13FuPpUed8Y0= +k8s.io/component-base v0.22.0-alpha.1/go.mod h1:mglpF0fcNfkUMD+FaqSzEE/nop+WUlBrujXwYG5gthg= +k8s.io/controller-manager v0.22.0-alpha.1 h1:Bab20wU/lOkNlPwdyhDu4r23wJs3g1KxJ35hUM4wGhg= +k8s.io/controller-manager v0.22.0-alpha.1/go.mod h1:3LoOmi7qe/dMhTgruY0iE8sYzMAq7sHwmPUYPKrKjW8= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.5.0 h1:8mOnjf1RmUPW6KRqQCfYSZq/K20Unmp3IhuZUhxl8KI= -k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= +k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= @@ -687,8 +701,8 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15 h1:4uqm9Mv+w2MmBYD+F4qf/v6tDFUdPOk29C095RbU5mY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.1 h1:nYqY2A6oy37sKLYuSBXuQhbj4JVclzJK13BOIvJG5XU= +sigs.k8s.io/structured-merge-diff/v4 v4.1.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/cluster-autoscaler/vendor/k8s.io/cloud-provider/volume/helpers/rounding.go b/cluster-autoscaler/vendor/k8s.io/cloud-provider/volume/helpers/rounding.go index 7adf345007af..101815738032 100644 --- a/cluster-autoscaler/vendor/k8s.io/cloud-provider/volume/helpers/rounding.go +++ b/cluster-autoscaler/vendor/k8s.io/cloud-provider/volume/helpers/rounding.go @@ -18,10 +18,22 @@ package helpers import ( "fmt" + "math" + "math/bits" "k8s.io/apimachinery/pkg/api/resource" ) +/* +The Cloud Provider's volume plugins provision disks for corresponding +PersistentVolumeClaims. Cloud Providers use different allocation unit for their +disk sizes. AWS allows you to specify the size as an integer amount of GiB, +while Portworx expects bytes for example. On AWS, if you want a volume of +1500MiB, the actual call to the AWS API should therefore be for a 2GiB disk. +This file contains functions that help rounding a storage request based on a +Cloud Provider's allocation unit. +*/ + const ( // GB - GigaByte size GB = 1000 * 1000 * 1000 @@ -41,139 +53,113 @@ const ( // RoundUpToGiB rounds up given quantity upto chunks of GiB func RoundUpToGiB(size resource.Quantity) (int64, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSize(requestBytes, GiB), nil + return roundUpSizeInt64(size, GiB) } // RoundUpToMB rounds up given quantity to chunks of MB func RoundUpToMB(size resource.Quantity) (int64, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSize(requestBytes, MB), nil + return roundUpSizeInt64(size, MB) } // RoundUpToMiB rounds up given quantity upto chunks of MiB func RoundUpToMiB(size resource.Quantity) (int64, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSize(requestBytes, MiB), nil + return roundUpSizeInt64(size, MiB) } // RoundUpToKB rounds up given quantity to chunks of KB func RoundUpToKB(size resource.Quantity) (int64, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSize(requestBytes, KB), nil + return roundUpSizeInt64(size, KB) } -// RoundUpToKiB rounds up given quantity upto chunks of KiB +// RoundUpToKiB rounds up given quantity to chunks of KiB func RoundUpToKiB(size resource.Quantity) (int64, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSize(requestBytes, KiB), nil + return roundUpSizeInt64(size, KiB) +} + +// RoundUpToB rounds up given quantity to chunks of bytes +func RoundUpToB(size resource.Quantity) (int64, error) { + return roundUpSizeInt64(size, 1) } // RoundUpToGiBInt rounds up given quantity upto chunks of GiB. It returns an // int instead of an int64 and an error if there's overflow func RoundUpToGiBInt(size resource.Quantity) (int, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSizeInt(requestBytes, GiB) + return roundUpSizeInt(size, GiB) } // RoundUpToMBInt rounds up given quantity to chunks of MB. It returns an // int instead of an int64 and an error if there's overflow func RoundUpToMBInt(size resource.Quantity) (int, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSizeInt(requestBytes, MB) + return roundUpSizeInt(size, MB) } // RoundUpToMiBInt rounds up given quantity upto chunks of MiB. It returns an // int instead of an int64 and an error if there's overflow func RoundUpToMiBInt(size resource.Quantity) (int, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSizeInt(requestBytes, MiB) + return roundUpSizeInt(size, MiB) } // RoundUpToKBInt rounds up given quantity to chunks of KB. It returns an // int instead of an int64 and an error if there's overflow func RoundUpToKBInt(size resource.Quantity) (int, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSizeInt(requestBytes, KB) + return roundUpSizeInt(size, KB) } // RoundUpToKiBInt rounds up given quantity upto chunks of KiB. It returns an // int instead of an int64 and an error if there's overflow func RoundUpToKiBInt(size resource.Quantity) (int, error) { - requestBytes := size.Value() - return roundUpSizeInt(requestBytes, KiB) + return roundUpSizeInt(size, KiB) } // RoundUpToGiBInt32 rounds up given quantity up to chunks of GiB. It returns an // int32 instead of an int64 and an error if there's overflow func RoundUpToGiBInt32(size resource.Quantity) (int32, error) { - requestBytes, ok := size.AsInt64() - if !ok { - return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) - } - return roundUpSizeInt32(requestBytes, GiB) + return roundUpSizeInt32(size, GiB) } // roundUpSizeInt calculates how many allocation units are needed to accommodate -// a volume of given size. It returns an int instead of an int64 and an error if -// there's overflow -func roundUpSizeInt(volumeSizeBytes int64, allocationUnitBytes int64) (int, error) { - roundedUp := roundUpSize(volumeSizeBytes, allocationUnitBytes) - roundedUpInt := int(roundedUp) - if int64(roundedUpInt) != roundedUp { - return 0, fmt.Errorf("capacity %v is too great, casting results in integer overflow", roundedUp) +// a volume of a given size. It returns an int and an error if there's overflow +func roundUpSizeInt(size resource.Quantity, allocationUnitBytes int64) (int, error) { + if bits.UintSize == 32 { + res, err := roundUpSizeInt32(size, allocationUnitBytes) + return int(res), err } - return roundedUpInt, nil + res, err := roundUpSizeInt64(size, allocationUnitBytes) + return int(res), err } // roundUpSizeInt32 calculates how many allocation units are needed to accommodate -// a volume of given size. It returns an int32 instead of an int64 and an error if -// there's overflow -func roundUpSizeInt32(volumeSizeBytes int64, allocationUnitBytes int64) (int32, error) { - roundedUp := roundUpSize(volumeSizeBytes, allocationUnitBytes) - roundedUpInt32 := int32(roundedUp) - if int64(roundedUpInt32) != roundedUp { - return 0, fmt.Errorf("quantity %v is too great, overflows int32", roundedUp) +// a volume of a given size. It returns an int32 and an error if there's overflow +func roundUpSizeInt32(size resource.Quantity, allocationUnitBytes int64) (int32, error) { + roundedUpInt32, err := roundUpSizeInt64(size, allocationUnitBytes) + if err != nil { + return 0, err + } + if roundedUpInt32 > math.MaxInt32 { + return 0, fmt.Errorf("quantity %s is too great, overflows int32", size.String()) } - return roundedUpInt32, nil + return int32(roundedUpInt32), nil } -// roundUpSize calculates how many allocation units are needed to accommodate -// a volume of given size. E.g. when user wants 1500MiB volume, while AWS EBS -// allocates volumes in gibibyte-sized chunks, -// RoundUpSize(1500 * 1024*1024, 1024*1024*1024) returns '2' -// (2 GiB is the smallest allocatable volume that can hold 1500MiB) -func roundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64 { +// roundUpSizeInt64 calculates how many allocation units are needed to accommodate +// a volume of a given size. It returns an int64 and an error if there's overflow +func roundUpSizeInt64(size resource.Quantity, allocationUnitBytes int64) (int64, error) { + // Use CmpInt64() to find out if the value of "size" would overflow an + // int64 and therefore have Value() return a wrong result. Then, retrieve + // the value as int64 and perform the rounding. + // It's not convenient to use AsScale() and related functions as they don't + // support BinarySI format, nor can we use AsInt64() directly since it's + // only implemented for int64 scaled numbers (int64Amount). + + // CmpInt64() actually returns 0 when comparing an amount bigger than MaxInt64. + if size.CmpInt64(math.MaxInt64) >= 0 { + return 0, fmt.Errorf("quantity %s is too great, overflows int64", size.String()) + } + volumeSizeBytes := size.Value() + roundedUp := volumeSizeBytes / allocationUnitBytes if volumeSizeBytes%allocationUnitBytes > 0 { roundedUp++ } - return roundedUp + return roundedUp, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/cli/flag/sectioned.go b/cluster-autoscaler/vendor/k8s.io/component-base/cli/flag/sectioned.go index 493a6c0f0f99..2357428761c4 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/cli/flag/sectioned.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/cli/flag/sectioned.go @@ -22,15 +22,22 @@ import ( "io" "strings" + "github.com/spf13/cobra" "github.com/spf13/pflag" ) +const ( + usageFmt = "Usage:\n %s\n" +) + // NamedFlagSets stores named flag sets in the order of calling FlagSet. type NamedFlagSets struct { // Order is an ordered list of flag set names. Order []string // FlagSets stores the flag sets by name. FlagSets map[string]*pflag.FlagSet + // NormalizeNameFunc is the normalize function which used to initialize FlagSets created by NamedFlagSets. + NormalizeNameFunc func(f *pflag.FlagSet, name string) pflag.NormalizedName } // FlagSet returns the flag set with the given name and adds it to the @@ -40,7 +47,12 @@ func (nfs *NamedFlagSets) FlagSet(name string) *pflag.FlagSet { nfs.FlagSets = map[string]*pflag.FlagSet{} } if _, ok := nfs.FlagSets[name]; !ok { - nfs.FlagSets[name] = pflag.NewFlagSet(name, pflag.ExitOnError) + flagSet := pflag.NewFlagSet(name, pflag.ExitOnError) + flagSet.SetNormalizeFunc(pflag.CommandLine.GetNormalizeFunc()) + if nfs.NormalizeNameFunc != nil { + flagSet.SetNormalizeFunc(nfs.NormalizeNameFunc) + } + nfs.FlagSets[name] = flagSet nfs.Order = append(nfs.Order, name) } return nfs.FlagSets[name] @@ -77,3 +89,17 @@ func PrintSections(w io.Writer, fss NamedFlagSets, cols int) { } } } + +// SetUsageAndHelpFunc set both usage and help function. +// Print the flag sets we need instead of all of them. +func SetUsageAndHelpFunc(cmd *cobra.Command, fss NamedFlagSets, cols int) { + cmd.SetUsageFunc(func(cmd *cobra.Command) error { + fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine()) + PrintSections(cmd.OutOrStderr(), fss, cols) + return nil + }) + cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) { + fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n"+usageFmt, cmd.Long, cmd.UseLine()) + PrintSections(cmd.OutOrStdout(), fss, cols) + }) +} diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/cli/flag/string_slice_flag.go b/cluster-autoscaler/vendor/k8s.io/component-base/cli/flag/string_slice_flag.go index 7b2e0f616956..37a1d778a39d 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/cli/flag/string_slice_flag.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/cli/flag/string_slice_flag.go @@ -38,12 +38,16 @@ var _ goflag.Value = &StringSlice{} var _ pflag.Value = &StringSlice{} func (s *StringSlice) String() string { + if s == nil || s.value == nil { + return "" + } return strings.Join(*s.value, " ") } func (s *StringSlice) Set(val string) error { if s.value == nil || !s.changed { - *s.value = make([]string, 0) + v := make([]string, 0) + s.value = &v } *s.value = append(*s.value, val) s.changed = true diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go b/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go index f9bb55656fa7..fd23246979e6 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go @@ -148,8 +148,9 @@ func (l *zapLogger) WithName(name string) logr.Logger { var encoderConfig = zapcore.EncoderConfig{ MessageKey: "msg", - TimeKey: "ts", - EncodeTime: zapcore.EpochMillisTimeEncoder, + TimeKey: "ts", + EncodeTime: zapcore.EpochMillisTimeEncoder, + EncodeDuration: zapcore.StringDurationEncoder, } // NewJSONLogger creates a new json logr.Logger using the given Zap Logger to log. diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/logs/options.go b/cluster-autoscaler/vendor/k8s.io/component-base/logs/options.go index 1698e5232f0c..1b53a6b2cdeb 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/logs/options.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/logs/options.go @@ -57,9 +57,9 @@ func NewOptions() *Options { func (o *Options) Validate() []error { errs := []error{} if o.LogFormat != defaultLogFormat { - allFlags := unsupportedLoggingFlags() + allFlags := unsupportedLoggingFlags(hyphensToUnderscores) for _, fname := range allFlags { - if flagIsSet(fname) { + if flagIsSet(fname, hyphensToUnderscores) { errs = append(errs, fmt.Errorf("non-default logging format doesn't honor flag: %s", fname)) } } @@ -70,11 +70,23 @@ func (o *Options) Validate() []error { return errs } -func flagIsSet(name string) bool { +// hyphensToUnderscores replaces hyphens with underscores +// we should always use underscores instead of hyphens when validate flags +func hyphensToUnderscores(s string) string { + return strings.Replace(s, "-", "_", -1) +} + +func flagIsSet(name string, normalizeFunc func(name string) string) bool { f := flag.Lookup(name) if f != nil { return f.DefValue != f.Value.String() } + if normalizeFunc != nil { + f = flag.Lookup(normalizeFunc(name)) + if f != nil { + return f.DefValue != f.Value.String() + } + } pf := pflag.Lookup(name) if pf != nil { return pf.DefValue != pf.Value.String() @@ -84,7 +96,12 @@ func flagIsSet(name string) bool { // AddFlags add logging-format flag func (o *Options) AddFlags(fs *pflag.FlagSet) { - unsupportedFlags := fmt.Sprintf("--%s", strings.Join(unsupportedLoggingFlags(), ", --")) + normalizeFunc := func(name string) string { + f := fs.GetNormalizeFunc() + return string(f(fs, name)) + } + + unsupportedFlags := fmt.Sprintf("--%s", strings.Join(unsupportedLoggingFlags(normalizeFunc), ", --")) formats := fmt.Sprintf(`"%s"`, strings.Join(logRegistry.List(), `", "`)) fs.StringVar(&o.LogFormat, logFormatFlagName, defaultLogFormat, fmt.Sprintf("Sets the log format. Permitted formats: %s.\nNon-default formats don't honor these flags: %s.\nNon-default choices are currently alpha and subject to change without warning.", formats, unsupportedFlags)) @@ -109,7 +126,7 @@ func (o *Options) Get() (logr.Logger, error) { return logRegistry.Get(o.LogFormat) } -func unsupportedLoggingFlags() []string { +func unsupportedLoggingFlags(normalizeFunc func(name string) string) []string { allFlags := []string{} // k8s.io/klog flags @@ -117,7 +134,11 @@ func unsupportedLoggingFlags() []string { klog.InitFlags(fs) fs.VisitAll(func(flag *flag.Flag) { if _, found := supportedLogsFlags[flag.Name]; !found { - allFlags = append(allFlags, strings.Replace(flag.Name, "_", "-", -1)) + name := flag.Name + if normalizeFunc != nil { + name = normalizeFunc(name) + } + allFlags = append(allFlags, name) } }) diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/metrics/prometheus/restclient/metrics.go b/cluster-autoscaler/vendor/k8s.io/component-base/metrics/prometheus/restclient/metrics.go index 82bc2babaa2f..21e4bb359984 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/metrics/prometheus/restclient/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/metrics/prometheus/restclient/metrics.go @@ -121,6 +121,7 @@ var ( func init() { legacyregistry.MustRegister(requestLatency) + legacyregistry.MustRegister(rateLimiterLatency) legacyregistry.MustRegister(requestResult) legacyregistry.RawMustRegister(execPluginCertTTL) legacyregistry.MustRegister(execPluginCertRotation) diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/metrics/testutil/metrics.go b/cluster-autoscaler/vendor/k8s.io/component-base/metrics/testutil/metrics.go index ac66772c4460..60a186483fb4 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/metrics/testutil/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/metrics/testutil/metrics.go @@ -281,21 +281,6 @@ func (hist *Histogram) Average() float64 { return hist.GetSampleSum() / float64(hist.GetSampleCount()) } -// Clear clears all fields of the wrapped histogram -func (hist *Histogram) Clear() { - if hist.SampleCount != nil { - *hist.SampleCount = 0 - } - if hist.SampleSum != nil { - *hist.SampleSum = 0 - } - for _, b := range hist.Bucket { - if b.CumulativeCount != nil { - *b.CumulativeCount = 0 - } - } -} - // Validate makes sure the wrapped histogram has all necessary fields set and with valid values. func (hist *Histogram) Validate() error { if hist.SampleCount == nil || hist.GetSampleCount() == 0 { diff --git a/cluster-autoscaler/vendor/k8s.io/component-helpers/scheduling/corev1/nodeaffinity/nodeaffinity.go b/cluster-autoscaler/vendor/k8s.io/component-helpers/scheduling/corev1/nodeaffinity/nodeaffinity.go index 4157f772cadb..27caf69b920a 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-helpers/scheduling/corev1/nodeaffinity/nodeaffinity.go +++ b/cluster-autoscaler/vendor/k8s.io/component-helpers/scheduling/corev1/nodeaffinity/nodeaffinity.go @@ -287,3 +287,38 @@ type preferredSchedulingTerm struct { nodeSelectorTerm weight int } + +type RequiredNodeAffinity struct { + labelSelector labels.Selector + nodeSelector *LazyErrorNodeSelector +} + +// GetRequiredNodeAffinity returns the parsing result of pod's nodeSelector and nodeAffinity. +func GetRequiredNodeAffinity(pod *v1.Pod) RequiredNodeAffinity { + var selector labels.Selector + if len(pod.Spec.NodeSelector) > 0 { + selector = labels.SelectorFromSet(pod.Spec.NodeSelector) + } + // Use LazyErrorNodeSelector for backwards compatibility of parsing errors. + var affinity *LazyErrorNodeSelector + if pod.Spec.Affinity != nil && + pod.Spec.Affinity.NodeAffinity != nil && + pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution != nil { + affinity = NewLazyErrorNodeSelector(pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution) + } + return RequiredNodeAffinity{labelSelector: selector, nodeSelector: affinity} +} + +// Match checks whether the pod is schedulable onto nodes according to +// the requirements in both nodeSelector and nodeAffinity. +func (s RequiredNodeAffinity) Match(node *v1.Node) (bool, error) { + if s.labelSelector != nil { + if !s.labelSelector.Matches(labels.Set(node.Labels)) { + return false, nil + } + } + if s.nodeSelector != nil { + return s.nodeSelector.Match(node) + } + return true, nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.mod b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.mod index 26020d57b47e..1ed4737c4aaa 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.mod +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.mod @@ -6,12 +6,12 @@ go 1.16 require ( github.com/stretchr/testify v1.6.1 - k8s.io/api v0.21.0-beta.1 - k8s.io/apimachinery v0.21.0-beta.1 - k8s.io/klog/v2 v2.5.0 + k8s.io/api v0.22.0-alpha.1 + k8s.io/apimachinery v0.22.0-alpha.1 + k8s.io/klog/v2 v2.8.0 ) replace ( - k8s.io/api => k8s.io/api v0.21.0-beta.1 - k8s.io/apimachinery => k8s.io/apimachinery v0.21.0-beta.1 + k8s.io/api => k8s.io/api v0.22.0-alpha.1 + k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.1 ) diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.sum b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.sum index 7a1d60475a06..dacbd19fdd05 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.sum +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.sum @@ -20,12 +20,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -34,13 +30,13 @@ github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4er github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -55,7 +51,7 @@ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -67,7 +63,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -97,15 +92,15 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -120,7 +115,6 @@ golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -138,7 +132,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h 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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -154,7 +147,6 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -194,19 +186,22 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/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 h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.21.0-beta.1/go.mod h1:8A+GKfJYDnFlmsIqnwi7z2l5+GwI3fbIdAkPu3xiZKA= -k8s.io/apimachinery v0.21.0-beta.1/go.mod h1:ZaN7d/yx5I8h2mk8Nu08sdLigsmkt4flkTxCTc9LElI= +k8s.io/api v0.22.0-alpha.1 h1:LuUYyELM7hm5I7B8pjn8dhZHQTcw86C/bFBNNu0/QoY= +k8s.io/api v0.22.0-alpha.1/go.mod h1:vQHAkhGeeRA6zI8QNe3tcuQqGXanfyk6mehgpyIHcpY= +k8s.io/apimachinery v0.22.0-alpha.1 h1:5H8J1su7o60La1W4iOytFrsn2DeRxd9NXVxulXWOdOE= +k8s.io/apimachinery v0.22.0-alpha.1/go.mod h1:fBRSkoylGO2QUTae8Wb2wac6pZ83/r+tL6HFSXGbzfs= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.5.0 h1:8mOnjf1RmUPW6KRqQCfYSZq/K20Unmp3IhuZUhxl8KI= -k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= +k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.1 h1:nYqY2A6oy37sKLYuSBXuQhbj4JVclzJK13BOIvJG5XU= +sigs.k8s.io/structured-merge-diff/v4 v4.1.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go index db00283a68d5..a5c32013f90d 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go @@ -86,7 +86,7 @@ func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeStorageClassToCSI(sc // TranslateInTreeInlineVolumeToCSI takes a Volume with AWSElasticBlockStore set from in-tree // and converts the AWSElasticBlockStore source to a CSIPersistentVolumeSource -func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { +func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) { if volume == nil || volume.AWSElasticBlockStore == nil { return nil, fmt.Errorf("volume is nil or AWS EBS not defined on volume") } diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/azure_disk.go b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/azure_disk.go index 8184881de9df..d47df35e5c47 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/azure_disk.go +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/azure_disk.go @@ -93,7 +93,7 @@ func (t *azureDiskCSITranslator) TranslateInTreeStorageClassToCSI(sc *storage.St // TranslateInTreeInlineVolumeToCSI takes a Volume with AzureDisk set from in-tree // and converts the AzureDisk source to a CSIPersistentVolumeSource -func (t *azureDiskCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { +func (t *azureDiskCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) { if volume == nil || volume.AzureDisk == nil { return nil, fmt.Errorf("volume is nil or Azure Disk not defined on volume") } diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/azure_file.go b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/azure_file.go index 6ce3be461f73..df8251325f14 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/azure_file.go +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/azure_file.go @@ -65,7 +65,7 @@ func (t *azureFileCSITranslator) TranslateInTreeStorageClassToCSI(sc *storage.St // TranslateInTreeInlineVolumeToCSI takes a Volume with AzureFile set from in-tree // and converts the AzureFile source to a CSIPersistentVolumeSource -func (t *azureFileCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { +func (t *azureFileCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) { if volume == nil || volume.AzureFile == nil { return nil, fmt.Errorf("volume is nil or Azure File not defined on volume") } @@ -77,6 +77,11 @@ func (t *azureFileCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Vol accountName = azureSource.SecretName } + secretNamespace := defaultSecretNamespace + if podNamespace != "" { + secretNamespace = podNamespace + } + var ( pv = &v1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ @@ -93,7 +98,7 @@ func (t *azureFileCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Vol VolumeAttributes: map[string]string{shareNameField: azureSource.ShareName}, NodeStageSecretRef: &v1.SecretReference{ Name: azureSource.SecretName, - Namespace: defaultSecretNamespace, + Namespace: secretNamespace, }, }, }, diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/gce_pd.go b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/gce_pd.go index d163fe88536d..5183e092bdf4 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/gce_pd.go +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/gce_pd.go @@ -162,7 +162,7 @@ func backwardCompatibleAccessModes(ams []v1.PersistentVolumeAccessMode) []v1.Per // TranslateInTreeInlineVolumeToCSI takes a Volume with GCEPersistentDisk set from in-tree // and converts the GCEPersistentDisk source to a CSIPersistentVolumeSource -func (g *gcePersistentDiskCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { +func (g *gcePersistentDiskCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) { if volume == nil || volume.GCEPersistentDisk == nil { return nil, fmt.Errorf("volume is nil or GCE PD not defined on volume") } diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/in_tree_volume.go b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/in_tree_volume.go index f1c760df786d..7a0040e26614 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/in_tree_volume.go +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/in_tree_volume.go @@ -37,7 +37,8 @@ type InTreePlugin interface { // TranslateInTreeInlineVolumeToCSI takes a inline volume and will translate // the in-tree inline volume source to a CSIPersistentVolumeSource // A PV object containing the CSIPersistentVolumeSource in it's spec is returned - TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) + // podNamespace is only needed for azurefile to fetch secret namespace, no need to be set for other plugins. + TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) // TranslateInTreePVToCSI takes a persistent volume and will translate // the in-tree pv source to a CSI Source. The input persistent volume can be modified diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/openstack_cinder.go b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/openstack_cinder.go index 44f744cb2189..66ce81185e96 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/openstack_cinder.go +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/openstack_cinder.go @@ -75,7 +75,7 @@ func (t *osCinderCSITranslator) TranslateInTreeStorageClassToCSI(sc *storage.Sto // TranslateInTreeInlineVolumeToCSI takes a Volume with Cinder set from in-tree // and converts the Cinder source to a CSIPersistentVolumeSource -func (t *osCinderCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { +func (t *osCinderCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) { if volume == nil || volume.Cinder == nil { return nil, fmt.Errorf("volume is nil or Cinder not defined on volume") } diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/vsphere_volume.go b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/vsphere_volume.go index 531aff0d9836..83058b374a6c 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/vsphere_volume.go +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/vsphere_volume.go @@ -111,7 +111,7 @@ func (t *vSphereCSITranslator) TranslateInTreeStorageClassToCSI(sc *storage.Stor // TranslateInTreeInlineVolumeToCSI takes a Volume with VsphereVolume set from in-tree // and converts the VsphereVolume source to a CSIPersistentVolumeSource -func (t *vSphereCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { +func (t *vSphereCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) { if volume == nil || volume.VsphereVolume == nil { return nil, fmt.Errorf("volume is nil or VsphereVolume not defined on volume") } diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/translate.go b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/translate.go index 21f5c49d59a5..c1ffbe974113 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/translate.go +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/translate.go @@ -62,13 +62,13 @@ func (CSITranslator) TranslateInTreeStorageClassToCSI(inTreePluginName string, s // TranslateInTreeInlineVolumeToCSI takes a inline volume and will translate // the in-tree volume source to a CSIPersistentVolumeSource (wrapped in a PV) // if the translation logic has been implemented. -func (CSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { +func (CSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) { if volume == nil { return nil, fmt.Errorf("persistent volume was nil") } for _, curPlugin := range inTreePlugins { if curPlugin.CanSupportInline(volume) { - pv, err := curPlugin.TranslateInTreeInlineVolumeToCSI(volume) + pv, err := curPlugin.TranslateInTreeInlineVolumeToCSI(volume, podNamespace) if err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/klog/v2/klog.go b/cluster-autoscaler/vendor/k8s.io/klog/v2/klog.go index fe2b724f6935..25483fad1388 100644 --- a/cluster-autoscaler/vendor/k8s.io/klog/v2/klog.go +++ b/cluster-autoscaler/vendor/k8s.io/klog/v2/klog.go @@ -81,6 +81,7 @@ import ( "math" "os" "path/filepath" + "reflect" "runtime" "strconv" "strings" @@ -433,7 +434,7 @@ func InitFlags(flagset *flag.FlagSet) { flagset.Var(&logging.verbosity, "v", "number for the log level verbosity") flagset.BoolVar(&logging.addDirHeader, "add_dir_header", logging.addDirHeader, "If true, adds the file directory to the header of the log messages") flagset.BoolVar(&logging.skipHeaders, "skip_headers", logging.skipHeaders, "If true, avoid header prefixes in the log messages") - flagset.BoolVar(&logging.oneOutput, "one_output", logging.oneOutput, "If true, only write logs to their native severity level (vs also writing to each lower severity level") + flagset.BoolVar(&logging.oneOutput, "one_output", logging.oneOutput, "If true, only write logs to their native severity level (vs also writing to each lower severity level)") flagset.BoolVar(&logging.skipLogHeaders, "skip_log_headers", logging.skipLogHeaders, "If true, avoid headers when opening log files") flagset.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr") flagset.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging") @@ -780,7 +781,7 @@ func (l *loggingT) errorS(err error, loggr logr.Logger, filter LogFilter, depth loggr.Error(err, msg, keysAndValues...) return } - l.printS(err, depth+1, msg, keysAndValues...) + l.printS(err, errorLog, depth+1, msg, keysAndValues...) } // if loggr is specified, will call loggr.Info, otherwise output with logging module. @@ -792,12 +793,12 @@ func (l *loggingT) infoS(loggr logr.Logger, filter LogFilter, depth int, msg str loggr.Info(msg, keysAndValues...) return } - l.printS(nil, depth+1, msg, keysAndValues...) + l.printS(nil, infoLog, depth+1, msg, keysAndValues...) } // printS is called from infoS and errorS if loggr is not specified. -// if err arguments is specified, will output to errorLog severity -func (l *loggingT) printS(err error, depth int, msg string, keysAndValues ...interface{}) { +// set log severity by s +func (l *loggingT) printS(err error, s severity, depth int, msg string, keysAndValues ...interface{}) { b := &bytes.Buffer{} b.WriteString(fmt.Sprintf("%q", msg)) if err != nil { @@ -805,12 +806,6 @@ func (l *loggingT) printS(err error, depth int, msg string, keysAndValues ...int b.WriteString(fmt.Sprintf("err=%q", err.Error())) } kvListFormat(b, keysAndValues...) - var s severity - if err == nil { - s = infoLog - } else { - s = errorLog - } l.printDepth(s, logging.logr, nil, depth+1, b) } @@ -1583,6 +1578,13 @@ type KMetadata interface { // KObj returns ObjectRef from ObjectMeta func KObj(obj KMetadata) ObjectRef { + if obj == nil { + return ObjectRef{} + } + if val := reflect.ValueOf(obj); val.Kind() == reflect.Ptr && val.IsNil() { + return ObjectRef{} + } + return ObjectRef{ Name: obj.GetName(), Namespace: obj.GetNamespace(), diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/openapi.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/openapi.go index d04080d57db3..3e9e675a0fbd 100644 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/openapi.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/openapi.go @@ -23,10 +23,10 @@ import ( "strings" restful "github.com/emicklei/go-restful" - "github.com/go-openapi/spec" "k8s.io/kube-openapi/pkg/common" "k8s.io/kube-openapi/pkg/util" + "k8s.io/kube-openapi/pkg/validation/spec" ) const ( diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/util.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/util.go index 5e9a56a6b806..c7ea40d91003 100644 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/util.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/util.go @@ -20,7 +20,7 @@ import ( "sort" "github.com/emicklei/go-restful" - "github.com/go-openapi/spec" + "k8s.io/kube-openapi/pkg/validation/spec" ) type parameters []spec.Parameter diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/common/common.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/common/common.go index 40be34786cd7..682014bda941 100644 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/common/common.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/common/common.go @@ -21,7 +21,7 @@ import ( "strings" "github.com/emicklei/go-restful" - "github.com/go-openapi/spec" + "k8s.io/kube-openapi/pkg/validation/spec" ) const ( diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/handler/default_pruning.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/handler/default_pruning.go index 69646871cd94..53bd9a640f29 100644 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/handler/default_pruning.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/handler/default_pruning.go @@ -16,7 +16,7 @@ limitations under the License. package handler -import "github.com/go-openapi/spec" +import "k8s.io/kube-openapi/pkg/validation/spec" // PruneDefaults remove all the defaults recursively from all the // schemas in the definitions, and does not modify the definitions in diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/handler/handler.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/handler/handler.go index 7cd1bbd0ff0a..7de4eba762af 100644 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/handler/handler.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/handler/handler.go @@ -28,16 +28,14 @@ import ( "github.com/NYTimes/gziphandler" "github.com/emicklei/go-restful" - "github.com/go-openapi/spec" "github.com/golang/protobuf/proto" - "github.com/googleapis/gnostic/compiler" openapi_v2 "github.com/googleapis/gnostic/openapiv2" jsoniter "github.com/json-iterator/go" "github.com/munnerz/goautoneg" "gopkg.in/yaml.v2" - "k8s.io/kube-openapi/pkg/builder" "k8s.io/kube-openapi/pkg/common" + "k8s.io/kube-openapi/pkg/validation/spec" ) const ( @@ -108,11 +106,7 @@ func (o *OpenAPIService) UpdateSpec(openapiSpec *spec.Swagger) (err error) { if err != nil { return err } - var json map[string]interface{} - if err := jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(specBytes, &json); err != nil { - return err - } - specPb, err := ToProtoBinary(json) + specPb, err := ToProtoBinary(specBytes) if err != nil { return err } @@ -180,8 +174,8 @@ func jsonToYAMLValue(j interface{}) interface{} { return j } -func ToProtoBinary(json map[string]interface{}) ([]byte, error) { - document, err := openapi_v2.NewDocument(jsonToYAML(json), compiler.NewContext("$root", nil)) +func ToProtoBinary(json []byte) ([]byte, error) { + document, err := openapi_v2.ParseDocument(json) if err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/.gitignore b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/.gitignore similarity index 100% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/.gitignore rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/.gitignore diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/LICENSE b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/LICENSE similarity index 100% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/LICENSE rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/LICENSE diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/contact_info.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/contact_info.go similarity index 100% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/contact_info.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/contact_info.go diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/external_docs.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/external_docs.go similarity index 100% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/external_docs.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/external_docs.go diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/header.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/header.go new file mode 100644 index 000000000000..216cf1cded43 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/header.go @@ -0,0 +1,71 @@ +// Copyright 2015 go-swagger maintainers +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package spec + +import ( + "encoding/json" + + "github.com/go-openapi/swag" +) + +const ( + jsonArray = "array" +) + +// HeaderProps describes a response header +type HeaderProps struct { + Description string `json:"description,omitempty"` +} + +// Header describes a header for a response of the API +// +// For more information: http://goo.gl/8us55a#headerObject +type Header struct { + CommonValidations + SimpleSchema + VendorExtensible + HeaderProps +} + +// MarshalJSON marshal this to JSON +func (h Header) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(h.CommonValidations) + if err != nil { + return nil, err + } + b2, err := json.Marshal(h.SimpleSchema) + if err != nil { + return nil, err + } + b3, err := json.Marshal(h.HeaderProps) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b1, b2, b3), nil +} + +// UnmarshalJSON unmarshals this header from JSON +func (h *Header) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &h.CommonValidations); err != nil { + return err + } + if err := json.Unmarshal(data, &h.SimpleSchema); err != nil { + return err + } + if err := json.Unmarshal(data, &h.VendorExtensible); err != nil { + return err + } + return json.Unmarshal(data, &h.HeaderProps) +} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/info.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/info.go similarity index 93% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/info.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/info.go index c458b49b216a..504a3972afd4 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/info.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/info.go @@ -18,7 +18,6 @@ import ( "encoding/json" "strings" - "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) @@ -134,15 +133,6 @@ type Info struct { InfoProps } -// JSONLookup look up a value by the json property name -func (i Info) JSONLookup(token string) (interface{}, error) { - if ex, ok := i.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(i.InfoProps, token) - return r, err -} - // MarshalJSON marshal this to JSON func (i Info) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(i.InfoProps) diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/items.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/items.go similarity index 53% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/items.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/items.go index 365d1631582a..b75aefe164a8 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/items.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/items.go @@ -16,9 +16,7 @@ package spec import ( "encoding/json" - "strings" - "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) @@ -37,22 +35,6 @@ type SimpleSchema struct { Example interface{} `json:"example,omitempty"` } -// TypeName return the type (or format) of a simple schema -func (s *SimpleSchema) TypeName() string { - if s.Format != "" { - return s.Format - } - return s.Type -} - -// ItemsTypeName yields the type of items in a simple schema array -func (s *SimpleSchema) ItemsTypeName() string { - if s.Items == nil { - return "" - } - return s.Items.TypeName() -} - // CommonValidations describe common JSON-schema validations type CommonValidations struct { Maximum *float64 `json:"maximum,omitempty"` @@ -80,106 +62,6 @@ type Items struct { VendorExtensible } -// NewItems creates a new instance of items -func NewItems() *Items { - return &Items{} -} - -// Typed a fluent builder method for the type of item -func (i *Items) Typed(tpe, format string) *Items { - i.Type = tpe - i.Format = format - return i -} - -// AsNullable flags this schema as nullable. -func (i *Items) AsNullable() *Items { - i.Nullable = true - return i -} - -// CollectionOf a fluent builder method for an array item -func (i *Items) CollectionOf(items *Items, format string) *Items { - i.Type = jsonArray - i.Items = items - i.CollectionFormat = format - return i -} - -// WithDefault sets the default value on this item -func (i *Items) WithDefault(defaultValue interface{}) *Items { - i.Default = defaultValue - return i -} - -// WithMaxLength sets a max length value -func (i *Items) WithMaxLength(max int64) *Items { - i.MaxLength = &max - return i -} - -// WithMinLength sets a min length value -func (i *Items) WithMinLength(min int64) *Items { - i.MinLength = &min - return i -} - -// WithPattern sets a pattern value -func (i *Items) WithPattern(pattern string) *Items { - i.Pattern = pattern - return i -} - -// WithMultipleOf sets a multiple of value -func (i *Items) WithMultipleOf(number float64) *Items { - i.MultipleOf = &number - return i -} - -// WithMaximum sets a maximum number value -func (i *Items) WithMaximum(max float64, exclusive bool) *Items { - i.Maximum = &max - i.ExclusiveMaximum = exclusive - return i -} - -// WithMinimum sets a minimum number value -func (i *Items) WithMinimum(min float64, exclusive bool) *Items { - i.Minimum = &min - i.ExclusiveMinimum = exclusive - return i -} - -// WithEnum sets a the enum values (replace) -func (i *Items) WithEnum(values ...interface{}) *Items { - i.Enum = append([]interface{}{}, values...) - return i -} - -// WithMaxItems sets the max items -func (i *Items) WithMaxItems(size int64) *Items { - i.MaxItems = &size - return i -} - -// WithMinItems sets the min items -func (i *Items) WithMinItems(size int64) *Items { - i.MinItems = &size - return i -} - -// UniqueValues dictates that this array can only have unique items -func (i *Items) UniqueValues() *Items { - i.UniqueItems = true - return i -} - -// AllowDuplicates this array can have duplicates -func (i *Items) AllowDuplicates() *Items { - i.UniqueItems = false - return i -} - // UnmarshalJSON hydrates this items instance with the data from JSON func (i *Items) UnmarshalJSON(data []byte) error { var validations CommonValidations @@ -225,20 +107,3 @@ func (i Items) MarshalJSON() ([]byte, error) { } return swag.ConcatJSON(b4, b3, b1, b2), nil } - -// JSONLookup look up a value by the json property name -func (i Items) JSONLookup(token string) (interface{}, error) { - if token == jsonRef { - return &i.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(i.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(i.SimpleSchema, token) - return r, err -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/license.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/license.go similarity index 100% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/license.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/license.go diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/operation.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/operation.go new file mode 100644 index 000000000000..c7acd8672cec --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/operation.go @@ -0,0 +1,96 @@ +// Copyright 2015 go-swagger maintainers +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package spec + +import ( + "encoding/json" + + "github.com/go-openapi/swag" +) + +// OperationProps describes an operation +// +// NOTES: +// - schemes, when present must be from [http, https, ws, wss]: see validate +// - Security is handled as a special case: see MarshalJSON function +type OperationProps struct { + Description string `json:"description,omitempty"` + Consumes []string `json:"consumes,omitempty"` + Produces []string `json:"produces,omitempty"` + Schemes []string `json:"schemes,omitempty"` + Tags []string `json:"tags,omitempty"` + Summary string `json:"summary,omitempty"` + ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` + ID string `json:"operationId,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` + Security []map[string][]string `json:"security,omitempty"` + Parameters []Parameter `json:"parameters,omitempty"` + Responses *Responses `json:"responses,omitempty"` +} + +// MarshalJSON takes care of serializing operation properties to JSON +// +// We use a custom marhaller here to handle a special cases related to +// the Security field. We need to preserve zero length slice +// while omitting the field when the value is nil/unset. +func (op OperationProps) MarshalJSON() ([]byte, error) { + type Alias OperationProps + if op.Security == nil { + return json.Marshal(&struct { + Security []map[string][]string `json:"security,omitempty"` + *Alias + }{ + Security: op.Security, + Alias: (*Alias)(&op), + }) + } + return json.Marshal(&struct { + Security []map[string][]string `json:"security"` + *Alias + }{ + Security: op.Security, + Alias: (*Alias)(&op), + }) +} + +// Operation describes a single API operation on a path. +// +// For more information: http://goo.gl/8us55a#operationObject +type Operation struct { + VendorExtensible + OperationProps +} + +// UnmarshalJSON hydrates this items instance with the data from JSON +func (o *Operation) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &o.OperationProps); err != nil { + return err + } + return json.Unmarshal(data, &o.VendorExtensible) +} + +// MarshalJSON converts this items object to JSON +func (o Operation) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(o.OperationProps) + if err != nil { + return nil, err + } + b2, err := json.Marshal(o.VendorExtensible) + if err != nil { + return nil, err + } + concated := swag.ConcatJSON(b1, b2) + return concated, nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go new file mode 100644 index 000000000000..21851397400e --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go @@ -0,0 +1,111 @@ +// Copyright 2015 go-swagger maintainers +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package spec + +import ( + "encoding/json" + + "github.com/go-openapi/swag" +) + +// ParamProps describes the specific attributes of an operation parameter +// +// NOTE: +// - Schema is defined when "in" == "body": see validate +// - AllowEmptyValue is allowed where "in" == "query" || "formData" +type ParamProps struct { + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + In string `json:"in,omitempty"` + Required bool `json:"required,omitempty"` + Schema *Schema `json:"schema,omitempty"` + AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` +} + +// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). +// +// There are five possible parameter types. +// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part +// of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, +// the path parameter is `itemId`. +// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`. +// * Header - Custom headers that are expected as part of the request. +// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be +// _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for +// documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist +// together for the same operation. +// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or +// `multipart/form-data` are used as the content type of the request (in Swagger's definition, +// the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used +// to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be +// declared together with a body parameter for the same operation. Form parameters have a different format based on +// the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4). +// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. +// For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple +// parameters that are being transferred. +// * `multipart/form-data` - each parameter takes a section in the payload with an internal header. +// For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is +// `submit-name`. This type of form parameters is more commonly used for file transfers. +// +// For more information: http://goo.gl/8us55a#parameterObject +type Parameter struct { + Refable + CommonValidations + SimpleSchema + VendorExtensible + ParamProps +} + +// UnmarshalJSON hydrates this items instance with the data from JSON +func (p *Parameter) UnmarshalJSON(data []byte) error { + if err := json.Unmarshal(data, &p.CommonValidations); err != nil { + return err + } + if err := json.Unmarshal(data, &p.Refable); err != nil { + return err + } + if err := json.Unmarshal(data, &p.SimpleSchema); err != nil { + return err + } + if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { + return err + } + return json.Unmarshal(data, &p.ParamProps) +} + +// MarshalJSON converts this items object to JSON +func (p Parameter) MarshalJSON() ([]byte, error) { + b1, err := json.Marshal(p.CommonValidations) + if err != nil { + return nil, err + } + b2, err := json.Marshal(p.SimpleSchema) + if err != nil { + return nil, err + } + b3, err := json.Marshal(p.Refable) + if err != nil { + return nil, err + } + b4, err := json.Marshal(p.VendorExtensible) + if err != nil { + return nil, err + } + b5, err := json.Marshal(p.ParamProps) + if err != nil { + return nil, err + } + return swag.ConcatJSON(b3, b1, b2, b4, b5), nil +} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/path_item.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/path_item.go similarity index 86% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/path_item.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/path_item.go index 68fc8e90144e..04de58f00f02 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/path_item.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/path_item.go @@ -17,7 +17,6 @@ package spec import ( "encoding/json" - "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) @@ -45,18 +44,6 @@ type PathItem struct { PathItemProps } -// JSONLookup look up a value by the json property name -func (p PathItem) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == jsonRef { - return &p.Ref, nil - } - r, _, err := jsonpointer.GetForToken(p.PathItemProps, token) - return r, err -} - // UnmarshalJSON hydrates this items instance with the data from JSON func (p *PathItem) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &p.Refable); err != nil { diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/paths.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/paths.go similarity index 88% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/paths.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/paths.go index 9dc82a2901d6..319aba879abc 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/paths.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/paths.go @@ -16,7 +16,6 @@ package spec import ( "encoding/json" - "fmt" "strings" "github.com/go-openapi/swag" @@ -33,17 +32,6 @@ type Paths struct { Paths map[string]PathItem `json:"-"` // custom serializer to flatten this, each entry must start with "/" } -// JSONLookup look up a value by the json property name -func (p Paths) JSONLookup(token string) (interface{}, error) { - if pi, ok := p.Paths[token]; ok { - return &pi, nil - } - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - return nil, fmt.Errorf("object has no field %q", token) -} - // UnmarshalJSON hydrates this items instance with the data from JSON func (p *Paths) UnmarshalJSON(data []byte) error { var res map[string]json.RawMessage diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/ref.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/ref.go similarity index 87% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/ref.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/ref.go index 1f31a9ead01f..1405bfd8ee2b 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/ref.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/ref.go @@ -15,8 +15,6 @@ package spec import ( - "bytes" - "encoding/gob" "encoding/json" "net/http" "os" @@ -68,12 +66,10 @@ func (r *Ref) IsValidURI(basepaths ...string) bool { } if r.HasFullURL { - //#nosec rr, err := http.Get(v) if err != nil { return false } - defer rr.Body.Close() return rr.StatusCode/100 == 2 } @@ -152,28 +148,6 @@ func (r *Ref) UnmarshalJSON(d []byte) error { return r.fromMap(v) } -// GobEncode provides a safe gob encoder for Ref -func (r Ref) GobEncode() ([]byte, error) { - var b bytes.Buffer - raw, err := r.MarshalJSON() - if err != nil { - return nil, err - } - err = gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Ref -func (r *Ref) GobDecode(b []byte) error { - var raw []byte - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - return json.Unmarshal(raw, r) -} - func (r *Ref) fromMap(v map[string]interface{}) error { if v == nil { return nil diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/response.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/response.go similarity index 60% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/response.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/response.go index 27729c1d93b1..9fd717ec3fd3 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/response.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/response.go @@ -17,7 +17,6 @@ package spec import ( "encoding/json" - "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) @@ -38,18 +37,6 @@ type Response struct { VendorExtensible } -// JSONLookup look up a value by the json property name -func (r Response) JSONLookup(token string) (interface{}, error) { - if ex, ok := r.Extensions[token]; ok { - return &ex, nil - } - if token == "$ref" { - return &r.Ref, nil - } - ptr, _, err := jsonpointer.GetForToken(r.ResponseProps, token) - return ptr, err -} - // UnmarshalJSON hydrates this items instance with the data from JSON func (r *Response) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &r.ResponseProps); err != nil { @@ -89,43 +76,3 @@ func ResponseRef(url string) *Response { resp.Ref = MustCreateRef(url) return resp } - -// WithDescription sets the description on this response, allows for chaining -func (r *Response) WithDescription(description string) *Response { - r.Description = description - return r -} - -// WithSchema sets the schema on this response, allows for chaining. -// Passing a nil argument removes the schema from this response -func (r *Response) WithSchema(schema *Schema) *Response { - r.Schema = schema - return r -} - -// AddHeader adds a header to this response -func (r *Response) AddHeader(name string, header *Header) *Response { - if header == nil { - return r.RemoveHeader(name) - } - if r.Headers == nil { - r.Headers = make(map[string]Header) - } - r.Headers[name] = *header - return r -} - -// RemoveHeader removes a header from this response -func (r *Response) RemoveHeader(name string) *Response { - delete(r.Headers, name) - return r -} - -// AddExample adds an example to this response -func (r *Response) AddExample(mediaType string, example interface{}) *Response { - if r.Examples == nil { - r.Examples = make(map[string]interface{}) - } - r.Examples[mediaType] = example - return r -} diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/responses.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/responses.go similarity index 88% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/responses.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/responses.go index 4efb6f868bd0..b2c3883a9f6d 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/responses.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/responses.go @@ -16,7 +16,6 @@ package spec import ( "encoding/json" - "fmt" "reflect" "strconv" @@ -41,22 +40,6 @@ type Responses struct { ResponsesProps } -// JSONLookup implements an interface to customize json pointer lookup -func (r Responses) JSONLookup(token string) (interface{}, error) { - if token == "default" { - return r.Default, nil - } - if ex, ok := r.Extensions[token]; ok { - return &ex, nil - } - if i, err := strconv.Atoi(token); err == nil { - if scr, ok := r.StatusCodeResponses[i]; ok { - return scr, nil - } - } - return nil, fmt.Errorf("object has no field %q", token) -} - // UnmarshalJSON hydrates this items instance with the data from JSON func (r *Responses) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &r.ResponsesProps); err != nil { diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/schema.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/schema.go similarity index 88% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/schema.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/schema.go index 37858ece9098..b0aeeb0d0e1f 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/schema.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/schema.go @@ -20,7 +20,6 @@ import ( "net/url" "strings" - "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) @@ -199,7 +198,6 @@ type SchemaProps struct { type SwaggerSchemaProps struct { Discriminator string `json:"discriminator,omitempty"` ReadOnly bool `json:"readOnly,omitempty"` - XML *XMLObject `json:"xml,omitempty"` ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` Example interface{} `json:"example,omitempty"` } @@ -218,24 +216,6 @@ type Schema struct { ExtraProps map[string]interface{} `json:"-"` } -// JSONLookup implements an interface to customize json pointer lookup -func (s Schema) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - - if ex, ok := s.ExtraProps[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(s.SchemaProps, token) - if r != nil || (err != nil && !strings.HasPrefix(err.Error(), "object has no field")) { - return r, err - } - r, _, err = jsonpointer.GetForToken(s.SwaggerSchemaProps, token) - return r, err -} - // WithID sets the id for this schema, allows for chaining func (s *Schema) WithID(id string) *Schema { s.ID = id @@ -450,69 +430,6 @@ func (s *Schema) WithExternalDocs(description, url string) *Schema { return s } -// WithXMLName sets the xml name for the object -func (s *Schema) WithXMLName(name string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Name = name - return s -} - -// WithXMLNamespace sets the xml namespace for the object -func (s *Schema) WithXMLNamespace(namespace string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Namespace = namespace - return s -} - -// WithXMLPrefix sets the xml prefix for the object -func (s *Schema) WithXMLPrefix(prefix string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Prefix = prefix - return s -} - -// AsXMLAttribute flags this object as xml attribute -func (s *Schema) AsXMLAttribute() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = true - return s -} - -// AsXMLElement flags this object as an xml node -func (s *Schema) AsXMLElement() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = false - return s -} - -// AsWrappedXML flags this object as wrapped, this is mostly useful for array types -func (s *Schema) AsWrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = true - return s -} - -// AsUnwrappedXML flags this object as an xml node -func (s *Schema) AsUnwrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = false - return s -} - // MarshalJSON marshal this to JSON func (s Schema) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(s.SchemaProps) diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/security_scheme.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/security_scheme.go similarity index 50% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/security_scheme.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/security_scheme.go index fe353842a6fc..563b9b95e41f 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/security_scheme.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/security_scheme.go @@ -17,67 +17,9 @@ package spec import ( "encoding/json" - "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) -const ( - basic = "basic" - apiKey = "apiKey" - oauth2 = "oauth2" - implicit = "implicit" - password = "password" - application = "application" - accessCode = "accessCode" -) - -// BasicAuth creates a basic auth security scheme -func BasicAuth() *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: basic}} -} - -// APIKeyAuth creates an api key auth security scheme -func APIKeyAuth(fieldName, valueSource string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: apiKey, Name: fieldName, In: valueSource}} -} - -// OAuth2Implicit creates an implicit flow oauth2 security scheme -func OAuth2Implicit(authorizationURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: implicit, - AuthorizationURL: authorizationURL, - }} -} - -// OAuth2Password creates a password flow oauth2 security scheme -func OAuth2Password(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: password, - TokenURL: tokenURL, - }} -} - -// OAuth2Application creates an application flow oauth2 security scheme -func OAuth2Application(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: application, - TokenURL: tokenURL, - }} -} - -// OAuth2AccessToken creates an access token flow oauth2 security scheme -func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: accessCode, - AuthorizationURL: authorizationURL, - TokenURL: tokenURL, - }} -} - // SecuritySchemeProps describes a swagger security scheme in the securityDefinitions section type SecuritySchemeProps struct { Description string `json:"description,omitempty"` @@ -90,14 +32,6 @@ type SecuritySchemeProps struct { Scopes map[string]string `json:"scopes,omitempty"` // oauth2 } -// AddScope adds a scope to this security scheme -func (s *SecuritySchemeProps) AddScope(scope, description string) { - if s.Scopes == nil { - s.Scopes = make(map[string]string) - } - s.Scopes[scope] = description -} - // SecurityScheme allows the definition of a security scheme that can be used by the operations. // Supported schemes are basic authentication, an API key (either as a header or as a query parameter) // and OAuth2's common flows (implicit, password, application and access code). @@ -108,16 +42,6 @@ type SecurityScheme struct { SecuritySchemeProps } -// JSONLookup implements an interface to customize json pointer lookup -func (s SecurityScheme) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(s.SecuritySchemeProps, token) - return r, err -} - // MarshalJSON marshal this to JSON func (s SecurityScheme) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(s.SecuritySchemeProps) diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/swagger.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/swagger.go similarity index 67% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/swagger.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/swagger.go index 44722ffd5adc..be66d1ddd68a 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/swagger.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/swagger.go @@ -15,13 +15,9 @@ package spec import ( - "bytes" - "encoding/gob" "encoding/json" "fmt" - "strconv" - "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) @@ -35,15 +31,6 @@ type Swagger struct { SwaggerProps } -// JSONLookup look up a value by the json property name -func (s Swagger) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(s.SwaggerProps, token) - return r, err -} - // MarshalJSON marshals this swagger structure to json func (s Swagger) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(s.SwaggerProps) @@ -70,36 +57,6 @@ func (s *Swagger) UnmarshalJSON(data []byte) error { return nil } -// GobEncode provides a safe gob encoder for Swagger, including extensions -func (s Swagger) GobEncode() ([]byte, error) { - var b bytes.Buffer - raw := struct { - Props SwaggerProps - Ext VendorExtensible - }{ - Props: s.SwaggerProps, - Ext: s.VendorExtensible, - } - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Swagger, including extensions -func (s *Swagger) GobDecode(b []byte) error { - var raw struct { - Props SwaggerProps - Ext VendorExtensible - } - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - s.SwaggerProps = raw.Props - s.VendorExtensible = raw.Ext - return nil -} - // SwaggerProps captures the top-level properties of an Api specification // // NOTE: validation rules @@ -125,98 +82,6 @@ type SwaggerProps struct { ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` } -type swaggerPropsAlias SwaggerProps - -type gobSwaggerPropsAlias struct { - Security []map[string]struct { - List []string - Pad bool - } - Alias *swaggerPropsAlias - SecurityIsEmpty bool -} - -// GobEncode provides a safe gob encoder for SwaggerProps, including empty security requirements -func (o SwaggerProps) GobEncode() ([]byte, error) { - raw := gobSwaggerPropsAlias{ - Alias: (*swaggerPropsAlias)(&o), - } - - var b bytes.Buffer - if o.Security == nil { - // nil security requirement - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - if len(o.Security) == 0 { - // empty, but non-nil security requirement - raw.SecurityIsEmpty = true - raw.Alias.Security = nil - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - raw.Security = make([]map[string]struct { - List []string - Pad bool - }, 0, len(o.Security)) - for _, req := range o.Security { - v := make(map[string]struct { - List []string - Pad bool - }, len(req)) - for k, val := range req { - v[k] = struct { - List []string - Pad bool - }{ - List: val, - } - } - raw.Security = append(raw.Security, v) - } - - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for SwaggerProps, including empty security requirements -func (o *SwaggerProps) GobDecode(b []byte) error { - var raw gobSwaggerPropsAlias - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - if raw.Alias == nil { - return nil - } - - switch { - case raw.SecurityIsEmpty: - // empty, but non-nil security requirement - raw.Alias.Security = []map[string][]string{} - case len(raw.Alias.Security) == 0: - // nil security requirement - raw.Alias.Security = nil - default: - raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) - for _, req := range raw.Security { - v := make(map[string][]string, len(req)) - for k, val := range req { - v[k] = make([]string, 0, len(val.List)) - v[k] = append(v[k], val.List...) - } - raw.Alias.Security = append(raw.Alias.Security, v) - } - } - - *o = *(*SwaggerProps)(raw.Alias) - return nil -} - // Dependencies represent a dependencies property type Dependencies map[string]SchemaOrStringArray @@ -226,15 +91,6 @@ type SchemaOrBool struct { Schema *Schema } -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrBool) JSONLookup(token string) (interface{}, error) { - if token == "allows" { - return s.Allows, nil - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - var jsTrue = []byte("true") var jsFalse = []byte("false") @@ -273,12 +129,6 @@ type SchemaOrStringArray struct { Property []string } -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrStringArray) JSONLookup(token string) (interface{}, error) { - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - // MarshalJSON converts this schema object or array into JSON structure func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) { if len(s.Property) > 0 { @@ -341,16 +191,6 @@ func (s StringOrArray) Contains(value string) bool { return false } -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrArray) JSONLookup(token string) (interface{}, error) { - if _, err := strconv.Atoi(token); err == nil { - r, _, err := jsonpointer.GetForToken(s.Schemas, token) - return r, err - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - // UnmarshalJSON unmarshals this string or array object from a JSON array or JSON string func (s *StringOrArray) UnmarshalJSON(data []byte) error { var first byte @@ -444,5 +284,3 @@ func (s *SchemaOrArray) UnmarshalJSON(data []byte) error { *s = nw return nil } - -// vim:set ft=go noet sts=2 sw=2 ts=2: diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/spec/tag.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/tag.go similarity index 77% rename from cluster-autoscaler/vendor/github.com/go-openapi/spec/tag.go rename to cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/tag.go index faa3d3de1eb4..ddd1eac7efa1 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/spec/tag.go +++ b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/validation/spec/tag.go @@ -17,7 +17,6 @@ package spec import ( "encoding/json" - "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) @@ -28,11 +27,6 @@ type TagProps struct { ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` } -// NewTag creates a new tag -func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag { - return Tag{TagProps: TagProps{Description: description, Name: name, ExternalDocs: externalDocs}} -} - // Tag allows adding meta data to a single tag that is used by the // [Operation Object](http://goo.gl/8us55a#operationObject). // It is not mandatory to have a Tag Object per tag used there. @@ -43,16 +37,6 @@ type Tag struct { TagProps } -// JSONLookup implements an interface to customize json pointer lookup -func (t Tag) JSONLookup(token string) (interface{}, error) { - if ex, ok := t.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(t.TagProps, token) - return r, err -} - // MarshalJSON marshal this to JSON func (t Tag) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(t.TagProps) diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.pb.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.pb.go index fdc72c02fc41..ced0bf57c50d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.pb.go @@ -429,7 +429,7 @@ func (m *Device) GetTopology() *TopologyInfo { // - PreStartContainer allows Device Plugin to run device specific operations on // the Devices requested type PreStartContainerRequest struct { - DevicesIDs []string `protobuf:"bytes,1,rep,name=devicesIDs,proto3" json:"devicesIDs,omitempty"` + DevicesIDs []string `protobuf:"bytes,1,rep,name=devices_ids,json=devicesIds,proto3" json:"devices_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } @@ -769,7 +769,7 @@ func (m *AllocateRequest) GetContainerRequests() []*ContainerAllocateRequest { } type ContainerAllocateRequest struct { - DevicesIDs []string `protobuf:"bytes,1,rep,name=devicesIDs,proto3" json:"devicesIDs,omitempty"` + DevicesIDs []string `protobuf:"bytes,1,rep,name=devices_ids,json=devicesIds,proto3" json:"devices_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } @@ -1100,70 +1100,71 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 996 bytes of a gzipped FileDescriptorProto + // 1014 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x5f, 0x6f, 0x1b, 0x45, - 0x10, 0xcf, 0xc5, 0x75, 0x6c, 0x8f, 0xdd, 0xfc, 0xd9, 0x84, 0xc8, 0xb9, 0x04, 0x93, 0x6e, 0x0a, - 0x0d, 0x52, 0xe3, 0x10, 0x17, 0xb5, 0x28, 0x0f, 0x08, 0x83, 0x03, 0x58, 0xd0, 0xd4, 0xba, 0x50, - 0xf1, 0x00, 0xc2, 0x3a, 0x9f, 0x37, 0xf6, 0x89, 0xf3, 0xee, 0x71, 0xbb, 0xb6, 0xe4, 0x4a, 0x48, - 0x3c, 0xf0, 0x01, 0xfa, 0x1d, 0xe0, 0x2b, 0xf0, 0x1d, 0xfa, 0xc8, 0x23, 0x8f, 0x34, 0x7c, 0x11, - 0x74, 0xbb, 0xb7, 0x77, 0xa7, 0xcb, 0xc5, 0x04, 0xa9, 0x6f, 0xde, 0x99, 0xf9, 0xcd, 0x9f, 0xdf, - 0x8c, 0x67, 0x0e, 0x2a, 0xb6, 0xef, 0x36, 0xfd, 0x80, 0x09, 0x86, 0x4a, 0xb3, 0x93, 0x01, 0x11, - 0xf6, 0x89, 0x79, 0x34, 0x72, 0xc5, 0x78, 0x3a, 0x68, 0x3a, 0x6c, 0x72, 0x3c, 0x62, 0x23, 0x76, - 0x2c, 0xf5, 0x83, 0xe9, 0xa5, 0x7c, 0xc9, 0x87, 0xfc, 0xa5, 0x70, 0xf8, 0xa5, 0x01, 0x9b, 0x1d, - 0x32, 0x73, 0x1d, 0xd2, 0xf3, 0xa6, 0x23, 0x97, 0x3e, 0xf3, 0x85, 0xcb, 0x28, 0x47, 0x0f, 0x01, - 0xf9, 0x01, 0xe9, 0x73, 0x61, 0x07, 0xa2, 0x1f, 0x90, 0x9f, 0xa6, 0x6e, 0x40, 0x86, 0x75, 0x63, - 0xdf, 0x38, 0x2c, 0x5b, 0xeb, 0x7e, 0x40, 0x2e, 0x42, 0x85, 0x15, 0xc9, 0xd1, 0x57, 0x80, 0x47, - 0x44, 0xf4, 0xfd, 0x80, 0x5c, 0x92, 0x20, 0x20, 0xc3, 0xbe, 0xed, 0x79, 0xcc, 0xb1, 0x43, 0x57, - 0x7d, 0x7b, 0x66, 0xbb, 0x9e, 0x3d, 0xf0, 0x48, 0x7d, 0x59, 0xa2, 0xdf, 0x19, 0x11, 0xd1, 0xd3, - 0x86, 0xed, 0xd8, 0xae, 0xad, 0xcd, 0xf0, 0xef, 0x06, 0xac, 0x59, 0x64, 0xe4, 0x72, 0x41, 0x82, - 0x30, 0x02, 0xe1, 0x02, 0xd5, 0xa1, 0x34, 0x23, 0x01, 0x77, 0x19, 0x95, 0x39, 0x54, 0x2c, 0xfd, - 0x44, 0x26, 0x94, 0x09, 0x1d, 0xfa, 0xcc, 0xa5, 0x42, 0x06, 0xa8, 0x58, 0xf1, 0x1b, 0x1d, 0xc0, - 0xdd, 0x80, 0x70, 0x36, 0x0d, 0x1c, 0xd2, 0xa7, 0xf6, 0x84, 0xd4, 0x0b, 0xd2, 0xa0, 0xa6, 0x85, - 0xe7, 0xf6, 0x84, 0xa0, 0xc7, 0x50, 0x62, 0xaa, 0xe8, 0xfa, 0x9d, 0x7d, 0xe3, 0xb0, 0xda, 0xda, - 0x6b, 0x46, 0x5c, 0x36, 0x73, 0x88, 0xb1, 0xb4, 0x31, 0x2e, 0x41, 0xf1, 0x6c, 0xe2, 0x8b, 0x39, - 0x6e, 0xc3, 0xd6, 0xd7, 0x2e, 0x17, 0x6d, 0x3a, 0xfc, 0xd6, 0x16, 0xce, 0xd8, 0x22, 0xdc, 0x67, - 0x94, 0x13, 0xf4, 0x3e, 0x94, 0x86, 0xd2, 0x01, 0xaf, 0x1b, 0xfb, 0x85, 0xc3, 0x6a, 0x6b, 0x2d, - 0xe3, 0xd8, 0xd2, 0x7a, 0xfc, 0x04, 0x6a, 0xdf, 0x30, 0x9f, 0x79, 0x6c, 0x34, 0xef, 0xd2, 0x4b, - 0x86, 0x1e, 0x40, 0x91, 0xb2, 0x61, 0x0c, 0xdc, 0x88, 0x81, 0xe7, 0xcf, 0x9f, 0xb6, 0xcf, 0xd9, - 0x90, 0x58, 0x4a, 0x8f, 0x4d, 0x28, 0x6b, 0x11, 0x5a, 0x85, 0xe5, 0x6e, 0x47, 0xd2, 0x53, 0xb0, - 0x96, 0xbb, 0x1d, 0xec, 0xc0, 0x8a, 0x8a, 0x93, 0xd2, 0x54, 0x42, 0x0d, 0xda, 0x86, 0x95, 0x31, - 0xb1, 0x3d, 0x31, 0x8e, 0x18, 0x8b, 0x5e, 0xe8, 0x04, 0xca, 0x22, 0x4a, 0x43, 0x52, 0x55, 0x6d, - 0xbd, 0x15, 0x47, 0x4e, 0xe7, 0x67, 0xc5, 0x66, 0xf8, 0x14, 0xea, 0xbd, 0x68, 0x1a, 0x3e, 0x63, - 0x54, 0xd8, 0x2e, 0x4d, 0x9a, 0xd6, 0x00, 0x88, 0x0a, 0xec, 0x76, 0x54, 0x29, 0x15, 0x2b, 0x25, - 0xc1, 0xbb, 0xb0, 0x93, 0x83, 0x55, 0xec, 0xe1, 0x39, 0x98, 0x39, 0x53, 0xa2, 0x5d, 0x7f, 0x07, - 0xc8, 0xd1, 0x10, 0x39, 0x9e, 0x84, 0x0b, 0xcd, 0xd6, 0xc3, 0x38, 0xe7, 0xd8, 0xeb, 0xcd, 0x9e, - 0xac, 0x0d, 0x27, 0x93, 0x36, 0xc7, 0x7f, 0x18, 0x70, 0x70, 0x0b, 0x28, 0x3a, 0x86, 0xcd, 0x78, - 0xb8, 0xfb, 0xaa, 0xae, 0xa4, 0x50, 0x14, 0xab, 0x3a, 0x5a, 0x83, 0x3e, 0x84, 0xed, 0xc9, 0x94, - 0x8b, 0xbe, 0x4b, 0x1d, 0x6f, 0x3a, 0x4c, 0x63, 0x96, 0x25, 0x66, 0x2b, 0xd4, 0x76, 0x95, 0x32, - 0x41, 0x3d, 0x80, 0xb5, 0xd4, 0xdf, 0x89, 0xbb, 0x2f, 0xd4, 0x1c, 0x17, 0xad, 0xd5, 0x44, 0x7c, - 0xe1, 0xbe, 0x20, 0xf8, 0x67, 0xd8, 0xcd, 0xcd, 0x36, 0x9a, 0xc7, 0x1f, 0x60, 0x33, 0xcd, 0x99, - 0x92, 0x6a, 0xd2, 0x8e, 0x6e, 0x49, 0x9a, 0x42, 0x59, 0xc8, 0xc9, 0x36, 0x8c, 0xe3, 0x0e, 0xdc, - 0xbf, 0x0d, 0x16, 0xed, 0x41, 0x25, 0x4b, 0x56, 0x22, 0xc0, 0x0e, 0xac, 0x45, 0x18, 0xa2, 0x79, - 0xee, 0x2d, 0x68, 0xf6, 0xbd, 0xeb, 0x79, 0x67, 0xe0, 0x79, 0x1d, 0x3e, 0x85, 0xfa, 0x4d, 0xe6, - 0xff, 0x39, 0xb5, 0x23, 0x58, 0x4f, 0x20, 0x51, 0x49, 0x17, 0x8b, 0xa8, 0xc5, 0x8b, 0x52, 0x5c, - 0xc0, 0xe7, 0xaf, 0x05, 0xd8, 0xb9, 0x11, 0x81, 0x3e, 0x81, 0x3b, 0x84, 0xce, 0x16, 0xcc, 0x7c, - 0x16, 0xd1, 0x3c, 0xa3, 0x33, 0x7e, 0x46, 0x45, 0x30, 0xb7, 0x24, 0x12, 0xbd, 0x07, 0x2b, 0x13, - 0x36, 0xa5, 0x42, 0x4d, 0x5f, 0xb5, 0xb5, 0x1a, 0xfb, 0x78, 0x1a, 0x8a, 0xad, 0x48, 0x8b, 0x8e, - 0x92, 0x3d, 0x56, 0x90, 0x86, 0x9b, 0x99, 0x3d, 0x76, 0xe1, 0x13, 0x27, 0xde, 0x65, 0xe8, 0x39, - 0x54, 0x6d, 0x4a, 0x99, 0xb0, 0xf5, 0x4e, 0x0d, 0x21, 0x8f, 0x6e, 0x91, 0x5f, 0x3b, 0x41, 0xa9, - 0x34, 0xd3, 0x7e, 0xcc, 0x27, 0x50, 0x89, 0x0b, 0x40, 0xeb, 0x50, 0xf8, 0x91, 0xcc, 0xa3, 0x8d, - 0x16, 0xfe, 0x44, 0x5b, 0x50, 0x9c, 0xd9, 0xde, 0x94, 0x44, 0x1b, 0x4d, 0x3d, 0x4e, 0x97, 0x3f, - 0x32, 0xcc, 0x8f, 0x61, 0x3d, 0xeb, 0xf9, 0xff, 0xe0, 0xf1, 0x18, 0x8a, 0x92, 0x0f, 0xf4, 0x2e, - 0xac, 0x26, 0x4d, 0xf6, 0x6d, 0x31, 0x8e, 0xf0, 0x77, 0x63, 0x69, 0xcf, 0x16, 0x63, 0xb4, 0x0b, - 0x95, 0x31, 0xe3, 0x42, 0x59, 0x44, 0x17, 0x29, 0x14, 0x68, 0x65, 0x40, 0xec, 0x61, 0x9f, 0x51, - 0x4f, 0xad, 0xd8, 0xb2, 0x55, 0x0e, 0x05, 0xcf, 0xa8, 0x37, 0xc7, 0x01, 0x40, 0x42, 0xe8, 0x1b, - 0x09, 0xb7, 0x0f, 0x55, 0x9f, 0x04, 0x13, 0x97, 0x73, 0xd9, 0x0b, 0x75, 0xfe, 0xd2, 0xa2, 0xd6, - 0xe7, 0x50, 0x53, 0xb7, 0x36, 0x90, 0xfc, 0xa0, 0xc7, 0x50, 0xd6, 0xb7, 0x17, 0xd5, 0xe3, 0xa6, - 0x65, 0xce, 0xb1, 0x99, 0x8c, 0x8a, 0x3a, 0x81, 0x4b, 0xad, 0xdf, 0x0a, 0x50, 0x4b, 0x9f, 0x4b, - 0xf4, 0x25, 0x6c, 0x7f, 0x41, 0x44, 0xde, 0xa7, 0x45, 0x06, 0x6c, 0x2e, 0xbc, 0xb7, 0x78, 0x09, - 0xb5, 0xa1, 0x96, 0xbe, 0xaf, 0xd7, 0xf0, 0x6f, 0xc7, 0xef, 0xbc, 0x33, 0x8c, 0x97, 0x3e, 0x30, - 0x10, 0x91, 0xc9, 0xe4, 0x2c, 0x25, 0x74, 0x10, 0x83, 0x6f, 0x5e, 0xf4, 0xe6, 0xfd, 0xc5, 0x46, - 0x3a, 0x10, 0x6a, 0x43, 0x59, 0x4f, 0x75, 0x8a, 0xbc, 0xcc, 0x82, 0x31, 0x77, 0x72, 0x34, 0xb1, - 0x8b, 0xef, 0x61, 0xe3, 0xda, 0x4d, 0x44, 0xf7, 0xd2, 0xf1, 0x73, 0x6f, 0xad, 0x89, 0x17, 0x99, - 0x68, 0xef, 0x9f, 0xee, 0xbd, 0x7a, 0xdd, 0x30, 0xfe, 0x7a, 0xdd, 0x58, 0xfa, 0xe5, 0xaa, 0x61, - 0xbc, 0xba, 0x6a, 0x18, 0x7f, 0x5e, 0x35, 0x8c, 0xbf, 0xaf, 0x1a, 0xc6, 0xcb, 0x7f, 0x1a, 0x4b, - 0x83, 0x15, 0xf9, 0x49, 0xf8, 0xe8, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd3, 0xe5, 0x36, 0x5e, - 0x57, 0x0a, 0x00, 0x00, + 0x10, 0xcf, 0xc5, 0x4d, 0x62, 0x8f, 0x5d, 0x27, 0xdd, 0x84, 0xc8, 0xb9, 0x04, 0x37, 0xdd, 0x14, + 0x1a, 0xa4, 0xc6, 0x21, 0x2e, 0x6a, 0x11, 0x0f, 0x08, 0x17, 0x07, 0xb0, 0x42, 0x53, 0xeb, 0x42, + 0xc5, 0x03, 0x88, 0xd3, 0xf9, 0x6e, 0x63, 0x9f, 0x38, 0xef, 0x1e, 0xb7, 0x6b, 0x4b, 0xae, 0x84, + 0xc4, 0x03, 0x1f, 0xa0, 0xdf, 0x01, 0xbe, 0x02, 0xdf, 0xa1, 0x8f, 0x3c, 0xf2, 0x84, 0xa8, 0xf9, + 0x22, 0xe8, 0x76, 0xef, 0x9f, 0x2e, 0x17, 0x2b, 0x95, 0x78, 0xf3, 0xce, 0xcc, 0x6f, 0xfe, 0xfc, + 0x66, 0x3c, 0x73, 0x50, 0xb1, 0x7c, 0xb7, 0xe5, 0x07, 0x4c, 0x30, 0xb4, 0x36, 0x3d, 0x19, 0x10, + 0x61, 0x9d, 0xe8, 0x47, 0x43, 0x57, 0x8c, 0x26, 0x83, 0x96, 0xcd, 0xc6, 0xc7, 0x43, 0x36, 0x64, + 0xc7, 0x52, 0x3f, 0x98, 0x5c, 0xca, 0x97, 0x7c, 0xc8, 0x5f, 0x0a, 0x87, 0x5f, 0x69, 0xb0, 0xd9, + 0x25, 0x53, 0xd7, 0x26, 0x7d, 0x6f, 0x32, 0x74, 0xe9, 0x73, 0x5f, 0xb8, 0x8c, 0x72, 0xf4, 0x10, + 0x90, 0x1f, 0x10, 0x93, 0x0b, 0x2b, 0x10, 0x66, 0x40, 0x7e, 0x9a, 0xb8, 0x01, 0x71, 0x1a, 0xda, + 0xbe, 0x76, 0x58, 0x36, 0x36, 0xfc, 0x80, 0x5c, 0x84, 0x0a, 0x23, 0x92, 0xa3, 0x33, 0xc0, 0x43, + 0x22, 0x4c, 0x3f, 0x20, 0x97, 0x24, 0x08, 0x88, 0x63, 0x5a, 0x9e, 0xc7, 0x6c, 0x2b, 0x74, 0x65, + 0x5a, 0x53, 0xcb, 0xf5, 0xac, 0x81, 0x47, 0x1a, 0xcb, 0x12, 0x7d, 0x77, 0x48, 0x44, 0x3f, 0x36, + 0xec, 0x24, 0x76, 0x9d, 0xd8, 0x0c, 0xff, 0xae, 0xc1, 0xba, 0x41, 0x86, 0x2e, 0x17, 0x24, 0x08, + 0x23, 0x10, 0x2e, 0x50, 0x03, 0xd6, 0xa6, 0x24, 0xe0, 0x2e, 0xa3, 0x32, 0x87, 0x8a, 0x11, 0x3f, + 0x91, 0x0e, 0x65, 0x42, 0x1d, 0x9f, 0xb9, 0x54, 0xc8, 0x00, 0x15, 0x23, 0x79, 0xa3, 0x03, 0xb8, + 0x1d, 0x10, 0xce, 0x26, 0x81, 0x4d, 0x4c, 0x6a, 0x8d, 0x49, 0xa3, 0x24, 0x0d, 0x6a, 0xb1, 0xf0, + 0xdc, 0x1a, 0x13, 0xf4, 0x18, 0xd6, 0x98, 0x2a, 0xba, 0x71, 0x6b, 0x5f, 0x3b, 0xac, 0xb6, 0xf7, + 0x5a, 0x11, 0x97, 0xad, 0x02, 0x62, 0x8c, 0xd8, 0x18, 0xaf, 0xc1, 0xca, 0xe9, 0xd8, 0x17, 0x33, + 0xdc, 0x81, 0xad, 0xaf, 0x5d, 0x2e, 0x3a, 0xd4, 0xf9, 0xd6, 0x12, 0xf6, 0xc8, 0x20, 0xdc, 0x67, + 0x94, 0x13, 0xf4, 0x01, 0xac, 0x39, 0xd2, 0x01, 0x6f, 0x68, 0xfb, 0xa5, 0xc3, 0x6a, 0x7b, 0x3d, + 0xe7, 0xd8, 0x88, 0xf5, 0xf8, 0x09, 0xd4, 0xbe, 0x61, 0x3e, 0xf3, 0xd8, 0x70, 0xd6, 0xa3, 0x97, + 0x0c, 0x3d, 0x80, 0x15, 0xca, 0x9c, 0x04, 0x78, 0x27, 0x01, 0x9e, 0xbf, 0x78, 0xd6, 0x39, 0x67, + 0x0e, 0x31, 0x94, 0x1e, 0xeb, 0x50, 0x8e, 0x45, 0xa8, 0x0e, 0xcb, 0xbd, 0xae, 0xa4, 0xa7, 0x64, + 0x2c, 0xf7, 0xba, 0xd8, 0x86, 0x55, 0x15, 0x27, 0xa3, 0xa9, 0x84, 0x1a, 0xb4, 0x0d, 0xab, 0x23, + 0x62, 0x79, 0x62, 0x14, 0x31, 0x16, 0xbd, 0xd0, 0x09, 0x94, 0x45, 0x94, 0x86, 0xa4, 0xaa, 0xda, + 0x7e, 0x27, 0x89, 0x9c, 0xcd, 0xcf, 0x48, 0xcc, 0xf0, 0x19, 0x34, 0xfa, 0xd1, 0x34, 0x7c, 0xce, + 0xa8, 0xb0, 0x5c, 0x9a, 0x36, 0xed, 0x18, 0xaa, 0x51, 0x81, 0xa6, 0xeb, 0xa8, 0x5a, 0x2a, 0x4f, + 0xeb, 0xf3, 0xbf, 0xef, 0x82, 0xca, 0x8b, 0xf7, 0xba, 0xdc, 0x80, 0xc8, 0xa4, 0xe7, 0x70, 0xbc, + 0x0b, 0x3b, 0x05, 0xce, 0x14, 0x9d, 0x78, 0x06, 0x7a, 0xc1, 0xd8, 0xc4, 0xb1, 0xbe, 0x03, 0x64, + 0xc7, 0x10, 0x39, 0xaf, 0x84, 0x8b, 0x98, 0xbe, 0x87, 0x49, 0x11, 0x89, 0xd7, 0xeb, 0x3d, 0x19, + 0x77, 0xec, 0x5c, 0x1d, 0x1c, 0xff, 0xa1, 0xc1, 0xc1, 0x0d, 0xa0, 0xe8, 0x18, 0x36, 0x93, 0x69, + 0x37, 0x55, 0x5d, 0xbd, 0x6e, 0x54, 0xb8, 0x81, 0x12, 0x55, 0x37, 0xd6, 0xa0, 0x8f, 0x60, 0x7b, + 0x3c, 0xe1, 0xc2, 0x74, 0xa9, 0xed, 0x4d, 0x9c, 0x2c, 0x66, 0x59, 0x62, 0xb6, 0x42, 0x6d, 0x4f, + 0x29, 0x53, 0xd4, 0x03, 0x58, 0xcf, 0xfc, 0xbf, 0xb8, 0xfb, 0x52, 0x0d, 0xf6, 0x8a, 0x51, 0x4f, + 0xc5, 0x17, 0xee, 0x4b, 0x82, 0x7f, 0x86, 0xdd, 0xc2, 0x6c, 0xa3, 0x01, 0xfd, 0x01, 0x36, 0xb3, + 0x9c, 0x29, 0x69, 0x4c, 0xda, 0xd1, 0x0d, 0x49, 0x53, 0x28, 0x03, 0xd9, 0xf9, 0x86, 0x71, 0xdc, + 0x85, 0xfb, 0x37, 0xc1, 0xa2, 0x3d, 0xa8, 0xe4, 0xc9, 0x4a, 0x05, 0xd8, 0x86, 0xf5, 0x08, 0x43, + 0x62, 0x9e, 0xfb, 0x0b, 0x9a, 0x7d, 0xef, 0x6a, 0xde, 0x39, 0x78, 0x51, 0x87, 0xcf, 0xa0, 0x71, + 0x9d, 0xf9, 0xdb, 0x8f, 0xf1, 0x10, 0x36, 0x52, 0x1f, 0x51, 0x8d, 0x17, 0x8b, 0xb8, 0xc6, 0x8b, + 0x72, 0x5e, 0x40, 0xf0, 0xaf, 0x25, 0xd8, 0xb9, 0x16, 0x81, 0x3e, 0x83, 0x5b, 0x84, 0x4e, 0x17, + 0xfc, 0x09, 0xf2, 0x88, 0xd6, 0x29, 0x9d, 0xf2, 0x53, 0x2a, 0x82, 0x99, 0x21, 0x91, 0xe8, 0x7d, + 0x58, 0x1d, 0xb3, 0x09, 0x15, 0x6a, 0x1c, 0xab, 0xed, 0x7a, 0xe2, 0xe3, 0x59, 0x28, 0x36, 0x22, + 0x2d, 0x3a, 0x4a, 0x37, 0x5d, 0x49, 0x1a, 0x6e, 0xe6, 0x36, 0xdd, 0x85, 0x4f, 0xec, 0x64, 0xdb, + 0xa1, 0x17, 0x50, 0xb5, 0x28, 0x65, 0xc2, 0x8a, 0xb7, 0x6e, 0x08, 0x79, 0x74, 0x83, 0xfc, 0x3a, + 0x29, 0x4a, 0xa5, 0x99, 0xf5, 0xa3, 0x3f, 0x81, 0x4a, 0x52, 0x00, 0xda, 0x80, 0xd2, 0x8f, 0x64, + 0x16, 0xed, 0xbc, 0xf0, 0x27, 0xda, 0x82, 0x95, 0xa9, 0xe5, 0x4d, 0x48, 0xb4, 0xf3, 0xd4, 0xe3, + 0x93, 0xe5, 0x8f, 0x35, 0xfd, 0x53, 0xd8, 0xc8, 0x7b, 0x7e, 0x1b, 0x3c, 0x1e, 0xc1, 0x8a, 0xe4, + 0x03, 0xbd, 0x07, 0xf5, 0xb4, 0xc9, 0xbe, 0x25, 0x46, 0x11, 0xfe, 0x76, 0x22, 0xed, 0x5b, 0x62, + 0x84, 0x76, 0xa1, 0x32, 0x62, 0x5c, 0x28, 0x8b, 0xe8, 0x66, 0x85, 0x82, 0x58, 0x19, 0x10, 0xcb, + 0x31, 0x19, 0xf5, 0xd4, 0x12, 0x2e, 0x1b, 0xe5, 0x50, 0xf0, 0x9c, 0x7a, 0x33, 0x1c, 0x00, 0xa4, + 0x84, 0xfe, 0x2f, 0xe1, 0xf6, 0xa1, 0xea, 0x93, 0x60, 0xec, 0x72, 0x2e, 0x7b, 0xa1, 0x0e, 0x64, + 0x56, 0xd4, 0xfe, 0x02, 0x6a, 0xea, 0x1a, 0x07, 0x92, 0x1f, 0xf4, 0x18, 0xca, 0xf1, 0x75, 0x46, + 0x8d, 0xa4, 0x69, 0xb9, 0x83, 0xad, 0xa7, 0xa3, 0xa2, 0x8e, 0xe4, 0x52, 0xfb, 0xb7, 0x12, 0xd4, + 0xb2, 0x07, 0x15, 0x7d, 0x05, 0xdb, 0x5f, 0x12, 0x51, 0xf4, 0xf1, 0x91, 0x03, 0xeb, 0x0b, 0x2f, + 0x32, 0x5e, 0x42, 0x1d, 0xa8, 0x65, 0x2f, 0xf0, 0x15, 0xfc, 0xbb, 0xc9, 0xbb, 0xe8, 0x50, 0xe3, + 0xa5, 0x0f, 0x35, 0x44, 0x64, 0x32, 0x05, 0x5b, 0x0a, 0x1d, 0x24, 0xe0, 0xeb, 0x37, 0xbf, 0x7e, + 0x7f, 0xb1, 0x51, 0x1c, 0x08, 0x75, 0xa0, 0x1c, 0x4f, 0x75, 0x86, 0xbc, 0xdc, 0xc6, 0xd1, 0x77, + 0x0a, 0x34, 0x89, 0x8b, 0xef, 0xe1, 0xce, 0x95, 0x23, 0x89, 0xee, 0x65, 0xe3, 0x17, 0x5e, 0x63, + 0x1d, 0x2f, 0x32, 0x89, 0xbd, 0x3f, 0xdd, 0x7b, 0xfd, 0xa6, 0xa9, 0xfd, 0xf5, 0xa6, 0xb9, 0xf4, + 0xcb, 0xbc, 0xa9, 0xbd, 0x9e, 0x37, 0xb5, 0x3f, 0xe7, 0x4d, 0xed, 0x9f, 0x79, 0x53, 0x7b, 0xf5, + 0x6f, 0x73, 0x69, 0xb0, 0x2a, 0x3f, 0x1a, 0x1f, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x2d, + 0xfa, 0x93, 0x79, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.proto b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.proto index 5debef7232c0..d22da05b2a03 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.proto +++ b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.proto @@ -94,9 +94,9 @@ message NUMANode { * struct Device { * ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e", * Health: "Healthy", -* Topology: -* Node: -* ID: 1 +* Topology: +* Node: +* ID: 1 *} */ message Device { // A unique ID assigned by the device plugin used @@ -114,7 +114,7 @@ message Device { // - PreStartContainer allows Device Plugin to run device specific operations on // the Devices requested message PreStartContainerRequest { - repeated string devicesIDs = 1; + repeated string devices_ids = 1 [(gogoproto.customname) = "DevicesIDs"]; } // PreStartContainerResponse will be send by plugin in response to PreStartContainerRequest @@ -160,7 +160,7 @@ message AllocateRequest { } message ContainerAllocateRequest { - repeated string devicesIDs = 1; + repeated string devices_ids = 1 [(gogoproto.customname) = "DevicesIDs"]; } // AllocateResponse includes the artifacts that needs to be injected into diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go index fc3e707a7aae..d8d15eb2f726 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go @@ -45,6 +45,97 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type AllocatableResourcesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AllocatableResourcesRequest) Reset() { *m = AllocatableResourcesRequest{} } +func (*AllocatableResourcesRequest) ProtoMessage() {} +func (*AllocatableResourcesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{0} +} +func (m *AllocatableResourcesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllocatableResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AllocatableResourcesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AllocatableResourcesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllocatableResourcesRequest.Merge(m, src) +} +func (m *AllocatableResourcesRequest) XXX_Size() int { + return m.Size() +} +func (m *AllocatableResourcesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AllocatableResourcesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AllocatableResourcesRequest proto.InternalMessageInfo + +// AllocatableResourcesResponses contains informations about all the devices known by the kubelet +type AllocatableResourcesResponse struct { + Devices []*ContainerDevices `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` + CpuIds []int64 `protobuf:"varint,2,rep,packed,name=cpu_ids,json=cpuIds,proto3" json:"cpu_ids,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AllocatableResourcesResponse) Reset() { *m = AllocatableResourcesResponse{} } +func (*AllocatableResourcesResponse) ProtoMessage() {} +func (*AllocatableResourcesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{1} +} +func (m *AllocatableResourcesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllocatableResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AllocatableResourcesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AllocatableResourcesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllocatableResourcesResponse.Merge(m, src) +} +func (m *AllocatableResourcesResponse) XXX_Size() int { + return m.Size() +} +func (m *AllocatableResourcesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AllocatableResourcesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AllocatableResourcesResponse proto.InternalMessageInfo + +func (m *AllocatableResourcesResponse) GetDevices() []*ContainerDevices { + if m != nil { + return m.Devices + } + return nil +} + +func (m *AllocatableResourcesResponse) GetCpuIds() []int64 { + if m != nil { + return m.CpuIds + } + return nil +} + // ListPodResourcesRequest is the request made to the PodResourcesLister service type ListPodResourcesRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -54,7 +145,7 @@ type ListPodResourcesRequest struct { func (m *ListPodResourcesRequest) Reset() { *m = ListPodResourcesRequest{} } func (*ListPodResourcesRequest) ProtoMessage() {} func (*ListPodResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} + return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *ListPodResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -93,7 +184,7 @@ type ListPodResourcesResponse struct { func (m *ListPodResourcesResponse) Reset() { *m = ListPodResourcesResponse{} } func (*ListPodResourcesResponse) ProtoMessage() {} func (*ListPodResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{1} + return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *ListPodResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -141,7 +232,7 @@ type PodResources struct { func (m *PodResources) Reset() { *m = PodResources{} } func (*PodResources) ProtoMessage() {} func (*PodResources) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{2} + return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *PodResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -203,7 +294,7 @@ type ContainerResources struct { func (m *ContainerResources) Reset() { *m = ContainerResources{} } func (*ContainerResources) ProtoMessage() {} func (*ContainerResources) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{3} + return fileDescriptor_00212fb1f9d3bf1c, []int{5} } func (m *ContainerResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -265,7 +356,7 @@ type ContainerDevices struct { func (m *ContainerDevices) Reset() { *m = ContainerDevices{} } func (*ContainerDevices) ProtoMessage() {} func (*ContainerDevices) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{4} + return fileDescriptor_00212fb1f9d3bf1c, []int{6} } func (m *ContainerDevices) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -325,7 +416,7 @@ type TopologyInfo struct { func (m *TopologyInfo) Reset() { *m = TopologyInfo{} } func (*TopologyInfo) ProtoMessage() {} func (*TopologyInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{5} + return fileDescriptor_00212fb1f9d3bf1c, []int{7} } func (m *TopologyInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -371,7 +462,7 @@ type NUMANode struct { func (m *NUMANode) Reset() { *m = NUMANode{} } func (*NUMANode) ProtoMessage() {} func (*NUMANode) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{6} + return fileDescriptor_00212fb1f9d3bf1c, []int{8} } func (m *NUMANode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -408,6 +499,8 @@ func (m *NUMANode) GetID() int64 { } func init() { + proto.RegisterType((*AllocatableResourcesRequest)(nil), "v1.AllocatableResourcesRequest") + proto.RegisterType((*AllocatableResourcesResponse)(nil), "v1.AllocatableResourcesResponse") proto.RegisterType((*ListPodResourcesRequest)(nil), "v1.ListPodResourcesRequest") proto.RegisterType((*ListPodResourcesResponse)(nil), "v1.ListPodResourcesResponse") proto.RegisterType((*PodResources)(nil), "v1.PodResources") @@ -420,34 +513,37 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 424 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xcd, 0xda, 0xa5, 0xad, 0x07, 0x17, 0x55, 0x2b, 0x44, 0x4d, 0x08, 0x56, 0xb4, 0x5c, 0x7a, - 0x00, 0x57, 0x0d, 0x82, 0x3b, 0x34, 0x17, 0x4b, 0x10, 0xc1, 0x0a, 0x0e, 0x9c, 0x22, 0xc7, 0xbb, - 0x35, 0x96, 0xa8, 0x67, 0xeb, 0xb5, 0x23, 0xb8, 0x71, 0xe0, 0x03, 0xf8, 0xac, 0x1e, 0x39, 0x72, - 0xa4, 0xe6, 0x47, 0xd0, 0xae, 0x71, 0xe3, 0x90, 0x70, 0xf2, 0xcc, 0x7b, 0x33, 0xef, 0x8d, 0x77, - 0x06, 0xbc, 0x44, 0xe5, 0x91, 0x2a, 0xb1, 0x42, 0xea, 0x2c, 0x4f, 0x87, 0x4f, 0xb2, 0xbc, 0xfa, - 0x58, 0x2f, 0xa2, 0x14, 0x2f, 0x4e, 0x32, 0xcc, 0xf0, 0xc4, 0x52, 0x8b, 0xfa, 0xdc, 0x66, 0x36, - 0xb1, 0x51, 0xdb, 0xc2, 0xee, 0xc3, 0xd1, 0xab, 0x5c, 0x57, 0x6f, 0x50, 0x70, 0xa9, 0xb1, 0x2e, - 0x53, 0xa9, 0xb9, 0xbc, 0xac, 0xa5, 0xae, 0xd8, 0x5b, 0x08, 0x36, 0x29, 0xad, 0xb0, 0xd0, 0x92, - 0x3e, 0x83, 0x03, 0x85, 0x62, 0x5e, 0x76, 0x44, 0x40, 0xc6, 0xee, 0xf1, 0xed, 0xc9, 0x61, 0xb4, - 0x3c, 0x8d, 0xd6, 0x1a, 0x7c, 0xd5, 0xcb, 0xd8, 0x67, 0xf0, 0xfb, 0x2c, 0xa5, 0xb0, 0x53, 0x24, - 0x17, 0x32, 0x20, 0x63, 0x72, 0xec, 0x71, 0x1b, 0xd3, 0x11, 0x78, 0xe6, 0xab, 0x55, 0x92, 0xca, - 0xc0, 0xb1, 0xc4, 0x0a, 0xa0, 0xcf, 0x01, 0x52, 0x2c, 0xaa, 0x24, 0x2f, 0x64, 0xa9, 0x03, 0xd7, - 0xba, 0xde, 0x33, 0xae, 0x67, 0x1d, 0xba, 0xf2, 0xee, 0x55, 0xb2, 0x4b, 0xa0, 0x9b, 0x15, 0x5b, - 0xfd, 0x23, 0xd8, 0x13, 0x72, 0x99, 0x9b, 0x9f, 0x72, 0xac, 0xfc, 0xdd, 0x35, 0xf9, 0x69, 0xcb, - 0xf1, 0xae, 0x88, 0x1e, 0xc1, 0x5e, 0xaa, 0xea, 0x79, 0x2e, 0xda, 0x71, 0x5c, 0xbe, 0x9b, 0xaa, - 0x3a, 0x16, 0x9a, 0x7d, 0x23, 0x70, 0xf8, 0x6f, 0x1b, 0x7d, 0x04, 0x07, 0xdd, 0xa3, 0xcd, 0x7b, - 0xd6, 0x7e, 0x07, 0xce, 0xcc, 0x08, 0x0f, 0x01, 0x5a, 0x75, 0xab, 0x6a, 0xa6, 0xf0, 0xb8, 0xd7, - 0x22, 0xb1, 0xd0, 0xf4, 0x31, 0xec, 0x57, 0xa8, 0xf0, 0x13, 0x66, 0x5f, 0x02, 0x77, 0x4c, 0xba, - 0x77, 0x7f, 0xf7, 0x17, 0x8b, 0x8b, 0x73, 0xe4, 0x37, 0x15, 0x6c, 0x02, 0x7e, 0x9f, 0xa1, 0x0c, - 0x6e, 0x15, 0x28, 0x6e, 0x56, 0xe6, 0x9b, 0xd6, 0xd9, 0xfb, 0xd7, 0x2f, 0x66, 0x28, 0x24, 0x6f, - 0x29, 0x36, 0x84, 0xfd, 0x0e, 0xa2, 0x77, 0xc0, 0x89, 0xa7, 0x76, 0x4c, 0x97, 0x3b, 0xf1, 0x74, - 0xf2, 0x01, 0x68, 0x7f, 0x87, 0xe6, 0x44, 0x64, 0x49, 0xcf, 0x60, 0xc7, 0x44, 0xf4, 0x81, 0x91, - 0xfb, 0xcf, 0x45, 0x0d, 0x47, 0xdb, 0xc9, 0xf6, 0xa6, 0xd8, 0xe0, 0xe5, 0xe8, 0xea, 0x3a, 0x24, - 0x3f, 0xaf, 0xc3, 0xc1, 0xd7, 0x26, 0x24, 0x57, 0x4d, 0x48, 0x7e, 0x34, 0x21, 0xf9, 0xd5, 0x84, - 0xe4, 0xfb, 0xef, 0x70, 0xb0, 0xd8, 0xb5, 0x17, 0xfb, 0xf4, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x1f, 0x52, 0x67, 0x23, 0xf1, 0x02, 0x00, 0x00, + // 480 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x80, 0xb3, 0x76, 0x69, 0x9b, 0xc1, 0x45, 0xd5, 0x0a, 0x11, 0x93, 0xa6, 0xc6, 0x5a, 0x2e, + 0x39, 0x80, 0xab, 0x06, 0xc1, 0xbd, 0x34, 0x12, 0xb2, 0x04, 0x11, 0xac, 0xe0, 0x4a, 0xe4, 0xd8, + 0x5b, 0x63, 0x29, 0xf5, 0x6c, 0xbd, 0x76, 0x04, 0x37, 0x0e, 0x3c, 0x00, 0xaf, 0xc3, 0x1b, 0xf4, + 0xc8, 0x91, 0x23, 0x0d, 0x2f, 0x82, 0xbc, 0x8e, 0x53, 0x87, 0xa4, 0x48, 0x3d, 0x79, 0x66, 0xbe, + 0xf9, 0xf3, 0xcc, 0x2c, 0xb4, 0x03, 0x99, 0x78, 0x32, 0xc3, 0x1c, 0xa9, 0x31, 0x3b, 0xee, 0x3e, + 0x8d, 0x93, 0xfc, 0x53, 0x31, 0xf1, 0x42, 0x3c, 0x3f, 0x8a, 0x31, 0xc6, 0x23, 0x8d, 0x26, 0xc5, + 0x99, 0xd6, 0xb4, 0xa2, 0xa5, 0x2a, 0x84, 0x1d, 0xc2, 0xc1, 0xc9, 0x74, 0x8a, 0x61, 0x90, 0x07, + 0x93, 0xa9, 0xe0, 0x42, 0x61, 0x91, 0x85, 0x42, 0x71, 0x71, 0x51, 0x08, 0x95, 0xb3, 0x18, 0x7a, + 0x9b, 0xb1, 0x92, 0x98, 0x2a, 0x41, 0x3d, 0xd8, 0x89, 0xc4, 0x2c, 0x09, 0x85, 0xb2, 0x89, 0x6b, + 0xf6, 0xef, 0x0e, 0xee, 0x7b, 0xb3, 0x63, 0xef, 0x14, 0xd3, 0x3c, 0x48, 0x52, 0x91, 0x0d, 0x2b, + 0xc6, 0x6b, 0x27, 0xda, 0x81, 0x9d, 0x50, 0x16, 0xe3, 0x24, 0x52, 0xb6, 0xe1, 0x9a, 0x7d, 0x93, + 0x6f, 0x87, 0xb2, 0xf0, 0x23, 0xc5, 0x1e, 0x42, 0xe7, 0x75, 0xa2, 0xf2, 0xb7, 0x18, 0xad, 0xf5, + 0xf0, 0x0e, 0xec, 0x75, 0xb4, 0xa8, 0xff, 0x1c, 0xf6, 0x24, 0x46, 0xe3, 0xac, 0x06, 0x8b, 0x2e, + 0xf6, 0xcb, 0x2e, 0x56, 0x02, 0x2c, 0xd9, 0xd0, 0xd8, 0x67, 0xb0, 0x9a, 0x94, 0x52, 0xd8, 0x4a, + 0x83, 0x73, 0x61, 0x13, 0x97, 0xf4, 0xdb, 0x5c, 0xcb, 0xb4, 0x07, 0xed, 0xf2, 0xab, 0x64, 0x10, + 0x0a, 0xdb, 0xd0, 0xe0, 0xda, 0x40, 0x5f, 0x00, 0x84, 0xf5, 0x5f, 0x2a, 0xdb, 0xd4, 0x55, 0x1f, + 0xac, 0xfc, 0xfb, 0x75, 0xed, 0x86, 0x27, 0xbb, 0x00, 0xba, 0xee, 0xb1, 0xb1, 0x7e, 0x63, 0xb4, + 0xc6, 0x2d, 0x47, 0x6b, 0xae, 0x8c, 0xf6, 0x1b, 0x81, 0xfd, 0x7f, 0xc3, 0xe8, 0x63, 0xd8, 0xab, + 0x87, 0x36, 0x6e, 0x94, 0xb6, 0x6a, 0xe3, 0xa8, 0x6c, 0xe1, 0x10, 0xa0, 0xca, 0xbe, 0x5c, 0x58, + 0x9b, 0xb7, 0x2b, 0x8b, 0x1f, 0x29, 0xfa, 0x04, 0x76, 0x73, 0x94, 0x38, 0xc5, 0xf8, 0x8b, 0x6d, + 0xba, 0xa4, 0x9e, 0xfb, 0xfb, 0x85, 0xcd, 0x4f, 0xcf, 0x90, 0x2f, 0x3d, 0xd8, 0x00, 0xac, 0x26, + 0xa1, 0x0c, 0xee, 0xa4, 0x18, 0x2d, 0x57, 0x66, 0x95, 0xa1, 0xa3, 0x0f, 0x6f, 0x4e, 0x46, 0x18, + 0x09, 0x5e, 0x21, 0xd6, 0x85, 0xdd, 0xda, 0x44, 0xef, 0x81, 0xe1, 0x0f, 0x75, 0x9b, 0x26, 0x37, + 0xfc, 0xe1, 0xe0, 0x07, 0x01, 0xda, 0x5c, 0x62, 0x79, 0x23, 0x22, 0xa3, 0xa7, 0xb0, 0x55, 0x4a, + 0xf4, 0xa0, 0xcc, 0x77, 0xc3, 0x49, 0x75, 0x7b, 0x9b, 0x61, 0x75, 0x54, 0xac, 0x45, 0x3f, 0x42, + 0xe7, 0x95, 0xc8, 0x37, 0x5d, 0x3e, 0x7d, 0x54, 0x86, 0xfe, 0xe7, 0xc9, 0x74, 0xdd, 0x9b, 0x1d, + 0xea, 0xfc, 0x2f, 0x7b, 0x97, 0x57, 0x0e, 0xf9, 0x75, 0xe5, 0xb4, 0xbe, 0xce, 0x1d, 0x72, 0x39, + 0x77, 0xc8, 0xcf, 0xb9, 0x43, 0x7e, 0xcf, 0x1d, 0xf2, 0xfd, 0x8f, 0xd3, 0x9a, 0x6c, 0xeb, 0xa7, + 0xf9, 0xec, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6f, 0x70, 0xd4, 0x4f, 0xda, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -463,6 +559,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type PodResourcesListerClient interface { List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error) + GetAllocatableResources(ctx context.Context, in *AllocatableResourcesRequest, opts ...grpc.CallOption) (*AllocatableResourcesResponse, error) } type podResourcesListerClient struct { @@ -482,9 +579,19 @@ func (c *podResourcesListerClient) List(ctx context.Context, in *ListPodResource return out, nil } +func (c *podResourcesListerClient) GetAllocatableResources(ctx context.Context, in *AllocatableResourcesRequest, opts ...grpc.CallOption) (*AllocatableResourcesResponse, error) { + out := new(AllocatableResourcesResponse) + err := c.cc.Invoke(ctx, "/v1.PodResourcesLister/GetAllocatableResources", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // PodResourcesListerServer is the server API for PodResourcesLister service. type PodResourcesListerServer interface { List(context.Context, *ListPodResourcesRequest) (*ListPodResourcesResponse, error) + GetAllocatableResources(context.Context, *AllocatableResourcesRequest) (*AllocatableResourcesResponse, error) } // UnimplementedPodResourcesListerServer can be embedded to have forward compatible implementations. @@ -494,6 +601,9 @@ type UnimplementedPodResourcesListerServer struct { func (*UnimplementedPodResourcesListerServer) List(ctx context.Context, req *ListPodResourcesRequest) (*ListPodResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } +func (*UnimplementedPodResourcesListerServer) GetAllocatableResources(ctx context.Context, req *AllocatableResourcesRequest) (*AllocatableResourcesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllocatableResources not implemented") +} func RegisterPodResourcesListerServer(s *grpc.Server, srv PodResourcesListerServer) { s.RegisterService(&_PodResourcesLister_serviceDesc, srv) @@ -517,6 +627,24 @@ func _PodResourcesLister_List_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _PodResourcesLister_GetAllocatableResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AllocatableResourcesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PodResourcesListerServer).GetAllocatableResources(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1.PodResourcesLister/GetAllocatableResources", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PodResourcesListerServer).GetAllocatableResources(ctx, req.(*AllocatableResourcesRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _PodResourcesLister_serviceDesc = grpc.ServiceDesc{ ServiceName: "v1.PodResourcesLister", HandlerType: (*PodResourcesListerServer)(nil), @@ -525,11 +653,94 @@ var _PodResourcesLister_serviceDesc = grpc.ServiceDesc{ MethodName: "List", Handler: _PodResourcesLister_List_Handler, }, + { + MethodName: "GetAllocatableResources", + Handler: _PodResourcesLister_GetAllocatableResources_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } +func (m *AllocatableResourcesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AllocatableResourcesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllocatableResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *AllocatableResourcesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AllocatableResourcesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllocatableResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CpuIds) > 0 { + dAtA2 := make([]byte, len(m.CpuIds)*10) + var j1 int + for _, num1 := range m.CpuIds { + num := uint64(num1) + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintApi(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0x12 + } + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *ListPodResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -662,21 +873,21 @@ func (m *ContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.CpuIds) > 0 { - dAtA2 := make([]byte, len(m.CpuIds)*10) - var j1 int + dAtA4 := make([]byte, len(m.CpuIds)*10) + var j3 int for _, num1 := range m.CpuIds { num := uint64(num1) for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j1++ + j3++ } - dAtA2[j1] = uint8(num) - j1++ + dAtA4[j3] = uint8(num) + j3++ } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintApi(dAtA, i, uint64(j1)) + i -= j3 + copy(dAtA[i:], dAtA4[:j3]) + i = encodeVarintApi(dAtA, i, uint64(j3)) i-- dAtA[i] = 0x1a } @@ -831,6 +1042,37 @@ func encodeVarintApi(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *AllocatableResourcesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *AllocatableResourcesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Devices) > 0 { + for _, e := range m.Devices { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } + if len(m.CpuIds) > 0 { + l = 0 + for _, e := range m.CpuIds { + l += sovApi(uint64(e)) + } + n += 1 + sovApi(uint64(l)) + l + } + return n +} + func (m *ListPodResourcesRequest) Size() (n int) { if m == nil { return 0 @@ -960,6 +1202,31 @@ func sovApi(x uint64) (n int) { func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (this *AllocatableResourcesRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllocatableResourcesRequest{`, + `}`, + }, "") + return s +} +func (this *AllocatableResourcesResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForDevices := "[]*ContainerDevices{" + for _, f := range this.Devices { + repeatedStringForDevices += strings.Replace(f.String(), "ContainerDevices", "ContainerDevices", 1) + "," + } + repeatedStringForDevices += "}" + s := strings.Join([]string{`&AllocatableResourcesResponse{`, + `Devices:` + repeatedStringForDevices + `,`, + `CpuIds:` + fmt.Sprintf("%v", this.CpuIds) + `,`, + `}`, + }, "") + return s +} func (this *ListPodResourcesRequest) String() string { if this == nil { return "nil" @@ -1063,6 +1330,216 @@ func valueToStringApi(v interface{}) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } +func (m *AllocatableResourcesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllocatableResourcesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllocatableResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllocatableResourcesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllocatableResourcesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllocatableResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Devices = append(m.Devices, &ContainerDevices{}) + if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CpuIds = append(m.CpuIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.CpuIds) == 0 { + m.CpuIds = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CpuIds = append(m.CpuIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field CpuIds", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ListPodResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto index cd8dbeaf9579..a05c5fd5605a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto +++ b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto @@ -18,6 +18,15 @@ option (gogoproto.goproto_unrecognized_all) = false; // node resources consumed by pods and containers on the node service PodResourcesLister { rpc List(ListPodResourcesRequest) returns (ListPodResourcesResponse) {} + rpc GetAllocatableResources(AllocatableResourcesRequest) returns (AllocatableResourcesResponse) {} +} + +message AllocatableResourcesRequest {} + +// AllocatableResourcesResponses contains informations about all the devices known by the kubelet +message AllocatableResourcesResponse { + repeated ContainerDevices devices = 1; + repeated int64 cpu_ids = 2; } // ListPodResourcesRequest is the request made to the PodResourcesLister service diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go index 2d5ca952c319..f7b57b2582bc 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go @@ -750,7 +750,7 @@ func (s *ProxyServer) Run() error { // functions must configure their shared informer event handlers first. informerFactory.Start(wait.NeverStop) - if utilfeature.DefaultFeatureGate.Enabled(features.ServiceTopology) { + if utilfeature.DefaultFeatureGate.Enabled(features.ServiceTopology) || utilfeature.DefaultFeatureGate.Enabled(features.TopologyAwareHints) { // Make an informer that selects for our nodename. currentNodeInformerFactory := informers.NewSharedInformerFactoryWithOptions(s.Client, s.ConfigSyncPeriod, informers.WithTweakListOptions(func(options *metav1.ListOptions) { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server_others.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server_others.go index 62547325b34e..011ff019f48c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server_others.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server_others.go @@ -364,6 +364,12 @@ func newProxyServer( } } + useEndpointSlices := utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceProxying) + if proxyMode == proxyModeUserspace { + // userspace mode doesn't support endpointslice. + useEndpointSlices = false + } + return &ProxyServer{ Client: client, EventClient: eventClient, @@ -384,7 +390,7 @@ func newProxyServer( OOMScoreAdj: config.OOMScoreAdj, ConfigSyncPeriod: config.ConfigSyncPeriod.Duration, HealthzServer: healthzServer, - UseEndpointSlices: utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceProxying), + UseEndpointSlices: useEndpointSlices, }, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server_windows.go index 12c714a39345..6853d9e0166f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server_windows.go @@ -104,10 +104,10 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi proxyMode := getProxyMode(string(config.Mode), winkernel.WindowsKernelCompatTester{}) if proxyMode == proxyModeKernelspace { - klog.V(0).Info("Using Kernelspace Proxier.") + klog.V(0).InfoS("Using Kernelspace Proxier.") isIPv6DualStackEnabled := utilfeature.DefaultFeatureGate.Enabled(features.IPv6DualStack) if isIPv6DualStackEnabled { - klog.V(0).Info("creating dualStackProxier for Windows kernel.") + klog.V(0).InfoS("Creating dualStackProxier for Windows kernel.") proxier, err = winkernel.NewDualStackProxier( config.IPTables.SyncPeriod.Duration, @@ -142,7 +142,7 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi return nil, fmt.Errorf("unable to create proxier: %v", err) } } else { - klog.V(0).Info("Using userspace Proxier.") + klog.V(0).InfoS("Using userspace Proxier.") execer := exec.New() var netshInterface utilnetsh.Interface netshInterface = utilnetsh.New(execer) @@ -160,7 +160,11 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi return nil, fmt.Errorf("unable to create proxier: %v", err) } } - + useEndpointSlices := utilfeature.DefaultFeatureGate.Enabled(features.WindowsEndpointSliceProxying) + if proxyMode == proxyModeUserspace { + // userspace mode doesn't support endpointslice. + useEndpointSlices = false + } return &ProxyServer{ Client: client, EventClient: eventClient, @@ -175,7 +179,7 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi OOMScoreAdj: config.OOMScoreAdj, ConfigSyncPeriod: config.ConfigSyncPeriod.Duration, HealthzServer: healthzServer, - UseEndpointSlices: utilfeature.DefaultFeatureGate.Enabled(features.WindowsEndpointSliceProxying), + UseEndpointSlices: useEndpointSlices, }, nil } @@ -197,14 +201,14 @@ func tryWinKernelSpaceProxy(kcompat winkernel.KernelCompatTester) string { // guaranteed false on error, error only necessary for debugging useWinKernelProxy, err := winkernel.CanUseWinKernelProxier(kcompat) if err != nil { - klog.Errorf("Can't determine whether to use windows kernel proxy, using userspace proxier: %v", err) + klog.ErrorS(err, "Can't determine whether to use windows kernel proxy, using userspace proxier") return proxyModeUserspace } if useWinKernelProxy { return proxyModeKernelspace } // Fallback. - klog.V(1).Infof("Can't use winkernel proxy, using userspace proxier") + klog.V(1).InfoS("Can't use winkernel proxy, using userspace proxier") return proxyModeUserspace } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/init_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/init_windows.go index bed76806701f..8b2755cc30d4 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/init_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/init_windows.go @@ -52,7 +52,7 @@ func initForOS(windowsService bool, windowsPriorityClass string) error { } kubeletProcessHandle := windows.CurrentProcess() // Set the priority of the kubelet process to given priority - klog.Infof("Setting the priority of kubelet process to %s", windowsPriorityClass) + klog.InfoS("Setting the priority of kubelet process", "windowsPriorityClass", windowsPriorityClass) if err := windows.SetPriorityClass(kubeletProcessHandle, priority); err != nil { return err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go index e4fd85cf9eae..2cd28ac56b4a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go @@ -56,8 +56,6 @@ type KubeletFlags struct { KubeConfig string BootstrapKubeconfig string - // Insert a probability of random errors during calls to the master. - ChaosChance float64 // Crash immediately, rather than eating panics. ReallyCrashForTesting bool @@ -367,8 +365,6 @@ func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) { fs.MarkDeprecated("keep-terminated-pod-volumes", "will be removed in a future version") fs.BoolVar(&f.ReallyCrashForTesting, "really-crash-for-testing", f.ReallyCrashForTesting, "If true, when panics occur crash. Intended for testing.") fs.MarkDeprecated("really-crash-for-testing", "will be removed in a future version.") - fs.Float64Var(&f.ChaosChance, "chaos-chance", f.ChaosChance, "If > 0.0, introduce random client errors and latency. Intended for testing.") - fs.MarkDeprecated("chaos-chance", "will be removed in a future version.") fs.StringVar(&f.SeccompProfileRoot, "seccomp-profile-root", f.SeccompProfileRoot, " Directory path for seccomp profiles.") fs.MarkDeprecated("seccomp-profile-root", "will be removed in 1.23, in favor of using the `/seccomp` directory") fs.StringVar(&f.ExperimentalMounterPath, "experimental-mounter-path", f.ExperimentalMounterPath, "[Experimental] Path of mounter binary. Leave empty to use the default mount.") @@ -537,7 +533,7 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig fs.StringSliceVar(&c.EnforceNodeAllocatable, "enforce-node-allocatable", c.EnforceNodeAllocatable, "A comma separated list of levels of node allocatable enforcement to be enforced by kubelet. Acceptable options are 'none', 'pods', 'system-reserved', and 'kube-reserved'. If the latter two options are specified, '--system-reserved-cgroup' and '--kube-reserved-cgroup' must also be set, respectively. If 'none' is specified, no additional options should be set. See https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/ for more details.") fs.StringVar(&c.SystemReservedCgroup, "system-reserved-cgroup", c.SystemReservedCgroup, "Absolute name of the top level cgroup that is used to manage non-kubernetes components for which compute resources were reserved via '--system-reserved' flag. Ex. '/system-reserved'. [default='']") fs.StringVar(&c.KubeReservedCgroup, "kube-reserved-cgroup", c.KubeReservedCgroup, "Absolute name of the top level cgroup that is used to manage kubernetes components for which compute resources were reserved via '--kube-reserved' flag. Ex. '/kube-reserved'. [default='']") - fs.StringVar(&c.Logging.Format, "logging-format", c.Logging.Format, `Sets the log format. Permitted formats: "text", "json".\nNon-default formats don't honor these flags: -add_dir_header, --alsologtostderr, --log_backtrace_at, --log_dir, --log_file, --log_file_max_size, --logtostderr, --skip_headers, --skip_log_headers, --stderrthreshold, --log-flush-frequency.\nNon-default choices are currently alpha and subject to change without warning.`) + fs.StringVar(&c.Logging.Format, "logging-format", c.Logging.Format, "Sets the log format. Permitted formats: \"text\", \"json\". \nNon-default formats don't honor these flags: --add-dir-header, --alsologtostderr, --log-backtrace-at, --log-dir, --log-file, --log-file-max-size, --logtostderr, --skip-headers, --skip-log-headers, --stderrthreshold, --log-flush-frequency. \nNon-default choices are currently alpha and subject to change without warning.") fs.BoolVar(&c.Logging.Sanitization, "experimental-logging-sanitization", c.Logging.Sanitization, `[Experimental] When enabled prevents logging of fields tagged as sensitive (passwords, keys, tokens). Runtime log sanitization may introduce significant computation overhead and therefore should not be enabled in production.`) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go index af9f708dc525..dc5125295c87 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go @@ -18,11 +18,6 @@ package app // This file exists to force the desired plugin implementations to be linked. import ( - // Credential providers - _ "k8s.io/kubernetes/pkg/credentialprovider/aws" - _ "k8s.io/kubernetes/pkg/credentialprovider/azure" - _ "k8s.io/kubernetes/pkg/credentialprovider/gcp" - "k8s.io/component-base/featuregate" "k8s.io/utils/exec" diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins_providers.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins_providers.go index bd71645de230..7261cd13b6a8 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins_providers.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins_providers.go @@ -19,6 +19,11 @@ limitations under the License. package app import ( + // Credential providers + _ "k8s.io/kubernetes/pkg/credentialprovider/aws" + _ "k8s.io/kubernetes/pkg/credentialprovider/azure" + _ "k8s.io/kubernetes/pkg/credentialprovider/gcp" + "k8s.io/component-base/featuregate" "k8s.io/csi-translation-lib/plugins" "k8s.io/klog/v2" @@ -43,16 +48,16 @@ func appendPluginBasedOnFeatureFlags(plugins []volume.VolumePlugin, inTreePlugin migrationComplete, err := csimigration.CheckMigrationFeatureFlags(featureGate, pluginInfo.pluginMigrationFeature, pluginInfo.pluginMigrationCompleteFeature, pluginInfo.pluginUnregisterFeature) if err != nil { - klog.Warningf("Unexpected CSI Migration Feature Flags combination detected: %v. CSI Migration may not take effect", err) + klog.InfoS("Unexpected CSI Migration Feature Flags combination detected, CSI Migration may not take effect", "err", err) // TODO: fail and return here once alpha only tests can set the feature flags for a plugin correctly } // TODO: This can be removed after feature flag CSIMigrationvSphereComplete is removed. if migrationComplete { - klog.Infof("Skip registration of plugin %s since migration is complete", inTreePluginName) + klog.InfoS("Skipped registration of plugin since migration is completed", "pluginName", inTreePluginName) return plugins, nil } if featureGate.Enabled(pluginInfo.pluginUnregisterFeature) { - klog.Infof("Skip registration of plugin %s since feature flag %v is enabled", inTreePluginName, pluginInfo.pluginUnregisterFeature) + klog.InfoS("Skipped registration of plugin since feature flag is enabled", "pluginName", inTreePluginName, "featureFlag", pluginInfo.pluginUnregisterFeature) return plugins, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go index 97bb522734d8..60f9f4a02752 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ import ( "k8s.io/klog/v2" "k8s.io/mount-utils" + cadvisorapi "github.com/google/cadvisor/info/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -82,6 +83,7 @@ import ( kubeletcertificate "k8s.io/kubernetes/pkg/kubelet/certificate" "k8s.io/kubernetes/pkg/kubelet/certificate/bootstrap" "k8s.io/kubernetes/pkg/kubelet/cm" + "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology" "k8s.io/kubernetes/pkg/kubelet/cm/cpuset" "k8s.io/kubernetes/pkg/kubelet/config" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" @@ -117,7 +119,8 @@ func NewKubeletCommand() *cobra.Command { kubeletConfig, err := options.NewKubeletConfiguration() // programmer error if err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to create a new kubelet configuration") + os.Exit(1) } cmd := &cobra.Command{ @@ -152,21 +155,24 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API Run: func(cmd *cobra.Command, args []string) { // initial flag parse, since we disable cobra's flag parsing if err := cleanFlagSet.Parse(args); err != nil { + klog.ErrorS(err, "Failed to parse kubelet flag") cmd.Usage() - klog.Fatal(err) + os.Exit(1) } // check if there are non-flag arguments in the command line cmds := cleanFlagSet.Args() if len(cmds) > 0 { + klog.ErrorS(nil, "Unknown command", "command", cmds[0]) cmd.Usage() - klog.Fatalf("unknown command: %s", cmds[0]) + os.Exit(1) } // short-circuit on help help, err := cleanFlagSet.GetBool("help") if err != nil { - klog.Fatal(`"help" flag is non-bool, programmer error, please correct`) + klog.InfoS(`"help" flag is non-bool, programmer error, please correct`) + os.Exit(1) } if help { cmd.Help() @@ -179,44 +185,50 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API // set feature gates from initial flags-based config if err := utilfeature.DefaultMutableFeatureGate.SetFromMap(kubeletConfig.FeatureGates); err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to set feature gates from initial flags-based config") + os.Exit(1) } // validate the initial KubeletFlags if err := options.ValidateKubeletFlags(kubeletFlags); err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to validate kubelet flags") + os.Exit(1) } if kubeletFlags.ContainerRuntime == "remote" && cleanFlagSet.Changed("pod-infra-container-image") { - klog.Warning("Warning: For remote container runtime, --pod-infra-container-image is ignored in kubelet, which should be set in that remote runtime instead") + klog.InfoS("Warning: For remote container runtime, --pod-infra-container-image is ignored in kubelet, which should be set in that remote runtime instead") } // load kubelet config file, if provided if configFile := kubeletFlags.KubeletConfigFile; len(configFile) > 0 { kubeletConfig, err = loadConfigFile(configFile) if err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to load kubelet config file", "path", configFile) + os.Exit(1) } // We must enforce flag precedence by re-parsing the command line into the new object. // This is necessary to preserve backwards-compatibility across binary upgrades. // See issue #56171 for more details. if err := kubeletConfigFlagPrecedence(kubeletConfig, args); err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to precedence kubeletConfigFlag") + os.Exit(1) } // update feature gates based on new config if err := utilfeature.DefaultMutableFeatureGate.SetFromMap(kubeletConfig.FeatureGates); err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to set feature gates from initial flags-based config") + os.Exit(1) } } // We always validate the local configuration (command line + config file). // This is the default "last-known-good" config for dynamic config, and must always remain valid. if err := kubeletconfigvalidation.ValidateKubeletConfiguration(kubeletConfig); err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to validate kubelet configuration", "path", kubeletConfig) + os.Exit(1) } - if (kubeletConfig.KubeletCgroups != "" && kubeletConfig.KubeReservedCgroup != "") && (0 != strings.Index(kubeletConfig.KubeletCgroups, kubeletConfig.KubeReservedCgroup)) { - klog.Warning("unsupported configuration:KubeletCgroups is not within KubeReservedCgroup") + if (kubeletConfig.KubeletCgroups != "" && kubeletConfig.KubeReservedCgroup != "") && (strings.Index(kubeletConfig.KubeletCgroups, kubeletConfig.KubeReservedCgroup) != 0) { + klog.InfoS("unsupported configuration:KubeletCgroups is not within KubeReservedCgroup") } // use dynamic kubelet config, if enabled @@ -232,7 +244,8 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API return kubeletConfigFlagPrecedence(kc, args) }) if err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to bootstrap a configuration controller", "dynamicConfigDir", dynamicConfigDir) + os.Exit(1) } // If we should just use our existing, local config, the controller will return a nil config if dynamicKubeletConfig != nil { @@ -240,7 +253,8 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API // Note: flag precedence was already enforced in the controller, prior to validation, // by our above transform function. Now we simply update feature gates from the new config. if err := utilfeature.DefaultMutableFeatureGate.SetFromMap(kubeletConfig.FeatureGates); err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to set feature gates from initial flags-based config") + os.Exit(1) } } } @@ -254,12 +268,16 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API // use kubeletServer to construct the default KubeletDeps kubeletDeps, err := UnsecuredDependencies(kubeletServer, utilfeature.DefaultFeatureGate) if err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to construct kubelet dependencies") + os.Exit(1) } // add the kubelet config controller to kubeletDeps kubeletDeps.KubeletConfigController = kubeletConfigController + if err := checkPermissions(); err != nil { + klog.ErrorS(err, "kubelet running with insufficient permissions") + } // set up signal context here in order to be reused by kubelet and docker shim ctx := genericapiserver.SetupSignalContext() @@ -269,11 +287,12 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API config.StaticPodURLHeader[k] = []string{""} } // log the kubelet's config for inspection - klog.V(5).Infof("KubeletConfiguration: %#v", config) + klog.V(5).InfoS("KubeletConfiguration", "configuration", kubeletServer.KubeletConfiguration) // run the kubelet if err := Run(ctx, kubeletServer, kubeletDeps, utilfeature.DefaultFeatureGate); err != nil { - klog.Fatal(err) + klog.ErrorS(err, "Failed to run kubelet") + os.Exit(1) } }, } @@ -420,7 +439,7 @@ func Run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend logOption.LogSanitization = s.Logging.Sanitization logOption.Apply() // To help debugging, immediately log version - klog.Infof("Version: %+v", version.Get()) + klog.InfoS("Kubelet version", "kubeletVersion", version.Get()) if err := initForOS(s.KubeletFlags.WindowsService, s.KubeletFlags.WindowsPriorityClass); err != nil { return fmt.Errorf("failed OS init: %v", err) } @@ -430,15 +449,6 @@ func Run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend return nil } -func checkPermissions() error { - if uid := os.Getuid(); uid != 0 { - return fmt.Errorf("kubelet needs to run as uid `0`. It is being run as %d", uid) - } - // TODO: Check if kubelet is running in the `initial` user namespace. - // http://man7.org/linux/man-pages/man7/user_namespaces.7.html - return nil -} - func setConfigz(cz *configz.Config, kc *kubeletconfiginternal.KubeletConfiguration) error { scheme, _, err := kubeletscheme.NewSchemeAndCodecs() if err != nil { @@ -455,11 +465,11 @@ func setConfigz(cz *configz.Config, kc *kubeletconfiginternal.KubeletConfigurati func initConfigz(kc *kubeletconfiginternal.KubeletConfiguration) error { cz, err := configz.New("kubeletconfig") if err != nil { - klog.Errorf("unable to register configz: %s", err) + klog.ErrorS(err, "Failed to register configz") return err } if err := setConfigz(cz, kc); err != nil { - klog.Errorf("unable to register config: %s", err) + klog.ErrorS(err, "Failed to register config") return err } return nil @@ -474,11 +484,33 @@ func makeEventRecorder(kubeDeps *kubelet.Dependencies, nodeName types.NodeName) kubeDeps.Recorder = eventBroadcaster.NewRecorder(legacyscheme.Scheme, v1.EventSource{Component: componentKubelet, Host: string(nodeName)}) eventBroadcaster.StartStructuredLogging(3) if kubeDeps.EventClient != nil { - klog.V(4).Infof("Sending events to api server.") + klog.V(4).InfoS("Sending events to api server") eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: kubeDeps.EventClient.Events("")}) } else { - klog.Warning("No api server defined - no events will be sent to API server.") + klog.InfoS("No api server defined - no events will be sent to API server") + } +} + +func getReservedCPUs(machineInfo *cadvisorapi.MachineInfo, cpus string) (cpuset.CPUSet, error) { + emptyCPUSet := cpuset.NewCPUSet() + + if cpus == "" { + return emptyCPUSet, nil + } + + topo, err := topology.Discover(machineInfo) + if err != nil { + return emptyCPUSet, fmt.Errorf("Unable to discover CPU topology info: %s", err) + } + reservedCPUSet, err := cpuset.Parse(cpus) + if err != nil { + return emptyCPUSet, fmt.Errorf("Unable to parse reserved-cpus list: %s", err) } + allCPUSet := topo.CPUDetails.CPUs() + if !reservedCPUSet.IsSubsetOf(allCPUSet) { + return emptyCPUSet, fmt.Errorf("reserved-cpus: %s is not a subset of online-cpus: %s", cpus, allCPUSet.String()) + } + return reservedCPUSet, nil } func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Dependencies, featureGate featuregate.FeatureGate) (err error) { @@ -498,12 +530,12 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend } done := make(chan struct{}) if s.LockFilePath != "" { - klog.Infof("acquiring file lock on %q", s.LockFilePath) + klog.InfoS("Acquiring file lock", "path", s.LockFilePath) if err := flock.Acquire(s.LockFilePath); err != nil { return fmt.Errorf("unable to acquire file lock on %q: %v", s.LockFilePath, err) } if s.ExitOnLockContention { - klog.Infof("watching for inotify events for: %v", s.LockFilePath) + klog.InfoS("Watching for inotify events", "path", s.LockFilePath) if err := watchForLockfileContention(s.LockFilePath, done); err != nil { return err } @@ -513,7 +545,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend // Register current configuration with /configz endpoint err = initConfigz(&s.KubeletConfiguration) if err != nil { - klog.Errorf("unable to register KubeletConfiguration with configz, error: %v", err) + klog.ErrorS(err, "Failed to register kubelet configuration with configz") } if len(s.ShowHiddenMetricsForVersion) > 0 { @@ -541,7 +573,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend return err } if cloud != nil { - klog.V(2).Infof("Successfully initialized cloud provider: %q from the config file: %q\n", s.CloudProvider, s.CloudConfigFile) + klog.V(2).InfoS("Successfully initialized cloud provider", "cloudProvider", s.CloudProvider, "cloudConfigFile", s.CloudConfigFile) } kubeDeps.Cloud = cloud } @@ -562,7 +594,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend kubeDeps.KubeClient = nil kubeDeps.EventClient = nil kubeDeps.HeartbeatClient = nil - klog.Warningf("standalone mode, no API client") + klog.InfoS("Standalone mode, no API client") case kubeDeps.KubeClient == nil, kubeDeps.EventClient == nil, kubeDeps.HeartbeatClient == nil: clientConfig, closeAllConns, err := buildKubeletClientConfig(ctx, s, nodeName) @@ -618,14 +650,14 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend cgroupRoots = append(cgroupRoots, nodeAllocatableRoot) kubeletCgroup, err := cm.GetKubeletContainer(s.KubeletCgroups) if err != nil { - klog.Warningf("failed to get the kubelet's cgroup: %v. Kubelet system container metrics may be missing.", err) + klog.InfoS("Failed to get the kubelet's cgroup. Kubelet system container metrics may be missing.", "err", err) } else if kubeletCgroup != "" { cgroupRoots = append(cgroupRoots, kubeletCgroup) } runtimeCgroup, err := cm.GetRuntimeContainer(s.ContainerRuntime, s.RuntimeCgroups) if err != nil { - klog.Warningf("failed to get the container runtime's cgroup: %v. Runtime system container metrics may be missing.", err) + klog.InfoS("Failed to get the container runtime's cgroup. Runtime system container metrics may be missing.", "err", err) } else if runtimeCgroup != "" { // RuntimeCgroups is optional, so ignore if it isn't specified cgroupRoots = append(cgroupRoots, runtimeCgroup) @@ -649,42 +681,21 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend if kubeDeps.ContainerManager == nil { if s.CgroupsPerQOS && s.CgroupRoot == "" { - klog.Info("--cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /") + klog.InfoS("--cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /") s.CgroupRoot = "/" } - var reservedSystemCPUs cpuset.CPUSet - if s.ReservedSystemCPUs != "" { - // is it safe do use CAdvisor here ?? - machineInfo, err := kubeDeps.CAdvisorInterface.MachineInfo() - if err != nil { - // if can't use CAdvisor here, fall back to non-explicit cpu list behavor - klog.Warning("Failed to get MachineInfo, set reservedSystemCPUs to empty") - reservedSystemCPUs = cpuset.NewCPUSet() - } else { - var errParse error - reservedSystemCPUs, errParse = cpuset.Parse(s.ReservedSystemCPUs) - if errParse != nil { - // invalid cpu list is provided, set reservedSystemCPUs to empty, so it won't overwrite kubeReserved/systemReserved - klog.Infof("Invalid ReservedSystemCPUs \"%s\"", s.ReservedSystemCPUs) - return errParse - } - reservedList := reservedSystemCPUs.ToSlice() - first := reservedList[0] - last := reservedList[len(reservedList)-1] - if first < 0 || last >= machineInfo.NumCores { - // the specified cpuset is outside of the range of what the machine has - klog.Infof("Invalid cpuset specified by --reserved-cpus") - return fmt.Errorf("Invalid cpuset %q specified by --reserved-cpus", s.ReservedSystemCPUs) - } - } - } else { - reservedSystemCPUs = cpuset.NewCPUSet() + machineInfo, err := kubeDeps.CAdvisorInterface.MachineInfo() + if err != nil { + return err + } + reservedSystemCPUs, err := getReservedCPUs(machineInfo, s.ReservedSystemCPUs) + if err != nil { + return err } - if reservedSystemCPUs.Size() > 0 { - // at cmd option valication phase it is tested either --system-reserved-cgroup or --kube-reserved-cgroup is specified, so overwrite should be ok - klog.Infof("Option --reserved-cpus is specified, it will overwrite the cpu setting in KubeReserved=\"%v\", SystemReserved=\"%v\".", s.KubeReserved, s.SystemReserved) + // at cmd option validation phase it is tested either --system-reserved-cgroup or --kube-reserved-cgroup is specified, so overwrite should be ok + klog.InfoS("Option --reserved-cpus is specified, it will overwrite the cpu setting in KubeReserved and SystemReserved", "kubeReservedCPUs", s.KubeReserved, "systemReservedCPUs", s.SystemReserved) if s.KubeReserved != nil { delete(s.KubeReserved, "cpu") } @@ -692,7 +703,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend s.SystemReserved = make(map[string]string) } s.SystemReserved["cpu"] = strconv.Itoa(reservedSystemCPUs.Size()) - klog.Infof("After cpu setting is overwritten, KubeReserved=\"%v\", SystemReserved=\"%v\"", s.KubeReserved, s.SystemReserved) + klog.InfoS("After cpu setting is overwritten", "kubeReservedCPUs", s.KubeReserved, "systemReservedCPUs", s.SystemReserved) } kubeReserved, err := parseResourceList(s.KubeReserved) @@ -760,16 +771,12 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend } } - if err := checkPermissions(); err != nil { - klog.Error(err) - } - utilruntime.ReallyCrash = s.ReallyCrashForTesting // TODO(vmarmol): Do this through container config. oomAdjuster := kubeDeps.OOMAdjuster if err := oomAdjuster.ApplyOOMScoreAdj(0, int(s.OOMScoreAdj)); err != nil { - klog.Warning(err) + klog.InfoS("Failed to ApplyOOMScoreAdj", "err", err) } err = kubelet.PreInitRuntimeService(&s.KubeletConfiguration, @@ -801,7 +808,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend go wait.Until(func() { err := http.ListenAndServe(net.JoinHostPort(s.HealthzBindAddress, strconv.Itoa(int(s.HealthzPort))), mux) if err != nil { - klog.Errorf("Starting healthz server failed: %v", err) + klog.ErrorS(err, "Failed to start healthz server") } }, 5*time.Second, wait.NeverStop) } @@ -844,7 +851,7 @@ func buildKubeletClientConfig(ctx context.Context, s *options.KubeletServer, nod // which provides a high powered kubeconfig on the master with cert/key data, we must // bootstrap the cert manager with the contents of the initial client config. - klog.Infof("Client rotation is on, will bootstrap in background") + klog.InfoS("Client rotation is on, will bootstrap in background") certConfig, clientConfig, err := bootstrap.LoadClientConfig(s.KubeConfig, s.BootstrapKubeconfig, s.CertDirectory) if err != nil { return nil, nil, err @@ -888,7 +895,7 @@ func buildKubeletClientConfig(ctx context.Context, s *options.KubeletServer, nod return nil, nil, err } - klog.V(2).Info("Starting client certificate rotation.") + klog.V(2).InfoS("Starting client certificate rotation") clientCertificateManager.Start() return transportConfig, closeAllConns, nil @@ -982,7 +989,7 @@ func getNodeName(cloud cloudprovider.Interface, hostname string) (types.NodeName return "", fmt.Errorf("error fetching current node name from cloud provider: %v", err) } - klog.V(2).Infof("cloud provider determined current node name to be %s", nodeName) + klog.V(2).InfoS("Cloud provider determined current node", "nodeName", klog.KRef("", string(nodeName))) return nodeName, nil } @@ -1016,7 +1023,7 @@ func InitializeTLS(kf *options.KubeletFlags, kc *kubeletconfiginternal.KubeletCo return nil, err } - klog.V(4).Infof("Using self-signed cert (%s, %s)", kc.TLSCertFile, kc.TLSPrivateKeyFile) + klog.V(4).InfoS("Using self-signed cert", "TLSCertFile", kc.TLSCertFile, "TLSPrivateKeyFile", kc.TLSPrivateKeyFile) } } @@ -1030,7 +1037,7 @@ func InitializeTLS(kf *options.KubeletFlags, kc *kubeletconfiginternal.KubeletCo for i := 0; i < len(tlsCipherSuites); i++ { for cipherName, cipherID := range insecureCiphers { if tlsCipherSuites[i] == cipherID { - klog.Warningf("Use of insecure cipher '%s' detected.", cipherName) + klog.InfoS("Use of insecure cipher detected.", "cipher", cipherName) } } } @@ -1064,7 +1071,7 @@ func InitializeTLS(kf *options.KubeletFlags, kc *kubeletconfiginternal.KubeletCo return tlsOptions, nil } -// setContentTypeForClient sets the appropritae content type into the rest config +// setContentTypeForClient sets the appropriate content type into the rest config // and handles defaulting AcceptContentTypes based on that input. func setContentTypeForClient(cfg *restclient.Config, contentType string) { if len(contentType) == 0 { @@ -1103,7 +1110,7 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie for _, ip := range strings.Split(kubeServer.NodeIP, ",") { parsedNodeIP := net.ParseIP(strings.TrimSpace(ip)) if parsedNodeIP == nil { - klog.Warningf("Could not parse --node-ip value %q; ignoring", ip) + klog.InfoS("Could not parse --node-ip ignoring", "IP", ip) } else { nodeIPs = append(nodeIPs, parsedNodeIP) } @@ -1124,7 +1131,7 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie }) credentialprovider.SetPreferredDockercfgPath(kubeServer.RootDirectory) - klog.V(2).Infof("Using root directory: %v", kubeServer.RootDirectory) + klog.V(2).InfoS("Using root directory", "path", kubeServer.RootDirectory) if kubeDeps.OSInterface == nil { kubeDeps.OSInterface = kubecontainer.RealOS{} @@ -1172,7 +1179,7 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie podCfg := kubeDeps.PodConfig if err := rlimit.SetNumFiles(uint64(kubeServer.MaxOpenFiles)); err != nil { - klog.Errorf("Failed to set rlimit on max file handles: %v", err) + klog.ErrorS(err, "Failed to set rlimit on max file handles") } // process pods and exit. @@ -1180,10 +1187,10 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie if _, err := k.RunOnce(podCfg.Updates()); err != nil { return fmt.Errorf("runonce failed: %v", err) } - klog.Info("Started kubelet as runonce") + klog.InfoS("Started kubelet as runonce") } else { startKubelet(k, podCfg, &kubeServer.KubeletConfiguration, kubeDeps, kubeServer.EnableServer) - klog.Info("Started kubelet") + klog.InfoS("Started kubelet") } return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_linux.go index f6cff9af261c..c22e24d5312f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_linux.go @@ -24,19 +24,19 @@ import ( func watchForLockfileContention(path string, done chan struct{}) error { watcher, err := inotify.NewWatcher() if err != nil { - klog.Errorf("unable to create watcher for lockfile: %v", err) + klog.ErrorS(err, "Unable to create watcher for lockfile") return err } if err = watcher.AddWatch(path, inotify.InOpen|inotify.InDeleteSelf); err != nil { - klog.Errorf("unable to watch lockfile: %v", err) + klog.ErrorS(err, "Unable to watch lockfile") return err } go func() { select { case ev := <-watcher.Event: - klog.Infof("inotify event: %v", ev) + klog.InfoS("inotify event", "event", ev) case err = <-watcher.Error: - klog.Errorf("inotify watcher error: %v", err) + klog.ErrorS(err, "inotify watcher error") } close(done) }() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_others.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_others.go new file mode 100644 index 000000000000..a6cced1a1a86 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_others.go @@ -0,0 +1,33 @@ +// +build !windows + +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package app + +import ( + "fmt" + "os" +) + +func checkPermissions() error { + if uid := os.Getuid(); uid != 0 { + return fmt.Errorf("kubelet needs to run as uid `0`. It is being run as %d", uid) + } + // TODO: Check if kubelet is running in the `initial` user namespace. + // http://man7.org/linux/man-pages/man7/user_namespaces.7.html + return nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_windows.go new file mode 100644 index 000000000000..cdb83e321f44 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_windows.go @@ -0,0 +1,85 @@ +// +build windows + +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package app + +import ( + "fmt" + "os/user" + + "golang.org/x/sys/windows" +) + +func isAdmin() (bool, error) { + // Get current user + u, err := user.Current() + if err != nil { + return false, fmt.Errorf("Error retrieving current user: %s", err) + } + // Get IDs of group user is a member of + ids, err := u.GroupIds() + if err != nil { + return false, fmt.Errorf("Error retrieving group ids: %s", err) + } + + // Check for existence of BUILTIN\ADMINISTRATORS group id + for i := range ids { + // BUILTIN\ADMINISTRATORS + if "S-1-5-32-544" == ids[i] { + return true, nil + } + } + return false, nil +} + +func checkPermissions() error { + //https://github.com/golang/go/issues/28804#issuecomment-505326268 + var sid *windows.SID + var userIsAdmin bool + + // https://docs.microsoft.com/en-us/windows/desktop/api/securitybaseapi/nf-securitybaseapi-checktokenmembership + err := windows.AllocateAndInitializeSid( + &windows.SECURITY_NT_AUTHORITY, + 2, + windows.SECURITY_BUILTIN_DOMAIN_RID, + windows.DOMAIN_ALIAS_RID_ADMINS, + 0, 0, 0, 0, 0, 0, + &sid) + if err != nil { + return fmt.Errorf("Error while checking for elevated permissions: %s", err) + } + + //We must free the sid to prevent security token leaks + defer windows.FreeSid(sid) + token := windows.Token(0) + + userIsAdmin, err = isAdmin() + if err != nil { + return fmt.Errorf("Error while checking admin group membership: %s", err) + } + + member, err := token.IsMember(sid) + if err != nil { + return fmt.Errorf("Error while checking for elevated permissions: %s", err) + } + if !member { + return fmt.Errorf("kubelet needs to run with administrator permissions. Run as admin is: %t, User in admin group: %t", member, userIsAdmin) + } + + return nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/util.go index 59f1a198e75b..dd6922ee3762 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/util.go @@ -551,6 +551,20 @@ func dropDisabledFields( }) } + if !utilfeature.DefaultFeatureGate.Enabled(features.ProbeTerminationGracePeriod) && !probeGracePeriodInUse(oldPodSpec) { + // Set pod-level terminationGracePeriodSeconds to nil if the feature is disabled and it is not used + VisitContainers(podSpec, AllContainers, func(c *api.Container, containerType ContainerType) bool { + if c.LivenessProbe != nil { + c.LivenessProbe.TerminationGracePeriodSeconds = nil + } + if c.StartupProbe != nil { + c.StartupProbe.TerminationGracePeriodSeconds = nil + } + // cannot be set for readiness probes + return true + }) + } + dropDisabledFSGroupFields(podSpec, oldPodSpec) if !utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) && !overheadInUse(oldPodSpec) { @@ -811,6 +825,27 @@ func subpathExprInUse(podSpec *api.PodSpec) bool { return inUse } +// probeGracePeriodInUse returns true if the pod spec is non-nil and has a probe that makes use +// of the probe-level terminationGracePeriodSeconds feature +func probeGracePeriodInUse(podSpec *api.PodSpec) bool { + if podSpec == nil { + return false + } + + var inUse bool + VisitContainers(podSpec, AllContainers, func(c *api.Container, containerType ContainerType) bool { + // cannot be set for readiness probes + if (c.LivenessProbe != nil && c.LivenessProbe.TerminationGracePeriodSeconds != nil) || + (c.StartupProbe != nil && c.StartupProbe.TerminationGracePeriodSeconds != nil) { + inUse = true + return false + } + return true + }) + + return inUse +} + // csiInUse returns true if any pod's spec include inline CSI volumes. func csiInUse(podSpec *api.PodSpec) bool { if podSpec == nil { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS index 031baa5e89f6..11c1b1a4fbb7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS @@ -12,7 +12,6 @@ reviewers: - ncdc - dims - errordeveloper -- mml - m1093782566 - kevin-wangzefeng labels: diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/validation/validation.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/validation/validation.go index 4699e85b98f2..ab68809bf0f8 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/validation/validation.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/validation/validation.go @@ -146,21 +146,15 @@ func ValidateStatefulSet(statefulSet *apps.StatefulSet, opts apivalidation.PodVa func ValidateStatefulSetUpdate(statefulSet, oldStatefulSet *apps.StatefulSet) field.ErrorList { allErrs := apivalidation.ValidateObjectMetaUpdate(&statefulSet.ObjectMeta, &oldStatefulSet.ObjectMeta, field.NewPath("metadata")) - restoreReplicas := statefulSet.Spec.Replicas - statefulSet.Spec.Replicas = oldStatefulSet.Spec.Replicas - - restoreTemplate := statefulSet.Spec.Template - statefulSet.Spec.Template = oldStatefulSet.Spec.Template - - restoreStrategy := statefulSet.Spec.UpdateStrategy - statefulSet.Spec.UpdateStrategy = oldStatefulSet.Spec.UpdateStrategy - - if !apiequality.Semantic.DeepEqual(statefulSet.Spec, oldStatefulSet.Spec) { + // statefulset updates aren't super common and general updates are likely to be touching spec, so we'll do this + // deep copy right away. This avoids mutating our inputs + newStatefulSetClone := statefulSet.DeepCopy() + newStatefulSetClone.Spec.Replicas = oldStatefulSet.Spec.Replicas // +k8s:verify-mutation:reason=clone + newStatefulSetClone.Spec.Template = oldStatefulSet.Spec.Template // +k8s:verify-mutation:reason=clone + newStatefulSetClone.Spec.UpdateStrategy = oldStatefulSet.Spec.UpdateStrategy // +k8s:verify-mutation:reason=clone + if !apiequality.Semantic.DeepEqual(newStatefulSetClone.Spec, oldStatefulSet.Spec) { allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden")) } - statefulSet.Spec.Replicas = restoreReplicas - statefulSet.Spec.Template = restoreTemplate - statefulSet.Spec.UpdateStrategy = restoreStrategy allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(statefulSet.Spec.Replicas), field.NewPath("spec", "replicas"))...) return allErrs diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/OWNERS index 9ba34848ccb2..16d87597188e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/OWNERS @@ -7,10 +7,8 @@ reviewers: - wojtek-t - deads2k - caesarxuchao -- erictune - sttts - ncdc - piosz - dims - errordeveloper -- mml diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/OWNERS index 7cacfce5f1ab..604da6c64a9e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/OWNERS @@ -7,13 +7,11 @@ reviewers: - wojtek-t - deads2k - caesarxuchao -- erictune - sttts - saad-ali - ncdc - soltysh - dims - errordeveloper -- mml labels: - sig/apps diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go index 19357eaec880..29a49f9e0d3e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go @@ -178,7 +178,7 @@ type JobSpec struct { // // `Indexed` means that the Pods of a // Job get an associated completion index from 0 to (.spec.completions - 1), - // available in the annotation batch.alpha.kubernetes.io/job-completion-index. + // available in the annotation batch.kubernetes.io/job-completion-index. // The Job is considered complete when there is one successfully completed Pod // for each index. // When value is `Indexed`, .spec.completions must be specified and @@ -189,7 +189,7 @@ type JobSpec struct { // If the Job controller observes a mode that it doesn't recognize, the // controller skips updates for the Job. // +optional - CompletionMode CompletionMode + CompletionMode *CompletionMode // Suspend specifies whether the Job controller should create Pods or not. If // a Job is created with suspend set to true, no Pods are created by the Job diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/zz_generated.deepcopy.go index b1e1f8e814c9..4c414b2f6119 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/zz_generated.deepcopy.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/zz_generated.deepcopy.go @@ -271,6 +271,11 @@ func (in *JobSpec) DeepCopyInto(out *JobSpec) { *out = new(int32) **out = **in } + if in.CompletionMode != nil { + in, out := &in.CompletionMode, &out.CompletionMode + *out = new(CompletionMode) + **out = **in + } if in.Suspend != nil { in, out := &in.Suspend, &out.Suspend *out = new(bool) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS index 588a436a5f8c..017e72e5d177 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS @@ -1,7 +1,6 @@ # See the OWNERS docs at https://go.k8s.io/owners approvers: -- erictune - lavalamp - smarterclayton - thockin @@ -19,7 +18,6 @@ reviewers: - vishh - mikedanese - liggitt -- erictune - davidopp - pmorie - sttts diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/annotation_key_constants.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/annotation_key_constants.go index f7194fb2168d..b492e5584538 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/annotation_key_constants.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/annotation_key_constants.go @@ -101,6 +101,14 @@ const ( // https://github.com/kubernetes/community/blob/master/sig-scalability/slos/network_programming_latency.md EndpointsLastChangeTriggerTime = "endpoints.kubernetes.io/last-change-trigger-time" + // EndpointsOverCapacity will be set on an Endpoints resource when it + // exceeds the maximum capacity of 1000 addresses. Inititially the Endpoints + // controller will set this annotation with a value of "warning". In a + // future release, the controller may set this annotation with a value of + // "truncated" to indicate that any addresses exceeding the limit of 1000 + // have been truncated from the Endpoints resource. + EndpointsOverCapacity = "endpoints.kubernetes.io/over-capacity" + // MigratedPluginsAnnotationKey is the annotation key, set for CSINode objects, that is a comma-separated // list of in-tree plugins that will be serviced by the CSI backend on the Node represented by CSINode. // This annotation is used by the Attach Detach Controller to determine whether to use the in-tree or @@ -114,6 +122,11 @@ const ( // pod deletion order. // The implicit deletion cost for pods that don't set the annotation is 0, negative values are permitted. // - // This annotation is alpha-level and is only honored when PodDeletionCost feature is enabled. + // This annotation is beta-level and is only honored when PodDeletionCost feature is enabled. PodDeletionCost = "controller.kubernetes.io/pod-deletion-cost" + + // AnnotationTopologyAwareHints can be used to enable or disable Topology + // Aware Hints for a Service. This may be set to "Auto" or "Disabled". Any + // other value is treated as "Disabled". + AnnotationTopologyAwareHints = "service.kubernetes.io/topology-aware-hints" ) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/register.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/register.go index 36856ef6cc7b..882f31795a2b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/register.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/register.go @@ -96,7 +96,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &RangeAllocation{}, &ConfigMap{}, &ConfigMapList{}, - &EphemeralContainers{}, ) return nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/types.go index e40d798b8fbe..c75b011863e1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/types.go @@ -157,7 +157,7 @@ type VolumeSource struct { // CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). // +optional CSI *CSIVolumeSource - // Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). + // Ephemeral represents a volume that is handled by a cluster storage driver. // The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, // and deleted when the pod is removed. // @@ -182,6 +182,9 @@ type VolumeSource struct { // A pod can use both types of ephemeral volumes and // persistent volumes at the same time. // + // This is a beta feature and only available when the GenericEphemeralVolume + // feature gate is enabled. + // // +optional Ephemeral *EphemeralVolumeSource } @@ -1717,11 +1720,6 @@ type EphemeralVolumeSource struct { // // Required, must not be nil. VolumeClaimTemplate *PersistentVolumeClaimTemplate - - // ReadOnly specifies a read-only configuration for the volume. - // Defaults to false (read/write). - // +optional - ReadOnly bool } // PersistentVolumeClaimTemplate is used to produce @@ -2022,6 +2020,17 @@ type Probe struct { // Minimum consecutive failures for the probe to be considered failed after having succeeded. // +optional FailureThreshold int32 + // Optional duration in seconds the pod needs to terminate gracefully upon probe failure. + // The grace period is the duration in seconds after the processes running in the pod are sent + // a termination signal and the time when the processes are forcibly halted with a kill signal. + // Set this value longer than the expected cleanup time for your process. + // If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this + // value overrides the value provided by the pod spec. + // Value must be non-negative integer. The value zero indicates stop immediately via + // the kill signal (no opportunity to shut down). + // This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. + // +optional + TerminationGracePeriodSeconds *int64 } // PullPolicy describes a policy for if/when to pull a container image @@ -2295,6 +2304,7 @@ const ( PodFailed PodPhase = "Failed" // PodUnknown means that for some reason the state of the pod could not be obtained, typically due // to an error in communicating with the host of the pod. + // Deprecated in v1.21: It isn't being set since 2015 (74da3b14b0c0f658b3bb8d2def5094686d0e9095) PodUnknown PodPhase = "Unknown" ) @@ -2721,7 +2731,8 @@ type PodSpec struct { // +optional RestartPolicy RestartPolicy // Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. - // Value must be non-negative integer. The value zero indicates delete immediately. + // Value must be non-negative integer. The value zero indicates stop immediately via the kill + // signal (no opportunity to shut down). // If this value is nil, the default grace period will be used instead. // The grace period is the duration in seconds after the processes running in the pod are sent // a termination signal and the time when the processes are forcibly halted with a kill signal. @@ -2838,8 +2849,8 @@ type PodSpec struct { // The RuntimeClass admission controller will reject Pod create requests which have the overhead already // set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value // defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. - // More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature. + // More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md + // This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature. // +optional Overhead ResourceList // EnableServiceLinks indicates whether information about services should be injected into pod's @@ -4429,20 +4440,6 @@ type Binding struct { Target ObjectReference } -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// EphemeralContainers is a list of ephemeral containers used with the Pod ephemeralcontainers subresource. -type EphemeralContainers struct { - metav1.TypeMeta - // +optional - metav1.ObjectMeta - - // A list of ephemeral containers associated with this pod. New ephemeral containers - // may be appended to this list, but existing ephemeral containers may not be removed - // or modified. - EphemeralContainers []EphemeralContainer -} - // Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. type Preconditions struct { // Specifies the target UID. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/OWNERS index 9f10db4dddd1..6d9196b8c414 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/OWNERS @@ -13,7 +13,6 @@ reviewers: - vishh - mikedanese - liggitt -- erictune - davidopp - pmorie - sttts diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go index 9cceb8cd0eff..3fe7ced32be1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go @@ -531,16 +531,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1.EphemeralContainers)(nil), (*core.EphemeralContainers)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_EphemeralContainers_To_core_EphemeralContainers(a.(*v1.EphemeralContainers), b.(*core.EphemeralContainers), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EphemeralContainers)(nil), (*v1.EphemeralContainers)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_core_EphemeralContainers_To_v1_EphemeralContainers(a.(*core.EphemeralContainers), b.(*v1.EphemeralContainers), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*v1.EphemeralVolumeSource)(nil), (*core.EphemeralVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_EphemeralVolumeSource_To_core_EphemeralVolumeSource(a.(*v1.EphemeralVolumeSource), b.(*core.EphemeralVolumeSource), scope) }); err != nil { @@ -3522,31 +3512,8 @@ func Convert_core_EphemeralContainerCommon_To_v1_EphemeralContainerCommon(in *co return autoConvert_core_EphemeralContainerCommon_To_v1_EphemeralContainerCommon(in, out, s) } -func autoConvert_v1_EphemeralContainers_To_core_EphemeralContainers(in *v1.EphemeralContainers, out *core.EphemeralContainers, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.EphemeralContainers = *(*[]core.EphemeralContainer)(unsafe.Pointer(&in.EphemeralContainers)) - return nil -} - -// Convert_v1_EphemeralContainers_To_core_EphemeralContainers is an autogenerated conversion function. -func Convert_v1_EphemeralContainers_To_core_EphemeralContainers(in *v1.EphemeralContainers, out *core.EphemeralContainers, s conversion.Scope) error { - return autoConvert_v1_EphemeralContainers_To_core_EphemeralContainers(in, out, s) -} - -func autoConvert_core_EphemeralContainers_To_v1_EphemeralContainers(in *core.EphemeralContainers, out *v1.EphemeralContainers, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.EphemeralContainers = *(*[]v1.EphemeralContainer)(unsafe.Pointer(&in.EphemeralContainers)) - return nil -} - -// Convert_core_EphemeralContainers_To_v1_EphemeralContainers is an autogenerated conversion function. -func Convert_core_EphemeralContainers_To_v1_EphemeralContainers(in *core.EphemeralContainers, out *v1.EphemeralContainers, s conversion.Scope) error { - return autoConvert_core_EphemeralContainers_To_v1_EphemeralContainers(in, out, s) -} - func autoConvert_v1_EphemeralVolumeSource_To_core_EphemeralVolumeSource(in *v1.EphemeralVolumeSource, out *core.EphemeralVolumeSource, s conversion.Scope) error { out.VolumeClaimTemplate = (*core.PersistentVolumeClaimTemplate)(unsafe.Pointer(in.VolumeClaimTemplate)) - out.ReadOnly = in.ReadOnly return nil } @@ -3557,7 +3524,6 @@ func Convert_v1_EphemeralVolumeSource_To_core_EphemeralVolumeSource(in *v1.Ephem func autoConvert_core_EphemeralVolumeSource_To_v1_EphemeralVolumeSource(in *core.EphemeralVolumeSource, out *v1.EphemeralVolumeSource, s conversion.Scope) error { out.VolumeClaimTemplate = (*v1.PersistentVolumeClaimTemplate)(unsafe.Pointer(in.VolumeClaimTemplate)) - out.ReadOnly = in.ReadOnly return nil } @@ -6469,6 +6435,7 @@ func autoConvert_v1_Probe_To_core_Probe(in *v1.Probe, out *core.Probe, s convers out.PeriodSeconds = in.PeriodSeconds out.SuccessThreshold = in.SuccessThreshold out.FailureThreshold = in.FailureThreshold + out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) return nil } @@ -6486,6 +6453,7 @@ func autoConvert_core_Probe_To_v1_Probe(in *core.Probe, out *v1.Probe, s convers out.PeriodSeconds = in.PeriodSeconds out.SuccessThreshold = in.SuccessThreshold out.FailureThreshold = in.FailureThreshold + out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.defaults.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.defaults.go index 68e2a32aacc7..d256ba8d36f3 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.defaults.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.defaults.go @@ -33,7 +33,6 @@ func RegisterDefaults(scheme *runtime.Scheme) error { scheme.AddTypeDefaultingFunc(&v1.ConfigMapList{}, func(obj interface{}) { SetObjectDefaults_ConfigMapList(obj.(*v1.ConfigMapList)) }) scheme.AddTypeDefaultingFunc(&v1.Endpoints{}, func(obj interface{}) { SetObjectDefaults_Endpoints(obj.(*v1.Endpoints)) }) scheme.AddTypeDefaultingFunc(&v1.EndpointsList{}, func(obj interface{}) { SetObjectDefaults_EndpointsList(obj.(*v1.EndpointsList)) }) - scheme.AddTypeDefaultingFunc(&v1.EphemeralContainers{}, func(obj interface{}) { SetObjectDefaults_EphemeralContainers(obj.(*v1.EphemeralContainers)) }) scheme.AddTypeDefaultingFunc(&v1.LimitRange{}, func(obj interface{}) { SetObjectDefaults_LimitRange(obj.(*v1.LimitRange)) }) scheme.AddTypeDefaultingFunc(&v1.LimitRangeList{}, func(obj interface{}) { SetObjectDefaults_LimitRangeList(obj.(*v1.LimitRangeList)) }) scheme.AddTypeDefaultingFunc(&v1.Namespace{}, func(obj interface{}) { SetObjectDefaults_Namespace(obj.(*v1.Namespace)) }) @@ -85,59 +84,6 @@ func SetObjectDefaults_EndpointsList(in *v1.EndpointsList) { } } -func SetObjectDefaults_EphemeralContainers(in *v1.EphemeralContainers) { - for i := range in.EphemeralContainers { - a := &in.EphemeralContainers[i] - SetDefaults_EphemeralContainer(a) - for j := range a.EphemeralContainerCommon.Ports { - b := &a.EphemeralContainerCommon.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - for j := range a.EphemeralContainerCommon.Env { - b := &a.EphemeralContainerCommon.Env[j] - if b.ValueFrom != nil { - if b.ValueFrom.FieldRef != nil { - SetDefaults_ObjectFieldSelector(b.ValueFrom.FieldRef) - } - } - } - SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Limits) - SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests) - if a.EphemeralContainerCommon.LivenessProbe != nil { - SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe) - if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil { - SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet) - } - } - if a.EphemeralContainerCommon.ReadinessProbe != nil { - SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe) - if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil { - SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet) - } - } - if a.EphemeralContainerCommon.StartupProbe != nil { - SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe) - if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil { - SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet) - } - } - if a.EphemeralContainerCommon.Lifecycle != nil { - if a.EphemeralContainerCommon.Lifecycle.PostStart != nil { - if a.EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet != nil { - SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet) - } - } - if a.EphemeralContainerCommon.Lifecycle.PreStop != nil { - if a.EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet != nil { - SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet) - } - } - } - } -} - func SetObjectDefaults_LimitRange(in *v1.LimitRange) { for i := range in.Spec.Limits { a := &in.Spec.Limits[i] diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/OWNERS index c3b5996db8a9..795b37f477cf 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/OWNERS @@ -13,7 +13,6 @@ reviewers: - vishh - mikedanese - liggitt -- erictune - davidopp - pmorie - sttts diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go index 1b668083b3b3..d9ebd9f93994 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go @@ -29,15 +29,12 @@ import ( "unicode" "unicode/utf8" - "k8s.io/klog/v2" - v1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/resource" apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" - v1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/diff" "k8s.io/apimachinery/pkg/util/intstr" @@ -285,7 +282,7 @@ var ValidateClusterName = apimachineryvalidation.ValidateClusterName // (where it should be) and this file. var ValidateClassName = apimachineryvalidation.NameIsDNSSubdomain -// ValidatePiorityClassName can be used to check whether the given priority +// ValidatePriorityClassName can be used to check whether the given priority // class name is valid. var ValidatePriorityClassName = apimachineryvalidation.NameIsDNSSubdomain @@ -1626,7 +1623,7 @@ func ValidatePersistentVolumeClaimTemplate(claimTemplate *core.PersistentVolumeC func validatePersistentVolumeClaimTemplateObjectMeta(objMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList { allErrs := apimachineryvalidation.ValidateAnnotations(objMeta.Annotations, fldPath.Child("annotations")) - allErrs = append(allErrs, v1validation.ValidateLabels(objMeta.Labels, fldPath.Child("labels"))...) + allErrs = append(allErrs, unversionedvalidation.ValidateLabels(objMeta.Labels, fldPath.Child("labels"))...) // All other fields are not supported and thus must not be set // to avoid confusion. We could reject individual fields, // but then adding a new one to ObjectMeta wouldn't be checked @@ -1960,13 +1957,11 @@ func ValidatePersistentVolumeUpdate(newPv, oldPv *core.PersistentVolume) field.E } // ValidatePersistentVolumeStatusUpdate tests to see if the status update is legal for an end user to make. -// newPv is updated with fields that cannot be changed. func ValidatePersistentVolumeStatusUpdate(newPv, oldPv *core.PersistentVolume) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newPv.ObjectMeta, &oldPv.ObjectMeta, field.NewPath("metadata")) if len(newPv.ResourceVersion) == 0 { allErrs = append(allErrs, field.Required(field.NewPath("resourceVersion"), "")) } - newPv.Spec = oldPv.Spec return allErrs } @@ -2039,7 +2034,7 @@ func ValidatePersistentVolumeClaimUpdate(newPvc, oldPvc *core.PersistentVolumeCl // Claims are immutable in order to enforce quota, range limits, etc. without gaming the system. if len(oldPvc.Spec.VolumeName) == 0 { // volumeName changes are allowed once. - oldPvcClone.Spec.VolumeName = newPvcClone.Spec.VolumeName + oldPvcClone.Spec.VolumeName = newPvcClone.Spec.VolumeName // +k8s:verify-mutation:reason=clone } if validateStorageClassUpgrade(oldPvcClone.Annotations, newPvcClone.Annotations, @@ -2055,7 +2050,7 @@ func ValidatePersistentVolumeClaimUpdate(newPvc, oldPvc *core.PersistentVolumeCl if utilfeature.DefaultFeatureGate.Enabled(features.ExpandPersistentVolumes) { // lets make sure storage values are same. if newPvc.Status.Phase == core.ClaimBound && newPvcClone.Spec.Resources.Requests != nil { - newPvcClone.Spec.Resources.Requests["storage"] = oldPvc.Spec.Resources.Requests["storage"] + newPvcClone.Spec.Resources.Requests["storage"] = oldPvc.Spec.Resources.Requests["storage"] // +k8s:verify-mutation:reason=clone } oldSize := oldPvc.Spec.Resources.Requests["storage"] @@ -2112,7 +2107,6 @@ func ValidatePersistentVolumeClaimStatusUpdate(newPvc, oldPvc *core.PersistentVo for r, qty := range newPvc.Status.Capacity { allErrs = append(allErrs, validateBasicResource(qty, capPath.Key(string(r)))...) } - newPvc.Spec = oldPvc.Spec return allErrs } @@ -2435,13 +2429,13 @@ func GetVolumeMountMap(mounts []core.VolumeMount) map[string]string { } func GetVolumeDeviceMap(devices []core.VolumeDevice) map[string]string { - voldevices := make(map[string]string) + volDevices := make(map[string]string) for _, dev := range devices { - voldevices[dev.Name] = dev.DevicePath + volDevices[dev.Name] = dev.DevicePath } - return voldevices + return volDevices } func ValidateVolumeMounts(mounts []core.VolumeMount, voldevices map[string]string, volumes map[string]core.VolumeSource, container *core.Container, fldPath *field.Path) field.ErrorList { @@ -2864,6 +2858,11 @@ func validateContainers(containers []core.Container, isInitContainers bool, volu allErrs = append(allErrs, validateLifecycle(ctr.Lifecycle, idxPath.Child("lifecycle"))...) } allErrs = append(allErrs, validateProbe(ctr.LivenessProbe, idxPath.Child("livenessProbe"))...) + // Readiness-specific validation + if ctr.ReadinessProbe != nil && ctr.ReadinessProbe.TerminationGracePeriodSeconds != nil { + allErrs = append(allErrs, field.Invalid(idxPath.Child("readinessProbe", "terminationGracePeriodSeconds"), ctr.ReadinessProbe.TerminationGracePeriodSeconds, "must not be set for readinessProbes")) + } + allErrs = append(allErrs, validateProbe(ctr.StartupProbe, idxPath.Child("startupProbe"))...) // Liveness-specific validation if ctr.LivenessProbe != nil && ctr.LivenessProbe.SuccessThreshold != 1 { allErrs = append(allErrs, field.Invalid(idxPath.Child("livenessProbe", "successThreshold"), ctr.LivenessProbe.SuccessThreshold, "must be 1")) @@ -3105,10 +3104,11 @@ func validateOnlyAddedTolerations(newTolerations []core.Toleration, oldToleratio allErrs := field.ErrorList{} for _, old := range oldTolerations { found := false - old.TolerationSeconds = nil - for _, new := range newTolerations { - new.TolerationSeconds = nil - if reflect.DeepEqual(old, new) { + oldTolerationClone := old.DeepCopy() + for _, newToleration := range newTolerations { + // assign to our clone before doing a deep equal so we can allow tolerationseconds to change. + oldTolerationClone.TolerationSeconds = newToleration.TolerationSeconds // +k8s:verify-mutation:reason=clone + if reflect.DeepEqual(*oldTolerationClone, newToleration) { found = true break } @@ -3992,37 +3992,44 @@ func ValidatePodUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions) fiel allErrs = append(allErrs, field.Invalid(specPath.Child("activeDeadlineSeconds"), newPod.Spec.ActiveDeadlineSeconds, "must not update from a positive integer to nil value")) } + // Allow only additions to tolerations updates. + allErrs = append(allErrs, validateOnlyAddedTolerations(newPod.Spec.Tolerations, oldPod.Spec.Tolerations, specPath.Child("tolerations"))...) + + // the last thing to check is pod spec equality. If the pod specs are equal, then we can simply return the errors we have + // so far and save the cost of a deep copy. + if apiequality.Semantic.DeepEqual(newPod.Spec, oldPod.Spec) { + return allErrs + } + // handle updateable fields by munging those fields prior to deep equal comparison. - mungedPod := *newPod + mungedPodSpec := *newPod.Spec.DeepCopy() // munge spec.containers[*].image var newContainers []core.Container - for ix, container := range mungedPod.Spec.Containers { - container.Image = oldPod.Spec.Containers[ix].Image + for ix, container := range mungedPodSpec.Containers { + container.Image = oldPod.Spec.Containers[ix].Image // +k8s:verify-mutation:reason=clone newContainers = append(newContainers, container) } - mungedPod.Spec.Containers = newContainers + mungedPodSpec.Containers = newContainers // munge spec.initContainers[*].image var newInitContainers []core.Container - for ix, container := range mungedPod.Spec.InitContainers { - container.Image = oldPod.Spec.InitContainers[ix].Image + for ix, container := range mungedPodSpec.InitContainers { + container.Image = oldPod.Spec.InitContainers[ix].Image // +k8s:verify-mutation:reason=clone newInitContainers = append(newInitContainers, container) } - mungedPod.Spec.InitContainers = newInitContainers + mungedPodSpec.InitContainers = newInitContainers // munge spec.activeDeadlineSeconds - mungedPod.Spec.ActiveDeadlineSeconds = nil + mungedPodSpec.ActiveDeadlineSeconds = nil if oldPod.Spec.ActiveDeadlineSeconds != nil { activeDeadlineSeconds := *oldPod.Spec.ActiveDeadlineSeconds - mungedPod.Spec.ActiveDeadlineSeconds = &activeDeadlineSeconds + mungedPodSpec.ActiveDeadlineSeconds = &activeDeadlineSeconds } + // tolerations are checked before the deep copy, so munge those too + mungedPodSpec.Tolerations = oldPod.Spec.Tolerations // +k8s:verify-mutation:reason=clone - // Allow only additions to tolerations updates. - mungedPod.Spec.Tolerations = oldPod.Spec.Tolerations - allErrs = append(allErrs, validateOnlyAddedTolerations(newPod.Spec.Tolerations, oldPod.Spec.Tolerations, specPath.Child("tolerations"))...) - - if !apiequality.Semantic.DeepEqual(mungedPod.Spec, oldPod.Spec) { + if !apiequality.Semantic.DeepEqual(mungedPodSpec, oldPod.Spec) { // This diff isn't perfect, but it's a helluva lot better an "I'm not going to tell you what the difference is". //TODO: Pinpoint the specific field that causes the invalid error after we have strategic merge diff - specDiff := diff.ObjectDiff(mungedPod.Spec, oldPod.Spec) + specDiff := diff.ObjectDiff(mungedPodSpec, oldPod.Spec) allErrs = append(allErrs, field.Forbidden(specPath, fmt.Sprintf("pod updates may not change fields other than `spec.containers[*].image`, `spec.initContainers[*].image`, `spec.activeDeadlineSeconds` or `spec.tolerations` (only additions to existing tolerations)\n%v", specDiff))) } @@ -4054,8 +4061,7 @@ func ValidateContainerStateTransition(newStatuses, oldStatuses []core.ContainerS return allErrs } -// ValidatePodStatusUpdate tests to see if the update is legal for an end user to make. newPod is updated with fields -// that cannot be changed. +// ValidatePodStatusUpdate tests to see if the update is legal for an end user to make. func ValidatePodStatusUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions) field.ErrorList { fldPath := field.NewPath("metadata") allErrs := ValidateObjectMetaUpdate(&newPod.ObjectMeta, &oldPod.ObjectMeta, fldPath) @@ -4086,9 +4092,6 @@ func ValidatePodStatusUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions } } - // For status update we ignore changes to pod spec. - newPod.Spec = oldPod.Spec - return allErrs } @@ -4263,7 +4266,7 @@ func ValidateService(service *core.Service) field.ErrorList { allErrs = append(allErrs, field.Invalid(idxPath, ip, msgs[i])) } } else { - allErrs = append(allErrs, validateNonSpecialIP(ip, idxPath)...) + allErrs = append(allErrs, ValidateNonSpecialIP(ip, idxPath)...) } } @@ -4806,11 +4809,8 @@ func ValidateNodeUpdate(node, oldNode *core.Node) field.ErrorList { addresses[address] = true } - if len(oldNode.Spec.PodCIDRs) == 0 { - // Allow the controller manager to assign a CIDR to a node if it doesn't have one. - //this is a no op for a string slice. - oldNode.Spec.PodCIDRs = node.Spec.PodCIDRs - } else { + // Allow the controller manager to assign a CIDR to a node if it doesn't have one. + if len(oldNode.Spec.PodCIDRs) > 0 { // compare the entire slice if len(oldNode.Spec.PodCIDRs) != len(node.Spec.PodCIDRs) { allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "podCIDRs"), "node updates may not change podCIDR except from \"\" to valid")) @@ -4824,46 +4824,35 @@ func ValidateNodeUpdate(node, oldNode *core.Node) field.ErrorList { } // Allow controller manager updating provider ID when not set - if len(oldNode.Spec.ProviderID) == 0 { - oldNode.Spec.ProviderID = node.Spec.ProviderID - } else { - if oldNode.Spec.ProviderID != node.Spec.ProviderID { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "providerID"), "node updates may not change providerID except from \"\" to valid")) - } + if len(oldNode.Spec.ProviderID) > 0 && oldNode.Spec.ProviderID != node.Spec.ProviderID { + allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "providerID"), "node updates may not change providerID except from \"\" to valid")) } if node.Spec.ConfigSource != nil { allErrs = append(allErrs, validateNodeConfigSourceSpec(node.Spec.ConfigSource, field.NewPath("spec", "configSource"))...) } - oldNode.Spec.ConfigSource = node.Spec.ConfigSource if node.Status.Config != nil { allErrs = append(allErrs, validateNodeConfigStatus(node.Status.Config, field.NewPath("status", "config"))...) } - oldNode.Status.Config = node.Status.Config - - // TODO: move reset function to its own location - // Ignore metadata changes now that they have been tested - oldNode.ObjectMeta = node.ObjectMeta - // Allow users to update capacity - oldNode.Status.Capacity = node.Status.Capacity - // Allow users to unschedule node - oldNode.Spec.Unschedulable = node.Spec.Unschedulable - // Clear status - oldNode.Status = node.Status // update taints if len(node.Spec.Taints) > 0 { allErrs = append(allErrs, validateNodeTaints(node.Spec.Taints, fldPath.Child("taints"))...) } - oldNode.Spec.Taints = node.Spec.Taints - // We made allowed changes to oldNode, and now we compare oldNode to node. Any remaining differences indicate changes to protected fields. - // TODO: Add a 'real' error type for this error and provide print actual diffs. - if !apiequality.Semantic.DeepEqual(oldNode, node) { - klog.V(4).Infof("Update failed validation %#v vs %#v", oldNode, node) - allErrs = append(allErrs, field.Forbidden(field.NewPath(""), "node updates may only change labels, taints, or capacity (or configSource, if the DynamicKubeletConfig feature gate is enabled)")) + if node.Spec.DoNotUseExternalID != oldNode.Spec.DoNotUseExternalID { + allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "externalID"), "may not be updated")) } + // status and metadata are allowed change (barring restrictions above), so separately test spec field. + // spec only has a few fields, so check the ones we don't allow changing + // 1. PodCIDRs - immutable after first set - checked above + // 2. ProviderID - immutable after first set - checked above + // 3. Unschedulable - allowed to change + // 4. Taints - allowed to change + // 5. ConfigSource - allowed to change (and checked above) + // 6. DoNotUseExternalID - immutable - checked above + return allErrs } @@ -5276,10 +5265,6 @@ func ValidateSecret(secret *core.Secret) field.ErrorList { func ValidateSecretUpdate(newSecret, oldSecret *core.Secret) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newSecret.ObjectMeta, &oldSecret.ObjectMeta, field.NewPath("metadata")) - if len(newSecret.Type) == 0 { - newSecret.Type = oldSecret.Type - } - allErrs = append(allErrs, ValidateImmutableField(newSecret.Type, oldSecret.Type, field.NewPath("type"))...) if oldSecret.Immutable != nil && *oldSecret.Immutable { if newSecret.Immutable == nil || !*newSecret.Immutable { @@ -5422,7 +5407,7 @@ func ValidateResourceRequirements(requirements *core.ResourceRequirements, fldPa } if !limContainsCPUOrMemory && !reqContainsCPUOrMemory && (reqContainsHugePages || limContainsHugePages) { - allErrs = append(allErrs, field.Forbidden(fldPath, fmt.Sprintf("HugePages require cpu or memory"))) + allErrs = append(allErrs, field.Forbidden(fldPath, "HugePages require cpu or memory")) } return allErrs @@ -5604,7 +5589,6 @@ func ValidateResourceQuantityValue(resource string, value resource.Quantity, fld } // ValidateResourceQuotaUpdate tests to see if the update is legal for an end user to make. -// newResourceQuota is updated with fields that cannot be changed. func ValidateResourceQuotaUpdate(newResourceQuota, oldResourceQuota *core.ResourceQuota, opts ResourceQuotaValidationOptions) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newResourceQuota.ObjectMeta, &oldResourceQuota.ObjectMeta, field.NewPath("metadata")) allErrs = append(allErrs, ValidateResourceQuotaSpec(&newResourceQuota.Spec, opts, field.NewPath("spec"))...) @@ -5623,12 +5607,10 @@ func ValidateResourceQuotaUpdate(newResourceQuota, oldResourceQuota *core.Resour allErrs = append(allErrs, field.Invalid(fldPath, newResourceQuota.Spec.Scopes, fieldImmutableErrorMsg)) } - newResourceQuota.Status = oldResourceQuota.Status return allErrs } // ValidateResourceQuotaStatusUpdate tests to see if the status update is legal for an end user to make. -// newResourceQuota is updated with fields that cannot be changed. func ValidateResourceQuotaStatusUpdate(newResourceQuota, oldResourceQuota *core.ResourceQuota) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newResourceQuota.ObjectMeta, &oldResourceQuota.ObjectMeta, field.NewPath("metadata")) if len(newResourceQuota.ResourceVersion) == 0 { @@ -5646,7 +5628,6 @@ func ValidateResourceQuotaStatusUpdate(newResourceQuota, oldResourceQuota *core. allErrs = append(allErrs, ValidateResourceQuotaResourceName(string(k), resPath)...) allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...) } - newResourceQuota.Spec = oldResourceQuota.Spec return allErrs } @@ -5679,19 +5660,14 @@ func validateKubeFinalizerName(stringValue string, fldPath *field.Path) field.Er } // ValidateNamespaceUpdate tests to make sure a namespace update can be applied. -// newNamespace is updated with fields that cannot be changed func ValidateNamespaceUpdate(newNamespace *core.Namespace, oldNamespace *core.Namespace) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newNamespace.ObjectMeta, &oldNamespace.ObjectMeta, field.NewPath("metadata")) - newNamespace.Spec.Finalizers = oldNamespace.Spec.Finalizers - newNamespace.Status = oldNamespace.Status return allErrs } -// ValidateNamespaceStatusUpdate tests to see if the update is legal for an end user to make. newNamespace is updated with fields -// that cannot be changed. +// ValidateNamespaceStatusUpdate tests to see if the update is legal for an end user to make. func ValidateNamespaceStatusUpdate(newNamespace, oldNamespace *core.Namespace) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newNamespace.ObjectMeta, &oldNamespace.ObjectMeta, field.NewPath("metadata")) - newNamespace.Spec = oldNamespace.Spec if newNamespace.DeletionTimestamp.IsZero() { if newNamespace.Status.Phase != core.NamespaceActive { allErrs = append(allErrs, field.Invalid(field.NewPath("status", "Phase"), newNamespace.Status.Phase, "may only be 'Active' if `deletionTimestamp` is empty")) @@ -5705,7 +5681,6 @@ func ValidateNamespaceStatusUpdate(newNamespace, oldNamespace *core.Namespace) f } // ValidateNamespaceFinalizeUpdate tests to see if the update is legal for an end user to make. -// newNamespace is updated with fields that cannot be changed. func ValidateNamespaceFinalizeUpdate(newNamespace, oldNamespace *core.Namespace) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newNamespace.ObjectMeta, &oldNamespace.ObjectMeta, field.NewPath("metadata")) @@ -5714,7 +5689,6 @@ func ValidateNamespaceFinalizeUpdate(newNamespace, oldNamespace *core.Namespace) idxPath := fldPath.Index(i) allErrs = append(allErrs, validateFinalizerName(string(newNamespace.Spec.Finalizers[i]), idxPath)...) } - newNamespace.Status = oldNamespace.Status return allErrs } @@ -5780,15 +5754,19 @@ func validateEndpointAddress(address *core.EndpointAddress, fldPath *field.Path) allErrs = append(allErrs, field.Invalid(fldPath.Child("nodeName"), *address.NodeName, msg)) } } - allErrs = append(allErrs, validateNonSpecialIP(address.IP, fldPath.Child("ip"))...) + allErrs = append(allErrs, ValidateNonSpecialIP(address.IP, fldPath.Child("ip"))...) return allErrs } -func validateNonSpecialIP(ipAddress string, fldPath *field.Path) field.ErrorList { - // We disallow some IPs as endpoints or external-ips. Specifically, - // unspecified and loopback addresses are nonsensical and link-local - // addresses tend to be used for node-centric purposes (e.g. metadata - // service). +// ValidateNonSpecialIP is used to validate Endpoints, EndpointSlices, and +// external IPs. Specifically, this disallows unspecified and loopback addresses +// are nonsensical and link-local addresses tend to be used for node-centric +// purposes (e.g. metadata service). +// +// IPv6 references +// - https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml +// - https://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xhtml +func ValidateNonSpecialIP(ipAddress string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} ip := net.ParseIP(ipAddress) if ip == nil { @@ -5796,16 +5774,16 @@ func validateNonSpecialIP(ipAddress string, fldPath *field.Path) field.ErrorList return allErrs } if ip.IsUnspecified() { - allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be unspecified (0.0.0.0)")) + allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, fmt.Sprintf("may not be unspecified (%v)", ipAddress))) } if ip.IsLoopback() { - allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the loopback range (127.0.0.0/8)")) + allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the loopback range (127.0.0.0/8, ::1/128)")) } if ip.IsLinkLocalUnicast() { - allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the link-local range (169.254.0.0/16)")) + allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the link-local range (169.254.0.0/16, fe80::/10)")) } if ip.IsLinkLocalMulticast() { - allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the link-local multicast range (224.0.0.0/24)")) + allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the link-local multicast range (224.0.0.0/24, ff02::/10)")) } return allErrs } @@ -5948,10 +5926,10 @@ func validateWindowsSecurityContextOptions(windowsOptions *core.WindowsSecurityC if l := len(*windowsOptions.RunAsUserName); l == 0 { allErrs = append(allErrs, field.Invalid(fieldPath.Child("runAsUserName"), windowsOptions.RunAsUserName, "runAsUserName cannot be an empty string")) } else if ctrlRegex.MatchString(*windowsOptions.RunAsUserName) { - errMsg := fmt.Sprintf("runAsUserName cannot contain control characters") + errMsg := "runAsUserName cannot contain control characters" allErrs = append(allErrs, field.Invalid(fieldPath.Child("runAsUserName"), windowsOptions.RunAsUserName, errMsg)) } else if parts := strings.Split(*windowsOptions.RunAsUserName, "\\"); len(parts) > 2 { - errMsg := fmt.Sprintf("runAsUserName cannot contain more than one backslash") + errMsg := "runAsUserName cannot contain more than one backslash" allErrs = append(allErrs, field.Invalid(fieldPath.Child("runAsUserName"), windowsOptions.RunAsUserName, errMsg)) } else { var ( @@ -5978,7 +5956,7 @@ func validateWindowsSecurityContextOptions(windowsOptions *core.WindowsSecurityC } if l := len(user); l == 0 { - errMsg := fmt.Sprintf("runAsUserName's User cannot be empty") + errMsg := "runAsUserName's User cannot be empty" allErrs = append(allErrs, field.Invalid(fieldPath.Child("runAsUserName"), windowsOptions.RunAsUserName, errMsg)) } else if l > maxRunAsUserNameUserLength { errMsg := fmt.Sprintf("runAsUserName's User length must not be longer than %d characters", maxRunAsUserNameUserLength) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go index 14a77ee1248f..9f265c21c2b9 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go @@ -1400,39 +1400,6 @@ func (in *EphemeralContainerCommon) DeepCopy() *EphemeralContainerCommon { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EphemeralContainers) DeepCopyInto(out *EphemeralContainers) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.EphemeralContainers != nil { - in, out := &in.EphemeralContainers, &out.EphemeralContainers - *out = make([]EphemeralContainer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EphemeralContainers. -func (in *EphemeralContainers) DeepCopy() *EphemeralContainers { - if in == nil { - return nil - } - out := new(EphemeralContainers) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *EphemeralContainers) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EphemeralVolumeSource) DeepCopyInto(out *EphemeralVolumeSource) { *out = *in @@ -4192,6 +4159,11 @@ func (in *PreferredSchedulingTerm) DeepCopy() *PreferredSchedulingTerm { func (in *Probe) DeepCopyInto(out *Probe) { *out = *in in.Handler.DeepCopyInto(&out.Handler) + if in.TerminationGracePeriodSeconds != nil { + in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds + *out = new(int64) + **out = **in + } return } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/extensions/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/extensions/OWNERS index 7ae05a903044..4739e16b4fc7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/extensions/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/extensions/OWNERS @@ -11,7 +11,6 @@ reviewers: - caesarxuchao - mikedanese - liggitt -- erictune - pmorie - sttts - saad-ali @@ -25,7 +24,6 @@ reviewers: - dims - errordeveloper - rootfs -- mml - resouer - therc - pweil- diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/helper.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/helper.go new file mode 100644 index 000000000000..4dd1658abc71 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/helper.go @@ -0,0 +1,51 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package policy + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + PDBV1beta1Label = "pdb.kubernetes.io/deprecated-v1beta1-empty-selector-match" +) + +var ( + NonV1beta1MatchAllSelector = &metav1.LabelSelector{} + NonV1beta1MatchNoneSelector = &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{Key: PDBV1beta1Label, Operator: metav1.LabelSelectorOpExists}}, + } + + V1beta1MatchNoneSelector = &metav1.LabelSelector{} + V1beta1MatchAllSelector = &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{Key: PDBV1beta1Label, Operator: metav1.LabelSelectorOpDoesNotExist}}, + } +) + +func StripPDBV1beta1Label(selector *metav1.LabelSelector) { + if selector == nil { + return + } + + trimmedMatchExpressions := selector.MatchExpressions[:0] + for _, exp := range selector.MatchExpressions { + if exp.Key != PDBV1beta1Label { + trimmedMatchExpressions = append(trimmedMatchExpressions, exp) + } + } + selector.MatchExpressions = trimmedMatchExpressions +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/controller/volume/persistentvolume/util/util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/controller/volume/persistentvolume/util/util.go index 844cd6cdae16..4f9390de4ad3 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/controller/volume/persistentvolume/util/util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/controller/volume/persistentvolume/util/util.go @@ -133,7 +133,7 @@ func GetBindVolumeToClaim(volume *v1.PersistentVolume, claim *v1.PersistentVolum claimRef, err := reference.GetReference(scheme.Scheme, claim) if err != nil { - return nil, false, fmt.Errorf("Unexpected error getting claim reference: %v", err) + return nil, false, fmt.Errorf("unexpected error getting claim reference: %w", err) } volumeClone.Spec.ClaimRef = claimRef dirty = true diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/OWNERS index 5e72ed8bde3b..ba3007ca8667 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/OWNERS @@ -2,7 +2,6 @@ approvers: - deads2k -- erictune - liggitt reviewers: - thockin diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/aws/aws_credentials.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/aws/aws_credentials.go index 8f85237e8f3b..a0eef38594a3 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/aws/aws_credentials.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/aws/aws_credentials.go @@ -20,7 +20,9 @@ import ( "encoding/base64" "errors" "fmt" + "io/ioutil" "net/url" + "os" "regexp" "strings" "sync" @@ -38,13 +40,19 @@ import ( "k8s.io/kubernetes/pkg/credentialprovider" ) -var ecrPattern = regexp.MustCompile(`^(\d{12})\.dkr\.ecr(\-fips)?\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\.amazonaws\.com(\.cn)?$`) +var ( + ecrPattern = regexp.MustCompile(`^(\d{12})\.dkr\.ecr(\-fips)?\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\.amazonaws\.com(\.cn)?$`) + once sync.Once + isEC2 bool +) // init registers a credential provider for each registryURLTemplate and creates // an ECR token getter factory with a new cache to store token getters func init() { credentialprovider.RegisterCredentialProvider("amazon-ecr", - newECRProvider(&ecrTokenGetterFactory{cache: make(map[string]tokenGetter)})) + newECRProvider(&ecrTokenGetterFactory{cache: make(map[string]tokenGetter)}, + ec2ValidationImpl, + )) } // ecrProvider is a DockerConfigProvider that gets and refreshes tokens @@ -52,20 +60,74 @@ func init() { type ecrProvider struct { cache cache.Store getterFactory tokenGetterFactory + isEC2 ec2ValidationFunc } var _ credentialprovider.DockerConfigProvider = &ecrProvider{} -func newECRProvider(getterFactory tokenGetterFactory) *ecrProvider { +func newECRProvider(getterFactory tokenGetterFactory, isEC2 ec2ValidationFunc) *ecrProvider { return &ecrProvider{ cache: cache.NewExpirationStore(stringKeyFunc, &ecrExpirationPolicy{}), getterFactory: getterFactory, + isEC2: isEC2, } } -// Enabled implements DockerConfigProvider.Enabled. Enabled is true if AWS -// credentials are found. +// Enabled implements DockerConfigProvider.Enabled. func (p *ecrProvider) Enabled() bool { + return true +} + +type ec2ValidationFunc func() bool + +// ec2ValidationImpl returns true if we detect +// an EC2 vm based on checking for the EC2 system UUID, the asset tag (for nitro +// instances), or instance credentials if the UUID is not present. +// Ref: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/identify_ec2_instances.html +func ec2ValidationImpl() bool { + return tryValidateEC2UUID() || tryValidateEC2Creds() +} + +func tryValidateEC2UUID() bool { + hypervisor_uuid := "/sys/hypervisor/uuid" + product_uuid := "/sys/devices/virtual/dmi/id/product_uuid" + asset_tag := "/sys/devices/virtual/dmi/id/board_asset_tag" + + if _, err := os.Stat(hypervisor_uuid); err == nil { + b, err := ioutil.ReadFile(hypervisor_uuid) + if err != nil { + klog.Errorf("error checking if this is an EC2 instance: %v", err) + } else if strings.HasPrefix(string(b), "EC2") || strings.HasPrefix(string(b), "ec2") { + klog.V(5).Infof("found 'ec2' in uuid %v from %v, enabling legacy AWS credential provider", string(b), hypervisor_uuid) + return true + } + } + + if _, err := os.Stat(product_uuid); err == nil { + b, err := ioutil.ReadFile(product_uuid) + if err != nil { + klog.Errorf("error checking if this is an EC2 instance: %v", err) + } else if strings.HasPrefix(string(b), "EC2") || strings.HasPrefix(string(b), "ec2") { + klog.V(5).Infof("found 'ec2' in uuid %v from %v, enabling legacy AWS credential provider", string(b), product_uuid) + return true + } + } + + if _, err := os.Stat(asset_tag); err == nil { + b, err := ioutil.ReadFile(asset_tag) + s := strings.TrimSpace(string(b)) + if err != nil { + klog.Errorf("error checking if this is an EC2 instance: %v", err) + } else if strings.HasPrefix(s, "i-") && len(s) == 19 { + // Instance ID's are 19 characters plus newline + klog.V(5).Infof("found instance ID in %v from %v, enabling legacy AWS credential provider", string(b), asset_tag) + return true + } + } + return false +} + +func tryValidateEC2Creds() bool { sess, err := session.NewSessionWithOptions(session.Options{ SharedConfigState: session.SharedConfigEnable, }) @@ -77,6 +139,7 @@ func (p *ecrProvider) Enabled() bool { klog.Errorf("while getting AWS credentials %v", err) return false } + klog.V(5).Infof("found aws credentials, enabling legacy AWS credential provider") return true } @@ -85,12 +148,25 @@ func (p *ecrProvider) Enabled() bool { func (p *ecrProvider) Provide(image string) credentialprovider.DockerConfig { parsed, err := parseRepoURL(image) if err != nil { - klog.V(3).Info(err) + return credentialprovider.DockerConfig{} + } + + // To prevent the AWS SDK from causing latency on non-aws platforms, only test if we are on + // EC2 or have access to credentials once. Attempt to do it without network calls by checking + // for certain EC2-specific files. Otherwise, we ask the SDK to initialize a session to see if + // credentials are available. On non-aws platforms, especially when a metadata endpoint is blocked, + // this has been shown to cause 20 seconds of latency due to SDK retries + // (see https://github.com/kubernetes/kubernetes/issues/92162) + once.Do(func() { + isEC2 = p.isEC2() + }) + + if !isEC2 { return credentialprovider.DockerConfig{} } if cfg, exists := p.getFromCache(parsed); exists { - klog.V(6).Infof("Got ECR credentials from cache for %s", parsed.registry) + klog.V(3).Infof("Got ECR credentials from cache for %s", parsed.registry) return cfg } klog.V(3).Info("unable to get ECR credentials from cache, checking ECR API") diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_acr_helper.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_acr_helper.go index 347b1658a918..ec4af71a28a2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_acr_helper.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_acr_helper.go @@ -57,7 +57,10 @@ import ( "net/url" "strconv" "strings" + "time" "unicode" + + utilnet "k8s.io/apimachinery/pkg/util/net" ) type authDirective struct { @@ -75,7 +78,10 @@ const userAgent = "kubernetes-credentialprovider-acr" const dockerTokenLoginUsernameGUID = "00000000-0000-0000-0000-000000000000" -var client = &http.Client{} +var client = &http.Client{ + Transport: utilnet.SetTransportDefaults(&http.Transport{}), + Timeout: time.Second * 10, +} func receiveChallengeFromLoginServer(serverAddress string) (*authDirective, error) { challengeURL := url.URL{ diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugin/config.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugin/config.go index 3857853de5b9..c65f3bb472f7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugin/config.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugin/config.go @@ -35,12 +35,12 @@ func readCredentialProviderConfigFile(configPath string) (*kubeletconfig.Credent data, err := ioutil.ReadFile(configPath) if err != nil { - return nil, fmt.Errorf("unable to read external registry credential provider configuration from %q: %v", configPath, err) + return nil, fmt.Errorf("unable to read external registry credential provider configuration from %q: %w", configPath, err) } config, err := decode(data) if err != nil { - return nil, fmt.Errorf("error decoding config %s: %v", configPath, err) + return nil, fmt.Errorf("error decoding config %s: %w", configPath, err) } return config, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugin/plugin.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugin/plugin.go index c646d5ca8713..eee135b94237 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugin/plugin.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/credentialprovider/plugin/plugin.go @@ -328,7 +328,7 @@ func (e *execPlugin) ExecPlugin(ctx context.Context, image string) (*credentialp authRequest := &credentialproviderapi.CredentialProviderRequest{Image: image} data, err := e.encodeRequest(authRequest) if err != nil { - return nil, fmt.Errorf("failed to encode auth request: %v", err) + return nil, fmt.Errorf("failed to encode auth request: %w", err) } stdout := &bytes.Buffer{} @@ -385,7 +385,7 @@ func (e *execPlugin) ExecPlugin(ctx context.Context, image string) (*credentialp func (e *execPlugin) encodeRequest(request *credentialproviderapi.CredentialProviderRequest) ([]byte, error) { data, err := runtime.Encode(e.encoder, request) if err != nil { - return nil, fmt.Errorf("error encoding request: %v", err) + return nil, fmt.Errorf("error encoding request: %w", err) } return data, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/features/kube_features.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/features/kube_features.go index 5b2ce6fa433e..a3f4a2dc59ad 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/features/kube_features.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/features/kube_features.go @@ -248,6 +248,7 @@ const ( // owner: @pohly // alpha: v1.19 + // beta: v1.21 // // Enables generic ephemeral inline volume support for pods GenericEphemeralVolume featuregate.Feature = "GenericEphemeralVolume" @@ -279,14 +280,6 @@ const ( // (Kube) Node Lifecycle Controller uses these heartbeats as a node health signal. NodeLease featuregate.Feature = "NodeLease" - // owner: @janosi - // alpha: v1.12 - // beta: v1.19 - // GA: v1.20 - // - // Enables SCTP as new protocol for Service ports, NetworkPolicy, and ContainerPort in Pod/Containers definition - SCTPSupport featuregate.Feature = "SCTPSupport" - // owner: @rikatz // alpha: v1.21 // @@ -564,13 +557,6 @@ const ( // Enables usage of hugepages- in downward API. DownwardAPIHugePages featuregate.Feature = "DownwardAPIHugePages" - // owner: @freehan - // GA: v1.18 - // - // Enable ExternalTrafficPolicy for Service ExternalIPs. - // This is for bug fix #69811 - ExternalPolicyForExternalIP featuregate.Feature = "ExternalPolicyForExternalIP" - // owner: @bswartz // alpha: v1.18 // @@ -635,6 +621,7 @@ const ( // owner: @derekwaynecarr // alpha: v1.20 + // beta: v1.22 // // Enables kubelet support to size memory backed volumes SizeMemoryBackedVolumes featuregate.Feature = "SizeMemoryBackedVolumes" @@ -644,7 +631,7 @@ const ( // // Ensure kubelet respects exec probe timeouts. Feature gate exists in-case existing workloads // may depend on old behavior where exec probe timeouts were ignored. - // Lock to default in v1.21 and remove in v1.22. + // Lock to default and remove after v1.22 based on user feedback that should be reflected in KEP #1972 update ExecProbeTimeout featuregate.Feature = "ExecProbeTimeout" // owner: @andrewsykim @@ -655,6 +642,7 @@ const ( // owner: @zshihang // alpha: v1.20 + // beta: v1.21 // // Enable kubelet to pass pod's service account token to NodePublishVolume // call of CSI driver which is mounting volumes for that pod. @@ -684,10 +672,23 @@ const ( // owner: @ahg-g // alpha: v1.21 + // beta: v1.22 // // Enables controlling pod ranking on replicaset scale-down. PodDeletionCost featuregate.Feature = "PodDeletionCost" + // owner: @robscott + // alpha: v1.21 + // + // Enables topology aware hints for EndpointSlices + TopologyAwareHints featuregate.Feature = "TopologyAwareHints" + + // owner: @ehashman + // alpha: v1.21 + // + // Allows user to override pod-level terminationGracePeriod for probes + ProbeTerminationGracePeriod featuregate.Feature = "ProbeTerminationGracePeriod" + // owner: @ahg-g // alpha: v1.21 // @@ -724,11 +725,24 @@ const ( // Allows jobs to be created in the suspended state. SuspendJob featuregate.Feature = "SuspendJob" + // owner: @fromanirh + // alpha: v1.21 + // + // Enable POD resources API to return allocatable resources + KubeletPodResourcesGetAllocatable featuregate.Feature = "KubeletPodResourcesGetAllocatable" + // owner: @jayunit100 @abhiraut @rikatz // beta: v1.21 + // ga: v1.22 // // Labels all namespaces with a default label "kubernetes.io/metadata.name: " NamespaceDefaultLabelName featuregate.Feature = "NamespaceDefaultLabelName" + + // owner: @fengzixu + // alpha: v1.21 + // + // Enables kubelet to detect CSI volume condition and send the event of the abnormal volume to the corresponding pod that is using it. + CSIVolumeHealth featuregate.Feature = "CSIVolumeHealth" ) func init() { @@ -782,12 +796,11 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS BalanceAttachedNodeVolumes: {Default: false, PreRelease: featuregate.Alpha}, CSIInlineVolume: {Default: true, PreRelease: featuregate.Beta}, CSIStorageCapacity: {Default: true, PreRelease: featuregate.Beta}, - CSIServiceAccountToken: {Default: false, PreRelease: featuregate.Alpha}, - GenericEphemeralVolume: {Default: false, PreRelease: featuregate.Alpha}, + CSIServiceAccountToken: {Default: true, PreRelease: featuregate.Beta}, + GenericEphemeralVolume: {Default: true, PreRelease: featuregate.Beta}, CSIVolumeFSGroupPolicy: {Default: true, PreRelease: featuregate.Beta}, RuntimeClass: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 NodeLease: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - SCTPSupport: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 NetworkPolicyEndPort: {Default: false, PreRelease: featuregate.Alpha}, VolumeSnapshotDataSource: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21 ProcMountType: {Default: false, PreRelease: featuregate.Alpha}, @@ -805,15 +818,14 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS WindowsEndpointSliceProxying: {Default: true, PreRelease: featuregate.Beta}, StartupProbe: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 AllowInsecureBackendProxy: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 - PodDisruptionBudget: {Default: true, PreRelease: featuregate.Beta}, + PodDisruptionBudget: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25 CronJobControllerV2: {Default: true, PreRelease: featuregate.Beta}, DaemonSetUpdateSurge: {Default: false, PreRelease: featuregate.Alpha}, ServiceTopology: {Default: false, PreRelease: featuregate.Alpha}, ServiceAppProtocol: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, ImmutableEphemeralVolumes: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.24 HugePageStorageMediumSize: {Default: true, PreRelease: featuregate.Beta}, - DownwardAPIHugePages: {Default: false, PreRelease: featuregate.Beta}, // on by default in 1.22 - ExternalPolicyForExternalIP: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 + DownwardAPIHugePages: {Default: false, PreRelease: featuregate.Beta}, // on by default in 1.22 AnyVolumeDataSource: {Default: false, PreRelease: featuregate.Alpha}, DefaultPodTopologySpread: {Default: true, PreRelease: featuregate.Beta}, SetHostnameAsFQDN: {Default: true, PreRelease: featuregate.Beta}, @@ -822,23 +834,27 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS DisableAcceleratorUsageMetrics: {Default: true, PreRelease: featuregate.Beta}, HPAContainerMetrics: {Default: false, PreRelease: featuregate.Alpha}, RootCAConfigMap: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 - SizeMemoryBackedVolumes: {Default: false, PreRelease: featuregate.Alpha}, - ExecProbeTimeout: {Default: true, PreRelease: featuregate.GA}, // lock to default in v1.21 and remove in v1.22 + SizeMemoryBackedVolumes: {Default: true, PreRelease: featuregate.Beta}, + ExecProbeTimeout: {Default: true, PreRelease: featuregate.GA}, // lock to default and remove after v1.22 based on KEP #1972 update KubeletCredentialProviders: {Default: false, PreRelease: featuregate.Alpha}, GracefulNodeShutdown: {Default: true, PreRelease: featuregate.Beta}, ServiceLBNodePortControl: {Default: false, PreRelease: featuregate.Alpha}, MixedProtocolLBService: {Default: false, PreRelease: featuregate.Alpha}, VolumeCapacityPriority: {Default: false, PreRelease: featuregate.Alpha}, PreferNominatedNode: {Default: false, PreRelease: featuregate.Alpha}, + ProbeTerminationGracePeriod: {Default: false, PreRelease: featuregate.Alpha}, RunAsGroup: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 - PodDeletionCost: {Default: false, PreRelease: featuregate.Alpha}, + PodDeletionCost: {Default: true, PreRelease: featuregate.Beta}, + TopologyAwareHints: {Default: false, PreRelease: featuregate.Alpha}, PodAffinityNamespaceSelector: {Default: false, PreRelease: featuregate.Alpha}, ServiceLoadBalancerClass: {Default: false, PreRelease: featuregate.Alpha}, LogarithmicScaleDown: {Default: false, PreRelease: featuregate.Alpha}, IngressClassNamespacedParams: {Default: false, PreRelease: featuregate.Alpha}, ServiceInternalTrafficPolicy: {Default: false, PreRelease: featuregate.Alpha}, SuspendJob: {Default: false, PreRelease: featuregate.Alpha}, - NamespaceDefaultLabelName: {Default: true, PreRelease: featuregate.Beta}, // graduate to GA and lock to default in 1.22, remove in 1.24 + KubeletPodResourcesGetAllocatable: {Default: false, PreRelease: featuregate.Alpha}, + NamespaceDefaultLabelName: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.24 + CSIVolumeHealth: {Default: false, PreRelease: featuregate.Alpha}, // inherited features from generic apiserver, relisted here to get a conflict if it is changed // unintentionally on either side: @@ -848,7 +864,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS genericfeatures.APIResponseCompression: {Default: true, PreRelease: featuregate.Beta}, genericfeatures.APIListChunking: {Default: true, PreRelease: featuregate.Beta}, genericfeatures.DryRun: {Default: true, PreRelease: featuregate.GA}, - genericfeatures.ServerSideApply: {Default: true, PreRelease: featuregate.Beta}, + genericfeatures.ServerSideApply: {Default: true, PreRelease: featuregate.GA}, genericfeatures.APIPriorityAndFairness: {Default: true, PreRelease: featuregate.Beta}, genericfeatures.WarningHeaders: {Default: true, PreRelease: featuregate.Beta}, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/server_v1.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/server_v1.go index 8482f51a19db..bd29ed9fc53e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/server_v1.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/server_v1.go @@ -18,7 +18,10 @@ package podresources import ( "context" + "fmt" + utilfeature "k8s.io/apiserver/pkg/util/feature" + kubefeatures "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/kubelet/metrics" "k8s.io/kubelet/pkg/apis/podresources/v1" @@ -44,6 +47,7 @@ func NewV1PodResourcesServer(podsProvider PodsProvider, devicesProvider DevicesP // List returns information about the resources assigned to pods on the node func (p *v1PodResourcesServer) List(ctx context.Context, req *v1.ListPodResourcesRequest) (*v1.ListPodResourcesResponse, error) { metrics.PodResourcesEndpointRequestsTotalCount.WithLabelValues("v1").Inc() + metrics.PodResourcesEndpointRequestsListCount.WithLabelValues("v1").Inc() pods := p.podsProvider.GetPods() podResources := make([]*v1.PodResources, len(pods)) @@ -70,3 +74,21 @@ func (p *v1PodResourcesServer) List(ctx context.Context, req *v1.ListPodResource PodResources: podResources, }, nil } + +// GetAllocatableResources returns information about all the resources known by the server - this more like the capacity, not like the current amount of free resources. +func (p *v1PodResourcesServer) GetAllocatableResources(ctx context.Context, req *v1.AllocatableResourcesRequest) (*v1.AllocatableResourcesResponse, error) { + metrics.PodResourcesEndpointRequestsTotalCount.WithLabelValues("v1").Inc() + metrics.PodResourcesEndpointRequestsGetAllocatableCount.WithLabelValues("v1").Inc() + + if !utilfeature.DefaultFeatureGate.Enabled(kubefeatures.KubeletPodResourcesGetAllocatable) { + metrics.PodResourcesEndpointErrorsGetAllocatableCount.WithLabelValues("v1").Inc() + return nil, fmt.Errorf("Pod Resources API GetAllocatableResources disabled") + } + + metrics.PodResourcesEndpointRequestsTotalCount.WithLabelValues("v1").Inc() + + return &v1.AllocatableResourcesResponse{ + Devices: p.devicesProvider.GetAllocatableDevices(), + CpuIds: p.cpusProvider.GetAllocatableCPUs(), + }, nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/types.go index 433d92c59964..ebc068742c7f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/types.go @@ -23,8 +23,12 @@ import ( // DevicesProvider knows how to provide the devices used by the given container type DevicesProvider interface { - GetDevices(podUID, containerName string) []*podresourcesapi.ContainerDevices + // UpdateAllocatedDevices frees any Devices that are bound to terminated pods. UpdateAllocatedDevices() + // GetDevices returns information about the devices assigned to pods and containers + GetDevices(podUID, containerName string) []*podresourcesapi.ContainerDevices + // GetAllocatableDevices returns information about all the devices known to the manager + GetAllocatableDevices() []*podresourcesapi.ContainerDevices } // PodsProvider knows how to provide the pods admitted by the node @@ -34,5 +38,8 @@ type PodsProvider interface { // CPUsProvider knows how to provide the cpus used by the given container type CPUsProvider interface { + // GetCPUs returns information about the cpus assigned to pods and containers GetCPUs(podUID, containerName string) []int64 + // GetAllocatableCPUs returns the allocatable (not allocated) CPUs + GetAllocatableCPUs() []int64 } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_cloudproviders.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_cloudproviders.go new file mode 100644 index 000000000000..c6444f241724 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_cloudproviders.go @@ -0,0 +1,28 @@ +// +build linux +// +build !providerless + +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cadvisor + +import ( + // Register cloud info providers. + // TODO(#68522): Remove this in 1.20+ once the cAdvisor endpoints are removed. + _ "github.com/google/cadvisor/utils/cloudinfo/aws" + _ "github.com/google/cadvisor/utils/cloudinfo/azure" + _ "github.com/google/cadvisor/utils/cloudinfo/gce" +) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go index 0c701cb98d3e..991afe5fcfeb 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go @@ -31,12 +31,6 @@ import ( _ "github.com/google/cadvisor/container/crio/install" _ "github.com/google/cadvisor/container/systemd/install" - // Register cloud info providers. - // TODO(#68522): Remove this in 1.20+ once the cAdvisor endpoints are removed. - _ "github.com/google/cadvisor/utils/cloudinfo/aws" - _ "github.com/google/cadvisor/utils/cloudinfo/azure" - _ "github.com/google/cadvisor/utils/cloudinfo/gce" - "github.com/google/cadvisor/cache/memory" cadvisormetrics "github.com/google/cadvisor/container" "github.com/google/cadvisor/events" @@ -79,7 +73,7 @@ func init() { f.DefValue = defaultValue f.Value.Set(defaultValue) } else { - klog.Errorf("Expected cAdvisor flag %q not found", name) + klog.ErrorS(nil, "Expected cAdvisor flag not found", "flag", name) } } } @@ -186,7 +180,7 @@ func (cc *cadvisorClient) getFsInfo(label string) (cadvisorapiv2.FsInfo, error) } // TODO(vmarmol): Handle this better when a label has more than one image filesystem. if len(res) > 1 { - klog.Warningf("More than one filesystem labeled %q: %#v. Only using the first one", label, res) + klog.InfoS("More than one filesystem labeled. Only using the first one", "label", label, "fileSystem", res) } return res[0], nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go index d5fd2e489731..f598d466b0b3 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go @@ -31,6 +31,7 @@ import ( cgroupfs2 "github.com/opencontainers/runc/libcontainer/cgroups/fs2" cgroupsystemd "github.com/opencontainers/runc/libcontainer/cgroups/systemd" libcontainerconfigs "github.com/opencontainers/runc/libcontainer/configs" + libcontainerdevices "github.com/opencontainers/runc/libcontainer/devices" "k8s.io/klog/v2" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" @@ -258,7 +259,7 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool { } difference := neededControllers.Difference(enabledControllers) if difference.Len() > 0 { - klog.V(4).Infof("The Cgroup %v has some missing controllers: %v", name, difference) + klog.V(4).InfoS("The cgroup has some missing controllers", "cgroupName", name, "controllers", difference) return false } return true @@ -291,7 +292,7 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool { } if len(missingPaths) > 0 { - klog.V(4).Infof("The Cgroup %v has some missing paths: %v", name, missingPaths) + klog.V(4).InfoS("The cgroup has some missing paths", "cgroupName", name, "paths", missingPaths) return false } @@ -366,7 +367,7 @@ func setSupportedSubsystemsV1(cgroupConfig *libcontainerconfigs.Cgroup) error { return fmt.Errorf("failed to find subsystem mount for required subsystem: %v", sys.Name()) } // the cgroup is not mounted, but its not required so continue... - klog.V(6).Infof("Unable to find subsystem mount for optional subsystem: %v", sys.Name()) + klog.V(6).InfoS("Unable to find subsystem mount for optional subsystem", "subsystemName", sys.Name()) continue } if err := sys.Set(cgroupConfig.Paths[sys.Name()], cgroupConfig); err != nil { @@ -468,13 +469,13 @@ func setResourcesV2(cgroupConfig *libcontainerconfigs.Cgroup) error { if err := propagateControllers(cgroupConfig.Path); err != nil { return err } - cgroupConfig.Resources.Devices = []*libcontainerconfigs.DeviceRule{ + cgroupConfig.Resources.Devices = []*libcontainerdevices.Rule{ { Type: 'a', Permissions: "rwm", Allow: true, - Minor: libcontainerconfigs.Wildcard, - Major: libcontainerconfigs.Wildcard, + Minor: libcontainerdevices.Wildcard, + Major: libcontainerdevices.Wildcard, }, } cgroupConfig.Resources.SkipDevices = true @@ -484,7 +485,7 @@ func setResourcesV2(cgroupConfig *libcontainerconfigs.Cgroup) error { if !supportedControllers.Has("hugetlb") { cgroupConfig.Resources.HugetlbLimit = nil // the cgroup is not present, but its not required so skip it - klog.V(6).Infof("Optional subsystem not supported: hugetlb") + klog.V(6).InfoS("Optional subsystem not supported: hugetlb") } manager, err := cgroupfs2.NewManager(cgroupConfig, filepath.Join(cmutil.CgroupRoot, cgroupConfig.Path), false) @@ -499,13 +500,13 @@ func setResourcesV2(cgroupConfig *libcontainerconfigs.Cgroup) error { func (m *cgroupManagerImpl) toResources(resourceConfig *ResourceConfig) *libcontainerconfigs.Resources { resources := &libcontainerconfigs.Resources{ - Devices: []*libcontainerconfigs.DeviceRule{ + Devices: []*libcontainerdevices.Rule{ { Type: 'a', Permissions: "rwm", Allow: true, - Minor: libcontainerconfigs.Wildcard, - Major: libcontainerconfigs.Wildcard, + Minor: libcontainerdevices.Wildcard, + Major: libcontainerdevices.Wildcard, }, }, SkipDevices: true, @@ -538,7 +539,7 @@ func (m *cgroupManagerImpl) toResources(resourceConfig *ResourceConfig) *libcont for pageSize, limit := range resourceConfig.HugePageLimit { sizeString, err := v1helper.HugePageUnitSizeFromByteSize(pageSize) if err != nil { - klog.Warningf("pageSize is invalid: %v", err) + klog.InfoS("Invalid pageSize", "err", err) continue } resources.HugetlbLimit = append(resources.HugetlbLimit, &libcontainerconfigs.HugepageLimit{ @@ -679,7 +680,7 @@ func (m *cgroupManagerImpl) Pids(name CgroupName) []int { // WalkFunc which is called for each file and directory in the pod cgroup dir visitor := func(path string, info os.FileInfo, err error) error { if err != nil { - klog.V(4).Infof("cgroup manager encountered error scanning cgroup path %q: %v", path, err) + klog.V(4).InfoS("Cgroup manager encountered error scanning cgroup path", "path", path, "err", err) return filepath.SkipDir } if !info.IsDir() { @@ -687,7 +688,7 @@ func (m *cgroupManagerImpl) Pids(name CgroupName) []int { } pids, err = getCgroupProcs(path) if err != nil { - klog.V(4).Infof("cgroup manager encountered error getting procs for cgroup path %q: %v", path, err) + klog.V(4).InfoS("Cgroup manager encountered error getting procs for cgroup path", "path", path, "err", err) return filepath.SkipDir } pidsToKill.Insert(pids...) @@ -697,7 +698,7 @@ func (m *cgroupManagerImpl) Pids(name CgroupName) []int { // container cgroups haven't been GCed yet. Get attached processes to // all such unwanted containers under the pod cgroup if err = filepath.Walk(dir, visitor); err != nil { - klog.V(4).Infof("cgroup manager encountered error scanning pids for directory: %q: %v", dir, err) + klog.V(4).InfoS("Cgroup manager encountered error scanning pids for directory", "path", dir, "err", err) } } return pidsToKill.List() @@ -725,7 +726,7 @@ func getStatsSupportedSubsystems(cgroupPaths map[string]string) (*libcontainercg return nil, fmt.Errorf("failed to find subsystem mount for required subsystem: %v", sys.Name()) } // the cgroup is not mounted, but its not required so continue... - klog.V(6).Infof("Unable to find subsystem mount for optional subsystem: %v", sys.Name()) + klog.V(6).InfoS("Unable to find subsystem mount for optional subsystem", "subsystemName", sys.Name()) continue } if err := sys.GetStats(cgroupPaths[sys.Name()], stats); err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager.go index e4a710947187..2296fe024e25 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager.go @@ -28,7 +28,9 @@ import ( internalapi "k8s.io/cri-api/pkg/apis" podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1" kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config" + "k8s.io/kubernetes/pkg/kubelet/apis/podresources" "k8s.io/kubernetes/pkg/kubelet/cm/cpuset" + "k8s.io/kubernetes/pkg/kubelet/cm/devicemanager" "k8s.io/kubernetes/pkg/kubelet/config" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" evictionapi "k8s.io/kubernetes/pkg/kubelet/eviction/api" @@ -103,12 +105,6 @@ type ContainerManager interface { // registration. GetPluginRegistrationHandler() cache.PluginHandler - // GetDevices returns information about the devices assigned to pods and containers - GetDevices(podUID, containerName string) []*podresourcesapi.ContainerDevices - - // GetCPUs returns information about the cpus assigned to pods and containers - GetCPUs(podUID, containerName string) []int64 - // ShouldResetExtendedResourceCapacity returns whether or not the extended resources should be zeroed, // due to node recreation. ShouldResetExtendedResourceCapacity() bool @@ -116,8 +112,9 @@ type ContainerManager interface { // GetAllocateResourcesPodAdmitHandler returns an instance of a PodAdmitHandler responsible for allocating pod resources. GetAllocateResourcesPodAdmitHandler() lifecycle.PodAdmitHandler - // UpdateAllocatedDevices frees any Devices that are bound to terminated pods. - UpdateAllocatedDevices() + // Implements the podresources Provider API for CPUs and Devices + podresources.CPUsProvider + podresources.DevicesProvider } type NodeConfig struct { @@ -191,3 +188,39 @@ func ParseQOSReserved(m map[string]string) (*map[v1.ResourceName]int64, error) { } return &reservations, nil } + +func containerDevicesFromResourceDeviceInstances(devs devicemanager.ResourceDeviceInstances) []*podresourcesapi.ContainerDevices { + var respDevs []*podresourcesapi.ContainerDevices + + for resourceName, resourceDevs := range devs { + for devID, dev := range resourceDevs { + topo := dev.GetTopology() + if topo == nil { + // Some device plugin do not report the topology information. + // This is legal, so we report the devices anyway, + // let the client decide what to do. + respDevs = append(respDevs, &podresourcesapi.ContainerDevices{ + ResourceName: resourceName, + DeviceIds: []string{devID}, + }) + continue + } + + for _, node := range topo.GetNodes() { + respDevs = append(respDevs, &podresourcesapi.ContainerDevices{ + ResourceName: resourceName, + DeviceIds: []string{devID}, + Topology: &podresourcesapi.TopologyInfo{ + Nodes: []*podresourcesapi.NUMANode{ + { + ID: node.GetID(), + }, + }, + }, + }) + } + } + } + + return respDevs +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go index e6e16ace516f..99ddd910189a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go @@ -38,6 +38,7 @@ import ( utilio "k8s.io/utils/io" utilpath "k8s.io/utils/path" + libcontainerdevices "github.com/opencontainers/runc/libcontainer/devices" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" utilerrors "k8s.io/apimachinery/pkg/util/errors" @@ -195,11 +196,11 @@ func validateSystemRequirements(mountUtil mount.Interface) (features, error) { // CPU cgroup is required and so it expected to be mounted at this point. periodExists, err := utilpath.Exists(utilpath.CheckFollowSymlink, path.Join(cpuMountPoint, "cpu.cfs_period_us")) if err != nil { - klog.Errorf("failed to detect if CPU cgroup cpu.cfs_period_us is available - %v", err) + klog.ErrorS(err, "Failed to detect if CPU cgroup cpu.cfs_period_us is available") } quotaExists, err := utilpath.Exists(utilpath.CheckFollowSymlink, path.Join(cpuMountPoint, "cpu.cfs_quota_us")) if err != nil { - klog.Errorf("failed to detect if CPU cgroup cpu.cfs_quota_us is available - %v", err) + klog.ErrorS(err, "Failed to detect if CPU cgroup cpu.cfs_quota_us is available") } if quotaExists && periodExists { f.cpuHardcapping = true @@ -222,7 +223,7 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I swapData, err := ioutil.ReadFile(swapFile) if err != nil { if os.IsNotExist(err) { - klog.Warningf("file %v does not exist, assuming that swap is disabled", swapFile) + klog.InfoS("File does not exist, assuming that swap is disabled", "path", swapFile) } else { return nil, err } @@ -274,12 +275,12 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I if !cgroupManager.Exists(cgroupRoot) { return nil, fmt.Errorf("invalid configuration: cgroup-root %q doesn't exist", cgroupRoot) } - klog.Infof("container manager verified user specified cgroup-root exists: %v", cgroupRoot) + klog.InfoS("Container manager verified user specified cgroup-root exists", "cgroupRoot", cgroupRoot) // Include the top level cgroup for enforcing node allocatable into cgroup-root. // This way, all sub modules can avoid having to understand the concept of node allocatable. cgroupRoot = NewCgroupName(cgroupRoot, defaultNodeAllocatableCgroupName) } - klog.Infof("Creating Container Manager object based on Node Config: %+v", nodeConfig) + klog.InfoS("Creating Container Manager object based on Node Config", "nodeConfig", nodeConfig) qosContainerManager, err := NewQOSContainerManager(subsystems, cgroupRoot, nodeConfig, cgroupManager) if err != nil { @@ -310,12 +311,11 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I return nil, err } - klog.Infof("[topologymanager] Initializing Topology Manager with %s policy and %s-level scope", nodeConfig.ExperimentalTopologyManagerPolicy, nodeConfig.ExperimentalTopologyManagerScope) } else { cm.topologyManager = topologymanager.NewFakeManager() } - klog.Infof("Creating device plugin manager: %t", devicePluginEnabled) + klog.InfoS("Creating device plugin manager", "devicePluginEnabled", devicePluginEnabled) if devicePluginEnabled { cm.deviceManager, err = devicemanager.NewManagerImpl(machineInfo.Topology, cm.topologyManager) cm.topologyManager.AddHintProvider(cm.deviceManager) @@ -338,7 +338,7 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I cm.topologyManager, ) if err != nil { - klog.Errorf("failed to initialize cpu manager: %v", err) + klog.ErrorS(err, "Failed to initialize cpu manager") return nil, err } cm.topologyManager.AddHintProvider(cm.cpuManager) @@ -354,7 +354,7 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I cm.topologyManager, ) if err != nil { - klog.Errorf("failed to initialize memory manager: %v", err) + klog.ErrorS(err, "Failed to initialize memory manager") return nil, err } cm.topologyManager.AddHintProvider(cm.memoryManager) @@ -392,13 +392,13 @@ func createManager(containerName string) (cgroups.Manager, error) { Parent: "/", Name: containerName, Resources: &configs.Resources{ - Devices: []*configs.DeviceRule{ + Devices: []*libcontainerdevices.Rule{ { Type: 'a', Permissions: "rwm", Allow: true, - Minor: configs.Wildcard, - Major: configs.Wildcard, + Minor: libcontainerdevices.Wildcard, + Major: libcontainerdevices.Wildcard, }, }, SkipDevices: true, @@ -449,9 +449,9 @@ func setupKernelTunables(option KernelTunableBehavior) error { case KernelTunableError: errList = append(errList, fmt.Errorf("invalid kernel flag: %v, expected value: %v, actual value: %v", flag, expectedValue, val)) case KernelTunableWarn: - klog.V(2).Infof("Invalid kernel flag: %v, expected value: %v, actual value: %v", flag, expectedValue, val) + klog.V(2).InfoS("Invalid kernel flag", "flag", flag, "expectedValue", expectedValue, "actualValue", val) case KernelTunableModify: - klog.V(2).Infof("Updating kernel flag: %v, expected value: %v, actual value: %v", flag, expectedValue, val) + klog.V(2).InfoS("Updating kernel flag", "flag", flag, "expectedValue", expectedValue, "actualValue", val) err = sysctl.SetSysctl(flag, expectedValue) if err != nil { errList = append(errList, err) @@ -500,13 +500,13 @@ func (cm *containerManagerImpl) setupNode(activePods ActivePodsFunc) error { // Check the cgroup for docker periodically, so kubelet can serve stats for the docker runtime. // TODO(KEP#866): remove special processing for CRI "docker" enablement cm.periodicTasks = append(cm.periodicTasks, func() { - klog.V(4).Infof("[ContainerManager]: Adding periodic tasks for docker CRI integration") + klog.V(4).InfoS("Adding periodic tasks for docker CRI integration") cont, err := getContainerNameForProcess(dockerProcessName, dockerPidFile) if err != nil { - klog.Error(err) + klog.ErrorS(err, "Failed to get container name for process") return } - klog.V(2).Infof("[ContainerManager]: Discovered runtime cgroups name: %s", cont) + klog.V(2).InfoS("Discovered runtime cgroup name", "cgroupName", cont) cm.Lock() defer cm.Unlock() cm.RuntimeCgroupsName = cont @@ -544,12 +544,12 @@ func (cm *containerManagerImpl) setupNode(activePods ActivePodsFunc) error { } else { cm.periodicTasks = append(cm.periodicTasks, func() { if err := ensureProcessInContainerWithOOMScore(os.Getpid(), qos.KubeletOOMScoreAdj, nil); err != nil { - klog.Error(err) + klog.ErrorS(err, "Failed to ensure process in container with oom score") return } cont, err := getContainer(os.Getpid()) if err != nil { - klog.Errorf("failed to find cgroups of kubelet - %v", err) + klog.ErrorS(err, "Failed to find cgroups of kubelet") return } cm.Lock() @@ -675,7 +675,7 @@ func (cm *containerManagerImpl) Start(node *v1.Node, for _, cont := range cm.systemContainers { if cont.ensureStateFunc != nil { if err := cont.ensureStateFunc(cont.manager); err != nil { - klog.Warningf("[ContainerManager] Failed to ensure state of %q: %v", cont.name, err) + klog.InfoS("Failed to ensure state", "containerName", cont.name, "err", err) } } } @@ -825,12 +825,12 @@ func isProcessRunningInHost(pid int) (bool, error) { if err != nil { return false, fmt.Errorf("failed to find pid namespace of init process") } - klog.V(10).Infof("init pid ns is %q", initPidNs) + klog.V(10).InfoS("Found init PID namespace", "namespace", initPidNs) processPidNs, err := os.Readlink(fmt.Sprintf("/proc/%d/ns/pid", pid)) if err != nil { return false, fmt.Errorf("failed to find pid namespace of process %q", pid) } - klog.V(10).Infof("Pid %d pid ns is %q", pid, processPidNs) + klog.V(10).InfoS("Process info", "pid", pid, "namespace", processPidNs) return initPidNs == processPidNs, nil } @@ -872,7 +872,7 @@ func getPidsForProcess(name, pidFile string) ([]int, error) { // Return error from getPidFromPidFile since that should have worked // and is the real source of the problem. - klog.V(4).Infof("unable to get pid from %s: %v", pidFile, err) + klog.V(4).InfoS("Unable to get pid from file", "path", pidFile, "err", err) return []int{}, err } @@ -912,7 +912,7 @@ func ensureProcessInContainerWithOOMScore(pid int, oomScoreAdj int, manager cgro return err } else if !runningInHost { // Process is running inside a container. Don't touch that. - klog.V(2).Infof("pid %d is not running in the host namespaces", pid) + klog.V(2).InfoS("PID is not running in the host namespace", "pid", pid) return nil } @@ -941,9 +941,9 @@ func ensureProcessInContainerWithOOMScore(pid int, oomScoreAdj int, manager cgro // Also apply oom-score-adj to processes oomAdjuster := oom.NewOOMAdjuster() - klog.V(5).Infof("attempting to apply oom_score_adj of %d to pid %d", oomScoreAdj, pid) + klog.V(5).InfoS("Attempting to apply oom_score_adj to process", "oomScoreAdj", oomScoreAdj, "pid", pid) if err := oomAdjuster.ApplyOOMScoreAdj(pid, oomScoreAdj); err != nil { - klog.V(3).Infof("Failed to apply oom_score_adj %d for pid %d: %v", oomScoreAdj, pid, err) + klog.V(3).InfoS("Failed to apply oom_score_adj to process", "oomScoreAdj", oomScoreAdj, "pid", pid, "err", err) errs = append(errs, fmt.Errorf("failed to apply oom score %d to PID %d: %v", oomScoreAdj, pid, err)) } return utilerrors.NewAggregate(errs) @@ -991,10 +991,10 @@ func getContainer(pid int) (string, error) { // in addition, you would not get memory or cpu accounting for the runtime unless accounting was enabled on its unit (or globally). if systemd, found := cgs["name=systemd"]; found { if systemd != cpu { - klog.Warningf("CPUAccounting not enabled for pid: %d", pid) + klog.InfoS("CPUAccounting not enabled for process", "pid", pid) } if systemd != memory { - klog.Warningf("MemoryAccounting not enabled for pid: %d", pid) + klog.InfoS("MemoryAccounting not enabled for process", "pid", pid) } return systemd, nil } @@ -1034,7 +1034,7 @@ func ensureSystemCgroups(rootCgroupPath string, manager cgroups.Manager) error { return nil } - klog.Infof("Moving non-kernel processes: %v", pids) + klog.InfoS("Moving non-kernel processes", "pids", pids) for _, pid := range pids { err := manager.Apply(pid) if err != nil { @@ -1069,13 +1069,21 @@ func (cm *containerManagerImpl) GetDevicePluginResourceCapacity() (v1.ResourceLi } func (cm *containerManagerImpl) GetDevices(podUID, containerName string) []*podresourcesapi.ContainerDevices { - return cm.deviceManager.GetDevices(podUID, containerName) + return containerDevicesFromResourceDeviceInstances(cm.deviceManager.GetDevices(podUID, containerName)) +} + +func (cm *containerManagerImpl) GetAllocatableDevices() []*podresourcesapi.ContainerDevices { + return containerDevicesFromResourceDeviceInstances(cm.deviceManager.GetAllocatableDevices()) } func (cm *containerManagerImpl) GetCPUs(podUID, containerName string) []int64 { return cm.cpuManager.GetCPUs(podUID, containerName).ToSliceNoSortInt64() } +func (cm *containerManagerImpl) GetAllocatableCPUs() []int64 { + return cm.cpuManager.GetAllocatableCPUs().ToSliceNoSortInt64() +} + func (cm *containerManagerImpl) ShouldResetExtendedResourceCapacity() bool { return cm.deviceManager.ShouldResetExtendedResourceCapacity() } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_stub.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_stub.go index ac4ceee2c56e..8988acb21f0d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_stub.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_stub.go @@ -36,12 +36,13 @@ import ( type containerManagerStub struct { shouldResetExtendedResourceCapacity bool + extendedPluginResources v1.ResourceList } var _ ContainerManager = &containerManagerStub{} func (cm *containerManagerStub) Start(_ *v1.Node, _ ActivePodsFunc, _ config.SourcesReady, _ status.PodStatusProvider, _ internalapi.RuntimeService) error { - klog.V(2).Infof("Starting stub container manager") + klog.V(2).InfoS("Starting stub container manager") return nil } @@ -87,7 +88,7 @@ func (cm *containerManagerStub) GetPluginRegistrationHandler() cache.PluginHandl } func (cm *containerManagerStub) GetDevicePluginResourceCapacity() (v1.ResourceList, v1.ResourceList, []string) { - return nil, nil, []string{} + return cm.extendedPluginResources, cm.extendedPluginResources, []string{} } func (cm *containerManagerStub) NewPodContainerManager() PodContainerManager { @@ -114,6 +115,10 @@ func (cm *containerManagerStub) GetDevices(_, _ string) []*podresourcesapi.Conta return nil } +func (cm *containerManagerStub) GetAllocatableDevices() []*podresourcesapi.ContainerDevices { + return nil +} + func (cm *containerManagerStub) ShouldResetExtendedResourceCapacity() bool { return cm.shouldResetExtendedResourceCapacity } @@ -130,6 +135,10 @@ func (cm *containerManagerStub) GetCPUs(_, _ string) []int64 { return nil } +func (cm *containerManagerStub) GetAllocatableCPUs() []int64 { + return nil +} + func NewStubContainerManager() ContainerManager { return &containerManagerStub{shouldResetExtendedResourceCapacity: false} } @@ -137,3 +146,10 @@ func NewStubContainerManager() ContainerManager { func NewStubContainerManagerWithExtendedResource(shouldResetExtendedResourceCapacity bool) ContainerManager { return &containerManagerStub{shouldResetExtendedResourceCapacity: shouldResetExtendedResourceCapacity} } + +func NewStubContainerManagerWithDevicePluginResource(extendedPluginResources v1.ResourceList) ContainerManager { + return &containerManagerStub{ + shouldResetExtendedResourceCapacity: false, + extendedPluginResources: extendedPluginResources, + } +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_windows.go index c3d07f270c30..3b1cf9430efc 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_windows.go @@ -73,7 +73,7 @@ func (cm *containerManagerImpl) Start(node *v1.Node, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, runtimeService internalapi.RuntimeService) error { - klog.V(2).Infof("Starting Windows container manager") + klog.V(2).InfoS("Starting Windows container manager") if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.LocalStorageCapacityIsolation) { rootfs, err := cm.cadvisorInterface.RootFsInfo() @@ -112,7 +112,7 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I cm.topologyManager = topologymanager.NewFakeManager() - klog.Infof("Creating device plugin manager: %t", devicePluginEnabled) + klog.InfoS("Creating device plugin manager", "devicePluginEnabled", devicePluginEnabled) if devicePluginEnabled { cm.deviceManager, err = devicemanager.NewManagerImpl(nil, cm.topologyManager) cm.topologyManager.AddHintProvider(cm.deviceManager) @@ -217,7 +217,11 @@ func (cm *containerManagerImpl) GetPodCgroupRoot() string { } func (cm *containerManagerImpl) GetDevices(podUID, containerName string) []*podresourcesapi.ContainerDevices { - return cm.deviceManager.GetDevices(podUID, containerName) + return containerDevicesFromResourceDeviceInstances(cm.deviceManager.GetDevices(podUID, containerName)) +} + +func (cm *containerManagerImpl) GetAllocatableDevices() []*podresourcesapi.ContainerDevices { + return nil } func (cm *containerManagerImpl) ShouldResetExtendedResourceCapacity() bool { @@ -235,3 +239,7 @@ func (cm *containerManagerImpl) UpdateAllocatedDevices() { func (cm *containerManagerImpl) GetCPUs(_, _ string) []int64 { return nil } + +func (cm *containerManagerImpl) GetAllocatableCPUs() []int64 { + return nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go index f646f80811a2..cb4b9807529f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go @@ -160,7 +160,7 @@ func takeByTopology(topo *topology.CPUTopology, availableCPUs cpuset.CPUSet, num // least a socket's-worth of CPUs. if acc.needs(acc.topo.CPUsPerSocket()) { for _, s := range acc.freeSockets() { - klog.V(4).Infof("[cpumanager] takeByTopology: claiming socket [%d]", s) + klog.V(4).InfoS("takeByTopology: claiming socket", "socket", s) acc.take(acc.details.CPUsInSockets(s)) if acc.isSatisfied() { return acc.result, nil @@ -175,7 +175,7 @@ func takeByTopology(topo *topology.CPUTopology, availableCPUs cpuset.CPUSet, num // a core's-worth of CPUs. if acc.needs(acc.topo.CPUsPerCore()) { for _, c := range acc.freeCores() { - klog.V(4).Infof("[cpumanager] takeByTopology: claiming core [%d]", c) + klog.V(4).InfoS("takeByTopology: claiming core", "core", c) acc.take(acc.details.CPUsInCores(c)) if acc.isSatisfied() { return acc.result, nil @@ -190,7 +190,7 @@ func takeByTopology(topo *topology.CPUTopology, availableCPUs cpuset.CPUSet, num // on the same sockets as the whole cores we have already taken in this // allocation. for _, c := range acc.freeCPUs() { - klog.V(4).Infof("[cpumanager] takeByTopology: claiming CPU [%d]", c) + klog.V(4).InfoS("takeByTopology: claiming CPU", "cpu", c) if acc.needs(1) { acc.take(cpuset.NewCPUSet(c)) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go index c0d0f1aa69b9..5a6e5082f15c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go @@ -85,6 +85,9 @@ type Manager interface { // and is consulted to achieve NUMA aware resource alignment per Pod // among this and other resource controllers. GetPodTopologyHints(pod *v1.Pod) map[string][]topologymanager.TopologyHint + + // GetAllocatableCPUs returns the assignable (not allocated) CPUs + GetAllocatableCPUs() cpuset.CPUSet } type manager struct { @@ -124,6 +127,9 @@ type manager struct { // stateFileDirectory holds the directory where the state file for checkpoints is held. stateFileDirectory string + + // allocatableCPUs is the set of online CPUs as reported by the system + allocatableCPUs cpuset.CPUSet } var _ Manager = &manager{} @@ -149,7 +155,8 @@ func NewManager(cpuPolicyName string, reconcilePeriod time.Duration, machineInfo if err != nil { return nil, err } - klog.Infof("[cpumanager] detected CPU topology: %v", topo) + klog.InfoS("Detected CPU topology", "topology", topo) + reservedCPUs, ok := nodeAllocatableReservation[v1.ResourceCPU] if !ok { // The static policy cannot initialize without this information. @@ -189,8 +196,8 @@ func NewManager(cpuPolicyName string, reconcilePeriod time.Duration, machineInfo } func (m *manager) Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, containerRuntime runtimeService, initialContainers containermap.ContainerMap) error { - klog.Infof("[cpumanager] starting with %s policy", m.policy.Name()) - klog.Infof("[cpumanager] reconciling every %v", m.reconcilePeriod) + klog.InfoS("Starting CPU manager", "policy", m.policy.Name()) + klog.InfoS("Reconciling", "reconcilePeriod", m.reconcilePeriod) m.sourcesReady = sourcesReady m.activePods = activePods m.podStatusProvider = podStatusProvider @@ -199,17 +206,19 @@ func (m *manager) Start(activePods ActivePodsFunc, sourcesReady config.SourcesRe stateImpl, err := state.NewCheckpointState(m.stateFileDirectory, cpuManagerStateFileName, m.policy.Name(), m.containerMap) if err != nil { - klog.Errorf("[cpumanager] could not initialize checkpoint manager: %v, please drain node and remove policy state file", err) + klog.ErrorS(err, "Could not initialize checkpoint manager, please drain node and remove policy state file") return err } m.state = stateImpl err = m.policy.Start(m.state) if err != nil { - klog.Errorf("[cpumanager] policy start error: %v", err) + klog.ErrorS(err, "Policy start error") return err } + m.allocatableCPUs = m.policy.GetAllocatableCPUs(m.state) + if m.policy.Name() == string(PolicyNone) { return nil } @@ -229,7 +238,7 @@ func (m *manager) Allocate(p *v1.Pod, c *v1.Container) error { // Call down into the policy to assign this container CPUs if required. err := m.policy.Allocate(m.state, p, c) if err != nil { - klog.Errorf("[cpumanager] Allocate error: %v", err) + klog.ErrorS(err, "Allocate error") return err } @@ -248,7 +257,7 @@ func (m *manager) RemoveContainer(containerID string) error { err := m.policyRemoveContainerByID(containerID) if err != nil { - klog.Errorf("[cpumanager] RemoveContainer error: %v", err) + klog.ErrorS(err, "RemoveContainer error") return err } @@ -296,6 +305,10 @@ func (m *manager) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymanager. return m.policy.GetPodTopologyHints(m.state, pod) } +func (m *manager) GetAllocatableCPUs() cpuset.CPUSet { + return m.allocatableCPUs.Clone() +} + type reconciledContainer struct { podName string containerName string @@ -335,10 +348,10 @@ func (m *manager) removeStaleState() { for podUID := range assignments { for containerName := range assignments[podUID] { if _, ok := activeContainers[podUID][containerName]; !ok { - klog.Errorf("[cpumanager] removeStaleState: removing (pod %s, container: %s)", podUID, containerName) + klog.ErrorS(nil, "RemoveStaleState: removing container", "podUID", podUID, "containerName", containerName) err := m.policyRemoveContainerByRef(podUID, containerName) if err != nil { - klog.Errorf("[cpumanager] removeStaleState: failed to remove (pod %s, container %s), error: %v)", podUID, containerName, err) + klog.ErrorS(err, "RemoveStaleState: failed to remove container", "podUID", podUID, "containerName", containerName) } } } @@ -353,7 +366,7 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec for _, pod := range m.activePods() { pstatus, ok := m.podStatusProvider.GetPodStatus(pod.UID) if !ok { - klog.Warningf("[cpumanager] reconcileState: skipping pod; status not found (pod: %s)", pod.Name) + klog.InfoS("ReconcileState: skipping pod; status not found", "pod", klog.KObj(pod)) failure = append(failure, reconciledContainer{pod.Name, "", ""}) continue } @@ -363,21 +376,21 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec for _, container := range allContainers { containerID, err := findContainerIDByName(&pstatus, container.Name) if err != nil { - klog.Warningf("[cpumanager] reconcileState: skipping container; ID not found in pod status (pod: %s, container: %s, error: %v)", pod.Name, container.Name, err) + klog.InfoS("ReconcileState: skipping container; ID not found in pod status", "pod", klog.KObj(pod), "containerName", container.Name, "err", err) failure = append(failure, reconciledContainer{pod.Name, container.Name, ""}) continue } cstatus, err := findContainerStatusByName(&pstatus, container.Name) if err != nil { - klog.Warningf("[cpumanager] reconcileState: skipping container; container status not found in pod status (pod: %s, container: %s, error: %v)", pod.Name, container.Name, err) + klog.InfoS("ReconcileState: skipping container; container status not found in pod status", "pod", klog.KObj(pod), "containerName", container.Name, "err", err) failure = append(failure, reconciledContainer{pod.Name, container.Name, ""}) continue } if cstatus.State.Waiting != nil || (cstatus.State.Waiting == nil && cstatus.State.Running == nil && cstatus.State.Terminated == nil) { - klog.Warningf("[cpumanager] reconcileState: skipping container; container still in the waiting state (pod: %s, container: %s, error: %v)", pod.Name, container.Name, err) + klog.InfoS("ReconcileState: skipping container; container still in the waiting state", "pod", klog.KObj(pod), "containerName", container.Name, "err", err) failure = append(failure, reconciledContainer{pod.Name, container.Name, ""}) continue } @@ -391,7 +404,7 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec // was allocated. _, _, err := m.containerMap.GetContainerRef(containerID) if err == nil { - klog.Warningf("[cpumanager] reconcileState: ignoring terminated container (pod: %s, container id: %s)", pod.Name, containerID) + klog.InfoS("ReconcileState: ignoring terminated container", "pod", klog.KObj(pod), "containerID", containerID) } m.Unlock() continue @@ -406,15 +419,15 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec cset := m.state.GetCPUSetOrDefault(string(pod.UID), container.Name) if cset.IsEmpty() { // NOTE: This should not happen outside of tests. - klog.Infof("[cpumanager] reconcileState: skipping container; assigned cpuset is empty (pod: %s, container: %s)", pod.Name, container.Name) + klog.InfoS("ReconcileState: skipping container; assigned cpuset is empty", "pod", klog.KObj(pod), "containerName", container.Name) failure = append(failure, reconciledContainer{pod.Name, container.Name, containerID}) continue } - klog.V(4).Infof("[cpumanager] reconcileState: updating container (pod: %s, container: %s, container id: %s, cpuset: \"%v\")", pod.Name, container.Name, containerID, cset) + klog.V(4).InfoS("ReconcileState: updating container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID, "cpuSet", cset) err = m.updateContainerCPUSet(containerID, cset) if err != nil { - klog.Errorf("[cpumanager] reconcileState: failed to update container (pod: %s, container: %s, container id: %s, cpuset: \"%v\", error: %v)", pod.Name, container.Name, containerID, cset, err) + klog.ErrorS(err, "ReconcileState: failed to update container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID, "cpuSet", cset) failure = append(failure, reconciledContainer{pod.Name, container.Name, containerID}) continue } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/fake_cpu_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/fake_cpu_manager.go index 478534b1c1c0..2c38b52b3748 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/fake_cpu_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/fake_cpu_manager.go @@ -32,36 +32,36 @@ type fakeManager struct { } func (m *fakeManager) Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, containerRuntime runtimeService, initialContainers containermap.ContainerMap) error { - klog.Info("[fake cpumanager] Start()") + klog.InfoS("Start()") return nil } func (m *fakeManager) Policy() Policy { - klog.Info("[fake cpumanager] Policy()") + klog.InfoS("Policy()") return NewNonePolicy() } func (m *fakeManager) Allocate(pod *v1.Pod, container *v1.Container) error { - klog.Infof("[fake cpumanager] Allocate (pod: %s, container: %s", pod.Name, container.Name) + klog.InfoS("Allocate", "pod", klog.KObj(pod), "containerName", container.Name) return nil } func (m *fakeManager) AddContainer(pod *v1.Pod, container *v1.Container, containerID string) { - klog.Infof("[fake cpumanager] AddContainer (pod: %s, container: %s, container id: %s)", pod.Name, container.Name, containerID) + klog.InfoS("AddContainer", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID) } func (m *fakeManager) RemoveContainer(containerID string) error { - klog.Infof("[fake cpumanager] RemoveContainer (container id: %s)", containerID) + klog.InfoS("RemoveContainer", "containerID", containerID) return nil } func (m *fakeManager) GetTopologyHints(pod *v1.Pod, container *v1.Container) map[string][]topologymanager.TopologyHint { - klog.Infof("[fake cpumanager] Get Container Topology Hints") + klog.InfoS("Get container topology hints") return map[string][]topologymanager.TopologyHint{} } func (m *fakeManager) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymanager.TopologyHint { - klog.Infof("[fake cpumanager] Get Pod Topology Hints") + klog.InfoS("Get pod topology hints") return map[string][]topologymanager.TopologyHint{} } @@ -70,7 +70,12 @@ func (m *fakeManager) State() state.Reader { } func (m *fakeManager) GetCPUs(podUID, containerName string) cpuset.CPUSet { - klog.Infof("[fake cpumanager] GetCPUs(podUID: %s, containerName: %s)", podUID, containerName) + klog.InfoS("GetCPUs", "podUID", podUID, "containerName", containerName) + return cpuset.CPUSet{} +} + +func (m *fakeManager) GetAllocatableCPUs() cpuset.CPUSet { + klog.InfoS("Get Allocatable CPUs") return cpuset.CPUSet{} } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy.go index 54565e5023c0..dd5d977a1201 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy.go @@ -19,6 +19,7 @@ package cpumanager import ( "k8s.io/api/core/v1" "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state" + "k8s.io/kubernetes/pkg/kubelet/cm/cpuset" "k8s.io/kubernetes/pkg/kubelet/cm/topologymanager" ) @@ -38,4 +39,6 @@ type Policy interface { // and is consulted to achieve NUMA aware resource alignment per Pod // among this and other resource controllers. GetPodTopologyHints(s state.State, pod *v1.Pod) map[string][]topologymanager.TopologyHint + // GetAllocatableCPUs returns the assignable (not allocated) CPUs + GetAllocatableCPUs(m state.State) cpuset.CPUSet } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_none.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_none.go index abc1c0632b14..345d4c14d6d1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_none.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_none.go @@ -20,6 +20,7 @@ import ( "k8s.io/api/core/v1" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state" + "k8s.io/kubernetes/pkg/kubelet/cm/cpuset" "k8s.io/kubernetes/pkg/kubelet/cm/topologymanager" ) @@ -30,7 +31,7 @@ var _ Policy = &nonePolicy{} // PolicyNone name of none policy const PolicyNone policyName = "none" -// NewNonePolicy returns a cupset manager policy that does nothing +// NewNonePolicy returns a cpuset manager policy that does nothing func NewNonePolicy() Policy { return &nonePolicy{} } @@ -40,7 +41,7 @@ func (p *nonePolicy) Name() string { } func (p *nonePolicy) Start(s state.State) error { - klog.Info("[cpumanager] none policy: Start") + klog.InfoS("None policy: Start") return nil } @@ -59,3 +60,12 @@ func (p *nonePolicy) GetTopologyHints(s state.State, pod *v1.Pod, container *v1. func (p *nonePolicy) GetPodTopologyHints(s state.State, pod *v1.Pod) map[string][]topologymanager.TopologyHint { return nil } + +// Assignable CPUs are the ones that can be exclusively allocated to pods that meet the exclusivity requirement +// (ie guaranteed QoS class and integral CPU request). +// Assignability of CPUs as a concept is only applicable in case of static policy i.e. scenarios where workloads +// CAN get exclusive access to core(s). +// Hence, we return empty set here: no cpus are assignable according to above definition with this policy. +func (p *nonePolicy) GetAllocatableCPUs(m state.State) cpuset.CPUSet { + return cpuset.NewCPUSet() +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_static.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_static.go index c3309ef72805..ec25a15a3c22 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_static.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_static.go @@ -27,7 +27,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/cm/cpuset" "k8s.io/kubernetes/pkg/kubelet/cm/topologymanager" "k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/bitmask" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) // PolicyStatic is the name of the static policy @@ -107,7 +106,7 @@ func NewStaticPolicy(topology *topology.CPUTopology, numReservedCPUs int, reserv return nil, err } - klog.Infof("[cpumanager] reserved %d CPUs (\"%s\") not available for exclusive assignment", reserved.Size(), reserved) + klog.InfoS("Reserved CPUs not available for exclusive assignment", "reservedSize", reserved.Size(), "reserved", reserved) return &staticPolicy{ topology: topology, @@ -123,7 +122,7 @@ func (p *staticPolicy) Name() string { func (p *staticPolicy) Start(s state.State) error { if err := p.validateState(s); err != nil { - klog.Errorf("[cpumanager] static policy invalid state: %v, please drain node and remove policy state file", err) + klog.ErrorS(err, "Static policy invalid state, please drain node and remove policy state file") return err } return nil @@ -187,8 +186,8 @@ func (p *staticPolicy) validateState(s state.State) error { return nil } -// assignableCPUs returns the set of unassigned CPUs minus the reserved set. -func (p *staticPolicy) assignableCPUs(s state.State) cpuset.CPUSet { +// GetAllocatableCPUs returns the set of unassigned CPUs minus the reserved set. +func (p *staticPolicy) GetAllocatableCPUs(s state.State) cpuset.CPUSet { return s.GetDefaultCPUSet().Difference(p.reserved) } @@ -218,23 +217,23 @@ func (p *staticPolicy) updateCPUsToReuse(pod *v1.Pod, container *v1.Container, c func (p *staticPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Container) error { if numCPUs := p.guaranteedCPUs(pod, container); numCPUs != 0 { - klog.Infof("[cpumanager] static policy: Allocate (pod: %s, container: %s)", format.Pod(pod), container.Name) + klog.InfoS("Static policy: Allocate", "pod", klog.KObj(pod), "containerName", container.Name) // container belongs in an exclusively allocated pool if cpuset, ok := s.GetCPUSet(string(pod.UID), container.Name); ok { p.updateCPUsToReuse(pod, container, cpuset) - klog.Infof("[cpumanager] static policy: container already present in state, skipping (pod: %s, container: %s)", format.Pod(pod), container.Name) + klog.InfoS("Static policy: container already present in state, skipping", "pod", klog.KObj(pod), "containerName", container.Name) return nil } // Call Topology Manager to get the aligned socket affinity across all hint providers. hint := p.affinity.GetAffinity(string(pod.UID), container.Name) - klog.Infof("[cpumanager] Pod %v, Container %v Topology Affinity is: %v", format.Pod(pod), container.Name, hint) + klog.InfoS("Topology Affinity", "pod", klog.KObj(pod), "containerName", container.Name, "affinity", hint) // Allocate CPUs according to the NUMA affinity contained in the hint. cpuset, err := p.allocateCPUs(s, numCPUs, hint.NUMANodeAffinity, p.cpusToReuse[string(pod.UID)]) if err != nil { - klog.Errorf("[cpumanager] unable to allocate %d CPUs (pod: %s, container: %s, error: %v)", numCPUs, format.Pod(pod), container.Name, err) + klog.ErrorS(err, "Unable to allocate CPUs", "pod", klog.KObj(pod), "containerName", container.Name, "numCPUs", numCPUs) return err } s.SetCPUSet(string(pod.UID), container.Name, cpuset) @@ -246,7 +245,7 @@ func (p *staticPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Contai } func (p *staticPolicy) RemoveContainer(s state.State, podUID string, containerName string) error { - klog.Infof("[cpumanager] static policy: RemoveContainer (pod: %s, container: %s)", podUID, containerName) + klog.InfoS("Static policy: RemoveContainer", "podUID", podUID, "containerName", containerName) if toRelease, ok := s.GetCPUSet(podUID, containerName); ok { s.Delete(podUID, containerName) // Mutate the shared pool, adding released cpus. @@ -256,16 +255,16 @@ func (p *staticPolicy) RemoveContainer(s state.State, podUID string, containerNa } func (p *staticPolicy) allocateCPUs(s state.State, numCPUs int, numaAffinity bitmask.BitMask, reusableCPUs cpuset.CPUSet) (cpuset.CPUSet, error) { - klog.Infof("[cpumanager] allocateCpus: (numCPUs: %d, socket: %v)", numCPUs, numaAffinity) + klog.InfoS("AllocateCPUs", "numCPUs", numCPUs, "socket", numaAffinity) - assignableCPUs := p.assignableCPUs(s).Union(reusableCPUs) + allocatableCPUs := p.GetAllocatableCPUs(s).Union(reusableCPUs) // If there are aligned CPUs in numaAffinity, attempt to take those first. result := cpuset.NewCPUSet() if numaAffinity != nil { alignedCPUs := cpuset.NewCPUSet() for _, numaNodeID := range numaAffinity.GetBits() { - alignedCPUs = alignedCPUs.Union(assignableCPUs.Intersection(p.topology.CPUDetails.CPUsInNUMANodes(numaNodeID))) + alignedCPUs = alignedCPUs.Union(allocatableCPUs.Intersection(p.topology.CPUDetails.CPUsInNUMANodes(numaNodeID))) } numAlignedToAlloc := alignedCPUs.Size() @@ -282,7 +281,7 @@ func (p *staticPolicy) allocateCPUs(s state.State, numCPUs int, numaAffinity bit } // Get any remaining CPUs from what's leftover after attempting to grab aligned ones. - remainingCPUs, err := takeByTopology(p.topology, assignableCPUs.Difference(result), numCPUs-result.Size()) + remainingCPUs, err := takeByTopology(p.topology, allocatableCPUs.Difference(result), numCPUs-result.Size()) if err != nil { return cpuset.NewCPUSet(), err } @@ -291,7 +290,7 @@ func (p *staticPolicy) allocateCPUs(s state.State, numCPUs int, numaAffinity bit // Remove allocated CPUs from the shared CPUSet. s.SetDefaultCPUSet(s.GetDefaultCPUSet().Difference(result)) - klog.Infof("[cpumanager] allocateCPUs: returning \"%v\"", result) + klog.InfoS("AllocateCPUs", "result", result) return result, nil } @@ -353,7 +352,7 @@ func (p *staticPolicy) GetTopologyHints(s state.State, pod *v1.Pod, container *v // kubelet restart, for example. if allocated, exists := s.GetCPUSet(string(pod.UID), container.Name); exists { if allocated.Size() != requested { - klog.Errorf("[cpumanager] CPUs already allocated to (pod %v, container %v) with different number than request: requested: %d, allocated: %d", format.Pod(pod), container.Name, requested, allocated.Size()) + klog.ErrorS(nil, "CPUs already allocated to container with different number than request", "pod", klog.KObj(pod), "containerName", container.Name, "requestedSize", requested, "allocatedSize", allocated.Size()) // An empty list of hints will be treated as a preference that cannot be satisfied. // In definition of hints this is equal to: TopologyHint[NUMANodeAffinity: nil, Preferred: false]. // For all but the best-effort policy, the Topology Manager will throw a pod-admission error. @@ -361,14 +360,14 @@ func (p *staticPolicy) GetTopologyHints(s state.State, pod *v1.Pod, container *v string(v1.ResourceCPU): {}, } } - klog.Infof("[cpumanager] Regenerating TopologyHints for CPUs already allocated to (pod %v, container %v)", format.Pod(pod), container.Name) + klog.InfoS("Regenerating TopologyHints for CPUs already allocated", "pod", klog.KObj(pod), "containerName", container.Name) return map[string][]topologymanager.TopologyHint{ string(v1.ResourceCPU): p.generateCPUTopologyHints(allocated, cpuset.CPUSet{}, requested), } } // Get a list of available CPUs. - available := p.assignableCPUs(s) + available := p.GetAllocatableCPUs(s) // Get a list of reusable CPUs (e.g. CPUs reused from initContainers). // It should be an empty CPUSet for a newly created pod. @@ -376,7 +375,7 @@ func (p *staticPolicy) GetTopologyHints(s state.State, pod *v1.Pod, container *v // Generate hints. cpuHints := p.generateCPUTopologyHints(available, reusable, requested) - klog.Infof("[cpumanager] TopologyHints generated for pod '%v', container '%v': %v", format.Pod(pod), container.Name, cpuHints) + klog.InfoS("TopologyHints generated", "pod", klog.KObj(pod), "containerName", container.Name, "cpuHints", cpuHints) return map[string][]topologymanager.TopologyHint{ string(v1.ResourceCPU): cpuHints, @@ -403,7 +402,7 @@ func (p *staticPolicy) GetPodTopologyHints(s state.State, pod *v1.Pod) map[strin // kubelet restart, for example. if allocated, exists := s.GetCPUSet(string(pod.UID), container.Name); exists { if allocated.Size() != requestedByContainer { - klog.Errorf("[cpumanager] CPUs already allocated to (pod %v, container %v) with different number than request: requested: %d, allocated: %d", format.Pod(pod), container.Name, requestedByContainer, allocated.Size()) + klog.ErrorS(nil, "CPUs already allocated to container with different number than request", "pod", klog.KObj(pod), "containerName", container.Name, "allocatedSize", requested, "requestedByContainer", requestedByContainer, "allocatedSize", allocated.Size()) // An empty list of hints will be treated as a preference that cannot be satisfied. // In definition of hints this is equal to: TopologyHint[NUMANodeAffinity: nil, Preferred: false]. // For all but the best-effort policy, the Topology Manager will throw a pod-admission error. @@ -416,14 +415,14 @@ func (p *staticPolicy) GetPodTopologyHints(s state.State, pod *v1.Pod) map[strin } } if assignedCPUs.Size() == requested { - klog.Infof("[cpumanager] Regenerating TopologyHints for CPUs already allocated to pod %v", format.Pod(pod)) + klog.InfoS("Regenerating TopologyHints for CPUs already allocated", "pod", klog.KObj(pod)) return map[string][]topologymanager.TopologyHint{ string(v1.ResourceCPU): p.generateCPUTopologyHints(assignedCPUs, cpuset.CPUSet{}, requested), } } // Get a list of available CPUs. - available := p.assignableCPUs(s) + available := p.GetAllocatableCPUs(s) // Get a list of reusable CPUs (e.g. CPUs reused from initContainers). // It should be an empty CPUSet for a newly created pod. @@ -434,7 +433,7 @@ func (p *staticPolicy) GetPodTopologyHints(s state.State, pod *v1.Pod) map[strin // Generate hints. cpuHints := p.generateCPUTopologyHints(available, reusable, requested) - klog.Infof("[cpumanager] TopologyHints generated for pod '%v' : %v", format.Pod(pod), cpuHints) + klog.InfoS("TopologyHints generated", "pod", klog.KObj(pod), "cpuHints", cpuHints) return map[string][]topologymanager.TopologyHint{ string(v1.ResourceCPU): cpuHints, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_checkpoint.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_checkpoint.go index 951f9da7f929..f501c2bea302 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_checkpoint.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_checkpoint.go @@ -133,8 +133,8 @@ func (sc *stateCheckpoint) restoreState() error { sc.cache.SetDefaultCPUSet(tmpDefaultCPUSet) sc.cache.SetCPUAssignments(tmpAssignments) - klog.V(2).Info("[cpumanager] state checkpoint: restored state from checkpoint") - klog.V(2).Infof("[cpumanager] state checkpoint: defaultCPUSet: %s", tmpDefaultCPUSet.String()) + klog.V(2).InfoS("State checkpoint: restored state from checkpoint") + klog.V(2).InfoS("State checkpoint: defaultCPUSet", "defaultCpuSet", tmpDefaultCPUSet.String()) return nil } @@ -155,7 +155,7 @@ func (sc *stateCheckpoint) storeState() error { err := sc.checkpointManager.CreateCheckpoint(sc.checkpointName, checkpoint) if err != nil { - klog.Errorf("[cpumanager] could not save checkpoint: %v", err) + klog.ErrorS(err, "Failed to save checkpoint") return err } return nil @@ -201,7 +201,7 @@ func (sc *stateCheckpoint) SetCPUSet(podUID string, containerName string, cset c sc.cache.SetCPUSet(podUID, containerName, cset) err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } @@ -212,7 +212,7 @@ func (sc *stateCheckpoint) SetDefaultCPUSet(cset cpuset.CPUSet) { sc.cache.SetDefaultCPUSet(cset) err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } @@ -223,7 +223,7 @@ func (sc *stateCheckpoint) SetCPUAssignments(a ContainerCPUAssignments) { sc.cache.SetCPUAssignments(a) err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } @@ -234,7 +234,7 @@ func (sc *stateCheckpoint) Delete(podUID string, containerName string) { sc.cache.Delete(podUID, containerName) err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } @@ -245,6 +245,6 @@ func (sc *stateCheckpoint) ClearState() { sc.cache.ClearState() err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_mem.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_mem.go index 894a6ccccfca..f51423f18674 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_mem.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_mem.go @@ -33,7 +33,7 @@ var _ State = &stateMemory{} // NewMemoryState creates new State for keeping track of cpu/pod assignment func NewMemoryState() State { - klog.Infof("[cpumanager] initializing new in-memory state store") + klog.InfoS("Initialized new in-memory state store") return &stateMemory{ assignments: ContainerCPUAssignments{}, defaultCPUSet: cpuset.NewCPUSet(), @@ -77,7 +77,7 @@ func (s *stateMemory) SetCPUSet(podUID string, containerName string, cset cpuset } s.assignments[podUID][containerName] = cset - klog.Infof("[cpumanager] updated desired cpuset (pod: %s, container: %s, cpuset: \"%s\")", podUID, containerName, cset) + klog.InfoS("Updated desired CPUSet", "podUID", podUID, "containerName", containerName, "cpuSet", cset) } func (s *stateMemory) SetDefaultCPUSet(cset cpuset.CPUSet) { @@ -85,7 +85,7 @@ func (s *stateMemory) SetDefaultCPUSet(cset cpuset.CPUSet) { defer s.Unlock() s.defaultCPUSet = cset - klog.Infof("[cpumanager] updated default cpuset: \"%s\"", cset) + klog.InfoS("Updated default CPUSet", "cpuSet", cset) } func (s *stateMemory) SetCPUAssignments(a ContainerCPUAssignments) { @@ -93,7 +93,7 @@ func (s *stateMemory) SetCPUAssignments(a ContainerCPUAssignments) { defer s.Unlock() s.assignments = a.Clone() - klog.Infof("[cpumanager] updated cpuset assignments: \"%v\"", a) + klog.InfoS("Updated CPUSet assignments", "assignments", a) } func (s *stateMemory) Delete(podUID string, containerName string) { @@ -104,7 +104,7 @@ func (s *stateMemory) Delete(podUID string, containerName string) { if len(s.assignments[podUID]) == 0 { delete(s.assignments, podUID) } - klog.V(2).Infof("[cpumanager] deleted cpuset assignment (pod: %s, container: %s)", podUID, containerName) + klog.V(2).InfoS("Deleted CPUSet assignment", "podUID", podUID, "containerName", containerName) } func (s *stateMemory) ClearState() { @@ -113,5 +113,5 @@ func (s *stateMemory) ClearState() { s.defaultCPUSet = cpuset.CPUSet{} s.assignments = make(ContainerCPUAssignments) - klog.V(2).Infof("[cpumanager] cleared state") + klog.V(2).InfoS("Cleared state") } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/topology.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/topology.go index 1475f758959a..b397165d97e6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/topology.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/topology.go @@ -236,8 +236,7 @@ func Discover(machineInfo *cadvisorapi.MachineInfo) (*CPUTopology, error) { } } } else { - klog.Errorf("could not get unique coreID for socket: %d core %d threads: %v", - core.SocketID, core.Id, core.Threads) + klog.ErrorS(nil, "Could not get unique coreID for socket", "socket", core.SocketID, "core", core.Id, "threads", core.Threads) return nil, err } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpuset/cpuset.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpuset/cpuset.go index ad7ea27afa43..de72ba257569 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpuset/cpuset.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpuset/cpuset.go @@ -19,6 +19,7 @@ package cpuset import ( "bytes" "fmt" + "os" "reflect" "sort" "strconv" @@ -75,6 +76,15 @@ func NewCPUSet(cpus ...int) CPUSet { return b.Result() } +// NewCPUSet returns a new CPUSet containing the supplied elements, as slice of int64. +func NewCPUSetInt64(cpus ...int64) CPUSet { + b := NewBuilder() + for _, c := range cpus { + b.Add(int(c)) + } + return b.Result() +} + // Size returns the number of elements in this set. func (s CPUSet) Size() int { return len(s.elems) @@ -269,7 +279,8 @@ func (s CPUSet) String() string { func MustParse(s string) CPUSet { res, err := Parse(s) if err != nil { - klog.Fatalf("unable to parse [%s] as CPUSet: %v", s, err) + klog.ErrorS(err, "Failed to parse input as CPUSet", "input", s) + os.Exit(1) } return res } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/device_plugin_stub.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/device_plugin_stub.go index b4c6be04ded9..ef1ca4569e65 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/device_plugin_stub.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/device_plugin_stub.go @@ -139,8 +139,7 @@ func (m *Stub) Start() error { return lastDialErr } - klog.Infof("Starting to serve on %v", m.socket) - + klog.InfoS("Starting to serve on socket", "socket", m.socket) return nil } @@ -161,7 +160,7 @@ func (m *Stub) Stop() error { // GetInfo is the RPC which return pluginInfo func (m *Stub) GetInfo(ctx context.Context, req *watcherapi.InfoRequest) (*watcherapi.PluginInfo, error) { - klog.Info("GetInfo") + klog.InfoS("GetInfo") return &watcherapi.PluginInfo{ Type: watcherapi.DevicePlugin, Name: m.resourceName, @@ -175,7 +174,7 @@ func (m *Stub) NotifyRegistrationStatus(ctx context.Context, status *watcherapi. m.registrationStatus <- *status } if !status.PluginRegistered { - klog.Infof("Registration failed: %v", status.Error) + klog.InfoS("Registration failed", "err", status.Error) } return &watcherapi.RegistrationStatusResponse{}, nil } @@ -184,11 +183,11 @@ func (m *Stub) NotifyRegistrationStatus(ctx context.Context, status *watcherapi. func (m *Stub) Register(kubeletEndpoint, resourceName string, pluginSockDir string) error { if pluginSockDir != "" { if _, err := os.Stat(pluginSockDir + "DEPRECATION"); err == nil { - klog.Info("Deprecation file found. Skip registration.") + klog.InfoS("Deprecation file found. Skip registration") return nil } } - klog.Info("Deprecation file not found. Invoke registration") + klog.InfoS("Deprecation file not found. Invoke registration") ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() @@ -229,13 +228,13 @@ func (m *Stub) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) ( // PreStartContainer resets the devices received func (m *Stub) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error) { - klog.Infof("PreStartContainer, %+v", r) + klog.InfoS("PreStartContainer", "request", r) return &pluginapi.PreStartContainerResponse{}, nil } // ListAndWatch lists devices and update that list according to the Update call func (m *Stub) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error { - klog.Info("ListAndWatch") + klog.InfoS("ListAndWatch") s.Send(&pluginapi.ListAndWatchResponse{Devices: m.devs}) @@ -256,7 +255,7 @@ func (m *Stub) Update(devs []*pluginapi.Device) { // GetPreferredAllocation gets the preferred allocation from a set of available devices func (m *Stub) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error) { - klog.Infof("GetPreferredAllocation, %+v", r) + klog.InfoS("GetPreferredAllocation", "request", r) devs := make(map[string]pluginapi.Device) @@ -269,7 +268,7 @@ func (m *Stub) GetPreferredAllocation(ctx context.Context, r *pluginapi.Preferre // Allocate does a mock allocation func (m *Stub) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error) { - klog.Infof("Allocate, %+v", r) + klog.InfoS("Allocate", "request", r) devs := make(map[string]pluginapi.Device) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/endpoint.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/endpoint.go index eaef0df39aab..9ce1df284eb0 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/endpoint.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/endpoint.go @@ -60,7 +60,7 @@ type endpointImpl struct { func newEndpointImpl(socketPath, resourceName string, callback monitorCallback) (*endpointImpl, error) { client, c, err := dial(socketPath) if err != nil { - klog.Errorf("Can't create new endpoint with path %s err %v", socketPath, err) + klog.ErrorS(err, "Can't create new endpoint with socket path", "path", socketPath) return nil, err } @@ -96,7 +96,7 @@ func (e *endpointImpl) callback(resourceName string, devices []pluginapi.Device) func (e *endpointImpl) run() { stream, err := e.client.ListAndWatch(context.Background(), &pluginapi.Empty{}) if err != nil { - klog.Errorf(errListAndWatch, e.resourceName, err) + klog.ErrorS(err, "listAndWatch ended unexpectedly for device plugin", "resourceName", e.resourceName) return } @@ -104,12 +104,12 @@ func (e *endpointImpl) run() { for { response, err := stream.Recv() if err != nil { - klog.Errorf(errListAndWatch, e.resourceName, err) + klog.ErrorS(err, "listAndWatch ended unexpectedly for device plugin", "resourceName", e.resourceName) return } devs := response.Devices - klog.V(2).Infof("State pushed for device plugin %s", e.resourceName) + klog.V(2).InfoS("State pushed for device plugin", "resourceName", e.resourceName) var newDevs []pluginapi.Device for _, d := range devs { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go index 445cf34ddb8e..1708176fc9b4 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go @@ -37,7 +37,6 @@ import ( "k8s.io/apimachinery/pkg/util/sets" utilfeature "k8s.io/apiserver/pkg/util/feature" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1" - podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/kubelet/checkpointmanager" @@ -48,7 +47,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/metrics" "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" - "k8s.io/kubernetes/pkg/kubelet/util/format" schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/util/selinux" ) @@ -85,8 +83,8 @@ type ManagerImpl struct { // e.g. a new device is advertised, two old devices are deleted and a running device fails. callback monitorCallback - // allDevices is a map by resource name of all the devices currently registered to the device manager - allDevices map[string]map[string]pluginapi.Device + // allDevices holds all the devices currently registered to the device manager + allDevices ResourceDeviceInstances // healthyDevices contains all of the registered healthy resourceNames and their exported device IDs. healthyDevices map[string]sets.String @@ -135,7 +133,7 @@ func NewManagerImpl(topology []cadvisorapi.Node, topologyAffinityStore topologym } func newManagerImpl(socketPath string, topology []cadvisorapi.Node, topologyAffinityStore topologymanager.Store) (*ManagerImpl, error) { - klog.V(2).Infof("Creating Device Plugin manager at %s", socketPath) + klog.V(2).InfoS("Creating Device Plugin manager", "path", socketPath) if socketPath == "" || !filepath.IsAbs(socketPath) { return nil, fmt.Errorf(errBadSocket+" %s", socketPath) @@ -152,7 +150,7 @@ func newManagerImpl(socketPath string, topology []cadvisorapi.Node, topologyAffi socketname: file, socketdir: dir, - allDevices: make(map[string]map[string]pluginapi.Device), + allDevices: NewResourceDeviceInstances(), healthyDevices: make(map[string]sets.String), unhealthyDevices: make(map[string]sets.String), allocatedDevices: make(map[string]sets.String), @@ -191,7 +189,7 @@ func (m *ManagerImpl) genericDeviceUpdateCallback(resourceName string, devices [ } m.mutex.Unlock() if err := m.writeCheckpoint(); err != nil { - klog.Errorf("writing checkpoint encountered %v", err) + klog.ErrorS(err, "Writing checkpoint encountered") } } @@ -216,7 +214,7 @@ func (m *ManagerImpl) removeContents(dir string) error { // its a socket, on windows. stat, err := os.Lstat(filePath) if err != nil { - klog.Errorf("Failed to stat file %s: %v", filePath, err) + klog.ErrorS(err, "Failed to stat file", "path", filePath) continue } if stat.IsDir() { @@ -225,7 +223,7 @@ func (m *ManagerImpl) removeContents(dir string) error { err = os.RemoveAll(filePath) if err != nil { errs = append(errs, err) - klog.Errorf("Failed to remove file %s: %v", filePath, err) + klog.ErrorS(err, "Failed to remove file", "path", filePath) continue } } @@ -241,7 +239,7 @@ func (m *ManagerImpl) checkpointFile() string { // podDevices and allocatedDevices information from checkpointed state and // starts device plugin registration service. func (m *ManagerImpl) Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady) error { - klog.V(2).Infof("Starting Device Plugin manager") + klog.V(2).InfoS("Starting Device Plugin manager") m.activePods = activePods m.sourcesReady = sourcesReady @@ -249,7 +247,7 @@ func (m *ManagerImpl) Start(activePods ActivePodsFunc, sourcesReady config.Sourc // Loads in allocatedDevices information from disk. err := m.readCheckpoint() if err != nil { - klog.Warningf("Continue after failing to read checkpoint file. Device allocation info may NOT be up-to-date. Err: %v", err) + klog.InfoS("Continue after failing to read checkpoint file. Device allocation info may NOT be up-to-date", "err", err) } socketPath := filepath.Join(m.socketdir, m.socketname) @@ -258,19 +256,19 @@ func (m *ManagerImpl) Start(activePods ActivePodsFunc, sourcesReady config.Sourc } if selinux.SELinuxEnabled() { if err := selinux.SetFileLabel(m.socketdir, config.KubeletPluginsDirSELinuxLabel); err != nil { - klog.Warningf("Unprivileged containerized plugins might not work. Could not set selinux context on %s: %v", m.socketdir, err) + klog.InfoS("Unprivileged containerized plugins might not work. Could not set selinux context on socket dir", "path", m.socketdir, "err", err) } } // Removes all stale sockets in m.socketdir. Device plugins can monitor // this and use it as a signal to re-register with the new Kubelet. if err := m.removeContents(m.socketdir); err != nil { - klog.Errorf("Fail to clean up stale contents under %s: %v", m.socketdir, err) + klog.ErrorS(err, "Fail to clean up stale content under socket dir", "path", m.socketdir) } s, err := net.Listen("unix", socketPath) if err != nil { - klog.Errorf(errListenSocket+" %v", err) + klog.ErrorS(err, "Failed to listen to socket while starting device plugin registry") return err } @@ -283,7 +281,7 @@ func (m *ManagerImpl) Start(activePods ActivePodsFunc, sourcesReady config.Sourc m.server.Serve(s) }() - klog.V(2).Infof("Serving device plugin registration server on %q", socketPath) + klog.V(2).InfoS("Serving device plugin registration server on socket", "path", socketPath) return nil } @@ -291,10 +289,10 @@ func (m *ManagerImpl) Start(activePods ActivePodsFunc, sourcesReady config.Sourc // GetWatcherHandler returns the plugin handler func (m *ManagerImpl) GetWatcherHandler() cache.PluginHandler { if f, err := os.Create(m.socketdir + "DEPRECATION"); err != nil { - klog.Errorf("Failed to create deprecation file at %s", m.socketdir) + klog.ErrorS(err, "Failed to create deprecation file at socket dir", "path", m.socketdir) } else { f.Close() - klog.V(4).Infof("created deprecation file %s", f.Name()) + klog.V(4).InfoS("Created deprecation file", "path", f.Name()) } return cache.PluginHandler(m) @@ -302,7 +300,7 @@ func (m *ManagerImpl) GetWatcherHandler() cache.PluginHandler { // ValidatePlugin validates a plugin if the version is correct and the name has the format of an extended resource func (m *ManagerImpl) ValidatePlugin(pluginName string, endpoint string, versions []string) error { - klog.V(2).Infof("Got Plugin %s at endpoint %s with versions %v", pluginName, endpoint, versions) + klog.V(2).InfoS("Got Plugin at endpoint with versions", "plugin", pluginName, "endpoint", endpoint, "versions", versions) if !m.isVersionCompatibleWithPlugin(versions) { return fmt.Errorf("manager version, %s, is not among plugin supported versions %v", pluginapi.Version, versions) @@ -319,7 +317,7 @@ func (m *ManagerImpl) ValidatePlugin(pluginName string, endpoint string, version // TODO: Start the endpoint and wait for the First ListAndWatch call // before registering the plugin func (m *ManagerImpl) RegisterPlugin(pluginName string, endpoint string, versions []string) error { - klog.V(2).Infof("Registering Plugin %s at endpoint %s", pluginName, endpoint) + klog.V(2).InfoS("Registering plugin at endpoint", "plugin", pluginName, "endpoint", endpoint) e, err := newEndpointImpl(endpoint, pluginName, m.callback) if err != nil { @@ -413,7 +411,7 @@ func (m *ManagerImpl) UpdatePluginResources(node *schedulerframework.NodeInfo, a // Register registers a device plugin. func (m *ManagerImpl) Register(ctx context.Context, r *pluginapi.RegisterRequest) (*pluginapi.Empty, error) { - klog.Infof("Got registration request from device plugin with resource name %q", r.ResourceName) + klog.InfoS("Got registration request from device plugin with resource", "resourceName", r.ResourceName) metrics.DevicePluginRegistrationCount.WithLabelValues(r.ResourceName).Inc() var versionCompatible bool for _, v := range pluginapi.SupportedVersions { @@ -423,15 +421,15 @@ func (m *ManagerImpl) Register(ctx context.Context, r *pluginapi.RegisterRequest } } if !versionCompatible { - errorString := fmt.Sprintf(errUnsupportedVersion, r.Version, pluginapi.SupportedVersions) - klog.Infof("Bad registration request from device plugin with resource name %q: %s", r.ResourceName, errorString) - return &pluginapi.Empty{}, fmt.Errorf(errorString) + err := fmt.Errorf(errUnsupportedVersion, r.Version, pluginapi.SupportedVersions) + klog.InfoS("Bad registration request from device plugin with resource", "resourceName", r.ResourceName, "err", err) + return &pluginapi.Empty{}, err } if !v1helper.IsExtendedResourceName(v1.ResourceName(r.ResourceName)) { - errorString := fmt.Sprintf(errInvalidResourceName, r.ResourceName) - klog.Infof("Bad registration request from device plugin: %s", errorString) - return &pluginapi.Empty{}, fmt.Errorf(errorString) + err := fmt.Errorf(errInvalidResourceName, r.ResourceName) + klog.InfoS("Bad registration request from device plugin", "err", err) + return &pluginapi.Empty{}, err } // TODO: for now, always accepts newest device plugin. Later may consider to @@ -467,7 +465,7 @@ func (m *ManagerImpl) registerEndpoint(resourceName string, options *pluginapi.D defer m.mutex.Unlock() m.endpoints[resourceName] = endpointInfo{e: e, opts: options} - klog.V(2).Infof("Registered endpoint %v", e) + klog.V(2).InfoS("Registered endpoint", "endpoint", e) } func (m *ManagerImpl) runEndpoint(resourceName string, e endpoint) { @@ -481,13 +479,13 @@ func (m *ManagerImpl) runEndpoint(resourceName string, e endpoint) { m.markResourceUnhealthy(resourceName) } - klog.V(2).Infof("Endpoint (%s, %v) became unhealthy", resourceName, e) + klog.V(2).InfoS("Endpoint became unhealthy", "resourceName", resourceName, "endpoint", e) } func (m *ManagerImpl) addEndpoint(r *pluginapi.RegisterRequest) { new, err := newEndpointImpl(filepath.Join(m.socketdir, r.Endpoint), r.ResourceName, m.callback) if err != nil { - klog.Errorf("Failed to dial device plugin with request %v: %v", r, err) + klog.ErrorS(err, "Failed to dial device plugin with request", "request", r) return } m.registerEndpoint(r.ResourceName, r.Options, new) @@ -497,7 +495,7 @@ func (m *ManagerImpl) addEndpoint(r *pluginapi.RegisterRequest) { } func (m *ManagerImpl) markResourceUnhealthy(resourceName string) { - klog.V(2).Infof("Mark all resources Unhealthy for resource %s", resourceName) + klog.V(2).InfoS("Mark all resources Unhealthy for resource", "resourceName", resourceName) healthyDevices := sets.NewString() if _, ok := m.healthyDevices[resourceName]; ok { healthyDevices = m.healthyDevices[resourceName] @@ -534,7 +532,7 @@ func (m *ManagerImpl) GetCapacity() (v1.ResourceList, v1.ResourceList, []string) // should always be consistent. Otherwise, we run with the risk // of failing to garbage collect non-existing resources or devices. if !ok { - klog.Errorf("unexpected: healthyDevices and endpoints are out of sync") + klog.ErrorS(nil, "Unexpected: healthyDevices and endpoints are out of sync") } delete(m.endpoints, resourceName) delete(m.healthyDevices, resourceName) @@ -549,7 +547,7 @@ func (m *ManagerImpl) GetCapacity() (v1.ResourceList, v1.ResourceList, []string) eI, ok := m.endpoints[resourceName] if (ok && eI.e.stopGracePeriodExpired()) || !ok { if !ok { - klog.Errorf("unexpected: unhealthyDevices and endpoints are out of sync") + klog.ErrorS(nil, "Unexpected: unhealthyDevices and endpoints are out of sync") } delete(m.endpoints, resourceName) delete(m.unhealthyDevices, resourceName) @@ -565,7 +563,7 @@ func (m *ManagerImpl) GetCapacity() (v1.ResourceList, v1.ResourceList, []string) m.mutex.Unlock() if needsUpdateCheckpoint { if err := m.writeCheckpoint(); err != nil { - klog.Errorf("writing checkpoint encountered %v", err) + klog.ErrorS(err, "Error on writing checkpoint") } } return capacity, allocatable, deletedResources.UnsortedList() @@ -584,7 +582,7 @@ func (m *ManagerImpl) writeCheckpoint() error { err := m.checkpointManager.CreateCheckpoint(kubeletDeviceManagerCheckpoint, data) if err != nil { err2 := fmt.Errorf("failed to write checkpoint file %q: %v", kubeletDeviceManagerCheckpoint, err) - klog.Warning(err2) + klog.InfoS("Failed to write checkpoint file", "err", err) return err2 } return nil @@ -599,7 +597,7 @@ func (m *ManagerImpl) readCheckpoint() error { err := m.checkpointManager.GetCheckpoint(kubeletDeviceManagerCheckpoint, cp) if err != nil { if err == errors.ErrCheckpointNotFound { - klog.Warningf("Failed to retrieve checkpoint for %q: %v", kubeletDeviceManagerCheckpoint, err) + klog.InfoS("Failed to retrieve checkpoint", "checkpoint", kubeletDeviceManagerCheckpoint, "err", err) return nil } return err @@ -634,7 +632,7 @@ func (m *ManagerImpl) UpdateAllocatedDevices() { if len(podsToBeRemoved) <= 0 { return } - klog.V(3).Infof("pods to be removed: %v", podsToBeRemoved.List()) + klog.V(3).InfoS("Pods to be removed", "podUIDs", podsToBeRemoved.List()) m.podDevices.delete(podsToBeRemoved.List()) // Regenerated allocatedDevices after we update pod allocation information. m.allocatedDevices = m.podDevices.devices() @@ -650,7 +648,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi // This can happen if a container restarts for example. devices := m.podDevices.containerDevices(podUID, contName, resource) if devices != nil { - klog.V(3).Infof("Found pre-allocated devices for resource %s container %q in Pod %q: %v", resource, contName, string(podUID), devices.List()) + klog.V(3).InfoS("Found pre-allocated devices for resource on pod", "resourceName", resource, "containerName", contName, "podUID", string(podUID), "devices", devices.List()) needed = needed - devices.Len() // A pod's resource is not expected to change once admitted by the API server, // so just fail loudly here. We can revisit this part if this no longer holds. @@ -662,7 +660,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi // No change, no work. return nil, nil } - klog.V(3).Infof("Needs to allocate %d %q for pod %q container %q", needed, resource, string(podUID), contName) + klog.V(3).InfoS("Need devices to allocate for pod", "deviceNumber", needed, "resourceName", resource, "podUID", string(podUID), "containerName", contName) // Check if resource registered with devicemanager if _, ok := m.healthyDevices[resource]; !ok { return nil, fmt.Errorf("can't allocate unregistered device %s", resource) @@ -847,7 +845,7 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont for k, v := range container.Resources.Limits { resource := string(k) needed := int(v.Value()) - klog.V(3).Infof("needs %d %s", needed, resource) + klog.V(3).InfoS("Looking for needed resources", "needed", needed, "resourceName", resource) if !m.isDevicePluginResource(resource) { continue } @@ -893,7 +891,7 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont devs := allocDevices.UnsortedList() // TODO: refactor this part of code to just append a ContainerAllocationRequest // in a passed in AllocateRequest pointer, and issues a single Allocate call per pod. - klog.V(3).Infof("Making allocation request for devices %v for device plugin %s", devs, resource) + klog.V(3).InfoS("Making allocation request for device plugin", "devices", devs, "resourceName", resource) resp, err := eI.e.allocate(devs) metrics.DevicePluginAllocationDuration.WithLabelValues(resource).Observe(metrics.SinceInSeconds(startRPCTime)) if err != nil { @@ -957,7 +955,7 @@ func (m *ManagerImpl) GetDeviceRunContainerOptions(pod *v1.Pod, container *v1.Co } } if needsReAllocate { - klog.V(2).Infof("needs re-allocate device plugin resources for pod %s, container %s", format.Pod(pod), container.Name) + klog.V(2).InfoS("Needs to re-allocate device plugin resources for pod", "pod", klog.KObj(pod), "containerName", container.Name) if err := m.Allocate(pod, container); err != nil { return nil, err } @@ -977,7 +975,7 @@ func (m *ManagerImpl) callPreStartContainerIfNeeded(podUID, contName, resource s if eI.opts == nil || !eI.opts.PreStartRequired { m.mutex.Unlock() - klog.V(4).Infof("Plugin options indicate to skip PreStartContainer for resource: %s", resource) + klog.V(4).InfoS("Plugin options indicate to skip PreStartContainer for resource", "resourceName", resource) return nil } @@ -989,7 +987,7 @@ func (m *ManagerImpl) callPreStartContainerIfNeeded(podUID, contName, resource s m.mutex.Unlock() devs := devices.UnsortedList() - klog.V(4).Infof("Issuing an PreStartContainer call for container, %s, of pod %s", contName, string(podUID)) + klog.V(4).InfoS("Issuing a PreStartContainer call for container", "containerName", contName, "podUID", string(podUID)) _, err := eI.e.preStartContainer(devs) if err != nil { return fmt.Errorf("device plugin PreStartContainer rpc failed with err: %v", err) @@ -1007,12 +1005,12 @@ func (m *ManagerImpl) callGetPreferredAllocationIfAvailable(podUID, contName, re } if eI.opts == nil || !eI.opts.GetPreferredAllocationAvailable { - klog.V(4).Infof("Plugin options indicate to skip GetPreferredAllocation for resource: %s", resource) + klog.V(4).InfoS("Plugin options indicate to skip GetPreferredAllocation for resource", "resourceName", resource) return nil, nil } m.mutex.Unlock() - klog.V(4).Infof("Issuing a GetPreferredAllocation call for container, %s, of pod %s", contName, string(podUID)) + klog.V(4).InfoS("Issuing a GetPreferredAllocation call for container", "containerName", contName, "podUID", string(podUID)) resp, err := eI.e.getPreferredAllocation(available.UnsortedList(), mustInclude.UnsortedList(), size) m.mutex.Lock() if err != nil { @@ -1068,8 +1066,17 @@ func (m *ManagerImpl) isDevicePluginResource(resource string) bool { return false } +// GetAllocatableDevices returns information about all the devices known to the manager +func (m *ManagerImpl) GetAllocatableDevices() ResourceDeviceInstances { + m.mutex.Lock() + resp := m.allDevices.Clone() + m.mutex.Unlock() + klog.V(4).InfoS("known devices", "numDevices", len(resp)) + return resp +} + // GetDevices returns the devices used by the specified container -func (m *ManagerImpl) GetDevices(podUID, containerName string) []*podresourcesapi.ContainerDevices { +func (m *ManagerImpl) GetDevices(podUID, containerName string) ResourceDeviceInstances { return m.podDevices.getContainerDevices(podUID, containerName) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager_stub.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager_stub.go index ea04f5a16c02..e6874f88d8ad 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager_stub.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager_stub.go @@ -18,7 +18,6 @@ package devicemanager import ( v1 "k8s.io/api/core/v1" - podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1" "k8s.io/kubernetes/pkg/kubelet/cm/topologymanager" "k8s.io/kubernetes/pkg/kubelet/config" "k8s.io/kubernetes/pkg/kubelet/lifecycle" @@ -80,7 +79,12 @@ func (h *ManagerStub) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymana } // GetDevices returns nil -func (h *ManagerStub) GetDevices(_, _ string) []*podresourcesapi.ContainerDevices { +func (h *ManagerStub) GetDevices(_, _ string) ResourceDeviceInstances { + return nil +} + +// GetAllocatableDevices returns nothing +func (h *ManagerStub) GetAllocatableDevices() ResourceDeviceInstances { return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go index 8e20eb7bb7bd..b7bb2e2e8f12 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go @@ -23,7 +23,6 @@ import ( "k8s.io/apimachinery/pkg/util/sets" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1" - podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1" "k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/checkpoint" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) @@ -187,13 +186,13 @@ func (pdev *podDevices) toCheckpointData() []checkpoint.PodDevicesEntry { for conName, resources := range containerDevices { for resource, devices := range resources { if devices.allocResp == nil { - klog.Errorf("Can't marshal allocResp for %v %v %v: allocation response is missing", podUID, conName, resource) + klog.ErrorS(nil, "Can't marshal allocResp, allocation response is missing", "podUID", podUID, "containerName", conName, "resourceName", resource) continue } allocResp, err := devices.allocResp.Marshal() if err != nil { - klog.Errorf("Can't marshal allocResp for %v %v %v: %v", podUID, conName, resource, err) + klog.ErrorS(err, "Can't marshal allocResp", "podUID", podUID, "containerName", conName, "resourceName", resource) continue } data = append(data, checkpoint.PodDevicesEntry{ @@ -211,12 +210,13 @@ func (pdev *podDevices) toCheckpointData() []checkpoint.PodDevicesEntry { // Populates podDevices from the passed in checkpointData. func (pdev *podDevices) fromCheckpointData(data []checkpoint.PodDevicesEntry) { for _, entry := range data { - klog.V(2).Infof("Get checkpoint entry: %v %v %v %v %v\n", - entry.PodUID, entry.ContainerName, entry.ResourceName, entry.DeviceIDs, entry.AllocResp) + klog.V(2).InfoS("Get checkpoint entry", + "podUID", entry.PodUID, "containerName", entry.ContainerName, + "resourceName", entry.ResourceName, "deviceIDs", entry.DeviceIDs, "allocated", entry.AllocResp) allocResp := &pluginapi.ContainerAllocateResponse{} err := allocResp.Unmarshal(entry.AllocResp) if err != nil { - klog.Errorf("Can't unmarshal allocResp for %v %v %v: %v", entry.PodUID, entry.ContainerName, entry.ResourceName, err) + klog.ErrorS(err, "Can't unmarshal allocResp", "podUID", entry.PodUID, "containerName", entry.ContainerName, "resourceName", entry.ResourceName) continue } pdev.insert(entry.PodUID, entry.ContainerName, entry.ResourceName, entry.DeviceIDs, allocResp) @@ -254,13 +254,13 @@ func (pdev *podDevices) deviceRunContainerOptions(podUID, contName string) *Devi // Updates RunContainerOptions.Envs. for k, v := range resp.Envs { if e, ok := envsMap[k]; ok { - klog.V(4).Infof("Skip existing env %s %s", k, v) + klog.V(4).InfoS("Skip existing env", "envKey", k, "envValue", v) if e != v { - klog.Errorf("Environment variable %s has conflicting setting: %s and %s", k, e, v) + klog.ErrorS(nil, "Environment variable has conflicting setting", "envKey", k, "expected", v, "got", e) } continue } - klog.V(4).Infof("Add env %s %s", k, v) + klog.V(4).InfoS("Add env", "envKey", k, "envValue", v) envsMap[k] = v opts.Envs = append(opts.Envs, kubecontainer.EnvVar{Name: k, Value: v}) } @@ -268,14 +268,14 @@ func (pdev *podDevices) deviceRunContainerOptions(podUID, contName string) *Devi // Updates RunContainerOptions.Devices. for _, dev := range resp.Devices { if d, ok := devsMap[dev.ContainerPath]; ok { - klog.V(4).Infof("Skip existing device %s %s", dev.ContainerPath, dev.HostPath) + klog.V(4).InfoS("Skip existing device", "containerPath", dev.ContainerPath, "hostPath", dev.HostPath) if d != dev.HostPath { - klog.Errorf("Container device %s has conflicting mapping host devices: %s and %s", - dev.ContainerPath, d, dev.HostPath) + klog.ErrorS(nil, "Container device has conflicting mapping host devices", + "containerPath", dev.ContainerPath, "got", d, "expected", dev.HostPath) } continue } - klog.V(4).Infof("Add device %s %s", dev.ContainerPath, dev.HostPath) + klog.V(4).InfoS("Add device", "containerPath", dev.ContainerPath, "hostPath", dev.HostPath) devsMap[dev.ContainerPath] = dev.HostPath opts.Devices = append(opts.Devices, kubecontainer.DeviceInfo{ PathOnHost: dev.HostPath, @@ -287,14 +287,14 @@ func (pdev *podDevices) deviceRunContainerOptions(podUID, contName string) *Devi // Updates RunContainerOptions.Mounts. for _, mount := range resp.Mounts { if m, ok := mountsMap[mount.ContainerPath]; ok { - klog.V(4).Infof("Skip existing mount %s %s", mount.ContainerPath, mount.HostPath) + klog.V(4).InfoS("Skip existing mount", "containerPath", mount.ContainerPath, "hostPath", mount.HostPath) if m != mount.HostPath { - klog.Errorf("Container mount %s has conflicting mapping host mounts: %s and %s", - mount.ContainerPath, m, mount.HostPath) + klog.ErrorS(nil, "Container mount has conflicting mapping host mounts", + "containerPath", mount.ContainerPath, "conflictingPath", m, "hostPath", mount.HostPath) } continue } - klog.V(4).Infof("Add mount %s %s", mount.ContainerPath, mount.HostPath) + klog.V(4).InfoS("Add mount", "containerPath", mount.ContainerPath, "hostPath", mount.HostPath) mountsMap[mount.ContainerPath] = mount.HostPath opts.Mounts = append(opts.Mounts, kubecontainer.Mount{ Name: mount.ContainerPath, @@ -309,13 +309,13 @@ func (pdev *podDevices) deviceRunContainerOptions(podUID, contName string) *Devi // Updates for Annotations for k, v := range resp.Annotations { if e, ok := annotationsMap[k]; ok { - klog.V(4).Infof("Skip existing annotation %s %s", k, v) + klog.V(4).InfoS("Skip existing annotation", "annotationKey", k, "annotationValue", v) if e != v { - klog.Errorf("Annotation %s has conflicting setting: %s and %s", k, e, v) + klog.ErrorS(nil, "Annotation has conflicting setting", "annotationKey", k, "expected", e, "got", v) } continue } - klog.V(4).Infof("Add annotation %s %s", k, v) + klog.V(4).InfoS("Add annotation", "annotationKey", k, "annotationValue", v) annotationsMap[k] = v opts.Annotations = append(opts.Annotations, kubecontainer.Annotation{Name: k, Value: v}) } @@ -324,7 +324,7 @@ func (pdev *podDevices) deviceRunContainerOptions(podUID, contName string) *Devi } // getContainerDevices returns the devices assigned to the provided container for all ResourceNames -func (pdev *podDevices) getContainerDevices(podUID, contName string) []*podresourcesapi.ContainerDevices { +func (pdev *podDevices) getContainerDevices(podUID, contName string) ResourceDeviceInstances { pdev.RLock() defer pdev.RUnlock() @@ -334,15 +334,51 @@ func (pdev *podDevices) getContainerDevices(podUID, contName string) []*podresou if _, contExists := pdev.devs[podUID][contName]; !contExists { return nil } - cDev := []*podresourcesapi.ContainerDevices{} + resDev := NewResourceDeviceInstances() for resource, allocateInfo := range pdev.devs[podUID][contName] { + if len(allocateInfo.deviceIds) == 0 { + continue + } + devicePluginMap := make(map[string]pluginapi.Device) for numaid, devlist := range allocateInfo.deviceIds { - cDev = append(cDev, &podresourcesapi.ContainerDevices{ - ResourceName: resource, - DeviceIds: devlist, - Topology: &podresourcesapi.TopologyInfo{Nodes: []*podresourcesapi.NUMANode{{ID: numaid}}}, - }) + for _, devId := range devlist { + NUMANodes := []*pluginapi.NUMANode{{ID: numaid}} + if pDev, ok := devicePluginMap[devId]; ok && pDev.Topology != nil { + if nodes := pDev.Topology.GetNodes(); nodes != nil { + NUMANodes = append(NUMANodes, nodes...) + } + } + + devicePluginMap[devId] = pluginapi.Device{ + // ID and Healthy are not relevant here. + Topology: &pluginapi.TopologyInfo{ + Nodes: NUMANodes, + }, + } + } + } + resDev[resource] = devicePluginMap + } + return resDev +} + +// DeviceInstances is a mapping device name -> plugin device data +type DeviceInstances map[string]pluginapi.Device + +// ResourceDeviceInstances is a mapping resource name -> DeviceInstances +type ResourceDeviceInstances map[string]DeviceInstances + +func NewResourceDeviceInstances() ResourceDeviceInstances { + return make(ResourceDeviceInstances) +} + +func (rdev ResourceDeviceInstances) Clone() ResourceDeviceInstances { + clone := NewResourceDeviceInstances() + for resourceName, resourceDevs := range rdev { + clone[resourceName] = make(map[string]pluginapi.Device) + for devID, dev := range resourceDevs { + clone[resourceName][devID] = dev } } - return cDev + return clone } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/topology_hints.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/topology_hints.go index 855f4763468c..32f26f139a8e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/topology_hints.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/topology_hints.go @@ -23,7 +23,6 @@ import ( pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1" "k8s.io/kubernetes/pkg/kubelet/cm/topologymanager" "k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/bitmask" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) // GetTopologyHints implements the TopologyManager HintProvider Interface which @@ -43,7 +42,7 @@ func (m *ManagerImpl) GetTopologyHints(pod *v1.Pod, container *v1.Container) map if m.isDevicePluginResource(resource) { // Only consider devices that actually container topology information. if aligned := m.deviceHasTopologyAlignment(resource); !aligned { - klog.Infof("[devicemanager] Resource '%v' does not have a topology preference", resource) + klog.InfoS("Resource does not have a topology preference", "resource", resource) deviceHints[resource] = nil continue } @@ -54,11 +53,11 @@ func (m *ManagerImpl) GetTopologyHints(pod *v1.Pod, container *v1.Container) map allocated := m.podDevices.containerDevices(string(pod.UID), container.Name, resource) if allocated.Len() > 0 { if allocated.Len() != requested { - klog.Errorf("[devicemanager] Resource '%v' already allocated to (pod %v, container %v) with different number than request: requested: %d, allocated: %d", resource, format.Pod(pod), container.Name, requested, allocated.Len()) + klog.ErrorS(nil, "Resource already allocated to pod with different number than request", "resource", resource, "pod", klog.KObj(pod), "containerName", container.Name, "request", requested, "allocated", allocated.Len()) deviceHints[resource] = []topologymanager.TopologyHint{} continue } - klog.Infof("[devicemanager] Regenerating TopologyHints for resource '%v' already allocated to (pod %v, container %v)", resource, format.Pod(pod), container.Name) + klog.InfoS("Regenerating TopologyHints for resource already allocated to pod", "resource", resource, "pod", klog.KObj(pod), "containerName", container.Name) deviceHints[resource] = m.generateDeviceTopologyHints(resource, allocated, sets.String{}, requested) continue } @@ -67,7 +66,7 @@ func (m *ManagerImpl) GetTopologyHints(pod *v1.Pod, container *v1.Container) map available := m.getAvailableDevices(resource) reusable := m.devicesToReuse[string(pod.UID)][resource] if available.Union(reusable).Len() < requested { - klog.Errorf("[devicemanager] Unable to generate topology hints: requested number of devices unavailable for '%s': requested: %d, available: %d", resource, requested, available.Union(reusable).Len()) + klog.ErrorS(nil, "Unable to generate topology hints: requested number of devices unavailable", "resource", resource, "request", requested, "available", available.Union(reusable).Len()) deviceHints[resource] = []topologymanager.TopologyHint{} continue } @@ -93,7 +92,7 @@ func (m *ManagerImpl) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymana for resource, requested := range accumulatedResourceRequests { // Only consider devices that actually contain topology information. if aligned := m.deviceHasTopologyAlignment(resource); !aligned { - klog.Infof("[devicemanager] Resource '%v' does not have a topology preference", resource) + klog.InfoS("Resource does not have a topology preference", "resource", resource) deviceHints[resource] = nil continue } @@ -104,11 +103,11 @@ func (m *ManagerImpl) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymana allocated := m.podDevices.podDevices(string(pod.UID), resource) if allocated.Len() > 0 { if allocated.Len() != requested { - klog.Errorf("[devicemanager] Resource '%v' already allocated to (pod %v) with different number than request: requested: %d, allocated: %d", resource, format.Pod(pod), requested, allocated.Len()) + klog.ErrorS(nil, "Resource already allocated to pod with different number than request", "resource", resource, "pod", klog.KObj(pod), "request", requested, "allocated", allocated.Len()) deviceHints[resource] = []topologymanager.TopologyHint{} continue } - klog.Infof("[devicemanager] Regenerating TopologyHints for resource '%v' already allocated to (pod %v)", resource, format.Pod(pod)) + klog.InfoS("Regenerating TopologyHints for resource already allocated to pod", "resource", resource, "pod", klog.KObj(pod)) deviceHints[resource] = m.generateDeviceTopologyHints(resource, allocated, sets.String{}, requested) continue } @@ -116,7 +115,7 @@ func (m *ManagerImpl) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymana // Get the list of available devices, for which TopologyHints should be generated. available := m.getAvailableDevices(resource) if available.Len() < requested { - klog.Errorf("[devicemanager] Unable to generate topology hints: requested number of devices unavailable for '%s': requested: %d, available: %d", resource, requested, available.Len()) + klog.ErrorS(nil, "Unable to generate topology hints: requested number of devices unavailable", "resource", resource, "request", requested, "available", available.Len()) deviceHints[resource] = []topologymanager.TopologyHint{} continue } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/types.go index 779d91e3df12..7b17ac4619d1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/types.go @@ -20,7 +20,6 @@ import ( "time" v1 "k8s.io/api/core/v1" - podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1" "k8s.io/kubernetes/pkg/kubelet/cm/topologymanager" "k8s.io/kubernetes/pkg/kubelet/config" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" @@ -60,7 +59,10 @@ type Manager interface { GetWatcherHandler() cache.PluginHandler // GetDevices returns information about the devices assigned to pods and containers - GetDevices(podUID, containerName string) []*podresourcesapi.ContainerDevices + GetDevices(podUID, containerName string) ResourceDeviceInstances + + // GetAllocatableDevices returns information about all the devices known to the manager + GetAllocatableDevices() ResourceDeviceInstances // ShouldResetExtendedResourceCapacity returns whether the extended resources should be reset or not, // depending on the checkpoint file availability. Absence of the checkpoint file strongly indicates @@ -106,10 +108,6 @@ const ( errEndpointStopped = "endpoint %v has been stopped" // errBadSocket is the error raised when the registry socket path is not absolute errBadSocket = "bad socketPath, must be an absolute path:" - // errListenSocket is the error raised when the registry could not listen on the socket - errListenSocket = "failed to listen to socket while starting device plugin registry, with error" - // errListAndWatch is the error raised when ListAndWatch ended unsuccessfully - errListAndWatch = "listAndWatch ended unexpectedly for device plugin %s with error %v" ) // endpointStopGracePeriod indicates the grace period after an endpoint is stopped diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/fake_container_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/fake_container_manager.go index 027fffc7e72a..a05b5fce114f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/fake_container_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/fake_container_manager.go @@ -174,6 +174,13 @@ func (cm *FakeContainerManager) GetDevices(_, _ string) []*podresourcesapi.Conta return nil } +func (cm *FakeContainerManager) GetAllocatableDevices() []*podresourcesapi.ContainerDevices { + cm.Lock() + defer cm.Unlock() + cm.CalledFunctions = append(cm.CalledFunctions, "GetAllocatableDevices") + return nil +} + func (cm *FakeContainerManager) ShouldResetExtendedResourceCapacity() bool { cm.Lock() defer cm.Unlock() @@ -201,3 +208,9 @@ func (cm *FakeContainerManager) GetCPUs(_, _ string) []int64 { cm.CalledFunctions = append(cm.CalledFunctions, "GetCPUs") return nil } + +func (cm *FakeContainerManager) GetAllocatableCPUs() []int64 { + cm.Lock() + defer cm.Unlock() + return nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/fake_memory_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/fake_memory_manager.go index 11328567926d..2c0034cdff0d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/fake_memory_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/fake_memory_manager.go @@ -32,41 +32,41 @@ type fakeManager struct { } func (m *fakeManager) Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, containerRuntime runtimeService, initialContainers containermap.ContainerMap) error { - klog.Info("[fake memorymanager] Start()") + klog.InfoS("Start()") return nil } func (m *fakeManager) Policy() Policy { - klog.Info("[fake memorymanager] Policy()") + klog.InfoS("Policy()") return NewPolicyNone() } func (m *fakeManager) Allocate(pod *v1.Pod, container *v1.Container) error { - klog.Infof("[fake memorymanager] Allocate (pod: %s, container: %s", pod.Name, container.Name) + klog.InfoS("Allocate", "pod", klog.KObj(pod), "containerName", container.Name) return nil } func (m *fakeManager) AddContainer(pod *v1.Pod, container *v1.Container, containerID string) { - klog.Infof("[fake memorymanager] AddContainer (pod: %s, container: %s, container id: %s)", pod.Name, container.Name, containerID) + klog.InfoS("Add container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID) } func (m *fakeManager) GetMemoryNUMANodes(pod *v1.Pod, container *v1.Container) sets.Int { - klog.Infof("[fake memorymanager] GetMemoryNUMANodes (pod: %s, container: %s)", pod.Name, container.Name) + klog.InfoS("Get MemoryNUMANodes", "pod", klog.KObj(pod), "containerName", container.Name) return nil } func (m *fakeManager) RemoveContainer(containerID string) error { - klog.Infof("[fake memorymanager] RemoveContainer (container id: %s)", containerID) + klog.InfoS("RemoveContainer", "containerID", containerID) return nil } func (m *fakeManager) GetTopologyHints(pod *v1.Pod, container *v1.Container) map[string][]topologymanager.TopologyHint { - klog.Infof("[fake memorymanager] Get Topology Hints") + klog.InfoS("Get Topology Hints") return map[string][]topologymanager.TopologyHint{} } func (m *fakeManager) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymanager.TopologyHint { - klog.Infof("[fake memorymanager] Get Pod Topology Hints") + klog.InfoS("Get Pod Topology Hints") return map[string][]topologymanager.TopologyHint{} } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/memory_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/memory_manager.go index 57a689d83af5..00e3d1ea3122 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/memory_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/memory_manager.go @@ -153,7 +153,7 @@ func NewManager(policyName string, machineInfo *cadvisorapi.MachineInfo, nodeAll // Start starts the memory manager under the kubelet and calls policy start func (m *manager) Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, containerRuntime runtimeService, initialContainers containermap.ContainerMap) error { - klog.Infof("[memorymanager] starting with %s policy", m.policy.Name()) + klog.InfoS("Starting memorymanager", "policy", m.policy.Name()) m.sourcesReady = sourcesReady m.activePods = activePods m.podStatusProvider = podStatusProvider @@ -162,14 +162,14 @@ func (m *manager) Start(activePods ActivePodsFunc, sourcesReady config.SourcesRe stateImpl, err := state.NewCheckpointState(m.stateFileDirectory, memoryManagerStateFileName, m.policy.Name()) if err != nil { - klog.Errorf("[memorymanager] could not initialize checkpoint manager: %v, please drain node and remove policy state file", err) + klog.ErrorS(err, "Could not initialize checkpoint manager, please drain node and remove policy state file") return err } m.state = stateImpl err = m.policy.Start(m.state) if err != nil { - klog.Errorf("[memorymanager] policy start error: %v", err) + klog.ErrorS(err, "Policy start error") return err } @@ -196,11 +196,11 @@ func (m *manager) GetMemoryNUMANodes(pod *v1.Pod, container *v1.Container) sets. } if numaNodes.Len() == 0 { - klog.V(5).Infof("No allocation is available for (Pod: %s, Container: %s)", pod.Name, container.Name) + klog.V(5).InfoS("No allocation is available", "pod", klog.KObj(pod), "containerName", container.Name) return nil } - klog.Infof("(Pod: %s, Container: %s) memory affinity is %v", pod.Name, container.Name, numaNodes) + klog.InfoS("Memory affinity", "pod", klog.KObj(pod), "containerName", container.Name, "numaNodes", numaNodes) return numaNodes } @@ -214,7 +214,7 @@ func (m *manager) Allocate(pod *v1.Pod, container *v1.Container) error { // Call down into the policy to assign this container memory if required. if err := m.policy.Allocate(m.state, pod, container); err != nil { - klog.Errorf("[memorymanager] Allocate error: %v", err) + klog.ErrorS(err, "Allocate error") return err } return nil @@ -228,13 +228,13 @@ func (m *manager) RemoveContainer(containerID string) error { // if error appears it means container entry already does not exist under the container map podUID, containerName, err := m.containerMap.GetContainerRef(containerID) if err != nil { - klog.Warningf("[memorymanager] Failed to get container %s from container map error: %v", containerID, err) + klog.InfoS("Failed to get container from container map", "containerID", containerID, "err", err) return nil } err = m.policyRemoveContainerByRef(podUID, containerName) if err != nil { - klog.Errorf("[memorymanager] RemoveContainer error: %v", err) + klog.ErrorS(err, "RemoveContainer error") return err } @@ -296,10 +296,10 @@ func (m *manager) removeStaleState() { for podUID := range assignments { for containerName := range assignments[podUID] { if _, ok := activeContainers[podUID][containerName]; !ok { - klog.Infof("[memorymanager] removeStaleState: removing (pod %s, container: %s)", podUID, containerName) + klog.InfoS("RemoveStaleState removing state", "podUID", podUID, "containerName", containerName) err := m.policyRemoveContainerByRef(podUID, containerName) if err != nil { - klog.Errorf("[memorymanager] removeStaleState: failed to remove (pod %s, container %s), error: %v)", podUID, containerName, err) + klog.ErrorS(err, "RemoveStaleState: failed to remove state", "podUID", podUID, "containerName", containerName) } } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/policy_static.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/policy_static.go index f6ad0b5fcc25..4f52d703e1dc 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/policy_static.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/policy_static.go @@ -77,7 +77,7 @@ func (p *staticPolicy) Name() string { func (p *staticPolicy) Start(s state.State) error { if err := p.validateState(s); err != nil { - klog.Errorf("[memorymanager] Invalid state: %v, please drain node and remove policy state file", err) + klog.ErrorS(err, "Invalid state, please drain node and remove policy state file") return err } return nil @@ -90,15 +90,15 @@ func (p *staticPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Contai return nil } - klog.Infof("[memorymanager] Allocate (pod: %s, container: %s)", pod.Name, container.Name) + klog.InfoS("Allocate", "pod", klog.KObj(pod), "containerName", container.Name) if blocks := s.GetMemoryBlocks(string(pod.UID), container.Name); blocks != nil { - klog.Infof("[memorymanager] Container already present in state, skipping (pod: %s, container: %s)", pod.Name, container.Name) + klog.InfoS("Container already present in state, skipping", "pod", klog.KObj(pod), "containerName", container.Name) return nil } // Call Topology Manager to get the aligned affinity across all hint providers. hint := p.affinity.GetAffinity(string(pod.UID), container.Name) - klog.Infof("[memorymanager] Pod %v, Container %v Topology Affinity is: %v", pod.UID, container.Name, hint) + klog.InfoS("Got topology affinity", "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", container.Name, "hint", hint) requestedResources, err := getRequestedResources(container) if err != nil { @@ -185,7 +185,7 @@ func (p *staticPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Contai // RemoveContainer call is idempotent func (p *staticPolicy) RemoveContainer(s state.State, podUID string, containerName string) error { - klog.Infof("[memorymanager] RemoveContainer (pod: %s, container: %s)", podUID, containerName) + klog.InfoS("RemoveContainer", "podUID", podUID, "containerName", containerName) blocks := s.GetMemoryBlocks(podUID, containerName) if blocks == nil { return nil @@ -245,28 +245,28 @@ func regenerateHints(pod *v1.Pod, ctn *v1.Container, ctnBlocks []state.Block, re } if len(ctnBlocks) != len(reqRsrc) { - klog.Errorf("[memorymanager] The number of requested resources by the container %s differs from the number of memory blocks", ctn.Name) + klog.ErrorS(nil, "The number of requested resources by the container differs from the number of memory blocks", "containerName", ctn.Name) return nil } for _, b := range ctnBlocks { if _, ok := reqRsrc[b.Type]; !ok { - klog.Errorf("[memorymanager] Container %s requested resources do not have resource of type %s", ctn.Name, b.Type) + klog.ErrorS(nil, "Container requested resources do not have resource of this type", "containerName", ctn.Name, "type", b.Type) return nil } if b.Size != reqRsrc[b.Type] { - klog.Errorf("[memorymanager] Memory %s already allocated to (pod %v, container %v) with different number than request: requested: %d, allocated: %d", b.Type, pod.UID, ctn.Name, reqRsrc[b.Type], b.Size) + klog.ErrorS(nil, "Memory already allocated with different numbers than requested", "podUID", pod.UID, "type", b.Type, "containerName", ctn.Name, "requestedResource", reqRsrc[b.Type], "allocatedSize", b.Size) return nil } containerNUMAAffinity, err := bitmask.NewBitMask(b.NUMAAffinity...) if err != nil { - klog.Errorf("[memorymanager] failed to generate NUMA bitmask: %v", err) + klog.ErrorS(err, "Failed to generate NUMA bitmask") return nil } - klog.Infof("[memorymanager] Regenerating TopologyHints, %s was already allocated to (pod %v, container %v)", b.Type, pod.UID, ctn.Name) + klog.InfoS("Regenerating TopologyHints, resource was already allocated to pod", "resourceName", b.Type, "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", ctn.Name) hints[string(b.Type)] = append(hints[string(b.Type)], topologymanager.TopologyHint{ NUMANodeAffinity: containerNUMAAffinity, Preferred: true, @@ -326,7 +326,7 @@ func (p *staticPolicy) GetPodTopologyHints(s state.State, pod *v1.Pod) map[strin reqRsrcs, err := getPodRequestedResources(pod) if err != nil { - klog.Error(err.Error()) + klog.ErrorS(err, "Failed to get pod requested resources", "pod", klog.KObj(pod), "podUID", pod.UID) return nil } @@ -352,7 +352,7 @@ func (p *staticPolicy) GetTopologyHints(s state.State, pod *v1.Pod, container *v requestedResources, err := getRequestedResources(container) if err != nil { - klog.Error(err.Error()) + klog.ErrorS(err, "Failed to get container requested resources", "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", container.Name) return nil } @@ -570,41 +570,41 @@ func (p *staticPolicy) validateState(s state.State) error { func areMachineStatesEqual(ms1, ms2 state.NUMANodeMap) bool { if len(ms1) != len(ms2) { - klog.Errorf("[memorymanager] node states are different len(ms1) != len(ms2): %d != %d", len(ms1), len(ms2)) + klog.ErrorS(nil, "Node states are different", "lengthNode1", len(ms1), "lengthNode2", len(ms2)) return false } for nodeID, nodeState1 := range ms1 { nodeState2, ok := ms2[nodeID] if !ok { - klog.Errorf("[memorymanager] node state does not have node ID %d", nodeID) + klog.ErrorS(nil, "Node state does not have node ID", "nodeID", nodeID) return false } if nodeState1.NumberOfAssignments != nodeState2.NumberOfAssignments { - klog.Errorf("[memorymanager] node states number of assignments are different: %d != %d", nodeState1.NumberOfAssignments, nodeState2.NumberOfAssignments) + klog.ErrorS(nil, "Node states number of assignments are different", "assignment1", nodeState1.NumberOfAssignments, "assignment2", nodeState2.NumberOfAssignments) return false } if !areGroupsEqual(nodeState1.Cells, nodeState2.Cells) { - klog.Errorf("[memorymanager] node states groups are different: %v != %v", nodeState1.Cells, nodeState2.Cells) + klog.ErrorS(nil, "Node states groups are different", "stateNode1", nodeState1.Cells, "stateNode2", nodeState2.Cells) return false } if len(nodeState1.MemoryMap) != len(nodeState2.MemoryMap) { - klog.Errorf("[memorymanager] node states memory map have different length: %d != %d", len(nodeState1.MemoryMap), len(nodeState2.MemoryMap)) + klog.ErrorS(nil, "Node states memory map have different lengths", "lengthNode1", len(nodeState1.MemoryMap), "lengthNode2", len(nodeState2.MemoryMap)) return false } for resourceName, memoryState1 := range nodeState1.MemoryMap { memoryState2, ok := nodeState2.MemoryMap[resourceName] if !ok { - klog.Errorf("[memorymanager] memory state does not have resource %s", resourceName) + klog.ErrorS(nil, "Memory state does not have resource", "resource", resourceName) return false } if !reflect.DeepEqual(*memoryState1, *memoryState2) { - klog.Errorf("[memorymanager] memory states for the NUMA node %d and the resource %s are different: %+v != %+v", nodeID, resourceName, *memoryState1, *memoryState2) + klog.ErrorS(nil, "Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "memoryState1", *memoryState1, "memoryState2", *memoryState2) return false } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_checkpoint.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_checkpoint.go index 03333badc666..3607234094b1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_checkpoint.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_checkpoint.go @@ -79,7 +79,7 @@ func (sc *stateCheckpoint) restoreState() error { sc.cache.SetMachineState(checkpoint.MachineState) sc.cache.SetMemoryAssignments(checkpoint.Entries) - klog.V(2).Info("[memorymanager] state checkpoint: restored state from checkpoint") + klog.V(2).InfoS("State checkpoint: restored state from checkpoint") return nil } @@ -93,7 +93,7 @@ func (sc *stateCheckpoint) storeState() error { err := sc.checkpointManager.CreateCheckpoint(sc.checkpointName, checkpoint) if err != nil { - klog.Errorf("[memorymanager] could not save checkpoint: %v", err) + klog.ErrorS(err, "Could not save checkpoint") return err } return nil @@ -131,7 +131,7 @@ func (sc *stateCheckpoint) SetMachineState(memoryMap NUMANodeMap) { sc.cache.SetMachineState(memoryMap) err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } @@ -143,7 +143,7 @@ func (sc *stateCheckpoint) SetMemoryBlocks(podUID string, containerName string, sc.cache.SetMemoryBlocks(podUID, containerName, blocks) err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } @@ -155,7 +155,7 @@ func (sc *stateCheckpoint) SetMemoryAssignments(assignments ContainerMemoryAssig sc.cache.SetMemoryAssignments(assignments) err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } @@ -167,7 +167,7 @@ func (sc *stateCheckpoint) Delete(podUID string, containerName string) { sc.cache.Delete(podUID, containerName) err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } @@ -179,6 +179,6 @@ func (sc *stateCheckpoint) ClearState() { sc.cache.ClearState() err := sc.storeState() if err != nil { - klog.Warningf("store state to checkpoint error: %v", err) + klog.InfoS("Store state to checkpoint error", "err", err) } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_mem.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_mem.go index 119e4eb8a122..7e4da7ab67ce 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_mem.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_mem.go @@ -32,7 +32,7 @@ var _ State = &stateMemory{} // NewMemoryState creates new State for keeping track of cpu/pod assignment func NewMemoryState() State { - klog.Infof("[memorymanager] initializing new in-memory state store") + klog.InfoS("Initializing new in-memory state store") return &stateMemory{ assignments: ContainerMemoryAssignments{}, machineState: NUMANodeMap{}, @@ -72,7 +72,7 @@ func (s *stateMemory) SetMachineState(nodeMap NUMANodeMap) { defer s.Unlock() s.machineState = nodeMap.Clone() - klog.Info("[memorymanager] updated machine memory state") + klog.InfoS("Updated machine memory state") } // SetMemoryBlocks stores memory assignments of container @@ -85,7 +85,7 @@ func (s *stateMemory) SetMemoryBlocks(podUID string, containerName string, block } s.assignments[podUID][containerName] = append([]Block{}, blocks...) - klog.Infof("[memorymanager] updated memory state (pod: %s, container: %s)", podUID, containerName) + klog.InfoS("Updated memory state", "podUID", podUID, "containerName", containerName) } // SetMemoryAssignments sets ContainerMemoryAssignments by using the passed parameter @@ -109,7 +109,7 @@ func (s *stateMemory) Delete(podUID string, containerName string) { if len(s.assignments[podUID]) == 0 { delete(s.assignments, podUID) } - klog.V(2).Infof("[memorymanager] deleted memory assignment (pod: %s, container: %s)", podUID, containerName) + klog.V(2).InfoS("Deleted memory assignment", "podUID", podUID, "containerName", containerName) } // ClearState clears machineState and ContainerMemoryAssignments @@ -119,5 +119,5 @@ func (s *stateMemory) ClearState() { s.machineState = NUMANodeMap{} s.assignments = make(ContainerMemoryAssignments) - klog.V(2).Infof("[memorymanager] cleared state") + klog.V(2).InfoS("Cleared state") } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/node_container_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/node_container_manager_linux.go index fc7864dacc2d..d9132c114641 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/node_container_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/node_container_manager_linux.go @@ -54,7 +54,7 @@ func (cm *containerManagerImpl) createNodeAllocatableCgroups() error { return nil } if err := cm.cgroupManager.Create(cgroupConfig); err != nil { - klog.Errorf("Failed to create %q cgroup", cm.cgroupRoot) + klog.ErrorS(err, "Failed to create cgroup", "cgroupName", cm.cgroupRoot) return err } return nil @@ -72,7 +72,7 @@ func (cm *containerManagerImpl) enforceNodeAllocatableCgroups() error { nodeAllocatable = cm.getNodeAllocatableInternalAbsolute() } - klog.V(4).Infof("Attempting to enforce Node Allocatable with config: %+v", nc) + klog.V(4).InfoS("Attempting to enforce Node Allocatable", "config", nc) cgroupConfig := &CgroupConfig{ Name: cm.cgroupRoot, @@ -109,7 +109,7 @@ func (cm *containerManagerImpl) enforceNodeAllocatableCgroups() error { } // Now apply kube reserved and system reserved limits if required. if nc.EnforceNodeAllocatable.Has(kubetypes.SystemReservedEnforcementKey) { - klog.V(2).Infof("Enforcing System reserved on cgroup %q with limits: %+v", nc.SystemReservedCgroupName, nc.SystemReserved) + klog.V(2).InfoS("Enforcing system reserved on cgroup", "cgroupName", nc.SystemReservedCgroupName, "limits", nc.SystemReserved) if err := enforceExistingCgroup(cm.cgroupManager, cm.cgroupManager.CgroupName(nc.SystemReservedCgroupName), nc.SystemReserved); err != nil { message := fmt.Sprintf("Failed to enforce System Reserved Cgroup Limits on %q: %v", nc.SystemReservedCgroupName, err) cm.recorder.Event(nodeRef, v1.EventTypeWarning, events.FailedNodeAllocatableEnforcement, message) @@ -118,7 +118,7 @@ func (cm *containerManagerImpl) enforceNodeAllocatableCgroups() error { cm.recorder.Eventf(nodeRef, v1.EventTypeNormal, events.SuccessfulNodeAllocatableEnforcement, "Updated limits on system reserved cgroup %v", nc.SystemReservedCgroupName) } if nc.EnforceNodeAllocatable.Has(kubetypes.KubeReservedEnforcementKey) { - klog.V(2).Infof("Enforcing kube reserved on cgroup %q with limits: %+v", nc.KubeReservedCgroupName, nc.KubeReserved) + klog.V(2).InfoS("Enforcing kube reserved on cgroup", "cgroupName", nc.KubeReservedCgroupName, "limits", nc.KubeReserved) if err := enforceExistingCgroup(cm.cgroupManager, cm.cgroupManager.CgroupName(nc.KubeReservedCgroupName), nc.KubeReserved); err != nil { message := fmt.Sprintf("Failed to enforce Kube Reserved Cgroup Limits on %q: %v", nc.KubeReservedCgroupName, err) cm.recorder.Event(nodeRef, v1.EventTypeWarning, events.FailedNodeAllocatableEnforcement, message) @@ -138,7 +138,7 @@ func enforceExistingCgroup(cgroupManager CgroupManager, cName CgroupName, rl v1. if cgroupConfig.ResourceParameters == nil { return fmt.Errorf("%q cgroup is not config properly", cgroupConfig.Name) } - klog.V(4).Infof("Enforcing limits on cgroup %q with %d cpu shares, %d bytes of memory, and %d processes", cName, cgroupConfig.ResourceParameters.CpuShares, cgroupConfig.ResourceParameters.Memory, cgroupConfig.ResourceParameters.PidsLimit) + klog.V(4).InfoS("Enforcing limits on cgroup", "cgroupName", cName, "cpuShares", cgroupConfig.ResourceParameters.CpuShares, "memory", cgroupConfig.ResourceParameters.Memory, "pidsLimit", cgroupConfig.ResourceParameters.PidsLimit) if !cgroupManager.Exists(cgroupConfig.Name) { return fmt.Errorf("%q cgroup does not exist", cgroupConfig.Name) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/pod_container_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/pod_container_manager_linux.go index b9fa3e05cde0..f60d85bbbe3a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/pod_container_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/pod_container_manager_linux.go @@ -57,14 +57,6 @@ type podContainerManagerImpl struct { // Make sure that podContainerManagerImpl implements the PodContainerManager interface var _ PodContainerManager = &podContainerManagerImpl{} -// applyLimits sets pod cgroup resource limits -// It also updates the resource limits on top level qos containers. -func (m *podContainerManagerImpl) applyLimits(pod *v1.Pod) error { - // This function will house the logic for setting the resource parameters - // on the pod container config and updating top level qos container configs - return nil -} - // Exists checks if the pod's cgroup already exists func (m *podContainerManagerImpl) Exists(pod *v1.Pod) bool { podContainerName, _ := m.GetPodContainerName(pod) @@ -91,13 +83,6 @@ func (m *podContainerManagerImpl) EnsureExists(pod *v1.Pod) error { return fmt.Errorf("failed to create container for %v : %v", podContainerName, err) } } - // Apply appropriate resource limits on the pod container - // Top level qos containers limits are not updated - // until we figure how to maintain the desired state in the kubelet. - // Because maintaining the desired state is difficult without checkpointing. - if err := m.applyLimits(pod); err != nil { - return fmt.Errorf("failed to apply resource limits on container for %v : %v", podContainerName, err) - } return nil } @@ -135,7 +120,7 @@ func (m *podContainerManagerImpl) killOnePid(pid int) error { // Hate parsing strings, but // vendor/github.com/opencontainers/runc/libcontainer/ // also does this. - klog.V(3).Infof("process with pid %v no longer exists", pid) + klog.V(3).InfoS("Process no longer exists", "pid", pid) return nil } return err @@ -158,23 +143,23 @@ func (m *podContainerManagerImpl) tryKillingCgroupProcesses(podCgroup CgroupName removed := map[int]bool{} for i := 0; i < 5; i++ { if i != 0 { - klog.V(3).Infof("Attempt %v failed to kill all unwanted process from cgroup: %v. Retyring", i, podCgroup) + klog.V(3).InfoS("Attempt failed to kill all unwanted process from cgroup, retrying", "attempt", i, "cgroupName", podCgroup) } errlist = []error{} for _, pid := range pidsToKill { if _, ok := removed[pid]; ok { continue } - klog.V(3).Infof("Attempt to kill process with pid: %v from cgroup: %v", pid, podCgroup) + klog.V(3).InfoS("Attempting to kill process from cgroup", "pid", pid, "cgroupName", podCgroup) if err := m.killOnePid(pid); err != nil { - klog.V(3).Infof("failed to kill process with pid: %v from cgroup: %v", pid, podCgroup) + klog.V(3).InfoS("Failed to kill process from cgroup", "pid", pid, "cgroupName", podCgroup, "err", err) errlist = append(errlist, err) } else { removed[pid] = true } } if len(errlist) == 0 { - klog.V(3).Infof("successfully killed all unwanted processes from cgroup: %v", podCgroup) + klog.V(3).InfoS("Successfully killed all unwanted processes from cgroup", "cgroupName", podCgroup) return nil } } @@ -185,7 +170,7 @@ func (m *podContainerManagerImpl) tryKillingCgroupProcesses(podCgroup CgroupName func (m *podContainerManagerImpl) Destroy(podCgroup CgroupName) error { // Try killing all the processes attached to the pod cgroup if err := m.tryKillingCgroupProcesses(podCgroup); err != nil { - klog.Warningf("failed to kill all the processes attached to the %v cgroups", podCgroup) + klog.InfoS("Failed to kill all the processes attached to cgroup", "cgroupName", podCgroup, "err", err) return fmt.Errorf("failed to kill all the processes attached to the %v cgroups : %v", podCgroup, err) } @@ -195,7 +180,7 @@ func (m *podContainerManagerImpl) Destroy(podCgroup CgroupName) error { ResourceParameters: &ResourceConfig{}, } if err := m.cgroupManager.Destroy(containerConfig); err != nil { - klog.Warningf("failed to delete cgroup paths for %v : %v", podCgroup, err) + klog.InfoS("Failed to delete cgroup paths", "cgroupName", podCgroup, "err", err) return fmt.Errorf("failed to delete cgroup paths for %v : %v", podCgroup, err) } return nil @@ -274,7 +259,7 @@ func (m *podContainerManagerImpl) GetAllPodsFromCgroups() (map[types.UID]CgroupN parts := strings.Split(basePath, podCgroupNamePrefix) // the uid is missing, so we log the unexpected cgroup not of form pod if len(parts) != 2 { - klog.Errorf("pod cgroup manager ignoring unexpected cgroup %v because it is not a pod", cgroupfsPath) + klog.InfoS("Pod cgroup manager ignored unexpected cgroup because it is not a pod", "path", cgroupfsPath) continue } podUID := parts[1] diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go index eb8fc7d3da3f..209b70b717d2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go @@ -135,7 +135,7 @@ func (m *qosContainerManagerImpl) Start(getNodeAllocatable func() v1.ResourceLis go wait.Until(func() { err := m.UpdateCgroups() if err != nil { - klog.Warningf("[ContainerManager] Failed to reserve QoS requests: %v", err) + klog.InfoS("Failed to reserve QoS requests", "err", err) } }, periodicQOSCgroupUpdateInterval, wait.NeverStop) @@ -219,17 +219,17 @@ func (m *qosContainerManagerImpl) setMemoryReserve(configs map[v1.PodQOSClass]*C resources := m.getNodeAllocatable() allocatableResource, ok := resources[v1.ResourceMemory] if !ok { - klog.V(2).Infof("[Container Manager] Allocatable memory value could not be determined. Not setting QOS memory limts.") + klog.V(2).InfoS("Allocatable memory value could not be determined, not setting QoS memory limits") return } allocatable := allocatableResource.Value() if allocatable == 0 { - klog.V(2).Infof("[Container Manager] Memory allocatable reported as 0, might be in standalone mode. Not setting QOS memory limts.") + klog.V(2).InfoS("Allocatable memory reported as 0, might be in standalone mode, not setting QoS memory limits") return } for qos, limits := range qosMemoryRequests { - klog.V(2).Infof("[Container Manager] %s pod requests total %d bytes (reserve %d%%)", qos, limits, percentReserve) + klog.V(2).InfoS("QoS pod memory limit", "qos", qos, "limits", limits, "percentReserve", percentReserve) } // Calculate QOS memory limits @@ -249,7 +249,7 @@ func (m *qosContainerManagerImpl) retrySetMemoryReserve(configs map[v1.PodQOSCla for qos, config := range configs { stats, err := m.cgroupManager.GetResourceStats(config.Name) if err != nil { - klog.V(2).Infof("[Container Manager] %v", err) + klog.V(2).InfoS("Failed to get resource stats", "err", err) return } usage := stats.MemoryStats.Usage @@ -307,7 +307,7 @@ func (m *qosContainerManagerImpl) UpdateCgroups() error { } } if updateSuccess { - klog.V(4).Infof("[ContainerManager]: Updated QoS cgroup configuration") + klog.V(4).InfoS("Updated QoS cgroup configuration") return nil } @@ -325,12 +325,12 @@ func (m *qosContainerManagerImpl) UpdateCgroups() error { for _, config := range qosConfigs { err := m.cgroupManager.Update(config) if err != nil { - klog.Errorf("[ContainerManager]: Failed to update QoS cgroup configuration") + klog.ErrorS(err, "Failed to update QoS cgroup configuration") return err } } - klog.V(4).Infof("[ContainerManager]: Updated QoS cgroup configuration") + klog.V(4).InfoS("Updated QoS cgroup configuration") return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go index a21e50c555a8..063cac65a27d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go @@ -20,38 +20,37 @@ import ( "k8s.io/api/core/v1" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/kubelet/lifecycle" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) type fakeManager struct{} //NewFakeManager returns an instance of FakeManager func NewFakeManager() Manager { - klog.Infof("[fake topologymanager] NewFakeManager") + klog.InfoS("NewFakeManager") return &fakeManager{} } func (m *fakeManager) GetAffinity(podUID string, containerName string) TopologyHint { - klog.Infof("[fake topologymanager] GetAffinity pod: %v container name: %v", podUID, containerName) + klog.InfoS("GetAffinity", "podUID", podUID, "containerName", containerName) return TopologyHint{} } func (m *fakeManager) AddHintProvider(h HintProvider) { - klog.Infof("[fake topologymanager] AddHintProvider HintProvider: %v", h) + klog.InfoS("AddHintProvider", "hintProvider", h) } func (m *fakeManager) AddContainer(pod *v1.Pod, containerID string) error { - klog.Infof("[fake topologymanager] AddContainer pod: %v container id: %v", format.Pod(pod), containerID) + klog.InfoS("AddContainer", "pod", klog.KObj(pod), "containerID", containerID) return nil } func (m *fakeManager) RemoveContainer(containerID string) error { - klog.Infof("[fake topologymanager] RemoveContainer container id: %v", containerID) + klog.InfoS("RemoveContainer", "containerID", containerID) return nil } func (m *fakeManager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult { - klog.Infof("[fake topologymanager] Topology Admit Handler") + klog.InfoS("Topology Admit Handler") return lifecycle.PodAdmitResult{ Admit: true, } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/policy.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/policy.go index 08a4d9e28e2a..b548e4afdbe5 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/policy.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/policy.go @@ -67,7 +67,7 @@ func filterProvidersHints(providersHints []map[string][]TopologyHint) [][]Topolo for _, hints := range providersHints { // If hints is nil, insert a single, preferred any-numa hint into allProviderHints. if len(hints) == 0 { - klog.Infof("[topologymanager] Hint Provider has no preference for NUMA affinity with any resource") + klog.InfoS("Hint Provider has no preference for NUMA affinity with any resource") allProviderHints = append(allProviderHints, []TopologyHint{{nil, true}}) continue } @@ -75,13 +75,13 @@ func filterProvidersHints(providersHints []map[string][]TopologyHint) [][]Topolo // Otherwise, accumulate the hints for each resource type into allProviderHints. for resource := range hints { if hints[resource] == nil { - klog.Infof("[topologymanager] Hint Provider has no preference for NUMA affinity with resource '%s'", resource) + klog.InfoS("Hint Provider has no preference for NUMA affinity with resource", "resource", resource) allProviderHints = append(allProviderHints, []TopologyHint{{nil, true}}) continue } if len(hints[resource]) == 0 { - klog.Infof("[topologymanager] Hint Provider has no possible NUMA affinities for resource '%s'", resource) + klog.InfoS("Hint Provider has no possible NUMA affinities for resource", "resource", resource) allProviderHints = append(allProviderHints, []TopologyHint{{nil, false}}) continue } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope.go index a7948c0b00cf..af90663368a4 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope.go @@ -108,7 +108,7 @@ func (s *scope) RemoveContainer(containerID string) error { s.mutex.Lock() defer s.mutex.Unlock() - klog.Infof("[topologymanager] RemoveContainer - Container ID: %v", containerID) + klog.InfoS("RemoveContainer", "containerID", containerID) podUIDString := s.podMap[containerID] delete(s.podMap, containerID) if _, exists := s.podTopologyHints[podUIDString]; exists { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go index 0a221b0259b6..e5d331e00e92 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go @@ -20,7 +20,6 @@ import ( "k8s.io/api/core/v1" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/kubelet/lifecycle" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) type containerScope struct { @@ -50,12 +49,12 @@ func (s *containerScope) Admit(pod *v1.Pod) lifecycle.PodAdmitResult { for _, container := range append(pod.Spec.InitContainers, pod.Spec.Containers...) { bestHint, admit := s.calculateAffinity(pod, &container) - klog.Infof("[topologymanager] Best TopologyHint for (pod: %v container: %v): %v", format.Pod(pod), container.Name, bestHint) + klog.InfoS("Best TopologyHint", "bestHint", bestHint, "pod", klog.KObj(pod), "containerName", container.Name) if !admit { return topologyAffinityError() } - klog.Infof("[topologymanager] Topology Affinity for (pod: %v container: %v): %v", format.Pod(pod), container.Name, bestHint) + klog.InfoS("Topology Affinity", "bestHint", bestHint, "pod", klog.KObj(pod), "containerName", container.Name) s.setTopologyHints(string(pod.UID), container.Name, bestHint) err := s.allocateAlignedResources(pod, &container) @@ -73,7 +72,7 @@ func (s *containerScope) accumulateProvidersHints(pod *v1.Pod, container *v1.Con // Get the TopologyHints for a Container from a provider. hints := provider.GetTopologyHints(pod, container) providersHints = append(providersHints, hints) - klog.Infof("[topologymanager] TopologyHints for pod '%v', container '%v': %v", format.Pod(pod), container.Name, hints) + klog.InfoS("TopologyHints", "hints", hints, "pod", klog.KObj(pod), "containerName", container.Name) } return providersHints } @@ -81,6 +80,6 @@ func (s *containerScope) accumulateProvidersHints(pod *v1.Pod, container *v1.Con func (s *containerScope) calculateAffinity(pod *v1.Pod, container *v1.Container) (TopologyHint, bool) { providersHints := s.accumulateProvidersHints(pod, container) bestHint, admit := s.policy.Merge(providersHints) - klog.Infof("[topologymanager] ContainerTopologyHint: %v", bestHint) + klog.InfoS("ContainerTopologyHint", "bestHint", bestHint) return bestHint, admit } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go index 11e66ac47c06..f4645bc4d768 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go @@ -20,7 +20,6 @@ import ( "k8s.io/api/core/v1" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/kubelet/lifecycle" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) type podScope struct { @@ -49,13 +48,13 @@ func (s *podScope) Admit(pod *v1.Pod) lifecycle.PodAdmitResult { } bestHint, admit := s.calculateAffinity(pod) - klog.Infof("[topologymanager] Best TopologyHint for (pod: %v): %v", format.Pod(pod), bestHint) + klog.InfoS("Best TopologyHint", "bestHint", bestHint, "pod", klog.KObj(pod)) if !admit { return topologyAffinityError() } for _, container := range append(pod.Spec.InitContainers, pod.Spec.Containers...) { - klog.Infof("[topologymanager] Topology Affinity for (pod: %v container: %v): %v", format.Pod(pod), container.Name, bestHint) + klog.InfoS("Topology Affinity", "bestHint", bestHint, "pod", klog.KObj(pod), "containerName", container.Name) s.setTopologyHints(string(pod.UID), container.Name, bestHint) err := s.allocateAlignedResources(pod, &container) @@ -73,7 +72,7 @@ func (s *podScope) accumulateProvidersHints(pod *v1.Pod) []map[string][]Topology // Get the TopologyHints for a Pod from a provider. hints := provider.GetPodTopologyHints(pod) providersHints = append(providersHints, hints) - klog.Infof("[topologymanager] TopologyHints for pod '%v': %v", format.Pod(pod), hints) + klog.InfoS("TopologyHints", "hints", hints, "pod", klog.KObj(pod)) } return providersHints } @@ -81,6 +80,6 @@ func (s *podScope) accumulateProvidersHints(pod *v1.Pod) []map[string][]Topology func (s *podScope) calculateAffinity(pod *v1.Pod) (TopologyHint, bool) { providersHints := s.accumulateProvidersHints(pod) bestHint, admit := s.policy.Merge(providersHints) - klog.Infof("[topologymanager] PodTopologyHint: %v", bestHint) + klog.InfoS("PodTopologyHint", "bestHint", bestHint) return bestHint, admit } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go index 00ebf490bd35..f1e435260dec 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go @@ -117,7 +117,7 @@ var _ Manager = &manager{} // NewManager creates a new TopologyManager based on provided policy and scope func NewManager(topology []cadvisorapi.Node, topologyPolicyName string, topologyScopeName string) (Manager, error) { - klog.Infof("[topologymanager] Creating topology manager with %s policy per %s scope", topologyPolicyName, topologyScopeName) + klog.InfoS("Creating topology manager with policy per scope", "topologyPolicyName", topologyPolicyName, "topologyScopeName", topologyScopeName) var numaNodes []int for _, node := range topology { @@ -184,7 +184,7 @@ func (m *manager) RemoveContainer(containerID string) error { } func (m *manager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult { - klog.Infof("[topologymanager] Topology Admit Handler") + klog.InfoS("Topology Admit Handler") pod := attrs.Pod return m.scope.Admit(pod) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/apiserver.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/apiserver.go index 5369cb285d37..b67f6c34fec4 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/apiserver.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/apiserver.go @@ -17,6 +17,8 @@ limitations under the License. package config import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" @@ -24,13 +26,32 @@ import ( "k8s.io/apimachinery/pkg/util/wait" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" + "k8s.io/klog/v2" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" ) +// WaitForAPIServerSyncPeriod is the period between checks for the node list/watch initial sync +const WaitForAPIServerSyncPeriod = 1 * time.Second + // NewSourceApiserver creates a config source that watches and pulls from the apiserver. -func NewSourceApiserver(c clientset.Interface, nodeName types.NodeName, updates chan<- interface{}) { +func NewSourceApiserver(c clientset.Interface, nodeName types.NodeName, nodeHasSynced func() bool, updates chan<- interface{}) { lw := cache.NewListWatchFromClient(c.CoreV1().RESTClient(), "pods", metav1.NamespaceAll, fields.OneTermEqualSelector("spec.nodeName", string(nodeName))) - newSourceApiserverFromLW(lw, updates) + + // The Reflector responsible for watching pods at the apiserver should be run only after + // the node sync with the apiserver has completed. + klog.InfoS("Waiting for node sync before watching apiserver pods") + go func() { + for { + if nodeHasSynced() { + klog.V(4).InfoS("node sync completed") + break + } + time.Sleep(WaitForAPIServerSyncPeriod) + klog.V(4).InfoS("node sync has not completed yet") + } + klog.InfoS("Watching apiserver") + newSourceApiserverFromLW(lw, updates) + }() } // newSourceApiserverFromLW holds creates a config source that watches and pulls from the apiserver. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/common.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/common.go index 2a5733d4f480..20456622a529 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/common.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/common.go @@ -68,16 +68,16 @@ func applyDefaults(pod *api.Pod, source string, isFile bool, nodeName types.Node fmt.Fprintf(hasher, "url:%s", source) } pod.UID = types.UID(hex.EncodeToString(hasher.Sum(nil)[0:])) - klog.V(5).Infof("Generated UID %q pod %q from %s", pod.UID, pod.Name, source) + klog.V(5).InfoS("Generated UID", "pod", klog.KObj(pod), "podUID", pod.UID, "source", source) } pod.Name = generatePodName(pod.Name, nodeName) - klog.V(5).Infof("Generated Name %q for UID %q from URL %s", pod.Name, pod.UID, source) + klog.V(5).InfoS("Generated pod name", "pod", klog.KObj(pod), "podUID", pod.UID, "source", source) if pod.Namespace == "" { pod.Namespace = metav1.NamespaceDefault } - klog.V(5).Infof("Using namespace %q for pod %q from %s", pod.Namespace, pod.Name, source) + klog.V(5).InfoS("Set namespace for pod", "pod", klog.KObj(pod), "source", source) // Set the Host field to indicate this pod is scheduled on the current node. pod.Spec.NodeName = string(nodeName) @@ -145,7 +145,7 @@ func tryDecodeSinglePod(data []byte, defaultFn defaultFunc) (parsed bool, pod *v } v1Pod := &v1.Pod{} if err := k8s_api_v1.Convert_core_Pod_To_v1_Pod(newPod, v1Pod, nil); err != nil { - klog.Errorf("Pod %q failed to convert to v1", newPod.Name) + klog.ErrorS(err, "Pod failed to convert to v1", "pod", klog.KObj(newPod)) return true, nil, err } return true, v1Pod, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/config.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/config.go index b04fdb8f967e..2895df7327e9 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/config.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/config.go @@ -39,7 +39,7 @@ type PodConfigNotificationMode int const ( // PodConfigNotificationUnknown is the default value for // PodConfigNotificationMode when uninitialized. - PodConfigNotificationUnknown = iota + PodConfigNotificationUnknown PodConfigNotificationMode = iota // PodConfigNotificationSnapshot delivers the full configuration as a SET whenever // any change occurs. PodConfigNotificationSnapshot @@ -94,7 +94,7 @@ func (c *PodConfig) SeenAllSources(seenSources sets.String) bool { if c.pods == nil { return false } - klog.V(5).Infof("Looking for %v, have seen %v", c.sources.List(), seenSources) + klog.V(5).InfoS("Looking for sources, have seen", "sources", c.sources.List(), "seenSources", seenSources) return seenSources.HasAll(c.sources.List()...) && c.pods.seenSources(c.sources.List()...) } @@ -254,16 +254,16 @@ func (s *podStorage) merge(source string, change interface{}) (adds, updates, de switch update.Op { case kubetypes.ADD, kubetypes.UPDATE, kubetypes.DELETE: if update.Op == kubetypes.ADD { - klog.V(4).Infof("Adding new pods from source %s : %v", source, update.Pods) + klog.V(4).InfoS("Adding new pods from source", "source", source, "pods", format.Pods(update.Pods)) } else if update.Op == kubetypes.DELETE { - klog.V(4).Infof("Graceful deleting pods from source %s : %v", source, update.Pods) + klog.V(4).InfoS("Gracefully deleting pods from source", "source", source, "pods", format.Pods(update.Pods)) } else { - klog.V(4).Infof("Updating pods from source %s : %v", source, update.Pods) + klog.V(4).InfoS("Updating pods from source", "source", source, "pods", format.Pods(update.Pods)) } updatePodsFunc(update.Pods, pods, pods) case kubetypes.REMOVE: - klog.V(4).Infof("Removing pods from source %s : %v", source, update.Pods) + klog.V(4).InfoS("Removing pods from source", "source", source, "pods", format.Pods(update.Pods)) for _, value := range update.Pods { if existing, found := pods[value.UID]; found { // this is a delete @@ -275,7 +275,7 @@ func (s *podStorage) merge(source string, change interface{}) (adds, updates, de } case kubetypes.SET: - klog.V(4).Infof("Setting pods for source %s", source) + klog.V(4).InfoS("Setting pods for source", "source", source) s.markSourceSet(source) // Clear the old map entries by just creating a new map oldPods := pods @@ -289,7 +289,7 @@ func (s *podStorage) merge(source string, change interface{}) (adds, updates, de } default: - klog.Warningf("Received invalid update type: %v", update) + klog.InfoS("Received invalid update type", "type", update) } @@ -323,7 +323,7 @@ func filterInvalidPods(pods []*v1.Pod, source string, recorder record.EventRecor // This function only checks if there is any naming conflict. name := kubecontainer.GetPodFullName(pod) if names.Has(name) { - klog.Warningf("Pod[%d] (%s) from %s failed validation due to duplicate pod name %q, ignoring", i+1, format.Pod(pod), source, pod.Name) + klog.InfoS("Pod failed validation due to duplicate pod name, ignoring", "index", i, "pod", klog.KObj(pod), "source", source) recorder.Eventf(pod, v1.EventTypeWarning, events.FailedValidation, "Error validating pod %s from %s due to duplicate pod name %q, ignoring", format.Pod(pod), source, pod.Name) continue } else { @@ -380,7 +380,7 @@ func isAnnotationMapEqual(existingMap, candidateMap map[string]string) bool { // recordFirstSeenTime records the first seen time of this pod. func recordFirstSeenTime(pod *v1.Pod) { - klog.V(4).Infof("Receiving a new pod %q", format.Pod(pod)) + klog.V(4).InfoS("Receiving a new pod", "pod", klog.KObj(pod)) pod.Annotations[kubetypes.ConfigFirstSeenAnnotationKey] = kubetypes.NewTimestamp().GetString() } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file.go index 68b5d3d22bdd..8984f5dee483 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file.go @@ -65,7 +65,7 @@ func NewSourceFile(path string, nodeName types.NodeName, period time.Duration, u path = strings.TrimRight(path, string(os.PathSeparator)) config := newSourceFile(path, nodeName, period, updates) - klog.V(1).Infof("Watching path %q", path) + klog.V(1).InfoS("Watching path", "path", path) config.run() } @@ -95,17 +95,17 @@ func (s *sourceFile) run() { go func() { // Read path immediately to speed up startup. if err := s.listConfig(); err != nil { - klog.Errorf("Unable to read config path %q: %v", s.path, err) + klog.ErrorS(err, "Unable to read config path", "path", s.path) } for { select { case <-listTicker.C: if err := s.listConfig(); err != nil { - klog.Errorf("Unable to read config path %q: %v", s.path, err) + klog.ErrorS(err, "Unable to read config path", "path", s.path) } case e := <-s.watchEvents: if err := s.consumeWatchEvent(e); err != nil { - klog.Errorf("Unable to process watch event: %v", err) + klog.ErrorS(err, "Unable to process watch event") } } } @@ -173,24 +173,24 @@ func (s *sourceFile) extractFromDir(name string) ([]*v1.Pod, error) { for _, path := range dirents { statInfo, err := os.Stat(path) if err != nil { - klog.Errorf("Can't get metadata for %q: %v", path, err) + klog.ErrorS(err, "Could not get metadata", "path", path) continue } switch { case statInfo.Mode().IsDir(): - klog.Errorf("Not recursing into manifest path %q", path) + klog.ErrorS(nil, "Provided manifest path is a directory, not recursing into manifest path", "path", path) case statInfo.Mode().IsRegular(): pod, err := s.extractFromFile(path) if err != nil { if !os.IsNotExist(err) { - klog.Errorf("Can't process manifest file %q: %v", path, err) + klog.ErrorS(err, "Could not process manifest file", "path", path) } } else { pods = append(pods, pod) } default: - klog.Errorf("Manifest path %q is not a directory or file: %v", path, statInfo.Mode()) + klog.ErrorS(nil, "Manifest path is not a directory or file", "path", path, "mode", statInfo.Mode()) } } return pods, nil @@ -198,7 +198,7 @@ func (s *sourceFile) extractFromDir(name string) ([]*v1.Pod, error) { // extractFromFile parses a file for Pod configuration information. func (s *sourceFile) extractFromFile(filename string) (pod *v1.Pod, err error) { - klog.V(3).Infof("Reading config file %q", filename) + klog.V(3).InfoS("Reading config file", "path", filename) defer func() { if err == nil && pod != nil { objKey, keyErr := cache.MetaNamespaceKeyFunc(pod) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file_linux.go index f1938afa1a5e..5c1930498f24 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file_linux.go @@ -57,7 +57,7 @@ func (s *sourceFile) startWatch() { } if err := s.doWatch(); err != nil { - klog.Errorf("Unable to read config path %q: %v", s.path, err) + klog.ErrorS(err, "Unable to read config path", "path", s.path) if _, retryable := err.(*retryableError); !retryable { backOff.Next(backOffID, time.Now()) } @@ -102,7 +102,7 @@ func (s *sourceFile) doWatch() error { func (s *sourceFile) produceWatchEvent(e *fsnotify.Event) error { // Ignore file start with dots if strings.HasPrefix(filepath.Base(e.Name), ".") { - klog.V(4).Infof("Ignored pod manifest: %s, because it starts with dots", e.Name) + klog.V(4).InfoS("Ignored pod manifest, because it starts with dots", "eventName", e.Name) return nil } var eventType podEventType diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file_unsupported.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file_unsupported.go index 5b58246763a2..7a262f421d92 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file_unsupported.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file_unsupported.go @@ -25,7 +25,7 @@ import ( ) func (s *sourceFile) startWatch() { - klog.Errorf("Watching source file is unsupported in this build") + klog.ErrorS(nil, "Watching source file is unsupported in this build") } func (s *sourceFile) consumeWatchEvent(e *watchEvent) error { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/flags.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/flags.go index 9fd5fe6b3030..80d0c77f41d9 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/flags.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/flags.go @@ -88,8 +88,6 @@ func (s *ContainerRuntimeOptions) AddFlags(fs *pflag.FlagSet) { // General settings. fs.StringVar(&s.ContainerRuntime, "container-runtime", s.ContainerRuntime, "The container runtime to use. Possible values: 'docker', 'remote'.") fs.StringVar(&s.RuntimeCgroups, "runtime-cgroups", s.RuntimeCgroups, "Optional absolute name of cgroups to create and run the runtime in.") - _ = fs.Bool("redirect-container-streaming", false, "[REMOVED]") // TODO: Delete in v1.22 - fs.MarkDeprecated("redirect-container-streaming", "Container streaming redirection has been removed from the kubelet as of v1.20, and this flag will be removed in v1.22. For more details, see http://git.k8s.io/enhancements/keps/sig-node/20191205-container-streaming-requests.md") // Docker-specific settings. fs.StringVar(&s.DockershimRootDirectory, "experimental-dockershim-root-directory", s.DockershimRootDirectory, "Path to the dockershim root directory.") diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/http.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/http.go index 710abb089b0e..b0b49e517c37 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/http.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/http.go @@ -54,7 +54,7 @@ func NewSourceURL(url string, header http.Header, nodeName types.NodeName, perio // read the manifest URL passed to kubelet. client: &http.Client{Timeout: 10 * time.Second}, } - klog.V(1).Infof("Watching URL %s", url) + klog.V(1).InfoS("Watching URL", "URL", url) go wait.Until(config.run, period, wait.NeverStop) } @@ -63,16 +63,16 @@ func (s *sourceURL) run() { // Don't log this multiple times per minute. The first few entries should be // enough to get the point across. if s.failureLogs < 3 { - klog.Warningf("Failed to read pods from URL: %v", err) + klog.InfoS("Failed to read pods from URL", "err", err) } else if s.failureLogs == 3 { - klog.Warningf("Failed to read pods from URL. Dropping verbosity of this message to V(4): %v", err) + klog.InfoS("Failed to read pods from URL. Dropping verbosity of this message to V(4)", "err", err) } else { - klog.V(4).Infof("Failed to read pods from URL: %v", err) + klog.V(4).InfoS("Failed to read pods from URL", "err", err) } s.failureLogs++ } else { if s.failureLogs > 0 { - klog.Info("Successfully read pods from URL.") + klog.InfoS("Successfully read pods from URL") s.failureLogs = 0 } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/container_gc.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/container_gc.go index 1b3cb192c21a..c1df294a9639 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/container_gc.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/container_gc.go @@ -82,6 +82,6 @@ func (cgc *realContainerGC) GarbageCollect() error { } func (cgc *realContainerGC) DeleteAllUnusedContainers() error { - klog.Infof("attempting to delete unused containers") + klog.InfoS("Attempting to delete unused containers") return cgc.runtime.GarbageCollect(cgc.policy, cgc.sourcesReadyProvider.AllReady(), true) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go index 4b207b99d848..7e3314fec017 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go @@ -31,7 +31,6 @@ import ( "k8s.io/client-go/tools/record" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" podutil "k8s.io/kubernetes/pkg/api/v1/pod" - "k8s.io/kubernetes/pkg/kubelet/util/format" hashutil "k8s.io/kubernetes/pkg/util/hash" "k8s.io/kubernetes/third_party/forked/golang/expansion" utilsnet "k8s.io/utils/net" @@ -82,13 +81,13 @@ func ShouldContainerBeRestarted(container *v1.Container, pod *v1.Pod, podStatus } // Check RestartPolicy for dead container if pod.Spec.RestartPolicy == v1.RestartPolicyNever { - klog.V(4).Infof("Already ran container %q of pod %q, do nothing", container.Name, format.Pod(pod)) + klog.V(4).InfoS("Already ran container, do nothing", "pod", klog.KObj(pod), "containerName", container.Name) return false } if pod.Spec.RestartPolicy == v1.RestartPolicyOnFailure { // Check the exit code. if status.ExitCode == 0 { - klog.V(4).Infof("Already successfully ran container %q of pod %q, do nothing", container.Name, format.Pod(pod)) + klog.V(4).InfoS("Already successfully ran container, do nothing", "pod", klog.KObj(pod), "containerName", container.Name) return false } } @@ -341,7 +340,7 @@ func MakePortMappings(container *v1.Container) (ports []PortMapping) { // Protect against a port name being used more than once in a container. if _, ok := names[name]; ok { - klog.Warningf("Port name conflicted, %q is defined more than once", name) + klog.InfoS("Port name conflicted, it is defined more than once", "portName", name) continue } ports = append(ports, pm) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go index b8014cea5f2e..52180087a155 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go @@ -204,7 +204,7 @@ func BuildContainerID(typ, ID string) ContainerID { func ParseContainerID(containerID string) ContainerID { var id ContainerID if err := id.ParseString(containerID); err != nil { - klog.Error(err) + klog.ErrorS(err, "Parsing containerID failed") } return id } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/remote/util/util_unix.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/remote/util/util_unix.go index ef067bd4c464..e5e2d7bedeab 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/remote/util/util_unix.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/remote/util/util_unix.go @@ -100,7 +100,7 @@ func parseEndpointWithFallbackProtocol(endpoint string, fallbackProtocol string) fallbackEndpoint := fallbackProtocol + "://" + endpoint protocol, addr, err = parseEndpoint(fallbackEndpoint) if err == nil { - klog.Warningf("Using %q as endpoint is deprecated, please consider using full url format %q.", endpoint, fallbackEndpoint) + klog.InfoS("Using this format as endpoint is deprecated, please consider using full url format.", "deprecatedFormat", endpoint, "fullURLFormat", fallbackEndpoint) } } return diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/httpstream.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/httpstream.go index 41911305487c..5b0016c3c2f5 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/httpstream.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/httpstream.go @@ -42,7 +42,7 @@ func handleHTTPStreams(req *http.Request, w http.ResponseWriter, portForwarder P } streamChan := make(chan httpstream.Stream, 1) - klog.V(5).Infof("Upgrading port forward response") + klog.V(5).InfoS("Upgrading port forward response") upgrader := spdy.NewResponseUpgrader() conn := upgrader.UpgradeResponse(w, req, httpStreamReceived(streamChan)) if conn == nil { @@ -50,7 +50,7 @@ func handleHTTPStreams(req *http.Request, w http.ResponseWriter, portForwarder P } defer conn.Close() - klog.V(5).Infof("(conn=%p) setting port forwarding streaming connection idle timeout to %v", conn, idleTimeout) + klog.V(5).InfoS("Connection setting port forwarding streaming connection idle timeout", "connection", conn, "idleTimeout", idleTimeout) conn.SetIdleTimeout(idleTimeout) h := &httpStreamHandler{ @@ -121,11 +121,11 @@ func (h *httpStreamHandler) getStreamPair(requestID string) (*httpStreamPair, bo defer h.streamPairsLock.Unlock() if p, ok := h.streamPairs[requestID]; ok { - klog.V(5).Infof("(conn=%p, request=%s) found existing stream pair", h.conn, requestID) + klog.V(5).InfoS("Connection request found existing stream pair", "connection", h.conn, "request", requestID) return p, false } - klog.V(5).Infof("(conn=%p, request=%s) creating new stream pair", h.conn, requestID) + klog.V(5).InfoS("Connection request creating new stream pair", "connection", h.conn, "request", requestID) p := newPortForwardPair(requestID) h.streamPairs[requestID] = p @@ -143,7 +143,7 @@ func (h *httpStreamHandler) monitorStreamPair(p *httpStreamPair, timeout <-chan utilruntime.HandleError(err) p.printError(err.Error()) case <-p.complete: - klog.V(5).Infof("(conn=%v, request=%s) successfully received error and data streams", h.conn, p.requestID) + klog.V(5).InfoS("Connection request successfully received error and data streams", "connection", h.conn, "request", p.requestID) } h.removeStreamPair(p.requestID) } @@ -163,6 +163,10 @@ func (h *httpStreamHandler) removeStreamPair(requestID string) { h.streamPairsLock.Lock() defer h.streamPairsLock.Unlock() + if h.conn != nil { + pair := h.streamPairs[requestID] + h.conn.RemoveStreams(pair.dataStream, pair.errorStream) + } delete(h.streamPairs, requestID) } @@ -170,7 +174,7 @@ func (h *httpStreamHandler) removeStreamPair(requestID string) { func (h *httpStreamHandler) requestID(stream httpstream.Stream) string { requestID := stream.Headers().Get(api.PortForwardRequestIDHeader) if len(requestID) == 0 { - klog.V(5).Infof("(conn=%p) stream received without %s header", h.conn, api.PortForwardRequestIDHeader) + klog.V(5).InfoS("Connection stream received without requestID header", "connection", h.conn) // If we get here, it's because the connection came from an older client // that isn't generating the request id header // (https://github.com/kubernetes/kubernetes/blob/843134885e7e0b360eb5441e85b1410a8b1a7a0c/pkg/client/unversioned/portforward/portforward.go#L258-L287) @@ -197,7 +201,7 @@ func (h *httpStreamHandler) requestID(stream httpstream.Stream) string { requestID = strconv.Itoa(int(stream.Identifier()) - 2) } - klog.V(5).Infof("(conn=%p) automatically assigning request ID=%q from stream type=%s, stream ID=%d", h.conn, requestID, streamType, stream.Identifier()) + klog.V(5).InfoS("Connection automatically assigning request ID from stream type and stream ID", "connection", h.conn, "request", requestID, "streamType", streamType, "stream", stream.Identifier()) } return requestID } @@ -206,17 +210,17 @@ func (h *httpStreamHandler) requestID(stream httpstream.Stream) string { // streams, invoking portForward for each complete stream pair. The loop exits // when the httpstream.Connection is closed. func (h *httpStreamHandler) run() { - klog.V(5).Infof("(conn=%p) waiting for port forward streams", h.conn) + klog.V(5).InfoS("Connection waiting for port forward streams", "connection", h.conn) Loop: for { select { case <-h.conn.CloseChan(): - klog.V(5).Infof("(conn=%p) upgraded connection closed", h.conn) + klog.V(5).InfoS("Connection upgraded connection closed", "connection", h.conn) break Loop case stream := <-h.streamChan: requestID := h.requestID(stream) streamType := stream.Headers().Get(api.StreamType) - klog.V(5).Infof("(conn=%p, request=%s) received new stream of type %s", h.conn, requestID, streamType) + klog.V(5).InfoS("Connection request received new type of stream", "connection", h.conn, "request", requestID, "streamType", streamType) p, created := h.getStreamPair(requestID) if created { @@ -242,9 +246,9 @@ func (h *httpStreamHandler) portForward(p *httpStreamPair) { portString := p.dataStream.Headers().Get(api.PortHeader) port, _ := strconv.ParseInt(portString, 10, 32) - klog.V(5).Infof("(conn=%p, request=%s) invoking forwarder.PortForward for port %s", h.conn, p.requestID, portString) + klog.V(5).InfoS("Connection request invoking forwarder.PortForward for port", "connection", h.conn, "request", p.requestID, "port", portString) err := h.forwarder.PortForward(h.pod, h.uid, int32(port), p.dataStream) - klog.V(5).Infof("(conn=%p, request=%s) done invoking forwarder.PortForward for port %s", h.conn, p.requestID, portString) + klog.V(5).InfoS("Connection request done invoking forwarder.PortForward for port", "connection", h.conn, "request", p.requestID, "port", portString) if err != nil { msg := fmt.Errorf("error forwarding port %d to pod %s, uid %v: %v", port, h.pod, h.uid, err) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/websocket.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/websocket.go index 8b5428cb6d80..d62d9d3f05fc 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/websocket.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/portforward/websocket.go @@ -185,9 +185,9 @@ func (h *websocketStreamHandler) portForward(p *websocketStreamPair) { defer p.dataStream.Close() defer p.errorStream.Close() - klog.V(5).Infof("(conn=%p) invoking forwarder.PortForward for port %d", h.conn, p.port) + klog.V(5).InfoS("Connection invoking forwarder.PortForward for port", "connection", h.conn, "port", p.port) err := h.forwarder.PortForward(h.pod, h.uid, p.port, p.dataStream) - klog.V(5).Infof("(conn=%p) done invoking forwarder.PortForward for port %d", h.conn, p.port) + klog.V(5).InfoS("Connection done invoking forwarder.PortForward for port", "connection", h.conn, "port", p.port) if err != nil { msg := fmt.Errorf("error forwarding port %d to pod %s, uid %v: %v", p.port, h.pod, h.uid, err) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/remotecommand/httpstream.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/remotecommand/httpstream.go index 9be6c4345e21..c1054152d350 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/remotecommand/httpstream.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cri/streaming/remotecommand/httpstream.go @@ -54,7 +54,7 @@ func NewOptions(req *http.Request) (*Options, error) { stderr := req.FormValue(api.ExecStderrParam) == "1" if tty && stderr { // TODO: make this an error before we reach this method - klog.V(4).Infof("Access to exec with tty and stderr is not supported, bypassing stderr") + klog.V(4).InfoS("Access to exec with tty and stderr is not supported, bypassing stderr") stderr = false } @@ -155,7 +155,7 @@ func createHTTPStreamStreams(req *http.Request, w http.ResponseWriter, opts *Opt case remotecommandconsts.StreamProtocolV2Name: handler = &v2ProtocolHandler{} case "": - klog.V(4).Infof("Client did not request protocol negotiation. Falling back to %q", remotecommandconsts.StreamProtocolV1Name) + klog.V(4).InfoS("Client did not request protocol negotiation. Falling back", "protocol", remotecommandconsts.StreamProtocolV1Name) fallthrough case remotecommandconsts.StreamProtocolV1Name: handler = &v1ProtocolHandler{} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/cm/container_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/cm/container_manager_linux.go index 6e4db6555a1e..f515a5bfb25e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/cm/container_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/cm/container_manager_linux.go @@ -28,6 +28,7 @@ import ( "github.com/opencontainers/runc/libcontainer/cgroups" cgroupfs "github.com/opencontainers/runc/libcontainer/cgroups/fs" "github.com/opencontainers/runc/libcontainer/configs" + libcontainerdevices "github.com/opencontainers/runc/libcontainer/devices" utilversion "k8s.io/apimachinery/pkg/util/version" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/klog/v2" @@ -126,10 +127,10 @@ func createCgroupManager(name string) (cgroups.Manager, error) { Memory: int64(memoryLimit), MemorySwap: -1, SkipDevices: true, - Devices: []*configs.DeviceRule{ + Devices: []*libcontainerdevices.Rule{ { - Minor: configs.Wildcard, - Major: configs.Wildcard, + Minor: libcontainerdevices.Wildcard, + Major: libcontainerdevices.Wildcard, Type: 'a', Permissions: "rwm", Allow: true, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_container.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_container.go index 55d8b90908c2..2171e60bee49 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_container.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_container.go @@ -180,6 +180,7 @@ func (ds *dockerService) CreateContainer(_ context.Context, r *runtimeapi.Create } hc.Resources.Devices = devices + //lint:ignore SA1019 backwards compatibility securityOpts, err := ds.getSecurityOpts(config.GetLinux().GetSecurityContext().GetSeccompProfilePath(), securityOptSeparator) if err != nil { return nil, fmt.Errorf("failed to generate security options for container %q: %v", config.Metadata.Name, err) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go index 793698341895..a0d27fe38eaa 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go @@ -97,7 +97,7 @@ func (ds *dockerService) RunPodSandbox(ctx context.Context, r *runtimeapi.RunPod } // NOTE: To use a custom sandbox image in a private repository, users need to configure the nodes with credentials properly. - // see: http://kubernetes.io/docs/user-guide/images/#configuring-nodes-to-authenticate-to-a-private-repository + // see: https://kubernetes.io/docs/user-guide/images/#configuring-nodes-to-authenticate-to-a-private-registry // Only pull sandbox image when it's not present - v1.PullIfNotPresent. if err := ensureSandboxImageExists(ds.client, image); err != nil { return nil, err diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/exec.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/exec.go index b59867156ff7..8a59a22b0b39 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/exec.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/exec.go @@ -26,8 +26,10 @@ import ( dockertypes "github.com/docker/docker/api/types" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/tools/remotecommand" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/features" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker" ) @@ -106,7 +108,7 @@ func (*NativeExecHandler) ExecInContainer(ctx context.Context, client libdocker. ExecStarted: execStarted, } - if timeout > 0 { + if timeout > 0 && utilfeature.DefaultFeatureGate.Enabled(features.ExecProbeTimeout) { var cancel context.CancelFunc ctx, cancel = context.WithTimeout(ctx, timeout) defer cancel() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/helpers_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/helpers_linux.go index a92725394415..0020d1886d0f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/helpers_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/helpers_linux.go @@ -119,6 +119,7 @@ func (ds *dockerService) updateCreateConfig( CPUQuota: rOpts.CpuQuota, CPUPeriod: rOpts.CpuPeriod, CpusetCpus: rOpts.CpusetCpus, + CpusetMems: rOpts.CpusetMems, } createConfig.HostConfig.OomScoreAdj = int(rOpts.OomScoreAdj) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker/kube_docker_client.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker/kube_docker_client.go index 81b6582e2bc9..3dfe4cf0145b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker/kube_docker_client.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker/kube_docker_client.go @@ -145,7 +145,7 @@ func (d *kubeDockerClient) CreateContainer(opts dockertypes.ContainerCreateConfi if opts.HostConfig != nil && opts.HostConfig.ShmSize <= 0 { opts.HostConfig.ShmSize = defaultShmSize } - createResp, err := d.client.ContainerCreate(ctx, opts.Config, opts.HostConfig, opts.NetworkingConfig, opts.Name) + createResp, err := d.client.ContainerCreate(ctx, opts.Config, opts.HostConfig, opts.NetworkingConfig, nil, opts.Name) if ctxErr := contextError(ctx); ctxErr != nil { return nil, ctxErr } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/network/cni/cni_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/network/cni/cni_windows.go index e76f69816c99..e9952ddb9836 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/network/cni/cni_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/network/cni/cni_windows.go @@ -54,9 +54,9 @@ func (plugin *cniNetworkPlugin) GetPodNetworkStatus(namespace string, name strin cniTimeoutCtx, cancelFunc := context.WithTimeout(context.Background(), network.CNITimeoutSec*time.Second) defer cancelFunc() result, err := plugin.addToNetwork(cniTimeoutCtx, plugin.getDefaultNetwork(), name, namespace, id, netnsPath, nil, nil) - klog.V(5).Infof("GetPodNetworkStatus result %+v", result) + klog.V(5).InfoS("GetPodNetworkStatus", "result", result) if err != nil { - klog.Errorf("error while adding to cni network: %s", err) + klog.ErrorS(err, "Got error while adding to cni network") return nil, err } @@ -64,7 +64,7 @@ func (plugin *cniNetworkPlugin) GetPodNetworkStatus(namespace string, name strin var result020 *cniTypes020.Result result020, err = cniTypes020.GetResult(result) if err != nil { - klog.Errorf("error while cni parsing result: %s", err) + klog.ErrorS(err, "Got error while cni parsing result") return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/eviction/eviction_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/eviction/eviction_manager.go index db43a652cf0c..338858e0dcf2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/eviction/eviction_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/eviction/eviction_manager.go @@ -437,8 +437,9 @@ func (m *managerImpl) reclaimNodeLevelResources(signalToReclaim evictionapi.Sign observations, _ := makeSignalObservations(summary) debugLogObservations("observations after resource reclaim", observations) - // determine the set of thresholds met independent of grace period - thresholds := thresholdsMet(m.config.Thresholds, observations, false) + // evaluate all thresholds independently of their grace period to see if with + // the new observations, we think we have met min reclaim goals + thresholds := thresholdsMet(m.config.Thresholds, observations, true) debugLogThresholdsWithObservation("thresholds after resource reclaim - ignoring grace period", thresholds, observations) if len(thresholds) == 0 { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/images/image_gc_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/images/image_gc_manager.go index e168b1d2634f..ac1651d25181 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/images/image_gc_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/images/image_gc_manager.go @@ -183,7 +183,7 @@ func (im *realImageGCManager) Start() { } _, err := im.detectImages(ts) if err != nil { - klog.Warningf("[imageGCManager] Failed to monitor images: %v", err) + klog.InfoS("Failed to monitor images", "err", err) } else { im.initialized = true } @@ -193,7 +193,7 @@ func (im *realImageGCManager) Start() { go wait.Until(func() { images, err := im.runtime.ListImages() if err != nil { - klog.Warningf("[imageGCManager] Failed to update image list: %v", err) + klog.InfoS("Failed to update image list", "err", err) } else { im.imageCache.set(images) } @@ -227,7 +227,7 @@ func (im *realImageGCManager) detectImages(detectTime time.Time) (sets.String, e // Make a set of images in use by containers. for _, pod := range pods { for _, container := range pod.Containers { - klog.V(5).Infof("Pod %s/%s, container %s uses image %s(%s)", pod.Namespace, pod.Name, container.Name, container.Image, container.ImageID) + klog.V(5).InfoS("Container uses image", "pod", klog.KRef(pod.Namespace, pod.Name), "containerName", container.Name, "containerImage", container.Image, "imageID", container.ImageID) imagesInUse.Insert(container.ImageID) } } @@ -238,12 +238,12 @@ func (im *realImageGCManager) detectImages(detectTime time.Time) (sets.String, e im.imageRecordsLock.Lock() defer im.imageRecordsLock.Unlock() for _, image := range images { - klog.V(5).Infof("Adding image ID %s to currentImages", image.ID) + klog.V(5).InfoS("Adding image ID to currentImages", "imageID", image.ID) currentImages.Insert(image.ID) // New image, set it as detected now. if _, ok := im.imageRecords[image.ID]; !ok { - klog.V(5).Infof("Image ID %s is new", image.ID) + klog.V(5).InfoS("Image ID is new", "imageID", image.ID) im.imageRecords[image.ID] = &imageRecord{ firstDetected: detectTime, } @@ -251,18 +251,18 @@ func (im *realImageGCManager) detectImages(detectTime time.Time) (sets.String, e // Set last used time to now if the image is being used. if isImageUsed(image.ID, imagesInUse) { - klog.V(5).Infof("Setting Image ID %s lastUsed to %v", image.ID, now) + klog.V(5).InfoS("Setting Image ID lastUsed", "imageID", image.ID, "lastUsed", now) im.imageRecords[image.ID].lastUsed = now } - klog.V(5).Infof("Image ID %s has size %d", image.ID, image.Size) + klog.V(5).InfoS("Image ID has size", "imageID", image.ID, "size", image.Size) im.imageRecords[image.ID].size = image.Size } // Remove old images from our records. for image := range im.imageRecords { if !currentImages.Has(image) { - klog.V(5).Infof("Image ID %s is no longer present; removing from imageRecords", image) + klog.V(5).InfoS("Image ID is no longer present; removing from imageRecords", "imageID", image) delete(im.imageRecords, image) } } @@ -286,7 +286,7 @@ func (im *realImageGCManager) GarbageCollect() error { } if available > capacity { - klog.Warningf("available %d is larger than capacity %d", available, capacity) + klog.InfoS("Availability is larger than capacity", "available", available, "capacity", capacity) available = capacity } @@ -301,7 +301,7 @@ func (im *realImageGCManager) GarbageCollect() error { usagePercent := 100 - int(available*100/capacity) if usagePercent >= im.policy.HighThresholdPercent { amountToFree := capacity*int64(100-im.policy.LowThresholdPercent)/100 - available - klog.Infof("[imageGCManager]: Disk usage on image filesystem is at %d%% which is over the high threshold (%d%%). Trying to free %d bytes down to the low threshold (%d%%).", usagePercent, im.policy.HighThresholdPercent, amountToFree, im.policy.LowThresholdPercent) + klog.InfoS("Disk usage on image filesystem is over the high threshold, trying to free bytes down to the low threshold", "usage", usagePercent, "highThreshold", im.policy.HighThresholdPercent, "amountToFree", amountToFree, "lowThreshold", im.policy.LowThresholdPercent) freed, err := im.freeSpace(amountToFree, time.Now()) if err != nil { return err @@ -318,7 +318,7 @@ func (im *realImageGCManager) GarbageCollect() error { } func (im *realImageGCManager) DeleteUnusedImages() error { - klog.Infof("attempting to delete unused images") + klog.InfoS("Attempting to delete unused images") _, err := im.freeSpace(math.MaxInt64, time.Now()) return err } @@ -342,7 +342,7 @@ func (im *realImageGCManager) freeSpace(bytesToFree int64, freeTime time.Time) ( images := make([]evictionInfo, 0, len(im.imageRecords)) for image, record := range im.imageRecords { if isImageUsed(image, imagesInUse) { - klog.V(5).Infof("Image ID %s is being used", image) + klog.V(5).InfoS("Image ID is being used", "imageID", image) continue } images = append(images, evictionInfo{ @@ -356,10 +356,10 @@ func (im *realImageGCManager) freeSpace(bytesToFree int64, freeTime time.Time) ( var deletionErrors []error spaceFreed := int64(0) for _, image := range images { - klog.V(5).Infof("Evaluating image ID %s for possible garbage collection", image.id) + klog.V(5).InfoS("Evaluating image ID for possible garbage collection", "imageID", image.id) // Images that are currently in used were given a newer lastUsed. if image.lastUsed.Equal(freeTime) || image.lastUsed.After(freeTime) { - klog.V(5).Infof("Image ID %s has lastUsed=%v which is >= freeTime=%v, not eligible for garbage collection", image.id, image.lastUsed, freeTime) + klog.V(5).InfoS("Image ID was used too recently, not eligible for garbage collection", "imageID", image.id, "lastUsed", image.lastUsed, "freeTime", freeTime) continue } @@ -367,12 +367,12 @@ func (im *realImageGCManager) freeSpace(bytesToFree int64, freeTime time.Time) ( // In such a case, the image may have just been pulled down, and will be used by a container right away. if freeTime.Sub(image.firstDetected) < im.policy.MinAge { - klog.V(5).Infof("Image ID %s has age %v which is less than the policy's minAge of %v, not eligible for garbage collection", image.id, freeTime.Sub(image.firstDetected), im.policy.MinAge) + klog.V(5).InfoS("Image ID's age is less than the policy's minAge, not eligible for garbage collection", "imageID", image.id, "age", freeTime.Sub(image.firstDetected), "minAge", im.policy.MinAge) continue } // Remove image. Continue despite errors. - klog.Infof("[imageGCManager]: Removing image %q to free %d bytes", image.id, image.size) + klog.InfoS("Removing image to free bytes", "imageID", image.id, "size", image.size) err := im.runtime.RemoveImage(container.ImageSpec{Image: image.id}) if err != nil { deletionErrors = append(deletionErrors, err) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/images/image_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/images/image_manager.go index d41ebcebc38a..6d8b5f334294 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/images/image_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/images/image_manager.go @@ -90,7 +90,7 @@ func (m *imageManager) EnsureImageExists(pod *v1.Pod, container *v1.Container, p logPrefix := fmt.Sprintf("%s/%s/%s", pod.Namespace, pod.Name, container.Image) ref, err := kubecontainer.GenerateContainerRef(pod, container) if err != nil { - klog.Errorf("Couldn't make a ref to pod %v, container %v: '%v'", pod.Name, container.Name, err) + klog.ErrorS(err, "Couldn't make a ref to pod", "pod", klog.KObj(pod), "containerName", container.Name) } // If the image contains no tag or digest, a default tag should be applied. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go index a626cac7474f..00890d662b86 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go @@ -124,9 +124,6 @@ const ( // Max amount of time to wait for the container runtime to come up. maxWaitForContainerRuntime = 30 * time.Second - // Max amount of time to wait for node list/watch to initially sync - maxWaitForAPIServerSync = 10 * time.Second - // nodeStatusUpdateRetry specifies how many times kubelet retries when posting node status failed. nodeStatusUpdateRetry = 5 @@ -257,7 +254,7 @@ type DockerOptions struct { // makePodSourceConfig creates a config.PodConfig from the given // KubeletConfiguration or returns an error. -func makePodSourceConfig(kubeCfg *kubeletconfiginternal.KubeletConfiguration, kubeDeps *Dependencies, nodeName types.NodeName) (*config.PodConfig, error) { +func makePodSourceConfig(kubeCfg *kubeletconfiginternal.KubeletConfiguration, kubeDeps *Dependencies, nodeName types.NodeName, nodeHasSynced func() bool) (*config.PodConfig, error) { manifestURLHeader := make(http.Header) if len(kubeCfg.StaticPodURLHeader) > 0 { for k, v := range kubeCfg.StaticPodURLHeader { @@ -272,19 +269,19 @@ func makePodSourceConfig(kubeCfg *kubeletconfiginternal.KubeletConfiguration, ku // define file config source if kubeCfg.StaticPodPath != "" { - klog.Infof("Adding pod path: %v", kubeCfg.StaticPodPath) + klog.InfoS("Adding static pod path", "path", kubeCfg.StaticPodPath) config.NewSourceFile(kubeCfg.StaticPodPath, nodeName, kubeCfg.FileCheckFrequency.Duration, cfg.Channel(kubetypes.FileSource)) } // define url config source if kubeCfg.StaticPodURL != "" { - klog.Infof("Adding pod url %q with HTTP header %v", kubeCfg.StaticPodURL, manifestURLHeader) + klog.InfoS("Adding pod URL with HTTP header", "URL", kubeCfg.StaticPodURL, "header", manifestURLHeader) config.NewSourceURL(kubeCfg.StaticPodURL, manifestURLHeader, nodeName, kubeCfg.HTTPCheckFrequency.Duration, cfg.Channel(kubetypes.HTTPSource)) } if kubeDeps.KubeClient != nil { - klog.Infof("Watching apiserver") - config.NewSourceApiserver(kubeDeps.KubeClient, nodeName, cfg.Channel(kubetypes.ApiserverSource)) + klog.InfoS("Adding apiserver pod source") + config.NewSourceApiserver(kubeDeps.KubeClient, nodeName, nodeHasSynced, cfg.Channel(kubetypes.ApiserverSource)) } return cfg, nil } @@ -307,7 +304,7 @@ func PreInitRuntimeService(kubeCfg *kubeletconfiginternal.KubeletConfiguration, switch containerRuntime { case kubetypes.DockerContainerRuntime: - klog.Warningf("Using dockershim is deprecated, please consider using a full-fledged CRI implementation") + klog.InfoS("Using dockershim is deprecated, please consider using a full-fledged CRI implementation") if err := runDockershim( kubeCfg, kubeDeps, @@ -390,9 +387,32 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, } } + var nodeHasSynced cache.InformerSynced + var nodeLister corelisters.NodeLister + + // If kubeClient == nil, we are running in standalone mode (i.e. no API servers) + // If not nil, we are running as part of a cluster and should sync w/API + if kubeDeps.KubeClient != nil { + kubeInformers := informers.NewSharedInformerFactoryWithOptions(kubeDeps.KubeClient, 0, informers.WithTweakListOptions(func(options *metav1.ListOptions) { + options.FieldSelector = fields.Set{metav1.ObjectNameField: string(nodeName)}.String() + })) + nodeLister = kubeInformers.Core().V1().Nodes().Lister() + nodeHasSynced = func() bool { + return kubeInformers.Core().V1().Nodes().Informer().HasSynced() + } + kubeInformers.Start(wait.NeverStop) + klog.InfoS("Attempting to sync node with API server") + } else { + // we don't have a client to sync! + nodeIndexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) + nodeLister = corelisters.NewNodeLister(nodeIndexer) + nodeHasSynced = func() bool { return true } + klog.InfoS("Kubelet is running in standalone mode, will skip API server sync") + } + if kubeDeps.PodConfig == nil { var err error - kubeDeps.PodConfig, err = makePodSourceConfig(kubeCfg, kubeDeps, nodeName) + kubeDeps.PodConfig, err = makePodSourceConfig(kubeCfg, kubeDeps, nodeName, nodeHasSynced) if err != nil { return nil, err } @@ -433,8 +453,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, var serviceLister corelisters.ServiceLister var serviceHasSynced cache.InformerSynced - // If kubeClient == nil, we are running in standalone mode (i.e. no API servers) - // If not nil, we are running as part of a cluster and should sync w/API if kubeDeps.KubeClient != nil { kubeInformers := informers.NewSharedInformerFactory(kubeDeps.KubeClient, 0) serviceLister = kubeInformers.Core().V1().Services().Lister() @@ -446,31 +464,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, serviceHasSynced = func() bool { return true } } - var nodeHasSynced cache.InformerSynced - var nodeLister corelisters.NodeLister - - if kubeDeps.KubeClient != nil { - kubeInformers := informers.NewSharedInformerFactoryWithOptions(kubeDeps.KubeClient, 0, informers.WithTweakListOptions(func(options *metav1.ListOptions) { - options.FieldSelector = fields.Set{metav1.ObjectNameField: string(nodeName)}.String() - })) - nodeLister = kubeInformers.Core().V1().Nodes().Lister() - nodeHasSynced = func() bool { - if kubeInformers.Core().V1().Nodes().Informer().HasSynced() { - return true - } - klog.Infof("kubelet nodes not sync") - return false - } - kubeInformers.Start(wait.NeverStop) - klog.Info("Kubelet client is not nil") - } else { - // we dont have a client to sync! - nodeIndexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) - nodeLister = corelisters.NewNodeLister(nodeIndexer) - nodeHasSynced = func() bool { return true } - klog.Info("Kubelet client is nil") - } - // construct a node reference used for events nodeRef := &v1.ObjectReference{ Kind: "Node", @@ -488,7 +481,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, for _, ipEntry := range kubeCfg.ClusterDNS { ip := net.ParseIP(ipEntry) if ip == nil { - klog.Warningf("Invalid clusterDNS ip '%q'", ipEntry) + klog.InfoS("Invalid clusterDNS IP", "IP", ipEntry) } else { clusterDNS = append(clusterDNS, ip) } @@ -576,7 +569,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, klet.configMapManager = configMapManager if klet.experimentalHostUserNamespaceDefaulting { - klog.Info("Experimental host user namespace defaulting is enabled.") + klog.InfoS("Experimental host user namespace defaulting is enabled") } machineInfo, err := klet.cadvisor.MachineInfo() @@ -601,7 +594,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, klet.statusManager = status.NewManager(klet.kubeClient, klet.podManager, klet) - klet.resourceAnalyzer = serverstats.NewResourceAnalyzer(klet, kubeCfg.VolumeStatsAggPeriod.Duration) + klet.resourceAnalyzer = serverstats.NewResourceAnalyzer(klet, kubeCfg.VolumeStatsAggPeriod.Duration, kubeDeps.Recorder) klet.dockerLegacyService = kubeDeps.dockerLegacyService klet.runtimeService = kubeDeps.RemoteRuntimeService @@ -666,8 +659,8 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, klet.runtimeCache = runtimeCache // common provider to get host file system usage associated with a pod managed by kubelet - hostStatsProvider := stats.NewHostStatsProvider(kubecontainer.RealOS{}, func(podUID types.UID) string { - return getEtcHostsPath(klet.getPodDir(podUID)) + hostStatsProvider := stats.NewHostStatsProvider(kubecontainer.RealOS{}, func(podUID types.UID) (string, bool) { + return getEtcHostsPath(klet.getPodDir(podUID)), klet.containerRuntime.SupportsSingleFileMapping() }) if kubeDeps.useLegacyCadvisorStats { klet.StatsProvider = stats.NewCadvisorStatsProvider( @@ -693,7 +686,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, klet.runtimeState = newRuntimeState(maxWaitForContainerRuntime) klet.runtimeState.addHealthCheck("PLEG", klet.pleg.Healthy) if _, err := klet.updatePodCIDR(kubeCfg.PodCIDR); err != nil { - klog.Errorf("Pod CIDR update failed %v", err) + klog.ErrorS(err, "Pod CIDR update failed") } // setup containerGC @@ -1267,11 +1260,11 @@ func (kl *Kubelet) setupDataDirs() error { if selinux.SELinuxEnabled() { err := selinux.SetFileLabel(pluginRegistrationDir, config.KubeletPluginsDirSELinuxLabel) if err != nil { - klog.Warningf("Unprivileged containerized plugins might not work. Could not set selinux context on %s: %v", pluginRegistrationDir, err) + klog.InfoS("Unprivileged containerized plugins might not work, could not set selinux context on plugin registration dir", "path", pluginRegistrationDir, "err", err) } err = selinux.SetFileLabel(pluginsDir, config.KubeletPluginsDirSELinuxLabel) if err != nil { - klog.Warningf("Unprivileged containerized plugins might not work. Could not set selinux context on %s: %v", pluginsDir, err) + klog.InfoS("Unprivileged containerized plugins might not work, could not set selinux context on plugins dir", "path", pluginsDir, "err", err) } } return nil @@ -1282,7 +1275,7 @@ func (kl *Kubelet) StartGarbageCollection() { loggedContainerGCFailure := false go wait.Until(func() { if err := kl.containerGC.GarbageCollect(); err != nil { - klog.Errorf("Container garbage collection failed: %v", err) + klog.ErrorS(err, "Container garbage collection failed") kl.recorder.Eventf(kl.nodeRef, v1.EventTypeWarning, events.ContainerGCFailed, err.Error()) loggedContainerGCFailure = true } else { @@ -1292,13 +1285,13 @@ func (kl *Kubelet) StartGarbageCollection() { loggedContainerGCFailure = false } - klog.V(vLevel).Infof("Container garbage collection succeeded") + klog.V(vLevel).InfoS("Container garbage collection succeeded") } }, ContainerGCPeriod, wait.NeverStop) // when the high threshold is set to 100, stub the image GC manager if kl.kubeletConfiguration.ImageGCHighThresholdPercent == 100 { - klog.V(2).Infof("ImageGCHighThresholdPercent is set 100, Disable image GC") + klog.V(2).InfoS("ImageGCHighThresholdPercent is set 100, Disable image GC") return } @@ -1306,11 +1299,11 @@ func (kl *Kubelet) StartGarbageCollection() { go wait.Until(func() { if err := kl.imageManager.GarbageCollect(); err != nil { if prevImageGCFailed { - klog.Errorf("Image garbage collection failed multiple times in a row: %v", err) + klog.ErrorS(err, "Image garbage collection failed multiple times in a row") // Only create an event for repeated failures kl.recorder.Eventf(kl.nodeRef, v1.EventTypeWarning, events.ImageGCFailed, err.Error()) } else { - klog.Errorf("Image garbage collection failed once. Stats initialization may not have completed yet: %v", err) + klog.ErrorS(err, "Image garbage collection failed once. Stats initialization may not have completed yet") } prevImageGCFailed = true } else { @@ -1320,7 +1313,7 @@ func (kl *Kubelet) StartGarbageCollection() { prevImageGCFailed = false } - klog.V(vLevel).Infof("Image garbage collection succeeded") + klog.V(vLevel).InfoS("Image garbage collection succeeded") } }, ImageGCPeriod, wait.NeverStop) } @@ -1371,7 +1364,8 @@ func (kl *Kubelet) initializeModules() error { func (kl *Kubelet) initializeRuntimeDependentModules() { if err := kl.cadvisor.Start(); err != nil { // Fail kubelet and rely on the babysitter to retry starting kubelet. - klog.Fatalf("Failed to start cAdvisor %v", err) + klog.ErrorS(err, "Failed to start cAdvisor") + os.Exit(1) } // trigger on-demand stats collection once so that we have capacity information for ephemeral storage. @@ -1381,12 +1375,14 @@ func (kl *Kubelet) initializeRuntimeDependentModules() { node, err := kl.getNodeAnyWay() if err != nil { // Fail kubelet and rely on the babysitter to retry starting kubelet. - klog.Fatalf("Kubelet failed to get node info: %v", err) + klog.ErrorS(err, "Kubelet failed to get node info") + os.Exit(1) } // containerManager must start after cAdvisor because it needs filesystem capacity information if err := kl.containerManager.Start(node, kl.GetActivePods, kl.sourcesReady, kl.statusManager, kl.runtimeService); err != nil { // Fail kubelet and rely on the babysitter to retry starting kubelet. - klog.Fatalf("Failed to start ContainerManager %v", err) + klog.ErrorS(err, "Failed to start ContainerManager") + os.Exit(1) } // eviction manager must start after cadvisor because it needs to know if the container runtime has a dedicated imagefs kl.evictionManager.Start(kl.StatsProvider, kl.GetActivePods, kl.podResourcesAreReclaimed, evictionMonitoringPeriod) @@ -1399,13 +1395,13 @@ func (kl *Kubelet) initializeRuntimeDependentModules() { // Adding Registration Callback function for Device Manager kl.pluginManager.AddHandler(pluginwatcherapi.DevicePlugin, kl.containerManager.GetPluginRegistrationHandler()) // Start the plugin manager - klog.V(4).Infof("starting plugin manager") + klog.V(4).InfoS("Starting plugin manager") go kl.pluginManager.Run(kl.sourcesReady, wait.NeverStop) err = kl.shutdownManager.Start() if err != nil { // The shutdown manager is not critical for kubelet, so log failure, but don't block Kubelet startup if there was a failure starting it. - klog.Errorf("Failed to start node shutdown manager: %v", err) + klog.ErrorS(err, "Failed to start node shutdown manager") } } @@ -1415,7 +1411,7 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) { kl.logServer = http.StripPrefix("/logs/", http.FileServer(http.Dir("/var/log/"))) } if kl.kubeClient == nil { - klog.Warning("No api server defined - no node status update will be sent.") + klog.InfoS("No API server defined - no node status update will be sent") } // Start the cloud provider sync manager @@ -1425,7 +1421,8 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) { if err := kl.initializeModules(); err != nil { kl.recorder.Eventf(kl.nodeRef, v1.EventTypeWarning, events.KubeletSetupFailed, err.Error()) - klog.Fatal(err) + klog.ErrorS(err, "failed to initialize internal modules") + os.Exit(1) } // Start volume manager @@ -1539,7 +1536,9 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error { // since kubelet first saw the pod if firstSeenTime is set. metrics.PodWorkerStartDuration.Observe(metrics.SinceInSeconds(firstSeenTime)) } else { - klog.V(3).Infof("First seen time not recorded for pod %q", pod.UID) + klog.V(3).InfoS("First seen time not recorded for pod", + "podUID", pod.UID, + "pod", klog.KObj(pod)) } } @@ -1634,7 +1633,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error { if err := kl.killPod(pod, nil, podStatus, nil); err == nil { podKilled = true } else { - klog.Errorf("killPod for pod %q (podStatus=%v) failed: %v", format.Pod(pod), podStatus, err) + klog.ErrorS(err, "killPod failed", "pod", klog.KObj(pod), "podStatus", podStatus) } } // Create and Update pod's Cgroups @@ -1647,7 +1646,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error { if !(podKilled && pod.Spec.RestartPolicy == v1.RestartPolicyNever) { if !pcm.Exists(pod) { if err := kl.containerManager.UpdateQOSCgroups(); err != nil { - klog.V(2).Infof("Failed to update QoS cgroups while syncing pod: %v", err) + klog.V(2).InfoS("Failed to update QoS cgroups while syncing pod", "pod", klog.KObj(pod), "err", err) } if err := pcm.EnsureExists(pod); err != nil { kl.recorder.Eventf(pod, v1.EventTypeWarning, events.FailedToCreatePodContainer, "unable to ensure pod container exists: %v", err) @@ -1664,24 +1663,24 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error { if mirrorPod.DeletionTimestamp != nil || !kl.podManager.IsMirrorPodOf(mirrorPod, pod) { // The mirror pod is semantically different from the static pod. Remove // it. The mirror pod will get recreated later. - klog.Infof("Trying to delete pod %s %v", podFullName, mirrorPod.ObjectMeta.UID) + klog.InfoS("Trying to delete pod", "pod", klog.KObj(pod), "podUID", mirrorPod.ObjectMeta.UID) var err error deleted, err = kl.podManager.DeleteMirrorPod(podFullName, &mirrorPod.ObjectMeta.UID) if deleted { - klog.Warningf("Deleted mirror pod %q because it is outdated", format.Pod(mirrorPod)) + klog.InfoS("Deleted mirror pod because it is outdated", "pod", klog.KObj(mirrorPod)) } else if err != nil { - klog.Errorf("Failed deleting mirror pod %q: %v", format.Pod(mirrorPod), err) + klog.ErrorS(err, "Failed deleting mirror pod", "pod", klog.KObj(mirrorPod)) } } } if mirrorPod == nil || deleted { node, err := kl.GetNode() if err != nil || node.DeletionTimestamp != nil { - klog.V(4).Infof("No need to create a mirror pod, since node %q has been removed from the cluster", kl.nodeName) + klog.V(4).InfoS("No need to create a mirror pod, since node has been removed from the cluster", "node", klog.KRef("", string(kl.nodeName))) } else { - klog.V(4).Infof("Creating a mirror pod for static pod %q", format.Pod(pod)) + klog.V(4).InfoS("Creating a mirror pod for static pod", "pod", klog.KObj(pod)) if err := kl.podManager.CreateMirrorPod(pod); err != nil { - klog.Errorf("Failed creating a mirror pod for %q: %v", format.Pod(pod), err) + klog.ErrorS(err, "Failed creating a mirror pod for", "pod", klog.KObj(pod)) } } } @@ -1690,7 +1689,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error { // Make data directories for the pod if err := kl.makePodDataDirs(pod); err != nil { kl.recorder.Eventf(pod, v1.EventTypeWarning, events.FailedToMakePodDataDirectories, "error making pod data directories: %v", err) - klog.Errorf("Unable to make pod data directories for pod %q: %v", format.Pod(pod), err) + klog.ErrorS(err, "Unable to make pod data directories for pod", "pod", klog.KObj(pod)) return err } @@ -1699,7 +1698,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error { // Wait for volumes to attach/mount if err := kl.volumeManager.WaitForAttachAndMount(pod); err != nil { kl.recorder.Eventf(pod, v1.EventTypeWarning, events.FailedMountVolume, "Unable to attach or mount volumes: %v", err) - klog.Errorf("Unable to attach or mount volumes for pod %q: %v; skipping pod", format.Pod(pod), err) + klog.ErrorS(err, "Unable to attach or mount volumes for pod; skipping pod", "pod", klog.KObj(pod)) return err } } @@ -1844,7 +1843,7 @@ func (kl *Kubelet) canRunPod(pod *v1.Pod) lifecycle.PodAdmitResult { // no changes are seen to the configuration, will synchronize the last known desired // state every sync-frequency seconds. Never returns. func (kl *Kubelet) syncLoop(updates <-chan kubetypes.PodUpdate, handler SyncHandler) { - klog.Info("Starting kubelet main sync loop.") + klog.InfoS("Starting kubelet main sync loop") // The syncTicker wakes up kubelet to checks if there are any pod workers // that need to be sync'd. A one-second period is sufficient because the // sync interval is defaulted to 10s. @@ -1868,7 +1867,7 @@ func (kl *Kubelet) syncLoop(updates <-chan kubetypes.PodUpdate, handler SyncHand for { if err := kl.runtimeState.runtimeErrors(); err != nil { - klog.Errorf("skipping pod synchronization - %v", err) + klog.ErrorS(err, "Skipping pod synchronization") // exponential backoff time.Sleep(duration) duration = time.Duration(math.Min(float64(max), factor*float64(duration))) @@ -1924,7 +1923,7 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle // Update from a config source; dispatch it to the right handler // callback. if !open { - klog.Errorf("Update channel is closed. Exiting the sync loop.") + klog.ErrorS(nil, "Update channel is closed, exiting the sync loop") return false } @@ -1946,14 +1945,14 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle klog.V(4).InfoS("SyncLoop RECONCILE", "source", u.Source, "pods", format.Pods(u.Pods)) handler.HandlePodReconcile(u.Pods) case kubetypes.DELETE: - klog.V(2).Infof("SyncLoop DELETE", "source", u.Source, "pods", format.Pods(u.Pods)) + klog.V(2).InfoS("SyncLoop DELETE", "source", u.Source, "pods", format.Pods(u.Pods)) // DELETE is treated as a UPDATE because of graceful deletion. handler.HandlePodUpdates(u.Pods) case kubetypes.SET: // TODO: Do we want to support this? - klog.Errorf("Kubelet does not support snapshot update") + klog.ErrorS(nil, "Kubelet does not support snapshot update") default: - klog.Errorf("Invalid event type received: %d.", u.Op) + klog.ErrorS(nil, "Invalid operation type received", "operation", u.Op) } kl.sourcesReady.AddSource(u.Source) @@ -1968,11 +1967,11 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle if isSyncPodWorthy(e) { // PLEG event for a pod; sync it. if pod, ok := kl.podManager.GetPodByUID(e.ID); ok { - klog.V(2).Infof("SyncLoop (PLEG): %q, event: %#v", format.Pod(pod), e) + klog.V(2).InfoS("SyncLoop (PLEG): event for pod", "pod", klog.KObj(pod), "event", e) handler.HandlePodSyncs([]*v1.Pod{pod}) } else { // If the pod no longer exists, ignore the event. - klog.V(4).Infof("SyncLoop (PLEG): ignore irrelevant event: %#v", e) + klog.V(4).InfoS("SyncLoop (PLEG): pod does not exist, ignore irrelevant event", "event", e) } } @@ -2005,11 +2004,11 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle if !kl.sourcesReady.AllReady() { // If the sources aren't ready or volume manager has not yet synced the states, // skip housekeeping, as we may accidentally delete pods from unready sources. - klog.V(4).Infof("SyncLoop (housekeeping, skipped): sources aren't ready yet.") + klog.V(4).InfoS("SyncLoop (housekeeping, skipped): sources aren't ready yet") } else { - klog.V(4).Infof("SyncLoop (housekeeping)") + klog.V(4).InfoS("SyncLoop (housekeeping)") if err := handler.HandlePodCleanups(); err != nil { - klog.Errorf("Failed cleaning pods: %v", err) + klog.ErrorS(err, "Failed cleaning pods") } } } @@ -2017,18 +2016,14 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle } func handleProbeSync(kl *Kubelet, update proberesults.Update, handler SyncHandler, probe, status string) { - probeAndStatus := probe - if len(status) > 0 { - probeAndStatus = fmt.Sprintf("%s (container %s)", probe, status) - } // We should not use the pod from manager, because it is never updated after initialization. pod, ok := kl.podManager.GetPodByUID(update.PodUID) if !ok { // If the pod no longer exists, ignore the update. - klog.V(4).Infof("SyncLoop %s: ignore irrelevant update: %#v", probeAndStatus, update) + klog.V(4).InfoS("SyncLoop (probe): ignore irrelevant update", "probe", probe, "status", status, "update", update) return } - klog.V(1).Infof("SyncLoop %s: %q", probeAndStatus, format.Pod(pod)) + klog.V(1).InfoS("SyncLoop (probe)", "probe", probe, "status", status, "pod", klog.KObj(pod)) handler.HandlePodSyncs([]*v1.Pod{pod}) } @@ -2038,7 +2033,7 @@ func (kl *Kubelet) dispatchWork(pod *v1.Pod, syncType kubetypes.SyncPodType, mir // check whether we are ready to delete the pod from the API server (all status up to date) containersTerminal, podWorkerTerminal := kl.podAndContainersAreTerminal(pod) if pod.DeletionTimestamp != nil && containersTerminal { - klog.V(4).Infof("Pod %q has completed execution and should be deleted from the API server: %s", format.Pod(pod), syncType) + klog.V(4).InfoS("Pod has completed execution and should be deleted from the API server", "pod", klog.KObj(pod), "syncType", syncType) kl.statusManager.TerminatePod(pod) return } @@ -2143,7 +2138,7 @@ func (kl *Kubelet) HandlePodRemoves(pods []*v1.Pod) { // Deletion is allowed to fail because the periodic cleanup routine // will trigger deletion again. if err := kl.deletePod(pod); err != nil { - klog.V(2).Infof("Failed to delete pod %q, err: %v", format.Pod(pod), err) + klog.V(2).InfoS("Failed to delete pod", "pod", klog.KObj(pod), "err", err) } kl.probeManager.RemovePod(pod) } @@ -2202,19 +2197,19 @@ func (kl *Kubelet) updateRuntimeUp() { s, err := kl.containerRuntime.Status() if err != nil { - klog.Errorf("Container runtime sanity check failed: %v", err) + klog.ErrorS(err, "Container runtime sanity check failed") return } if s == nil { - klog.Errorf("Container runtime status is nil") + klog.ErrorS(nil, "Container runtime status is nil") return } // Periodically log the whole runtime status for debugging. - klog.V(4).Infof("Container runtime status: %v", s) + klog.V(4).InfoS("Container runtime status", "status", s) networkReady := s.GetRuntimeCondition(kubecontainer.NetworkReady) if networkReady == nil || !networkReady.Status { - klog.Errorf("Container runtime network not ready: %v", networkReady) - kl.runtimeState.setNetworkState(fmt.Errorf("runtime network not ready: %v", networkReady)) + klog.ErrorS(nil, "Container runtime network not ready", "networkReady", networkReady) + kl.runtimeState.setNetworkState(fmt.Errorf("container runtime network not ready: %v", networkReady)) } else { // Set nil if the container runtime network is ready. kl.runtimeState.setNetworkState(nil) @@ -2223,9 +2218,8 @@ func (kl *Kubelet) updateRuntimeUp() { runtimeReady := s.GetRuntimeCondition(kubecontainer.RuntimeReady) // If RuntimeReady is not set or is false, report an error. if runtimeReady == nil || !runtimeReady.Status { - err := fmt.Errorf("Container runtime not ready: %v", runtimeReady) - klog.Error(err) - kl.runtimeState.setRuntimeState(err) + klog.ErrorS(nil, "Container runtime not ready", "runtimeReady", runtimeReady) + kl.runtimeState.setRuntimeState(fmt.Errorf("container runtime not ready: %v", runtimeReady)) return } kl.runtimeState.setRuntimeState(nil) @@ -2264,7 +2258,7 @@ func (kl *Kubelet) ListenAndServeReadOnly(address net.IP, port uint) { func (kl *Kubelet) ListenAndServePodResources() { socket, err := util.LocalEndpoint(kl.getPodResourcesDir(), podresources.Socket) if err != nil { - klog.V(2).Infof("Failed to get local endpoint for PodResources endpoint: %v", err) + klog.V(2).InfoS("Failed to get local endpoint for PodResources endpoint", "err", err) return } server.ListenAndServePodResources(socket, kl.podManager, kl.containerManager, kl.containerManager) @@ -2294,13 +2288,13 @@ func (kl *Kubelet) fastStatusUpdateOnce() { time.Sleep(100 * time.Millisecond) node, err := kl.GetNode() if err != nil { - klog.Errorf(err.Error()) + klog.ErrorS(err, "Error getting node") continue } if len(node.Spec.PodCIDRs) != 0 { podCIDRs := strings.Join(node.Spec.PodCIDRs, ",") if _, err := kl.updatePodCIDR(podCIDRs); err != nil { - klog.Errorf("Pod CIDR update to %v failed %v", podCIDRs, err) + klog.ErrorS(err, "Pod CIDR update failed", "CIDR", podCIDRs) continue } kl.updateRuntimeUp() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_getters.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_getters.go index 32e80cc863a2..a963409a1831 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_getters.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_getters.go @@ -22,7 +22,6 @@ import ( "io/ioutil" "net" "path/filepath" - "time" cadvisorapiv1 "github.com/google/cadvisor/info/v1" cadvisorv2 "github.com/google/cadvisor/info/v2" @@ -33,7 +32,6 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/kubernetes/pkg/kubelet/cm" "k8s.io/kubernetes/pkg/kubelet/config" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" @@ -237,15 +235,6 @@ func (kl *Kubelet) GetNode() (*v1.Node, error) { if kl.kubeClient == nil { return kl.initialNode(context.TODO()) } - // if we have a valid kube client, we wait for initial lister to sync - if !kl.nodeHasSynced() { - err := wait.PollImmediate(time.Second, maxWaitForAPIServerSync, func() (bool, error) { - return kl.nodeHasSynced(), nil - }) - if err != nil { - return nil, fmt.Errorf("nodes have not yet been read at least once, cannot construct node object") - } - } return kl.nodeLister.Get(string(kl.nodeName)) } @@ -256,7 +245,7 @@ func (kl *Kubelet) GetNode() (*v1.Node, error) { // zero capacity, and the default labels. func (kl *Kubelet) getNodeAnyWay() (*v1.Node, error) { if kl.kubeClient != nil { - if n, err := kl.GetNode(); err == nil { + if n, err := kl.nodeLister.Get(string(kl.nodeName)); err == nil { return n, nil } } @@ -308,13 +297,13 @@ func (kl *Kubelet) getPodVolumePathListFromDisk(podUID types.UID) ([]string, err if pathExists, pathErr := mount.PathExists(podVolDir); pathErr != nil { return volumes, fmt.Errorf("error checking if path %q exists: %v", podVolDir, pathErr) } else if !pathExists { - klog.Warningf("Path %q does not exist", podVolDir) + klog.InfoS("Path does not exist", "path", podVolDir) return volumes, nil } volumePluginDirs, err := ioutil.ReadDir(podVolDir) if err != nil { - klog.Errorf("Could not read directory %s: %v", podVolDir, err) + klog.ErrorS(err, "Could not read directory", "path", podVolDir) return volumes, err } for _, volumePluginDir := range volumePluginDirs { @@ -383,7 +372,7 @@ func (kl *Kubelet) getPodVolumeSubpathListFromDisk(podUID types.UID) ([]string, // Explicitly walks /// volumePluginDirs, err := ioutil.ReadDir(podSubpathsDir) if err != nil { - klog.Errorf("Could not read directory %s: %v", podSubpathsDir, err) + klog.ErrorS(err, "Could not read directory", "path", podSubpathsDir) return volumes, err } for _, volumePluginDir := range volumePluginDirs { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_node_status.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_node_status.go index c4f72bfb22cd..e44c8a1567e0 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_node_status.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_node_status.go @@ -64,14 +64,14 @@ func (kl *Kubelet) registerWithAPIServer() { node, err := kl.initialNode(context.TODO()) if err != nil { - klog.Errorf("Unable to construct v1.Node object for kubelet: %v", err) + klog.ErrorS(err, "Unable to construct v1.Node object for kubelet") continue } - klog.Infof("Attempting to register node %s", node.Name) + klog.InfoS("Attempting to register node", "node", klog.KObj(node)) registered := kl.tryRegisterWithAPIServer(node) if registered { - klog.Infof("Successfully registered node %s", node.Name) + klog.InfoS("Successfully registered node", "node", klog.KObj(node)) kl.registrationCompleted = true return } @@ -90,23 +90,23 @@ func (kl *Kubelet) tryRegisterWithAPIServer(node *v1.Node) bool { } if !apierrors.IsAlreadyExists(err) { - klog.Errorf("Unable to register node %q with API server: %v", kl.nodeName, err) + klog.ErrorS(err, "Unable to register node with API server", "node", klog.KObj(node)) return false } existingNode, err := kl.kubeClient.CoreV1().Nodes().Get(context.TODO(), string(kl.nodeName), metav1.GetOptions{}) if err != nil { - klog.Errorf("Unable to register node %q with API server: error getting existing node: %v", kl.nodeName, err) + klog.ErrorS(err, "Unable to register node with API server, error getting existing node", "node", klog.KObj(node)) return false } if existingNode == nil { - klog.Errorf("Unable to register node %q with API server: no node instance returned", kl.nodeName) + klog.InfoS("Unable to register node with API server, no node instance returned", "node", klog.KObj(node)) return false } originalNode := existingNode.DeepCopy() - klog.Infof("Node %s was previously registered", kl.nodeName) + klog.InfoS("Node was previously registered", "node", klog.KObj(node)) // Edge case: the node was previously registered; reconcile // the value of the controller-managed attach-detach @@ -117,7 +117,7 @@ func (kl *Kubelet) tryRegisterWithAPIServer(node *v1.Node) bool { requiresUpdate = kl.reconcileHugePageResource(node, existingNode) || requiresUpdate if requiresUpdate { if _, _, err := nodeutil.PatchNodeStatus(kl.kubeClient.CoreV1(), types.NodeName(kl.nodeName), originalNode, existingNode); err != nil { - klog.Errorf("Unable to reconcile node %q with API server: error updating node: %v", kl.nodeName, err) + klog.ErrorS(err, "Unable to reconcile node with API server,error updating node", "node", klog.KObj(node)) return false } } @@ -165,7 +165,7 @@ func (kl *Kubelet) reconcileHugePageResource(initialNode, existingNode *v1.Node) if !supportedHugePageResources.Has(string(resourceName)) { delete(existingNode.Status.Capacity, resourceName) delete(existingNode.Status.Allocatable, resourceName) - klog.Infof("Removing now unsupported huge page resource named: %s", resourceName) + klog.InfoS("Removing huge page resource which is no longer supported", "resourceName", resourceName) requiresUpdate = true } } @@ -179,7 +179,7 @@ func (kl *Kubelet) reconcileExtendedResource(initialNode, node *v1.Node) bool { if kl.containerManager.ShouldResetExtendedResourceCapacity() { for k := range node.Status.Capacity { if v1helper.IsExtendedResourceName(k) { - klog.Infof("Zero out resource %s capacity in existing node.", k) + klog.InfoS("Zero out resource capacity in existing node", "resourceName", k, "node", klog.KObj(node)) node.Status.Capacity[k] = *resource.NewQuantity(int64(0), resource.DecimalSI) node.Status.Allocatable[k] = *resource.NewQuantity(int64(0), resource.DecimalSI) requiresUpdate = true @@ -269,10 +269,10 @@ func (kl *Kubelet) reconcileCMADAnnotationWithExistingNode(node, existingNode *v // not have the same value, update the existing node with // the correct value of the annotation. if !newSet { - klog.Info("Controller attach-detach setting changed to false; updating existing Node") + klog.InfoS("Controller attach-detach setting changed to false; updating existing Node") delete(existingNode.Annotations, volutil.ControllerManagedAttachAnnotation) } else { - klog.Info("Controller attach-detach setting changed to true; updating existing Node") + klog.InfoS("Controller attach-detach setting changed to true; updating existing Node") if existingNode.Annotations == nil { existingNode.Annotations = make(map[string]string) } @@ -359,24 +359,24 @@ func (kl *Kubelet) initialNode(ctx context.Context) (*v1.Node, error) { node.Annotations = make(map[string]string) } - klog.V(2).Infof("Setting node annotation to enable volume controller attach/detach") + klog.V(2).InfoS("Setting node annotation to enable volume controller attach/detach") node.Annotations[volutil.ControllerManagedAttachAnnotation] = "true" } else { - klog.V(2).Infof("Controller attach/detach is disabled for this node; Kubelet will attach and detach volumes") + klog.V(2).InfoS("Controller attach/detach is disabled for this node; Kubelet will attach and detach volumes") } if kl.keepTerminatedPodVolumes { if node.Annotations == nil { node.Annotations = make(map[string]string) } - klog.V(2).Infof("Setting node annotation to keep pod volumes of terminated pods attached to the node") + klog.V(2).InfoS("Setting node annotation to keep pod volumes of terminated pods attached to the node") node.Annotations[volutil.KeepTerminatedPodVolumesAnnotation] = "true" } // @question: should this be place after the call to the cloud provider? which also applies labels for k, v := range kl.nodeLabels { if cv, found := node.ObjectMeta.Labels[k]; found { - klog.Warningf("the node label %s=%s will overwrite default setting %s", k, v, cv) + klog.InfoS("the node label will overwrite default setting", "labelKey", k, "labelValue", v, "default", cv) } node.ObjectMeta.Labels[k] = v } @@ -407,9 +407,9 @@ func (kl *Kubelet) initialNode(ctx context.Context) (*v1.Node, error) { return nil, err } if instanceType != "" { - klog.Infof("Adding node label from cloud provider: %s=%s", v1.LabelInstanceType, instanceType) + klog.InfoS("Adding label from cloud provider", "labelKey", v1.LabelInstanceType, "labelValue", instanceType) node.ObjectMeta.Labels[v1.LabelInstanceType] = instanceType - klog.Infof("Adding node label from cloud provider: %s=%s", v1.LabelInstanceTypeStable, instanceType) + klog.InfoS("Adding node label from cloud provider", "labelKey", v1.LabelInstanceTypeStable, "labelValue", instanceType) node.ObjectMeta.Labels[v1.LabelInstanceTypeStable] = instanceType } // If the cloud has zone information, label the node with the zone information @@ -420,15 +420,15 @@ func (kl *Kubelet) initialNode(ctx context.Context) (*v1.Node, error) { return nil, fmt.Errorf("failed to get zone from cloud provider: %v", err) } if zone.FailureDomain != "" { - klog.Infof("Adding node label from cloud provider: %s=%s", v1.LabelFailureDomainBetaZone, zone.FailureDomain) + klog.InfoS("Adding node label from cloud provider", "labelKey", v1.LabelFailureDomainBetaZone, "labelValue", zone.FailureDomain) node.ObjectMeta.Labels[v1.LabelFailureDomainBetaZone] = zone.FailureDomain - klog.Infof("Adding node label from cloud provider: %s=%s", v1.LabelTopologyZone, zone.FailureDomain) + klog.InfoS("Adding node label from cloud provider", "labelKey", v1.LabelTopologyZone, "labelValue", zone.FailureDomain) node.ObjectMeta.Labels[v1.LabelTopologyZone] = zone.FailureDomain } if zone.Region != "" { - klog.Infof("Adding node label from cloud provider: %s=%s", v1.LabelFailureDomainBetaRegion, zone.Region) + klog.InfoS("Adding node label from cloud provider", "labelKey", v1.LabelFailureDomainBetaRegion, "labelValue", zone.Region) node.ObjectMeta.Labels[v1.LabelFailureDomainBetaRegion] = zone.Region - klog.Infof("Adding node label from cloud provider: %s=%s", v1.LabelTopologyRegion, zone.Region) + klog.InfoS("Adding node label from cloud provider", "labelKey", v1.LabelTopologyRegion, "labelValue", zone.Region) node.ObjectMeta.Labels[v1.LabelTopologyRegion] = zone.Region } } @@ -454,20 +454,20 @@ func (kl *Kubelet) syncNodeStatus() { kl.registerWithAPIServer() } if err := kl.updateNodeStatus(); err != nil { - klog.Errorf("Unable to update node status: %v", err) + klog.ErrorS(err, "Unable to update node status") } } // updateNodeStatus updates node status to master with retries if there is any // change or enough time passed from the last sync. func (kl *Kubelet) updateNodeStatus() error { - klog.V(5).Infof("Updating node status") + klog.V(5).InfoS("Updating node status") for i := 0; i < nodeStatusUpdateRetry; i++ { if err := kl.tryUpdateNodeStatus(i); err != nil { if i > 0 && kl.onRepeatedHeartbeatFailure != nil { kl.onRepeatedHeartbeatFailure() } - klog.Errorf("Error updating node status, will retry: %v", err) + klog.ErrorS(err, "Error updating node status, will retry") } else { return nil } @@ -505,7 +505,7 @@ func (kl *Kubelet) tryUpdateNodeStatus(tryNumber int) error { // actually changed. podCIDRs := strings.Join(node.Spec.PodCIDRs, ",") if podCIDRChanged, err = kl.updatePodCIDR(podCIDRs); err != nil { - klog.Errorf(err.Error()) + klog.ErrorS(err, "Error updating pod CIDR") } } @@ -551,7 +551,7 @@ func (kl *Kubelet) tryUpdateNodeStatus(tryNumber int) error { // recordNodeStatusEvent records an event of the given type with the given // message for the node. func (kl *Kubelet) recordNodeStatusEvent(eventType, event string) { - klog.V(2).Infof("Recording %s event message for node %s", event, kl.nodeName) + klog.V(2).InfoS("Recording event message for node", "node", klog.KRef("", string(kl.nodeName)), "event", event) kl.recorder.Eventf(kl.nodeRef, eventType, event, "Node %s status is now: %s", kl.nodeName, event) } @@ -581,9 +581,9 @@ func (kl *Kubelet) recordNodeSchedulableEvent(node *v1.Node) error { // refactor the node status condition code out to a different file. func (kl *Kubelet) setNodeStatus(node *v1.Node) { for i, f := range kl.setNodeStatusFuncs { - klog.V(5).Infof("Setting node status at position %v", i) + klog.V(5).InfoS("Setting node status condition code", "position", i, "node", klog.KObj(node)) if err := f(node); err != nil { - klog.Errorf("Failed to set some node status fields: %s", err) + klog.ErrorS(err, "Failed to set some node status fields", "node", klog.KObj(node)) } } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go index 45daf137a042..b610b47ff7fd 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go @@ -59,7 +59,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/status" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/kubelet/util" - "k8s.io/kubernetes/pkg/kubelet/util/format" volumeutil "k8s.io/kubernetes/pkg/volume/util" "k8s.io/kubernetes/pkg/volume/util/hostutil" "k8s.io/kubernetes/pkg/volume/util/subpath" @@ -118,7 +117,7 @@ func (kl *Kubelet) makeBlockVolumes(pod *v1.Pod, container *v1.Container, podVol } vol, ok := podVolumes[device.Name] if !ok || vol.BlockVolumeMapper == nil { - klog.Errorf("Block volume cannot be satisfied for container %q, because the volume is missing or the volume mapper is nil: %+v", container.Name, device) + klog.ErrorS(nil, "Block volume cannot be satisfied for container, because the volume is missing or the volume mapper is nil", "containerName", container.Name, "device", device) return nil, fmt.Errorf("cannot find volume %q to pass into container %q", device.Name, container.Name) } // Get a symbolic link associated to a block device under pod device path @@ -132,7 +131,7 @@ func (kl *Kubelet) makeBlockVolumes(pod *v1.Pod, container *v1.Container, podVol if vol.ReadOnly { permission = "r" } - klog.V(4).Infof("Device will be attached to container %q. Path on host: %v", container.Name, symlinkPath) + klog.V(4).InfoS("Device will be attached to container in the corresponding path on host", "containerName", container.Name, "path", symlinkPath) devices = append(devices, kubecontainer.DeviceInfo{PathOnHost: symlinkPath, PathInContainer: device.DevicePath, Permissions: permission}) } } @@ -150,7 +149,7 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h // Kubernetes will not mount /etc/hosts if: // - when the Pod sandbox is being created, its IP is still unknown. Hence, PodIP will not have been set. mountEtcHostsFile := len(podIPs) > 0 && supportsSingleFileMapping - klog.V(3).Infof("container: %v/%v/%v podIPs: %q creating hosts mount: %v", pod.Namespace, pod.Name, container.Name, podIPs, mountEtcHostsFile) + klog.V(3).InfoS("Creating hosts mount for container", "pod", klog.KObj(pod), "containerName", container.Name, "podIPs", podIPs, "path", mountEtcHostsFile) mounts := []kubecontainer.Mount{} var cleanupAction func() for i, mount := range container.VolumeMounts { @@ -158,7 +157,8 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h mountEtcHostsFile = mountEtcHostsFile && (mount.MountPath != etcHostsPath) vol, ok := podVolumes[mount.Name] if !ok || vol.Mounter == nil { - klog.Errorf("Mount cannot be satisfied for container %q, because the volume is missing (ok=%v) or the volume mounter (vol.Mounter) is nil (vol=%+v): %+v", container.Name, ok, vol, mount) + klog.ErrorS(nil, "Mount cannot be satisfied for the container, because the volume is missing or the volume mounter (vol.Mounter) is nil", + "containerName", container.Name, "ok", ok, "volumeMounter", mount) return nil, cleanupAction, fmt.Errorf("cannot find volume %q to mount into container %q", mount.Name, container.Name) } @@ -206,7 +206,7 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h hostPath = filepath.Join(volumePath, subPath) if subPathExists, err := hu.PathExists(hostPath); err != nil { - klog.Errorf("Could not determine if subPath %s exists; will not attempt to change its permissions", hostPath) + klog.ErrorS(nil, "Could not determine if subPath exists, will not attempt to change its permissions", "path", hostPath) } else if !subPathExists { // Create the sub path now because if it's auto-created later when referenced, it may have an // incorrect ownership and mode. For example, the sub path directory must have at least g+rwx @@ -219,7 +219,7 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h } if err := subpather.SafeMakeDir(subPath, volumePath, perm); err != nil { // Don't pass detailed error back to the user because it could give information about host filesystem - klog.Errorf("failed to create subPath directory for volumeMount %q of container %q: %v", mount.Name, container.Name, err) + klog.ErrorS(err, "Failed to create subPath directory for volumeMount of the container", "containerName", container.Name, "volumeMountName", mount.Name) return nil, cleanupAction, fmt.Errorf("failed to create subPath directory for volumeMount %q of container %q", mount.Name, container.Name) } } @@ -233,7 +233,7 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h }) if err != nil { // Don't pass detailed error back to the user because it could give information about host filesystem - klog.Errorf("failed to prepare subPath for volumeMount %q of container %q: %v", mount.Name, container.Name, err) + klog.ErrorS(err, "Failed to prepare subPath for volumeMount of the container", "containerName", container.Name, "volumeMountName", mount.Name) return nil, cleanupAction, fmt.Errorf("failed to prepare subPath for volumeMount %q of container %q", mount.Name, container.Name) } } @@ -253,8 +253,7 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h if err != nil { return nil, cleanupAction, err } - klog.V(5).Infof("Pod %q container %q mount %q has propagation %q", format.Pod(pod), container.Name, mount.Name, propagation) - + klog.V(5).InfoS("Mount has propagation", "pod", klog.KObj(pod), "containerName", container.Name, "volumeMountName", mount.Name, "propagation", propagation) mustMountRO := vol.Mounter.GetAttributes().ReadOnly mounts = append(mounts, kubecontainer.Mount{ @@ -410,7 +409,7 @@ func truncatePodHostnameIfNeeded(podName, hostname string) (string, error) { return hostname, nil } truncated := hostname[:hostnameMaxLen] - klog.Errorf("hostname for pod:%q was longer than %d. Truncated hostname to :%q", podName, hostnameMaxLen, truncated) + klog.ErrorS(nil, "Hostname for pod was too long, truncated it", "podName", podName, "hostnameMaxLen", hostnameMaxLen, "truncatedHostname", truncated) // hostname should not end with '-' or '.' truncated = strings.TrimRight(truncated, "-.") if len(truncated) == 0 { @@ -505,7 +504,7 @@ func (kl *Kubelet) GenerateRunContainerOptions(pod *v1.Pod, container *v1.Contai if len(container.TerminationMessagePath) != 0 && supportsSingleFileMapping { p := kl.getPodContainerDir(pod.UID, container.Name) if err := os.MkdirAll(p, 0750); err != nil { - klog.Errorf("Error on creating %q: %v", p, err) + klog.ErrorS(err, "Error on creating dir", "path", p) } else { opts.PodContainerDir = p } @@ -860,7 +859,7 @@ func (kl *Kubelet) killPod(pod *v1.Pod, runningPod *kubecontainer.Pod, status *k return err } if err := kl.containerManager.UpdateQOSCgroups(); err != nil { - klog.V(2).Infof("Failed to update QoS cgroups while killing pod: %v", err) + klog.V(2).InfoS("Failed to update QoS cgroups while killing pod", "err", err) } return nil } @@ -893,7 +892,7 @@ func (kl *Kubelet) getPullSecretsForPod(pod *v1.Pod) []v1.Secret { } secret, err := kl.secretManager.GetSecret(pod.Namespace, secretRef.Name) if err != nil { - klog.Warningf("Unable to retrieve pull secret %s/%s for %s/%s due to %v. The image pull may not succeed.", pod.Namespace, secretRef.Name, pod.Namespace, pod.Name, err) + klog.InfoS("Unable to retrieve pull secret, the image pull may not succeed.", "pod", klog.KObj(pod), "secret", klog.KObj(secret), "err", err) continue } @@ -965,13 +964,13 @@ func (kl *Kubelet) IsPodDeleted(uid types.UID) bool { func (kl *Kubelet) PodResourcesAreReclaimed(pod *v1.Pod, status v1.PodStatus) bool { if !notRunning(status.ContainerStatuses) { // We shouldn't delete pods that still have running containers - klog.V(3).Infof("Pod %q is terminated, but some containers are still running", format.Pod(pod)) + klog.V(3).InfoS("Pod is terminated, but some containers are still running", "pod", klog.KObj(pod)) return false } // pod's containers should be deleted runtimeStatus, err := kl.podCache.Get(pod.UID) if err != nil { - klog.V(3).Infof("Pod %q is terminated, Error getting runtimeStatus from the podCache: %s", format.Pod(pod), err) + klog.V(3).InfoS("Pod is terminated, Error getting runtimeStatus from the podCache", "pod", klog.KObj(pod), "err", err) return false } if len(runtimeStatus.ContainerStatuses) > 0 { @@ -979,18 +978,18 @@ func (kl *Kubelet) PodResourcesAreReclaimed(pod *v1.Pod, status v1.PodStatus) bo for _, status := range runtimeStatus.ContainerStatuses { statusStr += fmt.Sprintf("%+v ", *status) } - klog.V(3).Infof("Pod %q is terminated, but some containers have not been cleaned up: %s", format.Pod(pod), statusStr) + klog.V(3).InfoS("Pod is terminated, but some containers have not been cleaned up", "pod", klog.KObj(pod), "status", statusStr) return false } if kl.podVolumesExist(pod.UID) && !kl.keepTerminatedPodVolumes { // We shouldn't delete pods whose volumes have not been cleaned up if we are not keeping terminated pod volumes - klog.V(3).Infof("Pod %q is terminated, but some volumes have not been cleaned up", format.Pod(pod)) + klog.V(3).InfoS("Pod is terminated, but some volumes have not been cleaned up", "pod", klog.KObj(pod)) return false } if kl.kubeletConfiguration.CgroupsPerQOS { pcm := kl.containerManager.NewPodContainerManager() if pcm.Exists(pod) { - klog.V(3).Infof("Pod %q is terminated, but pod cgroup sandbox has not been cleaned up", format.Pod(pod)) + klog.V(3).InfoS("Pod is terminated, but pod cgroup sandbox has not been cleaned up", "pod", klog.KObj(pod)) return false } } @@ -1052,9 +1051,9 @@ func (kl *Kubelet) deleteOrphanedMirrorPods() { if !kl.podKiller.IsPodPendingTerminationByPodName(podFullname) { _, err := kl.podManager.DeleteMirrorPod(podFullname, nil) if err != nil { - klog.Errorf("encountered error when deleting mirror pod %q : %v", podFullname, err) + klog.ErrorS(err, "Encountered error when deleting mirror pod", "podName", podFullname) } else { - klog.V(3).Infof("deleted pod %q", podFullname) + klog.V(3).InfoS("Deleted pod", "podName", podFullname) } } } @@ -1105,7 +1104,7 @@ func (kl *Kubelet) HandlePodCleanups() error { runningPods, err := kl.runtimeCache.GetPods() if err != nil { - klog.Errorf("Error listing containers: %#v", err) + klog.ErrorS(err, "Error listing containers") return err } for _, pod := range runningPods { @@ -1121,7 +1120,7 @@ func (kl *Kubelet) HandlePodCleanups() error { // TODO: Evaluate the performance impact of bypassing the runtime cache. runningPods, err = kl.containerRuntime.GetPods(false) if err != nil { - klog.Errorf("Error listing containers: %#v", err) + klog.ErrorS(err, "Error listing containers") return err } @@ -1134,7 +1133,7 @@ func (kl *Kubelet) HandlePodCleanups() error { // We want all cleanup tasks to be run even if one of them failed. So // we just log an error here and continue other cleanup tasks. // This also applies to the other clean up tasks. - klog.Errorf("Failed cleaning up orphaned pod directories: %v", err) + klog.ErrorS(err, "Failed cleaning up orphaned pod directories") } // Remove any orphaned mirror pods. @@ -1224,7 +1223,7 @@ func (pk *podKillerWithChannel) IsPodPendingTerminationByPodName(podFullname str } func (pk *podKillerWithChannel) markPodTerminated(uid string) { - klog.V(4).Infof("marking pod termination %q", uid) + klog.V(4).InfoS("Marking pod termination", "podUID", uid) pk.podKillingLock.Lock() defer pk.podKillingLock.Unlock() delete(pk.mirrorPodTerminationMap, uid) @@ -1243,7 +1242,7 @@ func (pk *podKillerWithChannel) KillPod(podPair *kubecontainer.PodPair) { _, apiPodExists = pk.mirrorPodTerminationMap[uid] if !apiPodExists { fullname := kubecontainer.GetPodFullName(podPair.APIPod) - klog.V(4).Infof("marking api pod pending termination %q : %q", uid, fullname) + klog.V(4).InfoS("Marking api pod pending termination", "podName", fullname, "podUID", uid) pk.mirrorPodTerminationMap[uid] = fullname } } @@ -1252,17 +1251,17 @@ func (pk *podKillerWithChannel) KillPod(podPair *kubecontainer.PodPair) { _, runningPodExists = pk.podTerminationMap[uid] if !runningPodExists { fullname := podPair.RunningPod.Name - klog.V(4).Infof("marking running pod pending termination %q: %q", uid, fullname) + klog.V(4).InfoS("Marking running pod pending termination", "podName", fullname, "podUID", uid) pk.podTerminationMap[uid] = fullname } } if apiPodExists || runningPodExists { if apiPodExists && runningPodExists { - klog.V(4).Infof("api pod %q and running pod %q is pending termination", podPair.APIPod.UID, podPair.RunningPod.ID) + klog.V(4).InfoS("Api pod and running pod are pending termination", "apiPodUID", podPair.APIPod.UID, "runningPodUID", podPair.RunningPod.ID) } else if apiPodExists { - klog.V(4).Infof("api pod %q is pending termination", podPair.APIPod.UID) + klog.V(4).InfoS("Api pod is pending termination", "podUID", podPair.APIPod.UID) } else { - klog.V(4).Infof("running pod %q is pending termination", podPair.RunningPod.ID) + klog.V(4).InfoS("Running pod is pending termination", "podUID", podPair.RunningPod.ID) } return } @@ -1283,10 +1282,10 @@ func (pk *podKillerWithChannel) PerformPodKillingWork() { apiPod := podPair.APIPod go func(apiPod *v1.Pod, runningPod *kubecontainer.Pod) { - klog.V(2).Infof("Killing unwanted pod %q", runningPod.Name) + klog.V(2).InfoS("Killing unwanted pod", "podName", runningPod.Name) err := pk.killPod(apiPod, runningPod, nil, nil) if err != nil { - klog.Errorf("Failed killing the pod %q: %v", runningPod.Name, err) + klog.ErrorS(err, "Failed killing the pod", "podName", runningPod.Name) } pk.markPodTerminated(string(runningPod.ID)) }(apiPod, runningPod) @@ -1483,7 +1482,7 @@ func getPhase(spec *v1.PodSpec, info []v1.ContainerStatus) v1.PodPhase { case pendingInitialization > 0: fallthrough case waiting > 0: - klog.V(5).Infof("pod waiting > 0, pending") + klog.V(5).InfoS("Pod waiting > 0, pending") // One or more containers has not been started return v1.PodPending case running > 0 && unknown == 0: @@ -1510,7 +1509,7 @@ func getPhase(spec *v1.PodSpec, info []v1.ContainerStatus) v1.PodPhase { // and in the process of restarting return v1.PodRunning default: - klog.V(5).Infof("pod default case, pending") + klog.V(5).InfoS("Pod default case, pending") return v1.PodPending } } @@ -1518,7 +1517,7 @@ func getPhase(spec *v1.PodSpec, info []v1.ContainerStatus) v1.PodPhase { // generateAPIPodStatus creates the final API pod status for a pod, given the // internal pod status. func (kl *Kubelet) generateAPIPodStatus(pod *v1.Pod, podStatus *kubecontainer.PodStatus) v1.PodStatus { - klog.V(3).Infof("Generating status for %q", format.Pod(pod)) + klog.V(3).InfoS("Generating pod status", "pod", klog.KObj(pod)) s := kl.convertStatusToAPIStatus(pod, podStatus) @@ -1540,7 +1539,7 @@ func (kl *Kubelet) generateAPIPodStatus(pod *v1.Pod, podStatus *kubecontainer.Po if pod.Status.Phase == v1.PodFailed || pod.Status.Phase == v1.PodSucceeded { // API server shows terminal phase; transitions are not allowed if s.Phase != pod.Status.Phase { - klog.Errorf("Pod attempted illegal phase transition from %s to %s: %v", pod.Status.Phase, s.Phase, s) + klog.ErrorS(nil, "Pod attempted illegal phase transition", "originalStatusPhase", pod.Status.Phase, "apiStatusPhase", s.Phase, "apiStatus", s) // Force back to phase from the API server s.Phase = pod.Status.Phase } @@ -1560,7 +1559,7 @@ func (kl *Kubelet) generateAPIPodStatus(pod *v1.Pod, podStatus *kubecontainer.Po if kl.kubeClient != nil { hostIPs, err := kl.getHostIPsAnyWay() if err != nil { - klog.V(4).Infof("Cannot get host IPs: %v", err) + klog.V(4).InfoS("Cannot get host IPs", "err", err) } else { s.HostIP = hostIPs[0].String() if kubecontainer.IsHostNetworkPod(pod) && s.PodIP == "" { @@ -2003,7 +2002,7 @@ func (kl *Kubelet) cleanupOrphanedPodCgroups(pcm cm.PodContainerManager, cgroupP // if the pod is within termination grace period, we shouldn't cleanup the underlying cgroup if kl.podKiller.IsPodPendingTerminationByUID(uid) { - klog.V(3).Infof("pod %q is pending termination", uid) + klog.V(3).InfoS("Pod is pending termination", "podUID", uid) continue } // If volumes have not been unmounted/detached, do not delete the cgroup @@ -2012,13 +2011,13 @@ func (kl *Kubelet) cleanupOrphanedPodCgroups(pcm cm.PodContainerManager, cgroupP // process in the cgroup to the minimum value while we wait. if the kubelet // is configured to keep terminated volumes, we will delete the cgroup and not block. if podVolumesExist := kl.podVolumesExist(uid); podVolumesExist && !kl.keepTerminatedPodVolumes { - klog.V(3).Infof("Orphaned pod %q found, but volumes not yet removed. Reducing cpu to minimum", uid) + klog.V(3).InfoS("Orphaned pod found, but volumes not yet removed. Reducing cpu to minimum", "podUID", uid) if err := pcm.ReduceCPULimits(val); err != nil { - klog.Warningf("Failed to reduce cpu time for pod %q pending volume cleanup due to %v", uid, err) + klog.InfoS("Failed to reduce cpu time for pod pending volume cleanup", "podUID", uid, "err", err) } continue } - klog.V(3).Infof("Orphaned pod %q found, removing pod cgroups", uid) + klog.V(3).InfoS("Orphaned pod found, removing pod cgroups", "podUID", uid) // Destroy all cgroups of pod that should not be running, // by first killing all the attached processes to these cgroups. // We ignore errors thrown by the method, as the housekeeping loop would @@ -2081,13 +2080,13 @@ func (kl *Kubelet) hasHostMountPVC(pod *v1.Pod) bool { if volume.PersistentVolumeClaim != nil { pvc, err := kl.kubeClient.CoreV1().PersistentVolumeClaims(pod.Namespace).Get(context.TODO(), volume.PersistentVolumeClaim.ClaimName, metav1.GetOptions{}) if err != nil { - klog.Warningf("unable to retrieve pvc %s:%s - %v", pod.Namespace, volume.PersistentVolumeClaim.ClaimName, err) + klog.InfoS("Unable to retrieve pvc", "pvc", klog.KRef(pod.Namespace, volume.PersistentVolumeClaim.ClaimName), "err", err) continue } if pvc != nil { referencedVolume, err := kl.kubeClient.CoreV1().PersistentVolumes().Get(context.TODO(), pvc.Spec.VolumeName, metav1.GetOptions{}) if err != nil { - klog.Warningf("unable to retrieve pv %s - %v", pvc.Spec.VolumeName, err) + klog.InfoS("Unable to retrieve pv", "pvName", pvc.Spec.VolumeName, "err", err) continue } if referencedVolume != nil && referencedVolume.Spec.HostPath != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_resources.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_resources.go index a453e015553d..0c737bb6bdff 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_resources.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_resources.go @@ -42,7 +42,7 @@ func (kl *Kubelet) defaultPodLimitsForDownwardAPI(pod *v1.Pod, container *v1.Con return nil, nil, fmt.Errorf("failed to find node object, expected a node") } allocatable := node.Status.Allocatable - klog.Infof("allocatable: %v", allocatable) + klog.InfoS("Allocatable", "allocatable", allocatable) outputPod := pod.DeepCopy() for idx := range outputPod.Spec.Containers { resource.MergeContainerResourceLimits(&outputPod.Spec.Containers[idx], allocatable) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_volumes.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_volumes.go index da43701d1b41..96e81ce00a53 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_volumes.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_volumes.go @@ -50,6 +50,26 @@ func (kl *Kubelet) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume return volumesToReturn, len(volumesToReturn) > 0 } +// ListBlockVolumesForPod returns a map of the mounted volumes for the given +// pod. The key in the map is the OuterVolumeSpecName (i.e. +// pod.Spec.Volumes[x].Name) +func (kl *Kubelet) ListBlockVolumesForPod(podUID types.UID) (map[string]volume.BlockVolume, bool) { + volumesToReturn := make(map[string]volume.BlockVolume) + podVolumes := kl.volumeManager.GetMountedVolumesForPod( + volumetypes.UniquePodName(podUID)) + for outerVolumeSpecName, volume := range podVolumes { + // TODO: volume.Mounter could be nil if volume object is recovered + // from reconciler's sync state process. PR 33616 will fix this problem + // to create Mounter object when recovering volume state. + if volume.BlockVolumeMapper == nil { + continue + } + volumesToReturn[outerVolumeSpecName] = volume.BlockVolumeMapper + } + + return volumesToReturn, len(volumesToReturn) > 0 +} + // podVolumesExist checks with the volume manager and returns true any of the // pods for the specified volume are mounted. func (kl *Kubelet) podVolumesExist(podUID types.UID) bool { @@ -63,11 +83,11 @@ func (kl *Kubelet) podVolumesExist(podUID types.UID) bool { // There are some volume plugins such as flexvolume might not have mounts. See issue #61229 volumePaths, err := kl.getMountedVolumePathListFromDisk(podUID) if err != nil { - klog.Errorf("pod %q found, but error %v occurred during checking mounted volumes from disk", podUID, err) + klog.ErrorS(err, "Pod found, but error occurred during checking mounted volumes from disk", "podUID", podUID) return true } if len(volumePaths) > 0 { - klog.V(4).Infof("pod %q found, but volumes are still mounted on disk %v", podUID, volumePaths) + klog.V(4).InfoS("Pod found, but volumes are still mounted on disk", "podUID", podUID, "paths", volumePaths) return true } @@ -86,7 +106,7 @@ func (kl *Kubelet) newVolumeMounterFromPlugins(spec *volume.Spec, pod *v1.Pod, o if err != nil { return nil, fmt.Errorf("failed to instantiate mounter for volume: %s using plugin: %s with a root cause: %v", spec.Name(), plugin.GetPluginName(), err) } - klog.V(10).Infof("Using volume plugin %q to mount %s", plugin.GetPluginName(), spec.Name()) + klog.V(10).InfoS("Using volume plugin for mount", "volumePluginName", plugin.GetPluginName(), "volumeName", spec.Name()) return physicalMounter, nil } @@ -118,7 +138,7 @@ func (kl *Kubelet) cleanupOrphanedPodDirs(pods []*v1.Pod, runningPods []*kubecon // TODO: getMountedVolumePathListFromDisk() call may be redundant with // kl.getPodVolumePathListFromDisk(). Can this be cleaned up? if podVolumesExist := kl.podVolumesExist(uid); podVolumesExist { - klog.V(3).Infof("Orphaned pod %q found, but volumes are not cleaned up", uid) + klog.V(3).InfoS("Orphaned pod found, but volumes are not cleaned up", "podUID", uid) continue } @@ -136,7 +156,7 @@ func (kl *Kubelet) cleanupOrphanedPodDirs(pods []*v1.Pod, runningPods []*kubecon orphanVolumeErrors = append(orphanVolumeErrors, fmt.Errorf("orphaned pod %q found, but failed to rmdir() volume at path %v: %v", uid, volumePath, err)) allVolumesCleanedUp = false } else { - klog.Warningf("Cleaned up orphaned volume from pod %q at %s", uid, volumePath) + klog.InfoS("Cleaned up orphaned volume from pod", "podUID", uid, "path", volumePath) } } } @@ -153,7 +173,7 @@ func (kl *Kubelet) cleanupOrphanedPodDirs(pods []*v1.Pod, runningPods []*kubecon orphanVolumeErrors = append(orphanVolumeErrors, fmt.Errorf("orphaned pod %q found, but failed to rmdir() subpath at path %v: %v", uid, subpathVolumePath, err)) allVolumesCleanedUp = false } else { - klog.Warningf("Cleaned up orphaned volume subpath from pod %q at %s", uid, subpathVolumePath) + klog.InfoS("Cleaned up orphaned volume subpath from pod", "podUID", uid, "path", subpathVolumePath) } } } @@ -167,18 +187,18 @@ func (kl *Kubelet) cleanupOrphanedPodDirs(pods []*v1.Pod, runningPods []*kubecon continue } - klog.V(3).Infof("Orphaned pod %q found, removing", uid) + klog.V(3).InfoS("Orphaned pod found, removing", "podUID", uid) if err := removeall.RemoveAllOneFilesystem(kl.mounter, kl.getPodDir(uid)); err != nil { - klog.Errorf("Failed to remove orphaned pod %q dir; err: %v", uid, err) + klog.ErrorS(err, "Failed to remove orphaned pod dir", "podUID", uid) orphanRemovalErrors = append(orphanRemovalErrors, err) } } logSpew := func(errs []error) { if len(errs) > 0 { - klog.Errorf("%v : There were a total of %v errors similar to this. Turn up verbosity to see them.", errs[0], len(errs)) + klog.ErrorS(errs[0], "There were many similar errors. Turn up verbosity to see them.", "numErrs", len(errs)) for _, err := range errs { - klog.V(5).Infof("Orphan pod: %v", err) + klog.V(5).InfoS("Orphan pod", "err", err) } } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/download.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/download.go index aa9c6746f9db..1b2a3c852ada 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/download.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/download.go @@ -19,6 +19,7 @@ package checkpoint import ( "context" "fmt" + "k8s.io/klog/v2" "math/rand" "time" @@ -35,7 +36,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/apis/config/scheme" "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/status" utilcodec "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/codec" - utillog "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log" ) // Payload represents a local copy of a config source (payload) object @@ -178,25 +178,25 @@ func (r *remoteConfigMap) Download(client clientset.Interface, store cache.Store ) // check the in-memory store for the ConfigMap, so we can skip unnecessary downloads if store != nil { - utillog.Infof("checking in-memory store for %s", r.APIPath()) + klog.InfoS("Kubelet config controller checking in-memory store for remoteConfigMap", "apiPath", r.APIPath()) cm, err = getConfigMapFromStore(store, r.source.ConfigMap.Namespace, r.source.ConfigMap.Name) if err != nil { // just log the error, we'll attempt a direct download instead - utillog.Errorf("failed to check in-memory store for %s, error: %v", r.APIPath(), err) + klog.ErrorS(err, "Kubelet config controller failed to check in-memory store for remoteConfigMap", "apiPath", r.APIPath()) } else if cm != nil { - utillog.Infof("found %s in in-memory store, UID: %s, ResourceVersion: %s", r.APIPath(), cm.UID, cm.ResourceVersion) + klog.InfoS("Kubelet config controller found remoteConfigMap in in-memory store", "apiPath", r.APIPath(), "configMapUID", cm.UID, "resourceVersion", cm.ResourceVersion) } else { - utillog.Infof("did not find %s in in-memory store", r.APIPath()) + klog.InfoS("Kubelet config controller did not find remoteConfigMap in in-memory store", "apiPath", r.APIPath()) } } // if we didn't find the ConfigMap in the in-memory store, download it from the API server if cm == nil { - utillog.Infof("attempting to download %s", r.APIPath()) + klog.InfoS("Kubelet config controller attempting to download remoteConfigMap", "apiPath", r.APIPath()) cm, err = client.CoreV1().ConfigMaps(r.source.ConfigMap.Namespace).Get(context.TODO(), r.source.ConfigMap.Name, metav1.GetOptions{}) if err != nil { return nil, status.DownloadError, fmt.Errorf("%s, error: %v", status.DownloadError, err) } - utillog.Infof("successfully downloaded %s, UID: %s, ResourceVersion: %s", r.APIPath(), cm.UID, cm.ResourceVersion) + klog.InfoS("Kubelet config controller successfully downloaded remoteConfigMap", "apiPath", r.APIPath(), "configMapUID", cm.UID, "resourceVersion", cm.ResourceVersion) } // Assert: Now we have a non-nil ConfigMap // construct Payload from the ConfigMap payload, err := NewConfigMapPayload(cm) @@ -255,7 +255,7 @@ func getConfigMapFromStore(store cache.Store, namespace, name string) (*apiv1.Co cm, ok := obj.(*apiv1.ConfigMap) if !ok { err := fmt.Errorf("failed to cast object %s from informer's store to ConfigMap", key) - utillog.Errorf(err.Error()) + klog.ErrorS(err, "Kubelet config controller") return nil, err } return cm, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/store/fsstore.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/store/fsstore.go index 26c48d06f267..ca5aa9a7efa9 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/store/fsstore.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/store/fsstore.go @@ -18,6 +18,7 @@ package store import ( "fmt" + "k8s.io/klog/v2" "path/filepath" "time" @@ -25,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint" "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/configfiles" utilfiles "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/files" - utillog "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log" utilfs "k8s.io/kubernetes/pkg/util/filesystem" ) @@ -56,7 +56,7 @@ func NewFsStore(fs utilfs.Filesystem, dir string) Store { } func (s *fsStore) Initialize() error { - utillog.Infof("initializing config checkpoints directory %q", s.dir) + klog.InfoS("Kubelet config controller initializing config checkpoints directory", "path", s.dir) // ensure top-level dir for store if err := utilfiles.EnsureDir(s.fs, s.dir); err != nil { return err @@ -113,7 +113,7 @@ func (s *fsStore) Load(source checkpoint.RemoteConfigSource) (*kubeletconfig.Kub return nil, fmt.Errorf("no checkpoint for source %s", sourceFmt) } // load the kubelet config file - utillog.Infof("loading Kubelet configuration checkpoint for source %s", sourceFmt) + klog.InfoS("Kubelet config controller loading Kubelet configuration checkpoint for source", "apiPath", source.APIPath(), "sourceUID", source.UID(), "resourceVersion", source.ResourceVersion()) loader, err := configfiles.NewFsLoader(s.fs, filepath.Join(s.checkpointPath(source.UID(), source.ResourceVersion()), source.KubeletFilename())) if err != nil { return nil, err diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/configsync.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/configsync.go index fc8706bbc18e..f4dea057d194 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/configsync.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/configsync.go @@ -32,7 +32,6 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint" "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/status" - utillog "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log" ) const ( @@ -65,7 +64,7 @@ func (cc *Controller) syncConfigSource(client clientset.Interface, eventClient v var syncerr error defer func() { if syncerr != nil { - utillog.Errorf(syncerr.Error()) + klog.ErrorS(syncerr, "Kubelet config controller") cc.pokeConfigSourceWorker() } }() @@ -80,7 +79,7 @@ func (cc *Controller) syncConfigSource(client clientset.Interface, eventClient v // a nil source simply means we reset to local defaults if source == nil { - utillog.Infof("Node.Spec.ConfigSource is empty, will reset assigned and last-known-good to defaults") + klog.InfoS("Kubelet config controller Node.Spec.ConfigSource is empty, will reset assigned and last-known-good to defaults") if updated, reason, err := cc.resetConfig(); err != nil { reason = fmt.Sprintf(status.SyncErrorFmt, reason) cc.configStatus.SetErrorOverride(reason) @@ -93,7 +92,7 @@ func (cc *Controller) syncConfigSource(client clientset.Interface, eventClient v } // a non-nil source means we should attempt to download the config, and checkpoint it if necessary - utillog.Infof("Node.Spec.ConfigSource is non-empty, will checkpoint source and update config if necessary") + klog.InfoS("Kubelet config controller Node.Spec.ConfigSource is non-empty, will checkpoint source and update config if necessary") // TODO(mtaufen): It would be nice if we could check the payload's metadata before (re)downloading the whole payload // we at least try pulling the latest configmap out of the local informer store. @@ -156,7 +155,7 @@ func (cc *Controller) saveConfigCheckpoint(source checkpoint.RemoteConfigSource, return status.InternalError, fmt.Errorf("%s, error: %v", status.InternalError, err) } if ok { - utillog.Infof("checkpoint already exists for %s, UID: %s, ResourceVersion: %s", source.APIPath(), payload.UID(), payload.ResourceVersion()) + klog.InfoS("Kubelet config controller checkpoint already exists for source", "apiPath", source.APIPath(), "checkpointUID", payload.UID(), "resourceVersion", payload.ResourceVersion()) return "", nil } if err := cc.checkpointStore.Save(payload); err != nil { @@ -198,11 +197,11 @@ func restartForNewConfig(eventClient v1core.EventsGetter, nodeName string, sourc // we directly log and send the event, instead of using the event recorder, // because the event recorder won't flush its queue before we exit (we'd lose the event) event := makeEvent(nodeName, apiv1.EventTypeNormal, KubeletConfigChangedEventReason, message) - klog.V(3).Infof("Event(%#v): type: '%v' reason: '%v' %v", event.InvolvedObject, event.Type, event.Reason, event.Message) + klog.V(3).InfoS("Event created", "event", klog.KObj(event), "involvedObject", event.InvolvedObject, "eventType", event.Type, "reason", event.Reason, "message", event.Message) if _, err := eventClient.Events(apiv1.NamespaceDefault).Create(context.TODO(), event, metav1.CreateOptions{}); err != nil { - utillog.Errorf("failed to send event, error: %v", err) + klog.ErrorS(err, "Kubelet config controller failed to send event") } - utillog.Infof(message) + klog.InfoS("Kubelet config controller event", "message", message) os.Exit(0) } @@ -211,17 +210,17 @@ func latestNodeConfigSource(store cache.Store, nodeName string) (*apiv1.NodeConf obj, ok, err := store.GetByKey(nodeName) if err != nil { err := fmt.Errorf("failed to retrieve Node %q from informer's store, error: %v", nodeName, err) - utillog.Errorf(err.Error()) + klog.ErrorS(err, "Kubelet config controller") return nil, err } else if !ok { err := fmt.Errorf("node %q does not exist in the informer's store, can't sync config source", nodeName) - utillog.Errorf(err.Error()) + klog.ErrorS(err, "Kubelet config controller") return nil, err } node, ok := obj.(*apiv1.Node) if !ok { err := fmt.Errorf("failed to cast object from informer's store to Node, can't sync config source for Node %q", nodeName) - utillog.Errorf(err.Error()) + klog.ErrorS(err, "Kubelet config controller") return nil, err } // Copy the source, so anyone who modifies it after here doesn't mess up the informer's store! diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/controller.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/controller.go index 50b65a67a3ae..45272af94b19 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/controller.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/controller.go @@ -18,6 +18,7 @@ package kubeletconfig import ( "fmt" + "k8s.io/klog/v2" "path/filepath" "time" @@ -32,7 +33,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint" "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/store" "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/status" - utillog "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log" utilpanic "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/panic" utilfs "k8s.io/kubernetes/pkg/util/filesystem" ) @@ -98,7 +98,7 @@ func NewController(dynamicConfigDir string, transform TransformFunc) *Controller // or returns an error if no valid configuration could be produced. Bootstrap should be called synchronously before StartSync. // If the pre-existing local configuration should be used, Bootstrap returns a nil config. func (cc *Controller) Bootstrap() (*kubeletconfig.KubeletConfiguration, error) { - utillog.Infof("starting controller") + klog.InfoS("Kubelet config controller starting controller") // ensure the filesystem is initialized if err := cc.initializeDynamicConfigDir(); err != nil { @@ -148,7 +148,7 @@ func (cc *Controller) Bootstrap() (*kubeletconfig.KubeletConfiguration, error) { // or something else scary // log the reason and error details for the failure to load the assigned config - utillog.Errorf(fmt.Sprintf("%s, error: %v", reason, err)) + klog.ErrorS(err, "Kubelet config controller", "reason", reason) // set status to indicate the failure with the assigned config cc.configStatus.SetError(reason) @@ -194,7 +194,7 @@ func (cc *Controller) StartSync(client clientset.Interface, eventClient v1core.E // status sync worker statusSyncLoopFunc := utilpanic.HandlePanic(func() { - utillog.Infof("starting status sync loop") + klog.InfoS("Kubelet config controller starting status sync loop") wait.JitterUntil(func() { cc.configStatus.Sync(client, nodeName) }, 10*time.Second, 0.2, true, wait.NeverStop) @@ -204,7 +204,7 @@ func (cc *Controller) StartSync(client clientset.Interface, eventClient v1core.E if err != nil { return fmt.Errorf(errFmt, err) } else if assignedSource == nil { - utillog.Infof("local source is assigned, will not start remote config source informer") + klog.InfoS("Kubelet config controller local source is assigned, will not start remote config source informer") } else { cc.remoteConfigSourceInformer = assignedSource.Informer(client, cache.ResourceEventHandlerFuncs{ AddFunc: cc.onAddRemoteConfigSourceEvent, @@ -215,7 +215,7 @@ func (cc *Controller) StartSync(client clientset.Interface, eventClient v1core.E } remoteConfigSourceInformerFunc := utilpanic.HandlePanic(func() { if cc.remoteConfigSourceInformer != nil { - utillog.Infof("starting remote config source informer") + klog.InfoS("Kubelet config controller starting remote config source informer") cc.remoteConfigSourceInformer.Run(wait.NeverStop) } }) @@ -223,12 +223,12 @@ func (cc *Controller) StartSync(client clientset.Interface, eventClient v1core.E cc.nodeInformer = newSharedNodeInformer(client, nodeName, cc.onAddNodeEvent, cc.onUpdateNodeEvent, cc.onDeleteNodeEvent) nodeInformerFunc := utilpanic.HandlePanic(func() { - utillog.Infof("starting Node informer") + klog.InfoS("Kubelet config controller starting Node informer") cc.nodeInformer.Run(wait.NeverStop) }) // config sync worker configSyncLoopFunc := utilpanic.HandlePanic(func() { - utillog.Infof("starting Kubelet config sync loop") + klog.InfoS("Kubelet config controller starting Kubelet config sync loop") wait.JitterUntil(func() { cc.syncConfigSource(client, eventClient, nodeName) }, 10*time.Second, 0.2, true, wait.NeverStop) @@ -264,7 +264,7 @@ func (cc *Controller) loadConfig(source checkpoint.RemoteConfigSource) (*kubelet // initializeDynamicConfigDir makes sure that the storage layers for various controller components are set up correctly func (cc *Controller) initializeDynamicConfigDir() error { - utillog.Infof("ensuring filesystem is set up correctly") + klog.InfoS("Kubelet config controller ensuring filesystem is set up correctly") // initializeDynamicConfigDir local checkpoint storage location return cc.checkpointStore.Initialize() } @@ -273,10 +273,10 @@ func (cc *Controller) initializeDynamicConfigDir() error { func (cc *Controller) checkTrial(duration time.Duration) { // when the trial period is over, the assigned config becomes the last-known-good if trial, err := cc.inTrial(duration); err != nil { - utillog.Errorf("failed to check trial period for assigned config, error: %v", err) + klog.ErrorS(err, "Kubelet config controller failed to check trial period for assigned config") } else if !trial { if err := cc.graduateAssignedToLastKnownGood(); err != nil { - utillog.Errorf("failed to set last-known-good to assigned config, error: %v", err) + klog.ErrorS(err, "failed to set last-known-good to assigned config") } } } @@ -319,6 +319,6 @@ func (cc *Controller) graduateAssignedToLastKnownGood() error { } // update the status to reflect the new last-known-good config cc.configStatus.SetLastKnownGood(assigned.NodeConfigSource()) - utillog.Infof("updated last-known-good config to %s, UID: %s, ResourceVersion: %s", assigned.APIPath(), assigned.UID(), assigned.ResourceVersion()) + klog.InfoS("Kubelet config controller updated last-known-good config to new checkpointStore", "apiPath", assigned.APIPath(), "checkpointUID", assigned.UID(), "resourceVersion", assigned.ResourceVersion()) return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/status/status.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/status/status.go index ad2cf898c860..aad5c0b395da 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/status/status.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/status/status.go @@ -19,13 +19,13 @@ package status import ( "context" "fmt" + "k8s.io/klog/v2" "sync" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" clientset "k8s.io/client-go/kubernetes" - utillog "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log" "k8s.io/kubernetes/pkg/kubelet/metrics" nodeutil "k8s.io/kubernetes/pkg/util/node" ) @@ -143,7 +143,7 @@ func (s *nodeConfigStatus) Sync(client clientset.Interface, nodeName string) { return } - utillog.Infof("updating Node.Status.Config") + klog.InfoS("Kubelet config controller updating Node.Status.Config") // grab the lock s.mux.Lock() @@ -153,7 +153,7 @@ func (s *nodeConfigStatus) Sync(client clientset.Interface, nodeName string) { var err error defer func() { if err != nil { - utillog.Errorf(err.Error()) + klog.ErrorS(err, "Kubelet config controller") s.sync() } }() @@ -198,6 +198,6 @@ func (s *nodeConfigStatus) Sync(client clientset.Interface, nodeName string) { // patch the node with the new status if _, _, err := nodeutil.PatchNodeStatus(client.CoreV1(), types.NodeName(nodeName), oldNode, newNode); err != nil { - utillog.Errorf("failed to patch node status, error: %v", err) + klog.ErrorS(err, "Kubelet config controller failed to patch node status") } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/codec/codec.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/codec/codec.go index c4adc4fc7c4e..37e8269106f7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/codec/codec.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/codec/codec.go @@ -115,7 +115,7 @@ func DecodeKubeletConfiguration(kubeletCodecs *serializer.CodecFactory, data []b return nil, fmt.Errorf("failed lenient decoding: %v", err) } // Continue with the v1beta1 object that was decoded leniently, but emit a warning. - klog.Warningf("using lenient decoding as strict decoding failed: %v", err) + klog.InfoS("Using lenient decoding as strict decoding failed", "err", err) } internalKC, ok := obj.(*kubeletconfig.KubeletConfiguration) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log/log.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log/log.go deleted file mode 100644 index ff76ff8f029f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log/log.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package log - -import ( - "fmt" - - "k8s.io/klog/v2" -) - -const logFmt = "kubelet config controller: %s" - -// Errorf shim that inserts "kubelet config controller" at the beginning of the log message, -// while still reporting the call site of the logging function. -func Errorf(format string, args ...interface{}) { - var s string - if len(args) > 0 { - s = fmt.Sprintf(format, args...) - } else { - s = format - } - klog.ErrorDepth(1, fmt.Sprintf(logFmt, s)) -} - -// Infof shim that inserts "kubelet config controller" at the beginning of the log message, -// while still reporting the call site of the logging function. -func Infof(format string, args ...interface{}) { - var s string - if len(args) > 0 { - s = fmt.Sprintf(format, args...) - } else { - s = format - } - klog.InfoDepth(1, fmt.Sprintf(logFmt, s)) -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/watch.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/watch.go index bc247962ea72..229d23e10151 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/watch.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubeletconfig/watch.go @@ -17,6 +17,7 @@ limitations under the License. package kubeletconfig import ( + "k8s.io/klog/v2" "math/rand" "time" @@ -26,7 +27,6 @@ import ( "k8s.io/apimachinery/pkg/fields" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" - utillog "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log" ) // newSharedNodeInformer returns a shared informer that uses `client` to watch the Node with @@ -67,22 +67,22 @@ func (cc *Controller) onAddNodeEvent(newObj interface{}) { func (cc *Controller) onUpdateNodeEvent(oldObj interface{}, newObj interface{}) { newNode, ok := newObj.(*apiv1.Node) if !ok { - utillog.Errorf("failed to cast new object to Node, couldn't handle event") + klog.ErrorS(nil, "Kubelet config controller failed to cast new object to Node, couldn't handle event") return } if oldObj == nil { // Node was just added, need to sync - utillog.Infof("initial Node watch event") + klog.InfoS("Kubelet config controller initial Node watch event") cc.pokeConfigSourceWorker() return } oldNode, ok := oldObj.(*apiv1.Node) if !ok { - utillog.Errorf("failed to cast old object to Node, couldn't handle event") + klog.ErrorS(nil, "Kubelet config controller failed to cast old object to Node, couldn't handle event") return } if !apiequality.Semantic.DeepEqual(oldNode.Spec.ConfigSource, newNode.Spec.ConfigSource) { - utillog.Infof("Node.Spec.ConfigSource was updated") + klog.InfoS("Kubelet config controller Node.Spec.ConfigSource was updated") cc.pokeConfigSourceWorker() } } @@ -96,7 +96,7 @@ func (cc *Controller) onDeleteNodeEvent(deletedObj interface{}) { // For this case, we just log the event. // We don't want to poke the worker, because a temporary deletion isn't worth reporting an error for. // If the Node is deleted because the VM is being deleted, then the Kubelet has nothing to do. - utillog.Infof("Node was deleted") + klog.InfoS("Kubelet config controller Node was deleted") } // onAddRemoteConfigSourceEvent calls onUpdateConfigMapEvent with the new object and a nil old object @@ -110,22 +110,22 @@ func (cc *Controller) onUpdateRemoteConfigSourceEvent(oldObj interface{}, newObj // since ConfigMap is currently the only source type, we handle that here newConfigMap, ok := newObj.(*apiv1.ConfigMap) if !ok { - utillog.Errorf("failed to cast new object to ConfigMap, couldn't handle event") + klog.ErrorS(nil, "Kubelet config controller failed to cast new object to ConfigMap, couldn't handle event") return } if oldObj == nil { // ConfigMap was just added, need to sync - utillog.Infof("initial ConfigMap watch event") + klog.InfoS("Kubelet config controller initial ConfigMap watch event") cc.pokeConfigSourceWorker() return } oldConfigMap, ok := oldObj.(*apiv1.ConfigMap) if !ok { - utillog.Errorf("failed to cast old object to ConfigMap, couldn't handle event") + klog.ErrorS(nil, "Kubelet config controller failed to cast old object to ConfigMap, couldn't handle event") return } if !apiequality.Semantic.DeepEqual(oldConfigMap, newConfigMap) { - utillog.Infof("assigned ConfigMap was updated") + klog.InfoS("Kubelet config controller assigned ConfigMap was updated") cc.pokeConfigSourceWorker() } } @@ -135,6 +135,6 @@ func (cc *Controller) onDeleteRemoteConfigSourceEvent(deletedObj interface{}) { // If the ConfigMap we're watching is deleted, we log the event and poke the sync worker. // This requires a sync, because if the Node is still configured to use the deleted ConfigMap, // the Kubelet should report a DownloadError. - utillog.Infof("assigned ConfigMap was deleted") + klog.InfoS("Kubelet config controller assigned ConfigMap was deleted") cc.pokeConfigSourceWorker() } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/helpers.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/helpers.go index 6db2698cb59b..7b4fb7c5d54b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/helpers.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/helpers.go @@ -81,7 +81,7 @@ func toRuntimeProtocol(protocol v1.Protocol) runtimeapi.Protocol { return runtimeapi.Protocol_SCTP } - klog.Warningf("Unknown protocol %q: defaulting to TCP", protocol) + klog.InfoS("Unknown protocol, defaulting to TCP", "protocol", protocol) return runtimeapi.Protocol_TCP } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go index dcbcc0589fcb..3804e9b04a52 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go @@ -227,7 +227,7 @@ func (m *kubeGenericRuntimeManager) startContainer(podSandboxID string, podSandb msg, handlerErr := m.runner.Run(kubeContainerID, pod, container, container.Lifecycle.PostStart) if handlerErr != nil { m.recordContainerEvent(pod, container, kubeContainerID.ID, v1.EventTypeWarning, events.FailedPostStartHook, msg) - if err := m.killContainer(pod, kubeContainerID, container.Name, "FailedPostStartHook", nil); err != nil { + if err := m.killContainer(pod, kubeContainerID, container.Name, "FailedPostStartHook", reasonFailedPostStartHook, nil); err != nil { klog.ErrorS(fmt.Errorf("%s: %v", ErrPostStartHook, handlerErr), "Failed to kill container", "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", container.Name, "containerID", kubeContainerID.String()) } @@ -596,7 +596,7 @@ func (m *kubeGenericRuntimeManager) restoreSpecsFromContainerLabels(containerID // killContainer kills a container through the following steps: // * Run the pre-stop lifecycle hooks (if applicable). // * Stop the container. -func (m *kubeGenericRuntimeManager) killContainer(pod *v1.Pod, containerID kubecontainer.ContainerID, containerName string, message string, gracePeriodOverride *int64) error { +func (m *kubeGenericRuntimeManager) killContainer(pod *v1.Pod, containerID kubecontainer.ContainerID, containerName string, message string, reason containerKillReason, gracePeriodOverride *int64) error { var containerSpec *v1.Container if pod != nil { if containerSpec = kubecontainer.GetContainerSpec(pod, containerName); containerSpec == nil { @@ -619,6 +619,19 @@ func (m *kubeGenericRuntimeManager) killContainer(pod *v1.Pod, containerID kubec gracePeriod = *pod.DeletionGracePeriodSeconds case pod.Spec.TerminationGracePeriodSeconds != nil: gracePeriod = *pod.Spec.TerminationGracePeriodSeconds + + if utilfeature.DefaultFeatureGate.Enabled(features.ProbeTerminationGracePeriod) { + switch reason { + case reasonStartupProbe: + if containerSpec.StartupProbe != nil && containerSpec.StartupProbe.TerminationGracePeriodSeconds != nil { + gracePeriod = *containerSpec.StartupProbe.TerminationGracePeriodSeconds + } + case reasonLivenessProbe: + if containerSpec.LivenessProbe != nil && containerSpec.LivenessProbe.TerminationGracePeriodSeconds != nil { + gracePeriod = *containerSpec.LivenessProbe.TerminationGracePeriodSeconds + } + } + } } if len(message) == 0 { @@ -672,9 +685,10 @@ func (m *kubeGenericRuntimeManager) killContainersWithSyncResult(pod *v1.Pod, ru defer wg.Done() killContainerResult := kubecontainer.NewSyncResult(kubecontainer.KillContainer, container.Name) - if err := m.killContainer(pod, container.ID, container.Name, "", gracePeriodOverride); err != nil { + if err := m.killContainer(pod, container.ID, container.Name, "", reasonUnknown, gracePeriodOverride); err != nil { killContainerResult.Fail(kubecontainer.ErrKillContainer, err.Error()) - klog.ErrorS(err, "Kill container failed", "pod", klog.KObj(pod), "podUID", pod.UID, + // Use runningPod for logging as the pod passed in could be *nil*. + klog.ErrorS(err, "Kill container failed", "pod", klog.KRef(runningPod.Namespace, runningPod.Name), "podUID", runningPod.ID, "containerName", container.Name, "containerID", container.ID) } containerResults <- killContainerResult diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_linux.go index 0f4fab34c049..85ad47772e86 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_linux.go @@ -112,13 +112,13 @@ func GetHugepageLimitsFromResources(resources v1.ResourceRequirements) []*runtim pageSize, err := v1helper.HugePageSizeFromResourceName(resourceObj) if err != nil { - klog.Warningf("Failed to get hugepage size from resource name: %v", err) + klog.InfoS("Failed to get hugepage size from resource", "object", resourceObj, "err", err) continue } sizeString, err := v1helper.HugePageUnitSizeFromByteSize(pageSize.Value()) if err != nil { - klog.Warningf("pageSize is invalid: %v", err) + klog.InfoS("Size is invalid", "object", resourceObj, "err", err) continue } requiredHugepageLimits[sizeString] = uint64(amountObj.Value()) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_windows.go index 348423e018d7..5b4910e5fbfb 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_windows.go @@ -97,7 +97,7 @@ func (m *kubeGenericRuntimeManager) generateWindowsContainerConfig(container *v1 if wc.Resources.CpuCount > 0 { if wc.Resources.CpuMaximum > 0 { wc.Resources.CpuMaximum = 0 - klog.Warningf("Mutually exclusive options: CPUCount priority > CPUMaximum priority on Windows Server Containers. CPUMaximum should be ignored") + klog.InfoS("Mutually exclusive options: CPUCount priority > CPUMaximum priority on Windows Server Containers. CPUMaximum should be ignored") } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_gc.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_gc.go index 8c4f786db9b1..a93cc5a88764 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_gc.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_gc.go @@ -137,13 +137,13 @@ func (cgc *containerGC) removeOldestN(containers []containerGCInfo, toRemove int ID: containers[i].id, } message := "Container is in unknown state, try killing it before removal" - if err := cgc.manager.killContainer(nil, id, containers[i].name, message, nil); err != nil { - klog.Errorf("Failed to stop container %q: %v", containers[i].id, err) + if err := cgc.manager.killContainer(nil, id, containers[i].name, message, reasonUnknown, nil); err != nil { + klog.ErrorS(err, "Failed to stop container", "containerID", containers[i].id) continue } } if err := cgc.manager.removeContainer(containers[i].id); err != nil { - klog.Errorf("Failed to remove container %q: %v", containers[i].id, err) + klog.ErrorS(err, "Failed to remove container", "containerID", containers[i].id) } } @@ -168,16 +168,16 @@ func (cgc *containerGC) removeOldestNSandboxes(sandboxes []sandboxGCInfo, toRemo // removeSandbox removes the sandbox by sandboxID. func (cgc *containerGC) removeSandbox(sandboxID string) { - klog.V(4).Infof("Removing sandbox %q", sandboxID) + klog.V(4).InfoS("Removing sandbox", "sandboxID", sandboxID) // In normal cases, kubelet should've already called StopPodSandbox before // GC kicks in. To guard against the rare cases where this is not true, try // stopping the sandbox before removing it. if err := cgc.client.StopPodSandbox(sandboxID); err != nil { - klog.Errorf("Failed to stop sandbox %q before removing: %v", sandboxID, err) + klog.ErrorS(err, "Failed to stop sandbox before removing", "sandboxID", sandboxID) return } if err := cgc.client.RemovePodSandbox(sandboxID); err != nil { - klog.Errorf("Failed to remove sandbox %q: %v", sandboxID, err) + klog.ErrorS(err, "Failed to remove sandbox", "sandboxID", sandboxID) } } @@ -342,7 +342,7 @@ func (cgc *containerGC) evictPodLogsDirectories(allSourcesReady bool) error { } err := osInterface.RemoveAll(filepath.Join(podLogsRootDirectory, name)) if err != nil { - klog.Errorf("Failed to remove pod logs directory %q: %v", name, err) + klog.ErrorS(err, "Failed to remove pod logs directory", "path", name) } } } @@ -357,7 +357,7 @@ func (cgc *containerGC) evictPodLogsDirectories(allSourcesReady bool) error { if err != nil { // TODO: we should handle container not found (i.e. container was deleted) case differently // once https://github.com/kubernetes/kubernetes/issues/63336 is resolved - klog.Infof("Error getting ContainerStatus for containerID %q: %v", containerID, err) + klog.InfoS("Error getting ContainerStatus for containerID", "containerID", containerID, "err", err) } else if status.State != runtimeapi.ContainerState_CONTAINER_EXITED { // Here is how container log rotation works (see containerLogManager#rotateLatestLog): // @@ -370,17 +370,17 @@ func (cgc *containerGC) evictPodLogsDirectories(allSourcesReady bool) error { // See https://github.com/kubernetes/kubernetes/issues/52172 // // We only remove unhealthy symlink for dead containers - klog.V(5).Infof("Container %q is still running, not removing symlink %q.", containerID, logSymlink) + klog.V(5).InfoS("Container is still running, not removing symlink", "containerID", containerID, "path", logSymlink) continue } } else { - klog.V(4).Infof("unable to obtain container Id: %v", err) + klog.V(4).InfoS("Unable to obtain container ID", "err", err) } err := osInterface.Remove(logSymlink) if err != nil { - klog.Errorf("Failed to remove container log dead symlink %q: %v", logSymlink, err) + klog.ErrorS(err, "Failed to remove container log dead symlink", "path", logSymlink) } else { - klog.V(4).Infof("removed symlink %s", logSymlink) + klog.V(4).InfoS("Removed symlink", "path", logSymlink) } } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_image.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_image.go index 146e5aac408a..1255335bd357 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_image.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_image.go @@ -44,11 +44,11 @@ func (m *kubeGenericRuntimeManager) PullImage(image kubecontainer.ImageSpec, pul creds, withCredentials := keyring.Lookup(repoToPull) if !withCredentials { - klog.V(3).Infof("Pulling image %q without credentials", img) + klog.V(3).InfoS("Pulling image without credentials", "image", img) imageRef, err := m.imageService.PullImage(imgSpec, nil, podSandboxConfig) if err != nil { - klog.Errorf("Pull image %q failed: %v", img, err) + klog.ErrorS(err, "Failed to pull image", "image", img) return "", err } @@ -83,7 +83,7 @@ func (m *kubeGenericRuntimeManager) PullImage(image kubecontainer.ImageSpec, pul func (m *kubeGenericRuntimeManager) GetImageRef(image kubecontainer.ImageSpec) (string, error) { status, err := m.imageService.ImageStatus(toRuntimeAPIImageSpec(image)) if err != nil { - klog.Errorf("ImageStatus for image %q failed: %v", image, err) + klog.ErrorS(err, "Failed to get image status", "image", image.Image) return "", err } if status == nil { @@ -98,7 +98,7 @@ func (m *kubeGenericRuntimeManager) ListImages() ([]kubecontainer.Image, error) allImages, err := m.imageService.ListImages(nil) if err != nil { - klog.Errorf("ListImages failed: %v", err) + klog.ErrorS(err, "Failed to list images") return nil, err } @@ -119,7 +119,7 @@ func (m *kubeGenericRuntimeManager) ListImages() ([]kubecontainer.Image, error) func (m *kubeGenericRuntimeManager) RemoveImage(image kubecontainer.ImageSpec) error { err := m.imageService.RemoveImage(&runtimeapi.ImageSpec{Image: image.Image}) if err != nil { - klog.Errorf("Remove image %q failed: %v", image.Image, err) + klog.ErrorS(err, "Failed to remove image", "image", image.Image) return err } @@ -133,7 +133,7 @@ func (m *kubeGenericRuntimeManager) RemoveImage(image kubecontainer.ImageSpec) e func (m *kubeGenericRuntimeManager) ImageStats() (*kubecontainer.ImageStats, error) { allImages, err := m.imageService.ListImages(nil) if err != nil { - klog.Errorf("ListImages failed: %v", err) + klog.ErrorS(err, "Failed to list images") return nil, err } stats := &kubecontainer.ImageStats{} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go index 4071b904026d..d83e75e300a2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go @@ -205,7 +205,7 @@ func NewKubeGenericRuntimeManager( typedVersion, err := kubeRuntimeManager.getTypedVersion() if err != nil { - klog.ErrorS(err, "Get runtime version failed: %v") + klog.ErrorS(err, "Get runtime version failed") return nil, err } @@ -403,6 +403,16 @@ func (m *kubeGenericRuntimeManager) GetPods(all bool) ([]*kubecontainer.Pod, err return result, nil } +// containerKillReason explains what killed a given container +type containerKillReason string + +const ( + reasonStartupProbe containerKillReason = "StartupProbe" + reasonLivenessProbe containerKillReason = "LivenessProbe" + reasonFailedPostStartHook containerKillReason = "FailedPostStartHook" + reasonUnknown containerKillReason = "Unknown" +) + // containerToKillInfo contains necessary information to kill a container. type containerToKillInfo struct { // The spec of the container. @@ -411,6 +421,9 @@ type containerToKillInfo struct { name string // The message indicates why the container will be killed. message string + // The reason is a clearer source of info on why a container will be killed + // TODO: replace message with reason? + reason containerKillReason } // podActions keeps information what to do for a pod. @@ -501,7 +514,7 @@ func containerSucceeded(c *v1.Container, podStatus *kubecontainer.PodStatus) boo // computePodActions checks whether the pod spec has changed and returns the changes if true. func (m *kubeGenericRuntimeManager) computePodActions(pod *v1.Pod, podStatus *kubecontainer.PodStatus) podActions { - klog.V(5).InfoS("Syncing Pod", klog.KObj(pod)) + klog.V(5).InfoS("Syncing Pod", "pod", klog.KObj(pod)) createPodSandbox, attempt, sandboxID := m.podSandboxChanged(pod, podStatus) changes := podActions{ @@ -582,6 +595,7 @@ func (m *kubeGenericRuntimeManager) computePodActions(pod *v1.Pod, podStatus *ku container: next, message: fmt.Sprintf("Init container is in %q state, try killing it before restart", initLastStatus.State), + reason: reasonUnknown, } } changes.NextInitContainerToStart = next @@ -623,6 +637,7 @@ func (m *kubeGenericRuntimeManager) computePodActions(pod *v1.Pod, podStatus *ku container: &pod.Spec.Containers[idx], message: fmt.Sprintf("Container is in %q state, try killing it before restart", containerStatus.State), + reason: reasonUnknown, } } } @@ -630,6 +645,7 @@ func (m *kubeGenericRuntimeManager) computePodActions(pod *v1.Pod, podStatus *ku } // The container is running, but kill the container if any of the following condition is met. var message string + var reason containerKillReason restart := shouldRestartOnFailure(pod) if _, _, changed := containerChanged(&container, containerStatus); changed { message = fmt.Sprintf("Container %s definition changed", container.Name) @@ -639,9 +655,11 @@ func (m *kubeGenericRuntimeManager) computePodActions(pod *v1.Pod, podStatus *ku } else if liveness, found := m.livenessManager.Get(containerStatus.ID); found && liveness == proberesults.Failure { // If the container failed the liveness probe, we should kill it. message = fmt.Sprintf("Container %s failed liveness probe", container.Name) + reason = reasonLivenessProbe } else if startup, found := m.startupManager.Get(containerStatus.ID); found && startup == proberesults.Failure { // If the container failed the startup probe, we should kill it. message = fmt.Sprintf("Container %s failed startup probe", container.Name) + reason = reasonStartupProbe } else { // Keep the container. keepCount++ @@ -660,6 +678,7 @@ func (m *kubeGenericRuntimeManager) computePodActions(pod *v1.Pod, podStatus *ku name: containerStatus.Name, container: &pod.Spec.Containers[idx], message: message, + reason: reason, } klog.V(2).InfoS("Message for Container of pod", "containerName", container.Name, "containerStatusID", containerStatus.ID, "pod", klog.KObj(pod), "containerMessage", message) } @@ -692,16 +711,16 @@ func (m *kubeGenericRuntimeManager) SyncPod(pod *v1.Pod, podStatus *kubecontaine if podContainerChanges.SandboxID != "" { m.recorder.Eventf(ref, v1.EventTypeNormal, events.SandboxChanged, "Pod sandbox changed, it will be killed and re-created.") } else { - klog.V(4).InfoS("SyncPod received new pod, will create a sandbox for it", klog.KObj(pod)) + klog.V(4).InfoS("SyncPod received new pod, will create a sandbox for it", "pod", klog.KObj(pod)) } } // Step 2: Kill the pod if the sandbox has changed. if podContainerChanges.KillPod { if podContainerChanges.CreateSandbox { - klog.V(4).InfoS("Stopping PodSandbox for pod, will start new one", klog.KObj(pod)) + klog.V(4).InfoS("Stopping PodSandbox for pod, will start new one", "pod", klog.KObj(pod)) } else { - klog.V(4).InfoS("Stopping PodSandbox for pod, because all other containers are dead", klog.KObj(pod)) + klog.V(4).InfoS("Stopping PodSandbox for pod, because all other containers are dead", "pod", klog.KObj(pod)) } killResult := m.killPodWithSyncResult(pod, kubecontainer.ConvertPodStatusToRunningPod(m.runtimeName, podStatus), nil) @@ -720,7 +739,7 @@ func (m *kubeGenericRuntimeManager) SyncPod(pod *v1.Pod, podStatus *kubecontaine klog.V(3).InfoS("Killing unwanted container for pod", "containerName", containerInfo.name, "containerID", containerID, "pod", klog.KObj(pod)) killContainerResult := kubecontainer.NewSyncResult(kubecontainer.KillContainer, containerInfo.name) result.AddSyncResult(killContainerResult) - if err := m.killContainer(pod, containerID, containerInfo.name, containerInfo.message, nil); err != nil { + if err := m.killContainer(pod, containerID, containerInfo.name, containerInfo.message, containerInfo.reason, nil); err != nil { killContainerResult.Fail(kubecontainer.ErrKillContainer, err.Error()) klog.ErrorS(err, "killContainer for pod failed", "containerName", containerInfo.name, "containerID", containerID, "pod", klog.KObj(pod)) return @@ -768,10 +787,10 @@ func (m *kubeGenericRuntimeManager) SyncPod(pod *v1.Pod, podStatus *kubecontaine return } createSandboxResult.Fail(kubecontainer.ErrCreatePodSandbox, msg) - klog.ErrorS(err, "CreatePodSandbox for pod failed", klog.KObj(pod)) + klog.ErrorS(err, "CreatePodSandbox for pod failed", "pod", klog.KObj(pod)) ref, referr := ref.GetReference(legacyscheme.Scheme, pod) if referr != nil { - klog.ErrorS(referr, "Couldn't make a ref to pod %q: '%v'", klog.KObj(pod)) + klog.ErrorS(referr, "Couldn't make a ref to pod", "pod", klog.KObj(pod)) } m.recorder.Eventf(ref, v1.EventTypeWarning, events.FailedCreatePodSandBox, "Failed to create pod sandbox: %v", err) return @@ -832,7 +851,7 @@ func (m *kubeGenericRuntimeManager) SyncPod(pod *v1.Pod, podStatus *kubecontaine return err } - klog.V(4).InfoS("Creating container in pod %v", "containerType", typeName, "container", spec.container, "pod", klog.KObj(pod)) + klog.V(4).InfoS("Creating container in pod", "containerType", typeName, "container", spec.container, "pod", klog.KObj(pod)) // NOTE (aramase) podIPs are populated for single stack and dual stack clusters. Send only podIPs. if msg, err := m.startContainer(podSandboxID, podSandboxConfig, spec, pod, podStatus, pullSecrets, podIP, podIPs); err != nil { startContainerResult.Fail(err, msg) @@ -840,7 +859,7 @@ func (m *kubeGenericRuntimeManager) SyncPod(pod *v1.Pod, podStatus *kubecontaine // repetitive log spam switch { case err == images.ErrImagePullBackOff: - klog.V(3).InfoS("Container start failed in pod", "containerType", typeName, "container", spec.container, klog.KObj(pod), "containerMessage", msg, "err", err) + klog.V(3).InfoS("Container start failed in pod", "containerType", typeName, "container", spec.container, "pod", klog.KObj(pod), "containerMessage", msg, "err", err) default: utilruntime.HandleError(fmt.Errorf("%v %+v start failed in pod %v: %v: %s", typeName, spec.container, format.Pod(pod), err, msg)) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_sandbox.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_sandbox.go index db0bdd7a0dcb..60cc9dbb04a1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_sandbox.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_sandbox.go @@ -37,16 +37,16 @@ import ( func (m *kubeGenericRuntimeManager) createPodSandbox(pod *v1.Pod, attempt uint32) (string, string, error) { podSandboxConfig, err := m.generatePodSandboxConfig(pod, attempt) if err != nil { - message := fmt.Sprintf("GeneratePodSandboxConfig for pod %q failed: %v", format.Pod(pod), err) - klog.Error(message) + message := fmt.Sprintf("Failed to generate sandbox config for pod %q: %v", format.Pod(pod), err) + klog.ErrorS(err, "Failed to generate sandbox config for pod", "pod", klog.KObj(pod)) return "", message, err } // Create pod logs directory err = m.osInterface.MkdirAll(podSandboxConfig.LogDirectory, 0755) if err != nil { - message := fmt.Sprintf("Create pod log directory for pod %q failed: %v", format.Pod(pod), err) - klog.Errorf(message) + message := fmt.Sprintf("Failed to create log directory for pod %q: %v", format.Pod(pod), err) + klog.ErrorS(err, "Failed to create log directory for pod", "pod", klog.KObj(pod)) return "", message, err } @@ -54,18 +54,18 @@ func (m *kubeGenericRuntimeManager) createPodSandbox(pod *v1.Pod, attempt uint32 if m.runtimeClassManager != nil { runtimeHandler, err = m.runtimeClassManager.LookupRuntimeHandler(pod.Spec.RuntimeClassName) if err != nil { - message := fmt.Sprintf("CreatePodSandbox for pod %q failed: %v", format.Pod(pod), err) + message := fmt.Sprintf("Failed to create sandbox for pod %q: %v", format.Pod(pod), err) return "", message, err } if runtimeHandler != "" { - klog.V(2).Infof("Running pod %s with RuntimeHandler %q", format.Pod(pod), runtimeHandler) + klog.V(2).InfoS("Running pod with runtime handler", "pod", klog.KObj(pod), "runtimeHandler", runtimeHandler) } } podSandBoxID, err := m.runtimeService.RunPodSandbox(podSandboxConfig, runtimeHandler) if err != nil { - message := fmt.Sprintf("CreatePodSandbox for pod %q failed: %v", format.Pod(pod), err) - klog.Error(message) + message := fmt.Sprintf("Failed to create sandbox for pod %q: %v", format.Pod(pod), err) + klog.ErrorS(err, "Failed to create sandbox for pod", "pod", klog.KObj(pod)) return "", message, err } @@ -220,7 +220,7 @@ func (m *kubeGenericRuntimeManager) getKubeletSandboxes(all bool) ([]*runtimeapi resp, err := m.runtimeService.ListPodSandbox(filter) if err != nil { - klog.Errorf("ListPodSandbox failed: %v", err) + klog.ErrorS(err, "Failed to list pod sandboxes") return nil, err } @@ -231,7 +231,7 @@ func (m *kubeGenericRuntimeManager) getKubeletSandboxes(all bool) ([]*runtimeapi func (m *kubeGenericRuntimeManager) determinePodSandboxIPs(podNamespace, podName string, podSandbox *runtimeapi.PodSandboxStatus) []string { podIPs := make([]string, 0) if podSandbox.Network == nil { - klog.Warningf("Pod Sandbox status doesn't have network information, cannot report IPs") + klog.InfoS("Pod Sandbox status doesn't have network information, cannot report IPs", "pod", klog.KRef(podNamespace, podName)) return podIPs } @@ -241,7 +241,7 @@ func (m *kubeGenericRuntimeManager) determinePodSandboxIPs(podNamespace, podName // pick primary IP if len(podSandbox.Network.Ip) != 0 { if net.ParseIP(podSandbox.Network.Ip) == nil { - klog.Warningf("Pod Sandbox reported an unparseable IP (Primary) %v", podSandbox.Network.Ip) + klog.InfoS("Pod Sandbox reported an unparseable primary IP", "pod", klog.KRef(podNamespace, podName), "IP", podSandbox.Network.Ip) return nil } podIPs = append(podIPs, podSandbox.Network.Ip) @@ -250,7 +250,7 @@ func (m *kubeGenericRuntimeManager) determinePodSandboxIPs(podNamespace, podName // pick additional ips, if cri reported them for _, podIP := range podSandbox.Network.AdditionalIps { if nil == net.ParseIP(podIP.Ip) { - klog.Warningf("Pod Sandbox reported an unparseable IP (additional) %v", podIP.Ip) + klog.InfoS("Pod Sandbox reported an unparseable additional IP", "pod", klog.KRef(podNamespace, podName), "IP", podIP.Ip) return nil } podIPs = append(podIPs, podIP.Ip) @@ -272,7 +272,7 @@ func (m *kubeGenericRuntimeManager) getSandboxIDByPodUID(podUID kubetypes.UID, s } sandboxes, err := m.runtimeService.ListPodSandbox(filter) if err != nil { - klog.Errorf("ListPodSandbox with pod UID %q failed: %v", podUID, err) + klog.ErrorS(err, "Failed to list sandboxes for pod", "podUID", podUID) return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/labels.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/labels.go index 6f9e15fd882e..2aaa1743ac67 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/labels.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/labels.go @@ -20,12 +20,11 @@ import ( "encoding/json" "strconv" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" kubetypes "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/types" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) const ( @@ -129,7 +128,7 @@ func newContainerAnnotations(container *v1.Container, pod *v1.Pod, restartCount // Using json encoding so that the PreStop handler object is readable after writing as a label rawPreStop, err := json.Marshal(container.Lifecycle.PreStop) if err != nil { - klog.Errorf("Unable to marshal lifecycle PreStop handler for container %q of pod %q: %v", container.Name, format.Pod(pod), err) + klog.ErrorS(err, "Unable to marshal lifecycle PreStop handler for container", "containerName", container.Name, "pod", klog.KObj(pod)) } else { annotations[containerPreStopHandlerLabel] = string(rawPreStop) } @@ -138,7 +137,7 @@ func newContainerAnnotations(container *v1.Container, pod *v1.Pod, restartCount if len(container.Ports) > 0 { rawContainerPorts, err := json.Marshal(container.Ports) if err != nil { - klog.Errorf("Unable to marshal container ports for container %q for pod %q: %v", container.Name, format.Pod(pod), err) + klog.ErrorS(err, "Unable to marshal container ports for container", "containerName", container.Name, "pod", klog.KObj(pod)) } else { annotations[containerPortsLabel] = string(rawContainerPorts) } @@ -192,28 +191,28 @@ func getContainerInfoFromAnnotations(annotations map[string]string) *annotatedCo } if containerInfo.Hash, err = getUint64ValueFromLabel(annotations, containerHashLabel); err != nil { - klog.Errorf("Unable to get %q from annotations %q: %v", containerHashLabel, annotations, err) + klog.ErrorS(err, "Unable to get label value from annotations", "label", containerHashLabel, "annotations", annotations) } if containerInfo.RestartCount, err = getIntValueFromLabel(annotations, containerRestartCountLabel); err != nil { - klog.Errorf("Unable to get %q from annotations %q: %v", containerRestartCountLabel, annotations, err) + klog.ErrorS(err, "Unable to get label value from annotations", "label", containerRestartCountLabel, "annotations", annotations) } if containerInfo.PodDeletionGracePeriod, err = getInt64PointerFromLabel(annotations, podDeletionGracePeriodLabel); err != nil { - klog.Errorf("Unable to get %q from annotations %q: %v", podDeletionGracePeriodLabel, annotations, err) + klog.ErrorS(err, "Unable to get label value from annotations", "label", podDeletionGracePeriodLabel, "annotations", annotations) } if containerInfo.PodTerminationGracePeriod, err = getInt64PointerFromLabel(annotations, podTerminationGracePeriodLabel); err != nil { - klog.Errorf("Unable to get %q from annotations %q: %v", podTerminationGracePeriodLabel, annotations, err) + klog.ErrorS(err, "Unable to get label value from annotations", "label", podTerminationGracePeriodLabel, "annotations", annotations) } preStopHandler := &v1.Handler{} if found, err := getJSONObjectFromLabel(annotations, containerPreStopHandlerLabel, preStopHandler); err != nil { - klog.Errorf("Unable to get %q from annotations %q: %v", containerPreStopHandlerLabel, annotations, err) + klog.ErrorS(err, "Unable to get label value from annotations", "label", containerPreStopHandlerLabel, "annotations", annotations) } else if found { containerInfo.PreStopHandler = preStopHandler } containerPorts := []v1.ContainerPort{} if found, err := getJSONObjectFromLabel(annotations, containerPortsLabel, &containerPorts); err != nil { - klog.Errorf("Unable to get %q from annotations %q: %v", containerPortsLabel, annotations, err) + klog.ErrorS(err, "Unable to get label value from annotations", "label", containerPortsLabel, "annotations", annotations) } else if found { containerInfo.ContainerPorts = containerPorts } @@ -226,7 +225,7 @@ func getStringValueFromLabel(labels map[string]string, label string) string { return value } // Do not report error, because there should be many old containers without label now. - klog.V(3).Infof("Container doesn't have label %s, it may be an old or invalid container", label) + klog.V(3).InfoS("Container doesn't have requested label, it may be an old or invalid container", "label", label) // Return empty string "" for these containers, the caller will get value by other ways. return "" } @@ -241,7 +240,7 @@ func getIntValueFromLabel(labels map[string]string, label string) (int, error) { return intValue, nil } // Do not report error, because there should be many old containers without label now. - klog.V(3).Infof("Container doesn't have label %s, it may be an old or invalid container", label) + klog.V(3).InfoS("Container doesn't have requested label, it may be an old or invalid container", "label", label) // Just set the value to 0 return 0, nil } @@ -256,7 +255,7 @@ func getUint64ValueFromLabel(labels map[string]string, label string) (uint64, er return intValue, nil } // Do not report error, because there should be many old containers without label now. - klog.V(3).Infof("Container doesn't have label %s, it may be an old or invalid container", label) + klog.V(3).InfoS("Container doesn't have requested label, it may be an old or invalid container", "label", label) // Just set the value to 0 return 0, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/logs/logs.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/logs/logs.go index 63413bdc69ea..428cc2eb65bb 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/logs/logs.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/logs/logs.go @@ -32,7 +32,7 @@ import ( "github.com/fsnotify/fsnotify" "k8s.io/klog/v2" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" internalapi "k8s.io/cri-api/pkg/apis" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "k8s.io/kubernetes/pkg/kubelet/types" @@ -316,7 +316,7 @@ func ReadLogs(ctx context.Context, path, containerID string, opts *LogOptions, r msg := &logMessage{} for { if stop || (limitedMode && limitedNum == 0) { - klog.V(2).Infof("Finish parsing log file %q", path) + klog.V(2).InfoS("Finished parsing log file", "path", path) return nil } l, err := r.ReadBytes(eol[0]) @@ -363,7 +363,7 @@ func ReadLogs(ctx context.Context, path, containerID string, opts *LogOptions, r } f.Close() if err := watcher.Remove(f.Name()); err != nil && !os.IsNotExist(err) { - klog.Errorf("failed to remove file watch %q: %v", f.Name(), err) + klog.ErrorS(err, "Failed to remove file watch", "path", f.Name()) } f = newF if err := watcher.Add(f.Name()); err != nil { @@ -379,7 +379,7 @@ func ReadLogs(ctx context.Context, path, containerID string, opts *LogOptions, r if len(l) == 0 { continue } - klog.Warningf("Incomplete line in log file %q: %q", path, l) + klog.InfoS("Incomplete line in log file", "path", path, "line", l) } if parse == nil { // Initialize the log parsing function. @@ -391,16 +391,16 @@ func ReadLogs(ctx context.Context, path, containerID string, opts *LogOptions, r // Parse the log line. msg.reset() if err := parse(l, msg); err != nil { - klog.Errorf("Failed with err %v when parsing log for log file %q: %q", err, path, l) + klog.ErrorS(err, "Failed when parsing line in log file", "path", path, "line", l) continue } // Write the log line into the stream. if err := writer.write(msg); err != nil { if err == errMaximumWrite { - klog.V(2).Infof("Finish parsing log file %q, hit bytes limit %d(bytes)", path, opts.bytes) + klog.V(2).InfoS("Finished parsing log file, hit bytes limit", "path", path, "limit", opts.bytes) return nil } - klog.Errorf("Failed with err %v when writing log for log file %q: %+v", err, path, msg) + klog.ErrorS(err, "Failed when writing line to log file", "path", path, "line", msg) return err } if limitedMode { @@ -417,7 +417,7 @@ func isContainerRunning(id string, r internalapi.RuntimeService) (bool, error) { } // Only keep following container log when it is running. if s.State != runtimeapi.ContainerState_CONTAINER_RUNNING { - klog.V(5).Infof("Container %q is not running (state=%q)", id, s.State) + klog.V(5).InfoS("Container is not running", "containerId", id, "state", s.State) // Do not return error because it's normal that the container stops // during waiting. return false, nil @@ -451,10 +451,10 @@ func waitLogs(ctx context.Context, id string, w *fsnotify.Watcher, runtimeServic case fsnotify.Chmod: return true, true, nil default: - klog.Errorf("Unexpected fsnotify event: %v, retrying...", e) + klog.ErrorS(nil, "Received unexpected fsnotify event, retrying", "event", e) } case err := <-w.Errors: - klog.Errorf("Fsnotify watch error: %v, %d error retries remaining", err, errRetry) + klog.ErrorS(err, "Received fsnotify watch error, retrying unless no more retries left", "retries", errRetry) if errRetry == 0 { return false, false, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/security_context_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/security_context_windows.go index 827e772fbba4..343757c0098e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/security_context_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/security_context_windows.go @@ -43,13 +43,15 @@ func verifyRunAsNonRoot(pod *v1.Pod, container *v1.Container, uid *int64, userna return nil } if effectiveSc.RunAsUser != nil { - klog.Warningf("Windows container does not support SecurityContext.RunAsUser, please use SecurityContext.WindowsOptions (pod: %q, container: %s)", format.Pod(pod), container.Name) + klog.InfoS("Windows container does not support SecurityContext.RunAsUser, please use SecurityContext.WindowsOptions", + "pod", klog.KObj(pod), "containerName", container.Name) } if effectiveSc.SELinuxOptions != nil { - klog.Warningf("Windows container does not support SecurityContext.SELinuxOptions, please use SecurityContext.WindowsOptions (pod: %q, container: %s)", format.Pod(pod), container.Name) + klog.InfoS("Windows container does not support SecurityContext.SELinuxOptions, please use SecurityContext.WindowsOptions", + "pod", klog.KObj(pod), "containerName", container.Name) } if effectiveSc.RunAsGroup != nil { - klog.Warningf("Windows container does not support SecurityContext.RunAsGroup (pod: %q, container: %s)", format.Pod(pod), container.Name) + klog.InfoS("Windows container does not support SecurityContext.RunAsGroup", "pod", klog.KObj(pod), "containerName", container.Name) } if effectiveSc.WindowsOptions != nil { if effectiveSc.WindowsOptions.RunAsUserName != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/handlers.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/handlers.go index b71682f4beb5..b4f804c3d74d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/handlers.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/handlers.go @@ -64,20 +64,20 @@ func (hr *handlerRunner) Run(containerID kubecontainer.ContainerID, pod *v1.Pod, output, err := hr.commandRunner.RunInContainer(containerID, handler.Exec.Command, 0) if err != nil { msg = fmt.Sprintf("Exec lifecycle hook (%v) for Container %q in Pod %q failed - error: %v, message: %q", handler.Exec.Command, container.Name, format.Pod(pod), err, string(output)) - klog.V(1).Infof(msg) + klog.V(1).ErrorS(err, "Exec lifecycle hook for Container in Pod failed", "execCommand", handler.Exec.Command, "containerName", container.Name, "pod", klog.KObj(pod), "message", string(output)) } return msg, err case handler.HTTPGet != nil: msg, err := hr.runHTTPHandler(pod, container, handler) if err != nil { - msg = fmt.Sprintf("Http lifecycle hook (%s) for Container %q in Pod %q failed - error: %v, message: %q", handler.HTTPGet.Path, container.Name, format.Pod(pod), err, msg) - klog.V(1).Infof(msg) + msg = fmt.Sprintf("HTTP lifecycle hook (%s) for Container %q in Pod %q failed - error: %v, message: %q", handler.HTTPGet.Path, container.Name, format.Pod(pod), err, msg) + klog.V(1).ErrorS(err, "HTTP lifecycle hook for Container in Pod failed", "path", handler.HTTPGet.Path, "containerName", container.Name, "pod", klog.KObj(pod)) } return msg, err default: err := fmt.Errorf("invalid handler: %v", handler) msg := fmt.Sprintf("Cannot run handler: %v", err) - klog.Errorf(msg) + klog.ErrorS(err, "Cannot run handler") return msg, err } } @@ -110,7 +110,7 @@ func (hr *handlerRunner) runHTTPHandler(pod *v1.Pod, container *v1.Container, ha if len(host) == 0 { status, err := hr.containerManager.GetPodStatus(pod.UID, pod.Name, pod.Namespace) if err != nil { - klog.Errorf("Unable to get pod info, event handlers may be invalid.") + klog.ErrorS(err, "Unable to get pod info, event handlers may be invalid.") return "", err } if len(status.IPs) == 0 { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go index a5b2bbf5a0ce..681c2b9adafd 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go @@ -20,11 +20,11 @@ import ( "fmt" v1 "k8s.io/api/core/v1" + v1affinityhelper "k8s.io/component-helpers/scheduling/corev1/nodeaffinity" "k8s.io/klog/v2" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" "k8s.io/kubernetes/pkg/kubelet/util/format" schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" - pluginhelper "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports" @@ -62,7 +62,7 @@ func NewPredicateAdmitHandler(getNodeAnyWayFunc getNodeAnyWayFuncType, admission func (w *predicateAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult { node, err := w.getNodeAnyWayFunc() if err != nil { - klog.Errorf("Cannot get Node info: %v", err) + klog.ErrorS(err, "Cannot get Node info") return PodAdmitResult{ Admit: false, Reason: "InvalidNodeInfo", @@ -76,7 +76,7 @@ func (w *predicateAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult // ensure the node has enough plugin resources for that required in pods if err = w.pluginResourceUpdateFunc(nodeInfo, attrs); err != nil { message := fmt.Sprintf("Update plugin resources failed due to %v, which is unexpected.", err) - klog.Warningf("Failed to admit pod %v - %s", format.Pod(admitPod), message) + klog.InfoS("Failed to admit pod", "pod", klog.KObj(admitPod), "message", message) return PodAdmitResult{ Admit: false, Reason: "UnexpectedAdmissionError", @@ -98,7 +98,7 @@ func (w *predicateAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult fit := len(reasons) == 0 && err == nil if err != nil { message := fmt.Sprintf("GeneralPredicates failed due to %v, which is unexpected.", err) - klog.Warningf("Failed to admit pod %v - %s", format.Pod(admitPod), message) + klog.InfoS("Failed to admit pod, GeneralPredicates failed", "pod", klog.KObj(admitPod), "err", err) return PodAdmitResult{ Admit: fit, Reason: "UnexpectedAdmissionError", @@ -110,7 +110,7 @@ func (w *predicateAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult fit = len(reasons) == 0 && err == nil if err != nil { message := fmt.Sprintf("Unexpected error while attempting to recover from admission failure: %v", err) - klog.Warningf("Failed to admit pod %v - %s", format.Pod(admitPod), message) + klog.InfoS("Failed to admit pod, unexpected error while attempting to recover from admission failure", "pod", klog.KObj(admitPod), "err", err) return PodAdmitResult{ Admit: fit, Reason: "UnexpectedAdmissionError", @@ -123,7 +123,7 @@ func (w *predicateAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult var message string if len(reasons) == 0 { message = fmt.Sprint("GeneralPredicates failed due to unknown reason, which is unexpected.") - klog.Warningf("Failed to admit pod %v - %s", format.Pod(admitPod), message) + klog.InfoS("Failed to admit pod: GeneralPredicates failed due to unknown reason, which is unexpected", "pod", klog.KObj(admitPod)) return PodAdmitResult{ Admit: fit, Reason: "UnknownReason", @@ -136,15 +136,15 @@ func (w *predicateAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult case *PredicateFailureError: reason = re.PredicateName message = re.Error() - klog.V(2).Infof("Predicate failed on Pod: %v, for reason: %v", format.Pod(admitPod), message) + klog.V(2).InfoS("Predicate failed on Pod", "pod", format.Pod(admitPod), "err", message) case *InsufficientResourceError: reason = fmt.Sprintf("OutOf%s", re.ResourceName) message = re.Error() - klog.V(2).Infof("Predicate failed on Pod: %v, for reason: %v", format.Pod(admitPod), message) + klog.V(2).InfoS("Predicate failed on Pod", "pod", format.Pod(admitPod), "err", message) default: reason = "UnexpectedPredicateFailureType" message = fmt.Sprintf("GeneralPredicates failed due to %v, which is unexpected.", r) - klog.Warningf("Failed to admit pod %v - %s", format.Pod(admitPod), message) + klog.InfoS("Failed to admit pod", "pod", klog.KObj(admitPod), "err", message) } return PodAdmitResult{ Admit: fit, @@ -236,7 +236,9 @@ func GeneralPredicates(pod *v1.Pod, nodeInfo *schedulerframework.NodeInfo) ([]Pr }) } - if !pluginhelper.PodMatchesNodeSelectorAndAffinityTerms(pod, nodeInfo.Node()) { + // Ignore parsing errors for backwards compatibility. + match, _ := v1affinityhelper.GetRequiredNodeAffinity(pod).Match(nodeInfo.Node()) + if !match { reasons = append(reasons, &PredicateFailureError{nodeaffinity.Name, nodeaffinity.ErrReasonPod}) } if !nodename.Fits(pod, nodeInfo) { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/logs/container_log_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/logs/container_log_manager.go index 56e4f31169d8..148922998aa3 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/logs/container_log_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/logs/container_log_manager.go @@ -179,7 +179,7 @@ func (c *containerLogManager) Start() { // Start a goroutine periodically does container log rotation. go wait.Forever(func() { if err := c.rotateLogs(); err != nil { - klog.Errorf("Failed to rotate container logs: %v", err) + klog.ErrorS(err, "Failed to rotate container logs") } }, logMonitorPeriod) } @@ -226,27 +226,27 @@ func (c *containerLogManager) rotateLogs() error { // Note that we should not block log rotate for an error of a single container. status, err := c.runtimeService.ContainerStatus(id) if err != nil { - klog.Errorf("Failed to get container status for %q: %v", id, err) + klog.ErrorS(err, "Failed to get container status", "containerID", id) continue } path := status.GetLogPath() info, err := c.osInterface.Stat(path) if err != nil { if !os.IsNotExist(err) { - klog.Errorf("Failed to stat container log %q: %v", path, err) + klog.ErrorS(err, "Failed to stat container log", "path", path) continue } // In rotateLatestLog, there are several cases that we may // lose original container log after ReopenContainerLog fails. // We try to recover it by reopening container log. if err := c.runtimeService.ReopenContainerLog(id); err != nil { - klog.Errorf("Container %q log %q doesn't exist, reopen container log failed: %v", id, path, err) + klog.ErrorS(err, "Container log doesn't exist, reopen container log failed", "containerID", id, "path", path) continue } // The container log should be recovered. info, err = c.osInterface.Stat(path) if err != nil { - klog.Errorf("Failed to stat container log %q after reopen: %v", path, err) + klog.ErrorS(err, "Failed to stat container log after reopen", "path", path) continue } } @@ -255,7 +255,7 @@ func (c *containerLogManager) rotateLogs() error { } // Perform log rotation. if err := c.rotateLog(id, path); err != nil { - klog.Errorf("Failed to rotate log %q for container %q: %v", path, id, err) + klog.ErrorS(err, "Failed to rotate log for container", "path", path, "containerID", id) continue } } @@ -412,7 +412,7 @@ func (c *containerLogManager) rotateLatestLog(id, log string) error { // This shouldn't happen. // Report an error if this happens, because we will lose original // log. - klog.Errorf("Failed to rename rotated log %q back to %q: %v, reopen container log error: %v", rotated, log, renameErr, err) + klog.ErrorS(renameErr, "Failed to rename rotated log", "rotatedLog", rotated, "newLog", log, "containerID", id) } return fmt.Errorf("failed to reopen container log %q: %v", id, err) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go index 61269fedd400..6fb40e1875ba 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go @@ -63,7 +63,11 @@ const ( DevicePluginRegistrationCountKey = "device_plugin_registration_total" DevicePluginAllocationDurationKey = "device_plugin_alloc_duration_seconds" // Metrics keys of pod resources operations - PodResourcesEndpointRequestsTotalKey = "pod_resources_endpoint_requests_total" + PodResourcesEndpointRequestsTotalKey = "pod_resources_endpoint_requests_total" + PodResourcesEndpointRequestsListKey = "pod_resources_endpoint_requests_list" + PodResourcesEndpointRequestsGetAllocatableKey = "pod_resources_endpoint_requests_get_allocatable" + PodResourcesEndpointErrorsListKey = "pod_resources_endpoint_errors_list" + PodResourcesEndpointErrorsGetAllocatableKey = "pod_resources_endpoint_errors_get_allocatable" // Metric keys for node config AssignedConfigKey = "node_config_assigned" @@ -293,6 +297,54 @@ var ( []string{"server_api_version"}, ) + // PodResourcesEndpointRequestsListCount is a Counter that tracks the number of requests to the PodResource List() endpoint. + // Broken down by server API version. + PodResourcesEndpointRequestsListCount = metrics.NewCounterVec( + &metrics.CounterOpts{ + Subsystem: KubeletSubsystem, + Name: PodResourcesEndpointRequestsListKey, + Help: "Number of requests to the PodResource List endpoint. Broken down by server api version.", + StabilityLevel: metrics.ALPHA, + }, + []string{"server_api_version"}, + ) + + // PodResourcesEndpointRequestsGetAllocatableCount is a Counter that tracks the number of requests to the PodResource GetAllocatableResources() endpoint. + // Broken down by server API version. + PodResourcesEndpointRequestsGetAllocatableCount = metrics.NewCounterVec( + &metrics.CounterOpts{ + Subsystem: KubeletSubsystem, + Name: PodResourcesEndpointRequestsGetAllocatableKey, + Help: "Number of requests to the PodResource GetAllocatableResources endpoint. Broken down by server api version.", + StabilityLevel: metrics.ALPHA, + }, + []string{"server_api_version"}, + ) + + // PodResourcesEndpointErrorsListCount is a Counter that tracks the number of errors returned by he PodResource List() endpoint. + // Broken down by server API version. + PodResourcesEndpointErrorsListCount = metrics.NewCounterVec( + &metrics.CounterOpts{ + Subsystem: KubeletSubsystem, + Name: PodResourcesEndpointErrorsListKey, + Help: "Number of requests to the PodResource List endpoint which returned error. Broken down by server api version.", + StabilityLevel: metrics.ALPHA, + }, + []string{"server_api_version"}, + ) + + // PodResourcesEndpointErrorsGetAllocatableCount is a Counter that tracks the number of errors returned by the PodResource GetAllocatableResources() endpoint. + // Broken down by server API version. + PodResourcesEndpointErrorsGetAllocatableCount = metrics.NewCounterVec( + &metrics.CounterOpts{ + Subsystem: KubeletSubsystem, + Name: PodResourcesEndpointErrorsGetAllocatableKey, + Help: "Number of requests to the PodResource GetAllocatableResources endpoint which returned error. Broken down by server api version.", + StabilityLevel: metrics.ALPHA, + }, + []string{"server_api_version"}, + ) + // Metrics for node config // AssignedConfig is a Gauge that is set 1 if the Kubelet has a NodeConfig assigned. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/network/dns/dns.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/network/dns/dns.go index f2608b45af8d..7d5dec8a7c2c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/network/dns/dns.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/network/dns/dns.go @@ -121,9 +121,9 @@ func (c *Configurer) formDNSSearchFitsLimits(composedSearch []string, pod *v1.Po } if limitsExceeded { - log := fmt.Sprintf("Search Line limits were exceeded, some search paths have been omitted, the applied search line is: %s", strings.Join(composedSearch, " ")) - c.recorder.Event(pod, v1.EventTypeWarning, "DNSConfigForming", log) - klog.ErrorS(nil, "eventlog", log) + err := fmt.Errorf("Search Line limits were exceeded, some search paths have been omitted, the applied search line is: %s", strings.Join(composedSearch, " ")) + c.recorder.Event(pod, v1.EventTypeWarning, "DNSConfigForming", err.Error()) + klog.ErrorS(err, "Search Line limits exceeded") } return composedSearch } @@ -131,9 +131,9 @@ func (c *Configurer) formDNSSearchFitsLimits(composedSearch []string, pod *v1.Po func (c *Configurer) formDNSNameserversFitsLimits(nameservers []string, pod *v1.Pod) []string { if len(nameservers) > validation.MaxDNSNameservers { nameservers = nameservers[0:validation.MaxDNSNameservers] - log := fmt.Sprintf("Nameserver limits were exceeded, some nameservers have been omitted, the applied nameserver line is: %s", strings.Join(nameservers, " ")) - c.recorder.Event(pod, v1.EventTypeWarning, "DNSConfigForming", log) - klog.ErrorS(nil, "eventlog", log) + err := fmt.Errorf("Nameserver limits were exceeded, some nameservers have been omitted, the applied nameserver line is: %s", strings.Join(nameservers, " ")) + c.recorder.Event(pod, v1.EventTypeWarning, "DNSConfigForming", err.Error()) + klog.ErrorS(err, "Nameserver limits exceeded") } return nameservers } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/nodeshutdown_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/nodeshutdown_manager_linux.go index e694db19ac0b..bbd869b7281e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/nodeshutdown_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/nodeshutdown_manager_linux.go @@ -34,7 +34,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd" kubelettypes "k8s.io/kubernetes/pkg/kubelet/types" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) const ( @@ -126,7 +125,7 @@ func (m *Manager) Start() error { if m.shutdownGracePeriodRequested > currentInhibitDelay { err := m.dbusCon.OverrideInhibitDelay(m.shutdownGracePeriodRequested) if err != nil { - return fmt.Errorf("unable to override inhibit delay by shutdown manager: %v", err) + return fmt.Errorf("unable to override inhibit delay by shutdown manager: %w", err) } err = m.dbusCon.ReloadLogindConf() @@ -154,9 +153,9 @@ func (m *Manager) Start() error { if err != nil { releaseErr := m.dbusCon.ReleaseInhibitLock(m.inhibitLock) if releaseErr != nil { - return fmt.Errorf("failed releasing inhibitLock: %v and failed monitoring shutdown: %v", releaseErr, err) + return fmt.Errorf("failed releasing inhibitLock: %v and failed monitoring shutdown: %w", releaseErr, err) } - return fmt.Errorf("failed to monitor shutdown: %v", err) + return fmt.Errorf("failed to monitor shutdown: %w", err) } go func() { @@ -167,7 +166,7 @@ func (m *Manager) Start() error { for { select { case isShuttingDown := <-events: - klog.V(1).Infof("Shutdown manager detected new shutdown event, isNodeShuttingDownNow: %t", isShuttingDown) + klog.V(1).InfoS("Shutdown manager detected new shutdown event, isNodeShuttingDownNow", "event", isShuttingDown) m.nodeShuttingDownMutex.Lock() m.nodeShuttingDownNow = isShuttingDown @@ -220,7 +219,7 @@ func (m *Manager) ShutdownStatus() error { } func (m *Manager) processShutdownEvent() error { - klog.V(1).Infof("Shutdown manager processing shutdown event") + klog.V(1).InfoS("Shutdown manager processing shutdown event") activePods := m.getPods() nonCriticalPodGracePeriod := m.shutdownGracePeriodRequested - m.shutdownGracePeriodCriticalPods @@ -244,7 +243,7 @@ func (m *Manager) processShutdownEvent() error { gracePeriodOverride = *pod.Spec.TerminationGracePeriodSeconds } - klog.V(1).Infof("Shutdown manager killing pod %q with gracePeriod: %v seconds", format.Pod(pod), gracePeriodOverride) + klog.V(1).InfoS("Shutdown manager killing pod with gracePeriod", "pod", klog.KObj(pod), "gracePeriod", gracePeriodOverride) status := v1.PodStatus{ Phase: v1.PodFailed, @@ -254,9 +253,9 @@ func (m *Manager) processShutdownEvent() error { err := m.killPod(pod, status, &gracePeriodOverride) if err != nil { - klog.V(1).Infof("Shutdown manager failed killing pod %q: %v", format.Pod(pod), err) + klog.V(1).InfoS("Shutdown manager failed killing pod", "pod", klog.KObj(pod), "err", err) } else { - klog.V(1).Infof("Shutdown manager finished killing pod %q", format.Pod(pod)) + klog.V(1).InfoS("Shutdown manager finished killing pod", "pod", klog.KObj(pod)) } }(pod) } @@ -272,11 +271,11 @@ func (m *Manager) processShutdownEvent() error { case <-c: break case <-time.After(m.shutdownGracePeriodRequested): - klog.V(1).Infof("Shutdown manager pod killing did not complete in %v", m.shutdownGracePeriodRequested) + klog.V(1).InfoS("Shutdown manager pod killing time out", "gracePeriod", m.shutdownGracePeriodRequested) } m.dbusCon.ReleaseInhibitLock(m.inhibitLock) - klog.V(1).Infof("Shutdown manager completed processing shutdown event, node will shutdown shortly") + klog.V(1).InfoS("Shutdown manager completed processing shutdown event, node will shutdown shortly") return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go index 8069691d048b..432e07de558d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go @@ -56,7 +56,7 @@ func (bus *DBusCon) CurrentInhibitDelay() (time.Duration, error) { obj := bus.SystemBus.Object(logindService, logindObject) res, err := obj.GetProperty(logindInterface + ".InhibitDelayMaxUSec") if err != nil { - return 0, fmt.Errorf("failed reading InhibitDelayMaxUSec property from logind: %v", err) + return 0, fmt.Errorf("failed reading InhibitDelayMaxUSec property from logind: %w", err) } delay, ok := res.Value().(uint64) @@ -80,13 +80,13 @@ func (bus *DBusCon) InhibitShutdown() (InhibitLock, error) { call := obj.Call("org.freedesktop.login1.Manager.Inhibit", 0, what, who, why, mode) if call.Err != nil { - return InhibitLock(0), fmt.Errorf("failed creating systemd inhibitor: %v", call.Err) + return InhibitLock(0), fmt.Errorf("failed creating systemd inhibitor: %w", call.Err) } var fd uint32 err := call.Store(&fd) if err != nil { - return InhibitLock(0), fmt.Errorf("failed storing inhibit lock file descriptor: %v", err) + return InhibitLock(0), fmt.Errorf("failed storing inhibit lock file descriptor: %w", err) } return InhibitLock(fd), nil @@ -97,7 +97,7 @@ func (bus *DBusCon) ReleaseInhibitLock(lock InhibitLock) error { err := syscall.Close(int(lock)) if err != nil { - return fmt.Errorf("unable to close systemd inhibitor lock: %v", err) + return fmt.Errorf("unable to close systemd inhibitor lock: %w", err) } return nil @@ -116,7 +116,7 @@ func (bus *DBusCon) ReloadLogindConf() error { call := obj.Call(systemdInterface+".KillUnit", 0, unit, who, signal) if call.Err != nil { - return fmt.Errorf("unable to reload logind conf: %v", call.Err) + return fmt.Errorf("unable to reload logind conf: %w", call.Err) } return nil @@ -141,12 +141,12 @@ func (bus *DBusCon) MonitorShutdown() (<-chan bool, error) { select { case event := <-busChan: if event == nil || len(event.Body) == 0 { - klog.Errorf("Failed obtaining shutdown event, PrepareForShutdown event was empty") + klog.ErrorS(nil, "Failed obtaining shutdown event, PrepareForShutdown event was empty") continue } shutdownActive, ok := event.Body[0].(bool) if !ok { - klog.Errorf("Failed obtaining shutdown event, PrepareForShutdown event was not bool type as expected") + klog.ErrorS(nil, "Failed obtaining shutdown event, PrepareForShutdown event was not bool type as expected") continue } shutdownChan <- shutdownActive @@ -166,7 +166,7 @@ const ( func (bus *DBusCon) OverrideInhibitDelay(inhibitDelayMax time.Duration) error { err := os.MkdirAll(logindConfigDirectory, 0755) if err != nil { - return fmt.Errorf("failed creating %v directory: %v", logindConfigDirectory, err) + return fmt.Errorf("failed creating %v directory: %w", logindConfigDirectory, err) } // This attempts to set the `InhibitDelayMaxUSec` dbus property of logind which is MaxInhibitDelay measured in microseconds. @@ -180,7 +180,7 @@ InhibitDelayMaxSec=%.0f logindOverridePath := filepath.Join(logindConfigDirectory, kubeletLogindConf) if err := ioutil.WriteFile(logindOverridePath, []byte(inhibitOverride), 0644); err != nil { - return fmt.Errorf("failed writing logind shutdown inhibit override file %v: %v", logindOverridePath, err) + return fmt.Errorf("failed writing logind shutdown inhibit override file %v: %w", logindOverridePath, err) } return nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodestatus/setters.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodestatus/setters.go index 7ad0a65a9ac9..0ff7f6fced94 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodestatus/setters.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodestatus/setters.go @@ -191,11 +191,11 @@ func NodeAddress(nodeIPs []net.IP, // typically Kubelet.nodeIPs if existingHostnameAddress == nil { // no existing Hostname address found, add it - klog.InfoS("adding overridden hostname to cloudprovider-reported addresses", "hostname", hostname) + klog.InfoS("Adding overridden hostname to cloudprovider-reported addresses", "hostname", hostname) nodeAddresses = append(nodeAddresses, v1.NodeAddress{Type: v1.NodeHostName, Address: hostname}) } else if existingHostnameAddress.Address != hostname { // override the Hostname address reported by the cloud provider - klog.InfoS("replacing cloudprovider-reported hostname with overridden hostname", "cloudproviderHostname", existingHostnameAddress.Address, "overrideHostname", hostname) + klog.InfoS("Replacing cloudprovider-reported hostname with overridden hostname", "cloudProviderHostname", existingHostnameAddress.Address, "overriddenHostname", hostname) existingHostnameAddress.Address = hostname } } @@ -792,7 +792,7 @@ func VolumeLimits(volumePluginListFunc func() []volume.VolumePluginWithAttachLim for _, volumePlugin := range pluginWithLimits { attachLimits, err := volumePlugin.GetVolumeLimits() if err != nil { - klog.V(4).InfoS("Error getting volume limit for plugin", "plugin", volumePlugin.GetPluginName()) + klog.V(4).InfoS("Skipping volume limits for volume plugin", "plugin", volumePlugin.GetPluginName()) continue } for limitKey, value := range attachLimits { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/oom/oom_watcher_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/oom/oom_watcher_linux.go index 21dc72315599..e5c7ab47a225 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/oom/oom_watcher_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/oom/oom_watcher_linux.go @@ -73,7 +73,7 @@ func (ow *realWatcher) Start(ref *v1.ObjectReference) error { for event := range outStream { if event.VictimContainerName == recordEventContainerName { - klog.V(1).Infof("Got sys oom event: %v", event) + klog.V(1).InfoS("Got sys oom event", "event", event) eventMsg := "System OOM encountered" if event.ProcessName != "" && event.Pid != 0 { eventMsg = fmt.Sprintf("%s, victim process: %s, pid: %d", eventMsg, event.ProcessName, event.Pid) @@ -81,7 +81,7 @@ func (ow *realWatcher) Start(ref *v1.ObjectReference) error { ow.recorder.Eventf(ref, v1.EventTypeWarning, systemOOMEvent, eventMsg) } } - klog.Errorf("Unexpectedly stopped receiving OOM notifications") + klog.ErrorS(nil, "Unexpectedly stopped receiving OOM notifications") }() return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pleg/generic.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pleg/generic.go index 137569633a65..1bc06466d45f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pleg/generic.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pleg/generic.go @@ -264,6 +264,10 @@ func (g *GenericPLEG) relist() { } // Update the internal storage and send out the events. g.podRecords.update(pid) + + // Map from containerId to exit code; used as a temporary cache for lookup + containerExitCode := make(map[string]int) + for i := range events { // Filter out events that are not reliable and no other components use yet. if events[i].Type == ContainerChanged { @@ -275,6 +279,24 @@ func (g *GenericPLEG) relist() { metrics.PLEGDiscardEvents.Inc() klog.ErrorS(nil, "Event channel is full, discard this relist() cycle event") } + // Log exit code of containers when they finished in a particular event + if events[i].Type == ContainerDied { + // Fill up containerExitCode map for ContainerDied event when first time appeared + if len(containerExitCode) == 0 && pod != nil && g.cache != nil { + // Get updated podStatus + status, err := g.cache.Get(pod.ID) + if err == nil { + for _, containerStatus := range status.ContainerStatuses { + containerExitCode[containerStatus.ID.ID] = containerStatus.ExitCode + } + } + } + if containerID, ok := events[i].Data.(string); ok { + if exitCode, ok := containerExitCode[containerID]; ok { + klog.V(2).InfoS("Generic (PLEG): container finished", "podID", pod.ID, "containerID", containerID, "exitCode", exitCode) + } + } + } } } @@ -383,7 +405,11 @@ func (g *GenericPLEG) updateCache(pod *kubecontainer.Pod, pid types.UID) error { // GetPodStatus(pod *kubecontainer.Pod) so that Docker can avoid listing // all containers again. status, err := g.runtime.GetPodStatus(pod.ID, pod.Name, pod.Namespace) - klog.V(4).ErrorS(err, "PLEG: Write status", "pod", klog.KRef(pod.Namespace, pod.Name), "podStatus", status) + if klog.V(6).Enabled() { + klog.V(6).ErrorS(err, "PLEG: Write status", "pod", klog.KRef(pod.Namespace, pod.Name), "podStatus", status) + } else { + klog.V(4).ErrorS(err, "PLEG: Write status", "pod", klog.KRef(pod.Namespace, pod.Name)) + } if err == nil { // Preserve the pod IP across cache updates if the new IP is empty. // When a pod is torn down, kubelet may race with PLEG and retrieve diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/actual_state_of_world.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/actual_state_of_world.go index 1fac9d9465a6..cdf6a0c50a9b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/actual_state_of_world.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/actual_state_of_world.go @@ -91,7 +91,7 @@ func (asw *actualStateOfWorld) AddPlugin(pluginInfo PluginInfo) error { return fmt.Errorf("socket path is empty") } if _, ok := asw.socketFileToInfo[pluginInfo.SocketPath]; ok { - klog.V(2).Infof("Plugin (Path %s) exists in actual state cache", pluginInfo.SocketPath) + klog.V(2).InfoS("Plugin exists in actual state cache", "path", pluginInfo.SocketPath) } asw.socketFileToInfo[pluginInfo.SocketPath] = pluginInfo return nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/desired_state_of_world.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/desired_state_of_world.go index d8f504d0b62a..a190e7707a01 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/desired_state_of_world.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/desired_state_of_world.go @@ -128,7 +128,7 @@ func (dsw *desiredStateOfWorld) AddOrUpdatePlugin(socketPath string) error { return fmt.Errorf("socket path is empty") } if _, ok := dsw.socketFileToInfo[socketPath]; ok { - klog.V(2).Infof("Plugin (Path %s) exists in actual state cache, timestamp will be updated", socketPath) + klog.V(2).InfoS("Plugin exists in actual state cache, timestamp will be updated", "path", socketPath) } // Update the PluginInfo object. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/operationexecutor/operation_generator.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/operationexecutor/operation_generator.go index bc643e458f2e..db6e8d41acbe 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/operationexecutor/operation_generator.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/operationexecutor/operation_generator.go @@ -118,7 +118,7 @@ func (og *operationGenerator) GenerateRegisterPluginFunc( Name: infoResp.Name, }) if err != nil { - klog.Errorf("RegisterPlugin error -- failed to add plugin at socket %s, err: %v", socketPath, err) + klog.ErrorS(err, "RegisterPlugin error -- failed to add plugin", "path", socketPath) } if err := handler.RegisterPlugin(infoResp.Name, infoResp.Endpoint, infoResp.SupportedVersions); err != nil { return og.notifyPlugin(client, false, fmt.Sprintf("RegisterPlugin error -- plugin registration failed with err: %v", err)) @@ -147,7 +147,7 @@ func (og *operationGenerator) GenerateUnregisterPluginFunc( pluginInfo.Handler.DeRegisterPlugin(pluginInfo.Name) - klog.V(4).Infof("DeRegisterPlugin called for %s on %v", pluginInfo.Name, pluginInfo.Handler) + klog.V(4).InfoS("DeRegisterPlugin called", "pluginName", pluginInfo.Name, "pluginHandler", pluginInfo.Handler) return nil } return unregisterPluginFunc diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/plugin_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/plugin_manager.go index 2697fda873f7..79e0c8c46b7d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/plugin_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/plugin_manager.go @@ -109,14 +109,14 @@ func (pm *pluginManager) Run(sourcesReady config.SourcesReady, stopCh <-chan str defer runtime.HandleCrash() pm.desiredStateOfWorldPopulator.Start(stopCh) - klog.V(2).Infof("The desired_state_of_world populator (plugin watcher) starts") + klog.V(2).InfoS("The desired_state_of_world populator (plugin watcher) starts") - klog.Infof("Starting Kubelet Plugin Manager") + klog.InfoS("Starting Kubelet Plugin Manager") go pm.reconciler.Run(stopCh) metrics.Register(pm.actualStateOfWorld, pm.desiredStateOfWorld) <-stopCh - klog.Infof("Shutting down Kubelet Plugin Manager") + klog.InfoS("Shutting down Kubelet Plugin Manager") } func (pm *pluginManager) AddHandler(pluginType string, handler cache.PluginHandler) { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/example_handler.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/example_handler.go index 8b8228af8674..6978826c9ced 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/example_handler.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/example_handler.go @@ -121,7 +121,7 @@ func (p *exampleHandler) EventChan(pluginName string) chan examplePluginEvent { } func (p *exampleHandler) SendEvent(pluginName string, event examplePluginEvent) { - klog.V(2).Infof("Sending %v for plugin %s over chan %v", event, pluginName, p.eventChans[pluginName]) + klog.V(2).InfoS("Sending event for plugin", "pluginName", pluginName, "event", event, "channel", p.eventChans[pluginName]) p.eventChans[pluginName] <- event } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/example_plugin.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/example_plugin.go index d0859cc89672..c6be96c9ce48 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/example_plugin.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/example_plugin.go @@ -50,7 +50,7 @@ type pluginServiceV1Beta1 struct { } func (s *pluginServiceV1Beta1) GetExampleInfo(ctx context.Context, rqt *v1beta1.ExampleRequest) (*v1beta1.ExampleResponse, error) { - klog.Infof("GetExampleInfo v1beta1field: %s", rqt.V1Beta1Field) + klog.InfoS("GetExampleInfo v1beta1field", "field", rqt.V1Beta1Field) return &v1beta1.ExampleResponse{}, nil } @@ -63,7 +63,7 @@ type pluginServiceV1Beta2 struct { } func (s *pluginServiceV1Beta2) GetExampleInfo(ctx context.Context, rqt *v1beta2.ExampleRequest) (*v1beta2.ExampleResponse, error) { - klog.Infof("GetExampleInfo v1beta2_field: %s", rqt.V1Beta2Field) + klog.InfoS("GetExampleInfo v1beta2_field", "field", rqt.V1Beta2Field) return &v1beta2.ExampleResponse{}, nil } @@ -105,7 +105,7 @@ func (e *examplePlugin) GetInfo(ctx context.Context, req *registerapi.InfoReques } func (e *examplePlugin) NotifyRegistrationStatus(ctx context.Context, status *registerapi.RegistrationStatus) (*registerapi.RegistrationStatusResponse, error) { - klog.Errorf("Registration is: %v\n", status) + klog.InfoS("Notify registration status", "status", status) if e.registrationStatus != nil { e.registrationStatus <- *status @@ -116,13 +116,13 @@ func (e *examplePlugin) NotifyRegistrationStatus(ctx context.Context, status *re // Serve starts a pluginwatcher server and one or more of the plugin services func (e *examplePlugin) Serve(services ...string) error { - klog.Infof("starting example server at: %s\n", e.endpoint) + klog.InfoS("Starting example server", "endpoint", e.endpoint) lis, err := net.Listen("unix", e.endpoint) if err != nil { return err } - klog.Infof("example server started at: %s\n", e.endpoint) + klog.InfoS("Example server started", "endpoint", e.endpoint) e.grpcServer = grpc.NewServer() // Registers kubelet plugin watcher api. @@ -147,7 +147,7 @@ func (e *examplePlugin) Serve(services ...string) error { defer e.wg.Done() // Blocking call to accept incoming connections. if err := e.grpcServer.Serve(lis); err != nil { - klog.Errorf("example server stopped serving: %v", err) + klog.ErrorS(err, "Example server stopped serving") } }() @@ -155,7 +155,7 @@ func (e *examplePlugin) Serve(services ...string) error { } func (e *examplePlugin) Stop() error { - klog.Infof("Stopping example server at: %s\n", e.endpoint) + klog.InfoS("Stopping example server", "endpoint", e.endpoint) e.grpcServer.Stop() c := make(chan struct{}) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/plugin_watcher.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/plugin_watcher.go index 2a869c186a14..b3a1a8b67e40 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/plugin_watcher.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher/plugin_watcher.go @@ -49,7 +49,7 @@ func NewWatcher(sockDir string, desiredStateOfWorld cache.DesiredStateOfWorld) * // Start watches for the creation and deletion of plugin sockets at the path func (w *Watcher) Start(stopCh <-chan struct{}) error { - klog.V(2).Infof("Plugin Watcher Start at %s", w.path) + klog.V(2).InfoS("Plugin Watcher Start", "path", w.path) // Creating the directory to be watched if it doesn't exist yet, // and walks through the directory to discover the existing plugins. @@ -65,7 +65,7 @@ func (w *Watcher) Start(stopCh <-chan struct{}) error { // Traverse plugin dir and add filesystem watchers before starting the plugin processing goroutine. if err := w.traversePluginDir(w.path); err != nil { - klog.Errorf("failed to traverse plugin socket path %q, err: %v", w.path, err) + klog.ErrorS(err, "Failed to traverse plugin socket path", "path", w.path) } go func(fsWatcher *fsnotify.Watcher) { @@ -76,7 +76,7 @@ func (w *Watcher) Start(stopCh <-chan struct{}) error { if event.Op&fsnotify.Create == fsnotify.Create { err := w.handleCreateEvent(event) if err != nil { - klog.Errorf("error %v when handling create event: %s", err, event) + klog.ErrorS(err, "Error when handling create event", "event", event) } } else if event.Op&fsnotify.Remove == fsnotify.Remove { w.handleDeleteEvent(event) @@ -84,7 +84,7 @@ func (w *Watcher) Start(stopCh <-chan struct{}) error { continue case err := <-fsWatcher.Errors: if err != nil { - klog.Errorf("fsWatcher received error: %v", err) + klog.ErrorS(err, "FsWatcher received error") } continue case <-stopCh: @@ -98,7 +98,7 @@ func (w *Watcher) Start(stopCh <-chan struct{}) error { } func (w *Watcher) init() error { - klog.V(4).Infof("Ensuring Plugin directory at %s ", w.path) + klog.V(4).InfoS("Ensuring Plugin directory", "path", w.path) if err := w.fs.MkdirAll(w.path, 0755); err != nil { return fmt.Errorf("error (re-)creating root %s: %v", w.path, err) @@ -122,7 +122,7 @@ func (w *Watcher) traversePluginDir(dir string) error { return fmt.Errorf("error accessing path: %s error: %v", path, err) } - klog.Errorf("error accessing path: %s error: %v", path, err) + klog.ErrorS(err, "Error accessing path", "path", path) return nil } @@ -143,10 +143,10 @@ func (w *Watcher) traversePluginDir(dir string) error { } //TODO: Handle errors by taking corrective measures if err := w.handleCreateEvent(event); err != nil { - klog.Errorf("error %v when handling create event: %s", err, event) + klog.ErrorS(err, "Error when handling create", "event", event) } default: - klog.V(5).Infof("Ignoring file %s with mode %v", path, mode) + klog.V(5).InfoS("Ignoring file", "path", path, "mode", mode) } return nil @@ -157,7 +157,7 @@ func (w *Watcher) traversePluginDir(dir string) error { // Files names: // - MUST NOT start with a '.' func (w *Watcher) handleCreateEvent(event fsnotify.Event) error { - klog.V(6).Infof("Handling create event: %v", event) + klog.V(6).InfoS("Handling create event", "event", event) fi, err := os.Stat(event.Name) // TODO: This is a workaround for Windows 20H2 issue for os.Stat(). Please see @@ -171,7 +171,7 @@ func (w *Watcher) handleCreateEvent(event fsnotify.Event) error { } if strings.HasPrefix(fi.Name(), ".") { - klog.V(5).Infof("Ignoring file (starts with '.'): %s", fi.Name()) + klog.V(5).InfoS("Ignoring file (starts with '.')", "path", fi.Name()) return nil } @@ -181,7 +181,7 @@ func (w *Watcher) handleCreateEvent(event fsnotify.Event) error { return fmt.Errorf("failed to determine if file: %s is a unix domain socket: %v", event.Name, err) } if !isSocket { - klog.V(5).Infof("Ignoring non socket file %s", fi.Name()) + klog.V(5).InfoS("Ignoring non socket file", "path", fi.Name()) return nil } @@ -200,7 +200,7 @@ func (w *Watcher) handlePluginRegistration(socketPath string) error { // a possibility that it has been deleted and recreated again before it is // removed from the desired world cache, so we still need to call AddOrUpdatePlugin // in this case to update the timestamp - klog.V(2).Infof("Adding socket path or updating timestamp %s to desired state cache", socketPath) + klog.V(2).InfoS("Adding socket path or updating timestamp to desired state cache", "path", socketPath) err := w.desiredStateOfWorld.AddOrUpdatePlugin(socketPath) if err != nil { return fmt.Errorf("error adding socket path %s or updating timestamp to desired state cache: %v", socketPath, err) @@ -209,9 +209,9 @@ func (w *Watcher) handlePluginRegistration(socketPath string) error { } func (w *Watcher) handleDeleteEvent(event fsnotify.Event) { - klog.V(6).Infof("Handling delete event: %v", event) + klog.V(6).InfoS("Handling delete event", "event", event) socketPath := event.Name - klog.V(2).Infof("Removing socket path %s from desired state cache", socketPath) + klog.V(2).InfoS("Removing socket path from desired state cache", "path", socketPath) w.desiredStateOfWorld.RemovePlugin(socketPath) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/reconciler/reconciler.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/reconciler/reconciler.go index 6cba00454692..d8f104eb8092 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/reconciler/reconciler.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/reconciler/reconciler.go @@ -122,7 +122,7 @@ func (rc *reconciler) reconcile() { // with the same socket path but different timestamp. for _, dswPlugin := range rc.desiredStateOfWorld.GetPluginsToRegister() { if dswPlugin.SocketPath == registeredPlugin.SocketPath && dswPlugin.Timestamp != registeredPlugin.Timestamp { - klog.V(5).Infof(registeredPlugin.GenerateMsgDetailed("An updated version of plugin has been found, unregistering the plugin first before reregistering", "")) + klog.V(5).InfoS("An updated version of plugin has been found, unregistering the plugin first before reregistering", "plugin", registeredPlugin) unregisterPlugin = true break } @@ -130,17 +130,17 @@ func (rc *reconciler) reconcile() { } if unregisterPlugin { - klog.V(5).Infof(registeredPlugin.GenerateMsgDetailed("Starting operationExecutor.UnregisterPlugin", "")) + klog.V(5).InfoS("Starting operationExecutor.UnregisterPlugin", "plugin", registeredPlugin) err := rc.operationExecutor.UnregisterPlugin(registeredPlugin, rc.actualStateOfWorld) if err != nil && !goroutinemap.IsAlreadyExists(err) && !exponentialbackoff.IsExponentialBackoff(err) { // Ignore goroutinemap.IsAlreadyExists and exponentialbackoff.IsExponentialBackoff errors, they are expected. // Log all other errors. - klog.Errorf(registeredPlugin.GenerateErrorDetailed("operationExecutor.UnregisterPlugin failed", err).Error()) + klog.ErrorS(err, "OperationExecutor.UnregisterPlugin failed", "plugin", registeredPlugin) } if err == nil { - klog.V(1).Infof(registeredPlugin.GenerateMsgDetailed("operationExecutor.UnregisterPlugin started", "")) + klog.V(1).InfoS("OperationExecutor.UnregisterPlugin started", "plugin", registeredPlugin) } } } @@ -148,16 +148,16 @@ func (rc *reconciler) reconcile() { // Ensure plugins that should be registered are registered for _, pluginToRegister := range rc.desiredStateOfWorld.GetPluginsToRegister() { if !rc.actualStateOfWorld.PluginExistsWithCorrectTimestamp(pluginToRegister) { - klog.V(5).Infof(pluginToRegister.GenerateMsgDetailed("Starting operationExecutor.RegisterPlugin", "")) + klog.V(5).InfoS("Starting operationExecutor.RegisterPlugin", "plugin", pluginToRegister) err := rc.operationExecutor.RegisterPlugin(pluginToRegister.SocketPath, pluginToRegister.Timestamp, rc.getHandlers(), rc.actualStateOfWorld) if err != nil && !goroutinemap.IsAlreadyExists(err) && !exponentialbackoff.IsExponentialBackoff(err) { // Ignore goroutinemap.IsAlreadyExists and exponentialbackoff.IsExponentialBackoff errors, they are expected. - klog.Errorf(pluginToRegister.GenerateErrorDetailed("operationExecutor.RegisterPlugin failed", err).Error()) + klog.ErrorS(err, "OperationExecutor.RegisterPlugin failed", "plugin", pluginToRegister) } if err == nil { - klog.V(1).Infof(pluginToRegister.GenerateMsgDetailed("operationExecutor.RegisterPlugin started", "")) + klog.V(1).InfoS("OperationExecutor.RegisterPlugin started", "plugin", pluginToRegister) } } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go index e349a22bbfeb..89f4c18f997a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go @@ -82,7 +82,7 @@ func (mc *basicMirrorClient) CreateMirrorPod(pod *v1.Pod) error { // With the MirrorPodNodeRestriction feature, mirror pods are required to have an owner reference // to the owning node. - // See http://git.k8s.io/enhancements/keps/sig-auth/20190916-noderestriction-pods.md + // See https://git.k8s.io/enhancements/keps/sig-auth/1314-node-restriction-pods/README.md nodeUID, err := mc.getNodeUID() if err != nil { return fmt.Errorf("failed to get node UID: %v", err) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_container_deletor.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_container_deletor.go index 4000cfb9c181..975148ce4e50 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_container_deletor.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_container_deletor.go @@ -49,7 +49,7 @@ func newPodContainerDeletor(runtime kubecontainer.Runtime, containersToKeep int) for { id := <-buffer if err := runtime.DeleteContainer(id); err != nil { - klog.Warningf("[pod_container_deletor] DeleteContainer returned error for (id=%v): %v", id, err) + klog.InfoS("DeleteContainer returned error", "containerID", id, "err", err) } } }, 0, wait.NeverStop) @@ -76,7 +76,7 @@ func getContainersToDeleteInPod(filterContainerID string, podStatus *kubecontain }(filterContainerID, podStatus) if filterContainerID != "" && matchedContainer == nil { - klog.Warningf("Container %q not found in pod's containers", filterContainerID) + klog.InfoS("Container not found in pod's containers", "containerID", filterContainerID) return containerStatusbyCreatedList{} } @@ -110,7 +110,7 @@ func (p *podContainerDeletor) deleteContainersInPod(filterContainerID string, po select { case p.worker <- candidate.ID: default: - klog.Warningf("Failed to issue the request to remove container %v", candidate.ID) + klog.InfoS("Failed to issue the request to remove container", "containerID", candidate.ID) } } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go index 2fecf534b719..fcf059f56e33 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go @@ -33,7 +33,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/events" "k8s.io/kubernetes/pkg/kubelet/eviction" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" - "k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/kubelet/util/queue" ) @@ -188,7 +187,7 @@ func (p *podWorkers) managePodLoop(podUpdates <-chan UpdatePodOptions) { } if err != nil { // IMPORTANT: we do not log errors here, the syncPodFn is responsible for logging errors - klog.Errorf("Error syncing pod %s (%q), skipping: %v", update.Pod.UID, format.Pod(update.Pod), err) + klog.ErrorS(err, "Error syncing pod, skipping", "pod", klog.KObj(update.Pod), "podUID", update.Pod.UID) } p.wrapUp(update.Pod.UID, err) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/preemption/preemption.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/preemption/preemption.go index 04db4ae0dc18..89ee669dcc04 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/preemption/preemption.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/preemption/preemption.go @@ -30,7 +30,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/lifecycle" "k8s.io/kubernetes/pkg/kubelet/metrics" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) const message = "Preempted in order to admit critical pod" @@ -95,7 +94,8 @@ func (c *CriticalPodAdmissionHandler) evictPodsToFreeRequests(admitPod *v1.Pod, if err != nil { return fmt.Errorf("preemption: error finding a set of pods to preempt: %v", err) } - klog.Infof("preemption: attempting to evict pods %v, in order to free up resources: %s", podsToPreempt, insufficientResources.toString()) + klog.InfoS("Attempting to evict pods in order to free up resources", "pods", podsToPreempt, + "insufficientResources", insufficientResources.toString()) for _, pod := range podsToPreempt { status := v1.PodStatus{ Phase: v1.PodFailed, @@ -107,7 +107,7 @@ func (c *CriticalPodAdmissionHandler) evictPodsToFreeRequests(admitPod *v1.Pod, // this is a blocking call and should only return when the pod and its containers are killed. err := c.killPodFunc(pod, status, nil) if err != nil { - klog.Warningf("preemption: pod %s failed to evict %v", format.Pod(pod), err) + klog.ErrorS(err, "Failed to evict pod", "pod", klog.KObj(pod)) // In future syncPod loops, the kubelet will retry the pod deletion steps that it was stuck on. continue } @@ -116,7 +116,7 @@ func (c *CriticalPodAdmissionHandler) evictPodsToFreeRequests(admitPod *v1.Pod, } else { metrics.Preemptions.WithLabelValues("").Inc() } - klog.Infof("preemption: pod %s evicted successfully", format.Pod(pod)) + klog.InfoS("Pod evicted successfully", "pod", klog.KObj(pod)) } return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober.go index 713adf3cd0e2..f766c132d286 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober.go @@ -81,7 +81,7 @@ func newProber( func (pb *prober) recordContainerEvent(pod *v1.Pod, container *v1.Container, eventType, reason, message string, args ...interface{}) { ref, err := kubecontainer.GenerateContainerRef(pod, container) if err != nil { - klog.Errorf("Can't make a ref to pod %q, container %v: %v", format.Pod(pod), container.Name, err) + klog.ErrorS(err, "Can't make a ref to pod and container", "pod", klog.KObj(pod), "containerName", container.Name) return } pb.recorder.Eventf(ref, eventType, reason, message, args...) @@ -101,9 +101,8 @@ func (pb *prober) probe(probeType probeType, pod *v1.Pod, status v1.PodStatus, c return results.Failure, fmt.Errorf("unknown probe type: %q", probeType) } - ctrName := fmt.Sprintf("%s:%s", format.Pod(pod), container.Name) if probeSpec == nil { - klog.Warningf("%s probe for %s is nil", probeType, ctrName) + klog.InfoS("Probe is nil", "probeType", probeType, "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", container.Name) return results.Success, nil } @@ -111,19 +110,19 @@ func (pb *prober) probe(probeType probeType, pod *v1.Pod, status v1.PodStatus, c if err != nil || (result != probe.Success && result != probe.Warning) { // Probe failed in one way or another. if err != nil { - klog.V(1).Infof("%s probe for %q errored: %v", probeType, ctrName, err) + klog.V(1).ErrorS(err, "Probe errored", "probeType", probeType, "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", container.Name) pb.recordContainerEvent(pod, &container, v1.EventTypeWarning, events.ContainerUnhealthy, "%s probe errored: %v", probeType, err) } else { // result != probe.Success - klog.V(1).Infof("%s probe for %q failed (%v): %s", probeType, ctrName, result, output) + klog.V(1).InfoS("Probe failed", "probeType", probeType, "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", container.Name, "probeResult", result, "output", output) pb.recordContainerEvent(pod, &container, v1.EventTypeWarning, events.ContainerUnhealthy, "%s probe failed: %s", probeType, output) } return results.Failure, err } if result == probe.Warning { pb.recordContainerEvent(pod, &container, v1.EventTypeWarning, events.ContainerProbeWarning, "%s probe warning: %s", probeType, output) - klog.V(3).Infof("%s probe for %q succeeded with a warning: %s", probeType, ctrName, output) + klog.V(3).InfoS("Probe succeeded with a warning", "probeType", probeType, "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", container.Name, "output", output) } else { - klog.V(3).Infof("%s probe for %q succeeded", probeType, ctrName) + klog.V(3).InfoS("Probe succeeded", "probeType", probeType, "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", container.Name) } return results.Success, nil } @@ -156,7 +155,7 @@ func buildHeader(headerList []v1.HTTPHeader) http.Header { func (pb *prober) runProbe(probeType probeType, p *v1.Probe, pod *v1.Pod, status v1.PodStatus, container v1.Container, containerID kubecontainer.ContainerID) (probe.Result, string, error) { timeout := time.Duration(p.TimeoutSeconds) * time.Second if p.Exec != nil { - klog.V(4).Infof("Exec-Probe Pod: %v, Container: %v, Command: %v", pod.Name, container.Name, p.Exec.Command) + klog.V(4).InfoS("Exec-Probe runProbe", "pod", klog.KObj(pod), "containerName", container.Name, "execCommand", p.Exec.Command) command := kubecontainer.ExpandContainerCommandOnlyStatic(p.Exec.Command, container.Env) return pb.exec.Probe(pb.newExecInContainer(container, containerID, command, timeout)) } @@ -171,10 +170,10 @@ func (pb *prober) runProbe(probeType probeType, p *v1.Probe, pod *v1.Pod, status return probe.Unknown, "", err } path := p.HTTPGet.Path - klog.V(4).Infof("HTTP-Probe Host: %v://%v, Port: %v, Path: %v", scheme, host, port, path) + klog.V(4).InfoS("HTTP-Probe Host", "scheme", scheme, "host", host, "port", port, "path", path) url := formatURL(scheme, host, port, path) headers := buildHeader(p.HTTPGet.HTTPHeaders) - klog.V(4).Infof("HTTP-Probe Headers: %v", headers) + klog.V(4).InfoS("HTTP-Probe Headers", "headers", headers) switch probeType { case liveness: return pb.livenessHTTP.Probe(url, headers, timeout) @@ -193,10 +192,10 @@ func (pb *prober) runProbe(probeType probeType, p *v1.Probe, pod *v1.Pod, status if host == "" { host = status.PodIP } - klog.V(4).Infof("TCP-Probe Host: %v, Port: %v, Timeout: %v", host, port, timeout) + klog.V(4).InfoS("TCP-Probe Host", "host", host, "port", port, "timeout", timeout) return pb.tcp.Probe(host, port, timeout) } - klog.Warningf("Failed to find probe builder for container: %v", container) + klog.InfoS("Failed to find probe builder for container", "containerName", container.Name) return probe.Unknown, "", fmt.Errorf("missing probe handler for %s:%s", format.Pod(pod), container.Name) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober_manager.go index a661d7a1795e..af6c723ec088 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober_manager.go @@ -30,7 +30,6 @@ import ( kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/prober/results" "k8s.io/kubernetes/pkg/kubelet/status" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) // ProberResults stores the cumulative number of a probe by result as prometheus metrics. @@ -162,8 +161,8 @@ func (m *manager) AddPod(pod *v1.Pod) { if c.StartupProbe != nil { key.probeType = startup if _, ok := m.workers[key]; ok { - klog.Errorf("Startup probe already exists! %v - %v", - format.Pod(pod), c.Name) + klog.ErrorS(nil, "Startup probe already exists for container", + "pod", klog.KObj(pod), "containerName", c.Name) return } w := newWorker(m, startup, pod, c) @@ -174,8 +173,8 @@ func (m *manager) AddPod(pod *v1.Pod) { if c.ReadinessProbe != nil { key.probeType = readiness if _, ok := m.workers[key]; ok { - klog.Errorf("Readiness probe already exists! %v - %v", - format.Pod(pod), c.Name) + klog.ErrorS(nil, "Readiness probe already exists for container", + "pod", klog.KObj(pod), "containerName", c.Name) return } w := newWorker(m, readiness, pod, c) @@ -186,8 +185,8 @@ func (m *manager) AddPod(pod *v1.Pod) { if c.LivenessProbe != nil { key.probeType = liveness if _, ok := m.workers[key]; ok { - klog.Errorf("Liveness probe already exists! %v - %v", - format.Pod(pod), c.Name) + klog.ErrorS(nil, "Liveness probe already exists for container", + "pod", klog.KObj(pod), "containerName", c.Name) return } w := newWorker(m, liveness, pod, c) @@ -253,7 +252,7 @@ func (m *manager) UpdatePodStatus(podUID types.UID, podStatus *v1.PodStatus) { select { case w.manualTriggerCh <- struct{}{}: default: // Non-blocking. - klog.Warningf("Failed to trigger a manual run of %s probe", w.probeType.String()) + klog.InfoS("Failed to trigger a manual run", "probe", w.probeType.String()) } } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/worker.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/worker.go index ef8339e314dd..f627a79d036b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/worker.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/worker.go @@ -20,14 +20,13 @@ import ( "math/rand" "time" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/component-base/metrics" "k8s.io/klog/v2" podutil "k8s.io/kubernetes/pkg/api/v1/pod" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/prober/results" - "k8s.io/kubernetes/pkg/kubelet/util/format" ) // worker handles the periodic probing of its assigned container. Each worker has a go-routine @@ -185,22 +184,22 @@ func (w *worker) doProbe() (keepGoing bool) { status, ok := w.probeManager.statusManager.GetPodStatus(w.pod.UID) if !ok { // Either the pod has not been created yet, or it was already deleted. - klog.V(3).Infof("No status for pod: %v", format.Pod(w.pod)) + klog.V(3).InfoS("No status for pod", "pod", klog.KObj(w.pod)) return true } // Worker should terminate if pod is terminated. if status.Phase == v1.PodFailed || status.Phase == v1.PodSucceeded { - klog.V(3).Infof("Pod %v %v, exiting probe worker", - format.Pod(w.pod), status.Phase) + klog.V(3).InfoS("Pod is terminated, exiting probe worker", + "pod", klog.KObj(w.pod), "phase", status.Phase) return false } c, ok := podutil.GetContainerStatus(status.ContainerStatuses, w.container.Name) if !ok || len(c.ContainerID) == 0 { // Either the container has not been created yet, or it was deleted. - klog.V(3).Infof("Probe target container not found: %v - %v", - format.Pod(w.pod), w.container.Name) + klog.V(3).InfoS("Probe target container not found", + "pod", klog.KObj(w.pod), "containerName", w.container.Name) return true // Wait for more information. } @@ -220,8 +219,8 @@ func (w *worker) doProbe() (keepGoing bool) { } if c.State.Running == nil { - klog.V(3).Infof("Non-running container probed: %v - %v", - format.Pod(w.pod), w.container.Name) + klog.V(3).InfoS("Non-running container probed", + "pod", klog.KObj(w.pod), "containerName", w.container.Name) if !w.containerID.IsEmpty() { w.resultsManager.Set(w.containerID, results.Failure, w.pod) } @@ -232,11 +231,11 @@ func (w *worker) doProbe() (keepGoing bool) { // Graceful shutdown of the pod. if w.pod.ObjectMeta.DeletionTimestamp != nil && (w.probeType == liveness || w.probeType == startup) { - klog.V(3).Infof("Pod deletion requested, setting %v probe result to success: %v - %v", - w.probeType.String(), format.Pod(w.pod), w.container.Name) + klog.V(3).InfoS("Pod deletion requested, setting probe result to success", + "probeType", w.probeType, "pod", klog.KObj(w.pod), "containerName", w.container.Name) if w.probeType == startup { - klog.Warningf("Pod deletion requested before container has fully started: %v - %v", - format.Pod(w.pod), w.container.Name) + klog.InfoS("Pod deletion requested before container has fully started", + "pod", klog.KObj(w.pod), "containerName", w.container.Name) } // Set a last result to ensure quiet shutdown. w.resultsManager.Set(w.containerID, results.Success, w.pod) @@ -251,8 +250,9 @@ func (w *worker) doProbe() (keepGoing bool) { if c.Started != nil && *c.Started { // Stop probing for startup once container has started. + // we keep it running to make sure it will work for restarted container. if w.probeType == startup { - return false + return true } } else { // Disable other probes until container has started. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go index fc4289213480..93d0934c2800 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go @@ -38,8 +38,8 @@ const ( // and 1000. Containers with higher OOM scores are killed if the system runs out of memory. // See https://lwn.net/Articles/391222/ for more information. func GetContainerOOMScoreAdjust(pod *v1.Pod, container *v1.Container, memoryCapacity int64) int { - if types.IsCriticalPod(pod) { - // Critical pods should be the last to get killed. + if types.IsNodeCriticalPod(pod) { + // Only node critical pod should be the last to get killed. return guaranteedOOMScoreAdj } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/runonce.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/runonce.go index 1da9c2251865..3272bccfda70 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/runonce.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/runonce.go @@ -51,15 +51,15 @@ func (kl *Kubelet) RunOnce(updates <-chan kubetypes.PodUpdate) ([]RunPodResult, // If the container logs directory does not exist, create it. if _, err := os.Stat(ContainerLogsDir); err != nil { if err := kl.os.MkdirAll(ContainerLogsDir, 0755); err != nil { - klog.Errorf("Failed to create directory %q: %v", ContainerLogsDir, err) + klog.ErrorS(err, "Failed to create directory", "path", ContainerLogsDir) } } select { case u := <-updates: - klog.Infof("processing manifest with %d pods", len(u.Pods)) + klog.InfoS("Processing manifest with pods", "numPods", len(u.Pods)) result, err := kl.runOnce(u.Pods, runOnceRetryDelay) - klog.Infof("finished processing %d pods", len(u.Pods)) + klog.InfoS("Finished processing pods", "numPods", len(u.Pods)) return result, err case <-time.After(runOnceManifestDelay): return nil, fmt.Errorf("no pod manifest update after %v", runOnceManifestDelay) @@ -85,27 +85,27 @@ func (kl *Kubelet) runOnce(pods []*v1.Pod, retryDelay time.Duration) (results [] }(pod) } - klog.Infof("Waiting for %d pods", len(admitted)) + klog.InfoS("Waiting for pods", "numPods", len(admitted)) failedPods := []string{} for i := 0; i < len(admitted); i++ { res := <-ch results = append(results, res) if res.Err != nil { - faliedContainerName, err := kl.getFailedContainers(res.Pod) + failedContainerName, err := kl.getFailedContainers(res.Pod) if err != nil { - klog.Infof("unable to get failed containers' names for pod %q, error:%v", format.Pod(res.Pod), err) + klog.InfoS("Unable to get failed containers' names for pod", "pod", klog.KObj(res.Pod), "err", err) } else { - klog.Infof("unable to start pod %q because container:%v failed", format.Pod(res.Pod), faliedContainerName) + klog.InfoS("Unable to start pod because container failed", "pod", klog.KObj(res.Pod), "containerName", failedContainerName) } failedPods = append(failedPods, format.Pod(res.Pod)) } else { - klog.Infof("started pod %q", format.Pod(res.Pod)) + klog.InfoS("Started pod", "pod", klog.KObj(res.Pod)) } } if len(failedPods) > 0 { return results, fmt.Errorf("error running pods: %v", failedPods) } - klog.Infof("%d pods started", len(pods)) + klog.InfoS("Pods started", "numPods", len(pods)) return results, err } @@ -120,14 +120,14 @@ func (kl *Kubelet) runPod(pod *v1.Pod, retryDelay time.Duration) error { } if kl.isPodRunning(pod, status) { - klog.Infof("pod %q containers running", format.Pod(pod)) + klog.InfoS("Pod's containers running", "pod", klog.KObj(pod)) return nil } - klog.Infof("pod %q containers not running: syncing", format.Pod(pod)) + klog.InfoS("Pod's containers not running: syncing", "pod", klog.KObj(pod)) - klog.Infof("Creating a mirror pod for static pod %q", format.Pod(pod)) + klog.InfoS("Creating a mirror pod for static pod", "pod", klog.KObj(pod)) if err := kl.podManager.CreateMirrorPod(pod); err != nil { - klog.Errorf("Failed creating a mirror pod %q: %v", format.Pod(pod), err) + klog.ErrorS(err, "Failed creating a mirror pod", "pod", klog.KObj(pod)) } mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod) if err = kl.syncPod(syncPodOptions{ @@ -142,7 +142,7 @@ func (kl *Kubelet) runPod(pod *v1.Pod, retryDelay time.Duration) error { return fmt.Errorf("timeout error: pod %q containers not running after %d retries", format.Pod(pod), runOnceMaxRetries) } // TODO(proppy): health checking would be better than waiting + checking the state at the next iteration. - klog.Infof("pod %q containers synced, waiting for %v", format.Pod(pod), delay) + klog.InfoS("Pod's containers synced, waiting", "pod", klog.KObj(pod), "duration", delay) time.Sleep(delay) retry++ delay *= runOnceRetryDelayBackoff @@ -154,7 +154,7 @@ func (kl *Kubelet) isPodRunning(pod *v1.Pod, status *kubecontainer.PodStatus) bo for _, c := range pod.Spec.Containers { cs := status.FindContainerStatusByName(c.Name) if cs == nil || cs.State != kubecontainer.ContainerStateRunning { - klog.Infof("Container %q for pod %q not running", c.Name, format.Pod(pod)) + klog.InfoS("Container not running", "pod", klog.KObj(pod), "containerName", c.Name) return false } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/fs_resource_analyzer.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/fs_resource_analyzer.go index 956e67d21b48..01ad396422ac 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/fs_resource_analyzer.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/fs_resource_analyzer.go @@ -23,6 +23,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/tools/record" "k8s.io/klog/v2" ) @@ -40,15 +41,17 @@ type fsResourceAnalyzer struct { calcPeriod time.Duration cachedVolumeStats atomic.Value startOnce sync.Once + eventRecorder record.EventRecorder } var _ fsResourceAnalyzerInterface = &fsResourceAnalyzer{} // newFsResourceAnalyzer returns a new fsResourceAnalyzer implementation -func newFsResourceAnalyzer(statsProvider Provider, calcVolumePeriod time.Duration) *fsResourceAnalyzer { +func newFsResourceAnalyzer(statsProvider Provider, calcVolumePeriod time.Duration, eventRecorder record.EventRecorder) *fsResourceAnalyzer { r := &fsResourceAnalyzer{ statsProvider: statsProvider, calcPeriod: calcVolumePeriod, + eventRecorder: eventRecorder, } r.cachedVolumeStats.Store(make(statCache)) return r @@ -74,7 +77,7 @@ func (s *fsResourceAnalyzer) updateCachedPodVolumeStats() { // Copy existing entries to new map, creating/starting new entries for pods missing from the cache for _, pod := range s.statsProvider.GetPods() { if value, found := oldCache[pod.GetUID()]; !found { - newCache[pod.GetUID()] = newVolumeStatCalculator(s.statsProvider, s.calcPeriod, pod).StartOnce() + newCache[pod.GetUID()] = newVolumeStatCalculator(s.statsProvider, s.calcPeriod, pod, s.eventRecorder).StartOnce() } else { newCache[pod.GetUID()] = value } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/handler.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/handler.go index c3781cf9b210..77e4fe7268cd 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/handler.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/handler.go @@ -88,6 +88,9 @@ type Provider interface { // ListVolumesForPod returns the stats of the volume used by the pod with // the podUID. ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) + // ListBlockVolumesForPod returns the stats of the volume used by the + // pod with the podUID. + ListBlockVolumesForPod(podUID types.UID) (map[string]volume.BlockVolume, bool) // GetPods returns the specs of all the pods running on this node. GetPods() []*v1.Pod diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/resource_analyzer.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/resource_analyzer.go index bcddff0b3c41..853eeb67b0f4 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/resource_analyzer.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/resource_analyzer.go @@ -17,6 +17,7 @@ limitations under the License. package stats import ( + "k8s.io/client-go/tools/record" "time" ) @@ -37,8 +38,8 @@ type resourceAnalyzer struct { var _ ResourceAnalyzer = &resourceAnalyzer{} // NewResourceAnalyzer returns a new ResourceAnalyzer -func NewResourceAnalyzer(statsProvider Provider, calVolumeFrequency time.Duration) ResourceAnalyzer { - fsAnalyzer := newFsResourceAnalyzer(statsProvider, calVolumeFrequency) +func NewResourceAnalyzer(statsProvider Provider, calVolumeFrequency time.Duration, eventRecorder record.EventRecorder) ResourceAnalyzer { + fsAnalyzer := newFsResourceAnalyzer(statsProvider, calVolumeFrequency, eventRecorder) summaryProvider := NewSummaryProvider(statsProvider) return &resourceAnalyzer{fsAnalyzer, summaryProvider} } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/volume_stat_calculator.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/volume_stat_calculator.go index fae72f9a6e66..39396d2f5d9b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/volume_stat_calculator.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/volume_stat_calculator.go @@ -17,17 +17,20 @@ limitations under the License. package stats import ( + "fmt" "sync" "sync/atomic" "time" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/wait" + utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/client-go/tools/record" + "k8s.io/klog/v2" stats "k8s.io/kubelet/pkg/apis/stats/v1alpha1" + "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume/util" - - "k8s.io/klog/v2" ) // volumeStatCalculator calculates volume metrics for a given pod periodically in the background and caches the result @@ -39,6 +42,7 @@ type volumeStatCalculator struct { startO sync.Once stopO sync.Once latest atomic.Value + eventRecorder record.EventRecorder } // PodVolumeStats encapsulates the VolumeStats for a pod. @@ -49,12 +53,13 @@ type PodVolumeStats struct { } // newVolumeStatCalculator creates a new VolumeStatCalculator -func newVolumeStatCalculator(statsProvider Provider, jitterPeriod time.Duration, pod *v1.Pod) *volumeStatCalculator { +func newVolumeStatCalculator(statsProvider Provider, jitterPeriod time.Duration, pod *v1.Pod, eventRecorder record.EventRecorder) *volumeStatCalculator { return &volumeStatCalculator{ statsProvider: statsProvider, jitterPeriod: jitterPeriod, pod: pod, stopChannel: make(chan struct{}), + eventRecorder: eventRecorder, } } @@ -91,10 +96,27 @@ func (s *volumeStatCalculator) GetLatest() (PodVolumeStats, bool) { func (s *volumeStatCalculator) calcAndStoreStats() { // Find all Volumes for the Pod volumes, found := s.statsProvider.ListVolumesForPod(s.pod.UID) - if !found { + blockVolumes, bvFound := s.statsProvider.ListBlockVolumesForPod(s.pod.UID) + if !found && !bvFound { return } + metricVolumes := make(map[string]volume.MetricsProvider) + + if found { + for name, v := range volumes { + metricVolumes[name] = v + } + } + if bvFound { + for name, v := range blockVolumes { + // Only add the blockVolume if it implements the MetricsProvider interface + if _, ok := v.(volume.MetricsProvider); ok { + metricVolumes[name] = v + } + } + } + // Get volume specs for the pod - key'd by volume name volumesSpec := make(map[string]v1.Volume) for _, v := range s.pod.Spec.Volumes { @@ -104,7 +126,7 @@ func (s *volumeStatCalculator) calcAndStoreStats() { // Call GetMetrics on each Volume and copy the result to a new VolumeStats.FsStats var ephemeralStats []stats.VolumeStats var persistentStats []stats.VolumeStats - for name, v := range volumes { + for name, v := range metricVolumes { metric, err := v.GetMetrics() if err != nil { // Expected for Volumes that don't support Metrics @@ -129,6 +151,11 @@ func (s *volumeStatCalculator) calcAndStoreStats() { persistentStats = append(persistentStats, volumeStats) } + if utilfeature.DefaultFeatureGate.Enabled(features.CSIVolumeHealth) { + if metric.Abnormal != nil && metric.Message != nil && (*metric.Abnormal) { + s.eventRecorder.Event(s.pod, v1.EventTypeWarning, "VolumeConditionAbnormal", fmt.Sprintf("Volume %s: %s", name, *metric.Message)) + } + } } // Store the new stats diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/host_stats_provider.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/host_stats_provider.go index 9c03fb542a4b..108fbfb8f142 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/host_stats_provider.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/host_stats_provider.go @@ -29,8 +29,8 @@ import ( "k8s.io/kubernetes/pkg/volume" ) -// PodEtcHostsPathFunc is a function to fetch a etc hosts path by pod uid. -type PodEtcHostsPathFunc func(podUID types.UID) string +// PodEtcHostsPathFunc is a function to fetch a etc hosts path by pod uid and whether etc host path is supported by the runtime +type PodEtcHostsPathFunc func(podUID types.UID) (string, bool) // metricsProviderByPath maps a path to its metrics provider type metricsProviderByPath map[string]volume.MetricsProvider @@ -79,7 +79,13 @@ func (h hostStatsProvider) getPodContainerLogStats(podNamespace, podName string, // getPodEtcHostsStats gets status for pod etc hosts usage func (h hostStatsProvider) getPodEtcHostsStats(podUID types.UID, rootFsInfo *cadvisorapiv2.FsInfo) (*statsapi.FsStats, error) { - metrics := h.podEtcHostsMetrics(podUID) + // Runtimes may not support etc hosts file (Windows with docker) + podEtcHostsPath, isEtcHostsSupported := h.podEtcHostsPathFunc(podUID) + if !isEtcHostsSupported { + return nil, nil + } + + metrics := volume.NewMetricsDu(podEtcHostsPath) hostMetrics, err := metrics.GetMetrics() if err != nil { return nil, fmt.Errorf("failed to get stats %v", err) @@ -103,11 +109,6 @@ func (h hostStatsProvider) podContainerLogMetrics(podNamespace, podName string, return h.fileMetricsByDir(podContainerLogsDirectoryPath) } -func (h hostStatsProvider) podEtcHostsMetrics(podUID types.UID) volume.MetricsProvider { - podEtcHostsPath := h.podEtcHostsPathFunc(podUID) - return volume.NewMetricsDu(podEtcHostsPath) -} - // fileMetricsByDir returns metrics by path for each file under specified directory func (h hostStatsProvider) fileMetricsByDir(dirname string) (metricsProviderByPath, error) { files, err := h.osInterface.ReadDir(dirname) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/provider.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/provider.go index 3ea8633200f5..360c740315d7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/provider.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/provider.go @@ -144,7 +144,7 @@ func (p *Provider) RootFsStats() (*statsapi.FsStats, error) { } // Get the root container stats's timestamp, which will be used as the - // imageFs stats timestamp. Dont force a stats update, as we only want the timestamp. + // imageFs stats timestamp. Don't force a stats update, as we only want the timestamp. rootStats, err := getCgroupStats(p.cadvisor, "/", false) if err != nil { return nil, fmt.Errorf("failed to get root container stats: %v", err) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go index 28b086e30a8f..fb607ea8f8f0 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go @@ -555,7 +555,7 @@ func (m *manager) syncPod(uid types.UID, status versionedPodStatus) { // TODO: make me easier to express from client code pod, err := m.kubeClient.CoreV1().Pods(status.podNamespace).Get(context.TODO(), status.podName, metav1.GetOptions{}) if errors.IsNotFound(err) { - klog.V(3).Infof("Pod does not exist on the server", + klog.V(3).InfoS("Pod does not exist on the server", "podUID", uid, "pod", klog.KRef(status.podNamespace, status.podName)) // If the Pod is deleted the status will be cleared in diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_update.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_update.go index 2cb27019283c..9420eef1eb32 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_update.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_update.go @@ -184,3 +184,8 @@ func Preemptable(preemptor, preemptee *v1.Pod) bool { func IsCriticalPodBasedOnPriority(priority int32) bool { return priority >= scheduling.SystemCriticalPriority } + +// IsNodeCriticalPod checks if the given pod is a system-node-critical +func IsNodeCriticalPod(pod *v1.Pod) bool { + return IsCriticalPod(pod) && (pod.Spec.PriorityClassName == scheduling.SystemNodeCritical) +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volume_host.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volume_host.go index c724e8aaee4a..d2e538539bd3 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volume_host.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volume_host.go @@ -72,7 +72,7 @@ func NewInitializedVolumePluginMgr( csiDriversSynced = csiDriverInformer.Informer().HasSynced } else { - klog.Warning("kubeClient is nil. Skip initialization of CSIDriverLister") + klog.InfoS("KubeClient is nil. Skip initialization of CSIDriverLister") } kvh := &kubeletVolumeHost{ @@ -176,13 +176,13 @@ func (kvh *kubeletVolumeHost) CSIDriversSynced() cache.InformerSynced { // WaitForCacheSync is a helper function that waits for cache sync for CSIDriverLister func (kvh *kubeletVolumeHost) WaitForCacheSync() error { if kvh.csiDriversSynced == nil { - klog.Error("csiDriversSynced not found on KubeletVolumeHost") + klog.ErrorS(nil, "CsiDriversSynced not found on KubeletVolumeHost") return fmt.Errorf("csiDriversSynced not found on KubeletVolumeHost") } synced := []cache.InformerSynced{kvh.csiDriversSynced} if !cache.WaitForCacheSync(wait.NeverStop, synced...) { - klog.Warning("failed to wait for cache sync for CSIDriverLister") + klog.InfoS("Failed to wait for cache sync for CSIDriverLister") return fmt.Errorf("failed to wait for cache sync for CSIDriverLister") } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/cache/actual_state_of_world.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/cache/actual_state_of_world.go index 155caebd7801..70a4c3d34097 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/cache/actual_state_of_world.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/cache/actual_state_of_world.go @@ -461,9 +461,7 @@ func (asw *actualStateOfWorld) addVolume( } else { // If volume object already exists, update the fields such as device path volumeObj.devicePath = devicePath - klog.V(2).Infof("Volume %q is already added to attachedVolume list, update device path %q", - volumeName, - devicePath) + klog.V(2).InfoS("Volume is already added to attachedVolume list, update device path", "volumeName", volumeName, "path", devicePath) } asw.attachedVolumes[volumeName] = volumeObj @@ -530,9 +528,7 @@ func (asw *actualStateOfWorld) MarkVolumeAsResized( podName, volumeName) } - - klog.V(5).Infof("Volume %s(OuterVolumeSpecName %s) of pod %s has been resized", - volumeName, podObj.outerVolumeSpecName, podName) + klog.V(5).InfoS("Pod volume has been resized", "uniquePodName", podName, "volumeName", volumeName, "outerVolumeSpecName", podObj.outerVolumeSpecName) podObj.fsResizeRequired = false asw.attachedVolumes[volumeName].mountedPods[podName] = podObj return nil @@ -548,12 +544,7 @@ func (asw *actualStateOfWorld) MarkRemountRequired( asw.volumePluginMgr.FindPluginBySpec(podObj.volumeSpec) if err != nil || volumePlugin == nil { // Log and continue processing - klog.Errorf( - "MarkRemountRequired failed to FindPluginBySpec for pod %q (podUid %q) volume: %q (volSpecName: %q)", - podObj.podName, - podObj.podUID, - volumeObj.volumeName, - podObj.volumeSpec.Name()) + klog.ErrorS(nil, "MarkRemountRequired failed to FindPluginBySpec for volume", "uniquePodName", podObj.podName, "podUID", podObj.podUID, "volumeName", volumeName, "volumeSpecName", podObj.volumeSpec.Name()) continue } @@ -572,14 +563,13 @@ func (asw *actualStateOfWorld) MarkFSResizeRequired( defer asw.Unlock() volumeObj, volumeExists := asw.attachedVolumes[volumeName] if !volumeExists { - klog.Warningf("MarkFSResizeRequired for volume %s failed as volume not exist", volumeName) + klog.InfoS("MarkFSResizeRequired for volume failed as volume does not exist", "volumeName", volumeName) return } podObj, podExists := volumeObj.mountedPods[podName] if !podExists { - klog.Warningf("MarkFSResizeRequired for volume %s failed "+ - "as pod(%s) not exist", volumeName, podName) + klog.InfoS("MarkFSResizeRequired for volume failed because the pod does not exist", "uniquePodName", podName, "volumeName", volumeName) return } @@ -587,18 +577,13 @@ func (asw *actualStateOfWorld) MarkFSResizeRequired( asw.volumePluginMgr.FindNodeExpandablePluginBySpec(podObj.volumeSpec) if err != nil || volumePlugin == nil { // Log and continue processing - klog.Errorf( - "MarkFSResizeRequired failed to find expandable plugin for pod %q volume: %q (volSpecName: %q)", - podObj.podName, - volumeObj.volumeName, - podObj.volumeSpec.Name()) + klog.ErrorS(nil, "MarkFSResizeRequired failed to find expandable plugin for volume", "uniquePodName", podObj.podName, "volumeName", volumeObj.volumeName, "volumeSpecName", podObj.volumeSpec.Name()) return } if volumePlugin.RequiresFSResize() { if !podObj.fsResizeRequired { - klog.V(3).Infof("PVC volume %s(OuterVolumeSpecName %s) of pod %s requires file system resize", - volumeName, podObj.outerVolumeSpecName, podName) + klog.V(3).InfoS("PVC volume of the pod requires file system resize", "uniquePodName", podName, "volumeName", volumeName, "outerVolumeSpecName", podObj.outerVolumeSpecName) podObj.fsResizeRequired = true } asw.attachedVolumes[volumeName].mountedPods[podName] = podObj diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go index b222f9224bf2..8300d9e08e9d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go @@ -41,7 +41,6 @@ import ( kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/pod" "k8s.io/kubernetes/pkg/kubelet/status" - "k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/kubelet/volumemanager/cache" "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume/csimigration" @@ -139,7 +138,7 @@ type processedPods struct { func (dswp *desiredStateOfWorldPopulator) Run(sourcesReady config.SourcesReady, stopCh <-chan struct{}) { // Wait for the completion of a loop that started after sources are all ready, then set hasAddedPods accordingly - klog.Infof("Desired state populator starts to run") + klog.InfoS("Desired state populator starts to run") wait.PollUntil(dswp.loopSleepDuration, func() (bool, error) { done := sourcesReady.AllReady() dswp.populatorLoop() @@ -171,11 +170,7 @@ func (dswp *desiredStateOfWorldPopulator) populatorLoop() { // findAndRemoveDeletedPods() is called independently of the main // populator loop. if time.Since(dswp.timeOfLastGetPodStatus) < dswp.getPodStatusRetryDuration { - klog.V(5).Infof( - "Skipping findAndRemoveDeletedPods(). Not permitted until %v (getPodStatusRetryDuration %v).", - dswp.timeOfLastGetPodStatus.Add(dswp.getPodStatusRetryDuration), - dswp.getPodStatusRetryDuration) - + klog.V(5).InfoS("Skipping findAndRemoveDeletedPods(). ", "nextRetryTime", dswp.timeOfLastGetPodStatus.Add(dswp.getPodStatusRetryDuration), "retryDuration", dswp.getPodStatusRetryDuration) return } @@ -234,7 +229,7 @@ func (dswp *desiredStateOfWorldPopulator) findAndRemoveDeletedPods() { // It is not possible right now for a CSI plugin to be both attachable and non-deviceMountable // So the uniqueVolumeName should remain the same after the attachability change dswp.desiredStateOfWorld.MarkVolumeAttachability(volumeToMount.VolumeName, false) - klog.Infof("Volume %v changes from attachable to non-attachable.", volumeToMount.VolumeName) + klog.InfoS("Volume changes from attachable to non-attachable", "volumeName", volumeToMount.VolumeName) continue } } @@ -256,9 +251,7 @@ func (dswp *desiredStateOfWorldPopulator) findAndRemoveDeletedPods() { var getPodsErr error runningPods, getPodsErr = dswp.kubeContainerRuntime.GetPods(false) if getPodsErr != nil { - klog.Errorf( - "kubeContainerRuntime.findAndRemoveDeletedPods returned error %v.", - getPodsErr) + klog.ErrorS(getPodsErr, "kubeContainerRuntime.findAndRemoveDeletedPods returned error") continue } @@ -269,7 +262,11 @@ func (dswp *desiredStateOfWorldPopulator) findAndRemoveDeletedPods() { runningContainers := false for _, runningPod := range runningPods { if runningPod.ID == volumeToMount.Pod.UID { - if len(runningPod.Containers) > 0 { + // runningPod.Containers only include containers in the running state, + // excluding containers in the creating process. + // By adding a non-empty judgment for runningPod.Sandboxes, + // ensure that all containers of the pod have been terminated. + if len(runningPod.Sandboxes) > 0 || len(runningPod.Containers) > 0 { runningContainers = true } @@ -278,19 +275,19 @@ func (dswp *desiredStateOfWorldPopulator) findAndRemoveDeletedPods() { } if runningContainers { - klog.V(4).Infof( - "Pod %q still has one or more containers in the non-exited state. Therefore, it will not be removed from desired state.", - format.Pod(volumeToMount.Pod)) + klog.V(4).InfoS("Pod still has one or more containers in the non-exited state and will not be removed from desired state", "pod", klog.KObj(volumeToMount.Pod)) continue } exists, _, _ := dswp.actualStateOfWorld.PodExistsInVolume(volumeToMount.PodName, volumeToMount.VolumeName) + var volumeToMountSpecName string + if volumeToMount.VolumeSpec != nil { + volumeToMountSpecName = volumeToMount.VolumeSpec.Name() + } if !exists && podExists { - klog.V(4).Infof( - volumeToMount.GenerateMsgDetailed(fmt.Sprintf("Actual state has not yet has this volume mounted information and pod (%q) still exists in pod manager, skip removing volume from desired state", - format.Pod(volumeToMount.Pod)), "")) + klog.V(4).InfoS("Actual state does not yet have volume mount information and pod still exists in pod manager, skip removing volume from desired state", "pod", klog.KObj(volumeToMount.Pod), "podUID", volumeToMount.Pod.UID, "volumeName", volumeToMountSpecName) continue } - klog.V(4).Infof(volumeToMount.GenerateMsgDetailed("Removing volume from desired state", "")) + klog.V(4).InfoS("Removing volume from desired state", "pod", klog.KObj(volumeToMount.Pod), "podUID", volumeToMount.Pod.UID, "volumeName", volumeToMountSpecName) dswp.desiredStateOfWorld.DeletePodFromVolume( volumeToMount.PodName, volumeToMount.VolumeName) @@ -328,18 +325,14 @@ func (dswp *desiredStateOfWorldPopulator) processPodVolumes( for _, podVolume := range pod.Spec.Volumes { if !mounts.Has(podVolume.Name) && !devices.Has(podVolume.Name) { // Volume is not used in the pod, ignore it. - klog.V(4).Infof("Skipping unused volume %q for pod %q", podVolume.Name, format.Pod(pod)) + klog.V(4).InfoS("Skipping unused volume", "pod", klog.KObj(pod), "volumeName", podVolume.Name) continue } pvc, volumeSpec, volumeGidValue, err := dswp.createVolumeSpec(podVolume, pod, mounts, devices) if err != nil { - klog.Errorf( - "Error processing volume %q for pod %q: %v", - podVolume.Name, - format.Pod(pod), - err) + klog.ErrorS(err, "Error processing volume", "pod", klog.KObj(pod), "volumeName", podVolume.Name) dswp.desiredStateOfWorld.AddErrorToPod(uniquePodName, err.Error()) allVolumesAdded = false continue @@ -349,20 +342,11 @@ func (dswp *desiredStateOfWorldPopulator) processPodVolumes( _, err = dswp.desiredStateOfWorld.AddPodToVolume( uniquePodName, pod, volumeSpec, podVolume.Name, volumeGidValue) if err != nil { - klog.Errorf( - "Failed to add volume %s (specName: %s) for pod %q to desiredStateOfWorld: %v", - podVolume.Name, - volumeSpec.Name(), - uniquePodName, - err) + klog.ErrorS(err, "Failed to add volume to desiredStateOfWorld", "pod", klog.KObj(pod), "volumeName", podVolume.Name, "volumeSpecName", volumeSpec.Name()) dswp.desiredStateOfWorld.AddErrorToPod(uniquePodName, err.Error()) allVolumesAdded = false } else { - klog.V(4).Infof( - "Added volume %q (volSpec=%q) for pod %q to desired state.", - podVolume.Name, - volumeSpec.Name(), - uniquePodName) + klog.V(4).InfoS("Added volume to desired state", "pod", klog.KObj(pod), "volumeName", podVolume.Name, "volumeSpecName", volumeSpec.Name()) } if expandInUsePV { @@ -425,8 +409,7 @@ func (dswp *desiredStateOfWorldPopulator) checkVolumeFSResize( // we should use it here. This value comes from Pod.spec.volumes.persistentVolumeClaim.readOnly. if volumeSpec.ReadOnly { // This volume is used as read only by this pod, we don't perform resize for read only volumes. - klog.V(5).Infof("Skip file system resize check for volume %s in pod %s/%s "+ - "as the volume is mounted as readonly", podVolume.Name, pod.Namespace, pod.Name) + klog.V(5).InfoS("Skip file system resize check for the volume, as the volume is mounted as readonly", "pod", klog.KObj(pod), "volumeName", podVolume.Name) return } if volumeRequiresFSResize(pvc, volumeSpec.PersistentVolume) { @@ -530,16 +513,11 @@ func (dswp *desiredStateOfWorldPopulator) createVolumeSpec( // owned by the pod. pvcSource = &v1.PersistentVolumeClaimVolumeSource{ ClaimName: pod.Name + "-" + podVolume.Name, - ReadOnly: podVolume.VolumeSource.Ephemeral.ReadOnly, } ephemeral = true } if pvcSource != nil { - klog.V(5).Infof( - "Found PVC, ClaimName: %q/%q", - pod.Namespace, - pvcSource.ClaimName) - + klog.V(5).InfoS("Found PVC", "PVC", klog.KRef(pod.Namespace, pvcSource.ClaimName)) // If podVolume is a PVC, fetch the real PV behind the claim pvc, err := dswp.getPVCExtractPV( pod.Namespace, pvcSource.ClaimName) @@ -558,14 +536,7 @@ func (dswp *desiredStateOfWorldPopulator) createVolumeSpec( ) } pvName, pvcUID := pvc.Spec.VolumeName, pvc.UID - - klog.V(5).Infof( - "Found bound PV for PVC (ClaimName %q/%q pvcUID %v): pvName=%q", - pod.Namespace, - pvcSource.ClaimName, - pvcUID, - pvName) - + klog.V(5).InfoS("Found bound PV for PVC", "PVC", klog.KRef(pod.Namespace, pvcSource.ClaimName), "PVCUID", pvcUID, "PVName", pvName) // Fetch actual PV object volumeSpec, volumeGidValue, err := dswp.getPVSpec(pvName, pvcSource.ReadOnly, pvcUID) @@ -576,21 +547,13 @@ func (dswp *desiredStateOfWorldPopulator) createVolumeSpec( pvcSource.ClaimName, err) } - - klog.V(5).Infof( - "Extracted volumeSpec (%v) from bound PV (pvName %q) and PVC (ClaimName %q/%q pvcUID %v)", - volumeSpec.Name(), - pvName, - pod.Namespace, - pvcSource.ClaimName, - pvcUID) - + klog.V(5).InfoS("Extracted volumeSpec from bound PV and PVC", "PVC", klog.KRef(pod.Namespace, pvcSource.ClaimName), "PVCUID", pvcUID, "PVName", pvName, "volumeSpecName", volumeSpec.Name()) migratable, err := dswp.csiMigratedPluginManager.IsMigratable(volumeSpec) if err != nil { return nil, nil, "", err } if migratable { - volumeSpec, err = csimigration.TranslateInTreeSpecToCSI(volumeSpec, dswp.intreeToCSITranslator) + volumeSpec, err = csimigration.TranslateInTreeSpecToCSI(volumeSpec, pod.Namespace, dswp.intreeToCSITranslator) if err != nil { return nil, nil, "", err } @@ -632,7 +595,7 @@ func (dswp *desiredStateOfWorldPopulator) createVolumeSpec( return nil, nil, "", err } if migratable { - spec, err = csimigration.TranslateInTreeSpecToCSI(spec, dswp.intreeToCSITranslator) + spec, err = csimigration.TranslateInTreeSpecToCSI(spec, pod.Namespace, dswp.intreeToCSITranslator) if err != nil { return nil, nil, "", err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler/reconciler.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler/reconciler.go index 284a46bae646..e09e269f1bcc 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler/reconciler.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler/reconciler.go @@ -154,7 +154,7 @@ func (rc *reconciler) reconciliationLoopFunc() func() { // Otherwise, the reconstruct process may clean up pods' volumes that are still in use because // desired state of world does not contain a complete list of pods. if rc.populatorHasAddedPods() && !rc.StatesHasBeenSynced() { - klog.Infof("Reconciler: start to sync state") + klog.InfoS("Reconciler: start to sync state") rc.sync() } } @@ -182,7 +182,7 @@ func (rc *reconciler) unmountVolumes() { for _, mountedVolume := range rc.actualStateOfWorld.GetAllMountedVolumes() { if !rc.desiredStateOfWorld.PodExistsInVolume(mountedVolume.PodName, mountedVolume.VolumeName) { // Volume is mounted, unmount it - klog.V(5).Infof(mountedVolume.GenerateMsgDetailed("Starting operationExecutor.UnmountVolume", "")) + klog.V(5).InfoS(mountedVolume.GenerateMsgDetailed("Starting operationExecutor.UnmountVolume", "")) err := rc.operationExecutor.UnmountVolume( mountedVolume.MountedVolume, rc.actualStateOfWorld, rc.kubeletPodsDir) if err != nil && @@ -190,10 +190,10 @@ func (rc *reconciler) unmountVolumes() { !exponentialbackoff.IsExponentialBackoff(err) { // Ignore nestedpendingoperations.IsAlreadyExists and exponentialbackoff.IsExponentialBackoff errors, they are expected. // Log all other errors. - klog.Errorf(mountedVolume.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.UnmountVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) + klog.ErrorS(err, mountedVolume.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.UnmountVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) } if err == nil { - klog.Infof(mountedVolume.GenerateMsgDetailed("operationExecutor.UnmountVolume started", "")) + klog.InfoS(mountedVolume.GenerateMsgDetailed("operationExecutor.UnmountVolume started", "")) } } } @@ -208,7 +208,7 @@ func (rc *reconciler) mountAttachVolumes() { if rc.controllerAttachDetachEnabled || !volumeToMount.PluginIsAttachable { // Volume is not attached (or doesn't implement attacher), kubelet attach is disabled, wait // for controller to finish attaching volume. - klog.V(5).Infof(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.VerifyControllerAttachedVolume", "")) + klog.V(5).InfoS(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.VerifyControllerAttachedVolume", "")) err := rc.operationExecutor.VerifyControllerAttachedVolume( volumeToMount.VolumeToMount, rc.nodeName, @@ -218,10 +218,10 @@ func (rc *reconciler) mountAttachVolumes() { !exponentialbackoff.IsExponentialBackoff(err) { // Ignore nestedpendingoperations.IsAlreadyExists and exponentialbackoff.IsExponentialBackoff errors, they are expected. // Log all other errors. - klog.Errorf(volumeToMount.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.VerifyControllerAttachedVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) + klog.ErrorS(err, volumeToMount.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.VerifyControllerAttachedVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) } if err == nil { - klog.Infof(volumeToMount.GenerateMsgDetailed("operationExecutor.VerifyControllerAttachedVolume started", "")) + klog.InfoS(volumeToMount.GenerateMsgDetailed("operationExecutor.VerifyControllerAttachedVolume started", "")) } } else { // Volume is not attached to node, kubelet attach is enabled, volume implements an attacher, @@ -231,17 +231,17 @@ func (rc *reconciler) mountAttachVolumes() { VolumeSpec: volumeToMount.VolumeSpec, NodeName: rc.nodeName, } - klog.V(5).Infof(volumeToAttach.GenerateMsgDetailed("Starting operationExecutor.AttachVolume", "")) + klog.V(5).InfoS(volumeToAttach.GenerateMsgDetailed("Starting operationExecutor.AttachVolume", "")) err := rc.operationExecutor.AttachVolume(volumeToAttach, rc.actualStateOfWorld) if err != nil && !nestedpendingoperations.IsAlreadyExists(err) && !exponentialbackoff.IsExponentialBackoff(err) { // Ignore nestedpendingoperations.IsAlreadyExists and exponentialbackoff.IsExponentialBackoff errors, they are expected. // Log all other errors. - klog.Errorf(volumeToMount.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.AttachVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) + klog.ErrorS(err, volumeToMount.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.AttachVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) } if err == nil { - klog.Infof(volumeToMount.GenerateMsgDetailed("operationExecutor.AttachVolume started", "")) + klog.InfoS(volumeToMount.GenerateMsgDetailed("operationExecutor.AttachVolume started", "")) } } } else if !volMounted || cache.IsRemountRequiredError(err) { @@ -251,7 +251,7 @@ func (rc *reconciler) mountAttachVolumes() { if isRemount { remountingLogStr = "Volume is already mounted to pod, but remount was requested." } - klog.V(4).Infof(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.MountVolume", remountingLogStr)) + klog.V(4).InfoS(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.MountVolume", remountingLogStr)) err := rc.operationExecutor.MountVolume( rc.waitForAttachTimeout, volumeToMount.VolumeToMount, @@ -262,18 +262,18 @@ func (rc *reconciler) mountAttachVolumes() { !exponentialbackoff.IsExponentialBackoff(err) { // Ignore nestedpendingoperations.IsAlreadyExists and exponentialbackoff.IsExponentialBackoff errors, they are expected. // Log all other errors. - klog.Errorf(volumeToMount.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.MountVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) + klog.ErrorS(err, volumeToMount.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.MountVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) } if err == nil { if remountingLogStr == "" { - klog.V(1).Infof(volumeToMount.GenerateMsgDetailed("operationExecutor.MountVolume started", remountingLogStr)) + klog.V(1).InfoS(volumeToMount.GenerateMsgDetailed("operationExecutor.MountVolume started", remountingLogStr)) } else { - klog.V(5).Infof(volumeToMount.GenerateMsgDetailed("operationExecutor.MountVolume started", remountingLogStr)) + klog.V(5).InfoS(volumeToMount.GenerateMsgDetailed("operationExecutor.MountVolume started", remountingLogStr)) } } } else if cache.IsFSResizeRequiredError(err) && utilfeature.DefaultFeatureGate.Enabled(features.ExpandInUsePersistentVolumes) { - klog.V(4).Infof(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.ExpandInUseVolume", "")) + klog.V(4).InfoS(volumeToMount.GenerateMsgDetailed("Starting operationExecutor.ExpandInUseVolume", "")) err := rc.operationExecutor.ExpandInUseVolume( volumeToMount.VolumeToMount, rc.actualStateOfWorld) @@ -282,10 +282,10 @@ func (rc *reconciler) mountAttachVolumes() { !exponentialbackoff.IsExponentialBackoff(err) { // Ignore nestedpendingoperations.IsAlreadyExists and exponentialbackoff.IsExponentialBackoff errors, they are expected. // Log all other errors. - klog.Errorf(volumeToMount.GenerateErrorDetailed("operationExecutor.ExpandInUseVolume failed", err).Error()) + klog.ErrorS(err, volumeToMount.GenerateErrorDetailed("operationExecutor.ExpandInUseVolume failed", err).Error()) } if err == nil { - klog.V(4).Infof(volumeToMount.GenerateMsgDetailed("operationExecutor.ExpandInUseVolume started", "")) + klog.V(4).InfoS(volumeToMount.GenerateMsgDetailed("operationExecutor.ExpandInUseVolume started", "")) } } } @@ -298,7 +298,7 @@ func (rc *reconciler) unmountDetachDevices() { !rc.operationExecutor.IsOperationPending(attachedVolume.VolumeName, nestedpendingoperations.EmptyUniquePodName, nestedpendingoperations.EmptyNodeName) { if attachedVolume.DeviceMayBeMounted() { // Volume is globally mounted to device, unmount it - klog.V(5).Infof(attachedVolume.GenerateMsgDetailed("Starting operationExecutor.UnmountDevice", "")) + klog.V(5).InfoS(attachedVolume.GenerateMsgDetailed("Starting operationExecutor.UnmountDevice", "")) err := rc.operationExecutor.UnmountDevice( attachedVolume.AttachedVolume, rc.actualStateOfWorld, rc.hostutil) if err != nil && @@ -306,20 +306,20 @@ func (rc *reconciler) unmountDetachDevices() { !exponentialbackoff.IsExponentialBackoff(err) { // Ignore nestedpendingoperations.IsAlreadyExists and exponentialbackoff.IsExponentialBackoff errors, they are expected. // Log all other errors. - klog.Errorf(attachedVolume.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.UnmountDevice failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) + klog.ErrorS(err, attachedVolume.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.UnmountDevice failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) } if err == nil { - klog.Infof(attachedVolume.GenerateMsgDetailed("operationExecutor.UnmountDevice started", "")) + klog.InfoS(attachedVolume.GenerateMsgDetailed("operationExecutor.UnmountDevice started", "")) } } else { // Volume is attached to node, detach it // Kubelet not responsible for detaching or this volume has a non-attachable volume plugin. if rc.controllerAttachDetachEnabled || !attachedVolume.PluginIsAttachable { rc.actualStateOfWorld.MarkVolumeAsDetached(attachedVolume.VolumeName, attachedVolume.NodeName) - klog.Infof(attachedVolume.GenerateMsgDetailed("Volume detached", fmt.Sprintf("DevicePath %q", attachedVolume.DevicePath))) + klog.InfoS(attachedVolume.GenerateMsgDetailed("Volume detached", fmt.Sprintf("DevicePath %q", attachedVolume.DevicePath))) } else { // Only detach if kubelet detach is enabled - klog.V(5).Infof(attachedVolume.GenerateMsgDetailed("Starting operationExecutor.DetachVolume", "")) + klog.V(5).InfoS(attachedVolume.GenerateMsgDetailed("Starting operationExecutor.DetachVolume", "")) err := rc.operationExecutor.DetachVolume( attachedVolume.AttachedVolume, false /* verifySafeToDetach */, rc.actualStateOfWorld) if err != nil && @@ -327,10 +327,10 @@ func (rc *reconciler) unmountDetachDevices() { !exponentialbackoff.IsExponentialBackoff(err) { // Ignore nestedpendingoperations.IsAlreadyExists && exponentialbackoff.IsExponentialBackoff errors, they are expected. // Log all other errors. - klog.Errorf(attachedVolume.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.DetachVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) + klog.ErrorS(err, attachedVolume.GenerateErrorDetailed(fmt.Sprintf("operationExecutor.DetachVolume failed (controllerAttachDetachEnabled %v)", rc.controllerAttachDetachEnabled), err).Error()) } if err == nil { - klog.Infof(attachedVolume.GenerateMsgDetailed("operationExecutor.DetachVolume started", "")) + klog.InfoS(attachedVolume.GenerateMsgDetailed("operationExecutor.DetachVolume started", "")) } } } @@ -386,14 +386,14 @@ func (rc *reconciler) syncStates() { // Get volumes information by reading the pod's directory podVolumes, err := getVolumesFromPodDir(rc.kubeletPodsDir) if err != nil { - klog.Errorf("Cannot get volumes from disk %v", err) + klog.ErrorS(err, "Cannot get volumes from disk") return } volumesNeedUpdate := make(map[v1.UniqueVolumeName]*reconstructedVolume) volumeNeedReport := []v1.UniqueVolumeName{} for _, volume := range podVolumes { if rc.actualStateOfWorld.VolumeExistsWithSpecName(volume.podName, volume.volumeSpecName) { - klog.V(4).Infof("Volume exists in actual state (volume.SpecName %s, pod.UID %s), skip cleaning up mounts", volume.volumeSpecName, volume.podName) + klog.V(4).InfoS("Volume exists in actual state, skip cleaning up mounts", "podName", volume.podName, "volumeSpecName", volume.volumeSpecName) // There is nothing to reconstruct continue } @@ -404,11 +404,11 @@ func (rc *reconciler) syncStates() { if volumeInDSW { // Some pod needs the volume, don't clean it up and hope that // reconcile() calls SetUp and reconstructs the volume in ASW. - klog.V(4).Infof("Volume exists in desired state (volume.SpecName %s, pod.UID %s), skip cleaning up mounts", volume.volumeSpecName, volume.podName) + klog.V(4).InfoS("Volume exists in desired state, skip cleaning up mounts", "podName", volume.podName, "volumeSpecName", volume.volumeSpecName) continue } // No pod needs the volume. - klog.Warningf("Could not construct volume information, cleanup the mounts. (pod.UID %s, volume.SpecName %s): %v", volume.podName, volume.volumeSpecName, err) + klog.InfoS("Could not construct volume information, cleaning up mounts", "podName", volume.podName, "volumeSpecName", volume.volumeSpecName, "error", err) rc.cleanupMounts(volume) continue } @@ -419,22 +419,20 @@ func (rc *reconciler) syncStates() { // this new kubelet so reconcile() calls SetUp and re-mounts the // volume if it's necessary. volumeNeedReport = append(volumeNeedReport, reconstructedVolume.volumeName) - klog.V(4).Infof("Volume exists in desired state (volume.SpecName %s, pod.UID %s), marking as InUse", volume.volumeSpecName, volume.podName) + klog.V(4).InfoS("Volume exists in desired state, marking as InUse", "podName", volume.podName, "volumeSpecName", volume.volumeSpecName) continue } // There is no pod that uses the volume. if rc.operationExecutor.IsOperationPending(reconstructedVolume.volumeName, nestedpendingoperations.EmptyUniquePodName, nestedpendingoperations.EmptyNodeName) { - klog.Warning("Volume is in pending operation, skip cleaning up mounts") + klog.InfoS("Volume is in pending operation, skip cleaning up mounts") } - klog.V(2).Infof( - "Reconciler sync states: could not find pod information in desired state, update it in actual state: %+v", - reconstructedVolume) + klog.V(2).InfoS("Reconciler sync states: could not find pod information in desired state, update it in actual state", "reconstructedVolume", reconstructedVolume) volumesNeedUpdate[reconstructedVolume.volumeName] = reconstructedVolume } if len(volumesNeedUpdate) > 0 { if err = rc.updateStates(volumesNeedUpdate); err != nil { - klog.Errorf("Error occurred during reconstruct volume from disk: %v", err) + klog.ErrorS(err, "Error occurred during reconstruct volume from disk") } } if len(volumeNeedReport) > 0 { @@ -443,8 +441,7 @@ func (rc *reconciler) syncStates() { } func (rc *reconciler) cleanupMounts(volume podVolume) { - klog.V(2).Infof("Reconciler sync states: could not find information (PID: %s) (Volume SpecName: %s) in desired state, clean up the mount points", - volume.podName, volume.volumeSpecName) + klog.V(2).InfoS("Reconciler sync states: could not find volume information in desired state, clean up the mount points", "podName", volume.podName, "volumeSpecName", volume.volumeSpecName) mountedVolume := operationexecutor.MountedVolume{ PodName: volume.podName, VolumeName: v1.UniqueVolumeName(volume.volumeSpecName), @@ -456,7 +453,7 @@ func (rc *reconciler) cleanupMounts(volume podVolume) { // to unmount both volume and device in the same routine. err := rc.operationExecutor.UnmountVolume(mountedVolume, rc.actualStateOfWorld, rc.kubeletPodsDir) if err != nil { - klog.Errorf(mountedVolume.GenerateErrorDetailed("volumeHandler.UnmountVolumeHandler for UnmountVolume failed", err).Error()) + klog.ErrorS(err, mountedVolume.GenerateErrorDetailed("volumeHandler.UnmountVolumeHandler for UnmountVolume failed", err).Error()) return } } @@ -600,13 +597,13 @@ func (rc *reconciler) reconstructVolume(volume podVolume) (*reconstructedVolume, func (rc *reconciler) updateDevicePath(volumesNeedUpdate map[v1.UniqueVolumeName]*reconstructedVolume) { node, fetchErr := rc.kubeClient.CoreV1().Nodes().Get(context.TODO(), string(rc.nodeName), metav1.GetOptions{}) if fetchErr != nil { - klog.Errorf("updateStates in reconciler: could not get node status with error %v", fetchErr) + klog.ErrorS(fetchErr, "UpdateStates in reconciler: could not get node status with error") } else { for _, attachedVolume := range node.Status.VolumesAttached { if volume, exists := volumesNeedUpdate[attachedVolume.Name]; exists { volume.devicePath = attachedVolume.DevicePath volumesNeedUpdate[attachedVolume.Name] = volume - klog.V(4).Infof("Update devicePath from node status for volume (%q): %q", attachedVolume.Name, volume.devicePath) + klog.V(4).InfoS("Update devicePath from node status for volume", "volumeName", attachedVolume.Name, "path", volume.devicePath) } } } @@ -636,7 +633,7 @@ func (rc *reconciler) updateStates(volumesNeedUpdate map[v1.UniqueVolumeName]*re //TODO: the devicePath might not be correct for some volume plugins: see issue #54108 volume.volumeName, volume.volumeSpec, "" /* nodeName */, volume.devicePath) if err != nil { - klog.Errorf("Could not add volume information to actual state of world: %v", err) + klog.ErrorS(err, "Could not add volume information to actual state of world") continue } markVolumeOpts := operationexecutor.MarkVolumeOpts{ @@ -652,23 +649,23 @@ func (rc *reconciler) updateStates(volumesNeedUpdate map[v1.UniqueVolumeName]*re } err = rc.actualStateOfWorld.MarkVolumeAsMounted(markVolumeOpts) if err != nil { - klog.Errorf("Could not add pod to volume information to actual state of world: %v", err) + klog.ErrorS(err, "Could not add pod to volume information to actual state of world") continue } - klog.V(4).Infof("Volume: %s (pod UID %s) is marked as mounted and added into the actual state", volume.volumeName, volume.podName) + klog.V(4).InfoS("Volume is marked as mounted and added into the actual state", "podName", volume.podName, "volumeName", volume.volumeName) // If the volume has device to mount, we mark its device as mounted. if volume.deviceMounter != nil || volume.blockVolumeMapper != nil { deviceMountPath, err := getDeviceMountPath(volume) if err != nil { - klog.Errorf("Could not find device mount path for volume %s", volume.volumeName) + klog.ErrorS(err, "Could not find device mount path for volume", "volumeName", volume.volumeName) continue } err = rc.actualStateOfWorld.MarkDeviceAsMounted(volume.volumeName, volume.devicePath, deviceMountPath) if err != nil { - klog.Errorf("Could not mark device is mounted to actual state of world: %v", err) + klog.ErrorS(err, "Could not mark device is mounted to actual state of world") continue } - klog.V(4).Infof("Volume: %s (pod UID %s) is marked device as mounted and added into the actual state", volume.volumeName, volume.podName) + klog.V(4).InfoS("Volume is marked device as mounted and added into the actual state", "podName", volume.podName, "volumeName", volume.volumeName) } } return nil @@ -710,13 +707,13 @@ func getVolumesFromPodDir(podDir string) ([]podVolume, error) { volumePluginPath := path.Join(volumesDir, pluginName) volumePluginDirs, err := utilpath.ReadDirNoStat(volumePluginPath) if err != nil { - klog.Errorf("Could not read volume plugin directory %q: %v", volumePluginPath, err) + klog.ErrorS(err, "Could not read volume plugin directory", "volumePluginPath", volumePluginPath) continue } unescapePluginName := utilstrings.UnescapeQualifiedName(pluginName) for _, volumeName := range volumePluginDirs { volumePath := path.Join(volumePluginPath, volumeName) - klog.V(5).Infof("podName: %v, volume path from volume plugin directory: %v, ", podName, volumePath) + klog.V(5).InfoS("Volume path from volume plugin directory", "podName", podName, "volumePath", volumePath) volumes = append(volumes, podVolume{ podName: volumetypes.UniquePodName(podName), volumeSpecName: volumeName, @@ -728,6 +725,6 @@ func getVolumesFromPodDir(podDir string) ([]podVolume, error) { } } } - klog.V(4).Infof("Get volumes from pod directory %q %+v", podDir, volumes) + klog.V(4).InfoS("Get volumes from pod directory", "path", podDir, "volumes", volumes) return volumes, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/volume_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/volume_manager.go index 86f77e517ad3..72e5f494b3db 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/volume_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/volume_manager.go @@ -24,6 +24,7 @@ import ( "strings" "time" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/klog/v2" "k8s.io/mount-utils" @@ -39,7 +40,6 @@ import ( "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/pod" "k8s.io/kubernetes/pkg/kubelet/status" - "k8s.io/kubernetes/pkg/kubelet/util/format" "k8s.io/kubernetes/pkg/kubelet/volumemanager/cache" "k8s.io/kubernetes/pkg/kubelet/volumemanager/metrics" "k8s.io/kubernetes/pkg/kubelet/volumemanager/populator" @@ -178,7 +178,7 @@ func NewVolumeManager( } intreeToCSITranslator := csitrans.New() - csiMigratedPluginManager := csimigration.NewPluginManager(intreeToCSITranslator) + csiMigratedPluginManager := csimigration.NewPluginManager(intreeToCSITranslator, utilfeature.DefaultFeatureGate) vm.intreeToCSITranslator = intreeToCSITranslator vm.csiMigratedPluginManager = csiMigratedPluginManager @@ -266,15 +266,15 @@ func (vm *volumeManager) Run(sourcesReady config.SourcesReady, stopCh <-chan str } go vm.desiredStateOfWorldPopulator.Run(sourcesReady, stopCh) - klog.V(2).Infof("The desired_state_of_world populator starts") + klog.V(2).InfoS("The desired_state_of_world populator starts") - klog.Infof("Starting Kubelet Volume Manager") + klog.InfoS("Starting Kubelet Volume Manager") go vm.reconciler.Run(stopCh) metrics.Register(vm.actualStateOfWorld, vm.desiredStateOfWorld, vm.volumePluginMgr) <-stopCh - klog.Infof("Shutting down Kubelet Volume Manager") + klog.InfoS("Shutting down Kubelet Volume Manager") } func (vm *volumeManager) GetMountedVolumesForPod(podName types.UniquePodName) container.VolumeMap { @@ -370,7 +370,7 @@ func (vm *volumeManager) WaitForAttachAndMount(pod *v1.Pod) error { return nil } - klog.V(3).Infof("Waiting for volumes to attach and mount for pod %q", format.Pod(pod)) + klog.V(3).InfoS("Waiting for volumes to attach and mount for pod", "pod", klog.KObj(pod)) uniquePodName := util.GetUniquePodName(pod) // Some pods expect to have Setup called over and over again to update. @@ -401,7 +401,7 @@ func (vm *volumeManager) WaitForAttachAndMount(pod *v1.Pod) error { err) } - klog.V(3).Infof("All volumes are attached and mounted for pod %q", format.Pod(pod)) + klog.V(3).InfoS("All volumes are attached and mounted for pod", "pod", klog.KObj(pod)) return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/network_stats.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/network_stats.go index d3acda6d54ea..242269820a99 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/network_stats.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/network_stats.go @@ -109,49 +109,49 @@ func newNetworkCounters() (*networkCounter, error) { func (n *networkCounter) getData() ([]cadvisorapi.InterfaceStats, error) { packetsReceivedPerSecondData, err := n.packetsReceivedPerSecondCounter.getDataList() if err != nil { - klog.Errorf("Unable to get packetsReceivedPerSecond perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get packetsReceivedPerSecond perf counter data") return nil, err } packetsSentPerSecondData, err := n.packetsSentPerSecondCounter.getDataList() if err != nil { - klog.Errorf("Unable to get packetsSentPerSecond perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get packetsSentPerSecond perf counter data") return nil, err } bytesReceivedPerSecondData, err := n.bytesReceivedPerSecondCounter.getDataList() if err != nil { - klog.Errorf("Unable to get bytesReceivedPerSecond perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get bytesReceivedPerSecond perf counter data") return nil, err } bytesSentPerSecondData, err := n.bytesSentPerSecondCounter.getDataList() if err != nil { - klog.Errorf("Unable to get bytesSentPerSecond perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get bytesSentPerSecond perf counter data") return nil, err } packetsReceivedDiscardedData, err := n.packetsReceivedDiscardedCounter.getDataList() if err != nil { - klog.Errorf("Unable to get packetsReceivedDiscarded perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get packetsReceivedDiscarded perf counter data") return nil, err } packetsReceivedErrorsData, err := n.packetsReceivedErrorsCounter.getDataList() if err != nil { - klog.Errorf("Unable to get packetsReceivedErrors perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get packetsReceivedErrors perf counter data") return nil, err } packetsOutboundDiscardedData, err := n.packetsOutboundDiscardedCounter.getDataList() if err != nil { - klog.Errorf("Unable to get packetsOutboundDiscarded perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get packetsOutboundDiscarded perf counter data") return nil, err } packetsOutboundErrorsData, err := n.packetsOutboundErrorsCounter.getDataList() if err != nil { - klog.Errorf("Unable to get packetsOutboundErrors perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get packetsOutboundErrors perf counter data") return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/perfcounter_nodestats.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/perfcounter_nodestats.go index 265debf096cd..11bd9153a417 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/perfcounter_nodestats.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/perfcounter_nodestats.go @@ -26,6 +26,7 @@ import ( "runtime" "strings" "sync" + "syscall" "time" "unsafe" @@ -50,10 +51,13 @@ type MemoryStatusEx struct { } var ( - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") - procGlobalMemoryStatusEx = modkernel32.NewProc("GlobalMemoryStatusEx") + modkernel32 = windows.NewLazySystemDLL("kernel32.dll") + procGlobalMemoryStatusEx = modkernel32.NewProc("GlobalMemoryStatusEx") + procGetActiveProcessorCount = modkernel32.NewProc("GetActiveProcessorCount") ) +const allProcessorGroups = 0xFFFF + // NewPerfCounterClient creates a client using perf counters func NewPerfCounterClient() (Client, error) { // Initialize the cache @@ -140,13 +144,33 @@ func (p *perfCounterNodeStatsClient) getMachineInfo() (*cadvisorapi.MachineInfo, } return &cadvisorapi.MachineInfo{ - NumCores: runtime.NumCPU(), + NumCores: processorCount(), MemoryCapacity: p.nodeInfo.memoryPhysicalCapacityBytes, MachineID: hostname, SystemUUID: systemUUID, }, nil } +// runtime.NumCPU() will only return the information for a single Processor Group. +// Since a single group can only hold 64 logical processors, this +// means when there are more they will be divided into multiple groups. +// For the above reason, procGetActiveProcessorCount is used to get the +// cpu count for all processor groups of the windows node. +// more notes for this issue: +// same issue in moby: https://github.com/moby/moby/issues/38935#issuecomment-744638345 +// solution in hcsshim: https://github.com/microsoft/hcsshim/blob/master/internal/processorinfo/processor_count.go +func processorCount() int { + if amount := getActiveProcessorCount(allProcessorGroups); amount != 0 { + return int(amount) + } + return runtime.NumCPU() +} + +func getActiveProcessorCount(groupNumber uint16) int { + r0, _, _ := syscall.Syscall(procGetActiveProcessorCount.Addr(), 1, uintptr(groupNumber), 0, 0) + return int(r0) +} + func (p *perfCounterNodeStatsClient) getVersionInfo() (*cadvisorapi.VersionInfo, error) { return &cadvisorapi.VersionInfo{ KernelVersion: p.nodeInfo.kernelVersion, @@ -168,25 +192,25 @@ func (p *perfCounterNodeStatsClient) collectMetricsData(cpuCounter, memWorkingSe cpuValue, err := cpuCounter.getData() cpuCores := runtime.NumCPU() if err != nil { - klog.Errorf("Unable to get cpu perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get cpu perf counter data") return } memWorkingSetValue, err := memWorkingSetCounter.getData() if err != nil { - klog.Errorf("Unable to get memWorkingSet perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get memWorkingSet perf counter data") return } memCommittedBytesValue, err := memCommittedBytesCounter.getData() if err != nil { - klog.Errorf("Unable to get memCommittedBytes perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get memCommittedBytes perf counter data") return } networkAdapterStats, err := networkAdapterCounter.getData() if err != nil { - klog.Errorf("Unable to get network adapter perf counter data; err: %v", err) + klog.ErrorS(err, "Unable to get network adapter perf counter data") return } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/probe/http/http.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/probe/http/http.go index 5e04ff28be73..ad034ee3fa4a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/probe/http/http.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/probe/http/http.go @@ -94,10 +94,10 @@ func DoHTTPProbe(url *url.URL, headers http.Header, client GetHTTPInterface) (pr // Convert errors into failures to catch timeouts. return probe.Failure, err.Error(), nil } + if headers == nil { + headers = http.Header{} + } if _, ok := headers["User-Agent"]; !ok { - if headers == nil { - headers = http.Header{} - } // explicitly set User-Agent so it's not set to default Go value v := version.Get() headers.Set("User-Agent", fmt.Sprintf("kube-probe/%s.%s", v.Major, v.Minor)) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpoints.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpoints.go index 0ef4a73e1b57..af1be8749323 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpoints.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpoints.go @@ -50,6 +50,9 @@ type BaseEndpointInfo struct { IsLocal bool Topology map[string]string + // ZoneHints represent the zone hints for the endpoint. This is based on + // endpoint.hints.forZones[*].name in the EndpointSlice API. + ZoneHints sets.String // Ready indicates whether this endpoint is ready and NOT terminating. // For pods, this is true if a pod has a ready status and a nil deletion timestamp. // This is only set when watching EndpointSlices. If using Endpoints, this is always @@ -102,6 +105,11 @@ func (info *BaseEndpointInfo) GetTopology() map[string]string { return info.Topology } +// GetZoneHints returns the zone hint for the endpoint. +func (info *BaseEndpointInfo) GetZoneHints() sets.String { + return info.ZoneHints +} + // IP returns just the IP part of the endpoint, it's a part of proxy.Endpoint interface. func (info *BaseEndpointInfo) IP() string { return utilproxy.IPPart(info.Endpoint) @@ -118,7 +126,7 @@ func (info *BaseEndpointInfo) Equal(other Endpoint) bool { } func newBaseEndpointInfo(IP string, port int, isLocal bool, topology map[string]string, - ready, serving, terminating bool) *BaseEndpointInfo { + ready, serving, terminating bool, zoneHints sets.String) *BaseEndpointInfo { return &BaseEndpointInfo{ Endpoint: net.JoinHostPort(IP, strconv.Itoa(port)), IsLocal: isLocal, @@ -126,6 +134,7 @@ func newBaseEndpointInfo(IP string, port int, isLocal bool, topology map[string] Ready: ready, Serving: serving, Terminating: terminating, + ZoneHints: zoneHints, } } @@ -155,6 +164,11 @@ type EndpointChangeTracker struct { // Map from the Endpoints namespaced-name to the times of the triggers that caused the endpoints // object to change. Used to calculate the network-programming-latency. lastChangeTriggerTimes map[types.NamespacedName][]time.Time + // record the time when the endpointChangeTracker was created so we can ignore the endpoints + // that were generated before, because we can't estimate the network-programming-latency on those. + // This is specially problematic on restarts, because we process all the endpoints that may have been + // created hours or days before. + trackerStartTime time.Time } // NewEndpointChangeTracker initializes an EndpointsChangeMap @@ -166,6 +180,7 @@ func NewEndpointChangeTracker(hostname string, makeEndpointInfo makeEndpointFunc ipFamily: ipFamily, recorder: recorder, lastChangeTriggerTimes: make(map[types.NamespacedName][]time.Time), + trackerStartTime: time.Now(), processEndpointsMapChange: processEndpointsMapChange, } if endpointSlicesEnabled { @@ -207,7 +222,7 @@ func (ect *EndpointChangeTracker) Update(previous, current *v1.Endpoints) bool { // In case of Endpoints deletion, the LastChangeTriggerTime annotation is // by-definition coming from the time of last update, which is not what // we want to measure. So we simply ignore it in this cases. - if t := getLastChangeTriggerTime(endpoints.Annotations); !t.IsZero() && current != nil { + if t := getLastChangeTriggerTime(endpoints.Annotations); !t.IsZero() && current != nil && t.After(ect.trackerStartTime) { ect.lastChangeTriggerTimes[namespacedName] = append(ect.lastChangeTriggerTimes[namespacedName], t) } @@ -267,7 +282,7 @@ func (ect *EndpointChangeTracker) EndpointSliceUpdate(endpointSlice *discovery.E // we want to measure. So we simply ignore it in this cases. // TODO(wojtek-t, robscott): Address the problem for EndpointSlice deletion // when other EndpointSlice for that service still exist. - if t := getLastChangeTriggerTime(endpointSlice.Annotations); !t.IsZero() && !removeSlice { + if t := getLastChangeTriggerTime(endpointSlice.Annotations); !t.IsZero() && !removeSlice && t.After(ect.trackerStartTime) { ect.lastChangeTriggerTimes[namespacedName] = append(ect.lastChangeTriggerTimes[namespacedName], t) } @@ -427,8 +442,10 @@ func (ect *EndpointChangeTracker) endpointsToEndpointsMap(endpoints *v1.Endpoint isServing := true isTerminating := false isLocal := addr.NodeName != nil && *addr.NodeName == ect.hostname + // Only supported with EndpointSlice API + zoneHints := sets.String{} - baseEndpointInfo := newBaseEndpointInfo(addr.IP, int(port.Port), isLocal, nil, isReady, isServing, isTerminating) + baseEndpointInfo := newBaseEndpointInfo(addr.IP, int(port.Port), isLocal, nil, isReady, isServing, isTerminating, zoneHints) if ect.makeEndpointInfo != nil { endpointsMap[svcPortName] = append(endpointsMap[svcPortName], ect.makeEndpointInfo(baseEndpointInfo)) } else { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpointslicecache.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpointslicecache.go index 572b68b7ba16..ec3bb8b3292a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpointslicecache.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpointslicecache.go @@ -26,8 +26,11 @@ import ( v1 "k8s.io/api/core/v1" discovery "k8s.io/api/discovery/v1beta1" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/sets" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/tools/record" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/features" utilproxy "k8s.io/kubernetes/pkg/proxy/util" utilnet "k8s.io/utils/net" ) @@ -78,6 +81,7 @@ type endpointInfo struct { Addresses []string NodeName *string Topology map[string]string + ZoneHints sets.String Ready bool Serving bool @@ -136,6 +140,15 @@ func newEndpointSliceInfo(endpointSlice *discovery.EndpointSlice, remove bool) * epInfo.NodeName = endpoint.NodeName + if utilfeature.DefaultFeatureGate.Enabled(features.TopologyAwareHints) { + if endpoint.Hints != nil && len(endpoint.Hints.ForZones) > 0 { + epInfo.ZoneHints = sets.String{} + for _, zone := range endpoint.Hints.ForZones { + epInfo.ZoneHints.Insert(zone.Name) + } + } + } + esInfo.Endpoints = append(esInfo.Endpoints, epInfo) } @@ -275,7 +288,7 @@ func (cache *EndpointSliceCache) addEndpointsByIP(serviceNN types.NamespacedName } endpointInfo := newBaseEndpointInfo(endpoint.Addresses[0], portNum, isLocal, endpoint.Topology, - endpoint.Ready, endpoint.Serving, endpoint.Terminating) + endpoint.Ready, endpoint.Serving, endpoint.Terminating, endpoint.ZoneHints) // This logic ensures we're deduping potential overlapping endpoints // isLocal should not vary between matching IPs, but if it does, we diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/iptables/proxier.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/iptables/proxier.go index 292e05aa8522..d186060396a7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/iptables/proxier.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/iptables/proxier.go @@ -668,8 +668,12 @@ func (proxier *Proxier) OnNodeAdd(node *v1.Node) { } proxier.mu.Lock() - proxier.nodeLabels = node.Labels + proxier.nodeLabels = map[string]string{} + for k, v := range node.Labels { + proxier.nodeLabels[k] = v + } proxier.mu.Unlock() + klog.V(4).InfoS("Updated proxier node labels", "labels", node.Labels) proxier.syncProxyRules() } @@ -688,8 +692,12 @@ func (proxier *Proxier) OnNodeUpdate(oldNode, node *v1.Node) { } proxier.mu.Lock() - proxier.nodeLabels = node.Labels + proxier.nodeLabels = map[string]string{} + for k, v := range node.Labels { + proxier.nodeLabels[k] = v + } proxier.mu.Unlock() + klog.V(4).InfoS("Updated proxier node labels", "labels", node.Labels) proxier.syncProxyRules() } @@ -1020,22 +1028,12 @@ func (proxier *Proxier) syncProxyRules() { allEndpoints := proxier.endpointsMap[svcName] - // Service Topology will not be enabled in the following cases: - // 1. externalTrafficPolicy=Local (mutually exclusive with service topology). - // 2. ServiceTopology is not enabled. - // 3. EndpointSlice is not enabled (service topology depends on endpoint slice - // to get topology information). - if !svcInfo.NodeLocalExternal() && utilfeature.DefaultFeatureGate.Enabled(features.ServiceTopology) && utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceProxying) { - allEndpoints = proxy.FilterTopologyEndpoint(proxier.nodeLabels, svcInfo.TopologyKeys(), allEndpoints) - } + // Filtering for topology aware endpoints. This function will only + // filter endpoints if appropriate feature gates are enabled and the + // Service does not have conflicting configuration such as + // externalTrafficPolicy=Local. + allEndpoints = proxy.FilterEndpoints(allEndpoints, svcInfo, proxier.nodeLabels) - // Service InternalTrafficPolicy is only enabled when all of the - // following are true: - // 1. InternalTrafficPolicy is Local - // 2. ServiceInternalTrafficPolicy feature gate is on - if utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) && svcInfo.NodeLocalInternal() { - allEndpoints = proxy.FilterLocalEndpoint(svcInfo.InternalTrafficPolicy(), allEndpoints) - } readyEndpoints := make([]proxy.Endpoint, 0, len(allEndpoints)) for _, endpoint := range allEndpoints { if !endpoint.IsReady() { @@ -1072,23 +1070,22 @@ func (proxier *Proxier) syncProxyRules() { // Capture the clusterIP. if hasEndpoints { args = append(args[:0], - "-A", string(kubeServicesChain), "-m", "comment", "--comment", fmt.Sprintf(`"%s cluster IP"`, svcNameString), "-m", protocol, "-p", protocol, "-d", utilproxy.ToCIDR(svcInfo.ClusterIP()), "--dport", strconv.Itoa(svcInfo.Port()), ) if proxier.masqueradeAll { - utilproxy.WriteLine(proxier.natRules, append(args, "-j", string(KubeMarkMasqChain))...) + utilproxy.WriteRuleLine(proxier.natRules, string(svcChain), append(args, "-j", string(KubeMarkMasqChain))...) } else if proxier.localDetector.IsImplemented() { // This masquerades off-cluster traffic to a service VIP. The idea // is that you can establish a static route for your Service range, // routing to any node, and that node will bridge into the Service // for you. Since that might bounce off-node, we masquerade here. // If/when we support "Local" policy for VIPs, we should update this. - utilproxy.WriteLine(proxier.natRules, proxier.localDetector.JumpIfNotLocal(args, string(KubeMarkMasqChain))...) + utilproxy.WriteRuleLine(proxier.natRules, string(svcChain), proxier.localDetector.JumpIfNotLocal(args, string(KubeMarkMasqChain))...) } - utilproxy.WriteLine(proxier.natRules, append(args, "-j", string(svcChain))...) + utilproxy.WriteRuleLine(proxier.natRules, string(kubeServicesChain), append(args, "-j", string(svcChain))...) } else { // No endpoints. utilproxy.WriteLine(proxier.filterRules, @@ -1120,7 +1117,7 @@ func (proxier *Proxier) syncProxyRules() { } else { socket, err := proxier.portMapper.OpenLocalPort(&lp) if err != nil { - msg := fmt.Sprintf("can't open %s, skipping this externalIP: %v", lp.String(), err) + msg := fmt.Sprintf("can't open port %s, skipping it", lp.String()) proxier.recorder.Eventf( &v1.ObjectReference{ @@ -1129,7 +1126,7 @@ func (proxier *Proxier) syncProxyRules() { UID: types.UID(proxier.hostname), Namespace: "", }, v1.EventTypeWarning, err.Error(), msg) - klog.ErrorS(err, "can't open port, skipping externalIP", "port", lp.String()) + klog.ErrorS(err, "can't open port, skipping it", "port", lp.String()) continue } klog.V(2).InfoS("Opened local port", "port", lp.String()) @@ -1139,7 +1136,6 @@ func (proxier *Proxier) syncProxyRules() { if hasEndpoints { args = append(args[:0], - "-A", string(kubeServicesChain), "-m", "comment", "--comment", fmt.Sprintf(`"%s external IP"`, svcNameString), "-m", protocol, "-p", protocol, "-d", utilproxy.ToCIDR(net.ParseIP(externalIP)), @@ -1155,13 +1151,13 @@ func (proxier *Proxier) syncProxyRules() { destChain = svcChain // This masquerades off-cluster traffic to a External IP. if proxier.localDetector.IsImplemented() { - utilproxy.WriteLine(proxier.natRules, proxier.localDetector.JumpIfNotLocal(args, string(KubeMarkMasqChain))...) + utilproxy.WriteRuleLine(proxier.natRules, string(svcChain), proxier.localDetector.JumpIfNotLocal(args, string(KubeMarkMasqChain))...) } else { - utilproxy.WriteLine(proxier.natRules, append(args, "-j", string(KubeMarkMasqChain))...) + utilproxy.WriteRuleLine(proxier.natRules, string(svcChain), append(args, "-j", string(KubeMarkMasqChain))...) } } - // Sent traffic bound for external IPs to the service chain. - utilproxy.WriteLine(proxier.natRules, append(args, "-j", string(destChain))...) + // Send traffic bound for external IPs to the service chain. + utilproxy.WriteRuleLine(proxier.natRules, string(kubeServicesChain), append(args, "-j", string(destChain))...) } else { // No endpoints. @@ -1293,7 +1289,16 @@ func (proxier *Proxier) syncProxyRules() { } else if svcInfo.Protocol() != v1.ProtocolSCTP { socket, err := proxier.portMapper.OpenLocalPort(&lp) if err != nil { - klog.ErrorS(err, "can't open port, skipping this nodePort", "port", lp.String()) + msg := fmt.Sprintf("can't open port %s, skipping it", lp.String()) + + proxier.recorder.Eventf( + &v1.ObjectReference{ + Kind: "Node", + Name: proxier.hostname, + UID: types.UID(proxier.hostname), + Namespace: "", + }, v1.EventTypeWarning, err.Error(), msg) + klog.ErrorS(err, "can't open port, skipping it", "port", lp.String()) continue } klog.V(2).InfoS("Opened local port", "port", lp.String()) @@ -1303,16 +1308,15 @@ func (proxier *Proxier) syncProxyRules() { if hasEndpoints { args = append(args[:0], - "-A", string(kubeNodePortsChain), "-m", "comment", "--comment", svcNameString, "-m", protocol, "-p", protocol, "--dport", strconv.Itoa(svcInfo.NodePort()), ) if !svcInfo.NodeLocalExternal() { // Nodeports need SNAT, unless they're local. - utilproxy.WriteLine(proxier.natRules, append(args, "-j", string(KubeMarkMasqChain))...) + utilproxy.WriteRuleLine(proxier.natRules, string(svcChain), append(args, "-j", string(KubeMarkMasqChain))...) // Jump to the service chain. - utilproxy.WriteLine(proxier.natRules, append(args, "-j", string(svcChain))...) + utilproxy.WriteRuleLine(proxier.natRules, string(kubeNodePortsChain), append(args, "-j", string(svcChain))...) } else { // TODO: Make all nodePorts jump to the firewall chain. // Currently we only create it for loadbalancers (#33586). @@ -1322,8 +1326,8 @@ func (proxier *Proxier) syncProxyRules() { if isIPv6 { loopback = "::1/128" } - utilproxy.WriteLine(proxier.natRules, append(args, "-s", loopback, "-j", string(KubeMarkMasqChain))...) - utilproxy.WriteLine(proxier.natRules, append(args, "-j", string(svcXlbChain))...) + utilproxy.WriteRuleLine(proxier.natRules, string(kubeNodePortsChain), append(args, "-s", loopback, "-j", string(KubeMarkMasqChain))...) + utilproxy.WriteRuleLine(proxier.natRules, string(kubeNodePortsChain), append(args, "-j", string(svcXlbChain))...) } } else { // No endpoints. @@ -1616,7 +1620,7 @@ func (proxier *Proxier) syncProxyRules() { numberNatIptablesRules := utilproxy.CountBytesLines(proxier.natRules.Bytes()) metrics.IptablesRulesTotal.WithLabelValues(string(utiliptables.TableNAT)).Set(float64(numberNatIptablesRules)) - klog.V(5).InfoS("Restoring iptables", "rules", proxier.iptablesData.Bytes()) + klog.V(5).InfoS("Restoring iptables", "rules", string(proxier.iptablesData.Bytes())) err = proxier.iptables.RestoreAll(proxier.iptablesData.Bytes(), utiliptables.NoFlushTables, utiliptables.RestoreCounters) if err != nil { klog.ErrorS(err, "Failed to execute iptables-restore") diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/OWNERS index 436971313b50..5e3e0a9c5798 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/OWNERS @@ -6,12 +6,14 @@ reviewers: - Lion-Wei - andrewsykim - lbernail +- uablrek approvers: - sig-network-approvers - brendandburns - m1093782566 - andrewsykim - lbernail +- uablrek labels: - sig/network - area/ipvs diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/README.md b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/README.md index 9f8bb09a068f..895dcb97975a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/README.md +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/README.md @@ -365,7 +365,7 @@ or similar logs occur in kube-proxy logs (for example, `/tmp/kube-proxy.log` for Using ipvs Proxier. ``` -While there is no IPVS proxy rules or the following logs ocuurs indicate that the kube-proxy fails to use IPVS mode: +While there is no IPVS proxy rules or the following logs occurs indicate that the kube-proxy fails to use IPVS mode: ``` Can't use ipvs proxier, trying iptables proxier Using iptables Proxier. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/proxier.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/proxier.go index 2656b52caa20..de0bc4032c53 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/proxier.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/proxier.go @@ -300,7 +300,8 @@ type realIPGetter struct { // 172.17.0.1 dev docker0 scope host src 172.17.0.1 // 192.168.122.1 dev virbr0 scope host src 192.168.122.1 // Then filter out dev==kube-ipvs0, and cut the unique src IP fields, -// Node IP set: [100.106.89.164, 127.0.0.1, 172.17.0.1, 192.168.122.1] +// Node IP set: [100.106.89.164, 172.17.0.1, 192.168.122.1] +// Note that loopback addresses are excluded. func (r *realIPGetter) NodeIPs() (ips []net.IP, err error) { // Pass in empty filter device name for list all LOCAL type addresses. nodeAddress, err := r.nl.GetLocalAddresses("", DefaultDummyDevice) @@ -309,7 +310,11 @@ func (r *realIPGetter) NodeIPs() (ips []net.IP, err error) { } // translate ip string to IP for _, ipStr := range nodeAddress.UnsortedList() { - ips = append(ips, net.ParseIP(ipStr)) + a := net.ParseIP(ipStr) + if a.IsLoopback() { + continue + } + ips = append(ips, a) } return ips, nil } @@ -322,21 +327,6 @@ func (r *realIPGetter) BindedIPs() (sets.String, error) { // Proxier implements proxy.Provider var _ proxy.Provider = &Proxier{} -// parseExcludedCIDRs parses the input strings and returns net.IPNet -// The validation has been done earlier so the error condition will never happen under normal conditions -func parseExcludedCIDRs(excludeCIDRs []string) []*net.IPNet { - var cidrExclusions []*net.IPNet - for _, excludedCIDR := range excludeCIDRs { - _, n, err := net.ParseCIDR(excludedCIDR) - if err != nil { - klog.Errorf("Error parsing exclude CIDR %q, err: %v", excludedCIDR, err) - continue - } - cidrExclusions = append(cidrExclusions, n) - } - return cidrExclusions -} - // NewProxier returns a new Proxier given an iptables and ipvs Interface instance. // Because of the iptables and ipvs logic, it is assumed that there is only a single Proxier active on a machine. // An error will be returned if it fails to update or acquire the initial lock. @@ -457,6 +447,9 @@ func NewProxier(ipt utiliptables.Interface, klog.Warningf("IP Family: %s, NodePortAddresses of wrong family; %s", ipFamily, strings.Join(ips, ",")) } + // excludeCIDRs has been validated before, here we just parse it to IPNet list + parsedExcludeCIDRs, _ := utilnet.ParseCIDRs(excludeCIDRs) + proxier := &Proxier{ ipFamily: ipFamily, portsMap: make(map[utilnet.LocalPort]utilnet.Closeable), @@ -466,7 +459,7 @@ func NewProxier(ipt utiliptables.Interface, endpointsChanges: proxy.NewEndpointChangeTracker(hostname, nil, ipFamily, recorder, endpointSlicesEnabled, nil), syncPeriod: syncPeriod, minSyncPeriod: minSyncPeriod, - excludeCIDRs: parseExcludedCIDRs(excludeCIDRs), + excludeCIDRs: parsedExcludeCIDRs, iptables: ipt, masqueradeAll: masqueradeAll, masqueradeMark: masqueradeMark, @@ -976,8 +969,12 @@ func (proxier *Proxier) OnNodeAdd(node *v1.Node) { } proxier.mu.Lock() - proxier.nodeLabels = node.Labels + proxier.nodeLabels = map[string]string{} + for k, v := range node.Labels { + proxier.nodeLabels[k] = v + } proxier.mu.Unlock() + klog.V(4).InfoS("Updated proxier node labels", "labels", node.Labels) proxier.syncProxyRules() } @@ -995,8 +992,12 @@ func (proxier *Proxier) OnNodeUpdate(oldNode, node *v1.Node) { } proxier.mu.Lock() - proxier.nodeLabels = node.Labels + proxier.nodeLabels = map[string]string{} + for k, v := range node.Labels { + proxier.nodeLabels[k] = v + } proxier.mu.Unlock() + klog.V(4).InfoS("Updated proxier node labels", "labels", node.Labels) proxier.syncProxyRules() } @@ -1131,6 +1132,10 @@ func (proxier *Proxier) syncProxyRules() { } else { nodeAddresses = nodeAddrSet.List() for _, address := range nodeAddresses { + a := net.ParseIP(address) + if a.IsLoopback() { + continue + } if utilproxy.IsZeroCIDR(address) { nodeIPs, err = proxier.ipGetter.NodeIPs() if err != nil { @@ -1138,7 +1143,7 @@ func (proxier *Proxier) syncProxyRules() { } break } - nodeIPs = append(nodeIPs, net.ParseIP(address)) + nodeIPs = append(nodeIPs, a) } } } @@ -1263,7 +1268,7 @@ func (proxier *Proxier) syncProxyRules() { } else { socket, err := proxier.portMapper.OpenLocalPort(&lp) if err != nil { - msg := fmt.Sprintf("can't open %s, skipping this externalIP: %v", lp.String(), err) + msg := fmt.Sprintf("can't open port %s, skipping it", lp.String()) proxier.recorder.Eventf( &v1.ObjectReference{ @@ -1272,7 +1277,7 @@ func (proxier *Proxier) syncProxyRules() { UID: types.UID(proxier.hostname), Namespace: "", }, v1.EventTypeWarning, err.Error(), msg) - klog.Error(msg) + klog.ErrorS(err, "can't open port, skipping it", "port", lp.String()) continue } klog.V(2).Infof("Opened local port %s", lp.String()) @@ -1466,7 +1471,16 @@ func (proxier *Proxier) syncProxyRules() { } else if svcInfo.Protocol() != v1.ProtocolSCTP { socket, err := proxier.portMapper.OpenLocalPort(&lp) if err != nil { - klog.Errorf("can't open %s, skipping this nodePort: %v", lp.String(), err) + msg := fmt.Sprintf("can't open port %s, skipping it", lp.String()) + + proxier.recorder.Eventf( + &v1.ObjectReference{ + Kind: "Node", + Name: proxier.hostname, + UID: types.UID(proxier.hostname), + Namespace: "", + }, v1.EventTypeWarning, err.Error(), msg) + klog.ErrorS(err, "can't open port, skipping it", "port", lp.String()) continue } klog.V(2).Infof("Opened local port %s", lp.String()) @@ -2057,21 +2071,15 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode endpoints := proxier.endpointsMap[svcPortName] - // Service Topology will not be enabled in the following cases: - // 1. externalTrafficPolicy=Local (mutually exclusive with service topology). - // 2. ServiceTopology is not enabled. - // 3. EndpointSlice is not enabled (service topology depends on endpoint slice - // to get topology information). - if !onlyNodeLocalEndpoints && utilfeature.DefaultFeatureGate.Enabled(features.ServiceTopology) && utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceProxying) { - endpoints = proxy.FilterTopologyEndpoint(proxier.nodeLabels, proxier.serviceMap[svcPortName].TopologyKeys(), endpoints) - } - - // Service InternalTrafficPolicy is only enabled when all of the - // following are true: - // 1. InternalTrafficPolicy is PreferLocal or Local - // 2. ServiceInternalTrafficPolicy feature gate is on - if utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) && onlyNodeLocalEndpointsForInternal { - endpoints = proxy.FilterLocalEndpoint(proxier.serviceMap[svcPortName].InternalTrafficPolicy(), endpoints) + // Filtering for topology aware endpoints. This function will only + // filter endpoints if appropriate feature gates are enabled and the + // Service does not have conflicting configuration such as + // externalTrafficPolicy=Local. + svcInfo, ok := proxier.serviceMap[svcPortName] + if !ok { + klog.Warningf("Unable to filter endpoints due to missing Service info for %s", svcPortName) + } else { + endpoints = proxy.FilterEndpoints(endpoints, svcInfo, proxier.nodeLabels) } for _, epInfo := range endpoints { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/metaproxier/meta_proxier.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/metaproxier/meta_proxier.go index 20b0413ea0f0..40a570d2b3d2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/metaproxier/meta_proxier.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/metaproxier/meta_proxier.go @@ -216,3 +216,31 @@ func endpointsIPFamily(endpoints *v1.Endpoints) (*v1.IPFamily, error) { return &ipv4, nil } + +// OnNodeAdd is called whenever creation of new node object is observed. +func (proxier *metaProxier) OnNodeAdd(node *v1.Node) { + proxier.ipv4Proxier.OnNodeAdd(node) + proxier.ipv6Proxier.OnNodeAdd(node) +} + +// OnNodeUpdate is called whenever modification of an existing +// node object is observed. +func (proxier *metaProxier) OnNodeUpdate(oldNode, node *v1.Node) { + proxier.ipv4Proxier.OnNodeUpdate(oldNode, node) + proxier.ipv6Proxier.OnNodeUpdate(oldNode, node) +} + +// OnNodeDelete is called whenever deletion of an existing node +// object is observed. +func (proxier *metaProxier) OnNodeDelete(node *v1.Node) { + proxier.ipv4Proxier.OnNodeDelete(node) + proxier.ipv6Proxier.OnNodeDelete(node) + +} + +// OnNodeSynced is called once all the initial event handlers were +// called and the state is fully propagated to local cache. +func (proxier *metaProxier) OnNodeSynced() { + proxier.ipv4Proxier.OnNodeSynced() + proxier.ipv6Proxier.OnNodeSynced() +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/service.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/service.go index a78930944a14..d56e0aed81a0 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/service.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/service.go @@ -55,6 +55,7 @@ type BaseServiceInfo struct { nodeLocalInternal bool internalTrafficPolicy *v1.ServiceInternalTrafficPolicyType topologyKeys []string + hintsAnnotation string } var _ ServicePort = &BaseServiceInfo{} @@ -138,6 +139,11 @@ func (info *BaseServiceInfo) TopologyKeys() []string { return info.topologyKeys } +// HintsAnnotation is part of ServicePort interface. +func (info *BaseServiceInfo) HintsAnnotation() string { + return info.hintsAnnotation +} + func (sct *ServiceChangeTracker) newBaseServiceInfo(port *v1.ServicePort, service *v1.Service) *BaseServiceInfo { nodeLocalExternal := false if apiservice.RequestsOnlyLocalTraffic(service) { @@ -165,6 +171,7 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *v1.ServicePort, servic nodeLocalInternal: nodeLocalInternal, internalTrafficPolicy: service.Spec.InternalTrafficPolicy, topologyKeys: service.Spec.TopologyKeys, + hintsAnnotation: service.Annotations[v1.AnnotationTopologyAwareHints], } loadBalancerSourceRanges := make([]string, len(service.Spec.LoadBalancerSourceRanges)) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/topology.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/topology.go index b272f3652575..377cc65184cf 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/topology.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/topology.go @@ -19,11 +19,80 @@ package proxy import ( v1 "k8s.io/api/core/v1" utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/features" ) -// FilterTopologyEndpoint returns the appropriate endpoints based on the cluster -// topology. +// FilterEndpoints filters endpoints based on Service configuration, node +// labels, and enabled feature gates. This is primarily used to enable topology +// aware routing. +func FilterEndpoints(endpoints []Endpoint, svcInfo ServicePort, nodeLabels map[string]string) []Endpoint { + if svcInfo.NodeLocalExternal() || !utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceProxying) { + return endpoints + } + + if utilfeature.DefaultFeatureGate.Enabled(features.ServiceTopology) { + return deprecatedTopologyFilter(nodeLabels, svcInfo.TopologyKeys(), endpoints) + } + + if utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) && svcInfo.NodeLocalInternal() { + return filterEndpointsInternalTrafficPolicy(svcInfo.InternalTrafficPolicy(), endpoints) + } + + if utilfeature.DefaultFeatureGate.Enabled(features.TopologyAwareHints) { + return filterEndpointsWithHints(endpoints, svcInfo.HintsAnnotation(), nodeLabels) + } + + return endpoints +} + +// filterEndpointsWithHints provides filtering based on the hints included in +// EndpointSlices. If any of the following are true, the full list of endpoints +// will be returned without any filtering: +// * The AnnotationTopologyAwareHints annotation is not set to "Auto" for this +// Service. +// * No zone is specified in node labels. +// * No endpoints for this Service have a hint pointing to the zone this +// instance of kube-proxy is running in. +// * One or more endpoints for this Service do not have hints specified. +func filterEndpointsWithHints(endpoints []Endpoint, hintsAnnotation string, nodeLabels map[string]string) []Endpoint { + if hintsAnnotation != "Auto" && hintsAnnotation != "auto" { + if hintsAnnotation != "" && hintsAnnotation != "Disabled" && hintsAnnotation != "disabled" { + klog.Warningf("Skipping topology aware endpoint filtering since Service has unexpected value for %s annotation: %s", v1.AnnotationTopologyAwareHints, hintsAnnotation) + } + return endpoints + } + + zone, ok := nodeLabels[v1.LabelTopologyZone] + if !ok || zone == "" { + klog.Warningf("Skipping topology aware endpoint filtering since node is missing %s label", v1.LabelTopologyZone) + return endpoints + } + + filteredEndpoints := []Endpoint{} + + for _, endpoint := range endpoints { + if endpoint.GetZoneHints().Len() == 0 { + klog.Warningf("Skipping topology aware endpoint filtering since one or more endpoints is missing a zone hint") + return endpoints + } + if endpoint.GetZoneHints().Has(zone) { + filteredEndpoints = append(filteredEndpoints, endpoint) + } + } + + if len(filteredEndpoints) > 0 { + klog.Warningf("Skipping topology aware endpoint filtering since no hints were provided for zone %s", zone) + return filteredEndpoints + } + + return endpoints +} + +// deprecatedTopologyFilter returns the appropriate endpoints based on the +// cluster topology. This will be removed in an upcoming release along with the +// ServiceTopology feature gate. +// // This uses the current node's labels, which contain topology information, and // the required topologyKeys to find appropriate endpoints. If both the endpoint's // topology and the current node have matching values for topologyKeys[0], the @@ -40,7 +109,7 @@ import ( // // If topologyKeys is not specified or empty, no topology constraints will be // applied and this will return all endpoints. -func FilterTopologyEndpoint(nodeLabels map[string]string, topologyKeys []string, endpoints []Endpoint) []Endpoint { +func deprecatedTopologyFilter(nodeLabels map[string]string, topologyKeys []string, endpoints []Endpoint) []Endpoint { // Do not filter endpoints if service has no topology keys. if len(topologyKeys) == 0 { return endpoints @@ -81,13 +150,13 @@ func FilterTopologyEndpoint(nodeLabels map[string]string, topologyKeys []string, return filteredEndpoints } -// FilterLocalEndpoint returns the node local endpoints based on configured -// InternalTrafficPolicy. +// filterEndpointsInternalTrafficPolicy returns the node local endpoints based +// on configured InternalTrafficPolicy. // // If ServiceInternalTrafficPolicy feature gate is off, returns the original -// endpoints slice. +// EndpointSlice. // Otherwise, if InternalTrafficPolicy is Local, only return the node local endpoints. -func FilterLocalEndpoint(internalTrafficPolicy *v1.ServiceInternalTrafficPolicyType, endpoints []Endpoint) []Endpoint { +func filterEndpointsInternalTrafficPolicy(internalTrafficPolicy *v1.ServiceInternalTrafficPolicyType, endpoints []Endpoint) []Endpoint { if !utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) { return endpoints } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/types.go index 9085bf0c7434..a33d6ba145e6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/types.go @@ -22,6 +22,7 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/kubernetes/pkg/proxy/config" ) @@ -91,6 +92,8 @@ type ServicePort interface { InternalTrafficPolicy() *v1.ServiceInternalTrafficPolicyType // TopologyKeys returns service TopologyKeys as a string array. TopologyKeys() []string + // HintsAnnotation returns the value of the v1.AnnotationTopologyAwareHints annotation. + HintsAnnotation() string } // Endpoint in an interface which abstracts information about an endpoint. @@ -117,6 +120,9 @@ type Endpoint interface { IsTerminating() bool // GetTopology returns the topology information of the endpoint. GetTopology() map[string]string + // GetZoneHint returns the zone hint for the endpoint. This is based on + // endpoint.hints.forZones[0].name in the EndpointSlice API. + GetZoneHints() sets.String // IP returns IP part of the endpoint. IP() string // Port returns the Port part of the endpoint. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/util/utils.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/util/utils.go index 9ec44c2de5a4..57744f10abb1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/util/utils.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/util/utils.go @@ -162,7 +162,7 @@ func GetLocalAddrs() ([]net.IP, error) { func GetLocalAddrSet() utilnet.IPSet { localAddrs, err := GetLocalAddrs() if err != nil { - klog.ErrorS(err, "Failed to get local addresses assuming no local IPs", err) + klog.ErrorS(err, "Failed to get local addresses assuming no local IPs") } else if len(localAddrs) == 0 { klog.InfoS("No local addresses were found") } @@ -477,6 +477,18 @@ func WriteLine(buf *bytes.Buffer, words ...string) { } } +// WriteRuleLine prepends the strings "-A" and chainName to the buffer and calls +// WriteLine to join all the words into the buffer and terminate with newline. +func WriteRuleLine(buf *bytes.Buffer, chainName string, words ...string) { + if len(words) == 0 { + return + } + buf.WriteString("-A ") + buf.WriteString(chainName) + buf.WriteByte(' ') + WriteLine(buf, words...) +} + // WriteBytesLine write bytes to buffer, terminate with newline func WriteBytesLine(buf *bytes.Buffer, bytes []byte) { buf.Write(bytes) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/winkernel/proxier.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/winkernel/proxier.go index fa585a62403b..382d8023d736 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/winkernel/proxier.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/winkernel/proxier.go @@ -37,6 +37,7 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/tools/record" @@ -201,6 +202,11 @@ func (info *endpointsInfo) GetTopology() map[string]string { return nil } +// GetZoneHint returns the zone hint for the endpoint. +func (info *endpointsInfo) GetZoneHints() sets.String { + return sets.String{} +} + // IP returns just the IP part of the endpoint, it's a part of proxy.Endpoint interface. func (info *endpointsInfo) IP() string { return info.ip @@ -404,7 +410,9 @@ func (proxier *Proxier) newServiceInfo(port *v1.ServicePort, service *v1.Service } for _, ingress := range service.Status.LoadBalancer.Ingress { - info.loadBalancerIngressIPs = append(info.loadBalancerIngressIPs, &loadBalancerIngressInfo{ip: ingress.IP}) + if net.ParseIP(ingress.IP) != nil { + info.loadBalancerIngressIPs = append(info.loadBalancerIngressIPs, &loadBalancerIngressInfo{ip: ingress.IP}) + } } return info } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/types_pluginargs.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/types_pluginargs.go index 4759d8fedee0..30e9542edd9e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/types_pluginargs.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/types_pluginargs.go @@ -134,7 +134,7 @@ type RequestedToCapacityRatioArgs struct { Shape []UtilizationShapePoint // Resources to be considered when scoring. // The default resource set includes "cpu" and "memory" with an equal weight. - // Allowed weights go from 1 to 100. + // Weights should be larger than 0. Resources []ResourceSpec } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta1/defaults.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta1/defaults.go index 2771ba420338..dd2a436b0370 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta1/defaults.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta1/defaults.go @@ -21,7 +21,6 @@ import ( "strconv" corev1 "k8s.io/api/core/v1" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apiserver/pkg/util/feature" componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" @@ -53,7 +52,7 @@ func SetDefaults_KubeSchedulerConfiguration(obj *v1beta1.KubeSchedulerConfigurat // Only apply a default scheduler name when there is a single profile. // Validation will ensure that every profile has a non-empty unique name. if len(obj.Profiles) == 1 && obj.Profiles[0].SchedulerName == nil { - obj.Profiles[0].SchedulerName = pointer.StringPtr(v1.DefaultSchedulerName) + obj.Profiles[0].SchedulerName = pointer.StringPtr(corev1.DefaultSchedulerName) } // For Healthz and Metrics bind addresses, we want to check: diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation.go index 759d66e5f702..a236799cfca0 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation.go @@ -17,11 +17,12 @@ limitations under the License. package validation import ( - "errors" "fmt" + "reflect" "github.com/google/go-cmp/cmp" v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation" @@ -32,67 +33,123 @@ import ( ) // ValidateKubeSchedulerConfiguration ensures validation of the KubeSchedulerConfiguration struct -func ValidateKubeSchedulerConfiguration(cc *config.KubeSchedulerConfiguration) field.ErrorList { - allErrs := field.ErrorList{} - allErrs = append(allErrs, componentbasevalidation.ValidateClientConnectionConfiguration(&cc.ClientConnection, field.NewPath("clientConnection"))...) - allErrs = append(allErrs, componentbasevalidation.ValidateLeaderElectionConfiguration(&cc.LeaderElection, field.NewPath("leaderElection"))...) - +func ValidateKubeSchedulerConfiguration(cc *config.KubeSchedulerConfiguration) utilerrors.Aggregate { + var errs []error + errs = append(errs, componentbasevalidation.ValidateClientConnectionConfiguration(&cc.ClientConnection, field.NewPath("clientConnection")).ToAggregate()) + errs = append(errs, componentbasevalidation.ValidateLeaderElectionConfiguration(&cc.LeaderElection, field.NewPath("leaderElection")).ToAggregate()) profilesPath := field.NewPath("profiles") if cc.Parallelism <= 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath("parallelism"), cc.Parallelism, "should be an integer value greater than zero")) + errs = append(errs, field.Invalid(field.NewPath("parallelism"), cc.Parallelism, "should be an integer value greater than zero")) } if len(cc.Profiles) == 0 { - allErrs = append(allErrs, field.Required(profilesPath, "")) + errs = append(errs, field.Required(profilesPath, "")) } else { existingProfiles := make(map[string]int, len(cc.Profiles)) for i := range cc.Profiles { profile := &cc.Profiles[i] path := profilesPath.Index(i) - allErrs = append(allErrs, validateKubeSchedulerProfile(path, profile)...) + errs = append(errs, validateKubeSchedulerProfile(path, profile)...) if idx, ok := existingProfiles[profile.SchedulerName]; ok { - allErrs = append(allErrs, field.Duplicate(path.Child("schedulerName"), profilesPath.Index(idx).Child("schedulerName"))) + errs = append(errs, field.Duplicate(path.Child("schedulerName"), profilesPath.Index(idx).Child("schedulerName"))) } existingProfiles[profile.SchedulerName] = i } - allErrs = append(allErrs, validateCommonQueueSort(profilesPath, cc.Profiles)...) + errs = append(errs, validateCommonQueueSort(profilesPath, cc.Profiles)...) } for _, msg := range validation.IsValidSocketAddr(cc.HealthzBindAddress) { - allErrs = append(allErrs, field.Invalid(field.NewPath("healthzBindAddress"), cc.HealthzBindAddress, msg)) + errs = append(errs, field.Invalid(field.NewPath("healthzBindAddress"), cc.HealthzBindAddress, msg)) } for _, msg := range validation.IsValidSocketAddr(cc.MetricsBindAddress) { - allErrs = append(allErrs, field.Invalid(field.NewPath("metricsBindAddress"), cc.MetricsBindAddress, msg)) + errs = append(errs, field.Invalid(field.NewPath("metricsBindAddress"), cc.MetricsBindAddress, msg)) } if cc.PercentageOfNodesToScore < 0 || cc.PercentageOfNodesToScore > 100 { - allErrs = append(allErrs, field.Invalid(field.NewPath("percentageOfNodesToScore"), + errs = append(errs, field.Invalid(field.NewPath("percentageOfNodesToScore"), cc.PercentageOfNodesToScore, "not in valid range [0-100]")) } if cc.PodInitialBackoffSeconds <= 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath("podInitialBackoffSeconds"), + errs = append(errs, field.Invalid(field.NewPath("podInitialBackoffSeconds"), cc.PodInitialBackoffSeconds, "must be greater than 0")) } if cc.PodMaxBackoffSeconds < cc.PodInitialBackoffSeconds { - allErrs = append(allErrs, field.Invalid(field.NewPath("podMaxBackoffSeconds"), + errs = append(errs, field.Invalid(field.NewPath("podMaxBackoffSeconds"), cc.PodMaxBackoffSeconds, "must be greater than or equal to PodInitialBackoffSeconds")) } - allErrs = append(allErrs, validateExtenders(field.NewPath("extenders"), cc.Extenders)...) - return allErrs + errs = append(errs, validateExtenders(field.NewPath("extenders"), cc.Extenders)...) + return utilerrors.Flatten(utilerrors.NewAggregate(errs)) } -func validateKubeSchedulerProfile(path *field.Path, profile *config.KubeSchedulerProfile) field.ErrorList { - allErrs := field.ErrorList{} +func validateKubeSchedulerProfile(path *field.Path, profile *config.KubeSchedulerProfile) []error { + var errs []error if len(profile.SchedulerName) == 0 { - allErrs = append(allErrs, field.Required(path.Child("schedulerName"), "")) + errs = append(errs, field.Required(path.Child("schedulerName"), "")) + } + errs = append(errs, validatePluginConfig(path, profile)...) + return errs +} + +func validatePluginConfig(path *field.Path, profile *config.KubeSchedulerProfile) []error { + var errs []error + m := map[string]interface{}{ + "DefaultPreemption": ValidateDefaultPreemptionArgs, + "InterPodAffinity": ValidateInterPodAffinityArgs, + "NodeAffinity": ValidateNodeAffinityArgs, + "NodeLabel": ValidateNodeLabelArgs, + "NodeResourcesFitArgs": ValidateNodeResourcesFitArgs, + "NodeResourcesLeastAllocated": ValidateNodeResourcesLeastAllocatedArgs, + "NodeResourcesMostAllocated": ValidateNodeResourcesMostAllocatedArgs, + "PodTopologySpread": ValidatePodTopologySpreadArgs, + "RequestedToCapacityRatio": ValidateRequestedToCapacityRatioArgs, + "VolumeBinding": ValidateVolumeBindingArgs, + } + + seenPluginConfig := make(sets.String) + for i := range profile.PluginConfig { + pluginConfigPath := path.Child("pluginConfig").Index(i) + name := profile.PluginConfig[i].Name + args := profile.PluginConfig[i].Args + if seenPluginConfig.Has(name) { + errs = append(errs, field.Duplicate(pluginConfigPath, name)) + } else { + seenPluginConfig.Insert(name) + } + if validateFunc, ok := m[name]; ok { + // type mismatch, no need to validate the `args`. + if reflect.TypeOf(args) != reflect.ValueOf(validateFunc).Type().In(1) { + errs = append(errs, field.Invalid(pluginConfigPath.Child("args"), args, "has to match plugin args")) + return errs + } + in := []reflect.Value{reflect.ValueOf(pluginConfigPath.Child("args")), reflect.ValueOf(args)} + res := reflect.ValueOf(validateFunc).Call(in) + // It's possible that validation function return a Aggregate, just append here and it will be flattened at the end of CC validation. + if res[0].Interface() != nil { + errs = append(errs, res[0].Interface().(error)) + } + } } - return allErrs + return errs } -func validateCommonQueueSort(path *field.Path, profiles []config.KubeSchedulerProfile) field.ErrorList { - allErrs := field.ErrorList{} +func validateCommonQueueSort(path *field.Path, profiles []config.KubeSchedulerProfile) []error { + var errs []error var canon config.PluginSet + var queueSortName string + var queueSortArgs runtime.Object if profiles[0].Plugins != nil { canon = profiles[0].Plugins.QueueSort + if len(profiles[0].Plugins.QueueSort.Enabled) != 0 { + queueSortName = profiles[0].Plugins.QueueSort.Enabled[0].Name + } + length := len(profiles[0].Plugins.QueueSort.Enabled) + if length > 1 { + errs = append(errs, field.Invalid(path.Index(0).Child("plugins", "queueSort", "Enabled"), length, "only one queue sort plugin can be enabled")) + } + } + for _, cfg := range profiles[0].PluginConfig { + if len(queueSortName) > 0 && cfg.Name == queueSortName { + queueSortArgs = cfg.Args + } } for i := 1; i < len(profiles); i++ { var curr config.PluginSet @@ -100,11 +157,15 @@ func validateCommonQueueSort(path *field.Path, profiles []config.KubeSchedulerPr curr = profiles[i].Plugins.QueueSort } if !cmp.Equal(canon, curr) { - allErrs = append(allErrs, field.Invalid(path.Index(i).Child("plugins", "queueSort"), curr, "has to match for all profiles")) + errs = append(errs, field.Invalid(path.Index(i).Child("plugins", "queueSort"), curr, "has to match for all profiles")) + } + for _, cfg := range profiles[i].PluginConfig { + if cfg.Name == queueSortName && !cmp.Equal(queueSortArgs, cfg.Args) { + errs = append(errs, field.Invalid(path.Index(i).Child("pluginConfig", "args"), cfg.Args, "has to match for all profiles")) + } } } - // TODO(#88093): Validate that all plugin configs for the queue sort extension match. - return allErrs + return errs } // ValidatePolicy checks for errors in the Config @@ -121,7 +182,7 @@ func ValidatePolicy(policy config.Policy) error { } if extenderErrs := validateExtenders(field.NewPath("extenders"), policy.Extenders); len(extenderErrs) > 0 { - validationErrors = append(validationErrors, extenderErrs.ToAggregate().Errors()...) + validationErrors = append(validationErrors, extenderErrs...) } if policy.HardPodAffinitySymmetricWeight < 0 || policy.HardPodAffinitySymmetricWeight > 100 { @@ -131,14 +192,14 @@ func ValidatePolicy(policy config.Policy) error { } // validateExtenders validates the configured extenders for the Scheduler -func validateExtenders(fldPath *field.Path, extenders []config.Extender) field.ErrorList { - allErrs := field.ErrorList{} +func validateExtenders(fldPath *field.Path, extenders []config.Extender) []error { + var errs []error binders := 0 extenderManagedResources := sets.NewString() for i, extender := range extenders { path := fldPath.Index(i) if len(extender.PrioritizeVerb) > 0 && extender.Weight <= 0 { - allErrs = append(allErrs, field.Invalid(path.Child("weight"), + errs = append(errs, field.Invalid(path.Child("weight"), extender.Weight, "must have a positive weight applied to it")) } if extender.BindVerb != "" { @@ -146,22 +207,19 @@ func validateExtenders(fldPath *field.Path, extenders []config.Extender) field.E } for j, resource := range extender.ManagedResources { managedResourcesPath := path.Child("managedResources").Index(j) - errs := validateExtendedResourceName(v1.ResourceName(resource.Name)) - for _, err := range errs { - allErrs = append(allErrs, field.Invalid(managedResourcesPath.Child("name"), - resource.Name, fmt.Sprintf("%+v", err))) - } + validationErrors := validateExtendedResourceName(managedResourcesPath.Child("name"), v1.ResourceName(resource.Name)) + errs = append(errs, validationErrors...) if extenderManagedResources.Has(resource.Name) { - allErrs = append(allErrs, field.Invalid(managedResourcesPath.Child("name"), + errs = append(errs, field.Invalid(managedResourcesPath.Child("name"), resource.Name, "duplicate extender managed resource name")) } extenderManagedResources.Insert(resource.Name) } } if binders > 1 { - allErrs = append(allErrs, field.Invalid(fldPath, fmt.Sprintf("found %d extenders implementing bind", binders), "only one extender can implement bind")) + errs = append(errs, field.Invalid(fldPath, fmt.Sprintf("found %d extenders implementing bind", binders), "only one extender can implement bind")) } - return allErrs + return errs } // validateCustomPriorities validates that: @@ -207,16 +265,16 @@ func validateCustomPriorities(priorities map[string]config.PriorityPolicy, prior // validateExtendedResourceName checks whether the specified name is a valid // extended resource name. -func validateExtendedResourceName(name v1.ResourceName) []error { +func validateExtendedResourceName(path *field.Path, name v1.ResourceName) []error { var validationErrors []error for _, msg := range validation.IsQualifiedName(string(name)) { - validationErrors = append(validationErrors, errors.New(msg)) + validationErrors = append(validationErrors, field.Invalid(path, name, msg)) } if len(validationErrors) != 0 { return validationErrors } if !v1helper.IsExtendedResourceName(name) { - validationErrors = append(validationErrors, fmt.Errorf("%s is an invalid extended resource name", name)) + validationErrors = append(validationErrors, field.Invalid(path, string(name), "is an invalid extended resource name")) } return validationErrors } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation_pluginargs.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation_pluginargs.go index 182f616bf102..f4b55027c034 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation_pluginargs.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation_pluginargs.go @@ -18,6 +18,7 @@ package validation import ( "fmt" + "strings" v1 "k8s.io/api/core/v1" metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" @@ -29,8 +30,7 @@ import ( ) // ValidateDefaultPreemptionArgs validates that DefaultPreemptionArgs are correct. -func ValidateDefaultPreemptionArgs(args config.DefaultPreemptionArgs) error { - var path *field.Path +func ValidateDefaultPreemptionArgs(path *field.Path, args *config.DefaultPreemptionArgs) error { var allErrs field.ErrorList percentagePath := path.Child("minCandidateNodesPercentage") absolutePath := path.Child("minCandidateNodesAbsolute") @@ -67,8 +67,7 @@ func validateMinCandidateNodesAbsolute(minCandidateNodesAbsolute int32, p *field } // ValidateInterPodAffinityArgs validates that InterPodAffinityArgs are correct. -func ValidateInterPodAffinityArgs(args config.InterPodAffinityArgs) error { - var path *field.Path +func ValidateInterPodAffinityArgs(path *field.Path, args *config.InterPodAffinityArgs) error { return ValidateHardPodAffinityWeight(path.Child("hardPodAffinityWeight"), args.HardPodAffinityWeight) } @@ -87,8 +86,7 @@ func ValidateHardPodAffinityWeight(path *field.Path, w int32) error { } // ValidateNodeLabelArgs validates that NodeLabelArgs are correct. -func ValidateNodeLabelArgs(args config.NodeLabelArgs) error { - var path *field.Path +func ValidateNodeLabelArgs(path *field.Path, args *config.NodeLabelArgs) error { var allErrs field.ErrorList allErrs = append(allErrs, validateNoConflict(args.PresentLabels, args.AbsentLabels, @@ -119,8 +117,7 @@ func validateNoConflict(presentLabels, absentLabels []string, presentPath, absen // ValidatePodTopologySpreadArgs validates that PodTopologySpreadArgs are correct. // It replicates the validation from pkg/apis/core/validation.validateTopologySpreadConstraints // with an additional check for .labelSelector to be nil. -func ValidatePodTopologySpreadArgs(args *config.PodTopologySpreadArgs) error { - var path *field.Path +func ValidatePodTopologySpreadArgs(path *field.Path, args *config.PodTopologySpreadArgs) error { var allErrs field.ErrorList if err := validateDefaultingType(path.Child("defaultingType"), args.DefaultingType, args.DefaultConstraints); err != nil { allErrs = append(allErrs, err) @@ -195,8 +192,7 @@ func validateConstraintNotRepeat(path *field.Path, constraints []v1.TopologySpre } // ValidateRequestedToCapacityRatioArgs validates that RequestedToCapacityRatioArgs are correct. -func ValidateRequestedToCapacityRatioArgs(args config.RequestedToCapacityRatioArgs) error { - var path *field.Path +func ValidateRequestedToCapacityRatioArgs(path *field.Path, args *config.RequestedToCapacityRatioArgs) error { var allErrs field.ErrorList allErrs = append(allErrs, validateFunctionShape(args.Shape, path.Child("shape"))...) allErrs = append(allErrs, validateResourcesNoMax(args.Resources, path.Child("resources"))...) @@ -240,7 +236,7 @@ func validateFunctionShape(shape []config.UtilizationShapePoint, path *field.Pat return allErrs } -// TODO potentially replace with validateResources +// weight of resource is allowed to exceed 100, this is only applicable to `RequestedToCapacityRatio` plugin for backwards compatibility reason. func validateResourcesNoMax(resources []config.ResourceSpec, p *field.Path) field.ErrorList { var allErrs field.ErrorList for i, r := range resources { @@ -253,14 +249,12 @@ func validateResourcesNoMax(resources []config.ResourceSpec, p *field.Path) fiel } // ValidateNodeResourcesLeastAllocatedArgs validates that NodeResourcesLeastAllocatedArgs are correct. -func ValidateNodeResourcesLeastAllocatedArgs(args *config.NodeResourcesLeastAllocatedArgs) error { - var path *field.Path +func ValidateNodeResourcesLeastAllocatedArgs(path *field.Path, args *config.NodeResourcesLeastAllocatedArgs) error { return validateResources(args.Resources, path.Child("resources")).ToAggregate() } // ValidateNodeResourcesMostAllocatedArgs validates that NodeResourcesMostAllocatedArgs are correct. -func ValidateNodeResourcesMostAllocatedArgs(args *config.NodeResourcesMostAllocatedArgs) error { - var path *field.Path +func ValidateNodeResourcesMostAllocatedArgs(path *field.Path, args *config.NodeResourcesMostAllocatedArgs) error { return validateResources(args.Resources, path.Child("resources")).ToAggregate() } @@ -276,22 +270,21 @@ func validateResources(resources []config.ResourceSpec, p *field.Path) field.Err } // ValidateNodeAffinityArgs validates that NodeAffinityArgs are correct. -func ValidateNodeAffinityArgs(args *config.NodeAffinityArgs) error { +func ValidateNodeAffinityArgs(path *field.Path, args *config.NodeAffinityArgs) error { if args.AddedAffinity == nil { return nil } affinity := args.AddedAffinity - path := field.NewPath("addedAffinity") var errs []error if ns := affinity.RequiredDuringSchedulingIgnoredDuringExecution; ns != nil { - _, err := nodeaffinity.NewNodeSelector(ns, field.WithPath(path.Child("requiredDuringSchedulingIgnoredDuringExecution"))) + _, err := nodeaffinity.NewNodeSelector(ns, field.WithPath(path.Child("addedAffinity", "requiredDuringSchedulingIgnoredDuringExecution"))) if err != nil { errs = append(errs, err) } } // TODO: Add validation for requiredDuringSchedulingRequiredDuringExecution when it gets added to the API. if terms := affinity.PreferredDuringSchedulingIgnoredDuringExecution; len(terms) != 0 { - _, err := nodeaffinity.NewPreferredSchedulingTerms(terms, field.WithPath(path.Child("preferredDuringSchedulingIgnoredDuringExecution"))) + _, err := nodeaffinity.NewPreferredSchedulingTerms(terms, field.WithPath(path.Child("addedAffinity", "preferredDuringSchedulingIgnoredDuringExecution"))) if err != nil { errs = append(errs, err) } @@ -300,8 +293,7 @@ func ValidateNodeAffinityArgs(args *config.NodeAffinityArgs) error { } // ValidateVolumeBindingArgs validates that VolumeBindingArgs are set correctly. -func ValidateVolumeBindingArgs(args *config.VolumeBindingArgs) error { - var path *field.Path +func ValidateVolumeBindingArgs(path *field.Path, args *config.VolumeBindingArgs) error { var err error if args.BindTimeoutSeconds < 0 { @@ -310,3 +302,30 @@ func ValidateVolumeBindingArgs(args *config.VolumeBindingArgs) error { return err } + +func ValidateNodeResourcesFitArgs(path *field.Path, args *config.NodeResourcesFitArgs) error { + var allErrs field.ErrorList + resPath := path.Child("ignoredResources") + for i, res := range args.IgnoredResources { + path := resPath.Index(i) + if errs := metav1validation.ValidateLabelName(res, path); len(errs) != 0 { + allErrs = append(allErrs, errs...) + } + } + + groupPath := path.Child("ignoredResourceGroups") + for i, group := range args.IgnoredResourceGroups { + path := groupPath.Index(i) + if strings.Contains(group, "/") { + allErrs = append(allErrs, field.Invalid(path, group, "resource group name can't contain '/'")) + } + if errs := metav1validation.ValidateLabelName(group, path); len(errs) != 0 { + allErrs = append(allErrs, errs...) + } + } + + if len(allErrs) == 0 { + return nil + } + return allErrs.ToAggregate() +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go index 8ae1c50fa02d..dedc053fab58 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go @@ -31,8 +31,10 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/informers" clientset "k8s.io/client-go/kubernetes" + restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/events" "k8s.io/kubernetes/pkg/scheduler/apis/config" + "k8s.io/kubernetes/pkg/scheduler/internal/parallelize" ) // NodeScoreList declares a list of nodes and their scores. @@ -587,6 +589,9 @@ type Handle interface { // ClientSet returns a kubernetes clientSet. ClientSet() clientset.Interface + // KubeConfig returns the raw kube config. + KubeConfig() *restclient.Config + // EventRecorder returns an event recorder. EventRecorder() events.EventRecorder @@ -597,6 +602,9 @@ type Handle interface { // Extenders returns registered scheduler extenders. Extenders() []Extender + + // Parallelizer returns a parallelizer holding parallelism for scheduler. + Parallelizer() parallelize.Parallelizer } // PostFilterResult wraps needed info for scheduler framework to act upon PostFilter phase. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go index 6437e09883cf..7884f289179d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go @@ -29,7 +29,7 @@ import ( "k8s.io/klog/v2" v1 "k8s.io/api/core/v1" - policy "k8s.io/api/policy/v1beta1" + policy "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -37,14 +37,13 @@ import ( "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" corelisters "k8s.io/client-go/listers/core/v1" - policylisters "k8s.io/client-go/listers/policy/v1beta1" + policylisters "k8s.io/client-go/listers/policy/v1" corev1helpers "k8s.io/component-helpers/scheduling/corev1" extenderv1 "k8s.io/kube-scheduler/extender/v1" kubefeatures "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/apis/config/validation" "k8s.io/kubernetes/pkg/scheduler/framework" - "k8s.io/kubernetes/pkg/scheduler/internal/parallelize" "k8s.io/kubernetes/pkg/scheduler/metrics" "k8s.io/kubernetes/pkg/scheduler/util" ) @@ -75,7 +74,7 @@ func New(dpArgs runtime.Object, fh framework.Handle) (framework.Plugin, error) { if !ok { return nil, fmt.Errorf("got args of type %T, want *DefaultPreemptionArgs", dpArgs) } - if err := validation.ValidateDefaultPreemptionArgs(*args); err != nil { + if err := validation.ValidateDefaultPreemptionArgs(nil, args); err != nil { return nil, err } pl := DefaultPreemption{ @@ -360,7 +359,7 @@ func dryRunPreemption(ctx context.Context, fh framework.Handle, statusesLock.Unlock() } } - parallelize.Until(parallelCtx, len(potentialNodes), checkNode) + fh.Parallelizer().Until(parallelCtx, len(potentialNodes), checkNode) return append(nonViolatingCandidates.get(), violatingCandidates.get()...), nodeStatuses } @@ -695,13 +694,13 @@ func selectVictimsOnNode( // - Clear the low-priority pods' nominatedNodeName status if needed func PrepareCandidate(c Candidate, fh framework.Handle, cs kubernetes.Interface, pod *v1.Pod, pluginName string) *framework.Status { for _, victim := range c.Victims().Pods { - if err := util.DeletePod(cs, victim); err != nil { - klog.ErrorS(err, "preempting pod", "pod", klog.KObj(victim)) - return framework.AsStatus(err) - } - // If the victim is a WaitingPod, send a reject message to the PermitPlugin + // If the victim is a WaitingPod, send a reject message to the PermitPlugin. + // Otherwise we should delete the victim. if waitingPod := fh.GetWaitingPod(victim.UID); waitingPod != nil { waitingPod.Reject(pluginName, "preempted") + } else if err := util.DeletePod(cs, victim); err != nil { + klog.ErrorS(err, "Preempting pod", "pod", klog.KObj(victim), "preemptor", klog.KObj(pod)) + return framework.AsStatus(err) } fh.EventRecorder().Eventf(victim, pod, v1.EventTypeNormal, "Preempted", "Preempting", "Preempted by %v/%v on node %v", pod.Namespace, pod.Name, c.Name()) @@ -799,7 +798,7 @@ func filterPodsWithPDBViolation(podInfos []*framework.PodInfo, pdbs []*policy.Po func getPDBLister(informerFactory informers.SharedInformerFactory) policylisters.PodDisruptionBudgetLister { if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.PodDisruptionBudget) { - return informerFactory.Policy().V1beta1().PodDisruptionBudgets().Lister() + return informerFactory.Policy().V1().PodDisruptionBudgets().Lister() } return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper/node_affinity.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper/node_affinity.go deleted file mode 100644 index 29380e7dd11f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper/node_affinity.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package helper - -import ( - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/component-helpers/scheduling/corev1" -) - -// PodMatchesNodeSelectorAndAffinityTerms checks whether the pod is schedulable onto nodes according to -// the requirements in both NodeAffinity and nodeSelector. -func PodMatchesNodeSelectorAndAffinityTerms(pod *v1.Pod, node *v1.Node) bool { - // Check if node.Labels match pod.Spec.NodeSelector. - if len(pod.Spec.NodeSelector) > 0 { - selector := labels.SelectorFromSet(pod.Spec.NodeSelector) - if !selector.Matches(labels.Set(node.Labels)) { - return false - } - } - if pod.Spec.Affinity == nil { - return true - } - return NodeMatchesNodeAffinity(pod.Spec.Affinity.NodeAffinity, node) -} - -// NodeMatchesNodeAffinity checks whether the Node satisfy the given NodeAffinity. -func NodeMatchesNodeAffinity(affinity *v1.NodeAffinity, node *v1.Node) bool { - // 1. nil NodeSelector matches all nodes (i.e. does not filter out any nodes) - // 2. nil []NodeSelectorTerm (equivalent to non-nil empty NodeSelector) matches no nodes - // 3. zero-length non-nil []NodeSelectorTerm matches no nodes also, just for simplicity - // 4. nil []NodeSelectorRequirement (equivalent to non-nil empty NodeSelectorTerm) matches no nodes - // 5. zero-length non-nil []NodeSelectorRequirement matches no nodes also, just for simplicity - // 6. non-nil empty NodeSelectorRequirement is not allowed - if affinity == nil { - return true - } - // Match node selector for requiredDuringSchedulingRequiredDuringExecution. - // TODO: Uncomment this block when implement RequiredDuringSchedulingRequiredDuringExecution. - // if affinity.RequiredDuringSchedulingRequiredDuringExecution != nil && !nodeMatchesNodeSelector(node, affinity.RequiredDuringSchedulingRequiredDuringExecution) { - // return false - // } - - // Match node selector for requiredDuringSchedulingIgnoredDuringExecution. - if affinity.RequiredDuringSchedulingIgnoredDuringExecution != nil && !nodeMatchesNodeSelector(node, affinity.RequiredDuringSchedulingIgnoredDuringExecution) { - return false - } - return true -} - -// nodeMatchesNodeSelector checks if a node's labels satisfy a list of node selector terms, -// terms are ORed, and an empty list of terms will match nothing. -func nodeMatchesNodeSelector(node *v1.Node, nodeSelector *v1.NodeSelector) bool { - matches, _ := corev1.MatchNodeSelectorTerms(node, nodeSelector) - return matches -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go index 2b0d5d71c4ec..d3e46ac2ea85 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go @@ -25,7 +25,6 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/scheduler/framework" - "k8s.io/kubernetes/pkg/scheduler/internal/parallelize" ) const ( @@ -157,7 +156,7 @@ func podMatchesAllAffinityTerms(terms []framework.AffinityTerm, pod *v1.Pod, ena // calculates the following for each existing pod on each node: // (1) Whether it has PodAntiAffinity // (2) Whether any AffinityTerm matches the incoming pod -func getExistingAntiAffinityCounts(pod *v1.Pod, nsLabels labels.Set, nodes []*framework.NodeInfo, enableNamespaceSelector bool) topologyToMatchedTermCount { +func (pl *InterPodAffinity) getExistingAntiAffinityCounts(pod *v1.Pod, nsLabels labels.Set, nodes []*framework.NodeInfo, enableNamespaceSelector bool) topologyToMatchedTermCount { topoMaps := make([]topologyToMatchedTermCount, len(nodes)) index := int32(-1) processNode := func(i int) { @@ -175,7 +174,7 @@ func getExistingAntiAffinityCounts(pod *v1.Pod, nsLabels labels.Set, nodes []*fr topoMaps[atomic.AddInt32(&index, 1)] = topoMap } } - parallelize.Until(context.Background(), len(nodes), processNode) + pl.parallelizer.Until(context.Background(), len(nodes), processNode) result := make(topologyToMatchedTermCount) for i := 0; i <= int(index); i++ { @@ -189,7 +188,7 @@ func getExistingAntiAffinityCounts(pod *v1.Pod, nsLabels labels.Set, nodes []*fr // It returns a topologyToMatchedTermCount that are checked later by the affinity // predicate. With this topologyToMatchedTermCount available, the affinity predicate does not // need to check all the pods in the cluster. -func getIncomingAffinityAntiAffinityCounts(podInfo *framework.PodInfo, allNodes []*framework.NodeInfo, enableNamespaceSelector bool) (topologyToMatchedTermCount, topologyToMatchedTermCount) { +func (pl *InterPodAffinity) getIncomingAffinityAntiAffinityCounts(podInfo *framework.PodInfo, allNodes []*framework.NodeInfo, enableNamespaceSelector bool) (topologyToMatchedTermCount, topologyToMatchedTermCount) { affinityCounts := make(topologyToMatchedTermCount) antiAffinityCounts := make(topologyToMatchedTermCount) if len(podInfo.RequiredAffinityTerms) == 0 && len(podInfo.RequiredAntiAffinityTerms) == 0 { @@ -221,7 +220,7 @@ func getIncomingAffinityAntiAffinityCounts(podInfo *framework.PodInfo, allNodes antiAffinityCountsList[k] = antiAffinity } } - parallelize.Until(context.Background(), len(allNodes), processNode) + pl.parallelizer.Until(context.Background(), len(allNodes), processNode) for i := 0; i <= int(index); i++ { affinityCounts.append(affinityCountsList[i]) @@ -266,8 +265,8 @@ func (pl *InterPodAffinity) PreFilter(ctx context.Context, cycleState *framework s.namespaceLabels = GetNamespaceLabelsSnapshot(pod.Namespace, pl.nsLister) } - s.existingAntiAffinityCounts = getExistingAntiAffinityCounts(pod, s.namespaceLabels, nodesWithRequiredAntiAffinityPods, pl.enableNamespaceSelector) - s.affinityCounts, s.antiAffinityCounts = getIncomingAffinityAntiAffinityCounts(s.podInfo, allNodes, pl.enableNamespaceSelector) + s.existingAntiAffinityCounts = pl.getExistingAntiAffinityCounts(pod, s.namespaceLabels, nodesWithRequiredAntiAffinityPods, pl.enableNamespaceSelector) + s.affinityCounts, s.antiAffinityCounts = pl.getIncomingAffinityAntiAffinityCounts(s.podInfo, allNodes, pl.enableNamespaceSelector) cycleState.Write(preFilterStateKey, s) return nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go index 9928b260235c..dd8e23897f97 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go @@ -27,6 +27,7 @@ import ( "k8s.io/kubernetes/pkg/scheduler/apis/config/validation" "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" + "k8s.io/kubernetes/pkg/scheduler/internal/parallelize" ) const ( @@ -38,9 +39,11 @@ var _ framework.PreFilterPlugin = &InterPodAffinity{} var _ framework.FilterPlugin = &InterPodAffinity{} var _ framework.PreScorePlugin = &InterPodAffinity{} var _ framework.ScorePlugin = &InterPodAffinity{} +var _ framework.EnqueueExtensions = &InterPodAffinity{} // InterPodAffinity is a plugin that checks inter pod affinity type InterPodAffinity struct { + parallelizer parallelize.Parallelizer args config.InterPodAffinityArgs sharedLister framework.SharedLister nsLister listersv1.NamespaceLister @@ -52,6 +55,22 @@ func (pl *InterPodAffinity) Name() string { return Name } +// EventsToRegister returns the possible events that may make a failed Pod +// schedulable +func (pl *InterPodAffinity) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + // All ActionType includes the following events: + // - Delete. An unschedulable Pod may fail due to violating an existing Pod's anti-affinity constraints, + // deleting an existing Pod may make it schedulable. + // - Update. Updating on an existing Pod's labels (e.g., removal) may make + // an unschedulable Pod schedulable. + // - Add. An unschedulable Pod may fail due to violating pod-affinity constraints, + // adding an assigned Pod may make it schedulable. + {Resource: framework.Pod, ActionType: framework.All}, + {Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeLabel}, + } +} + // New initializes a new plugin and returns it. func New(plArgs runtime.Object, h framework.Handle, fts feature.Features) (framework.Plugin, error) { if h.SnapshotSharedLister() == nil { @@ -61,10 +80,11 @@ func New(plArgs runtime.Object, h framework.Handle, fts feature.Features) (frame if err != nil { return nil, err } - if err := validation.ValidateInterPodAffinityArgs(args); err != nil { + if err := validation.ValidateInterPodAffinityArgs(nil, &args); err != nil { return nil, err } pl := &InterPodAffinity{ + parallelizer: h.Parallelizer(), args: args, sharedLister: h.SnapshotSharedLister(), enableNamespaceSelector: fts.EnablePodAffinityNamespaceSelector, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go index 716a67fa9726..464e0f3b5d1a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go @@ -25,7 +25,6 @@ import ( "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/kubernetes/pkg/scheduler/framework" - "k8s.io/kubernetes/pkg/scheduler/internal/parallelize" ) // preScoreStateKey is the key in CycleState to InterPodAffinity pre-computed data for Scoring. @@ -150,12 +149,12 @@ func (pl *InterPodAffinity) PreScore( if hasPreferredAffinityConstraints || hasPreferredAntiAffinityConstraints { allNodes, err = pl.sharedLister.NodeInfos().List() if err != nil { - framework.AsStatus(fmt.Errorf("failed to get all nodes from shared lister: %w", err)) + return framework.AsStatus(fmt.Errorf("failed to get all nodes from shared lister: %w", err)) } } else { allNodes, err = pl.sharedLister.NodeInfos().HavePodsWithAffinityList() if err != nil { - framework.AsStatus(fmt.Errorf("failed to get pods with affinity list: %w", err)) + return framework.AsStatus(fmt.Errorf("failed to get pods with affinity list: %w", err)) } } @@ -206,7 +205,7 @@ func (pl *InterPodAffinity) PreScore( topoScores[atomic.AddInt32(&index, 1)] = topoScore } } - parallelize.Until(context.Background(), len(allNodes), processNode) + pl.parallelizer.Until(context.Background(), len(allNodes), processNode) for i := 0; i <= int(index); i++ { state.topologyScore.append(topoScores[i]) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/legacy_registry.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/legacy_registry.go index e5ec1c77daf8..0c216a8e3e5d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/legacy_registry.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/legacy_registry.go @@ -546,8 +546,10 @@ func appendToPluginSet(set config.PluginSet, name string, weight *int32) config. // ProcessPredicatePolicy given a PredicatePolicy, return the plugin name implementing the predicate and update // the ConfigProducerArgs if necessary. -func (lr *LegacyRegistry) ProcessPredicatePolicy(policy config.PredicatePolicy, pluginArgs *ConfigProducerArgs) string { - validatePredicateOrDie(policy) +func (lr *LegacyRegistry) ProcessPredicatePolicy(policy config.PredicatePolicy, pluginArgs *ConfigProducerArgs) (string, error) { + if err := validatePredicate(policy); err != nil { + return "", err + } predicateName := policy.Name if policy.Name == "PodFitsPorts" { @@ -558,12 +560,12 @@ func (lr *LegacyRegistry) ProcessPredicatePolicy(policy config.PredicatePolicy, if _, ok := lr.predicateToConfigProducer[predicateName]; ok { // checking to see if a pre-defined predicate is requested klog.V(2).Infof("Predicate type %s already registered, reusing.", policy.Name) - return predicateName + return predicateName, nil } if policy.Argument == nil || (policy.Argument.ServiceAffinity == nil && policy.Argument.LabelsPresence == nil) { - klog.Fatalf("Invalid configuration: Predicate type not found for %q", policy.Name) + return "", fmt.Errorf("predicate type not found for %q", predicateName) } // generate the predicate function, if a custom type is requested @@ -597,13 +599,15 @@ func (lr *LegacyRegistry) ProcessPredicatePolicy(policy config.PredicatePolicy, predicateName = CheckNodeLabelPresencePred } - return predicateName + return predicateName, nil } // ProcessPriorityPolicy given a PriorityPolicy, return the plugin name implementing the priority and update // the ConfigProducerArgs if necessary. -func (lr *LegacyRegistry) ProcessPriorityPolicy(policy config.PriorityPolicy, configProducerArgs *ConfigProducerArgs) string { - validatePriorityOrDie(policy) +func (lr *LegacyRegistry) ProcessPriorityPolicy(policy config.PriorityPolicy, configProducerArgs *ConfigProducerArgs) (string, error) { + if err := validatePriority(policy); err != nil { + return "", err + } priorityName := policy.Name if policy.Name == ServiceSpreadingPriority { @@ -613,7 +617,7 @@ func (lr *LegacyRegistry) ProcessPriorityPolicy(policy config.PriorityPolicy, co if _, ok := lr.priorityToConfigProducer[priorityName]; ok { klog.V(2).Infof("Priority type %s already registered, reusing.", priorityName) - return priorityName + return priorityName, nil } // generate the priority function, if a custom priority is requested @@ -621,7 +625,7 @@ func (lr *LegacyRegistry) ProcessPriorityPolicy(policy config.PriorityPolicy, co (policy.Argument.ServiceAntiAffinity == nil && policy.Argument.RequestedToCapacityRatioArguments == nil && policy.Argument.LabelPreference == nil) { - klog.Fatalf("Invalid configuration: Priority type not found for %q", priorityName) + return "", fmt.Errorf("priority type not found for %q", priorityName) } if policy.Argument.ServiceAntiAffinity != nil { @@ -686,10 +690,10 @@ func (lr *LegacyRegistry) ProcessPriorityPolicy(policy config.PriorityPolicy, co priorityName = noderesources.RequestedToCapacityRatioName } - return priorityName + return priorityName, nil } -func validatePredicateOrDie(predicate config.PredicatePolicy) { +func validatePredicate(predicate config.PredicatePolicy) error { if predicate.Argument != nil { numArgs := 0 if predicate.Argument.ServiceAffinity != nil { @@ -699,12 +703,13 @@ func validatePredicateOrDie(predicate config.PredicatePolicy) { numArgs++ } if numArgs != 1 { - klog.Fatalf("Exactly 1 predicate argument is required, numArgs: %v, Predicate: %s", numArgs, predicate.Name) + return fmt.Errorf("exactly 1 predicate argument is required, numArgs: %v, predicate %v", numArgs, predicate) } } + return nil } -func validatePriorityOrDie(priority config.PriorityPolicy) { +func validatePriority(priority config.PriorityPolicy) error { if priority.Argument != nil { numArgs := 0 if priority.Argument.ServiceAntiAffinity != nil { @@ -717,7 +722,8 @@ func validatePriorityOrDie(priority config.PriorityPolicy) { numArgs++ } if numArgs != 1 { - klog.Fatalf("Exactly 1 priority argument is required, numArgs: %v, Priority: %s", numArgs, priority.Name) + return fmt.Errorf("exactly 1 priority argument is required, numArgs: %v, priority %v", numArgs, priority) } } + return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go index e4ab811409b3..27fa711b9b65 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go @@ -21,7 +21,6 @@ import ( "fmt" v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/component-helpers/scheduling/corev1/nodeaffinity" "k8s.io/kubernetes/pkg/scheduler/apis/config" @@ -39,6 +38,7 @@ type NodeAffinity struct { var _ framework.FilterPlugin = &NodeAffinity{} var _ framework.ScorePlugin = &NodeAffinity{} +var _ framework.EnqueueExtensions = &NodeAffinity{} const ( // Name is the name of the plugin used in the plugin registry and configurations. @@ -63,8 +63,7 @@ func (pl *NodeAffinity) Name() string { } type preFilterState struct { - requiredNodeSelector labels.Selector - requiredNodeAffinity *nodeaffinity.LazyErrorNodeSelector + requiredNodeSelectorAndAffinity nodeaffinity.RequiredNodeAffinity } // Clone just returns the same state because it is not affected by pod additions or deletions. @@ -72,9 +71,17 @@ func (s *preFilterState) Clone() framework.StateData { return s } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *NodeAffinity) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + {Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeLabel}, + } +} + // PreFilter builds and writes cycle state used by Filter. func (pl *NodeAffinity) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status { - state := getPodRequiredNodeSelectorAndAffinity(pod) + state := &preFilterState{requiredNodeSelectorAndAffinity: nodeaffinity.GetRequiredNodeAffinity(pod)} cycleState.Write(preFilterStateKey, state) return nil } @@ -99,21 +106,15 @@ func (pl *NodeAffinity) Filter(ctx context.Context, state *framework.CycleState, if err != nil { // Fallback to calculate requiredNodeSelector and requiredNodeAffinity // here when PreFilter is disabled. - s = getPodRequiredNodeSelectorAndAffinity(pod) + s = &preFilterState{requiredNodeSelectorAndAffinity: nodeaffinity.GetRequiredNodeAffinity(pod)} } - if s.requiredNodeSelector != nil { - if !s.requiredNodeSelector.Matches(labels.Set(node.Labels)) { - return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonPod) - } - } - if s.requiredNodeAffinity != nil { - // Ignore parsing errors for backwards compatibility. - matches, _ := s.requiredNodeAffinity.Match(node) - if !matches { - return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonPod) - } + // Ignore parsing errors for backwards compatibility. + match, _ := s.requiredNodeSelectorAndAffinity.Match(node) + if !match { + return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonPod) } + return nil } @@ -224,7 +225,7 @@ func getArgs(obj runtime.Object) (config.NodeAffinityArgs, error) { if !ok { return config.NodeAffinityArgs{}, fmt.Errorf("args are not of type NodeAffinityArgs, got %T", obj) } - return *ptr, validation.ValidateNodeAffinityArgs(ptr) + return *ptr, validation.ValidateNodeAffinityArgs(nil, ptr) } func getPodPreferredNodeAffinity(pod *v1.Pod) (*nodeaffinity.PreferredSchedulingTerms, error) { @@ -248,21 +249,6 @@ func getPreScoreState(cycleState *framework.CycleState) (*preScoreState, error) return s, nil } -func getPodRequiredNodeSelectorAndAffinity(pod *v1.Pod) *preFilterState { - var selector labels.Selector - if len(pod.Spec.NodeSelector) > 0 { - selector = labels.SelectorFromSet(pod.Spec.NodeSelector) - } - // Use LazyErrorNodeSelector for backwards compatibility of parsing errors. - var affinity *nodeaffinity.LazyErrorNodeSelector - if pod.Spec.Affinity != nil && - pod.Spec.Affinity.NodeAffinity != nil && - pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution != nil { - affinity = nodeaffinity.NewLazyErrorNodeSelector(pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution) - } - return &preFilterState{requiredNodeSelector: selector, requiredNodeAffinity: affinity} -} - func getPreFilterState(cycleState *framework.CycleState) (*preFilterState, error) { c, err := cycleState.Read(preFilterStateKey) if err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodelabel/node_label.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodelabel/node_label.go index f9ee13bbfcc2..dfa48c03c48e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodelabel/node_label.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodelabel/node_label.go @@ -42,8 +42,7 @@ func New(plArgs runtime.Object, handle framework.Handle) (framework.Plugin, erro if err != nil { return nil, err } - - if err := validation.ValidateNodeLabelArgs(args); err != nil { + if err := validation.ValidateNodeLabelArgs(nil, &args); err != nil { return nil, err } @@ -69,6 +68,7 @@ type NodeLabel struct { var _ framework.FilterPlugin = &NodeLabel{} var _ framework.ScorePlugin = &NodeLabel{} +var _ framework.EnqueueExtensions = &NodeLabel{} // Name returns name of the plugin. It is used in logs, etc. func (pl *NodeLabel) Name() string { @@ -89,11 +89,17 @@ func (pl *NodeLabel) Filter(ctx context.Context, _ *framework.CycleState, pod *v if node == nil { return framework.NewStatus(framework.Error, "node not found") } + + size := int64(len(pl.args.PresentLabels) + len(pl.args.AbsentLabels)) + if size == 0 { + return nil + } + nodeLabels := labels.Set(node.Labels) check := func(labels []string, presence bool) bool { for _, label := range labels { exists := nodeLabels.Has(label) - if (exists && !presence) || (!exists && presence) { + if exists != presence { return false } } @@ -114,6 +120,12 @@ func (pl *NodeLabel) Score(ctx context.Context, state *framework.CycleState, pod } node := nodeInfo.Node() + + size := int64(len(pl.args.PresentLabelsPreference) + len(pl.args.AbsentLabelsPreference)) + if size == 0 { + return 0, nil + } + score := int64(0) for _, label := range pl.args.PresentLabelsPreference { if labels.Set(node.Labels).Has(label) { @@ -125,8 +137,9 @@ func (pl *NodeLabel) Score(ctx context.Context, state *framework.CycleState, pod score += framework.MaxNodeScore } } + // Take average score for each label to ensure the score doesn't exceed MaxNodeScore. - score /= int64(len(pl.args.PresentLabelsPreference) + len(pl.args.AbsentLabelsPreference)) + score /= size return score, nil } @@ -135,3 +148,11 @@ func (pl *NodeLabel) Score(ctx context.Context, state *framework.CycleState, pod func (pl *NodeLabel) ScoreExtensions() framework.ScoreExtensions { return nil } + +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *NodeLabel) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + {Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeLabel}, + } +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename/node_name.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename/node_name.go index 070170360ed3..ff0d916cde58 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename/node_name.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename/node_name.go @@ -28,6 +28,7 @@ import ( type NodeName struct{} var _ framework.FilterPlugin = &NodeName{} +var _ framework.EnqueueExtensions = &NodeName{} const ( // Name is the name of the plugin used in the plugin registry and configurations. @@ -37,6 +38,14 @@ const ( ErrReason = "node(s) didn't match the requested node name" ) +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *NodeName) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + {Resource: framework.Node, ActionType: framework.Add}, + } +} + // Name returns name of the plugin. It is used in logs, etc. func (pl *NodeName) Name() string { return Name diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports/node_ports.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports/node_ports.go index 1006655b5ebe..9b665599e753 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports/node_ports.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports/node_ports.go @@ -30,6 +30,7 @@ type NodePorts struct{} var _ framework.PreFilterPlugin = &NodePorts{} var _ framework.FilterPlugin = &NodePorts{} +var _ framework.EnqueueExtensions = &NodePorts{} const ( // Name is the name of the plugin used in the plugin registry and configurations. @@ -97,6 +98,16 @@ func getPreFilterState(cycleState *framework.CycleState) (preFilterState, error) return s, nil } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *NodePorts) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + // Due to immutable fields `spec.containers[*].ports`, pod update events are ignored. + {Resource: framework.Pod, ActionType: framework.Delete}, + {Resource: framework.Node, ActionType: framework.Add}, + } +} + // Filter invoked at the filter extension point. func (pl *NodePorts) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { wantPorts, err := getPreFilterState(cycleState) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go index 93438302f1f4..169284a7f052 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go @@ -51,9 +51,6 @@ func (pl *NodePreferAvoidPods) Score(ctx context.Context, state *framework.Cycle } node := nodeInfo.Node() - if node == nil { - return 0, framework.NewStatus(framework.Error, "node not found") - } controllerRef := metav1.GetControllerOf(pod) if controllerRef != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go index 28c4dc0920b8..6f2d0f95714b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go @@ -22,14 +22,13 @@ import ( "strings" v1 "k8s.io/api/core/v1" - metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/validation/field" utilfeature "k8s.io/apiserver/pkg/util/feature" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/scheduler/apis/config" + "k8s.io/kubernetes/pkg/scheduler/apis/config/validation" "k8s.io/kubernetes/pkg/scheduler/framework" ) @@ -67,58 +66,21 @@ func (f *Fit) Name() string { return FitName } -func validateFitArgs(args config.NodeResourcesFitArgs) error { - var allErrs field.ErrorList - resPath := field.NewPath("ignoredResources") - for i, res := range args.IgnoredResources { - path := resPath.Index(i) - if errs := metav1validation.ValidateLabelName(res, path); len(errs) != 0 { - allErrs = append(allErrs, errs...) - } - } - - groupPath := field.NewPath("ignoredResourceGroups") - for i, group := range args.IgnoredResourceGroups { - path := groupPath.Index(i) - if strings.Contains(group, "/") { - allErrs = append(allErrs, field.Invalid(path, group, "resource group name can't contain '/'")) - } - if errs := metav1validation.ValidateLabelName(group, path); len(errs) != 0 { - allErrs = append(allErrs, errs...) - } - } - - if len(allErrs) == 0 { - return nil - } - return allErrs.ToAggregate() -} - // NewFit initializes a new plugin and returns it. func NewFit(plArgs runtime.Object, _ framework.Handle) (framework.Plugin, error) { - args, err := getFitArgs(plArgs) - if err != nil { - return nil, err + args, ok := plArgs.(*config.NodeResourcesFitArgs) + if !ok { + return nil, fmt.Errorf("want args to be of type NodeResourcesFitArgs, got %T", plArgs) } - - if err := validateFitArgs(args); err != nil { + if err := validation.ValidateNodeResourcesFitArgs(nil, args); err != nil { return nil, err } - return &Fit{ ignoredResources: sets.NewString(args.IgnoredResources...), ignoredResourceGroups: sets.NewString(args.IgnoredResourceGroups...), }, nil } -func getFitArgs(obj runtime.Object) (config.NodeResourcesFitArgs, error) { - ptr, ok := obj.(*config.NodeResourcesFitArgs) - if !ok { - return config.NodeResourcesFitArgs{}, fmt.Errorf("want args to be of type NodeResourcesFitArgs, got %T", obj) - } - return *ptr, nil -} - // computePodResourceRequest returns a framework.Resource that covers the largest // width in each resource dimension. Because init-containers run sequentially, we collect // the max in each dimension iteratively. In contrast, we sum the resource vectors for diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/least_allocated.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/least_allocated.go index f196f30299a0..5257a2ad20fd 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/least_allocated.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/least_allocated.go @@ -70,8 +70,7 @@ func NewLeastAllocated(laArgs runtime.Object, h framework.Handle) (framework.Plu if !ok { return nil, fmt.Errorf("want args to be of type NodeResourcesLeastAllocatedArgs, got %T", laArgs) } - - if err := validation.ValidateNodeResourcesLeastAllocatedArgs(args); err != nil { + if err := validation.ValidateNodeResourcesLeastAllocatedArgs(nil, args); err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/most_allocated.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/most_allocated.go index 7a7929dfd920..010643c1145b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/most_allocated.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/most_allocated.go @@ -68,8 +68,7 @@ func NewMostAllocated(maArgs runtime.Object, h framework.Handle) (framework.Plug if !ok { return nil, fmt.Errorf("want args to be of type NodeResourcesMostAllocatedArgs, got %T", args) } - - if err := validation.ValidateNodeResourcesMostAllocatedArgs(args); err != nil { + if err := validation.ValidateNodeResourcesMostAllocatedArgs(nil, args); err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go index b0bf7ab4b485..f9d7f9af65d1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go @@ -41,8 +41,7 @@ func NewRequestedToCapacityRatio(plArgs runtime.Object, handle framework.Handle) if err != nil { return nil, err } - - if err := validation.ValidateRequestedToCapacityRatioArgs(args); err != nil { + if err := validation.ValidateRequestedToCapacityRatioArgs(nil, &args); err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go index 6f128d6ab06d..89d3ae2e7c63 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go @@ -31,6 +31,7 @@ type NodeUnschedulable struct { } var _ framework.FilterPlugin = &NodeUnschedulable{} +var _ framework.EnqueueExtensions = &NodeUnschedulable{} // Name is the name of the plugin used in the plugin registry and configurations. const Name = "NodeUnschedulable" @@ -42,6 +43,14 @@ const ( ErrReasonUnschedulable = "node(s) were unschedulable" ) +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *NodeUnschedulable) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + {Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeTaint}, + } +} + // Name returns name of the plugin. It is used in logs, etc. func (pl *NodeUnschedulable) Name() string { return Name diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go index e911a0a4a925..204f022f63a2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go @@ -75,14 +75,14 @@ func (pl *CSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v node := nodeInfo.Node() if node == nil { - return framework.NewStatus(framework.Error, fmt.Sprintf("node not found")) + return framework.NewStatus(framework.Error, fmt.Sprintf("node not found: %s", node.Name)) } // If CSINode doesn't exist, the predicate may read the limits from Node object csiNode, err := pl.csiNodeLister.Get(node.Name) if err != nil { // TODO: return the error once CSINode is created by default (2 releases) - klog.V(5).Infof("Could not get a CSINode object for the node: %v", err) + klog.V(5).InfoS("Could not get a CSINode object for the node", "node", node.Name, "err", err) } newVolumes := make(map[string]string) @@ -149,13 +149,13 @@ func (pl *CSILimits) filterAttachableVolumes( pvc, err := pl.pvcLister.PersistentVolumeClaims(namespace).Get(pvcName) if err != nil { - klog.V(5).Infof("Unable to look up PVC info for %s/%s", namespace, pvcName) + klog.V(5).InfoS("Unable to look up PVC info", "PVC", fmt.Sprintf("%s/%s", namespace, pvcName)) continue } driverName, volumeHandle := pl.getCSIDriverInfo(csiNode, pvc) if driverName == "" || volumeHandle == "" { - klog.V(5).Infof("Could not find a CSI driver name or volume handle, not counting volume") + klog.V(5).Info("Could not find a CSI driver name or volume handle, not counting volume") continue } @@ -175,13 +175,13 @@ func (pl *CSILimits) getCSIDriverInfo(csiNode *storagev1.CSINode, pvc *v1.Persis pvcName := pvc.Name if pvName == "" { - klog.V(5).Infof("Persistent volume had no name for claim %s/%s", namespace, pvcName) + klog.V(5).InfoS("Persistent volume had no name for claim", "PVC", fmt.Sprintf("%s/%s", namespace, pvcName)) return pl.getCSIDriverInfoFromSC(csiNode, pvc) } pv, err := pl.pvLister.Get(pvName) if err != nil { - klog.V(5).Infof("Unable to look up PV info for PVC %s/%s and PV %s", namespace, pvcName, pvName) + klog.V(5).InfoS("Unable to look up PV info for PVC and PV", "PVC", fmt.Sprintf("%s/%s", namespace, pvcName), "PV", pvName) // If we can't fetch PV associated with PVC, may be it got deleted // or PVC was prebound to a PVC that hasn't been created yet. // fallback to using StorageClass for volume counting @@ -197,23 +197,23 @@ func (pl *CSILimits) getCSIDriverInfo(csiNode *storagev1.CSINode, pvc *v1.Persis pluginName, err := pl.translator.GetInTreePluginNameFromSpec(pv, nil) if err != nil { - klog.V(5).Infof("Unable to look up plugin name from PV spec: %v", err) + klog.V(5).InfoS("Unable to look up plugin name from PV spec", "err", err) return "", "" } if !isCSIMigrationOn(csiNode, pluginName) { - klog.V(5).Infof("CSI Migration of plugin %s is not enabled", pluginName) + klog.V(5).InfoS("CSI Migration of plugin is not enabled", "plugin", pluginName) return "", "" } csiPV, err := pl.translator.TranslateInTreePVToCSI(pv) if err != nil { - klog.V(5).Infof("Unable to translate in-tree volume to CSI: %v", err) + klog.V(5).InfoS("Unable to translate in-tree volume to CSI", "err", err) return "", "" } if csiPV.Spec.PersistentVolumeSource.CSI == nil { - klog.V(5).Infof("Unable to get a valid volume source for translated PV %s", pvName) + klog.V(5).InfoS("Unable to get a valid volume source for translated PV", "PV", pvName) return "", "" } @@ -232,13 +232,13 @@ func (pl *CSILimits) getCSIDriverInfoFromSC(csiNode *storagev1.CSINode, pvc *v1. // If StorageClass is not set or not found, then PVC must be using immediate binding mode // and hence it must be bound before scheduling. So it is safe to not count it. if scName == "" { - klog.V(5).Infof("PVC %s/%s has no StorageClass", namespace, pvcName) + klog.V(5).InfoS("PVC has no StorageClass", "PVC", fmt.Sprintf("%s/%s", namespace, pvcName)) return "", "" } storageClass, err := pl.scLister.Get(scName) if err != nil { - klog.V(5).Infof("Could not get StorageClass for PVC %s/%s: %v", namespace, pvcName, err) + klog.V(5).InfoS("Could not get StorageClass for PVC", "PVC", fmt.Sprintf("%s/%s", namespace, pvcName), "err", err) return "", "" } @@ -250,13 +250,13 @@ func (pl *CSILimits) getCSIDriverInfoFromSC(csiNode *storagev1.CSINode, pvc *v1. provisioner := storageClass.Provisioner if pl.translator.IsMigratableIntreePluginByName(provisioner) { if !isCSIMigrationOn(csiNode, provisioner) { - klog.V(5).Infof("CSI Migration of plugin %s is not enabled", provisioner) + klog.V(5).InfoS("CSI Migration of provisioner is not enabled", "provisioner", provisioner) return "", "" } driverName, err := pl.translator.GetCSINameFromInTreeName(provisioner) if err != nil { - klog.V(5).Infof("Unable to look up driver name from plugin name: %v", err) + klog.V(5).InfoS("Unable to look up driver name from provisioner name", "provisioner", provisioner, "err", err) return "", "" } return driverName, volumeHandle diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go index 475d5f11c40b..cbfa7c320f7e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go @@ -18,6 +18,7 @@ package nodevolumelimits import ( "context" + "errors" "fmt" "os" "regexp" @@ -171,8 +172,7 @@ func newNonCSILimits( filter = cinderVolumeFilter volumeLimitKey = v1.ResourceName(volumeutil.CinderVolumeLimitKey) default: - klog.Fatalf("Wrong filterName, Only Support %v %v %v %v", ebsVolumeFilterType, - gcePDVolumeFilterType, azureDiskVolumeFilterType, cinderVolumeFilterType) + klog.ErrorS(errors.New("wrong filterName"), "Cannot create nonCSILimits plugin", "candidates", fmt.Sprintf("%v %v %v %v", ebsVolumeFilterType, gcePDVolumeFilterType, azureDiskVolumeFilterType, cinderVolumeFilterType)) return nil } pl := &nonCSILimits{ @@ -215,7 +215,7 @@ func (pl *nonCSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod node := nodeInfo.Node() if node == nil { - return framework.NewStatus(framework.Error, fmt.Sprintf("node not found")) + return framework.NewStatus(framework.Error, fmt.Sprintf("node not found: %s", node.Name)) } var csiNode *storage.CSINode @@ -225,7 +225,7 @@ func (pl *nonCSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod if err != nil { // we don't fail here because the CSINode object is only necessary // for determining whether the migration is enabled or not - klog.V(5).Infof("Could not get a CSINode object for the node: %v", err) + klog.V(5).InfoS("Could not get a CSINode object for the node", "node", node.Name, "err", err) } } @@ -287,7 +287,7 @@ func (pl *nonCSILimits) filterVolumes(volumes []v1.Volume, namespace string, fil if err != nil || pvc == nil { // If the PVC is invalid, we don't count the volume because // there's no guarantee that it belongs to the running predicate. - klog.V(4).Infof("Unable to look up PVC info for %s/%s, assuming PVC doesn't match predicate when counting limits: %v", namespace, pvcName, err) + klog.V(4).InfoS("Unable to look up PVC info, assuming PVC doesn't match predicate when counting limits", "PVC", fmt.Sprintf("%s/%s", namespace, pvcName), "err", err) continue } @@ -298,7 +298,7 @@ func (pl *nonCSILimits) filterVolumes(volumes []v1.Volume, namespace string, fil // original PV where it was bound to, so we count the volume if // it belongs to the running predicate. if pl.matchProvisioner(pvc) { - klog.V(4).Infof("PVC %s/%s is not bound, assuming PVC matches predicate when counting limits", namespace, pvcName) + klog.V(4).InfoS("PVC is not bound, assuming PVC matches predicate when counting limits", "PVC", fmt.Sprintf("%s/%s", namespace, pvcName)) filteredVolumes.Insert(pvID) } continue @@ -309,7 +309,7 @@ func (pl *nonCSILimits) filterVolumes(volumes []v1.Volume, namespace string, fil // If the PV is invalid and PVC belongs to the running predicate, // log the error and count the PV towards the PV limit. if pl.matchProvisioner(pvc) { - klog.V(4).Infof("Unable to look up PV info for %s/%s/%s, assuming PV matches predicate when counting limits: %v", namespace, pvcName, pvName, err) + klog.V(4).InfoS("Unable to look up PV, assuming PV matches predicate when counting limits", "PV", fmt.Sprintf("%s/%s/%s", namespace, pvcName, pvName), "err", err) filteredVolumes.Insert(pvID) } continue @@ -342,9 +342,9 @@ func (pl *nonCSILimits) matchProvisioner(pvc *v1.PersistentVolumeClaim) bool { func getMaxVolLimitFromEnv() int { if rawMaxVols := os.Getenv(KubeMaxPDVols); rawMaxVols != "" { if parsedMaxVols, err := strconv.Atoi(rawMaxVols); err != nil { - klog.Errorf("Unable to parse maximum PD volumes value, using default: %v", err) + klog.ErrorS(err, "Unable to parse maximum PD volumes value, using default.") } else if parsedMaxVols <= 0 { - klog.Errorf("Maximum PD volumes must be a positive value, using default") + klog.Error("Maximum PD volumes must be a positive value, using default") } else { return parsedMaxVols } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go index c4d9253c1d31..6d86cdc84b6e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go @@ -24,10 +24,9 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" + "k8s.io/component-helpers/scheduling/corev1/nodeaffinity" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/scheduler/framework" - "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper" - "k8s.io/kubernetes/pkg/scheduler/internal/parallelize" ) const preFilterStateKey = "PreFilter" + Name @@ -223,6 +222,7 @@ func (pl *PodTopologySpread) calPreFilterState(pod *v1.Pod) (*preFilterState, er TpKeyToCriticalPaths: make(map[string]*criticalPaths, len(constraints)), TpPairToMatchNum: make(map[topologyPair]*int32, sizeHeuristic(len(allNodes), constraints)), } + requiredSchedulingTerm := nodeaffinity.GetRequiredNodeAffinity(pod) for _, n := range allNodes { node := n.Node() if node == nil { @@ -231,7 +231,9 @@ func (pl *PodTopologySpread) calPreFilterState(pod *v1.Pod) (*preFilterState, er } // In accordance to design, if NodeAffinity or NodeSelector is defined, // spreading is applied to nodes that pass those filters. - if !helper.PodMatchesNodeSelectorAndAffinityTerms(pod, node) { + // Ignore parsing errors for backwards compatibility. + match, _ := requiredSchedulingTerm.Match(node) + if !match { continue } // Ensure current node's labels contains all topologyKeys in 'Constraints'. @@ -258,7 +260,7 @@ func (pl *PodTopologySpread) calPreFilterState(pod *v1.Pod) (*preFilterState, er atomic.AddInt32(tpCount, int32(count)) } } - parallelize.Until(context.Background(), len(allNodes), processNode) + pl.parallelizer.Until(context.Background(), len(allNodes), processNode) // calculate min match for each topology pair for i := 0; i < len(constraints); i++ { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go index d80355b88954..cea232a000cc 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go @@ -27,6 +27,7 @@ import ( "k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/apis/config/validation" "k8s.io/kubernetes/pkg/scheduler/framework" + "k8s.io/kubernetes/pkg/scheduler/internal/parallelize" ) const ( @@ -51,6 +52,7 @@ var systemDefaultConstraints = []v1.TopologySpreadConstraint{ // PodTopologySpread is a plugin that ensures pod's topologySpreadConstraints is satisfied. type PodTopologySpread struct { + parallelizer parallelize.Parallelizer defaultConstraints []v1.TopologySpreadConstraint sharedLister framework.SharedLister services corelisters.ServiceLister @@ -63,6 +65,7 @@ var _ framework.PreFilterPlugin = &PodTopologySpread{} var _ framework.FilterPlugin = &PodTopologySpread{} var _ framework.PreScorePlugin = &PodTopologySpread{} var _ framework.ScorePlugin = &PodTopologySpread{} +var _ framework.EnqueueExtensions = &PodTopologySpread{} const ( // Name is the name of the plugin used in the plugin registry and configurations. @@ -83,10 +86,11 @@ func New(plArgs runtime.Object, h framework.Handle) (framework.Plugin, error) { if err != nil { return nil, err } - if err := validation.ValidatePodTopologySpreadArgs(&args); err != nil { + if err := validation.ValidatePodTopologySpreadArgs(nil, &args); err != nil { return nil, err } pl := &PodTopologySpread{ + parallelizer: h.Parallelizer(), sharedLister: h.SnapshotSharedLister(), defaultConstraints: args.DefaultConstraints, } @@ -116,3 +120,21 @@ func (pl *PodTopologySpread) setListers(factory informers.SharedInformerFactory) pl.replicaSets = factory.Apps().V1().ReplicaSets().Lister() pl.statefulSets = factory.Apps().V1().StatefulSets().Lister() } + +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *PodTopologySpread) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + // All ActionType includes the following events: + // - Add. An unschedulable Pod may fail due to violating topology spread constraints, + // adding an assigned Pod may make it schedulable. + // - Update. Updating on an existing Pod's labels (e.g., removal) may make + // an unschedulable Pod schedulable. + // - Delete. An unschedulable Pod may fail due to violating an existing Pod's topology spread constraints, + // deleting an existing Pod may make it schedulable. + {Resource: framework.Pod, ActionType: framework.All}, + // Node add|delete|updateLabel maybe lead an topology key changed, + // and make these pod in scheduling schedulable or unschedulable. + {Resource: framework.Node, ActionType: framework.Add | framework.Delete | framework.UpdateNodeLabel}, + } +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go index bba5abe9750b..f1b9ff7e6aac 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go @@ -24,9 +24,8 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/component-helpers/scheduling/corev1/nodeaffinity" "k8s.io/kubernetes/pkg/scheduler/framework" - pluginhelper "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper" - "k8s.io/kubernetes/pkg/scheduler/internal/parallelize" ) const preScoreStateKey = "PreScore" + Name @@ -137,6 +136,8 @@ func (pl *PodTopologySpread) PreScore( return nil } + // Ignore parsing errors for backwards compatibility. + requiredNodeAffinity := nodeaffinity.GetRequiredNodeAffinity(pod) processAllNode := func(i int) { nodeInfo := allNodes[i] node := nodeInfo.Node() @@ -145,8 +146,8 @@ func (pl *PodTopologySpread) PreScore( } // (1) `node` should satisfy incoming pod's NodeSelector/NodeAffinity // (2) All topologyKeys need to be present in `node` - if !pluginhelper.PodMatchesNodeSelectorAndAffinityTerms(pod, node) || - !nodeLabelsMatchSpreadConstraints(node.Labels, state.Constraints) { + match, _ := requiredNodeAffinity.Match(node) + if !match || !nodeLabelsMatchSpreadConstraints(node.Labels, state.Constraints) { return } @@ -163,7 +164,7 @@ func (pl *PodTopologySpread) PreScore( atomic.AddInt64(tpCount, int64(count)) } } - parallelize.Until(ctx, len(allNodes), processAllNode) + pl.parallelizer.Until(ctx, len(allNodes), processAllNode) cycleState.Write(preScoreStateKey, state) return nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread/selector_spread.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread/selector_spread.go index 402c1ce69fe9..6a8d04f7b264 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread/selector_spread.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread/selector_spread.go @@ -181,8 +181,7 @@ func (pl *SelectorSpread) PreScore(ctx context.Context, cycleState *framework.Cy if skipSelectorSpread(pod) { return nil } - var selector labels.Selector - selector = helper.DefaultSelector( + selector := helper.DefaultSelector( pod, pl.services, pl.replicationControllers, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go index 4648d7d1e7d9..35a2e103f24f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go @@ -95,6 +95,7 @@ type ServiceAffinity struct { var _ framework.PreFilterPlugin = &ServiceAffinity{} var _ framework.FilterPlugin = &ServiceAffinity{} var _ framework.ScorePlugin = &ServiceAffinity{} +var _ framework.EnqueueExtensions = &ServiceAffinity{} // Name returns name of the plugin. It is used in logs, etc. func (pl *ServiceAffinity) Name() string { @@ -208,6 +209,28 @@ func getPreFilterState(cycleState *framework.CycleState) (*preFilterState, error return s, nil } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *ServiceAffinity) EventsToRegister() []framework.ClusterEvent { + if len(pl.args.AffinityLabels) == 0 { + return nil + } + + return []framework.ClusterEvent{ + // Suppose there is a running Pod backs a Service, and the unschedulable Pod subjects + // to the same Service, but failed because of mis-matched affinity labels. + // - if the running Pod's labels get updated, it may not back the Service anymore, and + // hence make the unschedulable Pod schedulable. + // - if the running Pod gets deleted, the unschedulable Pod may also become schedulable. + {Resource: framework.Pod, ActionType: framework.Update | framework.Delete}, + // A new Node or updating a Node's labels may make a Pod schedulable. + {Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeLabel}, + // Update or delete of a Service may break the correlation of the Pods that previously + // backed it, and hence make a Pod schedulable. + {Resource: framework.Service, ActionType: framework.Update | framework.Delete}, + } +} + // Filter matches nodes in such a way to force that // ServiceAffinity.labels are homogeneous for pods that are scheduled to a node. // (i.e. it returns true IFF this pod can be added to this node such that all other pods in @@ -386,7 +409,7 @@ func (pl *ServiceAffinity) ScoreExtensions() framework.ScoreExtensions { // addUnsetLabelsToMap backfills missing values with values we find in a map. func addUnsetLabelsToMap(aL map[string]string, labelsToAdd []string, labelSet labels.Set) { for _, l := range labelsToAdd { - // if the label is already there, dont overwrite it. + // if the label is already there, don't overwrite it. if _, exists := aL[l]; exists { continue } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go index b60e1ea9dc10..0d3f4d47e5c8 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go @@ -35,6 +35,7 @@ type TaintToleration struct { var _ framework.FilterPlugin = &TaintToleration{} var _ framework.PreScorePlugin = &TaintToleration{} var _ framework.ScorePlugin = &TaintToleration{} +var _ framework.EnqueueExtensions = &TaintToleration{} const ( // Name is the name of the plugin used in the plugin registry and configurations. @@ -50,6 +51,14 @@ func (pl *TaintToleration) Name() string { return Name } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (f *TaintToleration) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + {Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeTaint}, + } +} + // Filter invoked at the filter extension point. func (pl *TaintToleration) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { if nodeInfo == nil || nodeInfo.Node() == nil { @@ -137,7 +146,7 @@ func countIntolerableTaintsPreferNoSchedule(taints []v1.Taint, tolerations []v1. // Score invoked at the Score extension point. func (pl *TaintToleration) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { nodeInfo, err := pl.handle.SnapshotSharedLister().NodeInfos().Get(nodeName) - if err != nil || nodeInfo.Node() == nil { + if err != nil { return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err)) } node := nodeInfo.Node() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go index c20784b5161b..72463c4d90dd 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go @@ -341,7 +341,7 @@ func New(plArgs runtime.Object, fh framework.Handle) (framework.Plugin, error) { if !ok { return nil, fmt.Errorf("want args to be of type VolumeBindingArgs, got %T", plArgs) } - if err := validation.ValidateVolumeBindingArgs(args); err != nil { + if err := validation.ValidateVolumeBindingArgs(nil, args); err != nil { return nil, err } podInformer := fh.SharedInformerFactory().Core().V1().Pods() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go index c1cdafe61944..faf8d02175a4 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go @@ -29,6 +29,7 @@ import ( type VolumeRestrictions struct{} var _ framework.FilterPlugin = &VolumeRestrictions{} +var _ framework.EnqueueExtensions = &VolumeRestrictions{} // Name is the name of the plugin used in the plugin registry and configurations. const Name = "VolumeRestrictions" @@ -130,6 +131,19 @@ func (pl *VolumeRestrictions) Filter(ctx context.Context, _ *framework.CycleStat return nil } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *VolumeRestrictions) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + // Pods may fail to schedule because of volumes conflicting with other pods on same node. + // Once running pods are deleted and volumes have been released, the unschedulable pod will be schedulable. + // Due to immutable fields `spec.volumes`, pod update events are ignored. + {Resource: framework.Pod, ActionType: framework.Delete}, + // A new Node may make a pod schedulable. + {Resource: framework.Node, ActionType: framework.Add}, + } +} + // New initializes a new plugin and returns it. func New(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) { return &VolumeRestrictions{}, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone/volume_zone.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone/volume_zone.go index 91fb62e9aac3..39c978e29a0b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone/volume_zone.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone/volume_zone.go @@ -40,6 +40,7 @@ type VolumeZone struct { } var _ framework.FilterPlugin = &VolumeZone{} +var _ framework.EnqueueExtensions = &VolumeZone{} const ( // Name is the name of the plugin used in the plugin registry and configurations. @@ -115,15 +116,11 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod * return framework.AsStatus(err) } - if pvc == nil { - return framework.NewStatus(framework.Error, fmt.Sprintf("PersistentVolumeClaim was not found: %q", pvcName)) - } - pvName := pvc.Spec.VolumeName if pvName == "" { scName := storagehelpers.GetPersistentVolumeClaimClass(pvc) if len(scName) == 0 { - return framework.NewStatus(framework.Error, fmt.Sprint("PersistentVolumeClaim had no pv name and storageClass name")) + return framework.NewStatus(framework.Error, "PersistentVolumeClaim had no pv name and storageClass name") } class, _ := pl.scLister.Get(scName) @@ -139,7 +136,7 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod * continue } - return framework.NewStatus(framework.Error, fmt.Sprint("PersistentVolume had no name")) + return framework.NewStatus(framework.Error, "PersistentVolume had no name") } pv, err := pl.pvLister.Get(pvName) @@ -147,15 +144,11 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod * return framework.AsStatus(err) } - if pv == nil { - return framework.NewStatus(framework.Error, fmt.Sprintf("PersistentVolume was not found: %q", pvName)) - } - for k, v := range pv.ObjectMeta.Labels { if !volumeZoneLabels.Has(k) { continue } - nodeV, _ := nodeConstraints[k] + nodeV := nodeConstraints[k] volumeVSet, err := volumehelpers.LabelZonesToSet(v) if err != nil { klog.InfoS("Failed to parse label, ignoring the label", "label", fmt.Sprintf("%s:%s", k, v), "err", err) @@ -171,6 +164,23 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod * return nil } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *VolumeZone) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + // New storageClass with bind mode `VolumeBindingWaitForFirstConsumer` will make a pod schedulable. + // Due to immutable field `storageClass.volumeBindingMode`, storageClass update events are ignored. + {Resource: framework.StorageClass, ActionType: framework.Add}, + // A new node or updating a node's volume zone labels may make a pod schedulable. + {Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeLabel}, + // A new pvc may make a pod schedulable. + // Due to fields are immutable except `spec.resources`, pvc update events are ignored. + {Resource: framework.PersistentVolumeClaim, ActionType: framework.Add}, + // A new pv or updating a pv's volume zone labels may make a pod shedulable. + {Resource: framework.PersistentVolume, ActionType: framework.Add | framework.Update}, + } +} + // New initializes a new plugin and returns it. func New(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) { informerFactory := handle.SharedInformerFactory() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go index a6305e07d038..ae7fef1f9d8a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go @@ -29,6 +29,7 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/informers" clientset "k8s.io/client-go/kubernetes" + restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/events" "k8s.io/component-helpers/scheduling/corev1" "k8s.io/klog/v2" @@ -66,7 +67,6 @@ var allClusterEvents = []framework.ClusterEvent{ {Resource: framework.CSINode, ActionType: framework.All}, {Resource: framework.PersistentVolume, ActionType: framework.All}, {Resource: framework.PersistentVolumeClaim, ActionType: framework.All}, - {Resource: framework.Service, ActionType: framework.All}, {Resource: framework.StorageClass, ActionType: framework.All}, } @@ -92,6 +92,7 @@ type frameworkImpl struct { permitPlugins []framework.PermitPlugin clientSet clientset.Interface + kubeConfig *restclient.Config eventRecorder events.EventRecorder informerFactory informers.SharedInformerFactory @@ -101,6 +102,8 @@ type frameworkImpl struct { extenders []framework.Extender framework.PodNominator + parallelizer parallelize.Parallelizer + // Indicates that RunFilterPlugins should accumulate all failed statuses and not return // after the first failure. runAllFilters bool @@ -140,6 +143,7 @@ func (f *frameworkImpl) Extenders() []framework.Extender { type frameworkOptions struct { clientSet clientset.Interface + kubeConfig *restclient.Config eventRecorder events.EventRecorder informerFactory informers.SharedInformerFactory snapshotSharedLister framework.SharedLister @@ -149,6 +153,7 @@ type frameworkOptions struct { runAllFilters bool captureProfile CaptureProfile clusterEventMap map[framework.ClusterEvent]sets.String + parallelizer parallelize.Parallelizer } // Option for the frameworkImpl. @@ -161,6 +166,13 @@ func WithClientSet(clientSet clientset.Interface) Option { } } +// WithKubeConfig sets kubeConfig for the scheduling frameworkImpl. +func WithKubeConfig(kubeConfig *restclient.Config) Option { + return func(o *frameworkOptions) { + o.kubeConfig = kubeConfig + } +} + // WithEventRecorder sets clientSet for the scheduling frameworkImpl. func WithEventRecorder(recorder events.EventRecorder) Option { return func(o *frameworkOptions) { @@ -190,13 +202,6 @@ func WithRunAllFilters(runAllFilters bool) Option { } } -// withMetricsRecorder is only used in tests. -func withMetricsRecorder(recorder *metricsRecorder) Option { - return func(o *frameworkOptions) { - o.metricsRecorder = recorder - } -} - // WithPodNominator sets podNominator for the scheduling frameworkImpl. func WithPodNominator(nominator framework.PodNominator) Option { return func(o *frameworkOptions) { @@ -211,6 +216,13 @@ func WithExtenders(extenders []framework.Extender) Option { } } +// WithParallelism sets parallelism for the scheduling frameworkImpl. +func WithParallelism(parallelism int) Option { + return func(o *frameworkOptions) { + o.parallelizer = parallelize.NewParallelizer(parallelism) + } +} + // CaptureProfile is a callback to capture a finalized profile. type CaptureProfile func(config.KubeSchedulerProfile) @@ -225,6 +237,7 @@ func defaultFrameworkOptions() frameworkOptions { return frameworkOptions{ metricsRecorder: newMetricsRecorder(1000, time.Second), clusterEventMap: make(map[framework.ClusterEvent]sets.String), + parallelizer: parallelize.NewParallelizer(parallelize.DefaultParallelism), } } @@ -250,12 +263,14 @@ func NewFramework(r Registry, profile *config.KubeSchedulerProfile, opts ...Opti pluginNameToWeightMap: make(map[string]int), waitingPods: newWaitingPodsMap(), clientSet: options.clientSet, + kubeConfig: options.kubeConfig, eventRecorder: options.eventRecorder, informerFactory: options.informerFactory, metricsRecorder: options.metricsRecorder, runAllFilters: options.runAllFilters, extenders: options.extenders, PodNominator: options.podNominator, + parallelizer: options.parallelizer, } if profile == nil { @@ -764,7 +779,7 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy errCh := parallelize.NewErrorChannel() // Run Score method for each node in parallel. - parallelize.Until(ctx, len(nodes), func(index int) { + f.Parallelizer().Until(ctx, len(nodes), func(index int) { for _, pl := range f.scorePlugins { nodeName := nodes[index].Name s, status := f.runScorePlugin(ctx, pl, state, pod, nodeName) @@ -784,7 +799,7 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy } // Run NormalizeScore method for each ScorePlugin in parallel. - parallelize.Until(ctx, len(f.scorePlugins), func(index int) { + f.Parallelizer().Until(ctx, len(f.scorePlugins), func(index int) { pl := f.scorePlugins[index] nodeScoreList := pluginToNodeScores[pl.Name()] if pl.ScoreExtensions() == nil { @@ -802,7 +817,7 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy } // Apply score defaultWeights for each ScorePlugin in parallel. - parallelize.Until(ctx, len(f.scorePlugins), func(index int) { + f.Parallelizer().Until(ctx, len(f.scorePlugins), func(index int) { pl := f.scorePlugins[index] // Score plugins' weight has been checked when they are initialized. weight := f.pluginNameToWeightMap[pl.Name()] @@ -1144,6 +1159,11 @@ func (f *frameworkImpl) ClientSet() clientset.Interface { return f.clientSet } +// KubeConfig returns a kubernetes config. +func (f *frameworkImpl) KubeConfig() *restclient.Config { + return f.kubeConfig +} + // EventRecorder returns an event recorder. func (f *frameworkImpl) EventRecorder() events.EventRecorder { return f.eventRecorder @@ -1176,3 +1196,8 @@ func (f *frameworkImpl) pluginsNeeded(plugins *config.Plugins) map[string]config func (f *frameworkImpl) ProfileName() string { return f.profileName } + +// Parallelizer returns a parallelizer holding parallelism for scheduler. +func (f *frameworkImpl) Parallelizer() parallelize.Parallelizer { + return f.parallelizer +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/types.go index a29c07915100..c632260b902d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/types.go @@ -25,15 +25,13 @@ import ( "sync/atomic" "time" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/klog/v2" - v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" "k8s.io/kubernetes/pkg/features" schedutil "k8s.io/kubernetes/pkg/scheduler/util" ) @@ -75,15 +73,18 @@ const ( WildCard GVK = "*" ) -// WildCardEvent semantically matches all resources on all actions. -var WildCardEvent = ClusterEvent{Resource: WildCard, ActionType: All} - // ClusterEvent abstracts how a system resource's state gets changed. // Resource represents the standard API resources such as Pod, Node, etc. // ActionType denotes the specific change such as Add, Update or Delete. type ClusterEvent struct { Resource GVK ActionType ActionType + Label string +} + +// IsWildCard returns true if ClusterEvent follows WildCard semantics +func (ce ClusterEvent) IsWildCard() bool { + return ce.Resource == WildCard && ce.ActionType == All } // QueuedPodInfo is a Pod wrapper with additional information related to @@ -493,24 +494,6 @@ func (r *Resource) Add(rl v1.ResourceList) { } } -// ResourceList returns a resource list of this resource. -func (r *Resource) ResourceList() v1.ResourceList { - result := v1.ResourceList{ - v1.ResourceCPU: *resource.NewMilliQuantity(r.MilliCPU, resource.DecimalSI), - v1.ResourceMemory: *resource.NewQuantity(r.Memory, resource.BinarySI), - v1.ResourcePods: *resource.NewQuantity(int64(r.AllowedPodNumber), resource.BinarySI), - v1.ResourceEphemeralStorage: *resource.NewQuantity(r.EphemeralStorage, resource.BinarySI), - } - for rName, rQuant := range r.ScalarResources { - if v1helper.IsHugePageResourceName(rName) { - result[rName] = *resource.NewQuantity(rQuant, resource.BinarySI) - } else { - result[rName] = *resource.NewQuantity(rQuant, resource.DecimalSI) - } - } - return result -} - // Clone returns a copy of this resource. func (r *Resource) Clone() *Resource { res := &Resource{ @@ -551,25 +534,16 @@ func (r *Resource) SetMaxResource(rl v1.ResourceList) { for rName, rQuantity := range rl { switch rName { case v1.ResourceMemory: - if mem := rQuantity.Value(); mem > r.Memory { - r.Memory = mem - } + r.Memory = max(r.Memory, rQuantity.Value()) case v1.ResourceCPU: - if cpu := rQuantity.MilliValue(); cpu > r.MilliCPU { - r.MilliCPU = cpu - } + r.MilliCPU = max(r.MilliCPU, rQuantity.MilliValue()) case v1.ResourceEphemeralStorage: if utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) { - if ephemeralStorage := rQuantity.Value(); ephemeralStorage > r.EphemeralStorage { - r.EphemeralStorage = ephemeralStorage - } + r.EphemeralStorage = max(r.EphemeralStorage, rQuantity.Value()) } default: if schedutil.IsScalarResourceName(rName) { - value := rQuantity.Value() - if value > r.ScalarResources[rName] { - r.SetScalar(rName, value) - } + r.SetScalar(rName, max(r.ScalarResources[rName], rQuantity.Value())) } } } @@ -770,6 +744,13 @@ func (n *NodeInfo) resetSlicesIfEmpty() { } } +func max(a, b int64) int64 { + if a >= b { + return a + } + return b +} + // resourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead func calculateResource(pod *v1.Pod) (res Resource, non0CPU int64, non0Mem int64) { resPtr := &res @@ -784,13 +765,8 @@ func calculateResource(pod *v1.Pod) (res Resource, non0CPU int64, non0Mem int64) for _, ic := range pod.Spec.InitContainers { resPtr.SetMaxResource(ic.Resources.Requests) non0CPUReq, non0MemReq := schedutil.GetNonzeroRequests(&ic.Resources.Requests) - if non0CPU < non0CPUReq { - non0CPU = non0CPUReq - } - - if non0Mem < non0MemReq { - non0Mem = non0MemReq - } + non0CPU = max(non0CPU, non0CPUReq) + non0Mem = max(non0Mem, non0MemReq) } // If Overhead is being utilized, add to the total requests for the pod @@ -824,12 +800,11 @@ func (n *NodeInfo) updateUsedPorts(pod *v1.Pod, add bool) { } // SetNode sets the overall node information. -func (n *NodeInfo) SetNode(node *v1.Node) error { +func (n *NodeInfo) SetNode(node *v1.Node) { n.node = node n.Allocatable = NewResource(node.Status.Allocatable) n.TransientInfo = NewTransientSchedulerInfo() n.Generation = nextGeneration() - return nil } // RemoveNode removes the node object, leaving all other tracking information. @@ -876,7 +851,7 @@ func (n *NodeInfo) FilterOutPods(pods []*v1.Pod) []*v1.Pod { func GetPodKey(pod *v1.Pod) (string, error) { uid := string(pod.UID) if len(uid) == 0 { - return "", errors.New("Cannot get cache key for pod with empty UID") + return "", errors.New("cannot get cache key for pod with empty UID") } return uid, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/internal/parallelize/parallelism.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/internal/parallelize/parallelism.go index db2df1c5eaa1..55f54a50bbd6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/internal/parallelize/parallelism.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/internal/parallelize/parallelism.go @@ -23,25 +23,23 @@ import ( "k8s.io/client-go/util/workqueue" ) -var ( - parallelism = 16 -) +// DefaultParallelism is the default parallelism used in scheduler. +const DefaultParallelism int = 16 -// GetParallelism returns the currently set parallelism. -func GetParallelism() int { - return parallelism +// Parallelizer holds the parallelism for scheduler. +type Parallelizer struct { + parallelism int } -// SetParallelism sets the parallelism for all scheduler algorithms. -// TODO(#95952): Remove global setter in favor of a struct that holds the configuration. -func SetParallelism(p int) { - parallelism = p +// NewParallelizer returns an object holding the parallelism. +func NewParallelizer(p int) Parallelizer { + return Parallelizer{parallelism: p} } // chunkSizeFor returns a chunk size for the given number of items to use for // parallel work. The size aims to produce good CPU utilization. // returns max(1, min(sqrt(n), n/Parallelism)) -func chunkSizeFor(n int) int { +func chunkSizeFor(n, parallelism int) int { s := int(math.Sqrt(float64(n))) if r := n/parallelism + 1; s > r { @@ -53,6 +51,6 @@ func chunkSizeFor(n int) int { } // Until is a wrapper around workqueue.ParallelizeUntil to use in scheduling algorithms. -func Until(ctx context.Context, pieces int, doWorkPiece workqueue.DoWorkPieceFunc) { - workqueue.ParallelizeUntil(ctx, parallelism, pieces, doWorkPiece, workqueue.WithChunkSize(chunkSizeFor(pieces))) +func (p Parallelizer) Until(ctx context.Context, pieces int, doWorkPiece workqueue.DoWorkPieceFunc) { + workqueue.ParallelizeUntil(ctx, p.parallelism, pieces, doWorkPiece, workqueue.WithChunkSize(chunkSizeFor(pieces, p.parallelism))) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/security/apparmor/validate.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/security/apparmor/validate.go index 210ff99fe107..eb0b96f6f702 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/security/apparmor/validate.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/security/apparmor/validate.go @@ -20,11 +20,11 @@ import ( "bufio" "errors" "fmt" - "io/ioutil" "os" "path" "strings" + "github.com/opencontainers/runc/libcontainer/apparmor" v1 "k8s.io/api/core/v1" utilfeature "k8s.io/apiserver/pkg/util/feature" podutil "k8s.io/kubernetes/pkg/api/v1/pod" @@ -107,7 +107,7 @@ func validateHost(runtime string) error { } // Check kernel support. - if !IsAppArmorEnabled() { + if !apparmor.IsEnabled() { return errors.New("AppArmor is not enabled on the host") } @@ -212,17 +212,3 @@ func getAppArmorFS() (string, error) { return "", errors.New("securityfs not found") } - -// IsAppArmorEnabled returns true if apparmor is enabled for the host. -// This function is forked from -// https://github.com/opencontainers/runc/blob/1a81e9ab1f138c091fe5c86d0883f87716088527/libcontainer/apparmor/apparmor.go -// to avoid the libapparmor dependency. -func IsAppArmorEnabled() bool { - if _, err := os.Stat("/sys/kernel/security/apparmor"); err == nil && os.Getenv("container") == "" { - if _, err = os.Stat("/sbin/apparmor_parser"); err == nil { - buf, err := ioutil.ReadFile("/sys/module/apparmor/parameters/enabled") - return err == nil && len(buf) > 1 && buf[0] == 'Y' - } - } - return false -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_util.go index 4a3ae61e9558..e5f8e7fc6132 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_util.go @@ -41,8 +41,9 @@ import ( ) const ( - diskPartitionSuffix = "" - checkSleepDuration = time.Second + diskPartitionSuffix = "" + nvmeDiskPartitionSuffix = "p" + checkSleepDuration = time.Second ) // AWSDiskUtil provides operations for EBS volume. @@ -240,6 +241,9 @@ func getDiskByIDPaths(volumeID aws.KubernetesVolumeID, partition string, deviceP if err != nil { klog.Warningf("error looking for nvme volume %q: %v", volumeID, err) } else if nvmePath != "" { + if partition != "" { + nvmePath = nvmePath + nvmeDiskPartitionSuffix + partition + } devicePaths = append(devicePaths, nvmePath) } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_file.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_file.go index 08b02a782f6a..77196a15e6ca 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_file.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_file.go @@ -56,7 +56,6 @@ var _ volume.ExpandableVolumePlugin = &azureFilePlugin{} const ( azureFilePluginName = "kubernetes.io/azure-file" - defaultSecretNamespace = "default" minimumPremiumShareSize = 100 // GB ) @@ -117,7 +116,7 @@ func (plugin *azureFilePlugin) newMounterInternal(spec *volume.Spec, pod *v1.Pod if err != nil { return nil, err } - secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defaultSecretNamespace) + secretName, secretNamespace, err := getSecretNameAndNamespace(spec, pod.Namespace) if err != nil { // Log-and-continue instead of returning an error for now // due to unspecified backwards compatibility concerns (a subject to revise) @@ -175,7 +174,7 @@ func (plugin *azureFilePlugin) ExpandVolumeDevice( resourceGroup = spec.PersistentVolume.ObjectMeta.Annotations[resourceGroupAnnotation] } - secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defaultSecretNamespace) + secretName, secretNamespace, err := getSecretNameAndNamespace(spec, spec.PersistentVolume.Spec.ClaimRef.Namespace) if err != nil { return oldSize, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_provision.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_provision.go index a9dc31b69090..4fa7f5b28853 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_provision.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_provision.go @@ -79,7 +79,7 @@ func (plugin *azureFilePlugin) newDeleterInternal(spec *volume.Spec, util azureU return nil, fmt.Errorf("invalid PV spec") } - secretName, secretNamespace, err := getSecretNameAndNamespace(spec, defaultSecretNamespace) + secretName, secretNamespace, err := getSecretNameAndNamespace(spec, spec.PersistentVolume.Spec.ClaimRef.Namespace) if err != nil { return nil, err } @@ -198,9 +198,10 @@ func (a *azureFileProvisioner) Provision(selectedNode *v1.Node, allowedTopologie } if shareName == "" { - // File share name has a length limit of 63, and it cannot contain two consecutive '-'s. + // File share name has a length limit of 63, it cannot contain two consecutive '-'s, and all letters must be lower case. name := util.GenerateVolumeName(a.options.ClusterName, a.options.PVName, 63) shareName = strings.Replace(name, "--", "-", -1) + shareName = strings.ToLower(shareName) } if resourceGroup == "" { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_block.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_block.go index 2f1d542237aa..687f2bc43859 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_block.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_block.go @@ -93,7 +93,9 @@ type csiBlockMapper struct { volumeID string readOnly bool spec *volume.Spec + pod *v1.Pod podUID types.UID + volume.MetricsProvider } var _ volume.BlockVolumeMapper = &csiBlockMapper{} @@ -210,8 +212,21 @@ func (m *csiBlockMapper) publishVolumeForBlock( publishVolumeInfo = attachment.Status.AttachmentMetadata } + // Inject pod information into volume_attributes + volAttribs := csiSource.VolumeAttributes + podInfoEnabled, err := m.plugin.podInfoEnabled(string(m.driverName)) + if err != nil { + return "", errors.New(log("blockMapper.publishVolumeForBlock failed to assemble volume attributes: %v", err)) + } + volumeLifecycleMode, err := m.plugin.getVolumeLifecycleMode(m.spec) + if err != nil { + return "", errors.New(log("blockMapper.publishVolumeForBlock failed to get VolumeLifecycleMode: %v", err)) + } + if podInfoEnabled { + volAttribs = mergeMap(volAttribs, getPodInfoAttrs(m.pod, volumeLifecycleMode)) + } + nodePublishSecrets := map[string]string{} - var err error if csiSource.NodePublishSecretRef != nil { nodePublishSecrets, err = getCredentialsFromSecret(m.k8s, csiSource.NodePublishSecretRef) if err != nil { @@ -241,7 +256,7 @@ func (m *csiBlockMapper) publishVolumeForBlock( publishPath, accessMode, publishVolumeInfo, - csiSource.VolumeAttributes, + volAttribs, nodePublishSecrets, fsTypeBlockName, []string{}, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_client.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_client.go index c4175851378d..ce75b0bd589c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_client.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_client.go @@ -30,7 +30,9 @@ import ( "google.golang.org/grpc/status" api "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/volume" volumetypes "k8s.io/kubernetes/pkg/volume/util/types" ) @@ -624,6 +626,19 @@ func (c *csiDriverClient) NodeGetVolumeStats(ctx context.Context, volID string, Inodes: resource.NewQuantity(int64(0), resource.BinarySI), InodesFree: resource.NewQuantity(int64(0), resource.BinarySI), } + + if utilfeature.DefaultFeatureGate.Enabled(features.CSIVolumeHealth) { + isSupportNodeVolumeCondition, err := supportNodeGetVolumeCondition(ctx, nodeClient) + if err != nil { + return nil, err + } + + if isSupportNodeVolumeCondition { + abnormal, message := resp.VolumeCondition.GetAbnormal(), resp.VolumeCondition.GetMessage() + metrics.Abnormal, metrics.Message = &abnormal, &message + } + } + for _, usage := range usages { if usage == nil { continue @@ -646,6 +661,30 @@ func (c *csiDriverClient) NodeGetVolumeStats(ctx context.Context, volID string, return metrics, nil } +func supportNodeGetVolumeCondition(ctx context.Context, nodeClient csipbv1.NodeClient) (supportNodeGetVolumeCondition bool, err error) { + req := csipbv1.NodeGetCapabilitiesRequest{} + rsp, err := nodeClient.NodeGetCapabilities(ctx, &req) + if err != nil { + return false, err + } + + for _, cap := range rsp.GetCapabilities() { + if cap == nil { + continue + } + rpc := cap.GetRpc() + if rpc == nil { + continue + } + t := rpc.GetType() + if t == csipbv1.NodeServiceCapability_RPC_VOLUME_CONDITION { + return true, nil + } + } + + return false, nil +} + func isFinalError(err error) bool { // Sources: // https://github.com/grpc/grpc/blob/master/doc/statuscodes.md diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_mounter.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_mounter.go index d632ffd1433b..7e98dea45ca6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_mounter.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_mounter.go @@ -23,7 +23,6 @@ import ( "fmt" "os" "path/filepath" - "strconv" "k8s.io/klog/v2" @@ -221,11 +220,13 @@ func (c *csiMountMgr) SetUpAt(dir string, mounterArgs volume.MounterArgs) error } // Inject pod information into volume_attributes - podAttrs, err := c.podAttributes() + podInfoEnabled, err := c.plugin.podInfoEnabled(string(c.driverName)) if err != nil { return volumetypes.NewTransientOperationFailure(log("mounter.SetUpAt failed to assemble volume attributes: %v", err)) } - volAttribs = mergeMap(volAttribs, podAttrs) + if podInfoEnabled { + volAttribs = mergeMap(volAttribs, getPodInfoAttrs(c.pod, c.volumeLifecycleMode)) + } // Inject pod service account token into volume attributes if utilfeature.DefaultFeatureGate.Enabled(features.CSIServiceAccountToken) { @@ -282,45 +283,6 @@ func (c *csiMountMgr) SetUpAt(dir string, mounterArgs volume.MounterArgs) error return nil } -func (c *csiMountMgr) podAttributes() (map[string]string, error) { - kletHost, ok := c.plugin.host.(volume.KubeletVolumeHost) - if ok { - kletHost.WaitForCacheSync() - } - - if c.plugin.csiDriverLister == nil { - return nil, fmt.Errorf("CSIDriverLister not found") - } - - csiDriver, err := c.plugin.csiDriverLister.Get(string(c.driverName)) - if err != nil { - if apierrors.IsNotFound(err) { - klog.V(4).Infof(log("CSIDriver %q not found, not adding pod information", c.driverName)) - return nil, nil - } - return nil, err - } - - // if PodInfoOnMount is not set or false we do not set pod attributes - if csiDriver.Spec.PodInfoOnMount == nil || *csiDriver.Spec.PodInfoOnMount == false { - klog.V(4).Infof(log("CSIDriver %q does not require pod information", c.driverName)) - return nil, nil - } - - attrs := map[string]string{ - "csi.storage.k8s.io/pod.name": c.pod.Name, - "csi.storage.k8s.io/pod.namespace": c.pod.Namespace, - "csi.storage.k8s.io/pod.uid": string(c.pod.UID), - "csi.storage.k8s.io/serviceAccount.name": c.pod.Spec.ServiceAccountName, - } - if utilfeature.DefaultFeatureGate.Enabled(features.CSIInlineVolume) { - attrs["csi.storage.k8s.io/ephemeral"] = strconv.FormatBool(c.volumeLifecycleMode == storage.VolumeLifecycleEphemeral) - } - - klog.V(4).Infof(log("CSIDriver %q requires pod information", c.driverName)) - return attrs, nil -} - func (c *csiMountMgr) podServiceAccountTokenAttrs() (map[string]string, error) { if c.plugin.serviceAccountTokenGetter == nil { return nil, errors.New("ServiceAccountTokenGetter is nil") @@ -403,7 +365,11 @@ func (c *csiMountMgr) TearDownAt(dir string) error { return errors.New(log("mounter.TearDownAt failed: %v", err)) } - // clean mount point dir + // Deprecation: Removal of target_path provided in the NodePublish RPC call + // (in this case location `dir`) MUST be done by the CSI plugin according + // to the spec. This will no longer be done directly as part of TearDown + // by the kubelet in the future. Kubelet will only be responsible for + // removal of json data files it creates and parent directories. if err := removeMountDir(c.plugin, dir); err != nil { return errors.New(log("mounter.TearDownAt failed to clean mount dir [%s]: %v", dir, err)) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_plugin.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_plugin.go index 85c1c1f3db18..207b6e587dcb 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_plugin.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_plugin.go @@ -685,6 +685,7 @@ func (p *csiPlugin) NewBlockVolumeMapper(spec *volume.Spec, podRef *api.Pod, opt readOnly: readOnly, spec: spec, specName: spec.Name(), + pod: podRef, podUID: podRef.UID, } mapper.csiClientGetter.driverName = csiDriverName(pvSource.Driver) @@ -697,6 +698,13 @@ func (p *csiPlugin) NewBlockVolumeMapper(spec *volume.Spec, podRef *api.Pod, opt } klog.V(4).Info(log("created path successfully [%s]", dataDir)) + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, errors.New(log("failed to get device path: %v", err)) + } + + mapper.MetricsProvider = NewMetricsCsi(pvSource.VolumeHandle, blockPath+"/"+string(podRef.UID), csiDriverName(pvSource.Driver)) + // persist volume info data for teardown node := string(p.host.GetNodeName()) attachID := getAttachmentName(pvSource.VolumeHandle, pvSource.Driver, node) @@ -959,6 +967,34 @@ func (p *csiPlugin) newAttacherDetacher() (*csiAttacher, error) { }, nil } +// podInfoEnabled check CSIDriver enabled pod info flag +func (p *csiPlugin) podInfoEnabled(driverName string) (bool, error) { + kletHost, ok := p.host.(volume.KubeletVolumeHost) + if ok { + kletHost.WaitForCacheSync() + } + + if p.csiDriverLister == nil { + return false, fmt.Errorf("CSIDriverLister not found") + } + + csiDriver, err := p.csiDriverLister.Get(driverName) + if err != nil { + if apierrors.IsNotFound(err) { + klog.V(4).Infof(log("CSIDriver %q not found, not adding pod information", driverName)) + return false, nil + } + return false, err + } + + // if PodInfoOnMount is not set or false we do not set pod attributes + if csiDriver.Spec.PodInfoOnMount == nil || *csiDriver.Spec.PodInfoOnMount == false { + klog.V(4).Infof(log("CSIDriver %q does not require pod information", driverName)) + return false, nil + } + return true, nil +} + func unregisterDriver(driverName string) error { csiDrivers.Delete(driverName) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_util.go index dec72a46bad7..ad9098b4ef87 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_util.go @@ -27,6 +27,7 @@ import ( "time" api "k8s.io/api/core/v1" + storage "k8s.io/api/storage/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/kubernetes" @@ -203,3 +204,17 @@ func createCSIOperationContext(volumeSpec *volume.Spec, timeout time.Duration) ( ctx := context.WithValue(context.Background(), additionalInfoKey, additionalInfo{Migrated: strconv.FormatBool(migrated)}) return context.WithTimeout(ctx, timeout) } + +// getPodInfoAttrs returns pod info for NodePublish +func getPodInfoAttrs(pod *api.Pod, volumeMode storage.VolumeLifecycleMode) map[string]string { + attrs := map[string]string{ + "csi.storage.k8s.io/pod.name": pod.Name, + "csi.storage.k8s.io/pod.namespace": pod.Namespace, + "csi.storage.k8s.io/pod.uid": string(pod.UID), + "csi.storage.k8s.io/serviceAccount.name": pod.Spec.ServiceAccountName, + } + if utilfeature.DefaultFeatureGate.Enabled(features.CSIInlineVolume) { + attrs["csi.storage.k8s.io/ephemeral"] = strconv.FormatBool(volumeMode == storage.VolumeLifecycleEphemeral) + } + return attrs +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/nodeinfomanager/nodeinfomanager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/nodeinfomanager/nodeinfomanager.go index 5168bdbd4e45..d7c709eb5ba8 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/nodeinfomanager/nodeinfomanager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/nodeinfomanager/nodeinfomanager.go @@ -326,7 +326,7 @@ func removeNodeIDFromNode(csiDriverName string) nodeUpdateFunc { // topology information. func updateTopologyLabels(topology map[string]string) nodeUpdateFunc { return func(node *v1.Node) (*v1.Node, bool, error) { - if topology == nil || len(topology) == 0 { + if len(topology) == 0 { return node, false, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csimigration/plugin_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csimigration/plugin_manager.go index 143e2a41dd9e..8870d12c3b38 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csimigration/plugin_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csimigration/plugin_manager.go @@ -21,7 +21,6 @@ import ( "fmt" v1 "k8s.io/api/core/v1" - utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/component-base/featuregate" csilibplugins "k8s.io/csi-translation-lib/plugins" "k8s.io/kubernetes/pkg/features" @@ -38,12 +37,14 @@ type PluginNameMapper interface { // PluginManager keeps track of migrated state of in-tree plugins type PluginManager struct { PluginNameMapper + featureGate featuregate.FeatureGate } // NewPluginManager returns a new PluginManager instance -func NewPluginManager(m PluginNameMapper) PluginManager { +func NewPluginManager(m PluginNameMapper, featureGate featuregate.FeatureGate) PluginManager { return PluginManager{ PluginNameMapper: m, + featureGate: featureGate, } } @@ -60,17 +61,17 @@ func (pm PluginManager) IsMigrationCompleteForPlugin(pluginName string) bool { switch pluginName { case csilibplugins.AWSEBSInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.InTreePluginAWSUnregister) + return pm.featureGate.Enabled(features.InTreePluginAWSUnregister) case csilibplugins.GCEPDInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.InTreePluginGCEUnregister) + return pm.featureGate.Enabled(features.InTreePluginGCEUnregister) case csilibplugins.AzureFileInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.InTreePluginAzureFileUnregister) + return pm.featureGate.Enabled(features.InTreePluginAzureFileUnregister) case csilibplugins.AzureDiskInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.InTreePluginAzureDiskUnregister) + return pm.featureGate.Enabled(features.InTreePluginAzureDiskUnregister) case csilibplugins.CinderInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.InTreePluginOpenStackUnregister) + return pm.featureGate.Enabled(features.InTreePluginOpenStackUnregister) case csilibplugins.VSphereInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationvSphereComplete) || utilfeature.DefaultFeatureGate.Enabled(features.InTreePluginvSphereUnregister) + return pm.featureGate.Enabled(features.CSIMigrationvSphereComplete) || pm.featureGate.Enabled(features.InTreePluginvSphereUnregister) default: return false } @@ -80,23 +81,23 @@ func (pm PluginManager) IsMigrationCompleteForPlugin(pluginName string) bool { // for a particular storage plugin func (pm PluginManager) IsMigrationEnabledForPlugin(pluginName string) bool { // CSIMigration feature should be enabled along with the plugin-specific one - if !utilfeature.DefaultFeatureGate.Enabled(features.CSIMigration) { + if !pm.featureGate.Enabled(features.CSIMigration) { return false } switch pluginName { case csilibplugins.AWSEBSInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationAWS) + return pm.featureGate.Enabled(features.CSIMigrationAWS) case csilibplugins.GCEPDInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationGCE) + return pm.featureGate.Enabled(features.CSIMigrationGCE) case csilibplugins.AzureFileInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationAzureFile) + return pm.featureGate.Enabled(features.CSIMigrationAzureFile) case csilibplugins.AzureDiskInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationAzureDisk) + return pm.featureGate.Enabled(features.CSIMigrationAzureDisk) case csilibplugins.CinderInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationOpenStack) + return pm.featureGate.Enabled(features.CSIMigrationOpenStack) case csilibplugins.VSphereInTreePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationvSphere) + return pm.featureGate.Enabled(features.CSIMigrationvSphere) default: return false } @@ -121,19 +122,19 @@ func (pm PluginManager) IsMigratable(spec *volume.Spec) (bool, error) { // from references to in-tree plugins to migrated CSI plugins type InTreeToCSITranslator interface { TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) - TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) + TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) } // TranslateInTreeSpecToCSI translates a volume spec (either PV or inline volume) // supported by an in-tree plugin to CSI -func TranslateInTreeSpecToCSI(spec *volume.Spec, translator InTreeToCSITranslator) (*volume.Spec, error) { +func TranslateInTreeSpecToCSI(spec *volume.Spec, podNamespace string, translator InTreeToCSITranslator) (*volume.Spec, error) { var csiPV *v1.PersistentVolume var err error inlineVolume := false if spec.PersistentVolume != nil { csiPV, err = translator.TranslateInTreePVToCSI(spec.PersistentVolume) } else if spec.Volume != nil { - csiPV, err = translator.TranslateInTreeInlineVolumeToCSI(spec.Volume) + csiPV, err = translator.TranslateInTreeInlineVolumeToCSI(spec.Volume, podNamespace) inlineVolume = true } else { err = errors.New("not a valid volume spec") diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/emptydir/empty_dir.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/emptydir/empty_dir.go index c21160e88595..f2bf8e2f3334 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/emptydir/empty_dir.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/emptydir/empty_dir.go @@ -117,7 +117,7 @@ func calculateEmptyDirMemorySize(nodeAllocatableMemory *resource.Quantity, spec return sizeLimit } - // size limit defaults to node allocatable (pods cant consume more memory than all pods) + // size limit defaults to node allocatable (pods can't consume more memory than all pods) sizeLimit = nodeAllocatableMemory zero := resource.MustParse("0") diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/mounter-defaults.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/mounter-defaults.go index 0449330af33a..a1c89ab19116 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/mounter-defaults.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/mounter-defaults.go @@ -43,7 +43,7 @@ func (f *mounterDefaults) SetUpAt(dir string, mounterArgs volume.MounterArgs) er // Returns the default volume attributes. func (f *mounterDefaults) GetAttributes() volume.Attributes { - klog.V(5).Infof(logPrefix(f.plugin), "using default GetAttributes") + klog.V(5).Info(logPrefix(f.plugin), "using default GetAttributes") return volume.Attributes{ ReadOnly: f.readOnly, Managed: !f.readOnly, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/plugin-defaults.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/plugin-defaults.go index d72089de973b..171d1592ca37 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/plugin-defaults.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/plugin-defaults.go @@ -29,6 +29,6 @@ func logPrefix(plugin *flexVolumePlugin) string { } func (plugin *pluginDefaults) GetVolumeName(spec *volume.Spec) (string, error) { - klog.V(4).Infof(logPrefix((*flexVolumePlugin)(plugin)), "using default GetVolumeName for volume ", spec.Name()) + klog.V(4).Info(logPrefix((*flexVolumePlugin)(plugin)), "using default GetVolumeName for volume ", spec.Name()) return spec.Name(), nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/plugin.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/plugin.go index b3deeef65356..a13b3af93263 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/plugin.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/plugin.go @@ -133,7 +133,7 @@ func (plugin *flexVolumePlugin) GetVolumeName(spec *volume.Spec) (string, error) return "", err } - klog.V(4).Infof(logPrefix(plugin), "GetVolumeName is not supported yet. Defaulting to PV or volume name: ", name) + klog.V(4).Info(logPrefix(plugin), "GetVolumeName is not supported yet. Defaulting to PV or volume name: ", name) return name, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/glusterfs/glusterfs.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/glusterfs/glusterfs.go index 233917749542..b0abb5494300 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/glusterfs/glusterfs.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/glusterfs/glusterfs.go @@ -77,7 +77,6 @@ const ( volPrefix = "vol_" dynamicEpSvcPrefix = "glusterfs-dynamic" replicaCount = 3 - durabilityType = "replicate" secretKeyName = "key" // key name used in secret gciLinuxGlusterMountBinaryPath = "/sbin/mount.glusterfs" defaultGidMin = 2000 diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi_util.go index b47a2318c910..7f1e0daf5041 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi_util.go @@ -791,7 +791,7 @@ func extractDeviceAndPrefix(mntPath string) (string, string, error) { func extractIface(mntPath string) (string, bool) { reOutput := ifaceRe.FindStringSubmatch(mntPath) - if reOutput != nil && len(reOutput) > 1 { + if len(reOutput) > 1 { return reOutput[1], true } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/nfs/nfs.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/nfs/nfs.go index 9f46118f556e..db906a7b799d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/nfs/nfs.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/nfs/nfs.go @@ -304,10 +304,10 @@ func (c *nfsUnmounter) TearDownAt(dir string) error { // Use extensiveMountPointCheck to consult /proc/mounts. We can't use faster // IsLikelyNotMountPoint (lstat()), since there may be root_squash on the // NFS server and kubelet may not be able to do lstat/stat() there. - forceUmounter, ok := c.mounter.(mount.MounterForceUnmounter) + forceUnmounter, ok := c.mounter.(mount.MounterForceUnmounter) if ok { klog.V(4).Infof("Using force unmounter interface") - return mount.CleanupMountWithForce(dir, forceUmounter, true /* extensiveMountPointCheck */, unMountTimeout) + return mount.CleanupMountWithForce(dir, forceUnmounter, true /* extensiveMountPointCheck */, unMountTimeout) } return mount.CleanupMountPoint(dir, c.mounter, true /* extensiveMountPointCheck */) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/portworx/portworx_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/portworx/portworx_util.go index 420afd277d65..5885a1065d70 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/portworx/portworx_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/portworx/portworx_util.go @@ -214,9 +214,9 @@ func (util *portworxVolumeUtil) ResizeVolume(spec *volume.Spec, newSize resource } vol := vols[0] - tBytes, ok := newSize.AsInt64() - if !ok { - return fmt.Errorf("quantity %v is too great, overflows int64", newSize) + tBytes, err := volumehelpers.RoundUpToB(newSize) + if err != nil { + return err } newSizeInBytes := uint64(tBytes) if vol.Spec.Size >= newSizeInBytes { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go index 25dfd3d876d1..fc761071a11f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go @@ -477,7 +477,7 @@ func (c *sioClient) WaitForDetachedDevice(token string) error { go func() { klog.V(4).Info(log("waiting for volume %s to be unmapped/detached", token)) }() - // cant find vol id, then ok. + // can't find vol id, then ok. if _, ok := devMap[token]; !ok { return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/fs/fs_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/fs/fs_windows.go index 0fab9bcb6ce1..8d16eabcefec 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/fs/fs_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/fs/fs_windows.go @@ -21,6 +21,7 @@ package fs import ( "fmt" "os" + "path/filepath" "syscall" "unsafe" @@ -40,6 +41,11 @@ func Info(path string) (int64, int64, int64, int64, int64, int64, error) { var freeBytesAvailable, totalNumberOfBytes, totalNumberOfFreeBytes int64 var err error + // The equivalent linux call supports calls against files but the syscall for windows + // fails for files with error code: The directory name is invalid. (#99173) + // https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499- + // By always ensuring the directory path we meet all uses cases of this function + path = filepath.Dir(path) ret, _, err := syscall.Syscall6( procGetDiskFreeSpaceEx.Addr(), 4, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go index bdd81aaca171..48ba1076e0da 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/operationexecutor/operation_generator.go @@ -58,7 +58,7 @@ type InTreeToCSITranslator interface { GetInTreePluginNameFromSpec(pv *v1.PersistentVolume, vol *v1.Volume) (string, error) GetCSINameFromInTreeName(pluginName string) (string, error) TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) - TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) + TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) } var _ OperationGenerator = &operationGenerator{} @@ -1551,6 +1551,14 @@ func (og *operationGenerator) GenerateExpandVolumeFunc( klog.Warning(detailedErr) return volumetypes.NewOperationContext(nil, nil, migrated) } + oldCapacity := pvc.Status.Capacity[v1.ResourceStorage] + err = util.AddAnnPreResizeCapacity(pv, oldCapacity, og.kubeClient) + if err != nil { + detailedErr := fmt.Errorf("error updating pv %s annotation (%s) with pre-resize capacity %s: %v", pv.ObjectMeta.Name, util.AnnPreResizeCapacity, oldCapacity.String(), err) + klog.Warning(detailedErr) + return volumetypes.NewOperationContext(nil, nil, migrated) + } + } return volumetypes.NewOperationContext(nil, nil, migrated) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/resize_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/resize_util.go index 9249380dc94f..195819d14087 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/resize_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/resize_util.go @@ -21,7 +21,7 @@ import ( "encoding/json" "fmt" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -39,6 +39,12 @@ var ( v1.PersistentVolumeClaimFileSystemResizePending: true, v1.PersistentVolumeClaimResizing: true, } + + // AnnPreResizeCapacity annotation is added to a PV when expanding volume. + // Its value is status capacity of the PVC prior to the volume expansion + // Its value will be set by the external-resizer when it deems that filesystem resize is required after resizing volume. + // Its value will be used by pv_controller to determine pvc's status capacity when binding pvc and pv. + AnnPreResizeCapacity = "volume.alpha.kubernetes.io/pre-resize-capacity" ) type resizeProcessStatus struct { @@ -57,27 +63,67 @@ func UpdatePVSize( newSize resource.Quantity, kubeClient clientset.Interface) error { pvClone := pv.DeepCopy() + pvClone.Spec.Capacity[v1.ResourceStorage] = newSize - oldData, err := json.Marshal(pvClone) - if err != nil { - return fmt.Errorf("unexpected error marshaling old PV %q with error : %v", pvClone.Name, err) + return PatchPV(pv, pvClone, kubeClient) +} + +// AddAnnPreResizeCapacity adds volume.alpha.kubernetes.io/pre-resize-capacity from the pv +func AddAnnPreResizeCapacity( + pv *v1.PersistentVolume, + oldCapacity resource.Quantity, + kubeClient clientset.Interface) error { + // if the pv already has a resize annotation skip the process + if metav1.HasAnnotation(pv.ObjectMeta, AnnPreResizeCapacity) { + return nil } - pvClone.Spec.Capacity[v1.ResourceStorage] = newSize + pvClone := pv.DeepCopy() + if pvClone.ObjectMeta.Annotations == nil { + pvClone.ObjectMeta.Annotations = make(map[string]string) + } + pvClone.ObjectMeta.Annotations[AnnPreResizeCapacity] = oldCapacity.String() + + return PatchPV(pv, pvClone, kubeClient) +} + +// DeleteAnnPreResizeCapacity deletes volume.alpha.kubernetes.io/pre-resize-capacity from the pv +func DeleteAnnPreResizeCapacity( + pv *v1.PersistentVolume, + kubeClient clientset.Interface) error { + // if the pv does not have a resize annotation skip the entire process + if !metav1.HasAnnotation(pv.ObjectMeta, AnnPreResizeCapacity) { + return nil + } + pvClone := pv.DeepCopy() + delete(pvClone.ObjectMeta.Annotations, AnnPreResizeCapacity) + + return PatchPV(pv, pvClone, kubeClient) +} + +// PatchPV creates and executes a patch for pv +func PatchPV( + oldPV *v1.PersistentVolume, + newPV *v1.PersistentVolume, + kubeClient clientset.Interface) error { + oldData, err := json.Marshal(oldPV) + if err != nil { + return fmt.Errorf("unexpected error marshaling old PV %q with error : %v", oldPV.Name, err) + } - newData, err := json.Marshal(pvClone) + newData, err := json.Marshal(newPV) if err != nil { - return fmt.Errorf("unexpected error marshaling new PV %q with error : %v", pvClone.Name, err) + return fmt.Errorf("unexpected error marshaling new PV %q with error : %v", newPV.Name, err) } - patchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, pvClone) + patchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, oldPV) if err != nil { - return fmt.Errorf("error Creating two way merge patch for PV %q with error : %v", pvClone.Name, err) + return fmt.Errorf("error Creating two way merge patch for PV %q with error : %v", oldPV.Name, err) } - _, err = kubeClient.CoreV1().PersistentVolumes().Patch(context.TODO(), pvClone.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}) + _, err = kubeClient.CoreV1().PersistentVolumes().Patch(context.TODO(), oldPV.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}) if err != nil { - return fmt.Errorf("error Patching PV %q with error : %v", pvClone.Name, err) + return fmt.Errorf("error Patching PV %q with error : %v", oldPV.Name, err) } return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler.go index e07f457aac39..3009eb34f46a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler.go @@ -30,10 +30,8 @@ import ( ) const ( - losetupPath = "losetup" - statPath = "stat" - ErrDeviceNotFound = "device not found" - ErrDeviceNotSupported = "device not supported" + losetupPath = "losetup" + ErrDeviceNotFound = "device not found" ) // BlockVolumePathHandler defines a set of operations for handling block volume-related operations diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume.go index 85b8c4aaa525..642f72645f8f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume.go @@ -48,6 +48,10 @@ type BlockVolume interface { // and name of a symbolic link associated to a block device. // ex. pods/{podUid}/{DefaultKubeletVolumeDevicesDirName}/{escapeQualifiedPluginName}/, {volumeName} GetPodDeviceMapPath() (string, string) + + // MetricsProvider embeds methods for exposing metrics (e.g. + // used, available space). + MetricsProvider } // MetricsProvider exposes metrics (e.g. used,available space) related to a @@ -92,6 +96,17 @@ type Metrics struct { // a filesystem with the host (e.g. emptydir, hostpath), this is the free inodes // on the underlying storage, and is shared with host processes and other volumes InodesFree *resource.Quantity + + // Normal volumes are available for use and operating optimally. + // An abnormal volume does not meet these criteria. + // This field is OPTIONAL. Only some csi drivers which support NodeServiceCapability_RPC_VOLUME_CONDITION + // need to fill it. + Abnormal *bool + + // The message describing the condition of the volume. + // This field is OPTIONAL. Only some csi drivers which support capability_RPC_VOLUME_CONDITION + // need to fill it. + Message *string } // Attributes represents the attributes of this mounter. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume_linux.go index 214e9db33023..bf9fcfcdacd8 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume_linux.go @@ -66,7 +66,7 @@ func SetVolumeOwnership(mounter Mounter, fsGroup *int64, fsGroupChangePolicy *v1 } if skipPermissionChange(mounter, fsGroup, fsGroupChangePolicy) { - klog.V(3).Infof("skipping permission and ownership change for volume %s", mounter.GetPath()) + klog.V(3).InfoS("Skipping permission and ownership change for volume", "path", mounter.GetPath()) return nil } @@ -96,7 +96,7 @@ func legacyOwnershipChange(mounter Mounter, fsGroup *int64) error { func changeFilePermission(filename string, fsGroup *int64, readonly bool, info os.FileInfo) error { err := os.Lchown(filename, -1, int(*fsGroup)) if err != nil { - klog.Errorf("Lchown failed on %v: %v", filename, err) + klog.ErrorS(err, "Lchown failed", "path", filename) } // chmod passes through to the underlying file for symlinks. @@ -122,7 +122,7 @@ func changeFilePermission(filename string, fsGroup *int64, readonly bool, info o err = os.Chmod(filename, info.Mode()|mask) if err != nil { - klog.Errorf("Chmod failed on %v: %v", filename, err) + klog.ErrorS(err, "Chown failed", "path", filename) } return nil @@ -132,7 +132,7 @@ func skipPermissionChange(mounter Mounter, fsGroup *int64, fsGroupChangePolicy * dir := mounter.GetPath() if fsGroupChangePolicy == nil || *fsGroupChangePolicy != v1.FSGroupChangeOnRootMismatch { - klog.V(4).Infof("perform recursive ownership change for %s", dir) + klog.V(4).InfoS("Perform recursive ownership change for directory", "path", dir) return false } return !requiresPermissionChange(mounter.GetPath(), fsGroup, mounter.GetAttributes().ReadOnly) @@ -141,17 +141,17 @@ func skipPermissionChange(mounter Mounter, fsGroup *int64, fsGroupChangePolicy * func requiresPermissionChange(rootDir string, fsGroup *int64, readonly bool) bool { fsInfo, err := os.Stat(rootDir) if err != nil { - klog.Errorf("performing recursive ownership change on %s because reading permissions of root volume failed: %v", rootDir, err) + klog.ErrorS(err, "Performing recursive ownership change on rootDir because reading permissions of root volume failed", "path", rootDir) return true } stat, ok := fsInfo.Sys().(*syscall.Stat_t) if !ok || stat == nil { - klog.Errorf("performing recursive ownership change on %s because reading permissions of root volume failed", rootDir) + klog.ErrorS(nil, "Performing recursive ownership change on rootDir because reading permissions of root volume failed", "path", rootDir) return true } if int(stat.Gid) != int(*fsGroup) { - klog.V(4).Infof("expected group ownership of volume %s did not match with: %d", rootDir, stat.Gid) + klog.V(4).InfoS("Expected group ownership of volume did not match with Gid", "path", rootDir, "GID", stat.Gid) return true } unixPerms := rwMask @@ -175,7 +175,7 @@ func requiresPermissionChange(rootDir string, fsGroup *int64, readonly bool) boo // unixPerms: 770, filePerms: 750 : 770&750 = 750 (perms on directory is NOT a superset) // We also need to check if setgid bits are set in permissions of the directory. if (unixPerms&filePerm != unixPerms) || (fsInfo.Mode()&os.ModeSetgid == 0) { - klog.V(4).Infof("performing recursive ownership change on %s because of mismatching mode", rootDir) + klog.V(4).InfoS("Performing recursive ownership change on rootDir because of mismatching mode", "path", rootDir) return true } return false diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_util.go index ab229b980fc7..d24ff640b3e3 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_util.go @@ -25,7 +25,7 @@ import ( "strings" "time" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" cloudprovider "k8s.io/cloud-provider" volumehelpers "k8s.io/cloud-provider/volume/helpers" "k8s.io/klog/v2" @@ -36,7 +36,6 @@ import ( ) const ( - maxRetries = 10 checkSleepDuration = time.Second diskByIDPath = "/dev/disk/by-id/" diskSCSIPrefix = "wwn-0x" @@ -68,6 +67,15 @@ const ( ObjectSpaceReservationCapabilityMin = 0 ObjectSpaceReservationCapabilityMax = 100 IopsLimitCapabilityMin = 0 + // reduce number of characters in vsphere volume name. The reason for setting length smaller than 255 is because typically + // volume name also becomes part of mount path - /var/lib/kubelet/plugins/kubernetes.io/vsphere-volume/mounts/ + // and systemd has a limit of 256 chars in a unit name - https://github.com/systemd/systemd/pull/14294 + // so if we subtract the kubelet path prefix from 256, we are left with 191 characters. + // Since datastore name is typically part of volumeName we are choosing a shorter length of 63 + // and leaving room of certain characters being escaped etc. + // Given that volume name is typically of the form - pvc-0f13e3ad-97f8-41ab-9392-84562ef40d17.vmdk (45 chars), + // this should still leave plenty of room for clusterName inclusion. + maxVolumeLength = 63 ) var ErrProbeVolume = errors.New("error scanning attached volumes") @@ -98,13 +106,7 @@ func (util *VsphereDiskUtil) CreateVolume(v *vsphereVolumeProvisioner, selectedN return nil, err } volSizeKiB := volSizeMiB * 1024 - // reduce number of characters in vsphere volume name. The reason for setting length smaller than 255 is because typically - // volume name also becomes part of mount path - /var/lib/kubelet/plugins/kubernetes.io/vsphere-volume/mounts/ - // and systemd has a limit of 256 chars in a unit name - https://github.com/systemd/systemd/pull/14294 - // so if we subtract the kubelet path prefix from 256, we are left with 191 characters. - // Since datastore name is typically part of volumeName we are choosing a shorter length of 90 - // and leaving room of certain characters being escaped etc. - name := volumeutil.GenerateVolumeName(v.options.ClusterName, v.options.PVName, 90) + name := volumeutil.GenerateVolumeName(v.options.ClusterName, v.options.PVName, maxVolumeLength) volumeOptions := &vclib.VolumeOptions{ CapacityKB: volSizeKiB, Tags: *v.options.CloudTags, diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/aws/aws.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/aws/aws.go index 3588f38cb4e0..0ba278fcefe5 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/aws/aws.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/aws/aws.go @@ -2555,7 +2555,7 @@ func (c *Cloud) CreateDisk(volumeOptions *VolumeOptions) (KubernetesVolumeID, er createType = DefaultVolumeType default: - return "", fmt.Errorf("invalid AWS VolumeType %q", volumeOptions.VolumeType) + return KubernetesVolumeID(""), fmt.Errorf("invalid AWS VolumeType %q", volumeOptions.VolumeType) } request := &ec2.CreateVolumeInput{} @@ -2587,12 +2587,12 @@ func (c *Cloud) CreateDisk(volumeOptions *VolumeOptions) (KubernetesVolumeID, er response, err := c.ec2.CreateVolume(request) if err != nil { - return "", err + return KubernetesVolumeID(""), err } awsID := EBSVolumeID(aws.StringValue(response.VolumeId)) if awsID == "" { - return "", fmt.Errorf("VolumeID was not returned by CreateVolume") + return KubernetesVolumeID(""), fmt.Errorf("VolumeID was not returned by CreateVolume") } volumeName := KubernetesVolumeID("aws://" + aws.StringValue(response.AvailabilityZone) + "/" + string(awsID)) @@ -2605,8 +2605,22 @@ func (c *Cloud) CreateDisk(volumeOptions *VolumeOptions) (KubernetesVolumeID, er // because Kubernetes may have limited permissions to the key. if isAWSErrorVolumeNotFound(err) { err = fmt.Errorf("failed to create encrypted volume: the volume disappeared after creation, most likely due to inaccessible KMS encryption key") + } else { + // When DescribeVolumes api failed, plugin will lose track on the volumes' state + // driver should be able to clean up these kind of volumes to make sure they are not leaked on customers' account + klog.V(5).Infof("Failed to create the volume %v due to %v. Will try to delete it.", volumeName, err) + awsDisk, newDiskError := newAWSDisk(c, volumeName) + if newDiskError != nil { + klog.Errorf("Failed to delete the volume %v due to error: %v", volumeName, newDiskError) + } else { + if _, deleteVolumeError := awsDisk.deleteVolume(); deleteVolumeError != nil { + klog.Errorf("Failed to delete the volume %v due to error: %v", volumeName, deleteVolumeError) + } else { + klog.V(5).Infof("%v is deleted because it is not in desired state after waiting", volumeName) + } + } } - return "", err + return KubernetesVolumeID(""), err } return volumeName, nil diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure.go index 30ad09c534a9..3e9d13dedc30 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure.go @@ -274,6 +274,8 @@ type Cloud struct { ipv6DualStackEnabled bool // Lock for access to node caches, includes nodeZones, nodeResourceGroups, and unmanagedNodes. nodeCachesLock sync.RWMutex + // nodeNames holds current nodes for tracking added nodes in VM caches. + nodeNames sets.String // nodeZones is a mapping from Zone to a sets.String of Node's names in the Zone // it is updated by the nodeInformer nodeZones map[string]sets.String @@ -342,6 +344,7 @@ func NewCloudWithoutFeatureGates(configReader io.Reader) (*Cloud, error) { } az := &Cloud{ + nodeNames: sets.NewString(), nodeZones: map[string]sets.String{}, nodeResourceGroups: map[string]string{}, unmanagedNodes: sets.NewString(), @@ -782,6 +785,9 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) { defer az.nodeCachesLock.Unlock() if prevNode != nil { + // Remove from nodeNames cache. + az.nodeNames.Delete(prevNode.ObjectMeta.Name) + // Remove from nodeZones cache. prevZone, ok := prevNode.ObjectMeta.Labels[LabelFailureDomainBetaZone] if ok && az.isAvailabilityZone(prevZone) { @@ -805,6 +811,9 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) { } if newNode != nil { + // Add to nodeNames cache. + az.nodeNames.Insert(newNode.ObjectMeta.Name) + // Add to nodeZones cache. newZone, ok := newNode.ObjectMeta.Labels[LabelFailureDomainBetaZone] if ok && az.isAvailabilityZone(newZone) { @@ -876,6 +885,22 @@ func (az *Cloud) GetNodeResourceGroup(nodeName string) (string, error) { return az.ResourceGroup, nil } +// GetNodeNames returns a set of all node names in the k8s cluster. +func (az *Cloud) GetNodeNames() (sets.String, error) { + // Kubelet won't set az.nodeInformerSynced, return nil. + if az.nodeInformerSynced == nil { + return nil, nil + } + + az.nodeCachesLock.RLock() + defer az.nodeCachesLock.RUnlock() + if !az.nodeInformerSynced() { + return nil, fmt.Errorf("node informer is not synced when trying to GetNodeNames") + } + + return sets.NewString(az.nodeNames.List()...), nil +} + // GetResourceGroups returns a set of resource groups that all nodes are running on. func (az *Cloud) GetResourceGroups() (sets.String, error) { // Kubelet won't set az.nodeInformerSynced, always return configured resourceGroup. diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_backoff.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_backoff.go index 584d66ac02a1..fbb3783cf794 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_backoff.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_backoff.go @@ -275,6 +275,9 @@ func (az *Cloud) ListLB(service *v1.Service) ([]network.LoadBalancer, error) { rgName := az.getLoadBalancerResourceGroup() allLBs, rerr := az.LoadBalancerClient.List(ctx, rgName) if rerr != nil { + if rerr.IsNotFound() { + return nil, nil + } az.Event(service, v1.EventTypeWarning, "ListLoadBalancers", rerr.Error().Error()) klog.Errorf("LoadBalancerClient.List(%v) failure with err=%v", rgName, rerr) return nil, rerr.Error() @@ -290,6 +293,9 @@ func (az *Cloud) ListPIP(service *v1.Service, pipResourceGroup string) ([]networ allPIPs, rerr := az.PublicIPAddressesClient.List(ctx, pipResourceGroup) if rerr != nil { + if rerr.IsNotFound() { + return nil, nil + } az.Event(service, v1.EventTypeWarning, "ListPublicIPs", rerr.Error().Error()) klog.Errorf("PublicIPAddressesClient.List(%v) failure with err=%v", pipResourceGroup, rerr) return nil, rerr.Error() diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go index 629da8c26695..2c1c4dfaa3f2 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go @@ -650,11 +650,19 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai serviceName := getServiceName(service) + var changed bool if existsPip { - // ensure that the service tag is good - changed, err := bindServicesToPIP(&pip, []string{serviceName}, false) - if err != nil { - return nil, err + // ensure that the service tag is good for managed pips + owns, isUserAssignedPIP := serviceOwnsPublicIP(service, &pip, clusterName) + if owns && !isUserAssignedPIP { + changed, err = bindServicesToPIP(&pip, []string{serviceName}, false) + if err != nil { + return nil, err + } + } + + if pip.Tags == nil { + pip.Tags = make(map[string]*string) } // return if pip exist and dns label is the same @@ -1626,7 +1634,13 @@ func (az *Cloud) reconcileLoadBalancerRule( var expectedProbes []network.Probe var expectedRules []network.LoadBalancingRule + highAvailabilityPortsEnabled := false for _, port := range ports { + if highAvailabilityPortsEnabled { + // Since the port is always 0 when enabling HA, only one rule should be configured. + break + } + lbRuleName := az.getLoadBalancerRuleName(service, port.Protocol, port.Port) klog.V(2).Infof("reconcileLoadBalancerRule lb name (%s) rule name (%s)", lbName, lbRuleName) @@ -1714,6 +1728,7 @@ func (az *Cloud) reconcileLoadBalancerRule( expectedRule.FrontendPort = to.Int32Ptr(0) expectedRule.BackendPort = to.Int32Ptr(0) expectedRule.Protocol = network.TransportProtocolAll + highAvailabilityPortsEnabled = true } // we didn't construct the probe objects for UDP or SCTP because they're not allowed on Azure. @@ -2084,7 +2099,12 @@ func deduplicate(collection *[]string) *[]string { } // Determine if we should release existing owned public IPs -func shouldReleaseExistingOwnedPublicIP(existingPip *network.PublicIPAddress, lbShouldExist, lbIsInternal bool, desiredPipName, svcName string, ipTagRequest serviceIPTagRequest) bool { +func shouldReleaseExistingOwnedPublicIP(existingPip *network.PublicIPAddress, lbShouldExist, lbIsInternal, isUserAssignedPIP bool, desiredPipName string, ipTagRequest serviceIPTagRequest) bool { + // skip deleting user created pip + if isUserAssignedPIP { + return false + } + // Latch some variables for readability purposes. pipName := *(*existingPip).Name @@ -2207,9 +2227,10 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa // Now, let's perform additional analysis to determine if we should release the public ips we have found. // We can only let them go if (a) they are owned by this service and (b) they meet the criteria for deletion. - if serviceOwnsPublicIP(&pip, clusterName, serviceName) { + owns, isUserAssignedPIP := serviceOwnsPublicIP(service, &pip, clusterName) + if owns { var dirtyPIP, toBeDeleted bool - if !wantLb { + if !wantLb && !isUserAssignedPIP { klog.V(2).Infof("reconcilePublicIP for service(%s): unbinding the service from pip %s", serviceName, *pip.Name) err = unbindServiceFromPIP(&pip, serviceName) if err != nil { @@ -2221,7 +2242,7 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa if changed { dirtyPIP = true } - if shouldReleaseExistingOwnedPublicIP(&pip, wantLb, isInternal, desiredPipName, serviceName, serviceIPTagRequest) { + if shouldReleaseExistingOwnedPublicIP(&pip, wantLb, isInternal, isUserAssignedPIP, desiredPipName, serviceIPTagRequest) { // Then, release the public ip pipsToBeDeleted = append(pipsToBeDeleted, &pip) @@ -2542,26 +2563,55 @@ func getServiceTags(service *v1.Service) []string { return nil } -func serviceOwnsPublicIP(pip *network.PublicIPAddress, clusterName, serviceName string) bool { - if pip != nil && pip.Tags != nil { +// serviceOwnsPublicIP checks if the service owns the pip and if the pip is user-created. +// The pip is user-created if and only if there is no service tags. +// The service owns the pip if: +// 1. The serviceName is included in the service tags of a system-created pip. +// 2. The service.Spec.LoadBalancerIP matches the IP address of a user-created pip. +func serviceOwnsPublicIP(service *v1.Service, pip *network.PublicIPAddress, clusterName string) (bool, bool) { + if service == nil || pip == nil { + klog.Warningf("serviceOwnsPublicIP: nil service or public IP") + return false, false + } + + if pip.PublicIPAddressPropertiesFormat == nil || to.String(pip.IPAddress) == "" { + klog.Warningf("serviceOwnsPublicIP: empty pip.IPAddress") + return false, false + } + + serviceName := getServiceName(service) + + if pip.Tags != nil { serviceTag := pip.Tags[serviceTagKey] clusterTag := pip.Tags[clusterNameKey] - if serviceTag != nil && isSVCNameInPIPTag(*serviceTag, serviceName) { - // Backward compatible for clusters upgraded from old releases. - // In such case, only "service" tag is set. - if clusterTag == nil { - return true - } + // if there is no service tag on the pip, it is user-created pip + if to.String(serviceTag) == "" { + return strings.EqualFold(to.String(pip.IPAddress), service.Spec.LoadBalancerIP), true + } + + if serviceTag != nil { + // if there is service tag on the pip, it is system-created pip + if isSVCNameInPIPTag(*serviceTag, serviceName) { + // Backward compatible for clusters upgraded from old releases. + // In such case, only "service" tag is set. + if clusterTag == nil { + return true, false + } - // If cluster name tag is set, then return true if it matches. - if *clusterTag == clusterName { - return true + // If cluster name tag is set, then return true if it matches. + if *clusterTag == clusterName { + return true, false + } + } else { + // if the service is not included in te tags of the system-created pip, check the ip address + // this could happen for secondary services + return strings.EqualFold(to.String(pip.IPAddress), service.Spec.LoadBalancerIP), false } } } - return false + return false, false } func isSVCNameInPIPTag(tag, svcName string) bool { diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss.go index 8504aada304b..49e0d755fde0 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss.go @@ -74,7 +74,8 @@ type scaleSet struct { *Cloud // availabilitySet is also required for scaleSet because some instances - // (e.g. master nodes) may not belong to any scale sets. + // (e.g. control plane nodes) may not belong to any scale sets. + // this also allows for clusters with both VM and VMSS nodes. availabilitySet VMSet vmssCache *azcache.TimedCache diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go index 5abfec1936e9..576e6539421c 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go @@ -58,6 +58,11 @@ type vmssEntry struct { lastUpdate time.Time } +type availabilitySetEntry struct { + vmNames sets.String + nodeNames sets.String +} + func (ss *scaleSet) newVMSSCache() (*azcache.TimedCache, error) { getter := func(key string) (interface{}, error) { localCache := &sync.Map{} // [vmssName]*vmssEntry @@ -273,7 +278,7 @@ func (ss *scaleSet) deleteCacheForNode(nodeName string) error { func (ss *scaleSet) newAvailabilitySetNodesCache() (*azcache.TimedCache, error) { getter := func(key string) (interface{}, error) { - localCache := sets.NewString() + vmNames := sets.NewString() resourceGroups, err := ss.GetResourceGroups() if err != nil { return nil, err @@ -287,11 +292,22 @@ func (ss *scaleSet) newAvailabilitySetNodesCache() (*azcache.TimedCache, error) for _, vm := range vmList { if vm.Name != nil { - localCache.Insert(*vm.Name) + vmNames.Insert(*vm.Name) } } } + // store all the node names in the cluster when the cache data was created. + nodeNames, err := ss.GetNodeNames() + if err != nil { + return nil, err + } + + localCache := availabilitySetEntry{ + vmNames: vmNames, + nodeNames: nodeNames, + } + return localCache, nil } @@ -313,6 +329,16 @@ func (ss *scaleSet) isNodeManagedByAvailabilitySet(nodeName string, crt azcache. return false, err } - availabilitySetNodes := cached.(sets.String) - return availabilitySetNodes.Has(nodeName), nil + cachedNodes := cached.(availabilitySetEntry).nodeNames + // if the node is not in the cache, assume the node has joined after the last cache refresh and attempt to refresh the cache. + if !cachedNodes.Has(nodeName) { + klog.V(2).Infof("Node %s has joined the cluster since the last VM cache refresh, refreshing the cache", nodeName) + cached, err = ss.availabilitySetNodesCache.Get(availabilitySetNodesKey, azcache.CacheReadTypeForceRefresh) + if err != nil { + return false, err + } + } + + cachedVMs := cached.(availabilitySetEntry).vmNames + return cachedVMs.Has(nodeName), nil } diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/gcpcredential/gcpcredential.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/gcpcredential/gcpcredential.go index b51990d15433..428578a237bf 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/gcpcredential/gcpcredential.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/gcpcredential/gcpcredential.go @@ -112,7 +112,7 @@ func ProvideContainerRegistry(client *http.Client, image string) credentialconfi var parsedBlob TokenBlob if err := json.Unmarshal([]byte(tokenJSONBlob), &parsedBlob); err != nil { - klog.Errorf("while parsing json blob %s: %v", tokenJSONBlob, err) + klog.Errorf("error while parsing json blob of length %d", len(tokenJSONBlob)) return cfg } diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/shared_datastore.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/shared_datastore.go new file mode 100644 index 000000000000..603ecde9b751 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/shared_datastore.go @@ -0,0 +1,209 @@ +// +build !providerless + +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vsphere + +import ( + "context" + "fmt" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "k8s.io/klog/v2" + "k8s.io/legacy-cloud-providers/vsphere/vclib" +) + +type sharedDatastore struct { + nodeManager *NodeManager + candidateDatastores []*vclib.DatastoreInfo +} + +type hostInfo struct { + hostUUID string + hostMOID string + datacenter string +} + +const ( + summary = "summary" + runtimeHost = "summary.runtime.host" + hostsProperty = "host" + nameProperty = "name" +) + +func (shared *sharedDatastore) getSharedDatastore(ctcx context.Context) (*vclib.DatastoreInfo, error) { + nodes := shared.nodeManager.getNodes() + + // Segregate nodes according to VC-DC + dcNodes := make(map[string][]NodeInfo) + nodeHosts := make(map[string]hostInfo) + + for nodeName, node := range nodes { + nodeInfo, err := shared.nodeManager.GetNodeInfoWithNodeObject(node) + if err != nil { + return nil, fmt.Errorf("unable to find node %s: %v", nodeName, err) + } + vcDC := nodeInfo.vcServer + nodeInfo.dataCenter.String() + dcNodes[vcDC] = append(dcNodes[vcDC], nodeInfo) + } + + for vcDC, nodes := range dcNodes { + var hostInfos []hostInfo + var err error + hostInfos, err = shared.getNodeHosts(ctcx, nodes, vcDC) + if err != nil { + if vclib.IsManagedObjectNotFoundError(err) { + klog.Warningf("SharedHost.getSharedDatastore: batch fetching of hosts failed - switching to fetching them individually.") + hostInfos, err = shared.getEachNodeHost(ctcx, nodes, vcDC) + if err != nil { + klog.Errorf("SharedHost.getSharedDatastore: error fetching node hosts individually: %v", err) + return nil, err + } + } else { + return nil, err + } + } + for _, host := range hostInfos { + hostDCName := fmt.Sprintf("%s/%s", host.datacenter, host.hostMOID) + nodeHosts[hostDCName] = host + } + } + + if len(nodeHosts) < 1 { + msg := fmt.Sprintf("SharedHost.getSharedDatastore unable to find hosts associated with nodes") + klog.Error(msg) + return nil, fmt.Errorf("") + } + + for _, datastoreInfo := range shared.candidateDatastores { + dataStoreHosts, err := shared.getAttachedHosts(ctcx, datastoreInfo.Datastore) + if err != nil { + msg := fmt.Sprintf("error finding attached hosts to datastore %s: %v", datastoreInfo.Name(), err) + klog.Error(msg) + return nil, fmt.Errorf(msg) + } + if shared.isIncluded(dataStoreHosts, nodeHosts) { + return datastoreInfo, nil + } + } + return nil, fmt.Errorf("SharedHost.getSharedDatastore: unable to find any shared datastores") +} + +// check if all of the nodeHosts are included in the dataStoreHosts +func (shared *sharedDatastore) isIncluded(dataStoreHosts []hostInfo, nodeHosts map[string]hostInfo) bool { + result := true + for _, host := range nodeHosts { + hostFound := false + for _, targetHost := range dataStoreHosts { + if host.hostUUID == targetHost.hostUUID && host.hostMOID == targetHost.hostMOID { + hostFound = true + } + } + if !hostFound { + result = false + } + } + return result +} + +func (shared *sharedDatastore) getEachNodeHost(ctx context.Context, nodes []NodeInfo, dcVC string) ([]hostInfo, error) { + var hosts []hostInfo + for _, node := range nodes { + host, err := node.vm.GetHost(ctx) + if err != nil { + klog.Errorf("SharedHost.getEachNodeHost: unable to find host for vm %s: %v", node.vm.InventoryPath, err) + return nil, err + } + hosts = append(hosts, hostInfo{ + hostUUID: host.Summary.Hardware.Uuid, + hostMOID: host.Summary.Host.String(), + datacenter: node.dataCenter.String(), + }) + } + return hosts, nil +} + +func (shared *sharedDatastore) getNodeHosts(ctx context.Context, nodes []NodeInfo, dcVC string) ([]hostInfo, error) { + var vmRefs []types.ManagedObjectReference + if len(nodes) < 1 { + return nil, fmt.Errorf("no nodes found for dc-vc: %s", dcVC) + } + var nodeInfo NodeInfo + for _, n := range nodes { + nodeInfo = n + vmRefs = append(vmRefs, n.vm.Reference()) + } + pc := property.DefaultCollector(nodeInfo.dataCenter.Client()) + var vmoList []mo.VirtualMachine + err := pc.Retrieve(ctx, vmRefs, []string{nameProperty, runtimeHost}, &vmoList) + if err != nil { + klog.Errorf("SharedHost.getNodeHosts: unable to fetch vms from datacenter %s: %w", nodeInfo.dataCenter.String(), err) + return nil, err + } + var hostMoList []mo.HostSystem + var hostRefs []types.ManagedObjectReference + for _, vmo := range vmoList { + if vmo.Summary.Runtime.Host == nil { + msg := fmt.Sprintf("SharedHost.getNodeHosts: no host associated with vm %s", vmo.Name) + klog.Error(msg) + return nil, fmt.Errorf(msg) + } + hostRefs = append(hostRefs, vmo.Summary.Runtime.Host.Reference()) + } + pc = property.DefaultCollector(nodeInfo.dataCenter.Client()) + err = pc.Retrieve(ctx, hostRefs, []string{summary}, &hostMoList) + if err != nil { + klog.Errorf("SharedHost.getNodeHosts: unable to fetch hosts from datacenter %s: %w", nodeInfo.dataCenter.String(), err) + return nil, err + } + var hosts []hostInfo + for _, host := range hostMoList { + hosts = append(hosts, hostInfo{hostMOID: host.Summary.Host.String(), hostUUID: host.Summary.Hardware.Uuid, datacenter: nodeInfo.dataCenter.String()}) + } + return hosts, nil +} + +func (shared *sharedDatastore) getAttachedHosts(ctx context.Context, datastore *vclib.Datastore) ([]hostInfo, error) { + var ds mo.Datastore + + pc := property.DefaultCollector(datastore.Client()) + err := pc.RetrieveOne(ctx, datastore.Reference(), []string{hostsProperty}, &ds) + if err != nil { + return nil, err + } + + mounts := make(map[types.ManagedObjectReference]types.DatastoreHostMount) + var refs []types.ManagedObjectReference + for _, host := range ds.Host { + refs = append(refs, host.Key) + mounts[host.Key] = host + } + + var hs []mo.HostSystem + err = pc.Retrieve(ctx, refs, []string{summary}, &hs) + if err != nil { + return nil, err + } + var hosts []hostInfo + for _, h := range hs { + hosts = append(hosts, hostInfo{hostUUID: h.Summary.Hardware.Uuid, hostMOID: h.Summary.Host.String()}) + } + return hosts, nil + +} diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/custom_errors.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/custom_errors.go index 6709c4cf21ad..802901ef5aae 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/custom_errors.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/custom_errors.go @@ -20,20 +20,18 @@ import "errors" // Error Messages const ( - FileAlreadyExistErrMsg = "File requested already exist" - NoDiskUUIDFoundErrMsg = "No disk UUID found" - NoDevicesFoundErrMsg = "No devices found" - DiskNotFoundErrMsg = "No vSphere disk ID found" - InvalidVolumeOptionsErrMsg = "VolumeOptions verification failed" - NoVMFoundErrMsg = "No VM found" + FileAlreadyExistErrMsg = "File requested already exist" + NoDiskUUIDFoundErrMsg = "No disk UUID found" + NoDevicesFoundErrMsg = "No devices found" + DiskNotFoundErrMsg = "No vSphere disk ID found" + NoVMFoundErrMsg = "No VM found" ) // Error constants var ( - ErrFileAlreadyExist = errors.New(FileAlreadyExistErrMsg) - ErrNoDiskUUIDFound = errors.New(NoDiskUUIDFoundErrMsg) - ErrNoDevicesFound = errors.New(NoDevicesFoundErrMsg) - ErrNoDiskIDFound = errors.New(DiskNotFoundErrMsg) - ErrInvalidVolumeOptions = errors.New(InvalidVolumeOptionsErrMsg) - ErrNoVMFound = errors.New(NoVMFoundErrMsg) + ErrFileAlreadyExist = errors.New(FileAlreadyExistErrMsg) + ErrNoDiskUUIDFound = errors.New(NoDiskUUIDFoundErrMsg) + ErrNoDevicesFound = errors.New(NoDevicesFoundErrMsg) + ErrNoDiskIDFound = errors.New(DiskNotFoundErrMsg) + ErrNoVMFound = errors.New(NoVMFoundErrMsg) ) diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers/virtualdisk.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers/virtualdisk.go index 3bb9af0fab4c..88b50641a5c4 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers/virtualdisk.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers/virtualdisk.go @@ -64,9 +64,9 @@ func (virtualDisk *VirtualDisk) Create(ctx context.Context, datastore *vclib.Dat if virtualDisk.VolumeOptions.DiskFormat == "" { virtualDisk.VolumeOptions.DiskFormat = vclib.ThinDiskType } - if !virtualDisk.VolumeOptions.VerifyVolumeOptions() { - klog.Error("VolumeOptions verification failed. volumeOptions: ", virtualDisk.VolumeOptions) - return "", vclib.ErrInvalidVolumeOptions + if err := virtualDisk.VolumeOptions.VerifyVolumeOptions(); err != nil { + klog.Errorf("VolumeOptions verification failed: %s (options: %+v)", err, virtualDisk.VolumeOptions) + return "", fmt.Errorf("validation of parameters failed: %s", err) } if virtualDisk.VolumeOptions.StoragePolicyID != "" && virtualDisk.VolumeOptions.StoragePolicyName != "" { return "", fmt.Errorf("Storage Policy ID and Storage Policy Name both set, Please set only one parameter") diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/virtualmachine.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/virtualmachine.go index 7fc6f1750dbe..a5e170438ad1 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/virtualmachine.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/virtualmachine.go @@ -166,6 +166,24 @@ func (vm *VirtualMachine) AttachDisk(ctx context.Context, vmDiskPath string, vol return diskUUID, nil } +// GetHost returns host of the virtual machine +func (vm *VirtualMachine) GetHost(ctx context.Context) (mo.HostSystem, error) { + host, err := vm.HostSystem(ctx) + var hostSystemMo mo.HostSystem + if err != nil { + klog.Errorf("Failed to get host system for VM: %q. err: %+v", vm.InventoryPath, err) + return hostSystemMo, err + } + + s := object.NewSearchIndex(vm.Client()) + err = s.Properties(ctx, host.Reference(), []string{"summary"}, &hostSystemMo) + if err != nil { + klog.Errorf("Failed to retrieve datastores for host: %+v. err: %+v", host, err) + return hostSystemMo, err + } + return hostSystemMo, nil +} + // DetachDisk detaches the disk specified by vmDiskPath func (vm *VirtualMachine) DetachDisk(ctx context.Context, vmDiskPath string) error { device, err := vm.getVirtualDeviceByPath(ctx, vmDiskPath) diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/volumeoptions.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/volumeoptions.go index 6ff0ad58aec2..ca9be55bed1a 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/volumeoptions.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vclib/volumeoptions.go @@ -17,6 +17,7 @@ limitations under the License. package vclib import ( + "fmt" "strings" "k8s.io/api/core/v1" @@ -90,21 +91,21 @@ func CheckControllerSupported(ctrlType string) bool { } // VerifyVolumeOptions checks if volumeOptions.SCIControllerType is valid controller type -func (volumeOptions VolumeOptions) VerifyVolumeOptions() bool { +func (volumeOptions VolumeOptions) VerifyVolumeOptions() error { // Validate only if SCSIControllerType is set by user. // Default value is set later in virtualDiskManager.Create and vmDiskManager.Create if volumeOptions.SCSIControllerType != "" { isValid := CheckControllerSupported(volumeOptions.SCSIControllerType) if !isValid { - return false + return fmt.Errorf("invalid scsiControllerType: %s", volumeOptions.SCSIControllerType) } } // ThinDiskType is the default, so skip the validation. if volumeOptions.DiskFormat != ThinDiskType { isValid := CheckDiskFormatSupported(volumeOptions.DiskFormat) if !isValid { - return false + return fmt.Errorf("invalid diskFormat: %s", volumeOptions.DiskFormat) } } - return true + return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vsphere.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vsphere.go index 75b6164c2c7b..350029a04c5e 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vsphere.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/vsphere/vsphere.go @@ -1388,13 +1388,20 @@ func (vs *VSphere) CreateVolume(volumeOptions *vclib.VolumeOptions) (canonicalVo if len(zonesToSearch) == 0 { // If zone is not provided, get the shared datastore across all node VMs. klog.V(4).Infof("Validating if datastore %s is shared across all node VMs", datastoreName) - sharedDsList, err = getSharedDatastoresInK8SCluster(ctx, vs.nodeManager) + sharedDSFinder := &sharedDatastore{ + nodeManager: vs.nodeManager, + candidateDatastores: candidateDatastoreInfos, + } + datastoreInfo, err = sharedDSFinder.getSharedDatastore(ctx) if err != nil { klog.Errorf("Failed to get shared datastore: %+v", err) return "", err } - // Prepare error msg to be used later, if required. - err = fmt.Errorf("The specified datastore %s is not a shared datastore across node VMs", datastoreName) + if datastoreInfo == nil { + err = fmt.Errorf("The specified datastore %s is not a shared datastore across node VMs", datastoreName) + klog.Error(err) + return "", err + } } else { // If zone is provided, get the shared datastores in that zone. klog.V(4).Infof("Validating if datastore %s is in zone %s ", datastoreName, zonesToSearch) @@ -1403,21 +1410,19 @@ func (vs *VSphere) CreateVolume(volumeOptions *vclib.VolumeOptions) (canonicalVo klog.Errorf("Failed to find a shared datastore matching zone %s. err: %+v", zonesToSearch, err) return "", err } - // Prepare error msg to be used later, if required. - err = fmt.Errorf("The specified datastore %s does not match the provided zones : %s", datastoreName, zonesToSearch) - } - found := false - // Check if the selected datastore belongs to the list of shared datastores computed. - for _, sharedDs := range sharedDsList { - if datastoreInfo, found = candidateDatastores[sharedDs.Info.Url]; found { - klog.V(4).Infof("Datastore validation succeeded") - found = true - break + found := false + for _, sharedDs := range sharedDsList { + if datastoreInfo, found = candidateDatastores[sharedDs.Info.Url]; found { + klog.V(4).Infof("Datastore validation succeeded") + found = true + break + } + } + if !found { + err = fmt.Errorf("The specified datastore %s does not match the provided zones : %s", datastoreName, zonesToSearch) + klog.Error(err) + return "", err } - } - if !found { - klog.Error(err) - return "", err } } } diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/go.mod b/cluster-autoscaler/vendor/k8s.io/mount-utils/go.mod index 401f7d4d62df..4c83c0a0924a 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/go.mod +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/go.mod @@ -9,6 +9,7 @@ require ( github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/stretchr/testify v1.6.1 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect - k8s.io/klog/v2 v2.5.0 + gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect + k8s.io/klog/v2 v2.8.0 k8s.io/utils v0.0.0-20201110183641-67b214c5f920 ) diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/go.sum b/cluster-autoscaler/vendor/k8s.io/mount-utils/go.sum index c3b01e4c2a35..1c34048641d9 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/go.sum +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/go.sum @@ -22,10 +22,11 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.5.0 h1:8mOnjf1RmUPW6KRqQCfYSZq/K20Unmp3IhuZUhxl8KI= -k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_common.go b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_common.go index a79874855628..dd4dc2c8e5ad 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_common.go +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_common.go @@ -122,6 +122,10 @@ func removePathIfNotMountPoint(mountPath string, mounter Interface, extensiveMou } if err != nil { + if os.IsNotExist(err) { + klog.V(4).Infof("%q does not exist", mountPath) + return true, nil + } return notMnt, err } diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_unix.go b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_unix.go index 11b70ebc298c..2c14a27c7192 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_unix.go +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_unix.go @@ -52,7 +52,7 @@ func IsCorruptedMnt(err error) bool { underlyingError = pe.Err } - return underlyingError == syscall.ENOTCONN || underlyingError == syscall.ESTALE || underlyingError == syscall.EIO || underlyingError == syscall.EACCES + return underlyingError == syscall.ENOTCONN || underlyingError == syscall.ESTALE || underlyingError == syscall.EIO || underlyingError == syscall.EACCES || underlyingError == syscall.EHOSTDOWN } // MountInfo represents a single line in /proc//mountinfo. diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_windows.go b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_windows.go index b308ce76d2f9..865ab5c3243f 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_windows.go @@ -38,7 +38,8 @@ import ( // ERROR_BAD_NET_NAME = 67 // ERROR_SESSION_CREDENTIAL_CONFLICT = 1219 // ERROR_LOGON_FAILURE = 1326 -var errorNoList = [...]int{53, 54, 59, 64, 65, 66, 67, 1219, 1326} +// WSAEHOSTDOWN = 10064 +var errorNoList = [...]int{53, 54, 59, 64, 65, 66, 67, 1219, 1326, 10064} // IsCorruptedMnt return true if err is about corrupted mount point func IsCorruptedMnt(err error) bool { diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/resizefs_linux.go b/cluster-autoscaler/vendor/k8s.io/mount-utils/resizefs_linux.go index 3b2ffa313661..54a529d7c699 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/resizefs_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/resizefs_linux.go @@ -20,6 +20,8 @@ package mount import ( "fmt" + "strconv" + "strings" "k8s.io/klog/v2" utilexec "k8s.io/utils/exec" @@ -99,3 +101,117 @@ func (resizefs *ResizeFs) btrfsResize(deviceMountPath string) (bool, error) { resizeError := fmt.Errorf("resize of device %s failed: %v. btrfs output: %s", deviceMountPath, err, string(output)) return false, resizeError } + +func (resizefs *ResizeFs) NeedResize(devicePath string, deviceMountPath string) (bool, error) { + deviceSize, err := resizefs.getDeviceSize(devicePath) + if err != nil { + return false, err + } + var fsSize, blockSize uint64 + format, err := getDiskFormat(resizefs.exec, devicePath) + if err != nil { + formatErr := fmt.Errorf("ResizeFS.Resize - error checking format for device %s: %v", devicePath, err) + return false, formatErr + } + + // If disk has no format, there is no need to resize the disk because mkfs.* + // by default will use whole disk anyways. + if format == "" { + return false, nil + } + + klog.V(3).Infof("ResizeFs.needResize - checking mounted volume %s", devicePath) + switch format { + case "ext3", "ext4": + blockSize, fsSize, err = resizefs.getExtSize(devicePath) + klog.V(5).Infof("Ext size: filesystem size=%d, block size=%d", fsSize, blockSize) + case "xfs": + blockSize, fsSize, err = resizefs.getXFSSize(deviceMountPath) + klog.V(5).Infof("Xfs size: filesystem size=%d, block size=%d, err=%v", fsSize, blockSize, err) + default: + klog.Errorf("Not able to parse given filesystem info. fsType: %s, will not resize", format) + return false, fmt.Errorf("Could not parse fs info on given filesystem format: %s. Supported fs types are: xfs, ext3, ext4", format) + } + if err != nil { + return false, err + } + // Tolerate one block difference, just in case of rounding errors somewhere. + klog.V(5).Infof("Volume %s: device size=%d, filesystem size=%d, block size=%d", devicePath, deviceSize, fsSize, blockSize) + if deviceSize <= fsSize+blockSize { + return false, nil + } + return true, nil +} +func (resizefs *ResizeFs) getDeviceSize(devicePath string) (uint64, error) { + output, err := resizefs.exec.Command("blockdev", "--getsize64", devicePath).CombinedOutput() + outStr := strings.TrimSpace(string(output)) + if err != nil { + return 0, fmt.Errorf("failed to read size of device %s: %s: %s", devicePath, err, outStr) + } + size, err := strconv.ParseUint(outStr, 10, 64) + if err != nil { + return 0, fmt.Errorf("failed to parse size of device %s %s: %s", devicePath, outStr, err) + } + return size, nil +} + +func (resizefs *ResizeFs) getExtSize(devicePath string) (uint64, uint64, error) { + output, err := resizefs.exec.Command("dumpe2fs", "-h", devicePath).CombinedOutput() + if err != nil { + return 0, 0, fmt.Errorf("failed to read size of filesystem on %s: %s: %s", devicePath, err, string(output)) + } + + blockSize, blockCount, _ := resizefs.parseFsInfoOutput(string(output), ":", "block size", "block count") + + if blockSize == 0 { + return 0, 0, fmt.Errorf("could not find block size of device %s", devicePath) + } + if blockCount == 0 { + return 0, 0, fmt.Errorf("could not find block count of device %s", devicePath) + } + return blockSize, blockSize * blockCount, nil +} + +func (resizefs *ResizeFs) getXFSSize(devicePath string) (uint64, uint64, error) { + output, err := resizefs.exec.Command("xfs_io", "-c", "statfs", devicePath).CombinedOutput() + if err != nil { + return 0, 0, fmt.Errorf("failed to read size of filesystem on %s: %s: %s", devicePath, err, string(output)) + } + + blockSize, blockCount, _ := resizefs.parseFsInfoOutput(string(output), "=", "geom.bsize", "geom.datablocks") + + if blockSize == 0 { + return 0, 0, fmt.Errorf("could not find block size of device %s", devicePath) + } + if blockCount == 0 { + return 0, 0, fmt.Errorf("could not find block count of device %s", devicePath) + } + return blockSize, blockSize * blockCount, nil +} + +func (resizefs *ResizeFs) parseFsInfoOutput(cmdOutput string, spliter string, blockSizeKey string, blockCountKey string) (uint64, uint64, error) { + lines := strings.Split(cmdOutput, "\n") + var blockSize, blockCount uint64 + var err error + + for _, line := range lines { + tokens := strings.Split(line, spliter) + if len(tokens) != 2 { + continue + } + key, value := strings.ToLower(strings.TrimSpace(tokens[0])), strings.ToLower(strings.TrimSpace(tokens[1])) + if key == blockSizeKey { + blockSize, err = strconv.ParseUint(value, 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("failed to parse block size %s: %s", value, err) + } + } + if key == blockCountKey { + blockCount, err = strconv.ParseUint(value, 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("failed to parse block count %s: %s", value, err) + } + } + } + return blockSize, blockCount, err +} diff --git a/cluster-autoscaler/vendor/modules.txt b/cluster-autoscaler/vendor/modules.txt index eb1013c4a71f..505524a63b45 100644 --- a/cluster-autoscaler/vendor/modules.txt +++ b/cluster-autoscaler/vendor/modules.txt @@ -1,14 +1,13 @@ # cloud.google.com/go v0.54.0 ## explicit cloud.google.com/go/compute/metadata -# github.com/Azure/azure-sdk-for-go v43.0.0+incompatible +# github.com/Azure/azure-sdk-for-go v53.1.0+incompatible ## explicit github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources -github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage github.com/Azure/azure-sdk-for-go/storage github.com/Azure/azure-sdk-for-go/version @@ -17,11 +16,11 @@ github.com/Azure/go-ansiterm github.com/Azure/go-ansiterm/winterm # github.com/Azure/go-autorest v14.2.0+incompatible github.com/Azure/go-autorest -# github.com/Azure/go-autorest/autorest v0.11.12 +# github.com/Azure/go-autorest/autorest v0.11.17 ## explicit github.com/Azure/go-autorest/autorest github.com/Azure/go-autorest/autorest/azure -# github.com/Azure/go-autorest/autorest/adal v0.9.5 +# github.com/Azure/go-autorest/autorest/adal v0.9.10 ## explicit github.com/Azure/go-autorest/autorest/adal # github.com/Azure/go-autorest/autorest/date v0.3.0 @@ -136,7 +135,7 @@ github.com/cespare/xxhash/v2 # github.com/checkpoint-restore/go-criu/v4 v4.1.0 github.com/checkpoint-restore/go-criu/v4 github.com/checkpoint-restore/go-criu/v4/rpc -# github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775 +# github.com/cilium/ebpf v0.2.0 github.com/cilium/ebpf github.com/cilium/ebpf/asm github.com/cilium/ebpf/internal @@ -148,9 +147,9 @@ github.com/clusterhq/flocker-go github.com/container-storage-interface/spec/lib/go/csi # github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 github.com/containerd/cgroups/stats/v1 -# github.com/containerd/console v1.0.0 +# github.com/containerd/console v1.0.1 github.com/containerd/console -# github.com/containerd/containerd v1.4.1 +# github.com/containerd/containerd v1.4.4 github.com/containerd/containerd/api/services/containers/v1 github.com/containerd/containerd/api/services/tasks/v1 github.com/containerd/containerd/api/services/version/v1 @@ -159,8 +158,10 @@ github.com/containerd/containerd/api/types/task github.com/containerd/containerd/containers github.com/containerd/containerd/errdefs github.com/containerd/containerd/identifiers +github.com/containerd/containerd/log github.com/containerd/containerd/namespaces github.com/containerd/containerd/pkg/dialer +github.com/containerd/containerd/platforms # github.com/containerd/ttrpc v1.0.2 github.com/containerd/ttrpc # github.com/containernetworking/cni v0.8.0 @@ -193,7 +194,7 @@ github.com/digitalocean/godo github.com/docker/distribution/digestset github.com/docker/distribution/reference github.com/docker/distribution/registry/api/errcode -# github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible +# github.com/docker/docker v20.10.2+incompatible github.com/docker/docker/api github.com/docker/docker/api/types github.com/docker/docker/api/types/blkiodev @@ -214,8 +215,6 @@ github.com/docker/docker/client github.com/docker/docker/errdefs github.com/docker/docker/pkg/jsonmessage github.com/docker/docker/pkg/stdcopy -github.com/docker/docker/pkg/term -github.com/docker/docker/pkg/term/windows # github.com/docker/go-connections v0.4.0 github.com/docker/go-connections/nat github.com/docker/go-connections/sockets @@ -242,8 +241,6 @@ github.com/go-logr/logr github.com/go-openapi/jsonpointer # github.com/go-openapi/jsonreference v0.19.3 github.com/go-openapi/jsonreference -# github.com/go-openapi/spec v0.19.5 -github.com/go-openapi/spec # github.com/go-openapi/swag v0.19.5 github.com/go-openapi/swag # github.com/go-ozzo/ozzo-validation v3.5.0+incompatible @@ -251,6 +248,8 @@ github.com/go-ozzo/ozzo-validation github.com/go-ozzo/ozzo-validation/is # github.com/godbus/dbus/v5 v5.0.3 github.com/godbus/dbus/v5 +# github.com/gofrs/uuid v4.0.0+incompatible +github.com/gofrs/uuid # github.com/gogo/protobuf v1.3.2 github.com/gogo/protobuf/gogoproto github.com/gogo/protobuf/proto @@ -270,7 +269,7 @@ github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp github.com/golang/protobuf/ptypes/wrappers -# github.com/google/cadvisor v0.38.8 +# github.com/google/cadvisor v0.39.0 github.com/google/cadvisor/accelerators github.com/google/cadvisor/cache/memory github.com/google/cadvisor/collector @@ -330,9 +329,10 @@ github.com/google/gofuzz github.com/google/uuid # github.com/googleapis/gax-go/v2 v2.0.5 github.com/googleapis/gax-go/v2 -# github.com/googleapis/gnostic v0.4.1 +# github.com/googleapis/gnostic v0.5.1 github.com/googleapis/gnostic/compiler github.com/googleapis/gnostic/extensions +github.com/googleapis/gnostic/jsonschema github.com/googleapis/gnostic/openapiv2 # github.com/gophercloud/gophercloud v0.1.0 github.com/gophercloud/gophercloud @@ -388,7 +388,7 @@ github.com/json-iterator/go # github.com/karrick/godirwalk v1.16.1 github.com/karrick/godirwalk # github.com/konsorten/go-windows-terminal-sequences v1.0.3 -github.com/konsorten/go-windows-terminal-sequences +## explicit # github.com/libopenstorage/openstorage v1.0.0 github.com/libopenstorage/openstorage/api github.com/libopenstorage/openstorage/api/client @@ -418,8 +418,11 @@ github.com/moby/ipvs # github.com/moby/spdystream v0.2.0 github.com/moby/spdystream github.com/moby/spdystream/spdy -# github.com/moby/sys/mountinfo v0.1.3 +# github.com/moby/sys/mountinfo v0.4.0 github.com/moby/sys/mountinfo +# github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 +github.com/moby/term +github.com/moby/term/windows # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd github.com/modern-go/concurrent # github.com/modern-go/reflect2 v1.0.1 @@ -428,7 +431,7 @@ github.com/modern-go/reflect2 github.com/mohae/deepcopy # github.com/morikuni/aec v1.0.0 github.com/morikuni/aec -# github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976 +# github.com/mrunalp/fileutils v0.5.0 github.com/mrunalp/fileutils # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 github.com/munnerz/goautoneg @@ -439,9 +442,10 @@ github.com/opencontainers/go-digest # github.com/opencontainers/image-spec v1.0.1 github.com/opencontainers/image-spec/specs-go github.com/opencontainers/image-spec/specs-go/v1 -# github.com/opencontainers/runc v1.0.0-rc92 +# github.com/opencontainers/runc v1.0.0-rc93 github.com/opencontainers/runc/libcontainer github.com/opencontainers/runc/libcontainer/apparmor +github.com/opencontainers/runc/libcontainer/capabilities github.com/opencontainers/runc/libcontainer/cgroups github.com/opencontainers/runc/libcontainer/cgroups/devices github.com/opencontainers/runc/libcontainer/cgroups/ebpf @@ -452,18 +456,20 @@ github.com/opencontainers/runc/libcontainer/cgroups/fscommon github.com/opencontainers/runc/libcontainer/cgroups/systemd github.com/opencontainers/runc/libcontainer/configs github.com/opencontainers/runc/libcontainer/configs/validate +github.com/opencontainers/runc/libcontainer/devices github.com/opencontainers/runc/libcontainer/intelrdt github.com/opencontainers/runc/libcontainer/keys github.com/opencontainers/runc/libcontainer/logs github.com/opencontainers/runc/libcontainer/seccomp +github.com/opencontainers/runc/libcontainer/seccomp/patchbpf github.com/opencontainers/runc/libcontainer/stacktrace github.com/opencontainers/runc/libcontainer/system github.com/opencontainers/runc/libcontainer/user github.com/opencontainers/runc/libcontainer/utils github.com/opencontainers/runc/types -# github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6 +# github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d github.com/opencontainers/runtime-spec/specs-go -# github.com/opencontainers/selinux v1.6.0 +# github.com/opencontainers/selinux v1.8.0 github.com/opencontainers/selinux/go-selinux github.com/opencontainers/selinux/go-selinux/label github.com/opencontainers/selinux/pkg/pwalk @@ -497,7 +503,7 @@ github.com/rubiojr/go-vhd/vhd github.com/satori/go.uuid # github.com/seccomp/libseccomp-golang v0.9.1 github.com/seccomp/libseccomp-golang -# github.com/sirupsen/logrus v1.6.0 +# github.com/sirupsen/logrus v1.7.0 github.com/sirupsen/logrus # github.com/spf13/afero v1.2.2 github.com/spf13/afero @@ -520,7 +526,7 @@ github.com/stretchr/testify/assert github.com/stretchr/testify/mock github.com/stretchr/testify/require github.com/stretchr/testify/suite -# github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 +# github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 github.com/syndtr/gocapability/capability # github.com/thecodeteam/goscaleio v0.1.0 github.com/thecodeteam/goscaleio @@ -557,7 +563,7 @@ github.com/vmware/govmomi/vim25/progress github.com/vmware/govmomi/vim25/soap github.com/vmware/govmomi/vim25/types github.com/vmware/govmomi/vim25/xml -# github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243 +# github.com/willf/bitset v1.1.11 github.com/willf/bitset # go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489 go.etcd.io/etcd/auth/authpb @@ -599,11 +605,11 @@ go.opencensus.io/trace go.opencensus.io/trace/internal go.opencensus.io/trace/propagation go.opencensus.io/trace/tracestate -# go.uber.org/atomic v1.4.0 +# go.uber.org/atomic v1.6.0 go.uber.org/atomic -# go.uber.org/multierr v1.1.0 +# go.uber.org/multierr v1.5.0 go.uber.org/multierr -# go.uber.org/zap v1.10.0 +# go.uber.org/zap v1.16.0 go.uber.org/zap go.uber.org/zap/buffer go.uber.org/zap/internal/bufferpool @@ -793,9 +799,9 @@ gopkg.in/warnings.v0 # gopkg.in/yaml.v2 v2.4.0 ## explicit gopkg.in/yaml.v2 -# gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c +# gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 gopkg.in/yaml.v3 -# k8s.io/api v0.21.0-beta.1 => k8s.io/api v0.21.0-beta.1 +# k8s.io/api v0.22.0-alpha.1 => k8s.io/api v0.22.0-alpha.1 ## explicit k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -831,6 +837,7 @@ k8s.io/api/networking/v1beta1 k8s.io/api/node/v1 k8s.io/api/node/v1alpha1 k8s.io/api/node/v1beta1 +k8s.io/api/policy/v1 k8s.io/api/policy/v1beta1 k8s.io/api/rbac/v1 k8s.io/api/rbac/v1alpha1 @@ -841,7 +848,7 @@ k8s.io/api/scheduling/v1beta1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -# k8s.io/apimachinery v0.21.0-beta.1 => k8s.io/apimachinery v0.21.0-beta.1 +# k8s.io/apimachinery v0.22.0-alpha.1 => k8s.io/apimachinery v0.22.0-alpha.1 ## explicit k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -880,6 +887,7 @@ k8s.io/apimachinery/pkg/util/httpstream k8s.io/apimachinery/pkg/util/httpstream/spdy k8s.io/apimachinery/pkg/util/intstr k8s.io/apimachinery/pkg/util/json +k8s.io/apimachinery/pkg/util/managedfields k8s.io/apimachinery/pkg/util/mergepatch k8s.io/apimachinery/pkg/util/naming k8s.io/apimachinery/pkg/util/net @@ -901,7 +909,7 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.21.0-beta.1 => k8s.io/apiserver v0.21.0-beta.1 +# k8s.io/apiserver v0.22.0-alpha.1 => k8s.io/apiserver v0.22.0-alpha.1 ## explicit k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/admission/configuration @@ -963,6 +971,7 @@ k8s.io/apiserver/pkg/endpoints/filters k8s.io/apiserver/pkg/endpoints/handlers k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal +k8s.io/apiserver/pkg/endpoints/handlers/finisher k8s.io/apiserver/pkg/endpoints/handlers/negotiation k8s.io/apiserver/pkg/endpoints/handlers/responsewriters k8s.io/apiserver/pkg/endpoints/metrics @@ -1026,7 +1035,7 @@ k8s.io/apiserver/plugin/pkg/audit/truncate k8s.io/apiserver/plugin/pkg/audit/webhook k8s.io/apiserver/plugin/pkg/authenticator/token/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook -# k8s.io/client-go v0.21.0-beta.1 => k8s.io/client-go v0.21.0-beta.1 +# k8s.io/client-go v0.22.0-alpha.1 => k8s.io/client-go v0.22.0-alpha.1 ## explicit k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1 @@ -1051,12 +1060,14 @@ k8s.io/client-go/applyconfigurations/events/v1beta1 k8s.io/client-go/applyconfigurations/extensions/v1beta1 k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1 k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1 +k8s.io/client-go/applyconfigurations/internal k8s.io/client-go/applyconfigurations/meta/v1 k8s.io/client-go/applyconfigurations/networking/v1 k8s.io/client-go/applyconfigurations/networking/v1beta1 k8s.io/client-go/applyconfigurations/node/v1 k8s.io/client-go/applyconfigurations/node/v1alpha1 k8s.io/client-go/applyconfigurations/node/v1beta1 +k8s.io/client-go/applyconfigurations/policy/v1 k8s.io/client-go/applyconfigurations/policy/v1beta1 k8s.io/client-go/applyconfigurations/rbac/v1 k8s.io/client-go/applyconfigurations/rbac/v1alpha1 @@ -1119,6 +1130,7 @@ k8s.io/client-go/informers/node/v1 k8s.io/client-go/informers/node/v1alpha1 k8s.io/client-go/informers/node/v1beta1 k8s.io/client-go/informers/policy +k8s.io/client-go/informers/policy/v1 k8s.io/client-go/informers/policy/v1beta1 k8s.io/client-go/informers/rbac k8s.io/client-go/informers/rbac/v1 @@ -1199,6 +1211,8 @@ k8s.io/client-go/kubernetes/typed/node/v1alpha1 k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake k8s.io/client-go/kubernetes/typed/node/v1beta1 k8s.io/client-go/kubernetes/typed/node/v1beta1/fake +k8s.io/client-go/kubernetes/typed/policy/v1 +k8s.io/client-go/kubernetes/typed/policy/v1/fake k8s.io/client-go/kubernetes/typed/policy/v1beta1 k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake k8s.io/client-go/kubernetes/typed/rbac/v1 @@ -1247,6 +1261,7 @@ k8s.io/client-go/listers/networking/v1beta1 k8s.io/client-go/listers/node/v1 k8s.io/client-go/listers/node/v1alpha1 k8s.io/client-go/listers/node/v1beta1 +k8s.io/client-go/listers/policy/v1 k8s.io/client-go/listers/policy/v1beta1 k8s.io/client-go/listers/rbac/v1 k8s.io/client-go/listers/rbac/v1alpha1 @@ -1304,7 +1319,7 @@ k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/workqueue -# k8s.io/cloud-provider v0.21.0-beta.1 => k8s.io/cloud-provider v0.21.0-beta.1 +# k8s.io/cloud-provider v0.22.0-alpha.1 => k8s.io/cloud-provider v0.22.0-alpha.1 ## explicit k8s.io/cloud-provider k8s.io/cloud-provider/api @@ -1314,7 +1329,7 @@ k8s.io/cloud-provider/service/helpers k8s.io/cloud-provider/volume k8s.io/cloud-provider/volume/errors k8s.io/cloud-provider/volume/helpers -# k8s.io/component-base v0.21.0-beta.1 => k8s.io/component-base v0.21.0-beta.1 +# k8s.io/component-base v0.22.0-alpha.1 => k8s.io/component-base v0.22.0-alpha.1 ## explicit k8s.io/component-base/cli/flag k8s.io/component-base/codec @@ -1336,38 +1351,39 @@ k8s.io/component-base/metrics/prometheus/workqueue k8s.io/component-base/metrics/testutil k8s.io/component-base/version k8s.io/component-base/version/verflag -# k8s.io/component-helpers v0.21.0-beta.1 => k8s.io/component-helpers v0.21.0-beta.1 +# k8s.io/component-helpers v0.22.0-alpha.1 => k8s.io/component-helpers v0.22.0-alpha.1 ## explicit k8s.io/component-helpers/apimachinery/lease k8s.io/component-helpers/node/topology k8s.io/component-helpers/scheduling/corev1 k8s.io/component-helpers/scheduling/corev1/nodeaffinity k8s.io/component-helpers/storage/volume -# k8s.io/cri-api v0.0.0 => k8s.io/cri-api v0.21.0-beta.1 +# k8s.io/cri-api v0.0.0 => k8s.io/cri-api v0.22.0-alpha.1 k8s.io/cri-api/pkg/apis k8s.io/cri-api/pkg/apis/runtime/v1alpha2 -# k8s.io/csi-translation-lib v0.21.0-beta.1 => k8s.io/csi-translation-lib v0.21.0-beta.1 +# k8s.io/csi-translation-lib v0.22.0-alpha.1 => k8s.io/csi-translation-lib v0.22.0-alpha.1 k8s.io/csi-translation-lib k8s.io/csi-translation-lib/plugins -# k8s.io/klog/v2 v2.5.0 +# k8s.io/klog/v2 v2.8.0 ## explicit k8s.io/klog/v2 -# k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 +# k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e k8s.io/kube-openapi/pkg/builder k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/handler k8s.io/kube-openapi/pkg/schemaconv k8s.io/kube-openapi/pkg/util k8s.io/kube-openapi/pkg/util/proto -# k8s.io/kube-proxy v0.0.0 => k8s.io/kube-proxy v0.21.0-beta.1 +k8s.io/kube-openapi/pkg/validation/spec +# k8s.io/kube-proxy v0.0.0 => k8s.io/kube-proxy v0.22.0-alpha.1 k8s.io/kube-proxy/config/v1alpha1 -# k8s.io/kube-scheduler v0.0.0 => k8s.io/kube-scheduler v0.21.0-beta.1 +# k8s.io/kube-scheduler v0.0.0 => k8s.io/kube-scheduler v0.22.0-alpha.1 k8s.io/kube-scheduler/config/v1 k8s.io/kube-scheduler/config/v1beta1 k8s.io/kube-scheduler/extender/v1 -# k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.21.0-beta.1 +# k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.22.0-alpha.1 k8s.io/kubectl/pkg/scale -# k8s.io/kubelet v0.0.0 => k8s.io/kubelet v0.21.0-beta.1 +# k8s.io/kubelet v0.0.0 => k8s.io/kubelet v0.22.0-alpha.1 ## explicit k8s.io/kubelet/config/v1alpha1 k8s.io/kubelet/config/v1beta1 @@ -1380,7 +1396,7 @@ k8s.io/kubelet/pkg/apis/pluginregistration/v1 k8s.io/kubelet/pkg/apis/podresources/v1 k8s.io/kubelet/pkg/apis/podresources/v1alpha1 k8s.io/kubelet/pkg/apis/stats/v1alpha1 -# k8s.io/kubernetes v1.21.0-beta.1 +# k8s.io/kubernetes v1.22.0-alpha.1 ## explicit k8s.io/kubernetes/cmd/kube-proxy/app k8s.io/kubernetes/cmd/kubelet/app @@ -1483,7 +1499,6 @@ k8s.io/kubernetes/pkg/kubelet/kubeletconfig/configfiles k8s.io/kubernetes/pkg/kubelet/kubeletconfig/status k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/codec k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/files -k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/log k8s.io/kubernetes/pkg/kubelet/kubeletconfig/util/panic k8s.io/kubernetes/pkg/kubelet/kuberuntime k8s.io/kubernetes/pkg/kubelet/kuberuntime/logs @@ -1672,7 +1687,7 @@ k8s.io/kubernetes/pkg/volume/vsphere_volume k8s.io/kubernetes/pkg/windows/service k8s.io/kubernetes/test/utils k8s.io/kubernetes/third_party/forked/golang/expansion -# k8s.io/legacy-cloud-providers v0.0.0 => k8s.io/legacy-cloud-providers v0.21.0-beta.1 +# k8s.io/legacy-cloud-providers v0.0.0 => k8s.io/legacy-cloud-providers v0.22.0-alpha.1 ## explicit k8s.io/legacy-cloud-providers/aws k8s.io/legacy-cloud-providers/azure @@ -1718,7 +1733,7 @@ k8s.io/legacy-cloud-providers/openstack k8s.io/legacy-cloud-providers/vsphere k8s.io/legacy-cloud-providers/vsphere/vclib k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers -# k8s.io/mount-utils v0.0.0 => k8s.io/mount-utils v0.21.0-beta.1 +# k8s.io/mount-utils v0.0.0 => k8s.io/mount-utils v0.22.0-alpha.1 k8s.io/mount-utils # k8s.io/utils v0.0.0-20201110183641-67b214c5f920 ## explicit @@ -1740,7 +1755,7 @@ k8s.io/utils/trace # sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15 sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client -# sigs.k8s.io/structured-merge-diff/v4 v4.0.3 +# sigs.k8s.io/structured-merge-diff/v4 v4.1.1 sigs.k8s.io/structured-merge-diff/v4/fieldpath sigs.k8s.io/structured-merge-diff/v4/merge sigs.k8s.io/structured-merge-diff/v4/schema @@ -1750,29 +1765,29 @@ sigs.k8s.io/structured-merge-diff/v4/value sigs.k8s.io/yaml # github.com/digitalocean/godo => github.com/digitalocean/godo v1.27.0 # github.com/rancher/go-rancher => github.com/rancher/go-rancher v0.1.0 -# k8s.io/api => k8s.io/api v0.21.0-beta.1 -# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.21.0-beta.1 -# k8s.io/apimachinery => k8s.io/apimachinery v0.21.0-beta.1 -# k8s.io/apiserver => k8s.io/apiserver v0.21.0-beta.1 -# k8s.io/cli-runtime => k8s.io/cli-runtime v0.21.0-beta.1 -# k8s.io/client-go => k8s.io/client-go v0.21.0-beta.1 -# k8s.io/cloud-provider => k8s.io/cloud-provider v0.21.0-beta.1 -# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.21.0-beta.1 -# k8s.io/code-generator => k8s.io/code-generator v0.21.0-beta.1 -# k8s.io/component-base => k8s.io/component-base v0.21.0-beta.1 -# k8s.io/component-helpers => k8s.io/component-helpers v0.21.0-beta.1 -# k8s.io/controller-manager => k8s.io/controller-manager v0.21.0-beta.1 -# k8s.io/cri-api => k8s.io/cri-api v0.21.0-beta.1 -# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.21.0-beta.1 -# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.21.0-beta.1 -# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.21.0-beta.1 -# k8s.io/kube-proxy => k8s.io/kube-proxy v0.21.0-beta.1 -# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.21.0-beta.1 -# k8s.io/kubectl => k8s.io/kubectl v0.21.0-beta.1 -# k8s.io/kubelet => k8s.io/kubelet v0.21.0-beta.1 -# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.21.0-beta.1 -# k8s.io/metrics => k8s.io/metrics v0.21.0-beta.1 -# k8s.io/mount-utils => k8s.io/mount-utils v0.21.0-beta.1 -# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.21.0-beta.1 -# k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.21.0-beta.1 -# k8s.io/sample-controller => k8s.io/sample-controller v0.21.0-beta.1 +# k8s.io/api => k8s.io/api v0.22.0-alpha.1 +# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0-alpha.1 +# k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.1 +# k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.1 +# k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.0-alpha.1 +# k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.1 +# k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0-alpha.1 +# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.0-alpha.1 +# k8s.io/code-generator => k8s.io/code-generator v0.22.0-alpha.1 +# k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.1 +# k8s.io/component-helpers => k8s.io/component-helpers v0.22.0-alpha.1 +# k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.1 +# k8s.io/cri-api => k8s.io/cri-api v0.22.0-alpha.1 +# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.22.0-alpha.1 +# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.22.0-alpha.1 +# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.22.0-alpha.1 +# k8s.io/kube-proxy => k8s.io/kube-proxy v0.22.0-alpha.1 +# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.22.0-alpha.1 +# k8s.io/kubectl => k8s.io/kubectl v0.22.0-alpha.1 +# k8s.io/kubelet => k8s.io/kubelet v0.22.0-alpha.1 +# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.22.0-alpha.1 +# k8s.io/metrics => k8s.io/metrics v0.22.0-alpha.1 +# k8s.io/mount-utils => k8s.io/mount-utils v0.22.0-alpha.1 +# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.0-alpha.1 +# k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.22.0-alpha.1 +# k8s.io/sample-controller => k8s.io/sample-controller v0.22.0-alpha.1 diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/set.go b/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/set.go index 5461326a886d..6d182768d052 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/set.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/set.go @@ -206,6 +206,40 @@ func (s *Set) WithPrefix(pe PathElement) *Set { return subset } +// Leaves returns a set containing only the leaf paths +// of a set. +func (s *Set) Leaves() *Set { + leaves := PathElementSet{} + im := 0 + ic := 0 + + // any members that are not also children are leaves +outer: + for im < len(s.Members.members) { + member := s.Members.members[im] + + for ic < len(s.Children.members) { + d := member.Compare(s.Children.members[ic].pathElement) + if d == 0 { + ic++ + im++ + continue outer + } else if d < 0 { + break + } else /* if d > 0 */ { + ic++ + } + } + leaves.members = append(leaves.members, member) + im++ + } + + return &Set{ + Members: leaves, + Children: *s.Children.Leaves(), + } +} + // setNode is a pair of PathElement / Set, for the purpose of expressing // nested set membership. type setNode struct { @@ -455,3 +489,17 @@ func (s *SetNodeMap) iteratePrefix(prefix Path, f func(Path)) { n.set.iteratePrefix(append(prefix, pe), f) } } + +// Leaves returns a SetNodeMap containing +// only setNodes with leaf PathElements. +func (s *SetNodeMap) Leaves() *SetNodeMap { + out := &SetNodeMap{} + out.members = make(sortedSetNode, len(s.members)) + for i, n := range s.members { + out.members[i] = setNode{ + pathElement: n.pathElement, + set: n.set.Leaves(), + } + } + return out +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/reconcile_schema.go b/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/reconcile_schema.go index 5a8214ae2d4e..27b663e399f0 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/reconcile_schema.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/reconcile_schema.go @@ -187,19 +187,17 @@ func (v *reconcileWithSchemaWalker) visitListItems(t *schema.List, element *fiel } func (v *reconcileWithSchemaWalker) doList(t *schema.List) (errs ValidationErrors) { - // reconcile lists changed from granular to atomic + // reconcile lists changed from granular to atomic. + // Note that migrations from atomic to granular are not recommended and will + // be treated as if they were always granular. + // + // In this case, the manager that owned the previously atomic field (and all subfields), + // will now own just the top-level field and none of the subfields. if !v.isAtomic && t.ElementRelationship == schema.Atomic { v.toRemove = fieldpath.NewSet(v.path) // remove all root and all children fields v.toAdd = fieldpath.NewSet(v.path) // add the root of the atomic return errs } - // reconcile lists changed from atomic to granular - if v.isAtomic && t.ElementRelationship == schema.Associative { - v.toAdd, errs = buildGranularFieldSet(v.path, v.value) - if errs != nil { - return errs - } - } if v.fieldSet != nil { errs = v.visitListItems(t, v.fieldSet) } @@ -231,7 +229,12 @@ func (v *reconcileWithSchemaWalker) visitMapItems(t *schema.Map, element *fieldp } func (v *reconcileWithSchemaWalker) doMap(t *schema.Map) (errs ValidationErrors) { - // reconcile maps and structs changed from granular to atomic + // reconcile maps and structs changed from granular to atomic. + // Note that migrations from atomic to granular are not recommended and will + // be treated as if they were always granular. + // + // In this case the manager that owned the previously atomic field (and all subfields), + // will now own just the top-level field and none of the subfields. if !v.isAtomic && t.ElementRelationship == schema.Atomic { if v.fieldSet != nil && v.fieldSet.Size() > 0 { v.toRemove = fieldpath.NewSet(v.path) // remove all root and all children fields @@ -239,34 +242,12 @@ func (v *reconcileWithSchemaWalker) doMap(t *schema.Map) (errs ValidationErrors) } return errs } - // reconcile maps changed from atomic to granular - if v.isAtomic && (t.ElementRelationship == schema.Separable || t.ElementRelationship == "") { - v.toAdd, errs = buildGranularFieldSet(v.path, v.value) - if errs != nil { - return errs - } - } if v.fieldSet != nil { errs = v.visitMapItems(t, v.fieldSet) } return errs } -func buildGranularFieldSet(path fieldpath.Path, value *TypedValue) (*fieldpath.Set, ValidationErrors) { - - valueFieldSet, err := value.ToFieldSet() - if err != nil { - return nil, errorf("toFieldSet: %v", err) - } - if valueFieldSetAtPath, ok := fieldSetAtPath(valueFieldSet, path); ok { - result := fieldpath.NewSet(path) - resultAtPath := descendToPath(result, path) - *resultAtPath = *valueFieldSetAtPath - return result, nil - } - return nil, nil -} - func fieldSetAtPath(node *fieldpath.Set, path fieldpath.Path) (*fieldpath.Set, bool) { ok := true for _, pe := range path { diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/remove.go b/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/remove.go index a20fc16f9ba1..a338d761d43f 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/remove.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/remove.go @@ -20,19 +20,26 @@ import ( ) type removingWalker struct { - value value.Value - out interface{} - schema *schema.Schema - toRemove *fieldpath.Set - allocator value.Allocator + value value.Value + out interface{} + schema *schema.Schema + toRemove *fieldpath.Set + allocator value.Allocator + shouldExtract bool } -func removeItemsWithSchema(val value.Value, toRemove *fieldpath.Set, schema *schema.Schema, typeRef schema.TypeRef) value.Value { +// removeItemsWithSchema will walk the given value and look for items from the toRemove set. +// Depending on whether shouldExtract is set true or false, it will return a modified version +// of the input value with either: +// 1. only the items in the toRemove set (when shouldExtract is true) or +// 2. the items from the toRemove set removed from the value (when shouldExtract is false). +func removeItemsWithSchema(val value.Value, toRemove *fieldpath.Set, schema *schema.Schema, typeRef schema.TypeRef, shouldExtract bool) value.Value { w := &removingWalker{ - value: val, - schema: schema, - toRemove: toRemove, - allocator: value.NewFreelistAllocator(), + value: val, + schema: schema, + toRemove: toRemove, + allocator: value.NewFreelistAllocator(), + shouldExtract: shouldExtract, } resolveSchema(schema, typeRef, val, w) return value.NewValueInterface(w.out) @@ -44,10 +51,22 @@ func (w *removingWalker) doScalar(t *schema.Scalar) ValidationErrors { } func (w *removingWalker) doList(t *schema.List) (errs ValidationErrors) { + if !w.value.IsList() { + return nil + } l := w.value.AsListUsing(w.allocator) defer w.allocator.Free(l) - // If list is null, empty, or atomic just return - if l == nil || l.Length() == 0 || t.ElementRelationship == schema.Atomic { + // If list is null or empty just return + if l == nil || l.Length() == 0 { + return nil + } + + // atomic lists should return everything in the case of extract + // and nothing in the case of remove (!w.shouldExtract) + if t.ElementRelationship == schema.Atomic { + if w.shouldExtract { + w.out = w.value.Unstructured() + } return nil } @@ -59,11 +78,22 @@ func (w *removingWalker) doList(t *schema.List) (errs ValidationErrors) { // Ignore error because we have already validated this list pe, _ := listItemToPathElement(w.allocator, w.schema, t, i, item) path, _ := fieldpath.MakePath(pe) + // save items on the path when we shouldExtract + // but ignore them when we are removing (i.e. !w.shouldExtract) if w.toRemove.Has(path) { - continue + if w.shouldExtract { + newItems = append(newItems, removeItemsWithSchema(item, w.toRemove, w.schema, t.ElementType, w.shouldExtract).Unstructured()) + } else { + continue + } } if subset := w.toRemove.WithPrefix(pe); !subset.Empty() { - item = removeItemsWithSchema(item, subset, w.schema, t.ElementType) + item = removeItemsWithSchema(item, subset, w.schema, t.ElementType, w.shouldExtract) + } else { + // don't save items not on the path when we shouldExtract. + if w.shouldExtract { + continue + } } newItems = append(newItems, item.Unstructured()) } @@ -74,12 +104,24 @@ func (w *removingWalker) doList(t *schema.List) (errs ValidationErrors) { } func (w *removingWalker) doMap(t *schema.Map) ValidationErrors { + if !w.value.IsMap() { + return nil + } m := w.value.AsMapUsing(w.allocator) if m != nil { defer w.allocator.Free(m) } - // If map is null, empty, or atomic just return - if m == nil || m.Empty() || t.ElementRelationship == schema.Atomic { + // If map is null or empty just return + if m == nil || m.Empty() { + return nil + } + + // atomic maps should return everything in the case of extract + // and nothing in the case of remove (!w.shouldExtract) + if t.ElementRelationship == schema.Atomic { + if w.shouldExtract { + w.out = w.value.Unstructured() + } return nil } @@ -96,11 +138,22 @@ func (w *removingWalker) doMap(t *schema.Map) ValidationErrors { if ft, ok := fieldTypes[k]; ok { fieldType = ft } + // save values on the path when we shouldExtract + // but ignore them when we are removing (i.e. !w.shouldExtract) if w.toRemove.Has(path) { + if w.shouldExtract { + newMap[k] = removeItemsWithSchema(val, w.toRemove, w.schema, fieldType, w.shouldExtract).Unstructured() + + } return true } if subset := w.toRemove.WithPrefix(pe); !subset.Empty() { - val = removeItemsWithSchema(val, subset, w.schema, fieldType) + val = removeItemsWithSchema(val, subset, w.schema, fieldType, w.shouldExtract) + } else { + // don't save values not on the path when we shouldExtract. + if w.shouldExtract { + return true + } } newMap[k] = val.Unstructured() return true diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/typed.go b/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/typed.go index 54766f6edcb6..e9e6be8befaa 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/typed.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/typed.go @@ -150,7 +150,13 @@ func (tv TypedValue) Compare(rhs *TypedValue) (c *Comparison, err error) { // RemoveItems removes each provided list or map item from the value. func (tv TypedValue) RemoveItems(items *fieldpath.Set) *TypedValue { - tv.value = removeItemsWithSchema(tv.value, items, tv.schema, tv.typeRef) + tv.value = removeItemsWithSchema(tv.value, items, tv.schema, tv.typeRef, false) + return &tv +} + +// ExtractItems returns a value with only the provided list or map items extracted from the value. +func (tv TypedValue) ExtractItems(items *fieldpath.Set) *TypedValue { + tv.value = removeItemsWithSchema(tv.value, items, tv.schema, tv.typeRef, true) return &tv } From f5c2ab73287d6d7226a040416121bbf140eb2bda Mon Sep 17 00:00:00 2001 From: "Amr Hanafi (MAHDI))" Date: Thu, 20 May 2021 16:49:39 -0700 Subject: [PATCH 28/86] Emit the node group metrics behind a flag --- cluster-autoscaler/core/scale_up_test.go | 2 +- cluster-autoscaler/main.go | 4 ++- cluster-autoscaler/metrics/metrics.go | 9 +++-- cluster-autoscaler/metrics/metrics_test.go | 42 ++++++++++++++++++++++ 4 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 cluster-autoscaler/metrics/metrics_test.go diff --git a/cluster-autoscaler/core/scale_up_test.go b/cluster-autoscaler/core/scale_up_test.go index 6ff0902bbe33..6da8cb6d509e 100644 --- a/cluster-autoscaler/core/scale_up_test.go +++ b/cluster-autoscaler/core/scale_up_test.go @@ -978,7 +978,7 @@ func TestCheckScaleUpDeltaWithinLimits(t *testing.T) { } func TestAuthError(t *testing.T) { - metrics.RegisterAll() + metrics.RegisterAll(false) context, err := NewScaleTestAutoscalingContext(config.AutoscalingOptions{}, &fake.Clientset{}, nil, nil, nil) assert.NoError(t, err) diff --git a/cluster-autoscaler/main.go b/cluster-autoscaler/main.go index c7c18d22b12b..7feb0a41ea17 100644 --- a/cluster-autoscaler/main.go +++ b/cluster-autoscaler/main.go @@ -179,6 +179,8 @@ var ( cordonNodeBeforeTerminate = flag.Bool("cordon-node-before-terminating", false, "Should CA cordon nodes before terminating during downscale process") daemonSetEvictionForEmptyNodes = flag.Bool("daemonset-eviction-for-empty-nodes", false, "DaemonSet pods will be gracefully terminated from empty nodes") userAgent = flag.String("user-agent", "cluster-autoscaler", "User agent used for HTTP calls.") + + emitPerNodeGroupMetrics = flag.Bool("emit-per-nodegroup-metrics", false, "If true, emit per node group metrics.") ) func createAutoscalingOptions() config.AutoscalingOptions { @@ -340,7 +342,7 @@ func buildAutoscaler() (core.Autoscaler, error) { } func run(healthCheck *metrics.HealthCheck) { - metrics.RegisterAll() + metrics.RegisterAll(*emitPerNodeGroupMetrics) autoscaler, err := buildAutoscaler() if err != nil { diff --git a/cluster-autoscaler/metrics/metrics.go b/cluster-autoscaler/metrics/metrics.go index 713af534ea79..e0b9e64e9277 100644 --- a/cluster-autoscaler/metrics/metrics.go +++ b/cluster-autoscaler/metrics/metrics.go @@ -330,7 +330,7 @@ var ( ) // RegisterAll registers all metrics. -func RegisterAll() { +func RegisterAll(emitPerNodeGroupMetrics bool) { legacyregistry.MustRegister(clusterSafeToAutoscale) legacyregistry.MustRegister(nodesCount) legacyregistry.MustRegister(nodeGroupsCount) @@ -340,8 +340,6 @@ func RegisterAll() { legacyregistry.MustRegister(cpuLimitsCores) legacyregistry.MustRegister(memoryCurrentBytes) legacyregistry.MustRegister(memoryLimitsBytes) - legacyregistry.MustRegister(nodesGroupMinNodes) - legacyregistry.MustRegister(nodesGroupMaxNodes) legacyregistry.MustRegister(lastActivity) legacyregistry.MustRegister(functionDuration) legacyregistry.MustRegister(functionDurationSummary) @@ -359,6 +357,11 @@ func RegisterAll() { legacyregistry.MustRegister(napEnabled) legacyregistry.MustRegister(nodeGroupCreationCount) legacyregistry.MustRegister(nodeGroupDeletionCount) + + if emitPerNodeGroupMetrics { + legacyregistry.MustRegister(nodesGroupMinNodes) + legacyregistry.MustRegister(nodesGroupMaxNodes) + } } // UpdateDurationFromStart records the duration of the step identified by the diff --git a/cluster-autoscaler/metrics/metrics_test.go b/cluster-autoscaler/metrics/metrics_test.go new file mode 100644 index 000000000000..71789d2c7a48 --- /dev/null +++ b/cluster-autoscaler/metrics/metrics_test.go @@ -0,0 +1,42 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package metrics + +import ( + "testing" + + "github.com/prometheus/client_golang/prometheus/testutil" + "github.com/stretchr/testify/assert" +) + +func TestDisabledPerNodeGroupMetrics(t *testing.T) { + RegisterAll(false) + assert.False(t, nodesGroupMinNodes.IsCreated()) + assert.False(t, nodesGroupMaxNodes.IsCreated()) +} + +func TestEnabledPerNodeGroupMetrics(t *testing.T) { + RegisterAll(true) + assert.True(t, nodesGroupMinNodes.IsCreated()) + assert.True(t, nodesGroupMaxNodes.IsCreated()) + + UpdateNodeGroupMin("foo", 2) + UpdateNodeGroupMax("foo", 100) + + assert.Equal(t, 2, int(testutil.ToFloat64(nodesGroupMinNodes.GaugeVec.WithLabelValues("foo")))) + assert.Equal(t, 100, int(testutil.ToFloat64(nodesGroupMaxNodes.GaugeVec.WithLabelValues("foo")))) +} From 3ac32b817ce8e598f55342b014724badbca3a930 Mon Sep 17 00:00:00 2001 From: "Amr Hanafi (MAHDI))" Date: Thu, 20 May 2021 17:35:08 -0700 Subject: [PATCH 29/86] Update node group min/max on cloud provider refresh --- cluster-autoscaler/core/autoscaler.go | 8 -------- cluster-autoscaler/core/static_autoscaler.go | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cluster-autoscaler/core/autoscaler.go b/cluster-autoscaler/core/autoscaler.go index bf243eaf8cab..3735baaac083 100644 --- a/cluster-autoscaler/core/autoscaler.go +++ b/cluster-autoscaler/core/autoscaler.go @@ -27,7 +27,6 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/estimator" "k8s.io/autoscaler/cluster-autoscaler/expander" "k8s.io/autoscaler/cluster-autoscaler/expander/factory" - "k8s.io/autoscaler/cluster-autoscaler/metrics" ca_processors "k8s.io/autoscaler/cluster-autoscaler/processors" "k8s.io/autoscaler/cluster-autoscaler/simulator" "k8s.io/autoscaler/cluster-autoscaler/utils/backoff" @@ -67,13 +66,6 @@ func NewAutoscaler(opts AutoscalerOptions) (Autoscaler, errors.AutoscalerError) if err != nil { return nil, errors.ToAutoscalerError(errors.InternalError, err) } - - // These metrics should be published only once. - for _, nodeGroup := range opts.CloudProvider.NodeGroups() { - metrics.UpdateNodeGroupMin(nodeGroup.Id(), nodeGroup.MinSize()) - metrics.UpdateNodeGroupMax(nodeGroup.Id(), nodeGroup.MaxSize()) - } - return NewStaticAutoscaler( opts.AutoscalingOptions, opts.PredicateChecker, diff --git a/cluster-autoscaler/core/static_autoscaler.go b/cluster-autoscaler/core/static_autoscaler.go index 83d840265a75..c9cde41645e9 100644 --- a/cluster-autoscaler/core/static_autoscaler.go +++ b/cluster-autoscaler/core/static_autoscaler.go @@ -263,6 +263,12 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) errors.AutoscalerError return errors.ToAutoscalerError(errors.CloudProviderError, err) } + // Update node groups min/max after cloud provider refresh + for _, nodeGroup := range a.AutoscalingContext.CloudProvider.NodeGroups() { + metrics.UpdateNodeGroupMin(nodeGroup.Id(), nodeGroup.MinSize()) + metrics.UpdateNodeGroupMax(nodeGroup.Id(), nodeGroup.MaxSize()) + } + nonExpendableScheduledPods := core_utils.FilterOutExpendablePods(originalScheduledPods, a.ExpendablePodsPriorityCutoff) // Initialize cluster state to ClusterSnapshot if typedErr := a.initializeClusterSnapshot(allNodes, nonExpendableScheduledPods); typedErr != nil { From 8b2aee01e4a1c145064b8084896d4b6b39652b97 Mon Sep 17 00:00:00 2001 From: "Amr Hanafi (MAHDI))" Date: Fri, 21 May 2021 08:25:16 -0700 Subject: [PATCH 30/86] Update FAQ to mention the new flag --- cluster-autoscaler/FAQ.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cluster-autoscaler/FAQ.md b/cluster-autoscaler/FAQ.md index 1125b54ec141..cb6e02f19c1e 100644 --- a/cluster-autoscaler/FAQ.md +++ b/cluster-autoscaler/FAQ.md @@ -662,6 +662,7 @@ The following startup parameters are supported for cluster autoscaler: | `max-node-provision-time` | Maximum time CA waits for node to be provisioned | 15 minutes | `nodes` | sets min,max size and other configuration data for a node group in a format accepted by cloud provider. Can be used multiple times. Format: :: | "" | `node-group-auto-discovery` | One or more definition(s) of node group auto-discovery.
A definition is expressed `:[[=]]`
The `aws`, `gce`, and `azure` cloud providers are currently supported. AWS matches by ASG tags, e.g. `asg:tag=tagKey,anotherTagKey`
GCE matches by IG name prefix, and requires you to specify min and max nodes per IG, e.g. `mig:namePrefix=pfx,min=0,max=10`
Azure matches by tags on VMSS, e.g. `label:foo=bar`, and will auto-detect `min` and `max` tags on the VMSS to set scaling limits.
Can be used multiple times | "" +| `emit-per-nodegroup-metrics` | If true, emit per node group metrics. | false | `estimator` | Type of resource estimator to be used in scale up | binpacking | `expander` | Type of node group expander to be used in scale up. | random | `write-status-configmap` | Should CA write status information to a configmap | true From e1b7f629ef51f3992dd6c35c06ebf741e14afadf Mon Sep 17 00:00:00 2001 From: Brett Elliott Date: Mon, 17 May 2021 18:03:21 +0200 Subject: [PATCH 31/86] Print out error when unable to download module Use shell syntax instead of pipe so error messages are printed out. Before this change, if it could not download a module, it would just exit without printing an error message due to the pipe. With this change it now prints out the error message(unable to download) from the underlying process. --- cluster-autoscaler/hack/update-vendor.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cluster-autoscaler/hack/update-vendor.sh b/cluster-autoscaler/hack/update-vendor.sh index 7c6608cc3a01..42d0b9405bc8 100755 --- a/cluster-autoscaler/hack/update-vendor.sh +++ b/cluster-autoscaler/hack/update-vendor.sh @@ -50,8 +50,14 @@ rm -rf ${WORKDIR} for MOD in "${MODS[@]}"; do V=$( - go mod download -json "${MOD}@kubernetes-${VERSION}" | - sed -n 's|.*"Version": "\(.*\)".*|\1|p' + GOMOD="${MOD}@kubernetes-${VERSION}" + JSON=$(go mod download -json "${GOMOD}") + retval=$? + if [ $retval -ne 0 ]; then + echo "Error downloading module ${GOMOD}." + exit 1 + fi + echo "${JSON}" | sed -n 's|.*"Version": "\(.*\)".*|\1|p' ) go mod edit "-replace=${MOD}=${MOD}@${V}" done From 3169a1cd9b43513de4438931d29b19e6a5188c67 Mon Sep 17 00:00:00 2001 From: Michael McCune Date: Tue, 25 May 2021 12:50:50 -0400 Subject: [PATCH 32/86] add field keys to cluster autoscaler unit test structs A few of the unit test structures did not have field name keys when using literal structs. This change adds the fields to make this code a little more future-proof. --- .../core/static_autoscaler_test.go | 52 +++++++++---------- cluster-autoscaler/simulator/cluster_test.go | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/cluster-autoscaler/core/static_autoscaler_test.go b/cluster-autoscaler/core/static_autoscaler_test.go index d7b08bfbf848..8809fed019d1 100644 --- a/cluster-autoscaler/core/static_autoscaler_test.go +++ b/cluster-autoscaler/core/static_autoscaler_test.go @@ -972,20 +972,20 @@ func TestStaticAutoscalerInstaceCreationErrors(t *testing.T) { nodeGroupA.On("DeleteNodes", mock.Anything).Return(nil) nodeGroupA.On("Nodes").Return([]cloudprovider.Instance{ { - "A1", - &cloudprovider.InstanceStatus{ + Id: "A1", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceRunning, }, }, { - "A2", - &cloudprovider.InstanceStatus{ + Id: "A2", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceCreating, }, }, { - "A3", - &cloudprovider.InstanceStatus{ + Id: "A3", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceCreating, ErrorInfo: &cloudprovider.InstanceErrorInfo{ ErrorClass: cloudprovider.OutOfResourcesErrorClass, @@ -994,8 +994,8 @@ func TestStaticAutoscalerInstaceCreationErrors(t *testing.T) { }, }, { - "A4", - &cloudprovider.InstanceStatus{ + Id: "A4", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceCreating, ErrorInfo: &cloudprovider.InstanceErrorInfo{ ErrorClass: cloudprovider.OutOfResourcesErrorClass, @@ -1004,8 +1004,8 @@ func TestStaticAutoscalerInstaceCreationErrors(t *testing.T) { }, }, { - "A5", - &cloudprovider.InstanceStatus{ + Id: "A5", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceCreating, ErrorInfo: &cloudprovider.InstanceErrorInfo{ ErrorClass: cloudprovider.OutOfResourcesErrorClass, @@ -1014,8 +1014,8 @@ func TestStaticAutoscalerInstaceCreationErrors(t *testing.T) { }, }, { - "A6", - &cloudprovider.InstanceStatus{ + Id: "A6", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceCreating, ErrorInfo: &cloudprovider.InstanceErrorInfo{ ErrorClass: cloudprovider.OtherErrorClass, @@ -1032,8 +1032,8 @@ func TestStaticAutoscalerInstaceCreationErrors(t *testing.T) { nodeGroupB.On("DeleteNodes", mock.Anything).Return(nil) nodeGroupB.On("Nodes").Return([]cloudprovider.Instance{ { - "B1", - &cloudprovider.InstanceStatus{ + Id: "B1", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceRunning, }, }, @@ -1102,38 +1102,38 @@ func TestStaticAutoscalerInstaceCreationErrors(t *testing.T) { // restub node group A so nodes are no longer reporting errors nodeGroupA.On("Nodes").Return([]cloudprovider.Instance{ { - "A1", - &cloudprovider.InstanceStatus{ + Id: "A1", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceRunning, }, }, { - "A2", - &cloudprovider.InstanceStatus{ + Id: "A2", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceCreating, }, }, { - "A3", - &cloudprovider.InstanceStatus{ + Id: "A3", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceDeleting, }, }, { - "A4", - &cloudprovider.InstanceStatus{ + Id: "A4", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceDeleting, }, }, { - "A5", - &cloudprovider.InstanceStatus{ + Id: "A5", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceDeleting, }, }, { - "A6", - &cloudprovider.InstanceStatus{ + Id: "A6", + Status: &cloudprovider.InstanceStatus{ State: cloudprovider.InstanceDeleting, }, }, diff --git a/cluster-autoscaler/simulator/cluster_test.go b/cluster-autoscaler/simulator/cluster_test.go index 7ee894f1475a..a1772790932e 100644 --- a/cluster-autoscaler/simulator/cluster_test.go +++ b/cluster-autoscaler/simulator/cluster_test.go @@ -69,7 +69,7 @@ func TestUtilization(t *testing.T) { assert.InEpsilon(t, 2.0/10, utilInfo.Utilization, 0.01) terminatedPod := BuildTestPod("podTerminated", 100, 200000) - terminatedPod.DeletionTimestamp = &metav1.Time{testTime.Add(-10 * time.Minute)} + terminatedPod.DeletionTimestamp = &metav1.Time{Time: testTime.Add(-10 * time.Minute)} nodeInfo = schedulerframework.NewNodeInfo(pod, pod, pod2, terminatedPod) utilInfo, err = CalculateUtilization(node, nodeInfo, false, false, gpuLabel, testTime) assert.NoError(t, err) From 1880fe6937b218cb14d7903d7efd0cfec6475909 Mon Sep 17 00:00:00 2001 From: Brett Elliott Date: Thu, 27 May 2021 17:53:52 +0200 Subject: [PATCH 33/86] Don't start CA in cooldown mode. --- cluster-autoscaler/core/static_autoscaler.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cluster-autoscaler/core/static_autoscaler.go b/cluster-autoscaler/core/static_autoscaler.go index 3dfced108c82..11c3b42c3840 100644 --- a/cluster-autoscaler/core/static_autoscaler.go +++ b/cluster-autoscaler/core/static_autoscaler.go @@ -149,12 +149,15 @@ func NewStaticAutoscaler( scaleDown := NewScaleDown(autoscalingContext, processors, clusterStateRegistry) + // Set the initial scale times to be less than the start time so as to + // not start in cooldown mode. + initialScaleTime := time.Now().Add(-time.Hour) return &StaticAutoscaler{ AutoscalingContext: autoscalingContext, startTime: time.Now(), - lastScaleUpTime: time.Now(), - lastScaleDownDeleteTime: time.Now(), - lastScaleDownFailTime: time.Now(), + lastScaleUpTime: initialScaleTime, + lastScaleDownDeleteTime: initialScaleTime, + lastScaleDownFailTime: initialScaleTime, scaleDown: scaleDown, processors: processors, processorCallbacks: processorCallbacks, From 69743f14c168d99b66a1d5c79a36a6542e1601d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Sobieszcza=C5=84ski?= Date: Fri, 28 May 2021 14:47:07 +0200 Subject: [PATCH 34/86] docs: Install parameters Mandatory awsRegion and optional awsAccessKeyID and awsSecretAccessKey --- charts/cluster-autoscaler/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 7a6582622819..7f94f5a9d754 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -81,10 +81,16 @@ Auto-discovery finds ASGs tags as below and automatically manages them based on - Verify the [IAM Permissions](#aws---iam) - Set `autoDiscovery.clusterName=` - Set `awsRegion=` -- Set `awsAccessKeyID=` and `awsSecretAccessKey=` if you want to [use AWS credentials directly instead of an instance role](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#using-aws-credentials) +- Set (option) `awsAccessKeyID=` and `awsSecretAccessKey=` if you want to [use AWS credentials directly instead of an instance role](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#using-aws-credentials) ```console -$ helm install my-release autoscaler/cluster-autoscaler --set autoDiscovery.clusterName= +$ helm install my-release autoscaler/cluster-autoscaler --set autoDiscovery.clusterName= --set awsRegion= +``` + +Alternatively with your own AWS credencials + +```console +$ helm install my-release autoscaler/cluster-autoscaler --set autoDiscovery.clusterName= --set awsRegion= --set awsAccessKeyID= --set awsSecretAccessKey= ``` #### Specifying groups manually From 986fe3ae205383d646200a0bebd52a72a9f88890 Mon Sep 17 00:00:00 2001 From: Benjamin Pineau Date: Mon, 31 May 2021 15:55:28 +0200 Subject: [PATCH 35/86] Metric for CloudProvider.Refresh() duration This function can take an variable amount of time due to various conditions (ie. many nodegroups changes causing forced refreshes, caches time to live expiries, ...). Monitoring that duration is useful to diagnose those variations, and to uncover external issues (ie. throttling from cloud provider) affecting cluster-autoscaler. --- cluster-autoscaler/core/static_autoscaler.go | 2 ++ cluster-autoscaler/metrics/metrics.go | 1 + 2 files changed, 3 insertions(+) diff --git a/cluster-autoscaler/core/static_autoscaler.go b/cluster-autoscaler/core/static_autoscaler.go index 0e3dd869fce1..cfbf2c249f54 100644 --- a/cluster-autoscaler/core/static_autoscaler.go +++ b/cluster-autoscaler/core/static_autoscaler.go @@ -260,7 +260,9 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) errors.AutoscalerError } // Call CloudProvider.Refresh before any other calls to cloud provider. + refreshStart := time.Now() err = a.AutoscalingContext.CloudProvider.Refresh() + metrics.UpdateDurationFromStart(metrics.CloudProviderRefresh, refreshStart) if err != nil { klog.Errorf("Failed to refresh cloud provider config: %v", err) return errors.ToAutoscalerError(errors.CloudProviderError, err) diff --git a/cluster-autoscaler/metrics/metrics.go b/cluster-autoscaler/metrics/metrics.go index 9580ee3344c0..41b7fb7a9d97 100644 --- a/cluster-autoscaler/metrics/metrics.go +++ b/cluster-autoscaler/metrics/metrics.go @@ -90,6 +90,7 @@ const ( FindUnneeded FunctionLabel = "findUnneeded" UpdateState FunctionLabel = "updateClusterState" FilterOutSchedulable FunctionLabel = "filterOutSchedulable" + CloudProviderRefresh FunctionLabel = "cloudProviderRefresh" Main FunctionLabel = "main" Poll FunctionLabel = "poll" Reconfigure FunctionLabel = "reconfigure" From d9e883bfdec253cb96e698ed1efdeb0f9f7d7c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Sobieszcza=C5=84ski?= Date: Tue, 1 Jun 2021 13:25:51 +0200 Subject: [PATCH 36/86] Update charts/cluster-autoscaler/README.md Co-authored-by: Benjamin Pineau --- charts/cluster-autoscaler/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 7f94f5a9d754..bc6c9cd346df 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -87,7 +87,7 @@ Auto-discovery finds ASGs tags as below and automatically manages them based on $ helm install my-release autoscaler/cluster-autoscaler --set autoDiscovery.clusterName= --set awsRegion= ``` -Alternatively with your own AWS credencials +Alternatively with your own AWS credentials ```console $ helm install my-release autoscaler/cluster-autoscaler --set autoDiscovery.clusterName= --set awsRegion= --set awsAccessKeyID= --set awsSecretAccessKey= From 36460df246cffb4cb3da099d03a04e29f25cf17c Mon Sep 17 00:00:00 2001 From: Marwan Ahmed Date: Sun, 6 Jun 2021 13:16:14 -0700 Subject: [PATCH 37/86] annotate fakeNodes so that cloudprovider implementations can identify them if needed --- cluster-autoscaler/clusterstate/clusterstate.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/cluster-autoscaler/clusterstate/clusterstate.go b/cluster-autoscaler/clusterstate/clusterstate.go index e66d49636808..6bc9703f650b 100644 --- a/cluster-autoscaler/clusterstate/clusterstate.go +++ b/cluster-autoscaler/clusterstate/clusterstate.go @@ -51,6 +51,14 @@ const ( // NodeGroupBackoffResetTimeout is the time after last failed scale-up when the backoff duration is reset. NodeGroupBackoffResetTimeout = 3 * time.Hour + + // FakeNodeReasonAnnotation is an annotation added to the fake placeholder nodes CA has created + // Note that this don't map to real nodes in k8s and are merely used for error handling + FakeNodeReasonAnnotation = "k8s.io/cluster-autoscaler/fake-node-reason" + // FakeNodeUnregistered represents a node that is identified by CA as unregistered + FakeNodeUnregistered = "unregistered" + // FakeNodeCreateError represents a node that is identified by CA as a created node with errors + FakeNodeCreateError = "create-error" ) // ScaleUpRequest contains information about the requested node group scale up. @@ -949,7 +957,7 @@ func getNotRegisteredNodes(allNodes []*apiv1.Node, cloudProviderNodeInstances ma for _, instance := range instances { if !registered.Has(instance.Id) { notRegistered = append(notRegistered, UnregisteredNode{ - Node: fakeNode(instance), + Node: fakeNode(instance, FakeNodeUnregistered), UnregisteredSince: time, }) } @@ -1096,7 +1104,7 @@ func (csr *ClusterStateRegistry) GetCreatedNodesWithErrors() []*apiv1.Node { _, _, instancesByErrorCode := csr.buildInstanceToErrorCodeMappings(nodeGroupInstances) for _, instances := range instancesByErrorCode { for _, instance := range instances { - nodesWithCreateErrors = append(nodesWithCreateErrors, fakeNode(instance)) + nodesWithCreateErrors = append(nodesWithCreateErrors, fakeNode(instance, FakeNodeCreateError)) } } } @@ -1113,10 +1121,13 @@ func (csr *ClusterStateRegistry) InvalidateNodeInstancesCacheEntry(nodeGroup clo csr.cloudProviderNodeInstancesCache.InvalidateCacheEntry(nodeGroup) } -func fakeNode(instance cloudprovider.Instance) *apiv1.Node { +func fakeNode(instance cloudprovider.Instance, reason string) *apiv1.Node { return &apiv1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: instance.Id, + Annotations: map[string]string{ + FakeNodeReasonAnnotation: reason, + }, }, Spec: apiv1.NodeSpec{ ProviderID: instance.Id, From 21299c73e32d8e2a89010599e1aa65fae00266f3 Mon Sep 17 00:00:00 2001 From: Pierrick Gicquelais Date: Tue, 1 Jun 2021 18:59:19 +0200 Subject: [PATCH 38/86] feat(ovh): enable OVHcloud provider for US side feat(ovh): fix omitempty field feat(ovh): fix issue on empty autoscaling opts --- .../cloudprovider/ovhcloud/ovh_cloud_manager.go | 4 ++-- .../cloudprovider/ovhcloud/ovh_cloud_node_group.go | 5 +++++ .../cloudprovider/ovhcloud/sdk/nodepool.go | 6 +++--- .../cloudprovider/ovhcloud/sdk/openstack.go | 2 ++ cluster-autoscaler/cloudprovider/ovhcloud/sdk/ovh.go | 12 ++++++++++-- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_manager.go b/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_manager.go index 1b2e9e3e2574..a316d0f74490 100644 --- a/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_manager.go +++ b/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_manager.go @@ -120,7 +120,7 @@ func NewManager(configFile io.Reader) (*OvhCloudManager, error) { return nil, fmt.Errorf("failed to create OpenStack provider: %w", err) } - client, err = sdk.NewDefaultClientWithToken(openStackProvider.Token) + client, err = sdk.NewDefaultClientWithToken(openStackProvider.AuthUrl, openStackProvider.Token) case ApplicationConsumerAuthenticationType: client, err = sdk.NewClient(cfg.ApplicationEndpoint, cfg.ApplicationKey, cfg.ApplicationSecret, cfg.ApplicationConsumerKey) default: @@ -151,7 +151,7 @@ func (m *OvhCloudManager) ReAuthenticate() error { return fmt.Errorf("failed to re-authenticate OpenStack token: %w", err) } - client, err := sdk.NewDefaultClientWithToken(m.OpenStackProvider.Token) + client, err := sdk.NewDefaultClientWithToken(m.OpenStackProvider.AuthUrl, m.OpenStackProvider.Token) if err != nil { return fmt.Errorf("failed to re-create client: %w", err) } diff --git a/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group.go b/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group.go index 189f36f93d78..b8b68da84b78 100644 --- a/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group.go +++ b/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group.go @@ -314,6 +314,11 @@ func (ng *NodeGroup) Autoprovisioned() bool { // GetOptions returns NodeGroupAutoscalingOptions that should be used for this particular // NodeGroup. Returning a nil will result in using default options. func (ng *NodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) { + // If node group autoscaling options nil, return defaults + if ng.Autoscaling == nil { + return nil, nil + } + // Forge autoscaling configuration from node pool cfg := &config.NodeGroupAutoscalingOptions{ ScaleDownUnneededTime: time.Duration(ng.Autoscaling.ScaleDownUnneededTimeSeconds) * time.Second, diff --git a/cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go b/cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go index 7f1e19ff2a04..c559a5cc9ab2 100644 --- a/cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go +++ b/cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go @@ -43,7 +43,7 @@ type NodePool struct { AvailableNodes uint32 `json:"availableNodes"` UpToDateNodes uint32 `json:"upToDateNodes"` - Autoscaling struct { + Autoscaling *struct { CpuMin float32 `json:"cpuMin"` CpuMax float32 `json:"cpuMax"` @@ -54,7 +54,7 @@ type NodePool struct { ScaleDownUnneededTimeSeconds int32 `json:"scaleDownUnneededTimeSeconds"` ScaleDownUnreadyTimeSeconds int32 `json:"scaleDownUnreadyTimeSeconds"` - } `json:"autoscaling"` + } `json:"autoscaling,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` @@ -140,7 +140,7 @@ type UpdateNodePoolOpts struct { MinNodes *uint32 `json:"minNodes,omitempty"` MaxNodes *uint32 `json:"maxNodes,omitempty"` - Autoscale *bool `json:"autoscale"` + Autoscale *bool `json:"autoscale,omitempty"` NodesToRemove []string `json:"nodesToRemove,omitempty"` } diff --git a/cluster-autoscaler/cloudprovider/ovhcloud/sdk/openstack.go b/cluster-autoscaler/cloudprovider/ovhcloud/sdk/openstack.go index 415885287c7e..816c5ac2a7c0 100644 --- a/cluster-autoscaler/cloudprovider/ovhcloud/sdk/openstack.go +++ b/cluster-autoscaler/cloudprovider/ovhcloud/sdk/openstack.go @@ -31,6 +31,7 @@ const DefaultExpirationTime = 23 * time.Hour type OpenStackProvider struct { provider *gophercloud.ProviderClient + AuthUrl string Token string tokenExpirationTime time.Time } @@ -51,6 +52,7 @@ func NewOpenStackProvider(authUrl string, username string, password string, doma return &OpenStackProvider{ provider: provider, + AuthUrl: authUrl, Token: provider.Token(), tokenExpirationTime: time.Now().Add(DefaultExpirationTime), }, nil diff --git a/cluster-autoscaler/cloudprovider/ovhcloud/sdk/ovh.go b/cluster-autoscaler/cloudprovider/ovhcloud/sdk/ovh.go index 4e465d225d11..cccc8d2a2384 100644 --- a/cluster-autoscaler/cloudprovider/ovhcloud/sdk/ovh.go +++ b/cluster-autoscaler/cloudprovider/ovhcloud/sdk/ovh.go @@ -26,6 +26,7 @@ import ( "io/ioutil" "net/http" "strconv" + "strings" "sync" "time" ) @@ -130,8 +131,15 @@ func NewDefaultClient() (*Client, error) { // NewDefaultClientWithToken will load all it's parameter from environment // or configuration files using an OpenStack keystone token -func NewDefaultClientWithToken(token string) (*Client, error) { - client, err := NewClient(OvhEU, "none", "none", "none") +func NewDefaultClientWithToken(authUrl, token string) (*Client, error) { + // Find endpoint given the keystone auth url + endpoint := OvhEU + if strings.Contains(authUrl, "ovh.us") { + endpoint = OvhUS + } + + // Create OVH api client + client, err := NewClient(endpoint, "none", "none", "none") if err != nil { return nil, err } From 32573725724269f0ec09db14a6df8dde3d8d2126 Mon Sep 17 00:00:00 2001 From: Pierrick Gicquelais Date: Tue, 8 Jun 2021 10:30:46 +0200 Subject: [PATCH 39/86] feat(ovh): fix unit tests --- .../ovhcloud/ovh_cloud_node_group_test.go | 9 ++++--- .../cloudprovider/ovhcloud/sdk/nodepool.go | 25 +++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group_test.go b/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group_test.go index 713593e94a69..56defe35509b 100644 --- a/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group_test.go +++ b/cluster-autoscaler/cloudprovider/ovhcloud/ovh_cloud_node_group_test.go @@ -116,15 +116,16 @@ func newTestNodeGroup(t *testing.T, isGpu bool) cloudprovider.NodeGroup { DesiredNodes: 3, MinNodes: 1, MaxNodes: 5, + Autoscaling: &sdk.NodePoolAutoscaling{ + ScaleDownUtilizationThreshold: 3.2, + ScaleDownUnneededTimeSeconds: 10, + ScaleDownUnreadyTimeSeconds: 20, + }, }, CurrentSize: 3, } - ng.NodePool.Autoscaling.ScaleDownUtilizationThreshold = 3.2 - ng.NodePool.Autoscaling.ScaleDownUnneededTimeSeconds = 10 - ng.NodePool.Autoscaling.ScaleDownUnreadyTimeSeconds = 20 - return ng } diff --git a/cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go b/cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go index c559a5cc9ab2..02e0b440c0fe 100644 --- a/cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go +++ b/cluster-autoscaler/cloudprovider/ovhcloud/sdk/nodepool.go @@ -43,21 +43,24 @@ type NodePool struct { AvailableNodes uint32 `json:"availableNodes"` UpToDateNodes uint32 `json:"upToDateNodes"` - Autoscaling *struct { - CpuMin float32 `json:"cpuMin"` - CpuMax float32 `json:"cpuMax"` + Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"` - MemoryMin float32 `json:"memoryMin"` - MemoryMax float32 `json:"memoryMax"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` +} - ScaleDownUtilizationThreshold float32 `json:"scaleDownUtilizationThreshold"` +// NodePoolAutoscaling defines the node group autoscaling options from OVHcloud API +type NodePoolAutoscaling struct { + CpuMin float32 `json:"cpuMin"` + CpuMax float32 `json:"cpuMax"` - ScaleDownUnneededTimeSeconds int32 `json:"scaleDownUnneededTimeSeconds"` - ScaleDownUnreadyTimeSeconds int32 `json:"scaleDownUnreadyTimeSeconds"` - } `json:"autoscaling,omitempty"` + MemoryMin float32 `json:"memoryMin"` + MemoryMax float32 `json:"memoryMax"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` + ScaleDownUtilizationThreshold float32 `json:"scaleDownUtilizationThreshold"` + + ScaleDownUnneededTimeSeconds int32 `json:"scaleDownUnneededTimeSeconds"` + ScaleDownUnreadyTimeSeconds int32 `json:"scaleDownUnreadyTimeSeconds"` } // ListNodePools allows to list all node pools available in a cluster From c0a9c6d04cffc166f48efaaf20be38c8d674661b Mon Sep 17 00:00:00 2001 From: Krzysztof Siedlecki Date: Tue, 8 Jun 2021 15:32:07 +0200 Subject: [PATCH 40/86] Changing injection test webhook API from V1Beta1 to V1 --- vertical-pod-autoscaler/e2e/utils/webhook.go | 42 ++++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/vertical-pod-autoscaler/e2e/utils/webhook.go b/vertical-pod-autoscaler/e2e/utils/webhook.go index 760cf1632bb9..2a69593425ed 100644 --- a/vertical-pod-autoscaler/e2e/utils/webhook.go +++ b/vertical-pod-autoscaler/e2e/utils/webhook.go @@ -25,7 +25,7 @@ import ( "time" "github.com/onsi/ginkgo" - admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" @@ -86,25 +86,25 @@ func RegisterMutatingWebhookForPod(f *framework.Framework, configName string, ce ginkgo.By("Registering the mutating pod webhook via the AdmissionRegistration API") namespace := f.Namespace.Name - sideEffectsNone := admissionregistrationv1beta1.SideEffectClassNone + sideEffectsNone := admissionregistrationv1.SideEffectClassNone - _, err := createMutatingWebhookConfiguration(f, &admissionregistrationv1beta1.MutatingWebhookConfiguration{ + _, err := createMutatingWebhookConfiguration(f, &admissionregistrationv1.MutatingWebhookConfiguration{ ObjectMeta: metav1.ObjectMeta{ Name: configName, }, - Webhooks: []admissionregistrationv1beta1.MutatingWebhook{ + Webhooks: []admissionregistrationv1.MutatingWebhook{ { Name: "adding-init-container.k8s.io", - Rules: []admissionregistrationv1beta1.RuleWithOperations{{ - Operations: []admissionregistrationv1beta1.OperationType{admissionregistrationv1beta1.Create}, - Rule: admissionregistrationv1beta1.Rule{ + Rules: []admissionregistrationv1.RuleWithOperations{{ + Operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, + Rule: admissionregistrationv1.Rule{ APIGroups: []string{""}, APIVersions: []string{"v1"}, Resources: []string{"pods"}, }, }}, - ClientConfig: admissionregistrationv1beta1.WebhookClientConfig{ - Service: &admissionregistrationv1beta1.ServiceReference{ + ClientConfig: admissionregistrationv1.WebhookClientConfig{ + Service: &admissionregistrationv1.ServiceReference{ Namespace: namespace, Name: WebhookServiceName, Path: strPtr("/mutating-pods-sidecar"), @@ -129,13 +129,13 @@ func RegisterMutatingWebhookForPod(f *framework.Framework, configName string, ce framework.ExpectNoError(err, "waiting for webhook configuration to be ready") return func() { - client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) + client.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), configName, metav1.DeleteOptions{}) } } // createMutatingWebhookConfiguration ensures the webhook config scopes object or namespace selection // to avoid interfering with other tests, then creates the config. -func createMutatingWebhookConfiguration(f *framework.Framework, config *admissionregistrationv1beta1.MutatingWebhookConfiguration) (*admissionregistrationv1beta1.MutatingWebhookConfiguration, error) { +func createMutatingWebhookConfiguration(f *framework.Framework, config *admissionregistrationv1.MutatingWebhookConfiguration) (*admissionregistrationv1.MutatingWebhookConfiguration, error) { for _, webhook := range config.Webhooks { if webhook.NamespaceSelector != nil && webhook.NamespaceSelector.MatchLabels[f.UniqueName] == "true" { continue @@ -145,26 +145,26 @@ func createMutatingWebhookConfiguration(f *framework.Framework, config *admissio } framework.Failf(`webhook %s in config %s has no namespace or object selector with %s="true", and can interfere with other tests`, webhook.Name, config.Name, f.UniqueName) } - return f.ClientSet.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Create(context.TODO(), config, metav1.CreateOptions{}) + return f.ClientSet.AdmissionregistrationV1().MutatingWebhookConfigurations().Create(context.TODO(), config, metav1.CreateOptions{}) } // newMutatingIsReadyWebhookFixture creates a mutating webhook that can be added to a webhook configuration and then probed // with "marker" requests via waitWebhookConfigurationReady to wait for a webhook configuration to be ready. -func newMutatingIsReadyWebhookFixture(f *framework.Framework, certContext *certContext, servicePort int32) admissionregistrationv1beta1.MutatingWebhook { - sideEffectsNone := admissionregistrationv1beta1.SideEffectClassNone - failOpen := admissionregistrationv1beta1.Ignore - return admissionregistrationv1beta1.MutatingWebhook{ +func newMutatingIsReadyWebhookFixture(f *framework.Framework, certContext *certContext, servicePort int32) admissionregistrationv1.MutatingWebhook { + sideEffectsNone := admissionregistrationv1.SideEffectClassNone + failOpen := admissionregistrationv1.Ignore + return admissionregistrationv1.MutatingWebhook{ Name: "mutating-is-webhook-configuration-ready.k8s.io", - Rules: []admissionregistrationv1beta1.RuleWithOperations{{ - Operations: []admissionregistrationv1beta1.OperationType{admissionregistrationv1beta1.Create}, - Rule: admissionregistrationv1beta1.Rule{ + Rules: []admissionregistrationv1.RuleWithOperations{{ + Operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, + Rule: admissionregistrationv1.Rule{ APIGroups: []string{""}, APIVersions: []string{"v1"}, Resources: []string{"configmaps"}, }, }}, - ClientConfig: admissionregistrationv1beta1.WebhookClientConfig{ - Service: &admissionregistrationv1beta1.ServiceReference{ + ClientConfig: admissionregistrationv1.WebhookClientConfig{ + Service: &admissionregistrationv1.ServiceReference{ Namespace: f.Namespace.Name, Name: WebhookServiceName, Path: strPtr("/always-deny"), From 8039af647e2f46328c81f11b1d2413172500188c Mon Sep 17 00:00:00 2001 From: Marwan Ahmed Date: Tue, 8 Jun 2021 10:56:35 -0700 Subject: [PATCH 41/86] move annotations to cloudprovider package --- cluster-autoscaler/cloudprovider/cloud_provider.go | 10 ++++++++++ cluster-autoscaler/clusterstate/clusterstate.go | 14 +++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/cloud_provider.go b/cluster-autoscaler/cloudprovider/cloud_provider.go index c53937da2e78..41ec7e914903 100644 --- a/cluster-autoscaler/cloudprovider/cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/cloud_provider.go @@ -256,6 +256,16 @@ func (c InstanceErrorClass) String() string { } } +const ( + // FakeNodeReasonAnnotation is an annotation added to the fake placeholder nodes CA has created + // Note that this don't map to real nodes in k8s and are merely used for error handling + FakeNodeReasonAnnotation = "k8s.io/cluster-autoscaler/fake-node-reason" + // FakeNodeUnregistered represents a node that is identified by CA as unregistered + FakeNodeUnregistered = "unregistered" + // FakeNodeCreateError represents a node that is identified by CA as a created node with errors + FakeNodeCreateError = "create-error" +) + // PricingModel contains information about the node price and how it changes in time. type PricingModel interface { // NodePrice returns a price of running the given node for a given period of time. diff --git a/cluster-autoscaler/clusterstate/clusterstate.go b/cluster-autoscaler/clusterstate/clusterstate.go index 6bc9703f650b..7eaa2ce330a4 100644 --- a/cluster-autoscaler/clusterstate/clusterstate.go +++ b/cluster-autoscaler/clusterstate/clusterstate.go @@ -51,14 +51,6 @@ const ( // NodeGroupBackoffResetTimeout is the time after last failed scale-up when the backoff duration is reset. NodeGroupBackoffResetTimeout = 3 * time.Hour - - // FakeNodeReasonAnnotation is an annotation added to the fake placeholder nodes CA has created - // Note that this don't map to real nodes in k8s and are merely used for error handling - FakeNodeReasonAnnotation = "k8s.io/cluster-autoscaler/fake-node-reason" - // FakeNodeUnregistered represents a node that is identified by CA as unregistered - FakeNodeUnregistered = "unregistered" - // FakeNodeCreateError represents a node that is identified by CA as a created node with errors - FakeNodeCreateError = "create-error" ) // ScaleUpRequest contains information about the requested node group scale up. @@ -957,7 +949,7 @@ func getNotRegisteredNodes(allNodes []*apiv1.Node, cloudProviderNodeInstances ma for _, instance := range instances { if !registered.Has(instance.Id) { notRegistered = append(notRegistered, UnregisteredNode{ - Node: fakeNode(instance, FakeNodeUnregistered), + Node: fakeNode(instance, cloudprovider.FakeNodeUnregistered), UnregisteredSince: time, }) } @@ -1104,7 +1096,7 @@ func (csr *ClusterStateRegistry) GetCreatedNodesWithErrors() []*apiv1.Node { _, _, instancesByErrorCode := csr.buildInstanceToErrorCodeMappings(nodeGroupInstances) for _, instances := range instancesByErrorCode { for _, instance := range instances { - nodesWithCreateErrors = append(nodesWithCreateErrors, fakeNode(instance, FakeNodeCreateError)) + nodesWithCreateErrors = append(nodesWithCreateErrors, fakeNode(instance, cloudprovider.FakeNodeCreateError)) } } } @@ -1126,7 +1118,7 @@ func fakeNode(instance cloudprovider.Instance, reason string) *apiv1.Node { ObjectMeta: metav1.ObjectMeta{ Name: instance.Id, Annotations: map[string]string{ - FakeNodeReasonAnnotation: reason, + cloudprovider.FakeNodeReasonAnnotation: reason, }, }, Spec: apiv1.NodeSpec{ From 0f5fde6b288054062c4e1b9ed4213da2453abd4f Mon Sep 17 00:00:00 2001 From: darkpssngr Date: Wed, 9 Jun 2021 11:23:44 +0530 Subject: [PATCH 42/86] use aws sdk to find region --- .../cloudprovider/aws/aws_util.go | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/aws/aws_util.go b/cluster-autoscaler/cloudprovider/aws/aws_util.go index 223eb547035b..5f1aa6c84681 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_util.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_util.go @@ -20,7 +20,10 @@ import ( "encoding/json" "errors" "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/endpoints" + "github.com/aws/aws-sdk-go/aws/session" "io/ioutil" klog "k8s.io/klog/v2" "net/http" @@ -31,7 +34,7 @@ import ( ) var ( - ec2MetaDataServiceUrl = "http://169.254.169.254/latest/dynamic/instance-identity/document" + ec2MetaDataServiceUrl = "http://169.254.169.254" ec2PricingServiceUrlTemplate = "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/%s/index.json" ec2PricingServiceUrlTemplateCN = "https://pricing.cn-north-1.amazonaws.com.cn/offers/v1.0/cn/AmazonEC2/current/%s/index.json" staticListLastUpdateTime = "2020-12-07" @@ -169,26 +172,13 @@ func GetCurrentAwsRegion() (string, error) { region, present := os.LookupEnv("AWS_REGION") if !present { - klog.V(1).Infof("fetching %s\n", ec2MetaDataServiceUrl) - res, err := http.Get(ec2MetaDataServiceUrl) + c := aws.NewConfig(). + WithEndpoint(ec2MetaDataServiceUrl) + sess, err := session.NewSession() if err != nil { - return "", fmt.Errorf("Error fetching %s", ec2MetaDataServiceUrl) + return "", fmt.Errorf("failed to create session") } - - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - return "", fmt.Errorf("Error parsing %s", ec2MetaDataServiceUrl) - } - - var unmarshalled = map[string]string{} - err = json.Unmarshal(body, &unmarshalled) - if err != nil { - klog.Warningf("Error unmarshalling %s, skip...\n", ec2MetaDataServiceUrl) - } - - region = unmarshalled["region"] + return ec2metadata.New(sess, c).Region() } return region, nil From b73ff7681900f934eafcf5ad3d9a228344ddade8 Mon Sep 17 00:00:00 2001 From: darkpssngr Date: Wed, 9 Jun 2021 11:24:27 +0530 Subject: [PATCH 43/86] update readme --- cluster-autoscaler/cloudprovider/aws/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cluster-autoscaler/cloudprovider/aws/README.md b/cluster-autoscaler/cloudprovider/aws/README.md index fe0a10489fd1..41e790f65b45 100644 --- a/cluster-autoscaler/cloudprovider/aws/README.md +++ b/cluster-autoscaler/cloudprovider/aws/README.md @@ -355,3 +355,6 @@ To refresh static list, please run `go run ec2_instance_types/gen.go` under `aws:///us-east-1a/i-01234abcdef`. * If you want to use regional STS endpoints (e.g. when using VPC endpoint for STS) the env `AWS_STS_REGIONAL_ENDPOINTS=regional` should be set. +* If you want to run it on instances with IMDSv1 disabled make sure your + EC2 launch configuration has the setting `Metadata response hop limit` set to `2`. + Otherwise, the `/latest/api/token` call will timeout and result in an error. From eabbf32365fb06ff1eb223bab882ed12b5221c63 Mon Sep 17 00:00:00 2001 From: Jayant Jain Date: Thu, 10 Jun 2021 10:17:25 +0000 Subject: [PATCH 44/86] Updated vendor to v1.22.0-alpha.3 Fixed breaking code in scheduler_based_predicates_checker.go due to vendor update --- cluster-autoscaler/go.mod | 76 +- cluster-autoscaler/go.sum | 269 +- .../scheduler_based_predicates_checker.go | 3 +- .../checkpoint-restore/go-criu/v4/.travis.yml | 28 - .../checkpoint-restore/go-criu/v4/Makefile | 60 - .../checkpoint-restore/go-criu/v4/go.mod | 5 - .../checkpoint-restore/go-criu/v4/go.sum | 2 - .../go-criu/v4/rpc/rpc.pb.go | 1667 ------- .../go-criu/{v4 => v5}/.gitignore | 3 +- .../go-criu/v5/.golangci.yml | 12 + .../go-criu/{v4 => v5}/LICENSE | 0 .../checkpoint-restore/go-criu/v5/Makefile | 57 + .../go-criu/{v4 => v5}/README.md | 34 +- .../checkpoint-restore/go-criu/v5/go.mod | 9 + .../checkpoint-restore/go-criu/v5/go.sum | 22 + .../go-criu/{v4 => v5}/main.go | 27 +- .../go-criu/{v4 => v5}/notify.go | 5 +- .../go-criu/v5/rpc/rpc.pb.go | 2208 +++++++++ .../github.com/cilium/ebpf/.golangci.yaml | 29 + .../github.com/cilium/ebpf/ARCHITECTURE.md | 80 + .../github.com/cilium/ebpf/CONTRIBUTING.md | 23 + .../vendor/github.com/cilium/ebpf/Makefile | 67 + .../vendor/github.com/cilium/ebpf/README.md | 62 + .../vendor/github.com/cilium/ebpf/abi.go | 200 - .../vendor/github.com/cilium/ebpf/asm/func.go | 2 +- .../github.com/cilium/ebpf/asm/instruction.go | 31 +- .../github.com/cilium/ebpf/collection.go | 307 +- .../github.com/cilium/ebpf/elf_reader.go | 713 ++- .../github.com/cilium/ebpf/elf_reader_fuzz.go | 21 + .../vendor/github.com/cilium/ebpf/go.mod | 7 +- .../vendor/github.com/cilium/ebpf/go.sum | 15 +- .../vendor/github.com/cilium/ebpf/info.go | 239 + .../cilium/ebpf/internal/btf/btf.go | 170 +- .../cilium/ebpf/internal/btf/btf_types.go | 4 +- .../cilium/ebpf/internal/btf/core.go | 388 ++ .../cilium/ebpf/internal/btf/ext_info.go | 141 +- .../cilium/ebpf/internal/btf/types.go | 275 +- .../github.com/cilium/ebpf/internal/elf.go | 52 + .../cilium/ebpf/internal/feature.go | 84 +- .../cilium/ebpf/internal/pinning.go | 44 + .../github.com/cilium/ebpf/internal/ptr.go | 15 +- .../cilium/ebpf/internal/syscall.go | 18 +- .../cilium/ebpf/internal/unix/types_linux.go | 57 +- .../cilium/ebpf/internal/unix/types_other.go | 56 +- .../cilium/ebpf/internal/version.go | 163 + .../github.com/cilium/ebpf/link/cgroup.go | 171 + .../vendor/github.com/cilium/ebpf/link/doc.go | 2 + .../github.com/cilium/ebpf/link/iter.go | 67 + .../github.com/cilium/ebpf/link/kprobe.go | 296 ++ .../github.com/cilium/ebpf/link/link.go | 229 + .../github.com/cilium/ebpf/link/netns.go | 60 + .../github.com/cilium/ebpf/link/perf_event.go | 253 + .../github.com/cilium/ebpf/link/program.go | 76 + .../cilium/ebpf/link/raw_tracepoint.go | 61 + .../github.com/cilium/ebpf/link/syscalls.go | 173 + .../github.com/cilium/ebpf/link/tracepoint.go | 56 + .../vendor/github.com/cilium/ebpf/linker.go | 4 +- .../vendor/github.com/cilium/ebpf/map.go | 630 ++- .../github.com/cilium/ebpf/marshalers.go | 31 +- .../vendor/github.com/cilium/ebpf/prog.go | 355 +- .../vendor/github.com/cilium/ebpf/readme.md | 29 - .../github.com/cilium/ebpf/run-tests.sh | 21 +- .../vendor/github.com/cilium/ebpf/syscalls.go | 202 +- .../vendor/github.com/cilium/ebpf/types.go | 60 +- .../github.com/containerd/console/README.md | 4 +- .../containerd/console/console_unix.go | 4 +- .../github.com/containerd/console/go.mod | 2 +- .../github.com/containerd/console/go.sum | 4 +- .../containerd/console/pty_freebsd_cgo.go | 45 + .../containerd/console/pty_freebsd_nocgo.go | 36 + .../github.com/containerd/console/pty_unix.go | 30 + .../{tc_freebsd.go => tc_freebsd_cgo.go} | 14 +- .../containerd/console/tc_freebsd_nocgo.go | 55 + .../github.com/containerd/console/tc_linux.go | 13 +- .../cni/pkg/invoke/find.go | 5 + .../coreos/go-systemd/v22/dbus/dbus.go | 45 +- .../coreos/go-systemd/v22/dbus/methods.go | 323 +- .../github.com/evanphx/json-patch/.travis.yml | 19 - .../github.com/evanphx/json-patch/README.md | 19 + .../github.com/evanphx/json-patch/merge.go | 33 +- .../github.com/evanphx/json-patch/patch.go | 4 + .../github.com/godbus/dbus/v5/.travis.yml | 50 - .../github.com/godbus/dbus/v5/README.markdown | 4 +- .../vendor/github.com/godbus/dbus/v5/auth.go | 2 +- .../vendor/github.com/godbus/dbus/v5/call.go | 9 + .../vendor/github.com/godbus/dbus/v5/conn.go | 159 +- .../vendor/github.com/godbus/dbus/v5/dbus.go | 4 + .../godbus/dbus/v5/default_handler.go | 22 +- .../github.com/godbus/dbus/v5/export.go | 61 +- .../vendor/github.com/godbus/dbus/v5/match.go | 27 + .../github.com/godbus/dbus/v5/object.go | 65 +- .../github.com/godbus/dbus/v5/sequence.go | 24 + .../godbus/dbus/v5/sequential_handler.go | 125 + .../vendor/github.com/godbus/dbus/v5/sig.go | 2 +- .../dbus/v5/transport_unixcred_freebsd.go | 1 + .../github.com/godbus/dbus/v5/variant.go | 6 + .../cadvisor/container/common/helpers.go | 135 +- .../google/go-cmp/cmp/cmpopts/equate.go | 2 +- .../google/go-cmp/cmp/cmpopts/ignore.go | 2 +- .../google/go-cmp/cmp/cmpopts/sort.go | 2 +- .../go-cmp/cmp/cmpopts/struct_filter.go | 2 +- .../google/go-cmp/cmp/cmpopts/xform.go | 2 +- .../github.com/google/go-cmp/cmp/compare.go | 6 +- .../google/go-cmp/cmp/export_panic.go | 2 +- .../google/go-cmp/cmp/export_unsafe.go | 2 +- .../go-cmp/cmp/internal/diff/debug_disable.go | 2 +- .../go-cmp/cmp/internal/diff/debug_enable.go | 2 +- .../google/go-cmp/cmp/internal/diff/diff.go | 50 +- .../google/go-cmp/cmp/internal/flags/flags.go | 2 +- .../cmp/internal/flags/toolchain_legacy.go | 2 +- .../cmp/internal/flags/toolchain_recent.go | 2 +- .../go-cmp/cmp/internal/function/func.go | 2 +- .../google/go-cmp/cmp/internal/value/name.go | 2 +- .../cmp/internal/value/pointer_purego.go | 2 +- .../cmp/internal/value/pointer_unsafe.go | 2 +- .../google/go-cmp/cmp/internal/value/sort.go | 2 +- .../google/go-cmp/cmp/internal/value/zero.go | 2 +- .../github.com/google/go-cmp/cmp/options.go | 2 +- .../github.com/google/go-cmp/cmp/path.go | 2 +- .../github.com/google/go-cmp/cmp/report.go | 2 +- .../google/go-cmp/cmp/report_compare.go | 2 +- .../google/go-cmp/cmp/report_references.go | 2 +- .../google/go-cmp/cmp/report_reflect.go | 4 +- .../google/go-cmp/cmp/report_slices.go | 2 +- .../google/go-cmp/cmp/report_text.go | 2 +- .../google/go-cmp/cmp/report_value.go | 2 +- .../moby/sys/mountinfo/mountinfo.go | 33 +- .../moby/sys/mountinfo/mountinfo_filters.go | 11 +- .../moby/sys/mountinfo/mountinfo_linux.go | 5 +- .../runc/libcontainer/README.md | 8 +- .../libcontainer/apparmor/apparmor_linux.go | 28 +- .../libcontainer/capabilities/capabilities.go | 103 +- .../runc/libcontainer/cgroups/cgroups.go | 36 +- .../cgroups/ebpf/devicefilter/devicefilter.go | 4 +- .../runc/libcontainer/cgroups/ebpf/ebpf.go | 18 +- .../runc/libcontainer/cgroups/fs/blkio.go | 20 +- .../runc/libcontainer/cgroups/fs/cpu.go | 30 +- .../runc/libcontainer/cgroups/fs/cpuacct.go | 2 +- .../runc/libcontainer/cgroups/fs/cpuset.go | 20 +- .../runc/libcontainer/cgroups/fs/devices.go | 8 +- .../runc/libcontainer/cgroups/fs/freezer.go | 58 +- .../runc/libcontainer/cgroups/fs/fs.go | 31 +- .../runc/libcontainer/cgroups/fs/hugetlb.go | 4 +- .../runc/libcontainer/cgroups/fs/kmem.go | 56 - .../libcontainer/cgroups/fs/kmem_disabled.go | 15 - .../runc/libcontainer/cgroups/fs/memory.go | 143 +- .../runc/libcontainer/cgroups/fs/name.go | 2 +- .../runc/libcontainer/cgroups/fs/net_cls.go | 6 +- .../runc/libcontainer/cgroups/fs/net_prio.go | 4 +- .../libcontainer/cgroups/fs/perf_event.go | 2 +- .../runc/libcontainer/cgroups/fs/pids.go | 8 +- .../runc/libcontainer/cgroups/fs2/cpu.go | 20 +- .../runc/libcontainer/cgroups/fs2/cpuset.go | 16 +- .../runc/libcontainer/cgroups/fs2/create.go | 30 +- .../runc/libcontainer/cgroups/fs2/devices.go | 36 +- .../runc/libcontainer/cgroups/fs2/fs2.go | 80 +- .../runc/libcontainer/cgroups/fs2/hugetlb.go | 16 +- .../runc/libcontainer/cgroups/fs2/io.go | 38 +- .../runc/libcontainer/cgroups/fs2/memory.go | 108 +- .../runc/libcontainer/cgroups/fs2/pids.go | 25 +- .../libcontainer/cgroups/fscommon/open.go | 35 +- .../libcontainer/cgroups/fscommon/utils.go | 48 +- .../libcontainer/cgroups/systemd/common.go | 106 +- .../runc/libcontainer/cgroups/systemd/dbus.go | 96 + .../runc/libcontainer/cgroups/systemd/user.go | 8 +- .../runc/libcontainer/cgroups/systemd/v1.go | 91 +- .../runc/libcontainer/cgroups/systemd/v2.go | 77 +- .../runc/libcontainer/cgroups/utils.go | 26 +- .../runc/libcontainer/configs/cgroup_linux.go | 6 - .../runc/libcontainer/configs/config.go | 19 +- .../libcontainer/configs/configs_fuzzer.go | 9 + .../libcontainer/configs/validate/rootless.go | 3 + .../configs/validate/validator.go | 84 +- .../runc/libcontainer/container_linux.go | 98 +- .../runc/libcontainer/criu_opts_linux.go | 2 +- .../runc/libcontainer/devices/device.go | 4 + .../runc/libcontainer/devices/device_unix.go | 107 +- .../libcontainer/devices/device_windows.go | 5 - .../runc/libcontainer/devices/devices.go | 112 - .../runc/libcontainer/factory_linux.go | 14 +- .../runc/libcontainer/init_linux.go | 35 +- .../runc/libcontainer/logs/logs.go | 62 +- .../runc/libcontainer/notify_linux_v2.go | 30 +- .../runc/libcontainer/process_linux.go | 91 +- .../runc/libcontainer/restored_process.go | 6 +- .../runc/libcontainer/rootfs_linux.go | 310 +- .../seccomp/patchbpf/enosys_linux.go | 25 +- .../libcontainer/seccomp/seccomp_linux.go | 50 +- .../seccomp/seccomp_unsupported.go | 5 - .../runc/libcontainer/setns_init_linux.go | 8 + .../runc/libcontainer/standard_init_linux.go | 9 + .../runc/libcontainer/system/linux.go | 49 - .../runc/libcontainer/system/unsupported.go | 27 - .../libcontainer/system/userns_deprecated.go | 5 + .../runc/libcontainer/user/MAINTAINERS | 2 - .../runc/libcontainer/user/lookup.go | 41 - .../runc/libcontainer/user/lookup_unix.go | 20 +- .../runc/libcontainer/user/lookup_windows.go | 40 - .../runc/libcontainer/user/user.go | 48 +- .../runc/libcontainer/user/user_fuzzer.go | 42 + .../runc/libcontainer/userns/userns.go | 5 + .../runc/libcontainer/userns/userns_fuzzer.go | 15 + .../runc/libcontainer/userns/userns_linux.go | 37 + .../libcontainer/userns/userns_unsupported.go | 17 + .../runc/libcontainer/utils/utils.go | 54 + .../runtime-spec/specs-go/config.go | 13 +- .../runtime-spec/specs-go/state.go | 29 +- .../prometheus/common/expfmt/decode.go | 2 +- .../prometheus/common/expfmt/text_parse.go | 11 + .../github.com/prometheus/common/model/fnv.go | 2 +- .../prometheus/common/model/labels.go | 8 + .../prometheus/common/model/time.go | 143 +- .../testify/assert/assertion_compare.go | 172 +- .../testify/assert/assertion_format.go | 97 + .../testify/assert/assertion_forward.go | 194 + .../testify/assert/assertion_order.go | 81 + .../stretchr/testify/assert/assertions.go | 83 +- .../github.com/stretchr/testify/mock/mock.go | 45 +- .../stretchr/testify/require/require.go | 248 + .../testify/require/require_forward.go | 194 + .../thecodeteam/goscaleio/.gitignore | 17 - .../thecodeteam/goscaleio/.travis.yml | 11 - .../thecodeteam/goscaleio/Gopkg.lock | 27 - .../thecodeteam/goscaleio/Gopkg.toml | 4 - .../github.com/thecodeteam/goscaleio/LICENSE | 202 - .../thecodeteam/goscaleio/README.md | 81 - .../github.com/thecodeteam/goscaleio/VERSION | 1 - .../github.com/thecodeteam/goscaleio/api.go | 401 -- .../github.com/thecodeteam/goscaleio/certs.go | 4232 ----------------- .../thecodeteam/goscaleio/device.go | 110 - .../thecodeteam/goscaleio/instance.go | 228 - .../thecodeteam/goscaleio/protectiondomain.go | 131 - .../thecodeteam/goscaleio/scsiinitiator.go | 35 - .../github.com/thecodeteam/goscaleio/sdc.go | 188 - .../github.com/thecodeteam/goscaleio/sds.go | 122 - .../thecodeteam/goscaleio/storagepool.go | 148 - .../thecodeteam/goscaleio/system.go | 106 - .../thecodeteam/goscaleio/types/v1/types.go | 388 -- .../github.com/thecodeteam/goscaleio/user.go | 35 - .../thecodeteam/goscaleio/volume.go | 279 -- .../golang.org/x/sys/cpu/asm_aix_ppc64.s | 1 + .../vendor/golang.org/x/sys/cpu/cpu_arm64.s | 1 + .../vendor/golang.org/x/sys/cpu/cpu_s390x.s | 1 + .../vendor/golang.org/x/sys/cpu/cpu_x86.s | 1 + .../golang.org/x/sys/unix/asm_aix_ppc64.s | 1 + .../unix/{asm_freebsd_386.s => asm_bsd_386.s} | 10 +- .../{asm_netbsd_amd64.s => asm_bsd_amd64.s} | 8 +- .../unix/{asm_netbsd_arm.s => asm_bsd_arm.s} | 8 +- .../{asm_darwin_amd64.s => asm_bsd_arm64.s} | 8 +- .../golang.org/x/sys/unix/asm_darwin_386.s | 29 - .../golang.org/x/sys/unix/asm_darwin_arm.s | 30 - .../golang.org/x/sys/unix/asm_darwin_arm64.s | 30 - .../x/sys/unix/asm_dragonfly_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_arm.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_arm64.s | 29 - .../golang.org/x/sys/unix/asm_linux_386.s | 1 + .../golang.org/x/sys/unix/asm_linux_amd64.s | 1 + .../golang.org/x/sys/unix/asm_linux_arm.s | 1 + .../golang.org/x/sys/unix/asm_linux_arm64.s | 1 + .../golang.org/x/sys/unix/asm_linux_mips64x.s | 1 + .../golang.org/x/sys/unix/asm_linux_mipsx.s | 1 + .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 1 + .../golang.org/x/sys/unix/asm_linux_riscv64.s | 4 +- .../golang.org/x/sys/unix/asm_linux_s390x.s | 3 +- .../golang.org/x/sys/unix/asm_netbsd_386.s | 29 - .../golang.org/x/sys/unix/asm_netbsd_arm64.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_386.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_amd64.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_arm.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_arm64.s | 29 - .../x/sys/unix/asm_openbsd_mips64.s | 1 + .../golang.org/x/sys/unix/asm_solaris_amd64.s | 1 + .../x/sys/unix/fcntl_linux_32bit.go | 4 +- .../golang.org/x/sys/unix/ioctl_linux.go | 196 + .../vendor/golang.org/x/sys/unix/mkall.sh | 2 +- .../vendor/golang.org/x/sys/unix/mkerrors.sh | 10 +- .../golang.org/x/sys/unix/syscall_aix.go | 2 +- .../golang.org/x/sys/unix/syscall_darwin.go | 11 + .../golang.org/x/sys/unix/syscall_illumos.go | 104 +- .../golang.org/x/sys/unix/syscall_linux.go | 183 +- .../x/sys/unix/syscall_linux_ppc.go | 272 ++ .../x/sys/unix/syscall_linux_s390x.go | 2 +- .../golang.org/x/sys/unix/syscall_solaris.go | 7 +- .../x/sys/unix/zerrors_darwin_amd64.go | 25 + .../x/sys/unix/zerrors_darwin_arm64.go | 25 + .../x/sys/unix/zerrors_freebsd_arm.go | 9 + .../golang.org/x/sys/unix/zerrors_linux.go | 28 +- .../x/sys/unix/zerrors_linux_ppc.go | 860 ++++ .../x/sys/unix/zerrors_linux_s390x.go | 2 + .../x/sys/unix/zerrors_solaris_amd64.go | 3 + .../x/sys/unix/zerrors_zos_s390x.go | 7 + .../x/sys/unix/zsyscall_darwin_386.1_13.s | 1 + .../x/sys/unix/zsyscall_darwin_386.s | 1 + .../x/sys/unix/zsyscall_darwin_amd64.1_13.s | 1 + .../x/sys/unix/zsyscall_darwin_amd64.s | 1 + .../x/sys/unix/zsyscall_darwin_arm.1_13.s | 1 + .../x/sys/unix/zsyscall_darwin_arm.s | 1 + .../x/sys/unix/zsyscall_darwin_arm64.1_13.s | 1 + .../x/sys/unix/zsyscall_darwin_arm64.s | 1 + .../x/sys/unix/zsyscall_illumos_amd64.go | 28 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 10 + .../x/sys/unix/zsyscall_linux_ppc.go | 762 +++ .../x/sys/unix/zsyscall_solaris_amd64.go | 5 +- .../x/sys/unix/zsysnum_linux_386.go | 1 + .../x/sys/unix/zsysnum_linux_amd64.go | 1 + .../x/sys/unix/zsysnum_linux_arm.go | 1 + .../x/sys/unix/zsysnum_linux_arm64.go | 1 + .../x/sys/unix/zsysnum_linux_mips.go | 1 + .../x/sys/unix/zsysnum_linux_mips64.go | 1 + .../x/sys/unix/zsysnum_linux_mips64le.go | 1 + .../x/sys/unix/zsysnum_linux_mipsle.go | 1 + .../x/sys/unix/zsysnum_linux_ppc.go | 434 ++ .../x/sys/unix/zsysnum_linux_ppc64.go | 1 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 1 + .../x/sys/unix/zsysnum_linux_riscv64.go | 1 + .../x/sys/unix/zsysnum_linux_s390x.go | 1 + .../x/sys/unix/zsysnum_linux_sparc64.go | 1 + .../x/sys/unix/ztypes_darwin_386.go | 7 + .../x/sys/unix/ztypes_darwin_amd64.go | 7 + .../x/sys/unix/ztypes_darwin_arm.go | 7 + .../x/sys/unix/ztypes_darwin_arm64.go | 7 + .../x/sys/unix/ztypes_illumos_amd64.go | 40 + .../golang.org/x/sys/unix/ztypes_linux.go | 41 +- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 627 +++ .../golang.org/x/sys/windows/exec_windows.go | 35 + .../golang.org/x/sys/windows/mkerrors.bash | 7 + .../x/sys/windows/security_windows.go | 29 +- .../golang.org/x/sys/windows/svc/security.go | 93 +- .../x/sys/windows/syscall_windows.go | 180 +- .../golang.org/x/sys/windows/types_windows.go | 537 +++ .../x/sys/windows/zerrors_windows.go | 2619 +++++++++- .../x/sys/windows/zsyscall_windows.go | 287 +- .../x/text/secure/bidirule/bidirule10.0.0.go | 1 + .../x/text/secure/bidirule/bidirule9.0.0.go | 1 + .../golang.org/x/text/unicode/bidi/bidi.go | 221 +- .../golang.org/x/text/unicode/bidi/core.go | 63 +- .../x/text/unicode/bidi/tables10.0.0.go | 1 + .../x/text/unicode/bidi/tables11.0.0.go | 1 + .../x/text/unicode/bidi/tables12.0.0.go | 1 + .../x/text/unicode/bidi/tables13.0.0.go | 1 + .../x/text/unicode/bidi/tables9.0.0.go | 1 + .../x/text/unicode/norm/tables10.0.0.go | 1 + .../x/text/unicode/norm/tables11.0.0.go | 1 + .../x/text/unicode/norm/tables12.0.0.go | 1 + .../x/text/unicode/norm/tables13.0.0.go | 1 + .../x/text/unicode/norm/tables9.0.0.go | 1 + .../golang.org/x/text/width/tables10.0.0.go | 1 + .../golang.org/x/text/width/tables11.0.0.go | 1 + .../golang.org/x/text/width/tables12.0.0.go | 1 + .../golang.org/x/text/width/tables13.0.0.go | 1 + .../golang.org/x/text/width/tables9.0.0.go | 1 + .../v1alpha1/generated.proto | 3 + .../api/apiserverinternal/v1alpha1/types.go | 5 +- .../v1alpha1/types_swagger_doc_generated.go | 4 +- .../vendor/k8s.io/api/apps/v1/generated.pb.go | 297 +- .../vendor/k8s.io/api/apps/v1/generated.proto | 26 +- .../vendor/k8s.io/api/apps/v1/types.go | 29 +- .../apps/v1/types_swagger_doc_generated.go | 17 +- .../k8s.io/api/apps/v1beta1/generated.pb.go | 277 +- .../k8s.io/api/apps/v1beta1/generated.proto | 13 + .../vendor/k8s.io/api/apps/v1beta1/types.go | 13 + .../v1beta1/types_swagger_doc_generated.go | 2 + .../k8s.io/api/apps/v1beta2/generated.pb.go | 321 +- .../k8s.io/api/apps/v1beta2/generated.proto | 15 +- .../vendor/k8s.io/api/apps/v1beta2/types.go | 15 +- .../v1beta2/types_swagger_doc_generated.go | 4 +- .../api/authentication/v1/generated.proto | 6 + .../k8s.io/api/authentication/v1/types.go | 7 + .../v1/types_swagger_doc_generated.go | 12 +- .../authentication/v1beta1/generated.proto | 4 +- .../api/authentication/v1beta1/types.go | 4 +- .../v1beta1/types_swagger_doc_generated.go | 7 +- .../api/authorization/v1/generated.proto | 9 + .../k8s.io/api/authorization/v1/types.go | 9 + .../v1/types_swagger_doc_generated.go | 29 +- .../api/authorization/v1beta1/generated.proto | 9 + .../k8s.io/api/authorization/v1beta1/types.go | 9 + .../v1beta1/types_swagger_doc_generated.go | 29 +- .../k8s.io/api/batch/v1/generated.proto | 6 +- .../vendor/k8s.io/api/batch/v1/types.go | 8 +- .../batch/v1/types_swagger_doc_generated.go | 2 +- .../api/core/v1/annotation_key_constants.go | 3 - .../vendor/k8s.io/api/core/v1/generated.pb.go | 1843 ++++--- .../vendor/k8s.io/api/core/v1/generated.proto | 81 +- .../vendor/k8s.io/api/core/v1/types.go | 91 +- .../core/v1/types_swagger_doc_generated.go | 22 +- .../api/core/v1/zz_generated.deepcopy.go | 10 +- .../api/extensions/v1beta1/generated.proto | 10 +- .../k8s.io/api/extensions/v1beta1/types.go | 10 +- .../v1beta1/types_swagger_doc_generated.go | 4 +- .../k8s.io/api/flowcontrol/v1beta1/types.go | 44 + .../k8s.io/api/networking/v1/generated.proto | 4 +- .../vendor/k8s.io/api/networking/v1/types.go | 4 +- .../v1/types_swagger_doc_generated.go | 2 +- .../networking/v1/well_known_annotations.go} | 13 +- .../api/networking/v1beta1/generated.proto | 4 +- .../k8s.io/api/networking/v1beta1/types.go | 4 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/node/v1alpha1/generated.proto | 2 +- .../vendor/k8s.io/api/node/v1alpha1/types.go | 2 +- .../v1alpha1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/node/v1beta1/generated.proto | 2 +- .../vendor/k8s.io/api/node/v1beta1/types.go | 2 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/policy/v1beta1/generated.proto | 5 + .../vendor/k8s.io/api/policy/v1beta1/types.go | 9 +- .../v1beta1/types_swagger_doc_generated.go | 11 +- .../apimachinery/pkg/api/resource/quantity.go | 9 + .../pkg/api/validation/generic.go | 6 +- .../pkg/api/validation/objectmeta.go | 21 +- .../pkg/apis/meta/v1/generated.proto | 2 - .../apimachinery/pkg/apis/meta/v1/types.go | 2 - .../meta/v1/types_swagger_doc_generated.go | 2 +- .../pkg/util/httpstream/spdy/connection.go | 5 +- .../pkg/util/httpstream/spdy/roundtripper.go | 3 + .../k8s.io/apimachinery/pkg/util/net/http.go | 1 + .../pkg/util/strategicpatch/patch.go | 5 +- .../k8s.io/apimachinery/pkg/util/wait/wait.go | 239 +- .../plugin/webhook/mutating/dispatcher.go | 46 +- .../plugin/webhook/validating/dispatcher.go | 20 +- .../pkg/apis/flowcontrol/bootstrap/default.go | 17 +- .../k8s.io/apiserver/pkg/audit/metrics.go | 2 +- .../k8s.io/apiserver/pkg/audit/request.go | 4 +- .../pkg/authentication/request/x509/x509.go | 2 +- .../endpoints/discovery/storageversionhash.go | 3 +- .../endpoints/filterlatency/filterlatency.go | 10 +- .../pkg/endpoints/filters/metrics.go | 2 +- .../pkg/endpoints/handlers/create.go | 8 +- .../pkg/endpoints/handlers/delete.go | 11 +- .../handlers/fieldmanager/admission.go | 5 +- .../fieldmanager/lastappliedupdater.go | 8 +- .../endpoints/handlers/finisher/finisher.go | 73 +- .../pkg/endpoints/handlers/update.go | 7 +- .../apiserver/pkg/endpoints/installer.go | 42 +- .../pkg/endpoints/metrics/metrics.go | 59 +- .../apiserver/pkg/features/kube_features.go | 10 +- .../generic/registry/decorated_watcher.go | 22 +- .../pkg/registry/generic/registry/store.go | 4 +- .../apiserver/pkg/registry/rest/create.go | 25 + .../pkg/registry/rest/create_update.go | 20 + .../apiserver/pkg/registry/rest/update.go | 25 + .../k8s.io/apiserver/pkg/server/config.go | 2 + .../apiserver/pkg/server/config_selfclient.go | 4 +- .../apiserver/pkg/server/deleted_kinds.go | 6 +- .../configmap_cafile_content.go | 4 +- .../dynamic_cafile_content.go | 6 +- .../dynamic_serving_content.go | 6 +- .../dynamiccertificates/named_certificates.go | 2 +- .../server/dynamiccertificates/tlsconfig.go | 8 +- .../pkg/server/filters/maxinflight.go | 5 +- .../server/filters/priority-and-fairness.go | 79 +- .../apiserver/pkg/server/filters/timeout.go | 17 +- .../apiserver/pkg/server/genericapiserver.go | 4 + .../apiserver/pkg/server/httplog/httplog.go | 67 +- .../server/options/serving_with_loopback.go | 6 +- .../apiserver/pkg/storage/cacher/cacher.go | 9 + .../apiserver/pkg/storage/cacher/metrics.go | 4 +- .../pkg/storage/etcd3/metrics/metrics.go | 2 +- .../apiserver/pkg/storage/etcd3/watcher.go | 13 +- .../apiserver/pkg/storage/interfaces.go | 2 +- .../apiserver/pkg/storage/names/generate.go | 6 +- .../pkg/storage/storagebackend/config.go | 1 + .../storage/storagebackend/factory/factory.go | 8 +- .../storage/value/encrypt/envelope/metrics.go | 2 +- .../apiserver/pkg/storage/value/metrics.go | 2 +- .../pkg/util/flowcontrol/apf_context.go | 82 + .../pkg/util/flowcontrol/debug/dump.go | 8 +- .../fairqueuing/queueset/fifo_list.go | 102 + .../fairqueuing/queueset/queueset.go | 124 +- .../flowcontrol/fairqueuing/queueset/types.go | 37 +- .../apiserver/pkg/util/webhook/client.go | 6 + .../apiserver/pkg/util/webhook/gencerts.sh | 18 +- .../apiserver/pkg/util/webhook/metrics.go | 39 + .../apiserver/pkg/util/webhook/webhook.go | 2 + .../pkg/util/x509metrics/missing_san.go | 92 + .../apps/v1/statefulsetspec.go | 9 + .../apps/v1/statefulsetstatus.go | 9 + .../apps/v1beta1/statefulsetspec.go | 9 + .../apps/v1beta1/statefulsetstatus.go | 9 + .../apps/v1beta2/statefulsetspec.go | 9 + .../apps/v1beta2/statefulsetstatus.go | 9 + .../core/v1/servicespec.go | 11 - .../core/v1/windowssecuritycontextoptions.go | 9 + .../applyconfigurations/internal/internal.go | 27 +- .../k8s.io/client-go/dynamic/fake/simple.go | 7 +- .../kubernetes/fake/clientset_generated.go | 5 +- .../plugin/pkg/client/auth/exec/exec.go | 5 +- .../vendor/k8s.io/client-go/rest/request.go | 333 +- .../k8s.io/client-go/rest/with_retry.go | 232 + .../vendor/k8s.io/client-go/testing/fake.go | 4 + .../k8s.io/client-go/testing/fixture.go | 39 +- .../k8s.io/client-go/testing/interface.go | 66 + .../client-go/tools/cache/controller.go | 2 +- .../client-go/tools/cache/delta_fifo.go | 12 +- .../k8s.io/client-go/tools/cache/fifo.go | 5 +- .../k8s.io/client-go/tools/cache/heap.go | 5 +- .../client-go/tools/clientcmd/config.go | 6 +- .../k8s.io/client-go/tools/events/helper.go | 64 + .../client-go/tools/record/util/util.go | 6 +- .../client-go/transport/round_trippers.go | 2 +- .../k8s.io/client-go/transport/transport.go | 38 +- .../vendor/k8s.io/client-go/util/cert/cert.go | 1 + .../vendor/k8s.io/cloud-provider/go.mod | 32 +- .../vendor/k8s.io/cloud-provider/go.sum | 91 +- .../vendor/k8s.io/cloud-provider/plugins.go | 35 +- .../k8s.io/component-base/logs/config.go | 94 + .../k8s.io/component-base/logs/json/json.go | 72 +- .../k8s.io/component-base/logs/options.go | 99 +- .../k8s.io/component-base/logs/registry.go | 12 - .../k8s.io/component-base/logs/validate.go | 65 + .../metrics/testutil/promlint.go | 5 - .../apimachinery/lease/controller.go | 2 +- .../pkg/apis/runtime/v1alpha2/api.pb.go | 1429 ++++-- .../pkg/apis/runtime/v1alpha2/api.proto | 30 +- .../vendor/k8s.io/csi-translation-lib/go.mod | 12 +- .../vendor/k8s.io/csi-translation-lib/go.sum | 43 +- .../csi-translation-lib/plugins/aws_ebs.go | 14 + .../vendor/k8s.io/klog/v2/klog.go | 27 +- .../kubernetes/cmd/kube-proxy/app/server.go | 2 +- .../kubelet/app/options/container_runtime.go | 2 +- .../cmd/kubelet/app/options/options.go | 4 +- .../kubernetes/cmd/kubelet/app/plugins.go | 2 - .../cmd/kubelet/app/plugins_providers.go | 24 +- .../kubernetes/cmd/kubelet/app/server.go | 30 +- .../cmd/kubelet/app/server_linux.go | 2 + .../cmd/kubelet/app/server_windows.go | 10 +- .../k8s.io/kubernetes/pkg/api/pod/util.go | 64 +- .../k8s.io/kubernetes/pkg/api/pod/warnings.go | 281 ++ .../k8s.io/kubernetes/pkg/apis/apps/OWNERS | 16 +- .../k8s.io/kubernetes/pkg/apis/apps/types.go | 15 +- .../pkg/apis/apps/validation/validation.go | 26 +- .../k8s.io/kubernetes/pkg/apis/batch/OWNERS | 15 +- .../k8s.io/kubernetes/pkg/apis/batch/types.go | 6 +- .../k8s.io/kubernetes/pkg/apis/core/OWNERS | 34 - .../pkg/apis/core/annotation_key_constants.go | 3 - .../k8s.io/kubernetes/pkg/apis/core/types.go | 82 +- .../pkg/apis/core/v1/validation/validation.go | 7 +- .../apis/core/v1/zz_generated.conversion.go | 4 +- .../pkg/apis/core/validation/events.go | 2 +- .../pkg/apis/core/validation/validation.go | 157 +- .../pkg/apis/core/zz_generated.deepcopy.go | 10 +- .../kubernetes/pkg/apis/networking/types.go | 4 +- .../k8s.io/kubernetes/pkg/apis/policy/OWNERS | 1 + .../pkg/apis/policy/validation/validation.go | 4 +- .../kubernetes/pkg/cluster/ports/ports.go | 4 - .../pkg/controller/controller_utils.go | 58 +- .../kubernetes/pkg/features/kube_features.go | 120 +- .../pkg/kubelet/cadvisor/cadvisor_linux.go | 21 +- .../pkg/kubelet/cm/cgroup_manager_linux.go | 211 +- .../kubelet/cm/cgroup_manager_unsupported.go | 10 +- .../pkg/kubelet/cm/container_manager_linux.go | 8 +- .../kubelet/cm/cpumanager/cpu_assignment.go | 208 +- .../pkg/kubelet/cm/cpumanager/cpu_manager.go | 25 +- .../pkg/kubelet/cm/cpuset/cpuset.go | 7 +- .../pkg/kubelet/cm/devicemanager/manager.go | 30 +- .../kubelet/cm/devicemanager/pod_devices.go | 2 + .../cm/internal_container_lifecycle.go | 5 +- .../kubelet/cm/qos_container_manager_linux.go | 5 +- .../topologymanager/fake_topology_manager.go | 23 +- .../pkg/kubelet/cm/topologymanager/scope.go | 28 +- .../cm/topologymanager/scope_container.go | 3 +- .../kubelet/cm/topologymanager/scope_pod.go | 3 +- .../cm/topologymanager/topology_manager.go | 6 +- .../k8s.io/kubernetes/pkg/kubelet/cm/types.go | 18 +- .../kubernetes/pkg/kubelet/config/file.go | 4 +- .../kubernetes/pkg/kubelet/config/http.go | 4 +- .../pkg/kubelet/container/helpers.go | 29 + .../pkg/kubelet/container/runtime.go | 10 +- .../pkg/kubelet/dockershim/docker_sandbox.go | 2 +- .../k8s.io/kubernetes/pkg/kubelet/kubelet.go | 26 +- .../kubernetes/pkg/kubelet/kubelet_pods.go | 10 +- .../kubernetes/pkg/kubelet/kubelet_volumes.go | 5 + .../kuberuntime/kuberuntime_container.go | 61 +- .../kuberuntime_container_windows.go | 15 +- .../kuberuntime/kuberuntime_manager.go | 2 +- .../kuberuntime/kuberuntime_sandbox.go | 58 + .../pkg/kubelet/kuberuntime/labels.go | 37 +- .../pkg/kubelet/lifecycle/predicate.go | 9 +- .../pkg/kubelet/logs/container_log_manager.go | 7 +- .../kubernetes/pkg/kubelet/metrics/metrics.go | 5 +- .../kubernetes/pkg/kubelet/network/dns/dns.go | 47 +- .../nodeshutdown/systemd/inhibit_linux.go | 23 +- .../kubernetes/pkg/kubelet/pleg/generic.go | 2 +- .../pkg/kubelet/pod/mirror_client.go | 10 +- .../kubernetes/pkg/kubelet/pod_workers.go | 2 +- .../pkg/kubelet/prober/prober_manager.go | 4 +- .../server/stats/volume_stat_calculator.go | 7 +- .../pkg/kubelet/stats/cri_stats_provider.go | 26 +- .../pkg/kubelet/stats/host_stats_provider.go | 5 + .../kubernetes/pkg/kubelet/stats/provider.go | 3 +- .../pkg/kubelet/status/status_manager.go | 2 +- .../volumemanager/reconciler/reconciler.go | 2 +- .../k8s.io/kubernetes/pkg/kubemark/OWNERS | 3 + .../kubernetes/pkg/kubemark/hollow_kubelet.go | 2 - .../pkg/proxy/endpointslicecache.go | 44 +- .../kubernetes/pkg/proxy/iptables/proxier.go | 16 +- .../kubernetes/pkg/proxy/ipvs/proxier.go | 188 +- .../k8s.io/kubernetes/pkg/proxy/service.go | 11 +- .../k8s.io/kubernetes/pkg/proxy/topology.go | 67 +- .../k8s.io/kubernetes/pkg/proxy/types.go | 2 - .../kubernetes/pkg/proxy/userspace/proxier.go | 64 +- .../kubernetes/pkg/proxy/winkernel/proxier.go | 6 +- .../scheduler/algorithmprovider/registry.go | 48 +- .../pkg/scheduler/apis/config/OWNERS | 15 +- .../scheduler/apis/config/v1/conversion.go | 2 +- .../pkg/scheduler/framework/cycle_state.go | 33 +- .../pkg/scheduler/framework/interface.go | 53 +- .../defaultpreemption/default_preemption.go | 36 +- .../framework/plugins/feature/feature.go | 3 + .../framework/plugins/helper/spread.go | 49 +- .../plugins/interpodaffinity/filtering.go | 10 +- .../plugins/nodeaffinity/node_affinity.go | 2 + .../framework/plugins/nodelabel/node_label.go | 4 +- .../noderesources/balanced_allocation.go | 16 +- .../framework/plugins/noderesources/fit.go | 17 +- .../plugins/noderesources/least_allocated.go | 7 +- .../plugins/noderesources/most_allocated.go | 7 +- .../requested_to_capacity_ratio.go | 10 +- .../noderesources/resource_allocation.go | 21 +- .../framework/plugins/nodevolumelimits/csi.go | 12 +- .../plugins/nodevolumelimits/non_csi.go | 16 +- .../scheduler/framework/plugins/registry.go | 73 +- .../plugins/volumezone/volume_zone.go | 34 +- .../scheduler/framework/runtime/framework.go | 91 +- .../kubernetes/pkg/scheduler/util/non_zero.go | 14 +- .../kubernetes/pkg/securitycontext/util.go | 17 + .../pkg/util/bandwidth/unsupported.go | 2 +- .../kubernetes/pkg/volume/awsebs/aws_ebs.go | 4 +- .../pkg/volume/awsebs/aws_ebs_block.go | 19 +- .../kubernetes/pkg/volume/awsebs/aws_util.go | 14 +- .../pkg/volume/azure_file/azure_file.go | 2 +- .../pkg/volume/azure_file/azure_provision.go | 2 +- .../pkg/volume/azure_file/azure_util.go | 10 +- .../pkg/volume/azuredd/azure_dd_block.go | 19 +- .../pkg/volume/azuredd/azure_mounter.go | 2 +- .../pkg/volume/azuredd/azure_provision.go | 8 +- .../kubernetes/pkg/volume/cephfs/cephfs.go | 4 +- .../kubernetes/pkg/volume/cinder/attacher.go | 8 +- .../kubernetes/pkg/volume/cinder/cinder.go | 8 +- .../pkg/volume/cinder/cinder_block.go | 20 +- .../pkg/volume/cinder/cinder_util.go | 2 +- .../pkg/volume/configmap/configmap.go | 2 +- .../kubernetes/pkg/volume/csi/csi_attacher.go | 5 +- .../kubernetes/pkg/volume/csi/csi_block.go | 6 + .../kubernetes/pkg/volume/csi/csi_plugin.go | 2 +- .../kubernetes/pkg/volume/csi/expander.go | 5 +- .../pkg/volume/csimigration/plugin_manager.go | 16 +- .../pkg/volume/downwardapi/downwardapi.go | 2 +- .../pkg/volume/emptydir/empty_dir.go | 7 +- .../kubernetes/pkg/volume/fc/attacher.go | 28 +- .../k8s.io/kubernetes/pkg/volume/fc/fc.go | 26 +- .../kubernetes/pkg/volume/fc/fc_util.go | 4 +- .../pkg/volume/flexvolume/detacher.go | 4 +- .../pkg/volume/flexvolume/driver-call.go | 10 +- .../kubernetes/pkg/volume/flexvolume/probe.go | 10 +- .../pkg/volume/flexvolume/unmounter.go | 2 +- .../kubernetes/pkg/volume/flexvolume/util.go | 4 +- .../kubernetes/pkg/volume/flocker/flocker.go | 8 +- .../pkg/volume/flocker/flocker_volume.go | 4 +- .../pkg/volume/gcepd/gce_pd_block.go | 19 +- .../kubernetes/pkg/volume/iscsi/iscsi.go | 37 +- .../kubernetes/pkg/volume/iscsi/iscsi_util.go | 12 +- .../kubernetes/pkg/volume/local/local.go | 18 +- .../kubernetes/pkg/volume/metrics_block.go | 87 + .../kubernetes/pkg/volume/metrics_errors.go | 8 + .../kubernetes/pkg/volume/metrics_nil.go | 5 + .../k8s.io/kubernetes/pkg/volume/nfs/nfs.go | 17 +- .../k8s.io/kubernetes/pkg/volume/plugins.go | 36 +- .../pkg/volume/portworx/portworx_util.go | 4 +- .../pkg/volume/projected/projected.go | 4 +- .../kubernetes/pkg/volume/quobyte/quobyte.go | 8 +- .../k8s.io/kubernetes/pkg/volume/rbd/rbd.go | 18 +- .../pkg/volume/scaleio/sio_client.go | 582 --- .../kubernetes/pkg/volume/scaleio/sio_mgr.go | 241 - .../pkg/volume/scaleio/sio_plugin.go | 220 - .../kubernetes/pkg/volume/scaleio/sio_util.go | 336 -- .../pkg/volume/scaleio/sio_volume.go | 530 --- .../kubernetes/pkg/volume/secret/secret.go | 2 +- .../pkg/volume/storageos/storageos.go | 4 +- .../pkg/volume/storageos/storageos_util.go | 53 +- .../kubernetes/pkg/volume/util/metrics.go | 2 +- .../kubernetes/pkg/volume/util/types/types.go | 5 +- .../k8s.io/kubernetes/pkg/volume/util/util.go | 42 +- .../volume_path_handler_linux.go | 84 +- .../k8s.io/kubernetes/pkg/volume/volume.go | 4 + .../vsphere_volume/vsphere_volume_block.go | 18 +- .../vsphere_volume_util_linux.go | 2 +- .../k8s.io/kubernetes/test/utils/runners.go | 57 +- .../kubernetes/test/utils/update_resources.go | 2 +- .../aws/aws_loadbalancer.go | 183 +- .../legacy-cloud-providers/azure/azure.go | 33 +- .../azure/azure_instance_metadata.go | 125 +- .../azure/azure_loadbalancer.go | 16 +- .../azure/azure_managedDiskController.go | 9 +- .../azure/azure_standard.go | 12 +- .../azure/azure_vmss.go | 64 +- .../azure/azure_vmss_cache.go | 5 + .../gce/gce_loadbalancer_external.go | 7 +- .../gce/token_source.go | 2 +- .../openstack/metadata.go | 2 +- .../vendor/k8s.io/mount-utils/go.mod | 6 +- .../vendor/k8s.io/mount-utils/go.sum | 12 +- .../k8s.io/mount-utils/mount_helper_unix.go | 2 +- .../k8s.io/mount-utils/mount_windows.go | 2 +- .../vendor/k8s.io/utils/io/read.go | 26 +- .../vendor/k8s.io/utils/mount/OWNERS | 15 - .../vendor/k8s.io/utils/mount/fake_mounter.go | 216 - .../vendor/k8s.io/utils/mount/mount.go | 370 -- .../k8s.io/utils/mount/mount_helper_common.go | 103 - .../k8s.io/utils/mount/mount_helper_unix.go | 158 - .../utils/mount/mount_helper_windows.go | 101 - .../vendor/k8s.io/utils/mount/mount_linux.go | 551 --- .../k8s.io/utils/mount/mount_unsupported.go | 77 - .../k8s.io/utils/mount/mount_windows.go | 313 -- .../vendor/k8s.io/utils/pointer/pointer.go | 156 +- cluster-autoscaler/vendor/modules.txt | 137 +- .../konnectivity-client/pkg/client/client.go | 36 +- 718 files changed, 26917 insertions(+), 20763 deletions(-) delete mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/.travis.yml delete mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/Makefile delete mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/go.mod delete mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/go.sum delete mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/rpc/rpc.pb.go rename cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/{v4 => v5}/.gitignore (52%) create mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/.golangci.yml rename cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/{v4 => v5}/LICENSE (100%) create mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/Makefile rename cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/{v4 => v5}/README.md (72%) create mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/go.mod create mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/go.sum rename cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/{v4 => v5}/main.go (87%) rename cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/{v4 => v5}/notify.go (95%) create mode 100644 cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/rpc/rpc.pb.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/.golangci.yaml create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/ARCHITECTURE.md create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/CONTRIBUTING.md create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/Makefile create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/README.md delete mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/abi.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader_fuzz.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/info.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/core.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/elf.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/pinning.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/version.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/cgroup.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/doc.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/iter.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/kprobe.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/link.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/netns.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/perf_event.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/program.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/raw_tracepoint.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/syscalls.go create mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/link/tracepoint.go delete mode 100644 cluster-autoscaler/vendor/github.com/cilium/ebpf/readme.md create mode 100644 cluster-autoscaler/vendor/github.com/containerd/console/pty_freebsd_cgo.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/console/pty_freebsd_nocgo.go create mode 100644 cluster-autoscaler/vendor/github.com/containerd/console/pty_unix.go rename cluster-autoscaler/vendor/github.com/containerd/console/{tc_freebsd.go => tc_freebsd_cgo.go} (85%) create mode 100644 cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd_nocgo.go delete mode 100644 cluster-autoscaler/vendor/github.com/evanphx/json-patch/.travis.yml delete mode 100644 cluster-autoscaler/vendor/github.com/godbus/dbus/v5/.travis.yml create mode 100644 cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sequence.go create mode 100644 cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sequential_handler.go delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem.go delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem_disabled.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/dbus.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/configs_fuzzer.go delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_windows.go delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/devices.go delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/userns_deprecated.go delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup.go delete mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user_fuzzer.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_fuzzer.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_linux.go create mode 100644 cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_unsupported.go create mode 100644 cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_order.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/.gitignore delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/.travis.yml delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/Gopkg.lock delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/Gopkg.toml delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/LICENSE delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/README.md delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/VERSION delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/api.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/certs.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/device.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/instance.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/protectiondomain.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/scsiinitiator.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/sdc.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/sds.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/storagepool.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/system.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/types/v1/types.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/user.go delete mode 100644 cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/volume.go rename cluster-autoscaler/vendor/golang.org/x/sys/unix/{asm_freebsd_386.s => asm_bsd_386.s} (70%) rename cluster-autoscaler/vendor/golang.org/x/sys/unix/{asm_netbsd_amd64.s => asm_bsd_amd64.s} (72%) rename cluster-autoscaler/vendor/golang.org/x/sys/unix/{asm_netbsd_arm.s => asm_bsd_arm.s} (74%) rename cluster-autoscaler/vendor/golang.org/x/sys/unix/{asm_darwin_amd64.s => asm_bsd_arm64.s} (75%) delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_386.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_arm.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_386.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_386.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s create mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/ioctl_linux.go create mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go create mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go create mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go create mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go create mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go create mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go rename cluster-autoscaler/vendor/k8s.io/{utils/mount/doc.go => api/networking/v1/well_known_annotations.go} (55%) create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_context.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/metrics.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/x509metrics/missing_san.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/rest/with_retry.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/testing/interface.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/tools/events/helper.go create mode 100644 cluster-autoscaler/vendor/k8s.io/component-base/logs/config.go create mode 100644 cluster-autoscaler/vendor/k8s.io/component-base/logs/validate.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/warnings.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_block.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_plugin.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/utils/mount/OWNERS delete mode 100644 cluster-autoscaler/vendor/k8s.io/utils/mount/fake_mounter.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/utils/mount/mount.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_common.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_unix.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_windows.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/utils/mount/mount_linux.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/utils/mount/mount_unsupported.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/utils/mount/mount_windows.go diff --git a/cluster-autoscaler/go.mod b/cluster-autoscaler/go.mod index e11b2c2b7376..c1f9848f3e99 100644 --- a/cluster-autoscaler/go.mod +++ b/cluster-autoscaler/go.mod @@ -19,78 +19,80 @@ require ( github.com/pkg/errors v0.9.1 github.com/satori/go.uuid v1.2.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.0 golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d google.golang.org/api v0.20.0 gopkg.in/gcfg.v1 v1.2.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.22.0-alpha.1 - k8s.io/apimachinery v0.22.0-alpha.1 - k8s.io/apiserver v0.22.0-alpha.1 - k8s.io/client-go v0.22.0-alpha.1 - k8s.io/cloud-provider v0.22.0-alpha.1 - k8s.io/component-base v0.22.0-alpha.1 - k8s.io/component-helpers v0.22.0-alpha.1 - k8s.io/klog/v2 v2.8.0 + k8s.io/api v0.22.0-alpha.3 + k8s.io/apimachinery v0.22.0-alpha.3 + k8s.io/apiserver v0.22.0-alpha.3 + k8s.io/client-go v0.22.0-alpha.3 + k8s.io/cloud-provider v0.22.0-alpha.3 + k8s.io/component-base v0.22.0-alpha.3 + k8s.io/component-helpers v0.22.0-alpha.3 + k8s.io/klog/v2 v2.9.0 k8s.io/kubelet v0.0.0 - k8s.io/kubernetes v1.22.0-alpha.1 + k8s.io/kubernetes v1.22.0-alpha.3 k8s.io/legacy-cloud-providers v0.0.0 - k8s.io/utils v0.0.0-20201110183641-67b214c5f920 + k8s.io/utils v0.0.0-20210521133846-da695404a2bc ) replace github.com/digitalocean/godo => github.com/digitalocean/godo v1.27.0 replace github.com/rancher/go-rancher => github.com/rancher/go-rancher v0.1.0 -replace k8s.io/api => k8s.io/api v0.22.0-alpha.1 +replace k8s.io/api => k8s.io/api v0.22.0-alpha.3 -replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0-alpha.1 +replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0-alpha.3 -replace k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.1 +replace k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.3 -replace k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.1 +replace k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.3 -replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.0-alpha.1 +replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.0-alpha.3 -replace k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.1 +replace k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.3 -replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0-alpha.1 +replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0-alpha.3 -replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.0-alpha.1 +replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.0-alpha.3 -replace k8s.io/code-generator => k8s.io/code-generator v0.22.0-alpha.1 +replace k8s.io/code-generator => k8s.io/code-generator v0.22.0-alpha.3 -replace k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.1 +replace k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.3 -replace k8s.io/component-helpers => k8s.io/component-helpers v0.22.0-alpha.1 +replace k8s.io/component-helpers => k8s.io/component-helpers v0.22.0-alpha.3 -replace k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.1 +replace k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.3 -replace k8s.io/cri-api => k8s.io/cri-api v0.22.0-alpha.1 +replace k8s.io/cri-api => k8s.io/cri-api v0.22.0-alpha.3 -replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.22.0-alpha.1 +replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.22.0-alpha.3 -replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.22.0-alpha.1 +replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.22.0-alpha.3 -replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.22.0-alpha.1 +replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.22.0-alpha.3 -replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.22.0-alpha.1 +replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.22.0-alpha.3 -replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.22.0-alpha.1 +replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.22.0-alpha.3 -replace k8s.io/kubectl => k8s.io/kubectl v0.22.0-alpha.1 +replace k8s.io/kubectl => k8s.io/kubectl v0.22.0-alpha.3 -replace k8s.io/kubelet => k8s.io/kubelet v0.22.0-alpha.1 +replace k8s.io/kubelet => k8s.io/kubelet v0.22.0-alpha.3 -replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.22.0-alpha.1 +replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.22.0-alpha.3 -replace k8s.io/metrics => k8s.io/metrics v0.22.0-alpha.1 +replace k8s.io/metrics => k8s.io/metrics v0.22.0-alpha.3 -replace k8s.io/mount-utils => k8s.io/mount-utils v0.22.0-alpha.1 +replace k8s.io/mount-utils => k8s.io/mount-utils v0.22.0-alpha.3 -replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.0-alpha.1 +replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.0-alpha.3 -replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.22.0-alpha.1 +replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.22.0-alpha.3 -replace k8s.io/sample-controller => k8s.io/sample-controller v0.22.0-alpha.1 +replace k8s.io/sample-controller => k8s.io/sample-controller v0.22.0-alpha.3 + +replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.22.0-alpha.3 diff --git a/cluster-autoscaler/go.sum b/cluster-autoscaler/go.sum index 51e457b6d610..4182fd8a2acd 100644 --- a/cluster-autoscaler/go.sum +++ b/cluster-autoscaler/go.sum @@ -66,24 +66,21 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0 github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7 h1:irR1cO6eek3n5uquIVaRAsQmZnlsfPuHNz31cXo4eyk= @@ -110,15 +107,15 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/checkpoint-restore/go-criu/v4 v4.1.0 h1:WW2B2uxx9KWF6bGlHqhm8Okiafwwx7Y2kcpn8lCpjgo= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= +github.com/checkpoint-restore/go-criu/v5 v5.0.0 h1:TW8f/UvntYoVDMN1K2HlT82qH1rb0sOjpGw3m6Ym+i4= +github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.2.0 h1:Fv93L3KKckEcEHR3oApXVzyBTDA8WAm6VXhPE00N3f8= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= +github.com/cilium/ebpf v0.5.0 h1:E1KshmrMEtkMP2UjlWzfmUV1owWY+BnbL5FxxuatnrU= +github.com/cilium/ebpf v0.5.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313 h1:eIHD9GNM3Hp7kcRW5mvcz7WTR3ETeoYYKwpgA04kaXE= github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= @@ -129,8 +126,8 @@ github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93C github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 h1:qWj4qVYZ95vLWwqyNJCQg7rDsG5wPdze0UaPolH7DUk= github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v1.0.1 h1:u7SFAJyRqWcG6ogaMAx3KjSTy1e3hT9QxqX7Jco7dRc= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= +github.com/containerd/console v1.0.2 h1:Pi6D+aZXM+oUw1czuKgH5IJ+y0jhYcwBJfx5/Ghn9dE= +github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.4.4 h1:rtRG4N6Ct7GNssATwgpvMGfnjnwfjnu/Zs9W3Ikzq+M= github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -143,8 +140,8 @@ github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8h github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/containerd/typeurl v1.0.1 h1:PvuK4E3D5S5q6IqsPDCy928FhP0LUIGcmZ/Yhgp5Djw= github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containernetworking/cni v0.8.0 h1:BT9lpgGoH4jw3lFC7Odz2prU5ruiYKcgAjMCbgybcKI= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v0.8.1 h1:7zpDnQ3T3s4ucOuJ/ZCLrYBxzkg0AELFfII3Epo9TmI= +github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/coredns/corefile-migration v1.0.11/go.mod h1:RMy/mXdeDlYwzt0vdMEJvT2hGJ2I86/eO0UdXmH9XNI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -157,8 +154,8 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.3.1 h1:7OO2CXWMYNDdaAzP51t4lCCZWwpQHmvPbm9sxWjm3So= +github.com/coreos/go-systemd/v22 v22.3.1/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= @@ -188,7 +185,6 @@ github.com/docker/docker v20.10.2+incompatible h1:vFgEHPqWBTp4pTjdLwjAA4bSo3gvIG github.com/docker/docker v20.10.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -205,8 +201,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/euank/go-kmsg-parser v2.0.0+incompatible h1:cHD53+PLQuuQyLZeriD1V/esuG4MuU0Pjs5y6iknohY= github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= +github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -214,14 +210,14 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= 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/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-acme/lego v2.5.0+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M= github.com/go-bindata/go-bindata v3.1.1+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= @@ -230,62 +226,26 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-ozzo/ozzo-validation v3.5.0+incompatible h1:sUy/in/P6askYr16XJgTKq/0SZhiWsdg4WZGaLsGQkM= github.com/go-ozzo/ozzo-validation v3.5.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= -github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -307,6 +267,7 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -314,7 +275,6 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -328,15 +288,16 @@ github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA// github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/cadvisor v0.39.0 h1:jai6dmBP9QAYluNGqU18yVUTw6uuyAW0AqtZIjvl8Qg= -github.com/google/cadvisor v0.39.0/go.mod h1:rjQFmK4jPCpxeUdLq9bYhNFFsjgGOtpnDmDeap0+nsw= +github.com/google/cadvisor v0.39.2 h1:SzgL5IYoMZEFVA9usi0xCy8SXSVXKQ6aL/rYs/kQjXE= +github.com/google/cadvisor v0.39.2/go.mod h1:kN93gpdevu+bpS227TyHVZyCU5bbqCzTj5T9drl34MI= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -403,7 +364,6 @@ github.com/heketi/heketi v10.2.0+incompatible h1:kw0rXzWGCXZP5XMP07426kKiz4hGFgR github.com/heketi/heketi v10.2.0+incompatible/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o= github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6 h1:oJ/NLadJn5HoxvonA6VxG31lg0d6XOURNA09BTtM4fY= github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6/go.mod h1:xGMAM8JLi7UkZt1i4FQeQy0R2T8GLUwQhOP5M1gBhy4= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q= @@ -418,6 +378,7 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= @@ -426,6 +387,7 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= @@ -436,11 +398,13 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -458,13 +422,10 @@ github.com/lucas-clemente/quic-go v0.10.2/go.mod h1:hvaRS9IHjFLMq76puFJeWNfmn+H7 github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced/go.mod h1:NCcRLrOTZbzhZvixZLlERbJtDtYsmMw8Jc4vS8Z0g58= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -497,8 +458,8 @@ github.com/moby/ipvs v1.0.1 h1:aoZ7fhLTXgDbzVrAnvV+XbKOU8kOET7B3+xULDF/1o0= github.com/moby/ipvs v1.0.1/go.mod h1:2pngiyseZbIKXNv7hsKj3O9UEz30c53MT9005gt2hxQ= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.4.0 h1:1KInV3Huv18akCu58V7lzNlt+jFmqlu1EaErnEHE/VM= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= +github.com/moby/sys/mountinfo v0.4.1 h1:1O+1cHA1aujwEwwVMa2Xm2l+gIpUHyd3+D+d7LZh1kM= +github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -519,39 +480,43 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mvdan/xurls v1.1.0/go.mod h1:tQlNn3BED8bE/15hnSL2HLkDeLWpNPAwtw7wkEq44oU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc93 h1:x2UMpOOVf3kQ8arv/EsDGwim8PTNqzL1/EYDr/+scOM= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= +github.com/opencontainers/runc v1.0.0-rc95 h1:RMuWVfY3E1ILlVsC3RhIq38n4sJtlOFwU9gfFZSqrd0= +github.com/opencontainers/runc v1.0.0-rc95/go.mod h1:z+bZxa/+Tz/FmYVWkhUajJdzFeOqjc5vrqskhVyHGUM= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d h1:pNa8metDkwZjb9g4T8s+krQ+HRgZAkqnXml+wNir/+s= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3snG66yBm59tKhhSPQrQ/0bCrv1LQbKt40LnUPiUxdc= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.0 h1:+77ba4ar4jsCbL1GLbFL8fFM57w6suPfSS9PDLDY7KM= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -575,8 +540,9 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -603,12 +569,12 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1 h1:NJjM5DNFOs0s3kYE1WUOr6G8V97sdt46rlXTMfXGWBo= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -644,14 +610,12 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/thecodeteam/goscaleio v0.1.0 h1:SB5tO98lawC+UK8ds/U2jyfOCH7GTcFztcF5x9gbut4= -github.com/thecodeteam/goscaleio v0.1.0/go.mod h1:68sdkZAsK8bvEwBlbQnlLS+xU+hvLYM/iQ8KXej1AwM= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -661,7 +625,6 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= @@ -683,9 +646,6 @@ go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489 h1:1JFLBqwIgdyHN1ZtgjTBwO+blA6gVOmZurpiMEsETKo= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -710,11 +670,8 @@ golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -765,7 +722,6 @@ golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hM golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -774,7 +730,6 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -795,6 +750,8 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -827,17 +784,16 @@ golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -846,6 +802,7 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -853,22 +810,23 @@ golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/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-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 h1:dXfMednGJh/SUUFjTLsWJz3P+TQt9qnR11GgeI3vWKs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= @@ -878,8 +836,9 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -892,7 +851,6 @@ golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -903,8 +861,6 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -1016,7 +972,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8X gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.0 h1:0HIbH907iBTAntm+88IJV2qmJALDAh8sPekI9Vc1fm0= gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= @@ -1038,8 +993,8 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/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= @@ -1057,59 +1012,59 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.0-alpha.1 h1:LuUYyELM7hm5I7B8pjn8dhZHQTcw86C/bFBNNu0/QoY= -k8s.io/api v0.22.0-alpha.1/go.mod h1:vQHAkhGeeRA6zI8QNe3tcuQqGXanfyk6mehgpyIHcpY= -k8s.io/apiextensions-apiserver v0.22.0-alpha.1/go.mod h1:CTqXHlfdBhzVb5XlYKBX99W8uPDk6kIj+4fwOofXq5o= -k8s.io/apimachinery v0.22.0-alpha.1 h1:5H8J1su7o60La1W4iOytFrsn2DeRxd9NXVxulXWOdOE= -k8s.io/apimachinery v0.22.0-alpha.1/go.mod h1:fBRSkoylGO2QUTae8Wb2wac6pZ83/r+tL6HFSXGbzfs= -k8s.io/apiserver v0.22.0-alpha.1 h1:1KEDWuHHLCbH+Q/qR8gZRCJdbmoEcRanjsvTvG/AAR0= -k8s.io/apiserver v0.22.0-alpha.1/go.mod h1:EBtDCYoV1+DxaNcB9OD61zUUyWlUaJ5a9CHwQKTD5Qg= -k8s.io/cli-runtime v0.22.0-alpha.1/go.mod h1:hAbdWeaJyja4PsFqgGoQT/JGmYFKd09bCU6h6F7ZpI8= -k8s.io/client-go v0.22.0-alpha.1 h1:RHT0MJXzZLwNhL8lluEko7zQ4n0fRn2TtmiZPiQI/fY= -k8s.io/client-go v0.22.0-alpha.1/go.mod h1:9onZcKpTRbDD0wiJC/T1toeVMYPyCQPgWHDn4xpQsHA= -k8s.io/cloud-provider v0.22.0-alpha.1 h1:vE5MNEDgVsWaFglmJE0axaH++Uae/vqwaGDmipIO/dQ= -k8s.io/cloud-provider v0.22.0-alpha.1/go.mod h1:cUGBYLml8bn4RknAgwXQw910xzwclIs0vmPI5HTV1YI= -k8s.io/cluster-bootstrap v0.22.0-alpha.1/go.mod h1:Nijrrjw05J+GtQCmW0wnYSqWoCMbVFbDSnVh2SB8U9k= -k8s.io/code-generator v0.22.0-alpha.1/go.mod h1:tHNeGA58jE3nJvZLDN0c/5k7P3NlYdjbWuJYK9QiU3s= -k8s.io/component-base v0.22.0-alpha.1 h1:X33MURXK6wXVMH4u28ckqXakOv1YBaB13FuPpUed8Y0= -k8s.io/component-base v0.22.0-alpha.1/go.mod h1:mglpF0fcNfkUMD+FaqSzEE/nop+WUlBrujXwYG5gthg= -k8s.io/component-helpers v0.22.0-alpha.1 h1:8ufrFeTCiRzHbQsvoZUO1MTkv+SK5l+SnnrvNrwm3kE= -k8s.io/component-helpers v0.22.0-alpha.1/go.mod h1:Du7D9KlzPvjXfWY7z58/pj2mYhQeu6yfz2Z16NjAJMs= -k8s.io/controller-manager v0.22.0-alpha.1/go.mod h1:3LoOmi7qe/dMhTgruY0iE8sYzMAq7sHwmPUYPKrKjW8= -k8s.io/cri-api v0.22.0-alpha.1 h1:wCHYU4INUMc4c93cZNjjMRYjrOC3dCOXk3doqBq4atQ= -k8s.io/cri-api v0.22.0-alpha.1/go.mod h1:9zj46jgx4C526EGuJx3lJvLk/YJsiXMsqimM7oOeVaY= -k8s.io/csi-translation-lib v0.22.0-alpha.1 h1:VD58o2JWFVRti8SMwBhFg1LGQt1nEMCGw6qVC/05qI4= -k8s.io/csi-translation-lib v0.22.0-alpha.1/go.mod h1:bf6KlUwPsvTsuj1i/ao/dLsdX0bmIG0dej1jmTXcUP8= +k8s.io/api v0.22.0-alpha.3 h1:rE7mI2nvuTyiSo3+C7iiVxWh1lmOqBTUVLloX+c9s4c= +k8s.io/api v0.22.0-alpha.3/go.mod h1:1XKmwk4lbdJRku2EqAElh5amCLsl9JvjSbQzUteQ1ac= +k8s.io/apiextensions-apiserver v0.22.0-alpha.3/go.mod h1:LdELmwoXLVdnTaWkQAvhP6NNmjZDbiU86Cl9uizIjOM= +k8s.io/apimachinery v0.22.0-alpha.3 h1:VIzKYyrRYpaPQDwhH6SZVy/04OR69ZKhovidSU+KjvY= +k8s.io/apimachinery v0.22.0-alpha.3/go.mod h1:5zcgojGmAy5Bo3S4mgZWAt6HwoKzaSh4MV3ITvlcOVM= +k8s.io/apiserver v0.22.0-alpha.3 h1:xcsUrEFSrN/u3MyIn3OK45fdMJwlmcvoD57FmWdQNSQ= +k8s.io/apiserver v0.22.0-alpha.3/go.mod h1:doQlHDHKpIHK6J/B8ERWxM7q0k3/dd+onnUpPaq8Ls8= +k8s.io/cli-runtime v0.22.0-alpha.3/go.mod h1:vlN/3GgRwydUHcTh2rH4/01wuOQrOBCuRx51V035y0k= +k8s.io/client-go v0.22.0-alpha.3 h1:kkvu6ggorI0tpU43aD9hRJZGhdC445d6RbMr0cb6HXY= +k8s.io/client-go v0.22.0-alpha.3/go.mod h1:ESvYVqJpwz3imRbIpr/eUZy20OaJ/TFene8F3ZTFtFY= +k8s.io/cloud-provider v0.22.0-alpha.3 h1:Tdw6HdvJqgllR3xoX9Pg9RxbXDRPntR5BALgDWW7Wy4= +k8s.io/cloud-provider v0.22.0-alpha.3/go.mod h1:vSb2HDvsKH335sOchf0rAynD1yLWKvQwIwyeX8Edqv0= +k8s.io/cluster-bootstrap v0.22.0-alpha.3/go.mod h1:EoRhJV7mutmGLtsfqJN+vnl6E34A6ZFSqA9kD8ZtfCw= +k8s.io/code-generator v0.22.0-alpha.3/go.mod h1:FSpIt1knsWe0QNfwrAq7+M1/AhwWXHWKjsbbfeeW+N4= +k8s.io/component-base v0.22.0-alpha.3 h1:2LkzKT/kOK2BArPE6E4GiaqQEHmUUqJOIzc+pw0y0pM= +k8s.io/component-base v0.22.0-alpha.3/go.mod h1:/uparSfFelitkoqeEEqpoJyJJMmc42rY3oJ7hNnQmzQ= +k8s.io/component-helpers v0.22.0-alpha.3 h1:vkyzAZSoFYe5BnZrQGhOkfFTkj3ISJVOsZnLsz9Vv3Q= +k8s.io/component-helpers v0.22.0-alpha.3/go.mod h1:21UmDnkTIFZV/lXWyG69N0OMVdza/QtdIGyayYJyWoA= +k8s.io/controller-manager v0.22.0-alpha.3/go.mod h1:DHADR6ytfFVL+UjOxSjZODjSv2mRiQ2oBBAcMUXUCJM= +k8s.io/cri-api v0.22.0-alpha.3 h1:83Agc7Dn/vcZ1KrDJGZ5YiabBe//UQwscC5g+WqhpYU= +k8s.io/cri-api v0.22.0-alpha.3/go.mod h1:ghgscVTPPM7yhyxA00ZgdNeX1JPnGC05fayZiNDC9qw= +k8s.io/csi-translation-lib v0.22.0-alpha.3 h1:C9j3mpzjiza/0xYJfSnAoUk3byT+FThfyPdd+ToZI2k= +k8s.io/csi-translation-lib v0.22.0-alpha.3/go.mod h1:rzrTyukePOFkWHjE/tLSPDfWBH8/SVve5i1NGiaBTMo= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/heapster v1.2.0-beta.1/go.mod h1:h1uhptVXMwC8xtZBYsPXKVi8fpdlYkTs6k949KozGrM= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-aggregator v0.22.0-alpha.1/go.mod h1:wEVaZtchAIkCavNYrz83/z39KUISsJd80eh9jyEhlh0= -k8s.io/kube-controller-manager v0.22.0-alpha.1/go.mod h1:WSvEur2WV7V6YU+Z1pO2v5TQ04M32vVzTVEh1JE3zGQ= +k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= +k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/kube-aggregator v0.22.0-alpha.3/go.mod h1:GvNK5/wxNqUQjKIOEjspoGSjH6d1xZJXqqhU+e0sJ5Q= +k8s.io/kube-controller-manager v0.22.0-alpha.3/go.mod h1:/UvxpHA1cNPZAHqEnDajm2rbVQo83o1cSGMy8+ACUHk= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-proxy v0.22.0-alpha.1 h1:8NRNfQraLRdwRzcmF7OIf5aY+04k54BFDBJmNwmrnQo= -k8s.io/kube-proxy v0.22.0-alpha.1/go.mod h1:r9Sk0UBefjXXfWZD6ReppotzMnyrSWPeus1hhZmN+jQ= -k8s.io/kube-scheduler v0.22.0-alpha.1 h1:0stphlaj66tYpFTdfyjaQY8C/Bvn7tjG70/+R5Bf/R4= -k8s.io/kube-scheduler v0.22.0-alpha.1/go.mod h1:BDbG/vXOcuUoV13aqP+Q0BNoEmTTbqWQwea1a6KABh0= -k8s.io/kubectl v0.22.0-alpha.1 h1:jG6k+5vjeEX7Iue8SjWXDOBbEmDuwzTRlZD0/wCSvn8= -k8s.io/kubectl v0.22.0-alpha.1/go.mod h1:kWcYWQs1XkM7Y2EvFJaeswhq2CQfJ28qUhFBdXC0Xjk= -k8s.io/kubelet v0.22.0-alpha.1 h1:Ln86e0mf+VCx4iIC6bMW75S7+n/cbHIIhxd7Wan6oII= -k8s.io/kubelet v0.22.0-alpha.1/go.mod h1:JmUEgOZaxdULOcR1gO87OyDJTWfBMsvoWat6YaZSRoc= -k8s.io/kubernetes v1.22.0-alpha.1 h1:tMDxJBrbwsbhnmWL9ovCG6tzNtIJZwXsrJtNPSiGHrU= -k8s.io/kubernetes v1.22.0-alpha.1/go.mod h1:Exr4czZFzGgO6m7eSrRcnJ+9oU20nk79/70jbYDMWFI= -k8s.io/legacy-cloud-providers v0.22.0-alpha.1 h1:zXfiLPppxSGgDh2HZr76sqrmj8XJPcPxr9UFses63aw= -k8s.io/legacy-cloud-providers v0.22.0-alpha.1/go.mod h1:E7daTU5Rozx6HR7JcffGe/3Kiozt907jNiWwzuzJSDM= -k8s.io/metrics v0.22.0-alpha.1/go.mod h1:sr4On/UmHn4pxvTGlLbd1k8ZIf2p3Nmgu/l1greLcaA= -k8s.io/mount-utils v0.22.0-alpha.1 h1:+gdD2K2lKFdvhjqDOPIfKGzaZ7AfQ2y7eOfyPu/prpI= -k8s.io/mount-utils v0.22.0-alpha.1/go.mod h1:cZkyEGfqT7U10Wby27fOGpgjS82N+dyhng5OtRk3qoo= -k8s.io/sample-apiserver v0.22.0-alpha.1/go.mod h1:jEdF6mOYZZixQabD8h5H+j69FQe6DlVo+Jlr4VrbExA= +k8s.io/kube-proxy v0.22.0-alpha.3 h1:devRLMVpiwBs9rU3ZsL12tkiHkK2Db3tAeeHpjnBULQ= +k8s.io/kube-proxy v0.22.0-alpha.3/go.mod h1:D5JZAYjcQveInm108JIFMpQR14DJDHsuoaoKmtD7f0U= +k8s.io/kube-scheduler v0.22.0-alpha.3 h1:vsicj79CVNbjPG9zDRv7ZyjUXf+OX6wefpGn/LI07ig= +k8s.io/kube-scheduler v0.22.0-alpha.3/go.mod h1:30hb9bDYrKr70VpyOa9ijxV/decunuok7xtX0nVfq2I= +k8s.io/kubectl v0.22.0-alpha.3 h1:nXsB7dyMLFXnw+IWm4LoyXLUGaqw/0EMdODOvY4JfFk= +k8s.io/kubectl v0.22.0-alpha.3/go.mod h1:u036CbWS9qdsfu7FFLFJ1hPqZ15eivF4FZaKnMEK3ic= +k8s.io/kubelet v0.22.0-alpha.3 h1:2r8g4Tvqoz0f/BhQg6DiXBLhy8GoesuEFfwRWs+5+bI= +k8s.io/kubelet v0.22.0-alpha.3/go.mod h1:dr4AmkEHtUTtw3rbCJv44wsmW279htOEdTT/vsyLzEE= +k8s.io/kubernetes v1.22.0-alpha.3 h1:qxh3SNSAJgnKc009MsdBBuBH6RxfZERLVw6+lpfPqQ0= +k8s.io/kubernetes v1.22.0-alpha.3/go.mod h1:rapWw7YyYSxlvWmuma/fvGwGQOGVHTGR86jUp7DadxY= +k8s.io/legacy-cloud-providers v0.22.0-alpha.3 h1:8Jv9Bd4WJRilhy9UZGRrZmIXLf0VnI4MuvjfRGUzNXw= +k8s.io/legacy-cloud-providers v0.22.0-alpha.3/go.mod h1:aY5r6gn4Tjp3f8VQhllrQV9U4eX4BFzT0iI1MP2J3vo= +k8s.io/metrics v0.22.0-alpha.3/go.mod h1:DY5svwVJAqf8t5E/svWHLUv4hwv8Z5NE2lmtDEgH/GI= +k8s.io/mount-utils v0.22.0-alpha.3 h1:H8aNm5vbmrBhA9+wxVl/HfOMqSCMW4gy5Wp5RhWQ2qo= +k8s.io/mount-utils v0.22.0-alpha.3/go.mod h1:w7uswZidAfPsX5bpBbv8eGByzO1nPSz0aCTEbo7SL+Q= +k8s.io/sample-apiserver v0.22.0-alpha.3/go.mod h1:zj9mnpJvhHKX7a+5fJS4ryjMVnGZxIs+JlAx67KmSNA= k8s.io/system-validators v1.4.0/go.mod h1:bPldcLgkIUK22ALflnsXk8pvkTEndYdNuaHH6gRrl0Q= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210521133846-da695404a2bc h1:dx6VGe+PnOW/kD/2UV4aUSsRfJGd7+lcqgJ6Xg0HwUs= +k8s.io/utils v0.0.0-20210521133846-da695404a2bc/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -1119,12 +1074,12 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15 h1:4uqm9Mv+w2MmBYD+F4qf/v6tDFUdPOk29C095RbU5mY= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/kustomize/api v0.8.8/go.mod h1:He1zoK0nk43Pc6NlV085xDXDXTNprtcyKZVm3swsdNY= -sigs.k8s.io/kustomize/cmd/config v0.9.10/go.mod h1:Mrby0WnRH7hA6OwOYnYpfpiY0WJIMgYrEDfwOeFdMK0= -sigs.k8s.io/kustomize/kustomize/v4 v4.1.2/go.mod h1:PxBvo4WGYlCLeRPL+ziT64wBXqbgfcalOS/SXa/tcyo= -sigs.k8s.io/kustomize/kyaml v0.10.17/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19 h1:0jaDAAxtqIrrqas4vtTqxct4xS5kHfRNycTRLTyJmVM= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/kustomize/api v0.8.10/go.mod h1:ImeIkhUU7GIhamOtKPlkllt+fkBKL5f6/4NLhVwkinA= +sigs.k8s.io/kustomize/cmd/config v0.9.12/go.mod h1:hVG/nPSqccrnogZ4ehzw3cTSR2fT6hdWeyojILHZivA= +sigs.k8s.io/kustomize/kustomize/v4 v4.1.3/go.mod h1:Zw+pVPW6cHyb0zkOb24HU6NjJziqPY/abiiVLQVrzp4= +sigs.k8s.io/kustomize/kyaml v0.10.20/go.mod h1:TYWhGwW9vjoRh3rWqBwB/ZOXyEGRVWe7Ggc3+KZIO+c= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.1 h1:nYqY2A6oy37sKLYuSBXuQhbj4JVclzJK13BOIvJG5XU= sigs.k8s.io/structured-merge-diff/v4 v4.1.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= diff --git a/cluster-autoscaler/simulator/scheduler_based_predicates_checker.go b/cluster-autoscaler/simulator/scheduler_based_predicates_checker.go index ba7a1191151d..85c711666b25 100644 --- a/cluster-autoscaler/simulator/scheduler_based_predicates_checker.go +++ b/cluster-autoscaler/simulator/scheduler_based_predicates_checker.go @@ -47,8 +47,7 @@ type SchedulerBasedPredicateChecker struct { // NewSchedulerBasedPredicateChecker builds scheduler based PredicateChecker. func NewSchedulerBasedPredicateChecker(kubeClient kube_client.Interface, stop <-chan struct{}) (*SchedulerBasedPredicateChecker, error) { informerFactory := informers.NewSharedInformerFactory(kubeClient, 0) - providerRegistry := algorithmprovider.NewRegistry() - plugins := providerRegistry[scheduler_apis_config.SchedulerDefaultProviderName] + plugins := algorithmprovider.GetDefaultConfig() sharedLister := NewDelegatingSchedulerSharedLister() kubeSchedulerProfile := &scheduler_apis_config.KubeSchedulerProfile{ Plugins: plugins, diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/.travis.yml b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/.travis.yml deleted file mode 100644 index 85e0cde3790a..000000000000 --- a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: go -dist: bionic -os: - - linux -go: - - "1.14.x" - - "1.13.x" - - tip -env: - # Run the tests with CRIU master and criu-dev - - CRIU_BRANCH="master" - - CRIU_BRANCH="criu-dev" -install: - - sudo apt-get update - - sudo apt-get install -y libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libnet-dev libcap-dev - - make install.tools - - go get github.com/checkpoint-restore/go-criu - - git clone --single-branch -b ${CRIU_BRANCH} https://github.com/checkpoint-restore/criu.git - - cd criu; make - - sudo install -D -m 755 criu/criu /usr/sbin/ - - cd .. -script: - # This builds the code without running the tests. - - make lint build phaul test/test test/phaul test/piggie - # Run actual test as root as it uses CRIU. - - sudo make test phaul-test - # This builds crit-go - - make -C crit-go/magic-gen lint build magicgen test diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/Makefile b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/Makefile deleted file mode 100644 index 10356304b1f0..000000000000 --- a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -GO ?= go -CC ?= gcc -ifeq ($(GOPATH),) -export GOPATH := $(shell $(GO) env GOPATH) -endif -FIRST_GOPATH := $(firstword $(subst :, ,$(GOPATH))) -GOBIN := $(shell $(GO) env GOBIN) -ifeq ($(GOBIN),) - GOBIN := $(FIRST_GOPATH)/bin -endif - -all: build test phaul phaul-test - -lint: - @golint -set_exit_status . test phaul -build: - @$(GO) build -v - -test/piggie: test/piggie.c - @$(CC) $^ -o $@ - -test/test: test/main.go - @$(GO) build -v -o test/test test/main.go - -test: test/test test/piggie - mkdir -p image - test/piggie - test/test dump `pidof piggie` image - test/test restore image - pkill -9 piggie || : - -phaul: - @cd phaul; go build -v - -test/phaul: test/phaul-main.go - @$(GO) build -v -o test/phaul test/phaul-main.go - -phaul-test: test/phaul test/piggie - rm -rf image - test/piggie - test/phaul `pidof piggie` - pkill -9 piggie || : - -clean: - @rm -f test/test test/piggie test/phaul - @rm -rf image - @rm -f rpc/rpc.proto - -install.tools: - if [ ! -x "$(GOBIN)/golint" ]; then \ - $(GO) get -u golang.org/x/lint/golint; \ - fi - -rpc/rpc.proto: - curl -s https://raw.githubusercontent.com/checkpoint-restore/criu/master/images/rpc.proto -o $@ - -rpc/rpc.pb.go: rpc/rpc.proto - protoc --go_out=. $^ - -.PHONY: build test clean lint phaul diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/go.mod b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/go.mod deleted file mode 100644 index 4966669068f4..000000000000 --- a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/checkpoint-restore/go-criu/v4 - -go 1.13 - -require github.com/golang/protobuf v1.3.5 diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/go.sum b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/go.sum deleted file mode 100644 index 6124ed3e451b..000000000000 --- a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/rpc/rpc.pb.go b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/rpc/rpc.pb.go deleted file mode 100644 index f9baece4edbf..000000000000 --- a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/rpc/rpc.pb.go +++ /dev/null @@ -1,1667 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: rpc/rpc.proto - -package rpc - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type CriuCgMode int32 - -const ( - CriuCgMode_IGNORE CriuCgMode = 0 - CriuCgMode_CG_NONE CriuCgMode = 1 - CriuCgMode_PROPS CriuCgMode = 2 - CriuCgMode_SOFT CriuCgMode = 3 - CriuCgMode_FULL CriuCgMode = 4 - CriuCgMode_STRICT CriuCgMode = 5 - CriuCgMode_DEFAULT CriuCgMode = 6 -) - -var CriuCgMode_name = map[int32]string{ - 0: "IGNORE", - 1: "CG_NONE", - 2: "PROPS", - 3: "SOFT", - 4: "FULL", - 5: "STRICT", - 6: "DEFAULT", -} - -var CriuCgMode_value = map[string]int32{ - "IGNORE": 0, - "CG_NONE": 1, - "PROPS": 2, - "SOFT": 3, - "FULL": 4, - "STRICT": 5, - "DEFAULT": 6, -} - -func (x CriuCgMode) Enum() *CriuCgMode { - p := new(CriuCgMode) - *p = x - return p -} - -func (x CriuCgMode) String() string { - return proto.EnumName(CriuCgMode_name, int32(x)) -} - -func (x *CriuCgMode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CriuCgMode_value, data, "CriuCgMode") - if err != nil { - return err - } - *x = CriuCgMode(value) - return nil -} - -func (CriuCgMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{0} -} - -type CriuPreDumpMode int32 - -const ( - CriuPreDumpMode_SPLICE CriuPreDumpMode = 1 - CriuPreDumpMode_VM_READ CriuPreDumpMode = 2 -) - -var CriuPreDumpMode_name = map[int32]string{ - 1: "SPLICE", - 2: "VM_READ", -} - -var CriuPreDumpMode_value = map[string]int32{ - "SPLICE": 1, - "VM_READ": 2, -} - -func (x CriuPreDumpMode) Enum() *CriuPreDumpMode { - p := new(CriuPreDumpMode) - *p = x - return p -} - -func (x CriuPreDumpMode) String() string { - return proto.EnumName(CriuPreDumpMode_name, int32(x)) -} - -func (x *CriuPreDumpMode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CriuPreDumpMode_value, data, "CriuPreDumpMode") - if err != nil { - return err - } - *x = CriuPreDumpMode(value) - return nil -} - -func (CriuPreDumpMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{1} -} - -type CriuReqType int32 - -const ( - CriuReqType_EMPTY CriuReqType = 0 - CriuReqType_DUMP CriuReqType = 1 - CriuReqType_RESTORE CriuReqType = 2 - CriuReqType_CHECK CriuReqType = 3 - CriuReqType_PRE_DUMP CriuReqType = 4 - CriuReqType_PAGE_SERVER CriuReqType = 5 - CriuReqType_NOTIFY CriuReqType = 6 - CriuReqType_CPUINFO_DUMP CriuReqType = 7 - CriuReqType_CPUINFO_CHECK CriuReqType = 8 - CriuReqType_FEATURE_CHECK CriuReqType = 9 - CriuReqType_VERSION CriuReqType = 10 - CriuReqType_WAIT_PID CriuReqType = 11 - CriuReqType_PAGE_SERVER_CHLD CriuReqType = 12 -) - -var CriuReqType_name = map[int32]string{ - 0: "EMPTY", - 1: "DUMP", - 2: "RESTORE", - 3: "CHECK", - 4: "PRE_DUMP", - 5: "PAGE_SERVER", - 6: "NOTIFY", - 7: "CPUINFO_DUMP", - 8: "CPUINFO_CHECK", - 9: "FEATURE_CHECK", - 10: "VERSION", - 11: "WAIT_PID", - 12: "PAGE_SERVER_CHLD", -} - -var CriuReqType_value = map[string]int32{ - "EMPTY": 0, - "DUMP": 1, - "RESTORE": 2, - "CHECK": 3, - "PRE_DUMP": 4, - "PAGE_SERVER": 5, - "NOTIFY": 6, - "CPUINFO_DUMP": 7, - "CPUINFO_CHECK": 8, - "FEATURE_CHECK": 9, - "VERSION": 10, - "WAIT_PID": 11, - "PAGE_SERVER_CHLD": 12, -} - -func (x CriuReqType) Enum() *CriuReqType { - p := new(CriuReqType) - *p = x - return p -} - -func (x CriuReqType) String() string { - return proto.EnumName(CriuReqType_name, int32(x)) -} - -func (x *CriuReqType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CriuReqType_value, data, "CriuReqType") - if err != nil { - return err - } - *x = CriuReqType(value) - return nil -} - -func (CriuReqType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{2} -} - -type CriuPageServerInfo struct { - Address *string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` - Port *int32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"` - Pid *int32 `protobuf:"varint,3,opt,name=pid" json:"pid,omitempty"` - Fd *int32 `protobuf:"varint,4,opt,name=fd" json:"fd,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuPageServerInfo) Reset() { *m = CriuPageServerInfo{} } -func (m *CriuPageServerInfo) String() string { return proto.CompactTextString(m) } -func (*CriuPageServerInfo) ProtoMessage() {} -func (*CriuPageServerInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{0} -} - -func (m *CriuPageServerInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuPageServerInfo.Unmarshal(m, b) -} -func (m *CriuPageServerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuPageServerInfo.Marshal(b, m, deterministic) -} -func (m *CriuPageServerInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuPageServerInfo.Merge(m, src) -} -func (m *CriuPageServerInfo) XXX_Size() int { - return xxx_messageInfo_CriuPageServerInfo.Size(m) -} -func (m *CriuPageServerInfo) XXX_DiscardUnknown() { - xxx_messageInfo_CriuPageServerInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuPageServerInfo proto.InternalMessageInfo - -func (m *CriuPageServerInfo) GetAddress() string { - if m != nil && m.Address != nil { - return *m.Address - } - return "" -} - -func (m *CriuPageServerInfo) GetPort() int32 { - if m != nil && m.Port != nil { - return *m.Port - } - return 0 -} - -func (m *CriuPageServerInfo) GetPid() int32 { - if m != nil && m.Pid != nil { - return *m.Pid - } - return 0 -} - -func (m *CriuPageServerInfo) GetFd() int32 { - if m != nil && m.Fd != nil { - return *m.Fd - } - return 0 -} - -type CriuVethPair struct { - IfIn *string `protobuf:"bytes,1,req,name=if_in,json=ifIn" json:"if_in,omitempty"` - IfOut *string `protobuf:"bytes,2,req,name=if_out,json=ifOut" json:"if_out,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuVethPair) Reset() { *m = CriuVethPair{} } -func (m *CriuVethPair) String() string { return proto.CompactTextString(m) } -func (*CriuVethPair) ProtoMessage() {} -func (*CriuVethPair) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{1} -} - -func (m *CriuVethPair) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuVethPair.Unmarshal(m, b) -} -func (m *CriuVethPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuVethPair.Marshal(b, m, deterministic) -} -func (m *CriuVethPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuVethPair.Merge(m, src) -} -func (m *CriuVethPair) XXX_Size() int { - return xxx_messageInfo_CriuVethPair.Size(m) -} -func (m *CriuVethPair) XXX_DiscardUnknown() { - xxx_messageInfo_CriuVethPair.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuVethPair proto.InternalMessageInfo - -func (m *CriuVethPair) GetIfIn() string { - if m != nil && m.IfIn != nil { - return *m.IfIn - } - return "" -} - -func (m *CriuVethPair) GetIfOut() string { - if m != nil && m.IfOut != nil { - return *m.IfOut - } - return "" -} - -type ExtMountMap struct { - Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` - Val *string `protobuf:"bytes,2,req,name=val" json:"val,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExtMountMap) Reset() { *m = ExtMountMap{} } -func (m *ExtMountMap) String() string { return proto.CompactTextString(m) } -func (*ExtMountMap) ProtoMessage() {} -func (*ExtMountMap) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{2} -} - -func (m *ExtMountMap) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtMountMap.Unmarshal(m, b) -} -func (m *ExtMountMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtMountMap.Marshal(b, m, deterministic) -} -func (m *ExtMountMap) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtMountMap.Merge(m, src) -} -func (m *ExtMountMap) XXX_Size() int { - return xxx_messageInfo_ExtMountMap.Size(m) -} -func (m *ExtMountMap) XXX_DiscardUnknown() { - xxx_messageInfo_ExtMountMap.DiscardUnknown(m) -} - -var xxx_messageInfo_ExtMountMap proto.InternalMessageInfo - -func (m *ExtMountMap) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *ExtMountMap) GetVal() string { - if m != nil && m.Val != nil { - return *m.Val - } - return "" -} - -type JoinNamespace struct { - Ns *string `protobuf:"bytes,1,req,name=ns" json:"ns,omitempty"` - NsFile *string `protobuf:"bytes,2,req,name=ns_file,json=nsFile" json:"ns_file,omitempty"` - ExtraOpt *string `protobuf:"bytes,3,opt,name=extra_opt,json=extraOpt" json:"extra_opt,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *JoinNamespace) Reset() { *m = JoinNamespace{} } -func (m *JoinNamespace) String() string { return proto.CompactTextString(m) } -func (*JoinNamespace) ProtoMessage() {} -func (*JoinNamespace) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{3} -} - -func (m *JoinNamespace) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_JoinNamespace.Unmarshal(m, b) -} -func (m *JoinNamespace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_JoinNamespace.Marshal(b, m, deterministic) -} -func (m *JoinNamespace) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinNamespace.Merge(m, src) -} -func (m *JoinNamespace) XXX_Size() int { - return xxx_messageInfo_JoinNamespace.Size(m) -} -func (m *JoinNamespace) XXX_DiscardUnknown() { - xxx_messageInfo_JoinNamespace.DiscardUnknown(m) -} - -var xxx_messageInfo_JoinNamespace proto.InternalMessageInfo - -func (m *JoinNamespace) GetNs() string { - if m != nil && m.Ns != nil { - return *m.Ns - } - return "" -} - -func (m *JoinNamespace) GetNsFile() string { - if m != nil && m.NsFile != nil { - return *m.NsFile - } - return "" -} - -func (m *JoinNamespace) GetExtraOpt() string { - if m != nil && m.ExtraOpt != nil { - return *m.ExtraOpt - } - return "" -} - -type InheritFd struct { - Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` - Fd *int32 `protobuf:"varint,2,req,name=fd" json:"fd,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InheritFd) Reset() { *m = InheritFd{} } -func (m *InheritFd) String() string { return proto.CompactTextString(m) } -func (*InheritFd) ProtoMessage() {} -func (*InheritFd) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{4} -} - -func (m *InheritFd) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InheritFd.Unmarshal(m, b) -} -func (m *InheritFd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InheritFd.Marshal(b, m, deterministic) -} -func (m *InheritFd) XXX_Merge(src proto.Message) { - xxx_messageInfo_InheritFd.Merge(m, src) -} -func (m *InheritFd) XXX_Size() int { - return xxx_messageInfo_InheritFd.Size(m) -} -func (m *InheritFd) XXX_DiscardUnknown() { - xxx_messageInfo_InheritFd.DiscardUnknown(m) -} - -var xxx_messageInfo_InheritFd proto.InternalMessageInfo - -func (m *InheritFd) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *InheritFd) GetFd() int32 { - if m != nil && m.Fd != nil { - return *m.Fd - } - return 0 -} - -type CgroupRoot struct { - Ctrl *string `protobuf:"bytes,1,opt,name=ctrl" json:"ctrl,omitempty"` - Path *string `protobuf:"bytes,2,req,name=path" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CgroupRoot) Reset() { *m = CgroupRoot{} } -func (m *CgroupRoot) String() string { return proto.CompactTextString(m) } -func (*CgroupRoot) ProtoMessage() {} -func (*CgroupRoot) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{5} -} - -func (m *CgroupRoot) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CgroupRoot.Unmarshal(m, b) -} -func (m *CgroupRoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CgroupRoot.Marshal(b, m, deterministic) -} -func (m *CgroupRoot) XXX_Merge(src proto.Message) { - xxx_messageInfo_CgroupRoot.Merge(m, src) -} -func (m *CgroupRoot) XXX_Size() int { - return xxx_messageInfo_CgroupRoot.Size(m) -} -func (m *CgroupRoot) XXX_DiscardUnknown() { - xxx_messageInfo_CgroupRoot.DiscardUnknown(m) -} - -var xxx_messageInfo_CgroupRoot proto.InternalMessageInfo - -func (m *CgroupRoot) GetCtrl() string { - if m != nil && m.Ctrl != nil { - return *m.Ctrl - } - return "" -} - -func (m *CgroupRoot) GetPath() string { - if m != nil && m.Path != nil { - return *m.Path - } - return "" -} - -type UnixSk struct { - Inode *uint32 `protobuf:"varint,1,req,name=inode" json:"inode,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UnixSk) Reset() { *m = UnixSk{} } -func (m *UnixSk) String() string { return proto.CompactTextString(m) } -func (*UnixSk) ProtoMessage() {} -func (*UnixSk) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{6} -} - -func (m *UnixSk) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UnixSk.Unmarshal(m, b) -} -func (m *UnixSk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UnixSk.Marshal(b, m, deterministic) -} -func (m *UnixSk) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnixSk.Merge(m, src) -} -func (m *UnixSk) XXX_Size() int { - return xxx_messageInfo_UnixSk.Size(m) -} -func (m *UnixSk) XXX_DiscardUnknown() { - xxx_messageInfo_UnixSk.DiscardUnknown(m) -} - -var xxx_messageInfo_UnixSk proto.InternalMessageInfo - -func (m *UnixSk) GetInode() uint32 { - if m != nil && m.Inode != nil { - return *m.Inode - } - return 0 -} - -type CriuOpts struct { - ImagesDirFd *int32 `protobuf:"varint,1,req,name=images_dir_fd,json=imagesDirFd" json:"images_dir_fd,omitempty"` - Pid *int32 `protobuf:"varint,2,opt,name=pid" json:"pid,omitempty"` - LeaveRunning *bool `protobuf:"varint,3,opt,name=leave_running,json=leaveRunning" json:"leave_running,omitempty"` - ExtUnixSk *bool `protobuf:"varint,4,opt,name=ext_unix_sk,json=extUnixSk" json:"ext_unix_sk,omitempty"` - TcpEstablished *bool `protobuf:"varint,5,opt,name=tcp_established,json=tcpEstablished" json:"tcp_established,omitempty"` - EvasiveDevices *bool `protobuf:"varint,6,opt,name=evasive_devices,json=evasiveDevices" json:"evasive_devices,omitempty"` - ShellJob *bool `protobuf:"varint,7,opt,name=shell_job,json=shellJob" json:"shell_job,omitempty"` - FileLocks *bool `protobuf:"varint,8,opt,name=file_locks,json=fileLocks" json:"file_locks,omitempty"` - LogLevel *int32 `protobuf:"varint,9,opt,name=log_level,json=logLevel,def=2" json:"log_level,omitempty"` - LogFile *string `protobuf:"bytes,10,opt,name=log_file,json=logFile" json:"log_file,omitempty"` - Ps *CriuPageServerInfo `protobuf:"bytes,11,opt,name=ps" json:"ps,omitempty"` - NotifyScripts *bool `protobuf:"varint,12,opt,name=notify_scripts,json=notifyScripts" json:"notify_scripts,omitempty"` - Root *string `protobuf:"bytes,13,opt,name=root" json:"root,omitempty"` - ParentImg *string `protobuf:"bytes,14,opt,name=parent_img,json=parentImg" json:"parent_img,omitempty"` - TrackMem *bool `protobuf:"varint,15,opt,name=track_mem,json=trackMem" json:"track_mem,omitempty"` - AutoDedup *bool `protobuf:"varint,16,opt,name=auto_dedup,json=autoDedup" json:"auto_dedup,omitempty"` - WorkDirFd *int32 `protobuf:"varint,17,opt,name=work_dir_fd,json=workDirFd" json:"work_dir_fd,omitempty"` - LinkRemap *bool `protobuf:"varint,18,opt,name=link_remap,json=linkRemap" json:"link_remap,omitempty"` - Veths []*CriuVethPair `protobuf:"bytes,19,rep,name=veths" json:"veths,omitempty"` - CpuCap *uint32 `protobuf:"varint,20,opt,name=cpu_cap,json=cpuCap,def=4294967295" json:"cpu_cap,omitempty"` - ForceIrmap *bool `protobuf:"varint,21,opt,name=force_irmap,json=forceIrmap" json:"force_irmap,omitempty"` - ExecCmd []string `protobuf:"bytes,22,rep,name=exec_cmd,json=execCmd" json:"exec_cmd,omitempty"` - ExtMnt []*ExtMountMap `protobuf:"bytes,23,rep,name=ext_mnt,json=extMnt" json:"ext_mnt,omitempty"` - ManageCgroups *bool `protobuf:"varint,24,opt,name=manage_cgroups,json=manageCgroups" json:"manage_cgroups,omitempty"` - CgRoot []*CgroupRoot `protobuf:"bytes,25,rep,name=cg_root,json=cgRoot" json:"cg_root,omitempty"` - RstSibling *bool `protobuf:"varint,26,opt,name=rst_sibling,json=rstSibling" json:"rst_sibling,omitempty"` - InheritFd []*InheritFd `protobuf:"bytes,27,rep,name=inherit_fd,json=inheritFd" json:"inherit_fd,omitempty"` - AutoExtMnt *bool `protobuf:"varint,28,opt,name=auto_ext_mnt,json=autoExtMnt" json:"auto_ext_mnt,omitempty"` - ExtSharing *bool `protobuf:"varint,29,opt,name=ext_sharing,json=extSharing" json:"ext_sharing,omitempty"` - ExtMasters *bool `protobuf:"varint,30,opt,name=ext_masters,json=extMasters" json:"ext_masters,omitempty"` - SkipMnt []string `protobuf:"bytes,31,rep,name=skip_mnt,json=skipMnt" json:"skip_mnt,omitempty"` - EnableFs []string `protobuf:"bytes,32,rep,name=enable_fs,json=enableFs" json:"enable_fs,omitempty"` - UnixSkIno []*UnixSk `protobuf:"bytes,33,rep,name=unix_sk_ino,json=unixSkIno" json:"unix_sk_ino,omitempty"` - ManageCgroupsMode *CriuCgMode `protobuf:"varint,34,opt,name=manage_cgroups_mode,json=manageCgroupsMode,enum=CriuCgMode" json:"manage_cgroups_mode,omitempty"` - GhostLimit *uint32 `protobuf:"varint,35,opt,name=ghost_limit,json=ghostLimit,def=1048576" json:"ghost_limit,omitempty"` - IrmapScanPaths []string `protobuf:"bytes,36,rep,name=irmap_scan_paths,json=irmapScanPaths" json:"irmap_scan_paths,omitempty"` - External []string `protobuf:"bytes,37,rep,name=external" json:"external,omitempty"` - EmptyNs *uint32 `protobuf:"varint,38,opt,name=empty_ns,json=emptyNs" json:"empty_ns,omitempty"` - JoinNs []*JoinNamespace `protobuf:"bytes,39,rep,name=join_ns,json=joinNs" json:"join_ns,omitempty"` - CgroupProps *string `protobuf:"bytes,41,opt,name=cgroup_props,json=cgroupProps" json:"cgroup_props,omitempty"` - CgroupPropsFile *string `protobuf:"bytes,42,opt,name=cgroup_props_file,json=cgroupPropsFile" json:"cgroup_props_file,omitempty"` - CgroupDumpController []string `protobuf:"bytes,43,rep,name=cgroup_dump_controller,json=cgroupDumpController" json:"cgroup_dump_controller,omitempty"` - FreezeCgroup *string `protobuf:"bytes,44,opt,name=freeze_cgroup,json=freezeCgroup" json:"freeze_cgroup,omitempty"` - Timeout *uint32 `protobuf:"varint,45,opt,name=timeout" json:"timeout,omitempty"` - TcpSkipInFlight *bool `protobuf:"varint,46,opt,name=tcp_skip_in_flight,json=tcpSkipInFlight" json:"tcp_skip_in_flight,omitempty"` - WeakSysctls *bool `protobuf:"varint,47,opt,name=weak_sysctls,json=weakSysctls" json:"weak_sysctls,omitempty"` - LazyPages *bool `protobuf:"varint,48,opt,name=lazy_pages,json=lazyPages" json:"lazy_pages,omitempty"` - StatusFd *int32 `protobuf:"varint,49,opt,name=status_fd,json=statusFd" json:"status_fd,omitempty"` - OrphanPtsMaster *bool `protobuf:"varint,50,opt,name=orphan_pts_master,json=orphanPtsMaster" json:"orphan_pts_master,omitempty"` - ConfigFile *string `protobuf:"bytes,51,opt,name=config_file,json=configFile" json:"config_file,omitempty"` - TcpClose *bool `protobuf:"varint,52,opt,name=tcp_close,json=tcpClose" json:"tcp_close,omitempty"` - LsmProfile *string `protobuf:"bytes,53,opt,name=lsm_profile,json=lsmProfile" json:"lsm_profile,omitempty"` - TlsCacert *string `protobuf:"bytes,54,opt,name=tls_cacert,json=tlsCacert" json:"tls_cacert,omitempty"` - TlsCacrl *string `protobuf:"bytes,55,opt,name=tls_cacrl,json=tlsCacrl" json:"tls_cacrl,omitempty"` - TlsCert *string `protobuf:"bytes,56,opt,name=tls_cert,json=tlsCert" json:"tls_cert,omitempty"` - TlsKey *string `protobuf:"bytes,57,opt,name=tls_key,json=tlsKey" json:"tls_key,omitempty"` - Tls *bool `protobuf:"varint,58,opt,name=tls" json:"tls,omitempty"` - TlsNoCnVerify *bool `protobuf:"varint,59,opt,name=tls_no_cn_verify,json=tlsNoCnVerify" json:"tls_no_cn_verify,omitempty"` - CgroupYard *string `protobuf:"bytes,60,opt,name=cgroup_yard,json=cgroupYard" json:"cgroup_yard,omitempty"` - PreDumpMode *CriuPreDumpMode `protobuf:"varint,61,opt,name=pre_dump_mode,json=preDumpMode,enum=CriuPreDumpMode,def=1" json:"pre_dump_mode,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuOpts) Reset() { *m = CriuOpts{} } -func (m *CriuOpts) String() string { return proto.CompactTextString(m) } -func (*CriuOpts) ProtoMessage() {} -func (*CriuOpts) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{7} -} - -func (m *CriuOpts) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuOpts.Unmarshal(m, b) -} -func (m *CriuOpts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuOpts.Marshal(b, m, deterministic) -} -func (m *CriuOpts) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuOpts.Merge(m, src) -} -func (m *CriuOpts) XXX_Size() int { - return xxx_messageInfo_CriuOpts.Size(m) -} -func (m *CriuOpts) XXX_DiscardUnknown() { - xxx_messageInfo_CriuOpts.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuOpts proto.InternalMessageInfo - -const Default_CriuOpts_LogLevel int32 = 2 -const Default_CriuOpts_CpuCap uint32 = 4294967295 -const Default_CriuOpts_GhostLimit uint32 = 1048576 -const Default_CriuOpts_PreDumpMode CriuPreDumpMode = CriuPreDumpMode_SPLICE - -func (m *CriuOpts) GetImagesDirFd() int32 { - if m != nil && m.ImagesDirFd != nil { - return *m.ImagesDirFd - } - return 0 -} - -func (m *CriuOpts) GetPid() int32 { - if m != nil && m.Pid != nil { - return *m.Pid - } - return 0 -} - -func (m *CriuOpts) GetLeaveRunning() bool { - if m != nil && m.LeaveRunning != nil { - return *m.LeaveRunning - } - return false -} - -func (m *CriuOpts) GetExtUnixSk() bool { - if m != nil && m.ExtUnixSk != nil { - return *m.ExtUnixSk - } - return false -} - -func (m *CriuOpts) GetTcpEstablished() bool { - if m != nil && m.TcpEstablished != nil { - return *m.TcpEstablished - } - return false -} - -func (m *CriuOpts) GetEvasiveDevices() bool { - if m != nil && m.EvasiveDevices != nil { - return *m.EvasiveDevices - } - return false -} - -func (m *CriuOpts) GetShellJob() bool { - if m != nil && m.ShellJob != nil { - return *m.ShellJob - } - return false -} - -func (m *CriuOpts) GetFileLocks() bool { - if m != nil && m.FileLocks != nil { - return *m.FileLocks - } - return false -} - -func (m *CriuOpts) GetLogLevel() int32 { - if m != nil && m.LogLevel != nil { - return *m.LogLevel - } - return Default_CriuOpts_LogLevel -} - -func (m *CriuOpts) GetLogFile() string { - if m != nil && m.LogFile != nil { - return *m.LogFile - } - return "" -} - -func (m *CriuOpts) GetPs() *CriuPageServerInfo { - if m != nil { - return m.Ps - } - return nil -} - -func (m *CriuOpts) GetNotifyScripts() bool { - if m != nil && m.NotifyScripts != nil { - return *m.NotifyScripts - } - return false -} - -func (m *CriuOpts) GetRoot() string { - if m != nil && m.Root != nil { - return *m.Root - } - return "" -} - -func (m *CriuOpts) GetParentImg() string { - if m != nil && m.ParentImg != nil { - return *m.ParentImg - } - return "" -} - -func (m *CriuOpts) GetTrackMem() bool { - if m != nil && m.TrackMem != nil { - return *m.TrackMem - } - return false -} - -func (m *CriuOpts) GetAutoDedup() bool { - if m != nil && m.AutoDedup != nil { - return *m.AutoDedup - } - return false -} - -func (m *CriuOpts) GetWorkDirFd() int32 { - if m != nil && m.WorkDirFd != nil { - return *m.WorkDirFd - } - return 0 -} - -func (m *CriuOpts) GetLinkRemap() bool { - if m != nil && m.LinkRemap != nil { - return *m.LinkRemap - } - return false -} - -func (m *CriuOpts) GetVeths() []*CriuVethPair { - if m != nil { - return m.Veths - } - return nil -} - -func (m *CriuOpts) GetCpuCap() uint32 { - if m != nil && m.CpuCap != nil { - return *m.CpuCap - } - return Default_CriuOpts_CpuCap -} - -func (m *CriuOpts) GetForceIrmap() bool { - if m != nil && m.ForceIrmap != nil { - return *m.ForceIrmap - } - return false -} - -func (m *CriuOpts) GetExecCmd() []string { - if m != nil { - return m.ExecCmd - } - return nil -} - -func (m *CriuOpts) GetExtMnt() []*ExtMountMap { - if m != nil { - return m.ExtMnt - } - return nil -} - -func (m *CriuOpts) GetManageCgroups() bool { - if m != nil && m.ManageCgroups != nil { - return *m.ManageCgroups - } - return false -} - -func (m *CriuOpts) GetCgRoot() []*CgroupRoot { - if m != nil { - return m.CgRoot - } - return nil -} - -func (m *CriuOpts) GetRstSibling() bool { - if m != nil && m.RstSibling != nil { - return *m.RstSibling - } - return false -} - -func (m *CriuOpts) GetInheritFd() []*InheritFd { - if m != nil { - return m.InheritFd - } - return nil -} - -func (m *CriuOpts) GetAutoExtMnt() bool { - if m != nil && m.AutoExtMnt != nil { - return *m.AutoExtMnt - } - return false -} - -func (m *CriuOpts) GetExtSharing() bool { - if m != nil && m.ExtSharing != nil { - return *m.ExtSharing - } - return false -} - -func (m *CriuOpts) GetExtMasters() bool { - if m != nil && m.ExtMasters != nil { - return *m.ExtMasters - } - return false -} - -func (m *CriuOpts) GetSkipMnt() []string { - if m != nil { - return m.SkipMnt - } - return nil -} - -func (m *CriuOpts) GetEnableFs() []string { - if m != nil { - return m.EnableFs - } - return nil -} - -func (m *CriuOpts) GetUnixSkIno() []*UnixSk { - if m != nil { - return m.UnixSkIno - } - return nil -} - -func (m *CriuOpts) GetManageCgroupsMode() CriuCgMode { - if m != nil && m.ManageCgroupsMode != nil { - return *m.ManageCgroupsMode - } - return CriuCgMode_IGNORE -} - -func (m *CriuOpts) GetGhostLimit() uint32 { - if m != nil && m.GhostLimit != nil { - return *m.GhostLimit - } - return Default_CriuOpts_GhostLimit -} - -func (m *CriuOpts) GetIrmapScanPaths() []string { - if m != nil { - return m.IrmapScanPaths - } - return nil -} - -func (m *CriuOpts) GetExternal() []string { - if m != nil { - return m.External - } - return nil -} - -func (m *CriuOpts) GetEmptyNs() uint32 { - if m != nil && m.EmptyNs != nil { - return *m.EmptyNs - } - return 0 -} - -func (m *CriuOpts) GetJoinNs() []*JoinNamespace { - if m != nil { - return m.JoinNs - } - return nil -} - -func (m *CriuOpts) GetCgroupProps() string { - if m != nil && m.CgroupProps != nil { - return *m.CgroupProps - } - return "" -} - -func (m *CriuOpts) GetCgroupPropsFile() string { - if m != nil && m.CgroupPropsFile != nil { - return *m.CgroupPropsFile - } - return "" -} - -func (m *CriuOpts) GetCgroupDumpController() []string { - if m != nil { - return m.CgroupDumpController - } - return nil -} - -func (m *CriuOpts) GetFreezeCgroup() string { - if m != nil && m.FreezeCgroup != nil { - return *m.FreezeCgroup - } - return "" -} - -func (m *CriuOpts) GetTimeout() uint32 { - if m != nil && m.Timeout != nil { - return *m.Timeout - } - return 0 -} - -func (m *CriuOpts) GetTcpSkipInFlight() bool { - if m != nil && m.TcpSkipInFlight != nil { - return *m.TcpSkipInFlight - } - return false -} - -func (m *CriuOpts) GetWeakSysctls() bool { - if m != nil && m.WeakSysctls != nil { - return *m.WeakSysctls - } - return false -} - -func (m *CriuOpts) GetLazyPages() bool { - if m != nil && m.LazyPages != nil { - return *m.LazyPages - } - return false -} - -func (m *CriuOpts) GetStatusFd() int32 { - if m != nil && m.StatusFd != nil { - return *m.StatusFd - } - return 0 -} - -func (m *CriuOpts) GetOrphanPtsMaster() bool { - if m != nil && m.OrphanPtsMaster != nil { - return *m.OrphanPtsMaster - } - return false -} - -func (m *CriuOpts) GetConfigFile() string { - if m != nil && m.ConfigFile != nil { - return *m.ConfigFile - } - return "" -} - -func (m *CriuOpts) GetTcpClose() bool { - if m != nil && m.TcpClose != nil { - return *m.TcpClose - } - return false -} - -func (m *CriuOpts) GetLsmProfile() string { - if m != nil && m.LsmProfile != nil { - return *m.LsmProfile - } - return "" -} - -func (m *CriuOpts) GetTlsCacert() string { - if m != nil && m.TlsCacert != nil { - return *m.TlsCacert - } - return "" -} - -func (m *CriuOpts) GetTlsCacrl() string { - if m != nil && m.TlsCacrl != nil { - return *m.TlsCacrl - } - return "" -} - -func (m *CriuOpts) GetTlsCert() string { - if m != nil && m.TlsCert != nil { - return *m.TlsCert - } - return "" -} - -func (m *CriuOpts) GetTlsKey() string { - if m != nil && m.TlsKey != nil { - return *m.TlsKey - } - return "" -} - -func (m *CriuOpts) GetTls() bool { - if m != nil && m.Tls != nil { - return *m.Tls - } - return false -} - -func (m *CriuOpts) GetTlsNoCnVerify() bool { - if m != nil && m.TlsNoCnVerify != nil { - return *m.TlsNoCnVerify - } - return false -} - -func (m *CriuOpts) GetCgroupYard() string { - if m != nil && m.CgroupYard != nil { - return *m.CgroupYard - } - return "" -} - -func (m *CriuOpts) GetPreDumpMode() CriuPreDumpMode { - if m != nil && m.PreDumpMode != nil { - return *m.PreDumpMode - } - return Default_CriuOpts_PreDumpMode -} - -type CriuDumpResp struct { - Restored *bool `protobuf:"varint,1,opt,name=restored" json:"restored,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuDumpResp) Reset() { *m = CriuDumpResp{} } -func (m *CriuDumpResp) String() string { return proto.CompactTextString(m) } -func (*CriuDumpResp) ProtoMessage() {} -func (*CriuDumpResp) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{8} -} - -func (m *CriuDumpResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuDumpResp.Unmarshal(m, b) -} -func (m *CriuDumpResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuDumpResp.Marshal(b, m, deterministic) -} -func (m *CriuDumpResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuDumpResp.Merge(m, src) -} -func (m *CriuDumpResp) XXX_Size() int { - return xxx_messageInfo_CriuDumpResp.Size(m) -} -func (m *CriuDumpResp) XXX_DiscardUnknown() { - xxx_messageInfo_CriuDumpResp.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuDumpResp proto.InternalMessageInfo - -func (m *CriuDumpResp) GetRestored() bool { - if m != nil && m.Restored != nil { - return *m.Restored - } - return false -} - -type CriuRestoreResp struct { - Pid *int32 `protobuf:"varint,1,req,name=pid" json:"pid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuRestoreResp) Reset() { *m = CriuRestoreResp{} } -func (m *CriuRestoreResp) String() string { return proto.CompactTextString(m) } -func (*CriuRestoreResp) ProtoMessage() {} -func (*CriuRestoreResp) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{9} -} - -func (m *CriuRestoreResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuRestoreResp.Unmarshal(m, b) -} -func (m *CriuRestoreResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuRestoreResp.Marshal(b, m, deterministic) -} -func (m *CriuRestoreResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuRestoreResp.Merge(m, src) -} -func (m *CriuRestoreResp) XXX_Size() int { - return xxx_messageInfo_CriuRestoreResp.Size(m) -} -func (m *CriuRestoreResp) XXX_DiscardUnknown() { - xxx_messageInfo_CriuRestoreResp.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuRestoreResp proto.InternalMessageInfo - -func (m *CriuRestoreResp) GetPid() int32 { - if m != nil && m.Pid != nil { - return *m.Pid - } - return 0 -} - -type CriuNotify struct { - Script *string `protobuf:"bytes,1,opt,name=script" json:"script,omitempty"` - Pid *int32 `protobuf:"varint,2,opt,name=pid" json:"pid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuNotify) Reset() { *m = CriuNotify{} } -func (m *CriuNotify) String() string { return proto.CompactTextString(m) } -func (*CriuNotify) ProtoMessage() {} -func (*CriuNotify) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{10} -} - -func (m *CriuNotify) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuNotify.Unmarshal(m, b) -} -func (m *CriuNotify) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuNotify.Marshal(b, m, deterministic) -} -func (m *CriuNotify) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuNotify.Merge(m, src) -} -func (m *CriuNotify) XXX_Size() int { - return xxx_messageInfo_CriuNotify.Size(m) -} -func (m *CriuNotify) XXX_DiscardUnknown() { - xxx_messageInfo_CriuNotify.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuNotify proto.InternalMessageInfo - -func (m *CriuNotify) GetScript() string { - if m != nil && m.Script != nil { - return *m.Script - } - return "" -} - -func (m *CriuNotify) GetPid() int32 { - if m != nil && m.Pid != nil { - return *m.Pid - } - return 0 -} - -// -// List of features which can queried via -// CRIU_REQ_TYPE__FEATURE_CHECK -type CriuFeatures struct { - MemTrack *bool `protobuf:"varint,1,opt,name=mem_track,json=memTrack" json:"mem_track,omitempty"` - LazyPages *bool `protobuf:"varint,2,opt,name=lazy_pages,json=lazyPages" json:"lazy_pages,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuFeatures) Reset() { *m = CriuFeatures{} } -func (m *CriuFeatures) String() string { return proto.CompactTextString(m) } -func (*CriuFeatures) ProtoMessage() {} -func (*CriuFeatures) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{11} -} - -func (m *CriuFeatures) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuFeatures.Unmarshal(m, b) -} -func (m *CriuFeatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuFeatures.Marshal(b, m, deterministic) -} -func (m *CriuFeatures) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuFeatures.Merge(m, src) -} -func (m *CriuFeatures) XXX_Size() int { - return xxx_messageInfo_CriuFeatures.Size(m) -} -func (m *CriuFeatures) XXX_DiscardUnknown() { - xxx_messageInfo_CriuFeatures.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuFeatures proto.InternalMessageInfo - -func (m *CriuFeatures) GetMemTrack() bool { - if m != nil && m.MemTrack != nil { - return *m.MemTrack - } - return false -} - -func (m *CriuFeatures) GetLazyPages() bool { - if m != nil && m.LazyPages != nil { - return *m.LazyPages - } - return false -} - -type CriuReq struct { - Type *CriuReqType `protobuf:"varint,1,req,name=type,enum=CriuReqType" json:"type,omitempty"` - Opts *CriuOpts `protobuf:"bytes,2,opt,name=opts" json:"opts,omitempty"` - NotifySuccess *bool `protobuf:"varint,3,opt,name=notify_success,json=notifySuccess" json:"notify_success,omitempty"` - // - // When set service won't close the connection but - // will wait for more req-s to appear. Works not - // for all request types. - KeepOpen *bool `protobuf:"varint,4,opt,name=keep_open,json=keepOpen" json:"keep_open,omitempty"` - // - // 'features' can be used to query which features - // are supported by the installed criu/kernel - // via RPC. - Features *CriuFeatures `protobuf:"bytes,5,opt,name=features" json:"features,omitempty"` - // 'pid' is used for WAIT_PID - Pid *uint32 `protobuf:"varint,6,opt,name=pid" json:"pid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuReq) Reset() { *m = CriuReq{} } -func (m *CriuReq) String() string { return proto.CompactTextString(m) } -func (*CriuReq) ProtoMessage() {} -func (*CriuReq) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{12} -} - -func (m *CriuReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuReq.Unmarshal(m, b) -} -func (m *CriuReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuReq.Marshal(b, m, deterministic) -} -func (m *CriuReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuReq.Merge(m, src) -} -func (m *CriuReq) XXX_Size() int { - return xxx_messageInfo_CriuReq.Size(m) -} -func (m *CriuReq) XXX_DiscardUnknown() { - xxx_messageInfo_CriuReq.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuReq proto.InternalMessageInfo - -func (m *CriuReq) GetType() CriuReqType { - if m != nil && m.Type != nil { - return *m.Type - } - return CriuReqType_EMPTY -} - -func (m *CriuReq) GetOpts() *CriuOpts { - if m != nil { - return m.Opts - } - return nil -} - -func (m *CriuReq) GetNotifySuccess() bool { - if m != nil && m.NotifySuccess != nil { - return *m.NotifySuccess - } - return false -} - -func (m *CriuReq) GetKeepOpen() bool { - if m != nil && m.KeepOpen != nil { - return *m.KeepOpen - } - return false -} - -func (m *CriuReq) GetFeatures() *CriuFeatures { - if m != nil { - return m.Features - } - return nil -} - -func (m *CriuReq) GetPid() uint32 { - if m != nil && m.Pid != nil { - return *m.Pid - } - return 0 -} - -type CriuResp struct { - Type *CriuReqType `protobuf:"varint,1,req,name=type,enum=CriuReqType" json:"type,omitempty"` - Success *bool `protobuf:"varint,2,req,name=success" json:"success,omitempty"` - Dump *CriuDumpResp `protobuf:"bytes,3,opt,name=dump" json:"dump,omitempty"` - Restore *CriuRestoreResp `protobuf:"bytes,4,opt,name=restore" json:"restore,omitempty"` - Notify *CriuNotify `protobuf:"bytes,5,opt,name=notify" json:"notify,omitempty"` - Ps *CriuPageServerInfo `protobuf:"bytes,6,opt,name=ps" json:"ps,omitempty"` - CrErrno *int32 `protobuf:"varint,7,opt,name=cr_errno,json=crErrno" json:"cr_errno,omitempty"` - Features *CriuFeatures `protobuf:"bytes,8,opt,name=features" json:"features,omitempty"` - CrErrmsg *string `protobuf:"bytes,9,opt,name=cr_errmsg,json=crErrmsg" json:"cr_errmsg,omitempty"` - Version *CriuVersion `protobuf:"bytes,10,opt,name=version" json:"version,omitempty"` - Status *int32 `protobuf:"varint,11,opt,name=status" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuResp) Reset() { *m = CriuResp{} } -func (m *CriuResp) String() string { return proto.CompactTextString(m) } -func (*CriuResp) ProtoMessage() {} -func (*CriuResp) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{13} -} - -func (m *CriuResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuResp.Unmarshal(m, b) -} -func (m *CriuResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuResp.Marshal(b, m, deterministic) -} -func (m *CriuResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuResp.Merge(m, src) -} -func (m *CriuResp) XXX_Size() int { - return xxx_messageInfo_CriuResp.Size(m) -} -func (m *CriuResp) XXX_DiscardUnknown() { - xxx_messageInfo_CriuResp.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuResp proto.InternalMessageInfo - -func (m *CriuResp) GetType() CriuReqType { - if m != nil && m.Type != nil { - return *m.Type - } - return CriuReqType_EMPTY -} - -func (m *CriuResp) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -func (m *CriuResp) GetDump() *CriuDumpResp { - if m != nil { - return m.Dump - } - return nil -} - -func (m *CriuResp) GetRestore() *CriuRestoreResp { - if m != nil { - return m.Restore - } - return nil -} - -func (m *CriuResp) GetNotify() *CriuNotify { - if m != nil { - return m.Notify - } - return nil -} - -func (m *CriuResp) GetPs() *CriuPageServerInfo { - if m != nil { - return m.Ps - } - return nil -} - -func (m *CriuResp) GetCrErrno() int32 { - if m != nil && m.CrErrno != nil { - return *m.CrErrno - } - return 0 -} - -func (m *CriuResp) GetFeatures() *CriuFeatures { - if m != nil { - return m.Features - } - return nil -} - -func (m *CriuResp) GetCrErrmsg() string { - if m != nil && m.CrErrmsg != nil { - return *m.CrErrmsg - } - return "" -} - -func (m *CriuResp) GetVersion() *CriuVersion { - if m != nil { - return m.Version - } - return nil -} - -func (m *CriuResp) GetStatus() int32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -// Answer for criu_req_type.VERSION requests -type CriuVersion struct { - MajorNumber *int32 `protobuf:"varint,1,req,name=major_number,json=majorNumber" json:"major_number,omitempty"` - MinorNumber *int32 `protobuf:"varint,2,req,name=minor_number,json=minorNumber" json:"minor_number,omitempty"` - Gitid *string `protobuf:"bytes,3,opt,name=gitid" json:"gitid,omitempty"` - Sublevel *int32 `protobuf:"varint,4,opt,name=sublevel" json:"sublevel,omitempty"` - Extra *int32 `protobuf:"varint,5,opt,name=extra" json:"extra,omitempty"` - Name *string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CriuVersion) Reset() { *m = CriuVersion{} } -func (m *CriuVersion) String() string { return proto.CompactTextString(m) } -func (*CriuVersion) ProtoMessage() {} -func (*CriuVersion) Descriptor() ([]byte, []int) { - return fileDescriptor_d9874a201429861e, []int{14} -} - -func (m *CriuVersion) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CriuVersion.Unmarshal(m, b) -} -func (m *CriuVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CriuVersion.Marshal(b, m, deterministic) -} -func (m *CriuVersion) XXX_Merge(src proto.Message) { - xxx_messageInfo_CriuVersion.Merge(m, src) -} -func (m *CriuVersion) XXX_Size() int { - return xxx_messageInfo_CriuVersion.Size(m) -} -func (m *CriuVersion) XXX_DiscardUnknown() { - xxx_messageInfo_CriuVersion.DiscardUnknown(m) -} - -var xxx_messageInfo_CriuVersion proto.InternalMessageInfo - -func (m *CriuVersion) GetMajorNumber() int32 { - if m != nil && m.MajorNumber != nil { - return *m.MajorNumber - } - return 0 -} - -func (m *CriuVersion) GetMinorNumber() int32 { - if m != nil && m.MinorNumber != nil { - return *m.MinorNumber - } - return 0 -} - -func (m *CriuVersion) GetGitid() string { - if m != nil && m.Gitid != nil { - return *m.Gitid - } - return "" -} - -func (m *CriuVersion) GetSublevel() int32 { - if m != nil && m.Sublevel != nil { - return *m.Sublevel - } - return 0 -} - -func (m *CriuVersion) GetExtra() int32 { - if m != nil && m.Extra != nil { - return *m.Extra - } - return 0 -} - -func (m *CriuVersion) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func init() { - proto.RegisterEnum("CriuCgMode", CriuCgMode_name, CriuCgMode_value) - proto.RegisterEnum("CriuPreDumpMode", CriuPreDumpMode_name, CriuPreDumpMode_value) - proto.RegisterEnum("CriuReqType", CriuReqType_name, CriuReqType_value) - proto.RegisterType((*CriuPageServerInfo)(nil), "criu_page_server_info") - proto.RegisterType((*CriuVethPair)(nil), "criu_veth_pair") - proto.RegisterType((*ExtMountMap)(nil), "ext_mount_map") - proto.RegisterType((*JoinNamespace)(nil), "join_namespace") - proto.RegisterType((*InheritFd)(nil), "inherit_fd") - proto.RegisterType((*CgroupRoot)(nil), "cgroup_root") - proto.RegisterType((*UnixSk)(nil), "unix_sk") - proto.RegisterType((*CriuOpts)(nil), "criu_opts") - proto.RegisterType((*CriuDumpResp)(nil), "criu_dump_resp") - proto.RegisterType((*CriuRestoreResp)(nil), "criu_restore_resp") - proto.RegisterType((*CriuNotify)(nil), "criu_notify") - proto.RegisterType((*CriuFeatures)(nil), "criu_features") - proto.RegisterType((*CriuReq)(nil), "criu_req") - proto.RegisterType((*CriuResp)(nil), "criu_resp") - proto.RegisterType((*CriuVersion)(nil), "criu_version") -} - -func init() { proto.RegisterFile("rpc/rpc.proto", fileDescriptor_d9874a201429861e) } - -var fileDescriptor_d9874a201429861e = []byte{ - // 2033 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0xe9, 0x72, 0x1b, 0x37, - 0x12, 0x0e, 0x29, 0xf1, 0x02, 0x45, 0x79, 0x0c, 0x5f, 0x70, 0xbc, 0xb6, 0x15, 0x3a, 0x8e, 0xb5, - 0x8a, 0xc3, 0x24, 0x8a, 0x8f, 0xd8, 0x9b, 0xd4, 0x96, 0x8b, 0x22, 0x1d, 0xae, 0x75, 0xb0, 0x40, - 0xc9, 0x5b, 0xfe, 0x85, 0x1a, 0xcd, 0x80, 0x14, 0xac, 0x19, 0xcc, 0x2c, 0x00, 0x2a, 0x92, 0x5f, - 0x62, 0x5f, 0x65, 0x7f, 0xef, 0x53, 0xe4, 0x91, 0xb6, 0xba, 0x01, 0xca, 0x52, 0x9c, 0xaa, 0xec, - 0xbf, 0xe9, 0xaf, 0xbb, 0x81, 0xbe, 0xd1, 0x43, 0x3a, 0xa6, 0x4c, 0xbe, 0x35, 0x65, 0xd2, 0x2b, - 0x4d, 0xe1, 0x8a, 0xee, 0x8c, 0xdc, 0x48, 0x8c, 0x9a, 0x8b, 0x32, 0x9e, 0x49, 0x61, 0xa5, 0x39, - 0x91, 0x46, 0x28, 0x3d, 0x2d, 0x28, 0x23, 0x8d, 0x38, 0x4d, 0x8d, 0xb4, 0x96, 0x55, 0xd6, 0x2a, - 0xeb, 0x2d, 0xbe, 0x20, 0x29, 0x25, 0xcb, 0x65, 0x61, 0x1c, 0xab, 0xae, 0x55, 0xd6, 0x6b, 0x1c, - 0xbf, 0x69, 0x44, 0x96, 0x4a, 0x95, 0xb2, 0x25, 0x84, 0xe0, 0x93, 0xae, 0x92, 0xea, 0x34, 0x65, - 0xcb, 0x08, 0x54, 0xa7, 0x69, 0xf7, 0x27, 0xb2, 0x8a, 0x17, 0x9d, 0x48, 0x77, 0x24, 0xca, 0x58, - 0x19, 0x7a, 0x8d, 0xd4, 0xd4, 0x54, 0x28, 0xcd, 0x2a, 0x6b, 0xd5, 0xf5, 0x16, 0x5f, 0x56, 0xd3, - 0x91, 0xa6, 0x37, 0x48, 0x5d, 0x4d, 0x45, 0x31, 0x87, 0xe3, 0x01, 0xad, 0xa9, 0xe9, 0xde, 0xdc, - 0x75, 0x7f, 0x20, 0x1d, 0x79, 0xea, 0x44, 0x5e, 0xcc, 0xb5, 0x13, 0x79, 0x5c, 0xc2, 0x85, 0xc7, - 0xf2, 0x2c, 0xa8, 0xc2, 0x27, 0x20, 0x27, 0x71, 0x16, 0xd4, 0xe0, 0xb3, 0xfb, 0x96, 0xac, 0xbe, - 0x2f, 0x94, 0x16, 0x3a, 0xce, 0xa5, 0x2d, 0xe3, 0x44, 0x82, 0x51, 0xda, 0x06, 0xa5, 0xaa, 0xb6, - 0xf4, 0x16, 0x69, 0x68, 0x2b, 0xa6, 0x2a, 0x93, 0x41, 0xaf, 0xae, 0xed, 0x50, 0x65, 0x92, 0xde, - 0x21, 0x2d, 0x79, 0xea, 0x4c, 0x2c, 0x8a, 0xd2, 0xa1, 0x57, 0x2d, 0xde, 0x44, 0x60, 0xaf, 0x74, - 0xdd, 0x1e, 0x21, 0x4a, 0x1f, 0x49, 0xa3, 0x9c, 0x98, 0xa6, 0x7f, 0x60, 0x89, 0x77, 0x1d, 0x0e, - 0xf4, 0xae, 0x3f, 0x25, 0xed, 0x64, 0x66, 0x8a, 0x79, 0x29, 0x4c, 0x51, 0x38, 0x88, 0x5f, 0xe2, - 0x4c, 0x16, 0xc2, 0x8a, 0xdf, 0x18, 0xd3, 0xd8, 0x1d, 0x05, 0x2b, 0xf0, 0xbb, 0x7b, 0x9f, 0x34, - 0xe6, 0x5a, 0x9d, 0x0a, 0x7b, 0x4c, 0xaf, 0x93, 0x9a, 0xd2, 0x45, 0x2a, 0xf1, 0x96, 0x0e, 0xf7, - 0x44, 0xf7, 0xbf, 0x11, 0x69, 0x61, 0x4c, 0x8b, 0xd2, 0x59, 0xda, 0x25, 0x1d, 0x95, 0xc7, 0x33, - 0x69, 0x45, 0xaa, 0x8c, 0x98, 0xa6, 0x28, 0x5b, 0xe3, 0x6d, 0x0f, 0x6e, 0x29, 0x33, 0x4c, 0x17, - 0x69, 0xaa, 0x7e, 0x4c, 0xd3, 0x03, 0xd2, 0xc9, 0x64, 0x7c, 0x22, 0x85, 0x99, 0x6b, 0xad, 0xf4, - 0x0c, 0x9d, 0x6d, 0xf2, 0x15, 0x04, 0xb9, 0xc7, 0xe8, 0x3d, 0xd2, 0x86, 0xe8, 0x07, 0x6b, 0x30, - 0xa9, 0x4d, 0x0e, 0x01, 0x3a, 0xd0, 0xea, 0x74, 0x72, 0x4c, 0x1f, 0x91, 0x2b, 0x2e, 0x29, 0x85, - 0xb4, 0x2e, 0x3e, 0xcc, 0x94, 0x3d, 0x92, 0x29, 0xab, 0xa1, 0xcc, 0xaa, 0x4b, 0xca, 0xc1, 0x47, - 0x14, 0x04, 0xe5, 0x49, 0x6c, 0xd5, 0x89, 0x14, 0xa9, 0x3c, 0x51, 0x89, 0xb4, 0xac, 0xee, 0x05, - 0x03, 0xbc, 0xe5, 0x51, 0x88, 0xbf, 0x3d, 0x92, 0x59, 0x26, 0xde, 0x17, 0x87, 0xac, 0x81, 0x22, - 0x4d, 0x04, 0xfe, 0x51, 0x1c, 0xd2, 0xbb, 0x84, 0x40, 0xca, 0x44, 0x56, 0x24, 0xc7, 0x96, 0x35, - 0xbd, 0x35, 0x80, 0x6c, 0x03, 0x40, 0xef, 0x91, 0x56, 0x56, 0xcc, 0x44, 0x26, 0x4f, 0x64, 0xc6, - 0x5a, 0xe0, 0xea, 0xcb, 0xca, 0x26, 0x6f, 0x66, 0xc5, 0x6c, 0x1b, 0x20, 0x7a, 0x9b, 0xc0, 0xb7, - 0xcf, 0x3a, 0xf1, 0xa5, 0x9d, 0x15, 0x33, 0x4c, 0xfb, 0x57, 0xa4, 0x5a, 0x5a, 0xd6, 0x5e, 0xab, - 0xac, 0xb7, 0x37, 0x6f, 0xf6, 0xfe, 0xb0, 0x31, 0x78, 0xb5, 0xb4, 0xf4, 0x21, 0x59, 0xd5, 0x85, - 0x53, 0xd3, 0x33, 0x61, 0x13, 0xa3, 0x4a, 0x67, 0xd9, 0x0a, 0x5a, 0xd1, 0xf1, 0xe8, 0xc4, 0x83, - 0x90, 0x55, 0xc8, 0x38, 0xeb, 0xf8, 0x4c, 0x63, 0xf6, 0xef, 0x12, 0x52, 0xc6, 0x46, 0x6a, 0x27, - 0x54, 0x3e, 0x63, 0xab, 0xc8, 0x69, 0x79, 0x64, 0x94, 0xcf, 0xc0, 0x71, 0x67, 0xe2, 0xe4, 0x58, - 0xe4, 0x32, 0x67, 0x57, 0xbc, 0xe3, 0x08, 0xec, 0xc8, 0x1c, 0x74, 0xe3, 0xb9, 0x2b, 0x44, 0x2a, - 0xd3, 0x79, 0xc9, 0x22, 0xef, 0x38, 0x20, 0x5b, 0x00, 0x40, 0x9a, 0x7e, 0x2d, 0xcc, 0xf1, 0x22, - 0xff, 0x57, 0x31, 0xcb, 0x2d, 0x80, 0x7c, 0xf6, 0xef, 0x12, 0x92, 0x29, 0x7d, 0x2c, 0x8c, 0xcc, - 0xe3, 0x92, 0x51, 0xaf, 0x0e, 0x08, 0x07, 0x80, 0x3e, 0x24, 0x35, 0x68, 0x4e, 0xcb, 0xae, 0xad, - 0x2d, 0xad, 0xb7, 0x37, 0xaf, 0xf4, 0x2e, 0xf7, 0x2b, 0xf7, 0x5c, 0xfa, 0x80, 0x34, 0x92, 0x72, - 0x2e, 0x92, 0xb8, 0x64, 0xd7, 0xd7, 0x2a, 0xeb, 0x9d, 0x97, 0xe4, 0xc9, 0xe6, 0x8b, 0x27, 0x2f, - 0x9e, 0x3d, 0xdf, 0x7c, 0xf1, 0x94, 0xd7, 0x93, 0x72, 0xde, 0x8f, 0x4b, 0x7a, 0x9f, 0xb4, 0xa7, - 0x85, 0x49, 0xa4, 0x50, 0x06, 0xee, 0xba, 0x81, 0x77, 0x11, 0x84, 0x46, 0x80, 0x40, 0x12, 0xe4, - 0xa9, 0x4c, 0x44, 0x92, 0xa7, 0xec, 0xe6, 0xda, 0x12, 0x24, 0x01, 0xe8, 0x7e, 0x0e, 0x45, 0xd2, - 0xc0, 0x5e, 0xd7, 0x8e, 0xdd, 0x42, 0x4b, 0x56, 0x7b, 0x97, 0x7a, 0x9f, 0xd7, 0xe5, 0xa9, 0xdb, - 0xd1, 0x0e, 0xb2, 0x90, 0xc7, 0x1a, 0xf2, 0xe3, 0xdb, 0xcb, 0x32, 0xe6, 0xb3, 0xe0, 0xd1, 0xbe, - 0x07, 0xe9, 0x43, 0xd2, 0x48, 0x66, 0xd8, 0x7a, 0xec, 0x36, 0x9e, 0xb7, 0xd2, 0xbb, 0xd0, 0x8e, - 0xbc, 0x9e, 0xcc, 0x38, 0x24, 0xe6, 0x3e, 0x69, 0x1b, 0xeb, 0x84, 0x55, 0x87, 0x19, 0xf4, 0xc1, - 0xe7, 0xde, 0x64, 0x63, 0xdd, 0xc4, 0x23, 0x74, 0xe3, 0x62, 0xdb, 0xb3, 0x3b, 0x78, 0x54, 0xbb, - 0xf7, 0x11, 0xe2, 0xad, 0xf0, 0x3d, 0x4c, 0xe9, 0x1a, 0x59, 0xc1, 0x4c, 0x2d, 0x1c, 0xf9, 0x8b, - 0x3f, 0x0d, 0xb0, 0x81, 0x37, 0xfe, 0xbe, 0xef, 0x29, 0x7b, 0x14, 0x1b, 0xb8, 0xee, 0xae, 0x17, - 0x90, 0xa7, 0x6e, 0xe2, 0x91, 0x85, 0x40, 0x1e, 0x5b, 0x27, 0x8d, 0x65, 0xf7, 0xce, 0x05, 0x76, - 0x3c, 0x02, 0x21, 0xb4, 0xc7, 0xaa, 0xc4, 0xf3, 0xef, 0xfb, 0x10, 0x02, 0x0d, 0x87, 0xc3, 0xf8, - 0xd2, 0xf1, 0x61, 0x26, 0xc5, 0xd4, 0xb2, 0x35, 0xe4, 0x35, 0x3d, 0x30, 0xb4, 0x74, 0x9d, 0xb4, - 0x43, 0x27, 0x0b, 0xa5, 0x0b, 0xf6, 0x05, 0x3a, 0xd2, 0xec, 0x05, 0x8c, 0xb7, 0xe6, 0xd8, 0xd4, - 0x23, 0x5d, 0xd0, 0x9f, 0xc9, 0xb5, 0xcb, 0x01, 0x16, 0x39, 0x0c, 0xa1, 0xee, 0x5a, 0x65, 0x7d, - 0x75, 0xb3, 0xe3, 0xeb, 0x23, 0x99, 0x21, 0xc8, 0xaf, 0x5e, 0x0a, 0xfa, 0x4e, 0x91, 0x4a, 0xb8, - 0x68, 0x76, 0x54, 0x58, 0x27, 0x32, 0x95, 0x2b, 0xc7, 0x1e, 0x60, 0xb5, 0x34, 0xbe, 0xff, 0xee, - 0xc9, 0x8f, 0x4f, 0x9f, 0x3f, 0xe3, 0x04, 0x79, 0xdb, 0xc0, 0xa2, 0xeb, 0x24, 0xc2, 0x42, 0x11, - 0x36, 0x89, 0xb5, 0x80, 0xe9, 0x67, 0xd9, 0x97, 0x68, 0xf6, 0x2a, 0xe2, 0x93, 0x24, 0xd6, 0x63, - 0x40, 0xe9, 0xe7, 0x50, 0x37, 0x4e, 0x1a, 0x1d, 0x67, 0xec, 0x61, 0x70, 0x2c, 0xd0, 0x58, 0x53, - 0x79, 0xe9, 0xce, 0x84, 0xb6, 0xec, 0x2b, 0xb8, 0x8c, 0x37, 0x90, 0xde, 0x05, 0x9f, 0x1b, 0xfe, - 0x29, 0xb0, 0xec, 0x51, 0xa8, 0xee, 0xcb, 0x4f, 0x03, 0xaf, 0x03, 0xbd, 0x6b, 0xe9, 0x17, 0x64, - 0x25, 0x54, 0x47, 0x69, 0x8a, 0xd2, 0xb2, 0xbf, 0x62, 0x87, 0x86, 0x01, 0x3e, 0x06, 0x88, 0x6e, - 0x90, 0xab, 0x17, 0x45, 0xfc, 0x24, 0xd9, 0x40, 0xb9, 0x2b, 0x17, 0xe4, 0x70, 0xa2, 0x3c, 0x21, - 0x37, 0x83, 0x6c, 0x3a, 0xcf, 0x4b, 0x91, 0x14, 0xda, 0x99, 0x22, 0xcb, 0xa4, 0x61, 0x5f, 0xa3, - 0xf5, 0xd7, 0x3d, 0x77, 0x6b, 0x9e, 0x97, 0xfd, 0x73, 0x1e, 0x4c, 0xe5, 0xa9, 0x91, 0xf2, 0xc3, - 0x22, 0xf0, 0xec, 0x31, 0x9e, 0xbe, 0xe2, 0x41, 0x1f, 0x63, 0x78, 0xa1, 0x9d, 0xca, 0x25, 0xbc, - 0x95, 0xdf, 0x78, 0x6f, 0x03, 0x49, 0xbf, 0x26, 0x14, 0xe6, 0x31, 0x56, 0x87, 0xd2, 0x62, 0x9a, - 0xa9, 0xd9, 0x91, 0x63, 0x3d, 0xac, 0x20, 0x98, 0xd4, 0x93, 0x63, 0x55, 0x8e, 0xf4, 0x10, 0x61, - 0x70, 0xf8, 0x57, 0x19, 0x1f, 0x0b, 0x7b, 0x66, 0x13, 0x97, 0x59, 0xf6, 0x2d, 0x8a, 0xb5, 0x01, - 0x9b, 0x78, 0x08, 0x07, 0x47, 0xfc, 0xe1, 0x0c, 0x67, 0xa1, 0x65, 0xdf, 0x85, 0xc1, 0x11, 0x7f, - 0x38, 0x1b, 0x03, 0x80, 0xc3, 0xda, 0xc5, 0x6e, 0x6e, 0xa1, 0x2f, 0xbe, 0xc7, 0xa9, 0xd3, 0xf4, - 0xc0, 0x30, 0x85, 0x60, 0x15, 0xa6, 0x3c, 0x82, 0xb4, 0x3a, 0x1b, 0xaa, 0x99, 0x6d, 0x7a, 0x53, - 0x3c, 0x63, 0xec, 0xac, 0x2f, 0x69, 0x28, 0xf9, 0xa4, 0xd0, 0x53, 0x15, 0x86, 0xf3, 0x0f, 0xe8, - 0x34, 0xf1, 0xd0, 0xe2, 0x59, 0x06, 0xc7, 0x92, 0xac, 0xb0, 0x92, 0x3d, 0x09, 0xd3, 0x31, 0x29, - 0xfb, 0x40, 0x83, 0x76, 0x66, 0x73, 0xc8, 0x09, 0x6a, 0x3f, 0xf5, 0xda, 0x99, 0xcd, 0xc7, 0x1e, - 0x01, 0x37, 0x5c, 0x66, 0x45, 0x12, 0x27, 0xd2, 0x38, 0xf6, 0xcc, 0x8f, 0x5e, 0x97, 0xd9, 0x3e, - 0x02, 0x78, 0xb8, 0x67, 0x9b, 0x8c, 0x3d, 0xf7, 0x6f, 0xbe, 0xe7, 0x1a, 0xac, 0x2d, 0x64, 0x82, - 0xe6, 0x8f, 0xfe, 0xd1, 0x00, 0x1e, 0xe8, 0xdd, 0x22, 0xf0, 0x29, 0x60, 0x09, 0x78, 0x81, 0x9c, - 0xba, 0xcb, 0xec, 0x1b, 0xbf, 0x91, 0x40, 0x40, 0x5f, 0xa2, 0x9d, 0xf0, 0x49, 0x1f, 0x91, 0x08, - 0x44, 0x75, 0x21, 0x12, 0x2d, 0x4e, 0xa4, 0x51, 0xd3, 0x33, 0xf6, 0x37, 0x3f, 0xb3, 0x5c, 0x66, - 0x77, 0x8b, 0xbe, 0x7e, 0x8b, 0x20, 0x46, 0xc2, 0x97, 0xcd, 0x59, 0x6c, 0x52, 0xf6, 0x53, 0x88, - 0x04, 0x42, 0xef, 0x62, 0x93, 0xd2, 0xbf, 0x93, 0x4e, 0x69, 0xa4, 0x2f, 0x2a, 0x6c, 0xca, 0x9f, - 0xb1, 0x29, 0xaf, 0x85, 0x47, 0xeb, 0x22, 0xeb, 0x65, 0x7d, 0x32, 0xde, 0x1e, 0xf5, 0x07, 0xbc, - 0x5d, 0x1a, 0x09, 0x85, 0x06, 0xcd, 0xd9, 0x7d, 0x1c, 0xf6, 0x31, 0x14, 0x33, 0xd2, 0x96, 0xd0, - 0x5a, 0x46, 0x5a, 0x57, 0x18, 0x99, 0xe2, 0x6e, 0xd2, 0xe4, 0xe7, 0x74, 0xf7, 0x21, 0xb9, 0x8a, - 0xd2, 0x01, 0xf0, 0x0a, 0x61, 0x9b, 0xf0, 0x7b, 0x06, 0x7c, 0x76, 0x9f, 0x93, 0x36, 0x8a, 0xf9, - 0x67, 0x90, 0xde, 0x24, 0x75, 0xff, 0x3e, 0x86, 0x5d, 0x27, 0x50, 0x9f, 0xae, 0x21, 0xdd, 0x37, - 0xa4, 0x83, 0x8a, 0x53, 0x19, 0xbb, 0xb9, 0xf1, 0x35, 0x95, 0xcb, 0x5c, 0xe0, 0xd3, 0xb7, 0xb0, - 0x26, 0x97, 0xf9, 0x3e, 0xd0, 0xbf, 0xab, 0xc7, 0xea, 0xef, 0xea, 0xb1, 0xfb, 0x5b, 0x85, 0x34, - 0x83, 0xb5, 0xff, 0xa2, 0x5d, 0xb2, 0xec, 0xce, 0x4a, 0xbf, 0x39, 0xad, 0x6e, 0xae, 0xf6, 0x16, - 0x0c, 0x01, 0x28, 0x47, 0x1e, 0xbd, 0x47, 0x96, 0x61, 0x85, 0xc2, 0x93, 0xda, 0x9b, 0xa4, 0x77, - 0xbe, 0x54, 0x71, 0xc4, 0x2f, 0x3e, 0xf7, 0xf3, 0x24, 0x81, 0x95, 0x78, 0xe9, 0xd2, 0x73, 0xef, - 0x41, 0xb0, 0xf9, 0x58, 0xca, 0x52, 0x14, 0xa5, 0xd4, 0x61, 0x49, 0x6a, 0x02, 0xb0, 0x57, 0x4a, - 0x4d, 0x37, 0x48, 0x73, 0xe1, 0x1c, 0x2e, 0x47, 0xed, 0x85, 0x2d, 0x0b, 0x94, 0x9f, 0xf3, 0x17, - 0xf1, 0xa9, 0x63, 0x57, 0x63, 0x7c, 0xfe, 0xbd, 0x14, 0x56, 0x3d, 0x0c, 0xfc, 0xff, 0xe3, 0x13, - 0x23, 0x8d, 0x85, 0xb1, 0xb0, 0x54, 0x36, 0xf9, 0x82, 0xa4, 0x0f, 0xc8, 0x32, 0x24, 0x1d, 0x7d, - 0x38, 0x7f, 0xe6, 0xcf, 0xcb, 0x80, 0x23, 0x93, 0x3e, 0x26, 0x8d, 0x90, 0x6b, 0xf4, 0xa4, 0xbd, - 0x49, 0x7b, 0x9f, 0x14, 0x00, 0x5f, 0x88, 0xd0, 0x2f, 0x49, 0xdd, 0x87, 0x22, 0xb8, 0xb6, 0xd2, - 0xbb, 0x50, 0x06, 0x3c, 0xf0, 0xc2, 0x76, 0x55, 0xff, 0xd3, 0xed, 0xea, 0x36, 0xa4, 0x4f, 0x48, - 0x63, 0x74, 0x81, 0xbb, 0x5f, 0x8d, 0x37, 0x12, 0x33, 0x00, 0xf2, 0x52, 0x14, 0x9b, 0x7f, 0x12, - 0xc5, 0x3b, 0x10, 0x32, 0x38, 0x26, 0xb7, 0x33, 0xdc, 0x03, 0x5b, 0xbc, 0x89, 0xe7, 0xe4, 0x76, - 0x06, 0x4b, 0xc6, 0x89, 0x34, 0x56, 0x15, 0x1a, 0x77, 0xc0, 0xf6, 0xe2, 0x39, 0x0b, 0x20, 0x5f, - 0x70, 0xb1, 0x86, 0x71, 0x96, 0xe1, 0x5a, 0x58, 0xe3, 0x81, 0xea, 0xfe, 0xa7, 0x42, 0x56, 0x2e, - 0x6a, 0xc0, 0x1c, 0xcd, 0xe3, 0xf7, 0x85, 0x11, 0x7a, 0x9e, 0x1f, 0x4a, 0xb3, 0x58, 0xbf, 0x11, - 0xdb, 0x45, 0x08, 0x45, 0x94, 0xfe, 0x28, 0x52, 0x0d, 0x22, 0x80, 0x05, 0x91, 0xeb, 0xa4, 0x36, - 0x53, 0x2e, 0xfc, 0x4a, 0xb5, 0xb8, 0x27, 0xa0, 0x35, 0xed, 0xfc, 0xd0, 0x6f, 0xb4, 0xcb, 0x61, - 0xc0, 0x06, 0x1a, 0x34, 0xf0, 0xcf, 0x04, 0x43, 0x5f, 0xe3, 0x9e, 0x80, 0xd5, 0x13, 0xde, 0x36, - 0x8c, 0x76, 0x8b, 0xe3, 0xf7, 0x86, 0x08, 0x16, 0x87, 0x27, 0x9b, 0x12, 0x52, 0x1f, 0xbd, 0xde, - 0xdd, 0xe3, 0x83, 0xe8, 0x33, 0xda, 0x26, 0x8d, 0xfe, 0x6b, 0xb1, 0xbb, 0xb7, 0x3b, 0x88, 0x2a, - 0xb4, 0x45, 0x6a, 0x63, 0xbe, 0x37, 0x9e, 0x44, 0x55, 0xda, 0x24, 0xcb, 0x93, 0xbd, 0xe1, 0x7e, - 0xb4, 0x04, 0x5f, 0xc3, 0x83, 0xed, 0xed, 0x68, 0x19, 0xf4, 0x26, 0xfb, 0x7c, 0xd4, 0xdf, 0x8f, - 0x6a, 0xa0, 0xb7, 0x35, 0x18, 0xbe, 0x3a, 0xd8, 0xde, 0x8f, 0xea, 0x1b, 0xdf, 0x10, 0xfa, 0xe9, - 0xf8, 0x41, 0x71, 0x1c, 0x40, 0x51, 0x05, 0xc4, 0xdf, 0xee, 0x08, 0x3e, 0x78, 0xb5, 0x15, 0x55, - 0x37, 0x7e, 0xab, 0x84, 0xae, 0x5f, 0x94, 0x2e, 0x5c, 0x3c, 0xd8, 0x19, 0xef, 0xbf, 0x8b, 0x3e, - 0x83, 0xeb, 0xb6, 0x0e, 0x76, 0xc6, 0x5e, 0x87, 0x0f, 0x26, 0xfb, 0x60, 0x67, 0x15, 0x24, 0xfa, - 0xbf, 0x0c, 0xfa, 0x6f, 0xa2, 0x25, 0xba, 0x42, 0x9a, 0x63, 0x3e, 0x10, 0x28, 0xb5, 0x4c, 0xaf, - 0x90, 0xf6, 0xf8, 0xd5, 0xeb, 0x81, 0x98, 0x0c, 0xf8, 0xdb, 0x01, 0x8f, 0x6a, 0x70, 0xed, 0xee, - 0xde, 0xfe, 0x68, 0xf8, 0x2e, 0xaa, 0xd3, 0x88, 0xac, 0xf4, 0xc7, 0x07, 0xa3, 0xdd, 0xe1, 0x9e, - 0x17, 0x6f, 0xd0, 0xab, 0xa4, 0xb3, 0x40, 0xfc, 0x79, 0x4d, 0x80, 0x86, 0x83, 0x57, 0xfb, 0x07, - 0x7c, 0x10, 0xa0, 0x16, 0x9a, 0x3b, 0xe0, 0x93, 0xd1, 0xde, 0x6e, 0x44, 0xe0, 0xbe, 0x7f, 0xbe, - 0x1a, 0xed, 0x8b, 0xf1, 0x68, 0x2b, 0x6a, 0xd3, 0xeb, 0x24, 0xba, 0x70, 0x9f, 0xe8, 0xff, 0xb2, - 0xbd, 0x15, 0xad, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x45, 0x96, 0x6d, 0x5e, 0x0f, 0x00, - 0x00, -} diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/.gitignore b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/.gitignore similarity index 52% rename from cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/.gitignore rename to cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/.gitignore index f1c90e3d5ff1..d99bf92cfef7 100644 --- a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/.gitignore +++ b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/.gitignore @@ -1,5 +1,6 @@ test/test -test/piggie +test/piggie/piggie test/phaul image rpc/rpc.proto +stats/stats.proto diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/.golangci.yml b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/.golangci.yml new file mode 100644 index 000000000000..fbbac4b4173b --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/.golangci.yml @@ -0,0 +1,12 @@ +run: + skip_dirs: + - rpc + - stats + +linters: + disable-all: false + presets: + - bugs + - performance + - unused + - format diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/LICENSE b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/LICENSE similarity index 100% rename from cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/LICENSE rename to cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/LICENSE diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/Makefile b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/Makefile new file mode 100644 index 000000000000..2c303a3c9f42 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/Makefile @@ -0,0 +1,57 @@ +GO ?= go +CC ?= gcc + +all: build test phaul-test + +lint: + golangci-lint run ./... + +build: + $(GO) build -v ./... + +TEST_BINARIES := test/test test/piggie/piggie test/phaul/phaul +test-bin: $(TEST_BINARIES) + +test/piggie/piggie: test/piggie/piggie.c + $(CC) $^ -o $@ + +test/test: test/*.go + $(GO) build -v -o $@ $^ + +test: $(TEST_BINARIES) + mkdir -p image + PID=$$(test/piggie/piggie) && { \ + test/test dump $$PID image && \ + test/test restore image; \ + pkill -9 piggie; \ + } + rm -rf image + +test/phaul/phaul: test/phaul/*.go + $(GO) build -v -o $@ $^ + +phaul-test: $(TEST_BINARIES) + rm -rf image + PID=$$(test/piggie/piggie) && { \ + test/phaul/phaul $$PID; \ + pkill -9 piggie; \ + } + +clean: + @rm -f $(TEST_BINARIES) + @rm -rf image + @rm -f rpc/rpc.proto stats/stats.proto + +rpc/rpc.proto: + curl -sSL https://raw.githubusercontent.com/checkpoint-restore/criu/master/images/rpc.proto -o $@ + +stats/stats.proto: + curl -sSL https://raw.githubusercontent.com/checkpoint-restore/criu/master/images/stats.proto -o $@ + +rpc/rpc.pb.go: rpc/rpc.proto + protoc --go_out=. $^ + +stats/stats.pb.go: stats/stats.proto + protoc --go_out=. $^ + +.PHONY: build test phaul-test test-bin clean lint diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/README.md b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/README.md similarity index 72% rename from cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/README.md rename to cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/README.md index ace01564c55e..390da3e98b07 100644 --- a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/README.md +++ b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/README.md @@ -1,8 +1,10 @@ -[![master](https://travis-ci.org/checkpoint-restore/go-criu.svg?branch=master)](https://travis-ci.org/checkpoint-restore/go-criu) +[![test](https://github.com/checkpoint-restore/go-criu/workflows/ci/badge.svg?branch=master)](https://github.com/checkpoint-restore/go-criu/actions?query=workflow%3Aci) +[![verify](https://github.com/checkpoint-restore/go-criu/workflows/verify/badge.svg?branch=master)](https://github.com/checkpoint-restore/go-criu/actions?query=workflow%3Averify) +[![Go Reference](https://pkg.go.dev/badge/github.com/checkpoint-restore/go-criu.svg)](https://pkg.go.dev/github.com/checkpoint-restore/go-criu) -## go-criu -- Go bindings for [CRIU](https://criu.org/) +## go-criu -- Go bindings for CRIU -This repository provides Go bindings for CRIU. The code is based on the Go based PHaul +This repository provides Go bindings for [CRIU](https://criu.org/). The code is based on the Go-based PHaul implementation from the CRIU repository. For easier inclusion into other Go projects the CRIU Go bindings have been moved to this repository. @@ -10,13 +12,26 @@ The Go bindings provide an easy way to use the CRIU RPC calls from Go without th to set up all the infrastructure to make the actual RPC connection to CRIU. The following example would print the version of CRIU: -``` +```go +import ( + "log" + + "github.com/checkpoint/restore/go-criu/v5" +) + +func main() { c := criu.MakeCriu() version, err := c.GetCriuVersion() - fmt.Println(version) + if err != nil { + log.Fatalln(err) + } + log.Println(version) +} ``` + or to just check if at least a certain CRIU version is installed: -``` + +```go c := criu.MakeCriu() result, err := c.IsCriuAtLeast(31100) ``` @@ -31,7 +46,12 @@ As go-criu is imported in other projects and as Go modules are expected to follow Semantic Versioning go-criu will also follow Semantic Versioning starting with the 4.0.0 release. -4.0.0 is based on CRIU 3.14 +The following table shows the relation between go-criu and criu versions: + +| Major version | Latest release | CRIU version | +| -------------- | -------------- | ------------ | +| v5             | 5.0.0         | 3.15         | +| v4             | 4.1.0         | 3.14         | ## How to contribute diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/go.mod b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/go.mod new file mode 100644 index 000000000000..58931e5f9837 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/go.mod @@ -0,0 +1,9 @@ +module github.com/checkpoint-restore/go-criu/v5 + +go 1.13 + +require ( + github.com/golang/protobuf v1.4.3 + golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c + google.golang.org/protobuf v1.23.0 +) diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/go.sum b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/go.sum new file mode 100644 index 000000000000..0a5a48cde74c --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/go.sum @@ -0,0 +1,22 @@ +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +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= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/main.go b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/main.go similarity index 87% rename from cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/main.go rename to cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/main.go index d0a6da47837b..78811c309ce2 100644 --- a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/main.go +++ b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/main.go @@ -8,8 +8,8 @@ import ( "strconv" "syscall" - "github.com/checkpoint-restore/go-criu/v4/rpc" - "github.com/golang/protobuf/proto" + "github.com/checkpoint-restore/go-criu/v5/rpc" + "google.golang.org/protobuf/proto" ) // Criu struct @@ -45,6 +45,7 @@ func (c *Criu) Prepare() error { defer srv.Close() args := []string{"swrk", strconv.Itoa(fds[1])} + // #nosec G204 cmd := exec.Command(c.swrkPath, args...) err = cmd.Start() @@ -64,7 +65,7 @@ func (c *Criu) Cleanup() { if c.swrkCmd != nil { c.swrkSk.Close() c.swrkSk = nil - c.swrkCmd.Wait() + _ = c.swrkCmd.Wait() c.swrkCmd = nil } } @@ -187,28 +188,28 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N } // Dump dumps a process -func (c *Criu) Dump(opts rpc.CriuOpts, nfy Notify) error { - return c.doSwrk(rpc.CriuReqType_DUMP, &opts, nfy) +func (c *Criu) Dump(opts *rpc.CriuOpts, nfy Notify) error { + return c.doSwrk(rpc.CriuReqType_DUMP, opts, nfy) } // Restore restores a process -func (c *Criu) Restore(opts rpc.CriuOpts, nfy Notify) error { - return c.doSwrk(rpc.CriuReqType_RESTORE, &opts, nfy) +func (c *Criu) Restore(opts *rpc.CriuOpts, nfy Notify) error { + return c.doSwrk(rpc.CriuReqType_RESTORE, opts, nfy) } // PreDump does a pre-dump -func (c *Criu) PreDump(opts rpc.CriuOpts, nfy Notify) error { - return c.doSwrk(rpc.CriuReqType_PRE_DUMP, &opts, nfy) +func (c *Criu) PreDump(opts *rpc.CriuOpts, nfy Notify) error { + return c.doSwrk(rpc.CriuReqType_PRE_DUMP, opts, nfy) } // StartPageServer starts the page server -func (c *Criu) StartPageServer(opts rpc.CriuOpts) error { - return c.doSwrk(rpc.CriuReqType_PAGE_SERVER, &opts, nil) +func (c *Criu) StartPageServer(opts *rpc.CriuOpts) error { + return c.doSwrk(rpc.CriuReqType_PAGE_SERVER, opts, nil) } // StartPageServerChld starts the page server and returns PID and port -func (c *Criu) StartPageServerChld(opts rpc.CriuOpts) (int, int, error) { - resp, err := c.doSwrkWithResp(rpc.CriuReqType_PAGE_SERVER_CHLD, &opts, nil) +func (c *Criu) StartPageServerChld(opts *rpc.CriuOpts) (int, int, error) { + resp, err := c.doSwrkWithResp(rpc.CriuReqType_PAGE_SERVER_CHLD, opts, nil) if err != nil { return 0, 0, err } diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/notify.go b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/notify.go similarity index 95% rename from cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/notify.go rename to cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/notify.go index 1c8547b435ae..a177f2bb5c0b 100644 --- a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v4/notify.go +++ b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/notify.go @@ -1,6 +1,6 @@ package criu -//Notify interface +// Notify interface type Notify interface { PreDump() error PostDump() error @@ -14,8 +14,7 @@ type Notify interface { } // NoNotify struct -type NoNotify struct { -} +type NoNotify struct{} // PreDump NoNotify func (c NoNotify) PreDump() error { diff --git a/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/rpc/rpc.pb.go b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/rpc/rpc.pb.go new file mode 100644 index 000000000000..fa37f93cbd6d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/checkpoint-restore/go-criu/v5/rpc/rpc.pb.go @@ -0,0 +1,2208 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.4 +// source: rpc/rpc.proto + +package rpc + +import ( + proto "github.com/golang/protobuf/proto" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type CriuCgMode int32 + +const ( + CriuCgMode_IGNORE CriuCgMode = 0 + CriuCgMode_CG_NONE CriuCgMode = 1 + CriuCgMode_PROPS CriuCgMode = 2 + CriuCgMode_SOFT CriuCgMode = 3 + CriuCgMode_FULL CriuCgMode = 4 + CriuCgMode_STRICT CriuCgMode = 5 + CriuCgMode_DEFAULT CriuCgMode = 6 +) + +// Enum value maps for CriuCgMode. +var ( + CriuCgMode_name = map[int32]string{ + 0: "IGNORE", + 1: "CG_NONE", + 2: "PROPS", + 3: "SOFT", + 4: "FULL", + 5: "STRICT", + 6: "DEFAULT", + } + CriuCgMode_value = map[string]int32{ + "IGNORE": 0, + "CG_NONE": 1, + "PROPS": 2, + "SOFT": 3, + "FULL": 4, + "STRICT": 5, + "DEFAULT": 6, + } +) + +func (x CriuCgMode) Enum() *CriuCgMode { + p := new(CriuCgMode) + *p = x + return p +} + +func (x CriuCgMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CriuCgMode) Descriptor() protoreflect.EnumDescriptor { + return file_rpc_rpc_proto_enumTypes[0].Descriptor() +} + +func (CriuCgMode) Type() protoreflect.EnumType { + return &file_rpc_rpc_proto_enumTypes[0] +} + +func (x CriuCgMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *CriuCgMode) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = CriuCgMode(num) + return nil +} + +// Deprecated: Use CriuCgMode.Descriptor instead. +func (CriuCgMode) EnumDescriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{0} +} + +type CriuPreDumpMode int32 + +const ( + CriuPreDumpMode_SPLICE CriuPreDumpMode = 1 + CriuPreDumpMode_VM_READ CriuPreDumpMode = 2 +) + +// Enum value maps for CriuPreDumpMode. +var ( + CriuPreDumpMode_name = map[int32]string{ + 1: "SPLICE", + 2: "VM_READ", + } + CriuPreDumpMode_value = map[string]int32{ + "SPLICE": 1, + "VM_READ": 2, + } +) + +func (x CriuPreDumpMode) Enum() *CriuPreDumpMode { + p := new(CriuPreDumpMode) + *p = x + return p +} + +func (x CriuPreDumpMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CriuPreDumpMode) Descriptor() protoreflect.EnumDescriptor { + return file_rpc_rpc_proto_enumTypes[1].Descriptor() +} + +func (CriuPreDumpMode) Type() protoreflect.EnumType { + return &file_rpc_rpc_proto_enumTypes[1] +} + +func (x CriuPreDumpMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *CriuPreDumpMode) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = CriuPreDumpMode(num) + return nil +} + +// Deprecated: Use CriuPreDumpMode.Descriptor instead. +func (CriuPreDumpMode) EnumDescriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{1} +} + +type CriuReqType int32 + +const ( + CriuReqType_EMPTY CriuReqType = 0 + CriuReqType_DUMP CriuReqType = 1 + CriuReqType_RESTORE CriuReqType = 2 + CriuReqType_CHECK CriuReqType = 3 + CriuReqType_PRE_DUMP CriuReqType = 4 + CriuReqType_PAGE_SERVER CriuReqType = 5 + CriuReqType_NOTIFY CriuReqType = 6 + CriuReqType_CPUINFO_DUMP CriuReqType = 7 + CriuReqType_CPUINFO_CHECK CriuReqType = 8 + CriuReqType_FEATURE_CHECK CriuReqType = 9 + CriuReqType_VERSION CriuReqType = 10 + CriuReqType_WAIT_PID CriuReqType = 11 + CriuReqType_PAGE_SERVER_CHLD CriuReqType = 12 +) + +// Enum value maps for CriuReqType. +var ( + CriuReqType_name = map[int32]string{ + 0: "EMPTY", + 1: "DUMP", + 2: "RESTORE", + 3: "CHECK", + 4: "PRE_DUMP", + 5: "PAGE_SERVER", + 6: "NOTIFY", + 7: "CPUINFO_DUMP", + 8: "CPUINFO_CHECK", + 9: "FEATURE_CHECK", + 10: "VERSION", + 11: "WAIT_PID", + 12: "PAGE_SERVER_CHLD", + } + CriuReqType_value = map[string]int32{ + "EMPTY": 0, + "DUMP": 1, + "RESTORE": 2, + "CHECK": 3, + "PRE_DUMP": 4, + "PAGE_SERVER": 5, + "NOTIFY": 6, + "CPUINFO_DUMP": 7, + "CPUINFO_CHECK": 8, + "FEATURE_CHECK": 9, + "VERSION": 10, + "WAIT_PID": 11, + "PAGE_SERVER_CHLD": 12, + } +) + +func (x CriuReqType) Enum() *CriuReqType { + p := new(CriuReqType) + *p = x + return p +} + +func (x CriuReqType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CriuReqType) Descriptor() protoreflect.EnumDescriptor { + return file_rpc_rpc_proto_enumTypes[2].Descriptor() +} + +func (CriuReqType) Type() protoreflect.EnumType { + return &file_rpc_rpc_proto_enumTypes[2] +} + +func (x CriuReqType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *CriuReqType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = CriuReqType(num) + return nil +} + +// Deprecated: Use CriuReqType.Descriptor instead. +func (CriuReqType) EnumDescriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{2} +} + +type CriuPageServerInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address *string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + Port *int32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"` + Pid *int32 `protobuf:"varint,3,opt,name=pid" json:"pid,omitempty"` + Fd *int32 `protobuf:"varint,4,opt,name=fd" json:"fd,omitempty"` +} + +func (x *CriuPageServerInfo) Reset() { + *x = CriuPageServerInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuPageServerInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuPageServerInfo) ProtoMessage() {} + +func (x *CriuPageServerInfo) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_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 CriuPageServerInfo.ProtoReflect.Descriptor instead. +func (*CriuPageServerInfo) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{0} +} + +func (x *CriuPageServerInfo) GetAddress() string { + if x != nil && x.Address != nil { + return *x.Address + } + return "" +} + +func (x *CriuPageServerInfo) GetPort() int32 { + if x != nil && x.Port != nil { + return *x.Port + } + return 0 +} + +func (x *CriuPageServerInfo) GetPid() int32 { + if x != nil && x.Pid != nil { + return *x.Pid + } + return 0 +} + +func (x *CriuPageServerInfo) GetFd() int32 { + if x != nil && x.Fd != nil { + return *x.Fd + } + return 0 +} + +type CriuVethPair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IfIn *string `protobuf:"bytes,1,req,name=if_in,json=ifIn" json:"if_in,omitempty"` + IfOut *string `protobuf:"bytes,2,req,name=if_out,json=ifOut" json:"if_out,omitempty"` +} + +func (x *CriuVethPair) Reset() { + *x = CriuVethPair{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuVethPair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuVethPair) ProtoMessage() {} + +func (x *CriuVethPair) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[1] + 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 CriuVethPair.ProtoReflect.Descriptor instead. +func (*CriuVethPair) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{1} +} + +func (x *CriuVethPair) GetIfIn() string { + if x != nil && x.IfIn != nil { + return *x.IfIn + } + return "" +} + +func (x *CriuVethPair) GetIfOut() string { + if x != nil && x.IfOut != nil { + return *x.IfOut + } + return "" +} + +type ExtMountMap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` + Val *string `protobuf:"bytes,2,req,name=val" json:"val,omitempty"` +} + +func (x *ExtMountMap) Reset() { + *x = ExtMountMap{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtMountMap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtMountMap) ProtoMessage() {} + +func (x *ExtMountMap) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[2] + 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 ExtMountMap.ProtoReflect.Descriptor instead. +func (*ExtMountMap) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{2} +} + +func (x *ExtMountMap) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key + } + return "" +} + +func (x *ExtMountMap) GetVal() string { + if x != nil && x.Val != nil { + return *x.Val + } + return "" +} + +type JoinNamespace struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ns *string `protobuf:"bytes,1,req,name=ns" json:"ns,omitempty"` + NsFile *string `protobuf:"bytes,2,req,name=ns_file,json=nsFile" json:"ns_file,omitempty"` + ExtraOpt *string `protobuf:"bytes,3,opt,name=extra_opt,json=extraOpt" json:"extra_opt,omitempty"` +} + +func (x *JoinNamespace) Reset() { + *x = JoinNamespace{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JoinNamespace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JoinNamespace) ProtoMessage() {} + +func (x *JoinNamespace) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[3] + 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 JoinNamespace.ProtoReflect.Descriptor instead. +func (*JoinNamespace) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{3} +} + +func (x *JoinNamespace) GetNs() string { + if x != nil && x.Ns != nil { + return *x.Ns + } + return "" +} + +func (x *JoinNamespace) GetNsFile() string { + if x != nil && x.NsFile != nil { + return *x.NsFile + } + return "" +} + +func (x *JoinNamespace) GetExtraOpt() string { + if x != nil && x.ExtraOpt != nil { + return *x.ExtraOpt + } + return "" +} + +type InheritFd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` + Fd *int32 `protobuf:"varint,2,req,name=fd" json:"fd,omitempty"` +} + +func (x *InheritFd) Reset() { + *x = InheritFd{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InheritFd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InheritFd) ProtoMessage() {} + +func (x *InheritFd) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[4] + 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 InheritFd.ProtoReflect.Descriptor instead. +func (*InheritFd) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{4} +} + +func (x *InheritFd) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key + } + return "" +} + +func (x *InheritFd) GetFd() int32 { + if x != nil && x.Fd != nil { + return *x.Fd + } + return 0 +} + +type CgroupRoot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ctrl *string `protobuf:"bytes,1,opt,name=ctrl" json:"ctrl,omitempty"` + Path *string `protobuf:"bytes,2,req,name=path" json:"path,omitempty"` +} + +func (x *CgroupRoot) Reset() { + *x = CgroupRoot{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CgroupRoot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CgroupRoot) ProtoMessage() {} + +func (x *CgroupRoot) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[5] + 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 CgroupRoot.ProtoReflect.Descriptor instead. +func (*CgroupRoot) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{5} +} + +func (x *CgroupRoot) GetCtrl() string { + if x != nil && x.Ctrl != nil { + return *x.Ctrl + } + return "" +} + +func (x *CgroupRoot) GetPath() string { + if x != nil && x.Path != nil { + return *x.Path + } + return "" +} + +type UnixSk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inode *uint32 `protobuf:"varint,1,req,name=inode" json:"inode,omitempty"` +} + +func (x *UnixSk) Reset() { + *x = UnixSk{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnixSk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnixSk) ProtoMessage() {} + +func (x *UnixSk) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[6] + 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 UnixSk.ProtoReflect.Descriptor instead. +func (*UnixSk) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{6} +} + +func (x *UnixSk) GetInode() uint32 { + if x != nil && x.Inode != nil { + return *x.Inode + } + return 0 +} + +type CriuOpts struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImagesDirFd *int32 `protobuf:"varint,1,req,name=images_dir_fd,json=imagesDirFd" json:"images_dir_fd,omitempty"` + Pid *int32 `protobuf:"varint,2,opt,name=pid" json:"pid,omitempty"` // if not set on dump, will dump requesting process + LeaveRunning *bool `protobuf:"varint,3,opt,name=leave_running,json=leaveRunning" json:"leave_running,omitempty"` + ExtUnixSk *bool `protobuf:"varint,4,opt,name=ext_unix_sk,json=extUnixSk" json:"ext_unix_sk,omitempty"` + TcpEstablished *bool `protobuf:"varint,5,opt,name=tcp_established,json=tcpEstablished" json:"tcp_established,omitempty"` + EvasiveDevices *bool `protobuf:"varint,6,opt,name=evasive_devices,json=evasiveDevices" json:"evasive_devices,omitempty"` + ShellJob *bool `protobuf:"varint,7,opt,name=shell_job,json=shellJob" json:"shell_job,omitempty"` + FileLocks *bool `protobuf:"varint,8,opt,name=file_locks,json=fileLocks" json:"file_locks,omitempty"` + LogLevel *int32 `protobuf:"varint,9,opt,name=log_level,json=logLevel,def=2" json:"log_level,omitempty"` + LogFile *string `protobuf:"bytes,10,opt,name=log_file,json=logFile" json:"log_file,omitempty"` // No subdirs are allowed. Consider using work-dir + Ps *CriuPageServerInfo `protobuf:"bytes,11,opt,name=ps" json:"ps,omitempty"` + NotifyScripts *bool `protobuf:"varint,12,opt,name=notify_scripts,json=notifyScripts" json:"notify_scripts,omitempty"` + Root *string `protobuf:"bytes,13,opt,name=root" json:"root,omitempty"` + ParentImg *string `protobuf:"bytes,14,opt,name=parent_img,json=parentImg" json:"parent_img,omitempty"` + TrackMem *bool `protobuf:"varint,15,opt,name=track_mem,json=trackMem" json:"track_mem,omitempty"` + AutoDedup *bool `protobuf:"varint,16,opt,name=auto_dedup,json=autoDedup" json:"auto_dedup,omitempty"` + WorkDirFd *int32 `protobuf:"varint,17,opt,name=work_dir_fd,json=workDirFd" json:"work_dir_fd,omitempty"` + LinkRemap *bool `protobuf:"varint,18,opt,name=link_remap,json=linkRemap" json:"link_remap,omitempty"` + Veths []*CriuVethPair `protobuf:"bytes,19,rep,name=veths" json:"veths,omitempty"` // DEPRECATED, use external instead + CpuCap *uint32 `protobuf:"varint,20,opt,name=cpu_cap,json=cpuCap,def=4294967295" json:"cpu_cap,omitempty"` + ForceIrmap *bool `protobuf:"varint,21,opt,name=force_irmap,json=forceIrmap" json:"force_irmap,omitempty"` + ExecCmd []string `protobuf:"bytes,22,rep,name=exec_cmd,json=execCmd" json:"exec_cmd,omitempty"` + ExtMnt []*ExtMountMap `protobuf:"bytes,23,rep,name=ext_mnt,json=extMnt" json:"ext_mnt,omitempty"` // DEPRECATED, use external instead + ManageCgroups *bool `protobuf:"varint,24,opt,name=manage_cgroups,json=manageCgroups" json:"manage_cgroups,omitempty"` // backward compatibility + CgRoot []*CgroupRoot `protobuf:"bytes,25,rep,name=cg_root,json=cgRoot" json:"cg_root,omitempty"` + RstSibling *bool `protobuf:"varint,26,opt,name=rst_sibling,json=rstSibling" json:"rst_sibling,omitempty"` // swrk only + InheritFd []*InheritFd `protobuf:"bytes,27,rep,name=inherit_fd,json=inheritFd" json:"inherit_fd,omitempty"` // swrk only + AutoExtMnt *bool `protobuf:"varint,28,opt,name=auto_ext_mnt,json=autoExtMnt" json:"auto_ext_mnt,omitempty"` + ExtSharing *bool `protobuf:"varint,29,opt,name=ext_sharing,json=extSharing" json:"ext_sharing,omitempty"` + ExtMasters *bool `protobuf:"varint,30,opt,name=ext_masters,json=extMasters" json:"ext_masters,omitempty"` + SkipMnt []string `protobuf:"bytes,31,rep,name=skip_mnt,json=skipMnt" json:"skip_mnt,omitempty"` + EnableFs []string `protobuf:"bytes,32,rep,name=enable_fs,json=enableFs" json:"enable_fs,omitempty"` + UnixSkIno []*UnixSk `protobuf:"bytes,33,rep,name=unix_sk_ino,json=unixSkIno" json:"unix_sk_ino,omitempty"` // DEPRECATED, use external instead + ManageCgroupsMode *CriuCgMode `protobuf:"varint,34,opt,name=manage_cgroups_mode,json=manageCgroupsMode,enum=CriuCgMode" json:"manage_cgroups_mode,omitempty"` + GhostLimit *uint32 `protobuf:"varint,35,opt,name=ghost_limit,json=ghostLimit,def=1048576" json:"ghost_limit,omitempty"` + IrmapScanPaths []string `protobuf:"bytes,36,rep,name=irmap_scan_paths,json=irmapScanPaths" json:"irmap_scan_paths,omitempty"` + External []string `protobuf:"bytes,37,rep,name=external" json:"external,omitempty"` + EmptyNs *uint32 `protobuf:"varint,38,opt,name=empty_ns,json=emptyNs" json:"empty_ns,omitempty"` + JoinNs []*JoinNamespace `protobuf:"bytes,39,rep,name=join_ns,json=joinNs" json:"join_ns,omitempty"` + CgroupProps *string `protobuf:"bytes,41,opt,name=cgroup_props,json=cgroupProps" json:"cgroup_props,omitempty"` + CgroupPropsFile *string `protobuf:"bytes,42,opt,name=cgroup_props_file,json=cgroupPropsFile" json:"cgroup_props_file,omitempty"` + CgroupDumpController []string `protobuf:"bytes,43,rep,name=cgroup_dump_controller,json=cgroupDumpController" json:"cgroup_dump_controller,omitempty"` + FreezeCgroup *string `protobuf:"bytes,44,opt,name=freeze_cgroup,json=freezeCgroup" json:"freeze_cgroup,omitempty"` + Timeout *uint32 `protobuf:"varint,45,opt,name=timeout" json:"timeout,omitempty"` + TcpSkipInFlight *bool `protobuf:"varint,46,opt,name=tcp_skip_in_flight,json=tcpSkipInFlight" json:"tcp_skip_in_flight,omitempty"` + WeakSysctls *bool `protobuf:"varint,47,opt,name=weak_sysctls,json=weakSysctls" json:"weak_sysctls,omitempty"` + LazyPages *bool `protobuf:"varint,48,opt,name=lazy_pages,json=lazyPages" json:"lazy_pages,omitempty"` + StatusFd *int32 `protobuf:"varint,49,opt,name=status_fd,json=statusFd" json:"status_fd,omitempty"` + OrphanPtsMaster *bool `protobuf:"varint,50,opt,name=orphan_pts_master,json=orphanPtsMaster" json:"orphan_pts_master,omitempty"` + ConfigFile *string `protobuf:"bytes,51,opt,name=config_file,json=configFile" json:"config_file,omitempty"` + TcpClose *bool `protobuf:"varint,52,opt,name=tcp_close,json=tcpClose" json:"tcp_close,omitempty"` + LsmProfile *string `protobuf:"bytes,53,opt,name=lsm_profile,json=lsmProfile" json:"lsm_profile,omitempty"` + TlsCacert *string `protobuf:"bytes,54,opt,name=tls_cacert,json=tlsCacert" json:"tls_cacert,omitempty"` + TlsCacrl *string `protobuf:"bytes,55,opt,name=tls_cacrl,json=tlsCacrl" json:"tls_cacrl,omitempty"` + TlsCert *string `protobuf:"bytes,56,opt,name=tls_cert,json=tlsCert" json:"tls_cert,omitempty"` + TlsKey *string `protobuf:"bytes,57,opt,name=tls_key,json=tlsKey" json:"tls_key,omitempty"` + Tls *bool `protobuf:"varint,58,opt,name=tls" json:"tls,omitempty"` + TlsNoCnVerify *bool `protobuf:"varint,59,opt,name=tls_no_cn_verify,json=tlsNoCnVerify" json:"tls_no_cn_verify,omitempty"` + CgroupYard *string `protobuf:"bytes,60,opt,name=cgroup_yard,json=cgroupYard" json:"cgroup_yard,omitempty"` + PreDumpMode *CriuPreDumpMode `protobuf:"varint,61,opt,name=pre_dump_mode,json=preDumpMode,enum=CriuPreDumpMode,def=1" json:"pre_dump_mode,omitempty"` // optional bool check_mounts = 128; +} + +// Default values for CriuOpts fields. +const ( + Default_CriuOpts_LogLevel = int32(2) + Default_CriuOpts_CpuCap = uint32(4294967295) + Default_CriuOpts_GhostLimit = uint32(1048576) + Default_CriuOpts_PreDumpMode = CriuPreDumpMode_SPLICE +) + +func (x *CriuOpts) Reset() { + *x = CriuOpts{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuOpts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuOpts) ProtoMessage() {} + +func (x *CriuOpts) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[7] + 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 CriuOpts.ProtoReflect.Descriptor instead. +func (*CriuOpts) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{7} +} + +func (x *CriuOpts) GetImagesDirFd() int32 { + if x != nil && x.ImagesDirFd != nil { + return *x.ImagesDirFd + } + return 0 +} + +func (x *CriuOpts) GetPid() int32 { + if x != nil && x.Pid != nil { + return *x.Pid + } + return 0 +} + +func (x *CriuOpts) GetLeaveRunning() bool { + if x != nil && x.LeaveRunning != nil { + return *x.LeaveRunning + } + return false +} + +func (x *CriuOpts) GetExtUnixSk() bool { + if x != nil && x.ExtUnixSk != nil { + return *x.ExtUnixSk + } + return false +} + +func (x *CriuOpts) GetTcpEstablished() bool { + if x != nil && x.TcpEstablished != nil { + return *x.TcpEstablished + } + return false +} + +func (x *CriuOpts) GetEvasiveDevices() bool { + if x != nil && x.EvasiveDevices != nil { + return *x.EvasiveDevices + } + return false +} + +func (x *CriuOpts) GetShellJob() bool { + if x != nil && x.ShellJob != nil { + return *x.ShellJob + } + return false +} + +func (x *CriuOpts) GetFileLocks() bool { + if x != nil && x.FileLocks != nil { + return *x.FileLocks + } + return false +} + +func (x *CriuOpts) GetLogLevel() int32 { + if x != nil && x.LogLevel != nil { + return *x.LogLevel + } + return Default_CriuOpts_LogLevel +} + +func (x *CriuOpts) GetLogFile() string { + if x != nil && x.LogFile != nil { + return *x.LogFile + } + return "" +} + +func (x *CriuOpts) GetPs() *CriuPageServerInfo { + if x != nil { + return x.Ps + } + return nil +} + +func (x *CriuOpts) GetNotifyScripts() bool { + if x != nil && x.NotifyScripts != nil { + return *x.NotifyScripts + } + return false +} + +func (x *CriuOpts) GetRoot() string { + if x != nil && x.Root != nil { + return *x.Root + } + return "" +} + +func (x *CriuOpts) GetParentImg() string { + if x != nil && x.ParentImg != nil { + return *x.ParentImg + } + return "" +} + +func (x *CriuOpts) GetTrackMem() bool { + if x != nil && x.TrackMem != nil { + return *x.TrackMem + } + return false +} + +func (x *CriuOpts) GetAutoDedup() bool { + if x != nil && x.AutoDedup != nil { + return *x.AutoDedup + } + return false +} + +func (x *CriuOpts) GetWorkDirFd() int32 { + if x != nil && x.WorkDirFd != nil { + return *x.WorkDirFd + } + return 0 +} + +func (x *CriuOpts) GetLinkRemap() bool { + if x != nil && x.LinkRemap != nil { + return *x.LinkRemap + } + return false +} + +func (x *CriuOpts) GetVeths() []*CriuVethPair { + if x != nil { + return x.Veths + } + return nil +} + +func (x *CriuOpts) GetCpuCap() uint32 { + if x != nil && x.CpuCap != nil { + return *x.CpuCap + } + return Default_CriuOpts_CpuCap +} + +func (x *CriuOpts) GetForceIrmap() bool { + if x != nil && x.ForceIrmap != nil { + return *x.ForceIrmap + } + return false +} + +func (x *CriuOpts) GetExecCmd() []string { + if x != nil { + return x.ExecCmd + } + return nil +} + +func (x *CriuOpts) GetExtMnt() []*ExtMountMap { + if x != nil { + return x.ExtMnt + } + return nil +} + +func (x *CriuOpts) GetManageCgroups() bool { + if x != nil && x.ManageCgroups != nil { + return *x.ManageCgroups + } + return false +} + +func (x *CriuOpts) GetCgRoot() []*CgroupRoot { + if x != nil { + return x.CgRoot + } + return nil +} + +func (x *CriuOpts) GetRstSibling() bool { + if x != nil && x.RstSibling != nil { + return *x.RstSibling + } + return false +} + +func (x *CriuOpts) GetInheritFd() []*InheritFd { + if x != nil { + return x.InheritFd + } + return nil +} + +func (x *CriuOpts) GetAutoExtMnt() bool { + if x != nil && x.AutoExtMnt != nil { + return *x.AutoExtMnt + } + return false +} + +func (x *CriuOpts) GetExtSharing() bool { + if x != nil && x.ExtSharing != nil { + return *x.ExtSharing + } + return false +} + +func (x *CriuOpts) GetExtMasters() bool { + if x != nil && x.ExtMasters != nil { + return *x.ExtMasters + } + return false +} + +func (x *CriuOpts) GetSkipMnt() []string { + if x != nil { + return x.SkipMnt + } + return nil +} + +func (x *CriuOpts) GetEnableFs() []string { + if x != nil { + return x.EnableFs + } + return nil +} + +func (x *CriuOpts) GetUnixSkIno() []*UnixSk { + if x != nil { + return x.UnixSkIno + } + return nil +} + +func (x *CriuOpts) GetManageCgroupsMode() CriuCgMode { + if x != nil && x.ManageCgroupsMode != nil { + return *x.ManageCgroupsMode + } + return CriuCgMode_IGNORE +} + +func (x *CriuOpts) GetGhostLimit() uint32 { + if x != nil && x.GhostLimit != nil { + return *x.GhostLimit + } + return Default_CriuOpts_GhostLimit +} + +func (x *CriuOpts) GetIrmapScanPaths() []string { + if x != nil { + return x.IrmapScanPaths + } + return nil +} + +func (x *CriuOpts) GetExternal() []string { + if x != nil { + return x.External + } + return nil +} + +func (x *CriuOpts) GetEmptyNs() uint32 { + if x != nil && x.EmptyNs != nil { + return *x.EmptyNs + } + return 0 +} + +func (x *CriuOpts) GetJoinNs() []*JoinNamespace { + if x != nil { + return x.JoinNs + } + return nil +} + +func (x *CriuOpts) GetCgroupProps() string { + if x != nil && x.CgroupProps != nil { + return *x.CgroupProps + } + return "" +} + +func (x *CriuOpts) GetCgroupPropsFile() string { + if x != nil && x.CgroupPropsFile != nil { + return *x.CgroupPropsFile + } + return "" +} + +func (x *CriuOpts) GetCgroupDumpController() []string { + if x != nil { + return x.CgroupDumpController + } + return nil +} + +func (x *CriuOpts) GetFreezeCgroup() string { + if x != nil && x.FreezeCgroup != nil { + return *x.FreezeCgroup + } + return "" +} + +func (x *CriuOpts) GetTimeout() uint32 { + if x != nil && x.Timeout != nil { + return *x.Timeout + } + return 0 +} + +func (x *CriuOpts) GetTcpSkipInFlight() bool { + if x != nil && x.TcpSkipInFlight != nil { + return *x.TcpSkipInFlight + } + return false +} + +func (x *CriuOpts) GetWeakSysctls() bool { + if x != nil && x.WeakSysctls != nil { + return *x.WeakSysctls + } + return false +} + +func (x *CriuOpts) GetLazyPages() bool { + if x != nil && x.LazyPages != nil { + return *x.LazyPages + } + return false +} + +func (x *CriuOpts) GetStatusFd() int32 { + if x != nil && x.StatusFd != nil { + return *x.StatusFd + } + return 0 +} + +func (x *CriuOpts) GetOrphanPtsMaster() bool { + if x != nil && x.OrphanPtsMaster != nil { + return *x.OrphanPtsMaster + } + return false +} + +func (x *CriuOpts) GetConfigFile() string { + if x != nil && x.ConfigFile != nil { + return *x.ConfigFile + } + return "" +} + +func (x *CriuOpts) GetTcpClose() bool { + if x != nil && x.TcpClose != nil { + return *x.TcpClose + } + return false +} + +func (x *CriuOpts) GetLsmProfile() string { + if x != nil && x.LsmProfile != nil { + return *x.LsmProfile + } + return "" +} + +func (x *CriuOpts) GetTlsCacert() string { + if x != nil && x.TlsCacert != nil { + return *x.TlsCacert + } + return "" +} + +func (x *CriuOpts) GetTlsCacrl() string { + if x != nil && x.TlsCacrl != nil { + return *x.TlsCacrl + } + return "" +} + +func (x *CriuOpts) GetTlsCert() string { + if x != nil && x.TlsCert != nil { + return *x.TlsCert + } + return "" +} + +func (x *CriuOpts) GetTlsKey() string { + if x != nil && x.TlsKey != nil { + return *x.TlsKey + } + return "" +} + +func (x *CriuOpts) GetTls() bool { + if x != nil && x.Tls != nil { + return *x.Tls + } + return false +} + +func (x *CriuOpts) GetTlsNoCnVerify() bool { + if x != nil && x.TlsNoCnVerify != nil { + return *x.TlsNoCnVerify + } + return false +} + +func (x *CriuOpts) GetCgroupYard() string { + if x != nil && x.CgroupYard != nil { + return *x.CgroupYard + } + return "" +} + +func (x *CriuOpts) GetPreDumpMode() CriuPreDumpMode { + if x != nil && x.PreDumpMode != nil { + return *x.PreDumpMode + } + return Default_CriuOpts_PreDumpMode +} + +type CriuDumpResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Restored *bool `protobuf:"varint,1,opt,name=restored" json:"restored,omitempty"` +} + +func (x *CriuDumpResp) Reset() { + *x = CriuDumpResp{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuDumpResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuDumpResp) ProtoMessage() {} + +func (x *CriuDumpResp) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[8] + 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 CriuDumpResp.ProtoReflect.Descriptor instead. +func (*CriuDumpResp) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{8} +} + +func (x *CriuDumpResp) GetRestored() bool { + if x != nil && x.Restored != nil { + return *x.Restored + } + return false +} + +type CriuRestoreResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pid *int32 `protobuf:"varint,1,req,name=pid" json:"pid,omitempty"` +} + +func (x *CriuRestoreResp) Reset() { + *x = CriuRestoreResp{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuRestoreResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuRestoreResp) ProtoMessage() {} + +func (x *CriuRestoreResp) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[9] + 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 CriuRestoreResp.ProtoReflect.Descriptor instead. +func (*CriuRestoreResp) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{9} +} + +func (x *CriuRestoreResp) GetPid() int32 { + if x != nil && x.Pid != nil { + return *x.Pid + } + return 0 +} + +type CriuNotify struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Script *string `protobuf:"bytes,1,opt,name=script" json:"script,omitempty"` + Pid *int32 `protobuf:"varint,2,opt,name=pid" json:"pid,omitempty"` +} + +func (x *CriuNotify) Reset() { + *x = CriuNotify{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuNotify) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuNotify) ProtoMessage() {} + +func (x *CriuNotify) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[10] + 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 CriuNotify.ProtoReflect.Descriptor instead. +func (*CriuNotify) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{10} +} + +func (x *CriuNotify) GetScript() string { + if x != nil && x.Script != nil { + return *x.Script + } + return "" +} + +func (x *CriuNotify) GetPid() int32 { + if x != nil && x.Pid != nil { + return *x.Pid + } + return 0 +} + +// +// List of features which can queried via +// CRIU_REQ_TYPE__FEATURE_CHECK +type CriuFeatures struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MemTrack *bool `protobuf:"varint,1,opt,name=mem_track,json=memTrack" json:"mem_track,omitempty"` + LazyPages *bool `protobuf:"varint,2,opt,name=lazy_pages,json=lazyPages" json:"lazy_pages,omitempty"` +} + +func (x *CriuFeatures) Reset() { + *x = CriuFeatures{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuFeatures) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuFeatures) ProtoMessage() {} + +func (x *CriuFeatures) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[11] + 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 CriuFeatures.ProtoReflect.Descriptor instead. +func (*CriuFeatures) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{11} +} + +func (x *CriuFeatures) GetMemTrack() bool { + if x != nil && x.MemTrack != nil { + return *x.MemTrack + } + return false +} + +func (x *CriuFeatures) GetLazyPages() bool { + if x != nil && x.LazyPages != nil { + return *x.LazyPages + } + return false +} + +type CriuReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *CriuReqType `protobuf:"varint,1,req,name=type,enum=CriuReqType" json:"type,omitempty"` + Opts *CriuOpts `protobuf:"bytes,2,opt,name=opts" json:"opts,omitempty"` + NotifySuccess *bool `protobuf:"varint,3,opt,name=notify_success,json=notifySuccess" json:"notify_success,omitempty"` + // + // When set service won't close the connection but + // will wait for more req-s to appear. Works not + // for all request types. + KeepOpen *bool `protobuf:"varint,4,opt,name=keep_open,json=keepOpen" json:"keep_open,omitempty"` + // + // 'features' can be used to query which features + // are supported by the installed criu/kernel + // via RPC. + Features *CriuFeatures `protobuf:"bytes,5,opt,name=features" json:"features,omitempty"` + // 'pid' is used for WAIT_PID + Pid *uint32 `protobuf:"varint,6,opt,name=pid" json:"pid,omitempty"` +} + +func (x *CriuReq) Reset() { + *x = CriuReq{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuReq) ProtoMessage() {} + +func (x *CriuReq) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[12] + 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 CriuReq.ProtoReflect.Descriptor instead. +func (*CriuReq) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{12} +} + +func (x *CriuReq) GetType() CriuReqType { + if x != nil && x.Type != nil { + return *x.Type + } + return CriuReqType_EMPTY +} + +func (x *CriuReq) GetOpts() *CriuOpts { + if x != nil { + return x.Opts + } + return nil +} + +func (x *CriuReq) GetNotifySuccess() bool { + if x != nil && x.NotifySuccess != nil { + return *x.NotifySuccess + } + return false +} + +func (x *CriuReq) GetKeepOpen() bool { + if x != nil && x.KeepOpen != nil { + return *x.KeepOpen + } + return false +} + +func (x *CriuReq) GetFeatures() *CriuFeatures { + if x != nil { + return x.Features + } + return nil +} + +func (x *CriuReq) GetPid() uint32 { + if x != nil && x.Pid != nil { + return *x.Pid + } + return 0 +} + +type CriuResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *CriuReqType `protobuf:"varint,1,req,name=type,enum=CriuReqType" json:"type,omitempty"` + Success *bool `protobuf:"varint,2,req,name=success" json:"success,omitempty"` + Dump *CriuDumpResp `protobuf:"bytes,3,opt,name=dump" json:"dump,omitempty"` + Restore *CriuRestoreResp `protobuf:"bytes,4,opt,name=restore" json:"restore,omitempty"` + Notify *CriuNotify `protobuf:"bytes,5,opt,name=notify" json:"notify,omitempty"` + Ps *CriuPageServerInfo `protobuf:"bytes,6,opt,name=ps" json:"ps,omitempty"` + CrErrno *int32 `protobuf:"varint,7,opt,name=cr_errno,json=crErrno" json:"cr_errno,omitempty"` + Features *CriuFeatures `protobuf:"bytes,8,opt,name=features" json:"features,omitempty"` + CrErrmsg *string `protobuf:"bytes,9,opt,name=cr_errmsg,json=crErrmsg" json:"cr_errmsg,omitempty"` + Version *CriuVersion `protobuf:"bytes,10,opt,name=version" json:"version,omitempty"` + Status *int32 `protobuf:"varint,11,opt,name=status" json:"status,omitempty"` +} + +func (x *CriuResp) Reset() { + *x = CriuResp{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuResp) ProtoMessage() {} + +func (x *CriuResp) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[13] + 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 CriuResp.ProtoReflect.Descriptor instead. +func (*CriuResp) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{13} +} + +func (x *CriuResp) GetType() CriuReqType { + if x != nil && x.Type != nil { + return *x.Type + } + return CriuReqType_EMPTY +} + +func (x *CriuResp) GetSuccess() bool { + if x != nil && x.Success != nil { + return *x.Success + } + return false +} + +func (x *CriuResp) GetDump() *CriuDumpResp { + if x != nil { + return x.Dump + } + return nil +} + +func (x *CriuResp) GetRestore() *CriuRestoreResp { + if x != nil { + return x.Restore + } + return nil +} + +func (x *CriuResp) GetNotify() *CriuNotify { + if x != nil { + return x.Notify + } + return nil +} + +func (x *CriuResp) GetPs() *CriuPageServerInfo { + if x != nil { + return x.Ps + } + return nil +} + +func (x *CriuResp) GetCrErrno() int32 { + if x != nil && x.CrErrno != nil { + return *x.CrErrno + } + return 0 +} + +func (x *CriuResp) GetFeatures() *CriuFeatures { + if x != nil { + return x.Features + } + return nil +} + +func (x *CriuResp) GetCrErrmsg() string { + if x != nil && x.CrErrmsg != nil { + return *x.CrErrmsg + } + return "" +} + +func (x *CriuResp) GetVersion() *CriuVersion { + if x != nil { + return x.Version + } + return nil +} + +func (x *CriuResp) GetStatus() int32 { + if x != nil && x.Status != nil { + return *x.Status + } + return 0 +} + +// Answer for criu_req_type.VERSION requests +type CriuVersion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MajorNumber *int32 `protobuf:"varint,1,req,name=major_number,json=majorNumber" json:"major_number,omitempty"` + MinorNumber *int32 `protobuf:"varint,2,req,name=minor_number,json=minorNumber" json:"minor_number,omitempty"` + Gitid *string `protobuf:"bytes,3,opt,name=gitid" json:"gitid,omitempty"` + Sublevel *int32 `protobuf:"varint,4,opt,name=sublevel" json:"sublevel,omitempty"` + Extra *int32 `protobuf:"varint,5,opt,name=extra" json:"extra,omitempty"` + Name *string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` +} + +func (x *CriuVersion) Reset() { + *x = CriuVersion{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_rpc_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CriuVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CriuVersion) ProtoMessage() {} + +func (x *CriuVersion) ProtoReflect() protoreflect.Message { + mi := &file_rpc_rpc_proto_msgTypes[14] + 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 CriuVersion.ProtoReflect.Descriptor instead. +func (*CriuVersion) Descriptor() ([]byte, []int) { + return file_rpc_rpc_proto_rawDescGZIP(), []int{14} +} + +func (x *CriuVersion) GetMajorNumber() int32 { + if x != nil && x.MajorNumber != nil { + return *x.MajorNumber + } + return 0 +} + +func (x *CriuVersion) GetMinorNumber() int32 { + if x != nil && x.MinorNumber != nil { + return *x.MinorNumber + } + return 0 +} + +func (x *CriuVersion) GetGitid() string { + if x != nil && x.Gitid != nil { + return *x.Gitid + } + return "" +} + +func (x *CriuVersion) GetSublevel() int32 { + if x != nil && x.Sublevel != nil { + return *x.Sublevel + } + return 0 +} + +func (x *CriuVersion) GetExtra() int32 { + if x != nil && x.Extra != nil { + return *x.Extra + } + return 0 +} + +func (x *CriuVersion) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +var File_rpc_rpc_proto protoreflect.FileDescriptor + +var file_rpc_rpc_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x67, 0x0a, 0x15, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x66, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x66, 0x64, 0x22, 0x3c, 0x0a, 0x0e, 0x63, 0x72, 0x69, 0x75, + 0x5f, 0x76, 0x65, 0x74, 0x68, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x12, 0x13, 0x0a, 0x05, 0x69, 0x66, + 0x5f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x04, 0x69, 0x66, 0x49, 0x6e, 0x12, + 0x15, 0x0a, 0x06, 0x69, 0x66, 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x02, 0x28, 0x09, 0x52, + 0x05, 0x69, 0x66, 0x4f, 0x75, 0x74, 0x22, 0x33, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x5f, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x02, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, + 0x18, 0x02, 0x20, 0x02, 0x28, 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x56, 0x0a, 0x0e, 0x6a, + 0x6f, 0x69, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x02, 0x6e, 0x73, 0x12, 0x17, 0x0a, + 0x07, 0x6e, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x09, 0x52, 0x06, + 0x6e, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, + 0x6f, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x74, 0x72, 0x61, + 0x4f, 0x70, 0x74, 0x22, 0x2e, 0x0a, 0x0a, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x5f, 0x66, + 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x66, 0x64, 0x18, 0x02, 0x20, 0x02, 0x28, 0x05, 0x52, + 0x02, 0x66, 0x64, 0x22, 0x35, 0x0a, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x74, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x63, 0x74, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, + 0x20, 0x02, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x1f, 0x0a, 0x07, 0x75, 0x6e, + 0x69, 0x78, 0x5f, 0x73, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x02, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xba, 0x10, 0x0a, 0x09, + 0x63, 0x72, 0x69, 0x75, 0x5f, 0x6f, 0x70, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x73, 0x5f, 0x64, 0x69, 0x72, 0x5f, 0x66, 0x64, 0x18, 0x01, 0x20, 0x02, 0x28, 0x05, + 0x52, 0x0b, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x44, 0x69, 0x72, 0x46, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, + 0x23, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x75, 0x6e, + 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x78, + 0x5f, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x74, 0x55, 0x6e, + 0x69, 0x78, 0x53, 0x6b, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x63, 0x70, 0x5f, 0x65, 0x73, 0x74, 0x61, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x74, + 0x63, 0x70, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x27, 0x0a, + 0x0f, 0x65, 0x76, 0x61, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x76, 0x61, 0x73, 0x69, 0x76, 0x65, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x5f, + 0x6a, 0x6f, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x68, 0x65, 0x6c, 0x6c, + 0x4a, 0x6f, 0x62, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x4c, 0x6f, 0x63, + 0x6b, 0x73, 0x12, 0x1e, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x01, 0x32, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x65, 0x76, + 0x65, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x26, 0x0a, + 0x02, 0x70, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x72, 0x69, 0x75, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x52, 0x02, 0x70, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6e, + 0x6f, 0x74, 0x69, 0x66, 0x79, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x6d, 0x67, 0x12, + 0x1b, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x5f, 0x6d, 0x65, 0x6d, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x4d, 0x65, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, + 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x64, 0x75, 0x70, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x44, 0x65, 0x64, 0x75, 0x70, 0x12, 0x1e, 0x0a, 0x0b, 0x77, + 0x6f, 0x72, 0x6b, 0x5f, 0x64, 0x69, 0x72, 0x5f, 0x66, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x69, 0x72, 0x46, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, + 0x69, 0x6e, 0x6b, 0x5f, 0x72, 0x65, 0x6d, 0x61, 0x70, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x6d, 0x61, 0x70, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x65, + 0x74, 0x68, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x72, 0x69, 0x75, + 0x5f, 0x76, 0x65, 0x74, 0x68, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x52, 0x05, 0x76, 0x65, 0x74, 0x68, + 0x73, 0x12, 0x23, 0x0a, 0x07, 0x63, 0x70, 0x75, 0x5f, 0x63, 0x61, 0x70, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x0d, 0x3a, 0x0a, 0x34, 0x32, 0x39, 0x34, 0x39, 0x36, 0x37, 0x32, 0x39, 0x35, 0x52, 0x06, + 0x63, 0x70, 0x75, 0x43, 0x61, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, + 0x69, 0x72, 0x6d, 0x61, 0x70, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x49, 0x72, 0x6d, 0x61, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x78, 0x65, 0x63, 0x5f, + 0x63, 0x6d, 0x64, 0x18, 0x16, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, 0x65, 0x63, 0x43, + 0x6d, 0x64, 0x12, 0x27, 0x0a, 0x07, 0x65, 0x78, 0x74, 0x5f, 0x6d, 0x6e, 0x74, 0x18, 0x17, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x78, 0x74, 0x5f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x6d, 0x61, 0x70, 0x52, 0x06, 0x65, 0x78, 0x74, 0x4d, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x18, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x43, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x73, 0x12, 0x25, 0x0a, 0x07, 0x63, 0x67, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x19, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x52, 0x06, 0x63, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x73, 0x74, + 0x5f, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x72, 0x73, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x2a, 0x0a, 0x0a, 0x69, 0x6e, + 0x68, 0x65, 0x72, 0x69, 0x74, 0x5f, 0x66, 0x64, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x5f, 0x66, 0x64, 0x52, 0x09, 0x69, 0x6e, 0x68, + 0x65, 0x72, 0x69, 0x74, 0x46, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x65, + 0x78, 0x74, 0x5f, 0x6d, 0x6e, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, + 0x74, 0x6f, 0x45, 0x78, 0x74, 0x4d, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x5f, + 0x73, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x65, + 0x78, 0x74, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, + 0x5f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x65, 0x78, 0x74, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x6b, + 0x69, 0x70, 0x5f, 0x6d, 0x6e, 0x74, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x6b, + 0x69, 0x70, 0x4d, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x66, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x46, 0x73, 0x12, 0x28, 0x0a, 0x0b, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x73, 0x6b, 0x5f, 0x69, 0x6e, + 0x6f, 0x18, 0x21, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x73, + 0x6b, 0x52, 0x09, 0x75, 0x6e, 0x69, 0x78, 0x53, 0x6b, 0x49, 0x6e, 0x6f, 0x12, 0x3d, 0x0a, 0x13, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x6d, + 0x6f, 0x64, 0x65, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x72, 0x69, 0x75, + 0x5f, 0x63, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x52, 0x11, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x28, 0x0a, 0x0b, 0x67, + 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0d, + 0x3a, 0x07, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x52, 0x0a, 0x67, 0x68, 0x6f, 0x73, 0x74, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x69, 0x72, 0x6d, 0x61, 0x70, 0x5f, 0x73, + 0x63, 0x61, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x24, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0e, 0x69, 0x72, 0x6d, 0x61, 0x70, 0x53, 0x63, 0x61, 0x6e, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x25, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6e, 0x73, 0x18, 0x26, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x73, 0x12, 0x28, 0x0a, 0x07, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x6e, + 0x73, 0x18, 0x27, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x06, 0x6a, 0x6f, 0x69, 0x6e, 0x4e, 0x73, + 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x73, + 0x18, 0x29, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x72, + 0x6f, 0x70, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x70, 0x72, + 0x6f, 0x70, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x12, + 0x34, 0x0a, 0x16, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x64, 0x75, 0x6d, 0x70, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x2b, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x14, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x44, 0x75, 0x6d, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, 0x65, 0x65, 0x7a, 0x65, 0x5f, + 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x72, + 0x65, 0x65, 0x7a, 0x65, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x12, 0x2b, 0x0a, 0x12, 0x74, 0x63, 0x70, 0x5f, 0x73, 0x6b, 0x69, 0x70, + 0x5f, 0x69, 0x6e, 0x5f, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x18, 0x2e, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0f, 0x74, 0x63, 0x70, 0x53, 0x6b, 0x69, 0x70, 0x49, 0x6e, 0x46, 0x6c, 0x69, 0x67, 0x68, + 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x65, 0x61, 0x6b, 0x5f, 0x73, 0x79, 0x73, 0x63, 0x74, 0x6c, + 0x73, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, 0x65, 0x61, 0x6b, 0x53, 0x79, 0x73, + 0x63, 0x74, 0x6c, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x70, 0x61, 0x67, + 0x65, 0x73, 0x18, 0x30, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6c, 0x61, 0x7a, 0x79, 0x50, 0x61, + 0x67, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x66, 0x64, + 0x18, 0x31, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x46, 0x64, + 0x12, 0x2a, 0x0a, 0x11, 0x6f, 0x72, 0x70, 0x68, 0x61, 0x6e, 0x5f, 0x70, 0x74, 0x73, 0x5f, 0x6d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x18, 0x32, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6f, 0x72, 0x70, + 0x68, 0x61, 0x6e, 0x50, 0x74, 0x73, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x33, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x74, 0x63, 0x70, 0x5f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x34, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x74, 0x63, 0x70, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x73, + 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x35, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x6c, 0x73, 0x6d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, + 0x6c, 0x73, 0x5f, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x18, 0x36, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x74, 0x6c, 0x73, 0x43, 0x61, 0x63, 0x65, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6c, + 0x73, 0x5f, 0x63, 0x61, 0x63, 0x72, 0x6c, 0x18, 0x37, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, + 0x6c, 0x73, 0x43, 0x61, 0x63, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x6c, 0x73, 0x5f, 0x63, + 0x65, 0x72, 0x74, 0x18, 0x38, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x6c, 0x73, 0x43, 0x65, + 0x72, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x6c, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x39, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x6c, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x74, + 0x6c, 0x73, 0x18, 0x3a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x74, 0x6c, 0x73, 0x12, 0x27, 0x0a, + 0x10, 0x74, 0x6c, 0x73, 0x5f, 0x6e, 0x6f, 0x5f, 0x63, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x18, 0x3b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6c, 0x73, 0x4e, 0x6f, 0x43, 0x6e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x5f, 0x79, 0x61, 0x72, 0x64, 0x18, 0x3c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x59, 0x61, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x0d, 0x70, 0x72, 0x65, 0x5f, 0x64, + 0x75, 0x6d, 0x70, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x3d, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, + 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x70, 0x72, 0x65, 0x5f, 0x64, 0x75, 0x6d, 0x70, 0x5f, 0x6d, + 0x6f, 0x64, 0x65, 0x3a, 0x06, 0x53, 0x50, 0x4c, 0x49, 0x43, 0x45, 0x52, 0x0b, 0x70, 0x72, 0x65, + 0x44, 0x75, 0x6d, 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x22, 0x2c, 0x0a, 0x0e, 0x63, 0x72, 0x69, 0x75, + 0x5f, 0x64, 0x75, 0x6d, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x22, 0x25, 0x0a, 0x11, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x72, + 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x02, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x37, 0x0a, + 0x0b, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x0d, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x5f, 0x74, + 0x72, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x54, + 0x72, 0x61, 0x63, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x70, 0x61, 0x67, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6c, 0x61, 0x7a, 0x79, 0x50, 0x61, + 0x67, 0x65, 0x73, 0x22, 0xd0, 0x01, 0x0a, 0x08, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x72, 0x65, 0x71, + 0x12, 0x22, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0e, 0x32, 0x0e, + 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x72, 0x65, 0x71, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x04, 0x6f, 0x70, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x6f, 0x70, 0x74, 0x73, 0x52, 0x04, + 0x6f, 0x70, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6e, 0x6f, + 0x74, 0x69, 0x66, 0x79, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6b, + 0x65, 0x65, 0x70, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x6b, 0x65, 0x65, 0x70, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x2a, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x72, 0x69, + 0x75, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x8f, 0x03, 0x0a, 0x09, 0x63, 0x72, 0x69, 0x75, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x02, + 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x72, 0x65, 0x71, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x75, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x64, 0x75, 0x6d, 0x70, 0x5f, 0x72, 0x65, 0x73, + 0x70, 0x52, 0x04, 0x64, 0x75, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, + 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x52, 0x07, 0x72, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x6e, 0x6f, 0x74, + 0x69, 0x66, 0x79, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x26, 0x0a, 0x02, 0x70, + 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x52, + 0x02, 0x70, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x72, 0x5f, 0x65, 0x72, 0x72, 0x6e, 0x6f, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x72, 0x45, 0x72, 0x72, 0x6e, 0x6f, 0x12, 0x2a, + 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x72, + 0x5f, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, + 0x72, 0x45, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x12, 0x27, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x72, 0x69, 0x75, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xb0, 0x01, 0x0a, 0x0c, 0x63, 0x72, 0x69, + 0x75, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x6a, + 0x6f, 0x72, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x02, 0x28, 0x05, 0x52, + 0x0b, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, + 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x02, + 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x67, 0x69, 0x74, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x67, 0x69, 0x74, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x2a, 0x5f, 0x0a, 0x0c, 0x63, + 0x72, 0x69, 0x75, 0x5f, 0x63, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x49, + 0x47, 0x4e, 0x4f, 0x52, 0x45, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x47, 0x5f, 0x4e, 0x4f, + 0x4e, 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x52, 0x4f, 0x50, 0x53, 0x10, 0x02, 0x12, + 0x08, 0x0a, 0x04, 0x53, 0x4f, 0x46, 0x54, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x55, 0x4c, + 0x4c, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x10, 0x05, 0x12, + 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x06, 0x2a, 0x2d, 0x0a, 0x12, + 0x63, 0x72, 0x69, 0x75, 0x5f, 0x70, 0x72, 0x65, 0x5f, 0x64, 0x75, 0x6d, 0x70, 0x5f, 0x6d, 0x6f, + 0x64, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x50, 0x4c, 0x49, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0b, + 0x0a, 0x07, 0x56, 0x4d, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x2a, 0xd0, 0x01, 0x0a, 0x0d, + 0x63, 0x72, 0x69, 0x75, 0x5f, 0x72, 0x65, 0x71, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, + 0x05, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x55, 0x4d, 0x50, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x02, 0x12, + 0x09, 0x0a, 0x05, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x52, + 0x45, 0x5f, 0x44, 0x55, 0x4d, 0x50, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x41, 0x47, 0x45, + 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, + 0x49, 0x46, 0x59, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x50, 0x55, 0x49, 0x4e, 0x46, 0x4f, + 0x5f, 0x44, 0x55, 0x4d, 0x50, 0x10, 0x07, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x50, 0x55, 0x49, 0x4e, + 0x46, 0x4f, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x10, 0x08, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x45, + 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x10, 0x09, 0x12, 0x0b, 0x0a, + 0x07, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x0a, 0x12, 0x0c, 0x0a, 0x08, 0x57, 0x41, + 0x49, 0x54, 0x5f, 0x50, 0x49, 0x44, 0x10, 0x0b, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x47, 0x45, + 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x43, 0x48, 0x4c, 0x44, 0x10, 0x0c, +} + +var ( + file_rpc_rpc_proto_rawDescOnce sync.Once + file_rpc_rpc_proto_rawDescData = file_rpc_rpc_proto_rawDesc +) + +func file_rpc_rpc_proto_rawDescGZIP() []byte { + file_rpc_rpc_proto_rawDescOnce.Do(func() { + file_rpc_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_rpc_proto_rawDescData) + }) + return file_rpc_rpc_proto_rawDescData +} + +var file_rpc_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_rpc_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_rpc_rpc_proto_goTypes = []interface{}{ + (CriuCgMode)(0), // 0: criu_cg_mode + (CriuPreDumpMode)(0), // 1: criu_pre_dump_mode + (CriuReqType)(0), // 2: criu_req_type + (*CriuPageServerInfo)(nil), // 3: criu_page_server_info + (*CriuVethPair)(nil), // 4: criu_veth_pair + (*ExtMountMap)(nil), // 5: ext_mount_map + (*JoinNamespace)(nil), // 6: join_namespace + (*InheritFd)(nil), // 7: inherit_fd + (*CgroupRoot)(nil), // 8: cgroup_root + (*UnixSk)(nil), // 9: unix_sk + (*CriuOpts)(nil), // 10: criu_opts + (*CriuDumpResp)(nil), // 11: criu_dump_resp + (*CriuRestoreResp)(nil), // 12: criu_restore_resp + (*CriuNotify)(nil), // 13: criu_notify + (*CriuFeatures)(nil), // 14: criu_features + (*CriuReq)(nil), // 15: criu_req + (*CriuResp)(nil), // 16: criu_resp + (*CriuVersion)(nil), // 17: criu_version +} +var file_rpc_rpc_proto_depIdxs = []int32{ + 3, // 0: criu_opts.ps:type_name -> criu_page_server_info + 4, // 1: criu_opts.veths:type_name -> criu_veth_pair + 5, // 2: criu_opts.ext_mnt:type_name -> ext_mount_map + 8, // 3: criu_opts.cg_root:type_name -> cgroup_root + 7, // 4: criu_opts.inherit_fd:type_name -> inherit_fd + 9, // 5: criu_opts.unix_sk_ino:type_name -> unix_sk + 0, // 6: criu_opts.manage_cgroups_mode:type_name -> criu_cg_mode + 6, // 7: criu_opts.join_ns:type_name -> join_namespace + 1, // 8: criu_opts.pre_dump_mode:type_name -> criu_pre_dump_mode + 2, // 9: criu_req.type:type_name -> criu_req_type + 10, // 10: criu_req.opts:type_name -> criu_opts + 14, // 11: criu_req.features:type_name -> criu_features + 2, // 12: criu_resp.type:type_name -> criu_req_type + 11, // 13: criu_resp.dump:type_name -> criu_dump_resp + 12, // 14: criu_resp.restore:type_name -> criu_restore_resp + 13, // 15: criu_resp.notify:type_name -> criu_notify + 3, // 16: criu_resp.ps:type_name -> criu_page_server_info + 14, // 17: criu_resp.features:type_name -> criu_features + 17, // 18: criu_resp.version:type_name -> criu_version + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name +} + +func init() { file_rpc_rpc_proto_init() } +func file_rpc_rpc_proto_init() { + if File_rpc_rpc_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpc_rpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuPageServerInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuVethPair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtMountMap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JoinNamespace); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InheritFd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CgroupRoot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnixSk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuOpts); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuDumpResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuRestoreResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuNotify); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuFeatures); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_rpc_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CriuVersion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_rpc_proto_rawDesc, + NumEnums: 3, + NumMessages: 15, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpc_rpc_proto_goTypes, + DependencyIndexes: file_rpc_rpc_proto_depIdxs, + EnumInfos: file_rpc_rpc_proto_enumTypes, + MessageInfos: file_rpc_rpc_proto_msgTypes, + }.Build() + File_rpc_rpc_proto = out.File + file_rpc_rpc_proto_rawDesc = nil + file_rpc_rpc_proto_goTypes = nil + file_rpc_rpc_proto_depIdxs = nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/.golangci.yaml b/cluster-autoscaler/vendor/github.com/cilium/ebpf/.golangci.yaml new file mode 100644 index 000000000000..a88374197ecb --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/.golangci.yaml @@ -0,0 +1,29 @@ +--- +issues: + exclude-rules: + # syscall param structs will have unused fields in Go code. + - path: syscall.*.go + linters: + - structcheck + +linters: + disable-all: true + enable: + - deadcode + - errcheck + - goimports + - gosimple + - govet + - ineffassign + - misspell + - staticcheck + - structcheck + - typecheck + - unused + - varcheck + + # Could be enabled later: + # - gocyclo + # - prealloc + # - maligned + # - gosec diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/ARCHITECTURE.md b/cluster-autoscaler/vendor/github.com/cilium/ebpf/ARCHITECTURE.md new file mode 100644 index 000000000000..aee9c0a0d4d5 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/ARCHITECTURE.md @@ -0,0 +1,80 @@ +Architecture of the library +=== + + ELF -> Specifications -> Objects -> Links + +ELF +--- + +BPF is usually produced by using Clang to compile a subset of C. Clang outputs +an ELF file which contains program byte code (aka BPF), but also metadata for +maps used by the program. The metadata follows the conventions set by libbpf +shipped with the kernel. Certain ELF sections have special meaning +and contain structures defined by libbpf. Newer versions of clang emit +additional metadata in BPF Type Format (aka BTF). + +The library aims to be compatible with libbpf so that moving from a C toolchain +to a Go one creates little friction. To that end, the [ELF reader](elf_reader.go) +is tested against the Linux selftests and avoids introducing custom behaviour +if possible. + +The output of the ELF reader is a `CollectionSpec` which encodes +all of the information contained in the ELF in a form that is easy to work with +in Go. + +### BTF + +The BPF Type Format describes more than just the types used by a BPF program. It +includes debug aids like which source line corresponds to which instructions and +what global variables are used. + +[BTF parsing](internal/btf/) lives in a separate internal package since exposing +it would mean an additional maintenance burden, and because the API still +has sharp corners. The most important concept is the `btf.Type` interface, which +also describes things that aren't really types like `.rodata` or `.bss` sections. +`btf.Type`s can form cyclical graphs, which can easily lead to infinite loops if +one is not careful. Hopefully a safe pattern to work with `btf.Type` emerges as +we write more code that deals with it. + +Specifications +--- + +`CollectionSpec`, `ProgramSpec` and `MapSpec` are blueprints for in-kernel +objects and contain everything necessary to execute the relevant `bpf(2)` +syscalls. Since the ELF reader outputs a `CollectionSpec` it's possible to +modify clang-compiled BPF code, for example to rewrite constants. At the same +time the [asm](asm/) package provides an assembler that can be used to generate +`ProgramSpec` on the fly. + +Creating a spec should never require any privileges or be restricted in any way, +for example by only allowing programs in native endianness. This ensures that +the library stays flexible. + +Objects +--- + +`Program` and `Map` are the result of loading specs into the kernel. Sometimes +loading a spec will fail because the kernel is too old, or a feature is not +enabled. There are multiple ways the library deals with that: + +* Fallback: older kernels don't allowing naming programs and maps. The library + automatically detects support for names, and omits them during load if + necessary. This works since name is primarily a debug aid. + +* Sentinel error: sometimes it's possible to detect that a feature isn't available. + In that case the library will return an error wrapping `ErrNotSupported`. + This is also useful to skip tests that can't run on the current kernel. + +Once program and map objects are loaded they expose the kernel's low-level API, +e.g. `NextKey`. Often this API is awkward to use in Go, so there are safer +wrappers on top of the low-level API, like `MapIterator`. The low-level API is +useful as an out when our higher-level API doesn't support a particular use case. + +Links +--- + +BPF can be attached to many different points in the kernel and newer BPF hooks +tend to use bpf_link to do so. Older hooks unfortunately use a combination of +syscalls, netlink messages, etc. Adding support for a new link type should not +pull in large dependencies like netlink, so XDP programs or tracepoints are +out of scope. diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/CONTRIBUTING.md b/cluster-autoscaler/vendor/github.com/cilium/ebpf/CONTRIBUTING.md new file mode 100644 index 000000000000..97c794f3a9b3 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# How to contribute + +Development is on [GitHub](https://github.com/cilium/ebpf) and contributions in +the form of pull requests and issues reporting bugs or suggesting new features +are welcome. Please take a look at [the architecture](ARCHITECTURE.md) to get +a better understanding for the high-level goals. + +New features must be accompanied by tests. Before starting work on any large +feature, please [join](https://cilium.herokuapp.com/) the +[#libbpf-go](https://cilium.slack.com/messages/libbpf-go) channel on Slack to +discuss the design first. + +When submitting pull requests, consider writing details about what problem you +are solving and why the proposed approach solves that problem in commit messages +and/or pull request description to help future library users and maintainers to +reason about the proposed changes. + +## Running the tests + +Many of the tests require privileges to set resource limits and load eBPF code. +The easiest way to obtain these is to run the tests with `sudo`: + + sudo go test ./... \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/Makefile b/cluster-autoscaler/vendor/github.com/cilium/ebpf/Makefile new file mode 100644 index 000000000000..5d4195833cab --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/Makefile @@ -0,0 +1,67 @@ +# The development version of clang is distributed as the 'clang' binary, +# while stable/released versions have a version number attached. +# Pin the default clang to a stable version. +CLANG ?= clang-11 +CFLAGS := -target bpf -O2 -g -Wall -Werror $(CFLAGS) + +# Obtain an absolute path to the directory of the Makefile. +# Assume the Makefile is in the root of the repository. +REPODIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +UIDGID := $(shell stat -c '%u:%g' ${REPODIR}) + +IMAGE := $(shell cat ${REPODIR}/testdata/docker/IMAGE) +VERSION := $(shell cat ${REPODIR}/testdata/docker/VERSION) + +# clang <8 doesn't tag relocs properly (STT_NOTYPE) +# clang 9 is the first version emitting BTF +TARGETS := \ + testdata/loader-clang-7 \ + testdata/loader-clang-9 \ + testdata/loader-clang-11 \ + testdata/invalid_map \ + testdata/raw_tracepoint \ + testdata/invalid_map_static \ + testdata/initialized_btf_map \ + testdata/strings \ + internal/btf/testdata/relocs + +.PHONY: all clean docker-all docker-shell + +.DEFAULT_TARGET = docker-all + +# Build all ELF binaries using a Dockerized LLVM toolchain. +docker-all: + docker run --rm --user "${UIDGID}" \ + -v "${REPODIR}":/ebpf -w /ebpf --env MAKEFLAGS \ + "${IMAGE}:${VERSION}" \ + make all + +# (debug) Drop the user into a shell inside the Docker container as root. +docker-shell: + docker run --rm -ti \ + -v "${REPODIR}":/ebpf -w /ebpf \ + "${IMAGE}:${VERSION}" + +clean: + -$(RM) testdata/*.elf + -$(RM) internal/btf/testdata/*.elf + +all: $(addsuffix -el.elf,$(TARGETS)) $(addsuffix -eb.elf,$(TARGETS)) + +testdata/loader-%-el.elf: testdata/loader.c + $* $(CFLAGS) -mlittle-endian -c $< -o $@ + +testdata/loader-%-eb.elf: testdata/loader.c + $* $(CFLAGS) -mbig-endian -c $< -o $@ + +%-el.elf: %.c + $(CLANG) $(CFLAGS) -mlittle-endian -c $< -o $@ + +%-eb.elf : %.c + $(CLANG) $(CFLAGS) -mbig-endian -c $< -o $@ + +# Usage: make VMLINUX=/path/to/vmlinux vmlinux-btf +.PHONY: vmlinux-btf +vmlinux-btf: internal/btf/testdata/vmlinux-btf.gz +internal/btf/testdata/vmlinux-btf.gz: $(VMLINUX) + objcopy --dump-section .BTF=/dev/stdout "$<" /dev/null | gzip > "$@" diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/README.md b/cluster-autoscaler/vendor/github.com/cilium/ebpf/README.md new file mode 100644 index 000000000000..76c3c303bb1b --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/README.md @@ -0,0 +1,62 @@ +# eBPF + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/cilium/ebpf)](https://pkg.go.dev/github.com/cilium/ebpf) + +eBPF is a pure Go library that provides utilities for loading, compiling, and +debugging eBPF programs. It has minimal external dependencies and is intended to +be used in long running processes. + +* [asm](https://pkg.go.dev/github.com/cilium/ebpf/asm) contains a basic + assembler +* [link](https://pkg.go.dev/github.com/cilium/ebpf/link) allows attaching eBPF + to various hooks +* [perf](https://pkg.go.dev/github.com/cilium/ebpf/perf) allows reading from a + `PERF_EVENT_ARRAY` +* [cmd/bpf2go](https://pkg.go.dev/github.com/cilium/ebpf/cmd/bpf2go) allows + compiling and embedding eBPF programs in Go code + +The library is maintained by [Cloudflare](https://www.cloudflare.com) and +[Cilium](https://www.cilium.io). Feel free to +[join](https://cilium.herokuapp.com/) the +[#libbpf-go](https://cilium.slack.com/messages/libbpf-go) channel on Slack. + +## Current status + +The package is production ready, but **the API is explicitly unstable right +now**. Expect to update your code if you want to follow along. + +## Getting Started + +A small collection of Go and eBPF programs that serve as examples for building +your own tools can be found under [examples/](examples/). + +Contributions are highly encouraged, as they highlight certain use cases of +eBPF and the library, and help shape the future of the project. + +## Requirements + +* A version of Go that is [supported by + upstream](https://golang.org/doc/devel/release.html#policy) +* Linux 4.9, 4.19 or 5.4 (versions in-between should work, but are not tested) + +## Useful resources + +* [eBPF.io](https://ebpf.io) (recommended) +* [Cilium eBPF documentation](https://docs.cilium.io/en/latest/bpf/#bpf-guide) + (recommended) +* [Linux documentation on + BPF](https://www.kernel.org/doc/html/latest/networking/filter.html) +* [eBPF features by Linux + version](https://github.com/iovisor/bcc/blob/master/docs/kernel-versions.md) + +## Regenerating Testdata + +Run `make` in the root of this repository to rebuild testdata in all +subpackages. This requires Docker, as it relies on a standardized build +environment to keep the build output stable. + +The toolchain image build files are kept in [testdata/docker/](testdata/docker/). + +## License + +MIT diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/abi.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/abi.go deleted file mode 100644 index f86a17ee7226..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/abi.go +++ /dev/null @@ -1,200 +0,0 @@ -package ebpf - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "os" - "syscall" - - "github.com/cilium/ebpf/internal" -) - -// MapABI are the attributes of a Map which are available across all supported kernels. -type MapABI struct { - Type MapType - KeySize uint32 - ValueSize uint32 - MaxEntries uint32 - Flags uint32 -} - -func newMapABIFromSpec(spec *MapSpec) *MapABI { - return &MapABI{ - spec.Type, - spec.KeySize, - spec.ValueSize, - spec.MaxEntries, - spec.Flags, - } -} - -func newMapABIFromFd(fd *internal.FD) (string, *MapABI, error) { - info, err := bpfGetMapInfoByFD(fd) - if err != nil { - if errors.Is(err, syscall.EINVAL) { - abi, err := newMapABIFromProc(fd) - return "", abi, err - } - return "", nil, err - } - - return "", &MapABI{ - MapType(info.mapType), - info.keySize, - info.valueSize, - info.maxEntries, - info.flags, - }, nil -} - -func newMapABIFromProc(fd *internal.FD) (*MapABI, error) { - var abi MapABI - err := scanFdInfo(fd, map[string]interface{}{ - "map_type": &abi.Type, - "key_size": &abi.KeySize, - "value_size": &abi.ValueSize, - "max_entries": &abi.MaxEntries, - "map_flags": &abi.Flags, - }) - if err != nil { - return nil, err - } - return &abi, nil -} - -// Equal returns true if two ABIs have the same values. -func (abi *MapABI) Equal(other *MapABI) bool { - switch { - case abi.Type != other.Type: - return false - case abi.KeySize != other.KeySize: - return false - case abi.ValueSize != other.ValueSize: - return false - case abi.MaxEntries != other.MaxEntries: - return false - case abi.Flags != other.Flags: - return false - default: - return true - } -} - -// ProgramABI are the attributes of a Program which are available across all supported kernels. -type ProgramABI struct { - Type ProgramType -} - -func newProgramABIFromFd(fd *internal.FD) (string, *ProgramABI, error) { - info, err := bpfGetProgInfoByFD(fd) - if err != nil { - if errors.Is(err, syscall.EINVAL) { - return newProgramABIFromProc(fd) - } - - return "", nil, err - } - - var name string - if bpfName := internal.CString(info.name[:]); bpfName != "" { - name = bpfName - } else { - name = internal.CString(info.tag[:]) - } - - return name, &ProgramABI{ - Type: ProgramType(info.progType), - }, nil -} - -func newProgramABIFromProc(fd *internal.FD) (string, *ProgramABI, error) { - var ( - abi ProgramABI - name string - ) - - err := scanFdInfo(fd, map[string]interface{}{ - "prog_type": &abi.Type, - "prog_tag": &name, - }) - if errors.Is(err, errMissingFields) { - return "", nil, &internal.UnsupportedFeatureError{ - Name: "reading ABI from /proc/self/fdinfo", - MinimumVersion: internal.Version{4, 11, 0}, - } - } - if err != nil { - return "", nil, err - } - - return name, &abi, nil -} - -func scanFdInfo(fd *internal.FD, fields map[string]interface{}) error { - raw, err := fd.Value() - if err != nil { - return err - } - - fh, err := os.Open(fmt.Sprintf("/proc/self/fdinfo/%d", raw)) - if err != nil { - return err - } - defer fh.Close() - - if err := scanFdInfoReader(fh, fields); err != nil { - return fmt.Errorf("%s: %w", fh.Name(), err) - } - return nil -} - -var errMissingFields = errors.New("missing fields") - -func scanFdInfoReader(r io.Reader, fields map[string]interface{}) error { - var ( - scanner = bufio.NewScanner(r) - scanned int - ) - - for scanner.Scan() { - parts := bytes.SplitN(scanner.Bytes(), []byte("\t"), 2) - if len(parts) != 2 { - continue - } - - name := bytes.TrimSuffix(parts[0], []byte(":")) - field, ok := fields[string(name)] - if !ok { - continue - } - - if n, err := fmt.Fscanln(bytes.NewReader(parts[1]), field); err != nil || n != 1 { - return fmt.Errorf("can't parse field %s: %v", name, err) - } - - scanned++ - } - - if err := scanner.Err(); err != nil { - return err - } - - if scanned != len(fields) { - return errMissingFields - } - - return nil -} - -// Equal returns true if two ABIs have the same values. -func (abi *ProgramABI) Equal(other *ProgramABI) bool { - switch { - case abi.Type != other.Type: - return false - default: - return true - } -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/func.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/func.go index 97f794cdb2a7..1d77745450b4 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/func.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/func.go @@ -7,7 +7,7 @@ type BuiltinFunc int32 // eBPF built-in functions // -// You can renegerate this list using the following gawk script: +// You can regenerate this list using the following gawk script: // // /FN\(.+\),/ { // match($1, /\((.+)\)/, r) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/instruction.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/instruction.go index 890dc008acf6..f09b083efb9c 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/instruction.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/instruction.go @@ -1,12 +1,16 @@ package asm import ( + "crypto/sha1" "encoding/binary" + "encoding/hex" "errors" "fmt" "io" "math" "strings" + + "github.com/cilium/ebpf/internal/unix" ) // InstructionSize is the size of a BPF instruction in bytes @@ -159,6 +163,9 @@ func (ins *Instruction) mapOffset() uint32 { return uint32(uint64(ins.Constant) >> 32) } +// isLoadFromMap returns true if the instruction loads from a map. +// +// This covers both loading the map pointer and direct map value loads. func (ins *Instruction) isLoadFromMap() bool { return ins.OpCode == LoadImmOp(DWord) && (ins.Src == PseudoMapFD || ins.Src == PseudoMapValue) } @@ -330,7 +337,7 @@ func (insns Instructions) ReferenceOffsets() map[string][]int { // You can control indentation of symbols by // specifying a width. Setting a precision controls the indentation of // instructions. -// The default character is a tab, which can be overriden by specifying +// The default character is a tab, which can be overridden by specifying // the ' ' space flag. func (insns Instructions) Format(f fmt.State, c rune) { if c != 's' && c != 'v' { @@ -375,8 +382,6 @@ func (insns Instructions) Format(f fmt.State, c rune) { } fmt.Fprintf(f, "%s%*d: %v\n", indent, offsetWidth, iter.Offset, iter.Ins) } - - return } // Marshal encodes a BPF program into the kernel format. @@ -390,6 +395,25 @@ func (insns Instructions) Marshal(w io.Writer, bo binary.ByteOrder) error { return nil } +// Tag calculates the kernel tag for a series of instructions. +// +// It mirrors bpf_prog_calc_tag in the kernel and so can be compared +// to ProgramInfo.Tag to figure out whether a loaded program matches +// certain instructions. +func (insns Instructions) Tag(bo binary.ByteOrder) (string, error) { + h := sha1.New() + for i, ins := range insns { + if ins.isLoadFromMap() { + ins.Constant = 0 + } + _, err := ins.Marshal(h, bo) + if err != nil { + return "", fmt.Errorf("instruction %d: %w", i, err) + } + } + return hex.EncodeToString(h.Sum(nil)[:unix.BPF_TAG_SIZE]), nil +} + // Iterate allows iterating a BPF program while keeping track of // various offsets. // @@ -417,6 +441,7 @@ func (iter *InstructionIterator) Next() bool { } if iter.Ins != nil { + iter.Index++ iter.Offset += RawInstructionOffset(iter.Ins.OpCode.rawInstructions()) } iter.Ins = &iter.insns[0] diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/collection.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/collection.go index 81ee2bd1a6bc..8e362900326f 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/collection.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/collection.go @@ -131,10 +131,11 @@ func (cs *CollectionSpec) RewriteConstants(consts map[string]interface{}) error return nil } -// Assign the contents of a collection spec to a struct. +// Assign the contents of a CollectionSpec to a struct. // // This function is a short-cut to manually checking the presence -// of maps and programs in a collection spec. +// of maps and programs in a collection spec. Consider using bpf2go if this +// sounds useful. // // The argument to must be a pointer to a struct. A field of the // struct is updated with values from Programs or Maps if it @@ -173,21 +174,61 @@ func (cs *CollectionSpec) Assign(to interface{}) error { return assignValues(to, valueOf) } -// LoadAndAssign creates a collection from a spec, and assigns it to a struct. +// LoadAndAssign maps and programs into the kernel and assign them to a struct. // -// See Collection.Assign for details. +// This function is a short-cut to manually checking the presence +// of maps and programs in a collection spec. Consider using bpf2go if this +// sounds useful. +// +// The argument to must be a pointer to a struct. A field of the +// struct is updated with values from Programs or Maps if it +// has an `ebpf` tag and its type is *Program or *Map. +// The tag gives the name of the program or map as found in +// the CollectionSpec. +// +// struct { +// Foo *ebpf.Program `ebpf:"xdp_foo"` +// Bar *ebpf.Map `ebpf:"bar_map"` +// Ignored int +// } +// +// opts may be nil. +// +// Returns an error if any of the fields can't be found, or +// if the same map or program is assigned multiple times. func (cs *CollectionSpec) LoadAndAssign(to interface{}, opts *CollectionOptions) error { if opts == nil { opts = &CollectionOptions{} } - coll, err := NewCollectionWithOptions(cs, *opts) - if err != nil { + loadMap, loadProgram, done, cleanup := lazyLoadCollection(cs, opts) + defer cleanup() + + valueOf := func(typ reflect.Type, name string) (reflect.Value, error) { + switch typ { + case reflect.TypeOf((*Program)(nil)): + p, err := loadProgram(name) + if err != nil { + return reflect.Value{}, err + } + return reflect.ValueOf(p), nil + case reflect.TypeOf((*Map)(nil)): + m, err := loadMap(name) + if err != nil { + return reflect.Value{}, err + } + return reflect.ValueOf(m), nil + default: + return reflect.Value{}, fmt.Errorf("unsupported type %s", typ) + } + } + + if err := assignValues(to, valueOf); err != nil { return err } - defer coll.Close() - return coll.Assign(to) + done() + return nil } // Collection is a collection of Programs and Maps associated @@ -198,28 +239,75 @@ type Collection struct { } // NewCollection creates a Collection from a specification. -// -// Only maps referenced by at least one of the programs are initialized. func NewCollection(spec *CollectionSpec) (*Collection, error) { return NewCollectionWithOptions(spec, CollectionOptions{}) } // NewCollectionWithOptions creates a Collection from a specification. -// -// Only maps referenced by at least one of the programs are initialized. -func NewCollectionWithOptions(spec *CollectionSpec, opts CollectionOptions) (coll *Collection, err error) { +func NewCollectionWithOptions(spec *CollectionSpec, opts CollectionOptions) (*Collection, error) { + loadMap, loadProgram, done, cleanup := lazyLoadCollection(spec, &opts) + defer cleanup() + + for mapName := range spec.Maps { + _, err := loadMap(mapName) + if err != nil { + return nil, err + } + } + + for progName := range spec.Programs { + _, err := loadProgram(progName) + if err != nil { + return nil, err + } + } + + maps, progs := done() + return &Collection{ + progs, + maps, + }, nil +} + +type btfHandleCache map[*btf.Spec]*btf.Handle + +func (btfs btfHandleCache) load(spec *btf.Spec) (*btf.Handle, error) { + if btfs[spec] != nil { + return btfs[spec], nil + } + + handle, err := btf.NewHandle(spec) + if err != nil { + return nil, err + } + + btfs[spec] = handle + return handle, nil +} + +func (btfs btfHandleCache) close() { + for _, handle := range btfs { + handle.Close() + } +} + +func lazyLoadCollection(coll *CollectionSpec, opts *CollectionOptions) ( + loadMap func(string) (*Map, error), + loadProgram func(string) (*Program, error), + done func() (map[string]*Map, map[string]*Program), + cleanup func(), +) { var ( - maps = make(map[string]*Map) - progs = make(map[string]*Program) - btfs = make(map[*btf.Spec]*btf.Handle) + maps = make(map[string]*Map) + progs = make(map[string]*Program) + btfs = make(btfHandleCache) + skipMapsAndProgs = false ) - defer func() { - for _, btf := range btfs { - btf.Close() - } + cleanup = func() { + btfs.close() - if err == nil { + if skipMapsAndProgs { return } @@ -230,40 +318,43 @@ func NewCollectionWithOptions(spec *CollectionSpec, opts CollectionOptions) (col for _, p := range progs { p.Close() } - }() + } - loadBTF := func(spec *btf.Spec) (*btf.Handle, error) { - if btfs[spec] != nil { - return btfs[spec], nil - } + done = func() (map[string]*Map, map[string]*Program) { + skipMapsAndProgs = true + return maps, progs + } - handle, err := btf.NewHandle(spec) - if err != nil { - return nil, err + loadMap = func(mapName string) (*Map, error) { + if m := maps[mapName]; m != nil { + return m, nil } - btfs[spec] = handle - return handle, nil - } - - for mapName, mapSpec := range spec.Maps { - var handle *btf.Handle - if mapSpec.BTF != nil { - handle, err = loadBTF(btf.MapSpec(mapSpec.BTF)) - if err != nil && !errors.Is(err, btf.ErrNotSupported) { - return nil, err - } + mapSpec := coll.Maps[mapName] + if mapSpec == nil { + return nil, fmt.Errorf("missing map %s", mapName) } - m, err := newMapWithBTF(mapSpec, handle, opts.Maps) + m, err := newMapWithOptions(mapSpec, opts.Maps, btfs) if err != nil { return nil, fmt.Errorf("map %s: %w", mapName, err) } + maps[mapName] = m + return m, nil } - for progName, origProgSpec := range spec.Programs { - progSpec := origProgSpec.Copy() + loadProgram = func(progName string) (*Program, error) { + if prog := progs[progName]; prog != nil { + return prog, nil + } + + progSpec := coll.Programs[progName] + if progSpec == nil { + return nil, fmt.Errorf("unknown program %s", progName) + } + + progSpec = progSpec.Copy() // Rewrite any reference to a valid map. for i := range progSpec.Instructions { @@ -279,9 +370,9 @@ func NewCollectionWithOptions(spec *CollectionSpec, opts CollectionOptions) (col continue } - m := maps[ins.Reference] - if m == nil { - return nil, fmt.Errorf("program %s: missing map %s", progName, ins.Reference) + m, err := loadMap(ins.Reference) + if err != nil { + return nil, fmt.Errorf("program %s: %s", progName, err) } fd := m.FD() @@ -293,25 +384,16 @@ func NewCollectionWithOptions(spec *CollectionSpec, opts CollectionOptions) (col } } - var handle *btf.Handle - if progSpec.BTF != nil { - handle, err = loadBTF(btf.ProgramSpec(progSpec.BTF)) - if err != nil && !errors.Is(err, btf.ErrNotSupported) { - return nil, err - } - } - - prog, err := newProgramWithBTF(progSpec, handle, opts.Programs) + prog, err := newProgramWithOptions(progSpec, opts.Programs, btfs) if err != nil { return nil, fmt.Errorf("program %s: %w", progName, err) } + progs[progName] = prog + return prog, nil } - return &Collection{ - progs, - maps, - }, nil + return } // LoadCollection parses an object file and converts it to a collection. @@ -359,18 +441,8 @@ func (coll *Collection) DetachProgram(name string) *Program { // Assign the contents of a collection to a struct. // -// `to` must be a pointer to a struct like the following: -// -// struct { -// Foo *ebpf.Program `ebpf:"xdp_foo"` -// Bar *ebpf.Map `ebpf:"bar_map"` -// Ignored int -// } -// -// See CollectionSpec.Assign for the semantics of this function. -// -// DetachMap and DetachProgram is invoked for all assigned elements -// if the function is successful. +// Deprecated: use CollectionSpec.Assign instead. It provides the same +// functionality but creates only the maps and programs requested. func (coll *Collection) Assign(to interface{}) error { assignedMaps := make(map[string]struct{}) assignedPrograms := make(map[string]struct{}) @@ -411,28 +483,86 @@ func (coll *Collection) Assign(to interface{}) error { } func assignValues(to interface{}, valueOf func(reflect.Type, string) (reflect.Value, error)) error { - v := reflect.ValueOf(to) - if v.Kind() != reflect.Ptr || v.Elem().Kind() != reflect.Struct { - return fmt.Errorf("%T is not a pointer to a struct", to) + type structField struct { + reflect.StructField + value reflect.Value + } + + var ( + fields []structField + visitedTypes = make(map[reflect.Type]bool) + flattenStruct func(reflect.Value) error + ) + + flattenStruct = func(structVal reflect.Value) error { + structType := structVal.Type() + if structType.Kind() != reflect.Struct { + return fmt.Errorf("%s is not a struct", structType) + } + + if visitedTypes[structType] { + return fmt.Errorf("recursion on type %s", structType) + } + + for i := 0; i < structType.NumField(); i++ { + field := structField{structType.Field(i), structVal.Field(i)} + + name := field.Tag.Get("ebpf") + if name != "" { + fields = append(fields, field) + continue + } + + var err error + switch field.Type.Kind() { + case reflect.Ptr: + if field.Type.Elem().Kind() != reflect.Struct { + continue + } + + if field.value.IsNil() { + return fmt.Errorf("nil pointer to %s", structType) + } + + err = flattenStruct(field.value.Elem()) + + case reflect.Struct: + err = flattenStruct(field.value) + + default: + continue + } + + if err != nil { + return fmt.Errorf("field %s: %s", field.Name, err) + } + } + + return nil + } + + toValue := reflect.ValueOf(to) + if toValue.Type().Kind() != reflect.Ptr { + return fmt.Errorf("%T is not a pointer to struct", to) + } + + if toValue.IsNil() { + return fmt.Errorf("nil pointer to %T", to) + } + + if err := flattenStruct(toValue.Elem()); err != nil { + return err } type elem struct { + // Either *Map or *Program typ reflect.Type name string } - var ( - s = v.Elem() - sT = s.Type() - assignedTo = make(map[elem]string) - ) - for i := 0; i < sT.NumField(); i++ { - field := sT.Field(i) - + assignedTo := make(map[elem]string) + for _, field := range fields { name := field.Tag.Get("ebpf") - if name == "" { - continue - } if strings.Contains(name, ",") { return fmt.Errorf("field %s: ebpf tag contains a comma", field.Name) } @@ -447,12 +577,11 @@ func assignValues(to interface{}, valueOf func(reflect.Type, string) (reflect.Va return fmt.Errorf("field %s: %w", field.Name, err) } - fieldValue := s.Field(i) - if !fieldValue.CanSet() { - return fmt.Errorf("can't set value of field %s", field.Name) + if !field.value.CanSet() { + return fmt.Errorf("field %s: can't set value", field.Name) } - fieldValue.Set(value) + field.value.Set(value) assignedTo[e] = field.Name } diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader.go index 2b564dae047c..3ae44f68f424 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader.go @@ -18,12 +18,14 @@ import ( "github.com/cilium/ebpf/internal/unix" ) +// elfCode is a convenience to reduce the amount of arguments that have to +// be passed around explicitly. You should treat it's contents as immutable. type elfCode struct { - *elf.File - symbols []elf.Symbol - symbolsPerSection map[elf.SectionIndex]map[uint64]elf.Symbol - license string - version uint32 + *internal.SafeELFFile + sections map[elf.SectionIndex]*elfSection + license string + version uint32 + btf *btf.Spec } // LoadCollectionSpec parses an ELF file into a CollectionSpec. @@ -43,63 +45,52 @@ func LoadCollectionSpec(file string) (*CollectionSpec, error) { // LoadCollectionSpecFromReader parses an ELF file into a CollectionSpec. func LoadCollectionSpecFromReader(rd io.ReaderAt) (*CollectionSpec, error) { - f, err := elf.NewFile(rd) + f, err := internal.NewSafeELFFile(rd) if err != nil { return nil, err } defer f.Close() - symbols, err := f.Symbols() - if err != nil { - return nil, fmt.Errorf("load symbols: %v", err) - } - - ec := &elfCode{f, symbols, symbolsPerSection(symbols), "", 0} - var ( licenseSection *elf.Section versionSection *elf.Section - btfMaps = make(map[elf.SectionIndex]*elf.Section) - progSections = make(map[elf.SectionIndex]*elf.Section) + sections = make(map[elf.SectionIndex]*elfSection) relSections = make(map[elf.SectionIndex]*elf.Section) - mapSections = make(map[elf.SectionIndex]*elf.Section) - dataSections = make(map[elf.SectionIndex]*elf.Section) ) - for i, sec := range ec.Sections { + // This is the target of relocations generated by inline assembly. + sections[elf.SHN_UNDEF] = newElfSection(new(elf.Section), undefSection) + + // Collect all the sections we're interested in. This includes relocations + // which we parse later. + for i, sec := range f.Sections { + idx := elf.SectionIndex(i) + switch { case strings.HasPrefix(sec.Name, "license"): licenseSection = sec case strings.HasPrefix(sec.Name, "version"): versionSection = sec case strings.HasPrefix(sec.Name, "maps"): - mapSections[elf.SectionIndex(i)] = sec + sections[idx] = newElfSection(sec, mapSection) case sec.Name == ".maps": - btfMaps[elf.SectionIndex(i)] = sec - case sec.Name == ".bss" || sec.Name == ".rodata" || sec.Name == ".data": - dataSections[elf.SectionIndex(i)] = sec + sections[idx] = newElfSection(sec, btfMapSection) + case sec.Name == ".bss" || sec.Name == ".data" || strings.HasPrefix(sec.Name, ".rodata"): + sections[idx] = newElfSection(sec, dataSection) case sec.Type == elf.SHT_REL: - if int(sec.Info) >= len(ec.Sections) { - return nil, fmt.Errorf("found relocation section %v for missing section %v", i, sec.Info) - } - // Store relocations under the section index of the target - idx := elf.SectionIndex(sec.Info) - if relSections[idx] != nil { - return nil, fmt.Errorf("section %d has multiple relocation sections", sec.Info) - } - relSections[idx] = sec + relSections[elf.SectionIndex(sec.Info)] = sec case sec.Type == elf.SHT_PROGBITS && (sec.Flags&elf.SHF_EXECINSTR) != 0 && sec.Size > 0: - progSections[elf.SectionIndex(i)] = sec + sections[idx] = newElfSection(sec, programSection) } } - ec.license, err = loadLicense(licenseSection) + license, err := loadLicense(licenseSection) if err != nil { return nil, fmt.Errorf("load license: %w", err) } - ec.version, err = loadVersion(versionSection, ec.ByteOrder) + version, err := loadVersion(versionSection, f.ByteOrder) if err != nil { return nil, fmt.Errorf("load version: %w", err) } @@ -109,37 +100,90 @@ func LoadCollectionSpecFromReader(rd io.ReaderAt) (*CollectionSpec, error) { return nil, fmt.Errorf("load BTF: %w", err) } - relocations, referencedSections, err := ec.loadRelocations(relSections) + // Assign symbols to all the sections we're interested in. + symbols, err := f.Symbols() if err != nil { - return nil, fmt.Errorf("load relocations: %w", err) + return nil, fmt.Errorf("load symbols: %v", err) } - maps := make(map[string]*MapSpec) - if err := ec.loadMaps(maps, mapSections); err != nil { - return nil, fmt.Errorf("load maps: %w", err) - } + for _, symbol := range symbols { + idx := symbol.Section + symType := elf.ST_TYPE(symbol.Info) - if len(btfMaps) > 0 { - if err := ec.loadBTFMaps(maps, btfMaps, btfSpec); err != nil { - return nil, fmt.Errorf("load BTF maps: %w", err) + section := sections[idx] + if section == nil { + continue } + + // Older versions of LLVM don't tag symbols correctly, so keep + // all NOTYPE ones. + keep := symType == elf.STT_NOTYPE + switch section.kind { + case mapSection, btfMapSection, dataSection: + keep = keep || symType == elf.STT_OBJECT + case programSection: + keep = keep || symType == elf.STT_FUNC + } + if !keep || symbol.Name == "" { + continue + } + + section.symbols[symbol.Value] = symbol } - if len(dataSections) > 0 { - for idx := range dataSections { - if !referencedSections[idx] { - // Prune data sections which are not referenced by any - // instructions. - delete(dataSections, idx) - } + ec := &elfCode{ + SafeELFFile: f, + sections: sections, + license: license, + version: version, + btf: btfSpec, + } + + // Go through relocation sections, and parse the ones for sections we're + // interested in. Make sure that relocations point at valid sections. + for idx, relSection := range relSections { + section := sections[idx] + if section == nil { + continue } - if err := ec.loadDataSections(maps, dataSections, btfSpec); err != nil { - return nil, fmt.Errorf("load data sections: %w", err) + rels, err := ec.loadRelocations(relSection, symbols) + if err != nil { + return nil, fmt.Errorf("relocation for section %q: %w", section.Name, err) + } + + for _, rel := range rels { + target := sections[rel.Section] + if target == nil { + return nil, fmt.Errorf("section %q: reference to %q in section %s: %w", section.Name, rel.Name, rel.Section, ErrNotSupported) + } + + if target.Flags&elf.SHF_STRINGS > 0 { + return nil, fmt.Errorf("section %q: string %q is not stack allocated: %w", section.Name, rel.Name, ErrNotSupported) + } + + target.references++ } + + section.relocations = rels + } + + // Collect all the various ways to define maps. + maps := make(map[string]*MapSpec) + if err := ec.loadMaps(maps); err != nil { + return nil, fmt.Errorf("load maps: %w", err) } - progs, err := ec.loadPrograms(progSections, relocations, btfSpec) + if err := ec.loadBTFMaps(maps); err != nil { + return nil, fmt.Errorf("load BTF maps: %w", err) + } + + if err := ec.loadDataSections(maps); err != nil { + return nil, fmt.Errorf("load data sections: %w", err) + } + + // Finally, collect programs and link them. + progs, err := ec.loadPrograms() if err != nil { return nil, fmt.Errorf("load programs: %w", err) } @@ -171,33 +215,69 @@ func loadVersion(sec *elf.Section, bo binary.ByteOrder) (uint32, error) { return version, nil } -func (ec *elfCode) loadPrograms(progSections map[elf.SectionIndex]*elf.Section, relocations map[elf.SectionIndex]map[uint64]elf.Symbol, btfSpec *btf.Spec) (map[string]*ProgramSpec, error) { +type elfSectionKind int + +const ( + undefSection elfSectionKind = iota + mapSection + btfMapSection + programSection + dataSection +) + +type elfSection struct { + *elf.Section + kind elfSectionKind + // Offset from the start of the section to a symbol + symbols map[uint64]elf.Symbol + // Offset from the start of the section to a relocation, which points at + // a symbol in another section. + relocations map[uint64]elf.Symbol + // The number of relocations pointing at this section. + references int +} + +func newElfSection(section *elf.Section, kind elfSectionKind) *elfSection { + return &elfSection{ + section, + kind, + make(map[uint64]elf.Symbol), + make(map[uint64]elf.Symbol), + 0, + } +} + +func (ec *elfCode) loadPrograms() (map[string]*ProgramSpec, error) { var ( progs []*ProgramSpec libs []*ProgramSpec ) - for idx, sec := range progSections { - syms := ec.symbolsPerSection[idx] - if len(syms) == 0 { + for _, sec := range ec.sections { + if sec.kind != programSection { + continue + } + + if len(sec.symbols) == 0 { return nil, fmt.Errorf("section %v: missing symbols", sec.Name) } - funcSym, ok := syms[0] + funcSym, ok := sec.symbols[0] if !ok { return nil, fmt.Errorf("section %v: no label at start", sec.Name) } - insns, length, err := ec.loadInstructions(sec, syms, relocations[idx]) + insns, length, err := ec.loadInstructions(sec) if err != nil { - return nil, fmt.Errorf("program %s: can't unmarshal instructions: %w", funcSym.Name, err) + return nil, fmt.Errorf("program %s: %w", funcSym.Name, err) } - progType, attachType, attachTo := getProgType(sec.Name) + progType, attachType, progFlags, attachTo := getProgType(sec.Name) spec := &ProgramSpec{ Name: funcSym.Name, Type: progType, + Flags: progFlags, AttachType: attachType, AttachTo: attachTo, License: ec.license, @@ -206,8 +286,8 @@ func (ec *elfCode) loadPrograms(progSections map[elf.SectionIndex]*elf.Section, ByteOrder: ec.ByteOrder, } - if btfSpec != nil { - spec.BTF, err = btfSpec.Program(sec.Name, length) + if ec.btf != nil { + spec.BTF, err = ec.btf.Program(sec.Name, length) if err != nil && !errors.Is(err, btf.ErrNoExtendedInfo) { return nil, fmt.Errorf("program %s: %w", funcSym.Name, err) } @@ -235,7 +315,7 @@ func (ec *elfCode) loadPrograms(progSections map[elf.SectionIndex]*elf.Section, return res, nil } -func (ec *elfCode) loadInstructions(section *elf.Section, symbols, relocations map[uint64]elf.Symbol) (asm.Instructions, uint64, error) { +func (ec *elfCode) loadInstructions(section *elfSection) (asm.Instructions, uint64, error) { var ( r = bufio.NewReader(section.Open()) insns asm.Instructions @@ -251,11 +331,11 @@ func (ec *elfCode) loadInstructions(section *elf.Section, symbols, relocations m return nil, 0, fmt.Errorf("offset %d: %w", offset, err) } - ins.Symbol = symbols[offset].Name + ins.Symbol = section.symbols[offset].Name - if rel, ok := relocations[offset]; ok { + if rel, ok := section.relocations[offset]; ok { if err = ec.relocateInstruction(&ins, rel); err != nil { - return nil, 0, fmt.Errorf("offset %d: can't relocate instruction: %w", offset, err) + return nil, 0, fmt.Errorf("offset %d: relocate instruction: %w", offset, err) } } @@ -271,69 +351,66 @@ func (ec *elfCode) relocateInstruction(ins *asm.Instruction, rel elf.Symbol) err name = rel.Name ) - if typ == elf.STT_SECTION { - // Symbols with section type do not have a name set. Get it - // from the section itself. - idx := int(rel.Section) - if idx > len(ec.Sections) { - return errors.New("out-of-bounds section index") + target := ec.sections[rel.Section] + + switch target.kind { + case mapSection, btfMapSection: + if bind != elf.STB_GLOBAL { + return fmt.Errorf("possible erroneous static qualifier on map definition: found reference to %q", name) } - name = ec.Sections[idx].Name - } + if typ != elf.STT_OBJECT && typ != elf.STT_NOTYPE { + // STT_NOTYPE is generated on clang < 8 which doesn't tag + // relocations appropriately. + return fmt.Errorf("map load: incorrect relocation type %v", typ) + } + + ins.Src = asm.PseudoMapFD -outer: - switch { - case ins.OpCode == asm.LoadImmOp(asm.DWord): - // There are two distinct types of a load from a map: - // a direct one, where the value is extracted without - // a call to map_lookup_elem in eBPF, and an indirect one - // that goes via the helper. They are distinguished by - // different relocations. + // Mark the instruction as needing an update when creating the + // collection. + if err := ins.RewriteMapPtr(-1); err != nil { + return err + } + + case dataSection: switch typ { case elf.STT_SECTION: - // This is a direct load since the referenced symbol is a - // section. Weirdly, the offset of the real symbol in the - // section is encoded in the instruction stream. if bind != elf.STB_LOCAL { return fmt.Errorf("direct load: %s: unsupported relocation %s", name, bind) } - // For some reason, clang encodes the offset of the symbol its - // section in the first basic BPF instruction, while the kernel - // expects it in the second one. - ins.Constant <<= 32 - ins.Src = asm.PseudoMapValue - - case elf.STT_NOTYPE: - if bind == elf.STB_GLOBAL && rel.Section == elf.SHN_UNDEF { - // This is a relocation generated by inline assembly. - // We can't do more than assigning ins.Reference. - break outer - } - - // This is an ELF generated on clang < 8, which doesn't tag - // relocations appropriately. - fallthrough - case elf.STT_OBJECT: if bind != elf.STB_GLOBAL { - return fmt.Errorf("load: %s: unsupported binding: %s", name, bind) + return fmt.Errorf("direct load: %s: unsupported relocation %s", name, bind) } - ins.Src = asm.PseudoMapFD - default: - return fmt.Errorf("load: %s: unsupported relocation: %s", name, typ) + return fmt.Errorf("incorrect relocation type %v for direct map load", typ) } + // We rely on using the name of the data section as the reference. It + // would be nicer to keep the real name in case of an STT_OBJECT, but + // it's not clear how to encode that into Instruction. + name = target.Name + + // For some reason, clang encodes the offset of the symbol its + // section in the first basic BPF instruction, while the kernel + // expects it in the second one. + ins.Constant <<= 32 + ins.Src = asm.PseudoMapValue + // Mark the instruction as needing an update when creating the // collection. if err := ins.RewriteMapPtr(-1); err != nil { return err } - case ins.OpCode.JumpOp() == asm.Call: + case programSection: + if ins.OpCode.JumpOp() != asm.Call { + return fmt.Errorf("not a call instruction: %s", ins) + } + if ins.Src != asm.PseudoCall { return fmt.Errorf("call: %s: incorrect source register", name) } @@ -358,7 +435,7 @@ outer: return fmt.Errorf("call: %s: invalid offset %d", name, offset) } - sym, ok := ec.symbolsPerSection[rel.Section][uint64(offset)] + sym, ok := target.symbols[uint64(offset)] if !ok { return fmt.Errorf("call: %s: no symbol at offset %d", name, offset) } @@ -370,31 +447,46 @@ outer: return fmt.Errorf("call: %s: invalid symbol type %s", name, typ) } + case undefSection: + if bind != elf.STB_GLOBAL { + return fmt.Errorf("asm relocation: %s: unsupported binding: %s", name, bind) + } + + if typ != elf.STT_NOTYPE { + return fmt.Errorf("asm relocation: %s: unsupported type %s", name, typ) + } + + // There is nothing to do here but set ins.Reference. + default: - return fmt.Errorf("relocation for unsupported instruction: %s", ins.OpCode) + return fmt.Errorf("relocation to %q: %w", target.Name, ErrNotSupported) } ins.Reference = name return nil } -func (ec *elfCode) loadMaps(maps map[string]*MapSpec, mapSections map[elf.SectionIndex]*elf.Section) error { - for idx, sec := range mapSections { - syms := ec.symbolsPerSection[idx] - if len(syms) == 0 { +func (ec *elfCode) loadMaps(maps map[string]*MapSpec) error { + for _, sec := range ec.sections { + if sec.kind != mapSection { + continue + } + + nSym := len(sec.symbols) + if nSym == 0 { return fmt.Errorf("section %v: no symbols", sec.Name) } - if sec.Size%uint64(len(syms)) != 0 { + if sec.Size%uint64(nSym) != 0 { return fmt.Errorf("section %v: map descriptors are not of equal size", sec.Name) } var ( r = bufio.NewReader(sec.Open()) - size = sec.Size / uint64(len(syms)) + size = sec.Size / uint64(nSym) ) - for i, offset := 0, uint64(0); i < len(syms); i, offset = i+1, offset+size { - mapSym, ok := syms[offset] + for i, offset := 0, uint64(0); i < nSym; i, offset = i+1, offset+size { + mapSym, ok := sec.symbols[offset] if !ok { return fmt.Errorf("section %s: missing symbol for map at offset %d", sec.Name, offset) } @@ -432,24 +524,43 @@ func (ec *elfCode) loadMaps(maps map[string]*MapSpec, mapSections map[elf.Sectio return nil } -func (ec *elfCode) loadBTFMaps(maps map[string]*MapSpec, mapSections map[elf.SectionIndex]*elf.Section, spec *btf.Spec) error { - if spec == nil { - return fmt.Errorf("missing BTF") - } +func (ec *elfCode) loadBTFMaps(maps map[string]*MapSpec) error { + for _, sec := range ec.sections { + if sec.kind != btfMapSection { + continue + } - for idx, sec := range mapSections { - syms := ec.symbolsPerSection[idx] - if len(syms) == 0 { - return fmt.Errorf("section %v: no symbols", sec.Name) + if ec.btf == nil { + return fmt.Errorf("missing BTF") } - for _, sym := range syms { - name := sym.Name + _, err := io.Copy(internal.DiscardZeroes{}, bufio.NewReader(sec.Open())) + if err != nil { + return fmt.Errorf("section %v: initializing BTF map definitions: %w", sec.Name, internal.ErrNotSupported) + } + + var ds btf.Datasec + if err := ec.btf.FindType(sec.Name, &ds); err != nil { + return fmt.Errorf("cannot find section '%s' in BTF: %w", sec.Name, err) + } + + for _, vs := range ds.Vars { + v, ok := vs.Type.(*btf.Var) + if !ok { + return fmt.Errorf("section %v: unexpected type %s", sec.Name, vs.Type) + } + name := string(v.Name) + if maps[name] != nil { - return fmt.Errorf("section %v: map %v already exists", sec.Name, sym) + return fmt.Errorf("section %v: map %s already exists", sec.Name, name) + } + + mapStruct, ok := v.Type.(*btf.Struct) + if !ok { + return fmt.Errorf("expected struct, got %s", v.Type) } - mapSpec, err := mapSpecFromBTF(spec, name) + mapSpec, err := mapSpecFromBTF(name, mapStruct, false, ec.btf) if err != nil { return fmt.Errorf("map %v: %w", name, err) } @@ -461,31 +572,21 @@ func (ec *elfCode) loadBTFMaps(maps map[string]*MapSpec, mapSections map[elf.Sec return nil } -func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) { - btfMap, btfMapMembers, err := spec.Map(name) - if err != nil { - return nil, fmt.Errorf("can't get BTF: %w", err) - } - - keyType := btf.MapKey(btfMap) - size, err := btf.Sizeof(keyType) - if err != nil { - return nil, fmt.Errorf("can't get size of BTF key: %w", err) - } - keySize := uint32(size) - - valueType := btf.MapValue(btfMap) - size, err = btf.Sizeof(valueType) - if err != nil { - return nil, fmt.Errorf("can't get size of BTF value: %w", err) - } - valueSize := uint32(size) +// mapSpecFromBTF produces a MapSpec based on a btf.Struct def representing +// a BTF map definition. The name and spec arguments will be copied to the +// resulting MapSpec, and inner must be true on any resursive invocations. +func mapSpecFromBTF(name string, def *btf.Struct, inner bool, spec *btf.Spec) (*MapSpec, error) { var ( + key, value btf.Type + keySize, valueSize uint32 mapType, flags, maxEntries uint32 pinType PinType + innerMapSpec *MapSpec + err error ) - for _, member := range btfMapMembers { + + for i, member := range def.Members { switch member.Name { case "type": mapType, err = uintFromBTF(member.Type) @@ -505,8 +606,48 @@ func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) { return nil, fmt.Errorf("can't get BTF map max entries: %w", err) } + case "key": + if keySize != 0 { + return nil, errors.New("both key and key_size given") + } + + pk, ok := member.Type.(*btf.Pointer) + if !ok { + return nil, fmt.Errorf("key type is not a pointer: %T", member.Type) + } + + key = pk.Target + + size, err := btf.Sizeof(pk.Target) + if err != nil { + return nil, fmt.Errorf("can't get size of BTF key: %w", err) + } + + keySize = uint32(size) + + case "value": + if valueSize != 0 { + return nil, errors.New("both value and value_size given") + } + + vk, ok := member.Type.(*btf.Pointer) + if !ok { + return nil, fmt.Errorf("value type is not a pointer: %T", member.Type) + } + + value = vk.Target + + size, err := btf.Sizeof(vk.Target) + if err != nil { + return nil, fmt.Errorf("can't get size of BTF value: %w", err) + } + + valueSize = uint32(size) + case "key_size": - if _, isVoid := keyType.(*btf.Void); !isVoid { + // Key needs to be nil and keySize needs to be 0 for key_size to be + // considered a valid member. + if key != nil || keySize != 0 { return nil, errors.New("both key and key_size given") } @@ -516,7 +657,9 @@ func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) { } case "value_size": - if _, isVoid := valueType.(*btf.Void); !isVoid { + // Value needs to be nil and valueSize needs to be 0 for value_size to be + // considered a valid member. + if value != nil || valueSize != 0 { return nil, errors.New("both value and value_size given") } @@ -526,6 +669,10 @@ func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) { } case "pinning": + if inner { + return nil, errors.New("inner maps can't be pinned") + } + pinning, err := uintFromBTF(member.Type) if err != nil { return nil, fmt.Errorf("can't get pinning: %w", err) @@ -533,12 +680,58 @@ func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) { pinType = PinType(pinning) - case "key", "value": + case "values": + // The 'values' field in BTF map definitions is used for declaring map + // value types that are references to other BPF objects, like other maps + // or programs. It is always expected to be an array of pointers. + if i != len(def.Members)-1 { + return nil, errors.New("'values' must be the last member in a BTF map definition") + } + + if valueSize != 0 && valueSize != 4 { + return nil, errors.New("value_size must be 0 or 4") + } + valueSize = 4 + + valueType, err := resolveBTFArrayMacro(member.Type) + if err != nil { + return nil, fmt.Errorf("can't resolve type of member 'values': %w", err) + } + + switch t := valueType.(type) { + case *btf.Struct: + // The values member pointing to an array of structs means we're expecting + // a map-in-map declaration. + if MapType(mapType) != ArrayOfMaps && MapType(mapType) != HashOfMaps { + return nil, errors.New("outer map needs to be an array or a hash of maps") + } + if inner { + return nil, fmt.Errorf("nested inner maps are not supported") + } + + // This inner map spec is used as a map template, but it needs to be + // created as a traditional map before it can be used to do so. + // libbpf names the inner map template '.inner', but we + // opted for _inner to simplify validation logic. (dots only supported + // on kernels 5.2 and up) + // Pass the BTF spec from the parent object, since both parent and + // child must be created from the same BTF blob (on kernels that support BTF). + innerMapSpec, err = mapSpecFromBTF(name+"_inner", t, true, spec) + if err != nil { + return nil, fmt.Errorf("can't parse BTF map definition of inner map: %w", err) + } + + default: + return nil, fmt.Errorf("unsupported value type %q in 'values' field", t) + } + default: return nil, fmt.Errorf("unrecognized field %s in BTF map definition", member.Name) } } + bm := btf.NewMap(spec, key, value) + return &MapSpec{ Name: SanitizeName(name, -1), Type: MapType(mapType), @@ -546,8 +739,9 @@ func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) { ValueSize: valueSize, MaxEntries: maxEntries, Flags: flags, - BTF: btfMap, + BTF: &bm, Pinning: pinType, + InnerMap: innerMapSpec, }, nil } @@ -567,13 +761,40 @@ func uintFromBTF(typ btf.Type) (uint32, error) { return arr.Nelems, nil } -func (ec *elfCode) loadDataSections(maps map[string]*MapSpec, dataSections map[elf.SectionIndex]*elf.Section, spec *btf.Spec) error { - if spec == nil { - return errors.New("data sections require BTF, make sure all consts are marked as static") +// resolveBTFArrayMacro resolves the __array macro, which declares an array +// of pointers to a given type. This function returns the target Type of +// the pointers in the array. +func resolveBTFArrayMacro(typ btf.Type) (btf.Type, error) { + arr, ok := typ.(*btf.Array) + if !ok { + return nil, fmt.Errorf("not an array: %v", typ) + } + + ptr, ok := arr.Type.(*btf.Pointer) + if !ok { + return nil, fmt.Errorf("not an array of pointers: %v", typ) } - for _, sec := range dataSections { - btfMap, err := spec.Datasec(sec.Name) + return ptr.Target, nil +} + +func (ec *elfCode) loadDataSections(maps map[string]*MapSpec) error { + for _, sec := range ec.sections { + if sec.kind != dataSection { + continue + } + + if sec.references == 0 { + // Prune data sections which are not referenced by any + // instructions. + continue + } + + if ec.btf == nil { + return errors.New("data sections require BTF, make sure all consts are marked as static") + } + + btfMap, err := ec.btf.Datasec(sec.Name) if err != nil { return err } @@ -611,56 +832,61 @@ func (ec *elfCode) loadDataSections(maps map[string]*MapSpec, dataSections map[e return nil } -func getProgType(sectionName string) (ProgramType, AttachType, string) { +func getProgType(sectionName string) (ProgramType, AttachType, uint32, string) { types := map[string]struct { progType ProgramType attachType AttachType + progFlags uint32 }{ // From https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/lib/bpf/libbpf.c - "socket": {SocketFilter, AttachNone}, - "seccomp": {SocketFilter, AttachNone}, - "kprobe/": {Kprobe, AttachNone}, - "uprobe/": {Kprobe, AttachNone}, - "kretprobe/": {Kprobe, AttachNone}, - "uretprobe/": {Kprobe, AttachNone}, - "tracepoint/": {TracePoint, AttachNone}, - "raw_tracepoint/": {RawTracepoint, AttachNone}, - "xdp": {XDP, AttachNone}, - "perf_event": {PerfEvent, AttachNone}, - "lwt_in": {LWTIn, AttachNone}, - "lwt_out": {LWTOut, AttachNone}, - "lwt_xmit": {LWTXmit, AttachNone}, - "lwt_seg6local": {LWTSeg6Local, AttachNone}, - "sockops": {SockOps, AttachCGroupSockOps}, - "sk_skb/stream_parser": {SkSKB, AttachSkSKBStreamParser}, - "sk_skb/stream_verdict": {SkSKB, AttachSkSKBStreamParser}, - "sk_msg": {SkMsg, AttachSkSKBStreamVerdict}, - "lirc_mode2": {LircMode2, AttachLircMode2}, - "flow_dissector": {FlowDissector, AttachFlowDissector}, - "iter/": {Tracing, AttachTraceIter}, - "sk_lookup/": {SkLookup, AttachSkLookup}, - "lsm/": {LSM, AttachLSMMac}, - - "cgroup_skb/ingress": {CGroupSKB, AttachCGroupInetIngress}, - "cgroup_skb/egress": {CGroupSKB, AttachCGroupInetEgress}, - "cgroup/dev": {CGroupDevice, AttachCGroupDevice}, - "cgroup/skb": {CGroupSKB, AttachNone}, - "cgroup/sock": {CGroupSock, AttachCGroupInetSockCreate}, - "cgroup/post_bind4": {CGroupSock, AttachCGroupInet4PostBind}, - "cgroup/post_bind6": {CGroupSock, AttachCGroupInet6PostBind}, - "cgroup/bind4": {CGroupSockAddr, AttachCGroupInet4Bind}, - "cgroup/bind6": {CGroupSockAddr, AttachCGroupInet6Bind}, - "cgroup/connect4": {CGroupSockAddr, AttachCGroupInet4Connect}, - "cgroup/connect6": {CGroupSockAddr, AttachCGroupInet6Connect}, - "cgroup/sendmsg4": {CGroupSockAddr, AttachCGroupUDP4Sendmsg}, - "cgroup/sendmsg6": {CGroupSockAddr, AttachCGroupUDP6Sendmsg}, - "cgroup/recvmsg4": {CGroupSockAddr, AttachCGroupUDP4Recvmsg}, - "cgroup/recvmsg6": {CGroupSockAddr, AttachCGroupUDP6Recvmsg}, - "cgroup/sysctl": {CGroupSysctl, AttachCGroupSysctl}, - "cgroup/getsockopt": {CGroupSockopt, AttachCGroupGetsockopt}, - "cgroup/setsockopt": {CGroupSockopt, AttachCGroupSetsockopt}, - "classifier": {SchedCLS, AttachNone}, - "action": {SchedACT, AttachNone}, + "socket": {SocketFilter, AttachNone, 0}, + "seccomp": {SocketFilter, AttachNone, 0}, + "kprobe/": {Kprobe, AttachNone, 0}, + "uprobe/": {Kprobe, AttachNone, 0}, + "kretprobe/": {Kprobe, AttachNone, 0}, + "uretprobe/": {Kprobe, AttachNone, 0}, + "tracepoint/": {TracePoint, AttachNone, 0}, + "raw_tracepoint/": {RawTracepoint, AttachNone, 0}, + "xdp": {XDP, AttachNone, 0}, + "perf_event": {PerfEvent, AttachNone, 0}, + "lwt_in": {LWTIn, AttachNone, 0}, + "lwt_out": {LWTOut, AttachNone, 0}, + "lwt_xmit": {LWTXmit, AttachNone, 0}, + "lwt_seg6local": {LWTSeg6Local, AttachNone, 0}, + "sockops": {SockOps, AttachCGroupSockOps, 0}, + "sk_skb/stream_parser": {SkSKB, AttachSkSKBStreamParser, 0}, + "sk_skb/stream_verdict": {SkSKB, AttachSkSKBStreamParser, 0}, + "sk_msg": {SkMsg, AttachSkSKBStreamVerdict, 0}, + "lirc_mode2": {LircMode2, AttachLircMode2, 0}, + "flow_dissector": {FlowDissector, AttachFlowDissector, 0}, + "iter/": {Tracing, AttachTraceIter, 0}, + "fentry.s/": {Tracing, AttachTraceFEntry, unix.BPF_F_SLEEPABLE}, + "fmod_ret.s/": {Tracing, AttachModifyReturn, unix.BPF_F_SLEEPABLE}, + "fexit.s/": {Tracing, AttachTraceFExit, unix.BPF_F_SLEEPABLE}, + "sk_lookup/": {SkLookup, AttachSkLookup, 0}, + "lsm/": {LSM, AttachLSMMac, 0}, + "lsm.s/": {LSM, AttachLSMMac, unix.BPF_F_SLEEPABLE}, + + "cgroup_skb/ingress": {CGroupSKB, AttachCGroupInetIngress, 0}, + "cgroup_skb/egress": {CGroupSKB, AttachCGroupInetEgress, 0}, + "cgroup/dev": {CGroupDevice, AttachCGroupDevice, 0}, + "cgroup/skb": {CGroupSKB, AttachNone, 0}, + "cgroup/sock": {CGroupSock, AttachCGroupInetSockCreate, 0}, + "cgroup/post_bind4": {CGroupSock, AttachCGroupInet4PostBind, 0}, + "cgroup/post_bind6": {CGroupSock, AttachCGroupInet6PostBind, 0}, + "cgroup/bind4": {CGroupSockAddr, AttachCGroupInet4Bind, 0}, + "cgroup/bind6": {CGroupSockAddr, AttachCGroupInet6Bind, 0}, + "cgroup/connect4": {CGroupSockAddr, AttachCGroupInet4Connect, 0}, + "cgroup/connect6": {CGroupSockAddr, AttachCGroupInet6Connect, 0}, + "cgroup/sendmsg4": {CGroupSockAddr, AttachCGroupUDP4Sendmsg, 0}, + "cgroup/sendmsg6": {CGroupSockAddr, AttachCGroupUDP6Sendmsg, 0}, + "cgroup/recvmsg4": {CGroupSockAddr, AttachCGroupUDP4Recvmsg, 0}, + "cgroup/recvmsg6": {CGroupSockAddr, AttachCGroupUDP6Recvmsg, 0}, + "cgroup/sysctl": {CGroupSysctl, AttachCGroupSysctl, 0}, + "cgroup/getsockopt": {CGroupSockopt, AttachCGroupGetsockopt, 0}, + "cgroup/setsockopt": {CGroupSockopt, AttachCGroupSetsockopt, 0}, + "classifier": {SchedCLS, AttachNone, 0}, + "action": {SchedACT, AttachNone, 0}, } for prefix, t := range types { @@ -669,78 +895,39 @@ func getProgType(sectionName string) (ProgramType, AttachType, string) { } if !strings.HasSuffix(prefix, "/") { - return t.progType, t.attachType, "" + return t.progType, t.attachType, t.progFlags, "" } - return t.progType, t.attachType, sectionName[len(prefix):] + return t.progType, t.attachType, t.progFlags, sectionName[len(prefix):] } - return UnspecifiedProgram, AttachNone, "" + return UnspecifiedProgram, AttachNone, 0, "" } -func (ec *elfCode) loadRelocations(sections map[elf.SectionIndex]*elf.Section) (map[elf.SectionIndex]map[uint64]elf.Symbol, map[elf.SectionIndex]bool, error) { - result := make(map[elf.SectionIndex]map[uint64]elf.Symbol) - targets := make(map[elf.SectionIndex]bool) - for idx, sec := range sections { - rels := make(map[uint64]elf.Symbol) - - if sec.Entsize < 16 { - return nil, nil, fmt.Errorf("section %s: relocations are less than 16 bytes", sec.Name) - } - - r := bufio.NewReader(sec.Open()) - for off := uint64(0); off < sec.Size; off += sec.Entsize { - ent := io.LimitReader(r, int64(sec.Entsize)) +func (ec *elfCode) loadRelocations(sec *elf.Section, symbols []elf.Symbol) (map[uint64]elf.Symbol, error) { + rels := make(map[uint64]elf.Symbol) - var rel elf.Rel64 - if binary.Read(ent, ec.ByteOrder, &rel) != nil { - return nil, nil, fmt.Errorf("can't parse relocation at offset %v", off) - } - - symNo := int(elf.R_SYM64(rel.Info) - 1) - if symNo >= len(ec.symbols) { - return nil, nil, fmt.Errorf("relocation at offset %d: symbol %v doesnt exist", off, symNo) - } - - symbol := ec.symbols[symNo] - targets[symbol.Section] = true - rels[rel.Off] = ec.symbols[symNo] - } - - result[idx] = rels + if sec.Entsize < 16 { + return nil, fmt.Errorf("section %s: relocations are less than 16 bytes", sec.Name) } - return result, targets, nil -} -func symbolsPerSection(symbols []elf.Symbol) map[elf.SectionIndex]map[uint64]elf.Symbol { - result := make(map[elf.SectionIndex]map[uint64]elf.Symbol) - for _, sym := range symbols { - switch elf.ST_TYPE(sym.Info) { - case elf.STT_NOTYPE: - // Older versions of LLVM doesn't tag - // symbols correctly. - break - case elf.STT_OBJECT: - break - case elf.STT_FUNC: - break - default: - continue - } + r := bufio.NewReader(sec.Open()) + for off := uint64(0); off < sec.Size; off += sec.Entsize { + ent := io.LimitReader(r, int64(sec.Entsize)) - if sym.Section == elf.SHN_UNDEF || sym.Section >= elf.SHN_LORESERVE { - continue + var rel elf.Rel64 + if binary.Read(ent, ec.ByteOrder, &rel) != nil { + return nil, fmt.Errorf("can't parse relocation at offset %v", off) } - if sym.Name == "" { - continue + symNo := int(elf.R_SYM64(rel.Info) - 1) + if symNo >= len(symbols) { + return nil, fmt.Errorf("offset %d: symbol %d doesn't exist", off, symNo) } - idx := sym.Section - if _, ok := result[idx]; !ok { - result[idx] = make(map[uint64]elf.Symbol) - } - result[idx][sym.Value] = sym + symbol := symbols[symNo] + rels[rel.Off] = symbol } - return result + + return rels, nil } diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader_fuzz.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader_fuzz.go new file mode 100644 index 000000000000..d46d135f2fcd --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/elf_reader_fuzz.go @@ -0,0 +1,21 @@ +// +build gofuzz + +// Use with https://github.com/dvyukov/go-fuzz + +package ebpf + +import "bytes" + +func FuzzLoadCollectionSpec(data []byte) int { + spec, err := LoadCollectionSpecFromReader(bytes.NewReader(data)) + if err != nil { + if spec != nil { + panic("spec is not nil") + } + return 0 + } + if spec == nil { + panic("spec is nil") + } + return 1 +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.mod b/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.mod index 2d1004425024..df8139621c3e 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.mod +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.mod @@ -1,8 +1,9 @@ module github.com/cilium/ebpf -go 1.14 +go 1.15 require ( - github.com/google/go-cmp v0.5.2 - golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 + github.com/frankban/quicktest v1.11.3 + github.com/google/go-cmp v0.5.4 + golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c ) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.sum b/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.sum index 47dd82f2921f..a5039262aab0 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.sum +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/go.sum @@ -1,6 +1,13 @@ -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/info.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/info.go new file mode 100644 index 000000000000..b95131ef5726 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/info.go @@ -0,0 +1,239 @@ +package ebpf + +import ( + "bufio" + "encoding/hex" + "errors" + "fmt" + "io" + "os" + "strings" + "syscall" + "time" + + "github.com/cilium/ebpf/internal" +) + +// MapInfo describes a map. +type MapInfo struct { + Type MapType + id MapID + KeySize uint32 + ValueSize uint32 + MaxEntries uint32 + Flags uint32 + // Name as supplied by user space at load time. + Name string +} + +func newMapInfoFromFd(fd *internal.FD) (*MapInfo, error) { + info, err := bpfGetMapInfoByFD(fd) + if errors.Is(err, syscall.EINVAL) { + return newMapInfoFromProc(fd) + } + if err != nil { + return nil, err + } + + return &MapInfo{ + MapType(info.map_type), + MapID(info.id), + info.key_size, + info.value_size, + info.max_entries, + info.map_flags, + // name is available from 4.15. + internal.CString(info.name[:]), + }, nil +} + +func newMapInfoFromProc(fd *internal.FD) (*MapInfo, error) { + var mi MapInfo + err := scanFdInfo(fd, map[string]interface{}{ + "map_type": &mi.Type, + "key_size": &mi.KeySize, + "value_size": &mi.ValueSize, + "max_entries": &mi.MaxEntries, + "map_flags": &mi.Flags, + }) + if err != nil { + return nil, err + } + return &mi, nil +} + +// ID returns the map ID. +// +// Available from 4.13. +// +// The bool return value indicates whether this optional field is available. +func (mi *MapInfo) ID() (MapID, bool) { + return mi.id, mi.id > 0 +} + +// programStats holds statistics of a program. +type programStats struct { + // Total accumulated runtime of the program ins ns. + runtime time.Duration + // Total number of times the program was called. + runCount uint64 +} + +// ProgramInfo describes a program. +type ProgramInfo struct { + Type ProgramType + id ProgramID + // Truncated hash of the BPF bytecode. + Tag string + // Name as supplied by user space at load time. + Name string + + stats *programStats +} + +func newProgramInfoFromFd(fd *internal.FD) (*ProgramInfo, error) { + info, err := bpfGetProgInfoByFD(fd) + if errors.Is(err, syscall.EINVAL) { + return newProgramInfoFromProc(fd) + } + if err != nil { + return nil, err + } + + return &ProgramInfo{ + Type: ProgramType(info.prog_type), + id: ProgramID(info.id), + // tag is available if the kernel supports BPF_PROG_GET_INFO_BY_FD. + Tag: hex.EncodeToString(info.tag[:]), + // name is available from 4.15. + Name: internal.CString(info.name[:]), + stats: &programStats{ + runtime: time.Duration(info.run_time_ns), + runCount: info.run_cnt, + }, + }, nil +} + +func newProgramInfoFromProc(fd *internal.FD) (*ProgramInfo, error) { + var info ProgramInfo + err := scanFdInfo(fd, map[string]interface{}{ + "prog_type": &info.Type, + "prog_tag": &info.Tag, + }) + if errors.Is(err, errMissingFields) { + return nil, &internal.UnsupportedFeatureError{ + Name: "reading program info from /proc/self/fdinfo", + MinimumVersion: internal.Version{4, 10, 0}, + } + } + if err != nil { + return nil, err + } + + return &info, nil +} + +// ID returns the program ID. +// +// Available from 4.13. +// +// The bool return value indicates whether this optional field is available. +func (pi *ProgramInfo) ID() (ProgramID, bool) { + return pi.id, pi.id > 0 +} + +// RunCount returns the total number of times the program was called. +// +// Can return 0 if the collection of statistics is not enabled. See EnableStats(). +// The bool return value indicates whether this optional field is available. +func (pi *ProgramInfo) RunCount() (uint64, bool) { + if pi.stats != nil { + return pi.stats.runCount, true + } + return 0, false +} + +// Runtime returns the total accumulated runtime of the program. +// +// Can return 0 if the collection of statistics is not enabled. See EnableStats(). +// The bool return value indicates whether this optional field is available. +func (pi *ProgramInfo) Runtime() (time.Duration, bool) { + if pi.stats != nil { + return pi.stats.runtime, true + } + return time.Duration(0), false +} + +func scanFdInfo(fd *internal.FD, fields map[string]interface{}) error { + raw, err := fd.Value() + if err != nil { + return err + } + + fh, err := os.Open(fmt.Sprintf("/proc/self/fdinfo/%d", raw)) + if err != nil { + return err + } + defer fh.Close() + + if err := scanFdInfoReader(fh, fields); err != nil { + return fmt.Errorf("%s: %w", fh.Name(), err) + } + return nil +} + +var errMissingFields = errors.New("missing fields") + +func scanFdInfoReader(r io.Reader, fields map[string]interface{}) error { + var ( + scanner = bufio.NewScanner(r) + scanned int + ) + + for scanner.Scan() { + parts := strings.SplitN(scanner.Text(), "\t", 2) + if len(parts) != 2 { + continue + } + + name := strings.TrimSuffix(parts[0], ":") + field, ok := fields[string(name)] + if !ok { + continue + } + + if n, err := fmt.Sscanln(parts[1], field); err != nil || n != 1 { + return fmt.Errorf("can't parse field %s: %v", name, err) + } + + scanned++ + } + + if err := scanner.Err(); err != nil { + return err + } + + if scanned != len(fields) { + return errMissingFields + } + + return nil +} + +// EnableStats starts the measuring of the runtime +// and run counts of eBPF programs. +// +// Collecting statistics can have an impact on the performance. +// +// Requires at least 5.8. +func EnableStats(which uint32) (io.Closer, error) { + attr := internal.BPFEnableStatsAttr{ + StatsType: which, + } + + fd, err := internal.BPFEnableStats(&attr) + if err != nil { + return nil, err + } + return fd, nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf.go index 7a904a02c2c2..1e66d94765a1 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf.go @@ -29,12 +29,14 @@ var ( // Spec represents decoded BTF. type Spec struct { - rawTypes []rawType - strings stringTable - types map[string][]namedType - funcInfos map[string]extInfo - lineInfos map[string]extInfo - byteOrder binary.ByteOrder + rawTypes []rawType + strings stringTable + types []Type + namedTypes map[string][]namedType + funcInfos map[string]extInfo + lineInfos map[string]extInfo + coreRelos map[string]bpfCoreRelos + byteOrder binary.ByteOrder } type btfHeader struct { @@ -53,7 +55,7 @@ type btfHeader struct { // // Returns a nil Spec and no error if no BTF was present. func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { - file, err := elf.NewFile(rd) + file, err := internal.NewSafeELFFile(rd) if err != nil { return nil, err } @@ -80,6 +82,10 @@ func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { continue } + if int(symbol.Section) >= len(file.Sections) { + return nil, fmt.Errorf("symbol %s: invalid section %d", symbol.Name, symbol.Section) + } + secName := file.Sections[symbol.Section].Name if _, ok := sectionSizes[secName]; !ok { continue @@ -101,7 +107,7 @@ func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { return spec, nil } - spec.funcInfos, spec.lineInfos, err = parseExtInfos(btfExtSection.Open(), file.ByteOrder, spec.strings) + spec.funcInfos, spec.lineInfos, spec.coreRelos, err = parseExtInfos(btfExtSection.Open(), file.ByteOrder, spec.strings) if err != nil { return nil, fmt.Errorf("can't read ext info: %w", err) } @@ -109,7 +115,7 @@ func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { return spec, nil } -func findBtfSections(file *elf.File) (*elf.Section, *elf.Section, map[string]uint32, error) { +func findBtfSections(file *internal.SafeELFFile) (*elf.Section, *elf.Section, map[string]uint32, error) { var ( btfSection *elf.Section btfExtSection *elf.Section @@ -138,7 +144,7 @@ func findBtfSections(file *elf.File) (*elf.Section, *elf.Section, map[string]uin } func loadSpecFromVmlinux(rd io.ReaderAt) (*Spec, error) { - file, err := elf.NewFile(rd) + file, err := internal.NewSafeELFFile(rd) if err != nil { return nil, err } @@ -165,16 +171,17 @@ func loadNakedSpec(btf io.ReadSeeker, bo binary.ByteOrder, sectionSizes map[stri return nil, err } - types, err := inflateRawTypes(rawTypes, rawStrings) + types, typesByName, err := inflateRawTypes(rawTypes, rawStrings) if err != nil { return nil, err } return &Spec{ - rawTypes: rawTypes, - types: types, - strings: rawStrings, - byteOrder: bo, + rawTypes: rawTypes, + namedTypes: typesByName, + types: types, + strings: rawStrings, + byteOrder: bo, }, nil } @@ -311,10 +318,14 @@ func fixupDatasec(rawTypes []rawType, rawStrings stringTable, sectionSizes map[s return err } - if name == ".kconfig" || name == ".ksym" { + if name == ".kconfig" || name == ".ksyms" { return fmt.Errorf("reference to %s: %w", name, ErrNotSupported) } + if rawTypes[i].SizeType != 0 { + continue + } + size, ok := sectionSizes[name] if !ok { return fmt.Errorf("data section %s: missing size", name) @@ -421,64 +432,19 @@ func (s *Spec) Program(name string, length uint64) (*Program, error) { return nil, errors.New("length musn't be zero") } - if s.funcInfos == nil && s.lineInfos == nil { + if s.funcInfos == nil && s.lineInfos == nil && s.coreRelos == nil { return nil, fmt.Errorf("BTF for section %s: %w", name, ErrNoExtendedInfo) } funcInfos, funcOK := s.funcInfos[name] lineInfos, lineOK := s.lineInfos[name] + coreRelos, coreOK := s.coreRelos[name] - if !funcOK && !lineOK { + if !funcOK && !lineOK && !coreOK { return nil, fmt.Errorf("no extended BTF info for section %s", name) } - return &Program{s, length, funcInfos, lineInfos}, nil -} - -// Map finds the BTF for a map. -// -// Returns an error if there is no BTF for the given name. -func (s *Spec) Map(name string) (*Map, []Member, error) { - var mapVar Var - if err := s.FindType(name, &mapVar); err != nil { - return nil, nil, err - } - - mapStruct, ok := mapVar.Type.(*Struct) - if !ok { - return nil, nil, fmt.Errorf("expected struct, have %s", mapVar.Type) - } - - var key, value Type - for _, member := range mapStruct.Members { - switch member.Name { - case "key": - key = member.Type - if pk, isPtr := key.(*Pointer); !isPtr { - return nil, nil, fmt.Errorf("key type is not a pointer: %T", key) - } else { - key = pk.Target - } - - case "value": - value = member.Type - if vk, isPtr := value.(*Pointer); !isPtr { - return nil, nil, fmt.Errorf("value type is not a pointer: %T", value) - } else { - value = vk.Target - } - } - } - - if key == nil { - key = (*Void)(nil) - } - - if value == nil { - value = (*Void)(nil) - } - - return &Map{s, key, value}, mapStruct.Members, nil + return &Program{s, length, funcInfos, lineInfos, coreRelos}, nil } // Datasec returns the BTF required to create maps which represent data sections. @@ -488,7 +454,8 @@ func (s *Spec) Datasec(name string) (*Map, error) { return nil, fmt.Errorf("data section %s: can't get BTF: %w", name, err) } - return &Map{s, &Void{}, &datasec}, nil + m := NewMap(s, &Void{}, &datasec) + return &m, nil } // FindType searches for a type with a specific name. @@ -503,7 +470,7 @@ func (s *Spec) FindType(name string, typ Type) error { candidate Type ) - for _, typ := range s.types[essentialName(name)] { + for _, typ := range s.namedTypes[essentialName(name)] { if reflect.TypeOf(typ) != wanted { continue } @@ -599,6 +566,23 @@ type Map struct { key, value Type } +// NewMap returns a new Map containing the given values. +// The key and value arguments are initialized to Void if nil values are given. +func NewMap(spec *Spec, key Type, value Type) Map { + if key == nil { + key = &Void{} + } + if value == nil { + value = &Void{} + } + + return Map{ + spec: spec, + key: key, + value: value, + } +} + // MapSpec should be a method on Map, but is a free function // to hide it from users of the ebpf package. func MapSpec(m *Map) *Spec { @@ -622,6 +606,7 @@ type Program struct { spec *Spec length uint64 funcInfos, lineInfos extInfo + coreRelos bpfCoreRelos } // ProgramSpec returns the Spec needed for loading function and line infos into the kernel. @@ -647,9 +632,10 @@ func ProgramAppend(s, other *Program) error { return fmt.Errorf("line infos: %w", err) } - s.length += other.length s.funcInfos = funcInfos s.lineInfos = lineInfos + s.coreRelos = s.coreRelos.append(other.coreRelos, s.length) + s.length += other.length return nil } @@ -679,6 +665,19 @@ func ProgramLineInfos(s *Program) (recordSize uint32, bytes []byte, err error) { return s.lineInfos.recordSize, bytes, nil } +// ProgramRelocations returns the CO-RE relocations required to adjust the +// program to the target. +// +// This is a free function instead of a method to hide it from users +// of package ebpf. +func ProgramRelocations(s *Program, target *Spec) (map[uint64]Relocation, error) { + if len(s.coreRelos) == 0 { + return nil, nil + } + + return coreRelocate(s.spec, target, s.coreRelos) +} + type bpfLoadBTFAttr struct { btf internal.Pointer logBuf internal.Pointer @@ -718,7 +717,7 @@ func marshalBTF(types interface{}, strings []byte, bo binary.ByteOrder) []byte { return buf.Bytes() } -var haveBTF = internal.FeatureTest("BTF", "5.1", func() (bool, error) { +var haveBTF = internal.FeatureTest("BTF", "5.1", func() error { var ( types struct { Integer btfType @@ -742,15 +741,24 @@ var haveBTF = internal.FeatureTest("BTF", "5.1", func() (bool, error) { btf: internal.NewSlicePointer(btf), btfSize: uint32(len(btf)), }) - if err == nil { - fd.Close() + if errors.Is(err, unix.EINVAL) || errors.Is(err, unix.EPERM) { + // Treat both EINVAL and EPERM as not supported: loading the program + // might still succeed without BTF. + return internal.ErrNotSupported + } + if err != nil { + return err } - // Check for EINVAL specifically, rather than err != nil since we - // otherwise misdetect due to insufficient permissions. - return !errors.Is(err, unix.EINVAL), nil + + fd.Close() + return nil }) -var haveFuncLinkage = internal.FeatureTest("BTF func linkage", "5.6", func() (bool, error) { +var haveFuncLinkage = internal.FeatureTest("BTF func linkage", "5.6", func() error { + if err := haveBTF(); err != nil { + return err + } + var ( types struct { FuncProto btfType @@ -771,11 +779,13 @@ var haveFuncLinkage = internal.FeatureTest("BTF func linkage", "5.6", func() (bo btf: internal.NewSlicePointer(btf), btfSize: uint32(len(btf)), }) - if err == nil { - fd.Close() + if errors.Is(err, unix.EINVAL) { + return internal.ErrNotSupported + } + if err != nil { + return err } - // Check for EINVAL specifically, rather than err != nil since we - // otherwise misdetect due to insufficient permissions. - return !errors.Is(err, unix.EINVAL), nil + fd.Close() + return nil }) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go index a4cde3fe8270..6d75cd6c0321 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go @@ -31,12 +31,14 @@ const ( kindDatasec ) +// btfFuncLinkage describes BTF function linkage metadata. type btfFuncLinkage uint8 +// Equivalent of enum btf_func_linkage. const ( linkageStatic btfFuncLinkage = iota linkageGlobal - linkageExtern + // linkageExtern // Currently unused in libbpf. ) const ( diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/core.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/core.go new file mode 100644 index 000000000000..52b59ed189f4 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/core.go @@ -0,0 +1,388 @@ +package btf + +import ( + "errors" + "fmt" + "reflect" + "strconv" + "strings" +) + +// Code in this file is derived from libbpf, which is available under a BSD +// 2-Clause license. + +// Relocation describes a CO-RE relocation. +type Relocation struct { + Current uint32 + New uint32 +} + +func (r Relocation) equal(other Relocation) bool { + return r.Current == other.Current && r.New == other.New +} + +// coreReloKind is the type of CO-RE relocation +type coreReloKind uint32 + +const ( + reloFieldByteOffset coreReloKind = iota /* field byte offset */ + reloFieldByteSize /* field size in bytes */ + reloFieldExists /* field existence in target kernel */ + reloFieldSigned /* field signedness (0 - unsigned, 1 - signed) */ + reloFieldLShiftU64 /* bitfield-specific left bitshift */ + reloFieldRShiftU64 /* bitfield-specific right bitshift */ + reloTypeIDLocal /* type ID in local BPF object */ + reloTypeIDTarget /* type ID in target kernel */ + reloTypeExists /* type existence in target kernel */ + reloTypeSize /* type size in bytes */ + reloEnumvalExists /* enum value existence in target kernel */ + reloEnumvalValue /* enum value integer value */ +) + +func (k coreReloKind) String() string { + switch k { + case reloFieldByteOffset: + return "byte_off" + case reloFieldByteSize: + return "byte_sz" + case reloFieldExists: + return "field_exists" + case reloFieldSigned: + return "signed" + case reloFieldLShiftU64: + return "lshift_u64" + case reloFieldRShiftU64: + return "rshift_u64" + case reloTypeIDLocal: + return "local_type_id" + case reloTypeIDTarget: + return "target_type_id" + case reloTypeExists: + return "type_exists" + case reloTypeSize: + return "type_size" + case reloEnumvalExists: + return "enumval_exists" + case reloEnumvalValue: + return "enumval_value" + default: + return "unknown" + } +} + +func coreRelocate(local, target *Spec, coreRelos bpfCoreRelos) (map[uint64]Relocation, error) { + if target == nil { + var err error + target, err = loadKernelSpec() + if err != nil { + return nil, err + } + } + + if local.byteOrder != target.byteOrder { + return nil, fmt.Errorf("can't relocate %s against %s", local.byteOrder, target.byteOrder) + } + + relocations := make(map[uint64]Relocation, len(coreRelos)) + for _, relo := range coreRelos { + accessorStr, err := local.strings.Lookup(relo.AccessStrOff) + if err != nil { + return nil, err + } + + accessor, err := parseCoreAccessor(accessorStr) + if err != nil { + return nil, fmt.Errorf("accessor %q: %s", accessorStr, err) + } + + if int(relo.TypeID) >= len(local.types) { + return nil, fmt.Errorf("invalid type id %d", relo.TypeID) + } + + typ := local.types[relo.TypeID] + + if relo.ReloKind == reloTypeIDLocal { + relocations[uint64(relo.InsnOff)] = Relocation{ + uint32(typ.ID()), + uint32(typ.ID()), + } + continue + } + + named, ok := typ.(namedType) + if !ok || named.name() == "" { + return nil, fmt.Errorf("relocate anonymous type %s: %w", typ.String(), ErrNotSupported) + } + + name := essentialName(named.name()) + res, err := coreCalculateRelocation(typ, target.namedTypes[name], relo.ReloKind, accessor) + if err != nil { + return nil, fmt.Errorf("relocate %s: %w", name, err) + } + + relocations[uint64(relo.InsnOff)] = res + } + + return relocations, nil +} + +var errAmbiguousRelocation = errors.New("ambiguous relocation") + +func coreCalculateRelocation(local Type, targets []namedType, kind coreReloKind, localAccessor coreAccessor) (Relocation, error) { + var relos []Relocation + var matches []Type + for _, target := range targets { + switch kind { + case reloTypeIDTarget: + if localAccessor[0] != 0 { + return Relocation{}, fmt.Errorf("%s: unexpected non-zero accessor", kind) + } + + if compat, err := coreAreTypesCompatible(local, target); err != nil { + return Relocation{}, fmt.Errorf("%s: %s", kind, err) + } else if !compat { + continue + } + + relos = append(relos, Relocation{uint32(target.ID()), uint32(target.ID())}) + + default: + return Relocation{}, fmt.Errorf("relocation %s: %w", kind, ErrNotSupported) + } + matches = append(matches, target) + } + + if len(relos) == 0 { + // TODO: Add switch for existence checks like reloEnumvalExists here. + + // TODO: This might have to be poisoned. + return Relocation{}, fmt.Errorf("no relocation found, tried %v", targets) + } + + relo := relos[0] + for _, altRelo := range relos[1:] { + if !altRelo.equal(relo) { + return Relocation{}, fmt.Errorf("multiple types %v match: %w", matches, errAmbiguousRelocation) + } + } + + return relo, nil +} + +/* coreAccessor contains a path through a struct. It contains at least one index. + * + * The interpretation depends on the kind of the relocation. The following is + * taken from struct bpf_core_relo in libbpf_internal.h: + * + * - for field-based relocations, string encodes an accessed field using + * a sequence of field and array indices, separated by colon (:). It's + * conceptually very close to LLVM's getelementptr ([0]) instruction's + * arguments for identifying offset to a field. + * - for type-based relocations, strings is expected to be just "0"; + * - for enum value-based relocations, string contains an index of enum + * value within its enum type; + * + * Example to provide a better feel. + * + * struct sample { + * int a; + * struct { + * int b[10]; + * }; + * }; + * + * struct sample s = ...; + * int x = &s->a; // encoded as "0:0" (a is field #0) + * int y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1, + * // b is field #0 inside anon struct, accessing elem #5) + * int z = &s[10]->b; // encoded as "10:1" (ptr is used as an array) + */ +type coreAccessor []int + +func parseCoreAccessor(accessor string) (coreAccessor, error) { + if accessor == "" { + return nil, fmt.Errorf("empty accessor") + } + + var result coreAccessor + parts := strings.Split(accessor, ":") + for _, part := range parts { + // 31 bits to avoid overflowing int on 32 bit platforms. + index, err := strconv.ParseUint(part, 10, 31) + if err != nil { + return nil, fmt.Errorf("accessor index %q: %s", part, err) + } + + result = append(result, int(index)) + } + + return result, nil +} + +/* The comment below is from bpf_core_types_are_compat in libbpf.c: + * + * Check local and target types for compatibility. This check is used for + * type-based CO-RE relocations and follow slightly different rules than + * field-based relocations. This function assumes that root types were already + * checked for name match. Beyond that initial root-level name check, names + * are completely ignored. Compatibility rules are as follows: + * - any two STRUCTs/UNIONs/FWDs/ENUMs/INTs are considered compatible, but + * kind should match for local and target types (i.e., STRUCT is not + * compatible with UNION); + * - for ENUMs, the size is ignored; + * - for INT, size and signedness are ignored; + * - for ARRAY, dimensionality is ignored, element types are checked for + * compatibility recursively; + * - CONST/VOLATILE/RESTRICT modifiers are ignored; + * - TYPEDEFs/PTRs are compatible if types they pointing to are compatible; + * - FUNC_PROTOs are compatible if they have compatible signature: same + * number of input args and compatible return and argument types. + * These rules are not set in stone and probably will be adjusted as we get + * more experience with using BPF CO-RE relocations. + */ +func coreAreTypesCompatible(localType Type, targetType Type) (bool, error) { + var ( + localTs, targetTs typeDeque + l, t = &localType, &targetType + depth = 0 + ) + + for ; l != nil && t != nil; l, t = localTs.shift(), targetTs.shift() { + if depth >= maxTypeDepth { + return false, errors.New("types are nested too deep") + } + + localType = skipQualifierAndTypedef(*l) + targetType = skipQualifierAndTypedef(*t) + + if reflect.TypeOf(localType) != reflect.TypeOf(targetType) { + return false, nil + } + + switch lv := (localType).(type) { + case *Void, *Struct, *Union, *Enum, *Fwd: + // Nothing to do here + + case *Int: + tv := targetType.(*Int) + if lv.isBitfield() || tv.isBitfield() { + return false, nil + } + + case *Pointer, *Array: + depth++ + localType.walk(&localTs) + targetType.walk(&targetTs) + + case *FuncProto: + tv := targetType.(*FuncProto) + if len(lv.Params) != len(tv.Params) { + return false, nil + } + + depth++ + localType.walk(&localTs) + targetType.walk(&targetTs) + + default: + return false, fmt.Errorf("unsupported type %T", localType) + } + } + + if l != nil { + return false, fmt.Errorf("dangling local type %T", *l) + } + + if t != nil { + return false, fmt.Errorf("dangling target type %T", *t) + } + + return true, nil +} + +/* The comment below is from bpf_core_fields_are_compat in libbpf.c: + * + * Check two types for compatibility for the purpose of field access + * relocation. const/volatile/restrict and typedefs are skipped to ensure we + * are relocating semantically compatible entities: + * - any two STRUCTs/UNIONs are compatible and can be mixed; + * - any two FWDs are compatible, if their names match (modulo flavor suffix); + * - any two PTRs are always compatible; + * - for ENUMs, names should be the same (ignoring flavor suffix) or at + * least one of enums should be anonymous; + * - for ENUMs, check sizes, names are ignored; + * - for INT, size and signedness are ignored; + * - for ARRAY, dimensionality is ignored, element types are checked for + * compatibility recursively; + * - everything else shouldn't be ever a target of relocation. + * These rules are not set in stone and probably will be adjusted as we get + * more experience with using BPF CO-RE relocations. + */ +func coreAreMembersCompatible(localType Type, targetType Type) (bool, error) { + doNamesMatch := func(a, b string) bool { + if a == "" || b == "" { + // allow anonymous and named type to match + return true + } + + return essentialName(a) == essentialName(b) + } + + for depth := 0; depth <= maxTypeDepth; depth++ { + localType = skipQualifierAndTypedef(localType) + targetType = skipQualifierAndTypedef(targetType) + + _, lok := localType.(composite) + _, tok := targetType.(composite) + if lok && tok { + return true, nil + } + + if reflect.TypeOf(localType) != reflect.TypeOf(targetType) { + return false, nil + } + + switch lv := localType.(type) { + case *Pointer: + return true, nil + + case *Enum: + tv := targetType.(*Enum) + return doNamesMatch(lv.name(), tv.name()), nil + + case *Fwd: + tv := targetType.(*Fwd) + return doNamesMatch(lv.name(), tv.name()), nil + + case *Int: + tv := targetType.(*Int) + return !lv.isBitfield() && !tv.isBitfield(), nil + + case *Array: + tv := targetType.(*Array) + + localType = lv.Type + targetType = tv.Type + + default: + return false, fmt.Errorf("unsupported type %T", localType) + } + } + + return false, errors.New("types are nested too deep") +} + +func skipQualifierAndTypedef(typ Type) Type { + result := typ + for depth := 0; depth <= maxTypeDepth; depth++ { + switch v := (result).(type) { + case qualifier: + result = v.qualify() + case *Typedef: + result = v.Type + default: + return result + } + } + return typ +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go index c1c82ec7f802..6a21b6bda5cc 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go @@ -25,57 +25,82 @@ type btfExtHeader struct { LineInfoLen uint32 } -func parseExtInfos(r io.ReadSeeker, bo binary.ByteOrder, strings stringTable) (funcInfo, lineInfo map[string]extInfo, err error) { +type btfExtCoreHeader struct { + CoreReloOff uint32 + CoreReloLen uint32 +} + +func parseExtInfos(r io.ReadSeeker, bo binary.ByteOrder, strings stringTable) (funcInfo, lineInfo map[string]extInfo, coreRelos map[string]bpfCoreRelos, err error) { var header btfExtHeader + var coreHeader btfExtCoreHeader if err := binary.Read(r, bo, &header); err != nil { - return nil, nil, fmt.Errorf("can't read header: %v", err) + return nil, nil, nil, fmt.Errorf("can't read header: %v", err) } if header.Magic != btfMagic { - return nil, nil, fmt.Errorf("incorrect magic value %v", header.Magic) + return nil, nil, nil, fmt.Errorf("incorrect magic value %v", header.Magic) } if header.Version != 1 { - return nil, nil, fmt.Errorf("unexpected version %v", header.Version) + return nil, nil, nil, fmt.Errorf("unexpected version %v", header.Version) } if header.Flags != 0 { - return nil, nil, fmt.Errorf("unsupported flags %v", header.Flags) + return nil, nil, nil, fmt.Errorf("unsupported flags %v", header.Flags) } remainder := int64(header.HdrLen) - int64(binary.Size(&header)) if remainder < 0 { - return nil, nil, errors.New("header is too short") + return nil, nil, nil, errors.New("header is too short") + } + + coreHdrSize := int64(binary.Size(&coreHeader)) + if remainder >= coreHdrSize { + if err := binary.Read(r, bo, &coreHeader); err != nil { + return nil, nil, nil, fmt.Errorf("can't read CO-RE relocation header: %v", err) + } + remainder -= coreHdrSize } // Of course, the .BTF.ext header has different semantics than the // .BTF ext header. We need to ignore non-null values. _, err = io.CopyN(ioutil.Discard, r, remainder) if err != nil { - return nil, nil, fmt.Errorf("header padding: %v", err) + return nil, nil, nil, fmt.Errorf("header padding: %v", err) } if _, err := r.Seek(int64(header.HdrLen+header.FuncInfoOff), io.SeekStart); err != nil { - return nil, nil, fmt.Errorf("can't seek to function info section: %v", err) + return nil, nil, nil, fmt.Errorf("can't seek to function info section: %v", err) } buf := bufio.NewReader(io.LimitReader(r, int64(header.FuncInfoLen))) funcInfo, err = parseExtInfo(buf, bo, strings) if err != nil { - return nil, nil, fmt.Errorf("function info: %w", err) + return nil, nil, nil, fmt.Errorf("function info: %w", err) } if _, err := r.Seek(int64(header.HdrLen+header.LineInfoOff), io.SeekStart); err != nil { - return nil, nil, fmt.Errorf("can't seek to line info section: %v", err) + return nil, nil, nil, fmt.Errorf("can't seek to line info section: %v", err) } buf = bufio.NewReader(io.LimitReader(r, int64(header.LineInfoLen))) lineInfo, err = parseExtInfo(buf, bo, strings) if err != nil { - return nil, nil, fmt.Errorf("line info: %w", err) + return nil, nil, nil, fmt.Errorf("line info: %w", err) } - return funcInfo, lineInfo, nil + if coreHeader.CoreReloOff > 0 && coreHeader.CoreReloLen > 0 { + if _, err := r.Seek(int64(header.HdrLen+coreHeader.CoreReloOff), io.SeekStart); err != nil { + return nil, nil, nil, fmt.Errorf("can't seek to CO-RE relocation section: %v", err) + } + + coreRelos, err = parseExtInfoRelos(io.LimitReader(r, int64(coreHeader.CoreReloLen)), bo, strings) + if err != nil { + return nil, nil, nil, fmt.Errorf("CO-RE relocation info: %w", err) + } + } + + return funcInfo, lineInfo, coreRelos, nil } type btfExtInfoSec struct { @@ -147,20 +172,9 @@ func parseExtInfo(r io.Reader, bo binary.ByteOrder, strings stringTable) (map[st result := make(map[string]extInfo) for { - var infoHeader btfExtInfoSec - if err := binary.Read(r, bo, &infoHeader); err == io.EOF { + secName, infoHeader, err := parseExtInfoHeader(r, bo, strings) + if errors.Is(err, io.EOF) { return result, nil - } else if err != nil { - return nil, fmt.Errorf("can't read ext info header: %v", err) - } - - secName, err := strings.Lookup(infoHeader.SecNameOff) - if err != nil { - return nil, fmt.Errorf("can't get section name: %w", err) - } - - if infoHeader.NumInfo == 0 { - return nil, fmt.Errorf("section %s has invalid number of records", secName) } var records []extInfoRecord @@ -188,3 +202,80 @@ func parseExtInfo(r io.Reader, bo binary.ByteOrder, strings stringTable) (map[st } } } + +// bpfCoreRelo matches `struct bpf_core_relo` from the kernel +type bpfCoreRelo struct { + InsnOff uint32 + TypeID TypeID + AccessStrOff uint32 + ReloKind coreReloKind +} + +type bpfCoreRelos []bpfCoreRelo + +// append two slices of extInfoRelo to each other. The InsnOff of b are adjusted +// by offset. +func (r bpfCoreRelos) append(other bpfCoreRelos, offset uint64) bpfCoreRelos { + result := make([]bpfCoreRelo, 0, len(r)+len(other)) + result = append(result, r...) + for _, relo := range other { + relo.InsnOff += uint32(offset) + result = append(result, relo) + } + return result +} + +var extInfoReloSize = binary.Size(bpfCoreRelo{}) + +func parseExtInfoRelos(r io.Reader, bo binary.ByteOrder, strings stringTable) (map[string]bpfCoreRelos, error) { + var recordSize uint32 + if err := binary.Read(r, bo, &recordSize); err != nil { + return nil, fmt.Errorf("read record size: %v", err) + } + + if recordSize != uint32(extInfoReloSize) { + return nil, fmt.Errorf("expected record size %d, got %d", extInfoReloSize, recordSize) + } + + result := make(map[string]bpfCoreRelos) + for { + secName, infoHeader, err := parseExtInfoHeader(r, bo, strings) + if errors.Is(err, io.EOF) { + return result, nil + } + + var relos []bpfCoreRelo + for i := uint32(0); i < infoHeader.NumInfo; i++ { + var relo bpfCoreRelo + if err := binary.Read(r, bo, &relo); err != nil { + return nil, fmt.Errorf("section %v: read record: %v", secName, err) + } + + if relo.InsnOff%asm.InstructionSize != 0 { + return nil, fmt.Errorf("section %v: offset %v is not aligned with instruction size", secName, relo.InsnOff) + } + + relos = append(relos, relo) + } + + result[secName] = relos + } +} + +func parseExtInfoHeader(r io.Reader, bo binary.ByteOrder, strings stringTable) (string, *btfExtInfoSec, error) { + var infoHeader btfExtInfoSec + if err := binary.Read(r, bo, &infoHeader); err != nil { + return "", nil, fmt.Errorf("read ext info header: %w", err) + } + + secName, err := strings.Lookup(infoHeader.SecNameOff) + if err != nil { + return "", nil, fmt.Errorf("get section name: %w", err) + } + + if infoHeader.NumInfo == 0 { + return "", nil, fmt.Errorf("section %s has zero records", secName) + } + + return secName, &infoHeader, nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/types.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/types.go index a93039bd5183..9e1fd8d0b2df 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/types.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/btf/types.go @@ -21,12 +21,14 @@ func (tid TypeID) ID() TypeID { type Type interface { ID() TypeID + String() string + // Make a copy of the type, without copying Type members. copy() Type // Enumerate all nested Types. Repeated calls must visit nested // types in the same order. - walk(*copyStack) + walk(*typeDeque) } // namedType is a type with a name. @@ -50,9 +52,10 @@ func (n Name) name() string { type Void struct{} func (v *Void) ID() TypeID { return 0 } +func (v *Void) String() string { return "void#0" } func (v *Void) size() uint32 { return 0 } func (v *Void) copy() Type { return (*Void)(nil) } -func (v *Void) walk(*copyStack) {} +func (v *Void) walk(*typeDeque) {} type IntEncoding byte @@ -78,21 +81,54 @@ type Int struct { var _ namedType = (*Int)(nil) +func (i *Int) String() string { + var s strings.Builder + + switch { + case i.Encoding&Char != 0: + s.WriteString("char") + case i.Encoding&Bool != 0: + s.WriteString("bool") + default: + if i.Encoding&Signed == 0 { + s.WriteRune('u') + } + s.WriteString("int") + fmt.Fprintf(&s, "%d", i.Size*8) + } + + fmt.Fprintf(&s, "#%d", i.TypeID) + + if i.Bits > 0 { + fmt.Fprintf(&s, "[bits=%d]", i.Bits) + } + + return s.String() +} + func (i *Int) size() uint32 { return i.Size } -func (i *Int) walk(*copyStack) {} +func (i *Int) walk(*typeDeque) {} func (i *Int) copy() Type { cpy := *i return &cpy } +func (i *Int) isBitfield() bool { + return i.Offset > 0 +} + // Pointer is a pointer to another type. type Pointer struct { TypeID Target Type } -func (p *Pointer) size() uint32 { return 8 } -func (p *Pointer) walk(cs *copyStack) { cs.push(&p.Target) } +func (p *Pointer) String() string { + return fmt.Sprintf("pointer#%d[target=#%d]", p.TypeID, p.Target.ID()) +} + +func (p *Pointer) size() uint32 { return 8 } +func (p *Pointer) walk(tdq *typeDeque) { tdq.push(&p.Target) } func (p *Pointer) copy() Type { cpy := *p return &cpy @@ -105,7 +141,11 @@ type Array struct { Nelems uint32 } -func (arr *Array) walk(cs *copyStack) { cs.push(&arr.Type) } +func (arr *Array) String() string { + return fmt.Sprintf("array#%d[type=#%d n=%d]", arr.TypeID, arr.Type.ID(), arr.Nelems) +} + +func (arr *Array) walk(tdq *typeDeque) { tdq.push(&arr.Type) } func (arr *Array) copy() Type { cpy := *arr return &cpy @@ -120,11 +160,15 @@ type Struct struct { Members []Member } +func (s *Struct) String() string { + return fmt.Sprintf("struct#%d[%q]", s.TypeID, s.Name) +} + func (s *Struct) size() uint32 { return s.Size } -func (s *Struct) walk(cs *copyStack) { +func (s *Struct) walk(tdq *typeDeque) { for i := range s.Members { - cs.push(&s.Members[i].Type) + tdq.push(&s.Members[i].Type) } } @@ -148,11 +192,15 @@ type Union struct { Members []Member } +func (u *Union) String() string { + return fmt.Sprintf("union#%d[%q]", u.TypeID, u.Name) +} + func (u *Union) size() uint32 { return u.Size } -func (u *Union) walk(cs *copyStack) { +func (u *Union) walk(tdq *typeDeque) { for i := range u.Members { - cs.push(&u.Members[i].Type) + tdq.push(&u.Members[i].Type) } } @@ -194,6 +242,10 @@ type Enum struct { Values []EnumValue } +func (e *Enum) String() string { + return fmt.Sprintf("enum#%d[%q]", e.TypeID, e.Name) +} + // EnumValue is part of an Enum // // Is is not a valid Type @@ -203,7 +255,7 @@ type EnumValue struct { } func (e *Enum) size() uint32 { return 4 } -func (e *Enum) walk(*copyStack) {} +func (e *Enum) walk(*typeDeque) {} func (e *Enum) copy() Type { cpy := *e cpy.Values = make([]EnumValue, len(e.Values)) @@ -211,13 +263,38 @@ func (e *Enum) copy() Type { return &cpy } +// FwdKind is the type of forward declaration. +type FwdKind int + +// Valid types of forward declaration. +const ( + FwdStruct FwdKind = iota + FwdUnion +) + +func (fk FwdKind) String() string { + switch fk { + case FwdStruct: + return "struct" + case FwdUnion: + return "union" + default: + return fmt.Sprintf("%T(%d)", fk, int(fk)) + } +} + // Fwd is a forward declaration of a Type. type Fwd struct { TypeID Name + Kind FwdKind +} + +func (f *Fwd) String() string { + return fmt.Sprintf("fwd#%d[%s %q]", f.TypeID, f.Kind, f.Name) } -func (f *Fwd) walk(*copyStack) {} +func (f *Fwd) walk(*typeDeque) {} func (f *Fwd) copy() Type { cpy := *f return &cpy @@ -230,7 +307,11 @@ type Typedef struct { Type Type } -func (td *Typedef) walk(cs *copyStack) { cs.push(&td.Type) } +func (td *Typedef) String() string { + return fmt.Sprintf("typedef#%d[%q #%d]", td.TypeID, td.Name, td.Type.ID()) +} + +func (td *Typedef) walk(tdq *typeDeque) { tdq.push(&td.Type) } func (td *Typedef) copy() Type { cpy := *td return &cpy @@ -242,8 +323,12 @@ type Volatile struct { Type Type } -func (v *Volatile) qualify() Type { return v.Type } -func (v *Volatile) walk(cs *copyStack) { cs.push(&v.Type) } +func (v *Volatile) String() string { + return fmt.Sprintf("volatile#%d[#%d]", v.TypeID, v.Type.ID()) +} + +func (v *Volatile) qualify() Type { return v.Type } +func (v *Volatile) walk(tdq *typeDeque) { tdq.push(&v.Type) } func (v *Volatile) copy() Type { cpy := *v return &cpy @@ -255,8 +340,12 @@ type Const struct { Type Type } -func (c *Const) qualify() Type { return c.Type } -func (c *Const) walk(cs *copyStack) { cs.push(&c.Type) } +func (c *Const) String() string { + return fmt.Sprintf("const#%d[#%d]", c.TypeID, c.Type.ID()) +} + +func (c *Const) qualify() Type { return c.Type } +func (c *Const) walk(tdq *typeDeque) { tdq.push(&c.Type) } func (c *Const) copy() Type { cpy := *c return &cpy @@ -268,8 +357,12 @@ type Restrict struct { Type Type } -func (r *Restrict) qualify() Type { return r.Type } -func (r *Restrict) walk(cs *copyStack) { cs.push(&r.Type) } +func (r *Restrict) String() string { + return fmt.Sprintf("restrict#%d[#%d]", r.TypeID, r.Type.ID()) +} + +func (r *Restrict) qualify() Type { return r.Type } +func (r *Restrict) walk(tdq *typeDeque) { tdq.push(&r.Type) } func (r *Restrict) copy() Type { cpy := *r return &cpy @@ -282,7 +375,11 @@ type Func struct { Type Type } -func (f *Func) walk(cs *copyStack) { cs.push(&f.Type) } +func (f *Func) String() string { + return fmt.Sprintf("func#%d[%q proto=#%d]", f.TypeID, f.Name, f.Type.ID()) +} + +func (f *Func) walk(tdq *typeDeque) { tdq.push(&f.Type) } func (f *Func) copy() Type { cpy := *f return &cpy @@ -295,10 +392,20 @@ type FuncProto struct { Params []FuncParam } -func (fp *FuncProto) walk(cs *copyStack) { - cs.push(&fp.Return) +func (fp *FuncProto) String() string { + var s strings.Builder + fmt.Fprintf(&s, "proto#%d[", fp.TypeID) + for _, param := range fp.Params { + fmt.Fprintf(&s, "%q=#%d, ", param.Name, param.Type.ID()) + } + fmt.Fprintf(&s, "return=#%d]", fp.Return.ID()) + return s.String() +} + +func (fp *FuncProto) walk(tdq *typeDeque) { + tdq.push(&fp.Return) for i := range fp.Params { - cs.push(&fp.Params[i].Type) + tdq.push(&fp.Params[i].Type) } } @@ -321,7 +428,12 @@ type Var struct { Type Type } -func (v *Var) walk(cs *copyStack) { cs.push(&v.Type) } +func (v *Var) String() string { + // TODO: Linkage + return fmt.Sprintf("var#%d[%q]", v.TypeID, v.Name) +} + +func (v *Var) walk(tdq *typeDeque) { tdq.push(&v.Type) } func (v *Var) copy() Type { cpy := *v return &cpy @@ -335,11 +447,15 @@ type Datasec struct { Vars []VarSecinfo } +func (ds *Datasec) String() string { + return fmt.Sprintf("section#%d[%q]", ds.TypeID, ds.Name) +} + func (ds *Datasec) size() uint32 { return ds.Size } -func (ds *Datasec) walk(cs *copyStack) { +func (ds *Datasec) walk(tdq *typeDeque) { for i := range ds.Vars { - cs.push(&ds.Vars[i].Type) + tdq.push(&ds.Vars[i].Type) } } @@ -351,6 +467,8 @@ func (ds *Datasec) copy() Type { } // VarSecinfo describes variable in a Datasec +// +// It is not a valid Type. type VarSecinfo struct { Type Type Offset uint32 @@ -438,7 +556,7 @@ func Sizeof(typ Type) (int, error) { func copyType(typ Type) Type { var ( copies = make(map[Type]Type) - work copyStack + work typeDeque ) for t := &typ; t != nil; t = work.pop() { @@ -459,34 +577,83 @@ func copyType(typ Type) Type { return typ } -// copyStack keeps track of pointers to types which still +// typeDeque keeps track of pointers to types which still // need to be visited. -type copyStack []*Type +type typeDeque struct { + types []*Type + read, write uint64 + mask uint64 +} // push adds a type to the stack. -func (cs *copyStack) push(t *Type) { - *cs = append(*cs, t) +func (dq *typeDeque) push(t *Type) { + if dq.write-dq.read < uint64(len(dq.types)) { + dq.types[dq.write&dq.mask] = t + dq.write++ + return + } + + new := len(dq.types) * 2 + if new == 0 { + new = 8 + } + + types := make([]*Type, new) + pivot := dq.read & dq.mask + n := copy(types, dq.types[pivot:]) + n += copy(types[n:], dq.types[:pivot]) + types[n] = t + + dq.types = types + dq.mask = uint64(new) - 1 + dq.read, dq.write = 0, uint64(n+1) +} + +// shift returns the first element or null. +func (dq *typeDeque) shift() *Type { + if dq.read == dq.write { + return nil + } + + index := dq.read & dq.mask + t := dq.types[index] + dq.types[index] = nil + dq.read++ + return t } -// pop returns the topmost Type, or nil. -func (cs *copyStack) pop() *Type { - n := len(*cs) - if n == 0 { +// pop returns the last element or null. +func (dq *typeDeque) pop() *Type { + if dq.read == dq.write { return nil } - t := (*cs)[n-1] - *cs = (*cs)[:n-1] + dq.write-- + index := dq.write & dq.mask + t := dq.types[index] + dq.types[index] = nil return t } +// all returns all elements. +// +// The deque is empty after calling this method. +func (dq *typeDeque) all() []*Type { + length := dq.write - dq.read + types := make([]*Type, 0, length) + for t := dq.shift(); t != nil; t = dq.shift() { + types = append(types, t) + } + return types +} + // inflateRawTypes takes a list of raw btf types linked via type IDs, and turns // it into a graph of Types connected via pointers. // -// Returns a map of named types (so, where NameOff is non-zero). Since BTF ignores -// compilation units, multiple types may share the same name. A Type may form a -// cyclic graph by pointing at itself. -func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map[string][]namedType, err error) { +// Returns a map of named types (so, where NameOff is non-zero) and a slice of types +// indexed by TypeID. Since BTF ignores compilation units, multiple types may share +// the same name. A Type may form a cyclic graph by pointing at itself. +func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (types []Type, namedTypes map[string][]namedType, err error) { type fixupDef struct { id TypeID expectedKind btfKind @@ -523,7 +690,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map return members, nil } - types := make([]Type, 0, len(rawTypes)) + types = make([]Type, 0, len(rawTypes)) types = append(types, (*Void)(nil)) namedTypes = make(map[string][]namedType) @@ -537,7 +704,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map name, err := rawStrings.LookupName(raw.NameOff) if err != nil { - return nil, fmt.Errorf("can't get name for type id %d: %w", id, err) + return nil, nil, fmt.Errorf("get name for type id %d: %w", id, err) } switch raw.Kind() { @@ -562,14 +729,14 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map case kindStruct: members, err := convertMembers(raw.data.([]btfMember), raw.KindFlag()) if err != nil { - return nil, fmt.Errorf("struct %s (id %d): %w", name, id, err) + return nil, nil, fmt.Errorf("struct %s (id %d): %w", name, id, err) } typ = &Struct{id, name, raw.Size(), members} case kindUnion: members, err := convertMembers(raw.data.([]btfMember), raw.KindFlag()) if err != nil { - return nil, fmt.Errorf("union %s (id %d): %w", name, id, err) + return nil, nil, fmt.Errorf("union %s (id %d): %w", name, id, err) } typ = &Union{id, name, raw.Size(), members} @@ -579,7 +746,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map for i, btfVal := range rawvals { name, err := rawStrings.LookupName(btfVal.NameOff) if err != nil { - return nil, fmt.Errorf("can't get name for enum value %d: %s", i, err) + return nil, nil, fmt.Errorf("get name for enum value %d: %s", i, err) } vals = append(vals, EnumValue{ Name: name, @@ -589,7 +756,11 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map typ = &Enum{id, name, vals} case kindForward: - typ = &Fwd{id, name} + if raw.KindFlag() { + typ = &Fwd{id, name, FwdUnion} + } else { + typ = &Fwd{id, name, FwdStruct} + } case kindTypedef: typedef := &Typedef{id, name, nil} @@ -622,7 +793,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map for i, param := range rawparams { name, err := rawStrings.LookupName(param.NameOff) if err != nil { - return nil, fmt.Errorf("can't get name for func proto parameter %d: %s", i, err) + return nil, nil, fmt.Errorf("get name for func proto parameter %d: %s", i, err) } params = append(params, FuncParam{ Name: name, @@ -656,7 +827,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map typ = &Datasec{id, name, raw.SizeType, vars} default: - return nil, fmt.Errorf("type id %d: unknown kind: %v", id, raw.Kind()) + return nil, nil, fmt.Errorf("type id %d: unknown kind: %v", id, raw.Kind()) } types = append(types, typ) @@ -671,7 +842,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map for _, fixup := range fixups { i := int(fixup.id) if i >= len(types) { - return nil, fmt.Errorf("reference to invalid type id: %d", fixup.id) + return nil, nil, fmt.Errorf("reference to invalid type id: %d", fixup.id) } // Default void (id 0) to unknown @@ -681,13 +852,13 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map } if expected := fixup.expectedKind; expected != kindUnknown && rawKind != expected { - return nil, fmt.Errorf("expected type id %d to have kind %s, found %s", fixup.id, expected, rawKind) + return nil, nil, fmt.Errorf("expected type id %d to have kind %s, found %s", fixup.id, expected, rawKind) } *fixup.typ = types[i] } - return namedTypes, nil + return types, namedTypes, nil } // essentialName returns name without a ___ suffix. diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/elf.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/elf.go new file mode 100644 index 000000000000..c3f9ea0f8a40 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/elf.go @@ -0,0 +1,52 @@ +package internal + +import ( + "debug/elf" + "fmt" + "io" +) + +type SafeELFFile struct { + *elf.File +} + +// NewSafeELFFile reads an ELF safely. +// +// Any panic during parsing is turned into an error. This is necessary since +// there are a bunch of unfixed bugs in debug/elf. +// +// https://github.com/golang/go/issues?q=is%3Aissue+is%3Aopen+debug%2Felf+in%3Atitle +func NewSafeELFFile(r io.ReaderAt) (safe *SafeELFFile, err error) { + defer func() { + r := recover() + if r == nil { + return + } + + safe = nil + err = fmt.Errorf("reading ELF file panicked: %s", r) + }() + + file, err := elf.NewFile(r) + if err != nil { + return nil, err + } + + return &SafeELFFile{file}, nil +} + +// Symbols is the safe version of elf.File.Symbols. +func (se *SafeELFFile) Symbols() (syms []elf.Symbol, err error) { + defer func() { + r := recover() + if r == nil { + return + } + + syms = nil + err = fmt.Errorf("reading ELF symbols panicked: %s", r) + }() + + syms, err = se.File.Symbols() + return +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/feature.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/feature.go index 8f282db64dfa..c94a2e1ee018 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/feature.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/feature.go @@ -32,7 +32,7 @@ func (ufe *UnsupportedFeatureError) Is(target error) bool { } type featureTest struct { - sync.Mutex + sync.RWMutex successful bool result error } @@ -42,10 +42,10 @@ type featureTest struct { // // The return values have the following semantics: // +// err == ErrNotSupported: the feature is not available +// err == nil: the feature is available // err != nil: the test couldn't be executed -// err == nil && available: the feature is available -// err == nil && !available: the feature isn't available -type FeatureTestFn func() (available bool, err error) +type FeatureTestFn func() error // FeatureTest wraps a function so that it is run at most once. // @@ -61,70 +61,40 @@ func FeatureTest(name, version string, fn FeatureTestFn) func() error { ft := new(featureTest) return func() error { + ft.RLock() + if ft.successful { + defer ft.RUnlock() + return ft.result + } + ft.RUnlock() ft.Lock() defer ft.Unlock() - + // check one more time on the off + // chance that two go routines + // were able to call into the write + // lock if ft.successful { return ft.result } - - available, err := fn() - if errors.Is(err, ErrNotSupported) { - // The feature test aborted because a dependent feature - // is missing, which we should cache. - available = false - } else if err != nil { - // We couldn't execute the feature test to a point - // where it could make a determination. - // Don't cache the result, just return it. - return fmt.Errorf("can't detect support for %s: %w", name, err) - } - - ft.successful = true - if !available { + err := fn() + switch { + case errors.Is(err, ErrNotSupported): ft.result = &UnsupportedFeatureError{ MinimumVersion: v, Name: name, } - } - return ft.result - } -} + fallthrough -// A Version in the form Major.Minor.Patch. -type Version [3]uint16 + case err == nil: + ft.successful = true -// NewVersion creates a version from a string like "Major.Minor.Patch". -// -// Patch is optional. -func NewVersion(ver string) (Version, error) { - var major, minor, patch uint16 - n, _ := fmt.Sscanf(ver, "%d.%d.%d", &major, &minor, &patch) - if n < 2 { - return Version{}, fmt.Errorf("invalid version: %s", ver) - } - return Version{major, minor, patch}, nil -} - -func (v Version) String() string { - if v[2] == 0 { - return fmt.Sprintf("v%d.%d", v[0], v[1]) - } - return fmt.Sprintf("v%d.%d.%d", v[0], v[1], v[2]) -} - -// Less returns true if the version is less than another version. -func (v Version) Less(other Version) bool { - for i, a := range v { - if a == other[i] { - continue + default: + // We couldn't execute the feature test to a point + // where it could make a determination. + // Don't cache the result, just return it. + return fmt.Errorf("detect support for %s: %w", name, err) } - return a < other[i] - } - return false -} -// Unspecified returns true if the version is all zero. -func (v Version) Unspecified() bool { - return v[0] == 0 && v[1] == 0 && v[2] == 0 + return ft.result + } } diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/pinning.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/pinning.go new file mode 100644 index 000000000000..5329b432d72e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/pinning.go @@ -0,0 +1,44 @@ +package internal + +import ( + "errors" + "fmt" + "os" + + "github.com/cilium/ebpf/internal/unix" +) + +func Pin(currentPath, newPath string, fd *FD) error { + if newPath == "" { + return errors.New("given pinning path cannot be empty") + } + if currentPath == newPath { + return nil + } + if currentPath == "" { + return BPFObjPin(newPath, fd) + } + var err error + // Renameat2 is used instead of os.Rename to disallow the new path replacing + // an existing path. + if err = unix.Renameat2(unix.AT_FDCWD, currentPath, unix.AT_FDCWD, newPath, unix.RENAME_NOREPLACE); err == nil { + // Object is now moved to the new pinning path. + return nil + } + if !os.IsNotExist(err) { + return fmt.Errorf("unable to move pinned object to new path %v: %w", newPath, err) + } + // Internal state not in sync with the file system so let's fix it. + return BPFObjPin(newPath, fd) +} + +func Unpin(pinnedPath string) error { + if pinnedPath == "" { + return nil + } + err := os.Remove(pinnedPath) + if err == nil || os.IsNotExist(err) { + return nil + } + return err +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/ptr.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/ptr.go index a7f12b2db4fe..66822a6acbc9 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/ptr.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/ptr.go @@ -1,6 +1,10 @@ package internal -import "unsafe" +import ( + "unsafe" + + "github.com/cilium/ebpf/internal/unix" +) // NewPointer creates a 64-bit pointer from an unsafe Pointer. func NewPointer(ptr unsafe.Pointer) Pointer { @@ -22,9 +26,10 @@ func NewStringPointer(str string) Pointer { return Pointer{} } - // The kernel expects strings to be zero terminated - buf := make([]byte, len(str)+1) - copy(buf, str) + p, err := unix.BytePtrFromString(str) + if err != nil { + return Pointer{} + } - return Pointer{ptr: unsafe.Pointer(&buf[0])} + return Pointer{ptr: unsafe.Pointer(p)} } diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/syscall.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/syscall.go index 9c5e0b3edd1d..0ba438d368c0 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/syscall.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/syscall.go @@ -91,6 +91,19 @@ func BPFProgDetach(attr *BPFProgDetachAttr) error { return err } +type BPFEnableStatsAttr struct { + StatsType uint32 +} + +func BPFEnableStats(attr *BPFEnableStatsAttr) (*FD, error) { + ptr, err := BPF(BPF_ENABLE_STATS, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) + if err != nil { + return nil, fmt.Errorf("enable stats: %w", err) + } + return NewFD(uint32(ptr)), nil + +} + type bpfObjAttr struct { fileName Pointer fd uint32 @@ -127,9 +140,10 @@ func BPFObjPin(fileName string, fd *FD) error { } // BPFObjGet wraps BPF_OBJ_GET. -func BPFObjGet(fileName string) (*FD, error) { +func BPFObjGet(fileName string, flags uint32) (*FD, error) { attr := bpfObjAttr{ - fileName: NewStringPointer(fileName), + fileName: NewStringPointer(fileName), + fileFlags: flags, } ptr, err := BPF(BPF_OBJ_GET, unsafe.Pointer(&attr), unsafe.Sizeof(attr)) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go index d8135c1836be..24bc76f7b8c3 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go @@ -10,19 +10,27 @@ import ( ) const ( - ENOENT = linux.ENOENT - EEXIST = linux.EEXIST - EAGAIN = linux.EAGAIN - ENOSPC = linux.ENOSPC - EINVAL = linux.EINVAL - EPOLLIN = linux.EPOLLIN - EINTR = linux.EINTR - EPERM = linux.EPERM - ESRCH = linux.ESRCH - ENODEV = linux.ENODEV + ENOENT = linux.ENOENT + EEXIST = linux.EEXIST + EAGAIN = linux.EAGAIN + ENOSPC = linux.ENOSPC + EINVAL = linux.EINVAL + EPOLLIN = linux.EPOLLIN + EINTR = linux.EINTR + EPERM = linux.EPERM + ESRCH = linux.ESRCH + ENODEV = linux.ENODEV + // ENOTSUPP is not the same as ENOTSUP or EOPNOTSUP + ENOTSUPP = syscall.Errno(0x20c) + + EBADF = linux.EBADF + BPF_F_NO_PREALLOC = linux.BPF_F_NO_PREALLOC BPF_F_NUMA_NODE = linux.BPF_F_NUMA_NODE + BPF_F_RDONLY = linux.BPF_F_RDONLY + BPF_F_WRONLY = linux.BPF_F_WRONLY BPF_F_RDONLY_PROG = linux.BPF_F_RDONLY_PROG BPF_F_WRONLY_PROG = linux.BPF_F_WRONLY_PROG + BPF_F_SLEEPABLE = linux.BPF_F_SLEEPABLE BPF_OBJ_NAME_LEN = linux.BPF_OBJ_NAME_LEN BPF_TAG_SIZE = linux.BPF_TAG_SIZE SYS_BPF = linux.SYS_BPF @@ -35,12 +43,21 @@ const ( PROT_WRITE = linux.PROT_WRITE MAP_SHARED = linux.MAP_SHARED PERF_TYPE_SOFTWARE = linux.PERF_TYPE_SOFTWARE + PERF_TYPE_TRACEPOINT = linux.PERF_TYPE_TRACEPOINT PERF_COUNT_SW_BPF_OUTPUT = linux.PERF_COUNT_SW_BPF_OUTPUT + PERF_EVENT_IOC_DISABLE = linux.PERF_EVENT_IOC_DISABLE + PERF_EVENT_IOC_ENABLE = linux.PERF_EVENT_IOC_ENABLE + PERF_EVENT_IOC_SET_BPF = linux.PERF_EVENT_IOC_SET_BPF PerfBitWatermark = linux.PerfBitWatermark PERF_SAMPLE_RAW = linux.PERF_SAMPLE_RAW PERF_FLAG_FD_CLOEXEC = linux.PERF_FLAG_FD_CLOEXEC RLIM_INFINITY = linux.RLIM_INFINITY RLIMIT_MEMLOCK = linux.RLIMIT_MEMLOCK + BPF_STATS_RUN_TIME = linux.BPF_STATS_RUN_TIME + PERF_RECORD_LOST = linux.PERF_RECORD_LOST + PERF_RECORD_SAMPLE = linux.PERF_RECORD_SAMPLE + AT_FDCWD = linux.AT_FDCWD + RENAME_NOREPLACE = linux.RENAME_NOREPLACE ) // Statfs_t is a wrapper @@ -64,6 +81,11 @@ func FcntlInt(fd uintptr, cmd, arg int) (int, error) { return linux.FcntlInt(fd, cmd, arg) } +// IoctlSetInt is a wrapper +func IoctlSetInt(fd int, req uint, value int) error { + return linux.IoctlSetInt(fd, req, value) +} + // Statfs is a wrapper func Statfs(path string, buf *Statfs_t) (err error) { return linux.Statfs(path, buf) @@ -151,6 +173,21 @@ func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { return linux.Tgkill(tgid, tid, sig) } +// BytePtrFromString is a wrapper +func BytePtrFromString(s string) (*byte, error) { + return linux.BytePtrFromString(s) +} + +// ByteSliceToString is a wrapper +func ByteSliceToString(s []byte) string { + return linux.ByteSliceToString(s) +} + +// Renameat2 is a wrapper +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) error { + return linux.Renameat2(olddirfd, oldpath, newdirfd, newpath, flags) +} + func KernelRelease() (string, error) { var uname Utsname err := Uname(&uname) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_other.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_other.go index 416b8d2f5dea..714589ba1e14 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_other.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/unix/types_other.go @@ -11,18 +11,26 @@ import ( var errNonLinux = fmt.Errorf("unsupported platform %s/%s", runtime.GOOS, runtime.GOARCH) const ( - ENOENT = syscall.ENOENT - EEXIST = syscall.EEXIST - EAGAIN = syscall.EAGAIN - ENOSPC = syscall.ENOSPC - EINVAL = syscall.EINVAL - EINTR = syscall.EINTR - EPERM = syscall.EPERM - ESRCH = syscall.ESRCH - ENODEV = syscall.ENODEV + ENOENT = syscall.ENOENT + EEXIST = syscall.EEXIST + EAGAIN = syscall.EAGAIN + ENOSPC = syscall.ENOSPC + EINVAL = syscall.EINVAL + EINTR = syscall.EINTR + EPERM = syscall.EPERM + ESRCH = syscall.ESRCH + ENODEV = syscall.ENODEV + EBADF = syscall.Errno(0) + // ENOTSUPP is not the same as ENOTSUP or EOPNOTSUP + ENOTSUPP = syscall.Errno(0x20c) + + BPF_F_NO_PREALLOC = 0 BPF_F_NUMA_NODE = 0 + BPF_F_RDONLY = 0 + BPF_F_WRONLY = 0 BPF_F_RDONLY_PROG = 0 BPF_F_WRONLY_PROG = 0 + BPF_F_SLEEPABLE = 0 BPF_OBJ_NAME_LEN = 0x10 BPF_TAG_SIZE = 0x8 SYS_BPF = 321 @@ -36,12 +44,21 @@ const ( PROT_WRITE = 0x2 MAP_SHARED = 0x1 PERF_TYPE_SOFTWARE = 0x1 + PERF_TYPE_TRACEPOINT = 0 PERF_COUNT_SW_BPF_OUTPUT = 0xa + PERF_EVENT_IOC_DISABLE = 0 + PERF_EVENT_IOC_ENABLE = 0 + PERF_EVENT_IOC_SET_BPF = 0 PerfBitWatermark = 0x4000 PERF_SAMPLE_RAW = 0x400 PERF_FLAG_FD_CLOEXEC = 0x8 RLIM_INFINITY = 0x7fffffffffffffff RLIMIT_MEMLOCK = 8 + BPF_STATS_RUN_TIME = 0 + PERF_RECORD_LOST = 2 + PERF_RECORD_SAMPLE = 9 + AT_FDCWD = -0x2 + RENAME_NOREPLACE = 0x1 ) // Statfs_t is a wrapper @@ -81,6 +98,11 @@ func FcntlInt(fd uintptr, cmd, arg int) (int, error) { return -1, errNonLinux } +// IoctlSetInt is a wrapper +func IoctlSetInt(fd int, req uint, value int) error { + return errNonLinux +} + // Statfs is a wrapper func Statfs(path string, buf *Statfs_t) error { return errNonLinux @@ -195,6 +217,7 @@ func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int // Utsname is a wrapper type Utsname struct { Release [65]byte + Version [65]byte } // Uname is a wrapper @@ -217,6 +240,21 @@ func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { return errNonLinux } +// BytePtrFromString is a wrapper +func BytePtrFromString(s string) (*byte, error) { + return nil, errNonLinux +} + +// ByteSliceToString is a wrapper +func ByteSliceToString(s []byte) string { + return "" +} + +// Renameat2 is a wrapper +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) error { + return errNonLinux +} + func KernelRelease() (string, error) { return "", errNonLinux } diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/version.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/version.go new file mode 100644 index 000000000000..1a678bfe6574 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/version.go @@ -0,0 +1,163 @@ +package internal + +import ( + "fmt" + "io/ioutil" + "regexp" + "sync" + + "github.com/cilium/ebpf/internal/unix" +) + +const ( + // Version constant used in ELF binaries indicating that the loader needs to + // substitute the eBPF program's version with the value of the kernel's + // KERNEL_VERSION compile-time macro. Used for compatibility with BCC, gobpf + // and RedSift. + MagicKernelVersion = 0xFFFFFFFE +) + +var ( + // Match between one and three decimals separated by dots, with the last + // segment (patch level) being optional on some kernels. + // The x.y.z string must appear at the start of a string or right after + // whitespace to prevent sequences like 'x.y.z-a.b.c' from matching 'a.b.c'. + rgxKernelVersion = regexp.MustCompile(`(?:\A|\s)\d{1,3}\.\d{1,3}(?:\.\d{1,3})?`) + + kernelVersion = struct { + once sync.Once + version Version + err error + }{} +) + +// A Version in the form Major.Minor.Patch. +type Version [3]uint16 + +// NewVersion creates a version from a string like "Major.Minor.Patch". +// +// Patch is optional. +func NewVersion(ver string) (Version, error) { + var major, minor, patch uint16 + n, _ := fmt.Sscanf(ver, "%d.%d.%d", &major, &minor, &patch) + if n < 2 { + return Version{}, fmt.Errorf("invalid version: %s", ver) + } + return Version{major, minor, patch}, nil +} + +func (v Version) String() string { + if v[2] == 0 { + return fmt.Sprintf("v%d.%d", v[0], v[1]) + } + return fmt.Sprintf("v%d.%d.%d", v[0], v[1], v[2]) +} + +// Less returns true if the version is less than another version. +func (v Version) Less(other Version) bool { + for i, a := range v { + if a == other[i] { + continue + } + return a < other[i] + } + return false +} + +// Unspecified returns true if the version is all zero. +func (v Version) Unspecified() bool { + return v[0] == 0 && v[1] == 0 && v[2] == 0 +} + +// Kernel implements the kernel's KERNEL_VERSION macro from linux/version.h. +// It represents the kernel version and patch level as a single value. +func (v Version) Kernel() uint32 { + + // Kernels 4.4 and 4.9 have their SUBLEVEL clamped to 255 to avoid + // overflowing into PATCHLEVEL. + // See kernel commit 9b82f13e7ef3 ("kbuild: clamp SUBLEVEL to 255"). + s := v[2] + if s > 255 { + s = 255 + } + + // Truncate members to uint8 to prevent them from spilling over into + // each other when overflowing 8 bits. + return uint32(uint8(v[0]))<<16 | uint32(uint8(v[1]))<<8 | uint32(uint8(s)) +} + +// KernelVersion returns the version of the currently running kernel. +func KernelVersion() (Version, error) { + kernelVersion.once.Do(func() { + kernelVersion.version, kernelVersion.err = detectKernelVersion() + }) + + if kernelVersion.err != nil { + return Version{}, kernelVersion.err + } + return kernelVersion.version, nil +} + +// detectKernelVersion returns the version of the running kernel. It scans the +// following sources in order: /proc/version_signature, uname -v, uname -r. +// In each of those locations, the last-appearing x.y(.z) value is selected +// for parsing. The first location that yields a usable version number is +// returned. +func detectKernelVersion() (Version, error) { + + // Try reading /proc/version_signature for Ubuntu compatibility. + // Example format: Ubuntu 4.15.0-91.92-generic 4.15.18 + // This method exists in the kernel itself, see d18acd15c + // ("perf tools: Fix kernel version error in ubuntu"). + if pvs, err := ioutil.ReadFile("/proc/version_signature"); err == nil { + // If /proc/version_signature exists, failing to parse it is an error. + // It only exists on Ubuntu, where the real patch level is not obtainable + // through any other method. + v, err := findKernelVersion(string(pvs)) + if err != nil { + return Version{}, err + } + return v, nil + } + + var uname unix.Utsname + if err := unix.Uname(&uname); err != nil { + return Version{}, fmt.Errorf("calling uname: %w", err) + } + + // Debian puts the version including the patch level in uname.Version. + // It is not an error if there's no version number in uname.Version, + // as most distributions don't use it. Parsing can continue on uname.Release. + // Example format: #1 SMP Debian 4.19.37-5+deb10u2 (2019-08-08) + if v, err := findKernelVersion(unix.ByteSliceToString(uname.Version[:])); err == nil { + return v, nil + } + + // Most other distributions have the full kernel version including patch + // level in uname.Release. + // Example format: 4.19.0-5-amd64, 5.5.10-arch1-1 + v, err := findKernelVersion(unix.ByteSliceToString(uname.Release[:])) + if err != nil { + return Version{}, err + } + + return v, nil +} + +// findKernelVersion matches s against rgxKernelVersion and parses the result +// into a Version. If s contains multiple matches, the last entry is selected. +func findKernelVersion(s string) (Version, error) { + m := rgxKernelVersion.FindAllString(s, -1) + if m == nil { + return Version{}, fmt.Errorf("no kernel version in string: %s", s) + } + // Pick the last match of the string in case there are multiple. + s = m[len(m)-1] + + v, err := NewVersion(s) + if err != nil { + return Version{}, fmt.Errorf("parsing version string %s: %w", s, err) + } + + return v, nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/cgroup.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/cgroup.go new file mode 100644 index 000000000000..5540bb068cd2 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/cgroup.go @@ -0,0 +1,171 @@ +package link + +import ( + "errors" + "fmt" + "os" + + "github.com/cilium/ebpf" +) + +type cgroupAttachFlags uint32 + +// cgroup attach flags +const ( + flagAllowOverride cgroupAttachFlags = 1 << iota + flagAllowMulti + flagReplace +) + +type CgroupOptions struct { + // Path to a cgroupv2 folder. + Path string + // One of the AttachCgroup* constants + Attach ebpf.AttachType + // Program must be of type CGroup*, and the attach type must match Attach. + Program *ebpf.Program +} + +// AttachCgroup links a BPF program to a cgroup. +func AttachCgroup(opts CgroupOptions) (Link, error) { + cgroup, err := os.Open(opts.Path) + if err != nil { + return nil, fmt.Errorf("can't open cgroup: %s", err) + } + + clone, err := opts.Program.Clone() + if err != nil { + cgroup.Close() + return nil, err + } + + var cg Link + cg, err = newLinkCgroup(cgroup, opts.Attach, clone) + if errors.Is(err, ErrNotSupported) { + cg, err = newProgAttachCgroup(cgroup, opts.Attach, clone, flagAllowMulti) + } + if errors.Is(err, ErrNotSupported) { + cg, err = newProgAttachCgroup(cgroup, opts.Attach, clone, flagAllowOverride) + } + if err != nil { + cgroup.Close() + clone.Close() + return nil, err + } + + return cg, nil +} + +// LoadPinnedCgroup loads a pinned cgroup from a bpffs. +func LoadPinnedCgroup(fileName string, opts *ebpf.LoadPinOptions) (Link, error) { + link, err := LoadPinnedRawLink(fileName, CgroupType, opts) + if err != nil { + return nil, err + } + + return &linkCgroup{*link}, nil +} + +type progAttachCgroup struct { + cgroup *os.File + current *ebpf.Program + attachType ebpf.AttachType + flags cgroupAttachFlags +} + +var _ Link = (*progAttachCgroup)(nil) + +func (cg *progAttachCgroup) isLink() {} + +func newProgAttachCgroup(cgroup *os.File, attach ebpf.AttachType, prog *ebpf.Program, flags cgroupAttachFlags) (*progAttachCgroup, error) { + if flags&flagAllowMulti > 0 { + if err := haveProgAttachReplace(); err != nil { + return nil, fmt.Errorf("can't support multiple programs: %w", err) + } + } + + err := RawAttachProgram(RawAttachProgramOptions{ + Target: int(cgroup.Fd()), + Program: prog, + Flags: uint32(flags), + Attach: attach, + }) + if err != nil { + return nil, fmt.Errorf("cgroup: %w", err) + } + + return &progAttachCgroup{cgroup, prog, attach, flags}, nil +} + +func (cg *progAttachCgroup) Close() error { + defer cg.cgroup.Close() + defer cg.current.Close() + + err := RawDetachProgram(RawDetachProgramOptions{ + Target: int(cg.cgroup.Fd()), + Program: cg.current, + Attach: cg.attachType, + }) + if err != nil { + return fmt.Errorf("close cgroup: %s", err) + } + return nil +} + +func (cg *progAttachCgroup) Update(prog *ebpf.Program) error { + new, err := prog.Clone() + if err != nil { + return err + } + + args := RawAttachProgramOptions{ + Target: int(cg.cgroup.Fd()), + Program: prog, + Attach: cg.attachType, + Flags: uint32(cg.flags), + } + + if cg.flags&flagAllowMulti > 0 { + // Atomically replacing multiple programs requires at least + // 5.5 (commit 7dd68b3279f17921 "bpf: Support replacing cgroup-bpf + // program in MULTI mode") + args.Flags |= uint32(flagReplace) + args.Replace = cg.current + } + + if err := RawAttachProgram(args); err != nil { + new.Close() + return fmt.Errorf("can't update cgroup: %s", err) + } + + cg.current.Close() + cg.current = new + return nil +} + +func (cg *progAttachCgroup) Pin(string) error { + return fmt.Errorf("can't pin cgroup: %w", ErrNotSupported) +} + +func (cg *progAttachCgroup) Unpin() error { + return fmt.Errorf("can't pin cgroup: %w", ErrNotSupported) +} + +type linkCgroup struct { + RawLink +} + +var _ Link = (*linkCgroup)(nil) + +func newLinkCgroup(cgroup *os.File, attach ebpf.AttachType, prog *ebpf.Program) (*linkCgroup, error) { + link, err := AttachRawLink(RawLinkOptions{ + Target: int(cgroup.Fd()), + Program: prog, + Attach: attach, + }) + if err != nil { + return nil, err + } + + return &linkCgroup{*link}, err +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/doc.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/doc.go new file mode 100644 index 000000000000..2bde35ed7a26 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/doc.go @@ -0,0 +1,2 @@ +// Package link allows attaching eBPF programs to various kernel hooks. +package link diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/iter.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/iter.go new file mode 100644 index 000000000000..04d24ef35a99 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/iter.go @@ -0,0 +1,67 @@ +package link + +import ( + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type IterOptions struct { + // Program must be of type Tracing with attach type + // AttachTraceIter. The kind of iterator to attach to is + // determined at load time via the AttachTo field. + // + // AttachTo requires the kernel to include BTF of itself, + // and it to be compiled with a recent pahole (>= 1.16). + Program *ebpf.Program +} + +// AttachIter attaches a BPF seq_file iterator. +func AttachIter(opts IterOptions) (*Iter, error) { + link, err := AttachRawLink(RawLinkOptions{ + Program: opts.Program, + Attach: ebpf.AttachTraceIter, + }) + if err != nil { + return nil, fmt.Errorf("can't link iterator: %w", err) + } + + return &Iter{*link}, err +} + +// LoadPinnedIter loads a pinned iterator from a bpffs. +func LoadPinnedIter(fileName string, opts *ebpf.LoadPinOptions) (*Iter, error) { + link, err := LoadPinnedRawLink(fileName, IterType, opts) + if err != nil { + return nil, err + } + + return &Iter{*link}, err +} + +// Iter represents an attached bpf_iter. +type Iter struct { + RawLink +} + +// Open creates a new instance of the iterator. +// +// Reading from the returned reader triggers the BPF program. +func (it *Iter) Open() (io.ReadCloser, error) { + linkFd, err := it.fd.Value() + if err != nil { + return nil, err + } + + attr := &bpfIterCreateAttr{ + linkFd: linkFd, + } + + fd, err := bpfIterCreate(attr) + if err != nil { + return nil, fmt.Errorf("can't create iterator: %w", err) + } + + return fd.File("bpf_iter"), nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/kprobe.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/kprobe.go new file mode 100644 index 000000000000..ad3a5949a94c --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/kprobe.go @@ -0,0 +1,296 @@ +package link + +import ( + "crypto/rand" + "errors" + "fmt" + "os" + "path/filepath" + "runtime" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/internal" + "github.com/cilium/ebpf/internal/unix" +) + +var ( + kprobeEventsPath = filepath.Join(tracefsPath, "kprobe_events") +) + +// Kprobe attaches the given eBPF program to a perf event that fires when the +// given kernel symbol starts executing. See /proc/kallsyms for available +// symbols. For example, printk(): +// +// Kprobe("printk") +// +// The resulting Link must be Closed during program shutdown to avoid leaking +// system resources. +func Kprobe(symbol string, prog *ebpf.Program) (Link, error) { + k, err := kprobe(symbol, prog, false) + if err != nil { + return nil, err + } + + err = k.attach(prog) + if err != nil { + k.Close() + return nil, err + } + + return k, nil +} + +// Kretprobe attaches the given eBPF program to a perf event that fires right +// before the given kernel symbol exits, with the function stack left intact. +// See /proc/kallsyms for available symbols. For example, printk(): +// +// Kretprobe("printk") +// +// The resulting Link must be Closed during program shutdown to avoid leaking +// system resources. +func Kretprobe(symbol string, prog *ebpf.Program) (Link, error) { + k, err := kprobe(symbol, prog, true) + if err != nil { + return nil, err + } + + err = k.attach(prog) + if err != nil { + k.Close() + return nil, err + } + + return k, nil +} + +// kprobe opens a perf event on the given symbol and attaches prog to it. +// If ret is true, create a kretprobe. +func kprobe(symbol string, prog *ebpf.Program, ret bool) (*perfEvent, error) { + if symbol == "" { + return nil, fmt.Errorf("symbol name cannot be empty: %w", errInvalidInput) + } + if prog == nil { + return nil, fmt.Errorf("prog cannot be nil: %w", errInvalidInput) + } + if !rgxTraceEvent.MatchString(symbol) { + return nil, fmt.Errorf("symbol '%s' must be alphanumeric or underscore: %w", symbol, errInvalidInput) + } + if prog.Type() != ebpf.Kprobe { + return nil, fmt.Errorf("eBPF program type %s is not a Kprobe: %w", prog.Type(), errInvalidInput) + } + + // Use kprobe PMU if the kernel has it available. + tp, err := pmuKprobe(symbol, ret) + if err == nil { + return tp, nil + } + if err != nil && !errors.Is(err, ErrNotSupported) { + return nil, fmt.Errorf("creating perf_kprobe PMU: %w", err) + } + + // Use tracefs if kprobe PMU is missing. + tp, err = tracefsKprobe(symbol, ret) + if err != nil { + return nil, fmt.Errorf("creating trace event '%s' in tracefs: %w", symbol, err) + } + + return tp, nil +} + +// pmuKprobe opens a perf event based on a Performance Monitoring Unit. +// Requires at least 4.17 (e12f03d7031a "perf/core: Implement the +// 'perf_kprobe' PMU"). +// Returns ErrNotSupported if the kernel doesn't support perf_kprobe PMU, +// or os.ErrNotExist if the given symbol does not exist in the kernel. +func pmuKprobe(symbol string, ret bool) (*perfEvent, error) { + + // Getting the PMU type will fail if the kernel doesn't support + // the perf_kprobe PMU. + et, err := getPMUEventType("kprobe") + if err != nil { + return nil, err + } + + // Create a pointer to a NUL-terminated string for the kernel. + sp, err := unsafeStringPtr(symbol) + if err != nil { + return nil, err + } + + // TODO: Parse the position of the bit from /sys/bus/event_source/devices/%s/format/retprobe. + config := 0 + if ret { + config = 1 + } + + attr := unix.PerfEventAttr{ + Type: uint32(et), // PMU event type read from sysfs + Ext1: uint64(uintptr(sp)), // Kernel symbol to trace + Config: uint64(config), // perf_kprobe PMU treats config as flags + } + + fd, err := unix.PerfEventOpen(&attr, perfAllThreads, 0, -1, unix.PERF_FLAG_FD_CLOEXEC) + + // Since commit 97c753e62e6c, ENOENT is correctly returned instead of EINVAL + // when trying to create a kretprobe for a missing symbol. Make sure ENOENT + // is returned to the caller. + if errors.Is(err, os.ErrNotExist) || errors.Is(err, unix.EINVAL) { + return nil, fmt.Errorf("symbol '%s' not found: %w", symbol, os.ErrNotExist) + } + if err != nil { + return nil, fmt.Errorf("opening perf event: %w", err) + } + + // Ensure the string pointer is not collected before PerfEventOpen returns. + runtime.KeepAlive(sp) + + // Kernel has perf_kprobe PMU available, initialize perf event. + return &perfEvent{ + fd: internal.NewFD(uint32(fd)), + pmuID: et, + name: symbol, + ret: ret, + progType: ebpf.Kprobe, + }, nil +} + +// tracefsKprobe creates a trace event by writing an entry to /kprobe_events. +// A new trace event group name is generated on every call to support creating +// multiple trace events for the same kernel symbol. A perf event is then opened +// on the newly-created trace event and returned to the caller. +func tracefsKprobe(symbol string, ret bool) (*perfEvent, error) { + + // Generate a random string for each trace event we attempt to create. + // This value is used as the 'group' token in tracefs to allow creating + // multiple kprobe trace events with the same name. + group, err := randomGroup("ebpf") + if err != nil { + return nil, fmt.Errorf("randomizing group name: %w", err) + } + + // Before attempting to create a trace event through tracefs, + // check if an event with the same group and name already exists. + // Kernels 4.x and earlier don't return os.ErrExist on writing a duplicate + // entry, so we need to rely on reads for detecting uniqueness. + _, err = getTraceEventID(group, symbol) + if err == nil { + return nil, fmt.Errorf("trace event already exists: %s/%s", group, symbol) + } + // The read is expected to fail with ErrNotSupported due to a non-existing event. + if err != nil && !errors.Is(err, ErrNotSupported) { + return nil, fmt.Errorf("checking trace event %s/%s: %w", group, symbol, err) + } + + // Create the kprobe trace event using tracefs. + if err := createTraceFSKprobeEvent(group, symbol, ret); err != nil { + return nil, fmt.Errorf("creating kprobe event on tracefs: %w", err) + } + + // Get the newly-created trace event's id. + tid, err := getTraceEventID(group, symbol) + if err != nil { + return nil, fmt.Errorf("getting trace event id: %w", err) + } + + // Kprobes are ephemeral tracepoints and share the same perf event type. + fd, err := openTracepointPerfEvent(tid) + if err != nil { + return nil, err + } + + return &perfEvent{ + fd: fd, + group: group, + name: symbol, + ret: ret, + tracefsID: tid, + progType: ebpf.Kprobe, // kernel only allows attaching kprobe programs to kprobe events + }, nil +} + +// createTraceFSKprobeEvent creates a new ephemeral trace event by writing to +// /kprobe_events. Returns ErrNotSupported if symbol is not a valid +// kernel symbol, or if it is not traceable with kprobes. +func createTraceFSKprobeEvent(group, symbol string, ret bool) error { + // Open the kprobe_events file in tracefs. + f, err := os.OpenFile(kprobeEventsPath, os.O_APPEND|os.O_WRONLY, 0666) + if err != nil { + return fmt.Errorf("error opening kprobe_events: %w", err) + } + defer f.Close() + + // The kprobe_events syntax is as follows (see Documentation/trace/kprobetrace.txt): + // p[:[GRP/]EVENT] [MOD:]SYM[+offs]|MEMADDR [FETCHARGS] : Set a probe + // r[MAXACTIVE][:[GRP/]EVENT] [MOD:]SYM[+0] [FETCHARGS] : Set a return probe + // -:[GRP/]EVENT : Clear a probe + // + // Some examples: + // r:ebpf_1234/r_my_kretprobe nf_conntrack_destroy + // p:ebpf_5678/p_my_kprobe __x64_sys_execve + // + // Leaving the kretprobe's MAXACTIVE set to 0 (or absent) will make the + // kernel default to NR_CPUS. This is desired in most eBPF cases since + // subsampling or rate limiting logic can be more accurately implemented in + // the eBPF program itself. See Documentation/kprobes.txt for more details. + pe := fmt.Sprintf("%s:%s/%s %s", kprobePrefix(ret), group, symbol, symbol) + _, err = f.WriteString(pe) + // Since commit 97c753e62e6c, ENOENT is correctly returned instead of EINVAL + // when trying to create a kretprobe for a missing symbol. Make sure ENOENT + // is returned to the caller. + if errors.Is(err, os.ErrNotExist) || errors.Is(err, unix.EINVAL) { + return fmt.Errorf("kernel symbol %s not found: %w", symbol, os.ErrNotExist) + } + if err != nil { + return fmt.Errorf("writing '%s' to kprobe_events: %w", pe, err) + } + + return nil +} + +// closeTraceFSKprobeEvent removes the kprobe with the given group, symbol and kind +// from /kprobe_events. +func closeTraceFSKprobeEvent(group, symbol string) error { + f, err := os.OpenFile(kprobeEventsPath, os.O_APPEND|os.O_WRONLY, 0666) + if err != nil { + return fmt.Errorf("error opening kprobe_events: %w", err) + } + defer f.Close() + + // See kprobe_events syntax above. Kprobe type does not need to be specified + // for removals. + pe := fmt.Sprintf("-:%s/%s", group, symbol) + if _, err = f.WriteString(pe); err != nil { + return fmt.Errorf("writing '%s' to kprobe_events: %w", pe, err) + } + + return nil +} + +// randomGroup generates a pseudorandom string for use as a tracefs group name. +// Returns an error when the output string would exceed 63 characters (kernel +// limitation), when rand.Read() fails or when prefix contains characters not +// allowed by rgxTraceEvent. +func randomGroup(prefix string) (string, error) { + if !rgxTraceEvent.MatchString(prefix) { + return "", fmt.Errorf("prefix '%s' must be alphanumeric or underscore: %w", prefix, errInvalidInput) + } + + b := make([]byte, 8) + if _, err := rand.Read(b); err != nil { + return "", fmt.Errorf("reading random bytes: %w", err) + } + + group := fmt.Sprintf("%s_%x", prefix, b) + if len(group) > 63 { + return "", fmt.Errorf("group name '%s' cannot be longer than 63 characters: %w", group, errInvalidInput) + } + + return group, nil +} + +func kprobePrefix(ret bool) string { + if ret { + return "r" + } + return "p" +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/link.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/link.go new file mode 100644 index 000000000000..16cfff415dd4 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/link.go @@ -0,0 +1,229 @@ +package link + +import ( + "fmt" + "unsafe" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/internal" +) + +var ErrNotSupported = internal.ErrNotSupported + +// Link represents a Program attached to a BPF hook. +type Link interface { + // Replace the current program with a new program. + // + // Passing a nil program is an error. May return an error wrapping ErrNotSupported. + Update(*ebpf.Program) error + + // Persist a link by pinning it into a bpffs. + // + // May return an error wrapping ErrNotSupported. + Pin(string) error + + // Undo a previous call to Pin. + // + // May return an error wrapping ErrNotSupported. + Unpin() error + + // Close frees resources. + // + // The link will be broken unless it has been pinned. A link + // may continue past the lifetime of the process if Close is + // not called. + Close() error + + // Prevent external users from implementing this interface. + isLink() +} + +// ID uniquely identifies a BPF link. +type ID uint32 + +// RawLinkOptions control the creation of a raw link. +type RawLinkOptions struct { + // File descriptor to attach to. This differs for each attach type. + Target int + // Program to attach. + Program *ebpf.Program + // Attach must match the attach type of Program. + Attach ebpf.AttachType +} + +// RawLinkInfo contains metadata on a link. +type RawLinkInfo struct { + Type Type + ID ID + Program ebpf.ProgramID +} + +// RawLink is the low-level API to bpf_link. +// +// You should consider using the higher level interfaces in this +// package instead. +type RawLink struct { + fd *internal.FD + pinnedPath string +} + +// AttachRawLink creates a raw link. +func AttachRawLink(opts RawLinkOptions) (*RawLink, error) { + if err := haveBPFLink(); err != nil { + return nil, err + } + + if opts.Target < 0 { + return nil, fmt.Errorf("invalid target: %s", internal.ErrClosedFd) + } + + progFd := opts.Program.FD() + if progFd < 0 { + return nil, fmt.Errorf("invalid program: %s", internal.ErrClosedFd) + } + + attr := bpfLinkCreateAttr{ + targetFd: uint32(opts.Target), + progFd: uint32(progFd), + attachType: opts.Attach, + } + fd, err := bpfLinkCreate(&attr) + if err != nil { + return nil, fmt.Errorf("can't create link: %s", err) + } + + return &RawLink{fd, ""}, nil +} + +// LoadPinnedRawLink loads a persisted link from a bpffs. +// +// Returns an error if the pinned link type doesn't match linkType. Pass +// UnspecifiedType to disable this behaviour. +func LoadPinnedRawLink(fileName string, linkType Type, opts *ebpf.LoadPinOptions) (*RawLink, error) { + fd, err := internal.BPFObjGet(fileName, opts.Marshal()) + if err != nil { + return nil, fmt.Errorf("load pinned link: %w", err) + } + + link := &RawLink{fd, fileName} + if linkType == UnspecifiedType { + return link, nil + } + + info, err := link.Info() + if err != nil { + link.Close() + return nil, fmt.Errorf("get pinned link info: %s", err) + } + + if info.Type != linkType { + link.Close() + return nil, fmt.Errorf("link type %v doesn't match %v", info.Type, linkType) + } + + return link, nil +} + +func (l *RawLink) isLink() {} + +// FD returns the raw file descriptor. +func (l *RawLink) FD() int { + fd, err := l.fd.Value() + if err != nil { + return -1 + } + return int(fd) +} + +// Close breaks the link. +// +// Use Pin if you want to make the link persistent. +func (l *RawLink) Close() error { + return l.fd.Close() +} + +// Pin persists a link past the lifetime of the process. +// +// Calling Close on a pinned Link will not break the link +// until the pin is removed. +func (l *RawLink) Pin(fileName string) error { + if err := internal.Pin(l.pinnedPath, fileName, l.fd); err != nil { + return err + } + l.pinnedPath = fileName + return nil +} + +// Unpin implements the Link interface. +func (l *RawLink) Unpin() error { + if err := internal.Unpin(l.pinnedPath); err != nil { + return err + } + l.pinnedPath = "" + return nil +} + +// Update implements the Link interface. +func (l *RawLink) Update(new *ebpf.Program) error { + return l.UpdateArgs(RawLinkUpdateOptions{ + New: new, + }) +} + +// RawLinkUpdateOptions control the behaviour of RawLink.UpdateArgs. +type RawLinkUpdateOptions struct { + New *ebpf.Program + Old *ebpf.Program + Flags uint32 +} + +// UpdateArgs updates a link based on args. +func (l *RawLink) UpdateArgs(opts RawLinkUpdateOptions) error { + newFd := opts.New.FD() + if newFd < 0 { + return fmt.Errorf("invalid program: %s", internal.ErrClosedFd) + } + + var oldFd int + if opts.Old != nil { + oldFd = opts.Old.FD() + if oldFd < 0 { + return fmt.Errorf("invalid replacement program: %s", internal.ErrClosedFd) + } + } + + linkFd, err := l.fd.Value() + if err != nil { + return fmt.Errorf("can't update link: %s", err) + } + + attr := bpfLinkUpdateAttr{ + linkFd: linkFd, + newProgFd: uint32(newFd), + oldProgFd: uint32(oldFd), + flags: opts.Flags, + } + return bpfLinkUpdate(&attr) +} + +// struct bpf_link_info +type bpfLinkInfo struct { + typ uint32 + id uint32 + prog_id uint32 +} + +// Info returns metadata about the link. +func (l *RawLink) Info() (*RawLinkInfo, error) { + var info bpfLinkInfo + err := internal.BPFObjGetInfoByFD(l.fd, unsafe.Pointer(&info), unsafe.Sizeof(info)) + if err != nil { + return nil, fmt.Errorf("link info: %s", err) + } + + return &RawLinkInfo{ + Type(info.typ), + ID(info.id), + ebpf.ProgramID(info.prog_id), + }, nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/netns.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/netns.go new file mode 100644 index 000000000000..37e5b84c4ddf --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/netns.go @@ -0,0 +1,60 @@ +package link + +import ( + "fmt" + + "github.com/cilium/ebpf" +) + +// NetNsInfo contains metadata about a network namespace link. +type NetNsInfo struct { + RawLinkInfo +} + +// NetNsLink is a program attached to a network namespace. +type NetNsLink struct { + *RawLink +} + +// AttachNetNs attaches a program to a network namespace. +func AttachNetNs(ns int, prog *ebpf.Program) (*NetNsLink, error) { + var attach ebpf.AttachType + switch t := prog.Type(); t { + case ebpf.FlowDissector: + attach = ebpf.AttachFlowDissector + case ebpf.SkLookup: + attach = ebpf.AttachSkLookup + default: + return nil, fmt.Errorf("can't attach %v to network namespace", t) + } + + link, err := AttachRawLink(RawLinkOptions{ + Target: ns, + Program: prog, + Attach: attach, + }) + if err != nil { + return nil, err + } + + return &NetNsLink{link}, nil +} + +// LoadPinnedNetNs loads a network namespace link from bpffs. +func LoadPinnedNetNs(fileName string, opts *ebpf.LoadPinOptions) (*NetNsLink, error) { + link, err := LoadPinnedRawLink(fileName, NetNsType, opts) + if err != nil { + return nil, err + } + + return &NetNsLink{link}, nil +} + +// Info returns information about the link. +func (nns *NetNsLink) Info() (*NetNsInfo, error) { + info, err := nns.RawLink.Info() + if err != nil { + return nil, err + } + return &NetNsInfo{*info}, nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/perf_event.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/perf_event.go new file mode 100644 index 000000000000..de973c7412e2 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/perf_event.go @@ -0,0 +1,253 @@ +package link + +import ( + "bytes" + "errors" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "regexp" + "runtime" + "strconv" + "strings" + "unsafe" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/internal" + "github.com/cilium/ebpf/internal/unix" +) + +// Getting the terminology right is usually the hardest part. For posterity and +// for staying sane during implementation: +// +// - trace event: Representation of a kernel runtime hook. Filesystem entries +// under /events. Can be tracepoints (static), kprobes or uprobes. +// Can be instantiated into perf events (see below). +// - tracepoint: A predetermined hook point in the kernel. Exposed as trace +// events in (sub)directories under /events. Cannot be closed or +// removed, they are static. +// - k(ret)probe: Ephemeral trace events based on entry or exit points of +// exported kernel symbols. kprobe-based (tracefs) trace events can be +// created system-wide by writing to the /kprobe_events file, or +// they can be scoped to the current process by creating PMU perf events. +// - perf event: An object instantiated based on an existing trace event or +// kernel symbol. Referred to by fd in userspace. +// Exactly one eBPF program can be attached to a perf event. Multiple perf +// events can be created from a single trace event. Closing a perf event +// stops any further invocations of the attached eBPF program. + +var ( + tracefsPath = "/sys/kernel/debug/tracing" + + // Trace event groups, names and kernel symbols must adhere to this set + // of characters. Non-empty, first character must not be a number, all + // characters must be alphanumeric or underscore. + rgxTraceEvent = regexp.MustCompile("^[a-zA-Z_][0-9a-zA-Z_]*$") + + errInvalidInput = errors.New("invalid input") +) + +const ( + perfAllThreads = -1 +) + +// A perfEvent represents a perf event kernel object. Exactly one eBPF program +// can be attached to it. It is created based on a tracefs trace event or a +// Performance Monitoring Unit (PMU). +type perfEvent struct { + + // Group and name of the tracepoint/kprobe/uprobe. + group string + name string + + // PMU event ID read from sysfs. Valid IDs are non-zero. + pmuID uint64 + // ID of the trace event read from tracefs. Valid IDs are non-zero. + tracefsID uint64 + + // True for kretprobes/uretprobes. + ret bool + + fd *internal.FD + progType ebpf.ProgramType +} + +func (pe *perfEvent) isLink() {} + +func (pe *perfEvent) Pin(string) error { + return fmt.Errorf("pin perf event: %w", ErrNotSupported) +} + +func (pe *perfEvent) Unpin() error { + return fmt.Errorf("unpin perf event: %w", ErrNotSupported) +} + +// Since 4.15 (e87c6bc3852b "bpf: permit multiple bpf attachments for a single perf event"), +// calling PERF_EVENT_IOC_SET_BPF appends the given program to a prog_array +// owned by the perf event, which means multiple programs can be attached +// simultaneously. +// +// Before 4.15, calling PERF_EVENT_IOC_SET_BPF more than once on a perf event +// returns EEXIST. +// +// Detaching a program from a perf event is currently not possible, so a +// program replacement mechanism cannot be implemented for perf events. +func (pe *perfEvent) Update(prog *ebpf.Program) error { + return fmt.Errorf("can't replace eBPF program in perf event: %w", ErrNotSupported) +} + +func (pe *perfEvent) Close() error { + if pe.fd == nil { + return nil + } + + pfd, err := pe.fd.Value() + if err != nil { + return fmt.Errorf("getting perf event fd: %w", err) + } + + err = unix.IoctlSetInt(int(pfd), unix.PERF_EVENT_IOC_DISABLE, 0) + if err != nil { + return fmt.Errorf("disabling perf event: %w", err) + } + + err = pe.fd.Close() + if err != nil { + return fmt.Errorf("closing perf event fd: %w", err) + } + + switch t := pe.progType; t { + case ebpf.Kprobe: + // For kprobes created using tracefs, clean up the /kprobe_events entry. + if pe.tracefsID != 0 { + return closeTraceFSKprobeEvent(pe.group, pe.name) + } + case ebpf.TracePoint: + // Tracepoint trace events don't hold any extra resources. + return nil + } + + return nil +} + +// attach the given eBPF prog to the perf event stored in pe. +// pe must contain a valid perf event fd. +// prog's type must match the program type stored in pe. +func (pe *perfEvent) attach(prog *ebpf.Program) error { + if prog == nil { + return errors.New("cannot attach a nil program") + } + if pe.fd == nil { + return errors.New("cannot attach to nil perf event") + } + if t := prog.Type(); t != pe.progType { + return fmt.Errorf("invalid program type (expected %s): %s", pe.progType, t) + } + if prog.FD() < 0 { + return fmt.Errorf("invalid program: %w", internal.ErrClosedFd) + } + + // The ioctl below will fail when the fd is invalid. + kfd, _ := pe.fd.Value() + + // Assign the eBPF program to the perf event. + err := unix.IoctlSetInt(int(kfd), unix.PERF_EVENT_IOC_SET_BPF, prog.FD()) + if err != nil { + return fmt.Errorf("setting perf event bpf program: %w", err) + } + + // PERF_EVENT_IOC_ENABLE and _DISABLE ignore their given values. + if err := unix.IoctlSetInt(int(kfd), unix.PERF_EVENT_IOC_ENABLE, 0); err != nil { + return fmt.Errorf("enable perf event: %s", err) + } + + // Close the perf event when its reference is lost to avoid leaking system resources. + runtime.SetFinalizer(pe, (*perfEvent).Close) + return nil +} + +// unsafeStringPtr returns an unsafe.Pointer to a NUL-terminated copy of str. +func unsafeStringPtr(str string) (unsafe.Pointer, error) { + p, err := unix.BytePtrFromString(str) + if err != nil { + return nil, err + } + return unsafe.Pointer(p), nil +} + +// getTraceEventID reads a trace event's ID from tracefs given its group and name. +// group and name must be alphanumeric or underscore, as required by the kernel. +func getTraceEventID(group, name string) (uint64, error) { + tid, err := uint64FromFile(tracefsPath, "events", group, name, "id") + if errors.Is(err, ErrNotSupported) { + return 0, fmt.Errorf("trace event %s/%s: %w", group, name, ErrNotSupported) + } + if err != nil { + return 0, fmt.Errorf("reading trace event ID of %s/%s: %w", group, name, err) + } + + return tid, nil +} + +// getPMUEventType reads a Performance Monitoring Unit's type (numeric identifier) +// from /sys/bus/event_source/devices//type. +func getPMUEventType(pmu string) (uint64, error) { + et, err := uint64FromFile("/sys/bus/event_source/devices", pmu, "type") + if errors.Is(err, ErrNotSupported) { + return 0, fmt.Errorf("pmu type %s: %w", pmu, ErrNotSupported) + } + if err != nil { + return 0, fmt.Errorf("reading pmu type %s: %w", pmu, err) + } + + return et, nil +} + +// openTracepointPerfEvent opens a tracepoint-type perf event. System-wide +// kprobes created by writing to /kprobe_events are tracepoints +// behind the scenes, and can be attached to using these perf events. +func openTracepointPerfEvent(tid uint64) (*internal.FD, error) { + attr := unix.PerfEventAttr{ + Type: unix.PERF_TYPE_TRACEPOINT, + Config: tid, + Sample_type: unix.PERF_SAMPLE_RAW, + Sample: 1, + Wakeup: 1, + } + + fd, err := unix.PerfEventOpen(&attr, perfAllThreads, 0, -1, unix.PERF_FLAG_FD_CLOEXEC) + if err != nil { + return nil, fmt.Errorf("opening tracepoint perf event: %w", err) + } + + return internal.NewFD(uint32(fd)), nil +} + +// uint64FromFile reads a uint64 from a file. All elements of path are sanitized +// and joined onto base. Returns error if base no longer prefixes the path after +// joining all components. +func uint64FromFile(base string, path ...string) (uint64, error) { + + // Resolve leaf path separately for error feedback. Makes the join onto + // base more readable (can't mix with variadic args). + l := filepath.Join(path...) + + p := filepath.Join(base, l) + if !strings.HasPrefix(p, base) { + return 0, fmt.Errorf("path '%s' attempts to escape base path '%s': %w", l, base, errInvalidInput) + } + + data, err := ioutil.ReadFile(p) + if os.IsNotExist(err) { + // Only echo leaf path, the base path can be prepended at the call site + // if more verbosity is required. + return 0, fmt.Errorf("symbol %s: %w", l, ErrNotSupported) + } + if err != nil { + return 0, fmt.Errorf("reading file %s: %w", p, err) + } + + et := bytes.TrimSpace(data) + return strconv.ParseUint(string(et), 10, 64) +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/program.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/program.go new file mode 100644 index 000000000000..0fe9d37c4f89 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/program.go @@ -0,0 +1,76 @@ +package link + +import ( + "fmt" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/internal" +) + +type RawAttachProgramOptions struct { + // File descriptor to attach to. This differs for each attach type. + Target int + // Program to attach. + Program *ebpf.Program + // Program to replace (cgroups). + Replace *ebpf.Program + // Attach must match the attach type of Program (and Replace). + Attach ebpf.AttachType + // Flags control the attach behaviour. This differs for each attach type. + Flags uint32 +} + +// RawAttachProgram is a low level wrapper around BPF_PROG_ATTACH. +// +// You should use one of the higher level abstractions available in this +// package if possible. +func RawAttachProgram(opts RawAttachProgramOptions) error { + if err := haveProgAttach(); err != nil { + return err + } + + var replaceFd uint32 + if opts.Replace != nil { + replaceFd = uint32(opts.Replace.FD()) + } + + attr := internal.BPFProgAttachAttr{ + TargetFd: uint32(opts.Target), + AttachBpfFd: uint32(opts.Program.FD()), + ReplaceBpfFd: replaceFd, + AttachType: uint32(opts.Attach), + AttachFlags: uint32(opts.Flags), + } + + if err := internal.BPFProgAttach(&attr); err != nil { + return fmt.Errorf("can't attach program: %s", err) + } + return nil +} + +type RawDetachProgramOptions struct { + Target int + Program *ebpf.Program + Attach ebpf.AttachType +} + +// RawDetachProgram is a low level wrapper around BPF_PROG_DETACH. +// +// You should use one of the higher level abstractions available in this +// package if possible. +func RawDetachProgram(opts RawDetachProgramOptions) error { + if err := haveProgAttach(); err != nil { + return err + } + + attr := internal.BPFProgDetachAttr{ + TargetFd: uint32(opts.Target), + AttachBpfFd: uint32(opts.Program.FD()), + AttachType: uint32(opts.Attach), + } + if err := internal.BPFProgDetach(&attr); err != nil { + return fmt.Errorf("can't detach program: %s", err) + } + + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/raw_tracepoint.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/raw_tracepoint.go new file mode 100644 index 000000000000..f4beb1e07863 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/raw_tracepoint.go @@ -0,0 +1,61 @@ +package link + +import ( + "fmt" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/internal" +) + +type RawTracepointOptions struct { + // Tracepoint name. + Name string + // Program must be of type RawTracepoint* + Program *ebpf.Program +} + +// AttachRawTracepoint links a BPF program to a raw_tracepoint. +// +// Requires at least Linux 4.17. +func AttachRawTracepoint(opts RawTracepointOptions) (Link, error) { + if t := opts.Program.Type(); t != ebpf.RawTracepoint && t != ebpf.RawTracepointWritable { + return nil, fmt.Errorf("invalid program type %s, expected RawTracepoint(Writable)", t) + } + if opts.Program.FD() < 0 { + return nil, fmt.Errorf("invalid program: %w", internal.ErrClosedFd) + } + + fd, err := bpfRawTracepointOpen(&bpfRawTracepointOpenAttr{ + name: internal.NewStringPointer(opts.Name), + fd: uint32(opts.Program.FD()), + }) + if err != nil { + return nil, err + } + + return &progAttachRawTracepoint{fd: fd}, nil +} + +type progAttachRawTracepoint struct { + fd *internal.FD +} + +var _ Link = (*progAttachRawTracepoint)(nil) + +func (rt *progAttachRawTracepoint) isLink() {} + +func (rt *progAttachRawTracepoint) Close() error { + return rt.fd.Close() +} + +func (rt *progAttachRawTracepoint) Update(_ *ebpf.Program) error { + return fmt.Errorf("can't update raw_tracepoint: %w", ErrNotSupported) +} + +func (rt *progAttachRawTracepoint) Pin(_ string) error { + return fmt.Errorf("can't pin raw_tracepoint: %w", ErrNotSupported) +} + +func (rt *progAttachRawTracepoint) Unpin() error { + return fmt.Errorf("unpin raw_tracepoint: %w", ErrNotSupported) +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/syscalls.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/syscalls.go new file mode 100644 index 000000000000..19326c8af800 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/syscalls.go @@ -0,0 +1,173 @@ +package link + +import ( + "errors" + "unsafe" + + "github.com/cilium/ebpf" + "github.com/cilium/ebpf/asm" + "github.com/cilium/ebpf/internal" + "github.com/cilium/ebpf/internal/unix" +) + +// Type is the kind of link. +type Type uint32 + +// Valid link types. +// +// Equivalent to enum bpf_link_type. +const ( + UnspecifiedType Type = iota + RawTracepointType + TracingType + CgroupType + IterType + NetNsType + XDPType +) + +var haveProgAttach = internal.FeatureTest("BPF_PROG_ATTACH", "4.10", func() error { + prog, err := ebpf.NewProgram(&ebpf.ProgramSpec{ + Type: ebpf.CGroupSKB, + AttachType: ebpf.AttachCGroupInetIngress, + License: "MIT", + Instructions: asm.Instructions{ + asm.Mov.Imm(asm.R0, 0), + asm.Return(), + }, + }) + if err != nil { + return internal.ErrNotSupported + } + + // BPF_PROG_ATTACH was introduced at the same time as CGgroupSKB, + // so being able to load the program is enough to infer that we + // have the syscall. + prog.Close() + return nil +}) + +var haveProgAttachReplace = internal.FeatureTest("BPF_PROG_ATTACH atomic replacement", "5.5", func() error { + if err := haveProgAttach(); err != nil { + return err + } + + prog, err := ebpf.NewProgram(&ebpf.ProgramSpec{ + Type: ebpf.CGroupSKB, + AttachType: ebpf.AttachCGroupInetIngress, + License: "MIT", + Instructions: asm.Instructions{ + asm.Mov.Imm(asm.R0, 0), + asm.Return(), + }, + }) + if err != nil { + return internal.ErrNotSupported + } + defer prog.Close() + + // We know that we have BPF_PROG_ATTACH since we can load CGroupSKB programs. + // If passing BPF_F_REPLACE gives us EINVAL we know that the feature isn't + // present. + attr := internal.BPFProgAttachAttr{ + // We rely on this being checked after attachFlags. + TargetFd: ^uint32(0), + AttachBpfFd: uint32(prog.FD()), + AttachType: uint32(ebpf.AttachCGroupInetIngress), + AttachFlags: uint32(flagReplace), + } + + err = internal.BPFProgAttach(&attr) + if errors.Is(err, unix.EINVAL) { + return internal.ErrNotSupported + } + if errors.Is(err, unix.EBADF) { + return nil + } + return err +}) + +type bpfLinkCreateAttr struct { + progFd uint32 + targetFd uint32 + attachType ebpf.AttachType + flags uint32 +} + +func bpfLinkCreate(attr *bpfLinkCreateAttr) (*internal.FD, error) { + ptr, err := internal.BPF(internal.BPF_LINK_CREATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) + if err != nil { + return nil, err + } + return internal.NewFD(uint32(ptr)), nil +} + +type bpfLinkUpdateAttr struct { + linkFd uint32 + newProgFd uint32 + flags uint32 + oldProgFd uint32 +} + +func bpfLinkUpdate(attr *bpfLinkUpdateAttr) error { + _, err := internal.BPF(internal.BPF_LINK_UPDATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) + return err +} + +var haveBPFLink = internal.FeatureTest("bpf_link", "5.7", func() error { + prog, err := ebpf.NewProgram(&ebpf.ProgramSpec{ + Type: ebpf.CGroupSKB, + AttachType: ebpf.AttachCGroupInetIngress, + License: "MIT", + Instructions: asm.Instructions{ + asm.Mov.Imm(asm.R0, 0), + asm.Return(), + }, + }) + if err != nil { + return internal.ErrNotSupported + } + defer prog.Close() + + attr := bpfLinkCreateAttr{ + // This is a hopefully invalid file descriptor, which triggers EBADF. + targetFd: ^uint32(0), + progFd: uint32(prog.FD()), + attachType: ebpf.AttachCGroupInetIngress, + } + _, err = bpfLinkCreate(&attr) + if errors.Is(err, unix.EINVAL) { + return internal.ErrNotSupported + } + if errors.Is(err, unix.EBADF) { + return nil + } + return err +}) + +type bpfIterCreateAttr struct { + linkFd uint32 + flags uint32 +} + +func bpfIterCreate(attr *bpfIterCreateAttr) (*internal.FD, error) { + ptr, err := internal.BPF(internal.BPF_ITER_CREATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) + if err == nil { + return internal.NewFD(uint32(ptr)), nil + } + return nil, err +} + +type bpfRawTracepointOpenAttr struct { + name internal.Pointer + fd uint32 + _ uint32 +} + +func bpfRawTracepointOpen(attr *bpfRawTracepointOpenAttr) (*internal.FD, error) { + ptr, err := internal.BPF(internal.BPF_RAW_TRACEPOINT_OPEN, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) + if err == nil { + return internal.NewFD(uint32(ptr)), nil + } + return nil, err +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/tracepoint.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/tracepoint.go new file mode 100644 index 000000000000..588466b9d856 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/tracepoint.go @@ -0,0 +1,56 @@ +package link + +import ( + "fmt" + + "github.com/cilium/ebpf" +) + +// Tracepoint attaches the given eBPF program to the tracepoint with the given +// group and name. See /sys/kernel/debug/tracing/events to find available +// tracepoints. The top-level directory is the group, the event's subdirectory +// is the name. Example: +// +// Tracepoint("syscalls", "sys_enter_fork") +// +// Note that attaching eBPF programs to syscalls (sys_enter_*/sys_exit_*) is +// only possible as of kernel 4.14 (commit cf5f5ce). +func Tracepoint(group, name string, prog *ebpf.Program) (Link, error) { + if group == "" || name == "" { + return nil, fmt.Errorf("group and name cannot be empty: %w", errInvalidInput) + } + if prog == nil { + return nil, fmt.Errorf("prog cannot be nil: %w", errInvalidInput) + } + if !rgxTraceEvent.MatchString(group) || !rgxTraceEvent.MatchString(name) { + return nil, fmt.Errorf("group and name '%s/%s' must be alphanumeric or underscore: %w", group, name, errInvalidInput) + } + if prog.Type() != ebpf.TracePoint { + return nil, fmt.Errorf("eBPF program type %s is not a Tracepoint: %w", prog.Type(), errInvalidInput) + } + + tid, err := getTraceEventID(group, name) + if err != nil { + return nil, err + } + + fd, err := openTracepointPerfEvent(tid) + if err != nil { + return nil, err + } + + pe := &perfEvent{ + fd: fd, + tracefsID: tid, + group: group, + name: name, + progType: ebpf.TracePoint, + } + + if err := pe.attach(prog); err != nil { + pe.Close() + return nil, err + } + + return pe, nil +} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/linker.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/linker.go index fc4ad9dffa2a..f843bb25e7ba 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/linker.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/linker.go @@ -113,7 +113,7 @@ func fixupJumpsAndCalls(insns asm.Instructions) error { // Rewrite bpf to bpf call callOffset, ok := symbolOffsets[ins.Reference] if !ok { - return fmt.Errorf("instruction %d: reference to missing symbol %s", i, ins.Reference) + return fmt.Errorf("instruction %d: reference to missing symbol %q", i, ins.Reference) } ins.Constant = int64(callOffset - offset - 1) @@ -122,7 +122,7 @@ func fixupJumpsAndCalls(insns asm.Instructions) error { // Rewrite jump to label jumpOffset, ok := symbolOffsets[ins.Reference] if !ok { - return fmt.Errorf("instruction %d: reference to missing symbol %s", i, ins.Reference) + return fmt.Errorf("instruction %d: reference to missing symbol %q", i, ins.Reference) } ins.Offset = int16(jumpOffset - offset - 1) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/map.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/map.go index 5c9028d9de5f..7ff756b89bae 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/map.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/map.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "path/filepath" + "reflect" "strings" "github.com/cilium/ebpf/internal" @@ -24,7 +25,8 @@ type MapOptions struct { // The base path to pin maps in if requested via PinByName. // Existing maps will be re-used if they are compatible, otherwise an // error is returned. - PinPath string + PinPath string + LoadPinOptions LoadPinOptions } // MapID represents the unique ID of an eBPF map @@ -39,7 +41,10 @@ type MapSpec struct { KeySize uint32 ValueSize uint32 MaxEntries uint32 - Flags uint32 + + // Flags is passed to the kernel and specifies additional map + // creation attributes. + Flags uint32 // Automatically pin and load a map from MapOptions.PinPath. // Generates an error if an existing pinned map is incompatible with the MapSpec. @@ -90,20 +95,20 @@ type MapKV struct { func (ms *MapSpec) checkCompatibility(m *Map) error { switch { - case m.abi.Type != ms.Type: - return fmt.Errorf("expected type %v, got %v", ms.Type, m.abi.Type) + case m.typ != ms.Type: + return fmt.Errorf("expected type %v, got %v", ms.Type, m.typ) - case m.abi.KeySize != ms.KeySize: - return fmt.Errorf("expected key size %v, got %v", ms.KeySize, m.abi.KeySize) + case m.keySize != ms.KeySize: + return fmt.Errorf("expected key size %v, got %v", ms.KeySize, m.keySize) - case m.abi.ValueSize != ms.ValueSize: - return fmt.Errorf("expected value size %v, got %v", ms.ValueSize, m.abi.ValueSize) + case m.valueSize != ms.ValueSize: + return fmt.Errorf("expected value size %v, got %v", ms.ValueSize, m.valueSize) - case m.abi.MaxEntries != ms.MaxEntries: - return fmt.Errorf("expected max entries %v, got %v", ms.MaxEntries, m.abi.MaxEntries) + case m.maxEntries != ms.MaxEntries: + return fmt.Errorf("expected max entries %v, got %v", ms.MaxEntries, m.maxEntries) - case m.abi.Flags != ms.Flags: - return fmt.Errorf("expected flags %v, got %v", ms.Flags, m.abi.Flags) + case m.flags != ms.Flags: + return fmt.Errorf("expected flags %v, got %v", ms.Flags, m.flags) } return nil } @@ -118,9 +123,14 @@ func (ms *MapSpec) checkCompatibility(m *Map) error { // Implement encoding.BinaryMarshaler or encoding.BinaryUnmarshaler // if you require custom encoding. type Map struct { - name string - fd *internal.FD - abi MapABI + name string + fd *internal.FD + typ MapType + keySize uint32 + valueSize uint32 + maxEntries uint32 + flags uint32 + pinnedPath string // Per CPU maps return values larger than the size in the spec fullValueSize int } @@ -132,14 +142,18 @@ func NewMapFromFD(fd int) (*Map, error) { if fd < 0 { return nil, errors.New("invalid fd") } - bpfFd := internal.NewFD(uint32(fd)) - name, abi, err := newMapABIFromFd(bpfFd) + return newMapFromFD(internal.NewFD(uint32(fd))) +} + +func newMapFromFD(fd *internal.FD) (*Map, error) { + info, err := newMapInfoFromFd(fd) if err != nil { - bpfFd.Forget() - return nil, err + fd.Close() + return nil, fmt.Errorf("get map info: %s", err) } - return newMap(bpfFd, name, abi) + + return newMap(fd, info.Name, info.Type, info.KeySize, info.ValueSize, info.MaxEntries, info.Flags) } // NewMap creates a new Map. @@ -158,35 +172,36 @@ func NewMap(spec *MapSpec) (*Map, error) { // sufficiently high for locking memory during map creation. This can be done // by calling unix.Setrlimit with unix.RLIMIT_MEMLOCK prior to calling NewMapWithOptions. func NewMapWithOptions(spec *MapSpec, opts MapOptions) (*Map, error) { - if spec.BTF == nil { - return newMapWithBTF(spec, nil, opts) - } + btfs := make(btfHandleCache) + defer btfs.close() - handle, err := btf.NewHandle(btf.MapSpec(spec.BTF)) - if err != nil && !errors.Is(err, btf.ErrNotSupported) { - return nil, fmt.Errorf("can't load BTF: %w", err) - } - - return newMapWithBTF(spec, handle, opts) + return newMapWithOptions(spec, opts, btfs) } -func newMapWithBTF(spec *MapSpec, handle *btf.Handle, opts MapOptions) (*Map, error) { +func newMapWithOptions(spec *MapSpec, opts MapOptions, btfs btfHandleCache) (_ *Map, err error) { + closeOnError := func(c io.Closer) { + if err != nil { + c.Close() + } + } + switch spec.Pinning { case PinByName: if spec.Name == "" || opts.PinPath == "" { return nil, fmt.Errorf("pin by name: missing Name or PinPath") } - m, err := LoadPinnedMap(filepath.Join(opts.PinPath, spec.Name)) + path := filepath.Join(opts.PinPath, spec.Name) + m, err := LoadPinnedMap(path, &opts.LoadPinOptions) if errors.Is(err, unix.ENOENT) { break } if err != nil { - return nil, fmt.Errorf("load pinned map: %s", err) + return nil, fmt.Errorf("load pinned map: %w", err) } + defer closeOnError(m) if err := spec.checkCompatibility(m); err != nil { - m.Close() return nil, fmt.Errorf("use pinned map %s: %s", spec.Name, err) } @@ -205,7 +220,11 @@ func newMapWithBTF(spec *MapSpec, handle *btf.Handle, opts MapOptions) (*Map, er return nil, fmt.Errorf("%s requires InnerMap", spec.Type) } - template, err := createMap(spec.InnerMap, nil, handle, opts) + if spec.InnerMap.Pinning != PinNone { + return nil, errors.New("inner maps cannot be pinned") + } + + template, err := createMap(spec.InnerMap, nil, opts, btfs) if err != nil { return nil, err } @@ -214,14 +233,15 @@ func newMapWithBTF(spec *MapSpec, handle *btf.Handle, opts MapOptions) (*Map, er innerFd = template.fd } - m, err := createMap(spec, innerFd, handle, opts) + m, err := createMap(spec, innerFd, opts, btfs) if err != nil { return nil, err } + defer closeOnError(m) if spec.Pinning == PinByName { - if err := m.Pin(filepath.Join(opts.PinPath, spec.Name)); err != nil { - m.Close() + path := filepath.Join(opts.PinPath, spec.Name) + if err := m.Pin(path); err != nil { return nil, fmt.Errorf("pin map: %s", err) } } @@ -229,14 +249,14 @@ func newMapWithBTF(spec *MapSpec, handle *btf.Handle, opts MapOptions) (*Map, er return m, nil } -func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle, opts MapOptions) (_ *Map, err error) { +func createMap(spec *MapSpec, inner *internal.FD, opts MapOptions, btfs btfHandleCache) (_ *Map, err error) { closeOnError := func(closer io.Closer) { if err != nil { closer.Close() } } - abi := newMapABIFromSpec(spec) + spec = spec.Copy() switch spec.Type { case ArrayOfMaps: @@ -246,43 +266,43 @@ func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle, opts MapOp return nil, err } - if abi.ValueSize != 0 && abi.ValueSize != 4 { + if spec.ValueSize != 0 && spec.ValueSize != 4 { return nil, errors.New("ValueSize must be zero or four for map of map") } - abi.ValueSize = 4 + spec.ValueSize = 4 case PerfEventArray: - if abi.KeySize != 0 && abi.KeySize != 4 { + if spec.KeySize != 0 && spec.KeySize != 4 { return nil, errors.New("KeySize must be zero or four for perf event array") } - abi.KeySize = 4 + spec.KeySize = 4 - if abi.ValueSize != 0 && abi.ValueSize != 4 { + if spec.ValueSize != 0 && spec.ValueSize != 4 { return nil, errors.New("ValueSize must be zero or four for perf event array") } - abi.ValueSize = 4 + spec.ValueSize = 4 - if abi.MaxEntries == 0 { + if spec.MaxEntries == 0 { n, err := internal.PossibleCPUs() if err != nil { return nil, fmt.Errorf("perf event array: %w", err) } - abi.MaxEntries = uint32(n) + spec.MaxEntries = uint32(n) } } - if abi.Flags&(unix.BPF_F_RDONLY_PROG|unix.BPF_F_WRONLY_PROG) > 0 || spec.Freeze { + if spec.Flags&(unix.BPF_F_RDONLY_PROG|unix.BPF_F_WRONLY_PROG) > 0 || spec.Freeze { if err := haveMapMutabilityModifiers(); err != nil { return nil, fmt.Errorf("map create: %w", err) } } attr := bpfMapCreateAttr{ - mapType: abi.Type, - keySize: abi.KeySize, - valueSize: abi.ValueSize, - maxEntries: abi.MaxEntries, - flags: abi.Flags, + mapType: spec.Type, + keySize: spec.KeySize, + valueSize: spec.ValueSize, + maxEntries: spec.MaxEntries, + flags: spec.Flags, numaNode: spec.NumaNode, } @@ -294,25 +314,40 @@ func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle, opts MapOp } } - if handle != nil && spec.BTF != nil { - attr.btfFd = uint32(handle.FD()) - attr.btfKeyTypeID = btf.MapKey(spec.BTF).ID() - attr.btfValueTypeID = btf.MapValue(spec.BTF).ID() - } - if haveObjName() == nil { attr.mapName = newBPFObjName(spec.Name) } + var btfDisabled bool + if spec.BTF != nil { + handle, err := btfs.load(btf.MapSpec(spec.BTF)) + btfDisabled = errors.Is(err, btf.ErrNotSupported) + if err != nil && !btfDisabled { + return nil, fmt.Errorf("load BTF: %w", err) + } + + if handle != nil { + attr.btfFd = uint32(handle.FD()) + attr.btfKeyTypeID = btf.MapKey(spec.BTF).ID() + attr.btfValueTypeID = btf.MapValue(spec.BTF).ID() + } + } + fd, err := bpfMapCreate(&attr) if err != nil { + if errors.Is(err, unix.EPERM) { + return nil, fmt.Errorf("map create: RLIMIT_MEMLOCK may be too low: %w", err) + } + if btfDisabled { + return nil, fmt.Errorf("map create without BTF: %w", err) + } return nil, fmt.Errorf("map create: %w", err) } defer closeOnError(fd) - m, err := newMap(fd, spec.Name, abi) + m, err := newMap(fd, spec.Name, spec.Type, spec.KeySize, spec.ValueSize, spec.MaxEntries, spec.Flags) if err != nil { - return nil, err + return nil, fmt.Errorf("map create: %w", err) } if err := m.populate(spec.Contents); err != nil { @@ -328,15 +363,20 @@ func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle, opts MapOp return m, nil } -func newMap(fd *internal.FD, name string, abi *MapABI) (*Map, error) { +func newMap(fd *internal.FD, name string, typ MapType, keySize, valueSize, maxEntries, flags uint32) (*Map, error) { m := &Map{ name, fd, - *abi, - int(abi.ValueSize), + typ, + keySize, + valueSize, + maxEntries, + flags, + "", + int(valueSize), } - if !abi.Type.hasPerCPUValue() { + if !typ.hasPerCPUValue() { return m, nil } @@ -345,47 +385,45 @@ func newMap(fd *internal.FD, name string, abi *MapABI) (*Map, error) { return nil, err } - m.fullValueSize = align(int(abi.ValueSize), 8) * possibleCPUs + m.fullValueSize = align(int(valueSize), 8) * possibleCPUs return m, nil } func (m *Map) String() string { if m.name != "" { - return fmt.Sprintf("%s(%s)#%v", m.abi.Type, m.name, m.fd) + return fmt.Sprintf("%s(%s)#%v", m.typ, m.name, m.fd) } - return fmt.Sprintf("%s#%v", m.abi.Type, m.fd) + return fmt.Sprintf("%s#%v", m.typ, m.fd) } // Type returns the underlying type of the map. func (m *Map) Type() MapType { - return m.abi.Type + return m.typ } // KeySize returns the size of the map key in bytes. func (m *Map) KeySize() uint32 { - return m.abi.KeySize + return m.keySize } // ValueSize returns the size of the map value in bytes. func (m *Map) ValueSize() uint32 { - return m.abi.ValueSize + return m.valueSize } // MaxEntries returns the maximum number of elements the map can hold. func (m *Map) MaxEntries() uint32 { - return m.abi.MaxEntries + return m.maxEntries } // Flags returns the flags of the map. func (m *Map) Flags() uint32 { - return m.abi.Flags + return m.flags } -// ABI gets the ABI of the Map. -// -// Deprecated: use Type, KeySize, ValueSize, MaxEntries and Flags instead. -func (m *Map) ABI() MapABI { - return m.abi +// Info returns metadata about the map. +func (m *Map) Info() (*MapInfo, error) { + return newMapInfoFromFd(m.fd) } // Lookup retrieves a value from a Map. @@ -393,54 +431,14 @@ func (m *Map) ABI() MapABI { // Calls Close() on valueOut if it is of type **Map or **Program, // and *valueOut is not nil. // -// Returns an error if the key doesn't exist, see IsNotExist. +// Returns an error if the key doesn't exist, see ErrKeyNotExist. func (m *Map) Lookup(key, valueOut interface{}) error { valuePtr, valueBytes := makeBuffer(valueOut, m.fullValueSize) - if err := m.lookup(key, valuePtr); err != nil { return err } - if valueBytes == nil { - return nil - } - - if m.abi.Type.hasPerCPUValue() { - return unmarshalPerCPUValue(valueOut, int(m.abi.ValueSize), valueBytes) - } - - switch value := valueOut.(type) { - case **Map: - m, err := unmarshalMap(valueBytes) - if err != nil { - return err - } - - (*value).Close() - *value = m - return nil - case *Map: - return fmt.Errorf("can't unmarshal into %T, need %T", value, (**Map)(nil)) - case Map: - return fmt.Errorf("can't unmarshal into %T, need %T", value, (**Map)(nil)) - - case **Program: - p, err := unmarshalProgram(valueBytes) - if err != nil { - return err - } - - (*value).Close() - *value = p - return nil - case *Program: - return fmt.Errorf("can't unmarshal into %T, need %T", value, (**Program)(nil)) - case Program: - return fmt.Errorf("can't unmarshal into %T, need %T", value, (**Program)(nil)) - - default: - return unmarshalBytes(valueOut, valueBytes) - } + return m.unmarshalValue(valueOut, valueBytes) } // LookupAndDelete retrieves and deletes a value from a Map. @@ -449,7 +447,7 @@ func (m *Map) Lookup(key, valueOut interface{}) error { func (m *Map) LookupAndDelete(key, valueOut interface{}) error { valuePtr, valueBytes := makeBuffer(valueOut, m.fullValueSize) - keyPtr, err := marshalPtr(key, int(m.abi.KeySize)) + keyPtr, err := m.marshalKey(key) if err != nil { return fmt.Errorf("can't marshal key: %w", err) } @@ -458,7 +456,7 @@ func (m *Map) LookupAndDelete(key, valueOut interface{}) error { return fmt.Errorf("lookup and delete failed: %w", err) } - return unmarshalBytes(valueOut, valueBytes) + return m.unmarshalValue(valueOut, valueBytes) } // LookupBytes gets a value from Map. @@ -477,7 +475,7 @@ func (m *Map) LookupBytes(key interface{}) ([]byte, error) { } func (m *Map) lookup(key interface{}, valueOut internal.Pointer) error { - keyPtr, err := marshalPtr(key, int(m.abi.KeySize)) + keyPtr, err := m.marshalKey(key) if err != nil { return fmt.Errorf("can't marshal key: %w", err) } @@ -511,17 +509,12 @@ func (m *Map) Put(key, value interface{}) error { // Update changes the value of a key. func (m *Map) Update(key, value interface{}, flags MapUpdateFlags) error { - keyPtr, err := marshalPtr(key, int(m.abi.KeySize)) + keyPtr, err := m.marshalKey(key) if err != nil { return fmt.Errorf("can't marshal key: %w", err) } - var valuePtr internal.Pointer - if m.abi.Type.hasPerCPUValue() { - valuePtr, err = marshalPerCPUValue(value, int(m.abi.ValueSize)) - } else { - valuePtr, err = marshalPtr(value, int(m.abi.ValueSize)) - } + valuePtr, err := m.marshalValue(value) if err != nil { return fmt.Errorf("can't marshal value: %w", err) } @@ -537,7 +530,7 @@ func (m *Map) Update(key, value interface{}, flags MapUpdateFlags) error { // // Returns ErrKeyNotExist if the key does not exist. func (m *Map) Delete(key interface{}) error { - keyPtr, err := marshalPtr(key, int(m.abi.KeySize)) + keyPtr, err := m.marshalKey(key) if err != nil { return fmt.Errorf("can't marshal key: %w", err) } @@ -554,17 +547,13 @@ func (m *Map) Delete(key interface{}) error { // // Returns ErrKeyNotExist if there is no next key. func (m *Map) NextKey(key, nextKeyOut interface{}) error { - nextKeyPtr, nextKeyBytes := makeBuffer(nextKeyOut, int(m.abi.KeySize)) + nextKeyPtr, nextKeyBytes := makeBuffer(nextKeyOut, int(m.keySize)) if err := m.nextKey(key, nextKeyPtr); err != nil { return err } - if nextKeyBytes == nil { - return nil - } - - if err := unmarshalBytes(nextKeyOut, nextKeyBytes); err != nil { + if err := m.unmarshalKey(nextKeyOut, nextKeyBytes); err != nil { return fmt.Errorf("can't unmarshal next key: %w", err) } return nil @@ -578,7 +567,7 @@ func (m *Map) NextKey(key, nextKeyOut interface{}) error { // // Returns nil if there are no more keys. func (m *Map) NextKeyBytes(key interface{}) ([]byte, error) { - nextKey := make([]byte, m.abi.KeySize) + nextKey := make([]byte, m.keySize) nextKeyPtr := internal.NewSlicePointer(nextKey) err := m.nextKey(key, nextKeyPtr) @@ -596,7 +585,7 @@ func (m *Map) nextKey(key interface{}, nextKeyOut internal.Pointer) error { ) if key != nil { - keyPtr, err = marshalPtr(key, int(m.abi.KeySize)) + keyPtr, err = m.marshalKey(key) if err != nil { return fmt.Errorf("can't marshal key: %w", err) } @@ -608,6 +597,158 @@ func (m *Map) nextKey(key interface{}, nextKeyOut internal.Pointer) error { return nil } +// BatchLookup looks up many elements in a map at once. +// +// "keysOut" and "valuesOut" must be of type slice, a pointer +// to a slice or buffer will not work. +// "prevKey" is the key to start the batch lookup from, it will +// *not* be included in the results. Use nil to start at the first key. +// +// ErrKeyNotExist is returned when the batch lookup has reached +// the end of all possible results, even when partial results +// are returned. It should be used to evaluate when lookup is "done". +func (m *Map) BatchLookup(prevKey, nextKeyOut, keysOut, valuesOut interface{}, opts *BatchOptions) (int, error) { + return m.batchLookup(internal.BPF_MAP_LOOKUP_BATCH, prevKey, nextKeyOut, keysOut, valuesOut, opts) +} + +// BatchLookupAndDelete looks up many elements in a map at once, +// +// It then deletes all those elements. +// "keysOut" and "valuesOut" must be of type slice, a pointer +// to a slice or buffer will not work. +// "prevKey" is the key to start the batch lookup from, it will +// *not* be included in the results. Use nil to start at the first key. +// +// ErrKeyNotExist is returned when the batch lookup has reached +// the end of all possible results, even when partial results +// are returned. It should be used to evaluate when lookup is "done". +func (m *Map) BatchLookupAndDelete(prevKey, nextKeyOut, keysOut, valuesOut interface{}, opts *BatchOptions) (int, error) { + return m.batchLookup(internal.BPF_MAP_LOOKUP_AND_DELETE_BATCH, prevKey, nextKeyOut, keysOut, valuesOut, opts) +} + +func (m *Map) batchLookup(cmd internal.BPFCmd, startKey, nextKeyOut, keysOut, valuesOut interface{}, opts *BatchOptions) (int, error) { + if err := haveBatchAPI(); err != nil { + return 0, err + } + if m.typ.hasPerCPUValue() { + return 0, ErrNotSupported + } + keysValue := reflect.ValueOf(keysOut) + if keysValue.Kind() != reflect.Slice { + return 0, fmt.Errorf("keys must be a slice") + } + valuesValue := reflect.ValueOf(valuesOut) + if valuesValue.Kind() != reflect.Slice { + return 0, fmt.Errorf("valuesOut must be a slice") + } + count := keysValue.Len() + if count != valuesValue.Len() { + return 0, fmt.Errorf("keysOut and valuesOut must be the same length") + } + keyBuf := make([]byte, count*int(m.keySize)) + keyPtr := internal.NewSlicePointer(keyBuf) + valueBuf := make([]byte, count*int(m.fullValueSize)) + valuePtr := internal.NewSlicePointer(valueBuf) + + var ( + startPtr internal.Pointer + err error + retErr error + ) + if startKey != nil { + startPtr, err = marshalPtr(startKey, int(m.keySize)) + if err != nil { + return 0, err + } + } + nextPtr, nextBuf := makeBuffer(nextKeyOut, int(m.keySize)) + + ct, err := bpfMapBatch(cmd, m.fd, startPtr, nextPtr, keyPtr, valuePtr, uint32(count), opts) + if err != nil { + if !errors.Is(err, ErrKeyNotExist) { + return 0, err + } + retErr = ErrKeyNotExist + } + + err = m.unmarshalKey(nextKeyOut, nextBuf) + if err != nil { + return 0, err + } + err = unmarshalBytes(keysOut, keyBuf) + if err != nil { + return 0, err + } + err = unmarshalBytes(valuesOut, valueBuf) + if err != nil { + retErr = err + } + return int(ct), retErr +} + +// BatchUpdate updates the map with multiple keys and values +// simultaneously. +// "keys" and "values" must be of type slice, a pointer +// to a slice or buffer will not work. +func (m *Map) BatchUpdate(keys, values interface{}, opts *BatchOptions) (int, error) { + if err := haveBatchAPI(); err != nil { + return 0, err + } + if m.typ.hasPerCPUValue() { + return 0, ErrNotSupported + } + keysValue := reflect.ValueOf(keys) + if keysValue.Kind() != reflect.Slice { + return 0, fmt.Errorf("keys must be a slice") + } + valuesValue := reflect.ValueOf(values) + if valuesValue.Kind() != reflect.Slice { + return 0, fmt.Errorf("values must be a slice") + } + var ( + count = keysValue.Len() + valuePtr internal.Pointer + err error + ) + if count != valuesValue.Len() { + return 0, fmt.Errorf("keys and values must be the same length") + } + keyPtr, err := marshalPtr(keys, count*int(m.keySize)) + if err != nil { + return 0, err + } + valuePtr, err = marshalPtr(values, count*int(m.valueSize)) + if err != nil { + return 0, err + } + var nilPtr internal.Pointer + ct, err := bpfMapBatch(internal.BPF_MAP_UPDATE_BATCH, m.fd, nilPtr, nilPtr, keyPtr, valuePtr, uint32(count), opts) + return int(ct), err +} + +// BatchDelete batch deletes entries in the map by keys. +// "keys" must be of type slice, a pointer to a slice or buffer will not work. +func (m *Map) BatchDelete(keys interface{}, opts *BatchOptions) (int, error) { + if err := haveBatchAPI(); err != nil { + return 0, err + } + if m.typ.hasPerCPUValue() { + return 0, ErrNotSupported + } + keysValue := reflect.ValueOf(keys) + if keysValue.Kind() != reflect.Slice { + return 0, fmt.Errorf("keys must be a slice") + } + count := keysValue.Len() + keyPtr, err := marshalPtr(keys, count*int(m.keySize)) + if err != nil { + return 0, fmt.Errorf("cannot marshal keys: %v", err) + } + var nilPtr internal.Pointer + ct, err := bpfMapBatch(internal.BPF_MAP_DELETE_BATCH, m.fd, nilPtr, nilPtr, keyPtr, nilPtr, uint32(count), opts) + return int(ct), err +} + // Iterate traverses a map. // // It's safe to create multiple iterators at the same time. @@ -647,6 +788,7 @@ func (m *Map) FD() int { // // Closing the duplicate does not affect the original, and vice versa. // Changes made to the map are reflected by both instances however. +// If the original map was pinned, the cloned map will not be pinned by default. // // Cloning a nil Map returns nil. func (m *Map) Clone() (*Map, error) { @@ -659,14 +801,51 @@ func (m *Map) Clone() (*Map, error) { return nil, fmt.Errorf("can't clone map: %w", err) } - return newMap(dup, m.name, &m.abi) + return &Map{ + m.name, + dup, + m.typ, + m.keySize, + m.valueSize, + m.maxEntries, + m.flags, + "", + m.fullValueSize, + }, nil } -// Pin persists the map past the lifetime of the process that created it. +// Pin persists the map on the BPF virtual file system past the lifetime of +// the process that created it . +// +// Calling Pin on a previously pinned map will overwrite the path, except when +// the new path already exists. Re-pinning across filesystems is not supported. +// You can Clone a map to pin it to a different path. // // This requires bpffs to be mounted above fileName. See https://docs.cilium.io/en/k8s-doc/admin/#admin-mount-bpffs func (m *Map) Pin(fileName string) error { - return internal.BPFObjPin(fileName, m.fd) + if err := internal.Pin(m.pinnedPath, fileName, m.fd); err != nil { + return err + } + m.pinnedPath = fileName + return nil +} + +// Unpin removes the persisted state for the map from the BPF virtual filesystem. +// +// Failed calls to Unpin will not alter the state returned by IsPinned. +// +// Unpinning an unpinned Map returns nil. +func (m *Map) Unpin() error { + if err := internal.Unpin(m.pinnedPath); err != nil { + return err + } + m.pinnedPath = "" + return nil +} + +// IsPinned returns true if the map has a non-empty pinned path. +func (m *Map) IsPinned() bool { + return m.pinnedPath != "" } // Freeze prevents a map to be modified from user space. @@ -692,45 +871,151 @@ func (m *Map) populate(contents []MapKV) error { return nil } -// LoadPinnedMap load a Map from a BPF file. -// -// The function is not compatible with nested maps. -// Use LoadPinnedMapExplicit in these situations. -func LoadPinnedMap(fileName string) (*Map, error) { - fd, err := internal.BPFObjGet(fileName) - if err != nil { - return nil, err +func (m *Map) marshalKey(data interface{}) (internal.Pointer, error) { + if data == nil { + if m.keySize == 0 { + // Queues have a key length of zero, so passing nil here is valid. + return internal.NewPointer(nil), nil + } + return internal.Pointer{}, errors.New("can't use nil as key of map") + } + + return marshalPtr(data, int(m.keySize)) +} + +func (m *Map) unmarshalKey(data interface{}, buf []byte) error { + if buf == nil { + // This is from a makeBuffer call, nothing do do here. + return nil + } + + return unmarshalBytes(data, buf) +} + +func (m *Map) marshalValue(data interface{}) (internal.Pointer, error) { + if m.typ.hasPerCPUValue() { + return marshalPerCPUValue(data, int(m.valueSize)) } - name, abi, err := newMapABIFromFd(fd) + + var ( + buf []byte + err error + ) + + switch value := data.(type) { + case *Map: + if !m.typ.canStoreMap() { + return internal.Pointer{}, fmt.Errorf("can't store map in %s", m.typ) + } + buf, err = marshalMap(value, int(m.valueSize)) + + case *Program: + if !m.typ.canStoreProgram() { + return internal.Pointer{}, fmt.Errorf("can't store program in %s", m.typ) + } + buf, err = marshalProgram(value, int(m.valueSize)) + + default: + return marshalPtr(data, int(m.valueSize)) + } + if err != nil { - _ = fd.Close() - return nil, err + return internal.Pointer{}, err } - return newMap(fd, name, abi) + + return internal.NewSlicePointer(buf), nil } -// LoadPinnedMapExplicit loads a map with explicit parameters. -func LoadPinnedMapExplicit(fileName string, abi *MapABI) (*Map, error) { - fd, err := internal.BPFObjGet(fileName) +func (m *Map) unmarshalValue(value interface{}, buf []byte) error { + if buf == nil { + // This is from a makeBuffer call, nothing do do here. + return nil + } + + if m.typ.hasPerCPUValue() { + return unmarshalPerCPUValue(value, int(m.valueSize), buf) + } + + switch value := value.(type) { + case **Map: + if !m.typ.canStoreMap() { + return fmt.Errorf("can't read a map from %s", m.typ) + } + + other, err := unmarshalMap(buf) + if err != nil { + return err + } + + // The caller might close the map externally, so ignore errors. + _ = (*value).Close() + + *value = other + return nil + + case *Map: + if !m.typ.canStoreMap() { + return fmt.Errorf("can't read a map from %s", m.typ) + } + return errors.New("require pointer to *Map") + + case **Program: + if !m.typ.canStoreProgram() { + return fmt.Errorf("can't read a program from %s", m.typ) + } + + other, err := unmarshalProgram(buf) + if err != nil { + return err + } + + // The caller might close the program externally, so ignore errors. + _ = (*value).Close() + + *value = other + return nil + + case *Program: + if !m.typ.canStoreProgram() { + return fmt.Errorf("can't read a program from %s", m.typ) + } + return errors.New("require pointer to *Program") + } + + return unmarshalBytes(value, buf) +} + +// LoadPinnedMap loads a Map from a BPF file. +func LoadPinnedMap(fileName string, opts *LoadPinOptions) (*Map, error) { + fd, err := internal.BPFObjGet(fileName, opts.Marshal()) if err != nil { return nil, err } - return newMap(fd, "", abi) + + m, err := newMapFromFD(fd) + if err == nil { + m.pinnedPath = fileName + } + + return m, err } +// unmarshalMap creates a map from a map ID encoded in host endianness. func unmarshalMap(buf []byte) (*Map, error) { if len(buf) != 4 { return nil, errors.New("map id requires 4 byte value") } - // Looking up an entry in a nested map or prog array returns an id, - // not an fd. id := internal.NativeEndian.Uint32(buf) return NewMapFromID(MapID(id)) } -// MarshalBinary implements BinaryMarshaler. -func (m *Map) MarshalBinary() ([]byte, error) { +// marshalMap marshals the fd of a map into a buffer in host endianness. +func marshalMap(m *Map, length int) ([]byte, error) { + if length != 4 { + return nil, fmt.Errorf("can't marshal map to %d bytes", length) + } + fd, err := m.fd.Value() if err != nil { return nil, err @@ -810,8 +1095,8 @@ type MapIterator struct { func newMapIterator(target *Map) *MapIterator { return &MapIterator{ target: target, - maxEntries: target.abi.MaxEntries, - prevBytes: make([]byte, int(target.abi.KeySize)), + maxEntries: target.maxEntries, + prevBytes: make([]byte, target.keySize), } } @@ -830,7 +1115,9 @@ func (mi *MapIterator) Next(keyOut, valueOut interface{}) bool { return false } - for ; mi.count < mi.maxEntries; mi.count++ { + // For array-like maps NextKeyBytes returns nil only on after maxEntries + // iterations. + for mi.count <= mi.maxEntries { var nextBytes []byte nextBytes, mi.err = mi.target.NextKeyBytes(mi.prevKey) if mi.err != nil { @@ -849,6 +1136,7 @@ func (mi *MapIterator) Next(keyOut, valueOut interface{}) bool { copy(mi.prevBytes, nextBytes) mi.prevKey = mi.prevBytes + mi.count++ mi.err = mi.target.Lookup(nextBytes, valueOut) if errors.Is(mi.err, ErrKeyNotExist) { // Even though the key should be valid, we couldn't look up @@ -865,7 +1153,7 @@ func (mi *MapIterator) Next(keyOut, valueOut interface{}) bool { return false } - mi.err = unmarshalBytes(keyOut, nextBytes) + mi.err = mi.target.unmarshalKey(keyOut, nextBytes) return mi.err == nil } @@ -899,18 +1187,12 @@ func NewMapFromID(id MapID) (*Map, error) { return nil, err } - name, abi, err := newMapABIFromFd(fd) - if err != nil { - _ = fd.Close() - return nil, err - } - - return newMap(fd, name, abi) + return newMapFromFD(fd) } // ID returns the systemwide unique ID of the map. // -// Requires at least Linux 4.13. +// Deprecated: use MapInfo.ID() instead. func (m *Map) ID() (MapID, error) { info, err := bpfGetMapInfoByFD(m.fd) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/marshalers.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/marshalers.go index c0db2f6b0b1c..f2610eff9c78 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/marshalers.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/marshalers.go @@ -13,14 +13,12 @@ import ( "github.com/cilium/ebpf/internal" ) +// marshalPtr converts an arbitrary value into a pointer suitable +// to be passed to the kernel. +// +// As an optimization, it returns the original value if it is an +// unsafe.Pointer. func marshalPtr(data interface{}, length int) (internal.Pointer, error) { - if data == nil { - if length == 0 { - return internal.NewPointer(nil), nil - } - return internal.Pointer{}, errors.New("can't use nil as key of map") - } - if ptr, ok := data.(unsafe.Pointer); ok { return internal.NewPointer(ptr), nil } @@ -33,6 +31,13 @@ func marshalPtr(data interface{}, length int) (internal.Pointer, error) { return internal.NewSlicePointer(buf), nil } +// marshalBytes converts an arbitrary value into a byte buffer. +// +// Prefer using Map.marshalKey and Map.marshalValue if possible, since +// those have special cases that allow more types to be encoded. +// +// Returns an error if the given value isn't representable in exactly +// length bytes. func marshalBytes(data interface{}, length int) (buf []byte, err error) { switch value := data.(type) { case encoding.BinaryMarshaler: @@ -43,6 +48,8 @@ func marshalBytes(data interface{}, length int) (buf []byte, err error) { buf = value case unsafe.Pointer: err = errors.New("can't marshal from unsafe.Pointer") + case Map, *Map, Program, *Program: + err = fmt.Errorf("can't marshal %T", value) default: var wr bytes.Buffer err = binary.Write(&wr, internal.NativeEndian, value) @@ -70,10 +77,16 @@ func makeBuffer(dst interface{}, length int) (internal.Pointer, []byte) { return internal.NewSlicePointer(buf), buf } +// unmarshalBytes converts a byte buffer into an arbitrary value. +// +// Prefer using Map.unmarshalKey and Map.unmarshalValue if possible, since +// those have special cases that allow more types to be encoded. func unmarshalBytes(data interface{}, buf []byte) error { switch value := data.(type) { case unsafe.Pointer: - sh := &reflect.SliceHeader{ + // This could be solved in Go 1.17 by unsafe.Slice instead. (https://github.com/golang/go/issues/19367) + // We could opt for removing unsafe.Pointer support in the lib as well. + sh := &reflect.SliceHeader{ //nolint:govet Data: uintptr(value), Len: len(buf), Cap: len(buf), @@ -83,6 +96,8 @@ func unmarshalBytes(data interface{}, buf []byte) error { copy(dst, buf) runtime.KeepAlive(value) return nil + case Map, *Map, Program, *Program: + return fmt.Errorf("can't unmarshal into %T", value) case encoding.BinaryUnmarshaler: return value.UnmarshalBinary(buf) case *string: diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/prog.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/prog.go index 67cfff67eb15..18edb5453cbb 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/prog.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/prog.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "math" + "path/filepath" "strings" "time" @@ -18,7 +19,7 @@ import ( // ErrNotSupported is returned whenever the kernel doesn't support a feature. var ErrNotSupported = internal.ErrNotSupported -// ProgramID represents the unique ID of an eBPF program +// ProgramID represents the unique ID of an eBPF program. type ProgramID uint32 const ( @@ -42,7 +43,7 @@ type ProgramOptions struct { LogSize int } -// ProgramSpec defines a Program +// ProgramSpec defines a Program. type ProgramSpec struct { // Name is passed to the kernel as a debug aid. Must only contain // alpha numeric and '_' characters. @@ -54,16 +55,19 @@ type ProgramSpec struct { // depends on Type and AttachType. AttachTo string Instructions asm.Instructions - + // Flags is passed to the kernel and specifies additional program + // load attributes. + Flags uint32 // License of the program. Some helpers are only available if // the license is deemed compatible with the GPL. // // See https://www.kernel.org/doc/html/latest/process/license-rules.html#id1 License string - // Version used by tracing programs. + // Version used by Kprobe programs. // - // Deprecated: superseded by BTF. + // Deprecated on kernels 5.0 and later. Leave empty to let the library + // detect this value automatically. KernelVersion uint32 // The BTF associated with this program. Changing Instructions @@ -87,6 +91,13 @@ func (ps *ProgramSpec) Copy() *ProgramSpec { return &cpy } +// Tag calculates the kernel tag for a series of instructions. +// +// Use asm.Instructions.Tag if you need to calculate for non-native endianness. +func (ps *ProgramSpec) Tag() (string, error) { + return ps.Instructions.Tag(internal.NativeEndian) +} + // Program represents BPF program loaded into the kernel. // // It is not safe to close a Program which is used by other goroutines. @@ -97,8 +108,8 @@ type Program struct { fd *internal.FD name string - abi ProgramABI - attachType AttachType + pinnedPath string + typ ProgramType } // NewProgram creates a new Program. @@ -114,88 +125,13 @@ func NewProgram(spec *ProgramSpec) (*Program, error) { // Loading a program for the first time will perform // feature detection by loading small, temporary programs. func NewProgramWithOptions(spec *ProgramSpec, opts ProgramOptions) (*Program, error) { - if spec.BTF == nil { - return newProgramWithBTF(spec, nil, opts) - } - - handle, err := btf.NewHandle(btf.ProgramSpec(spec.BTF)) - if err != nil && !errors.Is(err, btf.ErrNotSupported) { - return nil, fmt.Errorf("can't load BTF: %w", err) - } - - return newProgramWithBTF(spec, handle, opts) -} - -func newProgramWithBTF(spec *ProgramSpec, btf *btf.Handle, opts ProgramOptions) (*Program, error) { - attr, err := convertProgramSpec(spec, btf) - if err != nil { - return nil, err - } - - logSize := DefaultVerifierLogSize - if opts.LogSize > 0 { - logSize = opts.LogSize - } - - var logBuf []byte - if opts.LogLevel > 0 { - logBuf = make([]byte, logSize) - attr.logLevel = opts.LogLevel - attr.logSize = uint32(len(logBuf)) - attr.logBuf = internal.NewSlicePointer(logBuf) - } + btfs := make(btfHandleCache) + defer btfs.close() - fd, err := bpfProgLoad(attr) - if err == nil { - prog := newProgram(fd, spec.Name, &ProgramABI{spec.Type}) - prog.VerifierLog = internal.CString(logBuf) - return prog, nil - } - - logErr := err - if opts.LogLevel == 0 { - // Re-run with the verifier enabled to get better error messages. - logBuf = make([]byte, logSize) - attr.logLevel = 1 - attr.logSize = uint32(len(logBuf)) - attr.logBuf = internal.NewSlicePointer(logBuf) - - _, logErr = bpfProgLoad(attr) - } - - err = internal.ErrorWithLog(err, logBuf, logErr) - return nil, fmt.Errorf("can't load program: %w", err) + return newProgramWithOptions(spec, opts, btfs) } -// NewProgramFromFD creates a program from a raw fd. -// -// You should not use fd after calling this function. -// -// Requires at least Linux 4.11. -func NewProgramFromFD(fd int) (*Program, error) { - if fd < 0 { - return nil, errors.New("invalid fd") - } - bpfFd := internal.NewFD(uint32(fd)) - - name, abi, err := newProgramABIFromFd(bpfFd) - if err != nil { - bpfFd.Forget() - return nil, err - } - - return newProgram(bpfFd, name, abi), nil -} - -func newProgram(fd *internal.FD, name string, abi *ProgramABI) *Program { - return &Program{ - name: name, - fd: fd, - abi: *abi, - } -} - -func convertProgramSpec(spec *ProgramSpec, handle *btf.Handle) (*bpfProgLoadAttr, error) { +func newProgramWithOptions(spec *ProgramSpec, opts ProgramOptions, btfs btfHandleCache) (*Program, error) { if len(spec.Instructions) == 0 { return nil, errors.New("Instructions cannot be empty") } @@ -208,6 +144,19 @@ func convertProgramSpec(spec *ProgramSpec, handle *btf.Handle) (*bpfProgLoadAttr return nil, fmt.Errorf("can't load %s program on %s", spec.ByteOrder, internal.NativeEndian) } + // Kernels before 5.0 (6c4fc209fcf9 "bpf: remove useless version check for prog load") + // require the version field to be set to the value of the KERNEL_VERSION + // macro for kprobe-type programs. + // Overwrite Kprobe program version if set to zero or the magic version constant. + kv := spec.KernelVersion + if spec.Type == Kprobe && (kv == 0 || kv == internal.MagicKernelVersion) { + v, err := internal.KernelVersion() + if err != nil { + return nil, fmt.Errorf("detecting kernel version: %w", err) + } + kv = v.Kernel() + } + insns := make(asm.Instructions, len(spec.Instructions)) copy(insns, spec.Instructions) @@ -225,35 +174,51 @@ func convertProgramSpec(spec *ProgramSpec, handle *btf.Handle) (*bpfProgLoadAttr insCount := uint32(len(bytecode) / asm.InstructionSize) attr := &bpfProgLoadAttr{ progType: spec.Type, + progFlags: spec.Flags, expectedAttachType: spec.AttachType, insCount: insCount, instructions: internal.NewSlicePointer(bytecode), license: internal.NewStringPointer(spec.License), - kernelVersion: spec.KernelVersion, + kernelVersion: kv, } if haveObjName() == nil { attr.progName = newBPFObjName(spec.Name) } - if handle != nil && spec.BTF != nil { - attr.progBTFFd = uint32(handle.FD()) + var btfDisabled bool + if spec.BTF != nil { + if relos, err := btf.ProgramRelocations(spec.BTF, nil); err != nil { + return nil, fmt.Errorf("CO-RE relocations: %s", err) + } else if len(relos) > 0 { + return nil, fmt.Errorf("applying CO-RE relocations: %w", ErrNotSupported) + } - recSize, bytes, err := btf.ProgramLineInfos(spec.BTF) - if err != nil { - return nil, fmt.Errorf("can't get BTF line infos: %w", err) + handle, err := btfs.load(btf.ProgramSpec(spec.BTF)) + btfDisabled = errors.Is(err, btf.ErrNotSupported) + if err != nil && !btfDisabled { + return nil, fmt.Errorf("load BTF: %w", err) } - attr.lineInfoRecSize = recSize - attr.lineInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize)) - attr.lineInfo = internal.NewSlicePointer(bytes) - recSize, bytes, err = btf.ProgramFuncInfos(spec.BTF) - if err != nil { - return nil, fmt.Errorf("can't get BTF function infos: %w", err) + if handle != nil { + attr.progBTFFd = uint32(handle.FD()) + + recSize, bytes, err := btf.ProgramLineInfos(spec.BTF) + if err != nil { + return nil, fmt.Errorf("get BTF line infos: %w", err) + } + attr.lineInfoRecSize = recSize + attr.lineInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize)) + attr.lineInfo = internal.NewSlicePointer(bytes) + + recSize, bytes, err = btf.ProgramFuncInfos(spec.BTF) + if err != nil { + return nil, fmt.Errorf("get BTF function infos: %w", err) + } + attr.funcInfoRecSize = recSize + attr.funcInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize)) + attr.funcInfo = internal.NewSlicePointer(bytes) } - attr.funcInfoRecSize = recSize - attr.funcInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize)) - attr.funcInfo = internal.NewSlicePointer(bytes) } if spec.AttachTo != "" { @@ -266,26 +231,100 @@ func convertProgramSpec(spec *ProgramSpec, handle *btf.Handle) (*bpfProgLoadAttr } } - return attr, nil + logSize := DefaultVerifierLogSize + if opts.LogSize > 0 { + logSize = opts.LogSize + } + + var logBuf []byte + if opts.LogLevel > 0 { + logBuf = make([]byte, logSize) + attr.logLevel = opts.LogLevel + attr.logSize = uint32(len(logBuf)) + attr.logBuf = internal.NewSlicePointer(logBuf) + } + + fd, err := bpfProgLoad(attr) + if err == nil { + return &Program{internal.CString(logBuf), fd, spec.Name, "", spec.Type}, nil + } + + logErr := err + if opts.LogLevel == 0 { + // Re-run with the verifier enabled to get better error messages. + logBuf = make([]byte, logSize) + attr.logLevel = 1 + attr.logSize = uint32(len(logBuf)) + attr.logBuf = internal.NewSlicePointer(logBuf) + + _, logErr = bpfProgLoad(attr) + } + + if errors.Is(logErr, unix.EPERM) && logBuf[0] == 0 { + // EPERM due to RLIMIT_MEMLOCK happens before the verifier, so we can + // check that the log is empty to reduce false positives. + return nil, fmt.Errorf("load program: RLIMIT_MEMLOCK may be too low: %w", logErr) + } + + err = internal.ErrorWithLog(err, logBuf, logErr) + if btfDisabled { + return nil, fmt.Errorf("load program without BTF: %w", err) + } + return nil, fmt.Errorf("load program: %w", err) +} + +// NewProgramFromFD creates a program from a raw fd. +// +// You should not use fd after calling this function. +// +// Requires at least Linux 4.10. +func NewProgramFromFD(fd int) (*Program, error) { + if fd < 0 { + return nil, errors.New("invalid fd") + } + + return newProgramFromFD(internal.NewFD(uint32(fd))) +} + +// NewProgramFromID returns the program for a given id. +// +// Returns ErrNotExist, if there is no eBPF program with the given id. +func NewProgramFromID(id ProgramID) (*Program, error) { + fd, err := bpfObjGetFDByID(internal.BPF_PROG_GET_FD_BY_ID, uint32(id)) + if err != nil { + return nil, fmt.Errorf("get program by id: %w", err) + } + + return newProgramFromFD(fd) +} + +func newProgramFromFD(fd *internal.FD) (*Program, error) { + info, err := newProgramInfoFromFd(fd) + if err != nil { + fd.Close() + return nil, fmt.Errorf("discover program type: %w", err) + } + + return &Program{"", fd, "", "", info.Type}, nil } func (p *Program) String() string { if p.name != "" { - return fmt.Sprintf("%s(%s)#%v", p.abi.Type, p.name, p.fd) + return fmt.Sprintf("%s(%s)#%v", p.typ, p.name, p.fd) } - return fmt.Sprintf("%s#%v", p.abi.Type, p.fd) + return fmt.Sprintf("%s(%v)", p.typ, p.fd) } // Type returns the underlying type of the program. func (p *Program) Type() ProgramType { - return p.abi.Type + return p.typ } -// ABI gets the ABI of the Program. +// Info returns metadata about the program. // -// Deprecated: use Type instead. -func (p *Program) ABI() ProgramABI { - return p.abi +// Requires at least 4.10. +func (p *Program) Info() (*ProgramInfo, error) { + return newProgramInfoFromFd(p.fd) } // FD gets the file descriptor of the Program. @@ -317,19 +356,42 @@ func (p *Program) Clone() (*Program, error) { return nil, fmt.Errorf("can't clone program: %w", err) } - return newProgram(dup, p.name, &p.abi), nil + return &Program{p.VerifierLog, dup, p.name, "", p.typ}, nil } -// Pin persists the Program past the lifetime of the process that created it +// Pin persists the Program on the BPF virtual file system past the lifetime of +// the process that created it +// +// Calling Pin on a previously pinned program will overwrite the path, except when +// the new path already exists. Re-pinning across filesystems is not supported. // // This requires bpffs to be mounted above fileName. See https://docs.cilium.io/en/k8s-doc/admin/#admin-mount-bpffs func (p *Program) Pin(fileName string) error { - if err := internal.BPFObjPin(fileName, p.fd); err != nil { - return fmt.Errorf("can't pin program: %w", err) + if err := internal.Pin(p.pinnedPath, fileName, p.fd); err != nil { + return err } + p.pinnedPath = fileName return nil } +// Unpin removes the persisted state for the Program from the BPF virtual filesystem. +// +// Failed calls to Unpin will not alter the state returned by IsPinned. +// +// Unpinning an unpinned Program returns nil. +func (p *Program) Unpin() error { + if err := internal.Unpin(p.pinnedPath); err != nil { + return err + } + p.pinnedPath = "" + return nil +} + +// IsPinned returns true if the Program has a non-empty pinned path. +func (p *Program) IsPinned() bool { + return p.pinnedPath != "" +} + // Close unloads the program from the kernel. func (p *Program) Close() error { if p == nil { @@ -373,7 +435,7 @@ func (p *Program) Benchmark(in []byte, repeat int, reset func()) (uint32, time.D return ret, total, nil } -var haveProgTestRun = internal.FeatureTest("BPF_PROG_TEST_RUN", "4.12", func() (bool, error) { +var haveProgTestRun = internal.FeatureTest("BPF_PROG_TEST_RUN", "4.12", func() error { prog, err := NewProgram(&ProgramSpec{ Type: SocketFilter, Instructions: asm.Instructions{ @@ -384,7 +446,7 @@ var haveProgTestRun = internal.FeatureTest("BPF_PROG_TEST_RUN", "4.12", func() ( }) if err != nil { // This may be because we lack sufficient permissions, etc. - return false, err + return err } defer prog.Close() @@ -397,10 +459,16 @@ var haveProgTestRun = internal.FeatureTest("BPF_PROG_TEST_RUN", "4.12", func() ( } err = bpfProgTestRun(&attr) - - // Check for EINVAL specifically, rather than err != nil since we - // otherwise misdetect due to insufficient permissions. - return !errors.Is(err, unix.EINVAL), nil + if errors.Is(err, unix.EINVAL) { + // Check for EINVAL specifically, rather than err != nil since we + // otherwise misdetect due to insufficient permissions. + return internal.ErrNotSupported + } + if errors.Is(err, unix.EINTR) { + // We know that PROG_TEST_RUN is supported if we get EINTR. + return nil + } + return err }) func (p *Program) testRun(in []byte, repeat int, reset func()) (uint32, []byte, time.Duration, error) { @@ -479,8 +547,11 @@ func unmarshalProgram(buf []byte) (*Program, error) { return NewProgramFromID(ProgramID(id)) } -// MarshalBinary implements BinaryMarshaler. -func (p *Program) MarshalBinary() ([]byte, error) { +func marshalProgram(p *Program, length int) ([]byte, error) { + if length != 4 { + return nil, fmt.Errorf("can't marshal program to %d bytes", length) + } + value, err := p.fd.Value() if err != nil { return nil, err @@ -543,28 +614,28 @@ func (p *Program) Detach(fd int, typ AttachType, flags AttachFlags) error { // LoadPinnedProgram loads a Program from a BPF file. // // Requires at least Linux 4.11. -func LoadPinnedProgram(fileName string) (*Program, error) { - fd, err := internal.BPFObjGet(fileName) +func LoadPinnedProgram(fileName string, opts *LoadPinOptions) (*Program, error) { + fd, err := internal.BPFObjGet(fileName, opts.Marshal()) if err != nil { return nil, err } - name, abi, err := newProgramABIFromFd(fd) + info, err := newProgramInfoFromFd(fd) if err != nil { _ = fd.Close() - return nil, fmt.Errorf("can't get ABI for %s: %w", fileName, err) + return nil, fmt.Errorf("info for %s: %w", fileName, err) } - return newProgram(fd, name, abi), nil + return &Program{"", fd, filepath.Base(fileName), fileName, info.Type}, nil } -// SanitizeName replaces all invalid characters in name. -// -// Use this to automatically generate valid names for maps and -// programs at run time. +// SanitizeName replaces all invalid characters in name with replacement. +// Passing a negative value for replacement will delete characters instead +// of replacing them. Use this to automatically generate valid names for maps +// and programs at runtime. // -// Passing a negative value for replacement will delete characters -// instead of replacing them. +// The set of allowed characters depends on the running kernel version. +// Dots are only allowed as of kernel 5.2. func SanitizeName(name string, replacement rune) string { return strings.Map(func(char rune) rune { if invalidBPFObjNameChar(char) { @@ -582,25 +653,9 @@ func ProgramGetNextID(startID ProgramID) (ProgramID, error) { return ProgramID(id), err } -// NewProgramFromID returns the program for a given id. -// -// Returns ErrNotExist, if there is no eBPF program with the given id. -func NewProgramFromID(id ProgramID) (*Program, error) { - fd, err := bpfObjGetFDByID(internal.BPF_PROG_GET_FD_BY_ID, uint32(id)) - if err != nil { - return nil, err - } - - name, abi, err := newProgramABIFromFd(fd) - if err != nil { - _ = fd.Close() - return nil, err - } - - return newProgram(fd, name, abi), nil -} - // ID returns the systemwide unique ID of the program. +// +// Deprecated: use ProgramInfo.ID() instead. func (p *Program) ID() (ProgramID, error) { info, err := bpfGetProgInfoByFD(p.fd) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/readme.md b/cluster-autoscaler/vendor/github.com/cilium/ebpf/readme.md deleted file mode 100644 index 298db57c300b..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -eBPF -------- -[![PkgGoDev](https://pkg.go.dev/badge/github.com/cilium/ebpf)](https://pkg.go.dev/github.com/cilium/ebpf) - -eBPF is a pure Go library that provides utilities for loading, compiling, and debugging eBPF programs. It has minimal external dependencies and is intended to be used in long running processes. - -* [asm](https://pkg.go.dev/github.com/cilium/ebpf/asm) contains a basic assembler. -* [link](https://pkg.go.dev/github.com/cilium/ebpf/link) allows attaching eBPF to various hooks. -* [perf](https://pkg.go.dev/github.com/cilium/ebpf/perf) allows reading from a PERF_EVENT_ARRAY. -* [cmd/bpf2go](https://pkg.go.dev/github.com/cilium/ebpf/cmd/bpf2go) allows embedding eBPF in Go. - -The library is maintained by [Cloudflare](https://www.cloudflare.com) and [Cilium](https://www.cilium.io). Feel free to [join](https://cilium.herokuapp.com/) the [libbpf-go](https://cilium.slack.com/messages/libbpf-go) channel on Slack. - -## Current status - -The package is production ready, but **the API is explicitly unstable -right now**. Expect to update your code if you want to follow along. - -## Requirements - -* A version of Go that is [supported by upstream](https://golang.org/doc/devel/release.html#policy) -* Linux 4.9, 4.19 or 5.4 (versions in-between should work, but are not tested) - -## Useful resources - -* [eBPF.io](https://ebpf.io) (recommended) -* [Cilium eBPF documentation](https://docs.cilium.io/en/latest/bpf/#bpf-guide) (recommended) -* [Linux documentation on BPF](http://elixir.free-electrons.com/linux/latest/source/Documentation/networking/filter.txt) -* [eBPF features by Linux version](https://github.com/iovisor/bcc/blob/master/docs/kernel-versions.md) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/run-tests.sh b/cluster-autoscaler/vendor/github.com/cilium/ebpf/run-tests.sh index bd349f95160e..ed8679fa6638 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/run-tests.sh +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/run-tests.sh @@ -9,6 +9,7 @@ if [[ "${1:-}" = "--in-vm" ]]; then shift mount -t bpf bpf /sys/fs/bpf + mount -t tracefs tracefs /sys/kernel/debug/tracing export CGO_ENABLED=0 export GOFLAGS=-mod=readonly export GOPATH=/run/go-path @@ -16,16 +17,16 @@ if [[ "${1:-}" = "--in-vm" ]]; then export GOSUMDB=off export GOCACHE=/run/go-cache - elfs="" if [[ -d "/run/input/bpf" ]]; then - elfs="/run/input/bpf" + export KERNEL_SELFTESTS="/run/input/bpf" fi + readonly output="${1}" + shift + echo Running tests... - # TestLibBPFCompat runs separately to pass the "-elfs" flag only for it: https://github.com/cilium/ebpf/pull/119 - go test -v -count 1 -run TestLibBPFCompat -elfs "$elfs" - go test -v -count 1 ./... - touch "$1/success" + go test -v -coverpkg=./... -coverprofile="$output/coverage.txt" -count 1 ./... + touch "$output/success" exit 0 fi @@ -82,11 +83,9 @@ if [[ ! -e "${output}/success" ]]; then exit 1 else echo "Test successful on ${kernel_version}" -# if [[ -v CODECOV_TOKEN ]]; then -# curl --fail -s https://codecov.io/bash > "${tmp_dir}/codecov.sh" -# chmod +x "${tmp_dir}/codecov.sh" -# "${tmp_dir}/codecov.sh" -f "${output}/coverage.txt" -# fi + if [[ -v COVERALLS_TOKEN ]]; then + goveralls -coverprofile="${output}/coverage.txt" -service=semaphore -repotoken "$COVERALLS_TOKEN" + fi fi $sudo rm -r "${input}" diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/syscalls.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/syscalls.go index ff5c8e6c3c32..c530aadd9a5b 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/syscalls.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/syscalls.go @@ -3,7 +3,6 @@ package ebpf import ( "errors" "fmt" - "os" "unsafe" "github.com/cilium/ebpf/internal" @@ -12,9 +11,7 @@ import ( ) // Generic errors returned by BPF syscalls. -var ( - ErrNotExist = errors.New("requested object does not exist") -) +var ErrNotExist = errors.New("requested object does not exist") // bpfObjName is a null-terminated string made up of // 'A-Za-z0-9_' characters. @@ -27,18 +24,20 @@ func newBPFObjName(name string) bpfObjName { return result } +// invalidBPFObjNameChar returns true if char may not appear in +// a BPF object name. func invalidBPFObjNameChar(char rune) bool { dotAllowed := objNameAllowsDot() == nil switch { case char >= 'A' && char <= 'Z': - fallthrough + return false case char >= 'a' && char <= 'z': - fallthrough + return false case char >= '0' && char <= '9': - fallthrough + return false case dotAllowed && char == '.': - fallthrough + return false case char == '_': return false default: @@ -69,14 +68,32 @@ type bpfMapOpAttr struct { flags uint64 } +type bpfBatchMapOpAttr struct { + inBatch internal.Pointer + outBatch internal.Pointer + keys internal.Pointer + values internal.Pointer + count uint32 + mapFd uint32 + elemFlags uint64 + flags uint64 +} + type bpfMapInfo struct { - mapType uint32 - id uint32 - keySize uint32 - valueSize uint32 - maxEntries uint32 - flags uint32 - mapName bpfObjName // since 4.15 ad5b177bd73f + map_type uint32 // since 4.12 1e2709769086 + id uint32 + key_size uint32 + value_size uint32 + max_entries uint32 + map_flags uint32 + name bpfObjName // since 4.15 ad5b177bd73f + ifindex uint32 // since 4.16 52775b33bb50 + btf_vmlinux_value_type_id uint32 // since 5.6 85d33df357b6 + netns_dev uint64 // since 4.16 52775b33bb50 + netns_ino uint64 + btf_id uint32 // since 4.18 78958fca7ead + btf_key_type_id uint32 // since 4.18 9b2cf328b2ec + btf_value_type_id uint32 } type bpfProgLoadAttr struct { @@ -104,18 +121,40 @@ type bpfProgLoadAttr struct { } type bpfProgInfo struct { - progType uint32 - id uint32 - tag [unix.BPF_TAG_SIZE]byte - jitedLen uint32 - xlatedLen uint32 - jited internal.Pointer - xlated internal.Pointer - loadTime uint64 // since 4.15 cb4d2b3f03d8 - createdByUID uint32 - nrMapIDs uint32 - mapIds internal.Pointer - name bpfObjName + prog_type uint32 + id uint32 + tag [unix.BPF_TAG_SIZE]byte + jited_prog_len uint32 + xlated_prog_len uint32 + jited_prog_insns internal.Pointer + xlated_prog_insns internal.Pointer + load_time uint64 // since 4.15 cb4d2b3f03d8 + created_by_uid uint32 + nr_map_ids uint32 + map_ids internal.Pointer + name bpfObjName // since 4.15 067cae47771c + ifindex uint32 + gpl_compatible uint32 + netns_dev uint64 + netns_ino uint64 + nr_jited_ksyms uint32 + nr_jited_func_lens uint32 + jited_ksyms internal.Pointer + jited_func_lens internal.Pointer + btf_id uint32 + func_info_rec_size uint32 + func_info internal.Pointer + nr_func_info uint32 + nr_line_info uint32 + line_info internal.Pointer + jited_line_info internal.Pointer + nr_jited_line_info uint32 + line_info_rec_size uint32 + jited_line_info_rec_size uint32 + nr_prog_tags uint32 + prog_tags internal.Pointer + run_time_ns uint64 + run_cnt uint64 } type bpfProgTestRunAttr struct { @@ -168,10 +207,6 @@ func bpfProgTestRun(attr *bpfProgTestRunAttr) error { func bpfMapCreate(attr *bpfMapCreateAttr) (*internal.FD, error) { fd, err := internal.BPF(internal.BPF_MAP_CREATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if errors.Is(err, os.ErrPermission) { - return nil, errors.New("permission denied or insufficient rlimit to lock memory for map") - } - if err != nil { return nil, err } @@ -179,35 +214,25 @@ func bpfMapCreate(attr *bpfMapCreateAttr) (*internal.FD, error) { return internal.NewFD(uint32(fd)), nil } -var haveNestedMaps = internal.FeatureTest("nested maps", "4.12", func() (bool, error) { - inner, err := bpfMapCreate(&bpfMapCreateAttr{ - mapType: Array, - keySize: 4, - valueSize: 4, - maxEntries: 1, - }) - if err != nil { - return false, err - } - defer inner.Close() - - innerFd, _ := inner.Value() - nested, err := bpfMapCreate(&bpfMapCreateAttr{ +var haveNestedMaps = internal.FeatureTest("nested maps", "4.12", func() error { + _, err := bpfMapCreate(&bpfMapCreateAttr{ mapType: ArrayOfMaps, keySize: 4, valueSize: 4, maxEntries: 1, - innerMapFd: innerFd, + // Invalid file descriptor. + innerMapFd: ^uint32(0), }) - if err != nil { - return false, nil + if errors.Is(err, unix.EINVAL) { + return internal.ErrNotSupported } - - _ = nested.Close() - return true, nil + if errors.Is(err, unix.EBADF) { + return nil + } + return err }) -var haveMapMutabilityModifiers = internal.FeatureTest("read- and write-only maps", "5.2", func() (bool, error) { +var haveMapMutabilityModifiers = internal.FeatureTest("read- and write-only maps", "5.2", func() error { // This checks BPF_F_RDONLY_PROG and BPF_F_WRONLY_PROG. Since // BPF_MAP_FREEZE appeared in 5.2 as well we don't do a separate check. m, err := bpfMapCreate(&bpfMapCreateAttr{ @@ -218,10 +243,10 @@ var haveMapMutabilityModifiers = internal.FeatureTest("read- and write-only maps flags: unix.BPF_F_RDONLY_PROG, }) if err != nil { - return false, nil + return internal.ErrNotSupported } _ = m.Close() - return true, nil + return nil }) func bpfMapLookupElem(m *internal.FD, key, valueOut internal.Pointer) error { @@ -307,6 +332,29 @@ func objGetNextID(cmd internal.BPFCmd, start uint32) (uint32, error) { return attr.nextID, wrapObjError(err) } +func bpfMapBatch(cmd internal.BPFCmd, m *internal.FD, inBatch, outBatch, keys, values internal.Pointer, count uint32, opts *BatchOptions) (uint32, error) { + fd, err := m.Value() + if err != nil { + return 0, err + } + + attr := bpfBatchMapOpAttr{ + inBatch: inBatch, + outBatch: outBatch, + keys: keys, + values: values, + count: count, + mapFd: fd, + } + if opts != nil { + attr.elemFlags = opts.ElemFlags + attr.flags = opts.Flags + } + _, err = internal.BPF(cmd, unsafe.Pointer(&attr), unsafe.Sizeof(attr)) + // always return count even on an error, as things like update might partially be fulfilled. + return attr.count, wrapMapError(err) +} + func wrapObjError(err error) error { if err == nil { return nil @@ -331,7 +379,11 @@ func wrapMapError(err error) error { return ErrKeyExist } - return errors.New(err.Error()) + if errors.Is(err, unix.ENOTSUPP) { + return ErrNotSupported + } + + return err } func bpfMapFreeze(m *internal.FD) error { @@ -364,7 +416,7 @@ func bpfGetMapInfoByFD(fd *internal.FD) (*bpfMapInfo, error) { return &info, nil } -var haveObjName = internal.FeatureTest("object names", "4.15", func() (bool, error) { +var haveObjName = internal.FeatureTest("object names", "4.15", func() error { attr := bpfMapCreateAttr{ mapType: Array, keySize: 4, @@ -375,16 +427,16 @@ var haveObjName = internal.FeatureTest("object names", "4.15", func() (bool, err fd, err := bpfMapCreate(&attr) if err != nil { - return false, nil + return internal.ErrNotSupported } _ = fd.Close() - return true, nil + return nil }) -var objNameAllowsDot = internal.FeatureTest("dot in object names", "5.2", func() (bool, error) { +var objNameAllowsDot = internal.FeatureTest("dot in object names", "5.2", func() error { if err := haveObjName(); err != nil { - return false, err + return err } attr := bpfMapCreateAttr{ @@ -397,11 +449,37 @@ var objNameAllowsDot = internal.FeatureTest("dot in object names", "5.2", func() fd, err := bpfMapCreate(&attr) if err != nil { - return false, nil + return internal.ErrNotSupported } _ = fd.Close() - return true, nil + return nil +}) + +var haveBatchAPI = internal.FeatureTest("map batch api", "5.6", func() error { + var maxEntries uint32 = 2 + attr := bpfMapCreateAttr{ + mapType: Hash, + keySize: 4, + valueSize: 4, + maxEntries: maxEntries, + } + + fd, err := bpfMapCreate(&attr) + if err != nil { + return internal.ErrNotSupported + } + defer fd.Close() + keys := []uint32{1, 2} + values := []uint32{3, 4} + kp, _ := marshalPtr(keys, 8) + vp, _ := marshalPtr(values, 8) + nilPtr := internal.NewPointer(nil) + _, err = bpfMapBatch(internal.BPF_MAP_UPDATE_BATCH, fd, nilPtr, nilPtr, kp, vp, maxEntries, nil) + if err != nil { + return internal.ErrNotSupported + } + return nil }) func bpfObjGetFDByID(cmd internal.BPFCmd, id uint32) (*internal.FD, error) { diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/types.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/types.go index dd82dfd4d431..f4d1a8c41006 100644 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/types.go +++ b/cluster-autoscaler/vendor/github.com/cilium/ebpf/types.go @@ -1,5 +1,9 @@ package ebpf +import ( + "github.com/cilium/ebpf/internal/unix" +) + //go:generate stringer -output types_string.go -type=MapType,ProgramType,AttachType,PinType // MapType indicates the type map structure @@ -85,10 +89,19 @@ const ( // hasPerCPUValue returns true if the Map stores a value per CPU. func (mt MapType) hasPerCPUValue() bool { - if mt == PerCPUHash || mt == PerCPUArray || mt == LRUCPUHash { - return true - } - return false + return mt == PerCPUHash || mt == PerCPUArray || mt == LRUCPUHash +} + +// canStoreMap returns true if the map type accepts a map fd +// for update and returns a map id for lookup. +func (mt MapType) canStoreMap() bool { + return mt == ArrayOfMaps || mt == HashOfMaps +} + +// canStoreProgram returns true if the map type accepts a program fd +// for update and returns a program id for lookup. +func (mt MapType) canStoreProgram() bool { + return mt == ProgramArray } // ProgramType of the eBPF program @@ -134,7 +147,7 @@ const ( // Will cause invalid argument (EINVAL) at program load time if set incorrectly. type AttachType uint32 -// AttachNone is an alias for AttachCGroupInetIngress for readability reasons +// AttachNone is an alias for AttachCGroupInetIngress for readability reasons. const AttachNone AttachType = 0 const ( @@ -192,3 +205,40 @@ const ( // Pin an object by using its name as the filename. PinByName ) + +// LoadPinOptions control how a pinned object is loaded. +type LoadPinOptions struct { + // Request a read-only or write-only object. The default is a read-write + // object. Only one of the flags may be set. + ReadOnly bool + WriteOnly bool + + // Raw flags for the syscall. Other fields of this struct take precedence. + Flags uint32 +} + +// Marshal returns a value suitable for BPF_OBJ_GET syscall file_flags parameter. +func (lpo *LoadPinOptions) Marshal() uint32 { + if lpo == nil { + return 0 + } + + flags := lpo.Flags + if lpo.ReadOnly { + flags |= unix.BPF_F_RDONLY + } + if lpo.WriteOnly { + flags |= unix.BPF_F_WRONLY + } + return flags +} + +// BatchOptions batch map operations options +// +// Mirrors libbpf struct bpf_map_batch_opts +// Currently BPF_F_FLAG is the only supported +// flag (for ElemFlags). +type BatchOptions struct { + ElemFlags uint64 + Flags uint64 +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/README.md b/cluster-autoscaler/vendor/github.com/containerd/console/README.md index 5392fdaf1952..580b461a73db 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/README.md +++ b/cluster-autoscaler/vendor/github.com/containerd/console/README.md @@ -1,6 +1,8 @@ # console -[![Build Status](https://travis-ci.org/containerd/console.svg?branch=master)](https://travis-ci.org/containerd/console) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/console)](https://pkg.go.dev/github.com/containerd/console) +[![Build Status](https://github.com/containerd/console/workflows/CI/badge.svg)](https://github.com/containerd/console/actions?query=workflow%3ACI) +[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/console)](https://goreportcard.com/report/github.com/containerd/console) Golang package for dealing with consoles. Light on deps and a simple API. diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/console_unix.go b/cluster-autoscaler/vendor/github.com/containerd/console/console_unix.go index a78687523a34..a08117695e32 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/console_unix.go +++ b/cluster-autoscaler/vendor/github.com/containerd/console/console_unix.go @@ -19,8 +19,6 @@ package console import ( - "os" - "golang.org/x/sys/unix" ) @@ -28,7 +26,7 @@ import ( // The master is returned as the first console and a string // with the path to the pty slave is returned as the second func NewPty() (Console, string, error) { - f, err := os.OpenFile("/dev/ptmx", unix.O_RDWR|unix.O_NOCTTY|unix.O_CLOEXEC, 0) + f, err := openpt() if err != nil { return nil, "", err } diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/go.mod b/cluster-autoscaler/vendor/github.com/containerd/console/go.mod index 60bf028ee523..7fca0a9a3ac1 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/go.mod +++ b/cluster-autoscaler/vendor/github.com/containerd/console/go.mod @@ -4,5 +4,5 @@ go 1.13 require ( github.com/pkg/errors v0.9.1 - golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f + golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c ) diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/go.sum b/cluster-autoscaler/vendor/github.com/containerd/console/go.sum index 6b9363c40a93..9db384d3b006 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/go.sum +++ b/cluster-autoscaler/vendor/github.com/containerd/console/go.sum @@ -1,4 +1,4 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f h1:6Sc1XOXTulBN6imkqo6XoAXDEzoQ4/ro6xy7Vn8+rOM= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/pty_freebsd_cgo.go b/cluster-autoscaler/vendor/github.com/containerd/console/pty_freebsd_cgo.go new file mode 100644 index 000000000000..cbd3cd7ea43d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/console/pty_freebsd_cgo.go @@ -0,0 +1,45 @@ +// +build freebsd,cgo + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package console + +import ( + "fmt" + "os" +) + +/* +#include +#include +#include +*/ +import "C" + +// openpt allocates a new pseudo-terminal and establishes a connection with its +// control device. +func openpt() (*os.File, error) { + fd, err := C.posix_openpt(C.O_RDWR) + if err != nil { + return nil, fmt.Errorf("posix_openpt: %w", err) + } + if _, err := C.grantpt(fd); err != nil { + C.close(fd) + return nil, fmt.Errorf("grantpt: %w", err) + } + return os.NewFile(uintptr(fd), ""), nil +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/pty_freebsd_nocgo.go b/cluster-autoscaler/vendor/github.com/containerd/console/pty_freebsd_nocgo.go new file mode 100644 index 000000000000..b5e43181d4f3 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/console/pty_freebsd_nocgo.go @@ -0,0 +1,36 @@ +// +build freebsd,!cgo + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package console + +import ( + "os" +) + +// +// Implementing the functions below requires cgo support. Non-cgo stubs +// versions are defined below to enable cross-compilation of source code +// that depends on these functions, but the resultant cross-compiled +// binaries cannot actually be used. If the stub function(s) below are +// actually invoked they will display an error message and cause the +// calling process to exit. +// + +func openpt() (*os.File, error) { + panic("openpt() support requires cgo.") +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/pty_unix.go b/cluster-autoscaler/vendor/github.com/containerd/console/pty_unix.go new file mode 100644 index 000000000000..d5a6bd8ca2e8 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/console/pty_unix.go @@ -0,0 +1,30 @@ +// +build darwin linux netbsd openbsd solaris + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package console + +import ( + "os" + + "golang.org/x/sys/unix" +) + +// openpt allocates a new pseudo-terminal by opening the /dev/ptmx device +func openpt() (*os.File, error) { + return os.OpenFile("/dev/ptmx", unix.O_RDWR|unix.O_NOCTTY|unix.O_CLOEXEC, 0) +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd.go b/cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd_cgo.go similarity index 85% rename from cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd.go rename to cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd_cgo.go index 04583a615698..0f3d27273094 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd.go +++ b/cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd_cgo.go @@ -1,3 +1,5 @@ +// +build freebsd,cgo + /* Copyright The containerd Authors. @@ -23,6 +25,12 @@ import ( "golang.org/x/sys/unix" ) +/* +#include +#include +*/ +import "C" + const ( cmdTcGet = unix.TIOCGETA cmdTcSet = unix.TIOCSETA @@ -30,8 +38,12 @@ const ( // unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. // unlockpt should be called before opening the slave side of a pty. -// This does not exist on FreeBSD, it does not allocate controlling terminals on open func unlockpt(f *os.File) error { + fd := C.int(f.Fd()) + if _, err := C.unlockpt(fd); err != nil { + C.close(fd) + return fmt.Errorf("unlockpt: %w", err) + } return nil } diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd_nocgo.go b/cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd_nocgo.go new file mode 100644 index 000000000000..087fc158a169 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/containerd/console/tc_freebsd_nocgo.go @@ -0,0 +1,55 @@ +// +build freebsd,!cgo + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package console + +import ( + "fmt" + "os" + + "golang.org/x/sys/unix" +) + +const ( + cmdTcGet = unix.TIOCGETA + cmdTcSet = unix.TIOCSETA +) + +// +// Implementing the functions below requires cgo support. Non-cgo stubs +// versions are defined below to enable cross-compilation of source code +// that depends on these functions, but the resultant cross-compiled +// binaries cannot actually be used. If the stub function(s) below are +// actually invoked they will display an error message and cause the +// calling process to exit. +// + +// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. +// unlockpt should be called before opening the slave side of a pty. +func unlockpt(f *os.File) error { + panic("unlockpt() support requires cgo.") +} + +// ptsname retrieves the name of the first available pts for the given master. +func ptsname(f *os.File) (string, error) { + n, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN) + if err != nil { + return "", err + } + return fmt.Sprintf("/dev/pts/%d", n), nil +} diff --git a/cluster-autoscaler/vendor/github.com/containerd/console/tc_linux.go b/cluster-autoscaler/vendor/github.com/containerd/console/tc_linux.go index 75f8694f7fc8..7d552ea4ba13 100644 --- a/cluster-autoscaler/vendor/github.com/containerd/console/tc_linux.go +++ b/cluster-autoscaler/vendor/github.com/containerd/console/tc_linux.go @@ -19,6 +19,7 @@ package console import ( "fmt" "os" + "unsafe" "golang.org/x/sys/unix" ) @@ -31,13 +32,19 @@ const ( // unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. // unlockpt should be called before opening the slave side of a pty. func unlockpt(f *os.File) error { - return unix.IoctlSetPointerInt(int(f.Fd()), unix.TIOCSPTLCK, 0) + var u int32 + // XXX do not use unix.IoctlSetPointerInt here, see commit dbd69c59b81. + if _, _, err := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))); err != 0 { + return err + } + return nil } // ptsname retrieves the name of the first available pts for the given master. func ptsname(f *os.File) (string, error) { - u, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN) - if err != nil { + var u uint32 + // XXX do not use unix.IoctlGetInt here, see commit dbd69c59b81. + if _, _, err := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.TIOCGPTN, uintptr(unsafe.Pointer(&u))); err != 0 { return "", err } return fmt.Sprintf("/dev/pts/%d", u), nil diff --git a/cluster-autoscaler/vendor/github.com/containernetworking/cni/pkg/invoke/find.go b/cluster-autoscaler/vendor/github.com/containernetworking/cni/pkg/invoke/find.go index e815404c8591..e62029eb788b 100644 --- a/cluster-autoscaler/vendor/github.com/containernetworking/cni/pkg/invoke/find.go +++ b/cluster-autoscaler/vendor/github.com/containernetworking/cni/pkg/invoke/find.go @@ -18,6 +18,7 @@ import ( "fmt" "os" "path/filepath" + "strings" ) // FindInPath returns the full path of the plugin by searching in the provided path @@ -26,6 +27,10 @@ func FindInPath(plugin string, paths []string) (string, error) { return "", fmt.Errorf("no plugin name provided") } + if strings.ContainsRune(plugin, os.PathSeparator) { + return "", fmt.Errorf("invalid plugin name: %s", plugin) + } + if len(paths) == 0 { return "", fmt.Errorf("no paths provided") } diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/dbus.go b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/dbus.go index 91584a1668e4..e843a4613d51 100644 --- a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/dbus.go +++ b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/dbus.go @@ -16,6 +16,7 @@ package dbus import ( + "context" "encoding/hex" "fmt" "os" @@ -112,39 +113,63 @@ type Conn struct { // New establishes a connection to any available bus and authenticates. // Callers should call Close() when done with the connection. +// Deprecated: use NewWithContext instead func New() (*Conn, error) { - conn, err := NewSystemConnection() + return NewWithContext(context.Background()) +} + +// NewWithContext same as New with context +func NewWithContext(ctx context.Context) (*Conn, error) { + conn, err := NewSystemConnectionContext(ctx) if err != nil && os.Geteuid() == 0 { - return NewSystemdConnection() + return NewSystemdConnectionContext(ctx) } return conn, err } // NewSystemConnection establishes a connection to the system bus and authenticates. // Callers should call Close() when done with the connection +// Deprecated: use NewSystemConnectionContext instead func NewSystemConnection() (*Conn, error) { + return NewSystemConnectionContext(context.Background()) +} + +// NewSystemConnectionContext same as NewSystemConnection with context +func NewSystemConnectionContext(ctx context.Context) (*Conn, error) { return NewConnection(func() (*dbus.Conn, error) { - return dbusAuthHelloConnection(dbus.SystemBusPrivate) + return dbusAuthHelloConnection(ctx, dbus.SystemBusPrivate) }) } // NewUserConnection establishes a connection to the session bus and // authenticates. This can be used to connect to systemd user instances. // Callers should call Close() when done with the connection. +// Deprecated: use NewUserConnectionContext instead func NewUserConnection() (*Conn, error) { + return NewUserConnectionContext(context.Background()) +} + +// NewUserConnectionContext same as NewUserConnection with context +func NewUserConnectionContext(ctx context.Context) (*Conn, error) { return NewConnection(func() (*dbus.Conn, error) { - return dbusAuthHelloConnection(dbus.SessionBusPrivate) + return dbusAuthHelloConnection(ctx, dbus.SessionBusPrivate) }) } // NewSystemdConnection establishes a private, direct connection to systemd. // This can be used for communicating with systemd without a dbus daemon. // Callers should call Close() when done with the connection. +// Deprecated: use NewSystemdConnectionContext instead func NewSystemdConnection() (*Conn, error) { + return NewSystemdConnectionContext(context.Background()) +} + +// NewSystemdConnectionContext same as NewSystemdConnection with context +func NewSystemdConnectionContext(ctx context.Context) (*Conn, error) { return NewConnection(func() (*dbus.Conn, error) { // We skip Hello when talking directly to systemd. - return dbusAuthConnection(func(opts ...dbus.ConnOption) (*dbus.Conn, error) { - return dbus.Dial("unix:path=/run/systemd/private") + return dbusAuthConnection(ctx, func(opts ...dbus.ConnOption) (*dbus.Conn, error) { + return dbus.Dial("unix:path=/run/systemd/private", opts...) }) }) } @@ -201,8 +226,8 @@ func (c *Conn) GetManagerProperty(prop string) (string, error) { return variant.String(), nil } -func dbusAuthConnection(createBus func(opts ...dbus.ConnOption) (*dbus.Conn, error)) (*dbus.Conn, error) { - conn, err := createBus() +func dbusAuthConnection(ctx context.Context, createBus func(opts ...dbus.ConnOption) (*dbus.Conn, error)) (*dbus.Conn, error) { + conn, err := createBus(dbus.WithContext(ctx)) if err != nil { return nil, err } @@ -221,8 +246,8 @@ func dbusAuthConnection(createBus func(opts ...dbus.ConnOption) (*dbus.Conn, err return conn, nil } -func dbusAuthHelloConnection(createBus func(opts ...dbus.ConnOption) (*dbus.Conn, error)) (*dbus.Conn, error) { - conn, err := dbusAuthConnection(createBus) +func dbusAuthHelloConnection(ctx context.Context, createBus func(opts ...dbus.ConnOption) (*dbus.Conn, error)) (*dbus.Conn, error) { + conn, err := dbusAuthConnection(ctx, createBus) if err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/methods.go b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/methods.go index e38659d7be19..01879ba1580a 100644 --- a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/methods.go +++ b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/methods.go @@ -15,6 +15,7 @@ package dbus import ( + "context" "errors" "fmt" "path" @@ -23,6 +24,18 @@ import ( "github.com/godbus/dbus/v5" ) +// Who can be used to specify which process to kill in the unit via the KillUnitWithTarget API +type Who string + +const ( + // All sends the signal to all processes in the unit + All Who = "all" + // Main sends the signal to the main process of the unit + Main Who = "main" + // Control sends the signal to the control process of the unit + Control Who = "control" +) + func (c *Conn) jobComplete(signal *dbus.Signal) { var id uint32 var job dbus.ObjectPath @@ -38,14 +51,14 @@ func (c *Conn) jobComplete(signal *dbus.Signal) { c.jobListener.Unlock() } -func (c *Conn) startJob(ch chan<- string, job string, args ...interface{}) (int, error) { +func (c *Conn) startJob(ctx context.Context, ch chan<- string, job string, args ...interface{}) (int, error) { if ch != nil { c.jobListener.Lock() defer c.jobListener.Unlock() } var p dbus.ObjectPath - err := c.sysobj.Call(job, 0, args...).Store(&p) + err := c.sysobj.CallWithContext(ctx, job, 0, args...).Store(&p) if err != nil { return 0, err } @@ -90,43 +103,85 @@ func (c *Conn) startJob(ch chan<- string, job string, args ...interface{}) (int, // should not be considered authoritative. // // If an error does occur, it will be returned to the user alongside a job ID of 0. +// Deprecated: use StartUnitContext instead func (c *Conn) StartUnit(name string, mode string, ch chan<- string) (int, error) { - return c.startJob(ch, "org.freedesktop.systemd1.Manager.StartUnit", name, mode) + return c.StartUnitContext(context.Background(), name, mode, ch) +} + +// StartUnitContext same as StartUnit with context +func (c *Conn) StartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { + return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.StartUnit", name, mode) } // StopUnit is similar to StartUnit but stops the specified unit rather // than starting it. +// Deprecated: use StopUnitContext instead func (c *Conn) StopUnit(name string, mode string, ch chan<- string) (int, error) { - return c.startJob(ch, "org.freedesktop.systemd1.Manager.StopUnit", name, mode) + return c.StopUnitContext(context.Background(), name, mode, ch) +} + +// StopUnitContext same as StopUnit with context +func (c *Conn) StopUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { + return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.StopUnit", name, mode) } // ReloadUnit reloads a unit. Reloading is done only if the unit is already running and fails otherwise. +// Deprecated: use ReloadUnitContext instead func (c *Conn) ReloadUnit(name string, mode string, ch chan<- string) (int, error) { - return c.startJob(ch, "org.freedesktop.systemd1.Manager.ReloadUnit", name, mode) + return c.ReloadUnitContext(context.Background(), name, mode, ch) +} + +// ReloadUnitContext same as ReloadUnit with context +func (c *Conn) ReloadUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { + return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.ReloadUnit", name, mode) } // RestartUnit restarts a service. If a service is restarted that isn't // running it will be started. +// Deprecated: use RestartUnitContext instead func (c *Conn) RestartUnit(name string, mode string, ch chan<- string) (int, error) { - return c.startJob(ch, "org.freedesktop.systemd1.Manager.RestartUnit", name, mode) + return c.RestartUnitContext(context.Background(), name, mode, ch) +} + +// RestartUnitContext same as RestartUnit with context +func (c *Conn) RestartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { + return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.RestartUnit", name, mode) } // TryRestartUnit is like RestartUnit, except that a service that isn't running // is not affected by the restart. +// Deprecated: use TryRestartUnitContext instead func (c *Conn) TryRestartUnit(name string, mode string, ch chan<- string) (int, error) { - return c.startJob(ch, "org.freedesktop.systemd1.Manager.TryRestartUnit", name, mode) + return c.TryRestartUnitContext(context.Background(), name, mode, ch) +} + +// TryRestartUnitContext same as TryRestartUnit with context +func (c *Conn) TryRestartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { + return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.TryRestartUnit", name, mode) } // ReloadOrRestartUnit attempts a reload if the unit supports it and use a restart // otherwise. +// Deprecated: use ReloadOrRestartUnitContext instead func (c *Conn) ReloadOrRestartUnit(name string, mode string, ch chan<- string) (int, error) { - return c.startJob(ch, "org.freedesktop.systemd1.Manager.ReloadOrRestartUnit", name, mode) + return c.ReloadOrRestartUnitContext(context.Background(), name, mode, ch) +} + +// ReloadOrRestartUnitContext same as ReloadOrRestartUnit with context +func (c *Conn) ReloadOrRestartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { + return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.ReloadOrRestartUnit", name, mode) } // ReloadOrTryRestartUnit attempts a reload if the unit supports it and use a "Try" // flavored restart otherwise. +// Deprecated: use ReloadOrTryRestartUnitContext instead func (c *Conn) ReloadOrTryRestartUnit(name string, mode string, ch chan<- string) (int, error) { - return c.startJob(ch, "org.freedesktop.systemd1.Manager.ReloadOrTryRestartUnit", name, mode) + return c.ReloadOrTryRestartUnitContext(context.Background(), name, mode, ch) +} + +// ReloadOrTryRestartUnitContext same as ReloadOrTryRestartUnit with context +func (c *Conn) ReloadOrTryRestartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { + return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.ReloadOrTryRestartUnit", name, mode) } // StartTransientUnit() may be used to create and start a transient unit, which @@ -134,28 +189,57 @@ func (c *Conn) ReloadOrTryRestartUnit(name string, mode string, ch chan<- string // system is rebooted. name is the unit name including suffix, and must be // unique. mode is the same as in StartUnit(), properties contains properties // of the unit. +// Deprecated: use StartTransientUnitContext instead func (c *Conn) StartTransientUnit(name string, mode string, properties []Property, ch chan<- string) (int, error) { - return c.startJob(ch, "org.freedesktop.systemd1.Manager.StartTransientUnit", name, mode, properties, make([]PropertyCollection, 0)) + return c.StartTransientUnitContext(context.Background(), name, mode, properties, ch) +} + +// StartTransientUnitContext same as StartTransientUnit with context +func (c *Conn) StartTransientUnitContext(ctx context.Context, name string, mode string, properties []Property, ch chan<- string) (int, error) { + return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.StartTransientUnit", name, mode, properties, make([]PropertyCollection, 0)) } // KillUnit takes the unit name and a UNIX signal number to send. All of the unit's // processes are killed. +// Deprecated: use KillUnitContext instead func (c *Conn) KillUnit(name string, signal int32) { - c.sysobj.Call("org.freedesktop.systemd1.Manager.KillUnit", 0, name, "all", signal).Store() + c.KillUnitContext(context.Background(), name, signal) +} + +// KillUnitContext same as KillUnit with context +func (c *Conn) KillUnitContext(ctx context.Context, name string, signal int32) { + c.KillUnitWithTarget(ctx, name, All, signal) +} + +// KillUnitWithTarget is like KillUnitContext, but allows you to specify which process in the unit to send the signal to +func (c *Conn) KillUnitWithTarget(ctx context.Context, name string, target Who, signal int32) error { + return c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.KillUnit", 0, name, string(target), signal).Store() } // ResetFailedUnit resets the "failed" state of a specific unit. +// Deprecated: use ResetFailedUnitContext instead func (c *Conn) ResetFailedUnit(name string) error { - return c.sysobj.Call("org.freedesktop.systemd1.Manager.ResetFailedUnit", 0, name).Store() + return c.ResetFailedUnitContext(context.Background(), name) +} + +// ResetFailedUnitContext same as ResetFailedUnit with context +func (c *Conn) ResetFailedUnitContext(ctx context.Context, name string) error { + return c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ResetFailedUnit", 0, name).Store() } // SystemState returns the systemd state. Equivalent to `systemctl is-system-running`. +// Deprecated: use SystemStateContext instead func (c *Conn) SystemState() (*Property, error) { + return c.SystemStateContext(context.Background()) +} + +// SystemStateContext same as SystemState with context +func (c *Conn) SystemStateContext(ctx context.Context) (*Property, error) { var err error var prop dbus.Variant obj := c.sysconn.Object("org.freedesktop.systemd1", "/org/freedesktop/systemd1") - err = obj.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.systemd1.Manager", "SystemState").Store(&prop) + err = obj.CallWithContext(ctx, "org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.systemd1.Manager", "SystemState").Store(&prop) if err != nil { return nil, err } @@ -164,7 +248,7 @@ func (c *Conn) SystemState() (*Property, error) { } // getProperties takes the unit path and returns all of its dbus object properties, for the given dbus interface -func (c *Conn) getProperties(path dbus.ObjectPath, dbusInterface string) (map[string]interface{}, error) { +func (c *Conn) getProperties(ctx context.Context, path dbus.ObjectPath, dbusInterface string) (map[string]interface{}, error) { var err error var props map[string]dbus.Variant @@ -173,7 +257,7 @@ func (c *Conn) getProperties(path dbus.ObjectPath, dbusInterface string) (map[st } obj := c.sysconn.Object("org.freedesktop.systemd1", path) - err = obj.Call("org.freedesktop.DBus.Properties.GetAll", 0, dbusInterface).Store(&props) + err = obj.CallWithContext(ctx, "org.freedesktop.DBus.Properties.GetAll", 0, dbusInterface).Store(&props) if err != nil { return nil, err } @@ -187,23 +271,41 @@ func (c *Conn) getProperties(path dbus.ObjectPath, dbusInterface string) (map[st } // GetUnitProperties takes the (unescaped) unit name and returns all of its dbus object properties. +// Deprecated: use GetUnitPropertiesContext instead func (c *Conn) GetUnitProperties(unit string) (map[string]interface{}, error) { + return c.GetUnitPropertiesContext(context.Background(), unit) +} + +// GetUnitPropertiesContext same as GetUnitPropertiesContext with context +func (c *Conn) GetUnitPropertiesContext(ctx context.Context, unit string) (map[string]interface{}, error) { path := unitPath(unit) - return c.getProperties(path, "org.freedesktop.systemd1.Unit") + return c.getProperties(ctx, path, "org.freedesktop.systemd1.Unit") } // GetUnitPathProperties takes the (escaped) unit path and returns all of its dbus object properties. +// Deprecated: use GetUnitPathPropertiesContext instead func (c *Conn) GetUnitPathProperties(path dbus.ObjectPath) (map[string]interface{}, error) { - return c.getProperties(path, "org.freedesktop.systemd1.Unit") + return c.GetUnitPathPropertiesContext(context.Background(), path) +} + +// GetUnitPathPropertiesContext same as GetUnitPathProperties with context +func (c *Conn) GetUnitPathPropertiesContext(ctx context.Context, path dbus.ObjectPath) (map[string]interface{}, error) { + return c.getProperties(ctx, path, "org.freedesktop.systemd1.Unit") } // GetAllProperties takes the (unescaped) unit name and returns all of its dbus object properties. +// Deprecated: use GetAllPropertiesContext instead func (c *Conn) GetAllProperties(unit string) (map[string]interface{}, error) { + return c.GetAllPropertiesContext(context.Background(), unit) +} + +// GetAllPropertiesContext same as GetAllProperties with context +func (c *Conn) GetAllPropertiesContext(ctx context.Context, unit string) (map[string]interface{}, error) { path := unitPath(unit) - return c.getProperties(path, "") + return c.getProperties(ctx, path, "") } -func (c *Conn) getProperty(unit string, dbusInterface string, propertyName string) (*Property, error) { +func (c *Conn) getProperty(ctx context.Context, unit string, dbusInterface string, propertyName string) (*Property, error) { var err error var prop dbus.Variant @@ -213,7 +315,7 @@ func (c *Conn) getProperty(unit string, dbusInterface string, propertyName strin } obj := c.sysconn.Object("org.freedesktop.systemd1", path) - err = obj.Call("org.freedesktop.DBus.Properties.Get", 0, dbusInterface, propertyName).Store(&prop) + err = obj.CallWithContext(ctx, "org.freedesktop.DBus.Properties.Get", 0, dbusInterface, propertyName).Store(&prop) if err != nil { return nil, err } @@ -221,21 +323,39 @@ func (c *Conn) getProperty(unit string, dbusInterface string, propertyName strin return &Property{Name: propertyName, Value: prop}, nil } +// Deprecated: use GetUnitPropertyContext instead func (c *Conn) GetUnitProperty(unit string, propertyName string) (*Property, error) { - return c.getProperty(unit, "org.freedesktop.systemd1.Unit", propertyName) + return c.GetUnitPropertyContext(context.Background(), unit, propertyName) +} + +// GetUnitPropertyContext same as GetUnitProperty with context +func (c *Conn) GetUnitPropertyContext(ctx context.Context, unit string, propertyName string) (*Property, error) { + return c.getProperty(ctx, unit, "org.freedesktop.systemd1.Unit", propertyName) } // GetServiceProperty returns property for given service name and property name +// Deprecated: use GetServicePropertyContext instead func (c *Conn) GetServiceProperty(service string, propertyName string) (*Property, error) { - return c.getProperty(service, "org.freedesktop.systemd1.Service", propertyName) + return c.GetServicePropertyContext(context.Background(), service, propertyName) +} + +// GetServicePropertyContext same as GetServiceProperty with context +func (c *Conn) GetServicePropertyContext(ctx context.Context, service string, propertyName string) (*Property, error) { + return c.getProperty(ctx, service, "org.freedesktop.systemd1.Service", propertyName) } // GetUnitTypeProperties returns the extra properties for a unit, specific to the unit type. // Valid values for unitType: Service, Socket, Target, Device, Mount, Automount, Snapshot, Timer, Swap, Path, Slice, Scope // return "dbus.Error: Unknown interface" if the unitType is not the correct type of the unit +// Deprecated: use GetUnitTypePropertiesContext instead func (c *Conn) GetUnitTypeProperties(unit string, unitType string) (map[string]interface{}, error) { + return c.GetUnitTypePropertiesContext(context.Background(), unit, unitType) +} + +// GetUnitTypePropertiesContext same as GetUnitTypeProperties with context +func (c *Conn) GetUnitTypePropertiesContext(ctx context.Context, unit string, unitType string) (map[string]interface{}, error) { path := unitPath(unit) - return c.getProperties(path, "org.freedesktop.systemd1."+unitType) + return c.getProperties(ctx, path, "org.freedesktop.systemd1."+unitType) } // SetUnitProperties() may be used to modify certain unit properties at runtime. @@ -245,12 +365,24 @@ func (c *Conn) GetUnitTypeProperties(unit string, unitType string) (map[string]i // case the settings only apply until the next reboot. name is the name of the unit // to modify. properties are the settings to set, encoded as an array of property // name and value pairs. +// Deprecated: use SetUnitPropertiesContext instead func (c *Conn) SetUnitProperties(name string, runtime bool, properties ...Property) error { - return c.sysobj.Call("org.freedesktop.systemd1.Manager.SetUnitProperties", 0, name, runtime, properties).Store() + return c.SetUnitPropertiesContext(context.Background(), name, runtime, properties...) } +// SetUnitPropertiesContext same as SetUnitProperties with context +func (c *Conn) SetUnitPropertiesContext(ctx context.Context, name string, runtime bool, properties ...Property) error { + return c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.SetUnitProperties", 0, name, runtime, properties).Store() +} + +// Deprecated: use GetUnitTypePropertyContext instead func (c *Conn) GetUnitTypeProperty(unit string, unitType string, propertyName string) (*Property, error) { - return c.getProperty(unit, "org.freedesktop.systemd1."+unitType, propertyName) + return c.GetUnitTypePropertyContext(context.Background(), unit, unitType, propertyName) +} + +// GetUnitTypePropertyContext same as GetUnitTypeProperty with context +func (c *Conn) GetUnitTypePropertyContext(ctx context.Context, unit string, unitType string, propertyName string) (*Property, error) { + return c.getProperty(ctx, unit, "org.freedesktop.systemd1."+unitType, propertyName) } type UnitStatus struct { @@ -299,22 +431,40 @@ func (c *Conn) listUnitsInternal(f storeFunc) ([]UnitStatus, error) { // be more unit names loaded than actual units behind them. // Also note that a unit is only loaded if it is active and/or enabled. // Units that are both disabled and inactive will thus not be returned. +// Deprecated: use ListUnitsContext instead func (c *Conn) ListUnits() ([]UnitStatus, error) { - return c.listUnitsInternal(c.sysobj.Call("org.freedesktop.systemd1.Manager.ListUnits", 0).Store) + return c.ListUnitsContext(context.Background()) +} + +// ListUnitsContext same as ListUnits with context +func (c *Conn) ListUnitsContext(ctx context.Context) ([]UnitStatus, error) { + return c.listUnitsInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnits", 0).Store) } // ListUnitsFiltered returns an array with units filtered by state. // It takes a list of units' statuses to filter. +// Deprecated: use ListUnitsFilteredContext instead func (c *Conn) ListUnitsFiltered(states []string) ([]UnitStatus, error) { - return c.listUnitsInternal(c.sysobj.Call("org.freedesktop.systemd1.Manager.ListUnitsFiltered", 0, states).Store) + return c.ListUnitsFilteredContext(context.Background(), states) +} + +// ListUnitsFilteredContext same as ListUnitsFiltered with context +func (c *Conn) ListUnitsFilteredContext(ctx context.Context, states []string) ([]UnitStatus, error) { + return c.listUnitsInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitsFiltered", 0, states).Store) } // ListUnitsByPatterns returns an array with units. // It takes a list of units' statuses and names to filter. // Note that units may be known by multiple names at the same time, // and hence there might be more unit names loaded than actual units behind them. +// Deprecated: use ListUnitsByPatternsContext instead func (c *Conn) ListUnitsByPatterns(states []string, patterns []string) ([]UnitStatus, error) { - return c.listUnitsInternal(c.sysobj.Call("org.freedesktop.systemd1.Manager.ListUnitsByPatterns", 0, states, patterns).Store) + return c.ListUnitsByPatternsContext(context.Background(), states, patterns) +} + +// ListUnitsByPatternsContext same as ListUnitsByPatterns with context +func (c *Conn) ListUnitsByPatternsContext(ctx context.Context, states []string, patterns []string) ([]UnitStatus, error) { + return c.listUnitsInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitsByPatterns", 0, states, patterns).Store) } // ListUnitsByNames returns an array with units. It takes a list of units' @@ -322,8 +472,14 @@ func (c *Conn) ListUnitsByPatterns(states []string, patterns []string) ([]UnitSt // method, this method returns statuses even for inactive or non-existing // units. Input array should contain exact unit names, but not patterns. // Note: Requires systemd v230 or higher +// Deprecated: use ListUnitsByNamesContext instead func (c *Conn) ListUnitsByNames(units []string) ([]UnitStatus, error) { - return c.listUnitsInternal(c.sysobj.Call("org.freedesktop.systemd1.Manager.ListUnitsByNames", 0, units).Store) + return c.ListUnitsByNamesContext(context.Background(), units) +} + +// ListUnitsByNamesContext same as ListUnitsByNames with context +func (c *Conn) ListUnitsByNamesContext(ctx context.Context, units []string) ([]UnitStatus, error) { + return c.listUnitsInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitsByNames", 0, units).Store) } type UnitFile struct { @@ -358,13 +514,25 @@ func (c *Conn) listUnitFilesInternal(f storeFunc) ([]UnitFile, error) { } // ListUnitFiles returns an array of all available units on disk. +// Deprecated: use ListUnitFilesContext instead func (c *Conn) ListUnitFiles() ([]UnitFile, error) { - return c.listUnitFilesInternal(c.sysobj.Call("org.freedesktop.systemd1.Manager.ListUnitFiles", 0).Store) + return c.ListUnitFilesContext(context.Background()) +} + +// ListUnitFilesContext same as ListUnitFiles with context +func (c *Conn) ListUnitFilesContext(ctx context.Context) ([]UnitFile, error) { + return c.listUnitFilesInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitFiles", 0).Store) } // ListUnitFilesByPatterns returns an array of all available units on disk matched the patterns. +// Deprecated: use ListUnitFilesByPatternsContext instead func (c *Conn) ListUnitFilesByPatterns(states []string, patterns []string) ([]UnitFile, error) { - return c.listUnitFilesInternal(c.sysobj.Call("org.freedesktop.systemd1.Manager.ListUnitFilesByPatterns", 0, states, patterns).Store) + return c.ListUnitFilesByPatternsContext(context.Background(), states, patterns) +} + +// ListUnitFilesByPatternsContext same as ListUnitFilesByPatterns with context +func (c *Conn) ListUnitFilesByPatternsContext(ctx context.Context, states []string, patterns []string) ([]UnitFile, error) { + return c.listUnitFilesInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitFilesByPatterns", 0, states, patterns).Store) } type LinkUnitFileChange EnableUnitFileChange @@ -383,9 +551,15 @@ type LinkUnitFileChange EnableUnitFileChange // structures with three strings: the type of the change (one of symlink // or unlink), the file name of the symlink and the destination of the // symlink. +// Deprecated: use LinkUnitFilesContext instead func (c *Conn) LinkUnitFiles(files []string, runtime bool, force bool) ([]LinkUnitFileChange, error) { + return c.LinkUnitFilesContext(context.Background(), files, runtime, force) +} + +// LinkUnitFilesContext same as LinkUnitFiles with context +func (c *Conn) LinkUnitFilesContext(ctx context.Context, files []string, runtime bool, force bool) ([]LinkUnitFileChange, error) { result := make([][]interface{}, 0) - err := c.sysobj.Call("org.freedesktop.systemd1.Manager.LinkUnitFiles", 0, files, runtime, force).Store(&result) + err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.LinkUnitFiles", 0, files, runtime, force).Store(&result) if err != nil { return nil, err } @@ -425,11 +599,17 @@ func (c *Conn) LinkUnitFiles(files []string, runtime bool, force bool) ([]LinkUn // structures with three strings: the type of the change (one of symlink // or unlink), the file name of the symlink and the destination of the // symlink. +// Deprecated: use EnableUnitFilesContext instead func (c *Conn) EnableUnitFiles(files []string, runtime bool, force bool) (bool, []EnableUnitFileChange, error) { + return c.EnableUnitFilesContext(context.Background(), files, runtime, force) +} + +// EnableUnitFilesContext same as EnableUnitFiles with context +func (c *Conn) EnableUnitFilesContext(ctx context.Context, files []string, runtime bool, force bool) (bool, []EnableUnitFileChange, error) { var carries_install_info bool result := make([][]interface{}, 0) - err := c.sysobj.Call("org.freedesktop.systemd1.Manager.EnableUnitFiles", 0, files, runtime, force).Store(&carries_install_info, &result) + err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.EnableUnitFiles", 0, files, runtime, force).Store(&carries_install_info, &result) if err != nil { return false, nil, err } @@ -471,9 +651,15 @@ type EnableUnitFileChange struct { // consists of structures with three strings: the type of the change (one of // symlink or unlink), the file name of the symlink and the destination of the // symlink. +// Deprecated: use DisableUnitFilesContext instead func (c *Conn) DisableUnitFiles(files []string, runtime bool) ([]DisableUnitFileChange, error) { + return c.DisableUnitFilesContext(context.Background(), files, runtime) +} + +// DisableUnitFilesContext same as DisableUnitFiles with context +func (c *Conn) DisableUnitFilesContext(ctx context.Context, files []string, runtime bool) ([]DisableUnitFileChange, error) { result := make([][]interface{}, 0) - err := c.sysobj.Call("org.freedesktop.systemd1.Manager.DisableUnitFiles", 0, files, runtime).Store(&result) + err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.DisableUnitFiles", 0, files, runtime).Store(&result) if err != nil { return nil, err } @@ -512,9 +698,15 @@ type DisableUnitFileChange struct { // * runtime to specify whether the unit was enabled for runtime // only (true, /run/systemd/..), or persistently (false, /etc/systemd/..) // * force flag +// Deprecated: use MaskUnitFilesContext instead func (c *Conn) MaskUnitFiles(files []string, runtime bool, force bool) ([]MaskUnitFileChange, error) { + return c.MaskUnitFilesContext(context.Background(), files, runtime, force) +} + +// MaskUnitFilesContext same as MaskUnitFiles with context +func (c *Conn) MaskUnitFilesContext(ctx context.Context, files []string, runtime bool, force bool) ([]MaskUnitFileChange, error) { result := make([][]interface{}, 0) - err := c.sysobj.Call("org.freedesktop.systemd1.Manager.MaskUnitFiles", 0, files, runtime, force).Store(&result) + err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.MaskUnitFiles", 0, files, runtime, force).Store(&result) if err != nil { return nil, err } @@ -552,9 +744,15 @@ type MaskUnitFileChange struct { // the usual unit search paths) // * runtime to specify whether the unit was enabled for runtime // only (true, /run/systemd/..), or persistently (false, /etc/systemd/..) +// Deprecated: use UnmaskUnitFilesContext instead func (c *Conn) UnmaskUnitFiles(files []string, runtime bool) ([]UnmaskUnitFileChange, error) { + return c.UnmaskUnitFilesContext(context.Background(), files, runtime) +} + +// UnmaskUnitFilesContext same as UnmaskUnitFiles with context +func (c *Conn) UnmaskUnitFilesContext(ctx context.Context, files []string, runtime bool) ([]UnmaskUnitFileChange, error) { result := make([][]interface{}, 0) - err := c.sysobj.Call("org.freedesktop.systemd1.Manager.UnmaskUnitFiles", 0, files, runtime).Store(&result) + err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.UnmaskUnitFiles", 0, files, runtime).Store(&result) if err != nil { return nil, err } @@ -586,8 +784,14 @@ type UnmaskUnitFileChange struct { // Reload instructs systemd to scan for and reload unit files. This is // equivalent to a 'systemctl daemon-reload'. +// Deprecated: use ReloadContext instead func (c *Conn) Reload() error { - return c.sysobj.Call("org.freedesktop.systemd1.Manager.Reload", 0).Store() + return c.ReloadContext(context.Background()) +} + +// ReloadContext same as Reload with context +func (c *Conn) ReloadContext(ctx context.Context) error { + return c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.Reload", 0).Store() } func unitPath(name string) dbus.ObjectPath { @@ -598,3 +802,48 @@ func unitPath(name string) dbus.ObjectPath { func unitName(dpath dbus.ObjectPath) string { return pathBusUnescape(path.Base(string(dpath))) } + +// Currently queued job definition +type JobStatus struct { + Id uint32 // The numeric job id + Unit string // The primary unit name for this job + JobType string // The job type as string + Status string // The job state as string + JobPath dbus.ObjectPath // The job object path + UnitPath dbus.ObjectPath // The unit object path +} + +// ListJobs returns an array with all currently queued jobs +// Deprecated: use ListJobsContext instead +func (c *Conn) ListJobs() ([]JobStatus, error) { + return c.ListJobsContext(context.Background()) +} + +// ListJobsContext same as ListJobs with context +func (c *Conn) ListJobsContext(ctx context.Context) ([]JobStatus, error) { + return c.listJobsInternal(ctx) +} + +func (c *Conn) listJobsInternal(ctx context.Context) ([]JobStatus, error) { + result := make([][]interface{}, 0) + if err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListJobs", 0).Store(&result); err != nil { + return nil, err + } + + resultInterface := make([]interface{}, len(result)) + for i := range result { + resultInterface[i] = result[i] + } + + status := make([]JobStatus, len(result)) + statusInterface := make([]interface{}, len(status)) + for i := range status { + statusInterface[i] = &status[i] + } + + if err := dbus.Store(resultInterface, statusInterface...); err != nil { + return nil, err + } + + return status, nil +} diff --git a/cluster-autoscaler/vendor/github.com/evanphx/json-patch/.travis.yml b/cluster-autoscaler/vendor/github.com/evanphx/json-patch/.travis.yml deleted file mode 100644 index 50e4afd19a44..000000000000 --- a/cluster-autoscaler/vendor/github.com/evanphx/json-patch/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: go - -go: - - 1.14 - - 1.13 - -install: - - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi - - go get github.com/jessevdk/go-flags - -script: - - go get - - go test -cover ./... - - cd ./v5 - - go get - - go test -cover ./... - -notifications: - email: false diff --git a/cluster-autoscaler/vendor/github.com/evanphx/json-patch/README.md b/cluster-autoscaler/vendor/github.com/evanphx/json-patch/README.md index 121b039dbaa0..28e35169375b 100644 --- a/cluster-autoscaler/vendor/github.com/evanphx/json-patch/README.md +++ b/cluster-autoscaler/vendor/github.com/evanphx/json-patch/README.md @@ -39,6 +39,25 @@ go get -u github.com/evanphx/json-patch/v5 which limits the total size increase in bytes caused by "copy" operations in a patch. It defaults to 0, which means there is no limit. +These global variables control the behavior of `jsonpatch.Apply`. + +An alternative to `jsonpatch.Apply` is `jsonpatch.ApplyWithOptions` whose behavior +is controlled by an `options` parameter of type `*jsonpatch.ApplyOptions`. + +Structure `jsonpatch.ApplyOptions` includes the configuration options above +and adds two new options: `AllowMissingPathOnRemove` and `EnsurePathExistsOnAdd`. + +When `AllowMissingPathOnRemove` is set to `true`, `jsonpatch.ApplyWithOptions` will ignore +`remove` operations whose `path` points to a non-existent location in the JSON document. +`AllowMissingPathOnRemove` defaults to `false` which will lead to `jsonpatch.ApplyWithOptions` +returning an error when hitting a missing `path` on `remove`. + +When `EnsurePathExistsOnAdd` is set to `true`, `jsonpatch.ApplyWithOptions` will make sure +that `add` operations produce all the `path` elements that are missing from the target object. + +Use `jsonpatch.NewApplyOptions` to create an instance of `jsonpatch.ApplyOptions` +whose values are populated from the global configuration variables. + ## Create and apply a merge patch Given both an original JSON document and a modified JSON document, you can create a [Merge Patch](https://tools.ietf.org/html/rfc7396) document. diff --git a/cluster-autoscaler/vendor/github.com/evanphx/json-patch/merge.go b/cluster-autoscaler/vendor/github.com/evanphx/json-patch/merge.go index 14e8bb5ce386..ad88d40181c1 100644 --- a/cluster-autoscaler/vendor/github.com/evanphx/json-patch/merge.go +++ b/cluster-autoscaler/vendor/github.com/evanphx/json-patch/merge.go @@ -38,7 +38,10 @@ func mergeDocs(doc, patch *partialDoc, mergeMerge bool) { cur, ok := (*doc)[k] if !ok || cur == nil { - pruneNulls(v) + if !mergeMerge { + pruneNulls(v) + } + (*doc)[k] = v } else { (*doc)[k] = merge(cur, v, mergeMerge) @@ -79,8 +82,8 @@ func pruneAryNulls(ary *partialArray) *partialArray { for _, v := range *ary { if v != nil { pruneNulls(v) - newAry = append(newAry, v) } + newAry = append(newAry, v) } *ary = newAry @@ -88,8 +91,8 @@ func pruneAryNulls(ary *partialArray) *partialArray { return ary } -var errBadJSONDoc = fmt.Errorf("Invalid JSON Document") -var errBadJSONPatch = fmt.Errorf("Invalid JSON Patch") +var ErrBadJSONDoc = fmt.Errorf("Invalid JSON Document") +var ErrBadJSONPatch = fmt.Errorf("Invalid JSON Patch") var errBadMergeTypes = fmt.Errorf("Mismatched JSON Documents") // MergeMergePatches merges two merge patches together, such that @@ -114,19 +117,19 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) { patchErr := json.Unmarshal(patchData, patch) if _, ok := docErr.(*json.SyntaxError); ok { - return nil, errBadJSONDoc + return nil, ErrBadJSONDoc } if _, ok := patchErr.(*json.SyntaxError); ok { - return nil, errBadJSONPatch + return nil, ErrBadJSONPatch } if docErr == nil && *doc == nil { - return nil, errBadJSONDoc + return nil, ErrBadJSONDoc } if patchErr == nil && *patch == nil { - return nil, errBadJSONPatch + return nil, ErrBadJSONPatch } if docErr != nil || patchErr != nil { @@ -142,7 +145,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) { patchErr = json.Unmarshal(patchData, patchAry) if patchErr != nil { - return nil, errBadJSONPatch + return nil, ErrBadJSONPatch } pruneAryNulls(patchAry) @@ -150,7 +153,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) { out, patchErr := json.Marshal(patchAry) if patchErr != nil { - return nil, errBadJSONPatch + return nil, ErrBadJSONPatch } return out, nil @@ -207,12 +210,12 @@ func createObjectMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) { err := json.Unmarshal(originalJSON, &originalDoc) if err != nil { - return nil, errBadJSONDoc + return nil, ErrBadJSONDoc } err = json.Unmarshal(modifiedJSON, &modifiedDoc) if err != nil { - return nil, errBadJSONDoc + return nil, ErrBadJSONDoc } dest, err := getDiff(originalDoc, modifiedDoc) @@ -233,17 +236,17 @@ func createArrayMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) { err := json.Unmarshal(originalJSON, &originalDocs) if err != nil { - return nil, errBadJSONDoc + return nil, ErrBadJSONDoc } err = json.Unmarshal(modifiedJSON, &modifiedDocs) if err != nil { - return nil, errBadJSONDoc + return nil, ErrBadJSONDoc } total := len(originalDocs) if len(modifiedDocs) != total { - return nil, errBadJSONDoc + return nil, ErrBadJSONDoc } result := []json.RawMessage{} diff --git a/cluster-autoscaler/vendor/github.com/evanphx/json-patch/patch.go b/cluster-autoscaler/vendor/github.com/evanphx/json-patch/patch.go index f185a45b2cb0..18298549076e 100644 --- a/cluster-autoscaler/vendor/github.com/evanphx/json-patch/patch.go +++ b/cluster-autoscaler/vendor/github.com/evanphx/json-patch/patch.go @@ -721,6 +721,10 @@ func (p Patch) Apply(doc []byte) ([]byte, error) { // ApplyIndent mutates a JSON document according to the patch, and returns the new // document indented. func (p Patch) ApplyIndent(doc []byte, indent string) ([]byte, error) { + if len(doc) == 0 { + return doc, nil + } + var pd container if doc[0] == '[' { pd = &partialArray{} diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/.travis.yml b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/.travis.yml deleted file mode 100644 index dd67672048bf..000000000000 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -dist: bionic -language: go -go_import_path: github.com/godbus/dbus - -go: - - 1.11.x - - 1.12.x - - 1.13.x - - tip - -matrix: - fast_finish: true - allow_failures: - - go: tip - -addons: - apt: - packages: - - dbus - - dbus-x11 - -before_install: - - export GO111MODULE=on - -script: - - go test -v -race -mod=readonly ./... # Run all the tests with the race detector enabled - - go vet ./... # go vet is the official Go static analyzer - -jobs: - include: - # The build matrix doesn't cover build stages, so manually expand - # the jobs with anchors - - &multiarch - stage: "Multiarch Test" - go: 1.11.x - env: TARGETS="386 arm arm64 ppc64le" - before_install: - - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - script: - - | - set -e - for target in $TARGETS; do - printf "\e[1mRunning test suite under ${target}.\e[0m\n" - GOARCH="$target" go test -v ./... - printf "\n\n" - done - - <<: *multiarch - go: 1.12.x - - <<: *multiarch - go: 1.13.x diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/README.markdown b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/README.markdown index fd29648752d4..1fb2eacaa15a 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/README.markdown +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/README.markdown @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/godbus/dbus.svg?branch=master)](https://travis-ci.org/godbus/dbus) +![Build Status](https://github.com/godbus/dbus/workflows/Go/badge.svg) dbus ---- @@ -32,6 +32,8 @@ gives a short overview over the basic usage. #### Projects using godbus - [notify](https://github.com/esiqveland/notify) provides desktop notifications over dbus into a library. - [go-bluetooth](https://github.com/muka/go-bluetooth) provides a bluetooth client over bluez dbus API. +- [playerbm](https://github.com/altdesktop/playerbm) a bookmark utility for media players. +- [iwd](https://github.com/shibumi/iwd) go bindings for the internet wireless daemon "iwd". Please note that the API is considered unstable for now and may change without further notice. diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/auth.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/auth.go index 31abac629d7a..283487a0e313 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/auth.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/auth.go @@ -37,7 +37,7 @@ const ( // Auth defines the behaviour of an authentication mechanism. type Auth interface { - // Return the name of the mechnism, the argument to the first AUTH command + // Return the name of the mechanism, the argument to the first AUTH command // and the next status. FirstData() (name, resp []byte, status AuthStatus) diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/call.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/call.go index 2cb189012e7f..b06b063580fc 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/call.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/call.go @@ -24,6 +24,15 @@ type Call struct { // Holds the response once the call is done. Body []interface{} + // ResponseSequence stores the sequence number of the DBus message containing + // the call response (or error). This can be compared to the sequence number + // of other call responses and signals on this connection to determine their + // relative ordering on the underlying DBus connection. + // For errors, ResponseSequence is populated only if the error came from a + // DBusMessage that was received or if there was an error receiving. In case of + // failure to make the call, ResponseSequence will be NoSequence. + ResponseSequence Sequence + // tracks context and canceler ctx context.Context ctxCanceler context.CancelFunc diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/conn.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/conn.go index b55bc99c8540..29fe018ad823 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/conn.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/conn.go @@ -45,6 +45,7 @@ type Conn struct { serialGen SerialGenerator inInt Interceptor outInt Interceptor + auth []Auth names *nameTracker calls *callTracker @@ -59,7 +60,8 @@ type Conn struct { func SessionBus() (conn *Conn, err error) { sessionBusLck.Lock() defer sessionBusLck.Unlock() - if sessionBus != nil { + if sessionBus != nil && + sessionBus.Connected() { return sessionBus, nil } defer func() { @@ -67,19 +69,7 @@ func SessionBus() (conn *Conn, err error) { sessionBus = conn } }() - conn, err = SessionBusPrivate() - if err != nil { - return - } - if err = conn.Auth(nil); err != nil { - conn.Close() - conn = nil - return - } - if err = conn.Hello(); err != nil { - conn.Close() - conn = nil - } + conn, err = ConnectSessionBus() return } @@ -116,7 +106,8 @@ func SessionBusPrivateHandler(handler Handler, signalHandler SignalHandler) (*Co func SystemBus() (conn *Conn, err error) { systemBusLck.Lock() defer systemBusLck.Unlock() - if systemBus != nil { + if systemBus != nil && + systemBus.Connected() { return systemBus, nil } defer func() { @@ -124,20 +115,42 @@ func SystemBus() (conn *Conn, err error) { systemBus = conn } }() - conn, err = SystemBusPrivate() + conn, err = ConnectSystemBus() + return +} + +// ConnectSessionBus connects to the session bus. +func ConnectSessionBus(opts ...ConnOption) (*Conn, error) { + address, err := getSessionBusAddress() if err != nil { - return + return nil, err } - if err = conn.Auth(nil); err != nil { - conn.Close() - conn = nil - return + return Connect(address, opts...) +} + +// ConnectSystemBus connects to the system bus. +func ConnectSystemBus(opts ...ConnOption) (*Conn, error) { + return Connect(getSystemBusPlatformAddress(), opts...) +} + +// Connect connects to the given address. +// +// Returned connection is ready to use and doesn't require calling +// Auth and Hello methods to make it usable. +func Connect(address string, opts ...ConnOption) (*Conn, error) { + conn, err := Dial(address, opts...) + if err != nil { + return nil, err + } + if err = conn.Auth(conn.auth); err != nil { + _ = conn.Close() + return nil, err } if err = conn.Hello(); err != nil { - conn.Close() - conn = nil + _ = conn.Close() + return nil, err } - return + return conn, nil } // SystemBusPrivate returns a new private connection to the system bus. @@ -197,6 +210,14 @@ func WithSerialGenerator(gen SerialGenerator) ConnOption { } } +// WithAuth sets authentication methods for the auth conversation. +func WithAuth(methods ...Auth) ConnOption { + return func(conn *Conn) error { + conn.auth = methods + return nil + } +} + // Interceptor intercepts incoming and outgoing messages. type Interceptor func(msg *Message) @@ -309,6 +330,11 @@ func (conn *Conn) Context() context.Context { return conn.ctx } +// Connected returns whether conn is connected +func (conn *Conn) Connected() bool { + return conn.ctx.Err() == nil +} + // Eavesdrop causes conn to send all incoming messages to the given channel // without further processing. Method replies, errors and signals will not be // sent to the appropriate channels and method calls will not be handled. If nil @@ -342,8 +368,9 @@ func (conn *Conn) Hello() error { } // inWorker runs in an own goroutine, reading incoming messages from the -// transport and dispatching them appropiately. +// transport and dispatching them appropriately. func (conn *Conn) inWorker() { + sequenceGen := newSequenceGenerator() for { msg, err := conn.ReadMessage() if err != nil { @@ -352,7 +379,7 @@ func (conn *Conn) inWorker() { // anything but to shut down all stuff and returns errors to all // pending replies. conn.Close() - conn.calls.finalizeAllWithError(err) + conn.calls.finalizeAllWithError(sequenceGen, err) return } // invalid messages are ignored @@ -381,13 +408,14 @@ func (conn *Conn) inWorker() { if conn.inInt != nil { conn.inInt(msg) } + sequence := sequenceGen.next() switch msg.Type { case TypeError: - conn.serialGen.RetireSerial(conn.calls.handleDBusError(msg)) + conn.serialGen.RetireSerial(conn.calls.handleDBusError(sequence, msg)) case TypeMethodReply: - conn.serialGen.RetireSerial(conn.calls.handleReply(msg)) + conn.serialGen.RetireSerial(conn.calls.handleReply(sequence, msg)) case TypeSignal: - conn.handleSignal(msg) + conn.handleSignal(sequence, msg) case TypeMethodCall: go conn.handleCall(msg) } @@ -395,7 +423,7 @@ func (conn *Conn) inWorker() { } } -func (conn *Conn) handleSignal(msg *Message) { +func (conn *Conn) handleSignal(sequence Sequence, msg *Message) { iface := msg.Headers[FieldInterface].value.(string) member := msg.Headers[FieldMember].value.(string) // as per http://dbus.freedesktop.org/doc/dbus-specification.html , @@ -421,10 +449,11 @@ func (conn *Conn) handleSignal(msg *Message) { } } signal := &Signal{ - Sender: sender, - Path: msg.Headers[FieldPath].value.(ObjectPath), - Name: iface + "." + member, - Body: msg.Body, + Sender: sender, + Path: msg.Headers[FieldPath].value.(ObjectPath), + Name: iface + "." + member, + Body: msg.Body, + Sequence: sequence, } conn.signalHandler.DeliverSignal(iface, member, signal) } @@ -442,6 +471,9 @@ func (conn *Conn) Object(dest string, path ObjectPath) BusObject { } func (conn *Conn) sendMessageAndIfClosed(msg *Message, ifClosed func()) { + if msg.serial == 0 { + msg.serial = conn.getSerial() + } if conn.outInt != nil { conn.outInt(msg) } @@ -473,16 +505,16 @@ func (conn *Conn) send(ctx context.Context, msg *Message, ch chan *Call) *Call { if ctx == nil { panic("nil context") } + if ch == nil { + ch = make(chan *Call, 1) + } else if cap(ch) == 0 { + panic("dbus: unbuffered channel passed to (*Conn).Send") + } var call *Call ctx, canceler := context.WithCancel(ctx) msg.serial = conn.getSerial() if msg.Type == TypeMethodCall && msg.Flags&FlagNoReplyExpected == 0 { - if ch == nil { - ch = make(chan *Call, 5) - } else if cap(ch) == 0 { - panic("dbus: unbuffered channel passed to (*Conn).Send") - } call = new(Call) call.Destination, _ = msg.Headers[FieldDestination].value.(string) call.Path, _ = msg.Headers[FieldPath].value.(ObjectPath) @@ -504,7 +536,8 @@ func (conn *Conn) send(ctx context.Context, msg *Message, ch chan *Call) *Call { }) } else { canceler() - call = &Call{Err: nil} + call = &Call{Err: nil, Done: ch} + ch <- call conn.sendMessageAndIfClosed(msg, func() { call = &Call{Err: ErrClosed} }) @@ -529,7 +562,6 @@ func (conn *Conn) sendError(err error, dest string, serial uint32) { } msg := new(Message) msg.Type = TypeError - msg.serial = conn.getSerial() msg.Headers = make(map[HeaderField]Variant) if dest != "" { msg.Headers[FieldDestination] = MakeVariant(dest) @@ -548,7 +580,6 @@ func (conn *Conn) sendError(err error, dest string, serial uint32) { func (conn *Conn) sendReply(dest string, serial uint32, values ...interface{}) { msg := new(Message) msg.Type = TypeMethodReply - msg.serial = conn.getSerial() msg.Headers = make(map[HeaderField]Variant) if dest != "" { msg.Headers[FieldDestination] = MakeVariant(dest) @@ -564,8 +595,14 @@ func (conn *Conn) sendReply(dest string, serial uint32, values ...interface{}) { // AddMatchSignal registers the given match rule to receive broadcast // signals based on their contents. func (conn *Conn) AddMatchSignal(options ...MatchOption) error { + return conn.AddMatchSignalContext(context.Background(), options...) +} + +// AddMatchSignalContext acts like AddMatchSignal but takes a context. +func (conn *Conn) AddMatchSignalContext(ctx context.Context, options ...MatchOption) error { options = append([]MatchOption{withMatchType("signal")}, options...) - return conn.busObj.Call( + return conn.busObj.CallWithContext( + ctx, "org.freedesktop.DBus.AddMatch", 0, formatMatchOptions(options), ).Store() @@ -573,8 +610,14 @@ func (conn *Conn) AddMatchSignal(options ...MatchOption) error { // RemoveMatchSignal removes the first rule that matches previously registered with AddMatchSignal. func (conn *Conn) RemoveMatchSignal(options ...MatchOption) error { + return conn.RemoveMatchSignalContext(context.Background(), options...) +} + +// RemoveMatchSignalContext acts like RemoveMatchSignal but takes a context. +func (conn *Conn) RemoveMatchSignalContext(ctx context.Context, options ...MatchOption) error { options = append([]MatchOption{withMatchType("signal")}, options...) - return conn.busObj.Call( + return conn.busObj.CallWithContext( + ctx, "org.freedesktop.DBus.RemoveMatch", 0, formatMatchOptions(options), ).Store() @@ -639,10 +682,11 @@ func (e Error) Error() string { // Signal represents a D-Bus message of type Signal. The name member is given in // "interface.member" notation, e.g. org.freedesktop.D-Bus.NameLost. type Signal struct { - Sender string - Path ObjectPath - Name string - Body []interface{} + Sender string + Path ObjectPath + Name string + Body []interface{} + Sequence Sequence } // transport is a D-Bus transport. @@ -825,25 +869,25 @@ func (tracker *callTracker) track(sn uint32, call *Call) { tracker.lck.Unlock() } -func (tracker *callTracker) handleReply(msg *Message) uint32 { +func (tracker *callTracker) handleReply(sequence Sequence, msg *Message) uint32 { serial := msg.Headers[FieldReplySerial].value.(uint32) tracker.lck.RLock() _, ok := tracker.calls[serial] tracker.lck.RUnlock() if ok { - tracker.finalizeWithBody(serial, msg.Body) + tracker.finalizeWithBody(serial, sequence, msg.Body) } return serial } -func (tracker *callTracker) handleDBusError(msg *Message) uint32 { +func (tracker *callTracker) handleDBusError(sequence Sequence, msg *Message) uint32 { serial := msg.Headers[FieldReplySerial].value.(uint32) tracker.lck.RLock() _, ok := tracker.calls[serial] tracker.lck.RUnlock() if ok { name, _ := msg.Headers[FieldErrorName].value.(string) - tracker.finalizeWithError(serial, Error{name, msg.Body}) + tracker.finalizeWithError(serial, sequence, Error{name, msg.Body}) } return serial } @@ -856,7 +900,7 @@ func (tracker *callTracker) handleSendError(msg *Message, err error) { _, ok := tracker.calls[msg.serial] tracker.lck.RUnlock() if ok { - tracker.finalizeWithError(msg.serial, err) + tracker.finalizeWithError(msg.serial, NoSequence, err) } } @@ -871,7 +915,7 @@ func (tracker *callTracker) finalize(sn uint32) { } } -func (tracker *callTracker) finalizeWithBody(sn uint32, body []interface{}) { +func (tracker *callTracker) finalizeWithBody(sn uint32, sequence Sequence, body []interface{}) { tracker.lck.Lock() c, ok := tracker.calls[sn] if ok { @@ -880,11 +924,12 @@ func (tracker *callTracker) finalizeWithBody(sn uint32, body []interface{}) { tracker.lck.Unlock() if ok { c.Body = body + c.ResponseSequence = sequence c.done() } } -func (tracker *callTracker) finalizeWithError(sn uint32, err error) { +func (tracker *callTracker) finalizeWithError(sn uint32, sequence Sequence, err error) { tracker.lck.Lock() c, ok := tracker.calls[sn] if ok { @@ -893,11 +938,12 @@ func (tracker *callTracker) finalizeWithError(sn uint32, err error) { tracker.lck.Unlock() if ok { c.Err = err + c.ResponseSequence = sequence c.done() } } -func (tracker *callTracker) finalizeAllWithError(err error) { +func (tracker *callTracker) finalizeAllWithError(sequenceGen *sequenceGenerator, err error) { tracker.lck.Lock() closedCalls := make([]*Call, 0, len(tracker.calls)) for sn := range tracker.calls { @@ -907,6 +953,7 @@ func (tracker *callTracker) finalizeAllWithError(err error) { tracker.lck.Unlock() for _, call := range closedCalls { call.Err = err + call.ResponseSequence = sequenceGen.next() call.done() } } diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/dbus.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/dbus.go index 428923d26672..ddf3b7afde9d 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/dbus.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/dbus.go @@ -28,6 +28,7 @@ var ( interfaceType = reflect.TypeOf((*interface{})(nil)).Elem() unixFDType = reflect.TypeOf(UnixFD(0)) unixFDIndexType = reflect.TypeOf(UnixFDIndex(0)) + errType = reflect.TypeOf((*error)(nil)).Elem() ) // An InvalidTypeError signals that a value which cannot be represented in the @@ -63,6 +64,9 @@ func storeInterfaces(src, dest interface{}) error { func store(dest, src reflect.Value) error { if dest.Kind() == reflect.Ptr { + if dest.IsNil() { + dest.Set(reflect.New(dest.Type().Elem())) + } return store(dest.Elem(), src) } switch src.Kind() { diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/default_handler.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/default_handler.go index 6d8bf32f9f9f..13132c6b4797 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/default_handler.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/default_handler.go @@ -126,14 +126,28 @@ func (m exportedMethod) Call(args ...interface{}) ([]interface{}, error) { } ret := m.Value.Call(params) - - err := ret[t.NumOut()-1].Interface().(*Error) - ret = ret[:t.NumOut()-1] + var err error + nilErr := false // The reflection will find almost-nils, let's only pass back clean ones! + if t.NumOut() > 0 { + if e, ok := ret[t.NumOut()-1].Interface().(*Error); ok { // godbus *Error + nilErr = ret[t.NumOut()-1].IsNil() + ret = ret[:t.NumOut()-1] + err = e + } else if ret[t.NumOut()-1].Type().Implements(errType) { // Go error + i := ret[t.NumOut()-1].Interface() + if i == nil { + nilErr = ret[t.NumOut()-1].IsNil() + } else { + err = i.(error) + } + ret = ret[:t.NumOut()-1] + } + } out := make([]interface{}, len(ret)) for i, val := range ret { out[i] = val.Interface() } - if err == nil { + if nilErr || err == nil { //concrete type to interface nil is a special case return out, nil } diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/export.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/export.go index c277ab142622..2447b51d469d 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/export.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/export.go @@ -69,6 +69,22 @@ func getMethods(in interface{}, mapping map[string]string) map[string]reflect.Va return methods } +func getAllMethods(in interface{}, mapping map[string]string) map[string]reflect.Value { + if in == nil { + return nil + } + methods := make(map[string]reflect.Value) + val := reflect.ValueOf(in) + typ := val.Type() + for i := 0; i < typ.NumMethod(); i++ { + methtype := typ.Method(i) + method := val.Method(i) + // map names while building table + methods[computeMethodName(methtype.Name, mapping)] = method + } + return methods +} + func standardMethodArgumentDecode(m Method, sender string, msg *Message, body []interface{}) ([]interface{}, error) { pointers := make([]interface{}, m.NumArguments()) decode := make([]interface{}, 0, len(body)) @@ -159,7 +175,6 @@ func (conn *Conn) handleCall(msg *Message) { if msg.Flags&FlagNoReplyExpected == 0 { reply := new(Message) reply.Type = TypeMethodReply - reply.serial = conn.getSerial() reply.Headers = make(map[HeaderField]Variant) if hasSender { reply.Headers[FieldDestination] = msg.Headers[FieldSender] @@ -195,7 +210,6 @@ func (conn *Conn) Emit(path ObjectPath, name string, values ...interface{}) erro } msg := new(Message) msg.Type = TypeSignal - msg.serial = conn.getSerial() msg.Headers = make(map[HeaderField]Variant) msg.Headers[FieldInterface] = MakeVariant(iface) msg.Headers[FieldMember] = MakeVariant(member) @@ -247,6 +261,18 @@ func (conn *Conn) Export(v interface{}, path ObjectPath, iface string) error { return conn.ExportWithMap(v, nil, path, iface) } +// ExportAll registers all exported methods defined by the given object on +// the message bus. +// +// Unlike Export there is no requirement to have the last parameter as type +// *Error. If you want to be able to return error then you can append an error +// type parameter to your method signature. If the error returned is not nil, +// it is sent back to the caller as an error. Otherwise, a method reply is +// sent with the other return values as its body. +func (conn *Conn) ExportAll(v interface{}, path ObjectPath, iface string) error { + return conn.export(getAllMethods(v, nil), path, iface, false) +} + // ExportWithMap works exactly like Export but provides the ability to remap // method names (e.g. export a lower-case method). // @@ -299,19 +325,22 @@ func (conn *Conn) ExportSubtreeMethodTable(methods map[string]interface{}, path } func (conn *Conn) exportMethodTable(methods map[string]interface{}, path ObjectPath, iface string, includeSubtree bool) error { - out := make(map[string]reflect.Value) - for name, method := range methods { - rval := reflect.ValueOf(method) - if rval.Kind() != reflect.Func { - continue - } - t := rval.Type() - // only track valid methods must return *Error as last arg - if t.NumOut() == 0 || - t.Out(t.NumOut()-1) != reflect.TypeOf(&ErrMsgInvalidArg) { - continue + var out map[string]reflect.Value + if methods != nil { + out = make(map[string]reflect.Value) + for name, method := range methods { + rval := reflect.ValueOf(method) + if rval.Kind() != reflect.Func { + continue + } + t := rval.Type() + // only track valid methods must return *Error as last arg + if t.NumOut() == 0 || + t.Out(t.NumOut()-1) != reflect.TypeOf(&ErrMsgInvalidArg) { + continue + } + out[name] = rval } - out[name] = rval } return conn.export(out, path, iface, includeSubtree) } @@ -327,12 +356,12 @@ func (conn *Conn) unexport(h *defaultHandler, path ObjectPath, iface string) err return nil } -// exportWithMap is the worker function for all exports/registrations. +// export is the worker function for all exports/registrations. func (conn *Conn) export(methods map[string]reflect.Value, path ObjectPath, iface string, includeSubtree bool) error { h, ok := conn.handler.(*defaultHandler) if !ok { return fmt.Errorf( - `dbus: export only allowed on the default hander handler have %T"`, + `dbus: export only allowed on the default handler. Received: %T"`, conn.handler) } diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/match.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/match.go index 086ee336a9a4..5a607e53e410 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/match.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/match.go @@ -1,6 +1,7 @@ package dbus import ( + "strconv" "strings" ) @@ -60,3 +61,29 @@ func WithMatchPathNamespace(namespace ObjectPath) MatchOption { func WithMatchDestination(destination string) MatchOption { return WithMatchOption("destination", destination) } + +// WithMatchArg sets argN match option, range of N is 0 to 63. +func WithMatchArg(argIdx int, value string) MatchOption { + if argIdx < 0 || argIdx > 63 { + panic("range of argument index is 0 to 63") + } + return WithMatchOption("arg"+strconv.Itoa(argIdx), value) +} + +// WithMatchArgPath sets argN path match option, range of N is 0 to 63. +func WithMatchArgPath(argIdx int, path string) MatchOption { + if argIdx < 0 || argIdx > 63 { + panic("range of argument index is 0 to 63") + } + return WithMatchOption("arg"+strconv.Itoa(argIdx)+"path", path) +} + +// WithMatchArg0Namespace sets arg0namespace match option. +func WithMatchArg0Namespace(arg0Namespace string) MatchOption { + return WithMatchOption("arg0namespace", arg0Namespace) +} + +// WithMatchEavesdrop sets eavesdrop match option. +func WithMatchEavesdrop(eavesdrop bool) MatchOption { + return WithMatchOption("eavesdrop", strconv.FormatBool(eavesdrop)) +} diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/object.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/object.go index 8acd7fc8b1a4..664abb7fbabb 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/object.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/object.go @@ -16,6 +16,7 @@ type BusObject interface { AddMatchSignal(iface, member string, options ...MatchOption) *Call RemoveMatchSignal(iface, member string, options ...MatchOption) *Call GetProperty(p string) (Variant, error) + StoreProperty(p string, value interface{}) error SetProperty(p string, v interface{}) error Destination() string Path() ObjectPath @@ -109,7 +110,6 @@ func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch method = method[i+1:] msg := new(Message) msg.Type = TypeMethodCall - msg.serial = o.conn.getSerial() msg.Flags = flags & (FlagNoAutoStart | FlagNoReplyExpected) msg.Headers = make(map[HeaderField]Variant) msg.Headers[FieldPath] = MakeVariant(o.path) @@ -122,68 +122,31 @@ func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch if len(args) > 0 { msg.Headers[FieldSignature] = MakeVariant(SignatureOf(args...)) } - if msg.Flags&FlagNoReplyExpected == 0 { - if ch == nil { - ch = make(chan *Call, 1) - } else if cap(ch) == 0 { - panic("dbus: unbuffered channel passed to (*Object).Go") - } - ctx, cancel := context.WithCancel(ctx) - call := &Call{ - Destination: o.dest, - Path: o.path, - Method: method, - Args: args, - Done: ch, - ctxCanceler: cancel, - ctx: ctx, - } - o.conn.calls.track(msg.serial, call) - o.conn.sendMessageAndIfClosed(msg, func() { - o.conn.calls.handleSendError(msg, ErrClosed) - cancel() - }) - go func() { - <-ctx.Done() - o.conn.calls.handleSendError(msg, ctx.Err()) - }() - - return call - } - done := make(chan *Call, 1) - call := &Call{ - Err: nil, - Done: done, - } - defer func() { - call.Done <- call - close(done) - }() - o.conn.sendMessageAndIfClosed(msg, func() { - call.Err = ErrClosed - }) - return call + return o.conn.SendWithContext(ctx, msg, ch) } // GetProperty calls org.freedesktop.DBus.Properties.Get on the given // object. The property name must be given in interface.member notation. func (o *Object) GetProperty(p string) (Variant, error) { + var result Variant + err := o.StoreProperty(p, &result) + return result, err +} + +// StoreProperty calls org.freedesktop.DBus.Properties.Get on the given +// object. The property name must be given in interface.member notation. +// It stores the returned property into the provided value. +func (o *Object) StoreProperty(p string, value interface{}) error { idx := strings.LastIndex(p, ".") if idx == -1 || idx+1 == len(p) { - return Variant{}, errors.New("dbus: invalid property " + p) + return errors.New("dbus: invalid property " + p) } iface := p[:idx] prop := p[idx+1:] - result := Variant{} - err := o.Call("org.freedesktop.DBus.Properties.Get", 0, iface, prop).Store(&result) - - if err != nil { - return Variant{}, err - } - - return result, nil + return o.Call("org.freedesktop.DBus.Properties.Get", 0, iface, prop). + Store(value) } // SetProperty calls org.freedesktop.DBus.Properties.Set on the given diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sequence.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sequence.go new file mode 100644 index 000000000000..89435d3933bd --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sequence.go @@ -0,0 +1,24 @@ +package dbus + +// Sequence represents the value of a monotonically increasing counter. +type Sequence uint64 + +const ( + // NoSequence indicates the absence of a sequence value. + NoSequence Sequence = 0 +) + +// sequenceGenerator represents a monotonically increasing counter. +type sequenceGenerator struct { + nextSequence Sequence +} + +func (generator *sequenceGenerator) next() Sequence { + result := generator.nextSequence + generator.nextSequence++ + return result +} + +func newSequenceGenerator() *sequenceGenerator { + return &sequenceGenerator{nextSequence: 1} +} diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sequential_handler.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sequential_handler.go new file mode 100644 index 000000000000..ef2fcdba179c --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sequential_handler.go @@ -0,0 +1,125 @@ +package dbus + +import ( + "sync" +) + +// NewSequentialSignalHandler returns an instance of a new +// signal handler that guarantees sequential processing of signals. It is a +// guarantee of this signal handler that signals will be written to +// channels in the order they are received on the DBus connection. +func NewSequentialSignalHandler() SignalHandler { + return &sequentialSignalHandler{} +} + +type sequentialSignalHandler struct { + mu sync.RWMutex + closed bool + signals []*sequentialSignalChannelData +} + +func (sh *sequentialSignalHandler) DeliverSignal(intf, name string, signal *Signal) { + sh.mu.RLock() + defer sh.mu.RUnlock() + if sh.closed { + return + } + for _, scd := range sh.signals { + scd.deliver(signal) + } +} + +func (sh *sequentialSignalHandler) Terminate() { + sh.mu.Lock() + defer sh.mu.Unlock() + if sh.closed { + return + } + + for _, scd := range sh.signals { + scd.close() + close(scd.ch) + } + sh.closed = true + sh.signals = nil +} + +func (sh *sequentialSignalHandler) AddSignal(ch chan<- *Signal) { + sh.mu.Lock() + defer sh.mu.Unlock() + if sh.closed { + return + } + sh.signals = append(sh.signals, newSequentialSignalChannelData(ch)) +} + +func (sh *sequentialSignalHandler) RemoveSignal(ch chan<- *Signal) { + sh.mu.Lock() + defer sh.mu.Unlock() + if sh.closed { + return + } + for i := len(sh.signals) - 1; i >= 0; i-- { + if ch == sh.signals[i].ch { + sh.signals[i].close() + copy(sh.signals[i:], sh.signals[i+1:]) + sh.signals[len(sh.signals)-1] = nil + sh.signals = sh.signals[:len(sh.signals)-1] + } + } +} + +type sequentialSignalChannelData struct { + ch chan<- *Signal + in chan *Signal + done chan struct{} +} + +func newSequentialSignalChannelData(ch chan<- *Signal) *sequentialSignalChannelData { + scd := &sequentialSignalChannelData{ + ch: ch, + in: make(chan *Signal), + done: make(chan struct{}), + } + go scd.bufferSignals() + return scd +} + +func (scd *sequentialSignalChannelData) bufferSignals() { + defer close(scd.done) + + // Ensure that signals are delivered to scd.ch in the same + // order they are received from scd.in. + var queue []*Signal + for { + if len(queue) == 0 { + signal, ok := <- scd.in + if !ok { + return + } + queue = append(queue, signal) + } + select { + case scd.ch <- queue[0]: + copy(queue, queue[1:]) + queue[len(queue)-1] = nil + queue = queue[:len(queue)-1] + case signal, ok := <-scd.in: + if !ok { + return + } + queue = append(queue, signal) + } + } +} + +func (scd *sequentialSignalChannelData) deliver(signal *Signal) { + scd.in <- signal +} + +func (scd *sequentialSignalChannelData) close() { + close(scd.in) + // Ensure that bufferSignals() has exited and won't attempt + // any future sends on scd.ch + <-scd.done +} diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sig.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sig.go index c1b809202cd4..2d326cebc0d8 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sig.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/sig.go @@ -137,7 +137,7 @@ func ParseSignatureMust(s string) Signature { return sig } -// Empty retruns whether the signature is the empty signature. +// Empty returns whether the signature is the empty signature. func (s Signature) Empty() bool { return s.str == "" } diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go index 0fc5b92739ba..1b5ed2089d0b 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go @@ -10,6 +10,7 @@ package dbus /* const int sizeofPtr = sizeof(void*); #define _WANT_UCRED +#include #include */ import "C" diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/variant.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/variant.go index 5b51828c8248..f1e81f3ede67 100644 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/variant.go +++ b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/variant.go @@ -142,3 +142,9 @@ func (v Variant) String() string { func (v Variant) Value() interface{} { return v.value } + +// Store converts the variant into a native go type using the same +// mechanism as the "Store" function. +func (v Variant) Store(value interface{}) error { + return storeInterfaces(v.value, value) +} diff --git a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/common/helpers.go b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/common/helpers.go index 4eba4af2c3a4..19241e7937fc 100644 --- a/cluster-autoscaler/vendor/github.com/google/cadvisor/container/common/helpers.go +++ b/cluster-autoscaler/vendor/github.com/google/cadvisor/container/common/helpers.go @@ -17,9 +17,9 @@ package common import ( "fmt" "io/ioutil" + "math" "os" "path" - "path/filepath" "strconv" "strings" "time" @@ -50,25 +50,6 @@ func DebugInfo(watches map[string][]string) map[string][]string { return out } -// findFileInAncestorDir returns the path to the parent directory that contains the specified file. -// "" is returned if the lookup reaches the limit. -func findFileInAncestorDir(current, file, limit string) (string, error) { - for { - fpath := path.Join(current, file) - _, err := os.Stat(fpath) - if err == nil { - return current, nil - } - if !os.IsNotExist(err) { - return "", err - } - if current == limit { - return "", nil - } - current = filepath.Dir(current) - } -} - var bootTime = func() time.Time { now := time.Now() var sysinfo unix.Sysinfo_t @@ -80,6 +61,10 @@ var bootTime = func() time.Time { }() func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoFactory, hasNetwork, hasFilesystem bool) (info.ContainerSpec, error) { + return getSpecInternal(cgroupPaths, machineInfoFactory, hasNetwork, hasFilesystem, cgroups.IsCgroup2UnifiedMode()) +} + +func getSpecInternal(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoFactory, hasNetwork, hasFilesystem, cgroup2UnifiedMode bool) (info.ContainerSpec, error) { var spec info.ContainerSpec // Assume unified hierarchy containers. @@ -96,7 +81,7 @@ func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoF // Use clone_children/events as a workaround as it isn't usually modified. It is only likely changed // immediately after creating a container. If the directory modified time is lower, we use that. cgroupPathFile := path.Join(cgroupPathDir, "cgroup.clone_children") - if cgroups.IsCgroup2UnifiedMode() { + if cgroup2UnifiedMode { cgroupPathFile = path.Join(cgroupPathDir, "cgroup.events") } fi, err := os.Stat(cgroupPathFile) @@ -122,17 +107,43 @@ func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoF cpuRoot, ok := cgroupPaths["cpu"] if ok { if utils.FileExists(cpuRoot) { - spec.HasCpu = true - spec.Cpu.Limit = readUInt64(cpuRoot, "cpu.shares") - spec.Cpu.Period = readUInt64(cpuRoot, "cpu.cfs_period_us") - quota := readString(cpuRoot, "cpu.cfs_quota_us") - - if quota != "" && quota != "-1" { - val, err := strconv.ParseUint(quota, 10, 64) - if err != nil { - klog.Errorf("GetSpec: Failed to parse CPUQuota from %q: %s", path.Join(cpuRoot, "cpu.cfs_quota_us"), err) - } else { - spec.Cpu.Quota = val + if cgroup2UnifiedMode { + spec.HasCpu = true + + weight := readUInt64(cpuRoot, "cpu.weight") + if weight > 0 { + limit, err := convertCPUWeightToCPULimit(weight) + if err != nil { + klog.Errorf("GetSpec: Failed to read CPULimit from %q: %s", path.Join(cpuRoot, "cpu.weight"), err) + } else { + spec.Cpu.Limit = limit + } + } + max := readString(cpuRoot, "cpu.max") + if max != "" { + splits := strings.SplitN(max, " ", 2) + if len(splits) != 2 { + klog.Errorf("GetSpec: Failed to parse CPUmax from %q", path.Join(cpuRoot, "cpu.max")) + } else { + if splits[0] != "max" { + spec.Cpu.Quota = parseUint64String(splits[0]) + } + spec.Cpu.Period = parseUint64String(splits[1]) + } + } + } else { + spec.HasCpu = true + spec.Cpu.Limit = readUInt64(cpuRoot, "cpu.shares") + spec.Cpu.Period = readUInt64(cpuRoot, "cpu.cfs_period_us") + quota := readString(cpuRoot, "cpu.cfs_quota_us") + + if quota != "" && quota != "-1" { + val, err := strconv.ParseUint(quota, 10, 64) + if err != nil { + klog.Errorf("GetSpec: Failed to parse CPUQuota from %q: %s", path.Join(cpuRoot, "cpu.cfs_quota_us"), err) + } else { + spec.Cpu.Quota = val + } } } } @@ -145,7 +156,7 @@ func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoF if utils.FileExists(cpusetRoot) { spec.HasCpu = true mask := "" - if cgroups.IsCgroup2UnifiedMode() { + if cgroup2UnifiedMode { mask = readString(cpusetRoot, "cpuset.cpus.effective") } else { mask = readString(cpusetRoot, "cpuset.cpus") @@ -157,24 +168,20 @@ func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoF // Memory memoryRoot, ok := cgroupPaths["memory"] if ok { - if !cgroups.IsCgroup2UnifiedMode() { + if cgroup2UnifiedMode { + if utils.FileExists(path.Join(memoryRoot, "memory.max")) { + spec.HasMemory = true + spec.Memory.Reservation = readUInt64(memoryRoot, "memory.high") + spec.Memory.Limit = readUInt64(memoryRoot, "memory.max") + spec.Memory.SwapLimit = readUInt64(memoryRoot, "memory.swap.max") + } + } else { if utils.FileExists(memoryRoot) { spec.HasMemory = true spec.Memory.Limit = readUInt64(memoryRoot, "memory.limit_in_bytes") spec.Memory.SwapLimit = readUInt64(memoryRoot, "memory.memsw.limit_in_bytes") spec.Memory.Reservation = readUInt64(memoryRoot, "memory.soft_limit_in_bytes") } - } else { - memoryRoot, err := findFileInAncestorDir(memoryRoot, "memory.max", "/sys/fs/cgroup") - if err != nil { - return spec, err - } - if memoryRoot != "" { - spec.HasMemory = true - spec.Memory.Reservation = readUInt64(memoryRoot, "memory.high") - spec.Memory.Limit = readUInt64(memoryRoot, "memory.max") - spec.Memory.SwapLimit = readUInt64(memoryRoot, "memory.swap.max") - } } } @@ -199,7 +206,7 @@ func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoF spec.HasFilesystem = hasFilesystem ioControllerName := "blkio" - if cgroups.IsCgroup2UnifiedMode() { + if cgroup2UnifiedMode { ioControllerName = "io" } if blkioRoot, ok := cgroupPaths[ioControllerName]; ok && utils.FileExists(blkioRoot) { @@ -224,9 +231,43 @@ func readString(dirpath string, file string) string { return strings.TrimSpace(string(out)) } +// Convert from [1-10000] to [2-262144] +func convertCPUWeightToCPULimit(weight uint64) (uint64, error) { + const ( + // minWeight is the lowest value possible for cpu.weight + minWeight = 1 + // maxWeight is the highest value possible for cpu.weight + maxWeight = 10000 + ) + if weight < minWeight || weight > maxWeight { + return 0, fmt.Errorf("convertCPUWeightToCPULimit: invalid cpu weight: %v", weight) + } + return 2 + ((weight-1)*262142)/9999, nil +} + +func parseUint64String(strValue string) uint64 { + if strValue == "max" { + return math.MaxUint64 + } + if strValue == "" { + return 0 + } + + val, err := strconv.ParseUint(strValue, 10, 64) + if err != nil { + klog.Errorf("parseUint64String: Failed to parse int %q: %s", strValue, err) + return 0 + } + + return val +} + func readUInt64(dirpath string, file string) uint64 { out := readString(dirpath, file) - if out == "" || out == "max" { + if out == "max" { + return math.MaxUint64 + } + if out == "" { return 0 } diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go index 8667908cf593..51ce36fb60da 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // Package cmpopts provides common options for the cmp package. package cmpopts diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/ignore.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/ignore.go index 48787dd1aa2b..80c60617e40f 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/ignore.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/ignore.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmpopts diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/sort.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/sort.go index 3a4804621e93..a646d7475477 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/sort.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/sort.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmpopts diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/struct_filter.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/struct_filter.go index fe8d1b9cc36f..a09829c3af92 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/struct_filter.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/struct_filter.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmpopts diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go index 9d651553d78a..4eb49d63db31 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go @@ -1,6 +1,6 @@ // Copyright 2018, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmpopts diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/compare.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/compare.go index 6656186846e3..86d0903b8b54 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/compare.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/compare.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // Package cmp determines equality of values. // @@ -100,8 +100,8 @@ func Equal(x, y interface{}, opts ...Option) bool { // same input values and options. // // The output is displayed as a literal in pseudo-Go syntax. -// At the start of each line, a "-" prefix indicates an element removed from y, -// a "+" prefix to indicates an element added to y, and the lack of a prefix +// At the start of each line, a "-" prefix indicates an element removed from x, +// a "+" prefix to indicates an element added from y, and the lack of a prefix // indicates an element common to both x and y. If possible, the output // uses fmt.Stringer.String or error.Error methods to produce more humanly // readable outputs. In such cases, the string is prefixed with either an diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export_panic.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export_panic.go index dfa5d213769b..5ff0b4218c6d 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export_panic.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export_panic.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // +build purego diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export_unsafe.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export_unsafe.go index 351f1a34b468..21eb54858e03 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export_unsafe.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export_unsafe.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // +build !purego diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go index fe98dcc67746..1daaaacc5ee6 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // +build !cmp_debug diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go index 597b6ae56b1b..4b91dbcacaef 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // +build cmp_debug diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go index 730e223ee7b8..bc196b16cfaa 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // Package diff implements an algorithm for producing edit-scripts. // The edit-script is a sequence of operations needed to transform one list @@ -119,7 +119,7 @@ func (r Result) Similar() bool { return r.NumSame+1 >= r.NumDiff } -var randInt = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) +var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 // Difference reports whether two lists of lengths nx and ny are equal // given the definition of equality provided as f. @@ -168,17 +168,6 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) { // A vertical edge is equivalent to inserting a symbol from list Y. // A diagonal edge is equivalent to a matching symbol between both X and Y. - // To ensure flexibility in changing the algorithm in the future, - // introduce some degree of deliberate instability. - // This is achieved by fiddling the zigzag iterator to start searching - // the graph starting from the bottom-right versus than the top-left. - // The result may differ depending on the starting search location, - // but still produces a valid edit script. - zigzagInit := randInt // either 0 or 1 - if flags.Deterministic { - zigzagInit = 0 - } - // Invariants: // • 0 ≤ fwdPath.X ≤ (fwdFrontier.X, revFrontier.X) ≤ revPath.X ≤ nx // • 0 ≤ fwdPath.Y ≤ (fwdFrontier.Y, revFrontier.Y) ≤ revPath.Y ≤ ny @@ -197,6 +186,11 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) { // approximately the square-root of the search budget. searchBudget := 4 * (nx + ny) // O(n) + // Running the tests with the "cmp_debug" build tag prints a visualization + // of the algorithm running in real-time. This is educational for + // understanding how the algorithm works. See debug_enable.go. + f = debug.Begin(nx, ny, f, &fwdPath.es, &revPath.es) + // The algorithm below is a greedy, meet-in-the-middle algorithm for // computing sub-optimal edit-scripts between two lists. // @@ -214,22 +208,28 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) { // frontier towards the opposite corner. // • This algorithm terminates when either the X coordinates or the // Y coordinates of the forward and reverse frontier points ever intersect. - // + // This algorithm is correct even if searching only in the forward direction // or in the reverse direction. We do both because it is commonly observed // that two lists commonly differ because elements were added to the front // or end of the other list. // - // Running the tests with the "cmp_debug" build tag prints a visualization - // of the algorithm running in real-time. This is educational for - // understanding how the algorithm works. See debug_enable.go. - f = debug.Begin(nx, ny, f, &fwdPath.es, &revPath.es) - for { + // Non-deterministically start with either the forward or reverse direction + // to introduce some deliberate instability so that we have the flexibility + // to change this algorithm in the future. + if flags.Deterministic || randBool { + goto forwardSearch + } else { + goto reverseSearch + } + +forwardSearch: + { // Forward search from the beginning. if fwdFrontier.X >= revFrontier.X || fwdFrontier.Y >= revFrontier.Y || searchBudget == 0 { - break + goto finishSearch } - for stop1, stop2, i := false, false, zigzagInit; !(stop1 && stop2) && searchBudget > 0; i++ { + for stop1, stop2, i := false, false, 0; !(stop1 && stop2) && searchBudget > 0; i++ { // Search in a diagonal pattern for a match. z := zigzag(i) p := point{fwdFrontier.X + z, fwdFrontier.Y - z} @@ -262,10 +262,14 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) { } else { fwdFrontier.Y++ } + goto reverseSearch + } +reverseSearch: + { // Reverse search from the end. if fwdFrontier.X >= revFrontier.X || fwdFrontier.Y >= revFrontier.Y || searchBudget == 0 { - break + goto finishSearch } for stop1, stop2, i := false, false, 0; !(stop1 && stop2) && searchBudget > 0; i++ { // Search in a diagonal pattern for a match. @@ -300,8 +304,10 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) { } else { revFrontier.Y-- } + goto forwardSearch } +finishSearch: // Join the forward and reverse paths and then append the reverse path. fwdPath.connect(revPath.point, f) for i := len(revPath.es) - 1; i >= 0; i-- { diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go index a9e7fc0b5b39..d8e459c9b937 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go @@ -1,6 +1,6 @@ // Copyright 2019, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package flags diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go index 01aed0a1532b..82d1d7fbf8a2 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go @@ -1,6 +1,6 @@ // Copyright 2019, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // +build !go1.10 diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go index c0b667f58b05..8646f0529343 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go @@ -1,6 +1,6 @@ // Copyright 2019, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // +build go1.10 diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/function/func.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/function/func.go index ace1dbe86e57..d127d436230d 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/function/func.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/function/func.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // Package function provides functionality for identifying function types. package function diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/name.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/name.go index 8228e7d512a3..b6c12cefb47e 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/name.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/name.go @@ -1,6 +1,6 @@ // Copyright 2020, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package value diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go index e9e384a1c89d..44f4a5afddcb 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go @@ -1,6 +1,6 @@ // Copyright 2018, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // +build purego diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go index b50c17ec725a..a605953d4666 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go @@ -1,6 +1,6 @@ // Copyright 2018, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. // +build !purego diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go index 24fbae6e3c57..98533b036ccf 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package value diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go index 06a8ffd036d5..9147a2997311 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package value diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/options.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/options.go index 4b0407a7f887..e57b9eb5392d 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/options.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/options.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmp diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/path.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/path.go index 603dbb0026e6..3d45c1a47f28 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/path.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/path.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmp diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report.go index aafcb3635451..f43cd12eb5f3 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report.go @@ -1,6 +1,6 @@ // Copyright 2017, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmp diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_compare.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_compare.go index 9e2180964f1b..a6c070cfcd9e 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_compare.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_compare.go @@ -1,6 +1,6 @@ // Copyright 2019, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmp diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_references.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_references.go index d620c2c20e7f..be31b33a9e19 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_references.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_references.go @@ -1,6 +1,6 @@ // Copyright 2020, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmp diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_reflect.go index 786f671269cf..33f03577f98f 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -1,6 +1,6 @@ // Copyright 2019, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmp @@ -351,6 +351,8 @@ func formatMapKey(v reflect.Value, disambiguate bool, ptrs *pointerReferences) s opts.PrintAddresses = disambiguate opts.AvoidStringer = disambiguate opts.QualifiedNames = disambiguate + opts.VerbosityLevel = maxVerbosityPreset + opts.LimitVerbosity = true s := opts.FormatValue(v, reflect.Map, ptrs).String() return strings.TrimSpace(s) } diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_slices.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_slices.go index 35315dad3552..da04caf16490 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_slices.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_slices.go @@ -1,6 +1,6 @@ // Copyright 2019, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmp diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_text.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_text.go index 8b12c05cd4f3..0fd46d7ffb6e 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_text.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_text.go @@ -1,6 +1,6 @@ // Copyright 2019, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmp diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_value.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_value.go index 83031a7f5070..668d470fd83f 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_value.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/report_value.go @@ -1,6 +1,6 @@ // Copyright 2019, The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE.md file. +// license that can be found in the LICENSE file. package cmp diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo.go index fe828c8f583d..403a893310b4 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo.go +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo.go @@ -29,35 +29,38 @@ type Info struct { // ID is a unique identifier of the mount (may be reused after umount). ID int - // Parent indicates the ID of the mount parent (or of self for the top of the - // mount tree). + // Parent is the ID of the parent mount (or of self for the root + // of this mount namespace's mount tree). Parent int - // Major indicates one half of the device ID which identifies the device class. - Major int + // Major and Minor are the major and the minor components of the Dev + // field of unix.Stat_t structure returned by unix.*Stat calls for + // files on this filesystem. + Major, Minor int - // Minor indicates one half of the device ID which identifies a specific - // instance of device. - Minor int - - // Root of the mount within the filesystem. + // Root is the pathname of the directory in the filesystem which forms + // the root of this mount. Root string - // Mountpoint indicates the mount point relative to the process's root. + // Mountpoint is the pathname of the mount point relative to the + // process's root directory. Mountpoint string - // Options represents mount-specific options. + // Options is a comma-separated list of mount options. Options string - // Optional represents optional fields. + // Optional are zero or more fields of the form "tag[:value]", + // separated by a space. Currently, the possible optional fields are + // "shared", "master", "propagate_from", and "unbindable". For more + // information, see mount_namespaces(7) Linux man page. Optional string - // FSType indicates the type of filesystem, such as EXT3. + // FSType is the filesystem type in the form "type[.subtype]". FSType string - // Source indicates filesystem specific information or "none". + // Source is filesystem-specific information, or "none". Source string - // VFSOptions represents per super block options. + // VFSOptions is a comma-separated list of superblock options. VFSOptions string } diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_filters.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_filters.go index 5869b2cee391..16079c3c541b 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_filters.go +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_filters.go @@ -14,11 +14,16 @@ import "strings" // stop: true if parsing should be stopped after the entry. type FilterFunc func(*Info) (skip, stop bool) -// PrefixFilter discards all entries whose mount points -// do not start with a specific prefix. +// PrefixFilter discards all entries whose mount points do not start with, or +// are equal to the path specified in prefix. The prefix path must be absolute, +// have all symlinks resolved, and cleaned (i.e. no extra slashes or dots). +// +// PrefixFilter treats prefix as a path, not a partial prefix, which means that +// given "/foo", "/foo/bar" and "/foobar" entries, PrefixFilter("/foo") returns +// "/foo" and "/foo/bar", and discards "/foobar". func PrefixFilter(prefix string) FilterFunc { return func(m *Info) (bool, bool) { - skip := !strings.HasPrefix(m.Mountpoint, prefix) + skip := !strings.HasPrefix(m.Mountpoint+"/", prefix+"/") return skip, false } } diff --git a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go index e591c8365389..f09a70fa0d9d 100644 --- a/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go +++ b/cluster-autoscaler/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go @@ -12,7 +12,8 @@ import ( // GetMountsFromReader retrieves a list of mounts from the // reader provided, with an optional filter applied (use nil // for no filter). This can be useful in tests or benchmarks -// that provide a fake mountinfo data. +// that provide fake mountinfo data, or when a source other +// than /proc/self/mountinfo needs to be read from. // // This function is Linux-specific. func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) { @@ -133,8 +134,6 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) { return out, nil } -// Parse /proc/self/mountinfo because comparing Dev and ino does not work from -// bind mounts func parseMountTable(filter FilterFunc) ([]*Info, error) { f, err := os.Open("/proc/self/mountinfo") if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/README.md b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/README.md index 8b25d5c1c014..13eee49d4b97 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/README.md +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/README.md @@ -57,6 +57,10 @@ struct describing how the container is to be created. A sample would look simila ```go defaultMountFlags := unix.MS_NOEXEC | unix.MS_NOSUID | unix.MS_NODEV +var devices []*configs.DeviceRule +for _, device := range specconv.AllowedDevices { + devices = append(devices, &device.Rule) +} config := &configs.Config{ Rootfs: "/your/path/to/rootfs", Capabilities: &configs.Capabilities{ @@ -155,7 +159,7 @@ config := &configs.Config{ Parent: "system", Resources: &configs.Resources{ MemorySwappiness: nil, - Devices: specconv.AllowedDevices, + Devices: devices, }, }, MaskPaths: []string{ @@ -313,7 +317,7 @@ state, err := container.State() #### Checkpoint & Restore libcontainer now integrates [CRIU](http://criu.org/) for checkpointing and restoring containers. -This let's you save the state of a process running inside a container to disk, and then restore +This lets you save the state of a process running inside a container to disk, and then restore that state into a new process, on the same machine or on another machine. `criu` version 1.5.2 or higher is required to use checkpoint and restore. diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go index 73965f12d83b..5da14fb3b16a 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go @@ -1,27 +1,41 @@ package apparmor import ( - "bytes" + "errors" "fmt" "io/ioutil" "os" + "sync" "github.com/opencontainers/runc/libcontainer/utils" ) +var ( + appArmorEnabled bool + checkAppArmor sync.Once +) + // IsEnabled returns true if apparmor is enabled for the host. func IsEnabled() bool { - if _, err := os.Stat("/sys/kernel/security/apparmor"); err == nil { - buf, err := ioutil.ReadFile("/sys/module/apparmor/parameters/enabled") - return err == nil && bytes.HasPrefix(buf, []byte("Y")) - } - return false + checkAppArmor.Do(func() { + if _, err := os.Stat("/sys/kernel/security/apparmor"); err == nil { + buf, err := ioutil.ReadFile("/sys/module/apparmor/parameters/enabled") + appArmorEnabled = err == nil && len(buf) > 1 && buf[0] == 'Y' + } + }) + return appArmorEnabled } func setProcAttr(attr, value string) error { // Under AppArmor you can only change your own attr, so use /proc/self/ // instead of /proc// like libapparmor does - f, err := os.OpenFile("/proc/self/attr/"+attr, os.O_WRONLY, 0) + attrPath := "/proc/self/attr/apparmor/" + attr + if _, err := os.Stat(attrPath); errors.Is(err, os.ErrNotExist) { + // fall back to the old convention + attrPath = "/proc/self/attr/" + attr + } + + f, err := os.OpenFile(attrPath, os.O_WRONLY, 0) if err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities.go index adbf6330c48e..1099d32b1460 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/capabilities/capabilities.go @@ -3,16 +3,26 @@ package capabilities import ( - "fmt" + "sort" "strings" "github.com/opencontainers/runc/libcontainer/configs" + "github.com/sirupsen/logrus" "github.com/syndtr/gocapability/capability" ) -const allCapabilityTypes = capability.CAPS | capability.BOUNDS | capability.AMBS +const allCapabilityTypes = capability.CAPS | capability.BOUNDING | capability.AMBIENT -var capabilityMap map[string]capability.Cap +var ( + capabilityMap map[string]capability.Cap + capTypes = []capability.CapType{ + capability.BOUNDING, + capability.PERMITTED, + capability.INHERITABLE, + capability.EFFECTIVE, + capability.AMBIENT, + } +) func init() { capabilityMap = make(map[string]capability.Cap, capability.CAP_LAST_CAP+1) @@ -24,73 +34,78 @@ func init() { } } -// New creates a new Caps from the given Capabilities config. +// New creates a new Caps from the given Capabilities config. Unknown Capabilities +// or Capabilities that are unavailable in the current environment are ignored, +// printing a warning instead. func New(capConfig *configs.Capabilities) (*Caps, error) { var ( - err error - caps Caps + err error + c Caps ) - if caps.bounding, err = capSlice(capConfig.Bounding); err != nil { - return nil, err - } - if caps.effective, err = capSlice(capConfig.Effective); err != nil { - return nil, err - } - if caps.inheritable, err = capSlice(capConfig.Inheritable); err != nil { - return nil, err + unknownCaps := make(map[string]struct{}) + c.caps = map[capability.CapType][]capability.Cap{ + capability.BOUNDING: capSlice(capConfig.Bounding, unknownCaps), + capability.EFFECTIVE: capSlice(capConfig.Effective, unknownCaps), + capability.INHERITABLE: capSlice(capConfig.Inheritable, unknownCaps), + capability.PERMITTED: capSlice(capConfig.Permitted, unknownCaps), + capability.AMBIENT: capSlice(capConfig.Ambient, unknownCaps), } - if caps.permitted, err = capSlice(capConfig.Permitted); err != nil { + if c.pid, err = capability.NewPid2(0); err != nil { return nil, err } - if caps.ambient, err = capSlice(capConfig.Ambient); err != nil { + if err = c.pid.Load(); err != nil { return nil, err } - if caps.pid, err = capability.NewPid2(0); err != nil { - return nil, err - } - if err = caps.pid.Load(); err != nil { - return nil, err + if len(unknownCaps) > 0 { + logrus.Warn("ignoring unknown or unavailable capabilities: ", mapKeys(unknownCaps)) } - return &caps, nil + return &c, nil } -func capSlice(caps []string) ([]capability.Cap, error) { - out := make([]capability.Cap, len(caps)) - for i, c := range caps { - v, ok := capabilityMap[c] - if !ok { - return nil, fmt.Errorf("unknown capability %q", c) +// capSlice converts the slice of capability names in caps, to their numeric +// equivalent, and returns them as a slice. Unknown or unavailable capabilities +// are not returned, but appended to unknownCaps. +func capSlice(caps []string, unknownCaps map[string]struct{}) []capability.Cap { + var out []capability.Cap + for _, c := range caps { + if v, ok := capabilityMap[c]; !ok { + unknownCaps[c] = struct{}{} + } else { + out = append(out, v) } - out[i] = v } - return out, nil + return out +} + +// mapKeys returns the keys of input in sorted order +func mapKeys(input map[string]struct{}) []string { + var keys []string + for c := range input { + keys = append(keys, c) + } + sort.Strings(keys) + return keys } // Caps holds the capabilities for a container. type Caps struct { - pid capability.Capabilities - bounding []capability.Cap - effective []capability.Cap - inheritable []capability.Cap - permitted []capability.Cap - ambient []capability.Cap + pid capability.Capabilities + caps map[capability.CapType][]capability.Cap } // ApplyBoundingSet sets the capability bounding set to those specified in the whitelist. func (c *Caps) ApplyBoundingSet() error { - c.pid.Clear(capability.BOUNDS) - c.pid.Set(capability.BOUNDS, c.bounding...) - return c.pid.Apply(capability.BOUNDS) + c.pid.Clear(capability.BOUNDING) + c.pid.Set(capability.BOUNDING, c.caps[capability.BOUNDING]...) + return c.pid.Apply(capability.BOUNDING) } // Apply sets all the capabilities for the current process in the config. func (c *Caps) ApplyCaps() error { c.pid.Clear(allCapabilityTypes) - c.pid.Set(capability.BOUNDS, c.bounding...) - c.pid.Set(capability.PERMITTED, c.permitted...) - c.pid.Set(capability.INHERITABLE, c.inheritable...) - c.pid.Set(capability.EFFECTIVE, c.effective...) - c.pid.Set(capability.AMBIENT, c.ambient...) + for _, g := range capTypes { + c.pid.Set(g, c.caps[g]...) + } return c.pid.Apply(allCapabilityTypes) } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go index a16a68e9796a..68a346ca531a 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go @@ -7,37 +7,44 @@ import ( ) type Manager interface { - // Applies cgroup configuration to the process with the specified pid + // Apply creates a cgroup, if not yet created, and adds a process + // with the specified pid into that cgroup. A special value of -1 + // can be used to merely create a cgroup. Apply(pid int) error - // Returns the PIDs inside the cgroup set + // GetPids returns the PIDs of all processes inside the cgroup. GetPids() ([]int, error) - // Returns the PIDs inside the cgroup set & all sub-cgroups + // GetAllPids returns the PIDs of all processes inside the cgroup + // any all its sub-cgroups. GetAllPids() ([]int, error) - // Returns statistics for the cgroup set + // GetStats returns cgroups statistics. GetStats() (*Stats, error) - // Toggles the freezer cgroup according with specified state + // Freeze sets the freezer cgroup to the specified state. Freeze(state configs.FreezerState) error - // Destroys the cgroup set + // Destroy removes cgroup. Destroy() error // Path returns a cgroup path to the specified controller/subsystem. // For cgroupv2, the argument is unused and can be empty. Path(string) string - // Sets the cgroup as configured. - Set(container *configs.Config) error + // Set sets cgroup resources parameters/limits. If the argument is nil, + // the resources specified during Manager creation (or the previous call + // to Set) are used. + Set(r *configs.Resources) error - // GetPaths returns cgroup path(s) to save in a state file in order to restore later. + // GetPaths returns cgroup path(s) to save in a state file in order to + // restore later. // - // For cgroup v1, a key is cgroup subsystem name, and the value is the path - // to the cgroup for this subsystem. + // For cgroup v1, a key is cgroup subsystem name, and the value is the + // path to the cgroup for this subsystem. // - // For cgroup v2 unified hierarchy, a key is "", and the value is the unified path. + // For cgroup v2 unified hierarchy, a key is "", and the value is the + // unified path. GetPaths() map[string]string // GetCgroups returns the cgroup data as configured. @@ -46,6 +53,9 @@ type Manager interface { // GetFreezerState retrieves the current FreezerState of the cgroup. GetFreezerState() (configs.FreezerState, error) - // Whether the cgroup path exists or not + // Exists returns whether the cgroup path exists or not. Exists() bool + + // OOMKillCount reports OOM kill count for the cgroup. + OOMKillCount() (uint64, error) } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go index a173fd4a16f7..fcd3746e0238 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go @@ -127,10 +127,10 @@ func (p *program) appendDevice(dev *devices.Rule) error { } if hasAccess { p.insts = append(p.insts, - // if (R3 & bpfAccess == 0 /* use R1 as a temp var */) goto next + // if (R3 & bpfAccess != R3 /* use R1 as a temp var */) goto next asm.Mov.Reg32(asm.R1, asm.R3), asm.And.Imm32(asm.R1, bpfAccess), - asm.JEq.Imm(asm.R1, 0, nextBlockSym), + asm.JNE.Reg(asm.R1, asm.R3, nextBlockSym), ) } if hasMajor { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/ebpf.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/ebpf.go index 4795e0aa3f05..3bee21cb7de3 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/ebpf.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/ebpf/ebpf.go @@ -3,6 +3,7 @@ package ebpf import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/asm" + "github.com/cilium/ebpf/link" "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -32,12 +33,23 @@ func LoadAttachCgroupDeviceFilter(insts asm.Instructions, license string, dirFD if err != nil { return nilCloser, err } - if err := prog.Attach(dirFD, ebpf.AttachCGroupDevice, unix.BPF_F_ALLOW_MULTI); err != nil { + err = link.RawAttachProgram(link.RawAttachProgramOptions{ + Target: dirFD, + Program: prog, + Attach: ebpf.AttachCGroupDevice, + Flags: unix.BPF_F_ALLOW_MULTI, + }) + if err != nil { return nilCloser, errors.Wrap(err, "failed to call BPF_PROG_ATTACH (BPF_CGROUP_DEVICE, BPF_F_ALLOW_MULTI)") } closer := func() error { - if err := prog.Detach(dirFD, ebpf.AttachCGroupDevice, unix.BPF_F_ALLOW_MULTI); err != nil { - return errors.Wrap(err, "failed to call BPF_PROG_DETACH (BPF_CGROUP_DEVICE, BPF_F_ALLOW_MULTI)") + err = link.RawDetachProgram(link.RawDetachProgramOptions{ + Target: dirFD, + Program: prog, + Attach: ebpf.AttachCGroupDevice, + }) + if err != nil { + return errors.Wrap(err, "failed to call BPF_PROG_DETACH (BPF_CGROUP_DEVICE)") } return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go index dca2a6220785..05fec2603072 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go @@ -25,19 +25,19 @@ func (s *BlkioGroup) Apply(path string, d *cgroupData) error { return join(path, d.pid) } -func (s *BlkioGroup) Set(path string, cgroup *configs.Cgroup) error { - if cgroup.Resources.BlkioWeight != 0 { - if err := fscommon.WriteFile(path, "blkio.weight", strconv.FormatUint(uint64(cgroup.Resources.BlkioWeight), 10)); err != nil { +func (s *BlkioGroup) Set(path string, r *configs.Resources) error { + if r.BlkioWeight != 0 { + if err := fscommon.WriteFile(path, "blkio.weight", strconv.FormatUint(uint64(r.BlkioWeight), 10)); err != nil { return err } } - if cgroup.Resources.BlkioLeafWeight != 0 { - if err := fscommon.WriteFile(path, "blkio.leaf_weight", strconv.FormatUint(uint64(cgroup.Resources.BlkioLeafWeight), 10)); err != nil { + if r.BlkioLeafWeight != 0 { + if err := fscommon.WriteFile(path, "blkio.leaf_weight", strconv.FormatUint(uint64(r.BlkioLeafWeight), 10)); err != nil { return err } } - for _, wd := range cgroup.Resources.BlkioWeightDevice { + for _, wd := range r.BlkioWeightDevice { if err := fscommon.WriteFile(path, "blkio.weight_device", wd.WeightString()); err != nil { return err } @@ -45,22 +45,22 @@ func (s *BlkioGroup) Set(path string, cgroup *configs.Cgroup) error { return err } } - for _, td := range cgroup.Resources.BlkioThrottleReadBpsDevice { + for _, td := range r.BlkioThrottleReadBpsDevice { if err := fscommon.WriteFile(path, "blkio.throttle.read_bps_device", td.String()); err != nil { return err } } - for _, td := range cgroup.Resources.BlkioThrottleWriteBpsDevice { + for _, td := range r.BlkioThrottleWriteBpsDevice { if err := fscommon.WriteFile(path, "blkio.throttle.write_bps_device", td.String()); err != nil { return err } } - for _, td := range cgroup.Resources.BlkioThrottleReadIOPSDevice { + for _, td := range r.BlkioThrottleReadIOPSDevice { if err := fscommon.WriteFile(path, "blkio.throttle.read_iops_device", td.String()); err != nil { return err } } - for _, td := range cgroup.Resources.BlkioThrottleWriteIOPSDevice { + for _, td := range r.BlkioThrottleWriteIOPSDevice { if err := fscommon.WriteFile(path, "blkio.throttle.write_iops_device", td.String()); err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go index 1d5f455d6a40..975df1c4e8a2 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go @@ -32,7 +32,7 @@ func (s *CpuGroup) Apply(path string, d *cgroupData) error { // We should set the real-Time group scheduling settings before moving // in the process because if the process is already in SCHED_RR mode // and no RT bandwidth is set, adding it will fail. - if err := s.SetRtSched(path, d.config); err != nil { + if err := s.SetRtSched(path, d.config.Resources); err != nil { return err } // Since we are not using join(), we need to place the pid @@ -40,23 +40,23 @@ func (s *CpuGroup) Apply(path string, d *cgroupData) error { return cgroups.WriteCgroupProc(path, d.pid) } -func (s *CpuGroup) SetRtSched(path string, cgroup *configs.Cgroup) error { - if cgroup.Resources.CpuRtPeriod != 0 { - if err := fscommon.WriteFile(path, "cpu.rt_period_us", strconv.FormatUint(cgroup.Resources.CpuRtPeriod, 10)); err != nil { +func (s *CpuGroup) SetRtSched(path string, r *configs.Resources) error { + if r.CpuRtPeriod != 0 { + if err := fscommon.WriteFile(path, "cpu.rt_period_us", strconv.FormatUint(r.CpuRtPeriod, 10)); err != nil { return err } } - if cgroup.Resources.CpuRtRuntime != 0 { - if err := fscommon.WriteFile(path, "cpu.rt_runtime_us", strconv.FormatInt(cgroup.Resources.CpuRtRuntime, 10)); err != nil { + if r.CpuRtRuntime != 0 { + if err := fscommon.WriteFile(path, "cpu.rt_runtime_us", strconv.FormatInt(r.CpuRtRuntime, 10)); err != nil { return err } } return nil } -func (s *CpuGroup) Set(path string, cgroup *configs.Cgroup) error { - if cgroup.Resources.CpuShares != 0 { - shares := cgroup.Resources.CpuShares +func (s *CpuGroup) Set(path string, r *configs.Resources) error { + if r.CpuShares != 0 { + shares := r.CpuShares if err := fscommon.WriteFile(path, "cpu.shares", strconv.FormatUint(shares, 10)); err != nil { return err } @@ -72,17 +72,17 @@ func (s *CpuGroup) Set(path string, cgroup *configs.Cgroup) error { return fmt.Errorf("the minimum allowed cpu-shares is %d", sharesRead) } } - if cgroup.Resources.CpuPeriod != 0 { - if err := fscommon.WriteFile(path, "cpu.cfs_period_us", strconv.FormatUint(cgroup.Resources.CpuPeriod, 10)); err != nil { + if r.CpuPeriod != 0 { + if err := fscommon.WriteFile(path, "cpu.cfs_period_us", strconv.FormatUint(r.CpuPeriod, 10)); err != nil { return err } } - if cgroup.Resources.CpuQuota != 0 { - if err := fscommon.WriteFile(path, "cpu.cfs_quota_us", strconv.FormatInt(cgroup.Resources.CpuQuota, 10)); err != nil { + if r.CpuQuota != 0 { + if err := fscommon.WriteFile(path, "cpu.cfs_quota_us", strconv.FormatInt(r.CpuQuota, 10)); err != nil { return err } } - return s.SetRtSched(path, cgroup) + return s.SetRtSched(path, r) } func (s *CpuGroup) GetStats(path string, stats *cgroups.Stats) error { @@ -97,7 +97,7 @@ func (s *CpuGroup) GetStats(path string, stats *cgroups.Stats) error { sc := bufio.NewScanner(f) for sc.Scan() { - t, v, err := fscommon.GetCgroupParamKeyValue(sc.Text()) + t, v, err := fscommon.ParseKeyValue(sc.Text()) if err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go index 129de6a01cd1..0445cd45b4d4 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go @@ -43,7 +43,7 @@ func (s *CpuacctGroup) Apply(path string, d *cgroupData) error { return join(path, d.pid) } -func (s *CpuacctGroup) Set(path string, cgroup *configs.Cgroup) error { +func (s *CpuacctGroup) Set(_ string, _ *configs.Resources) error { return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go index 5bde025b4b91..0591122bca50 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go @@ -24,17 +24,17 @@ func (s *CpusetGroup) Name() string { } func (s *CpusetGroup) Apply(path string, d *cgroupData) error { - return s.ApplyDir(path, d.config, d.pid) + return s.ApplyDir(path, d.config.Resources, d.pid) } -func (s *CpusetGroup) Set(path string, cgroup *configs.Cgroup) error { - if cgroup.Resources.CpusetCpus != "" { - if err := fscommon.WriteFile(path, "cpuset.cpus", cgroup.Resources.CpusetCpus); err != nil { +func (s *CpusetGroup) Set(path string, r *configs.Resources) error { + if r.CpusetCpus != "" { + if err := fscommon.WriteFile(path, "cpuset.cpus", r.CpusetCpus); err != nil { return err } } - if cgroup.Resources.CpusetMems != "" { - if err := fscommon.WriteFile(path, "cpuset.mems", cgroup.Resources.CpusetMems); err != nil { + if r.CpusetMems != "" { + if err := fscommon.WriteFile(path, "cpuset.mems", r.CpusetMems); err != nil { return err } } @@ -144,7 +144,7 @@ func (s *CpusetGroup) GetStats(path string, stats *cgroups.Stats) error { return nil } -func (s *CpusetGroup) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) error { +func (s *CpusetGroup) ApplyDir(dir string, r *configs.Resources, pid int) error { // This might happen if we have no cpuset cgroup mounted. // Just do nothing and don't fail. if dir == "" { @@ -166,7 +166,7 @@ func (s *CpusetGroup) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) erro // specified configs, otherwise, inherit from parent. This makes // cpuset configs work correctly with 'cpuset.cpu_exclusive', and // keep backward compatibility. - if err := s.ensureCpusAndMems(dir, cgroup); err != nil { + if err := s.ensureCpusAndMems(dir, r); err != nil { return err } @@ -241,8 +241,8 @@ func isEmptyCpuset(str string) bool { return str == "" || str == "\n" } -func (s *CpusetGroup) ensureCpusAndMems(path string, cgroup *configs.Cgroup) error { - if err := s.Set(path, cgroup); err != nil { +func (s *CpusetGroup) ensureCpusAndMems(path string, r *configs.Resources) error { + if err := s.Set(path, r); err != nil { return err } return cpusetCopyIfNeeded(path, filepath.Dir(path)) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go index 9a37e68ec651..048f11398a9c 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go @@ -12,7 +12,7 @@ import ( "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/devices" - "github.com/opencontainers/runc/libcontainer/system" + "github.com/opencontainers/runc/libcontainer/userns" ) type DevicesGroup struct { @@ -54,8 +54,8 @@ func buildEmulator(rules []*devices.Rule) (*cgroupdevices.Emulator, error) { return emu, nil } -func (s *DevicesGroup) Set(path string, cgroup *configs.Cgroup) error { - if system.RunningInUserNS() || cgroup.SkipDevices { +func (s *DevicesGroup) Set(path string, r *configs.Resources) error { + if userns.RunningInUserNS() || r.SkipDevices { return nil } @@ -65,7 +65,7 @@ func (s *DevicesGroup) Set(path string, cgroup *configs.Cgroup) error { if err != nil { return err } - target, err := buildEmulator(cgroup.Resources.Devices) + target, err := buildEmulator(r.Devices) if err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go index 25aff4f863fd..cf2f948fe3fd 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go @@ -12,6 +12,7 @@ import ( "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -26,29 +27,62 @@ func (s *FreezerGroup) Apply(path string, d *cgroupData) error { return join(path, d.pid) } -func (s *FreezerGroup) Set(path string, cgroup *configs.Cgroup) error { - switch cgroup.Resources.Freezer { +func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) { + switch r.Freezer { case configs.Frozen: + defer func() { + if Err != nil { + // Freezing failed, and it is bad and dangerous + // to leave the cgroup in FROZEN or FREEZING + // state, so (try to) thaw it back. + _ = fscommon.WriteFile(path, "freezer.state", string(configs.Thawed)) + } + }() + // As per older kernel docs (freezer-subsystem.txt before // kernel commit ef9fe980c6fcc1821), if FREEZING is seen, // userspace should either retry or thaw. While current // kernel cgroup v1 docs no longer mention a need to retry, - // the kernel (tested on v5.4, Ubuntu 20.04) can't reliably - // freeze a cgroup while new processes keep appearing in it + // even a recent kernel (v5.4, Ubuntu 20.04) can't reliably + // freeze a cgroup v1 while new processes keep appearing in it // (either via fork/clone or by writing new PIDs to // cgroup.procs). // - // The number of retries below is chosen to have a decent - // chance to succeed even in the worst case scenario (runc - // pause/unpause with parallel runc exec). + // The numbers below are empirically chosen to have a decent + // chance to succeed in various scenarios ("runc pause/unpause + // with parallel runc exec" and "bare freeze/unfreeze on a very + // slow system"), tested on RHEL7 and Ubuntu 20.04 kernels. // // Adding any amount of sleep in between retries did not - // increase the chances of successful freeze. + // increase the chances of successful freeze in "pause/unpause + // with parallel exec" reproducer. OTOH, adding an occasional + // sleep helped for the case where the system is extremely slow + // (CentOS 7 VM on GHA CI). + // + // Alas, this is still a game of chances, since the real fix + // belong to the kernel (cgroup v2 do not have this bug). + for i := 0; i < 1000; i++ { + if i%50 == 49 { + // Occasional thaw and sleep improves + // the chances to succeed in freezing + // in case new processes keep appearing + // in the cgroup. + _ = fscommon.WriteFile(path, "freezer.state", string(configs.Thawed)) + time.Sleep(10 * time.Millisecond) + } + if err := fscommon.WriteFile(path, "freezer.state", string(configs.Frozen)); err != nil { return err } + if i%25 == 24 { + // Occasional short sleep before reading + // the state back also improves the chances to + // succeed in freezing in case of a very slow + // system. + time.Sleep(10 * time.Microsecond) + } state, err := fscommon.ReadFile(path, "freezer.state") if err != nil { return err @@ -58,6 +92,9 @@ func (s *FreezerGroup) Set(path string, cgroup *configs.Cgroup) error { case "FREEZING": continue case string(configs.Frozen): + if i > 1 { + logrus.Debugf("frozen after %d retries", i) + } return nil default: // should never happen @@ -65,16 +102,13 @@ func (s *FreezerGroup) Set(path string, cgroup *configs.Cgroup) error { } } // Despite our best efforts, it got stuck in FREEZING. - // Leaving it in this state is bad and dangerous, so - // let's (try to) thaw it back and error out. - _ = fscommon.WriteFile(path, "freezer.state", string(configs.Thawed)) return errors.New("unable to freeze") case configs.Thawed: return fscommon.WriteFile(path, "freezer.state", string(configs.Thawed)) case configs.Undefined: return nil default: - return fmt.Errorf("Invalid argument '%s' to freezer.state", string(cgroup.Resources.Freezer)) + return fmt.Errorf("Invalid argument '%s' to freezer.state", string(r.Freezer)) } } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go index a42ce4535e97..7dc4b9e37844 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go @@ -9,6 +9,7 @@ import ( "sync" "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" libcontainerUtils "github.com/opencontainers/runc/libcontainer/utils" "github.com/pkg/errors" @@ -43,8 +44,8 @@ type subsystem interface { GetStats(path string, stats *cgroups.Stats) error // Creates and joins the cgroup represented by 'cgroupData'. Apply(path string, c *cgroupData) error - // Set the cgroup represented by cgroup. - Set(path string, cgroup *configs.Cgroup) error + // Set sets the cgroup resources. + Set(path string, r *configs.Resources) error } type manager struct { @@ -273,8 +274,8 @@ func (m *manager) GetStats() (*cgroups.Stats, error) { return stats, nil } -func (m *manager) Set(container *configs.Config) error { - if container.Cgroups == nil { +func (m *manager) Set(r *configs.Resources) error { + if r == nil { return nil } @@ -283,7 +284,7 @@ func (m *manager) Set(container *configs.Config) error { if m.cgroups != nil && m.cgroups.Paths != nil { return nil } - if container.Cgroups.Resources.Unified != nil { + if r.Unified != nil { return cgroups.ErrV1NoUnified } @@ -291,11 +292,11 @@ func (m *manager) Set(container *configs.Config) error { defer m.mu.Unlock() for _, sys := range subsystems { path := m.paths[sys.Name()] - if err := sys.Set(path, container.Cgroups); err != nil { + if err := sys.Set(path, r); err != nil { if m.rootless && sys.Name() == "devices" { continue } - // When m.Rootless is true, errors from the device subsystem are ignored because it is really not expected to work. + // When m.rootless is true, errors from the device subsystem are ignored because it is really not expected to work. // However, errors from other subsystems are not ignored. // see @test "runc create (rootless + limits + no cgrouppath + no permission) fails with informative error" if path == "" { @@ -321,7 +322,7 @@ func (m *manager) Freeze(state configs.FreezerState) error { prevState := m.cgroups.Resources.Freezer m.cgroups.Resources.Freezer = state freezer := &FreezerGroup{} - if err := freezer.Set(path, m.cgroups); err != nil { + if err := freezer.Set(path, m.cgroups.Resources); err != nil { m.cgroups.Resources.Freezer = prevState return err } @@ -421,3 +422,17 @@ func (m *manager) GetFreezerState() (configs.FreezerState, error) { func (m *manager) Exists() bool { return cgroups.PathExists(m.Path("devices")) } + +func OOMKillCount(path string) (uint64, error) { + return fscommon.GetValueByKey(path, "memory.oom_control", "oom_kill") +} + +func (m *manager) OOMKillCount() (uint64, error) { + c, err := OOMKillCount(m.Path("memory")) + // Ignore ENOENT when rootless as it couldn't create cgroup. + if err != nil && m.rootless && os.IsNotExist(err) { + err = nil + } + + return c, err +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go index 861793411e6a..cf2b93bc5366 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go @@ -22,8 +22,8 @@ func (s *HugetlbGroup) Apply(path string, d *cgroupData) error { return join(path, d.pid) } -func (s *HugetlbGroup) Set(path string, cgroup *configs.Cgroup) error { - for _, hugetlb := range cgroup.Resources.HugetlbLimit { +func (s *HugetlbGroup) Set(path string, r *configs.Resources) error { + for _, hugetlb := range r.HugetlbLimit { if err := fscommon.WriteFile(path, "hugetlb."+hugetlb.Pagesize+".limit_in_bytes", strconv.FormatUint(hugetlb.Limit, 10)); err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem.go deleted file mode 100644 index 86858f9083e9..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build linux,!nokmem - -package fs - -import ( - "errors" - "fmt" - "path/filepath" - "strconv" - - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "golang.org/x/sys/unix" -) - -const cgroupKernelMemoryLimit = "memory.kmem.limit_in_bytes" - -func EnableKernelMemoryAccounting(path string) error { - // Ensure that kernel memory is available in this kernel build. If it - // isn't, we just ignore it because EnableKernelMemoryAccounting is - // automatically called for all memory limits. - if !cgroups.PathExists(filepath.Join(path, cgroupKernelMemoryLimit)) { - return nil - } - // We have to limit the kernel memory here as it won't be accounted at all - // until a limit is set on the cgroup and limit cannot be set once the - // cgroup has children, or if there are already tasks in the cgroup. - for _, i := range []int64{1, -1} { - if err := setKernelMemory(path, i); err != nil { - return err - } - } - return nil -} - -func setKernelMemory(path string, kernelMemoryLimit int64) error { - if path == "" { - return fmt.Errorf("no such directory for %s", cgroupKernelMemoryLimit) - } - if !cgroups.PathExists(filepath.Join(path, cgroupKernelMemoryLimit)) { - // We have specifically been asked to set a kmem limit. If the kernel - // doesn't support it we *must* error out. - return errors.New("kernel memory accounting not supported by this kernel") - } - if err := fscommon.WriteFile(path, cgroupKernelMemoryLimit, strconv.FormatInt(kernelMemoryLimit, 10)); err != nil { - // Check if the error number returned by the syscall is "EBUSY" - // The EBUSY signal is returned on attempts to write to the - // memory.kmem.limit_in_bytes file if the cgroup has children or - // once tasks have been attached to the cgroup - if errors.Is(err, unix.EBUSY) { - return fmt.Errorf("failed to set %s, because either tasks have already joined this cgroup or it has children", cgroupKernelMemoryLimit) - } - return err - } - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem_disabled.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem_disabled.go deleted file mode 100644 index ac290fd7a02a..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/kmem_disabled.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build linux,nokmem - -package fs - -import ( - "errors" -) - -func EnableKernelMemoryAccounting(path string) error { - return nil -} - -func setKernelMemory(path string, kernelMemoryLimit int64) error { - return errors.New("kernel memory accounting disabled in this runc build") -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go index 61be6d7e9a6d..dc27cb9e9c91 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go @@ -14,11 +14,15 @@ import ( "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" + "github.com/pkg/errors" + "golang.org/x/sys/unix" ) const ( cgroupMemorySwapLimit = "memory.memsw.limit_in_bytes" cgroupMemoryLimit = "memory.limit_in_bytes" + cgroupMemoryUsage = "memory.usage_in_bytes" + cgroupMemoryMaxUsage = "memory.max_usage_in_bytes" ) type MemoryGroup struct { @@ -29,48 +33,55 @@ func (s *MemoryGroup) Name() string { } func (s *MemoryGroup) Apply(path string, d *cgroupData) (err error) { - if path == "" { + return join(path, d.pid) +} + +func setMemory(path string, val int64) error { + if val == 0 { return nil } - if memoryAssigned(d.config) { - if _, err := os.Stat(path); os.IsNotExist(err) { - if err := os.MkdirAll(path, 0755); err != nil { - return err - } - // Only enable kernel memory accouting when this cgroup - // is created by libcontainer, otherwise we might get - // error when people use `cgroupsPath` to join an existed - // cgroup whose kernel memory is not initialized. - if err := EnableKernelMemoryAccounting(path); err != nil { - return err - } - } + + err := fscommon.WriteFile(path, cgroupMemoryLimit, strconv.FormatInt(val, 10)) + if !errors.Is(err, unix.EBUSY) { + return err } - defer func() { - if err != nil { - os.RemoveAll(path) - } - }() - // We need to join memory cgroup after set memory limits, because - // kmem.limit_in_bytes can only be set when the cgroup is empty. - return join(path, d.pid) + // EBUSY means the kernel can't set new limit as it's too low + // (lower than the current usage). Return more specific error. + usage, err := fscommon.GetCgroupParamUint(path, cgroupMemoryUsage) + if err != nil { + return err + } + max, err := fscommon.GetCgroupParamUint(path, cgroupMemoryMaxUsage) + if err != nil { + return err + } + + return errors.Errorf("unable to set memory limit to %d (current usage: %d, peak usage: %d)", val, usage, max) } -func setMemoryAndSwap(path string, cgroup *configs.Cgroup) error { +func setSwap(path string, val int64) error { + if val == 0 { + return nil + } + + return fscommon.WriteFile(path, cgroupMemorySwapLimit, strconv.FormatInt(val, 10)) +} + +func setMemoryAndSwap(path string, r *configs.Resources) error { // If the memory update is set to -1 and the swap is not explicitly // set, we should also set swap to -1, it means unlimited memory. - if cgroup.Resources.Memory == -1 && cgroup.Resources.MemorySwap == 0 { + if r.Memory == -1 && r.MemorySwap == 0 { // Only set swap if it's enabled in kernel if cgroups.PathExists(filepath.Join(path, cgroupMemorySwapLimit)) { - cgroup.Resources.MemorySwap = -1 + r.MemorySwap = -1 } } // When memory and swap memory are both set, we need to handle the cases // for updating container. - if cgroup.Resources.Memory != 0 && cgroup.Resources.MemorySwap != 0 { - memoryUsage, err := getMemoryData(path, "") + if r.Memory != 0 && r.MemorySwap != 0 { + curLimit, err := fscommon.GetCgroupParamUint(path, cgroupMemoryLimit) if err != nil { return err } @@ -78,72 +89,53 @@ func setMemoryAndSwap(path string, cgroup *configs.Cgroup) error { // When update memory limit, we should adapt the write sequence // for memory and swap memory, so it won't fail because the new // value and the old value don't fit kernel's validation. - if cgroup.Resources.MemorySwap == -1 || memoryUsage.Limit < uint64(cgroup.Resources.MemorySwap) { - if err := fscommon.WriteFile(path, cgroupMemorySwapLimit, strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil { - return err - } - if err := fscommon.WriteFile(path, cgroupMemoryLimit, strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil { + if r.MemorySwap == -1 || curLimit < uint64(r.MemorySwap) { + if err := setSwap(path, r.MemorySwap); err != nil { return err } - } else { - if err := fscommon.WriteFile(path, cgroupMemoryLimit, strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil { - return err - } - if err := fscommon.WriteFile(path, cgroupMemorySwapLimit, strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil { - return err - } - } - } else { - if cgroup.Resources.Memory != 0 { - if err := fscommon.WriteFile(path, cgroupMemoryLimit, strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil { - return err - } - } - if cgroup.Resources.MemorySwap != 0 { - if err := fscommon.WriteFile(path, cgroupMemorySwapLimit, strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil { + if err := setMemory(path, r.Memory); err != nil { return err } + return nil } } + if err := setMemory(path, r.Memory); err != nil { + return err + } + if err := setSwap(path, r.MemorySwap); err != nil { + return err + } + return nil } -func (s *MemoryGroup) Set(path string, cgroup *configs.Cgroup) error { - if err := setMemoryAndSwap(path, cgroup); err != nil { +func (s *MemoryGroup) Set(path string, r *configs.Resources) error { + if err := setMemoryAndSwap(path, r); err != nil { return err } - if cgroup.Resources.KernelMemory != 0 { - if err := setKernelMemory(path, cgroup.Resources.KernelMemory); err != nil { - return err - } - } + // ignore KernelMemory and KernelMemoryTCP - if cgroup.Resources.MemoryReservation != 0 { - if err := fscommon.WriteFile(path, "memory.soft_limit_in_bytes", strconv.FormatInt(cgroup.Resources.MemoryReservation, 10)); err != nil { + if r.MemoryReservation != 0 { + if err := fscommon.WriteFile(path, "memory.soft_limit_in_bytes", strconv.FormatInt(r.MemoryReservation, 10)); err != nil { return err } } - if cgroup.Resources.KernelMemoryTCP != 0 { - if err := fscommon.WriteFile(path, "memory.kmem.tcp.limit_in_bytes", strconv.FormatInt(cgroup.Resources.KernelMemoryTCP, 10)); err != nil { - return err - } - } - if cgroup.Resources.OomKillDisable { + if r.OomKillDisable { if err := fscommon.WriteFile(path, "memory.oom_control", "1"); err != nil { return err } } - if cgroup.Resources.MemorySwappiness == nil || int64(*cgroup.Resources.MemorySwappiness) == -1 { + if r.MemorySwappiness == nil || int64(*r.MemorySwappiness) == -1 { return nil - } else if *cgroup.Resources.MemorySwappiness <= 100 { - if err := fscommon.WriteFile(path, "memory.swappiness", strconv.FormatUint(*cgroup.Resources.MemorySwappiness, 10)); err != nil { + } else if *r.MemorySwappiness <= 100 { + if err := fscommon.WriteFile(path, "memory.swappiness", strconv.FormatUint(*r.MemorySwappiness, 10)); err != nil { return err } } else { - return fmt.Errorf("invalid value:%d. valid memory swappiness range is 0-100", *cgroup.Resources.MemorySwappiness) + return fmt.Errorf("invalid value:%d. valid memory swappiness range is 0-100", *r.MemorySwappiness) } return nil @@ -162,7 +154,7 @@ func (s *MemoryGroup) GetStats(path string, stats *cgroups.Stats) error { sc := bufio.NewScanner(statsFile) for sc.Scan() { - t, v, err := fscommon.GetCgroupParamKeyValue(sc.Text()) + t, v, err := fscommon.ParseKeyValue(sc.Text()) if err != nil { return fmt.Errorf("failed to parse memory.stat (%q) - %v", sc.Text(), err) } @@ -212,8 +204,6 @@ func memoryAssigned(cgroup *configs.Cgroup) bool { return cgroup.Resources.Memory != 0 || cgroup.Resources.MemoryReservation != 0 || cgroup.Resources.MemorySwap > 0 || - cgroup.Resources.KernelMemory > 0 || - cgroup.Resources.KernelMemoryTCP > 0 || cgroup.Resources.OomKillDisable || (cgroup.Resources.MemorySwappiness != nil && int64(*cgroup.Resources.MemorySwappiness) != -1) } @@ -234,7 +224,9 @@ func getMemoryData(path, name string) (cgroups.MemoryData, error) { value, err := fscommon.GetCgroupParamUint(path, usage) if err != nil { - if moduleName != "memory" && os.IsNotExist(err) { + if name != "" && os.IsNotExist(err) { + // Ignore ENOENT as swap and kmem controllers + // are optional in the kernel. return cgroups.MemoryData{}, nil } return cgroups.MemoryData{}, fmt.Errorf("failed to parse %s - %v", usage, err) @@ -242,25 +234,16 @@ func getMemoryData(path, name string) (cgroups.MemoryData, error) { memoryData.Usage = value value, err = fscommon.GetCgroupParamUint(path, maxUsage) if err != nil { - if moduleName != "memory" && os.IsNotExist(err) { - return cgroups.MemoryData{}, nil - } return cgroups.MemoryData{}, fmt.Errorf("failed to parse %s - %v", maxUsage, err) } memoryData.MaxUsage = value value, err = fscommon.GetCgroupParamUint(path, failcnt) if err != nil { - if moduleName != "memory" && os.IsNotExist(err) { - return cgroups.MemoryData{}, nil - } return cgroups.MemoryData{}, fmt.Errorf("failed to parse %s - %v", failcnt, err) } memoryData.Failcnt = value value, err = fscommon.GetCgroupParamUint(path, limit) if err != nil { - if moduleName != "memory" && os.IsNotExist(err) { - return cgroups.MemoryData{}, nil - } return cgroups.MemoryData{}, fmt.Errorf("failed to parse %s - %v", limit, err) } memoryData.Limit = value diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go index 7cada9149d46..94a94b5e8d00 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go @@ -24,7 +24,7 @@ func (s *NameGroup) Apply(path string, d *cgroupData) error { return nil } -func (s *NameGroup) Set(path string, cgroup *configs.Cgroup) error { +func (s *NameGroup) Set(_ string, _ *configs.Resources) error { return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_cls.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_cls.go index 901e9554431c..c824db34dc01 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_cls.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_cls.go @@ -21,9 +21,9 @@ func (s *NetClsGroup) Apply(path string, d *cgroupData) error { return join(path, d.pid) } -func (s *NetClsGroup) Set(path string, cgroup *configs.Cgroup) error { - if cgroup.Resources.NetClsClassid != 0 { - if err := fscommon.WriteFile(path, "net_cls.classid", strconv.FormatUint(uint64(cgroup.Resources.NetClsClassid), 10)); err != nil { +func (s *NetClsGroup) Set(path string, r *configs.Resources) error { + if r.NetClsClassid != 0 { + if err := fscommon.WriteFile(path, "net_cls.classid", strconv.FormatUint(uint64(r.NetClsClassid), 10)); err != nil { return err } } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_prio.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_prio.go index a9645de261bb..ce4bebc26c7b 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_prio.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_prio.go @@ -19,8 +19,8 @@ func (s *NetPrioGroup) Apply(path string, d *cgroupData) error { return join(path, d.pid) } -func (s *NetPrioGroup) Set(path string, cgroup *configs.Cgroup) error { - for _, prioMap := range cgroup.Resources.NetPrioIfpriomap { +func (s *NetPrioGroup) Set(path string, r *configs.Resources) error { + for _, prioMap := range r.NetPrioIfpriomap { if err := fscommon.WriteFile(path, "net_prio.ifpriomap", prioMap.CgroupString()); err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/perf_event.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/perf_event.go index dd1e98d0aed7..5da4845fb843 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/perf_event.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/perf_event.go @@ -18,7 +18,7 @@ func (s *PerfEventGroup) Apply(path string, d *cgroupData) error { return join(path, d.pid) } -func (s *PerfEventGroup) Set(path string, cgroup *configs.Cgroup) error { +func (s *PerfEventGroup) Set(_ string, _ *configs.Resources) error { return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go index 6614df88a782..c12dafd16598 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go @@ -23,13 +23,13 @@ func (s *PidsGroup) Apply(path string, d *cgroupData) error { return join(path, d.pid) } -func (s *PidsGroup) Set(path string, cgroup *configs.Cgroup) error { - if cgroup.Resources.PidsLimit != 0 { +func (s *PidsGroup) Set(path string, r *configs.Resources) error { + if r.PidsLimit != 0 { // "max" is the fallback value. limit := "max" - if cgroup.Resources.PidsLimit > 0 { - limit = strconv.FormatInt(cgroup.Resources.PidsLimit, 10) + if r.PidsLimit > 0 { + limit = strconv.FormatInt(r.PidsLimit, 10) } if err := fscommon.WriteFile(path, "pids.max", limit); err != nil { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go index 0dffe6648e97..404800e99e1e 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go @@ -12,15 +12,14 @@ import ( "github.com/opencontainers/runc/libcontainer/configs" ) -func isCpuSet(cgroup *configs.Cgroup) bool { - return cgroup.Resources.CpuWeight != 0 || cgroup.Resources.CpuQuota != 0 || cgroup.Resources.CpuPeriod != 0 +func isCpuSet(r *configs.Resources) bool { + return r.CpuWeight != 0 || r.CpuQuota != 0 || r.CpuPeriod != 0 } -func setCpu(dirPath string, cgroup *configs.Cgroup) error { - if !isCpuSet(cgroup) { +func setCpu(dirPath string, r *configs.Resources) error { + if !isCpuSet(r) { return nil } - r := cgroup.Resources // NOTE: .CpuShares is not used here. Conversion is the caller's responsibility. if r.CpuWeight != 0 { @@ -57,7 +56,7 @@ func statCpu(dirPath string, stats *cgroups.Stats) error { sc := bufio.NewScanner(f) for sc.Scan() { - t, v, err := fscommon.GetCgroupParamKeyValue(sc.Text()) + t, v, err := fscommon.ParseKeyValue(sc.Text()) if err != nil { return err } @@ -70,6 +69,15 @@ func statCpu(dirPath string, stats *cgroups.Stats) error { case "system_usec": stats.CpuStats.CpuUsage.UsageInKernelmode = v * 1000 + + case "nr_periods": + stats.CpuStats.ThrottlingData.Periods = v + + case "nr_throttled": + stats.CpuStats.ThrottlingData.ThrottledPeriods = v + + case "throttled_usec": + stats.CpuStats.ThrottlingData.ThrottledTime = v * 1000 } } return nil diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpuset.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpuset.go index fb4456b43c1a..713c430dc4df 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpuset.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpuset.go @@ -7,22 +7,22 @@ import ( "github.com/opencontainers/runc/libcontainer/configs" ) -func isCpusetSet(cgroup *configs.Cgroup) bool { - return cgroup.Resources.CpusetCpus != "" || cgroup.Resources.CpusetMems != "" +func isCpusetSet(r *configs.Resources) bool { + return r.CpusetCpus != "" || r.CpusetMems != "" } -func setCpuset(dirPath string, cgroup *configs.Cgroup) error { - if !isCpusetSet(cgroup) { +func setCpuset(dirPath string, r *configs.Resources) error { + if !isCpusetSet(r) { return nil } - if cgroup.Resources.CpusetCpus != "" { - if err := fscommon.WriteFile(dirPath, "cpuset.cpus", cgroup.Resources.CpusetCpus); err != nil { + if r.CpusetCpus != "" { + if err := fscommon.WriteFile(dirPath, "cpuset.cpus", r.CpusetCpus); err != nil { return err } } - if cgroup.Resources.CpusetMems != "" { - if err := fscommon.WriteFile(dirPath, "cpuset.mems", cgroup.Resources.CpusetMems); err != nil { + if r.CpusetMems != "" { + if err := fscommon.WriteFile(dirPath, "cpuset.mems", r.CpusetMems); err != nil { return err } } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go index 30cf51ee68b6..f7a9999b6e07 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go @@ -10,7 +10,7 @@ import ( "github.com/opencontainers/runc/libcontainer/configs" ) -func supportedControllers(cgroup *configs.Cgroup) (string, error) { +func supportedControllers() (string, error) { return fscommon.ReadFile(UnifiedMountpoint, "/cgroup.controllers") } @@ -18,13 +18,13 @@ func supportedControllers(cgroup *configs.Cgroup) (string, error) { // based on (1) controllers available and (2) resources that are being set. // We don't check "pseudo" controllers such as // "freezer" and "devices". -func needAnyControllers(cgroup *configs.Cgroup) (bool, error) { - if cgroup == nil { +func needAnyControllers(r *configs.Resources) (bool, error) { + if r == nil { return false, nil } // list of all available controllers - content, err := supportedControllers(cgroup) + content, err := supportedControllers() if err != nil { return false, err } @@ -39,22 +39,22 @@ func needAnyControllers(cgroup *configs.Cgroup) (bool, error) { return ok } - if isPidsSet(cgroup) && have("pids") { + if isPidsSet(r) && have("pids") { return true, nil } - if isMemorySet(cgroup) && have("memory") { + if isMemorySet(r) && have("memory") { return true, nil } - if isIoSet(cgroup) && have("io") { + if isIoSet(r) && have("io") { return true, nil } - if isCpuSet(cgroup) && have("cpu") { + if isCpuSet(r) && have("cpu") { return true, nil } - if isCpusetSet(cgroup) && have("cpuset") { + if isCpusetSet(r) && have("cpuset") { return true, nil } - if isHugeTlbSet(cgroup) && have("hugetlb") { + if isHugeTlbSet(r) && have("hugetlb") { return true, nil } @@ -64,8 +64,8 @@ func needAnyControllers(cgroup *configs.Cgroup) (bool, error) { // containsDomainController returns whether the current config contains domain controller or not. // Refer to: http://man7.org/linux/man-pages/man7/cgroups.7.html // As at Linux 4.19, the following controllers are threaded: cpu, perf_event, and pids. -func containsDomainController(cg *configs.Cgroup) bool { - return isMemorySet(cg) || isIoSet(cg) || isCpuSet(cg) || isHugeTlbSet(cg) +func containsDomainController(r *configs.Resources) bool { + return isMemorySet(r) || isIoSet(r) || isCpuSet(r) || isHugeTlbSet(r) } // CreateCgroupPath creates cgroupv2 path, enabling all the supported controllers. @@ -74,7 +74,7 @@ func CreateCgroupPath(path string, c *configs.Cgroup) (Err error) { return fmt.Errorf("invalid cgroup path %s", path) } - content, err := supportedControllers(c) + content, err := supportedControllers() if err != nil { return err } @@ -115,7 +115,7 @@ func CreateCgroupPath(path string, c *configs.Cgroup) (Err error) { // the controllers requested are thread-aware we can simply put the cgroup into // threaded mode. case "domain invalid": - if containsDomainController(c) { + if containsDomainController(c.Resources) { return fmt.Errorf("cannot enter cgroupv2 %q with domain controllers -- it is in an invalid state", current) } else { // Not entirely correct (in theory we'd always want to be a domain -- @@ -129,7 +129,7 @@ func CreateCgroupPath(path string, c *configs.Cgroup) (Err error) { case "domain threaded": fallthrough case "threaded": - if containsDomainController(c) { + if containsDomainController(c.Resources) { return fmt.Errorf("cannot enter cgroupv2 %q with domain controllers -- it is in %s mode", current, cgType) } } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/devices.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/devices.go index 4c793a1cc1ad..fa9194b557a4 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/devices.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/devices.go @@ -7,6 +7,8 @@ import ( "github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter" "github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/devices" + "github.com/opencontainers/runc/libcontainer/userns" + "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -26,26 +28,40 @@ func isRWM(perms devices.Permissions) bool { return r && w && m } -// the logic is from crun -// https://github.com/containers/crun/blob/0.10.2/src/libcrun/cgroup.c#L1644-L1652 -func canSkipEBPFError(cgroup *configs.Cgroup) bool { - for _, dev := range cgroup.Resources.Devices { - if dev.Allow || !isRWM(dev.Permissions) { +// This is similar to the logic applied in crun for handling errors from bpf(2) +// . +func canSkipEBPFError(r *configs.Resources) bool { + // If we're running in a user namespace we can ignore eBPF rules because we + // usually cannot use bpf(2), as well as rootless containers usually don't + // have the necessary privileges to mknod(2) device inodes or access + // host-level instances (though ideally we would be blocking device access + // for rootless containers anyway). + if userns.RunningInUserNS() { + return true + } + + // We cannot ignore an eBPF load error if any rule if is a block rule or it + // doesn't permit all access modes. + // + // NOTE: This will sometimes trigger in cases where access modes are split + // between different rules but to handle this correctly would require + // using ".../libcontainer/cgroup/devices".Emulator. + for _, dev := range r.Devices { + if !dev.Allow || !isRWM(dev.Permissions) { return false } } return true } -func setDevices(dirPath string, cgroup *configs.Cgroup) error { - if cgroup.SkipDevices { +func setDevices(dirPath string, r *configs.Resources) error { + if r.SkipDevices { return nil } // XXX: This is currently a white-list (but all callers pass a blacklist of // devices). This is bad for a whole variety of reasons, but will need // to be fixed with co-ordinated effort with downstreams. - devices := cgroup.Devices - insts, license, err := devicefilter.DeviceFilter(devices) + insts, license, err := devicefilter.DeviceFilter(r.Devices) if err != nil { return err } @@ -66,7 +82,7 @@ func setDevices(dirPath string, cgroup *configs.Cgroup) error { // programs. You could temporarily insert a deny-everything program // but that would result in spurrious failures during updates. if _, err := ebpf.LoadAttachCgroupDeviceFilter(insts, license, dirFD); err != nil { - if !canSkipEBPFError(cgroup) { + if !canSkipEBPFError(r) { return err } } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go index 3f0b9e0d7e17..5da6c51e52e4 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go @@ -75,7 +75,7 @@ func (m *manager) Apply(pid int) error { // - "runc create (rootless + limits + no cgrouppath + no permission) fails with informative error" if m.rootless { if m.config.Path == "" { - if blNeed, nErr := needAnyControllers(m.config); nErr == nil && !blNeed { + if blNeed, nErr := needAnyControllers(m.config.Resources); nErr == nil && !blNeed { return nil } return errors.Wrap(err, "rootless needs no limits + no cgrouppath when no permission is granted for cgroups") @@ -103,43 +103,27 @@ func (m *manager) GetStats() (*cgroups.Stats, error) { ) st := cgroups.NewStats() - if err := m.getControllers(); err != nil { - return st, err - } // pids (since kernel 4.5) - if _, ok := m.controllers["pids"]; ok { - if err := statPids(m.dirPath, st); err != nil { - errs = append(errs, err) - } - } else { - if err := statPidsWithoutController(m.dirPath, st); err != nil { - errs = append(errs, err) - } + if err := statPids(m.dirPath, st); err != nil { + errs = append(errs, err) } // memory (since kernel 4.5) - if _, ok := m.controllers["memory"]; ok { - if err := statMemory(m.dirPath, st); err != nil { - errs = append(errs, err) - } + if err := statMemory(m.dirPath, st); err != nil && !os.IsNotExist(err) { + errs = append(errs, err) } // io (since kernel 4.5) - if _, ok := m.controllers["io"]; ok { - if err := statIo(m.dirPath, st); err != nil { - errs = append(errs, err) - } + if err := statIo(m.dirPath, st); err != nil && !os.IsNotExist(err) { + errs = append(errs, err) } // cpu (since kernel 4.15) - if _, ok := m.controllers["cpu"]; ok { - if err := statCpu(m.dirPath, st); err != nil { - errs = append(errs, err) - } + // Note cpu.stat is available even if the controller is not enabled. + if err := statCpu(m.dirPath, st); err != nil && !os.IsNotExist(err) { + errs = append(errs, err) } // hugetlb (since kernel 5.6) - if _, ok := m.controllers["hugetlb"]; ok { - if err := statHugeTlb(m.dirPath, st); err != nil { - errs = append(errs, err) - } + if err := statHugeTlb(m.dirPath, st); err != nil && !os.IsNotExist(err) { + errs = append(errs, err) } if len(errs) > 0 && !m.rootless { return st, errors.Errorf("error while statting cgroup v2: %+v", errs) @@ -163,53 +147,50 @@ func (m *manager) Path(_ string) string { return m.dirPath } -func (m *manager) Set(container *configs.Config) error { - if container == nil || container.Cgroups == nil { - return nil - } +func (m *manager) Set(r *configs.Resources) error { if err := m.getControllers(); err != nil { return err } // pids (since kernel 4.5) - if err := setPids(m.dirPath, container.Cgroups); err != nil { + if err := setPids(m.dirPath, r); err != nil { return err } // memory (since kernel 4.5) - if err := setMemory(m.dirPath, container.Cgroups); err != nil { + if err := setMemory(m.dirPath, r); err != nil { return err } // io (since kernel 4.5) - if err := setIo(m.dirPath, container.Cgroups); err != nil { + if err := setIo(m.dirPath, r); err != nil { return err } // cpu (since kernel 4.15) - if err := setCpu(m.dirPath, container.Cgroups); err != nil { + if err := setCpu(m.dirPath, r); err != nil { return err } // devices (since kernel 4.15, pseudo-controller) // - // When m.Rootless is true, errors from the device subsystem are ignored because it is really not expected to work. + // When m.rootless is true, errors from the device subsystem are ignored because it is really not expected to work. // However, errors from other subsystems are not ignored. // see @test "runc create (rootless + limits + no cgrouppath + no permission) fails with informative error" - if err := setDevices(m.dirPath, container.Cgroups); err != nil && !m.rootless { + if err := setDevices(m.dirPath, r); err != nil && !m.rootless { return err } // cpuset (since kernel 5.0) - if err := setCpuset(m.dirPath, container.Cgroups); err != nil { + if err := setCpuset(m.dirPath, r); err != nil { return err } // hugetlb (since kernel 5.6) - if err := setHugeTlb(m.dirPath, container.Cgroups); err != nil { + if err := setHugeTlb(m.dirPath, r); err != nil { return err } // freezer (since kernel 5.2, pseudo-controller) - if err := setFreezer(m.dirPath, container.Cgroups.Freezer); err != nil { + if err := setFreezer(m.dirPath, r.Freezer); err != nil { return err } - if err := m.setUnified(container.Cgroups.Unified); err != nil { + if err := m.setUnified(r.Unified); err != nil { return err } - m.config = container.Cgroups + m.config.Resources = r return nil } @@ -257,3 +238,16 @@ func (m *manager) GetFreezerState() (configs.FreezerState, error) { func (m *manager) Exists() bool { return cgroups.PathExists(m.dirPath) } + +func OOMKillCount(path string) (uint64, error) { + return fscommon.GetValueByKey(path, "memory.events", "oom_kill") +} + +func (m *manager) OOMKillCount() (uint64, error) { + c, err := OOMKillCount(m.dirPath) + if err != nil && m.rootless && os.IsNotExist(err) { + err = nil + } + + return c, err +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go index 18cd411ce08b..76df770109c4 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go @@ -12,15 +12,15 @@ import ( "github.com/opencontainers/runc/libcontainer/configs" ) -func isHugeTlbSet(cgroup *configs.Cgroup) bool { - return len(cgroup.Resources.HugetlbLimit) > 0 +func isHugeTlbSet(r *configs.Resources) bool { + return len(r.HugetlbLimit) > 0 } -func setHugeTlb(dirPath string, cgroup *configs.Cgroup) error { - if !isHugeTlbSet(cgroup) { +func setHugeTlb(dirPath string, r *configs.Resources) error { + if !isHugeTlbSet(r) { return nil } - for _, hugetlb := range cgroup.Resources.HugetlbLimit { + for _, hugetlb := range r.HugetlbLimit { if err := fscommon.WriteFile(dirPath, "hugetlb."+hugetlb.Pagesize+".max", strconv.FormatUint(hugetlb.Limit, 10)); err != nil { return err } @@ -44,14 +44,10 @@ func statHugeTlb(dirPath string, stats *cgroups.Stats) error { hugetlbStats.Usage = value fileName := "hugetlb." + pagesize + ".events" - contents, err := fscommon.ReadFile(dirPath, fileName) + value, err = fscommon.GetValueByKey(dirPath, fileName, "max") if err != nil { return errors.Wrap(err, "failed to read stats") } - _, value, err = fscommon.GetCgroupParamKeyValue(contents) - if err != nil { - return errors.Wrap(err, "failed to parse "+fileName) - } hugetlbStats.Failcnt = value stats.HugetlbStats[pagesize] = hugetlbStats diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go index e01ea001b352..c07a00867ae8 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go @@ -13,42 +13,50 @@ import ( "github.com/opencontainers/runc/libcontainer/configs" ) -func isIoSet(cgroup *configs.Cgroup) bool { - return cgroup.Resources.BlkioWeight != 0 || - len(cgroup.Resources.BlkioThrottleReadBpsDevice) > 0 || - len(cgroup.Resources.BlkioThrottleWriteBpsDevice) > 0 || - len(cgroup.Resources.BlkioThrottleReadIOPSDevice) > 0 || - len(cgroup.Resources.BlkioThrottleWriteIOPSDevice) > 0 +func isIoSet(r *configs.Resources) bool { + return r.BlkioWeight != 0 || + len(r.BlkioThrottleReadBpsDevice) > 0 || + len(r.BlkioThrottleWriteBpsDevice) > 0 || + len(r.BlkioThrottleReadIOPSDevice) > 0 || + len(r.BlkioThrottleWriteIOPSDevice) > 0 } -func setIo(dirPath string, cgroup *configs.Cgroup) error { - if !isIoSet(cgroup) { +func setIo(dirPath string, r *configs.Resources) error { + if !isIoSet(r) { return nil } - if cgroup.Resources.BlkioWeight != 0 { + if r.BlkioWeight != 0 { filename := "io.bfq.weight" if err := fscommon.WriteFile(dirPath, filename, - strconv.FormatUint(cgroups.ConvertBlkIOToCgroupV2Value(cgroup.Resources.BlkioWeight), 10)); err != nil { - return err + strconv.FormatUint(uint64(r.BlkioWeight), 10)); err != nil { + // if io.bfq.weight does not exist, then bfq module is not loaded. + // Fallback to use io.weight with a conversion scheme + if !os.IsNotExist(err) { + return err + } + v := cgroups.ConvertBlkIOToIOWeightValue(r.BlkioWeight) + if err := fscommon.WriteFile(dirPath, "io.weight", strconv.FormatUint(v, 10)); err != nil { + return err + } } } - for _, td := range cgroup.Resources.BlkioThrottleReadBpsDevice { + for _, td := range r.BlkioThrottleReadBpsDevice { if err := fscommon.WriteFile(dirPath, "io.max", td.StringName("rbps")); err != nil { return err } } - for _, td := range cgroup.Resources.BlkioThrottleWriteBpsDevice { + for _, td := range r.BlkioThrottleWriteBpsDevice { if err := fscommon.WriteFile(dirPath, "io.max", td.StringName("wbps")); err != nil { return err } } - for _, td := range cgroup.Resources.BlkioThrottleReadIOPSDevice { + for _, td := range r.BlkioThrottleReadIOPSDevice { if err := fscommon.WriteFile(dirPath, "io.max", td.StringName("riops")); err != nil { return err } } - for _, td := range cgroup.Resources.BlkioThrottleWriteIOPSDevice { + for _, td := range r.BlkioThrottleWriteIOPSDevice { if err := fscommon.WriteFile(dirPath, "io.max", td.StringName("wiops")); err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go index 1c6913bf0f51..7308f5a205cc 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go @@ -4,13 +4,16 @@ package fs2 import ( "bufio" + "math" "os" "strconv" + "strings" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" "github.com/pkg/errors" + "golang.org/x/sys/unix" ) // numToStr converts an int64 value to a string for writing to a @@ -30,21 +33,20 @@ func numToStr(value int64) (ret string) { return ret } -func isMemorySet(cgroup *configs.Cgroup) bool { - return cgroup.Resources.MemoryReservation != 0 || - cgroup.Resources.Memory != 0 || cgroup.Resources.MemorySwap != 0 +func isMemorySet(r *configs.Resources) bool { + return r.MemoryReservation != 0 || r.Memory != 0 || r.MemorySwap != 0 } -func setMemory(dirPath string, cgroup *configs.Cgroup) error { - if !isMemorySet(cgroup) { +func setMemory(dirPath string, r *configs.Resources) error { + if !isMemorySet(r) { return nil } - swap, err := cgroups.ConvertMemorySwapToCgroupV2Value(cgroup.Resources.MemorySwap, cgroup.Resources.Memory) + swap, err := cgroups.ConvertMemorySwapToCgroupV2Value(r.MemorySwap, r.Memory) if err != nil { return err } swapStr := numToStr(swap) - if swapStr == "" && swap == 0 && cgroup.Resources.MemorySwap > 0 { + if swapStr == "" && swap == 0 && r.MemorySwap > 0 { // memory and memorySwap set to the same value -- disable swap swapStr = "0" } @@ -55,7 +57,7 @@ func setMemory(dirPath string, cgroup *configs.Cgroup) error { } } - if val := numToStr(cgroup.Resources.Memory); val != "" { + if val := numToStr(r.Memory); val != "" { if err := fscommon.WriteFile(dirPath, "memory.max", val); err != nil { return err } @@ -63,7 +65,7 @@ func setMemory(dirPath string, cgroup *configs.Cgroup) error { // cgroup.Resources.KernelMemory is ignored - if val := numToStr(cgroup.Resources.MemoryReservation); val != "" { + if val := numToStr(r.MemoryReservation); val != "" { if err := fscommon.WriteFile(dirPath, "memory.low", val); err != nil { return err } @@ -82,16 +84,24 @@ func statMemory(dirPath string, stats *cgroups.Stats) error { sc := bufio.NewScanner(statsFile) for sc.Scan() { - t, v, err := fscommon.GetCgroupParamKeyValue(sc.Text()) + t, v, err := fscommon.ParseKeyValue(sc.Text()) if err != nil { return errors.Wrapf(err, "failed to parse memory.stat (%q)", sc.Text()) } stats.MemoryStats.Stats[t] = v } - stats.MemoryStats.Cache = stats.MemoryStats.Stats["cache"] + stats.MemoryStats.Cache = stats.MemoryStats.Stats["file"] + // Unlike cgroup v1 which has memory.use_hierarchy binary knob, + // cgroup v2 is always hierarchical. + stats.MemoryStats.UseHierarchy = true memoryUsage, err := getMemoryDataV2(dirPath, "") if err != nil { + if errors.Is(err, unix.ENOENT) && dirPath == UnifiedMountpoint { + // The root cgroup does not have memory.{current,max} + // so emulate those using data from /proc/meminfo. + return statsFromMeminfo(stats) + } return err } stats.MemoryStats.Usage = memoryUsage @@ -99,9 +109,15 @@ func statMemory(dirPath string, stats *cgroups.Stats) error { if err != nil { return err } + // As cgroup v1 reports SwapUsage values as mem+swap combined, + // while in cgroup v2 swap values do not include memory, + // report combined mem+swap for v1 compatibility. + swapUsage.Usage += memoryUsage.Usage + if swapUsage.Limit != math.MaxUint64 { + swapUsage.Limit += memoryUsage.Limit + } stats.MemoryStats.SwapUsage = swapUsage - stats.MemoryStats.UseHierarchy = true return nil } @@ -117,7 +133,10 @@ func getMemoryDataV2(path, name string) (cgroups.MemoryData, error) { value, err := fscommon.GetCgroupParamUint(path, usage) if err != nil { - if moduleName != "memory" && os.IsNotExist(err) { + if name != "" && os.IsNotExist(err) { + // Ignore EEXIST as there's no swap accounting + // if kernel CONFIG_MEMCG_SWAP is not set or + // swapaccount=0 kernel boot parameter is given. return cgroups.MemoryData{}, nil } return cgroups.MemoryData{}, errors.Wrapf(err, "failed to parse %s", usage) @@ -126,12 +145,69 @@ func getMemoryDataV2(path, name string) (cgroups.MemoryData, error) { value, err = fscommon.GetCgroupParamUint(path, limit) if err != nil { - if moduleName != "memory" && os.IsNotExist(err) { - return cgroups.MemoryData{}, nil - } return cgroups.MemoryData{}, errors.Wrapf(err, "failed to parse %s", limit) } memoryData.Limit = value return memoryData, nil } + +func statsFromMeminfo(stats *cgroups.Stats) error { + f, err := os.Open("/proc/meminfo") + if err != nil { + return err + } + defer f.Close() + + // Fields we are interested in. + var ( + swap_free uint64 + swap_total uint64 + main_total uint64 + main_free uint64 + ) + mem := map[string]*uint64{ + "SwapFree": &swap_free, + "SwapTotal": &swap_total, + "MemTotal": &main_total, + "MemFree": &main_free, + } + + found := 0 + sc := bufio.NewScanner(f) + for sc.Scan() { + parts := strings.SplitN(sc.Text(), ":", 3) + if len(parts) != 2 { + // Should not happen. + continue + } + k := parts[0] + p, ok := mem[k] + if !ok { + // Unknown field -- not interested. + continue + } + vStr := strings.TrimSpace(strings.TrimSuffix(parts[1], " kB")) + *p, err = strconv.ParseUint(vStr, 10, 64) + if err != nil { + return errors.Wrap(err, "parsing /proc/meminfo "+k) + } + + found++ + if found == len(mem) { + // Got everything we need -- skip the rest. + break + } + } + if sc.Err() != nil { + return sc.Err() + } + + stats.MemoryStats.SwapUsage.Usage = (swap_total - swap_free) * 1024 + stats.MemoryStats.SwapUsage.Limit = math.MaxUint64 + + stats.MemoryStats.Usage.Usage = (main_total - main_free) * 1024 + stats.MemoryStats.Usage.Limit = math.MaxUint64 + + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go index 16e1c21957ad..346fdb678735 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go @@ -3,6 +3,7 @@ package fs2 import ( + "os" "path/filepath" "strings" @@ -13,15 +14,15 @@ import ( "golang.org/x/sys/unix" ) -func isPidsSet(cgroup *configs.Cgroup) bool { - return cgroup.Resources.PidsLimit != 0 +func isPidsSet(r *configs.Resources) bool { + return r.PidsLimit != 0 } -func setPids(dirPath string, cgroup *configs.Cgroup) error { - if !isPidsSet(cgroup) { +func setPids(dirPath string, r *configs.Resources) error { + if !isPidsSet(r) { return nil } - if val := numToStr(cgroup.Resources.PidsLimit); val != "" { + if val := numToStr(r.PidsLimit); val != "" { if err := fscommon.WriteFile(dirPath, "pids.max", val); err != nil { return err } @@ -30,7 +31,7 @@ func setPids(dirPath string, cgroup *configs.Cgroup) error { return nil } -func statPidsWithoutController(dirPath string, stats *cgroups.Stats) error { +func statPidsFromCgroupProcs(dirPath string, stats *cgroups.Stats) error { // if the controller is not enabled, let's read PIDS from cgroups.procs // (or threads if cgroup.threads is enabled) contents, err := fscommon.ReadFile(dirPath, "cgroup.procs") @@ -40,13 +41,8 @@ func statPidsWithoutController(dirPath string, stats *cgroups.Stats) error { if err != nil { return err } - pids := make(map[string]string) - for _, i := range strings.Split(contents, "\n") { - if i != "" { - pids[i] = i - } - } - stats.PidsStats.Current = uint64(len(pids)) + pids := strings.Count(contents, "\n") + stats.PidsStats.Current = uint64(pids) stats.PidsStats.Limit = 0 return nil } @@ -54,6 +50,9 @@ func statPidsWithoutController(dirPath string, stats *cgroups.Stats) error { func statPids(dirPath string, stats *cgroups.Stats) error { current, err := fscommon.GetCgroupParamUint(dirPath, "pids.current") if err != nil { + if os.IsNotExist(err) { + return statPidsFromCgroupProcs(dirPath, stats) + } return errors.Wrap(err, "failed to parse pids.current") } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/open.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/open.go index 0a7e3d952820..49af83b3c0dd 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/open.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/open.go @@ -5,7 +5,6 @@ import ( "strings" "sync" - securejoin "github.com/cyphar/filepath-securejoin" "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" @@ -17,7 +16,7 @@ const ( ) var ( - // Set to true by fs unit tests + // TestMode is set to true by unit tests that need "fake" cgroupfs. TestMode bool cgroupFd int = -1 @@ -71,12 +70,12 @@ func OpenFile(dir, file string, flags int) (*os.File, error) { flags |= os.O_TRUNC | os.O_CREATE mode = 0o600 } + if prepareOpenat2() != nil { + return openFallback(dir, file, flags, mode) + } reldir := strings.TrimPrefix(dir, cgroupfsPrefix) if len(reldir) == len(dir) { // non-standard path, old system? - return openWithSecureJoin(dir, file, flags, mode) - } - if prepareOpenat2() != nil { - return openWithSecureJoin(dir, file, flags, mode) + return openFallback(dir, file, flags, mode) } relname := reldir + "/" + file @@ -93,11 +92,29 @@ func OpenFile(dir, file string, flags int) (*os.File, error) { return os.NewFile(uintptr(fd), cgroupfsPrefix+relname), nil } -func openWithSecureJoin(dir, file string, flags int, mode os.FileMode) (*os.File, error) { - path, err := securejoin.SecureJoin(dir, file) +var errNotCgroupfs = errors.New("not a cgroup file") + +// openFallback is used when openat2(2) is not available. It checks the opened +// file is on cgroupfs, returning an error otherwise. +func openFallback(dir, file string, flags int, mode os.FileMode) (*os.File, error) { + path := dir + "/" + file + fd, err := os.OpenFile(path, flags, mode) if err != nil { return nil, err } + if TestMode { + return fd, nil + } + // Check this is a cgroupfs file. + var st unix.Statfs_t + if err := unix.Fstatfs(int(fd.Fd()), &st); err != nil { + _ = fd.Close() + return nil, &os.PathError{Op: "statfs", Path: path, Err: err} + } + if st.Type != unix.CGROUP_SUPER_MAGIC && st.Type != unix.CGROUP2_SUPER_MAGIC { + _ = fd.Close() + return nil, &os.PathError{Op: "open", Path: path, Err: errNotCgroupfs} + } - return os.OpenFile(path, flags, mode) + return fd, nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go index 2e4e837f2b8e..db0caded1518 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go @@ -35,22 +35,42 @@ func ParseUint(s string, base, bitSize int) (uint64, error) { return value, nil } -// GetCgroupParamKeyValue parses a space-separated "name value" kind of cgroup -// parameter and returns its components. For example, "io_service_bytes 1234" -// will return as "io_service_bytes", 1234. -func GetCgroupParamKeyValue(t string) (string, uint64, error) { - parts := strings.Fields(t) - switch len(parts) { - case 2: - value, err := ParseUint(parts[1], 10, 64) - if err != nil { - return "", 0, fmt.Errorf("unable to convert to uint64: %v", err) - } +// ParseKeyValue parses a space-separated "name value" kind of cgroup +// parameter and returns its key as a string, and its value as uint64 +// (ParseUint is used to convert the value). For example, +// "io_service_bytes 1234" will be returned as "io_service_bytes", 1234. +func ParseKeyValue(t string) (string, uint64, error) { + parts := strings.SplitN(t, " ", 3) + if len(parts) != 2 { + return "", 0, fmt.Errorf("line %q is not in key value format", t) + } - return parts[0], value, nil - default: - return "", 0, ErrNotValidFormat + value, err := ParseUint(parts[1], 10, 64) + if err != nil { + return "", 0, fmt.Errorf("unable to convert to uint64: %v", err) } + + return parts[0], value, nil +} + +// GetValueByKey reads a key-value pairs from the specified cgroup file, +// and returns a value of the specified key. ParseUint is used for value +// conversion. +func GetValueByKey(path, file, key string) (uint64, error) { + content, err := ReadFile(path, file) + if err != nil { + return 0, err + } + + lines := strings.Split(string(content), "\n") + for _, line := range lines { + arr := strings.Split(line, " ") + if len(arr) == 2 && arr[0] == key { + return ParseUint(arr[1], 10, 64) + } + } + + return 0, nil } // GetCgroupParamUint reads a single uint64 value from the specified cgroup file. diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go index 6d5def71257c..91c314e09eaa 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go @@ -2,6 +2,7 @@ package systemd import ( "bufio" + "context" "fmt" "math" "os" @@ -28,10 +29,6 @@ const ( ) var ( - connOnce sync.Once - connDbus *systemdDbus.Conn - connErr error - versionOnce sync.Once version int @@ -291,19 +288,6 @@ func generateDeviceProperties(rules []*devices.Rule) ([]systemdDbus.Property, er return properties, nil } -// getDbusConnection lazy initializes systemd dbus connection -// and returns it -func getDbusConnection(rootless bool) (*systemdDbus.Conn, error) { - connOnce.Do(func() { - if rootless { - connDbus, connErr = NewUserSystemdDbus() - } else { - connDbus, connErr = systemdDbus.New() - } - }) - return connDbus, connErr -} - func newProp(name string, units interface{}) systemdDbus.Property { return systemdDbus.Property{ Name: name, @@ -319,32 +303,42 @@ func getUnitName(c *configs.Cgroup) string { return c.Name } -// isUnitExists returns true if the error is that a systemd unit already exists. -func isUnitExists(err error) bool { +// isDbusError returns true if the error is a specific dbus error. +func isDbusError(err error, name string) bool { if err != nil { - if dbusError, ok := err.(dbus.Error); ok { - return strings.Contains(dbusError.Name, "org.freedesktop.systemd1.UnitExists") + var derr *dbus.Error + if errors.As(err, &derr) { + return strings.Contains(derr.Name, name) } } return false } -func startUnit(dbusConnection *systemdDbus.Conn, unitName string, properties []systemdDbus.Property) error { +// isUnitExists returns true if the error is that a systemd unit already exists. +func isUnitExists(err error) bool { + return isDbusError(err, "org.freedesktop.systemd1.UnitExists") +} + +func startUnit(cm *dbusConnManager, unitName string, properties []systemdDbus.Property) error { statusChan := make(chan string, 1) - if _, err := dbusConnection.StartTransientUnit(unitName, "replace", properties, statusChan); err == nil { + err := cm.retryOnDisconnect(func(c *systemdDbus.Conn) error { + _, err := c.StartTransientUnitContext(context.TODO(), unitName, "replace", properties, statusChan) + return err + }) + if err == nil { timeout := time.NewTimer(30 * time.Second) defer timeout.Stop() select { case s := <-statusChan: close(statusChan) - // Please refer to https://godoc.org/github.com/coreos/go-systemd/dbus#Conn.StartUnit + // Please refer to https://pkg.go.dev/github.com/coreos/go-systemd/v22/dbus#Conn.StartUnit if s != "done" { - dbusConnection.ResetFailedUnit(unitName) + resetFailedUnit(cm, unitName) return errors.Errorf("error creating systemd unit `%s`: got `%s`", unitName, s) } case <-timeout.C: - dbusConnection.ResetFailedUnit(unitName) + resetFailedUnit(cm, unitName) return errors.New("Timeout waiting for systemd to create " + unitName) } } else if !isUnitExists(err) { @@ -354,13 +348,17 @@ func startUnit(dbusConnection *systemdDbus.Conn, unitName string, properties []s return nil } -func stopUnit(dbusConnection *systemdDbus.Conn, unitName string) error { +func stopUnit(cm *dbusConnManager, unitName string) error { statusChan := make(chan string, 1) - if _, err := dbusConnection.StopUnit(unitName, "replace", statusChan); err == nil { + err := cm.retryOnDisconnect(func(c *systemdDbus.Conn) error { + _, err := c.StopUnitContext(context.TODO(), unitName, "replace", statusChan) + return err + }) + if err == nil { select { case s := <-statusChan: close(statusChan) - // Please refer to https://godoc.org/github.com/coreos/go-systemd/dbus#Conn.StartUnit + // Please refer to https://godoc.org/github.com/coreos/go-systemd/v22/dbus#Conn.StartUnit if s != "done" { logrus.Warnf("error removing unit `%s`: got `%s`. Continuing...", unitName, s) } @@ -371,10 +369,38 @@ func stopUnit(dbusConnection *systemdDbus.Conn, unitName string) error { return nil } -func systemdVersion(conn *systemdDbus.Conn) int { +func resetFailedUnit(cm *dbusConnManager, name string) { + err := cm.retryOnDisconnect(func(c *systemdDbus.Conn) error { + return c.ResetFailedUnitContext(context.TODO(), name) + }) + if err != nil { + logrus.Warnf("unable to reset failed unit: %v", err) + } +} + +func setUnitProperties(cm *dbusConnManager, name string, properties ...systemdDbus.Property) error { + return cm.retryOnDisconnect(func(c *systemdDbus.Conn) error { + return c.SetUnitPropertiesContext(context.TODO(), name, true, properties...) + }) +} + +func getManagerProperty(cm *dbusConnManager, name string) (string, error) { + str := "" + err := cm.retryOnDisconnect(func(c *systemdDbus.Conn) error { + var err error + str, err = c.GetManagerProperty(name) + return err + }) + if err != nil { + return "", err + } + return strconv.Unquote(str) +} + +func systemdVersion(cm *dbusConnManager) int { versionOnce.Do(func() { version = -1 - verStr, err := conn.GetManagerProperty("Version") + verStr, err := getManagerProperty(cm, "Version") if err == nil { version, err = systemdVersionAtoi(verStr) } @@ -389,11 +415,11 @@ func systemdVersion(conn *systemdDbus.Conn) int { func systemdVersionAtoi(verStr string) (int, error) { // verStr should be of the form: - // "v245.4-1.fc32", "245", "v245-1.fc32", "245-1.fc32" - // all the input strings include quotes, and the output int should be 245 - // thus, we unconditionally remove the `"v` - // and then match on the first integer we can grab - re := regexp.MustCompile(`"?v?([0-9]+)`) + // "v245.4-1.fc32", "245", "v245-1.fc32", "245-1.fc32" (without quotes). + // The result for all of the above should be 245. + // Thus, we unconditionally remove the "v" prefix + // and then match on the first integer we can grab. + re := regexp.MustCompile(`v?([0-9]+)`) matches := re.FindStringSubmatch(verStr) if len(matches) < 2 { return 0, errors.Errorf("can't parse version %s: incorrect number of matches %v", verStr, matches) @@ -402,10 +428,10 @@ func systemdVersionAtoi(verStr string) (int, error) { return ver, errors.Wrapf(err, "can't parse version %s", verStr) } -func addCpuQuota(conn *systemdDbus.Conn, properties *[]systemdDbus.Property, quota int64, period uint64) { +func addCpuQuota(cm *dbusConnManager, properties *[]systemdDbus.Property, quota int64, period uint64) { if period != 0 { // systemd only supports CPUQuotaPeriodUSec since v242 - sdVer := systemdVersion(conn) + sdVer := systemdVersion(cm) if sdVer >= 242 { *properties = append(*properties, newProp("CPUQuotaPeriodUSec", period)) @@ -436,13 +462,13 @@ func addCpuQuota(conn *systemdDbus.Conn, properties *[]systemdDbus.Property, quo } } -func addCpuset(conn *systemdDbus.Conn, props *[]systemdDbus.Property, cpus, mems string) error { +func addCpuset(cm *dbusConnManager, props *[]systemdDbus.Property, cpus, mems string) error { if cpus == "" && mems == "" { return nil } // systemd only supports AllowedCPUs/AllowedMemoryNodes since v244 - sdVer := systemdVersion(conn) + sdVer := systemdVersion(cm) if sdVer < 244 { logrus.Debugf("systemd v%d is too old to support AllowedCPUs/AllowedMemoryNodes"+ " (settings will still be applied to cgroupfs)", sdVer) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/dbus.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/dbus.go new file mode 100644 index 000000000000..0f7406cd9d60 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/dbus.go @@ -0,0 +1,96 @@ +// +build linux + +package systemd + +import ( + "context" + "sync" + + systemdDbus "github.com/coreos/go-systemd/v22/dbus" + dbus "github.com/godbus/dbus/v5" +) + +var ( + dbusC *systemdDbus.Conn + dbusMu sync.RWMutex + dbusInited bool + dbusRootless bool +) + +type dbusConnManager struct { +} + +// newDbusConnManager initializes systemd dbus connection manager. +func newDbusConnManager(rootless bool) *dbusConnManager { + if dbusInited && rootless != dbusRootless { + panic("can't have both root and rootless dbus") + } + dbusRootless = rootless + return &dbusConnManager{} +} + +// getConnection lazily initializes and returns systemd dbus connection. +func (d *dbusConnManager) getConnection() (*systemdDbus.Conn, error) { + // In the case where dbusC != nil + // Use the read lock the first time to ensure + // that Conn can be acquired at the same time. + dbusMu.RLock() + if conn := dbusC; conn != nil { + dbusMu.RUnlock() + return conn, nil + } + dbusMu.RUnlock() + + // In the case where dbusC == nil + // Use write lock to ensure that only one + // will be created + dbusMu.Lock() + defer dbusMu.Unlock() + if conn := dbusC; conn != nil { + return conn, nil + } + + conn, err := d.newConnection() + if err != nil { + return nil, err + } + dbusC = conn + return conn, nil +} + +func (d *dbusConnManager) newConnection() (*systemdDbus.Conn, error) { + if dbusRootless { + return newUserSystemdDbus() + } + return systemdDbus.NewWithContext(context.TODO()) +} + +// resetConnection resets the connection to its initial state +// (so it can be reconnected if necessary). +func (d *dbusConnManager) resetConnection(conn *systemdDbus.Conn) { + dbusMu.Lock() + defer dbusMu.Unlock() + if dbusC != nil && dbusC == conn { + dbusC.Close() + dbusC = nil + } +} + +var errDbusConnClosed = dbus.ErrClosed.Error() + +// retryOnDisconnect calls op, and if the error it returns is about closed dbus +// connection, the connection is re-established and the op is retried. This helps +// with the situation when dbus is restarted and we have a stale connection. +func (d *dbusConnManager) retryOnDisconnect(op func(*systemdDbus.Conn) error) error { + for { + conn, err := d.getConnection() + if err != nil { + return err + } + err = op(conn) + if !isDbusError(err, errDbusConnClosed) { + return err + } + d.resetConnection(conn) + } +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go index 8fe91688477b..ddeaf6642638 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go @@ -13,12 +13,12 @@ import ( systemdDbus "github.com/coreos/go-systemd/v22/dbus" dbus "github.com/godbus/dbus/v5" - "github.com/opencontainers/runc/libcontainer/system" + "github.com/opencontainers/runc/libcontainer/userns" "github.com/pkg/errors" ) -// NewUserSystemdDbus creates a connection for systemd user-instance. -func NewUserSystemdDbus() (*systemdDbus.Conn, error) { +// newUserSystemdDbus creates a connection for systemd user-instance. +func newUserSystemdDbus() (*systemdDbus.Conn, error) { addr, err := DetectUserDbusSessionBusAddress() if err != nil { return nil, err @@ -52,7 +52,7 @@ func NewUserSystemdDbus() (*systemdDbus.Conn, error) { // // Otherwise returns os.Getuid() . func DetectUID() (int, error) { - if !system.RunningInUserNS() { + if !userns.RunningInUserNS() { return os.Getuid(), nil } b, err := exec.Command("busctl", "--user", "--no-pager", "status").CombinedOutput() diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go index 64af1d94b3e3..41de6e8b70f0 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go @@ -12,7 +12,6 @@ import ( systemdDbus "github.com/coreos/go-systemd/v22/dbus" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fs" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" "github.com/sirupsen/logrus" ) @@ -21,12 +20,14 @@ type legacyManager struct { mu sync.Mutex cgroups *configs.Cgroup paths map[string]string + dbus *dbusConnManager } func NewLegacyManager(cg *configs.Cgroup, paths map[string]string) cgroups.Manager { return &legacyManager{ cgroups: cg, paths: paths, + dbus: newDbusConnManager(false), } } @@ -35,8 +36,8 @@ type subsystem interface { Name() string // Returns the stats, as 'stats', corresponding to the cgroup under 'path'. GetStats(path string, stats *cgroups.Stats) error - // Set the cgroup represented by cgroup. - Set(path string, cgroup *configs.Cgroup) error + // Set sets cgroup resource limits. + Set(path string, r *configs.Resources) error } var errSubsystemDoesNotExist = errors.New("cgroup: subsystem does not exist") @@ -57,9 +58,8 @@ var legacySubsystems = []subsystem{ &fs.NameGroup{GroupName: "name=systemd"}, } -func genV1ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]systemdDbus.Property, error) { +func genV1ResourcesProperties(r *configs.Resources, cm *dbusConnManager) ([]systemdDbus.Property, error) { var properties []systemdDbus.Property - r := c.Resources deviceProperties, err := generateDeviceProperties(r.Devices) if err != nil { @@ -77,7 +77,7 @@ func genV1ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]syst newProp("CPUShares", r.CpuShares)) } - addCpuQuota(conn, &properties, r.CpuQuota, r.CpuPeriod) + addCpuQuota(cm, &properties, r.CpuQuota, r.CpuPeriod) if r.BlkioWeight != 0 { properties = append(properties, @@ -86,11 +86,10 @@ func genV1ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]syst if r.PidsLimit > 0 || r.PidsLimit == -1 { properties = append(properties, - newProp("TasksAccounting", true), newProp("TasksMax", uint64(r.PidsLimit))) } - err = addCpuset(conn, &properties, r.CpusetCpus, r.CpusetMems) + err = addCpuset(cm, &properties, r.CpusetCpus, r.CpusetMems) if err != nil { return nil, err } @@ -158,32 +157,17 @@ func (m *legacyManager) Apply(pid int) error { properties = append(properties, newProp("MemoryAccounting", true), newProp("CPUAccounting", true), - newProp("BlockIOAccounting", true)) + newProp("BlockIOAccounting", true), + newProp("TasksAccounting", true), + ) // Assume DefaultDependencies= will always work (the check for it was previously broken.) properties = append(properties, newProp("DefaultDependencies", false)) - dbusConnection, err := getDbusConnection(false) - if err != nil { - return err - } - resourcesProperties, err := genV1ResourcesProperties(c, dbusConnection) - if err != nil { - return err - } - properties = append(properties, resourcesProperties...) properties = append(properties, c.SystemdProps...) - // We have to set kernel memory here, as we can't change it once - // processes have been attached to the cgroup. - if c.Resources.KernelMemory != 0 { - if err := enableKmem(c); err != nil { - return err - } - } - - if err := startUnit(dbusConnection, unitName, properties); err != nil { + if err := startUnit(m.dbus, unitName, properties); err != nil { return err } @@ -221,13 +205,8 @@ func (m *legacyManager) Destroy() error { m.mu.Lock() defer m.mu.Unlock() - dbusConnection, err := getDbusConnection(false) - if err != nil { - return err - } - unitName := getUnitName(m.cgroups) + stopErr := stopUnit(m.dbus, getUnitName(m.cgroups)) - stopErr := stopUnit(dbusConnection, unitName) // Both on success and on error, cleanup all the cgroups we are aware of. // Some of them were created directly by Apply() and are not managed by systemd. if err := cgroups.RemovePaths(m.paths); err != nil { @@ -252,7 +231,7 @@ func (m *legacyManager) joinCgroups(pid int) error { case "cpuset": if path, ok := m.paths[name]; ok { s := &fs.CpusetGroup{} - if err := s.ApplyDir(path, m.cgroups, pid); err != nil { + if err := s.ApplyDir(path, m.cgroups.Resources, pid); err != nil { return err } } @@ -305,7 +284,7 @@ func (m *legacyManager) Freeze(state configs.FreezerState) error { prevState := m.cgroups.Resources.Freezer m.cgroups.Resources.Freezer = state freezer := &fs.FreezerGroup{} - if err := freezer.Set(path, m.cgroups); err != nil { + if err := freezer.Set(path, m.cgroups.Resources); err != nil { m.cgroups.Resources.Freezer = prevState return err } @@ -345,20 +324,16 @@ func (m *legacyManager) GetStats() (*cgroups.Stats, error) { return stats, nil } -func (m *legacyManager) Set(container *configs.Config) error { +func (m *legacyManager) Set(r *configs.Resources) error { // If Paths are set, then we are just joining cgroups paths // and there is no need to set any values. if m.cgroups.Paths != nil { return nil } - if container.Cgroups.Resources.Unified != nil { + if r.Unified != nil { return cgroups.ErrV1NoUnified } - dbusConnection, err := getDbusConnection(false) - if err != nil { - return err - } - properties, err := genV1ResourcesProperties(container.Cgroups, dbusConnection) + properties, err := genV1ResourcesProperties(r, m.dbus) if err != nil { return err } @@ -386,7 +361,7 @@ func (m *legacyManager) Set(container *configs.Config) error { } } - if err := dbusConnection.SetUnitProperties(getUnitName(container.Cgroups), true, properties...); err != nil { + if err := setUnitProperties(m.dbus, getUnitName(m.cgroups), properties...); err != nil { _ = m.Freeze(targetFreezerState) return err } @@ -401,7 +376,7 @@ func (m *legacyManager) Set(container *configs.Config) error { if !ok { continue } - if err := sys.Set(path, container.Cgroups); err != nil { + if err := sys.Set(path, r); err != nil { return err } } @@ -409,30 +384,6 @@ func (m *legacyManager) Set(container *configs.Config) error { return nil } -func enableKmem(c *configs.Cgroup) error { - path, err := getSubsystemPath(c, "memory") - if err != nil { - if cgroups.IsNotFound(err) { - return nil - } - return err - } - - if err := os.MkdirAll(path, 0755); err != nil { - return err - } - // do not try to enable the kernel memory if we already have - // tasks in the cgroup. - content, err := fscommon.ReadFile(path, "tasks") - if err != nil { - return err - } - if len(content) > 0 { - return nil - } - return fs.EnableKernelMemoryAccounting(path) -} - func (m *legacyManager) GetPaths() map[string]string { m.mu.Lock() defer m.mu.Unlock() @@ -455,3 +406,7 @@ func (m *legacyManager) GetFreezerState() (configs.FreezerState, error) { func (m *legacyManager) Exists() bool { return cgroups.PathExists(m.Path("devices")) } + +func (m *legacyManager) OOMKillCount() (uint64, error) { + return fs.OOMKillCount(m.Path("memory")) +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go index 70b5b368e862..8abb0feb7483 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go @@ -26,6 +26,7 @@ type unifiedManager struct { // path is like "/sys/fs/cgroup/user.slice/user-1001.slice/session-1.scope" path string rootless bool + dbus *dbusConnManager } func NewUnifiedManager(config *configs.Cgroup, path string, rootless bool) cgroups.Manager { @@ -33,6 +34,7 @@ func NewUnifiedManager(config *configs.Cgroup, path string, rootless bool) cgrou cgroups: config, path: path, rootless: rootless, + dbus: newDbusConnManager(rootless), } } @@ -45,7 +47,7 @@ func NewUnifiedManager(config *configs.Cgroup, path string, rootless bool) cgrou // For the list of keys, see https://www.kernel.org/doc/Documentation/cgroup-v2.txt // // For the list of systemd unit properties, see systemd.resource-control(5). -func unifiedResToSystemdProps(conn *systemdDbus.Conn, res map[string]string) (props []systemdDbus.Property, _ error) { +func unifiedResToSystemdProps(cm *dbusConnManager, res map[string]string) (props []systemdDbus.Property, _ error) { var err error for k, v := range res { @@ -83,7 +85,7 @@ func unifiedResToSystemdProps(conn *systemdDbus.Conn, res map[string]string) (pr return nil, fmt.Errorf("unified resource %q quota value conversion error: %w", k, err) } } - addCpuQuota(conn, &props, quota, period) + addCpuQuota(cm, &props, quota, period) case "cpu.weight": num, err := strconv.ParseUint(v, 10, 64) @@ -103,7 +105,7 @@ func unifiedResToSystemdProps(conn *systemdDbus.Conn, res map[string]string) (pr "cpuset.mems": "AllowedMemoryNodes", } // systemd only supports these properties since v244 - sdVer := systemdVersion(conn) + sdVer := systemdVersion(cm) if sdVer >= 244 { props = append(props, newProp(m[k], bits)) @@ -141,7 +143,6 @@ func unifiedResToSystemdProps(conn *systemdDbus.Conn, res map[string]string) (pr } } props = append(props, - newProp("TasksAccounting", true), newProp("TasksMax", num)) case "memory.oom.group": @@ -163,9 +164,8 @@ func unifiedResToSystemdProps(conn *systemdDbus.Conn, res map[string]string) (pr return props, nil } -func genV2ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]systemdDbus.Property, error) { +func genV2ResourcesProperties(r *configs.Resources, cm *dbusConnManager) ([]systemdDbus.Property, error) { var properties []systemdDbus.Property - r := c.Resources // NOTE: This is of questionable correctness because we insert our own // devices eBPF program later. Two programs with identical rules @@ -201,15 +201,14 @@ func genV2ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]syst newProp("CPUWeight", r.CpuWeight)) } - addCpuQuota(conn, &properties, r.CpuQuota, r.CpuPeriod) + addCpuQuota(cm, &properties, r.CpuQuota, r.CpuPeriod) if r.PidsLimit > 0 || r.PidsLimit == -1 { properties = append(properties, - newProp("TasksAccounting", true), newProp("TasksMax", uint64(r.PidsLimit))) } - err = addCpuset(conn, &properties, r.CpusetCpus, r.CpusetMems) + err = addCpuset(cm, &properties, r.CpusetCpus, r.CpusetMems) if err != nil { return nil, err } @@ -218,7 +217,7 @@ func genV2ResourcesProperties(c *configs.Cgroup, conn *systemdDbus.Conn) ([]syst // convert Resources.Unified map to systemd properties if r.Unified != nil { - unifiedProps, err := unifiedResToSystemdProps(conn, r.Unified) + unifiedProps, err := unifiedResToSystemdProps(cm, r.Unified) if err != nil { return nil, err } @@ -273,28 +272,21 @@ func (m *unifiedManager) Apply(pid int) error { properties = append(properties, newProp("MemoryAccounting", true), newProp("CPUAccounting", true), - newProp("IOAccounting", true)) + newProp("IOAccounting", true), + newProp("TasksAccounting", true), + ) // Assume DefaultDependencies= will always work (the check for it was previously broken.) properties = append(properties, newProp("DefaultDependencies", false)) - dbusConnection, err := getDbusConnection(m.rootless) - if err != nil { - return err - } - resourcesProperties, err := genV2ResourcesProperties(c, dbusConnection) - if err != nil { - return err - } - properties = append(properties, resourcesProperties...) properties = append(properties, c.SystemdProps...) - if err := startUnit(dbusConnection, unitName, properties); err != nil { + if err := startUnit(m.dbus, unitName, properties); err != nil { return errors.Wrapf(err, "error while starting unit %q with properties %+v", unitName, properties) } - if err = m.initPath(); err != nil { + if err := m.initPath(); err != nil { return err } if err := fs2.CreateCgroupPath(m.path, m.cgroups); err != nil { @@ -310,17 +302,13 @@ func (m *unifiedManager) Destroy() error { m.mu.Lock() defer m.mu.Unlock() - dbusConnection, err := getDbusConnection(m.rootless) - if err != nil { - return err - } unitName := getUnitName(m.cgroups) - if err := stopUnit(dbusConnection, unitName); err != nil { + if err := stopUnit(m.dbus, unitName); err != nil { return err } // XXX this is probably not needed, systemd should handle it - err = os.Remove(m.path) + err := os.Remove(m.path) if err != nil && !os.IsNotExist(err) { return err } @@ -329,6 +317,7 @@ func (m *unifiedManager) Destroy() error { } func (m *unifiedManager) Path(_ string) string { + _ = m.initPath() return m.path } @@ -349,16 +338,8 @@ func (m *unifiedManager) getSliceFull() (string, error) { } if m.rootless { - dbusConnection, err := getDbusConnection(m.rootless) - if err != nil { - return "", err - } - // managerCGQuoted is typically "/user.slice/user-${uid}.slice/user@${uid}.service" including the quote symbols - managerCGQuoted, err := dbusConnection.GetManagerProperty("ControlGroup") - if err != nil { - return "", err - } - managerCG, err := strconv.Unquote(managerCGQuoted) + // managerCG is typically "/user.slice/user-${uid}.slice/user@${uid}.service". + managerCG, err := getManagerProperty(m.dbus, "ControlGroup") if err != nil { return "", err } @@ -431,12 +412,8 @@ func (m *unifiedManager) GetStats() (*cgroups.Stats, error) { return fsMgr.GetStats() } -func (m *unifiedManager) Set(container *configs.Config) error { - dbusConnection, err := getDbusConnection(m.rootless) - if err != nil { - return err - } - properties, err := genV2ResourcesProperties(m.cgroups, dbusConnection) +func (m *unifiedManager) Set(r *configs.Resources) error { + properties, err := genV2ResourcesProperties(r, m.dbus) if err != nil { return err } @@ -464,7 +441,7 @@ func (m *unifiedManager) Set(container *configs.Config) error { } } - if err := dbusConnection.SetUnitProperties(getUnitName(m.cgroups), true, properties...); err != nil { + if err := setUnitProperties(m.dbus, getUnitName(m.cgroups), properties...); err != nil { _ = m.Freeze(targetFreezerState) return errors.Wrap(err, "error while setting unit properties") } @@ -477,7 +454,7 @@ func (m *unifiedManager) Set(container *configs.Config) error { if err != nil { return err } - return fsMgr.Set(container) + return fsMgr.Set(r) } func (m *unifiedManager) GetPaths() map[string]string { @@ -501,3 +478,11 @@ func (m *unifiedManager) GetFreezerState() (configs.FreezerState, error) { func (m *unifiedManager) Exists() bool { return cgroups.PathExists(m.path) } + +func (m *unifiedManager) OOMKillCount() (uint64, error) { + fsMgr, err := m.fsManager() + if err != nil { + return 0, err + } + return fsMgr.OOMKillCount() +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go index 840817e398a8..35ce2c1c2d47 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go @@ -16,7 +16,7 @@ import ( "time" "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/system" + "github.com/opencontainers/runc/libcontainer/userns" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -37,7 +37,7 @@ func IsCgroup2UnifiedMode() bool { var st unix.Statfs_t err := unix.Statfs(unifiedMountpoint, &st) if err != nil { - if os.IsNotExist(err) && system.RunningInUserNS() { + if os.IsNotExist(err) && userns.RunningInUserNS() { // ignore the "not found" error if running in userns logrus.WithError(err).Debugf("%s missing, assuming cgroup v1", unifiedMountpoint) isUnified = false @@ -400,17 +400,6 @@ func WriteCgroupProc(dir string, pid int) error { return err } -// Since the OCI spec is designed for cgroup v1, in some cases -// there is need to convert from the cgroup v1 configuration to cgroup v2 -// the formula for BlkIOWeight is y = (1 + (x - 10) * 9999 / 990) -// convert linearly from [10-1000] to [1-10000] -func ConvertBlkIOToCgroupV2Value(blkIoWeight uint16) uint64 { - if blkIoWeight == 0 { - return 0 - } - return uint64(1 + (uint64(blkIoWeight)-10)*9999/990) -} - // Since the OCI spec is designed for cgroup v1, in some cases // there is need to convert from the cgroup v1 configuration to cgroup v2 // the formula for cpuShares is y = (1 + ((x - 2) * 9999) / 262142) @@ -450,3 +439,14 @@ func ConvertMemorySwapToCgroupV2Value(memorySwap, memory int64) (int64, error) { return memorySwap - memory, nil } + +// Since the OCI spec is designed for cgroup v1, in some cases +// there is need to convert from the cgroup v1 configuration to cgroup v2 +// the formula for BlkIOWeight to IOWeight is y = (1 + (x - 10) * 9999 / 990) +// convert linearly from [10-1000] to [1-10000] +func ConvertBlkIOToIOWeightValue(blkIoWeight uint16) uint64 { + if blkIoWeight == 0 { + return 0 + } + return uint64(1 + (uint64(blkIoWeight)-10)*9999/990) +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go index aada5d62f199..87d0da842881 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go @@ -54,12 +54,6 @@ type Resources struct { // Total memory usage (memory + swap); set `-1` to enable unlimited swap MemorySwap int64 `json:"memory_swap"` - // Kernel memory limit (in bytes) - KernelMemory int64 `json:"kernel_memory"` - - // Kernel memory limit for TCP use (in bytes) - KernelMemoryTCP int64 `json:"kernel_memory_tcp"` - // CPU shares (relative weight vs. other containers) CpuShares uint64 `json:"cpu_shares"` diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go index e1cd1626565a..14a0960389fb 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go @@ -31,9 +31,10 @@ type IDMap struct { // for syscalls. Additional architectures can be added by specifying them in // Architectures. type Seccomp struct { - DefaultAction Action `json:"default_action"` - Architectures []string `json:"architectures"` - Syscalls []*Syscall `json:"syscalls"` + DefaultAction Action `json:"default_action"` + Architectures []string `json:"architectures"` + Syscalls []*Syscall `json:"syscalls"` + DefaultErrnoRet *uint `json:"default_errno_ret"` } // Action is taken upon rule match in Seccomp @@ -222,25 +223,25 @@ const ( // the runtime environment has been created but before the pivot_root has been executed. // CreateRuntime is called immediately after the deprecated Prestart hook. // CreateRuntime commands are called in the Runtime Namespace. - CreateRuntime = "createRuntime" + CreateRuntime HookName = "createRuntime" // CreateContainer commands MUST be called as part of the create operation after // the runtime environment has been created but before the pivot_root has been executed. // CreateContainer commands are called in the Container namespace. - CreateContainer = "createContainer" + CreateContainer HookName = "createContainer" // StartContainer commands MUST be called as part of the start operation and before // the container process is started. // StartContainer commands are called in the Container namespace. - StartContainer = "startContainer" + StartContainer HookName = "startContainer" // Poststart commands are executed after the container init process starts. // Poststart commands are called in the Runtime Namespace. - Poststart = "poststart" + Poststart HookName = "poststart" // Poststop commands are executed after the container init process exits. // Poststop commands are called in the Runtime Namespace. - Poststop = "poststop" + Poststop HookName = "poststop" ) type Capabilities struct { @@ -387,7 +388,7 @@ func (c Command) Run(s *specs.State) error { return err case <-timerCh: cmd.Process.Kill() - cmd.Wait() + <-errC return fmt.Errorf("hook ran past specified timeout of %.1fs", c.Timeout.Seconds()) } } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/configs_fuzzer.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/configs_fuzzer.go new file mode 100644 index 000000000000..93bf41c8defc --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/configs_fuzzer.go @@ -0,0 +1,9 @@ +// +build gofuzz + +package configs + +func FuzzUnmarshalJSON(data []byte) int { + hooks := Hooks{} + _ = hooks.UnmarshalJSON(data) + return 1 +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/rootless.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/rootless.go index 717d0f00a340..9a6e5eb32a3c 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/rootless.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/rootless.go @@ -11,6 +11,9 @@ import ( // rootlessEUID makes sure that the config can be applied when runc // is being executed as a non-root user (euid != 0) in the current user namespace. func (v *ConfigValidator) rootlessEUID(config *configs.Config) error { + if !config.RootlessEUID { + return nil + } if err := rootlessEUIDMappings(config); err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/validator.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/validator.go index 63abdb00cb07..02de2abc81c0 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/validator.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/configs/validate/validator.go @@ -8,6 +8,7 @@ import ( "strings" "sync" + "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/intelrdt" selinux "github.com/opencontainers/selinux/go-selinux" @@ -25,36 +26,30 @@ func New() Validator { type ConfigValidator struct { } +type check func(config *configs.Config) error + func (v *ConfigValidator) Validate(config *configs.Config) error { - if err := v.rootfs(config); err != nil { - return err - } - if err := v.network(config); err != nil { - return err - } - if err := v.hostname(config); err != nil { - return err - } - if err := v.security(config); err != nil { - return err - } - if err := v.usernamespace(config); err != nil { - return err + checks := []check{ + v.rootfs, + v.network, + v.hostname, + v.security, + v.usernamespace, + v.cgroupnamespace, + v.sysctl, + v.intelrdt, + v.rootlessEUID, + v.mounts, } - if err := v.cgroupnamespace(config); err != nil { - return err - } - if err := v.sysctl(config); err != nil { - return err - } - if err := v.intelrdt(config); err != nil { - return err - } - if config.RootlessEUID { - if err := v.rootlessEUID(config); err != nil { + for _, c := range checks { + if err := c(config); err != nil { return err } } + if err := v.cgroups(config); err != nil { + return err + } + return nil } @@ -223,6 +218,45 @@ func (v *ConfigValidator) intelrdt(config *configs.Config) error { return nil } +func (v *ConfigValidator) cgroups(config *configs.Config) error { + c := config.Cgroups + if c == nil { + return nil + } + + if (c.Name != "" || c.Parent != "") && c.Path != "" { + return fmt.Errorf("cgroup: either Path or Name and Parent should be used, got %+v", c) + } + + r := c.Resources + if r == nil { + return nil + } + + if !cgroups.IsCgroup2UnifiedMode() && r.Unified != nil { + return cgroups.ErrV1NoUnified + } + + if cgroups.IsCgroup2UnifiedMode() { + _, err := cgroups.ConvertMemorySwapToCgroupV2Value(r.MemorySwap, r.Memory) + if err != nil { + return err + } + } + + return nil +} + +func (v *ConfigValidator) mounts(config *configs.Config) error { + for _, m := range config.Mounts { + if !filepath.IsAbs(m.Destination) { + return fmt.Errorf("invalid mount %+v: mount destination not absolute", m) + } + } + + return nil +} + func isHostNetNS(path string) (bool, error) { const currentProcessNetns = "/proc/self/ns/net" diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/container_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/container_linux.go index 3dca29e4c3f2..849bf4a613ce 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/container_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/container_linux.go @@ -27,13 +27,13 @@ import ( "github.com/opencontainers/runc/libcontainer/utils" "github.com/opencontainers/runtime-spec/specs-go" - "github.com/checkpoint-restore/go-criu/v4" - criurpc "github.com/checkpoint-restore/go-criu/v4/rpc" - "github.com/golang/protobuf/proto" + "github.com/checkpoint-restore/go-criu/v5" + criurpc "github.com/checkpoint-restore/go-criu/v5/rpc" errorsf "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/vishvananda/netlink/nl" "golang.org/x/sys/unix" + "google.golang.org/protobuf/proto" ) const stdioFdCount = 3 @@ -55,6 +55,7 @@ type linuxContainer struct { criuVersion int state containerState created time.Time + fifo *os.File } // State represents a running container's state @@ -224,9 +225,9 @@ func (c *linuxContainer) Set(config configs.Config) error { if status == Stopped { return newGenericError(errors.New("container not running"), ContainerNotRunning) } - if err := c.cgroupManager.Set(&config); err != nil { + if err := c.cgroupManager.Set(config.Cgroups.Resources); err != nil { // Set configs back - if err2 := c.cgroupManager.Set(c.config); err2 != nil { + if err2 := c.cgroupManager.Set(c.config.Cgroups.Resources); err2 != nil { logrus.Warnf("Setting back cgroup configs failed due to error: %v, your state.json and actual configs might be inconsistent.", err2) } return err @@ -234,7 +235,7 @@ func (c *linuxContainer) Set(config configs.Config) error { if c.intelRdtManager != nil { if err := c.intelRdtManager.Set(&config); err != nil { // Set configs back - if err2 := c.cgroupManager.Set(c.config); err2 != nil { + if err2 := c.cgroupManager.Set(c.config.Cgroups.Resources); err2 != nil { logrus.Warnf("Setting back cgroup configs failed due to error: %v, your state.json and actual configs might be inconsistent.", err2) } if err2 := c.intelRdtManager.Set(c.config); err2 != nil { @@ -357,17 +358,30 @@ type openResult struct { err error } -func (c *linuxContainer) start(process *Process) error { +func (c *linuxContainer) start(process *Process) (retErr error) { parent, err := c.newParentProcess(process) if err != nil { return newSystemErrorWithCause(err, "creating new parent process") } - parent.forwardChildLogs() + + logsDone := parent.forwardChildLogs() + if logsDone != nil { + defer func() { + // Wait for log forwarder to finish. This depends on + // runc init closing the _LIBCONTAINER_LOGPIPE log fd. + err := <-logsDone + if err != nil && retErr == nil { + retErr = newSystemErrorWithCause(err, "forwarding init logs") + } + }() + } + if err := parent.start(); err != nil { return newSystemErrorWithCause(err, "starting container process") } if process.Init { + c.fifo.Close() if c.config.Hooks != nil { s, err := c.currentOCIState() if err != nil { @@ -443,12 +457,13 @@ func (c *linuxContainer) deleteExecFifo() { // fd, with _LIBCONTAINER_FIFOFD set to its fd number. func (c *linuxContainer) includeExecFifo(cmd *exec.Cmd) error { fifoName := filepath.Join(c.root, execFifoFilename) - fifoFd, err := unix.Open(fifoName, unix.O_PATH|unix.O_CLOEXEC, 0) + fifo, err := os.OpenFile(fifoName, unix.O_PATH|unix.O_CLOEXEC, 0) if err != nil { return err } + c.fifo = fifo - cmd.ExtraFiles = append(cmd.ExtraFiles, os.NewFile(uintptr(fifoFd), fifoName)) + cmd.ExtraFiles = append(cmd.ExtraFiles, fifo) cmd.Env = append(cmd.Env, "_LIBCONTAINER_FIFOFD="+strconv.Itoa(stdioFdCount+len(cmd.ExtraFiles)-1)) return nil @@ -570,6 +585,7 @@ func (c *linuxContainer) newSetnsProcess(p *Process, cmd *exec.Cmd, messageSockP intelRdtPath: state.IntelRdtPath, messageSockPair: messageSockPair, logFilePair: logFilePair, + manager: c.cgroupManager, config: c.newInitConfig(p), process: p, bootstrapData: data, @@ -594,6 +610,9 @@ func (c *linuxContainer) newInitConfig(process *Process) *initConfig { AppArmorProfile: c.config.AppArmorProfile, ProcessLabel: c.config.ProcessLabel, Rlimits: c.config.Rlimits, + CreateConsole: process.ConsoleSocket != nil, + ConsoleWidth: process.ConsoleWidth, + ConsoleHeight: process.ConsoleHeight, } if process.NoNewPrivileges != nil { cfg.NoNewPrivileges = *process.NoNewPrivileges @@ -607,9 +626,10 @@ func (c *linuxContainer) newInitConfig(process *Process) *initConfig { if len(process.Rlimits) > 0 { cfg.Rlimits = process.Rlimits } - cfg.CreateConsole = process.ConsoleSocket != nil - cfg.ConsoleWidth = process.ConsoleWidth - cfg.ConsoleHeight = process.ConsoleHeight + if cgroups.IsCgroup2UnifiedMode() { + cfg.Cgroup2Path = c.cgroupManager.Path("") + } + return cfg } @@ -701,7 +721,6 @@ func (c *linuxContainer) checkCriuFeatures(criuOpts *CriuOpts, rpcOpts *criurpc. return errors.New("CRIU feature check failed") } - logrus.Debugf("Feature check says: %s", criuFeatures) missingFeatures := false // The outer if checks if the fields actually exist @@ -1198,7 +1217,6 @@ func (c *linuxContainer) makeCriuRestoreMountpoints(m *configs.Mount) error { if err := checkProcMount(c.config.Rootfs, dest, ""); err != nil { return err } - m.Destination = dest if err := os.MkdirAll(dest, 0755); err != nil { return err } @@ -1235,11 +1253,46 @@ func (c *linuxContainer) prepareCriuRestoreMounts(mounts []*configs.Mount) error // Now go through all mounts and create the mountpoints // if the mountpoints are not on a tmpfs, as CRIU will // restore the complete tmpfs content from its checkpoint. + umounts := []string{} + defer func() { + for _, u := range umounts { + _ = utils.WithProcfd(c.config.Rootfs, u, func(procfd string) error { + if e := unix.Unmount(procfd, unix.MNT_DETACH); e != nil { + if e != unix.EINVAL { + // Ignore EINVAL as it means 'target is not a mount point.' + // It probably has already been unmounted. + logrus.Warnf("Error during cleanup unmounting of %s (%s): %v", procfd, u, e) + } + } + return nil + }) + } + }() for _, m := range mounts { if !isPathInPrefixList(m.Destination, tmpfs) { if err := c.makeCriuRestoreMountpoints(m); err != nil { return err } + // If the mount point is a bind mount, we need to mount + // it now so that runc can create the necessary mount + // points for mounts in bind mounts. + // This also happens during initial container creation. + // Without this CRIU restore will fail + // See: https://github.com/opencontainers/runc/issues/2748 + // It is also not necessary to order the mount points + // because during initial container creation mounts are + // set up in the order they are configured. + if m.Device == "bind" { + if err := utils.WithProcfd(c.config.Rootfs, m.Destination, func(procfd string) error { + if err := unix.Mount(m.Source, procfd, "", unix.MS_BIND|unix.MS_REC, ""); err != nil { + return errorsf.Wrapf(err, "unable to bind mount %q to %q (through %q)", m.Source, m.Destination, procfd) + } + return nil + }); err != nil { + return err + } + umounts = append(umounts, m.Destination) + } } } return nil @@ -1416,7 +1469,7 @@ func (c *linuxContainer) criuApplyCgroups(pid int, req *criurpc.CriuReq) error { return err } - if err := c.cgroupManager.Set(c.config); err != nil { + if err := c.cgroupManager.Set(c.config.Cgroups.Resources); err != nil { return newSystemError(err) } @@ -1475,7 +1528,6 @@ func (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts * // the initial CRIU run to detect the version. Skip it. logrus.Debugf("Using CRIU %d at: %s", c.criuVersion, c.criuPath) } - logrus.Debugf("Using CRIU with following args: %s", args) cmd := exec.Command(c.criuPath, args...) if process != nil { cmd.Stdin = process.Stdin @@ -1523,19 +1575,19 @@ func (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts * // should be empty. For older CRIU versions it still will be // available but empty. criurpc.CriuReqType_VERSION actually // has no req.GetOpts(). - if !(req.GetType() == criurpc.CriuReqType_FEATURE_CHECK || - req.GetType() == criurpc.CriuReqType_VERSION) { + if logrus.GetLevel() >= logrus.DebugLevel && + !(req.GetType() == criurpc.CriuReqType_FEATURE_CHECK || + req.GetType() == criurpc.CriuReqType_VERSION) { val := reflect.ValueOf(req.GetOpts()) v := reflect.Indirect(val) for i := 0; i < v.NumField(); i++ { st := v.Type() name := st.Field(i).Name - if strings.HasPrefix(name, "XXX_") { - continue + if 'A' <= name[0] && name[0] <= 'Z' { + value := val.MethodByName("Get" + name).Call([]reflect.Value{}) + logrus.Debugf("CRIU option %s with value %v", name, value[0]) } - value := val.MethodByName("Get" + name).Call([]reflect.Value{}) - logrus.Debugf("CRIU option %s with value %v", name, value[0]) } } data, err := proto.Marshal(req) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/criu_opts_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/criu_opts_linux.go index 11cbdb2db982..001c5399c721 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/criu_opts_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/criu_opts_linux.go @@ -1,6 +1,6 @@ package libcontainer -import criu "github.com/checkpoint-restore/go-criu/v4/rpc" +import criu "github.com/checkpoint-restore/go-criu/v5/rpc" type CriuPageServerInfo struct { Address string // IP address of CRIU page server diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go index 3eb73cc7c762..c2c2b3bb7c0b 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go @@ -168,3 +168,7 @@ func (d *Rule) CgroupString() string { } return fmt.Sprintf("%c %s:%s %s", d.Type, major, minor, d.Permissions) } + +func (d *Rule) Mkdev() (uint64, error) { + return mkDev(d) +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go index a400341e440f..acb816998c35 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go @@ -4,13 +4,118 @@ package devices import ( "errors" + "io/ioutil" + "os" + "path/filepath" "golang.org/x/sys/unix" ) -func (d *Rule) Mkdev() (uint64, error) { +var ( + // ErrNotADevice denotes that a file is not a valid linux device. + ErrNotADevice = errors.New("not a device node") +) + +// Testing dependencies +var ( + unixLstat = unix.Lstat + ioutilReadDir = ioutil.ReadDir +) + +func mkDev(d *Rule) (uint64, error) { if d.Major == Wildcard || d.Minor == Wildcard { return 0, errors.New("cannot mkdev() device with wildcards") } return unix.Mkdev(uint32(d.Major), uint32(d.Minor)), nil } + +// Given the path to a device and its cgroup_permissions(which cannot be easily queried) look up the +// information about a linux device and return that information as a Device struct. +func DeviceFromPath(path, permissions string) (*Device, error) { + var stat unix.Stat_t + err := unixLstat(path, &stat) + if err != nil { + return nil, err + } + + var ( + devType Type + mode = stat.Mode + devNumber = uint64(stat.Rdev) + major = unix.Major(devNumber) + minor = unix.Minor(devNumber) + ) + switch mode & unix.S_IFMT { + case unix.S_IFBLK: + devType = BlockDevice + case unix.S_IFCHR: + devType = CharDevice + case unix.S_IFIFO: + devType = FifoDevice + default: + return nil, ErrNotADevice + } + return &Device{ + Rule: Rule{ + Type: devType, + Major: int64(major), + Minor: int64(minor), + Permissions: Permissions(permissions), + }, + Path: path, + FileMode: os.FileMode(mode &^ unix.S_IFMT), + Uid: stat.Uid, + Gid: stat.Gid, + }, nil +} + +// HostDevices returns all devices that can be found under /dev directory. +func HostDevices() ([]*Device, error) { + return GetDevices("/dev") +} + +// GetDevices recursively traverses a directory specified by path +// and returns all devices found there. +func GetDevices(path string) ([]*Device, error) { + files, err := ioutilReadDir(path) + if err != nil { + return nil, err + } + var out []*Device + for _, f := range files { + switch { + case f.IsDir(): + switch f.Name() { + // ".lxc" & ".lxd-mounts" added to address https://github.com/lxc/lxd/issues/2825 + // ".udev" added to address https://github.com/opencontainers/runc/issues/2093 + case "pts", "shm", "fd", "mqueue", ".lxc", ".lxd-mounts", ".udev": + continue + default: + sub, err := GetDevices(filepath.Join(path, f.Name())) + if err != nil { + return nil, err + } + + out = append(out, sub...) + continue + } + case f.Name() == "console": + continue + } + device, err := DeviceFromPath(filepath.Join(path, f.Name()), "rwm") + if err != nil { + if err == ErrNotADevice { + continue + } + if os.IsNotExist(err) { + continue + } + return nil, err + } + if device.Type == FifoDevice { + continue + } + out = append(out, device) + } + return out, nil +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_windows.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_windows.go deleted file mode 100644 index 8511bf00e076..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/device_windows.go +++ /dev/null @@ -1,5 +0,0 @@ -package devices - -func (d *Rule) Mkdev() (uint64, error) { - return 0, nil -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/devices.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/devices.go deleted file mode 100644 index 5011f373d2c3..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/devices/devices.go +++ /dev/null @@ -1,112 +0,0 @@ -package devices - -import ( - "errors" - "io/ioutil" - "os" - "path/filepath" - - "golang.org/x/sys/unix" -) - -var ( - // ErrNotADevice denotes that a file is not a valid linux device. - ErrNotADevice = errors.New("not a device node") -) - -// Testing dependencies -var ( - unixLstat = unix.Lstat - ioutilReadDir = ioutil.ReadDir -) - -// Given the path to a device and its cgroup_permissions(which cannot be easily queried) look up the -// information about a linux device and return that information as a Device struct. -func DeviceFromPath(path, permissions string) (*Device, error) { - var stat unix.Stat_t - err := unixLstat(path, &stat) - if err != nil { - return nil, err - } - - var ( - devType Type - mode = stat.Mode - devNumber = uint64(stat.Rdev) - major = unix.Major(devNumber) - minor = unix.Minor(devNumber) - ) - switch mode & unix.S_IFMT { - case unix.S_IFBLK: - devType = BlockDevice - case unix.S_IFCHR: - devType = CharDevice - case unix.S_IFIFO: - devType = FifoDevice - default: - return nil, ErrNotADevice - } - return &Device{ - Rule: Rule{ - Type: devType, - Major: int64(major), - Minor: int64(minor), - Permissions: Permissions(permissions), - }, - Path: path, - FileMode: os.FileMode(mode), - Uid: stat.Uid, - Gid: stat.Gid, - }, nil -} - -// HostDevices returns all devices that can be found under /dev directory. -func HostDevices() ([]*Device, error) { - return GetDevices("/dev") -} - -// GetDevices recursively traverses a directory specified by path -// and returns all devices found there. -func GetDevices(path string) ([]*Device, error) { - files, err := ioutilReadDir(path) - if err != nil { - return nil, err - } - var out []*Device - for _, f := range files { - switch { - case f.IsDir(): - switch f.Name() { - // ".lxc" & ".lxd-mounts" added to address https://github.com/lxc/lxd/issues/2825 - // ".udev" added to address https://github.com/opencontainers/runc/issues/2093 - case "pts", "shm", "fd", "mqueue", ".lxc", ".lxd-mounts", ".udev": - continue - default: - sub, err := GetDevices(filepath.Join(path, f.Name())) - if err != nil { - return nil, err - } - - out = append(out, sub...) - continue - } - case f.Name() == "console": - continue - } - device, err := DeviceFromPath(filepath.Join(path, f.Name()), "rwm") - if err != nil { - if err == ErrNotADevice { - continue - } - if os.IsNotExist(err) { - continue - } - return nil, err - } - if device.Type == FifoDevice { - continue - } - out = append(out, device) - } - return out, nil -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/factory_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/factory_linux.go index 5cd374162b93..972b0f2b5d96 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/factory_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/factory_linux.go @@ -185,7 +185,7 @@ func CriuPath(criupath string) func(*LinuxFactory) error { // configures the factory with the provided option funcs. func New(root string, options ...func(*LinuxFactory) error) (Factory, error) { if root != "" { - if err := os.MkdirAll(root, 0700); err != nil { + if err := os.MkdirAll(root, 0o700); err != nil { return nil, newGenericError(err, SystemError) } } @@ -225,7 +225,7 @@ type LinuxFactory struct { // containers. CriuPath string - // New{u,g}uidmapPath is the path to the binaries used for mapping with + // New{u,g}idmapPath is the path to the binaries used for mapping with // rootless containers. NewuidmapPath string NewgidmapPath string @@ -259,7 +259,7 @@ func (l *LinuxFactory) Create(id string, config *configs.Config) (Container, err } else if !os.IsNotExist(err) { return nil, newGenericError(err, SystemError) } - if err := os.MkdirAll(containerRoot, 0711); err != nil { + if err := os.MkdirAll(containerRoot, 0o711); err != nil { return nil, newGenericError(err, SystemError) } if err := os.Chown(containerRoot, unix.Geteuid(), unix.Getegid()); err != nil { @@ -365,6 +365,12 @@ func (l *LinuxFactory) StartInitialization() (err error) { defer consoleSocket.Close() } + logPipeFdStr := os.Getenv("_LIBCONTAINER_LOGPIPE") + logPipeFd, err := strconv.Atoi(logPipeFdStr) + if err != nil { + return fmt.Errorf("unable to convert _LIBCONTAINER_LOGPIPE=%s to int: %s", logPipeFdStr, err) + } + // clear the current process's environment to clean any libcontainer // specific env vars. os.Clearenv() @@ -387,7 +393,7 @@ func (l *LinuxFactory) StartInitialization() (err error) { } }() - i, err := newContainerInit(it, pipe, consoleSocket, fifofd) + i, err := newContainerInit(it, pipe, consoleSocket, fifofd, logPipeFd) if err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/init_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/init_linux.go index c57af0eebb8b..798e7a84d35e 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/init_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/init_linux.go @@ -35,8 +35,8 @@ const ( ) type pid struct { - Pid int `json:"pid"` - PidFirstChild int `json:"pid_first"` + Pid int `json:"stage2_pid"` + PidFirstChild int `json:"stage1_pid"` } // network is an internal struct used to setup container networks. @@ -70,13 +70,14 @@ type initConfig struct { RootlessEUID bool `json:"rootless_euid,omitempty"` RootlessCgroups bool `json:"rootless_cgroups,omitempty"` SpecState *specs.State `json:"spec_state,omitempty"` + Cgroup2Path string `json:"cgroup2_path,omitempty"` } type initer interface { Init() error } -func newContainerInit(t initType, pipe *os.File, consoleSocket *os.File, fifoFd int) (initer, error) { +func newContainerInit(t initType, pipe *os.File, consoleSocket *os.File, fifoFd, logFd int) (initer, error) { var config *initConfig if err := json.NewDecoder(pipe).Decode(&config); err != nil { return nil, err @@ -90,6 +91,7 @@ func newContainerInit(t initType, pipe *os.File, consoleSocket *os.File, fifoFd pipe: pipe, consoleSocket: consoleSocket, config: config, + logFd: logFd, }, nil case initStandard: return &linuxStandardInit{ @@ -98,6 +100,7 @@ func newContainerInit(t initType, pipe *os.File, consoleSocket *os.File, fifoFd parentPid: unix.Getppid(), config: config, fifoFd: fifoFd, + logFd: logFd, }, nil } return nil, fmt.Errorf("unknown init type %q", t) @@ -129,6 +132,26 @@ func finalizeNamespace(config *initConfig) error { return errors.Wrap(err, "close exec fds") } + // we only do chdir if it's specified + doChdir := config.Cwd != "" + if doChdir { + // First, attempt the chdir before setting up the user. + // This could allow us to access a directory that the user running runc can access + // but the container user cannot. + err := unix.Chdir(config.Cwd) + switch { + case err == nil: + doChdir = false + case os.IsPermission(err): + // If we hit an EPERM, we should attempt again after setting up user. + // This will allow us to successfully chdir if the container user has access + // to the directory, but the user running runc does not. + // This is useful in cases where the cwd is also a volume that's been chowned to the container user. + default: + return fmt.Errorf("chdir to cwd (%q) set in config.json failed: %v", config.Cwd, err) + } + } + caps := &configs.Capabilities{} if config.Capabilities != nil { caps = config.Capabilities @@ -150,10 +173,8 @@ func finalizeNamespace(config *initConfig) error { if err := setupUser(config); err != nil { return errors.Wrap(err, "setup user") } - // Change working directory AFTER the user has been set up. - // Otherwise, if the cwd is also a volume that's been chowned to the container user (and not the user running runc), - // this command will EPERM. - if config.Cwd != "" { + // Change working directory AFTER the user has been set up, if we haven't done it yet. + if doChdir { if err := unix.Chdir(config.Cwd); err != nil { return fmt.Errorf("chdir to cwd (%q) set in config.json failed: %v", config.Cwd, err) } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/logs/logs.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/logs/logs.go index 1077e7b01450..27b96846632f 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/logs/logs.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/logs/logs.go @@ -6,14 +6,14 @@ import ( "fmt" "io" "os" - "strconv" "sync" + "github.com/pkg/errors" "github.com/sirupsen/logrus" ) var ( - configureMutex = sync.Mutex{} + configureMutex sync.Mutex // loggingConfigured will be set once logging has been configured via invoking `ConfigureLogging`. // Subsequent invocations of `ConfigureLogging` would be no-op loggingConfigured = false @@ -23,41 +23,47 @@ type Config struct { LogLevel logrus.Level LogFormat string LogFilePath string - LogPipeFd string + LogPipeFd int + LogCaller bool } -func ForwardLogs(logPipe io.Reader) { - lineReader := bufio.NewReader(logPipe) - for { - line, err := lineReader.ReadBytes('\n') - if len(line) > 0 { - processEntry(line) - } - if err == io.EOF { - logrus.Debugf("log pipe has been closed: %+v", err) - return +func ForwardLogs(logPipe io.ReadCloser) chan error { + done := make(chan error, 1) + s := bufio.NewScanner(logPipe) + + go func() { + for s.Scan() { + processEntry(s.Bytes()) } - if err != nil { - logrus.Errorf("log pipe read error: %+v", err) + if err := logPipe.Close(); err != nil { + logrus.Errorf("error closing log source: %v", err) } - } + // The only error we want to return is when reading from + // logPipe has failed. + done <- s.Err() + close(done) + }() + + return done } func processEntry(text []byte) { - type jsonLog struct { + if len(text) == 0 { + return + } + + var jl struct { Level string `json:"level"` Msg string `json:"msg"` } - - var jl jsonLog if err := json.Unmarshal(text, &jl); err != nil { - logrus.Errorf("failed to decode %q to json: %+v", text, err) + logrus.Errorf("failed to decode %q to json: %v", text, err) return } lvl, err := logrus.ParseLevel(jl.Level) if err != nil { - logrus.Errorf("failed to parse log level %q: %v\n", jl.Level, err) + logrus.Errorf("failed to parse log level %q: %v", jl.Level, err) return } logrus.StandardLogger().Logf(lvl, jl.Msg) @@ -68,18 +74,16 @@ func ConfigureLogging(config Config) error { defer configureMutex.Unlock() if loggingConfigured { - logrus.Debug("logging has already been configured") - return nil + return errors.New("logging has already been configured") } logrus.SetLevel(config.LogLevel) + logrus.SetReportCaller(config.LogCaller) - if config.LogPipeFd != "" { - logPipeFdInt, err := strconv.Atoi(config.LogPipeFd) - if err != nil { - return fmt.Errorf("failed to convert _LIBCONTAINER_LOGPIPE environment variable value %q to int: %v", config.LogPipeFd, err) - } - logrus.SetOutput(os.NewFile(uintptr(logPipeFdInt), "logpipe")) + // XXX: while 0 is a valid fd (usually stdin), here we assume + // that we never deliberately set LogPipeFd to 0. + if config.LogPipeFd > 0 { + logrus.SetOutput(os.NewFile(uintptr(config.LogPipeFd), "logpipe")) } else if config.LogFilePath != "" { f, err := os.OpenFile(config.LogFilePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND|os.O_SYNC, 0644) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/notify_linux_v2.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/notify_linux_v2.go index cdab10ed609e..dd0ec290ecf1 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/notify_linux_v2.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/notify_linux_v2.go @@ -3,48 +3,28 @@ package libcontainer import ( - "io/ioutil" "path/filepath" - "strconv" - "strings" "unsafe" + "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) -func getValueFromCgroup(path, key string) (int, error) { - content, err := ioutil.ReadFile(path) - if err != nil { - return 0, err - } - - lines := strings.Split(string(content), "\n") - for _, line := range lines { - arr := strings.Split(line, " ") - if len(arr) == 2 && arr[0] == key { - return strconv.Atoi(arr[1]) - } - } - return 0, nil -} - func registerMemoryEventV2(cgDir, evName, cgEvName string) (<-chan struct{}, error) { - eventControlPath := filepath.Join(cgDir, evName) - cgEvPath := filepath.Join(cgDir, cgEvName) fd, err := unix.InotifyInit() if err != nil { return nil, errors.Wrap(err, "unable to init inotify") } // watching oom kill - evFd, err := unix.InotifyAddWatch(fd, eventControlPath, unix.IN_MODIFY) + evFd, err := unix.InotifyAddWatch(fd, filepath.Join(cgDir, evName), unix.IN_MODIFY) if err != nil { unix.Close(fd) return nil, errors.Wrap(err, "unable to add inotify watch") } // Because no `unix.IN_DELETE|unix.IN_DELETE_SELF` event for cgroup file system, so watching all process exited - cgFd, err := unix.InotifyAddWatch(fd, cgEvPath, unix.IN_MODIFY) + cgFd, err := unix.InotifyAddWatch(fd, filepath.Join(cgDir, cgEvName), unix.IN_MODIFY) if err != nil { unix.Close(fd) return nil, errors.Wrap(err, "unable to add inotify watch") @@ -79,12 +59,12 @@ func registerMemoryEventV2(cgDir, evName, cgEvName string) (<-chan struct{}, err } switch int(rawEvent.Wd) { case evFd: - oom, err := getValueFromCgroup(eventControlPath, "oom_kill") + oom, err := fscommon.GetValueByKey(cgDir, evName, "oom_kill") if err != nil || oom > 0 { ch <- struct{}{} } case cgFd: - pids, err := getValueFromCgroup(cgEvPath, "populated") + pids, err := fscommon.GetValueByKey(cgDir, cgEvName, "populated") if err != nil || pids == 0 { return } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/process_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/process_linux.go index 834268b99571..053971b911bd 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/process_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/process_linux.go @@ -51,7 +51,7 @@ type parentProcess interface { setExternalDescriptors(fds []string) - forwardChildLogs() + forwardChildLogs() chan error } type filePair struct { @@ -65,6 +65,7 @@ type setnsProcess struct { logFilePair filePair cgroupPaths map[string]string rootlessCgroups bool + manager cgroups.Manager intelRdtPath string config *initConfig fds []string @@ -88,6 +89,8 @@ func (p *setnsProcess) signal(sig os.Signal) error { func (p *setnsProcess) start() (retErr error) { defer p.messageSockPair.parent.Close() + // get the "before" value of oom kill count + oom, _ := p.manager.OOMKillCount() err := p.cmd.Start() // close the write-side of the pipes (controlled by child) p.messageSockPair.child.Close() @@ -95,19 +98,34 @@ func (p *setnsProcess) start() (retErr error) { if err != nil { return newSystemErrorWithCause(err, "starting setns process") } + + waitInit := initWaiter(p.messageSockPair.parent) defer func() { if retErr != nil { + if newOom, err := p.manager.OOMKillCount(); err == nil && newOom != oom { + // Someone in this cgroup was killed, this _might_ be us. + retErr = newSystemErrorWithCause(retErr, "possibly OOM-killed") + } + werr := <-waitInit + if werr != nil { + logrus.WithError(werr).Warn() + } err := ignoreTerminateErrors(p.terminate()) if err != nil { logrus.WithError(err).Warn("unable to terminate setnsProcess") } } }() + if p.bootstrapData != nil { if _, err := io.Copy(p.messageSockPair.parent, p.bootstrapData); err != nil { return newSystemErrorWithCause(err, "copying bootstrap data to pipe") } } + err = <-waitInit + if err != nil { + return err + } if err := p.execSetns(); err != nil { return newSystemErrorWithCause(err, "executing setns process") } @@ -244,8 +262,8 @@ func (p *setnsProcess) setExternalDescriptors(newFds []string) { p.fds = newFds } -func (p *setnsProcess) forwardChildLogs() { - go logs.ForwardLogs(p.logFilePair.parent) +func (p *setnsProcess) forwardChildLogs() chan error { + return logs.ForwardLogs(p.logFilePair.parent) } type initProcess struct { @@ -319,9 +337,36 @@ func (p *initProcess) start() (retErr error) { p.process.ops = nil return newSystemErrorWithCause(err, "starting init process command") } + + waitInit := initWaiter(p.messageSockPair.parent) defer func() { if retErr != nil { - // terminate the process to ensure we can remove cgroups + // Find out if init is killed by the kernel's OOM killer. + // Get the count before killing init as otherwise cgroup + // might be removed by systemd. + oom, err := p.manager.OOMKillCount() + if err != nil { + logrus.WithError(err).Warn("unable to get oom kill count") + } else if oom > 0 { + // Does not matter what the particular error was, + // its cause is most probably OOM, so report that. + const oomError = "container init was OOM-killed (memory limit too low?)" + + if logrus.GetLevel() >= logrus.DebugLevel { + // Only show the original error if debug is set, + // as it is not generally very useful. + retErr = newSystemErrorWithCause(retErr, oomError) + } else { + retErr = newSystemError(errors.New(oomError)) + } + } + + werr := <-waitInit + if werr != nil { + logrus.WithError(werr).Warn() + } + + // Terminate the process to ensure we can remove cgroups. if err := ignoreTerminateErrors(p.terminate()); err != nil { logrus.WithError(err).Warn("unable to terminate initProcess") } @@ -347,6 +392,11 @@ func (p *initProcess) start() (retErr error) { if _, err := io.Copy(p.messageSockPair.parent, p.bootstrapData); err != nil { return newSystemErrorWithCause(err, "copying bootstrap data to pipe") } + err = <-waitInit + if err != nil { + return err + } + childPid, err := p.getChildPid() if err != nil { return newSystemErrorWithCause(err, "getting the final child's pid from pipe") @@ -398,7 +448,7 @@ func (p *initProcess) start() (retErr error) { // call prestart and CreateRuntime hooks if !p.config.Config.Namespaces.Contains(configs.NEWNS) { // Setup cgroup before the hook, so that the prestart and CreateRuntime hook could apply cgroup permissions. - if err := p.manager.Set(p.config.Config); err != nil { + if err := p.manager.Set(p.config.Config.Cgroups.Resources); err != nil { return newSystemErrorWithCause(err, "setting cgroup config for ready process") } if p.intelRdtManager != nil { @@ -454,7 +504,7 @@ func (p *initProcess) start() (retErr error) { sentRun = true case procHooks: // Setup cgroup before prestart hook, so that the prestart hook could apply cgroup permissions. - if err := p.manager.Set(p.config.Config); err != nil { + if err := p.manager.Set(p.config.Config.Cgroups.Resources); err != nil { return newSystemErrorWithCause(err, "setting cgroup config for procHooks process") } if p.intelRdtManager != nil { @@ -580,8 +630,8 @@ func (p *initProcess) setExternalDescriptors(newFds []string) { p.fds = newFds } -func (p *initProcess) forwardChildLogs() { - go logs.ForwardLogs(p.logFilePair.parent) +func (p *initProcess) forwardChildLogs() chan error { + return logs.ForwardLogs(p.logFilePair.parent) } func getPipeFds(pid int) ([]string, error) { @@ -649,3 +699,28 @@ func (p *Process) InitializeIO(rootuid, rootgid int) (i *IO, err error) { } return i, nil } + +// initWaiter returns a channel to wait on for making sure +// runc init has finished the initial setup. +func initWaiter(r io.Reader) chan error { + ch := make(chan error, 1) + go func() { + defer close(ch) + + inited := make([]byte, 1) + n, err := r.Read(inited) + if err == nil { + if n < 1 { + err = errors.New("short read") + } else if inited[0] != 0 { + err = fmt.Errorf("unexpected %d != 0", inited[0]) + } else { + ch <- nil + return + } + } + ch <- newSystemErrorWithCause(err, "waiting for init preliminary setup") + }() + + return ch +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/restored_process.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/restored_process.go index f861e82d1b28..97565d7fa4b2 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/restored_process.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/restored_process.go @@ -77,7 +77,8 @@ func (p *restoredProcess) setExternalDescriptors(newFds []string) { p.fds = newFds } -func (p *restoredProcess) forwardChildLogs() { +func (p *restoredProcess) forwardChildLogs() chan error { + return nil } // nonChildProcess represents a process where the calling process is not @@ -125,5 +126,6 @@ func (p *nonChildProcess) setExternalDescriptors(newFds []string) { p.fds = newFds } -func (p *nonChildProcess) forwardChildLogs() { +func (p *nonChildProcess) forwardChildLogs() chan error { + return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux.go index 411496ab7c6d..d9c5146dddd1 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/rootfs_linux.go @@ -17,18 +17,28 @@ import ( "github.com/moby/sys/mountinfo" "github.com/mrunalp/fileutils" "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/runc/libcontainer/cgroups/fs2" "github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/devices" - "github.com/opencontainers/runc/libcontainer/system" + "github.com/opencontainers/runc/libcontainer/userns" "github.com/opencontainers/runc/libcontainer/utils" libcontainerUtils "github.com/opencontainers/runc/libcontainer/utils" "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/selinux/go-selinux/label" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) const defaultMountFlags = unix.MS_NOEXEC | unix.MS_NOSUID | unix.MS_NODEV +type mountConfig struct { + root string + label string + cgroup2Path string + rootlessCgroups bool + cgroupns bool +} + // needsSetupDev returns true if /dev needs to be set up. func needsSetupDev(config *configs.Config) bool { for _, m := range config.Mounts { @@ -48,7 +58,13 @@ func prepareRootfs(pipe io.ReadWriter, iConfig *initConfig) (err error) { return newSystemErrorWithCause(err, "preparing rootfs") } - hasCgroupns := config.Namespaces.Contains(configs.NEWCGROUP) + mountConfig := &mountConfig{ + root: config.Rootfs, + label: config.MountLabel, + cgroup2Path: iConfig.Cgroup2Path, + rootlessCgroups: iConfig.RootlessCgroups, + cgroupns: config.Namespaces.Contains(configs.NEWCGROUP), + } setupDev := needsSetupDev(config) for _, m := range config.Mounts { for _, precmd := range m.PremountCmds { @@ -56,7 +72,7 @@ func prepareRootfs(pipe io.ReadWriter, iConfig *initConfig) (err error) { return newSystemErrorWithCause(err, "running premount command") } } - if err := mountToRootfs(m, config.Rootfs, config.MountLabel, hasCgroupns); err != nil { + if err := mountToRootfs(m, mountConfig); err != nil { return newSystemErrorWithCausef(err, "mounting %q to rootfs at %q", m.Source, m.Destination) } @@ -213,8 +229,6 @@ func prepareBindMount(m *configs.Mount, rootfs string) error { if err := checkProcMount(rootfs, dest, m.Source); err != nil { return err } - // update the mount with the correct dest after symlinks are resolved. - m.Destination = dest if err := createIfNotExists(dest, stat.IsDir()); err != nil { return err } @@ -222,7 +236,7 @@ func prepareBindMount(m *configs.Mount, rootfs string) error { return nil } -func mountCgroupV1(m *configs.Mount, rootfs, mountLabel string, enableCgroupns bool) error { +func mountCgroupV1(m *configs.Mount, c *mountConfig) error { binds, err := getCgroupMounts(m) if err != nil { return err @@ -242,31 +256,34 @@ func mountCgroupV1(m *configs.Mount, rootfs, mountLabel string, enableCgroupns b Data: "mode=755", PropagationFlags: m.PropagationFlags, } - if err := mountToRootfs(tmpfs, rootfs, mountLabel, enableCgroupns); err != nil { + if err := mountToRootfs(tmpfs, c); err != nil { return err } for _, b := range binds { - if enableCgroupns { - subsystemPath := filepath.Join(rootfs, b.Destination) + if c.cgroupns { + subsystemPath := filepath.Join(c.root, b.Destination) if err := os.MkdirAll(subsystemPath, 0755); err != nil { return err } - flags := defaultMountFlags - if m.Flags&unix.MS_RDONLY != 0 { - flags = flags | unix.MS_RDONLY - } - cgroupmount := &configs.Mount{ - Source: "cgroup", - Device: "cgroup", // this is actually fstype - Destination: subsystemPath, - Flags: flags, - Data: filepath.Base(subsystemPath), - } - if err := mountNewCgroup(cgroupmount); err != nil { + if err := utils.WithProcfd(c.root, b.Destination, func(procfd string) error { + flags := defaultMountFlags + if m.Flags&unix.MS_RDONLY != 0 { + flags = flags | unix.MS_RDONLY + } + var ( + source = "cgroup" + data = filepath.Base(subsystemPath) + ) + if data == "systemd" { + data = cgroups.CgroupNamePrefix + data + source = "systemd" + } + return unix.Mount(source, procfd, "cgroup", uintptr(flags), data) + }); err != nil { return err } } else { - if err := mountToRootfs(b, rootfs, mountLabel, enableCgroupns); err != nil { + if err := mountToRootfs(b, c); err != nil { return err } } @@ -276,7 +293,7 @@ func mountCgroupV1(m *configs.Mount, rootfs, mountLabel string, enableCgroupns b // symlink(2) is very dumb, it will just shove the path into // the link and doesn't do any checks or relative path // conversion. Also, don't error out if the cgroup already exists. - if err := os.Symlink(mc, filepath.Join(rootfs, m.Destination, ss)); err != nil && !os.IsExist(err) { + if err := os.Symlink(mc, filepath.Join(c.root, m.Destination, ss)); err != nil && !os.IsExist(err) { return err } } @@ -284,30 +301,87 @@ func mountCgroupV1(m *configs.Mount, rootfs, mountLabel string, enableCgroupns b return nil } -func mountCgroupV2(m *configs.Mount, rootfs, mountLabel string, enableCgroupns bool) error { - cgroupPath, err := securejoin.SecureJoin(rootfs, m.Destination) +func mountCgroupV2(m *configs.Mount, c *mountConfig) error { + dest, err := securejoin.SecureJoin(c.root, m.Destination) if err != nil { return err } - if err := os.MkdirAll(cgroupPath, 0755); err != nil { + if err := os.MkdirAll(dest, 0755); err != nil { return err } - if err := unix.Mount(m.Source, cgroupPath, "cgroup2", uintptr(m.Flags), m.Data); err != nil { - // when we are in UserNS but CgroupNS is not unshared, we cannot mount cgroup2 (#2158) - if err == unix.EPERM || err == unix.EBUSY { - return unix.Mount("/sys/fs/cgroup", cgroupPath, "", uintptr(m.Flags)|unix.MS_BIND, "") + return utils.WithProcfd(c.root, m.Destination, func(procfd string) error { + if err := unix.Mount(m.Source, procfd, "cgroup2", uintptr(m.Flags), m.Data); err != nil { + // when we are in UserNS but CgroupNS is not unshared, we cannot mount cgroup2 (#2158) + if err == unix.EPERM || err == unix.EBUSY { + src := fs2.UnifiedMountpoint + if c.cgroupns && c.cgroup2Path != "" { + // Emulate cgroupns by bind-mounting + // the container cgroup path rather than + // the whole /sys/fs/cgroup. + src = c.cgroup2Path + } + err = unix.Mount(src, procfd, "", uintptr(m.Flags)|unix.MS_BIND, "") + if err == unix.ENOENT && c.rootlessCgroups { + err = nil + } + } + return err } + return nil + }) +} + +func doTmpfsCopyUp(m *configs.Mount, rootfs, mountLabel string) (Err error) { + // Set up a scratch dir for the tmpfs on the host. + tmpdir, err := prepareTmp("/tmp") + if err != nil { + return newSystemErrorWithCause(err, "tmpcopyup: failed to setup tmpdir") + } + defer cleanupTmp(tmpdir) + tmpDir, err := ioutil.TempDir(tmpdir, "runctmpdir") + if err != nil { + return newSystemErrorWithCause(err, "tmpcopyup: failed to create tmpdir") + } + defer os.RemoveAll(tmpDir) + + // Configure the *host* tmpdir as if it's the container mount. We change + // m.Destination since we are going to mount *on the host*. + oldDest := m.Destination + m.Destination = tmpDir + err = mountPropagate(m, "/", mountLabel) + m.Destination = oldDest + if err != nil { return err } - return nil + defer func() { + if Err != nil { + if err := unix.Unmount(tmpDir, unix.MNT_DETACH); err != nil { + logrus.Warnf("tmpcopyup: failed to unmount tmpdir on error: %v", err) + } + } + }() + + return utils.WithProcfd(rootfs, m.Destination, func(procfd string) (Err error) { + // Copy the container data to the host tmpdir. We append "/" to force + // CopyDirectory to resolve the symlink rather than trying to copy the + // symlink itself. + if err := fileutils.CopyDirectory(procfd+"/", tmpDir); err != nil { + return fmt.Errorf("tmpcopyup: failed to copy %s to %s (%s): %w", m.Destination, procfd, tmpDir, err) + } + // Now move the mount into the container. + if err := unix.Mount(tmpDir, procfd, "", unix.MS_MOVE, ""); err != nil { + return fmt.Errorf("tmpcopyup: failed to move mount %s to %s (%s): %w", tmpDir, procfd, m.Destination, err) + } + return nil + }) } -func mountToRootfs(m *configs.Mount, rootfs, mountLabel string, enableCgroupns bool) error { - var ( - dest = m.Destination - ) - if !strings.HasPrefix(dest, rootfs) { - dest = filepath.Join(rootfs, dest) +func mountToRootfs(m *configs.Mount, c *mountConfig) error { + rootfs := c.root + mountLabel := c.label + dest, err := securejoin.SecureJoin(rootfs, m.Destination) + if err != nil { + return err } switch m.Device { @@ -338,53 +412,21 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string, enableCgroupns b } return label.SetFileLabel(dest, mountLabel) case "tmpfs": - copyUp := m.Extensions&configs.EXT_COPYUP == configs.EXT_COPYUP - tmpDir := "" - // dest might be an absolute symlink, so it needs - // to be resolved under rootfs. - dest, err := securejoin.SecureJoin(rootfs, m.Destination) - if err != nil { - return err - } - m.Destination = dest stat, err := os.Stat(dest) if err != nil { if err := os.MkdirAll(dest, 0755); err != nil { return err } } - if copyUp { - tmpdir, err := prepareTmp("/tmp") - if err != nil { - return newSystemErrorWithCause(err, "tmpcopyup: failed to setup tmpdir") - } - defer cleanupTmp(tmpdir) - tmpDir, err = ioutil.TempDir(tmpdir, "runctmpdir") - if err != nil { - return newSystemErrorWithCause(err, "tmpcopyup: failed to create tmpdir") - } - defer os.RemoveAll(tmpDir) - m.Destination = tmpDir + + if m.Extensions&configs.EXT_COPYUP == configs.EXT_COPYUP { + err = doTmpfsCopyUp(m, rootfs, mountLabel) + } else { + err = mountPropagate(m, rootfs, mountLabel) } - if err := mountPropagate(m, rootfs, mountLabel); err != nil { + if err != nil { return err } - if copyUp { - if err := fileutils.CopyDirectory(dest, tmpDir); err != nil { - errMsg := fmt.Errorf("tmpcopyup: failed to copy %s to %s: %v", dest, tmpDir, err) - if err1 := unix.Unmount(tmpDir, unix.MNT_DETACH); err1 != nil { - return newSystemErrorWithCausef(err1, "tmpcopyup: %v: failed to unmount", errMsg) - } - return errMsg - } - if err := unix.Mount(tmpDir, dest, "", unix.MS_MOVE, ""); err != nil { - errMsg := fmt.Errorf("tmpcopyup: failed to move mount %s to %s: %v", tmpDir, dest, err) - if err1 := unix.Unmount(tmpDir, unix.MNT_DETACH); err1 != nil { - return newSystemErrorWithCausef(err1, "tmpcopyup: %v: failed to unmount", errMsg) - } - return errMsg - } - } if stat != nil { if err = os.Chmod(dest, stat.Mode()); err != nil { return err @@ -424,23 +466,13 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string, enableCgroupns b } case "cgroup": if cgroups.IsCgroup2UnifiedMode() { - return mountCgroupV2(m, rootfs, mountLabel, enableCgroupns) + return mountCgroupV2(m, c) } - return mountCgroupV1(m, rootfs, mountLabel, enableCgroupns) + return mountCgroupV1(m, c) default: - // ensure that the destination of the mount is resolved of symlinks at mount time because - // any previous mounts can invalidate the next mount's destination. - // this can happen when a user specifies mounts within other mounts to cause breakouts or other - // evil stuff to try to escape the container's rootfs. - var err error - if dest, err = securejoin.SecureJoin(rootfs, m.Destination); err != nil { - return err - } if err := checkProcMount(rootfs, dest, m.Source); err != nil { return err } - // update the mount with the correct dest after symlinks are resolved. - m.Destination = dest if err := os.MkdirAll(dest, 0755); err != nil { return err } @@ -603,7 +635,7 @@ func reOpenDevNull() error { // Create the device nodes in the container. func createDevices(config *configs.Config) error { - useBindMount := system.RunningInUserNS() || config.Namespaces.Contains(configs.NEWUSER) + useBindMount := userns.RunningInUserNS() || config.Namespaces.Contains(configs.NEWUSER) oldMask := unix.Umask(0000) for _, node := range config.Devices { @@ -623,7 +655,7 @@ func createDevices(config *configs.Config) error { return nil } -func bindMountDeviceNode(dest string, node *devices.Device) error { +func bindMountDeviceNode(rootfs, dest string, node *devices.Device) error { f, err := os.Create(dest) if err != nil && !os.IsExist(err) { return err @@ -631,7 +663,9 @@ func bindMountDeviceNode(dest string, node *devices.Device) error { if f != nil { f.Close() } - return unix.Mount(node.Path, dest, "bind", unix.MS_BIND, "") + return utils.WithProcfd(rootfs, dest, func(procfd string) error { + return unix.Mount(node.Path, procfd, "bind", unix.MS_BIND, "") + }) } // Creates the device node in the rootfs of the container. @@ -640,18 +674,21 @@ func createDeviceNode(rootfs string, node *devices.Device, bind bool) error { // The node only exists for cgroup reasons, ignore it here. return nil } - dest := filepath.Join(rootfs, node.Path) + dest, err := securejoin.SecureJoin(rootfs, node.Path) + if err != nil { + return err + } if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil { return err } if bind { - return bindMountDeviceNode(dest, node) + return bindMountDeviceNode(rootfs, dest, node) } if err := mknodDevice(dest, node); err != nil { if os.IsExist(err) { return nil } else if os.IsPermission(err) { - return bindMountDeviceNode(dest, node) + return bindMountDeviceNode(rootfs, dest, node) } return err } @@ -931,9 +968,20 @@ func readonlyPath(path string) error { if os.IsNotExist(err) { return nil } - return err + return &os.PathError{Op: "bind-mount", Path: path, Err: err} } - return unix.Mount(path, path, "", unix.MS_BIND|unix.MS_REMOUNT|unix.MS_RDONLY|unix.MS_REC, "") + + var s unix.Statfs_t + if err := unix.Statfs(path, &s); err != nil { + return &os.PathError{Op: "statfs", Path: path, Err: err} + } + flags := uintptr(s.Flags) & (unix.MS_NOSUID | unix.MS_NODEV | unix.MS_NOEXEC) + + if err := unix.Mount(path, path, "", flags|unix.MS_BIND|unix.MS_REMOUNT|unix.MS_RDONLY, ""); err != nil { + return &os.PathError{Op: "bind-mount-ro", Path: path, Err: err} + } + + return nil } // remountReadonly will remount an existing mount point and ensure that it is read-only. @@ -987,61 +1035,47 @@ func writeSystemProperty(key, value string) error { } func remount(m *configs.Mount, rootfs string) error { - var ( - dest = m.Destination - ) - if !strings.HasPrefix(dest, rootfs) { - dest = filepath.Join(rootfs, dest) - } - return unix.Mount(m.Source, dest, m.Device, uintptr(m.Flags|unix.MS_REMOUNT), "") + return utils.WithProcfd(rootfs, m.Destination, func(procfd string) error { + return unix.Mount(m.Source, procfd, m.Device, uintptr(m.Flags|unix.MS_REMOUNT), "") + }) } // Do the mount operation followed by additional mounts required to take care -// of propagation flags. +// of propagation flags. This will always be scoped inside the container rootfs. func mountPropagate(m *configs.Mount, rootfs string, mountLabel string) error { var ( - dest = m.Destination data = label.FormatMountLabel(m.Data, mountLabel) flags = m.Flags ) - if libcontainerUtils.CleanPath(dest) == "/dev" { - flags &= ^unix.MS_RDONLY - } - - // Mount it rw to allow chmod operation. A remount will be performed - // later to make it ro if set. - if m.Device == "tmpfs" { + // Delay mounting the filesystem read-only if we need to do further + // operations on it. We need to set up files in "/dev" and tmpfs mounts may + // need to be chmod-ed after mounting. The mount will be remounted ro later + // in finalizeRootfs() if necessary. + if libcontainerUtils.CleanPath(m.Destination) == "/dev" || m.Device == "tmpfs" { flags &= ^unix.MS_RDONLY } - copyUp := m.Extensions&configs.EXT_COPYUP == configs.EXT_COPYUP - if !(copyUp || strings.HasPrefix(dest, rootfs)) { - dest = filepath.Join(rootfs, dest) - } - - if err := unix.Mount(m.Source, dest, m.Device, uintptr(flags), data); err != nil { - return err - } - - for _, pflag := range m.PropagationFlags { - if err := unix.Mount("", dest, "", uintptr(pflag), ""); err != nil { - return err + // Because the destination is inside a container path which might be + // mutating underneath us, we verify that we are actually going to mount + // inside the container with WithProcfd() -- mounting through a procfd + // mounts on the target. + if err := utils.WithProcfd(rootfs, m.Destination, func(procfd string) error { + return unix.Mount(m.Source, procfd, m.Device, uintptr(flags), data) + }); err != nil { + return fmt.Errorf("mount through procfd: %w", err) + } + // We have to apply mount propagation flags in a separate WithProcfd() call + // because the previous call invalidates the passed procfd -- the mount + // target needs to be re-opened. + if err := utils.WithProcfd(rootfs, m.Destination, func(procfd string) error { + for _, pflag := range m.PropagationFlags { + if err := unix.Mount("", procfd, "", uintptr(pflag), ""); err != nil { + return err + } } - } - return nil -} - -func mountNewCgroup(m *configs.Mount) error { - var ( - data = m.Data - source = m.Source - ) - if data == "systemd" { - data = cgroups.CgroupNamePrefix + data - source = "systemd" - } - if err := unix.Mount(source, m.Destination, m.Device, uintptr(m.Flags), data); err != nil { - return err + return nil + }); err != nil { + return fmt.Errorf("change mount propagation through procfd: %w", err) } return nil } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go index cdbd59da0952..a8432bfd46a7 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/patchbpf/enosys_linux.go @@ -3,6 +3,7 @@ package patchbpf import ( + "bytes" "encoding/binary" "io" "os" @@ -114,14 +115,26 @@ func disassembleFilter(filter *libseccomp.ScmpFilter) ([]bpf.Instruction, error) defer wtr.Close() defer rdr.Close() + readerBuffer := new(bytes.Buffer) + errChan := make(chan error, 1) + go func() { + _, err := io.Copy(readerBuffer, rdr) + errChan <- err + close(errChan) + }() + if err := filter.ExportBPF(wtr); err != nil { return nil, errors.Wrap(err, "exporting BPF") } // Close so that the reader actually gets EOF. _ = wtr.Close() + if copyErr := <-errChan; copyErr != nil { + return nil, errors.Wrap(copyErr, "reading from ExportBPF pipe") + } + // Parse the instructions. - rawProgram, err := parseProgram(rdr) + rawProgram, err := parseProgram(readerBuffer) if err != nil { return nil, errors.Wrap(err, "parsing generated BPF filter") } @@ -510,6 +523,11 @@ func assemble(program []bpf.Instruction) ([]unix.SockFilter, error) { } func generatePatch(config *configs.Seccomp) ([]bpf.Instruction, error) { + // Patch the generated cBPF only when there is not a defaultErrnoRet set + // and it is different from ENOSYS + if config.DefaultErrnoRet != nil && *config.DefaultErrnoRet == uint(retErrnoEnosys) { + return nil, nil + } // We only add the stub if the default action is not permissive. if isAllowAction(config.DefaultAction) { logrus.Debugf("seccomp: skipping -ENOSYS stub filter generation") @@ -584,9 +602,12 @@ func sysSeccompSetFilter(flags uint, filter []unix.SockFilter) (err error) { unix.SECCOMP_MODE_FILTER, uintptr(unsafe.Pointer(&fprog)), 0, 0) } else { - _, _, err = unix.RawSyscall(unix.SYS_SECCOMP, + _, _, errno := unix.RawSyscall(unix.SYS_SECCOMP, uintptr(C.C_SET_MODE_FILTER), uintptr(flags), uintptr(unsafe.Pointer(&fprog))) + if errno != 0 { + err = errno + } } runtime.KeepAlive(filter) runtime.KeepAlive(fprog) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_linux.go index 5e7b365c563a..b14d0ede3bb6 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_linux.go @@ -3,11 +3,8 @@ package seccomp import ( - "bufio" "errors" "fmt" - "os" - "strings" "github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/seccomp/patchbpf" @@ -39,7 +36,7 @@ func InitSeccomp(config *configs.Seccomp) error { return errors.New("cannot initialize Seccomp - nil config passed") } - defaultAction, err := getAction(config.DefaultAction, nil) + defaultAction, err := getAction(config.DefaultAction, config.DefaultErrnoRet) if err != nil { return errors.New("error initializing seccomp - invalid default action") } @@ -80,24 +77,6 @@ func InitSeccomp(config *configs.Seccomp) error { return nil } -// IsEnabled returns if the kernel has been configured to support seccomp. -func IsEnabled() bool { - // Try to read from /proc/self/status for kernels > 3.8 - s, err := parseStatusFile("/proc/self/status") - if err != nil { - // Check if Seccomp is supported, via CONFIG_SECCOMP. - if err := unix.Prctl(unix.PR_GET_SECCOMP, 0, 0, 0, 0); err != unix.EINVAL { - // Make sure the kernel has CONFIG_SECCOMP_FILTER. - if err := unix.Prctl(unix.PR_SET_SECCOMP, unix.SECCOMP_MODE_FILTER, 0, 0, 0); err != unix.EINVAL { - return true - } - } - return false - } - _, ok := s["Seccomp"] - return ok -} - // Convert Libcontainer Action to Libseccomp ScmpAction func getAction(act configs.Action, errnoRet *uint) (libseccomp.ScmpAction, error) { switch act { @@ -237,33 +216,6 @@ func matchCall(filter *libseccomp.ScmpFilter, call *configs.Syscall) error { return nil } -func parseStatusFile(path string) (map[string]string, error) { - f, err := os.Open(path) - if err != nil { - return nil, err - } - defer f.Close() - - s := bufio.NewScanner(f) - status := make(map[string]string) - - for s.Scan() { - text := s.Text() - parts := strings.Split(text, ":") - - if len(parts) <= 1 { - continue - } - - status[parts[0]] = parts[1] - } - if err := s.Err(); err != nil { - return nil, err - } - - return status, nil -} - // Version returns major, minor, and micro. func Version() (uint, uint, uint) { return libseccomp.GetLibraryVersion() diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_unsupported.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_unsupported.go index 244886a42e54..8b7973e9a13b 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_unsupported.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/seccomp/seccomp_unsupported.go @@ -18,11 +18,6 @@ func InitSeccomp(config *configs.Seccomp) error { return nil } -// IsEnabled returns false, because it is not supported. -func IsEnabled() bool { - return false -} - // Version returns major, minor, and micro. func Version() (uint, uint, uint) { return 0, 0, 0 diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/setns_init_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/setns_init_linux.go index 6b1e9a6e97c8..97987f1d038c 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/setns_init_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/setns_init_linux.go @@ -12,6 +12,7 @@ import ( "github.com/opencontainers/runc/libcontainer/system" "github.com/opencontainers/selinux/go-selinux" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -21,6 +22,7 @@ type linuxSetnsInit struct { pipe *os.File consoleSocket *os.File config *initConfig + logFd int } func (l *linuxSetnsInit) getSessionRingName() string { @@ -86,5 +88,11 @@ func (l *linuxSetnsInit) Init() error { return newSystemErrorWithCause(err, "init seccomp") } } + logrus.Debugf("setns_init: about to exec") + // Close the log pipe fd so the parent's ForwardLogs can exit. + if err := unix.Close(l.logFd); err != nil { + return newSystemErrorWithCause(err, "closing log pipe fd") + } + return system.Execv(l.config.Args[0], l.config.Args[0:], os.Environ()) } diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/standard_init_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/standard_init_linux.go index 7ec506c462ed..d77022ad4d63 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/standard_init_linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/standard_init_linux.go @@ -16,6 +16,7 @@ import ( "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/selinux/go-selinux" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -24,6 +25,7 @@ type linuxStandardInit struct { consoleSocket *os.File parentPid int fifoFd int + logFd int config *initConfig } @@ -180,7 +182,14 @@ func (l *linuxStandardInit) Init() error { return err } // Close the pipe to signal that we have completed our init. + logrus.Debugf("init: closing the pipe to signal completion") l.pipe.Close() + + // Close the log pipe fd so the parent's ForwardLogs can exit. + if err := unix.Close(l.logFd); err != nil { + return newSystemErrorWithCause(err, "closing log pipe fd") + } + // Wait for the FIFO to be opened on the other side before exec-ing the // user process. We open it through /proc/self/fd/$fd, because the fd that // was given to us was an O_PATH fd to the fifo itself. Linux allows us to diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/linux.go index 49471960be5e..4379a2070884 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/linux.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/linux.go @@ -3,12 +3,9 @@ package system import ( - "os" "os/exec" - "sync" "unsafe" - "github.com/opencontainers/runc/libcontainer/user" "golang.org/x/sys/unix" ) @@ -87,52 +84,6 @@ func Setctty() error { return nil } -var ( - inUserNS bool - nsOnce sync.Once -) - -// RunningInUserNS detects whether we are currently running in a user namespace. -// Originally copied from github.com/lxc/lxd/shared/util.go -func RunningInUserNS() bool { - nsOnce.Do(func() { - uidmap, err := user.CurrentProcessUIDMap() - if err != nil { - // This kernel-provided file only exists if user namespaces are supported - return - } - inUserNS = UIDMapInUserNS(uidmap) - }) - return inUserNS -} - -func UIDMapInUserNS(uidmap []user.IDMap) bool { - /* - * We assume we are in the initial user namespace if we have a full - * range - 4294967295 uids starting at uid 0. - */ - if len(uidmap) == 1 && uidmap[0].ID == 0 && uidmap[0].ParentID == 0 && uidmap[0].Count == 4294967295 { - return false - } - return true -} - -// GetParentNSeuid returns the euid within the parent user namespace -func GetParentNSeuid() int64 { - euid := int64(os.Geteuid()) - uidmap, err := user.CurrentProcessUIDMap() - if err != nil { - // This kernel-provided file only exists if user namespaces are supported - return euid - } - for _, um := range uidmap { - if um.ID <= euid && euid <= um.ID+um.Count-1 { - return um.ParentID + euid - um.ID - } - } - return euid -} - // SetSubreaper sets the value i as the subreaper setting for the calling process func SetSubreaper(i int) error { return unix.Prctl(unix.PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go deleted file mode 100644 index b94be74a6648..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go +++ /dev/null @@ -1,27 +0,0 @@ -// +build !linux - -package system - -import ( - "os" - - "github.com/opencontainers/runc/libcontainer/user" -) - -// RunningInUserNS is a stub for non-Linux systems -// Always returns false -func RunningInUserNS() bool { - return false -} - -// UIDMapInUserNS is a stub for non-Linux systems -// Always returns false -func UIDMapInUserNS(uidmap []user.IDMap) bool { - return false -} - -// GetParentNSeuid returns the euid within the parent user namespace -// Always returns os.Geteuid on non-linux -func GetParentNSeuid() int { - return os.Geteuid() -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/userns_deprecated.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/userns_deprecated.go new file mode 100644 index 000000000000..2de3462a5068 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/system/userns_deprecated.go @@ -0,0 +1,5 @@ +package system + +import "github.com/opencontainers/runc/libcontainer/userns" + +var RunningInUserNS = userns.RunningInUserNS diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS deleted file mode 100644 index edbe20066946..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS +++ /dev/null @@ -1,2 +0,0 @@ -Tianon Gravi (@tianon) -Aleksa Sarai (@cyphar) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup.go deleted file mode 100644 index 6fd8dd0d44aa..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup.go +++ /dev/null @@ -1,41 +0,0 @@ -package user - -import ( - "errors" -) - -var ( - // The current operating system does not provide the required data for user lookups. - ErrUnsupported = errors.New("user lookup: operating system does not provide passwd-formatted data") - // No matching entries found in file. - ErrNoPasswdEntries = errors.New("no matching entries in passwd file") - ErrNoGroupEntries = errors.New("no matching entries in group file") -) - -// LookupUser looks up a user by their username in /etc/passwd. If the user -// cannot be found (or there is no /etc/passwd file on the filesystem), then -// LookupUser returns an error. -func LookupUser(username string) (User, error) { - return lookupUser(username) -} - -// LookupUid looks up a user by their user id in /etc/passwd. If the user cannot -// be found (or there is no /etc/passwd file on the filesystem), then LookupId -// returns an error. -func LookupUid(uid int) (User, error) { - return lookupUid(uid) -} - -// LookupGroup looks up a group by its name in /etc/group. If the group cannot -// be found (or there is no /etc/group file on the filesystem), then LookupGroup -// returns an error. -func LookupGroup(groupname string) (Group, error) { - return lookupGroup(groupname) -} - -// LookupGid looks up a group by its group id in /etc/group. If the group cannot -// be found (or there is no /etc/group file on the filesystem), then LookupGid -// returns an error. -func LookupGid(gid int) (Group, error) { - return lookupGid(gid) -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go index 92b5ae8de017..967717a1b1c5 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go @@ -16,13 +16,19 @@ const ( unixGroupPath = "/etc/group" ) -func lookupUser(username string) (User, error) { +// LookupUser looks up a user by their username in /etc/passwd. If the user +// cannot be found (or there is no /etc/passwd file on the filesystem), then +// LookupUser returns an error. +func LookupUser(username string) (User, error) { return lookupUserFunc(func(u User) bool { return u.Name == username }) } -func lookupUid(uid int) (User, error) { +// LookupUid looks up a user by their user id in /etc/passwd. If the user cannot +// be found (or there is no /etc/passwd file on the filesystem), then LookupId +// returns an error. +func LookupUid(uid int) (User, error) { return lookupUserFunc(func(u User) bool { return u.Uid == uid }) @@ -51,13 +57,19 @@ func lookupUserFunc(filter func(u User) bool) (User, error) { return users[0], nil } -func lookupGroup(groupname string) (Group, error) { +// LookupGroup looks up a group by its name in /etc/group. If the group cannot +// be found (or there is no /etc/group file on the filesystem), then LookupGroup +// returns an error. +func LookupGroup(groupname string) (Group, error) { return lookupGroupFunc(func(g Group) bool { return g.Name == groupname }) } -func lookupGid(gid int) (Group, error) { +// LookupGid looks up a group by its group id in /etc/group. If the group cannot +// be found (or there is no /etc/group file on the filesystem), then LookupGid +// returns an error. +func LookupGid(gid int) (Group, error) { return lookupGroupFunc(func(g Group) bool { return g.Gid == gid }) diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go deleted file mode 100644 index f19333e61eb1..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go +++ /dev/null @@ -1,40 +0,0 @@ -// +build windows - -package user - -import ( - "os/user" - "strconv" -) - -func lookupUser(username string) (User, error) { - u, err := user.Lookup(username) - if err != nil { - return User{}, err - } - return userFromOS(u) -} - -func lookupUid(uid int) (User, error) { - u, err := user.LookupId(strconv.Itoa(uid)) - if err != nil { - return User{}, err - } - return userFromOS(u) -} - -func lookupGroup(groupname string) (Group, error) { - g, err := user.LookupGroup(groupname) - if err != nil { - return Group{}, err - } - return groupFromOS(g) -} - -func lookupGid(gid int) (Group, error) { - g, err := user.LookupGroupId(strconv.Itoa(gid)) - if err != nil { - return Group{}, err - } - return groupFromOS(g) -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user.go index a533bf5e6686..68da4400d463 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user.go @@ -2,10 +2,10 @@ package user import ( "bufio" + "errors" "fmt" "io" "os" - "os/user" "strconv" "strings" ) @@ -16,6 +16,13 @@ const ( ) var ( + // The current operating system does not provide the required data for user lookups. + ErrUnsupported = errors.New("user lookup: operating system does not provide passwd-formatted data") + + // No matching entries found in file. + ErrNoPasswdEntries = errors.New("no matching entries in passwd file") + ErrNoGroupEntries = errors.New("no matching entries in group file") + ErrRange = fmt.Errorf("uids and gids must be in range %d-%d", minId, maxId) ) @@ -29,28 +36,6 @@ type User struct { Shell string } -// userFromOS converts an os/user.(*User) to local User -// -// (This does not include Pass, Shell or Gecos) -func userFromOS(u *user.User) (User, error) { - newUser := User{ - Name: u.Username, - Home: u.HomeDir, - } - id, err := strconv.Atoi(u.Uid) - if err != nil { - return newUser, err - } - newUser.Uid = id - - id, err = strconv.Atoi(u.Gid) - if err != nil { - return newUser, err - } - newUser.Gid = id - return newUser, nil -} - type Group struct { Name string Pass string @@ -58,23 +43,6 @@ type Group struct { List []string } -// groupFromOS converts an os/user.(*Group) to local Group -// -// (This does not include Pass or List) -func groupFromOS(g *user.Group) (Group, error) { - newGroup := Group{ - Name: g.Name, - } - - id, err := strconv.Atoi(g.Gid) - if err != nil { - return newGroup, err - } - newGroup.Gid = id - - return newGroup, nil -} - // SubID represents an entry in /etc/sub{u,g}id type SubID struct { Name string diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user_fuzzer.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user_fuzzer.go new file mode 100644 index 000000000000..8c9bb5df39c2 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/user/user_fuzzer.go @@ -0,0 +1,42 @@ +// +build gofuzz + +package user + +import ( + "io" + "strings" +) + +func IsDivisbleBy(n int, divisibleby int) bool { + return (n % divisibleby) == 0 +} + +func FuzzUser(data []byte) int { + if len(data) == 0 { + return -1 + } + if !IsDivisbleBy(len(data), 5) { + return -1 + } + + var divided [][]byte + + chunkSize := len(data) / 5 + + for i := 0; i < len(data); i += chunkSize { + end := i + chunkSize + + divided = append(divided, data[i:end]) + } + + _, _ = ParsePasswdFilter(strings.NewReader(string(divided[0])), nil) + + var passwd, group io.Reader + + group = strings.NewReader(string(divided[1])) + _, _ = GetAdditionalGroups([]string{string(divided[2])}, group) + + passwd = strings.NewReader(string(divided[3])) + _, _ = GetExecUser(string(divided[4]), nil, passwd, group) + return 1 +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns.go new file mode 100644 index 000000000000..f6cb98e5e492 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns.go @@ -0,0 +1,5 @@ +package userns + +// RunningInUserNS detects whether we are currently running in a user namespace. +// Originally copied from github.com/lxc/lxd/shared/util.go +var RunningInUserNS = runningInUserNS diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_fuzzer.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_fuzzer.go new file mode 100644 index 000000000000..529f8eaea2f5 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_fuzzer.go @@ -0,0 +1,15 @@ +// +build gofuzz + +package userns + +import ( + "strings" + + "github.com/opencontainers/runc/libcontainer/user" +) + +func FuzzUIDMap(data []byte) int { + uidmap, _ := user.ParseIDMap(strings.NewReader(string(data))) + _ = uidMapInUserNS(uidmap) + return 1 +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_linux.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_linux.go new file mode 100644 index 000000000000..724e6df0120e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_linux.go @@ -0,0 +1,37 @@ +package userns + +import ( + "sync" + + "github.com/opencontainers/runc/libcontainer/user" +) + +var ( + inUserNS bool + nsOnce sync.Once +) + +// runningInUserNS detects whether we are currently running in a user namespace. +// Originally copied from github.com/lxc/lxd/shared/util.go +func runningInUserNS() bool { + nsOnce.Do(func() { + uidmap, err := user.CurrentProcessUIDMap() + if err != nil { + // This kernel-provided file only exists if user namespaces are supported + return + } + inUserNS = uidMapInUserNS(uidmap) + }) + return inUserNS +} + +func uidMapInUserNS(uidmap []user.IDMap) bool { + /* + * We assume we are in the initial user namespace if we have a full + * range - 4294967295 uids starting at uid 0. + */ + if len(uidmap) == 1 && uidmap[0].ID == 0 && uidmap[0].ParentID == 0 && uidmap[0].Count == 4294967295 { + return false + } + return true +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_unsupported.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_unsupported.go new file mode 100644 index 000000000000..f45bb0c31560 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/userns/userns_unsupported.go @@ -0,0 +1,17 @@ +// +build !linux + +package userns + +import "github.com/opencontainers/runc/libcontainer/user" + +// runningInUserNS is a stub for non-Linux systems +// Always returns false +func runningInUserNS() bool { + return false +} + +// uidMapInUserNS is a stub for non-Linux systems +// Always returns false +func uidMapInUserNS(uidmap []user.IDMap) bool { + return false +} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go index 1b72b7a1c1ba..cd78f23e1bd0 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go @@ -3,12 +3,15 @@ package utils import ( "encoding/binary" "encoding/json" + "fmt" "io" "os" "path/filepath" + "strconv" "strings" "unsafe" + "github.com/cyphar/filepath-securejoin" "golang.org/x/sys/unix" ) @@ -88,6 +91,57 @@ func CleanPath(path string) string { return filepath.Clean(path) } +// stripRoot returns the passed path, stripping the root path if it was +// (lexicially) inside it. Note that both passed paths will always be treated +// as absolute, and the returned path will also always be absolute. In +// addition, the paths are cleaned before stripping the root. +func stripRoot(root, path string) string { + // Make the paths clean and absolute. + root, path = CleanPath("/"+root), CleanPath("/"+path) + switch { + case path == root: + path = "/" + case root == "/": + // do nothing + case strings.HasPrefix(path, root+"/"): + path = strings.TrimPrefix(path, root+"/") + } + return CleanPath("/" + path) +} + +// WithProcfd runs the passed closure with a procfd path (/proc/self/fd/...) +// corresponding to the unsafePath resolved within the root. Before passing the +// fd, this path is verified to have been inside the root -- so operating on it +// through the passed fdpath should be safe. Do not access this path through +// the original path strings, and do not attempt to use the pathname outside of +// the passed closure (the file handle will be freed once the closure returns). +func WithProcfd(root, unsafePath string, fn func(procfd string) error) error { + // Remove the root then forcefully resolve inside the root. + unsafePath = stripRoot(root, unsafePath) + path, err := securejoin.SecureJoin(root, unsafePath) + if err != nil { + return fmt.Errorf("resolving path inside rootfs failed: %v", err) + } + + // Open the target path. + fh, err := os.OpenFile(path, unix.O_PATH|unix.O_CLOEXEC, 0) + if err != nil { + return fmt.Errorf("open o_path procfd: %w", err) + } + defer fh.Close() + + // Double-check the path is the one we expected. + procfd := "/proc/self/fd/" + strconv.Itoa(int(fh.Fd())) + if realpath, err := os.Readlink(procfd); err != nil { + return fmt.Errorf("procfd verification failed: %w", err) + } else if realpath != path { + return fmt.Errorf("possibly malicious path detected -- refusing to operate on %s", realpath) + } + + // Run the closure. + return fn(procfd) +} + // SearchLabels searches a list of key-value pairs for the provided key and // returns the corresponding value. The pairs must be separated with '='. func SearchLabels(labels []string, query string) string { diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go index 5fceeb63533e..6a7a91e55969 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go @@ -598,10 +598,13 @@ type VMImage struct { // LinuxSeccomp represents syscall restrictions type LinuxSeccomp struct { - DefaultAction LinuxSeccompAction `json:"defaultAction"` - Architectures []Arch `json:"architectures,omitempty"` - Flags []LinuxSeccompFlag `json:"flags,omitempty"` - Syscalls []LinuxSyscall `json:"syscalls,omitempty"` + DefaultAction LinuxSeccompAction `json:"defaultAction"` + DefaultErrnoRet *uint `json:"defaultErrnoRet,omitempty"` + Architectures []Arch `json:"architectures,omitempty"` + Flags []LinuxSeccompFlag `json:"flags,omitempty"` + ListenerPath string `json:"listenerPath,omitempty"` + ListenerMetadata string `json:"listenerMetadata,omitempty"` + Syscalls []LinuxSyscall `json:"syscalls,omitempty"` } // Arch used for additional architectures @@ -641,11 +644,13 @@ type LinuxSeccompAction string const ( ActKill LinuxSeccompAction = "SCMP_ACT_KILL" ActKillProcess LinuxSeccompAction = "SCMP_ACT_KILL_PROCESS" + ActKillThread LinuxSeccompAction = "SCMP_ACT_KILL_THREAD" ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP" ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO" ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE" ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW" ActLog LinuxSeccompAction = "SCMP_ACT_LOG" + ActNotify LinuxSeccompAction = "SCMP_ACT_NOTIFY" ) // LinuxSeccompOperator used to match syscall arguments in Seccomp diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go b/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go index e2e64c663112..7c010d4fe798 100644 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go +++ b/cluster-autoscaler/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go @@ -5,17 +5,17 @@ type ContainerState string const ( // StateCreating indicates that the container is being created - StateCreating ContainerState = "creating" + StateCreating ContainerState = "creating" // StateCreated indicates that the runtime has finished the create operation - StateCreated ContainerState = "created" + StateCreated ContainerState = "created" // StateRunning indicates that the container process has executed the // user-specified program but has not exited - StateRunning ContainerState = "running" + StateRunning ContainerState = "running" // StateStopped indicates that the container process has exited - StateStopped ContainerState = "stopped" + StateStopped ContainerState = "stopped" ) // State holds information about the runtime state of the container. @@ -33,3 +33,24 @@ type State struct { // Annotations are key values associated with the container. Annotations map[string]string `json:"annotations,omitempty"` } + +const ( + // SeccompFdName is the name of the seccomp notify file descriptor. + SeccompFdName string = "seccompFd" +) + +// ContainerProcessState holds information about the state of a container process. +type ContainerProcessState struct { + // Version is the version of the specification that is supported. + Version string `json:"ociVersion"` + // Fds is a string array containing the names of the file descriptors passed. + // The index of the name in this array corresponds to index of the file + // descriptor in the `SCM_RIGHTS` array. + Fds []string `json:"fds"` + // Pid is the process ID as seen by the runtime. + Pid int `json:"pid"` + // Opaque metadata. + Metadata string `json:"metadata,omitempty"` + // State of the container. + State State `json:"state"` +} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/common/expfmt/decode.go b/cluster-autoscaler/vendor/github.com/prometheus/common/expfmt/decode.go index c092723e84a4..7657f841d632 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/common/expfmt/decode.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/common/expfmt/decode.go @@ -164,7 +164,7 @@ func (sd *SampleDecoder) Decode(s *model.Vector) error { } // ExtractSamples builds a slice of samples from the provided metric -// families. If an error occurrs during sample extraction, it continues to +// families. If an error occurs during sample extraction, it continues to // extract from the remaining metric families. The returned error is the last // error that has occurred. func ExtractSamples(o *DecodeOptions, fams ...*dto.MetricFamily) (model.Vector, error) { diff --git a/cluster-autoscaler/vendor/github.com/prometheus/common/expfmt/text_parse.go b/cluster-autoscaler/vendor/github.com/prometheus/common/expfmt/text_parse.go index 342e5940d0f7..b6079b31eeb5 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/common/expfmt/text_parse.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/common/expfmt/text_parse.go @@ -299,6 +299,17 @@ func (p *TextParser) startLabelName() stateFn { p.parseError(fmt.Sprintf("expected '=' after label name, found %q", p.currentByte)) return nil } + // Check for duplicate label names. + labels := make(map[string]struct{}) + for _, l := range p.currentMetric.Label { + lName := l.GetName() + if _, exists := labels[lName]; !exists { + labels[lName] = struct{}{} + } else { + p.parseError(fmt.Sprintf("duplicate label names for metric %q", p.currentMF.GetName())) + return nil + } + } return p.startLabelValue } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/common/model/fnv.go b/cluster-autoscaler/vendor/github.com/prometheus/common/model/fnv.go index 038fc1c9003c..367afecd30e6 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/common/model/fnv.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/common/model/fnv.go @@ -20,7 +20,7 @@ const ( prime64 = 1099511628211 ) -// hashNew initializies a new fnv64a hash value. +// hashNew initializes a new fnv64a hash value. func hashNew() uint64 { return offset64 } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/common/model/labels.go b/cluster-autoscaler/vendor/github.com/prometheus/common/model/labels.go index 41051a01a36d..ef8956335468 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/common/model/labels.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/common/model/labels.go @@ -45,6 +45,14 @@ const ( // scrape a target. MetricsPathLabel = "__metrics_path__" + // ScrapeIntervalLabel is the name of the label that holds the scrape interval + // used to scrape a target. + ScrapeIntervalLabel = "__scrape_interval__" + + // ScrapeTimeoutLabel is the name of the label that holds the scrape + // timeout used to scrape a target. + ScrapeTimeoutLabel = "__scrape_timeout__" + // ReservedLabelPrefix is a prefix which is not legal in user-supplied // label names. ReservedLabelPrefix = "__" diff --git a/cluster-autoscaler/vendor/github.com/prometheus/common/model/time.go b/cluster-autoscaler/vendor/github.com/prometheus/common/model/time.go index 490a0240c101..7f67b16e4295 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/common/model/time.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/common/model/time.go @@ -14,6 +14,8 @@ package model import ( + "encoding/json" + "errors" "fmt" "math" "regexp" @@ -181,77 +183,118 @@ func (d *Duration) Type() string { return "duration" } -var durationRE = regexp.MustCompile("^([0-9]+)(y|w|d|h|m|s|ms)$") +var durationRE = regexp.MustCompile("^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$") // ParseDuration parses a string into a time.Duration, assuming that a year // always has 365d, a week always has 7d, and a day always has 24h. func ParseDuration(durationStr string) (Duration, error) { - // Allow 0 without a unit. - if durationStr == "0" { + switch durationStr { + case "0": + // Allow 0 without a unit. return 0, nil + case "": + return 0, fmt.Errorf("empty duration string") } matches := durationRE.FindStringSubmatch(durationStr) - if len(matches) != 3 { + if matches == nil { return 0, fmt.Errorf("not a valid duration string: %q", durationStr) } - var ( - n, _ = strconv.Atoi(matches[1]) - dur = time.Duration(n) * time.Millisecond - ) - switch unit := matches[2]; unit { - case "y": - dur *= 1000 * 60 * 60 * 24 * 365 - case "w": - dur *= 1000 * 60 * 60 * 24 * 7 - case "d": - dur *= 1000 * 60 * 60 * 24 - case "h": - dur *= 1000 * 60 * 60 - case "m": - dur *= 1000 * 60 - case "s": - dur *= 1000 - case "ms": - // Value already correct - default: - return 0, fmt.Errorf("invalid time unit in duration string: %q", unit) + var dur time.Duration + + // Parse the match at pos `pos` in the regex and use `mult` to turn that + // into ms, then add that value to the total parsed duration. + var overflowErr error + m := func(pos int, mult time.Duration) { + if matches[pos] == "" { + return + } + n, _ := strconv.Atoi(matches[pos]) + + // Check if the provided duration overflows time.Duration (> ~ 290years). + if n > int((1<<63-1)/mult/time.Millisecond) { + overflowErr = errors.New("duration out of range") + } + d := time.Duration(n) * time.Millisecond + dur += d * mult + + if dur < 0 { + overflowErr = errors.New("duration out of range") + } } - return Duration(dur), nil + + m(2, 1000*60*60*24*365) // y + m(4, 1000*60*60*24*7) // w + m(6, 1000*60*60*24) // d + m(8, 1000*60*60) // h + m(10, 1000*60) // m + m(12, 1000) // s + m(14, 1) // ms + + return Duration(dur), overflowErr } func (d Duration) String() string { var ( - ms = int64(time.Duration(d) / time.Millisecond) - unit = "ms" + ms = int64(time.Duration(d) / time.Millisecond) + r = "" ) if ms == 0 { return "0s" } - factors := map[string]int64{ - "y": 1000 * 60 * 60 * 24 * 365, - "w": 1000 * 60 * 60 * 24 * 7, - "d": 1000 * 60 * 60 * 24, - "h": 1000 * 60 * 60, - "m": 1000 * 60, - "s": 1000, - "ms": 1, + + f := func(unit string, mult int64, exact bool) { + if exact && ms%mult != 0 { + return + } + if v := ms / mult; v > 0 { + r += fmt.Sprintf("%d%s", v, unit) + ms -= v * mult + } } - switch int64(0) { - case ms % factors["y"]: - unit = "y" - case ms % factors["w"]: - unit = "w" - case ms % factors["d"]: - unit = "d" - case ms % factors["h"]: - unit = "h" - case ms % factors["m"]: - unit = "m" - case ms % factors["s"]: - unit = "s" + // Only format years and weeks if the remainder is zero, as it is often + // easier to read 90d than 12w6d. + f("y", 1000*60*60*24*365, true) + f("w", 1000*60*60*24*7, true) + + f("d", 1000*60*60*24, false) + f("h", 1000*60*60, false) + f("m", 1000*60, false) + f("s", 1000, false) + f("ms", 1, false) + + return r +} + +// MarshalJSON implements the json.Marshaler interface. +func (d Duration) MarshalJSON() ([]byte, error) { + return json.Marshal(d.String()) +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (d *Duration) UnmarshalJSON(bytes []byte) error { + var s string + if err := json.Unmarshal(bytes, &s); err != nil { + return err + } + dur, err := ParseDuration(s) + if err != nil { + return err } - return fmt.Sprintf("%v%v", ms/factors[unit], unit) + *d = dur + return nil +} + +// MarshalText implements the encoding.TextMarshaler interface. +func (d *Duration) MarshalText() ([]byte, error) { + return []byte(d.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (d *Duration) UnmarshalText(text []byte) error { + var err error + *d, err = ParseDuration(string(text)) + return err } // MarshalYAML implements the yaml.Marshaler interface. diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare.go index dc200395ceb7..41649d267924 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare.go @@ -13,12 +13,42 @@ const ( compareGreater ) +var ( + intType = reflect.TypeOf(int(1)) + int8Type = reflect.TypeOf(int8(1)) + int16Type = reflect.TypeOf(int16(1)) + int32Type = reflect.TypeOf(int32(1)) + int64Type = reflect.TypeOf(int64(1)) + + uintType = reflect.TypeOf(uint(1)) + uint8Type = reflect.TypeOf(uint8(1)) + uint16Type = reflect.TypeOf(uint16(1)) + uint32Type = reflect.TypeOf(uint32(1)) + uint64Type = reflect.TypeOf(uint64(1)) + + float32Type = reflect.TypeOf(float32(1)) + float64Type = reflect.TypeOf(float64(1)) + + stringType = reflect.TypeOf("") +) + func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { + obj1Value := reflect.ValueOf(obj1) + obj2Value := reflect.ValueOf(obj2) + + // throughout this switch we try and avoid calling .Convert() if possible, + // as this has a pretty big performance impact switch kind { case reflect.Int: { - intobj1 := obj1.(int) - intobj2 := obj2.(int) + intobj1, ok := obj1.(int) + if !ok { + intobj1 = obj1Value.Convert(intType).Interface().(int) + } + intobj2, ok := obj2.(int) + if !ok { + intobj2 = obj2Value.Convert(intType).Interface().(int) + } if intobj1 > intobj2 { return compareGreater, true } @@ -31,8 +61,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int8: { - int8obj1 := obj1.(int8) - int8obj2 := obj2.(int8) + int8obj1, ok := obj1.(int8) + if !ok { + int8obj1 = obj1Value.Convert(int8Type).Interface().(int8) + } + int8obj2, ok := obj2.(int8) + if !ok { + int8obj2 = obj2Value.Convert(int8Type).Interface().(int8) + } if int8obj1 > int8obj2 { return compareGreater, true } @@ -45,8 +81,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int16: { - int16obj1 := obj1.(int16) - int16obj2 := obj2.(int16) + int16obj1, ok := obj1.(int16) + if !ok { + int16obj1 = obj1Value.Convert(int16Type).Interface().(int16) + } + int16obj2, ok := obj2.(int16) + if !ok { + int16obj2 = obj2Value.Convert(int16Type).Interface().(int16) + } if int16obj1 > int16obj2 { return compareGreater, true } @@ -59,8 +101,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int32: { - int32obj1 := obj1.(int32) - int32obj2 := obj2.(int32) + int32obj1, ok := obj1.(int32) + if !ok { + int32obj1 = obj1Value.Convert(int32Type).Interface().(int32) + } + int32obj2, ok := obj2.(int32) + if !ok { + int32obj2 = obj2Value.Convert(int32Type).Interface().(int32) + } if int32obj1 > int32obj2 { return compareGreater, true } @@ -73,8 +121,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int64: { - int64obj1 := obj1.(int64) - int64obj2 := obj2.(int64) + int64obj1, ok := obj1.(int64) + if !ok { + int64obj1 = obj1Value.Convert(int64Type).Interface().(int64) + } + int64obj2, ok := obj2.(int64) + if !ok { + int64obj2 = obj2Value.Convert(int64Type).Interface().(int64) + } if int64obj1 > int64obj2 { return compareGreater, true } @@ -87,8 +141,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint: { - uintobj1 := obj1.(uint) - uintobj2 := obj2.(uint) + uintobj1, ok := obj1.(uint) + if !ok { + uintobj1 = obj1Value.Convert(uintType).Interface().(uint) + } + uintobj2, ok := obj2.(uint) + if !ok { + uintobj2 = obj2Value.Convert(uintType).Interface().(uint) + } if uintobj1 > uintobj2 { return compareGreater, true } @@ -101,8 +161,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint8: { - uint8obj1 := obj1.(uint8) - uint8obj2 := obj2.(uint8) + uint8obj1, ok := obj1.(uint8) + if !ok { + uint8obj1 = obj1Value.Convert(uint8Type).Interface().(uint8) + } + uint8obj2, ok := obj2.(uint8) + if !ok { + uint8obj2 = obj2Value.Convert(uint8Type).Interface().(uint8) + } if uint8obj1 > uint8obj2 { return compareGreater, true } @@ -115,8 +181,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint16: { - uint16obj1 := obj1.(uint16) - uint16obj2 := obj2.(uint16) + uint16obj1, ok := obj1.(uint16) + if !ok { + uint16obj1 = obj1Value.Convert(uint16Type).Interface().(uint16) + } + uint16obj2, ok := obj2.(uint16) + if !ok { + uint16obj2 = obj2Value.Convert(uint16Type).Interface().(uint16) + } if uint16obj1 > uint16obj2 { return compareGreater, true } @@ -129,8 +201,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint32: { - uint32obj1 := obj1.(uint32) - uint32obj2 := obj2.(uint32) + uint32obj1, ok := obj1.(uint32) + if !ok { + uint32obj1 = obj1Value.Convert(uint32Type).Interface().(uint32) + } + uint32obj2, ok := obj2.(uint32) + if !ok { + uint32obj2 = obj2Value.Convert(uint32Type).Interface().(uint32) + } if uint32obj1 > uint32obj2 { return compareGreater, true } @@ -143,8 +221,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint64: { - uint64obj1 := obj1.(uint64) - uint64obj2 := obj2.(uint64) + uint64obj1, ok := obj1.(uint64) + if !ok { + uint64obj1 = obj1Value.Convert(uint64Type).Interface().(uint64) + } + uint64obj2, ok := obj2.(uint64) + if !ok { + uint64obj2 = obj2Value.Convert(uint64Type).Interface().(uint64) + } if uint64obj1 > uint64obj2 { return compareGreater, true } @@ -157,8 +241,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Float32: { - float32obj1 := obj1.(float32) - float32obj2 := obj2.(float32) + float32obj1, ok := obj1.(float32) + if !ok { + float32obj1 = obj1Value.Convert(float32Type).Interface().(float32) + } + float32obj2, ok := obj2.(float32) + if !ok { + float32obj2 = obj2Value.Convert(float32Type).Interface().(float32) + } if float32obj1 > float32obj2 { return compareGreater, true } @@ -171,8 +261,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Float64: { - float64obj1 := obj1.(float64) - float64obj2 := obj2.(float64) + float64obj1, ok := obj1.(float64) + if !ok { + float64obj1 = obj1Value.Convert(float64Type).Interface().(float64) + } + float64obj2, ok := obj2.(float64) + if !ok { + float64obj2 = obj2Value.Convert(float64Type).Interface().(float64) + } if float64obj1 > float64obj2 { return compareGreater, true } @@ -185,8 +281,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.String: { - stringobj1 := obj1.(string) - stringobj2 := obj2.(string) + stringobj1, ok := obj1.(string) + if !ok { + stringobj1 = obj1Value.Convert(stringType).Interface().(string) + } + stringobj2, ok := obj2.(string) + if !ok { + stringobj2 = obj2Value.Convert(stringType).Interface().(string) + } if stringobj1 > stringobj2 { return compareGreater, true } @@ -240,6 +342,24 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter return compareTwoValues(t, e1, e2, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) } +// Positive asserts that the specified element is positive +// +// assert.Positive(t, 1) +// assert.Positive(t, 1.23) +func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { + zero := reflect.Zero(reflect.TypeOf(e)) + return compareTwoValues(t, e, zero.Interface(), []CompareType{compareGreater}, "\"%v\" is not positive", msgAndArgs) +} + +// Negative asserts that the specified element is negative +// +// assert.Negative(t, -1) +// assert.Negative(t, -1.23) +func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { + zero := reflect.Zero(reflect.TypeOf(e)) + return compareTwoValues(t, e, zero.Interface(), []CompareType{compareLess}, "\"%v\" is not negative", msgAndArgs) +} + func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_format.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_format.go index 49370eb16742..4dfd1229a861 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_format.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_format.go @@ -114,6 +114,24 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) bool { return Error(t, err, append([]interface{}{msg}, args...)...) } +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...) +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return ErrorIs(t, err, target, append([]interface{}{msg}, args...)...) +} + // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // @@ -321,6 +339,54 @@ func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsil return InEpsilonSlice(t, expected, actual, epsilon, append([]interface{}{msg}, args...)...) } +// IsDecreasingf asserts that the collection is decreasing +// +// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsDecreasing(t, object, append([]interface{}{msg}, args...)...) +} + +// IsIncreasingf asserts that the collection is increasing +// +// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsIncreasing(t, object, append([]interface{}{msg}, args...)...) +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsNonDecreasing(t, object, append([]interface{}{msg}, args...)...) +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsNonIncreasing(t, object, append([]interface{}{msg}, args...)...) +} + // IsTypef asserts that the specified objects are of the same type. func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { @@ -375,6 +441,17 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args . return LessOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...) } +// Negativef asserts that the specified element is negative +// +// assert.Negativef(t, -1, "error message %s", "formatted") +// assert.Negativef(t, -1.23, "error message %s", "formatted") +func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return Negative(t, e, append([]interface{}{msg}, args...)...) +} + // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -476,6 +553,15 @@ func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg s return NotEqualValues(t, expected, actual, append([]interface{}{msg}, args...)...) } +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return NotErrorIs(t, err, target, append([]interface{}{msg}, args...)...) +} + // NotNilf asserts that the specified object is not nil. // // assert.NotNilf(t, err, "error message %s", "formatted") @@ -572,6 +658,17 @@ func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg str return PanicsWithValue(t, expected, f, append([]interface{}{msg}, args...)...) } +// Positivef asserts that the specified element is positive +// +// assert.Positivef(t, 1, "error message %s", "formatted") +// assert.Positivef(t, 1.23, "error message %s", "formatted") +func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return Positive(t, e, append([]interface{}{msg}, args...)...) +} + // Regexpf asserts that a specified regexp matches a string. // // assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_forward.go index 9db889427a72..25337a6f07e6 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_forward.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_forward.go @@ -204,6 +204,42 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool { return Error(a.t, err, msgAndArgs...) } +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorAs(a.t, err, target, msgAndArgs...) +} + +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorAsf(a.t, err, target, msg, args...) +} + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorIs(a.t, err, target, msgAndArgs...) +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorIsf(a.t, err, target, msg, args...) +} + // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -631,6 +667,102 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo return InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } +// IsDecreasing asserts that the collection is decreasing +// +// a.IsDecreasing([]int{2, 1, 0}) +// a.IsDecreasing([]float{2, 1}) +// a.IsDecreasing([]string{"b", "a"}) +func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsDecreasing(a.t, object, msgAndArgs...) +} + +// IsDecreasingf asserts that the collection is decreasing +// +// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") +// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsDecreasingf(a.t, object, msg, args...) +} + +// IsIncreasing asserts that the collection is increasing +// +// a.IsIncreasing([]int{1, 2, 3}) +// a.IsIncreasing([]float{1, 2}) +// a.IsIncreasing([]string{"a", "b"}) +func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsIncreasing(a.t, object, msgAndArgs...) +} + +// IsIncreasingf asserts that the collection is increasing +// +// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") +// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsIncreasingf(a.t, object, msg, args...) +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// a.IsNonDecreasing([]int{1, 1, 2}) +// a.IsNonDecreasing([]float{1, 2}) +// a.IsNonDecreasing([]string{"a", "b"}) +func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonDecreasing(a.t, object, msgAndArgs...) +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonDecreasingf(a.t, object, msg, args...) +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// a.IsNonIncreasing([]int{2, 1, 1}) +// a.IsNonIncreasing([]float{2, 1}) +// a.IsNonIncreasing([]string{"b", "a"}) +func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonIncreasing(a.t, object, msgAndArgs...) +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonIncreasingf(a.t, object, msg, args...) +} + // IsType asserts that the specified objects are of the same type. func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { @@ -739,6 +871,28 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i return Lessf(a.t, e1, e2, msg, args...) } +// Negative asserts that the specified element is negative +// +// a.Negative(-1) +// a.Negative(-1.23) +func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Negative(a.t, e, msgAndArgs...) +} + +// Negativef asserts that the specified element is negative +// +// a.Negativef(-1, "error message %s", "formatted") +// a.Negativef(-1.23, "error message %s", "formatted") +func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Negativef(a.t, e, msg, args...) +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -941,6 +1095,24 @@ func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg str return NotEqualf(a.t, expected, actual, msg, args...) } +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return NotErrorIs(a.t, err, target, msgAndArgs...) +} + +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return NotErrorIsf(a.t, err, target, msg, args...) +} + // NotNil asserts that the specified object is not nil. // // a.NotNil(err) @@ -1133,6 +1305,28 @@ func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) b return Panicsf(a.t, f, msg, args...) } +// Positive asserts that the specified element is positive +// +// a.Positive(1) +// a.Positive(1.23) +func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Positive(a.t, e, msgAndArgs...) +} + +// Positivef asserts that the specified element is positive +// +// a.Positivef(1, "error message %s", "formatted") +// a.Positivef(1.23, "error message %s", "formatted") +func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Positivef(a.t, e, msg, args...) +} + // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_order.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_order.go new file mode 100644 index 000000000000..1c3b47182a72 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_order.go @@ -0,0 +1,81 @@ +package assert + +import ( + "fmt" + "reflect" +) + +// isOrdered checks that collection contains orderable elements. +func isOrdered(t TestingT, object interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { + objKind := reflect.TypeOf(object).Kind() + if objKind != reflect.Slice && objKind != reflect.Array { + return false + } + + objValue := reflect.ValueOf(object) + objLen := objValue.Len() + + if objLen <= 1 { + return true + } + + value := objValue.Index(0) + valueInterface := value.Interface() + firstValueKind := value.Kind() + + for i := 1; i < objLen; i++ { + prevValue := value + prevValueInterface := valueInterface + + value = objValue.Index(i) + valueInterface = value.Interface() + + compareResult, isComparable := compare(prevValueInterface, valueInterface, firstValueKind) + + if !isComparable { + return Fail(t, fmt.Sprintf("Can not compare type \"%s\" and \"%s\"", reflect.TypeOf(value), reflect.TypeOf(prevValue)), msgAndArgs...) + } + + if !containsValue(allowedComparesResults, compareResult) { + return Fail(t, fmt.Sprintf(failMessage, prevValue, value), msgAndArgs...) + } + } + + return true +} + +// IsIncreasing asserts that the collection is increasing +// +// assert.IsIncreasing(t, []int{1, 2, 3}) +// assert.IsIncreasing(t, []float{1, 2}) +// assert.IsIncreasing(t, []string{"a", "b"}) +func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs) +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// assert.IsNonIncreasing(t, []int{2, 1, 1}) +// assert.IsNonIncreasing(t, []float{2, 1}) +// assert.IsNonIncreasing(t, []string{"b", "a"}) +func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs) +} + +// IsDecreasing asserts that the collection is decreasing +// +// assert.IsDecreasing(t, []int{2, 1, 0}) +// assert.IsDecreasing(t, []float{2, 1}) +// assert.IsDecreasing(t, []string{"b", "a"}) +func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs) +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// assert.IsNonDecreasing(t, []int{1, 1, 2}) +// assert.IsNonDecreasing(t, []float{1, 2}) +// assert.IsNonDecreasing(t, []string{"a", "b"}) +func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) +} diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertions.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertions.go index 914a10d83afc..bcac4401f57f 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertions.go @@ -172,8 +172,8 @@ func isTest(name, prefix string) bool { if len(name) == len(prefix) { // "Test" is ok return true } - rune, _ := utf8.DecodeRuneInString(name[len(prefix):]) - return !unicode.IsLower(rune) + r, _ := utf8.DecodeRuneInString(name[len(prefix):]) + return !unicode.IsLower(r) } func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { @@ -1622,6 +1622,7 @@ var spewConfig = spew.ConfigState{ DisableCapacities: true, SortKeys: true, DisableMethods: true, + MaxDepth: 10, } type tHelper interface { @@ -1693,3 +1694,81 @@ func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.D } } } + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if errors.Is(err, target) { + return true + } + + var expectedText string + if target != nil { + expectedText = target.Error() + } + + chain := buildErrorChainString(err) + + return Fail(t, fmt.Sprintf("Target error should be in err chain:\n"+ + "expected: %q\n"+ + "in chain: %s", expectedText, chain, + ), msgAndArgs...) +} + +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if !errors.Is(err, target) { + return true + } + + var expectedText string + if target != nil { + expectedText = target.Error() + } + + chain := buildErrorChainString(err) + + return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+ + "found: %q\n"+ + "in chain: %s", expectedText, chain, + ), msgAndArgs...) +} + +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if errors.As(err, target) { + return true + } + + chain := buildErrorChainString(err) + + return Fail(t, fmt.Sprintf("Should be in error chain:\n"+ + "expected: %q\n"+ + "in chain: %s", target, chain, + ), msgAndArgs...) +} + +func buildErrorChainString(err error) string { + if err == nil { + return "" + } + + e := errors.Unwrap(err) + chain := fmt.Sprintf("%q", err.Error()) + for e != nil { + chain += fmt.Sprintf("\n\t%q", e.Error()) + e = errors.Unwrap(e) + } + return chain +} diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/mock.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/mock.go index c6df4485abc2..e2e6a2d237df 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/mock.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/mock.go @@ -297,25 +297,52 @@ func (m *Mock) findExpectedCall(method string, arguments ...interface{}) (int, * return -1, expectedCall } +type matchCandidate struct { + call *Call + mismatch string + diffCount int +} + +func (c matchCandidate) isBetterMatchThan(other matchCandidate) bool { + if c.call == nil { + return false + } + if other.call == nil { + return true + } + + if c.diffCount > other.diffCount { + return false + } + if c.diffCount < other.diffCount { + return true + } + + if c.call.Repeatability > 0 && other.call.Repeatability <= 0 { + return true + } + return false +} + func (m *Mock) findClosestCall(method string, arguments ...interface{}) (*Call, string) { - var diffCount int - var closestCall *Call - var err string + var bestMatch matchCandidate for _, call := range m.expectedCalls() { if call.Method == method { errInfo, tempDiffCount := call.Arguments.Diff(arguments) - if tempDiffCount < diffCount || diffCount == 0 { - diffCount = tempDiffCount - closestCall = call - err = errInfo + tempCandidate := matchCandidate{ + call: call, + mismatch: errInfo, + diffCount: tempDiffCount, + } + if tempCandidate.isBetterMatchThan(bestMatch) { + bestMatch = tempCandidate } - } } - return closestCall, err + return bestMatch.call, bestMatch.mismatch } func callString(method string, arguments Arguments, includeArgumentValues bool) string { diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require.go index ec4624b282bb..51820df2e672 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require.go @@ -256,6 +256,54 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) { t.FailNow() } +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorAs(t, err, target, msgAndArgs...) { + return + } + t.FailNow() +} + +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorAsf(t, err, target, msg, args...) { + return + } + t.FailNow() +} + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorIs(t, err, target, msgAndArgs...) { + return + } + t.FailNow() +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorIsf(t, err, target, msg, args...) { + return + } + t.FailNow() +} + // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -806,6 +854,126 @@ func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon fl t.FailNow() } +// IsDecreasing asserts that the collection is decreasing +// +// assert.IsDecreasing(t, []int{2, 1, 0}) +// assert.IsDecreasing(t, []float{2, 1}) +// assert.IsDecreasing(t, []string{"b", "a"}) +func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsDecreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsDecreasingf asserts that the collection is decreasing +// +// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsDecreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + +// IsIncreasing asserts that the collection is increasing +// +// assert.IsIncreasing(t, []int{1, 2, 3}) +// assert.IsIncreasing(t, []float{1, 2}) +// assert.IsIncreasing(t, []string{"a", "b"}) +func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsIncreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsIncreasingf asserts that the collection is increasing +// +// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsIncreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// assert.IsNonDecreasing(t, []int{1, 1, 2}) +// assert.IsNonDecreasing(t, []float{1, 2}) +// assert.IsNonDecreasing(t, []string{"a", "b"}) +func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonDecreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonDecreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// assert.IsNonIncreasing(t, []int{2, 1, 1}) +// assert.IsNonIncreasing(t, []float{2, 1}) +// assert.IsNonIncreasing(t, []string{"b", "a"}) +func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonIncreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonIncreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + // IsType asserts that the specified objects are of the same type. func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { @@ -944,6 +1112,34 @@ func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...inter t.FailNow() } +// Negative asserts that the specified element is negative +// +// assert.Negative(t, -1) +// assert.Negative(t, -1.23) +func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Negative(t, e, msgAndArgs...) { + return + } + t.FailNow() +} + +// Negativef asserts that the specified element is negative +// +// assert.Negativef(t, -1, "error message %s", "formatted") +// assert.Negativef(t, -1.23, "error message %s", "formatted") +func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Negativef(t, e, msg, args...) { + return + } + t.FailNow() +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -1200,6 +1396,30 @@ func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, t.FailNow() } +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.NotErrorIs(t, err, target, msgAndArgs...) { + return + } + t.FailNow() +} + +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.NotErrorIsf(t, err, target, msg, args...) { + return + } + t.FailNow() +} + // NotNil asserts that the specified object is not nil. // // assert.NotNil(t, err) @@ -1446,6 +1666,34 @@ func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{} t.FailNow() } +// Positive asserts that the specified element is positive +// +// assert.Positive(t, 1) +// assert.Positive(t, 1.23) +func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Positive(t, e, msgAndArgs...) { + return + } + t.FailNow() +} + +// Positivef asserts that the specified element is positive +// +// assert.Positivef(t, 1, "error message %s", "formatted") +// assert.Positivef(t, 1.23, "error message %s", "formatted") +func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Positivef(t, e, msg, args...) { + return + } + t.FailNow() +} + // Regexp asserts that a specified regexp matches a string. // // assert.Regexp(t, regexp.MustCompile("start"), "it's starting") diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require_forward.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require_forward.go index 103d7dcb6ad6..ed54a9d83f35 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require_forward.go @@ -205,6 +205,42 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { Error(a.t, err, msgAndArgs...) } +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorAs(a.t, err, target, msgAndArgs...) +} + +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorAsf(a.t, err, target, msg, args...) +} + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorIs(a.t, err, target, msgAndArgs...) +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorIsf(a.t, err, target, msg, args...) +} + // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -632,6 +668,102 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } +// IsDecreasing asserts that the collection is decreasing +// +// a.IsDecreasing([]int{2, 1, 0}) +// a.IsDecreasing([]float{2, 1}) +// a.IsDecreasing([]string{"b", "a"}) +func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsDecreasing(a.t, object, msgAndArgs...) +} + +// IsDecreasingf asserts that the collection is decreasing +// +// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") +// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsDecreasingf(a.t, object, msg, args...) +} + +// IsIncreasing asserts that the collection is increasing +// +// a.IsIncreasing([]int{1, 2, 3}) +// a.IsIncreasing([]float{1, 2}) +// a.IsIncreasing([]string{"a", "b"}) +func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsIncreasing(a.t, object, msgAndArgs...) +} + +// IsIncreasingf asserts that the collection is increasing +// +// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") +// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsIncreasingf(a.t, object, msg, args...) +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// a.IsNonDecreasing([]int{1, 1, 2}) +// a.IsNonDecreasing([]float{1, 2}) +// a.IsNonDecreasing([]string{"a", "b"}) +func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonDecreasing(a.t, object, msgAndArgs...) +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonDecreasingf(a.t, object, msg, args...) +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// a.IsNonIncreasing([]int{2, 1, 1}) +// a.IsNonIncreasing([]float{2, 1}) +// a.IsNonIncreasing([]string{"b", "a"}) +func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonIncreasing(a.t, object, msgAndArgs...) +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonIncreasingf(a.t, object, msg, args...) +} + // IsType asserts that the specified objects are of the same type. func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { @@ -740,6 +872,28 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i Lessf(a.t, e1, e2, msg, args...) } +// Negative asserts that the specified element is negative +// +// a.Negative(-1) +// a.Negative(-1.23) +func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Negative(a.t, e, msgAndArgs...) +} + +// Negativef asserts that the specified element is negative +// +// a.Negativef(-1, "error message %s", "formatted") +// a.Negativef(-1.23, "error message %s", "formatted") +func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Negativef(a.t, e, msg, args...) +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -942,6 +1096,24 @@ func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg str NotEqualf(a.t, expected, actual, msg, args...) } +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + NotErrorIs(a.t, err, target, msgAndArgs...) +} + +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + NotErrorIsf(a.t, err, target, msg, args...) +} + // NotNil asserts that the specified object is not nil. // // a.NotNil(err) @@ -1134,6 +1306,28 @@ func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interfa Panicsf(a.t, f, msg, args...) } +// Positive asserts that the specified element is positive +// +// a.Positive(1) +// a.Positive(1.23) +func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Positive(a.t, e, msgAndArgs...) +} + +// Positivef asserts that the specified element is positive +// +// a.Positivef(1, "error message %s", "formatted") +// a.Positivef(1.23, "error message %s", "formatted") +func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Positivef(a.t, e, msg, args...) +} + // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/.gitignore b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/.gitignore deleted file mode 100644 index 3aef02675d47..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.dll -*.so -*.dylib - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 -.glide/ - -# A macOS metadata file -.DS_Store diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/.travis.yml b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/.travis.yml deleted file mode 100644 index 9f9f43fda333..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -go_import_path: github.com/thecodeteam/goscaleio - -language: go -go: - - 1.8.3 - - 1.9.1 -os: - - linux - -install: true -script: go build diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/Gopkg.lock b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/Gopkg.lock deleted file mode 100644 index 5f9c1bedfb2b..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/Gopkg.lock +++ /dev/null @@ -1,27 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/sirupsen/logrus" - packages = ["."] - revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e" - version = "v1.0.3" - -[[projects]] - branch = "master" - name = "golang.org/x/crypto" - packages = ["ssh/terminal"] - revision = "2509b142fb2b797aa7587dad548f113b2c0f20ce" - -[[projects]] - branch = "master" - name = "golang.org/x/sys" - packages = ["unix","windows"] - revision = "164713f0dfcec4e80be8b53e1f0811f5f0d84578" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "9a4df6c2b9cbc7b6a8c1f52444dc0bace4dc5e03a39109d0e2f7956c62319982" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/Gopkg.toml b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/Gopkg.toml deleted file mode 100644 index b0e2232b194f..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/Gopkg.toml +++ /dev/null @@ -1,4 +0,0 @@ -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# Refer to https://github.com/toml-lang/toml for detailed TOML docs. diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/LICENSE b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/LICENSE deleted file mode 100644 index e06d2081865a..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/README.md b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/README.md deleted file mode 100644 index 129954cbe2d9..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# Goscaleio -The *Goscaleio* project represents API bindings that can be used to provide ScaleIO functionality into other Go applications. - - -- [Current State](#state) -- [Usage](#usage) -- [Licensing](#licensing) -- [Support](#support) - -## Use Cases -Any application written in Go can take advantage of these bindings. Specifically, things that are involved in monitoring, management, and more specifically infrastructrue as code would find these bindings relevant. - - -## Current State -Early build-out and pre-documentation stages. The basics around authentication and object models are there. - - -## Usage - -### Logging in - - client, err := goscaleio.NewClient() - if err != nil { - log.Fatalf("err: %v", err) - } - - _, err = client.Authenticate(&goscaleio.ConfigConnect{endpoint, username, password}) - if err != nil { - log.Fatalf("error authenticating: %v", err) - } - - fmt.Println("Successfuly logged in to ScaleIO Gateway at", client.SIOEndpoint.String()) - - -### Reusing the authentication token -Once a client struct is created via the ```NewClient()``` function, you can replace the ```Token``` with the saved token. - - client, err := goscaleio.NewClient() - if err != nil { - log.Fatalf("error with NewClient: %s", err) - } - - client.Token = oldToken - -### Get Systems -Retrieving systems is the first step after authentication which enables you to work with other necessary methods. - -#### All Systems - - systems, err := client.GetInstance() - if err != nil { - log.Fatalf("err: problem getting instance %v", err) - } - -#### Find a System - - system, err := client.FindSystem(systemid,"","") - if err != nil { - log.Fatalf("err: problem getting instance %v", err) - } - - -### Get Protection Domains -Once you have a ```System``` struct you can then get other things like ```Protection Domains```. - - protectiondomains, err := system.GetProtectionDomain() - if err != nil { - log.Fatalf("error getting protection domains: %v", err) - } - - -Licensing ---------- -Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -Support -------- - -Please file bugs and issues on the Github issues page for this project. This is to help keep track and document everything related to this repo. For general discussions and further support you can join the [EMC {code} Community slack channel](http://community.emccode.com/). Lastly, for questions asked on [Stackoverflow.com](https://stackoverflow.com) please tag them with **EMC**. The code and documentation are released with no warranties or SLAs and are intended to be supported through a community driven process. diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/VERSION b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/VERSION deleted file mode 100644 index 6e8bf73aa550..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.1.0 diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/api.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/api.go deleted file mode 100644 index 2b17c8886c1f..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/api.go +++ /dev/null @@ -1,401 +0,0 @@ -package goscaleio - -import ( - "bytes" - "crypto/tls" - "crypto/x509" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "os" - "regexp" - "strings" - "time" - - types "github.com/thecodeteam/goscaleio/types/v1" - log "github.com/sirupsen/logrus" -) - -type Client struct { - Token string - SIOEndpoint url.URL - Http http.Client - Insecure string - ShowBody bool - configConnect *ConfigConnect -} - -type Cluster struct { -} - -type ConfigConnect struct { - Endpoint string - Version string - Username string - Password string -} - -type ClientPersistent struct { - configConnect *ConfigConnect - client *Client -} - -func (client *Client) getVersion() (string, error) { - endpoint := client.SIOEndpoint - endpoint.Path = "/api/version" - - req := client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", client.Token) - - resp, err := client.retryCheckResp(&client.Http, req) - if err != nil { - return "", fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - bs, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "", errors.New("error reading body") - } - - version := string(bs) - - if client.ShowBody { - log.WithField("body", version).Debug( - "printing version message body") - } - - version = strings.TrimRight(version, `"`) - version = strings.TrimLeft(version, `"`) - - versionRX := regexp.MustCompile(`^(\d+?\.\d+?).*$`) - if m := versionRX.FindStringSubmatch(version); len(m) > 0 { - return m[1], nil - } - return version, nil -} - -func (client *Client) updateVersion() error { - - version, err := client.getVersion() - if err != nil { - return err - } - client.configConnect.Version = version - - return nil -} - -func (client *Client) Authenticate(configConnect *ConfigConnect) (Cluster, error) { - - configConnect.Version = client.configConnect.Version - client.configConnect = configConnect - - endpoint := client.SIOEndpoint - endpoint.Path += "/login" - - req := client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth(configConnect.Username, configConnect.Password) - - httpClient := &client.Http - resp, errBody, err := client.checkResp(httpClient.Do(req)) - if errBody == nil && err != nil { - return Cluster{}, err - } else if errBody != nil && err != nil { - if resp == nil { - return Cluster{}, errors.New("Problem getting response from endpoint") - } - return Cluster{}, errors.New(errBody.Message) - } - defer resp.Body.Close() - - bs, err := ioutil.ReadAll(resp.Body) - if err != nil { - return Cluster{}, errors.New("error reading body") - } - - token := string(bs) - - if client.ShowBody { - log.WithField("body", token).Debug( - "printing authentication message body") - } - - token = strings.TrimRight(token, `"`) - token = strings.TrimLeft(token, `"`) - client.Token = token - - if client.configConnect.Version == "" { - err = client.updateVersion() - if err != nil { - return Cluster{}, errors.New("error getting version of ScaleIO") - } - } - - return Cluster{}, nil -} - -//https://github.com/chrislusf/teeproxy/blob/master/teeproxy.go -type nopCloser struct { - io.Reader -} - -func (nopCloser) Close() error { return nil } - -func DuplicateRequest(request *http.Request) (request1 *http.Request, request2 *http.Request) { - request1 = &http.Request{ - Method: request.Method, - URL: request.URL, - Proto: "HTTP/1.1", - ProtoMajor: 1, - ProtoMinor: 1, - Header: request.Header, - Host: request.Host, - ContentLength: request.ContentLength, - } - request2 = &http.Request{ - Method: request.Method, - URL: request.URL, - Proto: "HTTP/1.1", - ProtoMajor: 1, - ProtoMinor: 1, - Header: request.Header, - Host: request.Host, - ContentLength: request.ContentLength, - } - - if request.Body != nil { - b1 := new(bytes.Buffer) - b2 := new(bytes.Buffer) - w := io.MultiWriter(b1, b2) - io.Copy(w, request.Body) - request1.Body = nopCloser{b1} - request2.Body = nopCloser{b2} - - defer request.Body.Close() - } - - return -} - -func (client *Client) retryCheckResp(httpClient *http.Client, req *http.Request) (*http.Response, error) { - - req1, req2 := DuplicateRequest(req) - resp, errBody, err := client.checkResp(httpClient.Do(req1)) - if errBody == nil && err != nil { - return &http.Response{}, err - } else if errBody != nil && err != nil { - if resp == nil { - return nil, errors.New("Problem getting response from endpoint") - } - - if resp.StatusCode == 401 && errBody.MajorErrorCode == 0 { - _, err := client.Authenticate(client.configConnect) - if err != nil { - return nil, fmt.Errorf("Error re-authenticating: %s", err) - } - - ioutil.ReadAll(resp.Body) - resp.Body.Close() - - req2.SetBasicAuth("", client.Token) - resp, errBody, err = client.checkResp(httpClient.Do(req2)) - if err != nil { - return &http.Response{}, errors.New(errBody.Message) - } - } else { - return &http.Response{}, errors.New(errBody.Message) - } - } - - return resp, nil -} - -func (client *Client) checkResp(resp *http.Response, err error) (*http.Response, *types.Error, error) { - if err != nil { - return resp, &types.Error{}, err - } - - switch i := resp.StatusCode; { - // Valid request, return the response. - case i == 200 || i == 201 || i == 202 || i == 204: - return resp, &types.Error{}, nil - // Invalid request, parse the XML error returned and return it. - case i == 400 || i == 401 || i == 403 || i == 404 || i == 405 || i == 406 || i == 409 || i == 415 || i == 500 || i == 503 || i == 504: - errBody, err := client.parseErr(resp) - return resp, errBody, err - // Unhandled response. - default: - return nil, &types.Error{}, fmt.Errorf("unhandled API response, please report this issue, status code: %s", resp.Status) - } -} - -func (client *Client) decodeBody(resp *http.Response, out interface{}) error { - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - if client.ShowBody { - var prettyJSON bytes.Buffer - _ = json.Indent(&prettyJSON, body, "", " ") - log.WithField("body", prettyJSON.String()).Debug( - "print decoded body") - } - - if err = json.Unmarshal(body, &out); err != nil { - return err - } - - return nil -} - -func (client *Client) parseErr(resp *http.Response) (*types.Error, error) { - - errBody := new(types.Error) - - // if there was an error decoding the body, just return that - if err := client.decodeBody(resp, errBody); err != nil { - return &types.Error{}, fmt.Errorf("error parsing error body for non-200 request: %s", err) - } - - return errBody, fmt.Errorf("API (%d) Error: %d: %s", resp.StatusCode, errBody.MajorErrorCode, errBody.Message) -} - -func (c *Client) NewRequest(params map[string]string, method string, u url.URL, body io.Reader) *http.Request { - - if log.GetLevel() == log.DebugLevel && c.ShowBody && body != nil { - buf := new(bytes.Buffer) - buf.ReadFrom(body) - log.WithField("body", buf.String()).Debug("print new request body") - } - - p := url.Values{} - - for k, v := range params { - p.Add(k, v) - } - - u.RawQuery = p.Encode() - - req, _ := http.NewRequest(method, u.String(), body) - - return req - -} - -func NewClient() (client *Client, err error) { - return NewClientWithArgs( - os.Getenv("GOSCALEIO_ENDPOINT"), - os.Getenv("GOSCALEIO_VERSION"), - os.Getenv("GOSCALEIO_INSECURE") == "true", - os.Getenv("GOSCALEIO_USECERTS") == "true") -} - -func NewClientWithArgs( - endpoint string, - version string, - insecure, - useCerts bool) (client *Client, err error) { - - fields := map[string]interface{}{ - "endpoint": endpoint, - "insecure": insecure, - "useCerts": useCerts, - "version": version, - } - - var uri *url.URL - - if endpoint != "" { - uri, err = url.ParseRequestURI(endpoint) - if err != nil { - return &Client{}, - withFieldsE(fields, "error parsing endpoint", err) - } - } else { - return &Client{}, - withFields(fields, "endpoint is required") - } - - client = &Client{ - SIOEndpoint: *uri, - Http: http.Client{ - Transport: &http.Transport{ - TLSHandshakeTimeout: 120 * time.Second, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: insecure, - }, - }, - }, - } - - if useCerts { - pool := x509.NewCertPool() - pool.AppendCertsFromPEM(pemCerts) - - client.Http.Transport = &http.Transport{ - TLSHandshakeTimeout: 120 * time.Second, - TLSClientConfig: &tls.Config{ - RootCAs: pool, - InsecureSkipVerify: insecure, - }, - } - } - - client.configConnect = &ConfigConnect{ - Version: version, - } - - return client, nil -} - -func GetLink(links []*types.Link, rel string) (*types.Link, error) { - for _, link := range links { - if link.Rel == rel { - return link, nil - } - } - - return &types.Link{}, errors.New("Couldn't find link") -} - -func withFields(fields map[string]interface{}, message string) error { - return withFieldsE(fields, message, nil) -} - -func withFieldsE( - fields map[string]interface{}, message string, inner error) error { - - if fields == nil { - fields = make(map[string]interface{}) - } - - if inner != nil { - fields["inner"] = inner - } - - x := 0 - l := len(fields) - - var b bytes.Buffer - for k, v := range fields { - if x < l-1 { - b.WriteString(fmt.Sprintf("%s=%v,", k, v)) - } else { - b.WriteString(fmt.Sprintf("%s=%v", k, v)) - } - x = x + 1 - } - - return newf("%s %s", message, b.String()) -} - -func newf(format string, a ...interface{}) error { - return errors.New(fmt.Sprintf(format, a)) -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/certs.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/certs.go deleted file mode 100644 index 976d8f3274c6..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/certs.go +++ /dev/null @@ -1,4232 +0,0 @@ -package goscaleio - -//https://raw.githubusercontent.com/kelseyhightower/contributors/master/certs.go - -var pemCerts = []byte(` ------BEGIN CERTIFICATE----- -MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJB -VDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp -bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5R -dWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5RdWFsLTAzMB4XDTA1MDgxNzIyMDAw -MFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgwRgYDVQQKDD9BLVRy -dXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0ZW52 -ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMM -EEEtVHJ1c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQCtPWFuA/OQO8BBC4SAzewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUj -lUC5B3ilJfYKvUWG6Nm9wASOhURh73+nyfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZ -znF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPESU7l0+m0iKsMrmKS1GWH -2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4iHQF63n1 -k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs -2e3Vcuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYD -VR0OBAoECERqlWdVeRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC -AQEAVdRU0VlIXLOThaq/Yy/kgM40ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fG -KOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmrsQd7TZjTXLDR8KdCoLXEjq/+ -8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZdJXDRZslo+S4R -FGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS -mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmE -DNuxUCAKGkq6ahq97BvIxYSazQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UE -AwwJQUNDVlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQsw -CQYDVQQGEwJFUzAeFw0xMTA1MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQ -BgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwHUEtJQUNDVjENMAsGA1UECgwEQUND -VjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCb -qau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gMjmoY -HtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWo -G2ioPej0RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpA -lHPrzg5XPAOBOp0KoVdDaaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhr -IA8wKFSVf+DuzgpmndFALW4ir50awQUZ0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/ -0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDGWuzndN9wrqODJerWx5eH -k6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs78yM2x/47 -4KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMO -m3WR5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpa -cXpkatcnYGMN285J9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPl -uUsXQA+xtrn13k/c4LOsOxFwYIRKQ26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYI -KwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRwOi8vd3d3LmFjY3YuZXMvZmls -ZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEuY3J0MB8GCCsG -AQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 -VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeT -VfZW6oHlNsyMHj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIG -CCsGAQUFBwICMIIBFB6CARAAQQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUA -cgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBhAO0AegAgAGQAZQAgAGwAYQAgAEEA -QwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUAYwBuAG8AbABvAGcA -7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBjAHQA -cgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAA -QwBQAFMAIABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUA -czAwBggrBgEFBQcCARYkaHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2Mu -aHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRt -aW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2MV9kZXIuY3JsMA4GA1Ud -DwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZIhvcNAQEF -BQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdp -D70ER9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gU -JyCpZET/LtZ1qmxNYEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+m -AM/EKXMRNt6GGT6d7hmKG9Ww7Y49nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepD -vV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJTS+xJlsndQAJxGJ3KQhfnlms -tn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3sCPdK6jT2iWH -7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h -I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szA -h1xA2syVP1XgNce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xF -d3+YJ5oyXSrjhO7FmGYvliAd3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2H -pPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3pEfbRD0tVNEYqi4Y7 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UE -AwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00x -CzAJBgNVBAYTAkVTMB4XDTA4MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEW -MBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZF -RElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC -AgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHkWLn7 -09gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7 -XBZXehuDYAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5P -Grjm6gSSrj0RuVFCPYewMYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAK -t0SdE3QrwqXrIhWYENiLxQSfHY9g5QYbm8+5eaA9oiM/Qj9r+hwDezCNzmzAv+Yb -X79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbkHQl/Sog4P75n/TSW9R28 -MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTTxKJxqvQU -fecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI -2Sf23EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyH -K9caUPgn6C9D4zq92Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEae -ZAwUswdbxcJzbPEHXEUkFDWug/FqTYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAP -BgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz4SsrSbbXc6GqlPUB53NlTKxQ -MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU9QHnc2VMrFAw -RAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv -bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWIm -fQwng4/F9tqgaHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3 -gvoFNTPhNahXwOf9jU8/kzJPeGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKe -I6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1PwkzQSulgUV1qzOMPPKC8W64iLgpq0i -5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1ThCojz2GuHURwCRi -ipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oIKiMn -MCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZ -o5NjEFIqnxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6 -zqylfDJKZ0DcMDQj3dcEI2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacN -GHk0vFQYXlPKNFHtRQrmjseCNj6nOGOpMCwXEGCSn1WHElkQwg9naRHMTh5+Spqt -r0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3otkYNbn5XOmeUwssfnHdK -Z05phkOTOPu220+DkdRgfks+KzgHVZhepA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsx -CzAJBgNVBAYTAkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRp -ZmljYWNpw7NuIERpZ2l0YWwgLSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwa -QUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4wHhcNMDYxMTI3MjA0NjI5WhcNMzAw -NDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+U29jaWVkYWQgQ2Ft -ZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJhIFMu -QS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkq -hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeG -qentLhM0R7LQcNzJPNCNyu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzL -fDe3fezTf3MZsGqy2IiKLUV0qPezuMDU2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQ -Y5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU34ojC2I+GdV75LaeHM/J4 -Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP2yYe68yQ -54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+b -MMCm8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48j -ilSH5L887uvDdUhfHjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++Ej -YfDIJss2yKHzMI+ko6Kh3VOz3vCaMh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/zt -A/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK5lw1omdMEWux+IBkAC1vImHF -rEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1bczwmPS9KvqfJ -pxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE -AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCB -lTCBkgYEVR0gADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFy -YS5jb20vZHBjLzBaBggrBgEFBQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW50 -7WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2UgcHVlZGVuIGVuY29udHJhciBlbiBs -YSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEfAygPU3zmpFmps4p6 -xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuXEpBc -unvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/ -Jre7Ir5v/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dp -ezy4ydV/NgIlqmjCMRW3MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42 -gzmRkBDI8ck1fj+404HGIGQatlDCIaR43NAvO2STdPCWkPHv+wlaNECW8DYSwaN0 -jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wkeZBWN7PGKX6jD/EpOe9+ -XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f/RWmnkJD -W2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/ -RL5hRqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35r -MDOhYil/SrnhLecUIw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxk -BYn8eNZcLCZDqQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE -BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w -MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 -IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC -SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1 -ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv -UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX -4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9 -KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/ -gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb -rxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ -51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F -be8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe -KF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F -v6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn -fpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7 -jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz -ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt -ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL -e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70 -jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz -WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V -SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j -pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX -X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok -fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R -K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU -ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU -LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT -LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs -IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 -MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux -FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h -bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v -dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt -H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 -uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX -mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX -a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN -E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 -WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD -VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 -Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU -cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx -IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN -AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH -YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 -6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC -Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX -c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a -mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 -b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw -MTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD -VQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul -CDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n -tGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl -dI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch -PXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC -+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O -BBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E -BTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl -MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk -ZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB -IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X -7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz -43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY -eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl -pz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA -WiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 -b3JrMSAwHgYDVQQDExdBZGRUcnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAx -MDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtB -ZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIDAeBgNV -BAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV -6tsfSlbunyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nX -GCwwfQ56HmIexkvA/X1id9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnP -dzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSGAa2Il+tmzV7R/9x98oTaunet3IAIx6eH -1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAwHM+A+WD+eeSI8t0A65RF -62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0GA1UdDgQW -BBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUw -AwEB/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDEL -MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRU -cnVzdCBUVFAgTmV0d29yazEgMB4GA1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJv -b3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4JNojVhaTdt02KLmuG7jD8WS6 -IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL+YPoRNWyQSW/ -iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao -GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh -4SINhwBk/ox9Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQm -XiLsks3/QppEIW1cxeMiHV9HEufOX1362KqxMy3ZdvJOOjMMK7MtkAY= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 -b3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1 -MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK -EwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh -BgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq -xBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G -87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i -2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U -WfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1 -0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G -A1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T -AQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr -pGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL -ExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm -aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv -hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm -hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X -dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3 -P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y -iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no -xqE= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE -BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz -dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL -MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp -cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP -Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr -ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL -MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 -yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr -VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ -nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ -KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG -XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj -vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt -Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g -N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC -nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE -BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz -dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL -MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp -cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y -YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua -kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL -QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp -6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG -yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i -QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ -KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO -tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu -QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ -Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u -olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 -x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE -BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz -dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG -A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U -cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf -qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ -JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ -+jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS -s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 -HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 -70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG -V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S -qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S -5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia -C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX -OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE -FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ -BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 -KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg -Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B -8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ -MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc -0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ -u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF -u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH -YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 -GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO -RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e -KeC2uAloGRwYQw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC -VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ -cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ -BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt -VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D -0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9 -ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G -A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G -A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs -aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I -flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP -bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2 -MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft -ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk -hsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym -1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW -OqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb -2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP8c9GsEsPPt2IYriMqQko -O3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAU -AK3Zo/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB -BQUAA4IBAQB8itEfGDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkF -Zu90821fnZmv9ov761KyBZiibyrFVL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAb -LjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft3OJvx8Fi8eNy1gTIdGcL+oir -oQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43gKd8hdIaC2y+C -MMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds -sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP -bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2 -MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft -ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP -ADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC -206B89enfHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFci -KtZHgVdEglZTvYYUAQv8f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2 -JxhP7JsowtS013wMPgwr38oE18aO6lhOqKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9 -BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JNRvCAOVIyD+OEsnpD8l7e -Xz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0gBe4lL8B -PeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67 -Xnfn6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEq -Z8A9W6Wa6897GqidFEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZ -o2C7HK2JNDJiuEMhBnIMoVxtRsX6Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3 -+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnjB453cMor9H124HhnAgMBAAGj -YzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3OpaaEg5+31IqEj -FNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE -AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmn -xPBUlgtk87FYT15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2 -LHo1YGwRgJfMqZJS5ivmae2p+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzccc -obGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXgJXUjhx5c3LqdsKyzadsXg8n33gy8 -CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//ZoyzH1kUQ7rVyZ2OuMe -IjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgOZtMA -DjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2F -AjgQ5ANh1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUX -Om/9riW99XJZZLF0KjhfGEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPb -AZO1XB4Y3WRayhgoPmMEEf0cjQAPuDffZ4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQl -Zvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuPcX/9XhmgD0uRuMRUvAaw -RY8mkaKO/qk= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEc -MBoGA1UEChMTSmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRp -b25DQTAeFw0wNzEyMTIxNTAwMDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYT -AkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zlcm5tZW50MRYwFAYDVQQLEw1BcHBs -aWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp23gdE6H -j6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4fl+K -f5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55 -IrmTwcrNwVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cw -FO5cjFW6WY2H/CPek9AEjP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDiht -QWEjdnjDuGWk81quzMKq2edY3rZ+nYVunyoKb58DKTCXKB28t89UKU5RMfkntigm -/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRUWssmP3HMlEYNllPqa0jQ -k/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNVBAYTAkpQ -MRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOC -seODvOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD -ggEBADlqRHZ3ODrso2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJ -hyzjVOGjprIIC8CFqMjSnHH2HZ9g/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+ -eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYDio+nEhEMy/0/ecGc/WLuo89U -DNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmWdupwX3kSa+Sj -B1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL -rosot4LKGAfmt1t06SAZf7IbiVQ= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UE -AwwVQXRvcyBUcnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQG -EwJERTAeFw0xMTA3MDcxNDU4MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMM -FUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsGA1UECgwEQXRvczELMAkGA1UEBhMC -REUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCVhTuXbyo7LjvPpvMp -Nb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr54rM -VD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+ -SZFhyBH+DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ -4J7sVaE3IqKHBAUsR320HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0L -cp2AMBYHlT8oDv3FdU9T1nSatCQujgKRz3bFmx5VdJx4IbHwLfELn8LVlhgf8FQi -eowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7Rl+lwrrw7GWzbITAPBgNV -HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZbNshMBgG -A1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3 -DQEBCwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8j -vZfza1zv7v1Apt+hk6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kP -DpFrdRbhIfzYJsdHt6bPWHJxfrrhTZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pc -maHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a961qn8FYiqTxlVMYVqL2Gns2D -lmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G3mB/ufNPRJLv -KrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UE -BhMCRVMxQjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1h -cHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEy -MzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUg -Q2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBBNjI2MzQwNjgwggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDDUtd9 -thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQM -cas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefG -L9ItWY16Ck6WaVICqjaY7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15i -NA9wBj4gGFrO93IbJWyTdBSTo3OxDqqHECNZXyAFGUftaI6SEspd/NYrspI8IM/h -X68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyIplD9amML9ZMWGxmPsu2b -m8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctXMbScyJCy -Z/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirja -EbsXLZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/T -KI8xWVvTyQKmtFLKbpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF -6NkBiDkal4ZkQdU7hwxu+g/GvUgUvzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVh -OSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYD -VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNHDhpkLzCBpgYD -VR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp -cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBv -ACAAZABlACAAbABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBl -AGwAbwBuAGEAIAAwADgAMAAxADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF -661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx51tkljYyGOylMnfX40S2wBEqgLk9 -am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qkR71kMrv2JYSiJ0L1 -ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaPT481 -PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS -3a/DTg4fJl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k -SeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF -3dvd6qJ2gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVM -ZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g -StRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz -Q0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB -jLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ -RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD -VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX -DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y -ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy -VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr -mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr -IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK -mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu -XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy -dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye -jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 -BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 -DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 -9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx -jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 -Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz -ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS -R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEd -MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3Mg -Q2xhc3MgMiBDQSAxMB4XDTA2MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzEL -MAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MR0wGwYD -VQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7McXA0 -ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLX -l18xoS830r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVB -HfCuuCkslFJgNJQ72uA40Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B -5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/RuFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3 -WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNCMEAwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0PAQH/BAQD -AgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLP -gcIV1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+ -DKhQ7SLHrQVMdvvt7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKu -BctN518fV4bVIJwo+28TOPX2EZL2fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHs -h7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5wwDX3OaJdZtB7WZ+oRxKaJyOk -LY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd -MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg -Q2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow -TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw -HgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB -BQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr -6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPV -L4O2fuPn9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC91 -1K2GScuVr1QGbNgGE41b/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHx -MlAQTn/0hpPshNOOvEu/XAFOBz3cFIqUCqTqc/sLUegTBxj6DvEr0VQVfTzh97QZ -QmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeffawrbD02TTqigzXsu8lkB -arcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgIzRFo1clr -Us3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLi -FRhnBkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRS -P/TizPJhk9H9Z2vXUq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN -9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP -AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz -uvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h -9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s -A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t -OluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo -+fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7 -KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2 -DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us -H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ -I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7 -5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h -3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz -Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEd -MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3Mg -Q2xhc3MgMyBDQSAxMB4XDTA1MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzEL -MAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MR0wGwYD -VQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKxifZg -isRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//z -NIqeKNc0n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI -+MkcVyzwPX6UvCWThOiaAJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2R -hzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+ -mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNCMEAwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0PAQH/BAQD -AgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFP -Bdy7pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27s -EzNxZy5p+qksP2bAEllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2 -mSlf56oBzKwzqBwKu5HEA6BvtjT5htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yC -e/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQjel/wroQk5PMr+4okoyeYZdow -dXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd -MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg -Q2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow -TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw -HgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB -BQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRHsJ8Y -ZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3E -N3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9 -tznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX -0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c -/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8X -KhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTY -zIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvS -O1UQRwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D -34xFMFbG02SrZvPAXpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgP -K9Dx2hzLabjKSWJtyNBjYt1gD1iqj6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3 -AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEe4zf/lb+74suwv -Tg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAACAj -QTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV -cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXS -IGrs/CIBKM+GuIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2 -HJLw5QY33KbmkJs4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa -O5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv -033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u -dmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE -kbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41 -3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD -u79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq -4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzET -MBEGA1UEBxMKQnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UE -AxMIQ0EgRGlzaWcwHhcNMDYwMzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQsw -CQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcg -YS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgmGErE -Nx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnX -mjxUizkDPw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYD -XcDtab86wYqg6I7ZuUUohwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhW -S8+2rT+MitcE5eN4TPWGqvWP+j1scaMtymfraHtuM6kMgiioTGohQBUgDCZbg8Kp -FhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8wgfwwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0PAQH/BAQD -AgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cu -ZGlzaWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5z -ay9jYS9jcmwvY2FfZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2sv -Y2EvY3JsL2NhX2Rpc2lnLmNybDAaBgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEw -DQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59tWDYcPQuBDRIrRhCA/ec8J9B6 -yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3mkkp7M5+cTxq -EEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ -CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeB -EicTXxChds6KezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFN -PGO+I++MzVpQuGhU+QqZMxEA4Z7CRneC9VkGjCFMhwnN5ag= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNV -BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu -MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQy -MDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx -EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjEw -ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy3QRk -D2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/o -OI7bm+V8u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3A -fQ+lekLZWnDZv6fXARz2m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJe -IgpFy4QxTaz+29FHuvlglzmxZcfe+5nkCiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8n -oc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTaYVKvJrT1cU/J19IG32PK -/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6vpmumwKj -rckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD -3AjLLhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE -7cderVC6xkGbrPAXZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkC -yC2fg69naQanMVXVz0tv/wQFx1isXxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLd -qvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud -DwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ04IwDQYJKoZI -hvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR -xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaA -SfX8MPWbTx9BLxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXo -HqJPYNcHKfyyo6SdbhWSVhlMCrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpB -emOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5GfbVSUZP/3oNn6z4eGBrxEWi1CXYBmC -AMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85YmLLW1AL14FABZyb -7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKSds+x -DzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvk -F7mGnjixlAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqF -a3qdnom2piiZk4hA9z7NUaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsT -Q6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJa7+h89n07eLw4+1knj0vllJPgFOL ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV -BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu -MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy -MDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx -EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjIw -ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbCw3Oe -NcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNH -PWSb6WiaxswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3I -x2ymrdMxp7zo5eFm1tL7A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbe -QTg06ov80egEFGEtQX6sx3dOy1FU+16SGBsEWmjGycT6txOgmLcRK7fWV8x8nhfR -yyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqVg8NTEQxzHQuyRpDRQjrO -QG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa5Beny912 -H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJ -QfYEkoopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUD -i/ZnWejBBhG93c+AAk9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORs -nLMOPReisjQS1n6yqEm70XooQL6iFh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1 -rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud -DwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5uQu0wDQYJKoZI -hvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM -tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqf -GopTpti72TVVsRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkb -lvdhuDvEK7Z4bLQjb/D907JedR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka -+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W81k/BfDxujRNt+3vrMNDcTa/F1bal -TFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjxmHHEt38OFdAlab0i -nSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01utI3 -gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18Dr -G5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os -zMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8x -L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJD -TjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2 -MDcwOTE0WhcNMjcwNDE2MDcwOTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMF -Q05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzDo+/hn7E7SIX1mlwh -IhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tizVHa6 -dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZO -V/kbZKKTVrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrC -GHn2emU1z5DrvTOTn1OrczvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gN -v7Sg2Ca+I19zN38m5pIEo3/PIKe38zrKy5nLAgMBAAGjczBxMBEGCWCGSAGG+EIB -AQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscCwQ7vptU7ETAPBgNVHRMB -Af8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991SlgrHAsEO -76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnK -OOK5Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvH -ugDnuL8BV8F3RTIMO/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7Hgvi -yJA/qIYM/PmLXoXLT1tLYhFHxUV8BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fL -buXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2G8kS1sHNzYDzAgE8yGnLRUhj -2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5mmxE= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB -gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV -BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw -MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl -YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P -RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3 -UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI -2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8 -Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp -+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+ -DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O -nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW -/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g -PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u -QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY -SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv -IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ -RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4 -zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd -BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB -ZQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL -MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE -BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT -IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw -MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy -ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N -T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR -FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J -cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW -BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm -fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv -GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEn -MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL -ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMg -b2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAxNjEzNDNaFw0zNzA5MzAxNjEzNDRa -MH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZpcm1hIFNBIENJRiBB -ODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3JnMSIw -IAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0B -AQEFAAOCAQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtb -unXF/KGIJPov7coISjlUxFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0d -BmpAPrMMhe5cG3nCYsS4No41XQEMIwRHNaqbYE6gZj3LJgqcQKH0XZi/caulAGgq -7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jWDA+wWFjbw2Y3npuRVDM3 -0pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFVd9oKDMyX -roDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIG -A1UdEwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5j -aGFtYmVyc2lnbi5vcmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p -26EpW1eLTXYGduHRooowDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIA -BzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hhbWJlcnNpZ24ub3JnMCcGA1Ud -EgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYDVR0gBFEwTzBN -BgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz -aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEB -AAxBl8IahsAifJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZd -p0AJPaxJRUXcLo0waLIJuvvDL8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi -1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wNUPf6s+xCX6ndbcj0dc97wXImsQEc -XCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/nADydb47kMgkdTXg0 -eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1erfu -tGWaIZDgqtCYvDi1czyL+Nw= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEn -MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL -ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENo -YW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYxNDE4WhcNMzcwOTMwMTYxNDE4WjB9 -MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgy -NzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4G -A1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUA -A4IBDQAwggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0 -Mi+ITaFgCPS3CU6gSS9J1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/s -QJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8Oby4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpV -eAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl6DJWk0aJqCWKZQbua795 -B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c8lCrEqWh -z0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0T -AQH/BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1i -ZXJzaWduLm9yZy9jaGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4w -TcbOX60Qq+UDpfqpFDAOBgNVHQ8BAf8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAH -MCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBjaGFtYmVyc2lnbi5vcmcwKgYD -VR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9yZzBbBgNVHSAE -VDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh -bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0B -AQUFAAOCAQEAPDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUM -bKGKfKX0j//U2K0X1S0E0T9YgOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXi -ryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJPJ7oKXqJ1/6v/2j1pReQvayZzKWG -VwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4IBHNfTIzSJRUTN3c -ecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREest2d/ -AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV -BAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X -DTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ -BgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4 -QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyHGxny -gQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbw -zBfsV1/pogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q -130yGLMLLGq/jj8UEYkgDncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2 -JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKfIrjxwo1p3Po6WAbfAgMBAAGjgbwwgbkw -DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQtCRZvgHyUtVF9lo53BEw -ZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJBgNVBAYT -AkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzj -AQ/JSP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG -9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h -bV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc -fca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu -HWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w -t0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw -WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjET -MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAk -BgNVBAMMHUNlcnRpbm9taXMgLSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4 -Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkGA1UEBhMCRlIxEzARBgNVBAoTCkNl -cnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYwJAYDVQQDDB1DZXJ0 -aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQADggIP -ADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jY -F1AMnmHawE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N -8y4oH3DfVS9O7cdxbwlyLu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWe -rP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K -/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92NjMD2AR5vpTESOH2VwnHu -7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9qc1pkIuVC -28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6 -lSTClrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1E -nn1So2+WLhl+HPNbxxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB -0iSVL1N6aaLwD4ZFjliCK0wi1F6g530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql09 -5gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna4NH4+ej9Uji29YnfAgMBAAGj -WzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQN -jLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ -KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9s -ov3/4gbIOZ/xWqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZM -OH8oMDX/nyNTt7buFHAAQCvaR6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q -619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40nJ+U8/aGH88bc62UeYdocMMzpXDn -2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1BCxMjidPJC+iKunqj -o3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjvJL1v -nxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG -5ERQL1TEqkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWq -pdEdnV1j6CTmNhTih60bWfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZb -dsLLO7XSAPCjDuGtbkD326C00EauFddEwk01+dIL8hf2rGbVJLJP0RyZwG71fet0 -BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/vgt2Fl43N+bYdJeimUV5 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAw -PTELMAkGA1UEBhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFz -cyAyIFByaW1hcnkgQ0EwHhcNOTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9 -MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2VydHBsdXMxGzAZBgNVBAMTEkNsYXNz -IDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANxQ -ltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR5aiR -VhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyL -kcAbmXuZVg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCd -EgETjdyAYveVqUSISnFOYFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yas -H7WLO7dDWWuwJKZtkIvEcupdM5i3y95ee++U8Rs+yskhwcWYAqqi9lt3m/V+llU0 -HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRMECDAGAQH/AgEKMAsGA1Ud -DwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJYIZIAYb4 -QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMu -Y29tL0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/ -AN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8 -yfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMR -FcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW2ikbhiMA -ybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB -kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 -l7+ijrRU ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM -MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD -QTAeFw0wMjA2MTExMDQ2MzlaFw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBM -MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD -QTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6xwS7TT3zNJc4YPk/E -jG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdLkKWo -ePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GI -ULdtlkIJ89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapu -Ob7kky/ZR6By6/qmW6/KUz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUg -AKpoC6EahQGcxEZjgoi2IrHu/qpGWX7PNSzVttpd90gzFFS269lvzs2I1qsb2pY7 -HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA -uI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa -TOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg -xSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q -CjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x -O/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs -6GAqm4VKQPNriiTsBhYscw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM -MSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D -ZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU -cnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIyMTIwNzM3WhcNMjkxMjMxMTIwNzM3 -WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMg -Uy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSIw -IAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rH -UV+rpDKmYYe2bg+G0jACl/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LM -TXPb865Px1bVWqeWifrzq2jUI4ZZJ88JJ7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVU -BBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4fOQtf/WsX+sWn7Et0brM -kUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0cvW0QM8x -AcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNV -HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15y -sHhE49wcrwn9I0j6vSrEuVUEtRCjjSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfL -I9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv94nYmem8 -J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY -VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI -03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD -VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 -IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 -MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJz -IG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDcz -MTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBj -dXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIw -EAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEp -MCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0G -CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW9 -28sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKAXuFixrYp4YFs8r/lfTJq -VKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorjh40G072Q -DuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR -5gN/ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfL -ZEFHcpOrUMPrCXZkNNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05a -Sd+pZgvMPMZ4fKecHePOjlO+Bd5gD2vlGts/4+EhySnB8esHnFIbAURRPHsl18Tl -UlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331lubKgdaX8ZSD6e2wsWsSaR6s -+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ0wlf2eOKNcx5 -Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj -ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAx -hduub+84Mxh2EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNV -HQ4EFgQU+SSsD7K1+HnA+mCIG8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1 -+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpN -YWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29t -L2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVy -ZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAt -IDIwMDiCCQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRV -HSAAMCowKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20w -DQYJKoZIhvcNAQEFBQADggIBAJASryI1wqM58C7e6bXpeHxIvj99RZJe6dqxGfwW -PJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH3qLPaYRgM+gQDROpI9CF -5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbURWpGqOt1 -glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaH -FoI6M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2 -pSB7+R5KBWIBpih1YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MD -xvbxrN8y8NmBGuScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG -tjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq -jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De -fhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg -OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ -d0jQ ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC -Q04xMjAwBgNVBAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24g -Q2VudGVyMUcwRQYDVQQDDD5DaGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0 -aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMgUm9vdDAeFw0xMDA4MzEwNzExMjVa -Fw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAGA1UECgwpQ2hpbmEg -SW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMMPkNo -aW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRp -ZmljYXRlcyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z -7r07eKpkQ0H1UN+U8i6yjUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA// -DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV98YPjUesWgbdYavi7NifFy2cyjw1l1Vx -zUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2HklY0bBoQCxfVWhyXWIQ8 -hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23KzhmBsUs -4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54u -gQEC7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oY -NJKiyoOCWTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4E -FgQUfHJLOcfA22KlT5uqGDSSosqDglkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3 -j92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd50XPFtQO3WKwMVC/GVhMPMdoG -52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM7+czV0I664zB -echNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws -ZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrI -zo9uoV1/A3U05K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATy -wy39FCqQmbkHzJ8= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDkzCCAnugAwIBAgIQFBOWgxRVjOp7Y+X8NId3RDANBgkqhkiG9w0BAQUFADA0 -MRMwEQYDVQQDEwpDb21TaWduIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQG -EwJJTDAeFw0wNDAzMjQxMTMyMThaFw0yOTAzMTkxNTAyMThaMDQxEzARBgNVBAMT -CkNvbVNpZ24gQ0ExEDAOBgNVBAoTB0NvbVNpZ24xCzAJBgNVBAYTAklMMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8ORUaSvTx49qROR+WCf4C9DklBKK -8Rs4OC8fMZwG1Cyn3gsqrhqg455qv588x26i+YtkbDqthVVRVKU4VbirgwTyP2Q2 -98CNQ0NqZtH3FyrV7zb6MBBC11PN+fozc0yz6YQgitZBJzXkOPqUm7h65HkfM/sb -2CEJKHxNGGleZIp6GZPKfuzzcuc3B1hZKKxC+cX/zT/npfo4sdAMx9lSGlPWgcxC -ejVb7Us6eva1jsz/D3zkYDaHL63woSV9/9JLEYhwVKZBqGdTUkJe5DSe5L6j7Kpi -Xd3DTKaCQeQzC6zJMw9kglcq/QytNuEMrkvF7zuZ2SOzW120V+x0cAwqTwIDAQAB -o4GgMIGdMAwGA1UdEwQFMAMBAf8wPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDovL2Zl -ZGlyLmNvbXNpZ24uY28uaWwvY3JsL0NvbVNpZ25DQS5jcmwwDgYDVR0PAQH/BAQD -AgGGMB8GA1UdIwQYMBaAFEsBmz5WGmU2dst7l6qSBe4y5ygxMB0GA1UdDgQWBBRL -AZs+VhplNnbLe5eqkgXuMucoMTANBgkqhkiG9w0BAQUFAAOCAQEA0Nmlfv4pYEWd -foPPbrxHbvUanlR2QnG0PFg/LUAlQvaBnPGJEMgOqnhPOAlXsDzACPw1jvFIUY0M -cXS6hMTXcpuEfDhOZAYnKuGntewImbQKDdSFc8gS4TXt8QUxHXOZDOuWyt3T5oWq -8Ir7dcHyCTxlZWTzTNity4hp8+SDtwy9F1qWF8pb/627HOkthIDYIb6FUtnUdLlp -hbpN7Sgy6/lhSuTENh4Z3G+EER+V9YMoGKgzkkMn3V0TBEVPh9VGzT2ouvDzuFYk -Res3x+F2T3I5GN9+dHLHcy056mDmrRGiVod7w2ia/viMcKjfZTL0pECMocJEAw6U -AGegcQCCSA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAw -PDEbMBkGA1UEAxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWdu -MQswCQYDVQQGEwJJTDAeFw0wNDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwx -GzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBDQTEQMA4GA1UEChMHQ29tU2lnbjEL -MAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGtWhf -HZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs49oh -gHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sW -v+bznkqH7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ue -Mv5WJDmyVIRD9YTC2LxBkMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr -9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d19guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt -6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUwAwEB/zBEBgNVHR8EPTA7 -MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29tU2lnblNl -Y3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58 -ADsAj8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkq -hkiG9w0BAQUFAAOCAQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7p -iL1DRYHjZiM/EoZNGeQFsOY3wo3aBijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtC -dsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtpFhpFfTMDZflScZAmlaxMDPWL -kz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP51qJThRv4zdL -hfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz -OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj -YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL -MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE -BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM -GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua -BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe -3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 -YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR -rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm -ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU -oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF -MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v -QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t -b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF -AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q -GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 -G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi -l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 -smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRp -ZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVow -fjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAiBgNV -BAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPM -cm3ye5drswfxdySRXyWP9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3S -HpR7LZQdqnXXs5jLrLxkU0C8j6ysNstcrbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996 -CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rCoznl2yY4rYsK7hljxxwk -3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3Vp6ea5EQz -6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNV -HQ4EFgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1Ud -EwEB/wQFMAMBAf8wgYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2Rv -Y2EuY29tL1NlY3VyZUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRw -Oi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmww -DQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm4J4oqF7Tt/Q0 -5qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj -Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtI -gKvcnDe4IRRLDXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJ -aD61JlfutuC23bkpgHl9j6PwpCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDl -izeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1HRR3B7Hzs/Sk= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0 -aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEwMDAwMDBaFw0yODEyMzEyMzU5NTla -MH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO -BgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUwIwYD -VQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWW -fnJSoBVC21ndZHoa0Lh73TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMt -TGo87IvDktJTdyR0nAducPy9C1t2ul/y/9c3S0pgePfw+spwtOpZqqPOSC+pw7IL -fhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6juljatEPmsbS9Is6FARW -1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsSivnkBbA7 -kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0G -A1UdDgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYD -VR0TAQH/BAUwAwEB/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21v -ZG9jYS5jb20vVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRo -dHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMu -Y3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8NtwuleGFTQQuS9/ -HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 -pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxIS -jBc/lDb+XbDABHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+ -xqFx7D+gIIxmOom0jtTYsU0lR+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/Atyjcn -dBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O9y5Xt5hwXsjEeLBi ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG -A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh -bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE -ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS -b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5 -7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS -J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y -HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP -t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz -FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY -XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/ -MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw -hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js -MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA -A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj -Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx -XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o -omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc -A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW -WL1WMRJOEcgh4LMRkWXbtKaIOM5V ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF -MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD -bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha -ME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM -HkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03 -UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42 -tSHKXzlABF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9R -ySPocq60vFYJfxLLHLGvKZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsM -lFqVlNpQmvH/pStmMaTJOKDfHR+4CS7zp+hnUquVH+BGPtikw8paxTGA6Eian5Rp -/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUCAwEAAaOCARowggEWMA8G -A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ4PGEMA4G -A1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVj -dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUy -MENBJTIwMiUyMDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl -cmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js -L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL -BQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni -acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 -o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K -zCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8 -PIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y -Johw1+qRzT65ysCQblrGXnRl11z+o+I= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF -MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD -bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw -NDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV -BAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn -ljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0 -3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z -qQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR -p75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8 -HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw -ggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea -HNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw -Oi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh -c3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E -RT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt -dHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku -Y3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp -3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 -nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF -CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na -xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX -KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBb -MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3Qx -ETAPBgNVBAsTCERTVCBBQ0VTMRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0w -MzExMjAyMTE5NThaFw0xNzExMjAyMTE5NThaMFsxCzAJBgNVBAYTAlVTMSAwHgYD -VQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UECxMIRFNUIEFDRVMx -FzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPu -ktKe1jzIDZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7 -gLFViYsx+tC3dr5BPTCapCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZH -fAjIgrrep4c9oW24MFbCswKBXy314powGCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4a -ahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPyMjwmR/onJALJfh1biEIT -ajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1UdEwEB/wQF -MAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rk -c3QuY29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjto -dHRwOi8vd3d3LnRydXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMt -aW5kZXguaHRtbDAdBgNVHQ4EFgQUCXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZI -hvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V25FYrnJmQ6AgwbN99Pe7lv7Uk -QIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6tFr8hlxCBPeP/ -h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq -nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpR -rscL9yuwNwXsvFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf2 -9w4LTJxoeHtxMcfrHuBnQfO3oKfN5XozNmr6mis= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ -MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT -DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow -PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD -Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O -rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq -OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b -xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw -7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD -aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG -SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 -ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr -AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz -R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 -JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo -Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc -MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj -IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB -IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE -RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl -U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290 -IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU -ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC -QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr -rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S -NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc -QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH -txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP -BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC -AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp -tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa -IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl -6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+ -xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU -Cm26OWMohpLzGITY+9HPBVZkVw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv -b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl -cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c -JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP -mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+ -wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4 -VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/ -AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB -AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW -BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun -pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC -dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf -fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm -NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx -H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe -+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD -QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT -MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j -b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB -CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 -nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt -43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P -T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 -gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO -BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR -TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw -DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr -hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg -06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF -PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls -YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk -CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j -ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL -MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 -LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug -RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm -+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW -PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM -xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB -Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 -hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg -EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF -MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA -FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec -nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z -eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF -hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 -Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe -vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep -+OkuE6N36B9K ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV -UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL -EwhEU1RDQSBFMTAeFw05ODEyMTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJ -BgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x -ETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCg -bIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJENySZ -j9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlV -Sn5JTe2io74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCG -SAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx -JDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI -RFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMTAxODEw -MjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFGp5 -fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i -+DAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG -SIb3DQEBBQUAA4GBACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lN -QseSJqBcNJo4cvj9axY+IO6CizEqkzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+ -gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4RbyhkwS7hp86W0N6w4pl ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV -UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL -EwhEU1RDQSBFMjAeFw05ODEyMDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJ -BgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x -ETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQC/ -k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGODVvso -LeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3o -TQPMx7JSxhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCG -SAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx -JDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI -RFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMDkxOTE3 -MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFB6C -TShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5 -WzAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG -SIb3DQEBBQUAA4GBAEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHR -xdf0CiUPPXiBng+xZ8SQTGPdXqfiup/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVL -B3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1mPnHfxsb1gYgAlihw6ID ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1 -MQswCQYDVQQGEwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxp -Z2kgQS5TLjE8MDoGA1UEAxMzZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZp -a2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3MDEwNDExMzI0OFoXDTE3MDEwNDEx -MzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0cm9uaWsgQmlsZ2kg -R3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9uaWsg -U2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdU -MZTe1RK6UxYC6lhj71vY8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlT -L/jDj/6z/P2douNffb7tC+Bg62nsM+3YjfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H -5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAIJjjcJRFHLfO6IxClv7wC -90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk9Ok0oSy1 -c+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/ -BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoE -VtstxNulMA0GCSqGSIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLP -qk/CaOv/gKlR6D1id4k9CnU58W5dF4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S -/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwqD2fK/A+JYZ1lpTzlvBNbCNvj -/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4Vwpm+Vganf2X -KWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq -fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNV -BAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBC -aWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNV -BAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQDDB9FLVR1 -Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMwNTEyMDk0OFoXDTIz -MDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+ -BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhp -em1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN -ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4vU/kwVRHoViVF56C/UY -B4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vdhQd2h8y/L5VMzH2nPbxH -D5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5KCKpbknSF -Q9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEo -q1+gElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3D -k14opz8n8Y4e0ypQBaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcH -fC425lAcP9tDJMW/hkd5s3kc91r0E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsut -dEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gzrt48Ue7LE3wBf4QOXVGUnhMM -ti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAqjqFGOjGY5RH8 -zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn -rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUX -U8u3Zg5mTPj5dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6 -Jyr+zE7S6E5UMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5 -XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAF -Nzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAKkEh47U6YA5n+KGCR -HTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jOXKqY -GwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c -77NCR807VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3 -+GbHeJAAFS6LrVE1Uweoa2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WK -vJUawSg5TB9D0pH0clmKuVb8P7Sd2nCcdlqMQ1DujjByTd//SffGqWfZbawCEeI6 -FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEVKV0jq9BgoRJP3vQXzTLl -yb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gTDx4JnW2P -AJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpD -y4Q08ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8d -NL/+I5c30jn6PQ0GC7TbO6Orb1wdtn7os4I07QZcJA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNV -BAMML0VCRyBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx -c8SxMTcwNQYDVQQKDC5FQkcgQmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXpt -ZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAeFw0wNjA4MTcwMDIxMDlaFw0xNjA4 -MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25payBTZXJ0aWZpa2Eg -SGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2ltIFRl -a25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h -4fuXd7hxlugTlkaDT7byX3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAk -tiHq6yOU/im/+4mRDGSaBUorzAzu8T2bgmmkTPiab+ci2hC6X5L8GCcKqKpE+i4s -tPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfreYteIAbTdgtsApWjluTL -dlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZTqNGFav4 -c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8Um -TDGyY5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z -+kI2sSXFCjEmN1ZnuqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0O -Lna9XvNRiYuoP1Vzv9s6xiQFlpJIqkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMW -OeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vmExH8nYQKE3vwO9D8owrXieqW -fo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0Nokb+Clsi7n2 -l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB -/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgw -FoAU587GT/wWZ5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+ -8ygjdsZs93/mQJ7ANtyVDR2tFcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI -6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgmzJNSroIBk5DKd8pNSe/iWtkqvTDO -TLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64kXPBfrAowzIpAoHME -wfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqTbCmY -Iai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJn -xk1Gj7sURT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4Q -DgZxGhBM/nV+/x5XOULK1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9q -Kd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11t -hie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQY9iJSrSq3RZj9W6+YKH4 -7ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9AahH3eU7 -QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB -8zELMAkGA1UEBhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2Vy -dGlmaWNhY2lvIChOSUYgUS0wODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1 -YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYDVQQLEyxWZWdldSBodHRwczovL3d3 -dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UECxMsSmVyYXJxdWlh -IEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMTBkVD -LUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQG -EwJFUzE7MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8g -KE5JRiBRLTA4MDExNzYtSSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBD -ZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZlZ2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQu -bmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJhcnF1aWEgRW50aXRhdHMg -ZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUNDMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R -85iKw5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm -4CgPukLjbo73FCeTae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaV -HMf5NLWUhdWZXqBIoH7nF2W4onW4HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNd -QlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0aE9jD2z3Il3rucO2n5nzbcc8t -lGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw0JDnJwIDAQAB -o4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4 -opvpXY0wfwYDVR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBo -dHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidW -ZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAwDQYJKoZIhvcN -AQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJlF7W2u++AVtd0x7Y -/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNaAl6k -SBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhy -Rp/7SNVel+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOS -Agu+TGbrIP65y7WZf+a2E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xl -nJ2lYJU6Un/10asIbvPuW/mIPX64b24D5EI= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1 -MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1 -czEoMCYGA1UEAwwfRUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYG -CSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIwMTAxMDMwMTAxMDMwWhgPMjAzMDEy -MTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNl -ZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBS -b290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUy -euuOF0+W2Ap7kaJjbMeMTC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvO -bntl8jixwKIy72KyaOBhU8E2lf/slLo2rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIw -WFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw93X2PaRka9ZP585ArQ/d -MtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtNP2MbRMNE -1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYD -VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/ -zQas8fElyalL1BSZMEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYB -BQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEF -BQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+RjxY6hUFaTlrg4wCQiZrxTFGGV -v9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqMlIpPnTX/dqQG -E5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u -uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIW -iAYLtqZLICjU3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/v -GVCJYMzpJJUPwssd8m92kMfMdcGWxZ0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML -RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp -bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 -IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3 -MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 -LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp -YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG -A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq -K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe -sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX -MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT -XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ -HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH -4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV -HQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub -j1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo -U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf -zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b -u/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+ -bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er -fF6adulZkMV8gzURZVE= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC -VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u -ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc -KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u -ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1 -MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE -ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j -b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF -bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg -U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA -A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/ -I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3 -wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC -AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb -oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5 -BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p -dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk -MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp -b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu -dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0 -MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi -E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa -MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI -hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN -95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd -2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC -VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 -Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW -KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl -cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw -NTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw -NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy -ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV -BAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo -Nu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4 -4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9 -KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI -rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi -94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB -sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi -gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo -kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE -vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA -A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t -O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua -AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP -9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/ -eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m -0vdXcDazv/wor3ElhVsT/h5/WrQ8 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV -UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy -dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 -MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx -dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f -BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A -cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC -AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ -MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm -aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw -ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj -IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF -MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA -A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y -7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh -1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT -ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw -MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj -dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l -c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC -UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc -58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/ -o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH -MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr -aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA -A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA -Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv -8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT -ZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw -MDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j -LjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ -KoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo -RvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu -WqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw -Env+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD -AQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK -eDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM -zfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+ -WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN -/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD -VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv -bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv -b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV -UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU -cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds -b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH -iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS -r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4 -04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r -GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9 -3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P -lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i -YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg -R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 -9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq -fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv -iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU -1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ -bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW -MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA -ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l -uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn -Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS -tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF -PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un -hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV -5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEW -MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFs -IENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3Qg -R2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvPE1A -PRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/NTL8 -Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hL -TytCOb1kLUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL -5mkWRxHCJ1kDs6ZgwiFAVvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7 -S4wMcoKK+xfNAGw6EzywhIdLFnopsk/bHdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe -2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE -FHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNHK266ZUap -EBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6td -EPx7srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv -/NgdRN3ggX+d6YvhZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywN -A0ZF66D0f0hExghAzN4bcLUprbqLOzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0 -abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkCx1YAzUm5s2x7UwQa4qjJqhIF -I8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqFH4z1Ir+rzoPz -4iIprn2DQKi6bA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo -R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx -MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK -Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9 -AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA -ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0 -7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W -kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI -mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G -A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ -KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1 -6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl -4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K -oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj -UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU -AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL -MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj -KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 -MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV -BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw -NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV -BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH -MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL -So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal -tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO -BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG -CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT -qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz -rD6ogRLQy7rQkgu2npaqBA+K ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB -mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT -MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s -eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv -cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ -BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg -MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0 -BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz -+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm -hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn -5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W -JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL -DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC -huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw -HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB -AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB -zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN -kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD -AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH -SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G -spki4cErx5z481+oghLrGREt ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW -MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy -c2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE -BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0 -IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV -VaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8 -cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT -QjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFh -F7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v -c7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/w -mZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7VqnJNk22CDtucvc+081xd -VHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3CgaRr0BHdCX -teGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZ -f9hBZ3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfRe -Bi9Fi1jUIxaS5BZuKGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+ -nhutxx9z3SxPGWX9f5NAEC7S8O08ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB -/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY -MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG -9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc -aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX -IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn -ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z -uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN -Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja -QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW -koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9 -ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt -DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm -bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEW -MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVy -c2FsIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYD -VQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1 -c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0DE81 -WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUG -FF+3Qs17j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdq -XbboW0W63MOhBW9Wjo8QJqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxL -se4YuU6W3Nx2/zu+z18DwPw76L5GG//aQMJS9/7jOvdqdzXQ2o3rXhhqMcceujwb -KNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2WP0+GfPtDCapkzj4T8Fd -IgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP20gaXT73 -y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRt -hAAnZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgoc -QIgfksILAAX/8sgCSqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4 -Lt1ZrtmhN79UNdxzMk+MBB4zsslG8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAfBgNV -HSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8EBAMCAYYwDQYJ -KoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z -dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQ -L1EuxBRa3ugZ4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgr -Fg5fNuH8KrUwJM/gYwx7WBr+mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSo -ag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpqA1Ihn0CoZ1Dy81of398j9tx4TuaY -T1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpgY+RdM4kX2TGq2tbz -GDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiPpm8m -1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJV -OCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH -6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwX -QMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG -A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv -b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw -MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i -YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT -aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ -jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp -xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp -1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG -snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ -U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 -9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E -BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B -AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz -yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE -38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP -AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad -DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME -HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 -MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL -v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 -eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq -tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd -C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa -zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB -mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH -V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n -bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG -3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs -J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO -291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS -ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd -AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 -TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 -MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 -RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT -gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm -KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd -QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ -XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw -DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o -LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU -RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp -jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK -6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX -mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs -Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH -WD9f ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD -VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 -IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 -MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD -aGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx -MjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3Vy -cmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAG -A1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAl -BgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI -hvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xed -KYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7 -G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0ZJJ0YPP2 -zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4 -ddPB/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyG -HoiMvvKRhI9lNNgATH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2 -Id3UwD2ln58fQ1DJu7xsepeY7s2MH/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3V -yJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfeOx2YItaswTXbo6Al/3K1dh3e -beksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSFHTynyQbehP9r -6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh -wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsog -zCtLkykPAgMBAAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQW -BBS5CcqcHtvTbDprru1U8VuTBjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDpr -ru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UEBhMCRVUxQzBBBgNVBAcTOk1hZHJp -ZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJmaXJtYS5jb20vYWRk -cmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJmaXJt -YSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiC -CQDJzdPp1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCow -KAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZI -hvcNAQEFBQADggIBAICIf3DekijZBZRG/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZ -UohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXoz -X1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/x -fxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVz -a2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yyd -Yhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMd -SqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9O -AP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso -M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4ge -v8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z -09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh -MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE -YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3 -MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo -ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg -MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN -ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA -PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w -wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi -EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY -avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+ -YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE -sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h -/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5 -IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD -ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy -OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P -TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ -HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER -dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf -ReYNnyicsbkqWletNw+vHX/bvZ8= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx -EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT -EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp -ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz -NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH -EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE -AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD -E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH -/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy -DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh -GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR -tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA -AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE -FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX -WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu -9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr -gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo -2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO -LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI -4uJEvlz36hz1 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1Ix -RDBCBgNVBAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 -dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1p -YyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIw -NjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQK -EztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIENl -cnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl -c2VhcmNoIEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPz -dYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJ -fel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa71HFK9+WXesyHgLacEns -bgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u8yBRQlqD -75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSP -FEDH3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNV -HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp -5dgTBCPuQSUwRwYDVR0eBEAwPqA8MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQu -b3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQub3JnMA0GCSqGSIb3DQEBBQUA -A4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVtXdMiKahsog2p -6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 -TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7 -dIsXRSZMFpGD/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8Acys -Nnq/onN694/BtZqhFLKPM58N7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXI -l7WdmplNsDz4SgCbZN2fOUvRJ9e4 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsx -FjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3Qg -Um9vdCBDQSAxMB4XDTAzMDUxNTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkG -A1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdr -b25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1ApzQ -jVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEn -PzlTCeqrauh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjh -ZY4bXSNmO7ilMlHIhqqhqZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9 -nnV0ttgCXjqQesBCNnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/h -q5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgED -MA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsC -mEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI3 -7piol7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clB -oiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJs -EhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpO -fMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4JxHYB0yvbi -AmvZWg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYT -AkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQ -TS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG -9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMB4XDTAyMTIxMzE0MjkyM1oXDTIw -MTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAM -BgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEO -MAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2 -LmZyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaI -s9z4iPf930Pfeo2aSVz2TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2 -xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCWSo7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4 -u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYyHF2fYPepraX/z9E0+X1b -F8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNdfrGoRpAx -Vs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGd -PDPQtQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNV -HSAEDjAMMAoGCCqBegF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAx -NjAfBgNVHSMEGDAWgBSjBS8YYFDCiQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUF -AAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RKq89toB9RlPhJy3Q2FLwV3duJ -L92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3QMZsyK10XZZOY -YLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg -Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2a -NjSaTFR+FwNIlQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R -0982gaEbeC9xs/FZTEYYKKuF0mBWWg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4 -MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6 -ZW5wZS5jb20wHhcNMDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYD -VQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5j -b20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ03rKDx6sp4boFmVq -scIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAKClaO -xdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6H -LmYRY2xU+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFX -uaOKmMPsOzTFlUFpfnXCPCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQD -yCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxTOTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+ -JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbKF7jJeodWLBoBHmy+E60Q -rLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK0GqfvEyN -BjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8L -hij+0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIB -QFqNeb+Lz0vPqhbBleStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+ -HMh3/1uaD7euBUbl8agW7EekFwIDAQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2lu -Zm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+SVpFTlBFIFMuQS4gLSBDSUYg -QTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBGNjIgUzgxQzBB -BgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx -MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwHQYDVR0OBBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUA -A4ICAQB4pgwWSp9MiDrAyw6lFn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWb -laQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbgakEyrkgPH7UIBzg/YsfqikuFgba56 -awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8qhT/AQKM6WfxZSzwo -JNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Csg1lw -LDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCT -VyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk -LhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJb -UjWumDqtujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/ -QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+ -naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGls -QyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcN -AQkBFglwa2lAc2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZp -dHNlZXJpbWlza2Vza3VzMRAwDgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMw -MVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMQsw -CQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEQ -MA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOB -SvZiF3tfTQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkz -ABpTpyHhOEvWgxutr2TC+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvH -LCu3GFH+4Hv2qEivbDtPL+/40UceJlfwUR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMP -PbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDaTpxt4brNj3pssAki14sL -2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQFMAMBAf8w -ggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwIC -MIHDHoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDk -AGwAagBhAHMAdABhAHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0 -AHMAZQBlAHIAaQBtAGkAcwBrAGUAcwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABz -AGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABrAGkAbgBuAGkAdABhAG0AaQBz -AGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nwcy8wKwYDVR0f -BCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE -FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcY -P2/v6X2+MA4GA1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOi -CfP+JmeaUOTDBS8rNXiRTHyoERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+g -kcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyLabVAyJRld/JXIWY7zoVAtjNjGr95 -HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678IIbsSt4beDI3poHS -na9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkhMp6q -qIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0Z -TbvGRNs2yyqcjg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAw -cjELMAkGA1UEBhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNy -b3NlYyBMdGQuMRQwEgYDVQQLEwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9z -ZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0MDYxMjI4NDRaFw0xNzA0MDYxMjI4 -NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEWMBQGA1UEChMN -TWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMTGU1p -Y3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2u -uO/TEdyB5s87lozWbxXGd36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+ -LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/NoqdNAoI/gqyFxuEPkEeZlApxcpMqyabA -vjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjcQR/Ji3HWVBTji1R4P770 -Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJPqW+jqpx -62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcB -AQRbMFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3Aw -LQYIKwYBBQUHMAKGIWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAP -BgNVHRMBAf8EBTADAQH/MIIBcwYDVR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIB -AQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3LmUtc3ppZ25vLmh1L1NaU1ov -MIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0AdAB2AOEAbgB5 -ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn -AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABT -AHoAbwBsAGcA4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABh -ACAAcwB6AGUAcgBpAG4AdAAgAGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABo -AHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMAegBpAGcAbgBvAC4AaAB1AC8AUwBa -AFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6Ly93d3cuZS1zemln -bm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NOPU1p -Y3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxP -PU1pY3Jvc2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZv -Y2F0aW9uTGlzdDtiaW5hcnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuB -EGluZm9AZS1zemlnbm8uaHWkdzB1MSMwIQYDVQQDDBpNaWNyb3NlYyBlLVN6aWdu -w7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhTWjEWMBQGA1UEChMNTWlj -cm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhVMIGsBgNV -HSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJI -VTERMA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDAS -BgNVBAsTC2UtU3ppZ25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBS -b290IENBghEAzLjnv04pGv2i3GalHCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS -8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMTnGZjWS7KXHAM/IO8VbH0jgds -ZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FEaGAHQzAxQmHl -7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a -86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfR -hUZLphK3dehKyVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/ -MPMMNz7UwiiAc7EBt51alhQBS6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD -VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0 -ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G -CSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y -OTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3Qx -FjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3pp -Z25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o -dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvP -kd6mJviZpWNwrZuuyjNAfW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tc -cbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG0IMZfcChEhyVbUr02MelTTMuhTlAdX4U -fIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKApxn1ntxVUwOXewdI/5n7 -N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm1HxdrtbC -xkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1 -+rUCAwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G -A1UdDgQWBBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPM -Pcu1SCOhGnqmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG -SIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h -mLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk -ddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 -tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c -2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t -HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQG -EwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3 -MDUGA1UECwwuVGFuw7pzw610dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNl -cnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBBcmFueSAoQ2xhc3MgR29sZCkgRsWR -dGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgxMjA2MTUwODIxWjCB -pzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxOZXRM -b2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlm -aWNhdGlvbiBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNz -IEdvbGQpIEbFkXRhbsO6c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAxCRec75LbRTDofTjl5Bu0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrT -lF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw/HpYzY6b7cNGbIRwXdrz -AZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAkH3B5r9s5 -VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRG -ILdwfzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2 -BJtr+UBdADTHLpl1neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAG -AQH/AgEEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2M -U9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwWqZw8UQCgwBEIBaeZ5m8BiFRh -bvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTtaYtOUZcTh5m2C -+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC -bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2F -uLjbvrW5KfnaNwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2 -XjG4Kvte9nHfRCaexOYNkbQudZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUx -ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0 -b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQD -EylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikgVGFudXNpdHZhbnlraWFkbzAeFw05 -OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYDVQQGEwJIVTERMA8G -A1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh -Z2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5l -dExvY2sgVXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqG -SIb3DQEBAQUAA4GNADCBiQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xK -gZjupNTKihe5In+DCnVMm8Bp2GQ5o+2So/1bXHQawEfKOml2mrriRBf8TKPV/riX -iK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr1nGTLbO/CVRY7QbrqHvc -Q7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8E -BAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1G -SUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFu -b3MgU3pvbGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBh -bGFwamFuIGtlc3p1bHQuIEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExv -Y2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRvc2l0YXNhIHZlZGkuIEEgZGln -aXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYXogZWxvaXJ0 -IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh -c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGph -biBhIGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJo -ZXRvIGF6IGVsbGVub3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBP -UlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmlj -YXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2YWlsYWJsZSBhdCBo -dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBjcHNA -bmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06 -sPgzTEdM43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXa -n3BukxowOR0w2y7jfLKRstE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKS -NitjrFgBazMpUIaD8QFI ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUx -ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0 -b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQD -EytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBDKSBUYW51c2l0dmFueWtpYWRvMB4X -DTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJBgNVBAYTAkhVMREw -DwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9u -c2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMr -TmV0TG9jayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzAN -BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNA -OoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3ZW3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC -2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63euyucYT2BDMIJTLrdKwW -RMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQwDgYDVR0P -AQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEW -ggJNRklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0 -YWxhbm9zIFN6b2xnYWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFz -b2sgYWxhcGphbiBrZXN6dWx0LiBBIGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBO -ZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1iaXp0b3NpdGFzYSB2ZWRpLiBB -IGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0ZWxlIGF6IGVs -b2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs -ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25s -YXBqYW4gYSBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kg -a2VyaGV0byBheiBlbGxlbm9yemVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4g -SU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5kIHRoZSB1c2Ugb2YgdGhpcyBjZXJ0 -aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQUyBhdmFpbGFibGUg -YXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwgYXQg -Y3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmY -ta3UzbM2xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2g -pO0u9f38vf5NNwgMvOOWgyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4 -Fp1hBWeAyNDYpQcCNJgEjTME1A== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhV -MRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMe -TmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0 -dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFzcyBB -KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oXDTE5MDIxOTIzMTQ0 -N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQHEwhC -dWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQu -MRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBL -b3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSMD7tM9DceqQWC2ObhbHDqeLVu0ThEDaiD -zl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZz+qMkjvN9wfcZnSX9EUi -3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC/tmwqcm8 -WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LY -Oph7tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2Esi -NCubMvJIH5+hCoR64sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCC -ApswDgYDVR0PAQH/BAQDAgAGMBIGA1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4 -QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZRUxFTSEgRXplbiB0 -YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRhdGFz -aSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu -IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtm -ZWxlbG9zc2VnLWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMg -ZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVs -amFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJhc2EgbWVndGFsYWxoYXRv -IGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBzOi8vd3d3 -Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6 -ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1 -YW5jZSBhbmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3Qg -dG8gdGhlIE5ldExvY2sgQ1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRs -b2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBjcHNAbmV0bG9jay5uZXQuMA0G -CSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5ayZrU3/b39/zcT0mwBQO -xmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjPytoUMaFP -0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQ -QeJBCWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxk -f1qbFFgBJ34TUMdrKuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK -8CtmdWOMovsEPoMOmzbwGOQmIMOM8CgHrTwXZoi1/baI ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIG0TCCBbmgAwIBAgIBezANBgkqhkiG9w0BAQUFADCByTELMAkGA1UEBhMCSFUx -ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0 -b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMUIwQAYDVQQD -EzlOZXRMb2NrIE1pbm9zaXRldHQgS296amVneXpvaSAoQ2xhc3MgUUEpIFRhbnVz -aXR2YW55a2lhZG8xHjAcBgkqhkiG9w0BCQEWD2luZm9AbmV0bG9jay5odTAeFw0w -MzAzMzAwMTQ3MTFaFw0yMjEyMTUwMTQ3MTFaMIHJMQswCQYDVQQGEwJIVTERMA8G -A1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh -Z2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxQjBABgNVBAMTOU5l -dExvY2sgTWlub3NpdGV0dCBLb3pqZWd5em9pIChDbGFzcyBRQSkgVGFudXNpdHZh -bnlraWFkbzEeMBwGCSqGSIb3DQEJARYPaW5mb0BuZXRsb2NrLmh1MIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1Ilstg91IRVCacbvWy5FPSKAtt2/Goq -eKvld/Bu4IwjZ9ulZJm53QE+b+8tmjwi8F3JV6BVQX/yQ15YglMxZc4e8ia6AFQe -r7C8HORSjKAyr7c3sVNnaHRnUPYtLmTeriZ539+Zhqurf4XsoPuAzPS4DB6TRWO5 -3Lhbm+1bOdRfYrCnjnxmOCyqsQhjF2d9zL2z8cM/z1A57dEZgxXbhxInlrfa6uWd -vLrqOU+L73Sa58XQ0uqGURzk/mQIKAR5BevKxXEOC++r6uwSEaEYBTJp0QwsGj0l -mT+1fMptsK6ZmfoIYOcZwvK9UdPM0wKswREMgM6r3JSda6M5UzrWhQIDAMV9o4IC -wDCCArwwEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8EBAMCAQYwggJ1Bglg -hkgBhvhCAQ0EggJmFoICYkZJR1lFTEVNISBFemVuIHRhbnVzaXR2YW55IGEgTmV0 -TG9jayBLZnQuIE1pbm9zaXRldHQgU3pvbGdhbHRhdGFzaSBTemFiYWx5emF0YWJh -biBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBBIG1pbm9zaXRldHQg -ZWxla3Ryb25pa3VzIGFsYWlyYXMgam9naGF0YXMgZXJ2ZW55ZXN1bGVzZW5laywg -dmFsYW1pbnQgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYSBNaW5vc2l0ZXR0IFN6 -b2xnYWx0YXRhc2kgU3phYmFseXphdGJhbiwgYXogQWx0YWxhbm9zIFN6ZXJ6b2Rl -c2kgRmVsdGV0ZWxla2JlbiBlbG9pcnQgZWxsZW5vcnplc2kgZWxqYXJhcyBtZWd0 -ZXRlbGUuIEEgZG9rdW1lbnR1bW9rIG1lZ3RhbGFsaGF0b2sgYSBodHRwczovL3d3 -dy5uZXRsb2NrLmh1L2RvY3MvIGNpbWVuIHZhZ3kga2VyaGV0b2sgYXogaW5mb0Bu -ZXRsb2NrLm5ldCBlLW1haWwgY2ltZW4uIFdBUk5JTkchIFRoZSBpc3N1YW5jZSBh -bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGFyZSBzdWJqZWN0IHRvIHRo -ZSBOZXRMb2NrIFF1YWxpZmllZCBDUFMgYXZhaWxhYmxlIGF0IGh0dHBzOi8vd3d3 -Lm5ldGxvY2suaHUvZG9jcy8gb3IgYnkgZS1tYWlsIGF0IGluZm9AbmV0bG9jay5u -ZXQwHQYDVR0OBBYEFAlqYhaSsFq7VQ7LdTI6MuWyIckoMA0GCSqGSIb3DQEBBQUA -A4IBAQCRalCc23iBmz+LQuM7/KbD7kPgz/PigDVJRXYC4uMvBcXxKufAQTPGtpvQ -MznNwNuhrWw3AkxYQTvyl5LGSKjN5Yo5iWH5Upfpvfb5lHTocQ68d4bDBsxafEp+ -NFAwLvt/MpqNPfMgW/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCR -VCHnpgu0mfVRQdzNo0ci2ccBgcTcR08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY -83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR5qq5aKrN9p2QdRLqOBrKROi3 -macqaJVmlaut74nLYKkGEsaUR+ko ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi -MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu -MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp -dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV -UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO -ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz -c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP -OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl -mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF -BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4 -qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw -gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB -BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu -bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp -dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8 -6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/ -h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH -/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv -wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN -pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCB -ijELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHly -aWdodCAoYykgMjAwNTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl -ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQSBDQTAeFw0w -NTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYDVQQGEwJDSDEQMA4G -A1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIwIAYD -VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBX -SVNlS2V5IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAy0+zAJs9Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxR -VVuuk+g3/ytr6dTqvirdqFEr12bDYVxgAsj1znJ7O7jyTmUIms2kahnBAbtzptf2 -w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbDd50kc3vkDIzh2TbhmYsF -mQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ/yxViJGg -4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t9 -4B3RLoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYw -DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQw -EAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOx -SPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VFvbBsUfk2 -ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8 -vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa -hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZi -Fj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ -/L7fCg0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1 -dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9s -YW5vMQswCQYDVQQGEwJWRTEQMA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlz -dHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0 -aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBlcmludGVuZGVuY2lh -IGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUwIwYJ -KoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEw -MFoXDTIwMTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHBy -b2NlcnQubmV0LnZlMQ8wDQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGEx -KjAoBgNVBAsTIVByb3ZlZWRvciBkZSBDZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQG -A1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9u -aWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIwDQYJKoZI -hvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo9 -7BVCwfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74 -BCXfgI8Qhd19L3uA3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38G -ieU89RLAu9MLmV+QfI4tL3czkkohRqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9 -JcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmOEO8GqQKJ/+MMbpfg353bIdD0 -PghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG20qCZyFSTXai2 -0b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH -0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/ -6mnbVSKVUyqUtd+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1m -v6JpIzi4mWCZDlZTOpx+FIywBm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7 -K2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvpr2uKGcfLFFb14dq12fy/czja+eev -bqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/AgEBMDcGA1UdEgQw -MC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAzNi0w -MB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFD -gBStuyIdxuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0 -b3JpZGFkIGRlIENlcnRpZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xh -bm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQHEwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0 -cml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5hY2lvbmFsIGRlIENlcnRp -ZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5kZW5jaWEg -ZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkq -hkiG9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQD -AgEGME0GA1UdEQRGMESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0w -MDAwMDKgGwYFYIZeAgKgEgwQUklGLUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEag -RKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9sY3IvQ0VSVElGSUNBRE8t -UkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNyYWl6LnN1c2Nl -cnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v -Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsG -AQUFBwIBFh5odHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcN -AQELBQADggIBACtZ6yKZu4SqT96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS -1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmNg7+mvTV+LFwxNG9s2/NkAZiqlCxB -3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4quxtxj7mkoP3Yldmv -Wb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1n8Gh -HVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHm -pHmJWhSnFFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXz -sOfIt+FTvZLm8wyWuevo5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bE -qCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq3TNWOByyrYDT13K9mmyZY+gAu0F2Bbdb -mRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5poLWccret9W6aAjtmcz9 -opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3YeMLEYC/H -YvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC -TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0 -aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0 -aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz -MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw -IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR -dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp -li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D -rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ -WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug -F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU -xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC -Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv -dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw -ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl -IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh -c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy -ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh -Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI -KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T -KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq -y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p -dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD -VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL -MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk -fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8 -7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R -cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y -mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW -xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK -SnQ2+Q== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x -GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv -b3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV -BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W -YWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCa -GMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6XJxg -Fyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55J -WpzmM+Yklvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bB -rrcCaoF6qUWD4gXmuVbBlDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp -+ARz8un+XJiM9XOva7R+zdRcAitMOeGylZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1 -ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt66/3FsvbzSUr5R/7mp/i -Ucw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1JdxnwQ5hYIiz -PtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og -/zOhD7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UH -oycR7hYQe7xFSkyyBNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuI -yV77zGHcizN300QyNQliBJIWENieJ0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1Ud -EwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBQahGK8SEwzJQTU7tD2 -A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGUa6FJpEcwRTEL -MAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT -ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2f -BluornFdLwUvZ+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzn -g/iN/Ae42l9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl -fF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K -WWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha -B0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc -hLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR -TUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD -mbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z -ohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y -4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza -8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x -GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv -b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV -BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W -YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM -V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB -4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr -H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd -8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv -vWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT -mZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe -btfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc -T5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt -WAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ -c6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A -4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD -VR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG -CCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0 -aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 -aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu -dC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw -czALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G -A1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC -TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg -Um9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0 -7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem -d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd -+LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B -4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN -t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x -DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57 -k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s -zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j -Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT -mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK -4SVhM7JZG+Ju1zdXtg2pEto= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 -IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz -BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y -aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG -9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy -NjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD -cnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs -2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY -JJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE -Zwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ -n0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A -PhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6 -MRkwFwYDVQQKExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJp -dHkgMjA0OCBWMzAeFw0wMTAyMjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAX -BgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAbBgNVBAsTFFJTQSBTZWN1cml0eSAy -MDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt49VcdKA3Xtp -eafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7Jylg -/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGl -wSMiuLgbWhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnh -AMFRD0xS+ARaqn1y07iHKrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2 -PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpu -AWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB -BjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4EFgQUB8NR -MKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYc -HnmYv/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/ -Zb5gEydxiKRz44Rj0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+ -f00/FGj1EVDVwfSQpQgdMWD/YIwjVAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVO -rSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395nzIlQnQFgCi/vcEkllgVsRch -6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kApKnXwiJPZ9d3 -7CAFYd4= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJF -UzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJ -R1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcN -MDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3WjBoMQswCQYDVQQGEwJFUzEfMB0G -A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScw -JQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+ -WmmmO3I2F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKj -SgbwJ/BXufjpTjJ3Cj9BZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGl -u6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQD0EbtFpKd71ng+CT516nDOeB0/RSrFOy -A8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXteJajCq+TA81yc477OMUxk -Hl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMBAAGjggM7 -MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBr -aS5ndmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIIC -IwYKKwYBBAG/VQIBADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8A -cgBpAGQAYQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIA -YQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIAYQBsAGkAdABhAHQAIABWAGEA -bABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQByAGEAYwBpAPMA -bgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA -aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMA -aQBvAG4AYQBtAGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQA -ZQAgAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEA -YwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBuAHQAcgBhACAAZQBuACAAbABhACAA -ZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAAOgAvAC8AdwB3AHcA -LgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0dHA6 -Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+y -eAT8MIGVBgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQsw -CQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0G -A1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVu -Y2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRhTvW1yEICKrNcda3Fbcrn -lD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdzCkj+IHLt -b8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg -9J63NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XF -ducTZnV+ZfsBn5OHiJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmC -IoaZM3Fa6hlXPZHNqcCjbgcTpsnt+GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEezCCA2OgAwIBAgIQNxkY5lNUfBq1uMtZWts1tzANBgkqhkiG9w0BAQUFADCB -rjELMAkGA1UEBhMCREUxIDAeBgNVBAgTF0JhZGVuLVd1ZXJ0dGVtYmVyZyAoQlcp -MRIwEAYDVQQHEwlTdHV0dGdhcnQxKTAnBgNVBAoTIERldXRzY2hlciBTcGFya2Fz -c2VuIFZlcmxhZyBHbWJIMT4wPAYDVQQDEzVTLVRSVVNUIEF1dGhlbnRpY2F0aW9u -IGFuZCBFbmNyeXB0aW9uIFJvb3QgQ0EgMjAwNTpQTjAeFw0wNTA2MjIwMDAwMDBa -Fw0zMDA2MjEyMzU5NTlaMIGuMQswCQYDVQQGEwJERTEgMB4GA1UECBMXQmFkZW4t -V3VlcnR0ZW1iZXJnIChCVykxEjAQBgNVBAcTCVN0dXR0Z2FydDEpMCcGA1UEChMg -RGV1dHNjaGVyIFNwYXJrYXNzZW4gVmVybGFnIEdtYkgxPjA8BgNVBAMTNVMtVFJV -U1QgQXV0aGVudGljYXRpb24gYW5kIEVuY3J5cHRpb24gUm9vdCBDQSAyMDA1OlBO -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2bVKwdMz6tNGs9HiTNL1 -toPQb9UY6ZOvJ44TzbUlNlA0EmQpoVXhOmCTnijJ4/Ob4QSwI7+Vio5bG0F/WsPo -TUzVJBY+h0jUJ67m91MduwwA7z5hca2/OnpYH5Q9XIHV1W/fuJvS9eXLg3KSwlOy -ggLrra1fFi2SU3bxibYs9cEv4KdKb6AwajLrmnQDaHgTncovmwsdvs91DSaXm8f1 -XgqfeN+zvOyauu9VjxuapgdjKRdZYgkqeQd3peDRF2npW932kKvimAoA0SVtnteF -hy+S8dF2g08LOlk3KC8zpxdQ1iALCvQm+Z845y2kuJuJja2tyWp9iRe79n+Ag3rm -7QIDAQABo4GSMIGPMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEG -MCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTVFJvbmxpbmUxLTIwNDgtNTAdBgNV -HQ4EFgQUD8oeXHngovMpttKFswtKtWXsa1IwHwYDVR0jBBgwFoAUD8oeXHngovMp -ttKFswtKtWXsa1IwDQYJKoZIhvcNAQEFBQADggEBAK8B8O0ZPCjoTVy7pWMciDMD -pwCHpB8gq9Yc4wYfl35UvbfRssnV2oDsF9eK9XvCAPbpEW+EoFolMeKJ+aQAPzFo -LtU96G7m1R08P7K9n3frndOMusDXtk3sU5wPBG7qNWdX4wple5A64U8+wwCSersF -iXOMy6ZNwPv2AtawB6MDwidAnwzkhYItr5pCHdDHjfhA7p0GVxzZotiAFP7hYy0y -h9WUUpY6RsZxlj33mA6ykaqP2vROJAA5VeitF7nTNCtKqUDMFypVZUF0Qn71wK/I -k63yGFs9iQzbRzkk+OBM8h+wPQrKBU6JIRrjKpms/H+h8Q8bHz2eBIPdltkdOpQ= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGGTCCBAGgAwIBAgIIPtVRGeZNzn4wDQYJKoZIhvcNAQELBQAwajEhMB8GA1UE -AxMYU0cgVFJVU1QgU0VSVklDRVMgUkFDSU5FMRwwGgYDVQQLExMwMDAyIDQzNTI1 -Mjg5NTAwMDIyMRowGAYDVQQKExFTRyBUUlVTVCBTRVJWSUNFUzELMAkGA1UEBhMC -RlIwHhcNMTAwOTA2MTI1MzQyWhcNMzAwOTA1MTI1MzQyWjBqMSEwHwYDVQQDExhT -RyBUUlVTVCBTRVJWSUNFUyBSQUNJTkUxHDAaBgNVBAsTEzAwMDIgNDM1MjUyODk1 -MDAwMjIxGjAYBgNVBAoTEVNHIFRSVVNUIFNFUlZJQ0VTMQswCQYDVQQGEwJGUjCC -AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANqoVgLsfJXwTukK0rcHoyKL -ULO5Lhk9V9sZqtIr5M5C4myh5F0lHjMdtkXRtPpZilZwyW0IdmlwmubHnAgwE/7m -0ZJoYT5MEfJu8rF7V1ZLCb3cD9lxDOiaN94iEByZXtaxFwfTpDktwhpz/cpLKQfC -eSnIyCauLMT8I8hL4oZWDyj9tocbaF85ZEX9aINsdSQePHWZYfrSFPipS7HYfad4 -0hNiZbXWvn5qA7y1svxkMMPQwpk9maTTzdGxxFOHe0wTE2Z/v9VlU2j5XB7ltP82 -mUWjn2LAfxGCAVTeD2WlOa6dSEyJoxA74OaD9bDaLB56HFwfAKzMq6dgZLPGxXvH -VUZ0PJCBDkqOWZ1UsEixUkw7mO6r2jS3U81J2i/rlb4MVxH2lkwEeVyZ1eXkvm/q -R+5RS+8iJq612BGqQ7t4vwt+tN3PdB0lqYljseI0gcSINTjiAg0PE8nVKoIV8IrE -QzJW5FMdHay2z32bll0eZOl0c8RW5BZKUm2SOdPhTQ4/YrnerbUdZbldUv5dCamc -tKQM2S9FdqXPjmqanqqwEaHrYcbrPx78ZrQSnUZ/MhaJvnFFr5Eh2f2Tv7QCkUL/ -SR/tixVo3R+OrJvdggWcRGkWZBdWX0EPSk8ED2VQhpOX7EW/XcIc3M/E2DrmeAXQ -xVVVqV7+qzohu+VyFPcLAgMBAAGjgcIwgb8wHQYDVR0OBBYEFCkgy/HDD9oGjhOT -h/5fYBopu/O2MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUKSDL8cMP2gaO -E5OH/l9gGim787YwEQYDVR0gBAowCDAGBgRVHSAAMEkGA1UdHwRCMEAwPqA8oDqG -OGh0dHA6Ly9jcmwuc2d0cnVzdHNlcnZpY2VzLmNvbS9yYWNpbmUtR3JvdXBlU0cv -TGF0ZXN0Q1JMMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEATEZn -4ERQ9cW2urJRCiUTHbfHiC4fuStkoMuTiFJZqmD1zClSF/8E5ze0MRFGfisebKeL -PEeaXvSqXZA7RT2fSsmKe47A7j55i5KjyJRKuCgRa6YlX129x8j7g09VMeZc8BN8 -471/Kiw3N5RJr4QfFCeiWBCPCjk3GhIgQY8Z9qkfGe2yNLKtfTNEi18KB0PydkVF -La3kjQ4A/QQIqudr+xe9sAhWDjUqcvCz5006Tw3c82ASszhkjNv54SaNL+9O6CRH -PjY0imkPKGuLh8a9hSb50+tpIVZgkdb34GLCqHGuLt5mI7VSRqakSDcsfwEWVxH3 -Jw0O5Q/WkEXhHj8h3NL8FhgTPk1qsiZqQF4leP049KxYejcbmEAEx47J1MRnYbGY -rvDNDty5r2WDewoEij9hqvddQYbmxkzCTzpcVuooO6dEz8hKZPVyYC3jQ7hK4HU8 -MuSqFtcRucFF2ZtmY2blIrc07rrVdC8lZPOBVMt33lfUk+OsBzE6PlwDg1dTx/D+ -aNglUE0SyObhlY1nqzyTPxcCujjXnvcwpT09RAEzGpqfjtCf8e4wiHPvriQZupdz -FcHscQyEZLV77LxpPqRtCRY2yko5isune8YdfucziMm+MG2chZUh6Uc7Bn6B4upG -5nBYgOao8p0LadEziVkw82TTC/bOKwn7fRB2LhA= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr -MCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG -A1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0 -MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZp -Y2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1cmVTaWduIFJvb3RD -QTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvLTJsz -i1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8 -h9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOV -MdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9 -UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni -8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitAbpSACW22s293bzUIUPsC -h8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZXt94wDgYD -VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB -AKChOBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xm -KbabfSVSSUOrTC4rbnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQ -X5Ucv+2rIrVls4W6ng+4reV6G4pQOh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWr -QbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01y8hSyn+B/tlr0/cR7SXf+Of5 -pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061lgeLKBObjBmN -QSdJQO7e5iNEOdyhIta6A/I= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI -MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x -FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz -MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv -cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQXOZEz -Zum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO -0gMdA+9tDWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIao -wW8xQmxSPmjL8xk037uHGFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj -7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b01k/unK8RCSc43Oz969XL0Imnal0ugBS -8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmHursCAwEAAaOBnTCBmjAT -BgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB -/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCeg -JYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC -NxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3 -6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/ -3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm -D5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS -CPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR -3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK -MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x -GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx -MjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg -Q29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ -iQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa -/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ -jnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI -HmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7 -sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w -gZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF -MAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw -KaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG -AQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L -URYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO -H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm -I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY -iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc -f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDEl -MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMh -U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIz -MloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09N -IFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNlY3VyaXR5IENvbW11 -bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSE -RMqm4miO/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gO -zXppFodEtZDkBp2uoQSXWHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5 -bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4zZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDF -MxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4bepJz11sS6/vmsJWXMY1 -VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK9U2vP9eC -OKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G -CSqGSIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HW -tWS3irO4G8za+6xmiEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZ -q51ihPZRwSzJIxXYKLerJRO1RuGGAv8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDb -EJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnWmHyojf6GPgcWkuF75x3sM3Z+ -Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEWT1MKZPlO9L9O -VL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl -MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe -U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX -DTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRy -dXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmlj -YXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANAV -OVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGr -zbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVM -VAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ -hNBqyjoGADdH5H5XTz+L62e4iKrFvlNVspHEfbmwhRkGeC7bYRr6hfVKkaHnFtWO -ojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1KEOtOghY6rCcMU/Gt1SSw -awNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8QIH4D5cs -OPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 -DQEBCwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpF -coJxDjrSzG+ntKEju/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc -okgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8 -t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy -1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/ -SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY -MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t -dW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5 -WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD -VQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8 -9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ -DKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9 -Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N -QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ -xrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G -A1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T -AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG -kl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr -Uj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5 -Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU -JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot -RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP -MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAx -MDQwNjEwNDkxM1oXDTIxMDQwNjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNV -BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMSBDQTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H887dF+2rDNbS82rDTG -29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9EJUk -oVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk -3w0LBUXl0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBL -qdReLjVQCfOAl/QMF6452F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIIN -nvmLVz5MxxftLItyM19yejhW1ebZrgUaHXVFsculJRwSVzb9IjcCAwEAAaMzMDEw -DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZTiFIwCwYDVR0PBAQDAgEG -MA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE928Jj2VuX -ZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0H -DjxVyhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VO -TzF2nBBhjrZTOqMRvq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2Uv -kVrCqIexVmiUefkl98HVrhq4uz2PqYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4w -zMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9ZIRlXvVWa ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP -MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx -MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV -BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o -Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt -5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s -3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej -vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu -8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw -DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG -MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil -zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/ -3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD -FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6 -Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2 -ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJO -TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFh -dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEy -MTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVk -ZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxhbmRlbiBSb290IENB -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFtvszn -ExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw71 -9tV2U02PjLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MO -hXeiD+EwR+4A5zN9RGcaC1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+U -tFE5A3+y3qcym7RHjm+0Sq7lr7HcsBthvJly3uSJt3omXdozSVtSnA71iq3DuD3o -BmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn622r+I/q85Ej0ZytqERAh -SQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRVHSAAMDww -OgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMv -cm9vdC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA -7Jbg0zTBLL9s+DANBgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k -/rvuFbQvBgwp8qiSpGEN/KtcCFtREytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzm -eafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbwMVcoEoJz6TMvplW0C5GUR5z6 -u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3ynGQI0DvDKcWy -7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR -iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO -TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh -dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oX -DTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl -ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv -b3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ5291 -qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8Sp -uOUfiUtnvWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPU -Z5uW6M7XxgpT0GtJlvOjCwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvE -pMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiile7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp -5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCROME4HYYEhLoaJXhena/M -UGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpICT0ugpTN -GmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy -5V6548r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv -6q012iDTiIJh8BIitrzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEK -eN5KzlW/HdXZt1bv8Hb/C3m1r737qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6 -B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMBAAGjgZcwgZQwDwYDVR0TAQH/ -BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcCARYxaHR0cDov -L3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqG -SIb3DQEBCwUAA4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLyS -CZa59sCrI2AGeYwRTlHSeYAz+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen -5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwjf/ST7ZwaUb7dRUG/kSS0H4zpX897 -IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaNkqbG9AclVMwWVxJK -gnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfkCpYL -+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxL -vJxxcypFURmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkm -bEgeqmiSBeGCc1qb3AdbCG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvk -N1trSt8sV4pAWja63XVECDdCcAz+3F4hoKOKwJCcaNpQ5kUQR3i2TtJlycM33+FC -Y7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z -ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl -MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp -U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw -NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE -ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp -ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3 -DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf -8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN -+lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0 -X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa -K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA -1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G -A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR -zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0 -YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD -bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w -DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3 -L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D -eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl -xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp -VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY -WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx -EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT -HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs -ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw -MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 -b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj -aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp -Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg -nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1 -HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N -Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN -dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0 -HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO -BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G -CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU -sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3 -4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg -8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K -pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1 -mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx -EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT -HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs -ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 -MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD -VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy -ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy -dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p -OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2 -8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K -Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe -hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk -6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw -DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q -AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI -bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB -ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z -qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd -iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn -0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN -sSi6 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW -MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg -Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM3WhcNMzYwOTE3MTk0NjM2WjB9 -MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi -U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh -cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk -pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf -OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C -Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT -Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi -HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM -Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w -+2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ -Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 -Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B -26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID -AQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD -VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFul -F2mHMMo0aEPQQa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCC -ATgwLgYIKwYBBQUHAgEWImh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5w -ZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL2ludGVybWVk -aWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENvbW1lcmNpYWwgKFN0 -YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUg -c2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0 -aWZpY2F0aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93 -d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgG -CWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5fPGFf59Jb2vKXfuM/gTF -wWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS -Ta0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst -0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc -pRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl -CcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF -P0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK -1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm -KhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE -JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ -8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm -fyWl8kgAwKQB2j8= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEW -MBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlm -aWNhdGlvbiBBdXRob3JpdHkgRzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1 -OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoG -A1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRzIwggIiMA0G -CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8Oo1XJ -JZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsD -vfOpL9HG4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnoo -D/Uefyf3lLE3PbfHkffiAez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/ -Q0kGi4xDuFby2X8hQxfqp0iVAXV16iulQ5XqFYSdCI0mblWbq9zSOdIxHWDirMxW -RST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbsO+wmETRIjfaAKxojAuuK -HDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8HvKTlXcxN -nw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM -0D4LnMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/i -UUjXuG+v+E5+M5iSFGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9 -Ha90OrInwMEePnWjFqmveiJdnxMaz6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHg -TuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE -AwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJKoZIhvcNAQEL -BQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K -2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfX -UfEpY9Z1zRbkJ4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl -6/2o1PXWT6RbdejF0mCy2wl+JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK -9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG/+gyRr61M3Z3qAFdlsHB1b6uJcDJ -HgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTcnIhT76IxW1hPkWLI -wpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/XldblhY -XzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5l -IxKVCCIcl85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoo -hdVddLHRDiBYmxOlsGOm7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulr -so8uBtjRkcfGEvRM/TAXw8HaOFvjqermobp573PYtlNXLfbQ4ddI ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV -BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln -biBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF -MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT -d2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC -CgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8 -76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+ -bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c -6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE -emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd -MmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdt -MDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02y -MszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69y -FGkOpeUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPi -aG59je883WX0XaxR7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxM -gI93e2CaHt+28kgeDrpOVG2Y4OGiGqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCB -qTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWyV7 -lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64OfPAeGZe6Drn -8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov -L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6 -45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO -UYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5 -O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC -bwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv -GPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a -77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC -hdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3 -92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp -Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w -ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt -Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE -BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWdu -IFBsYXRpbnVtIENBIC0gRzIwHhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAw -WjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMSMwIQYDVQQD -ExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu669y -IIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2Htn -IuJpX+UFeNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+ -6ixuEFGSzH7VozPY1kneWCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5ob -jM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIoj5+saCB9bzuohTEJfwvH6GXp43gOCWcw -izSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/68++QHkwFix7qepF6w9fl -+zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34TaNhxKFrY -zt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaP -pZjydomyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtF -KwH3HBqi7Ri6Cr2D+m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XUz13XuW -ae5ogObnmLo2t/5u7Su9IPhlGdpVCX4l3P5hYnL5fhgC72O00Puv5TtjjGePAgMB -AAGjgawwgakwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O -BBYEFFCvzAeHFUdvOMW0ZdHelarp35zMMB8GA1UdIwQYMBaAFFCvzAeHFUdvOMW0 -ZdHelarp35zMMEYGA1UdIAQ/MD0wOwYJYIV0AVkBAQEBMC4wLAYIKwYBBQUHAgEW -IGh0dHA6Ly9yZXBvc2l0b3J5LnN3aXNzc2lnbi5jb20vMA0GCSqGSIb3DQEBBQUA -A4ICAQAIhab1Fgz8RBrBY+D5VUYI/HAcQiiWjrfFwUF1TglxeeVtlspLpYhg0DB0 -uMoI3LQwnkAHFmtllXcBrqS3NQuB2nEVqXQXOHtYyvkv+8Bldo1bAbl93oI9ZLi+ -FHSjClTTLJUYFzX1UWs/j6KWYTl4a0vlpqD4U99REJNi54Av4tHgvI42Rncz7Lj7 -jposiU0xEQ8mngS7twSNC/K5/FqdOxa3L8iYq/6KUFkuozv8KV2LwUvJ4ooTHbG/ -u0IdUt1O2BReEMYxB+9xJ/cbOQncguqLs5WGXv312l0xpuAxtpTmREl0xRbl9x8D -YSjFyMsSoEJL+WuICI20MhjzdZ/EfwBPBZWcoxcCw7NTm6ogOSkrZvqdr16zktK1 -puEa+S1BaYEUtLS17Yk9zvupnTVCRLEcFHOBzyoBNZox1S2PbYTfgE1X4z/FhHXa -icYwu+uPyyIIoK6q8QNsOktNCaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbG -DI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSYMdp08YSTcU1f+2BY0fvEwW2JorsgH51x -kcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAciIfNAChs0B0QTwoRqjt8Z -Wr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE -BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu -IFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow -RzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY -U3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv -Fz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7br -YT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieF -nbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH -6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZt -eJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/ -c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJ -MoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRH -HTBsROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTf -jNFusB3hB48IHpmccelM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb6 -5i/4z3GcRm25xBWNOHkDRUjvxF3XCO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOB -rDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU -F6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRBtjpbO8tFnb0c -wpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 -cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIB -AHPGgeAn0i0P4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShp -WJHckRE1qTodvBqlYJ7YH39FkWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9 -xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L3XWgwF15kIwb4FDm3jH+mHtwX6WQ -2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ -IseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8 -aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X -em1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR -dAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/ -OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+ -hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy -tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBk -MQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0 -YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3Qg -Q0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4MTgyMjA2MjBaMGQxCzAJBgNVBAYT -AmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZp -Y2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIICIjAN -BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9 -m2BtRsiMMW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdih -FvkcxC7mlSpnzNApbjyFNDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/ -TilftKaNXXsLmREDA/7n29uj/x2lzZAeAR81sH8A25Bvxn570e56eqeqDFdvpG3F -EzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkCb6dJtDZd0KTeByy2dbco -kdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn7uHbHaBu -HYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNF -vJbNcA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo -19AOeCMgkckkKmUpWyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjC -L3UcPX7ape8eYIVpQtPM+GP+HkM5haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJW -bjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNYMUJDLXT5xp6mig/p/r+D5kNX -JLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0hBBYw -FDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j -BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzc -K6FptWfUjNP9MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzf -ky9NfEBWMXrrpA9gzXrzvsMnjgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7Ik -Vh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQMbFamIp1TpBcahQq4FJHgmDmHtqB -sfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4HVtA4oJVwIHaM190e -3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtlvrsR -ls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ip -mXeascClOS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HH -b6D0jqTsNFFbjCYDcKF31QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksf -rK/7DZBaZmBwXarNeNQk7shBoJMBkpxqnvy5JMWzFYJ+vq6VK+uxwNrjAWALXmms -hFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCyx/yP2FS1k2Kdzs9Z+z0Y -zirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMWNY6E0F/6 -MBr1mmz0DlP5OlvRHA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBk -MQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0 -YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3Qg -Q0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2MjUwNzM4MTRaMGQxCzAJBgNVBAYT -AmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZp -Y2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIICIjAN -BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvEr -jw0DzpPMLgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r -0rk0X2s682Q2zsKwzxNoysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f -2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJwDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVP -ACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpHWrumnf2U5NGKpV+GY3aF -y6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1aSgJA/MTA -tukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL -6yxSNLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0 -uPoTXGiTOmekl9AbmbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrAL -acywlKinh/LTSlDcX3KwFnUey7QYYpqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velh -k6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3qPyZ7iVNTA6z00yPhOgpD/0Q -VAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0hBBYw -FDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O -BBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqh -b97iEoHF8TwuMA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4R -fbgZPnm3qKhyN2abGu2sEzsOv2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv -/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ82YqZh6NM4OKb3xuqFp1mrjX2lhI -REeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLzo9v/tdhZsnPdTSpx -srpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcsa0vv -aGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciAT -woCqISxxOQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99n -Bjx8Oto0QuFmtEYE3saWmA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5W -t6NlUe07qxS/TFED6F+KBZvuim6c779o+sjaC+NCydAXFJy3SuCvkychVSa1ZC+N -8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TCrvJcwhbtkj6EPnNgiLx2 -9CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX5OfNeOI5 -wSsSnqaeG8XmDtkx2Q== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAw -ZzELMAkGA1UEBhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdp -dGFsIENlcnRpZmljYXRlIFNlcnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290 -IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcNMzEwNjI1MDg0NTA4WjBnMQswCQYD -VQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2Vy -dGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYgQ0Eg -MjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7Bx -UglgRCgzo3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD -1ycfMQ4jFrclyxy0uYAyXhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPH -oCE2G3pXKSinLr9xJZDzRINpUKTk4RtiGZQJo/PDvO/0vezbE53PnUgJUmfANykR -HvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8LiqG12W0OfvrSdsyaGOx9/ -5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaHZa0zKcQv -idm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHL -OdAGalNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaC -NYGu+HuB5ur+rPQam3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f -46Fq9mDU5zXNysRojddxyNMkM3OxbPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCB -UWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDixzgHcgplwLa7JSnaFp6LNYth -7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/BAQDAgGGMB0G -A1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED -MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWB -bj2ITY1x0kbBbkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6x -XCX5145v9Ydkn+0UjrgEjihLj6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98T -PLr+flaYC/NUn81ETm484T4VvwYmneTwkLbUwp4wLh/vx3rEUMfqe9pQy3omywC0 -Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7XwgiG/W9mR4U9s70 -WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH59yL -Gn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm -7JFe3VE/23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4S -nr8PyQUQ3nqjsTzyP6WqJ3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VN -vBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyAHmBR3NdUIR7KYndP+tiPsys6DXhyyWhB -WkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/giuMod89a2GQ+fYWVq6nTI -fI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuWl8PVP3wb -I+2ksx0WckNLIOFZfsLorSa/ovc= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx -KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd -BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl -YyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgxMDAxMTA0MDE0WhcNMzMxMDAxMjM1 -OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy -aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 -ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUd -AqSzm1nzHoqvNK38DcLZSBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiC -FoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/FvudocP05l03Sx5iRUKrERLMjfTlH6VJi -1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx9702cu+fjOlbpSD8DT6Iavq -jnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGVWOHAD3bZ -wI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGj -QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/ -WSA2AHmgoCJrjNXyYdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhy -NsZt+U2e+iKo4YFWz827n+qrkRk4r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPAC -uvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNfvNoBYimipidx5joifsFvHZVw -IEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR3p1m0IvVVGb6 -g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN -9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlP -BSeOE6Fuwg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx -KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd -BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl -YyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1 -OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy -aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 -ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN -8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/ -RLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4 -hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5 -ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltM -EnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGj -QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1 -A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy -WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ -1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30 -6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT -91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml -e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p -TpPDpFQUWw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjEL -MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV -BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 -Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYwMTEyMTQzODQzWhcNMjUxMjMxMjI1 -OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i -SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UEAxMc -VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jf -tMjWQ+nEdVl//OEd+DFwIxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKg -uNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2J -XjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQXa7pIXSSTYtZgo+U4+lK -8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7uSNQZu+99 -5OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3 -kUrL84J6E1wIqzCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy -dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6 -Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz -JTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 -Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iS -GNn3Bzn1LL4GdXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprt -ZjluS5TmVfwLG4t3wVMTZonZKNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8 -au0WOB9/WIFaGusyiC2y8zl3gK9etmF1KdsjTYjKUCjLhdLTEKJZbtOTVAB6okaV -hgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kPJOzHdiEoZa5X6AeI -dUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfkvQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjEL -MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV -BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 -Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYwMTEyMTQ0MTU3WhcNMjUxMjMxMjI1 -OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i -SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UEAxMc -VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJW -Ht4bNwcwIi9v8Qbxq63WyKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+Q -Vl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo6SI7dYnWRBpl8huXJh0obazovVkdKyT2 -1oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZuV3bOx4a+9P/FRQI2Alq -ukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk2ZyqBwi1 -Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NX -XAek0CSnwPIA1DCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy -dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6 -Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz -JTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 -Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlN -irTzwppVMXzEO2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8 -TtXqluJucsG7Kv5sbviRmEb8yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6 -g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9IJqDnxrcOfHFcqMRA/07QlIp2+gB -95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal092Y+tTmBvTwtiBj -S+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc5A== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTEL -MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV -BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1 -c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcNMDYwMzIyMTU1NDI4WhcNMjUxMjMx -MjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIg -R21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYwJAYD -VQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSR -JJZ4Hgmgm5qVSkr1YnwCqMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3T -fCZdzHd55yx4Oagmcw6iXSVphU9VDprvxrlE4Vc93x9UIuVvZaozhDrzznq+VZeu -jRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtwag+1m7Z3W0hZneTvWq3z -wZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9OgdwZu5GQ -fezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYD -VR0jBBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAO -BgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0G -CSqGSIb3DQEBBQUAA4IBAQAo0uCG1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X1 -7caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/CyvwbZ71q+s2IhtNerNXxTPqYn -8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3ghUJGooWMNjs -ydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT -ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/ -2TYcuiUaUj0a7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJE -SzEVMBMGA1UEChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQg -Um9vdCBDQTAeFw0wMTA0MDUxNjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNV -BAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJuZXQxHTAbBgNVBAsTFFREQyBJbnRl -cm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxLhA -vJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20jxsNu -Zp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a -0vnRrEvLznWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc1 -4izbSysseLlJ28TQx5yc5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGN -eGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcD -R0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZIAYb4QgEBBAQDAgAHMGUG -A1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMMVERDIElu -dGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxME -Q1JMMTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3 -WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAw -HQYDVR0OBBYEFGxkAcf9hW2syNqeUAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJ -KoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4IBAQBO -Q8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540mgwV5dOy0uaOX -wTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+ -2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm89 -9qNLPg7kbWzbO0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0 -jUNAE4z9mQNUecYu6oah9jrUCbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38 -aQNiuJkFBT1reBK9sG9l ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOc -UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx -c8SxMQswCQYDVQQGDAJUUjEPMA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykg -MjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8 -dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMxMDI3MTdaFw0xNTAz -MjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsgU2Vy -dGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYD -VQQHDAZBTktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kg -xLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEu -xZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7 -XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GXyGl8hMW0kWxsE2qkVa2k -heiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8iSi9BB35J -YbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5C -urKZ8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1 -JuTm5Rh8i27fbMx4W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51 -b0dewQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV -9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46sWrv7/hg0Uw2ZkUd82YCdAR7 -kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxEq8Sn5RTOPEFh -fEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy -B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdA -aLX/7KfS0zgYnNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKS -RGQDJereW26fyfJOrN3H ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOc -UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx -c8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xS -S1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg -SGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcNMDUxMTA3MTAwNzU3 -WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVrdHJv -bmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJU -UjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSw -bGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWe -LiAoYykgS2FzxLFtIDIwMDUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqeLCDe2JAOCtFp0if7qnef -J1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKIx+XlZEdh -R3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJ -Qv2gQrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGX -JHpsmxcPbe9TmJEr5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1p -zpwACPI2/z7woQ8arBT9pmAPAgMBAAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58S -Fq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8GA1UdEwEB/wQFMAMBAf8wDQYJ -KoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/nttRbj2hWyfIvwq -ECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 -Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFz -gw2lGh1uEpJ+hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotH -uFEJjOp9zYhys2AzsfAKRO8P9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LS -y3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5UrbnBEI= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOc -UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx -c8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xS -S1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg -SGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4XDTA3MTIyNTE4Mzcx -OVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxla3Ry -b25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMC -VFIxDzANBgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDE -sGxldGnFn2ltIHZlIEJpbGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7F -ni4gKGMpIEFyYWzEsWsgMjAwNzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9NYvDdE3ePYakqtdTyuTFY -KTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQvKUmi8wUG -+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveG -HtyaKhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6P -IzdezKKqdfcYbwnTrqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M -733WB2+Y8a+xwXrXgTW4qhe04MsCAwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHk -Yb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G -CSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/sPx+EnWVUXKgW -AkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I -aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5 -mxRZNTZPz/OOXl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsa -XRik7r4EW5nVcV9VZWRi1aKbBFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZ -qxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAKpoRq0Tl9 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcx -EjAQBgNVBAoTCVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMT -VFdDQSBHbG9iYWwgUm9vdCBDQTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5 -NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQKEwlUQUlXQU4tQ0ExEDAOBgNVBAsT -B1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3QgQ0EwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2CnJfF -10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz -0ALfUPZVr2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfCh -MBwqoJimFb3u/Rk28OKRQ4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbH -zIh1HrtsBv+baz4X7GGqcXzGHaL3SekVtTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc -46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1WKKD+u4ZqyPpcC1jcxkt2 -yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99sy2sbZCi -laLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYP -oA/pyJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQA -BDzfuBSO6N+pjWxnkjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcE -qYSjMq+u7msXi7Kx/mzhkIyIqJdIzshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm -4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB -/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6gcFGn90xHNcgL -1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn -LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WF -H6vPNOw/KP4M8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNo -RI2T9GRwoD2dKAXDOXC4Ynsg/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+ -nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlglPx4mI88k1HtQJAH32RjJMtOcQWh -15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryPA9gK8kxkRr05YuWW -6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3mi4TW -nsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5j -wa19hAM8EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWz -aGHQRiapIVJpLesux+t3zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmy -KwbQBM0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES -MBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU -V0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz -WhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO -LUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm -aWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE -AcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH -K3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX -RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z -rX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx -3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq -hkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC -MErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls -XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D -lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn -aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ -YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/ -MQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow -PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB -AJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qNw8XR -IePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1q -gQdW8or5BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKy -yhwOeYHWtXBiCAEuTk8O1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAts -F/tnyMKtsc2AtJfcdgEWFelq16TheEfOhtX7MfP6Mb40qij7cEwdScevLJ1tZqa2 -jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wovJ5pGfaENda1UhhXcSTvx -ls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7Q3hub/FC -VGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHK -YS1tB6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoH -EgKXTiCQ8P8NHuJBO9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThN -Xo+EHWbNxWCWtFJaBYmOlXqYwZE8lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1Ud -DgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNVHRMEBTADAQH/MDkGBGcqBwAE -MTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg209yewDL7MTqK -UWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ -TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyf -qzvS/3WXy6TjZwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaK -ZEk9GhiHkASfQlK3T8v+R0F2Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFE -JPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlUD7gsL0u8qV1bYH+Mh6XgUmMqvtg7 -hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6QzDxARvBMB1uUO07+1 -EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+HbkZ6Mm -nD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WX -udpVBrkk7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44Vbnz -ssQwmSNOXfJIoRIM3BKQCZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDe -LMDDav7v3Aun+kbfYNucpllQdSNpc5Oy+fwC00fmcc4QAu4njIT/rEUNE1yDMuAl -pYYsfPQS ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAw -NzEUMBIGA1UECgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJv -b3QgQ0EgdjEwHhcNMDcxMDE4MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYD -VQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwWVGVsaWFTb25lcmEgUm9vdCBDQSB2 -MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+6yfwIaPzaSZVfp3F -VRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA3GV1 -7CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+X -Z75Ljo1kB1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+ -/jXh7VB7qTCNGdMJjmhnXb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs -81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxHoLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkm -dtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3F0fUTPHSiXk+TT2YqGHe -Oh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJoWjiUIMu -sDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4 -pgd7gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fs -slESl1MpWtTwEhDcTwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQ -arMCpgKIv7NHfirZ1fpoeDVNAgMBAAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYD -VR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qWDNXr+nuqF+gTEjANBgkqhkiG -9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNmzqjMDfz1mgbl -dxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx -0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1Tj -TQpgcmLNkQfWpb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBed -Y2gea+zDTYa4EzAvXUYNR0PVG6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7 -Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpcc41teyWRyu5FrgZLAMzTsVlQ2jqI -OylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOTJsjrDNYmiLbAJM+7 -vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2qReW -t88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcn -HL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx -SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD -VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy -dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t -MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB -MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG -A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp -b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl -cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv -bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE -VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ -ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR -uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG -9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI -hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM -pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD -VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm -MCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx -MDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3 -dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl -cyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3 -DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD -gY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91 -yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX -L+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj -EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG -7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e -QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ -qdq5snUb9kLy78fyGPmJvKP/iiMucEc= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBF -MQswCQYDVQQGEwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQL -ExNUcnVzdGlzIEZQUyBSb290IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTEx -MzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNVBAoTD1RydXN0aXMgTGltaXRlZDEc -MBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQRUN+ -AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihH -iTHcDnlkH5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjj -vSkCqPoc4Vu5g6hBSLwacY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA -0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zto3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlB -OrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEAAaNTMFEwDwYDVR0TAQH/ -BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAdBgNVHQ4E -FgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01 -GX2cGE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmW -zaD+vkAMXBJV+JOCyinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP4 -1BIy+Q7DsdwyhEQsb8tGD+pmQQ9P8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZE -f1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHVl/9D7S3B2l0pKoU/rGXuhg8F -jZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYliB6XzCGcKQEN -ZetX2fNXlrtIzYE= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRS -MRgwFgYDVQQHDA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJp -bGltc2VsIHZlIFRla25vbG9qaWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSw -VEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ryb25payB2ZSBLcmlwdG9sb2ppIEFy -YcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNVBAsMGkthbXUgU2Vy -dGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUgS8O2 -ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAe -Fw0wNzA4MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIx -GDAWBgNVBAcMD0dlYnplIC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmls -aW1zZWwgdmUgVGVrbm9sb2ppayBBcmHFn3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBU -QUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZlIEtyaXB0b2xvamkgQXJh -xZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2FtdSBTZXJ0 -aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7Zr -IFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4h -gb46ezzb8R1Sf1n68yJMlaCQvEhOEav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yK -O7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1xnnRFDDtG1hba+818qEhTsXO -fJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR6Oqeyjh1jmKw -lZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL -hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQID -AQABo0IwQDAdBgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/ -BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmP -NOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4N5EY3ATIZJkrGG2AA1nJrvhY0D7t -wyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLTy9LQQfMmNkqblWwM -7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYhLBOh -gLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5n -oN+J1q2MdqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUs -yZyQ2uypQjyttgI= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB -kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug -Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho -dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw -IFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG -EwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD -VQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu -dXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6 -E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ -D0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK -4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq -lXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW -bfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB -o4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT -MtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js -LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr -BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB -AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft -Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj -j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH -KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv -2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3 -mfnGV/TJVTl4uix5yaaIK/QI ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCB -rjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug -Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho -dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0BgNVBAMTLVVUTi1VU0VSRmlyc3Qt -Q2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05OTA3MDkxNzI4NTBa -Fw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAV -BgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5l -dHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UE -AxMtVVROLVVTRVJGaXJzdC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWls -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3B -YHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIxB8dOtINknS4p1aJkxIW9 -hVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8om+rWV6l -L8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLm -SGHGTPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM -1tZUOt4KpLoDd7NlyP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws -6wIDAQABo4G5MIG2MAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud -DgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNVHR8EUTBPME2gS6BJhkdodHRw -Oi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGllbnRBdXRoZW50 -aWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH -AwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u -7mFVbwQ+zznexRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0 -xtcgBEXkzYABurorbs6q15L+5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQ -rfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarVNZ1yQAOJujEdxRBoUp7fooXFXAim -eOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZw7JHpsIyYdfHb0gk -USeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB -lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug -Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho -dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt -SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG -A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe -MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v -d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh -cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn -0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ -M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a -MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd -oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI -DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy -oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD -VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0 -dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy -bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF -BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM -//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli -CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE -CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t -3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS -KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 -IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz -BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y -aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG -9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy -NTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y -LqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+ -TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y -TfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0 -LBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW -I8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw -nXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 -IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz -BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y -aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG -9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy -NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY -dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9 -WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS -v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v -UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu -IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC -W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW -ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp -U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y -aXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp -U2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg -SW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln -biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm -GUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve -fLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw -AwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ -aW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj -aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW -kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC -4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga -FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW -ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW -ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp -U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y -aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 -nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex -t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz -SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG -BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ -rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ -NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E -BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH -BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy -aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv -MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE -p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y -5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK -WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ -4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N -hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB -vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W -ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe -Fw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJVUzEX -MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0 -IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9y -IGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNh -bCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj1mCOkdeQmIN65lgZOIzF -9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGPMiJhgsWH -H26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H -LL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN -/BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT -rJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw -WTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs -exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud -DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4 -sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+ -seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz -4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+ -BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR -lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3 -7M2CYfE45k+XmCpajQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0f -zGVuDLDQVoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHi -TkVWaR94AoDa3EeRKbs2yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0G -CSqGSIb3DQEBBQUAA4GBAFgVKTk8d6PaXCUDfGD67gmZPCcQcMgMCeazh88K4hiW -NWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n0a3hUKw8fGJLj7qE1xIV -Gx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZRjXZ+Hxb ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh -c3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy -MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp -emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X -DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo -YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 -MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgdk4xWArzZbxpvUjZudVYK -VdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIqWpDBucSm -Fc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQID -AQABMA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0J -h9ZrbWB85a7FkCMMXErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2ul -uIncrKTdcu1OofdPvAbT6shkdHvClUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68 -DzFc6PLZ ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN2E1Lm0+afY8wR4 -nN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/EbRrsC+MO -8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjV -ojYJrKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjb -PG7PoBMAGrgnoeS+Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP2 -6KbqxzcSXKMpHgLZ2x87tNcPVkeBFQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vr -n5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAq2aN17O6x5q25lXQBfGfMY1a -qtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/Ny9Sn2WCVhDr4 -wTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3 -ns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrs -pSCAaWihT37ha88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4 -E1Z5T21Q6huwtVexN2ZYI/PcD98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0Ns -YXNzIDIgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH -MjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y -aXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazAe -Fw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJVUzEX -MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGlj -IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMx -KGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s -eTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjxnNuX6Zr8wgQGE75fUsjM -HiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRCwiNPStjw -DqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cC -AwEAATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9ji -nb3/7aHmZuovCfTK1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAX -rXfMSTWqz9iP0b63GJZHc2pUIjRkLbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnIn -jBJ7xUS0rg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVy -aVNpZ24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24s -IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNp -Z24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJBgNV -BAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp -Z24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIElu -Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24g -Q2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt -IEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArwoNwtUs22e5LeWU -J92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6tW8UvxDO -JxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUY -wZF7C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9o -koqQHgiBVrKtaaNS0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjN -qWm6o+sdDZykIKbBoMXRRkwXbdKsZj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/E -Srg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0JhU8wI1NQ0kdvekhktdmnLfe -xbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf0xwLRtxyID+u -7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU -sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RI -sH/7NiXaldDxJBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTP -cjnhsUPgKM+351psE2tJs//jGHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE -BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is -I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G -CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i -2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ -2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh -c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy -MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp -emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X -DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo -YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 -MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4 -pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0 -13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID -AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk -U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i -F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY -oJ2daZH9 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b -N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t -KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu -kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm -CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ -Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu -imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te -2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe -DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p -F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt -TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK3LpRFpxlmr8Y+1 -GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaStBO3IFsJ -+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0Gbd -U6LM8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLm -NxdLMEYH5IBtptiWLugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XY -ufTsgsbSPZUd5cBPhMnZo0QoBmrXRazwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ -ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAj/ola09b5KROJ1WrIhVZPMq1 -CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXttmhwwjIDLk5Mq -g6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm -fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c -2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/ -bLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBr -MQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl -cm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv -bW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2WhcNMjIwNjI0MDAxNjEyWjBrMQsw -CQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5h -dGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1l -cmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h -2mCxlCfLF9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4E -lpF7sDPwsRROEW+1QK8bRaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdV -ZqW1LS7YgFmypw23RuwhY/81q6UCzyr0TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq -299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI/k4+oKsGGelT84ATB+0t -vz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzsGHxBvfaL -dXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD -AgEGMB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUF -AAOCAQEAX/FBfXxcCLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcR -zCSs00Rsca4BIGsDoo8Ytyk6feUWYFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3 -LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pzzkWKsKZJ/0x9nXGIxHYdkFsd -7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBuYQa7FkKMcPcw -++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt -398znM/jra6O1I7mT1GvFpLgXPYHDw== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMx -IDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxs -cyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9v -dCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDcxMjEzMTcwNzU0WhcNMjIxMjE0 -MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdl -bGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQD -DC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+r -WxxTkqxtnt3CxC5FlAM1iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjU -Dk/41itMpBb570OYj7OeUt9tkTmPOL13i0Nj67eT/DBMHAGTthP796EfvyXhdDcs -HqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8bJVhHlfXBIEyg1J55oNj -z7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiBK0HmOFaf -SZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/Slwxl -AgMBAAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqG -KGh0dHA6Ly9jcmwucGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0P -AQH/BAQDAgHGMB0GA1UdDgQWBBQmlRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0j -BIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGBi6SBiDCBhTELMAkGA1UEBhMC -VVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNX -ZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg -Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEB -ALkVsUSRzCPIK0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd -/ZDJPHV3V3p9+N701NX3leZ0bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pB -A4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSljqHyita04pO2t/caaH/+Xc/77szWn -k4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+esE2fDbbFwRnzVlhE9 -iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJtylv -2G0xffX8oRAHh84vWdw+WNs= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB -gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk -MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY -UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx -NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 -dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy -dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 -38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP -KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q -DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 -qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa -JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi -PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P -BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs -jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 -eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD -ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR -vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt -qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa -IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy -i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ -O+7ETPTsJ3xCwnR8gooJybQDJbw= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYT -AlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBD -QTAeFw0wNjA3MDQxNzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJP -MREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCC -ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7IJUqOtdu0KBuqV5Do -0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHHrfAQ -UySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5d -RdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQ -OA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv -JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08C -AwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0O -BBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJ -LjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecY -MnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ -44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I -Jd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw -i/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN -9u6wWk5JRFRYX0KD ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe -MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0 -ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe -Fw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw -IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL -SSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF -AAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH -SyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh -ijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X -DZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1 -TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX12ruOzjjK9SXDrkb5wdJ -fzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0OWQqraffA -sgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uU -WH1+ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLS -nT0IFaUQAS2zMnaolQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pH -dmX2Os+PYhcZewoozRrSgx4hxyy/vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJip -NiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXiZo1jDiVN1Rmy5nk3pyKdVDEC -AwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/QkqiMAwGA1UdEwQF -MAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH -ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB -uvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl -PwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP -JXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/ -gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2 -j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6 -5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB -o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS -/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z -Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE -W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D -hNQ+IIX3Sj0rnP0qCglN6oH4EZw= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB -qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf -Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw -MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV -BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw -NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j -LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG -A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs -W0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta -3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk -6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6 -Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J -NqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA -MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP -r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU -DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz -YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX -xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2 -/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ -LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 -jVaMaA== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL -MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp -IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi -BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw -MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh -d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig -YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v -dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/ -BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6 -papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K -DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3 -KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox -XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB -rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf -Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw -MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV -BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa -Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl -LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u -MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl -ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm -gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8 -YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf -b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9 -9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S -zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk -OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV -HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA -2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW -oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu -t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c -KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM -m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu -MdRAGmI0Nj81Aa6sY6A= ------END CERTIFICATE-----`) diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/device.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/device.go deleted file mode 100644 index d1e2b23f9caa..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/device.go +++ /dev/null @@ -1,110 +0,0 @@ -package goscaleio - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "reflect" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -type Device struct { - Device *types.Device - client *Client -} - -func NewDevice(client *Client) *Device { - return &Device{ - Device: new(types.Device), - client: client, - } -} - -func NewDeviceEx(client *Client, device *types.Device) *Device { - return &Device{ - Device: device, - client: client, - } -} - -func (storagePool *StoragePool) AttachDevice(path string, sdsID string) (string, error) { - endpoint := storagePool.client.SIOEndpoint - - deviceParam := &types.DeviceParam{} - deviceParam.Name = path - deviceParam.DeviceCurrentPathname = path - deviceParam.StoragePoolID = storagePool.StoragePool.ID - deviceParam.SdsID = sdsID - deviceParam.TestMode = "testAndActivate" - - jsonOutput, err := json.Marshal(&deviceParam) - if err != nil { - return "", fmt.Errorf("error marshaling: %s", err) - } - endpoint.Path = fmt.Sprintf("/api/types/Device/instances") - - req := storagePool.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", storagePool.client.Token) - req.Header.Add("Accept", "application/json;version="+storagePool.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+storagePool.client.configConnect.Version) - - resp, err := storagePool.client.retryCheckResp(&storagePool.client.Http, req) - if err != nil { - return "", err - } - defer resp.Body.Close() - - bs, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "", errors.New("error reading body") - } - - var dev types.DeviceResp - err = json.Unmarshal(bs, &dev) - if err != nil { - return "", err - } - - return dev.ID, nil -} - -func (storagePool *StoragePool) GetDevice() (devices []types.Device, err error) { - endpoint := storagePool.client.SIOEndpoint - endpoint.Path = fmt.Sprintf("/api/instances/StoragePool::%v/relationships/Device", storagePool.StoragePool.ID) - - req := storagePool.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", storagePool.client.Token) - req.Header.Add("Accept", "application/json;version="+storagePool.client.configConnect.Version) - - resp, err := storagePool.client.retryCheckResp(&storagePool.client.Http, req) - if err != nil { - return []types.Device{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = storagePool.client.decodeBody(resp, &devices); err != nil { - return []types.Device{}, fmt.Errorf("error decoding instances response: %s", err) - } - - return devices, nil -} - -func (storagePool *StoragePool) FindDevice(field, value string) (device *types.Device, err error) { - devices, err := storagePool.GetDevice() - if err != nil { - return &types.Device{}, nil - } - - for _, device := range devices { - valueOf := reflect.ValueOf(device) - switch { - case reflect.Indirect(valueOf).FieldByName(field).String() == value: - return &device, nil - } - } - - return &types.Device{}, errors.New("Couldn't find DEV") -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/instance.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/instance.go deleted file mode 100644 index 6753ea664506..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/instance.go +++ /dev/null @@ -1,228 +0,0 @@ -package goscaleio - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "strings" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -func (client *Client) GetInstance(systemhref string) (systems []*types.System, err error) { - - endpoint := client.SIOEndpoint - if systemhref == "" { - endpoint.Path += "/types/System/instances" - } else { - endpoint.Path = systemhref - } - - req := client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", client.Token) - req.Header.Add("Accept", "application/json;version="+client.configConnect.Version) - - resp, err := client.retryCheckResp(&client.Http, req) - if err != nil { - return []*types.System{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if systemhref == "" { - if err = client.decodeBody(resp, &systems); err != nil { - return []*types.System{}, fmt.Errorf("error decoding instances response: %s", err) - } - } else { - system := &types.System{} - if err = client.decodeBody(resp, &system); err != nil { - return []*types.System{}, fmt.Errorf("error decoding instances response: %s", err) - } - systems = append(systems, system) - } - - // bs, err := ioutil.ReadAll(resp.Body) - // if err != nil { - // return types.Systems{}, errors.New("error reading body") - // } - - return systems, nil -} - -func (client *Client) GetVolume(volumehref, volumeid, ancestorvolumeid, volumename string, getSnapshots bool) (volumes []*types.Volume, err error) { - - endpoint := client.SIOEndpoint - - if volumename != "" { - volumeid, err = client.FindVolumeID(volumename) - if err != nil && err.Error() == "Not found" { - return nil, nil - } - if err != nil { - return []*types.Volume{}, fmt.Errorf("Error: problem finding volume: %s", err) - } - } - - if volumeid != "" { - endpoint.Path = fmt.Sprintf("/api/instances/Volume::%s", volumeid) - } else if volumehref == "" { - endpoint.Path = "/api/types/Volume/instances" - } else { - endpoint.Path = volumehref - } - - req := client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", client.Token) - req.Header.Add("Accept", "application/json;version="+client.configConnect.Version) - - resp, err := client.retryCheckResp(&client.Http, req) - if err != nil { - return []*types.Volume{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if volumehref == "" && volumeid == "" { - if err = client.decodeBody(resp, &volumes); err != nil { - return []*types.Volume{}, fmt.Errorf("error decoding storage pool response: %s", err) - } - var volumesNew []*types.Volume - for _, volume := range volumes { - if (!getSnapshots && volume.AncestorVolumeID == ancestorvolumeid) || (getSnapshots && volume.AncestorVolumeID != "") { - volumesNew = append(volumesNew, volume) - } - } - volumes = volumesNew - } else { - volume := &types.Volume{} - if err = client.decodeBody(resp, &volume); err != nil { - return []*types.Volume{}, fmt.Errorf("error decoding instances response: %s", err) - } - volumes = append(volumes, volume) - } - return volumes, nil -} - -func (client *Client) FindVolumeID(volumename string) (volumeID string, err error) { - - endpoint := client.SIOEndpoint - - volumeQeryIdByKeyParam := &types.VolumeQeryIdByKeyParam{} - volumeQeryIdByKeyParam.Name = volumename - - jsonOutput, err := json.Marshal(&volumeQeryIdByKeyParam) - if err != nil { - return "", fmt.Errorf("error marshaling: %s", err) - } - endpoint.Path = fmt.Sprintf("/api/types/Volume/instances/action/queryIdByKey") - - req := client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", client.Token) - req.Header.Add("Accept", "application/json;version="+client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+client.configConnect.Version) - - resp, err := client.retryCheckResp(&client.Http, req) - if err != nil { - return "", err - } - defer resp.Body.Close() - - bs, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "", errors.New("error reading body") - } - - volumeID = string(bs) - - volumeID = strings.TrimRight(volumeID, `"`) - volumeID = strings.TrimLeft(volumeID, `"`) - - return volumeID, nil -} - -func (client *Client) CreateVolume(volume *types.VolumeParam, storagePoolName string) (volumeResp *types.VolumeResp, err error) { - - endpoint := client.SIOEndpoint - - endpoint.Path = "/api/types/Volume/instances" - - storagePool, err := client.FindStoragePool("", storagePoolName, "") - if err != nil { - return nil, err - } - - volume.StoragePoolID = storagePool.ID - volume.ProtectionDomainID = storagePool.ProtectionDomainID - - jsonOutput, err := json.Marshal(&volume) - if err != nil { - return &types.VolumeResp{}, fmt.Errorf("error marshaling: %s", err) - } - - req := client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", client.Token) - req.Header.Add("Accept", "application/json;version="+client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+client.configConnect.Version) - - resp, err := client.retryCheckResp(&client.Http, req) - if err != nil { - return &types.VolumeResp{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = client.decodeBody(resp, &volumeResp); err != nil { - return &types.VolumeResp{}, fmt.Errorf("error decoding volume creation response: %s", err) - } - - return volumeResp, nil -} - -func (client *Client) GetStoragePool(storagepoolhref string) (storagePools []*types.StoragePool, err error) { - - endpoint := client.SIOEndpoint - - if storagepoolhref == "" { - endpoint.Path = "/api/types/StoragePool/instances" - } else { - endpoint.Path = storagepoolhref - } - - req := client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", client.Token) - req.Header.Add("Accept", "application/json;version="+client.configConnect.Version) - - resp, err := client.retryCheckResp(&client.Http, req) - if err != nil { - return []*types.StoragePool{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if storagepoolhref == "" { - if err = client.decodeBody(resp, &storagePools); err != nil { - return []*types.StoragePool{}, fmt.Errorf("error decoding storage pool response: %s", err) - } - } else { - storagePool := &types.StoragePool{} - if err = client.decodeBody(resp, &storagePool); err != nil { - return []*types.StoragePool{}, fmt.Errorf("error decoding instances response: %s", err) - } - storagePools = append(storagePools, storagePool) - } - return storagePools, nil -} - -func (client *Client) FindStoragePool(id, name, href string) (storagePool *types.StoragePool, err error) { - storagePools, err := client.GetStoragePool(href) - if err != nil { - return &types.StoragePool{}, fmt.Errorf("Error getting storage pool %s", err) - } - - for _, storagePool = range storagePools { - if storagePool.ID == id || storagePool.Name == name || href != "" { - return storagePool, nil - } - } - - return &types.StoragePool{}, errors.New("Couldn't find storage pool") - -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/protectiondomain.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/protectiondomain.go deleted file mode 100644 index abad3e25b954..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/protectiondomain.go +++ /dev/null @@ -1,131 +0,0 @@ -package goscaleio - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -type ProtectionDomain struct { - ProtectionDomain *types.ProtectionDomain - client *Client -} - -func NewProtectionDomain(client *Client) *ProtectionDomain { - return &ProtectionDomain{ - ProtectionDomain: new(types.ProtectionDomain), - client: client, - } -} - -func NewProtectionDomainEx(client *Client, pd *types.ProtectionDomain) *ProtectionDomain { - return &ProtectionDomain{ - ProtectionDomain: pd, - client: client, - } -} - -func (system *System) CreateProtectionDomain(name string) (string, error) { - endpoint := system.client.SIOEndpoint - - protectionDomainParam := &types.ProtectionDomainParam{} - protectionDomainParam.Name = name - - jsonOutput, err := json.Marshal(&protectionDomainParam) - if err != nil { - return "", fmt.Errorf("error marshaling: %s", err) - } - endpoint.Path = fmt.Sprintf("/api/types/ProtectionDomain/instances") - - req := system.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", system.client.Token) - req.Header.Add("Accept", "application/json;version="+system.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+system.client.configConnect.Version) - - resp, err := system.client.retryCheckResp(&system.client.Http, req) - if err != nil { - return "", err - } - defer resp.Body.Close() - - bs, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "", errors.New("error reading body") - } - - var pd types.ProtectionDomainResp - err = json.Unmarshal(bs, &pd) - if err != nil { - return "", err - } - - return pd.ID, nil -} - -func (system *System) GetProtectionDomain(protectiondomainhref string) (protectionDomains []*types.ProtectionDomain, err error) { - - endpoint := system.client.SIOEndpoint - - if protectiondomainhref == "" { - link, err := GetLink(system.System.Links, "/api/System/relationship/ProtectionDomain") - if err != nil { - return []*types.ProtectionDomain{}, errors.New("Error: problem finding link") - } - - endpoint.Path = link.HREF - } else { - endpoint.Path = protectiondomainhref - } - - req := system.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", system.client.Token) - req.Header.Add("Accept", "application/json;version="+system.client.configConnect.Version) - - resp, err := system.client.retryCheckResp(&system.client.Http, req) - if err != nil { - return []*types.ProtectionDomain{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if protectiondomainhref == "" { - if err = system.client.decodeBody(resp, &protectionDomains); err != nil { - return []*types.ProtectionDomain{}, fmt.Errorf("error decoding instances response: %s", err) - } - } else { - protectionDomain := &types.ProtectionDomain{} - if err = system.client.decodeBody(resp, &protectionDomain); err != nil { - return []*types.ProtectionDomain{}, fmt.Errorf("error decoding instances response: %s", err) - } - protectionDomains = append(protectionDomains, protectionDomain) - - } - // - // bs, err := ioutil.ReadAll(resp.Body) - // if err != nil { - // return []types.ProtectionDomain{}, errors.New("error reading body") - // } - // - // fmt.Println(string(bs)) - // log.Fatalf("here") - // return []types.ProtectionDomain{}, nil - return protectionDomains, nil -} - -func (system *System) FindProtectionDomain(id, name, href string) (protectionDomain *types.ProtectionDomain, err error) { - protectionDomains, err := system.GetProtectionDomain(href) - if err != nil { - return &types.ProtectionDomain{}, fmt.Errorf("Error getting protection domains %s", err) - } - - for _, protectionDomain = range protectionDomains { - if protectionDomain.ID == id || protectionDomain.Name == name || href != "" { - return protectionDomain, nil - } - } - - return &types.ProtectionDomain{}, errors.New("Couldn't find protection domain") -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/scsiinitiator.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/scsiinitiator.go deleted file mode 100644 index d2bbc810ad3e..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/scsiinitiator.go +++ /dev/null @@ -1,35 +0,0 @@ -package goscaleio - -import ( - "fmt" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -func (system *System) GetScsiInitiator() (scsiInitiators []types.ScsiInitiator, err error) { - endpoint := system.client.SIOEndpoint - endpoint.Path = fmt.Sprintf("/api/instances/System::%v/relationships/ScsiInitiator", system.System.ID) - - req := system.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", system.client.Token) - req.Header.Add("Accept", "application/json;version="+system.client.configConnect.Version) - - resp, err := system.client.retryCheckResp(&system.client.Http, req) - if err != nil { - return []types.ScsiInitiator{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = system.client.decodeBody(resp, &scsiInitiators); err != nil { - return []types.ScsiInitiator{}, fmt.Errorf("error decoding instances response: %s", err) - } - - // bs, err := ioutil.ReadAll(resp.Body) - // if err != nil { - // return types.ScsiInitiator{}, errors.New("error reading body") - // } - // - // log.Fatalf("here") - // return types.ScsiInitiator{}, nil - return scsiInitiators, nil -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/sdc.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/sdc.go deleted file mode 100644 index a590d744aef0..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/sdc.go +++ /dev/null @@ -1,188 +0,0 @@ -package goscaleio - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "log" - "os/exec" - "reflect" - "strings" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -type Sdc struct { - Sdc *types.Sdc - client *Client -} - -func NewSdc(client *Client, sdc *types.Sdc) *Sdc { - return &Sdc{ - Sdc: sdc, - client: client, - } -} - -func (system *System) GetSdc() (sdcs []types.Sdc, err error) { - endpoint := system.client.SIOEndpoint - endpoint.Path = fmt.Sprintf("/api/instances/System::%v/relationships/Sdc", system.System.ID) - - req := system.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", system.client.Token) - req.Header.Add("Accept", "application/json;version="+system.client.configConnect.Version) - - resp, err := system.client.retryCheckResp(&system.client.Http, req) - if err != nil { - return []types.Sdc{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = system.client.decodeBody(resp, &sdcs); err != nil { - return []types.Sdc{}, fmt.Errorf("error decoding instances response: %s", err) - } - - // bs, err := ioutil.ReadAll(resp.Body) - // if err != nil { - // return []types.Sdc{}, errors.New("error reading body") - // } - // - // fmt.Println(string(bs)) - // log.Fatalf("here") - // return []types.Sdc{}, nil - return sdcs, nil -} - -func (system *System) FindSdc(field, value string) (sdc *Sdc, err error) { - sdcs, err := system.GetSdc() - if err != nil { - return &Sdc{}, nil - } - - for _, sdc := range sdcs { - valueOf := reflect.ValueOf(sdc) - switch { - case reflect.Indirect(valueOf).FieldByName(field).String() == value: - return NewSdc(system.client, &sdc), nil - } - } - - return &Sdc{}, errors.New("Couldn't find SDC") -} - -func (sdc *Sdc) GetStatistics() (statistics *types.Statistics, err error) { - endpoint := sdc.client.SIOEndpoint - - link, err := GetLink(sdc.Sdc.Links, "/api/Sdc/relationship/Statistics") - if err != nil { - return &types.Statistics{}, errors.New("Error: problem finding link") - } - endpoint.Path = link.HREF - - req := sdc.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", sdc.client.Token) - req.Header.Add("Accept", "application/json;version="+sdc.client.configConnect.Version) - - resp, err := sdc.client.retryCheckResp(&sdc.client.Http, req) - if err != nil { - return &types.Statistics{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = sdc.client.decodeBody(resp, &statistics); err != nil { - return &types.Statistics{}, fmt.Errorf("error decoding instances response: %s", err) - } - - return statistics, nil -} - -func (sdc *Sdc) GetVolume() (volumes []*types.Volume, err error) { - endpoint := sdc.client.SIOEndpoint - - link, err := GetLink(sdc.Sdc.Links, "/api/Sdc/relationship/Volume") - if err != nil { - return []*types.Volume{}, errors.New("Error: problem finding link") - } - endpoint.Path = link.HREF - - req := sdc.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", sdc.client.Token) - req.Header.Add("Accept", "application/json;version="+sdc.client.configConnect.Version) - - resp, err := sdc.client.retryCheckResp(&sdc.client.Http, req) - if err != nil { - return []*types.Volume{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = sdc.client.decodeBody(resp, &volumes); err != nil { - return []*types.Volume{}, fmt.Errorf("error decoding instances response: %s", err) - } - - return volumes, nil -} - -func GetSdcLocalGUID() (sdcGUID string, err error) { - - // get sdc kernel guid - // /bin/emc/scaleio/drv_cfg --query_guid - // sdcKernelGuid := "271bad82-08ee-44f2-a2b1-7e2787c27be1" - - out, err := exec.Command("/opt/emc/scaleio/sdc/bin/drv_cfg", "--query_guid").Output() - if err != nil { - return "", fmt.Errorf("GetSdcLocalGUID: query vols failed: %v", err) - } - - sdcGUID = strings.Replace(string(out), "\n", "", -1) - - return sdcGUID, nil -} - -func (volume *Volume) MapVolumeSdc(mapVolumeSdcParam *types.MapVolumeSdcParam) (err error) { - endpoint := volume.client.SIOEndpoint - - endpoint.Path = fmt.Sprintf("/api/instances/Volume::%s/action/addMappedSdc", volume.Volume.ID) - - jsonOutput, err := json.Marshal(&mapVolumeSdcParam) - if err != nil { - log.Fatalf("error marshaling: %s", err) - } - - req := volume.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", volume.client.Token) - req.Header.Add("Accept", "application/json;version="+volume.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+volume.client.configConnect.Version) - - resp, err := volume.client.retryCheckResp(&volume.client.Http, req) - if err != nil { - return fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - return nil -} - -func (volume *Volume) UnmapVolumeSdc(unmapVolumeSdcParam *types.UnmapVolumeSdcParam) (err error) { - endpoint := volume.client.SIOEndpoint - - endpoint.Path = fmt.Sprintf("/api/instances/Volume::%s/action/removeMappedSdc", volume.Volume.ID) - - jsonOutput, err := json.Marshal(&unmapVolumeSdcParam) - if err != nil { - return fmt.Errorf("error marshaling: %s", err) - } - - req := volume.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", volume.client.Token) - req.Header.Add("Accept", "application/json;version="+volume.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+volume.client.configConnect.Version) - - resp, err := volume.client.retryCheckResp(&volume.client.Http, req) - if err != nil { - return fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/sds.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/sds.go deleted file mode 100644 index c63d70267a0d..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/sds.go +++ /dev/null @@ -1,122 +0,0 @@ -package goscaleio - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "reflect" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -type Sds struct { - Sds *types.Sds - client *Client -} - -func NewSds(client *Client) *Sds { - return &Sds{ - Sds: new(types.Sds), - client: client, - } -} - -func NewSdsEx(client *Client, sds *types.Sds) *Sds { - return &Sds{ - Sds: sds, - client: client, - } -} - -func (protectionDomain *ProtectionDomain) CreateSds(name string, ipList []string) (string, error) { - endpoint := protectionDomain.client.SIOEndpoint - - sdsParam := &types.SdsParam{} - sdsParam.Name = name - sdsParam.ProtectionDomainID = protectionDomain.ProtectionDomain.ID - - if len(ipList) == 0 { - return "", fmt.Errorf("Must provide at least 1 SDS IP") - } else if len(ipList) == 1 { - sdsIP := types.SdsIp{IP: ipList[0], Role: "all"} - sdsIPList := &types.SdsIpList{SdsIP: sdsIP} - sdsParam.IPList = append(sdsParam.IPList, sdsIPList) - } else if len(ipList) >= 2 { - sdsIP1 := types.SdsIp{IP: ipList[0], Role: "sdcOnly"} - sdsIP2 := types.SdsIp{IP: ipList[1], Role: "sdsOnly"} - sdsIPList1 := &types.SdsIpList{SdsIP: sdsIP1} - sdsIPList2 := &types.SdsIpList{SdsIP: sdsIP2} - sdsParam.IPList = append(sdsParam.IPList, sdsIPList1) - sdsParam.IPList = append(sdsParam.IPList, sdsIPList2) - } - - jsonOutput, err := json.Marshal(&sdsParam) - if err != nil { - return "", fmt.Errorf("error marshaling: %s", err) - } - endpoint.Path = fmt.Sprintf("/api/types/Sds/instances") - - req := protectionDomain.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", protectionDomain.client.Token) - req.Header.Add("Accept", "application/json;version="+protectionDomain.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+protectionDomain.client.configConnect.Version) - - resp, err := protectionDomain.client.retryCheckResp(&protectionDomain.client.Http, req) - if err != nil { - return "", err - } - defer resp.Body.Close() - - bs, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "", errors.New("error reading body") - } - - var sds types.SdsResp - err = json.Unmarshal(bs, &sds) - if err != nil { - return "", err - } - - return sds.ID, nil -} - -func (protectionDomain *ProtectionDomain) GetSds() (sdss []types.Sds, err error) { - endpoint := protectionDomain.client.SIOEndpoint - endpoint.Path = fmt.Sprintf("/api/instances/ProtectionDomain::%v/relationships/Sds", protectionDomain.ProtectionDomain.ID) - - req := protectionDomain.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", protectionDomain.client.Token) - req.Header.Add("Accept", "application/json;version="+protectionDomain.client.configConnect.Version) - - resp, err := protectionDomain.client.retryCheckResp(&protectionDomain.client.Http, req) - if err != nil { - return []types.Sds{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = protectionDomain.client.decodeBody(resp, &sdss); err != nil { - return []types.Sds{}, fmt.Errorf("error decoding instances response: %s", err) - } - - return sdss, nil -} - -func (protectionDomain *ProtectionDomain) FindSds(field, value string) (sds *types.Sds, err error) { - sdss, err := protectionDomain.GetSds() - if err != nil { - return &types.Sds{}, nil - } - - for _, sds := range sdss { - valueOf := reflect.ValueOf(sds) - switch { - case reflect.Indirect(valueOf).FieldByName(field).String() == value: - return &sds, nil - } - } - - return &types.Sds{}, errors.New("Couldn't find SDS") -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/storagepool.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/storagepool.go deleted file mode 100644 index b9288d4d773a..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/storagepool.go +++ /dev/null @@ -1,148 +0,0 @@ -package goscaleio - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -type StoragePool struct { - StoragePool *types.StoragePool - client *Client -} - -func NewStoragePool(client *Client) *StoragePool { - return &StoragePool{ - StoragePool: new(types.StoragePool), - client: client, - } -} - -func NewStoragePoolEx(client *Client, pool *types.StoragePool) *StoragePool { - return &StoragePool{ - StoragePool: pool, - client: client, - } -} - -func (protectionDomain *ProtectionDomain) CreateStoragePool(name string) (string, error) { - endpoint := protectionDomain.client.SIOEndpoint - - storagePoolParam := &types.StoragePoolParam{} - storagePoolParam.Name = name - storagePoolParam.ProtectionDomainID = protectionDomain.ProtectionDomain.ID - - jsonOutput, err := json.Marshal(&storagePoolParam) - if err != nil { - return "", fmt.Errorf("error marshaling: %s", err) - } - endpoint.Path = fmt.Sprintf("/api/types/StoragePool/instances") - - req := protectionDomain.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", protectionDomain.client.Token) - req.Header.Add("Accept", "application/json;version="+protectionDomain.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+protectionDomain.client.configConnect.Version) - - resp, err := protectionDomain.client.retryCheckResp(&protectionDomain.client.Http, req) - if err != nil { - return "", err - } - defer resp.Body.Close() - - bs, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "", errors.New("error reading body") - } - - var sp types.StoragePoolResp - err = json.Unmarshal(bs, &sp) - if err != nil { - return "", err - } - - return sp.ID, nil -} - -func (protectionDomain *ProtectionDomain) GetStoragePool(storagepoolhref string) (storagePools []*types.StoragePool, err error) { - - endpoint := protectionDomain.client.SIOEndpoint - - if storagepoolhref == "" { - link, err := GetLink(protectionDomain.ProtectionDomain.Links, "/api/ProtectionDomain/relationship/StoragePool") - if err != nil { - return []*types.StoragePool{}, errors.New("Error: problem finding link") - } - endpoint.Path = link.HREF - } else { - endpoint.Path = storagepoolhref - } - - req := protectionDomain.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", protectionDomain.client.Token) - req.Header.Add("Accept", "application/json;version="+protectionDomain.client.configConnect.Version) - - resp, err := protectionDomain.client.retryCheckResp(&protectionDomain.client.Http, req) - if err != nil { - return []*types.StoragePool{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if storagepoolhref == "" { - if err = protectionDomain.client.decodeBody(resp, &storagePools); err != nil { - return []*types.StoragePool{}, fmt.Errorf("error decoding storage pool response: %s", err) - } - } else { - storagePool := &types.StoragePool{} - if err = protectionDomain.client.decodeBody(resp, &storagePool); err != nil { - return []*types.StoragePool{}, fmt.Errorf("error decoding instances response: %s", err) - } - storagePools = append(storagePools, storagePool) - } - return storagePools, nil -} - -func (protectionDomain *ProtectionDomain) FindStoragePool(id, name, href string) (storagePool *types.StoragePool, err error) { - storagePools, err := protectionDomain.GetStoragePool(href) - if err != nil { - return &types.StoragePool{}, fmt.Errorf("Error getting protection domains %s", err) - } - - for _, storagePool = range storagePools { - if storagePool.ID == id || storagePool.Name == name || href != "" { - return storagePool, nil - } - } - - return &types.StoragePool{}, errors.New("Couldn't find protection domain") - -} - -func (storagePool *StoragePool) GetStatistics() (statistics *types.Statistics, err error) { - link, err := GetLink(storagePool.StoragePool.Links, "/api/StoragePool/relationship/Statistics") - if err != nil { - return &types.Statistics{}, errors.New("Error: problem finding link") - } - - endpoint := storagePool.client.SIOEndpoint - endpoint.Path = link.HREF - - req := storagePool.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", storagePool.client.Token) - req.Header.Add("Accept", "application/json;version="+storagePool.client.configConnect.Version) - - resp, err := storagePool.client.retryCheckResp(&storagePool.client.Http, req) - if err != nil { - return &types.Statistics{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = storagePool.client.decodeBody(resp, &statistics); err != nil { - return &types.Statistics{}, fmt.Errorf("error decoding instances response: %s", err) - } - - return statistics, nil -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/system.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/system.go deleted file mode 100644 index ea4d9d4f8f3e..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/system.go +++ /dev/null @@ -1,106 +0,0 @@ -package goscaleio - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -type System struct { - System *types.System - client *Client -} - -func NewSystem(client *Client) *System { - return &System{ - System: new(types.System), - client: client, - } -} - -func (client *Client) FindSystem(instanceID, name, href string) (*System, error) { - systems, err := client.GetInstance(href) - if err != nil { - return &System{}, fmt.Errorf("err: problem getting instances: %s", err) - } - - for _, system := range systems { - if system.ID == instanceID || system.Name == name || href != "" { - outSystem := NewSystem(client) - outSystem.System = system - return outSystem, nil - } - } - return &System{}, fmt.Errorf("err: systemid or systemname not found") -} - -func (system *System) GetStatistics() (statistics *types.Statistics, err error) { - endpoint := system.client.SIOEndpoint - // endpoint.Path = fmt.Sprintf("/api/instances/System::%v/relationships/Statistics", system.System.ID) - - link, err := GetLink(system.System.Links, "/api/System/relationship/Statistics") - if err != nil { - return &types.Statistics{}, errors.New("Error: problem finding link") - } - - endpoint.Path = link.HREF - - req := system.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", system.client.Token) - req.Header.Add("Accept", "application/json;version="+system.client.configConnect.Version) - - resp, err := system.client.retryCheckResp(&system.client.Http, req) - if err != nil { - return &types.Statistics{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = system.client.decodeBody(resp, &statistics); err != nil { - return &types.Statistics{}, fmt.Errorf("error decoding instances response: %s", err) - } - - // bs, err := ioutil.ReadAll(resp.Body) - // if err != nil { - // return errors.New("error reading body") - // } - // - // fmt.Println(string(bs)) - return statistics, nil -} - -func (system *System) CreateSnapshotConsistencyGroup(snapshotVolumesParam *types.SnapshotVolumesParam) (snapshotVolumesResp *types.SnapshotVolumesResp, err error) { - endpoint := system.client.SIOEndpoint - - link, err := GetLink(system.System.Links, "self") - if err != nil { - return &types.SnapshotVolumesResp{}, errors.New("Error: problem finding link") - } - - endpoint.Path = fmt.Sprintf("%v/action/snapshotVolumes", link.HREF) - - jsonOutput, err := json.Marshal(&snapshotVolumesParam) - if err != nil { - return &types.SnapshotVolumesResp{}, fmt.Errorf("error marshaling: %s", err) - } - - req := system.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", system.client.Token) - req.Header.Add("Accept", "application/json;version="+system.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+system.client.configConnect.Version) - - resp, err := system.client.retryCheckResp(&system.client.Http, req) - if err != nil { - return &types.SnapshotVolumesResp{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = system.client.decodeBody(resp, &snapshotVolumesResp); err != nil { - return &types.SnapshotVolumesResp{}, fmt.Errorf("error decoding snapshotvolumes response: %s", err) - } - - return snapshotVolumesResp, nil - -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/types/v1/types.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/types/v1/types.go deleted file mode 100644 index 252cad90fdfa..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/types/v1/types.go +++ /dev/null @@ -1,388 +0,0 @@ -package goscaleio - -type Error struct { - Message string `xml:"message,attr"` - MajorErrorCode int `xml:"majorErrorCode,attr"` - MinorErrorCode string `xml:"minorErrorCode,attr"` - VendorSpecificErrorCode string `xml:"vendorSpecificErrorCode,attr,omitempty"` - StackTrace string `xml:"stackTrace,attr,omitempty"` -} - -// type session struct { -// Link []*types.Link `xml:"Link"` -// } - -type System struct { - MdmMode string `json:"mdmMode"` - MdmClusterState string `json:"mdmClusterState"` - SecondaryMdmActorIPList []string `json:"secondaryMdmActorIpList"` - InstallID string `json:"installId"` - PrimaryActorIPList []string `json:"primaryMdmActorIpList"` - SystemVersionName string `json:"systemVersionName"` - CapacityAlertHighThresholdPercent int `json:"capacityAlertHighThresholdPercent"` - CapacityAlertCriticalThresholdPercent int `json:"capacityAlertCriticalThresholdPercent"` - RemoteReadOnlyLimitState bool `json:"remoteReadOnlyLimitState"` - PrimaryMdmActorPort int `json:"primaryMdmActorPort"` - SecondaryMdmActorPort int `json:"secondaryMdmActorPort"` - TiebreakerMdmActorPort int `json:"tiebreakerMdmActorPort"` - MdmManagementPort int `json:"mdmManagementPort"` - TiebreakerMdmIPList []string `json:"tiebreakerMdmIpList"` - MdmManagementIPList []string `json:"mdmManagementIPList"` - DefaultIsVolumeObfuscated bool `json:"defaultIsVolumeObfuscated"` - RestrictedSdcModeEnabled bool `json:"restrictedSdcModeEnabled"` - Swid string `json:"swid"` - DaysInstalled int `json:"daysInstalled"` - MaxCapacityInGb string `json:"maxCapacityInGb"` - CapacityTimeLeftInDays string `json:"capacityTimeLeftInDays"` - EnterpriseFeaturesEnabled bool `json:"enterpriseFeaturesEnabled"` - IsInitialLicense bool `json:"isInitialLicense"` - Name string `json:"name"` - ID string `json:"id"` - Links []*Link `json:"links"` -} - -type Link struct { - Rel string `json:"rel"` - HREF string `json:"href"` -} - -type BWC struct { - TotalWeightInKb int `json:"totalWeightInKb"` - NumOccured int `json:"numOccured"` - NumSeconds int `json:"numSeconds"` -} - -type Statistics struct { - PrimaryReadFromDevBwc BWC `json:"primaryReadFromDevBwc"` - NumOfStoragePools int `json:"numOfStoragePools"` - ProtectedCapacityInKb int `json:"protectedCapacityInKb"` - MovingCapacityInKb int `json:"movingCapacityInKb"` - SnapCapacityInUseOccupiedInKb int `json:"snapCapacityInUseOccupiedInKb"` - SnapCapacityInUseInKb int `json:"snapCapacityInUseInKb"` - ActiveFwdRebuildCapacityInKb int `json:"activeFwdRebuildCapacityInKb"` - DegradedHealthyVacInKb int `json:"degradedHealthyVacInKb"` - ActiveMovingRebalanceJobs int `json:"activeMovingRebalanceJobs"` - TotalReadBwc BWC `json:"totalReadBwc"` - MaxCapacityInKb int `json:"maxCapacityInKb"` - PendingBckRebuildCapacityInKb int `json:"pendingBckRebuildCapacityInKb"` - ActiveMovingOutFwdRebuildJobs int `json:"activeMovingOutFwdRebuildJobs"` - CapacityLimitInKb int `json:"capacityLimitInKb"` - SecondaryVacInKb int `json:"secondaryVacInKb"` - PendingFwdRebuildCapacityInKb int `json:"pendingFwdRebuildCapacityInKb"` - ThinCapacityInUseInKb int `json:"thinCapacityInUseInKb"` - AtRestCapacityInKb int `json:"atRestCapacityInKb"` - ActiveMovingInBckRebuildJobs int `json:"activeMovingInBckRebuildJobs"` - DegradedHealthyCapacityInKb int `json:"degradedHealthyCapacityInKb"` - NumOfScsiInitiators int `json:"numOfScsiInitiators"` - NumOfUnmappedVolumes int `json:"numOfUnmappedVolumes"` - FailedCapacityInKb int `json:"failedCapacityInKb"` - SecondaryReadFromDevBwc BWC `json:"secondaryReadFromDevBwc"` - NumOfVolumes int `json:"numOfVolumes"` - SecondaryWriteBwc BWC `json:"secondaryWriteBwc"` - ActiveBckRebuildCapacityInKb int `json:"activeBckRebuildCapacityInKb"` - FailedVacInKb int `json:"failedVacInKb"` - PendingMovingCapacityInKb int `json:"pendingMovingCapacityInKb"` - ActiveMovingInRebalanceJobs int `json:"activeMovingInRebalanceJobs"` - PendingMovingInRebalanceJobs int `json:"pendingMovingInRebalanceJobs"` - BckRebuildReadBwc BWC `json:"bckRebuildReadBwc"` - DegradedFailedVacInKb int `json:"degradedFailedVacInKb"` - NumOfSnapshots int `json:"numOfSnapshots"` - RebalanceCapacityInKb int `json:"rebalanceCapacityInKb"` - fwdRebuildReadBwc BWC `json:"fwdRebuildReadBwc"` - NumOfSdc int `json:"numOfSdc"` - ActiveMovingInFwdRebuildJobs int `json:"activeMovingInFwdRebuildJobs"` - NumOfVtrees int `json:"numOfVtrees"` - ThickCapacityInUseInKb int `json:"thickCapacityInUseInKb"` - ProtectedVacInKb int `json:"protectedVacInKb"` - PendingMovingInBckRebuildJobs int `json:"pendingMovingInBckRebuildJobs"` - CapacityAvailableForVolumeAllocationInKb int `json:"capacityAvailableForVolumeAllocationInKb"` - PendingRebalanceCapacityInKb int `json:"pendingRebalanceCapacityInKb"` - PendingMovingRebalanceJobs int `json:"pendingMovingRebalanceJobs"` - NumOfProtectionDomains int `json:"numOfProtectionDomains"` - NumOfSds int `json:"numOfSds"` - CapacityInUseInKb int `json:"capacityInUseInKb"` - BckRebuildWriteBwc BWC `json:"bckRebuildWriteBwc"` - DegradedFailedCapacityInKb int `json:"degradedFailedCapacityInKb"` - NumOfThinBaseVolumes int `json:"numOfThinBaseVolumes"` - PendingMovingOutFwdRebuildJobs int `json:"pendingMovingOutFwdRebuildJobs"` - SecondaryReadBwc BWC `json:"secondaryReadBwc"` - PendingMovingOutBckRebuildJobs int `json:"pendingMovingOutBckRebuildJobs"` - RebalanceWriteBwc BWC `json:"rebalanceWriteBwc"` - PrimaryReadBwc BWC `json:"primaryReadBwc"` - NumOfVolumesInDeletion int `json:"numOfVolumesInDeletion"` - NumOfDevices int `json:"numOfDevices"` - RebalanceReadBwc BWC `json:"rebalanceReadBwc"` - InUseVacInKb int `json:"inUseVacInKb"` - UnreachableUnusedCapacityInKb int `json:"unreachableUnusedCapacityInKb"` - TotalWriteBwc BWC `json:"totalWriteBwc"` - SpareCapacityInKb int `json:"spareCapacityInKb"` - ActiveMovingOutBckRebuildJobs int `json:"activeMovingOutBckRebuildJobs"` - PrimaryVacInKb int `json:"primaryVacInKb"` - NumOfThickBaseVolumes int `json:"numOfThickBaseVolumes"` - BckRebuildCapacityInKb int `json:"bckRebuildCapacityInKb"` - NumOfMappedToAllVolumes int `json:"numOfMappedToAllVolumes"` - ActiveMovingCapacityInKb int `json:"activeMovingCapacityInKb"` - PendingMovingInFwdRebuildJobs int `json:"pendingMovingInFwdRebuildJobs"` - ActiveRebalanceCapacityInKb int `json:"activeRebalanceCapacityInKb"` - RmcacheSizeInKb int `json:"rmcacheSizeInKb"` - FwdRebuildCapacityInKb int `json:"fwdRebuildCapacityInKb"` - FwdRebuildWriteBwc BWC `json:"fwdRebuildWriteBwc"` - PrimaryWriteBwc BWC `json:"primaryWriteBwc"` -} - -type User struct { - SystemID string `json:"systemId"` - UserRole string `json:"userRole"` - PasswordChangeRequire bool `json:"passwordChangeRequired"` - Name string `json:"name"` - ID string `json:"id"` - Links []*Link `json:"links"` -} - -type ScsiInitiator struct { - Name string `json:"name"` - IQN string `json:"iqn"` - SystemID string `json:"systemID"` - Links []*Link `json:"links"` -} - -type ProtectionDomain struct { - SystemID string `json:"systemId"` - RebuildNetworkThrottlingInKbps int `json:"rebuildNetworkThrottlingInKbps"` - RebalanceNetworkThrottlingInKbps int `json:"rebalanceNetworkThrottlingInKbps"` - OverallIoNetworkThrottlingInKbps int `json:"overallIoNetworkThrottlingInKbps"` - OverallIoNetworkThrottlingEnabled bool `json:"overallIoNetworkThrottlingEnabled"` - RebuildNetworkThrottlingEnabled bool `json:"rebuildNetworkThrottlingEnabled"` - RebalanceNetworkThrottlingEnabled bool `json:"rebalanceNetworkThrottlingEnabled"` - ProtectionDomainState string `json:"protectionDomainState"` - Name string `json:"name"` - ID string `json:"id"` - Links []*Link `json:"links"` -} - -type ProtectionDomainParam struct { - Name string `json:"name"` -} - -type ProtectionDomainResp struct { - ID string `json:"id"` -} - -type Sdc struct { - SystemID string `json:"systemId"` - SdcApproved bool `json:"sdcApproved"` - SdcIp string `json:"SdcIp"` - OnVmWare bool `json:"onVmWare"` - SdcGuid string `json:"sdcGuid"` - MdmConnectionState string `json:"mdmConnectionState"` - Name string `json:"name"` - ID string `json:"id"` - Links []*Link `json:"links"` -} - -type SdsIp struct { - IP string `json:"ip"` - Role string `json:"role"` -} - -type SdsIpList struct { - SdsIP SdsIp `json:"SdsIp"` -} - -type Sds struct { - ID string `json:"id"` - Name string `json:"name,omitempty"` - ProtectionDomainID string `json:"protectionDomainId"` - IPList []*SdsIpList `json:"ipList"` - Port int `json:"port,omitempty"` - SdsState string `json:"sdsState"` - MembershipState string `json:"membershipState"` - MdmConnectionState string `json:"mdmConnectionState"` - DrlMode string `json:"drlMode,omitempty"` - RmcacheEnabled bool `json:"rmcacheEnabled,omitempty"` - RmcacheSizeInKb int `json:"rmcacheSizeInKb,omitempty"` - RmcacheFrozen bool `json:"rmcacheFrozen,omitempty"` - IsOnVMware bool `json:"isOnVmWare,omitempty"` - FaultSetID string `json:"faultSetId,omitempty"` - NumOfIoBuffers int `json:"numOfIoBuffers,omitempty"` - RmcacheMemoryAllocationState string `json:"RmcacheMemoryAllocationState,omitempty"` -} - -type DeviceInfo struct { - DevicePath string `json:"devicePath"` - StoragePoolID string `json:"storagePoolId"` - DeviceName string `json:"deviceName,omitempty"` -} - -type SdsParam struct { - Name string `json:"name,omitempty"` - IPList []*SdsIpList `json:"sdsIpList"` - Port int `json:"sdsPort,omitempty"` - DrlMode string `json:"drlMode,omitempty"` - RmcacheEnabled bool `json:"rmcacheEnabled,omitempty"` - RmcacheSizeInKb int `json:"rmcacheSizeInKb,omitempty"` - RmcacheFrozen bool `json:"rmcacheFrozen,omitempty"` - ProtectionDomainID string `json:"protectionDomainId"` - FaultSetID string `json:"faultSetId,omitempty"` - NumOfIoBuffers int `json:"numOfIoBuffers,omitempty"` - DeviceInfoList []*DeviceInfo `json:"deviceInfoList,omitempty"` - ForceClean bool `json:"forceClean,omitempty"` - DeviceTestTimeSecs int `json:"deviceTestTimeSecs ,omitempty"` - DeviceTestMode string `json:"deviceTestMode,omitempty"` -} - -type SdsResp struct { - ID string `json:"id"` -} - -type Device struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - DeviceCurrentPathname string `json:"deviceCurrentPathname"` - DeviceOriginalPathname string `json:"deviceOriginalPathname,omitempty"` - DeviceState string `json:"deviceState,omitempty"` - ErrorState string `json:"errorState,omitempty"` - CapacityLimitInKb int `json:"capacityLimitInKb,omitempty"` - MaxCapacityInKb int `json:"maxCapacityInKb,omitempty"` - StoragePoolID string `json:"storagePoolId"` - SdsID string `json:"sdsId"` -} - -type DeviceParam struct { - Name string `json:"name,omitempty"` - DeviceCurrentPathname string `json:"deviceCurrentPathname"` - CapacityLimitInKb int `json:"capacityLimitInKb,omitempty"` - StoragePoolID string `json:"storagePoolId"` - SdsID string `json:"sdsId"` - TestTimeSecs int `json:"testTimeSecs,omitempty"` - TestMode string `json:"testMode,omitempty"` -} - -type DeviceResp struct { - ID string `json:"id"` -} - -type StoragePool struct { - ProtectionDomainID string `json:"protectionDomainId"` - RebalanceioPriorityPolicy string `json:"rebalanceIoPriorityPolicy"` - RebuildioPriorityPolicy string `json:"rebuildIoPriorityPolicy"` - RebuildioPriorityBwLimitPerDeviceInKbps int `json:"rebuildIoPriorityBwLimitPerDeviceInKbps"` - RebuildioPriorityNumOfConcurrentIosPerDevice int `json:"rebuildIoPriorityNumOfConcurrentIosPerDevice"` - RebalanceioPriorityNumOfConcurrentIosPerDevice int `json:"rebalanceIoPriorityNumOfConcurrentIosPerDevice"` - RebalanceioPriorityBwLimitPerDeviceInKbps int `json:"rebalanceIoPriorityBwLimitPerDeviceInKbps"` - RebuildioPriorityAppIopsPerDeviceThreshold int `json:"rebuildIoPriorityAppIopsPerDeviceThreshold"` - RebalanceioPriorityAppIopsPerDeviceThreshold int `json:"rebalanceIoPriorityAppIopsPerDeviceThreshold"` - RebuildioPriorityAppBwPerDeviceThresholdInKbps int `json:"rebuildIoPriorityAppBwPerDeviceThresholdInKbps"` - RebalanceioPriorityAppBwPerDeviceThresholdInKbps int `json:"rebalanceIoPriorityAppBwPerDeviceThresholdInKbps"` - RebuildioPriorityQuietPeriodInMsec int `json:"rebuildIoPriorityQuietPeriodInMsec"` - RebalanceioPriorityQuietPeriodInMsec int `json:"rebalanceIoPriorityQuietPeriodInMsec"` - ZeroPaddingEnabled bool `json:"zeroPaddingEnabled"` - UseRmcache bool `json:"useRmcache"` - SparePercentage int `json:"sparePercentage"` - RmCacheWriteHandlingMode string `json:"rmcacheWriteHandlingMode"` - RebuildEnabled bool `json:"rebuildEnabled"` - RebalanceEnabled bool `json:"rebalanceEnabled"` - NumofParallelRebuildRebalanceJobsPerDevice int `json:"numOfParallelRebuildRebalanceJobsPerDevice"` - Name string `json:"name"` - ID string `json:"id"` - Links []*Link `json:"links"` -} - -type StoragePoolParam struct { - Name string `json:"name"` - SparePercentage int `json:"sparePercentage,omitempty"` - RebuildEnabled bool `json:"rebuildEnabled,omitempty"` - RebalanceEnabled bool `json:"rebalanceEnabled,omitempty"` - ProtectionDomainID string `json:"protectionDomainId"` - ZeroPaddingEnabled bool `json:"zeroPaddingEnabled,omitempty"` - UseRmcache bool `json:"useRmcache,omitempty"` - RmcacheWriteHandlingMode string `json:"rmcacheWriteHandlingMode,omitempty"` -} - -type StoragePoolResp struct { - ID string `json:"id"` -} - -type MappedSdcInfo struct { - SdcID string `json:"sdcId"` - SdcIP string `json:"sdcIp"` - LimitIops int `json:"limitIops"` - LimitBwInMbps int `json:"limitBwInMbps"` -} - -type Volume struct { - StoragePoolID string `json:"storagePoolId"` - UseRmCache bool `json:"useRmcache"` - MappingToAllSdcsEnabled bool `json:"mappingToAllSdcsEnabled"` - MappedSdcInfo []*MappedSdcInfo `json:"mappedSdcInfo"` - IsObfuscated bool `json:"isObfuscated"` - VolumeType string `json:"volumeType"` - ConsistencyGroupID string `json:"consistencyGroupId"` - VTreeID string `json:"vtreeId"` - AncestorVolumeID string `json:"ancestorVolumeId"` - MappedScsiInitiatorInfo string `json:"mappedScsiInitiatorInfo"` - SizeInKb int `json:"sizeInKb"` - CreationTime int `json:"creationTime"` - Name string `json:"name"` - ID string `json:"id"` - Links []*Link `json:"links"` -} - -type VolumeParam struct { - ProtectionDomainID string `json:"protectionDomainId,omitempty"` - StoragePoolID string `json:"storagePoolId,omitempty"` - UseRmCache string `json:"useRmcache,omitempty"` - VolumeType string `json:"volumeType,omitempty"` - VolumeSizeInKb string `json:"volumeSizeInKb,omitempty"` - Name string `json:"name,omitempty"` -} - -type VolumeResp struct { - ID string `json:"id"` -} - -type VolumeQeryIdByKeyParam struct { - Name string `json:"name"` -} - -type VolumeQeryBySelectedIdsParam struct { - IDs []string `json:"ids"` -} - -type MapVolumeSdcParam struct { - SdcID string `json:"sdcId,omitempty"` - AllowMultipleMappings string `json:"allowMultipleMappings,omitempty"` - AllSdcs string `json:"allSdcs,omitempty"` -} - -type UnmapVolumeSdcParam struct { - SdcID string `json:"sdcId,omitempty"` - IgnoreScsiInitiators string `json:"ignoreScsiInitiators,omitempty"` - AllSdcs string `json:"allSdcs,omitempty"` -} - -type SnapshotDef struct { - VolumeID string `json:"volumeId,omitempty"` - SnapshotName string `json:"snapshotName,omitempty"` -} - -type SnapshotVolumesParam struct { - SnapshotDefs []*SnapshotDef `json:"snapshotDefs"` -} - -type SnapshotVolumesResp struct { - VolumeIDList []string `json:"volumeIdList"` - SnapshotGroupID string `json:"snapshotGroupId"` -} - -type VTree struct { - ID string `json:"id"` - Name string `json:"name"` - BaseVolumeID string `json:"baseVolumeId"` - StoragePoolID string `json:"storagePoolId"` - Links []*Link `json:"links"` -} - -type RemoveVolumeParam struct { - RemoveMode string `json:"removeMode"` -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/user.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/user.go deleted file mode 100644 index a322fa47d29f..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/user.go +++ /dev/null @@ -1,35 +0,0 @@ -package goscaleio - -import ( - "fmt" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -func (system *System) GetUser() (user []types.User, err error) { - endpoint := system.client.SIOEndpoint - endpoint.Path = fmt.Sprintf("/api/instances/System::%v/relationships/User", system.System.ID) - - req := system.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", system.client.Token) - req.Header.Add("Accept", "application/json;version="+system.client.configConnect.Version) - - resp, err := system.client.retryCheckResp(&system.client.Http, req) - if err != nil { - return []types.User{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = system.client.decodeBody(resp, &user); err != nil { - return []types.User{}, fmt.Errorf("error decoding instances response: %s", err) - } - - // bs, err := ioutil.ReadAll(resp.Body) - // if err != nil { - // return types.User{}, errors.New("error reading body") - // } - // - // fmt.Println(string(bs)) - // return types.User{}, nil - return user, nil -} diff --git a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/volume.go b/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/volume.go deleted file mode 100644 index 7fce6ef00a40..000000000000 --- a/cluster-autoscaler/vendor/github.com/thecodeteam/goscaleio/volume.go +++ /dev/null @@ -1,279 +0,0 @@ -package goscaleio - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "os/exec" - "path/filepath" - "regexp" - "sort" - "strings" - - types "github.com/thecodeteam/goscaleio/types/v1" -) - -type SdcMappedVolume struct { - MdmID string - VolumeID string - SdcDevice string - // Mounted bool - // MountPath bool - // Mapped bool -} - -type Volume struct { - Volume *types.Volume - client *Client -} - -func NewVolume(client *Client) *Volume { - return &Volume{ - Volume: new(types.Volume), - client: client, - } -} - -func (storagePool *StoragePool) GetVolume(volumehref, volumeid, ancestorvolumeid, volumename string, getSnapshots bool) (volumes []*types.Volume, err error) { - - endpoint := storagePool.client.SIOEndpoint - - if volumename != "" { - volumeid, err = storagePool.FindVolumeID(volumename) - if err != nil && err.Error() == "Not found" { - return nil, nil - } - if err != nil { - return []*types.Volume{}, fmt.Errorf("Error: problem finding volume: %s", err) - } - } - - if volumeid != "" { - endpoint.Path = fmt.Sprintf("/api/instances/Volume::%s", volumeid) - } else if volumehref == "" { - link, err := GetLink(storagePool.StoragePool.Links, "/api/StoragePool/relationship/Volume") - if err != nil { - return []*types.Volume{}, errors.New("Error: problem finding link") - } - endpoint.Path = link.HREF - } else { - endpoint.Path = volumehref - } - - req := storagePool.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", storagePool.client.Token) - req.Header.Add("Accept", "application/json;version="+storagePool.client.configConnect.Version) - - resp, err := storagePool.client.retryCheckResp(&storagePool.client.Http, req) - if err != nil { - return []*types.Volume{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if volumehref == "" && volumeid == "" { - if err = storagePool.client.decodeBody(resp, &volumes); err != nil { - return []*types.Volume{}, fmt.Errorf("error decoding storage pool response: %s", err) - } - var volumesNew []*types.Volume - for _, volume := range volumes { - if (!getSnapshots && volume.AncestorVolumeID == ancestorvolumeid) || (getSnapshots && volume.AncestorVolumeID != "") { - volumesNew = append(volumesNew, volume) - } - } - volumes = volumesNew - } else { - volume := &types.Volume{} - if err = storagePool.client.decodeBody(resp, &volume); err != nil { - return []*types.Volume{}, fmt.Errorf("error decoding instances response: %s", err) - } - volumes = append(volumes, volume) - } - return volumes, nil -} - -func (storagePool *StoragePool) FindVolumeID(volumename string) (volumeID string, err error) { - - endpoint := storagePool.client.SIOEndpoint - - volumeQeryIdByKeyParam := &types.VolumeQeryIdByKeyParam{} - volumeQeryIdByKeyParam.Name = volumename - - jsonOutput, err := json.Marshal(&volumeQeryIdByKeyParam) - if err != nil { - return "", fmt.Errorf("error marshaling: %s", err) - } - endpoint.Path = fmt.Sprintf("/api/types/Volume/instances/action/queryIdByKey") - - req := storagePool.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", storagePool.client.Token) - req.Header.Add("Accept", "application/json;version="+storagePool.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+storagePool.client.configConnect.Version) - - resp, err := storagePool.client.retryCheckResp(&storagePool.client.Http, req) - if err != nil { - return "", err - } - defer resp.Body.Close() - - bs, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "", errors.New("error reading body") - } - - volumeID = string(bs) - - volumeID = strings.TrimRight(volumeID, `"`) - volumeID = strings.TrimLeft(volumeID, `"`) - - return volumeID, nil -} - -func GetLocalVolumeMap() (mappedVolumes []*SdcMappedVolume, err error) { - - // get sdc kernel guid - // /bin/emc/scaleio/drv_cfg --query_guid - // sdcKernelGuid := "271bad82-08ee-44f2-a2b1-7e2787c27be1" - - mappedVolumesMap := make(map[string]*SdcMappedVolume) - - out, err := exec.Command("/opt/emc/scaleio/sdc/bin/drv_cfg", "--query_vols").Output() - if err != nil { - return []*SdcMappedVolume{}, - fmt.Errorf("GetLocalVolumeMap: query vols failed: %v", err) - } - - result := string(out) - lines := strings.Split(result, "\n") - - for _, line := range lines { - split := strings.Split(line, " ") - if split[0] == "VOL-ID" { - mappedVolume := &SdcMappedVolume{MdmID: split[3], VolumeID: split[1]} - mdmVolumeID := fmt.Sprintf("%s-%s", mappedVolume.MdmID, mappedVolume.VolumeID) - mappedVolumesMap[mdmVolumeID] = mappedVolume - } - } - - diskIDPath := "/dev/disk/by-id" - files, _ := ioutil.ReadDir(diskIDPath) - r, _ := regexp.Compile(`^emc-vol-\w*-\w*$`) - for _, f := range files { - matched := r.MatchString(f.Name()) - if matched { - mdmVolumeID := strings.Replace(f.Name(), "emc-vol-", "", 1) - devPath, _ := filepath.EvalSymlinks(fmt.Sprintf("%s/%s", diskIDPath, f.Name())) - if _, ok := mappedVolumesMap[mdmVolumeID]; ok { - mappedVolumesMap[mdmVolumeID].SdcDevice = devPath - } - } - } - - keys := make([]string, 0, len(mappedVolumesMap)) - for key := range mappedVolumesMap { - keys = append(keys, key) - } - sort.Strings(keys) - - for _, key := range keys { - mappedVolumes = append(mappedVolumes, mappedVolumesMap[key]) - } - - return mappedVolumes, nil -} - -func (storagePool *StoragePool) CreateVolume(volume *types.VolumeParam) (volumeResp *types.VolumeResp, err error) { - - endpoint := storagePool.client.SIOEndpoint - - endpoint.Path = "/api/types/Volume/instances" - - volume.StoragePoolID = storagePool.StoragePool.ID - volume.ProtectionDomainID = storagePool.StoragePool.ProtectionDomainID - - jsonOutput, err := json.Marshal(&volume) - if err != nil { - return &types.VolumeResp{}, fmt.Errorf("error marshaling: %s", err) - } - - req := storagePool.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - req.SetBasicAuth("", storagePool.client.Token) - req.Header.Add("Accept", "application/json;version="+storagePool.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+storagePool.client.configConnect.Version) - - resp, err := storagePool.client.retryCheckResp(&storagePool.client.Http, req) - if err != nil { - return &types.VolumeResp{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = storagePool.client.decodeBody(resp, &volumeResp); err != nil { - return &types.VolumeResp{}, fmt.Errorf("error decoding volume creation response: %s", err) - } - - return volumeResp, nil -} - -func (volume *Volume) GetVTree() (vtree *types.VTree, err error) { - - endpoint := volume.client.SIOEndpoint - - link, err := GetLink(volume.Volume.Links, "/api/parent/relationship/vtreeId") - if err != nil { - return &types.VTree{}, errors.New("Error: problem finding link") - } - endpoint.Path = link.HREF - - req := volume.client.NewRequest(map[string]string{}, "GET", endpoint, nil) - req.SetBasicAuth("", volume.client.Token) - req.Header.Add("Accept", "application/json;version="+volume.client.configConnect.Version) - - resp, err := volume.client.retryCheckResp(&volume.client.Http, req) - if err != nil { - return &types.VTree{}, fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - if err = volume.client.decodeBody(resp, &vtree); err != nil { - return &types.VTree{}, fmt.Errorf("error decoding vtree response: %s", err) - } - return vtree, nil -} - -func (volume *Volume) RemoveVolume(removeMode string) (err error) { - - endpoint := volume.client.SIOEndpoint - - link, err := GetLink(volume.Volume.Links, "self") - if err != nil { - return errors.New("Error: problem finding link") - } - endpoint.Path = fmt.Sprintf("%v/action/removeVolume", link.HREF) - - if removeMode == "" { - removeMode = "ONLY_ME" - } - removeVolumeParam := &types.RemoveVolumeParam{ - RemoveMode: removeMode, - } - - jsonOutput, err := json.Marshal(&removeVolumeParam) - if err != nil { - return fmt.Errorf("error marshaling: %s", err) - } - - req := volume.client.NewRequest(map[string]string{}, "POST", endpoint, bytes.NewBufferString(string(jsonOutput))) - - req.SetBasicAuth("", volume.client.Token) - req.Header.Add("Accept", "application/json;version="+volume.client.configConnect.Version) - req.Header.Add("Content-Type", "application/json;version="+volume.client.configConnect.Version) - - resp, err := volume.client.retryCheckResp(&volume.client.Http, req) - if err != nil { - return fmt.Errorf("problem getting response: %v", err) - } - defer resp.Body.Close() - - return nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s b/cluster-autoscaler/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s index 6b4027b33fd2..db9171c2e491 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_arm64.s index cfc08c979439..c61f95a05a73 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_arm64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_s390x.s b/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_s390x.s index 964946df9571..96f81e209717 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_s390x.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_s390x.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_x86.s b/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_x86.s index 2f557a5887a4..39acab2ff5c2 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_x86.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/cpu/cpu_x86.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (386 || amd64 || amd64p32) && gc // +build 386 amd64 amd64p32 // +build gc diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s index 6b4027b33fd2..db9171c2e491 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_386.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_386.s similarity index 70% rename from cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_386.s rename to cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_386.s index 49f0ac2364cb..7f29275fa000 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_386.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_386.s @@ -1,14 +1,14 @@ -// Copyright 2009 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || freebsd || netbsd || openbsd) && gc +// +build darwin freebsd netbsd openbsd // +build gc #include "textflag.h" -// -// System call support for 386, FreeBSD -// +// System call support for 386 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. @@ -22,7 +22,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall9(SB),NOSPLIT,$0-52 JMP syscall·Syscall9(SB) -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 +TEXT ·RawSyscall(SB),NOSPLIT,$0-28 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s similarity index 72% rename from cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s rename to cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s index e57367c17aa7..2b99c349a2d3 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s @@ -1,14 +1,14 @@ -// Copyright 2009 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc +// +build darwin dragonfly freebsd netbsd openbsd // +build gc #include "textflag.h" -// -// System call support for AMD64, NetBSD -// +// System call support for AMD64 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_arm.s similarity index 74% rename from cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s rename to cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_arm.s index d7da175e1a3f..98ebfad9d512 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_arm.s @@ -1,14 +1,14 @@ -// Copyright 2013 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || freebsd || netbsd || openbsd) && gc +// +build darwin freebsd netbsd openbsd // +build gc #include "textflag.h" -// -// System call support for ARM, NetBSD -// +// System call support for ARM BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s similarity index 75% rename from cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s rename to cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s index f2397fde554d..fe36a7391a64 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s @@ -1,14 +1,14 @@ -// Copyright 2009 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || freebsd || netbsd || openbsd) && gc +// +build darwin freebsd netbsd openbsd // +build gc #include "textflag.h" -// -// System call support for AMD64, Darwin -// +// System call support for ARM64 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_386.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_386.s deleted file mode 100644 index 8a06b87d715a..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_386.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for 386, Darwin -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - JMP syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_arm.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_arm.s deleted file mode 100644 index c9e6b6fc8b55..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_arm.s +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc -// +build arm,darwin - -#include "textflag.h" - -// -// System call support for ARM, Darwin -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - B syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s deleted file mode 100644 index 89843f8f4b29..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc -// +build arm64,darwin - -#include "textflag.h" - -// -// System call support for AMD64, Darwin -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - B syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s deleted file mode 100644 index 27674e1cafd7..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for AMD64, DragonFly -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s deleted file mode 100644 index f2dfc57b836f..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for AMD64, FreeBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s deleted file mode 100644 index 6d740db2c0c7..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for ARM, FreeBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - B syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s deleted file mode 100644 index a8f5a29b35f2..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for ARM64, FreeBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_386.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_386.s index 0655ecbfbbec..8fd101d0716d 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_386.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_386.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_amd64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_amd64.s index bc3fb6ac3ed2..7ed38e43c673 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_amd64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_amd64.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_arm.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_arm.s index 55b13c7ba45c..8ef1d51402ae 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_arm.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_arm.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_arm64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_arm64.s index 22a83d8e3fad..98ae02760da1 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_arm64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_arm64.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && arm64 && gc // +build linux // +build arm64 // +build gc diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s index dc222b90ce74..21231d2ce13f 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && (mips64 || mips64le) && gc // +build linux // +build mips64 mips64le // +build gc diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s index d333f13cff3b..6783b26c606a 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && (mips || mipsle) && gc // +build linux // +build mips mipsle // +build gc diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s index 459a629c2732..19d4989344df 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && (ppc64 || ppc64le) && gc // +build linux // +build ppc64 ppc64le // +build gc diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s index 04d38497c6dd..e42eb81d583d 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s @@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build riscv64,gc +//go:build riscv64 && gc +// +build riscv64 +// +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_s390x.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_s390x.s index cc303989e174..c46aab339594 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_s390x.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_linux_s390x.s @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build s390x +//go:build linux && s390x && gc // +build linux +// +build s390x // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_386.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_386.s deleted file mode 100644 index ae7b498d5068..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_386.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for 386, NetBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - JMP syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s deleted file mode 100644 index e7cbe1904c4e..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for ARM64, NetBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - B syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_386.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_386.s deleted file mode 100644 index 2f00b0310f43..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_386.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for 386, OpenBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - JMP syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s deleted file mode 100644 index 07632c99ceaa..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for AMD64, OpenBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s deleted file mode 100644 index 73e997320fc7..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for ARM, OpenBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - B syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s deleted file mode 100644 index c47302aa46df..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for arm64, OpenBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s index 47c93fcb6c76..5e7a1169c05d 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s index 1f2c755a7203..f8c5394c1a72 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go index cb0dfbd09a04..29d44808b1d0 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) -// +build linux,386 linux,arm linux,mips linux,mipsle +//go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) +// +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc package unix diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ioctl_linux.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ioctl_linux.go new file mode 100644 index 000000000000..48773f730ac6 --- /dev/null +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ioctl_linux.go @@ -0,0 +1,196 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package unix + +import ( + "runtime" + "unsafe" +) + +// IoctlRetInt performs an ioctl operation specified by req on a device +// associated with opened file descriptor fd, and returns a non-negative +// integer that is returned by the ioctl syscall. +func IoctlRetInt(fd int, req uint) (int, error) { + ret, _, err := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), 0) + if err != 0 { + return 0, err + } + return int(ret), nil +} + +func IoctlGetUint32(fd int, req uint) (uint32, error) { + var value uint32 + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + return value, err +} + +func IoctlGetRTCTime(fd int) (*RTCTime, error) { + var value RTCTime + err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +func IoctlSetRTCTime(fd int, value *RTCTime) error { + err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) { + var value RTCWkAlrm + err := ioctl(fd, RTC_WKALM_RD, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error { + err := ioctl(fd, RTC_WKALM_SET, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +type ifreqEthtool struct { + name [IFNAMSIZ]byte + data unsafe.Pointer +} + +// IoctlGetEthtoolDrvinfo fetches ethtool driver information for the network +// device specified by ifname. +func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, error) { + // Leave room for terminating NULL byte. + if len(ifname) >= IFNAMSIZ { + return nil, EINVAL + } + + value := EthtoolDrvinfo{ + Cmd: ETHTOOL_GDRVINFO, + } + ifreq := ifreqEthtool{ + data: unsafe.Pointer(&value), + } + copy(ifreq.name[:], ifname) + err := ioctl(fd, SIOCETHTOOL, uintptr(unsafe.Pointer(&ifreq))) + runtime.KeepAlive(ifreq) + return &value, err +} + +// IoctlGetWatchdogInfo fetches information about a watchdog device from the +// Linux watchdog API. For more information, see: +// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. +func IoctlGetWatchdogInfo(fd int) (*WatchdogInfo, error) { + var value WatchdogInfo + err := ioctl(fd, WDIOC_GETSUPPORT, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +// IoctlWatchdogKeepalive issues a keepalive ioctl to a watchdog device. For +// more information, see: +// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. +func IoctlWatchdogKeepalive(fd int) error { + return ioctl(fd, WDIOC_KEEPALIVE, 0) +} + +// IoctlFileCloneRange performs an FICLONERANGE ioctl operation to clone the +// range of data conveyed in value to the file associated with the file +// descriptor destFd. See the ioctl_ficlonerange(2) man page for details. +func IoctlFileCloneRange(destFd int, value *FileCloneRange) error { + err := ioctl(destFd, FICLONERANGE, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +// IoctlFileClone performs an FICLONE ioctl operation to clone the entire file +// associated with the file description srcFd to the file associated with the +// file descriptor destFd. See the ioctl_ficlone(2) man page for details. +func IoctlFileClone(destFd, srcFd int) error { + return ioctl(destFd, FICLONE, uintptr(srcFd)) +} + +type FileDedupeRange struct { + Src_offset uint64 + Src_length uint64 + Reserved1 uint16 + Reserved2 uint32 + Info []FileDedupeRangeInfo +} + +type FileDedupeRangeInfo struct { + Dest_fd int64 + Dest_offset uint64 + Bytes_deduped uint64 + Status int32 + Reserved uint32 +} + +// IoctlFileDedupeRange performs an FIDEDUPERANGE ioctl operation to share the +// range of data conveyed in value from the file associated with the file +// descriptor srcFd to the value.Info destinations. See the +// ioctl_fideduperange(2) man page for details. +func IoctlFileDedupeRange(srcFd int, value *FileDedupeRange) error { + buf := make([]byte, SizeofRawFileDedupeRange+ + len(value.Info)*SizeofRawFileDedupeRangeInfo) + rawrange := (*RawFileDedupeRange)(unsafe.Pointer(&buf[0])) + rawrange.Src_offset = value.Src_offset + rawrange.Src_length = value.Src_length + rawrange.Dest_count = uint16(len(value.Info)) + rawrange.Reserved1 = value.Reserved1 + rawrange.Reserved2 = value.Reserved2 + + for i := range value.Info { + rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer( + uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) + + uintptr(i*SizeofRawFileDedupeRangeInfo))) + rawinfo.Dest_fd = value.Info[i].Dest_fd + rawinfo.Dest_offset = value.Info[i].Dest_offset + rawinfo.Bytes_deduped = value.Info[i].Bytes_deduped + rawinfo.Status = value.Info[i].Status + rawinfo.Reserved = value.Info[i].Reserved + } + + err := ioctl(srcFd, FIDEDUPERANGE, uintptr(unsafe.Pointer(&buf[0]))) + + // Output + for i := range value.Info { + rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer( + uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) + + uintptr(i*SizeofRawFileDedupeRangeInfo))) + value.Info[i].Dest_fd = rawinfo.Dest_fd + value.Info[i].Dest_offset = rawinfo.Dest_offset + value.Info[i].Bytes_deduped = rawinfo.Bytes_deduped + value.Info[i].Status = rawinfo.Status + value.Info[i].Reserved = rawinfo.Reserved + } + + return err +} + +func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error { + err := ioctl(fd, HIDIOCGRDESC, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) { + var value HIDRawDevInfo + err := ioctl(fd, HIDIOCGRAWINFO, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +func IoctlHIDGetRawName(fd int) (string, error) { + var value [_HIDIOCGRAWNAME_LEN]byte + err := ioctl(fd, _HIDIOCGRAWNAME, uintptr(unsafe.Pointer(&value[0]))) + return ByteSliceToString(value[:]), err +} + +func IoctlHIDGetRawPhys(fd int) (string, error) { + var value [_HIDIOCGRAWPHYS_LEN]byte + err := ioctl(fd, _HIDIOCGRAWPHYS, uintptr(unsafe.Pointer(&value[0]))) + return ByteSliceToString(value[:]), err +} + +func IoctlHIDGetRawUniq(fd int) (string, error) { + var value [_HIDIOCGRAWUNIQ_LEN]byte + err := ioctl(fd, _HIDIOCGRAWUNIQ, uintptr(unsafe.Pointer(&value[0]))) + return ByteSliceToString(value[:]), err +} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkall.sh b/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkall.sh index d257fac50576..d727cad19c14 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkall.sh +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkall.sh @@ -199,7 +199,7 @@ illumos_amd64) mksyscall="go run mksyscall_solaris.go" mkerrors= mksysnum= - mktypes= + mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; *) echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkerrors.sh b/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkerrors.sh index 60ffa48a29b2..007358af8fc1 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -56,6 +56,7 @@ includes_Darwin=' #define _DARWIN_C_SOURCE #define KERNEL #define _DARWIN_USE_64_BIT_INODE +#define __APPLE_USE_RFC_3542 #include #include #include @@ -216,6 +217,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -403,10 +405,11 @@ includes_SunOS=' #include #include #include +#include #include -#include #include #include +#include ' @@ -497,10 +500,10 @@ ccflags="$@" $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || $2 ~ /^LO_(KEY|NAME)_SIZE$/ || $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL)_/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL)_/ || $2 ~ /^TP_STATUS_/ || $2 ~ /^FALLOC_/ || - $2 == "ICMPV6_FILTER" || + $2 ~ /^ICMPV?6?_(FILTER|SEC)/ || $2 == "SOMAXCONN" || $2 == "NAME_MAX" || $2 == "IFNAMSIZ" || @@ -627,6 +630,7 @@ echo '#include ' | $CC -x c - -E -dM $ccflags | echo '// mkerrors.sh' "$@" echo '// Code generated by the command above; see README.md. DO NOT EDIT.' echo +echo "//go:build ${GOARCH} && ${GOOS}" echo "// +build ${GOARCH},${GOOS}" echo go tool cgo -godefs -- "$@" _const.go >_error.out diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_aix.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_aix.go index d2723225ec58..d8efb715ff1d 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_aix.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -252,7 +252,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { } } - bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] + bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] sa.Name = string(bytes) return sa, nil diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_darwin.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_darwin.go index 1223d7aed1c7..9945e5f9655a 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -378,6 +378,17 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e return } +func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) { + var value IPMreqn + vallen := _Socklen(SizeofIPMreqn) + errno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) + return &value, errno +} + +func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) +} + // GetsockoptXucred is a getsockopt wrapper that returns an Xucred struct. // The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively. func GetsockoptXucred(fd, level, opt int) (*Xucred, error) { diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_illumos.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_illumos.go index bc442e3bace9..8c5357683527 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_illumos.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_illumos.go @@ -1,4 +1,4 @@ -// Copyright 2009 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -9,7 +9,11 @@ package unix -import "unsafe" +import ( + "fmt" + "runtime" + "unsafe" +) func bytes2iovec(bs [][]byte) []Iovec { iovecs := make([]Iovec, len(bs)) @@ -76,3 +80,99 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { } return } + +//sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) + +func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) { + var clp, datap *strbuf + if len(cl) > 0 { + clp = &strbuf{ + Len: int32(len(cl)), + Buf: (*int8)(unsafe.Pointer(&cl[0])), + } + } + if len(data) > 0 { + datap = &strbuf{ + Len: int32(len(data)), + Buf: (*int8)(unsafe.Pointer(&data[0])), + } + } + return putmsg(fd, clp, datap, flags) +} + +//sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) + +func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) { + var clp, datap *strbuf + if len(cl) > 0 { + clp = &strbuf{ + Maxlen: int32(len(cl)), + Buf: (*int8)(unsafe.Pointer(&cl[0])), + } + } + if len(data) > 0 { + datap = &strbuf{ + Maxlen: int32(len(data)), + Buf: (*int8)(unsafe.Pointer(&data[0])), + } + } + + if err = getmsg(fd, clp, datap, &flags); err != nil { + return nil, nil, 0, err + } + + if len(cl) > 0 { + retCl = cl[:clp.Len] + } + if len(data) > 0 { + retData = data[:datap.Len] + } + return retCl, retData, flags, nil +} + +func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) { + return ioctlRet(fd, req, uintptr(arg)) +} + +func IoctlSetString(fd int, req uint, val string) error { + bs := make([]byte, len(val)+1) + copy(bs[:len(bs)-1], val) + err := ioctl(fd, req, uintptr(unsafe.Pointer(&bs[0]))) + runtime.KeepAlive(&bs[0]) + return err +} + +// Lifreq Helpers + +func (l *Lifreq) SetName(name string) error { + if len(name) >= len(l.Name) { + return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1) + } + for i := range name { + l.Name[i] = int8(name[i]) + } + return nil +} + +func (l *Lifreq) SetLifruInt(d int) { + *(*int)(unsafe.Pointer(&l.Lifru[0])) = d +} + +func (l *Lifreq) GetLifruInt() int { + return *(*int)(unsafe.Pointer(&l.Lifru[0])) +} + +func IoctlLifreq(fd int, req uint, l *Lifreq) error { + return ioctl(fd, req, uintptr(unsafe.Pointer(l))) +} + +// Strioctl Helpers + +func (s *Strioctl) SetInt(i int) { + s.Len = int32(unsafe.Sizeof(i)) + s.Dp = (*int8)(unsafe.Pointer(&i)) +} + +func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) { + return ioctlRet(fd, req, uintptr(unsafe.Pointer(s))) +} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux.go index 0a48548e80f3..2dd7c8e34a94 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -70,167 +70,7 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { // ioctl itself should not be exposed directly, but additional get/set // functions for specific types are permissible. - -// IoctlRetInt performs an ioctl operation specified by req on a device -// associated with opened file descriptor fd, and returns a non-negative -// integer that is returned by the ioctl syscall. -func IoctlRetInt(fd int, req uint) (int, error) { - ret, _, err := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), 0) - if err != 0 { - return 0, err - } - return int(ret), nil -} - -func IoctlSetRTCTime(fd int, value *RTCTime) error { - err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value))) - runtime.KeepAlive(value) - return err -} - -func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error { - err := ioctl(fd, RTC_WKALM_SET, uintptr(unsafe.Pointer(value))) - runtime.KeepAlive(value) - return err -} - -func IoctlGetUint32(fd int, req uint) (uint32, error) { - var value uint32 - err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) - return value, err -} - -func IoctlGetRTCTime(fd int) (*RTCTime, error) { - var value RTCTime - err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value))) - return &value, err -} - -// IoctlGetWatchdogInfo fetches information about a watchdog device from the -// Linux watchdog API. For more information, see: -// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. -func IoctlGetWatchdogInfo(fd int) (*WatchdogInfo, error) { - var value WatchdogInfo - err := ioctl(fd, WDIOC_GETSUPPORT, uintptr(unsafe.Pointer(&value))) - return &value, err -} - -func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) { - var value RTCWkAlrm - err := ioctl(fd, RTC_WKALM_RD, uintptr(unsafe.Pointer(&value))) - return &value, err -} - -// IoctlFileCloneRange performs an FICLONERANGE ioctl operation to clone the -// range of data conveyed in value to the file associated with the file -// descriptor destFd. See the ioctl_ficlonerange(2) man page for details. -func IoctlFileCloneRange(destFd int, value *FileCloneRange) error { - err := ioctl(destFd, FICLONERANGE, uintptr(unsafe.Pointer(value))) - runtime.KeepAlive(value) - return err -} - -// IoctlFileClone performs an FICLONE ioctl operation to clone the entire file -// associated with the file description srcFd to the file associated with the -// file descriptor destFd. See the ioctl_ficlone(2) man page for details. -func IoctlFileClone(destFd, srcFd int) error { - return ioctl(destFd, FICLONE, uintptr(srcFd)) -} - -type FileDedupeRange struct { - Src_offset uint64 - Src_length uint64 - Reserved1 uint16 - Reserved2 uint32 - Info []FileDedupeRangeInfo -} - -type FileDedupeRangeInfo struct { - Dest_fd int64 - Dest_offset uint64 - Bytes_deduped uint64 - Status int32 - Reserved uint32 -} - -// IoctlFileDedupeRange performs an FIDEDUPERANGE ioctl operation to share the -// range of data conveyed in value from the file associated with the file -// descriptor srcFd to the value.Info destinations. See the -// ioctl_fideduperange(2) man page for details. -func IoctlFileDedupeRange(srcFd int, value *FileDedupeRange) error { - buf := make([]byte, SizeofRawFileDedupeRange+ - len(value.Info)*SizeofRawFileDedupeRangeInfo) - rawrange := (*RawFileDedupeRange)(unsafe.Pointer(&buf[0])) - rawrange.Src_offset = value.Src_offset - rawrange.Src_length = value.Src_length - rawrange.Dest_count = uint16(len(value.Info)) - rawrange.Reserved1 = value.Reserved1 - rawrange.Reserved2 = value.Reserved2 - - for i := range value.Info { - rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer( - uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) + - uintptr(i*SizeofRawFileDedupeRangeInfo))) - rawinfo.Dest_fd = value.Info[i].Dest_fd - rawinfo.Dest_offset = value.Info[i].Dest_offset - rawinfo.Bytes_deduped = value.Info[i].Bytes_deduped - rawinfo.Status = value.Info[i].Status - rawinfo.Reserved = value.Info[i].Reserved - } - - err := ioctl(srcFd, FIDEDUPERANGE, uintptr(unsafe.Pointer(&buf[0]))) - - // Output - for i := range value.Info { - rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer( - uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) + - uintptr(i*SizeofRawFileDedupeRangeInfo))) - value.Info[i].Dest_fd = rawinfo.Dest_fd - value.Info[i].Dest_offset = rawinfo.Dest_offset - value.Info[i].Bytes_deduped = rawinfo.Bytes_deduped - value.Info[i].Status = rawinfo.Status - value.Info[i].Reserved = rawinfo.Reserved - } - - return err -} - -// IoctlWatchdogKeepalive issues a keepalive ioctl to a watchdog device. For -// more information, see: -// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. -func IoctlWatchdogKeepalive(fd int) error { - return ioctl(fd, WDIOC_KEEPALIVE, 0) -} - -func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error { - err := ioctl(fd, HIDIOCGRDESC, uintptr(unsafe.Pointer(value))) - runtime.KeepAlive(value) - return err -} - -func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) { - var value HIDRawDevInfo - err := ioctl(fd, HIDIOCGRAWINFO, uintptr(unsafe.Pointer(&value))) - return &value, err -} - -func IoctlHIDGetRawName(fd int) (string, error) { - var value [_HIDIOCGRAWNAME_LEN]byte - err := ioctl(fd, _HIDIOCGRAWNAME, uintptr(unsafe.Pointer(&value[0]))) - return ByteSliceToString(value[:]), err -} - -func IoctlHIDGetRawPhys(fd int) (string, error) { - var value [_HIDIOCGRAWPHYS_LEN]byte - err := ioctl(fd, _HIDIOCGRAWPHYS, uintptr(unsafe.Pointer(&value[0]))) - return ByteSliceToString(value[:]), err -} - -func IoctlHIDGetRawUniq(fd int) (string, error) { - var value [_HIDIOCGRAWUNIQ_LEN]byte - err := ioctl(fd, _HIDIOCGRAWUNIQ, uintptr(unsafe.Pointer(&value[0]))) - return ByteSliceToString(value[:]), err -} +// These are defined in ioctl.go and ioctl_linux.go. //sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) @@ -857,16 +697,19 @@ type SockaddrVM struct { // CID and Port specify a context ID and port address for a VM socket. // Guests have a unique CID, and hosts may have a well-known CID of: // - VMADDR_CID_HYPERVISOR: refers to the hypervisor process. + // - VMADDR_CID_LOCAL: refers to local communication (loopback). // - VMADDR_CID_HOST: refers to other processes on the host. - CID uint32 - Port uint32 - raw RawSockaddrVM + CID uint32 + Port uint32 + Flags uint8 + raw RawSockaddrVM } func (sa *SockaddrVM) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_VSOCK sa.raw.Port = sa.Port sa.raw.Cid = sa.CID + sa.raw.Flags = sa.Flags return unsafe.Pointer(&sa.raw), SizeofSockaddrVM, nil } @@ -1171,8 +1014,9 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { case AF_VSOCK: pp := (*RawSockaddrVM)(unsafe.Pointer(rsa)) sa := &SockaddrVM{ - CID: pp.Cid, - Port: pp.Port, + CID: pp.Cid, + Port: pp.Port, + Flags: pp.Flags, } return sa, nil case AF_BLUETOOTH: @@ -1307,7 +1151,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { func Accept(fd int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny - nfd, err = accept(fd, &rsa, &len) + // Try accept4 first for Android, then try accept for kernel older than 2.6.28 + nfd, err = accept4(fd, &rsa, &len, 0) + if err == ENOSYS { + nfd, err = accept(fd, &rsa, &len) + } if err != nil { return } @@ -1877,6 +1725,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) //sys Close(fd int) (err error) +//sys CloseRange(first uint, last uint, flags uint) (err error) //sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) //sys DeleteModule(name string, flags int) (err error) //sys Dup(oldfd int) (fd int, err error) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go new file mode 100644 index 000000000000..7e65e088d29b --- /dev/null +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go @@ -0,0 +1,272 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build linux && ppc +// +build linux +// +build ppc + +package unix + +import ( + "syscall" + "unsafe" +) + +//sys dup2(oldfd int, newfd int) (err error) +//sysnb EpollCreate(size int) (fd int, err error) +//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) +//sys Fchown(fd int, uid int, gid int) (err error) +//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 +//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 +//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 +//sysnb Getegid() (egid int) +//sysnb Geteuid() (euid int) +//sysnb Getgid() (gid int) +//sysnb Getuid() (uid int) +//sysnb InotifyInit() (fd int, err error) +//sys Ioperm(from int, num int, on int) (err error) +//sys Iopl(level int) (err error) +//sys Lchown(path string, uid int, gid int) (err error) +//sys Listen(s int, n int) (err error) +//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 +//sys Pause() (err error) +//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) +//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT +//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) +//sysnb Setregid(rgid int, egid int) (err error) +//sysnb Setresgid(rgid int, egid int, sgid int) (err error) +//sysnb Setresuid(ruid int, euid int, suid int) (err error) +//sysnb Setreuid(ruid int, euid int) (err error) +//sys Shutdown(fd int, how int) (err error) +//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) +//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 +//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 +//sys Ustat(dev int, ubuf *Ustat_t) (err error) +//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) +//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) +//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) +//sysnb setgroups(n int, list *_Gid_t) (err error) +//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) +//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) +//sysnb socket(domain int, typ int, proto int) (fd int, err error) +//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) +//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) +//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) +//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) +//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) +//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) +//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) + +//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) +//sysnb Gettimeofday(tv *Timeval) (err error) +//sysnb Time(t *Time_t) (tt Time_t, err error) +//sys Utime(path string, buf *Utimbuf) (err error) +//sys utimes(path string, times *[2]Timeval) (err error) + +func Fadvise(fd int, offset int64, length int64, advice int) (err error) { + _, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(advice), uintptr(offset>>32), uintptr(offset), uintptr(length>>32), uintptr(length)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { + var newoffset int64 + offsetLow := uint32(offset & 0xffffffff) + offsetHigh := uint32((offset >> 32) & 0xffffffff) + _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) + return newoffset, err +} + +func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + newoffset, errno := seek(fd, offset, whence) + if errno != 0 { + return 0, errno + } + return newoffset, nil +} + +func Fstatfs(fd int, buf *Statfs_t) (err error) { + _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) + if e != 0 { + err = e + } + return +} + +func Statfs(path string, buf *Statfs_t) (err error) { + pathp, err := BytePtrFromString(path) + if err != nil { + return err + } + _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) + if e != 0 { + err = e + } + return +} + +//sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) + +func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { + page := uintptr(offset / 4096) + if offset != int64(page)*4096 { + return 0, EINVAL + } + return mmap2(addr, length, prot, flags, fd, page) +} + +func setTimespec(sec, nsec int64) Timespec { + return Timespec{Sec: int32(sec), Nsec: int32(nsec)} +} + +func setTimeval(sec, usec int64) Timeval { + return Timeval{Sec: int32(sec), Usec: int32(usec)} +} + +type rlimit32 struct { + Cur uint32 + Max uint32 +} + +//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_UGETRLIMIT + +const rlimInf32 = ^uint32(0) +const rlimInf64 = ^uint64(0) + +func Getrlimit(resource int, rlim *Rlimit) (err error) { + err = prlimit(0, resource, nil, rlim) + if err != ENOSYS { + return err + } + + rl := rlimit32{} + err = getrlimit(resource, &rl) + if err != nil { + return + } + + if rl.Cur == rlimInf32 { + rlim.Cur = rlimInf64 + } else { + rlim.Cur = uint64(rl.Cur) + } + + if rl.Max == rlimInf32 { + rlim.Max = rlimInf64 + } else { + rlim.Max = uint64(rl.Max) + } + return +} + +//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT + +func Setrlimit(resource int, rlim *Rlimit) (err error) { + err = prlimit(0, resource, rlim, nil) + if err != ENOSYS { + return err + } + + rl := rlimit32{} + if rlim.Cur == rlimInf64 { + rl.Cur = rlimInf32 + } else if rlim.Cur < uint64(rlimInf32) { + rl.Cur = uint32(rlim.Cur) + } else { + return EINVAL + } + if rlim.Max == rlimInf64 { + rl.Max = rlimInf32 + } else if rlim.Max < uint64(rlimInf32) { + rl.Max = uint32(rlim.Max) + } else { + return EINVAL + } + + return setrlimit(resource, &rl) +} + +func (r *PtraceRegs) PC() uint32 { return r.Nip } + +func (r *PtraceRegs) SetPC(pc uint32) { r.Nip = pc } + +func (iov *Iovec) SetLen(length int) { + iov.Len = uint32(length) +} + +func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) +} + +func (msghdr *Msghdr) SetIovlen(length int) { + msghdr.Iovlen = uint32(length) +} + +func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) +} + +//sysnb pipe(p *[2]_C_int) (err error) + +func Pipe(p []int) (err error) { + if len(p) != 2 { + return EINVAL + } + var pp [2]_C_int + err = pipe(&pp) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return +} + +//sysnb pipe2(p *[2]_C_int, flags int) (err error) + +func Pipe2(p []int, flags int) (err error) { + if len(p) != 2 { + return EINVAL + } + var pp [2]_C_int + err = pipe2(&pp, flags) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return +} + +//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) + +func Poll(fds []PollFd, timeout int) (n int, err error) { + if len(fds) == 0 { + return poll(nil, 0, timeout) + } + return poll(&fds[0], len(fds), timeout) +} + +//sys syncFileRange2(fd int, flags int, off int64, n int64) (err error) = SYS_SYNC_FILE_RANGE2 + +func SyncFileRange(fd int, off int64, n int64, flags int) error { + // The sync_file_range and sync_file_range2 syscalls differ only in the + // order of their arguments. + return syncFileRange2(fd, flags, off, n) +} + +//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) + +func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { + cmdlineLen := len(cmdline) + if cmdlineLen > 0 { + // Account for the additional NULL byte added by + // BytePtrFromString in kexecFileLoad. The kexec_file_load + // syscall expects a NULL-terminated string. + cmdlineLen++ + } + return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) +} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go index a941d8881501..a1e45694b441 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -250,7 +250,7 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen } func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) error { - args := [4]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val)} + args := [5]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val), vallen} _, _, err := Syscall(SYS_SOCKETCALL, netSetSockOpt, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_solaris.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_solaris.go index 169497f0620e..77fcde7c180a 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -565,7 +565,12 @@ func Minor(dev uint64) uint32 { * Expose the ioctl function */ -//sys ioctl(fd int, req uint, arg uintptr) (err error) +//sys ioctlRet(fd int, req uint, arg uintptr) (ret int, err error) = libc.ioctl + +func ioctl(fd int, req uint, arg uintptr) (err error) { + _, err = ioctlRet(fd, req, arg) + return err +} func IoctlSetTermio(fd int, req uint, value *Termio) error { err := ioctl(fd, req, uintptr(unsafe.Pointer(value))) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go index 0100cb12f1f3..991996b60911 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go @@ -776,15 +776,24 @@ const ( IPV6_2292PKTINFO = 0x13 IPV6_2292PKTOPTIONS = 0x19 IPV6_2292RTHDR = 0x18 + IPV6_3542DSTOPTS = 0x32 + IPV6_3542HOPLIMIT = 0x2f + IPV6_3542HOPOPTS = 0x31 + IPV6_3542NEXTHOP = 0x30 + IPV6_3542PKTINFO = 0x2e + IPV6_3542RTHDR = 0x33 IPV6_ADDR_MC_FLAGS_PREFIX = 0x20 IPV6_ADDR_MC_FLAGS_TRANSIENT = 0x10 IPV6_ADDR_MC_FLAGS_UNICAST_BASED = 0x30 + IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDV6ONLY = 0x1b IPV6_BOUND_IF = 0x7d IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 + IPV6_DONTFRAG = 0x3e + IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 @@ -796,6 +805,8 @@ const ( IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 + IPV6_HOPLIMIT = 0x2f + IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd @@ -807,20 +818,34 @@ const ( IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MIN_MEMBERSHIPS = 0x1f IPV6_MMTU = 0x500 + IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb + IPV6_NEXTHOP = 0x30 + IPV6_PATHMTU = 0x2c + IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 + IPV6_PREFER_TEMPADDR = 0x3f + IPV6_RECVDSTOPTS = 0x28 + IPV6_RECVHOPLIMIT = 0x25 + IPV6_RECVHOPOPTS = 0x27 + IPV6_RECVPATHMTU = 0x2b + IPV6_RECVPKTINFO = 0x3d + IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x23 + IPV6_RTHDR = 0x33 + IPV6_RTHDRDSTOPTS = 0x39 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x24 IPV6_UNICAST_HOPS = 0x4 + IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go index df26a19681e3..e644eaf5e757 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go @@ -776,15 +776,24 @@ const ( IPV6_2292PKTINFO = 0x13 IPV6_2292PKTOPTIONS = 0x19 IPV6_2292RTHDR = 0x18 + IPV6_3542DSTOPTS = 0x32 + IPV6_3542HOPLIMIT = 0x2f + IPV6_3542HOPOPTS = 0x31 + IPV6_3542NEXTHOP = 0x30 + IPV6_3542PKTINFO = 0x2e + IPV6_3542RTHDR = 0x33 IPV6_ADDR_MC_FLAGS_PREFIX = 0x20 IPV6_ADDR_MC_FLAGS_TRANSIENT = 0x10 IPV6_ADDR_MC_FLAGS_UNICAST_BASED = 0x30 + IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDV6ONLY = 0x1b IPV6_BOUND_IF = 0x7d IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 + IPV6_DONTFRAG = 0x3e + IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 @@ -796,6 +805,8 @@ const ( IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 + IPV6_HOPLIMIT = 0x2f + IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd @@ -807,20 +818,34 @@ const ( IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MIN_MEMBERSHIPS = 0x1f IPV6_MMTU = 0x500 + IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb + IPV6_NEXTHOP = 0x30 + IPV6_PATHMTU = 0x2c + IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 + IPV6_PREFER_TEMPADDR = 0x3f + IPV6_RECVDSTOPTS = 0x28 + IPV6_RECVHOPLIMIT = 0x25 + IPV6_RECVHOPOPTS = 0x27 + IPV6_RECVPATHMTU = 0x2b + IPV6_RECVPKTINFO = 0x3d + IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x23 + IPV6_RTHDR = 0x33 + IPV6_RTHDRDSTOPTS = 0x39 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x24 IPV6_UNICAST_HOPS = 0x4 + IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go index 0326a6b3af97..3df99f285f14 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go @@ -1022,6 +1022,15 @@ const ( MAP_RESERVED0100 = 0x100 MAP_SHARED = 0x1 MAP_STACK = 0x400 + MCAST_BLOCK_SOURCE = 0x54 + MCAST_EXCLUDE = 0x2 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x50 + MCAST_JOIN_SOURCE_GROUP = 0x52 + MCAST_LEAVE_GROUP = 0x51 + MCAST_LEAVE_SOURCE_GROUP = 0x53 + MCAST_UNBLOCK_SOURCE = 0x55 + MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ACLS = 0x8000000 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux.go index 504dd6cd2d02..47572aaa690f 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -166,13 +166,16 @@ const ( BPF_ALU64 = 0x7 BPF_AND = 0x50 BPF_ARSH = 0xc0 + BPF_ATOMIC = 0xc0 BPF_B = 0x10 BPF_BUILD_ID_SIZE = 0x14 BPF_CALL = 0x80 + BPF_CMPXCHG = 0xf1 BPF_DIV = 0x30 BPF_DW = 0x18 BPF_END = 0xd0 BPF_EXIT = 0x90 + BPF_FETCH = 0x1 BPF_FROM_BE = 0x8 BPF_FROM_LE = 0x0 BPF_FS_MAGIC = 0xcafe4a11 @@ -240,6 +243,7 @@ const ( BPF_W = 0x0 BPF_X = 0x8 BPF_XADD = 0xc0 + BPF_XCHG = 0xe1 BPF_XOR = 0xa0 BRKINT = 0x2 BS0 = 0x0 @@ -490,9 +494,9 @@ const ( DM_UUID_FLAG = 0x4000 DM_UUID_LEN = 0x81 DM_VERSION = 0xc138fd00 - DM_VERSION_EXTRA = "-ioctl (2020-10-01)" + DM_VERSION_EXTRA = "-ioctl (2021-02-01)" DM_VERSION_MAJOR = 0x4 - DM_VERSION_MINOR = 0x2b + DM_VERSION_MINOR = 0x2c DM_VERSION_PATCHLEVEL = 0x0 DT_BLK = 0x6 DT_CHR = 0x2 @@ -860,6 +864,7 @@ const ( FS_IOC_GET_ENCRYPTION_KEY_STATUS = 0xc080661a FS_IOC_GET_ENCRYPTION_POLICY_EX = 0xc0096616 FS_IOC_MEASURE_VERITY = 0xc0046686 + FS_IOC_READ_VERITY_METADATA = 0xc0286687 FS_IOC_REMOVE_ENCRYPTION_KEY = 0xc0406618 FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS = 0xc0406619 FS_KEY_DESCRIPTOR_SIZE = 0x8 @@ -875,6 +880,9 @@ const ( FS_VERITY_FL = 0x100000 FS_VERITY_HASH_ALG_SHA256 = 0x1 FS_VERITY_HASH_ALG_SHA512 = 0x2 + FS_VERITY_METADATA_TYPE_DESCRIPTOR = 0x2 + FS_VERITY_METADATA_TYPE_MERKLE_TREE = 0x1 + FS_VERITY_METADATA_TYPE_SIGNATURE = 0x3 FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -974,6 +982,11 @@ const ( HUGETLBFS_MAGIC = 0x958458f6 IBSHIFT = 0x10 ICMPV6_FILTER = 0x1 + ICMPV6_FILTER_BLOCK = 0x1 + ICMPV6_FILTER_BLOCKOTHERS = 0x3 + ICMPV6_FILTER_PASS = 0x2 + ICMPV6_FILTER_PASSONLY = 0x4 + ICMP_FILTER = 0x1 ICRNL = 0x100 IFA_F_DADFAILED = 0x8 IFA_F_DEPRECATED = 0x20 @@ -1668,6 +1681,10 @@ const ( PERF_FLAG_PID_CGROUP = 0x4 PERF_MAX_CONTEXTS_PER_STACK = 0x8 PERF_MAX_STACK_DEPTH = 0x7f + PERF_MEM_BLK_ADDR = 0x4 + PERF_MEM_BLK_DATA = 0x2 + PERF_MEM_BLK_NA = 0x1 + PERF_MEM_BLK_SHIFT = 0x28 PERF_MEM_LOCK_LOCKED = 0x2 PERF_MEM_LOCK_NA = 0x1 PERF_MEM_LOCK_SHIFT = 0x18 @@ -1731,12 +1748,14 @@ const ( PERF_RECORD_MISC_GUEST_USER = 0x5 PERF_RECORD_MISC_HYPERVISOR = 0x3 PERF_RECORD_MISC_KERNEL = 0x1 + PERF_RECORD_MISC_MMAP_BUILD_ID = 0x4000 PERF_RECORD_MISC_MMAP_DATA = 0x2000 PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT = 0x1000 PERF_RECORD_MISC_SWITCH_OUT = 0x2000 PERF_RECORD_MISC_SWITCH_OUT_PREEMPT = 0x4000 PERF_RECORD_MISC_USER = 0x2 PERF_SAMPLE_BRANCH_PLM_ALL = 0x7 + PERF_SAMPLE_WEIGHT_TYPE = 0x1004000 PIPEFS_MAGIC = 0x50495045 PPC_CMM_MAGIC = 0xc7571590 PPPIOCGNPMODE = 0xc008744c @@ -1990,6 +2009,10 @@ const ( RTCF_NAT = 0x800000 RTCF_VALVE = 0x200000 RTC_AF = 0x20 + RTC_FEATURE_ALARM = 0x0 + RTC_FEATURE_ALARM_RES_MINUTE = 0x1 + RTC_FEATURE_CNT = 0x3 + RTC_FEATURE_NEED_WEEK_DAY = 0x2 RTC_IRQF = 0x80 RTC_MAX_FREQ = 0x2000 RTC_PF = 0x40 @@ -2063,6 +2086,7 @@ const ( RTM_F_LOOKUP_TABLE = 0x1000 RTM_F_NOTIFY = 0x100 RTM_F_OFFLOAD = 0x4000 + RTM_F_OFFLOAD_FAILED = 0x20000000 RTM_F_PREFIX = 0x800 RTM_F_TRAP = 0x8000 RTM_GETACTION = 0x32 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go new file mode 100644 index 000000000000..d9530e5fbfbc --- /dev/null +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -0,0 +1,860 @@ +// mkerrors.sh -Wall -Werror -static -I/tmp/include +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build ppc && linux +// +build ppc,linux + +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go + +package unix + +import "syscall" + +const ( + B1000000 = 0x17 + B115200 = 0x11 + B1152000 = 0x18 + B1500000 = 0x19 + B2000000 = 0x1a + B230400 = 0x12 + B2500000 = 0x1b + B3000000 = 0x1c + B3500000 = 0x1d + B4000000 = 0x1e + B460800 = 0x13 + B500000 = 0x14 + B57600 = 0x10 + B576000 = 0x15 + B921600 = 0x16 + BLKBSZGET = 0x40041270 + BLKBSZSET = 0x80041271 + BLKFLSBUF = 0x20001261 + BLKFRAGET = 0x20001265 + BLKFRASET = 0x20001264 + BLKGETSIZE = 0x20001260 + BLKGETSIZE64 = 0x40041272 + BLKPBSZGET = 0x2000127b + BLKRAGET = 0x20001263 + BLKRASET = 0x20001262 + BLKROGET = 0x2000125e + BLKROSET = 0x2000125d + BLKRRPART = 0x2000125f + BLKSECTGET = 0x20001267 + BLKSECTSET = 0x20001266 + BLKSSZGET = 0x20001268 + BOTHER = 0x1f + BS1 = 0x8000 + BSDLY = 0x8000 + CBAUD = 0xff + CBAUDEX = 0x0 + CIBAUD = 0xff0000 + CLOCAL = 0x8000 + CR1 = 0x1000 + CR2 = 0x2000 + CR3 = 0x3000 + CRDLY = 0x3000 + CREAD = 0x800 + CS6 = 0x100 + CS7 = 0x200 + CS8 = 0x300 + CSIZE = 0x300 + CSTOPB = 0x400 + ECHOCTL = 0x40 + ECHOE = 0x2 + ECHOK = 0x4 + ECHOKE = 0x1 + ECHONL = 0x10 + ECHOPRT = 0x20 + EFD_CLOEXEC = 0x80000 + EFD_NONBLOCK = 0x800 + EPOLL_CLOEXEC = 0x80000 + EXTPROC = 0x10000000 + FF1 = 0x4000 + FFDLY = 0x4000 + FICLONE = 0x80049409 + FICLONERANGE = 0x8020940d + FLUSHO = 0x800000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40046601 + FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b + FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 + FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 + FS_IOC_SETFLAGS = 0x80046602 + FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 + F_GETLK = 0xc + F_GETLK64 = 0xc + F_GETOWN = 0x9 + F_RDLCK = 0x0 + F_SETLK = 0xd + F_SETLK64 = 0xd + F_SETLKW = 0xe + F_SETLKW64 = 0xe + F_SETOWN = 0x8 + F_UNLCK = 0x2 + F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x40084803 + HIDIOCGRDESC = 0x50044802 + HIDIOCGRDESCSIZE = 0x40044801 + HUPCL = 0x4000 + ICANON = 0x100 + IEXTEN = 0x400 + IN_CLOEXEC = 0x80000 + IN_NONBLOCK = 0x800 + IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + ISIG = 0x80 + IUCLC = 0x1000 + IXOFF = 0x400 + IXON = 0x200 + MAP_ANON = 0x20 + MAP_ANONYMOUS = 0x20 + MAP_DENYWRITE = 0x800 + MAP_EXECUTABLE = 0x1000 + MAP_GROWSDOWN = 0x100 + MAP_HUGETLB = 0x40000 + MAP_LOCKED = 0x80 + MAP_NONBLOCK = 0x10000 + MAP_NORESERVE = 0x40 + MAP_POPULATE = 0x8000 + MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 + MCL_CURRENT = 0x2000 + MCL_FUTURE = 0x4000 + MCL_ONFAULT = 0x8000 + NFDBITS = 0x20 + NL2 = 0x200 + NL3 = 0x300 + NLDLY = 0x300 + NOFLSH = 0x80000000 + NS_GET_NSTYPE = 0x2000b703 + NS_GET_OWNER_UID = 0x2000b704 + NS_GET_PARENT = 0x2000b702 + NS_GET_USERNS = 0x2000b701 + OLCUC = 0x4 + ONLCR = 0x2 + O_APPEND = 0x400 + O_ASYNC = 0x2000 + O_CLOEXEC = 0x80000 + O_CREAT = 0x40 + O_DIRECT = 0x20000 + O_DIRECTORY = 0x4000 + O_DSYNC = 0x1000 + O_EXCL = 0x80 + O_FSYNC = 0x101000 + O_LARGEFILE = 0x10000 + O_NDELAY = 0x800 + O_NOATIME = 0x40000 + O_NOCTTY = 0x100 + O_NOFOLLOW = 0x8000 + O_NONBLOCK = 0x800 + O_PATH = 0x200000 + O_RSYNC = 0x101000 + O_SYNC = 0x101000 + O_TMPFILE = 0x404000 + O_TRUNC = 0x200 + PARENB = 0x1000 + PARODD = 0x2000 + PENDIN = 0x20000000 + PERF_EVENT_IOC_DISABLE = 0x20002401 + PERF_EVENT_IOC_ENABLE = 0x20002400 + PERF_EVENT_IOC_ID = 0x40042407 + PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8004240b + PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 + PERF_EVENT_IOC_PERIOD = 0x80082404 + PERF_EVENT_IOC_QUERY_BPF = 0xc004240a + PERF_EVENT_IOC_REFRESH = 0x20002402 + PERF_EVENT_IOC_RESET = 0x20002403 + PERF_EVENT_IOC_SET_BPF = 0x80042408 + PERF_EVENT_IOC_SET_FILTER = 0x80042406 + PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCBRIDGECHAN = 0x80047435 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4008743f + PPPIOCGIDLE32 = 0x4008743f + PPPIOCGIDLE64 = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCSACTIVE = 0x80087446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x800c744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80087447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCUNBRIDGECHAN = 0x20007434 + PPPIOCXFERUNIT = 0x2000744e + PROT_SAO = 0x10 + PR_SET_PTRACER_ANY = 0xffffffff + PTRACE_GETEVRREGS = 0x14 + PTRACE_GETFPREGS = 0xe + PTRACE_GETREGS64 = 0x16 + PTRACE_GETVRREGS = 0x12 + PTRACE_GETVSRREGS = 0x1b + PTRACE_GET_DEBUGREG = 0x19 + PTRACE_SETEVRREGS = 0x15 + PTRACE_SETFPREGS = 0xf + PTRACE_SETREGS64 = 0x17 + PTRACE_SETVRREGS = 0x13 + PTRACE_SETVSRREGS = 0x1c + PTRACE_SET_DEBUGREG = 0x1a + PTRACE_SINGLEBLOCK = 0x100 + PTRACE_SYSEMU = 0x1d + PTRACE_SYSEMU_SINGLESTEP = 0x1e + PT_CCR = 0x26 + PT_CTR = 0x23 + PT_DAR = 0x29 + PT_DSCR = 0x2c + PT_DSISR = 0x2a + PT_FPR0 = 0x30 + PT_FPR31 = 0x6e + PT_FPSCR = 0x71 + PT_LNK = 0x24 + PT_MQ = 0x27 + PT_MSR = 0x21 + PT_NIP = 0x20 + PT_ORIG_R3 = 0x22 + PT_R0 = 0x0 + PT_R1 = 0x1 + PT_R10 = 0xa + PT_R11 = 0xb + PT_R12 = 0xc + PT_R13 = 0xd + PT_R14 = 0xe + PT_R15 = 0xf + PT_R16 = 0x10 + PT_R17 = 0x11 + PT_R18 = 0x12 + PT_R19 = 0x13 + PT_R2 = 0x2 + PT_R20 = 0x14 + PT_R21 = 0x15 + PT_R22 = 0x16 + PT_R23 = 0x17 + PT_R24 = 0x18 + PT_R25 = 0x19 + PT_R26 = 0x1a + PT_R27 = 0x1b + PT_R28 = 0x1c + PT_R29 = 0x1d + PT_R3 = 0x3 + PT_R30 = 0x1e + PT_R31 = 0x1f + PT_R4 = 0x4 + PT_R5 = 0x5 + PT_R6 = 0x6 + PT_R7 = 0x7 + PT_R8 = 0x8 + PT_R9 = 0x9 + PT_REGS_COUNT = 0x2c + PT_RESULT = 0x2b + PT_TRAP = 0x28 + PT_XER = 0x25 + RLIMIT_AS = 0x9 + RLIMIT_MEMLOCK = 0x8 + RLIMIT_NOFILE = 0x7 + RLIMIT_NPROC = 0x6 + RLIMIT_RSS = 0x5 + RNDADDENTROPY = 0x80085203 + RNDADDTOENTCNT = 0x80045201 + RNDCLEARPOOL = 0x20005206 + RNDGETENTCNT = 0x40045200 + RNDGETPOOL = 0x40085202 + RNDRESEEDCRNG = 0x20005207 + RNDZAPENTCNT = 0x20005204 + RTC_AIE_OFF = 0x20007002 + RTC_AIE_ON = 0x20007001 + RTC_ALM_READ = 0x40247008 + RTC_ALM_SET = 0x80247007 + RTC_EPOCH_READ = 0x4004700d + RTC_EPOCH_SET = 0x8004700e + RTC_IRQP_READ = 0x4004700b + RTC_IRQP_SET = 0x8004700c + RTC_PIE_OFF = 0x20007006 + RTC_PIE_ON = 0x20007005 + RTC_PLL_GET = 0x401c7011 + RTC_PLL_SET = 0x801c7012 + RTC_RD_TIME = 0x40247009 + RTC_SET_TIME = 0x8024700a + RTC_UIE_OFF = 0x20007004 + RTC_UIE_ON = 0x20007003 + RTC_VL_CLR = 0x20007014 + RTC_VL_READ = 0x40047013 + RTC_WIE_OFF = 0x20007010 + RTC_WIE_ON = 0x2000700f + RTC_WKALM_RD = 0x40287010 + RTC_WKALM_SET = 0x8028700f + SCM_TIMESTAMPING = 0x25 + SCM_TIMESTAMPING_OPT_STATS = 0x36 + SCM_TIMESTAMPING_PKTINFO = 0x3a + SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d + SCM_WIFI_STATUS = 0x29 + SFD_CLOEXEC = 0x80000 + SFD_NONBLOCK = 0x800 + SIOCATMARK = 0x8905 + SIOCGPGRP = 0x8904 + SIOCGSTAMPNS_NEW = 0x40108907 + SIOCGSTAMP_NEW = 0x40108906 + SIOCINQ = 0x4004667f + SIOCOUTQ = 0x40047473 + SIOCSPGRP = 0x8902 + SOCK_CLOEXEC = 0x80000 + SOCK_DGRAM = 0x2 + SOCK_NONBLOCK = 0x800 + SOCK_STREAM = 0x1 + SOL_SOCKET = 0x1 + SO_ACCEPTCONN = 0x1e + SO_ATTACH_BPF = 0x32 + SO_ATTACH_REUSEPORT_CBPF = 0x33 + SO_ATTACH_REUSEPORT_EBPF = 0x34 + SO_BINDTODEVICE = 0x19 + SO_BINDTOIFINDEX = 0x3e + SO_BPF_EXTENSIONS = 0x30 + SO_BROADCAST = 0x6 + SO_BSDCOMPAT = 0xe + SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 + SO_CNX_ADVICE = 0x35 + SO_COOKIE = 0x39 + SO_DETACH_REUSEPORT_BPF = 0x44 + SO_DOMAIN = 0x27 + SO_DONTROUTE = 0x5 + SO_ERROR = 0x4 + SO_INCOMING_CPU = 0x31 + SO_INCOMING_NAPI_ID = 0x38 + SO_KEEPALIVE = 0x9 + SO_LINGER = 0xd + SO_LOCK_FILTER = 0x2c + SO_MARK = 0x24 + SO_MAX_PACING_RATE = 0x2f + SO_MEMINFO = 0x37 + SO_NOFCS = 0x2b + SO_OOBINLINE = 0xa + SO_PASSCRED = 0x14 + SO_PASSSEC = 0x22 + SO_PEEK_OFF = 0x2a + SO_PEERCRED = 0x15 + SO_PEERGROUPS = 0x3b + SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 + SO_PROTOCOL = 0x26 + SO_RCVBUF = 0x8 + SO_RCVBUFFORCE = 0x21 + SO_RCVLOWAT = 0x10 + SO_RCVTIMEO = 0x12 + SO_RCVTIMEO_NEW = 0x42 + SO_RCVTIMEO_OLD = 0x12 + SO_REUSEADDR = 0x2 + SO_REUSEPORT = 0xf + SO_RXQ_OVFL = 0x28 + SO_SECURITY_AUTHENTICATION = 0x16 + SO_SECURITY_ENCRYPTION_NETWORK = 0x18 + SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 + SO_SELECT_ERR_QUEUE = 0x2d + SO_SNDBUF = 0x7 + SO_SNDBUFFORCE = 0x20 + SO_SNDLOWAT = 0x11 + SO_SNDTIMEO = 0x13 + SO_SNDTIMEO_NEW = 0x43 + SO_SNDTIMEO_OLD = 0x13 + SO_TIMESTAMPING = 0x25 + SO_TIMESTAMPING_NEW = 0x41 + SO_TIMESTAMPING_OLD = 0x25 + SO_TIMESTAMPNS = 0x23 + SO_TIMESTAMPNS_NEW = 0x40 + SO_TIMESTAMPNS_OLD = 0x23 + SO_TIMESTAMP_NEW = 0x3f + SO_TXTIME = 0x3d + SO_TYPE = 0x3 + SO_WIFI_STATUS = 0x29 + SO_ZEROCOPY = 0x3c + TAB1 = 0x400 + TAB2 = 0x800 + TAB3 = 0xc00 + TABDLY = 0xc00 + TCFLSH = 0x2000741f + TCGETA = 0x40147417 + TCGETS = 0x402c7413 + TCSAFLUSH = 0x2 + TCSBRK = 0x2000741d + TCSBRKP = 0x5425 + TCSETA = 0x80147418 + TCSETAF = 0x8014741c + TCSETAW = 0x80147419 + TCSETS = 0x802c7414 + TCSETSF = 0x802c7416 + TCSETSW = 0x802c7415 + TCXONC = 0x2000741e + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 + TIOCCBRK = 0x5428 + TIOCCONS = 0x541d + TIOCEXCL = 0x540c + TIOCGDEV = 0x40045432 + TIOCGETC = 0x40067412 + TIOCGETD = 0x5424 + TIOCGETP = 0x40067408 + TIOCGEXCL = 0x40045440 + TIOCGICOUNT = 0x545d + TIOCGISO7816 = 0x40285442 + TIOCGLCKTRMIOS = 0x5456 + TIOCGLTC = 0x40067474 + TIOCGPGRP = 0x40047477 + TIOCGPKT = 0x40045438 + TIOCGPTLCK = 0x40045439 + TIOCGPTN = 0x40045430 + TIOCGPTPEER = 0x20005441 + TIOCGRS485 = 0x542e + TIOCGSERIAL = 0x541e + TIOCGSID = 0x5429 + TIOCGSOFTCAR = 0x5419 + TIOCGWINSZ = 0x40087468 + TIOCINQ = 0x4004667f + TIOCLINUX = 0x541c + TIOCMBIC = 0x5417 + TIOCMBIS = 0x5416 + TIOCMGET = 0x5415 + TIOCMIWAIT = 0x545c + TIOCMSET = 0x5418 + TIOCM_CAR = 0x40 + TIOCM_CD = 0x40 + TIOCM_CTS = 0x20 + TIOCM_DSR = 0x100 + TIOCM_LOOP = 0x8000 + TIOCM_OUT1 = 0x2000 + TIOCM_OUT2 = 0x4000 + TIOCM_RI = 0x80 + TIOCM_RNG = 0x80 + TIOCM_SR = 0x10 + TIOCM_ST = 0x8 + TIOCNOTTY = 0x5422 + TIOCNXCL = 0x540d + TIOCOUTQ = 0x40047473 + TIOCPKT = 0x5420 + TIOCSBRK = 0x5427 + TIOCSCTTY = 0x540e + TIOCSERCONFIG = 0x5453 + TIOCSERGETLSR = 0x5459 + TIOCSERGETMULTI = 0x545a + TIOCSERGSTRUCT = 0x5458 + TIOCSERGWILD = 0x5454 + TIOCSERSETMULTI = 0x545b + TIOCSERSWILD = 0x5455 + TIOCSER_TEMT = 0x1 + TIOCSETC = 0x80067411 + TIOCSETD = 0x5423 + TIOCSETN = 0x8006740a + TIOCSETP = 0x80067409 + TIOCSIG = 0x80045436 + TIOCSISO7816 = 0xc0285443 + TIOCSLCKTRMIOS = 0x5457 + TIOCSLTC = 0x80067475 + TIOCSPGRP = 0x80047476 + TIOCSPTLCK = 0x80045431 + TIOCSRS485 = 0x542f + TIOCSSERIAL = 0x541f + TIOCSSOFTCAR = 0x541a + TIOCSTART = 0x2000746e + TIOCSTI = 0x5412 + TIOCSTOP = 0x2000746f + TIOCSWINSZ = 0x80087467 + TIOCVHANGUP = 0x5437 + TOSTOP = 0x400000 + TUNATTACHFILTER = 0x800854d5 + TUNDETACHFILTER = 0x800854d6 + TUNGETDEVNETNS = 0x200054e3 + TUNGETFEATURES = 0x400454cf + TUNGETFILTER = 0x400854db + TUNGETIFF = 0x400454d2 + TUNGETSNDBUF = 0x400454d3 + TUNGETVNETBE = 0x400454df + TUNGETVNETHDRSZ = 0x400454d7 + TUNGETVNETLE = 0x400454dd + TUNSETCARRIER = 0x800454e2 + TUNSETDEBUG = 0x800454c9 + TUNSETFILTEREBPF = 0x400454e1 + TUNSETGROUP = 0x800454ce + TUNSETIFF = 0x800454ca + TUNSETIFINDEX = 0x800454da + TUNSETLINK = 0x800454cd + TUNSETNOCSUM = 0x800454c8 + TUNSETOFFLOAD = 0x800454d0 + TUNSETOWNER = 0x800454cc + TUNSETPERSIST = 0x800454cb + TUNSETQUEUE = 0x800454d9 + TUNSETSNDBUF = 0x800454d4 + TUNSETSTEERINGEBPF = 0x400454e0 + TUNSETTXFILTER = 0x800454d1 + TUNSETVNETBE = 0x800454de + TUNSETVNETHDRSZ = 0x800454d8 + TUNSETVNETLE = 0x800454dc + UBI_IOCATT = 0x80186f40 + UBI_IOCDET = 0x80046f41 + UBI_IOCEBCH = 0x80044f02 + UBI_IOCEBER = 0x80044f01 + UBI_IOCEBISMAP = 0x40044f05 + UBI_IOCEBMAP = 0x80084f03 + UBI_IOCEBUNMAP = 0x80044f04 + UBI_IOCMKVOL = 0x80986f00 + UBI_IOCRMVOL = 0x80046f01 + UBI_IOCRNVOL = 0x91106f03 + UBI_IOCRPEB = 0x80046f04 + UBI_IOCRSVOL = 0x800c6f02 + UBI_IOCSETVOLPROP = 0x80104f06 + UBI_IOCSPEB = 0x80046f05 + UBI_IOCVOLCRBLK = 0x80804f07 + UBI_IOCVOLRMBLK = 0x20004f08 + UBI_IOCVOLUP = 0x80084f00 + VDISCARD = 0x10 + VEOF = 0x4 + VEOL = 0x6 + VEOL2 = 0x8 + VMIN = 0x5 + VREPRINT = 0xb + VSTART = 0xd + VSTOP = 0xe + VSUSP = 0xc + VSWTC = 0x9 + VT1 = 0x10000 + VTDLY = 0x10000 + VTIME = 0x7 + VWERASE = 0xa + WDIOC_GETBOOTSTATUS = 0x40045702 + WDIOC_GETPRETIMEOUT = 0x40045709 + WDIOC_GETSTATUS = 0x40045701 + WDIOC_GETSUPPORT = 0x40285700 + WDIOC_GETTEMP = 0x40045703 + WDIOC_GETTIMELEFT = 0x4004570a + WDIOC_GETTIMEOUT = 0x40045707 + WDIOC_KEEPALIVE = 0x40045705 + WDIOC_SETOPTIONS = 0x40045704 + WORDSIZE = 0x20 + XCASE = 0x4000 + XTABS = 0xc00 + _HIDIOCGRAWNAME = 0x40804804 + _HIDIOCGRAWPHYS = 0x40404805 + _HIDIOCGRAWUNIQ = 0x40404808 +) + +// Errors +const ( + EADDRINUSE = syscall.Errno(0x62) + EADDRNOTAVAIL = syscall.Errno(0x63) + EADV = syscall.Errno(0x44) + EAFNOSUPPORT = syscall.Errno(0x61) + EALREADY = syscall.Errno(0x72) + EBADE = syscall.Errno(0x34) + EBADFD = syscall.Errno(0x4d) + EBADMSG = syscall.Errno(0x4a) + EBADR = syscall.Errno(0x35) + EBADRQC = syscall.Errno(0x38) + EBADSLT = syscall.Errno(0x39) + EBFONT = syscall.Errno(0x3b) + ECANCELED = syscall.Errno(0x7d) + ECHRNG = syscall.Errno(0x2c) + ECOMM = syscall.Errno(0x46) + ECONNABORTED = syscall.Errno(0x67) + ECONNREFUSED = syscall.Errno(0x6f) + ECONNRESET = syscall.Errno(0x68) + EDEADLK = syscall.Errno(0x23) + EDEADLOCK = syscall.Errno(0x3a) + EDESTADDRREQ = syscall.Errno(0x59) + EDOTDOT = syscall.Errno(0x49) + EDQUOT = syscall.Errno(0x7a) + EHOSTDOWN = syscall.Errno(0x70) + EHOSTUNREACH = syscall.Errno(0x71) + EHWPOISON = syscall.Errno(0x85) + EIDRM = syscall.Errno(0x2b) + EILSEQ = syscall.Errno(0x54) + EINPROGRESS = syscall.Errno(0x73) + EISCONN = syscall.Errno(0x6a) + EISNAM = syscall.Errno(0x78) + EKEYEXPIRED = syscall.Errno(0x7f) + EKEYREJECTED = syscall.Errno(0x81) + EKEYREVOKED = syscall.Errno(0x80) + EL2HLT = syscall.Errno(0x33) + EL2NSYNC = syscall.Errno(0x2d) + EL3HLT = syscall.Errno(0x2e) + EL3RST = syscall.Errno(0x2f) + ELIBACC = syscall.Errno(0x4f) + ELIBBAD = syscall.Errno(0x50) + ELIBEXEC = syscall.Errno(0x53) + ELIBMAX = syscall.Errno(0x52) + ELIBSCN = syscall.Errno(0x51) + ELNRNG = syscall.Errno(0x30) + ELOOP = syscall.Errno(0x28) + EMEDIUMTYPE = syscall.Errno(0x7c) + EMSGSIZE = syscall.Errno(0x5a) + EMULTIHOP = syscall.Errno(0x48) + ENAMETOOLONG = syscall.Errno(0x24) + ENAVAIL = syscall.Errno(0x77) + ENETDOWN = syscall.Errno(0x64) + ENETRESET = syscall.Errno(0x66) + ENETUNREACH = syscall.Errno(0x65) + ENOANO = syscall.Errno(0x37) + ENOBUFS = syscall.Errno(0x69) + ENOCSI = syscall.Errno(0x32) + ENODATA = syscall.Errno(0x3d) + ENOKEY = syscall.Errno(0x7e) + ENOLCK = syscall.Errno(0x25) + ENOLINK = syscall.Errno(0x43) + ENOMEDIUM = syscall.Errno(0x7b) + ENOMSG = syscall.Errno(0x2a) + ENONET = syscall.Errno(0x40) + ENOPKG = syscall.Errno(0x41) + ENOPROTOOPT = syscall.Errno(0x5c) + ENOSR = syscall.Errno(0x3f) + ENOSTR = syscall.Errno(0x3c) + ENOSYS = syscall.Errno(0x26) + ENOTCONN = syscall.Errno(0x6b) + ENOTEMPTY = syscall.Errno(0x27) + ENOTNAM = syscall.Errno(0x76) + ENOTRECOVERABLE = syscall.Errno(0x83) + ENOTSOCK = syscall.Errno(0x58) + ENOTSUP = syscall.Errno(0x5f) + ENOTUNIQ = syscall.Errno(0x4c) + EOPNOTSUPP = syscall.Errno(0x5f) + EOVERFLOW = syscall.Errno(0x4b) + EOWNERDEAD = syscall.Errno(0x82) + EPFNOSUPPORT = syscall.Errno(0x60) + EPROTO = syscall.Errno(0x47) + EPROTONOSUPPORT = syscall.Errno(0x5d) + EPROTOTYPE = syscall.Errno(0x5b) + EREMCHG = syscall.Errno(0x4e) + EREMOTE = syscall.Errno(0x42) + EREMOTEIO = syscall.Errno(0x79) + ERESTART = syscall.Errno(0x55) + ERFKILL = syscall.Errno(0x84) + ESHUTDOWN = syscall.Errno(0x6c) + ESOCKTNOSUPPORT = syscall.Errno(0x5e) + ESRMNT = syscall.Errno(0x45) + ESTALE = syscall.Errno(0x74) + ESTRPIPE = syscall.Errno(0x56) + ETIME = syscall.Errno(0x3e) + ETIMEDOUT = syscall.Errno(0x6e) + ETOOMANYREFS = syscall.Errno(0x6d) + EUCLEAN = syscall.Errno(0x75) + EUNATCH = syscall.Errno(0x31) + EUSERS = syscall.Errno(0x57) + EXFULL = syscall.Errno(0x36) +) + +// Signals +const ( + SIGBUS = syscall.Signal(0x7) + SIGCHLD = syscall.Signal(0x11) + SIGCLD = syscall.Signal(0x11) + SIGCONT = syscall.Signal(0x12) + SIGIO = syscall.Signal(0x1d) + SIGPOLL = syscall.Signal(0x1d) + SIGPROF = syscall.Signal(0x1b) + SIGPWR = syscall.Signal(0x1e) + SIGSTKFLT = syscall.Signal(0x10) + SIGSTOP = syscall.Signal(0x13) + SIGSYS = syscall.Signal(0x1f) + SIGTSTP = syscall.Signal(0x14) + SIGTTIN = syscall.Signal(0x15) + SIGTTOU = syscall.Signal(0x16) + SIGURG = syscall.Signal(0x17) + SIGUSR1 = syscall.Signal(0xa) + SIGUSR2 = syscall.Signal(0xc) + SIGVTALRM = syscall.Signal(0x1a) + SIGWINCH = syscall.Signal(0x1c) + SIGXCPU = syscall.Signal(0x18) + SIGXFSZ = syscall.Signal(0x19) +) + +// Error table +var errorList = [...]struct { + num syscall.Errno + name string + desc string +}{ + {1, "EPERM", "operation not permitted"}, + {2, "ENOENT", "no such file or directory"}, + {3, "ESRCH", "no such process"}, + {4, "EINTR", "interrupted system call"}, + {5, "EIO", "input/output error"}, + {6, "ENXIO", "no such device or address"}, + {7, "E2BIG", "argument list too long"}, + {8, "ENOEXEC", "exec format error"}, + {9, "EBADF", "bad file descriptor"}, + {10, "ECHILD", "no child processes"}, + {11, "EAGAIN", "resource temporarily unavailable"}, + {12, "ENOMEM", "cannot allocate memory"}, + {13, "EACCES", "permission denied"}, + {14, "EFAULT", "bad address"}, + {15, "ENOTBLK", "block device required"}, + {16, "EBUSY", "device or resource busy"}, + {17, "EEXIST", "file exists"}, + {18, "EXDEV", "invalid cross-device link"}, + {19, "ENODEV", "no such device"}, + {20, "ENOTDIR", "not a directory"}, + {21, "EISDIR", "is a directory"}, + {22, "EINVAL", "invalid argument"}, + {23, "ENFILE", "too many open files in system"}, + {24, "EMFILE", "too many open files"}, + {25, "ENOTTY", "inappropriate ioctl for device"}, + {26, "ETXTBSY", "text file busy"}, + {27, "EFBIG", "file too large"}, + {28, "ENOSPC", "no space left on device"}, + {29, "ESPIPE", "illegal seek"}, + {30, "EROFS", "read-only file system"}, + {31, "EMLINK", "too many links"}, + {32, "EPIPE", "broken pipe"}, + {33, "EDOM", "numerical argument out of domain"}, + {34, "ERANGE", "numerical result out of range"}, + {35, "EDEADLK", "resource deadlock avoided"}, + {36, "ENAMETOOLONG", "file name too long"}, + {37, "ENOLCK", "no locks available"}, + {38, "ENOSYS", "function not implemented"}, + {39, "ENOTEMPTY", "directory not empty"}, + {40, "ELOOP", "too many levels of symbolic links"}, + {42, "ENOMSG", "no message of desired type"}, + {43, "EIDRM", "identifier removed"}, + {44, "ECHRNG", "channel number out of range"}, + {45, "EL2NSYNC", "level 2 not synchronized"}, + {46, "EL3HLT", "level 3 halted"}, + {47, "EL3RST", "level 3 reset"}, + {48, "ELNRNG", "link number out of range"}, + {49, "EUNATCH", "protocol driver not attached"}, + {50, "ENOCSI", "no CSI structure available"}, + {51, "EL2HLT", "level 2 halted"}, + {52, "EBADE", "invalid exchange"}, + {53, "EBADR", "invalid request descriptor"}, + {54, "EXFULL", "exchange full"}, + {55, "ENOANO", "no anode"}, + {56, "EBADRQC", "invalid request code"}, + {57, "EBADSLT", "invalid slot"}, + {58, "EDEADLOCK", "file locking deadlock error"}, + {59, "EBFONT", "bad font file format"}, + {60, "ENOSTR", "device not a stream"}, + {61, "ENODATA", "no data available"}, + {62, "ETIME", "timer expired"}, + {63, "ENOSR", "out of streams resources"}, + {64, "ENONET", "machine is not on the network"}, + {65, "ENOPKG", "package not installed"}, + {66, "EREMOTE", "object is remote"}, + {67, "ENOLINK", "link has been severed"}, + {68, "EADV", "advertise error"}, + {69, "ESRMNT", "srmount error"}, + {70, "ECOMM", "communication error on send"}, + {71, "EPROTO", "protocol error"}, + {72, "EMULTIHOP", "multihop attempted"}, + {73, "EDOTDOT", "RFS specific error"}, + {74, "EBADMSG", "bad message"}, + {75, "EOVERFLOW", "value too large for defined data type"}, + {76, "ENOTUNIQ", "name not unique on network"}, + {77, "EBADFD", "file descriptor in bad state"}, + {78, "EREMCHG", "remote address changed"}, + {79, "ELIBACC", "can not access a needed shared library"}, + {80, "ELIBBAD", "accessing a corrupted shared library"}, + {81, "ELIBSCN", ".lib section in a.out corrupted"}, + {82, "ELIBMAX", "attempting to link in too many shared libraries"}, + {83, "ELIBEXEC", "cannot exec a shared library directly"}, + {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, + {85, "ERESTART", "interrupted system call should be restarted"}, + {86, "ESTRPIPE", "streams pipe error"}, + {87, "EUSERS", "too many users"}, + {88, "ENOTSOCK", "socket operation on non-socket"}, + {89, "EDESTADDRREQ", "destination address required"}, + {90, "EMSGSIZE", "message too long"}, + {91, "EPROTOTYPE", "protocol wrong type for socket"}, + {92, "ENOPROTOOPT", "protocol not available"}, + {93, "EPROTONOSUPPORT", "protocol not supported"}, + {94, "ESOCKTNOSUPPORT", "socket type not supported"}, + {95, "ENOTSUP", "operation not supported"}, + {96, "EPFNOSUPPORT", "protocol family not supported"}, + {97, "EAFNOSUPPORT", "address family not supported by protocol"}, + {98, "EADDRINUSE", "address already in use"}, + {99, "EADDRNOTAVAIL", "cannot assign requested address"}, + {100, "ENETDOWN", "network is down"}, + {101, "ENETUNREACH", "network is unreachable"}, + {102, "ENETRESET", "network dropped connection on reset"}, + {103, "ECONNABORTED", "software caused connection abort"}, + {104, "ECONNRESET", "connection reset by peer"}, + {105, "ENOBUFS", "no buffer space available"}, + {106, "EISCONN", "transport endpoint is already connected"}, + {107, "ENOTCONN", "transport endpoint is not connected"}, + {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, + {109, "ETOOMANYREFS", "too many references: cannot splice"}, + {110, "ETIMEDOUT", "connection timed out"}, + {111, "ECONNREFUSED", "connection refused"}, + {112, "EHOSTDOWN", "host is down"}, + {113, "EHOSTUNREACH", "no route to host"}, + {114, "EALREADY", "operation already in progress"}, + {115, "EINPROGRESS", "operation now in progress"}, + {116, "ESTALE", "stale file handle"}, + {117, "EUCLEAN", "structure needs cleaning"}, + {118, "ENOTNAM", "not a XENIX named type file"}, + {119, "ENAVAIL", "no XENIX semaphores available"}, + {120, "EISNAM", "is a named type file"}, + {121, "EREMOTEIO", "remote I/O error"}, + {122, "EDQUOT", "disk quota exceeded"}, + {123, "ENOMEDIUM", "no medium found"}, + {124, "EMEDIUMTYPE", "wrong medium type"}, + {125, "ECANCELED", "operation canceled"}, + {126, "ENOKEY", "required key not available"}, + {127, "EKEYEXPIRED", "key has expired"}, + {128, "EKEYREVOKED", "key has been revoked"}, + {129, "EKEYREJECTED", "key was rejected by service"}, + {130, "EOWNERDEAD", "owner died"}, + {131, "ENOTRECOVERABLE", "state not recoverable"}, + {132, "ERFKILL", "operation not possible due to RF-kill"}, + {133, "EHWPOISON", "memory page has hardware error"}, +} + +// Signal table +var signalList = [...]struct { + num syscall.Signal + name string + desc string +}{ + {1, "SIGHUP", "hangup"}, + {2, "SIGINT", "interrupt"}, + {3, "SIGQUIT", "quit"}, + {4, "SIGILL", "illegal instruction"}, + {5, "SIGTRAP", "trace/breakpoint trap"}, + {6, "SIGABRT", "aborted"}, + {7, "SIGBUS", "bus error"}, + {8, "SIGFPE", "floating point exception"}, + {9, "SIGKILL", "killed"}, + {10, "SIGUSR1", "user defined signal 1"}, + {11, "SIGSEGV", "segmentation fault"}, + {12, "SIGUSR2", "user defined signal 2"}, + {13, "SIGPIPE", "broken pipe"}, + {14, "SIGALRM", "alarm clock"}, + {15, "SIGTERM", "terminated"}, + {16, "SIGSTKFLT", "stack fault"}, + {17, "SIGCHLD", "child exited"}, + {18, "SIGCONT", "continued"}, + {19, "SIGSTOP", "stopped (signal)"}, + {20, "SIGTSTP", "stopped"}, + {21, "SIGTTIN", "stopped (tty input)"}, + {22, "SIGTTOU", "stopped (tty output)"}, + {23, "SIGURG", "urgent I/O condition"}, + {24, "SIGXCPU", "CPU time limit exceeded"}, + {25, "SIGXFSZ", "file size limit exceeded"}, + {26, "SIGVTALRM", "virtual timer expired"}, + {27, "SIGPROF", "profiling timer expired"}, + {28, "SIGWINCH", "window changed"}, + {29, "SIGIO", "I/O possible"}, + {30, "SIGPWR", "power failure"}, + {31, "SIGSYS", "bad system call"}, +} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index a508392d2582..6d30e6fd846a 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -212,6 +212,8 @@ const ( PTRACE_POKE_SYSTEM_CALL = 0x5008 PTRACE_PROT = 0x15 PTRACE_SINGLEBLOCK = 0xc + PTRACE_SYSEMU = 0x1f + PTRACE_SYSEMU_SINGLESTEP = 0x20 PTRACE_TE_ABORT_RAND = 0x5011 PT_ACR0 = 0x90 PT_ACR1 = 0x94 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go index 65fb2c5cd83c..1afee6a08905 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go @@ -366,6 +366,7 @@ const ( HUPCL = 0x400 IBSHIFT = 0x10 ICANON = 0x2 + ICMP6_FILTER = 0x1 ICRNL = 0x100 IEXTEN = 0x8000 IFF_ADDRCONF = 0x80000 @@ -612,6 +613,7 @@ const ( IP_RECVPKTINFO = 0x1a IP_RECVRETOPTS = 0x6 IP_RECVSLLA = 0xa + IP_RECVTOS = 0xc IP_RECVTTL = 0xb IP_RETOPTS = 0x8 IP_REUSEADDR = 0x104 @@ -704,6 +706,7 @@ const ( O_APPEND = 0x8 O_CLOEXEC = 0x800000 O_CREAT = 0x100 + O_DIRECT = 0x2000000 O_DIRECTORY = 0x1000000 O_DSYNC = 0x40 O_EXCL = 0x400 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go index 4117ce08a506..4e87b4bebd5f 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go @@ -137,6 +137,7 @@ const ( IP_TTL = 3 IP_UNBLOCK_SOURCE = 11 ICANON = 0x0010 + ICMP6_FILTER = 0x26 ICRNL = 0x0002 IEXTEN = 0x0020 IGNBRK = 0x0004 @@ -163,6 +164,12 @@ const ( MAP_PRIVATE = 0x1 // changes are private MAP_SHARED = 0x2 // changes are shared MAP_FIXED = 0x4 // place exactly + MCAST_JOIN_GROUP = 40 + MCAST_LEAVE_GROUP = 41 + MCAST_JOIN_SOURCE_GROUP = 42 + MCAST_LEAVE_SOURCE_GROUP = 43 + MCAST_BLOCK_SOURCE = 44 + MCAST_UNBLOCK_SOURCE = 45 MS_SYNC = 0x1 // msync - synchronous writes MS_ASYNC = 0x2 // asynchronous writes MS_INVALIDATE = 0x4 // invalidate mappings diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s index 00da1ebfca12..1c73a1921d72 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s @@ -1,6 +1,7 @@ // go run mkasm_darwin.go 386 // Code generated by the command above; DO NOT EDIT. +//go:build go1.13 // +build go1.13 #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s index 1c53979a101e..8cc7928d9294 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s @@ -1,6 +1,7 @@ // go run mkasm_darwin.go 386 // Code generated by the command above; DO NOT EDIT. +//go:build go1.12 // +build go1.12 #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s index d671e8311fa7..ab59833fcd28 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s @@ -1,6 +1,7 @@ // go run mkasm_darwin.go amd64 // Code generated by the command above; DO NOT EDIT. +//go:build go1.13 // +build go1.13 #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index c77bd6e20bdc..b8f316e676d5 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -1,6 +1,7 @@ // go run mkasm_darwin.go amd64 // Code generated by the command above; DO NOT EDIT. +//go:build go1.12 // +build go1.12 #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s index 488e55707ab1..0cc80ad87ea2 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s @@ -1,6 +1,7 @@ // go run mkasm_darwin.go arm // Code generated by the command above; DO NOT EDIT. +//go:build go1.13 // +build go1.13 #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s index 5eec5f1d9534..a99f9c1113e2 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s @@ -1,6 +1,7 @@ // go run mkasm_darwin.go arm // Code generated by the command above; DO NOT EDIT. +//go:build go1.12 // +build go1.12 #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s index b29dabb0f084..a5f96ffb07d3 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s @@ -1,6 +1,7 @@ // go run mkasm_darwin.go arm64 // Code generated by the command above; DO NOT EDIT. +//go:build go1.13 // +build go1.13 #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 53c402bf68b5..e30a69740718 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -1,6 +1,7 @@ // go run mkasm_darwin.go arm64 // Code generated by the command above; DO NOT EDIT. +//go:build go1.12 // +build go1.12 #include "textflag.h" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go index b57c7050d7a8..af5cb064ec4f 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go @@ -15,19 +15,25 @@ import ( //go:cgo_import_dynamic libc_writev writev "libc.so" //go:cgo_import_dynamic libc_pwritev pwritev "libc.so" //go:cgo_import_dynamic libc_accept4 accept4 "libsocket.so" +//go:cgo_import_dynamic libc_putmsg putmsg "libc.so" +//go:cgo_import_dynamic libc_getmsg getmsg "libc.so" //go:linkname procreadv libc_readv //go:linkname procpreadv libc_preadv //go:linkname procwritev libc_writev //go:linkname procpwritev libc_pwritev //go:linkname procaccept4 libc_accept4 +//go:linkname procputmsg libc_putmsg +//go:linkname procgetmsg libc_getmsg var ( procreadv, procpreadv, procwritev, procpwritev, - procaccept4 syscallFunc + procaccept4, + procputmsg, + procgetmsg syscallFunc ) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -100,3 +106,23 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) { + _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procputmsg)), 4, uintptr(fd), uintptr(unsafe.Pointer(clptr)), uintptr(unsafe.Pointer(dataptr)), uintptr(flags), 0, 0) + if e1 != 0 { + err = e1 + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) { + _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetmsg)), 4, uintptr(fd), uintptr(unsafe.Pointer(clptr)), uintptr(unsafe.Pointer(dataptr)), uintptr(unsafe.Pointer(flags)), 0, 0) + if e1 != 0 { + err = e1 + } + return +} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 3ee26f4ad169..7305cc915b7a 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -532,6 +532,16 @@ func Close(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func CloseRange(first uint, last uint, flags uint) (err error) { + _, _, e1 := Syscall(SYS_CLOSE_RANGE, uintptr(first), uintptr(last), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go new file mode 100644 index 000000000000..927cf1a00f0d --- /dev/null +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go @@ -0,0 +1,762 @@ +// go run mksyscall.go -b32 -tags linux,ppc syscall_linux.go syscall_linux_ppc.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build linux && ppc +// +build linux,ppc + +package unix + +import ( + "syscall" + "unsafe" +) + +var _ syscall.Errno + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { + _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask>>32), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { + _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off>>32), uintptr(off), uintptr(len>>32), uintptr(len)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { + r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) + n = int64(int64(r0)<<32 | int64(r1)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func dup2(oldfd int, newfd int) (err error) { + _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func EpollCreate(size int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { + var _p0 unsafe.Pointer + if len(events) > 0 { + _p0 = unsafe.Pointer(&events[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchown(fd int, uid int, gid int) (err error) { + _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length>>32), uintptr(length)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (euid int) { + r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) + euid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func InotifyInit() (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ioperm(from int, num int, on int) (err error) { + _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Iopl(level int) (err error) { + _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, n int) (err error) { + _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pause() (err error) { + _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset>>32), uintptr(offset), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset>>32), uintptr(offset), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { + r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) + written = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setresgid(rgid int, egid int, sgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setresuid(ruid int, euid int, suid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(fd int, how int) (err error) { + _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { + r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), uintptr(length>>32), uintptr(length)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ustat(dev int, ubuf *Ustat_t) (err error) { + _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { + r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(n int, list *_Gid_t) (nn int, err error) { + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + nn = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setgroups(n int, list *_Gid_t) (err error) { + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Gettimeofday(tv *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Time(t *Time_t) (tt Time_t, err error) { + r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) + tt = Time_t(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Utime(path string, buf *Utimbuf) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimes(path string, times *[2]Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { + r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) + xaddr = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getrlimit(resource int, rlim *rlimit32) (err error) { + _, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setrlimit(resource int, rlim *rlimit32) (err error) { + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe(p *[2]_C_int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { + r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func syncFileRange2(fd int, flags int, off int64, n int64) (err error) { + _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(flags), uintptr(off>>32), uintptr(off), uintptr(n>>32), uintptr(n)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(cmdline) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index 7099f555aa4c..4e18d5c99fd3 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -619,8 +619,9 @@ func __minor(version int, dev uint64) (val uint) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func ioctl(fd int, req uint, arg uintptr) (err error) { - _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0) +func ioctlRet(fd int, req uint, arg uintptr) (ret int, err error) { + r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0) + ret = int(r0) if e1 != 0 { err = e1 } diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index 8e5359713489..fbc59b7fdd25 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -438,4 +438,5 @@ const ( SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index d7dceb769b3f..04d16d771ef7 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -360,4 +360,5 @@ const ( SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 04093a69fd8a..3b1c10513736 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -402,4 +402,5 @@ const ( SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 48f94f135d6d..3198adcf77a1 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -305,4 +305,5 @@ const ( SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 499978c3e402..c877ec6e6821 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -423,4 +423,5 @@ const ( SYS_FACCESSAT2 = 4439 SYS_PROCESS_MADVISE = 4440 SYS_EPOLL_PWAIT2 = 4441 + SYS_MOUNT_SETATTR = 4442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 10d1db2be0ce..b5f29037299a 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -353,4 +353,5 @@ const ( SYS_FACCESSAT2 = 5439 SYS_PROCESS_MADVISE = 5440 SYS_EPOLL_PWAIT2 = 5441 + SYS_MOUNT_SETATTR = 5442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 208d5dcd5a32..46077689ab1f 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -353,4 +353,5 @@ const ( SYS_FACCESSAT2 = 5439 SYS_PROCESS_MADVISE = 5440 SYS_EPOLL_PWAIT2 = 5441 + SYS_MOUNT_SETATTR = 5442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index f8250602eb8e..80e6696b39db 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -423,4 +423,5 @@ const ( SYS_FACCESSAT2 = 4439 SYS_PROCESS_MADVISE = 4440 SYS_EPOLL_PWAIT2 = 4441 + SYS_MOUNT_SETATTR = 4442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go new file mode 100644 index 000000000000..b9d697ffb1c0 --- /dev/null +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -0,0 +1,434 @@ +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build ppc && linux +// +build ppc,linux + +package unix + +const ( + SYS_RESTART_SYSCALL = 0 + SYS_EXIT = 1 + SYS_FORK = 2 + SYS_READ = 3 + SYS_WRITE = 4 + SYS_OPEN = 5 + SYS_CLOSE = 6 + SYS_WAITPID = 7 + SYS_CREAT = 8 + SYS_LINK = 9 + SYS_UNLINK = 10 + SYS_EXECVE = 11 + SYS_CHDIR = 12 + SYS_TIME = 13 + SYS_MKNOD = 14 + SYS_CHMOD = 15 + SYS_LCHOWN = 16 + SYS_BREAK = 17 + SYS_OLDSTAT = 18 + SYS_LSEEK = 19 + SYS_GETPID = 20 + SYS_MOUNT = 21 + SYS_UMOUNT = 22 + SYS_SETUID = 23 + SYS_GETUID = 24 + SYS_STIME = 25 + SYS_PTRACE = 26 + SYS_ALARM = 27 + SYS_OLDFSTAT = 28 + SYS_PAUSE = 29 + SYS_UTIME = 30 + SYS_STTY = 31 + SYS_GTTY = 32 + SYS_ACCESS = 33 + SYS_NICE = 34 + SYS_FTIME = 35 + SYS_SYNC = 36 + SYS_KILL = 37 + SYS_RENAME = 38 + SYS_MKDIR = 39 + SYS_RMDIR = 40 + SYS_DUP = 41 + SYS_PIPE = 42 + SYS_TIMES = 43 + SYS_PROF = 44 + SYS_BRK = 45 + SYS_SETGID = 46 + SYS_GETGID = 47 + SYS_SIGNAL = 48 + SYS_GETEUID = 49 + SYS_GETEGID = 50 + SYS_ACCT = 51 + SYS_UMOUNT2 = 52 + SYS_LOCK = 53 + SYS_IOCTL = 54 + SYS_FCNTL = 55 + SYS_MPX = 56 + SYS_SETPGID = 57 + SYS_ULIMIT = 58 + SYS_OLDOLDUNAME = 59 + SYS_UMASK = 60 + SYS_CHROOT = 61 + SYS_USTAT = 62 + SYS_DUP2 = 63 + SYS_GETPPID = 64 + SYS_GETPGRP = 65 + SYS_SETSID = 66 + SYS_SIGACTION = 67 + SYS_SGETMASK = 68 + SYS_SSETMASK = 69 + SYS_SETREUID = 70 + SYS_SETREGID = 71 + SYS_SIGSUSPEND = 72 + SYS_SIGPENDING = 73 + SYS_SETHOSTNAME = 74 + SYS_SETRLIMIT = 75 + SYS_GETRLIMIT = 76 + SYS_GETRUSAGE = 77 + SYS_GETTIMEOFDAY = 78 + SYS_SETTIMEOFDAY = 79 + SYS_GETGROUPS = 80 + SYS_SETGROUPS = 81 + SYS_SELECT = 82 + SYS_SYMLINK = 83 + SYS_OLDLSTAT = 84 + SYS_READLINK = 85 + SYS_USELIB = 86 + SYS_SWAPON = 87 + SYS_REBOOT = 88 + SYS_READDIR = 89 + SYS_MMAP = 90 + SYS_MUNMAP = 91 + SYS_TRUNCATE = 92 + SYS_FTRUNCATE = 93 + SYS_FCHMOD = 94 + SYS_FCHOWN = 95 + SYS_GETPRIORITY = 96 + SYS_SETPRIORITY = 97 + SYS_PROFIL = 98 + SYS_STATFS = 99 + SYS_FSTATFS = 100 + SYS_IOPERM = 101 + SYS_SOCKETCALL = 102 + SYS_SYSLOG = 103 + SYS_SETITIMER = 104 + SYS_GETITIMER = 105 + SYS_STAT = 106 + SYS_LSTAT = 107 + SYS_FSTAT = 108 + SYS_OLDUNAME = 109 + SYS_IOPL = 110 + SYS_VHANGUP = 111 + SYS_IDLE = 112 + SYS_VM86 = 113 + SYS_WAIT4 = 114 + SYS_SWAPOFF = 115 + SYS_SYSINFO = 116 + SYS_IPC = 117 + SYS_FSYNC = 118 + SYS_SIGRETURN = 119 + SYS_CLONE = 120 + SYS_SETDOMAINNAME = 121 + SYS_UNAME = 122 + SYS_MODIFY_LDT = 123 + SYS_ADJTIMEX = 124 + SYS_MPROTECT = 125 + SYS_SIGPROCMASK = 126 + SYS_CREATE_MODULE = 127 + SYS_INIT_MODULE = 128 + SYS_DELETE_MODULE = 129 + SYS_GET_KERNEL_SYMS = 130 + SYS_QUOTACTL = 131 + SYS_GETPGID = 132 + SYS_FCHDIR = 133 + SYS_BDFLUSH = 134 + SYS_SYSFS = 135 + SYS_PERSONALITY = 136 + SYS_AFS_SYSCALL = 137 + SYS_SETFSUID = 138 + SYS_SETFSGID = 139 + SYS__LLSEEK = 140 + SYS_GETDENTS = 141 + SYS__NEWSELECT = 142 + SYS_FLOCK = 143 + SYS_MSYNC = 144 + SYS_READV = 145 + SYS_WRITEV = 146 + SYS_GETSID = 147 + SYS_FDATASYNC = 148 + SYS__SYSCTL = 149 + SYS_MLOCK = 150 + SYS_MUNLOCK = 151 + SYS_MLOCKALL = 152 + SYS_MUNLOCKALL = 153 + SYS_SCHED_SETPARAM = 154 + SYS_SCHED_GETPARAM = 155 + SYS_SCHED_SETSCHEDULER = 156 + SYS_SCHED_GETSCHEDULER = 157 + SYS_SCHED_YIELD = 158 + SYS_SCHED_GET_PRIORITY_MAX = 159 + SYS_SCHED_GET_PRIORITY_MIN = 160 + SYS_SCHED_RR_GET_INTERVAL = 161 + SYS_NANOSLEEP = 162 + SYS_MREMAP = 163 + SYS_SETRESUID = 164 + SYS_GETRESUID = 165 + SYS_QUERY_MODULE = 166 + SYS_POLL = 167 + SYS_NFSSERVCTL = 168 + SYS_SETRESGID = 169 + SYS_GETRESGID = 170 + SYS_PRCTL = 171 + SYS_RT_SIGRETURN = 172 + SYS_RT_SIGACTION = 173 + SYS_RT_SIGPROCMASK = 174 + SYS_RT_SIGPENDING = 175 + SYS_RT_SIGTIMEDWAIT = 176 + SYS_RT_SIGQUEUEINFO = 177 + SYS_RT_SIGSUSPEND = 178 + SYS_PREAD64 = 179 + SYS_PWRITE64 = 180 + SYS_CHOWN = 181 + SYS_GETCWD = 182 + SYS_CAPGET = 183 + SYS_CAPSET = 184 + SYS_SIGALTSTACK = 185 + SYS_SENDFILE = 186 + SYS_GETPMSG = 187 + SYS_PUTPMSG = 188 + SYS_VFORK = 189 + SYS_UGETRLIMIT = 190 + SYS_READAHEAD = 191 + SYS_MMAP2 = 192 + SYS_TRUNCATE64 = 193 + SYS_FTRUNCATE64 = 194 + SYS_STAT64 = 195 + SYS_LSTAT64 = 196 + SYS_FSTAT64 = 197 + SYS_PCICONFIG_READ = 198 + SYS_PCICONFIG_WRITE = 199 + SYS_PCICONFIG_IOBASE = 200 + SYS_MULTIPLEXER = 201 + SYS_GETDENTS64 = 202 + SYS_PIVOT_ROOT = 203 + SYS_FCNTL64 = 204 + SYS_MADVISE = 205 + SYS_MINCORE = 206 + SYS_GETTID = 207 + SYS_TKILL = 208 + SYS_SETXATTR = 209 + SYS_LSETXATTR = 210 + SYS_FSETXATTR = 211 + SYS_GETXATTR = 212 + SYS_LGETXATTR = 213 + SYS_FGETXATTR = 214 + SYS_LISTXATTR = 215 + SYS_LLISTXATTR = 216 + SYS_FLISTXATTR = 217 + SYS_REMOVEXATTR = 218 + SYS_LREMOVEXATTR = 219 + SYS_FREMOVEXATTR = 220 + SYS_FUTEX = 221 + SYS_SCHED_SETAFFINITY = 222 + SYS_SCHED_GETAFFINITY = 223 + SYS_TUXCALL = 225 + SYS_SENDFILE64 = 226 + SYS_IO_SETUP = 227 + SYS_IO_DESTROY = 228 + SYS_IO_GETEVENTS = 229 + SYS_IO_SUBMIT = 230 + SYS_IO_CANCEL = 231 + SYS_SET_TID_ADDRESS = 232 + SYS_FADVISE64 = 233 + SYS_EXIT_GROUP = 234 + SYS_LOOKUP_DCOOKIE = 235 + SYS_EPOLL_CREATE = 236 + SYS_EPOLL_CTL = 237 + SYS_EPOLL_WAIT = 238 + SYS_REMAP_FILE_PAGES = 239 + SYS_TIMER_CREATE = 240 + SYS_TIMER_SETTIME = 241 + SYS_TIMER_GETTIME = 242 + SYS_TIMER_GETOVERRUN = 243 + SYS_TIMER_DELETE = 244 + SYS_CLOCK_SETTIME = 245 + SYS_CLOCK_GETTIME = 246 + SYS_CLOCK_GETRES = 247 + SYS_CLOCK_NANOSLEEP = 248 + SYS_SWAPCONTEXT = 249 + SYS_TGKILL = 250 + SYS_UTIMES = 251 + SYS_STATFS64 = 252 + SYS_FSTATFS64 = 253 + SYS_FADVISE64_64 = 254 + SYS_RTAS = 255 + SYS_SYS_DEBUG_SETCONTEXT = 256 + SYS_MIGRATE_PAGES = 258 + SYS_MBIND = 259 + SYS_GET_MEMPOLICY = 260 + SYS_SET_MEMPOLICY = 261 + SYS_MQ_OPEN = 262 + SYS_MQ_UNLINK = 263 + SYS_MQ_TIMEDSEND = 264 + SYS_MQ_TIMEDRECEIVE = 265 + SYS_MQ_NOTIFY = 266 + SYS_MQ_GETSETATTR = 267 + SYS_KEXEC_LOAD = 268 + SYS_ADD_KEY = 269 + SYS_REQUEST_KEY = 270 + SYS_KEYCTL = 271 + SYS_WAITID = 272 + SYS_IOPRIO_SET = 273 + SYS_IOPRIO_GET = 274 + SYS_INOTIFY_INIT = 275 + SYS_INOTIFY_ADD_WATCH = 276 + SYS_INOTIFY_RM_WATCH = 277 + SYS_SPU_RUN = 278 + SYS_SPU_CREATE = 279 + SYS_PSELECT6 = 280 + SYS_PPOLL = 281 + SYS_UNSHARE = 282 + SYS_SPLICE = 283 + SYS_TEE = 284 + SYS_VMSPLICE = 285 + SYS_OPENAT = 286 + SYS_MKDIRAT = 287 + SYS_MKNODAT = 288 + SYS_FCHOWNAT = 289 + SYS_FUTIMESAT = 290 + SYS_FSTATAT64 = 291 + SYS_UNLINKAT = 292 + SYS_RENAMEAT = 293 + SYS_LINKAT = 294 + SYS_SYMLINKAT = 295 + SYS_READLINKAT = 296 + SYS_FCHMODAT = 297 + SYS_FACCESSAT = 298 + SYS_GET_ROBUST_LIST = 299 + SYS_SET_ROBUST_LIST = 300 + SYS_MOVE_PAGES = 301 + SYS_GETCPU = 302 + SYS_EPOLL_PWAIT = 303 + SYS_UTIMENSAT = 304 + SYS_SIGNALFD = 305 + SYS_TIMERFD_CREATE = 306 + SYS_EVENTFD = 307 + SYS_SYNC_FILE_RANGE2 = 308 + SYS_FALLOCATE = 309 + SYS_SUBPAGE_PROT = 310 + SYS_TIMERFD_SETTIME = 311 + SYS_TIMERFD_GETTIME = 312 + SYS_SIGNALFD4 = 313 + SYS_EVENTFD2 = 314 + SYS_EPOLL_CREATE1 = 315 + SYS_DUP3 = 316 + SYS_PIPE2 = 317 + SYS_INOTIFY_INIT1 = 318 + SYS_PERF_EVENT_OPEN = 319 + SYS_PREADV = 320 + SYS_PWRITEV = 321 + SYS_RT_TGSIGQUEUEINFO = 322 + SYS_FANOTIFY_INIT = 323 + SYS_FANOTIFY_MARK = 324 + SYS_PRLIMIT64 = 325 + SYS_SOCKET = 326 + SYS_BIND = 327 + SYS_CONNECT = 328 + SYS_LISTEN = 329 + SYS_ACCEPT = 330 + SYS_GETSOCKNAME = 331 + SYS_GETPEERNAME = 332 + SYS_SOCKETPAIR = 333 + SYS_SEND = 334 + SYS_SENDTO = 335 + SYS_RECV = 336 + SYS_RECVFROM = 337 + SYS_SHUTDOWN = 338 + SYS_SETSOCKOPT = 339 + SYS_GETSOCKOPT = 340 + SYS_SENDMSG = 341 + SYS_RECVMSG = 342 + SYS_RECVMMSG = 343 + SYS_ACCEPT4 = 344 + SYS_NAME_TO_HANDLE_AT = 345 + SYS_OPEN_BY_HANDLE_AT = 346 + SYS_CLOCK_ADJTIME = 347 + SYS_SYNCFS = 348 + SYS_SENDMMSG = 349 + SYS_SETNS = 350 + SYS_PROCESS_VM_READV = 351 + SYS_PROCESS_VM_WRITEV = 352 + SYS_FINIT_MODULE = 353 + SYS_KCMP = 354 + SYS_SCHED_SETATTR = 355 + SYS_SCHED_GETATTR = 356 + SYS_RENAMEAT2 = 357 + SYS_SECCOMP = 358 + SYS_GETRANDOM = 359 + SYS_MEMFD_CREATE = 360 + SYS_BPF = 361 + SYS_EXECVEAT = 362 + SYS_SWITCH_ENDIAN = 363 + SYS_USERFAULTFD = 364 + SYS_MEMBARRIER = 365 + SYS_MLOCK2 = 378 + SYS_COPY_FILE_RANGE = 379 + SYS_PREADV2 = 380 + SYS_PWRITEV2 = 381 + SYS_KEXEC_FILE_LOAD = 382 + SYS_STATX = 383 + SYS_PKEY_ALLOC = 384 + SYS_PKEY_FREE = 385 + SYS_PKEY_MPROTECT = 386 + SYS_RSEQ = 387 + SYS_IO_PGETEVENTS = 388 + SYS_SEMGET = 393 + SYS_SEMCTL = 394 + SYS_SHMGET = 395 + SYS_SHMCTL = 396 + SYS_SHMAT = 397 + SYS_SHMDT = 398 + SYS_MSGGET = 399 + SYS_MSGSND = 400 + SYS_MSGRCV = 401 + SYS_MSGCTL = 402 + SYS_CLOCK_GETTIME64 = 403 + SYS_CLOCK_SETTIME64 = 404 + SYS_CLOCK_ADJTIME64 = 405 + SYS_CLOCK_GETRES_TIME64 = 406 + SYS_CLOCK_NANOSLEEP_TIME64 = 407 + SYS_TIMER_GETTIME64 = 408 + SYS_TIMER_SETTIME64 = 409 + SYS_TIMERFD_GETTIME64 = 410 + SYS_TIMERFD_SETTIME64 = 411 + SYS_UTIMENSAT_TIME64 = 412 + SYS_PSELECT6_TIME64 = 413 + SYS_PPOLL_TIME64 = 414 + SYS_IO_PGETEVENTS_TIME64 = 416 + SYS_RECVMMSG_TIME64 = 417 + SYS_MQ_TIMEDSEND_TIME64 = 418 + SYS_MQ_TIMEDRECEIVE_TIME64 = 419 + SYS_SEMTIMEDOP_TIME64 = 420 + SYS_RT_SIGTIMEDWAIT_TIME64 = 421 + SYS_FUTEX_TIME64 = 422 + SYS_SCHED_RR_GET_INTERVAL_TIME64 = 423 + SYS_PIDFD_SEND_SIGNAL = 424 + SYS_IO_URING_SETUP = 425 + SYS_IO_URING_ENTER = 426 + SYS_IO_URING_REGISTER = 427 + SYS_OPEN_TREE = 428 + SYS_MOVE_MOUNT = 429 + SYS_FSOPEN = 430 + SYS_FSCONFIG = 431 + SYS_FSMOUNT = 432 + SYS_FSPICK = 433 + SYS_PIDFD_OPEN = 434 + SYS_CLONE3 = 435 + SYS_CLOSE_RANGE = 436 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 + SYS_FACCESSAT2 = 439 + SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 +) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index d5ed3ff5100e..08edc54d35de 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -402,4 +402,5 @@ const ( SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index e29b4424c245..33b33b08342d 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -402,4 +402,5 @@ const ( SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 41deed6c3a57..66c8a8e09e1a 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -304,4 +304,5 @@ const ( SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 8e53a9e8ceb6..aea5760cea26 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -367,4 +367,5 @@ const ( SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 596e5bc7d357..488ca848d176 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -381,4 +381,5 @@ const ( SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go index 54db43335554..883b64a27236 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go @@ -221,6 +221,12 @@ type IPMreq struct { Interface [4]byte /* in_addr */ } +type IPMreqn struct { + Multiaddr [4]byte /* in_addr */ + Address [4]byte /* in_addr */ + Ifindex int32 +} + type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 @@ -272,6 +278,7 @@ const ( SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 + SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go index eb73e52fb68c..2673e6c5909c 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go @@ -233,6 +233,12 @@ type IPMreq struct { Interface [4]byte /* in_addr */ } +type IPMreqn struct { + Multiaddr [4]byte /* in_addr */ + Address [4]byte /* in_addr */ + Ifindex int32 +} + type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 @@ -285,6 +291,7 @@ const ( SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 + SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go index 8606d654e568..eef513385744 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go @@ -221,6 +221,12 @@ type IPMreq struct { Interface [4]byte /* in_addr */ } +type IPMreqn struct { + Multiaddr [4]byte /* in_addr */ + Address [4]byte /* in_addr */ + Ifindex int32 +} + type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 @@ -272,6 +278,7 @@ const ( SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 + SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go index dcb51f8404d6..1465cbcffe47 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go @@ -233,6 +233,12 @@ type IPMreq struct { Interface [4]byte /* in_addr */ } +type IPMreqn struct { + Multiaddr [4]byte /* in_addr */ + Address [4]byte /* in_addr */ + Ifindex int32 +} + type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 @@ -285,6 +291,7 @@ const ( SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 + SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go new file mode 100644 index 000000000000..236f37ef6f7e --- /dev/null +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go @@ -0,0 +1,40 @@ +// cgo -godefs types_illumos.go | go run mkpost.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build amd64 && illumos +// +build amd64,illumos + +package unix + +const ( + TUNNEWPPA = 0x540001 + TUNSETPPA = 0x540002 + + I_STR = 0x5308 + I_POP = 0x5303 + I_PUSH = 0x5302 + I_PLINK = 0x5316 + I_PUNLINK = 0x5317 + + IF_UNITSEL = -0x7ffb8cca +) + +type strbuf struct { + Maxlen int32 + Len int32 + Buf *int8 +} + +type Strioctl struct { + Cmd int32 + Timout int32 + Len int32 + Dp *int8 +} + +type Lifreq struct { + Name [32]int8 + Lifru1 [4]byte + Type uint32 + Lifru [336]byte +} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_linux.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_linux.go index d3a18713bb94..087323591e61 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -1016,7 +1016,10 @@ const ( PERF_SAMPLE_PHYS_ADDR = 0x80000 PERF_SAMPLE_AUX = 0x100000 PERF_SAMPLE_CGROUP = 0x200000 - PERF_SAMPLE_MAX = 0x1000000 + PERF_SAMPLE_DATA_PAGE_SIZE = 0x400000 + PERF_SAMPLE_CODE_PAGE_SIZE = 0x800000 + PERF_SAMPLE_WEIGHT_STRUCT = 0x1000000 + PERF_SAMPLE_MAX = 0x2000000 PERF_SAMPLE_BRANCH_USER_SHIFT = 0x0 PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 0x1 PERF_SAMPLE_BRANCH_HV_SHIFT = 0x2 @@ -3126,7 +3129,8 @@ const ( DEVLINK_ATTR_REMOTE_RELOAD_STATS = 0xa1 DEVLINK_ATTR_RELOAD_ACTION_INFO = 0xa2 DEVLINK_ATTR_RELOAD_ACTION_STATS = 0xa3 - DEVLINK_ATTR_MAX = 0xa3 + DEVLINK_ATTR_PORT_PCI_SF_NUMBER = 0xa4 + DEVLINK_ATTR_MAX = 0xa4 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 @@ -3140,7 +3144,9 @@ const ( DEVLINK_RESOURCE_UNIT_ENTRY = 0x0 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC = 0x0 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR = 0x1 - DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x1 + DEVLINK_PORT_FN_ATTR_STATE = 0x2 + DEVLINK_PORT_FN_ATTR_OPSTATE = 0x3 + DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x3 ) type FsverityDigest struct { @@ -3509,7 +3515,8 @@ const ( ETHTOOL_A_LINKMODES_DUPLEX = 0x6 ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG = 0x7 ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE = 0x8 - ETHTOOL_A_LINKMODES_MAX = 0x8 + ETHTOOL_A_LINKMODES_LANES = 0x9 + ETHTOOL_A_LINKMODES_MAX = 0x9 ETHTOOL_A_LINKSTATE_UNSPEC = 0x0 ETHTOOL_A_LINKSTATE_HEADER = 0x1 ETHTOOL_A_LINKSTATE_LINK = 0x2 @@ -3698,6 +3705,21 @@ const ( ETHTOOL_A_TUNNEL_INFO_MAX = 0x2 ) +type EthtoolDrvinfo struct { + Cmd uint32 + Driver [32]byte + Version [32]byte + Fw_version [32]byte + Bus_info [32]byte + Erom_version [32]byte + Reserved2 [12]byte + N_priv_flags uint32 + N_stats uint32 + Testinfo_len uint32 + Eedump_len uint32 + Regdump_len uint32 +} + type ( HIDRawReportDescriptor struct { Size uint32 @@ -3709,3 +3731,14 @@ type ( Product int16 } ) + +const ( + CLOSE_RANGE_UNSHARE = 0x2 + CLOSE_RANGE_CLOEXEC = 0x4 +) + +const ( + NLMSGERR_ATTR_MSG = 0x1 + NLMSGERR_ATTR_OFFS = 0x2 + NLMSGERR_ATTR_COOKIE = 0x3 +) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go new file mode 100644 index 000000000000..af7a72017e9f --- /dev/null +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -0,0 +1,627 @@ +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build ppc && linux +// +build ppc,linux + +package unix + +const ( + SizeofPtr = 0x4 + SizeofLong = 0x4 +) + +type ( + _C_long int32 +) + +type Timespec struct { + Sec int32 + Nsec int32 +} + +type Timeval struct { + Sec int32 + Usec int32 +} + +type Timex struct { + Modes uint32 + Offset int32 + Freq int32 + Maxerror int32 + Esterror int32 + Status int32 + Constant int32 + Precision int32 + Tolerance int32 + Time Timeval + Tick int32 + Ppsfreq int32 + Jitter int32 + Shift int32 + Stabil int32 + Jitcnt int32 + Calcnt int32 + Errcnt int32 + Stbcnt int32 + Tai int32 + _ [44]byte +} + +type Time_t int32 + +type Tms struct { + Utime int32 + Stime int32 + Cutime int32 + Cstime int32 +} + +type Utimbuf struct { + Actime int32 + Modtime int32 +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int32 + Ixrss int32 + Idrss int32 + Isrss int32 + Minflt int32 + Majflt int32 + Nswap int32 + Inblock int32 + Oublock int32 + Msgsnd int32 + Msgrcv int32 + Nsignals int32 + Nvcsw int32 + Nivcsw int32 +} + +type Stat_t struct { + Dev uint64 + Ino uint64 + Mode uint32 + Nlink uint32 + Uid uint32 + Gid uint32 + Rdev uint64 + _ uint16 + _ [4]byte + Size int64 + Blksize int32 + _ [4]byte + Blocks int64 + Atim Timespec + Mtim Timespec + Ctim Timespec + _ uint32 + _ uint32 +} + +type Dirent struct { + Ino uint64 + Off int64 + Reclen uint16 + Type uint8 + Name [256]uint8 + _ [5]byte +} + +type Flock_t struct { + Type int16 + Whence int16 + _ [4]byte + Start int64 + Len int64 + Pid int32 + _ [4]byte +} + +type DmNameList struct { + Dev uint64 + Next uint32 + Name [0]byte + _ [4]byte +} + +const ( + FADV_DONTNEED = 0x4 + FADV_NOREUSE = 0x5 +) + +type RawSockaddr struct { + Family uint16 + Data [14]uint8 +} + +type RawSockaddrAny struct { + Addr RawSockaddr + Pad [96]uint8 +} + +type Iovec struct { + Base *byte + Len uint32 +} + +type Msghdr struct { + Name *byte + Namelen uint32 + Iov *Iovec + Iovlen uint32 + Control *byte + Controllen uint32 + Flags int32 +} + +type Cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + SizeofIovec = 0x8 + SizeofMsghdr = 0x1c + SizeofCmsghdr = 0xc +) + +const ( + SizeofSockFprog = 0x8 +) + +type PtraceRegs struct { + Gpr [32]uint32 + Nip uint32 + Msr uint32 + Orig_gpr3 uint32 + Ctr uint32 + Link uint32 + Xer uint32 + Ccr uint32 + Mq uint32 + Trap uint32 + Dar uint32 + Dsisr uint32 + Result uint32 +} + +type FdSet struct { + Bits [32]int32 +} + +type Sysinfo_t struct { + Uptime int32 + Loads [3]uint32 + Totalram uint32 + Freeram uint32 + Sharedram uint32 + Bufferram uint32 + Totalswap uint32 + Freeswap uint32 + Procs uint16 + Pad uint16 + Totalhigh uint32 + Freehigh uint32 + Unit uint32 + _ [8]uint8 +} + +type Ustat_t struct { + Tfree int32 + Tinode uint32 + Fname [6]uint8 + Fpack [6]uint8 +} + +type EpollEvent struct { + Events uint32 + _ int32 + Fd int32 + Pad int32 +} + +const ( + POLLRDHUP = 0x2000 +) + +type Sigset_t struct { + Val [32]uint32 +} + +const _C__NSIG = 0x41 + +type Termios struct { + Iflag uint32 + Oflag uint32 + Cflag uint32 + Lflag uint32 + Cc [19]uint8 + Line uint8 + Ispeed uint32 + Ospeed uint32 +} + +type Taskstats struct { + Version uint16 + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + _ [4]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]uint8 + Ac_sched uint8 + Ac_pad [3]uint8 + _ [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + _ [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 + Ac_btime64 uint64 +} + +type cpuMask uint32 + +const ( + _NCPUBITS = 0x20 +) + +const ( + CBitFieldMaskBit0 = 0x8000000000000000 + CBitFieldMaskBit1 = 0x4000000000000000 + CBitFieldMaskBit2 = 0x2000000000000000 + CBitFieldMaskBit3 = 0x1000000000000000 + CBitFieldMaskBit4 = 0x800000000000000 + CBitFieldMaskBit5 = 0x400000000000000 + CBitFieldMaskBit6 = 0x200000000000000 + CBitFieldMaskBit7 = 0x100000000000000 + CBitFieldMaskBit8 = 0x80000000000000 + CBitFieldMaskBit9 = 0x40000000000000 + CBitFieldMaskBit10 = 0x20000000000000 + CBitFieldMaskBit11 = 0x10000000000000 + CBitFieldMaskBit12 = 0x8000000000000 + CBitFieldMaskBit13 = 0x4000000000000 + CBitFieldMaskBit14 = 0x2000000000000 + CBitFieldMaskBit15 = 0x1000000000000 + CBitFieldMaskBit16 = 0x800000000000 + CBitFieldMaskBit17 = 0x400000000000 + CBitFieldMaskBit18 = 0x200000000000 + CBitFieldMaskBit19 = 0x100000000000 + CBitFieldMaskBit20 = 0x80000000000 + CBitFieldMaskBit21 = 0x40000000000 + CBitFieldMaskBit22 = 0x20000000000 + CBitFieldMaskBit23 = 0x10000000000 + CBitFieldMaskBit24 = 0x8000000000 + CBitFieldMaskBit25 = 0x4000000000 + CBitFieldMaskBit26 = 0x2000000000 + CBitFieldMaskBit27 = 0x1000000000 + CBitFieldMaskBit28 = 0x800000000 + CBitFieldMaskBit29 = 0x400000000 + CBitFieldMaskBit30 = 0x200000000 + CBitFieldMaskBit31 = 0x100000000 + CBitFieldMaskBit32 = 0x80000000 + CBitFieldMaskBit33 = 0x40000000 + CBitFieldMaskBit34 = 0x20000000 + CBitFieldMaskBit35 = 0x10000000 + CBitFieldMaskBit36 = 0x8000000 + CBitFieldMaskBit37 = 0x4000000 + CBitFieldMaskBit38 = 0x2000000 + CBitFieldMaskBit39 = 0x1000000 + CBitFieldMaskBit40 = 0x800000 + CBitFieldMaskBit41 = 0x400000 + CBitFieldMaskBit42 = 0x200000 + CBitFieldMaskBit43 = 0x100000 + CBitFieldMaskBit44 = 0x80000 + CBitFieldMaskBit45 = 0x40000 + CBitFieldMaskBit46 = 0x20000 + CBitFieldMaskBit47 = 0x10000 + CBitFieldMaskBit48 = 0x8000 + CBitFieldMaskBit49 = 0x4000 + CBitFieldMaskBit50 = 0x2000 + CBitFieldMaskBit51 = 0x1000 + CBitFieldMaskBit52 = 0x800 + CBitFieldMaskBit53 = 0x400 + CBitFieldMaskBit54 = 0x200 + CBitFieldMaskBit55 = 0x100 + CBitFieldMaskBit56 = 0x80 + CBitFieldMaskBit57 = 0x40 + CBitFieldMaskBit58 = 0x20 + CBitFieldMaskBit59 = 0x10 + CBitFieldMaskBit60 = 0x8 + CBitFieldMaskBit61 = 0x4 + CBitFieldMaskBit62 = 0x2 + CBitFieldMaskBit63 = 0x1 +) + +type SockaddrStorage struct { + Family uint16 + _ [122]uint8 + _ uint32 +} + +type HDGeometry struct { + Heads uint8 + Sectors uint8 + Cylinders uint16 + Start uint32 +} + +type Statfs_t struct { + Type int32 + Bsize int32 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Files uint64 + Ffree uint64 + Fsid Fsid + Namelen int32 + Frsize int32 + Flags int32 + Spare [4]int32 + _ [4]byte +} + +type TpacketHdr struct { + Status uint32 + Len uint32 + Snaplen uint32 + Mac uint16 + Net uint16 + Sec uint32 + Usec uint32 +} + +const ( + SizeofTpacketHdr = 0x18 +) + +type RTCPLLInfo struct { + Ctrl int32 + Value int32 + Max int32 + Min int32 + Posmult int32 + Negmult int32 + Clock int32 +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x20001269 +) + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + +type CryptoUserAlg struct { + Name [64]uint8 + Driver_name [64]uint8 + Module_name [64]uint8 + Type uint32 + Mask uint32 + Refcnt uint32 + Flags uint32 +} + +type CryptoStatAEAD struct { + Type [64]uint8 + Encrypt_cnt uint64 + Encrypt_tlen uint64 + Decrypt_cnt uint64 + Decrypt_tlen uint64 + Err_cnt uint64 +} + +type CryptoStatAKCipher struct { + Type [64]uint8 + Encrypt_cnt uint64 + Encrypt_tlen uint64 + Decrypt_cnt uint64 + Decrypt_tlen uint64 + Verify_cnt uint64 + Sign_cnt uint64 + Err_cnt uint64 +} + +type CryptoStatCipher struct { + Type [64]uint8 + Encrypt_cnt uint64 + Encrypt_tlen uint64 + Decrypt_cnt uint64 + Decrypt_tlen uint64 + Err_cnt uint64 +} + +type CryptoStatCompress struct { + Type [64]uint8 + Compress_cnt uint64 + Compress_tlen uint64 + Decompress_cnt uint64 + Decompress_tlen uint64 + Err_cnt uint64 +} + +type CryptoStatHash struct { + Type [64]uint8 + Hash_cnt uint64 + Hash_tlen uint64 + Err_cnt uint64 +} + +type CryptoStatKPP struct { + Type [64]uint8 + Setsecret_cnt uint64 + Generate_public_key_cnt uint64 + Compute_shared_secret_cnt uint64 + Err_cnt uint64 +} + +type CryptoStatRNG struct { + Type [64]uint8 + Generate_cnt uint64 + Generate_tlen uint64 + Seed_cnt uint64 + Err_cnt uint64 +} + +type CryptoStatLarval struct { + Type [64]uint8 +} + +type CryptoReportLarval struct { + Type [64]uint8 +} + +type CryptoReportHash struct { + Type [64]uint8 + Blocksize uint32 + Digestsize uint32 +} + +type CryptoReportCipher struct { + Type [64]uint8 + Blocksize uint32 + Min_keysize uint32 + Max_keysize uint32 +} + +type CryptoReportBlkCipher struct { + Type [64]uint8 + Geniv [64]uint8 + Blocksize uint32 + Min_keysize uint32 + Max_keysize uint32 + Ivsize uint32 +} + +type CryptoReportAEAD struct { + Type [64]uint8 + Geniv [64]uint8 + Blocksize uint32 + Maxauthsize uint32 + Ivsize uint32 +} + +type CryptoReportComp struct { + Type [64]uint8 +} + +type CryptoReportRNG struct { + Type [64]uint8 + Seedsize uint32 +} + +type CryptoReportAKCipher struct { + Type [64]uint8 +} + +type CryptoReportKPP struct { + Type [64]uint8 +} + +type CryptoReportAcomp struct { + Type [64]uint8 +} + +type LoopInfo struct { + Number int32 + Device uint32 + Inode uint32 + Rdevice uint32 + Offset int32 + Encrypt_type int32 + Encrypt_key_size int32 + Flags int32 + Name [64]uint8 + Encrypt_key [32]uint8 + Init [2]uint32 + Reserved [4]uint8 +} + +type TIPCSubscr struct { + Seq TIPCServiceRange + Timeout uint32 + Filter uint32 + Handle [8]uint8 +} + +type TIPCSIOCLNReq struct { + Peer uint32 + Id uint32 + Linkname [68]uint8 +} + +type TIPCSIOCNodeIDReq struct { + Peer uint32 + Id [16]uint8 +} + +type PPSKInfo struct { + Assert_sequence uint32 + Clear_sequence uint32 + Assert_tu PPSKTime + Clear_tu PPSKTime + Current_mode int32 + _ [4]byte +} + +const ( + PPS_GETPARAMS = 0x400470a1 + PPS_SETPARAMS = 0x800470a2 + PPS_GETCAP = 0x400470a3 + PPS_FETCH = 0xc00470a4 +) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/exec_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/exec_windows.go index 3606c3a8b369..9eb1fb633a46 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/exec_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/exec_windows.go @@ -6,6 +6,11 @@ package windows +import ( + errorspkg "errors" + "unsafe" +) + // EscapeArg rewrites command line argument s as prescribed // in http://msdn.microsoft.com/en-us/library/ms880421. // This function returns "" (2 double quotes) if s is empty. @@ -95,3 +100,33 @@ func FullPath(name string) (path string, err error) { } } } + +// NewProcThreadAttributeList allocates a new ProcThreadAttributeList, with the requested maximum number of attributes. +func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeList, error) { + var size uintptr + err := initializeProcThreadAttributeList(nil, maxAttrCount, 0, &size) + if err != ERROR_INSUFFICIENT_BUFFER { + if err == nil { + return nil, errorspkg.New("unable to query buffer size from InitializeProcThreadAttributeList") + } + return nil, err + } + const psize = unsafe.Sizeof(uintptr(0)) + // size is guaranteed to be ≥1 by InitializeProcThreadAttributeList. + al := (*ProcThreadAttributeList)(unsafe.Pointer(&make([]unsafe.Pointer, (size+psize-1)/psize)[0])) + err = initializeProcThreadAttributeList(al, maxAttrCount, 0, &size) + if err != nil { + return nil, err + } + return al, err +} + +// Update modifies the ProcThreadAttributeList using UpdateProcThreadAttribute. +func (al *ProcThreadAttributeList) Update(attribute uintptr, flags uint32, value unsafe.Pointer, size uintptr, prevValue unsafe.Pointer, returnedSize *uintptr) error { + return updateProcThreadAttribute(al, flags, attribute, value, size, prevValue, returnedSize) +} + +// Delete frees ProcThreadAttributeList's resources. +func (al *ProcThreadAttributeList) Delete() { + deleteProcThreadAttributeList(al) +} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/mkerrors.bash b/cluster-autoscaler/vendor/golang.org/x/sys/windows/mkerrors.bash index 2163843a11df..58e0188fb71f 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/mkerrors.bash +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/mkerrors.bash @@ -9,6 +9,8 @@ shopt -s nullglob winerror="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/winerror.h | sort -Vr | head -n 1)" [[ -n $winerror ]] || { echo "Unable to find winerror.h" >&2; exit 1; } +ntstatus="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/ntstatus.h | sort -Vr | head -n 1)" +[[ -n $ntstatus ]] || { echo "Unable to find ntstatus.h" >&2; exit 1; } declare -A errors @@ -59,5 +61,10 @@ declare -A errors echo "$key $vtype = $value" done < "$winerror" + while read -r line; do + [[ $line =~ ^#define\ (STATUS_[^\s]+)\ +\(\(NTSTATUS\)((0x)?[0-9a-fA-F]+)L?\) ]] || continue + echo "${BASH_REMATCH[1]} NTStatus = ${BASH_REMATCH[2]}" + done < "$ntstatus" + echo ")" } | gofmt > "zerrors_windows.go" diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/security_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/security_windows.go index 69eb462c59a8..111c10d3a7f6 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/security_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/security_windows.go @@ -908,6 +908,19 @@ type SECURITY_DESCRIPTOR struct { dacl *ACL } +type SECURITY_QUALITY_OF_SERVICE struct { + Length uint32 + ImpersonationLevel uint32 + ContextTrackingMode byte + EffectiveOnly byte +} + +// Constants for the ContextTrackingMode field of SECURITY_QUALITY_OF_SERVICE. +const ( + SECURITY_STATIC_TRACKING = 0 + SECURITY_DYNAMIC_TRACKING = 1 +) + type SecurityAttributes struct { Length uint32 SecurityDescriptor *SECURITY_DESCRIPTOR @@ -1321,7 +1334,11 @@ func (absoluteSD *SECURITY_DESCRIPTOR) ToSelfRelative() (selfRelativeSD *SECURIT } func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() *SECURITY_DESCRIPTOR { - sdLen := (int)(selfRelativeSD.Length()) + sdLen := int(selfRelativeSD.Length()) + const min = int(unsafe.Sizeof(SECURITY_DESCRIPTOR{})) + if sdLen < min { + sdLen = min + } var src []byte h := (*unsafeheader.Slice)(unsafe.Pointer(&src)) @@ -1329,7 +1346,15 @@ func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() h.Len = sdLen h.Cap = sdLen - dst := make([]byte, sdLen) + const psize = int(unsafe.Sizeof(uintptr(0))) + + var dst []byte + h = (*unsafeheader.Slice)(unsafe.Pointer(&dst)) + alloc := make([]uintptr, (sdLen+psize-1)/psize) + h.Data = (*unsafeheader.Slice)(unsafe.Pointer(&alloc)).Data + h.Len = sdLen + h.Cap = sdLen + copy(dst, src) return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&dst[0])) } diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/svc/security.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/svc/security.go index da6df1d3c00c..ef719c1759f2 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/svc/security.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/svc/security.go @@ -7,8 +7,8 @@ package svc import ( - "errors" - "syscall" + "path/filepath" + "strings" "unsafe" "golang.org/x/sys/windows" @@ -64,94 +64,45 @@ func IsAnInteractiveSession() (bool, error) { return false, nil } -var ( - ntdll = windows.NewLazySystemDLL("ntdll.dll") - _NtQueryInformationProcess = ntdll.NewProc("NtQueryInformationProcess") - - kernel32 = windows.NewLazySystemDLL("kernel32.dll") - _QueryFullProcessImageNameA = kernel32.NewProc("QueryFullProcessImageNameA") -) - // IsWindowsService reports whether the process is currently executing // as a Windows service. func IsWindowsService() (bool, error) { - // This code was copied from runtime.isWindowsService function. - // The below technique looks a bit hairy, but it's actually // exactly what the .NET framework does for the similarly named function: // https://github.com/dotnet/extensions/blob/f4066026ca06984b07e90e61a6390ac38152ba93/src/Hosting/WindowsServices/src/WindowsServiceHelpers.cs#L26-L31 // Specifically, it looks up whether the parent process has session ID zero // and is called "services". - const _CURRENT_PROCESS = ^uintptr(0) - // pbi is a PROCESS_BASIC_INFORMATION struct, where we just care about - // the 6th pointer inside of it, which contains the pid of the process - // parent: - // https://github.com/wine-mirror/wine/blob/42cb7d2ad1caba08de235e6319b9967296b5d554/include/winternl.h#L1294 - var pbi [6]uintptr - var pbiLen uint32 - r0, _, _ := syscall.Syscall6(_NtQueryInformationProcess.Addr(), 5, _CURRENT_PROCESS, 0, uintptr(unsafe.Pointer(&pbi[0])), uintptr(unsafe.Sizeof(pbi)), uintptr(unsafe.Pointer(&pbiLen)), 0) - if r0 != 0 { - return false, errors.New("NtQueryInformationProcess failed: error=" + itoa(int(r0))) - } - var psid uint32 - err := windows.ProcessIdToSessionId(uint32(pbi[5]), &psid) + + var pbi windows.PROCESS_BASIC_INFORMATION + pbiLen := uint32(unsafe.Sizeof(pbi)) + err := windows.NtQueryInformationProcess(windows.CurrentProcess(), windows.ProcessBasicInformation, unsafe.Pointer(&pbi), pbiLen, &pbiLen) if err != nil { return false, err } - if psid != 0 { - // parent session id should be 0 for service process + var psid uint32 + err = windows.ProcessIdToSessionId(uint32(pbi.InheritedFromUniqueProcessId), &psid) + if err != nil || psid != 0 { return false, nil } - - pproc, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pbi[5])) + pproc, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pbi.InheritedFromUniqueProcessId)) if err != nil { return false, err } defer windows.CloseHandle(pproc) - - // exeName gets the path to the executable image of the parent process - var exeName [261]byte - exeNameLen := uint32(len(exeName) - 1) - r0, _, e0 := syscall.Syscall6(_QueryFullProcessImageNameA.Addr(), 4, uintptr(pproc), 0, uintptr(unsafe.Pointer(&exeName[0])), uintptr(unsafe.Pointer(&exeNameLen)), 0, 0) - if r0 == 0 { - if e0 != 0 { - return false, e0 - } else { - return false, syscall.EINVAL - } + var exeNameBuf [261]uint16 + exeNameLen := uint32(len(exeNameBuf) - 1) + err = windows.QueryFullProcessImageName(pproc, 0, &exeNameBuf[0], &exeNameLen) + if err != nil { + return false, err } - const ( - servicesLower = "services.exe" - servicesUpper = "SERVICES.EXE" - ) - i := int(exeNameLen) - 1 - j := len(servicesLower) - 1 - if i < j { + exeName := windows.UTF16ToString(exeNameBuf[:exeNameLen]) + if !strings.EqualFold(filepath.Base(exeName), "services.exe") { return false, nil } - for { - if j == -1 { - return i == -1 || exeName[i] == '\\', nil - } - if exeName[i] != servicesLower[j] && exeName[i] != servicesUpper[j] { - return false, nil - } - i-- - j-- - } -} - -func itoa(val int) string { // do it here rather than with fmt to avoid dependency - if val < 0 { - return "-" + itoa(-val) - } - var buf [32]byte // big enough for int64 - i := len(buf) - 1 - for val >= 10 { - buf[i] = byte(val%10 + '0') - i-- - val /= 10 + system32, err := windows.GetSystemDirectory() + if err != nil { + return false, err } - buf[i] = byte(val + '0') - return string(buf[i:]) + targetExeName := filepath.Join(system32, "services.exe") + return strings.EqualFold(exeName, targetExeName), nil } diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/syscall_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/syscall_windows.go index 25c6efdca2cd..bb6aaf89e47c 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -8,6 +8,8 @@ package windows import ( errorspkg "errors" + "fmt" + "runtime" "sync" "syscall" "time" @@ -65,9 +67,8 @@ const ( LOCKFILE_FAIL_IMMEDIATELY = 0x00000001 LOCKFILE_EXCLUSIVE_LOCK = 0x00000002 - // Return values of SleepEx and other APC functions - STATUS_USER_APC = 0x000000C0 - WAIT_IO_COMPLETION = STATUS_USER_APC + // Return value of SleepEx and other APC functions + WAIT_IO_COMPLETION = 0x000000C0 ) // StringToUTF16 is deprecated. Use UTF16FromString instead. @@ -180,6 +181,11 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys IsWow64Process(handle Handle, isWow64 *bool) (err error) = IsWow64Process //sys IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint16) (err error) = IsWow64Process2? //sys CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) [failretval==InvalidHandle] = CreateFileW +//sys CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) [failretval==InvalidHandle] = CreateNamedPipeW +//sys ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) +//sys GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) +//sys GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW +//sys SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) = SetNamedPipeHandleState //sys ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) //sys WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) //sys GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wait bool) (err error) @@ -214,6 +220,9 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys CancelIo(s Handle) (err error) //sys CancelIoEx(s Handle, o *Overlapped) (err error) //sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = CreateProcessW +//sys initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) = InitializeProcThreadAttributeList +//sys deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) = DeleteProcThreadAttributeList +//sys updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) = UpdateProcThreadAttribute //sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) //sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW //sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId @@ -248,13 +257,14 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys GetCommandLine() (cmd *uint16) = kernel32.GetCommandLineW //sys CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) [failretval==nil] = shell32.CommandLineToArgvW //sys LocalFree(hmem Handle) (handle Handle, err error) [failretval!=0] +//sys LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) //sys SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) //sys FlushFileBuffers(handle Handle) (err error) //sys GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) = kernel32.GetFullPathNameW //sys GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) = kernel32.GetLongPathNameW //sys GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) = kernel32.GetShortPathNameW //sys GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) = kernel32.GetFinalPathNameByHandleW -//sys CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) = kernel32.CreateFileMappingW +//sys CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateFileMappingW //sys MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) //sys UnmapViewOfFile(addr uintptr) (err error) //sys FlushViewOfFile(addr uintptr, length uintptr) (err error) @@ -315,14 +325,14 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) [failretval&0xff==0] = CreateSymbolicLinkW //sys CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) [failretval&0xff==0] = CreateHardLinkW //sys GetCurrentThreadId() (id uint32) -//sys CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) = kernel32.CreateEventW -//sys CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) = kernel32.CreateEventExW +//sys CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateEventW +//sys CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateEventExW //sys OpenEvent(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) = kernel32.OpenEventW //sys SetEvent(event Handle) (err error) = kernel32.SetEvent //sys ResetEvent(event Handle) (err error) = kernel32.ResetEvent //sys PulseEvent(event Handle) (err error) = kernel32.PulseEvent -//sys CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16) (handle Handle, err error) = kernel32.CreateMutexW -//sys CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) = kernel32.CreateMutexExW +//sys CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateMutexW +//sys CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateMutexExW //sys OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) = kernel32.OpenMutexW //sys ReleaseMutex(mutex Handle) (err error) = kernel32.ReleaseMutex //sys SleepEx(milliseconds uint32, alertable bool) (ret uint32) = kernel32.SleepEx @@ -337,10 +347,13 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) //sys GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) //sys GetProcessId(process Handle) (id uint32, err error) +//sys QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) = kernel32.QueryFullProcessImageNameW //sys OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (handle Handle, err error) //sys SetProcessPriorityBoost(process Handle, disable bool) (err error) = kernel32.SetProcessPriorityBoost //sys GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) //sys SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) +//sys GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) +//sys SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) // Volume Management Functions //sys DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) = DefineDosDeviceW @@ -370,16 +383,36 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) = ole32.StringFromGUID2 //sys coCreateGuid(pguid *GUID) (ret error) = ole32.CoCreateGuid //sys CoTaskMemFree(address unsafe.Pointer) = ole32.CoTaskMemFree -//sys rtlGetVersion(info *OsVersionInfoEx) (ret error) = ntdll.RtlGetVersion -//sys rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) = ntdll.RtlGetNtVersionNumbers +//sys CoInitializeEx(reserved uintptr, coInit uint32) (ret error) = ole32.CoInitializeEx +//sys CoUninitialize() = ole32.CoUninitialize +//sys CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) = ole32.CoGetObject //sys getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetProcessPreferredUILanguages //sys getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetThreadPreferredUILanguages //sys getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetUserPreferredUILanguages //sys getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetSystemPreferredUILanguages +//sys findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) = kernel32.FindResourceW +//sys SizeofResource(module Handle, resInfo Handle) (size uint32, err error) = kernel32.SizeofResource +//sys LoadResource(module Handle, resInfo Handle) (resData Handle, err error) = kernel32.LoadResource +//sys LockResource(resData Handle) (addr uintptr, err error) = kernel32.LockResource // Process Status API (PSAPI) //sys EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses +// NT Native APIs +//sys rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) = ntdll.RtlNtStatusToDosErrorNoTeb +//sys rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) = ntdll.RtlGetVersion +//sys rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) = ntdll.RtlGetNtVersionNumbers +//sys RtlGetCurrentPeb() (peb *PEB) = ntdll.RtlGetCurrentPeb +//sys RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16) = ntdll.RtlInitUnicodeString +//sys RtlInitString(destinationString *NTString, sourceString *byte) = ntdll.RtlInitString +//sys NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) = ntdll.NtCreateFile +//sys NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) = ntdll.NtCreateNamedPipeFile +//sys RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToNtPathName_U_WithStatus +//sys RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToRelativeNtPathName_U_WithStatus +//sys RtlDefaultNpAcl(acl **ACL) (ntstatus error) = ntdll.RtlDefaultNpAcl +//sys NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) = ntdll.NtQueryInformationProcess +//sys NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) = ntdll.NtSetInformationProcess + // syscall interface implementation for other packages // GetCurrentProcess returns the handle for the current process. @@ -787,6 +820,7 @@ const socket_error = uintptr(^uint32(0)) //sys GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) = iphlpapi.GetAdaptersInfo //sys SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) = kernel32.SetFileCompletionNotificationModes //sys WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) [failretval==-1] = ws2_32.WSAEnumProtocolsW +//sys WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult //sys GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) = iphlpapi.GetAdaptersAddresses //sys GetACP() (acp uint32) = kernel32.GetACP //sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar @@ -1509,3 +1543,129 @@ func getUILanguages(flags uint32, f func(flags uint32, numLanguages *uint32, buf func SetConsoleCursorPosition(console Handle, position Coord) error { return setConsoleCursorPosition(console, *((*uint32)(unsafe.Pointer(&position)))) } + +func (s NTStatus) Errno() syscall.Errno { + return rtlNtStatusToDosErrorNoTeb(s) +} + +func langID(pri, sub uint16) uint32 { return uint32(sub)<<10 | uint32(pri) } + +func (s NTStatus) Error() string { + b := make([]uint16, 300) + n, err := FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_FROM_HMODULE|FORMAT_MESSAGE_ARGUMENT_ARRAY, modntdll.Handle(), uint32(s), langID(LANG_ENGLISH, SUBLANG_ENGLISH_US), b, nil) + if err != nil { + return fmt.Sprintf("NTSTATUS 0x%08x", uint32(s)) + } + // trim terminating \r and \n + for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { + } + return string(utf16.Decode(b[:n])) +} + +// NewNTUnicodeString returns a new NTUnicodeString structure for use with native +// NT APIs that work over the NTUnicodeString type. Note that most Windows APIs +// do not use NTUnicodeString, and instead UTF16PtrFromString should be used for +// the more common *uint16 string type. +func NewNTUnicodeString(s string) (*NTUnicodeString, error) { + var u NTUnicodeString + s16, err := UTF16PtrFromString(s) + if err != nil { + return nil, err + } + RtlInitUnicodeString(&u, s16) + return &u, nil +} + +// Slice returns a uint16 slice that aliases the data in the NTUnicodeString. +func (s *NTUnicodeString) Slice() []uint16 { + var slice []uint16 + hdr := (*unsafeheader.Slice)(unsafe.Pointer(&slice)) + hdr.Data = unsafe.Pointer(s.Buffer) + hdr.Len = int(s.Length) + hdr.Cap = int(s.MaximumLength) + return slice +} + +func (s *NTUnicodeString) String() string { + return UTF16ToString(s.Slice()) +} + +// NewNTString returns a new NTString structure for use with native +// NT APIs that work over the NTString type. Note that most Windows APIs +// do not use NTString, and instead UTF16PtrFromString should be used for +// the more common *uint16 string type. +func NewNTString(s string) (*NTString, error) { + var nts NTString + s8, err := BytePtrFromString(s) + if err != nil { + return nil, err + } + RtlInitString(&nts, s8) + return &nts, nil +} + +// Slice returns a byte slice that aliases the data in the NTString. +func (s *NTString) Slice() []byte { + var slice []byte + hdr := (*unsafeheader.Slice)(unsafe.Pointer(&slice)) + hdr.Data = unsafe.Pointer(s.Buffer) + hdr.Len = int(s.Length) + hdr.Cap = int(s.MaximumLength) + return slice +} + +func (s *NTString) String() string { + return ByteSliceToString(s.Slice()) +} + +// FindResource resolves a resource of the given name and resource type. +func FindResource(module Handle, name, resType ResourceIDOrString) (Handle, error) { + var namePtr, resTypePtr uintptr + var name16, resType16 *uint16 + var err error + resolvePtr := func(i interface{}, keep **uint16) (uintptr, error) { + switch v := i.(type) { + case string: + *keep, err = UTF16PtrFromString(v) + if err != nil { + return 0, err + } + return uintptr(unsafe.Pointer(*keep)), nil + case ResourceID: + return uintptr(v), nil + } + return 0, errorspkg.New("parameter must be a ResourceID or a string") + } + namePtr, err = resolvePtr(name, &name16) + if err != nil { + return 0, err + } + resTypePtr, err = resolvePtr(resType, &resType16) + if err != nil { + return 0, err + } + resInfo, err := findResource(module, namePtr, resTypePtr) + runtime.KeepAlive(name16) + runtime.KeepAlive(resType16) + return resInfo, err +} + +func LoadResourceData(module, resInfo Handle) (data []byte, err error) { + size, err := SizeofResource(module, resInfo) + if err != nil { + return + } + resData, err := LoadResource(module, resInfo) + if err != nil { + return + } + ptr, err := LockResource(resData) + if err != nil { + return + } + h := (*unsafeheader.Slice)(unsafe.Pointer(&data)) + h.Data = unsafe.Pointer(ptr) + h.Len = int(size) + h.Cap = int(size) + return +} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/types_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/types_windows.go index fe135276efe3..23fe18ecef21 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/types_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/types_windows.go @@ -10,6 +10,10 @@ import ( "unsafe" ) +// NTStatus corresponds with NTSTATUS, error values returned by ntdll.dll and +// other native functions. +type NTStatus uint32 + const ( // Invented values to support what package os expects. O_RDONLY = 0x00000 @@ -215,6 +219,18 @@ const ( INHERIT_PARENT_AFFINITY = 0x00010000 ) +const ( + // attributes for ProcThreadAttributeList + PROC_THREAD_ATTRIBUTE_PARENT_PROCESS = 0x00020000 + PROC_THREAD_ATTRIBUTE_HANDLE_LIST = 0x00020002 + PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY = 0x00030003 + PROC_THREAD_ATTRIBUTE_PREFERRED_NODE = 0x00020004 + PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR = 0x00030005 + PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY = 0x00020007 + PROC_THREAD_ATTRIBUTE_UMS_THREAD = 0x00030006 + PROC_THREAD_ATTRIBUTE_PROTECTION_LEVEL = 0x0002000b +) + const ( // flags for CreateToolhelp32Snapshot TH32CS_SNAPHEAPLIST = 0x01 @@ -886,6 +902,23 @@ type StartupInfo struct { StdErr Handle } +type StartupInfoEx struct { + StartupInfo + ProcThreadAttributeList *ProcThreadAttributeList +} + +// ProcThreadAttributeList is a placeholder type to represent a PROC_THREAD_ATTRIBUTE_LIST. +// +// To create a *ProcThreadAttributeList, use NewProcThreadAttributeList, and +// free its memory using ProcThreadAttributeList.Delete. +type ProcThreadAttributeList struct { + // This is of type unsafe.Pointer, not of type byte or uintptr, because + // the contents of it is mostly a list of pointers, and in most cases, + // that's a list of pointers to Go-allocated objects. In order to keep + // the GC from collecting these objects, we declare this as unsafe.Pointer. + _ [1]unsafe.Pointer +} + type ProcessInformation struct { Process Handle Thread Handle @@ -987,6 +1020,7 @@ const ( // cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;257460 + IP_HDRINCL = 0x2 IP_TOS = 0x3 IP_TTL = 0x4 IP_MULTICAST_IF = 0x9 @@ -994,6 +1028,7 @@ const ( IP_MULTICAST_LOOP = 0xb IP_ADD_MEMBERSHIP = 0xc IP_DROP_MEMBERSHIP = 0xd + IP_PKTINFO = 0x13 IPV6_V6ONLY = 0x1b IPV6_UNICAST_HOPS = 0x4 @@ -1002,6 +1037,7 @@ const ( IPV6_MULTICAST_LOOP = 0xb IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd + IPV6_PKTINFO = 0x13 MSG_OOB = 0x1 MSG_PEEK = 0x2 @@ -2235,3 +2271,504 @@ const ( // REG_NOTIFY_THREAD_AGNOSTIC indicates that the lifetime of the registration must not be tied to the lifetime of the thread issuing the RegNotifyChangeKeyValue call. Note: This flag value is only supported in Windows 8 and later. REG_NOTIFY_THREAD_AGNOSTIC = 0x10000000 ) + +type CommTimeouts struct { + ReadIntervalTimeout uint32 + ReadTotalTimeoutMultiplier uint32 + ReadTotalTimeoutConstant uint32 + WriteTotalTimeoutMultiplier uint32 + WriteTotalTimeoutConstant uint32 +} + +// NTUnicodeString is a UTF-16 string for NT native APIs, corresponding to UNICODE_STRING. +type NTUnicodeString struct { + Length uint16 + MaximumLength uint16 + Buffer *uint16 +} + +// NTString is an ANSI string for NT native APIs, corresponding to STRING. +type NTString struct { + Length uint16 + MaximumLength uint16 + Buffer *byte +} + +type LIST_ENTRY struct { + Flink *LIST_ENTRY + Blink *LIST_ENTRY +} + +type LDR_DATA_TABLE_ENTRY struct { + reserved1 [2]uintptr + InMemoryOrderLinks LIST_ENTRY + reserved2 [2]uintptr + DllBase uintptr + reserved3 [2]uintptr + FullDllName NTUnicodeString + reserved4 [8]byte + reserved5 [3]uintptr + reserved6 uintptr + TimeDateStamp uint32 +} + +type PEB_LDR_DATA struct { + reserved1 [8]byte + reserved2 [3]uintptr + InMemoryOrderModuleList LIST_ENTRY +} + +type CURDIR struct { + DosPath NTUnicodeString + Handle Handle +} + +type RTL_DRIVE_LETTER_CURDIR struct { + Flags uint16 + Length uint16 + TimeStamp uint32 + DosPath NTString +} + +type RTL_USER_PROCESS_PARAMETERS struct { + MaximumLength, Length uint32 + + Flags, DebugFlags uint32 + + ConsoleHandle Handle + ConsoleFlags uint32 + StandardInput, StandardOutput, StandardError Handle + + CurrentDirectory CURDIR + DllPath NTUnicodeString + ImagePathName NTUnicodeString + CommandLine NTUnicodeString + Environment unsafe.Pointer + + StartingX, StartingY, CountX, CountY, CountCharsX, CountCharsY, FillAttribute uint32 + + WindowFlags, ShowWindowFlags uint32 + WindowTitle, DesktopInfo, ShellInfo, RuntimeData NTUnicodeString + CurrentDirectories [32]RTL_DRIVE_LETTER_CURDIR + + EnvironmentSize, EnvironmentVersion uintptr + + PackageDependencyData unsafe.Pointer + ProcessGroupId uint32 + LoaderThreads uint32 + + RedirectionDllName NTUnicodeString + HeapPartitionName NTUnicodeString + DefaultThreadpoolCpuSetMasks uintptr + DefaultThreadpoolCpuSetMaskCount uint32 +} + +type PEB struct { + reserved1 [2]byte + BeingDebugged byte + BitField byte + reserved3 uintptr + ImageBaseAddress uintptr + Ldr *PEB_LDR_DATA + ProcessParameters *RTL_USER_PROCESS_PARAMETERS + reserved4 [3]uintptr + AtlThunkSListPtr uintptr + reserved5 uintptr + reserved6 uint32 + reserved7 uintptr + reserved8 uint32 + AtlThunkSListPtr32 uint32 + reserved9 [45]uintptr + reserved10 [96]byte + PostProcessInitRoutine uintptr + reserved11 [128]byte + reserved12 [1]uintptr + SessionId uint32 +} + +type OBJECT_ATTRIBUTES struct { + Length uint32 + RootDirectory Handle + ObjectName *NTUnicodeString + Attributes uint32 + SecurityDescriptor *SECURITY_DESCRIPTOR + SecurityQoS *SECURITY_QUALITY_OF_SERVICE +} + +// Values for the Attributes member of OBJECT_ATTRIBUTES. +const ( + OBJ_INHERIT = 0x00000002 + OBJ_PERMANENT = 0x00000010 + OBJ_EXCLUSIVE = 0x00000020 + OBJ_CASE_INSENSITIVE = 0x00000040 + OBJ_OPENIF = 0x00000080 + OBJ_OPENLINK = 0x00000100 + OBJ_KERNEL_HANDLE = 0x00000200 + OBJ_FORCE_ACCESS_CHECK = 0x00000400 + OBJ_IGNORE_IMPERSONATED_DEVICEMAP = 0x00000800 + OBJ_DONT_REPARSE = 0x00001000 + OBJ_VALID_ATTRIBUTES = 0x00001FF2 +) + +type IO_STATUS_BLOCK struct { + Status NTStatus + Information uintptr +} + +type RTLP_CURDIR_REF struct { + RefCount int32 + Handle Handle +} + +type RTL_RELATIVE_NAME struct { + RelativeName NTUnicodeString + ContainingDirectory Handle + CurDirRef *RTLP_CURDIR_REF +} + +const ( + // CreateDisposition flags for NtCreateFile and NtCreateNamedPipeFile. + FILE_SUPERSEDE = 0x00000000 + FILE_OPEN = 0x00000001 + FILE_CREATE = 0x00000002 + FILE_OPEN_IF = 0x00000003 + FILE_OVERWRITE = 0x00000004 + FILE_OVERWRITE_IF = 0x00000005 + FILE_MAXIMUM_DISPOSITION = 0x00000005 + + // CreateOptions flags for NtCreateFile and NtCreateNamedPipeFile. + FILE_DIRECTORY_FILE = 0x00000001 + FILE_WRITE_THROUGH = 0x00000002 + FILE_SEQUENTIAL_ONLY = 0x00000004 + FILE_NO_INTERMEDIATE_BUFFERING = 0x00000008 + FILE_SYNCHRONOUS_IO_ALERT = 0x00000010 + FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020 + FILE_NON_DIRECTORY_FILE = 0x00000040 + FILE_CREATE_TREE_CONNECTION = 0x00000080 + FILE_COMPLETE_IF_OPLOCKED = 0x00000100 + FILE_NO_EA_KNOWLEDGE = 0x00000200 + FILE_OPEN_REMOTE_INSTANCE = 0x00000400 + FILE_RANDOM_ACCESS = 0x00000800 + FILE_DELETE_ON_CLOSE = 0x00001000 + FILE_OPEN_BY_FILE_ID = 0x00002000 + FILE_OPEN_FOR_BACKUP_INTENT = 0x00004000 + FILE_NO_COMPRESSION = 0x00008000 + FILE_OPEN_REQUIRING_OPLOCK = 0x00010000 + FILE_DISALLOW_EXCLUSIVE = 0x00020000 + FILE_RESERVE_OPFILTER = 0x00100000 + FILE_OPEN_REPARSE_POINT = 0x00200000 + FILE_OPEN_NO_RECALL = 0x00400000 + FILE_OPEN_FOR_FREE_SPACE_QUERY = 0x00800000 + + // Parameter constants for NtCreateNamedPipeFile. + + FILE_PIPE_BYTE_STREAM_TYPE = 0x00000000 + FILE_PIPE_MESSAGE_TYPE = 0x00000001 + + FILE_PIPE_ACCEPT_REMOTE_CLIENTS = 0x00000000 + FILE_PIPE_REJECT_REMOTE_CLIENTS = 0x00000002 + + FILE_PIPE_TYPE_VALID_MASK = 0x00000003 + + FILE_PIPE_BYTE_STREAM_MODE = 0x00000000 + FILE_PIPE_MESSAGE_MODE = 0x00000001 + + FILE_PIPE_QUEUE_OPERATION = 0x00000000 + FILE_PIPE_COMPLETE_OPERATION = 0x00000001 + + FILE_PIPE_INBOUND = 0x00000000 + FILE_PIPE_OUTBOUND = 0x00000001 + FILE_PIPE_FULL_DUPLEX = 0x00000002 + + FILE_PIPE_DISCONNECTED_STATE = 0x00000001 + FILE_PIPE_LISTENING_STATE = 0x00000002 + FILE_PIPE_CONNECTED_STATE = 0x00000003 + FILE_PIPE_CLOSING_STATE = 0x00000004 + + FILE_PIPE_CLIENT_END = 0x00000000 + FILE_PIPE_SERVER_END = 0x00000001 +) + +// ProcessInformationClasses for NtQueryInformationProcess and NtSetInformationProcess. +const ( + ProcessBasicInformation = iota + ProcessQuotaLimits + ProcessIoCounters + ProcessVmCounters + ProcessTimes + ProcessBasePriority + ProcessRaisePriority + ProcessDebugPort + ProcessExceptionPort + ProcessAccessToken + ProcessLdtInformation + ProcessLdtSize + ProcessDefaultHardErrorMode + ProcessIoPortHandlers + ProcessPooledUsageAndLimits + ProcessWorkingSetWatch + ProcessUserModeIOPL + ProcessEnableAlignmentFaultFixup + ProcessPriorityClass + ProcessWx86Information + ProcessHandleCount + ProcessAffinityMask + ProcessPriorityBoost + ProcessDeviceMap + ProcessSessionInformation + ProcessForegroundInformation + ProcessWow64Information + ProcessImageFileName + ProcessLUIDDeviceMapsEnabled + ProcessBreakOnTermination + ProcessDebugObjectHandle + ProcessDebugFlags + ProcessHandleTracing + ProcessIoPriority + ProcessExecuteFlags + ProcessTlsInformation + ProcessCookie + ProcessImageInformation + ProcessCycleTime + ProcessPagePriority + ProcessInstrumentationCallback + ProcessThreadStackAllocation + ProcessWorkingSetWatchEx + ProcessImageFileNameWin32 + ProcessImageFileMapping + ProcessAffinityUpdateMode + ProcessMemoryAllocationMode + ProcessGroupInformation + ProcessTokenVirtualizationEnabled + ProcessConsoleHostProcess + ProcessWindowInformation + ProcessHandleInformation + ProcessMitigationPolicy + ProcessDynamicFunctionTableInformation + ProcessHandleCheckingMode + ProcessKeepAliveCount + ProcessRevokeFileHandles + ProcessWorkingSetControl + ProcessHandleTable + ProcessCheckStackExtentsMode + ProcessCommandLineInformation + ProcessProtectionInformation + ProcessMemoryExhaustion + ProcessFaultInformation + ProcessTelemetryIdInformation + ProcessCommitReleaseInformation + ProcessDefaultCpuSetsInformation + ProcessAllowedCpuSetsInformation + ProcessSubsystemProcess + ProcessJobMemoryInformation + ProcessInPrivate + ProcessRaiseUMExceptionOnInvalidHandleClose + ProcessIumChallengeResponse + ProcessChildProcessInformation + ProcessHighGraphicsPriorityInformation + ProcessSubsystemInformation + ProcessEnergyValues + ProcessActivityThrottleState + ProcessActivityThrottlePolicy + ProcessWin32kSyscallFilterInformation + ProcessDisableSystemAllowedCpuSets + ProcessWakeInformation + ProcessEnergyTrackingState + ProcessManageWritesToExecutableMemory + ProcessCaptureTrustletLiveDump + ProcessTelemetryCoverage + ProcessEnclaveInformation + ProcessEnableReadWriteVmLogging + ProcessUptimeInformation + ProcessImageSection + ProcessDebugAuthInformation + ProcessSystemResourceManagement + ProcessSequenceNumber + ProcessLoaderDetour + ProcessSecurityDomainInformation + ProcessCombineSecurityDomainsInformation + ProcessEnableLogging + ProcessLeapSecondInformation + ProcessFiberShadowStackAllocation + ProcessFreeFiberShadowStackAllocation + ProcessAltSystemCallInformation + ProcessDynamicEHContinuationTargets + ProcessDynamicEnforcedCetCompatibleRanges +) + +type PROCESS_BASIC_INFORMATION struct { + ExitStatus NTStatus + PebBaseAddress *PEB + AffinityMask uintptr + BasePriority int32 + UniqueProcessId uintptr + InheritedFromUniqueProcessId uintptr +} + +// Constants for LocalAlloc flags. +const ( + LMEM_FIXED = 0x0 + LMEM_MOVEABLE = 0x2 + LMEM_NOCOMPACT = 0x10 + LMEM_NODISCARD = 0x20 + LMEM_ZEROINIT = 0x40 + LMEM_MODIFY = 0x80 + LMEM_DISCARDABLE = 0xf00 + LMEM_VALID_FLAGS = 0xf72 + LMEM_INVALID_HANDLE = 0x8000 + LHND = LMEM_MOVEABLE | LMEM_ZEROINIT + LPTR = LMEM_FIXED | LMEM_ZEROINIT + NONZEROLHND = LMEM_MOVEABLE + NONZEROLPTR = LMEM_FIXED +) + +// Constants for the CreateNamedPipe-family of functions. +const ( + PIPE_ACCESS_INBOUND = 0x1 + PIPE_ACCESS_OUTBOUND = 0x2 + PIPE_ACCESS_DUPLEX = 0x3 + + PIPE_CLIENT_END = 0x0 + PIPE_SERVER_END = 0x1 + + PIPE_WAIT = 0x0 + PIPE_NOWAIT = 0x1 + PIPE_READMODE_BYTE = 0x0 + PIPE_READMODE_MESSAGE = 0x2 + PIPE_TYPE_BYTE = 0x0 + PIPE_TYPE_MESSAGE = 0x4 + PIPE_ACCEPT_REMOTE_CLIENTS = 0x0 + PIPE_REJECT_REMOTE_CLIENTS = 0x8 + + PIPE_UNLIMITED_INSTANCES = 255 +) + +// Constants for security attributes when opening named pipes. +const ( + SECURITY_ANONYMOUS = SecurityAnonymous << 16 + SECURITY_IDENTIFICATION = SecurityIdentification << 16 + SECURITY_IMPERSONATION = SecurityImpersonation << 16 + SECURITY_DELEGATION = SecurityDelegation << 16 + + SECURITY_CONTEXT_TRACKING = 0x40000 + SECURITY_EFFECTIVE_ONLY = 0x80000 + + SECURITY_SQOS_PRESENT = 0x100000 + SECURITY_VALID_SQOS_FLAGS = 0x1f0000 +) + +// ResourceID represents a 16-bit resource identifier, traditionally created with the MAKEINTRESOURCE macro. +type ResourceID uint16 + +// ResourceIDOrString must be either a ResourceID, to specify a resource or resource type by ID, +// or a string, to specify a resource or resource type by name. +type ResourceIDOrString interface{} + +// Predefined resource names and types. +var ( + // Predefined names. + CREATEPROCESS_MANIFEST_RESOURCE_ID ResourceID = 1 + ISOLATIONAWARE_MANIFEST_RESOURCE_ID ResourceID = 2 + ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID ResourceID = 3 + ISOLATIONPOLICY_MANIFEST_RESOURCE_ID ResourceID = 4 + ISOLATIONPOLICY_BROWSER_MANIFEST_RESOURCE_ID ResourceID = 5 + MINIMUM_RESERVED_MANIFEST_RESOURCE_ID ResourceID = 1 // inclusive + MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID ResourceID = 16 // inclusive + + // Predefined types. + RT_CURSOR ResourceID = 1 + RT_BITMAP ResourceID = 2 + RT_ICON ResourceID = 3 + RT_MENU ResourceID = 4 + RT_DIALOG ResourceID = 5 + RT_STRING ResourceID = 6 + RT_FONTDIR ResourceID = 7 + RT_FONT ResourceID = 8 + RT_ACCELERATOR ResourceID = 9 + RT_RCDATA ResourceID = 10 + RT_MESSAGETABLE ResourceID = 11 + RT_GROUP_CURSOR ResourceID = 12 + RT_GROUP_ICON ResourceID = 14 + RT_VERSION ResourceID = 16 + RT_DLGINCLUDE ResourceID = 17 + RT_PLUGPLAY ResourceID = 19 + RT_VXD ResourceID = 20 + RT_ANICURSOR ResourceID = 21 + RT_ANIICON ResourceID = 22 + RT_HTML ResourceID = 23 + RT_MANIFEST ResourceID = 24 +) + +type COAUTHIDENTITY struct { + User *uint16 + UserLength uint32 + Domain *uint16 + DomainLength uint32 + Password *uint16 + PasswordLength uint32 + Flags uint32 +} + +type COAUTHINFO struct { + AuthnSvc uint32 + AuthzSvc uint32 + ServerPrincName *uint16 + AuthnLevel uint32 + ImpersonationLevel uint32 + AuthIdentityData *COAUTHIDENTITY + Capabilities uint32 +} + +type COSERVERINFO struct { + Reserved1 uint32 + Aame *uint16 + AuthInfo *COAUTHINFO + Reserved2 uint32 +} + +type BIND_OPTS3 struct { + CbStruct uint32 + Flags uint32 + Mode uint32 + TickCountDeadline uint32 + TrackFlags uint32 + ClassContext uint32 + Locale uint32 + ServerInfo *COSERVERINFO + Hwnd HWND +} + +const ( + CLSCTX_INPROC_SERVER = 0x1 + CLSCTX_INPROC_HANDLER = 0x2 + CLSCTX_LOCAL_SERVER = 0x4 + CLSCTX_INPROC_SERVER16 = 0x8 + CLSCTX_REMOTE_SERVER = 0x10 + CLSCTX_INPROC_HANDLER16 = 0x20 + CLSCTX_RESERVED1 = 0x40 + CLSCTX_RESERVED2 = 0x80 + CLSCTX_RESERVED3 = 0x100 + CLSCTX_RESERVED4 = 0x200 + CLSCTX_NO_CODE_DOWNLOAD = 0x400 + CLSCTX_RESERVED5 = 0x800 + CLSCTX_NO_CUSTOM_MARSHAL = 0x1000 + CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000 + CLSCTX_NO_FAILURE_LOG = 0x4000 + CLSCTX_DISABLE_AAA = 0x8000 + CLSCTX_ENABLE_AAA = 0x10000 + CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000 + CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000 + CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000 + CLSCTX_ENABLE_CLOAKING = 0x100000 + CLSCTX_APPCONTAINER = 0x400000 + CLSCTX_ACTIVATE_AAA_AS_IU = 0x800000 + CLSCTX_PS_DLL = 0x80000000 + + COINIT_MULTITHREADED = 0x0 + COINIT_APARTMENTTHREADED = 0x2 + COINIT_DISABLE_OLE1DDE = 0x4 + COINIT_SPEED_OVER_MEMORY = 0x8 +) + +// Flag for QueryFullProcessImageName. +const PROCESS_NAME_NATIVE = 1 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/zerrors_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/zerrors_windows.go index f0212003520d..0cf658fbd5d7 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/zerrors_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/zerrors_windows.go @@ -146,6 +146,7 @@ const ( FACILITY_WEP = 2049 FACILITY_SYNCENGINE = 2050 FACILITY_XBOX = 2339 + FACILITY_GAME = 2340 FACILITY_PIX = 2748 ERROR_SUCCESS syscall.Errno = 0 NO_ERROR = 0 @@ -469,9 +470,18 @@ const ( ERROR_STORAGE_RESERVE_NOT_EMPTY syscall.Errno = 419 ERROR_NOT_A_DAX_VOLUME syscall.Errno = 420 ERROR_NOT_DAX_MAPPABLE syscall.Errno = 421 - ERROR_TIME_CRITICAL_THREAD syscall.Errno = 422 + ERROR_TIME_SENSITIVE_THREAD syscall.Errno = 422 ERROR_DPL_NOT_SUPPORTED_FOR_USER syscall.Errno = 423 ERROR_CASE_DIFFERING_NAMES_IN_DIR syscall.Errno = 424 + ERROR_FILE_NOT_SUPPORTED syscall.Errno = 425 + ERROR_CLOUD_FILE_REQUEST_TIMEOUT syscall.Errno = 426 + ERROR_NO_TASK_QUEUE syscall.Errno = 427 + ERROR_SRC_SRV_DLL_LOAD_FAILED syscall.Errno = 428 + ERROR_NOT_SUPPORTED_WITH_BTT syscall.Errno = 429 + ERROR_ENCRYPTION_DISABLED syscall.Errno = 430 + ERROR_ENCRYPTING_METADATA_DISALLOWED syscall.Errno = 431 + ERROR_CANT_CLEAR_ENCRYPTION_FLAG syscall.Errno = 432 + ERROR_NO_SUCH_DEVICE syscall.Errno = 433 ERROR_CAPAUTHZ_NOT_DEVUNLOCKED syscall.Errno = 450 ERROR_CAPAUTHZ_CHANGE_TYPE syscall.Errno = 451 ERROR_CAPAUTHZ_NOT_PROVISIONED syscall.Errno = 452 @@ -1593,6 +1603,8 @@ const ( ERROR_SYSTEM_INTEGRITY_POLICY_VIOLATION syscall.Errno = 4551 ERROR_SYSTEM_INTEGRITY_INVALID_POLICY syscall.Errno = 4552 ERROR_SYSTEM_INTEGRITY_POLICY_NOT_SIGNED syscall.Errno = 4553 + ERROR_SYSTEM_INTEGRITY_TOO_MANY_POLICIES syscall.Errno = 4554 + ERROR_SYSTEM_INTEGRITY_SUPPLEMENTAL_POLICY_NOT_AUTHORIZED syscall.Errno = 4555 ERROR_VSM_NOT_INITIALIZED syscall.Errno = 4560 ERROR_VSM_DMA_PROTECTION_NOT_IN_USE syscall.Errno = 4561 ERROR_PLATFORM_MANIFEST_NOT_AUTHORIZED syscall.Errno = 4570 @@ -1824,6 +1836,7 @@ const ( ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE syscall.Errno = 6020 ERROR_CS_ENCRYPTION_FILE_NOT_CSE syscall.Errno = 6021 ERROR_ENCRYPTION_POLICY_DENIES_OPERATION syscall.Errno = 6022 + ERROR_WIP_ENCRYPTION_FAILED syscall.Errno = 6023 ERROR_NO_BROWSER_SERVERS_FOUND syscall.Errno = 6118 SCHED_E_SERVICE_NOT_LOCALSYSTEM syscall.Errno = 6200 ERROR_LOG_SECTOR_INVALID syscall.Errno = 6600 @@ -3000,6 +3013,7 @@ const ( ERROR_SMI_PRIMITIVE_INSTALLER_FAILED syscall.Errno = 14108 ERROR_GENERIC_COMMAND_FAILED syscall.Errno = 14109 ERROR_SXS_FILE_HASH_MISSING syscall.Errno = 14110 + ERROR_SXS_DUPLICATE_ACTIVATABLE_CLASS syscall.Errno = 14111 ERROR_EVT_INVALID_CHANNEL_PATH syscall.Errno = 15000 ERROR_EVT_INVALID_QUERY syscall.Errno = 15001 ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND syscall.Errno = 15002 @@ -3093,6 +3107,7 @@ const ( ERROR_PRI_MERGE_RESOURCE_PACKAGE_REQUIRED syscall.Errno = 15157 ERROR_PRI_MERGE_INVALID_FILE_NAME syscall.Errno = 15158 ERROR_MRM_PACKAGE_NOT_FOUND syscall.Errno = 15159 + ERROR_MRM_MISSING_DEFAULT_LANGUAGE syscall.Errno = 15160 ERROR_MCA_INVALID_CAPABILITIES_STRING syscall.Errno = 15200 ERROR_MCA_INVALID_VCP_VERSION syscall.Errno = 15201 ERROR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION syscall.Errno = 15202 @@ -3167,6 +3182,15 @@ const ( ERROR_DEPLOYMENT_OPTION_NOT_SUPPORTED syscall.Errno = 15645 ERROR_APPINSTALLER_ACTIVATION_BLOCKED syscall.Errno = 15646 ERROR_REGISTRATION_FROM_REMOTE_DRIVE_NOT_SUPPORTED syscall.Errno = 15647 + ERROR_APPX_RAW_DATA_WRITE_FAILED syscall.Errno = 15648 + ERROR_DEPLOYMENT_BLOCKED_BY_VOLUME_POLICY_PACKAGE syscall.Errno = 15649 + ERROR_DEPLOYMENT_BLOCKED_BY_VOLUME_POLICY_MACHINE syscall.Errno = 15650 + ERROR_DEPLOYMENT_BLOCKED_BY_PROFILE_POLICY syscall.Errno = 15651 + ERROR_DEPLOYMENT_FAILED_CONFLICTING_MUTABLE_PACKAGE_DIRECTORY syscall.Errno = 15652 + ERROR_SINGLETON_RESOURCE_INSTALLED_IN_ACTIVE_USER syscall.Errno = 15653 + ERROR_DIFFERENT_VERSION_OF_PACKAGED_SERVICE_INSTALLED syscall.Errno = 15654 + ERROR_SERVICE_EXISTS_AS_NON_PACKAGED_SERVICE syscall.Errno = 15655 + ERROR_PACKAGED_SERVICE_REQUIRES_ADMIN_PRIVILEGES syscall.Errno = 15656 APPMODEL_ERROR_NO_PACKAGE syscall.Errno = 15700 APPMODEL_ERROR_PACKAGE_RUNTIME_CORRUPT syscall.Errno = 15701 APPMODEL_ERROR_PACKAGE_IDENTITY_CORRUPT syscall.Errno = 15702 @@ -3174,6 +3198,7 @@ const ( APPMODEL_ERROR_DYNAMIC_PROPERTY_READ_FAILED syscall.Errno = 15704 APPMODEL_ERROR_DYNAMIC_PROPERTY_INVALID syscall.Errno = 15705 APPMODEL_ERROR_PACKAGE_NOT_AVAILABLE syscall.Errno = 15706 + APPMODEL_ERROR_NO_MUTABLE_DIRECTORY syscall.Errno = 15707 ERROR_STATE_LOAD_STORE_FAILED syscall.Errno = 15800 ERROR_STATE_GET_VERSION_FAILED syscall.Errno = 15801 ERROR_STATE_SET_VERSION_FAILED syscall.Errno = 15802 @@ -3204,7 +3229,8 @@ const ( E_NOT_SET = ERROR_NOT_FOUND E_NOT_VALID_STATE = ERROR_INVALID_STATE E_NOT_SUFFICIENT_BUFFER = ERROR_INSUFFICIENT_BUFFER - E_TIME_CRITICAL_THREAD = ERROR_TIME_CRITICAL_THREAD + E_TIME_SENSITIVE_THREAD = ERROR_TIME_SENSITIVE_THREAD + E_NO_TASK_QUEUE = ERROR_NO_TASK_QUEUE NOERROR syscall.Errno = 0 E_UNEXPECTED Handle = 0x8000FFFF E_NOTIMPL Handle = 0x80004001 @@ -3966,6 +3992,7 @@ const ( SEC_I_COMPLETE_NEEDED Handle = 0x00090313 SEC_I_COMPLETE_AND_CONTINUE Handle = 0x00090314 SEC_I_LOCAL_LOGON Handle = 0x00090315 + SEC_I_GENERIC_EXTENSION_RECEIVED Handle = 0x00090316 SEC_E_BAD_PKGID Handle = 0x80090316 SEC_E_CONTEXT_EXPIRED Handle = 0x80090317 SEC_I_CONTEXT_EXPIRED Handle = 0x00090317 @@ -4033,6 +4060,8 @@ const ( SEC_E_APPLICATION_PROTOCOL_MISMATCH Handle = 0x80090367 SEC_I_ASYNC_CALL_PENDING Handle = 0x00090368 SEC_E_INVALID_UPN_NAME Handle = 0x80090369 + SEC_E_EXT_BUFFER_TOO_SMALL Handle = 0x8009036A + SEC_E_INSUFFICIENT_BUFFERS Handle = 0x8009036B SEC_E_NO_SPM = SEC_E_INTERNAL_ERROR SEC_E_NOT_SUPPORTED = SEC_E_UNSUPPORTED_FUNCTION CRYPT_E_MSG_ERROR Handle = 0x80091001 @@ -4637,6 +4666,8 @@ const ( ERROR_GRAPHICS_PRESENT_INVALID_WINDOW Handle = 0xC026200F ERROR_GRAPHICS_PRESENT_BUFFER_NOT_BOUND Handle = 0xC0262010 ERROR_GRAPHICS_VAIL_STATE_CHANGED Handle = 0xC0262011 + ERROR_GRAPHICS_INDIRECT_DISPLAY_ABANDON_SWAPCHAIN Handle = 0xC0262012 + ERROR_GRAPHICS_INDIRECT_DISPLAY_DEVICE_STOPPED Handle = 0xC0262013 ERROR_GRAPHICS_NO_VIDEO_MEMORY Handle = 0xC0262100 ERROR_GRAPHICS_CANT_LOCK_MEMORY Handle = 0xC0262101 ERROR_GRAPHICS_ALLOCATION_BUSY Handle = 0xC0262102 @@ -5393,6 +5424,13 @@ const ( FVE_E_NOT_DE_VOLUME Handle = 0x803100D7 FVE_E_PROTECTION_CANNOT_BE_DISABLED Handle = 0x803100D8 FVE_E_OSV_KSR_NOT_ALLOWED Handle = 0x803100D9 + FVE_E_AD_BACKUP_REQUIRED_POLICY_NOT_SET_OS_DRIVE Handle = 0x803100DA + FVE_E_AD_BACKUP_REQUIRED_POLICY_NOT_SET_FIXED_DRIVE Handle = 0x803100DB + FVE_E_AD_BACKUP_REQUIRED_POLICY_NOT_SET_REMOVABLE_DRIVE Handle = 0x803100DC + FVE_E_KEY_ROTATION_NOT_SUPPORTED Handle = 0x803100DD + FVE_E_EXECUTE_REQUEST_SENT_TOO_SOON Handle = 0x803100DE + FVE_E_KEY_ROTATION_NOT_ENABLED Handle = 0x803100DF + FVE_E_DEVICE_NOT_JOINED Handle = 0x803100E0 FWP_E_CALLOUT_NOT_FOUND Handle = 0x80320001 FWP_E_CONDITION_NOT_FOUND Handle = 0x80320002 FWP_E_FILTER_NOT_FOUND Handle = 0x80320003 @@ -5881,6 +5919,12 @@ const ( GCN_E_NETCOMPARTMENT_NOT_FOUND Handle = 0x803B0027 GCN_E_NETINTERFACE_NOT_FOUND Handle = 0x803B0028 GCN_E_DEFAULTNAMESPACE_EXISTS Handle = 0x803B0029 + HCN_E_ICS_DISABLED Handle = 0x803B002A + HCN_E_ENDPOINT_NAMESPACE_ALREADY_EXISTS Handle = 0x803B002B + HCN_E_ENTITY_HAS_REFERENCES Handle = 0x803B002C + HCN_E_INVALID_INTERNAL_PORT Handle = 0x803B002D + HCN_E_NAMESPACE_ATTACH_FAILED Handle = 0x803B002E + HCN_E_ADDR_INVALID_OR_RESERVED Handle = 0x803B002F SDIAG_E_CANCELLED syscall.Errno = 0x803C0100 SDIAG_E_SCRIPT syscall.Errno = 0x803C0101 SDIAG_E_POWERSHELL syscall.Errno = 0x803C0102 @@ -6846,8 +6890,2579 @@ const ( UTC_E_INSUFFICIENT_SPACE_TO_START_TRACE Handle = 0x87C51059 UTC_E_ESCALATION_CANCELLED_AT_SHUTDOWN Handle = 0x87C5105A UTC_E_GETFILEINFOACTION_FILE_NOT_APPROVED Handle = 0x87C5105B + UTC_E_SETREGKEYACTION_TYPE_NOT_APPROVED Handle = 0x87C5105C WINML_ERR_INVALID_DEVICE Handle = 0x88900001 WINML_ERR_INVALID_BINDING Handle = 0x88900002 WINML_ERR_VALUE_NOTFOUND Handle = 0x88900003 WINML_ERR_SIZE_MISMATCH Handle = 0x88900004 + STATUS_WAIT_0 NTStatus = 0x00000000 + STATUS_SUCCESS NTStatus = 0x00000000 + STATUS_WAIT_1 NTStatus = 0x00000001 + STATUS_WAIT_2 NTStatus = 0x00000002 + STATUS_WAIT_3 NTStatus = 0x00000003 + STATUS_WAIT_63 NTStatus = 0x0000003F + STATUS_ABANDONED NTStatus = 0x00000080 + STATUS_ABANDONED_WAIT_0 NTStatus = 0x00000080 + STATUS_ABANDONED_WAIT_63 NTStatus = 0x000000BF + STATUS_USER_APC NTStatus = 0x000000C0 + STATUS_ALREADY_COMPLETE NTStatus = 0x000000FF + STATUS_KERNEL_APC NTStatus = 0x00000100 + STATUS_ALERTED NTStatus = 0x00000101 + STATUS_TIMEOUT NTStatus = 0x00000102 + STATUS_PENDING NTStatus = 0x00000103 + STATUS_REPARSE NTStatus = 0x00000104 + STATUS_MORE_ENTRIES NTStatus = 0x00000105 + STATUS_NOT_ALL_ASSIGNED NTStatus = 0x00000106 + STATUS_SOME_NOT_MAPPED NTStatus = 0x00000107 + STATUS_OPLOCK_BREAK_IN_PROGRESS NTStatus = 0x00000108 + STATUS_VOLUME_MOUNTED NTStatus = 0x00000109 + STATUS_RXACT_COMMITTED NTStatus = 0x0000010A + STATUS_NOTIFY_CLEANUP NTStatus = 0x0000010B + STATUS_NOTIFY_ENUM_DIR NTStatus = 0x0000010C + STATUS_NO_QUOTAS_FOR_ACCOUNT NTStatus = 0x0000010D + STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED NTStatus = 0x0000010E + STATUS_PAGE_FAULT_TRANSITION NTStatus = 0x00000110 + STATUS_PAGE_FAULT_DEMAND_ZERO NTStatus = 0x00000111 + STATUS_PAGE_FAULT_COPY_ON_WRITE NTStatus = 0x00000112 + STATUS_PAGE_FAULT_GUARD_PAGE NTStatus = 0x00000113 + STATUS_PAGE_FAULT_PAGING_FILE NTStatus = 0x00000114 + STATUS_CACHE_PAGE_LOCKED NTStatus = 0x00000115 + STATUS_CRASH_DUMP NTStatus = 0x00000116 + STATUS_BUFFER_ALL_ZEROS NTStatus = 0x00000117 + STATUS_REPARSE_OBJECT NTStatus = 0x00000118 + STATUS_RESOURCE_REQUIREMENTS_CHANGED NTStatus = 0x00000119 + STATUS_TRANSLATION_COMPLETE NTStatus = 0x00000120 + STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY NTStatus = 0x00000121 + STATUS_NOTHING_TO_TERMINATE NTStatus = 0x00000122 + STATUS_PROCESS_NOT_IN_JOB NTStatus = 0x00000123 + STATUS_PROCESS_IN_JOB NTStatus = 0x00000124 + STATUS_VOLSNAP_HIBERNATE_READY NTStatus = 0x00000125 + STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY NTStatus = 0x00000126 + STATUS_INTERRUPT_VECTOR_ALREADY_CONNECTED NTStatus = 0x00000127 + STATUS_INTERRUPT_STILL_CONNECTED NTStatus = 0x00000128 + STATUS_PROCESS_CLONED NTStatus = 0x00000129 + STATUS_FILE_LOCKED_WITH_ONLY_READERS NTStatus = 0x0000012A + STATUS_FILE_LOCKED_WITH_WRITERS NTStatus = 0x0000012B + STATUS_VALID_IMAGE_HASH NTStatus = 0x0000012C + STATUS_VALID_CATALOG_HASH NTStatus = 0x0000012D + STATUS_VALID_STRONG_CODE_HASH NTStatus = 0x0000012E + STATUS_GHOSTED NTStatus = 0x0000012F + STATUS_DATA_OVERWRITTEN NTStatus = 0x00000130 + STATUS_RESOURCEMANAGER_READ_ONLY NTStatus = 0x00000202 + STATUS_RING_PREVIOUSLY_EMPTY NTStatus = 0x00000210 + STATUS_RING_PREVIOUSLY_FULL NTStatus = 0x00000211 + STATUS_RING_PREVIOUSLY_ABOVE_QUOTA NTStatus = 0x00000212 + STATUS_RING_NEWLY_EMPTY NTStatus = 0x00000213 + STATUS_RING_SIGNAL_OPPOSITE_ENDPOINT NTStatus = 0x00000214 + STATUS_OPLOCK_SWITCHED_TO_NEW_HANDLE NTStatus = 0x00000215 + STATUS_OPLOCK_HANDLE_CLOSED NTStatus = 0x00000216 + STATUS_WAIT_FOR_OPLOCK NTStatus = 0x00000367 + STATUS_REPARSE_GLOBAL NTStatus = 0x00000368 + STATUS_FLT_IO_COMPLETE NTStatus = 0x001C0001 + STATUS_OBJECT_NAME_EXISTS NTStatus = 0x40000000 + STATUS_THREAD_WAS_SUSPENDED NTStatus = 0x40000001 + STATUS_WORKING_SET_LIMIT_RANGE NTStatus = 0x40000002 + STATUS_IMAGE_NOT_AT_BASE NTStatus = 0x40000003 + STATUS_RXACT_STATE_CREATED NTStatus = 0x40000004 + STATUS_SEGMENT_NOTIFICATION NTStatus = 0x40000005 + STATUS_LOCAL_USER_SESSION_KEY NTStatus = 0x40000006 + STATUS_BAD_CURRENT_DIRECTORY NTStatus = 0x40000007 + STATUS_SERIAL_MORE_WRITES NTStatus = 0x40000008 + STATUS_REGISTRY_RECOVERED NTStatus = 0x40000009 + STATUS_FT_READ_RECOVERY_FROM_BACKUP NTStatus = 0x4000000A + STATUS_FT_WRITE_RECOVERY NTStatus = 0x4000000B + STATUS_SERIAL_COUNTER_TIMEOUT NTStatus = 0x4000000C + STATUS_NULL_LM_PASSWORD NTStatus = 0x4000000D + STATUS_IMAGE_MACHINE_TYPE_MISMATCH NTStatus = 0x4000000E + STATUS_RECEIVE_PARTIAL NTStatus = 0x4000000F + STATUS_RECEIVE_EXPEDITED NTStatus = 0x40000010 + STATUS_RECEIVE_PARTIAL_EXPEDITED NTStatus = 0x40000011 + STATUS_EVENT_DONE NTStatus = 0x40000012 + STATUS_EVENT_PENDING NTStatus = 0x40000013 + STATUS_CHECKING_FILE_SYSTEM NTStatus = 0x40000014 + STATUS_FATAL_APP_EXIT NTStatus = 0x40000015 + STATUS_PREDEFINED_HANDLE NTStatus = 0x40000016 + STATUS_WAS_UNLOCKED NTStatus = 0x40000017 + STATUS_SERVICE_NOTIFICATION NTStatus = 0x40000018 + STATUS_WAS_LOCKED NTStatus = 0x40000019 + STATUS_LOG_HARD_ERROR NTStatus = 0x4000001A + STATUS_ALREADY_WIN32 NTStatus = 0x4000001B + STATUS_WX86_UNSIMULATE NTStatus = 0x4000001C + STATUS_WX86_CONTINUE NTStatus = 0x4000001D + STATUS_WX86_SINGLE_STEP NTStatus = 0x4000001E + STATUS_WX86_BREAKPOINT NTStatus = 0x4000001F + STATUS_WX86_EXCEPTION_CONTINUE NTStatus = 0x40000020 + STATUS_WX86_EXCEPTION_LASTCHANCE NTStatus = 0x40000021 + STATUS_WX86_EXCEPTION_CHAIN NTStatus = 0x40000022 + STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE NTStatus = 0x40000023 + STATUS_NO_YIELD_PERFORMED NTStatus = 0x40000024 + STATUS_TIMER_RESUME_IGNORED NTStatus = 0x40000025 + STATUS_ARBITRATION_UNHANDLED NTStatus = 0x40000026 + STATUS_CARDBUS_NOT_SUPPORTED NTStatus = 0x40000027 + STATUS_WX86_CREATEWX86TIB NTStatus = 0x40000028 + STATUS_MP_PROCESSOR_MISMATCH NTStatus = 0x40000029 + STATUS_HIBERNATED NTStatus = 0x4000002A + STATUS_RESUME_HIBERNATION NTStatus = 0x4000002B + STATUS_FIRMWARE_UPDATED NTStatus = 0x4000002C + STATUS_DRIVERS_LEAKING_LOCKED_PAGES NTStatus = 0x4000002D + STATUS_MESSAGE_RETRIEVED NTStatus = 0x4000002E + STATUS_SYSTEM_POWERSTATE_TRANSITION NTStatus = 0x4000002F + STATUS_ALPC_CHECK_COMPLETION_LIST NTStatus = 0x40000030 + STATUS_SYSTEM_POWERSTATE_COMPLEX_TRANSITION NTStatus = 0x40000031 + STATUS_ACCESS_AUDIT_BY_POLICY NTStatus = 0x40000032 + STATUS_ABANDON_HIBERFILE NTStatus = 0x40000033 + STATUS_BIZRULES_NOT_ENABLED NTStatus = 0x40000034 + STATUS_FT_READ_FROM_COPY NTStatus = 0x40000035 + STATUS_IMAGE_AT_DIFFERENT_BASE NTStatus = 0x40000036 + STATUS_PATCH_DEFERRED NTStatus = 0x40000037 + STATUS_HEURISTIC_DAMAGE_POSSIBLE NTStatus = 0x40190001 + STATUS_GUARD_PAGE_VIOLATION NTStatus = 0x80000001 + STATUS_DATATYPE_MISALIGNMENT NTStatus = 0x80000002 + STATUS_BREAKPOINT NTStatus = 0x80000003 + STATUS_SINGLE_STEP NTStatus = 0x80000004 + STATUS_BUFFER_OVERFLOW NTStatus = 0x80000005 + STATUS_NO_MORE_FILES NTStatus = 0x80000006 + STATUS_WAKE_SYSTEM_DEBUGGER NTStatus = 0x80000007 + STATUS_HANDLES_CLOSED NTStatus = 0x8000000A + STATUS_NO_INHERITANCE NTStatus = 0x8000000B + STATUS_GUID_SUBSTITUTION_MADE NTStatus = 0x8000000C + STATUS_PARTIAL_COPY NTStatus = 0x8000000D + STATUS_DEVICE_PAPER_EMPTY NTStatus = 0x8000000E + STATUS_DEVICE_POWERED_OFF NTStatus = 0x8000000F + STATUS_DEVICE_OFF_LINE NTStatus = 0x80000010 + STATUS_DEVICE_BUSY NTStatus = 0x80000011 + STATUS_NO_MORE_EAS NTStatus = 0x80000012 + STATUS_INVALID_EA_NAME NTStatus = 0x80000013 + STATUS_EA_LIST_INCONSISTENT NTStatus = 0x80000014 + STATUS_INVALID_EA_FLAG NTStatus = 0x80000015 + STATUS_VERIFY_REQUIRED NTStatus = 0x80000016 + STATUS_EXTRANEOUS_INFORMATION NTStatus = 0x80000017 + STATUS_RXACT_COMMIT_NECESSARY NTStatus = 0x80000018 + STATUS_NO_MORE_ENTRIES NTStatus = 0x8000001A + STATUS_FILEMARK_DETECTED NTStatus = 0x8000001B + STATUS_MEDIA_CHANGED NTStatus = 0x8000001C + STATUS_BUS_RESET NTStatus = 0x8000001D + STATUS_END_OF_MEDIA NTStatus = 0x8000001E + STATUS_BEGINNING_OF_MEDIA NTStatus = 0x8000001F + STATUS_MEDIA_CHECK NTStatus = 0x80000020 + STATUS_SETMARK_DETECTED NTStatus = 0x80000021 + STATUS_NO_DATA_DETECTED NTStatus = 0x80000022 + STATUS_REDIRECTOR_HAS_OPEN_HANDLES NTStatus = 0x80000023 + STATUS_SERVER_HAS_OPEN_HANDLES NTStatus = 0x80000024 + STATUS_ALREADY_DISCONNECTED NTStatus = 0x80000025 + STATUS_LONGJUMP NTStatus = 0x80000026 + STATUS_CLEANER_CARTRIDGE_INSTALLED NTStatus = 0x80000027 + STATUS_PLUGPLAY_QUERY_VETOED NTStatus = 0x80000028 + STATUS_UNWIND_CONSOLIDATE NTStatus = 0x80000029 + STATUS_REGISTRY_HIVE_RECOVERED NTStatus = 0x8000002A + STATUS_DLL_MIGHT_BE_INSECURE NTStatus = 0x8000002B + STATUS_DLL_MIGHT_BE_INCOMPATIBLE NTStatus = 0x8000002C + STATUS_STOPPED_ON_SYMLINK NTStatus = 0x8000002D + STATUS_CANNOT_GRANT_REQUESTED_OPLOCK NTStatus = 0x8000002E + STATUS_NO_ACE_CONDITION NTStatus = 0x8000002F + STATUS_DEVICE_SUPPORT_IN_PROGRESS NTStatus = 0x80000030 + STATUS_DEVICE_POWER_CYCLE_REQUIRED NTStatus = 0x80000031 + STATUS_NO_WORK_DONE NTStatus = 0x80000032 + STATUS_CLUSTER_NODE_ALREADY_UP NTStatus = 0x80130001 + STATUS_CLUSTER_NODE_ALREADY_DOWN NTStatus = 0x80130002 + STATUS_CLUSTER_NETWORK_ALREADY_ONLINE NTStatus = 0x80130003 + STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE NTStatus = 0x80130004 + STATUS_CLUSTER_NODE_ALREADY_MEMBER NTStatus = 0x80130005 + STATUS_FLT_BUFFER_TOO_SMALL NTStatus = 0x801C0001 + STATUS_FVE_PARTIAL_METADATA NTStatus = 0x80210001 + STATUS_FVE_TRANSIENT_STATE NTStatus = 0x80210002 + STATUS_CLOUD_FILE_PROPERTY_BLOB_CHECKSUM_MISMATCH NTStatus = 0x8000CF00 + STATUS_UNSUCCESSFUL NTStatus = 0xC0000001 + STATUS_NOT_IMPLEMENTED NTStatus = 0xC0000002 + STATUS_INVALID_INFO_CLASS NTStatus = 0xC0000003 + STATUS_INFO_LENGTH_MISMATCH NTStatus = 0xC0000004 + STATUS_ACCESS_VIOLATION NTStatus = 0xC0000005 + STATUS_IN_PAGE_ERROR NTStatus = 0xC0000006 + STATUS_PAGEFILE_QUOTA NTStatus = 0xC0000007 + STATUS_INVALID_HANDLE NTStatus = 0xC0000008 + STATUS_BAD_INITIAL_STACK NTStatus = 0xC0000009 + STATUS_BAD_INITIAL_PC NTStatus = 0xC000000A + STATUS_INVALID_CID NTStatus = 0xC000000B + STATUS_TIMER_NOT_CANCELED NTStatus = 0xC000000C + STATUS_INVALID_PARAMETER NTStatus = 0xC000000D + STATUS_NO_SUCH_DEVICE NTStatus = 0xC000000E + STATUS_NO_SUCH_FILE NTStatus = 0xC000000F + STATUS_INVALID_DEVICE_REQUEST NTStatus = 0xC0000010 + STATUS_END_OF_FILE NTStatus = 0xC0000011 + STATUS_WRONG_VOLUME NTStatus = 0xC0000012 + STATUS_NO_MEDIA_IN_DEVICE NTStatus = 0xC0000013 + STATUS_UNRECOGNIZED_MEDIA NTStatus = 0xC0000014 + STATUS_NONEXISTENT_SECTOR NTStatus = 0xC0000015 + STATUS_MORE_PROCESSING_REQUIRED NTStatus = 0xC0000016 + STATUS_NO_MEMORY NTStatus = 0xC0000017 + STATUS_CONFLICTING_ADDRESSES NTStatus = 0xC0000018 + STATUS_NOT_MAPPED_VIEW NTStatus = 0xC0000019 + STATUS_UNABLE_TO_FREE_VM NTStatus = 0xC000001A + STATUS_UNABLE_TO_DELETE_SECTION NTStatus = 0xC000001B + STATUS_INVALID_SYSTEM_SERVICE NTStatus = 0xC000001C + STATUS_ILLEGAL_INSTRUCTION NTStatus = 0xC000001D + STATUS_INVALID_LOCK_SEQUENCE NTStatus = 0xC000001E + STATUS_INVALID_VIEW_SIZE NTStatus = 0xC000001F + STATUS_INVALID_FILE_FOR_SECTION NTStatus = 0xC0000020 + STATUS_ALREADY_COMMITTED NTStatus = 0xC0000021 + STATUS_ACCESS_DENIED NTStatus = 0xC0000022 + STATUS_BUFFER_TOO_SMALL NTStatus = 0xC0000023 + STATUS_OBJECT_TYPE_MISMATCH NTStatus = 0xC0000024 + STATUS_NONCONTINUABLE_EXCEPTION NTStatus = 0xC0000025 + STATUS_INVALID_DISPOSITION NTStatus = 0xC0000026 + STATUS_UNWIND NTStatus = 0xC0000027 + STATUS_BAD_STACK NTStatus = 0xC0000028 + STATUS_INVALID_UNWIND_TARGET NTStatus = 0xC0000029 + STATUS_NOT_LOCKED NTStatus = 0xC000002A + STATUS_PARITY_ERROR NTStatus = 0xC000002B + STATUS_UNABLE_TO_DECOMMIT_VM NTStatus = 0xC000002C + STATUS_NOT_COMMITTED NTStatus = 0xC000002D + STATUS_INVALID_PORT_ATTRIBUTES NTStatus = 0xC000002E + STATUS_PORT_MESSAGE_TOO_LONG NTStatus = 0xC000002F + STATUS_INVALID_PARAMETER_MIX NTStatus = 0xC0000030 + STATUS_INVALID_QUOTA_LOWER NTStatus = 0xC0000031 + STATUS_DISK_CORRUPT_ERROR NTStatus = 0xC0000032 + STATUS_OBJECT_NAME_INVALID NTStatus = 0xC0000033 + STATUS_OBJECT_NAME_NOT_FOUND NTStatus = 0xC0000034 + STATUS_OBJECT_NAME_COLLISION NTStatus = 0xC0000035 + STATUS_PORT_DO_NOT_DISTURB NTStatus = 0xC0000036 + STATUS_PORT_DISCONNECTED NTStatus = 0xC0000037 + STATUS_DEVICE_ALREADY_ATTACHED NTStatus = 0xC0000038 + STATUS_OBJECT_PATH_INVALID NTStatus = 0xC0000039 + STATUS_OBJECT_PATH_NOT_FOUND NTStatus = 0xC000003A + STATUS_OBJECT_PATH_SYNTAX_BAD NTStatus = 0xC000003B + STATUS_DATA_OVERRUN NTStatus = 0xC000003C + STATUS_DATA_LATE_ERROR NTStatus = 0xC000003D + STATUS_DATA_ERROR NTStatus = 0xC000003E + STATUS_CRC_ERROR NTStatus = 0xC000003F + STATUS_SECTION_TOO_BIG NTStatus = 0xC0000040 + STATUS_PORT_CONNECTION_REFUSED NTStatus = 0xC0000041 + STATUS_INVALID_PORT_HANDLE NTStatus = 0xC0000042 + STATUS_SHARING_VIOLATION NTStatus = 0xC0000043 + STATUS_QUOTA_EXCEEDED NTStatus = 0xC0000044 + STATUS_INVALID_PAGE_PROTECTION NTStatus = 0xC0000045 + STATUS_MUTANT_NOT_OWNED NTStatus = 0xC0000046 + STATUS_SEMAPHORE_LIMIT_EXCEEDED NTStatus = 0xC0000047 + STATUS_PORT_ALREADY_SET NTStatus = 0xC0000048 + STATUS_SECTION_NOT_IMAGE NTStatus = 0xC0000049 + STATUS_SUSPEND_COUNT_EXCEEDED NTStatus = 0xC000004A + STATUS_THREAD_IS_TERMINATING NTStatus = 0xC000004B + STATUS_BAD_WORKING_SET_LIMIT NTStatus = 0xC000004C + STATUS_INCOMPATIBLE_FILE_MAP NTStatus = 0xC000004D + STATUS_SECTION_PROTECTION NTStatus = 0xC000004E + STATUS_EAS_NOT_SUPPORTED NTStatus = 0xC000004F + STATUS_EA_TOO_LARGE NTStatus = 0xC0000050 + STATUS_NONEXISTENT_EA_ENTRY NTStatus = 0xC0000051 + STATUS_NO_EAS_ON_FILE NTStatus = 0xC0000052 + STATUS_EA_CORRUPT_ERROR NTStatus = 0xC0000053 + STATUS_FILE_LOCK_CONFLICT NTStatus = 0xC0000054 + STATUS_LOCK_NOT_GRANTED NTStatus = 0xC0000055 + STATUS_DELETE_PENDING NTStatus = 0xC0000056 + STATUS_CTL_FILE_NOT_SUPPORTED NTStatus = 0xC0000057 + STATUS_UNKNOWN_REVISION NTStatus = 0xC0000058 + STATUS_REVISION_MISMATCH NTStatus = 0xC0000059 + STATUS_INVALID_OWNER NTStatus = 0xC000005A + STATUS_INVALID_PRIMARY_GROUP NTStatus = 0xC000005B + STATUS_NO_IMPERSONATION_TOKEN NTStatus = 0xC000005C + STATUS_CANT_DISABLE_MANDATORY NTStatus = 0xC000005D + STATUS_NO_LOGON_SERVERS NTStatus = 0xC000005E + STATUS_NO_SUCH_LOGON_SESSION NTStatus = 0xC000005F + STATUS_NO_SUCH_PRIVILEGE NTStatus = 0xC0000060 + STATUS_PRIVILEGE_NOT_HELD NTStatus = 0xC0000061 + STATUS_INVALID_ACCOUNT_NAME NTStatus = 0xC0000062 + STATUS_USER_EXISTS NTStatus = 0xC0000063 + STATUS_NO_SUCH_USER NTStatus = 0xC0000064 + STATUS_GROUP_EXISTS NTStatus = 0xC0000065 + STATUS_NO_SUCH_GROUP NTStatus = 0xC0000066 + STATUS_MEMBER_IN_GROUP NTStatus = 0xC0000067 + STATUS_MEMBER_NOT_IN_GROUP NTStatus = 0xC0000068 + STATUS_LAST_ADMIN NTStatus = 0xC0000069 + STATUS_WRONG_PASSWORD NTStatus = 0xC000006A + STATUS_ILL_FORMED_PASSWORD NTStatus = 0xC000006B + STATUS_PASSWORD_RESTRICTION NTStatus = 0xC000006C + STATUS_LOGON_FAILURE NTStatus = 0xC000006D + STATUS_ACCOUNT_RESTRICTION NTStatus = 0xC000006E + STATUS_INVALID_LOGON_HOURS NTStatus = 0xC000006F + STATUS_INVALID_WORKSTATION NTStatus = 0xC0000070 + STATUS_PASSWORD_EXPIRED NTStatus = 0xC0000071 + STATUS_ACCOUNT_DISABLED NTStatus = 0xC0000072 + STATUS_NONE_MAPPED NTStatus = 0xC0000073 + STATUS_TOO_MANY_LUIDS_REQUESTED NTStatus = 0xC0000074 + STATUS_LUIDS_EXHAUSTED NTStatus = 0xC0000075 + STATUS_INVALID_SUB_AUTHORITY NTStatus = 0xC0000076 + STATUS_INVALID_ACL NTStatus = 0xC0000077 + STATUS_INVALID_SID NTStatus = 0xC0000078 + STATUS_INVALID_SECURITY_DESCR NTStatus = 0xC0000079 + STATUS_PROCEDURE_NOT_FOUND NTStatus = 0xC000007A + STATUS_INVALID_IMAGE_FORMAT NTStatus = 0xC000007B + STATUS_NO_TOKEN NTStatus = 0xC000007C + STATUS_BAD_INHERITANCE_ACL NTStatus = 0xC000007D + STATUS_RANGE_NOT_LOCKED NTStatus = 0xC000007E + STATUS_DISK_FULL NTStatus = 0xC000007F + STATUS_SERVER_DISABLED NTStatus = 0xC0000080 + STATUS_SERVER_NOT_DISABLED NTStatus = 0xC0000081 + STATUS_TOO_MANY_GUIDS_REQUESTED NTStatus = 0xC0000082 + STATUS_GUIDS_EXHAUSTED NTStatus = 0xC0000083 + STATUS_INVALID_ID_AUTHORITY NTStatus = 0xC0000084 + STATUS_AGENTS_EXHAUSTED NTStatus = 0xC0000085 + STATUS_INVALID_VOLUME_LABEL NTStatus = 0xC0000086 + STATUS_SECTION_NOT_EXTENDED NTStatus = 0xC0000087 + STATUS_NOT_MAPPED_DATA NTStatus = 0xC0000088 + STATUS_RESOURCE_DATA_NOT_FOUND NTStatus = 0xC0000089 + STATUS_RESOURCE_TYPE_NOT_FOUND NTStatus = 0xC000008A + STATUS_RESOURCE_NAME_NOT_FOUND NTStatus = 0xC000008B + STATUS_ARRAY_BOUNDS_EXCEEDED NTStatus = 0xC000008C + STATUS_FLOAT_DENORMAL_OPERAND NTStatus = 0xC000008D + STATUS_FLOAT_DIVIDE_BY_ZERO NTStatus = 0xC000008E + STATUS_FLOAT_INEXACT_RESULT NTStatus = 0xC000008F + STATUS_FLOAT_INVALID_OPERATION NTStatus = 0xC0000090 + STATUS_FLOAT_OVERFLOW NTStatus = 0xC0000091 + STATUS_FLOAT_STACK_CHECK NTStatus = 0xC0000092 + STATUS_FLOAT_UNDERFLOW NTStatus = 0xC0000093 + STATUS_INTEGER_DIVIDE_BY_ZERO NTStatus = 0xC0000094 + STATUS_INTEGER_OVERFLOW NTStatus = 0xC0000095 + STATUS_PRIVILEGED_INSTRUCTION NTStatus = 0xC0000096 + STATUS_TOO_MANY_PAGING_FILES NTStatus = 0xC0000097 + STATUS_FILE_INVALID NTStatus = 0xC0000098 + STATUS_ALLOTTED_SPACE_EXCEEDED NTStatus = 0xC0000099 + STATUS_INSUFFICIENT_RESOURCES NTStatus = 0xC000009A + STATUS_DFS_EXIT_PATH_FOUND NTStatus = 0xC000009B + STATUS_DEVICE_DATA_ERROR NTStatus = 0xC000009C + STATUS_DEVICE_NOT_CONNECTED NTStatus = 0xC000009D + STATUS_DEVICE_POWER_FAILURE NTStatus = 0xC000009E + STATUS_FREE_VM_NOT_AT_BASE NTStatus = 0xC000009F + STATUS_MEMORY_NOT_ALLOCATED NTStatus = 0xC00000A0 + STATUS_WORKING_SET_QUOTA NTStatus = 0xC00000A1 + STATUS_MEDIA_WRITE_PROTECTED NTStatus = 0xC00000A2 + STATUS_DEVICE_NOT_READY NTStatus = 0xC00000A3 + STATUS_INVALID_GROUP_ATTRIBUTES NTStatus = 0xC00000A4 + STATUS_BAD_IMPERSONATION_LEVEL NTStatus = 0xC00000A5 + STATUS_CANT_OPEN_ANONYMOUS NTStatus = 0xC00000A6 + STATUS_BAD_VALIDATION_CLASS NTStatus = 0xC00000A7 + STATUS_BAD_TOKEN_TYPE NTStatus = 0xC00000A8 + STATUS_BAD_MASTER_BOOT_RECORD NTStatus = 0xC00000A9 + STATUS_INSTRUCTION_MISALIGNMENT NTStatus = 0xC00000AA + STATUS_INSTANCE_NOT_AVAILABLE NTStatus = 0xC00000AB + STATUS_PIPE_NOT_AVAILABLE NTStatus = 0xC00000AC + STATUS_INVALID_PIPE_STATE NTStatus = 0xC00000AD + STATUS_PIPE_BUSY NTStatus = 0xC00000AE + STATUS_ILLEGAL_FUNCTION NTStatus = 0xC00000AF + STATUS_PIPE_DISCONNECTED NTStatus = 0xC00000B0 + STATUS_PIPE_CLOSING NTStatus = 0xC00000B1 + STATUS_PIPE_CONNECTED NTStatus = 0xC00000B2 + STATUS_PIPE_LISTENING NTStatus = 0xC00000B3 + STATUS_INVALID_READ_MODE NTStatus = 0xC00000B4 + STATUS_IO_TIMEOUT NTStatus = 0xC00000B5 + STATUS_FILE_FORCED_CLOSED NTStatus = 0xC00000B6 + STATUS_PROFILING_NOT_STARTED NTStatus = 0xC00000B7 + STATUS_PROFILING_NOT_STOPPED NTStatus = 0xC00000B8 + STATUS_COULD_NOT_INTERPRET NTStatus = 0xC00000B9 + STATUS_FILE_IS_A_DIRECTORY NTStatus = 0xC00000BA + STATUS_NOT_SUPPORTED NTStatus = 0xC00000BB + STATUS_REMOTE_NOT_LISTENING NTStatus = 0xC00000BC + STATUS_DUPLICATE_NAME NTStatus = 0xC00000BD + STATUS_BAD_NETWORK_PATH NTStatus = 0xC00000BE + STATUS_NETWORK_BUSY NTStatus = 0xC00000BF + STATUS_DEVICE_DOES_NOT_EXIST NTStatus = 0xC00000C0 + STATUS_TOO_MANY_COMMANDS NTStatus = 0xC00000C1 + STATUS_ADAPTER_HARDWARE_ERROR NTStatus = 0xC00000C2 + STATUS_INVALID_NETWORK_RESPONSE NTStatus = 0xC00000C3 + STATUS_UNEXPECTED_NETWORK_ERROR NTStatus = 0xC00000C4 + STATUS_BAD_REMOTE_ADAPTER NTStatus = 0xC00000C5 + STATUS_PRINT_QUEUE_FULL NTStatus = 0xC00000C6 + STATUS_NO_SPOOL_SPACE NTStatus = 0xC00000C7 + STATUS_PRINT_CANCELLED NTStatus = 0xC00000C8 + STATUS_NETWORK_NAME_DELETED NTStatus = 0xC00000C9 + STATUS_NETWORK_ACCESS_DENIED NTStatus = 0xC00000CA + STATUS_BAD_DEVICE_TYPE NTStatus = 0xC00000CB + STATUS_BAD_NETWORK_NAME NTStatus = 0xC00000CC + STATUS_TOO_MANY_NAMES NTStatus = 0xC00000CD + STATUS_TOO_MANY_SESSIONS NTStatus = 0xC00000CE + STATUS_SHARING_PAUSED NTStatus = 0xC00000CF + STATUS_REQUEST_NOT_ACCEPTED NTStatus = 0xC00000D0 + STATUS_REDIRECTOR_PAUSED NTStatus = 0xC00000D1 + STATUS_NET_WRITE_FAULT NTStatus = 0xC00000D2 + STATUS_PROFILING_AT_LIMIT NTStatus = 0xC00000D3 + STATUS_NOT_SAME_DEVICE NTStatus = 0xC00000D4 + STATUS_FILE_RENAMED NTStatus = 0xC00000D5 + STATUS_VIRTUAL_CIRCUIT_CLOSED NTStatus = 0xC00000D6 + STATUS_NO_SECURITY_ON_OBJECT NTStatus = 0xC00000D7 + STATUS_CANT_WAIT NTStatus = 0xC00000D8 + STATUS_PIPE_EMPTY NTStatus = 0xC00000D9 + STATUS_CANT_ACCESS_DOMAIN_INFO NTStatus = 0xC00000DA + STATUS_CANT_TERMINATE_SELF NTStatus = 0xC00000DB + STATUS_INVALID_SERVER_STATE NTStatus = 0xC00000DC + STATUS_INVALID_DOMAIN_STATE NTStatus = 0xC00000DD + STATUS_INVALID_DOMAIN_ROLE NTStatus = 0xC00000DE + STATUS_NO_SUCH_DOMAIN NTStatus = 0xC00000DF + STATUS_DOMAIN_EXISTS NTStatus = 0xC00000E0 + STATUS_DOMAIN_LIMIT_EXCEEDED NTStatus = 0xC00000E1 + STATUS_OPLOCK_NOT_GRANTED NTStatus = 0xC00000E2 + STATUS_INVALID_OPLOCK_PROTOCOL NTStatus = 0xC00000E3 + STATUS_INTERNAL_DB_CORRUPTION NTStatus = 0xC00000E4 + STATUS_INTERNAL_ERROR NTStatus = 0xC00000E5 + STATUS_GENERIC_NOT_MAPPED NTStatus = 0xC00000E6 + STATUS_BAD_DESCRIPTOR_FORMAT NTStatus = 0xC00000E7 + STATUS_INVALID_USER_BUFFER NTStatus = 0xC00000E8 + STATUS_UNEXPECTED_IO_ERROR NTStatus = 0xC00000E9 + STATUS_UNEXPECTED_MM_CREATE_ERR NTStatus = 0xC00000EA + STATUS_UNEXPECTED_MM_MAP_ERROR NTStatus = 0xC00000EB + STATUS_UNEXPECTED_MM_EXTEND_ERR NTStatus = 0xC00000EC + STATUS_NOT_LOGON_PROCESS NTStatus = 0xC00000ED + STATUS_LOGON_SESSION_EXISTS NTStatus = 0xC00000EE + STATUS_INVALID_PARAMETER_1 NTStatus = 0xC00000EF + STATUS_INVALID_PARAMETER_2 NTStatus = 0xC00000F0 + STATUS_INVALID_PARAMETER_3 NTStatus = 0xC00000F1 + STATUS_INVALID_PARAMETER_4 NTStatus = 0xC00000F2 + STATUS_INVALID_PARAMETER_5 NTStatus = 0xC00000F3 + STATUS_INVALID_PARAMETER_6 NTStatus = 0xC00000F4 + STATUS_INVALID_PARAMETER_7 NTStatus = 0xC00000F5 + STATUS_INVALID_PARAMETER_8 NTStatus = 0xC00000F6 + STATUS_INVALID_PARAMETER_9 NTStatus = 0xC00000F7 + STATUS_INVALID_PARAMETER_10 NTStatus = 0xC00000F8 + STATUS_INVALID_PARAMETER_11 NTStatus = 0xC00000F9 + STATUS_INVALID_PARAMETER_12 NTStatus = 0xC00000FA + STATUS_REDIRECTOR_NOT_STARTED NTStatus = 0xC00000FB + STATUS_REDIRECTOR_STARTED NTStatus = 0xC00000FC + STATUS_STACK_OVERFLOW NTStatus = 0xC00000FD + STATUS_NO_SUCH_PACKAGE NTStatus = 0xC00000FE + STATUS_BAD_FUNCTION_TABLE NTStatus = 0xC00000FF + STATUS_VARIABLE_NOT_FOUND NTStatus = 0xC0000100 + STATUS_DIRECTORY_NOT_EMPTY NTStatus = 0xC0000101 + STATUS_FILE_CORRUPT_ERROR NTStatus = 0xC0000102 + STATUS_NOT_A_DIRECTORY NTStatus = 0xC0000103 + STATUS_BAD_LOGON_SESSION_STATE NTStatus = 0xC0000104 + STATUS_LOGON_SESSION_COLLISION NTStatus = 0xC0000105 + STATUS_NAME_TOO_LONG NTStatus = 0xC0000106 + STATUS_FILES_OPEN NTStatus = 0xC0000107 + STATUS_CONNECTION_IN_USE NTStatus = 0xC0000108 + STATUS_MESSAGE_NOT_FOUND NTStatus = 0xC0000109 + STATUS_PROCESS_IS_TERMINATING NTStatus = 0xC000010A + STATUS_INVALID_LOGON_TYPE NTStatus = 0xC000010B + STATUS_NO_GUID_TRANSLATION NTStatus = 0xC000010C + STATUS_CANNOT_IMPERSONATE NTStatus = 0xC000010D + STATUS_IMAGE_ALREADY_LOADED NTStatus = 0xC000010E + STATUS_ABIOS_NOT_PRESENT NTStatus = 0xC000010F + STATUS_ABIOS_LID_NOT_EXIST NTStatus = 0xC0000110 + STATUS_ABIOS_LID_ALREADY_OWNED NTStatus = 0xC0000111 + STATUS_ABIOS_NOT_LID_OWNER NTStatus = 0xC0000112 + STATUS_ABIOS_INVALID_COMMAND NTStatus = 0xC0000113 + STATUS_ABIOS_INVALID_LID NTStatus = 0xC0000114 + STATUS_ABIOS_SELECTOR_NOT_AVAILABLE NTStatus = 0xC0000115 + STATUS_ABIOS_INVALID_SELECTOR NTStatus = 0xC0000116 + STATUS_NO_LDT NTStatus = 0xC0000117 + STATUS_INVALID_LDT_SIZE NTStatus = 0xC0000118 + STATUS_INVALID_LDT_OFFSET NTStatus = 0xC0000119 + STATUS_INVALID_LDT_DESCRIPTOR NTStatus = 0xC000011A + STATUS_INVALID_IMAGE_NE_FORMAT NTStatus = 0xC000011B + STATUS_RXACT_INVALID_STATE NTStatus = 0xC000011C + STATUS_RXACT_COMMIT_FAILURE NTStatus = 0xC000011D + STATUS_MAPPED_FILE_SIZE_ZERO NTStatus = 0xC000011E + STATUS_TOO_MANY_OPENED_FILES NTStatus = 0xC000011F + STATUS_CANCELLED NTStatus = 0xC0000120 + STATUS_CANNOT_DELETE NTStatus = 0xC0000121 + STATUS_INVALID_COMPUTER_NAME NTStatus = 0xC0000122 + STATUS_FILE_DELETED NTStatus = 0xC0000123 + STATUS_SPECIAL_ACCOUNT NTStatus = 0xC0000124 + STATUS_SPECIAL_GROUP NTStatus = 0xC0000125 + STATUS_SPECIAL_USER NTStatus = 0xC0000126 + STATUS_MEMBERS_PRIMARY_GROUP NTStatus = 0xC0000127 + STATUS_FILE_CLOSED NTStatus = 0xC0000128 + STATUS_TOO_MANY_THREADS NTStatus = 0xC0000129 + STATUS_THREAD_NOT_IN_PROCESS NTStatus = 0xC000012A + STATUS_TOKEN_ALREADY_IN_USE NTStatus = 0xC000012B + STATUS_PAGEFILE_QUOTA_EXCEEDED NTStatus = 0xC000012C + STATUS_COMMITMENT_LIMIT NTStatus = 0xC000012D + STATUS_INVALID_IMAGE_LE_FORMAT NTStatus = 0xC000012E + STATUS_INVALID_IMAGE_NOT_MZ NTStatus = 0xC000012F + STATUS_INVALID_IMAGE_PROTECT NTStatus = 0xC0000130 + STATUS_INVALID_IMAGE_WIN_16 NTStatus = 0xC0000131 + STATUS_LOGON_SERVER_CONFLICT NTStatus = 0xC0000132 + STATUS_TIME_DIFFERENCE_AT_DC NTStatus = 0xC0000133 + STATUS_SYNCHRONIZATION_REQUIRED NTStatus = 0xC0000134 + STATUS_DLL_NOT_FOUND NTStatus = 0xC0000135 + STATUS_OPEN_FAILED NTStatus = 0xC0000136 + STATUS_IO_PRIVILEGE_FAILED NTStatus = 0xC0000137 + STATUS_ORDINAL_NOT_FOUND NTStatus = 0xC0000138 + STATUS_ENTRYPOINT_NOT_FOUND NTStatus = 0xC0000139 + STATUS_CONTROL_C_EXIT NTStatus = 0xC000013A + STATUS_LOCAL_DISCONNECT NTStatus = 0xC000013B + STATUS_REMOTE_DISCONNECT NTStatus = 0xC000013C + STATUS_REMOTE_RESOURCES NTStatus = 0xC000013D + STATUS_LINK_FAILED NTStatus = 0xC000013E + STATUS_LINK_TIMEOUT NTStatus = 0xC000013F + STATUS_INVALID_CONNECTION NTStatus = 0xC0000140 + STATUS_INVALID_ADDRESS NTStatus = 0xC0000141 + STATUS_DLL_INIT_FAILED NTStatus = 0xC0000142 + STATUS_MISSING_SYSTEMFILE NTStatus = 0xC0000143 + STATUS_UNHANDLED_EXCEPTION NTStatus = 0xC0000144 + STATUS_APP_INIT_FAILURE NTStatus = 0xC0000145 + STATUS_PAGEFILE_CREATE_FAILED NTStatus = 0xC0000146 + STATUS_NO_PAGEFILE NTStatus = 0xC0000147 + STATUS_INVALID_LEVEL NTStatus = 0xC0000148 + STATUS_WRONG_PASSWORD_CORE NTStatus = 0xC0000149 + STATUS_ILLEGAL_FLOAT_CONTEXT NTStatus = 0xC000014A + STATUS_PIPE_BROKEN NTStatus = 0xC000014B + STATUS_REGISTRY_CORRUPT NTStatus = 0xC000014C + STATUS_REGISTRY_IO_FAILED NTStatus = 0xC000014D + STATUS_NO_EVENT_PAIR NTStatus = 0xC000014E + STATUS_UNRECOGNIZED_VOLUME NTStatus = 0xC000014F + STATUS_SERIAL_NO_DEVICE_INITED NTStatus = 0xC0000150 + STATUS_NO_SUCH_ALIAS NTStatus = 0xC0000151 + STATUS_MEMBER_NOT_IN_ALIAS NTStatus = 0xC0000152 + STATUS_MEMBER_IN_ALIAS NTStatus = 0xC0000153 + STATUS_ALIAS_EXISTS NTStatus = 0xC0000154 + STATUS_LOGON_NOT_GRANTED NTStatus = 0xC0000155 + STATUS_TOO_MANY_SECRETS NTStatus = 0xC0000156 + STATUS_SECRET_TOO_LONG NTStatus = 0xC0000157 + STATUS_INTERNAL_DB_ERROR NTStatus = 0xC0000158 + STATUS_FULLSCREEN_MODE NTStatus = 0xC0000159 + STATUS_TOO_MANY_CONTEXT_IDS NTStatus = 0xC000015A + STATUS_LOGON_TYPE_NOT_GRANTED NTStatus = 0xC000015B + STATUS_NOT_REGISTRY_FILE NTStatus = 0xC000015C + STATUS_NT_CROSS_ENCRYPTION_REQUIRED NTStatus = 0xC000015D + STATUS_DOMAIN_CTRLR_CONFIG_ERROR NTStatus = 0xC000015E + STATUS_FT_MISSING_MEMBER NTStatus = 0xC000015F + STATUS_ILL_FORMED_SERVICE_ENTRY NTStatus = 0xC0000160 + STATUS_ILLEGAL_CHARACTER NTStatus = 0xC0000161 + STATUS_UNMAPPABLE_CHARACTER NTStatus = 0xC0000162 + STATUS_UNDEFINED_CHARACTER NTStatus = 0xC0000163 + STATUS_FLOPPY_VOLUME NTStatus = 0xC0000164 + STATUS_FLOPPY_ID_MARK_NOT_FOUND NTStatus = 0xC0000165 + STATUS_FLOPPY_WRONG_CYLINDER NTStatus = 0xC0000166 + STATUS_FLOPPY_UNKNOWN_ERROR NTStatus = 0xC0000167 + STATUS_FLOPPY_BAD_REGISTERS NTStatus = 0xC0000168 + STATUS_DISK_RECALIBRATE_FAILED NTStatus = 0xC0000169 + STATUS_DISK_OPERATION_FAILED NTStatus = 0xC000016A + STATUS_DISK_RESET_FAILED NTStatus = 0xC000016B + STATUS_SHARED_IRQ_BUSY NTStatus = 0xC000016C + STATUS_FT_ORPHANING NTStatus = 0xC000016D + STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT NTStatus = 0xC000016E + STATUS_PARTITION_FAILURE NTStatus = 0xC0000172 + STATUS_INVALID_BLOCK_LENGTH NTStatus = 0xC0000173 + STATUS_DEVICE_NOT_PARTITIONED NTStatus = 0xC0000174 + STATUS_UNABLE_TO_LOCK_MEDIA NTStatus = 0xC0000175 + STATUS_UNABLE_TO_UNLOAD_MEDIA NTStatus = 0xC0000176 + STATUS_EOM_OVERFLOW NTStatus = 0xC0000177 + STATUS_NO_MEDIA NTStatus = 0xC0000178 + STATUS_NO_SUCH_MEMBER NTStatus = 0xC000017A + STATUS_INVALID_MEMBER NTStatus = 0xC000017B + STATUS_KEY_DELETED NTStatus = 0xC000017C + STATUS_NO_LOG_SPACE NTStatus = 0xC000017D + STATUS_TOO_MANY_SIDS NTStatus = 0xC000017E + STATUS_LM_CROSS_ENCRYPTION_REQUIRED NTStatus = 0xC000017F + STATUS_KEY_HAS_CHILDREN NTStatus = 0xC0000180 + STATUS_CHILD_MUST_BE_VOLATILE NTStatus = 0xC0000181 + STATUS_DEVICE_CONFIGURATION_ERROR NTStatus = 0xC0000182 + STATUS_DRIVER_INTERNAL_ERROR NTStatus = 0xC0000183 + STATUS_INVALID_DEVICE_STATE NTStatus = 0xC0000184 + STATUS_IO_DEVICE_ERROR NTStatus = 0xC0000185 + STATUS_DEVICE_PROTOCOL_ERROR NTStatus = 0xC0000186 + STATUS_BACKUP_CONTROLLER NTStatus = 0xC0000187 + STATUS_LOG_FILE_FULL NTStatus = 0xC0000188 + STATUS_TOO_LATE NTStatus = 0xC0000189 + STATUS_NO_TRUST_LSA_SECRET NTStatus = 0xC000018A + STATUS_NO_TRUST_SAM_ACCOUNT NTStatus = 0xC000018B + STATUS_TRUSTED_DOMAIN_FAILURE NTStatus = 0xC000018C + STATUS_TRUSTED_RELATIONSHIP_FAILURE NTStatus = 0xC000018D + STATUS_EVENTLOG_FILE_CORRUPT NTStatus = 0xC000018E + STATUS_EVENTLOG_CANT_START NTStatus = 0xC000018F + STATUS_TRUST_FAILURE NTStatus = 0xC0000190 + STATUS_MUTANT_LIMIT_EXCEEDED NTStatus = 0xC0000191 + STATUS_NETLOGON_NOT_STARTED NTStatus = 0xC0000192 + STATUS_ACCOUNT_EXPIRED NTStatus = 0xC0000193 + STATUS_POSSIBLE_DEADLOCK NTStatus = 0xC0000194 + STATUS_NETWORK_CREDENTIAL_CONFLICT NTStatus = 0xC0000195 + STATUS_REMOTE_SESSION_LIMIT NTStatus = 0xC0000196 + STATUS_EVENTLOG_FILE_CHANGED NTStatus = 0xC0000197 + STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT NTStatus = 0xC0000198 + STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT NTStatus = 0xC0000199 + STATUS_NOLOGON_SERVER_TRUST_ACCOUNT NTStatus = 0xC000019A + STATUS_DOMAIN_TRUST_INCONSISTENT NTStatus = 0xC000019B + STATUS_FS_DRIVER_REQUIRED NTStatus = 0xC000019C + STATUS_IMAGE_ALREADY_LOADED_AS_DLL NTStatus = 0xC000019D + STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING NTStatus = 0xC000019E + STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME NTStatus = 0xC000019F + STATUS_SECURITY_STREAM_IS_INCONSISTENT NTStatus = 0xC00001A0 + STATUS_INVALID_LOCK_RANGE NTStatus = 0xC00001A1 + STATUS_INVALID_ACE_CONDITION NTStatus = 0xC00001A2 + STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT NTStatus = 0xC00001A3 + STATUS_NOTIFICATION_GUID_ALREADY_DEFINED NTStatus = 0xC00001A4 + STATUS_INVALID_EXCEPTION_HANDLER NTStatus = 0xC00001A5 + STATUS_DUPLICATE_PRIVILEGES NTStatus = 0xC00001A6 + STATUS_NOT_ALLOWED_ON_SYSTEM_FILE NTStatus = 0xC00001A7 + STATUS_REPAIR_NEEDED NTStatus = 0xC00001A8 + STATUS_QUOTA_NOT_ENABLED NTStatus = 0xC00001A9 + STATUS_NO_APPLICATION_PACKAGE NTStatus = 0xC00001AA + STATUS_FILE_METADATA_OPTIMIZATION_IN_PROGRESS NTStatus = 0xC00001AB + STATUS_NOT_SAME_OBJECT NTStatus = 0xC00001AC + STATUS_FATAL_MEMORY_EXHAUSTION NTStatus = 0xC00001AD + STATUS_ERROR_PROCESS_NOT_IN_JOB NTStatus = 0xC00001AE + STATUS_CPU_SET_INVALID NTStatus = 0xC00001AF + STATUS_IO_DEVICE_INVALID_DATA NTStatus = 0xC00001B0 + STATUS_IO_UNALIGNED_WRITE NTStatus = 0xC00001B1 + STATUS_NETWORK_OPEN_RESTRICTION NTStatus = 0xC0000201 + STATUS_NO_USER_SESSION_KEY NTStatus = 0xC0000202 + STATUS_USER_SESSION_DELETED NTStatus = 0xC0000203 + STATUS_RESOURCE_LANG_NOT_FOUND NTStatus = 0xC0000204 + STATUS_INSUFF_SERVER_RESOURCES NTStatus = 0xC0000205 + STATUS_INVALID_BUFFER_SIZE NTStatus = 0xC0000206 + STATUS_INVALID_ADDRESS_COMPONENT NTStatus = 0xC0000207 + STATUS_INVALID_ADDRESS_WILDCARD NTStatus = 0xC0000208 + STATUS_TOO_MANY_ADDRESSES NTStatus = 0xC0000209 + STATUS_ADDRESS_ALREADY_EXISTS NTStatus = 0xC000020A + STATUS_ADDRESS_CLOSED NTStatus = 0xC000020B + STATUS_CONNECTION_DISCONNECTED NTStatus = 0xC000020C + STATUS_CONNECTION_RESET NTStatus = 0xC000020D + STATUS_TOO_MANY_NODES NTStatus = 0xC000020E + STATUS_TRANSACTION_ABORTED NTStatus = 0xC000020F + STATUS_TRANSACTION_TIMED_OUT NTStatus = 0xC0000210 + STATUS_TRANSACTION_NO_RELEASE NTStatus = 0xC0000211 + STATUS_TRANSACTION_NO_MATCH NTStatus = 0xC0000212 + STATUS_TRANSACTION_RESPONDED NTStatus = 0xC0000213 + STATUS_TRANSACTION_INVALID_ID NTStatus = 0xC0000214 + STATUS_TRANSACTION_INVALID_TYPE NTStatus = 0xC0000215 + STATUS_NOT_SERVER_SESSION NTStatus = 0xC0000216 + STATUS_NOT_CLIENT_SESSION NTStatus = 0xC0000217 + STATUS_CANNOT_LOAD_REGISTRY_FILE NTStatus = 0xC0000218 + STATUS_DEBUG_ATTACH_FAILED NTStatus = 0xC0000219 + STATUS_SYSTEM_PROCESS_TERMINATED NTStatus = 0xC000021A + STATUS_DATA_NOT_ACCEPTED NTStatus = 0xC000021B + STATUS_NO_BROWSER_SERVERS_FOUND NTStatus = 0xC000021C + STATUS_VDM_HARD_ERROR NTStatus = 0xC000021D + STATUS_DRIVER_CANCEL_TIMEOUT NTStatus = 0xC000021E + STATUS_REPLY_MESSAGE_MISMATCH NTStatus = 0xC000021F + STATUS_MAPPED_ALIGNMENT NTStatus = 0xC0000220 + STATUS_IMAGE_CHECKSUM_MISMATCH NTStatus = 0xC0000221 + STATUS_LOST_WRITEBEHIND_DATA NTStatus = 0xC0000222 + STATUS_CLIENT_SERVER_PARAMETERS_INVALID NTStatus = 0xC0000223 + STATUS_PASSWORD_MUST_CHANGE NTStatus = 0xC0000224 + STATUS_NOT_FOUND NTStatus = 0xC0000225 + STATUS_NOT_TINY_STREAM NTStatus = 0xC0000226 + STATUS_RECOVERY_FAILURE NTStatus = 0xC0000227 + STATUS_STACK_OVERFLOW_READ NTStatus = 0xC0000228 + STATUS_FAIL_CHECK NTStatus = 0xC0000229 + STATUS_DUPLICATE_OBJECTID NTStatus = 0xC000022A + STATUS_OBJECTID_EXISTS NTStatus = 0xC000022B + STATUS_CONVERT_TO_LARGE NTStatus = 0xC000022C + STATUS_RETRY NTStatus = 0xC000022D + STATUS_FOUND_OUT_OF_SCOPE NTStatus = 0xC000022E + STATUS_ALLOCATE_BUCKET NTStatus = 0xC000022F + STATUS_PROPSET_NOT_FOUND NTStatus = 0xC0000230 + STATUS_MARSHALL_OVERFLOW NTStatus = 0xC0000231 + STATUS_INVALID_VARIANT NTStatus = 0xC0000232 + STATUS_DOMAIN_CONTROLLER_NOT_FOUND NTStatus = 0xC0000233 + STATUS_ACCOUNT_LOCKED_OUT NTStatus = 0xC0000234 + STATUS_HANDLE_NOT_CLOSABLE NTStatus = 0xC0000235 + STATUS_CONNECTION_REFUSED NTStatus = 0xC0000236 + STATUS_GRACEFUL_DISCONNECT NTStatus = 0xC0000237 + STATUS_ADDRESS_ALREADY_ASSOCIATED NTStatus = 0xC0000238 + STATUS_ADDRESS_NOT_ASSOCIATED NTStatus = 0xC0000239 + STATUS_CONNECTION_INVALID NTStatus = 0xC000023A + STATUS_CONNECTION_ACTIVE NTStatus = 0xC000023B + STATUS_NETWORK_UNREACHABLE NTStatus = 0xC000023C + STATUS_HOST_UNREACHABLE NTStatus = 0xC000023D + STATUS_PROTOCOL_UNREACHABLE NTStatus = 0xC000023E + STATUS_PORT_UNREACHABLE NTStatus = 0xC000023F + STATUS_REQUEST_ABORTED NTStatus = 0xC0000240 + STATUS_CONNECTION_ABORTED NTStatus = 0xC0000241 + STATUS_BAD_COMPRESSION_BUFFER NTStatus = 0xC0000242 + STATUS_USER_MAPPED_FILE NTStatus = 0xC0000243 + STATUS_AUDIT_FAILED NTStatus = 0xC0000244 + STATUS_TIMER_RESOLUTION_NOT_SET NTStatus = 0xC0000245 + STATUS_CONNECTION_COUNT_LIMIT NTStatus = 0xC0000246 + STATUS_LOGIN_TIME_RESTRICTION NTStatus = 0xC0000247 + STATUS_LOGIN_WKSTA_RESTRICTION NTStatus = 0xC0000248 + STATUS_IMAGE_MP_UP_MISMATCH NTStatus = 0xC0000249 + STATUS_INSUFFICIENT_LOGON_INFO NTStatus = 0xC0000250 + STATUS_BAD_DLL_ENTRYPOINT NTStatus = 0xC0000251 + STATUS_BAD_SERVICE_ENTRYPOINT NTStatus = 0xC0000252 + STATUS_LPC_REPLY_LOST NTStatus = 0xC0000253 + STATUS_IP_ADDRESS_CONFLICT1 NTStatus = 0xC0000254 + STATUS_IP_ADDRESS_CONFLICT2 NTStatus = 0xC0000255 + STATUS_REGISTRY_QUOTA_LIMIT NTStatus = 0xC0000256 + STATUS_PATH_NOT_COVERED NTStatus = 0xC0000257 + STATUS_NO_CALLBACK_ACTIVE NTStatus = 0xC0000258 + STATUS_LICENSE_QUOTA_EXCEEDED NTStatus = 0xC0000259 + STATUS_PWD_TOO_SHORT NTStatus = 0xC000025A + STATUS_PWD_TOO_RECENT NTStatus = 0xC000025B + STATUS_PWD_HISTORY_CONFLICT NTStatus = 0xC000025C + STATUS_PLUGPLAY_NO_DEVICE NTStatus = 0xC000025E + STATUS_UNSUPPORTED_COMPRESSION NTStatus = 0xC000025F + STATUS_INVALID_HW_PROFILE NTStatus = 0xC0000260 + STATUS_INVALID_PLUGPLAY_DEVICE_PATH NTStatus = 0xC0000261 + STATUS_DRIVER_ORDINAL_NOT_FOUND NTStatus = 0xC0000262 + STATUS_DRIVER_ENTRYPOINT_NOT_FOUND NTStatus = 0xC0000263 + STATUS_RESOURCE_NOT_OWNED NTStatus = 0xC0000264 + STATUS_TOO_MANY_LINKS NTStatus = 0xC0000265 + STATUS_QUOTA_LIST_INCONSISTENT NTStatus = 0xC0000266 + STATUS_FILE_IS_OFFLINE NTStatus = 0xC0000267 + STATUS_EVALUATION_EXPIRATION NTStatus = 0xC0000268 + STATUS_ILLEGAL_DLL_RELOCATION NTStatus = 0xC0000269 + STATUS_LICENSE_VIOLATION NTStatus = 0xC000026A + STATUS_DLL_INIT_FAILED_LOGOFF NTStatus = 0xC000026B + STATUS_DRIVER_UNABLE_TO_LOAD NTStatus = 0xC000026C + STATUS_DFS_UNAVAILABLE NTStatus = 0xC000026D + STATUS_VOLUME_DISMOUNTED NTStatus = 0xC000026E + STATUS_WX86_INTERNAL_ERROR NTStatus = 0xC000026F + STATUS_WX86_FLOAT_STACK_CHECK NTStatus = 0xC0000270 + STATUS_VALIDATE_CONTINUE NTStatus = 0xC0000271 + STATUS_NO_MATCH NTStatus = 0xC0000272 + STATUS_NO_MORE_MATCHES NTStatus = 0xC0000273 + STATUS_NOT_A_REPARSE_POINT NTStatus = 0xC0000275 + STATUS_IO_REPARSE_TAG_INVALID NTStatus = 0xC0000276 + STATUS_IO_REPARSE_TAG_MISMATCH NTStatus = 0xC0000277 + STATUS_IO_REPARSE_DATA_INVALID NTStatus = 0xC0000278 + STATUS_IO_REPARSE_TAG_NOT_HANDLED NTStatus = 0xC0000279 + STATUS_PWD_TOO_LONG NTStatus = 0xC000027A + STATUS_STOWED_EXCEPTION NTStatus = 0xC000027B + STATUS_CONTEXT_STOWED_EXCEPTION NTStatus = 0xC000027C + STATUS_REPARSE_POINT_NOT_RESOLVED NTStatus = 0xC0000280 + STATUS_DIRECTORY_IS_A_REPARSE_POINT NTStatus = 0xC0000281 + STATUS_RANGE_LIST_CONFLICT NTStatus = 0xC0000282 + STATUS_SOURCE_ELEMENT_EMPTY NTStatus = 0xC0000283 + STATUS_DESTINATION_ELEMENT_FULL NTStatus = 0xC0000284 + STATUS_ILLEGAL_ELEMENT_ADDRESS NTStatus = 0xC0000285 + STATUS_MAGAZINE_NOT_PRESENT NTStatus = 0xC0000286 + STATUS_REINITIALIZATION_NEEDED NTStatus = 0xC0000287 + STATUS_DEVICE_REQUIRES_CLEANING NTStatus = 0x80000288 + STATUS_DEVICE_DOOR_OPEN NTStatus = 0x80000289 + STATUS_ENCRYPTION_FAILED NTStatus = 0xC000028A + STATUS_DECRYPTION_FAILED NTStatus = 0xC000028B + STATUS_RANGE_NOT_FOUND NTStatus = 0xC000028C + STATUS_NO_RECOVERY_POLICY NTStatus = 0xC000028D + STATUS_NO_EFS NTStatus = 0xC000028E + STATUS_WRONG_EFS NTStatus = 0xC000028F + STATUS_NO_USER_KEYS NTStatus = 0xC0000290 + STATUS_FILE_NOT_ENCRYPTED NTStatus = 0xC0000291 + STATUS_NOT_EXPORT_FORMAT NTStatus = 0xC0000292 + STATUS_FILE_ENCRYPTED NTStatus = 0xC0000293 + STATUS_WAKE_SYSTEM NTStatus = 0x40000294 + STATUS_WMI_GUID_NOT_FOUND NTStatus = 0xC0000295 + STATUS_WMI_INSTANCE_NOT_FOUND NTStatus = 0xC0000296 + STATUS_WMI_ITEMID_NOT_FOUND NTStatus = 0xC0000297 + STATUS_WMI_TRY_AGAIN NTStatus = 0xC0000298 + STATUS_SHARED_POLICY NTStatus = 0xC0000299 + STATUS_POLICY_OBJECT_NOT_FOUND NTStatus = 0xC000029A + STATUS_POLICY_ONLY_IN_DS NTStatus = 0xC000029B + STATUS_VOLUME_NOT_UPGRADED NTStatus = 0xC000029C + STATUS_REMOTE_STORAGE_NOT_ACTIVE NTStatus = 0xC000029D + STATUS_REMOTE_STORAGE_MEDIA_ERROR NTStatus = 0xC000029E + STATUS_NO_TRACKING_SERVICE NTStatus = 0xC000029F + STATUS_SERVER_SID_MISMATCH NTStatus = 0xC00002A0 + STATUS_DS_NO_ATTRIBUTE_OR_VALUE NTStatus = 0xC00002A1 + STATUS_DS_INVALID_ATTRIBUTE_SYNTAX NTStatus = 0xC00002A2 + STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED NTStatus = 0xC00002A3 + STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS NTStatus = 0xC00002A4 + STATUS_DS_BUSY NTStatus = 0xC00002A5 + STATUS_DS_UNAVAILABLE NTStatus = 0xC00002A6 + STATUS_DS_NO_RIDS_ALLOCATED NTStatus = 0xC00002A7 + STATUS_DS_NO_MORE_RIDS NTStatus = 0xC00002A8 + STATUS_DS_INCORRECT_ROLE_OWNER NTStatus = 0xC00002A9 + STATUS_DS_RIDMGR_INIT_ERROR NTStatus = 0xC00002AA + STATUS_DS_OBJ_CLASS_VIOLATION NTStatus = 0xC00002AB + STATUS_DS_CANT_ON_NON_LEAF NTStatus = 0xC00002AC + STATUS_DS_CANT_ON_RDN NTStatus = 0xC00002AD + STATUS_DS_CANT_MOD_OBJ_CLASS NTStatus = 0xC00002AE + STATUS_DS_CROSS_DOM_MOVE_FAILED NTStatus = 0xC00002AF + STATUS_DS_GC_NOT_AVAILABLE NTStatus = 0xC00002B0 + STATUS_DIRECTORY_SERVICE_REQUIRED NTStatus = 0xC00002B1 + STATUS_REPARSE_ATTRIBUTE_CONFLICT NTStatus = 0xC00002B2 + STATUS_CANT_ENABLE_DENY_ONLY NTStatus = 0xC00002B3 + STATUS_FLOAT_MULTIPLE_FAULTS NTStatus = 0xC00002B4 + STATUS_FLOAT_MULTIPLE_TRAPS NTStatus = 0xC00002B5 + STATUS_DEVICE_REMOVED NTStatus = 0xC00002B6 + STATUS_JOURNAL_DELETE_IN_PROGRESS NTStatus = 0xC00002B7 + STATUS_JOURNAL_NOT_ACTIVE NTStatus = 0xC00002B8 + STATUS_NOINTERFACE NTStatus = 0xC00002B9 + STATUS_DS_RIDMGR_DISABLED NTStatus = 0xC00002BA + STATUS_DS_ADMIN_LIMIT_EXCEEDED NTStatus = 0xC00002C1 + STATUS_DRIVER_FAILED_SLEEP NTStatus = 0xC00002C2 + STATUS_MUTUAL_AUTHENTICATION_FAILED NTStatus = 0xC00002C3 + STATUS_CORRUPT_SYSTEM_FILE NTStatus = 0xC00002C4 + STATUS_DATATYPE_MISALIGNMENT_ERROR NTStatus = 0xC00002C5 + STATUS_WMI_READ_ONLY NTStatus = 0xC00002C6 + STATUS_WMI_SET_FAILURE NTStatus = 0xC00002C7 + STATUS_COMMITMENT_MINIMUM NTStatus = 0xC00002C8 + STATUS_REG_NAT_CONSUMPTION NTStatus = 0xC00002C9 + STATUS_TRANSPORT_FULL NTStatus = 0xC00002CA + STATUS_DS_SAM_INIT_FAILURE NTStatus = 0xC00002CB + STATUS_ONLY_IF_CONNECTED NTStatus = 0xC00002CC + STATUS_DS_SENSITIVE_GROUP_VIOLATION NTStatus = 0xC00002CD + STATUS_PNP_RESTART_ENUMERATION NTStatus = 0xC00002CE + STATUS_JOURNAL_ENTRY_DELETED NTStatus = 0xC00002CF + STATUS_DS_CANT_MOD_PRIMARYGROUPID NTStatus = 0xC00002D0 + STATUS_SYSTEM_IMAGE_BAD_SIGNATURE NTStatus = 0xC00002D1 + STATUS_PNP_REBOOT_REQUIRED NTStatus = 0xC00002D2 + STATUS_POWER_STATE_INVALID NTStatus = 0xC00002D3 + STATUS_DS_INVALID_GROUP_TYPE NTStatus = 0xC00002D4 + STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN NTStatus = 0xC00002D5 + STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN NTStatus = 0xC00002D6 + STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER NTStatus = 0xC00002D7 + STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER NTStatus = 0xC00002D8 + STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER NTStatus = 0xC00002D9 + STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER NTStatus = 0xC00002DA + STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER NTStatus = 0xC00002DB + STATUS_DS_HAVE_PRIMARY_MEMBERS NTStatus = 0xC00002DC + STATUS_WMI_NOT_SUPPORTED NTStatus = 0xC00002DD + STATUS_INSUFFICIENT_POWER NTStatus = 0xC00002DE + STATUS_SAM_NEED_BOOTKEY_PASSWORD NTStatus = 0xC00002DF + STATUS_SAM_NEED_BOOTKEY_FLOPPY NTStatus = 0xC00002E0 + STATUS_DS_CANT_START NTStatus = 0xC00002E1 + STATUS_DS_INIT_FAILURE NTStatus = 0xC00002E2 + STATUS_SAM_INIT_FAILURE NTStatus = 0xC00002E3 + STATUS_DS_GC_REQUIRED NTStatus = 0xC00002E4 + STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY NTStatus = 0xC00002E5 + STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS NTStatus = 0xC00002E6 + STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED NTStatus = 0xC00002E7 + STATUS_MULTIPLE_FAULT_VIOLATION NTStatus = 0xC00002E8 + STATUS_CURRENT_DOMAIN_NOT_ALLOWED NTStatus = 0xC00002E9 + STATUS_CANNOT_MAKE NTStatus = 0xC00002EA + STATUS_SYSTEM_SHUTDOWN NTStatus = 0xC00002EB + STATUS_DS_INIT_FAILURE_CONSOLE NTStatus = 0xC00002EC + STATUS_DS_SAM_INIT_FAILURE_CONSOLE NTStatus = 0xC00002ED + STATUS_UNFINISHED_CONTEXT_DELETED NTStatus = 0xC00002EE + STATUS_NO_TGT_REPLY NTStatus = 0xC00002EF + STATUS_OBJECTID_NOT_FOUND NTStatus = 0xC00002F0 + STATUS_NO_IP_ADDRESSES NTStatus = 0xC00002F1 + STATUS_WRONG_CREDENTIAL_HANDLE NTStatus = 0xC00002F2 + STATUS_CRYPTO_SYSTEM_INVALID NTStatus = 0xC00002F3 + STATUS_MAX_REFERRALS_EXCEEDED NTStatus = 0xC00002F4 + STATUS_MUST_BE_KDC NTStatus = 0xC00002F5 + STATUS_STRONG_CRYPTO_NOT_SUPPORTED NTStatus = 0xC00002F6 + STATUS_TOO_MANY_PRINCIPALS NTStatus = 0xC00002F7 + STATUS_NO_PA_DATA NTStatus = 0xC00002F8 + STATUS_PKINIT_NAME_MISMATCH NTStatus = 0xC00002F9 + STATUS_SMARTCARD_LOGON_REQUIRED NTStatus = 0xC00002FA + STATUS_KDC_INVALID_REQUEST NTStatus = 0xC00002FB + STATUS_KDC_UNABLE_TO_REFER NTStatus = 0xC00002FC + STATUS_KDC_UNKNOWN_ETYPE NTStatus = 0xC00002FD + STATUS_SHUTDOWN_IN_PROGRESS NTStatus = 0xC00002FE + STATUS_SERVER_SHUTDOWN_IN_PROGRESS NTStatus = 0xC00002FF + STATUS_NOT_SUPPORTED_ON_SBS NTStatus = 0xC0000300 + STATUS_WMI_GUID_DISCONNECTED NTStatus = 0xC0000301 + STATUS_WMI_ALREADY_DISABLED NTStatus = 0xC0000302 + STATUS_WMI_ALREADY_ENABLED NTStatus = 0xC0000303 + STATUS_MFT_TOO_FRAGMENTED NTStatus = 0xC0000304 + STATUS_COPY_PROTECTION_FAILURE NTStatus = 0xC0000305 + STATUS_CSS_AUTHENTICATION_FAILURE NTStatus = 0xC0000306 + STATUS_CSS_KEY_NOT_PRESENT NTStatus = 0xC0000307 + STATUS_CSS_KEY_NOT_ESTABLISHED NTStatus = 0xC0000308 + STATUS_CSS_SCRAMBLED_SECTOR NTStatus = 0xC0000309 + STATUS_CSS_REGION_MISMATCH NTStatus = 0xC000030A + STATUS_CSS_RESETS_EXHAUSTED NTStatus = 0xC000030B + STATUS_PASSWORD_CHANGE_REQUIRED NTStatus = 0xC000030C + STATUS_LOST_MODE_LOGON_RESTRICTION NTStatus = 0xC000030D + STATUS_PKINIT_FAILURE NTStatus = 0xC0000320 + STATUS_SMARTCARD_SUBSYSTEM_FAILURE NTStatus = 0xC0000321 + STATUS_NO_KERB_KEY NTStatus = 0xC0000322 + STATUS_HOST_DOWN NTStatus = 0xC0000350 + STATUS_UNSUPPORTED_PREAUTH NTStatus = 0xC0000351 + STATUS_EFS_ALG_BLOB_TOO_BIG NTStatus = 0xC0000352 + STATUS_PORT_NOT_SET NTStatus = 0xC0000353 + STATUS_DEBUGGER_INACTIVE NTStatus = 0xC0000354 + STATUS_DS_VERSION_CHECK_FAILURE NTStatus = 0xC0000355 + STATUS_AUDITING_DISABLED NTStatus = 0xC0000356 + STATUS_PRENT4_MACHINE_ACCOUNT NTStatus = 0xC0000357 + STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER NTStatus = 0xC0000358 + STATUS_INVALID_IMAGE_WIN_32 NTStatus = 0xC0000359 + STATUS_INVALID_IMAGE_WIN_64 NTStatus = 0xC000035A + STATUS_BAD_BINDINGS NTStatus = 0xC000035B + STATUS_NETWORK_SESSION_EXPIRED NTStatus = 0xC000035C + STATUS_APPHELP_BLOCK NTStatus = 0xC000035D + STATUS_ALL_SIDS_FILTERED NTStatus = 0xC000035E + STATUS_NOT_SAFE_MODE_DRIVER NTStatus = 0xC000035F + STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT NTStatus = 0xC0000361 + STATUS_ACCESS_DISABLED_BY_POLICY_PATH NTStatus = 0xC0000362 + STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER NTStatus = 0xC0000363 + STATUS_ACCESS_DISABLED_BY_POLICY_OTHER NTStatus = 0xC0000364 + STATUS_FAILED_DRIVER_ENTRY NTStatus = 0xC0000365 + STATUS_DEVICE_ENUMERATION_ERROR NTStatus = 0xC0000366 + STATUS_MOUNT_POINT_NOT_RESOLVED NTStatus = 0xC0000368 + STATUS_INVALID_DEVICE_OBJECT_PARAMETER NTStatus = 0xC0000369 + STATUS_MCA_OCCURED NTStatus = 0xC000036A + STATUS_DRIVER_BLOCKED_CRITICAL NTStatus = 0xC000036B + STATUS_DRIVER_BLOCKED NTStatus = 0xC000036C + STATUS_DRIVER_DATABASE_ERROR NTStatus = 0xC000036D + STATUS_SYSTEM_HIVE_TOO_LARGE NTStatus = 0xC000036E + STATUS_INVALID_IMPORT_OF_NON_DLL NTStatus = 0xC000036F + STATUS_DS_SHUTTING_DOWN NTStatus = 0x40000370 + STATUS_NO_SECRETS NTStatus = 0xC0000371 + STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY NTStatus = 0xC0000372 + STATUS_FAILED_STACK_SWITCH NTStatus = 0xC0000373 + STATUS_HEAP_CORRUPTION NTStatus = 0xC0000374 + STATUS_SMARTCARD_WRONG_PIN NTStatus = 0xC0000380 + STATUS_SMARTCARD_CARD_BLOCKED NTStatus = 0xC0000381 + STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED NTStatus = 0xC0000382 + STATUS_SMARTCARD_NO_CARD NTStatus = 0xC0000383 + STATUS_SMARTCARD_NO_KEY_CONTAINER NTStatus = 0xC0000384 + STATUS_SMARTCARD_NO_CERTIFICATE NTStatus = 0xC0000385 + STATUS_SMARTCARD_NO_KEYSET NTStatus = 0xC0000386 + STATUS_SMARTCARD_IO_ERROR NTStatus = 0xC0000387 + STATUS_DOWNGRADE_DETECTED NTStatus = 0xC0000388 + STATUS_SMARTCARD_CERT_REVOKED NTStatus = 0xC0000389 + STATUS_ISSUING_CA_UNTRUSTED NTStatus = 0xC000038A + STATUS_REVOCATION_OFFLINE_C NTStatus = 0xC000038B + STATUS_PKINIT_CLIENT_FAILURE NTStatus = 0xC000038C + STATUS_SMARTCARD_CERT_EXPIRED NTStatus = 0xC000038D + STATUS_DRIVER_FAILED_PRIOR_UNLOAD NTStatus = 0xC000038E + STATUS_SMARTCARD_SILENT_CONTEXT NTStatus = 0xC000038F + STATUS_PER_USER_TRUST_QUOTA_EXCEEDED NTStatus = 0xC0000401 + STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED NTStatus = 0xC0000402 + STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED NTStatus = 0xC0000403 + STATUS_DS_NAME_NOT_UNIQUE NTStatus = 0xC0000404 + STATUS_DS_DUPLICATE_ID_FOUND NTStatus = 0xC0000405 + STATUS_DS_GROUP_CONVERSION_ERROR NTStatus = 0xC0000406 + STATUS_VOLSNAP_PREPARE_HIBERNATE NTStatus = 0xC0000407 + STATUS_USER2USER_REQUIRED NTStatus = 0xC0000408 + STATUS_STACK_BUFFER_OVERRUN NTStatus = 0xC0000409 + STATUS_NO_S4U_PROT_SUPPORT NTStatus = 0xC000040A + STATUS_CROSSREALM_DELEGATION_FAILURE NTStatus = 0xC000040B + STATUS_REVOCATION_OFFLINE_KDC NTStatus = 0xC000040C + STATUS_ISSUING_CA_UNTRUSTED_KDC NTStatus = 0xC000040D + STATUS_KDC_CERT_EXPIRED NTStatus = 0xC000040E + STATUS_KDC_CERT_REVOKED NTStatus = 0xC000040F + STATUS_PARAMETER_QUOTA_EXCEEDED NTStatus = 0xC0000410 + STATUS_HIBERNATION_FAILURE NTStatus = 0xC0000411 + STATUS_DELAY_LOAD_FAILED NTStatus = 0xC0000412 + STATUS_AUTHENTICATION_FIREWALL_FAILED NTStatus = 0xC0000413 + STATUS_VDM_DISALLOWED NTStatus = 0xC0000414 + STATUS_HUNG_DISPLAY_DRIVER_THREAD NTStatus = 0xC0000415 + STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE NTStatus = 0xC0000416 + STATUS_INVALID_CRUNTIME_PARAMETER NTStatus = 0xC0000417 + STATUS_NTLM_BLOCKED NTStatus = 0xC0000418 + STATUS_DS_SRC_SID_EXISTS_IN_FOREST NTStatus = 0xC0000419 + STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST NTStatus = 0xC000041A + STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST NTStatus = 0xC000041B + STATUS_INVALID_USER_PRINCIPAL_NAME NTStatus = 0xC000041C + STATUS_FATAL_USER_CALLBACK_EXCEPTION NTStatus = 0xC000041D + STATUS_ASSERTION_FAILURE NTStatus = 0xC0000420 + STATUS_VERIFIER_STOP NTStatus = 0xC0000421 + STATUS_CALLBACK_POP_STACK NTStatus = 0xC0000423 + STATUS_INCOMPATIBLE_DRIVER_BLOCKED NTStatus = 0xC0000424 + STATUS_HIVE_UNLOADED NTStatus = 0xC0000425 + STATUS_COMPRESSION_DISABLED NTStatus = 0xC0000426 + STATUS_FILE_SYSTEM_LIMITATION NTStatus = 0xC0000427 + STATUS_INVALID_IMAGE_HASH NTStatus = 0xC0000428 + STATUS_NOT_CAPABLE NTStatus = 0xC0000429 + STATUS_REQUEST_OUT_OF_SEQUENCE NTStatus = 0xC000042A + STATUS_IMPLEMENTATION_LIMIT NTStatus = 0xC000042B + STATUS_ELEVATION_REQUIRED NTStatus = 0xC000042C + STATUS_NO_SECURITY_CONTEXT NTStatus = 0xC000042D + STATUS_PKU2U_CERT_FAILURE NTStatus = 0xC000042F + STATUS_BEYOND_VDL NTStatus = 0xC0000432 + STATUS_ENCOUNTERED_WRITE_IN_PROGRESS NTStatus = 0xC0000433 + STATUS_PTE_CHANGED NTStatus = 0xC0000434 + STATUS_PURGE_FAILED NTStatus = 0xC0000435 + STATUS_CRED_REQUIRES_CONFIRMATION NTStatus = 0xC0000440 + STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE NTStatus = 0xC0000441 + STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER NTStatus = 0xC0000442 + STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE NTStatus = 0xC0000443 + STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE NTStatus = 0xC0000444 + STATUS_CS_ENCRYPTION_FILE_NOT_CSE NTStatus = 0xC0000445 + STATUS_INVALID_LABEL NTStatus = 0xC0000446 + STATUS_DRIVER_PROCESS_TERMINATED NTStatus = 0xC0000450 + STATUS_AMBIGUOUS_SYSTEM_DEVICE NTStatus = 0xC0000451 + STATUS_SYSTEM_DEVICE_NOT_FOUND NTStatus = 0xC0000452 + STATUS_RESTART_BOOT_APPLICATION NTStatus = 0xC0000453 + STATUS_INSUFFICIENT_NVRAM_RESOURCES NTStatus = 0xC0000454 + STATUS_INVALID_SESSION NTStatus = 0xC0000455 + STATUS_THREAD_ALREADY_IN_SESSION NTStatus = 0xC0000456 + STATUS_THREAD_NOT_IN_SESSION NTStatus = 0xC0000457 + STATUS_INVALID_WEIGHT NTStatus = 0xC0000458 + STATUS_REQUEST_PAUSED NTStatus = 0xC0000459 + STATUS_NO_RANGES_PROCESSED NTStatus = 0xC0000460 + STATUS_DISK_RESOURCES_EXHAUSTED NTStatus = 0xC0000461 + STATUS_NEEDS_REMEDIATION NTStatus = 0xC0000462 + STATUS_DEVICE_FEATURE_NOT_SUPPORTED NTStatus = 0xC0000463 + STATUS_DEVICE_UNREACHABLE NTStatus = 0xC0000464 + STATUS_INVALID_TOKEN NTStatus = 0xC0000465 + STATUS_SERVER_UNAVAILABLE NTStatus = 0xC0000466 + STATUS_FILE_NOT_AVAILABLE NTStatus = 0xC0000467 + STATUS_DEVICE_INSUFFICIENT_RESOURCES NTStatus = 0xC0000468 + STATUS_PACKAGE_UPDATING NTStatus = 0xC0000469 + STATUS_NOT_READ_FROM_COPY NTStatus = 0xC000046A + STATUS_FT_WRITE_FAILURE NTStatus = 0xC000046B + STATUS_FT_DI_SCAN_REQUIRED NTStatus = 0xC000046C + STATUS_OBJECT_NOT_EXTERNALLY_BACKED NTStatus = 0xC000046D + STATUS_EXTERNAL_BACKING_PROVIDER_UNKNOWN NTStatus = 0xC000046E + STATUS_COMPRESSION_NOT_BENEFICIAL NTStatus = 0xC000046F + STATUS_DATA_CHECKSUM_ERROR NTStatus = 0xC0000470 + STATUS_INTERMIXED_KERNEL_EA_OPERATION NTStatus = 0xC0000471 + STATUS_TRIM_READ_ZERO_NOT_SUPPORTED NTStatus = 0xC0000472 + STATUS_TOO_MANY_SEGMENT_DESCRIPTORS NTStatus = 0xC0000473 + STATUS_INVALID_OFFSET_ALIGNMENT NTStatus = 0xC0000474 + STATUS_INVALID_FIELD_IN_PARAMETER_LIST NTStatus = 0xC0000475 + STATUS_OPERATION_IN_PROGRESS NTStatus = 0xC0000476 + STATUS_INVALID_INITIATOR_TARGET_PATH NTStatus = 0xC0000477 + STATUS_SCRUB_DATA_DISABLED NTStatus = 0xC0000478 + STATUS_NOT_REDUNDANT_STORAGE NTStatus = 0xC0000479 + STATUS_RESIDENT_FILE_NOT_SUPPORTED NTStatus = 0xC000047A + STATUS_COMPRESSED_FILE_NOT_SUPPORTED NTStatus = 0xC000047B + STATUS_DIRECTORY_NOT_SUPPORTED NTStatus = 0xC000047C + STATUS_IO_OPERATION_TIMEOUT NTStatus = 0xC000047D + STATUS_SYSTEM_NEEDS_REMEDIATION NTStatus = 0xC000047E + STATUS_APPX_INTEGRITY_FAILURE_CLR_NGEN NTStatus = 0xC000047F + STATUS_SHARE_UNAVAILABLE NTStatus = 0xC0000480 + STATUS_APISET_NOT_HOSTED NTStatus = 0xC0000481 + STATUS_APISET_NOT_PRESENT NTStatus = 0xC0000482 + STATUS_DEVICE_HARDWARE_ERROR NTStatus = 0xC0000483 + STATUS_FIRMWARE_SLOT_INVALID NTStatus = 0xC0000484 + STATUS_FIRMWARE_IMAGE_INVALID NTStatus = 0xC0000485 + STATUS_STORAGE_TOPOLOGY_ID_MISMATCH NTStatus = 0xC0000486 + STATUS_WIM_NOT_BOOTABLE NTStatus = 0xC0000487 + STATUS_BLOCKED_BY_PARENTAL_CONTROLS NTStatus = 0xC0000488 + STATUS_NEEDS_REGISTRATION NTStatus = 0xC0000489 + STATUS_QUOTA_ACTIVITY NTStatus = 0xC000048A + STATUS_CALLBACK_INVOKE_INLINE NTStatus = 0xC000048B + STATUS_BLOCK_TOO_MANY_REFERENCES NTStatus = 0xC000048C + STATUS_MARKED_TO_DISALLOW_WRITES NTStatus = 0xC000048D + STATUS_NETWORK_ACCESS_DENIED_EDP NTStatus = 0xC000048E + STATUS_ENCLAVE_FAILURE NTStatus = 0xC000048F + STATUS_PNP_NO_COMPAT_DRIVERS NTStatus = 0xC0000490 + STATUS_PNP_DRIVER_PACKAGE_NOT_FOUND NTStatus = 0xC0000491 + STATUS_PNP_DRIVER_CONFIGURATION_NOT_FOUND NTStatus = 0xC0000492 + STATUS_PNP_DRIVER_CONFIGURATION_INCOMPLETE NTStatus = 0xC0000493 + STATUS_PNP_FUNCTION_DRIVER_REQUIRED NTStatus = 0xC0000494 + STATUS_PNP_DEVICE_CONFIGURATION_PENDING NTStatus = 0xC0000495 + STATUS_DEVICE_HINT_NAME_BUFFER_TOO_SMALL NTStatus = 0xC0000496 + STATUS_PACKAGE_NOT_AVAILABLE NTStatus = 0xC0000497 + STATUS_DEVICE_IN_MAINTENANCE NTStatus = 0xC0000499 + STATUS_NOT_SUPPORTED_ON_DAX NTStatus = 0xC000049A + STATUS_FREE_SPACE_TOO_FRAGMENTED NTStatus = 0xC000049B + STATUS_DAX_MAPPING_EXISTS NTStatus = 0xC000049C + STATUS_CHILD_PROCESS_BLOCKED NTStatus = 0xC000049D + STATUS_STORAGE_LOST_DATA_PERSISTENCE NTStatus = 0xC000049E + STATUS_VRF_CFG_ENABLED NTStatus = 0xC000049F + STATUS_PARTITION_TERMINATING NTStatus = 0xC00004A0 + STATUS_EXTERNAL_SYSKEY_NOT_SUPPORTED NTStatus = 0xC00004A1 + STATUS_ENCLAVE_VIOLATION NTStatus = 0xC00004A2 + STATUS_FILE_PROTECTED_UNDER_DPL NTStatus = 0xC00004A3 + STATUS_VOLUME_NOT_CLUSTER_ALIGNED NTStatus = 0xC00004A4 + STATUS_NO_PHYSICALLY_ALIGNED_FREE_SPACE_FOUND NTStatus = 0xC00004A5 + STATUS_APPX_FILE_NOT_ENCRYPTED NTStatus = 0xC00004A6 + STATUS_RWRAW_ENCRYPTED_FILE_NOT_ENCRYPTED NTStatus = 0xC00004A7 + STATUS_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILEOFFSET NTStatus = 0xC00004A8 + STATUS_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILERANGE NTStatus = 0xC00004A9 + STATUS_RWRAW_ENCRYPTED_INVALID_EDATAINFO_PARAMETER NTStatus = 0xC00004AA + STATUS_FT_READ_FAILURE NTStatus = 0xC00004AB + STATUS_PATCH_CONFLICT NTStatus = 0xC00004AC + STATUS_STORAGE_RESERVE_ID_INVALID NTStatus = 0xC00004AD + STATUS_STORAGE_RESERVE_DOES_NOT_EXIST NTStatus = 0xC00004AE + STATUS_STORAGE_RESERVE_ALREADY_EXISTS NTStatus = 0xC00004AF + STATUS_STORAGE_RESERVE_NOT_EMPTY NTStatus = 0xC00004B0 + STATUS_NOT_A_DAX_VOLUME NTStatus = 0xC00004B1 + STATUS_NOT_DAX_MAPPABLE NTStatus = 0xC00004B2 + STATUS_CASE_DIFFERING_NAMES_IN_DIR NTStatus = 0xC00004B3 + STATUS_FILE_NOT_SUPPORTED NTStatus = 0xC00004B4 + STATUS_NOT_SUPPORTED_WITH_BTT NTStatus = 0xC00004B5 + STATUS_ENCRYPTION_DISABLED NTStatus = 0xC00004B6 + STATUS_ENCRYPTING_METADATA_DISALLOWED NTStatus = 0xC00004B7 + STATUS_CANT_CLEAR_ENCRYPTION_FLAG NTStatus = 0xC00004B8 + STATUS_INVALID_TASK_NAME NTStatus = 0xC0000500 + STATUS_INVALID_TASK_INDEX NTStatus = 0xC0000501 + STATUS_THREAD_ALREADY_IN_TASK NTStatus = 0xC0000502 + STATUS_CALLBACK_BYPASS NTStatus = 0xC0000503 + STATUS_UNDEFINED_SCOPE NTStatus = 0xC0000504 + STATUS_INVALID_CAP NTStatus = 0xC0000505 + STATUS_NOT_GUI_PROCESS NTStatus = 0xC0000506 + STATUS_DEVICE_HUNG NTStatus = 0xC0000507 + STATUS_CONTAINER_ASSIGNED NTStatus = 0xC0000508 + STATUS_JOB_NO_CONTAINER NTStatus = 0xC0000509 + STATUS_DEVICE_UNRESPONSIVE NTStatus = 0xC000050A + STATUS_REPARSE_POINT_ENCOUNTERED NTStatus = 0xC000050B + STATUS_ATTRIBUTE_NOT_PRESENT NTStatus = 0xC000050C + STATUS_NOT_A_TIERED_VOLUME NTStatus = 0xC000050D + STATUS_ALREADY_HAS_STREAM_ID NTStatus = 0xC000050E + STATUS_JOB_NOT_EMPTY NTStatus = 0xC000050F + STATUS_ALREADY_INITIALIZED NTStatus = 0xC0000510 + STATUS_ENCLAVE_NOT_TERMINATED NTStatus = 0xC0000511 + STATUS_ENCLAVE_IS_TERMINATING NTStatus = 0xC0000512 + STATUS_SMB1_NOT_AVAILABLE NTStatus = 0xC0000513 + STATUS_SMR_GARBAGE_COLLECTION_REQUIRED NTStatus = 0xC0000514 + STATUS_INTERRUPTED NTStatus = 0xC0000515 + STATUS_THREAD_NOT_RUNNING NTStatus = 0xC0000516 + STATUS_FAIL_FAST_EXCEPTION NTStatus = 0xC0000602 + STATUS_IMAGE_CERT_REVOKED NTStatus = 0xC0000603 + STATUS_DYNAMIC_CODE_BLOCKED NTStatus = 0xC0000604 + STATUS_IMAGE_CERT_EXPIRED NTStatus = 0xC0000605 + STATUS_STRICT_CFG_VIOLATION NTStatus = 0xC0000606 + STATUS_SET_CONTEXT_DENIED NTStatus = 0xC000060A + STATUS_CROSS_PARTITION_VIOLATION NTStatus = 0xC000060B + STATUS_PORT_CLOSED NTStatus = 0xC0000700 + STATUS_MESSAGE_LOST NTStatus = 0xC0000701 + STATUS_INVALID_MESSAGE NTStatus = 0xC0000702 + STATUS_REQUEST_CANCELED NTStatus = 0xC0000703 + STATUS_RECURSIVE_DISPATCH NTStatus = 0xC0000704 + STATUS_LPC_RECEIVE_BUFFER_EXPECTED NTStatus = 0xC0000705 + STATUS_LPC_INVALID_CONNECTION_USAGE NTStatus = 0xC0000706 + STATUS_LPC_REQUESTS_NOT_ALLOWED NTStatus = 0xC0000707 + STATUS_RESOURCE_IN_USE NTStatus = 0xC0000708 + STATUS_HARDWARE_MEMORY_ERROR NTStatus = 0xC0000709 + STATUS_THREADPOOL_HANDLE_EXCEPTION NTStatus = 0xC000070A + STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED NTStatus = 0xC000070B + STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED NTStatus = 0xC000070C + STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED NTStatus = 0xC000070D + STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED NTStatus = 0xC000070E + STATUS_THREADPOOL_RELEASED_DURING_OPERATION NTStatus = 0xC000070F + STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING NTStatus = 0xC0000710 + STATUS_APC_RETURNED_WHILE_IMPERSONATING NTStatus = 0xC0000711 + STATUS_PROCESS_IS_PROTECTED NTStatus = 0xC0000712 + STATUS_MCA_EXCEPTION NTStatus = 0xC0000713 + STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE NTStatus = 0xC0000714 + STATUS_SYMLINK_CLASS_DISABLED NTStatus = 0xC0000715 + STATUS_INVALID_IDN_NORMALIZATION NTStatus = 0xC0000716 + STATUS_NO_UNICODE_TRANSLATION NTStatus = 0xC0000717 + STATUS_ALREADY_REGISTERED NTStatus = 0xC0000718 + STATUS_CONTEXT_MISMATCH NTStatus = 0xC0000719 + STATUS_PORT_ALREADY_HAS_COMPLETION_LIST NTStatus = 0xC000071A + STATUS_CALLBACK_RETURNED_THREAD_PRIORITY NTStatus = 0xC000071B + STATUS_INVALID_THREAD NTStatus = 0xC000071C + STATUS_CALLBACK_RETURNED_TRANSACTION NTStatus = 0xC000071D + STATUS_CALLBACK_RETURNED_LDR_LOCK NTStatus = 0xC000071E + STATUS_CALLBACK_RETURNED_LANG NTStatus = 0xC000071F + STATUS_CALLBACK_RETURNED_PRI_BACK NTStatus = 0xC0000720 + STATUS_CALLBACK_RETURNED_THREAD_AFFINITY NTStatus = 0xC0000721 + STATUS_LPC_HANDLE_COUNT_EXCEEDED NTStatus = 0xC0000722 + STATUS_EXECUTABLE_MEMORY_WRITE NTStatus = 0xC0000723 + STATUS_KERNEL_EXECUTABLE_MEMORY_WRITE NTStatus = 0xC0000724 + STATUS_ATTACHED_EXECUTABLE_MEMORY_WRITE NTStatus = 0xC0000725 + STATUS_TRIGGERED_EXECUTABLE_MEMORY_WRITE NTStatus = 0xC0000726 + STATUS_DISK_REPAIR_DISABLED NTStatus = 0xC0000800 + STATUS_DS_DOMAIN_RENAME_IN_PROGRESS NTStatus = 0xC0000801 + STATUS_DISK_QUOTA_EXCEEDED NTStatus = 0xC0000802 + STATUS_DATA_LOST_REPAIR NTStatus = 0x80000803 + STATUS_CONTENT_BLOCKED NTStatus = 0xC0000804 + STATUS_BAD_CLUSTERS NTStatus = 0xC0000805 + STATUS_VOLUME_DIRTY NTStatus = 0xC0000806 + STATUS_DISK_REPAIR_REDIRECTED NTStatus = 0x40000807 + STATUS_DISK_REPAIR_UNSUCCESSFUL NTStatus = 0xC0000808 + STATUS_CORRUPT_LOG_OVERFULL NTStatus = 0xC0000809 + STATUS_CORRUPT_LOG_CORRUPTED NTStatus = 0xC000080A + STATUS_CORRUPT_LOG_UNAVAILABLE NTStatus = 0xC000080B + STATUS_CORRUPT_LOG_DELETED_FULL NTStatus = 0xC000080C + STATUS_CORRUPT_LOG_CLEARED NTStatus = 0xC000080D + STATUS_ORPHAN_NAME_EXHAUSTED NTStatus = 0xC000080E + STATUS_PROACTIVE_SCAN_IN_PROGRESS NTStatus = 0xC000080F + STATUS_ENCRYPTED_IO_NOT_POSSIBLE NTStatus = 0xC0000810 + STATUS_CORRUPT_LOG_UPLEVEL_RECORDS NTStatus = 0xC0000811 + STATUS_FILE_CHECKED_OUT NTStatus = 0xC0000901 + STATUS_CHECKOUT_REQUIRED NTStatus = 0xC0000902 + STATUS_BAD_FILE_TYPE NTStatus = 0xC0000903 + STATUS_FILE_TOO_LARGE NTStatus = 0xC0000904 + STATUS_FORMS_AUTH_REQUIRED NTStatus = 0xC0000905 + STATUS_VIRUS_INFECTED NTStatus = 0xC0000906 + STATUS_VIRUS_DELETED NTStatus = 0xC0000907 + STATUS_BAD_MCFG_TABLE NTStatus = 0xC0000908 + STATUS_CANNOT_BREAK_OPLOCK NTStatus = 0xC0000909 + STATUS_BAD_KEY NTStatus = 0xC000090A + STATUS_BAD_DATA NTStatus = 0xC000090B + STATUS_NO_KEY NTStatus = 0xC000090C + STATUS_FILE_HANDLE_REVOKED NTStatus = 0xC0000910 + STATUS_WOW_ASSERTION NTStatus = 0xC0009898 + STATUS_INVALID_SIGNATURE NTStatus = 0xC000A000 + STATUS_HMAC_NOT_SUPPORTED NTStatus = 0xC000A001 + STATUS_AUTH_TAG_MISMATCH NTStatus = 0xC000A002 + STATUS_INVALID_STATE_TRANSITION NTStatus = 0xC000A003 + STATUS_INVALID_KERNEL_INFO_VERSION NTStatus = 0xC000A004 + STATUS_INVALID_PEP_INFO_VERSION NTStatus = 0xC000A005 + STATUS_HANDLE_REVOKED NTStatus = 0xC000A006 + STATUS_EOF_ON_GHOSTED_RANGE NTStatus = 0xC000A007 + STATUS_IPSEC_QUEUE_OVERFLOW NTStatus = 0xC000A010 + STATUS_ND_QUEUE_OVERFLOW NTStatus = 0xC000A011 + STATUS_HOPLIMIT_EXCEEDED NTStatus = 0xC000A012 + STATUS_PROTOCOL_NOT_SUPPORTED NTStatus = 0xC000A013 + STATUS_FASTPATH_REJECTED NTStatus = 0xC000A014 + STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED NTStatus = 0xC000A080 + STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR NTStatus = 0xC000A081 + STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR NTStatus = 0xC000A082 + STATUS_XML_PARSE_ERROR NTStatus = 0xC000A083 + STATUS_XMLDSIG_ERROR NTStatus = 0xC000A084 + STATUS_WRONG_COMPARTMENT NTStatus = 0xC000A085 + STATUS_AUTHIP_FAILURE NTStatus = 0xC000A086 + STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS NTStatus = 0xC000A087 + STATUS_DS_OID_NOT_FOUND NTStatus = 0xC000A088 + STATUS_INCORRECT_ACCOUNT_TYPE NTStatus = 0xC000A089 + STATUS_HASH_NOT_SUPPORTED NTStatus = 0xC000A100 + STATUS_HASH_NOT_PRESENT NTStatus = 0xC000A101 + STATUS_SECONDARY_IC_PROVIDER_NOT_REGISTERED NTStatus = 0xC000A121 + STATUS_GPIO_CLIENT_INFORMATION_INVALID NTStatus = 0xC000A122 + STATUS_GPIO_VERSION_NOT_SUPPORTED NTStatus = 0xC000A123 + STATUS_GPIO_INVALID_REGISTRATION_PACKET NTStatus = 0xC000A124 + STATUS_GPIO_OPERATION_DENIED NTStatus = 0xC000A125 + STATUS_GPIO_INCOMPATIBLE_CONNECT_MODE NTStatus = 0xC000A126 + STATUS_GPIO_INTERRUPT_ALREADY_UNMASKED NTStatus = 0x8000A127 + STATUS_CANNOT_SWITCH_RUNLEVEL NTStatus = 0xC000A141 + STATUS_INVALID_RUNLEVEL_SETTING NTStatus = 0xC000A142 + STATUS_RUNLEVEL_SWITCH_TIMEOUT NTStatus = 0xC000A143 + STATUS_SERVICES_FAILED_AUTOSTART NTStatus = 0x4000A144 + STATUS_RUNLEVEL_SWITCH_AGENT_TIMEOUT NTStatus = 0xC000A145 + STATUS_RUNLEVEL_SWITCH_IN_PROGRESS NTStatus = 0xC000A146 + STATUS_NOT_APPCONTAINER NTStatus = 0xC000A200 + STATUS_NOT_SUPPORTED_IN_APPCONTAINER NTStatus = 0xC000A201 + STATUS_INVALID_PACKAGE_SID_LENGTH NTStatus = 0xC000A202 + STATUS_LPAC_ACCESS_DENIED NTStatus = 0xC000A203 + STATUS_ADMINLESS_ACCESS_DENIED NTStatus = 0xC000A204 + STATUS_APP_DATA_NOT_FOUND NTStatus = 0xC000A281 + STATUS_APP_DATA_EXPIRED NTStatus = 0xC000A282 + STATUS_APP_DATA_CORRUPT NTStatus = 0xC000A283 + STATUS_APP_DATA_LIMIT_EXCEEDED NTStatus = 0xC000A284 + STATUS_APP_DATA_REBOOT_REQUIRED NTStatus = 0xC000A285 + STATUS_OFFLOAD_READ_FLT_NOT_SUPPORTED NTStatus = 0xC000A2A1 + STATUS_OFFLOAD_WRITE_FLT_NOT_SUPPORTED NTStatus = 0xC000A2A2 + STATUS_OFFLOAD_READ_FILE_NOT_SUPPORTED NTStatus = 0xC000A2A3 + STATUS_OFFLOAD_WRITE_FILE_NOT_SUPPORTED NTStatus = 0xC000A2A4 + STATUS_WOF_WIM_HEADER_CORRUPT NTStatus = 0xC000A2A5 + STATUS_WOF_WIM_RESOURCE_TABLE_CORRUPT NTStatus = 0xC000A2A6 + STATUS_WOF_FILE_RESOURCE_TABLE_CORRUPT NTStatus = 0xC000A2A7 + STATUS_FILE_SYSTEM_VIRTUALIZATION_UNAVAILABLE NTStatus = 0xC000CE01 + STATUS_FILE_SYSTEM_VIRTUALIZATION_METADATA_CORRUPT NTStatus = 0xC000CE02 + STATUS_FILE_SYSTEM_VIRTUALIZATION_BUSY NTStatus = 0xC000CE03 + STATUS_FILE_SYSTEM_VIRTUALIZATION_PROVIDER_UNKNOWN NTStatus = 0xC000CE04 + STATUS_FILE_SYSTEM_VIRTUALIZATION_INVALID_OPERATION NTStatus = 0xC000CE05 + STATUS_CLOUD_FILE_SYNC_ROOT_METADATA_CORRUPT NTStatus = 0xC000CF00 + STATUS_CLOUD_FILE_PROVIDER_NOT_RUNNING NTStatus = 0xC000CF01 + STATUS_CLOUD_FILE_METADATA_CORRUPT NTStatus = 0xC000CF02 + STATUS_CLOUD_FILE_METADATA_TOO_LARGE NTStatus = 0xC000CF03 + STATUS_CLOUD_FILE_PROPERTY_BLOB_TOO_LARGE NTStatus = 0x8000CF04 + STATUS_CLOUD_FILE_TOO_MANY_PROPERTY_BLOBS NTStatus = 0x8000CF05 + STATUS_CLOUD_FILE_PROPERTY_VERSION_NOT_SUPPORTED NTStatus = 0xC000CF06 + STATUS_NOT_A_CLOUD_FILE NTStatus = 0xC000CF07 + STATUS_CLOUD_FILE_NOT_IN_SYNC NTStatus = 0xC000CF08 + STATUS_CLOUD_FILE_ALREADY_CONNECTED NTStatus = 0xC000CF09 + STATUS_CLOUD_FILE_NOT_SUPPORTED NTStatus = 0xC000CF0A + STATUS_CLOUD_FILE_INVALID_REQUEST NTStatus = 0xC000CF0B + STATUS_CLOUD_FILE_READ_ONLY_VOLUME NTStatus = 0xC000CF0C + STATUS_CLOUD_FILE_CONNECTED_PROVIDER_ONLY NTStatus = 0xC000CF0D + STATUS_CLOUD_FILE_VALIDATION_FAILED NTStatus = 0xC000CF0E + STATUS_CLOUD_FILE_AUTHENTICATION_FAILED NTStatus = 0xC000CF0F + STATUS_CLOUD_FILE_INSUFFICIENT_RESOURCES NTStatus = 0xC000CF10 + STATUS_CLOUD_FILE_NETWORK_UNAVAILABLE NTStatus = 0xC000CF11 + STATUS_CLOUD_FILE_UNSUCCESSFUL NTStatus = 0xC000CF12 + STATUS_CLOUD_FILE_NOT_UNDER_SYNC_ROOT NTStatus = 0xC000CF13 + STATUS_CLOUD_FILE_IN_USE NTStatus = 0xC000CF14 + STATUS_CLOUD_FILE_PINNED NTStatus = 0xC000CF15 + STATUS_CLOUD_FILE_REQUEST_ABORTED NTStatus = 0xC000CF16 + STATUS_CLOUD_FILE_PROPERTY_CORRUPT NTStatus = 0xC000CF17 + STATUS_CLOUD_FILE_ACCESS_DENIED NTStatus = 0xC000CF18 + STATUS_CLOUD_FILE_INCOMPATIBLE_HARDLINKS NTStatus = 0xC000CF19 + STATUS_CLOUD_FILE_PROPERTY_LOCK_CONFLICT NTStatus = 0xC000CF1A + STATUS_CLOUD_FILE_REQUEST_CANCELED NTStatus = 0xC000CF1B + STATUS_CLOUD_FILE_PROVIDER_TERMINATED NTStatus = 0xC000CF1D + STATUS_NOT_A_CLOUD_SYNC_ROOT NTStatus = 0xC000CF1E + STATUS_CLOUD_FILE_REQUEST_TIMEOUT NTStatus = 0xC000CF1F + STATUS_ACPI_INVALID_OPCODE NTStatus = 0xC0140001 + STATUS_ACPI_STACK_OVERFLOW NTStatus = 0xC0140002 + STATUS_ACPI_ASSERT_FAILED NTStatus = 0xC0140003 + STATUS_ACPI_INVALID_INDEX NTStatus = 0xC0140004 + STATUS_ACPI_INVALID_ARGUMENT NTStatus = 0xC0140005 + STATUS_ACPI_FATAL NTStatus = 0xC0140006 + STATUS_ACPI_INVALID_SUPERNAME NTStatus = 0xC0140007 + STATUS_ACPI_INVALID_ARGTYPE NTStatus = 0xC0140008 + STATUS_ACPI_INVALID_OBJTYPE NTStatus = 0xC0140009 + STATUS_ACPI_INVALID_TARGETTYPE NTStatus = 0xC014000A + STATUS_ACPI_INCORRECT_ARGUMENT_COUNT NTStatus = 0xC014000B + STATUS_ACPI_ADDRESS_NOT_MAPPED NTStatus = 0xC014000C + STATUS_ACPI_INVALID_EVENTTYPE NTStatus = 0xC014000D + STATUS_ACPI_HANDLER_COLLISION NTStatus = 0xC014000E + STATUS_ACPI_INVALID_DATA NTStatus = 0xC014000F + STATUS_ACPI_INVALID_REGION NTStatus = 0xC0140010 + STATUS_ACPI_INVALID_ACCESS_SIZE NTStatus = 0xC0140011 + STATUS_ACPI_ACQUIRE_GLOBAL_LOCK NTStatus = 0xC0140012 + STATUS_ACPI_ALREADY_INITIALIZED NTStatus = 0xC0140013 + STATUS_ACPI_NOT_INITIALIZED NTStatus = 0xC0140014 + STATUS_ACPI_INVALID_MUTEX_LEVEL NTStatus = 0xC0140015 + STATUS_ACPI_MUTEX_NOT_OWNED NTStatus = 0xC0140016 + STATUS_ACPI_MUTEX_NOT_OWNER NTStatus = 0xC0140017 + STATUS_ACPI_RS_ACCESS NTStatus = 0xC0140018 + STATUS_ACPI_INVALID_TABLE NTStatus = 0xC0140019 + STATUS_ACPI_REG_HANDLER_FAILED NTStatus = 0xC0140020 + STATUS_ACPI_POWER_REQUEST_FAILED NTStatus = 0xC0140021 + STATUS_CTX_WINSTATION_NAME_INVALID NTStatus = 0xC00A0001 + STATUS_CTX_INVALID_PD NTStatus = 0xC00A0002 + STATUS_CTX_PD_NOT_FOUND NTStatus = 0xC00A0003 + STATUS_CTX_CDM_CONNECT NTStatus = 0x400A0004 + STATUS_CTX_CDM_DISCONNECT NTStatus = 0x400A0005 + STATUS_CTX_CLOSE_PENDING NTStatus = 0xC00A0006 + STATUS_CTX_NO_OUTBUF NTStatus = 0xC00A0007 + STATUS_CTX_MODEM_INF_NOT_FOUND NTStatus = 0xC00A0008 + STATUS_CTX_INVALID_MODEMNAME NTStatus = 0xC00A0009 + STATUS_CTX_RESPONSE_ERROR NTStatus = 0xC00A000A + STATUS_CTX_MODEM_RESPONSE_TIMEOUT NTStatus = 0xC00A000B + STATUS_CTX_MODEM_RESPONSE_NO_CARRIER NTStatus = 0xC00A000C + STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE NTStatus = 0xC00A000D + STATUS_CTX_MODEM_RESPONSE_BUSY NTStatus = 0xC00A000E + STATUS_CTX_MODEM_RESPONSE_VOICE NTStatus = 0xC00A000F + STATUS_CTX_TD_ERROR NTStatus = 0xC00A0010 + STATUS_CTX_LICENSE_CLIENT_INVALID NTStatus = 0xC00A0012 + STATUS_CTX_LICENSE_NOT_AVAILABLE NTStatus = 0xC00A0013 + STATUS_CTX_LICENSE_EXPIRED NTStatus = 0xC00A0014 + STATUS_CTX_WINSTATION_NOT_FOUND NTStatus = 0xC00A0015 + STATUS_CTX_WINSTATION_NAME_COLLISION NTStatus = 0xC00A0016 + STATUS_CTX_WINSTATION_BUSY NTStatus = 0xC00A0017 + STATUS_CTX_BAD_VIDEO_MODE NTStatus = 0xC00A0018 + STATUS_CTX_GRAPHICS_INVALID NTStatus = 0xC00A0022 + STATUS_CTX_NOT_CONSOLE NTStatus = 0xC00A0024 + STATUS_CTX_CLIENT_QUERY_TIMEOUT NTStatus = 0xC00A0026 + STATUS_CTX_CONSOLE_DISCONNECT NTStatus = 0xC00A0027 + STATUS_CTX_CONSOLE_CONNECT NTStatus = 0xC00A0028 + STATUS_CTX_SHADOW_DENIED NTStatus = 0xC00A002A + STATUS_CTX_WINSTATION_ACCESS_DENIED NTStatus = 0xC00A002B + STATUS_CTX_INVALID_WD NTStatus = 0xC00A002E + STATUS_CTX_WD_NOT_FOUND NTStatus = 0xC00A002F + STATUS_CTX_SHADOW_INVALID NTStatus = 0xC00A0030 + STATUS_CTX_SHADOW_DISABLED NTStatus = 0xC00A0031 + STATUS_RDP_PROTOCOL_ERROR NTStatus = 0xC00A0032 + STATUS_CTX_CLIENT_LICENSE_NOT_SET NTStatus = 0xC00A0033 + STATUS_CTX_CLIENT_LICENSE_IN_USE NTStatus = 0xC00A0034 + STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE NTStatus = 0xC00A0035 + STATUS_CTX_SHADOW_NOT_RUNNING NTStatus = 0xC00A0036 + STATUS_CTX_LOGON_DISABLED NTStatus = 0xC00A0037 + STATUS_CTX_SECURITY_LAYER_ERROR NTStatus = 0xC00A0038 + STATUS_TS_INCOMPATIBLE_SESSIONS NTStatus = 0xC00A0039 + STATUS_TS_VIDEO_SUBSYSTEM_ERROR NTStatus = 0xC00A003A + STATUS_PNP_BAD_MPS_TABLE NTStatus = 0xC0040035 + STATUS_PNP_TRANSLATION_FAILED NTStatus = 0xC0040036 + STATUS_PNP_IRQ_TRANSLATION_FAILED NTStatus = 0xC0040037 + STATUS_PNP_INVALID_ID NTStatus = 0xC0040038 + STATUS_IO_REISSUE_AS_CACHED NTStatus = 0xC0040039 + STATUS_MUI_FILE_NOT_FOUND NTStatus = 0xC00B0001 + STATUS_MUI_INVALID_FILE NTStatus = 0xC00B0002 + STATUS_MUI_INVALID_RC_CONFIG NTStatus = 0xC00B0003 + STATUS_MUI_INVALID_LOCALE_NAME NTStatus = 0xC00B0004 + STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME NTStatus = 0xC00B0005 + STATUS_MUI_FILE_NOT_LOADED NTStatus = 0xC00B0006 + STATUS_RESOURCE_ENUM_USER_STOP NTStatus = 0xC00B0007 + STATUS_FLT_NO_HANDLER_DEFINED NTStatus = 0xC01C0001 + STATUS_FLT_CONTEXT_ALREADY_DEFINED NTStatus = 0xC01C0002 + STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST NTStatus = 0xC01C0003 + STATUS_FLT_DISALLOW_FAST_IO NTStatus = 0xC01C0004 + STATUS_FLT_INVALID_NAME_REQUEST NTStatus = 0xC01C0005 + STATUS_FLT_NOT_SAFE_TO_POST_OPERATION NTStatus = 0xC01C0006 + STATUS_FLT_NOT_INITIALIZED NTStatus = 0xC01C0007 + STATUS_FLT_FILTER_NOT_READY NTStatus = 0xC01C0008 + STATUS_FLT_POST_OPERATION_CLEANUP NTStatus = 0xC01C0009 + STATUS_FLT_INTERNAL_ERROR NTStatus = 0xC01C000A + STATUS_FLT_DELETING_OBJECT NTStatus = 0xC01C000B + STATUS_FLT_MUST_BE_NONPAGED_POOL NTStatus = 0xC01C000C + STATUS_FLT_DUPLICATE_ENTRY NTStatus = 0xC01C000D + STATUS_FLT_CBDQ_DISABLED NTStatus = 0xC01C000E + STATUS_FLT_DO_NOT_ATTACH NTStatus = 0xC01C000F + STATUS_FLT_DO_NOT_DETACH NTStatus = 0xC01C0010 + STATUS_FLT_INSTANCE_ALTITUDE_COLLISION NTStatus = 0xC01C0011 + STATUS_FLT_INSTANCE_NAME_COLLISION NTStatus = 0xC01C0012 + STATUS_FLT_FILTER_NOT_FOUND NTStatus = 0xC01C0013 + STATUS_FLT_VOLUME_NOT_FOUND NTStatus = 0xC01C0014 + STATUS_FLT_INSTANCE_NOT_FOUND NTStatus = 0xC01C0015 + STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND NTStatus = 0xC01C0016 + STATUS_FLT_INVALID_CONTEXT_REGISTRATION NTStatus = 0xC01C0017 + STATUS_FLT_NAME_CACHE_MISS NTStatus = 0xC01C0018 + STATUS_FLT_NO_DEVICE_OBJECT NTStatus = 0xC01C0019 + STATUS_FLT_VOLUME_ALREADY_MOUNTED NTStatus = 0xC01C001A + STATUS_FLT_ALREADY_ENLISTED NTStatus = 0xC01C001B + STATUS_FLT_CONTEXT_ALREADY_LINKED NTStatus = 0xC01C001C + STATUS_FLT_NO_WAITER_FOR_REPLY NTStatus = 0xC01C0020 + STATUS_FLT_REGISTRATION_BUSY NTStatus = 0xC01C0023 + STATUS_SXS_SECTION_NOT_FOUND NTStatus = 0xC0150001 + STATUS_SXS_CANT_GEN_ACTCTX NTStatus = 0xC0150002 + STATUS_SXS_INVALID_ACTCTXDATA_FORMAT NTStatus = 0xC0150003 + STATUS_SXS_ASSEMBLY_NOT_FOUND NTStatus = 0xC0150004 + STATUS_SXS_MANIFEST_FORMAT_ERROR NTStatus = 0xC0150005 + STATUS_SXS_MANIFEST_PARSE_ERROR NTStatus = 0xC0150006 + STATUS_SXS_ACTIVATION_CONTEXT_DISABLED NTStatus = 0xC0150007 + STATUS_SXS_KEY_NOT_FOUND NTStatus = 0xC0150008 + STATUS_SXS_VERSION_CONFLICT NTStatus = 0xC0150009 + STATUS_SXS_WRONG_SECTION_TYPE NTStatus = 0xC015000A + STATUS_SXS_THREAD_QUERIES_DISABLED NTStatus = 0xC015000B + STATUS_SXS_ASSEMBLY_MISSING NTStatus = 0xC015000C + STATUS_SXS_RELEASE_ACTIVATION_CONTEXT NTStatus = 0x4015000D + STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET NTStatus = 0xC015000E + STATUS_SXS_EARLY_DEACTIVATION NTStatus = 0xC015000F + STATUS_SXS_INVALID_DEACTIVATION NTStatus = 0xC0150010 + STATUS_SXS_MULTIPLE_DEACTIVATION NTStatus = 0xC0150011 + STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY NTStatus = 0xC0150012 + STATUS_SXS_PROCESS_TERMINATION_REQUESTED NTStatus = 0xC0150013 + STATUS_SXS_CORRUPT_ACTIVATION_STACK NTStatus = 0xC0150014 + STATUS_SXS_CORRUPTION NTStatus = 0xC0150015 + STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE NTStatus = 0xC0150016 + STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME NTStatus = 0xC0150017 + STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE NTStatus = 0xC0150018 + STATUS_SXS_IDENTITY_PARSE_ERROR NTStatus = 0xC0150019 + STATUS_SXS_COMPONENT_STORE_CORRUPT NTStatus = 0xC015001A + STATUS_SXS_FILE_HASH_MISMATCH NTStatus = 0xC015001B + STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT NTStatus = 0xC015001C + STATUS_SXS_IDENTITIES_DIFFERENT NTStatus = 0xC015001D + STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT NTStatus = 0xC015001E + STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY NTStatus = 0xC015001F + STATUS_ADVANCED_INSTALLER_FAILED NTStatus = 0xC0150020 + STATUS_XML_ENCODING_MISMATCH NTStatus = 0xC0150021 + STATUS_SXS_MANIFEST_TOO_BIG NTStatus = 0xC0150022 + STATUS_SXS_SETTING_NOT_REGISTERED NTStatus = 0xC0150023 + STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE NTStatus = 0xC0150024 + STATUS_SMI_PRIMITIVE_INSTALLER_FAILED NTStatus = 0xC0150025 + STATUS_GENERIC_COMMAND_FAILED NTStatus = 0xC0150026 + STATUS_SXS_FILE_HASH_MISSING NTStatus = 0xC0150027 + STATUS_CLUSTER_INVALID_NODE NTStatus = 0xC0130001 + STATUS_CLUSTER_NODE_EXISTS NTStatus = 0xC0130002 + STATUS_CLUSTER_JOIN_IN_PROGRESS NTStatus = 0xC0130003 + STATUS_CLUSTER_NODE_NOT_FOUND NTStatus = 0xC0130004 + STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND NTStatus = 0xC0130005 + STATUS_CLUSTER_NETWORK_EXISTS NTStatus = 0xC0130006 + STATUS_CLUSTER_NETWORK_NOT_FOUND NTStatus = 0xC0130007 + STATUS_CLUSTER_NETINTERFACE_EXISTS NTStatus = 0xC0130008 + STATUS_CLUSTER_NETINTERFACE_NOT_FOUND NTStatus = 0xC0130009 + STATUS_CLUSTER_INVALID_REQUEST NTStatus = 0xC013000A + STATUS_CLUSTER_INVALID_NETWORK_PROVIDER NTStatus = 0xC013000B + STATUS_CLUSTER_NODE_DOWN NTStatus = 0xC013000C + STATUS_CLUSTER_NODE_UNREACHABLE NTStatus = 0xC013000D + STATUS_CLUSTER_NODE_NOT_MEMBER NTStatus = 0xC013000E + STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS NTStatus = 0xC013000F + STATUS_CLUSTER_INVALID_NETWORK NTStatus = 0xC0130010 + STATUS_CLUSTER_NO_NET_ADAPTERS NTStatus = 0xC0130011 + STATUS_CLUSTER_NODE_UP NTStatus = 0xC0130012 + STATUS_CLUSTER_NODE_PAUSED NTStatus = 0xC0130013 + STATUS_CLUSTER_NODE_NOT_PAUSED NTStatus = 0xC0130014 + STATUS_CLUSTER_NO_SECURITY_CONTEXT NTStatus = 0xC0130015 + STATUS_CLUSTER_NETWORK_NOT_INTERNAL NTStatus = 0xC0130016 + STATUS_CLUSTER_POISONED NTStatus = 0xC0130017 + STATUS_CLUSTER_NON_CSV_PATH NTStatus = 0xC0130018 + STATUS_CLUSTER_CSV_VOLUME_NOT_LOCAL NTStatus = 0xC0130019 + STATUS_CLUSTER_CSV_READ_OPLOCK_BREAK_IN_PROGRESS NTStatus = 0xC0130020 + STATUS_CLUSTER_CSV_AUTO_PAUSE_ERROR NTStatus = 0xC0130021 + STATUS_CLUSTER_CSV_REDIRECTED NTStatus = 0xC0130022 + STATUS_CLUSTER_CSV_NOT_REDIRECTED NTStatus = 0xC0130023 + STATUS_CLUSTER_CSV_VOLUME_DRAINING NTStatus = 0xC0130024 + STATUS_CLUSTER_CSV_SNAPSHOT_CREATION_IN_PROGRESS NTStatus = 0xC0130025 + STATUS_CLUSTER_CSV_VOLUME_DRAINING_SUCCEEDED_DOWNLEVEL NTStatus = 0xC0130026 + STATUS_CLUSTER_CSV_NO_SNAPSHOTS NTStatus = 0xC0130027 + STATUS_CSV_IO_PAUSE_TIMEOUT NTStatus = 0xC0130028 + STATUS_CLUSTER_CSV_INVALID_HANDLE NTStatus = 0xC0130029 + STATUS_CLUSTER_CSV_SUPPORTED_ONLY_ON_COORDINATOR NTStatus = 0xC0130030 + STATUS_CLUSTER_CAM_TICKET_REPLAY_DETECTED NTStatus = 0xC0130031 + STATUS_TRANSACTIONAL_CONFLICT NTStatus = 0xC0190001 + STATUS_INVALID_TRANSACTION NTStatus = 0xC0190002 + STATUS_TRANSACTION_NOT_ACTIVE NTStatus = 0xC0190003 + STATUS_TM_INITIALIZATION_FAILED NTStatus = 0xC0190004 + STATUS_RM_NOT_ACTIVE NTStatus = 0xC0190005 + STATUS_RM_METADATA_CORRUPT NTStatus = 0xC0190006 + STATUS_TRANSACTION_NOT_JOINED NTStatus = 0xC0190007 + STATUS_DIRECTORY_NOT_RM NTStatus = 0xC0190008 + STATUS_COULD_NOT_RESIZE_LOG NTStatus = 0x80190009 + STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE NTStatus = 0xC019000A + STATUS_LOG_RESIZE_INVALID_SIZE NTStatus = 0xC019000B + STATUS_REMOTE_FILE_VERSION_MISMATCH NTStatus = 0xC019000C + STATUS_CRM_PROTOCOL_ALREADY_EXISTS NTStatus = 0xC019000F + STATUS_TRANSACTION_PROPAGATION_FAILED NTStatus = 0xC0190010 + STATUS_CRM_PROTOCOL_NOT_FOUND NTStatus = 0xC0190011 + STATUS_TRANSACTION_SUPERIOR_EXISTS NTStatus = 0xC0190012 + STATUS_TRANSACTION_REQUEST_NOT_VALID NTStatus = 0xC0190013 + STATUS_TRANSACTION_NOT_REQUESTED NTStatus = 0xC0190014 + STATUS_TRANSACTION_ALREADY_ABORTED NTStatus = 0xC0190015 + STATUS_TRANSACTION_ALREADY_COMMITTED NTStatus = 0xC0190016 + STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER NTStatus = 0xC0190017 + STATUS_CURRENT_TRANSACTION_NOT_VALID NTStatus = 0xC0190018 + STATUS_LOG_GROWTH_FAILED NTStatus = 0xC0190019 + STATUS_OBJECT_NO_LONGER_EXISTS NTStatus = 0xC0190021 + STATUS_STREAM_MINIVERSION_NOT_FOUND NTStatus = 0xC0190022 + STATUS_STREAM_MINIVERSION_NOT_VALID NTStatus = 0xC0190023 + STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION NTStatus = 0xC0190024 + STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT NTStatus = 0xC0190025 + STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS NTStatus = 0xC0190026 + STATUS_HANDLE_NO_LONGER_VALID NTStatus = 0xC0190028 + STATUS_NO_TXF_METADATA NTStatus = 0x80190029 + STATUS_LOG_CORRUPTION_DETECTED NTStatus = 0xC0190030 + STATUS_CANT_RECOVER_WITH_HANDLE_OPEN NTStatus = 0x80190031 + STATUS_RM_DISCONNECTED NTStatus = 0xC0190032 + STATUS_ENLISTMENT_NOT_SUPERIOR NTStatus = 0xC0190033 + STATUS_RECOVERY_NOT_NEEDED NTStatus = 0x40190034 + STATUS_RM_ALREADY_STARTED NTStatus = 0x40190035 + STATUS_FILE_IDENTITY_NOT_PERSISTENT NTStatus = 0xC0190036 + STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY NTStatus = 0xC0190037 + STATUS_CANT_CROSS_RM_BOUNDARY NTStatus = 0xC0190038 + STATUS_TXF_DIR_NOT_EMPTY NTStatus = 0xC0190039 + STATUS_INDOUBT_TRANSACTIONS_EXIST NTStatus = 0xC019003A + STATUS_TM_VOLATILE NTStatus = 0xC019003B + STATUS_ROLLBACK_TIMER_EXPIRED NTStatus = 0xC019003C + STATUS_TXF_ATTRIBUTE_CORRUPT NTStatus = 0xC019003D + STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION NTStatus = 0xC019003E + STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED NTStatus = 0xC019003F + STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE NTStatus = 0xC0190040 + STATUS_TXF_METADATA_ALREADY_PRESENT NTStatus = 0x80190041 + STATUS_TRANSACTION_SCOPE_CALLBACKS_NOT_SET NTStatus = 0x80190042 + STATUS_TRANSACTION_REQUIRED_PROMOTION NTStatus = 0xC0190043 + STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION NTStatus = 0xC0190044 + STATUS_TRANSACTIONS_NOT_FROZEN NTStatus = 0xC0190045 + STATUS_TRANSACTION_FREEZE_IN_PROGRESS NTStatus = 0xC0190046 + STATUS_NOT_SNAPSHOT_VOLUME NTStatus = 0xC0190047 + STATUS_NO_SAVEPOINT_WITH_OPEN_FILES NTStatus = 0xC0190048 + STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION NTStatus = 0xC0190049 + STATUS_TM_IDENTITY_MISMATCH NTStatus = 0xC019004A + STATUS_FLOATED_SECTION NTStatus = 0xC019004B + STATUS_CANNOT_ACCEPT_TRANSACTED_WORK NTStatus = 0xC019004C + STATUS_CANNOT_ABORT_TRANSACTIONS NTStatus = 0xC019004D + STATUS_TRANSACTION_NOT_FOUND NTStatus = 0xC019004E + STATUS_RESOURCEMANAGER_NOT_FOUND NTStatus = 0xC019004F + STATUS_ENLISTMENT_NOT_FOUND NTStatus = 0xC0190050 + STATUS_TRANSACTIONMANAGER_NOT_FOUND NTStatus = 0xC0190051 + STATUS_TRANSACTIONMANAGER_NOT_ONLINE NTStatus = 0xC0190052 + STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION NTStatus = 0xC0190053 + STATUS_TRANSACTION_NOT_ROOT NTStatus = 0xC0190054 + STATUS_TRANSACTION_OBJECT_EXPIRED NTStatus = 0xC0190055 + STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION NTStatus = 0xC0190056 + STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED NTStatus = 0xC0190057 + STATUS_TRANSACTION_RECORD_TOO_LONG NTStatus = 0xC0190058 + STATUS_NO_LINK_TRACKING_IN_TRANSACTION NTStatus = 0xC0190059 + STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION NTStatus = 0xC019005A + STATUS_TRANSACTION_INTEGRITY_VIOLATED NTStatus = 0xC019005B + STATUS_TRANSACTIONMANAGER_IDENTITY_MISMATCH NTStatus = 0xC019005C + STATUS_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT NTStatus = 0xC019005D + STATUS_TRANSACTION_MUST_WRITETHROUGH NTStatus = 0xC019005E + STATUS_TRANSACTION_NO_SUPERIOR NTStatus = 0xC019005F + STATUS_EXPIRED_HANDLE NTStatus = 0xC0190060 + STATUS_TRANSACTION_NOT_ENLISTED NTStatus = 0xC0190061 + STATUS_LOG_SECTOR_INVALID NTStatus = 0xC01A0001 + STATUS_LOG_SECTOR_PARITY_INVALID NTStatus = 0xC01A0002 + STATUS_LOG_SECTOR_REMAPPED NTStatus = 0xC01A0003 + STATUS_LOG_BLOCK_INCOMPLETE NTStatus = 0xC01A0004 + STATUS_LOG_INVALID_RANGE NTStatus = 0xC01A0005 + STATUS_LOG_BLOCKS_EXHAUSTED NTStatus = 0xC01A0006 + STATUS_LOG_READ_CONTEXT_INVALID NTStatus = 0xC01A0007 + STATUS_LOG_RESTART_INVALID NTStatus = 0xC01A0008 + STATUS_LOG_BLOCK_VERSION NTStatus = 0xC01A0009 + STATUS_LOG_BLOCK_INVALID NTStatus = 0xC01A000A + STATUS_LOG_READ_MODE_INVALID NTStatus = 0xC01A000B + STATUS_LOG_NO_RESTART NTStatus = 0x401A000C + STATUS_LOG_METADATA_CORRUPT NTStatus = 0xC01A000D + STATUS_LOG_METADATA_INVALID NTStatus = 0xC01A000E + STATUS_LOG_METADATA_INCONSISTENT NTStatus = 0xC01A000F + STATUS_LOG_RESERVATION_INVALID NTStatus = 0xC01A0010 + STATUS_LOG_CANT_DELETE NTStatus = 0xC01A0011 + STATUS_LOG_CONTAINER_LIMIT_EXCEEDED NTStatus = 0xC01A0012 + STATUS_LOG_START_OF_LOG NTStatus = 0xC01A0013 + STATUS_LOG_POLICY_ALREADY_INSTALLED NTStatus = 0xC01A0014 + STATUS_LOG_POLICY_NOT_INSTALLED NTStatus = 0xC01A0015 + STATUS_LOG_POLICY_INVALID NTStatus = 0xC01A0016 + STATUS_LOG_POLICY_CONFLICT NTStatus = 0xC01A0017 + STATUS_LOG_PINNED_ARCHIVE_TAIL NTStatus = 0xC01A0018 + STATUS_LOG_RECORD_NONEXISTENT NTStatus = 0xC01A0019 + STATUS_LOG_RECORDS_RESERVED_INVALID NTStatus = 0xC01A001A + STATUS_LOG_SPACE_RESERVED_INVALID NTStatus = 0xC01A001B + STATUS_LOG_TAIL_INVALID NTStatus = 0xC01A001C + STATUS_LOG_FULL NTStatus = 0xC01A001D + STATUS_LOG_MULTIPLEXED NTStatus = 0xC01A001E + STATUS_LOG_DEDICATED NTStatus = 0xC01A001F + STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS NTStatus = 0xC01A0020 + STATUS_LOG_ARCHIVE_IN_PROGRESS NTStatus = 0xC01A0021 + STATUS_LOG_EPHEMERAL NTStatus = 0xC01A0022 + STATUS_LOG_NOT_ENOUGH_CONTAINERS NTStatus = 0xC01A0023 + STATUS_LOG_CLIENT_ALREADY_REGISTERED NTStatus = 0xC01A0024 + STATUS_LOG_CLIENT_NOT_REGISTERED NTStatus = 0xC01A0025 + STATUS_LOG_FULL_HANDLER_IN_PROGRESS NTStatus = 0xC01A0026 + STATUS_LOG_CONTAINER_READ_FAILED NTStatus = 0xC01A0027 + STATUS_LOG_CONTAINER_WRITE_FAILED NTStatus = 0xC01A0028 + STATUS_LOG_CONTAINER_OPEN_FAILED NTStatus = 0xC01A0029 + STATUS_LOG_CONTAINER_STATE_INVALID NTStatus = 0xC01A002A + STATUS_LOG_STATE_INVALID NTStatus = 0xC01A002B + STATUS_LOG_PINNED NTStatus = 0xC01A002C + STATUS_LOG_METADATA_FLUSH_FAILED NTStatus = 0xC01A002D + STATUS_LOG_INCONSISTENT_SECURITY NTStatus = 0xC01A002E + STATUS_LOG_APPENDED_FLUSH_FAILED NTStatus = 0xC01A002F + STATUS_LOG_PINNED_RESERVATION NTStatus = 0xC01A0030 + STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD NTStatus = 0xC01B00EA + STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD_RECOVERED NTStatus = 0x801B00EB + STATUS_VIDEO_DRIVER_DEBUG_REPORT_REQUEST NTStatus = 0x401B00EC + STATUS_MONITOR_NO_DESCRIPTOR NTStatus = 0xC01D0001 + STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT NTStatus = 0xC01D0002 + STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM NTStatus = 0xC01D0003 + STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK NTStatus = 0xC01D0004 + STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED NTStatus = 0xC01D0005 + STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK NTStatus = 0xC01D0006 + STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK NTStatus = 0xC01D0007 + STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA NTStatus = 0xC01D0008 + STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK NTStatus = 0xC01D0009 + STATUS_MONITOR_INVALID_MANUFACTURE_DATE NTStatus = 0xC01D000A + STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER NTStatus = 0xC01E0000 + STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER NTStatus = 0xC01E0001 + STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER NTStatus = 0xC01E0002 + STATUS_GRAPHICS_ADAPTER_WAS_RESET NTStatus = 0xC01E0003 + STATUS_GRAPHICS_INVALID_DRIVER_MODEL NTStatus = 0xC01E0004 + STATUS_GRAPHICS_PRESENT_MODE_CHANGED NTStatus = 0xC01E0005 + STATUS_GRAPHICS_PRESENT_OCCLUDED NTStatus = 0xC01E0006 + STATUS_GRAPHICS_PRESENT_DENIED NTStatus = 0xC01E0007 + STATUS_GRAPHICS_CANNOTCOLORCONVERT NTStatus = 0xC01E0008 + STATUS_GRAPHICS_DRIVER_MISMATCH NTStatus = 0xC01E0009 + STATUS_GRAPHICS_PARTIAL_DATA_POPULATED NTStatus = 0x401E000A + STATUS_GRAPHICS_PRESENT_REDIRECTION_DISABLED NTStatus = 0xC01E000B + STATUS_GRAPHICS_PRESENT_UNOCCLUDED NTStatus = 0xC01E000C + STATUS_GRAPHICS_WINDOWDC_NOT_AVAILABLE NTStatus = 0xC01E000D + STATUS_GRAPHICS_WINDOWLESS_PRESENT_DISABLED NTStatus = 0xC01E000E + STATUS_GRAPHICS_PRESENT_INVALID_WINDOW NTStatus = 0xC01E000F + STATUS_GRAPHICS_PRESENT_BUFFER_NOT_BOUND NTStatus = 0xC01E0010 + STATUS_GRAPHICS_VAIL_STATE_CHANGED NTStatus = 0xC01E0011 + STATUS_GRAPHICS_INDIRECT_DISPLAY_ABANDON_SWAPCHAIN NTStatus = 0xC01E0012 + STATUS_GRAPHICS_INDIRECT_DISPLAY_DEVICE_STOPPED NTStatus = 0xC01E0013 + STATUS_GRAPHICS_NO_VIDEO_MEMORY NTStatus = 0xC01E0100 + STATUS_GRAPHICS_CANT_LOCK_MEMORY NTStatus = 0xC01E0101 + STATUS_GRAPHICS_ALLOCATION_BUSY NTStatus = 0xC01E0102 + STATUS_GRAPHICS_TOO_MANY_REFERENCES NTStatus = 0xC01E0103 + STATUS_GRAPHICS_TRY_AGAIN_LATER NTStatus = 0xC01E0104 + STATUS_GRAPHICS_TRY_AGAIN_NOW NTStatus = 0xC01E0105 + STATUS_GRAPHICS_ALLOCATION_INVALID NTStatus = 0xC01E0106 + STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE NTStatus = 0xC01E0107 + STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED NTStatus = 0xC01E0108 + STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION NTStatus = 0xC01E0109 + STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE NTStatus = 0xC01E0110 + STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION NTStatus = 0xC01E0111 + STATUS_GRAPHICS_ALLOCATION_CLOSED NTStatus = 0xC01E0112 + STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE NTStatus = 0xC01E0113 + STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE NTStatus = 0xC01E0114 + STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE NTStatus = 0xC01E0115 + STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST NTStatus = 0xC01E0116 + STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE NTStatus = 0xC01E0200 + STATUS_GRAPHICS_SKIP_ALLOCATION_PREPARATION NTStatus = 0x401E0201 + STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY NTStatus = 0xC01E0300 + STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED NTStatus = 0xC01E0301 + STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED NTStatus = 0xC01E0302 + STATUS_GRAPHICS_INVALID_VIDPN NTStatus = 0xC01E0303 + STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE NTStatus = 0xC01E0304 + STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET NTStatus = 0xC01E0305 + STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED NTStatus = 0xC01E0306 + STATUS_GRAPHICS_MODE_NOT_PINNED NTStatus = 0x401E0307 + STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET NTStatus = 0xC01E0308 + STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET NTStatus = 0xC01E0309 + STATUS_GRAPHICS_INVALID_FREQUENCY NTStatus = 0xC01E030A + STATUS_GRAPHICS_INVALID_ACTIVE_REGION NTStatus = 0xC01E030B + STATUS_GRAPHICS_INVALID_TOTAL_REGION NTStatus = 0xC01E030C + STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE NTStatus = 0xC01E0310 + STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE NTStatus = 0xC01E0311 + STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET NTStatus = 0xC01E0312 + STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY NTStatus = 0xC01E0313 + STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET NTStatus = 0xC01E0314 + STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET NTStatus = 0xC01E0315 + STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET NTStatus = 0xC01E0316 + STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET NTStatus = 0xC01E0317 + STATUS_GRAPHICS_TARGET_ALREADY_IN_SET NTStatus = 0xC01E0318 + STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH NTStatus = 0xC01E0319 + STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY NTStatus = 0xC01E031A + STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET NTStatus = 0xC01E031B + STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE NTStatus = 0xC01E031C + STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET NTStatus = 0xC01E031D + STATUS_GRAPHICS_NO_PREFERRED_MODE NTStatus = 0x401E031E + STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET NTStatus = 0xC01E031F + STATUS_GRAPHICS_STALE_MODESET NTStatus = 0xC01E0320 + STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET NTStatus = 0xC01E0321 + STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE NTStatus = 0xC01E0322 + STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN NTStatus = 0xC01E0323 + STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE NTStatus = 0xC01E0324 + STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION NTStatus = 0xC01E0325 + STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES NTStatus = 0xC01E0326 + STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY NTStatus = 0xC01E0327 + STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE NTStatus = 0xC01E0328 + STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET NTStatus = 0xC01E0329 + STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET NTStatus = 0xC01E032A + STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR NTStatus = 0xC01E032B + STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET NTStatus = 0xC01E032C + STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET NTStatus = 0xC01E032D + STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE NTStatus = 0xC01E032E + STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE NTStatus = 0xC01E032F + STATUS_GRAPHICS_RESOURCES_NOT_RELATED NTStatus = 0xC01E0330 + STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE NTStatus = 0xC01E0331 + STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE NTStatus = 0xC01E0332 + STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET NTStatus = 0xC01E0333 + STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER NTStatus = 0xC01E0334 + STATUS_GRAPHICS_NO_VIDPNMGR NTStatus = 0xC01E0335 + STATUS_GRAPHICS_NO_ACTIVE_VIDPN NTStatus = 0xC01E0336 + STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY NTStatus = 0xC01E0337 + STATUS_GRAPHICS_MONITOR_NOT_CONNECTED NTStatus = 0xC01E0338 + STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY NTStatus = 0xC01E0339 + STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE NTStatus = 0xC01E033A + STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE NTStatus = 0xC01E033B + STATUS_GRAPHICS_INVALID_STRIDE NTStatus = 0xC01E033C + STATUS_GRAPHICS_INVALID_PIXELFORMAT NTStatus = 0xC01E033D + STATUS_GRAPHICS_INVALID_COLORBASIS NTStatus = 0xC01E033E + STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE NTStatus = 0xC01E033F + STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY NTStatus = 0xC01E0340 + STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT NTStatus = 0xC01E0341 + STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE NTStatus = 0xC01E0342 + STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN NTStatus = 0xC01E0343 + STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL NTStatus = 0xC01E0344 + STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION NTStatus = 0xC01E0345 + STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED NTStatus = 0xC01E0346 + STATUS_GRAPHICS_INVALID_GAMMA_RAMP NTStatus = 0xC01E0347 + STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED NTStatus = 0xC01E0348 + STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED NTStatus = 0xC01E0349 + STATUS_GRAPHICS_MODE_NOT_IN_MODESET NTStatus = 0xC01E034A + STATUS_GRAPHICS_DATASET_IS_EMPTY NTStatus = 0x401E034B + STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET NTStatus = 0x401E034C + STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON NTStatus = 0xC01E034D + STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE NTStatus = 0xC01E034E + STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE NTStatus = 0xC01E034F + STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS NTStatus = 0xC01E0350 + STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED NTStatus = 0x401E0351 + STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING NTStatus = 0xC01E0352 + STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED NTStatus = 0xC01E0353 + STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS NTStatus = 0xC01E0354 + STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT NTStatus = 0xC01E0355 + STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM NTStatus = 0xC01E0356 + STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN NTStatus = 0xC01E0357 + STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT NTStatus = 0xC01E0358 + STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED NTStatus = 0xC01E0359 + STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION NTStatus = 0xC01E035A + STATUS_GRAPHICS_INVALID_CLIENT_TYPE NTStatus = 0xC01E035B + STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET NTStatus = 0xC01E035C + STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED NTStatus = 0xC01E0400 + STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED NTStatus = 0xC01E0401 + STATUS_GRAPHICS_UNKNOWN_CHILD_STATUS NTStatus = 0x401E042F + STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER NTStatus = 0xC01E0430 + STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED NTStatus = 0xC01E0431 + STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED NTStatus = 0xC01E0432 + STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY NTStatus = 0xC01E0433 + STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED NTStatus = 0xC01E0434 + STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON NTStatus = 0xC01E0435 + STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE NTStatus = 0xC01E0436 + STATUS_GRAPHICS_LEADLINK_START_DEFERRED NTStatus = 0x401E0437 + STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER NTStatus = 0xC01E0438 + STATUS_GRAPHICS_POLLING_TOO_FREQUENTLY NTStatus = 0x401E0439 + STATUS_GRAPHICS_START_DEFERRED NTStatus = 0x401E043A + STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED NTStatus = 0xC01E043B + STATUS_GRAPHICS_DEPENDABLE_CHILD_STATUS NTStatus = 0x401E043C + STATUS_GRAPHICS_OPM_NOT_SUPPORTED NTStatus = 0xC01E0500 + STATUS_GRAPHICS_COPP_NOT_SUPPORTED NTStatus = 0xC01E0501 + STATUS_GRAPHICS_UAB_NOT_SUPPORTED NTStatus = 0xC01E0502 + STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS NTStatus = 0xC01E0503 + STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST NTStatus = 0xC01E0505 + STATUS_GRAPHICS_OPM_INTERNAL_ERROR NTStatus = 0xC01E050B + STATUS_GRAPHICS_OPM_INVALID_HANDLE NTStatus = 0xC01E050C + STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH NTStatus = 0xC01E050E + STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED NTStatus = 0xC01E050F + STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED NTStatus = 0xC01E0510 + STATUS_GRAPHICS_PVP_HFS_FAILED NTStatus = 0xC01E0511 + STATUS_GRAPHICS_OPM_INVALID_SRM NTStatus = 0xC01E0512 + STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP NTStatus = 0xC01E0513 + STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP NTStatus = 0xC01E0514 + STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA NTStatus = 0xC01E0515 + STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET NTStatus = 0xC01E0516 + STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH NTStatus = 0xC01E0517 + STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE NTStatus = 0xC01E0518 + STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS NTStatus = 0xC01E051A + STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS NTStatus = 0xC01E051C + STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST NTStatus = 0xC01E051D + STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR NTStatus = 0xC01E051E + STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS NTStatus = 0xC01E051F + STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED NTStatus = 0xC01E0520 + STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST NTStatus = 0xC01E0521 + STATUS_GRAPHICS_I2C_NOT_SUPPORTED NTStatus = 0xC01E0580 + STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST NTStatus = 0xC01E0581 + STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA NTStatus = 0xC01E0582 + STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA NTStatus = 0xC01E0583 + STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED NTStatus = 0xC01E0584 + STATUS_GRAPHICS_DDCCI_INVALID_DATA NTStatus = 0xC01E0585 + STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE NTStatus = 0xC01E0586 + STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING NTStatus = 0xC01E0587 + STATUS_GRAPHICS_MCA_INTERNAL_ERROR NTStatus = 0xC01E0588 + STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND NTStatus = 0xC01E0589 + STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH NTStatus = 0xC01E058A + STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM NTStatus = 0xC01E058B + STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE NTStatus = 0xC01E058C + STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS NTStatus = 0xC01E058D + STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED NTStatus = 0xC01E05E0 + STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME NTStatus = 0xC01E05E1 + STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP NTStatus = 0xC01E05E2 + STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED NTStatus = 0xC01E05E3 + STATUS_GRAPHICS_INVALID_POINTER NTStatus = 0xC01E05E4 + STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE NTStatus = 0xC01E05E5 + STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL NTStatus = 0xC01E05E6 + STATUS_GRAPHICS_INTERNAL_ERROR NTStatus = 0xC01E05E7 + STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS NTStatus = 0xC01E05E8 + STATUS_FVE_LOCKED_VOLUME NTStatus = 0xC0210000 + STATUS_FVE_NOT_ENCRYPTED NTStatus = 0xC0210001 + STATUS_FVE_BAD_INFORMATION NTStatus = 0xC0210002 + STATUS_FVE_TOO_SMALL NTStatus = 0xC0210003 + STATUS_FVE_FAILED_WRONG_FS NTStatus = 0xC0210004 + STATUS_FVE_BAD_PARTITION_SIZE NTStatus = 0xC0210005 + STATUS_FVE_FS_NOT_EXTENDED NTStatus = 0xC0210006 + STATUS_FVE_FS_MOUNTED NTStatus = 0xC0210007 + STATUS_FVE_NO_LICENSE NTStatus = 0xC0210008 + STATUS_FVE_ACTION_NOT_ALLOWED NTStatus = 0xC0210009 + STATUS_FVE_BAD_DATA NTStatus = 0xC021000A + STATUS_FVE_VOLUME_NOT_BOUND NTStatus = 0xC021000B + STATUS_FVE_NOT_DATA_VOLUME NTStatus = 0xC021000C + STATUS_FVE_CONV_READ_ERROR NTStatus = 0xC021000D + STATUS_FVE_CONV_WRITE_ERROR NTStatus = 0xC021000E + STATUS_FVE_OVERLAPPED_UPDATE NTStatus = 0xC021000F + STATUS_FVE_FAILED_SECTOR_SIZE NTStatus = 0xC0210010 + STATUS_FVE_FAILED_AUTHENTICATION NTStatus = 0xC0210011 + STATUS_FVE_NOT_OS_VOLUME NTStatus = 0xC0210012 + STATUS_FVE_KEYFILE_NOT_FOUND NTStatus = 0xC0210013 + STATUS_FVE_KEYFILE_INVALID NTStatus = 0xC0210014 + STATUS_FVE_KEYFILE_NO_VMK NTStatus = 0xC0210015 + STATUS_FVE_TPM_DISABLED NTStatus = 0xC0210016 + STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO NTStatus = 0xC0210017 + STATUS_FVE_TPM_INVALID_PCR NTStatus = 0xC0210018 + STATUS_FVE_TPM_NO_VMK NTStatus = 0xC0210019 + STATUS_FVE_PIN_INVALID NTStatus = 0xC021001A + STATUS_FVE_AUTH_INVALID_APPLICATION NTStatus = 0xC021001B + STATUS_FVE_AUTH_INVALID_CONFIG NTStatus = 0xC021001C + STATUS_FVE_DEBUGGER_ENABLED NTStatus = 0xC021001D + STATUS_FVE_DRY_RUN_FAILED NTStatus = 0xC021001E + STATUS_FVE_BAD_METADATA_POINTER NTStatus = 0xC021001F + STATUS_FVE_OLD_METADATA_COPY NTStatus = 0xC0210020 + STATUS_FVE_REBOOT_REQUIRED NTStatus = 0xC0210021 + STATUS_FVE_RAW_ACCESS NTStatus = 0xC0210022 + STATUS_FVE_RAW_BLOCKED NTStatus = 0xC0210023 + STATUS_FVE_NO_AUTOUNLOCK_MASTER_KEY NTStatus = 0xC0210024 + STATUS_FVE_MOR_FAILED NTStatus = 0xC0210025 + STATUS_FVE_NO_FEATURE_LICENSE NTStatus = 0xC0210026 + STATUS_FVE_POLICY_USER_DISABLE_RDV_NOT_ALLOWED NTStatus = 0xC0210027 + STATUS_FVE_CONV_RECOVERY_FAILED NTStatus = 0xC0210028 + STATUS_FVE_VIRTUALIZED_SPACE_TOO_BIG NTStatus = 0xC0210029 + STATUS_FVE_INVALID_DATUM_TYPE NTStatus = 0xC021002A + STATUS_FVE_VOLUME_TOO_SMALL NTStatus = 0xC0210030 + STATUS_FVE_ENH_PIN_INVALID NTStatus = 0xC0210031 + STATUS_FVE_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE NTStatus = 0xC0210032 + STATUS_FVE_WIPE_NOT_ALLOWED_ON_TP_STORAGE NTStatus = 0xC0210033 + STATUS_FVE_NOT_ALLOWED_ON_CSV_STACK NTStatus = 0xC0210034 + STATUS_FVE_NOT_ALLOWED_ON_CLUSTER NTStatus = 0xC0210035 + STATUS_FVE_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING NTStatus = 0xC0210036 + STATUS_FVE_WIPE_CANCEL_NOT_APPLICABLE NTStatus = 0xC0210037 + STATUS_FVE_EDRIVE_DRY_RUN_FAILED NTStatus = 0xC0210038 + STATUS_FVE_SECUREBOOT_DISABLED NTStatus = 0xC0210039 + STATUS_FVE_SECUREBOOT_CONFIG_CHANGE NTStatus = 0xC021003A + STATUS_FVE_DEVICE_LOCKEDOUT NTStatus = 0xC021003B + STATUS_FVE_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT NTStatus = 0xC021003C + STATUS_FVE_NOT_DE_VOLUME NTStatus = 0xC021003D + STATUS_FVE_PROTECTION_DISABLED NTStatus = 0xC021003E + STATUS_FVE_PROTECTION_CANNOT_BE_DISABLED NTStatus = 0xC021003F + STATUS_FVE_OSV_KSR_NOT_ALLOWED NTStatus = 0xC0210040 + STATUS_FWP_CALLOUT_NOT_FOUND NTStatus = 0xC0220001 + STATUS_FWP_CONDITION_NOT_FOUND NTStatus = 0xC0220002 + STATUS_FWP_FILTER_NOT_FOUND NTStatus = 0xC0220003 + STATUS_FWP_LAYER_NOT_FOUND NTStatus = 0xC0220004 + STATUS_FWP_PROVIDER_NOT_FOUND NTStatus = 0xC0220005 + STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND NTStatus = 0xC0220006 + STATUS_FWP_SUBLAYER_NOT_FOUND NTStatus = 0xC0220007 + STATUS_FWP_NOT_FOUND NTStatus = 0xC0220008 + STATUS_FWP_ALREADY_EXISTS NTStatus = 0xC0220009 + STATUS_FWP_IN_USE NTStatus = 0xC022000A + STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS NTStatus = 0xC022000B + STATUS_FWP_WRONG_SESSION NTStatus = 0xC022000C + STATUS_FWP_NO_TXN_IN_PROGRESS NTStatus = 0xC022000D + STATUS_FWP_TXN_IN_PROGRESS NTStatus = 0xC022000E + STATUS_FWP_TXN_ABORTED NTStatus = 0xC022000F + STATUS_FWP_SESSION_ABORTED NTStatus = 0xC0220010 + STATUS_FWP_INCOMPATIBLE_TXN NTStatus = 0xC0220011 + STATUS_FWP_TIMEOUT NTStatus = 0xC0220012 + STATUS_FWP_NET_EVENTS_DISABLED NTStatus = 0xC0220013 + STATUS_FWP_INCOMPATIBLE_LAYER NTStatus = 0xC0220014 + STATUS_FWP_KM_CLIENTS_ONLY NTStatus = 0xC0220015 + STATUS_FWP_LIFETIME_MISMATCH NTStatus = 0xC0220016 + STATUS_FWP_BUILTIN_OBJECT NTStatus = 0xC0220017 + STATUS_FWP_TOO_MANY_CALLOUTS NTStatus = 0xC0220018 + STATUS_FWP_NOTIFICATION_DROPPED NTStatus = 0xC0220019 + STATUS_FWP_TRAFFIC_MISMATCH NTStatus = 0xC022001A + STATUS_FWP_INCOMPATIBLE_SA_STATE NTStatus = 0xC022001B + STATUS_FWP_NULL_POINTER NTStatus = 0xC022001C + STATUS_FWP_INVALID_ENUMERATOR NTStatus = 0xC022001D + STATUS_FWP_INVALID_FLAGS NTStatus = 0xC022001E + STATUS_FWP_INVALID_NET_MASK NTStatus = 0xC022001F + STATUS_FWP_INVALID_RANGE NTStatus = 0xC0220020 + STATUS_FWP_INVALID_INTERVAL NTStatus = 0xC0220021 + STATUS_FWP_ZERO_LENGTH_ARRAY NTStatus = 0xC0220022 + STATUS_FWP_NULL_DISPLAY_NAME NTStatus = 0xC0220023 + STATUS_FWP_INVALID_ACTION_TYPE NTStatus = 0xC0220024 + STATUS_FWP_INVALID_WEIGHT NTStatus = 0xC0220025 + STATUS_FWP_MATCH_TYPE_MISMATCH NTStatus = 0xC0220026 + STATUS_FWP_TYPE_MISMATCH NTStatus = 0xC0220027 + STATUS_FWP_OUT_OF_BOUNDS NTStatus = 0xC0220028 + STATUS_FWP_RESERVED NTStatus = 0xC0220029 + STATUS_FWP_DUPLICATE_CONDITION NTStatus = 0xC022002A + STATUS_FWP_DUPLICATE_KEYMOD NTStatus = 0xC022002B + STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER NTStatus = 0xC022002C + STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER NTStatus = 0xC022002D + STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER NTStatus = 0xC022002E + STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT NTStatus = 0xC022002F + STATUS_FWP_INCOMPATIBLE_AUTH_METHOD NTStatus = 0xC0220030 + STATUS_FWP_INCOMPATIBLE_DH_GROUP NTStatus = 0xC0220031 + STATUS_FWP_EM_NOT_SUPPORTED NTStatus = 0xC0220032 + STATUS_FWP_NEVER_MATCH NTStatus = 0xC0220033 + STATUS_FWP_PROVIDER_CONTEXT_MISMATCH NTStatus = 0xC0220034 + STATUS_FWP_INVALID_PARAMETER NTStatus = 0xC0220035 + STATUS_FWP_TOO_MANY_SUBLAYERS NTStatus = 0xC0220036 + STATUS_FWP_CALLOUT_NOTIFICATION_FAILED NTStatus = 0xC0220037 + STATUS_FWP_INVALID_AUTH_TRANSFORM NTStatus = 0xC0220038 + STATUS_FWP_INVALID_CIPHER_TRANSFORM NTStatus = 0xC0220039 + STATUS_FWP_INCOMPATIBLE_CIPHER_TRANSFORM NTStatus = 0xC022003A + STATUS_FWP_INVALID_TRANSFORM_COMBINATION NTStatus = 0xC022003B + STATUS_FWP_DUPLICATE_AUTH_METHOD NTStatus = 0xC022003C + STATUS_FWP_INVALID_TUNNEL_ENDPOINT NTStatus = 0xC022003D + STATUS_FWP_L2_DRIVER_NOT_READY NTStatus = 0xC022003E + STATUS_FWP_KEY_DICTATOR_ALREADY_REGISTERED NTStatus = 0xC022003F + STATUS_FWP_KEY_DICTATION_INVALID_KEYING_MATERIAL NTStatus = 0xC0220040 + STATUS_FWP_CONNECTIONS_DISABLED NTStatus = 0xC0220041 + STATUS_FWP_INVALID_DNS_NAME NTStatus = 0xC0220042 + STATUS_FWP_STILL_ON NTStatus = 0xC0220043 + STATUS_FWP_IKEEXT_NOT_RUNNING NTStatus = 0xC0220044 + STATUS_FWP_TCPIP_NOT_READY NTStatus = 0xC0220100 + STATUS_FWP_INJECT_HANDLE_CLOSING NTStatus = 0xC0220101 + STATUS_FWP_INJECT_HANDLE_STALE NTStatus = 0xC0220102 + STATUS_FWP_CANNOT_PEND NTStatus = 0xC0220103 + STATUS_FWP_DROP_NOICMP NTStatus = 0xC0220104 + STATUS_NDIS_CLOSING NTStatus = 0xC0230002 + STATUS_NDIS_BAD_VERSION NTStatus = 0xC0230004 + STATUS_NDIS_BAD_CHARACTERISTICS NTStatus = 0xC0230005 + STATUS_NDIS_ADAPTER_NOT_FOUND NTStatus = 0xC0230006 + STATUS_NDIS_OPEN_FAILED NTStatus = 0xC0230007 + STATUS_NDIS_DEVICE_FAILED NTStatus = 0xC0230008 + STATUS_NDIS_MULTICAST_FULL NTStatus = 0xC0230009 + STATUS_NDIS_MULTICAST_EXISTS NTStatus = 0xC023000A + STATUS_NDIS_MULTICAST_NOT_FOUND NTStatus = 0xC023000B + STATUS_NDIS_REQUEST_ABORTED NTStatus = 0xC023000C + STATUS_NDIS_RESET_IN_PROGRESS NTStatus = 0xC023000D + STATUS_NDIS_NOT_SUPPORTED NTStatus = 0xC02300BB + STATUS_NDIS_INVALID_PACKET NTStatus = 0xC023000F + STATUS_NDIS_ADAPTER_NOT_READY NTStatus = 0xC0230011 + STATUS_NDIS_INVALID_LENGTH NTStatus = 0xC0230014 + STATUS_NDIS_INVALID_DATA NTStatus = 0xC0230015 + STATUS_NDIS_BUFFER_TOO_SHORT NTStatus = 0xC0230016 + STATUS_NDIS_INVALID_OID NTStatus = 0xC0230017 + STATUS_NDIS_ADAPTER_REMOVED NTStatus = 0xC0230018 + STATUS_NDIS_UNSUPPORTED_MEDIA NTStatus = 0xC0230019 + STATUS_NDIS_GROUP_ADDRESS_IN_USE NTStatus = 0xC023001A + STATUS_NDIS_FILE_NOT_FOUND NTStatus = 0xC023001B + STATUS_NDIS_ERROR_READING_FILE NTStatus = 0xC023001C + STATUS_NDIS_ALREADY_MAPPED NTStatus = 0xC023001D + STATUS_NDIS_RESOURCE_CONFLICT NTStatus = 0xC023001E + STATUS_NDIS_MEDIA_DISCONNECTED NTStatus = 0xC023001F + STATUS_NDIS_INVALID_ADDRESS NTStatus = 0xC0230022 + STATUS_NDIS_INVALID_DEVICE_REQUEST NTStatus = 0xC0230010 + STATUS_NDIS_PAUSED NTStatus = 0xC023002A + STATUS_NDIS_INTERFACE_NOT_FOUND NTStatus = 0xC023002B + STATUS_NDIS_UNSUPPORTED_REVISION NTStatus = 0xC023002C + STATUS_NDIS_INVALID_PORT NTStatus = 0xC023002D + STATUS_NDIS_INVALID_PORT_STATE NTStatus = 0xC023002E + STATUS_NDIS_LOW_POWER_STATE NTStatus = 0xC023002F + STATUS_NDIS_REINIT_REQUIRED NTStatus = 0xC0230030 + STATUS_NDIS_NO_QUEUES NTStatus = 0xC0230031 + STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED NTStatus = 0xC0232000 + STATUS_NDIS_DOT11_MEDIA_IN_USE NTStatus = 0xC0232001 + STATUS_NDIS_DOT11_POWER_STATE_INVALID NTStatus = 0xC0232002 + STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL NTStatus = 0xC0232003 + STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL NTStatus = 0xC0232004 + STATUS_NDIS_DOT11_AP_CHANNEL_CURRENTLY_NOT_AVAILABLE NTStatus = 0xC0232005 + STATUS_NDIS_DOT11_AP_BAND_CURRENTLY_NOT_AVAILABLE NTStatus = 0xC0232006 + STATUS_NDIS_DOT11_AP_CHANNEL_NOT_ALLOWED NTStatus = 0xC0232007 + STATUS_NDIS_DOT11_AP_BAND_NOT_ALLOWED NTStatus = 0xC0232008 + STATUS_NDIS_INDICATION_REQUIRED NTStatus = 0x40230001 + STATUS_NDIS_OFFLOAD_POLICY NTStatus = 0xC023100F + STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED NTStatus = 0xC0231012 + STATUS_NDIS_OFFLOAD_PATH_REJECTED NTStatus = 0xC0231013 + STATUS_TPM_ERROR_MASK NTStatus = 0xC0290000 + STATUS_TPM_AUTHFAIL NTStatus = 0xC0290001 + STATUS_TPM_BADINDEX NTStatus = 0xC0290002 + STATUS_TPM_BAD_PARAMETER NTStatus = 0xC0290003 + STATUS_TPM_AUDITFAILURE NTStatus = 0xC0290004 + STATUS_TPM_CLEAR_DISABLED NTStatus = 0xC0290005 + STATUS_TPM_DEACTIVATED NTStatus = 0xC0290006 + STATUS_TPM_DISABLED NTStatus = 0xC0290007 + STATUS_TPM_DISABLED_CMD NTStatus = 0xC0290008 + STATUS_TPM_FAIL NTStatus = 0xC0290009 + STATUS_TPM_BAD_ORDINAL NTStatus = 0xC029000A + STATUS_TPM_INSTALL_DISABLED NTStatus = 0xC029000B + STATUS_TPM_INVALID_KEYHANDLE NTStatus = 0xC029000C + STATUS_TPM_KEYNOTFOUND NTStatus = 0xC029000D + STATUS_TPM_INAPPROPRIATE_ENC NTStatus = 0xC029000E + STATUS_TPM_MIGRATEFAIL NTStatus = 0xC029000F + STATUS_TPM_INVALID_PCR_INFO NTStatus = 0xC0290010 + STATUS_TPM_NOSPACE NTStatus = 0xC0290011 + STATUS_TPM_NOSRK NTStatus = 0xC0290012 + STATUS_TPM_NOTSEALED_BLOB NTStatus = 0xC0290013 + STATUS_TPM_OWNER_SET NTStatus = 0xC0290014 + STATUS_TPM_RESOURCES NTStatus = 0xC0290015 + STATUS_TPM_SHORTRANDOM NTStatus = 0xC0290016 + STATUS_TPM_SIZE NTStatus = 0xC0290017 + STATUS_TPM_WRONGPCRVAL NTStatus = 0xC0290018 + STATUS_TPM_BAD_PARAM_SIZE NTStatus = 0xC0290019 + STATUS_TPM_SHA_THREAD NTStatus = 0xC029001A + STATUS_TPM_SHA_ERROR NTStatus = 0xC029001B + STATUS_TPM_FAILEDSELFTEST NTStatus = 0xC029001C + STATUS_TPM_AUTH2FAIL NTStatus = 0xC029001D + STATUS_TPM_BADTAG NTStatus = 0xC029001E + STATUS_TPM_IOERROR NTStatus = 0xC029001F + STATUS_TPM_ENCRYPT_ERROR NTStatus = 0xC0290020 + STATUS_TPM_DECRYPT_ERROR NTStatus = 0xC0290021 + STATUS_TPM_INVALID_AUTHHANDLE NTStatus = 0xC0290022 + STATUS_TPM_NO_ENDORSEMENT NTStatus = 0xC0290023 + STATUS_TPM_INVALID_KEYUSAGE NTStatus = 0xC0290024 + STATUS_TPM_WRONG_ENTITYTYPE NTStatus = 0xC0290025 + STATUS_TPM_INVALID_POSTINIT NTStatus = 0xC0290026 + STATUS_TPM_INAPPROPRIATE_SIG NTStatus = 0xC0290027 + STATUS_TPM_BAD_KEY_PROPERTY NTStatus = 0xC0290028 + STATUS_TPM_BAD_MIGRATION NTStatus = 0xC0290029 + STATUS_TPM_BAD_SCHEME NTStatus = 0xC029002A + STATUS_TPM_BAD_DATASIZE NTStatus = 0xC029002B + STATUS_TPM_BAD_MODE NTStatus = 0xC029002C + STATUS_TPM_BAD_PRESENCE NTStatus = 0xC029002D + STATUS_TPM_BAD_VERSION NTStatus = 0xC029002E + STATUS_TPM_NO_WRAP_TRANSPORT NTStatus = 0xC029002F + STATUS_TPM_AUDITFAIL_UNSUCCESSFUL NTStatus = 0xC0290030 + STATUS_TPM_AUDITFAIL_SUCCESSFUL NTStatus = 0xC0290031 + STATUS_TPM_NOTRESETABLE NTStatus = 0xC0290032 + STATUS_TPM_NOTLOCAL NTStatus = 0xC0290033 + STATUS_TPM_BAD_TYPE NTStatus = 0xC0290034 + STATUS_TPM_INVALID_RESOURCE NTStatus = 0xC0290035 + STATUS_TPM_NOTFIPS NTStatus = 0xC0290036 + STATUS_TPM_INVALID_FAMILY NTStatus = 0xC0290037 + STATUS_TPM_NO_NV_PERMISSION NTStatus = 0xC0290038 + STATUS_TPM_REQUIRES_SIGN NTStatus = 0xC0290039 + STATUS_TPM_KEY_NOTSUPPORTED NTStatus = 0xC029003A + STATUS_TPM_AUTH_CONFLICT NTStatus = 0xC029003B + STATUS_TPM_AREA_LOCKED NTStatus = 0xC029003C + STATUS_TPM_BAD_LOCALITY NTStatus = 0xC029003D + STATUS_TPM_READ_ONLY NTStatus = 0xC029003E + STATUS_TPM_PER_NOWRITE NTStatus = 0xC029003F + STATUS_TPM_FAMILYCOUNT NTStatus = 0xC0290040 + STATUS_TPM_WRITE_LOCKED NTStatus = 0xC0290041 + STATUS_TPM_BAD_ATTRIBUTES NTStatus = 0xC0290042 + STATUS_TPM_INVALID_STRUCTURE NTStatus = 0xC0290043 + STATUS_TPM_KEY_OWNER_CONTROL NTStatus = 0xC0290044 + STATUS_TPM_BAD_COUNTER NTStatus = 0xC0290045 + STATUS_TPM_NOT_FULLWRITE NTStatus = 0xC0290046 + STATUS_TPM_CONTEXT_GAP NTStatus = 0xC0290047 + STATUS_TPM_MAXNVWRITES NTStatus = 0xC0290048 + STATUS_TPM_NOOPERATOR NTStatus = 0xC0290049 + STATUS_TPM_RESOURCEMISSING NTStatus = 0xC029004A + STATUS_TPM_DELEGATE_LOCK NTStatus = 0xC029004B + STATUS_TPM_DELEGATE_FAMILY NTStatus = 0xC029004C + STATUS_TPM_DELEGATE_ADMIN NTStatus = 0xC029004D + STATUS_TPM_TRANSPORT_NOTEXCLUSIVE NTStatus = 0xC029004E + STATUS_TPM_OWNER_CONTROL NTStatus = 0xC029004F + STATUS_TPM_DAA_RESOURCES NTStatus = 0xC0290050 + STATUS_TPM_DAA_INPUT_DATA0 NTStatus = 0xC0290051 + STATUS_TPM_DAA_INPUT_DATA1 NTStatus = 0xC0290052 + STATUS_TPM_DAA_ISSUER_SETTINGS NTStatus = 0xC0290053 + STATUS_TPM_DAA_TPM_SETTINGS NTStatus = 0xC0290054 + STATUS_TPM_DAA_STAGE NTStatus = 0xC0290055 + STATUS_TPM_DAA_ISSUER_VALIDITY NTStatus = 0xC0290056 + STATUS_TPM_DAA_WRONG_W NTStatus = 0xC0290057 + STATUS_TPM_BAD_HANDLE NTStatus = 0xC0290058 + STATUS_TPM_BAD_DELEGATE NTStatus = 0xC0290059 + STATUS_TPM_BADCONTEXT NTStatus = 0xC029005A + STATUS_TPM_TOOMANYCONTEXTS NTStatus = 0xC029005B + STATUS_TPM_MA_TICKET_SIGNATURE NTStatus = 0xC029005C + STATUS_TPM_MA_DESTINATION NTStatus = 0xC029005D + STATUS_TPM_MA_SOURCE NTStatus = 0xC029005E + STATUS_TPM_MA_AUTHORITY NTStatus = 0xC029005F + STATUS_TPM_PERMANENTEK NTStatus = 0xC0290061 + STATUS_TPM_BAD_SIGNATURE NTStatus = 0xC0290062 + STATUS_TPM_NOCONTEXTSPACE NTStatus = 0xC0290063 + STATUS_TPM_20_E_ASYMMETRIC NTStatus = 0xC0290081 + STATUS_TPM_20_E_ATTRIBUTES NTStatus = 0xC0290082 + STATUS_TPM_20_E_HASH NTStatus = 0xC0290083 + STATUS_TPM_20_E_VALUE NTStatus = 0xC0290084 + STATUS_TPM_20_E_HIERARCHY NTStatus = 0xC0290085 + STATUS_TPM_20_E_KEY_SIZE NTStatus = 0xC0290087 + STATUS_TPM_20_E_MGF NTStatus = 0xC0290088 + STATUS_TPM_20_E_MODE NTStatus = 0xC0290089 + STATUS_TPM_20_E_TYPE NTStatus = 0xC029008A + STATUS_TPM_20_E_HANDLE NTStatus = 0xC029008B + STATUS_TPM_20_E_KDF NTStatus = 0xC029008C + STATUS_TPM_20_E_RANGE NTStatus = 0xC029008D + STATUS_TPM_20_E_AUTH_FAIL NTStatus = 0xC029008E + STATUS_TPM_20_E_NONCE NTStatus = 0xC029008F + STATUS_TPM_20_E_PP NTStatus = 0xC0290090 + STATUS_TPM_20_E_SCHEME NTStatus = 0xC0290092 + STATUS_TPM_20_E_SIZE NTStatus = 0xC0290095 + STATUS_TPM_20_E_SYMMETRIC NTStatus = 0xC0290096 + STATUS_TPM_20_E_TAG NTStatus = 0xC0290097 + STATUS_TPM_20_E_SELECTOR NTStatus = 0xC0290098 + STATUS_TPM_20_E_INSUFFICIENT NTStatus = 0xC029009A + STATUS_TPM_20_E_SIGNATURE NTStatus = 0xC029009B + STATUS_TPM_20_E_KEY NTStatus = 0xC029009C + STATUS_TPM_20_E_POLICY_FAIL NTStatus = 0xC029009D + STATUS_TPM_20_E_INTEGRITY NTStatus = 0xC029009F + STATUS_TPM_20_E_TICKET NTStatus = 0xC02900A0 + STATUS_TPM_20_E_RESERVED_BITS NTStatus = 0xC02900A1 + STATUS_TPM_20_E_BAD_AUTH NTStatus = 0xC02900A2 + STATUS_TPM_20_E_EXPIRED NTStatus = 0xC02900A3 + STATUS_TPM_20_E_POLICY_CC NTStatus = 0xC02900A4 + STATUS_TPM_20_E_BINDING NTStatus = 0xC02900A5 + STATUS_TPM_20_E_CURVE NTStatus = 0xC02900A6 + STATUS_TPM_20_E_ECC_POINT NTStatus = 0xC02900A7 + STATUS_TPM_20_E_INITIALIZE NTStatus = 0xC0290100 + STATUS_TPM_20_E_FAILURE NTStatus = 0xC0290101 + STATUS_TPM_20_E_SEQUENCE NTStatus = 0xC0290103 + STATUS_TPM_20_E_PRIVATE NTStatus = 0xC029010B + STATUS_TPM_20_E_HMAC NTStatus = 0xC0290119 + STATUS_TPM_20_E_DISABLED NTStatus = 0xC0290120 + STATUS_TPM_20_E_EXCLUSIVE NTStatus = 0xC0290121 + STATUS_TPM_20_E_ECC_CURVE NTStatus = 0xC0290123 + STATUS_TPM_20_E_AUTH_TYPE NTStatus = 0xC0290124 + STATUS_TPM_20_E_AUTH_MISSING NTStatus = 0xC0290125 + STATUS_TPM_20_E_POLICY NTStatus = 0xC0290126 + STATUS_TPM_20_E_PCR NTStatus = 0xC0290127 + STATUS_TPM_20_E_PCR_CHANGED NTStatus = 0xC0290128 + STATUS_TPM_20_E_UPGRADE NTStatus = 0xC029012D + STATUS_TPM_20_E_TOO_MANY_CONTEXTS NTStatus = 0xC029012E + STATUS_TPM_20_E_AUTH_UNAVAILABLE NTStatus = 0xC029012F + STATUS_TPM_20_E_REBOOT NTStatus = 0xC0290130 + STATUS_TPM_20_E_UNBALANCED NTStatus = 0xC0290131 + STATUS_TPM_20_E_COMMAND_SIZE NTStatus = 0xC0290142 + STATUS_TPM_20_E_COMMAND_CODE NTStatus = 0xC0290143 + STATUS_TPM_20_E_AUTHSIZE NTStatus = 0xC0290144 + STATUS_TPM_20_E_AUTH_CONTEXT NTStatus = 0xC0290145 + STATUS_TPM_20_E_NV_RANGE NTStatus = 0xC0290146 + STATUS_TPM_20_E_NV_SIZE NTStatus = 0xC0290147 + STATUS_TPM_20_E_NV_LOCKED NTStatus = 0xC0290148 + STATUS_TPM_20_E_NV_AUTHORIZATION NTStatus = 0xC0290149 + STATUS_TPM_20_E_NV_UNINITIALIZED NTStatus = 0xC029014A + STATUS_TPM_20_E_NV_SPACE NTStatus = 0xC029014B + STATUS_TPM_20_E_NV_DEFINED NTStatus = 0xC029014C + STATUS_TPM_20_E_BAD_CONTEXT NTStatus = 0xC0290150 + STATUS_TPM_20_E_CPHASH NTStatus = 0xC0290151 + STATUS_TPM_20_E_PARENT NTStatus = 0xC0290152 + STATUS_TPM_20_E_NEEDS_TEST NTStatus = 0xC0290153 + STATUS_TPM_20_E_NO_RESULT NTStatus = 0xC0290154 + STATUS_TPM_20_E_SENSITIVE NTStatus = 0xC0290155 + STATUS_TPM_COMMAND_BLOCKED NTStatus = 0xC0290400 + STATUS_TPM_INVALID_HANDLE NTStatus = 0xC0290401 + STATUS_TPM_DUPLICATE_VHANDLE NTStatus = 0xC0290402 + STATUS_TPM_EMBEDDED_COMMAND_BLOCKED NTStatus = 0xC0290403 + STATUS_TPM_EMBEDDED_COMMAND_UNSUPPORTED NTStatus = 0xC0290404 + STATUS_TPM_RETRY NTStatus = 0xC0290800 + STATUS_TPM_NEEDS_SELFTEST NTStatus = 0xC0290801 + STATUS_TPM_DOING_SELFTEST NTStatus = 0xC0290802 + STATUS_TPM_DEFEND_LOCK_RUNNING NTStatus = 0xC0290803 + STATUS_TPM_COMMAND_CANCELED NTStatus = 0xC0291001 + STATUS_TPM_TOO_MANY_CONTEXTS NTStatus = 0xC0291002 + STATUS_TPM_NOT_FOUND NTStatus = 0xC0291003 + STATUS_TPM_ACCESS_DENIED NTStatus = 0xC0291004 + STATUS_TPM_INSUFFICIENT_BUFFER NTStatus = 0xC0291005 + STATUS_TPM_PPI_FUNCTION_UNSUPPORTED NTStatus = 0xC0291006 + STATUS_PCP_ERROR_MASK NTStatus = 0xC0292000 + STATUS_PCP_DEVICE_NOT_READY NTStatus = 0xC0292001 + STATUS_PCP_INVALID_HANDLE NTStatus = 0xC0292002 + STATUS_PCP_INVALID_PARAMETER NTStatus = 0xC0292003 + STATUS_PCP_FLAG_NOT_SUPPORTED NTStatus = 0xC0292004 + STATUS_PCP_NOT_SUPPORTED NTStatus = 0xC0292005 + STATUS_PCP_BUFFER_TOO_SMALL NTStatus = 0xC0292006 + STATUS_PCP_INTERNAL_ERROR NTStatus = 0xC0292007 + STATUS_PCP_AUTHENTICATION_FAILED NTStatus = 0xC0292008 + STATUS_PCP_AUTHENTICATION_IGNORED NTStatus = 0xC0292009 + STATUS_PCP_POLICY_NOT_FOUND NTStatus = 0xC029200A + STATUS_PCP_PROFILE_NOT_FOUND NTStatus = 0xC029200B + STATUS_PCP_VALIDATION_FAILED NTStatus = 0xC029200C + STATUS_PCP_DEVICE_NOT_FOUND NTStatus = 0xC029200D + STATUS_PCP_WRONG_PARENT NTStatus = 0xC029200E + STATUS_PCP_KEY_NOT_LOADED NTStatus = 0xC029200F + STATUS_PCP_NO_KEY_CERTIFICATION NTStatus = 0xC0292010 + STATUS_PCP_KEY_NOT_FINALIZED NTStatus = 0xC0292011 + STATUS_PCP_ATTESTATION_CHALLENGE_NOT_SET NTStatus = 0xC0292012 + STATUS_PCP_NOT_PCR_BOUND NTStatus = 0xC0292013 + STATUS_PCP_KEY_ALREADY_FINALIZED NTStatus = 0xC0292014 + STATUS_PCP_KEY_USAGE_POLICY_NOT_SUPPORTED NTStatus = 0xC0292015 + STATUS_PCP_KEY_USAGE_POLICY_INVALID NTStatus = 0xC0292016 + STATUS_PCP_SOFT_KEY_ERROR NTStatus = 0xC0292017 + STATUS_PCP_KEY_NOT_AUTHENTICATED NTStatus = 0xC0292018 + STATUS_PCP_KEY_NOT_AIK NTStatus = 0xC0292019 + STATUS_PCP_KEY_NOT_SIGNING_KEY NTStatus = 0xC029201A + STATUS_PCP_LOCKED_OUT NTStatus = 0xC029201B + STATUS_PCP_CLAIM_TYPE_NOT_SUPPORTED NTStatus = 0xC029201C + STATUS_PCP_TPM_VERSION_NOT_SUPPORTED NTStatus = 0xC029201D + STATUS_PCP_BUFFER_LENGTH_MISMATCH NTStatus = 0xC029201E + STATUS_PCP_IFX_RSA_KEY_CREATION_BLOCKED NTStatus = 0xC029201F + STATUS_PCP_TICKET_MISSING NTStatus = 0xC0292020 + STATUS_PCP_RAW_POLICY_NOT_SUPPORTED NTStatus = 0xC0292021 + STATUS_PCP_KEY_HANDLE_INVALIDATED NTStatus = 0xC0292022 + STATUS_PCP_UNSUPPORTED_PSS_SALT NTStatus = 0x40292023 + STATUS_RTPM_CONTEXT_CONTINUE NTStatus = 0x00293000 + STATUS_RTPM_CONTEXT_COMPLETE NTStatus = 0x00293001 + STATUS_RTPM_NO_RESULT NTStatus = 0xC0293002 + STATUS_RTPM_PCR_READ_INCOMPLETE NTStatus = 0xC0293003 + STATUS_RTPM_INVALID_CONTEXT NTStatus = 0xC0293004 + STATUS_RTPM_UNSUPPORTED_CMD NTStatus = 0xC0293005 + STATUS_TPM_ZERO_EXHAUST_ENABLED NTStatus = 0xC0294000 + STATUS_HV_INVALID_HYPERCALL_CODE NTStatus = 0xC0350002 + STATUS_HV_INVALID_HYPERCALL_INPUT NTStatus = 0xC0350003 + STATUS_HV_INVALID_ALIGNMENT NTStatus = 0xC0350004 + STATUS_HV_INVALID_PARAMETER NTStatus = 0xC0350005 + STATUS_HV_ACCESS_DENIED NTStatus = 0xC0350006 + STATUS_HV_INVALID_PARTITION_STATE NTStatus = 0xC0350007 + STATUS_HV_OPERATION_DENIED NTStatus = 0xC0350008 + STATUS_HV_UNKNOWN_PROPERTY NTStatus = 0xC0350009 + STATUS_HV_PROPERTY_VALUE_OUT_OF_RANGE NTStatus = 0xC035000A + STATUS_HV_INSUFFICIENT_MEMORY NTStatus = 0xC035000B + STATUS_HV_PARTITION_TOO_DEEP NTStatus = 0xC035000C + STATUS_HV_INVALID_PARTITION_ID NTStatus = 0xC035000D + STATUS_HV_INVALID_VP_INDEX NTStatus = 0xC035000E + STATUS_HV_INVALID_PORT_ID NTStatus = 0xC0350011 + STATUS_HV_INVALID_CONNECTION_ID NTStatus = 0xC0350012 + STATUS_HV_INSUFFICIENT_BUFFERS NTStatus = 0xC0350013 + STATUS_HV_NOT_ACKNOWLEDGED NTStatus = 0xC0350014 + STATUS_HV_INVALID_VP_STATE NTStatus = 0xC0350015 + STATUS_HV_ACKNOWLEDGED NTStatus = 0xC0350016 + STATUS_HV_INVALID_SAVE_RESTORE_STATE NTStatus = 0xC0350017 + STATUS_HV_INVALID_SYNIC_STATE NTStatus = 0xC0350018 + STATUS_HV_OBJECT_IN_USE NTStatus = 0xC0350019 + STATUS_HV_INVALID_PROXIMITY_DOMAIN_INFO NTStatus = 0xC035001A + STATUS_HV_NO_DATA NTStatus = 0xC035001B + STATUS_HV_INACTIVE NTStatus = 0xC035001C + STATUS_HV_NO_RESOURCES NTStatus = 0xC035001D + STATUS_HV_FEATURE_UNAVAILABLE NTStatus = 0xC035001E + STATUS_HV_INSUFFICIENT_BUFFER NTStatus = 0xC0350033 + STATUS_HV_INSUFFICIENT_DEVICE_DOMAINS NTStatus = 0xC0350038 + STATUS_HV_CPUID_FEATURE_VALIDATION_ERROR NTStatus = 0xC035003C + STATUS_HV_CPUID_XSAVE_FEATURE_VALIDATION_ERROR NTStatus = 0xC035003D + STATUS_HV_PROCESSOR_STARTUP_TIMEOUT NTStatus = 0xC035003E + STATUS_HV_SMX_ENABLED NTStatus = 0xC035003F + STATUS_HV_INVALID_LP_INDEX NTStatus = 0xC0350041 + STATUS_HV_INVALID_REGISTER_VALUE NTStatus = 0xC0350050 + STATUS_HV_INVALID_VTL_STATE NTStatus = 0xC0350051 + STATUS_HV_NX_NOT_DETECTED NTStatus = 0xC0350055 + STATUS_HV_INVALID_DEVICE_ID NTStatus = 0xC0350057 + STATUS_HV_INVALID_DEVICE_STATE NTStatus = 0xC0350058 + STATUS_HV_PENDING_PAGE_REQUESTS NTStatus = 0x00350059 + STATUS_HV_PAGE_REQUEST_INVALID NTStatus = 0xC0350060 + STATUS_HV_INVALID_CPU_GROUP_ID NTStatus = 0xC035006F + STATUS_HV_INVALID_CPU_GROUP_STATE NTStatus = 0xC0350070 + STATUS_HV_OPERATION_FAILED NTStatus = 0xC0350071 + STATUS_HV_NOT_ALLOWED_WITH_NESTED_VIRT_ACTIVE NTStatus = 0xC0350072 + STATUS_HV_INSUFFICIENT_ROOT_MEMORY NTStatus = 0xC0350073 + STATUS_HV_NOT_PRESENT NTStatus = 0xC0351000 + STATUS_VID_DUPLICATE_HANDLER NTStatus = 0xC0370001 + STATUS_VID_TOO_MANY_HANDLERS NTStatus = 0xC0370002 + STATUS_VID_QUEUE_FULL NTStatus = 0xC0370003 + STATUS_VID_HANDLER_NOT_PRESENT NTStatus = 0xC0370004 + STATUS_VID_INVALID_OBJECT_NAME NTStatus = 0xC0370005 + STATUS_VID_PARTITION_NAME_TOO_LONG NTStatus = 0xC0370006 + STATUS_VID_MESSAGE_QUEUE_NAME_TOO_LONG NTStatus = 0xC0370007 + STATUS_VID_PARTITION_ALREADY_EXISTS NTStatus = 0xC0370008 + STATUS_VID_PARTITION_DOES_NOT_EXIST NTStatus = 0xC0370009 + STATUS_VID_PARTITION_NAME_NOT_FOUND NTStatus = 0xC037000A + STATUS_VID_MESSAGE_QUEUE_ALREADY_EXISTS NTStatus = 0xC037000B + STATUS_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT NTStatus = 0xC037000C + STATUS_VID_MB_STILL_REFERENCED NTStatus = 0xC037000D + STATUS_VID_CHILD_GPA_PAGE_SET_CORRUPTED NTStatus = 0xC037000E + STATUS_VID_INVALID_NUMA_SETTINGS NTStatus = 0xC037000F + STATUS_VID_INVALID_NUMA_NODE_INDEX NTStatus = 0xC0370010 + STATUS_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED NTStatus = 0xC0370011 + STATUS_VID_INVALID_MEMORY_BLOCK_HANDLE NTStatus = 0xC0370012 + STATUS_VID_PAGE_RANGE_OVERFLOW NTStatus = 0xC0370013 + STATUS_VID_INVALID_MESSAGE_QUEUE_HANDLE NTStatus = 0xC0370014 + STATUS_VID_INVALID_GPA_RANGE_HANDLE NTStatus = 0xC0370015 + STATUS_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE NTStatus = 0xC0370016 + STATUS_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED NTStatus = 0xC0370017 + STATUS_VID_INVALID_PPM_HANDLE NTStatus = 0xC0370018 + STATUS_VID_MBPS_ARE_LOCKED NTStatus = 0xC0370019 + STATUS_VID_MESSAGE_QUEUE_CLOSED NTStatus = 0xC037001A + STATUS_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED NTStatus = 0xC037001B + STATUS_VID_STOP_PENDING NTStatus = 0xC037001C + STATUS_VID_INVALID_PROCESSOR_STATE NTStatus = 0xC037001D + STATUS_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT NTStatus = 0xC037001E + STATUS_VID_KM_INTERFACE_ALREADY_INITIALIZED NTStatus = 0xC037001F + STATUS_VID_MB_PROPERTY_ALREADY_SET_RESET NTStatus = 0xC0370020 + STATUS_VID_MMIO_RANGE_DESTROYED NTStatus = 0xC0370021 + STATUS_VID_INVALID_CHILD_GPA_PAGE_SET NTStatus = 0xC0370022 + STATUS_VID_RESERVE_PAGE_SET_IS_BEING_USED NTStatus = 0xC0370023 + STATUS_VID_RESERVE_PAGE_SET_TOO_SMALL NTStatus = 0xC0370024 + STATUS_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE NTStatus = 0xC0370025 + STATUS_VID_MBP_COUNT_EXCEEDED_LIMIT NTStatus = 0xC0370026 + STATUS_VID_SAVED_STATE_CORRUPT NTStatus = 0xC0370027 + STATUS_VID_SAVED_STATE_UNRECOGNIZED_ITEM NTStatus = 0xC0370028 + STATUS_VID_SAVED_STATE_INCOMPATIBLE NTStatus = 0xC0370029 + STATUS_VID_VTL_ACCESS_DENIED NTStatus = 0xC037002A + STATUS_VID_REMOTE_NODE_PARENT_GPA_PAGES_USED NTStatus = 0x80370001 + STATUS_IPSEC_BAD_SPI NTStatus = 0xC0360001 + STATUS_IPSEC_SA_LIFETIME_EXPIRED NTStatus = 0xC0360002 + STATUS_IPSEC_WRONG_SA NTStatus = 0xC0360003 + STATUS_IPSEC_REPLAY_CHECK_FAILED NTStatus = 0xC0360004 + STATUS_IPSEC_INVALID_PACKET NTStatus = 0xC0360005 + STATUS_IPSEC_INTEGRITY_CHECK_FAILED NTStatus = 0xC0360006 + STATUS_IPSEC_CLEAR_TEXT_DROP NTStatus = 0xC0360007 + STATUS_IPSEC_AUTH_FIREWALL_DROP NTStatus = 0xC0360008 + STATUS_IPSEC_THROTTLE_DROP NTStatus = 0xC0360009 + STATUS_IPSEC_DOSP_BLOCK NTStatus = 0xC0368000 + STATUS_IPSEC_DOSP_RECEIVED_MULTICAST NTStatus = 0xC0368001 + STATUS_IPSEC_DOSP_INVALID_PACKET NTStatus = 0xC0368002 + STATUS_IPSEC_DOSP_STATE_LOOKUP_FAILED NTStatus = 0xC0368003 + STATUS_IPSEC_DOSP_MAX_ENTRIES NTStatus = 0xC0368004 + STATUS_IPSEC_DOSP_KEYMOD_NOT_ALLOWED NTStatus = 0xC0368005 + STATUS_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES NTStatus = 0xC0368006 + STATUS_VOLMGR_INCOMPLETE_REGENERATION NTStatus = 0x80380001 + STATUS_VOLMGR_INCOMPLETE_DISK_MIGRATION NTStatus = 0x80380002 + STATUS_VOLMGR_DATABASE_FULL NTStatus = 0xC0380001 + STATUS_VOLMGR_DISK_CONFIGURATION_CORRUPTED NTStatus = 0xC0380002 + STATUS_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC NTStatus = 0xC0380003 + STATUS_VOLMGR_PACK_CONFIG_UPDATE_FAILED NTStatus = 0xC0380004 + STATUS_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME NTStatus = 0xC0380005 + STATUS_VOLMGR_DISK_DUPLICATE NTStatus = 0xC0380006 + STATUS_VOLMGR_DISK_DYNAMIC NTStatus = 0xC0380007 + STATUS_VOLMGR_DISK_ID_INVALID NTStatus = 0xC0380008 + STATUS_VOLMGR_DISK_INVALID NTStatus = 0xC0380009 + STATUS_VOLMGR_DISK_LAST_VOTER NTStatus = 0xC038000A + STATUS_VOLMGR_DISK_LAYOUT_INVALID NTStatus = 0xC038000B + STATUS_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS NTStatus = 0xC038000C + STATUS_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED NTStatus = 0xC038000D + STATUS_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL NTStatus = 0xC038000E + STATUS_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS NTStatus = 0xC038000F + STATUS_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS NTStatus = 0xC0380010 + STATUS_VOLMGR_DISK_MISSING NTStatus = 0xC0380011 + STATUS_VOLMGR_DISK_NOT_EMPTY NTStatus = 0xC0380012 + STATUS_VOLMGR_DISK_NOT_ENOUGH_SPACE NTStatus = 0xC0380013 + STATUS_VOLMGR_DISK_REVECTORING_FAILED NTStatus = 0xC0380014 + STATUS_VOLMGR_DISK_SECTOR_SIZE_INVALID NTStatus = 0xC0380015 + STATUS_VOLMGR_DISK_SET_NOT_CONTAINED NTStatus = 0xC0380016 + STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS NTStatus = 0xC0380017 + STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES NTStatus = 0xC0380018 + STATUS_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED NTStatus = 0xC0380019 + STATUS_VOLMGR_EXTENT_ALREADY_USED NTStatus = 0xC038001A + STATUS_VOLMGR_EXTENT_NOT_CONTIGUOUS NTStatus = 0xC038001B + STATUS_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION NTStatus = 0xC038001C + STATUS_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED NTStatus = 0xC038001D + STATUS_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION NTStatus = 0xC038001E + STATUS_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH NTStatus = 0xC038001F + STATUS_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED NTStatus = 0xC0380020 + STATUS_VOLMGR_INTERLEAVE_LENGTH_INVALID NTStatus = 0xC0380021 + STATUS_VOLMGR_MAXIMUM_REGISTERED_USERS NTStatus = 0xC0380022 + STATUS_VOLMGR_MEMBER_IN_SYNC NTStatus = 0xC0380023 + STATUS_VOLMGR_MEMBER_INDEX_DUPLICATE NTStatus = 0xC0380024 + STATUS_VOLMGR_MEMBER_INDEX_INVALID NTStatus = 0xC0380025 + STATUS_VOLMGR_MEMBER_MISSING NTStatus = 0xC0380026 + STATUS_VOLMGR_MEMBER_NOT_DETACHED NTStatus = 0xC0380027 + STATUS_VOLMGR_MEMBER_REGENERATING NTStatus = 0xC0380028 + STATUS_VOLMGR_ALL_DISKS_FAILED NTStatus = 0xC0380029 + STATUS_VOLMGR_NO_REGISTERED_USERS NTStatus = 0xC038002A + STATUS_VOLMGR_NO_SUCH_USER NTStatus = 0xC038002B + STATUS_VOLMGR_NOTIFICATION_RESET NTStatus = 0xC038002C + STATUS_VOLMGR_NUMBER_OF_MEMBERS_INVALID NTStatus = 0xC038002D + STATUS_VOLMGR_NUMBER_OF_PLEXES_INVALID NTStatus = 0xC038002E + STATUS_VOLMGR_PACK_DUPLICATE NTStatus = 0xC038002F + STATUS_VOLMGR_PACK_ID_INVALID NTStatus = 0xC0380030 + STATUS_VOLMGR_PACK_INVALID NTStatus = 0xC0380031 + STATUS_VOLMGR_PACK_NAME_INVALID NTStatus = 0xC0380032 + STATUS_VOLMGR_PACK_OFFLINE NTStatus = 0xC0380033 + STATUS_VOLMGR_PACK_HAS_QUORUM NTStatus = 0xC0380034 + STATUS_VOLMGR_PACK_WITHOUT_QUORUM NTStatus = 0xC0380035 + STATUS_VOLMGR_PARTITION_STYLE_INVALID NTStatus = 0xC0380036 + STATUS_VOLMGR_PARTITION_UPDATE_FAILED NTStatus = 0xC0380037 + STATUS_VOLMGR_PLEX_IN_SYNC NTStatus = 0xC0380038 + STATUS_VOLMGR_PLEX_INDEX_DUPLICATE NTStatus = 0xC0380039 + STATUS_VOLMGR_PLEX_INDEX_INVALID NTStatus = 0xC038003A + STATUS_VOLMGR_PLEX_LAST_ACTIVE NTStatus = 0xC038003B + STATUS_VOLMGR_PLEX_MISSING NTStatus = 0xC038003C + STATUS_VOLMGR_PLEX_REGENERATING NTStatus = 0xC038003D + STATUS_VOLMGR_PLEX_TYPE_INVALID NTStatus = 0xC038003E + STATUS_VOLMGR_PLEX_NOT_RAID5 NTStatus = 0xC038003F + STATUS_VOLMGR_PLEX_NOT_SIMPLE NTStatus = 0xC0380040 + STATUS_VOLMGR_STRUCTURE_SIZE_INVALID NTStatus = 0xC0380041 + STATUS_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS NTStatus = 0xC0380042 + STATUS_VOLMGR_TRANSACTION_IN_PROGRESS NTStatus = 0xC0380043 + STATUS_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE NTStatus = 0xC0380044 + STATUS_VOLMGR_VOLUME_CONTAINS_MISSING_DISK NTStatus = 0xC0380045 + STATUS_VOLMGR_VOLUME_ID_INVALID NTStatus = 0xC0380046 + STATUS_VOLMGR_VOLUME_LENGTH_INVALID NTStatus = 0xC0380047 + STATUS_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE NTStatus = 0xC0380048 + STATUS_VOLMGR_VOLUME_NOT_MIRRORED NTStatus = 0xC0380049 + STATUS_VOLMGR_VOLUME_NOT_RETAINED NTStatus = 0xC038004A + STATUS_VOLMGR_VOLUME_OFFLINE NTStatus = 0xC038004B + STATUS_VOLMGR_VOLUME_RETAINED NTStatus = 0xC038004C + STATUS_VOLMGR_NUMBER_OF_EXTENTS_INVALID NTStatus = 0xC038004D + STATUS_VOLMGR_DIFFERENT_SECTOR_SIZE NTStatus = 0xC038004E + STATUS_VOLMGR_BAD_BOOT_DISK NTStatus = 0xC038004F + STATUS_VOLMGR_PACK_CONFIG_OFFLINE NTStatus = 0xC0380050 + STATUS_VOLMGR_PACK_CONFIG_ONLINE NTStatus = 0xC0380051 + STATUS_VOLMGR_NOT_PRIMARY_PACK NTStatus = 0xC0380052 + STATUS_VOLMGR_PACK_LOG_UPDATE_FAILED NTStatus = 0xC0380053 + STATUS_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID NTStatus = 0xC0380054 + STATUS_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID NTStatus = 0xC0380055 + STATUS_VOLMGR_VOLUME_MIRRORED NTStatus = 0xC0380056 + STATUS_VOLMGR_PLEX_NOT_SIMPLE_SPANNED NTStatus = 0xC0380057 + STATUS_VOLMGR_NO_VALID_LOG_COPIES NTStatus = 0xC0380058 + STATUS_VOLMGR_PRIMARY_PACK_PRESENT NTStatus = 0xC0380059 + STATUS_VOLMGR_NUMBER_OF_DISKS_INVALID NTStatus = 0xC038005A + STATUS_VOLMGR_MIRROR_NOT_SUPPORTED NTStatus = 0xC038005B + STATUS_VOLMGR_RAID5_NOT_SUPPORTED NTStatus = 0xC038005C + STATUS_BCD_NOT_ALL_ENTRIES_IMPORTED NTStatus = 0x80390001 + STATUS_BCD_TOO_MANY_ELEMENTS NTStatus = 0xC0390002 + STATUS_BCD_NOT_ALL_ENTRIES_SYNCHRONIZED NTStatus = 0x80390003 + STATUS_VHD_DRIVE_FOOTER_MISSING NTStatus = 0xC03A0001 + STATUS_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH NTStatus = 0xC03A0002 + STATUS_VHD_DRIVE_FOOTER_CORRUPT NTStatus = 0xC03A0003 + STATUS_VHD_FORMAT_UNKNOWN NTStatus = 0xC03A0004 + STATUS_VHD_FORMAT_UNSUPPORTED_VERSION NTStatus = 0xC03A0005 + STATUS_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH NTStatus = 0xC03A0006 + STATUS_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION NTStatus = 0xC03A0007 + STATUS_VHD_SPARSE_HEADER_CORRUPT NTStatus = 0xC03A0008 + STATUS_VHD_BLOCK_ALLOCATION_FAILURE NTStatus = 0xC03A0009 + STATUS_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT NTStatus = 0xC03A000A + STATUS_VHD_INVALID_BLOCK_SIZE NTStatus = 0xC03A000B + STATUS_VHD_BITMAP_MISMATCH NTStatus = 0xC03A000C + STATUS_VHD_PARENT_VHD_NOT_FOUND NTStatus = 0xC03A000D + STATUS_VHD_CHILD_PARENT_ID_MISMATCH NTStatus = 0xC03A000E + STATUS_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH NTStatus = 0xC03A000F + STATUS_VHD_METADATA_READ_FAILURE NTStatus = 0xC03A0010 + STATUS_VHD_METADATA_WRITE_FAILURE NTStatus = 0xC03A0011 + STATUS_VHD_INVALID_SIZE NTStatus = 0xC03A0012 + STATUS_VHD_INVALID_FILE_SIZE NTStatus = 0xC03A0013 + STATUS_VIRTDISK_PROVIDER_NOT_FOUND NTStatus = 0xC03A0014 + STATUS_VIRTDISK_NOT_VIRTUAL_DISK NTStatus = 0xC03A0015 + STATUS_VHD_PARENT_VHD_ACCESS_DENIED NTStatus = 0xC03A0016 + STATUS_VHD_CHILD_PARENT_SIZE_MISMATCH NTStatus = 0xC03A0017 + STATUS_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED NTStatus = 0xC03A0018 + STATUS_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT NTStatus = 0xC03A0019 + STATUS_VIRTUAL_DISK_LIMITATION NTStatus = 0xC03A001A + STATUS_VHD_INVALID_TYPE NTStatus = 0xC03A001B + STATUS_VHD_INVALID_STATE NTStatus = 0xC03A001C + STATUS_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE NTStatus = 0xC03A001D + STATUS_VIRTDISK_DISK_ALREADY_OWNED NTStatus = 0xC03A001E + STATUS_VIRTDISK_DISK_ONLINE_AND_WRITABLE NTStatus = 0xC03A001F + STATUS_CTLOG_TRACKING_NOT_INITIALIZED NTStatus = 0xC03A0020 + STATUS_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE NTStatus = 0xC03A0021 + STATUS_CTLOG_VHD_CHANGED_OFFLINE NTStatus = 0xC03A0022 + STATUS_CTLOG_INVALID_TRACKING_STATE NTStatus = 0xC03A0023 + STATUS_CTLOG_INCONSISTENT_TRACKING_FILE NTStatus = 0xC03A0024 + STATUS_VHD_METADATA_FULL NTStatus = 0xC03A0028 + STATUS_VHD_INVALID_CHANGE_TRACKING_ID NTStatus = 0xC03A0029 + STATUS_VHD_CHANGE_TRACKING_DISABLED NTStatus = 0xC03A002A + STATUS_VHD_MISSING_CHANGE_TRACKING_INFORMATION NTStatus = 0xC03A0030 + STATUS_VHD_RESIZE_WOULD_TRUNCATE_DATA NTStatus = 0xC03A0031 + STATUS_VHD_COULD_NOT_COMPUTE_MINIMUM_VIRTUAL_SIZE NTStatus = 0xC03A0032 + STATUS_VHD_ALREADY_AT_OR_BELOW_MINIMUM_VIRTUAL_SIZE NTStatus = 0xC03A0033 + STATUS_QUERY_STORAGE_ERROR NTStatus = 0x803A0001 + STATUS_GDI_HANDLE_LEAK NTStatus = 0x803F0001 + STATUS_RKF_KEY_NOT_FOUND NTStatus = 0xC0400001 + STATUS_RKF_DUPLICATE_KEY NTStatus = 0xC0400002 + STATUS_RKF_BLOB_FULL NTStatus = 0xC0400003 + STATUS_RKF_STORE_FULL NTStatus = 0xC0400004 + STATUS_RKF_FILE_BLOCKED NTStatus = 0xC0400005 + STATUS_RKF_ACTIVE_KEY NTStatus = 0xC0400006 + STATUS_RDBSS_RESTART_OPERATION NTStatus = 0xC0410001 + STATUS_RDBSS_CONTINUE_OPERATION NTStatus = 0xC0410002 + STATUS_RDBSS_POST_OPERATION NTStatus = 0xC0410003 + STATUS_RDBSS_RETRY_LOOKUP NTStatus = 0xC0410004 + STATUS_BTH_ATT_INVALID_HANDLE NTStatus = 0xC0420001 + STATUS_BTH_ATT_READ_NOT_PERMITTED NTStatus = 0xC0420002 + STATUS_BTH_ATT_WRITE_NOT_PERMITTED NTStatus = 0xC0420003 + STATUS_BTH_ATT_INVALID_PDU NTStatus = 0xC0420004 + STATUS_BTH_ATT_INSUFFICIENT_AUTHENTICATION NTStatus = 0xC0420005 + STATUS_BTH_ATT_REQUEST_NOT_SUPPORTED NTStatus = 0xC0420006 + STATUS_BTH_ATT_INVALID_OFFSET NTStatus = 0xC0420007 + STATUS_BTH_ATT_INSUFFICIENT_AUTHORIZATION NTStatus = 0xC0420008 + STATUS_BTH_ATT_PREPARE_QUEUE_FULL NTStatus = 0xC0420009 + STATUS_BTH_ATT_ATTRIBUTE_NOT_FOUND NTStatus = 0xC042000A + STATUS_BTH_ATT_ATTRIBUTE_NOT_LONG NTStatus = 0xC042000B + STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE NTStatus = 0xC042000C + STATUS_BTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH NTStatus = 0xC042000D + STATUS_BTH_ATT_UNLIKELY NTStatus = 0xC042000E + STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION NTStatus = 0xC042000F + STATUS_BTH_ATT_UNSUPPORTED_GROUP_TYPE NTStatus = 0xC0420010 + STATUS_BTH_ATT_INSUFFICIENT_RESOURCES NTStatus = 0xC0420011 + STATUS_BTH_ATT_UNKNOWN_ERROR NTStatus = 0xC0421000 + STATUS_SECUREBOOT_ROLLBACK_DETECTED NTStatus = 0xC0430001 + STATUS_SECUREBOOT_POLICY_VIOLATION NTStatus = 0xC0430002 + STATUS_SECUREBOOT_INVALID_POLICY NTStatus = 0xC0430003 + STATUS_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND NTStatus = 0xC0430004 + STATUS_SECUREBOOT_POLICY_NOT_SIGNED NTStatus = 0xC0430005 + STATUS_SECUREBOOT_NOT_ENABLED NTStatus = 0x80430006 + STATUS_SECUREBOOT_FILE_REPLACED NTStatus = 0xC0430007 + STATUS_SECUREBOOT_POLICY_NOT_AUTHORIZED NTStatus = 0xC0430008 + STATUS_SECUREBOOT_POLICY_UNKNOWN NTStatus = 0xC0430009 + STATUS_SECUREBOOT_POLICY_MISSING_ANTIROLLBACKVERSION NTStatus = 0xC043000A + STATUS_SECUREBOOT_PLATFORM_ID_MISMATCH NTStatus = 0xC043000B + STATUS_SECUREBOOT_POLICY_ROLLBACK_DETECTED NTStatus = 0xC043000C + STATUS_SECUREBOOT_POLICY_UPGRADE_MISMATCH NTStatus = 0xC043000D + STATUS_SECUREBOOT_REQUIRED_POLICY_FILE_MISSING NTStatus = 0xC043000E + STATUS_SECUREBOOT_NOT_BASE_POLICY NTStatus = 0xC043000F + STATUS_SECUREBOOT_NOT_SUPPLEMENTAL_POLICY NTStatus = 0xC0430010 + STATUS_PLATFORM_MANIFEST_NOT_AUTHORIZED NTStatus = 0xC0EB0001 + STATUS_PLATFORM_MANIFEST_INVALID NTStatus = 0xC0EB0002 + STATUS_PLATFORM_MANIFEST_FILE_NOT_AUTHORIZED NTStatus = 0xC0EB0003 + STATUS_PLATFORM_MANIFEST_CATALOG_NOT_AUTHORIZED NTStatus = 0xC0EB0004 + STATUS_PLATFORM_MANIFEST_BINARY_ID_NOT_FOUND NTStatus = 0xC0EB0005 + STATUS_PLATFORM_MANIFEST_NOT_ACTIVE NTStatus = 0xC0EB0006 + STATUS_PLATFORM_MANIFEST_NOT_SIGNED NTStatus = 0xC0EB0007 + STATUS_SYSTEM_INTEGRITY_ROLLBACK_DETECTED NTStatus = 0xC0E90001 + STATUS_SYSTEM_INTEGRITY_POLICY_VIOLATION NTStatus = 0xC0E90002 + STATUS_SYSTEM_INTEGRITY_INVALID_POLICY NTStatus = 0xC0E90003 + STATUS_SYSTEM_INTEGRITY_POLICY_NOT_SIGNED NTStatus = 0xC0E90004 + STATUS_SYSTEM_INTEGRITY_TOO_MANY_POLICIES NTStatus = 0xC0E90005 + STATUS_SYSTEM_INTEGRITY_SUPPLEMENTAL_POLICY_NOT_AUTHORIZED NTStatus = 0xC0E90006 + STATUS_NO_APPLICABLE_APP_LICENSES_FOUND NTStatus = 0xC0EA0001 + STATUS_CLIP_LICENSE_NOT_FOUND NTStatus = 0xC0EA0002 + STATUS_CLIP_DEVICE_LICENSE_MISSING NTStatus = 0xC0EA0003 + STATUS_CLIP_LICENSE_INVALID_SIGNATURE NTStatus = 0xC0EA0004 + STATUS_CLIP_KEYHOLDER_LICENSE_MISSING_OR_INVALID NTStatus = 0xC0EA0005 + STATUS_CLIP_LICENSE_EXPIRED NTStatus = 0xC0EA0006 + STATUS_CLIP_LICENSE_SIGNED_BY_UNKNOWN_SOURCE NTStatus = 0xC0EA0007 + STATUS_CLIP_LICENSE_NOT_SIGNED NTStatus = 0xC0EA0008 + STATUS_CLIP_LICENSE_HARDWARE_ID_OUT_OF_TOLERANCE NTStatus = 0xC0EA0009 + STATUS_CLIP_LICENSE_DEVICE_ID_MISMATCH NTStatus = 0xC0EA000A + STATUS_AUDIO_ENGINE_NODE_NOT_FOUND NTStatus = 0xC0440001 + STATUS_HDAUDIO_EMPTY_CONNECTION_LIST NTStatus = 0xC0440002 + STATUS_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED NTStatus = 0xC0440003 + STATUS_HDAUDIO_NO_LOGICAL_DEVICES_CREATED NTStatus = 0xC0440004 + STATUS_HDAUDIO_NULL_LINKED_LIST_ENTRY NTStatus = 0xC0440005 + STATUS_SPACES_REPAIRED NTStatus = 0x00E70000 + STATUS_SPACES_PAUSE NTStatus = 0x00E70001 + STATUS_SPACES_COMPLETE NTStatus = 0x00E70002 + STATUS_SPACES_REDIRECT NTStatus = 0x00E70003 + STATUS_SPACES_FAULT_DOMAIN_TYPE_INVALID NTStatus = 0xC0E70001 + STATUS_SPACES_RESILIENCY_TYPE_INVALID NTStatus = 0xC0E70003 + STATUS_SPACES_DRIVE_SECTOR_SIZE_INVALID NTStatus = 0xC0E70004 + STATUS_SPACES_DRIVE_REDUNDANCY_INVALID NTStatus = 0xC0E70006 + STATUS_SPACES_NUMBER_OF_DATA_COPIES_INVALID NTStatus = 0xC0E70007 + STATUS_SPACES_INTERLEAVE_LENGTH_INVALID NTStatus = 0xC0E70009 + STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID NTStatus = 0xC0E7000A + STATUS_SPACES_NOT_ENOUGH_DRIVES NTStatus = 0xC0E7000B + STATUS_SPACES_EXTENDED_ERROR NTStatus = 0xC0E7000C + STATUS_SPACES_PROVISIONING_TYPE_INVALID NTStatus = 0xC0E7000D + STATUS_SPACES_ALLOCATION_SIZE_INVALID NTStatus = 0xC0E7000E + STATUS_SPACES_ENCLOSURE_AWARE_INVALID NTStatus = 0xC0E7000F + STATUS_SPACES_WRITE_CACHE_SIZE_INVALID NTStatus = 0xC0E70010 + STATUS_SPACES_NUMBER_OF_GROUPS_INVALID NTStatus = 0xC0E70011 + STATUS_SPACES_DRIVE_OPERATIONAL_STATE_INVALID NTStatus = 0xC0E70012 + STATUS_SPACES_UPDATE_COLUMN_STATE NTStatus = 0xC0E70013 + STATUS_SPACES_MAP_REQUIRED NTStatus = 0xC0E70014 + STATUS_SPACES_UNSUPPORTED_VERSION NTStatus = 0xC0E70015 + STATUS_SPACES_CORRUPT_METADATA NTStatus = 0xC0E70016 + STATUS_SPACES_DRT_FULL NTStatus = 0xC0E70017 + STATUS_SPACES_INCONSISTENCY NTStatus = 0xC0E70018 + STATUS_SPACES_LOG_NOT_READY NTStatus = 0xC0E70019 + STATUS_SPACES_NO_REDUNDANCY NTStatus = 0xC0E7001A + STATUS_SPACES_DRIVE_NOT_READY NTStatus = 0xC0E7001B + STATUS_SPACES_DRIVE_SPLIT NTStatus = 0xC0E7001C + STATUS_SPACES_DRIVE_LOST_DATA NTStatus = 0xC0E7001D + STATUS_SPACES_ENTRY_INCOMPLETE NTStatus = 0xC0E7001E + STATUS_SPACES_ENTRY_INVALID NTStatus = 0xC0E7001F + STATUS_SPACES_MARK_DIRTY NTStatus = 0xC0E70020 + STATUS_VOLSNAP_BOOTFILE_NOT_VALID NTStatus = 0xC0500003 + STATUS_VOLSNAP_ACTIVATION_TIMEOUT NTStatus = 0xC0500004 + STATUS_IO_PREEMPTED NTStatus = 0xC0510001 + STATUS_SVHDX_ERROR_STORED NTStatus = 0xC05C0000 + STATUS_SVHDX_ERROR_NOT_AVAILABLE NTStatus = 0xC05CFF00 + STATUS_SVHDX_UNIT_ATTENTION_AVAILABLE NTStatus = 0xC05CFF01 + STATUS_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED NTStatus = 0xC05CFF02 + STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED NTStatus = 0xC05CFF03 + STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED NTStatus = 0xC05CFF04 + STATUS_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED NTStatus = 0xC05CFF05 + STATUS_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED NTStatus = 0xC05CFF06 + STATUS_SVHDX_RESERVATION_CONFLICT NTStatus = 0xC05CFF07 + STATUS_SVHDX_WRONG_FILE_TYPE NTStatus = 0xC05CFF08 + STATUS_SVHDX_VERSION_MISMATCH NTStatus = 0xC05CFF09 + STATUS_VHD_SHARED NTStatus = 0xC05CFF0A + STATUS_SVHDX_NO_INITIATOR NTStatus = 0xC05CFF0B + STATUS_VHDSET_BACKING_STORAGE_NOT_FOUND NTStatus = 0xC05CFF0C + STATUS_SMB_NO_PREAUTH_INTEGRITY_HASH_OVERLAP NTStatus = 0xC05D0000 + STATUS_SMB_BAD_CLUSTER_DIALECT NTStatus = 0xC05D0001 + STATUS_SMB_GUEST_LOGON_BLOCKED NTStatus = 0xC05D0002 + STATUS_SECCORE_INVALID_COMMAND NTStatus = 0xC0E80000 + STATUS_VSM_NOT_INITIALIZED NTStatus = 0xC0450000 + STATUS_VSM_DMA_PROTECTION_NOT_IN_USE NTStatus = 0xC0450001 + STATUS_APPEXEC_CONDITION_NOT_SATISFIED NTStatus = 0xC0EC0000 + STATUS_APPEXEC_HANDLE_INVALIDATED NTStatus = 0xC0EC0001 + STATUS_APPEXEC_INVALID_HOST_GENERATION NTStatus = 0xC0EC0002 + STATUS_APPEXEC_UNEXPECTED_PROCESS_REGISTRATION NTStatus = 0xC0EC0003 + STATUS_APPEXEC_INVALID_HOST_STATE NTStatus = 0xC0EC0004 + STATUS_APPEXEC_NO_DONOR NTStatus = 0xC0EC0005 + STATUS_APPEXEC_HOST_ID_MISMATCH NTStatus = 0xC0EC0006 + STATUS_APPEXEC_UNKNOWN_USER NTStatus = 0xC0EC0007 ) diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 3f8952d10497..559bc845c99c 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -172,6 +172,7 @@ var ( procCancelIo = modkernel32.NewProc("CancelIo") procCancelIoEx = modkernel32.NewProc("CancelIoEx") procCloseHandle = modkernel32.NewProc("CloseHandle") + procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") procCreateDirectoryW = modkernel32.NewProc("CreateDirectoryW") procCreateEventExW = modkernel32.NewProc("CreateEventExW") procCreateEventW = modkernel32.NewProc("CreateEventW") @@ -182,12 +183,14 @@ var ( procCreateJobObjectW = modkernel32.NewProc("CreateJobObjectW") procCreateMutexExW = modkernel32.NewProc("CreateMutexExW") procCreateMutexW = modkernel32.NewProc("CreateMutexW") + procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") procCreatePipe = modkernel32.NewProc("CreatePipe") procCreateProcessW = modkernel32.NewProc("CreateProcessW") procCreateSymbolicLinkW = modkernel32.NewProc("CreateSymbolicLinkW") procCreateToolhelp32Snapshot = modkernel32.NewProc("CreateToolhelp32Snapshot") procDefineDosDeviceW = modkernel32.NewProc("DefineDosDeviceW") procDeleteFileW = modkernel32.NewProc("DeleteFileW") + procDeleteProcThreadAttributeList = modkernel32.NewProc("DeleteProcThreadAttributeList") procDeleteVolumeMountPointW = modkernel32.NewProc("DeleteVolumeMountPointW") procDeviceIoControl = modkernel32.NewProc("DeviceIoControl") procDuplicateHandle = modkernel32.NewProc("DuplicateHandle") @@ -202,6 +205,7 @@ var ( procFindNextFileW = modkernel32.NewProc("FindNextFileW") procFindNextVolumeMountPointW = modkernel32.NewProc("FindNextVolumeMountPointW") procFindNextVolumeW = modkernel32.NewProc("FindNextVolumeW") + procFindResourceW = modkernel32.NewProc("FindResourceW") procFindVolumeClose = modkernel32.NewProc("FindVolumeClose") procFindVolumeMountPointClose = modkernel32.NewProc("FindVolumeMountPointClose") procFlushFileBuffers = modkernel32.NewProc("FlushFileBuffers") @@ -211,6 +215,7 @@ var ( procFreeLibrary = modkernel32.NewProc("FreeLibrary") procGenerateConsoleCtrlEvent = modkernel32.NewProc("GenerateConsoleCtrlEvent") procGetACP = modkernel32.NewProc("GetACP") + procGetCommTimeouts = modkernel32.NewProc("GetCommTimeouts") procGetCommandLineW = modkernel32.NewProc("GetCommandLineW") procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW") procGetComputerNameW = modkernel32.NewProc("GetComputerNameW") @@ -237,6 +242,8 @@ var ( procGetLongPathNameW = modkernel32.NewProc("GetLongPathNameW") procGetModuleFileNameW = modkernel32.NewProc("GetModuleFileNameW") procGetModuleHandleExW = modkernel32.NewProc("GetModuleHandleExW") + procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") + procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") procGetOverlappedResult = modkernel32.NewProc("GetOverlappedResult") procGetPriorityClass = modkernel32.NewProc("GetPriorityClass") procGetProcAddress = modkernel32.NewProc("GetProcAddress") @@ -266,12 +273,16 @@ var ( procGetVolumePathNameW = modkernel32.NewProc("GetVolumePathNameW") procGetVolumePathNamesForVolumeNameW = modkernel32.NewProc("GetVolumePathNamesForVolumeNameW") procGetWindowsDirectoryW = modkernel32.NewProc("GetWindowsDirectoryW") + procInitializeProcThreadAttributeList = modkernel32.NewProc("InitializeProcThreadAttributeList") procIsWow64Process = modkernel32.NewProc("IsWow64Process") procIsWow64Process2 = modkernel32.NewProc("IsWow64Process2") procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW") procLoadLibraryW = modkernel32.NewProc("LoadLibraryW") + procLoadResource = modkernel32.NewProc("LoadResource") + procLocalAlloc = modkernel32.NewProc("LocalAlloc") procLocalFree = modkernel32.NewProc("LocalFree") procLockFileEx = modkernel32.NewProc("LockFileEx") + procLockResource = modkernel32.NewProc("LockResource") procMapViewOfFile = modkernel32.NewProc("MapViewOfFile") procMoveFileExW = modkernel32.NewProc("MoveFileExW") procMoveFileW = modkernel32.NewProc("MoveFileW") @@ -286,6 +297,7 @@ var ( procProcessIdToSessionId = modkernel32.NewProc("ProcessIdToSessionId") procPulseEvent = modkernel32.NewProc("PulseEvent") procQueryDosDeviceW = modkernel32.NewProc("QueryDosDeviceW") + procQueryFullProcessImageNameW = modkernel32.NewProc("QueryFullProcessImageNameW") procQueryInformationJobObject = modkernel32.NewProc("QueryInformationJobObject") procReadConsoleW = modkernel32.NewProc("ReadConsoleW") procReadDirectoryChangesW = modkernel32.NewProc("ReadDirectoryChangesW") @@ -294,6 +306,7 @@ var ( procRemoveDirectoryW = modkernel32.NewProc("RemoveDirectoryW") procResetEvent = modkernel32.NewProc("ResetEvent") procResumeThread = modkernel32.NewProc("ResumeThread") + procSetCommTimeouts = modkernel32.NewProc("SetCommTimeouts") procSetConsoleCursorPosition = modkernel32.NewProc("SetConsoleCursorPosition") procSetConsoleMode = modkernel32.NewProc("SetConsoleMode") procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW") @@ -310,6 +323,7 @@ var ( procSetFileTime = modkernel32.NewProc("SetFileTime") procSetHandleInformation = modkernel32.NewProc("SetHandleInformation") procSetInformationJobObject = modkernel32.NewProc("SetInformationJobObject") + procSetNamedPipeHandleState = modkernel32.NewProc("SetNamedPipeHandleState") procSetPriorityClass = modkernel32.NewProc("SetPriorityClass") procSetProcessPriorityBoost = modkernel32.NewProc("SetProcessPriorityBoost") procSetProcessShutdownParameters = modkernel32.NewProc("SetProcessShutdownParameters") @@ -317,6 +331,7 @@ var ( procSetStdHandle = modkernel32.NewProc("SetStdHandle") procSetVolumeLabelW = modkernel32.NewProc("SetVolumeLabelW") procSetVolumeMountPointW = modkernel32.NewProc("SetVolumeMountPointW") + procSizeofResource = modkernel32.NewProc("SizeofResource") procSleepEx = modkernel32.NewProc("SleepEx") procTerminateJobObject = modkernel32.NewProc("TerminateJobObject") procTerminateProcess = modkernel32.NewProc("TerminateProcess") @@ -324,6 +339,7 @@ var ( procThread32Next = modkernel32.NewProc("Thread32Next") procUnlockFileEx = modkernel32.NewProc("UnlockFileEx") procUnmapViewOfFile = modkernel32.NewProc("UnmapViewOfFile") + procUpdateProcThreadAttribute = modkernel32.NewProc("UpdateProcThreadAttribute") procVirtualAlloc = modkernel32.NewProc("VirtualAlloc") procVirtualFree = modkernel32.NewProc("VirtualFree") procVirtualLock = modkernel32.NewProc("VirtualLock") @@ -339,11 +355,25 @@ var ( procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree") procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation") procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") + procNtCreateFile = modntdll.NewProc("NtCreateFile") + procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") + procNtQueryInformationProcess = modntdll.NewProc("NtQueryInformationProcess") + procNtSetInformationProcess = modntdll.NewProc("NtSetInformationProcess") + procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") + procRtlDosPathNameToNtPathName_U_WithStatus = modntdll.NewProc("RtlDosPathNameToNtPathName_U_WithStatus") + procRtlDosPathNameToRelativeNtPathName_U_WithStatus = modntdll.NewProc("RtlDosPathNameToRelativeNtPathName_U_WithStatus") + procRtlGetCurrentPeb = modntdll.NewProc("RtlGetCurrentPeb") procRtlGetNtVersionNumbers = modntdll.NewProc("RtlGetNtVersionNumbers") procRtlGetVersion = modntdll.NewProc("RtlGetVersion") + procRtlInitString = modntdll.NewProc("RtlInitString") + procRtlInitUnicodeString = modntdll.NewProc("RtlInitUnicodeString") + procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") procCLSIDFromString = modole32.NewProc("CLSIDFromString") procCoCreateGuid = modole32.NewProc("CoCreateGuid") + procCoGetObject = modole32.NewProc("CoGetObject") + procCoInitializeEx = modole32.NewProc("CoInitializeEx") procCoTaskMemFree = modole32.NewProc("CoTaskMemFree") + procCoUninitialize = modole32.NewProc("CoUninitialize") procStringFromGUID2 = modole32.NewProc("StringFromGUID2") procEnumProcesses = modpsapi.NewProc("EnumProcesses") procSubscribeServiceChangeNotifications = modsechost.NewProc("SubscribeServiceChangeNotifications") @@ -365,6 +395,7 @@ var ( procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW") procWSACleanup = modws2_32.NewProc("WSACleanup") procWSAEnumProtocolsW = modws2_32.NewProc("WSAEnumProtocolsW") + procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") procWSAIoctl = modws2_32.NewProc("WSAIoctl") procWSARecv = modws2_32.NewProc("WSARecv") procWSARecvFrom = modws2_32.NewProc("WSARecvFrom") @@ -1429,6 +1460,14 @@ func CloseHandle(handle Handle) (err error) { return } +func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) { + r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(overlapped)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { r1, _, e1 := syscall.Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0) if r1 == 0 { @@ -1440,7 +1479,7 @@ func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { r0, _, e1 := syscall.Syscall6(procCreateEventExW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0) handle = Handle(r0) - if handle == 0 { + if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) } return @@ -1449,7 +1488,7 @@ func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, d func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) { r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)), 0, 0) handle = Handle(r0) - if handle == 0 { + if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) } return @@ -1458,7 +1497,7 @@ func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialStat func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) { r0, _, e1 := syscall.Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name))) handle = Handle(r0) - if handle == 0 { + if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) } return @@ -1502,7 +1541,7 @@ func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, func CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { r0, _, e1 := syscall.Syscall6(procCreateMutexExW.Addr(), 4, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0) handle = Handle(r0) - if handle == 0 { + if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) } return @@ -1515,7 +1554,16 @@ func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16 } r0, _, e1 := syscall.Syscall(procCreateMutexW.Addr(), 3, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) - if handle == 0 { + if handle == 0 || e1 == ERROR_ALREADY_EXISTS { + err = errnoErr(e1) + } + return +} + +func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) { + r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0) + handle = Handle(r0) + if handle == InvalidHandle { err = errnoErr(e1) } return @@ -1574,6 +1622,11 @@ func DeleteFile(path *uint16) (err error) { return } +func deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) { + syscall.Syscall(procDeleteProcThreadAttributeList.Addr(), 1, uintptr(unsafe.Pointer(attrlist)), 0, 0) + return +} + func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) { r1, _, e1 := syscall.Syscall(procDeleteVolumeMountPointW.Addr(), 1, uintptr(unsafe.Pointer(volumeMountPoint)), 0, 0) if r1 == 0 { @@ -1704,6 +1757,15 @@ func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) return } +func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) { + r0, _, e1 := syscall.Syscall(procFindResourceW.Addr(), 3, uintptr(module), uintptr(name), uintptr(resType)) + resInfo = Handle(r0) + if resInfo == 0 { + err = errnoErr(e1) + } + return +} + func FindVolumeClose(findVolume Handle) (err error) { r1, _, e1 := syscall.Syscall(procFindVolumeClose.Addr(), 1, uintptr(findVolume), 0, 0) if r1 == 0 { @@ -1779,6 +1841,14 @@ func GetACP() (acp uint32) { return } +func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { + r1, _, e1 := syscall.Syscall(procGetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func GetCommandLine() (cmd *uint16) { r0, _, _ := syscall.Syscall(procGetCommandLineW.Addr(), 0, 0, 0, 0) cmd = (*uint16)(unsafe.Pointer(r0)) @@ -1990,6 +2060,22 @@ func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err er return } +func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { + r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + +func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wait bool) (err error) { var _p0 uint32 if wait { @@ -2235,6 +2321,14 @@ func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { return } +func initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) { + r1, _, e1 := syscall.Syscall6(procInitializeProcThreadAttributeList.Addr(), 4, uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size)), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func IsWow64Process(handle Handle, isWow64 *bool) (err error) { var _p0 uint32 if *isWow64 { @@ -2296,6 +2390,24 @@ func _LoadLibrary(libname *uint16) (handle Handle, err error) { return } +func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) { + r0, _, e1 := syscall.Syscall(procLoadResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) + resData = Handle(r0) + if resData == 0 { + err = errnoErr(e1) + } + return +} + +func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) { + r0, _, e1 := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(flags), uintptr(length), 0) + ptr = uintptr(r0) + if ptr == 0 { + err = errnoErr(e1) + } + return +} + func LocalFree(hmem Handle) (handle Handle, err error) { r0, _, e1 := syscall.Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0) handle = Handle(r0) @@ -2313,6 +2425,15 @@ func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, byt return } +func LockResource(resData Handle) (addr uintptr, err error) { + r0, _, e1 := syscall.Syscall(procLockResource.Addr(), 1, uintptr(resData), 0, 0) + addr = uintptr(r0) + if addr == 0 { + err = errnoErr(e1) + } + return +} + func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) { r0, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0) addr = uintptr(r0) @@ -2448,6 +2569,14 @@ func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint3 return } +func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procQueryFullProcessImageNameW.Addr(), 4, uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size)), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) { r1, _, e1 := syscall.Syscall6(procQueryInformationJobObject.Addr(), 5, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen)), 0) if r1 == 0 { @@ -2521,6 +2650,14 @@ func ResumeThread(thread Handle) (ret uint32, err error) { return } +func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { + r1, _, e1 := syscall.Syscall(procSetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func setConsoleCursorPosition(console Handle, position uint32) (err error) { r1, _, e1 := syscall.Syscall(procSetConsoleCursorPosition.Addr(), 2, uintptr(console), uintptr(position), 0) if r1 == 0 { @@ -2658,6 +2795,14 @@ func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobOb return } +func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procSetNamedPipeHandleState.Addr(), 4, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func SetPriorityClass(process Handle, priorityClass uint32) (err error) { r1, _, e1 := syscall.Syscall(procSetPriorityClass.Addr(), 2, uintptr(process), uintptr(priorityClass), 0) if r1 == 0 { @@ -2718,6 +2863,15 @@ func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err erro return } +func SizeofResource(module Handle, resInfo Handle) (size uint32, err error) { + r0, _, e1 := syscall.Syscall(procSizeofResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) + size = uint32(r0) + if size == 0 { + err = errnoErr(e1) + } + return +} + func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { var _p0 uint32 if alertable { @@ -2776,6 +2930,14 @@ func UnmapViewOfFile(addr uintptr) (err error) { return } +func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) { + r1, _, e1 := syscall.Syscall9(procUpdateProcThreadAttribute.Addr(), 7, uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize)), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint32) (value uintptr, err error) { r0, _, e1 := syscall.Syscall6(procVirtualAlloc.Addr(), 4, uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect), 0, 0) value = uintptr(r0) @@ -2904,19 +3066,97 @@ func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **by return } +func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) { + r0, _, _ := syscall.Syscall12(procNtCreateFile.Addr(), 11, uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength), 0) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) { + r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) { + r0, _, _ := syscall.Syscall6(procNtQueryInformationProcess.Addr(), 5, uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen)), 0) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) { + r0, _, _ := syscall.Syscall6(procNtSetInformationProcess.Addr(), 4, uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), 0, 0) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { + r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(acl)), 0, 0) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { + r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), 4, uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)), 0, 0) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { + r0, _, _ := syscall.Syscall6(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), 4, uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)), 0, 0) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func RtlGetCurrentPeb() (peb *PEB) { + r0, _, _ := syscall.Syscall(procRtlGetCurrentPeb.Addr(), 0, 0, 0, 0) + peb = (*PEB)(unsafe.Pointer(r0)) + return +} + func rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) { syscall.Syscall(procRtlGetNtVersionNumbers.Addr(), 3, uintptr(unsafe.Pointer(majorVersion)), uintptr(unsafe.Pointer(minorVersion)), uintptr(unsafe.Pointer(buildNumber))) return } -func rtlGetVersion(info *OsVersionInfoEx) (ret error) { +func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) { r0, _, _ := syscall.Syscall(procRtlGetVersion.Addr(), 1, uintptr(unsafe.Pointer(info)), 0, 0) if r0 != 0 { - ret = syscall.Errno(r0) + ntstatus = NTStatus(r0) } return } +func RtlInitString(destinationString *NTString, sourceString *byte) { + syscall.Syscall(procRtlInitString.Addr(), 2, uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)), 0) + return +} + +func RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16) { + syscall.Syscall(procRtlInitUnicodeString.Addr(), 2, uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)), 0) + return +} + +func rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) { + r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(ntstatus), 0, 0) + ret = syscall.Errno(r0) + return +} + func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) { r0, _, _ := syscall.Syscall(procCLSIDFromString.Addr(), 2, uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid)), 0) if r0 != 0 { @@ -2933,11 +3173,32 @@ func coCreateGuid(pguid *GUID) (ret error) { return } +func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) { + r0, _, _ := syscall.Syscall6(procCoGetObject.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable)), 0, 0) + if r0 != 0 { + ret = syscall.Errno(r0) + } + return +} + +func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) { + r0, _, _ := syscall.Syscall(procCoInitializeEx.Addr(), 2, uintptr(reserved), uintptr(coInit), 0) + if r0 != 0 { + ret = syscall.Errno(r0) + } + return +} + func CoTaskMemFree(address unsafe.Pointer) { syscall.Syscall(procCoTaskMemFree.Addr(), 1, uintptr(address), 0, 0) return } +func CoUninitialize() { + syscall.Syscall(procCoUninitialize.Addr(), 0, 0, 0, 0) + return +} + func stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) { r0, _, _ := syscall.Syscall(procStringFromGUID2.Addr(), 3, uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax)) chars = int32(r0) @@ -3116,6 +3377,18 @@ func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferL return } +func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { + var _p0 uint32 + if wait { + _p0 = 1 + } + r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) { r1, _, e1 := syscall.Syscall9(procWSAIoctl.Addr(), 9, uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) if r1 == socket_error { diff --git a/cluster-autoscaler/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go index e4c62289f90d..8a7392c4a162 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.10 // +build go1.10 package bidirule diff --git a/cluster-autoscaler/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go index 02b9e1e9d4c2..bb0a920018c8 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.10 // +build !go1.10 package bidirule diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/bidi.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/bidi.go index e8edc54cc28d..fd057601bd91 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/bidi.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/bidi.go @@ -12,15 +12,14 @@ // and without notice. package bidi // import "golang.org/x/text/unicode/bidi" -// TODO: -// The following functionality would not be hard to implement, but hinges on -// the definition of a Segmenter interface. For now this is up to the user. -// - Iterate over paragraphs -// - Segmenter to iterate over runs directly from a given text. -// Also: +// TODO // - Transformer for reordering? // - Transformer (validator, really) for Bidi Rule. +import ( + "bytes" +) + // This API tries to avoid dealing with embedding levels for now. Under the hood // these will be computed, but the question is to which extent the user should // know they exist. We should at some point allow the user to specify an @@ -49,7 +48,9 @@ const ( Neutral ) -type options struct{} +type options struct { + defaultDirection Direction +} // An Option is an option for Bidi processing. type Option func(*options) @@ -66,12 +67,62 @@ type Option func(*options) // DefaultDirection sets the default direction for a Paragraph. The direction is // overridden if the text contains directional characters. func DefaultDirection(d Direction) Option { - panic("unimplemented") + return func(opts *options) { + opts.defaultDirection = d + } } // A Paragraph holds a single Paragraph for Bidi processing. type Paragraph struct { - // buffers + p []byte + o Ordering + opts []Option + types []Class + pairTypes []bracketType + pairValues []rune + runes []rune + options options +} + +// Initialize the p.pairTypes, p.pairValues and p.types from the input previously +// set by p.SetBytes() or p.SetString(). Also limit the input up to (and including) a paragraph +// separator (bidi class B). +// +// The function p.Order() needs these values to be set, so this preparation could be postponed. +// But since the SetBytes and SetStrings functions return the length of the input up to the paragraph +// separator, the whole input needs to be processed anyway and should not be done twice. +// +// The function has the same return values as SetBytes() / SetString() +func (p *Paragraph) prepareInput() (n int, err error) { + p.runes = bytes.Runes(p.p) + bytecount := 0 + // clear slices from previous SetString or SetBytes + p.pairTypes = nil + p.pairValues = nil + p.types = nil + + for _, r := range p.runes { + props, i := LookupRune(r) + bytecount += i + cls := props.Class() + if cls == B { + return bytecount, nil + } + p.types = append(p.types, cls) + if props.IsOpeningBracket() { + p.pairTypes = append(p.pairTypes, bpOpen) + p.pairValues = append(p.pairValues, r) + } else if props.IsBracket() { + // this must be a closing bracket, + // since IsOpeningBracket is not true + p.pairTypes = append(p.pairTypes, bpClose) + p.pairValues = append(p.pairValues, r) + } else { + p.pairTypes = append(p.pairTypes, bpNone) + p.pairValues = append(p.pairValues, 0) + } + } + return bytecount, nil } // SetBytes configures p for the given paragraph text. It replaces text @@ -80,70 +131,150 @@ type Paragraph struct { // consumed from b including this separator. Error may be non-nil if options are // given. func (p *Paragraph) SetBytes(b []byte, opts ...Option) (n int, err error) { - panic("unimplemented") + p.p = b + p.opts = opts + return p.prepareInput() } -// SetString configures p for the given paragraph text. It replaces text -// previously set by SetBytes or SetString. If b contains a paragraph separator +// SetString configures s for the given paragraph text. It replaces text +// previously set by SetBytes or SetString. If s contains a paragraph separator // it will only process the first paragraph and report the number of bytes -// consumed from b including this separator. Error may be non-nil if options are +// consumed from s including this separator. Error may be non-nil if options are // given. func (p *Paragraph) SetString(s string, opts ...Option) (n int, err error) { - panic("unimplemented") + p.p = []byte(s) + p.opts = opts + return p.prepareInput() } // IsLeftToRight reports whether the principle direction of rendering for this // paragraphs is left-to-right. If this returns false, the principle direction // of rendering is right-to-left. func (p *Paragraph) IsLeftToRight() bool { - panic("unimplemented") + return p.Direction() == LeftToRight } // Direction returns the direction of the text of this paragraph. // // The direction may be LeftToRight, RightToLeft, Mixed, or Neutral. func (p *Paragraph) Direction() Direction { - panic("unimplemented") + return p.o.Direction() } +// TODO: what happens if the position is > len(input)? This should return an error. + // RunAt reports the Run at the given position of the input text. // // This method can be used for computing line breaks on paragraphs. func (p *Paragraph) RunAt(pos int) Run { - panic("unimplemented") + c := 0 + runNumber := 0 + for i, r := range p.o.runes { + c += len(r) + if pos < c { + runNumber = i + } + } + return p.o.Run(runNumber) +} + +func calculateOrdering(levels []level, runes []rune) Ordering { + var curDir Direction + + prevDir := Neutral + prevI := 0 + + o := Ordering{} + // lvl = 0,2,4,...: left to right + // lvl = 1,3,5,...: right to left + for i, lvl := range levels { + if lvl%2 == 0 { + curDir = LeftToRight + } else { + curDir = RightToLeft + } + if curDir != prevDir { + if i > 0 { + o.runes = append(o.runes, runes[prevI:i]) + o.directions = append(o.directions, prevDir) + o.startpos = append(o.startpos, prevI) + } + prevI = i + prevDir = curDir + } + } + o.runes = append(o.runes, runes[prevI:]) + o.directions = append(o.directions, prevDir) + o.startpos = append(o.startpos, prevI) + return o } // Order computes the visual ordering of all the runs in a Paragraph. func (p *Paragraph) Order() (Ordering, error) { - panic("unimplemented") + if len(p.types) == 0 { + return Ordering{}, nil + } + + for _, fn := range p.opts { + fn(&p.options) + } + lvl := level(-1) + if p.options.defaultDirection == RightToLeft { + lvl = 1 + } + para, err := newParagraph(p.types, p.pairTypes, p.pairValues, lvl) + if err != nil { + return Ordering{}, err + } + + levels := para.getLevels([]int{len(p.types)}) + + p.o = calculateOrdering(levels, p.runes) + return p.o, nil } // Line computes the visual ordering of runs for a single line starting and // ending at the given positions in the original text. func (p *Paragraph) Line(start, end int) (Ordering, error) { - panic("unimplemented") + lineTypes := p.types[start:end] + para, err := newParagraph(lineTypes, p.pairTypes[start:end], p.pairValues[start:end], -1) + if err != nil { + return Ordering{}, err + } + levels := para.getLevels([]int{len(lineTypes)}) + o := calculateOrdering(levels, p.runes[start:end]) + return o, nil } // An Ordering holds the computed visual order of runs of a Paragraph. Calling // SetBytes or SetString on the originating Paragraph invalidates an Ordering. // The methods of an Ordering should only be called by one goroutine at a time. -type Ordering struct{} +type Ordering struct { + runes [][]rune + directions []Direction + startpos []int +} // Direction reports the directionality of the runs. // // The direction may be LeftToRight, RightToLeft, Mixed, or Neutral. func (o *Ordering) Direction() Direction { - panic("unimplemented") + return o.directions[0] } // NumRuns returns the number of runs. func (o *Ordering) NumRuns() int { - panic("unimplemented") + return len(o.runes) } // Run returns the ith run within the ordering. func (o *Ordering) Run(i int) Run { - panic("unimplemented") + r := Run{ + runes: o.runes[i], + direction: o.directions[i], + startpos: o.startpos[i], + } + return r } // TODO: perhaps with options. @@ -155,16 +286,19 @@ func (o *Ordering) Run(i int) Run { // A Run is a continuous sequence of characters of a single direction. type Run struct { + runes []rune + direction Direction + startpos int } // String returns the text of the run in its original order. func (r *Run) String() string { - panic("unimplemented") + return string(r.runes) } // Bytes returns the text of the run in its original order. func (r *Run) Bytes() []byte { - panic("unimplemented") + return []byte(r.String()) } // TODO: methods for @@ -174,25 +308,52 @@ func (r *Run) Bytes() []byte { // Direction reports the direction of the run. func (r *Run) Direction() Direction { - panic("unimplemented") + return r.direction } -// Position of the Run within the text passed to SetBytes or SetString of the +// Pos returns the position of the Run within the text passed to SetBytes or SetString of the // originating Paragraph value. func (r *Run) Pos() (start, end int) { - panic("unimplemented") + return r.startpos, r.startpos + len(r.runes) - 1 } // AppendReverse reverses the order of characters of in, appends them to out, // and returns the result. Modifiers will still follow the runes they modify. // Brackets are replaced with their counterparts. func AppendReverse(out, in []byte) []byte { - panic("unimplemented") + ret := make([]byte, len(in)+len(out)) + copy(ret, out) + inRunes := bytes.Runes(in) + + for i, r := range inRunes { + prop, _ := LookupRune(r) + if prop.IsBracket() { + inRunes[i] = prop.reverseBracket(r) + } + } + + for i, j := 0, len(inRunes)-1; i < j; i, j = i+1, j-1 { + inRunes[i], inRunes[j] = inRunes[j], inRunes[i] + } + copy(ret[len(out):], string(inRunes)) + + return ret } // ReverseString reverses the order of characters in s and returns a new string. // Modifiers will still follow the runes they modify. Brackets are replaced with // their counterparts. func ReverseString(s string) string { - panic("unimplemented") + input := []rune(s) + li := len(input) + ret := make([]rune, li) + for i, r := range input { + prop, _ := LookupRune(r) + if prop.IsBracket() { + ret[li-i-1] = prop.reverseBracket(r) + } else { + ret[li-i-1] = r + } + } + return string(ret) } diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/core.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/core.go index 50deb6600a3c..e4c0811016c2 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/core.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/core.go @@ -4,7 +4,10 @@ package bidi -import "log" +import ( + "fmt" + "log" +) // This implementation is a port based on the reference implementation found at: // https://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/ @@ -97,13 +100,20 @@ type paragraph struct { // rune (suggested is the rune of the open bracket for opening and matching // close brackets, after normalization). The embedding levels are optional, but // may be supplied to encode embedding levels of styled text. -// -// TODO: return an error. -func newParagraph(types []Class, pairTypes []bracketType, pairValues []rune, levels level) *paragraph { - validateTypes(types) - validatePbTypes(pairTypes) - validatePbValues(pairValues, pairTypes) - validateParagraphEmbeddingLevel(levels) +func newParagraph(types []Class, pairTypes []bracketType, pairValues []rune, levels level) (*paragraph, error) { + var err error + if err = validateTypes(types); err != nil { + return nil, err + } + if err = validatePbTypes(pairTypes); err != nil { + return nil, err + } + if err = validatePbValues(pairValues, pairTypes); err != nil { + return nil, err + } + if err = validateParagraphEmbeddingLevel(levels); err != nil { + return nil, err + } p := ¶graph{ initialTypes: append([]Class(nil), types...), @@ -115,7 +125,7 @@ func newParagraph(types []Class, pairTypes []bracketType, pairValues []rune, lev resultTypes: append([]Class(nil), types...), } p.run() - return p + return p, nil } func (p *paragraph) Len() int { return len(p.initialTypes) } @@ -1001,58 +1011,61 @@ func typeForLevel(level level) Class { return R } -// TODO: change validation to not panic - -func validateTypes(types []Class) { +func validateTypes(types []Class) error { if len(types) == 0 { - log.Panic("types is null") + return fmt.Errorf("types is null") } for i, t := range types[:len(types)-1] { if t == B { - log.Panicf("B type before end of paragraph at index: %d", i) + return fmt.Errorf("B type before end of paragraph at index: %d", i) } } + return nil } -func validateParagraphEmbeddingLevel(embeddingLevel level) { +func validateParagraphEmbeddingLevel(embeddingLevel level) error { if embeddingLevel != implicitLevel && embeddingLevel != 0 && embeddingLevel != 1 { - log.Panicf("illegal paragraph embedding level: %d", embeddingLevel) + return fmt.Errorf("illegal paragraph embedding level: %d", embeddingLevel) } + return nil } -func validateLineBreaks(linebreaks []int, textLength int) { +func validateLineBreaks(linebreaks []int, textLength int) error { prev := 0 for i, next := range linebreaks { if next <= prev { - log.Panicf("bad linebreak: %d at index: %d", next, i) + return fmt.Errorf("bad linebreak: %d at index: %d", next, i) } prev = next } if prev != textLength { - log.Panicf("last linebreak was %d, want %d", prev, textLength) + return fmt.Errorf("last linebreak was %d, want %d", prev, textLength) } + return nil } -func validatePbTypes(pairTypes []bracketType) { +func validatePbTypes(pairTypes []bracketType) error { if len(pairTypes) == 0 { - log.Panic("pairTypes is null") + return fmt.Errorf("pairTypes is null") } for i, pt := range pairTypes { switch pt { case bpNone, bpOpen, bpClose: default: - log.Panicf("illegal pairType value at %d: %v", i, pairTypes[i]) + return fmt.Errorf("illegal pairType value at %d: %v", i, pairTypes[i]) } } + return nil } -func validatePbValues(pairValues []rune, pairTypes []bracketType) { +func validatePbValues(pairValues []rune, pairTypes []bracketType) error { if pairValues == nil { - log.Panic("pairValues is null") + return fmt.Errorf("pairValues is null") } if len(pairTypes) != len(pairValues) { - log.Panic("pairTypes is different length from pairValues") + return fmt.Errorf("pairTypes is different length from pairValues") } + return nil } diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go index d8c94e1bd1a6..42fa8d72cec0 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.10 && !go1.13 // +build go1.10,!go1.13 package bidi diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go index 16b11db53883..56a0e1ea2165 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.13 && !go1.14 // +build go1.13,!go1.14 package bidi diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go index 647f2d4279e6..baacf32b43c3 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.14 && !go1.16 // +build go1.14,!go1.16 package bidi diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go index c937d0976feb..f248effae17b 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.16 // +build go1.16 package bidi diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go index 0ca0193ebe2d..f517fdb202a5 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build !go1.10 // +build !go1.10 package bidi diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go index 26fbd55a1243..f5a0788277ff 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.10 && !go1.13 // +build go1.10,!go1.13 package norm diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go index 2c58f09baa49..cb7239c4377d 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.13 && !go1.14 // +build go1.13,!go1.14 package norm diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go index 7e1ae096e5c0..11b27330017d 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.14 && !go1.16 // +build go1.14,!go1.16 package norm diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go index 9ea1b421407d..96a130d30e9e 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.16 // +build go1.16 package norm diff --git a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go index 942906929135..0175eae50aa6 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build !go1.10 // +build !go1.10 package norm diff --git a/cluster-autoscaler/vendor/golang.org/x/text/width/tables10.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/width/tables10.0.0.go index decb8e480939..186b1d4efac5 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/width/tables10.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/width/tables10.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.10 && !go1.13 // +build go1.10,!go1.13 package width diff --git a/cluster-autoscaler/vendor/golang.org/x/text/width/tables11.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/width/tables11.0.0.go index 3c75e428fd0d..990f7622f175 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/width/tables11.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/width/tables11.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.13 && !go1.14 // +build go1.13,!go1.14 package width diff --git a/cluster-autoscaler/vendor/golang.org/x/text/width/tables12.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/width/tables12.0.0.go index 543942b9e781..85296297e38c 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/width/tables12.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/width/tables12.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.14 && !go1.16 // +build go1.14,!go1.16 package width diff --git a/cluster-autoscaler/vendor/golang.org/x/text/width/tables13.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/width/tables13.0.0.go index 804264ca67d1..bac3f1aee341 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/width/tables13.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/width/tables13.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build go1.16 // +build go1.16 package width diff --git a/cluster-autoscaler/vendor/golang.org/x/text/width/tables9.0.0.go b/cluster-autoscaler/vendor/golang.org/x/text/width/tables9.0.0.go index 7069e26345b2..b3db84f6f9b6 100644 --- a/cluster-autoscaler/vendor/golang.org/x/text/width/tables9.0.0.go +++ b/cluster-autoscaler/vendor/golang.org/x/text/width/tables9.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build !go1.10 // +build !go1.10 package width diff --git a/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto index 539c8c9e2b20..c4506eb92365 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto @@ -86,9 +86,12 @@ message StorageVersionCondition { // A list of StorageVersions. message StorageVersionList { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + // Items holds a list of StorageVersion repeated StorageVersion items = 2; } diff --git a/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/types.go b/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/types.go index 880091b6f82b..bfa249e135c7 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/types.go @@ -121,7 +121,10 @@ type StorageVersionCondition struct { // A list of StorageVersions. type StorageVersionList struct { metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Items []StorageVersion `json:"items" protobuf:"bytes,2,rep,name=items"` + // Items holds a list of StorageVersion + Items []StorageVersion `json:"items" protobuf:"bytes,2,rep,name=items"` } diff --git a/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/types_swagger_doc_generated.go index b05c28595436..297ed08a7157 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apiserverinternal/v1alpha1/types_swagger_doc_generated.go @@ -64,7 +64,9 @@ func (StorageVersionCondition) SwaggerDoc() map[string]string { } var map_StorageVersionList = map[string]string{ - "": "A list of StorageVersions.", + "": "A list of StorageVersions.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "Items holds a list of StorageVersion", } func (StorageVersionList) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/generated.pb.go index 19fe45638867..0a15aff4d8c2 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/generated.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/generated.pb.go @@ -868,134 +868,135 @@ func init() { } var fileDescriptor_e1014cab6f31e43b = []byte{ - // 2031 bytes of a gzipped FileDescriptorProto + // 2047 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x6f, 0x24, 0x47, 0x15, 0x77, 0xcf, 0x87, 0x3d, 0x2e, 0xaf, 0xed, 0xdd, 0xb2, 0xb1, 0x27, 0xbb, 0x64, 0x66, 0x19, 0x60, 0xe3, 0x64, 0xb3, 0x3d, 0xec, 0x66, 0x13, 0xa1, 0x2c, 0x02, 0x79, 0xc6, 0x21, 0x84, 0x78, 0x6c, 0x53, 0x5e, 0xef, 0x61, 0x09, 0x12, 0xe5, 0xe9, 0xda, 0x71, 0xc7, 0xfd, 0xa5, 0xee, 0xea, - 0x61, 0x47, 0x5c, 0x10, 0x12, 0x37, 0x0e, 0xfc, 0x27, 0x08, 0x21, 0xb8, 0xa1, 0x08, 0x71, 0xd9, - 0x0b, 0x52, 0xc4, 0x85, 0x9c, 0x2c, 0x76, 0x72, 0x42, 0x28, 0x47, 0x2e, 0xb9, 0x80, 0xaa, 0xba, - 0xfa, 0xbb, 0xda, 0x33, 0xf6, 0x26, 0xce, 0x87, 0x72, 0xf3, 0x54, 0xfd, 0xde, 0xaf, 0xde, 0xab, - 0x7a, 0x55, 0xef, 0xd7, 0x55, 0x06, 0xf7, 0x8e, 0xbf, 0xeb, 0xa9, 0xba, 0xdd, 0x3e, 0xf6, 0x0f, - 0x89, 0x6b, 0x11, 0x4a, 0xbc, 0xf6, 0x90, 0x58, 0x9a, 0xed, 0xb6, 0x45, 0x07, 0x76, 0xf4, 0x36, - 0x76, 0x1c, 0xaf, 0x3d, 0xbc, 0xdd, 0x1e, 0x10, 0x8b, 0xb8, 0x98, 0x12, 0x4d, 0x75, 0x5c, 0x9b, - 0xda, 0x10, 0x06, 0x18, 0x15, 0x3b, 0xba, 0xca, 0x30, 0xea, 0xf0, 0xf6, 0xd5, 0x5b, 0x03, 0x9d, - 0x1e, 0xf9, 0x87, 0x6a, 0xdf, 0x36, 0xdb, 0x03, 0x7b, 0x60, 0xb7, 0x39, 0xf4, 0xd0, 0x7f, 0xc4, - 0x7f, 0xf1, 0x1f, 0xfc, 0xaf, 0x80, 0xe2, 0x6a, 0x2b, 0x31, 0x4c, 0xdf, 0x76, 0x89, 0x64, 0x98, - 0xab, 0x77, 0x63, 0x8c, 0x89, 0xfb, 0x47, 0xba, 0x45, 0xdc, 0x51, 0xdb, 0x39, 0x1e, 0xb0, 0x06, - 0xaf, 0x6d, 0x12, 0x8a, 0x65, 0x56, 0xed, 0x22, 0x2b, 0xd7, 0xb7, 0xa8, 0x6e, 0x92, 0x9c, 0xc1, - 0x6b, 0x93, 0x0c, 0xbc, 0xfe, 0x11, 0x31, 0x71, 0xce, 0xee, 0x95, 0x22, 0x3b, 0x9f, 0xea, 0x46, - 0x5b, 0xb7, 0xa8, 0x47, 0xdd, 0xac, 0x51, 0xeb, 0xbf, 0x0a, 0x80, 0x5d, 0xdb, 0xa2, 0xae, 0x6d, - 0x18, 0xc4, 0x45, 0x64, 0xa8, 0x7b, 0xba, 0x6d, 0xc1, 0x9f, 0x83, 0x1a, 0x8b, 0x47, 0xc3, 0x14, - 0xd7, 0x95, 0xeb, 0xca, 0xc6, 0xc2, 0x9d, 0xef, 0xa8, 0xf1, 0x24, 0x47, 0xf4, 0xaa, 0x73, 0x3c, - 0x60, 0x0d, 0x9e, 0xca, 0xd0, 0xea, 0xf0, 0xb6, 0xba, 0x7b, 0xf8, 0x2e, 0xe9, 0xd3, 0x1e, 0xa1, - 0xb8, 0x03, 0x9f, 0x9c, 0x34, 0x67, 0xc6, 0x27, 0x4d, 0x10, 0xb7, 0xa1, 0x88, 0x15, 0xee, 0x82, - 0x0a, 0x67, 0x2f, 0x71, 0xf6, 0x5b, 0x85, 0xec, 0x22, 0x68, 0x15, 0xe1, 0x5f, 0xbc, 0xf1, 0x98, - 0x12, 0x8b, 0xb9, 0xd7, 0xb9, 0x24, 0xa8, 0x2b, 0x5b, 0x98, 0x62, 0xc4, 0x89, 0xe0, 0xcb, 0xa0, - 0xe6, 0x0a, 0xf7, 0xeb, 0xe5, 0xeb, 0xca, 0x46, 0xb9, 0x73, 0x59, 0xa0, 0x6a, 0x61, 0x58, 0x28, - 0x42, 0xb4, 0xfe, 0xa6, 0x80, 0xb5, 0x7c, 0xdc, 0xdb, 0xba, 0x47, 0xe1, 0x3b, 0xb9, 0xd8, 0xd5, - 0xe9, 0x62, 0x67, 0xd6, 0x3c, 0xf2, 0x68, 0xe0, 0xb0, 0x25, 0x11, 0xf7, 0xdb, 0xa0, 0xaa, 0x53, - 0x62, 0x7a, 0xf5, 0xd2, 0xf5, 0xf2, 0xc6, 0xc2, 0x9d, 0x1b, 0x6a, 0x3e, 0x77, 0xd5, 0xbc, 0x63, - 0x9d, 0x45, 0x41, 0x59, 0x7d, 0x8b, 0x19, 0xa3, 0x80, 0xa3, 0xf5, 0x3f, 0x05, 0xcc, 0x6f, 0x61, - 0x62, 0xda, 0xd6, 0x3e, 0xa1, 0x17, 0xb0, 0x68, 0x5d, 0x50, 0xf1, 0x1c, 0xd2, 0x17, 0x8b, 0xf6, - 0x0d, 0x99, 0xef, 0x91, 0x3b, 0xfb, 0x0e, 0xe9, 0xc7, 0x0b, 0xc5, 0x7e, 0x21, 0x6e, 0x0c, 0xdf, - 0x06, 0xb3, 0x1e, 0xc5, 0xd4, 0xf7, 0xf8, 0x32, 0x2d, 0xdc, 0xf9, 0xe6, 0xe9, 0x34, 0x1c, 0xda, - 0x59, 0x12, 0x44, 0xb3, 0xc1, 0x6f, 0x24, 0x28, 0x5a, 0xff, 0x2e, 0x01, 0x18, 0x61, 0xbb, 0xb6, - 0xa5, 0xe9, 0x94, 0xe5, 0xef, 0xeb, 0xa0, 0x42, 0x47, 0x0e, 0xe1, 0xd3, 0x30, 0xdf, 0xb9, 0x11, - 0x7a, 0x71, 0x7f, 0xe4, 0x90, 0x8f, 0x4f, 0x9a, 0x6b, 0x79, 0x0b, 0xd6, 0x83, 0xb8, 0x0d, 0xdc, - 0x8e, 0xfc, 0x2b, 0x71, 0xeb, 0xbb, 0xe9, 0xa1, 0x3f, 0x3e, 0x69, 0x4a, 0x0e, 0x0b, 0x35, 0x62, - 0x4a, 0x3b, 0x08, 0x87, 0x00, 0x1a, 0xd8, 0xa3, 0xf7, 0x5d, 0x6c, 0x79, 0xc1, 0x48, 0xba, 0x49, - 0x44, 0xe4, 0x2f, 0x4d, 0xb7, 0x3c, 0xcc, 0xa2, 0x73, 0x55, 0x78, 0x01, 0xb7, 0x73, 0x6c, 0x48, - 0x32, 0x02, 0xbc, 0x01, 0x66, 0x5d, 0x82, 0x3d, 0xdb, 0xaa, 0x57, 0x78, 0x14, 0xd1, 0x04, 0x22, - 0xde, 0x8a, 0x44, 0x2f, 0x7c, 0x11, 0xcc, 0x99, 0xc4, 0xf3, 0xf0, 0x80, 0xd4, 0xab, 0x1c, 0xb8, - 0x2c, 0x80, 0x73, 0xbd, 0xa0, 0x19, 0x85, 0xfd, 0xad, 0x3f, 0x28, 0x60, 0x31, 0x9a, 0xb9, 0x0b, - 0xd8, 0x2a, 0x9d, 0xf4, 0x56, 0x79, 0xfe, 0xd4, 0x3c, 0x29, 0xd8, 0x21, 0xef, 0x95, 0x13, 0x3e, - 0xb3, 0x24, 0x84, 0x3f, 0x03, 0x35, 0x8f, 0x18, 0xa4, 0x4f, 0x6d, 0x57, 0xf8, 0xfc, 0xca, 0x94, - 0x3e, 0xe3, 0x43, 0x62, 0xec, 0x0b, 0xd3, 0xce, 0x25, 0xe6, 0x74, 0xf8, 0x0b, 0x45, 0x94, 0xf0, - 0x27, 0xa0, 0x46, 0x89, 0xe9, 0x18, 0x98, 0x12, 0xb1, 0x4d, 0x52, 0xf9, 0xcd, 0xd2, 0x85, 0x91, - 0xed, 0xd9, 0xda, 0x7d, 0x01, 0xe3, 0x1b, 0x25, 0x9a, 0x87, 0xb0, 0x15, 0x45, 0x34, 0xf0, 0x18, - 0x2c, 0xf9, 0x8e, 0xc6, 0x90, 0x94, 0x1d, 0xdd, 0x83, 0x91, 0x48, 0x9f, 0x9b, 0xa7, 0x4e, 0xc8, - 0x41, 0xca, 0xa4, 0xb3, 0x26, 0x06, 0x58, 0x4a, 0xb7, 0xa3, 0x0c, 0x35, 0xdc, 0x04, 0xcb, 0xa6, - 0x6e, 0x21, 0x82, 0xb5, 0xd1, 0x3e, 0xe9, 0xdb, 0x96, 0xe6, 0xf1, 0x04, 0xaa, 0x76, 0xd6, 0x05, - 0xc1, 0x72, 0x2f, 0xdd, 0x8d, 0xb2, 0x78, 0xb8, 0x0d, 0x56, 0xc3, 0x73, 0xf6, 0x47, 0xba, 0x47, - 0x6d, 0x77, 0xb4, 0xad, 0x9b, 0x3a, 0xad, 0xcf, 0x72, 0x9e, 0xfa, 0xf8, 0xa4, 0xb9, 0x8a, 0x24, - 0xfd, 0x48, 0x6a, 0xd5, 0xfa, 0xed, 0x2c, 0x58, 0xce, 0x9c, 0x06, 0xf0, 0x01, 0x58, 0xeb, 0xfb, - 0xae, 0x4b, 0x2c, 0xba, 0xe3, 0x9b, 0x87, 0xc4, 0xdd, 0xef, 0x1f, 0x11, 0xcd, 0x37, 0x88, 0xc6, - 0x57, 0xb4, 0xda, 0x69, 0x08, 0x5f, 0xd7, 0xba, 0x52, 0x14, 0x2a, 0xb0, 0x86, 0x3f, 0x06, 0xd0, - 0xe2, 0x4d, 0x3d, 0xdd, 0xf3, 0x22, 0xce, 0x12, 0xe7, 0x8c, 0x36, 0xe0, 0x4e, 0x0e, 0x81, 0x24, - 0x56, 0xcc, 0x47, 0x8d, 0x78, 0xba, 0x4b, 0xb4, 0xac, 0x8f, 0xe5, 0xb4, 0x8f, 0x5b, 0x52, 0x14, - 0x2a, 0xb0, 0x86, 0xaf, 0x82, 0x85, 0x60, 0x34, 0x3e, 0xe7, 0x62, 0x71, 0x56, 0x04, 0xd9, 0xc2, - 0x4e, 0xdc, 0x85, 0x92, 0x38, 0x16, 0x9a, 0x7d, 0xe8, 0x11, 0x77, 0x48, 0xb4, 0x37, 0x03, 0x0d, - 0xc0, 0x0a, 0x65, 0x95, 0x17, 0xca, 0x28, 0xb4, 0xdd, 0x1c, 0x02, 0x49, 0xac, 0x58, 0x68, 0x41, - 0xd6, 0xe4, 0x42, 0x9b, 0x4d, 0x87, 0x76, 0x20, 0x45, 0xa1, 0x02, 0x6b, 0x96, 0x7b, 0x81, 0xcb, - 0x9b, 0x43, 0xac, 0x1b, 0xf8, 0xd0, 0x20, 0xf5, 0xb9, 0x74, 0xee, 0xed, 0xa4, 0xbb, 0x51, 0x16, - 0x0f, 0xdf, 0x04, 0x57, 0x82, 0xa6, 0x03, 0x0b, 0x47, 0x24, 0x35, 0x4e, 0xf2, 0x9c, 0x20, 0xb9, - 0xb2, 0x93, 0x05, 0xa0, 0xbc, 0x0d, 0x7c, 0x1d, 0x2c, 0xf5, 0x6d, 0xc3, 0xe0, 0xf9, 0xd8, 0xb5, - 0x7d, 0x8b, 0xd6, 0xe7, 0x39, 0x0b, 0x64, 0x7b, 0xa8, 0x9b, 0xea, 0x41, 0x19, 0x24, 0x7c, 0x08, - 0x40, 0x3f, 0x2c, 0x07, 0x5e, 0x1d, 0x14, 0x17, 0xfa, 0x7c, 0x1d, 0x8a, 0x0b, 0x70, 0xd4, 0xe4, - 0xa1, 0x04, 0x5b, 0xeb, 0x3d, 0x05, 0xac, 0x17, 0xec, 0x71, 0xf8, 0x83, 0x54, 0xd5, 0xbb, 0x99, - 0xa9, 0x7a, 0xd7, 0x0a, 0xcc, 0x12, 0xa5, 0xaf, 0x0f, 0x16, 0x99, 0xee, 0xd0, 0xad, 0x41, 0x00, - 0x11, 0x27, 0xd8, 0x4b, 0x32, 0xdf, 0x51, 0x12, 0x18, 0x1f, 0xc3, 0x57, 0xc6, 0x27, 0xcd, 0xc5, - 0x54, 0x1f, 0x4a, 0x73, 0xb6, 0x7e, 0x5d, 0x02, 0x60, 0x8b, 0x38, 0x86, 0x3d, 0x32, 0x89, 0x75, - 0x11, 0xaa, 0x65, 0x2b, 0xa5, 0x5a, 0x5a, 0xd2, 0x85, 0x88, 0xfc, 0x29, 0x94, 0x2d, 0xdb, 0x19, - 0xd9, 0xf2, 0xad, 0x09, 0x3c, 0xa7, 0xeb, 0x96, 0x7f, 0x96, 0xc1, 0x4a, 0x0c, 0x8e, 0x85, 0xcb, - 0xbd, 0xd4, 0x12, 0xbe, 0x90, 0x59, 0xc2, 0x75, 0x89, 0xc9, 0xa7, 0xa6, 0x5c, 0xde, 0x05, 0x4b, - 0x4c, 0x57, 0x04, 0xab, 0xc6, 0x55, 0xcb, 0xec, 0x99, 0x55, 0x4b, 0x54, 0x75, 0xb6, 0x53, 0x4c, - 0x28, 0xc3, 0x5c, 0xa0, 0x92, 0xe6, 0xbe, 0x88, 0x2a, 0xe9, 0x8f, 0x0a, 0x58, 0x8a, 0x97, 0xe9, - 0x02, 0x64, 0x52, 0x37, 0x2d, 0x93, 0x1a, 0xa7, 0xe7, 0x65, 0x81, 0x4e, 0xfa, 0x47, 0x25, 0xe9, - 0x35, 0x17, 0x4a, 0x1b, 0xec, 0x83, 0xca, 0x31, 0xf4, 0x3e, 0xf6, 0x44, 0x59, 0xbd, 0x14, 0x7c, - 0x4c, 0x05, 0x6d, 0x28, 0xea, 0x4d, 0x49, 0xaa, 0xd2, 0xa7, 0x2b, 0xa9, 0xca, 0x9f, 0x8c, 0xa4, - 0xba, 0x0f, 0x6a, 0x5e, 0x28, 0xa6, 0x2a, 0x9c, 0xf2, 0xc6, 0xa4, 0xed, 0x2c, 0x74, 0x54, 0xc4, - 0x1a, 0x29, 0xa8, 0x88, 0x49, 0xa6, 0x9d, 0xaa, 0x9f, 0xa5, 0x76, 0x62, 0xe9, 0xed, 0x60, 0xdf, - 0x23, 0x1a, 0xdf, 0x4a, 0xb5, 0x38, 0xbd, 0xf7, 0x78, 0x2b, 0x12, 0xbd, 0xf0, 0x00, 0xac, 0x3b, - 0xae, 0x3d, 0x70, 0x89, 0xe7, 0x6d, 0x11, 0xac, 0x19, 0xba, 0x45, 0xc2, 0x00, 0x82, 0xaa, 0x77, - 0x6d, 0x7c, 0xd2, 0x5c, 0xdf, 0x93, 0x43, 0x50, 0x91, 0x6d, 0xeb, 0x2f, 0x15, 0x70, 0x39, 0x7b, - 0x22, 0x16, 0x08, 0x11, 0xe5, 0x5c, 0x42, 0xe4, 0xe5, 0x44, 0x8a, 0x06, 0x2a, 0x2d, 0xf1, 0xcd, - 0x9f, 0x4b, 0xd3, 0x4d, 0xb0, 0x2c, 0x84, 0x47, 0xd8, 0x29, 0xa4, 0x58, 0xb4, 0x3c, 0x07, 0xe9, - 0x6e, 0x94, 0xc5, 0xc3, 0x7b, 0x60, 0xd1, 0xe5, 0xda, 0x2a, 0x24, 0x08, 0xf4, 0xc9, 0xd7, 0x04, - 0xc1, 0x22, 0x4a, 0x76, 0xa2, 0x34, 0x96, 0x69, 0x93, 0x58, 0x72, 0x84, 0x04, 0x95, 0xb4, 0x36, - 0xd9, 0xcc, 0x02, 0x50, 0xde, 0x06, 0xf6, 0xc0, 0x8a, 0x6f, 0xe5, 0xa9, 0x82, 0x5c, 0xbb, 0x26, - 0xa8, 0x56, 0x0e, 0xf2, 0x10, 0x24, 0xb3, 0x83, 0x3f, 0x4d, 0xc9, 0x95, 0x59, 0x7e, 0x8a, 0xbc, - 0x70, 0xfa, 0x76, 0x98, 0x5a, 0xaf, 0x48, 0x74, 0x54, 0x6d, 0x5a, 0x1d, 0xd5, 0xfa, 0xb3, 0x02, - 0x60, 0x7e, 0x0b, 0x4e, 0xfc, 0xb8, 0xcf, 0x59, 0x24, 0x4a, 0xa4, 0x26, 0x57, 0x38, 0x37, 0x27, - 0x2b, 0x9c, 0xf8, 0x04, 0x9d, 0x4e, 0xe2, 0x88, 0xe9, 0xbd, 0x98, 0x8b, 0x99, 0x29, 0x24, 0x4e, - 0xec, 0xcf, 0xb3, 0x49, 0x9c, 0x04, 0xcf, 0xe9, 0x12, 0xe7, 0x3f, 0x25, 0xb0, 0x12, 0x83, 0xa7, - 0x96, 0x38, 0x12, 0x93, 0xaf, 0x2e, 0x67, 0xa6, 0x93, 0x1d, 0xf1, 0xd4, 0x7d, 0x4e, 0x64, 0x47, - 0xec, 0x50, 0x81, 0xec, 0xf8, 0x7d, 0x29, 0xe9, 0xf5, 0x19, 0x65, 0xc7, 0x27, 0x70, 0x55, 0xf1, - 0x85, 0x53, 0x2e, 0xad, 0xbf, 0x96, 0xc1, 0xe5, 0xec, 0x16, 0x4c, 0xd5, 0x41, 0x65, 0x62, 0x1d, - 0xdc, 0x03, 0xab, 0x8f, 0x7c, 0xc3, 0x18, 0xf1, 0x18, 0x12, 0xc5, 0x30, 0xa8, 0xa0, 0x5f, 0x17, - 0x96, 0xab, 0x3f, 0x94, 0x60, 0x90, 0xd4, 0x32, 0x5f, 0x16, 0x2b, 0xcf, 0x5a, 0x16, 0xab, 0xe7, - 0x28, 0x8b, 0x72, 0x65, 0x51, 0x3e, 0x97, 0xb2, 0x98, 0xba, 0x26, 0x4a, 0x8e, 0xab, 0x89, 0xdf, - 0xf0, 0x63, 0x05, 0xac, 0xc9, 0x3f, 0x9f, 0xa1, 0x01, 0x96, 0x4c, 0xfc, 0x38, 0x79, 0x79, 0x31, - 0xa9, 0x60, 0xf8, 0x54, 0x37, 0xd4, 0xe0, 0x75, 0x47, 0x7d, 0xcb, 0xa2, 0xbb, 0xee, 0x3e, 0x75, - 0x75, 0x6b, 0x10, 0x14, 0xd8, 0x5e, 0x8a, 0x0b, 0x65, 0xb8, 0xe1, 0x43, 0x50, 0x33, 0xf1, 0xe3, - 0x7d, 0xdf, 0x1d, 0x84, 0x85, 0xf0, 0xec, 0xe3, 0xf0, 0xdc, 0xef, 0x09, 0x16, 0x14, 0xf1, 0xb5, - 0x3e, 0x54, 0xc0, 0x7a, 0x41, 0x05, 0xfd, 0x12, 0x45, 0xb9, 0x0b, 0xae, 0xa7, 0x82, 0x64, 0x1b, - 0x92, 0x3c, 0xf2, 0x0d, 0xbe, 0x37, 0x85, 0x5e, 0xb9, 0x09, 0xe6, 0x1d, 0xec, 0x52, 0x3d, 0x12, - 0xba, 0xd5, 0xce, 0xe2, 0xf8, 0xa4, 0x39, 0xbf, 0x17, 0x36, 0xa2, 0xb8, 0xbf, 0xf5, 0x9b, 0x12, - 0x58, 0x48, 0x90, 0x5c, 0x80, 0x76, 0x78, 0x23, 0xa5, 0x1d, 0xa4, 0xaf, 0x31, 0xc9, 0xa8, 0x8a, - 0xc4, 0x43, 0x2f, 0x23, 0x1e, 0xbe, 0x3d, 0x89, 0xe8, 0x74, 0xf5, 0xf0, 0x51, 0x09, 0xac, 0x26, - 0xd0, 0xb1, 0x7c, 0xf8, 0x5e, 0x4a, 0x3e, 0x6c, 0x64, 0xe4, 0x43, 0x5d, 0x66, 0xf3, 0x95, 0x7e, - 0x98, 0xac, 0x1f, 0xfe, 0xa4, 0x80, 0xe5, 0xc4, 0xdc, 0x5d, 0x80, 0x80, 0xd8, 0x4a, 0x0b, 0x88, - 0xe6, 0x84, 0x7c, 0x29, 0x50, 0x10, 0x4f, 0xaa, 0x29, 0xbf, 0xbf, 0xf4, 0x37, 0x17, 0xbf, 0x04, - 0xab, 0x43, 0xdb, 0xf0, 0x4d, 0xd2, 0x35, 0xb0, 0x6e, 0x86, 0x00, 0x56, 0x71, 0xd9, 0x24, 0xbe, - 0x28, 0xa5, 0x27, 0xae, 0xa7, 0x7b, 0x94, 0x58, 0xf4, 0x41, 0x6c, 0x19, 0xd7, 0xf9, 0x07, 0x12, - 0x3a, 0x24, 0x1d, 0x04, 0xbe, 0x0a, 0x16, 0x58, 0xa5, 0xd4, 0xfb, 0x64, 0x07, 0x9b, 0x61, 0x4e, - 0x45, 0x6f, 0x0f, 0xfb, 0x71, 0x17, 0x4a, 0xe2, 0xe0, 0x11, 0x58, 0x71, 0x6c, 0xad, 0x87, 0x2d, - 0x3c, 0x20, 0xec, 0xfc, 0xdf, 0xb3, 0x0d, 0xbd, 0x3f, 0xe2, 0x77, 0x1a, 0xf3, 0x9d, 0xd7, 0xc2, - 0xef, 0xd5, 0xbd, 0x3c, 0x84, 0x7d, 0x0f, 0x48, 0x9a, 0xf9, 0x7e, 0x96, 0x51, 0x42, 0x33, 0xf7, - 0x54, 0x36, 0x97, 0xfb, 0xff, 0x02, 0x59, 0x72, 0x9d, 0xf3, 0xb1, 0xac, 0xe8, 0xb6, 0xa6, 0x76, - 0xae, 0x97, 0xae, 0x8f, 0x2a, 0xe0, 0x4a, 0xee, 0x80, 0xfc, 0x0c, 0xef, 0x4b, 0x72, 0xaa, 0xae, - 0x7c, 0x06, 0x55, 0xb7, 0x09, 0x96, 0xc5, 0x23, 0x5b, 0x46, 0x14, 0x46, 0xe2, 0xbc, 0x9b, 0xee, - 0x46, 0x59, 0xbc, 0xec, 0xbe, 0xa6, 0x7a, 0xc6, 0xfb, 0x9a, 0xa4, 0x17, 0xe2, 0x7f, 0x43, 0x82, - 0xac, 0xcb, 0x7b, 0x21, 0xfe, 0x45, 0x24, 0x8b, 0x87, 0xdf, 0x0f, 0x53, 0x2a, 0x62, 0x98, 0xe3, - 0x0c, 0x99, 0x1c, 0x89, 0x08, 0x32, 0xe8, 0x67, 0x7a, 0x48, 0x7a, 0x47, 0xf2, 0x90, 0xb4, 0x31, - 0x21, 0x95, 0xa7, 0x97, 0xa1, 0x7f, 0x57, 0xc0, 0x73, 0x85, 0x7b, 0x00, 0x6e, 0xa6, 0xea, 0xec, - 0xad, 0x4c, 0x9d, 0x7d, 0xbe, 0xd0, 0x30, 0x51, 0x6c, 0x4d, 0xf9, 0x65, 0xcb, 0xdd, 0x89, 0x97, - 0x2d, 0x12, 0x15, 0x35, 0xf9, 0xd6, 0xa5, 0xb3, 0xf1, 0xe4, 0x69, 0x63, 0xe6, 0xfd, 0xa7, 0x8d, - 0x99, 0x0f, 0x9e, 0x36, 0x66, 0x7e, 0x35, 0x6e, 0x28, 0x4f, 0xc6, 0x0d, 0xe5, 0xfd, 0x71, 0x43, - 0xf9, 0x60, 0xdc, 0x50, 0xfe, 0x35, 0x6e, 0x28, 0xbf, 0xfb, 0xb0, 0x31, 0xf3, 0xb0, 0x34, 0xbc, - 0xfd, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xc9, 0x16, 0xd9, 0x6e, 0x26, 0x00, 0x00, + 0x61, 0x47, 0x5c, 0x10, 0x12, 0x27, 0x38, 0xf0, 0x9f, 0x20, 0x84, 0xc8, 0x0d, 0x45, 0x88, 0xcb, + 0x5e, 0x90, 0x22, 0x2e, 0xe4, 0x64, 0xb1, 0x93, 0x13, 0x42, 0x1c, 0xb9, 0xe4, 0x02, 0xaa, 0xea, + 0xea, 0xef, 0x6a, 0xcf, 0xd8, 0x9b, 0x38, 0x24, 0xca, 0x6d, 0xba, 0xea, 0xf7, 0x7e, 0xf5, 0x5e, + 0xd5, 0xab, 0x7a, 0xbf, 0xae, 0x1e, 0x70, 0xef, 0xf8, 0xdb, 0x9e, 0xaa, 0xdb, 0xed, 0x63, 0xff, + 0x90, 0xb8, 0x16, 0xa1, 0xc4, 0x6b, 0x0f, 0x89, 0xa5, 0xd9, 0x6e, 0x5b, 0x74, 0x60, 0x47, 0x6f, + 0x63, 0xc7, 0xf1, 0xda, 0xc3, 0xdb, 0xed, 0x01, 0xb1, 0x88, 0x8b, 0x29, 0xd1, 0x54, 0xc7, 0xb5, + 0xa9, 0x0d, 0x61, 0x80, 0x51, 0xb1, 0xa3, 0xab, 0x0c, 0xa3, 0x0e, 0x6f, 0x5f, 0xbd, 0x35, 0xd0, + 0xe9, 0x91, 0x7f, 0xa8, 0xf6, 0x6d, 0xb3, 0x3d, 0xb0, 0x07, 0x76, 0x9b, 0x43, 0x0f, 0xfd, 0x47, + 0xfc, 0x89, 0x3f, 0xf0, 0x5f, 0x01, 0xc5, 0xd5, 0x56, 0x62, 0x98, 0xbe, 0xed, 0x12, 0xc9, 0x30, + 0x57, 0xef, 0xc6, 0x18, 0x13, 0xf7, 0x8f, 0x74, 0x8b, 0xb8, 0xa3, 0xb6, 0x73, 0x3c, 0x60, 0x0d, + 0x5e, 0xdb, 0x24, 0x14, 0xcb, 0xac, 0xda, 0x45, 0x56, 0xae, 0x6f, 0x51, 0xdd, 0x24, 0x39, 0x83, + 0xd7, 0x26, 0x19, 0x78, 0xfd, 0x23, 0x62, 0xe2, 0x9c, 0xdd, 0x2b, 0x45, 0x76, 0x3e, 0xd5, 0x8d, + 0xb6, 0x6e, 0x51, 0x8f, 0xba, 0x59, 0xa3, 0xd6, 0x7f, 0x14, 0x00, 0xbb, 0xb6, 0x45, 0x5d, 0xdb, + 0x30, 0x88, 0x8b, 0xc8, 0x50, 0xf7, 0x74, 0xdb, 0x82, 0x3f, 0x05, 0x35, 0x16, 0x8f, 0x86, 0x29, + 0xae, 0x2b, 0xd7, 0x95, 0x8d, 0x85, 0x3b, 0xdf, 0x52, 0xe3, 0x49, 0x8e, 0xe8, 0x55, 0xe7, 0x78, + 0xc0, 0x1a, 0x3c, 0x95, 0xa1, 0xd5, 0xe1, 0x6d, 0x75, 0xf7, 0xf0, 0x5d, 0xd2, 0xa7, 0x3d, 0x42, + 0x71, 0x07, 0x3e, 0x39, 0x69, 0xce, 0x8c, 0x4f, 0x9a, 0x20, 0x6e, 0x43, 0x11, 0x2b, 0xdc, 0x05, + 0x15, 0xce, 0x5e, 0xe2, 0xec, 0xb7, 0x0a, 0xd9, 0x45, 0xd0, 0x2a, 0xc2, 0x3f, 0x7b, 0xe3, 0x31, + 0x25, 0x16, 0x73, 0xaf, 0x73, 0x49, 0x50, 0x57, 0xb6, 0x30, 0xc5, 0x88, 0x13, 0xc1, 0x97, 0x41, + 0xcd, 0x15, 0xee, 0xd7, 0xcb, 0xd7, 0x95, 0x8d, 0x72, 0xe7, 0xb2, 0x40, 0xd5, 0xc2, 0xb0, 0x50, + 0x84, 0x68, 0xfd, 0x45, 0x01, 0x6b, 0xf9, 0xb8, 0xb7, 0x75, 0x8f, 0xc2, 0x77, 0x72, 0xb1, 0xab, + 0xd3, 0xc5, 0xce, 0xac, 0x79, 0xe4, 0xd1, 0xc0, 0x61, 0x4b, 0x22, 0xee, 0xb7, 0x41, 0x55, 0xa7, + 0xc4, 0xf4, 0xea, 0xa5, 0xeb, 0xe5, 0x8d, 0x85, 0x3b, 0x37, 0xd4, 0x7c, 0xee, 0xaa, 0x79, 0xc7, + 0x3a, 0x8b, 0x82, 0xb2, 0xfa, 0x16, 0x33, 0x46, 0x01, 0x47, 0xeb, 0xbf, 0x0a, 0x98, 0xdf, 0xc2, + 0xc4, 0xb4, 0xad, 0x7d, 0x42, 0x2f, 0x60, 0xd1, 0xba, 0xa0, 0xe2, 0x39, 0xa4, 0x2f, 0x16, 0xed, + 0x6b, 0x32, 0xdf, 0x23, 0x77, 0xf6, 0x1d, 0xd2, 0x8f, 0x17, 0x8a, 0x3d, 0x21, 0x6e, 0x0c, 0xdf, + 0x06, 0xb3, 0x1e, 0xc5, 0xd4, 0xf7, 0xf8, 0x32, 0x2d, 0xdc, 0xf9, 0xfa, 0xe9, 0x34, 0x1c, 0xda, + 0x59, 0x12, 0x44, 0xb3, 0xc1, 0x33, 0x12, 0x14, 0xad, 0x7f, 0x96, 0x00, 0x8c, 0xb0, 0x5d, 0xdb, + 0xd2, 0x74, 0xca, 0xf2, 0xf7, 0x75, 0x50, 0xa1, 0x23, 0x87, 0xf0, 0x69, 0x98, 0xef, 0xdc, 0x08, + 0xbd, 0xb8, 0x3f, 0x72, 0xc8, 0xc7, 0x27, 0xcd, 0xb5, 0xbc, 0x05, 0xeb, 0x41, 0xdc, 0x06, 0x6e, + 0x47, 0xfe, 0x95, 0xb8, 0xf5, 0xdd, 0xf4, 0xd0, 0x1f, 0x9f, 0x34, 0x25, 0x87, 0x85, 0x1a, 0x31, + 0xa5, 0x1d, 0x84, 0x43, 0x00, 0x0d, 0xec, 0xd1, 0xfb, 0x2e, 0xb6, 0xbc, 0x60, 0x24, 0xdd, 0x24, + 0x22, 0xf2, 0x97, 0xa6, 0x5b, 0x1e, 0x66, 0xd1, 0xb9, 0x2a, 0xbc, 0x80, 0xdb, 0x39, 0x36, 0x24, + 0x19, 0x01, 0xde, 0x00, 0xb3, 0x2e, 0xc1, 0x9e, 0x6d, 0xd5, 0x2b, 0x3c, 0x8a, 0x68, 0x02, 0x11, + 0x6f, 0x45, 0xa2, 0x17, 0xbe, 0x08, 0xe6, 0x4c, 0xe2, 0x79, 0x78, 0x40, 0xea, 0x55, 0x0e, 0x5c, + 0x16, 0xc0, 0xb9, 0x5e, 0xd0, 0x8c, 0xc2, 0xfe, 0xd6, 0xef, 0x15, 0xb0, 0x18, 0xcd, 0xdc, 0x05, + 0x6c, 0x95, 0x4e, 0x7a, 0xab, 0x3c, 0x7f, 0x6a, 0x9e, 0x14, 0xec, 0x90, 0xf7, 0xcb, 0x09, 0x9f, + 0x59, 0x12, 0xc2, 0x9f, 0x80, 0x9a, 0x47, 0x0c, 0xd2, 0xa7, 0xb6, 0x2b, 0x7c, 0x7e, 0x65, 0x4a, + 0x9f, 0xf1, 0x21, 0x31, 0xf6, 0x85, 0x69, 0xe7, 0x12, 0x73, 0x3a, 0x7c, 0x42, 0x11, 0x25, 0xfc, + 0x11, 0xa8, 0x51, 0x62, 0x3a, 0x06, 0xa6, 0x44, 0x6c, 0x93, 0x54, 0x7e, 0xb3, 0x74, 0x61, 0x64, + 0x7b, 0xb6, 0x76, 0x5f, 0xc0, 0xf8, 0x46, 0x89, 0xe6, 0x21, 0x6c, 0x45, 0x11, 0x0d, 0x3c, 0x06, + 0x4b, 0xbe, 0xa3, 0x31, 0x24, 0x65, 0x47, 0xf7, 0x60, 0x24, 0xd2, 0xe7, 0xe6, 0xa9, 0x13, 0x72, + 0x90, 0x32, 0xe9, 0xac, 0x89, 0x01, 0x96, 0xd2, 0xed, 0x28, 0x43, 0x0d, 0x37, 0xc1, 0xb2, 0xa9, + 0x5b, 0x88, 0x60, 0x6d, 0xb4, 0x4f, 0xfa, 0xb6, 0xa5, 0x79, 0x3c, 0x81, 0xaa, 0x9d, 0x75, 0x41, + 0xb0, 0xdc, 0x4b, 0x77, 0xa3, 0x2c, 0x1e, 0x6e, 0x83, 0xd5, 0xf0, 0x9c, 0xfd, 0x81, 0xee, 0x51, + 0xdb, 0x1d, 0x6d, 0xeb, 0xa6, 0x4e, 0xeb, 0xb3, 0x9c, 0xa7, 0x3e, 0x3e, 0x69, 0xae, 0x22, 0x49, + 0x3f, 0x92, 0x5a, 0xb5, 0x7e, 0x33, 0x0b, 0x96, 0x33, 0xa7, 0x01, 0x7c, 0x00, 0xd6, 0xfa, 0xbe, + 0xeb, 0x12, 0x8b, 0xee, 0xf8, 0xe6, 0x21, 0x71, 0xf7, 0xfb, 0x47, 0x44, 0xf3, 0x0d, 0xa2, 0xf1, + 0x15, 0xad, 0x76, 0x1a, 0xc2, 0xd7, 0xb5, 0xae, 0x14, 0x85, 0x0a, 0xac, 0xe1, 0x0f, 0x01, 0xb4, + 0x78, 0x53, 0x4f, 0xf7, 0xbc, 0x88, 0xb3, 0xc4, 0x39, 0xa3, 0x0d, 0xb8, 0x93, 0x43, 0x20, 0x89, + 0x15, 0xf3, 0x51, 0x23, 0x9e, 0xee, 0x12, 0x2d, 0xeb, 0x63, 0x39, 0xed, 0xe3, 0x96, 0x14, 0x85, + 0x0a, 0xac, 0xe1, 0xab, 0x60, 0x21, 0x18, 0x8d, 0xcf, 0xb9, 0x58, 0x9c, 0x15, 0x41, 0xb6, 0xb0, + 0x13, 0x77, 0xa1, 0x24, 0x8e, 0x85, 0x66, 0x1f, 0x7a, 0xc4, 0x1d, 0x12, 0xed, 0xcd, 0x40, 0x03, + 0xb0, 0x42, 0x59, 0xe5, 0x85, 0x32, 0x0a, 0x6d, 0x37, 0x87, 0x40, 0x12, 0x2b, 0x16, 0x5a, 0x90, + 0x35, 0xb9, 0xd0, 0x66, 0xd3, 0xa1, 0x1d, 0x48, 0x51, 0xa8, 0xc0, 0x9a, 0xe5, 0x5e, 0xe0, 0xf2, + 0xe6, 0x10, 0xeb, 0x06, 0x3e, 0x34, 0x48, 0x7d, 0x2e, 0x9d, 0x7b, 0x3b, 0xe9, 0x6e, 0x94, 0xc5, + 0xc3, 0x37, 0xc1, 0x95, 0xa0, 0xe9, 0xc0, 0xc2, 0x11, 0x49, 0x8d, 0x93, 0x3c, 0x27, 0x48, 0xae, + 0xec, 0x64, 0x01, 0x28, 0x6f, 0x03, 0x5f, 0x07, 0x4b, 0x7d, 0xdb, 0x30, 0x78, 0x3e, 0x76, 0x6d, + 0xdf, 0xa2, 0xf5, 0x79, 0xce, 0x02, 0xd9, 0x1e, 0xea, 0xa6, 0x7a, 0x50, 0x06, 0x09, 0x1f, 0x02, + 0xd0, 0x0f, 0xcb, 0x81, 0x57, 0x07, 0xc5, 0x85, 0x3e, 0x5f, 0x87, 0xe2, 0x02, 0x1c, 0x35, 0x79, + 0x28, 0xc1, 0xd6, 0x7a, 0x5f, 0x01, 0xeb, 0x05, 0x7b, 0x1c, 0x7e, 0x2f, 0x55, 0xf5, 0x6e, 0x66, + 0xaa, 0xde, 0xb5, 0x02, 0xb3, 0x44, 0xe9, 0xeb, 0x83, 0x45, 0xa6, 0x3b, 0x74, 0x6b, 0x10, 0x40, + 0xc4, 0x09, 0xf6, 0x92, 0xcc, 0x77, 0x94, 0x04, 0xc6, 0xc7, 0xf0, 0x95, 0xf1, 0x49, 0x73, 0x31, + 0xd5, 0x87, 0xd2, 0x9c, 0xad, 0x5f, 0x96, 0x00, 0xd8, 0x22, 0x8e, 0x61, 0x8f, 0x4c, 0x62, 0x5d, + 0x84, 0x6a, 0xd9, 0x4a, 0xa9, 0x96, 0x96, 0x74, 0x21, 0x22, 0x7f, 0x0a, 0x65, 0xcb, 0x76, 0x46, + 0xb6, 0x7c, 0x63, 0x02, 0xcf, 0xe9, 0xba, 0xe5, 0xef, 0x65, 0xb0, 0x12, 0x83, 0x63, 0xe1, 0x72, + 0x2f, 0xb5, 0x84, 0x2f, 0x64, 0x96, 0x70, 0x5d, 0x62, 0xf2, 0xa9, 0x29, 0x97, 0x77, 0xc1, 0x12, + 0xd3, 0x15, 0xc1, 0xaa, 0x71, 0xd5, 0x32, 0x7b, 0x66, 0xd5, 0x12, 0x55, 0x9d, 0xed, 0x14, 0x13, + 0xca, 0x30, 0x17, 0xa8, 0xa4, 0xb9, 0xcf, 0xa3, 0x4a, 0xfa, 0x83, 0x02, 0x96, 0xe2, 0x65, 0xba, + 0x00, 0x99, 0xd4, 0x4d, 0xcb, 0xa4, 0xc6, 0xe9, 0x79, 0x59, 0xa0, 0x93, 0xfe, 0x56, 0x49, 0x7a, + 0xcd, 0x85, 0xd2, 0x06, 0x7b, 0xa1, 0x72, 0x0c, 0xbd, 0x8f, 0x3d, 0x51, 0x56, 0x2f, 0x05, 0x2f, + 0x53, 0x41, 0x1b, 0x8a, 0x7a, 0x53, 0x92, 0xaa, 0xf4, 0xe9, 0x4a, 0xaa, 0xf2, 0x27, 0x23, 0xa9, + 0xee, 0x83, 0x9a, 0x17, 0x8a, 0xa9, 0x0a, 0xa7, 0xbc, 0x31, 0x69, 0x3b, 0x0b, 0x1d, 0x15, 0xb1, + 0x46, 0x0a, 0x2a, 0x62, 0x92, 0x69, 0xa7, 0xea, 0x67, 0xa9, 0x9d, 0x58, 0x7a, 0x3b, 0xd8, 0xf7, + 0x88, 0xc6, 0xb7, 0x52, 0x2d, 0x4e, 0xef, 0x3d, 0xde, 0x8a, 0x44, 0x2f, 0x3c, 0x00, 0xeb, 0x8e, + 0x6b, 0x0f, 0x5c, 0xe2, 0x79, 0x5b, 0x04, 0x6b, 0x86, 0x6e, 0x91, 0x30, 0x80, 0xa0, 0xea, 0x5d, + 0x1b, 0x9f, 0x34, 0xd7, 0xf7, 0xe4, 0x10, 0x54, 0x64, 0xdb, 0xfa, 0x53, 0x05, 0x5c, 0xce, 0x9e, + 0x88, 0x05, 0x42, 0x44, 0x39, 0x97, 0x10, 0x79, 0x39, 0x91, 0xa2, 0x81, 0x4a, 0x4b, 0xbc, 0xf3, + 0xe7, 0xd2, 0x74, 0x13, 0x2c, 0x0b, 0xe1, 0x11, 0x76, 0x0a, 0x29, 0x16, 0x2d, 0xcf, 0x41, 0xba, + 0x1b, 0x65, 0xf1, 0xf0, 0x1e, 0x58, 0x74, 0xb9, 0xb6, 0x0a, 0x09, 0x02, 0x7d, 0xf2, 0x15, 0x41, + 0xb0, 0x88, 0x92, 0x9d, 0x28, 0x8d, 0x65, 0xda, 0x24, 0x96, 0x1c, 0x21, 0x41, 0x25, 0xad, 0x4d, + 0x36, 0xb3, 0x00, 0x94, 0xb7, 0x81, 0x3d, 0xb0, 0xe2, 0x5b, 0x79, 0xaa, 0x20, 0xd7, 0xae, 0x09, + 0xaa, 0x95, 0x83, 0x3c, 0x04, 0xc9, 0xec, 0xe0, 0x8f, 0x53, 0x72, 0x65, 0x96, 0x9f, 0x22, 0x2f, + 0x9c, 0xbe, 0x1d, 0xa6, 0xd6, 0x2b, 0x12, 0x1d, 0x55, 0x9b, 0x56, 0x47, 0xb5, 0xde, 0x53, 0x00, + 0xcc, 0x6f, 0xc1, 0x89, 0x2f, 0xf7, 0x39, 0x8b, 0x44, 0x89, 0xd4, 0xe4, 0x0a, 0xe7, 0xe6, 0x64, + 0x85, 0x13, 0x9f, 0xa0, 0xd3, 0x49, 0x1c, 0x31, 0xbd, 0x17, 0x73, 0x31, 0x33, 0x85, 0xc4, 0x89, + 0xfd, 0x79, 0x36, 0x89, 0x93, 0xe0, 0x39, 0x5d, 0xe2, 0xfc, 0xab, 0x04, 0x56, 0x62, 0xf0, 0xd4, + 0x12, 0x47, 0x62, 0xf2, 0xe5, 0xe5, 0xcc, 0x74, 0xb2, 0x23, 0x9e, 0xba, 0xff, 0x13, 0xd9, 0x11, + 0x3b, 0x54, 0x20, 0x3b, 0x7e, 0x57, 0x4a, 0x7a, 0x7d, 0x46, 0xd9, 0xf1, 0x09, 0x5c, 0x55, 0x7c, + 0xee, 0x94, 0x4b, 0xeb, 0xcf, 0x65, 0x70, 0x39, 0xbb, 0x05, 0x53, 0x75, 0x50, 0x99, 0x58, 0x07, + 0xf7, 0xc0, 0xea, 0x23, 0xdf, 0x30, 0x46, 0x3c, 0x86, 0x44, 0x31, 0x0c, 0x2a, 0xe8, 0x57, 0x85, + 0xe5, 0xea, 0xf7, 0x25, 0x18, 0x24, 0xb5, 0xcc, 0x97, 0xc5, 0xca, 0xb3, 0x96, 0xc5, 0xea, 0x39, + 0xca, 0xa2, 0x5c, 0x59, 0x94, 0xcf, 0xa5, 0x2c, 0xa6, 0xae, 0x89, 0x92, 0xe3, 0x6a, 0xe2, 0x3b, + 0xfc, 0x58, 0x01, 0x6b, 0xf2, 0xd7, 0x67, 0x68, 0x80, 0x25, 0x13, 0x3f, 0x4e, 0x5e, 0x5e, 0x4c, + 0x2a, 0x18, 0x3e, 0xd5, 0x0d, 0x35, 0xf8, 0xba, 0xa3, 0xbe, 0x65, 0xd1, 0x5d, 0x77, 0x9f, 0xba, + 0xba, 0x35, 0x08, 0x0a, 0x6c, 0x2f, 0xc5, 0x85, 0x32, 0xdc, 0xf0, 0x21, 0xa8, 0x99, 0xf8, 0xf1, + 0xbe, 0xef, 0x0e, 0xc2, 0x42, 0x78, 0xf6, 0x71, 0x78, 0xee, 0xf7, 0x04, 0x0b, 0x8a, 0xf8, 0x5a, + 0x1f, 0x29, 0x60, 0xbd, 0xa0, 0x82, 0x7e, 0x81, 0xa2, 0xdc, 0x05, 0xd7, 0x53, 0x41, 0xb2, 0x0d, + 0x49, 0x1e, 0xf9, 0x06, 0xdf, 0x9b, 0x42, 0xaf, 0xdc, 0x04, 0xf3, 0x0e, 0x76, 0xa9, 0x1e, 0x09, + 0xdd, 0x6a, 0x67, 0x71, 0x7c, 0xd2, 0x9c, 0xdf, 0x0b, 0x1b, 0x51, 0xdc, 0xdf, 0xfa, 0x55, 0x09, + 0x2c, 0x24, 0x48, 0x2e, 0x40, 0x3b, 0xbc, 0x91, 0xd2, 0x0e, 0xd2, 0xaf, 0x31, 0xc9, 0xa8, 0x8a, + 0xc4, 0x43, 0x2f, 0x23, 0x1e, 0xbe, 0x39, 0x89, 0xe8, 0x74, 0xf5, 0xf0, 0xef, 0x12, 0x58, 0x4d, + 0xa0, 0x63, 0xf9, 0xf0, 0x9d, 0x94, 0x7c, 0xd8, 0xc8, 0xc8, 0x87, 0xba, 0xcc, 0xe6, 0x4b, 0xfd, + 0x30, 0x59, 0x3f, 0xfc, 0x51, 0x01, 0xcb, 0x89, 0xb9, 0xbb, 0x00, 0x01, 0xb1, 0x95, 0x16, 0x10, + 0xcd, 0x09, 0xf9, 0x52, 0xa0, 0x20, 0x7e, 0x3d, 0x9b, 0xf2, 0xfb, 0x0b, 0x7f, 0x73, 0xf1, 0x73, + 0xb0, 0x3a, 0xb4, 0x0d, 0xdf, 0x24, 0x5d, 0x03, 0xeb, 0x66, 0x08, 0x60, 0x15, 0x97, 0x4d, 0xe2, + 0x8b, 0x52, 0x7a, 0xe2, 0x7a, 0xba, 0x47, 0x89, 0x45, 0x1f, 0xc4, 0x96, 0x71, 0x9d, 0x7f, 0x20, + 0xa1, 0x43, 0xd2, 0x41, 0xe0, 0xab, 0x60, 0x81, 0x55, 0x4a, 0xbd, 0x4f, 0x76, 0xb0, 0x19, 0xe6, + 0x54, 0xf4, 0xed, 0x61, 0x3f, 0xee, 0x42, 0x49, 0x1c, 0x3c, 0x02, 0x2b, 0x8e, 0xad, 0xf5, 0xb0, + 0x85, 0x07, 0x84, 0x9d, 0xff, 0x7b, 0xb6, 0xa1, 0xf7, 0x47, 0xfc, 0x4e, 0x63, 0xbe, 0xf3, 0x5a, + 0xf8, 0xbe, 0xba, 0x97, 0x87, 0xb0, 0xf7, 0x01, 0x49, 0x33, 0xdf, 0xcf, 0x32, 0x4a, 0x68, 0xe6, + 0x3e, 0x95, 0xcd, 0xe5, 0xfe, 0x5f, 0x20, 0x4b, 0xae, 0x73, 0x7e, 0x2c, 0x2b, 0xba, 0xad, 0xa9, + 0x9d, 0xeb, 0xb6, 0x46, 0xa2, 0x67, 0xe7, 0xcf, 0xa6, 0x67, 0x5b, 0xef, 0x55, 0xc1, 0x95, 0xdc, + 0x19, 0xfb, 0x19, 0x5e, 0xb9, 0xe4, 0x84, 0x61, 0xf9, 0x0c, 0xc2, 0x70, 0x13, 0x2c, 0x8b, 0xef, + 0x74, 0x19, 0x5d, 0x19, 0xcd, 0x47, 0x37, 0xdd, 0x8d, 0xb2, 0x78, 0xd9, 0x95, 0x4f, 0xf5, 0x8c, + 0x57, 0x3e, 0x49, 0x2f, 0xc4, 0xdf, 0x4b, 0x82, 0xc4, 0xcd, 0x7b, 0x21, 0xfe, 0x65, 0x92, 0xc5, + 0xc3, 0xef, 0x86, 0x59, 0x19, 0x31, 0xcc, 0x71, 0x86, 0x4c, 0x9a, 0x45, 0x04, 0x19, 0xf4, 0x33, + 0x7d, 0x8b, 0x7a, 0x47, 0xf2, 0x2d, 0x6a, 0x63, 0xc2, 0x6e, 0x98, 0xfe, 0x76, 0x47, 0xaa, 0xdd, + 0x17, 0xce, 0xae, 0xdd, 0x5b, 0x7f, 0x55, 0xc0, 0x73, 0x85, 0xfb, 0x11, 0x6e, 0xa6, 0x6a, 0xfe, + 0xad, 0x4c, 0xcd, 0x7f, 0xbe, 0xd0, 0x30, 0x51, 0xf8, 0x4d, 0xf9, 0xc5, 0xcf, 0xdd, 0x89, 0x17, + 0x3f, 0x12, 0x45, 0x37, 0xf9, 0x06, 0xa8, 0xb3, 0xf1, 0xe4, 0x69, 0x63, 0xe6, 0x83, 0xa7, 0x8d, + 0x99, 0x0f, 0x9f, 0x36, 0x66, 0x7e, 0x31, 0x6e, 0x28, 0x4f, 0xc6, 0x0d, 0xe5, 0x83, 0x71, 0x43, + 0xf9, 0x70, 0xdc, 0x50, 0xfe, 0x31, 0x6e, 0x28, 0xbf, 0xfd, 0xa8, 0x31, 0xf3, 0xb0, 0x34, 0xbc, + 0xfd, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x69, 0x8a, 0x39, 0xfa, 0x26, 0x00, 0x00, } func (m *ControllerRevision) Marshal() (dAtA []byte, err error) { @@ -2310,6 +2311,9 @@ func (m *StatefulSetSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.MinReadySeconds)) + i-- + dAtA[i] = 0x48 if m.RevisionHistoryLimit != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.RevisionHistoryLimit)) i-- @@ -2399,6 +2403,9 @@ func (m *StatefulSetStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.AvailableReplicas)) + i-- + dAtA[i] = 0x58 if len(m.Conditions) > 0 { for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { { @@ -2978,6 +2985,7 @@ func (m *StatefulSetSpec) Size() (n int) { if m.RevisionHistoryLimit != nil { n += 1 + sovGenerated(uint64(*m.RevisionHistoryLimit)) } + n += 1 + sovGenerated(uint64(m.MinReadySeconds)) return n } @@ -3005,6 +3013,7 @@ func (m *StatefulSetStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + n += 1 + sovGenerated(uint64(m.AvailableReplicas)) return n } @@ -3408,6 +3417,7 @@ func (this *StatefulSetSpec) String() string { `PodManagementPolicy:` + fmt.Sprintf("%v", this.PodManagementPolicy) + `,`, `UpdateStrategy:` + strings.Replace(strings.Replace(this.UpdateStrategy.String(), "StatefulSetUpdateStrategy", "StatefulSetUpdateStrategy", 1), `&`, ``, 1) + `,`, `RevisionHistoryLimit:` + valueToStringGenerated(this.RevisionHistoryLimit) + `,`, + `MinReadySeconds:` + fmt.Sprintf("%v", this.MinReadySeconds) + `,`, `}`, }, "") return s @@ -3431,6 +3441,7 @@ func (this *StatefulSetStatus) String() string { `UpdateRevision:` + fmt.Sprintf("%v", this.UpdateRevision) + `,`, `CollisionCount:` + valueToStringGenerated(this.CollisionCount) + `,`, `Conditions:` + repeatedStringForConditions + `,`, + `AvailableReplicas:` + fmt.Sprintf("%v", this.AvailableReplicas) + `,`, `}`, }, "") return s @@ -7719,6 +7730,25 @@ func (m *StatefulSetSpec) Unmarshal(dAtA []byte) error { } } m.RevisionHistoryLimit = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinReadySeconds", wireType) + } + m.MinReadySeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinReadySeconds |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -7982,6 +8012,25 @@ func (m *StatefulSetStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AvailableReplicas", wireType) + } + m.AvailableReplicas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AvailableReplicas |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/generated.proto index d4689d88b51b..038d7ad7f49d 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/generated.proto @@ -219,7 +219,8 @@ message DaemonSetUpdateStrategy { // Deployment enables declarative updates for Pods and ReplicaSets. message Deployment { - // Standard object metadata. + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -366,7 +367,8 @@ message DeploymentStrategy { message ReplicaSet { // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. - // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -511,7 +513,7 @@ message RollingUpdateDaemonSet { // daemonset on any given node can double if the readiness check fails, and // so resource intensive daemonsets should take into account that they may // cause evictions during disruption. - // This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate. + // This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate. // +optional optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2; } @@ -562,6 +564,8 @@ message RollingUpdateStatefulSetStrategy { // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. message StatefulSet { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -598,9 +602,12 @@ message StatefulSetCondition { // StatefulSetList is a collection of StatefulSets. message StatefulSetList { + // Standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + // Items is the list of stateful sets. repeated StatefulSet items = 2; } @@ -663,6 +670,13 @@ message StatefulSetSpec { // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. optional int32 revisionHistoryLimit = 8; + + // Minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // +optional + optional int32 minReadySeconds = 9; } // StatefulSetStatus represents the current state of a StatefulSet. @@ -705,6 +719,12 @@ message StatefulSetStatus { // +patchMergeKey=type // +patchStrategy=merge repeated StatefulSetCondition conditions = 10; + + // Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset. + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // Remove omitempty when graduating to beta + // +optional + optional int32 availableReplicas = 11; } // StatefulSetUpdateStrategy indicates the strategy that the StatefulSet diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types.go index e2c8961aa55e..68e8bb271e79 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types.go @@ -45,6 +45,8 @@ const ( // map to the same storage identity. type StatefulSet struct { metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -173,6 +175,13 @@ type StatefulSetSpec struct { // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,8,opt,name=revisionHistoryLimit"` + + // Minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // +optional + MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,9,opt,name=minReadySeconds"` } // StatefulSetStatus represents the current state of a StatefulSet. @@ -215,6 +224,12 @@ type StatefulSetStatus struct { // +patchMergeKey=type // +patchStrategy=merge Conditions []StatefulSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,10,rep,name=conditions"` + + // Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset. + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // Remove omitempty when graduating to beta + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,11,opt,name=availableReplicas"` } type StatefulSetConditionType string @@ -241,9 +256,13 @@ type StatefulSetCondition struct { // StatefulSetList is a collection of StatefulSets. type StatefulSetList struct { metav1.TypeMeta `json:",inline"` + // Standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Items []StatefulSet `json:"items" protobuf:"bytes,2,rep,name=items"` + + // Items is the list of stateful sets. + Items []StatefulSet `json:"items" protobuf:"bytes,2,rep,name=items"` } // +genclient @@ -255,7 +274,8 @@ type StatefulSetList struct { // Deployment enables declarative updates for Pods and ReplicaSets. type Deployment struct { metav1.TypeMeta `json:",inline"` - // Standard object metadata. + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -522,7 +542,7 @@ type RollingUpdateDaemonSet struct { // daemonset on any given node can double if the readiness check fails, and // so resource intensive daemonsets should take into account that they may // cause evictions during disruption. - // This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate. + // This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate. // +optional MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"` } @@ -693,7 +713,8 @@ type ReplicaSet struct { // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. - // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go index b9783ad20ed1..03738eb8b823 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go @@ -125,7 +125,7 @@ func (DaemonSetUpdateStrategy) SwaggerDoc() map[string]string { var map_Deployment = map[string]string{ "": "Deployment enables declarative updates for Pods and ReplicaSets.", - "metadata": "Standard object metadata.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "Specification of the desired behavior of the Deployment.", "status": "Most recently observed status of the Deployment.", } @@ -263,7 +263,7 @@ func (ReplicaSetStatus) SwaggerDoc() map[string]string { var map_RollingUpdateDaemonSet = map[string]string{ "": "Spec to control the desired behavior of daemon set rolling update.", "maxUnavailable": "The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding down to a minimum of one. This cannot be 0 if MaxSurge is 0 Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update.", - "maxSurge": "The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption. This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate.", + "maxSurge": "The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption. This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate.", } func (RollingUpdateDaemonSet) SwaggerDoc() map[string]string { @@ -290,9 +290,10 @@ func (RollingUpdateStatefulSetStrategy) SwaggerDoc() map[string]string { } var map_StatefulSet = map[string]string{ - "": "StatefulSet represents a set of pods with consistent identities. Identities are defined as:\n - Network: A single stable DNS and hostname.\n - Storage: As many VolumeClaims as requested.\nThe StatefulSet guarantees that a given network identity will always map to the same storage identity.", - "spec": "Spec defines the desired identities of pods in this set.", - "status": "Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time.", + "": "StatefulSet represents a set of pods with consistent identities. Identities are defined as:\n - Network: A single stable DNS and hostname.\n - Storage: As many VolumeClaims as requested.\nThe StatefulSet guarantees that a given network identity will always map to the same storage identity.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec defines the desired identities of pods in this set.", + "status": "Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time.", } func (StatefulSet) SwaggerDoc() map[string]string { @@ -313,7 +314,9 @@ func (StatefulSetCondition) SwaggerDoc() map[string]string { } var map_StatefulSetList = map[string]string{ - "": "StatefulSetList is a collection of StatefulSets.", + "": "StatefulSetList is a collection of StatefulSets.", + "metadata": "Standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "Items is the list of stateful sets.", } func (StatefulSetList) SwaggerDoc() map[string]string { @@ -330,6 +333,7 @@ var map_StatefulSetSpec = map[string]string{ "podManagementPolicy": "podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.", "updateStrategy": "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.", "revisionHistoryLimit": "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.", + "minReadySeconds": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate.", } func (StatefulSetSpec) SwaggerDoc() map[string]string { @@ -347,6 +351,7 @@ var map_StatefulSetStatus = map[string]string{ "updateRevision": "updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)", "collisionCount": "collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision.", "conditions": "Represents the latest available observations of a statefulset's current state.", + "availableReplicas": "Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset. This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. Remove omitempty when graduating to beta", } func (StatefulSetStatus) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/generated.pb.go index 6bc56e382aa3..79e39e582f10 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/generated.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/generated.pb.go @@ -668,123 +668,124 @@ func init() { } var fileDescriptor_2a07313e8f66e805 = []byte{ - // 1855 bytes of a gzipped FileDescriptorProto + // 1869 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcd, 0x6f, 0x24, 0x47, - 0x15, 0x77, 0x8f, 0x67, 0xec, 0xf1, 0x73, 0x3c, 0xde, 0x2d, 0x9b, 0xf5, 0xc4, 0x81, 0xb1, 0x35, + 0x15, 0x77, 0x8f, 0x3d, 0xf6, 0xcc, 0x73, 0x3c, 0xde, 0x2d, 0x9b, 0xf5, 0xc4, 0x81, 0xb1, 0x35, 0x44, 0x89, 0xf3, 0xe1, 0x9e, 0xac, 0x13, 0xa2, 0x64, 0x17, 0x45, 0x78, 0xbc, 0x4b, 0xb2, 0x91, 0x8d, 0x9d, 0xb2, 0x1d, 0x44, 0x00, 0x29, 0x35, 0x3d, 0xb5, 0xb3, 0x1d, 0xf7, 0x97, 0xba, 0xab, - 0x87, 0x1d, 0x71, 0xe1, 0x0f, 0x40, 0x0a, 0x67, 0xfe, 0x0a, 0x8e, 0x08, 0x6e, 0x9c, 0xf6, 0x82, - 0x14, 0x71, 0x21, 0x27, 0x8b, 0x9d, 0x5c, 0x81, 0x1b, 0x97, 0x95, 0x90, 0x50, 0x55, 0x57, 0x7f, - 0x77, 0xdb, 0x6d, 0xa4, 0xb5, 0x04, 0xb7, 0xe9, 0x7a, 0xef, 0xfd, 0x5e, 0x7d, 0xbc, 0xaf, 0xdf, - 0xc0, 0x0f, 0xce, 0xde, 0xf3, 0x54, 0xdd, 0xee, 0x9d, 0xf9, 0x03, 0xea, 0x5a, 0x94, 0x51, 0xaf, - 0x37, 0xa6, 0xd6, 0xd0, 0x76, 0x7b, 0x52, 0x40, 0x1c, 0xbd, 0x47, 0x1c, 0xc7, 0xeb, 0x8d, 0x6f, - 0x0f, 0x28, 0x23, 0xb7, 0x7b, 0x23, 0x6a, 0x51, 0x97, 0x30, 0x3a, 0x54, 0x1d, 0xd7, 0x66, 0x36, - 0x5a, 0x0b, 0x14, 0x55, 0xe2, 0xe8, 0x2a, 0x57, 0x54, 0xa5, 0xe2, 0xfa, 0xf6, 0x48, 0x67, 0x8f, - 0xfc, 0x81, 0xaa, 0xd9, 0x66, 0x6f, 0x64, 0x8f, 0xec, 0x9e, 0xd0, 0x1f, 0xf8, 0x0f, 0xc5, 0x97, - 0xf8, 0x10, 0xbf, 0x02, 0x9c, 0xf5, 0x6e, 0xc2, 0xa1, 0x66, 0xbb, 0xb4, 0x37, 0xce, 0xf9, 0x5a, - 0x7f, 0x27, 0xd6, 0x31, 0x89, 0xf6, 0x48, 0xb7, 0xa8, 0x3b, 0xe9, 0x39, 0x67, 0x23, 0xbe, 0xe0, - 0xf5, 0x4c, 0xca, 0x48, 0x91, 0x55, 0xaf, 0xcc, 0xca, 0xf5, 0x2d, 0xa6, 0x9b, 0x34, 0x67, 0xf0, - 0xee, 0x65, 0x06, 0x9e, 0xf6, 0x88, 0x9a, 0x24, 0x67, 0xf7, 0x76, 0x99, 0x9d, 0xcf, 0x74, 0xa3, - 0xa7, 0x5b, 0xcc, 0x63, 0x6e, 0xd6, 0xa8, 0xfb, 0x2f, 0x05, 0xd0, 0x9e, 0x6d, 0x31, 0xd7, 0x36, - 0x0c, 0xea, 0x62, 0x3a, 0xd6, 0x3d, 0xdd, 0xb6, 0xd0, 0xe7, 0xd0, 0xe4, 0xe7, 0x19, 0x12, 0x46, - 0xda, 0xca, 0xa6, 0xb2, 0xb5, 0xb8, 0xf3, 0x96, 0x1a, 0xdf, 0x74, 0x04, 0xaf, 0x3a, 0x67, 0x23, - 0xbe, 0xe0, 0xa9, 0x5c, 0x5b, 0x1d, 0xdf, 0x56, 0x0f, 0x07, 0x5f, 0x50, 0x8d, 0x1d, 0x50, 0x46, - 0xfa, 0xe8, 0xc9, 0xf9, 0xc6, 0xcc, 0xf4, 0x7c, 0x03, 0xe2, 0x35, 0x1c, 0xa1, 0xa2, 0x43, 0xa8, - 0x0b, 0xf4, 0x9a, 0x40, 0xdf, 0x2e, 0x45, 0x97, 0x87, 0x56, 0x31, 0xf9, 0xc5, 0xfd, 0xc7, 0x8c, - 0x5a, 0x7c, 0x7b, 0xfd, 0x17, 0x24, 0x74, 0xfd, 0x1e, 0x61, 0x04, 0x0b, 0x20, 0xf4, 0x26, 0x34, - 0x5d, 0xb9, 0xfd, 0xf6, 0xec, 0xa6, 0xb2, 0x35, 0xdb, 0xbf, 0x21, 0xb5, 0x9a, 0xe1, 0xb1, 0x70, - 0xa4, 0xd1, 0x7d, 0xa2, 0xc0, 0xad, 0xfc, 0xb9, 0xf7, 0x75, 0x8f, 0xa1, 0x9f, 0xe5, 0xce, 0xae, - 0x56, 0x3b, 0x3b, 0xb7, 0x16, 0x27, 0x8f, 0x1c, 0x87, 0x2b, 0x89, 0x73, 0x1f, 0x41, 0x43, 0x67, - 0xd4, 0xf4, 0xda, 0xb5, 0xcd, 0xd9, 0xad, 0xc5, 0x9d, 0x37, 0xd4, 0x92, 0x00, 0x56, 0xf3, 0xbb, - 0xeb, 0x2f, 0x49, 0xdc, 0xc6, 0x03, 0x8e, 0x80, 0x03, 0xa0, 0xee, 0xaf, 0x6b, 0x00, 0xf7, 0xa8, - 0x63, 0xd8, 0x13, 0x93, 0x5a, 0xec, 0x1a, 0x9e, 0xee, 0x01, 0xd4, 0x3d, 0x87, 0x6a, 0xf2, 0xe9, - 0x5e, 0x2d, 0x3d, 0x41, 0xbc, 0xa9, 0x63, 0x87, 0x6a, 0xf1, 0xa3, 0xf1, 0x2f, 0x2c, 0x20, 0xd0, - 0x27, 0x30, 0xe7, 0x31, 0xc2, 0x7c, 0x4f, 0x3c, 0xd9, 0xe2, 0xce, 0x6b, 0x55, 0xc0, 0x84, 0x41, - 0xbf, 0x25, 0xe1, 0xe6, 0x82, 0x6f, 0x2c, 0x81, 0xba, 0x7f, 0x9d, 0x85, 0x95, 0x58, 0x79, 0xcf, - 0xb6, 0x86, 0x3a, 0xe3, 0x21, 0x7d, 0x17, 0xea, 0x6c, 0xe2, 0x50, 0x71, 0x27, 0x0b, 0xfd, 0x57, - 0xc3, 0xcd, 0x9c, 0x4c, 0x1c, 0xfa, 0xec, 0x7c, 0x63, 0xad, 0xc0, 0x84, 0x8b, 0xb0, 0x30, 0x42, - 0xfb, 0xd1, 0x3e, 0x6b, 0xc2, 0xfc, 0x9d, 0xb4, 0xf3, 0x67, 0xe7, 0x1b, 0x05, 0x05, 0x44, 0x8d, - 0x90, 0xd2, 0x5b, 0x44, 0x5f, 0x40, 0xcb, 0x20, 0x1e, 0x3b, 0x75, 0x86, 0x84, 0xd1, 0x13, 0xdd, - 0xa4, 0xed, 0x39, 0x71, 0xfa, 0xd7, 0xab, 0x3d, 0x14, 0xb7, 0xe8, 0xdf, 0x92, 0x3b, 0x68, 0xed, - 0xa7, 0x90, 0x70, 0x06, 0x19, 0x8d, 0x01, 0xf1, 0x95, 0x13, 0x97, 0x58, 0x5e, 0x70, 0x2a, 0xee, - 0x6f, 0xfe, 0xca, 0xfe, 0xd6, 0xa5, 0x3f, 0xb4, 0x9f, 0x43, 0xc3, 0x05, 0x1e, 0xd0, 0x2b, 0x30, - 0xe7, 0x52, 0xe2, 0xd9, 0x56, 0xbb, 0x2e, 0x6e, 0x2c, 0x7a, 0x2e, 0x2c, 0x56, 0xb1, 0x94, 0xa2, - 0xd7, 0x60, 0xde, 0xa4, 0x9e, 0x47, 0x46, 0xb4, 0xdd, 0x10, 0x8a, 0xcb, 0x52, 0x71, 0xfe, 0x20, - 0x58, 0xc6, 0xa1, 0xbc, 0xfb, 0x7b, 0x05, 0x5a, 0xf1, 0x33, 0x5d, 0x43, 0xae, 0x7e, 0x94, 0xce, - 0xd5, 0xef, 0x56, 0x08, 0xce, 0x92, 0x1c, 0xfd, 0x7b, 0x0d, 0x50, 0xac, 0x84, 0x6d, 0xc3, 0x18, - 0x10, 0xed, 0x0c, 0x6d, 0x42, 0xdd, 0x22, 0x66, 0x18, 0x93, 0x51, 0x82, 0xfc, 0x88, 0x98, 0x14, - 0x0b, 0x09, 0xfa, 0x52, 0x01, 0xe4, 0x8b, 0xd7, 0x1c, 0xee, 0x5a, 0x96, 0xcd, 0x08, 0xbf, 0xe0, - 0x70, 0x43, 0x7b, 0x15, 0x36, 0x14, 0xfa, 0x52, 0x4f, 0x73, 0x28, 0xf7, 0x2d, 0xe6, 0x4e, 0xe2, - 0x87, 0xcd, 0x2b, 0xe0, 0x02, 0xd7, 0xe8, 0xa7, 0x00, 0xae, 0xc4, 0x3c, 0xb1, 0x65, 0xda, 0x96, - 0xd7, 0x80, 0xd0, 0xfd, 0x9e, 0x6d, 0x3d, 0xd4, 0x47, 0x71, 0x61, 0xc1, 0x11, 0x04, 0x4e, 0xc0, - 0xad, 0xdf, 0x87, 0xb5, 0x92, 0x7d, 0xa2, 0x1b, 0x30, 0x7b, 0x46, 0x27, 0xc1, 0x55, 0x61, 0xfe, - 0x13, 0xad, 0x42, 0x63, 0x4c, 0x0c, 0x9f, 0x06, 0x39, 0x89, 0x83, 0x8f, 0x3b, 0xb5, 0xf7, 0x94, - 0xee, 0xef, 0x1a, 0xc9, 0x48, 0xe1, 0xf5, 0x06, 0x6d, 0xf1, 0xf6, 0xe0, 0x18, 0xba, 0x46, 0x3c, - 0x81, 0xd1, 0xe8, 0xbf, 0x10, 0xb4, 0x86, 0x60, 0x0d, 0x47, 0x52, 0xf4, 0x73, 0x68, 0x7a, 0xd4, - 0xa0, 0x1a, 0xb3, 0x5d, 0x59, 0xe2, 0xde, 0xae, 0x18, 0x53, 0x64, 0x40, 0x8d, 0x63, 0x69, 0x1a, - 0xc0, 0x87, 0x5f, 0x38, 0x82, 0x44, 0x9f, 0x40, 0x93, 0x51, 0xd3, 0x31, 0x08, 0xa3, 0xf2, 0xf6, - 0x52, 0x71, 0xc5, 0x6b, 0x07, 0x07, 0x3b, 0xb2, 0x87, 0x27, 0x52, 0x4d, 0x54, 0xcf, 0x28, 0x4e, - 0xc3, 0x55, 0x1c, 0xc1, 0xa0, 0x9f, 0x40, 0xd3, 0x63, 0xbc, 0xab, 0x8f, 0x26, 0x22, 0xdb, 0x2e, - 0x6a, 0x2b, 0xc9, 0x3a, 0x1a, 0x98, 0xc4, 0xd0, 0xe1, 0x0a, 0x8e, 0xe0, 0xd0, 0x2e, 0x2c, 0x9b, - 0xba, 0x85, 0x29, 0x19, 0x4e, 0x8e, 0xa9, 0x66, 0x5b, 0x43, 0x4f, 0xa4, 0x69, 0xa3, 0xbf, 0x26, - 0x8d, 0x96, 0x0f, 0xd2, 0x62, 0x9c, 0xd5, 0x47, 0xfb, 0xb0, 0x1a, 0xb6, 0xdd, 0x8f, 0x74, 0x8f, - 0xd9, 0xee, 0x64, 0x5f, 0x37, 0x75, 0x26, 0x6a, 0x5e, 0xa3, 0xdf, 0x9e, 0x9e, 0x6f, 0xac, 0xe2, - 0x02, 0x39, 0x2e, 0xb4, 0xe2, 0x75, 0xc5, 0x21, 0xbe, 0x47, 0x87, 0xa2, 0x86, 0x35, 0xe3, 0xba, - 0x72, 0x24, 0x56, 0xb1, 0x94, 0xa2, 0x1f, 0xa7, 0xc2, 0xb4, 0x79, 0xb5, 0x30, 0x6d, 0x95, 0x87, - 0x28, 0x3a, 0x85, 0x35, 0xc7, 0xb5, 0x47, 0x2e, 0xf5, 0xbc, 0x7b, 0x94, 0x0c, 0x0d, 0xdd, 0xa2, - 0xe1, 0xcd, 0x2c, 0x88, 0x13, 0xbd, 0x34, 0x3d, 0xdf, 0x58, 0x3b, 0x2a, 0x56, 0xc1, 0x65, 0xb6, - 0xdd, 0x3f, 0xd5, 0xe1, 0x46, 0xb6, 0xc7, 0xa1, 0x8f, 0x01, 0xd9, 0x03, 0x8f, 0xba, 0x63, 0x3a, - 0xfc, 0x30, 0x18, 0xdc, 0xf8, 0x74, 0xa3, 0x88, 0xe9, 0x26, 0xca, 0xdb, 0xc3, 0x9c, 0x06, 0x2e, - 0xb0, 0x0a, 0xe6, 0x23, 0x99, 0x00, 0x35, 0xb1, 0xd1, 0xc4, 0x7c, 0x94, 0x4b, 0x82, 0x5d, 0x58, - 0x96, 0xb9, 0x1f, 0x0a, 0x45, 0xb0, 0x26, 0xde, 0xfd, 0x34, 0x2d, 0xc6, 0x59, 0x7d, 0x74, 0x17, - 0x96, 0x5c, 0x1e, 0x07, 0x11, 0xc0, 0xbc, 0x00, 0xf8, 0x96, 0x04, 0x58, 0xc2, 0x49, 0x21, 0x4e, - 0xeb, 0xa2, 0x0f, 0xe1, 0x26, 0x19, 0x13, 0xdd, 0x20, 0x03, 0x83, 0x46, 0x00, 0x75, 0x01, 0xf0, - 0xa2, 0x04, 0xb8, 0xb9, 0x9b, 0x55, 0xc0, 0x79, 0x1b, 0x74, 0x00, 0x2b, 0xbe, 0x95, 0x87, 0x0a, - 0x82, 0xf8, 0x25, 0x09, 0xb5, 0x72, 0x9a, 0x57, 0xc1, 0x45, 0x76, 0xe8, 0x73, 0x00, 0x2d, 0xec, - 0xea, 0x5e, 0x7b, 0x4e, 0x94, 0xe1, 0x37, 0x2b, 0x24, 0x5b, 0x34, 0x0a, 0xc4, 0x25, 0x30, 0x5a, - 0xf2, 0x70, 0x02, 0x13, 0xdd, 0x81, 0x96, 0x66, 0x1b, 0x86, 0x88, 0xfc, 0x3d, 0xdb, 0xb7, 0x98, - 0x08, 0xde, 0x46, 0x1f, 0xf1, 0x66, 0xbf, 0x97, 0x92, 0xe0, 0x8c, 0x66, 0xf7, 0x8f, 0x4a, 0xb2, - 0xcd, 0x84, 0xe9, 0x8c, 0xee, 0xa4, 0x46, 0x9f, 0x57, 0x32, 0xa3, 0xcf, 0xad, 0xbc, 0x45, 0x62, - 0xf2, 0xd1, 0x61, 0x89, 0x07, 0xbf, 0x6e, 0x8d, 0x82, 0x07, 0x97, 0x25, 0xf1, 0xad, 0x0b, 0x53, - 0x29, 0xd2, 0x4e, 0x34, 0xc6, 0x9b, 0xe2, 0xcd, 0x93, 0x42, 0x9c, 0x46, 0xee, 0x7e, 0x00, 0xad, - 0x74, 0x1e, 0xa6, 0x66, 0x7a, 0xe5, 0xd2, 0x99, 0xfe, 0x1b, 0x05, 0xd6, 0x4a, 0xbc, 0x23, 0x03, - 0x5a, 0x26, 0x79, 0x9c, 0x78, 0xe6, 0x4b, 0x67, 0x63, 0xce, 0x9a, 0xd4, 0x80, 0x35, 0xa9, 0x0f, - 0x2c, 0x76, 0xe8, 0x1e, 0x33, 0x57, 0xb7, 0x46, 0xc1, 0x3b, 0x1c, 0xa4, 0xb0, 0x70, 0x06, 0x1b, - 0x7d, 0x06, 0x4d, 0x93, 0x3c, 0x3e, 0xf6, 0xdd, 0x51, 0xd1, 0x7d, 0x55, 0xf3, 0x23, 0xfa, 0xc7, - 0x81, 0x44, 0xc1, 0x11, 0x5e, 0xf7, 0x10, 0x36, 0x53, 0x87, 0xe4, 0xa5, 0x82, 0x3e, 0xf4, 0x8d, - 0x63, 0x1a, 0x3f, 0xf8, 0x1b, 0xb0, 0xe0, 0x10, 0x97, 0xe9, 0x51, 0xb9, 0x68, 0xf4, 0x97, 0xa6, - 0xe7, 0x1b, 0x0b, 0x47, 0xe1, 0x22, 0x8e, 0xe5, 0xdd, 0x7f, 0x2b, 0xd0, 0x38, 0xd6, 0x88, 0x41, - 0xaf, 0x81, 0x3a, 0xdc, 0x4b, 0x51, 0x87, 0x6e, 0x69, 0x10, 0x89, 0xfd, 0x94, 0xb2, 0x86, 0xfd, - 0x0c, 0x6b, 0x78, 0xf9, 0x12, 0x9c, 0x8b, 0x09, 0xc3, 0xfb, 0xb0, 0x10, 0xb9, 0x4b, 0x55, 0x49, - 0xe5, 0xb2, 0x2a, 0xd9, 0xfd, 0x6d, 0x0d, 0x16, 0x13, 0x2e, 0xae, 0x66, 0xcd, 0xaf, 0x3b, 0x31, - 0x68, 0xf0, 0x4a, 0xb2, 0x53, 0xe5, 0x20, 0x6a, 0x38, 0x54, 0x04, 0xf3, 0x5b, 0xdc, 0xbd, 0xf3, - 0xb3, 0xc6, 0x07, 0xd0, 0x62, 0xc4, 0x1d, 0x51, 0x16, 0xca, 0xc4, 0x85, 0x2d, 0xc4, 0xe4, 0xe1, - 0x24, 0x25, 0xc5, 0x19, 0xed, 0xf5, 0xbb, 0xb0, 0x94, 0x72, 0x76, 0xa5, 0x21, 0xec, 0x4b, 0x7e, - 0x39, 0x71, 0x70, 0x5e, 0x43, 0x74, 0x7d, 0x9c, 0x8a, 0xae, 0xad, 0xf2, 0xcb, 0x4c, 0xa4, 0x4c, - 0x59, 0x8c, 0xe1, 0x4c, 0x8c, 0xbd, 0x5e, 0x09, 0xed, 0xe2, 0x48, 0xfb, 0x47, 0x0d, 0x56, 0x13, - 0xda, 0x31, 0x37, 0xfd, 0x7e, 0xaa, 0x40, 0x6f, 0x65, 0x0a, 0x74, 0xbb, 0xc8, 0xe6, 0xb9, 0x91, - 0xd3, 0x62, 0xc2, 0x38, 0xfb, 0xbf, 0x48, 0x18, 0xff, 0xa0, 0xc0, 0x72, 0xe2, 0xee, 0xae, 0x81, - 0x31, 0x3e, 0x48, 0x33, 0xc6, 0x97, 0xab, 0x04, 0x4d, 0x09, 0x65, 0xfc, 0x73, 0x23, 0xb5, 0xf9, - 0xff, 0x7b, 0x12, 0xf3, 0x4b, 0x58, 0x1d, 0xdb, 0x86, 0x6f, 0xd2, 0x3d, 0x83, 0xe8, 0x66, 0xa8, - 0xc0, 0x87, 0xbe, 0xd9, 0xec, 0x1f, 0x43, 0x11, 0x3c, 0x75, 0x3d, 0xdd, 0x63, 0xd4, 0x62, 0x9f, - 0xc6, 0x96, 0xfd, 0x6f, 0x4b, 0x27, 0xab, 0x9f, 0x16, 0xc0, 0xe1, 0x42, 0x27, 0xe8, 0x7b, 0xb0, - 0xc8, 0x07, 0x66, 0x5d, 0xa3, 0x9c, 0x7b, 0xcb, 0xc0, 0x5a, 0x91, 0x40, 0x8b, 0xc7, 0xb1, 0x08, - 0x27, 0xf5, 0xd0, 0x23, 0x58, 0x71, 0xec, 0xe1, 0x01, 0xb1, 0xc8, 0x88, 0xf2, 0x31, 0xe3, 0xc8, - 0x36, 0x74, 0x6d, 0x22, 0x98, 0xcd, 0x42, 0xff, 0xdd, 0x70, 0xb8, 0x3c, 0xca, 0xab, 0x3c, 0xe3, - 0x14, 0x21, 0xbf, 0x2c, 0x92, 0xba, 0x08, 0x12, 0xb9, 0xd0, 0xf2, 0x65, 0xbb, 0x97, 0x44, 0x2f, - 0xf8, 0x0b, 0x67, 0xa7, 0x4a, 0x84, 0x9d, 0xa6, 0x2c, 0xe3, 0xea, 0x9f, 0x5e, 0xc7, 0x19, 0x0f, - 0xa5, 0xc4, 0xad, 0xf9, 0xdf, 0x10, 0xb7, 0xee, 0x3f, 0xeb, 0x70, 0x33, 0x57, 0x2a, 0xd1, 0x0f, - 0x2f, 0x60, 0x38, 0xb7, 0x9e, 0x1b, 0xbb, 0xc9, 0x51, 0x93, 0xd9, 0x2b, 0x50, 0x93, 0x5d, 0x58, - 0xd6, 0x7c, 0xd7, 0xa5, 0x16, 0xcb, 0x10, 0x93, 0x88, 0x1a, 0xed, 0xa5, 0xc5, 0x38, 0xab, 0x5f, - 0xc4, 0xae, 0x1a, 0x57, 0x64, 0x57, 0xc9, 0x5d, 0xc8, 0x09, 0x39, 0x08, 0xbb, 0xfc, 0x2e, 0xe4, - 0xa0, 0x9c, 0xd5, 0xe7, 0xd3, 0x41, 0x80, 0x1a, 0x21, 0xcc, 0xa7, 0xa7, 0x83, 0xd3, 0x94, 0x14, - 0x67, 0xb4, 0x0b, 0x98, 0xca, 0x42, 0x55, 0xa6, 0x82, 0x48, 0x8a, 0x47, 0x81, 0xc8, 0xf1, 0xed, - 0x2a, 0xb1, 0x5c, 0x99, 0x48, 0x75, 0xff, 0xa2, 0xc0, 0x8b, 0xa5, 0x49, 0x80, 0x76, 0x53, 0x2d, - 0x77, 0x3b, 0xd3, 0x72, 0xbf, 0x53, 0x6a, 0x98, 0xe8, 0xbb, 0x6e, 0x31, 0x35, 0x7a, 0xbf, 0x1a, - 0x35, 0x2a, 0x98, 0xdb, 0x2f, 0xe7, 0x48, 0xfd, 0xed, 0x27, 0x4f, 0x3b, 0x33, 0x5f, 0x3d, 0xed, - 0xcc, 0x7c, 0xfd, 0xb4, 0x33, 0xf3, 0xab, 0x69, 0x47, 0x79, 0x32, 0xed, 0x28, 0x5f, 0x4d, 0x3b, - 0xca, 0xd7, 0xd3, 0x8e, 0xf2, 0xb7, 0x69, 0x47, 0xf9, 0xcd, 0x37, 0x9d, 0x99, 0xcf, 0xe6, 0xa5, - 0xc7, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x99, 0x8d, 0x1e, 0xaf, 0x61, 0x1b, 0x00, 0x00, + 0x87, 0x1d, 0x71, 0xe1, 0x0f, 0x40, 0x4a, 0xce, 0xfc, 0x15, 0xdc, 0x40, 0x70, 0xe3, 0xb4, 0xc7, + 0x88, 0x0b, 0x39, 0x59, 0xec, 0xe4, 0x0a, 0x47, 0x2e, 0x2b, 0x21, 0xa1, 0xaa, 0xae, 0xfe, 0xee, + 0xb6, 0xdb, 0x48, 0x6b, 0x09, 0x6e, 0xd3, 0xf5, 0xde, 0xfb, 0xbd, 0x57, 0x55, 0xef, 0xbd, 0x7a, + 0xbf, 0x81, 0x1f, 0x9d, 0xbd, 0xe7, 0xa9, 0xba, 0xdd, 0x3b, 0xf3, 0x07, 0xd4, 0xb5, 0x28, 0xa3, + 0x5e, 0x6f, 0x4c, 0xad, 0xa1, 0xed, 0xf6, 0xa4, 0x80, 0x38, 0x7a, 0x8f, 0x38, 0x8e, 0xd7, 0x1b, + 0xdf, 0x1e, 0x50, 0x46, 0x6e, 0xf7, 0x46, 0xd4, 0xa2, 0x2e, 0x61, 0x74, 0xa8, 0x3a, 0xae, 0xcd, + 0x6c, 0xb4, 0x16, 0x28, 0xaa, 0xc4, 0xd1, 0x55, 0xae, 0xa8, 0x4a, 0xc5, 0xf5, 0xed, 0x91, 0xce, + 0x1e, 0xf9, 0x03, 0x55, 0xb3, 0xcd, 0xde, 0xc8, 0x1e, 0xd9, 0x3d, 0xa1, 0x3f, 0xf0, 0x1f, 0x8a, + 0x2f, 0xf1, 0x21, 0x7e, 0x05, 0x38, 0xeb, 0xdd, 0x84, 0x43, 0xcd, 0x76, 0x69, 0x6f, 0x9c, 0xf3, + 0xb5, 0xfe, 0x4e, 0xac, 0x63, 0x12, 0xed, 0x91, 0x6e, 0x51, 0x77, 0xd2, 0x73, 0xce, 0x46, 0x7c, + 0xc1, 0xeb, 0x99, 0x94, 0x91, 0x22, 0xab, 0x5e, 0x99, 0x95, 0xeb, 0x5b, 0x4c, 0x37, 0x69, 0xce, + 0xe0, 0xdd, 0xcb, 0x0c, 0x3c, 0xed, 0x11, 0x35, 0x49, 0xce, 0xee, 0xed, 0x32, 0x3b, 0x9f, 0xe9, + 0x46, 0x4f, 0xb7, 0x98, 0xc7, 0xdc, 0xac, 0x51, 0xf7, 0x5f, 0x0a, 0xa0, 0x3d, 0xdb, 0x62, 0xae, + 0x6d, 0x18, 0xd4, 0xc5, 0x74, 0xac, 0x7b, 0xba, 0x6d, 0xa1, 0xcf, 0xa1, 0xc1, 0xf7, 0x33, 0x24, + 0x8c, 0xb4, 0x95, 0x4d, 0x65, 0x6b, 0x71, 0xe7, 0x2d, 0x35, 0x3e, 0xe9, 0x08, 0x5e, 0x75, 0xce, + 0x46, 0x7c, 0xc1, 0x53, 0xb9, 0xb6, 0x3a, 0xbe, 0xad, 0x1e, 0x0e, 0xbe, 0xa0, 0x1a, 0x3b, 0xa0, + 0x8c, 0xf4, 0xd1, 0x93, 0xf3, 0x8d, 0x99, 0xe9, 0xf9, 0x06, 0xc4, 0x6b, 0x38, 0x42, 0x45, 0x87, + 0x30, 0x27, 0xd0, 0x6b, 0x02, 0x7d, 0xbb, 0x14, 0x5d, 0x6e, 0x5a, 0xc5, 0xe4, 0x57, 0xf7, 0x1f, + 0x33, 0x6a, 0xf1, 0xf0, 0xfa, 0x2f, 0x48, 0xe8, 0xb9, 0x7b, 0x84, 0x11, 0x2c, 0x80, 0xd0, 0x9b, + 0xd0, 0x70, 0x65, 0xf8, 0xed, 0xd9, 0x4d, 0x65, 0x6b, 0xb6, 0x7f, 0x43, 0x6a, 0x35, 0xc2, 0x6d, + 0xe1, 0x48, 0xa3, 0xfb, 0x44, 0x81, 0x5b, 0xf9, 0x7d, 0xef, 0xeb, 0x1e, 0x43, 0xbf, 0xc8, 0xed, + 0x5d, 0xad, 0xb6, 0x77, 0x6e, 0x2d, 0x76, 0x1e, 0x39, 0x0e, 0x57, 0x12, 0xfb, 0x3e, 0x82, 0xba, + 0xce, 0xa8, 0xe9, 0xb5, 0x6b, 0x9b, 0xb3, 0x5b, 0x8b, 0x3b, 0x6f, 0xa8, 0x25, 0x09, 0xac, 0xe6, + 0xa3, 0xeb, 0x2f, 0x49, 0xdc, 0xfa, 0x03, 0x8e, 0x80, 0x03, 0xa0, 0xee, 0x6f, 0x6b, 0x00, 0xf7, + 0xa8, 0x63, 0xd8, 0x13, 0x93, 0x5a, 0xec, 0x1a, 0xae, 0xee, 0x01, 0xcc, 0x79, 0x0e, 0xd5, 0xe4, + 0xd5, 0xbd, 0x5a, 0xba, 0x83, 0x38, 0xa8, 0x63, 0x87, 0x6a, 0xf1, 0xa5, 0xf1, 0x2f, 0x2c, 0x20, + 0xd0, 0x27, 0x30, 0xef, 0x31, 0xc2, 0x7c, 0x4f, 0x5c, 0xd9, 0xe2, 0xce, 0x6b, 0x55, 0xc0, 0x84, + 0x41, 0xbf, 0x25, 0xe1, 0xe6, 0x83, 0x6f, 0x2c, 0x81, 0xba, 0x7f, 0x9b, 0x85, 0x95, 0x58, 0x79, + 0xcf, 0xb6, 0x86, 0x3a, 0xe3, 0x29, 0x7d, 0x17, 0xe6, 0xd8, 0xc4, 0xa1, 0xe2, 0x4c, 0x9a, 0xfd, + 0x57, 0xc3, 0x60, 0x4e, 0x26, 0x0e, 0x7d, 0x76, 0xbe, 0xb1, 0x56, 0x60, 0xc2, 0x45, 0x58, 0x18, + 0xa1, 0xfd, 0x28, 0xce, 0x9a, 0x30, 0x7f, 0x27, 0xed, 0xfc, 0xd9, 0xf9, 0x46, 0x41, 0x03, 0x51, + 0x23, 0xa4, 0x74, 0x88, 0xe8, 0x0b, 0x68, 0x19, 0xc4, 0x63, 0xa7, 0xce, 0x90, 0x30, 0x7a, 0xa2, + 0x9b, 0xb4, 0x3d, 0x2f, 0x76, 0xff, 0x7a, 0xb5, 0x8b, 0xe2, 0x16, 0xfd, 0x5b, 0x32, 0x82, 0xd6, + 0x7e, 0x0a, 0x09, 0x67, 0x90, 0xd1, 0x18, 0x10, 0x5f, 0x39, 0x71, 0x89, 0xe5, 0x05, 0xbb, 0xe2, + 0xfe, 0x16, 0xae, 0xec, 0x6f, 0x5d, 0xfa, 0x43, 0xfb, 0x39, 0x34, 0x5c, 0xe0, 0x01, 0xbd, 0x02, + 0xf3, 0x2e, 0x25, 0x9e, 0x6d, 0xb5, 0xe7, 0xc4, 0x89, 0x45, 0xd7, 0x85, 0xc5, 0x2a, 0x96, 0x52, + 0xf4, 0x1a, 0x2c, 0x98, 0xd4, 0xf3, 0xc8, 0x88, 0xb6, 0xeb, 0x42, 0x71, 0x59, 0x2a, 0x2e, 0x1c, + 0x04, 0xcb, 0x38, 0x94, 0x77, 0xff, 0xa8, 0x40, 0x2b, 0xbe, 0xa6, 0x6b, 0xa8, 0xd5, 0x8f, 0xd2, + 0xb5, 0xfa, 0xfd, 0x0a, 0xc9, 0x59, 0x52, 0xa3, 0xff, 0xa8, 0x01, 0x8a, 0x95, 0xb0, 0x6d, 0x18, + 0x03, 0xa2, 0x9d, 0xa1, 0x4d, 0x98, 0xb3, 0x88, 0x19, 0xe6, 0x64, 0x54, 0x20, 0x3f, 0x21, 0x26, + 0xc5, 0x42, 0x82, 0xbe, 0x54, 0x00, 0xf9, 0xe2, 0x36, 0x87, 0xbb, 0x96, 0x65, 0x33, 0xc2, 0x0f, + 0x38, 0x0c, 0x68, 0xaf, 0x42, 0x40, 0xa1, 0x2f, 0xf5, 0x34, 0x87, 0x72, 0xdf, 0x62, 0xee, 0x24, + 0xbe, 0xd8, 0xbc, 0x02, 0x2e, 0x70, 0x8d, 0x7e, 0x0e, 0xe0, 0x4a, 0xcc, 0x13, 0x5b, 0x96, 0x6d, + 0x79, 0x0f, 0x08, 0xdd, 0xef, 0xd9, 0xd6, 0x43, 0x7d, 0x14, 0x37, 0x16, 0x1c, 0x41, 0xe0, 0x04, + 0xdc, 0xfa, 0x7d, 0x58, 0x2b, 0x89, 0x13, 0xdd, 0x80, 0xd9, 0x33, 0x3a, 0x09, 0x8e, 0x0a, 0xf3, + 0x9f, 0x68, 0x15, 0xea, 0x63, 0x62, 0xf8, 0x34, 0xa8, 0x49, 0x1c, 0x7c, 0xdc, 0xa9, 0xbd, 0xa7, + 0x74, 0x7f, 0x5f, 0x4f, 0x66, 0x0a, 0xef, 0x37, 0x68, 0x8b, 0x3f, 0x0f, 0x8e, 0xa1, 0x6b, 0xc4, + 0x13, 0x18, 0xf5, 0xfe, 0x0b, 0xc1, 0xd3, 0x10, 0xac, 0xe1, 0x48, 0x8a, 0x7e, 0x09, 0x0d, 0x8f, + 0x1a, 0x54, 0x63, 0xb6, 0x2b, 0x5b, 0xdc, 0xdb, 0x15, 0x73, 0x8a, 0x0c, 0xa8, 0x71, 0x2c, 0x4d, + 0x03, 0xf8, 0xf0, 0x0b, 0x47, 0x90, 0xe8, 0x13, 0x68, 0x30, 0x6a, 0x3a, 0x06, 0x61, 0x54, 0x9e, + 0x5e, 0x2a, 0xaf, 0x78, 0xef, 0xe0, 0x60, 0x47, 0xf6, 0xf0, 0x44, 0xaa, 0x89, 0xee, 0x19, 0xe5, + 0x69, 0xb8, 0x8a, 0x23, 0x18, 0xf4, 0x33, 0x68, 0x78, 0x8c, 0xbf, 0xea, 0xa3, 0x89, 0xa8, 0xb6, + 0x8b, 0x9e, 0x95, 0x64, 0x1f, 0x0d, 0x4c, 0x62, 0xe8, 0x70, 0x05, 0x47, 0x70, 0x68, 0x17, 0x96, + 0x4d, 0xdd, 0xc2, 0x94, 0x0c, 0x27, 0xc7, 0x54, 0xb3, 0xad, 0xa1, 0x27, 0xca, 0xb4, 0xde, 0x5f, + 0x93, 0x46, 0xcb, 0x07, 0x69, 0x31, 0xce, 0xea, 0xa3, 0x7d, 0x58, 0x0d, 0x9f, 0xdd, 0x8f, 0x74, + 0x8f, 0xd9, 0xee, 0x64, 0x5f, 0x37, 0x75, 0x26, 0x7a, 0x5e, 0xbd, 0xdf, 0x9e, 0x9e, 0x6f, 0xac, + 0xe2, 0x02, 0x39, 0x2e, 0xb4, 0xe2, 0x7d, 0xc5, 0x21, 0xbe, 0x47, 0x87, 0xa2, 0x87, 0x35, 0xe2, + 0xbe, 0x72, 0x24, 0x56, 0xb1, 0x94, 0xa2, 0x9f, 0xa6, 0xd2, 0xb4, 0x71, 0xb5, 0x34, 0x6d, 0x95, + 0xa7, 0x28, 0x3a, 0x85, 0x35, 0xc7, 0xb5, 0x47, 0x2e, 0xf5, 0xbc, 0x7b, 0x94, 0x0c, 0x0d, 0xdd, + 0xa2, 0xe1, 0xc9, 0x34, 0xc5, 0x8e, 0x5e, 0x9a, 0x9e, 0x6f, 0xac, 0x1d, 0x15, 0xab, 0xe0, 0x32, + 0xdb, 0xee, 0x5f, 0xe6, 0xe0, 0x46, 0xf6, 0x8d, 0x43, 0x1f, 0x03, 0xb2, 0x07, 0x1e, 0x75, 0xc7, + 0x74, 0xf8, 0x61, 0x30, 0xb8, 0xf1, 0xe9, 0x46, 0x11, 0xd3, 0x4d, 0x54, 0xb7, 0x87, 0x39, 0x0d, + 0x5c, 0x60, 0x15, 0xcc, 0x47, 0xb2, 0x00, 0x6a, 0x22, 0xd0, 0xc4, 0x7c, 0x94, 0x2b, 0x82, 0x5d, + 0x58, 0x96, 0xb5, 0x1f, 0x0a, 0x45, 0xb2, 0x26, 0xee, 0xfd, 0x34, 0x2d, 0xc6, 0x59, 0x7d, 0x74, + 0x17, 0x96, 0x5c, 0x9e, 0x07, 0x11, 0xc0, 0x82, 0x00, 0xf8, 0x8e, 0x04, 0x58, 0xc2, 0x49, 0x21, + 0x4e, 0xeb, 0xa2, 0x0f, 0xe1, 0x26, 0x19, 0x13, 0xdd, 0x20, 0x03, 0x83, 0x46, 0x00, 0x73, 0x02, + 0xe0, 0x45, 0x09, 0x70, 0x73, 0x37, 0xab, 0x80, 0xf3, 0x36, 0xe8, 0x00, 0x56, 0x7c, 0x2b, 0x0f, + 0x15, 0x24, 0xf1, 0x4b, 0x12, 0x6a, 0xe5, 0x34, 0xaf, 0x82, 0x8b, 0xec, 0xd0, 0xe7, 0x00, 0x5a, + 0xf8, 0xaa, 0x7b, 0xed, 0x79, 0xd1, 0x86, 0xdf, 0xac, 0x50, 0x6c, 0xd1, 0x28, 0x10, 0xb7, 0xc0, + 0x68, 0xc9, 0xc3, 0x09, 0x4c, 0x74, 0x07, 0x5a, 0x9a, 0x6d, 0x18, 0x22, 0xf3, 0xf7, 0x6c, 0xdf, + 0x62, 0x22, 0x79, 0xeb, 0x7d, 0xc4, 0x1f, 0xfb, 0xbd, 0x94, 0x04, 0x67, 0x34, 0xbb, 0x7f, 0x56, + 0x92, 0xcf, 0x4c, 0x58, 0xce, 0xe8, 0x4e, 0x6a, 0xf4, 0x79, 0x25, 0x33, 0xfa, 0xdc, 0xca, 0x5b, + 0x24, 0x26, 0x1f, 0x1d, 0x96, 0x78, 0xf2, 0xeb, 0xd6, 0x28, 0xb8, 0x70, 0xd9, 0x12, 0xdf, 0xba, + 0xb0, 0x94, 0x22, 0xed, 0xc4, 0xc3, 0x78, 0x53, 0xdc, 0x79, 0x52, 0x88, 0xd3, 0xc8, 0xdd, 0x0f, + 0xa0, 0x95, 0xae, 0xc3, 0xd4, 0x4c, 0xaf, 0x5c, 0x3a, 0xd3, 0x7f, 0xab, 0xc0, 0x5a, 0x89, 0x77, + 0x64, 0x40, 0xcb, 0x24, 0x8f, 0x13, 0xd7, 0x7c, 0xe9, 0x6c, 0xcc, 0x59, 0x93, 0x1a, 0xb0, 0x26, + 0xf5, 0x81, 0xc5, 0x0e, 0xdd, 0x63, 0xe6, 0xea, 0xd6, 0x28, 0xb8, 0x87, 0x83, 0x14, 0x16, 0xce, + 0x60, 0xa3, 0xcf, 0xa0, 0x61, 0x92, 0xc7, 0xc7, 0xbe, 0x3b, 0x2a, 0x3a, 0xaf, 0x6a, 0x7e, 0xc4, + 0xfb, 0x71, 0x20, 0x51, 0x70, 0x84, 0xd7, 0x3d, 0x84, 0xcd, 0xd4, 0x26, 0x79, 0xab, 0xa0, 0x0f, + 0x7d, 0xe3, 0x98, 0xc6, 0x17, 0xfe, 0x06, 0x34, 0x1d, 0xe2, 0x32, 0x3d, 0x6a, 0x17, 0xf5, 0xfe, + 0xd2, 0xf4, 0x7c, 0xa3, 0x79, 0x14, 0x2e, 0xe2, 0x58, 0xde, 0xfd, 0xb7, 0x02, 0xf5, 0x63, 0x8d, + 0x18, 0xf4, 0x1a, 0xa8, 0xc3, 0xbd, 0x14, 0x75, 0xe8, 0x96, 0x26, 0x91, 0x88, 0xa7, 0x94, 0x35, + 0xec, 0x67, 0x58, 0xc3, 0xcb, 0x97, 0xe0, 0x5c, 0x4c, 0x18, 0xde, 0x87, 0x66, 0xe4, 0x2e, 0xd5, + 0x25, 0x95, 0xcb, 0xba, 0x64, 0xf7, 0x77, 0x35, 0x58, 0x4c, 0xb8, 0xb8, 0x9a, 0x35, 0x3f, 0xee, + 0xc4, 0xa0, 0xc1, 0x3b, 0xc9, 0x4e, 0x95, 0x8d, 0xa8, 0xe1, 0x50, 0x11, 0xcc, 0x6f, 0xf1, 0xeb, + 0x9d, 0x9f, 0x35, 0x3e, 0x80, 0x16, 0x23, 0xee, 0x88, 0xb2, 0x50, 0x26, 0x0e, 0xac, 0x19, 0x93, + 0x87, 0x93, 0x94, 0x14, 0x67, 0xb4, 0xd7, 0xef, 0xc2, 0x52, 0xca, 0xd9, 0x95, 0x86, 0xb0, 0x2f, + 0xf9, 0xe1, 0xc4, 0xc9, 0x79, 0x0d, 0xd9, 0xf5, 0x71, 0x2a, 0xbb, 0xb6, 0xca, 0x0f, 0x33, 0x51, + 0x32, 0x65, 0x39, 0x86, 0x33, 0x39, 0xf6, 0x7a, 0x25, 0xb4, 0x8b, 0x33, 0xed, 0x9f, 0x35, 0x58, + 0x4d, 0x68, 0xc7, 0xdc, 0xf4, 0x87, 0xa9, 0x06, 0xbd, 0x95, 0x69, 0xd0, 0xed, 0x22, 0x9b, 0xe7, + 0x46, 0x4e, 0x8b, 0x09, 0xe3, 0xec, 0xff, 0x22, 0x61, 0xfc, 0x93, 0x02, 0xcb, 0x89, 0xb3, 0xbb, + 0x06, 0xc6, 0xf8, 0x20, 0xcd, 0x18, 0x5f, 0xae, 0x92, 0x34, 0x25, 0x94, 0xf1, 0xab, 0xf9, 0x54, + 0xf0, 0xff, 0xf7, 0x24, 0xe6, 0xd7, 0xb0, 0x3a, 0xb6, 0x0d, 0xdf, 0xa4, 0x7b, 0x06, 0xd1, 0xcd, + 0x50, 0x81, 0x0f, 0x7d, 0xb3, 0xd9, 0x3f, 0x86, 0x22, 0x78, 0xea, 0x7a, 0xba, 0xc7, 0xa8, 0xc5, + 0x3e, 0x8d, 0x2d, 0xfb, 0xdf, 0x95, 0x4e, 0x56, 0x3f, 0x2d, 0x80, 0xc3, 0x85, 0x4e, 0xd0, 0x0f, + 0x60, 0x91, 0x0f, 0xcc, 0xba, 0x46, 0x39, 0xf7, 0x96, 0x89, 0xb5, 0x22, 0x81, 0x16, 0x8f, 0x63, + 0x11, 0x4e, 0xea, 0xa1, 0x47, 0xb0, 0xe2, 0xd8, 0xc3, 0x03, 0x62, 0x91, 0x11, 0xe5, 0x63, 0xc6, + 0x91, 0x6d, 0xe8, 0xda, 0x44, 0x30, 0x9b, 0x66, 0xff, 0xdd, 0x70, 0xb8, 0x3c, 0xca, 0xab, 0x3c, + 0xe3, 0x14, 0x21, 0xbf, 0x2c, 0x8a, 0xba, 0x08, 0x12, 0xb9, 0xd0, 0xf2, 0xe5, 0x73, 0x2f, 0x89, + 0x5e, 0xf0, 0x17, 0xce, 0x4e, 0x95, 0x0c, 0x3b, 0x4d, 0x59, 0xc6, 0xdd, 0x3f, 0xbd, 0x8e, 0x33, + 0x1e, 0x4a, 0x89, 0x5b, 0xe3, 0xbf, 0x22, 0x6e, 0x05, 0x4c, 0xb2, 0x79, 0x35, 0x26, 0xd9, 0xfd, + 0x43, 0x1d, 0x6e, 0xe6, 0xba, 0x2d, 0xfa, 0xf1, 0x05, 0x24, 0xe9, 0xd6, 0x73, 0x23, 0x48, 0x39, + 0x76, 0x33, 0x7b, 0x05, 0x76, 0xb3, 0x0b, 0xcb, 0x9a, 0xef, 0xba, 0xd4, 0x62, 0x19, 0x6e, 0x13, + 0x9d, 0xc5, 0x5e, 0x5a, 0x8c, 0xb3, 0xfa, 0x45, 0x04, 0xad, 0x7e, 0x45, 0x82, 0x96, 0x8c, 0x42, + 0x0e, 0xd9, 0x41, 0xe6, 0xe6, 0xa3, 0x90, 0xb3, 0x76, 0x56, 0x9f, 0x0f, 0x18, 0x01, 0x6a, 0x84, + 0xb0, 0x90, 0x1e, 0x30, 0x4e, 0x53, 0x52, 0x9c, 0xd1, 0x2e, 0x20, 0x3b, 0xcd, 0xaa, 0x64, 0x07, + 0x91, 0x14, 0x15, 0x03, 0xd1, 0x26, 0xb6, 0xab, 0x94, 0x43, 0x75, 0x2e, 0x56, 0xc8, 0x42, 0x17, + 0xaf, 0xce, 0x42, 0xbb, 0x7f, 0x55, 0xe0, 0xc5, 0xd2, 0x82, 0x44, 0xbb, 0xa9, 0xe7, 0x7f, 0x3b, + 0xf3, 0xfc, 0x7f, 0xaf, 0xd4, 0x30, 0x31, 0x03, 0xb8, 0xc5, 0x34, 0xed, 0xfd, 0x6a, 0x34, 0xad, + 0x80, 0x43, 0x5c, 0xce, 0xd7, 0xfa, 0xdb, 0x4f, 0x9e, 0x76, 0x66, 0xbe, 0x7e, 0xda, 0x99, 0xf9, + 0xe6, 0x69, 0x67, 0xe6, 0x37, 0xd3, 0x8e, 0xf2, 0x64, 0xda, 0x51, 0xbe, 0x9e, 0x76, 0x94, 0x6f, + 0xa6, 0x1d, 0xe5, 0xef, 0xd3, 0x8e, 0xf2, 0xd5, 0xb7, 0x9d, 0x99, 0xcf, 0x16, 0xa4, 0xc7, 0xff, + 0x04, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x02, 0xfa, 0x27, 0xed, 0x1b, 0x00, 0x00, } func (m *ControllerRevision) Marshal() (dAtA []byte, err error) { @@ -1706,6 +1707,9 @@ func (m *StatefulSetSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.MinReadySeconds)) + i-- + dAtA[i] = 0x48 if m.RevisionHistoryLimit != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.RevisionHistoryLimit)) i-- @@ -1795,6 +1799,9 @@ func (m *StatefulSetStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.AvailableReplicas)) + i-- + dAtA[i] = 0x58 if len(m.Conditions) > 0 { for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { { @@ -2236,6 +2243,7 @@ func (m *StatefulSetSpec) Size() (n int) { if m.RevisionHistoryLimit != nil { n += 1 + sovGenerated(uint64(*m.RevisionHistoryLimit)) } + n += 1 + sovGenerated(uint64(m.MinReadySeconds)) return n } @@ -2265,6 +2273,7 @@ func (m *StatefulSetStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + n += 1 + sovGenerated(uint64(m.AvailableReplicas)) return n } @@ -2568,6 +2577,7 @@ func (this *StatefulSetSpec) String() string { `PodManagementPolicy:` + fmt.Sprintf("%v", this.PodManagementPolicy) + `,`, `UpdateStrategy:` + strings.Replace(strings.Replace(this.UpdateStrategy.String(), "StatefulSetUpdateStrategy", "StatefulSetUpdateStrategy", 1), `&`, ``, 1) + `,`, `RevisionHistoryLimit:` + valueToStringGenerated(this.RevisionHistoryLimit) + `,`, + `MinReadySeconds:` + fmt.Sprintf("%v", this.MinReadySeconds) + `,`, `}`, }, "") return s @@ -2591,6 +2601,7 @@ func (this *StatefulSetStatus) String() string { `UpdateRevision:` + fmt.Sprintf("%v", this.UpdateRevision) + `,`, `CollisionCount:` + valueToStringGenerated(this.CollisionCount) + `,`, `Conditions:` + repeatedStringForConditions + `,`, + `AvailableReplicas:` + fmt.Sprintf("%v", this.AvailableReplicas) + `,`, `}`, }, "") return s @@ -5694,6 +5705,25 @@ func (m *StatefulSetSpec) Unmarshal(dAtA []byte) error { } } m.RevisionHistoryLimit = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinReadySeconds", wireType) + } + m.MinReadySeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinReadySeconds |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -5958,6 +5988,25 @@ func (m *StatefulSetStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AvailableReplicas", wireType) + } + m.AvailableReplicas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AvailableReplicas |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/generated.proto index 888f3e79e17e..128efa9ca90f 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/generated.proto @@ -427,6 +427,13 @@ message StatefulSetSpec { // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. optional int32 revisionHistoryLimit = 8; + + // Minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // +optional + optional int32 minReadySeconds = 9; } // StatefulSetStatus represents the current state of a StatefulSet. @@ -469,6 +476,12 @@ message StatefulSetStatus { // +patchMergeKey=type // +patchStrategy=merge repeated StatefulSetCondition conditions = 10; + + // Total number of available pods (ready for at least minReadySeconds) targeted by this StatefulSet. + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // Remove omitempty when graduating to beta + // +optional + optional int32 availableReplicas = 11; } // StatefulSetUpdateStrategy indicates the strategy that the StatefulSet diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/types.go index 9f822faee171..be638bb0f93b 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/types.go @@ -218,6 +218,13 @@ type StatefulSetSpec struct { // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,8,opt,name=revisionHistoryLimit"` + + // Minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // +optional + MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,9,opt,name=minReadySeconds"` } // StatefulSetStatus represents the current state of a StatefulSet. @@ -260,6 +267,12 @@ type StatefulSetStatus struct { // +patchMergeKey=type // +patchStrategy=merge Conditions []StatefulSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,10,rep,name=conditions"` + + // Total number of available pods (ready for at least minReadySeconds) targeted by this StatefulSet. + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // Remove omitempty when graduating to beta + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,11,opt,name=availableReplicas"` } type StatefulSetConditionType string diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go index 504b858639ea..51e08b575ecf 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go @@ -237,6 +237,7 @@ var map_StatefulSetSpec = map[string]string{ "podManagementPolicy": "podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.", "updateStrategy": "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.", "revisionHistoryLimit": "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.", + "minReadySeconds": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate.", } func (StatefulSetSpec) SwaggerDoc() map[string]string { @@ -254,6 +255,7 @@ var map_StatefulSetStatus = map[string]string{ "updateRevision": "updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)", "collisionCount": "collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision.", "conditions": "Represents the latest available observations of a statefulset's current state.", + "availableReplicas": "Total number of available pods (ready for at least minReadySeconds) targeted by this StatefulSet. This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. Remove omitempty when graduating to beta", } func (StatefulSetStatus) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.pb.go index b2e5c2e97238..e03a95acd470 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.pb.go @@ -957,143 +957,144 @@ func init() { } var fileDescriptor_42fe616264472f7e = []byte{ - // 2169 bytes of a gzipped FileDescriptorProto + // 2182 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x6f, 0x1c, 0xb7, - 0xf9, 0xd6, 0xec, 0x87, 0xb4, 0xa2, 0x2c, 0xc9, 0xa6, 0xf4, 0x93, 0x36, 0xf2, 0xaf, 0x2b, 0x63, - 0x13, 0x38, 0x4a, 0x6c, 0xcd, 0xda, 0xca, 0x07, 0x12, 0xbb, 0x68, 0xab, 0x95, 0x52, 0xdb, 0x81, - 0xbe, 0x42, 0x59, 0x06, 0x1a, 0xb4, 0xa8, 0xa9, 0x5d, 0x7a, 0x35, 0xd1, 0x7c, 0x61, 0x86, 0xb3, - 0xf5, 0xa2, 0x97, 0x5e, 0x0b, 0x14, 0x68, 0x7b, 0xed, 0x3f, 0xd1, 0x5b, 0x51, 0xb4, 0xb7, 0x22, - 0x28, 0x7c, 0x29, 0x10, 0xf4, 0x92, 0x9c, 0x84, 0x7a, 0x73, 0x2a, 0x8a, 0x5e, 0x0a, 0xf4, 0x12, - 0xa0, 0x40, 0x41, 0x0e, 0xe7, 0x83, 0xf3, 0xe1, 0x1d, 0x29, 0x8e, 0xd2, 0x04, 0xb9, 0x69, 0xc9, - 0xe7, 0x7d, 0xf8, 0xbe, 0xe4, 0x4b, 0xbe, 0x0f, 0x39, 0x02, 0xdf, 0x3b, 0x7e, 0xcb, 0x55, 0x35, - 0xab, 0x75, 0xec, 0x1d, 0x12, 0xc7, 0x24, 0x94, 0xb8, 0xad, 0x3e, 0x31, 0xbb, 0x96, 0xd3, 0x12, - 0x1d, 0xd8, 0xd6, 0x5a, 0xd8, 0xb6, 0xdd, 0x56, 0xff, 0xe6, 0x21, 0xa1, 0x78, 0xad, 0xd5, 0x23, - 0x26, 0x71, 0x30, 0x25, 0x5d, 0xd5, 0x76, 0x2c, 0x6a, 0xc1, 0x45, 0x1f, 0xa8, 0x62, 0x5b, 0x53, - 0x19, 0x50, 0x15, 0xc0, 0xa5, 0xd5, 0x9e, 0x46, 0x8f, 0xbc, 0x43, 0xb5, 0x63, 0x19, 0xad, 0x9e, - 0xd5, 0xb3, 0x5a, 0x1c, 0x7f, 0xe8, 0x3d, 0xe2, 0xbf, 0xf8, 0x0f, 0xfe, 0x97, 0xcf, 0xb3, 0xd4, - 0x8c, 0x0d, 0xd8, 0xb1, 0x1c, 0xd2, 0xea, 0xdf, 0x4c, 0x8e, 0xb5, 0xf4, 0x7a, 0x84, 0x31, 0x70, - 0xe7, 0x48, 0x33, 0x89, 0x33, 0x68, 0xd9, 0xc7, 0x3d, 0xd6, 0xe0, 0xb6, 0x0c, 0x42, 0x71, 0x96, - 0x55, 0x2b, 0xcf, 0xca, 0xf1, 0x4c, 0xaa, 0x19, 0x24, 0x65, 0xf0, 0xe6, 0x28, 0x03, 0xb7, 0x73, - 0x44, 0x0c, 0x9c, 0xb2, 0x7b, 0x2d, 0xcf, 0xce, 0xa3, 0x9a, 0xde, 0xd2, 0x4c, 0xea, 0x52, 0x27, - 0x69, 0xd4, 0xfc, 0xb7, 0x02, 0xe0, 0x86, 0x65, 0x52, 0xc7, 0xd2, 0x75, 0xe2, 0x20, 0xd2, 0xd7, - 0x5c, 0xcd, 0x32, 0xe1, 0x43, 0x50, 0x63, 0xf1, 0x74, 0x31, 0xc5, 0x75, 0xe5, 0x8a, 0xb2, 0x32, - 0xb5, 0x76, 0x43, 0x8d, 0x66, 0x3a, 0xa4, 0x57, 0xed, 0xe3, 0x1e, 0x6b, 0x70, 0x55, 0x86, 0x56, - 0xfb, 0x37, 0xd5, 0xdd, 0xc3, 0x0f, 0x48, 0x87, 0x6e, 0x13, 0x8a, 0xdb, 0xf0, 0xc9, 0xc9, 0xf2, - 0xd8, 0xf0, 0x64, 0x19, 0x44, 0x6d, 0x28, 0x64, 0x85, 0xbb, 0xa0, 0xc2, 0xd9, 0x4b, 0x9c, 0x7d, - 0x35, 0x97, 0x5d, 0x04, 0xad, 0x22, 0xfc, 0x93, 0x77, 0x1e, 0x53, 0x62, 0x32, 0xf7, 0xda, 0x17, - 0x04, 0x75, 0x65, 0x13, 0x53, 0x8c, 0x38, 0x11, 0xbc, 0x0e, 0x6a, 0x8e, 0x70, 0xbf, 0x5e, 0xbe, - 0xa2, 0xac, 0x94, 0xdb, 0x17, 0x05, 0xaa, 0x16, 0x84, 0x85, 0x42, 0x44, 0xf3, 0x89, 0x02, 0x16, - 0xd2, 0x71, 0x6f, 0x69, 0x2e, 0x85, 0x3f, 0x4c, 0xc5, 0xae, 0x16, 0x8b, 0x9d, 0x59, 0xf3, 0xc8, - 0xc3, 0x81, 0x83, 0x96, 0x58, 0xdc, 0x7b, 0xa0, 0xaa, 0x51, 0x62, 0xb8, 0xf5, 0xd2, 0x95, 0xf2, - 0xca, 0xd4, 0xda, 0x35, 0x35, 0x27, 0x81, 0xd5, 0xb4, 0x77, 0xed, 0x69, 0xc1, 0x5b, 0xbd, 0xc7, - 0x18, 0x90, 0x4f, 0xd4, 0xfc, 0x79, 0x09, 0x4c, 0x6e, 0x62, 0x62, 0x58, 0xe6, 0x3e, 0xa1, 0xe7, - 0xb0, 0x72, 0x77, 0x41, 0xc5, 0xb5, 0x49, 0x47, 0xac, 0xdc, 0xd5, 0xdc, 0x00, 0x42, 0x9f, 0xf6, - 0x6d, 0xd2, 0x89, 0x96, 0x8c, 0xfd, 0x42, 0x9c, 0x01, 0xee, 0x81, 0x71, 0x97, 0x62, 0xea, 0xb9, - 0x7c, 0xc1, 0xa6, 0xd6, 0x56, 0x0a, 0x70, 0x71, 0x7c, 0x7b, 0x46, 0xb0, 0x8d, 0xfb, 0xbf, 0x91, - 0xe0, 0x69, 0xfe, 0xbd, 0x04, 0x60, 0x88, 0xdd, 0xb0, 0xcc, 0xae, 0x46, 0x59, 0x3a, 0xdf, 0x02, - 0x15, 0x3a, 0xb0, 0x09, 0x9f, 0x90, 0xc9, 0xf6, 0xd5, 0xc0, 0x95, 0xfb, 0x03, 0x9b, 0x7c, 0x76, - 0xb2, 0xbc, 0x90, 0xb6, 0x60, 0x3d, 0x88, 0xdb, 0xc0, 0xad, 0xd0, 0xc9, 0x12, 0xb7, 0x7e, 0x5d, - 0x1e, 0xfa, 0xb3, 0x93, 0xe5, 0x8c, 0xb3, 0x43, 0x0d, 0x99, 0x64, 0x07, 0x61, 0x1f, 0x40, 0x1d, - 0xbb, 0xf4, 0xbe, 0x83, 0x4d, 0xd7, 0x1f, 0x49, 0x33, 0x88, 0x08, 0xff, 0xd5, 0x62, 0x0b, 0xc5, - 0x2c, 0xda, 0x4b, 0xc2, 0x0b, 0xb8, 0x95, 0x62, 0x43, 0x19, 0x23, 0xc0, 0xab, 0x60, 0xdc, 0x21, - 0xd8, 0xb5, 0xcc, 0x7a, 0x85, 0x47, 0x11, 0x4e, 0x20, 0xe2, 0xad, 0x48, 0xf4, 0xc2, 0x57, 0xc0, - 0x84, 0x41, 0x5c, 0x17, 0xf7, 0x48, 0xbd, 0xca, 0x81, 0xb3, 0x02, 0x38, 0xb1, 0xed, 0x37, 0xa3, - 0xa0, 0xbf, 0xf9, 0x3b, 0x05, 0x4c, 0x87, 0x33, 0x77, 0x0e, 0x3b, 0xe7, 0x8e, 0xbc, 0x73, 0x9a, - 0xa3, 0x93, 0x25, 0x67, 0xc3, 0x7c, 0x58, 0x8e, 0x39, 0xce, 0xd2, 0x11, 0xfe, 0x08, 0xd4, 0x5c, - 0xa2, 0x93, 0x0e, 0xb5, 0x1c, 0xe1, 0xf8, 0x6b, 0x05, 0x1d, 0xc7, 0x87, 0x44, 0xdf, 0x17, 0xa6, - 0xed, 0x0b, 0xcc, 0xf3, 0xe0, 0x17, 0x0a, 0x29, 0xe1, 0x7b, 0xa0, 0x46, 0x89, 0x61, 0xeb, 0x98, - 0x12, 0xb1, 0x6b, 0x5e, 0x8c, 0x3b, 0xcf, 0x72, 0x86, 0x91, 0xed, 0x59, 0xdd, 0xfb, 0x02, 0xc6, - 0xb7, 0x4c, 0x38, 0x19, 0x41, 0x2b, 0x0a, 0x69, 0xa0, 0x0d, 0x66, 0x3c, 0xbb, 0xcb, 0x90, 0x94, - 0x1d, 0xe7, 0xbd, 0x81, 0xc8, 0xa1, 0x1b, 0xa3, 0x67, 0xe5, 0x40, 0xb2, 0x6b, 0x2f, 0x88, 0x51, - 0x66, 0xe4, 0x76, 0x94, 0xe0, 0x87, 0xeb, 0x60, 0xd6, 0xd0, 0x4c, 0x44, 0x70, 0x77, 0xb0, 0x4f, - 0x3a, 0x96, 0xd9, 0x75, 0x79, 0x2a, 0x55, 0xdb, 0x8b, 0x82, 0x60, 0x76, 0x5b, 0xee, 0x46, 0x49, - 0x3c, 0xdc, 0x02, 0xf3, 0xc1, 0x01, 0x7c, 0x57, 0x73, 0xa9, 0xe5, 0x0c, 0xb6, 0x34, 0x43, 0xa3, - 0xf5, 0x71, 0xce, 0x53, 0x1f, 0x9e, 0x2c, 0xcf, 0xa3, 0x8c, 0x7e, 0x94, 0x69, 0xd5, 0xfc, 0xf5, - 0x38, 0x98, 0x4d, 0x9c, 0x0b, 0xf0, 0x01, 0x58, 0xe8, 0x78, 0x8e, 0x43, 0x4c, 0xba, 0xe3, 0x19, - 0x87, 0xc4, 0xd9, 0xef, 0x1c, 0x91, 0xae, 0xa7, 0x93, 0x2e, 0x5f, 0xd6, 0x6a, 0xbb, 0x21, 0x7c, - 0x5d, 0xd8, 0xc8, 0x44, 0xa1, 0x1c, 0x6b, 0xf8, 0x2e, 0x80, 0x26, 0x6f, 0xda, 0xd6, 0x5c, 0x37, - 0xe4, 0x2c, 0x71, 0xce, 0x70, 0x2b, 0xee, 0xa4, 0x10, 0x28, 0xc3, 0x8a, 0xf9, 0xd8, 0x25, 0xae, - 0xe6, 0x90, 0x6e, 0xd2, 0xc7, 0xb2, 0xec, 0xe3, 0x66, 0x26, 0x0a, 0xe5, 0x58, 0xc3, 0x37, 0xc0, - 0x94, 0x3f, 0x1a, 0x9f, 0x73, 0xb1, 0x38, 0x73, 0x82, 0x6c, 0x6a, 0x27, 0xea, 0x42, 0x71, 0x1c, - 0x0b, 0xcd, 0x3a, 0x74, 0x89, 0xd3, 0x27, 0xdd, 0x3b, 0xbe, 0x38, 0x60, 0x15, 0xb4, 0xca, 0x2b, - 0x68, 0x18, 0xda, 0x6e, 0x0a, 0x81, 0x32, 0xac, 0x58, 0x68, 0x7e, 0xd6, 0xa4, 0x42, 0x1b, 0x97, - 0x43, 0x3b, 0xc8, 0x44, 0xa1, 0x1c, 0x6b, 0x96, 0x7b, 0xbe, 0xcb, 0xeb, 0x7d, 0xac, 0xe9, 0xf8, - 0x50, 0x27, 0xf5, 0x09, 0x39, 0xf7, 0x76, 0xe4, 0x6e, 0x94, 0xc4, 0xc3, 0x3b, 0xe0, 0x92, 0xdf, - 0x74, 0x60, 0xe2, 0x90, 0xa4, 0xc6, 0x49, 0x5e, 0x10, 0x24, 0x97, 0x76, 0x92, 0x00, 0x94, 0xb6, - 0x81, 0xb7, 0xc0, 0x4c, 0xc7, 0xd2, 0x75, 0x9e, 0x8f, 0x1b, 0x96, 0x67, 0xd2, 0xfa, 0x24, 0x67, - 0x81, 0x6c, 0x0f, 0x6d, 0x48, 0x3d, 0x28, 0x81, 0x84, 0x3f, 0x06, 0xa0, 0x13, 0x14, 0x06, 0xb7, - 0x0e, 0x46, 0x28, 0x80, 0x74, 0x59, 0x8a, 0x2a, 0x73, 0xd8, 0xe4, 0xa2, 0x18, 0x65, 0xf3, 0x43, - 0x05, 0x2c, 0xe6, 0x6c, 0x74, 0xf8, 0x5d, 0xa9, 0x08, 0x5e, 0x4b, 0x14, 0xc1, 0xcb, 0x39, 0x66, - 0xb1, 0x4a, 0x78, 0x04, 0xa6, 0x99, 0x20, 0xd1, 0xcc, 0x9e, 0x0f, 0x11, 0x67, 0x59, 0x2b, 0x37, - 0x00, 0x14, 0x47, 0x47, 0xa7, 0xf2, 0xa5, 0xe1, 0xc9, 0xf2, 0xb4, 0xd4, 0x87, 0x64, 0xe2, 0xe6, - 0x2f, 0x4a, 0x00, 0x6c, 0x12, 0x5b, 0xb7, 0x06, 0x06, 0x31, 0xcf, 0x43, 0xd3, 0xdc, 0x93, 0x34, - 0xcd, 0xcb, 0xf9, 0x4b, 0x12, 0x3a, 0x95, 0x2b, 0x6a, 0xde, 0x4b, 0x88, 0x9a, 0x57, 0x8a, 0x90, - 0x3d, 0x5b, 0xd5, 0x7c, 0x5c, 0x06, 0x73, 0x11, 0x38, 0x92, 0x35, 0xb7, 0xa5, 0x15, 0x7d, 0x39, - 0xb1, 0xa2, 0x8b, 0x19, 0x26, 0x5f, 0x98, 0xae, 0xf9, 0x00, 0xcc, 0x30, 0xd5, 0xe1, 0xaf, 0x1f, - 0xd7, 0x34, 0xe3, 0xa7, 0xd6, 0x34, 0x61, 0x25, 0xda, 0x92, 0x98, 0x50, 0x82, 0x39, 0x47, 0x43, - 0x4d, 0x7c, 0x15, 0x35, 0xd4, 0xef, 0x15, 0x30, 0x13, 0x2d, 0xd3, 0x39, 0x88, 0xa8, 0xbb, 0xb2, - 0x88, 0x7a, 0xb1, 0x40, 0x72, 0xe6, 0xa8, 0xa8, 0x8f, 0x2b, 0x71, 0xd7, 0xb9, 0x8c, 0x5a, 0x61, - 0x57, 0x30, 0x5b, 0xd7, 0x3a, 0xd8, 0x15, 0xf5, 0xf6, 0x82, 0x7f, 0xfd, 0xf2, 0xdb, 0x50, 0xd8, - 0x2b, 0x09, 0xae, 0xd2, 0x17, 0x2b, 0xb8, 0xca, 0xcf, 0x47, 0x70, 0xfd, 0x00, 0xd4, 0xdc, 0x40, - 0x6a, 0x55, 0x38, 0xe5, 0xb5, 0x42, 0x1b, 0x5b, 0xa8, 0xac, 0x90, 0x3a, 0xd4, 0x57, 0x21, 0x5d, - 0x96, 0xb2, 0xaa, 0x7e, 0x99, 0xca, 0x8a, 0x25, 0xba, 0x8d, 0x3d, 0x97, 0x74, 0xf9, 0xa6, 0xaa, - 0x45, 0x89, 0xbe, 0xc7, 0x5b, 0x91, 0xe8, 0x85, 0x07, 0x60, 0xd1, 0x76, 0xac, 0x9e, 0x43, 0x5c, - 0x77, 0x93, 0xe0, 0xae, 0xae, 0x99, 0x24, 0x08, 0xc0, 0xaf, 0x89, 0x97, 0x87, 0x27, 0xcb, 0x8b, - 0x7b, 0xd9, 0x10, 0x94, 0x67, 0xdb, 0xfc, 0x53, 0x05, 0x5c, 0x4c, 0x9e, 0x8d, 0x39, 0x32, 0x45, - 0x39, 0x93, 0x4c, 0xb9, 0x1e, 0xcb, 0x53, 0x5f, 0xc3, 0xc5, 0x9e, 0x0a, 0x52, 0xb9, 0xba, 0x0e, - 0x66, 0x85, 0x2c, 0x09, 0x3a, 0x85, 0x50, 0x0b, 0x97, 0xe7, 0x40, 0xee, 0x46, 0x49, 0x3c, 0xbc, - 0x0d, 0xa6, 0x1d, 0xae, 0xbc, 0x02, 0x02, 0x5f, 0xbd, 0xfc, 0x9f, 0x20, 0x98, 0x46, 0xf1, 0x4e, - 0x24, 0x63, 0x99, 0x72, 0x89, 0x04, 0x49, 0x40, 0x50, 0x91, 0x95, 0xcb, 0x7a, 0x12, 0x80, 0xd2, - 0x36, 0x70, 0x1b, 0xcc, 0x79, 0x66, 0x9a, 0xca, 0xcf, 0xb5, 0xcb, 0x82, 0x6a, 0xee, 0x20, 0x0d, - 0x41, 0x59, 0x76, 0xf0, 0xa1, 0x24, 0x66, 0xc6, 0xf9, 0x79, 0x72, 0xbd, 0xc0, 0x9e, 0x28, 0xac, - 0x66, 0x32, 0xa4, 0x56, 0xad, 0xa8, 0xd4, 0x6a, 0xfe, 0x51, 0x01, 0x30, 0xbd, 0x0f, 0x47, 0xbe, - 0x04, 0xa4, 0x2c, 0x62, 0x15, 0x53, 0xcb, 0xd6, 0x3f, 0x37, 0x0a, 0xea, 0x9f, 0xe8, 0x40, 0x2d, - 0x26, 0x80, 0xc4, 0x44, 0x9f, 0xcf, 0xa3, 0x4e, 0x51, 0x01, 0x14, 0x39, 0xf5, 0x1c, 0x04, 0x50, - 0x8c, 0xec, 0xd9, 0x02, 0xe8, 0x1f, 0x25, 0x30, 0x17, 0x81, 0x0b, 0x0b, 0xa0, 0x0c, 0x93, 0x6f, - 0x1e, 0x76, 0x8a, 0x89, 0x92, 0x68, 0xea, 0xfe, 0x97, 0x44, 0x49, 0xe4, 0x55, 0x8e, 0x28, 0xf9, - 0x6d, 0x29, 0xee, 0xfa, 0x29, 0x45, 0xc9, 0x73, 0x78, 0xe1, 0xf8, 0xca, 0xe9, 0x9a, 0xe6, 0x9f, - 0xcb, 0xe0, 0x62, 0x72, 0x1f, 0x4a, 0x05, 0x52, 0x19, 0x59, 0x20, 0xf7, 0xc0, 0xfc, 0x23, 0x4f, - 0xd7, 0x07, 0x3c, 0x86, 0x58, 0x95, 0xf4, 0x4b, 0xeb, 0xff, 0x0b, 0xcb, 0xf9, 0xef, 0x67, 0x60, - 0x50, 0xa6, 0x65, 0xba, 0x5e, 0x56, 0x3e, 0x6f, 0xbd, 0xac, 0x9e, 0xa1, 0x5e, 0x66, 0x4b, 0x8e, - 0xf2, 0x99, 0x24, 0xc7, 0xe9, 0x8a, 0x65, 0xc6, 0xc1, 0x35, 0xf2, 0xea, 0x3f, 0x54, 0xc0, 0x42, - 0xf6, 0x85, 0x1b, 0xea, 0x60, 0xc6, 0xc0, 0x8f, 0xe3, 0x0f, 0x1f, 0xa3, 0x8a, 0x88, 0x47, 0x35, - 0x5d, 0xf5, 0x3f, 0x19, 0xa9, 0xf7, 0x4c, 0xba, 0xeb, 0xec, 0x53, 0x47, 0x33, 0x7b, 0x7e, 0xe5, - 0xdd, 0x96, 0xb8, 0x50, 0x82, 0x1b, 0xbe, 0x0f, 0x6a, 0x06, 0x7e, 0xbc, 0xef, 0x39, 0xbd, 0xac, - 0x0a, 0x59, 0x6c, 0x1c, 0xbe, 0x01, 0xb6, 0x05, 0x0b, 0x0a, 0xf9, 0x9a, 0x9f, 0x2a, 0x60, 0x31, - 0xa7, 0xaa, 0x7e, 0x8d, 0xa2, 0xdc, 0x05, 0x57, 0xa4, 0x20, 0xd9, 0xae, 0x24, 0x8f, 0x3c, 0x9d, - 0x6f, 0x50, 0x21, 0x64, 0xae, 0x81, 0x49, 0x1b, 0x3b, 0x54, 0x0b, 0x65, 0x70, 0xb5, 0x3d, 0x3d, - 0x3c, 0x59, 0x9e, 0xdc, 0x0b, 0x1a, 0x51, 0xd4, 0xdf, 0xfc, 0x8f, 0x02, 0xaa, 0xfb, 0x1d, 0xac, - 0x93, 0x73, 0x50, 0x12, 0x9b, 0x92, 0x92, 0xc8, 0x7f, 0xa5, 0xe7, 0xfe, 0xe4, 0x8a, 0x88, 0xad, - 0x84, 0x88, 0x78, 0x69, 0x04, 0xcf, 0xb3, 0xf5, 0xc3, 0xdb, 0x60, 0x32, 0x1c, 0xee, 0x74, 0x87, - 0x5b, 0xf3, 0x37, 0x25, 0x30, 0x15, 0x1b, 0xe2, 0x94, 0x47, 0xe3, 0x43, 0xa9, 0x1e, 0xb0, 0x4d, - 0xbf, 0x56, 0x24, 0x10, 0x35, 0x38, 0xfb, 0xdf, 0x31, 0xa9, 0x13, 0xbf, 0x3c, 0xa6, 0x4b, 0xc2, - 0x77, 0xc0, 0x0c, 0xc5, 0x4e, 0x8f, 0xd0, 0xa0, 0x8f, 0x4f, 0xd8, 0x64, 0xf4, 0x98, 0x72, 0x5f, - 0xea, 0x45, 0x09, 0xf4, 0xd2, 0x6d, 0x30, 0x2d, 0x0d, 0x06, 0x2f, 0x82, 0xf2, 0x31, 0x19, 0xf8, - 0x92, 0x0a, 0xb1, 0x3f, 0xe1, 0x3c, 0xa8, 0xf6, 0xb1, 0xee, 0xf9, 0x79, 0x3e, 0x89, 0xfc, 0x1f, - 0xb7, 0x4a, 0x6f, 0x29, 0xcd, 0x5f, 0xb2, 0xc9, 0x89, 0x92, 0xf3, 0x1c, 0xb2, 0xeb, 0x5d, 0x29, - 0xbb, 0xf2, 0x3f, 0x18, 0xc6, 0xb7, 0x4c, 0x5e, 0x8e, 0xa1, 0x44, 0x8e, 0xbd, 0x5a, 0x88, 0xed, - 0xd9, 0x99, 0xf6, 0xcf, 0x12, 0x98, 0x8f, 0xa1, 0x23, 0xa9, 0xfa, 0x6d, 0x49, 0xaa, 0xae, 0x24, - 0xa4, 0x6a, 0x3d, 0xcb, 0xe6, 0x1b, 0xad, 0x3a, 0x5a, 0xab, 0xfe, 0x41, 0x01, 0xb3, 0xb1, 0xb9, - 0x3b, 0x07, 0xb1, 0x7a, 0x4f, 0x16, 0xab, 0x2f, 0x15, 0x49, 0x9a, 0x1c, 0xb5, 0xfa, 0x97, 0xaa, - 0xe4, 0xfc, 0xd7, 0xfe, 0x0d, 0xed, 0xa7, 0x60, 0xbe, 0x6f, 0xe9, 0x9e, 0x41, 0x36, 0x74, 0xac, - 0x19, 0x01, 0x80, 0xa9, 0xbb, 0x72, 0xf2, 0x9e, 0x18, 0xd2, 0x13, 0xc7, 0xd5, 0x5c, 0x4a, 0x4c, - 0xfa, 0x20, 0xb2, 0x8c, 0x34, 0xe5, 0x83, 0x0c, 0x3a, 0x94, 0x39, 0x08, 0x7c, 0x03, 0x4c, 0x31, - 0x55, 0xa6, 0x75, 0xc8, 0x0e, 0x36, 0x82, 0xc4, 0x0a, 0x3f, 0x8f, 0xed, 0x47, 0x5d, 0x28, 0x8e, - 0x83, 0x47, 0x60, 0xce, 0xb6, 0xba, 0xdb, 0xd8, 0xc4, 0x3d, 0xc2, 0x64, 0xc6, 0x9e, 0xa5, 0x6b, - 0x9d, 0x01, 0x7f, 0x58, 0x9b, 0x6c, 0xbf, 0x19, 0x3c, 0x9a, 0xec, 0xa5, 0x21, 0xec, 0x02, 0x9a, - 0xd1, 0xcc, 0x37, 0x75, 0x16, 0x25, 0x74, 0x52, 0x9f, 0x74, 0xfd, 0x27, 0xed, 0xb5, 0x22, 0x19, - 0x76, 0xc6, 0x8f, 0xba, 0x79, 0xef, 0x86, 0xb5, 0x33, 0x7d, 0x91, 0xfd, 0x57, 0x05, 0x5c, 0x4a, - 0x1d, 0x95, 0x5f, 0xe2, 0xcb, 0x5d, 0xea, 0x1a, 0x51, 0x3e, 0xc5, 0x35, 0x62, 0x1d, 0xcc, 0x8a, - 0x8f, 0xc1, 0x89, 0x5b, 0x48, 0x78, 0x1b, 0xdc, 0x90, 0xbb, 0x51, 0x12, 0x9f, 0xf5, 0x72, 0x58, - 0x3d, 0xe5, 0xcb, 0x61, 0xdc, 0x0b, 0xf1, 0xcf, 0x4d, 0x7e, 0xea, 0xa5, 0xbd, 0x10, 0xff, 0xe3, - 0x94, 0xc4, 0x33, 0x85, 0xe0, 0xb3, 0x86, 0x0c, 0x13, 0xb2, 0x42, 0x38, 0x90, 0x7a, 0x51, 0x02, - 0xfd, 0xb9, 0x3e, 0x78, 0xe2, 0x8c, 0x0f, 0x9e, 0xab, 0x45, 0xf2, 0xb9, 0xf8, 0xbd, 0xe7, 0xaf, - 0x0a, 0x78, 0x21, 0x77, 0x23, 0xc0, 0x75, 0xa9, 0xec, 0xae, 0x26, 0xca, 0xee, 0xb7, 0x72, 0x0d, - 0x63, 0xb5, 0xd7, 0xc9, 0x7e, 0xf6, 0x7b, 0xbb, 0xd8, 0xb3, 0x5f, 0x86, 0x76, 0x1f, 0xfd, 0xfe, - 0xd7, 0x5e, 0x7d, 0xf2, 0xb4, 0x31, 0xf6, 0xd1, 0xd3, 0xc6, 0xd8, 0x27, 0x4f, 0x1b, 0x63, 0x3f, - 0x1b, 0x36, 0x94, 0x27, 0xc3, 0x86, 0xf2, 0xd1, 0xb0, 0xa1, 0x7c, 0x32, 0x6c, 0x28, 0x7f, 0x1b, - 0x36, 0x94, 0x5f, 0x7d, 0xda, 0x18, 0x7b, 0x7f, 0x42, 0x8c, 0xf8, 0xdf, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xd0, 0xf7, 0x24, 0x13, 0x48, 0x29, 0x00, 0x00, + 0xf9, 0xf6, 0xec, 0x87, 0xb4, 0x4b, 0x59, 0x92, 0x4d, 0xe9, 0x27, 0x6d, 0xec, 0x5f, 0x57, 0xc6, + 0x26, 0x70, 0x94, 0xd8, 0x9a, 0xb5, 0x95, 0x0f, 0x24, 0x76, 0xd1, 0x56, 0x2b, 0xa5, 0xb6, 0x03, + 0x7d, 0x85, 0xb2, 0x0c, 0x34, 0x68, 0x51, 0x53, 0xbb, 0xf4, 0x6a, 0xa2, 0xf9, 0xc2, 0x0c, 0x67, + 0xeb, 0x45, 0x2f, 0xbd, 0x16, 0x28, 0xd0, 0xf4, 0xda, 0x7f, 0xa2, 0xb7, 0xa2, 0x68, 0x6e, 0x45, + 0x50, 0xf8, 0x18, 0xf4, 0x92, 0x9c, 0x84, 0x7a, 0x73, 0x2a, 0x8a, 0x1e, 0x7b, 0x09, 0x50, 0xa0, + 0x20, 0x87, 0xf3, 0xc1, 0xf9, 0xf0, 0x8e, 0x14, 0x47, 0x69, 0x82, 0xdc, 0xb4, 0xe4, 0xf3, 0x3e, + 0x7c, 0x5f, 0xf2, 0x25, 0xdf, 0x87, 0x1c, 0x81, 0x1f, 0x1d, 0xbd, 0xe5, 0xaa, 0x9a, 0xd5, 0x3e, + 0xf2, 0x0e, 0x88, 0x63, 0x12, 0x4a, 0xdc, 0xf6, 0x80, 0x98, 0x3d, 0xcb, 0x69, 0x8b, 0x0e, 0x6c, + 0x6b, 0x6d, 0x6c, 0xdb, 0x6e, 0x7b, 0x70, 0xf3, 0x80, 0x50, 0xbc, 0xda, 0xee, 0x13, 0x93, 0x38, + 0x98, 0x92, 0x9e, 0x6a, 0x3b, 0x16, 0xb5, 0xe0, 0xa2, 0x0f, 0x54, 0xb1, 0xad, 0xa9, 0x0c, 0xa8, + 0x0a, 0xe0, 0xa5, 0x95, 0xbe, 0x46, 0x0f, 0xbd, 0x03, 0xb5, 0x6b, 0x19, 0xed, 0xbe, 0xd5, 0xb7, + 0xda, 0x1c, 0x7f, 0xe0, 0x3d, 0xe2, 0xbf, 0xf8, 0x0f, 0xfe, 0x97, 0xcf, 0x73, 0xa9, 0x15, 0x1b, + 0xb0, 0x6b, 0x39, 0xa4, 0x3d, 0xb8, 0x99, 0x1c, 0xeb, 0xd2, 0xeb, 0x11, 0xc6, 0xc0, 0xdd, 0x43, + 0xcd, 0x24, 0xce, 0xb0, 0x6d, 0x1f, 0xf5, 0x59, 0x83, 0xdb, 0x36, 0x08, 0xc5, 0x59, 0x56, 0xed, + 0x3c, 0x2b, 0xc7, 0x33, 0xa9, 0x66, 0x90, 0x94, 0xc1, 0x9b, 0xe3, 0x0c, 0xdc, 0xee, 0x21, 0x31, + 0x70, 0xca, 0xee, 0xb5, 0x3c, 0x3b, 0x8f, 0x6a, 0x7a, 0x5b, 0x33, 0xa9, 0x4b, 0x9d, 0xa4, 0x51, + 0xeb, 0xdf, 0x0a, 0x80, 0xeb, 0x96, 0x49, 0x1d, 0x4b, 0xd7, 0x89, 0x83, 0xc8, 0x40, 0x73, 0x35, + 0xcb, 0x84, 0x0f, 0x41, 0x8d, 0xc5, 0xd3, 0xc3, 0x14, 0x37, 0x94, 0x2b, 0xca, 0xf2, 0xd4, 0xea, + 0x0d, 0x35, 0x9a, 0xe9, 0x90, 0x5e, 0xb5, 0x8f, 0xfa, 0xac, 0xc1, 0x55, 0x19, 0x5a, 0x1d, 0xdc, + 0x54, 0x77, 0x0e, 0x3e, 0x20, 0x5d, 0xba, 0x45, 0x28, 0xee, 0xc0, 0x27, 0xc7, 0x4b, 0xe7, 0x46, + 0xc7, 0x4b, 0x20, 0x6a, 0x43, 0x21, 0x2b, 0xdc, 0x01, 0x15, 0xce, 0x5e, 0xe2, 0xec, 0x2b, 0xb9, + 0xec, 0x22, 0x68, 0x15, 0xe1, 0x5f, 0xbc, 0xf3, 0x98, 0x12, 0x93, 0xb9, 0xd7, 0x39, 0x2f, 0xa8, + 0x2b, 0x1b, 0x98, 0x62, 0xc4, 0x89, 0xe0, 0x75, 0x50, 0x73, 0x84, 0xfb, 0x8d, 0xf2, 0x15, 0x65, + 0xb9, 0xdc, 0xb9, 0x20, 0x50, 0xb5, 0x20, 0x2c, 0x14, 0x22, 0x5a, 0x4f, 0x14, 0xb0, 0x90, 0x8e, + 0x7b, 0x53, 0x73, 0x29, 0xfc, 0x69, 0x2a, 0x76, 0xb5, 0x58, 0xec, 0xcc, 0x9a, 0x47, 0x1e, 0x0e, + 0x1c, 0xb4, 0xc4, 0xe2, 0xde, 0x05, 0x55, 0x8d, 0x12, 0xc3, 0x6d, 0x94, 0xae, 0x94, 0x97, 0xa7, + 0x56, 0xaf, 0xa9, 0x39, 0x09, 0xac, 0xa6, 0xbd, 0xeb, 0x4c, 0x0b, 0xde, 0xea, 0x3d, 0xc6, 0x80, + 0x7c, 0xa2, 0xd6, 0xaf, 0x4b, 0xa0, 0xbe, 0x81, 0x89, 0x61, 0x99, 0x7b, 0x84, 0x9e, 0xc1, 0xca, + 0xdd, 0x05, 0x15, 0xd7, 0x26, 0x5d, 0xb1, 0x72, 0x57, 0x73, 0x03, 0x08, 0x7d, 0xda, 0xb3, 0x49, + 0x37, 0x5a, 0x32, 0xf6, 0x0b, 0x71, 0x06, 0xb8, 0x0b, 0x26, 0x5c, 0x8a, 0xa9, 0xe7, 0xf2, 0x05, + 0x9b, 0x5a, 0x5d, 0x2e, 0xc0, 0xc5, 0xf1, 0x9d, 0x19, 0xc1, 0x36, 0xe1, 0xff, 0x46, 0x82, 0xa7, + 0xf5, 0x8f, 0x12, 0x80, 0x21, 0x76, 0xdd, 0x32, 0x7b, 0x1a, 0x65, 0xe9, 0x7c, 0x0b, 0x54, 0xe8, + 0xd0, 0x26, 0x7c, 0x42, 0xea, 0x9d, 0xab, 0x81, 0x2b, 0xf7, 0x87, 0x36, 0xf9, 0xe2, 0x78, 0x69, + 0x21, 0x6d, 0xc1, 0x7a, 0x10, 0xb7, 0x81, 0x9b, 0xa1, 0x93, 0x25, 0x6e, 0xfd, 0xba, 0x3c, 0xf4, + 0x17, 0xc7, 0x4b, 0x19, 0x67, 0x87, 0x1a, 0x32, 0xc9, 0x0e, 0xc2, 0x01, 0x80, 0x3a, 0x76, 0xe9, + 0x7d, 0x07, 0x9b, 0xae, 0x3f, 0x92, 0x66, 0x10, 0x11, 0xfe, 0xab, 0xc5, 0x16, 0x8a, 0x59, 0x74, + 0x2e, 0x09, 0x2f, 0xe0, 0x66, 0x8a, 0x0d, 0x65, 0x8c, 0x00, 0xaf, 0x82, 0x09, 0x87, 0x60, 0xd7, + 0x32, 0x1b, 0x15, 0x1e, 0x45, 0x38, 0x81, 0x88, 0xb7, 0x22, 0xd1, 0x0b, 0x5f, 0x01, 0x93, 0x06, + 0x71, 0x5d, 0xdc, 0x27, 0x8d, 0x2a, 0x07, 0xce, 0x0a, 0xe0, 0xe4, 0x96, 0xdf, 0x8c, 0x82, 0xfe, + 0xd6, 0x1f, 0x15, 0x30, 0x1d, 0xce, 0xdc, 0x19, 0xec, 0x9c, 0x3b, 0xf2, 0xce, 0x69, 0x8d, 0x4f, + 0x96, 0x9c, 0x0d, 0xf3, 0x71, 0x39, 0xe6, 0x38, 0x4b, 0x47, 0xf8, 0x33, 0x50, 0x73, 0x89, 0x4e, + 0xba, 0xd4, 0x72, 0x84, 0xe3, 0xaf, 0x15, 0x74, 0x1c, 0x1f, 0x10, 0x7d, 0x4f, 0x98, 0x76, 0xce, + 0x33, 0xcf, 0x83, 0x5f, 0x28, 0xa4, 0x84, 0xef, 0x81, 0x1a, 0x25, 0x86, 0xad, 0x63, 0x4a, 0xc4, + 0xae, 0x79, 0x31, 0xee, 0x3c, 0xcb, 0x19, 0x46, 0xb6, 0x6b, 0xf5, 0xee, 0x0b, 0x18, 0xdf, 0x32, + 0xe1, 0x64, 0x04, 0xad, 0x28, 0xa4, 0x81, 0x36, 0x98, 0xf1, 0xec, 0x1e, 0x43, 0x52, 0x76, 0x9c, + 0xf7, 0x87, 0x22, 0x87, 0x6e, 0x8c, 0x9f, 0x95, 0x7d, 0xc9, 0xae, 0xb3, 0x20, 0x46, 0x99, 0x91, + 0xdb, 0x51, 0x82, 0x1f, 0xae, 0x81, 0x59, 0x43, 0x33, 0x11, 0xc1, 0xbd, 0xe1, 0x1e, 0xe9, 0x5a, + 0x66, 0xcf, 0xe5, 0xa9, 0x54, 0xed, 0x2c, 0x0a, 0x82, 0xd9, 0x2d, 0xb9, 0x1b, 0x25, 0xf1, 0x70, + 0x13, 0xcc, 0x07, 0x07, 0xf0, 0x5d, 0xcd, 0xa5, 0x96, 0x33, 0xdc, 0xd4, 0x0c, 0x8d, 0x36, 0x26, + 0x38, 0x4f, 0x63, 0x74, 0xbc, 0x34, 0x8f, 0x32, 0xfa, 0x51, 0xa6, 0x55, 0xeb, 0x77, 0x13, 0x60, + 0x36, 0x71, 0x2e, 0xc0, 0x07, 0x60, 0xa1, 0xeb, 0x39, 0x0e, 0x31, 0xe9, 0xb6, 0x67, 0x1c, 0x10, + 0x67, 0xaf, 0x7b, 0x48, 0x7a, 0x9e, 0x4e, 0x7a, 0x7c, 0x59, 0xab, 0x9d, 0xa6, 0xf0, 0x75, 0x61, + 0x3d, 0x13, 0x85, 0x72, 0xac, 0xe1, 0xbb, 0x00, 0x9a, 0xbc, 0x69, 0x4b, 0x73, 0xdd, 0x90, 0xb3, + 0xc4, 0x39, 0xc3, 0xad, 0xb8, 0x9d, 0x42, 0xa0, 0x0c, 0x2b, 0xe6, 0x63, 0x8f, 0xb8, 0x9a, 0x43, + 0x7a, 0x49, 0x1f, 0xcb, 0xb2, 0x8f, 0x1b, 0x99, 0x28, 0x94, 0x63, 0x0d, 0xdf, 0x00, 0x53, 0xfe, + 0x68, 0x7c, 0xce, 0xc5, 0xe2, 0xcc, 0x09, 0xb2, 0xa9, 0xed, 0xa8, 0x0b, 0xc5, 0x71, 0x2c, 0x34, + 0xeb, 0xc0, 0x25, 0xce, 0x80, 0xf4, 0xee, 0xf8, 0xe2, 0x80, 0x55, 0xd0, 0x2a, 0xaf, 0xa0, 0x61, + 0x68, 0x3b, 0x29, 0x04, 0xca, 0xb0, 0x62, 0xa1, 0xf9, 0x59, 0x93, 0x0a, 0x6d, 0x42, 0x0e, 0x6d, + 0x3f, 0x13, 0x85, 0x72, 0xac, 0x59, 0xee, 0xf9, 0x2e, 0xaf, 0x0d, 0xb0, 0xa6, 0xe3, 0x03, 0x9d, + 0x34, 0x26, 0xe5, 0xdc, 0xdb, 0x96, 0xbb, 0x51, 0x12, 0x0f, 0xef, 0x80, 0x8b, 0x7e, 0xd3, 0xbe, + 0x89, 0x43, 0x92, 0x1a, 0x27, 0x79, 0x41, 0x90, 0x5c, 0xdc, 0x4e, 0x02, 0x50, 0xda, 0x06, 0xde, + 0x02, 0x33, 0x5d, 0x4b, 0xd7, 0x79, 0x3e, 0xae, 0x5b, 0x9e, 0x49, 0x1b, 0x75, 0xce, 0x02, 0xd9, + 0x1e, 0x5a, 0x97, 0x7a, 0x50, 0x02, 0x09, 0x7f, 0x0e, 0x40, 0x37, 0x28, 0x0c, 0x6e, 0x03, 0x8c, + 0x51, 0x00, 0xe9, 0xb2, 0x14, 0x55, 0xe6, 0xb0, 0xc9, 0x45, 0x31, 0xca, 0xd6, 0xc7, 0x0a, 0x58, + 0xcc, 0xd9, 0xe8, 0xf0, 0x87, 0x52, 0x11, 0xbc, 0x96, 0x28, 0x82, 0x97, 0x73, 0xcc, 0x62, 0x95, + 0xf0, 0x10, 0x4c, 0x33, 0x41, 0xa2, 0x99, 0x7d, 0x1f, 0x22, 0xce, 0xb2, 0x76, 0x6e, 0x00, 0x28, + 0x8e, 0x8e, 0x4e, 0xe5, 0x8b, 0xa3, 0xe3, 0xa5, 0x69, 0xa9, 0x0f, 0xc9, 0xc4, 0xad, 0xdf, 0x94, + 0x00, 0xd8, 0x20, 0xb6, 0x6e, 0x0d, 0x0d, 0x62, 0x9e, 0x85, 0xa6, 0xb9, 0x27, 0x69, 0x9a, 0x97, + 0xf3, 0x97, 0x24, 0x74, 0x2a, 0x57, 0xd4, 0xbc, 0x97, 0x10, 0x35, 0xaf, 0x14, 0x21, 0x7b, 0xb6, + 0xaa, 0xf9, 0xb4, 0x0c, 0xe6, 0x22, 0x70, 0x24, 0x6b, 0x6e, 0x4b, 0x2b, 0xfa, 0x72, 0x62, 0x45, + 0x17, 0x33, 0x4c, 0xbe, 0x32, 0x5d, 0xf3, 0x01, 0x98, 0x61, 0xaa, 0xc3, 0x5f, 0x3f, 0xae, 0x69, + 0x26, 0x4e, 0xac, 0x69, 0xc2, 0x4a, 0xb4, 0x29, 0x31, 0xa1, 0x04, 0x73, 0x8e, 0x86, 0x9a, 0xfc, + 0x26, 0x6a, 0xa8, 0x3f, 0x29, 0x60, 0x26, 0x5a, 0xa6, 0x33, 0x10, 0x51, 0x77, 0x65, 0x11, 0xf5, + 0x62, 0x81, 0xe4, 0xcc, 0x51, 0x51, 0x9f, 0x56, 0xe2, 0xae, 0x73, 0x19, 0xb5, 0xcc, 0xae, 0x60, + 0xb6, 0xae, 0x75, 0xb1, 0x2b, 0xea, 0xed, 0x79, 0xff, 0xfa, 0xe5, 0xb7, 0xa1, 0xb0, 0x57, 0x12, + 0x5c, 0xa5, 0xaf, 0x56, 0x70, 0x95, 0x9f, 0x8f, 0xe0, 0xfa, 0x09, 0xa8, 0xb9, 0x81, 0xd4, 0xaa, + 0x70, 0xca, 0x6b, 0x85, 0x36, 0xb6, 0x50, 0x59, 0x21, 0x75, 0xa8, 0xaf, 0x42, 0xba, 0x2c, 0x65, + 0x55, 0xfd, 0x3a, 0x95, 0x15, 0x4b, 0x74, 0x1b, 0x7b, 0x2e, 0xe9, 0xf1, 0x4d, 0x55, 0x8b, 0x12, + 0x7d, 0x97, 0xb7, 0x22, 0xd1, 0x0b, 0xf7, 0xc1, 0xa2, 0xed, 0x58, 0x7d, 0x87, 0xb8, 0xee, 0x06, + 0xc1, 0x3d, 0x5d, 0x33, 0x49, 0x10, 0x80, 0x5f, 0x13, 0x2f, 0x8f, 0x8e, 0x97, 0x16, 0x77, 0xb3, + 0x21, 0x28, 0xcf, 0xb6, 0xf5, 0x97, 0x0a, 0xb8, 0x90, 0x3c, 0x1b, 0x73, 0x64, 0x8a, 0x72, 0x2a, + 0x99, 0x72, 0x3d, 0x96, 0xa7, 0xbe, 0x86, 0x8b, 0x3d, 0x15, 0xa4, 0x72, 0x75, 0x0d, 0xcc, 0x0a, + 0x59, 0x12, 0x74, 0x0a, 0xa1, 0x16, 0x2e, 0xcf, 0xbe, 0xdc, 0x8d, 0x92, 0x78, 0x78, 0x1b, 0x4c, + 0x3b, 0x5c, 0x79, 0x05, 0x04, 0xbe, 0x7a, 0xf9, 0x3f, 0x41, 0x30, 0x8d, 0xe2, 0x9d, 0x48, 0xc6, + 0x32, 0xe5, 0x12, 0x09, 0x92, 0x80, 0xa0, 0x22, 0x2b, 0x97, 0xb5, 0x24, 0x00, 0xa5, 0x6d, 0xe0, + 0x16, 0x98, 0xf3, 0xcc, 0x34, 0x95, 0x9f, 0x6b, 0x97, 0x05, 0xd5, 0xdc, 0x7e, 0x1a, 0x82, 0xb2, + 0xec, 0xe0, 0x43, 0x49, 0xcc, 0x4c, 0xf0, 0xf3, 0xe4, 0x7a, 0x81, 0x3d, 0x51, 0x58, 0xcd, 0x64, + 0x48, 0xad, 0x5a, 0x51, 0xa9, 0xd5, 0xfa, 0x48, 0x01, 0x30, 0xbd, 0x0f, 0xc7, 0xbe, 0x04, 0xa4, + 0x2c, 0x62, 0x15, 0x53, 0xcb, 0xd6, 0x3f, 0x37, 0x0a, 0xea, 0x9f, 0xe8, 0x40, 0x2d, 0x26, 0x80, + 0xc4, 0x44, 0x9f, 0xcd, 0xa3, 0x4e, 0x51, 0x01, 0x14, 0x39, 0xf5, 0x1c, 0x04, 0x50, 0x8c, 0xec, + 0xd9, 0x02, 0xe8, 0x9f, 0x25, 0x30, 0x17, 0x81, 0x0b, 0x0b, 0xa0, 0x0c, 0x93, 0xef, 0x1e, 0x76, + 0x8a, 0x89, 0x92, 0x68, 0xea, 0xfe, 0x97, 0x44, 0x49, 0xe4, 0x55, 0x8e, 0x28, 0xf9, 0x43, 0x29, + 0xee, 0xfa, 0x09, 0x45, 0xc9, 0x73, 0x78, 0xe1, 0xf8, 0xc6, 0xe9, 0x9a, 0xd6, 0x5f, 0xcb, 0xe0, + 0x42, 0x72, 0x1f, 0x4a, 0x05, 0x52, 0x19, 0x5b, 0x20, 0x77, 0xc1, 0xfc, 0x23, 0x4f, 0xd7, 0x87, + 0x3c, 0x86, 0x58, 0x95, 0xf4, 0x4b, 0xeb, 0xff, 0x0b, 0xcb, 0xf9, 0x1f, 0x67, 0x60, 0x50, 0xa6, + 0x65, 0xba, 0x5e, 0x56, 0xbe, 0x6c, 0xbd, 0xac, 0x9e, 0xa2, 0x5e, 0x66, 0x4b, 0x8e, 0xf2, 0xa9, + 0x24, 0xc7, 0xc9, 0x8a, 0x65, 0xc6, 0xc1, 0x35, 0xf6, 0xea, 0x3f, 0x52, 0xc0, 0x42, 0xf6, 0x85, + 0x1b, 0xea, 0x60, 0xc6, 0xc0, 0x8f, 0xe3, 0x0f, 0x1f, 0xe3, 0x8a, 0x88, 0x47, 0x35, 0x5d, 0xf5, + 0x3f, 0x19, 0xa9, 0xf7, 0x4c, 0xba, 0xe3, 0xec, 0x51, 0x47, 0x33, 0xfb, 0x7e, 0xe5, 0xdd, 0x92, + 0xb8, 0x50, 0x82, 0x1b, 0xbe, 0x0f, 0x6a, 0x06, 0x7e, 0xbc, 0xe7, 0x39, 0xfd, 0xac, 0x0a, 0x59, + 0x6c, 0x1c, 0xbe, 0x01, 0xb6, 0x04, 0x0b, 0x0a, 0xf9, 0x5a, 0x9f, 0x2b, 0x60, 0x31, 0xa7, 0xaa, + 0x7e, 0x8b, 0xa2, 0xdc, 0x01, 0x57, 0xa4, 0x20, 0xd9, 0xae, 0x24, 0x8f, 0x3c, 0x9d, 0x6f, 0x50, + 0x21, 0x64, 0xae, 0x81, 0xba, 0x8d, 0x1d, 0xaa, 0x85, 0x32, 0xb8, 0xda, 0x99, 0x1e, 0x1d, 0x2f, + 0xd5, 0x77, 0x83, 0x46, 0x14, 0xf5, 0xb7, 0xfe, 0xa3, 0x80, 0xea, 0x5e, 0x17, 0xeb, 0xe4, 0x0c, + 0x94, 0xc4, 0x86, 0xa4, 0x24, 0xf2, 0x5f, 0xe9, 0xb9, 0x3f, 0xb9, 0x22, 0x62, 0x33, 0x21, 0x22, + 0x5e, 0x1a, 0xc3, 0xf3, 0x6c, 0xfd, 0xf0, 0x36, 0xa8, 0x87, 0xc3, 0x9d, 0xec, 0x70, 0x6b, 0xfd, + 0xbe, 0x04, 0xa6, 0x62, 0x43, 0x9c, 0xf0, 0x68, 0x7c, 0x28, 0xd5, 0x03, 0xb6, 0xe9, 0x57, 0x8b, + 0x04, 0xa2, 0x06, 0x67, 0xff, 0x3b, 0x26, 0x75, 0xe2, 0x97, 0xc7, 0x74, 0x49, 0xf8, 0x01, 0x98, + 0xa1, 0xd8, 0xe9, 0x13, 0x1a, 0xf4, 0xf1, 0x09, 0xab, 0x47, 0x8f, 0x29, 0xf7, 0xa5, 0x5e, 0x94, + 0x40, 0x5f, 0xba, 0x0d, 0xa6, 0xa5, 0xc1, 0xe0, 0x05, 0x50, 0x3e, 0x22, 0x43, 0x5f, 0x52, 0x21, + 0xf6, 0x27, 0x9c, 0x07, 0xd5, 0x01, 0xd6, 0x3d, 0x3f, 0xcf, 0xeb, 0xc8, 0xff, 0x71, 0xab, 0xf4, + 0x96, 0xd2, 0xfa, 0x2d, 0x9b, 0x9c, 0x28, 0x39, 0xcf, 0x20, 0xbb, 0xde, 0x95, 0xb2, 0x2b, 0xff, + 0x83, 0x61, 0x7c, 0xcb, 0xe4, 0xe5, 0x18, 0x4a, 0xe4, 0xd8, 0xab, 0x85, 0xd8, 0x9e, 0x9d, 0x69, + 0xff, 0x2a, 0x81, 0xf9, 0x18, 0x3a, 0x92, 0xaa, 0xdf, 0x97, 0xa4, 0xea, 0x72, 0x42, 0xaa, 0x36, + 0xb2, 0x6c, 0xbe, 0xd3, 0xaa, 0xe3, 0xb5, 0xea, 0x9f, 0x15, 0x30, 0x1b, 0x9b, 0xbb, 0x33, 0x10, + 0xab, 0xf7, 0x64, 0xb1, 0xfa, 0x52, 0x91, 0xa4, 0xc9, 0x51, 0xab, 0x1f, 0x4e, 0x48, 0xce, 0x7f, + 0xeb, 0xdf, 0xd0, 0x7e, 0x09, 0xe6, 0x07, 0x96, 0xee, 0x19, 0x64, 0x5d, 0xc7, 0x9a, 0x11, 0x00, + 0x98, 0xba, 0x2b, 0x27, 0xef, 0x89, 0x21, 0x3d, 0x71, 0x5c, 0xcd, 0xa5, 0xc4, 0xa4, 0x0f, 0x22, + 0xcb, 0x48, 0x53, 0x3e, 0xc8, 0xa0, 0x43, 0x99, 0x83, 0xc0, 0x37, 0xc0, 0x14, 0x53, 0x65, 0x5a, + 0x97, 0x6c, 0x63, 0x23, 0x48, 0xac, 0xf0, 0xf3, 0xd8, 0x5e, 0xd4, 0x85, 0xe2, 0x38, 0x78, 0x08, + 0xe6, 0x6c, 0xab, 0xb7, 0x85, 0x4d, 0xdc, 0x27, 0x4c, 0x66, 0xec, 0x5a, 0xba, 0xd6, 0x1d, 0xf2, + 0x87, 0xb5, 0x7a, 0xe7, 0xcd, 0xe0, 0xd1, 0x64, 0x37, 0x0d, 0x61, 0x17, 0xd0, 0x8c, 0x66, 0xbe, + 0xa9, 0xb3, 0x28, 0xa1, 0x93, 0xfa, 0xa4, 0xeb, 0x3f, 0x69, 0xaf, 0x16, 0xc9, 0xb0, 0x53, 0x7e, + 0xd4, 0xcd, 0x7b, 0x37, 0xac, 0x9d, 0xea, 0xdd, 0x30, 0xe3, 0x02, 0x55, 0x3f, 0xd9, 0x05, 0xaa, + 0xf5, 0x51, 0x15, 0x5c, 0x4c, 0x9d, 0xb6, 0x5f, 0xe3, 0xe3, 0x5f, 0xea, 0x26, 0x52, 0x3e, 0xc1, + 0x4d, 0x64, 0x0d, 0xcc, 0x8a, 0xef, 0xc9, 0x89, 0x8b, 0x4c, 0x38, 0x1f, 0xeb, 0x72, 0x37, 0x4a, + 0xe2, 0xb3, 0x1e, 0x1f, 0xab, 0x27, 0x7c, 0x7c, 0x8c, 0x7b, 0x21, 0xfe, 0x3f, 0xca, 0xcf, 0xde, + 0xb4, 0x17, 0xe2, 0xdf, 0xa4, 0x92, 0x78, 0x26, 0x32, 0x7c, 0xd6, 0x90, 0x61, 0x52, 0x16, 0x19, + 0xfb, 0x52, 0x2f, 0x4a, 0xa0, 0xbf, 0xd4, 0x37, 0x53, 0x9c, 0xf1, 0xcd, 0x74, 0xa5, 0xc8, 0x96, + 0x28, 0xfe, 0xce, 0x98, 0x79, 0x63, 0x9c, 0x3a, 0xf9, 0x8d, 0xb1, 0xf5, 0x37, 0x05, 0xbc, 0x90, + 0xbb, 0x29, 0xe1, 0x9a, 0x24, 0x01, 0x56, 0x12, 0x12, 0xe0, 0x7b, 0xb9, 0x86, 0x31, 0x1d, 0xe0, + 0x64, 0x3f, 0x41, 0xbe, 0x5d, 0xec, 0x09, 0x32, 0xe3, 0x1e, 0x31, 0xfe, 0x2d, 0xb2, 0xb3, 0xf2, + 0xe4, 0x69, 0xf3, 0xdc, 0x27, 0x4f, 0x9b, 0xe7, 0x3e, 0x7b, 0xda, 0x3c, 0xf7, 0xab, 0x51, 0x53, + 0x79, 0x32, 0x6a, 0x2a, 0x9f, 0x8c, 0x9a, 0xca, 0x67, 0xa3, 0xa6, 0xf2, 0xf7, 0x51, 0x53, 0xf9, + 0xf0, 0xf3, 0xe6, 0xb9, 0xf7, 0x27, 0xc5, 0x88, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xda, 0x5d, + 0xee, 0xc9, 0xd4, 0x29, 0x00, 0x00, } func (m *ControllerRevision) Marshal() (dAtA []byte, err error) { @@ -2542,6 +2543,9 @@ func (m *StatefulSetSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.MinReadySeconds)) + i-- + dAtA[i] = 0x48 if m.RevisionHistoryLimit != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.RevisionHistoryLimit)) i-- @@ -2631,6 +2635,9 @@ func (m *StatefulSetStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.AvailableReplicas)) + i-- + dAtA[i] = 0x58 if len(m.Conditions) > 0 { for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { { @@ -3255,6 +3262,7 @@ func (m *StatefulSetSpec) Size() (n int) { if m.RevisionHistoryLimit != nil { n += 1 + sovGenerated(uint64(*m.RevisionHistoryLimit)) } + n += 1 + sovGenerated(uint64(m.MinReadySeconds)) return n } @@ -3282,6 +3290,7 @@ func (m *StatefulSetStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + n += 1 + sovGenerated(uint64(m.AvailableReplicas)) return n } @@ -3729,6 +3738,7 @@ func (this *StatefulSetSpec) String() string { `PodManagementPolicy:` + fmt.Sprintf("%v", this.PodManagementPolicy) + `,`, `UpdateStrategy:` + strings.Replace(strings.Replace(this.UpdateStrategy.String(), "StatefulSetUpdateStrategy", "StatefulSetUpdateStrategy", 1), `&`, ``, 1) + `,`, `RevisionHistoryLimit:` + valueToStringGenerated(this.RevisionHistoryLimit) + `,`, + `MinReadySeconds:` + fmt.Sprintf("%v", this.MinReadySeconds) + `,`, `}`, }, "") return s @@ -3752,6 +3762,7 @@ func (this *StatefulSetStatus) String() string { `UpdateRevision:` + fmt.Sprintf("%v", this.UpdateRevision) + `,`, `CollisionCount:` + valueToStringGenerated(this.CollisionCount) + `,`, `Conditions:` + repeatedStringForConditions + `,`, + `AvailableReplicas:` + fmt.Sprintf("%v", this.AvailableReplicas) + `,`, `}`, }, "") return s @@ -8486,6 +8497,25 @@ func (m *StatefulSetSpec) Unmarshal(dAtA []byte) error { } } m.RevisionHistoryLimit = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinReadySeconds", wireType) + } + m.MinReadySeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinReadySeconds |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -8749,6 +8779,25 @@ func (m *StatefulSetStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AvailableReplicas", wireType) + } + m.AvailableReplicas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AvailableReplicas |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.proto index 8940f6426907..e22d9e281f8a 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/generated.proto @@ -519,7 +519,7 @@ message RollingUpdateDaemonSet { // daemonset on any given node can double if the readiness check fails, and // so resource intensive daemonsets should take into account that they may // cause evictions during disruption. - // This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate. + // This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate. // +optional optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2; } @@ -715,6 +715,13 @@ message StatefulSetSpec { // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. optional int32 revisionHistoryLimit = 8; + + // Minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // +optional + optional int32 minReadySeconds = 9; } // StatefulSetStatus represents the current state of a StatefulSet. @@ -757,6 +764,12 @@ message StatefulSetStatus { // +patchMergeKey=type // +patchStrategy=merge repeated StatefulSetCondition conditions = 10; + + // Total number of available pods (ready for at least minReadySeconds) targeted by this StatefulSet. + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // Remove omitempty when graduating to beta + // +optional + optional int32 availableReplicas = 11; } // StatefulSetUpdateStrategy indicates the strategy that the StatefulSet diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types.go index be3744ef04c6..709ba9dded4e 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types.go @@ -228,6 +228,13 @@ type StatefulSetSpec struct { // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,8,opt,name=revisionHistoryLimit"` + + // Minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // +optional + MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,9,opt,name=minReadySeconds"` } // StatefulSetStatus represents the current state of a StatefulSet. @@ -270,6 +277,12 @@ type StatefulSetStatus struct { // +patchMergeKey=type // +patchStrategy=merge Conditions []StatefulSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,10,rep,name=conditions"` + + // Total number of available pods (ready for at least minReadySeconds) targeted by this StatefulSet. + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // Remove omitempty when graduating to beta + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,11,opt,name=availableReplicas"` } type StatefulSetConditionType string @@ -588,7 +601,7 @@ type RollingUpdateDaemonSet struct { // daemonset on any given node can double if the readiness check fails, and // so resource intensive daemonsets should take into account that they may // cause evictions during disruption. - // This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate. + // This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate. // +optional MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"` } diff --git a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go index 51d552234843..29c840615346 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go @@ -263,7 +263,7 @@ func (ReplicaSetStatus) SwaggerDoc() map[string]string { var map_RollingUpdateDaemonSet = map[string]string{ "": "Spec to control the desired behavior of daemon set rolling update.", "maxUnavailable": "The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding down to a minimum of one. This cannot be 0 if MaxSurge is 0 Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update.", - "maxSurge": "The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption. This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate.", + "maxSurge": "The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption. This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate.", } func (RollingUpdateDaemonSet) SwaggerDoc() map[string]string { @@ -361,6 +361,7 @@ var map_StatefulSetSpec = map[string]string{ "podManagementPolicy": "podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.", "updateStrategy": "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.", "revisionHistoryLimit": "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.", + "minReadySeconds": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate.", } func (StatefulSetSpec) SwaggerDoc() map[string]string { @@ -378,6 +379,7 @@ var map_StatefulSetStatus = map[string]string{ "updateRevision": "updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)", "collisionCount": "collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision.", "conditions": "Represents the latest available observations of a statefulset's current state.", + "availableReplicas": "Total number of available pods (ready for at least minReadySeconds) targeted by this StatefulSet. This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. Remove omitempty when graduating to beta", } func (StatefulSetStatus) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/generated.proto index c91fd92a5719..8f928be408f0 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/generated.proto @@ -58,11 +58,15 @@ message ExtraValue { // TokenRequest requests a token for a given service account. message TokenRequest { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + // Spec holds information about the request being evaluated optional TokenRequestSpec spec = 2; + // Status is filled in by the server and indicates whether the token can be authenticated. // +optional optional TokenRequestStatus status = 3; } @@ -105,6 +109,8 @@ message TokenRequestStatus { // Note: TokenReview requests may be cached by the webhook token authenticator // plugin in the kube-apiserver. message TokenReview { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; diff --git a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/types.go index 6f5f0ad1a308..a2b65d2830e4 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/types.go @@ -48,6 +48,8 @@ const ( // plugin in the kube-apiserver. type TokenReview struct { metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -130,10 +132,15 @@ func (t ExtraValue) String() string { // TokenRequest requests a token for a given service account. type TokenRequest struct { metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // Spec holds information about the request being evaluated Spec TokenRequestSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // Status is filled in by the server and indicates whether the token can be authenticated. // +optional Status TokenRequestStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } diff --git a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go index 09f6b920fd8d..f9a88a3df25c 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go @@ -40,7 +40,10 @@ func (BoundObjectReference) SwaggerDoc() map[string]string { } var map_TokenRequest = map[string]string{ - "": "TokenRequest requests a token for a given service account.", + "": "TokenRequest requests a token for a given service account.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated", + "status": "Status is filled in by the server and indicates whether the token can be authenticated.", } func (TokenRequest) SwaggerDoc() map[string]string { @@ -69,9 +72,10 @@ func (TokenRequestStatus) SwaggerDoc() map[string]string { } var map_TokenReview = map[string]string{ - "": "TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.", - "spec": "Spec holds information about the request being evaluated", - "status": "Status is filled in by the server and indicates whether the request can be authenticated.", + "": "TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated", + "status": "Status is filled in by the server and indicates whether the request can be authenticated.", } func (TokenReview) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/generated.proto index d3bff49eb57e..67a32b320e65 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/generated.proto @@ -41,13 +41,15 @@ message ExtraValue { // Note: TokenReview requests may be cached by the webhook token authenticator // plugin in the kube-apiserver. message TokenReview { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec holds information about the request being evaluated optional TokenReviewSpec spec = 2; - // Status is filled in by the server and indicates whether the request can be authenticated. + // Status is filled in by the server and indicates whether the token can be authenticated. // +optional optional TokenReviewStatus status = 3; } diff --git a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/types.go index 121b3461811b..08e1e09b640a 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/types.go @@ -35,13 +35,15 @@ import ( // plugin in the kube-apiserver. type TokenReview struct { metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec holds information about the request being evaluated Spec TokenReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - // Status is filled in by the server and indicates whether the request can be authenticated. + // Status is filled in by the server and indicates whether the token can be authenticated. // +optional Status TokenReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } diff --git a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/types_swagger_doc_generated.go index 8c9acfb5b249..1086955c3a87 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/authentication/v1beta1/types_swagger_doc_generated.go @@ -28,9 +28,10 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_TokenReview = map[string]string{ - "": "TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.", - "spec": "Spec holds information about the request being evaluated", - "status": "Status is filled in by the server and indicates whether the request can be authenticated.", + "": "TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated", + "status": "Status is filled in by the server and indicates whether the token can be authenticated.", } func (TokenReview) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/generated.proto index 931b0f4995e0..0170ee11fd62 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/generated.proto @@ -41,6 +41,8 @@ message ExtraValue { // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions // checking. message LocalSubjectAccessReview { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -134,6 +136,8 @@ message ResourceRule { // spec.namespace means "in all namespaces". Self is a special case, because users should always be able // to check whether they can perform an action message SelfSubjectAccessReview { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -164,6 +168,8 @@ message SelfSubjectAccessReviewSpec { // drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. message SelfSubjectRulesReview { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -175,6 +181,7 @@ message SelfSubjectRulesReview { optional SubjectRulesReviewStatus status = 3; } +// SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview. message SelfSubjectRulesReviewSpec { // Namespace to evaluate rules for. Required. optional string namespace = 1; @@ -182,6 +189,8 @@ message SelfSubjectRulesReviewSpec { // SubjectAccessReview checks whether or not a user or group can perform an action. message SubjectAccessReview { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; diff --git a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/types.go index be8913eb4f0a..d1fe483f9649 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/types.go @@ -30,6 +30,8 @@ import ( // SubjectAccessReview checks whether or not a user or group can perform an action. type SubjectAccessReview struct { metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -51,6 +53,8 @@ type SubjectAccessReview struct { // to check whether they can perform an action type SelfSubjectAccessReview struct { metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -71,6 +75,8 @@ type SelfSubjectAccessReview struct { // checking. type LocalSubjectAccessReview struct { metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -200,6 +206,8 @@ type SubjectAccessReviewStatus struct { // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. type SelfSubjectRulesReview struct { metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -211,6 +219,7 @@ type SelfSubjectRulesReview struct { Status SubjectRulesReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview. type SelfSubjectRulesReviewSpec struct { // Namespace to evaluate rules for. Required. Namespace string `json:"namespace,omitempty" protobuf:"bytes,1,opt,name=namespace"` diff --git a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go index 8445f71164ab..2e5fbea7ad64 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go @@ -28,9 +28,10 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_LocalSubjectAccessReview = map[string]string{ - "": "LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.", - "spec": "Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.", - "status": "Status is filled in by the server and indicates whether the request is allowed or not", + "": "LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.", + "status": "Status is filled in by the server and indicates whether the request is allowed or not", } func (LocalSubjectAccessReview) SwaggerDoc() map[string]string { @@ -85,9 +86,10 @@ func (ResourceRule) SwaggerDoc() map[string]string { } var map_SelfSubjectAccessReview = map[string]string{ - "": "SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \"in all namespaces\". Self is a special case, because users should always be able to check whether they can perform an action", - "spec": "Spec holds information about the request being evaluated. user and groups must be empty", - "status": "Status is filled in by the server and indicates whether the request is allowed or not", + "": "SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \"in all namespaces\". Self is a special case, because users should always be able to check whether they can perform an action", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated. user and groups must be empty", + "status": "Status is filled in by the server and indicates whether the request is allowed or not", } func (SelfSubjectAccessReview) SwaggerDoc() map[string]string { @@ -105,9 +107,10 @@ func (SelfSubjectAccessReviewSpec) SwaggerDoc() map[string]string { } var map_SelfSubjectRulesReview = map[string]string{ - "": "SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server's authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.", - "spec": "Spec holds information about the request being evaluated.", - "status": "Status is filled in by the server and indicates the set of actions a user can perform.", + "": "SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server's authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated.", + "status": "Status is filled in by the server and indicates the set of actions a user can perform.", } func (SelfSubjectRulesReview) SwaggerDoc() map[string]string { @@ -115,6 +118,7 @@ func (SelfSubjectRulesReview) SwaggerDoc() map[string]string { } var map_SelfSubjectRulesReviewSpec = map[string]string{ + "": "SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview.", "namespace": "Namespace to evaluate rules for. Required.", } @@ -123,9 +127,10 @@ func (SelfSubjectRulesReviewSpec) SwaggerDoc() map[string]string { } var map_SubjectAccessReview = map[string]string{ - "": "SubjectAccessReview checks whether or not a user or group can perform an action.", - "spec": "Spec holds information about the request being evaluated", - "status": "Status is filled in by the server and indicates whether the request is allowed or not", + "": "SubjectAccessReview checks whether or not a user or group can perform an action.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated", + "status": "Status is filled in by the server and indicates whether the request is allowed or not", } func (SubjectAccessReview) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/generated.proto index a9e221608efd..4b1a55e0ca69 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/generated.proto @@ -41,6 +41,8 @@ message ExtraValue { // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions // checking. message LocalSubjectAccessReview { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -134,6 +136,8 @@ message ResourceRule { // spec.namespace means "in all namespaces". Self is a special case, because users should always be able // to check whether they can perform an action message SelfSubjectAccessReview { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -164,6 +168,8 @@ message SelfSubjectAccessReviewSpec { // drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. message SelfSubjectRulesReview { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -175,6 +181,7 @@ message SelfSubjectRulesReview { optional SubjectRulesReviewStatus status = 3; } +// SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview. message SelfSubjectRulesReviewSpec { // Namespace to evaluate rules for. Required. optional string namespace = 1; @@ -182,6 +189,8 @@ message SelfSubjectRulesReviewSpec { // SubjectAccessReview checks whether or not a user or group can perform an action. message SubjectAccessReview { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; diff --git a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/types.go index c62b5ea21375..265309865566 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/types.go @@ -33,6 +33,8 @@ import ( // SubjectAccessReview checks whether or not a user or group can perform an action. type SubjectAccessReview struct { metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -57,6 +59,8 @@ type SubjectAccessReview struct { // to check whether they can perform an action type SelfSubjectAccessReview struct { metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -80,6 +84,8 @@ type SelfSubjectAccessReview struct { // checking. type LocalSubjectAccessReview struct { metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -212,6 +218,8 @@ type SubjectAccessReviewStatus struct { // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. type SelfSubjectRulesReview struct { metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -223,6 +231,7 @@ type SelfSubjectRulesReview struct { Status SubjectRulesReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } +// SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview. type SelfSubjectRulesReviewSpec struct { // Namespace to evaluate rules for. Required. Namespace string `json:"namespace,omitempty" protobuf:"bytes,1,opt,name=namespace"` diff --git a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/types_swagger_doc_generated.go index 3ae6e7206014..2d291189eb20 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/authorization/v1beta1/types_swagger_doc_generated.go @@ -28,9 +28,10 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_LocalSubjectAccessReview = map[string]string{ - "": "LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.", - "spec": "Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.", - "status": "Status is filled in by the server and indicates whether the request is allowed or not", + "": "LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.", + "status": "Status is filled in by the server and indicates whether the request is allowed or not", } func (LocalSubjectAccessReview) SwaggerDoc() map[string]string { @@ -85,9 +86,10 @@ func (ResourceRule) SwaggerDoc() map[string]string { } var map_SelfSubjectAccessReview = map[string]string{ - "": "SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \"in all namespaces\". Self is a special case, because users should always be able to check whether they can perform an action", - "spec": "Spec holds information about the request being evaluated. user and groups must be empty", - "status": "Status is filled in by the server and indicates whether the request is allowed or not", + "": "SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \"in all namespaces\". Self is a special case, because users should always be able to check whether they can perform an action", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated. user and groups must be empty", + "status": "Status is filled in by the server and indicates whether the request is allowed or not", } func (SelfSubjectAccessReview) SwaggerDoc() map[string]string { @@ -105,9 +107,10 @@ func (SelfSubjectAccessReviewSpec) SwaggerDoc() map[string]string { } var map_SelfSubjectRulesReview = map[string]string{ - "": "SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server's authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.", - "spec": "Spec holds information about the request being evaluated.", - "status": "Status is filled in by the server and indicates the set of actions a user can perform.", + "": "SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server's authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated.", + "status": "Status is filled in by the server and indicates the set of actions a user can perform.", } func (SelfSubjectRulesReview) SwaggerDoc() map[string]string { @@ -115,6 +118,7 @@ func (SelfSubjectRulesReview) SwaggerDoc() map[string]string { } var map_SelfSubjectRulesReviewSpec = map[string]string{ + "": "SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview.", "namespace": "Namespace to evaluate rules for. Required.", } @@ -123,9 +127,10 @@ func (SelfSubjectRulesReviewSpec) SwaggerDoc() map[string]string { } var map_SubjectAccessReview = map[string]string{ - "": "SubjectAccessReview checks whether or not a user or group can perform an action.", - "spec": "Spec holds information about the request being evaluated", - "status": "Status is filled in by the server and indicates whether the request is allowed or not", + "": "SubjectAccessReview checks whether or not a user or group can perform an action.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Spec holds information about the request being evaluated", + "status": "Status is filled in by the server and indicates whether the request is allowed or not", } func (SubjectAccessReview) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.proto index 04f0e7ea7e69..c786d6ae25c8 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/generated.proto @@ -246,9 +246,11 @@ message JobSpec { // for each index. // When value is `Indexed`, .spec.completions must be specified and // `.spec.parallelism` must be less than or equal to 10^5. + // In addition, The Pod name takes the form + // `$(job-name)-$(index)-$(random-string)`, + // the Pod hostname takes the form `$(job-name)-$(index)`. // - // This field is alpha-level and is only honored by servers that enable the - // IndexedJob feature gate. More completion modes can be added in the future. + // This field is beta-level. More completion modes can be added in the future. // If the Job controller observes a mode that it doesn't recognize, the // controller skips updates for the Job. // +optional diff --git a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types.go index 12f4b04cbd9a..caf0374c174a 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types.go @@ -21,7 +21,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -const JobCompletionIndexAnnotationAlpha = "batch.kubernetes.io/job-completion-index" +const JobCompletionIndexAnnotation = "batch.kubernetes.io/job-completion-index" // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -162,9 +162,11 @@ type JobSpec struct { // for each index. // When value is `Indexed`, .spec.completions must be specified and // `.spec.parallelism` must be less than or equal to 10^5. + // In addition, The Pod name takes the form + // `$(job-name)-$(index)-$(random-string)`, + // the Pod hostname takes the form `$(job-name)-$(index)`. // - // This field is alpha-level and is only honored by servers that enable the - // IndexedJob feature gate. More completion modes can be added in the future. + // This field is beta-level. More completion modes can be added in the future. // If the Job controller observes a mode that it doesn't recognize, the // controller skips updates for the Job. // +optional diff --git a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go index d98c5edeb1e6..f522b01a1170 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go @@ -119,7 +119,7 @@ var map_JobSpec = map[string]string{ "manualSelector": "manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector", "template": "Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", "ttlSecondsAfterFinished": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature.", - "completionMode": "CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5.\n\nThis field is alpha-level and is only honored by servers that enable the IndexedJob feature gate. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.", + "completionMode": "CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nThis field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.", "suspend": "Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. This is an alpha field and requires the SuspendJob feature gate to be enabled; otherwise this field may not be set to true. Defaults to false.", } diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/annotation_key_constants.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/annotation_key_constants.go index a3802f0c3632..7fde09126c60 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/annotation_key_constants.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/annotation_key_constants.go @@ -23,9 +23,6 @@ const ( // webhook backend fails. ImagePolicyFailedOpenKey string = "alpha.image-policy.k8s.io/failed-open" - // PodPresetOptOutAnnotationKey represents the annotation key for a pod to exempt itself from pod preset manipulation - PodPresetOptOutAnnotationKey string = "podpreset.admission.kubernetes.io/exclude" - // MirrorAnnotationKey represents the annotation key set by kubelets when creating mirror pods MirrorPodAnnotationKey string = "kubernetes.io/config.mirror" diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.pb.go index bc5bcbd607db..9ca70b61beed 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.pb.go @@ -6087,885 +6087,885 @@ func init() { } var fileDescriptor_83c10c24ec417dc9 = []byte{ - // 14043 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x6b, 0x70, 0x1c, 0xd9, - 0x75, 0x18, 0xac, 0x9e, 0xc1, 0x6b, 0x0e, 0xde, 0x17, 0x24, 0x17, 0xc4, 0x2e, 0x09, 0x6e, 0x53, - 0xe2, 0x72, 0xb5, 0xbb, 0xa0, 0xb8, 0x0f, 0x69, 0xbd, 0x2b, 0xad, 0x05, 0x60, 0x00, 0x72, 0x96, - 0x04, 0x38, 0x7b, 0x07, 0x24, 0x25, 0x79, 0xa5, 0x52, 0x63, 0xe6, 0x02, 0x68, 0x61, 0xa6, 0x7b, - 0xb6, 0xbb, 0x07, 0x24, 0xf6, 0x93, 0xeb, 0xf3, 0x27, 0x3f, 0xe5, 0xc7, 0x57, 0xaa, 0x94, 0xf3, - 0xb2, 0x5d, 0xae, 0x94, 0xe3, 0x54, 0xac, 0x38, 0x49, 0xc5, 0xb1, 0x63, 0x3b, 0x96, 0x13, 0x3b, - 0x71, 0x1e, 0x4e, 0x7e, 0x38, 0x8e, 0x2b, 0xb1, 0x5c, 0xe5, 0x0a, 0x62, 0xd3, 0x49, 0xb9, 0xf4, - 0x23, 0xb6, 0x13, 0x3b, 0x3f, 0x82, 0xb8, 0xe2, 0xd4, 0x7d, 0xf6, 0xbd, 0xfd, 0x98, 0x19, 0x70, - 0x41, 0x68, 0xa5, 0xda, 0x7f, 0x33, 0xf7, 0x9c, 0x7b, 0xee, 0xed, 0xfb, 0x3c, 0xf7, 0x3c, 0xe1, - 0xd5, 0xdd, 0x97, 0xc3, 0x05, 0xd7, 0xbf, 0xb2, 0xdb, 0xd9, 0x24, 0x81, 0x47, 0x22, 0x12, 0x5e, - 0xd9, 0x23, 0x5e, 0xc3, 0x0f, 0xae, 0x08, 0x80, 0xd3, 0x76, 0xaf, 0xd4, 0xfd, 0x80, 0x5c, 0xd9, - 0xbb, 0x7a, 0x65, 0x9b, 0x78, 0x24, 0x70, 0x22, 0xd2, 0x58, 0x68, 0x07, 0x7e, 0xe4, 0x23, 0xc4, - 0x71, 0x16, 0x9c, 0xb6, 0xbb, 0x40, 0x71, 0x16, 0xf6, 0xae, 0xce, 0x3d, 0xb7, 0xed, 0x46, 0x3b, - 0x9d, 0xcd, 0x85, 0xba, 0xdf, 0xba, 0xb2, 0xed, 0x6f, 0xfb, 0x57, 0x18, 0xea, 0x66, 0x67, 0x8b, - 0xfd, 0x63, 0x7f, 0xd8, 0x2f, 0x4e, 0x62, 0xee, 0xc5, 0xb8, 0x99, 0x96, 0x53, 0xdf, 0x71, 0x3d, - 0x12, 0xec, 0x5f, 0x69, 0xef, 0x6e, 0xb3, 0x76, 0x03, 0x12, 0xfa, 0x9d, 0xa0, 0x4e, 0x92, 0x0d, - 0x77, 0xad, 0x15, 0x5e, 0x69, 0x91, 0xc8, 0xc9, 0xe8, 0xee, 0xdc, 0x95, 0xbc, 0x5a, 0x41, 0xc7, - 0x8b, 0xdc, 0x56, 0xba, 0x99, 0x0f, 0xf7, 0xaa, 0x10, 0xd6, 0x77, 0x48, 0xcb, 0x49, 0xd5, 0x7b, - 0x21, 0xaf, 0x5e, 0x27, 0x72, 0x9b, 0x57, 0x5c, 0x2f, 0x0a, 0xa3, 0x20, 0x59, 0xc9, 0xfe, 0xaa, - 0x05, 0x17, 0x16, 0xef, 0xd6, 0x56, 0x9a, 0x4e, 0x18, 0xb9, 0xf5, 0xa5, 0xa6, 0x5f, 0xdf, 0xad, - 0x45, 0x7e, 0x40, 0xee, 0xf8, 0xcd, 0x4e, 0x8b, 0xd4, 0xd8, 0x40, 0xa0, 0x67, 0x61, 0x64, 0x8f, - 0xfd, 0xaf, 0x94, 0x67, 0xad, 0x0b, 0xd6, 0xe5, 0xd2, 0xd2, 0xd4, 0xaf, 0x1f, 0xcc, 0xbf, 0xef, - 0xc1, 0xc1, 0xfc, 0xc8, 0x1d, 0x51, 0x8e, 0x15, 0x06, 0xba, 0x04, 0x43, 0x5b, 0xe1, 0xc6, 0x7e, - 0x9b, 0xcc, 0x16, 0x18, 0xee, 0x84, 0xc0, 0x1d, 0x5a, 0xad, 0xd1, 0x52, 0x2c, 0xa0, 0xe8, 0x0a, - 0x94, 0xda, 0x4e, 0x10, 0xb9, 0x91, 0xeb, 0x7b, 0xb3, 0xc5, 0x0b, 0xd6, 0xe5, 0xc1, 0xa5, 0x69, - 0x81, 0x5a, 0xaa, 0x4a, 0x00, 0x8e, 0x71, 0x68, 0x37, 0x02, 0xe2, 0x34, 0x6e, 0x79, 0xcd, 0xfd, - 0xd9, 0x81, 0x0b, 0xd6, 0xe5, 0x91, 0xb8, 0x1b, 0x58, 0x94, 0x63, 0x85, 0x61, 0xff, 0x48, 0x01, - 0x46, 0x16, 0xb7, 0xb6, 0x5c, 0xcf, 0x8d, 0xf6, 0xd1, 0x1d, 0x18, 0xf3, 0xfc, 0x06, 0x91, 0xff, - 0xd9, 0x57, 0x8c, 0x3e, 0x7f, 0x61, 0x21, 0xbd, 0x94, 0x16, 0xd6, 0x35, 0xbc, 0xa5, 0xa9, 0x07, - 0x07, 0xf3, 0x63, 0x7a, 0x09, 0x36, 0xe8, 0x20, 0x0c, 0xa3, 0x6d, 0xbf, 0xa1, 0xc8, 0x16, 0x18, - 0xd9, 0xf9, 0x2c, 0xb2, 0xd5, 0x18, 0x6d, 0x69, 0xf2, 0xc1, 0xc1, 0xfc, 0xa8, 0x56, 0x80, 0x75, - 0x22, 0x68, 0x13, 0x26, 0xe9, 0x5f, 0x2f, 0x72, 0x15, 0xdd, 0x22, 0xa3, 0x7b, 0x31, 0x8f, 0xae, - 0x86, 0xba, 0x34, 0xf3, 0xe0, 0x60, 0x7e, 0x32, 0x51, 0x88, 0x93, 0x04, 0xed, 0xb7, 0x61, 0x62, - 0x31, 0x8a, 0x9c, 0xfa, 0x0e, 0x69, 0xf0, 0x19, 0x44, 0x2f, 0xc2, 0x80, 0xe7, 0xb4, 0x88, 0x98, - 0xdf, 0x0b, 0x62, 0x60, 0x07, 0xd6, 0x9d, 0x16, 0x39, 0x3c, 0x98, 0x9f, 0xba, 0xed, 0xb9, 0x6f, - 0x75, 0xc4, 0xaa, 0xa0, 0x65, 0x98, 0x61, 0xa3, 0xe7, 0x01, 0x1a, 0x64, 0xcf, 0xad, 0x93, 0xaa, - 0x13, 0xed, 0x88, 0xf9, 0x46, 0xa2, 0x2e, 0x94, 0x15, 0x04, 0x6b, 0x58, 0xf6, 0x7d, 0x28, 0x2d, - 0xee, 0xf9, 0x6e, 0xa3, 0xea, 0x37, 0x42, 0xb4, 0x0b, 0x93, 0xed, 0x80, 0x6c, 0x91, 0x40, 0x15, - 0xcd, 0x5a, 0x17, 0x8a, 0x97, 0x47, 0x9f, 0xbf, 0x9c, 0xf9, 0xb1, 0x26, 0xea, 0x8a, 0x17, 0x05, - 0xfb, 0x4b, 0x8f, 0x89, 0xf6, 0x26, 0x13, 0x50, 0x9c, 0xa4, 0x6c, 0xff, 0x8b, 0x02, 0x9c, 0x5e, - 0x7c, 0xbb, 0x13, 0x90, 0xb2, 0x1b, 0xee, 0x26, 0x57, 0x78, 0xc3, 0x0d, 0x77, 0xd7, 0xe3, 0x11, - 0x50, 0x4b, 0xab, 0x2c, 0xca, 0xb1, 0xc2, 0x40, 0xcf, 0xc1, 0x30, 0xfd, 0x7d, 0x1b, 0x57, 0xc4, - 0x27, 0xcf, 0x08, 0xe4, 0xd1, 0xb2, 0x13, 0x39, 0x65, 0x0e, 0xc2, 0x12, 0x07, 0xad, 0xc1, 0x68, - 0x9d, 0x6d, 0xc8, 0xed, 0x35, 0xbf, 0x41, 0xd8, 0x64, 0x96, 0x96, 0x9e, 0xa1, 0xe8, 0xcb, 0x71, - 0xf1, 0xe1, 0xc1, 0xfc, 0x2c, 0xef, 0x9b, 0x20, 0xa1, 0xc1, 0xb0, 0x5e, 0x1f, 0xd9, 0x6a, 0x7f, - 0x0d, 0x30, 0x4a, 0x90, 0xb1, 0xb7, 0x2e, 0x6b, 0x5b, 0x65, 0x90, 0x6d, 0x95, 0xb1, 0xec, 0x6d, - 0x82, 0xae, 0xc2, 0xc0, 0xae, 0xeb, 0x35, 0x66, 0x87, 0x18, 0xad, 0x73, 0x74, 0xce, 0x6f, 0xb8, - 0x5e, 0xe3, 0xf0, 0x60, 0x7e, 0xda, 0xe8, 0x0e, 0x2d, 0xc4, 0x0c, 0xd5, 0xfe, 0x53, 0x0b, 0xe6, - 0x19, 0x6c, 0xd5, 0x6d, 0x92, 0x2a, 0x09, 0x42, 0x37, 0x8c, 0x88, 0x17, 0x19, 0x03, 0xfa, 0x3c, - 0x40, 0x48, 0xea, 0x01, 0x89, 0xb4, 0x21, 0x55, 0x0b, 0xa3, 0xa6, 0x20, 0x58, 0xc3, 0xa2, 0x07, - 0x42, 0xb8, 0xe3, 0x04, 0x6c, 0x7d, 0x89, 0x81, 0x55, 0x07, 0x42, 0x4d, 0x02, 0x70, 0x8c, 0x63, - 0x1c, 0x08, 0xc5, 0x5e, 0x07, 0x02, 0xfa, 0x18, 0x4c, 0xc6, 0x8d, 0x85, 0x6d, 0xa7, 0x2e, 0x07, - 0x90, 0x6d, 0x99, 0x9a, 0x09, 0xc2, 0x49, 0x5c, 0xfb, 0xef, 0x58, 0x62, 0xf1, 0xd0, 0xaf, 0x7e, - 0x97, 0x7f, 0xab, 0xfd, 0x8b, 0x16, 0x0c, 0x2f, 0xb9, 0x5e, 0xc3, 0xf5, 0xb6, 0xd1, 0x67, 0x61, - 0x84, 0xde, 0x4d, 0x0d, 0x27, 0x72, 0xc4, 0xb9, 0xf7, 0x21, 0x6d, 0x6f, 0xa9, 0xab, 0x62, 0xa1, - 0xbd, 0xbb, 0x4d, 0x0b, 0xc2, 0x05, 0x8a, 0x4d, 0x77, 0xdb, 0xad, 0xcd, 0xcf, 0x91, 0x7a, 0xb4, - 0x46, 0x22, 0x27, 0xfe, 0x9c, 0xb8, 0x0c, 0x2b, 0xaa, 0xe8, 0x06, 0x0c, 0x45, 0x4e, 0xb0, 0x4d, - 0x22, 0x71, 0x00, 0x66, 0x1e, 0x54, 0xbc, 0x26, 0xa6, 0x3b, 0x92, 0x78, 0x75, 0x12, 0x5f, 0x0b, - 0x1b, 0xac, 0x2a, 0x16, 0x24, 0xec, 0x1f, 0x1a, 0x86, 0xb3, 0xcb, 0xb5, 0x4a, 0xce, 0xba, 0xba, - 0x04, 0x43, 0x8d, 0xc0, 0xdd, 0x23, 0x81, 0x18, 0x67, 0x45, 0xa5, 0xcc, 0x4a, 0xb1, 0x80, 0xa2, - 0x97, 0x61, 0x8c, 0x5f, 0x48, 0xd7, 0x1d, 0xaf, 0xd1, 0x94, 0x43, 0x7c, 0x4a, 0x60, 0x8f, 0xdd, - 0xd1, 0x60, 0xd8, 0xc0, 0x3c, 0xe2, 0xa2, 0xba, 0x94, 0xd8, 0x8c, 0x79, 0x97, 0xdd, 0x17, 0x2d, - 0x98, 0xe2, 0xcd, 0x2c, 0x46, 0x51, 0xe0, 0x6e, 0x76, 0x22, 0x12, 0xce, 0x0e, 0xb2, 0x93, 0x6e, - 0x39, 0x6b, 0xb4, 0x72, 0x47, 0x60, 0xe1, 0x4e, 0x82, 0x0a, 0x3f, 0x04, 0x67, 0x45, 0xbb, 0x53, - 0x49, 0x30, 0x4e, 0x35, 0x8b, 0xbe, 0xd3, 0x82, 0xb9, 0xba, 0xef, 0x45, 0x81, 0xdf, 0x6c, 0x92, - 0xa0, 0xda, 0xd9, 0x6c, 0xba, 0xe1, 0x0e, 0x5f, 0xa7, 0x98, 0x6c, 0xb1, 0x93, 0x20, 0x67, 0x0e, - 0x15, 0x92, 0x98, 0xc3, 0xf3, 0x0f, 0x0e, 0xe6, 0xe7, 0x96, 0x73, 0x49, 0xe1, 0x2e, 0xcd, 0xa0, - 0x5d, 0x40, 0xf4, 0x2a, 0xad, 0x45, 0xce, 0x36, 0x89, 0x1b, 0x1f, 0xee, 0xbf, 0xf1, 0x33, 0x0f, - 0x0e, 0xe6, 0xd1, 0x7a, 0x8a, 0x04, 0xce, 0x20, 0x8b, 0xde, 0x82, 0x53, 0xb4, 0x34, 0xf5, 0xad, - 0x23, 0xfd, 0x37, 0x37, 0xfb, 0xe0, 0x60, 0xfe, 0xd4, 0x7a, 0x06, 0x11, 0x9c, 0x49, 0x1a, 0x7d, - 0x87, 0x05, 0x67, 0xe3, 0xcf, 0x5f, 0xb9, 0xdf, 0x76, 0xbc, 0x46, 0xdc, 0x70, 0xa9, 0xff, 0x86, - 0xe9, 0x99, 0x7c, 0x76, 0x39, 0x8f, 0x12, 0xce, 0x6f, 0x64, 0x6e, 0x19, 0x4e, 0x67, 0xae, 0x16, - 0x34, 0x05, 0xc5, 0x5d, 0xc2, 0xb9, 0xa0, 0x12, 0xa6, 0x3f, 0xd1, 0x29, 0x18, 0xdc, 0x73, 0x9a, - 0x1d, 0xb1, 0x51, 0x30, 0xff, 0xf3, 0x4a, 0xe1, 0x65, 0xcb, 0xfe, 0x97, 0x45, 0x98, 0x5c, 0xae, - 0x55, 0x1e, 0x6a, 0x17, 0xea, 0xd7, 0x50, 0xa1, 0xeb, 0x35, 0x14, 0x5f, 0x6a, 0xc5, 0xdc, 0x4b, - 0xed, 0xff, 0xcd, 0xd8, 0x42, 0x03, 0x6c, 0x0b, 0x7d, 0x4b, 0xce, 0x16, 0x3a, 0xe6, 0x8d, 0xb3, - 0x97, 0xb3, 0x8a, 0x06, 0xd9, 0x64, 0x66, 0x72, 0x2c, 0x37, 0xfd, 0xba, 0xd3, 0x4c, 0x1e, 0x7d, - 0x47, 0x5c, 0x4a, 0xc7, 0x33, 0x8f, 0x75, 0x18, 0x5b, 0x76, 0xda, 0xce, 0xa6, 0xdb, 0x74, 0x23, - 0x97, 0x84, 0xe8, 0x29, 0x28, 0x3a, 0x8d, 0x06, 0xe3, 0xb6, 0x4a, 0x4b, 0xa7, 0x1f, 0x1c, 0xcc, - 0x17, 0x17, 0x1b, 0xf4, 0xda, 0x07, 0x85, 0xb5, 0x8f, 0x29, 0x06, 0xfa, 0x20, 0x0c, 0x34, 0x02, - 0xbf, 0x3d, 0x5b, 0x60, 0x98, 0x74, 0xd7, 0x0d, 0x94, 0x03, 0xbf, 0x9d, 0x40, 0x65, 0x38, 0xf6, - 0xaf, 0x16, 0xe0, 0x89, 0x65, 0xd2, 0xde, 0x59, 0xad, 0xe5, 0x9c, 0xdf, 0x97, 0x61, 0xa4, 0xe5, - 0x7b, 0x6e, 0xe4, 0x07, 0xa1, 0x68, 0x9a, 0xad, 0x88, 0x35, 0x51, 0x86, 0x15, 0x14, 0x5d, 0x80, - 0x81, 0x76, 0xcc, 0x54, 0x8e, 0x49, 0x86, 0x94, 0xb1, 0x93, 0x0c, 0x42, 0x31, 0x3a, 0x21, 0x09, - 0xc4, 0x8a, 0x51, 0x18, 0xb7, 0x43, 0x12, 0x60, 0x06, 0x89, 0x6f, 0x66, 0x7a, 0x67, 0x8b, 0x13, - 0x3a, 0x71, 0x33, 0x53, 0x08, 0xd6, 0xb0, 0x50, 0x15, 0x4a, 0x61, 0x62, 0x66, 0xfb, 0xda, 0xa6, - 0xe3, 0xec, 0xea, 0x56, 0x33, 0x19, 0x13, 0x31, 0x6e, 0x94, 0xa1, 0x9e, 0x57, 0xf7, 0x57, 0x0a, - 0x80, 0xf8, 0x10, 0x7e, 0x83, 0x0d, 0xdc, 0xed, 0xf4, 0xc0, 0xf5, 0xbf, 0x25, 0x8e, 0x6b, 0xf4, - 0xfe, 0xcc, 0x82, 0x27, 0x96, 0x5d, 0xaf, 0x41, 0x82, 0x9c, 0x05, 0xf8, 0x68, 0xde, 0xb2, 0x47, - 0x63, 0x1a, 0x8c, 0x25, 0x36, 0x70, 0x0c, 0x4b, 0xcc, 0xfe, 0x63, 0x0b, 0x10, 0xff, 0xec, 0x77, - 0xdd, 0xc7, 0xde, 0x4e, 0x7f, 0xec, 0x31, 0x2c, 0x0b, 0xfb, 0x26, 0x4c, 0x2c, 0x37, 0x5d, 0xe2, - 0x45, 0x95, 0xea, 0xb2, 0xef, 0x6d, 0xb9, 0xdb, 0xe8, 0x15, 0x98, 0x88, 0xdc, 0x16, 0xf1, 0x3b, - 0x51, 0x8d, 0xd4, 0x7d, 0x8f, 0xbd, 0x24, 0xad, 0xcb, 0x83, 0x4b, 0xe8, 0xc1, 0xc1, 0xfc, 0xc4, - 0x86, 0x01, 0xc1, 0x09, 0x4c, 0xfb, 0x77, 0xe9, 0xf8, 0xf9, 0xad, 0xb6, 0xef, 0x11, 0x2f, 0x5a, - 0xf6, 0xbd, 0x06, 0x97, 0x38, 0xbc, 0x02, 0x03, 0x11, 0x1d, 0x0f, 0x3e, 0x76, 0x97, 0xe4, 0x46, - 0xa1, 0xa3, 0x70, 0x78, 0x30, 0x7f, 0x26, 0x5d, 0x83, 0x8d, 0x13, 0xab, 0x83, 0xbe, 0x05, 0x86, - 0xc2, 0xc8, 0x89, 0x3a, 0xa1, 0x18, 0xcd, 0x27, 0xe5, 0x68, 0xd6, 0x58, 0xe9, 0xe1, 0xc1, 0xfc, - 0xa4, 0xaa, 0xc6, 0x8b, 0xb0, 0xa8, 0x80, 0x9e, 0x86, 0xe1, 0x16, 0x09, 0x43, 0x67, 0x5b, 0xde, - 0x86, 0x93, 0xa2, 0xee, 0xf0, 0x1a, 0x2f, 0xc6, 0x12, 0x8e, 0x2e, 0xc2, 0x20, 0x09, 0x02, 0x3f, - 0x10, 0x7b, 0x74, 0x5c, 0x20, 0x0e, 0xae, 0xd0, 0x42, 0xcc, 0x61, 0xf6, 0xbf, 0xb3, 0x60, 0x52, - 0xf5, 0x95, 0xb7, 0x75, 0x02, 0xaf, 0x82, 0x4f, 0x01, 0xd4, 0xe5, 0x07, 0x86, 0xec, 0xf6, 0x18, - 0x7d, 0xfe, 0x52, 0xe6, 0x45, 0x9d, 0x1a, 0xc6, 0x98, 0xb2, 0x2a, 0x0a, 0xb1, 0x46, 0xcd, 0xfe, - 0x27, 0x16, 0xcc, 0x24, 0xbe, 0xe8, 0xa6, 0x1b, 0x46, 0xe8, 0xcd, 0xd4, 0x57, 0x2d, 0xf4, 0xf7, - 0x55, 0xb4, 0x36, 0xfb, 0x26, 0xb5, 0x94, 0x65, 0x89, 0xf6, 0x45, 0xd7, 0x61, 0xd0, 0x8d, 0x48, - 0x4b, 0x7e, 0xcc, 0xc5, 0xae, 0x1f, 0xc3, 0x7b, 0x15, 0xcf, 0x48, 0x85, 0xd6, 0xc4, 0x9c, 0x80, - 0xfd, 0xab, 0x45, 0x28, 0xf1, 0x65, 0xbb, 0xe6, 0xb4, 0x4f, 0x60, 0x2e, 0x9e, 0x81, 0x92, 0xdb, - 0x6a, 0x75, 0x22, 0x67, 0x53, 0x1c, 0xe7, 0x23, 0x7c, 0x6b, 0x55, 0x64, 0x21, 0x8e, 0xe1, 0xa8, - 0x02, 0x03, 0xac, 0x2b, 0xfc, 0x2b, 0x9f, 0xca, 0xfe, 0x4a, 0xd1, 0xf7, 0x85, 0xb2, 0x13, 0x39, - 0x9c, 0x93, 0x52, 0xf7, 0x08, 0x2d, 0xc2, 0x8c, 0x04, 0x72, 0x00, 0x36, 0x5d, 0xcf, 0x09, 0xf6, - 0x69, 0xd9, 0x6c, 0x91, 0x11, 0x7c, 0xae, 0x3b, 0xc1, 0x25, 0x85, 0xcf, 0xc9, 0xaa, 0x0f, 0x8b, - 0x01, 0x58, 0x23, 0x3a, 0xf7, 0x11, 0x28, 0x29, 0xe4, 0xa3, 0x30, 0x44, 0x73, 0x1f, 0x83, 0xc9, - 0x44, 0x5b, 0xbd, 0xaa, 0x8f, 0xe9, 0xfc, 0xd4, 0x2f, 0xb1, 0x23, 0x43, 0xf4, 0x7a, 0xc5, 0xdb, - 0x13, 0x47, 0xee, 0xdb, 0x70, 0xaa, 0x99, 0x71, 0x92, 0x89, 0x79, 0xed, 0xff, 0xe4, 0x7b, 0x42, - 0x7c, 0xf6, 0xa9, 0x2c, 0x28, 0xce, 0x6c, 0x83, 0xf2, 0x08, 0x7e, 0x9b, 0x6e, 0x10, 0xa7, 0xa9, - 0xb3, 0xdb, 0xb7, 0x44, 0x19, 0x56, 0x50, 0x7a, 0xde, 0x9d, 0x52, 0x9d, 0xbf, 0x41, 0xf6, 0x6b, - 0xa4, 0x49, 0xea, 0x91, 0x1f, 0x7c, 0x5d, 0xbb, 0x7f, 0x8e, 0x8f, 0x3e, 0x3f, 0x2e, 0x47, 0x05, - 0x81, 0xe2, 0x0d, 0xb2, 0xcf, 0xa7, 0x42, 0xff, 0xba, 0x62, 0xd7, 0xaf, 0xfb, 0x19, 0x0b, 0xc6, - 0xd5, 0xd7, 0x9d, 0xc0, 0xb9, 0xb0, 0x64, 0x9e, 0x0b, 0xe7, 0xba, 0x2e, 0xf0, 0x9c, 0x13, 0xe1, - 0x2b, 0x05, 0x38, 0xab, 0x70, 0xe8, 0xdb, 0x80, 0xff, 0x11, 0xab, 0xea, 0x0a, 0x94, 0x3c, 0x25, - 0xb5, 0xb2, 0x4c, 0x71, 0x51, 0x2c, 0xb3, 0x8a, 0x71, 0x28, 0x8b, 0xe7, 0xc5, 0xa2, 0xa5, 0x31, - 0x5d, 0x9c, 0x2b, 0x44, 0xb7, 0x4b, 0x50, 0xec, 0xb8, 0x0d, 0x71, 0xc1, 0x7c, 0x48, 0x8e, 0xf6, - 0xed, 0x4a, 0xf9, 0xf0, 0x60, 0xfe, 0xc9, 0x3c, 0x55, 0x02, 0xbd, 0xd9, 0xc2, 0x85, 0xdb, 0x95, - 0x32, 0xa6, 0x95, 0xd1, 0x22, 0x4c, 0x4a, 0x6d, 0xc9, 0x1d, 0xca, 0x6e, 0xf9, 0x9e, 0xb8, 0x87, - 0x94, 0x4c, 0x16, 0x9b, 0x60, 0x9c, 0xc4, 0x47, 0x65, 0x98, 0xda, 0xed, 0x6c, 0x92, 0x26, 0x89, - 0xf8, 0x07, 0xdf, 0x20, 0x5c, 0x62, 0x59, 0x8a, 0x5f, 0x66, 0x37, 0x12, 0x70, 0x9c, 0xaa, 0x61, - 0xff, 0x05, 0xbb, 0x0f, 0xc4, 0xe8, 0x55, 0x03, 0x9f, 0x2e, 0x2c, 0x4a, 0xfd, 0xeb, 0xb9, 0x9c, - 0xfb, 0x59, 0x15, 0x37, 0xc8, 0xfe, 0x86, 0x4f, 0x39, 0xf3, 0xec, 0x55, 0x61, 0xac, 0xf9, 0x81, - 0xae, 0x6b, 0xfe, 0xe7, 0x0a, 0x70, 0x5a, 0x8d, 0x80, 0xc1, 0x04, 0x7e, 0xa3, 0x8f, 0xc1, 0x55, - 0x18, 0x6d, 0x90, 0x2d, 0xa7, 0xd3, 0x8c, 0x94, 0xf8, 0x7c, 0x90, 0xab, 0x50, 0xca, 0x71, 0x31, - 0xd6, 0x71, 0x8e, 0x30, 0x6c, 0xff, 0x73, 0x94, 0x5d, 0xc4, 0x91, 0x43, 0xd7, 0xb8, 0xda, 0x35, - 0x56, 0xee, 0xae, 0xb9, 0x08, 0x83, 0x6e, 0x8b, 0x32, 0x66, 0x05, 0x93, 0xdf, 0xaa, 0xd0, 0x42, - 0xcc, 0x61, 0xe8, 0x03, 0x30, 0x5c, 0xf7, 0x5b, 0x2d, 0xc7, 0x6b, 0xb0, 0x2b, 0xaf, 0xb4, 0x34, - 0x4a, 0x79, 0xb7, 0x65, 0x5e, 0x84, 0x25, 0x0c, 0x3d, 0x01, 0x03, 0x4e, 0xb0, 0xcd, 0x65, 0x18, - 0xa5, 0xa5, 0x11, 0xda, 0xd2, 0x62, 0xb0, 0x1d, 0x62, 0x56, 0x4a, 0x9f, 0x60, 0xf7, 0xfc, 0x60, - 0xd7, 0xf5, 0xb6, 0xcb, 0x6e, 0x20, 0xb6, 0x84, 0xba, 0x0b, 0xef, 0x2a, 0x08, 0xd6, 0xb0, 0xd0, - 0x2a, 0x0c, 0xb6, 0xfd, 0x20, 0x0a, 0x67, 0x87, 0xd8, 0x70, 0x3f, 0x99, 0x73, 0x10, 0xf1, 0xaf, - 0xad, 0xfa, 0x41, 0x14, 0x7f, 0x00, 0xfd, 0x17, 0x62, 0x5e, 0x1d, 0xdd, 0x84, 0x61, 0xe2, 0xed, - 0xad, 0x06, 0x7e, 0x6b, 0x76, 0x26, 0x9f, 0xd2, 0x0a, 0x47, 0xe1, 0xcb, 0x2c, 0xe6, 0x51, 0x45, - 0x31, 0x96, 0x24, 0xd0, 0xb7, 0x40, 0x91, 0x78, 0x7b, 0xb3, 0xc3, 0x8c, 0xd2, 0x5c, 0x0e, 0xa5, - 0x3b, 0x4e, 0x10, 0x9f, 0xf9, 0x2b, 0xde, 0x1e, 0xa6, 0x75, 0xd0, 0x27, 0xa1, 0x24, 0x0f, 0x8c, - 0x50, 0x08, 0xeb, 0x32, 0x17, 0xac, 0x3c, 0x66, 0x30, 0x79, 0xab, 0xe3, 0x06, 0xa4, 0x45, 0xbc, - 0x28, 0x8c, 0x4f, 0x48, 0x09, 0x0d, 0x71, 0x4c, 0x0d, 0x7d, 0x52, 0x4a, 0x88, 0xd7, 0xfc, 0x8e, - 0x17, 0x85, 0xb3, 0x25, 0xd6, 0xbd, 0x4c, 0xdd, 0xdd, 0x9d, 0x18, 0x2f, 0x29, 0x42, 0xe6, 0x95, - 0xb1, 0x41, 0x0a, 0x7d, 0x1a, 0xc6, 0xf9, 0x7f, 0xae, 0x01, 0x0b, 0x67, 0x4f, 0x33, 0xda, 0x17, - 0xf2, 0x69, 0x73, 0xc4, 0xa5, 0xd3, 0x82, 0xf8, 0xb8, 0x5e, 0x1a, 0x62, 0x93, 0x1a, 0xc2, 0x30, - 0xde, 0x74, 0xf7, 0x88, 0x47, 0xc2, 0xb0, 0x1a, 0xf8, 0x9b, 0x64, 0x16, 0xd8, 0xc0, 0x9c, 0xcd, - 0xd6, 0x98, 0xf9, 0x9b, 0x64, 0x69, 0x9a, 0xd2, 0xbc, 0xa9, 0xd7, 0xc1, 0x26, 0x09, 0x74, 0x1b, - 0x26, 0xe8, 0x8b, 0xcd, 0x8d, 0x89, 0x8e, 0xf6, 0x22, 0xca, 0xde, 0x55, 0xd8, 0xa8, 0x84, 0x13, - 0x44, 0xd0, 0x2d, 0x18, 0x0b, 0x23, 0x27, 0x88, 0x3a, 0x6d, 0x4e, 0xf4, 0x4c, 0x2f, 0xa2, 0x4c, - 0xe1, 0x5a, 0xd3, 0xaa, 0x60, 0x83, 0x00, 0x7a, 0x1d, 0x4a, 0x4d, 0x77, 0x8b, 0xd4, 0xf7, 0xeb, - 0x4d, 0x32, 0x3b, 0xc6, 0xa8, 0x65, 0x1e, 0x2a, 0x37, 0x25, 0x12, 0xe7, 0x73, 0xd5, 0x5f, 0x1c, - 0x57, 0x47, 0x77, 0xe0, 0x4c, 0x44, 0x82, 0x96, 0xeb, 0x39, 0xf4, 0x30, 0x10, 0x4f, 0x2b, 0xa6, - 0xc8, 0x1c, 0x67, 0xbb, 0xed, 0xbc, 0x98, 0x8d, 0x33, 0x1b, 0x99, 0x58, 0x38, 0xa7, 0x36, 0xba, - 0x0f, 0xb3, 0x19, 0x10, 0xbf, 0xe9, 0xd6, 0xf7, 0x67, 0x4f, 0x31, 0xca, 0x1f, 0x15, 0x94, 0x67, - 0x37, 0x72, 0xf0, 0x0e, 0xbb, 0xc0, 0x70, 0x2e, 0x75, 0x74, 0x0b, 0x26, 0xd9, 0x09, 0x54, 0xed, - 0x34, 0x9b, 0xa2, 0xc1, 0x09, 0xd6, 0xe0, 0x07, 0xe4, 0x7d, 0x5c, 0x31, 0xc1, 0x87, 0x07, 0xf3, - 0x10, 0xff, 0xc3, 0xc9, 0xda, 0x68, 0x93, 0xe9, 0xcc, 0x3a, 0x81, 0x1b, 0xed, 0xd3, 0x73, 0x83, - 0xdc, 0x8f, 0x66, 0x27, 0xbb, 0xca, 0x2b, 0x74, 0x54, 0xa5, 0x58, 0xd3, 0x0b, 0x71, 0x92, 0x20, - 0x3d, 0x52, 0xc3, 0xa8, 0xe1, 0x7a, 0xb3, 0x53, 0xfc, 0x5d, 0x22, 0x4f, 0xa4, 0x1a, 0x2d, 0xc4, - 0x1c, 0xc6, 0xf4, 0x65, 0xf4, 0xc7, 0x2d, 0x7a, 0x73, 0x4d, 0x33, 0xc4, 0x58, 0x5f, 0x26, 0x01, - 0x38, 0xc6, 0xa1, 0xcc, 0x64, 0x14, 0xed, 0xcf, 0x22, 0x86, 0xaa, 0x0e, 0x96, 0x8d, 0x8d, 0x4f, - 0x62, 0x5a, 0x6e, 0x6f, 0xc2, 0x84, 0x3a, 0x08, 0xd9, 0x98, 0xa0, 0x79, 0x18, 0x64, 0xec, 0x93, - 0x90, 0xae, 0x95, 0x68, 0x17, 0x18, 0x6b, 0x85, 0x79, 0x39, 0xeb, 0x82, 0xfb, 0x36, 0x59, 0xda, - 0x8f, 0x08, 0x7f, 0xd3, 0x17, 0xb5, 0x2e, 0x48, 0x00, 0x8e, 0x71, 0xec, 0xff, 0xc3, 0xd9, 0xd0, - 0xf8, 0xb4, 0xed, 0xe3, 0x7e, 0x79, 0x16, 0x46, 0x76, 0xfc, 0x30, 0xa2, 0xd8, 0xac, 0x8d, 0xc1, - 0x98, 0xf1, 0xbc, 0x2e, 0xca, 0xb1, 0xc2, 0x40, 0xaf, 0xc2, 0x78, 0x5d, 0x6f, 0x40, 0x5c, 0x8e, - 0xea, 0x18, 0x31, 0x5a, 0xc7, 0x26, 0x2e, 0x7a, 0x19, 0x46, 0x98, 0x0d, 0x48, 0xdd, 0x6f, 0x0a, - 0xae, 0x4d, 0xde, 0xf0, 0x23, 0x55, 0x51, 0x7e, 0xa8, 0xfd, 0xc6, 0x0a, 0x1b, 0x5d, 0x82, 0x21, - 0xda, 0x85, 0x4a, 0x55, 0x5c, 0x4b, 0x4a, 0x50, 0x74, 0x9d, 0x95, 0x62, 0x01, 0xb5, 0xff, 0x52, - 0x41, 0x1b, 0x65, 0xfa, 0x1e, 0x26, 0xa8, 0x0a, 0xc3, 0xf7, 0x1c, 0x37, 0x72, 0xbd, 0x6d, 0xc1, - 0x7f, 0x3c, 0xdd, 0xf5, 0x8e, 0x62, 0x95, 0xee, 0xf2, 0x0a, 0xfc, 0x16, 0x15, 0x7f, 0xb0, 0x24, - 0x43, 0x29, 0x06, 0x1d, 0xcf, 0xa3, 0x14, 0x0b, 0xfd, 0x52, 0xc4, 0xbc, 0x02, 0xa7, 0x28, 0xfe, - 0x60, 0x49, 0x06, 0xbd, 0x09, 0x20, 0x77, 0x18, 0x69, 0x08, 0xdb, 0x8b, 0x67, 0x7b, 0x13, 0xdd, - 0x50, 0x75, 0x96, 0x26, 0xe8, 0x1d, 0x1d, 0xff, 0xc7, 0x1a, 0x3d, 0x3b, 0x62, 0x7c, 0x5a, 0xba, - 0x33, 0xe8, 0xdb, 0xe8, 0x12, 0x77, 0x82, 0x88, 0x34, 0x16, 0x23, 0x31, 0x38, 0x1f, 0xec, 0xef, - 0x91, 0xb2, 0xe1, 0xb6, 0x88, 0xbe, 0x1d, 0x04, 0x11, 0x1c, 0xd3, 0xb3, 0x7f, 0xa1, 0x08, 0xb3, - 0x79, 0xdd, 0xa5, 0x8b, 0x8e, 0xdc, 0x77, 0xa3, 0x65, 0xca, 0x5e, 0x59, 0xe6, 0xa2, 0x5b, 0x11, - 0xe5, 0x58, 0x61, 0xd0, 0xd9, 0x0f, 0xdd, 0x6d, 0xf9, 0xc6, 0x1c, 0x8c, 0x67, 0xbf, 0xc6, 0x4a, - 0xb1, 0x80, 0x52, 0xbc, 0x80, 0x38, 0xa1, 0x30, 0xee, 0xd1, 0x56, 0x09, 0x66, 0xa5, 0x58, 0x40, - 0x75, 0x69, 0xd7, 0x40, 0x0f, 0x69, 0x97, 0x31, 0x44, 0x83, 0xc7, 0x3b, 0x44, 0xe8, 0x33, 0x00, - 0x5b, 0xae, 0xe7, 0x86, 0x3b, 0x8c, 0xfa, 0xd0, 0x91, 0xa9, 0x2b, 0xe6, 0x6c, 0x55, 0x51, 0xc1, - 0x1a, 0x45, 0xf4, 0x12, 0x8c, 0xaa, 0x0d, 0x58, 0x29, 0x33, 0x4d, 0xa7, 0x66, 0x39, 0x12, 0x9f, - 0x46, 0x65, 0xac, 0xe3, 0xd9, 0x9f, 0x4b, 0xae, 0x17, 0xb1, 0x03, 0xb4, 0xf1, 0xb5, 0xfa, 0x1d, - 0xdf, 0x42, 0xf7, 0xf1, 0xb5, 0xbf, 0x56, 0x84, 0x49, 0xa3, 0xb1, 0x4e, 0xd8, 0xc7, 0x99, 0x75, - 0x8d, 0x1e, 0xe0, 0x4e, 0x44, 0xc4, 0xfe, 0xb3, 0x7b, 0x6f, 0x15, 0xfd, 0x90, 0xa7, 0x3b, 0x80, - 0xd7, 0x47, 0x9f, 0x81, 0x52, 0xd3, 0x09, 0x99, 0xe4, 0x8c, 0x88, 0x7d, 0xd7, 0x0f, 0xb1, 0xf8, - 0x61, 0xe2, 0x84, 0x91, 0x76, 0x6b, 0x72, 0xda, 0x31, 0x49, 0x7a, 0xd3, 0x50, 0xfe, 0x44, 0x5a, - 0x8f, 0xa9, 0x4e, 0x50, 0x26, 0x66, 0x1f, 0x73, 0x18, 0x7a, 0x19, 0xc6, 0x02, 0xc2, 0x56, 0xc5, - 0x32, 0xe5, 0xe6, 0xd8, 0x32, 0x1b, 0x8c, 0xd9, 0x3e, 0xac, 0xc1, 0xb0, 0x81, 0x19, 0xbf, 0x0d, - 0x86, 0xba, 0xbc, 0x0d, 0x9e, 0x86, 0x61, 0xf6, 0x43, 0xad, 0x00, 0x35, 0x1b, 0x15, 0x5e, 0x8c, - 0x25, 0x3c, 0xb9, 0x60, 0x46, 0xfa, 0x5b, 0x30, 0xf4, 0xf5, 0x21, 0x16, 0x35, 0xd3, 0x32, 0x8f, - 0xf0, 0x53, 0x4e, 0x2c, 0x79, 0x2c, 0x61, 0xf6, 0x07, 0x61, 0xa2, 0xec, 0x90, 0x96, 0xef, 0xad, - 0x78, 0x8d, 0xb6, 0xef, 0x7a, 0x11, 0x9a, 0x85, 0x01, 0x76, 0x89, 0xf0, 0x23, 0x60, 0x80, 0x36, - 0x84, 0x59, 0x89, 0xbd, 0x0d, 0xa7, 0xcb, 0xfe, 0x3d, 0xef, 0x9e, 0x13, 0x34, 0x16, 0xab, 0x15, - 0xed, 0x7d, 0xbd, 0x2e, 0xdf, 0x77, 0xdc, 0x68, 0x2b, 0xf3, 0xe8, 0xd5, 0x6a, 0x72, 0xb6, 0x76, - 0xd5, 0x6d, 0x92, 0x1c, 0x29, 0xc8, 0x5f, 0x2d, 0x18, 0x2d, 0xc5, 0xf8, 0x4a, 0xab, 0x65, 0xe5, - 0x6a, 0xb5, 0xde, 0x80, 0x91, 0x2d, 0x97, 0x34, 0x1b, 0x98, 0x6c, 0x89, 0x95, 0xf8, 0x54, 0xbe, - 0x1d, 0xca, 0x2a, 0xc5, 0x94, 0x52, 0x2f, 0xfe, 0x3a, 0x5c, 0x15, 0x95, 0xb1, 0x22, 0x83, 0x76, - 0x61, 0x4a, 0x3e, 0x18, 0x24, 0x54, 0xac, 0xcb, 0xa7, 0xbb, 0xbd, 0x42, 0x4c, 0xe2, 0xa7, 0x1e, - 0x1c, 0xcc, 0x4f, 0xe1, 0x04, 0x19, 0x9c, 0x22, 0x4c, 0x9f, 0x83, 0x2d, 0x7a, 0x02, 0x0f, 0xb0, - 0xe1, 0x67, 0xcf, 0x41, 0xf6, 0xb2, 0x65, 0xa5, 0xf6, 0x8f, 0x59, 0xf0, 0x58, 0x6a, 0x64, 0xc4, - 0x0b, 0xff, 0x98, 0x67, 0x21, 0xf9, 0xe2, 0x2e, 0xf4, 0x7e, 0x71, 0xdb, 0x7f, 0xd7, 0x82, 0x53, - 0x2b, 0xad, 0x76, 0xb4, 0x5f, 0x76, 0x4d, 0x15, 0xd4, 0x47, 0x60, 0xa8, 0x45, 0x1a, 0x6e, 0xa7, - 0x25, 0x66, 0x6e, 0x5e, 0x9e, 0x52, 0x6b, 0xac, 0xf4, 0xf0, 0x60, 0x7e, 0xbc, 0x16, 0xf9, 0x81, - 0xb3, 0x4d, 0x78, 0x01, 0x16, 0xe8, 0xec, 0xac, 0x77, 0xdf, 0x26, 0x37, 0xdd, 0x96, 0x2b, 0xed, - 0x8a, 0xba, 0xca, 0xec, 0x16, 0xe4, 0x80, 0x2e, 0xbc, 0xd1, 0x71, 0xbc, 0xc8, 0x8d, 0xf6, 0x85, - 0xf6, 0x48, 0x12, 0xc1, 0x31, 0x3d, 0xfb, 0xab, 0x16, 0x4c, 0xca, 0x75, 0xbf, 0xd8, 0x68, 0x04, - 0x24, 0x0c, 0xd1, 0x1c, 0x14, 0xdc, 0xb6, 0xe8, 0x25, 0x88, 0x5e, 0x16, 0x2a, 0x55, 0x5c, 0x70, - 0xdb, 0x92, 0x2d, 0x63, 0x07, 0x61, 0xd1, 0x54, 0xa4, 0x5d, 0x17, 0xe5, 0x58, 0x61, 0xa0, 0xcb, - 0x30, 0xe2, 0xf9, 0x0d, 0x6e, 0xdb, 0xc5, 0xaf, 0x34, 0xb6, 0xc0, 0xd6, 0x45, 0x19, 0x56, 0x50, - 0x54, 0x85, 0x12, 0x37, 0x7b, 0x8a, 0x17, 0x6d, 0x5f, 0xc6, 0x53, 0xec, 0xcb, 0x36, 0x64, 0x4d, - 0x1c, 0x13, 0xb1, 0x7f, 0xc5, 0x82, 0x31, 0xf9, 0x65, 0x7d, 0xf2, 0x9c, 0x74, 0x6b, 0xc5, 0xfc, - 0x66, 0xbc, 0xb5, 0x28, 0xcf, 0xc8, 0x20, 0x06, 0xab, 0x58, 0x3c, 0x12, 0xab, 0x78, 0x15, 0x46, - 0x9d, 0x76, 0xbb, 0x6a, 0xf2, 0x99, 0x6c, 0x29, 0x2d, 0xc6, 0xc5, 0x58, 0xc7, 0xb1, 0x7f, 0xb4, - 0x00, 0x13, 0xf2, 0x0b, 0x6a, 0x9d, 0xcd, 0x90, 0x44, 0x68, 0x03, 0x4a, 0x0e, 0x9f, 0x25, 0x22, - 0x17, 0xf9, 0xc5, 0x6c, 0x39, 0x82, 0x31, 0xa5, 0xf1, 0x85, 0xbf, 0x28, 0x6b, 0xe3, 0x98, 0x10, - 0x6a, 0xc2, 0xb4, 0xe7, 0x47, 0xec, 0xf0, 0x57, 0xf0, 0x6e, 0xaa, 0x9d, 0x24, 0xf5, 0xb3, 0x82, - 0xfa, 0xf4, 0x7a, 0x92, 0x0a, 0x4e, 0x13, 0x46, 0x2b, 0x52, 0x36, 0x53, 0xcc, 0x17, 0x06, 0xe8, - 0x13, 0x97, 0x2d, 0x9a, 0xb1, 0x7f, 0xd9, 0x82, 0x92, 0x44, 0x3b, 0x09, 0x2d, 0xde, 0x1a, 0x0c, - 0x87, 0x6c, 0x12, 0xe4, 0xd0, 0xd8, 0xdd, 0x3a, 0xce, 0xe7, 0x2b, 0xbe, 0xd3, 0xf8, 0xff, 0x10, - 0x4b, 0x1a, 0x4c, 0x34, 0xaf, 0xba, 0xff, 0x2e, 0x11, 0xcd, 0xab, 0xfe, 0xe4, 0x5c, 0x4a, 0x7f, - 0xc8, 0xfa, 0xac, 0xc9, 0xba, 0x28, 0xeb, 0xd5, 0x0e, 0xc8, 0x96, 0x7b, 0x3f, 0xc9, 0x7a, 0x55, - 0x59, 0x29, 0x16, 0x50, 0xf4, 0x26, 0x8c, 0xd5, 0xa5, 0x4c, 0x36, 0xde, 0xe1, 0x97, 0xba, 0xea, - 0x07, 0x94, 0x2a, 0x89, 0xcb, 0x42, 0x96, 0xb5, 0xfa, 0xd8, 0xa0, 0x66, 0x9a, 0x11, 0x14, 0x7b, - 0x99, 0x11, 0xc4, 0x74, 0xf3, 0x95, 0xea, 0x3f, 0x6e, 0xc1, 0x10, 0x97, 0xc5, 0xf5, 0x27, 0x0a, - 0xd5, 0x34, 0x6b, 0xf1, 0xd8, 0xdd, 0xa1, 0x85, 0x42, 0x53, 0x86, 0xd6, 0xa0, 0xc4, 0x7e, 0x30, - 0x59, 0x62, 0x31, 0xdf, 0xea, 0x9e, 0xb7, 0xaa, 0x77, 0xf0, 0x8e, 0xac, 0x86, 0x63, 0x0a, 0xf6, - 0x0f, 0x17, 0xe9, 0xe9, 0x16, 0xa3, 0x1a, 0x97, 0xbe, 0xf5, 0xe8, 0x2e, 0xfd, 0xc2, 0xa3, 0xba, - 0xf4, 0xb7, 0x61, 0xb2, 0xae, 0xe9, 0xe1, 0xe2, 0x99, 0xbc, 0xdc, 0x75, 0x91, 0x68, 0x2a, 0x3b, - 0x2e, 0x65, 0x59, 0x36, 0x89, 0xe0, 0x24, 0x55, 0xf4, 0x6d, 0x30, 0xc6, 0xe7, 0x59, 0xb4, 0xc2, - 0x2d, 0x31, 0x3e, 0x90, 0xbf, 0x5e, 0xf4, 0x26, 0xb8, 0x54, 0x4e, 0xab, 0x8e, 0x0d, 0x62, 0xf6, - 0x9f, 0x58, 0x80, 0x56, 0xda, 0x3b, 0xa4, 0x45, 0x02, 0xa7, 0x19, 0x8b, 0xd3, 0xbf, 0xdf, 0x82, - 0x59, 0x92, 0x2a, 0x5e, 0xf6, 0x5b, 0x2d, 0xf1, 0x68, 0xc9, 0x79, 0x57, 0xaf, 0xe4, 0xd4, 0x51, - 0x6e, 0x09, 0xb3, 0x79, 0x18, 0x38, 0xb7, 0x3d, 0xb4, 0x06, 0x33, 0xfc, 0x96, 0x54, 0x00, 0xcd, - 0xf6, 0xfa, 0x71, 0x41, 0x78, 0x66, 0x23, 0x8d, 0x82, 0xb3, 0xea, 0xd9, 0xdf, 0x35, 0x06, 0xb9, - 0xbd, 0x78, 0x4f, 0x8f, 0xf0, 0x9e, 0x1e, 0xe1, 0x3d, 0x3d, 0xc2, 0x7b, 0x7a, 0x84, 0xf7, 0xf4, - 0x08, 0xdf, 0xf4, 0x7a, 0x84, 0xbf, 0x6c, 0xc1, 0x69, 0x75, 0x0d, 0x18, 0x0f, 0xdf, 0xcf, 0xc3, - 0x0c, 0xdf, 0x6e, 0xcb, 0x4d, 0xc7, 0x6d, 0x6d, 0x90, 0x56, 0xbb, 0xe9, 0x44, 0x52, 0xeb, 0x7e, - 0x35, 0x73, 0xe5, 0x26, 0x2c, 0x56, 0x8d, 0x8a, 0x4b, 0x8f, 0xd1, 0xeb, 0x29, 0x03, 0x80, 0xb3, - 0x9a, 0xb1, 0x7f, 0x61, 0x04, 0x06, 0x57, 0xf6, 0x88, 0x17, 0x9d, 0xc0, 0x13, 0xa1, 0x0e, 0x13, - 0xae, 0xb7, 0xe7, 0x37, 0xf7, 0x48, 0x83, 0xc3, 0x8f, 0xf2, 0x92, 0x3d, 0x23, 0x48, 0x4f, 0x54, - 0x0c, 0x12, 0x38, 0x41, 0xf2, 0x51, 0x48, 0x93, 0xaf, 0xc1, 0x10, 0x3f, 0xc4, 0x85, 0x28, 0x39, - 0xf3, 0xcc, 0x66, 0x83, 0x28, 0xae, 0xa6, 0x58, 0xd2, 0xcd, 0x2f, 0x09, 0x51, 0x1d, 0x7d, 0x0e, - 0x26, 0xb6, 0xdc, 0x20, 0x8c, 0x36, 0xdc, 0x16, 0x09, 0x23, 0xa7, 0xd5, 0x7e, 0x08, 0xe9, 0xb1, - 0x1a, 0x87, 0x55, 0x83, 0x12, 0x4e, 0x50, 0x46, 0xdb, 0x30, 0xde, 0x74, 0xf4, 0xa6, 0x86, 0x8f, - 0xdc, 0x94, 0xba, 0x1d, 0x6e, 0xea, 0x84, 0xb0, 0x49, 0x97, 0x6e, 0xa7, 0x3a, 0x13, 0x80, 0x8e, - 0x30, 0xb1, 0x80, 0xda, 0x4e, 0x5c, 0xf2, 0xc9, 0x61, 0x94, 0xd1, 0x61, 0x06, 0xb2, 0x25, 0x93, - 0xd1, 0xd1, 0xcc, 0x60, 0x3f, 0x0b, 0x25, 0x42, 0x87, 0x90, 0x12, 0x16, 0x17, 0xcc, 0x95, 0xfe, - 0xfa, 0xba, 0xe6, 0xd6, 0x03, 0xdf, 0x94, 0xdb, 0xaf, 0x48, 0x4a, 0x38, 0x26, 0x8a, 0x96, 0x61, - 0x28, 0x24, 0x81, 0x4b, 0x42, 0x71, 0xd5, 0x74, 0x99, 0x46, 0x86, 0xc6, 0x7d, 0x4b, 0xf8, 0x6f, - 0x2c, 0xaa, 0xd2, 0xe5, 0xe5, 0x30, 0x91, 0x26, 0xbb, 0x0c, 0xb4, 0xe5, 0xb5, 0xc8, 0x4a, 0xb1, - 0x80, 0xa2, 0xd7, 0x61, 0x38, 0x20, 0x4d, 0xa6, 0x18, 0x1a, 0xef, 0x7f, 0x91, 0x73, 0x3d, 0x13, - 0xaf, 0x87, 0x25, 0x01, 0x74, 0x03, 0x50, 0x40, 0x28, 0xa3, 0xe4, 0x7a, 0xdb, 0xca, 0x6c, 0x54, - 0x1c, 0xb4, 0x8a, 0x21, 0xc5, 0x31, 0x86, 0x74, 0xf3, 0xc1, 0x19, 0xd5, 0xd0, 0x35, 0x98, 0x56, - 0xa5, 0x15, 0x2f, 0x8c, 0x1c, 0x7a, 0xc0, 0x4d, 0x32, 0x5a, 0x4a, 0x4e, 0x81, 0x93, 0x08, 0x38, - 0x5d, 0xc7, 0xfe, 0xb2, 0x05, 0x7c, 0x9c, 0x4f, 0xe0, 0x75, 0xfe, 0x9a, 0xf9, 0x3a, 0x3f, 0x9b, - 0x3b, 0x73, 0x39, 0x2f, 0xf3, 0x2f, 0x5b, 0x30, 0xaa, 0xcd, 0x6c, 0xbc, 0x66, 0xad, 0x2e, 0x6b, - 0xb6, 0x03, 0x53, 0x74, 0xa5, 0xdf, 0xda, 0x0c, 0x49, 0xb0, 0x47, 0x1a, 0x6c, 0x61, 0x16, 0x1e, - 0x6e, 0x61, 0x2a, 0x13, 0xb5, 0x9b, 0x09, 0x82, 0x38, 0xd5, 0x84, 0xfd, 0x59, 0xd9, 0x55, 0x65, - 0xd1, 0x57, 0x57, 0x73, 0x9e, 0xb0, 0xe8, 0x53, 0xb3, 0x8a, 0x63, 0x1c, 0xba, 0xd5, 0x76, 0xfc, - 0x30, 0x4a, 0x5a, 0xf4, 0x5d, 0xf7, 0xc3, 0x08, 0x33, 0x88, 0xfd, 0x02, 0xc0, 0xca, 0x7d, 0x52, - 0xe7, 0x2b, 0x56, 0x7f, 0x3c, 0x58, 0xf9, 0x8f, 0x07, 0xfb, 0xb7, 0x2c, 0x98, 0x58, 0x5d, 0x36, - 0x6e, 0xae, 0x05, 0x00, 0xfe, 0xe2, 0xb9, 0x7b, 0x77, 0x5d, 0xaa, 0xc3, 0xb9, 0x46, 0x53, 0x95, - 0x62, 0x0d, 0x03, 0x9d, 0x85, 0x62, 0xb3, 0xe3, 0x09, 0xf1, 0xe1, 0x30, 0xbd, 0x1e, 0x6f, 0x76, - 0x3c, 0x4c, 0xcb, 0x34, 0x97, 0x82, 0x62, 0xdf, 0x2e, 0x05, 0x3d, 0x5d, 0xfb, 0xd1, 0x3c, 0x0c, - 0xde, 0xbb, 0xe7, 0x36, 0xb8, 0x03, 0xa5, 0x50, 0xd5, 0xdf, 0xbd, 0x5b, 0x29, 0x87, 0x98, 0x97, - 0xdb, 0x5f, 0x2a, 0xc2, 0xdc, 0x6a, 0x93, 0xdc, 0x7f, 0x87, 0x4e, 0xa4, 0xfd, 0x3a, 0x44, 0x1c, - 0x4d, 0x10, 0x73, 0x54, 0xa7, 0x97, 0xde, 0xe3, 0xb1, 0x05, 0xc3, 0xdc, 0xa0, 0x4d, 0xba, 0x94, - 0xbe, 0x9a, 0xd5, 0x7a, 0xfe, 0x80, 0x2c, 0x70, 0xc3, 0x38, 0xe1, 0x11, 0xa7, 0x2e, 0x4c, 0x51, - 0x8a, 0x25, 0xf1, 0xb9, 0x57, 0x60, 0x4c, 0xc7, 0x3c, 0x92, 0xfb, 0xd9, 0xff, 0x57, 0x84, 0x29, - 0xda, 0x83, 0x47, 0x3a, 0x11, 0xb7, 0xd3, 0x13, 0x71, 0xdc, 0x2e, 0x48, 0xbd, 0x67, 0xe3, 0xcd, - 0xe4, 0x6c, 0x5c, 0xcd, 0x9b, 0x8d, 0x93, 0x9e, 0x83, 0xef, 0xb4, 0x60, 0x66, 0xb5, 0xe9, 0xd7, - 0x77, 0x13, 0x6e, 0x42, 0x2f, 0xc1, 0x28, 0x3d, 0x8e, 0x43, 0xc3, 0x83, 0xdd, 0x88, 0x69, 0x20, - 0x40, 0x58, 0xc7, 0xd3, 0xaa, 0xdd, 0xbe, 0x5d, 0x29, 0x67, 0x85, 0x42, 0x10, 0x20, 0xac, 0xe3, - 0xd9, 0xbf, 0x61, 0xc1, 0xb9, 0x6b, 0xcb, 0x2b, 0xf1, 0x52, 0x4c, 0x45, 0x63, 0xb8, 0x04, 0x43, - 0xed, 0x86, 0xd6, 0x95, 0x58, 0xbc, 0x5a, 0x66, 0xbd, 0x10, 0xd0, 0x77, 0x4b, 0xa4, 0x91, 0x9f, - 0xb2, 0x60, 0xe6, 0x9a, 0x1b, 0xd1, 0xdb, 0x35, 0x19, 0x17, 0x80, 0x5e, 0xaf, 0xa1, 0x1b, 0xf9, - 0xc1, 0x7e, 0x32, 0x2e, 0x00, 0x56, 0x10, 0xac, 0x61, 0xf1, 0x96, 0xf7, 0x5c, 0x66, 0x4a, 0x5d, - 0x30, 0x15, 0x4d, 0x58, 0x94, 0x63, 0x85, 0x41, 0x3f, 0xac, 0xe1, 0x06, 0x4c, 0x46, 0xb7, 0x2f, - 0x4e, 0x58, 0xf5, 0x61, 0x65, 0x09, 0xc0, 0x31, 0x8e, 0xfd, 0x47, 0x16, 0xcc, 0x5f, 0x6b, 0x76, - 0xc2, 0x88, 0x04, 0x5b, 0x61, 0xce, 0xe9, 0xf8, 0x02, 0x94, 0x88, 0x94, 0x88, 0x8b, 0x5e, 0x2b, - 0x8e, 0x51, 0x89, 0xca, 0x79, 0x78, 0x02, 0x85, 0xd7, 0x87, 0xd3, 0xe1, 0xd1, 0xbc, 0xc6, 0x56, - 0x01, 0x11, 0xbd, 0x2d, 0x3d, 0x5e, 0x03, 0x73, 0xfc, 0x5e, 0x49, 0x41, 0x71, 0x46, 0x0d, 0xfb, - 0xc7, 0x2c, 0x38, 0xad, 0x3e, 0xf8, 0x5d, 0xf7, 0x99, 0xf6, 0xcf, 0x16, 0x60, 0xfc, 0xfa, 0xc6, - 0x46, 0xf5, 0x1a, 0x89, 0xc4, 0xb5, 0xdd, 0x5b, 0xcf, 0x8d, 0x35, 0x75, 0x5d, 0xb7, 0xc7, 0x5c, - 0x27, 0x72, 0x9b, 0x0b, 0x3c, 0xec, 0xcf, 0x42, 0xc5, 0x8b, 0x6e, 0x05, 0xb5, 0x28, 0x70, 0xbd, - 0xed, 0x4c, 0x05, 0x9f, 0x64, 0x2e, 0x8a, 0x79, 0xcc, 0x05, 0x7a, 0x01, 0x86, 0x58, 0xdc, 0x21, - 0x39, 0x09, 0x8f, 0xab, 0xb7, 0x10, 0x2b, 0x3d, 0x3c, 0x98, 0x2f, 0xdd, 0xc6, 0x15, 0xfe, 0x07, - 0x0b, 0x54, 0x74, 0x1b, 0x46, 0x77, 0xa2, 0xa8, 0x7d, 0x9d, 0x38, 0x0d, 0x12, 0xc8, 0xe3, 0xf0, - 0x7c, 0xd6, 0x71, 0x48, 0x07, 0x81, 0xa3, 0xc5, 0x27, 0x48, 0x5c, 0x16, 0x62, 0x9d, 0x8e, 0x5d, - 0x03, 0x88, 0x61, 0xc7, 0xa4, 0xa9, 0xb0, 0xff, 0xc0, 0x82, 0x61, 0x1e, 0x02, 0x22, 0x40, 0x1f, - 0x85, 0x01, 0x72, 0x9f, 0xd4, 0x05, 0xc7, 0x9b, 0xd9, 0xe1, 0x98, 0xd3, 0xe2, 0x12, 0x57, 0xfa, - 0x1f, 0xb3, 0x5a, 0xe8, 0x3a, 0x0c, 0xd3, 0xde, 0x5e, 0x53, 0xf1, 0x30, 0x9e, 0xcc, 0xfb, 0x62, - 0x35, 0xed, 0x9c, 0x39, 0x13, 0x45, 0x58, 0x56, 0x67, 0xea, 0xe1, 0x7a, 0xbb, 0x46, 0x4f, 0xec, - 0xa8, 0x1b, 0x63, 0xb1, 0xb1, 0x5c, 0xe5, 0x48, 0x82, 0x1a, 0x57, 0x0f, 0xcb, 0x42, 0x1c, 0x13, - 0xb1, 0x37, 0xa0, 0x44, 0x27, 0x75, 0xb1, 0xe9, 0x3a, 0xdd, 0x35, 0xde, 0xcf, 0x40, 0x49, 0xea, - 0xb3, 0x43, 0xe1, 0xfa, 0xcd, 0xa8, 0x4a, 0x75, 0x77, 0x88, 0x63, 0xb8, 0xbd, 0x05, 0xa7, 0x98, - 0x75, 0xa2, 0x13, 0xed, 0x18, 0x7b, 0xac, 0xf7, 0x62, 0x7e, 0x56, 0x3c, 0x20, 0xf9, 0xcc, 0xcc, - 0x6a, 0xde, 0x95, 0x63, 0x92, 0x62, 0xfc, 0x98, 0xb4, 0xbf, 0x36, 0x00, 0x8f, 0x57, 0x6a, 0xf9, - 0xd1, 0x41, 0x5e, 0x86, 0x31, 0xce, 0x97, 0xd2, 0xa5, 0xed, 0x34, 0x45, 0xbb, 0x4a, 0xd4, 0xba, - 0xa1, 0xc1, 0xb0, 0x81, 0x89, 0xce, 0x41, 0xd1, 0x7d, 0xcb, 0x4b, 0xfa, 0x1e, 0x55, 0xde, 0x58, - 0xc7, 0xb4, 0x9c, 0x82, 0x29, 0x8b, 0xcb, 0xef, 0x0e, 0x05, 0x56, 0x6c, 0xee, 0x6b, 0x30, 0xe1, - 0x86, 0xf5, 0xd0, 0xad, 0x78, 0xf4, 0x9c, 0xd1, 0x4e, 0x2a, 0x25, 0xdc, 0xa0, 0x9d, 0x56, 0x50, - 0x9c, 0xc0, 0xd6, 0x2e, 0xb2, 0xc1, 0xbe, 0xd9, 0xe4, 0x9e, 0xbe, 0xd0, 0xf4, 0x05, 0xd0, 0x66, - 0x5f, 0x17, 0x32, 0x99, 0xb9, 0x78, 0x01, 0xf0, 0x0f, 0x0e, 0xb1, 0x84, 0xd1, 0x97, 0x63, 0x7d, - 0xc7, 0x69, 0x2f, 0x76, 0xa2, 0x9d, 0xb2, 0x1b, 0xd6, 0xfd, 0x3d, 0x12, 0xec, 0xb3, 0x47, 0xff, - 0x48, 0xfc, 0x72, 0x54, 0x80, 0xe5, 0xeb, 0x8b, 0x55, 0x8a, 0x89, 0xd3, 0x75, 0xd0, 0x22, 0x4c, - 0xca, 0xc2, 0x1a, 0x09, 0xd9, 0x15, 0x36, 0xca, 0xc8, 0x28, 0x6f, 0x20, 0x51, 0xac, 0x88, 0x24, - 0xf1, 0x4d, 0x4e, 0x1a, 0x8e, 0x83, 0x93, 0xfe, 0x08, 0x8c, 0xbb, 0x9e, 0x1b, 0xb9, 0x4e, 0xe4, - 0x73, 0x85, 0x0f, 0x7f, 0xdf, 0x33, 0x49, 0x76, 0x45, 0x07, 0x60, 0x13, 0xcf, 0xfe, 0x2f, 0x03, - 0x30, 0xcd, 0xa6, 0xed, 0xbd, 0x15, 0xf6, 0xcd, 0xb4, 0xc2, 0x6e, 0xa7, 0x57, 0xd8, 0x71, 0x3c, - 0x11, 0x1e, 0x7a, 0x99, 0x7d, 0x0e, 0x4a, 0xca, 0x01, 0x4a, 0x7a, 0x40, 0x5a, 0x39, 0x1e, 0x90, - 0xbd, 0xb9, 0x0f, 0x69, 0x43, 0x56, 0xcc, 0xb4, 0x21, 0xfb, 0xeb, 0x16, 0xc4, 0x1a, 0x0c, 0x74, - 0x1d, 0x4a, 0x6d, 0x9f, 0x99, 0x46, 0x06, 0xd2, 0xde, 0xf8, 0xf1, 0xcc, 0x8b, 0x8a, 0x5f, 0x8a, - 0xfc, 0xe3, 0xab, 0xb2, 0x06, 0x8e, 0x2b, 0xa3, 0x25, 0x18, 0x6e, 0x07, 0xa4, 0x16, 0xb1, 0x20, - 0x21, 0x3d, 0xe9, 0xf0, 0x35, 0xc2, 0xf1, 0xb1, 0xac, 0x68, 0xff, 0x9c, 0x05, 0xc0, 0xcd, 0xb4, - 0x1c, 0x6f, 0x9b, 0x9c, 0x80, 0xd4, 0xba, 0x0c, 0x03, 0x61, 0x9b, 0xd4, 0xbb, 0x19, 0xad, 0xc6, - 0xfd, 0xa9, 0xb5, 0x49, 0x3d, 0x1e, 0x70, 0xfa, 0x0f, 0xb3, 0xda, 0xf6, 0x77, 0x03, 0x4c, 0xc4, - 0x68, 0x95, 0x88, 0xb4, 0xd0, 0x73, 0x46, 0xd0, 0x80, 0xb3, 0x89, 0xa0, 0x01, 0x25, 0x86, 0xad, - 0x09, 0x48, 0x3f, 0x07, 0xc5, 0x96, 0x73, 0x5f, 0x48, 0xc0, 0x9e, 0xe9, 0xde, 0x0d, 0x4a, 0x7f, - 0x61, 0xcd, 0xb9, 0xcf, 0x1f, 0x89, 0xcf, 0xc8, 0x05, 0xb2, 0xe6, 0xdc, 0x3f, 0xe4, 0xa6, 0xa9, - 0xec, 0x90, 0xba, 0xe9, 0x86, 0xd1, 0x17, 0xfe, 0x73, 0xfc, 0x9f, 0x2d, 0x3b, 0xda, 0x08, 0x6b, - 0xcb, 0xf5, 0x84, 0x05, 0x52, 0x5f, 0x6d, 0xb9, 0x5e, 0xb2, 0x2d, 0xd7, 0xeb, 0xa3, 0x2d, 0xd7, - 0x43, 0x6f, 0xc3, 0xb0, 0x30, 0x10, 0x14, 0x41, 0x7a, 0xae, 0xf4, 0xd1, 0x9e, 0xb0, 0x2f, 0xe4, - 0x6d, 0x5e, 0x91, 0x8f, 0x60, 0x51, 0xda, 0xb3, 0x5d, 0xd9, 0x20, 0xfa, 0x2b, 0x16, 0x4c, 0x88, - 0xdf, 0x98, 0xbc, 0xd5, 0x21, 0x61, 0x24, 0x78, 0xcf, 0x0f, 0xf7, 0xdf, 0x07, 0x51, 0x91, 0x77, - 0xe5, 0xc3, 0xf2, 0x98, 0x35, 0x81, 0x3d, 0x7b, 0x94, 0xe8, 0x05, 0xfa, 0xfb, 0x16, 0x9c, 0x6a, - 0x39, 0xf7, 0x79, 0x8b, 0xbc, 0x0c, 0x3b, 0x91, 0xeb, 0x0b, 0x45, 0xfb, 0x47, 0xfb, 0x9b, 0xfe, - 0x54, 0x75, 0xde, 0x49, 0xa9, 0x0d, 0x3c, 0x95, 0x85, 0xd2, 0xb3, 0xab, 0x99, 0xfd, 0x9a, 0xdb, - 0x82, 0x11, 0xb9, 0xde, 0x32, 0x44, 0x0d, 0x65, 0x9d, 0xb1, 0x3e, 0xb2, 0x7d, 0xa6, 0xee, 0x8c, - 0x4f, 0xdb, 0x11, 0x6b, 0xed, 0x91, 0xb6, 0xf3, 0x39, 0x18, 0xd3, 0xd7, 0xd8, 0x23, 0x6d, 0xeb, - 0x2d, 0x98, 0xc9, 0x58, 0x4b, 0x8f, 0xb4, 0xc9, 0x7b, 0x70, 0x36, 0x77, 0x7d, 0x3c, 0xca, 0x86, - 0xed, 0x9f, 0xb5, 0xf4, 0x73, 0xf0, 0x04, 0x54, 0x07, 0xcb, 0xa6, 0xea, 0xe0, 0x7c, 0xf7, 0x9d, - 0x93, 0xa3, 0x3f, 0x78, 0x53, 0xef, 0x34, 0x3d, 0xd5, 0xd1, 0xeb, 0x30, 0xd4, 0xa4, 0x25, 0xd2, - 0xcc, 0xd4, 0xee, 0xbd, 0x23, 0x63, 0x5e, 0x8a, 0x95, 0x87, 0x58, 0x50, 0xb0, 0x7f, 0xd1, 0x82, - 0x81, 0x13, 0x18, 0x09, 0x6c, 0x8e, 0xc4, 0x73, 0xb9, 0xa4, 0x45, 0xfc, 0xe0, 0x05, 0xec, 0xdc, - 0x5b, 0xb9, 0x1f, 0x11, 0x2f, 0x64, 0x4f, 0xc5, 0xcc, 0x81, 0xf9, 0x49, 0x0b, 0x66, 0x6e, 0xfa, - 0x4e, 0x63, 0xc9, 0x69, 0x3a, 0x5e, 0x9d, 0x04, 0x15, 0x6f, 0xfb, 0x48, 0x36, 0xd2, 0x85, 0x9e, - 0x36, 0xd2, 0xcb, 0xd2, 0xc4, 0x68, 0x20, 0x7f, 0xfe, 0x28, 0x23, 0x99, 0x0c, 0xa3, 0x62, 0x18, - 0xc3, 0xee, 0x00, 0xd2, 0x7b, 0x29, 0x3c, 0x56, 0x30, 0x0c, 0xbb, 0xbc, 0xbf, 0x62, 0x12, 0x9f, - 0xca, 0x66, 0xf0, 0x52, 0x9f, 0xa7, 0xf9, 0x62, 0xf0, 0x02, 0x2c, 0x09, 0xd9, 0x2f, 0x43, 0xa6, - 0xdb, 0x7b, 0x6f, 0xe1, 0x83, 0xfd, 0x49, 0x98, 0x66, 0x35, 0x8f, 0xf8, 0x30, 0xb6, 0x13, 0xb2, - 0xcd, 0x8c, 0x80, 0x78, 0xf6, 0x17, 0x2d, 0x98, 0x5c, 0x4f, 0xc4, 0x09, 0xbb, 0xc4, 0xb4, 0xa1, - 0x19, 0x22, 0xf5, 0x1a, 0x2b, 0xc5, 0x02, 0x7a, 0xec, 0x92, 0xac, 0xbf, 0xb0, 0x20, 0x8e, 0x44, - 0x71, 0x02, 0xec, 0xdb, 0xb2, 0xc1, 0xbe, 0x65, 0x4a, 0x58, 0x54, 0x77, 0xf2, 0xb8, 0x37, 0x74, - 0x43, 0xc5, 0x68, 0xea, 0x22, 0x5c, 0x89, 0xc9, 0xf0, 0xa5, 0x38, 0x61, 0x06, 0x72, 0x92, 0x51, - 0x9b, 0xec, 0xdf, 0x2e, 0x00, 0x52, 0xb8, 0x7d, 0xc7, 0x90, 0x4a, 0xd7, 0x38, 0x9e, 0x18, 0x52, - 0x7b, 0x80, 0x98, 0x3e, 0x3f, 0x70, 0xbc, 0x90, 0x93, 0x75, 0x85, 0xec, 0xee, 0x68, 0xc6, 0x02, - 0x73, 0xa2, 0x49, 0x74, 0x33, 0x45, 0x0d, 0x67, 0xb4, 0xa0, 0xd9, 0x69, 0x0c, 0xf6, 0x6b, 0xa7, - 0x31, 0xd4, 0xc3, 0x2b, 0xed, 0x67, 0x2c, 0x18, 0x57, 0xc3, 0xf4, 0x2e, 0xb1, 0x19, 0x57, 0xfd, - 0xc9, 0x39, 0x40, 0xab, 0x5a, 0x97, 0xd9, 0xc5, 0xf2, 0xad, 0xcc, 0xbb, 0xd0, 0x69, 0xba, 0x6f, - 0x13, 0x15, 0xc1, 0x6f, 0x5e, 0x78, 0x0b, 0x8a, 0xd2, 0xc3, 0x83, 0xf9, 0x71, 0xf5, 0x8f, 0x47, - 0x0c, 0x8e, 0xab, 0xd0, 0x23, 0x79, 0x32, 0xb1, 0x14, 0xd1, 0x4b, 0x30, 0xd8, 0xde, 0x71, 0x42, - 0x92, 0xf0, 0xad, 0x19, 0xac, 0xd2, 0xc2, 0xc3, 0x83, 0xf9, 0x09, 0x55, 0x81, 0x95, 0x60, 0x8e, - 0xdd, 0x7f, 0x64, 0xae, 0xf4, 0xe2, 0xec, 0x19, 0x99, 0xeb, 0x4f, 0x2c, 0x18, 0x58, 0xf7, 0x1b, - 0x27, 0x71, 0x04, 0xbc, 0x66, 0x1c, 0x01, 0x4f, 0xe4, 0x05, 0x73, 0xcf, 0xdd, 0xfd, 0xab, 0x89, - 0xdd, 0x7f, 0x3e, 0x97, 0x42, 0xf7, 0x8d, 0xdf, 0x82, 0x51, 0x16, 0x22, 0x5e, 0xf8, 0x11, 0xbd, - 0x60, 0x6c, 0xf8, 0xf9, 0xc4, 0x86, 0x9f, 0xd4, 0x50, 0xb5, 0x9d, 0xfe, 0x34, 0x0c, 0x0b, 0xc7, - 0x94, 0xa4, 0x93, 0xa6, 0xc0, 0xc5, 0x12, 0x6e, 0xff, 0x78, 0x11, 0x8c, 0x90, 0xf4, 0xe8, 0x97, - 0x2d, 0x58, 0x08, 0xb8, 0xc1, 0x6a, 0xa3, 0xdc, 0x09, 0x5c, 0x6f, 0xbb, 0x56, 0xdf, 0x21, 0x8d, - 0x4e, 0xd3, 0xf5, 0xb6, 0x2b, 0xdb, 0x9e, 0xaf, 0x8a, 0x57, 0xee, 0x93, 0x7a, 0x87, 0x29, 0xc1, - 0x7a, 0xc4, 0xbf, 0x57, 0x86, 0xdf, 0xcf, 0x3f, 0x38, 0x98, 0x5f, 0xc0, 0x47, 0xa2, 0x8d, 0x8f, - 0xd8, 0x17, 0xf4, 0x1b, 0x16, 0x5c, 0xe1, 0x91, 0xda, 0xfb, 0xef, 0x7f, 0x97, 0xd7, 0x72, 0x55, - 0x92, 0x8a, 0x89, 0x6c, 0x90, 0xa0, 0xb5, 0xf4, 0x11, 0x31, 0xa0, 0x57, 0xaa, 0x47, 0x6b, 0x0b, - 0x1f, 0xb5, 0x73, 0xf6, 0x3f, 0x2b, 0xc2, 0xb8, 0x88, 0xe0, 0x24, 0xee, 0x80, 0x97, 0x8c, 0x25, - 0xf1, 0x64, 0x62, 0x49, 0x4c, 0x1b, 0xc8, 0xc7, 0x73, 0xfc, 0x87, 0x30, 0x4d, 0x0f, 0xe7, 0xeb, - 0xc4, 0x09, 0xa2, 0x4d, 0xe2, 0x70, 0xf3, 0xab, 0xe2, 0x91, 0x4f, 0x7f, 0x25, 0x9e, 0xbb, 0x99, - 0x24, 0x86, 0xd3, 0xf4, 0xbf, 0x99, 0xee, 0x1c, 0x0f, 0xa6, 0x52, 0x41, 0xb8, 0x3e, 0x05, 0x25, - 0xe5, 0x55, 0x21, 0x0e, 0x9d, 0xee, 0xb1, 0xec, 0x92, 0x14, 0xb8, 0x08, 0x2d, 0xf6, 0xe8, 0x89, - 0xc9, 0xd9, 0xff, 0xa0, 0x60, 0x34, 0xc8, 0x27, 0x71, 0x1d, 0x46, 0x9c, 0x30, 0x74, 0xb7, 0x3d, - 0xd2, 0x10, 0x3b, 0xf6, 0xfd, 0x79, 0x3b, 0xd6, 0x68, 0x86, 0x79, 0xb6, 0x2c, 0x8a, 0x9a, 0x58, - 0xd1, 0x40, 0xd7, 0xb9, 0x91, 0xdb, 0x9e, 0x7c, 0xef, 0xf5, 0x47, 0x0d, 0xa4, 0x19, 0xdc, 0x1e, - 0xc1, 0xa2, 0x3e, 0xfa, 0x34, 0xb7, 0x42, 0xbc, 0xe1, 0xf9, 0xf7, 0xbc, 0x6b, 0xbe, 0x2f, 0xa3, - 0x24, 0xf4, 0x47, 0x70, 0x5a, 0xda, 0x1e, 0xaa, 0xea, 0xd8, 0xa4, 0xd6, 0x5f, 0x54, 0xcb, 0xcf, - 0xc3, 0x0c, 0x25, 0x6d, 0x3a, 0x31, 0x87, 0x88, 0xc0, 0xa4, 0x08, 0x0f, 0x26, 0xcb, 0xc4, 0xd8, - 0x65, 0x3e, 0xe5, 0xcc, 0xda, 0xb1, 0x1c, 0xf9, 0x86, 0x49, 0x02, 0x27, 0x69, 0xda, 0x7f, 0xdb, - 0x02, 0xe6, 0xd0, 0x79, 0x02, 0xfc, 0xc8, 0xc7, 0x4c, 0x7e, 0x64, 0x36, 0x6f, 0x90, 0x73, 0x58, - 0x91, 0x17, 0xf9, 0xca, 0xaa, 0x06, 0xfe, 0xfd, 0x7d, 0x61, 0x3a, 0xd2, 0xfb, 0xfd, 0x61, 0xff, - 0x6f, 0x8b, 0x1f, 0x62, 0xca, 0xe7, 0x01, 0x7d, 0x3b, 0x8c, 0xd4, 0x9d, 0xb6, 0x53, 0xe7, 0xf9, - 0x53, 0x72, 0x25, 0x7a, 0x46, 0xa5, 0x85, 0x65, 0x51, 0x83, 0x4b, 0xa8, 0x64, 0x98, 0xb9, 0x11, - 0x59, 0xdc, 0x53, 0x2a, 0xa5, 0x9a, 0x9c, 0xdb, 0x85, 0x71, 0x83, 0xd8, 0x23, 0x15, 0x67, 0x7c, - 0x3b, 0xbf, 0x62, 0x55, 0x58, 0xc4, 0x16, 0x4c, 0x7b, 0xda, 0x7f, 0x7a, 0xa1, 0xc8, 0xc7, 0xe5, - 0xfb, 0x7b, 0x5d, 0xa2, 0xec, 0xf6, 0xd1, 0x7c, 0x45, 0x13, 0x64, 0x70, 0x9a, 0xb2, 0xfd, 0x13, - 0x16, 0x3c, 0xa6, 0x23, 0x6a, 0xee, 0x28, 0xbd, 0x74, 0x04, 0x65, 0x18, 0xf1, 0xdb, 0x24, 0x70, - 0x22, 0x3f, 0x10, 0xb7, 0xc6, 0x65, 0x39, 0xe8, 0xb7, 0x44, 0xf9, 0xa1, 0x88, 0x3e, 0x2e, 0xa9, - 0xcb, 0x72, 0xac, 0x6a, 0xd2, 0xd7, 0x27, 0x1b, 0x8c, 0x50, 0x38, 0x1e, 0xb1, 0x33, 0x80, 0xa9, - 0xcb, 0x43, 0x2c, 0x20, 0xf6, 0xd7, 0x2c, 0xbe, 0xb0, 0xf4, 0xae, 0xa3, 0xb7, 0x60, 0xaa, 0xe5, - 0x44, 0xf5, 0x9d, 0x95, 0xfb, 0xed, 0x80, 0x6b, 0x5c, 0xe4, 0x38, 0x3d, 0xd3, 0x6b, 0x9c, 0xb4, - 0x8f, 0x8c, 0x0d, 0x2b, 0xd7, 0x12, 0xc4, 0x70, 0x8a, 0x3c, 0xda, 0x84, 0x51, 0x56, 0xc6, 0x7c, - 0xea, 0xc2, 0x6e, 0xac, 0x41, 0x5e, 0x6b, 0xca, 0xe2, 0x60, 0x2d, 0xa6, 0x83, 0x75, 0xa2, 0xf6, - 0x4f, 0x17, 0xf9, 0x6e, 0x67, 0xac, 0xfc, 0xd3, 0x30, 0xdc, 0xf6, 0x1b, 0xcb, 0x95, 0x32, 0x16, - 0xb3, 0xa0, 0xae, 0x91, 0x2a, 0x2f, 0xc6, 0x12, 0x8e, 0x2e, 0xc3, 0x88, 0xf8, 0x29, 0x35, 0x64, - 0xec, 0x6c, 0x16, 0x78, 0x21, 0x56, 0x50, 0xf4, 0x3c, 0x40, 0x3b, 0xf0, 0xf7, 0xdc, 0x06, 0x8b, - 0xf5, 0x50, 0x34, 0x8d, 0x85, 0xaa, 0x0a, 0x82, 0x35, 0x2c, 0xf4, 0x2a, 0x8c, 0x77, 0xbc, 0x90, - 0xb3, 0x23, 0x5a, 0x64, 0x57, 0x65, 0xc6, 0x72, 0x5b, 0x07, 0x62, 0x13, 0x17, 0x2d, 0xc2, 0x50, - 0xe4, 0x30, 0xe3, 0x97, 0xc1, 0x7c, 0xe3, 0xdb, 0x0d, 0x8a, 0xa1, 0xa7, 0xea, 0xa0, 0x15, 0xb0, - 0xa8, 0x88, 0x3e, 0x25, 0xdd, 0x5b, 0xf9, 0xc1, 0x2e, 0xac, 0xde, 0xfb, 0xbb, 0x04, 0x34, 0xe7, - 0x56, 0x61, 0x4d, 0x6f, 0xd0, 0x42, 0xaf, 0x00, 0x90, 0xfb, 0x11, 0x09, 0x3c, 0xa7, 0xa9, 0x6c, - 0xcb, 0x14, 0x5f, 0x50, 0xf6, 0xd7, 0xfd, 0xe8, 0x76, 0x48, 0x56, 0x14, 0x06, 0xd6, 0xb0, 0xed, - 0xdf, 0x28, 0x01, 0xc4, 0x7c, 0x3b, 0x7a, 0x3b, 0x75, 0x70, 0x3d, 0xdb, 0x9d, 0xd3, 0x3f, 0xbe, - 0x53, 0x0b, 0x7d, 0x8f, 0x05, 0xa3, 0x4e, 0xb3, 0xe9, 0xd7, 0x1d, 0x1e, 0x7b, 0xb7, 0xd0, 0xfd, - 0xe0, 0x14, 0xed, 0x2f, 0xc6, 0x35, 0x78, 0x17, 0x5e, 0x90, 0x2b, 0x54, 0x83, 0xf4, 0xec, 0x85, - 0xde, 0x30, 0xfa, 0x90, 0x7c, 0x2a, 0x16, 0x8d, 0xa1, 0x54, 0x4f, 0xc5, 0x12, 0xbb, 0x23, 0xf4, - 0x57, 0xe2, 0x6d, 0xe3, 0x95, 0x38, 0x90, 0xef, 0xbf, 0x67, 0xb0, 0xaf, 0xbd, 0x1e, 0x88, 0xa8, - 0xaa, 0xfb, 0xf2, 0x0f, 0xe6, 0x3b, 0xcb, 0x69, 0xef, 0xa4, 0x1e, 0x7e, 0xfc, 0x9f, 0x83, 0xc9, - 0x86, 0xc9, 0x04, 0x88, 0x95, 0xf8, 0x54, 0x1e, 0xdd, 0x04, 0xcf, 0x10, 0x5f, 0xfb, 0x09, 0x00, - 0x4e, 0x12, 0x46, 0x55, 0x1e, 0xda, 0xa1, 0xe2, 0x6d, 0xf9, 0xc2, 0xf3, 0xc2, 0xce, 0x9d, 0xcb, - 0xfd, 0x30, 0x22, 0x2d, 0x8a, 0x19, 0xdf, 0xee, 0xeb, 0xa2, 0x2e, 0x56, 0x54, 0xd0, 0xeb, 0x30, - 0xc4, 0xbc, 0xa5, 0xc2, 0xd9, 0x91, 0x7c, 0x89, 0xb3, 0x19, 0xab, 0x2c, 0xde, 0x90, 0xec, 0x6f, - 0x88, 0x05, 0x05, 0x74, 0x5d, 0xfa, 0x22, 0x86, 0x15, 0xef, 0x76, 0x48, 0x98, 0x2f, 0x62, 0x69, - 0xe9, 0xfd, 0xb1, 0x9b, 0x21, 0x2f, 0xcf, 0x4c, 0xe8, 0x65, 0xd4, 0xa4, 0x5c, 0x94, 0xf8, 0x2f, - 0xf3, 0x84, 0xcd, 0x42, 0x7e, 0xf7, 0xcc, 0x5c, 0x62, 0xf1, 0x70, 0xde, 0x31, 0x49, 0xe0, 0x24, - 0x4d, 0xca, 0x91, 0xf2, 0x5d, 0x2f, 0x7c, 0x37, 0x7a, 0x9d, 0x1d, 0xfc, 0x21, 0xce, 0x6e, 0x23, - 0x5e, 0x82, 0x45, 0xfd, 0x13, 0x65, 0x0f, 0xe6, 0x3c, 0x98, 0x4a, 0x6e, 0xd1, 0x47, 0xca, 0x8e, - 0xfc, 0xc1, 0x00, 0x4c, 0x98, 0x4b, 0x0a, 0x5d, 0x81, 0x92, 0x20, 0xa2, 0x62, 0xfb, 0xab, 0x5d, - 0xb2, 0x26, 0x01, 0x38, 0xc6, 0x61, 0x29, 0x1d, 0x58, 0x75, 0xcd, 0x58, 0x37, 0x4e, 0xe9, 0xa0, - 0x20, 0x58, 0xc3, 0xa2, 0x0f, 0xab, 0x4d, 0xdf, 0x8f, 0xd4, 0x85, 0xa4, 0xd6, 0xdd, 0x12, 0x2b, - 0xc5, 0x02, 0x4a, 0x2f, 0xa2, 0x5d, 0x12, 0x78, 0xa4, 0x69, 0x46, 0x01, 0x56, 0x17, 0xd1, 0x0d, - 0x1d, 0x88, 0x4d, 0x5c, 0x7a, 0x9d, 0xfa, 0x21, 0x5b, 0xc8, 0xe2, 0xf9, 0x16, 0x1b, 0x3f, 0xd7, - 0xb8, 0x3b, 0xb4, 0x84, 0xa3, 0x4f, 0xc2, 0x63, 0x2a, 0xd2, 0x11, 0xe6, 0xda, 0x0c, 0xd9, 0xe2, - 0x90, 0x21, 0x6d, 0x79, 0x6c, 0x39, 0x1b, 0x0d, 0xe7, 0xd5, 0x47, 0xaf, 0xc1, 0x84, 0x60, 0xf1, - 0x25, 0xc5, 0x61, 0xd3, 0xc0, 0xe6, 0x86, 0x01, 0xc5, 0x09, 0x6c, 0x19, 0xc7, 0x98, 0x71, 0xd9, - 0x92, 0xc2, 0x48, 0x3a, 0x8e, 0xb1, 0x0e, 0xc7, 0xa9, 0x1a, 0x68, 0x11, 0x26, 0x39, 0x0f, 0xe6, - 0x7a, 0xdb, 0x7c, 0x4e, 0x84, 0x6b, 0x95, 0xda, 0x52, 0xb7, 0x4c, 0x30, 0x4e, 0xe2, 0xa3, 0x97, - 0x61, 0xcc, 0x09, 0xea, 0x3b, 0x6e, 0x44, 0xea, 0x51, 0x27, 0xe0, 0x3e, 0x57, 0x9a, 0x85, 0xd2, - 0xa2, 0x06, 0xc3, 0x06, 0xa6, 0xfd, 0x36, 0xcc, 0x64, 0xc4, 0x49, 0xa0, 0x0b, 0xc7, 0x69, 0xbb, - 0xf2, 0x9b, 0x12, 0x66, 0xcc, 0x8b, 0xd5, 0x8a, 0xfc, 0x1a, 0x0d, 0x8b, 0xae, 0x4e, 0x16, 0x4f, - 0x41, 0x4b, 0x0b, 0xa8, 0x56, 0xe7, 0xaa, 0x04, 0xe0, 0x18, 0xc7, 0xfe, 0x1f, 0x05, 0x98, 0xcc, - 0xd0, 0xad, 0xb0, 0xd4, 0x74, 0x89, 0x47, 0x4a, 0x9c, 0x89, 0xce, 0x0c, 0x8b, 0x5d, 0x38, 0x42, - 0x58, 0xec, 0x62, 0xaf, 0xb0, 0xd8, 0x03, 0xef, 0x24, 0x2c, 0xb6, 0x39, 0x62, 0x83, 0x7d, 0x8d, - 0x58, 0x46, 0x28, 0xed, 0xa1, 0x23, 0x86, 0xd2, 0x36, 0x06, 0x7d, 0xb8, 0x8f, 0x41, 0xff, 0xe1, - 0x02, 0x4c, 0x25, 0x2d, 0x29, 0x4f, 0x40, 0x6e, 0xfb, 0xba, 0x21, 0xb7, 0xbd, 0xdc, 0x8f, 0x2b, - 0x6c, 0xae, 0x0c, 0x17, 0x27, 0x64, 0xb8, 0x1f, 0xec, 0x8b, 0x5a, 0x77, 0x79, 0xee, 0xdf, 0x2c, - 0xc0, 0xe9, 0x4c, 0x5f, 0xdc, 0x13, 0x18, 0x9b, 0x5b, 0xc6, 0xd8, 0x3c, 0xd7, 0xb7, 0x9b, 0x70, - 0xee, 0x00, 0xdd, 0x4d, 0x0c, 0xd0, 0x95, 0xfe, 0x49, 0x76, 0x1f, 0xa5, 0xaf, 0x16, 0xe1, 0x7c, - 0x66, 0xbd, 0x58, 0xec, 0xb9, 0x6a, 0x88, 0x3d, 0x9f, 0x4f, 0x88, 0x3d, 0xed, 0xee, 0xb5, 0x8f, - 0x47, 0x0e, 0x2a, 0xdc, 0x65, 0x99, 0xd3, 0xff, 0x43, 0xca, 0x40, 0x0d, 0x77, 0x59, 0x45, 0x08, - 0x9b, 0x74, 0xbf, 0x99, 0x64, 0x9f, 0xff, 0xc6, 0x82, 0xb3, 0x99, 0x73, 0x73, 0x02, 0xb2, 0xae, - 0x75, 0x53, 0xd6, 0xf5, 0x74, 0xdf, 0xab, 0x35, 0x47, 0xf8, 0xf5, 0x6b, 0x03, 0x39, 0xdf, 0xc2, - 0x5e, 0xf2, 0xb7, 0x60, 0xd4, 0xa9, 0xd7, 0x49, 0x18, 0xae, 0xf9, 0x0d, 0x15, 0xf9, 0xf7, 0x39, - 0xf6, 0xce, 0x8a, 0x8b, 0x0f, 0x0f, 0xe6, 0xe7, 0x92, 0x24, 0x62, 0x30, 0xd6, 0x29, 0xa0, 0x4f, - 0xc3, 0x48, 0x28, 0xee, 0x4d, 0x31, 0xf7, 0x2f, 0xf4, 0x39, 0x38, 0xce, 0x26, 0x69, 0x9a, 0xa1, - 0x89, 0x94, 0xa4, 0x42, 0x91, 0x34, 0xc3, 0x98, 0x14, 0x8e, 0x35, 0x8c, 0xc9, 0xf3, 0x00, 0x7b, - 0xea, 0x31, 0x90, 0x94, 0x3f, 0x68, 0xcf, 0x04, 0x0d, 0x0b, 0x7d, 0x1c, 0xa6, 0x42, 0x1e, 0xbb, - 0x6f, 0xb9, 0xe9, 0x84, 0xcc, 0x59, 0x46, 0xac, 0x42, 0x16, 0xfe, 0xa8, 0x96, 0x80, 0xe1, 0x14, - 0x36, 0x5a, 0x95, 0xad, 0xb2, 0x40, 0x83, 0x7c, 0x61, 0x5e, 0x8a, 0x5b, 0x14, 0x89, 0x71, 0x4f, - 0x25, 0x87, 0x9f, 0x0d, 0xbc, 0x56, 0x13, 0x7d, 0x1a, 0x80, 0x2e, 0x1f, 0x21, 0x87, 0x18, 0xce, - 0x3f, 0x3c, 0xe9, 0xa9, 0xd2, 0xc8, 0xb4, 0xed, 0x65, 0x1e, 0xae, 0x65, 0x45, 0x04, 0x6b, 0x04, - 0xed, 0x1f, 0x1e, 0x80, 0xc7, 0xbb, 0x9c, 0x91, 0x68, 0xd1, 0xd4, 0xc3, 0x3e, 0x93, 0x7c, 0x5c, - 0xcf, 0x65, 0x56, 0x36, 0x5e, 0xdb, 0x89, 0xa5, 0x58, 0x78, 0xc7, 0x4b, 0xf1, 0x07, 0x2c, 0x4d, - 0xec, 0xc1, 0x2d, 0x3e, 0x3f, 0x76, 0xc4, 0xb3, 0xff, 0x18, 0xe5, 0x20, 0x5b, 0x19, 0xc2, 0x84, - 0xe7, 0xfb, 0xee, 0x4e, 0xdf, 0xd2, 0x85, 0x93, 0x95, 0x12, 0xff, 0x96, 0x05, 0xe7, 0xba, 0x06, - 0xed, 0xf8, 0x06, 0x64, 0x18, 0xec, 0x2f, 0x58, 0xf0, 0x64, 0x66, 0x0d, 0xc3, 0xcc, 0xe8, 0x0a, - 0x94, 0xea, 0xb4, 0x50, 0xf3, 0xd2, 0x8c, 0xdd, 0xd7, 0x25, 0x00, 0xc7, 0x38, 0x86, 0x35, 0x51, - 0xa1, 0xa7, 0x35, 0xd1, 0xaf, 0x58, 0x90, 0xda, 0xf4, 0x27, 0x70, 0xfb, 0x54, 0xcc, 0xdb, 0xe7, - 0xfd, 0xfd, 0x8c, 0x66, 0xce, 0xc5, 0xf3, 0xc7, 0x93, 0x70, 0x26, 0xc7, 0x4b, 0x69, 0x0f, 0xa6, - 0xb7, 0xeb, 0xc4, 0xf4, 0x7f, 0xed, 0x16, 0x17, 0xa6, 0xab, 0xb3, 0x2c, 0x4b, 0xdd, 0x39, 0x9d, - 0x42, 0xc1, 0xe9, 0x26, 0xd0, 0x17, 0x2c, 0x38, 0xe5, 0xdc, 0x0b, 0x53, 0xb9, 0xfe, 0xc5, 0xda, - 0x79, 0x31, 0x53, 0xb2, 0x73, 0xb7, 0x96, 0xc2, 0x37, 0x9a, 0x67, 0xb9, 0x4c, 0xb3, 0xb0, 0x70, - 0x66, 0x5b, 0x08, 0x8b, 0x00, 0xf7, 0xf4, 0x8d, 0xd2, 0xc5, 0x43, 0x3b, 0xcb, 0x9d, 0x8c, 0x5f, - 0x8b, 0x12, 0x82, 0x15, 0x1d, 0xf4, 0x59, 0x28, 0x6d, 0x4b, 0x1f, 0xcf, 0x8c, 0x6b, 0x37, 0x1e, - 0xc8, 0xee, 0x9e, 0xaf, 0x5c, 0x3d, 0xab, 0x90, 0x70, 0x4c, 0x14, 0xbd, 0x06, 0x45, 0x6f, 0x2b, - 0xec, 0x96, 0x0e, 0x34, 0x61, 0x87, 0xc7, 0xe3, 0x20, 0xac, 0xaf, 0xd6, 0x30, 0xad, 0x88, 0xae, - 0x43, 0x31, 0xd8, 0x6c, 0x08, 0xb1, 0x64, 0xe6, 0x26, 0xc5, 0x4b, 0xe5, 0x9c, 0x5e, 0x31, 0x4a, - 0x78, 0xa9, 0x8c, 0x29, 0x09, 0x54, 0x85, 0x41, 0xe6, 0xda, 0x23, 0x2e, 0xb9, 0x4c, 0x76, 0xbe, - 0x8b, 0x8b, 0x1c, 0x0f, 0x96, 0xc0, 0x10, 0x30, 0x27, 0x84, 0x36, 0x60, 0xa8, 0xce, 0x52, 0x47, - 0x8a, 0xc0, 0x68, 0x1f, 0xca, 0x14, 0x40, 0x76, 0xc9, 0xa9, 0x29, 0xe4, 0x71, 0x0c, 0x03, 0x0b, - 0x5a, 0x8c, 0x2a, 0x69, 0xef, 0x6c, 0x85, 0x22, 0xd5, 0x71, 0x36, 0xd5, 0x2e, 0xa9, 0x62, 0x05, - 0x55, 0x86, 0x81, 0x05, 0x2d, 0xf4, 0x0a, 0x14, 0xb6, 0xea, 0xc2, 0x6d, 0x27, 0x53, 0x12, 0x69, - 0x86, 0xb2, 0x58, 0x1a, 0x7a, 0x70, 0x30, 0x5f, 0x58, 0x5d, 0xc6, 0x85, 0xad, 0x3a, 0x5a, 0x87, - 0xe1, 0x2d, 0xee, 0xfc, 0x2e, 0x84, 0x8d, 0x4f, 0x65, 0xfb, 0xe5, 0xa7, 0xfc, 0xe3, 0xb9, 0xc7, - 0x8a, 0x00, 0x60, 0x49, 0x84, 0xc5, 0x8b, 0x57, 0x4e, 0xfc, 0x22, 0x86, 0xd8, 0xc2, 0xd1, 0x02, - 0x2f, 0x70, 0xa6, 0x23, 0x0e, 0x05, 0x80, 0x35, 0x8a, 0x74, 0x55, 0x3b, 0x32, 0xdf, 0xbc, 0x08, - 0x36, 0x93, 0xb9, 0xaa, 0x7b, 0xa4, 0xe2, 0xe7, 0xab, 0x5a, 0x21, 0xe1, 0x98, 0x28, 0xda, 0x85, - 0xf1, 0xbd, 0xb0, 0xbd, 0x43, 0xe4, 0x96, 0x66, 0xb1, 0x67, 0x72, 0xee, 0xe5, 0x3b, 0x02, 0xd1, - 0x0d, 0xa2, 0x8e, 0xd3, 0x4c, 0x9d, 0x42, 0x4c, 0xa7, 0x7f, 0x47, 0x27, 0x86, 0x4d, 0xda, 0x74, - 0xf8, 0xdf, 0xea, 0xf8, 0x9b, 0xfb, 0x11, 0x11, 0xa1, 0xbf, 0x32, 0x87, 0xff, 0x0d, 0x8e, 0x92, - 0x1e, 0x7e, 0x01, 0xc0, 0x92, 0x08, 0xba, 0x23, 0x86, 0x87, 0x9d, 0x9e, 0x53, 0xf9, 0xf1, 0x39, - 0x17, 0x25, 0x52, 0xce, 0xa0, 0xb0, 0xd3, 0x32, 0x26, 0xc5, 0x4e, 0xc9, 0xf6, 0x8e, 0x1f, 0xf9, - 0x5e, 0xe2, 0x84, 0x9e, 0xce, 0x3f, 0x25, 0xab, 0x19, 0xf8, 0xe9, 0x53, 0x32, 0x0b, 0x0b, 0x67, - 0xb6, 0x85, 0x1a, 0x30, 0xd1, 0xf6, 0x83, 0xe8, 0x9e, 0x1f, 0xc8, 0xf5, 0x85, 0xba, 0x08, 0x4b, - 0x0c, 0x4c, 0xd1, 0x22, 0x8b, 0xaa, 0x67, 0x42, 0x70, 0x82, 0x26, 0xfa, 0x04, 0x0c, 0x87, 0x75, - 0xa7, 0x49, 0x2a, 0xb7, 0x66, 0x67, 0xf2, 0xaf, 0x9f, 0x1a, 0x47, 0xc9, 0x59, 0x5d, 0x3c, 0xb8, - 0x3c, 0x47, 0xc1, 0x92, 0x1c, 0x5a, 0x85, 0x41, 0x96, 0x0f, 0x8c, 0xc5, 0xa9, 0xcb, 0x09, 0x33, - 0x9a, 0xb2, 0x8a, 0xe6, 0x67, 0x13, 0x2b, 0xc6, 0xbc, 0x3a, 0xdd, 0x03, 0xe2, 0xcd, 0xe0, 0x87, - 0xb3, 0xa7, 0xf3, 0xf7, 0x80, 0x78, 0x6a, 0xdc, 0xaa, 0x75, 0xdb, 0x03, 0x0a, 0x09, 0xc7, 0x44, - 0xe9, 0xc9, 0x4c, 0x4f, 0xd3, 0x33, 0x5d, 0xcc, 0x79, 0x72, 0xcf, 0x52, 0x76, 0x32, 0xd3, 0x93, - 0x94, 0x92, 0xb0, 0x7f, 0x6f, 0x38, 0xcd, 0xb3, 0xb0, 0x57, 0xe6, 0x77, 0x59, 0x29, 0x05, 0xe4, - 0x87, 0xfb, 0x15, 0x7a, 0x1d, 0x23, 0x0b, 0xfe, 0x05, 0x0b, 0xce, 0xb4, 0x33, 0x3f, 0x44, 0x30, - 0x00, 0xfd, 0xc9, 0xce, 0xf8, 0xa7, 0xab, 0x98, 0x86, 0xd9, 0x70, 0x9c, 0xd3, 0x52, 0xf2, 0x99, - 0x53, 0x7c, 0xc7, 0xcf, 0x9c, 0x35, 0x18, 0x61, 0x4c, 0x66, 0x8f, 0x54, 0xca, 0xc9, 0xd7, 0x1e, - 0x63, 0x25, 0x96, 0x45, 0x45, 0xac, 0x48, 0xa0, 0x1f, 0xb4, 0xe0, 0x5c, 0xb2, 0xeb, 0x98, 0x30, - 0xb0, 0x08, 0x84, 0xc8, 0x1f, 0xb8, 0xab, 0xe2, 0xfb, 0x53, 0xfc, 0xbf, 0x81, 0x7c, 0xd8, 0x0b, - 0x01, 0x77, 0x6f, 0x0c, 0x95, 0x33, 0x5e, 0xd8, 0x43, 0xa6, 0x56, 0xa1, 0x8f, 0x57, 0xf6, 0x8b, - 0x30, 0xd6, 0xf2, 0x3b, 0x5e, 0x24, 0xac, 0x7f, 0x84, 0x25, 0x02, 0xd3, 0xc0, 0xaf, 0x69, 0xe5, - 0xd8, 0xc0, 0x4a, 0xbc, 0xcd, 0x47, 0x1e, 0xfa, 0x6d, 0xfe, 0x26, 0x8c, 0x79, 0x9a, 0xb9, 0xaa, - 0xe0, 0x07, 0x2e, 0xe5, 0x07, 0x31, 0xd5, 0x8d, 0x5b, 0x79, 0x2f, 0xf5, 0x12, 0x6c, 0x50, 0x3b, - 0xd9, 0x07, 0xdf, 0x97, 0xad, 0x0c, 0xa6, 0x9e, 0x8b, 0x00, 0x3e, 0x6a, 0x8a, 0x00, 0x2e, 0x25, - 0x45, 0x00, 0x29, 0x89, 0xb2, 0xf1, 0xfa, 0xef, 0x3f, 0x47, 0x4b, 0xbf, 0x81, 0x10, 0xed, 0x26, - 0x5c, 0xe8, 0x75, 0x2d, 0x31, 0x33, 0xb0, 0x86, 0xd2, 0x1f, 0xc6, 0x66, 0x60, 0x8d, 0x4a, 0x19, - 0x33, 0x48, 0xbf, 0x21, 0x76, 0xec, 0xff, 0x66, 0x41, 0xb1, 0xea, 0x37, 0x4e, 0xe0, 0xc1, 0xfb, - 0x31, 0xe3, 0xc1, 0xfb, 0x78, 0xf6, 0x85, 0xd8, 0xc8, 0x95, 0x87, 0xaf, 0x24, 0xe4, 0xe1, 0xe7, - 0xf2, 0x08, 0x74, 0x97, 0x7e, 0xff, 0x64, 0x11, 0x46, 0xab, 0x7e, 0x43, 0xd9, 0x60, 0xff, 0xda, - 0xc3, 0xd8, 0x60, 0xe7, 0x66, 0x1a, 0xd0, 0x28, 0x33, 0xeb, 0x31, 0xe9, 0x7e, 0xfa, 0x0d, 0x66, - 0x8a, 0x7d, 0x97, 0xb8, 0xdb, 0x3b, 0x11, 0x69, 0x24, 0x3f, 0xe7, 0xe4, 0x4c, 0xb1, 0x7f, 0xaf, - 0x00, 0x93, 0x89, 0xd6, 0x51, 0x13, 0xc6, 0x9b, 0xba, 0xb4, 0x55, 0xac, 0xd3, 0x87, 0x12, 0xd4, - 0x0a, 0x53, 0x56, 0xad, 0x08, 0x9b, 0xc4, 0xd1, 0x02, 0x80, 0x52, 0x3f, 0x4a, 0xb1, 0x1e, 0xe3, - 0xfa, 0x95, 0x7e, 0x32, 0xc4, 0x1a, 0x06, 0x7a, 0x09, 0x46, 0x23, 0xbf, 0xed, 0x37, 0xfd, 0xed, - 0xfd, 0x1b, 0x44, 0x06, 0x75, 0x52, 0x06, 0x6a, 0x1b, 0x31, 0x08, 0xeb, 0x78, 0xe8, 0x3e, 0x4c, - 0x2b, 0x22, 0xb5, 0x63, 0x90, 0x40, 0x33, 0xa9, 0xc2, 0x7a, 0x92, 0x22, 0x4e, 0x37, 0x62, 0xff, - 0x54, 0x91, 0x0f, 0xb1, 0x17, 0xb9, 0xef, 0xed, 0x86, 0x77, 0xf7, 0x6e, 0xf8, 0xaa, 0x05, 0x53, - 0xb4, 0x75, 0x66, 0x7d, 0x23, 0xaf, 0x79, 0x15, 0x36, 0xd9, 0xea, 0x12, 0x36, 0xf9, 0x12, 0x3d, - 0x35, 0x1b, 0x7e, 0x27, 0x12, 0xb2, 0x3b, 0xed, 0x58, 0xa4, 0xa5, 0x58, 0x40, 0x05, 0x1e, 0x09, - 0x02, 0xe1, 0x31, 0xa8, 0xe3, 0x91, 0x20, 0xc0, 0x02, 0x2a, 0xa3, 0x2a, 0x0f, 0x64, 0x47, 0x55, - 0xe6, 0xc1, 0x31, 0x85, 0x9d, 0x86, 0x60, 0xb8, 0xb4, 0xe0, 0x98, 0xd2, 0x80, 0x23, 0xc6, 0xb1, - 0x7f, 0xb6, 0x08, 0x63, 0x55, 0xbf, 0x11, 0xab, 0x1e, 0x5f, 0x34, 0x54, 0x8f, 0x17, 0x12, 0xaa, - 0xc7, 0x29, 0x1d, 0xf7, 0x3d, 0x45, 0xe3, 0xd7, 0x4b, 0xd1, 0xf8, 0x4f, 0x2d, 0x36, 0x6b, 0xe5, - 0xf5, 0x1a, 0x37, 0xe6, 0x42, 0x57, 0x61, 0x94, 0x1d, 0x30, 0xcc, 0x45, 0x55, 0xea, 0xe3, 0x58, - 0xb6, 0xa0, 0xf5, 0xb8, 0x18, 0xeb, 0x38, 0xe8, 0x32, 0x8c, 0x84, 0xc4, 0x09, 0xea, 0x3b, 0xea, - 0x74, 0x15, 0xca, 0x33, 0x5e, 0x86, 0x15, 0x14, 0xbd, 0x11, 0xc7, 0x65, 0x2c, 0xe6, 0xbb, 0xbc, - 0xe9, 0xfd, 0xe1, 0x5b, 0x24, 0x3f, 0x18, 0xa3, 0x7d, 0x17, 0x50, 0x1a, 0xbf, 0x8f, 0x80, 0x64, - 0xf3, 0x66, 0x40, 0xb2, 0x52, 0x2a, 0x18, 0xd9, 0x9f, 0x5b, 0x30, 0x51, 0xf5, 0x1b, 0x74, 0xeb, - 0x7e, 0x33, 0xed, 0x53, 0x3d, 0x28, 0xed, 0x50, 0x97, 0xa0, 0xb4, 0x17, 0x61, 0xb0, 0xea, 0x37, - 0x2a, 0xd5, 0x6e, 0xfe, 0xe6, 0xf6, 0xdf, 0xb2, 0x60, 0xb8, 0xea, 0x37, 0x4e, 0x40, 0x2d, 0xf0, - 0x51, 0x53, 0x2d, 0xf0, 0x58, 0xce, 0xba, 0xc9, 0xd1, 0x04, 0xfc, 0x8d, 0x01, 0x18, 0xa7, 0xfd, - 0xf4, 0xb7, 0xe5, 0x54, 0x1a, 0xc3, 0x66, 0xf5, 0x31, 0x6c, 0x94, 0x0b, 0xf7, 0x9b, 0x4d, 0xff, - 0x5e, 0x72, 0x5a, 0x57, 0x59, 0x29, 0x16, 0x50, 0xf4, 0x2c, 0x8c, 0xb4, 0x03, 0xb2, 0xe7, 0xfa, - 0x82, 0xbd, 0xd5, 0x94, 0x2c, 0x55, 0x51, 0x8e, 0x15, 0x06, 0x7d, 0x16, 0x86, 0xae, 0x47, 0xaf, - 0xf2, 0xba, 0xef, 0x35, 0xb8, 0xe4, 0xbc, 0x28, 0x32, 0x27, 0x68, 0xe5, 0xd8, 0xc0, 0x42, 0x77, - 0xa1, 0xc4, 0xfe, 0xb3, 0x63, 0xe7, 0xe8, 0x39, 0x38, 0x45, 0x4e, 0x36, 0x41, 0x00, 0xc7, 0xb4, - 0xd0, 0xf3, 0x00, 0x91, 0x8c, 0x3e, 0x1e, 0x8a, 0xe0, 0x53, 0xea, 0x29, 0xa0, 0xe2, 0x92, 0x87, - 0x58, 0xc3, 0x42, 0xcf, 0x40, 0x29, 0x72, 0xdc, 0xe6, 0x4d, 0xd7, 0x23, 0x21, 0x93, 0x88, 0x17, - 0x65, 0x6a, 0x34, 0x51, 0x88, 0x63, 0x38, 0x65, 0xc5, 0x58, 0x64, 0x06, 0x9e, 0xc1, 0x77, 0x84, - 0x61, 0x33, 0x56, 0xec, 0xa6, 0x2a, 0xc5, 0x1a, 0x06, 0xda, 0x81, 0x27, 0x5c, 0x8f, 0x65, 0x19, - 0x20, 0xb5, 0x5d, 0xb7, 0xbd, 0x71, 0xb3, 0x76, 0x87, 0x04, 0xee, 0xd6, 0xfe, 0x92, 0x53, 0xdf, - 0x25, 0x9e, 0xcc, 0xae, 0xf8, 0x7e, 0xd1, 0xc5, 0x27, 0x2a, 0x5d, 0x70, 0x71, 0x57, 0x4a, 0xf6, - 0xcb, 0x70, 0xba, 0xea, 0x37, 0xaa, 0x7e, 0x10, 0xad, 0xfa, 0xc1, 0x3d, 0x27, 0x68, 0xc8, 0x95, - 0x32, 0x2f, 0xa3, 0x24, 0xd0, 0xa3, 0x70, 0x90, 0x1f, 0x14, 0x46, 0x04, 0x84, 0x17, 0x18, 0xf3, - 0x75, 0x44, 0xdf, 0x9e, 0x3a, 0x63, 0x03, 0x54, 0xca, 0x8d, 0x6b, 0x4e, 0x44, 0xd0, 0x2d, 0x96, - 0x4a, 0x38, 0xbe, 0x11, 0x45, 0xf5, 0xa7, 0xb5, 0x54, 0xc2, 0x31, 0x30, 0xf3, 0x0a, 0x35, 0xeb, - 0xdb, 0xff, 0x7d, 0x90, 0x1d, 0x8e, 0x89, 0xb4, 0x0d, 0xe8, 0x33, 0x30, 0x11, 0x92, 0x9b, 0xae, - 0xd7, 0xb9, 0x2f, 0xa5, 0x11, 0x5d, 0xbc, 0xb3, 0x6a, 0x2b, 0x3a, 0x26, 0x97, 0x69, 0x9a, 0x65, - 0x38, 0x41, 0x0d, 0xb5, 0x60, 0xe2, 0x9e, 0xeb, 0x35, 0xfc, 0x7b, 0xa1, 0xa4, 0x3f, 0x92, 0x2f, - 0xda, 0xbc, 0xcb, 0x31, 0x13, 0x7d, 0x34, 0x9a, 0xbb, 0x6b, 0x10, 0xc3, 0x09, 0xe2, 0x74, 0x01, - 0x06, 0x1d, 0x6f, 0x31, 0xbc, 0x1d, 0x92, 0x40, 0x24, 0x85, 0x66, 0x0b, 0x10, 0xcb, 0x42, 0x1c, - 0xc3, 0xe9, 0x02, 0x64, 0x7f, 0xae, 0x05, 0x7e, 0x87, 0xe7, 0x08, 0x10, 0x0b, 0x10, 0xab, 0x52, - 0xac, 0x61, 0xd0, 0x0d, 0xca, 0xfe, 0xad, 0xfb, 0x1e, 0xf6, 0xfd, 0x48, 0x6e, 0x69, 0x96, 0x86, - 0x54, 0x2b, 0xc7, 0x06, 0x16, 0x5a, 0x05, 0x14, 0x76, 0xda, 0xed, 0x26, 0x33, 0xfb, 0x70, 0x9a, - 0x8c, 0x14, 0x57, 0xb9, 0x17, 0x79, 0xe8, 0xd4, 0x5a, 0x0a, 0x8a, 0x33, 0x6a, 0xd0, 0xb3, 0x7a, - 0x4b, 0x74, 0x75, 0x90, 0x75, 0x95, 0xab, 0x41, 0x6a, 0xbc, 0x9f, 0x12, 0x86, 0x56, 0x60, 0x38, - 0xdc, 0x0f, 0xeb, 0x91, 0x88, 0x01, 0x97, 0x93, 0x99, 0xa7, 0xc6, 0x50, 0xb4, 0xc4, 0x70, 0xbc, - 0x0a, 0x96, 0x75, 0x51, 0x1d, 0x66, 0x04, 0xc5, 0xe5, 0x1d, 0xc7, 0x53, 0x79, 0x4e, 0xb8, 0xf5, - 0xeb, 0xd5, 0x07, 0x07, 0xf3, 0x33, 0xa2, 0x65, 0x1d, 0x7c, 0x78, 0x30, 0x7f, 0xa6, 0xea, 0x37, - 0x32, 0x20, 0x38, 0x8b, 0x1a, 0x5f, 0x7c, 0xf5, 0xba, 0xdf, 0x6a, 0x57, 0x03, 0x7f, 0xcb, 0x6d, - 0x92, 0x6e, 0xaa, 0xa4, 0x9a, 0x81, 0x29, 0x16, 0x9f, 0x51, 0x86, 0x13, 0xd4, 0xec, 0x6f, 0x67, - 0xfc, 0x0c, 0xcb, 0x83, 0x1c, 0x75, 0x02, 0x82, 0x5a, 0x30, 0xde, 0x66, 0xdb, 0x44, 0x44, 0xee, - 0x17, 0x6b, 0xfd, 0xc5, 0x3e, 0x45, 0x22, 0xf7, 0xe8, 0x35, 0xa0, 0x44, 0x96, 0xec, 0xad, 0x59, - 0xd5, 0xc9, 0x61, 0x93, 0xba, 0xfd, 0x63, 0x8f, 0xb1, 0x1b, 0xb1, 0xc6, 0xe5, 0x1c, 0xc3, 0xc2, - 0xd8, 0x5e, 0x3c, 0xad, 0xe6, 0xf2, 0x05, 0x6e, 0xf1, 0xb4, 0x08, 0x83, 0x7d, 0x2c, 0xeb, 0xa2, - 0x4f, 0xc3, 0x04, 0x7d, 0xa9, 0xa8, 0x5b, 0x29, 0x9c, 0x3d, 0x95, 0x1f, 0x14, 0x41, 0x61, 0xe9, - 0x59, 0x3d, 0xf4, 0xca, 0x38, 0x41, 0x0c, 0xbd, 0xc1, 0xcc, 0x42, 0x24, 0xe9, 0x42, 0x3f, 0xa4, - 0x75, 0x0b, 0x10, 0x49, 0x56, 0x23, 0x82, 0x3a, 0x30, 0x93, 0xce, 0x01, 0x16, 0xce, 0xda, 0xf9, - 0x2c, 0x5f, 0x3a, 0x8d, 0x57, 0x9c, 0x7e, 0x21, 0x0d, 0x0b, 0x71, 0x16, 0x7d, 0x74, 0x13, 0xc6, - 0x45, 0x32, 0x60, 0xb1, 0x72, 0x8b, 0x86, 0x1c, 0x70, 0x1c, 0xeb, 0xc0, 0xc3, 0x64, 0x01, 0x36, - 0x2b, 0xa3, 0x6d, 0x38, 0xa7, 0x25, 0xe7, 0xb9, 0x16, 0x38, 0x4c, 0x99, 0xef, 0xb2, 0xe3, 0x54, - 0xbb, 0xab, 0x9f, 0x7c, 0x70, 0x30, 0x7f, 0x6e, 0xa3, 0x1b, 0x22, 0xee, 0x4e, 0x07, 0xdd, 0x82, - 0xd3, 0xdc, 0xa5, 0xb7, 0x4c, 0x9c, 0x46, 0xd3, 0xf5, 0x14, 0x33, 0xc0, 0xb7, 0xfc, 0xd9, 0x07, - 0x07, 0xf3, 0xa7, 0x17, 0xb3, 0x10, 0x70, 0x76, 0x3d, 0xf4, 0x51, 0x28, 0x35, 0xbc, 0x50, 0x8c, - 0xc1, 0x90, 0x91, 0xff, 0xa8, 0x54, 0x5e, 0xaf, 0xa9, 0xef, 0x8f, 0xff, 0xe0, 0xb8, 0x02, 0xda, - 0xe6, 0xb2, 0x62, 0x25, 0xc1, 0x18, 0x4e, 0x85, 0x34, 0x4a, 0x0a, 0xf9, 0x0c, 0xa7, 0x3e, 0xae, - 0x24, 0x51, 0xb6, 0xee, 0x86, 0xbf, 0x9f, 0x41, 0x18, 0xbd, 0x0e, 0x88, 0xbe, 0x20, 0xdc, 0x3a, - 0x59, 0xac, 0xb3, 0xb4, 0x10, 0x4c, 0xb4, 0x3e, 0x62, 0xba, 0x99, 0xd5, 0x52, 0x18, 0x38, 0xa3, - 0x16, 0xba, 0x4e, 0x4f, 0x15, 0xbd, 0x54, 0x9c, 0x5a, 0x2a, 0x5b, 0x5d, 0x99, 0xb4, 0x03, 0x52, - 0x77, 0x22, 0xd2, 0x30, 0x29, 0xe2, 0x44, 0x3d, 0xd4, 0x80, 0x27, 0x9c, 0x4e, 0xe4, 0x33, 0x31, - 0xbc, 0x89, 0xba, 0xe1, 0xef, 0x12, 0x8f, 0x69, 0xc0, 0x46, 0x96, 0x2e, 0x50, 0x6e, 0x63, 0xb1, - 0x0b, 0x1e, 0xee, 0x4a, 0x85, 0x72, 0x89, 0x2a, 0x3d, 0x2d, 0x98, 0x81, 0x9a, 0x32, 0x52, 0xd4, - 0xbe, 0x04, 0xa3, 0x3b, 0x7e, 0x18, 0xad, 0x93, 0xe8, 0x9e, 0x1f, 0xec, 0x8a, 0x78, 0x9b, 0x71, - 0x8c, 0xe6, 0x18, 0x84, 0x75, 0x3c, 0xfa, 0x0c, 0x64, 0xf6, 0x19, 0x95, 0x32, 0x53, 0x8d, 0x8f, - 0xc4, 0x67, 0xcc, 0x75, 0x5e, 0x8c, 0x25, 0x5c, 0xa2, 0x56, 0xaa, 0xcb, 0x4c, 0xcd, 0x9d, 0x40, - 0xad, 0x54, 0x97, 0xb1, 0x84, 0xd3, 0xe5, 0x1a, 0xee, 0x38, 0x01, 0xa9, 0x06, 0x7e, 0x9d, 0x84, - 0x5a, 0x64, 0xf0, 0xc7, 0x79, 0x34, 0x51, 0xba, 0x5c, 0x6b, 0x59, 0x08, 0x38, 0xbb, 0x1e, 0x22, - 0xe9, 0xc4, 0x54, 0x13, 0xf9, 0xfa, 0x89, 0x34, 0x3f, 0xd3, 0x67, 0x6e, 0x2a, 0x0f, 0xa6, 0x54, - 0x4a, 0x2c, 0x1e, 0x3f, 0x34, 0x9c, 0x9d, 0x64, 0x6b, 0xbb, 0xff, 0xe0, 0xa3, 0x4a, 0xe3, 0x53, - 0x49, 0x50, 0xc2, 0x29, 0xda, 0x46, 0x2c, 0xae, 0xa9, 0x9e, 0xb1, 0xb8, 0xae, 0x40, 0x29, 0xec, - 0x6c, 0x36, 0xfc, 0x96, 0xe3, 0x7a, 0x4c, 0xcd, 0xad, 0xbd, 0x47, 0x6a, 0x12, 0x80, 0x63, 0x1c, - 0xb4, 0x0a, 0x23, 0x8e, 0x54, 0xe7, 0xa0, 0xfc, 0xe8, 0x2b, 0x4a, 0x89, 0xc3, 0x03, 0x12, 0x48, - 0x05, 0x8e, 0xaa, 0x8b, 0x5e, 0x85, 0x71, 0xe1, 0x92, 0x2a, 0xb2, 0x31, 0xce, 0x98, 0x7e, 0x43, - 0x35, 0x1d, 0x88, 0x4d, 0x5c, 0x74, 0x1b, 0x46, 0x23, 0xbf, 0xc9, 0x9c, 0x5f, 0x28, 0x9b, 0x77, - 0x26, 0x3f, 0x8e, 0xd8, 0x86, 0x42, 0xd3, 0x25, 0xa9, 0xaa, 0x2a, 0xd6, 0xe9, 0xa0, 0x0d, 0xbe, - 0xde, 0x59, 0x84, 0x6c, 0x12, 0xce, 0x3e, 0x96, 0x7f, 0x27, 0xa9, 0x40, 0xda, 0xe6, 0x76, 0x10, - 0x35, 0xb1, 0x4e, 0x06, 0x5d, 0x83, 0xe9, 0x76, 0xe0, 0xfa, 0x6c, 0x4d, 0x28, 0x4d, 0xde, 0xac, - 0x99, 0x9e, 0xa7, 0x9a, 0x44, 0xc0, 0xe9, 0x3a, 0xcc, 0xa3, 0x58, 0x14, 0xce, 0x9e, 0xe5, 0x09, - 0x9b, 0xf9, 0xf3, 0x8e, 0x97, 0x61, 0x05, 0x45, 0x6b, 0xec, 0x24, 0xe6, 0x92, 0x89, 0xd9, 0xb9, - 0xfc, 0x80, 0x2f, 0xba, 0x04, 0x83, 0x33, 0xaf, 0xea, 0x2f, 0x8e, 0x29, 0xa0, 0x86, 0x96, 0xd9, - 0x8f, 0xbe, 0x18, 0xc2, 0xd9, 0x27, 0xba, 0x18, 0xc9, 0x25, 0x9e, 0x17, 0x31, 0x43, 0x60, 0x14, - 0x87, 0x38, 0x41, 0x13, 0x7d, 0x1c, 0xa6, 0x44, 0x98, 0xba, 0x78, 0x98, 0xce, 0xc5, 0x26, 0xc5, - 0x38, 0x01, 0xc3, 0x29, 0x6c, 0x9e, 0x39, 0xc0, 0xd9, 0x6c, 0x12, 0x71, 0xf4, 0xdd, 0x74, 0xbd, - 0xdd, 0x70, 0xf6, 0x3c, 0x3b, 0x1f, 0x44, 0xe6, 0x80, 0x24, 0x14, 0x67, 0xd4, 0x40, 0x1b, 0x30, - 0xd5, 0x0e, 0x08, 0x69, 0x31, 0x46, 0x5f, 0xdc, 0x67, 0xf3, 0xdc, 0xa1, 0x9e, 0xf6, 0xa4, 0x9a, - 0x80, 0x1d, 0x66, 0x94, 0xe1, 0x14, 0x05, 0x74, 0x0f, 0x46, 0xfc, 0x3d, 0x12, 0xec, 0x10, 0xa7, - 0x31, 0x7b, 0xa1, 0x8b, 0x89, 0xbb, 0xb8, 0xdc, 0x6e, 0x09, 0xdc, 0x84, 0xf6, 0x5f, 0x16, 0xf7, - 0xd6, 0xfe, 0xcb, 0xc6, 0xd0, 0x0f, 0x59, 0x70, 0x56, 0x2a, 0x0c, 0x6a, 0x6d, 0x3a, 0xea, 0xcb, - 0xbe, 0x17, 0x46, 0x01, 0x77, 0x01, 0x7f, 0x32, 0xdf, 0x2d, 0x7a, 0x23, 0xa7, 0x92, 0x12, 0x8e, - 0x9e, 0xcd, 0xc3, 0x08, 0x71, 0x7e, 0x8b, 0x68, 0x19, 0xa6, 0x43, 0x12, 0xc9, 0xc3, 0x68, 0x31, - 0x5c, 0x7d, 0xa3, 0xbc, 0x3e, 0x7b, 0x91, 0xfb, 0xaf, 0xd3, 0xcd, 0x50, 0x4b, 0x02, 0x71, 0x1a, - 0x7f, 0xee, 0x5b, 0x61, 0x3a, 0x75, 0xfd, 0x1f, 0x25, 0x23, 0xca, 0xdc, 0x2e, 0x8c, 0x1b, 0x43, - 0xfc, 0x48, 0xb5, 0xc7, 0xff, 0x6a, 0x18, 0x4a, 0x4a, 0xb3, 0x88, 0xae, 0x98, 0x0a, 0xe3, 0xb3, - 0x49, 0x85, 0xf1, 0x08, 0x7d, 0xd7, 0xeb, 0x3a, 0xe2, 0x8d, 0x8c, 0xa8, 0x5d, 0x79, 0x1b, 0xba, - 0x7f, 0x77, 0x6c, 0x4d, 0x5c, 0x5b, 0xec, 0x5b, 0xf3, 0x3c, 0xd0, 0x55, 0x02, 0x7c, 0x0d, 0xa6, - 0x3d, 0x9f, 0xf1, 0x9c, 0xa4, 0x21, 0x19, 0x0a, 0xc6, 0x37, 0x94, 0xf4, 0x30, 0x18, 0x09, 0x04, - 0x9c, 0xae, 0x43, 0x1b, 0xe4, 0x17, 0x7f, 0x52, 0xe4, 0xcc, 0xf9, 0x02, 0x2c, 0xa0, 0xe8, 0x22, - 0x0c, 0xb6, 0xfd, 0x46, 0xa5, 0x2a, 0xf8, 0x4d, 0x2d, 0x56, 0x64, 0xa3, 0x52, 0xc5, 0x1c, 0x86, - 0x16, 0x61, 0x88, 0xfd, 0x08, 0x67, 0xc7, 0xf2, 0xe3, 0x1d, 0xb0, 0x1a, 0x5a, 0xbe, 0x19, 0x56, - 0x01, 0x8b, 0x8a, 0x4c, 0xf4, 0x45, 0x99, 0x74, 0x26, 0xfa, 0x1a, 0x7e, 0x48, 0xd1, 0x97, 0x24, - 0x80, 0x63, 0x5a, 0xe8, 0x3e, 0x9c, 0x36, 0x1e, 0x46, 0x7c, 0x89, 0x90, 0x50, 0xf8, 0x5c, 0x5f, - 0xec, 0xfa, 0x22, 0x12, 0x9a, 0xea, 0x73, 0xa2, 0xd3, 0xa7, 0x2b, 0x59, 0x94, 0x70, 0x76, 0x03, - 0xa8, 0x09, 0xd3, 0xf5, 0x54, 0xab, 0x23, 0xfd, 0xb7, 0xaa, 0x26, 0x34, 0xdd, 0x62, 0x9a, 0x30, - 0x7a, 0x15, 0x46, 0xde, 0xf2, 0x43, 0x76, 0x56, 0x0b, 0x1e, 0x59, 0x3a, 0xec, 0x8e, 0xbc, 0x71, - 0xab, 0xc6, 0xca, 0x0f, 0x0f, 0xe6, 0x47, 0xab, 0x7e, 0x43, 0xfe, 0xc5, 0xaa, 0x02, 0xfa, 0x5e, - 0x0b, 0xe6, 0xd2, 0x2f, 0x2f, 0xd5, 0xe9, 0xf1, 0xfe, 0x3b, 0x6d, 0x8b, 0x46, 0xe7, 0x56, 0x72, - 0xc9, 0xe1, 0x2e, 0x4d, 0xd9, 0xbf, 0x64, 0x31, 0xa9, 0x9b, 0xd0, 0x00, 0x91, 0xb0, 0xd3, 0x3c, - 0x89, 0x34, 0x9b, 0x2b, 0x86, 0x72, 0xea, 0xa1, 0x2d, 0x17, 0xfe, 0xb9, 0xc5, 0x2c, 0x17, 0x4e, - 0xd0, 0x45, 0xe1, 0x0d, 0x18, 0x89, 0x64, 0xfa, 0xd3, 0x2e, 0x99, 0x41, 0xb5, 0x4e, 0x31, 0xeb, - 0x0d, 0xc5, 0xb1, 0xaa, 0x4c, 0xa7, 0x8a, 0x8c, 0xfd, 0x8f, 0xf8, 0x0c, 0x48, 0xc8, 0x09, 0xe8, - 0x00, 0xca, 0xa6, 0x0e, 0x60, 0xbe, 0xc7, 0x17, 0xe4, 0xe8, 0x02, 0xfe, 0xa1, 0xd9, 0x6f, 0x26, - 0xa9, 0x79, 0xb7, 0x9b, 0xcc, 0xd8, 0x5f, 0xb4, 0x00, 0xe2, 0x50, 0xbc, 0x4c, 0xbe, 0xec, 0x07, - 0x32, 0xc7, 0x62, 0x56, 0x36, 0xa1, 0x97, 0x29, 0x8f, 0xea, 0x47, 0x7e, 0xdd, 0x6f, 0x0a, 0x0d, - 0xd7, 0x13, 0xb1, 0x1a, 0x82, 0x97, 0x1f, 0x6a, 0xbf, 0xb1, 0xc2, 0x46, 0xf3, 0x32, 0xf0, 0x57, - 0x31, 0x56, 0x8c, 0x19, 0x41, 0xbf, 0x7e, 0xc4, 0x82, 0x53, 0x59, 0xf6, 0xae, 0xf4, 0xc5, 0xc3, - 0x65, 0x56, 0xca, 0x9c, 0x49, 0xcd, 0xe6, 0x1d, 0x51, 0x8e, 0x15, 0x46, 0xdf, 0x99, 0xc3, 0x8e, - 0x16, 0x03, 0xf7, 0x16, 0x8c, 0x57, 0x03, 0xa2, 0x5d, 0xae, 0xaf, 0x71, 0x67, 0x72, 0xde, 0x9f, - 0x67, 0x8f, 0xec, 0x48, 0x6e, 0xff, 0x74, 0x01, 0x4e, 0x71, 0xab, 0x80, 0xc5, 0x3d, 0xdf, 0x6d, - 0x54, 0xfd, 0x86, 0xc8, 0xfa, 0xf6, 0x29, 0x18, 0x6b, 0x6b, 0x82, 0xc6, 0x6e, 0xf1, 0x1c, 0x75, - 0x81, 0x64, 0x2c, 0x1a, 0xd1, 0x4b, 0xb1, 0x41, 0x0b, 0x35, 0x60, 0x8c, 0xec, 0xb9, 0x75, 0xa5, - 0x5a, 0x2e, 0x1c, 0xf9, 0xa2, 0x53, 0xad, 0xac, 0x68, 0x74, 0xb0, 0x41, 0xf5, 0x11, 0xe4, 0xf3, - 0xb5, 0x7f, 0xd4, 0x82, 0xc7, 0x72, 0xa2, 0x3f, 0xd2, 0xe6, 0xee, 0x31, 0xfb, 0x0b, 0xb1, 0x6c, - 0x55, 0x73, 0xdc, 0x2a, 0x03, 0x0b, 0x28, 0xfa, 0x04, 0x00, 0xb7, 0xaa, 0xa0, 0x4f, 0xee, 0x5e, - 0x61, 0xf2, 0x8c, 0x08, 0x5f, 0x5a, 0xb0, 0x26, 0x59, 0x1f, 0x6b, 0xb4, 0xec, 0x2f, 0x0d, 0xc0, - 0x20, 0xcf, 0x3d, 0xbe, 0x0a, 0xc3, 0x3b, 0x3c, 0x17, 0x46, 0x3f, 0x69, 0x37, 0x62, 0x61, 0x08, - 0x2f, 0xc0, 0xb2, 0x32, 0x5a, 0x83, 0x19, 0x9e, 0x4b, 0xa4, 0x59, 0x26, 0x4d, 0x67, 0x5f, 0x4a, - 0xee, 0x78, 0x1e, 0x4e, 0x25, 0xc1, 0xac, 0xa4, 0x51, 0x70, 0x56, 0x3d, 0xf4, 0x1a, 0x4c, 0xd0, - 0x97, 0x94, 0xdf, 0x89, 0x24, 0x25, 0x9e, 0x45, 0x44, 0x3d, 0xdd, 0x36, 0x0c, 0x28, 0x4e, 0x60, - 0xd3, 0xc7, 0x7c, 0x3b, 0x25, 0xa3, 0x1c, 0x8c, 0x1f, 0xf3, 0xa6, 0x5c, 0xd2, 0xc4, 0x65, 0x86, - 0xae, 0x1d, 0x66, 0xd6, 0xbb, 0xb1, 0x13, 0x90, 0x70, 0xc7, 0x6f, 0x36, 0x18, 0xd3, 0x37, 0xa8, - 0x19, 0xba, 0x26, 0xe0, 0x38, 0x55, 0x83, 0x52, 0xd9, 0x72, 0xdc, 0x66, 0x27, 0x20, 0x31, 0x95, - 0x21, 0x93, 0xca, 0x6a, 0x02, 0x8e, 0x53, 0x35, 0x7a, 0x0b, 0x5f, 0x87, 0x8f, 0x47, 0xf8, 0x4a, - 0x17, 0xec, 0xe9, 0x6a, 0xe0, 0xd3, 0x13, 0x5b, 0xc6, 0xce, 0x51, 0x66, 0xd2, 0xc3, 0xd2, 0xcd, - 0xb7, 0x4b, 0x94, 0x39, 0x61, 0x48, 0xca, 0x29, 0x18, 0x96, 0x0a, 0x35, 0xe1, 0xe0, 0x2b, 0xa9, - 0xa0, 0xab, 0x30, 0x2a, 0x52, 0x51, 0x30, 0x6b, 0x5e, 0xbe, 0x46, 0x98, 0x65, 0x45, 0x39, 0x2e, - 0xc6, 0x3a, 0x8e, 0xfd, 0x7d, 0x05, 0x98, 0xc9, 0x70, 0xc7, 0xe0, 0x67, 0xe2, 0xb6, 0x1b, 0x46, - 0x2a, 0xa9, 0xa1, 0x76, 0x26, 0xf2, 0x72, 0xac, 0x30, 0xe8, 0xc6, 0xe3, 0xa7, 0x6e, 0xf2, 0xa4, - 0x15, 0xe6, 0xce, 0x02, 0x7a, 0xc4, 0xf4, 0x80, 0x17, 0x60, 0xa0, 0x13, 0x12, 0x19, 0x1f, 0x52, - 0xdd, 0x41, 0x4c, 0xe1, 0xc6, 0x20, 0xf4, 0x4d, 0xb0, 0xad, 0x74, 0x57, 0xda, 0x9b, 0x80, 0x6b, - 0xaf, 0x38, 0x8c, 0x76, 0x2e, 0x22, 0x9e, 0xe3, 0x45, 0xe2, 0xe5, 0x10, 0x07, 0x3a, 0x63, 0xa5, - 0x58, 0x40, 0xed, 0x2f, 0x15, 0xe1, 0x6c, 0xae, 0x83, 0x16, 0xed, 0x7a, 0xcb, 0xf7, 0xdc, 0xc8, - 0x57, 0x26, 0x2b, 0x3c, 0xb8, 0x19, 0x69, 0xef, 0xac, 0x89, 0x72, 0xac, 0x30, 0xd0, 0x25, 0x18, - 0x64, 0xe2, 0xba, 0x54, 0x7a, 0xc7, 0xa5, 0x32, 0x8f, 0x76, 0xc3, 0xc1, 0x7d, 0xa7, 0xce, 0xbd, - 0x48, 0xaf, 0x63, 0xbf, 0x99, 0x3c, 0x1d, 0x69, 0x77, 0x7d, 0xbf, 0x89, 0x19, 0x10, 0x7d, 0x40, - 0x8c, 0x57, 0xc2, 0x46, 0x03, 0x3b, 0x0d, 0x3f, 0xd4, 0x06, 0xed, 0x69, 0x18, 0xde, 0x25, 0xfb, - 0x81, 0xeb, 0x6d, 0x27, 0x6d, 0x77, 0x6e, 0xf0, 0x62, 0x2c, 0xe1, 0x66, 0xa6, 0xae, 0xe1, 0xe3, - 0xce, 0x79, 0x3b, 0xd2, 0xf3, 0xae, 0xfd, 0x81, 0x22, 0x4c, 0xe2, 0xa5, 0xf2, 0x7b, 0x13, 0x71, - 0x3b, 0x3d, 0x11, 0xc7, 0x9d, 0xf3, 0xb6, 0xf7, 0x6c, 0xfc, 0xbc, 0x05, 0x93, 0x2c, 0x21, 0x86, - 0x08, 0x8b, 0xe5, 0xfa, 0xde, 0x09, 0xf0, 0xb5, 0x17, 0x61, 0x30, 0xa0, 0x8d, 0x26, 0xf3, 0x3a, - 0xb2, 0x9e, 0x60, 0x0e, 0x43, 0x4f, 0xc0, 0x00, 0xeb, 0x02, 0x9d, 0xbc, 0x31, 0x9e, 0x12, 0xab, - 0xec, 0x44, 0x0e, 0x66, 0xa5, 0x2c, 0xd6, 0x0b, 0x26, 0xed, 0xa6, 0xcb, 0x3b, 0x1d, 0x2b, 0x53, - 0xdf, 0x1d, 0xae, 0xdb, 0x99, 0x5d, 0x7b, 0x67, 0xb1, 0x5e, 0xb2, 0x49, 0x76, 0x7f, 0x33, 0xfe, - 0x51, 0x01, 0xce, 0x67, 0xd6, 0xeb, 0x3b, 0xd6, 0x4b, 0xf7, 0xda, 0x8f, 0x32, 0xe5, 0x41, 0xf1, - 0x04, 0x2d, 0x23, 0x07, 0xfa, 0x65, 0x65, 0x07, 0xfb, 0x08, 0xc1, 0x92, 0x39, 0x64, 0xef, 0x92, - 0x10, 0x2c, 0x99, 0x7d, 0xcb, 0x79, 0xf3, 0xfe, 0x45, 0x21, 0xe7, 0x5b, 0xd8, 0xeb, 0xf7, 0x32, - 0x3d, 0x67, 0x18, 0x30, 0x94, 0x2f, 0x4a, 0x7e, 0xc6, 0xf0, 0x32, 0xac, 0xa0, 0x68, 0x11, 0x26, - 0x5b, 0xae, 0x47, 0x0f, 0x9f, 0x7d, 0x93, 0xc3, 0x54, 0x11, 0xb2, 0xd6, 0x4c, 0x30, 0x4e, 0xe2, - 0x23, 0x57, 0x0b, 0xcf, 0x52, 0xc8, 0xcf, 0x94, 0x9e, 0xdb, 0xdb, 0x05, 0x53, 0xd1, 0xac, 0x46, - 0x31, 0x23, 0x54, 0xcb, 0x9a, 0x26, 0xf4, 0x28, 0xf6, 0x2f, 0xf4, 0x18, 0xcb, 0x16, 0x78, 0xcc, - 0xbd, 0x0a, 0xe3, 0x0f, 0x2d, 0xe5, 0xb6, 0xbf, 0x5a, 0x84, 0xc7, 0xbb, 0x6c, 0x7b, 0x7e, 0xd6, - 0x1b, 0x73, 0xa0, 0x9d, 0xf5, 0xa9, 0x79, 0xa8, 0xc2, 0xa9, 0xad, 0x4e, 0xb3, 0xb9, 0xcf, 0x1c, - 0x06, 0x48, 0x43, 0x62, 0x08, 0x9e, 0x52, 0xbe, 0xf4, 0x4f, 0xad, 0x66, 0xe0, 0xe0, 0xcc, 0x9a, - 0xf4, 0xe5, 0x40, 0x6f, 0x92, 0x7d, 0x45, 0x2a, 0xf1, 0x72, 0xc0, 0x3a, 0x10, 0x9b, 0xb8, 0xe8, - 0x1a, 0x4c, 0x3b, 0x7b, 0x8e, 0xcb, 0x63, 0xdc, 0x4a, 0x02, 0xfc, 0xe9, 0xa0, 0x84, 0x93, 0x8b, - 0x49, 0x04, 0x9c, 0xae, 0x83, 0x5e, 0x07, 0xe4, 0x6f, 0x32, 0xb3, 0xe2, 0xc6, 0x35, 0xe2, 0x09, - 0x7d, 0x20, 0x9b, 0xbb, 0x62, 0x7c, 0x24, 0xdc, 0x4a, 0x61, 0xe0, 0x8c, 0x5a, 0x89, 0x70, 0x27, - 0x43, 0xf9, 0xe1, 0x4e, 0xba, 0x9f, 0x8b, 0x3d, 0xb3, 0x6d, 0xfc, 0x27, 0x8b, 0x5e, 0x5f, 0x9c, - 0xc9, 0x37, 0xa3, 0xf6, 0xbd, 0xca, 0xec, 0xf9, 0xb8, 0xe0, 0x52, 0x0b, 0xd2, 0x71, 0x5a, 0xb3, - 0xe7, 0x8b, 0x81, 0xd8, 0xc4, 0xe5, 0x0b, 0x22, 0x8c, 0x7d, 0x43, 0x0d, 0x16, 0x5f, 0x84, 0x16, - 0x52, 0x18, 0xe8, 0x93, 0x30, 0xdc, 0x70, 0xf7, 0xdc, 0x50, 0x88, 0x6d, 0x8e, 0xac, 0x23, 0x89, - 0xcf, 0xc1, 0x32, 0x27, 0x83, 0x25, 0x3d, 0xfb, 0x07, 0x0a, 0x30, 0x2e, 0x5b, 0x7c, 0xa3, 0xe3, - 0x47, 0xce, 0x09, 0x5c, 0xcb, 0xd7, 0x8c, 0x6b, 0xf9, 0x03, 0xdd, 0xe2, 0x2b, 0xb1, 0x2e, 0xe5, - 0x5e, 0xc7, 0xb7, 0x12, 0xd7, 0xf1, 0x53, 0xbd, 0x49, 0x75, 0xbf, 0x86, 0xff, 0xb1, 0x05, 0xd3, - 0x06, 0xfe, 0x09, 0xdc, 0x06, 0xab, 0xe6, 0x6d, 0xf0, 0x64, 0xcf, 0x6f, 0xc8, 0xb9, 0x05, 0xbe, - 0xbb, 0x98, 0xe8, 0x3b, 0x3b, 0xfd, 0xdf, 0x82, 0x81, 0x1d, 0x27, 0x68, 0x74, 0x8b, 0x27, 0x9f, - 0xaa, 0xb4, 0x70, 0xdd, 0x09, 0x84, 0x42, 0xf4, 0x59, 0x95, 0xa8, 0xdc, 0x09, 0x7a, 0x2b, 0x43, - 0x59, 0x53, 0xe8, 0x65, 0x18, 0x0a, 0xeb, 0x7e, 0x5b, 0xb9, 0x0b, 0x5c, 0xe0, 0x49, 0xcc, 0x69, - 0xc9, 0xe1, 0xc1, 0x3c, 0x32, 0x9b, 0xa3, 0xc5, 0x58, 0xe0, 0xa3, 0x4f, 0xc1, 0x38, 0xfb, 0xa5, - 0xac, 0x93, 0x8a, 0xf9, 0xb9, 0xa7, 0x6a, 0x3a, 0x22, 0x37, 0xdd, 0x33, 0x8a, 0xb0, 0x49, 0x6a, - 0x6e, 0x1b, 0x4a, 0xea, 0xb3, 0x1e, 0xa9, 0x12, 0xf2, 0xdf, 0x17, 0x61, 0x26, 0x63, 0xcd, 0xa1, - 0xd0, 0x98, 0x89, 0xab, 0x7d, 0x2e, 0xd5, 0x77, 0x38, 0x17, 0x21, 0x7b, 0x0d, 0x35, 0xc4, 0xda, - 0xea, 0xbb, 0xd1, 0xdb, 0x21, 0x49, 0x36, 0x4a, 0x8b, 0x7a, 0x37, 0x4a, 0x1b, 0x3b, 0xb1, 0xa1, - 0xa6, 0x0d, 0xa9, 0x9e, 0x3e, 0xd2, 0x39, 0xfd, 0xd3, 0x22, 0x9c, 0xca, 0x0a, 0xf9, 0x86, 0x3e, - 0x9f, 0xc8, 0x66, 0xf8, 0x62, 0xbf, 0xc1, 0xe2, 0x78, 0x8a, 0x43, 0x2e, 0x6c, 0x5e, 0x5a, 0x30, - 0xf3, 0x1b, 0xf6, 0x1c, 0x66, 0xd1, 0x26, 0x8b, 0x7b, 0x10, 0xf0, 0x2c, 0x94, 0xf2, 0xf8, 0xf8, - 0x70, 0xdf, 0x1d, 0x10, 0xe9, 0x2b, 0xc3, 0x84, 0xe5, 0x83, 0x2c, 0xee, 0x6d, 0xf9, 0x20, 0x5b, - 0x9e, 0x73, 0x61, 0x54, 0xfb, 0x9a, 0x47, 0x3a, 0xe3, 0xbb, 0xf4, 0xb6, 0xd2, 0xfa, 0xfd, 0x48, - 0x67, 0xfd, 0x47, 0x2d, 0x48, 0x18, 0xc3, 0x2b, 0xb1, 0x98, 0x95, 0x2b, 0x16, 0xbb, 0x00, 0x03, - 0x81, 0xdf, 0x24, 0xc9, 0xb4, 0x7f, 0xd8, 0x6f, 0x12, 0xcc, 0x20, 0x14, 0x23, 0x8a, 0x85, 0x1d, - 0x63, 0xfa, 0x43, 0x4e, 0x3c, 0xd1, 0x2e, 0xc2, 0x60, 0x93, 0xec, 0x91, 0x66, 0x32, 0x3b, 0xcb, - 0x4d, 0x5a, 0x88, 0x39, 0xcc, 0xfe, 0xf9, 0x01, 0x38, 0xd7, 0x35, 0x72, 0x08, 0x7d, 0x0e, 0x6d, - 0x3b, 0x11, 0xb9, 0xe7, 0xec, 0x27, 0xd3, 0x28, 0x5c, 0xe3, 0xc5, 0x58, 0xc2, 0x99, 0xbb, 0x12, - 0x8f, 0x86, 0x9c, 0x10, 0x22, 0x8a, 0x20, 0xc8, 0x02, 0x6a, 0x0a, 0xa5, 0x8a, 0xc7, 0x21, 0x94, - 0x7a, 0x1e, 0x20, 0x0c, 0x9b, 0xdc, 0x64, 0xa8, 0x21, 0xfc, 0xa0, 0xe2, 0xa8, 0xd9, 0xb5, 0x9b, - 0x02, 0x82, 0x35, 0x2c, 0x54, 0x86, 0xa9, 0x76, 0xe0, 0x47, 0x5c, 0x26, 0x5b, 0xe6, 0x56, 0x75, - 0x83, 0x66, 0xd0, 0x86, 0x6a, 0x02, 0x8e, 0x53, 0x35, 0xd0, 0x4b, 0x30, 0x2a, 0x02, 0x39, 0x54, - 0x7d, 0xbf, 0x29, 0xc4, 0x40, 0xca, 0xd0, 0xac, 0x16, 0x83, 0xb0, 0x8e, 0xa7, 0x55, 0x63, 0x82, - 0xde, 0xe1, 0xcc, 0x6a, 0x5c, 0xd8, 0xab, 0xe1, 0x25, 0xc2, 0x3f, 0x8e, 0xf4, 0x15, 0xfe, 0x31, - 0x16, 0x8c, 0x95, 0xfa, 0x56, 0xa2, 0x41, 0x4f, 0x51, 0xd2, 0xcf, 0x0c, 0xc0, 0x8c, 0x58, 0x38, - 0x8f, 0x7a, 0xb9, 0xdc, 0x4e, 0x2f, 0x97, 0xe3, 0x10, 0x9d, 0xbd, 0xb7, 0x66, 0x4e, 0x7a, 0xcd, - 0xfc, 0xa0, 0x05, 0x26, 0x7b, 0x85, 0xfe, 0x9f, 0xdc, 0x3c, 0x34, 0x2f, 0xe5, 0xb2, 0x6b, 0x0d, - 0x79, 0x81, 0xbc, 0xc3, 0x8c, 0x34, 0xf6, 0x7f, 0xb4, 0xe0, 0xc9, 0x9e, 0x14, 0xd1, 0x0a, 0x94, - 0x18, 0x0f, 0xa8, 0xbd, 0xce, 0x9e, 0x52, 0x56, 0xb7, 0x12, 0x90, 0xc3, 0x92, 0xc6, 0x35, 0xd1, - 0x4a, 0x2a, 0xe1, 0xcf, 0xd3, 0x19, 0x09, 0x7f, 0x4e, 0x1b, 0xc3, 0xf3, 0x90, 0x19, 0x7f, 0xbe, - 0x9f, 0xde, 0x38, 0x86, 0xc7, 0x0b, 0xfa, 0xb0, 0x21, 0xf6, 0xb3, 0x13, 0x62, 0x3f, 0x64, 0x62, - 0x6b, 0x77, 0xc8, 0xc7, 0x61, 0x8a, 0x45, 0x78, 0x62, 0x36, 0xe0, 0xc2, 0x17, 0xa7, 0x10, 0xdb, - 0x79, 0xde, 0x4c, 0xc0, 0x70, 0x0a, 0xdb, 0xfe, 0xc3, 0x22, 0x0c, 0xf1, 0xed, 0x77, 0x02, 0x6f, - 0xc2, 0x67, 0xa0, 0xe4, 0xb6, 0x5a, 0x1d, 0x9e, 0xc3, 0x65, 0x90, 0x3b, 0xe0, 0xd2, 0x79, 0xaa, - 0xc8, 0x42, 0x1c, 0xc3, 0xd1, 0xaa, 0x90, 0x38, 0x77, 0x09, 0x22, 0xc9, 0x3b, 0xbe, 0x50, 0x76, - 0x22, 0x87, 0x33, 0x38, 0xea, 0x9e, 0x8d, 0x65, 0xd3, 0xe8, 0x33, 0x00, 0x61, 0x14, 0xb8, 0xde, - 0x36, 0x2d, 0x13, 0x31, 0x53, 0x3f, 0xd8, 0x85, 0x5a, 0x4d, 0x21, 0x73, 0x9a, 0xf1, 0x99, 0xa3, - 0x00, 0x58, 0xa3, 0x88, 0x16, 0x8c, 0x9b, 0x7e, 0x2e, 0x31, 0x77, 0xc0, 0xa9, 0xc6, 0x73, 0x36, - 0xf7, 0x11, 0x28, 0x29, 0xe2, 0xbd, 0xe4, 0x4f, 0x63, 0x3a, 0x5b, 0xf4, 0x31, 0x98, 0x4c, 0xf4, - 0xed, 0x48, 0xe2, 0xab, 0x5f, 0xb0, 0x60, 0x92, 0x77, 0x66, 0xc5, 0xdb, 0x13, 0xb7, 0xc1, 0xdb, - 0x70, 0xaa, 0x99, 0x71, 0x2a, 0x8b, 0xe9, 0xef, 0xff, 0x14, 0x57, 0xe2, 0xaa, 0x2c, 0x28, 0xce, - 0x6c, 0x03, 0x5d, 0xa6, 0x3b, 0x8e, 0x9e, 0xba, 0x4e, 0x53, 0xf8, 0xe3, 0x8e, 0xf1, 0xdd, 0xc6, - 0xcb, 0xb0, 0x82, 0xda, 0xbf, 0x63, 0xc1, 0x34, 0xef, 0xf9, 0x0d, 0xb2, 0xaf, 0xce, 0xa6, 0xaf, - 0x67, 0xdf, 0x45, 0xf6, 0xb0, 0x42, 0x4e, 0xf6, 0x30, 0xfd, 0xd3, 0x8a, 0x5d, 0x3f, 0xed, 0xa7, - 0x2d, 0x10, 0x2b, 0xe4, 0x04, 0x84, 0x10, 0xdf, 0x6a, 0x0a, 0x21, 0xe6, 0xf2, 0x37, 0x41, 0x8e, - 0xf4, 0xe1, 0xcf, 0x2d, 0x98, 0xe2, 0x08, 0xb1, 0xb6, 0xfc, 0xeb, 0x3a, 0x0f, 0xfd, 0xe4, 0x18, - 0xbe, 0x41, 0xf6, 0x37, 0xfc, 0xaa, 0x13, 0xed, 0x64, 0x7f, 0x94, 0x31, 0x59, 0x03, 0x5d, 0x27, - 0xab, 0x21, 0x37, 0xd0, 0x11, 0x12, 0x97, 0x1f, 0x39, 0xb9, 0x86, 0xfd, 0x35, 0x0b, 0x10, 0x6f, - 0xc6, 0x60, 0xdc, 0x28, 0x3b, 0xc4, 0x4a, 0xb5, 0x8b, 0x2e, 0x3e, 0x9a, 0x14, 0x04, 0x6b, 0x58, - 0xc7, 0x32, 0x3c, 0x09, 0x93, 0x87, 0x62, 0x6f, 0x93, 0x87, 0x23, 0x8c, 0xe8, 0xbf, 0x1e, 0x82, - 0xa4, 0xd7, 0x0f, 0xba, 0x03, 0x63, 0x75, 0xa7, 0xed, 0x6c, 0xba, 0x4d, 0x37, 0x72, 0x49, 0xd8, - 0xcd, 0x28, 0x6b, 0x59, 0xc3, 0x13, 0x4a, 0x6a, 0xad, 0x04, 0x1b, 0x74, 0xd0, 0x02, 0x40, 0x3b, - 0x70, 0xf7, 0xdc, 0x26, 0xd9, 0x66, 0xb2, 0x12, 0x16, 0x01, 0x80, 0x5b, 0x1a, 0xc9, 0x52, 0xac, - 0x61, 0x64, 0xb8, 0x58, 0x17, 0x1f, 0xb1, 0x8b, 0x35, 0x9c, 0x98, 0x8b, 0xf5, 0xc0, 0x91, 0x5c, - 0xac, 0x47, 0x8e, 0xec, 0x62, 0x3d, 0xd8, 0x97, 0x8b, 0x35, 0x86, 0x33, 0x92, 0xf7, 0xa4, 0xff, - 0x57, 0xdd, 0x26, 0x11, 0x0f, 0x0e, 0x1e, 0xb6, 0x60, 0xee, 0xc1, 0xc1, 0xfc, 0x19, 0x9c, 0x89, - 0x81, 0x73, 0x6a, 0xa2, 0x4f, 0xc0, 0xac, 0xd3, 0x6c, 0xfa, 0xf7, 0xd4, 0xa4, 0xae, 0x84, 0x75, - 0xa7, 0xc9, 0x95, 0x10, 0xc3, 0x8c, 0xea, 0x13, 0x0f, 0x0e, 0xe6, 0x67, 0x17, 0x73, 0x70, 0x70, - 0x6e, 0x6d, 0xf4, 0x51, 0x28, 0xb5, 0x03, 0xbf, 0xbe, 0xa6, 0xb9, 0x26, 0x9e, 0xa7, 0x03, 0x58, - 0x95, 0x85, 0x87, 0x07, 0xf3, 0xe3, 0xea, 0x0f, 0xbb, 0xf0, 0xe3, 0x0a, 0x19, 0x3e, 0xd3, 0xa3, - 0xc7, 0xea, 0x33, 0xbd, 0x0b, 0x33, 0x35, 0x12, 0xb8, 0x2c, 0xcd, 0x79, 0x23, 0x3e, 0x9f, 0x36, - 0xa0, 0x14, 0x24, 0x4e, 0xe4, 0xbe, 0x02, 0x3b, 0x6a, 0x59, 0x0e, 0xe4, 0x09, 0x1c, 0x13, 0xb2, - 0xff, 0x97, 0x05, 0xc3, 0xc2, 0xcb, 0xe7, 0x04, 0xb8, 0xc6, 0x45, 0x43, 0x93, 0x30, 0x9f, 0x3d, - 0x60, 0xac, 0x33, 0xb9, 0x3a, 0x84, 0x4a, 0x42, 0x87, 0xf0, 0x64, 0x37, 0x22, 0xdd, 0xb5, 0x07, - 0x7f, 0xad, 0x48, 0xb9, 0x77, 0xc3, 0xdf, 0xf4, 0xd1, 0x0f, 0xc1, 0x3a, 0x0c, 0x87, 0xc2, 0xdf, - 0xb1, 0x90, 0x6f, 0xa0, 0x9f, 0x9c, 0xc4, 0xd8, 0x8e, 0x4d, 0x78, 0x38, 0x4a, 0x22, 0x99, 0x8e, - 0x94, 0xc5, 0x47, 0xe8, 0x48, 0xd9, 0xcb, 0x23, 0x77, 0xe0, 0x38, 0x3c, 0x72, 0xed, 0xaf, 0xb0, - 0x9b, 0x53, 0x2f, 0x3f, 0x01, 0xa6, 0xea, 0x9a, 0x79, 0xc7, 0xda, 0x5d, 0x56, 0x96, 0xe8, 0x54, - 0x0e, 0x73, 0xf5, 0x73, 0x16, 0x9c, 0xcb, 0xf8, 0x2a, 0x8d, 0xd3, 0x7a, 0x16, 0x46, 0x9c, 0x4e, - 0xc3, 0x55, 0x7b, 0x59, 0xd3, 0x27, 0x2e, 0x8a, 0x72, 0xac, 0x30, 0xd0, 0x32, 0x4c, 0x93, 0xfb, - 0x6d, 0x97, 0xab, 0x52, 0x75, 0xab, 0xd6, 0x22, 0x77, 0x0d, 0x5b, 0x49, 0x02, 0x71, 0x1a, 0x5f, - 0x45, 0x41, 0x29, 0xe6, 0x46, 0x41, 0xf9, 0x7b, 0x16, 0x8c, 0x2a, 0x8f, 0xbf, 0x47, 0x3e, 0xda, - 0x1f, 0x37, 0x47, 0xfb, 0xf1, 0x2e, 0xa3, 0x9d, 0x33, 0xcc, 0xbf, 0x55, 0x50, 0xfd, 0xad, 0xfa, - 0x41, 0xd4, 0x07, 0x07, 0xf7, 0xf0, 0x76, 0xf8, 0x57, 0x61, 0xd4, 0x69, 0xb7, 0x25, 0x40, 0xda, - 0xa0, 0xb1, 0x30, 0xbd, 0x71, 0x31, 0xd6, 0x71, 0x94, 0x5b, 0x40, 0x31, 0xd7, 0x2d, 0xa0, 0x01, - 0x10, 0x39, 0xc1, 0x36, 0x89, 0x68, 0x99, 0x88, 0x58, 0x96, 0x7f, 0xde, 0x74, 0x22, 0xb7, 0xb9, - 0xe0, 0x7a, 0x51, 0x18, 0x05, 0x0b, 0x15, 0x2f, 0xba, 0x15, 0xf0, 0x27, 0xa4, 0x16, 0x12, 0x48, - 0xd1, 0xc2, 0x1a, 0x5d, 0xe9, 0xdd, 0xce, 0xda, 0x18, 0x34, 0x8d, 0x19, 0xd6, 0x45, 0x39, 0x56, - 0x18, 0xf6, 0x47, 0xd8, 0xed, 0xc3, 0xc6, 0xf4, 0x68, 0x31, 0x74, 0xfe, 0xeb, 0x98, 0x9a, 0x0d, - 0xa6, 0xc9, 0x2c, 0xeb, 0x91, 0x7a, 0xba, 0x1f, 0xf6, 0xb4, 0x61, 0xdd, 0x49, 0x2d, 0x0e, 0xe7, - 0x83, 0xbe, 0x2d, 0x65, 0xa0, 0xf2, 0x5c, 0x8f, 0x5b, 0xe3, 0x08, 0x26, 0x29, 0x2c, 0x67, 0x07, - 0xcb, 0x68, 0x50, 0xa9, 0x8a, 0x7d, 0xa1, 0xe5, 0xec, 0x10, 0x00, 0x1c, 0xe3, 0x50, 0x66, 0x4a, - 0xfd, 0x09, 0x67, 0x51, 0x1c, 0xbb, 0x52, 0x61, 0x87, 0x58, 0xc3, 0x40, 0x57, 0x84, 0x40, 0x81, - 0xeb, 0x05, 0x1e, 0x4f, 0x08, 0x14, 0xe4, 0x70, 0x69, 0x52, 0xa0, 0xab, 0x30, 0xaa, 0xd2, 0xf6, - 0x56, 0x79, 0x36, 0x58, 0xb1, 0xcc, 0x56, 0xe2, 0x62, 0xac, 0xe3, 0xa0, 0x0d, 0x98, 0x0c, 0xb9, - 0x9c, 0x4d, 0x05, 0x14, 0xe6, 0xf2, 0xca, 0x0f, 0x4a, 0x2b, 0xa0, 0x9a, 0x09, 0x3e, 0x64, 0x45, - 0xfc, 0x74, 0x92, 0x1e, 0xe8, 0x49, 0x12, 0xe8, 0x35, 0x98, 0x68, 0xfa, 0x4e, 0x63, 0xc9, 0x69, - 0x3a, 0x5e, 0x9d, 0x8d, 0xcf, 0x88, 0x99, 0xfd, 0xf1, 0xa6, 0x01, 0xc5, 0x09, 0x6c, 0xca, 0xbc, - 0xe9, 0x25, 0x22, 0x08, 0xb6, 0xe3, 0x6d, 0x93, 0x50, 0x24, 0x61, 0x65, 0xcc, 0xdb, 0xcd, 0x1c, - 0x1c, 0x9c, 0x5b, 0x1b, 0xbd, 0x0c, 0x63, 0xf2, 0xf3, 0xb5, 0x80, 0x0d, 0xb1, 0x87, 0x85, 0x06, - 0xc3, 0x06, 0x26, 0xba, 0x07, 0xa7, 0xe5, 0xff, 0x8d, 0xc0, 0xd9, 0xda, 0x72, 0xeb, 0xc2, 0x8b, - 0x99, 0xbb, 0x62, 0x2e, 0x4a, 0x7f, 0xc1, 0x95, 0x2c, 0xa4, 0xc3, 0x83, 0xf9, 0x0b, 0x62, 0xd4, - 0x32, 0xe1, 0x6c, 0x12, 0xb3, 0xe9, 0xa3, 0x35, 0x98, 0xd9, 0x21, 0x4e, 0x33, 0xda, 0x59, 0xde, - 0x21, 0xf5, 0x5d, 0xb9, 0xe9, 0x58, 0x18, 0x08, 0xcd, 0x2f, 0xe1, 0x7a, 0x1a, 0x05, 0x67, 0xd5, - 0x43, 0x6f, 0xc2, 0x6c, 0xbb, 0xb3, 0xd9, 0x74, 0xc3, 0x9d, 0x75, 0x3f, 0x62, 0xa6, 0x40, 0x2a, - 0x0b, 0xb0, 0x88, 0x17, 0xa1, 0x02, 0x6d, 0x54, 0x73, 0xf0, 0x70, 0x2e, 0x05, 0xf4, 0x36, 0x9c, - 0x4e, 0x2c, 0x06, 0xe1, 0x31, 0x3f, 0x91, 0x9f, 0x52, 0xa0, 0x96, 0x55, 0x41, 0x04, 0x9f, 0xc8, - 0x02, 0xe1, 0xec, 0x26, 0xe8, 0xe3, 0x43, 0x8b, 0xe1, 0x1a, 0xce, 0x4e, 0xc5, 0x36, 0xcb, 0x5a, - 0xa0, 0xd7, 0x10, 0x1b, 0x58, 0xe8, 0x15, 0x00, 0xb7, 0xbd, 0xea, 0xb4, 0xdc, 0x26, 0x7d, 0x64, - 0xce, 0xb0, 0x3a, 0xf4, 0xc1, 0x01, 0x95, 0xaa, 0x2c, 0xa5, 0xa7, 0xba, 0xf8, 0xb7, 0x8f, 0x35, - 0x6c, 0x54, 0x85, 0x09, 0xf1, 0x6f, 0x5f, 0x2c, 0x86, 0x69, 0xe5, 0xd2, 0x3e, 0x21, 0x6b, 0xa8, - 0x15, 0x80, 0xcc, 0x12, 0x36, 0xe7, 0x89, 0xfa, 0x68, 0x1b, 0xce, 0x89, 0x34, 0xd3, 0x44, 0x5f, - 0xdd, 0x72, 0xf6, 0x42, 0x96, 0x01, 0x60, 0x84, 0x3b, 0x4b, 0x2c, 0x76, 0x43, 0xc4, 0xdd, 0xe9, - 0x50, 0xae, 0x40, 0xdf, 0x24, 0xdc, 0x89, 0xf4, 0x34, 0x37, 0x6a, 0xa2, 0x5c, 0xc1, 0xcd, 0x24, - 0x10, 0xa7, 0xf1, 0x51, 0x08, 0xa7, 0x5d, 0x2f, 0x6b, 0x4f, 0x9c, 0x61, 0x84, 0x3e, 0xc6, 0xfd, - 0x67, 0xbb, 0xef, 0x87, 0x4c, 0x38, 0xdf, 0x0f, 0x99, 0xb4, 0xdf, 0x99, 0xed, 0xde, 0x6f, 0x5b, - 0xb4, 0xb6, 0xc6, 0xdf, 0xa3, 0xcf, 0xc2, 0x98, 0xfe, 0x61, 0x82, 0x57, 0xb9, 0x94, 0xcd, 0xfe, - 0x6a, 0xa7, 0x0a, 0x7f, 0x1d, 0xa8, 0x93, 0x43, 0x87, 0x61, 0x83, 0x22, 0xaa, 0x67, 0x78, 0x9a, - 0x5f, 0xe9, 0x8f, 0x17, 0xea, 0xdf, 0x74, 0x8d, 0x40, 0xf6, 0x66, 0x41, 0x37, 0x61, 0xa4, 0xde, - 0x74, 0x89, 0x17, 0x55, 0xaa, 0xdd, 0x62, 0xc3, 0x2d, 0x0b, 0x1c, 0xb1, 0xfb, 0x44, 0x40, 0x7f, - 0x5e, 0x86, 0x15, 0x05, 0xfb, 0x57, 0x0b, 0x30, 0xdf, 0x23, 0x3b, 0x44, 0x42, 0x91, 0x65, 0xf5, - 0xa5, 0xc8, 0x5a, 0x94, 0x09, 0xb2, 0xd7, 0x13, 0x32, 0xb2, 0x44, 0xf2, 0xeb, 0x58, 0x52, 0x96, - 0xc4, 0xef, 0xdb, 0xb1, 0x40, 0xd7, 0x85, 0x0d, 0xf4, 0x74, 0x8d, 0x31, 0x74, 0xe0, 0x83, 0xfd, - 0x3f, 0x9c, 0x73, 0xf5, 0x99, 0xf6, 0x57, 0x0a, 0x70, 0x5a, 0x0d, 0xe1, 0x37, 0xef, 0xc0, 0xdd, - 0x4e, 0x0f, 0xdc, 0x31, 0x68, 0x83, 0xed, 0x5b, 0x30, 0xc4, 0x83, 0xdd, 0xf5, 0xc1, 0xb0, 0x5f, - 0x34, 0xe3, 0xc2, 0x2a, 0x1e, 0xd1, 0x88, 0x0d, 0xfb, 0xbd, 0x16, 0x4c, 0x6e, 0x2c, 0x57, 0x6b, - 0x7e, 0x7d, 0x97, 0x44, 0x8b, 0xfc, 0x81, 0x85, 0x35, 0x9f, 0xdc, 0x87, 0x61, 0xaa, 0xb3, 0xd8, - 0xf5, 0x0b, 0x30, 0xb0, 0xe3, 0x87, 0x51, 0xd2, 0x54, 0xe4, 0xba, 0x1f, 0x46, 0x98, 0x41, 0xec, - 0xdf, 0xb5, 0x60, 0x70, 0xc3, 0x71, 0xbd, 0x48, 0xaa, 0x15, 0xac, 0x1c, 0xb5, 0x42, 0x3f, 0xdf, - 0x85, 0x5e, 0x82, 0x21, 0xb2, 0xb5, 0x45, 0xea, 0x91, 0x98, 0x55, 0x19, 0xd0, 0x60, 0x68, 0x85, - 0x95, 0x52, 0x0e, 0x92, 0x35, 0xc6, 0xff, 0x62, 0x81, 0x8c, 0xee, 0x42, 0x29, 0x72, 0x5b, 0x64, - 0xb1, 0xd1, 0x10, 0xca, 0xf6, 0x87, 0x08, 0xca, 0xb0, 0x21, 0x09, 0xe0, 0x98, 0x96, 0xfd, 0xa5, - 0x02, 0x40, 0x1c, 0x25, 0xa8, 0xd7, 0x27, 0x2e, 0xa5, 0xd4, 0xb0, 0x97, 0x32, 0xd4, 0xb0, 0x28, - 0x26, 0x98, 0xa1, 0x83, 0x55, 0xc3, 0x54, 0xec, 0x6b, 0x98, 0x06, 0x8e, 0x32, 0x4c, 0xcb, 0x30, - 0x1d, 0x47, 0x39, 0x32, 0x83, 0xbc, 0xb1, 0xeb, 0x73, 0x23, 0x09, 0xc4, 0x69, 0x7c, 0x9b, 0xc0, - 0x05, 0x15, 0xec, 0x45, 0xdc, 0x68, 0xcc, 0x96, 0x5b, 0x57, 0x6b, 0xf7, 0x18, 0xa7, 0x58, 0xcf, - 0x5c, 0xc8, 0xd5, 0x33, 0xff, 0x84, 0x05, 0xa7, 0x92, 0xed, 0x30, 0x2f, 0xde, 0x2f, 0x5a, 0x70, - 0x9a, 0x69, 0xdb, 0x59, 0xab, 0x69, 0xdd, 0xfe, 0x8b, 0x5d, 0x03, 0xd8, 0xe4, 0xf4, 0x38, 0x8e, - 0x9c, 0xb1, 0x96, 0x45, 0x1a, 0x67, 0xb7, 0x68, 0xff, 0x87, 0x02, 0xcc, 0xe6, 0x45, 0xbe, 0x61, - 0xae, 0x1e, 0xce, 0xfd, 0xda, 0x2e, 0xb9, 0x27, 0x0c, 0xea, 0x63, 0x57, 0x0f, 0x5e, 0x8c, 0x25, - 0x3c, 0x19, 0xf0, 0xbf, 0xd0, 0x67, 0xc0, 0xff, 0x1d, 0x98, 0xbe, 0xb7, 0x43, 0xbc, 0xdb, 0x5e, - 0xe8, 0x44, 0x6e, 0xb8, 0xe5, 0x32, 0xcd, 0x34, 0x5f, 0x37, 0xaf, 0x48, 0xb3, 0xf7, 0xbb, 0x49, - 0x84, 0xc3, 0x83, 0xf9, 0x73, 0x46, 0x41, 0xdc, 0x65, 0x7e, 0x90, 0xe0, 0x34, 0xd1, 0x74, 0xbe, - 0x84, 0x81, 0x47, 0x98, 0x2f, 0xc1, 0xfe, 0xa2, 0x05, 0x67, 0x73, 0x93, 0xb4, 0xa2, 0xcb, 0x30, - 0xe2, 0xb4, 0x5d, 0x2e, 0xdc, 0x17, 0xc7, 0x28, 0x13, 0x22, 0x55, 0x2b, 0x5c, 0xb4, 0xaf, 0xa0, - 0x2a, 0x79, 0x7c, 0x21, 0x37, 0x79, 0x7c, 0xcf, 0x5c, 0xf0, 0xf6, 0xf7, 0x58, 0x20, 0xdc, 0x54, - 0xfb, 0x38, 0xbb, 0x3f, 0x05, 0x63, 0x7b, 0xe9, 0x9c, 0x4a, 0x17, 0xf2, 0xfd, 0x76, 0x45, 0x26, - 0x25, 0xc5, 0x90, 0x19, 0xf9, 0x93, 0x0c, 0x5a, 0x76, 0x03, 0x04, 0xb4, 0x4c, 0x98, 0xe8, 0xba, - 0x77, 0x6f, 0x9e, 0x07, 0x68, 0x30, 0x5c, 0x2d, 0x03, 0xbf, 0xba, 0x99, 0xcb, 0x0a, 0x82, 0x35, - 0x2c, 0xfb, 0xdf, 0x16, 0x60, 0x54, 0xe6, 0xf0, 0xe9, 0x78, 0xfd, 0x08, 0x98, 0x8e, 0x94, 0xd4, - 0x13, 0x5d, 0x81, 0x12, 0x93, 0x80, 0x56, 0x63, 0xb9, 0x9c, 0x92, 0x3f, 0xac, 0x49, 0x00, 0x8e, - 0x71, 0xe8, 0x2e, 0x0a, 0x3b, 0x9b, 0x0c, 0x3d, 0xe1, 0x54, 0x59, 0xe3, 0xc5, 0x58, 0xc2, 0xd1, - 0x27, 0x60, 0x8a, 0xd7, 0x0b, 0xfc, 0xb6, 0xb3, 0xcd, 0xb5, 0x26, 0x83, 0x2a, 0xec, 0xc2, 0xd4, - 0x5a, 0x02, 0x76, 0x78, 0x30, 0x7f, 0x2a, 0x59, 0xc6, 0xd4, 0x81, 0x29, 0x2a, 0xcc, 0x38, 0x8a, - 0x37, 0x42, 0x77, 0x7f, 0xca, 0xa6, 0x2a, 0x06, 0x61, 0x1d, 0xcf, 0xfe, 0x2c, 0xa0, 0x74, 0x36, - 0x23, 0xf4, 0x3a, 0xb7, 0x88, 0x75, 0x03, 0xd2, 0xe8, 0xa6, 0x1e, 0xd4, 0x83, 0x0b, 0x48, 0x7f, - 0x28, 0x5e, 0x0b, 0xab, 0xfa, 0xf6, 0xff, 0x5f, 0x84, 0xa9, 0xa4, 0x07, 0x38, 0xba, 0x0e, 0x43, - 0x9c, 0xf5, 0x10, 0xe4, 0xbb, 0x58, 0x9f, 0x68, 0x7e, 0xe3, 0xec, 0x10, 0x16, 0xdc, 0x8b, 0xa8, - 0x8f, 0xde, 0x84, 0xd1, 0x86, 0x7f, 0xcf, 0xbb, 0xe7, 0x04, 0x8d, 0xc5, 0x6a, 0x45, 0x2c, 0xe7, - 0xcc, 0xe7, 0x70, 0x39, 0x46, 0xd3, 0x7d, 0xd1, 0x99, 0xa6, 0x35, 0x06, 0x61, 0x9d, 0x1c, 0xda, - 0x60, 0x21, 0xd0, 0xb7, 0xdc, 0xed, 0x35, 0xa7, 0xdd, 0xcd, 0x3d, 0x62, 0x59, 0x22, 0x69, 0x94, - 0xc7, 0x45, 0x9c, 0x74, 0x0e, 0xc0, 0x31, 0x21, 0xf4, 0x79, 0x98, 0x09, 0x73, 0x84, 0xf4, 0x79, - 0xc9, 0xed, 0xba, 0xc9, 0xad, 0x97, 0x1e, 0x7b, 0x70, 0x30, 0x3f, 0x93, 0x25, 0xce, 0xcf, 0x6a, - 0xc6, 0xfe, 0x91, 0x53, 0x60, 0x6c, 0x62, 0x23, 0xd7, 0xa9, 0x75, 0x4c, 0xb9, 0x4e, 0x31, 0x8c, - 0x90, 0x56, 0x3b, 0xda, 0x2f, 0xbb, 0x41, 0xb7, 0x0c, 0xe0, 0x2b, 0x02, 0x27, 0x4d, 0x53, 0x42, - 0xb0, 0xa2, 0x93, 0x9d, 0x90, 0xb6, 0xf8, 0x75, 0x4c, 0x48, 0x3b, 0x70, 0x82, 0x09, 0x69, 0xd7, - 0x61, 0x78, 0xdb, 0x8d, 0x30, 0x69, 0xfb, 0x82, 0xe9, 0xcf, 0x5c, 0x87, 0xd7, 0x38, 0x4a, 0x3a, - 0xf5, 0xa1, 0x00, 0x60, 0x49, 0x04, 0xbd, 0xae, 0x76, 0xe0, 0x50, 0xfe, 0xc3, 0x3c, 0x6d, 0x26, - 0x91, 0xb9, 0x07, 0x45, 0xda, 0xd9, 0xe1, 0x87, 0x4d, 0x3b, 0xbb, 0x2a, 0x93, 0xc5, 0x8e, 0xe4, - 0xfb, 0x32, 0xb1, 0x5c, 0xb0, 0x3d, 0x52, 0xc4, 0xde, 0xd1, 0x13, 0xec, 0x96, 0xf2, 0x4f, 0x02, - 0x95, 0x3b, 0xb7, 0xcf, 0xb4, 0xba, 0xdf, 0x63, 0xc1, 0xe9, 0x76, 0x56, 0xae, 0x69, 0x61, 0x51, - 0xf0, 0x52, 0xdf, 0xe9, 0xac, 0x8d, 0x06, 0x99, 0x24, 0x2e, 0x13, 0x0d, 0x67, 0x37, 0x47, 0x07, - 0x3a, 0xd8, 0x6c, 0x08, 0xcd, 0xf6, 0xc5, 0x9c, 0xfc, 0xbc, 0x5d, 0xb2, 0xf2, 0x6e, 0x64, 0xe4, - 0x82, 0x7d, 0x7f, 0x5e, 0x2e, 0xd8, 0xbe, 0x33, 0xc0, 0xbe, 0xae, 0x32, 0xf3, 0x8e, 0xe7, 0x2f, - 0x25, 0x9e, 0x77, 0xb7, 0x67, 0x3e, 0xde, 0xd7, 0x55, 0x3e, 0xde, 0x2e, 0xf1, 0x6d, 0x79, 0xb6, - 0xdd, 0x9e, 0x59, 0x78, 0xb5, 0x4c, 0xba, 0x93, 0xc7, 0x93, 0x49, 0xd7, 0xb8, 0x6a, 0x78, 0x32, - 0xd7, 0x67, 0x7a, 0x5c, 0x35, 0x06, 0xdd, 0xee, 0x97, 0x0d, 0xcf, 0x1a, 0x3c, 0xfd, 0x50, 0x59, - 0x83, 0xef, 0xe8, 0x59, 0x78, 0x51, 0x8f, 0x34, 0xb3, 0x14, 0xa9, 0xcf, 0xdc, 0xbb, 0x77, 0xf4, - 0x0b, 0x70, 0x26, 0x9f, 0xae, 0xba, 0xe7, 0xd2, 0x74, 0x33, 0xaf, 0xc0, 0x54, 0x4e, 0xdf, 0x53, - 0x27, 0x93, 0xd3, 0xf7, 0xf4, 0xb1, 0xe7, 0xf4, 0x3d, 0x73, 0x02, 0x39, 0x7d, 0x1f, 0x3b, 0xc1, - 0x9c, 0xbe, 0x77, 0x98, 0x19, 0x0e, 0x0f, 0xf6, 0x23, 0xe2, 0xf1, 0x66, 0xc7, 0x7e, 0xcd, 0x8a, - 0x08, 0xc4, 0x3f, 0x4e, 0x81, 0x70, 0x4c, 0x2a, 0x23, 0x57, 0xf0, 0xec, 0x23, 0xc8, 0x15, 0xbc, - 0x1e, 0xe7, 0x0a, 0x3e, 0x9b, 0x3f, 0xd5, 0x19, 0x8e, 0x1b, 0x39, 0x19, 0x82, 0xef, 0xe8, 0x99, - 0x7d, 0x1f, 0xef, 0xa2, 0x6b, 0xc9, 0x12, 0x3c, 0x76, 0xc9, 0xe7, 0xfb, 0x1a, 0xcf, 0xe7, 0xfb, - 0x44, 0xfe, 0x49, 0x9e, 0xbc, 0xee, 0x8c, 0x2c, 0xbe, 0xb4, 0x5f, 0x2a, 0xf2, 0x23, 0x8b, 0x3c, - 0x9c, 0xd3, 0x2f, 0x15, 0x3a, 0x32, 0xdd, 0x2f, 0x05, 0xc2, 0x31, 0x29, 0xfb, 0xfb, 0x0a, 0x70, - 0xbe, 0xfb, 0x7e, 0x8b, 0xa5, 0xa9, 0xd5, 0x58, 0xf5, 0x9c, 0x90, 0xa6, 0xf2, 0x37, 0x5b, 0x8c, - 0xd5, 0x77, 0x20, 0xbb, 0x6b, 0x30, 0xad, 0x3c, 0x3e, 0x9a, 0x6e, 0x7d, 0x7f, 0x3d, 0x7e, 0xf9, - 0x2a, 0x2f, 0xf9, 0x5a, 0x12, 0x01, 0xa7, 0xeb, 0xa0, 0x45, 0x98, 0x34, 0x0a, 0x2b, 0x65, 0xf1, - 0x36, 0x53, 0xe2, 0xdb, 0x9a, 0x09, 0xc6, 0x49, 0x7c, 0xfb, 0xcb, 0x16, 0x3c, 0x96, 0x93, 0x0c, - 0xaf, 0xef, 0x38, 0x6d, 0x5b, 0x30, 0xd9, 0x36, 0xab, 0xf6, 0x08, 0x2d, 0x69, 0xa4, 0xdc, 0x53, - 0x7d, 0x4d, 0x00, 0x70, 0x92, 0xa8, 0xfd, 0x67, 0x16, 0x9c, 0xeb, 0x6a, 0xc2, 0x88, 0x30, 0x9c, - 0xd9, 0x6e, 0x85, 0xce, 0x72, 0x40, 0x1a, 0xc4, 0x8b, 0x5c, 0xa7, 0x59, 0x6b, 0x93, 0xba, 0x26, - 0x0f, 0x67, 0xb6, 0x80, 0xd7, 0xd6, 0x6a, 0x8b, 0x69, 0x0c, 0x9c, 0x53, 0x13, 0xad, 0x02, 0x4a, - 0x43, 0xc4, 0x0c, 0xb3, 0x18, 0xd6, 0x69, 0x7a, 0x38, 0xa3, 0x06, 0xfa, 0x08, 0x8c, 0x2b, 0xd3, - 0x48, 0x6d, 0xc6, 0xd9, 0xc1, 0x8e, 0x75, 0x00, 0x36, 0xf1, 0x96, 0x2e, 0xff, 0xfa, 0xef, 0x9f, - 0x7f, 0xdf, 0x6f, 0xfe, 0xfe, 0xf9, 0xf7, 0xfd, 0xce, 0xef, 0x9f, 0x7f, 0xdf, 0x77, 0x3c, 0x38, - 0x6f, 0xfd, 0xfa, 0x83, 0xf3, 0xd6, 0x6f, 0x3e, 0x38, 0x6f, 0xfd, 0xce, 0x83, 0xf3, 0xd6, 0xef, - 0x3d, 0x38, 0x6f, 0x7d, 0xe9, 0x0f, 0xce, 0xbf, 0xef, 0x53, 0x85, 0xbd, 0xab, 0xff, 0x37, 0x00, - 0x00, 0xff, 0xff, 0x6d, 0xc2, 0x10, 0x4f, 0xcb, 0x03, 0x01, 0x00, + // 14044 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x69, 0x70, 0x5c, 0xd9, + 0x75, 0x18, 0xac, 0xd7, 0x8d, 0xad, 0x0f, 0xf6, 0x0b, 0x92, 0x03, 0x62, 0x86, 0x04, 0xe7, 0x51, + 0xe2, 0x70, 0x34, 0x33, 0xa0, 0x38, 0x8b, 0x34, 0x9e, 0x91, 0xc6, 0x02, 0xd0, 0x00, 0xd9, 0x43, + 0x02, 0xec, 0xb9, 0x0d, 0x92, 0x92, 0x3c, 0x52, 0xe9, 0xa1, 0xfb, 0x02, 0x78, 0x42, 0xf7, 0x7b, + 0x3d, 0xef, 0xbd, 0x06, 0x89, 0xf9, 0xe4, 0xfa, 0xfc, 0xc9, 0xab, 0xbc, 0x7c, 0xa5, 0x4a, 0x39, + 0x9b, 0xed, 0x72, 0xa5, 0x1c, 0xa7, 0x6c, 0xc5, 0xd9, 0x1c, 0x3b, 0xb6, 0x63, 0x39, 0xb1, 0x13, + 0x67, 0x71, 0xf2, 0xc3, 0x71, 0x5c, 0x89, 0xe5, 0x2a, 0x57, 0x10, 0x9b, 0x4e, 0x95, 0x4b, 0x3f, + 0x62, 0x3b, 0x71, 0xf2, 0x23, 0x88, 0x2b, 0x4e, 0xdd, 0xf5, 0xdd, 0xfb, 0x96, 0xee, 0x06, 0x07, + 0x84, 0x46, 0xaa, 0xf9, 0xd7, 0x7d, 0xcf, 0xb9, 0xe7, 0xde, 0x77, 0xd7, 0x73, 0xcf, 0x0a, 0xaf, + 0xee, 0xbe, 0x1c, 0x2e, 0xb8, 0xfe, 0x95, 0xdd, 0xce, 0x26, 0x09, 0x3c, 0x12, 0x91, 0xf0, 0xca, + 0x1e, 0xf1, 0x1a, 0x7e, 0x70, 0x45, 0x00, 0x9c, 0xb6, 0x7b, 0xa5, 0xee, 0x07, 0xe4, 0xca, 0xde, + 0xd5, 0x2b, 0xdb, 0xc4, 0x23, 0x81, 0x13, 0x91, 0xc6, 0x42, 0x3b, 0xf0, 0x23, 0x1f, 0x21, 0x8e, + 0xb3, 0xe0, 0xb4, 0xdd, 0x05, 0x8a, 0xb3, 0xb0, 0x77, 0x75, 0xee, 0xb9, 0x6d, 0x37, 0xda, 0xe9, + 0x6c, 0x2e, 0xd4, 0xfd, 0xd6, 0x95, 0x6d, 0x7f, 0xdb, 0xbf, 0xc2, 0x50, 0x37, 0x3b, 0x5b, 0xec, + 0x1f, 0xfb, 0xc3, 0x7e, 0x71, 0x12, 0x73, 0x2f, 0xc6, 0xcd, 0xb4, 0x9c, 0xfa, 0x8e, 0xeb, 0x91, + 0x60, 0xff, 0x4a, 0x7b, 0x77, 0x9b, 0xb5, 0x1b, 0x90, 0xd0, 0xef, 0x04, 0x75, 0x92, 0x6c, 0xb8, + 0x6b, 0xad, 0xf0, 0x4a, 0x8b, 0x44, 0x4e, 0x46, 0x77, 0xe7, 0xae, 0xe4, 0xd5, 0x0a, 0x3a, 0x5e, + 0xe4, 0xb6, 0xd2, 0xcd, 0x7c, 0xb8, 0x57, 0x85, 0xb0, 0xbe, 0x43, 0x5a, 0x4e, 0xaa, 0xde, 0x0b, + 0x79, 0xf5, 0x3a, 0x91, 0xdb, 0xbc, 0xe2, 0x7a, 0x51, 0x18, 0x05, 0xc9, 0x4a, 0xf6, 0x57, 0x2d, + 0xb8, 0xb0, 0x78, 0xb7, 0xb6, 0xd2, 0x74, 0xc2, 0xc8, 0xad, 0x2f, 0x35, 0xfd, 0xfa, 0x6e, 0x2d, + 0xf2, 0x03, 0x72, 0xc7, 0x6f, 0x76, 0x5a, 0xa4, 0xc6, 0x06, 0x02, 0x3d, 0x0b, 0x23, 0x7b, 0xec, + 0x7f, 0xa5, 0x3c, 0x6b, 0x5d, 0xb0, 0x2e, 0x97, 0x96, 0xa6, 0x7e, 0xe3, 0x60, 0xfe, 0x7d, 0x0f, + 0x0e, 0xe6, 0x47, 0xee, 0x88, 0x72, 0xac, 0x30, 0xd0, 0x25, 0x18, 0xda, 0x0a, 0x37, 0xf6, 0xdb, + 0x64, 0xb6, 0xc0, 0x70, 0x27, 0x04, 0xee, 0xd0, 0x6a, 0x8d, 0x96, 0x62, 0x01, 0x45, 0x57, 0xa0, + 0xd4, 0x76, 0x82, 0xc8, 0x8d, 0x5c, 0xdf, 0x9b, 0x2d, 0x5e, 0xb0, 0x2e, 0x0f, 0x2e, 0x4d, 0x0b, + 0xd4, 0x52, 0x55, 0x02, 0x70, 0x8c, 0x43, 0xbb, 0x11, 0x10, 0xa7, 0x71, 0xcb, 0x6b, 0xee, 0xcf, + 0x0e, 0x5c, 0xb0, 0x2e, 0x8f, 0xc4, 0xdd, 0xc0, 0xa2, 0x1c, 0x2b, 0x0c, 0xfb, 0x47, 0x0a, 0x30, + 0xb2, 0xb8, 0xb5, 0xe5, 0x7a, 0x6e, 0xb4, 0x8f, 0xee, 0xc0, 0x98, 0xe7, 0x37, 0x88, 0xfc, 0xcf, + 0xbe, 0x62, 0xf4, 0xf9, 0x0b, 0x0b, 0xe9, 0xa5, 0xb4, 0xb0, 0xae, 0xe1, 0x2d, 0x4d, 0x3d, 0x38, + 0x98, 0x1f, 0xd3, 0x4b, 0xb0, 0x41, 0x07, 0x61, 0x18, 0x6d, 0xfb, 0x0d, 0x45, 0xb6, 0xc0, 0xc8, + 0xce, 0x67, 0x91, 0xad, 0xc6, 0x68, 0x4b, 0x93, 0x0f, 0x0e, 0xe6, 0x47, 0xb5, 0x02, 0xac, 0x13, + 0x41, 0x9b, 0x30, 0x49, 0xff, 0x7a, 0x91, 0xab, 0xe8, 0x16, 0x19, 0xdd, 0x8b, 0x79, 0x74, 0x35, + 0xd4, 0xa5, 0x99, 0x07, 0x07, 0xf3, 0x93, 0x89, 0x42, 0x9c, 0x24, 0x68, 0xbf, 0x0d, 0x13, 0x8b, + 0x51, 0xe4, 0xd4, 0x77, 0x48, 0x83, 0xcf, 0x20, 0x7a, 0x11, 0x06, 0x3c, 0xa7, 0x45, 0xc4, 0xfc, + 0x5e, 0x10, 0x03, 0x3b, 0xb0, 0xee, 0xb4, 0xc8, 0xe1, 0xc1, 0xfc, 0xd4, 0x6d, 0xcf, 0x7d, 0xab, + 0x23, 0x56, 0x05, 0x2d, 0xc3, 0x0c, 0x1b, 0x3d, 0x0f, 0xd0, 0x20, 0x7b, 0x6e, 0x9d, 0x54, 0x9d, + 0x68, 0x47, 0xcc, 0x37, 0x12, 0x75, 0xa1, 0xac, 0x20, 0x58, 0xc3, 0xb2, 0xef, 0x43, 0x69, 0x71, + 0xcf, 0x77, 0x1b, 0x55, 0xbf, 0x11, 0xa2, 0x5d, 0x98, 0x6c, 0x07, 0x64, 0x8b, 0x04, 0xaa, 0x68, + 0xd6, 0xba, 0x50, 0xbc, 0x3c, 0xfa, 0xfc, 0xe5, 0xcc, 0x8f, 0x35, 0x51, 0x57, 0xbc, 0x28, 0xd8, + 0x5f, 0x7a, 0x4c, 0xb4, 0x37, 0x99, 0x80, 0xe2, 0x24, 0x65, 0xfb, 0x5f, 0x14, 0xe0, 0xf4, 0xe2, + 0xdb, 0x9d, 0x80, 0x94, 0xdd, 0x70, 0x37, 0xb9, 0xc2, 0x1b, 0x6e, 0xb8, 0xbb, 0x1e, 0x8f, 0x80, + 0x5a, 0x5a, 0x65, 0x51, 0x8e, 0x15, 0x06, 0x7a, 0x0e, 0x86, 0xe9, 0xef, 0xdb, 0xb8, 0x22, 0x3e, + 0x79, 0x46, 0x20, 0x8f, 0x96, 0x9d, 0xc8, 0x29, 0x73, 0x10, 0x96, 0x38, 0x68, 0x0d, 0x46, 0xeb, + 0x6c, 0x43, 0x6e, 0xaf, 0xf9, 0x0d, 0xc2, 0x26, 0xb3, 0xb4, 0xf4, 0x0c, 0x45, 0x5f, 0x8e, 0x8b, + 0x0f, 0x0f, 0xe6, 0x67, 0x79, 0xdf, 0x04, 0x09, 0x0d, 0x86, 0xf5, 0xfa, 0xc8, 0x56, 0xfb, 0x6b, + 0x80, 0x51, 0x82, 0x8c, 0xbd, 0x75, 0x59, 0xdb, 0x2a, 0x83, 0x6c, 0xab, 0x8c, 0x65, 0x6f, 0x13, + 0x74, 0x15, 0x06, 0x76, 0x5d, 0xaf, 0x31, 0x3b, 0xc4, 0x68, 0x9d, 0xa3, 0x73, 0x7e, 0xc3, 0xf5, + 0x1a, 0x87, 0x07, 0xf3, 0xd3, 0x46, 0x77, 0x68, 0x21, 0x66, 0xa8, 0xf6, 0x9f, 0x59, 0x30, 0xcf, + 0x60, 0xab, 0x6e, 0x93, 0x54, 0x49, 0x10, 0xba, 0x61, 0x44, 0xbc, 0xc8, 0x18, 0xd0, 0xe7, 0x01, + 0x42, 0x52, 0x0f, 0x48, 0xa4, 0x0d, 0xa9, 0x5a, 0x18, 0x35, 0x05, 0xc1, 0x1a, 0x16, 0x3d, 0x10, + 0xc2, 0x1d, 0x27, 0x60, 0xeb, 0x4b, 0x0c, 0xac, 0x3a, 0x10, 0x6a, 0x12, 0x80, 0x63, 0x1c, 0xe3, + 0x40, 0x28, 0xf6, 0x3a, 0x10, 0xd0, 0xc7, 0x60, 0x32, 0x6e, 0x2c, 0x6c, 0x3b, 0x75, 0x39, 0x80, + 0x6c, 0xcb, 0xd4, 0x4c, 0x10, 0x4e, 0xe2, 0xda, 0x7f, 0xdb, 0x12, 0x8b, 0x87, 0x7e, 0xf5, 0xbb, + 0xfc, 0x5b, 0xed, 0x5f, 0xb2, 0x60, 0x78, 0xc9, 0xf5, 0x1a, 0xae, 0xb7, 0x8d, 0x3e, 0x0b, 0x23, + 0xf4, 0x6e, 0x6a, 0x38, 0x91, 0x23, 0xce, 0xbd, 0x0f, 0x69, 0x7b, 0x4b, 0x5d, 0x15, 0x0b, 0xed, + 0xdd, 0x6d, 0x5a, 0x10, 0x2e, 0x50, 0x6c, 0xba, 0xdb, 0x6e, 0x6d, 0x7e, 0x8e, 0xd4, 0xa3, 0x35, + 0x12, 0x39, 0xf1, 0xe7, 0xc4, 0x65, 0x58, 0x51, 0x45, 0x37, 0x60, 0x28, 0x72, 0x82, 0x6d, 0x12, + 0x89, 0x03, 0x30, 0xf3, 0xa0, 0xe2, 0x35, 0x31, 0xdd, 0x91, 0xc4, 0xab, 0x93, 0xf8, 0x5a, 0xd8, + 0x60, 0x55, 0xb1, 0x20, 0x61, 0xff, 0xd0, 0x30, 0x9c, 0x5d, 0xae, 0x55, 0x72, 0xd6, 0xd5, 0x25, + 0x18, 0x6a, 0x04, 0xee, 0x1e, 0x09, 0xc4, 0x38, 0x2b, 0x2a, 0x65, 0x56, 0x8a, 0x05, 0x14, 0xbd, + 0x0c, 0x63, 0xfc, 0x42, 0xba, 0xee, 0x78, 0x8d, 0xa6, 0x1c, 0xe2, 0x53, 0x02, 0x7b, 0xec, 0x8e, + 0x06, 0xc3, 0x06, 0xe6, 0x11, 0x17, 0xd5, 0xa5, 0xc4, 0x66, 0xcc, 0xbb, 0xec, 0xbe, 0x68, 0xc1, + 0x14, 0x6f, 0x66, 0x31, 0x8a, 0x02, 0x77, 0xb3, 0x13, 0x91, 0x70, 0x76, 0x90, 0x9d, 0x74, 0xcb, + 0x59, 0xa3, 0x95, 0x3b, 0x02, 0x0b, 0x77, 0x12, 0x54, 0xf8, 0x21, 0x38, 0x2b, 0xda, 0x9d, 0x4a, + 0x82, 0x71, 0xaa, 0x59, 0xf4, 0x9d, 0x16, 0xcc, 0xd5, 0x7d, 0x2f, 0x0a, 0xfc, 0x66, 0x93, 0x04, + 0xd5, 0xce, 0x66, 0xd3, 0x0d, 0x77, 0xf8, 0x3a, 0xc5, 0x64, 0x8b, 0x9d, 0x04, 0x39, 0x73, 0xa8, + 0x90, 0xc4, 0x1c, 0x9e, 0x7f, 0x70, 0x30, 0x3f, 0xb7, 0x9c, 0x4b, 0x0a, 0x77, 0x69, 0x06, 0xed, + 0x02, 0xa2, 0x57, 0x69, 0x2d, 0x72, 0xb6, 0x49, 0xdc, 0xf8, 0x70, 0xff, 0x8d, 0x9f, 0x79, 0x70, + 0x30, 0x8f, 0xd6, 0x53, 0x24, 0x70, 0x06, 0x59, 0xf4, 0x16, 0x9c, 0xa2, 0xa5, 0xa9, 0x6f, 0x1d, + 0xe9, 0xbf, 0xb9, 0xd9, 0x07, 0x07, 0xf3, 0xa7, 0xd6, 0x33, 0x88, 0xe0, 0x4c, 0xd2, 0xe8, 0x3b, + 0x2c, 0x38, 0x1b, 0x7f, 0xfe, 0xca, 0xfd, 0xb6, 0xe3, 0x35, 0xe2, 0x86, 0x4b, 0xfd, 0x37, 0x4c, + 0xcf, 0xe4, 0xb3, 0xcb, 0x79, 0x94, 0x70, 0x7e, 0x23, 0x73, 0xcb, 0x70, 0x3a, 0x73, 0xb5, 0xa0, + 0x29, 0x28, 0xee, 0x12, 0xce, 0x05, 0x95, 0x30, 0xfd, 0x89, 0x4e, 0xc1, 0xe0, 0x9e, 0xd3, 0xec, + 0x88, 0x8d, 0x82, 0xf9, 0x9f, 0x57, 0x0a, 0x2f, 0x5b, 0xf6, 0xbf, 0x2c, 0xc2, 0xe4, 0x72, 0xad, + 0xf2, 0x50, 0xbb, 0x50, 0xbf, 0x86, 0x0a, 0x5d, 0xaf, 0xa1, 0xf8, 0x52, 0x2b, 0xe6, 0x5e, 0x6a, + 0xff, 0x6f, 0xc6, 0x16, 0x1a, 0x60, 0x5b, 0xe8, 0x5b, 0x72, 0xb6, 0xd0, 0x31, 0x6f, 0x9c, 0xbd, + 0x9c, 0x55, 0x34, 0xc8, 0x26, 0x33, 0x93, 0x63, 0xb9, 0xe9, 0xd7, 0x9d, 0x66, 0xf2, 0xe8, 0x3b, + 0xe2, 0x52, 0x3a, 0x9e, 0x79, 0xac, 0xc3, 0xd8, 0xb2, 0xd3, 0x76, 0x36, 0xdd, 0xa6, 0x1b, 0xb9, + 0x24, 0x44, 0x4f, 0x41, 0xd1, 0x69, 0x34, 0x18, 0xb7, 0x55, 0x5a, 0x3a, 0xfd, 0xe0, 0x60, 0xbe, + 0xb8, 0xd8, 0xa0, 0xd7, 0x3e, 0x28, 0xac, 0x7d, 0x4c, 0x31, 0xd0, 0x07, 0x61, 0xa0, 0x11, 0xf8, + 0xed, 0xd9, 0x02, 0xc3, 0xa4, 0xbb, 0x6e, 0xa0, 0x1c, 0xf8, 0xed, 0x04, 0x2a, 0xc3, 0xb1, 0x7f, + 0xad, 0x00, 0x4f, 0x2c, 0x93, 0xf6, 0xce, 0x6a, 0x2d, 0xe7, 0xfc, 0xbe, 0x0c, 0x23, 0x2d, 0xdf, + 0x73, 0x23, 0x3f, 0x08, 0x45, 0xd3, 0x6c, 0x45, 0xac, 0x89, 0x32, 0xac, 0xa0, 0xe8, 0x02, 0x0c, + 0xb4, 0x63, 0xa6, 0x72, 0x4c, 0x32, 0xa4, 0x8c, 0x9d, 0x64, 0x10, 0x8a, 0xd1, 0x09, 0x49, 0x20, + 0x56, 0x8c, 0xc2, 0xb8, 0x1d, 0x92, 0x00, 0x33, 0x48, 0x7c, 0x33, 0xd3, 0x3b, 0x5b, 0x9c, 0xd0, + 0x89, 0x9b, 0x99, 0x42, 0xb0, 0x86, 0x85, 0xaa, 0x50, 0x0a, 0x13, 0x33, 0xdb, 0xd7, 0x36, 0x1d, + 0x67, 0x57, 0xb7, 0x9a, 0xc9, 0x98, 0x88, 0x71, 0xa3, 0x0c, 0xf5, 0xbc, 0xba, 0xbf, 0x52, 0x00, + 0xc4, 0x87, 0xf0, 0x1b, 0x6c, 0xe0, 0x6e, 0xa7, 0x07, 0xae, 0xff, 0x2d, 0x71, 0x5c, 0xa3, 0xf7, + 0x3f, 0x2c, 0x78, 0x62, 0xd9, 0xf5, 0x1a, 0x24, 0xc8, 0x59, 0x80, 0x8f, 0xe6, 0x2d, 0x7b, 0x34, + 0xa6, 0xc1, 0x58, 0x62, 0x03, 0xc7, 0xb0, 0xc4, 0xec, 0x3f, 0xb1, 0x00, 0xf1, 0xcf, 0x7e, 0xd7, + 0x7d, 0xec, 0xed, 0xf4, 0xc7, 0x1e, 0xc3, 0xb2, 0xb0, 0x6f, 0xc2, 0xc4, 0x72, 0xd3, 0x25, 0x5e, + 0x54, 0xa9, 0x2e, 0xfb, 0xde, 0x96, 0xbb, 0x8d, 0x5e, 0x81, 0x89, 0xc8, 0x6d, 0x11, 0xbf, 0x13, + 0xd5, 0x48, 0xdd, 0xf7, 0xd8, 0x4b, 0xd2, 0xba, 0x3c, 0xb8, 0x84, 0x1e, 0x1c, 0xcc, 0x4f, 0x6c, + 0x18, 0x10, 0x9c, 0xc0, 0xb4, 0x7f, 0x8f, 0x8e, 0x9f, 0xdf, 0x6a, 0xfb, 0x1e, 0xf1, 0xa2, 0x65, + 0xdf, 0x6b, 0x70, 0x89, 0xc3, 0x2b, 0x30, 0x10, 0xd1, 0xf1, 0xe0, 0x63, 0x77, 0x49, 0x6e, 0x14, + 0x3a, 0x0a, 0x87, 0x07, 0xf3, 0x67, 0xd2, 0x35, 0xd8, 0x38, 0xb1, 0x3a, 0xe8, 0x5b, 0x60, 0x28, + 0x8c, 0x9c, 0xa8, 0x13, 0x8a, 0xd1, 0x7c, 0x52, 0x8e, 0x66, 0x8d, 0x95, 0x1e, 0x1e, 0xcc, 0x4f, + 0xaa, 0x6a, 0xbc, 0x08, 0x8b, 0x0a, 0xe8, 0x69, 0x18, 0x6e, 0x91, 0x30, 0x74, 0xb6, 0xe5, 0x6d, + 0x38, 0x29, 0xea, 0x0e, 0xaf, 0xf1, 0x62, 0x2c, 0xe1, 0xe8, 0x22, 0x0c, 0x92, 0x20, 0xf0, 0x03, + 0xb1, 0x47, 0xc7, 0x05, 0xe2, 0xe0, 0x0a, 0x2d, 0xc4, 0x1c, 0x66, 0xff, 0x3b, 0x0b, 0x26, 0x55, + 0x5f, 0x79, 0x5b, 0x27, 0xf0, 0x2a, 0xf8, 0x14, 0x40, 0x5d, 0x7e, 0x60, 0xc8, 0x6e, 0x8f, 0xd1, + 0xe7, 0x2f, 0x65, 0x5e, 0xd4, 0xa9, 0x61, 0x8c, 0x29, 0xab, 0xa2, 0x10, 0x6b, 0xd4, 0xec, 0x7f, + 0x62, 0xc1, 0x4c, 0xe2, 0x8b, 0x6e, 0xba, 0x61, 0x84, 0xde, 0x4c, 0x7d, 0xd5, 0x42, 0x7f, 0x5f, + 0x45, 0x6b, 0xb3, 0x6f, 0x52, 0x4b, 0x59, 0x96, 0x68, 0x5f, 0x74, 0x1d, 0x06, 0xdd, 0x88, 0xb4, + 0xe4, 0xc7, 0x5c, 0xec, 0xfa, 0x31, 0xbc, 0x57, 0xf1, 0x8c, 0x54, 0x68, 0x4d, 0xcc, 0x09, 0xd8, + 0xbf, 0x56, 0x84, 0x12, 0x5f, 0xb6, 0x6b, 0x4e, 0xfb, 0x04, 0xe6, 0xe2, 0x19, 0x28, 0xb9, 0xad, + 0x56, 0x27, 0x72, 0x36, 0xc5, 0x71, 0x3e, 0xc2, 0xb7, 0x56, 0x45, 0x16, 0xe2, 0x18, 0x8e, 0x2a, + 0x30, 0xc0, 0xba, 0xc2, 0xbf, 0xf2, 0xa9, 0xec, 0xaf, 0x14, 0x7d, 0x5f, 0x28, 0x3b, 0x91, 0xc3, + 0x39, 0x29, 0x75, 0x8f, 0xd0, 0x22, 0xcc, 0x48, 0x20, 0x07, 0x60, 0xd3, 0xf5, 0x9c, 0x60, 0x9f, + 0x96, 0xcd, 0x16, 0x19, 0xc1, 0xe7, 0xba, 0x13, 0x5c, 0x52, 0xf8, 0x9c, 0xac, 0xfa, 0xb0, 0x18, + 0x80, 0x35, 0xa2, 0x73, 0x1f, 0x81, 0x92, 0x42, 0x3e, 0x0a, 0x43, 0x34, 0xf7, 0x31, 0x98, 0x4c, + 0xb4, 0xd5, 0xab, 0xfa, 0x98, 0xce, 0x4f, 0xfd, 0x32, 0x3b, 0x32, 0x44, 0xaf, 0x57, 0xbc, 0x3d, + 0x71, 0xe4, 0xbe, 0x0d, 0xa7, 0x9a, 0x19, 0x27, 0x99, 0x98, 0xd7, 0xfe, 0x4f, 0xbe, 0x27, 0xc4, + 0x67, 0x9f, 0xca, 0x82, 0xe2, 0xcc, 0x36, 0x28, 0x8f, 0xe0, 0xb7, 0xe9, 0x06, 0x71, 0x9a, 0x3a, + 0xbb, 0x7d, 0x4b, 0x94, 0x61, 0x05, 0xa5, 0xe7, 0xdd, 0x29, 0xd5, 0xf9, 0x1b, 0x64, 0xbf, 0x46, + 0x9a, 0xa4, 0x1e, 0xf9, 0xc1, 0xd7, 0xb5, 0xfb, 0xe7, 0xf8, 0xe8, 0xf3, 0xe3, 0x72, 0x54, 0x10, + 0x28, 0xde, 0x20, 0xfb, 0x7c, 0x2a, 0xf4, 0xaf, 0x2b, 0x76, 0xfd, 0xba, 0x9f, 0xb5, 0x60, 0x5c, + 0x7d, 0xdd, 0x09, 0x9c, 0x0b, 0x4b, 0xe6, 0xb9, 0x70, 0xae, 0xeb, 0x02, 0xcf, 0x39, 0x11, 0xbe, + 0x52, 0x80, 0xb3, 0x0a, 0x87, 0xbe, 0x0d, 0xf8, 0x1f, 0xb1, 0xaa, 0xae, 0x40, 0xc9, 0x53, 0x52, + 0x2b, 0xcb, 0x14, 0x17, 0xc5, 0x32, 0xab, 0x18, 0x87, 0xb2, 0x78, 0x5e, 0x2c, 0x5a, 0x1a, 0xd3, + 0xc5, 0xb9, 0x42, 0x74, 0xbb, 0x04, 0xc5, 0x8e, 0xdb, 0x10, 0x17, 0xcc, 0x87, 0xe4, 0x68, 0xdf, + 0xae, 0x94, 0x0f, 0x0f, 0xe6, 0x9f, 0xcc, 0x53, 0x25, 0xd0, 0x9b, 0x2d, 0x5c, 0xb8, 0x5d, 0x29, + 0x63, 0x5a, 0x19, 0x2d, 0xc2, 0xa4, 0xd4, 0x96, 0xdc, 0xa1, 0xec, 0x96, 0xef, 0x89, 0x7b, 0x48, + 0xc9, 0x64, 0xb1, 0x09, 0xc6, 0x49, 0x7c, 0x54, 0x86, 0xa9, 0xdd, 0xce, 0x26, 0x69, 0x92, 0x88, + 0x7f, 0xf0, 0x0d, 0xc2, 0x25, 0x96, 0xa5, 0xf8, 0x65, 0x76, 0x23, 0x01, 0xc7, 0xa9, 0x1a, 0xf6, + 0x5f, 0xb0, 0xfb, 0x40, 0x8c, 0x5e, 0x35, 0xf0, 0xe9, 0xc2, 0xa2, 0xd4, 0xbf, 0x9e, 0xcb, 0xb9, + 0x9f, 0x55, 0x71, 0x83, 0xec, 0x6f, 0xf8, 0x94, 0x33, 0xcf, 0x5e, 0x15, 0xc6, 0x9a, 0x1f, 0xe8, + 0xba, 0xe6, 0x7f, 0xbe, 0x00, 0xa7, 0xd5, 0x08, 0x18, 0x4c, 0xe0, 0x37, 0xfa, 0x18, 0x5c, 0x85, + 0xd1, 0x06, 0xd9, 0x72, 0x3a, 0xcd, 0x48, 0x89, 0xcf, 0x07, 0xb9, 0x0a, 0xa5, 0x1c, 0x17, 0x63, + 0x1d, 0xe7, 0x08, 0xc3, 0xf6, 0x3f, 0x47, 0xd9, 0x45, 0x1c, 0x39, 0x74, 0x8d, 0xab, 0x5d, 0x63, + 0xe5, 0xee, 0x9a, 0x8b, 0x30, 0xe8, 0xb6, 0x28, 0x63, 0x56, 0x30, 0xf9, 0xad, 0x0a, 0x2d, 0xc4, + 0x1c, 0x86, 0x3e, 0x00, 0xc3, 0x75, 0xbf, 0xd5, 0x72, 0xbc, 0x06, 0xbb, 0xf2, 0x4a, 0x4b, 0xa3, + 0x94, 0x77, 0x5b, 0xe6, 0x45, 0x58, 0xc2, 0xd0, 0x13, 0x30, 0xe0, 0x04, 0xdb, 0x5c, 0x86, 0x51, + 0x5a, 0x1a, 0xa1, 0x2d, 0x2d, 0x06, 0xdb, 0x21, 0x66, 0xa5, 0xf4, 0x09, 0x76, 0xcf, 0x0f, 0x76, + 0x5d, 0x6f, 0xbb, 0xec, 0x06, 0x62, 0x4b, 0xa8, 0xbb, 0xf0, 0xae, 0x82, 0x60, 0x0d, 0x0b, 0xad, + 0xc2, 0x60, 0xdb, 0x0f, 0xa2, 0x70, 0x76, 0x88, 0x0d, 0xf7, 0x93, 0x39, 0x07, 0x11, 0xff, 0xda, + 0xaa, 0x1f, 0x44, 0xf1, 0x07, 0xd0, 0x7f, 0x21, 0xe6, 0xd5, 0xd1, 0x4d, 0x18, 0x26, 0xde, 0xde, + 0x6a, 0xe0, 0xb7, 0x66, 0x67, 0xf2, 0x29, 0xad, 0x70, 0x14, 0xbe, 0xcc, 0x62, 0x1e, 0x55, 0x14, + 0x63, 0x49, 0x02, 0x7d, 0x0b, 0x14, 0x89, 0xb7, 0x37, 0x3b, 0xcc, 0x28, 0xcd, 0xe5, 0x50, 0xba, + 0xe3, 0x04, 0xf1, 0x99, 0xbf, 0xe2, 0xed, 0x61, 0x5a, 0x07, 0x7d, 0x12, 0x4a, 0xf2, 0xc0, 0x08, + 0x85, 0xb0, 0x2e, 0x73, 0xc1, 0xca, 0x63, 0x06, 0x93, 0xb7, 0x3a, 0x6e, 0x40, 0x5a, 0xc4, 0x8b, + 0xc2, 0xf8, 0x84, 0x94, 0xd0, 0x10, 0xc7, 0xd4, 0xd0, 0x27, 0xa5, 0x84, 0x78, 0xcd, 0xef, 0x78, + 0x51, 0x38, 0x5b, 0x62, 0xdd, 0xcb, 0xd4, 0xdd, 0xdd, 0x89, 0xf1, 0x92, 0x22, 0x64, 0x5e, 0x19, + 0x1b, 0xa4, 0xd0, 0xa7, 0x61, 0x9c, 0xff, 0xe7, 0x1a, 0xb0, 0x70, 0xf6, 0x34, 0xa3, 0x7d, 0x21, + 0x9f, 0x36, 0x47, 0x5c, 0x3a, 0x2d, 0x88, 0x8f, 0xeb, 0xa5, 0x21, 0x36, 0xa9, 0x21, 0x0c, 0xe3, + 0x4d, 0x77, 0x8f, 0x78, 0x24, 0x0c, 0xab, 0x81, 0xbf, 0x49, 0x66, 0x81, 0x0d, 0xcc, 0xd9, 0x6c, + 0x8d, 0x99, 0xbf, 0x49, 0x96, 0xa6, 0x29, 0xcd, 0x9b, 0x7a, 0x1d, 0x6c, 0x92, 0x40, 0xb7, 0x61, + 0x82, 0xbe, 0xd8, 0xdc, 0x98, 0xe8, 0x68, 0x2f, 0xa2, 0xec, 0x5d, 0x85, 0x8d, 0x4a, 0x38, 0x41, + 0x04, 0xdd, 0x82, 0xb1, 0x30, 0x72, 0x82, 0xa8, 0xd3, 0xe6, 0x44, 0xcf, 0xf4, 0x22, 0xca, 0x14, + 0xae, 0x35, 0xad, 0x0a, 0x36, 0x08, 0xa0, 0xd7, 0xa1, 0xd4, 0x74, 0xb7, 0x48, 0x7d, 0xbf, 0xde, + 0x24, 0xb3, 0x63, 0x8c, 0x5a, 0xe6, 0xa1, 0x72, 0x53, 0x22, 0x71, 0x3e, 0x57, 0xfd, 0xc5, 0x71, + 0x75, 0x74, 0x07, 0xce, 0x44, 0x24, 0x68, 0xb9, 0x9e, 0x43, 0x0f, 0x03, 0xf1, 0xb4, 0x62, 0x8a, + 0xcc, 0x71, 0xb6, 0xdb, 0xce, 0x8b, 0xd9, 0x38, 0xb3, 0x91, 0x89, 0x85, 0x73, 0x6a, 0xa3, 0xfb, + 0x30, 0x9b, 0x01, 0xf1, 0x9b, 0x6e, 0x7d, 0x7f, 0xf6, 0x14, 0xa3, 0xfc, 0x51, 0x41, 0x79, 0x76, + 0x23, 0x07, 0xef, 0xb0, 0x0b, 0x0c, 0xe7, 0x52, 0x47, 0xb7, 0x60, 0x92, 0x9d, 0x40, 0xd5, 0x4e, + 0xb3, 0x29, 0x1a, 0x9c, 0x60, 0x0d, 0x7e, 0x40, 0xde, 0xc7, 0x15, 0x13, 0x7c, 0x78, 0x30, 0x0f, + 0xf1, 0x3f, 0x9c, 0xac, 0x8d, 0x36, 0x99, 0xce, 0xac, 0x13, 0xb8, 0xd1, 0x3e, 0x3d, 0x37, 0xc8, + 0xfd, 0x68, 0x76, 0xb2, 0xab, 0xbc, 0x42, 0x47, 0x55, 0x8a, 0x35, 0xbd, 0x10, 0x27, 0x09, 0xd2, + 0x23, 0x35, 0x8c, 0x1a, 0xae, 0x37, 0x3b, 0xc5, 0xdf, 0x25, 0xf2, 0x44, 0xaa, 0xd1, 0x42, 0xcc, + 0x61, 0x4c, 0x5f, 0x46, 0x7f, 0xdc, 0xa2, 0x37, 0xd7, 0x34, 0x43, 0x8c, 0xf5, 0x65, 0x12, 0x80, + 0x63, 0x1c, 0xca, 0x4c, 0x46, 0xd1, 0xfe, 0x2c, 0x62, 0xa8, 0xea, 0x60, 0xd9, 0xd8, 0xf8, 0x24, + 0xa6, 0xe5, 0xf6, 0x26, 0x4c, 0xa8, 0x83, 0x90, 0x8d, 0x09, 0x9a, 0x87, 0x41, 0xc6, 0x3e, 0x09, + 0xe9, 0x5a, 0x89, 0x76, 0x81, 0xb1, 0x56, 0x98, 0x97, 0xb3, 0x2e, 0xb8, 0x6f, 0x93, 0xa5, 0xfd, + 0x88, 0xf0, 0x37, 0x7d, 0x51, 0xeb, 0x82, 0x04, 0xe0, 0x18, 0xc7, 0xfe, 0x3f, 0x9c, 0x0d, 0x8d, + 0x4f, 0xdb, 0x3e, 0xee, 0x97, 0x67, 0x61, 0x64, 0xc7, 0x0f, 0x23, 0x8a, 0xcd, 0xda, 0x18, 0x8c, + 0x19, 0xcf, 0xeb, 0xa2, 0x1c, 0x2b, 0x0c, 0xf4, 0x2a, 0x8c, 0xd7, 0xf5, 0x06, 0xc4, 0xe5, 0xa8, + 0x8e, 0x11, 0xa3, 0x75, 0x6c, 0xe2, 0xa2, 0x97, 0x61, 0x84, 0xd9, 0x80, 0xd4, 0xfd, 0xa6, 0xe0, + 0xda, 0xe4, 0x0d, 0x3f, 0x52, 0x15, 0xe5, 0x87, 0xda, 0x6f, 0xac, 0xb0, 0xd1, 0x25, 0x18, 0xa2, + 0x5d, 0xa8, 0x54, 0xc5, 0xb5, 0xa4, 0x04, 0x45, 0xd7, 0x59, 0x29, 0x16, 0x50, 0xfb, 0x2f, 0x15, + 0xb4, 0x51, 0xa6, 0xef, 0x61, 0x82, 0xaa, 0x30, 0x7c, 0xcf, 0x71, 0x23, 0xd7, 0xdb, 0x16, 0xfc, + 0xc7, 0xd3, 0x5d, 0xef, 0x28, 0x56, 0xe9, 0x2e, 0xaf, 0xc0, 0x6f, 0x51, 0xf1, 0x07, 0x4b, 0x32, + 0x94, 0x62, 0xd0, 0xf1, 0x3c, 0x4a, 0xb1, 0xd0, 0x2f, 0x45, 0xcc, 0x2b, 0x70, 0x8a, 0xe2, 0x0f, + 0x96, 0x64, 0xd0, 0x9b, 0x00, 0x72, 0x87, 0x91, 0x86, 0xb0, 0xbd, 0x78, 0xb6, 0x37, 0xd1, 0x0d, + 0x55, 0x67, 0x69, 0x82, 0xde, 0xd1, 0xf1, 0x7f, 0xac, 0xd1, 0xb3, 0x23, 0xc6, 0xa7, 0xa5, 0x3b, + 0x83, 0xbe, 0x8d, 0x2e, 0x71, 0x27, 0x88, 0x48, 0x63, 0x31, 0x12, 0x83, 0xf3, 0xc1, 0xfe, 0x1e, + 0x29, 0x1b, 0x6e, 0x8b, 0xe8, 0xdb, 0x41, 0x10, 0xc1, 0x31, 0x3d, 0xfb, 0x17, 0x8b, 0x30, 0x9b, + 0xd7, 0x5d, 0xba, 0xe8, 0xc8, 0x7d, 0x37, 0x5a, 0xa6, 0xec, 0x95, 0x65, 0x2e, 0xba, 0x15, 0x51, + 0x8e, 0x15, 0x06, 0x9d, 0xfd, 0xd0, 0xdd, 0x96, 0x6f, 0xcc, 0xc1, 0x78, 0xf6, 0x6b, 0xac, 0x14, + 0x0b, 0x28, 0xc5, 0x0b, 0x88, 0x13, 0x0a, 0xe3, 0x1e, 0x6d, 0x95, 0x60, 0x56, 0x8a, 0x05, 0x54, + 0x97, 0x76, 0x0d, 0xf4, 0x90, 0x76, 0x19, 0x43, 0x34, 0x78, 0xbc, 0x43, 0x84, 0x3e, 0x03, 0xb0, + 0xe5, 0x7a, 0x6e, 0xb8, 0xc3, 0xa8, 0x0f, 0x1d, 0x99, 0xba, 0x62, 0xce, 0x56, 0x15, 0x15, 0xac, + 0x51, 0x44, 0x2f, 0xc1, 0xa8, 0xda, 0x80, 0x95, 0x32, 0xd3, 0x74, 0x6a, 0x96, 0x23, 0xf1, 0x69, + 0x54, 0xc6, 0x3a, 0x9e, 0xfd, 0xb9, 0xe4, 0x7a, 0x11, 0x3b, 0x40, 0x1b, 0x5f, 0xab, 0xdf, 0xf1, + 0x2d, 0x74, 0x1f, 0x5f, 0xfb, 0x6b, 0x45, 0x98, 0x34, 0x1a, 0xeb, 0x84, 0x7d, 0x9c, 0x59, 0xd7, + 0xe8, 0x01, 0xee, 0x44, 0x44, 0xec, 0x3f, 0xbb, 0xf7, 0x56, 0xd1, 0x0f, 0x79, 0xba, 0x03, 0x78, + 0x7d, 0xf4, 0x19, 0x28, 0x35, 0x9d, 0x90, 0x49, 0xce, 0x88, 0xd8, 0x77, 0xfd, 0x10, 0x8b, 0x1f, + 0x26, 0x4e, 0x18, 0x69, 0xb7, 0x26, 0xa7, 0x1d, 0x93, 0xa4, 0x37, 0x0d, 0xe5, 0x4f, 0xa4, 0xf5, + 0x98, 0xea, 0x04, 0x65, 0x62, 0xf6, 0x31, 0x87, 0xa1, 0x97, 0x61, 0x2c, 0x20, 0x6c, 0x55, 0x2c, + 0x53, 0x6e, 0x8e, 0x2d, 0xb3, 0xc1, 0x98, 0xed, 0xc3, 0x1a, 0x0c, 0x1b, 0x98, 0xf1, 0xdb, 0x60, + 0xa8, 0xcb, 0xdb, 0xe0, 0x69, 0x18, 0x66, 0x3f, 0xd4, 0x0a, 0x50, 0xb3, 0x51, 0xe1, 0xc5, 0x58, + 0xc2, 0x93, 0x0b, 0x66, 0xa4, 0xbf, 0x05, 0x43, 0x5f, 0x1f, 0x62, 0x51, 0x33, 0x2d, 0xf3, 0x08, + 0x3f, 0xe5, 0xc4, 0x92, 0xc7, 0x12, 0x66, 0x7f, 0x10, 0x26, 0xca, 0x0e, 0x69, 0xf9, 0xde, 0x8a, + 0xd7, 0x68, 0xfb, 0xae, 0x17, 0xa1, 0x59, 0x18, 0x60, 0x97, 0x08, 0x3f, 0x02, 0x06, 0x68, 0x43, + 0x98, 0x95, 0xd8, 0xdb, 0x70, 0xba, 0xec, 0xdf, 0xf3, 0xee, 0x39, 0x41, 0x63, 0xb1, 0x5a, 0xd1, + 0xde, 0xd7, 0xeb, 0xf2, 0x7d, 0xc7, 0x8d, 0xb6, 0x32, 0x8f, 0x5e, 0xad, 0x26, 0x67, 0x6b, 0x57, + 0xdd, 0x26, 0xc9, 0x91, 0x82, 0xfc, 0xd5, 0x82, 0xd1, 0x52, 0x8c, 0xaf, 0xb4, 0x5a, 0x56, 0xae, + 0x56, 0xeb, 0x0d, 0x18, 0xd9, 0x72, 0x49, 0xb3, 0x81, 0xc9, 0x96, 0x58, 0x89, 0x4f, 0xe5, 0xdb, + 0xa1, 0xac, 0x52, 0x4c, 0x29, 0xf5, 0xe2, 0xaf, 0xc3, 0x55, 0x51, 0x19, 0x2b, 0x32, 0x68, 0x17, + 0xa6, 0xe4, 0x83, 0x41, 0x42, 0xc5, 0xba, 0x7c, 0xba, 0xdb, 0x2b, 0xc4, 0x24, 0x7e, 0xea, 0xc1, + 0xc1, 0xfc, 0x14, 0x4e, 0x90, 0xc1, 0x29, 0xc2, 0xf4, 0x39, 0xd8, 0xa2, 0x27, 0xf0, 0x00, 0x1b, + 0x7e, 0xf6, 0x1c, 0x64, 0x2f, 0x5b, 0x56, 0x6a, 0xff, 0x98, 0x05, 0x8f, 0xa5, 0x46, 0x46, 0xbc, + 0xf0, 0x8f, 0x79, 0x16, 0x92, 0x2f, 0xee, 0x42, 0xef, 0x17, 0xb7, 0xfd, 0x77, 0x2c, 0x38, 0xb5, + 0xd2, 0x6a, 0x47, 0xfb, 0x65, 0xd7, 0x54, 0x41, 0x7d, 0x04, 0x86, 0x5a, 0xa4, 0xe1, 0x76, 0x5a, + 0x62, 0xe6, 0xe6, 0xe5, 0x29, 0xb5, 0xc6, 0x4a, 0x0f, 0x0f, 0xe6, 0xc7, 0x6b, 0x91, 0x1f, 0x38, + 0xdb, 0x84, 0x17, 0x60, 0x81, 0xce, 0xce, 0x7a, 0xf7, 0x6d, 0x72, 0xd3, 0x6d, 0xb9, 0xd2, 0xae, + 0xa8, 0xab, 0xcc, 0x6e, 0x41, 0x0e, 0xe8, 0xc2, 0x1b, 0x1d, 0xc7, 0x8b, 0xdc, 0x68, 0x5f, 0x68, + 0x8f, 0x24, 0x11, 0x1c, 0xd3, 0xb3, 0xbf, 0x6a, 0xc1, 0xa4, 0x5c, 0xf7, 0x8b, 0x8d, 0x46, 0x40, + 0xc2, 0x10, 0xcd, 0x41, 0xc1, 0x6d, 0x8b, 0x5e, 0x82, 0xe8, 0x65, 0xa1, 0x52, 0xc5, 0x05, 0xb7, + 0x2d, 0xd9, 0x32, 0x76, 0x10, 0x16, 0x4d, 0x45, 0xda, 0x75, 0x51, 0x8e, 0x15, 0x06, 0xba, 0x0c, + 0x23, 0x9e, 0xdf, 0xe0, 0xb6, 0x5d, 0xfc, 0x4a, 0x63, 0x0b, 0x6c, 0x5d, 0x94, 0x61, 0x05, 0x45, + 0x55, 0x28, 0x71, 0xb3, 0xa7, 0x78, 0xd1, 0xf6, 0x65, 0x3c, 0xc5, 0xbe, 0x6c, 0x43, 0xd6, 0xc4, + 0x31, 0x11, 0xfb, 0x57, 0x2d, 0x18, 0x93, 0x5f, 0xd6, 0x27, 0xcf, 0x49, 0xb7, 0x56, 0xcc, 0x6f, + 0xc6, 0x5b, 0x8b, 0xf2, 0x8c, 0x0c, 0x62, 0xb0, 0x8a, 0xc5, 0x23, 0xb1, 0x8a, 0x57, 0x61, 0xd4, + 0x69, 0xb7, 0xab, 0x26, 0x9f, 0xc9, 0x96, 0xd2, 0x62, 0x5c, 0x8c, 0x75, 0x1c, 0xfb, 0x47, 0x0b, + 0x30, 0x21, 0xbf, 0xa0, 0xd6, 0xd9, 0x0c, 0x49, 0x84, 0x36, 0xa0, 0xe4, 0xf0, 0x59, 0x22, 0x72, + 0x91, 0x5f, 0xcc, 0x96, 0x23, 0x18, 0x53, 0x1a, 0x5f, 0xf8, 0x8b, 0xb2, 0x36, 0x8e, 0x09, 0xa1, + 0x26, 0x4c, 0x7b, 0x7e, 0xc4, 0x0e, 0x7f, 0x05, 0xef, 0xa6, 0xda, 0x49, 0x52, 0x3f, 0x2b, 0xa8, + 0x4f, 0xaf, 0x27, 0xa9, 0xe0, 0x34, 0x61, 0xb4, 0x22, 0x65, 0x33, 0xc5, 0x7c, 0x61, 0x80, 0x3e, + 0x71, 0xd9, 0xa2, 0x19, 0xfb, 0x57, 0x2c, 0x28, 0x49, 0xb4, 0x93, 0xd0, 0xe2, 0xad, 0xc1, 0x70, + 0xc8, 0x26, 0x41, 0x0e, 0x8d, 0xdd, 0xad, 0xe3, 0x7c, 0xbe, 0xe2, 0x3b, 0x8d, 0xff, 0x0f, 0xb1, + 0xa4, 0xc1, 0x44, 0xf3, 0xaa, 0xfb, 0xef, 0x12, 0xd1, 0xbc, 0xea, 0x4f, 0xce, 0xa5, 0xf4, 0x47, + 0xac, 0xcf, 0x9a, 0xac, 0x8b, 0xb2, 0x5e, 0xed, 0x80, 0x6c, 0xb9, 0xf7, 0x93, 0xac, 0x57, 0x95, + 0x95, 0x62, 0x01, 0x45, 0x6f, 0xc2, 0x58, 0x5d, 0xca, 0x64, 0xe3, 0x1d, 0x7e, 0xa9, 0xab, 0x7e, + 0x40, 0xa9, 0x92, 0xb8, 0x2c, 0x64, 0x59, 0xab, 0x8f, 0x0d, 0x6a, 0xa6, 0x19, 0x41, 0xb1, 0x97, + 0x19, 0x41, 0x4c, 0x37, 0x5f, 0xa9, 0xfe, 0xe3, 0x16, 0x0c, 0x71, 0x59, 0x5c, 0x7f, 0xa2, 0x50, + 0x4d, 0xb3, 0x16, 0x8f, 0xdd, 0x1d, 0x5a, 0x28, 0x34, 0x65, 0x68, 0x0d, 0x4a, 0xec, 0x07, 0x93, + 0x25, 0x16, 0xf3, 0xad, 0xee, 0x79, 0xab, 0x7a, 0x07, 0xef, 0xc8, 0x6a, 0x38, 0xa6, 0x60, 0xff, + 0x70, 0x91, 0x9e, 0x6e, 0x31, 0xaa, 0x71, 0xe9, 0x5b, 0x8f, 0xee, 0xd2, 0x2f, 0x3c, 0xaa, 0x4b, + 0x7f, 0x1b, 0x26, 0xeb, 0x9a, 0x1e, 0x2e, 0x9e, 0xc9, 0xcb, 0x5d, 0x17, 0x89, 0xa6, 0xb2, 0xe3, + 0x52, 0x96, 0x65, 0x93, 0x08, 0x4e, 0x52, 0x45, 0xdf, 0x06, 0x63, 0x7c, 0x9e, 0x45, 0x2b, 0xdc, + 0x12, 0xe3, 0x03, 0xf9, 0xeb, 0x45, 0x6f, 0x82, 0x4b, 0xe5, 0xb4, 0xea, 0xd8, 0x20, 0x66, 0xff, + 0xa9, 0x05, 0x68, 0xa5, 0xbd, 0x43, 0x5a, 0x24, 0x70, 0x9a, 0xb1, 0x38, 0xfd, 0xfb, 0x2d, 0x98, + 0x25, 0xa9, 0xe2, 0x65, 0xbf, 0xd5, 0x12, 0x8f, 0x96, 0x9c, 0x77, 0xf5, 0x4a, 0x4e, 0x1d, 0xe5, + 0x96, 0x30, 0x9b, 0x87, 0x81, 0x73, 0xdb, 0x43, 0x6b, 0x30, 0xc3, 0x6f, 0x49, 0x05, 0xd0, 0x6c, + 0xaf, 0x1f, 0x17, 0x84, 0x67, 0x36, 0xd2, 0x28, 0x38, 0xab, 0x9e, 0xfd, 0x5d, 0x63, 0x90, 0xdb, + 0x8b, 0xf7, 0xf4, 0x08, 0xef, 0xe9, 0x11, 0xde, 0xd3, 0x23, 0xbc, 0xa7, 0x47, 0x78, 0x4f, 0x8f, + 0xf0, 0x4d, 0xaf, 0x47, 0xf8, 0xcb, 0x16, 0x9c, 0x56, 0xd7, 0x80, 0xf1, 0xf0, 0xfd, 0x3c, 0xcc, + 0xf0, 0xed, 0xb6, 0xdc, 0x74, 0xdc, 0xd6, 0x06, 0x69, 0xb5, 0x9b, 0x4e, 0x24, 0xb5, 0xee, 0x57, + 0x33, 0x57, 0x6e, 0xc2, 0x62, 0xd5, 0xa8, 0xb8, 0xf4, 0x18, 0xbd, 0x9e, 0x32, 0x00, 0x38, 0xab, + 0x19, 0xfb, 0x17, 0x47, 0x60, 0x70, 0x65, 0x8f, 0x78, 0xd1, 0x09, 0x3c, 0x11, 0xea, 0x30, 0xe1, + 0x7a, 0x7b, 0x7e, 0x73, 0x8f, 0x34, 0x38, 0xfc, 0x28, 0x2f, 0xd9, 0x33, 0x82, 0xf4, 0x44, 0xc5, + 0x20, 0x81, 0x13, 0x24, 0x1f, 0x85, 0x34, 0xf9, 0x1a, 0x0c, 0xf1, 0x43, 0x5c, 0x88, 0x92, 0x33, + 0xcf, 0x6c, 0x36, 0x88, 0xe2, 0x6a, 0x8a, 0x25, 0xdd, 0xfc, 0x92, 0x10, 0xd5, 0xd1, 0xe7, 0x60, + 0x62, 0xcb, 0x0d, 0xc2, 0x68, 0xc3, 0x6d, 0x91, 0x30, 0x72, 0x5a, 0xed, 0x87, 0x90, 0x1e, 0xab, + 0x71, 0x58, 0x35, 0x28, 0xe1, 0x04, 0x65, 0xb4, 0x0d, 0xe3, 0x4d, 0x47, 0x6f, 0x6a, 0xf8, 0xc8, + 0x4d, 0xa9, 0xdb, 0xe1, 0xa6, 0x4e, 0x08, 0x9b, 0x74, 0xe9, 0x76, 0xaa, 0x33, 0x01, 0xe8, 0x08, + 0x13, 0x0b, 0xa8, 0xed, 0xc4, 0x25, 0x9f, 0x1c, 0x46, 0x19, 0x1d, 0x66, 0x20, 0x5b, 0x32, 0x19, + 0x1d, 0xcd, 0x0c, 0xf6, 0xb3, 0x50, 0x22, 0x74, 0x08, 0x29, 0x61, 0x71, 0xc1, 0x5c, 0xe9, 0xaf, + 0xaf, 0x6b, 0x6e, 0x3d, 0xf0, 0x4d, 0xb9, 0xfd, 0x8a, 0xa4, 0x84, 0x63, 0xa2, 0x68, 0x19, 0x86, + 0x42, 0x12, 0xb8, 0x24, 0x14, 0x57, 0x4d, 0x97, 0x69, 0x64, 0x68, 0xdc, 0xb7, 0x84, 0xff, 0xc6, + 0xa2, 0x2a, 0x5d, 0x5e, 0x0e, 0x13, 0x69, 0xb2, 0xcb, 0x40, 0x5b, 0x5e, 0x8b, 0xac, 0x14, 0x0b, + 0x28, 0x7a, 0x1d, 0x86, 0x03, 0xd2, 0x64, 0x8a, 0xa1, 0xf1, 0xfe, 0x17, 0x39, 0xd7, 0x33, 0xf1, + 0x7a, 0x58, 0x12, 0x40, 0x37, 0x00, 0x05, 0x84, 0x32, 0x4a, 0xae, 0xb7, 0xad, 0xcc, 0x46, 0xc5, + 0x41, 0xab, 0x18, 0x52, 0x1c, 0x63, 0x48, 0x37, 0x1f, 0x9c, 0x51, 0x0d, 0x5d, 0x83, 0x69, 0x55, + 0x5a, 0xf1, 0xc2, 0xc8, 0xa1, 0x07, 0xdc, 0x24, 0xa3, 0xa5, 0xe4, 0x14, 0x38, 0x89, 0x80, 0xd3, + 0x75, 0xec, 0x2f, 0x5b, 0xc0, 0xc7, 0xf9, 0x04, 0x5e, 0xe7, 0xaf, 0x99, 0xaf, 0xf3, 0xb3, 0xb9, + 0x33, 0x97, 0xf3, 0x32, 0xff, 0xb2, 0x05, 0xa3, 0xda, 0xcc, 0xc6, 0x6b, 0xd6, 0xea, 0xb2, 0x66, + 0x3b, 0x30, 0x45, 0x57, 0xfa, 0xad, 0xcd, 0x90, 0x04, 0x7b, 0xa4, 0xc1, 0x16, 0x66, 0xe1, 0xe1, + 0x16, 0xa6, 0x32, 0x51, 0xbb, 0x99, 0x20, 0x88, 0x53, 0x4d, 0xd8, 0x9f, 0x95, 0x5d, 0x55, 0x16, + 0x7d, 0x75, 0x35, 0xe7, 0x09, 0x8b, 0x3e, 0x35, 0xab, 0x38, 0xc6, 0xa1, 0x5b, 0x6d, 0xc7, 0x0f, + 0xa3, 0xa4, 0x45, 0xdf, 0x75, 0x3f, 0x8c, 0x30, 0x83, 0xd8, 0x2f, 0x00, 0xac, 0xdc, 0x27, 0x75, + 0xbe, 0x62, 0xf5, 0xc7, 0x83, 0x95, 0xff, 0x78, 0xb0, 0x7f, 0xdb, 0x82, 0x89, 0xd5, 0x65, 0xe3, + 0xe6, 0x5a, 0x00, 0xe0, 0x2f, 0x9e, 0xbb, 0x77, 0xd7, 0xa5, 0x3a, 0x9c, 0x6b, 0x34, 0x55, 0x29, + 0xd6, 0x30, 0xd0, 0x59, 0x28, 0x36, 0x3b, 0x9e, 0x10, 0x1f, 0x0e, 0xd3, 0xeb, 0xf1, 0x66, 0xc7, + 0xc3, 0xb4, 0x4c, 0x73, 0x29, 0x28, 0xf6, 0xed, 0x52, 0xd0, 0xd3, 0xb5, 0x1f, 0xcd, 0xc3, 0xe0, + 0xbd, 0x7b, 0x6e, 0x83, 0x3b, 0x50, 0x0a, 0x55, 0xfd, 0xdd, 0xbb, 0x95, 0x72, 0x88, 0x79, 0xb9, + 0xfd, 0xa5, 0x22, 0xcc, 0xad, 0x36, 0xc9, 0xfd, 0x77, 0xe8, 0x44, 0xda, 0xaf, 0x43, 0xc4, 0xd1, + 0x04, 0x31, 0x47, 0x75, 0x7a, 0xe9, 0x3d, 0x1e, 0x5b, 0x30, 0xcc, 0x0d, 0xda, 0xa4, 0x4b, 0xe9, + 0xab, 0x59, 0xad, 0xe7, 0x0f, 0xc8, 0x02, 0x37, 0x8c, 0x13, 0x1e, 0x71, 0xea, 0xc2, 0x14, 0xa5, + 0x58, 0x12, 0x9f, 0x7b, 0x05, 0xc6, 0x74, 0xcc, 0x23, 0xb9, 0x9f, 0xfd, 0x7f, 0x45, 0x98, 0xa2, + 0x3d, 0x78, 0xa4, 0x13, 0x71, 0x3b, 0x3d, 0x11, 0xc7, 0xed, 0x82, 0xd4, 0x7b, 0x36, 0xde, 0x4c, + 0xce, 0xc6, 0xd5, 0xbc, 0xd9, 0x38, 0xe9, 0x39, 0xf8, 0x4e, 0x0b, 0x66, 0x56, 0x9b, 0x7e, 0x7d, + 0x37, 0xe1, 0x26, 0xf4, 0x12, 0x8c, 0xd2, 0xe3, 0x38, 0x34, 0x3c, 0xd8, 0x8d, 0x98, 0x06, 0x02, + 0x84, 0x75, 0x3c, 0xad, 0xda, 0xed, 0xdb, 0x95, 0x72, 0x56, 0x28, 0x04, 0x01, 0xc2, 0x3a, 0x9e, + 0xfd, 0x9b, 0x16, 0x9c, 0xbb, 0xb6, 0xbc, 0x12, 0x2f, 0xc5, 0x54, 0x34, 0x86, 0x4b, 0x30, 0xd4, + 0x6e, 0x68, 0x5d, 0x89, 0xc5, 0xab, 0x65, 0xd6, 0x0b, 0x01, 0x7d, 0xb7, 0x44, 0x1a, 0xf9, 0x69, + 0x0b, 0x66, 0xae, 0xb9, 0x11, 0xbd, 0x5d, 0x93, 0x71, 0x01, 0xe8, 0xf5, 0x1a, 0xba, 0x91, 0x1f, + 0xec, 0x27, 0xe3, 0x02, 0x60, 0x05, 0xc1, 0x1a, 0x16, 0x6f, 0x79, 0xcf, 0x65, 0xa6, 0xd4, 0x05, + 0x53, 0xd1, 0x84, 0x45, 0x39, 0x56, 0x18, 0xf4, 0xc3, 0x1a, 0x6e, 0xc0, 0x64, 0x74, 0xfb, 0xe2, + 0x84, 0x55, 0x1f, 0x56, 0x96, 0x00, 0x1c, 0xe3, 0xd8, 0x7f, 0x6c, 0xc1, 0xfc, 0xb5, 0x66, 0x27, + 0x8c, 0x48, 0xb0, 0x15, 0xe6, 0x9c, 0x8e, 0x2f, 0x40, 0x89, 0x48, 0x89, 0xb8, 0xe8, 0xb5, 0xe2, + 0x18, 0x95, 0xa8, 0x9c, 0x87, 0x27, 0x50, 0x78, 0x7d, 0x38, 0x1d, 0x1e, 0xcd, 0x6b, 0x6c, 0x15, + 0x10, 0xd1, 0xdb, 0xd2, 0xe3, 0x35, 0x30, 0xc7, 0xef, 0x95, 0x14, 0x14, 0x67, 0xd4, 0xb0, 0x7f, + 0xcc, 0x82, 0xd3, 0xea, 0x83, 0xdf, 0x75, 0x9f, 0x69, 0xff, 0x5c, 0x01, 0xc6, 0xaf, 0x6f, 0x6c, + 0x54, 0xaf, 0x91, 0x48, 0x5c, 0xdb, 0xbd, 0xf5, 0xdc, 0x58, 0x53, 0xd7, 0x75, 0x7b, 0xcc, 0x75, + 0x22, 0xb7, 0xb9, 0xc0, 0xc3, 0xfe, 0x2c, 0x54, 0xbc, 0xe8, 0x56, 0x50, 0x8b, 0x02, 0xd7, 0xdb, + 0xce, 0x54, 0xf0, 0x49, 0xe6, 0xa2, 0x98, 0xc7, 0x5c, 0xa0, 0x17, 0x60, 0x88, 0xc5, 0x1d, 0x92, + 0x93, 0xf0, 0xb8, 0x7a, 0x0b, 0xb1, 0xd2, 0xc3, 0x83, 0xf9, 0xd2, 0x6d, 0x5c, 0xe1, 0x7f, 0xb0, + 0x40, 0x45, 0xb7, 0x61, 0x74, 0x27, 0x8a, 0xda, 0xd7, 0x89, 0xd3, 0x20, 0x81, 0x3c, 0x0e, 0xcf, + 0x67, 0x1d, 0x87, 0x74, 0x10, 0x38, 0x5a, 0x7c, 0x82, 0xc4, 0x65, 0x21, 0xd6, 0xe9, 0xd8, 0x35, + 0x80, 0x18, 0x76, 0x4c, 0x9a, 0x0a, 0xfb, 0x0f, 0x2d, 0x18, 0xe6, 0x21, 0x20, 0x02, 0xf4, 0x51, + 0x18, 0x20, 0xf7, 0x49, 0x5d, 0x70, 0xbc, 0x99, 0x1d, 0x8e, 0x39, 0x2d, 0x2e, 0x71, 0xa5, 0xff, + 0x31, 0xab, 0x85, 0xae, 0xc3, 0x30, 0xed, 0xed, 0x35, 0x15, 0x0f, 0xe3, 0xc9, 0xbc, 0x2f, 0x56, + 0xd3, 0xce, 0x99, 0x33, 0x51, 0x84, 0x65, 0x75, 0xa6, 0x1e, 0xae, 0xb7, 0x6b, 0xf4, 0xc4, 0x8e, + 0xba, 0x31, 0x16, 0x1b, 0xcb, 0x55, 0x8e, 0x24, 0xa8, 0x71, 0xf5, 0xb0, 0x2c, 0xc4, 0x31, 0x11, + 0x7b, 0x03, 0x4a, 0x74, 0x52, 0x17, 0x9b, 0xae, 0xd3, 0x5d, 0xe3, 0xfd, 0x0c, 0x94, 0xa4, 0x3e, + 0x3b, 0x14, 0xae, 0xdf, 0x8c, 0xaa, 0x54, 0x77, 0x87, 0x38, 0x86, 0xdb, 0x5b, 0x70, 0x8a, 0x59, + 0x27, 0x3a, 0xd1, 0x8e, 0xb1, 0xc7, 0x7a, 0x2f, 0xe6, 0x67, 0xc5, 0x03, 0x92, 0xcf, 0xcc, 0xac, + 0xe6, 0x5d, 0x39, 0x26, 0x29, 0xc6, 0x8f, 0x49, 0xfb, 0x6b, 0x03, 0xf0, 0x78, 0xa5, 0x96, 0x1f, + 0x1d, 0xe4, 0x65, 0x18, 0xe3, 0x7c, 0x29, 0x5d, 0xda, 0x4e, 0x53, 0xb4, 0xab, 0x44, 0xad, 0x1b, + 0x1a, 0x0c, 0x1b, 0x98, 0xe8, 0x1c, 0x14, 0xdd, 0xb7, 0xbc, 0xa4, 0xef, 0x51, 0xe5, 0x8d, 0x75, + 0x4c, 0xcb, 0x29, 0x98, 0xb2, 0xb8, 0xfc, 0xee, 0x50, 0x60, 0xc5, 0xe6, 0xbe, 0x06, 0x13, 0x6e, + 0x58, 0x0f, 0xdd, 0x8a, 0x47, 0xcf, 0x19, 0xed, 0xa4, 0x52, 0xc2, 0x0d, 0xda, 0x69, 0x05, 0xc5, + 0x09, 0x6c, 0xed, 0x22, 0x1b, 0xec, 0x9b, 0x4d, 0xee, 0xe9, 0x0b, 0x4d, 0x5f, 0x00, 0x6d, 0xf6, + 0x75, 0x21, 0x93, 0x99, 0x8b, 0x17, 0x00, 0xff, 0xe0, 0x10, 0x4b, 0x18, 0x7d, 0x39, 0xd6, 0x77, + 0x9c, 0xf6, 0x62, 0x27, 0xda, 0x29, 0xbb, 0x61, 0xdd, 0xdf, 0x23, 0xc1, 0x3e, 0x7b, 0xf4, 0x8f, + 0xc4, 0x2f, 0x47, 0x05, 0x58, 0xbe, 0xbe, 0x58, 0xa5, 0x98, 0x38, 0x5d, 0x07, 0x2d, 0xc2, 0xa4, + 0x2c, 0xac, 0x91, 0x90, 0x5d, 0x61, 0xa3, 0x8c, 0x8c, 0xf2, 0x06, 0x12, 0xc5, 0x8a, 0x48, 0x12, + 0xdf, 0xe4, 0xa4, 0xe1, 0x38, 0x38, 0xe9, 0x8f, 0xc0, 0xb8, 0xeb, 0xb9, 0x91, 0xeb, 0x44, 0x3e, + 0x57, 0xf8, 0xf0, 0xf7, 0x3d, 0x93, 0x64, 0x57, 0x74, 0x00, 0x36, 0xf1, 0xec, 0xff, 0x32, 0x00, + 0xd3, 0x6c, 0xda, 0xde, 0x5b, 0x61, 0xdf, 0x4c, 0x2b, 0xec, 0x76, 0x7a, 0x85, 0x1d, 0xc7, 0x13, + 0xe1, 0xa1, 0x97, 0xd9, 0xe7, 0xa0, 0xa4, 0x1c, 0xa0, 0xa4, 0x07, 0xa4, 0x95, 0xe3, 0x01, 0xd9, + 0x9b, 0xfb, 0x90, 0x36, 0x64, 0xc5, 0x4c, 0x1b, 0xb2, 0xbf, 0x6e, 0x41, 0xac, 0xc1, 0x40, 0xd7, + 0xa1, 0xd4, 0xf6, 0x99, 0x69, 0x64, 0x20, 0xed, 0x8d, 0x1f, 0xcf, 0xbc, 0xa8, 0xf8, 0xa5, 0xc8, + 0x3f, 0xbe, 0x2a, 0x6b, 0xe0, 0xb8, 0x32, 0x5a, 0x82, 0xe1, 0x76, 0x40, 0x6a, 0x11, 0x0b, 0x12, + 0xd2, 0x93, 0x0e, 0x5f, 0x23, 0x1c, 0x1f, 0xcb, 0x8a, 0xf6, 0xcf, 0x5b, 0x00, 0xdc, 0x4c, 0xcb, + 0xf1, 0xb6, 0xc9, 0x09, 0x48, 0xad, 0xcb, 0x30, 0x10, 0xb6, 0x49, 0xbd, 0x9b, 0xd1, 0x6a, 0xdc, + 0x9f, 0x5a, 0x9b, 0xd4, 0xe3, 0x01, 0xa7, 0xff, 0x30, 0xab, 0x6d, 0x7f, 0x37, 0xc0, 0x44, 0x8c, + 0x56, 0x89, 0x48, 0x0b, 0x3d, 0x67, 0x04, 0x0d, 0x38, 0x9b, 0x08, 0x1a, 0x50, 0x62, 0xd8, 0x9a, + 0x80, 0xf4, 0x73, 0x50, 0x6c, 0x39, 0xf7, 0x85, 0x04, 0xec, 0x99, 0xee, 0xdd, 0xa0, 0xf4, 0x17, + 0xd6, 0x9c, 0xfb, 0xfc, 0x91, 0xf8, 0x8c, 0x5c, 0x20, 0x6b, 0xce, 0xfd, 0x43, 0x6e, 0x9a, 0xca, + 0x0e, 0xa9, 0x9b, 0x6e, 0x18, 0x7d, 0xe1, 0x3f, 0xc7, 0xff, 0xd9, 0xb2, 0xa3, 0x8d, 0xb0, 0xb6, + 0x5c, 0x4f, 0x58, 0x20, 0xf5, 0xd5, 0x96, 0xeb, 0x25, 0xdb, 0x72, 0xbd, 0x3e, 0xda, 0x72, 0x3d, + 0xf4, 0x36, 0x0c, 0x0b, 0x03, 0x41, 0x11, 0xa4, 0xe7, 0x4a, 0x1f, 0xed, 0x09, 0xfb, 0x42, 0xde, + 0xe6, 0x15, 0xf9, 0x08, 0x16, 0xa5, 0x3d, 0xdb, 0x95, 0x0d, 0xa2, 0xbf, 0x62, 0xc1, 0x84, 0xf8, + 0x8d, 0xc9, 0x5b, 0x1d, 0x12, 0x46, 0x82, 0xf7, 0xfc, 0x70, 0xff, 0x7d, 0x10, 0x15, 0x79, 0x57, + 0x3e, 0x2c, 0x8f, 0x59, 0x13, 0xd8, 0xb3, 0x47, 0x89, 0x5e, 0xa0, 0xbf, 0x67, 0xc1, 0xa9, 0x96, + 0x73, 0x9f, 0xb7, 0xc8, 0xcb, 0xb0, 0x13, 0xb9, 0xbe, 0x50, 0xb4, 0x7f, 0xb4, 0xbf, 0xe9, 0x4f, + 0x55, 0xe7, 0x9d, 0x94, 0xda, 0xc0, 0x53, 0x59, 0x28, 0x3d, 0xbb, 0x9a, 0xd9, 0xaf, 0xb9, 0x2d, + 0x18, 0x91, 0xeb, 0x2d, 0x43, 0xd4, 0x50, 0xd6, 0x19, 0xeb, 0x23, 0xdb, 0x67, 0xea, 0xce, 0xf8, + 0xb4, 0x1d, 0xb1, 0xd6, 0x1e, 0x69, 0x3b, 0x9f, 0x83, 0x31, 0x7d, 0x8d, 0x3d, 0xd2, 0xb6, 0xde, + 0x82, 0x99, 0x8c, 0xb5, 0xf4, 0x48, 0x9b, 0xbc, 0x07, 0x67, 0x73, 0xd7, 0xc7, 0xa3, 0x6c, 0xd8, + 0xfe, 0x39, 0x4b, 0x3f, 0x07, 0x4f, 0x40, 0x75, 0xb0, 0x6c, 0xaa, 0x0e, 0xce, 0x77, 0xdf, 0x39, + 0x39, 0xfa, 0x83, 0x37, 0xf5, 0x4e, 0xd3, 0x53, 0x1d, 0xbd, 0x0e, 0x43, 0x4d, 0x5a, 0x22, 0xcd, + 0x4c, 0xed, 0xde, 0x3b, 0x32, 0xe6, 0xa5, 0x58, 0x79, 0x88, 0x05, 0x05, 0xfb, 0x97, 0x2c, 0x18, + 0x38, 0x81, 0x91, 0xc0, 0xe6, 0x48, 0x3c, 0x97, 0x4b, 0x5a, 0xc4, 0x0f, 0x5e, 0xc0, 0xce, 0xbd, + 0x95, 0xfb, 0x11, 0xf1, 0x42, 0xf6, 0x54, 0xcc, 0x1c, 0x98, 0x9f, 0xb4, 0x60, 0xe6, 0xa6, 0xef, + 0x34, 0x96, 0x9c, 0xa6, 0xe3, 0xd5, 0x49, 0x50, 0xf1, 0xb6, 0x8f, 0x64, 0x23, 0x5d, 0xe8, 0x69, + 0x23, 0xbd, 0x2c, 0x4d, 0x8c, 0x06, 0xf2, 0xe7, 0x8f, 0x32, 0x92, 0xc9, 0x30, 0x2a, 0x86, 0x31, + 0xec, 0x0e, 0x20, 0xbd, 0x97, 0xc2, 0x63, 0x05, 0xc3, 0xb0, 0xcb, 0xfb, 0x2b, 0x26, 0xf1, 0xa9, + 0x6c, 0x06, 0x2f, 0xf5, 0x79, 0x9a, 0x2f, 0x06, 0x2f, 0xc0, 0x92, 0x90, 0xfd, 0x32, 0x64, 0xba, + 0xbd, 0xf7, 0x16, 0x3e, 0xd8, 0x9f, 0x84, 0x69, 0x56, 0xf3, 0x88, 0x0f, 0x63, 0x3b, 0x21, 0xdb, + 0xcc, 0x08, 0x88, 0x67, 0x7f, 0xd1, 0x82, 0xc9, 0xf5, 0x44, 0x9c, 0xb0, 0x4b, 0x4c, 0x1b, 0x9a, + 0x21, 0x52, 0xaf, 0xb1, 0x52, 0x2c, 0xa0, 0xc7, 0x2e, 0xc9, 0xfa, 0x0b, 0x0b, 0xe2, 0x48, 0x14, + 0x27, 0xc0, 0xbe, 0x2d, 0x1b, 0xec, 0x5b, 0xa6, 0x84, 0x45, 0x75, 0x27, 0x8f, 0x7b, 0x43, 0x37, + 0x54, 0x8c, 0xa6, 0x2e, 0xc2, 0x95, 0x98, 0x0c, 0x5f, 0x8a, 0x13, 0x66, 0x20, 0x27, 0x19, 0xb5, + 0xc9, 0xfe, 0x9d, 0x02, 0x20, 0x85, 0xdb, 0x77, 0x0c, 0xa9, 0x74, 0x8d, 0xe3, 0x89, 0x21, 0xb5, + 0x07, 0x88, 0xe9, 0xf3, 0x03, 0xc7, 0x0b, 0x39, 0x59, 0x57, 0xc8, 0xee, 0x8e, 0x66, 0x2c, 0x30, + 0x27, 0x9a, 0x44, 0x37, 0x53, 0xd4, 0x70, 0x46, 0x0b, 0x9a, 0x9d, 0xc6, 0x60, 0xbf, 0x76, 0x1a, + 0x43, 0x3d, 0xbc, 0xd2, 0x7e, 0xd6, 0x82, 0x71, 0x35, 0x4c, 0xef, 0x12, 0x9b, 0x71, 0xd5, 0x9f, + 0x9c, 0x03, 0xb4, 0xaa, 0x75, 0x99, 0x5d, 0x2c, 0xdf, 0xca, 0xbc, 0x0b, 0x9d, 0xa6, 0xfb, 0x36, + 0x51, 0x11, 0xfc, 0xe6, 0x85, 0xb7, 0xa0, 0x28, 0x3d, 0x3c, 0x98, 0x1f, 0x57, 0xff, 0x78, 0xc4, + 0xe0, 0xb8, 0x0a, 0x3d, 0x92, 0x27, 0x13, 0x4b, 0x11, 0xbd, 0x04, 0x83, 0xed, 0x1d, 0x27, 0x24, + 0x09, 0xdf, 0x9a, 0xc1, 0x2a, 0x2d, 0x3c, 0x3c, 0x98, 0x9f, 0x50, 0x15, 0x58, 0x09, 0xe6, 0xd8, + 0xfd, 0x47, 0xe6, 0x4a, 0x2f, 0xce, 0x9e, 0x91, 0xb9, 0xfe, 0xd4, 0x82, 0x81, 0x75, 0xbf, 0x71, + 0x12, 0x47, 0xc0, 0x6b, 0xc6, 0x11, 0xf0, 0x44, 0x5e, 0x30, 0xf7, 0xdc, 0xdd, 0xbf, 0x9a, 0xd8, + 0xfd, 0xe7, 0x73, 0x29, 0x74, 0xdf, 0xf8, 0x2d, 0x18, 0x65, 0x21, 0xe2, 0x85, 0x1f, 0xd1, 0x0b, + 0xc6, 0x86, 0x9f, 0x4f, 0x6c, 0xf8, 0x49, 0x0d, 0x55, 0xdb, 0xe9, 0x4f, 0xc3, 0xb0, 0x70, 0x4c, + 0x49, 0x3a, 0x69, 0x0a, 0x5c, 0x2c, 0xe1, 0xf6, 0x8f, 0x17, 0xc1, 0x08, 0x49, 0x8f, 0x7e, 0xc5, + 0x82, 0x85, 0x80, 0x1b, 0xac, 0x36, 0xca, 0x9d, 0xc0, 0xf5, 0xb6, 0x6b, 0xf5, 0x1d, 0xd2, 0xe8, + 0x34, 0x5d, 0x6f, 0xbb, 0xb2, 0xed, 0xf9, 0xaa, 0x78, 0xe5, 0x3e, 0xa9, 0x77, 0x98, 0x12, 0xac, + 0x47, 0xfc, 0x7b, 0x65, 0xf8, 0xfd, 0xfc, 0x83, 0x83, 0xf9, 0x05, 0x7c, 0x24, 0xda, 0xf8, 0x88, + 0x7d, 0x41, 0xbf, 0x69, 0xc1, 0x15, 0x1e, 0xa9, 0xbd, 0xff, 0xfe, 0x77, 0x79, 0x2d, 0x57, 0x25, + 0xa9, 0x98, 0xc8, 0x06, 0x09, 0x5a, 0x4b, 0x1f, 0x11, 0x03, 0x7a, 0xa5, 0x7a, 0xb4, 0xb6, 0xf0, + 0x51, 0x3b, 0x67, 0xff, 0xb3, 0x22, 0x8c, 0x8b, 0x08, 0x4e, 0xe2, 0x0e, 0x78, 0xc9, 0x58, 0x12, + 0x4f, 0x26, 0x96, 0xc4, 0xb4, 0x81, 0x7c, 0x3c, 0xc7, 0x7f, 0x08, 0xd3, 0xf4, 0x70, 0xbe, 0x4e, + 0x9c, 0x20, 0xda, 0x24, 0x0e, 0x37, 0xbf, 0x2a, 0x1e, 0xf9, 0xf4, 0x57, 0xe2, 0xb9, 0x9b, 0x49, + 0x62, 0x38, 0x4d, 0xff, 0x9b, 0xe9, 0xce, 0xf1, 0x60, 0x2a, 0x15, 0x84, 0xeb, 0x53, 0x50, 0x52, + 0x5e, 0x15, 0xe2, 0xd0, 0xe9, 0x1e, 0xcb, 0x2e, 0x49, 0x81, 0x8b, 0xd0, 0x62, 0x8f, 0x9e, 0x98, + 0x9c, 0xfd, 0x0f, 0x0a, 0x46, 0x83, 0x7c, 0x12, 0xd7, 0x61, 0xc4, 0x09, 0x43, 0x77, 0xdb, 0x23, + 0x0d, 0xb1, 0x63, 0xdf, 0x9f, 0xb7, 0x63, 0x8d, 0x66, 0x98, 0x67, 0xcb, 0xa2, 0xa8, 0x89, 0x15, + 0x0d, 0x74, 0x9d, 0x1b, 0xb9, 0xed, 0xc9, 0xf7, 0x5e, 0x7f, 0xd4, 0x40, 0x9a, 0xc1, 0xed, 0x11, + 0x2c, 0xea, 0xa3, 0x4f, 0x73, 0x2b, 0xc4, 0x1b, 0x9e, 0x7f, 0xcf, 0xbb, 0xe6, 0xfb, 0x32, 0x4a, + 0x42, 0x7f, 0x04, 0xa7, 0xa5, 0xed, 0xa1, 0xaa, 0x8e, 0x4d, 0x6a, 0xfd, 0x45, 0xb5, 0xfc, 0x3c, + 0xcc, 0x50, 0xd2, 0xa6, 0x13, 0x73, 0x88, 0x08, 0x4c, 0x8a, 0xf0, 0x60, 0xb2, 0x4c, 0x8c, 0x5d, + 0xe6, 0x53, 0xce, 0xac, 0x1d, 0xcb, 0x91, 0x6f, 0x98, 0x24, 0x70, 0x92, 0xa6, 0xfd, 0x53, 0x16, + 0x30, 0x87, 0xce, 0x13, 0xe0, 0x47, 0x3e, 0x66, 0xf2, 0x23, 0xb3, 0x79, 0x83, 0x9c, 0xc3, 0x8a, + 0xbc, 0xc8, 0x57, 0x56, 0x35, 0xf0, 0xef, 0xef, 0x0b, 0xd3, 0x91, 0xde, 0xef, 0x0f, 0xfb, 0x7f, + 0x5b, 0xfc, 0x10, 0x53, 0x3e, 0x0f, 0xe8, 0xdb, 0x61, 0xa4, 0xee, 0xb4, 0x9d, 0x3a, 0xcf, 0x9f, + 0x92, 0x2b, 0xd1, 0x33, 0x2a, 0x2d, 0x2c, 0x8b, 0x1a, 0x5c, 0x42, 0x25, 0xc3, 0xcc, 0x8d, 0xc8, + 0xe2, 0x9e, 0x52, 0x29, 0xd5, 0xe4, 0xdc, 0x2e, 0x8c, 0x1b, 0xc4, 0x1e, 0xa9, 0x38, 0xe3, 0xdb, + 0xf9, 0x15, 0xab, 0xc2, 0x22, 0xb6, 0x60, 0xda, 0xd3, 0xfe, 0xd3, 0x0b, 0x45, 0x3e, 0x2e, 0xdf, + 0xdf, 0xeb, 0x12, 0x65, 0xb7, 0x8f, 0xe6, 0x2b, 0x9a, 0x20, 0x83, 0xd3, 0x94, 0xed, 0x9f, 0xb0, + 0xe0, 0x31, 0x1d, 0x51, 0x73, 0x47, 0xe9, 0xa5, 0x23, 0x28, 0xc3, 0x88, 0xdf, 0x26, 0x81, 0x13, + 0xf9, 0x81, 0xb8, 0x35, 0x2e, 0xcb, 0x41, 0xbf, 0x25, 0xca, 0x0f, 0x45, 0xf4, 0x71, 0x49, 0x5d, + 0x96, 0x63, 0x55, 0x93, 0xbe, 0x3e, 0xd9, 0x60, 0x84, 0xc2, 0xf1, 0x88, 0x9d, 0x01, 0x4c, 0x5d, + 0x1e, 0x62, 0x01, 0xb1, 0xbf, 0x66, 0xf1, 0x85, 0xa5, 0x77, 0x1d, 0xbd, 0x05, 0x53, 0x2d, 0x27, + 0xaa, 0xef, 0xac, 0xdc, 0x6f, 0x07, 0x5c, 0xe3, 0x22, 0xc7, 0xe9, 0x99, 0x5e, 0xe3, 0xa4, 0x7d, + 0x64, 0x6c, 0x58, 0xb9, 0x96, 0x20, 0x86, 0x53, 0xe4, 0xd1, 0x26, 0x8c, 0xb2, 0x32, 0xe6, 0x53, + 0x17, 0x76, 0x63, 0x0d, 0xf2, 0x5a, 0x53, 0x16, 0x07, 0x6b, 0x31, 0x1d, 0xac, 0x13, 0xb5, 0x7f, + 0xa6, 0xc8, 0x77, 0x3b, 0x63, 0xe5, 0x9f, 0x86, 0xe1, 0xb6, 0xdf, 0x58, 0xae, 0x94, 0xb1, 0x98, + 0x05, 0x75, 0x8d, 0x54, 0x79, 0x31, 0x96, 0x70, 0x74, 0x19, 0x46, 0xc4, 0x4f, 0xa9, 0x21, 0x63, + 0x67, 0xb3, 0xc0, 0x0b, 0xb1, 0x82, 0xa2, 0xe7, 0x01, 0xda, 0x81, 0xbf, 0xe7, 0x36, 0x58, 0xac, + 0x87, 0xa2, 0x69, 0x2c, 0x54, 0x55, 0x10, 0xac, 0x61, 0xa1, 0x57, 0x61, 0xbc, 0xe3, 0x85, 0x9c, + 0x1d, 0xd1, 0x22, 0xbb, 0x2a, 0x33, 0x96, 0xdb, 0x3a, 0x10, 0x9b, 0xb8, 0x68, 0x11, 0x86, 0x22, + 0x87, 0x19, 0xbf, 0x0c, 0xe6, 0x1b, 0xdf, 0x6e, 0x50, 0x0c, 0x3d, 0x55, 0x07, 0xad, 0x80, 0x45, + 0x45, 0xf4, 0x29, 0xe9, 0xde, 0xca, 0x0f, 0x76, 0x61, 0xf5, 0xde, 0xdf, 0x25, 0xa0, 0x39, 0xb7, + 0x0a, 0x6b, 0x7a, 0x83, 0x16, 0x7a, 0x05, 0x80, 0xdc, 0x8f, 0x48, 0xe0, 0x39, 0x4d, 0x65, 0x5b, + 0xa6, 0xf8, 0x82, 0xb2, 0xbf, 0xee, 0x47, 0xb7, 0x43, 0xb2, 0xa2, 0x30, 0xb0, 0x86, 0x6d, 0xff, + 0x66, 0x09, 0x20, 0xe6, 0xdb, 0xd1, 0xdb, 0xa9, 0x83, 0xeb, 0xd9, 0xee, 0x9c, 0xfe, 0xf1, 0x9d, + 0x5a, 0xe8, 0x7b, 0x2c, 0x18, 0x75, 0x9a, 0x4d, 0xbf, 0xee, 0xf0, 0xd8, 0xbb, 0x85, 0xee, 0x07, + 0xa7, 0x68, 0x7f, 0x31, 0xae, 0xc1, 0xbb, 0xf0, 0x82, 0x5c, 0xa1, 0x1a, 0xa4, 0x67, 0x2f, 0xf4, + 0x86, 0xd1, 0x87, 0xe4, 0x53, 0xb1, 0x68, 0x0c, 0xa5, 0x7a, 0x2a, 0x96, 0xd8, 0x1d, 0xa1, 0xbf, + 0x12, 0x6f, 0x1b, 0xaf, 0xc4, 0x81, 0x7c, 0xff, 0x3d, 0x83, 0x7d, 0xed, 0xf5, 0x40, 0x44, 0x55, + 0xdd, 0x97, 0x7f, 0x30, 0xdf, 0x59, 0x4e, 0x7b, 0x27, 0xf5, 0xf0, 0xe3, 0xff, 0x1c, 0x4c, 0x36, + 0x4c, 0x26, 0x40, 0xac, 0xc4, 0xa7, 0xf2, 0xe8, 0x26, 0x78, 0x86, 0xf8, 0xda, 0x4f, 0x00, 0x70, + 0x92, 0x30, 0xaa, 0xf2, 0xd0, 0x0e, 0x15, 0x6f, 0xcb, 0x17, 0x9e, 0x17, 0x76, 0xee, 0x5c, 0xee, + 0x87, 0x11, 0x69, 0x51, 0xcc, 0xf8, 0x76, 0x5f, 0x17, 0x75, 0xb1, 0xa2, 0x82, 0x5e, 0x87, 0x21, + 0xe6, 0x2d, 0x15, 0xce, 0x8e, 0xe4, 0x4b, 0x9c, 0xcd, 0x58, 0x65, 0xf1, 0x86, 0x64, 0x7f, 0x43, + 0x2c, 0x28, 0xa0, 0xeb, 0xd2, 0x17, 0x31, 0xac, 0x78, 0xb7, 0x43, 0xc2, 0x7c, 0x11, 0x4b, 0x4b, + 0xef, 0x8f, 0xdd, 0x0c, 0x79, 0x79, 0x66, 0x42, 0x2f, 0xa3, 0x26, 0xe5, 0xa2, 0xc4, 0x7f, 0x99, + 0x27, 0x6c, 0x16, 0xf2, 0xbb, 0x67, 0xe6, 0x12, 0x8b, 0x87, 0xf3, 0x8e, 0x49, 0x02, 0x27, 0x69, + 0x52, 0x8e, 0x94, 0xef, 0x7a, 0xe1, 0xbb, 0xd1, 0xeb, 0xec, 0xe0, 0x0f, 0x71, 0x76, 0x1b, 0xf1, + 0x12, 0x2c, 0xea, 0x9f, 0x28, 0x7b, 0x30, 0xe7, 0xc1, 0x54, 0x72, 0x8b, 0x3e, 0x52, 0x76, 0xe4, + 0x0f, 0x07, 0x60, 0xc2, 0x5c, 0x52, 0xe8, 0x0a, 0x94, 0x04, 0x11, 0x15, 0xdb, 0x5f, 0xed, 0x92, + 0x35, 0x09, 0xc0, 0x31, 0x0e, 0x4b, 0xe9, 0xc0, 0xaa, 0x6b, 0xc6, 0xba, 0x71, 0x4a, 0x07, 0x05, + 0xc1, 0x1a, 0x16, 0x7d, 0x58, 0x6d, 0xfa, 0x7e, 0xa4, 0x2e, 0x24, 0xb5, 0xee, 0x96, 0x58, 0x29, + 0x16, 0x50, 0x7a, 0x11, 0xed, 0x92, 0xc0, 0x23, 0x4d, 0x33, 0x0a, 0xb0, 0xba, 0x88, 0x6e, 0xe8, + 0x40, 0x6c, 0xe2, 0xd2, 0xeb, 0xd4, 0x0f, 0xd9, 0x42, 0x16, 0xcf, 0xb7, 0xd8, 0xf8, 0xb9, 0xc6, + 0xdd, 0xa1, 0x25, 0x1c, 0x7d, 0x12, 0x1e, 0x53, 0x91, 0x8e, 0x30, 0xd7, 0x66, 0xc8, 0x16, 0x87, + 0x0c, 0x69, 0xcb, 0x63, 0xcb, 0xd9, 0x68, 0x38, 0xaf, 0x3e, 0x7a, 0x0d, 0x26, 0x04, 0x8b, 0x2f, + 0x29, 0x0e, 0x9b, 0x06, 0x36, 0x37, 0x0c, 0x28, 0x4e, 0x60, 0xcb, 0x38, 0xc6, 0x8c, 0xcb, 0x96, + 0x14, 0x46, 0xd2, 0x71, 0x8c, 0x75, 0x38, 0x4e, 0xd5, 0x40, 0x8b, 0x30, 0xc9, 0x79, 0x30, 0xd7, + 0xdb, 0xe6, 0x73, 0x22, 0x5c, 0xab, 0xd4, 0x96, 0xba, 0x65, 0x82, 0x71, 0x12, 0x1f, 0xbd, 0x0c, + 0x63, 0x4e, 0x50, 0xdf, 0x71, 0x23, 0x52, 0x8f, 0x3a, 0x01, 0xf7, 0xb9, 0xd2, 0x2c, 0x94, 0x16, + 0x35, 0x18, 0x36, 0x30, 0xed, 0xb7, 0x61, 0x26, 0x23, 0x4e, 0x02, 0x5d, 0x38, 0x4e, 0xdb, 0x95, + 0xdf, 0x94, 0x30, 0x63, 0x5e, 0xac, 0x56, 0xe4, 0xd7, 0x68, 0x58, 0x74, 0x75, 0xb2, 0x78, 0x0a, + 0x5a, 0x5a, 0x40, 0xb5, 0x3a, 0x57, 0x25, 0x00, 0xc7, 0x38, 0xf6, 0x7f, 0x2f, 0xc0, 0x64, 0x86, + 0x6e, 0x85, 0xa5, 0xa6, 0x4b, 0x3c, 0x52, 0xe2, 0x4c, 0x74, 0x66, 0x58, 0xec, 0xc2, 0x11, 0xc2, + 0x62, 0x17, 0x7b, 0x85, 0xc5, 0x1e, 0x78, 0x27, 0x61, 0xb1, 0xcd, 0x11, 0x1b, 0xec, 0x6b, 0xc4, + 0x32, 0x42, 0x69, 0x0f, 0x1d, 0x31, 0x94, 0xb6, 0x31, 0xe8, 0xc3, 0x7d, 0x0c, 0xfa, 0x0f, 0x17, + 0x60, 0x2a, 0x69, 0x49, 0x79, 0x02, 0x72, 0xdb, 0xd7, 0x0d, 0xb9, 0xed, 0xe5, 0x7e, 0x5c, 0x61, + 0x73, 0x65, 0xb8, 0x38, 0x21, 0xc3, 0xfd, 0x60, 0x5f, 0xd4, 0xba, 0xcb, 0x73, 0xff, 0x66, 0x01, + 0x4e, 0x67, 0xfa, 0xe2, 0x9e, 0xc0, 0xd8, 0xdc, 0x32, 0xc6, 0xe6, 0xb9, 0xbe, 0xdd, 0x84, 0x73, + 0x07, 0xe8, 0x6e, 0x62, 0x80, 0xae, 0xf4, 0x4f, 0xb2, 0xfb, 0x28, 0x7d, 0xb5, 0x08, 0xe7, 0x33, + 0xeb, 0xc5, 0x62, 0xcf, 0x55, 0x43, 0xec, 0xf9, 0x7c, 0x42, 0xec, 0x69, 0x77, 0xaf, 0x7d, 0x3c, + 0x72, 0x50, 0xe1, 0x2e, 0xcb, 0x9c, 0xfe, 0x1f, 0x52, 0x06, 0x6a, 0xb8, 0xcb, 0x2a, 0x42, 0xd8, + 0xa4, 0xfb, 0xcd, 0x24, 0xfb, 0xfc, 0x37, 0x16, 0x9c, 0xcd, 0x9c, 0x9b, 0x13, 0x90, 0x75, 0xad, + 0x9b, 0xb2, 0xae, 0xa7, 0xfb, 0x5e, 0xad, 0x39, 0xc2, 0xaf, 0x5f, 0x1f, 0xc8, 0xf9, 0x16, 0xf6, + 0x92, 0xbf, 0x05, 0xa3, 0x4e, 0xbd, 0x4e, 0xc2, 0x70, 0xcd, 0x6f, 0xa8, 0xc8, 0xbf, 0xcf, 0xb1, + 0x77, 0x56, 0x5c, 0x7c, 0x78, 0x30, 0x3f, 0x97, 0x24, 0x11, 0x83, 0xb1, 0x4e, 0x01, 0x7d, 0x1a, + 0x46, 0x42, 0x71, 0x6f, 0x8a, 0xb9, 0x7f, 0xa1, 0xcf, 0xc1, 0x71, 0x36, 0x49, 0xd3, 0x0c, 0x4d, + 0xa4, 0x24, 0x15, 0x8a, 0xa4, 0x19, 0xc6, 0xa4, 0x70, 0xac, 0x61, 0x4c, 0x9e, 0x07, 0xd8, 0x53, + 0x8f, 0x81, 0xa4, 0xfc, 0x41, 0x7b, 0x26, 0x68, 0x58, 0xe8, 0xe3, 0x30, 0x15, 0xf2, 0xd8, 0x7d, + 0xcb, 0x4d, 0x27, 0x64, 0xce, 0x32, 0x62, 0x15, 0xb2, 0xf0, 0x47, 0xb5, 0x04, 0x0c, 0xa7, 0xb0, + 0xd1, 0xaa, 0x6c, 0x95, 0x05, 0x1a, 0xe4, 0x0b, 0xf3, 0x52, 0xdc, 0xa2, 0x48, 0x8c, 0x7b, 0x2a, + 0x39, 0xfc, 0x6c, 0xe0, 0xb5, 0x9a, 0xe8, 0xd3, 0x00, 0x74, 0xf9, 0x08, 0x39, 0xc4, 0x70, 0xfe, + 0xe1, 0x49, 0x4f, 0x95, 0x46, 0xa6, 0x6d, 0x2f, 0xf3, 0x70, 0x2d, 0x2b, 0x22, 0x58, 0x23, 0x68, + 0xff, 0xf0, 0x00, 0x3c, 0xde, 0xe5, 0x8c, 0x44, 0x8b, 0xa6, 0x1e, 0xf6, 0x99, 0xe4, 0xe3, 0x7a, + 0x2e, 0xb3, 0xb2, 0xf1, 0xda, 0x4e, 0x2c, 0xc5, 0xc2, 0x3b, 0x5e, 0x8a, 0x3f, 0x60, 0x69, 0x62, + 0x0f, 0x6e, 0xf1, 0xf9, 0xb1, 0x23, 0x9e, 0xfd, 0xc7, 0x28, 0x07, 0xd9, 0xca, 0x10, 0x26, 0x3c, + 0xdf, 0x77, 0x77, 0xfa, 0x96, 0x2e, 0x9c, 0xac, 0x94, 0xf8, 0xb7, 0x2d, 0x38, 0xd7, 0x35, 0x68, + 0xc7, 0x37, 0x20, 0xc3, 0x60, 0x7f, 0xc1, 0x82, 0x27, 0x33, 0x6b, 0x18, 0x66, 0x46, 0x57, 0xa0, + 0x54, 0xa7, 0x85, 0x9a, 0x97, 0x66, 0xec, 0xbe, 0x2e, 0x01, 0x38, 0xc6, 0x31, 0xac, 0x89, 0x0a, + 0x3d, 0xad, 0x89, 0x7e, 0xd5, 0x82, 0xd4, 0xa6, 0x3f, 0x81, 0xdb, 0xa7, 0x62, 0xde, 0x3e, 0xef, + 0xef, 0x67, 0x34, 0x73, 0x2e, 0x9e, 0x3f, 0x99, 0x84, 0x33, 0x39, 0x5e, 0x4a, 0x7b, 0x30, 0xbd, + 0x5d, 0x27, 0xa6, 0xff, 0x6b, 0xb7, 0xb8, 0x30, 0x5d, 0x9d, 0x65, 0x59, 0xea, 0xce, 0xe9, 0x14, + 0x0a, 0x4e, 0x37, 0x81, 0xbe, 0x60, 0xc1, 0x29, 0xe7, 0x5e, 0x98, 0xca, 0xf5, 0x2f, 0xd6, 0xce, + 0x8b, 0x99, 0x92, 0x9d, 0xbb, 0xb5, 0x14, 0xbe, 0xd1, 0x3c, 0xcb, 0x65, 0x9a, 0x85, 0x85, 0x33, + 0xdb, 0x42, 0x58, 0x04, 0xb8, 0xa7, 0x6f, 0x94, 0x2e, 0x1e, 0xda, 0x59, 0xee, 0x64, 0xfc, 0x5a, + 0x94, 0x10, 0xac, 0xe8, 0xa0, 0xcf, 0x42, 0x69, 0x5b, 0xfa, 0x78, 0x66, 0x5c, 0xbb, 0xf1, 0x40, + 0x76, 0xf7, 0x7c, 0xe5, 0xea, 0x59, 0x85, 0x84, 0x63, 0xa2, 0xe8, 0x35, 0x28, 0x7a, 0x5b, 0x61, + 0xb7, 0x74, 0xa0, 0x09, 0x3b, 0x3c, 0x1e, 0x07, 0x61, 0x7d, 0xb5, 0x86, 0x69, 0x45, 0x74, 0x1d, + 0x8a, 0xc1, 0x66, 0x43, 0x88, 0x25, 0x33, 0x37, 0x29, 0x5e, 0x2a, 0xe7, 0xf4, 0x8a, 0x51, 0xc2, + 0x4b, 0x65, 0x4c, 0x49, 0xa0, 0x2a, 0x0c, 0x32, 0xd7, 0x1e, 0x71, 0xc9, 0x65, 0xb2, 0xf3, 0x5d, + 0x5c, 0xe4, 0x78, 0xb0, 0x04, 0x86, 0x80, 0x39, 0x21, 0xb4, 0x01, 0x43, 0x75, 0x96, 0x3a, 0x52, + 0x04, 0x46, 0xfb, 0x50, 0xa6, 0x00, 0xb2, 0x4b, 0x4e, 0x4d, 0x21, 0x8f, 0x63, 0x18, 0x58, 0xd0, + 0x62, 0x54, 0x49, 0x7b, 0x67, 0x2b, 0x14, 0xa9, 0x8e, 0xb3, 0xa9, 0x76, 0x49, 0x15, 0x2b, 0xa8, + 0x32, 0x0c, 0x2c, 0x68, 0xa1, 0x57, 0xa0, 0xb0, 0x55, 0x17, 0x6e, 0x3b, 0x99, 0x92, 0x48, 0x33, + 0x94, 0xc5, 0xd2, 0xd0, 0x83, 0x83, 0xf9, 0xc2, 0xea, 0x32, 0x2e, 0x6c, 0xd5, 0xd1, 0x3a, 0x0c, + 0x6f, 0x71, 0xe7, 0x77, 0x21, 0x6c, 0x7c, 0x2a, 0xdb, 0x2f, 0x3f, 0xe5, 0x1f, 0xcf, 0x3d, 0x56, + 0x04, 0x00, 0x4b, 0x22, 0x2c, 0x5e, 0xbc, 0x72, 0xe2, 0x17, 0x31, 0xc4, 0x16, 0x8e, 0x16, 0x78, + 0x81, 0x33, 0x1d, 0x71, 0x28, 0x00, 0xac, 0x51, 0xa4, 0xab, 0xda, 0x91, 0xf9, 0xe6, 0x45, 0xb0, + 0x99, 0xcc, 0x55, 0xdd, 0x23, 0x15, 0x3f, 0x5f, 0xd5, 0x0a, 0x09, 0xc7, 0x44, 0xd1, 0x2e, 0x8c, + 0xef, 0x85, 0xed, 0x1d, 0x22, 0xb7, 0x34, 0x8b, 0x3d, 0x93, 0x73, 0x2f, 0xdf, 0x11, 0x88, 0x6e, + 0x10, 0x75, 0x9c, 0x66, 0xea, 0x14, 0x62, 0x3a, 0xfd, 0x3b, 0x3a, 0x31, 0x6c, 0xd2, 0xa6, 0xc3, + 0xff, 0x56, 0xc7, 0xdf, 0xdc, 0x8f, 0x88, 0x08, 0xfd, 0x95, 0x39, 0xfc, 0x6f, 0x70, 0x94, 0xf4, + 0xf0, 0x0b, 0x00, 0x96, 0x44, 0xd0, 0x1d, 0x31, 0x3c, 0xec, 0xf4, 0x9c, 0xca, 0x8f, 0xcf, 0xb9, + 0x28, 0x91, 0x72, 0x06, 0x85, 0x9d, 0x96, 0x31, 0x29, 0x76, 0x4a, 0xb6, 0x77, 0xfc, 0xc8, 0xf7, + 0x12, 0x27, 0xf4, 0x74, 0xfe, 0x29, 0x59, 0xcd, 0xc0, 0x4f, 0x9f, 0x92, 0x59, 0x58, 0x38, 0xb3, + 0x2d, 0xd4, 0x80, 0x89, 0xb6, 0x1f, 0x44, 0xf7, 0xfc, 0x40, 0xae, 0x2f, 0xd4, 0x45, 0x58, 0x62, + 0x60, 0x8a, 0x16, 0x59, 0x54, 0x3d, 0x13, 0x82, 0x13, 0x34, 0xd1, 0x27, 0x60, 0x38, 0xac, 0x3b, + 0x4d, 0x52, 0xb9, 0x35, 0x3b, 0x93, 0x7f, 0xfd, 0xd4, 0x38, 0x4a, 0xce, 0xea, 0xe2, 0xc1, 0xe5, + 0x39, 0x0a, 0x96, 0xe4, 0xd0, 0x2a, 0x0c, 0xb2, 0x7c, 0x60, 0x2c, 0x4e, 0x5d, 0x4e, 0x98, 0xd1, + 0x94, 0x55, 0x34, 0x3f, 0x9b, 0x58, 0x31, 0xe6, 0xd5, 0xe9, 0x1e, 0x10, 0x6f, 0x06, 0x3f, 0x9c, + 0x3d, 0x9d, 0xbf, 0x07, 0xc4, 0x53, 0xe3, 0x56, 0xad, 0xdb, 0x1e, 0x50, 0x48, 0x38, 0x26, 0x4a, + 0x4f, 0x66, 0x7a, 0x9a, 0x9e, 0xe9, 0x62, 0xce, 0x93, 0x7b, 0x96, 0xb2, 0x93, 0x99, 0x9e, 0xa4, + 0x94, 0x84, 0xfd, 0xfb, 0xc3, 0x69, 0x9e, 0x85, 0xbd, 0x32, 0xbf, 0xcb, 0x4a, 0x29, 0x20, 0x3f, + 0xdc, 0xaf, 0xd0, 0xeb, 0x18, 0x59, 0xf0, 0x2f, 0x58, 0x70, 0xa6, 0x9d, 0xf9, 0x21, 0x82, 0x01, + 0xe8, 0x4f, 0x76, 0xc6, 0x3f, 0x5d, 0xc5, 0x34, 0xcc, 0x86, 0xe3, 0x9c, 0x96, 0x92, 0xcf, 0x9c, + 0xe2, 0x3b, 0x7e, 0xe6, 0xac, 0xc1, 0x08, 0x63, 0x32, 0x7b, 0xa4, 0x52, 0x4e, 0xbe, 0xf6, 0x18, + 0x2b, 0xb1, 0x2c, 0x2a, 0x62, 0x45, 0x02, 0xfd, 0xa0, 0x05, 0xe7, 0x92, 0x5d, 0xc7, 0x84, 0x81, + 0x45, 0x20, 0x44, 0xfe, 0xc0, 0x5d, 0x15, 0xdf, 0x9f, 0xe2, 0xff, 0x0d, 0xe4, 0xc3, 0x5e, 0x08, + 0xb8, 0x7b, 0x63, 0xa8, 0x9c, 0xf1, 0xc2, 0x1e, 0x32, 0xb5, 0x0a, 0x7d, 0xbc, 0xb2, 0x5f, 0x84, + 0xb1, 0x96, 0xdf, 0xf1, 0x22, 0x61, 0xfd, 0x23, 0x2c, 0x11, 0x98, 0x06, 0x7e, 0x4d, 0x2b, 0xc7, + 0x06, 0x56, 0xe2, 0x6d, 0x3e, 0xf2, 0xd0, 0x6f, 0xf3, 0x37, 0x61, 0xcc, 0xd3, 0xcc, 0x55, 0x05, + 0x3f, 0x70, 0x29, 0x3f, 0x88, 0xa9, 0x6e, 0xdc, 0xca, 0x7b, 0xa9, 0x97, 0x60, 0x83, 0xda, 0xc9, + 0x3e, 0xf8, 0xbe, 0x6c, 0x65, 0x30, 0xf5, 0x5c, 0x04, 0xf0, 0x51, 0x53, 0x04, 0x70, 0x29, 0x29, + 0x02, 0x48, 0x49, 0x94, 0x8d, 0xd7, 0x7f, 0xff, 0x39, 0x5a, 0xfa, 0x0d, 0x84, 0x68, 0x37, 0xe1, + 0x42, 0xaf, 0x6b, 0x89, 0x99, 0x81, 0x35, 0x94, 0xfe, 0x30, 0x36, 0x03, 0x6b, 0x54, 0xca, 0x98, + 0x41, 0xfa, 0x0d, 0xb1, 0x63, 0xff, 0x57, 0x0b, 0x8a, 0x55, 0xbf, 0x71, 0x02, 0x0f, 0xde, 0x8f, + 0x19, 0x0f, 0xde, 0xc7, 0xb3, 0x2f, 0xc4, 0x46, 0xae, 0x3c, 0x7c, 0x25, 0x21, 0x0f, 0x3f, 0x97, + 0x47, 0xa0, 0xbb, 0xf4, 0xfb, 0x27, 0x8b, 0x30, 0x5a, 0xf5, 0x1b, 0xca, 0x06, 0xfb, 0xd7, 0x1f, + 0xc6, 0x06, 0x3b, 0x37, 0xd3, 0x80, 0x46, 0x99, 0x59, 0x8f, 0x49, 0xf7, 0xd3, 0x6f, 0x30, 0x53, + 0xec, 0xbb, 0xc4, 0xdd, 0xde, 0x89, 0x48, 0x23, 0xf9, 0x39, 0x27, 0x67, 0x8a, 0xfd, 0xfb, 0x05, + 0x98, 0x4c, 0xb4, 0x8e, 0x9a, 0x30, 0xde, 0xd4, 0xa5, 0xad, 0x62, 0x9d, 0x3e, 0x94, 0xa0, 0x56, + 0x98, 0xb2, 0x6a, 0x45, 0xd8, 0x24, 0x8e, 0x16, 0x00, 0x94, 0xfa, 0x51, 0x8a, 0xf5, 0x18, 0xd7, + 0xaf, 0xf4, 0x93, 0x21, 0xd6, 0x30, 0xd0, 0x4b, 0x30, 0x1a, 0xf9, 0x6d, 0xbf, 0xe9, 0x6f, 0xef, + 0xdf, 0x20, 0x32, 0xa8, 0x93, 0x32, 0x50, 0xdb, 0x88, 0x41, 0x58, 0xc7, 0x43, 0xf7, 0x61, 0x5a, + 0x11, 0xa9, 0x1d, 0x83, 0x04, 0x9a, 0x49, 0x15, 0xd6, 0x93, 0x14, 0x71, 0xba, 0x11, 0xfb, 0xa7, + 0x8b, 0x7c, 0x88, 0xbd, 0xc8, 0x7d, 0x6f, 0x37, 0xbc, 0xbb, 0x77, 0xc3, 0x57, 0x2d, 0x98, 0xa2, + 0xad, 0x33, 0xeb, 0x1b, 0x79, 0xcd, 0xab, 0xb0, 0xc9, 0x56, 0x97, 0xb0, 0xc9, 0x97, 0xe8, 0xa9, + 0xd9, 0xf0, 0x3b, 0x91, 0x90, 0xdd, 0x69, 0xc7, 0x22, 0x2d, 0xc5, 0x02, 0x2a, 0xf0, 0x48, 0x10, + 0x08, 0x8f, 0x41, 0x1d, 0x8f, 0x04, 0x01, 0x16, 0x50, 0x19, 0x55, 0x79, 0x20, 0x3b, 0xaa, 0x32, + 0x0f, 0x8e, 0x29, 0xec, 0x34, 0x04, 0xc3, 0xa5, 0x05, 0xc7, 0x94, 0x06, 0x1c, 0x31, 0x8e, 0xfd, + 0x73, 0x45, 0x18, 0xab, 0xfa, 0x8d, 0x58, 0xf5, 0xf8, 0xa2, 0xa1, 0x7a, 0xbc, 0x90, 0x50, 0x3d, + 0x4e, 0xe9, 0xb8, 0xef, 0x29, 0x1a, 0xbf, 0x5e, 0x8a, 0xc6, 0x7f, 0x6a, 0xb1, 0x59, 0x2b, 0xaf, + 0xd7, 0xb8, 0x31, 0x17, 0xba, 0x0a, 0xa3, 0xec, 0x80, 0x61, 0x2e, 0xaa, 0x52, 0x1f, 0xc7, 0xb2, + 0x05, 0xad, 0xc7, 0xc5, 0x58, 0xc7, 0x41, 0x97, 0x61, 0x24, 0x24, 0x4e, 0x50, 0xdf, 0x51, 0xa7, + 0xab, 0x50, 0x9e, 0xf1, 0x32, 0xac, 0xa0, 0xe8, 0x8d, 0x38, 0x2e, 0x63, 0x31, 0xdf, 0xe5, 0x4d, + 0xef, 0x0f, 0xdf, 0x22, 0xf9, 0xc1, 0x18, 0xed, 0xbb, 0x80, 0xd2, 0xf8, 0x7d, 0x04, 0x24, 0x9b, + 0x37, 0x03, 0x92, 0x95, 0x52, 0xc1, 0xc8, 0xfe, 0xdc, 0x82, 0x89, 0xaa, 0xdf, 0xa0, 0x5b, 0xf7, + 0x9b, 0x69, 0x9f, 0xea, 0x41, 0x69, 0x87, 0xba, 0x04, 0xa5, 0xbd, 0x08, 0x83, 0x55, 0xbf, 0x51, + 0xa9, 0x76, 0xf3, 0x37, 0xb7, 0xff, 0x96, 0x05, 0xc3, 0x55, 0xbf, 0x71, 0x02, 0x6a, 0x81, 0x8f, + 0x9a, 0x6a, 0x81, 0xc7, 0x72, 0xd6, 0x4d, 0x8e, 0x26, 0xe0, 0x6f, 0x0c, 0xc0, 0x38, 0xed, 0xa7, + 0xbf, 0x2d, 0xa7, 0xd2, 0x18, 0x36, 0xab, 0x8f, 0x61, 0xa3, 0x5c, 0xb8, 0xdf, 0x6c, 0xfa, 0xf7, + 0x92, 0xd3, 0xba, 0xca, 0x4a, 0xb1, 0x80, 0xa2, 0x67, 0x61, 0xa4, 0x1d, 0x90, 0x3d, 0xd7, 0x17, + 0xec, 0xad, 0xa6, 0x64, 0xa9, 0x8a, 0x72, 0xac, 0x30, 0xe8, 0xb3, 0x30, 0x74, 0x3d, 0x7a, 0x95, + 0xd7, 0x7d, 0xaf, 0xc1, 0x25, 0xe7, 0x45, 0x91, 0x39, 0x41, 0x2b, 0xc7, 0x06, 0x16, 0xba, 0x0b, + 0x25, 0xf6, 0x9f, 0x1d, 0x3b, 0x47, 0xcf, 0xc1, 0x29, 0x72, 0xb2, 0x09, 0x02, 0x38, 0xa6, 0x85, + 0x9e, 0x07, 0x88, 0x64, 0xf4, 0xf1, 0x50, 0x04, 0x9f, 0x52, 0x4f, 0x01, 0x15, 0x97, 0x3c, 0xc4, + 0x1a, 0x16, 0x7a, 0x06, 0x4a, 0x91, 0xe3, 0x36, 0x6f, 0xba, 0x1e, 0x09, 0x99, 0x44, 0xbc, 0x28, + 0x53, 0xa3, 0x89, 0x42, 0x1c, 0xc3, 0x29, 0x2b, 0xc6, 0x22, 0x33, 0xf0, 0x0c, 0xbe, 0x23, 0x0c, + 0x9b, 0xb1, 0x62, 0x37, 0x55, 0x29, 0xd6, 0x30, 0xd0, 0x0e, 0x3c, 0xe1, 0x7a, 0x2c, 0xcb, 0x00, + 0xa9, 0xed, 0xba, 0xed, 0x8d, 0x9b, 0xb5, 0x3b, 0x24, 0x70, 0xb7, 0xf6, 0x97, 0x9c, 0xfa, 0x2e, + 0xf1, 0x64, 0x76, 0xc5, 0xf7, 0x8b, 0x2e, 0x3e, 0x51, 0xe9, 0x82, 0x8b, 0xbb, 0x52, 0xb2, 0x5f, + 0x86, 0xd3, 0x55, 0xbf, 0x51, 0xf5, 0x83, 0x68, 0xd5, 0x0f, 0xee, 0x39, 0x41, 0x43, 0xae, 0x94, + 0x79, 0x19, 0x25, 0x81, 0x1e, 0x85, 0x83, 0xfc, 0xa0, 0x30, 0x22, 0x20, 0xbc, 0xc0, 0x98, 0xaf, + 0x23, 0xfa, 0xf6, 0xd4, 0x19, 0x1b, 0xa0, 0x52, 0x6e, 0x5c, 0x73, 0x22, 0x82, 0x6e, 0xb1, 0x54, + 0xc2, 0xf1, 0x8d, 0x28, 0xaa, 0x3f, 0xad, 0xa5, 0x12, 0x8e, 0x81, 0x99, 0x57, 0xa8, 0x59, 0xdf, + 0xfe, 0x6f, 0x83, 0xec, 0x70, 0x4c, 0xa4, 0x6d, 0x40, 0x9f, 0x81, 0x89, 0x90, 0xdc, 0x74, 0xbd, + 0xce, 0x7d, 0x29, 0x8d, 0xe8, 0xe2, 0x9d, 0x55, 0x5b, 0xd1, 0x31, 0xb9, 0x4c, 0xd3, 0x2c, 0xc3, + 0x09, 0x6a, 0xa8, 0x05, 0x13, 0xf7, 0x5c, 0xaf, 0xe1, 0xdf, 0x0b, 0x25, 0xfd, 0x91, 0x7c, 0xd1, + 0xe6, 0x5d, 0x8e, 0x99, 0xe8, 0xa3, 0xd1, 0xdc, 0x5d, 0x83, 0x18, 0x4e, 0x10, 0xa7, 0x0b, 0x30, + 0xe8, 0x78, 0x8b, 0xe1, 0xed, 0x90, 0x04, 0x22, 0x29, 0x34, 0x5b, 0x80, 0x58, 0x16, 0xe2, 0x18, + 0x4e, 0x17, 0x20, 0xfb, 0x73, 0x2d, 0xf0, 0x3b, 0x3c, 0x47, 0x80, 0x58, 0x80, 0x58, 0x95, 0x62, + 0x0d, 0x83, 0x6e, 0x50, 0xf6, 0x6f, 0xdd, 0xf7, 0xb0, 0xef, 0x47, 0x72, 0x4b, 0xb3, 0x34, 0xa4, + 0x5a, 0x39, 0x36, 0xb0, 0xd0, 0x2a, 0xa0, 0xb0, 0xd3, 0x6e, 0x37, 0x99, 0xd9, 0x87, 0xd3, 0x64, + 0xa4, 0xb8, 0xca, 0xbd, 0xc8, 0x43, 0xa7, 0xd6, 0x52, 0x50, 0x9c, 0x51, 0x83, 0x9e, 0xd5, 0x5b, + 0xa2, 0xab, 0x83, 0xac, 0xab, 0x5c, 0x0d, 0x52, 0xe3, 0xfd, 0x94, 0x30, 0xb4, 0x02, 0xc3, 0xe1, + 0x7e, 0x58, 0x8f, 0x44, 0x0c, 0xb8, 0x9c, 0xcc, 0x3c, 0x35, 0x86, 0xa2, 0x25, 0x86, 0xe3, 0x55, + 0xb0, 0xac, 0x8b, 0xea, 0x30, 0x23, 0x28, 0x2e, 0xef, 0x38, 0x9e, 0xca, 0x73, 0xc2, 0xad, 0x5f, + 0xaf, 0x3e, 0x38, 0x98, 0x9f, 0x11, 0x2d, 0xeb, 0xe0, 0xc3, 0x83, 0xf9, 0x33, 0x55, 0xbf, 0x91, + 0x01, 0xc1, 0x59, 0xd4, 0xf8, 0xe2, 0xab, 0xd7, 0xfd, 0x56, 0xbb, 0x1a, 0xf8, 0x5b, 0x6e, 0x93, + 0x74, 0x53, 0x25, 0xd5, 0x0c, 0x4c, 0xb1, 0xf8, 0x8c, 0x32, 0x9c, 0xa0, 0x66, 0x7f, 0x3b, 0xe3, + 0x67, 0x58, 0x1e, 0xe4, 0xa8, 0x13, 0x10, 0xd4, 0x82, 0xf1, 0x36, 0xdb, 0x26, 0x22, 0x72, 0xbf, + 0x58, 0xeb, 0x2f, 0xf6, 0x29, 0x12, 0xb9, 0x47, 0xaf, 0x01, 0x25, 0xb2, 0x64, 0x6f, 0xcd, 0xaa, + 0x4e, 0x0e, 0x9b, 0xd4, 0xed, 0x1f, 0x7b, 0x8c, 0xdd, 0x88, 0x35, 0x2e, 0xe7, 0x18, 0x16, 0xc6, + 0xf6, 0xe2, 0x69, 0x35, 0x97, 0x2f, 0x70, 0x8b, 0xa7, 0x45, 0x18, 0xec, 0x63, 0x59, 0x17, 0x7d, + 0x1a, 0x26, 0xe8, 0x4b, 0x45, 0xdd, 0x4a, 0xe1, 0xec, 0xa9, 0xfc, 0xa0, 0x08, 0x0a, 0x4b, 0xcf, + 0xea, 0xa1, 0x57, 0xc6, 0x09, 0x62, 0xe8, 0x0d, 0x66, 0x16, 0x22, 0x49, 0x17, 0xfa, 0x21, 0xad, + 0x5b, 0x80, 0x48, 0xb2, 0x1a, 0x11, 0xd4, 0x81, 0x99, 0x74, 0x0e, 0xb0, 0x70, 0xd6, 0xce, 0x67, + 0xf9, 0xd2, 0x69, 0xbc, 0xe2, 0xf4, 0x0b, 0x69, 0x58, 0x88, 0xb3, 0xe8, 0xa3, 0x9b, 0x30, 0x2e, + 0x92, 0x01, 0x8b, 0x95, 0x5b, 0x34, 0xe4, 0x80, 0xe3, 0x58, 0x07, 0x1e, 0x26, 0x0b, 0xb0, 0x59, + 0x19, 0x6d, 0xc3, 0x39, 0x2d, 0x39, 0xcf, 0xb5, 0xc0, 0x61, 0xca, 0x7c, 0x97, 0x1d, 0xa7, 0xda, + 0x5d, 0xfd, 0xe4, 0x83, 0x83, 0xf9, 0x73, 0x1b, 0xdd, 0x10, 0x71, 0x77, 0x3a, 0xe8, 0x16, 0x9c, + 0xe6, 0x2e, 0xbd, 0x65, 0xe2, 0x34, 0x9a, 0xae, 0xa7, 0x98, 0x01, 0xbe, 0xe5, 0xcf, 0x3e, 0x38, + 0x98, 0x3f, 0xbd, 0x98, 0x85, 0x80, 0xb3, 0xeb, 0xa1, 0x8f, 0x42, 0xa9, 0xe1, 0x85, 0x62, 0x0c, + 0x86, 0x8c, 0xfc, 0x47, 0xa5, 0xf2, 0x7a, 0x4d, 0x7d, 0x7f, 0xfc, 0x07, 0xc7, 0x15, 0xd0, 0x36, + 0x97, 0x15, 0x2b, 0x09, 0xc6, 0x70, 0x2a, 0xa4, 0x51, 0x52, 0xc8, 0x67, 0x38, 0xf5, 0x71, 0x25, + 0x89, 0xb2, 0x75, 0x37, 0xfc, 0xfd, 0x0c, 0xc2, 0xe8, 0x75, 0x40, 0xf4, 0x05, 0xe1, 0xd6, 0xc9, + 0x62, 0x9d, 0xa5, 0x85, 0x60, 0xa2, 0xf5, 0x11, 0xd3, 0xcd, 0xac, 0x96, 0xc2, 0xc0, 0x19, 0xb5, + 0xd0, 0x75, 0x7a, 0xaa, 0xe8, 0xa5, 0xe2, 0xd4, 0x52, 0xd9, 0xea, 0xca, 0xa4, 0x1d, 0x90, 0xba, + 0x13, 0x91, 0x86, 0x49, 0x11, 0x27, 0xea, 0xa1, 0x06, 0x3c, 0xe1, 0x74, 0x22, 0x9f, 0x89, 0xe1, + 0x4d, 0xd4, 0x0d, 0x7f, 0x97, 0x78, 0x4c, 0x03, 0x36, 0xb2, 0x74, 0x81, 0x72, 0x1b, 0x8b, 0x5d, + 0xf0, 0x70, 0x57, 0x2a, 0x94, 0x4b, 0x54, 0xe9, 0x69, 0xc1, 0x0c, 0xd4, 0x94, 0x91, 0xa2, 0xf6, + 0x25, 0x18, 0xdd, 0xf1, 0xc3, 0x68, 0x9d, 0x44, 0xf7, 0xfc, 0x60, 0x57, 0xc4, 0xdb, 0x8c, 0x63, + 0x34, 0xc7, 0x20, 0xac, 0xe3, 0xd1, 0x67, 0x20, 0xb3, 0xcf, 0xa8, 0x94, 0x99, 0x6a, 0x7c, 0x24, + 0x3e, 0x63, 0xae, 0xf3, 0x62, 0x2c, 0xe1, 0x12, 0xb5, 0x52, 0x5d, 0x66, 0x6a, 0xee, 0x04, 0x6a, + 0xa5, 0xba, 0x8c, 0x25, 0x9c, 0x2e, 0xd7, 0x70, 0xc7, 0x09, 0x48, 0x35, 0xf0, 0xeb, 0x24, 0xd4, + 0x22, 0x83, 0x3f, 0xce, 0xa3, 0x89, 0xd2, 0xe5, 0x5a, 0xcb, 0x42, 0xc0, 0xd9, 0xf5, 0x10, 0x49, + 0x27, 0xa6, 0x9a, 0xc8, 0xd7, 0x4f, 0xa4, 0xf9, 0x99, 0x3e, 0x73, 0x53, 0x79, 0x30, 0xa5, 0x52, + 0x62, 0xf1, 0xf8, 0xa1, 0xe1, 0xec, 0x24, 0x5b, 0xdb, 0xfd, 0x07, 0x1f, 0x55, 0x1a, 0x9f, 0x4a, + 0x82, 0x12, 0x4e, 0xd1, 0x36, 0x62, 0x71, 0x4d, 0xf5, 0x8c, 0xc5, 0x75, 0x05, 0x4a, 0x61, 0x67, + 0xb3, 0xe1, 0xb7, 0x1c, 0xd7, 0x63, 0x6a, 0x6e, 0xed, 0x3d, 0x52, 0x93, 0x00, 0x1c, 0xe3, 0xa0, + 0x55, 0x18, 0x71, 0xa4, 0x3a, 0x07, 0xe5, 0x47, 0x5f, 0x51, 0x4a, 0x1c, 0x1e, 0x90, 0x40, 0x2a, + 0x70, 0x54, 0x5d, 0xf4, 0x2a, 0x8c, 0x0b, 0x97, 0x54, 0x91, 0x8d, 0x71, 0xc6, 0xf4, 0x1b, 0xaa, + 0xe9, 0x40, 0x6c, 0xe2, 0xa2, 0xdb, 0x30, 0x1a, 0xf9, 0x4d, 0xe6, 0xfc, 0x42, 0xd9, 0xbc, 0x33, + 0xf9, 0x71, 0xc4, 0x36, 0x14, 0x9a, 0x2e, 0x49, 0x55, 0x55, 0xb1, 0x4e, 0x07, 0x6d, 0xf0, 0xf5, + 0xce, 0x22, 0x64, 0x93, 0x70, 0xf6, 0xb1, 0xfc, 0x3b, 0x49, 0x05, 0xd2, 0x36, 0xb7, 0x83, 0xa8, + 0x89, 0x75, 0x32, 0xe8, 0x1a, 0x4c, 0xb7, 0x03, 0xd7, 0x67, 0x6b, 0x42, 0x69, 0xf2, 0x66, 0xcd, + 0xf4, 0x3c, 0xd5, 0x24, 0x02, 0x4e, 0xd7, 0x61, 0x1e, 0xc5, 0xa2, 0x70, 0xf6, 0x2c, 0x4f, 0xd8, + 0xcc, 0x9f, 0x77, 0xbc, 0x0c, 0x2b, 0x28, 0x5a, 0x63, 0x27, 0x31, 0x97, 0x4c, 0xcc, 0xce, 0xe5, + 0x07, 0x7c, 0xd1, 0x25, 0x18, 0x9c, 0x79, 0x55, 0x7f, 0x71, 0x4c, 0x01, 0x35, 0xb4, 0xcc, 0x7e, + 0xf4, 0xc5, 0x10, 0xce, 0x3e, 0xd1, 0xc5, 0x48, 0x2e, 0xf1, 0xbc, 0x88, 0x19, 0x02, 0xa3, 0x38, + 0xc4, 0x09, 0x9a, 0xe8, 0xe3, 0x30, 0x25, 0xc2, 0xd4, 0xc5, 0xc3, 0x74, 0x2e, 0x36, 0x29, 0xc6, + 0x09, 0x18, 0x4e, 0x61, 0xf3, 0xcc, 0x01, 0xce, 0x66, 0x93, 0x88, 0xa3, 0xef, 0xa6, 0xeb, 0xed, + 0x86, 0xb3, 0xe7, 0xd9, 0xf9, 0x20, 0x32, 0x07, 0x24, 0xa1, 0x38, 0xa3, 0x06, 0xda, 0x80, 0xa9, + 0x76, 0x40, 0x48, 0x8b, 0x31, 0xfa, 0xe2, 0x3e, 0x9b, 0xe7, 0x0e, 0xf5, 0xb4, 0x27, 0xd5, 0x04, + 0xec, 0x30, 0xa3, 0x0c, 0xa7, 0x28, 0xa0, 0x7b, 0x30, 0xe2, 0xef, 0x91, 0x60, 0x87, 0x38, 0x8d, + 0xd9, 0x0b, 0x5d, 0x4c, 0xdc, 0xc5, 0xe5, 0x76, 0x4b, 0xe0, 0x26, 0xb4, 0xff, 0xb2, 0xb8, 0xb7, + 0xf6, 0x5f, 0x36, 0x86, 0x7e, 0xc8, 0x82, 0xb3, 0x52, 0x61, 0x50, 0x6b, 0xd3, 0x51, 0x5f, 0xf6, + 0xbd, 0x30, 0x0a, 0xb8, 0x0b, 0xf8, 0x93, 0xf9, 0x6e, 0xd1, 0x1b, 0x39, 0x95, 0x94, 0x70, 0xf4, + 0x6c, 0x1e, 0x46, 0x88, 0xf3, 0x5b, 0x44, 0xcb, 0x30, 0x1d, 0x92, 0x48, 0x1e, 0x46, 0x8b, 0xe1, + 0xea, 0x1b, 0xe5, 0xf5, 0xd9, 0x8b, 0xdc, 0x7f, 0x9d, 0x6e, 0x86, 0x5a, 0x12, 0x88, 0xd3, 0xf8, + 0x73, 0xdf, 0x0a, 0xd3, 0xa9, 0xeb, 0xff, 0x28, 0x19, 0x51, 0xe6, 0x76, 0x61, 0xdc, 0x18, 0xe2, + 0x47, 0xaa, 0x3d, 0xfe, 0x57, 0xc3, 0x50, 0x52, 0x9a, 0x45, 0x74, 0xc5, 0x54, 0x18, 0x9f, 0x4d, + 0x2a, 0x8c, 0x47, 0xe8, 0xbb, 0x5e, 0xd7, 0x11, 0x6f, 0x64, 0x44, 0xed, 0xca, 0xdb, 0xd0, 0xfd, + 0xbb, 0x63, 0x6b, 0xe2, 0xda, 0x62, 0xdf, 0x9a, 0xe7, 0x81, 0xae, 0x12, 0xe0, 0x6b, 0x30, 0xed, + 0xf9, 0x8c, 0xe7, 0x24, 0x0d, 0xc9, 0x50, 0x30, 0xbe, 0xa1, 0xa4, 0x87, 0xc1, 0x48, 0x20, 0xe0, + 0x74, 0x1d, 0xda, 0x20, 0xbf, 0xf8, 0x93, 0x22, 0x67, 0xce, 0x17, 0x60, 0x01, 0x45, 0x17, 0x61, + 0xb0, 0xed, 0x37, 0x2a, 0x55, 0xc1, 0x6f, 0x6a, 0xb1, 0x22, 0x1b, 0x95, 0x2a, 0xe6, 0x30, 0xb4, + 0x08, 0x43, 0xec, 0x47, 0x38, 0x3b, 0x96, 0x1f, 0xef, 0x80, 0xd5, 0xd0, 0xf2, 0xcd, 0xb0, 0x0a, + 0x58, 0x54, 0x64, 0xa2, 0x2f, 0xca, 0xa4, 0x33, 0xd1, 0xd7, 0xf0, 0x43, 0x8a, 0xbe, 0x24, 0x01, + 0x1c, 0xd3, 0x42, 0xf7, 0xe1, 0xb4, 0xf1, 0x30, 0xe2, 0x4b, 0x84, 0x84, 0xc2, 0xe7, 0xfa, 0x62, + 0xd7, 0x17, 0x91, 0xd0, 0x54, 0x9f, 0x13, 0x9d, 0x3e, 0x5d, 0xc9, 0xa2, 0x84, 0xb3, 0x1b, 0x40, + 0x4d, 0x98, 0xae, 0xa7, 0x5a, 0x1d, 0xe9, 0xbf, 0x55, 0x35, 0xa1, 0xe9, 0x16, 0xd3, 0x84, 0xd1, + 0xab, 0x30, 0xf2, 0x96, 0x1f, 0xb2, 0xb3, 0x5a, 0xf0, 0xc8, 0xd2, 0x61, 0x77, 0xe4, 0x8d, 0x5b, + 0x35, 0x56, 0x7e, 0x78, 0x30, 0x3f, 0x5a, 0xf5, 0x1b, 0xf2, 0x2f, 0x56, 0x15, 0xd0, 0xf7, 0x5a, + 0x30, 0x97, 0x7e, 0x79, 0xa9, 0x4e, 0x8f, 0xf7, 0xdf, 0x69, 0x5b, 0x34, 0x3a, 0xb7, 0x92, 0x4b, + 0x0e, 0x77, 0x69, 0xca, 0xfe, 0x65, 0x8b, 0x49, 0xdd, 0x84, 0x06, 0x88, 0x84, 0x9d, 0xe6, 0x49, + 0xa4, 0xd9, 0x5c, 0x31, 0x94, 0x53, 0x0f, 0x6d, 0xb9, 0xf0, 0xcf, 0x2d, 0x66, 0xb9, 0x70, 0x82, + 0x2e, 0x0a, 0x6f, 0xc0, 0x48, 0x24, 0xd3, 0x9f, 0x76, 0xc9, 0x0c, 0xaa, 0x75, 0x8a, 0x59, 0x6f, + 0x28, 0x8e, 0x55, 0x65, 0x3a, 0x55, 0x64, 0xec, 0x7f, 0xc4, 0x67, 0x40, 0x42, 0x4e, 0x40, 0x07, + 0x50, 0x36, 0x75, 0x00, 0xf3, 0x3d, 0xbe, 0x20, 0x47, 0x17, 0xf0, 0x0f, 0xcd, 0x7e, 0x33, 0x49, + 0xcd, 0xbb, 0xdd, 0x64, 0xc6, 0xfe, 0xa2, 0x05, 0x10, 0x87, 0xe2, 0x65, 0xf2, 0x65, 0x3f, 0x90, + 0x39, 0x16, 0xb3, 0xb2, 0x09, 0xbd, 0x4c, 0x79, 0x54, 0x3f, 0xf2, 0xeb, 0x7e, 0x53, 0x68, 0xb8, + 0x9e, 0x88, 0xd5, 0x10, 0xbc, 0xfc, 0x50, 0xfb, 0x8d, 0x15, 0x36, 0x9a, 0x97, 0x81, 0xbf, 0x8a, + 0xb1, 0x62, 0xcc, 0x08, 0xfa, 0xf5, 0x23, 0x16, 0x9c, 0xca, 0xb2, 0x77, 0xa5, 0x2f, 0x1e, 0x2e, + 0xb3, 0x52, 0xe6, 0x4c, 0x6a, 0x36, 0xef, 0x88, 0x72, 0xac, 0x30, 0xfa, 0xce, 0x1c, 0x76, 0xb4, + 0x18, 0xb8, 0xb7, 0x60, 0xbc, 0x1a, 0x10, 0xed, 0x72, 0x7d, 0x8d, 0x3b, 0x93, 0xf3, 0xfe, 0x3c, + 0x7b, 0x64, 0x47, 0x72, 0xfb, 0x67, 0x0a, 0x70, 0x8a, 0x5b, 0x05, 0x2c, 0xee, 0xf9, 0x6e, 0xa3, + 0xea, 0x37, 0x44, 0xd6, 0xb7, 0x4f, 0xc1, 0x58, 0x5b, 0x13, 0x34, 0x76, 0x8b, 0xe7, 0xa8, 0x0b, + 0x24, 0x63, 0xd1, 0x88, 0x5e, 0x8a, 0x0d, 0x5a, 0xa8, 0x01, 0x63, 0x64, 0xcf, 0xad, 0x2b, 0xd5, + 0x72, 0xe1, 0xc8, 0x17, 0x9d, 0x6a, 0x65, 0x45, 0xa3, 0x83, 0x0d, 0xaa, 0x8f, 0x20, 0x9f, 0xaf, + 0xfd, 0xa3, 0x16, 0x3c, 0x96, 0x13, 0xfd, 0x91, 0x36, 0x77, 0x8f, 0xd9, 0x5f, 0x88, 0x65, 0xab, + 0x9a, 0xe3, 0x56, 0x19, 0x58, 0x40, 0xd1, 0x27, 0x00, 0xb8, 0x55, 0x05, 0x7d, 0x72, 0xf7, 0x0a, + 0x93, 0x67, 0x44, 0xf8, 0xd2, 0x82, 0x35, 0xc9, 0xfa, 0x58, 0xa3, 0x65, 0x7f, 0x69, 0x00, 0x06, + 0x79, 0xee, 0xf1, 0x55, 0x18, 0xde, 0xe1, 0xb9, 0x30, 0xfa, 0x49, 0xbb, 0x11, 0x0b, 0x43, 0x78, + 0x01, 0x96, 0x95, 0xd1, 0x1a, 0xcc, 0xf0, 0x5c, 0x22, 0xcd, 0x32, 0x69, 0x3a, 0xfb, 0x52, 0x72, + 0xc7, 0xf3, 0x70, 0x2a, 0x09, 0x66, 0x25, 0x8d, 0x82, 0xb3, 0xea, 0xa1, 0xd7, 0x60, 0x82, 0xbe, + 0xa4, 0xfc, 0x4e, 0x24, 0x29, 0xf1, 0x2c, 0x22, 0xea, 0xe9, 0xb6, 0x61, 0x40, 0x71, 0x02, 0x9b, + 0x3e, 0xe6, 0xdb, 0x29, 0x19, 0xe5, 0x60, 0xfc, 0x98, 0x37, 0xe5, 0x92, 0x26, 0x2e, 0x33, 0x74, + 0xed, 0x30, 0xb3, 0xde, 0x8d, 0x9d, 0x80, 0x84, 0x3b, 0x7e, 0xb3, 0xc1, 0x98, 0xbe, 0x41, 0xcd, + 0xd0, 0x35, 0x01, 0xc7, 0xa9, 0x1a, 0x94, 0xca, 0x96, 0xe3, 0x36, 0x3b, 0x01, 0x89, 0xa9, 0x0c, + 0x99, 0x54, 0x56, 0x13, 0x70, 0x9c, 0xaa, 0xd1, 0x5b, 0xf8, 0x3a, 0x7c, 0x3c, 0xc2, 0x57, 0xba, + 0x60, 0x4f, 0x57, 0x03, 0x9f, 0x9e, 0xd8, 0x32, 0x76, 0x8e, 0x32, 0x93, 0x1e, 0x96, 0x6e, 0xbe, + 0x5d, 0xa2, 0xcc, 0x09, 0x43, 0x52, 0x4e, 0xc1, 0xb0, 0x54, 0xa8, 0x09, 0x07, 0x5f, 0x49, 0x05, + 0x5d, 0x85, 0x51, 0x91, 0x8a, 0x82, 0x59, 0xf3, 0xf2, 0x35, 0xc2, 0x2c, 0x2b, 0xca, 0x71, 0x31, + 0xd6, 0x71, 0xec, 0xef, 0x2b, 0xc0, 0x4c, 0x86, 0x3b, 0x06, 0x3f, 0x13, 0xb7, 0xdd, 0x30, 0x52, + 0x49, 0x0d, 0xb5, 0x33, 0x91, 0x97, 0x63, 0x85, 0x41, 0x37, 0x1e, 0x3f, 0x75, 0x93, 0x27, 0xad, + 0x30, 0x77, 0x16, 0xd0, 0x23, 0xa6, 0x07, 0xbc, 0x00, 0x03, 0x9d, 0x90, 0xc8, 0xf8, 0x90, 0xea, + 0x0e, 0x62, 0x0a, 0x37, 0x06, 0xa1, 0x6f, 0x82, 0x6d, 0xa5, 0xbb, 0xd2, 0xde, 0x04, 0x5c, 0x7b, + 0xc5, 0x61, 0xb4, 0x73, 0x11, 0xf1, 0x1c, 0x2f, 0x12, 0x2f, 0x87, 0x38, 0xd0, 0x19, 0x2b, 0xc5, + 0x02, 0x6a, 0x7f, 0xa9, 0x08, 0x67, 0x73, 0x1d, 0xb4, 0x68, 0xd7, 0x5b, 0xbe, 0xe7, 0x46, 0xbe, + 0x32, 0x59, 0xe1, 0xc1, 0xcd, 0x48, 0x7b, 0x67, 0x4d, 0x94, 0x63, 0x85, 0x81, 0x2e, 0xc1, 0x20, + 0x13, 0xd7, 0xa5, 0xd2, 0x3b, 0x2e, 0x95, 0x79, 0xb4, 0x1b, 0x0e, 0xee, 0x3b, 0x75, 0xee, 0x45, + 0x7a, 0x1d, 0xfb, 0xcd, 0xe4, 0xe9, 0x48, 0xbb, 0xeb, 0xfb, 0x4d, 0xcc, 0x80, 0xe8, 0x03, 0x62, + 0xbc, 0x12, 0x36, 0x1a, 0xd8, 0x69, 0xf8, 0xa1, 0x36, 0x68, 0x4f, 0xc3, 0xf0, 0x2e, 0xd9, 0x0f, + 0x5c, 0x6f, 0x3b, 0x69, 0xbb, 0x73, 0x83, 0x17, 0x63, 0x09, 0x37, 0x33, 0x75, 0x0d, 0x1f, 0x77, + 0xce, 0xdb, 0x91, 0x9e, 0x77, 0xed, 0x0f, 0x14, 0x61, 0x12, 0x2f, 0x95, 0xdf, 0x9b, 0x88, 0xdb, + 0xe9, 0x89, 0x38, 0xee, 0x9c, 0xb7, 0xbd, 0x67, 0xe3, 0x17, 0x2c, 0x98, 0x64, 0x09, 0x31, 0x44, + 0x58, 0x2c, 0xd7, 0xf7, 0x4e, 0x80, 0xaf, 0xbd, 0x08, 0x83, 0x01, 0x6d, 0x34, 0x99, 0xd7, 0x91, + 0xf5, 0x04, 0x73, 0x18, 0x7a, 0x02, 0x06, 0x58, 0x17, 0xe8, 0xe4, 0x8d, 0xf1, 0x94, 0x58, 0x65, + 0x27, 0x72, 0x30, 0x2b, 0x65, 0xb1, 0x5e, 0x30, 0x69, 0x37, 0x5d, 0xde, 0xe9, 0x58, 0x99, 0xfa, + 0xee, 0x70, 0xdd, 0xce, 0xec, 0xda, 0x3b, 0x8b, 0xf5, 0x92, 0x4d, 0xb2, 0xfb, 0x9b, 0xf1, 0x8f, + 0x0b, 0x70, 0x3e, 0xb3, 0x5e, 0xdf, 0xb1, 0x5e, 0xba, 0xd7, 0x7e, 0x94, 0x29, 0x0f, 0x8a, 0x27, + 0x68, 0x19, 0x39, 0xd0, 0x2f, 0x2b, 0x3b, 0xd8, 0x47, 0x08, 0x96, 0xcc, 0x21, 0x7b, 0x97, 0x84, + 0x60, 0xc9, 0xec, 0x5b, 0xce, 0x9b, 0xf7, 0x2f, 0x0a, 0x39, 0xdf, 0xc2, 0x5e, 0xbf, 0x97, 0xe9, + 0x39, 0xc3, 0x80, 0xa1, 0x7c, 0x51, 0xf2, 0x33, 0x86, 0x97, 0x61, 0x05, 0x45, 0x8b, 0x30, 0xd9, + 0x72, 0x3d, 0x7a, 0xf8, 0xec, 0x9b, 0x1c, 0xa6, 0x8a, 0x90, 0xb5, 0x66, 0x82, 0x71, 0x12, 0x1f, + 0xb9, 0x5a, 0x78, 0x96, 0x42, 0x7e, 0xa6, 0xf4, 0xdc, 0xde, 0x2e, 0x98, 0x8a, 0x66, 0x35, 0x8a, + 0x19, 0xa1, 0x5a, 0xd6, 0x34, 0xa1, 0x47, 0xb1, 0x7f, 0xa1, 0xc7, 0x58, 0xb6, 0xc0, 0x63, 0xee, + 0x55, 0x18, 0x7f, 0x68, 0x29, 0xb7, 0xfd, 0xd5, 0x22, 0x3c, 0xde, 0x65, 0xdb, 0xf3, 0xb3, 0xde, + 0x98, 0x03, 0xed, 0xac, 0x4f, 0xcd, 0x43, 0x15, 0x4e, 0x6d, 0x75, 0x9a, 0xcd, 0x7d, 0xe6, 0x30, + 0x40, 0x1a, 0x12, 0x43, 0xf0, 0x94, 0xf2, 0xa5, 0x7f, 0x6a, 0x35, 0x03, 0x07, 0x67, 0xd6, 0xa4, + 0x2f, 0x07, 0x7a, 0x93, 0xec, 0x2b, 0x52, 0x89, 0x97, 0x03, 0xd6, 0x81, 0xd8, 0xc4, 0x45, 0xd7, + 0x60, 0xda, 0xd9, 0x73, 0x5c, 0x1e, 0xe3, 0x56, 0x12, 0xe0, 0x4f, 0x07, 0x25, 0x9c, 0x5c, 0x4c, + 0x22, 0xe0, 0x74, 0x1d, 0xf4, 0x3a, 0x20, 0x7f, 0x93, 0x99, 0x15, 0x37, 0xae, 0x11, 0x4f, 0xe8, + 0x03, 0xd9, 0xdc, 0x15, 0xe3, 0x23, 0xe1, 0x56, 0x0a, 0x03, 0x67, 0xd4, 0x4a, 0x84, 0x3b, 0x19, + 0xca, 0x0f, 0x77, 0xd2, 0xfd, 0x5c, 0xec, 0x99, 0x6d, 0xe3, 0x3f, 0x59, 0xf4, 0xfa, 0xe2, 0x4c, + 0xbe, 0x19, 0xb5, 0xef, 0x55, 0x66, 0xcf, 0xc7, 0x05, 0x97, 0x5a, 0x90, 0x8e, 0xd3, 0x9a, 0x3d, + 0x5f, 0x0c, 0xc4, 0x26, 0x2e, 0x5f, 0x10, 0x61, 0xec, 0x1b, 0x6a, 0xb0, 0xf8, 0x22, 0xb4, 0x90, + 0xc2, 0x40, 0x9f, 0x84, 0xe1, 0x86, 0xbb, 0xe7, 0x86, 0x42, 0x6c, 0x73, 0x64, 0x1d, 0x49, 0x7c, + 0x0e, 0x96, 0x39, 0x19, 0x2c, 0xe9, 0xd9, 0x3f, 0x50, 0x80, 0x71, 0xd9, 0xe2, 0x1b, 0x1d, 0x3f, + 0x72, 0x4e, 0xe0, 0x5a, 0xbe, 0x66, 0x5c, 0xcb, 0x1f, 0xe8, 0x16, 0x5f, 0x89, 0x75, 0x29, 0xf7, + 0x3a, 0xbe, 0x95, 0xb8, 0x8e, 0x9f, 0xea, 0x4d, 0xaa, 0xfb, 0x35, 0xfc, 0x8f, 0x2d, 0x98, 0x36, + 0xf0, 0x4f, 0xe0, 0x36, 0x58, 0x35, 0x6f, 0x83, 0x27, 0x7b, 0x7e, 0x43, 0xce, 0x2d, 0xf0, 0xdd, + 0xc5, 0x44, 0xdf, 0xd9, 0xe9, 0xff, 0x16, 0x0c, 0xec, 0x38, 0x41, 0xa3, 0x5b, 0x3c, 0xf9, 0x54, + 0xa5, 0x85, 0xeb, 0x4e, 0x20, 0x14, 0xa2, 0xcf, 0xaa, 0x44, 0xe5, 0x4e, 0xd0, 0x5b, 0x19, 0xca, + 0x9a, 0x42, 0x2f, 0xc3, 0x50, 0x58, 0xf7, 0xdb, 0xca, 0x5d, 0xe0, 0x02, 0x4f, 0x62, 0x4e, 0x4b, + 0x0e, 0x0f, 0xe6, 0x91, 0xd9, 0x1c, 0x2d, 0xc6, 0x02, 0x1f, 0x7d, 0x0a, 0xc6, 0xd9, 0x2f, 0x65, + 0x9d, 0x54, 0xcc, 0xcf, 0x3d, 0x55, 0xd3, 0x11, 0xb9, 0xe9, 0x9e, 0x51, 0x84, 0x4d, 0x52, 0x73, + 0xdb, 0x50, 0x52, 0x9f, 0xf5, 0x48, 0x95, 0x90, 0xff, 0xbe, 0x08, 0x33, 0x19, 0x6b, 0x0e, 0x85, + 0xc6, 0x4c, 0x5c, 0xed, 0x73, 0xa9, 0xbe, 0xc3, 0xb9, 0x08, 0xd9, 0x6b, 0xa8, 0x21, 0xd6, 0x56, + 0xdf, 0x8d, 0xde, 0x0e, 0x49, 0xb2, 0x51, 0x5a, 0xd4, 0xbb, 0x51, 0xda, 0xd8, 0x89, 0x0d, 0x35, + 0x6d, 0x48, 0xf5, 0xf4, 0x91, 0xce, 0xe9, 0x9f, 0x15, 0xe1, 0x54, 0x56, 0xc8, 0x37, 0xf4, 0xf9, + 0x44, 0x36, 0xc3, 0x17, 0xfb, 0x0d, 0x16, 0xc7, 0x53, 0x1c, 0x72, 0x61, 0xf3, 0xd2, 0x82, 0x99, + 0xdf, 0xb0, 0xe7, 0x30, 0x8b, 0x36, 0x59, 0xdc, 0x83, 0x80, 0x67, 0xa1, 0x94, 0xc7, 0xc7, 0x87, + 0xfb, 0xee, 0x80, 0x48, 0x5f, 0x19, 0x26, 0x2c, 0x1f, 0x64, 0x71, 0x6f, 0xcb, 0x07, 0xd9, 0xf2, + 0x9c, 0x0b, 0xa3, 0xda, 0xd7, 0x3c, 0xd2, 0x19, 0xdf, 0xa5, 0xb7, 0x95, 0xd6, 0xef, 0x47, 0x3a, + 0xeb, 0x3f, 0x6a, 0x41, 0xc2, 0x18, 0x5e, 0x89, 0xc5, 0xac, 0x5c, 0xb1, 0xd8, 0x05, 0x18, 0x08, + 0xfc, 0x26, 0x49, 0xa6, 0xfd, 0xc3, 0x7e, 0x93, 0x60, 0x06, 0xa1, 0x18, 0x51, 0x2c, 0xec, 0x18, + 0xd3, 0x1f, 0x72, 0xe2, 0x89, 0x76, 0x11, 0x06, 0x9b, 0x64, 0x8f, 0x34, 0x93, 0xd9, 0x59, 0x6e, + 0xd2, 0x42, 0xcc, 0x61, 0xf6, 0x2f, 0x0c, 0xc0, 0xb9, 0xae, 0x91, 0x43, 0xe8, 0x73, 0x68, 0xdb, + 0x89, 0xc8, 0x3d, 0x67, 0x3f, 0x99, 0x46, 0xe1, 0x1a, 0x2f, 0xc6, 0x12, 0xce, 0xdc, 0x95, 0x78, + 0x34, 0xe4, 0x84, 0x10, 0x51, 0x04, 0x41, 0x16, 0x50, 0x53, 0x28, 0x55, 0x3c, 0x0e, 0xa1, 0xd4, + 0xf3, 0x00, 0x61, 0xd8, 0xe4, 0x26, 0x43, 0x0d, 0xe1, 0x07, 0x15, 0x47, 0xcd, 0xae, 0xdd, 0x14, + 0x10, 0xac, 0x61, 0xa1, 0x32, 0x4c, 0xb5, 0x03, 0x3f, 0xe2, 0x32, 0xd9, 0x32, 0xb7, 0xaa, 0x1b, + 0x34, 0x83, 0x36, 0x54, 0x13, 0x70, 0x9c, 0xaa, 0x81, 0x5e, 0x82, 0x51, 0x11, 0xc8, 0xa1, 0xea, + 0xfb, 0x4d, 0x21, 0x06, 0x52, 0x86, 0x66, 0xb5, 0x18, 0x84, 0x75, 0x3c, 0xad, 0x1a, 0x13, 0xf4, + 0x0e, 0x67, 0x56, 0xe3, 0xc2, 0x5e, 0x0d, 0x2f, 0x11, 0xfe, 0x71, 0xa4, 0xaf, 0xf0, 0x8f, 0xb1, + 0x60, 0xac, 0xd4, 0xb7, 0x12, 0x0d, 0x7a, 0x8a, 0x92, 0x7e, 0x76, 0x00, 0x66, 0xc4, 0xc2, 0x79, + 0xd4, 0xcb, 0xe5, 0x76, 0x7a, 0xb9, 0x1c, 0x87, 0xe8, 0xec, 0xbd, 0x35, 0x73, 0xd2, 0x6b, 0xe6, + 0x07, 0x2d, 0x30, 0xd9, 0x2b, 0xf4, 0xff, 0xe4, 0xe6, 0xa1, 0x79, 0x29, 0x97, 0x5d, 0x6b, 0xc8, + 0x0b, 0xe4, 0x1d, 0x66, 0xa4, 0xb1, 0xff, 0xa3, 0x05, 0x4f, 0xf6, 0xa4, 0x88, 0x56, 0xa0, 0xc4, + 0x78, 0x40, 0xed, 0x75, 0xf6, 0x94, 0xb2, 0xba, 0x95, 0x80, 0x1c, 0x96, 0x34, 0xae, 0x89, 0x56, + 0x52, 0x09, 0x7f, 0x9e, 0xce, 0x48, 0xf8, 0x73, 0xda, 0x18, 0x9e, 0x87, 0xcc, 0xf8, 0xf3, 0xfd, + 0xf4, 0xc6, 0x31, 0x3c, 0x5e, 0xd0, 0x87, 0x0d, 0xb1, 0x9f, 0x9d, 0x10, 0xfb, 0x21, 0x13, 0x5b, + 0xbb, 0x43, 0x3e, 0x0e, 0x53, 0x2c, 0xc2, 0x13, 0xb3, 0x01, 0x17, 0xbe, 0x38, 0x85, 0xd8, 0xce, + 0xf3, 0x66, 0x02, 0x86, 0x53, 0xd8, 0xf6, 0x1f, 0x15, 0x61, 0x88, 0x6f, 0xbf, 0x13, 0x78, 0x13, + 0x3e, 0x03, 0x25, 0xb7, 0xd5, 0xea, 0xf0, 0x1c, 0x2e, 0x83, 0xdc, 0x01, 0x97, 0xce, 0x53, 0x45, + 0x16, 0xe2, 0x18, 0x8e, 0x56, 0x85, 0xc4, 0xb9, 0x4b, 0x10, 0x49, 0xde, 0xf1, 0x85, 0xb2, 0x13, + 0x39, 0x9c, 0xc1, 0x51, 0xf7, 0x6c, 0x2c, 0x9b, 0x46, 0x9f, 0x01, 0x08, 0xa3, 0xc0, 0xf5, 0xb6, + 0x69, 0x99, 0x88, 0x99, 0xfa, 0xc1, 0x2e, 0xd4, 0x6a, 0x0a, 0x99, 0xd3, 0x8c, 0xcf, 0x1c, 0x05, + 0xc0, 0x1a, 0x45, 0xb4, 0x60, 0xdc, 0xf4, 0x73, 0x89, 0xb9, 0x03, 0x4e, 0x35, 0x9e, 0xb3, 0xb9, + 0x8f, 0x40, 0x49, 0x11, 0xef, 0x25, 0x7f, 0x1a, 0xd3, 0xd9, 0xa2, 0x8f, 0xc1, 0x64, 0xa2, 0x6f, + 0x47, 0x12, 0x5f, 0xfd, 0xa2, 0x05, 0x93, 0xbc, 0x33, 0x2b, 0xde, 0x9e, 0xb8, 0x0d, 0xde, 0x86, + 0x53, 0xcd, 0x8c, 0x53, 0x59, 0x4c, 0x7f, 0xff, 0xa7, 0xb8, 0x12, 0x57, 0x65, 0x41, 0x71, 0x66, + 0x1b, 0xe8, 0x32, 0xdd, 0x71, 0xf4, 0xd4, 0x75, 0x9a, 0xc2, 0x1f, 0x77, 0x8c, 0xef, 0x36, 0x5e, + 0x86, 0x15, 0xd4, 0xfe, 0x5d, 0x0b, 0xa6, 0x79, 0xcf, 0x6f, 0x90, 0x7d, 0x75, 0x36, 0x7d, 0x3d, + 0xfb, 0x2e, 0xb2, 0x87, 0x15, 0x72, 0xb2, 0x87, 0xe9, 0x9f, 0x56, 0xec, 0xfa, 0x69, 0x3f, 0x63, + 0x81, 0x58, 0x21, 0x27, 0x20, 0x84, 0xf8, 0x56, 0x53, 0x08, 0x31, 0x97, 0xbf, 0x09, 0x72, 0xa4, + 0x0f, 0x7f, 0x6e, 0xc1, 0x14, 0x47, 0x88, 0xb5, 0xe5, 0x5f, 0xd7, 0x79, 0xe8, 0x27, 0xc7, 0xf0, + 0x0d, 0xb2, 0xbf, 0xe1, 0x57, 0x9d, 0x68, 0x27, 0xfb, 0xa3, 0x8c, 0xc9, 0x1a, 0xe8, 0x3a, 0x59, + 0x0d, 0xb9, 0x81, 0x8e, 0x90, 0xb8, 0xfc, 0xc8, 0xc9, 0x35, 0xec, 0xaf, 0x59, 0x80, 0x78, 0x33, + 0x06, 0xe3, 0x46, 0xd9, 0x21, 0x56, 0xaa, 0x5d, 0x74, 0xf1, 0xd1, 0xa4, 0x20, 0x58, 0xc3, 0x3a, + 0x96, 0xe1, 0x49, 0x98, 0x3c, 0x14, 0x7b, 0x9b, 0x3c, 0x1c, 0x61, 0x44, 0xff, 0xf5, 0x10, 0x24, + 0xbd, 0x7e, 0xd0, 0x1d, 0x18, 0xab, 0x3b, 0x6d, 0x67, 0xd3, 0x6d, 0xba, 0x91, 0x4b, 0xc2, 0x6e, + 0x46, 0x59, 0xcb, 0x1a, 0x9e, 0x50, 0x52, 0x6b, 0x25, 0xd8, 0xa0, 0x83, 0x16, 0x00, 0xda, 0x81, + 0xbb, 0xe7, 0x36, 0xc9, 0x36, 0x93, 0x95, 0xb0, 0x08, 0x00, 0xdc, 0xd2, 0x48, 0x96, 0x62, 0x0d, + 0x23, 0xc3, 0xc5, 0xba, 0xf8, 0x88, 0x5d, 0xac, 0xe1, 0xc4, 0x5c, 0xac, 0x07, 0x8e, 0xe4, 0x62, + 0x3d, 0x72, 0x64, 0x17, 0xeb, 0xc1, 0xbe, 0x5c, 0xac, 0x31, 0x9c, 0x91, 0xbc, 0x27, 0xfd, 0xbf, + 0xea, 0x36, 0x89, 0x78, 0x70, 0xf0, 0xb0, 0x05, 0x73, 0x0f, 0x0e, 0xe6, 0xcf, 0xe0, 0x4c, 0x0c, + 0x9c, 0x53, 0x13, 0x7d, 0x02, 0x66, 0x9d, 0x66, 0xd3, 0xbf, 0xa7, 0x26, 0x75, 0x25, 0xac, 0x3b, + 0x4d, 0xae, 0x84, 0x18, 0x66, 0x54, 0x9f, 0x78, 0x70, 0x30, 0x3f, 0xbb, 0x98, 0x83, 0x83, 0x73, + 0x6b, 0xa3, 0x8f, 0x42, 0xa9, 0x1d, 0xf8, 0xf5, 0x35, 0xcd, 0x35, 0xf1, 0x3c, 0x1d, 0xc0, 0xaa, + 0x2c, 0x3c, 0x3c, 0x98, 0x1f, 0x57, 0x7f, 0xd8, 0x85, 0x1f, 0x57, 0xc8, 0xf0, 0x99, 0x1e, 0x3d, + 0x56, 0x9f, 0xe9, 0x5d, 0x98, 0xa9, 0x91, 0xc0, 0x65, 0x69, 0xce, 0x1b, 0xf1, 0xf9, 0xb4, 0x01, + 0xa5, 0x20, 0x71, 0x22, 0xf7, 0x15, 0xd8, 0x51, 0xcb, 0x72, 0x20, 0x4f, 0xe0, 0x98, 0x90, 0xfd, + 0xbf, 0x2c, 0x18, 0x16, 0x5e, 0x3e, 0x27, 0xc0, 0x35, 0x2e, 0x1a, 0x9a, 0x84, 0xf9, 0xec, 0x01, + 0x63, 0x9d, 0xc9, 0xd5, 0x21, 0x54, 0x12, 0x3a, 0x84, 0x27, 0xbb, 0x11, 0xe9, 0xae, 0x3d, 0xf8, + 0x6b, 0x45, 0xca, 0xbd, 0x1b, 0xfe, 0xa6, 0x8f, 0x7e, 0x08, 0xd6, 0x61, 0x38, 0x14, 0xfe, 0x8e, + 0x85, 0x7c, 0x03, 0xfd, 0xe4, 0x24, 0xc6, 0x76, 0x6c, 0xc2, 0xc3, 0x51, 0x12, 0xc9, 0x74, 0xa4, + 0x2c, 0x3e, 0x42, 0x47, 0xca, 0x5e, 0x1e, 0xb9, 0x03, 0xc7, 0xe1, 0x91, 0x6b, 0x7f, 0x85, 0xdd, + 0x9c, 0x7a, 0xf9, 0x09, 0x30, 0x55, 0xd7, 0xcc, 0x3b, 0xd6, 0xee, 0xb2, 0xb2, 0x44, 0xa7, 0x72, + 0x98, 0xab, 0x9f, 0xb7, 0xe0, 0x5c, 0xc6, 0x57, 0x69, 0x9c, 0xd6, 0xb3, 0x30, 0xe2, 0x74, 0x1a, + 0xae, 0xda, 0xcb, 0x9a, 0x3e, 0x71, 0x51, 0x94, 0x63, 0x85, 0x81, 0x96, 0x61, 0x9a, 0xdc, 0x6f, + 0xbb, 0x5c, 0x95, 0xaa, 0x5b, 0xb5, 0x16, 0xb9, 0x6b, 0xd8, 0x4a, 0x12, 0x88, 0xd3, 0xf8, 0x2a, + 0x0a, 0x4a, 0x31, 0x37, 0x0a, 0xca, 0xdf, 0xb5, 0x60, 0x54, 0x79, 0xfc, 0x3d, 0xf2, 0xd1, 0xfe, + 0xb8, 0x39, 0xda, 0x8f, 0x77, 0x19, 0xed, 0x9c, 0x61, 0xfe, 0xed, 0x82, 0xea, 0x6f, 0xd5, 0x0f, + 0xa2, 0x3e, 0x38, 0xb8, 0x87, 0xb7, 0xc3, 0xbf, 0x0a, 0xa3, 0x4e, 0xbb, 0x2d, 0x01, 0xd2, 0x06, + 0x8d, 0x85, 0xe9, 0x8d, 0x8b, 0xb1, 0x8e, 0xa3, 0xdc, 0x02, 0x8a, 0xb9, 0x6e, 0x01, 0x0d, 0x80, + 0xc8, 0x09, 0xb6, 0x49, 0x44, 0xcb, 0x44, 0xc4, 0xb2, 0xfc, 0xf3, 0xa6, 0x13, 0xb9, 0xcd, 0x05, + 0xd7, 0x8b, 0xc2, 0x28, 0x58, 0xa8, 0x78, 0xd1, 0xad, 0x80, 0x3f, 0x21, 0xb5, 0x90, 0x40, 0x8a, + 0x16, 0xd6, 0xe8, 0x4a, 0xef, 0x76, 0xd6, 0xc6, 0xa0, 0x69, 0xcc, 0xb0, 0x2e, 0xca, 0xb1, 0xc2, + 0xb0, 0x3f, 0xc2, 0x6e, 0x1f, 0x36, 0xa6, 0x47, 0x8b, 0xa1, 0xf3, 0xf7, 0xc7, 0xd4, 0x6c, 0x30, + 0x4d, 0x66, 0x59, 0x8f, 0xd4, 0xd3, 0xfd, 0xb0, 0xa7, 0x0d, 0xeb, 0x4e, 0x6a, 0x71, 0x38, 0x1f, + 0xf4, 0x6d, 0x29, 0x03, 0x95, 0xe7, 0x7a, 0xdc, 0x1a, 0x47, 0x30, 0x49, 0x61, 0x39, 0x3b, 0x58, + 0x46, 0x83, 0x4a, 0x55, 0xec, 0x0b, 0x2d, 0x67, 0x87, 0x00, 0xe0, 0x18, 0x87, 0x32, 0x53, 0xea, + 0x4f, 0x38, 0x8b, 0xe2, 0xd8, 0x95, 0x0a, 0x3b, 0xc4, 0x1a, 0x06, 0xba, 0x22, 0x04, 0x0a, 0x5c, + 0x2f, 0xf0, 0x78, 0x42, 0xa0, 0x20, 0x87, 0x4b, 0x93, 0x02, 0x5d, 0x85, 0x51, 0x95, 0xb6, 0xb7, + 0xca, 0xb3, 0xc1, 0x8a, 0x65, 0xb6, 0x12, 0x17, 0x63, 0x1d, 0x07, 0x6d, 0xc0, 0x64, 0xc8, 0xe5, + 0x6c, 0x2a, 0xa0, 0x30, 0x97, 0x57, 0x7e, 0x50, 0x5a, 0x01, 0xd5, 0x4c, 0xf0, 0x21, 0x2b, 0xe2, + 0xa7, 0x93, 0xf4, 0x40, 0x4f, 0x92, 0x40, 0xaf, 0xc1, 0x44, 0xd3, 0x77, 0x1a, 0x4b, 0x4e, 0xd3, + 0xf1, 0xea, 0x6c, 0x7c, 0x46, 0xcc, 0xec, 0x8f, 0x37, 0x0d, 0x28, 0x4e, 0x60, 0x53, 0xe6, 0x4d, + 0x2f, 0x11, 0x41, 0xb0, 0x1d, 0x6f, 0x9b, 0x84, 0x22, 0x09, 0x2b, 0x63, 0xde, 0x6e, 0xe6, 0xe0, + 0xe0, 0xdc, 0xda, 0xe8, 0x65, 0x18, 0x93, 0x9f, 0xaf, 0x05, 0x6c, 0x88, 0x3d, 0x2c, 0x34, 0x18, + 0x36, 0x30, 0xd1, 0x3d, 0x38, 0x2d, 0xff, 0x6f, 0x04, 0xce, 0xd6, 0x96, 0x5b, 0x17, 0x5e, 0xcc, + 0xdc, 0x15, 0x73, 0x51, 0xfa, 0x0b, 0xae, 0x64, 0x21, 0x1d, 0x1e, 0xcc, 0x5f, 0x10, 0xa3, 0x96, + 0x09, 0x67, 0x93, 0x98, 0x4d, 0x1f, 0xad, 0xc1, 0xcc, 0x0e, 0x71, 0x9a, 0xd1, 0xce, 0xf2, 0x0e, + 0xa9, 0xef, 0xca, 0x4d, 0xc7, 0xc2, 0x40, 0x68, 0x7e, 0x09, 0xd7, 0xd3, 0x28, 0x38, 0xab, 0x1e, + 0x7a, 0x13, 0x66, 0xdb, 0x9d, 0xcd, 0xa6, 0x1b, 0xee, 0xac, 0xfb, 0x11, 0x33, 0x05, 0x52, 0x59, + 0x80, 0x45, 0xbc, 0x08, 0x15, 0x68, 0xa3, 0x9a, 0x83, 0x87, 0x73, 0x29, 0xa0, 0xb7, 0xe1, 0x74, + 0x62, 0x31, 0x08, 0x8f, 0xf9, 0x89, 0xfc, 0x94, 0x02, 0xb5, 0xac, 0x0a, 0x22, 0xf8, 0x44, 0x16, + 0x08, 0x67, 0x37, 0x81, 0x5e, 0x01, 0x70, 0xdb, 0xab, 0x4e, 0xcb, 0x6d, 0xd2, 0xe7, 0xe2, 0x0c, + 0x5b, 0x27, 0xf4, 0xe9, 0x00, 0x95, 0xaa, 0x2c, 0xa5, 0xe7, 0xb3, 0xf8, 0xb7, 0x8f, 0x35, 0x6c, + 0x54, 0x85, 0x09, 0xf1, 0x6f, 0x5f, 0x4c, 0xeb, 0xb4, 0x72, 0x4e, 0x9f, 0x90, 0x35, 0xd4, 0x5c, + 0x22, 0xb3, 0x84, 0xcd, 0x5e, 0xa2, 0x3e, 0xda, 0x86, 0x73, 0x22, 0x61, 0x34, 0xd1, 0xd7, 0xa9, + 0x9c, 0x87, 0x90, 0xc5, 0xf2, 0x1f, 0xe1, 0x6e, 0x0f, 0x8b, 0xdd, 0x10, 0x71, 0x77, 0x3a, 0xf4, + 0x7e, 0xd7, 0x97, 0x3b, 0x77, 0x07, 0x3d, 0xcd, 0xcd, 0x93, 0xe8, 0xfd, 0x7e, 0x33, 0x09, 0xc4, + 0x69, 0x7c, 0x14, 0xc2, 0x69, 0xd7, 0xcb, 0x5a, 0xdd, 0x67, 0x18, 0xa1, 0x8f, 0x71, 0x4f, 0xd8, + 0xee, 0x2b, 0x3b, 0x13, 0xce, 0x57, 0x76, 0x26, 0xed, 0x77, 0x66, 0x85, 0xf7, 0x3b, 0x16, 0xad, + 0xad, 0x71, 0xea, 0xe8, 0xb3, 0x30, 0xa6, 0x7f, 0x98, 0xe0, 0x3a, 0x2e, 0x65, 0x33, 0xb2, 0xda, + 0xf9, 0xc0, 0xf9, 0x7c, 0x75, 0x06, 0xe8, 0x30, 0x6c, 0x50, 0x44, 0xf5, 0x0c, 0x9f, 0xf1, 0x2b, + 0xfd, 0x71, 0x35, 0xfd, 0x1b, 0xa1, 0x11, 0xc8, 0x5e, 0xf6, 0xe8, 0x26, 0x8c, 0xd4, 0x9b, 0x2e, + 0xf1, 0xa2, 0x4a, 0xb5, 0x5b, 0x94, 0xb7, 0x65, 0x81, 0x23, 0xf6, 0x91, 0x08, 0xcd, 0xcf, 0xcb, + 0xb0, 0xa2, 0x60, 0xff, 0x5a, 0x01, 0xe6, 0x7b, 0xe4, 0x79, 0x48, 0xa8, 0xa4, 0xac, 0xbe, 0x54, + 0x52, 0x8b, 0x32, 0xd5, 0xf5, 0x7a, 0x42, 0xda, 0x95, 0x48, 0x63, 0x1d, 0xcb, 0xbc, 0x92, 0xf8, + 0x7d, 0xbb, 0x08, 0xe8, 0x5a, 0xad, 0x81, 0x9e, 0x4e, 0x2e, 0x86, 0x36, 0x7b, 0xb0, 0xff, 0x27, + 0x70, 0xae, 0x66, 0xd2, 0xfe, 0x4a, 0x01, 0x4e, 0xab, 0x21, 0xfc, 0xe6, 0x1d, 0xb8, 0xdb, 0xe9, + 0x81, 0x3b, 0x06, 0xbd, 0xae, 0x7d, 0x0b, 0x86, 0x78, 0xd8, 0xba, 0x3e, 0x58, 0xef, 0x8b, 0x66, + 0x84, 0x57, 0xc5, 0xed, 0x19, 0x51, 0x5e, 0xbf, 0xd7, 0x82, 0xc9, 0x8d, 0xe5, 0x6a, 0xcd, 0xaf, + 0xef, 0x92, 0x68, 0x91, 0x3f, 0x95, 0xb0, 0xe6, 0x5d, 0xfb, 0x30, 0xec, 0x71, 0x16, 0xe3, 0x7d, + 0x01, 0x06, 0x76, 0xfc, 0x30, 0x4a, 0x1a, 0x7d, 0x5c, 0xf7, 0xc3, 0x08, 0x33, 0x88, 0xfd, 0x7b, + 0x16, 0x0c, 0x6e, 0x38, 0xae, 0x17, 0x49, 0x05, 0x81, 0x95, 0xa3, 0x20, 0xe8, 0xe7, 0xbb, 0xd0, + 0x4b, 0x30, 0x44, 0xb6, 0xb6, 0x48, 0x3d, 0x12, 0xb3, 0x2a, 0x43, 0x13, 0x0c, 0xad, 0xb0, 0x52, + 0xca, 0x0b, 0xb2, 0xc6, 0xf8, 0x5f, 0x2c, 0x90, 0xd1, 0x5d, 0x28, 0x45, 0x6e, 0x8b, 0x2c, 0x36, + 0x1a, 0x42, 0x6d, 0xfe, 0x10, 0xe1, 0x15, 0x36, 0x24, 0x01, 0x1c, 0xd3, 0xb2, 0xbf, 0x54, 0x00, + 0x88, 0xe3, 0xfd, 0xf4, 0xfa, 0xc4, 0xa5, 0x94, 0x42, 0xf5, 0x52, 0x86, 0x42, 0x15, 0xc5, 0x04, + 0x33, 0xb4, 0xa9, 0x6a, 0x98, 0x8a, 0x7d, 0x0d, 0xd3, 0xc0, 0x51, 0x86, 0x69, 0x19, 0xa6, 0xe3, + 0x78, 0x45, 0x66, 0xb8, 0x36, 0x76, 0x7d, 0x6e, 0x24, 0x81, 0x38, 0x8d, 0x6f, 0x13, 0xb8, 0xa0, + 0xc2, 0xb6, 0x88, 0x1b, 0x8d, 0x59, 0x65, 0xeb, 0x0a, 0xea, 0x1e, 0xe3, 0x14, 0x6b, 0x8c, 0x0b, + 0xb9, 0x1a, 0xe3, 0x9f, 0xb0, 0xe0, 0x54, 0xb2, 0x1d, 0xe6, 0x8f, 0xfb, 0x45, 0x0b, 0x4e, 0x33, + 0xbd, 0x39, 0x6b, 0x35, 0xad, 0xa5, 0x7f, 0xb1, 0x6b, 0x28, 0x9a, 0x9c, 0x1e, 0xc7, 0x31, 0x30, + 0xd6, 0xb2, 0x48, 0xe3, 0xec, 0x16, 0xed, 0xff, 0x50, 0x80, 0xd9, 0xbc, 0x18, 0x36, 0xcc, 0x69, + 0xc3, 0xb9, 0x5f, 0xdb, 0x25, 0xf7, 0x84, 0x69, 0x7c, 0xec, 0xb4, 0xc1, 0x8b, 0xb1, 0x84, 0x27, + 0x43, 0xf7, 0x17, 0xfa, 0x0c, 0xdd, 0xbf, 0x03, 0xd3, 0xf7, 0x76, 0x88, 0x77, 0xdb, 0x0b, 0x9d, + 0xc8, 0x0d, 0xb7, 0x5c, 0xa6, 0x63, 0xe6, 0xeb, 0xe6, 0x15, 0x69, 0xc0, 0x7e, 0x37, 0x89, 0x70, + 0x78, 0x30, 0x7f, 0xce, 0x28, 0x88, 0xbb, 0xcc, 0x0f, 0x12, 0x9c, 0x26, 0x9a, 0xce, 0x7c, 0x30, + 0xf0, 0x08, 0x33, 0x1f, 0xd8, 0x5f, 0xb4, 0xe0, 0x6c, 0x6e, 0xba, 0x55, 0x74, 0x19, 0x46, 0x9c, + 0xb6, 0xcb, 0xc5, 0xf4, 0xe2, 0x18, 0x65, 0xe2, 0xa0, 0x6a, 0x85, 0x0b, 0xe9, 0x15, 0x54, 0xa5, + 0x81, 0x2f, 0xe4, 0xa6, 0x81, 0xef, 0x99, 0xd5, 0xdd, 0xfe, 0x1e, 0x0b, 0x84, 0xc3, 0x69, 0x1f, + 0x67, 0xf7, 0xa7, 0x60, 0x6c, 0x2f, 0x9d, 0x1d, 0xe9, 0x42, 0xbe, 0x07, 0xae, 0xc8, 0x89, 0xa4, + 0x18, 0x32, 0x23, 0x13, 0x92, 0x41, 0xcb, 0x6e, 0x80, 0x80, 0x96, 0x09, 0x13, 0x42, 0xf7, 0xee, + 0xcd, 0xf3, 0x00, 0x0d, 0x86, 0xab, 0xe5, 0xd2, 0x57, 0x37, 0x73, 0x59, 0x41, 0xb0, 0x86, 0x65, + 0xff, 0xdb, 0x02, 0x8c, 0xca, 0x6c, 0x3c, 0x1d, 0xaf, 0x1f, 0x51, 0xd1, 0x91, 0xd2, 0x73, 0xa2, + 0x2b, 0x50, 0x62, 0xb2, 0xcc, 0x6a, 0x2c, 0x61, 0x53, 0x92, 0x84, 0x35, 0x09, 0xc0, 0x31, 0x0e, + 0xdd, 0x45, 0x61, 0x67, 0x93, 0xa1, 0x27, 0xdc, 0x23, 0x6b, 0xbc, 0x18, 0x4b, 0x38, 0xfa, 0x04, + 0x4c, 0xf1, 0x7a, 0x81, 0xdf, 0x76, 0xb6, 0xb9, 0xfe, 0x63, 0x50, 0x05, 0x50, 0x98, 0x5a, 0x4b, + 0xc0, 0x0e, 0x0f, 0xe6, 0x4f, 0x25, 0xcb, 0x98, 0x62, 0x2f, 0x45, 0x85, 0x99, 0x39, 0xf1, 0x46, + 0xe8, 0xee, 0x4f, 0x59, 0x47, 0xc5, 0x20, 0xac, 0xe3, 0xd9, 0x9f, 0x05, 0x94, 0xce, 0x4b, 0x84, + 0x5e, 0xe7, 0xb6, 0xad, 0x6e, 0x40, 0x1a, 0xdd, 0x14, 0x7d, 0x7a, 0x98, 0x00, 0xe9, 0xd9, 0xc4, + 0x6b, 0x61, 0x55, 0xdf, 0xfe, 0xff, 0x8b, 0x30, 0x95, 0xf4, 0xe5, 0x46, 0xd7, 0x61, 0x88, 0xb3, + 0x1e, 0x82, 0x7c, 0x17, 0x3b, 0x12, 0xcd, 0x03, 0x9c, 0x1d, 0xc2, 0x82, 0x7b, 0x11, 0xf5, 0xd1, + 0x9b, 0x30, 0xda, 0xf0, 0xef, 0x79, 0xf7, 0x9c, 0xa0, 0xb1, 0x58, 0xad, 0x88, 0xe5, 0x9c, 0xf9, + 0xb0, 0x2d, 0xc7, 0x68, 0xba, 0x57, 0x39, 0xd3, 0x99, 0xc6, 0x20, 0xac, 0x93, 0x43, 0x1b, 0x2c, + 0x98, 0xf9, 0x96, 0xbb, 0xbd, 0xe6, 0xb4, 0xbb, 0x39, 0x3a, 0x2c, 0x4b, 0x24, 0x8d, 0xf2, 0xb8, + 0x88, 0x78, 0xce, 0x01, 0x38, 0x26, 0x84, 0x3e, 0x0f, 0x33, 0x61, 0x8e, 0xb8, 0x3d, 0x2f, 0x4d, + 0x5d, 0x37, 0x09, 0xf4, 0xd2, 0x63, 0x0f, 0x0e, 0xe6, 0x67, 0xb2, 0x04, 0xf3, 0x59, 0xcd, 0xd8, + 0x3f, 0x72, 0x0a, 0x8c, 0x4d, 0x6c, 0x64, 0x2d, 0xb5, 0x8e, 0x29, 0x6b, 0x29, 0x86, 0x11, 0xd2, + 0x6a, 0x47, 0xfb, 0x65, 0x37, 0xe8, 0x96, 0xcb, 0x7b, 0x45, 0xe0, 0xa4, 0x69, 0x4a, 0x08, 0x56, + 0x74, 0xb2, 0x53, 0xcb, 0x16, 0xbf, 0x8e, 0xa9, 0x65, 0x07, 0x4e, 0x30, 0xb5, 0xec, 0x3a, 0x0c, + 0x6f, 0xbb, 0x11, 0x26, 0x6d, 0x5f, 0x30, 0xfd, 0x99, 0xeb, 0xf0, 0x1a, 0x47, 0x49, 0x27, 0x31, + 0x14, 0x00, 0x2c, 0x89, 0xa0, 0xd7, 0xd5, 0x0e, 0x1c, 0xca, 0x7f, 0x98, 0xa7, 0x0d, 0x1e, 0x32, + 0xf7, 0xa0, 0x48, 0x20, 0x3b, 0xfc, 0xb0, 0x09, 0x64, 0x57, 0x65, 0xda, 0xd7, 0x91, 0x7c, 0xaf, + 0x24, 0x96, 0xd5, 0xb5, 0x47, 0xb2, 0xd7, 0x3b, 0x7a, 0xaa, 0xdc, 0x52, 0xfe, 0x49, 0xa0, 0xb2, + 0xe0, 0xf6, 0x99, 0x20, 0xf7, 0x7b, 0x2c, 0x38, 0xdd, 0xce, 0xca, 0x1a, 0x2d, 0x6c, 0x03, 0x5e, + 0xea, 0x3b, 0x31, 0xb5, 0xd1, 0x20, 0x93, 0xa9, 0x65, 0xa2, 0xe1, 0xec, 0xe6, 0xe8, 0x40, 0x07, + 0x9b, 0x0d, 0xa1, 0xa3, 0xbe, 0x98, 0x93, 0x69, 0xb7, 0x4b, 0x7e, 0xdd, 0x8d, 0x8c, 0xac, 0xae, + 0xef, 0xcf, 0xcb, 0xea, 0xda, 0x77, 0x2e, 0xd7, 0xd7, 0x55, 0x8e, 0xdd, 0xf1, 0xfc, 0xa5, 0xc4, + 0x33, 0xe8, 0xf6, 0xcc, 0xac, 0xfb, 0xba, 0xca, 0xac, 0xdb, 0x25, 0x52, 0x2d, 0xcf, 0x9b, 0xdb, + 0x33, 0x9f, 0xae, 0x96, 0x13, 0x77, 0xf2, 0x78, 0x72, 0xe2, 0x1a, 0x57, 0x0d, 0x4f, 0xcb, 0xfa, + 0x4c, 0x8f, 0xab, 0xc6, 0xa0, 0xdb, 0xfd, 0xb2, 0xe1, 0xf9, 0x7f, 0xa7, 0x1f, 0x2a, 0xff, 0xef, + 0x1d, 0x3d, 0x9f, 0x2e, 0xea, 0x91, 0x30, 0x96, 0x22, 0xf5, 0x99, 0x45, 0xf7, 0x8e, 0x7e, 0x01, + 0xce, 0xe4, 0xd3, 0x55, 0xf7, 0x5c, 0x9a, 0x6e, 0xe6, 0x15, 0x98, 0xca, 0xce, 0x7b, 0xea, 0x64, + 0xb2, 0xf3, 0x9e, 0x3e, 0xf6, 0xec, 0xbc, 0x67, 0x4e, 0x20, 0x3b, 0xef, 0x63, 0x27, 0x98, 0x9d, + 0xf7, 0x0e, 0x33, 0xa8, 0xe1, 0x61, 0x7b, 0x44, 0x64, 0xdd, 0xec, 0x28, 0xae, 0x59, 0xb1, 0x7d, + 0xf8, 0xc7, 0x29, 0x10, 0x8e, 0x49, 0x65, 0x64, 0xfd, 0x9d, 0x7d, 0x04, 0x59, 0x7f, 0xd7, 0xe3, + 0xac, 0xbf, 0x67, 0xf3, 0xa7, 0x3a, 0xc3, 0x05, 0x23, 0x27, 0xd7, 0xef, 0x1d, 0x3d, 0x47, 0xef, + 0xe3, 0x5d, 0xb4, 0x26, 0x59, 0x82, 0xc7, 0x2e, 0x99, 0x79, 0x5f, 0xe3, 0x99, 0x79, 0x9f, 0xc8, + 0x3f, 0xc9, 0x93, 0xd7, 0x9d, 0x91, 0x8f, 0x97, 0xf6, 0x4b, 0xc5, 0x70, 0x64, 0x31, 0x84, 0x73, + 0xfa, 0xa5, 0x82, 0x40, 0xa6, 0xfb, 0xa5, 0x40, 0x38, 0x26, 0x65, 0x7f, 0x5f, 0x01, 0xce, 0x77, + 0xdf, 0x6f, 0xb1, 0x34, 0xb5, 0x1a, 0x2b, 0x91, 0x13, 0xd2, 0x54, 0xfe, 0x66, 0x8b, 0xb1, 0xfa, + 0x0e, 0x49, 0x77, 0x0d, 0xa6, 0x95, 0xef, 0x46, 0xd3, 0xad, 0xef, 0xaf, 0xc7, 0x2f, 0x5f, 0xe5, + 0xef, 0x5e, 0x4b, 0x22, 0xe0, 0x74, 0x1d, 0xb4, 0x08, 0x93, 0x46, 0x61, 0xa5, 0x2c, 0xde, 0x66, + 0x4a, 0x7c, 0x5b, 0x33, 0xc1, 0x38, 0x89, 0x6f, 0x7f, 0xd9, 0x82, 0xc7, 0x72, 0xd2, 0xda, 0xf5, + 0x1d, 0x71, 0x6d, 0x0b, 0x26, 0xdb, 0x66, 0xd5, 0x1e, 0x41, 0x22, 0x8d, 0xe4, 0x79, 0xaa, 0xaf, + 0x09, 0x00, 0x4e, 0x12, 0xb5, 0x7f, 0xaa, 0x00, 0xe7, 0xba, 0x1a, 0x23, 0x22, 0x0c, 0x67, 0xb6, + 0x5b, 0xa1, 0xb3, 0x1c, 0x90, 0x06, 0xf1, 0x22, 0xd7, 0x69, 0xd6, 0xda, 0xa4, 0xae, 0xc9, 0xc3, + 0x99, 0x55, 0xdf, 0xb5, 0xb5, 0xda, 0x62, 0x1a, 0x03, 0xe7, 0xd4, 0x44, 0xab, 0x80, 0xd2, 0x10, + 0x31, 0xc3, 0x2c, 0x1a, 0x75, 0x9a, 0x1e, 0xce, 0xa8, 0x81, 0x3e, 0x02, 0xe3, 0xca, 0xc8, 0x51, + 0x9b, 0x71, 0x76, 0xb0, 0x63, 0x1d, 0x80, 0x4d, 0x3c, 0x74, 0x95, 0x87, 0x33, 0x17, 0x81, 0xef, + 0x85, 0xf0, 0x7c, 0x52, 0xc6, 0x2a, 0x17, 0xc5, 0x58, 0xc7, 0x59, 0xba, 0xfc, 0x1b, 0x7f, 0x70, + 0xfe, 0x7d, 0xbf, 0xf5, 0x07, 0xe7, 0xdf, 0xf7, 0xbb, 0x7f, 0x70, 0xfe, 0x7d, 0xdf, 0xf1, 0xe0, + 0xbc, 0xf5, 0x1b, 0x0f, 0xce, 0x5b, 0xbf, 0xf5, 0xe0, 0xbc, 0xf5, 0xbb, 0x0f, 0xce, 0x5b, 0xbf, + 0xff, 0xe0, 0xbc, 0xf5, 0xa5, 0x3f, 0x3c, 0xff, 0xbe, 0x4f, 0x15, 0xf6, 0xae, 0xfe, 0xdf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x7a, 0x57, 0x60, 0xaf, 0xc8, 0x03, 0x01, 0x00, } func (m *AWSElasticBlockStoreVolumeSource) Marshal() (dAtA []byte, err error) { @@ -18033,17 +18033,6 @@ func (m *ServiceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x8a } - if len(m.TopologyKeys) > 0 { - for iNdEx := len(m.TopologyKeys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.TopologyKeys[iNdEx]) - copy(dAtA[i:], m.TopologyKeys[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopologyKeys[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - } if m.SessionAffinityConfig != nil { { size, err := m.SessionAffinityConfig.MarshalToSizedBuffer(dAtA[:i]) @@ -19418,6 +19407,16 @@ func (m *WindowsSecurityContextOptions) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if m.HostProcess != nil { + i-- + if *m.HostProcess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if m.RunAsUserName != nil { i -= len(*m.RunAsUserName) copy(dAtA[i:], *m.RunAsUserName) @@ -23507,12 +23506,6 @@ func (m *ServiceSpec) Size() (n int) { l = m.SessionAffinityConfig.Size() n += 1 + l + sovGenerated(uint64(l)) } - if len(m.TopologyKeys) > 0 { - for _, s := range m.TopologyKeys { - l = len(s) - n += 2 + l + sovGenerated(uint64(l)) - } - } if m.IPFamilyPolicy != nil { l = len(*m.IPFamilyPolicy) n += 2 + l + sovGenerated(uint64(l)) @@ -24003,6 +23996,9 @@ func (m *WindowsSecurityContextOptions) Size() (n int) { l = len(*m.RunAsUserName) n += 1 + l + sovGenerated(uint64(l)) } + if m.HostProcess != nil { + n += 2 + } return n } @@ -27113,7 +27109,6 @@ func (this *ServiceSpec) String() string { `HealthCheckNodePort:` + fmt.Sprintf("%v", this.HealthCheckNodePort) + `,`, `PublishNotReadyAddresses:` + fmt.Sprintf("%v", this.PublishNotReadyAddresses) + `,`, `SessionAffinityConfig:` + strings.Replace(this.SessionAffinityConfig.String(), "SessionAffinityConfig", "SessionAffinityConfig", 1) + `,`, - `TopologyKeys:` + fmt.Sprintf("%v", this.TopologyKeys) + `,`, `IPFamilyPolicy:` + valueToStringGenerated(this.IPFamilyPolicy) + `,`, `ClusterIPs:` + fmt.Sprintf("%v", this.ClusterIPs) + `,`, `IPFamilies:` + fmt.Sprintf("%v", this.IPFamilies) + `,`, @@ -27408,6 +27403,7 @@ func (this *WindowsSecurityContextOptions) String() string { `GMSACredentialSpecName:` + valueToStringGenerated(this.GMSACredentialSpecName) + `,`, `GMSACredentialSpec:` + valueToStringGenerated(this.GMSACredentialSpec) + `,`, `RunAsUserName:` + valueToStringGenerated(this.RunAsUserName) + `,`, + `HostProcess:` + valueToStringGenerated(this.HostProcess) + `,`, `}`, }, "") return s @@ -62883,38 +62879,6 @@ func (m *ServiceSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TopologyKeys", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TopologyKeys = append(m.TopologyKeys, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex case 17: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IPFamilyPolicy", wireType) @@ -67092,6 +67056,27 @@ func (m *WindowsSecurityContextOptions) Unmarshal(dAtA []byte) error { s := string(dAtA[iNdEx:postIndex]) m.RunAsUserName = &s iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostProcess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.HostProcess = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.proto index eb54bd424ee7..7c4474842631 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/generated.proto @@ -622,10 +622,10 @@ message Container { // Entrypoint array. Not executed within a shell. // The docker image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional repeated string command = 3; @@ -633,10 +633,10 @@ message Container { // Arguments to the entrypoint. // The docker image's CMD is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional repeated string args = 4; @@ -755,8 +755,8 @@ message Container { // +optional optional string imagePullPolicy = 14; - // Security options the pod should run with. - // More info: https://kubernetes.io/docs/concepts/policy/security-context/ + // SecurityContext defines the security options the container should be run with. + // If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ // +optional optional SecurityContext securityContext = 15; @@ -787,6 +787,7 @@ message Container { message ContainerImage { // Names by which this image is known. // e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] + // +optional repeated string names = 1; // The size of the image in bytes. @@ -1153,11 +1154,12 @@ message EnvVar { optional string name = 1; // Variable references $(VAR_NAME) are expanded - // using the previous defined environment variables in the container and + // using the previously defined environment variables in the container and // any service environment variables. If a variable cannot be resolved, - // the reference in the input string will be unchanged. The $(VAR_NAME) - // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped - // references will never be expanded, regardless of whether the variable + // the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + // "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + // Escaped references will never be expanded, regardless of whether the variable // exists or not. // Defaults to "". // +optional @@ -1229,10 +1231,10 @@ message EphemeralContainerCommon { // Entrypoint array. Not executed within a shell. // The docker image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional repeated string command = 3; @@ -1240,10 +1242,10 @@ message EphemeralContainerCommon { // Arguments to the entrypoint. // The docker image's CMD is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional repeated string args = 4; @@ -3019,7 +3021,7 @@ message PodAffinityTerm { // and the ones listed in the namespaces field. // null selector and null or empty namespaces list means "this pod's namespace". // An empty selector ({}) matches all namespaces. - // This field is alpha-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + // This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 4; } @@ -3567,7 +3569,7 @@ message PodSpec { // If specified, all readiness gates will be evaluated for pod readiness. // A pod is ready when all its containers are ready AND // all conditions specified in the readiness gates have status equal to "True" - // More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md + // More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates // +optional repeated PodReadinessGate readinessGates = 28; @@ -3575,7 +3577,7 @@ message PodSpec { // to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. // If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an // empty definition that uses the default runtime handler. - // More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md + // More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class // This is a beta feature as of Kubernetes v1.14. // +optional optional string runtimeClassName = 29; @@ -4939,7 +4941,7 @@ message ServiceSpec { // If specified and supported by the platform, this will restrict traffic through the cloud-provider // load-balancer will be restricted to the specified client IPs. This field will be ignored if the // cloud-provider does not support the feature." - // More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/ + // More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/ // +optional repeated string loadBalancerSourceRanges = 9; @@ -4986,23 +4988,6 @@ message ServiceSpec { // +optional optional SessionAffinityConfig sessionAffinityConfig = 14; - // topologyKeys is a preference-order list of topology keys which - // implementations of services should use to preferentially sort endpoints - // when accessing this Service, it can not be used at the same time as - // externalTrafficPolicy=Local. - // Topology keys must be valid label keys and at most 16 keys may be specified. - // Endpoints are chosen based on the first topology key with available backends. - // If this field is specified and all entries have no backends that match - // the topology of the client, the service has no backends for that client - // and connections should fail. - // The special value "*" may be used to mean "any topology". This catch-all - // value, if used, only makes sense as the last value in the list. - // If this is not specified or empty, no topology constraints will be applied. - // This field is alpha-level and is only honored by servers that enable the ServiceTopology feature. - // This field is deprecated and will be removed in a future version. - // +optional - repeated string topologyKeys = 16; - // IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this // service, and is gated by the "IPv6DualStack" feature gate. This field // is usually assigned automatically based on cluster configuration and the @@ -5629,5 +5614,15 @@ message WindowsSecurityContextOptions { // PodSecurityContext, the value specified in SecurityContext takes precedence. // +optional optional string runAsUserName = 3; + + // HostProcess determines if a container should be run as a 'Host Process' container. + // This field is alpha-level and will only be honored by components that enable the + // WindowsHostProcessContainers feature flag. Setting this field without the feature + // flag will result in errors when validating the Pod. All of a Pod's containers must + // have the same effective HostProcess value (it is not allowed to have a mix of HostProcess + // containers and non-HostProcess containers). In addition, if HostProcess is true + // then HostNetwork must also be set to true. + // +optional + optional bool hostProcess = 4; } diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/types.go index 3cbdd3c20cdf..d1dbeda8f369 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/types.go @@ -30,8 +30,6 @@ const ( NamespaceAll string = "" // NamespaceNodeLease is the namespace where we place node lease objects (used for node heartbeats) NamespaceNodeLease string = "kube-node-lease" - // TopologyKeyAny is the service topology key that matches any node - TopologyKeyAny string = "*" ) // Volume represents a named volume in a pod that may be accessed by any container in the pod. @@ -1916,11 +1914,12 @@ type EnvVar struct { // Optional: no more than one of the following may be specified. // Variable references $(VAR_NAME) are expanded - // using the previous defined environment variables in the container and + // using the previously defined environment variables in the container and // any service environment variables. If a variable cannot be resolved, - // the reference in the input string will be unchanged. The $(VAR_NAME) - // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped - // references will never be expanded, regardless of whether the variable + // the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + // "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + // Escaped references will never be expanded, regardless of whether the variable // exists or not. // Defaults to "". // +optional @@ -2217,20 +2216,20 @@ type Container struct { // Entrypoint array. Not executed within a shell. // The docker image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` // Arguments to the entrypoint. // The docker image's CMD is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` @@ -2334,8 +2333,8 @@ type Container struct { // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images // +optional ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"` - // Security options the pod should run with. - // More info: https://kubernetes.io/docs/concepts/policy/security-context/ + // SecurityContext defines the security options the container should be run with. + // If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ // +optional SecurityContext *SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` @@ -2814,7 +2813,7 @@ type PodAffinityTerm struct { // and the ones listed in the namespaces field. // null selector and null or empty namespaces list means "this pod's namespace". // An empty selector ({}) matches all namespaces. - // This field is alpha-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + // This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. // +optional NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,4,opt,name=namespaceSelector"` } @@ -3120,14 +3119,14 @@ type PodSpec struct { // If specified, all readiness gates will be evaluated for pod readiness. // A pod is ready when all its containers are ready AND // all conditions specified in the readiness gates have status equal to "True" - // More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md + // More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates // +optional ReadinessGates []PodReadinessGate `json:"readinessGates,omitempty" protobuf:"bytes,28,opt,name=readinessGates"` // RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used // to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. // If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an // empty definition that uses the default runtime handler. - // More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md + // More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class // This is a beta feature as of Kubernetes v1.14. // +optional RuntimeClassName *string `json:"runtimeClassName,omitempty" protobuf:"bytes,29,opt,name=runtimeClassName"` @@ -3435,20 +3434,20 @@ type EphemeralContainerCommon struct { // Entrypoint array. Not executed within a shell. // The docker image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` // Arguments to the entrypoint. // The docker image's CMD is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` @@ -4038,11 +4037,6 @@ type LoadBalancerIngress struct { Ports []PortStatus `json:"ports,omitempty" protobuf:"bytes,4,rep,name=ports"` } -const ( - // MaxServiceTopologyKeys is the largest number of topology keys allowed on a service - MaxServiceTopologyKeys = 16 -) - // IPFamily represents the IP Family (IPv4 or IPv6). This type is used // to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type IPFamily string @@ -4192,7 +4186,7 @@ type ServiceSpec struct { // If specified and supported by the platform, this will restrict traffic through the cloud-provider // load-balancer will be restricted to the specified client IPs. This field will be ignored if the // cloud-provider does not support the feature." - // More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/ + // More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/ // +optional LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty" protobuf:"bytes,9,opt,name=loadBalancerSourceRanges"` @@ -4239,22 +4233,8 @@ type ServiceSpec struct { // +optional SessionAffinityConfig *SessionAffinityConfig `json:"sessionAffinityConfig,omitempty" protobuf:"bytes,14,opt,name=sessionAffinityConfig"` - // topologyKeys is a preference-order list of topology keys which - // implementations of services should use to preferentially sort endpoints - // when accessing this Service, it can not be used at the same time as - // externalTrafficPolicy=Local. - // Topology keys must be valid label keys and at most 16 keys may be specified. - // Endpoints are chosen based on the first topology key with available backends. - // If this field is specified and all entries have no backends that match - // the topology of the client, the service has no backends for that client - // and connections should fail. - // The special value "*" may be used to mean "any topology". This catch-all - // value, if used, only makes sense as the last value in the list. - // If this is not specified or empty, no topology constraints will be applied. - // This field is alpha-level and is only honored by servers that enable the ServiceTopology feature. - // This field is deprecated and will be removed in a future version. - // +optional - TopologyKeys []string `json:"topologyKeys,omitempty" protobuf:"bytes,16,opt,name=topologyKeys"` + // TopologyKeys is tombstoned to show why 16 is reserved protobuf tag. + //TopologyKeys []string `json:"topologyKeys,omitempty" protobuf:"bytes,16,opt,name=topologyKeys"` // IPFamily is tombstoned to show why 15 is a reserved protobuf tag. // IPFamily *IPFamily `json:"ipFamily,omitempty" protobuf:"bytes,15,opt,name=ipFamily,Configcasttype=IPFamily"` @@ -4871,6 +4851,7 @@ type PodSignature struct { type ContainerImage struct { // Names by which this image is known. // e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] + // +optional Names []string `json:"names" protobuf:"bytes,1,rep,name=names"` // The size of the image in bytes. // +optional @@ -5688,7 +5669,7 @@ const ( // Match all pod objects that have priority class mentioned ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass" // Match all pod objects that have cross-namespace pod (anti)affinity mentioned. - // This is an alpha feature enabled by the PodAffinityNamespaceSelector feature flag. + // This is a beta feature enabled by the PodAffinityNamespaceSelector feature flag. ResourceQuotaScopeCrossNamespacePodAffinity ResourceQuotaScope = "CrossNamespacePodAffinity" ) @@ -6215,6 +6196,16 @@ type WindowsSecurityContextOptions struct { // PodSecurityContext, the value specified in SecurityContext takes precedence. // +optional RunAsUserName *string `json:"runAsUserName,omitempty" protobuf:"bytes,3,opt,name=runAsUserName"` + + // HostProcess determines if a container should be run as a 'Host Process' container. + // This field is alpha-level and will only be honored by components that enable the + // WindowsHostProcessContainers feature flag. Setting this field without the feature + // flag will result in errors when validating the Pod. All of a Pod's containers must + // have the same effective HostProcess value (it is not allowed to have a mix of HostProcess + // containers and non-HostProcess containers). In addition, if HostProcess is true + // then HostNetwork must also be set to true. + // +optional + HostProcess *bool `json:"hostProcess,omitempty" protobuf:"bytes,4,opt,name=hostProcess"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go index 51d17c6deb13..12a7d489690d 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -328,8 +328,8 @@ var map_Container = map[string]string{ "": "A single application container that you want to run within a pod.", "name": "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.", "image": "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", - "command": "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - "args": "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", + "command": "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", + "args": "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "workingDir": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "ports": "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.", "envFrom": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", @@ -344,7 +344,7 @@ var map_Container = map[string]string{ "terminationMessagePath": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", "terminationMessagePolicy": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", "imagePullPolicy": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", - "securityContext": "Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", + "securityContext": "SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", "stdin": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", "stdinOnce": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", "tty": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", @@ -558,7 +558,7 @@ func (EnvFromSource) SwaggerDoc() map[string]string { var map_EnvVar = map[string]string{ "": "EnvVar represents an environment variable present in a Container.", "name": "Name of the environment variable. Must be a C_IDENTIFIER.", - "value": "Variable references $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", + "value": "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", "valueFrom": "Source for the environment variable's value. Cannot be used if value is not empty.", } @@ -591,8 +591,8 @@ var map_EphemeralContainerCommon = map[string]string{ "": "EphemeralContainerCommon is a copy of all fields in Container to be inlined in EphemeralContainer. This separate type allows easy conversion from EphemeralContainer to Container and allows separate documentation for the fields of EphemeralContainer. When a new field is added to Container it must be added here as well.", "name": "Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.", "image": "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images", - "command": "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - "args": "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", + "command": "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", + "args": "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "workingDir": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "ports": "Ports are not allowed for ephemeral containers.", "envFrom": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", @@ -1443,7 +1443,7 @@ var map_PodAffinityTerm = map[string]string{ "labelSelector": "A label query over a set of resources, in this case pods.", "namespaces": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"", "topologyKey": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.", - "namespaceSelector": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is alpha-level and is only honored when PodAffinityNamespaceSelector feature is enabled.", + "namespaceSelector": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.", } func (PodAffinityTerm) SwaggerDoc() map[string]string { @@ -1641,8 +1641,8 @@ var map_PodSpec = map[string]string{ "priorityClassName": "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", "priority": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.", "dnsConfig": "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.", - "readinessGates": "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md", - "runtimeClassName": "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md This is a beta feature as of Kubernetes v1.14.", + "readinessGates": "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates", + "runtimeClassName": "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14.", "enableServiceLinks": "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.", "preemptionPolicy": "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is beta-level, gated by the NonPreemptingPriority feature-gate.", "overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.", @@ -2238,13 +2238,12 @@ var map_ServiceSpec = map[string]string{ "externalIPs": "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.", "sessionAffinity": "Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", "loadBalancerIP": "Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.", - "loadBalancerSourceRanges": "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/", + "loadBalancerSourceRanges": "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/", "externalName": "externalName is the external reference that discovery mechanisms will return as an alias for this service (e.g. a DNS CNAME record). No proxying will be involved. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires `type` to be \"ExternalName\".", "externalTrafficPolicy": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.", "healthCheckNodePort": "healthCheckNodePort specifies the healthcheck nodePort for the service. This only applies when type is set to LoadBalancer and externalTrafficPolicy is set to Local. If a value is specified, is in-range, and is not in use, it will be used. If not specified, a value will be automatically allocated. External systems (e.g. load-balancers) can use this port to determine if a given node holds endpoints for this service or not. If this field is specified when creating a Service which does not need it, creation will fail. This field will be wiped when updating a Service to no longer need it (e.g. changing type).", "publishNotReadyAddresses": "publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready. The primary use case for setting this field is for a StatefulSet's Headless Service to propagate SRV DNS records for its Pods for the purpose of peer discovery. The Kubernetes controllers that generate Endpoints and EndpointSlice resources for Services interpret this to mean that all endpoints are considered \"ready\" even if the Pods themselves are not. Agents which consume only Kubernetes generated endpoints through the Endpoints or EndpointSlice resources can safely assume this behavior.", "sessionAffinityConfig": "sessionAffinityConfig contains the configurations of session affinity.", - "topologyKeys": "topologyKeys is a preference-order list of topology keys which implementations of services should use to preferentially sort endpoints when accessing this Service, it can not be used at the same time as externalTrafficPolicy=Local. Topology keys must be valid label keys and at most 16 keys may be specified. Endpoints are chosen based on the first topology key with available backends. If this field is specified and all entries have no backends that match the topology of the client, the service has no backends for that client and connections should fail. The special value \"*\" may be used to mean \"any topology\". This catch-all value, if used, only makes sense as the last value in the list. If this is not specified or empty, no topology constraints will be applied. This field is alpha-level and is only honored by servers that enable the ServiceTopology feature. This field is deprecated and will be removed in a future version.", "ipFamilies": "IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this service, and is gated by the \"IPv6DualStack\" feature gate. This field is usually assigned automatically based on cluster configuration and the ipFamilyPolicy field. If this field is specified manually, the requested family is available in the cluster, and ipFamilyPolicy allows it, it will be used; otherwise creation of the service will fail. This field is conditionally mutable: it allows for adding or removing a secondary IP family, but it does not allow changing the primary IP family of the Service. Valid values are \"IPv4\" and \"IPv6\". This field only applies to Services of types ClusterIP, NodePort, and LoadBalancer, and does apply to \"headless\" services. This field will be wiped when updating a Service to type ExternalName.\n\nThis field may hold a maximum of two entries (dual-stack families, in either order). These families must correspond to the values of the clusterIPs field, if specified. Both clusterIPs and ipFamilies are governed by the ipFamilyPolicy field.", "ipFamilyPolicy": "IPFamilyPolicy represents the dual-stack-ness requested or required by this Service, and is gated by the \"IPv6DualStack\" feature gate. If there is no value provided, then this field will be set to SingleStack. Services can be \"SingleStack\" (a single IP family), \"PreferDualStack\" (two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or \"RequireDualStack\" (two IP families on dual-stack configured clusters, otherwise fail). The ipFamilies and clusterIPs fields depend on the value of this field. This field will be wiped when updating a service to type ExternalName.", "allocateLoadBalancerNodePorts": "allocateLoadBalancerNodePorts defines if NodePorts will be automatically allocated for services with type LoadBalancer. Default is \"true\". It may be set to \"false\" if the cluster load-balancer does not rely on NodePorts. allocateLoadBalancerNodePorts may only be set for services with type LoadBalancer and will be cleared if the type is changed to any other type. This field is alpha-level and is only honored by servers that enable the ServiceLBNodePortControl feature.", @@ -2506,6 +2505,7 @@ var map_WindowsSecurityContextOptions = map[string]string{ "gmsaCredentialSpecName": "GMSACredentialSpecName is the name of the GMSA credential spec to use.", "gmsaCredentialSpec": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.", "runAsUserName": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", + "hostProcess": "HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.", } func (WindowsSecurityContextOptions) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go index aff3c6894e82..7cc563171c56 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go +++ b/cluster-autoscaler/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go @@ -5297,11 +5297,6 @@ func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec) { *out = new(SessionAffinityConfig) (*in).DeepCopyInto(*out) } - if in.TopologyKeys != nil { - in, out := &in.TopologyKeys, &out.TopologyKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } if in.IPFamilies != nil { in, out := &in.IPFamilies, &out.IPFamilies *out = make([]IPFamily, len(*in)) @@ -5910,6 +5905,11 @@ func (in *WindowsSecurityContextOptions) DeepCopyInto(out *WindowsSecurityContex *out = new(string) **out = **in } + if in.HostProcess != nil { + in, out := &in.HostProcess, &out.HostProcess + *out = new(bool) + **out = **in + } return } diff --git a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/generated.proto index a3e54810d627..427886414a0c 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/generated.proto @@ -210,6 +210,9 @@ message DaemonSetStatus { repeated DaemonSetCondition conditions = 10; } +// DaemonSetUpdateStrategy indicates the strategy that the DaemonSet +// controller will use to perform updates. It includes any additional parameters +// necessary to perform the update for the indicated strategy. message DaemonSetUpdateStrategy { // Type of daemon set update. Can be "RollingUpdate" or "OnDelete". // Default is OnDelete. @@ -580,7 +583,12 @@ message IngressRule { // mixing different types of rules in a single Ingress is disallowed, so exactly // one of the following must be set. message IngressRuleValue { - // +optional + // http is a list of http selectors pointing to backends. + // A path is matched against the path of an incoming request. Currently it can + // contain characters disallowed from the conventional "path" part of a URL + // as defined by RFC 3986. Paths must begin with a '/'. + // A backend defines the referenced service endpoint to which the traffic + // will be forwarded to. optional HTTPIngressRuleValue http = 1; } diff --git a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types.go index f9e7012ebe22..1ef23545ceef 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types.go @@ -329,6 +329,9 @@ type DeploymentList struct { Items []Deployment `json:"items" protobuf:"bytes,2,rep,name=items"` } +// DaemonSetUpdateStrategy indicates the strategy that the DaemonSet +// controller will use to perform updates. It includes any additional parameters +// necessary to perform the update for the indicated strategy. type DaemonSetUpdateStrategy struct { // Type of daemon set update. Can be "RollingUpdate" or "OnDelete". // Default is OnDelete. @@ -731,7 +734,12 @@ type IngressRuleValue struct { // 2. Consider adding fields for ingress-type specific global options // usable by a loadbalancer, like http keep-alive. - // +optional + // http is a list of http selectors pointing to backends. + // A path is matched against the path of an incoming request. Currently it can + // contain characters disallowed from the conventional "path" part of a URL + // as defined by RFC 3986. Paths must begin with a '/'. + // A backend defines the referenced service endpoint to which the traffic + // will be forwarded to. HTTP *HTTPIngressRuleValue `json:"http,omitempty" protobuf:"bytes,1,opt,name=http"` } diff --git a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go index 870b607a72bd..8f40402c64ce 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go @@ -122,6 +122,7 @@ func (DaemonSetStatus) SwaggerDoc() map[string]string { } var map_DaemonSetUpdateStrategy = map[string]string{ + "": "DaemonSetUpdateStrategy indicates the strategy that the DaemonSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.", "type": "Type of daemon set update. Can be \"RollingUpdate\" or \"OnDelete\". Default is OnDelete.", "rollingUpdate": "Rolling update config params. Present only if type = \"RollingUpdate\".", } @@ -321,7 +322,8 @@ func (IngressRule) SwaggerDoc() map[string]string { } var map_IngressRuleValue = map[string]string{ - "": "IngressRuleValue represents a rule to apply against incoming requests. If the rule is satisfied, the request is routed to the specified backend. Currently mixing different types of rules in a single Ingress is disallowed, so exactly one of the following must be set.", + "": "IngressRuleValue represents a rule to apply against incoming requests. If the rule is satisfied, the request is routed to the specified backend. Currently mixing different types of rules in a single Ingress is disallowed, so exactly one of the following must be set.", + "http": "http is a list of http selectors pointing to backends. A path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. A backend defines the referenced service endpoint to which the traffic will be forwarded to.", } func (IngressRuleValue) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1beta1/types.go index ece834e92925..673cde42dc7d 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1beta1/types.go @@ -57,6 +57,50 @@ const ( ResponseHeaderMatchedFlowSchemaUID = "X-Kubernetes-PF-FlowSchema-UID" ) +const ( + // AutoUpdateAnnotationKey is the name of an annotation that enables + // automatic update of the spec of the bootstrap configuration + // object(s), if set to 'true'. + // + // On a fresh install, all bootstrap configuration objects will have auto + // update enabled with the following annotation key: + // apf.kubernetes.io/autoupdate-spec: 'true' + // + // The kube-apiserver periodically checks the bootstrap configuration + // objects on the cluster and applies updates if necessary. + // + // kube-apiserver enforces an 'always auto-update' policy for the + // mandatory configuration object(s). This implies: + // - the auto-update annotation key is added with a value of 'true' + // if it is missing. + // - the auto-update annotation key is set to 'true' if its current value + // is a boolean false or has an invalid boolean representation + // (if the cluster operator sets it to 'false' it will be stomped) + // - any changes to the spec made by the cluster operator will be + // stomped. + // + // The kube-apiserver will apply updates on the suggested configuration if: + // - the cluster operator has enabled auto-update by setting the annotation + // (apf.kubernetes.io/autoupdate-spec: 'true') or + // - the annotation key is missing but the generation is 1 + // + // If the suggested configuration object is missing the annotation key, + // kube-apiserver will update the annotation appropriately: + // - it is set to 'true' if generation of the object is '1' which usually + // indicates that the spec of the object has not been changed. + // - it is set to 'false' if generation of the object is greater than 1. + // + // The goal is to enable the kube-apiserver to apply update on suggested + // configuration objects installed by previous releases but not overwrite + // changes made by the cluster operators. + // Note that this distinction is imperfectly detected: in the case where an + // operator deletes a suggested configuration object and later creates it + // but with a variant spec and then does no updates of the object + // (generation is 1), the technique outlined above will incorrectly + // determine that the object should be auto-updated. + AutoUpdateAnnotationKey = "apf.kubernetes.io/autoupdate-spec" +) + // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/cluster-autoscaler/vendor/k8s.io/api/networking/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/networking/v1/generated.proto index 8f23477d8fbc..e687bc5647a6 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/networking/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/networking/v1/generated.proto @@ -35,8 +35,8 @@ option go_package = "v1"; message HTTPIngressPath { // Path is matched against the path of an incoming request. Currently it can // contain characters disallowed from the conventional "path" part of a URL - // as defined by RFC 3986. Paths must begin with a '/'. When unspecified, - // all paths from incoming requests are matched. + // as defined by RFC 3986. Paths must begin with a '/' and must be present + // when using PathType with value "Exact" or "Prefix". // +optional optional string path = 1; diff --git a/cluster-autoscaler/vendor/k8s.io/api/networking/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/networking/v1/types.go index 6cc210b8940f..99e9fe3e2afd 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/networking/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/networking/v1/types.go @@ -407,8 +407,8 @@ const ( type HTTPIngressPath struct { // Path is matched against the path of an incoming request. Currently it can // contain characters disallowed from the conventional "path" part of a URL - // as defined by RFC 3986. Paths must begin with a '/'. When unspecified, - // all paths from incoming requests are matched. + // as defined by RFC 3986. Paths must begin with a '/' and must be present + // when using PathType with value "Exact" or "Prefix". // +optional Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` diff --git a/cluster-autoscaler/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go index 88f9a8f130b2..83c5094c6950 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_HTTPIngressPath = map[string]string{ "": "HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend.", - "path": "Path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. When unspecified, all paths from incoming requests are matched.", + "path": "Path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/' and must be present when using PathType with value \"Exact\" or \"Prefix\".", "pathType": "PathType determines the interpretation of the Path matching. PathType can be one of the following values: * Exact: Matches the URL path exactly. * Prefix: Matches based on a URL path prefix split by '/'. Matching is\n done on a path element by element basis. A path element refers is the\n list of labels in the path split by the '/' separator. A request is a\n match for path p if every p is an element-wise prefix of p of the\n request path. Note that if the last element of the path is a substring\n of the last element in request path, it is not a match (e.g. /foo/bar\n matches /foo/bar/baz, but does not match /foo/barbaz).\n* ImplementationSpecific: Interpretation of the Path matching is up to\n the IngressClass. Implementations can treat this as a separate PathType\n or treat it identically to Prefix or Exact path types.\nImplementations are required to support all path types.", "backend": "Backend defines the referenced service endpoint to which the traffic will be forwarded to.", } diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/doc.go b/cluster-autoscaler/vendor/k8s.io/api/networking/v1/well_known_annotations.go similarity index 55% rename from cluster-autoscaler/vendor/k8s.io/utils/mount/doc.go rename to cluster-autoscaler/vendor/k8s.io/api/networking/v1/well_known_annotations.go index c81b426ce8c0..0e3754d5cd44 100644 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/doc.go +++ b/cluster-autoscaler/vendor/k8s.io/api/networking/v1/well_known_annotations.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package mount defines an interface to mounting filesystems. -package mount // import "k8s.io/utils/mount" +package v1 + +const ( + // AnnotationIsDefaultIngressClass can be used to indicate that an + // IngressClass should be considered default. When a single IngressClass + // resource has this annotation set to true, new Ingress resources without a + // class specified will be assigned this default class. + AnnotationIsDefaultIngressClass = "ingressclass.kubernetes.io/is-default-class" +) diff --git a/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/generated.proto index acb6e859cfcf..5479ac482b3c 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/generated.proto @@ -35,8 +35,8 @@ option go_package = "v1beta1"; message HTTPIngressPath { // Path is matched against the path of an incoming request. Currently it can // contain characters disallowed from the conventional "path" part of a URL - // as defined by RFC 3986. Paths must begin with a '/'. When unspecified, - // all paths from incoming requests are matched. + // as defined by RFC 3986. Paths must begin with a '/' and must be present + // when using PathType with value "Exact" or "Prefix". // +optional optional string path = 1; diff --git a/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/types.go index 09279d6938f5..4646e90b64c4 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/types.go @@ -228,8 +228,8 @@ const ( type HTTPIngressPath struct { // Path is matched against the path of an incoming request. Currently it can // contain characters disallowed from the conventional "path" part of a URL - // as defined by RFC 3986. Paths must begin with a '/'. When unspecified, - // all paths from incoming requests are matched. + // as defined by RFC 3986. Paths must begin with a '/' and must be present + // when using PathType with value "Exact" or "Prefix". // +optional Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` diff --git a/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go index 84337ad3ea84..88c130e89b4e 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_HTTPIngressPath = map[string]string{ "": "HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend.", - "path": "Path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. When unspecified, all paths from incoming requests are matched.", + "path": "Path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/' and must be present when using PathType with value \"Exact\" or \"Prefix\".", "pathType": "PathType determines the interpretation of the Path matching. PathType can be one of the following values: * Exact: Matches the URL path exactly. * Prefix: Matches based on a URL path prefix split by '/'. Matching is\n done on a path element by element basis. A path element refers is the\n list of labels in the path split by the '/' separator. A request is a\n match for path p if every p is an element-wise prefix of p of the\n request path. Note that if the last element of the path is a substring\n of the last element in request path, it is not a match (e.g. /foo/bar\n matches /foo/bar/baz, but does not match /foo/barbaz).\n* ImplementationSpecific: Interpretation of the Path matching is up to\n the IngressClass. Implementations can treat this as a separate PathType\n or treat it identically to Prefix or Exact path types.\nImplementations are required to support all path types. Defaults to ImplementationSpecific.", "backend": "Backend defines the referenced service endpoint to which the traffic will be forwarded to.", } diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/generated.proto index f88ae6f41a68..d92e18ff333a 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/generated.proto @@ -43,7 +43,7 @@ message Overhead { // user or cluster provisioner, and referenced in the PodSpec. The Kubelet is // responsible for resolving the RuntimeClassName reference before running the // pod. For more details, see -// https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md +// https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class message RuntimeClass { // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types.go b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types.go index d0dd281bde27..f11bcbb10ad9 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types.go @@ -31,7 +31,7 @@ import ( // user or cluster provisioner, and referenced in the PodSpec. The Kubelet is // responsible for resolving the RuntimeClassName reference before running the // pod. For more details, see -// https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md +// https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class type RuntimeClass struct { metav1.TypeMeta `json:",inline"` // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go index 244077e20f32..5a259573c3e1 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go @@ -37,7 +37,7 @@ func (Overhead) SwaggerDoc() map[string]string { } var map_RuntimeClass = map[string]string{ - "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md", + "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class", "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "Specification of the RuntimeClass More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/generated.proto index 1166e525b391..3c1e5bbbdcbf 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/generated.proto @@ -43,7 +43,7 @@ message Overhead { // user or cluster provisioner, and referenced in the PodSpec. The Kubelet is // responsible for resolving the RuntimeClassName reference before running the // pod. For more details, see -// https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md +// https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class message RuntimeClass { // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types.go index d2741bf626b7..c545abf18b02 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types.go @@ -33,7 +33,7 @@ import ( // user or cluster provisioner, and referenced in the PodSpec. The Kubelet is // responsible for resolving the RuntimeClassName reference before running the // pod. For more details, see -// https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md +// https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class type RuntimeClass struct { metav1.TypeMeta `json:",inline"` // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go index 5a5422f94fcc..6d88710340bd 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go @@ -37,7 +37,7 @@ func (Overhead) SwaggerDoc() map[string]string { } var map_RuntimeClass = map[string]string{ - "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md", + "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class", "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "handler": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.", "overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.", diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/generated.proto index a47212142dc7..133ba0493c69 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/generated.proto @@ -105,6 +105,8 @@ message IDRange { // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods message PodDisruptionBudget { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -119,9 +121,12 @@ message PodDisruptionBudget { // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. message PodDisruptionBudgetList { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + // items list individual PodDisruptionBudget objects repeated PodDisruptionBudget items = 2; } diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types.go index 2811044518e2..553cb316dcf1 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types.go @@ -129,6 +129,9 @@ const ( // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudget struct { metav1.TypeMeta `json:",inline"` + + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -149,9 +152,13 @@ type PodDisruptionBudget struct { // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. type PodDisruptionBudgetList struct { metav1.TypeMeta `json:",inline"` + + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Items []PodDisruptionBudget `json:"items" protobuf:"bytes,2,rep,name=items"` + // items list individual PodDisruptionBudget objects + Items []PodDisruptionBudget `json:"items" protobuf:"bytes,2,rep,name=items"` } // +genclient diff --git a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go index 0853a5e99669..ef81d43af36d 100644 --- a/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go @@ -96,9 +96,10 @@ func (IDRange) SwaggerDoc() map[string]string { } var map_PodDisruptionBudget = map[string]string{ - "": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods", - "spec": "Specification of the desired behavior of the PodDisruptionBudget.", - "status": "Most recently observed status of the PodDisruptionBudget.", + "": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Specification of the desired behavior of the PodDisruptionBudget.", + "status": "Most recently observed status of the PodDisruptionBudget.", } func (PodDisruptionBudget) SwaggerDoc() map[string]string { @@ -106,7 +107,9 @@ func (PodDisruptionBudget) SwaggerDoc() map[string]string { } var map_PodDisruptionBudgetList = map[string]string{ - "": "PodDisruptionBudgetList is a collection of PodDisruptionBudgets.", + "": "PodDisruptionBudgetList is a collection of PodDisruptionBudgets.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items list individual PodDisruptionBudget objects", } func (PodDisruptionBudgetList) SwaggerDoc() map[string]string { diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go index 8d718945d066..2395656cc903 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go @@ -696,6 +696,15 @@ func (q *Quantity) UnmarshalJSON(value []byte) error { return nil } +// NewDecimalQuantity returns a new Quantity representing the given +// value in the given format. +func NewDecimalQuantity(b inf.Dec, format Format) *Quantity { + return &Quantity{ + d: infDecAmount{&b}, + Format: format, + } +} + // NewQuantity returns a new Quantity representing the given // value in the given format. func NewQuantity(value int64, format Format) *Quantity { diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go index 947c96f43486..e0b5b14900d9 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go @@ -68,9 +68,11 @@ var ValidateNamespaceName = NameIsDNSLabel var ValidateServiceAccountName = NameIsDNSSubdomain // maskTrailingDash replaces the final character of a string with a subdomain safe -// value if is a dash. +// value if it is a dash and if the length of this string is greater than 1. Note that +// this is used when a value could be appended to the string, see ValidateNameFunc +// for more info. func maskTrailingDash(name string) string { - if strings.HasSuffix(name, "-") { + if len(name) > 1 && strings.HasSuffix(name, "-") { return name[:len(name)-2] + "a" } return name diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go index 3e234eb11dca..4d9efe3f72bd 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go @@ -33,7 +33,7 @@ import ( // FieldImmutableErrorMsg is a error message for field is immutable. const FieldImmutableErrorMsg string = `field is immutable` -const totalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB +const TotalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB // BannedOwners is a black list of object that are not allowed to be owners. var BannedOwners = map[schema.GroupVersionKind]struct{}{ @@ -46,19 +46,28 @@ var ValidateClusterName = NameIsDNS1035Label // ValidateAnnotations validates that a set of annotations are correctly defined. func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} - var totalSize int64 - for k, v := range annotations { + for k := range annotations { for _, msg := range validation.IsQualifiedName(strings.ToLower(k)) { allErrs = append(allErrs, field.Invalid(fldPath, k, msg)) } - totalSize += (int64)(len(k)) + (int64)(len(v)) } - if totalSize > (int64)(totalAnnotationSizeLimitB) { - allErrs = append(allErrs, field.TooLong(fldPath, "", totalAnnotationSizeLimitB)) + if err := ValidateAnnotationsSize(annotations); err != nil { + allErrs = append(allErrs, field.TooLong(fldPath, "", TotalAnnotationSizeLimitB)) } return allErrs } +func ValidateAnnotationsSize(annotations map[string]string) error { + var totalSize int64 + for k, v := range annotations { + totalSize += (int64)(len(k)) + (int64)(len(v)) + } + if totalSize > (int64)(TotalAnnotationSizeLimitB) { + return fmt.Errorf("annotations size %d is larger than limit %d", totalSize, TotalAnnotationSizeLimitB) + } + return nil +} + func validateOwnerReference(ownerReference metav1.OwnerReference, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} gvk := schema.FromAPIVersionAndKind(ownerReference.APIVersion, ownerReference.Kind) diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto index f1cb025a3170..7d450644d2a2 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto @@ -499,8 +499,6 @@ message ListOptions { // assume bookmarks are returned at any specific interval, nor may they // assume the server will send any BOOKMARK event during a session. // If this is not a watch, this field is ignored. - // If the feature gate WatchBookmarks is not enabled in apiserver, - // this field is ignored. // +optional optional bool allowWatchBookmarks = 9; diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go index fb680a44bdf9..9660282c48bc 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go @@ -357,8 +357,6 @@ type ListOptions struct { // assume bookmarks are returned at any specific interval, nor may they // assume the server will send any BOOKMARK event during a session. // If this is not a watch, this field is ignored. - // If the feature gate WatchBookmarks is not enabled in apiserver, - // this field is ignored. // +optional AllowWatchBookmarks bool `json:"allowWatchBookmarks,omitempty" protobuf:"varint,9,opt,name=allowWatchBookmarks"` diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go index b5c43cca7d15..3eae04d072e3 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go @@ -209,7 +209,7 @@ var map_ListOptions = map[string]string{ "labelSelector": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "fieldSelector": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "watch": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "allowWatchBookmarks": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.", + "allowWatchBookmarks": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "resourceVersion": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "resourceVersionMatch": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "timeoutSeconds": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go index 3da7457f4827..d4ceab84f06d 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go @@ -123,7 +123,10 @@ func (c *connection) Close() error { func (c *connection) RemoveStreams(streams ...httpstream.Stream) { c.streamLock.Lock() for _, stream := range streams { - delete(c.streams, stream.Identifier()) + // It may be possible that the provided stream is nil if timed out. + if stream != nil { + delete(c.streams, stream.Identifier()) + } } c.streamLock.Unlock() } diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go index 4cb1cfadcb0e..b8e329571ee2 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go @@ -183,8 +183,11 @@ func (s *SpdyRoundTripper) dial(req *http.Request) (net.Conn, error) { return nil, err } + //lint:ignore SA1019 ignore deprecated httputil.NewProxyClientConn proxyClientConn := httputil.NewProxyClientConn(proxyDialConn, nil) _, err = proxyClientConn.Do(&proxyReq) + //lint:ignore SA1019 ignore deprecated httputil.ErrPersistEOF: it might be + // returned from the invocation of proxyClientConn.Do if err != nil && err != httputil.ErrPersistEOF { return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/net/http.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/net/http.go index ce69b8054b51..d75ac6efa2d3 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/net/http.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/net/http.go @@ -113,6 +113,7 @@ func SetOldTransportDefaults(t *http.Transport) *http.Transport { t.Proxy = NewProxierWithNoProxyCIDR(http.ProxyFromEnvironment) } // If no custom dialer is set, use the default context dialer + //lint:file-ignore SA1019 Keep supporting deprecated Dial method of custom transports if t.DialContext == nil && t.Dial == nil { t.DialContext = defaultTransport.DialContext } diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go index 600f3befd2e9..fd2081a28d52 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go @@ -987,10 +987,10 @@ func validatePatchWithSetOrderList(patchList, setOrderList interface{}, mergeKey return nil } - var nonDeleteList, toDeleteList []interface{} + var nonDeleteList []interface{} var err error if len(mergeKey) > 0 { - nonDeleteList, toDeleteList, err = extractToDeleteItems(typedPatchList) + nonDeleteList, _, err = extractToDeleteItems(typedPatchList) if err != nil { return err } @@ -1018,7 +1018,6 @@ func validatePatchWithSetOrderList(patchList, setOrderList interface{}, mergeKey if patchIndex < len(nonDeleteList) && setOrderIndex >= len(typedSetOrderList) { return fmt.Errorf("The order in patch list:\n%v\n doesn't match %s list:\n%v\n", typedPatchList, setElementOrderDirectivePrefix, setOrderList) } - typedPatchList = append(nonDeleteList, toDeleteList...) return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go index 3dea7fe7f9eb..afb24876adfe 100644 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go +++ b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go @@ -205,10 +205,29 @@ var ErrWaitTimeout = errors.New("timed out waiting for the condition") // if the loop should be aborted. type ConditionFunc func() (done bool, err error) +// ConditionWithContextFunc returns true if the condition is satisfied, or an error +// if the loop should be aborted. +// +// The caller passes along a context that can be used by the condition function. +type ConditionWithContextFunc func(context.Context) (done bool, err error) + +// WithContext converts a ConditionFunc into a ConditionWithContextFunc +func (cf ConditionFunc) WithContext() ConditionWithContextFunc { + return func(context.Context) (done bool, err error) { + return cf() + } +} + // runConditionWithCrashProtection runs a ConditionFunc with crash protection func runConditionWithCrashProtection(condition ConditionFunc) (bool, error) { + return runConditionWithCrashProtectionWithContext(context.TODO(), condition.WithContext()) +} + +// runConditionWithCrashProtectionWithContext runs a +// ConditionWithContextFunc with crash protection. +func runConditionWithCrashProtectionWithContext(ctx context.Context, condition ConditionWithContextFunc) (bool, error) { defer runtime.HandleCrash() - return condition() + return condition(ctx) } // Backoff holds parameters applied to a Backoff function. @@ -418,38 +437,42 @@ func ExponentialBackoff(backoff Backoff, condition ConditionFunc) error { // // If you want to Poll something forever, see PollInfinite. func Poll(interval, timeout time.Duration, condition ConditionFunc) error { - return pollInternal(poller(interval, timeout), condition) -} - -func pollInternal(wait WaitFunc, condition ConditionFunc) error { - done := make(chan struct{}) - defer close(done) - return WaitFor(wait, condition, done) + return PollWithContext(context.Background(), interval, timeout, condition.WithContext()) } -// PollImmediate tries a condition func until it returns true, an error, or the timeout -// is reached. +// PollWithContext tries a condition func until it returns true, an error, +// or when the context expires or the timeout is reached, whichever +// happens first. // -// PollImmediate always checks 'condition' before waiting for the interval. 'condition' -// will always be invoked at least once. +// PollWithContext always waits the interval before the run of 'condition'. +// 'condition' will always be invoked at least once. // // Some intervals may be missed if the condition takes too long or the time // window is too short. // -// If you want to immediately Poll something forever, see PollImmediateInfinite. -func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error { - return pollImmediateInternal(poller(interval, timeout), condition) +// If you want to Poll something forever, see PollInfinite. +func PollWithContext(ctx context.Context, interval, timeout time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, false, poller(interval, timeout), condition) } -func pollImmediateInternal(wait WaitFunc, condition ConditionFunc) error { - done, err := runConditionWithCrashProtection(condition) - if err != nil { - return err - } - if done { - return nil - } - return pollInternal(wait, condition) +// PollUntil tries a condition func until it returns true, an error or stopCh is +// closed. +// +// PollUntil always waits interval before the first run of 'condition'. +// 'condition' will always be invoked at least once. +func PollUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error { + ctx, cancel := contextForChannel(stopCh) + defer cancel() + return PollUntilWithContext(ctx, interval, condition.WithContext()) +} + +// PollUntilWithContext tries a condition func until it returns true, +// an error or the specified context is cancelled or expired. +// +// PollUntilWithContext always waits interval before the first run of 'condition'. +// 'condition' will always be invoked at least once. +func PollUntilWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, false, poller(interval, 0), condition) } // PollInfinite tries a condition func until it returns true or an error @@ -459,37 +482,45 @@ func pollImmediateInternal(wait WaitFunc, condition ConditionFunc) error { // Some intervals may be missed if the condition takes too long or the time // window is too short. func PollInfinite(interval time.Duration, condition ConditionFunc) error { - done := make(chan struct{}) - defer close(done) - return PollUntil(interval, condition, done) + return PollInfiniteWithContext(context.Background(), interval, condition.WithContext()) } -// PollImmediateInfinite tries a condition func until it returns true or an error +// PollInfiniteWithContext tries a condition func until it returns true or an error // -// PollImmediateInfinite runs the 'condition' before waiting for the interval. +// PollInfiniteWithContext always waits the interval before the run of 'condition'. // // Some intervals may be missed if the condition takes too long or the time // window is too short. -func PollImmediateInfinite(interval time.Duration, condition ConditionFunc) error { - done, err := runConditionWithCrashProtection(condition) - if err != nil { - return err - } - if done { - return nil - } - return PollInfinite(interval, condition) +func PollInfiniteWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, false, poller(interval, 0), condition) } -// PollUntil tries a condition func until it returns true, an error or stopCh is -// closed. +// PollImmediate tries a condition func until it returns true, an error, or the timeout +// is reached. // -// PollUntil always waits interval before the first run of 'condition'. +// PollImmediate always checks 'condition' before waiting for the interval. 'condition' +// will always be invoked at least once. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// If you want to immediately Poll something forever, see PollImmediateInfinite. +func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error { + return PollImmediateWithContext(context.Background(), interval, timeout, condition.WithContext()) +} + +// PollImmediateWithContext tries a condition func until it returns true, an error, +// or the timeout is reached or the specified context expires, whichever happens first. +// +// PollImmediateWithContext always checks 'condition' before waiting for the interval. // 'condition' will always be invoked at least once. -func PollUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error { - ctx, cancel := contextForChannel(stopCh) - defer cancel() - return WaitFor(poller(interval, 0), condition, ctx.Done()) +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +// +// If you want to immediately Poll something forever, see PollImmediateInfinite. +func PollImmediateWithContext(ctx context.Context, interval, timeout time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, true, poller(interval, timeout), condition) } // PollImmediateUntil tries a condition func until it returns true, an error or stopCh is closed. @@ -497,18 +528,67 @@ func PollUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan st // PollImmediateUntil runs the 'condition' before waiting for the interval. // 'condition' will always be invoked at least once. func PollImmediateUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error { - done, err := condition() - if err != nil { - return err - } - if done { - return nil + ctx, cancel := contextForChannel(stopCh) + defer cancel() + return PollImmediateUntilWithContext(ctx, interval, condition.WithContext()) +} + +// PollImmediateUntilWithContext tries a condition func until it returns true, +// an error or the specified context is cancelled or expired. +// +// PollImmediateUntilWithContext runs the 'condition' before waiting for the interval. +// 'condition' will always be invoked at least once. +func PollImmediateUntilWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, true, poller(interval, 0), condition) +} + +// PollImmediateInfinite tries a condition func until it returns true or an error +// +// PollImmediateInfinite runs the 'condition' before waiting for the interval. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +func PollImmediateInfinite(interval time.Duration, condition ConditionFunc) error { + return PollImmediateInfiniteWithContext(context.Background(), interval, condition.WithContext()) +} + +// PollImmediateInfiniteWithContext tries a condition func until it returns true +// or an error or the specified context gets cancelled or expired. +// +// PollImmediateInfiniteWithContext runs the 'condition' before waiting for the interval. +// +// Some intervals may be missed if the condition takes too long or the time +// window is too short. +func PollImmediateInfiniteWithContext(ctx context.Context, interval time.Duration, condition ConditionWithContextFunc) error { + return poll(ctx, true, poller(interval, 0), condition) +} + +// Internally used, each of the the public 'Poll*' function defined in this +// package should invoke this internal function with appropriate parameters. +// ctx: the context specified by the caller, for infinite polling pass +// a context that never gets cancelled or expired. +// immediate: if true, the 'condition' will be invoked before waiting for the interval, +// in this case 'condition' will always be invoked at least once. +// wait: user specified WaitFunc function that controls at what interval the condition +// function should be invoked periodically and whether it is bound by a timeout. +// condition: user specified ConditionWithContextFunc function. +func poll(ctx context.Context, immediate bool, wait WaitWithContextFunc, condition ConditionWithContextFunc) error { + if immediate { + done, err := runConditionWithCrashProtectionWithContext(ctx, condition) + if err != nil { + return err + } + if done { + return nil + } } + select { - case <-stopCh: + case <-ctx.Done(): + // returning ctx.Err() will break backward compatibility return ErrWaitTimeout default: - return PollUntil(interval, condition, stopCh) + return WaitForWithContext(ctx, wait, condition) } } @@ -516,6 +596,20 @@ func PollImmediateUntil(interval time.Duration, condition ConditionFunc, stopCh // should be executed and is closed when the last test should be invoked. type WaitFunc func(done <-chan struct{}) <-chan struct{} +// WithContext converts the WaitFunc to an equivalent WaitWithContextFunc +func (w WaitFunc) WithContext() WaitWithContextFunc { + return func(ctx context.Context) <-chan struct{} { + return w(ctx.Done()) + } +} + +// WaitWithContextFunc creates a channel that receives an item every time a test +// should be executed and is closed when the last test should be invoked. +// +// When the specified context gets cancelled or expires the function +// stops sending item and returns immediately. +type WaitWithContextFunc func(ctx context.Context) <-chan struct{} + // WaitFor continually checks 'fn' as driven by 'wait'. // // WaitFor gets a channel from 'wait()'', and then invokes 'fn' once for every value @@ -532,13 +626,35 @@ type WaitFunc func(done <-chan struct{}) <-chan struct{} // "uniform pseudo-random", the `fn` might still run one or multiple time, // though eventually `WaitFor` will return. func WaitFor(wait WaitFunc, fn ConditionFunc, done <-chan struct{}) error { - stopCh := make(chan struct{}) - defer close(stopCh) - c := wait(stopCh) + ctx, cancel := contextForChannel(done) + defer cancel() + return WaitForWithContext(ctx, wait.WithContext(), fn.WithContext()) +} + +// WaitForWithContext continually checks 'fn' as driven by 'wait'. +// +// WaitForWithContext gets a channel from 'wait()'', and then invokes 'fn' +// once for every value placed on the channel and once more when the +// channel is closed. If the channel is closed and 'fn' +// returns false without error, WaitForWithContext returns ErrWaitTimeout. +// +// If 'fn' returns an error the loop ends and that error is returned. If +// 'fn' returns true the loop ends and nil is returned. +// +// context.Canceled will be returned if the ctx.Done() channel is closed +// without fn ever returning true. +// +// When the ctx.Done() channel is closed, because the golang `select` statement is +// "uniform pseudo-random", the `fn` might still run one or multiple times, +// though eventually `WaitForWithContext` will return. +func WaitForWithContext(ctx context.Context, wait WaitWithContextFunc, fn ConditionWithContextFunc) error { + waitCtx, cancel := context.WithCancel(context.Background()) + defer cancel() + c := wait(waitCtx) for { select { case _, open := <-c: - ok, err := runConditionWithCrashProtection(fn) + ok, err := runConditionWithCrashProtectionWithContext(ctx, fn) if err != nil { return err } @@ -548,7 +664,8 @@ func WaitFor(wait WaitFunc, fn ConditionFunc, done <-chan struct{}) error { if !open { return ErrWaitTimeout } - case <-done: + case <-ctx.Done(): + // returning ctx.Err() will break backward compatibility return ErrWaitTimeout } } @@ -564,8 +681,8 @@ func WaitFor(wait WaitFunc, fn ConditionFunc, done <-chan struct{}) error { // // Output ticks are not buffered. If the channel is not ready to receive an // item, the tick is skipped. -func poller(interval, timeout time.Duration) WaitFunc { - return WaitFunc(func(done <-chan struct{}) <-chan struct{} { +func poller(interval, timeout time.Duration) WaitWithContextFunc { + return WaitWithContextFunc(func(ctx context.Context) <-chan struct{} { ch := make(chan struct{}) go func() { @@ -595,7 +712,7 @@ func poller(interval, timeout time.Duration) WaitFunc { } case <-after: return - case <-done: + case <-ctx.Done(): return } } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go index fc636601b5d7..3b35bb31ece7 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go @@ -55,6 +55,10 @@ const ( PatchAuditAnnotationPrefix = "patch.webhook.admission.k8s.io/" // MutationAuditAnnotationPrefix is a prefix for presisting webhook mutation existence in audit annotation. MutationAuditAnnotationPrefix = "mutation.webhook.admission.k8s.io/" + // MutationAnnotationFailedOpenKeyPrefix in an annotation indicates + // the mutating webhook failed open when the webhook backend connection + // failed or returned an internal server error. + MutationAuditAnnotationFailedOpenKeyPrefix string = "failed-open." + MutationAuditAnnotationPrefix ) var encodingjson = json.CaseSensitiveJSONIterator() @@ -134,7 +138,9 @@ func (a *mutatingDispatcher) Dispatch(ctx context.Context, attr admission.Attrib if reinvokeCtx.IsReinvoke() { round = 1 } - changed, err := a.callAttrMutatingHook(ctx, hook, invocation, versionedAttr, o, round, i) + + annotator := newWebhookAnnotator(versionedAttr, round, i, hook.Name, invocation.Webhook.GetConfigurationName()) + changed, err := a.callAttrMutatingHook(ctx, hook, invocation, versionedAttr, annotator, o, round, i) ignoreClientCallFailures := hook.FailurePolicy != nil && *hook.FailurePolicy == admissionregistrationv1.Ignore rejected := false if err != nil { @@ -168,6 +174,9 @@ func (a *mutatingDispatcher) Dispatch(ctx context.Context, attr admission.Attrib if callErr, ok := err.(*webhookutil.ErrCallingWebhook); ok { if ignoreClientCallFailures { klog.Warningf("Failed calling webhook, failing open %v: %v", hook.Name, callErr) + + annotator.addFailedOpenAnnotation() + utilruntime.HandleError(callErr) select { @@ -198,9 +207,8 @@ func (a *mutatingDispatcher) Dispatch(ctx context.Context, attr admission.Attrib // note that callAttrMutatingHook updates attr -func (a *mutatingDispatcher) callAttrMutatingHook(ctx context.Context, h *admissionregistrationv1.MutatingWebhook, invocation *generic.WebhookInvocation, attr *generic.VersionedAttributes, o admission.ObjectInterfaces, round, idx int) (bool, error) { +func (a *mutatingDispatcher) callAttrMutatingHook(ctx context.Context, h *admissionregistrationv1.MutatingWebhook, invocation *generic.WebhookInvocation, attr *generic.VersionedAttributes, annotator *webhookAnnotator, o admission.ObjectInterfaces, round, idx int) (bool, error) { configurationName := invocation.Webhook.GetConfigurationName() - annotator := newWebhookAnnotator(attr, round, idx, h.Name, configurationName) changed := false defer func() { annotator.addMutationAnnotation(changed) }() if attr.Attributes.IsDryRun() { @@ -338,20 +346,32 @@ func (a *mutatingDispatcher) callAttrMutatingHook(ctx context.Context, h *admiss } type webhookAnnotator struct { - attr *generic.VersionedAttributes - patchAnnotationKey string - mutationAnnotationKey string - webhook string - configuration string + attr *generic.VersionedAttributes + failedOpenAnnotationKey string + patchAnnotationKey string + mutationAnnotationKey string + webhook string + configuration string } func newWebhookAnnotator(attr *generic.VersionedAttributes, round, idx int, webhook, configuration string) *webhookAnnotator { return &webhookAnnotator{ - attr: attr, - patchAnnotationKey: fmt.Sprintf("%sround_%d_index_%d", PatchAuditAnnotationPrefix, round, idx), - mutationAnnotationKey: fmt.Sprintf("%sround_%d_index_%d", MutationAuditAnnotationPrefix, round, idx), - webhook: webhook, - configuration: configuration, + attr: attr, + failedOpenAnnotationKey: fmt.Sprintf("%sround_%d_index_%d", MutationAuditAnnotationFailedOpenKeyPrefix, round, idx), + patchAnnotationKey: fmt.Sprintf("%sround_%d_index_%d", PatchAuditAnnotationPrefix, round, idx), + mutationAnnotationKey: fmt.Sprintf("%sround_%d_index_%d", MutationAuditAnnotationPrefix, round, idx), + webhook: webhook, + configuration: configuration, + } +} + +func (w *webhookAnnotator) addFailedOpenAnnotation() { + if w.attr == nil || w.attr.Attributes == nil { + return + } + value := w.webhook + if err := w.attr.Attributes.AddAnnotation(w.failedOpenAnnotationKey, value); err != nil { + klog.Warningf("failed to set failed open annotation for mutating webhook key %s to %s: %v", w.failedOpenAnnotationKey, value, err) } } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/dispatcher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/dispatcher.go index 7a24d52ce572..250bb02a7839 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/dispatcher.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/dispatcher.go @@ -38,6 +38,16 @@ import ( utiltrace "k8s.io/utils/trace" ) +const ( + // ValidatingAuditAnnotationPrefix is a prefix for keeping noteworthy + // validating audit annotations. + ValidatingAuditAnnotationPrefix = "validating.webhook.admission.k8s.io/" + // ValidatingAuditAnnotationFailedOpenKeyPrefix in an annotation indicates + // the validating webhook failed open when the webhook backend connection + // failed or returned an internal server error. + ValidatingAuditAnnotationFailedOpenKeyPrefix = "failed-open." + ValidatingAuditAnnotationPrefix +) + type validatingDispatcher struct { cm *webhookutil.ClientManager plugin *Plugin @@ -92,7 +102,7 @@ func (d *validatingDispatcher) Dispatch(ctx context.Context, attr admission.Attr errCh := make(chan error, len(relevantHooks)) wg.Add(len(relevantHooks)) for i := range relevantHooks { - go func(invocation *generic.WebhookInvocation) { + go func(invocation *generic.WebhookInvocation, idx int) { defer wg.Done() hook, ok := invocation.Webhook.GetValidatingWebhook() if !ok { @@ -127,6 +137,12 @@ func (d *validatingDispatcher) Dispatch(ctx context.Context, attr admission.Attr if callErr, ok := err.(*webhookutil.ErrCallingWebhook); ok { if ignoreClientCallFailures { klog.Warningf("Failed calling webhook, failing open %v: %v", hook.Name, callErr) + + key := fmt.Sprintf("%sround_0_index_%d", ValidatingAuditAnnotationFailedOpenKeyPrefix, idx) + value := hook.Name + if err := versionedAttr.Attributes.AddAnnotation(key, value); err != nil { + klog.Warningf("Failed to set admission audit annotation %s to %s for validating webhook %s: %v", key, value, hook.Name, err) + } utilruntime.HandleError(callErr) return } @@ -141,7 +157,7 @@ func (d *validatingDispatcher) Dispatch(ctx context.Context, attr admission.Attr } klog.Warningf("rejected by webhook %q: %#v", hook.Name, err) errCh <- err - }(relevantHooks[i]) + }(relevantHooks[i], i) } wg.Wait() close(errCh) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go index 64600beca317..dbb932aa34a8 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go @@ -455,8 +455,14 @@ var ( func newPriorityLevelConfiguration(name string, spec flowcontrol.PriorityLevelConfigurationSpec) *flowcontrol.PriorityLevelConfiguration { return &flowcontrol.PriorityLevelConfiguration{ - ObjectMeta: metav1.ObjectMeta{Name: name}, - Spec: spec} + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Annotations: map[string]string{ + flowcontrol.AutoUpdateAnnotationKey: "true", + }, + }, + Spec: spec, + } } func newFlowSchema(name, plName string, matchingPrecedence int32, dmType flowcontrol.FlowDistinguisherMethodType, rules ...flowcontrol.PolicyRulesWithSubjects) *flowcontrol.FlowSchema { @@ -465,7 +471,12 @@ func newFlowSchema(name, plName string, matchingPrecedence int32, dmType flowcon dm = &flowcontrol.FlowDistinguisherMethod{Type: dmType} } return &flowcontrol.FlowSchema{ - ObjectMeta: metav1.ObjectMeta{Name: name}, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Annotations: map[string]string{ + flowcontrol.AutoUpdateAnnotationKey: "true", + }, + }, Spec: flowcontrol.FlowSchemaSpec{ PriorityLevelConfiguration: flowcontrol.PriorityLevelConfigurationReference{ Name: plName, diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/metrics.go index 3cf6d8f2a11f..729a16eeca9c 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/metrics.go @@ -32,7 +32,7 @@ const ( /* * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/request.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/request.go index 960ec93211f6..29ad4b72b428 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/request.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/audit/request.go @@ -111,7 +111,7 @@ func LogImpersonatedUser(ae *auditinternal.Event, user user.Info) { // LogRequestObject fills in the request object into an audit event. The passed runtime.Object // will be converted to the given gv. -func LogRequestObject(ae *auditinternal.Event, obj runtime.Object, gvr schema.GroupVersionResource, subresource string, s runtime.NegotiatedSerializer) { +func LogRequestObject(ae *auditinternal.Event, obj runtime.Object, objGV schema.GroupVersion, gvr schema.GroupVersionResource, subresource string, s runtime.NegotiatedSerializer) { if ae == nil || ae.Level.Less(auditinternal.LevelMetadata) { return } @@ -153,7 +153,7 @@ func LogRequestObject(ae *auditinternal.Event, obj runtime.Object, gvr schema.Gr // TODO(audit): hook into the serializer to avoid double conversion var err error - ae.RequestObject, err = encodeObject(obj, gvr.GroupVersion(), s) + ae.RequestObject, err = encodeObject(obj, objGV, s) if err != nil { // TODO(audit): add error slice to audit event struct klog.Warningf("Auditing failed of %v request: %v", reflect.TypeOf(obj).Name(), err) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/request/x509/x509.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/request/x509/x509.go index 09177f719b1a..eeb7c09881e8 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/request/x509/x509.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/request/x509/x509.go @@ -35,7 +35,7 @@ import ( /* * By default, the following metric is defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/discovery/storageversionhash.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/discovery/storageversionhash.go index a1b00decbaeb..d72d4ba207c7 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/discovery/storageversionhash.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/discovery/storageversionhash.go @@ -35,6 +35,5 @@ func StorageVersionHash(group, version, kind string) string { // the chance of colliding hash P(N,X) approximates to 1-e^(-(N^2)/2^(8X+1)). // P(10,000, 8) ~= 2.7*10^(-12), which is low enough. // See https://en.wikipedia.org/wiki/Birthday_problem#Approximations. - return base64.StdEncoding.EncodeToString( - bytes[:8]) + return base64.StdEncoding.EncodeToString(bytes[:8]) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filterlatency/filterlatency.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filterlatency/filterlatency.go index d42e18233f15..07880e5e2a12 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filterlatency/filterlatency.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filterlatency/filterlatency.go @@ -24,6 +24,8 @@ import ( utilclock "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apiserver/pkg/endpoints/metrics" apirequest "k8s.io/apiserver/pkg/endpoints/request" + "k8s.io/apiserver/pkg/server/httplog" + "k8s.io/klog/v2" ) type requestFilterRecordKeyType int @@ -31,6 +33,8 @@ type requestFilterRecordKeyType int // requestFilterRecordKey is the context key for a request filter record struct. const requestFilterRecordKey requestFilterRecordKeyType = iota +const minFilterLatencyToLog = 100 * time.Millisecond + type requestFilterRecord struct { name string startedTimestamp time.Time @@ -57,7 +61,11 @@ func TrackStarted(handler http.Handler, name string) http.Handler { // it updates the corresponding metric with the filter latency duration. func TrackCompleted(handler http.Handler) http.Handler { return trackCompleted(handler, utilclock.RealClock{}, func(ctx context.Context, fr *requestFilterRecord, completedAt time.Time) { - metrics.RecordFilterLatency(ctx, fr.name, completedAt.Sub(fr.startedTimestamp)) + latency := completedAt.Sub(fr.startedTimestamp) + metrics.RecordFilterLatency(ctx, fr.name, latency) + if klog.V(3).Enabled() && latency > minFilterLatencyToLog { + httplog.AddInfof(ctx, "%s=%s", fr.name, latency.String()) + } }) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/metrics.go index 31ead93d51a4..47e1be847c7a 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/metrics.go @@ -28,7 +28,7 @@ import ( /* * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go index d6f8025e39a5..d5f7c414b069 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go @@ -123,8 +123,10 @@ func createHandler(r rest.NamedCreater, scope *RequestScope, admit admission.Int scope.err(err, w, req) return } - if !scope.AcceptsGroupVersion(gvk.GroupVersion()) { - err = errors.NewBadRequest(fmt.Sprintf("the API version in the data (%s) does not match the expected API version (%v)", gvk.GroupVersion().String(), gv.String())) + + objGV := gvk.GroupVersion() + if !scope.AcceptsGroupVersion(objGV) { + err = errors.NewBadRequest(fmt.Sprintf("the API version in the data (%s) does not match the expected API version (%v)", objGV.String(), gv.String())) scope.err(err, w, req) return } @@ -141,7 +143,7 @@ func createHandler(r rest.NamedCreater, scope *RequestScope, admit admission.Int ae := request.AuditEventFrom(ctx) admit = admission.WithAudit(admit, ae) - audit.LogRequestObject(ae, obj, scope.Resource, scope.Subresource, scope.Serializer) + audit.LogRequestObject(ae, obj, objGV, scope.Resource, scope.Subresource, scope.Serializer) userInfo, _ := request.UserFrom(ctx) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go index c1a1fc987eee..9b2b9b60a2ca 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go @@ -92,7 +92,7 @@ func DeleteResource(r rest.GracefulDeleter, allowsOptions bool, scope *RequestSc // For backwards compatibility, we need to allow existing clients to submit per group DeleteOptions // It is also allowed to pass a body with meta.k8s.io/v1.DeleteOptions defaultGVK := scope.MetaGroupVersion.WithKind("DeleteOptions") - obj, _, err := metainternalversionscheme.Codecs.DecoderToVersion(s.Serializer, defaultGVK.GroupVersion()).Decode(body, &defaultGVK, options) + obj, gvk, err := metainternalversionscheme.Codecs.DecoderToVersion(s.Serializer, defaultGVK.GroupVersion()).Decode(body, &defaultGVK, options) if err != nil { scope.err(err, w, req) return @@ -104,7 +104,8 @@ func DeleteResource(r rest.GracefulDeleter, allowsOptions bool, scope *RequestSc trace.Step("Decoded delete options") ae := request.AuditEventFrom(ctx) - audit.LogRequestObject(ae, obj, scope.Resource, scope.Subresource, scope.Serializer) + objGV := gvk.GroupVersion() + audit.LogRequestObject(ae, obj, objGV, scope.Resource, scope.Subresource, scope.Serializer) trace.Step("Recorded the audit event") } else { if err := metainternalversionscheme.ParameterCodec.DecodeParameters(req.URL.Query(), scope.MetaGroupVersion, options); err != nil { @@ -144,6 +145,7 @@ func DeleteResource(r rest.GracefulDeleter, allowsOptions bool, scope *RequestSc // Other cases where resource is not instantly deleted are: namespace deletion // and pod graceful deletion. //lint:ignore SA1019 backwards compatibility + //nolint: staticcheck if !wasDeleted && options.OrphanDependents != nil && !*options.OrphanDependents { status = http.StatusAccepted } @@ -238,7 +240,7 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope *RequestSc // For backwards compatibility, we need to allow existing clients to submit per group DeleteOptions // It is also allowed to pass a body with meta.k8s.io/v1.DeleteOptions defaultGVK := scope.Kind.GroupVersion().WithKind("DeleteOptions") - obj, _, err := scope.Serializer.DecoderToVersion(s.Serializer, defaultGVK.GroupVersion()).Decode(body, &defaultGVK, options) + obj, gvk, err := scope.Serializer.DecoderToVersion(s.Serializer, defaultGVK.GroupVersion()).Decode(body, &defaultGVK, options) if err != nil { scope.err(err, w, req) return @@ -249,7 +251,8 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope *RequestSc } ae := request.AuditEventFrom(ctx) - audit.LogRequestObject(ae, obj, scope.Resource, scope.Subresource, scope.Serializer) + objGV := gvk.GroupVersion() + audit.LogRequestObject(ae, obj, objGV, scope.Resource, scope.Subresource, scope.Serializer) } else { if err := metainternalversionscheme.ParameterCodec.DecodeParameters(req.URL.Query(), scope.MetaGroupVersion, options); err != nil { err = errors.NewBadRequest(err.Error()) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/admission.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/admission.go index 20bbab065056..26d264fe833b 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/admission.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/admission.go @@ -60,7 +60,10 @@ func (admit *managedFieldsValidatingAdmissionController) Admit(ctx context.Conte } objectMeta, err := meta.Accessor(a.GetObject()) if err != nil { - return err + // the object we are dealing with doesn't have object metadata defined + // in that case we don't have to keep track of the managedField + // just call the wrapped admission + return mutationInterface.Admit(ctx, a, o) } managedFieldsBeforeAdmission := objectMeta.GetManagedFields() if err := mutationInterface.Admit(ctx, a, o); err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/lastappliedupdater.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/lastappliedupdater.go index 91e2e9691473..7cd4eb1289b0 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/lastappliedupdater.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/lastappliedupdater.go @@ -21,6 +21,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" + apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" ) @@ -78,8 +79,8 @@ func hasLastApplied(obj runtime.Object) bool { if annotations == nil { return false } - _, ok := annotations[corev1.LastAppliedConfigAnnotation] - return ok + lastApplied, ok := annotations[corev1.LastAppliedConfigAnnotation] + return ok && len(lastApplied) > 0 } func setLastApplied(obj runtime.Object, value string) error { @@ -92,6 +93,9 @@ func setLastApplied(obj runtime.Object, value string) error { annotations = map[string]string{} } annotations[corev1.LastAppliedConfigAnnotation] = value + if err := apimachineryvalidation.ValidateAnnotationsSize(annotations); err != nil { + delete(annotations, corev1.LastAppliedConfigAnnotation) + } accessor.SetAnnotations(annotations) return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go index 42b81c7f7034..dd7651718b90 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go @@ -21,10 +21,14 @@ import ( "fmt" "net/http" goruntime "runtime" + "time" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apiserver/pkg/endpoints/metrics" + "k8s.io/klog/v2" ) // ResultFunc is a function that returns a rest result and can be run in a goroutine @@ -62,10 +66,27 @@ func (r *result) Return() (runtime.Object, error) { } } +// PostTimeoutLoggerFunc is a function that can be used to log the result returned +// by a ResultFunc after the request had timed out. +// timedOutAt is the time the request had been timed out. +// r is the result returned by the child goroutine. +type PostTimeoutLoggerFunc func(timedOutAt time.Time, r *result) + +const ( + // how much time the post-timeout receiver goroutine will wait for the sender + // (child goroutine executing ResultFunc) to send a result after the request. + // had timed out. + postTimeoutLoggerWait = 5 * time.Minute +) + // FinishRequest makes a given ResultFunc asynchronous and handles errors returned by the response. func FinishRequest(ctx context.Context, fn ResultFunc) (runtime.Object, error) { - // the channel needs to be buffered to prevent the goroutine below from hanging indefinitely - // when the select statement reads something other than the one the goroutine sends on. + return finishRequest(ctx, fn, postTimeoutLoggerWait, logPostTimeoutResult) +} + +func finishRequest(ctx context.Context, fn ResultFunc, postTimeoutWait time.Duration, postTimeoutLogger PostTimeoutLoggerFunc) (runtime.Object, error) { + // the channel needs to be buffered since the post-timeout receiver goroutine + // waits up to 5 minutes for the child goroutine to return. resultCh := make(chan *result, 1) go func() { @@ -104,6 +125,52 @@ func FinishRequest(ctx context.Context, fn ResultFunc) (runtime.Object, error) { case result := <-resultCh: return result.Return() case <-ctx.Done(): - return nil, errors.NewTimeoutError(fmt.Sprintf("request did not complete within requested timeout %s", ctx.Err()), 0) + // we are going to send a timeout response to the caller, but the asynchronous goroutine + // (sender) is still executing the ResultFunc function. + // kick off a goroutine (receiver) here to wait for the sender (goroutine executing ResultFunc) + // to send the result and then log details of the result. + defer func() { + go func() { + timedOutAt := time.Now() + + var result *result + select { + case result = <-resultCh: + case <-time.After(postTimeoutWait): + // we will not wait forever, if we are here then we know that some sender + // goroutines are taking longer than postTimeoutWait. + } + postTimeoutLogger(timedOutAt, result) + }() + }() + return nil, errors.NewTimeoutError(fmt.Sprintf("request did not complete within requested timeout - %s", ctx.Err()), 0) } } + +// logPostTimeoutResult logs a panic or an error from the result that the sender (goroutine that is +// executing the ResultFunc function) has sent to the receiver after the request had timed out. +// timedOutAt is the time the request had been timed out +func logPostTimeoutResult(timedOutAt time.Time, r *result) { + if r == nil { + // we are using r == nil to indicate that the child goroutine never returned a result. + metrics.RecordRequestPostTimeout(metrics.PostTimeoutSourceRestHandler, metrics.PostTimeoutHandlerPending) + klog.Errorf("FinishRequest: post-timeout activity, waited for %s, child goroutine has not returned yet", time.Since(timedOutAt)) + return + } + + var status string + switch { + case r.reason != nil: + // a non empty reason inside a result object indicates that there was a panic. + status = metrics.PostTimeoutHandlerPanic + case r.err != nil: + status = metrics.PostTimeoutHandlerError + default: + status = metrics.PostTimeoutHandlerOK + } + + metrics.RecordRequestPostTimeout(metrics.PostTimeoutSourceRestHandler, status) + err := fmt.Errorf("FinishRequest: post-timeout activity - time-elapsed: %s, panicked: %t, err: %v, panic-reason: %v", + time.Since(timedOutAt), r.reason != nil, r.err, r.reason) + utilruntime.HandleError(err) +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go index ceae03eee395..e0dbd54a54cc 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go @@ -110,15 +110,16 @@ func UpdateResource(r rest.Updater, scope *RequestScope, admit admission.Interfa scope.err(err, w, req) return } - if !scope.AcceptsGroupVersion(gvk.GroupVersion()) { - err = errors.NewBadRequest(fmt.Sprintf("the API version in the data (%s) does not match the expected API version (%s)", gvk.GroupVersion(), defaultGVK.GroupVersion())) + objGV := gvk.GroupVersion() + if !scope.AcceptsGroupVersion(objGV) { + err = errors.NewBadRequest(fmt.Sprintf("the API version in the data (%s) does not match the expected API version (%s)", objGV, defaultGVK.GroupVersion())) scope.err(err, w, req) return } trace.Step("Conversion done") ae := request.AuditEventFrom(ctx) - audit.LogRequestObject(ae, obj, scope.Resource, scope.Subresource, scope.Serializer) + audit.LogRequestObject(ae, obj, objGV, scope.Resource, scope.Subresource, scope.Serializer) admit = admission.WithAudit(admit, ae) if err := checkName(obj, name, namespace, scope.Namer); err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/installer.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/installer.go index eb100646538a..0902add4823c 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/installer.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/installer.go @@ -669,8 +669,6 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag // accumulate endpoint-level warnings var ( - enableWarningHeaders = utilfeature.DefaultFeatureGate.Enabled(features.WarningHeaders) - warnings []string deprecated bool removedRelease string @@ -702,9 +700,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } else { handler = metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, handler) } - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) doc := "read the specified " + kind if isSubresource { @@ -730,9 +726,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag doc = "list " + subresource + " of objects of kind " + kind } handler := metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, restfulListResource(lister, watcher, reqScope, false, a.minRequestTimeout)) - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) route := ws.GET(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). @@ -765,9 +759,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag doc = "replace " + subresource + " of the specified " + kind } handler := metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, restfulUpdateResource(updater, reqScope, admit)) - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) route := ws.PUT(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). @@ -798,9 +790,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag supportedTypes = append(supportedTypes, string(types.ApplyPatchType)) } handler := metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, restfulPatchResource(patcher, reqScope, admit, supportedTypes)) - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) route := ws.PATCH(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). @@ -825,9 +815,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag handler = restfulCreateResource(creater, reqScope, admit) } handler = metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, handler) - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) article := GetArticleForNoun(kind, " ") doc := "create" + article + kind if isSubresource { @@ -861,9 +849,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag deleteReturnType = producedObject } handler := metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, restfulDeleteResource(gracefulDeleter, isGracefulDeleter, reqScope, admit)) - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) route := ws.DELETE(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). @@ -887,9 +873,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag doc = "delete collection of " + subresource + " of a " + kind } handler := metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, restfulDeleteCollection(collectionDeleter, isCollectionDeleter, reqScope, admit)) - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) route := ws.DELETE(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). @@ -917,9 +901,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } doc += ". deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter." handler := metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, restfulListResource(lister, watcher, reqScope, true, a.minRequestTimeout)) - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) route := ws.GET(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). @@ -940,9 +922,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } doc += ". deprecated: use the 'watch' parameter with a list operation instead." handler := metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, restfulListResource(lister, watcher, reqScope, true, a.minRequestTimeout)) - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) route := ws.GET(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). @@ -966,9 +946,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag doc = "connect " + method + " requests to " + subresource + " of " + kind } handler := metrics.InstrumentRouteFunc(action.Verb, group, version, resource, subresource, requestScope, metrics.APIServerComponent, deprecated, removedRelease, restfulConnectResource(connecter, reqScope, admit, path, isSubresource)) - if enableWarningHeaders { - handler = utilwarning.AddWarningsHandler(handler, warnings) - } + handler = utilwarning.AddWarningsHandler(handler, warnings) route := ws.Method(method).Path(action.Path). To(handler). Doc(doc). diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go index a278566438ce..979859920836 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go @@ -54,7 +54,7 @@ const ( /* * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with @@ -65,7 +65,7 @@ var ( &compbasemetrics.GaugeOpts{ Name: "apiserver_requested_deprecated_apis", Help: "Gauge of deprecated APIs that have been requested, broken out by API group, version, resource, subresource, and removed_release.", - StabilityLevel: compbasemetrics.ALPHA, + StabilityLevel: compbasemetrics.STABLE, }, []string{"group", "version", "resource", "subresource", "removed_release"}, ) @@ -211,6 +211,26 @@ var ( []string{"verb", "group", "version", "resource", "subresource", "scope"}, ) + // requestPostTimeoutTotal tracks the activity of the executing request handler after the associated request + // has been timed out by the apiserver. + // source: the name of the handler that is recording this metric. Currently, we have two: + // - timeout-handler: the "executing" handler returns after the timeout filter times out the request. + // - rest-handler: the "executing" handler returns after the rest layer times out the request. + // status: whether the handler panicked or threw an error, possible values: + // - 'panic': the handler panicked + // - 'error': the handler return an error + // - 'ok': the handler returned a result (no error and no panic) + // - 'pending': the handler is still running in the background and it did not return + // within the wait threshold. + requestPostTimeoutTotal = compbasemetrics.NewCounterVec( + &compbasemetrics.CounterOpts{ + Name: "apiserver_request_post_timeout_total", + Help: "Tracks the activity of the request handlers after the associated requests have been timed out by the apiserver", + StabilityLevel: compbasemetrics.ALPHA, + }, + []string{"source", "status"}, + ) + metrics = []resettableCollector{ deprecatedRequestGauge, requestCounter, @@ -228,6 +248,7 @@ var ( apiSelfRequestCounter, requestFilterDuration, requestAbortsTotal, + requestPostTimeoutTotal, } // these are the valid request methods which we report in our metrics. Any other request methods @@ -271,6 +292,36 @@ const ( removedReleaseAnnotationKey = "k8s.io/removed-release" ) +const ( + // The source that is recording the apiserver_request_post_timeout_total metric. + // The "executing" request handler returns after the timeout filter times out the request. + PostTimeoutSourceTimeoutHandler = "timeout-handler" + + // The source that is recording the apiserver_request_post_timeout_total metric. + // The "executing" request handler returns after the rest layer times out the request. + PostTimeoutSourceRestHandler = "rest-handler" +) + +const ( + // The executing request handler panicked after the request had + // been timed out by the apiserver. + PostTimeoutHandlerPanic = "panic" + + // The executing request handler has returned an error to the post-timeout + // receiver after the request had been timed out by the apiserver. + PostTimeoutHandlerError = "error" + + // The executing request handler has returned a result to the post-timeout + // receiver after the request had been timed out by the apiserver. + PostTimeoutHandlerOK = "ok" + + // The executing request handler has not panicked or returned any error/result to + // the post-timeout receiver yet after the request had been timed out by the apiserver. + // The post-timeout receiver gives up after waiting for certain threshold and if the + // executing request handler has not returned yet we use the following label. + PostTimeoutHandlerPending = "pending" +) + var registerMetrics sync.Once // Register all metrics. @@ -308,6 +359,10 @@ func RecordFilterLatency(ctx context.Context, name string, elapsed time.Duration requestFilterDuration.WithContext(ctx).WithLabelValues(name).Observe(elapsed.Seconds()) } +func RecordRequestPostTimeout(source string, status string) { + requestPostTimeoutTotal.WithLabelValues(source, status).Inc() +} + // RecordRequestAbort records that the request was aborted possibly due to a timeout. func RecordRequestAbort(req *http.Request, requestInfo *request.RequestInfo) { if requestInfo == nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/features/kube_features.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/features/kube_features.go index 6b7747fd9c7e..84a685921407 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/features/kube_features.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/features/kube_features.go @@ -38,12 +38,13 @@ const ( // StreamingProxyRedirects controls whether the apiserver should intercept (and follow) // redirects from the backend (Kubelet) for streaming requests (exec/attach/port-forward). // - // This feature is deprecated, and will be removed in v1.22. + // This feature is deprecated, and will be removed in v1.24. StreamingProxyRedirects featuregate.Feature = "StreamingProxyRedirects" // owner: @tallclair // alpha: v1.12 // beta: v1.14 + // deprecated: v1.22 // // ValidateProxyRedirects controls whether the apiserver should validate that redirects are only // followed to the same host. Only used if StreamingProxyRedirects is enabled. @@ -146,6 +147,7 @@ const ( // owner: @liggitt // beta: v1.19 + // GA: v1.22 // // Allows sending warning headers in API responses. WarningHeaders featuregate.Feature = "WarningHeaders" @@ -172,8 +174,8 @@ func init() { // To add a new feature, define a key for it above and add it here. The features will be // available throughout Kubernetes binaries. var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ - StreamingProxyRedirects: {Default: true, PreRelease: featuregate.Deprecated}, - ValidateProxyRedirects: {Default: true, PreRelease: featuregate.Beta}, + StreamingProxyRedirects: {Default: false, PreRelease: featuregate.Deprecated}, + ValidateProxyRedirects: {Default: true, PreRelease: featuregate.Deprecated}, AdvancedAuditing: {Default: true, PreRelease: featuregate.GA}, APIResponseCompression: {Default: true, PreRelease: featuregate.Beta}, APIListChunking: {Default: true, PreRelease: featuregate.Beta}, @@ -186,7 +188,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS APIPriorityAndFairness: {Default: true, PreRelease: featuregate.Beta}, RemoveSelfLink: {Default: true, PreRelease: featuregate.Beta}, SelectorIndex: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - WarningHeaders: {Default: true, PreRelease: featuregate.Beta}, + WarningHeaders: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, EfficientWatchResumption: {Default: true, PreRelease: featuregate.Beta}, APIServerIdentity: {Default: false, PreRelease: featuregate.Alpha}, } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/decorated_watcher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/decorated_watcher.go index e341b371df6f..e066d2a7fa7e 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/decorated_watcher.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/decorated_watcher.go @@ -29,8 +29,8 @@ type decoratedWatcher struct { resultCh chan watch.Event } -func newDecoratedWatcher(w watch.Interface, decorator func(runtime.Object)) *decoratedWatcher { - ctx, cancel := context.WithCancel(context.Background()) +func newDecoratedWatcher(ctx context.Context, w watch.Interface, decorator func(runtime.Object)) *decoratedWatcher { + ctx, cancel := context.WithCancel(ctx) d := &decoratedWatcher{ w: w, decorator: decorator, @@ -41,14 +41,18 @@ func newDecoratedWatcher(w watch.Interface, decorator func(runtime.Object)) *dec return d } +// run decorates watch events from the underlying watcher until its result channel +// is closed or the passed in context is done. +// When run() returns, decoratedWatcher#resultCh is closed. func (d *decoratedWatcher) run(ctx context.Context) { var recv, send watch.Event var ok bool + defer close(d.resultCh) for { select { case recv, ok = <-d.w.ResultChan(): - // The underlying channel may be closed after timeout. if !ok { + // The underlying channel was closed, cancel our context d.cancel() return } @@ -61,20 +65,24 @@ func (d *decoratedWatcher) run(ctx context.Context) { } select { case d.resultCh <- send: - if send.Type == watch.Error { - d.cancel() - } + // propagated event successfully case <-ctx.Done(): + // context timed out or was cancelled, stop the underlying watcher + d.w.Stop() + return } case <-ctx.Done(): + // context timed out or was cancelled, stop the underlying watcher d.w.Stop() - close(d.resultCh) return } } } func (d *decoratedWatcher) Stop() { + // stop the underlying watcher + d.w.Stop() + // cancel our context d.cancel() } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go index d40214f9db9b..0fe82ed0c974 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go @@ -1226,7 +1226,7 @@ func (e *Store) WatchPredicate(ctx context.Context, p storage.SelectionPredicate return nil, err } if e.Decorator != nil { - return newDecoratedWatcher(w, e.Decorator), nil + return newDecoratedWatcher(ctx, w, e.Decorator), nil } return w, nil } @@ -1239,7 +1239,7 @@ func (e *Store) WatchPredicate(ctx context.Context, p storage.SelectionPredicate return nil, err } if e.Decorator != nil { - return newDecoratedWatcher(w, e.Decorator), nil + return newDecoratedWatcher(ctx, w, e.Decorator), nil } return w, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/create.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/create.go index dd70a4eb780e..950260e457c0 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/create.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/create.go @@ -31,6 +31,7 @@ import ( "k8s.io/apiserver/pkg/features" "k8s.io/apiserver/pkg/storage/names" utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/apiserver/pkg/warning" ) // RESTCreateStrategy defines the minimum validation, accepted input, and @@ -59,6 +60,26 @@ type RESTCreateStrategy interface { // before the object is persisted. This method should not mutate the // object. Validate(ctx context.Context, obj runtime.Object) field.ErrorList + // WarningsOnCreate returns warnings to the client performing a create. + // WarningsOnCreate is invoked after default fields in the object have been filled in + // and after Validate has passed, before Canonicalize is called, and the object is persisted. + // This method must not mutate the object. + // + // Be brief; limit warnings to 120 characters if possible. + // Don't include a "Warning:" prefix in the message (that is added by clients on output). + // Warnings returned about a specific field should be formatted as "path.to.field: message". + // For example: `spec.imagePullSecrets[0].name: invalid empty name ""` + // + // Use warning messages to describe problems the client making the API request should correct or be aware of. + // For example: + // - use of deprecated fields/labels/annotations that will stop working in a future release + // - use of obsolete fields/labels/annotations that are non-functional + // - malformed or invalid specifications that prevent successful handling of the submitted object, + // but are not rejected by validation for compatibility reasons + // + // Warnings should not be returned for fields which cannot be resolved by the caller. + // For example, do not warn about spec fields in a subresource creation request. + WarningsOnCreate(ctx context.Context, obj runtime.Object) []string // Canonicalize allows an object to be mutated into a canonical form. This // ensures that code that operates on these objects can rely on the common // form for things like comparison. Canonicalize is invoked after @@ -113,6 +134,10 @@ func BeforeCreate(strategy RESTCreateStrategy, ctx context.Context, obj runtime. return errors.NewInvalid(kind.GroupKind(), objectMeta.GetName(), errs) } + for _, w := range strategy.WarningsOnCreate(ctx, obj) { + warning.AddWarning(ctx, "", w) + } + strategy.Canonicalize(obj) return nil diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/create_update.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/create_update.go index 37d6c8f8ada4..acef76fa63e2 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/create_update.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/create_update.go @@ -39,6 +39,26 @@ type RESTCreateUpdateStrategy interface { // filled in before the object is persisted. This method should not mutate // the object. ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList + // WarningsOnUpdate returns warnings to the client performing the update. + // WarningsOnUpdate is invoked after default fields in the object have been filled in + // and after ValidateUpdate has passed, before Canonicalize is called, and before the object is persisted. + // This method must not mutate either object. + // + // Be brief; limit warnings to 120 characters if possible. + // Don't include a "Warning:" prefix in the message (that is added by clients on output). + // Warnings returned about a specific field should be formatted as "path.to.field: message". + // For example: `spec.imagePullSecrets[0].name: invalid empty name ""` + // + // Use warning messages to describe problems the client making the API request should correct or be aware of. + // For example: + // - use of deprecated fields/labels/annotations that will stop working in a future release + // - use of obsolete fields/labels/annotations that are non-functional + // - malformed or invalid specifications that prevent successful handling of the submitted object, + // but are not rejected by validation for compatibility reasons + // + // Warnings should not be returned for fields which cannot be resolved by the caller. + // For example, do not warn about spec fields in a status update. + WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string // AllowUnconditionalUpdate returns true if the object can be updated // unconditionally (irrespective of the latest resource version), when // there is no resource version specified in the object. diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/update.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/update.go index 0741b84ec297..ffcca33c05ee 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/update.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/registry/rest/update.go @@ -30,6 +30,7 @@ import ( "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/features" utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/apiserver/pkg/warning" ) // RESTUpdateStrategy defines the minimum validation, accepted input, and @@ -51,6 +52,26 @@ type RESTUpdateStrategy interface { // filled in before the object is persisted. This method should not mutate // the object. ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList + // WarningsOnUpdate returns warnings to the client performing the update. + // WarningsOnUpdate is invoked after default fields in the object have been filled in + // and after ValidateUpdate has passed, before Canonicalize is called, and before the object is persisted. + // This method must not mutate either object. + // + // Be brief; limit warnings to 120 characters if possible. + // Don't include a "Warning:" prefix in the message (that is added by clients on output). + // Warnings returned about a specific field should be formatted as "path.to.field: message". + // For example: `spec.imagePullSecrets[0].name: invalid empty name ""` + // + // Use warning messages to describe problems the client making the API request should correct or be aware of. + // For example: + // - use of deprecated fields/labels/annotations that will stop working in a future release + // - use of obsolete fields/labels/annotations that are non-functional + // - malformed or invalid specifications that prevent successful handling of the submitted object, + // but are not rejected by validation for compatibility reasons + // + // Warnings should not be returned for fields which cannot be resolved by the caller. + // For example, do not warn about spec fields in a status update. + WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string // Canonicalize allows an object to be mutated into a canonical form. This // ensures that code that operates on these objects can rely on the common // form for things like comparison. Canonicalize is invoked after @@ -144,6 +165,10 @@ func BeforeUpdate(strategy RESTUpdateStrategy, ctx context.Context, obj, old run return errors.NewInvalid(kind.GroupKind(), objectMeta.GetName(), errs) } + for _, w := range strategy.WarningsOnUpdate(ctx, obj, old) { + warning.AddWarning(ctx, "", w) + } + strategy.Canonicalize(obj) return nil diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config.go index a02958e29ece..32825f379c76 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config.go @@ -593,6 +593,8 @@ func (c completedConfig) New(name string, delegationTarget DelegationTarget) (*G APIServerID: c.APIServerID, StorageVersionManager: c.StorageVersionManager, + + Version: c.Version, } for { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config_selfclient.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config_selfclient.go index f2c2de9b324c..9a224d3f75a6 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config_selfclient.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/config_selfclient.go @@ -42,8 +42,6 @@ func (s *SecureServingInfo) NewClientConfig(caCert []byte) (*restclient.Config, // Do not limit loopback client QPS. QPS: -1, Host: "https://" + net.JoinHostPort(host, port), - // override the ServerName to select our loopback certificate via SNI. This name is also - // used by the client to compare the returns server certificate against. TLSClientConfig: restclient.TLSClientConfig{ CAData: caCert, }, @@ -57,6 +55,8 @@ func (s *SecureServingInfo) NewLoopbackClientConfig(token string, loopbackCert [ } c.BearerToken = token + // override the ServerName to select our loopback certificate via SNI. This name is also + // used by the client to compare the returns server certificate against. c.TLSClientConfig.ServerName = LoopbackClientServerNameOverride return c, nil diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/deleted_kinds.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/deleted_kinds.go index e9aed99ed6b4..f9735a8393e7 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/deleted_kinds.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/deleted_kinds.go @@ -54,7 +54,10 @@ type ResourceExpirationEvaluator interface { } func NewResourceExpirationEvaluator(currentVersion apimachineryversion.Info) (ResourceExpirationEvaluator, error) { - ret := &resourceExpirationEvaluator{} + ret := &resourceExpirationEvaluator{ + // TODO https://github.com/kubernetes/kubernetes/issues/101951 set this back to false after beta is tagged. + strictRemovedHandlingInAlpha: true, + } if len(currentVersion.Major) > 0 { currentMajor64, err := strconv.ParseInt(currentVersion.Major, 10, 32) if err != nil { @@ -83,6 +86,7 @@ func NewResourceExpirationEvaluator(currentVersion apimachineryversion.Info) (Re } else { ret.strictRemovedHandlingInAlpha = envBool } + if envString, ok := os.LookupEnv("KUBE_APISERVER_SERVE_REMOVED_APIS_FOR_ONE_RELEASE"); !ok { // do nothing } else if envBool, err := strconv.ParseBool(envString); err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go index f3d6b9680eed..b09474bc4fea 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go @@ -198,8 +198,8 @@ func (c *ConfigMapCAController) Run(workers int, stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer c.queue.ShutDown() - klog.Infof("Starting %s", c.name) - defer klog.Infof("Shutting down %s", c.name) + klog.InfoS("Starting controller", "name", c.name) + defer klog.InfoS("Shutting down controller", "name", c.name) // we have a personal informer that is narrowly scoped, start it. go c.configMapInformer.Run(stopCh) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go index 6995334b37a6..15f3c1dad18e 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go @@ -114,7 +114,7 @@ func (c *DynamicFileCAContent) loadCABundle() error { return err } c.caBundle.Store(caBundleAndVerifier) - klog.V(2).Infof("Loaded a new CA Bundle and Verifier for %q", c.Name()) + klog.V(2).InfoS("Loaded a new CA Bundle and Verifier", "name", c.Name()) for _, listener := range c.listeners { listener.Enqueue() @@ -152,8 +152,8 @@ func (c *DynamicFileCAContent) Run(workers int, stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer c.queue.ShutDown() - klog.Infof("Starting %s", c.name) - defer klog.Infof("Shutting down %s", c.name) + klog.InfoS("Starting controller", "name", c.name) + defer klog.InfoS("Shutting down controller", "name", c.name) // doesn't matter what workers say, only start one. go wait.Until(c.runWorker, time.Second, stopCh) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go index 9a5dc0f4b50f..de79fb58f5f5 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go @@ -107,7 +107,7 @@ func (c *DynamicCertKeyPairContent) loadCertKeyPair() error { } c.certKeyPair.Store(newCertKey) - klog.V(2).Infof("Loaded a new cert/key pair for %q", c.Name()) + klog.V(2).InfoS("Loaded a new cert/key pair", "name", c.Name()) for _, listener := range c.listeners { listener.Enqueue() @@ -126,8 +126,8 @@ func (c *DynamicCertKeyPairContent) Run(workers int, stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer c.queue.ShutDown() - klog.Infof("Starting %s", c.name) - defer klog.Infof("Shutting down %s", c.name) + klog.InfoS("Starting controller", "name", c.name) + defer klog.InfoS("Shutting down controller", "name", c.name) // doesn't matter what workers say, only start one. go wait.Until(c.runWorker, time.Second, stopCh) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/named_certificates.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/named_certificates.go index 8f55edec4e64..ee0aa8de0f16 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/named_certificates.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/named_certificates.go @@ -50,7 +50,7 @@ func (c *DynamicServingCertificateController) BuildNamedCertificates(sniCerts [] byNameExplicit[name] = &cert } - klog.V(2).Infof("loaded SNI cert [%d/%q]: %s", i, c.sniCerts[i].Name(), GetHumanCertDetail(x509Cert)) + klog.V(2).InfoS("Loaded SNI cert", "index", i, "certName", c.sniCerts[i].Name(), "certDetail", GetHumanCertDetail(x509Cert)) if c.eventRecorder != nil { c.eventRecorder.Eventf(&corev1.ObjectReference{Name: c.sniCerts[i].Name()}, nil, corev1.EventTypeWarning, "TLSConfigChanged", "SNICertificateReload", "loaded SNI cert [%d/%q]: %s with explicit names %v", i, c.sniCerts[i].Name(), GetHumanCertDetail(x509Cert), names) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/tlsconfig.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/tlsconfig.go index f637f32331bc..56e7ffd27553 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/tlsconfig.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/tlsconfig.go @@ -175,7 +175,7 @@ func (c *DynamicServingCertificateController) syncCerts() error { return fmt.Errorf("unable to load client CA file %q: %v", string(newContent.clientCA.caBundle), err) } for i, cert := range newClientCAs { - klog.V(2).Infof("loaded client CA [%d/%q]: %s", i, c.clientCA.Name(), GetHumanCertDetail(cert)) + klog.V(2).InfoS("Loaded client CA", "index", i, "certName", c.clientCA.Name(), "certDetail", GetHumanCertDetail(cert)) if c.eventRecorder != nil { c.eventRecorder.Eventf(&corev1.ObjectReference{Name: c.clientCA.Name()}, nil, corev1.EventTypeWarning, "TLSConfigChanged", "CACertificateReload", "loaded client CA [%d/%q]: %s", i, c.clientCA.Name(), GetHumanCertDetail(cert)) } @@ -197,7 +197,7 @@ func (c *DynamicServingCertificateController) syncCerts() error { return fmt.Errorf("invalid serving cert: %v", err) } - klog.V(2).Infof("loaded serving cert [%q]: %s", c.servingCert.Name(), GetHumanCertDetail(x509Cert)) + klog.V(2).InfoS("Loaded serving cert", "certName", c.servingCert.Name(), "certDetail", GetHumanCertDetail(x509Cert)) if c.eventRecorder != nil { c.eventRecorder.Eventf(&corev1.ObjectReference{Name: c.servingCert.Name()}, nil, corev1.EventTypeWarning, "TLSConfigChanged", "ServingCertificateReload", "loaded serving cert [%q]: %s", c.servingCert.Name(), GetHumanCertDetail(x509Cert)) } @@ -237,8 +237,8 @@ func (c *DynamicServingCertificateController) Run(workers int, stopCh <-chan str defer utilruntime.HandleCrash() defer c.queue.ShutDown() - klog.Infof("Starting DynamicServingCertificateController") - defer klog.Infof("Shutting down DynamicServingCertificateController") + klog.InfoS("Starting DynamicServingCertificateController") + defer klog.InfoS("Shutting down DynamicServingCertificateController") // synchronously load once. We will trigger again, so ignoring any error is fine _ = c.RunOnce() diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go index 2484bfc76c8f..70c8d8b855c4 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go @@ -47,7 +47,10 @@ const ( observationMaintenancePeriod = 10 * time.Second ) -var nonMutatingRequestVerbs = sets.NewString("get", "list", "watch") +var ( + nonMutatingRequestVerbs = sets.NewString("get", "list", "watch") + watchVerbs = sets.NewString("watch") +) func handleError(w http.ResponseWriter, r *http.Request, err error) { errorMsg := fmt.Sprintf("Internal Server Error: %#v", r.RequestURI) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go index 186824e2f265..23ea5b7287ad 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go @@ -17,9 +17,9 @@ limitations under the License. package filters import ( - "context" "fmt" "net/http" + "runtime" "sync/atomic" flowcontrol "k8s.io/api/flowcontrol/v1beta1" @@ -31,10 +31,6 @@ import ( "k8s.io/klog/v2" ) -type priorityAndFairnessKeyType int - -const priorityAndFairnessKey priorityAndFairnessKeyType = iota - // PriorityAndFairnessClassification identifies the results of // classification for API Priority and Fairness type PriorityAndFairnessClassification struct { @@ -44,12 +40,6 @@ type PriorityAndFairnessClassification struct { PriorityLevelUID apitypes.UID } -// GetClassification returns the classification associated with the -// given context, if any, otherwise nil -func GetClassification(ctx context.Context) *PriorityAndFairnessClassification { - return ctx.Value(priorityAndFairnessKey).(*PriorityAndFairnessClassification) -} - // waitingMark tracks requests waiting rather than being executed var waitingMark = &requestWatermark{ phase: epmetrics.WaitingPhase, @@ -60,6 +50,9 @@ var waitingMark = &requestWatermark{ var atomicMutatingExecuting, atomicReadOnlyExecuting int32 var atomicMutatingWaiting, atomicReadOnlyWaiting int32 +// newInitializationSignal is defined for testing purposes. +var newInitializationSignal = utilflowcontrol.NewInitializationSignal + // WithPriorityAndFairness limits the number of in-flight // requests in a fine-grained way. func WithPriorityAndFairness( @@ -84,8 +77,10 @@ func WithPriorityAndFairness( return } - // Skip tracking long running requests. - if longRunningRequestCheck != nil && longRunningRequestCheck(r, requestInfo) { + isWatchRequest := watchVerbs.Has(requestInfo.Verb) + + // Skip tracking long running non-watch requests. + if longRunningRequestCheck != nil && longRunningRequestCheck(r, requestInfo) && !isWatchRequest { klog.V(6).Infof("Serving RequestInfo=%#+v, user.Info=%#+v as longrunning\n", requestInfo, user) handler.ServeHTTP(w, r) return @@ -116,15 +111,53 @@ func WithPriorityAndFairness( waitingMark.recordReadOnly(int(atomic.AddInt32(&atomicReadOnlyWaiting, delta))) } } + var resultCh chan interface{} + if isWatchRequest { + resultCh = make(chan interface{}) + } execute := func() { noteExecutingDelta(1) defer noteExecutingDelta(-1) served = true - innerCtx := context.WithValue(ctx, priorityAndFairnessKey, classification) - innerReq := r.Clone(innerCtx) + + innerCtx := ctx + innerReq := r + + var watchInitializationSignal utilflowcontrol.InitializationSignal + if isWatchRequest { + watchInitializationSignal = newInitializationSignal() + innerCtx = utilflowcontrol.WithInitializationSignal(ctx, watchInitializationSignal) + innerReq = r.Clone(innerCtx) + } setResponseHeaders(classification, w) - handler.ServeHTTP(w, innerReq) + if isWatchRequest { + go func() { + defer func() { + err := recover() + // do not wrap the sentinel ErrAbortHandler panic value + if err != nil && err != http.ErrAbortHandler { + // Same as stdlib http server code. Manually allocate stack + // trace buffer size to prevent excessively large logs + const size = 64 << 10 + buf := make([]byte, size) + buf = buf[:runtime.Stack(buf, false)] + err = fmt.Sprintf("%v\n%s", err, buf) + } + resultCh <- err + }() + + // Protect from the situations when request will not reach storage layer + // and the initialization signal will not be send. + defer watchInitializationSignal.Signal() + + handler.ServeHTTP(w, innerReq) + }() + + watchInitializationSignal.Wait() + } else { + handler.ServeHTTP(w, innerReq) + } } digest := utilflowcontrol.RequestDigest{RequestInfo: requestInfo, User: user} fcIfc.Handle(ctx, digest, note, func(inQueue bool) { @@ -143,9 +176,23 @@ func WithPriorityAndFairness( epmetrics.DroppedRequests.WithContext(ctx).WithLabelValues(epmetrics.ReadOnlyKind).Inc() } epmetrics.RecordRequestTermination(r, requestInfo, epmetrics.APIServerComponent, http.StatusTooManyRequests) + if isWatchRequest { + close(resultCh) + } tooManyRequests(r, w) } + // For watch requests, from the APF point of view the request is already + // finished at this point. However, that doesn't mean it is already finished + // from the non-APF point of view. So we need to wait here until the request is: + // 1) finished being processed or + // 2) rejected + if isWatchRequest { + err := <-resultCh + if err != nil { + panic(err) + } + } }) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go index ccbed60dba5d..69e4fd4f21ce 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go @@ -24,6 +24,7 @@ import ( "net/http" "runtime" "sync" + "time" apierrors "k8s.io/apimachinery/pkg/api/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -119,15 +120,19 @@ func (t *timeoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // the work needs to send to it. This is defer'd to ensure it runs // ever if the post timeout work itself panics. go func() { + timedOutAt := time.Now() res := <-resultCh + + status := metrics.PostTimeoutHandlerOK if res != nil { - switch t := res.(type) { - case error: - utilruntime.HandleError(t) - default: - utilruntime.HandleError(fmt.Errorf("%v", res)) - } + // a non nil res indicates that there was a panic. + status = metrics.PostTimeoutHandlerPanic } + + metrics.RecordRequestPostTimeout(metrics.PostTimeoutSourceTimeoutHandler, status) + err := fmt.Errorf("post-timeout activity - time-elapsed: %s, %v %q result: %v", + time.Since(timedOutAt), r.Method, r.URL.Path, res) + utilruntime.HandleError(err) }() }() diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go index e780b8e4d052..ca0c65652786 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go @@ -34,6 +34,7 @@ import ( "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apimachinery/pkg/util/sets" utilwaitgroup "k8s.io/apimachinery/pkg/util/waitgroup" + "k8s.io/apimachinery/pkg/version" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/audit" "k8s.io/apiserver/pkg/authorization/authorizer" @@ -209,6 +210,9 @@ type GenericAPIServer struct { // StorageVersionManager holds the storage versions of the API resources installed by this server. StorageVersionManager storageversion.Manager + + // Version will enable the /version endpoint if non-nil + Version *version.Info } // DelegationTarget is an interface which allows for composition of API servers with top level handling that works diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go index 386d5b9ca2b5..5650a80600a7 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/httplog/httplog.go @@ -23,6 +23,7 @@ import ( "net" "net/http" "runtime" + "strings" "time" "k8s.io/apiserver/pkg/endpoints/request" @@ -52,7 +53,7 @@ type respLogger struct { statusRecorded bool status int statusStack string - addedInfo string + addedInfo strings.Builder startTime time.Time captureErrorOutput bool @@ -66,6 +67,9 @@ type respLogger struct { // Simple logger that logs immediately when Addf is called type passthroughLogger struct{} +//lint:ignore SA1019 Interface implementation check to make sure we don't drop CloseNotifier again +var _ http.CloseNotifier = &respLogger{} + // Addf logs info immediately. func (passthroughLogger) Addf(format string, data ...interface{}) { klog.V(2).Info(fmt.Sprintf(format, data...)) @@ -80,7 +84,7 @@ func DefaultStacktracePred(status int) bool { func WithLogging(handler http.Handler, pred StacktracePred) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { ctx := req.Context() - if old := respLoggerFromContext(req); old != nil { + if old := respLoggerFromRequest(req); old != nil { panic("multiple WithLogging calls!") } @@ -93,15 +97,14 @@ func WithLogging(handler http.Handler, pred StacktracePred) http.Handler { req = req.WithContext(context.WithValue(ctx, respLoggerContextKey, rl)) if klog.V(3).Enabled() { - defer func() { klog.InfoS("HTTP", rl.LogArgs()...) }() + defer rl.Log() } handler.ServeHTTP(rl, req) }) } // respLoggerFromContext returns the respLogger or nil. -func respLoggerFromContext(req *http.Request) *respLogger { - ctx := req.Context() +func respLoggerFromContext(ctx context.Context) *respLogger { val := ctx.Value(respLoggerContextKey) if rl, ok := val.(*respLogger); ok { return rl @@ -109,6 +112,10 @@ func respLoggerFromContext(req *http.Request) *respLogger { return nil } +func respLoggerFromRequest(req *http.Request) *respLogger { + return respLoggerFromContext(req.Context()) +} + func newLoggedWithStartTime(req *http.Request, w http.ResponseWriter, startTime time.Time) *respLogger { return &respLogger{ startTime: startTime, @@ -127,7 +134,7 @@ func newLogged(req *http.Request, w http.ResponseWriter) *respLogger { // then a passthroughLogger will be created which will log to stdout immediately // when Addf is called. func LogOf(req *http.Request, w http.ResponseWriter) logger { - if rl := respLoggerFromContext(req); rl != nil { + if rl := respLoggerFromRequest(req); rl != nil { return rl } return &passthroughLogger{} @@ -135,7 +142,7 @@ func LogOf(req *http.Request, w http.ResponseWriter) logger { // Unlogged returns the original ResponseWriter, or w if it is not our inserted logger. func Unlogged(req *http.Request, w http.ResponseWriter) http.ResponseWriter { - if rl := respLoggerFromContext(req); rl != nil { + if rl := respLoggerFromRequest(req); rl != nil { return rl.w } return w @@ -163,40 +170,43 @@ func StatusIsNot(statuses ...int) StacktracePred { // Addf adds additional data to be logged with this request. func (rl *respLogger) Addf(format string, data ...interface{}) { - rl.addedInfo += "\n" + fmt.Sprintf(format, data...) + rl.addedInfo.WriteString("\n") + rl.addedInfo.WriteString(fmt.Sprintf(format, data...)) +} + +func AddInfof(ctx context.Context, format string, data ...interface{}) { + if rl := respLoggerFromContext(ctx); rl != nil { + rl.Addf(format, data...) + } } -func (rl *respLogger) LogArgs() []interface{} { +// Log is intended to be called once at the end of your request handler, via defer +func (rl *respLogger) Log() { latency := time.Since(rl.startTime) auditID := request.GetAuditIDTruncated(rl.req) - if rl.hijacked { - return []interface{}{ - "verb", rl.req.Method, - "URI", rl.req.RequestURI, - "latency", latency, - "userAgent", rl.req.UserAgent(), - "audit-ID", auditID, - "srcIP", rl.req.RemoteAddr, - "hijacked", true, - } - } - args := []interface{}{ + keysAndValues := []interface{}{ "verb", rl.req.Method, "URI", rl.req.RequestURI, "latency", latency, "userAgent", rl.req.UserAgent(), "audit-ID", auditID, "srcIP", rl.req.RemoteAddr, - "resp", rl.status, - } - if len(rl.statusStack) > 0 { - args = append(args, "statusStack", rl.statusStack) } - if len(rl.addedInfo) > 0 { - args = append(args, "addedInfo", rl.addedInfo) + if rl.hijacked { + keysAndValues = append(keysAndValues, "hijacked", true) + } else { + keysAndValues = append(keysAndValues, "resp", rl.status) + if len(rl.statusStack) > 0 { + keysAndValues = append(keysAndValues, "statusStack", rl.statusStack) + } + info := rl.addedInfo.String() + if len(info) > 0 { + keysAndValues = append(keysAndValues, "addedInfo", info) + } } - return args + + klog.InfoSDepth(1, "HTTP", keysAndValues...) } // Header implements http.ResponseWriter. @@ -239,6 +249,7 @@ func (rl *respLogger) Hijack() (net.Conn, *bufio.ReadWriter, error) { // CloseNotify implements http.CloseNotifier func (rl *respLogger) CloseNotify() <-chan bool { + //lint:ignore SA1019 There are places in the code base requiring the CloseNotifier interface to be implemented. return rl.w.(http.CloseNotifier).CloseNotify() } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go index 9f9a42f81b01..2317be82d26f 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go @@ -60,10 +60,14 @@ func (s *SecureServingOptionsWithLoopback) ApplyTo(secureServingInfo **server.Se return fmt.Errorf("failed to generate self-signed certificate for loopback connection: %v", err) } + // Write to the front of SNICerts so that this overrides any other certs with the same name + (*secureServingInfo).SNICerts = append([]dynamiccertificates.SNICertKeyContentProvider{certProvider}, (*secureServingInfo).SNICerts...) + secureLoopbackClientConfig, err := (*secureServingInfo).NewLoopbackClientConfig(uuid.New().String(), certPem) switch { // if we failed and there's no fallback loopback client config, we need to fail case err != nil && *loopbackClientConfig == nil: + (*secureServingInfo).SNICerts = (*secureServingInfo).SNICerts[1:] return err // if we failed, but we already have a fallback loopback client config (usually insecure), allow it @@ -71,8 +75,6 @@ func (s *SecureServingOptionsWithLoopback) ApplyTo(secureServingInfo **server.Se default: *loopbackClientConfig = secureLoopbackClientConfig - // Write to the front of SNICerts so that this overrides any other certs with the same name - (*secureServingInfo).SNICerts = append([]dynamiccertificates.SNICertKeyContentProvider{certProvider}, (*secureServingInfo).SNICerts...) } return nil diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go index 23ffc3ae31e5..39e8db0b7673 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go @@ -38,6 +38,7 @@ import ( "k8s.io/apiserver/pkg/features" "k8s.io/apiserver/pkg/storage" utilfeature "k8s.io/apiserver/pkg/util/feature" + utilflowcontrol "k8s.io/apiserver/pkg/util/flowcontrol" "k8s.io/client-go/tools/cache" "k8s.io/klog/v2" utiltrace "k8s.io/utils/trace" @@ -1413,6 +1414,14 @@ func (c *cacheWatcher) process(ctx context.Context, initEvents []*watchCacheEven klog.V(2).Infof("processing %d initEvents of %s (%s) took %v", len(initEvents), objType, c.identifier, processingTime) } + // At this point we already start processing incoming watch events. + // However, the init event can still be processed because their serialization + // and sending to the client happens asynchrnously. + // TODO: As describe in the KEP, we would like to estimate that by delaying + // the initialization signal proportionally to the number of events to + // process, but we're leaving this to the tuning phase. + utilflowcontrol.WatchInitialized(ctx) + defer close(c.result) defer c.Stop() for { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics.go index cf7bad510a3c..4d41889f2a44 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics.go @@ -23,7 +23,7 @@ import ( /* * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with @@ -86,10 +86,10 @@ func init() { // recordsWatchCacheCapacityChange record watchCache capacity resize(increase or decrease) operations. func recordsWatchCacheCapacityChange(objType string, old, new int) { + watchCacheCapacity.WithLabelValues(objType).Set(float64(new)) if old < new { watchCacheCapacityIncreaseTotal.WithLabelValues(objType).Inc() return } watchCacheCapacityDecreaseTotal.WithLabelValues(objType).Inc() - watchCacheCapacity.WithLabelValues(objType).Set(float64(new)) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go index c97a4afc8231..c10eb273e679 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go @@ -26,7 +26,7 @@ import ( /* * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go index bd87382e83f1..1a15fa229ad1 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go @@ -32,6 +32,7 @@ import ( "k8s.io/apiserver/pkg/storage" "k8s.io/apiserver/pkg/storage/etcd3/metrics" "k8s.io/apiserver/pkg/storage/value" + utilflowcontrol "k8s.io/apiserver/pkg/util/flowcontrol" "go.etcd.io/etcd/clientv3" "k8s.io/klog/v2" @@ -120,6 +121,14 @@ func (w *watcher) Watch(ctx context.Context, key string, rev int64, recursive, p } wc := w.createWatchChan(ctx, key, rev, recursive, progressNotify, pred) go wc.run() + + // For etcd watch we don't have an easy way to answer whether the watch + // has already caught up. So in the initial version (given that watchcache + // is by default enabled for all resources but Events), we just deliver + // the initialization signal immediately. Improving this will be explored + // in the future. + utilflowcontrol.WatchInitialized(ctx) + return wc, nil } @@ -283,7 +292,7 @@ func (wc *watchChan) processEvent(wg *sync.WaitGroup) { continue } if len(wc.resultChan) == outgoingBufSize { - klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow dispatching events to watchers", "outgoingEvents", outgoingBufSize) + klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow dispatching events to watchers", "outgoingEvents", outgoingBufSize, "objectType", wc.watcher.objectType) } // If user couldn't receive results fast enough, we also block incoming events from watcher. // Because storing events in local will cause more memory usage. @@ -402,7 +411,7 @@ func (wc *watchChan) sendError(err error) { func (wc *watchChan) sendEvent(e *event) { if len(wc.incomingEventChan) == incomingBufSize { - klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow decoding, user not receiving fast, or other processing logic", "incomingEvents", incomingBufSize) + klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow decoding, user not receiving fast, or other processing logic", "incomingEvents", incomingBufSize, "objectType", wc.watcher.objectType) } select { case wc.incomingEventChan <- e: diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/interfaces.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/interfaces.go index ccfe98467e96..db72d915508b 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/interfaces.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/interfaces.go @@ -244,7 +244,7 @@ type Interface interface { // ) GuaranteedUpdate( ctx context.Context, key string, ptrToType runtime.Object, ignoreNotFound bool, - precondtions *Preconditions, tryUpdate UpdateFunc, cachedExistingObject runtime.Object) error + preconditions *Preconditions, tryUpdate UpdateFunc, cachedExistingObject runtime.Object) error // Count returns number of different entries under the key (generally being path prefix). Count(key string) (int64, error) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/names/generate.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/names/generate.go index aad9a07f9ad2..f7fb4c9414a2 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/names/generate.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/names/generate.go @@ -43,12 +43,12 @@ const ( // TODO: make this flexible for non-core resources with alternate naming rules. maxNameLength = 63 randomLength = 5 - maxGeneratedNameLength = maxNameLength - randomLength + MaxGeneratedNameLength = maxNameLength - randomLength ) func (simpleNameGenerator) GenerateName(base string) string { - if len(base) > maxGeneratedNameLength { - base = base[:maxGeneratedNameLength] + if len(base) > MaxGeneratedNameLength { + base = base[:MaxGeneratedNameLength] } return fmt.Sprintf("%s%s", base, utilrand.String(randomLength)) } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go index 500e55c0206a..45f0d6f4a704 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go @@ -27,6 +27,7 @@ import ( const ( StorageTypeUnset = "" + StorageTypeETCD2 = "etcd2" StorageTypeETCD3 = "etcd3" DefaultCompactInterval = 5 * time.Minute diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go index 1e8a8cdb0f0e..fb1e2d2896ac 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go @@ -30,8 +30,8 @@ type DestroyFunc func() // Create creates a storage backend based on given config. func Create(c storagebackend.Config, newFunc func() runtime.Object) (storage.Interface, DestroyFunc, error) { switch c.Type { - case "etcd2": - return nil, nil, fmt.Errorf("%v is no longer a supported storage backend", c.Type) + case storagebackend.StorageTypeETCD2: + return nil, nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type) case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3: return newETCD3Storage(c, newFunc) default: @@ -42,8 +42,8 @@ func Create(c storagebackend.Config, newFunc func() runtime.Object) (storage.Int // CreateHealthCheck creates a healthcheck function based on given config. func CreateHealthCheck(c storagebackend.Config) (func() error, error) { switch c.Type { - case "etcd2": - return nil, fmt.Errorf("%v is no longer a supported storage backend", c.Type) + case storagebackend.StorageTypeETCD2: + return nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type) case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3: return newETCD3HealthCheck(c) default: diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics.go index 10aafb03457b..e5499f1e1866 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics.go @@ -33,7 +33,7 @@ const ( /* * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/metrics.go index e52d9b01a45e..29dce71746c7 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/metrics.go @@ -33,7 +33,7 @@ const ( /* * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_context.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_context.go new file mode 100644 index 000000000000..6497e3fff5ef --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_context.go @@ -0,0 +1,82 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flowcontrol + +import ( + "context" + "sync" +) + +type priorityAndFairnessKeyType int + +const ( + // priorityAndFairnessInitializationSignalKey is a key under which + // initialization signal function for watch requests is stored + // in the context. + priorityAndFairnessInitializationSignalKey priorityAndFairnessKeyType = iota +) + +// WithInitializationSignal creates a copy of parent context with +// priority and fairness initialization signal value. +func WithInitializationSignal(ctx context.Context, signal InitializationSignal) context.Context { + return context.WithValue(ctx, priorityAndFairnessInitializationSignalKey, signal) +} + +// initializationSignalFrom returns an initialization signal function +// which when called signals that watch initialization has already finished +// to priority and fairness dispatcher. +func initializationSignalFrom(ctx context.Context) (InitializationSignal, bool) { + signal, ok := ctx.Value(priorityAndFairnessInitializationSignalKey).(InitializationSignal) + return signal, ok && signal != nil +} + +// WatchInitialized sends a signal to priority and fairness dispatcher +// that a given watch request has already been initialized. +func WatchInitialized(ctx context.Context) { + if signal, ok := initializationSignalFrom(ctx); ok { + signal.Signal() + } +} + +// InitializationSignal is an interface that allows sending and handling +// initialization signals. +type InitializationSignal interface { + // Signal notifies the dispatcher about finished initialization. + Signal() + // Wait waits for the initialization signal. + Wait() +} + +type initializationSignal struct { + once sync.Once + done chan struct{} +} + +func NewInitializationSignal() InitializationSignal { + return &initializationSignal{ + once: sync.Once{}, + done: make(chan struct{}), + } +} + +func (i *initializationSignal) Signal() { + i.once.Do(func() { close(i.done) }) +} + +func (i *initializationSignal) Wait() { + <-i.done +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/debug/dump.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/debug/dump.go index 5e44676491bf..9d50c3e21a20 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/debug/dump.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/debug/dump.go @@ -24,9 +24,10 @@ import ( // QueueSetDump is an instant dump of queue-set. type QueueSetDump struct { - Queues []QueueDump - Waiting int - Executing int + Queues []QueueDump + Waiting int + Executing int + SeatsInUse int } // QueueDump is an instant dump of one queue in a queue-set. @@ -34,6 +35,7 @@ type QueueDump struct { Requests []RequestDump VirtualStart float64 ExecutingRequests int + SeatsInUse int } // RequestDump is an instant dump of one requests pending in the queue. diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go new file mode 100644 index 000000000000..78fb777f8428 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go @@ -0,0 +1,102 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package queueset + +import ( + "container/list" +) + +// removeFromFIFOFunc removes a designated element from the list. +// The complexity of the runtime cost is O(1) +// It returns the request removed from the list. +type removeFromFIFOFunc func() *request + +// walkFunc is called for each request in the list in the +// oldest -> newest order. +// ok: if walkFunc returns false then the iteration stops immediately. +type walkFunc func(*request) (ok bool) + +// Internal interface to abstract out the implementation details +// of the underlying list used to maintain the requests. +// +// Note that the FIFO list is not safe for concurrent use by multiple +// goroutines without additional locking or coordination. It rests with +// the user to ensure that the FIFO list is used with proper locking. +type fifo interface { + // Enqueue enqueues the specified request into the list and + // returns a removeFromFIFOFunc function that can be used to remove the + // request from the list + Enqueue(*request) removeFromFIFOFunc + + // Dequeue pulls out the oldest request from the list. + Dequeue() (*request, bool) + + // Length returns the number of requests in the list. + Length() int + + // Walk iterates through the list in order of oldest -> newest + // and executes the specified walkFunc for each request in that order. + // + // if the specified walkFunc returns false the Walk function + // stops the walk an returns immediately. + Walk(walkFunc) +} + +// the FIFO list implementation is not safe for concurrent use by multiple +// goroutines without additional locking or coordination. +type requestFIFO struct { + *list.List +} + +func newRequestFIFO() fifo { + return &requestFIFO{ + List: list.New(), + } +} + +func (l *requestFIFO) Length() int { + return l.Len() +} + +func (l *requestFIFO) Enqueue(req *request) removeFromFIFOFunc { + e := l.PushBack(req) + return func() *request { + l.Remove(e) + return req + } +} + +func (l *requestFIFO) Dequeue() (*request, bool) { + e := l.Front() + if e == nil { + return nil, false + } + defer l.Remove(e) + + request, ok := e.Value.(*request) + return request, ok +} + +func (l *requestFIFO) Walk(f walkFunc) { + for current := l.Front(); current != nil; current = current.Next() { + if r, ok := current.Value.(*request); ok { + if !f(r) { + return + } + } + } +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go index 8229ccbbb4b3..34f2bc370afb 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go @@ -108,6 +108,10 @@ type queueSet struct { // sum, over all the queues, of the number of requests executing // from that queue. totRequestsExecuting int + + // totSeatsInUse is the number of total "seats" in use by all the + // request(s) that are currently executing in this queueset. + totSeatsInUse int } // NewQueueSetFactory creates a new QueueSetFactory object @@ -165,7 +169,7 @@ func (qsc *queueSetCompleter) Complete(dCfg fq.DispatchingConfig) fq.QueueSet { func createQueues(n, baseIndex int) []*queue { fqqueues := make([]*queue, n) for i := 0; i < n; i++ { - fqqueues[i] = &queue{index: baseIndex + i, requests: make([]*request, 0)} + fqqueues[i] = &queue{index: baseIndex + i, requests: newRequestFIFO()} } return fqqueues } @@ -233,6 +237,9 @@ const ( // because the metrics --- and only the metrics --- track that // quantity per FlowSchema. func (qs *queueSet) StartRequest(ctx context.Context, hashValue uint64, flowDistinguisher, fsName string, descr1, descr2 interface{}, queueNoteFn fq.QueueNoteFn) (fq.Request, bool) { + // all request(s) have a width of 1, in keeping with the current behavior + width := 1.0 + qs.lockAndSyncTime() defer qs.lock.Unlock() var req *request @@ -241,12 +248,13 @@ func (qs *queueSet) StartRequest(ctx context.Context, hashValue uint64, flowDist // Step 0: // Apply only concurrency limit, if zero queues desired if qs.qCfg.DesiredNumQueues < 1 { - if qs.totRequestsExecuting >= qs.dCfg.ConcurrencyLimit { - klog.V(5).Infof("QS(%s): rejecting request %q %#+v %#+v because %d are executing and the limit is %d", qs.qCfg.Name, fsName, descr1, descr2, qs.totRequestsExecuting, qs.dCfg.ConcurrencyLimit) + if qs.totSeatsInUse >= qs.dCfg.ConcurrencyLimit { + klog.V(5).Infof("QS(%s): rejecting request %q %#+v %#+v because %d seats are in use (%d are executing) and the limit is %d", + qs.qCfg.Name, fsName, descr1, descr2, qs.totSeatsInUse, qs.totRequestsExecuting, qs.dCfg.ConcurrencyLimit) metrics.AddReject(ctx, qs.qCfg.Name, fsName, "concurrency-limit") return nil, qs.isIdleLocked() } - req = qs.dispatchSansQueueLocked(ctx, flowDistinguisher, fsName, descr1, descr2) + req = qs.dispatchSansQueueLocked(ctx, width, flowDistinguisher, fsName, descr1, descr2) return req, false } @@ -257,7 +265,7 @@ func (qs *queueSet) StartRequest(ctx context.Context, hashValue uint64, flowDist // 3) Reject current request if there is not enough concurrency shares and // we are at max queue length // 4) If not rejected, create a request and enqueue - req = qs.timeoutOldRequestsAndRejectOrEnqueueLocked(ctx, hashValue, flowDistinguisher, fsName, descr1, descr2, queueNoteFn) + req = qs.timeoutOldRequestsAndRejectOrEnqueueLocked(ctx, width, hashValue, flowDistinguisher, fsName, descr1, descr2, queueNoteFn) // req == nil means that the request was rejected - no remaining // concurrency shares and at max queue length already if req == nil { @@ -310,6 +318,11 @@ func (qs *queueSet) StartRequest(ctx context.Context, hashValue uint64, flowDist return req, false } +// Seats returns the number of seats this request requires. +func (req *request) Seats() int { + return int(math.Ceil(req.width)) +} + func (req *request) NoteQueued(inQueue bool) { if req.queueNoteFn != nil { req.queueNoteFn(inQueue) @@ -407,7 +420,7 @@ func (qs *queueSet) getVirtualTimeRatioLocked() float64 { reqs := 0 for _, queue := range qs.queues { reqs += queue.requestsExecuting - if len(queue.requests) > 0 || queue.requestsExecuting > 0 { + if queue.requests.Length() > 0 || queue.requestsExecuting > 0 { activeQueues++ } } @@ -427,7 +440,7 @@ func (qs *queueSet) getVirtualTimeRatioLocked() float64 { // returns the enqueud request on a successful enqueue // returns nil in the case that there is no available concurrency or // the queuelengthlimit has been reached -func (qs *queueSet) timeoutOldRequestsAndRejectOrEnqueueLocked(ctx context.Context, hashValue uint64, flowDistinguisher, fsName string, descr1, descr2 interface{}, queueNoteFn fq.QueueNoteFn) *request { +func (qs *queueSet) timeoutOldRequestsAndRejectOrEnqueueLocked(ctx context.Context, width float64, hashValue uint64, flowDistinguisher, fsName string, descr1, descr2 interface{}, queueNoteFn fq.QueueNoteFn) *request { // Start with the shuffle sharding, to pick a queue. queueIdx := qs.chooseQueueIndexLocked(hashValue, descr1, descr2) queue := qs.queues[queueIdx] @@ -449,11 +462,12 @@ func (qs *queueSet) timeoutOldRequestsAndRejectOrEnqueueLocked(ctx context.Conte descr1: descr1, descr2: descr2, queueNoteFn: queueNoteFn, + width: width, } if ok := qs.rejectOrEnqueueLocked(req); !ok { return nil } - metrics.ObserveQueueLength(ctx, qs.qCfg.Name, fsName, len(queue.requests)) + metrics.ObserveQueueLength(ctx, qs.qCfg.Name, fsName, queue.requests.Length()) return req } @@ -464,7 +478,7 @@ func (qs *queueSet) chooseQueueIndexLocked(hashValue uint64, descr1, descr2 inte bestQueueLen := int(math.MaxInt32) // the dealer uses the current desired number of queues, which is no larger than the number in `qs.queues`. qs.dealer.Deal(hashValue, func(queueIdx int) { - thisLen := len(qs.queues[queueIdx].requests) + thisLen := qs.queues[queueIdx].requests.Length() klog.V(7).Infof("QS(%s): For request %#+v %#+v considering queue %d of length %d", qs.qCfg.Name, descr1, descr2, queueIdx, thisLen) if thisLen < bestQueueLen { bestQueueIdx, bestQueueLen = queueIdx, thisLen @@ -477,7 +491,7 @@ func (qs *queueSet) chooseQueueIndexLocked(hashValue uint64, descr1, descr2 inte // removeTimedOutRequestsFromQueueLocked rejects old requests that have been enqueued // past the requestWaitLimit func (qs *queueSet) removeTimedOutRequestsFromQueueLocked(queue *queue, fsName string) { - timeoutIdx := -1 + timeoutCount := 0 now := qs.clock.Now() reqs := queue.requests // reqs are sorted oldest -> newest @@ -486,26 +500,31 @@ func (qs *queueSet) removeTimedOutRequestsFromQueueLocked(queue *queue, fsName s // now - requestWaitLimit = waitLimit waitLimit := now.Add(-qs.qCfg.RequestWaitLimit) - for i, req := range reqs { + reqs.Walk(func(req *request) bool { if waitLimit.After(req.arrivalTime) { req.decision.SetLocked(decisionReject) - // get index for timed out requests - timeoutIdx = i + timeoutCount++ metrics.AddRequestsInQueues(req.ctx, qs.qCfg.Name, req.fsName, -1) req.NoteQueued(false) - } else { - break + + // we need to check if the next request has timed out. + return true } - } + + // since reqs are sorted oldest -> newest, we are done here. + return false + }) + // remove timed out requests from queue - if timeoutIdx != -1 { - // timeoutIdx + 1 to remove the last timeout req - removeIdx := timeoutIdx + 1 - // remove all the timeout requests - queue.requests = reqs[removeIdx:] + if timeoutCount > 0 { + // The number of requests we have timed out is timeoutCount, + // so, let's dequeue the exact number of requests for this queue. + for i := 0; i < timeoutCount; i++ { + queue.requests.Dequeue() + } // decrement the # of requestsEnqueued - qs.totRequestsWaiting -= removeIdx - qs.obsPair.RequestsWaiting.Add(float64(-removeIdx)) + qs.totRequestsWaiting -= timeoutCount + qs.obsPair.RequestsWaiting.Add(float64(-timeoutCount)) } } @@ -515,9 +534,9 @@ func (qs *queueSet) removeTimedOutRequestsFromQueueLocked(queue *queue, fsName s // Otherwise enqueues and returns true. func (qs *queueSet) rejectOrEnqueueLocked(request *request) bool { queue := request.queue - curQueueLength := len(queue.requests) + curQueueLength := queue.requests.Length() // rejects the newly arrived request if resource criteria not met - if qs.totRequestsExecuting >= qs.dCfg.ConcurrencyLimit && + if qs.totSeatsInUse >= qs.dCfg.ConcurrencyLimit && curQueueLength >= qs.qCfg.QueueLengthLimit { return false } @@ -530,7 +549,7 @@ func (qs *queueSet) rejectOrEnqueueLocked(request *request) bool { func (qs *queueSet) enqueueLocked(request *request) { queue := request.queue now := qs.clock.Now() - if len(queue.requests) == 0 && queue.requestsExecuting == 0 { + if queue.requests.Length() == 0 && queue.requestsExecuting == 0 { // the queue’s virtual start time is set to the virtual time. queue.virtualStart = qs.virtualTime if klog.V(6).Enabled() { @@ -551,7 +570,7 @@ func (qs *queueSet) enqueueLocked(request *request) { // queue, increment the count of the number executing, and send true // to the request's channel. func (qs *queueSet) dispatchAsMuchAsPossibleLocked() { - for qs.totRequestsWaiting != 0 && qs.totRequestsExecuting < qs.dCfg.ConcurrencyLimit { + for qs.totRequestsWaiting != 0 && qs.totSeatsInUse < qs.dCfg.ConcurrencyLimit { ok := qs.dispatchLocked() if !ok { break @@ -559,7 +578,7 @@ func (qs *queueSet) dispatchAsMuchAsPossibleLocked() { } } -func (qs *queueSet) dispatchSansQueueLocked(ctx context.Context, flowDistinguisher, fsName string, descr1, descr2 interface{}) *request { +func (qs *queueSet) dispatchSansQueueLocked(ctx context.Context, width float64, flowDistinguisher, fsName string, descr1, descr2 interface{}) *request { now := qs.clock.Now() req := &request{ qs: qs, @@ -571,9 +590,11 @@ func (qs *queueSet) dispatchSansQueueLocked(ctx context.Context, flowDistinguish arrivalTime: now, descr1: descr1, descr2: descr2, + width: width, } req.decision.SetLocked(decisionExecute) qs.totRequestsExecuting++ + qs.totSeatsInUse += req.Seats() metrics.AddRequestsExecuting(ctx, qs.qCfg.Name, fsName, 1) qs.obsPair.RequestsExecuting.Add(1) if klog.V(5).Enabled() { @@ -603,17 +624,21 @@ func (qs *queueSet) dispatchLocked() bool { // problem because other overhead is also included. qs.totRequestsWaiting-- qs.totRequestsExecuting++ + qs.totSeatsInUse += request.Seats() queue.requestsExecuting++ + queue.seatsInUse += request.Seats() metrics.AddRequestsInQueues(request.ctx, qs.qCfg.Name, request.fsName, -1) request.NoteQueued(false) metrics.AddRequestsExecuting(request.ctx, qs.qCfg.Name, request.fsName, 1) qs.obsPair.RequestsWaiting.Add(-1) qs.obsPair.RequestsExecuting.Add(1) if klog.V(6).Enabled() { - klog.Infof("QS(%s) at r=%s v=%.9fs: dispatching request %#+v %#+v from queue %d with virtual start time %.9fs, queue will have %d waiting & %d executing", qs.qCfg.Name, request.startTime.Format(nsTimeFmt), qs.virtualTime, request.descr1, request.descr2, queue.index, queue.virtualStart, len(queue.requests), queue.requestsExecuting) + klog.Infof("QS(%s) at r=%s v=%.9fs: dispatching request %#+v %#+v from queue %d with virtual start time %.9fs, queue will have %d waiting & %d executing", + qs.qCfg.Name, request.startTime.Format(nsTimeFmt), qs.virtualTime, request.descr1, request.descr2, + queue.index, queue.virtualStart, queue.requests.Length(), queue.requestsExecuting) } // When a request is dequeued for service -> qs.virtualStart += G - queue.virtualStart += qs.estimatedServiceTime + queue.virtualStart += qs.estimatedServiceTime * float64(request.Seats()) request.decision.SetLocked(decisionExecute) return ok } @@ -629,19 +654,13 @@ func (qs *queueSet) cancelWait(req *request) { return } req.decision.SetLocked(decisionCancel) - queue := req.queue + // remove the request from the queue as it has timed out - for i := range queue.requests { - if req == queue.requests[i] { - // remove the request - queue.requests = append(queue.requests[:i], queue.requests[i+1:]...) - qs.totRequestsWaiting-- - metrics.AddRequestsInQueues(req.ctx, qs.qCfg.Name, req.fsName, -1) - req.NoteQueued(false) - qs.obsPair.RequestsWaiting.Add(-1) - break - } - } + req.removeFromQueueFn() + qs.totRequestsWaiting-- + metrics.AddRequestsInQueues(req.ctx, qs.qCfg.Name, req.fsName, -1) + req.NoteQueued(false) + qs.obsPair.RequestsWaiting.Add(-1) } // selectQueueLocked examines the queues in round robin order and @@ -655,7 +674,7 @@ func (qs *queueSet) selectQueueLocked() *queue { for range qs.queues { qs.robinIndex = (qs.robinIndex + 1) % nq queue := qs.queues[qs.robinIndex] - if len(queue.requests) != 0 { + if queue.requests.Length() != 0 { currentVirtualFinish := queue.GetVirtualFinish(0, qs.estimatedServiceTime) if currentVirtualFinish < minVirtualFinish { @@ -681,7 +700,7 @@ func (qs *queueSet) selectQueueLocked() *queue { // queue here. if the last virtual start time (excluded estimated cost) // falls behind the global virtual time, we update the latest virtual // start by: + - previouslyEstimatedServiceTime := float64(minQueue.requestsExecuting) * qs.estimatedServiceTime + previouslyEstimatedServiceTime := float64(minQueue.seatsInUse) * qs.estimatedServiceTime if qs.virtualTime > minQueue.virtualStart-previouslyEstimatedServiceTime { // per-queue virtual time should not fall behind the global minQueue.virtualStart = qs.virtualTime + previouslyEstimatedServiceTime @@ -709,6 +728,7 @@ func (qs *queueSet) finishRequestAndDispatchAsMuchAsPossible(req *request) bool func (qs *queueSet) finishRequestLocked(r *request) { now := qs.clock.Now() qs.totRequestsExecuting-- + qs.totSeatsInUse -= r.Seats() metrics.AddRequestsExecuting(r.ctx, qs.qCfg.Name, r.fsName, -1) qs.obsPair.RequestsExecuting.Add(-1) @@ -723,19 +743,22 @@ func (qs *queueSet) finishRequestLocked(r *request) { // When a request finishes being served, and the actual service time was S, // the queue’s virtual start time is decremented by G - S. - r.queue.virtualStart -= qs.estimatedServiceTime - S + r.queue.virtualStart -= (qs.estimatedServiceTime * float64(r.Seats())) - S // request has finished, remove from requests executing r.queue.requestsExecuting-- + r.queue.seatsInUse -= r.Seats() if klog.V(6).Enabled() { - klog.Infof("QS(%s) at r=%s v=%.9fs: request %#+v %#+v finished, adjusted queue %d virtual start time to %.9fs due to service time %.9fs, queue will have %d waiting & %d executing", qs.qCfg.Name, now.Format(nsTimeFmt), qs.virtualTime, r.descr1, r.descr2, r.queue.index, r.queue.virtualStart, S, len(r.queue.requests), r.queue.requestsExecuting) + klog.Infof("QS(%s) at r=%s v=%.9fs: request %#+v %#+v finished, adjusted queue %d virtual start time to %.9fs due to service time %.9fs, queue will have %d waiting & %d executing", + qs.qCfg.Name, now.Format(nsTimeFmt), qs.virtualTime, r.descr1, r.descr2, r.queue.index, + r.queue.virtualStart, S, r.queue.requests.Length(), r.queue.requestsExecuting) } // If there are more queues than desired and this one has no // requests then remove it if len(qs.queues) > qs.qCfg.DesiredNumQueues && - len(r.queue.requests) == 0 && + r.queue.requests.Length() == 0 && r.queue.requestsExecuting == 0 { qs.queues = removeQueueAndUpdateIndexes(qs.queues, r.queue.index) @@ -781,9 +804,10 @@ func (qs *queueSet) Dump(includeRequestDetails bool) debug.QueueSetDump { qs.lock.Lock() defer qs.lock.Unlock() d := debug.QueueSetDump{ - Queues: make([]debug.QueueDump, len(qs.queues)), - Waiting: qs.totRequestsWaiting, - Executing: qs.totRequestsExecuting, + Queues: make([]debug.QueueDump, len(qs.queues)), + Waiting: qs.totRequestsWaiting, + Executing: qs.totRequestsExecuting, + SeatsInUse: qs.totSeatsInUse, } for i, q := range qs.queues { d.Queues[i] = q.dump(includeRequestDetails) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/types.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/types.go index a720230600ea..7309d3bf04ef 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/types.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/types.go @@ -43,6 +43,9 @@ type request struct { // startTime is the real time when the request began executing startTime time.Time + // width of the request + width float64 + // decision gets set to a `requestDecision` indicating what to do // with this request. It gets set exactly once, when the request // is removed from its queue. The value will be decisionReject, @@ -61,12 +64,17 @@ type request struct { waitStarted bool queueNoteFn fq.QueueNoteFn + + // Removes this request from its queue. If the request is not put into a + // a queue it will be nil. + removeFromQueueFn removeFromFIFOFunc } // queue is an array of requests with additional metadata required for // the FQScheduler type queue struct { - requests []*request + // The requests are stored in a FIFO list. + requests fifo // virtualStart is the virtual time (virtual seconds since process // startup) when the oldest request in the queue (if there is any) @@ -75,21 +83,22 @@ type queue struct { requestsExecuting int index int + + // seatsInUse is the total number of "seats" currently occupied + // by all the requests that are currently executing in this queue. + seatsInUse int } -// Enqueue enqueues a request into the queue +// Enqueue enqueues a request into the queue and +// sets the removeFromQueueFn of the request appropriately. func (q *queue) Enqueue(request *request) { - q.requests = append(q.requests, request) + request.removeFromQueueFn = q.requests.Enqueue(request) } // Dequeue dequeues a request from the queue func (q *queue) Dequeue() (*request, bool) { - if len(q.requests) == 0 { - return nil, false - } - request := q.requests[0] - q.requests = q.requests[1:] - return request, true + request, ok := q.requests.Dequeue() + return request, ok } // GetVirtualFinish returns the expected virtual finish time of the request at @@ -104,8 +113,9 @@ func (q *queue) GetVirtualFinish(J int, G float64) float64 { } func (q *queue) dump(includeDetails bool) debug.QueueDump { - digest := make([]debug.RequestDump, len(q.requests)) - for i, r := range q.requests { + digest := make([]debug.RequestDump, q.requests.Length()) + i := 0 + q.requests.Walk(func(r *request) bool { // dump requests. digest[i].MatchedFlowSchema = r.fsName digest[i].FlowDistinguisher = r.flowDistinguisher @@ -119,10 +129,13 @@ func (q *queue) dump(includeDetails bool) debug.QueueDump { digest[i].RequestInfo = *requestInfo } } - } + i++ + return true + }) return debug.QueueDump{ VirtualStart: q.virtualStart, Requests: digest, ExecutingRequests: q.requestsExecuting, + SeatsInUse: q.seatsInUse, } } diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/client.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/client.go index d750c3f7c03a..56600f155bda 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/client.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/client.go @@ -30,6 +30,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" utilerrors "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apiserver/pkg/util/x509metrics" "k8s.io/client-go/rest" ) @@ -148,6 +149,11 @@ func (cm *ClientManager) HookClient(cc ClientConfig) (*rest.RESTClient, error) { cfg.ContentConfig.NegotiatedSerializer = cm.negotiatedSerializer cfg.ContentConfig.ContentType = runtime.ContentTypeJSON + + // Add a transport wrapper that allows detection of TLS connections to + // servers without SAN extension in their serving certificates + cfg.Wrap(x509metrics.NewMissingSANRoundTripperWrapperConstructor(x509MissingSANCounter)) + client, err := rest.UnversionedRESTClientFor(cfg) if err == nil { cm.cache.Add(string(cacheKey), client) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/gencerts.sh b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/gencerts.sh index de407730117d..f99895e298ae 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/gencerts.sh +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/gencerts.sh @@ -35,6 +35,18 @@ extendedKeyUsage = clientAuth, serverAuth subjectAltName = @alt_names [alt_names] IP.1 = 127.0.0.1 +DNS.1 = localhost +EOF + +cat > server_no_san.conf << EOF +[req] +req_extensions = v3_req +distinguished_name = req_distinguished_name +[req_distinguished_name] +[ v3_req ] +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +extendedKeyUsage = clientAuth, serverAuth EOF cat > client.conf << EOF @@ -64,6 +76,10 @@ openssl genrsa -out serverKey.pem 2048 openssl req -new -key serverKey.pem -out server.csr -subj "/CN=${CN_BASE}_server" -config server.conf openssl x509 -req -in server.csr -CA caCert.pem -CAkey caKey.pem -CAcreateserial -out serverCert.pem -days 100000 -extensions v3_req -extfile server.conf +# Create a server certiticate w/o SAN +openssl req -new -key serverKey.pem -out serverNoSAN.csr -subj "/CN=localhost" -config server_no_san.conf +openssl x509 -req -in serverNoSAN.csr -CA caCert.pem -CAkey caKey.pem -CAcreateserial -out serverCertNoSAN.pem -days 100000 -extensions v3_req -extfile server_no_san.conf + # Create a client certiticate openssl genrsa -out clientKey.pem 2048 openssl req -new -key clientKey.pem -out client.csr -subj "/CN=${CN_BASE}_client" -config client.conf @@ -94,7 +110,7 @@ limitations under the License. package webhook EOF -for file in caKey caCert badCAKey badCACert serverKey serverCert clientKey clientCert; do +for file in caKey caCert badCAKey badCACert serverKey serverCert serverCertNoSAN clientKey clientCert; do data=$(cat ${file}.pem) echo "" >> $outfile echo "var $file = []byte(\`$data\`)" >> $outfile diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/metrics.go new file mode 100644 index 000000000000..c3085226cfee --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/metrics.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package webhook + +import ( + "k8s.io/component-base/metrics" + "k8s.io/component-base/metrics/legacyregistry" +) + +var x509MissingSANCounter = metrics.NewCounter( + &metrics.CounterOpts{ + Subsystem: "webhooks", + Namespace: "apiserver", + Name: "x509_missing_san_total", + Help: "Counts the number of requests to servers missing SAN extension " + + "in their serving certificate OR the number of connection failures " + + "due to the lack of x509 certificate SAN extension missing " + + "(either/or, based on the runtime environment)", + StabilityLevel: metrics.ALPHA, + }, +) + +func init() { + legacyregistry.MustRegister(x509MissingSANCounter) +} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/webhook.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/webhook.go index abaade352b04..a17ab8f48f75 100644 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/webhook.go +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/webhook/webhook.go @@ -28,6 +28,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/apiserver/pkg/util/x509metrics" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" ) @@ -107,6 +108,7 @@ func newGenericWebhook(scheme *runtime.Scheme, codecFactory serializer.CodecFact clientConfig.ContentConfig.NegotiatedSerializer = serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{Serializer: codec}) clientConfig.Dial = customDial + clientConfig.Wrap(x509metrics.NewMissingSANRoundTripperWrapperConstructor(x509MissingSANCounter)) restClient, err := rest.UnversionedRESTClientFor(clientConfig) if err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/x509metrics/missing_san.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/x509metrics/missing_san.go new file mode 100644 index 000000000000..d16daec25119 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/x509metrics/missing_san.go @@ -0,0 +1,92 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package x509metrics + +import ( + "crypto/x509" + "errors" + "net/http" + "strings" + + utilnet "k8s.io/apimachinery/pkg/util/net" + "k8s.io/component-base/metrics" +) + +var _ utilnet.RoundTripperWrapper = &x509MissingSANErrorMetricsRTWrapper{} + +type x509MissingSANErrorMetricsRTWrapper struct { + rt http.RoundTripper + + counter *metrics.Counter +} + +// NewMissingSANRoundTripperWrapperConstructor returns a RoundTripper wrapper that's usable +// within ClientConfig.Wrap that increases the `metricCounter` whenever: +// 1. we get a x509.HostnameError with string `x509: certificate relies on legacy Common Name field` +// which indicates an error caused by the deprecation of Common Name field when veryfing remote +// hostname +// 2. the server certificate in response contains no SAN. This indicates that this binary run +// with the GODEBUG=x509ignoreCN=0 in env +func NewMissingSANRoundTripperWrapperConstructor(metricCounter *metrics.Counter) func(rt http.RoundTripper) http.RoundTripper { + return func(rt http.RoundTripper) http.RoundTripper { + return &x509MissingSANErrorMetricsRTWrapper{ + rt: rt, + counter: metricCounter, + } + } +} + +func (w *x509MissingSANErrorMetricsRTWrapper) RoundTrip(req *http.Request) (*http.Response, error) { + resp, err := w.rt.RoundTrip(req) + checkForHostnameError(err, w.counter) + checkRespForNoSAN(resp, w.counter) + return resp, err +} + +func (w *x509MissingSANErrorMetricsRTWrapper) WrappedRoundTripper() http.RoundTripper { + return w.rt +} + +// checkForHostnameError increases the metricCounter when we're running w/o GODEBUG=x509ignoreCN=0 +// and the client reports a HostnameError about the legacy CN fields +func checkForHostnameError(err error, metricCounter *metrics.Counter) { + if err != nil && errors.As(err, &x509.HostnameError{}) && strings.Contains(err.Error(), "x509: certificate relies on legacy Common Name field") { + // increase the count of registered failures due to Go 1.15 x509 cert Common Name deprecation + metricCounter.Inc() + } +} + +// checkRespForNoSAN increases the metricCounter when the server response contains +// a leaf certificate w/o the SAN extension +func checkRespForNoSAN(resp *http.Response, metricCounter *metrics.Counter) { + if resp != nil && resp.TLS != nil && len(resp.TLS.PeerCertificates) > 0 { + if serverCert := resp.TLS.PeerCertificates[0]; !hasSAN(serverCert) { + metricCounter.Inc() + } + } +} + +func hasSAN(c *x509.Certificate) bool { + sanOID := []int{2, 5, 29, 17} + + for _, e := range c.Extensions { + if e.Id.Equal(sanOID) { + return true + } + } + return false +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetspec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetspec.go index 502f00ba4509..ade14180b22d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetspec.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetspec.go @@ -35,6 +35,7 @@ type StatefulSetSpecApplyConfiguration struct { PodManagementPolicy *appsv1.PodManagementPolicyType `json:"podManagementPolicy,omitempty"` UpdateStrategy *StatefulSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` } // StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with @@ -111,3 +112,11 @@ func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32 b.RevisionHistoryLimit = &value return b } + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *StatefulSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *StatefulSetSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetstatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetstatus.go index 58c07475e549..d88881b6569b 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetstatus.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetstatus.go @@ -30,6 +30,7 @@ type StatefulSetStatusApplyConfiguration struct { UpdateRevision *string `json:"updateRevision,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` Conditions []StatefulSetConditionApplyConfiguration `json:"conditions,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` } // StatefulSetStatusApplyConfiguration constructs an declarative configuration of the StatefulSetStatus type for use with @@ -114,3 +115,11 @@ func (b *StatefulSetStatusApplyConfiguration) WithConditions(values ...*Stateful } return b } + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *StatefulSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *StatefulSetStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetspec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetspec.go index 61b86a9d82f6..befd1f7e0ad2 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetspec.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetspec.go @@ -35,6 +35,7 @@ type StatefulSetSpecApplyConfiguration struct { PodManagementPolicy *v1beta1.PodManagementPolicyType `json:"podManagementPolicy,omitempty"` UpdateStrategy *StatefulSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` } // StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with @@ -111,3 +112,11 @@ func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32 b.RevisionHistoryLimit = &value return b } + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *StatefulSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *StatefulSetSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetstatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetstatus.go index b716352d2650..f31066b6ff46 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetstatus.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetstatus.go @@ -30,6 +30,7 @@ type StatefulSetStatusApplyConfiguration struct { UpdateRevision *string `json:"updateRevision,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` Conditions []StatefulSetConditionApplyConfiguration `json:"conditions,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` } // StatefulSetStatusApplyConfiguration constructs an declarative configuration of the StatefulSetStatus type for use with @@ -114,3 +115,11 @@ func (b *StatefulSetStatusApplyConfiguration) WithConditions(values ...*Stateful } return b } + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *StatefulSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *StatefulSetStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetspec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetspec.go index eb2c8555b94e..44044be265c9 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetspec.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetspec.go @@ -35,6 +35,7 @@ type StatefulSetSpecApplyConfiguration struct { PodManagementPolicy *v1beta2.PodManagementPolicyType `json:"podManagementPolicy,omitempty"` UpdateStrategy *StatefulSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` } // StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with @@ -111,3 +112,11 @@ func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32 b.RevisionHistoryLimit = &value return b } + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *StatefulSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *StatefulSetSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetstatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetstatus.go index 73f7c0b3f5c7..63835904c173 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetstatus.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetstatus.go @@ -30,6 +30,7 @@ type StatefulSetStatusApplyConfiguration struct { UpdateRevision *string `json:"updateRevision,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` Conditions []StatefulSetConditionApplyConfiguration `json:"conditions,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` } // StatefulSetStatusApplyConfiguration constructs an declarative configuration of the StatefulSetStatus type for use with @@ -114,3 +115,11 @@ func (b *StatefulSetStatusApplyConfiguration) WithConditions(values ...*Stateful } return b } + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *StatefulSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *StatefulSetStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/servicespec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/servicespec.go index 99361cecf067..856cd4f9d820 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/servicespec.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/servicespec.go @@ -39,7 +39,6 @@ type ServiceSpecApplyConfiguration struct { HealthCheckNodePort *int32 `json:"healthCheckNodePort,omitempty"` PublishNotReadyAddresses *bool `json:"publishNotReadyAddresses,omitempty"` SessionAffinityConfig *SessionAffinityConfigApplyConfiguration `json:"sessionAffinityConfig,omitempty"` - TopologyKeys []string `json:"topologyKeys,omitempty"` IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty"` IPFamilyPolicy *corev1.IPFamilyPolicyType `json:"ipFamilyPolicy,omitempty"` AllocateLoadBalancerNodePorts *bool `json:"allocateLoadBalancerNodePorts,omitempty"` @@ -182,16 +181,6 @@ func (b *ServiceSpecApplyConfiguration) WithSessionAffinityConfig(value *Session return b } -// WithTopologyKeys adds the given value to the TopologyKeys field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the TopologyKeys field. -func (b *ServiceSpecApplyConfiguration) WithTopologyKeys(values ...string) *ServiceSpecApplyConfiguration { - for i := range values { - b.TopologyKeys = append(b.TopologyKeys, values[i]) - } - return b -} - // WithIPFamilies adds the given value to the IPFamilies field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the IPFamilies field. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/windowssecuritycontextoptions.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/windowssecuritycontextoptions.go index 2442063c4ecd..20692e01466d 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/windowssecuritycontextoptions.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/windowssecuritycontextoptions.go @@ -24,6 +24,7 @@ type WindowsSecurityContextOptionsApplyConfiguration struct { GMSACredentialSpecName *string `json:"gmsaCredentialSpecName,omitempty"` GMSACredentialSpec *string `json:"gmsaCredentialSpec,omitempty"` RunAsUserName *string `json:"runAsUserName,omitempty"` + HostProcess *bool `json:"hostProcess,omitempty"` } // WindowsSecurityContextOptionsApplyConfiguration constructs an declarative configuration of the WindowsSecurityContextOptions type for use with @@ -55,3 +56,11 @@ func (b *WindowsSecurityContextOptionsApplyConfiguration) WithRunAsUserName(valu b.RunAsUserName = &value return b } + +// WithHostProcess sets the HostProcess field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostProcess field is set to the value of the last call. +func (b *WindowsSecurityContextOptionsApplyConfiguration) WithHostProcess(value bool) *WindowsSecurityContextOptionsApplyConfiguration { + b.HostProcess = &value + return b +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go index 66b23cbfe3d2..079ef8dc27dd 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go @@ -910,6 +910,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.apps.v1.StatefulSetSpec map: fields: + - name: minReadySeconds + type: + scalar: numeric - name: podManagementPolicy type: scalar: string @@ -943,6 +946,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.apps.v1.StatefulSetStatus map: fields: + - name: availableReplicas + type: + scalar: numeric - name: collisionCount type: scalar: numeric @@ -1191,6 +1197,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.apps.v1beta1.StatefulSetSpec map: fields: + - name: minReadySeconds + type: + scalar: numeric - name: podManagementPolicy type: scalar: string @@ -1224,6 +1233,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.apps.v1beta1.StatefulSetStatus map: fields: + - name: availableReplicas + type: + scalar: numeric - name: collisionCount type: scalar: numeric @@ -1670,6 +1682,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.apps.v1beta2.StatefulSetSpec map: fields: + - name: minReadySeconds + type: + scalar: numeric - name: podManagementPolicy type: scalar: string @@ -1703,6 +1718,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.apps.v1beta2.StatefulSetStatus map: fields: + - name: availableReplicas + type: + scalar: numeric - name: collisionCount type: scalar: numeric @@ -6217,12 +6235,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: sessionAffinityConfig type: namedType: io.k8s.api.core.v1.SessionAffinityConfig - - name: topologyKeys - type: - list: - elementType: - scalar: string - elementRelationship: atomic - name: type type: scalar: string @@ -6580,6 +6592,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: gmsaCredentialSpecName type: scalar: string + - name: hostProcess + type: + scalar: boolean - name: runAsUserName type: scalar: string diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/dynamic/fake/simple.go b/cluster-autoscaler/vendor/k8s.io/client-go/dynamic/fake/simple.go index 1891998f6570..82f805d1f2af 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/dynamic/fake/simple.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/dynamic/fake/simple.go @@ -115,12 +115,15 @@ type dynamicResourceClient struct { listKind string } +var ( + _ dynamic.Interface = &FakeDynamicClient{} + _ testing.FakeClient = &FakeDynamicClient{} +) + func (c *FakeDynamicClient) Tracker() testing.ObjectTracker { return c.tracker } -var _ dynamic.Interface = &FakeDynamicClient{} - func (c *FakeDynamicClient) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface { return &dynamicResourceClient{client: c, resource: resource, listKind: c.gvrToListKind[resource]} } diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go index c09d8999f828..6f6fc67aef62 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go @@ -158,7 +158,10 @@ func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } -var _ clientset.Interface = &Clientset{} +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) // AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client func (c *Clientset) AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface { diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go b/cluster-autoscaler/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go index 52655c0bcb33..ce24be175394 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go @@ -263,8 +263,9 @@ func (a *Authenticator) UpdateTransportConfig(c *transport.Config) error { // setting up the transport, as that triggers the exec action if the server is // also configured to allow client certificates for authentication. For requests // like "kubectl get --token (token) pods" we should assume the intention is to - // use the provided token for authentication. - if c.HasTokenAuth() { + // use the provided token for authentication. The same can be said for when the + // user specifies basic auth. + if c.HasTokenAuth() || c.HasBasicAuth() { return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/rest/request.go b/cluster-autoscaler/vendor/k8s.io/client-go/rest/request.go index 6f4c0b054af1..8f66c079ecae 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/rest/request.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/rest/request.go @@ -93,7 +93,6 @@ type Request struct { rateLimiter flowcontrol.RateLimiter backoff BackoffManager timeout time.Duration - maxRetries int // generic components accessible via method setters verb string @@ -110,8 +109,9 @@ type Request struct { subresource string // output - err error - body io.Reader + err error + body io.Reader + retry WithRetry } // NewRequest creates a new request helper object for accessing runtime.Objects on a server. @@ -142,7 +142,7 @@ func NewRequest(c *RESTClient) *Request { backoff: backoff, timeout: timeout, pathPrefix: pathPrefix, - maxRetries: 10, + retry: &withRetry{maxRetries: 10}, warningHandler: c.warningHandler, } @@ -408,10 +408,7 @@ func (r *Request) Timeout(d time.Duration) *Request { // function is specifically called with a different value. // A zero maxRetries prevent it from doing retires and return an error immediately. func (r *Request) MaxRetries(maxRetries int) *Request { - if maxRetries < 0 { - maxRetries = 0 - } - r.maxRetries = maxRetries + r.retry.SetMaxRetries(maxRetries) return r } @@ -678,43 +675,88 @@ func (r *Request) Watch(ctx context.Context) (watch.Interface, error) { return nil, r.err } - url := r.URL().String() - req, err := http.NewRequest(r.verb, url, r.body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - req.Header = r.headers client := r.c.Client if client == nil { client = http.DefaultClient } - r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL())) - resp, err := client.Do(req) - updateURLMetrics(ctx, r, resp, err) - if r.c.base != nil { - if err != nil { - r.backoff.UpdateBackoff(r.c.base, err, 0) - } else { - r.backoff.UpdateBackoff(r.c.base, err, resp.StatusCode) - } - } - if err != nil { + + isErrRetryableFunc := func(request *http.Request, err error) bool { // The watch stream mechanism handles many common partial data errors, so closed // connections can be retried in many cases. if net.IsProbableEOF(err) || net.IsTimeout(err) { - return watch.NewEmptyWatch(), nil + return true } - return nil, err + return false } - if resp.StatusCode != http.StatusOK { - defer resp.Body.Close() - if result := r.transformResponse(resp, req); result.err != nil { - return nil, result.err + var retryAfter *RetryAfter + url := r.URL().String() + for { + req, err := r.newHTTPRequest(ctx) + if err != nil { + return nil, err + } + + r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL())) + if retryAfter != nil { + // We are retrying the request that we already send to apiserver + // at least once before. + // This request should also be throttled with the client-internal rate limiter. + if err := r.tryThrottleWithInfo(ctx, retryAfter.Reason); err != nil { + return nil, err + } + retryAfter = nil + } + + resp, err := client.Do(req) + updateURLMetrics(ctx, r, resp, err) + if r.c.base != nil { + if err != nil { + r.backoff.UpdateBackoff(r.c.base, err, 0) + } else { + r.backoff.UpdateBackoff(r.c.base, err, resp.StatusCode) + } + } + if err == nil && resp.StatusCode == http.StatusOK { + return r.newStreamWatcher(resp) + } + + done, transformErr := func() (bool, error) { + defer readAndCloseResponseBody(resp) + + var retry bool + retryAfter, retry = r.retry.NextRetry(req, resp, err, isErrRetryableFunc) + if retry { + err := r.retry.BeforeNextRetry(ctx, r.backoff, retryAfter, url, r.body) + if err == nil { + return false, nil + } + klog.V(4).Infof("Could not retry request - %v", err) + } + + if resp == nil { + // the server must have sent us an error in 'err' + return true, nil + } + if result := r.transformResponse(resp, req); result.err != nil { + return true, result.err + } + return true, fmt.Errorf("for request %s, got status: %v", url, resp.StatusCode) + }() + if done { + if isErrRetryableFunc(req, err) { + return watch.NewEmptyWatch(), nil + } + if err == nil { + // if the server sent us an HTTP Response object, + // we need to return the error object from that. + err = transformErr + } + return nil, err } - return nil, fmt.Errorf("for request %s, got status: %v", url, resp.StatusCode) } +} +func (r *Request) newStreamWatcher(resp *http.Response) (watch.Interface, error) { contentType := resp.Header.Get("Content-Type") mediaType, params, err := mime.ParseMediaType(contentType) if err != nil { @@ -769,49 +811,75 @@ func (r *Request) Stream(ctx context.Context) (io.ReadCloser, error) { return nil, err } - url := r.URL().String() - req, err := http.NewRequest(r.verb, url, nil) - if err != nil { - return nil, err - } - if r.body != nil { - req.Body = ioutil.NopCloser(r.body) - } - req = req.WithContext(ctx) - req.Header = r.headers client := r.c.Client if client == nil { client = http.DefaultClient } - r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL())) - resp, err := client.Do(req) - updateURLMetrics(ctx, r, resp, err) - if r.c.base != nil { + + var retryAfter *RetryAfter + url := r.URL().String() + for { + req, err := r.newHTTPRequest(ctx) if err != nil { - r.backoff.UpdateBackoff(r.URL(), err, 0) - } else { - r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode) + return nil, err + } + if r.body != nil { + req.Body = ioutil.NopCloser(r.body) } - } - if err != nil { - return nil, err - } - switch { - case (resp.StatusCode >= 200) && (resp.StatusCode < 300): - handleWarnings(resp.Header, r.warningHandler) - return resp.Body, nil + r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL())) + if retryAfter != nil { + // We are retrying the request that we already send to apiserver + // at least once before. + // This request should also be throttled with the client-internal rate limiter. + if err := r.tryThrottleWithInfo(ctx, retryAfter.Reason); err != nil { + return nil, err + } + retryAfter = nil + } - default: - // ensure we close the body before returning the error - defer resp.Body.Close() + resp, err := client.Do(req) + updateURLMetrics(ctx, r, resp, err) + if r.c.base != nil { + if err != nil { + r.backoff.UpdateBackoff(r.URL(), err, 0) + } else { + r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode) + } + } + if err != nil { + // we only retry on an HTTP response with 'Retry-After' header + return nil, err + } - result := r.transformResponse(resp, req) - err := result.Error() - if err == nil { - err = fmt.Errorf("%d while accessing %v: %s", result.statusCode, url, string(result.body)) + switch { + case (resp.StatusCode >= 200) && (resp.StatusCode < 300): + handleWarnings(resp.Header, r.warningHandler) + return resp.Body, nil + + default: + done, transformErr := func() (bool, error) { + defer resp.Body.Close() + + var retry bool + retryAfter, retry = r.retry.NextRetry(req, resp, err, neverRetryError) + if retry { + err := r.retry.BeforeNextRetry(ctx, r.backoff, retryAfter, url, r.body) + if err == nil { + return false, nil + } + klog.V(4).Infof("Could not retry request - %v", err) + } + result := r.transformResponse(resp, req) + if err := result.Error(); err != nil { + return true, err + } + return true, fmt.Errorf("%d while accessing %v: %s", result.statusCode, url, string(result.body)) + }() + if done { + return nil, transformErr + } } - return nil, err } } @@ -842,6 +910,17 @@ func (r *Request) requestPreflightCheck() error { return nil } +func (r *Request) newHTTPRequest(ctx context.Context) (*http.Request, error) { + url := r.URL().String() + req, err := http.NewRequest(r.verb, url, r.body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + req.Header = r.headers + return req, nil +} + // request connects to the server and invokes the provided function when a server response is // received. It handles retry behavior and up front validation of requests. It will invoke // fn at most once. It will return an error if a problem occurred prior to connecting to the @@ -881,27 +960,22 @@ func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Resp } // Right now we make about ten retry attempts if we get a Retry-After response. - retries := 0 - var retryInfo string + var retryAfter *RetryAfter for { - - url := r.URL().String() - req, err := http.NewRequest(r.verb, url, r.body) + req, err := r.newHTTPRequest(ctx) if err != nil { return err } - req = req.WithContext(ctx) - req.Header = r.headers r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL())) - if retries > 0 { + if retryAfter != nil { // We are retrying the request that we already send to apiserver // at least once before. // This request should also be throttled with the client-internal rate limiter. - if err := r.tryThrottleWithInfo(ctx, retryInfo); err != nil { + if err := r.tryThrottleWithInfo(ctx, retryAfter.Reason); err != nil { return err } - retryInfo = "" + retryAfter = nil } resp, err := client.Do(req) updateURLMetrics(ctx, r, resp, err) @@ -910,61 +984,45 @@ func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Resp } else { r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode) } - if err != nil { - // "Connection reset by peer" or "apiserver is shutting down" are usually a transient errors. - // Thus in case of "GET" operations, we simply retry it. - // We are not automatically retrying "write" operations, as - // they are not idempotent. - if r.verb != "GET" { - return err - } - // For connection errors and apiserver shutdown errors retry. - if net.IsConnectionReset(err) || net.IsProbableEOF(err) { - // For the purpose of retry, we set the artificial "retry-after" response. - // TODO: Should we clean the original response if it exists? - resp = &http.Response{ - StatusCode: http.StatusInternalServerError, - Header: http.Header{"Retry-After": []string{"1"}}, - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - } else { - return err - } - } done := func() bool { - // Ensure the response body is fully read and closed - // before we reconnect, so that we reuse the same TCP - // connection. - defer func() { - const maxBodySlurpSize = 2 << 10 - if resp.ContentLength <= maxBodySlurpSize { - io.Copy(ioutil.Discard, &io.LimitedReader{R: resp.Body, N: maxBodySlurpSize}) - } - resp.Body.Close() - }() + defer readAndCloseResponseBody(resp) - retries++ - if seconds, wait := checkWait(resp); wait && retries <= r.maxRetries { - retryInfo = getRetryReason(retries, seconds, resp, err) - if seeker, ok := r.body.(io.Seeker); ok && r.body != nil { - _, err := seeker.Seek(0, 0) - if err != nil { - klog.V(4).Infof("Could not retry request, can't Seek() back to beginning of body for %T", r.body) - fn(req, resp) - return true - } + // if the the server returns an error in err, the response will be nil. + f := func(req *http.Request, resp *http.Response) { + if resp == nil { + return } + fn(req, resp) + } - klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", seconds, retries, url) - r.backoff.Sleep(time.Duration(seconds) * time.Second) + var retry bool + retryAfter, retry = r.retry.NextRetry(req, resp, err, func(req *http.Request, err error) bool { + // "Connection reset by peer" or "apiserver is shutting down" are usually a transient errors. + // Thus in case of "GET" operations, we simply retry it. + // We are not automatically retrying "write" operations, as they are not idempotent. + if r.verb != "GET" { + return false + } + // For connection errors and apiserver shutdown errors retry. + if net.IsConnectionReset(err) || net.IsProbableEOF(err) { + return true + } return false + }) + if retry { + err := r.retry.BeforeNextRetry(ctx, r.backoff, retryAfter, req.URL.String(), r.body) + if err == nil { + return false + } + klog.V(4).Infof("Could not retry request - %v", err) } - fn(req, resp) + + f(req, resp) return true }() if done { - return nil + return err } } } @@ -1196,19 +1254,6 @@ func isTextResponse(resp *http.Response) bool { return strings.HasPrefix(media, "text/") } -// checkWait returns true along with a number of seconds if the server instructed us to wait -// before retrying. -func checkWait(resp *http.Response) (int, bool) { - switch r := resp.StatusCode; { - // any 500 error code and 429 can trigger a wait - case r == http.StatusTooManyRequests, r >= 500: - default: - return 0, false - } - i, ok := retryAfterSeconds(resp) - return i, ok -} - // retryAfterSeconds returns the value of the Retry-After header and true, or 0 and false if // the header was missing or not a valid number. func retryAfterSeconds(resp *http.Response) (int, bool) { @@ -1220,26 +1265,6 @@ func retryAfterSeconds(resp *http.Response) (int, bool) { return 0, false } -func getRetryReason(retries, seconds int, resp *http.Response, err error) string { - // priority and fairness sets the UID of the FlowSchema associated with a request - // in the following response Header. - const responseHeaderMatchedFlowSchemaUID = "X-Kubernetes-PF-FlowSchema-UID" - - message := fmt.Sprintf("retries: %d, retry-after: %ds", retries, seconds) - - switch { - case resp.StatusCode == http.StatusTooManyRequests: - // it is server-side throttling from priority and fairness - flowSchemaUID := resp.Header.Get(responseHeaderMatchedFlowSchemaUID) - return fmt.Sprintf("%s - retry-reason: due to server-side throttling, FlowSchema UID: %q", message, flowSchemaUID) - case err != nil: - // it's a retriable error - return fmt.Sprintf("%s - retry-reason: due to retriable error, error: %v", message, err) - default: - return fmt.Sprintf("%s - retry-reason: %d", message, resp.StatusCode) - } -} - // Result contains the result of calling Request.Do(). type Result struct { body []byte diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/rest/with_retry.go b/cluster-autoscaler/vendor/k8s.io/client-go/rest/with_retry.go new file mode 100644 index 000000000000..1b7360b53490 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/rest/with_retry.go @@ -0,0 +1,232 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rest + +import ( + "context" + "fmt" + "io" + "io/ioutil" + "net/http" + "time" + + "k8s.io/klog/v2" +) + +// IsRetryableErrorFunc allows the client to provide its own function +// that determines whether the specified err from the server is retryable. +// +// request: the original request sent to the server +// err: the server sent this error to us +// +// The function returns true if the error is retryable and the request +// can be retried, otherwise it returns false. +// We have four mode of communications - 'Stream', 'Watch', 'Do' and 'DoRaw', this +// function allows us to customize the retryability aspect of each. +type IsRetryableErrorFunc func(request *http.Request, err error) bool + +func (r IsRetryableErrorFunc) IsErrorRetryable(request *http.Request, err error) bool { + return r(request, err) +} + +var neverRetryError = IsRetryableErrorFunc(func(_ *http.Request, _ error) bool { + return false +}) + +// WithRetry allows the client to retry a request up to a certain number of times +// Note that WithRetry is not safe for concurrent use by multiple +// goroutines without additional locking or coordination. +type WithRetry interface { + // SetMaxRetries makes the request use the specified integer as a ceiling + // for retries upon receiving a 429 status code and the "Retry-After" header + // in the response. + // A zero maxRetries should prevent from doing any retry and return immediately. + SetMaxRetries(maxRetries int) + + // NextRetry advances the retry counter appropriately and returns true if the + // request should be retried, otherwise it returns false if: + // - we have already reached the maximum retry threshold. + // - the error does not fall into the retryable category. + // - the server has not sent us a 429, or 5xx status code and the + // 'Retry-After' response header is not set with a value. + // + // if retry is set to true, retryAfter will contain the information + // regarding the next retry. + // + // request: the original request sent to the server + // resp: the response sent from the server, it is set if err is nil + // err: the server sent this error to us, if err is set then resp is nil. + // f: a IsRetryableErrorFunc function provided by the client that determines + // if the err sent by the server is retryable. + NextRetry(req *http.Request, resp *http.Response, err error, f IsRetryableErrorFunc) (*RetryAfter, bool) + + // BeforeNextRetry is responsible for carrying out operations that need + // to be completed before the next retry is initiated: + // - if the request context is already canceled there is no need to + // retry, the function will return ctx.Err(). + // - we need to seek to the beginning of the request body before we + // initiate the next retry, the function should return an error if + // it fails to do so. + // - we should wait the number of seconds the server has asked us to + // in the 'Retry-After' response header. + // + // If BeforeNextRetry returns an error the client should abort the retry, + // otherwise it is safe to initiate the next retry. + BeforeNextRetry(ctx context.Context, backoff BackoffManager, retryAfter *RetryAfter, url string, body io.Reader) error +} + +// RetryAfter holds information associated with the next retry. +type RetryAfter struct { + // Wait is the duration the server has asked us to wait before + // the next retry is initiated. + // This is the value of the 'Retry-After' response header in seconds. + Wait time.Duration + + // Attempt is the Nth attempt after which we have received a retryable + // error or a 'Retry-After' response header from the server. + Attempt int + + // Reason describes why we are retrying the request + Reason string +} + +type withRetry struct { + maxRetries int + attempts int +} + +func (r *withRetry) SetMaxRetries(maxRetries int) { + if maxRetries < 0 { + maxRetries = 0 + } + r.maxRetries = maxRetries +} + +func (r *withRetry) NextRetry(req *http.Request, resp *http.Response, err error, f IsRetryableErrorFunc) (*RetryAfter, bool) { + if req == nil || (resp == nil && err == nil) { + // bad input, we do nothing. + return nil, false + } + + r.attempts++ + retryAfter := &RetryAfter{Attempt: r.attempts} + if r.attempts > r.maxRetries { + return retryAfter, false + } + + // if the server returned an error, it takes precedence over the http response. + var errIsRetryable bool + if f != nil && err != nil && f.IsErrorRetryable(req, err) { + errIsRetryable = true + // we have a retryable error, for which we will create an + // artificial "Retry-After" response. + resp = retryAfterResponse() + } + if err != nil && !errIsRetryable { + return retryAfter, false + } + + // if we are here, we have either a or b: + // a: we have a retryable error, for which we already + // have an artificial "Retry-After" response. + // b: we have a response from the server for which we + // need to check if it is retryable + seconds, wait := checkWait(resp) + if !wait { + return retryAfter, false + } + + retryAfter.Wait = time.Duration(seconds) * time.Second + retryAfter.Reason = getRetryReason(r.attempts, seconds, resp, err) + return retryAfter, true +} + +func (r *withRetry) BeforeNextRetry(ctx context.Context, backoff BackoffManager, retryAfter *RetryAfter, url string, body io.Reader) error { + // Ensure the response body is fully read and closed before + // we reconnect, so that we reuse the same TCP connection. + if ctx.Err() != nil { + return ctx.Err() + } + + if seeker, ok := body.(io.Seeker); ok && body != nil { + if _, err := seeker.Seek(0, 0); err != nil { + return fmt.Errorf("can't Seek() back to beginning of body for %T", r) + } + } + + klog.V(4).Infof("Got a Retry-After %s response for attempt %d to %v", retryAfter.Wait, retryAfter.Attempt, url) + if backoff != nil { + backoff.Sleep(retryAfter.Wait) + } + return nil +} + +// checkWait returns true along with a number of seconds if +// the server instructed us to wait before retrying. +func checkWait(resp *http.Response) (int, bool) { + switch r := resp.StatusCode; { + // any 500 error code and 429 can trigger a wait + case r == http.StatusTooManyRequests, r >= 500: + default: + return 0, false + } + i, ok := retryAfterSeconds(resp) + return i, ok +} + +func getRetryReason(retries, seconds int, resp *http.Response, err error) string { + // priority and fairness sets the UID of the FlowSchema + // associated with a request in the following response Header. + const responseHeaderMatchedFlowSchemaUID = "X-Kubernetes-PF-FlowSchema-UID" + + message := fmt.Sprintf("retries: %d, retry-after: %ds", retries, seconds) + + switch { + case resp.StatusCode == http.StatusTooManyRequests: + // it is server-side throttling from priority and fairness + flowSchemaUID := resp.Header.Get(responseHeaderMatchedFlowSchemaUID) + return fmt.Sprintf("%s - retry-reason: due to server-side throttling, FlowSchema UID: %q", message, flowSchemaUID) + case err != nil: + // it's a retryable error + return fmt.Sprintf("%s - retry-reason: due to retryable error, error: %v", message, err) + default: + return fmt.Sprintf("%s - retry-reason: %d", message, resp.StatusCode) + } +} + +func readAndCloseResponseBody(resp *http.Response) { + if resp == nil { + return + } + + // Ensure the response body is fully read and closed + // before we reconnect, so that we reuse the same TCP + // connection. + const maxBodySlurpSize = 2 << 10 + defer resp.Body.Close() + + if resp.ContentLength <= maxBodySlurpSize { + io.Copy(ioutil.Discard, &io.LimitedReader{R: resp.Body, N: maxBodySlurpSize}) + } +} + +func retryAfterResponse() *http.Response { + return &http.Response{ + StatusCode: http.StatusInternalServerError, + Header: http.Header{"Retry-After": []string{"1"}}, + } +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/testing/fake.go b/cluster-autoscaler/vendor/k8s.io/client-go/testing/fake.go index 8b9ee149c83e..3ab9c1b075d5 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/testing/fake.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/testing/fake.go @@ -106,11 +106,15 @@ func (c *Fake) PrependReactor(verb, resource string, reaction ReactionFunc) { // AddWatchReactor appends a reactor to the end of the chain. func (c *Fake) AddWatchReactor(resource string, reaction WatchReactionFunc) { + c.Lock() + defer c.Unlock() c.WatchReactionChain = append(c.WatchReactionChain, &SimpleWatchReactor{resource, reaction}) } // PrependWatchReactor adds a reactor to the beginning of the chain. func (c *Fake) PrependWatchReactor(resource string, reaction WatchReactionFunc) { + c.Lock() + defer c.Unlock() c.WatchReactionChain = append([]WatchReactor{&SimpleWatchReactor{resource, reaction}}, c.WatchReactionChain...) } diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/testing/fixture.go b/cluster-autoscaler/vendor/k8s.io/client-go/testing/fixture.go index d3b937247b24..caa045117eea 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/testing/fixture.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/testing/fixture.go @@ -20,6 +20,7 @@ import ( "fmt" "reflect" "sort" + "strings" "sync" jsonpatch "github.com/evanphx/json-patch" @@ -509,12 +510,8 @@ func (r *SimpleReactor) Handles(action Action) bool { if !verbCovers { return false } - resourceCovers := r.Resource == "*" || r.Resource == action.GetResource().Resource - if !resourceCovers { - return false - } - return true + return resourceCovers(r.Resource, action) } func (r *SimpleReactor) React(action Action) (bool, runtime.Object, error) { @@ -530,12 +527,7 @@ type SimpleWatchReactor struct { } func (r *SimpleWatchReactor) Handles(action Action) bool { - resourceCovers := r.Resource == "*" || r.Resource == action.GetResource().Resource - if !resourceCovers { - return false - } - - return true + return resourceCovers(r.Resource, action) } func (r *SimpleWatchReactor) React(action Action) (bool, watch.Interface, error) { @@ -551,14 +543,27 @@ type SimpleProxyReactor struct { } func (r *SimpleProxyReactor) Handles(action Action) bool { - resourceCovers := r.Resource == "*" || r.Resource == action.GetResource().Resource - if !resourceCovers { - return false - } - - return true + return resourceCovers(r.Resource, action) } func (r *SimpleProxyReactor) React(action Action) (bool, restclient.ResponseWrapper, error) { return r.Reaction(action) } + +func resourceCovers(resource string, action Action) bool { + if resource == "*" { + return true + } + + if resource == action.GetResource().Resource { + return true + } + + if index := strings.Index(resource, "/"); index != -1 && + resource[:index] == action.GetResource().Resource && + resource[index+1:] == action.GetSubresource() { + return true + } + + return false +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/testing/interface.go b/cluster-autoscaler/vendor/k8s.io/client-go/testing/interface.go new file mode 100644 index 000000000000..266c6ba3f547 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/testing/interface.go @@ -0,0 +1,66 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testing + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + restclient "k8s.io/client-go/rest" +) + +type FakeClient interface { + // Tracker gives access to the ObjectTracker internal to the fake client. + Tracker() ObjectTracker + + // AddReactor appends a reactor to the end of the chain. + AddReactor(verb, resource string, reaction ReactionFunc) + + // PrependReactor adds a reactor to the beginning of the chain. + PrependReactor(verb, resource string, reaction ReactionFunc) + + // AddWatchReactor appends a reactor to the end of the chain. + AddWatchReactor(resource string, reaction WatchReactionFunc) + + // PrependWatchReactor adds a reactor to the beginning of the chain. + PrependWatchReactor(resource string, reaction WatchReactionFunc) + + // AddProxyReactor appends a reactor to the end of the chain. + AddProxyReactor(resource string, reaction ProxyReactionFunc) + + // PrependProxyReactor adds a reactor to the beginning of the chain. + PrependProxyReactor(resource string, reaction ProxyReactionFunc) + + // Invokes records the provided Action and then invokes the ReactionFunc that + // handles the action if one exists. defaultReturnObj is expected to be of the + // same type a normal call would return. + Invokes(action Action, defaultReturnObj runtime.Object) (runtime.Object, error) + + // InvokesWatch records the provided Action and then invokes the ReactionFunc + // that handles the action if one exists. + InvokesWatch(action Action) (watch.Interface, error) + + // InvokesProxy records the provided Action and then invokes the ReactionFunc + // that handles the action if one exists. + InvokesProxy(action Action) restclient.ResponseWrapper + + // ClearActions clears the history of actions called on the fake client. + ClearActions() + + // Actions returns a chronologically ordered slice fake actions called on the + // fake client. + Actions() []Action +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/controller.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/controller.go index 684d1a8d388c..fe394d16ceb0 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/controller.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/controller.go @@ -325,7 +325,7 @@ func NewInformer( return clientState, newInformer(lw, objType, resyncPeriod, h, clientState) } -// NewIndexerInformer returns a Indexer and a controller for populating the index +// NewIndexerInformer returns an Indexer and a Controller for populating the index // while also providing event notifications. You should only used the returned // Index for Get/List operations; Add/Modify/Deletes will cause the event // notifications to be faulty. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/delta_fifo.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/delta_fifo.go index 1464d34c62d8..82038e0f94bb 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/delta_fifo.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/delta_fifo.go @@ -153,7 +153,7 @@ const ( // change happened, and the object's state after* that change. // // [*] Unless the change is a deletion, and then you'll get the final -// state of the object before it was deleted. +// state of the object before it was deleted. type Delta struct { Type DeltaType Object interface{} @@ -174,9 +174,10 @@ type Deltas []Delta // modifications. // // TODO: consider merging keyLister with this object, tracking a list of -// "known" keys when Pop() is called. Have to think about how that -// affects error retrying. -// NOTE: It is possible to misuse this and cause a race when using an +// "known" keys when Pop() is called. Have to think about how that +// affects error retrying. +// +// NOTE: It is possible to misuse this and cause a race when using an // external known object source. // Whether there is a potential race depends on how the consumer // modifies knownObjects. In Pop(), process function is called under @@ -185,8 +186,7 @@ type Deltas []Delta // // Example: // In case of sharedIndexInformer being a consumer -// (https://github.com/kubernetes/kubernetes/blob/0cdd940f/staging/ -// src/k8s.io/client-go/tools/cache/shared_informer.go#L192), +// (https://github.com/kubernetes/kubernetes/blob/0cdd940f/staging/src/k8s.io/client-go/tools/cache/shared_informer.go#L192), // there is no race as knownObjects (s.indexer) is modified safely // under DeltaFIFO's lock. The only exceptions are GetStore() and // GetIndexer() methods, which expose ways to modify the underlying diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/fifo.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/fifo.go index edb2c8ed6c4e..f82bf22d2fcf 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/fifo.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/fifo.go @@ -263,10 +263,7 @@ func (f *FIFO) GetByKey(key string) (item interface{}, exists bool, err error) { func (f *FIFO) IsClosed() bool { f.lock.Lock() defer f.lock.Unlock() - if f.closed { - return true - } - return false + return f.closed } // Pop waits until an item is ready and processes it. If multiple items are diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/heap.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/heap.go index e503a45a467f..819325e9e2e0 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/heap.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/heap.go @@ -304,10 +304,7 @@ func (h *Heap) GetByKey(key string) (interface{}, bool, error) { func (h *Heap) IsClosed() bool { h.lock.RLock() defer h.lock.RUnlock() - if h.closed { - return true - } - return false + return h.closed } // NewHeap returns a Heap which can be used to queue up items to process. diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/clientcmd/config.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/clientcmd/config.go index 12c8b84f3778..31f8963160e7 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/clientcmd/config.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/clientcmd/config.go @@ -135,11 +135,7 @@ func (o *PathOptions) GetDefaultFilename() string { } func (o *PathOptions) IsExplicitFile() bool { - if len(o.LoadingRules.ExplicitPath) > 0 { - return true - } - - return false + return len(o.LoadingRules.ExplicitPath) > 0 } func (o *PathOptions) GetExplicitFile() string { diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/events/helper.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/events/helper.go new file mode 100644 index 000000000000..dfc57af4c244 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/events/helper.go @@ -0,0 +1,64 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package events + +import ( + "fmt" + + corev1 "k8s.io/api/core/v1" + eventsv1 "k8s.io/api/events/v1" + eventsv1beta1 "k8s.io/api/events/v1beta1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" +) + +var mapping = map[schema.GroupVersion]string{ + eventsv1.SchemeGroupVersion: "regarding", + eventsv1beta1.SchemeGroupVersion: "regarding", + corev1.SchemeGroupVersion: "involvedObject", +} + +// GetFieldSelector returns the appropriate field selector based on the API version being used to communicate with the server. +// The returned field selector can be used with List and Watch to filter desired events. +func GetFieldSelector(eventsGroupVersion schema.GroupVersion, regardingGroupVersionKind schema.GroupVersionKind, regardingName string, regardingUID types.UID) (fields.Selector, error) { + field := fields.Set{} + + if _, ok := mapping[eventsGroupVersion]; !ok { + return nil, fmt.Errorf("unknown version %v", eventsGroupVersion) + } + prefix := mapping[eventsGroupVersion] + + if len(regardingName) > 0 { + field[prefix+".name"] = regardingName + } + + if len(regardingGroupVersionKind.Kind) > 0 { + field[prefix+".kind"] = regardingGroupVersionKind.Kind + } + + regardingGroupVersion := regardingGroupVersionKind.GroupVersion() + if !regardingGroupVersion.Empty() { + field[prefix+".apiVersion"] = regardingGroupVersion.String() + } + + if len(regardingUID) > 0 { + field[prefix+".uid"] = string(regardingUID) + } + + return field.AsSelector(), nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/util/util.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/util/util.go index d1818a8d907a..afcc6a6a07ed 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/util/util.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/tools/record/util/util.go @@ -36,9 +36,5 @@ func ValidateEventType(eventtype string) bool { func IsKeyNotFoundError(err error) bool { statusErr, _ := err.(*errors.StatusError) - if statusErr != nil && statusErr.Status().Code == http.StatusNotFound { - return true - } - - return false + return statusErr != nil && statusErr.Status().Code == http.StatusNotFound } diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/transport/round_trippers.go b/cluster-autoscaler/vendor/k8s.io/client-go/transport/round_trippers.go index cd0a4455f194..818fd52d6e50 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/transport/round_trippers.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/transport/round_trippers.go @@ -346,7 +346,7 @@ func (r *requestInfo) toCurl() string { } } - return fmt.Sprintf("curl -k -v -X%s %s '%s'", r.RequestVerb, headers, r.RequestURL) + return fmt.Sprintf("curl -v -X%s %s '%s'", r.RequestVerb, headers, r.RequestURL) } // debuggingRoundTripper will display information about the requests passing diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/transport/transport.go b/cluster-autoscaler/vendor/k8s.io/client-go/transport/transport.go index 083364fd6de4..b4a7bfa67cda 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/transport/transport.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/transport/transport.go @@ -20,6 +20,7 @@ import ( "context" "crypto/tls" "crypto/x509" + "encoding/pem" "fmt" "io/ioutil" "net/http" @@ -79,7 +80,11 @@ func TLSConfigFor(c *Config) (*tls.Config, error) { } if c.HasCA() { - tlsConfig.RootCAs = rootCertPool(c.TLS.CAData) + rootCAs, err := rootCertPool(c.TLS.CAData) + if err != nil { + return nil, fmt.Errorf("unable to load root certificates: %w", err) + } + tlsConfig.RootCAs = rootCAs } var staticCert *tls.Certificate @@ -176,18 +181,41 @@ func dataFromSliceOrFile(data []byte, file string) ([]byte, error) { // rootCertPool returns nil if caData is empty. When passed along, this will mean "use system CAs". // When caData is not empty, it will be the ONLY information used in the CertPool. -func rootCertPool(caData []byte) *x509.CertPool { +func rootCertPool(caData []byte) (*x509.CertPool, error) { // What we really want is a copy of x509.systemRootsPool, but that isn't exposed. It's difficult to build (see the go // code for a look at the platform specific insanity), so we'll use the fact that RootCAs == nil gives us the system values // It doesn't allow trusting either/or, but hopefully that won't be an issue if len(caData) == 0 { - return nil + return nil, nil } // if we have caData, use it certPool := x509.NewCertPool() - certPool.AppendCertsFromPEM(caData) - return certPool + if ok := certPool.AppendCertsFromPEM(caData); !ok { + return nil, createErrorParsingCAData(caData) + } + return certPool, nil +} + +// createErrorParsingCAData ALWAYS returns an error. We call it because know we failed to AppendCertsFromPEM +// but we don't know the specific error because that API is just true/false +func createErrorParsingCAData(pemCerts []byte) error { + for len(pemCerts) > 0 { + var block *pem.Block + block, pemCerts = pem.Decode(pemCerts) + if block == nil { + return fmt.Errorf("unable to parse bytes as PEM block") + } + + if block.Type != "CERTIFICATE" || len(block.Headers) != 0 { + continue + } + + if _, err := x509.ParseCertificate(block.Bytes); err != nil { + return fmt.Errorf("failed to parse certificate: %w", err) + } + } + return fmt.Errorf("no valid certificate authority data seen") } // WrapperFunc wraps an http.RoundTripper when a new transport diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/util/cert/cert.go b/cluster-autoscaler/vendor/k8s.io/client-go/util/cert/cert.go index 3da144163683..bffb1526272f 100644 --- a/cluster-autoscaler/vendor/k8s.io/client-go/util/cert/cert.go +++ b/cluster-autoscaler/vendor/k8s.io/client-go/util/cert/cert.go @@ -62,6 +62,7 @@ func NewSelfSignedCACert(cfg Config, key crypto.Signer) (*x509.Certificate, erro CommonName: cfg.CommonName, Organization: cfg.Organization, }, + DNSNames: []string{cfg.CommonName}, NotBefore: now.UTC(), NotAfter: now.Add(duration365d * 10).UTC(), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, diff --git a/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.mod b/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.mod index 23f18fec9954..a1210ece41b9 100644 --- a/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.mod +++ b/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.mod @@ -5,25 +5,25 @@ module k8s.io/cloud-provider go 1.16 require ( - github.com/google/go-cmp v0.5.2 + github.com/google/go-cmp v0.5.4 github.com/spf13/cobra v1.1.1 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.6.1 - k8s.io/api v0.22.0-alpha.1 - k8s.io/apimachinery v0.22.0-alpha.1 - k8s.io/apiserver v0.22.0-alpha.1 - k8s.io/client-go v0.22.0-alpha.1 - k8s.io/component-base v0.22.0-alpha.1 - k8s.io/controller-manager v0.22.0-alpha.1 - k8s.io/klog/v2 v2.8.0 - k8s.io/utils v0.0.0-20201110183641-67b214c5f920 + github.com/stretchr/testify v1.7.0 + k8s.io/api v0.22.0-alpha.3 + k8s.io/apimachinery v0.22.0-alpha.3 + k8s.io/apiserver v0.22.0-alpha.3 + k8s.io/client-go v0.22.0-alpha.3 + k8s.io/component-base v0.22.0-alpha.3 + k8s.io/controller-manager v0.22.0-alpha.3 + k8s.io/klog/v2 v2.9.0 + k8s.io/utils v0.0.0-20210521133846-da695404a2bc ) replace ( - k8s.io/api => k8s.io/api v0.22.0-alpha.1 - k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.1 - k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.1 - k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.1 - k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.1 - k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.1 + k8s.io/api => k8s.io/api v0.22.0-alpha.3 + k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.3 + k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.3 + k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.3 + k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.3 + k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.3 ) diff --git a/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.sum b/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.sum index 2aca3ed8424e..e23ca0ba5cd8 100644 --- a/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.sum +++ b/cluster-autoscaler/vendor/k8s.io/cloud-provider/go.sum @@ -47,6 +47,7 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -103,19 +104,23 @@ github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= +github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= 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/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= @@ -165,8 +170,8 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -219,7 +224,6 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q= @@ -228,6 +232,7 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= @@ -236,10 +241,12 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -281,18 +288,23 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= @@ -317,8 +329,9 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -334,6 +347,7 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -362,8 +376,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= @@ -464,6 +478,8 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -498,8 +514,11 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -510,13 +529,15 @@ golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/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-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 h1:dXfMednGJh/SUUFjTLsWJz3P+TQt9qnR11GgeI3vWKs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= @@ -526,8 +547,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -643,7 +664,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8X gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -660,6 +680,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/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= @@ -675,31 +696,31 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.0-alpha.1 h1:LuUYyELM7hm5I7B8pjn8dhZHQTcw86C/bFBNNu0/QoY= -k8s.io/api v0.22.0-alpha.1/go.mod h1:vQHAkhGeeRA6zI8QNe3tcuQqGXanfyk6mehgpyIHcpY= -k8s.io/apimachinery v0.22.0-alpha.1 h1:5H8J1su7o60La1W4iOytFrsn2DeRxd9NXVxulXWOdOE= -k8s.io/apimachinery v0.22.0-alpha.1/go.mod h1:fBRSkoylGO2QUTae8Wb2wac6pZ83/r+tL6HFSXGbzfs= -k8s.io/apiserver v0.22.0-alpha.1 h1:1KEDWuHHLCbH+Q/qR8gZRCJdbmoEcRanjsvTvG/AAR0= -k8s.io/apiserver v0.22.0-alpha.1/go.mod h1:EBtDCYoV1+DxaNcB9OD61zUUyWlUaJ5a9CHwQKTD5Qg= -k8s.io/client-go v0.22.0-alpha.1 h1:RHT0MJXzZLwNhL8lluEko7zQ4n0fRn2TtmiZPiQI/fY= -k8s.io/client-go v0.22.0-alpha.1/go.mod h1:9onZcKpTRbDD0wiJC/T1toeVMYPyCQPgWHDn4xpQsHA= -k8s.io/component-base v0.22.0-alpha.1 h1:X33MURXK6wXVMH4u28ckqXakOv1YBaB13FuPpUed8Y0= -k8s.io/component-base v0.22.0-alpha.1/go.mod h1:mglpF0fcNfkUMD+FaqSzEE/nop+WUlBrujXwYG5gthg= -k8s.io/controller-manager v0.22.0-alpha.1 h1:Bab20wU/lOkNlPwdyhDu4r23wJs3g1KxJ35hUM4wGhg= -k8s.io/controller-manager v0.22.0-alpha.1/go.mod h1:3LoOmi7qe/dMhTgruY0iE8sYzMAq7sHwmPUYPKrKjW8= +k8s.io/api v0.22.0-alpha.3 h1:rE7mI2nvuTyiSo3+C7iiVxWh1lmOqBTUVLloX+c9s4c= +k8s.io/api v0.22.0-alpha.3/go.mod h1:1XKmwk4lbdJRku2EqAElh5amCLsl9JvjSbQzUteQ1ac= +k8s.io/apimachinery v0.22.0-alpha.3 h1:VIzKYyrRYpaPQDwhH6SZVy/04OR69ZKhovidSU+KjvY= +k8s.io/apimachinery v0.22.0-alpha.3/go.mod h1:5zcgojGmAy5Bo3S4mgZWAt6HwoKzaSh4MV3ITvlcOVM= +k8s.io/apiserver v0.22.0-alpha.3 h1:xcsUrEFSrN/u3MyIn3OK45fdMJwlmcvoD57FmWdQNSQ= +k8s.io/apiserver v0.22.0-alpha.3/go.mod h1:doQlHDHKpIHK6J/B8ERWxM7q0k3/dd+onnUpPaq8Ls8= +k8s.io/client-go v0.22.0-alpha.3 h1:kkvu6ggorI0tpU43aD9hRJZGhdC445d6RbMr0cb6HXY= +k8s.io/client-go v0.22.0-alpha.3/go.mod h1:ESvYVqJpwz3imRbIpr/eUZy20OaJ/TFene8F3ZTFtFY= +k8s.io/component-base v0.22.0-alpha.3 h1:2LkzKT/kOK2BArPE6E4GiaqQEHmUUqJOIzc+pw0y0pM= +k8s.io/component-base v0.22.0-alpha.3/go.mod h1:/uparSfFelitkoqeEEqpoJyJJMmc42rY3oJ7hNnQmzQ= +k8s.io/controller-manager v0.22.0-alpha.3 h1:Hu03MO7ENI5lAl23f/Av2wSpHUuI97mWVuzEB3PLfg8= +k8s.io/controller-manager v0.22.0-alpha.3/go.mod h1:DHADR6ytfFVL+UjOxSjZODjSv2mRiQ2oBBAcMUXUCJM= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= +k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210521133846-da695404a2bc h1:dx6VGe+PnOW/kD/2UV4aUSsRfJGd7+lcqgJ6Xg0HwUs= +k8s.io/utils v0.0.0-20210521133846-da695404a2bc/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15 h1:4uqm9Mv+w2MmBYD+F4qf/v6tDFUdPOk29C095RbU5mY= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19 h1:0jaDAAxtqIrrqas4vtTqxct4xS5kHfRNycTRLTyJmVM= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.1 h1:nYqY2A6oy37sKLYuSBXuQhbj4JVclzJK13BOIvJG5XU= sigs.k8s.io/structured-merge-diff/v4 v4.1.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= diff --git a/cluster-autoscaler/vendor/k8s.io/cloud-provider/plugins.go b/cluster-autoscaler/vendor/k8s.io/cloud-provider/plugins.go index e408e9cbc483..bfd731631495 100644 --- a/cluster-autoscaler/vendor/k8s.io/cloud-provider/plugins.go +++ b/cluster-autoscaler/vendor/k8s.io/cloud-provider/plugins.go @@ -40,11 +40,11 @@ var ( external bool detail string }{ - {"aws", false, "The AWS provider is deprecated and will be removed in a future release"}, - {"azure", false, "The Azure provider is deprecated and will be removed in a future release"}, - {"gce", false, "The GCE provider is deprecated and will be removed in a future release"}, + {"aws", false, "The AWS provider is deprecated and will be removed in a future release. Please use https://github.com/kubernetes/cloud-provider-aws"}, + {"azure", false, "The Azure provider is deprecated and will be removed in a future release. Please use https://github.com/kubernetes-sigs/cloud-provider-azure"}, + {"gce", false, "The GCE provider is deprecated and will be removed in a future release. Please use https://github.com/kubernetes/cloud-provider-gcp"}, {"openstack", true, "https://github.com/kubernetes/cloud-provider-openstack"}, - {"vsphere", false, "The vSphere provider is deprecated and will be removed in a future release"}, + {"vsphere", false, "The vSphere provider is deprecated and will be removed in a future release. Please use https://github.com/kubernetes/cloud-provider-vsphere"}, } ) @@ -91,6 +91,33 @@ func IsExternal(name string) bool { return name == externalCloudProvider } +// IsDeprecatedInternal is responsible for preventing cloud.Interface +// from being initialized in kubelet, kube-controller-manager or kube-api-server +func IsDeprecatedInternal(name string) bool { + for _, provider := range deprecatedCloudProviders { + if provider.name == name { + return true + } + } + + return false +} + +// DisableWarningForProvider logs information about disabled cloud provider state +func DisableWarningForProvider(providerName string) { + for _, provider := range deprecatedCloudProviders { + if provider.name == providerName { + klog.Infof("INFO: Please make sure you are running external cloud controller manager binary for provider %q."+ + "In-tree cloud providers are currently disabled. Refer to https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/cloud-provider/sample"+ + "for example implementation.", providerName) + detail := fmt.Sprintf("Please reach to sig-cloud-provider and use 'external' cloud provider for %q: %s", providerName, provider.detail) + klog.Warningf("WARNING: %q built-in cloud provider is now disabled. %s", providerName, detail) + break + } + } +} + +// DeprecationWarningForProvider logs information about deprecated cloud provider state func DeprecationWarningForProvider(providerName string) { for _, provider := range deprecatedCloudProviders { if provider.name != providerName { diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/logs/config.go b/cluster-autoscaler/vendor/k8s.io/component-base/logs/config.go new file mode 100644 index 000000000000..ee05d823881a --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/component-base/logs/config.go @@ -0,0 +1,94 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logs + +import ( + "flag" + "fmt" + "strings" + + "github.com/spf13/pflag" + "k8s.io/klog/v2" + + json "k8s.io/component-base/logs/json" +) + +// Supported klog formats +const ( + DefaultLogFormat = "text" + JSONLogFormat = "json" +) + +// LogRegistry is new init LogFormatRegistry struct +var LogRegistry = NewLogFormatRegistry() + +func init() { + // Text format is default klog format + LogRegistry.Register(DefaultLogFormat, nil) + LogRegistry.Register(JSONLogFormat, json.JSONLogger) +} + +// List of logs (k8s.io/klog + k8s.io/component-base/logs) flags supported by all logging formats +var supportedLogsFlags = map[string]struct{}{ + "v": {}, + // TODO: support vmodule after 1.19 Alpha +} + +// BindLoggingFlags binds the Options struct fields to a flagset +func BindLoggingFlags(o *Options, fs *pflag.FlagSet) { + normalizeFunc := func(name string) string { + f := fs.GetNormalizeFunc() + return string(f(fs, name)) + } + + unsupportedFlags := fmt.Sprintf("--%s", strings.Join(UnsupportedLoggingFlags(normalizeFunc), ", --")) + formats := fmt.Sprintf(`"%s"`, strings.Join(LogRegistry.List(), `", "`)) + fs.StringVar(&o.LogFormat, "logging-format", DefaultLogFormat, fmt.Sprintf("Sets the log format. Permitted formats: %s.\nNon-default formats don't honor these flags: %s.\nNon-default choices are currently alpha and subject to change without warning.", formats, unsupportedFlags)) + + // No new log formats should be added after generation is of flag options + LogRegistry.Freeze() + fs.BoolVar(&o.LogSanitization, "experimental-logging-sanitization", o.LogSanitization, `[Experimental] When enabled prevents logging of fields tagged as sensitive (passwords, keys, tokens). +Runtime log sanitization may introduce significant computation overhead and therefore should not be enabled in production.`) +} + +// UnsupportedLoggingFlags lists unsupported logging flags +func UnsupportedLoggingFlags(normalizeFunc func(name string) string) []string { + allFlags := []string{} + + // k8s.io/klog flags + fs := &flag.FlagSet{} + klog.InitFlags(fs) + fs.VisitAll(func(flag *flag.Flag) { + if _, found := supportedLogsFlags[flag.Name]; !found { + name := flag.Name + if normalizeFunc != nil { + name = normalizeFunc(name) + } + allFlags = append(allFlags, name) + } + }) + + // k8s.io/component-base/logs flags + pfs := &pflag.FlagSet{} + AddFlags(pfs) + pfs.VisitAll(func(flag *pflag.Flag) { + if _, found := supportedLogsFlags[flag.Name]; !found { + allFlags = append(allFlags, flag.Name) + } + }) + return allFlags +} diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go b/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go index fd23246979e6..fb6f93f0f2a3 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go @@ -17,7 +17,6 @@ limitations under the License. package logs import ( - "os" "time" "github.com/go-logr/logr" @@ -35,6 +34,38 @@ var ( timeNow = time.Now ) +func init() { + JSONLogger = NewJSONLogger(nil) +} + +// NewJSONLogger creates a new json logr.Logger using the given Zap Logger to log. +func NewJSONLogger(w zapcore.WriteSyncer) logr.Logger { + l, _ := zapConfig.Build() + l = l.WithOptions(zap.AddCallerSkip(1)) + if w != nil { + l = l.WithOptions(zap.WrapCore( + func(zapcore.Core) zapcore.Core { + return zapcore.NewCore(zapcore.NewJSONEncoder(zapConfig.EncoderConfig), zapcore.AddSync(w), zapcore.DebugLevel) + })) + } + return &zapLogger{l: l} +} + +var zapConfig = zap.Config{ + Level: zap.NewAtomicLevelAt(zap.DebugLevel), + Development: false, + Sampling: nil, + Encoding: "json", + EncoderConfig: zapcore.EncoderConfig{ + MessageKey: "msg", + TimeKey: "ts", + EncodeTime: zapcore.EpochMillisTimeEncoder, + EncodeDuration: zapcore.StringDurationEncoder, + }, + OutputPaths: []string{"stdout"}, + ErrorOutputPaths: []string{"stderr"}, +} + // zapLogger is a logr.Logger that uses Zap to record log. type zapLogger struct { // NB: this looks very similar to zap.SugaredLogger, but @@ -43,7 +74,7 @@ type zapLogger struct { lvl int } -// implement logr.Logger +// zapLogger implement logr.Logger var _ logr.Logger = &zapLogger{} // Enabled should always return true @@ -124,6 +155,10 @@ func (l *zapLogger) Error(err error, msg string, keysAndVals ...interface{}) { checkedEntry.Write(l.handleFields(keysAndVals, handleError(err))...) } +func handleError(err error) zap.Field { + return zap.NamedError("err", err) +} + // V return info logr.Logger with specified level func (l *zapLogger) V(level int) logr.Logger { return &zapLogger{ @@ -143,36 +178,3 @@ func (l *zapLogger) WithName(name string) logr.Logger { l.l = l.l.Named(name) return l } - -// encoderConfig config zap encodetime format -var encoderConfig = zapcore.EncoderConfig{ - MessageKey: "msg", - - TimeKey: "ts", - EncodeTime: zapcore.EpochMillisTimeEncoder, - EncodeDuration: zapcore.StringDurationEncoder, -} - -// NewJSONLogger creates a new json logr.Logger using the given Zap Logger to log. -func NewJSONLogger(w zapcore.WriteSyncer) logr.Logger { - l, _ := zap.NewProduction() - if w == nil { - w = os.Stdout - } - log := l.WithOptions(zap.AddCallerSkip(1), - zap.WrapCore( - func(zapcore.Core) zapcore.Core { - return zapcore.NewCore(zapcore.NewJSONEncoder(encoderConfig), zapcore.AddSync(w), zapcore.DebugLevel) - })) - return &zapLogger{ - l: log, - } -} - -func handleError(err error) zap.Field { - return zap.NamedError("err", err) -} - -func init() { - JSONLogger = NewJSONLogger(nil) -} diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/logs/options.go b/cluster-autoscaler/vendor/k8s.io/component-base/logs/options.go index 1b53a6b2cdeb..be0420ca194b 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/logs/options.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/logs/options.go @@ -17,28 +17,14 @@ limitations under the License. package logs import ( - "flag" - "fmt" - "strings" - "github.com/go-logr/logr" "github.com/spf13/pflag" - "k8s.io/component-base/logs/sanitization" "k8s.io/klog/v2" -) -const ( - logFormatFlagName = "logging-format" - defaultLogFormat = "text" + "k8s.io/component-base/logs/sanitization" ) -// List of logs (k8s.io/klog + k8s.io/component-base/logs) flags supported by all logging formats -var supportedLogsFlags = map[string]struct{}{ - "v": {}, - // TODO: support vmodule after 1.19 Alpha -} - // Options has klog format parameters type Options struct { LogFormat string @@ -48,67 +34,19 @@ type Options struct { // NewOptions return new klog options func NewOptions() *Options { return &Options{ - LogFormat: defaultLogFormat, + LogFormat: DefaultLogFormat, } } // Validate verifies if any unsupported flag is set // for non-default logging format func (o *Options) Validate() []error { - errs := []error{} - if o.LogFormat != defaultLogFormat { - allFlags := unsupportedLoggingFlags(hyphensToUnderscores) - for _, fname := range allFlags { - if flagIsSet(fname, hyphensToUnderscores) { - errs = append(errs, fmt.Errorf("non-default logging format doesn't honor flag: %s", fname)) - } - } - } - if _, err := o.Get(); err != nil { - errs = append(errs, fmt.Errorf("unsupported log format: %s", o.LogFormat)) - } - return errs -} - -// hyphensToUnderscores replaces hyphens with underscores -// we should always use underscores instead of hyphens when validate flags -func hyphensToUnderscores(s string) string { - return strings.Replace(s, "-", "_", -1) -} - -func flagIsSet(name string, normalizeFunc func(name string) string) bool { - f := flag.Lookup(name) - if f != nil { - return f.DefValue != f.Value.String() - } - if normalizeFunc != nil { - f = flag.Lookup(normalizeFunc(name)) - if f != nil { - return f.DefValue != f.Value.String() - } - } - pf := pflag.Lookup(name) - if pf != nil { - return pf.DefValue != pf.Value.String() - } - panic("failed to lookup unsupported log flag") + return ValidateLoggingConfiguration(o) } // AddFlags add logging-format flag func (o *Options) AddFlags(fs *pflag.FlagSet) { - normalizeFunc := func(name string) string { - f := fs.GetNormalizeFunc() - return string(f(fs, name)) - } - - unsupportedFlags := fmt.Sprintf("--%s", strings.Join(unsupportedLoggingFlags(normalizeFunc), ", --")) - formats := fmt.Sprintf(`"%s"`, strings.Join(logRegistry.List(), `", "`)) - fs.StringVar(&o.LogFormat, logFormatFlagName, defaultLogFormat, fmt.Sprintf("Sets the log format. Permitted formats: %s.\nNon-default formats don't honor these flags: %s.\nNon-default choices are currently alpha and subject to change without warning.", formats, unsupportedFlags)) - - // No new log formats should be added after generation is of flag options - logRegistry.Freeze() - fs.BoolVar(&o.LogSanitization, "experimental-logging-sanitization", o.LogSanitization, `[Experimental] When enabled prevents logging of fields tagged as sensitive (passwords, keys, tokens). -Runtime log sanitization may introduce significant computation overhead and therefore should not be enabled in production.`) + BindLoggingFlags(o, fs) } // Apply set klog logger from LogFormat type @@ -123,32 +61,5 @@ func (o *Options) Apply() { // Get logger with LogFormat field func (o *Options) Get() (logr.Logger, error) { - return logRegistry.Get(o.LogFormat) -} - -func unsupportedLoggingFlags(normalizeFunc func(name string) string) []string { - allFlags := []string{} - - // k8s.io/klog flags - fs := &flag.FlagSet{} - klog.InitFlags(fs) - fs.VisitAll(func(flag *flag.Flag) { - if _, found := supportedLogsFlags[flag.Name]; !found { - name := flag.Name - if normalizeFunc != nil { - name = normalizeFunc(name) - } - allFlags = append(allFlags, name) - } - }) - - // k8s.io/component-base/logs flags - pfs := &pflag.FlagSet{} - AddFlags(pfs) - pfs.VisitAll(func(flag *pflag.Flag) { - if _, found := supportedLogsFlags[flag.Name]; !found { - allFlags = append(allFlags, flag.Name) - } - }) - return allFlags + return LogRegistry.Get(o.LogFormat) } diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/logs/registry.go b/cluster-autoscaler/vendor/k8s.io/component-base/logs/registry.go index c71899db66d7..150af394c277 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/logs/registry.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/logs/registry.go @@ -21,15 +21,8 @@ import ( "sort" "github.com/go-logr/logr" - json "k8s.io/component-base/logs/json" ) -const ( - jsonLogFormat = "json" -) - -var logRegistry = NewLogFormatRegistry() - // LogFormatRegistry store klog format registry type LogFormatRegistry struct { registry map[string]logr.Logger @@ -99,8 +92,3 @@ func (lfr *LogFormatRegistry) List() []string { func (lfr *LogFormatRegistry) Freeze() { lfr.frozen = true } -func init() { - // Text format is default klog format - logRegistry.Register(defaultLogFormat, nil) - logRegistry.Register(jsonLogFormat, json.JSONLogger) -} diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/logs/validate.go b/cluster-autoscaler/vendor/k8s.io/component-base/logs/validate.go new file mode 100644 index 000000000000..0fca18a0b402 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/component-base/logs/validate.go @@ -0,0 +1,65 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logs + +import ( + "flag" + "fmt" + "strings" + + "github.com/spf13/pflag" +) + +func ValidateLoggingConfiguration(o *Options) []error { + errs := []error{} + if o.LogFormat != DefaultLogFormat { + allFlags := UnsupportedLoggingFlags(hyphensToUnderscores) + for _, fname := range allFlags { + if flagIsSet(fname, hyphensToUnderscores) { + errs = append(errs, fmt.Errorf("non-default logging format doesn't honor flag: %s", fname)) + } + } + } + if _, err := o.Get(); err != nil { + errs = append(errs, fmt.Errorf("unsupported log format: %s", o.LogFormat)) + } + return errs +} + +// hyphensToUnderscores replaces hyphens with underscores +// we should always use underscores instead of hyphens when validate flags +func hyphensToUnderscores(s string) string { + return strings.Replace(s, "-", "_", -1) +} + +func flagIsSet(name string, normalizeFunc func(name string) string) bool { + f := flag.Lookup(name) + if f != nil { + return f.DefValue != f.Value.String() + } + if normalizeFunc != nil { + f = flag.Lookup(normalizeFunc(name)) + if f != nil { + return f.DefValue != f.Value.String() + } + } + pf := pflag.Lookup(name) + if pf != nil { + return pf.DefValue != pf.Value.String() + } + panic("failed to lookup unsupported log flag") +} diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/metrics/testutil/promlint.go b/cluster-autoscaler/vendor/k8s.io/component-base/metrics/testutil/promlint.go index 33b83f05c5a6..4c537be225b9 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-base/metrics/testutil/promlint.go +++ b/cluster-autoscaler/vendor/k8s.io/component-base/metrics/testutil/promlint.go @@ -57,11 +57,6 @@ var exceptionMetrics = []string{ "get_token_count", "get_token_fail_count", "node_collector_evictions_number", - - // k8s.io/kubernetes/pkg/kubelet/server/stats - // The two metrics have been deprecated and will be removed in release v1.20+. - "container_cpu_usage_seconds_total", // non-counter metrics should not have "_total" suffix - "node_cpu_usage_seconds_total", // non-counter metrics should not have "_total" suffix } // A Problem is an issue detected by a Linter. diff --git a/cluster-autoscaler/vendor/k8s.io/component-helpers/apimachinery/lease/controller.go b/cluster-autoscaler/vendor/k8s.io/component-helpers/apimachinery/lease/controller.go index 3b31c80a7a03..517351a3b4da 100644 --- a/cluster-autoscaler/vendor/k8s.io/component-helpers/apimachinery/lease/controller.go +++ b/cluster-autoscaler/vendor/k8s.io/component-helpers/apimachinery/lease/controller.go @@ -95,7 +95,7 @@ func (c *controller) Run(stopCh <-chan struct{}) { klog.Infof("lease controller has nil lease client, will not claim or renew leases") return } - wait.Until(c.sync, c.renewInterval, stopCh) + wait.JitterUntil(c.sync, c.renewInterval, 0.04, true, stopCh) } func (c *controller) sync() { diff --git a/cluster-autoscaler/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go b/cluster-autoscaler/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go index 852cac52a0b0..4c2f1d162ddc 100644 --- a/cluster-autoscaler/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go +++ b/cluster-autoscaler/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go @@ -1119,9 +1119,11 @@ type PodSandboxConfig struct { // consider proposing new typed fields for any new features instead. Annotations map[string]string `protobuf:"bytes,7,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Optional configurations specific to Linux hosts. - Linux *LinuxPodSandboxConfig `protobuf:"bytes,8,opt,name=linux,proto3" json:"linux,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + Linux *LinuxPodSandboxConfig `protobuf:"bytes,8,opt,name=linux,proto3" json:"linux,omitempty"` + // Optional configurations specific to Windows hosts. + Windows *WindowsPodSandboxConfig `protobuf:"bytes,9,opt,name=windows,proto3" json:"windows,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *PodSandboxConfig) Reset() { *m = PodSandboxConfig{} } @@ -1212,6 +1214,13 @@ func (m *PodSandboxConfig) GetLinux() *LinuxPodSandboxConfig { return nil } +func (m *PodSandboxConfig) GetWindows() *WindowsPodSandboxConfig { + if m != nil { + return m.Windows + } + return nil +} + type RunPodSandboxRequest struct { // Configuration for creating a PodSandbox. Config *PodSandboxConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` @@ -1219,7 +1228,7 @@ type RunPodSandboxRequest struct { // If the runtime handler is unknown, this request should be rejected. An // empty string should select the default handler, equivalent to the // behavior before this feature was added. - // See https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md + // See https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class RuntimeHandler string `protobuf:"bytes,2,opt,name=runtime_handler,json=runtimeHandler,proto3" json:"runtime_handler,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` @@ -2912,6 +2921,123 @@ func (m *LinuxContainerConfig) GetSecurityContext() *LinuxContainerSecurityConte return nil } +// WindowsSandboxSecurityContext holds platform-specific configurations that will be +// applied to a sandbox. +// These settings will only apply to the sandbox container. +type WindowsSandboxSecurityContext struct { + // User name to run the container process as. If specified, the user MUST + // exist in the container image and be resolved there by the runtime; + // otherwise, the runtime MUST return error. + RunAsUsername string `protobuf:"bytes,1,opt,name=run_as_username,json=runAsUsername,proto3" json:"run_as_username,omitempty"` + // The contents of the GMSA credential spec to use to run this container. + CredentialSpec string `protobuf:"bytes,2,opt,name=credential_spec,json=credentialSpec,proto3" json:"credential_spec,omitempty"` + // Indicates whether the container be asked to run as a HostProcess container. + HostProcess bool `protobuf:"varint,3,opt,name=host_process,json=hostProcess,proto3" json:"host_process,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WindowsSandboxSecurityContext) Reset() { *m = WindowsSandboxSecurityContext{} } +func (*WindowsSandboxSecurityContext) ProtoMessage() {} +func (*WindowsSandboxSecurityContext) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{38} +} +func (m *WindowsSandboxSecurityContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WindowsSandboxSecurityContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WindowsSandboxSecurityContext.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WindowsSandboxSecurityContext) XXX_Merge(src proto.Message) { + xxx_messageInfo_WindowsSandboxSecurityContext.Merge(m, src) +} +func (m *WindowsSandboxSecurityContext) XXX_Size() int { + return m.Size() +} +func (m *WindowsSandboxSecurityContext) XXX_DiscardUnknown() { + xxx_messageInfo_WindowsSandboxSecurityContext.DiscardUnknown(m) +} + +var xxx_messageInfo_WindowsSandboxSecurityContext proto.InternalMessageInfo + +func (m *WindowsSandboxSecurityContext) GetRunAsUsername() string { + if m != nil { + return m.RunAsUsername + } + return "" +} + +func (m *WindowsSandboxSecurityContext) GetCredentialSpec() string { + if m != nil { + return m.CredentialSpec + } + return "" +} + +func (m *WindowsSandboxSecurityContext) GetHostProcess() bool { + if m != nil { + return m.HostProcess + } + return false +} + +// WindowsPodSandboxConfig holds platform-specific configurations for Windows +// host platforms and Windows-based containers. +type WindowsPodSandboxConfig struct { + // WindowsSandboxSecurityContext holds sandbox security attributes. + SecurityContext *WindowsSandboxSecurityContext `protobuf:"bytes,1,opt,name=security_context,json=securityContext,proto3" json:"security_context,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WindowsPodSandboxConfig) Reset() { *m = WindowsPodSandboxConfig{} } +func (*WindowsPodSandboxConfig) ProtoMessage() {} +func (*WindowsPodSandboxConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{39} +} +func (m *WindowsPodSandboxConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WindowsPodSandboxConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WindowsPodSandboxConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WindowsPodSandboxConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_WindowsPodSandboxConfig.Merge(m, src) +} +func (m *WindowsPodSandboxConfig) XXX_Size() int { + return m.Size() +} +func (m *WindowsPodSandboxConfig) XXX_DiscardUnknown() { + xxx_messageInfo_WindowsPodSandboxConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_WindowsPodSandboxConfig proto.InternalMessageInfo + +func (m *WindowsPodSandboxConfig) GetSecurityContext() *WindowsSandboxSecurityContext { + if m != nil { + return m.SecurityContext + } + return nil +} + // WindowsContainerSecurityContext holds windows security configuration that will be applied to a container. type WindowsContainerSecurityContext struct { // User name to run the container process as. If specified, the user MUST @@ -2919,7 +3045,9 @@ type WindowsContainerSecurityContext struct { // otherwise, the runtime MUST return error. RunAsUsername string `protobuf:"bytes,1,opt,name=run_as_username,json=runAsUsername,proto3" json:"run_as_username,omitempty"` // The contents of the GMSA credential spec to use to run this container. - CredentialSpec string `protobuf:"bytes,2,opt,name=credential_spec,json=credentialSpec,proto3" json:"credential_spec,omitempty"` + CredentialSpec string `protobuf:"bytes,2,opt,name=credential_spec,json=credentialSpec,proto3" json:"credential_spec,omitempty"` + // Indicates whether a container is to be run as a HostProcess container. + HostProcess bool `protobuf:"varint,3,opt,name=host_process,json=hostProcess,proto3" json:"host_process,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } @@ -2927,7 +3055,7 @@ type WindowsContainerSecurityContext struct { func (m *WindowsContainerSecurityContext) Reset() { *m = WindowsContainerSecurityContext{} } func (*WindowsContainerSecurityContext) ProtoMessage() {} func (*WindowsContainerSecurityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{38} + return fileDescriptor_00212fb1f9d3bf1c, []int{40} } func (m *WindowsContainerSecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2970,6 +3098,13 @@ func (m *WindowsContainerSecurityContext) GetCredentialSpec() string { return "" } +func (m *WindowsContainerSecurityContext) GetHostProcess() bool { + if m != nil { + return m.HostProcess + } + return false +} + // WindowsContainerConfig contains platform-specific configuration for // Windows-based containers. type WindowsContainerConfig struct { @@ -2984,7 +3119,7 @@ type WindowsContainerConfig struct { func (m *WindowsContainerConfig) Reset() { *m = WindowsContainerConfig{} } func (*WindowsContainerConfig) ProtoMessage() {} func (*WindowsContainerConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{39} + return fileDescriptor_00212fb1f9d3bf1c, []int{41} } func (m *WindowsContainerConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3045,7 +3180,7 @@ type WindowsContainerResources struct { func (m *WindowsContainerResources) Reset() { *m = WindowsContainerResources{} } func (*WindowsContainerResources) ProtoMessage() {} func (*WindowsContainerResources) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{40} + return fileDescriptor_00212fb1f9d3bf1c, []int{42} } func (m *WindowsContainerResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3119,7 +3254,7 @@ type ContainerMetadata struct { func (m *ContainerMetadata) Reset() { *m = ContainerMetadata{} } func (*ContainerMetadata) ProtoMessage() {} func (*ContainerMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{41} + return fileDescriptor_00212fb1f9d3bf1c, []int{43} } func (m *ContainerMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3180,7 +3315,7 @@ type Device struct { func (m *Device) Reset() { *m = Device{} } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{42} + return fileDescriptor_00212fb1f9d3bf1c, []int{44} } func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3299,7 +3434,7 @@ type ContainerConfig struct { func (m *ContainerConfig) Reset() { *m = ContainerConfig{} } func (*ContainerConfig) ProtoMessage() {} func (*ContainerConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{43} + return fileDescriptor_00212fb1f9d3bf1c, []int{45} } func (m *ContainerConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3457,7 +3592,7 @@ type CreateContainerRequest struct { func (m *CreateContainerRequest) Reset() { *m = CreateContainerRequest{} } func (*CreateContainerRequest) ProtoMessage() {} func (*CreateContainerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{44} + return fileDescriptor_00212fb1f9d3bf1c, []int{46} } func (m *CreateContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3517,7 +3652,7 @@ type CreateContainerResponse struct { func (m *CreateContainerResponse) Reset() { *m = CreateContainerResponse{} } func (*CreateContainerResponse) ProtoMessage() {} func (*CreateContainerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{45} + return fileDescriptor_00212fb1f9d3bf1c, []int{47} } func (m *CreateContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3563,7 +3698,7 @@ type StartContainerRequest struct { func (m *StartContainerRequest) Reset() { *m = StartContainerRequest{} } func (*StartContainerRequest) ProtoMessage() {} func (*StartContainerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{46} + return fileDescriptor_00212fb1f9d3bf1c, []int{48} } func (m *StartContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3607,7 +3742,7 @@ type StartContainerResponse struct { func (m *StartContainerResponse) Reset() { *m = StartContainerResponse{} } func (*StartContainerResponse) ProtoMessage() {} func (*StartContainerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{47} + return fileDescriptor_00212fb1f9d3bf1c, []int{49} } func (m *StartContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3649,7 +3784,7 @@ type StopContainerRequest struct { func (m *StopContainerRequest) Reset() { *m = StopContainerRequest{} } func (*StopContainerRequest) ProtoMessage() {} func (*StopContainerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{48} + return fileDescriptor_00212fb1f9d3bf1c, []int{50} } func (m *StopContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3700,7 +3835,7 @@ type StopContainerResponse struct { func (m *StopContainerResponse) Reset() { *m = StopContainerResponse{} } func (*StopContainerResponse) ProtoMessage() {} func (*StopContainerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{49} + return fileDescriptor_00212fb1f9d3bf1c, []int{51} } func (m *StopContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3739,7 +3874,7 @@ type RemoveContainerRequest struct { func (m *RemoveContainerRequest) Reset() { *m = RemoveContainerRequest{} } func (*RemoveContainerRequest) ProtoMessage() {} func (*RemoveContainerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{50} + return fileDescriptor_00212fb1f9d3bf1c, []int{52} } func (m *RemoveContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3783,7 +3918,7 @@ type RemoveContainerResponse struct { func (m *RemoveContainerResponse) Reset() { *m = RemoveContainerResponse{} } func (*RemoveContainerResponse) ProtoMessage() {} func (*RemoveContainerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{51} + return fileDescriptor_00212fb1f9d3bf1c, []int{53} } func (m *RemoveContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3823,7 +3958,7 @@ type ContainerStateValue struct { func (m *ContainerStateValue) Reset() { *m = ContainerStateValue{} } func (*ContainerStateValue) ProtoMessage() {} func (*ContainerStateValue) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{52} + return fileDescriptor_00212fb1f9d3bf1c, []int{54} } func (m *ContainerStateValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3879,7 +4014,7 @@ type ContainerFilter struct { func (m *ContainerFilter) Reset() { *m = ContainerFilter{} } func (*ContainerFilter) ProtoMessage() {} func (*ContainerFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{53} + return fileDescriptor_00212fb1f9d3bf1c, []int{55} } func (m *ContainerFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3945,7 +4080,7 @@ type ListContainersRequest struct { func (m *ListContainersRequest) Reset() { *m = ListContainersRequest{} } func (*ListContainersRequest) ProtoMessage() {} func (*ListContainersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{54} + return fileDescriptor_00212fb1f9d3bf1c, []int{56} } func (m *ListContainersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4014,7 +4149,7 @@ type Container struct { func (m *Container) Reset() { *m = Container{} } func (*Container) ProtoMessage() {} func (*Container) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{55} + return fileDescriptor_00212fb1f9d3bf1c, []int{57} } func (m *Container) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4116,7 +4251,7 @@ type ListContainersResponse struct { func (m *ListContainersResponse) Reset() { *m = ListContainersResponse{} } func (*ListContainersResponse) ProtoMessage() {} func (*ListContainersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{56} + return fileDescriptor_00212fb1f9d3bf1c, []int{58} } func (m *ListContainersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4164,7 +4299,7 @@ type ContainerStatusRequest struct { func (m *ContainerStatusRequest) Reset() { *m = ContainerStatusRequest{} } func (*ContainerStatusRequest) ProtoMessage() {} func (*ContainerStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{57} + return fileDescriptor_00212fb1f9d3bf1c, []int{59} } func (m *ContainerStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4251,7 +4386,7 @@ type ContainerStatus struct { func (m *ContainerStatus) Reset() { *m = ContainerStatus{} } func (*ContainerStatus) ProtoMessage() {} func (*ContainerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{58} + return fileDescriptor_00212fb1f9d3bf1c, []int{60} } func (m *ContainerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4400,7 +4535,7 @@ type ContainerStatusResponse struct { func (m *ContainerStatusResponse) Reset() { *m = ContainerStatusResponse{} } func (*ContainerStatusResponse) ProtoMessage() {} func (*ContainerStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{59} + return fileDescriptor_00212fb1f9d3bf1c, []int{61} } func (m *ContainerStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4461,7 +4596,7 @@ type UpdateContainerResourcesRequest struct { func (m *UpdateContainerResourcesRequest) Reset() { *m = UpdateContainerResourcesRequest{} } func (*UpdateContainerResourcesRequest) ProtoMessage() {} func (*UpdateContainerResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{60} + return fileDescriptor_00212fb1f9d3bf1c, []int{62} } func (m *UpdateContainerResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4526,7 +4661,7 @@ type UpdateContainerResourcesResponse struct { func (m *UpdateContainerResourcesResponse) Reset() { *m = UpdateContainerResourcesResponse{} } func (*UpdateContainerResourcesResponse) ProtoMessage() {} func (*UpdateContainerResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{61} + return fileDescriptor_00212fb1f9d3bf1c, []int{63} } func (m *UpdateContainerResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4569,7 +4704,7 @@ type ExecSyncRequest struct { func (m *ExecSyncRequest) Reset() { *m = ExecSyncRequest{} } func (*ExecSyncRequest) ProtoMessage() {} func (*ExecSyncRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{62} + return fileDescriptor_00212fb1f9d3bf1c, []int{64} } func (m *ExecSyncRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4633,7 +4768,7 @@ type ExecSyncResponse struct { func (m *ExecSyncResponse) Reset() { *m = ExecSyncResponse{} } func (*ExecSyncResponse) ProtoMessage() {} func (*ExecSyncResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{63} + return fileDescriptor_00212fb1f9d3bf1c, []int{65} } func (m *ExecSyncResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4709,7 +4844,7 @@ type ExecRequest struct { func (m *ExecRequest) Reset() { *m = ExecRequest{} } func (*ExecRequest) ProtoMessage() {} func (*ExecRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{64} + return fileDescriptor_00212fb1f9d3bf1c, []int{66} } func (m *ExecRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4790,7 +4925,7 @@ type ExecResponse struct { func (m *ExecResponse) Reset() { *m = ExecResponse{} } func (*ExecResponse) ProtoMessage() {} func (*ExecResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{65} + return fileDescriptor_00212fb1f9d3bf1c, []int{67} } func (m *ExecResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4851,7 +4986,7 @@ type AttachRequest struct { func (m *AttachRequest) Reset() { *m = AttachRequest{} } func (*AttachRequest) ProtoMessage() {} func (*AttachRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{66} + return fileDescriptor_00212fb1f9d3bf1c, []int{68} } func (m *AttachRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4925,7 +5060,7 @@ type AttachResponse struct { func (m *AttachResponse) Reset() { *m = AttachResponse{} } func (*AttachResponse) ProtoMessage() {} func (*AttachResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{67} + return fileDescriptor_00212fb1f9d3bf1c, []int{69} } func (m *AttachResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4973,7 +5108,7 @@ type PortForwardRequest struct { func (m *PortForwardRequest) Reset() { *m = PortForwardRequest{} } func (*PortForwardRequest) ProtoMessage() {} func (*PortForwardRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{68} + return fileDescriptor_00212fb1f9d3bf1c, []int{70} } func (m *PortForwardRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5026,7 +5161,7 @@ type PortForwardResponse struct { func (m *PortForwardResponse) Reset() { *m = PortForwardResponse{} } func (*PortForwardResponse) ProtoMessage() {} func (*PortForwardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{69} + return fileDescriptor_00212fb1f9d3bf1c, []int{71} } func (m *PortForwardResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5072,7 +5207,7 @@ type ImageFilter struct { func (m *ImageFilter) Reset() { *m = ImageFilter{} } func (*ImageFilter) ProtoMessage() {} func (*ImageFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{70} + return fileDescriptor_00212fb1f9d3bf1c, []int{72} } func (m *ImageFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5118,7 +5253,7 @@ type ListImagesRequest struct { func (m *ListImagesRequest) Reset() { *m = ListImagesRequest{} } func (*ListImagesRequest) ProtoMessage() {} func (*ListImagesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{71} + return fileDescriptor_00212fb1f9d3bf1c, []int{73} } func (m *ListImagesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5180,7 +5315,7 @@ type Image struct { func (m *Image) Reset() { *m = Image{} } func (*Image) ProtoMessage() {} func (*Image) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{72} + return fileDescriptor_00212fb1f9d3bf1c, []int{74} } func (m *Image) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5268,7 +5403,7 @@ type ListImagesResponse struct { func (m *ListImagesResponse) Reset() { *m = ListImagesResponse{} } func (*ListImagesResponse) ProtoMessage() {} func (*ListImagesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{73} + return fileDescriptor_00212fb1f9d3bf1c, []int{75} } func (m *ListImagesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5316,7 +5451,7 @@ type ImageStatusRequest struct { func (m *ImageStatusRequest) Reset() { *m = ImageStatusRequest{} } func (*ImageStatusRequest) ProtoMessage() {} func (*ImageStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{74} + return fileDescriptor_00212fb1f9d3bf1c, []int{76} } func (m *ImageStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5374,7 +5509,7 @@ type ImageStatusResponse struct { func (m *ImageStatusResponse) Reset() { *m = ImageStatusResponse{} } func (*ImageStatusResponse) ProtoMessage() {} func (*ImageStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{75} + return fileDescriptor_00212fb1f9d3bf1c, []int{77} } func (m *ImageStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5435,7 +5570,7 @@ type AuthConfig struct { func (m *AuthConfig) Reset() { *m = AuthConfig{} } func (*AuthConfig) ProtoMessage() {} func (*AuthConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{76} + return fileDescriptor_00212fb1f9d3bf1c, []int{78} } func (m *AuthConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5520,7 +5655,7 @@ type PullImageRequest struct { func (m *PullImageRequest) Reset() { *m = PullImageRequest{} } func (*PullImageRequest) ProtoMessage() {} func (*PullImageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{77} + return fileDescriptor_00212fb1f9d3bf1c, []int{79} } func (m *PullImageRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5581,7 +5716,7 @@ type PullImageResponse struct { func (m *PullImageResponse) Reset() { *m = PullImageResponse{} } func (*PullImageResponse) ProtoMessage() {} func (*PullImageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{78} + return fileDescriptor_00212fb1f9d3bf1c, []int{80} } func (m *PullImageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5627,7 +5762,7 @@ type RemoveImageRequest struct { func (m *RemoveImageRequest) Reset() { *m = RemoveImageRequest{} } func (*RemoveImageRequest) ProtoMessage() {} func (*RemoveImageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{79} + return fileDescriptor_00212fb1f9d3bf1c, []int{81} } func (m *RemoveImageRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5671,7 +5806,7 @@ type RemoveImageResponse struct { func (m *RemoveImageResponse) Reset() { *m = RemoveImageResponse{} } func (*RemoveImageResponse) ProtoMessage() {} func (*RemoveImageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{80} + return fileDescriptor_00212fb1f9d3bf1c, []int{82} } func (m *RemoveImageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5711,7 +5846,7 @@ type NetworkConfig struct { func (m *NetworkConfig) Reset() { *m = NetworkConfig{} } func (*NetworkConfig) ProtoMessage() {} func (*NetworkConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{81} + return fileDescriptor_00212fb1f9d3bf1c, []int{83} } func (m *NetworkConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5756,7 +5891,7 @@ type RuntimeConfig struct { func (m *RuntimeConfig) Reset() { *m = RuntimeConfig{} } func (*RuntimeConfig) ProtoMessage() {} func (*RuntimeConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{82} + return fileDescriptor_00212fb1f9d3bf1c, []int{84} } func (m *RuntimeConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5801,7 +5936,7 @@ type UpdateRuntimeConfigRequest struct { func (m *UpdateRuntimeConfigRequest) Reset() { *m = UpdateRuntimeConfigRequest{} } func (*UpdateRuntimeConfigRequest) ProtoMessage() {} func (*UpdateRuntimeConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{83} + return fileDescriptor_00212fb1f9d3bf1c, []int{85} } func (m *UpdateRuntimeConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5845,7 +5980,7 @@ type UpdateRuntimeConfigResponse struct { func (m *UpdateRuntimeConfigResponse) Reset() { *m = UpdateRuntimeConfigResponse{} } func (*UpdateRuntimeConfigResponse) ProtoMessage() {} func (*UpdateRuntimeConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{84} + return fileDescriptor_00212fb1f9d3bf1c, []int{86} } func (m *UpdateRuntimeConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5903,7 +6038,7 @@ type RuntimeCondition struct { func (m *RuntimeCondition) Reset() { *m = RuntimeCondition{} } func (*RuntimeCondition) ProtoMessage() {} func (*RuntimeCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{85} + return fileDescriptor_00212fb1f9d3bf1c, []int{87} } func (m *RuntimeCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5971,7 +6106,7 @@ type RuntimeStatus struct { func (m *RuntimeStatus) Reset() { *m = RuntimeStatus{} } func (*RuntimeStatus) ProtoMessage() {} func (*RuntimeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{86} + return fileDescriptor_00212fb1f9d3bf1c, []int{88} } func (m *RuntimeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6017,7 +6152,7 @@ type StatusRequest struct { func (m *StatusRequest) Reset() { *m = StatusRequest{} } func (*StatusRequest) ProtoMessage() {} func (*StatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{87} + return fileDescriptor_00212fb1f9d3bf1c, []int{89} } func (m *StatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6068,7 +6203,7 @@ type StatusResponse struct { func (m *StatusResponse) Reset() { *m = StatusResponse{} } func (*StatusResponse) ProtoMessage() {} func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{88} + return fileDescriptor_00212fb1f9d3bf1c, []int{90} } func (m *StatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6119,7 +6254,7 @@ type ImageFsInfoRequest struct { func (m *ImageFsInfoRequest) Reset() { *m = ImageFsInfoRequest{} } func (*ImageFsInfoRequest) ProtoMessage() {} func (*ImageFsInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{89} + return fileDescriptor_00212fb1f9d3bf1c, []int{91} } func (m *ImageFsInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6159,7 +6294,7 @@ type UInt64Value struct { func (m *UInt64Value) Reset() { *m = UInt64Value{} } func (*UInt64Value) ProtoMessage() {} func (*UInt64Value) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{90} + return fileDescriptor_00212fb1f9d3bf1c, []int{92} } func (m *UInt64Value) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6206,7 +6341,7 @@ type FilesystemIdentifier struct { func (m *FilesystemIdentifier) Reset() { *m = FilesystemIdentifier{} } func (*FilesystemIdentifier) ProtoMessage() {} func (*FilesystemIdentifier) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{91} + return fileDescriptor_00212fb1f9d3bf1c, []int{93} } func (m *FilesystemIdentifier) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6263,7 +6398,7 @@ type FilesystemUsage struct { func (m *FilesystemUsage) Reset() { *m = FilesystemUsage{} } func (*FilesystemUsage) ProtoMessage() {} func (*FilesystemUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{92} + return fileDescriptor_00212fb1f9d3bf1c, []int{94} } func (m *FilesystemUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6330,7 +6465,7 @@ type ImageFsInfoResponse struct { func (m *ImageFsInfoResponse) Reset() { *m = ImageFsInfoResponse{} } func (*ImageFsInfoResponse) ProtoMessage() {} func (*ImageFsInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{93} + return fileDescriptor_00212fb1f9d3bf1c, []int{95} } func (m *ImageFsInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6376,7 +6511,7 @@ type ContainerStatsRequest struct { func (m *ContainerStatsRequest) Reset() { *m = ContainerStatsRequest{} } func (*ContainerStatsRequest) ProtoMessage() {} func (*ContainerStatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{94} + return fileDescriptor_00212fb1f9d3bf1c, []int{96} } func (m *ContainerStatsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6422,7 +6557,7 @@ type ContainerStatsResponse struct { func (m *ContainerStatsResponse) Reset() { *m = ContainerStatsResponse{} } func (*ContainerStatsResponse) ProtoMessage() {} func (*ContainerStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{95} + return fileDescriptor_00212fb1f9d3bf1c, []int{97} } func (m *ContainerStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6468,7 +6603,7 @@ type ListContainerStatsRequest struct { func (m *ListContainerStatsRequest) Reset() { *m = ListContainerStatsRequest{} } func (*ListContainerStatsRequest) ProtoMessage() {} func (*ListContainerStatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{96} + return fileDescriptor_00212fb1f9d3bf1c, []int{98} } func (m *ListContainerStatsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6522,7 +6657,7 @@ type ContainerStatsFilter struct { func (m *ContainerStatsFilter) Reset() { *m = ContainerStatsFilter{} } func (*ContainerStatsFilter) ProtoMessage() {} func (*ContainerStatsFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{97} + return fileDescriptor_00212fb1f9d3bf1c, []int{99} } func (m *ContainerStatsFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6582,7 +6717,7 @@ type ListContainerStatsResponse struct { func (m *ListContainerStatsResponse) Reset() { *m = ListContainerStatsResponse{} } func (*ListContainerStatsResponse) ProtoMessage() {} func (*ListContainerStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{98} + return fileDescriptor_00212fb1f9d3bf1c, []int{100} } func (m *ListContainerStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6638,7 +6773,7 @@ type ContainerAttributes struct { func (m *ContainerAttributes) Reset() { *m = ContainerAttributes{} } func (*ContainerAttributes) ProtoMessage() {} func (*ContainerAttributes) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{99} + return fileDescriptor_00212fb1f9d3bf1c, []int{101} } func (m *ContainerAttributes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6712,7 +6847,7 @@ type ContainerStats struct { func (m *ContainerStats) Reset() { *m = ContainerStats{} } func (*ContainerStats) ProtoMessage() {} func (*ContainerStats) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{100} + return fileDescriptor_00212fb1f9d3bf1c, []int{102} } func (m *ContainerStats) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6782,7 +6917,7 @@ type CpuUsage struct { func (m *CpuUsage) Reset() { *m = CpuUsage{} } func (*CpuUsage) ProtoMessage() {} func (*CpuUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{101} + return fileDescriptor_00212fb1f9d3bf1c, []int{103} } func (m *CpuUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6838,7 +6973,7 @@ type MemoryUsage struct { func (m *MemoryUsage) Reset() { *m = MemoryUsage{} } func (*MemoryUsage) ProtoMessage() {} func (*MemoryUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{102} + return fileDescriptor_00212fb1f9d3bf1c, []int{104} } func (m *MemoryUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6891,7 +7026,7 @@ type ReopenContainerLogRequest struct { func (m *ReopenContainerLogRequest) Reset() { *m = ReopenContainerLogRequest{} } func (*ReopenContainerLogRequest) ProtoMessage() {} func (*ReopenContainerLogRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{103} + return fileDescriptor_00212fb1f9d3bf1c, []int{105} } func (m *ReopenContainerLogRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6935,7 +7070,7 @@ type ReopenContainerLogResponse struct { func (m *ReopenContainerLogResponse) Reset() { *m = ReopenContainerLogResponse{} } func (*ReopenContainerLogResponse) ProtoMessage() {} func (*ReopenContainerLogResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{104} + return fileDescriptor_00212fb1f9d3bf1c, []int{106} } func (m *ReopenContainerLogResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -7019,6 +7154,8 @@ func init() { proto.RegisterType((*Capability)(nil), "runtime.v1alpha2.Capability") proto.RegisterType((*LinuxContainerSecurityContext)(nil), "runtime.v1alpha2.LinuxContainerSecurityContext") proto.RegisterType((*LinuxContainerConfig)(nil), "runtime.v1alpha2.LinuxContainerConfig") + proto.RegisterType((*WindowsSandboxSecurityContext)(nil), "runtime.v1alpha2.WindowsSandboxSecurityContext") + proto.RegisterType((*WindowsPodSandboxConfig)(nil), "runtime.v1alpha2.WindowsPodSandboxConfig") proto.RegisterType((*WindowsContainerSecurityContext)(nil), "runtime.v1alpha2.WindowsContainerSecurityContext") proto.RegisterType((*WindowsContainerConfig)(nil), "runtime.v1alpha2.WindowsContainerConfig") proto.RegisterType((*WindowsContainerResources)(nil), "runtime.v1alpha2.WindowsContainerResources") @@ -7105,322 +7242,326 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 5033 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x7c, 0x4d, 0x6c, 0x1b, 0x49, - 0x76, 0xbf, 0x9a, 0xa4, 0x24, 0xf2, 0x51, 0xa4, 0xa8, 0xb2, 0x6c, 0xd1, 0xf4, 0xd8, 0x63, 0xb7, - 0xc7, 0x9f, 0x33, 0x96, 0xd7, 0x9a, 0x59, 0xcf, 0xdf, 0xf6, 0x8c, 0x6d, 0x5a, 0x92, 0x6d, 0xfe, - 0xd7, 0xa6, 0x98, 0xa6, 0x34, 0x1f, 0x3b, 0x03, 0xf4, 0xb6, 0xd8, 0x25, 0xaa, 0xd7, 0x64, 0x77, - 0x4f, 0x77, 0xd3, 0xb6, 0x36, 0x40, 0xb0, 0xc0, 0x02, 0x7b, 0xc8, 0x29, 0xe7, 0x1c, 0x37, 0x87, - 0x1c, 0x72, 0xca, 0x21, 0xa7, 0x9c, 0x36, 0xc8, 0x61, 0x11, 0x20, 0x48, 0x4e, 0x9b, 0x04, 0xb9, - 0x64, 0x26, 0x08, 0xb0, 0x08, 0x90, 0x20, 0xc8, 0x39, 0x87, 0xa0, 0xbe, 0xfa, 0xbb, 0xf9, 0x61, - 0x7b, 0x76, 0x36, 0x27, 0xb1, 0x5e, 0xbf, 0xf7, 0xea, 0xf5, 0xab, 0x57, 0xaf, 0x5e, 0xfd, 0xaa, - 0x5a, 0x50, 0xd2, 0x6c, 0x63, 0xdd, 0x76, 0x2c, 0xcf, 0x42, 0x35, 0x67, 0x64, 0x7a, 0xc6, 0x10, - 0xaf, 0x3f, 0xbf, 0xa1, 0x0d, 0xec, 0x43, 0x6d, 0xa3, 0x71, 0xad, 0x6f, 0x78, 0x87, 0xa3, 0xfd, - 0xf5, 0x9e, 0x35, 0xbc, 0xde, 0xb7, 0xfa, 0xd6, 0x75, 0xca, 0xb8, 0x3f, 0x3a, 0xa0, 0x2d, 0xda, - 0xa0, 0xbf, 0x98, 0x02, 0xf9, 0x2a, 0x54, 0x3f, 0xc1, 0x8e, 0x6b, 0x58, 0xa6, 0x82, 0xbf, 0x1a, - 0x61, 0xd7, 0x43, 0x75, 0x58, 0x7c, 0xce, 0x28, 0x75, 0xe9, 0xac, 0x74, 0xb9, 0xa4, 0x88, 0xa6, - 0xfc, 0xa7, 0x12, 0x2c, 0xfb, 0xcc, 0xae, 0x6d, 0x99, 0x2e, 0xce, 0xe6, 0x46, 0xe7, 0x60, 0x89, - 0x1b, 0xa7, 0x9a, 0xda, 0x10, 0xd7, 0x73, 0xf4, 0x71, 0x99, 0xd3, 0xda, 0xda, 0x10, 0xa3, 0x4b, - 0xb0, 0x2c, 0x58, 0x84, 0x92, 0x3c, 0xe5, 0xaa, 0x72, 0x32, 0xef, 0x0d, 0xad, 0xc3, 0x31, 0xc1, - 0xa8, 0xd9, 0x86, 0xcf, 0x5c, 0xa0, 0xcc, 0x2b, 0xfc, 0x51, 0xd3, 0x36, 0x38, 0xbf, 0xfc, 0x05, - 0x94, 0xb6, 0xda, 0xdd, 0x4d, 0xcb, 0x3c, 0x30, 0xfa, 0xc4, 0x44, 0x17, 0x3b, 0x44, 0xa6, 0x2e, - 0x9d, 0xcd, 0x13, 0x13, 0x79, 0x13, 0x35, 0xa0, 0xe8, 0x62, 0xcd, 0xe9, 0x1d, 0x62, 0xb7, 0x9e, - 0xa3, 0x8f, 0xfc, 0x36, 0x91, 0xb2, 0x6c, 0xcf, 0xb0, 0x4c, 0xb7, 0x9e, 0x67, 0x52, 0xbc, 0x29, - 0xff, 0x42, 0x82, 0x72, 0xc7, 0x72, 0xbc, 0xa7, 0x9a, 0x6d, 0x1b, 0x66, 0x1f, 0xdd, 0x84, 0x22, - 0xf5, 0x65, 0xcf, 0x1a, 0x50, 0x1f, 0x54, 0x37, 0x1a, 0xeb, 0xf1, 0x61, 0x59, 0xef, 0x70, 0x0e, - 0xc5, 0xe7, 0x45, 0x17, 0xa0, 0xda, 0xb3, 0x4c, 0x4f, 0x33, 0x4c, 0xec, 0xa8, 0xb6, 0xe5, 0x78, - 0xd4, 0x45, 0xf3, 0x4a, 0xc5, 0xa7, 0x92, 0x5e, 0xd0, 0x29, 0x28, 0x1d, 0x5a, 0xae, 0xc7, 0x38, - 0xf2, 0x94, 0xa3, 0x48, 0x08, 0xf4, 0xe1, 0x1a, 0x2c, 0xd2, 0x87, 0x86, 0xcd, 0x9d, 0xb1, 0x40, - 0x9a, 0x2d, 0x5b, 0xfe, 0xb5, 0x04, 0xf3, 0x4f, 0xad, 0x91, 0xe9, 0xc5, 0xba, 0xd1, 0xbc, 0x43, - 0x3e, 0x50, 0xa1, 0x6e, 0x34, 0xef, 0x30, 0xe8, 0x86, 0x70, 0xb0, 0xb1, 0x62, 0xdd, 0x90, 0x87, - 0x0d, 0x28, 0x3a, 0x58, 0xd3, 0x2d, 0x73, 0x70, 0x44, 0x4d, 0x28, 0x2a, 0x7e, 0x9b, 0x0c, 0xa2, - 0x8b, 0x07, 0x86, 0x39, 0x7a, 0xa9, 0x3a, 0x78, 0xa0, 0xed, 0xe3, 0x01, 0x35, 0xa5, 0xa8, 0x54, - 0x39, 0x59, 0x61, 0x54, 0xb4, 0x05, 0x65, 0xdb, 0xb1, 0x6c, 0xad, 0xaf, 0x11, 0x3f, 0xd6, 0xe7, - 0xa9, 0xab, 0xe4, 0xa4, 0xab, 0xa8, 0xd9, 0x9d, 0x80, 0x53, 0x09, 0x8b, 0xc9, 0x7f, 0x27, 0xc1, - 0x32, 0x09, 0x1e, 0xd7, 0xd6, 0x7a, 0x78, 0x87, 0x0e, 0x09, 0xba, 0x05, 0x8b, 0x26, 0xf6, 0x5e, - 0x58, 0xce, 0x33, 0x3e, 0x00, 0x6f, 0x27, 0xb5, 0xfa, 0x32, 0x4f, 0x2d, 0x1d, 0x2b, 0x82, 0x1f, - 0xdd, 0x80, 0xbc, 0x6d, 0xe8, 0xf4, 0x85, 0xa7, 0x10, 0x23, 0xbc, 0x44, 0xc4, 0xb0, 0x7b, 0xd4, - 0x0f, 0xd3, 0x88, 0x18, 0x76, 0x8f, 0x38, 0xd7, 0xd3, 0x9c, 0x3e, 0xf6, 0x54, 0x43, 0xe7, 0x03, - 0x55, 0x64, 0x84, 0x96, 0x2e, 0xcb, 0x00, 0x2d, 0xd3, 0xbb, 0xf9, 0xc1, 0x27, 0xda, 0x60, 0x84, - 0xd1, 0x2a, 0xcc, 0x3f, 0x27, 0x3f, 0xe8, 0x9b, 0xe4, 0x15, 0xd6, 0x90, 0xbf, 0x2e, 0xc0, 0xa9, - 0x27, 0xc4, 0x99, 0x5d, 0xcd, 0xd4, 0xf7, 0xad, 0x97, 0x5d, 0xdc, 0x1b, 0x39, 0x86, 0x77, 0xb4, - 0x69, 0x99, 0x1e, 0x7e, 0xe9, 0xa1, 0x36, 0xac, 0x98, 0xa2, 0x5b, 0x55, 0xc4, 0x2d, 0xd1, 0x50, - 0xde, 0x38, 0x37, 0xc6, 0x42, 0xe6, 0x3f, 0xa5, 0x66, 0x46, 0x09, 0x2e, 0x7a, 0x1c, 0x0c, 0xaa, - 0xd0, 0x96, 0xa3, 0xda, 0x52, 0xde, 0xb7, 0xbb, 0x4d, 0x2d, 0xe3, 0xba, 0xc4, 0xa8, 0x0b, 0x4d, - 0x1f, 0x01, 0x99, 0xf2, 0xaa, 0xe6, 0xaa, 0x23, 0x17, 0x3b, 0xd4, 0x6b, 0xe5, 0x8d, 0xb7, 0x92, - 0x5a, 0x02, 0x17, 0x28, 0x25, 0x67, 0x64, 0x36, 0xdd, 0x3d, 0x17, 0x3b, 0xe8, 0x2e, 0x4d, 0x22, - 0x44, 0xba, 0xef, 0x58, 0x23, 0xbb, 0x5e, 0x9c, 0x42, 0x1c, 0xa8, 0xf8, 0x23, 0xc2, 0x4f, 0x33, - 0x0c, 0x0f, 0x54, 0xd5, 0xb1, 0x2c, 0xef, 0xc0, 0x15, 0xc1, 0x29, 0xc8, 0x0a, 0xa5, 0xa2, 0xeb, - 0x70, 0xcc, 0x1d, 0xd9, 0xf6, 0x00, 0x0f, 0xb1, 0xe9, 0x69, 0x03, 0xd6, 0x9d, 0x5b, 0x9f, 0x3f, - 0x9b, 0xbf, 0x9c, 0x57, 0x50, 0xf8, 0x11, 0x55, 0xec, 0xa2, 0x33, 0x00, 0xb6, 0x63, 0x3c, 0x37, - 0x06, 0xb8, 0x8f, 0xf5, 0xfa, 0x02, 0x55, 0x1a, 0xa2, 0xa0, 0x3b, 0x24, 0xeb, 0xf4, 0x7a, 0xd6, - 0xd0, 0xae, 0x97, 0xb2, 0xc6, 0x41, 0x8c, 0x62, 0xc7, 0xb1, 0x0e, 0x8c, 0x01, 0x56, 0x84, 0x04, - 0xfa, 0x18, 0x8a, 0x9a, 0x6d, 0x6b, 0xce, 0xd0, 0x72, 0xea, 0x30, 0xad, 0xb4, 0x2f, 0x82, 0x3e, - 0x80, 0x55, 0xae, 0x49, 0xb5, 0xd9, 0x43, 0x36, 0xad, 0x17, 0x49, 0xe4, 0x3d, 0xc8, 0xd5, 0x25, - 0x05, 0xf1, 0xe7, 0x5c, 0x96, 0x4c, 0x72, 0xf9, 0x6f, 0x24, 0x58, 0x8e, 0xe9, 0x44, 0x1d, 0x58, - 0x12, 0x1a, 0xbc, 0x23, 0x1b, 0xf3, 0xe9, 0x75, 0x6d, 0xa2, 0x31, 0xeb, 0xfc, 0xef, 0xee, 0x91, - 0x8d, 0xe9, 0xfc, 0x15, 0x0d, 0x74, 0x1e, 0x2a, 0x03, 0xab, 0xa7, 0x0d, 0x68, 0xb2, 0x71, 0xf0, - 0x01, 0xcf, 0x35, 0x4b, 0x3e, 0x51, 0xc1, 0x07, 0xf2, 0x7d, 0x28, 0x87, 0x14, 0x20, 0x04, 0x55, - 0x85, 0x75, 0xb8, 0x85, 0x0f, 0xb4, 0xd1, 0xc0, 0xab, 0xcd, 0xa1, 0x2a, 0xc0, 0x9e, 0xd9, 0x23, - 0x19, 0xde, 0xc4, 0x7a, 0x4d, 0x42, 0x15, 0x28, 0x3d, 0x11, 0x2a, 0x6a, 0x39, 0xf9, 0x17, 0x39, - 0x38, 0x4e, 0xc3, 0xb2, 0x63, 0xe9, 0x7c, 0xce, 0xf0, 0xe5, 0xe0, 0x3c, 0x54, 0x7a, 0x74, 0x74, - 0x55, 0x5b, 0x73, 0xb0, 0xe9, 0xf1, 0x74, 0xb8, 0xc4, 0x88, 0x1d, 0x4a, 0x43, 0x9f, 0x41, 0xcd, - 0xe5, 0x6f, 0xa4, 0xf6, 0xd8, 0x1c, 0xe3, 0x13, 0x20, 0xe5, 0xdd, 0xc7, 0x4c, 0x4c, 0x65, 0xd9, - 0x4d, 0xcc, 0xd4, 0x45, 0xf7, 0xc8, 0xed, 0x79, 0x03, 0xb6, 0xae, 0x94, 0x37, 0x3e, 0xc8, 0x50, - 0x18, 0x37, 0x7c, 0xbd, 0xcb, 0xc4, 0xb6, 0x4d, 0xcf, 0x39, 0x52, 0x84, 0x92, 0xc6, 0x6d, 0x58, - 0x0a, 0x3f, 0x40, 0x35, 0xc8, 0x3f, 0xc3, 0x47, 0xfc, 0xa5, 0xc8, 0xcf, 0x20, 0xa3, 0x30, 0x4f, - 0xb3, 0xc6, 0xed, 0xdc, 0xff, 0x93, 0x64, 0x07, 0x50, 0xd0, 0xcb, 0x53, 0xec, 0x69, 0xba, 0xe6, - 0x69, 0x08, 0x41, 0x81, 0x2e, 0xd8, 0x4c, 0x05, 0xfd, 0x4d, 0xb4, 0x8e, 0x78, 0x9a, 0x2c, 0x29, - 0xe4, 0x27, 0x7a, 0x0b, 0x4a, 0x7e, 0xd6, 0xe0, 0xab, 0x76, 0x40, 0x20, 0xab, 0xa7, 0xe6, 0x79, - 0x78, 0x68, 0x7b, 0x74, 0xbe, 0x55, 0x14, 0xd1, 0x94, 0xff, 0xb3, 0x00, 0xb5, 0xc4, 0x98, 0xdc, - 0x87, 0xe2, 0x90, 0x77, 0xcf, 0xb3, 0xd6, 0x3b, 0x29, 0x4b, 0x68, 0xc2, 0x54, 0xc5, 0x97, 0x22, - 0x2b, 0x14, 0x19, 0xf9, 0x50, 0xa5, 0xe1, 0xb7, 0x59, 0xc8, 0xf5, 0x55, 0xdd, 0x70, 0x70, 0xcf, - 0xb3, 0x9c, 0x23, 0x6e, 0xee, 0xd2, 0xc0, 0xea, 0x6f, 0x09, 0x1a, 0xba, 0x0d, 0xa0, 0x9b, 0xae, - 0x4a, 0x23, 0xaa, 0x4f, 0x8d, 0x2e, 0x6f, 0x9c, 0x4a, 0x1a, 0xe1, 0x97, 0x15, 0x4a, 0x49, 0x37, - 0x5d, 0x6e, 0xfe, 0x03, 0xa8, 0x90, 0xd5, 0x59, 0x1d, 0xb2, 0x8a, 0x80, 0xa5, 0x8d, 0xf2, 0xc6, - 0xe9, 0xb4, 0x77, 0xf0, 0xeb, 0x06, 0x65, 0xc9, 0x0e, 0x1a, 0x2e, 0x7a, 0x08, 0x0b, 0x74, 0x99, - 0x74, 0xeb, 0x0b, 0x54, 0x78, 0x7d, 0x9c, 0x03, 0x78, 0x44, 0x3c, 0xa1, 0x02, 0x2c, 0x20, 0xb8, - 0x34, 0xda, 0x83, 0xb2, 0x66, 0x9a, 0x96, 0xa7, 0xb1, 0xac, 0xbd, 0x48, 0x95, 0xbd, 0x3f, 0x85, - 0xb2, 0x66, 0x20, 0xc5, 0x34, 0x86, 0xf5, 0xa0, 0x8f, 0x61, 0x9e, 0xa6, 0x75, 0x9e, 0x81, 0x2f, - 0x4d, 0x19, 0xb4, 0x0a, 0x93, 0x6a, 0xdc, 0x82, 0x72, 0xc8, 0xd8, 0x59, 0x82, 0xb4, 0x71, 0x17, - 0x6a, 0x71, 0xd3, 0x66, 0x0a, 0xf2, 0xdf, 0x87, 0x55, 0x65, 0x64, 0x06, 0x86, 0x89, 0x3a, 0xf7, - 0x36, 0x2c, 0xf0, 0xc1, 0x66, 0x11, 0x27, 0x4f, 0xf6, 0x91, 0xc2, 0x25, 0xc2, 0x85, 0xeb, 0xa1, - 0x66, 0xea, 0x03, 0xec, 0xf0, 0x7e, 0x45, 0xe1, 0xfa, 0x98, 0x51, 0xe5, 0x8f, 0xe1, 0x78, 0xac, - 0x73, 0x5e, 0x37, 0xbf, 0x03, 0x55, 0xdb, 0xd2, 0x55, 0x97, 0x91, 0x49, 0x59, 0xc0, 0xd3, 0x90, - 0xed, 0xf3, 0xb6, 0x74, 0x22, 0xde, 0xf5, 0x2c, 0x3b, 0x69, 0xfc, 0x74, 0xe2, 0x75, 0x38, 0x11, - 0x17, 0x67, 0xdd, 0xcb, 0xf7, 0x60, 0x4d, 0xc1, 0x43, 0xeb, 0x39, 0x7e, 0x55, 0xd5, 0x0d, 0xa8, - 0x27, 0x15, 0x70, 0xe5, 0x9f, 0xc3, 0x5a, 0x40, 0xed, 0x7a, 0x9a, 0x37, 0x72, 0x67, 0x52, 0xce, - 0x37, 0x15, 0xfb, 0x96, 0xcb, 0x86, 0xb3, 0xa8, 0x88, 0xa6, 0xbc, 0x06, 0xf3, 0x1d, 0x4b, 0x6f, - 0x75, 0x50, 0x15, 0x72, 0x86, 0xcd, 0x85, 0x73, 0x86, 0x2d, 0x1b, 0xe1, 0x3e, 0xdb, 0xac, 0xb8, - 0x63, 0x5d, 0xc7, 0x59, 0xd1, 0x5d, 0xa8, 0x6a, 0xba, 0x6e, 0x90, 0x70, 0xd2, 0x06, 0xaa, 0x61, - 0xb3, 0xda, 0xbf, 0xbc, 0xb1, 0x96, 0x1a, 0x00, 0xad, 0x8e, 0x52, 0x09, 0xd8, 0x5b, 0xb6, 0x2b, - 0x3f, 0x86, 0x92, 0x5f, 0x40, 0x91, 0x65, 0x3e, 0x5a, 0x20, 0x4d, 0x51, 0x6e, 0xf9, 0x3b, 0x89, - 0xdd, 0xc4, 0x1a, 0xc5, 0x4d, 0xbe, 0x03, 0xe0, 0xe7, 0x52, 0x51, 0xc7, 0x9d, 0x1a, 0xa3, 0x58, - 0x09, 0xb1, 0xcb, 0x3f, 0x9b, 0x0f, 0x67, 0xd8, 0x90, 0x13, 0x74, 0xdf, 0x09, 0x7a, 0x24, 0xe3, - 0xe6, 0x5e, 0x29, 0xe3, 0x7e, 0x08, 0xf3, 0xae, 0xa7, 0x79, 0x98, 0x17, 0xc2, 0xe7, 0xc6, 0x89, - 0x13, 0x23, 0xb0, 0xc2, 0xf8, 0xd1, 0x69, 0x80, 0x9e, 0x83, 0x35, 0x0f, 0xeb, 0xaa, 0xc6, 0x96, - 0x87, 0xbc, 0x52, 0xe2, 0x94, 0xa6, 0x87, 0x36, 0x83, 0x62, 0x7e, 0x9e, 0x1a, 0x76, 0x65, 0x9c, - 0xe6, 0xc8, 0x50, 0x07, 0x65, 0xbd, 0x9f, 0xae, 0x16, 0xa6, 0x4c, 0x57, 0x5c, 0x01, 0x93, 0x0a, - 0x25, 0xe3, 0xc5, 0xc9, 0xc9, 0x98, 0x89, 0x4e, 0x93, 0x8c, 0x8b, 0x93, 0x93, 0x31, 0x57, 0x36, - 0x3e, 0x19, 0xa7, 0xa4, 0x9f, 0x52, 0x5a, 0xfa, 0xf9, 0x2e, 0xd3, 0xee, 0x3f, 0x49, 0x50, 0x4f, - 0x66, 0x01, 0x9e, 0xfd, 0x6e, 0xc3, 0x82, 0x4b, 0x29, 0xd3, 0xe4, 0x5e, 0x2e, 0xcb, 0x25, 0xd0, - 0x63, 0x28, 0x18, 0xe6, 0x81, 0xc5, 0x27, 0xed, 0x07, 0x53, 0x48, 0xf2, 0x5e, 0xd7, 0x5b, 0xe6, - 0x81, 0xc5, 0xbc, 0x49, 0x35, 0x34, 0x3e, 0x84, 0x92, 0x4f, 0x9a, 0xe9, 0xdd, 0x76, 0x60, 0x35, - 0x16, 0xdb, 0x6c, 0xef, 0xe6, 0x4f, 0x09, 0x69, 0xb6, 0x29, 0x21, 0xff, 0x34, 0x17, 0x9e, 0xb2, - 0x0f, 0x8d, 0x81, 0x87, 0x9d, 0xc4, 0x94, 0xfd, 0x48, 0x68, 0x67, 0xf3, 0xf5, 0xe2, 0x44, 0xed, - 0x6c, 0x3b, 0xc4, 0x67, 0xdd, 0x97, 0x50, 0xa5, 0x41, 0xa9, 0xba, 0x78, 0x40, 0x4b, 0x1e, 0x5e, - 0x7e, 0x7e, 0x7f, 0x9c, 0x1a, 0x66, 0x09, 0x0b, 0xed, 0x2e, 0x97, 0x63, 0x1e, 0xac, 0x0c, 0xc2, - 0xb4, 0xc6, 0x7d, 0x40, 0x49, 0xa6, 0x99, 0x7c, 0xda, 0x25, 0xb9, 0xd0, 0xf5, 0x52, 0xd7, 0xe9, - 0x03, 0x6a, 0xc6, 0x34, 0xb1, 0xc2, 0x0c, 0x56, 0xb8, 0x84, 0xfc, 0x1f, 0x79, 0x80, 0xe0, 0xe1, - 0xff, 0xa1, 0x24, 0x78, 0xdf, 0x4f, 0x40, 0xac, 0x94, 0xbc, 0x3c, 0x4e, 0x71, 0x6a, 0xea, 0xd9, - 0x89, 0xa6, 0x1e, 0x56, 0x54, 0x5e, 0x1b, 0xab, 0x66, 0xe6, 0xa4, 0xb3, 0xf8, 0xbb, 0x96, 0x74, - 0x9e, 0xc0, 0x89, 0x78, 0x10, 0xf1, 0x8c, 0xb3, 0x01, 0xf3, 0x86, 0x87, 0x87, 0x0c, 0x02, 0x4c, - 0x45, 0x10, 0x42, 0x42, 0x8c, 0x55, 0xfe, 0x73, 0x09, 0x4a, 0xad, 0xa1, 0xd6, 0xc7, 0x5d, 0x1b, - 0xf7, 0x48, 0xaf, 0x06, 0x69, 0x70, 0x4b, 0x58, 0x03, 0xb5, 0xa3, 0x6e, 0x66, 0x49, 0xe9, 0xbd, - 0x14, 0x7c, 0x42, 0xe8, 0x19, 0xef, 0xe5, 0xd7, 0xf6, 0xc0, 0x06, 0x14, 0x7f, 0x80, 0x8f, 0x58, - 0x3a, 0x9a, 0x52, 0x4e, 0xfe, 0x87, 0x1c, 0xac, 0xd1, 0xe5, 0x70, 0x53, 0x20, 0x82, 0x0a, 0x76, - 0xad, 0x91, 0xd3, 0xc3, 0x2e, 0x8d, 0x53, 0x7b, 0xa4, 0xda, 0xd8, 0x31, 0x2c, 0x9d, 0x63, 0x52, - 0xa5, 0x9e, 0x3d, 0xea, 0x50, 0x02, 0x3a, 0x05, 0xa4, 0xa1, 0x7e, 0x35, 0xb2, 0xf8, 0x14, 0xca, - 0x2b, 0xc5, 0x9e, 0x3d, 0xfa, 0x3d, 0xd2, 0x16, 0xb2, 0xee, 0xa1, 0xe6, 0x60, 0x97, 0xce, 0x10, - 0x26, 0xdb, 0xa5, 0x04, 0x74, 0x03, 0x8e, 0x0f, 0xf1, 0xd0, 0x72, 0x8e, 0xd4, 0x81, 0x31, 0x34, - 0x3c, 0xd5, 0x30, 0xd5, 0xfd, 0x23, 0x0f, 0xbb, 0x7c, 0x36, 0x20, 0xf6, 0xf0, 0x09, 0x79, 0xd6, - 0x32, 0x1f, 0x90, 0x27, 0x48, 0x86, 0x8a, 0x65, 0x0d, 0x55, 0xb7, 0x67, 0x39, 0x58, 0xd5, 0xf4, - 0x1f, 0xd3, 0x0a, 0x21, 0xaf, 0x94, 0x2d, 0x6b, 0xd8, 0x25, 0xb4, 0xa6, 0xfe, 0x63, 0xf4, 0x36, - 0x94, 0x7b, 0xf6, 0xc8, 0xc5, 0x9e, 0x4a, 0xfe, 0xd0, 0x02, 0xa0, 0xa4, 0x00, 0x23, 0x6d, 0xda, - 0x23, 0x37, 0xc4, 0x30, 0x24, 0x01, 0xb1, 0x18, 0x66, 0x78, 0x8a, 0x87, 0x14, 0xfc, 0x3a, 0x1c, - 0xf5, 0xb1, 0xad, 0xf5, 0x31, 0x33, 0x4d, 0xac, 0xdc, 0x29, 0xe0, 0xd7, 0x63, 0xce, 0x48, 0xcd, - 0x54, 0xaa, 0x87, 0xe1, 0xa6, 0x2b, 0x3f, 0x80, 0x4a, 0x84, 0x81, 0xf8, 0x8b, 0xaa, 0x75, 0x8d, - 0x9f, 0x88, 0x40, 0x2a, 0x12, 0x42, 0xd7, 0xf8, 0x09, 0x85, 0xfe, 0x68, 0x77, 0xd4, 0x91, 0x05, - 0x85, 0x35, 0x64, 0x0d, 0x2a, 0x11, 0x84, 0x8d, 0xec, 0xcf, 0x29, 0x94, 0xc6, 0xf7, 0xe7, 0xe4, - 0x37, 0xa1, 0x39, 0xd6, 0x40, 0x8c, 0x2b, 0xfd, 0x4d, 0x68, 0x14, 0xb3, 0x61, 0xbb, 0x5d, 0xfa, - 0x9b, 0x76, 0x81, 0x9f, 0x73, 0x88, 0xb6, 0xa4, 0xb0, 0x86, 0xac, 0x03, 0x6c, 0x6a, 0xb6, 0xb6, - 0x6f, 0x0c, 0x0c, 0xef, 0x08, 0x5d, 0x81, 0x9a, 0xa6, 0xeb, 0x6a, 0x4f, 0x50, 0x0c, 0x2c, 0x80, - 0xf3, 0x65, 0x4d, 0xd7, 0x37, 0x43, 0x64, 0xf4, 0x2e, 0xac, 0xe8, 0x8e, 0x65, 0x47, 0x79, 0x19, - 0x92, 0x5e, 0x23, 0x0f, 0xc2, 0xcc, 0xf2, 0x6f, 0x16, 0xe0, 0x74, 0x34, 0xcc, 0xe2, 0x28, 0xe6, - 0x7d, 0x58, 0x8a, 0xf5, 0x9a, 0x81, 0xf6, 0x05, 0xd6, 0x2a, 0x11, 0x89, 0x18, 0x2a, 0x97, 0x4b, - 0xa0, 0x72, 0xa9, 0x38, 0x69, 0xfe, 0x8d, 0xe2, 0xa4, 0x85, 0x37, 0x82, 0x93, 0xce, 0xbf, 0x1e, - 0x4e, 0xba, 0x34, 0x23, 0x4e, 0x7a, 0x91, 0x26, 0x77, 0xd1, 0x3b, 0x45, 0x51, 0xd8, 0xc4, 0xa9, - 0xf8, 0x7d, 0x98, 0xe2, 0xc4, 0x26, 0x86, 0xa7, 0x2e, 0xce, 0x82, 0xa7, 0x16, 0x33, 0xf1, 0xd4, - 0xb3, 0xb0, 0x64, 0x5a, 0xaa, 0x89, 0x5f, 0xa8, 0x64, 0xb8, 0xdc, 0x7a, 0x99, 0x8d, 0x9d, 0x69, - 0xb5, 0xf1, 0x8b, 0x0e, 0xa1, 0xa0, 0x73, 0xb0, 0x34, 0xd4, 0xdc, 0x67, 0x58, 0xa7, 0x60, 0xa6, - 0x5b, 0xaf, 0xd0, 0x38, 0x2b, 0x33, 0x5a, 0x87, 0x90, 0xd0, 0x05, 0xf0, 0xed, 0xe0, 0x4c, 0x55, - 0xca, 0x54, 0x11, 0x54, 0xc6, 0x16, 0xc2, 0x66, 0x97, 0x5f, 0x0b, 0x9b, 0xad, 0xcd, 0x8e, 0xcd, - 0x5e, 0x83, 0x9a, 0xf8, 0x2d, 0xc0, 0x59, 0x56, 0xbc, 0x53, 0x5c, 0x76, 0x59, 0x3c, 0x13, 0x00, - 0x6c, 0x16, 0x94, 0x0b, 0x63, 0xa1, 0xdc, 0xbf, 0x94, 0x60, 0x35, 0x3a, 0xd5, 0x38, 0x52, 0xf5, - 0x08, 0x4a, 0x8e, 0xc8, 0xed, 0x7c, 0x7a, 0x5d, 0xc9, 0xd8, 0x1b, 0x25, 0x17, 0x03, 0x25, 0x90, - 0x45, 0x3f, 0xcc, 0x04, 0x48, 0xaf, 0x4f, 0xd2, 0x37, 0x09, 0x22, 0x95, 0x1d, 0x78, 0xfb, 0x53, - 0xc3, 0xd4, 0xad, 0x17, 0x6e, 0x66, 0xa6, 0x48, 0x89, 0x57, 0x29, 0x23, 0x5e, 0x7b, 0x0e, 0xd6, - 0xb1, 0xe9, 0x19, 0xda, 0x40, 0x75, 0x6d, 0xdc, 0x13, 0x40, 0x4d, 0x40, 0x26, 0xab, 0xb2, 0xfc, - 0x4b, 0x09, 0x4e, 0xc4, 0x3b, 0xe5, 0x3e, 0x6b, 0x25, 0x7d, 0xf6, 0x6e, 0xf2, 0x1d, 0xe3, 0xc2, - 0xa9, 0x5e, 0xfb, 0x32, 0xd3, 0x6b, 0x37, 0x26, 0x6b, 0x9c, 0xe8, 0xb7, 0x3f, 0x93, 0xe0, 0x64, - 0xa6, 0x19, 0xb1, 0xd5, 0x58, 0x8a, 0xaf, 0xc6, 0x7c, 0x25, 0xef, 0x59, 0x23, 0xd3, 0x0b, 0xad, - 0xe4, 0x9b, 0xf4, 0x0c, 0x91, 0x2d, 0x99, 0xea, 0x50, 0x7b, 0x69, 0x0c, 0x47, 0x43, 0xbe, 0x94, - 0x13, 0x75, 0x4f, 0x19, 0xe5, 0x15, 0xd6, 0x72, 0xb9, 0x09, 0x2b, 0xbe, 0x95, 0x63, 0xb1, 0xe7, - 0x10, 0x96, 0x9c, 0x8b, 0x62, 0xc9, 0x26, 0x2c, 0x6c, 0xe1, 0xe7, 0x46, 0x0f, 0xbf, 0x91, 0x43, - 0xce, 0xb3, 0x50, 0xb6, 0xb1, 0x33, 0x34, 0x5c, 0xd7, 0x5f, 0x15, 0x4a, 0x4a, 0x98, 0x24, 0xff, - 0xdb, 0x02, 0x2c, 0xc7, 0xa3, 0xe3, 0x5e, 0x02, 0xba, 0x3e, 0x9f, 0xb2, 0x5e, 0xc5, 0x5f, 0x34, - 0xb4, 0x85, 0xb8, 0x21, 0xea, 0xca, 0x5c, 0x16, 0xcc, 0xe3, 0xd7, 0x8e, 0xa2, 0xe8, 0xac, 0xc3, - 0x62, 0xcf, 0x1a, 0x0e, 0x35, 0x53, 0x17, 0x67, 0xd3, 0xbc, 0x49, 0xfc, 0xa7, 0x39, 0x7d, 0xe2, - 0x76, 0x42, 0xa6, 0xbf, 0xc9, 0xe0, 0xbd, 0xb0, 0x9c, 0x67, 0x86, 0x49, 0x21, 0x70, 0xba, 0xb2, - 0x94, 0x14, 0xe0, 0xa4, 0x2d, 0xc3, 0x41, 0xeb, 0x50, 0xc0, 0xe6, 0x73, 0xb1, 0x47, 0x48, 0x39, - 0xbc, 0x16, 0x15, 0xa5, 0x42, 0xf9, 0xd0, 0x75, 0x58, 0x18, 0x92, 0xb0, 0x10, 0xe8, 0xc8, 0x5a, - 0xc6, 0x19, 0xae, 0xc2, 0xd9, 0xd0, 0x06, 0x2c, 0xea, 0x74, 0x9c, 0x44, 0x21, 0x55, 0x4f, 0x01, - 0xd6, 0x29, 0x83, 0x22, 0x18, 0xd1, 0xb6, 0xbf, 0x03, 0x2a, 0x65, 0x6d, 0x5d, 0x62, 0x43, 0x91, - 0xba, 0x0d, 0xda, 0x8d, 0xd6, 0xe7, 0x40, 0x75, 0x6d, 0x4c, 0xd6, 0x35, 0x7e, 0x2f, 0x74, 0x12, - 0x8a, 0x03, 0xab, 0xcf, 0xc2, 0xa8, 0xcc, 0xae, 0x3d, 0x0c, 0xac, 0x3e, 0x8d, 0xa2, 0x55, 0xb2, - 0x23, 0xd4, 0x0d, 0x93, 0x2e, 0xc1, 0x45, 0x85, 0x35, 0xc8, 0xe4, 0xa3, 0x3f, 0x54, 0xcb, 0xec, - 0xe1, 0x7a, 0x85, 0x3e, 0x2a, 0x51, 0xca, 0x8e, 0xd9, 0xa3, 0x95, 0xba, 0xe7, 0x1d, 0xd5, 0xab, - 0x94, 0x4e, 0x7e, 0x92, 0xcd, 0x3e, 0x03, 0xb0, 0x96, 0xb3, 0x36, 0xfb, 0x69, 0xf9, 0x5d, 0xe0, - 0x57, 0x0f, 0x60, 0xf1, 0x05, 0x4b, 0x04, 0x7c, 0x89, 0xba, 0x3c, 0x39, 0xbd, 0x70, 0x0d, 0x42, - 0xf0, 0xbb, 0xdc, 0xc6, 0xfd, 0xb5, 0x04, 0x27, 0x36, 0xe9, 0x5e, 0x38, 0x94, 0xc7, 0x66, 0x01, - 0x90, 0x6f, 0xf9, 0xd8, 0x7e, 0x26, 0x28, 0x1b, 0x7f, 0x6f, 0x01, 0xed, 0xb7, 0xa0, 0x2a, 0x94, - 0x73, 0x15, 0xf9, 0xa9, 0x8f, 0x07, 0x2a, 0x6e, 0xb8, 0x29, 0x7f, 0x04, 0x6b, 0x89, 0xb7, 0xe0, - 0xdb, 0xd1, 0x73, 0xb0, 0x14, 0xe4, 0x2b, 0xff, 0x25, 0xca, 0x3e, 0xad, 0xa5, 0xcb, 0xb7, 0xe1, - 0x78, 0xd7, 0xd3, 0x1c, 0x2f, 0xe1, 0x82, 0x29, 0x64, 0x29, 0xf0, 0x1f, 0x95, 0xe5, 0xd8, 0x7c, - 0x17, 0x56, 0xbb, 0x9e, 0x65, 0xbf, 0x82, 0x52, 0x92, 0x75, 0xc8, 0xfb, 0x5b, 0x23, 0xb1, 0x3e, - 0x88, 0xa6, 0xbc, 0xc6, 0x8e, 0x29, 0x92, 0xbd, 0xdd, 0x81, 0x13, 0xec, 0x94, 0xe0, 0x55, 0x5e, - 0xe2, 0xa4, 0x38, 0xa3, 0x48, 0xea, 0x7d, 0x0a, 0xc7, 0x82, 0x65, 0x31, 0xc0, 0xdf, 0x6e, 0x46, - 0xf1, 0xb7, 0xb3, 0x63, 0x46, 0x3d, 0x02, 0xbf, 0xfd, 0x49, 0x2e, 0x94, 0xd7, 0x33, 0xd0, 0xb7, - 0x3b, 0x51, 0xf4, 0xed, 0xc2, 0x24, 0xdd, 0x11, 0xf0, 0x2d, 0x19, 0xb5, 0xf9, 0x94, 0xa8, 0xfd, - 0x22, 0x01, 0xd1, 0x15, 0xb2, 0x30, 0xce, 0x98, 0xb5, 0xbf, 0x15, 0x84, 0x4e, 0x61, 0x08, 0x9d, - 0xdf, 0xb5, 0x7f, 0xa8, 0x73, 0x2b, 0x86, 0xd0, 0x9d, 0x9b, 0x68, 0xaf, 0x0f, 0xd0, 0xfd, 0x45, - 0x01, 0x4a, 0xfe, 0xb3, 0x84, 0xcf, 0x93, 0x6e, 0xcb, 0xa5, 0xb8, 0x2d, 0xbc, 0x02, 0xe7, 0x5f, - 0x6b, 0x05, 0x2e, 0x4c, 0xbd, 0x02, 0x9f, 0x82, 0x12, 0xfd, 0x41, 0x6f, 0x30, 0xb0, 0x15, 0xb5, - 0x48, 0x09, 0x0a, 0x3e, 0x08, 0xc2, 0x70, 0x61, 0xa6, 0x30, 0x8c, 0x61, 0x82, 0x8b, 0x71, 0x4c, - 0xf0, 0x9e, 0xbf, 0x22, 0xb2, 0x45, 0xf4, 0xd2, 0x18, 0xbd, 0xa9, 0x6b, 0x61, 0x0c, 0xab, 0x2a, - 0x65, 0x61, 0x55, 0x81, 0x96, 0xf1, 0x58, 0xd5, 0x77, 0xb8, 0x42, 0xec, 0x31, 0xa0, 0x2f, 0x1c, - 0x8b, 0x3c, 0xb3, 0xde, 0x01, 0xf0, 0x93, 0x88, 0x40, 0xfb, 0x4e, 0x8d, 0x79, 0x47, 0x25, 0xc4, - 0x4e, 0xd4, 0x46, 0x86, 0x26, 0x38, 0xb8, 0x9c, 0x2e, 0x3f, 0x66, 0x9c, 0x5a, 0xfe, 0xcf, 0x7c, - 0x28, 0xbf, 0x64, 0x1c, 0xc8, 0xdd, 0x4b, 0x60, 0xd1, 0x33, 0x46, 0xf1, 0xcd, 0x28, 0x14, 0xfd, - 0x8a, 0x51, 0x97, 0x40, 0xa2, 0x69, 0xe5, 0xa2, 0x39, 0xfc, 0x31, 0xc3, 0xdb, 0x4a, 0x9c, 0xd2, - 0xa4, 0x3b, 0x83, 0x03, 0xc3, 0x34, 0xdc, 0x43, 0xf6, 0x7c, 0x81, 0xed, 0x0c, 0x04, 0xa9, 0x49, - 0x11, 0x2f, 0xfc, 0xd2, 0xf0, 0xd4, 0x9e, 0xa5, 0x63, 0x1a, 0xd3, 0xf3, 0x4a, 0x91, 0x10, 0x36, - 0x2d, 0x1d, 0x07, 0x33, 0xaf, 0xf8, 0x6a, 0x33, 0xaf, 0x14, 0x9b, 0x79, 0x27, 0x60, 0xc1, 0xc1, - 0x9a, 0x6b, 0x99, 0x6c, 0x7f, 0xac, 0xf0, 0x16, 0x19, 0x9a, 0x21, 0x76, 0x5d, 0xd2, 0x13, 0x2f, - 0xd7, 0x78, 0x33, 0x54, 0x66, 0x2e, 0x4d, 0x2c, 0x33, 0xc7, 0x1c, 0xf4, 0xc5, 0xca, 0xcc, 0xca, - 0xc4, 0x32, 0x73, 0xaa, 0x73, 0xbe, 0xa0, 0xd0, 0xae, 0x4e, 0x57, 0x68, 0x87, 0xeb, 0xd2, 0xe5, - 0x48, 0x5d, 0xfa, 0x5d, 0x4e, 0xd6, 0x5f, 0x4b, 0xb0, 0x96, 0x98, 0x56, 0x7c, 0xba, 0xde, 0x8a, - 0x9d, 0x04, 0x9e, 0x9b, 0xe8, 0x33, 0xff, 0x20, 0xf0, 0x51, 0xe4, 0x20, 0xf0, 0xfd, 0xc9, 0x82, - 0x6f, 0xfc, 0x1c, 0xf0, 0xbf, 0x73, 0xf0, 0xf6, 0x9e, 0xad, 0xc7, 0x2a, 0x3c, 0xbe, 0xed, 0x9f, - 0x3e, 0x71, 0xdc, 0x13, 0xb5, 0x7e, 0x6e, 0x56, 0x40, 0x86, 0x97, 0xfb, 0xdb, 0x41, 0xb9, 0x9f, - 0x9f, 0x1d, 0x9f, 0x10, 0xb2, 0x48, 0x8f, 0x06, 0x31, 0x2b, 0x3e, 0x1e, 0x24, 0x55, 0x4d, 0x78, - 0xe5, 0x6f, 0xf9, 0x84, 0x43, 0x86, 0xb3, 0xd9, 0x06, 0xf0, 0xfa, 0xf0, 0x47, 0xb0, 0xbc, 0xfd, - 0x12, 0xf7, 0xba, 0x47, 0x66, 0x6f, 0x86, 0x71, 0xa8, 0x41, 0xbe, 0x37, 0xd4, 0x39, 0x7e, 0x4d, - 0x7e, 0x86, 0x4b, 0xde, 0x7c, 0xb4, 0xe4, 0x55, 0xa1, 0x16, 0xf4, 0xc0, 0x63, 0xf9, 0x04, 0x89, - 0x65, 0x9d, 0x30, 0x13, 0xe5, 0x4b, 0x0a, 0x6f, 0x71, 0x3a, 0x76, 0xd8, 0x25, 0x21, 0x46, 0xc7, - 0x8e, 0x13, 0x4d, 0x8d, 0xf9, 0x68, 0x6a, 0x94, 0xff, 0x58, 0x82, 0x32, 0xe9, 0xe1, 0xb5, 0xec, - 0xe7, 0xfb, 0xca, 0x7c, 0xb0, 0xaf, 0xf4, 0xb7, 0xa7, 0x85, 0xf0, 0xf6, 0x34, 0xb0, 0x7c, 0x9e, - 0x92, 0x93, 0x96, 0x2f, 0xf8, 0x74, 0xec, 0x38, 0xf2, 0x59, 0x58, 0x62, 0xb6, 0xf1, 0x37, 0xaf, - 0x41, 0x7e, 0xe4, 0x0c, 0xc4, 0xf8, 0x8d, 0x9c, 0x81, 0xfc, 0x87, 0x12, 0x54, 0x9a, 0x9e, 0xa7, - 0xf5, 0x0e, 0x67, 0x78, 0x01, 0xdf, 0xb8, 0x5c, 0xd8, 0xb8, 0xe4, 0x4b, 0x04, 0xe6, 0x16, 0x32, - 0xcc, 0x9d, 0x8f, 0x98, 0x2b, 0x43, 0x55, 0xd8, 0x92, 0x69, 0x70, 0x1b, 0x50, 0xc7, 0x72, 0xbc, - 0x87, 0x96, 0xf3, 0x42, 0x73, 0xf4, 0xd9, 0xb6, 0x9b, 0x08, 0x0a, 0xfc, 0xfe, 0x7e, 0xfe, 0xf2, - 0xbc, 0x42, 0x7f, 0xcb, 0x97, 0xe0, 0x58, 0x44, 0x5f, 0x66, 0xc7, 0xf7, 0xa1, 0x4c, 0x17, 0x39, - 0xbe, 0xef, 0xb8, 0x11, 0x3e, 0x66, 0x9c, 0x6a, 0x49, 0x94, 0xff, 0x3f, 0xac, 0x90, 0x62, 0x88, - 0xd2, 0xfd, 0xbc, 0xf3, 0xfd, 0x58, 0x51, 0x7e, 0x3a, 0x43, 0x51, 0xac, 0x20, 0xff, 0x8d, 0x04, - 0xf3, 0x94, 0x9e, 0x28, 0x50, 0x4e, 0x41, 0xc9, 0xc1, 0xb6, 0xa5, 0x7a, 0x5a, 0xdf, 0xff, 0x5a, - 0x82, 0x10, 0x76, 0xb5, 0x3e, 0xc5, 0xe6, 0xe9, 0x43, 0xdd, 0xe8, 0x63, 0xd7, 0x13, 0x9f, 0x4c, - 0x94, 0x09, 0x6d, 0x8b, 0x91, 0x88, 0x93, 0xe8, 0xa9, 0x57, 0x81, 0x1e, 0x6e, 0xd1, 0xdf, 0x68, - 0x9d, 0x5d, 0x2b, 0x9d, 0xe6, 0xb0, 0x83, 0x5e, 0x3a, 0x6d, 0x40, 0x31, 0x76, 0x3e, 0xe1, 0xb7, - 0xd1, 0x75, 0x28, 0x50, 0x7c, 0x77, 0x71, 0xb2, 0xdf, 0x28, 0xa3, 0xbc, 0x0d, 0x28, 0xec, 0x36, - 0x3e, 0x40, 0xd7, 0x61, 0x81, 0x7a, 0x55, 0xd4, 0x8e, 0x6b, 0x19, 0x8a, 0x14, 0xce, 0x26, 0x6b, - 0x80, 0x98, 0xe6, 0x48, 0xbd, 0x38, 0xfb, 0x30, 0x8e, 0xa9, 0x1f, 0xff, 0x4a, 0x82, 0x63, 0x91, - 0x3e, 0xb8, 0xad, 0xd7, 0xa2, 0x9d, 0x64, 0x9a, 0xca, 0x3b, 0xd8, 0x8c, 0x2c, 0x98, 0xd7, 0xb3, - 0x4c, 0xfa, 0x96, 0x16, 0xcb, 0xbf, 0x95, 0x00, 0x9a, 0x23, 0xef, 0x90, 0xe3, 0xa6, 0xe1, 0xa1, - 0x94, 0x62, 0x43, 0xd9, 0x80, 0xa2, 0xad, 0xb9, 0xee, 0x0b, 0xcb, 0x11, 0x3b, 0x3e, 0xbf, 0x4d, - 0x11, 0xce, 0x91, 0x77, 0x28, 0x4e, 0x35, 0xc9, 0x6f, 0x74, 0x01, 0xaa, 0xec, 0x93, 0x1e, 0x55, - 0xd3, 0x75, 0x07, 0xbb, 0x2e, 0x3f, 0xde, 0xac, 0x30, 0x6a, 0x93, 0x11, 0x09, 0x9b, 0x41, 0x31, - 0x7f, 0xef, 0x48, 0xf5, 0xac, 0x67, 0xd8, 0xe4, 0x3b, 0xb7, 0x8a, 0xa0, 0xee, 0x12, 0x22, 0x3b, - 0x44, 0xea, 0x1b, 0xae, 0xe7, 0x08, 0x36, 0x71, 0x14, 0xc6, 0xa9, 0x94, 0x8d, 0x0c, 0x4a, 0xad, - 0x33, 0x1a, 0x0c, 0x98, 0x8b, 0x5f, 0x7d, 0xd8, 0xbf, 0xc7, 0x5f, 0x28, 0x97, 0x35, 0x09, 0x02, - 0xa7, 0xf1, 0xd7, 0x7d, 0x83, 0x10, 0xd5, 0xf7, 0x60, 0x25, 0xf4, 0x0e, 0x3c, 0xac, 0x22, 0x25, - 0xb6, 0x14, 0x2d, 0xb1, 0xe5, 0x47, 0x80, 0x18, 0x2a, 0xf3, 0x9a, 0xef, 0x2d, 0x1f, 0x87, 0x63, - 0x11, 0x45, 0x7c, 0xe9, 0xbe, 0x0a, 0x15, 0x7e, 0xa7, 0x8f, 0x07, 0xca, 0x49, 0x28, 0x92, 0x14, - 0xdc, 0x33, 0x74, 0x71, 0xe4, 0xbd, 0x68, 0x5b, 0xfa, 0xa6, 0xa1, 0x3b, 0xf2, 0xa7, 0x50, 0xe1, - 0xdf, 0x05, 0x70, 0xde, 0x87, 0x50, 0xe5, 0x37, 0x00, 0xd5, 0xc8, 0xdd, 0xde, 0xb4, 0xaf, 0x74, - 0xc2, 0x9d, 0x28, 0x15, 0x33, 0xdc, 0x94, 0x75, 0x68, 0xb0, 0x1a, 0x23, 0xa2, 0x5e, 0xbc, 0xec, - 0x43, 0x10, 0x57, 0x5e, 0x26, 0xf6, 0x12, 0x95, 0xaf, 0x38, 0xe1, 0xa6, 0x7c, 0x1a, 0x4e, 0xa5, - 0xf6, 0xc2, 0x3d, 0x61, 0x43, 0x2d, 0x78, 0xc0, 0x2e, 0xa0, 0xfa, 0x67, 0xfa, 0x52, 0xe8, 0x4c, - 0xff, 0x84, 0x5f, 0x42, 0xe7, 0xc4, 0xaa, 0x47, 0xeb, 0xe3, 0x60, 0x33, 0x94, 0xcf, 0xda, 0x0c, - 0x15, 0x22, 0x9b, 0x21, 0xb9, 0xeb, 0xfb, 0x93, 0x6f, 0x52, 0x1f, 0xd0, 0xcd, 0x34, 0xeb, 0x5b, - 0x24, 0x44, 0x79, 0xdc, 0x5b, 0x32, 0x56, 0x25, 0x24, 0x25, 0x5f, 0x81, 0x4a, 0x34, 0x35, 0x86, - 0xf2, 0x9c, 0x94, 0xc8, 0x73, 0xd5, 0x58, 0x8a, 0xfb, 0x30, 0xb6, 0x3f, 0xc8, 0xf6, 0x71, 0x6c, - 0x77, 0x70, 0x37, 0x92, 0xec, 0xae, 0xa6, 0x1c, 0xd1, 0x7e, 0x4b, 0x79, 0x6e, 0x95, 0xaf, 0x07, - 0x0f, 0x5d, 0x22, 0xcf, 0x5f, 0x5a, 0x3e, 0x0f, 0xe5, 0xbd, 0xac, 0xaf, 0xbc, 0x0a, 0xe2, 0x22, - 0xce, 0x4d, 0x58, 0x7d, 0x68, 0x0c, 0xb0, 0x7b, 0xe4, 0x7a, 0x78, 0xd8, 0xa2, 0x49, 0xe9, 0xc0, - 0xc0, 0x0e, 0x3a, 0x03, 0x40, 0x37, 0x78, 0xb6, 0x65, 0xf8, 0xdf, 0xab, 0x84, 0x28, 0xf2, 0xbf, - 0x4b, 0xb0, 0x1c, 0x08, 0xee, 0xd1, 0x8d, 0xed, 0x5b, 0x50, 0x22, 0xef, 0xeb, 0x7a, 0xda, 0xd0, - 0x16, 0xa7, 0x7d, 0x3e, 0x01, 0xdd, 0x81, 0xf9, 0x03, 0x57, 0x00, 0x6a, 0xa9, 0xc7, 0x0b, 0x69, - 0x86, 0x28, 0x85, 0x03, 0xb7, 0xa5, 0xa3, 0x8f, 0x00, 0x46, 0x2e, 0xd6, 0xf9, 0x09, 0x5f, 0x3e, - 0xab, 0xbc, 0xd8, 0x0b, 0x5f, 0x55, 0x20, 0x02, 0xec, 0x0e, 0xcf, 0x5d, 0x28, 0x1b, 0xa6, 0xa5, - 0x63, 0x7a, 0x74, 0xab, 0x73, 0xcc, 0x6d, 0x82, 0x38, 0x30, 0x89, 0x3d, 0x17, 0xeb, 0x32, 0xe6, - 0x6b, 0xa1, 0xf0, 0x2f, 0x0f, 0x94, 0x36, 0xac, 0xb0, 0xa4, 0x75, 0xe0, 0x1b, 0x2e, 0x22, 0xf6, - 0xdc, 0xb8, 0xb7, 0xa3, 0xde, 0x52, 0x6a, 0x06, 0xaf, 0x85, 0x84, 0xa8, 0x7c, 0x1b, 0x8e, 0x47, - 0xf6, 0x8f, 0x33, 0x6c, 0xe8, 0xe4, 0x4e, 0x0c, 0x46, 0x0a, 0xc2, 0x99, 0x83, 0x34, 0x22, 0x9a, - 0x27, 0x81, 0x34, 0x2e, 0x03, 0x69, 0x5c, 0xf9, 0x0b, 0x38, 0x19, 0xc1, 0xbb, 0x22, 0x16, 0xdd, - 0x8d, 0x95, 0x7a, 0x17, 0x27, 0x69, 0x8d, 0xd5, 0x7c, 0xff, 0x25, 0xc1, 0x6a, 0x1a, 0xc3, 0x2b, - 0xe2, 0xb1, 0x3f, 0xca, 0xb8, 0x69, 0x7a, 0x6b, 0x3a, 0xb3, 0x7e, 0x2b, 0x58, 0xf6, 0x2e, 0x34, - 0xd2, 0xfc, 0x99, 0x1c, 0xa5, 0xfc, 0x2c, 0xa3, 0xf4, 0xf3, 0x7c, 0xe8, 0x5c, 0xa2, 0xe9, 0x79, - 0x8e, 0xb1, 0x3f, 0x22, 0x21, 0xff, 0xc6, 0xb1, 0xbe, 0x96, 0x8f, 0x5a, 0x31, 0xd7, 0xde, 0x18, - 0x23, 0x1e, 0xd8, 0x91, 0x8a, 0x5c, 0x7d, 0x96, 0xb6, 0xe9, 0xbf, 0x39, 0x9d, 0xbe, 0xdf, 0x59, - 0x78, 0xf8, 0xe7, 0x39, 0xa8, 0x46, 0x87, 0x08, 0x6d, 0x03, 0x68, 0xbe, 0xe5, 0x7c, 0xa2, 0x5c, - 0x98, 0xea, 0x35, 0x95, 0x90, 0x20, 0x7a, 0x0f, 0xf2, 0x3d, 0x7b, 0xc4, 0x47, 0x2d, 0xe5, 0xa8, - 0x7c, 0xd3, 0x1e, 0xb1, 0x8c, 0x42, 0xd8, 0xc8, 0x26, 0x8c, 0xdd, 0x7c, 0xc8, 0xce, 0x92, 0x4f, - 0xe9, 0x73, 0x26, 0xc3, 0x99, 0xd1, 0x63, 0xa8, 0xbe, 0x70, 0x0c, 0x4f, 0xdb, 0x1f, 0x60, 0x75, - 0xa0, 0x1d, 0x61, 0x87, 0x67, 0xc9, 0x29, 0x12, 0x59, 0x45, 0x08, 0x3e, 0x21, 0x72, 0xf2, 0x1f, - 0x40, 0x51, 0x58, 0x34, 0x61, 0x45, 0xd8, 0x85, 0xb5, 0x11, 0x61, 0x53, 0xe9, 0xdd, 0x4a, 0x53, - 0x33, 0x2d, 0xd5, 0xc5, 0x64, 0x19, 0x17, 0x1f, 0xb6, 0x4c, 0x48, 0xd1, 0xab, 0x54, 0x7a, 0xd3, - 0x72, 0x70, 0x5b, 0x33, 0xad, 0x2e, 0x13, 0x95, 0x9f, 0x43, 0x39, 0xf4, 0x82, 0x13, 0x4c, 0x68, - 0xc1, 0x8a, 0xb8, 0xa8, 0xe0, 0x62, 0x8f, 0x2f, 0x2f, 0x53, 0x75, 0xbe, 0xcc, 0xe5, 0xba, 0xd8, - 0x63, 0x97, 0x4b, 0xee, 0xc2, 0x49, 0x05, 0x5b, 0x36, 0x36, 0xfd, 0xf1, 0x7c, 0x62, 0xf5, 0x67, - 0xc8, 0xe0, 0x6f, 0x41, 0x23, 0x4d, 0x9e, 0xe5, 0x87, 0xab, 0x17, 0xa1, 0x28, 0xbe, 0xe7, 0x47, - 0x8b, 0x90, 0xdf, 0xdd, 0xec, 0xd4, 0xe6, 0xc8, 0x8f, 0xbd, 0xad, 0x4e, 0x4d, 0x42, 0x45, 0x28, - 0x74, 0x37, 0x77, 0x3b, 0xb5, 0xdc, 0xd5, 0x21, 0xd4, 0xe2, 0x1f, 0xb3, 0xa3, 0x35, 0x38, 0xd6, - 0x51, 0x76, 0x3a, 0xcd, 0x47, 0xcd, 0xdd, 0xd6, 0x4e, 0x5b, 0xed, 0x28, 0xad, 0x4f, 0x9a, 0xbb, - 0xdb, 0xb5, 0x39, 0x74, 0x0e, 0x4e, 0x87, 0x1f, 0x3c, 0xde, 0xe9, 0xee, 0xaa, 0xbb, 0x3b, 0xea, - 0xe6, 0x4e, 0x7b, 0xb7, 0xd9, 0x6a, 0x6f, 0x2b, 0x35, 0x09, 0x9d, 0x86, 0x93, 0x61, 0x96, 0x07, - 0xad, 0xad, 0x96, 0xb2, 0xbd, 0x49, 0x7e, 0x37, 0x9f, 0xd4, 0x72, 0x57, 0x3f, 0x86, 0x4a, 0xe4, - 0xdb, 0x73, 0x62, 0x52, 0x67, 0x67, 0xab, 0x36, 0x87, 0x2a, 0x50, 0x0a, 0xeb, 0x29, 0x42, 0xa1, - 0xbd, 0xb3, 0xb5, 0x5d, 0xcb, 0x21, 0x80, 0x85, 0xdd, 0xa6, 0xf2, 0x68, 0x7b, 0xb7, 0x96, 0xbf, - 0x7a, 0x1b, 0x96, 0x63, 0x97, 0xd5, 0xd1, 0x0a, 0x54, 0xba, 0xcd, 0xf6, 0xd6, 0x83, 0x9d, 0xcf, - 0x54, 0x65, 0xbb, 0xb9, 0xf5, 0x79, 0x6d, 0x0e, 0xad, 0x42, 0x4d, 0x90, 0xda, 0x3b, 0xbb, 0x8c, - 0x2a, 0x5d, 0x7d, 0x16, 0x9b, 0x6f, 0x18, 0x1d, 0x87, 0x15, 0xbf, 0x4b, 0x75, 0x53, 0xd9, 0x6e, - 0xee, 0x6e, 0x13, 0x4b, 0x22, 0x64, 0x65, 0xaf, 0xdd, 0x6e, 0xb5, 0x1f, 0xd5, 0x24, 0xa2, 0x35, - 0x20, 0x6f, 0x7f, 0xd6, 0x22, 0xcc, 0xb9, 0x28, 0xf3, 0x5e, 0xfb, 0x07, 0xed, 0x9d, 0x4f, 0xdb, - 0xb5, 0xfc, 0xc6, 0x2f, 0x57, 0xfc, 0xef, 0x81, 0xbb, 0xd8, 0xa1, 0xf7, 0x7f, 0x3a, 0xb0, 0x28, - 0xfe, 0x57, 0x44, 0x4a, 0xb6, 0x8e, 0xfe, 0x87, 0x8b, 0xc6, 0xb9, 0x31, 0x1c, 0xbc, 0xf6, 0x9e, - 0x43, 0xfb, 0xb4, 0x16, 0x0e, 0x7d, 0x3c, 0x70, 0x31, 0xb5, 0xf2, 0x4c, 0x7c, 0xaf, 0xd0, 0xb8, - 0x34, 0x91, 0xcf, 0xef, 0x03, 0x93, 0x72, 0x37, 0xfc, 0x7d, 0x1e, 0xba, 0x94, 0x56, 0xa7, 0xa6, - 0x7c, 0x00, 0xd8, 0xb8, 0x3c, 0x99, 0xd1, 0xef, 0xe6, 0x19, 0xd4, 0xe2, 0xdf, 0xea, 0xa1, 0x14, - 0x90, 0x39, 0xe3, 0x83, 0xc0, 0xc6, 0xd5, 0x69, 0x58, 0xc3, 0x9d, 0x25, 0x3e, 0x3e, 0xbb, 0x32, - 0xcd, 0x47, 0x3a, 0x99, 0x9d, 0x65, 0x7d, 0xcf, 0xc3, 0x1c, 0x18, 0xbd, 0xef, 0x8f, 0x52, 0xbf, - 0xf4, 0x4a, 0xf9, 0xac, 0x24, 0xcd, 0x81, 0xe9, 0x9f, 0x0e, 0xc8, 0x73, 0xe8, 0x10, 0x96, 0x63, - 0x17, 0x39, 0x50, 0x8a, 0x78, 0xfa, 0x8d, 0x95, 0xc6, 0x95, 0x29, 0x38, 0xa3, 0x11, 0x11, 0xbe, - 0xb8, 0x91, 0x1e, 0x11, 0x29, 0xd7, 0x42, 0xd2, 0x23, 0x22, 0xf5, 0x0e, 0x08, 0x0d, 0xee, 0xc8, - 0x85, 0x8d, 0xb4, 0xe0, 0x4e, 0xbb, 0x26, 0xd2, 0xb8, 0x34, 0x91, 0x2f, 0xec, 0xb4, 0xd8, 0xf5, - 0x8d, 0x34, 0xa7, 0xa5, 0x5f, 0x0f, 0x69, 0x5c, 0x99, 0x82, 0x33, 0x1e, 0x05, 0xc1, 0x61, 0x70, - 0x56, 0x14, 0x24, 0xae, 0x2e, 0x64, 0x45, 0x41, 0xf2, 0x5c, 0x99, 0x47, 0x41, 0xec, 0x10, 0xf7, - 0xf2, 0x14, 0x87, 0x4e, 0xd9, 0x51, 0x90, 0x7e, 0x3c, 0x25, 0xcf, 0xa1, 0x9f, 0x49, 0x50, 0xcf, - 0x3a, 0xe3, 0x40, 0x37, 0x66, 0x3e, 0x90, 0x69, 0x6c, 0xcc, 0x22, 0xe2, 0x5b, 0xf1, 0x15, 0xa0, - 0xe4, 0x1a, 0x88, 0xde, 0x4d, 0x1b, 0x99, 0x8c, 0x95, 0xb6, 0xf1, 0xde, 0x74, 0xcc, 0x7e, 0x97, - 0x5d, 0x28, 0x8a, 0x53, 0x15, 0x94, 0x92, 0xa5, 0x63, 0x67, 0x3a, 0x0d, 0x79, 0x1c, 0x8b, 0xaf, - 0xf4, 0x11, 0x14, 0x08, 0x15, 0x9d, 0x4e, 0xe7, 0x16, 0xca, 0xce, 0x64, 0x3d, 0xf6, 0x15, 0x3d, - 0x85, 0x05, 0x76, 0x8c, 0x80, 0x52, 0x50, 0x88, 0xc8, 0x61, 0x47, 0xe3, 0x6c, 0x36, 0x83, 0xaf, - 0xee, 0x4b, 0xf6, 0x6f, 0x84, 0xf8, 0x09, 0x01, 0x7a, 0x27, 0xfd, 0xbf, 0x05, 0x44, 0x0f, 0x24, - 0x1a, 0x17, 0x26, 0x70, 0x85, 0x27, 0x45, 0xac, 0x02, 0xbe, 0x34, 0x71, 0x1b, 0x93, 0x3d, 0x29, - 0xd2, 0x37, 0x4a, 0x2c, 0x48, 0x92, 0x1b, 0xa9, 0xb4, 0x20, 0xc9, 0xdc, 0xbe, 0xa6, 0x05, 0x49, - 0xf6, 0xde, 0x4c, 0x9e, 0x43, 0x1e, 0x1c, 0x4b, 0x81, 0xcd, 0xd0, 0x7b, 0x59, 0x41, 0x9e, 0x86, - 0xe1, 0x35, 0xae, 0x4d, 0xc9, 0x1d, 0x1e, 0x7c, 0x3e, 0xe9, 0xdf, 0xce, 0xc6, 0x92, 0x32, 0x07, - 0x3f, 0x3e, 0xc5, 0x37, 0xfe, 0x39, 0x0f, 0x4b, 0x0c, 0x12, 0xe5, 0x15, 0xcc, 0xe7, 0x00, 0xc1, - 0x69, 0x04, 0x3a, 0x9f, 0xee, 0x93, 0xc8, 0x11, 0x4f, 0xe3, 0x9d, 0xf1, 0x4c, 0xe1, 0x40, 0x0b, - 0x21, 0xfb, 0x69, 0x81, 0x96, 0x3c, 0xc0, 0x48, 0x0b, 0xb4, 0x94, 0xe3, 0x01, 0x79, 0x0e, 0x7d, - 0x02, 0x25, 0x1f, 0x42, 0x46, 0x69, 0x10, 0x74, 0x0c, 0x23, 0x6f, 0x9c, 0x1f, 0xcb, 0x13, 0xb6, - 0x3a, 0x84, 0x0f, 0xa7, 0x59, 0x9d, 0xc4, 0xa1, 0xd3, 0xac, 0x4e, 0x03, 0x99, 0x03, 0x9f, 0x30, - 0x14, 0x29, 0xd3, 0x27, 0x11, 0x10, 0x2f, 0xd3, 0x27, 0x51, 0x28, 0x4a, 0x9e, 0x7b, 0x70, 0xf1, - 0x57, 0x5f, 0x9f, 0x91, 0xfe, 0xf1, 0xeb, 0x33, 0x73, 0x3f, 0xfd, 0xe6, 0x8c, 0xf4, 0xab, 0x6f, - 0xce, 0x48, 0x7f, 0xff, 0xcd, 0x19, 0xe9, 0x5f, 0xbe, 0x39, 0x23, 0xfd, 0xd1, 0xbf, 0x9e, 0x99, - 0xfb, 0x61, 0x51, 0x48, 0xef, 0x2f, 0xd0, 0x7f, 0x06, 0xf6, 0xfe, 0xff, 0x06, 0x00, 0x00, 0xff, - 0xff, 0x9e, 0x13, 0x0f, 0x8c, 0xd2, 0x4d, 0x00, 0x00, + // 5092 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x7c, 0x4d, 0x6c, 0x1b, 0x59, + 0x72, 0xb0, 0x9a, 0xa4, 0x24, 0xb2, 0x28, 0x52, 0xf4, 0xb3, 0x6c, 0xd1, 0xf4, 0xd8, 0x63, 0xb5, + 0xc7, 0xbf, 0x33, 0x96, 0xd7, 0x9a, 0x59, 0xcf, 0x67, 0x7b, 0xc6, 0x63, 0x5a, 0x92, 0x6d, 0x7e, + 0x6b, 0x53, 0x4c, 0x53, 0x9a, 0x9f, 0x9d, 0x01, 0x7a, 0x5b, 0xec, 0x27, 0xaa, 0xd7, 0x64, 0x77, + 0x4f, 0x77, 0xd3, 0xb6, 0x36, 0x40, 0xb0, 0xc0, 0x02, 0x7b, 0xc8, 0x29, 0x40, 0x90, 0x4b, 0x8e, + 0x9b, 0x43, 0x0e, 0x39, 0x05, 0x41, 0x4e, 0x39, 0x6d, 0x90, 0xc3, 0x22, 0x40, 0x90, 0x9c, 0x36, + 0x09, 0x72, 0xc9, 0x4c, 0x10, 0x60, 0x11, 0x20, 0x40, 0x90, 0x73, 0x0e, 0xc1, 0xfb, 0xeb, 0xff, + 0xe6, 0x8f, 0xed, 0xd9, 0x99, 0x9c, 0xd8, 0xaf, 0xba, 0xaa, 0x5e, 0xbd, 0x7a, 0xf5, 0xea, 0xd5, + 0xab, 0x7a, 0x4d, 0x28, 0x69, 0xb6, 0xb1, 0x6e, 0x3b, 0x96, 0x67, 0xa1, 0x9a, 0x33, 0x32, 0x3d, + 0x63, 0x88, 0xd7, 0x9f, 0xdd, 0xd0, 0x06, 0xf6, 0xa1, 0xb6, 0xd1, 0xb8, 0xd6, 0x37, 0xbc, 0xc3, + 0xd1, 0xfe, 0x7a, 0xcf, 0x1a, 0x5e, 0xef, 0x5b, 0x7d, 0xeb, 0x3a, 0x45, 0xdc, 0x1f, 0x1d, 0xd0, + 0x16, 0x6d, 0xd0, 0x27, 0xc6, 0x40, 0xbe, 0x0a, 0xd5, 0x8f, 0xb1, 0xe3, 0x1a, 0x96, 0xa9, 0xe0, + 0x2f, 0x47, 0xd8, 0xf5, 0x50, 0x1d, 0x16, 0x9f, 0x31, 0x48, 0x5d, 0x3a, 0x27, 0x5d, 0x2e, 0x29, + 0xa2, 0x29, 0xff, 0xa9, 0x04, 0xcb, 0x3e, 0xb2, 0x6b, 0x5b, 0xa6, 0x8b, 0xb3, 0xb1, 0xd1, 0x1a, + 0x2c, 0x71, 0xe1, 0x54, 0x53, 0x1b, 0xe2, 0x7a, 0x8e, 0xbe, 0x2e, 0x73, 0x58, 0x5b, 0x1b, 0x62, + 0x74, 0x09, 0x96, 0x05, 0x8a, 0x60, 0x92, 0xa7, 0x58, 0x55, 0x0e, 0xe6, 0xbd, 0xa1, 0x75, 0x38, + 0x2e, 0x10, 0x35, 0xdb, 0xf0, 0x91, 0x0b, 0x14, 0xf9, 0x18, 0x7f, 0xd5, 0xb4, 0x0d, 0x8e, 0x2f, + 0x7f, 0x0e, 0xa5, 0xad, 0x76, 0x77, 0xd3, 0x32, 0x0f, 0x8c, 0x3e, 0x11, 0xd1, 0xc5, 0x0e, 0xa1, + 0xa9, 0x4b, 0xe7, 0xf2, 0x44, 0x44, 0xde, 0x44, 0x0d, 0x28, 0xba, 0x58, 0x73, 0x7a, 0x87, 0xd8, + 0xad, 0xe7, 0xe8, 0x2b, 0xbf, 0x4d, 0xa8, 0x2c, 0xdb, 0x33, 0x2c, 0xd3, 0xad, 0xe7, 0x19, 0x15, + 0x6f, 0xca, 0xbf, 0x90, 0xa0, 0xdc, 0xb1, 0x1c, 0xef, 0x89, 0x66, 0xdb, 0x86, 0xd9, 0x47, 0x37, + 0xa1, 0x48, 0x75, 0xd9, 0xb3, 0x06, 0x54, 0x07, 0xd5, 0x8d, 0xc6, 0x7a, 0x7c, 0x5a, 0xd6, 0x3b, + 0x1c, 0x43, 0xf1, 0x71, 0xd1, 0x05, 0xa8, 0xf6, 0x2c, 0xd3, 0xd3, 0x0c, 0x13, 0x3b, 0xaa, 0x6d, + 0x39, 0x1e, 0x55, 0xd1, 0xbc, 0x52, 0xf1, 0xa1, 0xa4, 0x17, 0x74, 0x1a, 0x4a, 0x87, 0x96, 0xeb, + 0x31, 0x8c, 0x3c, 0xc5, 0x28, 0x12, 0x00, 0x7d, 0xb9, 0x0a, 0x8b, 0xf4, 0xa5, 0x61, 0x73, 0x65, + 0x2c, 0x90, 0x66, 0xcb, 0x96, 0x7f, 0x2d, 0xc1, 0xfc, 0x13, 0x6b, 0x64, 0x7a, 0xb1, 0x6e, 0x34, + 0xef, 0x90, 0x4f, 0x54, 0xa8, 0x1b, 0xcd, 0x3b, 0x0c, 0xba, 0x21, 0x18, 0x6c, 0xae, 0x58, 0x37, + 0xe4, 0x65, 0x03, 0x8a, 0x0e, 0xd6, 0x74, 0xcb, 0x1c, 0x1c, 0x51, 0x11, 0x8a, 0x8a, 0xdf, 0x26, + 0x93, 0xe8, 0xe2, 0x81, 0x61, 0x8e, 0x5e, 0xa8, 0x0e, 0x1e, 0x68, 0xfb, 0x78, 0x40, 0x45, 0x29, + 0x2a, 0x55, 0x0e, 0x56, 0x18, 0x14, 0x6d, 0x41, 0xd9, 0x76, 0x2c, 0x5b, 0xeb, 0x6b, 0x44, 0x8f, + 0xf5, 0x79, 0xaa, 0x2a, 0x39, 0xa9, 0x2a, 0x2a, 0x76, 0x27, 0xc0, 0x54, 0xc2, 0x64, 0xf2, 0xdf, + 0x4b, 0xb0, 0x4c, 0x8c, 0xc7, 0xb5, 0xb5, 0x1e, 0xde, 0xa1, 0x53, 0x82, 0x6e, 0xc1, 0xa2, 0x89, + 0xbd, 0xe7, 0x96, 0xf3, 0x94, 0x4f, 0xc0, 0x9b, 0x49, 0xae, 0x3e, 0xcd, 0x13, 0x4b, 0xc7, 0x8a, + 0xc0, 0x47, 0x37, 0x20, 0x6f, 0x1b, 0x3a, 0x1d, 0xf0, 0x14, 0x64, 0x04, 0x97, 0x90, 0x18, 0x76, + 0x8f, 0xea, 0x61, 0x1a, 0x12, 0xc3, 0xee, 0x11, 0xe5, 0x7a, 0x9a, 0xd3, 0xc7, 0x9e, 0x6a, 0xe8, + 0x7c, 0xa2, 0x8a, 0x0c, 0xd0, 0xd2, 0x65, 0x19, 0xa0, 0x65, 0x7a, 0x37, 0xdf, 0xfb, 0x58, 0x1b, + 0x8c, 0x30, 0x5a, 0x81, 0xf9, 0x67, 0xe4, 0x81, 0x8e, 0x24, 0xaf, 0xb0, 0x86, 0xfc, 0x55, 0x01, + 0x4e, 0x3f, 0x26, 0xca, 0xec, 0x6a, 0xa6, 0xbe, 0x6f, 0xbd, 0xe8, 0xe2, 0xde, 0xc8, 0x31, 0xbc, + 0xa3, 0x4d, 0xcb, 0xf4, 0xf0, 0x0b, 0x0f, 0xb5, 0xe1, 0x98, 0x29, 0xba, 0x55, 0x85, 0xdd, 0x12, + 0x0e, 0xe5, 0x8d, 0xb5, 0x31, 0x12, 0x32, 0xfd, 0x29, 0x35, 0x33, 0x0a, 0x70, 0xd1, 0xa3, 0x60, + 0x52, 0x05, 0xb7, 0x1c, 0xe5, 0x96, 0x32, 0xde, 0xee, 0x36, 0x95, 0x8c, 0xf3, 0x12, 0xb3, 0x2e, + 0x38, 0x7d, 0x00, 0x64, 0xc9, 0xab, 0x9a, 0xab, 0x8e, 0x5c, 0xec, 0x50, 0xad, 0x95, 0x37, 0xde, + 0x48, 0x72, 0x09, 0x54, 0xa0, 0x94, 0x9c, 0x91, 0xd9, 0x74, 0xf7, 0x5c, 0xec, 0xa0, 0xbb, 0xd4, + 0x89, 0x10, 0xea, 0xbe, 0x63, 0x8d, 0xec, 0x7a, 0x71, 0x0a, 0x72, 0xa0, 0xe4, 0x0f, 0x09, 0x3e, + 0xf5, 0x30, 0xdc, 0x50, 0x55, 0xc7, 0xb2, 0xbc, 0x03, 0x57, 0x18, 0xa7, 0x00, 0x2b, 0x14, 0x8a, + 0xae, 0xc3, 0x71, 0x77, 0x64, 0xdb, 0x03, 0x3c, 0xc4, 0xa6, 0xa7, 0x0d, 0x58, 0x77, 0x6e, 0x7d, + 0xfe, 0x5c, 0xfe, 0x72, 0x5e, 0x41, 0xe1, 0x57, 0x94, 0xb1, 0x8b, 0xce, 0x02, 0xd8, 0x8e, 0xf1, + 0xcc, 0x18, 0xe0, 0x3e, 0xd6, 0xeb, 0x0b, 0x94, 0x69, 0x08, 0x82, 0xee, 0x10, 0xaf, 0xd3, 0xeb, + 0x59, 0x43, 0xbb, 0x5e, 0xca, 0x9a, 0x07, 0x31, 0x8b, 0x1d, 0xc7, 0x3a, 0x30, 0x06, 0x58, 0x11, + 0x14, 0xe8, 0x43, 0x28, 0x6a, 0xb6, 0xad, 0x39, 0x43, 0xcb, 0xa9, 0xc3, 0xb4, 0xd4, 0x3e, 0x09, + 0x7a, 0x0f, 0x56, 0x38, 0x27, 0xd5, 0x66, 0x2f, 0xd9, 0xb2, 0x5e, 0x24, 0x96, 0x77, 0x3f, 0x57, + 0x97, 0x14, 0xc4, 0xdf, 0x73, 0x5a, 0xb2, 0xc8, 0xe5, 0xbf, 0x95, 0x60, 0x39, 0xc6, 0x13, 0x75, + 0x60, 0x49, 0x70, 0xf0, 0x8e, 0x6c, 0xcc, 0x97, 0xd7, 0xb5, 0x89, 0xc2, 0xac, 0xf3, 0xdf, 0xdd, + 0x23, 0x1b, 0xd3, 0xf5, 0x2b, 0x1a, 0xe8, 0x3c, 0x54, 0x06, 0x56, 0x4f, 0x1b, 0x50, 0x67, 0xe3, + 0xe0, 0x03, 0xee, 0x6b, 0x96, 0x7c, 0xa0, 0x82, 0x0f, 0xe4, 0x7b, 0x50, 0x0e, 0x31, 0x40, 0x08, + 0xaa, 0x0a, 0xeb, 0x70, 0x0b, 0x1f, 0x68, 0xa3, 0x81, 0x57, 0x9b, 0x43, 0x55, 0x80, 0x3d, 0xb3, + 0x47, 0x3c, 0xbc, 0x89, 0xf5, 0x9a, 0x84, 0x2a, 0x50, 0x7a, 0x2c, 0x58, 0xd4, 0x72, 0xf2, 0x2f, + 0x72, 0x70, 0x82, 0x9a, 0x65, 0xc7, 0xd2, 0xf9, 0x9a, 0xe1, 0xdb, 0xc1, 0x79, 0xa8, 0xf4, 0xe8, + 0xec, 0xaa, 0xb6, 0xe6, 0x60, 0xd3, 0xe3, 0xee, 0x70, 0x89, 0x01, 0x3b, 0x14, 0x86, 0x3e, 0x85, + 0x9a, 0xcb, 0x47, 0xa4, 0xf6, 0xd8, 0x1a, 0xe3, 0x0b, 0x20, 0x65, 0xec, 0x63, 0x16, 0xa6, 0xb2, + 0xec, 0x26, 0x56, 0xea, 0xa2, 0x7b, 0xe4, 0xf6, 0xbc, 0x01, 0xdb, 0x57, 0xca, 0x1b, 0xef, 0x65, + 0x30, 0x8c, 0x0b, 0xbe, 0xde, 0x65, 0x64, 0xdb, 0xa6, 0xe7, 0x1c, 0x29, 0x82, 0x49, 0xe3, 0x36, + 0x2c, 0x85, 0x5f, 0xa0, 0x1a, 0xe4, 0x9f, 0xe2, 0x23, 0x3e, 0x28, 0xf2, 0x18, 0x78, 0x14, 0xa6, + 0x69, 0xd6, 0xb8, 0x9d, 0xfb, 0x7f, 0x92, 0xec, 0x00, 0x0a, 0x7a, 0x79, 0x82, 0x3d, 0x4d, 0xd7, + 0x3c, 0x0d, 0x21, 0x28, 0xd0, 0x0d, 0x9b, 0xb1, 0xa0, 0xcf, 0x84, 0xeb, 0x88, 0xbb, 0xc9, 0x92, + 0x42, 0x1e, 0xd1, 0x1b, 0x50, 0xf2, 0xbd, 0x06, 0xdf, 0xb5, 0x03, 0x00, 0xd9, 0x3d, 0x35, 0xcf, + 0xc3, 0x43, 0xdb, 0xa3, 0xeb, 0xad, 0xa2, 0x88, 0xa6, 0xfc, 0x17, 0xf3, 0x50, 0x4b, 0xcc, 0xc9, + 0x3d, 0x28, 0x0e, 0x79, 0xf7, 0xdc, 0x6b, 0xbd, 0x95, 0xb2, 0x85, 0x26, 0x44, 0x55, 0x7c, 0x2a, + 0xb2, 0x43, 0x91, 0x99, 0x0f, 0x45, 0x1a, 0x7e, 0x9b, 0x99, 0x5c, 0x5f, 0xd5, 0x0d, 0x07, 0xf7, + 0x3c, 0xcb, 0x39, 0xe2, 0xe2, 0x2e, 0x0d, 0xac, 0xfe, 0x96, 0x80, 0xa1, 0xdb, 0x00, 0xba, 0xe9, + 0xaa, 0xd4, 0xa2, 0xfa, 0x54, 0xe8, 0xf2, 0xc6, 0xe9, 0xa4, 0x10, 0x7e, 0x58, 0xa1, 0x94, 0x74, + 0xd3, 0xe5, 0xe2, 0xdf, 0x87, 0x0a, 0xd9, 0x9d, 0xd5, 0x21, 0x8b, 0x08, 0x98, 0xdb, 0x28, 0x6f, + 0x9c, 0x49, 0x1b, 0x83, 0x1f, 0x37, 0x28, 0x4b, 0x76, 0xd0, 0x70, 0xd1, 0x03, 0x58, 0xa0, 0xdb, + 0xa4, 0x5b, 0x5f, 0xa0, 0xc4, 0xeb, 0xe3, 0x14, 0xc0, 0x2d, 0xe2, 0x31, 0x25, 0x60, 0x06, 0xc1, + 0xa9, 0xd1, 0x1e, 0x94, 0x35, 0xd3, 0xb4, 0x3c, 0x8d, 0x79, 0xed, 0x45, 0xca, 0xec, 0xdd, 0x29, + 0x98, 0x35, 0x03, 0x2a, 0xc6, 0x31, 0xcc, 0x07, 0x7d, 0x08, 0xf3, 0xd4, 0xad, 0x73, 0x0f, 0x7c, + 0x69, 0x4a, 0xa3, 0x55, 0x18, 0x15, 0xda, 0x84, 0xc5, 0xe7, 0x86, 0xa9, 0x5b, 0xcf, 0x5d, 0xee, + 0x0d, 0xaf, 0x24, 0x19, 0x7c, 0xc2, 0x10, 0x12, 0x2c, 0x04, 0x65, 0xe3, 0x16, 0x94, 0x43, 0x23, + 0x9e, 0xc5, 0xd2, 0x1b, 0x77, 0xa1, 0x16, 0x1f, 0xdf, 0x4c, 0x2b, 0xe5, 0x77, 0x61, 0x45, 0x19, + 0x99, 0x81, 0x68, 0x22, 0x58, 0xbe, 0x0d, 0x0b, 0xdc, 0x62, 0x98, 0xd9, 0xca, 0x93, 0x15, 0xad, + 0x70, 0x8a, 0x70, 0xf4, 0x7b, 0xa8, 0x99, 0xfa, 0x00, 0x3b, 0xbc, 0x5f, 0x11, 0xfd, 0x3e, 0x62, + 0x50, 0xf9, 0x43, 0x38, 0x11, 0xeb, 0x9c, 0x07, 0xdf, 0x6f, 0x41, 0xd5, 0xb6, 0x74, 0xd5, 0x65, + 0x60, 0x12, 0x5b, 0x70, 0x5f, 0x66, 0xfb, 0xb8, 0x2d, 0x9d, 0x90, 0x77, 0x3d, 0xcb, 0x4e, 0x0a, + 0x3f, 0x1d, 0x79, 0x1d, 0x4e, 0xc6, 0xc9, 0x59, 0xf7, 0xf2, 0x47, 0xb0, 0xaa, 0xe0, 0xa1, 0xf5, + 0x0c, 0xbf, 0x2c, 0xeb, 0x06, 0xd4, 0x93, 0x0c, 0x38, 0xf3, 0xcf, 0x60, 0x35, 0x80, 0x76, 0x3d, + 0xcd, 0x1b, 0xb9, 0x33, 0x31, 0xe7, 0x27, 0x93, 0x7d, 0xcb, 0x65, 0xd3, 0x59, 0x54, 0x44, 0x53, + 0x5e, 0x85, 0xf9, 0x8e, 0xa5, 0xb7, 0x3a, 0xa8, 0x0a, 0x39, 0xc3, 0xe6, 0xc4, 0x39, 0xc3, 0x96, + 0x8d, 0x70, 0x9f, 0x6d, 0x16, 0x21, 0xb2, 0xae, 0xe3, 0xa8, 0xe8, 0x2e, 0x54, 0x35, 0x5d, 0x37, + 0x88, 0x39, 0x69, 0x03, 0xd5, 0xb0, 0xd9, 0x01, 0xa2, 0xbc, 0xb1, 0x9a, 0x6a, 0x00, 0xad, 0x8e, + 0x52, 0x09, 0xd0, 0x5b, 0xb6, 0x2b, 0x3f, 0x82, 0x92, 0x1f, 0x85, 0x91, 0x58, 0x21, 0x1a, 0x65, + 0x4d, 0x11, 0xb3, 0xf9, 0xc7, 0x91, 0xdd, 0xc4, 0x46, 0xc7, 0x45, 0xbe, 0x03, 0xe0, 0x3b, 0x64, + 0x11, 0x0c, 0x9e, 0x1e, 0xc3, 0x58, 0x09, 0xa1, 0xcb, 0x3f, 0x8b, 0xb8, 0xe9, 0x90, 0x12, 0x74, + 0x5f, 0x09, 0x7a, 0xc4, 0x6d, 0xe7, 0x5e, 0xca, 0x6d, 0xbf, 0x0f, 0xf3, 0xae, 0xa7, 0x79, 0x98, + 0x47, 0xd3, 0x6b, 0xe3, 0xc8, 0x89, 0x10, 0x58, 0x61, 0xf8, 0xe8, 0x0c, 0x40, 0xcf, 0xc1, 0x9a, + 0x87, 0x75, 0x55, 0x63, 0x7b, 0x4c, 0x5e, 0x29, 0x71, 0x48, 0xd3, 0x23, 0xfe, 0x46, 0x9c, 0x08, + 0xe6, 0xb3, 0xfc, 0x4d, 0xc6, 0x54, 0x07, 0x67, 0x03, 0xdf, 0xe7, 0x2d, 0x4c, 0xe9, 0xf3, 0x38, + 0x03, 0xee, 0xf3, 0x02, 0x8f, 0xbe, 0x38, 0xd9, 0xa3, 0x33, 0xd2, 0x69, 0x3c, 0x7a, 0x71, 0xb2, + 0x47, 0xe7, 0xcc, 0xc6, 0x7b, 0xf4, 0x14, 0xf7, 0x53, 0x4a, 0x73, 0x3f, 0xdf, 0xa6, 0xdb, 0xfd, + 0x67, 0x09, 0xea, 0x49, 0x2f, 0xc0, 0xbd, 0xdf, 0x6d, 0x58, 0x70, 0x29, 0x64, 0x1a, 0xdf, 0xcb, + 0x69, 0x39, 0x05, 0x7a, 0x04, 0x05, 0xc3, 0x3c, 0xb0, 0xf8, 0xa2, 0x7d, 0x6f, 0x0a, 0x4a, 0xde, + 0xeb, 0x7a, 0xcb, 0x3c, 0xb0, 0x98, 0x36, 0x29, 0x87, 0xc6, 0xfb, 0x50, 0xf2, 0x41, 0x33, 0x8d, + 0x6d, 0x07, 0x56, 0x62, 0xb6, 0xcd, 0x0e, 0x80, 0xfe, 0x92, 0x90, 0x66, 0x5b, 0x12, 0xf2, 0x4f, + 0x73, 0xe1, 0x25, 0xfb, 0xc0, 0x18, 0x78, 0xd8, 0x49, 0x2c, 0xd9, 0x0f, 0x04, 0x77, 0xb6, 0x5e, + 0x2f, 0x4e, 0xe4, 0xce, 0xce, 0x54, 0x7c, 0xd5, 0x7d, 0x01, 0x55, 0x6a, 0x94, 0xaa, 0x8b, 0x07, + 0x34, 0x6e, 0xe2, 0x31, 0xec, 0xf7, 0xc7, 0xb1, 0x61, 0x92, 0x30, 0xd3, 0xee, 0x72, 0x3a, 0xa6, + 0xc1, 0xca, 0x20, 0x0c, 0x6b, 0xdc, 0x03, 0x94, 0x44, 0x9a, 0x49, 0xa7, 0x5d, 0xe2, 0x0b, 0x5d, + 0x2f, 0x75, 0x9f, 0x3e, 0xa0, 0x62, 0x4c, 0x63, 0x2b, 0x4c, 0x60, 0x85, 0x53, 0xc8, 0xff, 0x99, + 0x07, 0x08, 0x5e, 0xfe, 0x1f, 0x72, 0x82, 0xf7, 0x7c, 0x07, 0xc4, 0xe2, 0xd1, 0xcb, 0xe3, 0x18, + 0xa7, 0xba, 0x9e, 0x9d, 0xa8, 0xeb, 0x61, 0x91, 0xe9, 0xb5, 0xb1, 0x6c, 0x66, 0x76, 0x3a, 0x8b, + 0xdf, 0x35, 0xa7, 0xf3, 0x18, 0x4e, 0xc6, 0x8d, 0x88, 0x7b, 0x9c, 0x0d, 0x98, 0x37, 0x3c, 0x3c, + 0x64, 0x79, 0xc4, 0xd4, 0x34, 0x44, 0x88, 0x88, 0xa1, 0xca, 0x7f, 0x2e, 0x41, 0xa9, 0x35, 0xd4, + 0xfa, 0xb8, 0x6b, 0xe3, 0x1e, 0xe9, 0xd5, 0x20, 0x0d, 0x2e, 0x09, 0x6b, 0xa0, 0x76, 0x54, 0xcd, + 0xcc, 0x29, 0xbd, 0x93, 0x92, 0xe4, 0x10, 0x7c, 0xc6, 0x6b, 0xf9, 0x95, 0x35, 0xb0, 0x01, 0xc5, + 0x1f, 0xe0, 0x23, 0xe6, 0x8e, 0xa6, 0xa4, 0x93, 0xff, 0x31, 0x07, 0xab, 0x74, 0x3b, 0xdc, 0x14, + 0x69, 0x45, 0x05, 0xbb, 0xd6, 0xc8, 0xe9, 0x61, 0x97, 0xda, 0xa9, 0x3d, 0x52, 0x6d, 0xec, 0x18, + 0x96, 0xce, 0x13, 0x5b, 0xa5, 0x9e, 0x3d, 0xea, 0x50, 0x00, 0x3a, 0x0d, 0xa4, 0xa1, 0x7e, 0x39, + 0xb2, 0xf8, 0x12, 0xca, 0x2b, 0xc5, 0x9e, 0x3d, 0xfa, 0x1d, 0xd2, 0x16, 0xb4, 0xee, 0xa1, 0xe6, + 0x60, 0x97, 0xae, 0x10, 0x46, 0xdb, 0xa5, 0x00, 0x74, 0x03, 0x4e, 0x0c, 0xf1, 0xd0, 0x72, 0x8e, + 0xd4, 0x81, 0x31, 0x34, 0x3c, 0xd5, 0x30, 0xd5, 0xfd, 0x23, 0x0f, 0xbb, 0x7c, 0x35, 0x20, 0xf6, + 0xf2, 0x31, 0x79, 0xd7, 0x32, 0xef, 0x93, 0x37, 0x48, 0x86, 0x8a, 0x65, 0x0d, 0x55, 0xb7, 0x67, + 0x39, 0x58, 0xd5, 0xf4, 0x1f, 0xd3, 0x08, 0x21, 0xaf, 0x94, 0x2d, 0x6b, 0xd8, 0x25, 0xb0, 0xa6, + 0xfe, 0x63, 0xf4, 0x26, 0x94, 0x7b, 0xf6, 0xc8, 0xc5, 0x9e, 0x4a, 0x7e, 0x68, 0x00, 0x50, 0x52, + 0x80, 0x81, 0x36, 0xed, 0x91, 0x1b, 0x42, 0x18, 0x12, 0x83, 0x58, 0x0c, 0x23, 0x3c, 0xc1, 0x43, + 0x9a, 0x41, 0x3b, 0x1c, 0xf5, 0xb1, 0xad, 0xf5, 0x31, 0x13, 0x4d, 0xec, 0xdc, 0x29, 0x19, 0xb4, + 0x47, 0x1c, 0x91, 0x8a, 0xa9, 0x54, 0x0f, 0xc3, 0x4d, 0x57, 0xbe, 0x0f, 0x95, 0x08, 0x02, 0xd1, + 0x17, 0x65, 0xeb, 0x1a, 0x3f, 0x11, 0x86, 0x54, 0x24, 0x80, 0xae, 0xf1, 0x13, 0x9a, 0x3f, 0xa4, + 0xdd, 0x51, 0x45, 0x16, 0x14, 0xd6, 0x90, 0x35, 0xa8, 0x44, 0xd2, 0x74, 0xe4, 0x90, 0x4f, 0xf3, + 0x71, 0xfc, 0x90, 0x4f, 0x9e, 0x09, 0xcc, 0xb1, 0x06, 0x62, 0x5e, 0xe9, 0x33, 0x81, 0xd1, 0xc4, + 0x0f, 0x3b, 0x32, 0xd3, 0x67, 0xda, 0x05, 0x7e, 0xc6, 0xf3, 0xbc, 0x25, 0x85, 0x35, 0x64, 0x1d, + 0x60, 0x53, 0xb3, 0xb5, 0x7d, 0x63, 0x60, 0x78, 0x47, 0xe8, 0x0a, 0xd4, 0x34, 0x5d, 0x57, 0x7b, + 0x02, 0x62, 0x60, 0x91, 0x7d, 0x5f, 0xd6, 0x74, 0x7d, 0x33, 0x04, 0x46, 0x6f, 0xc3, 0x31, 0xdd, + 0xb1, 0xec, 0x28, 0x2e, 0x4b, 0xc7, 0xd7, 0xc8, 0x8b, 0x30, 0xb2, 0xfc, 0x9b, 0x05, 0x38, 0x13, + 0x35, 0xb3, 0x78, 0x2a, 0xf4, 0x1e, 0x2c, 0xc5, 0x7a, 0xcd, 0x48, 0x19, 0x06, 0xd2, 0x2a, 0x11, + 0x8a, 0x58, 0x6a, 0x2f, 0x97, 0x48, 0xed, 0xa5, 0x26, 0x5b, 0xf3, 0xaf, 0x35, 0xd9, 0x5a, 0x78, + 0x2d, 0xc9, 0xd6, 0xf9, 0x57, 0x4b, 0xb6, 0x2e, 0xcd, 0x98, 0x6c, 0xbd, 0x48, 0x9d, 0xbb, 0xe8, + 0x9d, 0xa6, 0x62, 0xd8, 0xc2, 0xa9, 0xf8, 0x7d, 0x98, 0xa2, 0xec, 0x13, 0x4b, 0xca, 0x2e, 0xce, + 0x92, 0x94, 0x2d, 0x66, 0x26, 0x65, 0xcf, 0xc1, 0x92, 0x69, 0xa9, 0x26, 0x7e, 0xae, 0x92, 0xe9, + 0x72, 0xeb, 0x65, 0x36, 0x77, 0xa6, 0xd5, 0xc6, 0xcf, 0x3b, 0x04, 0x82, 0xd6, 0x60, 0x69, 0xa8, + 0xb9, 0x4f, 0xb1, 0x4e, 0x33, 0xa2, 0x6e, 0xbd, 0x42, 0xed, 0xac, 0xcc, 0x60, 0x1d, 0x02, 0x42, + 0x17, 0xc0, 0x97, 0x83, 0x23, 0x55, 0x29, 0x52, 0x45, 0x40, 0x19, 0x5a, 0x28, 0xc1, 0xbb, 0xfc, + 0x4a, 0x09, 0xde, 0xda, 0xec, 0x09, 0xde, 0x6b, 0x50, 0x13, 0xcf, 0x22, 0xc3, 0xcb, 0x82, 0x77, + 0x9a, 0xdc, 0x5d, 0x16, 0xef, 0x44, 0x16, 0x37, 0x2b, 0x1f, 0x0c, 0x63, 0xf3, 0xc1, 0x7f, 0x25, + 0xc1, 0x4a, 0x74, 0xa9, 0xf1, 0x74, 0xd7, 0x43, 0x28, 0x39, 0xc2, 0xb7, 0xf3, 0xe5, 0x75, 0x25, + 0xe3, 0x6c, 0x94, 0xdc, 0x0c, 0x94, 0x80, 0x16, 0xfd, 0x30, 0x33, 0xcb, 0x7a, 0x7d, 0x12, 0xbf, + 0x49, 0x79, 0x56, 0xf9, 0x0f, 0x25, 0x38, 0xc3, 0x33, 0x4a, 0x19, 0x35, 0x93, 0x14, 0x73, 0x95, + 0x32, 0xcc, 0xb5, 0xe7, 0x60, 0x1d, 0x9b, 0x9e, 0xa1, 0x0d, 0x54, 0xd7, 0xc6, 0x3d, 0x91, 0xa7, + 0x09, 0xc0, 0x74, 0x73, 0x5f, 0x83, 0x25, 0x56, 0x42, 0x73, 0xac, 0x1e, 0x76, 0x5d, 0x5e, 0x29, + 0x2b, 0xd3, 0x2a, 0x1a, 0x03, 0xc9, 0x23, 0x58, 0xcd, 0x48, 0x73, 0xa5, 0x2a, 0x43, 0xca, 0x52, + 0xc6, 0xd8, 0x91, 0x25, 0x95, 0xf1, 0x47, 0x12, 0xbc, 0xc9, 0x49, 0x32, 0xfd, 0xe6, 0xb7, 0xa1, + 0x8e, 0x5f, 0x4a, 0x70, 0x32, 0x2e, 0x17, 0x57, 0x47, 0x2b, 0x69, 0x64, 0x6f, 0x67, 0xea, 0x61, + 0xbc, 0x99, 0x7d, 0x91, 0x69, 0x66, 0x37, 0x26, 0x73, 0x9c, 0xa8, 0xdb, 0x3f, 0x93, 0xe0, 0x54, + 0xa6, 0x18, 0xb1, 0xf0, 0x45, 0x8a, 0x87, 0x2f, 0x3c, 0xf4, 0xe9, 0x59, 0x23, 0xd3, 0x0b, 0x85, + 0x3e, 0x9b, 0xb4, 0x72, 0xcb, 0x62, 0x0c, 0x75, 0xa8, 0xbd, 0x30, 0x86, 0xa3, 0x21, 0x8f, 0x7d, + 0x08, 0xbb, 0x27, 0x0c, 0xf2, 0x12, 0xc1, 0x8f, 0xdc, 0x84, 0x63, 0xbe, 0x94, 0x63, 0x33, 0xfe, + 0xa1, 0x0c, 0x7e, 0x2e, 0x9a, 0xc1, 0x37, 0x61, 0x61, 0x0b, 0x3f, 0x33, 0x7a, 0xf8, 0xb5, 0x94, + 0x96, 0xcf, 0x41, 0xd9, 0xc6, 0xce, 0xd0, 0x70, 0x5d, 0x7f, 0x1b, 0x2d, 0x29, 0x61, 0x90, 0xfc, + 0xef, 0x0b, 0xb0, 0x1c, 0xb7, 0x8e, 0x8f, 0x12, 0x05, 0x83, 0xf3, 0x29, 0x1b, 0x7c, 0x7c, 0xa0, + 0xa1, 0x33, 0xd7, 0x0d, 0x11, 0x88, 0xe7, 0xb2, 0xf2, 0x62, 0x7e, 0xb0, 0x2d, 0xa2, 0xf4, 0x3a, + 0x2c, 0xf6, 0xac, 0xe1, 0x50, 0x33, 0x75, 0x71, 0x23, 0x80, 0x37, 0x89, 0xfe, 0x34, 0xa7, 0x4f, + 0xd4, 0x4e, 0xc0, 0xf4, 0x99, 0x4c, 0xde, 0x73, 0xcb, 0x79, 0x6a, 0x98, 0xb4, 0xf0, 0x40, 0xb7, + 0xe2, 0x92, 0x02, 0x1c, 0xb4, 0x65, 0x38, 0x68, 0x1d, 0x0a, 0xd8, 0x7c, 0x26, 0x0e, 0x55, 0x29, + 0x57, 0x06, 0x44, 0x08, 0xae, 0x50, 0x3c, 0x74, 0x1d, 0x16, 0x86, 0xc4, 0x2c, 0x44, 0x3a, 0x69, + 0x35, 0xa3, 0x72, 0xae, 0x70, 0x34, 0xb4, 0x01, 0x8b, 0x3a, 0x9d, 0x27, 0x11, 0x79, 0xd6, 0x53, + 0xca, 0x19, 0x14, 0x41, 0x11, 0x88, 0x68, 0xdb, 0x3f, 0x32, 0x96, 0xb2, 0xce, 0x7a, 0xb1, 0xa9, + 0x48, 0x3d, 0x37, 0xee, 0x46, 0x0f, 0x34, 0x40, 0x79, 0x6d, 0x4c, 0xe6, 0x35, 0xfe, 0xf0, 0x78, + 0x0a, 0x8a, 0x03, 0xab, 0xcf, 0xcc, 0xa8, 0xcc, 0x2e, 0x9b, 0x0c, 0xac, 0x3e, 0xb5, 0xa2, 0x15, + 0x72, 0x84, 0xd6, 0x0d, 0x93, 0xc6, 0x2c, 0x45, 0x85, 0x35, 0xc8, 0xe2, 0xa3, 0x0f, 0xaa, 0x65, + 0xf6, 0x70, 0xbd, 0x42, 0x5f, 0x95, 0x28, 0x64, 0xc7, 0xec, 0xd1, 0xa3, 0x8d, 0xe7, 0x1d, 0xd5, + 0xab, 0x14, 0x4e, 0x1e, 0xd1, 0x07, 0x22, 0xe3, 0xb7, 0x9c, 0x95, 0x1d, 0x49, 0xdb, 0x10, 0x45, + 0xc2, 0xef, 0x7e, 0x50, 0xe4, 0x60, 0x7b, 0xfa, 0xe5, 0xc9, 0xee, 0xe5, 0x3b, 0x54, 0xe3, 0xf8, + 0x1b, 0x09, 0x4e, 0x6e, 0xd2, 0xe4, 0x41, 0xc8, 0x8f, 0xcd, 0x92, 0x71, 0xbf, 0xe5, 0x17, 0x43, + 0x32, 0xb3, 0xd8, 0xf1, 0x71, 0x8b, 0x5a, 0x48, 0x0b, 0xaa, 0x82, 0x39, 0x67, 0x91, 0x9f, 0xba, + 0x9e, 0x52, 0x71, 0xc3, 0x4d, 0xf9, 0x03, 0x58, 0x4d, 0x8c, 0x82, 0x9f, 0xdf, 0xd7, 0x60, 0x29, + 0xf0, 0x57, 0xfe, 0x20, 0xca, 0x3e, 0xac, 0xa5, 0xcb, 0xb7, 0xe1, 0x44, 0xd7, 0xd3, 0x1c, 0x2f, + 0xa1, 0x82, 0x29, 0x68, 0x69, 0xa5, 0x24, 0x4a, 0xcb, 0x8b, 0x19, 0x5d, 0x58, 0xe9, 0x7a, 0x96, + 0xfd, 0x12, 0x4c, 0x89, 0xd7, 0x21, 0xe3, 0xb7, 0x46, 0x62, 0x7f, 0x10, 0x4d, 0x79, 0x95, 0xd5, + 0x75, 0x92, 0xbd, 0xdd, 0x81, 0x93, 0xac, 0xac, 0xf2, 0x32, 0x83, 0x38, 0x25, 0x8a, 0x3a, 0x49, + 0xbe, 0x4f, 0xe0, 0x78, 0xb0, 0x2d, 0x06, 0x09, 0xcb, 0x9b, 0xd1, 0x84, 0xe5, 0xb9, 0x31, 0xb3, + 0x1e, 0xc9, 0x57, 0xfe, 0x49, 0x2e, 0xe4, 0xd7, 0x33, 0xd2, 0x95, 0x77, 0xa2, 0xe9, 0xca, 0x0b, + 0x93, 0x78, 0x47, 0xb2, 0x95, 0x49, 0xab, 0xcd, 0xa7, 0x58, 0xed, 0xe7, 0x89, 0x9c, 0x66, 0x21, + 0x2b, 0x29, 0x1c, 0x93, 0xf6, 0xb7, 0x92, 0xd2, 0x54, 0x58, 0x4a, 0xd3, 0xef, 0xda, 0xaf, 0x82, + 0xdd, 0x8a, 0xa5, 0x34, 0xd7, 0x26, 0xca, 0xeb, 0x67, 0x34, 0xff, 0xb2, 0x00, 0x25, 0xff, 0x5d, + 0x42, 0xe7, 0x49, 0xb5, 0xe5, 0x52, 0xd4, 0x16, 0xde, 0x81, 0xf3, 0xaf, 0xb4, 0x03, 0x17, 0xa6, + 0xde, 0x81, 0x4f, 0x43, 0x89, 0x3e, 0xd0, 0x7b, 0x23, 0x6c, 0x47, 0x2d, 0x52, 0x80, 0x82, 0x0f, + 0x02, 0x33, 0x5c, 0x98, 0xc9, 0x0c, 0x63, 0x49, 0xd4, 0xc5, 0x78, 0x12, 0xf5, 0x23, 0x7f, 0x47, + 0x64, 0x9b, 0xe8, 0xa5, 0x31, 0x7c, 0x53, 0xf7, 0xc2, 0x58, 0x72, 0xaf, 0x94, 0x95, 0xdc, 0x0b, + 0xb8, 0x8c, 0x4f, 0xee, 0x7d, 0x8b, 0x3b, 0xc4, 0x1e, 0xcb, 0x8c, 0x86, 0x6d, 0x91, 0x7b, 0xd6, + 0x3b, 0x00, 0xbe, 0x13, 0x11, 0xe9, 0xd1, 0xd3, 0x63, 0xc6, 0xa8, 0x84, 0xd0, 0x09, 0xdb, 0xc8, + 0xd4, 0x04, 0x95, 0xde, 0xe9, 0xfc, 0x63, 0x46, 0x99, 0xf7, 0x7f, 0xe6, 0x43, 0xfe, 0x25, 0xa3, + 0x82, 0xf9, 0x51, 0x22, 0x79, 0x3f, 0xa3, 0x15, 0xdf, 0x8c, 0xe6, 0xee, 0x5f, 0xd2, 0xea, 0x12, + 0xa9, 0x7b, 0x1a, 0xb9, 0x68, 0x0e, 0x7f, 0xcd, 0x12, 0x94, 0x25, 0x0e, 0x69, 0xd2, 0x93, 0xc1, + 0x81, 0x61, 0x1a, 0xee, 0x21, 0x7b, 0xbf, 0xc0, 0x4e, 0x06, 0x02, 0xd4, 0xa4, 0x29, 0x42, 0xfc, + 0xc2, 0xf0, 0xd4, 0x9e, 0xa5, 0x63, 0x6a, 0xd3, 0xf3, 0x4a, 0x91, 0x00, 0x36, 0x2d, 0x1d, 0x07, + 0x2b, 0xaf, 0xf8, 0x72, 0x2b, 0xaf, 0x14, 0x5b, 0x79, 0x27, 0x61, 0xc1, 0xc1, 0x9a, 0x6b, 0x99, + 0x2c, 0xa1, 0xa0, 0xf0, 0x16, 0x99, 0x9a, 0x21, 0x76, 0x5d, 0xd2, 0x13, 0x0f, 0xd7, 0x78, 0x33, + 0x14, 0x66, 0x2e, 0x4d, 0x0c, 0x33, 0xc7, 0x54, 0x46, 0x63, 0x61, 0x66, 0x65, 0x62, 0x98, 0x39, + 0x55, 0x61, 0x34, 0x08, 0xb4, 0xab, 0xd3, 0x05, 0xda, 0xe1, 0xb8, 0x74, 0x39, 0x12, 0x97, 0x7e, + 0x9b, 0x8b, 0xf5, 0xd7, 0x12, 0xac, 0x26, 0x96, 0x15, 0x5f, 0xae, 0xb7, 0x62, 0xa5, 0xd3, 0xb5, + 0x89, 0x3a, 0xf3, 0x2b, 0xa7, 0x0f, 0x23, 0x95, 0xd3, 0x77, 0x27, 0x13, 0xbe, 0xf6, 0xc2, 0xe9, + 0x7f, 0xe7, 0xe0, 0xcd, 0x3d, 0x5b, 0x8f, 0x45, 0x78, 0xfc, 0xd8, 0x3f, 0xbd, 0xe3, 0xf8, 0x48, + 0xc4, 0xfa, 0xb9, 0x59, 0x33, 0x58, 0x3c, 0xdc, 0xdf, 0x0e, 0xc2, 0xfd, 0xfc, 0xec, 0xf9, 0x09, + 0x41, 0x8b, 0xf4, 0xa8, 0x11, 0xb3, 0xe0, 0xe3, 0x7e, 0x92, 0xd5, 0x84, 0x21, 0x7f, 0xc3, 0x25, + 0x21, 0x19, 0xce, 0x65, 0x0b, 0xc0, 0xe3, 0xc3, 0x1f, 0xc1, 0xf2, 0xf6, 0x0b, 0xdc, 0xeb, 0x1e, + 0x99, 0xbd, 0x19, 0xe6, 0xa1, 0x06, 0xf9, 0xde, 0x50, 0xe7, 0x09, 0x7f, 0xf2, 0x18, 0x0e, 0x79, + 0xf3, 0xd1, 0x90, 0x57, 0x85, 0x5a, 0xd0, 0x03, 0xb7, 0xe5, 0x93, 0xc4, 0x96, 0x75, 0x82, 0x4c, + 0x98, 0x2f, 0x29, 0xbc, 0xc5, 0xe1, 0xd8, 0x61, 0xb7, 0xaa, 0x18, 0x1c, 0x3b, 0x4e, 0xd4, 0x35, + 0xe6, 0xa3, 0xae, 0x51, 0xfe, 0x63, 0x09, 0xca, 0xa4, 0x87, 0x57, 0x92, 0x9f, 0x9f, 0x2b, 0xf3, + 0xc1, 0xb9, 0xd2, 0x3f, 0x9e, 0x16, 0xc2, 0xc7, 0xd3, 0x40, 0xf2, 0x79, 0x0a, 0x4e, 0x4a, 0xbe, + 0xe0, 0xc3, 0xb1, 0xe3, 0xc8, 0xe7, 0x60, 0x89, 0xc9, 0xc6, 0x47, 0x5e, 0x83, 0xfc, 0xc8, 0x19, + 0x88, 0xf9, 0x1b, 0x39, 0x03, 0xf9, 0xf7, 0x25, 0xa8, 0x34, 0x3d, 0x4f, 0xeb, 0x1d, 0xce, 0x30, + 0x00, 0x5f, 0xb8, 0x5c, 0x58, 0xb8, 0xe4, 0x20, 0x02, 0x71, 0x0b, 0x19, 0xe2, 0xce, 0x47, 0xc4, + 0x95, 0xa1, 0x2a, 0x64, 0xc9, 0x14, 0xb8, 0x0d, 0xa8, 0x63, 0x39, 0xde, 0x03, 0xcb, 0x79, 0xae, + 0x39, 0xfa, 0x6c, 0xc7, 0x4d, 0x04, 0x05, 0xfe, 0xd5, 0x44, 0xfe, 0xf2, 0xbc, 0x42, 0x9f, 0xe5, + 0x4b, 0x70, 0x3c, 0xc2, 0x2f, 0xb3, 0xe3, 0x7b, 0x50, 0xa6, 0x9b, 0x1c, 0x3f, 0x77, 0xdc, 0x08, + 0xd7, 0x65, 0xa7, 0xda, 0x12, 0xe5, 0xff, 0x0f, 0xc7, 0x48, 0x30, 0x44, 0xe1, 0xbe, 0xdf, 0xf9, + 0x7e, 0x2c, 0x28, 0x3f, 0x93, 0xc1, 0x28, 0x16, 0x90, 0xff, 0x46, 0x82, 0x79, 0x0a, 0x4f, 0x04, + 0x28, 0xa7, 0xa1, 0xe4, 0x60, 0xdb, 0x52, 0x3d, 0xad, 0xef, 0x7f, 0xa3, 0x42, 0x00, 0xbb, 0x5a, + 0x9f, 0x16, 0x33, 0xe8, 0x4b, 0xdd, 0xe8, 0x63, 0xd7, 0x13, 0x1f, 0xaa, 0x94, 0x09, 0x6c, 0x8b, + 0x81, 0x88, 0x92, 0x68, 0x99, 0xb0, 0x40, 0xab, 0x81, 0xf4, 0x19, 0xad, 0xb3, 0xcb, 0xbc, 0xd3, + 0x54, 0x87, 0xe8, 0x55, 0xdf, 0x06, 0x14, 0x63, 0x05, 0x1d, 0xbf, 0x8d, 0xae, 0x43, 0x81, 0xa6, + 0x80, 0x17, 0x27, 0xeb, 0x8d, 0x22, 0xca, 0xdb, 0x80, 0xc2, 0x6a, 0xe3, 0x13, 0x74, 0x1d, 0x16, + 0xa8, 0x56, 0x45, 0xec, 0xb8, 0x9a, 0xc1, 0x48, 0xe1, 0x68, 0xb2, 0x06, 0x88, 0x71, 0x8e, 0xc4, + 0x8b, 0xb3, 0x4f, 0xe3, 0x98, 0xf8, 0xf1, 0xaf, 0x25, 0x38, 0x1e, 0xe9, 0x83, 0xcb, 0x7a, 0x2d, + 0xda, 0x49, 0xa6, 0xa8, 0xbc, 0x83, 0xcd, 0xc8, 0x86, 0x79, 0x3d, 0x4b, 0xa4, 0x6f, 0x68, 0xb3, + 0xfc, 0x3b, 0x09, 0xa0, 0x39, 0xf2, 0x0e, 0x79, 0xde, 0x34, 0x3c, 0x95, 0x52, 0x6c, 0x2a, 0x1b, + 0x50, 0xb4, 0x35, 0xd7, 0x7d, 0x6e, 0x39, 0xe2, 0xc4, 0xe7, 0xb7, 0x69, 0x86, 0x73, 0xe4, 0x1d, + 0x8a, 0x32, 0x30, 0x79, 0x46, 0x17, 0xa0, 0xca, 0x3e, 0xa4, 0x52, 0x35, 0x5d, 0x77, 0xb0, 0xeb, + 0xf2, 0x7a, 0x70, 0x85, 0x41, 0x9b, 0x0c, 0x48, 0xd0, 0x0c, 0x5a, 0x16, 0xf0, 0x8e, 0x54, 0xcf, + 0x7a, 0x8a, 0x4d, 0x7e, 0x72, 0xab, 0x08, 0xe8, 0x2e, 0x01, 0xb2, 0xaa, 0x5b, 0xdf, 0x70, 0x3d, + 0x47, 0xa0, 0x89, 0xda, 0x21, 0x87, 0x52, 0x34, 0x32, 0x29, 0xb5, 0xce, 0x68, 0x30, 0x60, 0x2a, + 0x7e, 0xf9, 0x69, 0xff, 0x1e, 0x1f, 0x50, 0x2e, 0x6b, 0x11, 0x04, 0x4a, 0xe3, 0xc3, 0x7d, 0x8d, + 0x29, 0xaa, 0xef, 0xc1, 0xb1, 0xd0, 0x18, 0xb8, 0x59, 0x45, 0x42, 0x6c, 0x29, 0x1a, 0x62, 0xcb, + 0x0f, 0x01, 0xb1, 0xac, 0xcc, 0x2b, 0x8e, 0x5b, 0x3e, 0x01, 0xc7, 0x23, 0x8c, 0xf8, 0xd6, 0x7d, + 0x15, 0x2a, 0xfc, 0x12, 0x24, 0x37, 0x94, 0x53, 0x50, 0x24, 0x2e, 0xb8, 0x67, 0xe8, 0xe2, 0x8e, + 0xc0, 0xa2, 0x6d, 0xe9, 0x9b, 0x86, 0xee, 0xc8, 0x9f, 0x40, 0x85, 0x7f, 0x8d, 0xc1, 0x71, 0x1f, + 0x40, 0x95, 0x5f, 0x99, 0x54, 0x23, 0x97, 0xa1, 0xd3, 0xbe, 0x8d, 0x0a, 0x77, 0xa2, 0x54, 0xcc, + 0x70, 0x53, 0xd6, 0xa1, 0xc1, 0x62, 0x8c, 0x08, 0x7b, 0x31, 0xd8, 0x07, 0x20, 0xee, 0x08, 0x4d, + 0xec, 0x25, 0x4a, 0x5f, 0x71, 0xc2, 0x4d, 0xf9, 0x0c, 0x9c, 0x4e, 0xed, 0x85, 0x6b, 0xc2, 0x86, + 0x5a, 0xf0, 0x82, 0xdd, 0xd8, 0xf5, 0x2f, 0x41, 0x48, 0xa1, 0x4b, 0x10, 0x27, 0xfd, 0x10, 0x3a, + 0x27, 0x76, 0x3d, 0x1a, 0x1f, 0x07, 0x87, 0xa1, 0x7c, 0xd6, 0x61, 0xa8, 0x10, 0x39, 0x0c, 0xc9, + 0x5d, 0x5f, 0x9f, 0xfc, 0x90, 0x7a, 0x9f, 0x1e, 0xa6, 0x59, 0xdf, 0xc2, 0x21, 0xca, 0xe3, 0x46, + 0xc9, 0x50, 0x95, 0x10, 0x95, 0x7c, 0x05, 0x2a, 0x51, 0xd7, 0x18, 0xf2, 0x73, 0x52, 0xc2, 0xcf, + 0x55, 0x63, 0x2e, 0xee, 0xfd, 0xd8, 0xf9, 0x20, 0x5b, 0xc7, 0xb1, 0xd3, 0xc1, 0xdd, 0x88, 0xb3, + 0xbb, 0x9a, 0x52, 0xd3, 0xfe, 0x86, 0xfc, 0xdc, 0x0a, 0xdf, 0x0f, 0x1e, 0xb8, 0x84, 0x9e, 0x0f, + 0x5a, 0x3e, 0x0f, 0xe5, 0xbd, 0xac, 0x6f, 0xeb, 0x0a, 0xe2, 0xe6, 0xd2, 0x4d, 0x58, 0x79, 0x60, + 0x0c, 0xb0, 0x7b, 0xe4, 0x7a, 0x78, 0xd8, 0xa2, 0x4e, 0xe9, 0xc0, 0xc0, 0x0e, 0x3a, 0x0b, 0x40, + 0x0f, 0x78, 0xb6, 0x65, 0xf8, 0x5f, 0x09, 0x85, 0x20, 0xf2, 0x7f, 0x48, 0xb0, 0x1c, 0x10, 0xee, + 0xd1, 0x83, 0xed, 0x1b, 0x50, 0x22, 0xe3, 0x75, 0x3d, 0x6d, 0x68, 0x8b, 0x6a, 0x9f, 0x0f, 0x40, + 0x77, 0x60, 0xfe, 0xc0, 0x15, 0x09, 0xb5, 0xd4, 0xf2, 0x42, 0x9a, 0x20, 0x4a, 0xe1, 0xc0, 0x6d, + 0xe9, 0xe8, 0x03, 0x80, 0x91, 0x8b, 0x75, 0x5e, 0xe1, 0xcb, 0x67, 0x85, 0x17, 0x7b, 0xe1, 0xbb, + 0x1d, 0x84, 0x80, 0x5d, 0x7a, 0xba, 0x0b, 0x65, 0xc3, 0xb4, 0x74, 0x4c, 0xab, 0xbb, 0x3a, 0xcf, + 0xb9, 0x4d, 0x20, 0x07, 0x46, 0xb1, 0xe7, 0x62, 0x5d, 0xc6, 0x7c, 0x2f, 0x14, 0xfa, 0xe5, 0x86, + 0xd2, 0x86, 0x63, 0xcc, 0x69, 0x1d, 0xf8, 0x82, 0x0b, 0x8b, 0x5d, 0x1b, 0x37, 0x3a, 0xaa, 0x2d, + 0xa5, 0x66, 0xf0, 0x58, 0x48, 0x90, 0xca, 0xb7, 0xe1, 0x44, 0xe4, 0xfc, 0x38, 0xc3, 0x81, 0x4e, + 0xee, 0xc4, 0xd2, 0x48, 0x81, 0x39, 0xf3, 0x24, 0x8d, 0xb0, 0xe6, 0x49, 0x49, 0x1a, 0x97, 0x25, + 0x69, 0x5c, 0xf9, 0x73, 0x38, 0x15, 0xc9, 0x77, 0x45, 0x24, 0xba, 0x1b, 0x0b, 0xf5, 0x2e, 0x4e, + 0xe2, 0x1a, 0x8b, 0xf9, 0xfe, 0x4b, 0x82, 0x95, 0x34, 0x84, 0x97, 0xcc, 0xc7, 0xfe, 0x28, 0xe3, + 0x6a, 0xee, 0xad, 0xe9, 0xc4, 0xfa, 0xad, 0xe4, 0xb2, 0x77, 0xa1, 0x91, 0xa6, 0xcf, 0xe4, 0x2c, + 0xe5, 0x67, 0x99, 0xa5, 0x9f, 0xe7, 0x43, 0x75, 0x89, 0xa6, 0xe7, 0x39, 0xc6, 0xfe, 0x88, 0x98, + 0xfc, 0x6b, 0xcf, 0xf5, 0xb5, 0xfc, 0xac, 0x15, 0x53, 0xed, 0x8d, 0x31, 0xe4, 0x81, 0x1c, 0xa9, + 0x99, 0xab, 0x4f, 0xd3, 0x0e, 0xfd, 0x37, 0xa7, 0xe3, 0xf7, 0x9d, 0x4d, 0x0f, 0xff, 0x3c, 0x07, + 0xd5, 0xe8, 0x14, 0xa1, 0x6d, 0x00, 0xcd, 0x97, 0x9c, 0x2f, 0x94, 0x0b, 0x53, 0x0d, 0x53, 0x09, + 0x11, 0xa2, 0x77, 0x20, 0xdf, 0xb3, 0x47, 0x7c, 0xd6, 0x52, 0x4a, 0xe5, 0x9b, 0xf6, 0x88, 0x79, + 0x14, 0x82, 0x46, 0x0e, 0x61, 0xec, 0xe6, 0x43, 0xb6, 0x97, 0x7c, 0x42, 0xdf, 0x33, 0x1a, 0x8e, + 0x8c, 0x1e, 0x41, 0xf5, 0xb9, 0x63, 0x78, 0xda, 0xfe, 0x00, 0xab, 0x03, 0xed, 0x08, 0x3b, 0xdc, + 0x4b, 0x4e, 0xe1, 0xc8, 0x2a, 0x82, 0xf0, 0x31, 0xa1, 0x93, 0x7f, 0x0f, 0x8a, 0x42, 0xa2, 0x09, + 0x3b, 0xc2, 0x2e, 0xac, 0x8e, 0x08, 0x9a, 0x4a, 0x2f, 0xa3, 0x9a, 0x9a, 0x69, 0xa9, 0x2e, 0x26, + 0xdb, 0xb8, 0xf8, 0x12, 0x68, 0x82, 0x8b, 0x5e, 0xa1, 0xd4, 0x9b, 0x96, 0x83, 0xdb, 0x9a, 0x69, + 0x75, 0x19, 0xa9, 0xfc, 0x0c, 0xca, 0xa1, 0x01, 0x4e, 0x10, 0xa1, 0x05, 0xc7, 0xc4, 0x45, 0x05, + 0x17, 0x7b, 0x7c, 0x7b, 0x99, 0xaa, 0xf3, 0x65, 0x4e, 0xd7, 0xc5, 0x1e, 0xbb, 0x5c, 0x72, 0x17, + 0x4e, 0x29, 0xd8, 0xb2, 0xb1, 0xe9, 0xcf, 0xe7, 0x63, 0xab, 0x3f, 0x83, 0x07, 0x7f, 0x03, 0x1a, + 0x69, 0xf4, 0xcc, 0x3f, 0x5c, 0xbd, 0x08, 0x45, 0xf1, 0x2f, 0x0a, 0x68, 0x11, 0xf2, 0xbb, 0x9b, + 0x9d, 0xda, 0x1c, 0x79, 0xd8, 0xdb, 0xea, 0xd4, 0x24, 0x54, 0x84, 0x42, 0x77, 0x73, 0xb7, 0x53, + 0xcb, 0x5d, 0x1d, 0x42, 0x2d, 0xfe, 0x17, 0x02, 0x68, 0x15, 0x8e, 0x77, 0x94, 0x9d, 0x4e, 0xf3, + 0x61, 0x73, 0xb7, 0xb5, 0xd3, 0x56, 0x3b, 0x4a, 0xeb, 0xe3, 0xe6, 0xee, 0x76, 0x6d, 0x0e, 0xad, + 0xc1, 0x99, 0xf0, 0x8b, 0x47, 0x3b, 0xdd, 0x5d, 0x75, 0x77, 0x47, 0xdd, 0xdc, 0x69, 0xef, 0x36, + 0x5b, 0xed, 0x6d, 0xa5, 0x26, 0xa1, 0x33, 0x70, 0x2a, 0x8c, 0x72, 0xbf, 0xb5, 0xd5, 0x52, 0xb6, + 0x37, 0xc9, 0x73, 0xf3, 0x71, 0x2d, 0x77, 0xf5, 0x43, 0xa8, 0x44, 0xbe, 0xf8, 0x27, 0x22, 0x75, + 0x76, 0xb6, 0x6a, 0x73, 0xa8, 0x02, 0xa5, 0x30, 0x9f, 0x22, 0x14, 0xda, 0x3b, 0x5b, 0xdb, 0xb5, + 0x1c, 0x02, 0x58, 0xd8, 0x6d, 0x2a, 0x0f, 0xb7, 0x77, 0x6b, 0xf9, 0xab, 0xb7, 0x61, 0x39, 0x76, + 0xbb, 0x1f, 0x1d, 0x83, 0x4a, 0xb7, 0xd9, 0xde, 0xba, 0xbf, 0xf3, 0xa9, 0xaa, 0x6c, 0x37, 0xb7, + 0x3e, 0xab, 0xcd, 0xa1, 0x15, 0xa8, 0x09, 0x50, 0x7b, 0x67, 0x97, 0x41, 0xa5, 0xab, 0x4f, 0x63, + 0xeb, 0x0d, 0xa3, 0x13, 0x70, 0xcc, 0xef, 0x52, 0xdd, 0x54, 0xb6, 0x9b, 0xbb, 0xdb, 0x44, 0x92, + 0x08, 0x58, 0xd9, 0x6b, 0xb7, 0x5b, 0xed, 0x87, 0x35, 0x89, 0x70, 0x0d, 0xc0, 0xdb, 0x9f, 0xb6, + 0x08, 0x72, 0x2e, 0x8a, 0xbc, 0xd7, 0xfe, 0x41, 0x7b, 0xe7, 0x93, 0x76, 0x2d, 0xbf, 0xf1, 0xcb, + 0x63, 0xfe, 0x57, 0xd8, 0x5d, 0xec, 0xd0, 0xfb, 0x3f, 0x1d, 0x58, 0x14, 0xff, 0xd0, 0x91, 0xe2, + 0xad, 0xa3, 0xff, 0x2b, 0xd2, 0x58, 0x1b, 0x83, 0xc1, 0x63, 0xef, 0x39, 0xb4, 0x4f, 0x63, 0xe1, + 0xd0, 0xd7, 0x16, 0x17, 0x53, 0x23, 0xcf, 0xc4, 0x07, 0x1e, 0x8d, 0x4b, 0x13, 0xf1, 0xfc, 0x3e, + 0x30, 0x09, 0x77, 0xc3, 0x1f, 0x34, 0xa2, 0x4b, 0x69, 0x71, 0x6a, 0xca, 0x17, 0x93, 0x8d, 0xcb, + 0x93, 0x11, 0xfd, 0x6e, 0x9e, 0x42, 0x2d, 0xfe, 0x71, 0x23, 0x4a, 0x49, 0x32, 0x67, 0x7c, 0x41, + 0xd9, 0xb8, 0x3a, 0x0d, 0x6a, 0xb8, 0xb3, 0xc4, 0xd7, 0x7a, 0x57, 0xa6, 0xf9, 0xaa, 0x29, 0xb3, + 0xb3, 0xac, 0x0f, 0xa0, 0x98, 0x02, 0xa3, 0x1f, 0x48, 0xa0, 0xd4, 0x4f, 0xe3, 0x52, 0xbe, 0xc3, + 0x49, 0x53, 0x60, 0xfa, 0xb7, 0x16, 0xf2, 0x1c, 0x3a, 0x84, 0xe5, 0xd8, 0x45, 0x0e, 0x94, 0x42, + 0x9e, 0x7e, 0x63, 0xa5, 0x71, 0x65, 0x0a, 0xcc, 0xa8, 0x45, 0x84, 0x2f, 0x6e, 0xa4, 0x5b, 0x44, + 0xca, 0xb5, 0x90, 0x74, 0x8b, 0x48, 0xbd, 0x03, 0x42, 0x8d, 0x3b, 0x72, 0x61, 0x23, 0xcd, 0xb8, + 0xd3, 0xae, 0x89, 0x34, 0x2e, 0x4d, 0xc4, 0x0b, 0x2b, 0x2d, 0x76, 0x7d, 0x23, 0x4d, 0x69, 0xe9, + 0xd7, 0x43, 0x1a, 0x57, 0xa6, 0xc0, 0x8c, 0x5b, 0x41, 0x50, 0x0c, 0xce, 0xb2, 0x82, 0xc4, 0xd5, + 0x85, 0x2c, 0x2b, 0x48, 0xd6, 0x95, 0xb9, 0x15, 0xc4, 0x8a, 0xb8, 0x97, 0xa7, 0x28, 0x3a, 0x65, + 0x5b, 0x41, 0x7a, 0x79, 0x4a, 0x9e, 0x43, 0x3f, 0x93, 0xa0, 0x9e, 0x55, 0xe3, 0x40, 0x37, 0x66, + 0x2e, 0xc8, 0x34, 0x36, 0x66, 0x21, 0xf1, 0xa5, 0xf8, 0x12, 0x50, 0x72, 0x0f, 0x44, 0x6f, 0xa7, + 0xcd, 0x4c, 0xc6, 0x4e, 0xdb, 0x78, 0x67, 0x3a, 0x64, 0xbf, 0xcb, 0x2e, 0x14, 0x45, 0x55, 0x05, + 0xa5, 0x78, 0xe9, 0x58, 0x4d, 0xa7, 0x21, 0x8f, 0x43, 0xf1, 0x99, 0x3e, 0x84, 0x02, 0x81, 0xa2, + 0x33, 0xe9, 0xd8, 0x82, 0xd9, 0xd9, 0xac, 0xd7, 0x3e, 0xa3, 0x27, 0xb0, 0xc0, 0xca, 0x08, 0x28, + 0x25, 0x0b, 0x11, 0x29, 0x76, 0x34, 0xce, 0x65, 0x23, 0xf8, 0xec, 0xbe, 0x60, 0x7f, 0xde, 0xc4, + 0x2b, 0x04, 0xe8, 0xad, 0xf4, 0xff, 0x68, 0x88, 0x16, 0x24, 0x1a, 0x17, 0x26, 0x60, 0x85, 0x17, + 0x45, 0x2c, 0x02, 0xbe, 0x34, 0xf1, 0x18, 0x93, 0xbd, 0x28, 0xd2, 0x0f, 0x4a, 0xcc, 0x48, 0x92, + 0x07, 0xa9, 0x34, 0x23, 0xc9, 0x3c, 0xbe, 0xa6, 0x19, 0x49, 0xf6, 0xd9, 0x4c, 0x9e, 0x43, 0x1e, + 0x1c, 0x4f, 0x49, 0x9b, 0xa1, 0x77, 0xb2, 0x8c, 0x3c, 0x2d, 0x87, 0xd7, 0xb8, 0x36, 0x25, 0x76, + 0x78, 0xf2, 0xf9, 0xa2, 0x7f, 0x33, 0x3b, 0x97, 0x94, 0x39, 0xf9, 0xf1, 0x25, 0xbe, 0xf1, 0x2f, + 0x79, 0x58, 0x62, 0x29, 0x51, 0x1e, 0xc1, 0x7c, 0x06, 0x10, 0x54, 0x23, 0xd0, 0xf9, 0x74, 0x9d, + 0x44, 0x4a, 0x3c, 0x8d, 0xb7, 0xc6, 0x23, 0x85, 0x0d, 0x2d, 0x94, 0xd9, 0x4f, 0x33, 0xb4, 0x64, + 0x01, 0x23, 0xcd, 0xd0, 0x52, 0xca, 0x03, 0xf2, 0x1c, 0xfa, 0x18, 0x4a, 0x7e, 0x0a, 0x19, 0xa5, + 0xa5, 0xa0, 0x63, 0x39, 0xf2, 0xc6, 0xf9, 0xb1, 0x38, 0x61, 0xa9, 0x43, 0xf9, 0xe1, 0x34, 0xa9, + 0x93, 0x79, 0xe8, 0x34, 0xa9, 0xd3, 0x92, 0xcc, 0x81, 0x4e, 0x58, 0x16, 0x29, 0x53, 0x27, 0x91, + 0x24, 0x5e, 0xa6, 0x4e, 0xa2, 0xa9, 0x28, 0x79, 0xee, 0xfe, 0xc5, 0x5f, 0x7d, 0x75, 0x56, 0xfa, + 0xa7, 0xaf, 0xce, 0xce, 0xfd, 0xf4, 0xeb, 0xb3, 0xd2, 0xaf, 0xbe, 0x3e, 0x2b, 0xfd, 0xc3, 0xd7, + 0x67, 0xa5, 0x7f, 0xfd, 0xfa, 0xac, 0xf4, 0x07, 0xff, 0x76, 0x76, 0xee, 0x87, 0x45, 0x41, 0xbd, + 0xbf, 0x40, 0xff, 0x82, 0xed, 0xdd, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x86, 0xf5, 0x30, + 0x48, 0x4f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -9204,6 +9345,18 @@ func (m *PodSandboxConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Windows != nil { + { + size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } if m.Linux != nil { { size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) @@ -10494,21 +10647,21 @@ func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, dAtA[i] = 0x4a } if len(m.SupplementalGroups) > 0 { - dAtA27 := make([]byte, len(m.SupplementalGroups)*10) - var j26 int + dAtA28 := make([]byte, len(m.SupplementalGroups)*10) + var j27 int for _, num1 := range m.SupplementalGroups { num := uint64(num1) for num >= 1<<7 { - dAtA27[j26] = uint8(uint64(num)&0x7f | 0x80) + dAtA28[j27] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j26++ + j27++ } - dAtA27[j26] = uint8(num) - j26++ + dAtA28[j27] = uint8(num) + j27++ } - i -= j26 - copy(dAtA[i:], dAtA27[:j26]) - i = encodeVarintApi(dAtA, i, uint64(j26)) + i -= j27 + copy(dAtA[i:], dAtA28[:j27]) + i = encodeVarintApi(dAtA, i, uint64(j27)) i-- dAtA[i] = 0x42 } @@ -10637,7 +10790,7 @@ func (m *LinuxContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *WindowsContainerSecurityContext) Marshal() (dAtA []byte, err error) { +func (m *WindowsSandboxSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10647,16 +10800,26 @@ func (m *WindowsContainerSecurityContext) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WindowsContainerSecurityContext) MarshalTo(dAtA []byte) (int, error) { +func (m *WindowsSandboxSecurityContext) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WindowsContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WindowsSandboxSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.HostProcess { + i-- + if m.HostProcess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } if len(m.CredentialSpec) > 0 { i -= len(m.CredentialSpec) copy(dAtA[i:], m.CredentialSpec) @@ -10674,7 +10837,7 @@ func (m *WindowsContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } -func (m *WindowsContainerConfig) Marshal() (dAtA []byte, err error) { +func (m *WindowsPodSandboxConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10684,12 +10847,12 @@ func (m *WindowsContainerConfig) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WindowsContainerConfig) MarshalTo(dAtA []byte) (int, error) { +func (m *WindowsPodSandboxConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WindowsContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WindowsPodSandboxConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -10704,17 +10867,99 @@ func (m *WindowsContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } - if m.Resources != nil { - { - size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + return len(dAtA) - i, nil +} + +func (m *WindowsContainerSecurityContext) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WindowsContainerSecurityContext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HostProcess { + i-- + if m.HostProcess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.CredentialSpec) > 0 { + i -= len(m.CredentialSpec) + copy(dAtA[i:], m.CredentialSpec) + i = encodeVarintApi(dAtA, i, uint64(len(m.CredentialSpec))) + i-- + dAtA[i] = 0x12 + } + if len(m.RunAsUsername) > 0 { + i -= len(m.RunAsUsername) + copy(dAtA[i:], m.RunAsUsername) + i = encodeVarintApi(dAtA, i, uint64(len(m.RunAsUsername))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WindowsContainerConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WindowsContainerConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Resources != nil { + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } @@ -12255,21 +12500,21 @@ func (m *PortForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.Port) > 0 { - dAtA52 := make([]byte, len(m.Port)*10) - var j51 int + dAtA54 := make([]byte, len(m.Port)*10) + var j53 int for _, num1 := range m.Port { num := uint64(num1) for num >= 1<<7 { - dAtA52[j51] = uint8(uint64(num)&0x7f | 0x80) + dAtA54[j53] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j51++ + j53++ } - dAtA52[j51] = uint8(num) - j51++ + dAtA54[j53] = uint8(num) + j53++ } - i -= j51 - copy(dAtA[i:], dAtA52[:j51]) - i = encodeVarintApi(dAtA, i, uint64(j51)) + i -= j53 + copy(dAtA[i:], dAtA54[:j53]) + i = encodeVarintApi(dAtA, i, uint64(j53)) i-- dAtA[i] = 0x12 } @@ -14096,6 +14341,10 @@ func (m *PodSandboxConfig) Size() (n int) { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } + if m.Windows != nil { + l = m.Windows.Size() + n += 1 + l + sovApi(uint64(l)) + } return n } @@ -14659,6 +14908,39 @@ func (m *LinuxContainerConfig) Size() (n int) { return n } +func (m *WindowsSandboxSecurityContext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RunAsUsername) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.CredentialSpec) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.HostProcess { + n += 2 + } + return n +} + +func (m *WindowsPodSandboxConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + func (m *WindowsContainerSecurityContext) Size() (n int) { if m == nil { return 0 @@ -14673,6 +14955,9 @@ func (m *WindowsContainerSecurityContext) Size() (n int) { if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if m.HostProcess { + n += 2 + } return n } @@ -16153,6 +16438,7 @@ func (this *PodSandboxConfig) String() string { `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `Linux:` + strings.Replace(this.Linux.String(), "LinuxPodSandboxConfig", "LinuxPodSandboxConfig", 1) + `,`, + `Windows:` + strings.Replace(this.Windows.String(), "WindowsPodSandboxConfig", "WindowsPodSandboxConfig", 1) + `,`, `}`, }, "") return s @@ -16550,6 +16836,28 @@ func (this *LinuxContainerConfig) String() string { }, "") return s } +func (this *WindowsSandboxSecurityContext) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WindowsSandboxSecurityContext{`, + `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, + `CredentialSpec:` + fmt.Sprintf("%v", this.CredentialSpec) + `,`, + `HostProcess:` + fmt.Sprintf("%v", this.HostProcess) + `,`, + `}`, + }, "") + return s +} +func (this *WindowsPodSandboxConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WindowsPodSandboxConfig{`, + `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "WindowsSandboxSecurityContext", "WindowsSandboxSecurityContext", 1) + `,`, + `}`, + }, "") + return s +} func (this *WindowsContainerSecurityContext) String() string { if this == nil { return "nil" @@ -16557,6 +16865,7 @@ func (this *WindowsContainerSecurityContext) String() string { s := strings.Join([]string{`&WindowsContainerSecurityContext{`, `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, `CredentialSpec:` + fmt.Sprintf("%v", this.CredentialSpec) + `,`, + `HostProcess:` + fmt.Sprintf("%v", this.HostProcess) + `,`, `}`, }, "") return s @@ -19847,6 +20156,42 @@ func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Windows", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Windows == nil { + m.Windows = &WindowsPodSandboxConfig{} + } + if err := m.Windows.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -24136,6 +24481,226 @@ func (m *LinuxContainerConfig) Unmarshal(dAtA []byte) error { } return nil } +func (m *WindowsSandboxSecurityContext) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WindowsSandboxSecurityContext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WindowsSandboxSecurityContext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAsUsername", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunAsUsername = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialSpec", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CredentialSpec = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostProcess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HostProcess = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WindowsPodSandboxConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WindowsPodSandboxConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WindowsPodSandboxConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &WindowsSandboxSecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *WindowsContainerSecurityContext) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -24229,6 +24794,26 @@ func (m *WindowsContainerSecurityContext) Unmarshal(dAtA []byte) error { } m.CredentialSpec = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostProcess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HostProcess = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) diff --git a/cluster-autoscaler/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto b/cluster-autoscaler/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto index a8701692f6cf..ea4069981d59 100644 --- a/cluster-autoscaler/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto +++ b/cluster-autoscaler/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto @@ -392,6 +392,8 @@ message PodSandboxConfig { map annotations = 7; // Optional configurations specific to Linux hosts. LinuxPodSandboxConfig linux = 8; + // Optional configurations specific to Windows hosts. + WindowsPodSandboxConfig windows = 9; } message RunPodSandboxRequest { @@ -401,7 +403,7 @@ message RunPodSandboxRequest { // If the runtime handler is unknown, this request should be rejected. An // empty string should select the default handler, equivalent to the // behavior before this feature was added. - // See https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md + // See https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class string runtime_handler = 2; } @@ -693,6 +695,29 @@ message LinuxContainerConfig { LinuxContainerSecurityContext security_context = 2; } +// WindowsSandboxSecurityContext holds platform-specific configurations that will be +// applied to a sandbox. +// These settings will only apply to the sandbox container. +message WindowsSandboxSecurityContext { + // User name to run the container process as. If specified, the user MUST + // exist in the container image and be resolved there by the runtime; + // otherwise, the runtime MUST return error. + string run_as_username = 1; + + // The contents of the GMSA credential spec to use to run this container. + string credential_spec = 2; + + // Indicates whether the container be asked to run as a HostProcess container. + bool host_process = 3; +} + +// WindowsPodSandboxConfig holds platform-specific configurations for Windows +// host platforms and Windows-based containers. +message WindowsPodSandboxConfig { + // WindowsSandboxSecurityContext holds sandbox security attributes. + WindowsSandboxSecurityContext security_context = 1; +} + // WindowsContainerSecurityContext holds windows security configuration that will be applied to a container. message WindowsContainerSecurityContext { // User name to run the container process as. If specified, the user MUST @@ -702,6 +727,9 @@ message WindowsContainerSecurityContext { // The contents of the GMSA credential spec to use to run this container. string credential_spec = 2; + + // Indicates whether a container is to be run as a HostProcess container. + bool host_process = 3; } // WindowsContainerConfig contains platform-specific configuration for diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.mod b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.mod index 1ed4737c4aaa..e2ad6ae36eee 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.mod +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.mod @@ -5,13 +5,13 @@ module k8s.io/csi-translation-lib go 1.16 require ( - github.com/stretchr/testify v1.6.1 - k8s.io/api v0.22.0-alpha.1 - k8s.io/apimachinery v0.22.0-alpha.1 - k8s.io/klog/v2 v2.8.0 + github.com/stretchr/testify v1.7.0 + k8s.io/api v0.22.0-alpha.3 + k8s.io/apimachinery v0.22.0-alpha.3 + k8s.io/klog/v2 v2.9.0 ) replace ( - k8s.io/api => k8s.io/api v0.22.0-alpha.1 - k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.1 + k8s.io/api => k8s.io/api v0.22.0-alpha.3 + k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.3 ) diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.sum b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.sum index dacbd19fdd05..288ee1c56896 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.sum +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/go.sum @@ -15,8 +15,9 @@ github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkg github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= @@ -43,8 +44,8 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -80,11 +81,14 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= 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= @@ -96,8 +100,8 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -119,6 +123,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -132,16 +137,20 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h 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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -183,7 +192,9 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/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= @@ -191,14 +202,14 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclp gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.22.0-alpha.1 h1:LuUYyELM7hm5I7B8pjn8dhZHQTcw86C/bFBNNu0/QoY= -k8s.io/api v0.22.0-alpha.1/go.mod h1:vQHAkhGeeRA6zI8QNe3tcuQqGXanfyk6mehgpyIHcpY= -k8s.io/apimachinery v0.22.0-alpha.1 h1:5H8J1su7o60La1W4iOytFrsn2DeRxd9NXVxulXWOdOE= -k8s.io/apimachinery v0.22.0-alpha.1/go.mod h1:fBRSkoylGO2QUTae8Wb2wac6pZ83/r+tL6HFSXGbzfs= +k8s.io/api v0.22.0-alpha.3 h1:rE7mI2nvuTyiSo3+C7iiVxWh1lmOqBTUVLloX+c9s4c= +k8s.io/api v0.22.0-alpha.3/go.mod h1:1XKmwk4lbdJRku2EqAElh5amCLsl9JvjSbQzUteQ1ac= +k8s.io/apimachinery v0.22.0-alpha.3 h1:VIzKYyrRYpaPQDwhH6SZVy/04OR69ZKhovidSU+KjvY= +k8s.io/apimachinery v0.22.0-alpha.3/go.mod h1:5zcgojGmAy5Bo3S4mgZWAt6HwoKzaSh4MV3ITvlcOVM= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= +k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.1 h1:nYqY2A6oy37sKLYuSBXuQhbj4JVclzJK13BOIvJG5XU= diff --git a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go index a5c32013f90d..3b3dbac1f63a 100644 --- a/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go +++ b/cluster-autoscaler/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go @@ -36,6 +36,14 @@ const ( AWSEBSInTreePluginName = "kubernetes.io/aws-ebs" // AWSEBSTopologyKey is the zonal topology key for AWS EBS CSI driver AWSEBSTopologyKey = "topology." + AWSEBSDriverName + "/zone" + // iopsPerGBKey is StorageClass parameter name that specifies IOPS + // Per GB. + iopsPerGBKey = "iopspergb" + // allowIncreaseIOPSKey is parameter name that allows the CSI driver + // to increase IOPS to the minimum value supported by AWS when IOPS + // Per GB is too low for a given volume size. This preserves current + // in-tree volume plugin behavior. + allowIncreaseIOPSKey = "allowautoiopspergbincrease" ) var _ InTreePlugin = &awsElasticBlockStoreCSITranslator{} @@ -62,6 +70,12 @@ func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeStorageClassToCSI(sc generatedTopologies = generateToplogySelectors(AWSEBSTopologyKey, []string{v}) case zonesKey: generatedTopologies = generateToplogySelectors(AWSEBSTopologyKey, strings.Split(v, ",")) + case iopsPerGBKey: + // Keep iopsPerGBKey + params[k] = v + // Preserve current in-tree volume plugin behavior and allow the CSI + // driver to bump volume IOPS when volume size * iopsPerGB is too low. + params[allowIncreaseIOPSKey] = "true" default: params[k] = v } diff --git a/cluster-autoscaler/vendor/k8s.io/klog/v2/klog.go b/cluster-autoscaler/vendor/k8s.io/klog/v2/klog.go index 25483fad1388..1e187f76354b 100644 --- a/cluster-autoscaler/vendor/k8s.io/klog/v2/klog.go +++ b/cluster-autoscaler/vendor/k8s.io/klog/v2/klog.go @@ -284,6 +284,7 @@ func (m *moduleSpec) Get() interface{} { var errVmoduleSyntax = errors.New("syntax error: expect comma-separated list of filename=N") +// Set will sets module value // Syntax: -vmodule=recordio=2,file=1,gfs*=3 func (m *moduleSpec) Set(value string) error { var filter []modulePat @@ -362,6 +363,7 @@ func (t *traceLocation) Get() interface{} { var errTraceSyntax = errors.New("syntax error: expect file.go:234") +// Set will sets backtrace value // Syntax: -log_backtrace_at=gopherflakes.go:234 // Note that unlike vmodule the file extension is included here. func (t *traceLocation) Set(value string) error { @@ -708,7 +710,7 @@ func (l *loggingT) println(s severity, logr logr.Logger, filter LogFilter, args args = filter.Filter(args) } fmt.Fprintln(buf, args...) - l.output(s, logr, buf, file, line, false) + l.output(s, logr, buf, 0 /* depth */, file, line, false) } func (l *loggingT) print(s severity, logr logr.Logger, filter LogFilter, args ...interface{}) { @@ -730,7 +732,7 @@ func (l *loggingT) printDepth(s severity, logr logr.Logger, filter LogFilter, de if buf.Bytes()[buf.Len()-1] != '\n' { buf.WriteByte('\n') } - l.output(s, logr, buf, file, line, false) + l.output(s, logr, buf, depth, file, line, false) } func (l *loggingT) printf(s severity, logr logr.Logger, filter LogFilter, format string, args ...interface{}) { @@ -748,7 +750,7 @@ func (l *loggingT) printf(s severity, logr logr.Logger, filter LogFilter, format if buf.Bytes()[buf.Len()-1] != '\n' { buf.WriteByte('\n') } - l.output(s, logr, buf, file, line, false) + l.output(s, logr, buf, 0 /* depth */, file, line, false) } // printWithFileLine behaves like print but uses the provided file and line number. If @@ -769,7 +771,7 @@ func (l *loggingT) printWithFileLine(s severity, logr logr.Logger, filter LogFil if buf.Bytes()[buf.Len()-1] != '\n' { buf.WriteByte('\n') } - l.output(s, logr, buf, file, line, alsoToStderr) + l.output(s, logr, buf, 2 /* depth */, file, line, alsoToStderr) } // if loggr is specified, will call loggr.Error, otherwise output with logging module. @@ -778,7 +780,7 @@ func (l *loggingT) errorS(err error, loggr logr.Logger, filter LogFilter, depth msg, keysAndValues = filter.FilterS(msg, keysAndValues) } if loggr != nil { - loggr.Error(err, msg, keysAndValues...) + logr.WithCallDepth(loggr, depth+2).Error(err, msg, keysAndValues...) return } l.printS(err, errorLog, depth+1, msg, keysAndValues...) @@ -790,7 +792,7 @@ func (l *loggingT) infoS(loggr logr.Logger, filter LogFilter, depth int, msg str msg, keysAndValues = filter.FilterS(msg, keysAndValues) } if loggr != nil { - loggr.Info(msg, keysAndValues...) + logr.WithCallDepth(loggr, depth+2).Info(msg, keysAndValues...) return } l.printS(nil, infoLog, depth+1, msg, keysAndValues...) @@ -825,6 +827,8 @@ func kvListFormat(b *bytes.Buffer, keysAndValues ...interface{}) { switch v.(type) { case string, error: b.WriteString(fmt.Sprintf("%s=%q", k, v)) + case []byte: + b.WriteString(fmt.Sprintf("%s=%+q", k, v)) default: if _, ok := v.(fmt.Stringer); ok { b.WriteString(fmt.Sprintf("%s=%q", k, v)) @@ -855,12 +859,13 @@ func (rb *redirectBuffer) Write(bytes []byte) (n int, err error) { // SetLogger will set the backing logr implementation for klog. // If set, all log lines will be suppressed from the regular Output, and // redirected to the logr implementation. -// All log lines include the 'severity', 'file' and 'line' values attached as -// structured logging values. // Use as: // ... // klog.SetLogger(zapr.NewLogger(zapLog)) func SetLogger(logr logr.Logger) { + logging.mu.Lock() + defer logging.mu.Unlock() + logging.logr = logr } @@ -899,7 +904,7 @@ func LogToStderr(stderr bool) { } // output writes the data to the log files and releases the buffer. -func (l *loggingT) output(s severity, log logr.Logger, buf *buffer, file string, line int, alsoToStderr bool) { +func (l *loggingT) output(s severity, log logr.Logger, buf *buffer, depth int, file string, line int, alsoToStderr bool) { l.mu.Lock() if l.traceLocation.isSet() { if l.traceLocation.match(file, line) { @@ -911,9 +916,9 @@ func (l *loggingT) output(s severity, log logr.Logger, buf *buffer, file string, // TODO: set 'severity' and caller information as structured log info // keysAndValues := []interface{}{"severity", severityName[s], "file", file, "line", line} if s == errorLog { - l.logr.Error(nil, string(data)) + logr.WithCallDepth(l.logr, depth+3).Error(nil, string(data)) } else { - log.Info(string(data)) + logr.WithCallDepth(log, depth+3).Info(string(data)) } } else if l.toStderr { os.Stderr.Write(data) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go index f7b57b2582bc..055e9cb3d7b7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go @@ -750,7 +750,7 @@ func (s *ProxyServer) Run() error { // functions must configure their shared informer event handlers first. informerFactory.Start(wait.NeverStop) - if utilfeature.DefaultFeatureGate.Enabled(features.ServiceTopology) || utilfeature.DefaultFeatureGate.Enabled(features.TopologyAwareHints) { + if utilfeature.DefaultFeatureGate.Enabled(features.TopologyAwareHints) { // Make an informer that selects for our nodename. currentNodeInformerFactory := informers.NewSharedInformerFactoryWithOptions(s.Client, s.ConfigSyncPeriod, informers.WithTweakListOptions(func(options *metav1.ListOptions) { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/container_runtime.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/container_runtime.go index a3be109f6493..e557c113e527 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/container_runtime.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/container_runtime.go @@ -28,7 +28,7 @@ import ( const ( // When these values are updated, also update test/utils/image/manifest.go defaultPodSandboxImageName = "k8s.gcr.io/pause" - defaultPodSandboxImageVersion = "3.4.1" + defaultPodSandboxImageVersion = "3.5" ) var ( diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go index 2cd28ac56b4a..f084dfa25843 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go @@ -528,8 +528,8 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig fs.StringVar(&c.ReservedSystemCPUs, "reserved-cpus", c.ReservedSystemCPUs, "A comma-separated list of CPUs or CPU ranges that are reserved for system and kubernetes usage. This specific list will supersede cpu counts in --system-reserved and --kube-reserved.") fs.StringVar(&c.TopologyManagerScope, "topology-manager-scope", c.TopologyManagerScope, "Scope to which topology hints applied. Topology Manager collects hints from Hint Providers and applies them to defined scope to ensure the pod admission. Possible values: 'container', 'pod'.") // Node Allocatable Flags - fs.Var(cliflag.NewMapStringString(&c.SystemReserved), "system-reserved", "A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=500Mi,ephemeral-storage=1Gi) pairs that describe resources reserved for non-kubernetes components. Currently only cpu and memory are supported. See http://kubernetes.io/docs/user-guide/compute-resources for more detail. [default=none]") - fs.Var(cliflag.NewMapStringString(&c.KubeReserved), "kube-reserved", "A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=500Mi,ephemeral-storage=1Gi) pairs that describe resources reserved for kubernetes system components. Currently cpu, memory and local ephemeral storage for root file system are supported. See http://kubernetes.io/docs/user-guide/compute-resources for more detail. [default=none]") + fs.Var(cliflag.NewMapStringString(&c.SystemReserved), "system-reserved", "A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=500Mi,ephemeral-storage=1Gi) pairs that describe resources reserved for non-kubernetes components. Currently only cpu and memory are supported. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more detail. [default=none]") + fs.Var(cliflag.NewMapStringString(&c.KubeReserved), "kube-reserved", "A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=500Mi,ephemeral-storage=1Gi) pairs that describe resources reserved for kubernetes system components. Currently cpu, memory and local ephemeral storage for root file system are supported. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more detail. [default=none]") fs.StringSliceVar(&c.EnforceNodeAllocatable, "enforce-node-allocatable", c.EnforceNodeAllocatable, "A comma separated list of levels of node allocatable enforcement to be enforced by kubelet. Acceptable options are 'none', 'pods', 'system-reserved', and 'kube-reserved'. If the latter two options are specified, '--system-reserved-cgroup' and '--kube-reserved-cgroup' must also be set, respectively. If 'none' is specified, no additional options should be set. See https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/ for more details.") fs.StringVar(&c.SystemReservedCgroup, "system-reserved-cgroup", c.SystemReservedCgroup, "Absolute name of the top level cgroup that is used to manage non-kubernetes components for which compute resources were reserved via '--system-reserved' flag. Ex. '/system-reserved'. [default='']") fs.StringVar(&c.KubeReservedCgroup, "kube-reserved-cgroup", c.KubeReservedCgroup, "Absolute name of the top level cgroup that is used to manage kubernetes components for which compute resources were reserved via '--kube-reserved' flag. Ex. '/kube-reserved'. [default='']") diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go index dc5125295c87..a5c536cd59bf 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go @@ -41,7 +41,6 @@ import ( "k8s.io/kubernetes/pkg/volume/projected" "k8s.io/kubernetes/pkg/volume/quobyte" "k8s.io/kubernetes/pkg/volume/rbd" - "k8s.io/kubernetes/pkg/volume/scaleio" "k8s.io/kubernetes/pkg/volume/secret" "k8s.io/kubernetes/pkg/volume/storageos" @@ -80,7 +79,6 @@ func ProbeVolumePlugins(featureGate featuregate.FeatureGate) ([]volume.VolumePlu allPlugins = append(allPlugins, configmap.ProbeVolumePlugins()...) allPlugins = append(allPlugins, projected.ProbeVolumePlugins()...) allPlugins = append(allPlugins, portworx.ProbeVolumePlugins()...) - allPlugins = append(allPlugins, scaleio.ProbeVolumePlugins()...) allPlugins = append(allPlugins, local.ProbeVolumePlugins()...) allPlugins = append(allPlugins, storageos.ProbeVolumePlugins()...) allPlugins = append(allPlugins, csi.ProbeVolumePlugins()...) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins_providers.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins_providers.go index 7261cd13b6a8..98564409de32 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins_providers.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins_providers.go @@ -42,20 +42,14 @@ type probeFn func() []volume.VolumePlugin func appendPluginBasedOnFeatureFlags(plugins []volume.VolumePlugin, inTreePluginName string, featureGate featuregate.FeatureGate, pluginInfo pluginInfo) ([]volume.VolumePlugin, error) { - // Skip appending the in-tree plugin to the list of plugins to be probed/initialized - // if the CSIMigration feature flag and plugin specific feature flag indicating - // CSI migration is complete - migrationComplete, err := csimigration.CheckMigrationFeatureFlags(featureGate, pluginInfo.pluginMigrationFeature, - pluginInfo.pluginMigrationCompleteFeature, pluginInfo.pluginUnregisterFeature) + _, err := csimigration.CheckMigrationFeatureFlags(featureGate, pluginInfo.pluginMigrationFeature, pluginInfo.pluginUnregisterFeature) if err != nil { klog.InfoS("Unexpected CSI Migration Feature Flags combination detected, CSI Migration may not take effect", "err", err) // TODO: fail and return here once alpha only tests can set the feature flags for a plugin correctly } - // TODO: This can be removed after feature flag CSIMigrationvSphereComplete is removed. - if migrationComplete { - klog.InfoS("Skipped registration of plugin since migration is completed", "pluginName", inTreePluginName) - return plugins, nil - } + + // Skip appending the in-tree plugin to the list of plugins to be probed/initialized + // if the plugin unregister feature flag is set if featureGate.Enabled(pluginInfo.pluginUnregisterFeature) { klog.InfoS("Skipped registration of plugin since feature flag is enabled", "pluginName", inTreePluginName, "featureFlag", pluginInfo.pluginUnregisterFeature) return plugins, nil @@ -66,11 +60,9 @@ func appendPluginBasedOnFeatureFlags(plugins []volume.VolumePlugin, inTreePlugin } type pluginInfo struct { - pluginMigrationFeature featuregate.Feature - // deprecated, only to keep here for vSphere - pluginMigrationCompleteFeature featuregate.Feature - pluginUnregisterFeature featuregate.Feature - pluginProbeFunction probeFn + pluginMigrationFeature featuregate.Feature + pluginUnregisterFeature featuregate.Feature + pluginProbeFunction probeFn } func appendLegacyProviderVolumes(allPlugins []volume.VolumePlugin, featureGate featuregate.FeatureGate) ([]volume.VolumePlugin, error) { @@ -80,7 +72,7 @@ func appendLegacyProviderVolumes(allPlugins []volume.VolumePlugin, featureGate f pluginMigrationStatus[plugins.CinderInTreePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationOpenStack, pluginUnregisterFeature: features.InTreePluginOpenStackUnregister, pluginProbeFunction: cinder.ProbeVolumePlugins} pluginMigrationStatus[plugins.AzureDiskInTreePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationAzureDisk, pluginUnregisterFeature: features.InTreePluginAzureDiskUnregister, pluginProbeFunction: azuredd.ProbeVolumePlugins} pluginMigrationStatus[plugins.AzureFileInTreePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationAzureFile, pluginUnregisterFeature: features.InTreePluginAzureFileUnregister, pluginProbeFunction: azure_file.ProbeVolumePlugins} - pluginMigrationStatus[plugins.VSphereInTreePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationvSphere, pluginMigrationCompleteFeature: features.CSIMigrationvSphereComplete, pluginUnregisterFeature: features.InTreePluginvSphereUnregister, pluginProbeFunction: vsphere_volume.ProbeVolumePlugins} + pluginMigrationStatus[plugins.VSphereInTreePluginName] = pluginInfo{pluginMigrationFeature: features.CSIMigrationvSphere, pluginUnregisterFeature: features.InTreePluginvSphereUnregister, pluginProbeFunction: vsphere_volume.ProbeVolumePlugins} var err error for pluginName, pluginInfo := range pluginMigrationStatus { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go index 60f9f4a02752..bb52d49cf4cc 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go @@ -441,10 +441,10 @@ func Run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend // To help debugging, immediately log version klog.InfoS("Kubelet version", "kubeletVersion", version.Get()) if err := initForOS(s.KubeletFlags.WindowsService, s.KubeletFlags.WindowsPriorityClass); err != nil { - return fmt.Errorf("failed OS init: %v", err) + return fmt.Errorf("failed OS init: %w", err) } if err := run(ctx, s, kubeDeps, featureGate); err != nil { - return fmt.Errorf("failed to run Kubelet: %v", err) + return fmt.Errorf("failed to run Kubelet: %w", err) } return nil } @@ -500,11 +500,11 @@ func getReservedCPUs(machineInfo *cadvisorapi.MachineInfo, cpus string) (cpuset. topo, err := topology.Discover(machineInfo) if err != nil { - return emptyCPUSet, fmt.Errorf("Unable to discover CPU topology info: %s", err) + return emptyCPUSet, fmt.Errorf("unable to discover CPU topology info: %s", err) } reservedCPUSet, err := cpuset.Parse(cpus) if err != nil { - return emptyCPUSet, fmt.Errorf("Unable to parse reserved-cpus list: %s", err) + return emptyCPUSet, fmt.Errorf("unable to parse reserved-cpus list: %s", err) } allCPUSet := topo.CPUDetails.CPUs() if !reservedCPUSet.IsSubsetOf(allCPUSet) { @@ -532,7 +532,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend if s.LockFilePath != "" { klog.InfoS("Acquiring file lock", "path", s.LockFilePath) if err := flock.Acquire(s.LockFilePath); err != nil { - return fmt.Errorf("unable to acquire file lock on %q: %v", s.LockFilePath, err) + return fmt.Errorf("unable to acquire file lock on %q: %w", s.LockFilePath, err) } if s.ExitOnLockContention { klog.InfoS("Watching for inotify events", "path", s.LockFilePath) @@ -608,7 +608,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend kubeDeps.KubeClient, err = clientset.NewForConfig(clientConfig) if err != nil { - return fmt.Errorf("failed to initialize kubelet client: %v", err) + return fmt.Errorf("failed to initialize kubelet client: %w", err) } // make a separate client for events @@ -617,7 +617,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend eventClientConfig.Burst = int(s.EventBurst) kubeDeps.EventClient, err = v1core.NewForConfig(&eventClientConfig) if err != nil { - return fmt.Errorf("failed to initialize kubelet event client: %v", err) + return fmt.Errorf("failed to initialize kubelet event client: %w", err) } // make a separate client for heartbeat with throttling disabled and a timeout attached @@ -632,7 +632,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend heartbeatClientConfig.QPS = float32(-1) kubeDeps.HeartbeatClient, err = clientset.NewForConfig(&heartbeatClientConfig) if err != nil { - return fmt.Errorf("failed to initialize kubelet heartbeat client: %v", err) + return fmt.Errorf("failed to initialize kubelet heartbeat client: %w", err) } } @@ -912,7 +912,7 @@ func buildKubeletClientConfig(ctx context.Context, s *options.KubeletServer, nod &clientcmd.ConfigOverrides{}, ).ClientConfig() if err != nil { - return nil, nil, fmt.Errorf("invalid kubeconfig: %v", err) + return nil, nil, fmt.Errorf("invalid kubeconfig: %w", err) } kubeClientConfigOverrides(s, clientConfig) @@ -986,7 +986,7 @@ func getNodeName(cloud cloudprovider.Interface, hostname string) (types.NodeName nodeName, err := instances.CurrentNodeName(context.TODO(), hostname) if err != nil { - return "", fmt.Errorf("error fetching current node name from cloud provider: %v", err) + return "", fmt.Errorf("error fetching current node name from cloud provider: %w", err) } klog.V(2).InfoS("Cloud provider determined current node", "nodeName", klog.KRef("", string(nodeName))) @@ -1012,7 +1012,7 @@ func InitializeTLS(kf *options.KubeletFlags, kc *kubeletconfiginternal.KubeletCo } cert, key, err := certutil.GenerateSelfSignedCertKey(hostName, nil, nil) if err != nil { - return nil, fmt.Errorf("unable to generate self signed cert: %v", err) + return nil, fmt.Errorf("unable to generate self signed cert: %w", err) } if err := certutil.WriteCert(kc.TLSCertFile, cert); err != nil { @@ -1060,7 +1060,7 @@ func InitializeTLS(kf *options.KubeletFlags, kc *kubeletconfiginternal.KubeletCo if len(kc.Authentication.X509.ClientCAFile) > 0 { clientCAs, err := certutil.NewPool(kc.Authentication.X509.ClientCAFile) if err != nil { - return nil, fmt.Errorf("unable to load client CA file %s: %v", kc.Authentication.X509.ClientCAFile, err) + return nil, fmt.Errorf("unable to load client CA file %s: %w", kc.Authentication.X509.ClientCAFile, err) } // Specify allowed CAs for client certificates tlsOptions.Config.ClientCAs = clientCAs @@ -1168,7 +1168,7 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie kubeServer.SeccompProfileRoot, kubeServer.NodeStatusMaxImages) if err != nil { - return fmt.Errorf("failed to create kubelet: %v", err) + return fmt.Errorf("failed to create kubelet: %w", err) } // NewMainKubelet should have set up a pod source config if one didn't exist @@ -1185,7 +1185,7 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie // process pods and exit. if runOnce { if _, err := k.RunOnce(podCfg.Updates()); err != nil { - return fmt.Errorf("runonce failed: %v", err) + return fmt.Errorf("runonce failed: %w", err) } klog.InfoS("Started kubelet as runonce") } else { @@ -1329,7 +1329,7 @@ func BootstrapKubeletConfigController(dynamicConfigDir string, transform dynamic c := dynamickubeletconfig.NewController(dir, transform) kc, err := c.Bootstrap() if err != nil { - return nil, nil, fmt.Errorf("failed to determine a valid configuration, error: %v", err) + return nil, nil, fmt.Errorf("failed to determine a valid configuration, error: %w", err) } return kc, c, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_linux.go index c22e24d5312f..3eef6f13d9e2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_linux.go @@ -29,6 +29,7 @@ func watchForLockfileContention(path string, done chan struct{}) error { } if err = watcher.AddWatch(path, inotify.InOpen|inotify.InDeleteSelf); err != nil { klog.ErrorS(err, "Unable to watch lockfile") + watcher.Close() return err } go func() { @@ -39,6 +40,7 @@ func watchForLockfileContention(path string, done chan struct{}) error { klog.ErrorS(err, "inotify watcher error") } close(done) + watcher.Close() }() return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_windows.go index cdb83e321f44..b986f102b29e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/cmd/kubelet/app/server_windows.go @@ -29,12 +29,12 @@ func isAdmin() (bool, error) { // Get current user u, err := user.Current() if err != nil { - return false, fmt.Errorf("Error retrieving current user: %s", err) + return false, fmt.Errorf("error retrieving current user: %s", err) } // Get IDs of group user is a member of ids, err := u.GroupIds() if err != nil { - return false, fmt.Errorf("Error retrieving group ids: %s", err) + return false, fmt.Errorf("error retrieving group ids: %s", err) } // Check for existence of BUILTIN\ADMINISTRATORS group id @@ -61,7 +61,7 @@ func checkPermissions() error { 0, 0, 0, 0, 0, 0, &sid) if err != nil { - return fmt.Errorf("Error while checking for elevated permissions: %s", err) + return fmt.Errorf("error while checking for elevated permissions: %s", err) } //We must free the sid to prevent security token leaks @@ -70,12 +70,12 @@ func checkPermissions() error { userIsAdmin, err = isAdmin() if err != nil { - return fmt.Errorf("Error while checking admin group membership: %s", err) + return fmt.Errorf("error while checking admin group membership: %s", err) } member, err := token.IsMember(sid) if err != nil { - return fmt.Errorf("Error while checking for elevated permissions: %s", err) + return fmt.Errorf("error while checking for elevated permissions: %s", err) } if !member { return fmt.Errorf("kubelet needs to run with administrator permissions. Run as admin is: %t, User in admin group: %t", member, userIsAdmin) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/util.go index dd6922ee3762..256231fcf07c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/util.go @@ -26,7 +26,6 @@ import ( api "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/apis/core/helper" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" - "k8s.io/kubernetes/pkg/apis/core/validation" apivalidation "k8s.io/kubernetes/pkg/apis/core/validation" "k8s.io/kubernetes/pkg/features" ) @@ -391,10 +390,41 @@ func usesIndivisibleHugePagesValues(podSpec *api.PodSpec) bool { return false } +// haveSameExpandedDNSConfig returns true if the oldPodSpec already had +// ExpandedDNSConfig and podSpec has the same DNSConfig +func haveSameExpandedDNSConfig(podSpec, oldPodSpec *api.PodSpec) bool { + if oldPodSpec == nil || oldPodSpec.DNSConfig == nil { + return false + } + if podSpec == nil || podSpec.DNSConfig == nil { + return false + } + + if len(oldPodSpec.DNSConfig.Searches) <= apivalidation.MaxDNSSearchPathsLegacy && + len(strings.Join(oldPodSpec.DNSConfig.Searches, " ")) <= apivalidation.MaxDNSSearchListCharsLegacy { + // didn't have ExpandedDNSConfig + return false + } + + if len(oldPodSpec.DNSConfig.Searches) != len(podSpec.DNSConfig.Searches) { + // updates DNSConfig + return false + } + + for i, oldSearch := range oldPodSpec.DNSConfig.Searches { + if podSpec.DNSConfig.Searches[i] != oldSearch { + // updates DNSConfig + return false + } + } + + return true +} + // GetValidationOptionsFromPodSpecAndMeta returns validation options based on pod specs and metadata func GetValidationOptionsFromPodSpecAndMeta(podSpec, oldPodSpec *api.PodSpec, podMeta, oldPodMeta *metav1.ObjectMeta) apivalidation.PodValidationOptions { // default pod validation options based on feature gate - opts := validation.PodValidationOptions{ + opts := apivalidation.PodValidationOptions{ // Allow multiple huge pages on pod create if feature is enabled AllowMultipleHugePageResources: utilfeature.DefaultFeatureGate.Enabled(features.HugePageStorageMediumSize), // Allow pod spec to use hugepages in downward API if feature is enabled @@ -402,6 +432,9 @@ func GetValidationOptionsFromPodSpecAndMeta(podSpec, oldPodSpec *api.PodSpec, po AllowInvalidPodDeletionCost: !utilfeature.DefaultFeatureGate.Enabled(features.PodDeletionCost), // Do not allow pod spec to use non-integer multiple of huge page unit size default AllowIndivisibleHugePagesValues: false, + AllowWindowsHostProcessField: utilfeature.DefaultFeatureGate.Enabled(features.WindowsHostProcessContainers), + // Allow pod spec with expanded DNS configuration + AllowExpandedDNSConfig: utilfeature.DefaultFeatureGate.Enabled(features.ExpandedDNSConfig) || haveSameExpandedDNSConfig(podSpec, oldPodSpec), } if oldPodSpec != nil { @@ -416,6 +449,8 @@ func GetValidationOptionsFromPodSpecAndMeta(podSpec, oldPodSpec *api.PodSpec, po return !opts.AllowDownwardAPIHugePages }) } + // if old spec has Windows Host Process fields set, we must allow it + opts.AllowWindowsHostProcessField = opts.AllowWindowsHostProcessField || setsWindowsHostProcess(oldPodSpec) // if old spec used non-integer multiple of huge page unit size, we must allow it opts.AllowIndivisibleHugePagesValues = usesIndivisibleHugePagesValues(oldPodSpec) @@ -945,3 +980,28 @@ func SeccompFieldForAnnotation(annotation string) *api.SeccompProfile { // length or if the annotation has an unrecognized value return nil } + +// setsWindowsHostProcess returns true if WindowsOptions.HostProcess is set (true or false) +// anywhere in the pod spec. +func setsWindowsHostProcess(podSpec *api.PodSpec) bool { + if podSpec == nil { + return false + } + + // Check Pod's WindowsOptions.HostProcess + if podSpec.SecurityContext != nil && podSpec.SecurityContext.WindowsOptions != nil && podSpec.SecurityContext.WindowsOptions.HostProcess != nil { + return true + } + + // Check WindowsOptions.HostProcess for each container + inUse := false + VisitContainers(podSpec, AllContainers, func(c *api.Container, containerType ContainerType) bool { + if c.SecurityContext != nil && c.SecurityContext.WindowsOptions != nil && c.SecurityContext.WindowsOptions.HostProcess != nil { + inUse = true + return false + } + return true + }) + + return inUse +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/warnings.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/warnings.go new file mode 100644 index 000000000000..e0c34511f0b2 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/api/pod/warnings.go @@ -0,0 +1,281 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pod + +import ( + "context" + "fmt" + "strings" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/validation/field" + api "k8s.io/kubernetes/pkg/apis/core" + "k8s.io/kubernetes/pkg/apis/core/pods" +) + +func GetWarningsForPod(ctx context.Context, pod, oldPod *api.Pod) []string { + if pod == nil { + return nil + } + + var ( + oldSpec *api.PodSpec + oldMeta *metav1.ObjectMeta + ) + if oldPod != nil { + oldSpec = &oldPod.Spec + oldMeta = &oldPod.ObjectMeta + } + return warningsForPodSpecAndMeta(nil, &pod.Spec, &pod.ObjectMeta, oldSpec, oldMeta) +} + +func GetWarningsForPodTemplate(ctx context.Context, fieldPath *field.Path, podTemplate, oldPodTemplate *api.PodTemplateSpec) []string { + if podTemplate == nil { + return nil + } + + var ( + oldSpec *api.PodSpec + oldMeta *metav1.ObjectMeta + ) + if oldPodTemplate != nil { + oldSpec = &oldPodTemplate.Spec + oldMeta = &oldPodTemplate.ObjectMeta + } + return warningsForPodSpecAndMeta(fieldPath, &podTemplate.Spec, &podTemplate.ObjectMeta, oldSpec, oldMeta) +} + +var deprecatedNodeLabels = map[string]string{ + `beta.kubernetes.io/arch`: `deprecated since v1.14; use "kubernetes.io/arch" instead`, + `beta.kubernetes.io/os`: `deprecated since v1.14; use "kubernetes.io/os" instead`, + `failure-domain.beta.kubernetes.io/region`: `deprecated since v1.17; use "topology.kubernetes.io/region" instead`, + `failure-domain.beta.kubernetes.io/zone`: `deprecated since v1.17; use "topology.kubernetes.io/zone" instead`, + `beta.kubernetes.io/instance-type`: `deprecated since v1.17; use "node.kubernetes.io/instance-type" instead`, +} + +var deprecatedAnnotations = []struct { + key string + prefix string + message string +}{ + { + key: `scheduler.alpha.kubernetes.io/critical-pod`, + message: `non-functional in v1.16+; use the "priorityClassName" field instead`, + }, + { + key: `security.alpha.kubernetes.io/sysctls`, + message: `non-functional in v1.11+; use the "sysctls" field instead`, + }, + { + key: `security.alpha.kubernetes.io/unsafe-sysctls`, + message: `non-functional in v1.11+; use the "sysctls" field instead`, + }, +} + +func warningsForPodSpecAndMeta(fieldPath *field.Path, podSpec *api.PodSpec, meta *metav1.ObjectMeta, oldPodSpec *api.PodSpec, oldMeta *metav1.ObjectMeta) []string { + var warnings []string + + // use of deprecated node labels in selectors/affinity/topology + for k := range podSpec.NodeSelector { + if msg, deprecated := deprecatedNodeLabels[k]; deprecated { + warnings = append(warnings, fmt.Sprintf("%s: %s", fieldPath.Child("spec", "nodeSelector").Key(k), msg)) + } + } + if podSpec.Affinity != nil && podSpec.Affinity.NodeAffinity != nil { + n := podSpec.Affinity.NodeAffinity + if n.RequiredDuringSchedulingIgnoredDuringExecution != nil { + for i, t := range n.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms { + for j, e := range t.MatchExpressions { + if msg, deprecated := deprecatedNodeLabels[e.Key]; deprecated { + warnings = append( + warnings, + fmt.Sprintf( + "%s: %s is %s", + fieldPath.Child("spec", "affinity", "nodeAffinity", "requiredDuringSchedulingIgnoredDuringExecution", "nodeSelectorTerms").Index(i). + Child("matchExpressions").Index(j). + Child("key"), + e.Key, + msg, + ), + ) + } + } + } + } + for i, t := range n.PreferredDuringSchedulingIgnoredDuringExecution { + for j, e := range t.Preference.MatchExpressions { + if msg, deprecated := deprecatedNodeLabels[e.Key]; deprecated { + warnings = append( + warnings, + fmt.Sprintf( + "%s: %s is %s", + fieldPath.Child("spec", "affinity", "nodeAffinity", "preferredDuringSchedulingIgnoredDuringExecution").Index(i). + Child("preference"). + Child("matchExpressions").Index(j). + Child("key"), + e.Key, + msg, + ), + ) + } + } + } + } + for i, t := range podSpec.TopologySpreadConstraints { + if msg, deprecated := deprecatedNodeLabels[t.TopologyKey]; deprecated { + warnings = append(warnings, fmt.Sprintf( + "%s: %s is %s", + fieldPath.Child("spec", "topologySpreadConstraints").Index(i).Child("topologyKey"), + t.TopologyKey, + msg, + )) + } + } + + // use of deprecated annotations + for _, deprecated := range deprecatedAnnotations { + if _, exists := meta.Annotations[deprecated.key]; exists { + warnings = append(warnings, fmt.Sprintf("%s: %s", fieldPath.Child("metadata", "annotations").Key(deprecated.key), deprecated.message)) + } + if len(deprecated.prefix) > 0 { + for k := range meta.Annotations { + if strings.HasPrefix(k, deprecated.prefix) { + warnings = append(warnings, fmt.Sprintf("%s: %s", fieldPath.Child("metadata", "annotations").Key(k), deprecated.message)) + break + } + } + } + } + + // deprecated and removed volume plugins + for i, v := range podSpec.Volumes { + if v.PhotonPersistentDisk != nil { + warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.11, non-functional in v1.16+", fieldPath.Child("spec", "volumes").Index(i).Child("photonPersistentDisk"))) + } + if v.GitRepo != nil { + warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.11", fieldPath.Child("spec", "volumes").Index(i).Child("gitRepo"))) + } + if v.ScaleIO != nil { + warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.16, non-functional in v1.22+", fieldPath.Child("spec", "volumes").Index(i).Child("scaleIO"))) + } + if v.Flocker != nil { + warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.22, support removal is planned in v1.26", fieldPath.Child("spec", "volumes").Index(i).Child("flocker"))) + } + if v.StorageOS != nil { + warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.22, support removal is planned in v1.26", fieldPath.Child("spec", "volumes").Index(i).Child("storageOS"))) + } + if v.Quobyte != nil { + warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.22, support removal is planned in v1.26", fieldPath.Child("spec", "volumes").Index(i).Child("quobyte"))) + } + } + + // duplicate hostAliases (#91670, #58477) + if len(podSpec.HostAliases) > 1 { + items := sets.NewString() + for i, item := range podSpec.HostAliases { + if items.Has(item.IP) { + warnings = append(warnings, fmt.Sprintf("%s: duplicate ip %q", fieldPath.Child("spec", "hostAliases").Index(i).Child("ip"), item.IP)) + } else { + items.Insert(item.IP) + } + } + } + + // duplicate imagePullSecrets (#91629, #58477) + if len(podSpec.ImagePullSecrets) > 1 { + items := sets.NewString() + for i, item := range podSpec.ImagePullSecrets { + if items.Has(item.Name) { + warnings = append(warnings, fmt.Sprintf("%s: duplicate name %q", fieldPath.Child("spec", "imagePullSecrets").Index(i).Child("name"), item.Name)) + } else { + items.Insert(item.Name) + } + } + } + // imagePullSecrets with empty name (#99454#issuecomment-787838112) + for i, item := range podSpec.ImagePullSecrets { + if len(item.Name) == 0 { + warnings = append(warnings, fmt.Sprintf("%s: invalid empty name %q", fieldPath.Child("spec", "imagePullSecrets").Index(i).Child("name"), item.Name)) + } + } + + // duplicate volume names (#78266, #58477) + if len(podSpec.Volumes) > 1 { + items := sets.NewString() + for i, item := range podSpec.Volumes { + if items.Has(item.Name) { + warnings = append(warnings, fmt.Sprintf("%s: duplicate name %q", fieldPath.Child("spec", "volumes").Index(i).Child("name"), item.Name)) + } else { + items.Insert(item.Name) + } + } + } + + // fractional memory/ephemeral-storage requests/limits (#79950, #49442, #18538) + if value, ok := podSpec.Overhead[api.ResourceMemory]; ok && value.MilliValue()%int64(1000) != int64(0) { + warnings = append(warnings, fmt.Sprintf("%s: fractional byte value %q is invalid, must be an integer", fieldPath.Child("spec", "overhead").Key(string(api.ResourceMemory)), value.String())) + } + if value, ok := podSpec.Overhead[api.ResourceEphemeralStorage]; ok && value.MilliValue()%int64(1000) != int64(0) { + warnings = append(warnings, fmt.Sprintf("%s: fractional byte value %q is invalid, must be an integer", fieldPath.Child("spec", "overhead").Key(string(api.ResourceEphemeralStorage)), value.String())) + } + + // use of pod seccomp annotation without accompanying field + if podSpec.SecurityContext == nil || podSpec.SecurityContext.SeccompProfile == nil { + if _, exists := meta.Annotations[api.SeccompPodAnnotationKey]; exists { + warnings = append(warnings, fmt.Sprintf(`%s: deprecated since v1.19; use the "seccompProfile" field instead`, fieldPath.Child("metadata", "annotations").Key(api.SeccompPodAnnotationKey))) + } + } + + pods.VisitContainersWithPath(podSpec, fieldPath.Child("spec"), func(c *api.Container, p *field.Path) bool { + // use of container seccomp annotation without accompanying field + if c.SecurityContext == nil || c.SecurityContext.SeccompProfile == nil { + if _, exists := meta.Annotations[api.SeccompContainerAnnotationKeyPrefix+c.Name]; exists { + warnings = append(warnings, fmt.Sprintf(`%s: deprecated since v1.19; use the "seccompProfile" field instead`, fieldPath.Child("metadata", "annotations").Key(api.SeccompContainerAnnotationKeyPrefix+c.Name))) + } + } + + // fractional memory/ephemeral-storage requests/limits (#79950, #49442, #18538) + if value, ok := c.Resources.Limits[api.ResourceMemory]; ok && value.MilliValue()%int64(1000) != int64(0) { + warnings = append(warnings, fmt.Sprintf("%s: fractional byte value %q is invalid, must be an integer", p.Child("resources", "limits").Key(string(api.ResourceMemory)), value.String())) + } + if value, ok := c.Resources.Requests[api.ResourceMemory]; ok && value.MilliValue()%int64(1000) != int64(0) { + warnings = append(warnings, fmt.Sprintf("%s: fractional byte value %q is invalid, must be an integer", p.Child("resources", "requests").Key(string(api.ResourceMemory)), value.String())) + } + if value, ok := c.Resources.Limits[api.ResourceEphemeralStorage]; ok && value.MilliValue()%int64(1000) != int64(0) { + warnings = append(warnings, fmt.Sprintf("%s: fractional byte value %q is invalid, must be an integer", p.Child("resources", "limits").Key(string(api.ResourceEphemeralStorage)), value.String())) + } + if value, ok := c.Resources.Requests[api.ResourceEphemeralStorage]; ok && value.MilliValue()%int64(1000) != int64(0) { + warnings = append(warnings, fmt.Sprintf("%s: fractional byte value %q is invalid, must be an integer", p.Child("resources", "requests").Key(string(api.ResourceEphemeralStorage)), value.String())) + } + + // duplicate containers[*].env (#86163, #93266, #58477) + if len(c.Env) > 1 { + items := sets.NewString() + for i, item := range c.Env { + if items.Has(item.Name) { + warnings = append(warnings, fmt.Sprintf("%s: duplicate name %q", p.Child("env").Index(i).Child("name"), item.Name)) + } else { + items.Insert(item.Name) + } + } + } + return true + }) + + return warnings +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS index 11c1b1a4fbb7..ec350aa4ff8f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/OWNERS @@ -1,18 +1,8 @@ # See the OWNERS docs at https://go.k8s.io/owners +# approval on api packages bubbles to api-approvers reviewers: -- thockin -- lavalamp -- smarterclayton -- deads2k -- caesarxuchao -- pmorie -- sttts -- saad-ali -- ncdc -- dims -- errordeveloper -- m1093782566 -- kevin-wangzefeng +- sig-apps-api-reviewers +- sig-apps-api-approvers labels: - sig/apps diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go index 6866540baf08..c5607e6bf9ca 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go @@ -157,6 +157,13 @@ type StatefulSetSpec struct { // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. RevisionHistoryLimit *int32 + + // Minimum number of seconds for which a newly created pod should be ready + // without any of its container crashing for it to be considered available. + // Defaults to 0 (pod will be considered available as soon as it is ready) + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // +optional + MinReadySeconds int32 } // StatefulSetStatus represents the current state of a StatefulSet. @@ -196,6 +203,12 @@ type StatefulSetStatus struct { // Represents the latest available observations of a statefulset's current state. Conditions []StatefulSetCondition + + // Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset. + // This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + // Remove omitempty when graduating to beta + // +optional + AvailableReplicas int32 } // StatefulSetConditionType describes the condition types of StatefulSets. @@ -564,7 +577,7 @@ type RollingUpdateDaemonSet struct { // daemonset on any given node can double if the readiness check fails, and // so resource intensive daemonsets should take into account that they may // cause evictions during disruption. - // This is an alpha field and requires enabling DaemonSetUpdateSurge feature gate. + // This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate. // +optional MaxSurge intstr.IntOrString } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/validation/validation.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/validation/validation.go index ab68809bf0f8..efd06b030d6e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/validation/validation.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/apps/validation/validation.go @@ -109,6 +109,9 @@ func ValidateStatefulSetSpec(spec *apps.StatefulSetSpec, fldPath *field.Path, op } allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(spec.Replicas), fldPath.Child("replicas"))...) + if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetMinReadySeconds) { + allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(spec.MinReadySeconds), fldPath.Child("minReadySeconds"))...) + } if spec.Selector == nil { allErrs = append(allErrs, field.Required(fldPath.Child("selector"), "")) } else { @@ -152,11 +155,21 @@ func ValidateStatefulSetUpdate(statefulSet, oldStatefulSet *apps.StatefulSet) fi newStatefulSetClone.Spec.Replicas = oldStatefulSet.Spec.Replicas // +k8s:verify-mutation:reason=clone newStatefulSetClone.Spec.Template = oldStatefulSet.Spec.Template // +k8s:verify-mutation:reason=clone newStatefulSetClone.Spec.UpdateStrategy = oldStatefulSet.Spec.UpdateStrategy // +k8s:verify-mutation:reason=clone + if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetMinReadySeconds) { + newStatefulSetClone.Spec.MinReadySeconds = oldStatefulSet.Spec.MinReadySeconds // +k8s:verify-mutation:reason=clone + } if !apiequality.Semantic.DeepEqual(newStatefulSetClone.Spec, oldStatefulSet.Spec) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden")) + if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetMinReadySeconds) { + allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "updates to statefulset spec for fields other than 'replicas', 'template', 'minReadySeconds' and 'updateStrategy' are forbidden")) + } else { + allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "updates to statefulset spec for fields other than 'replicas', 'template' and 'updateStrategy' are forbidden")) + } } allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(statefulSet.Spec.Replicas), field.NewPath("spec", "replicas"))...) + if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetMinReadySeconds) { + allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(statefulSet.Spec.MinReadySeconds), field.NewPath("spec", "minReadySeconds"))...) + } return allErrs } @@ -168,6 +181,9 @@ func ValidateStatefulSetStatus(status *apps.StatefulSetStatus, fieldPath *field. allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.ReadyReplicas), fieldPath.Child("readyReplicas"))...) allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.CurrentReplicas), fieldPath.Child("currentReplicas"))...) allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.UpdatedReplicas), fieldPath.Child("updatedReplicas"))...) + if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetMinReadySeconds) { + allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(status.AvailableReplicas), fieldPath.Child("availableReplicas"))...) + } if status.ObservedGeneration != nil { allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(*status.ObservedGeneration), fieldPath.Child("observedGeneration"))...) } @@ -185,6 +201,14 @@ func ValidateStatefulSetStatus(status *apps.StatefulSetStatus, fieldPath *field. if status.UpdatedReplicas > status.Replicas { allErrs = append(allErrs, field.Invalid(fieldPath.Child("updatedReplicas"), status.UpdatedReplicas, msg)) } + if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetMinReadySeconds) { + if status.AvailableReplicas > status.Replicas { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("availableReplicas"), status.AvailableReplicas, msg)) + } + if status.AvailableReplicas > status.ReadyReplicas { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("availableReplicas"), status.AvailableReplicas, "cannot be greater than readyReplicas")) + } + } return allErrs } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/OWNERS index 604da6c64a9e..ec350aa4ff8f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/OWNERS @@ -1,17 +1,8 @@ # See the OWNERS docs at https://go.k8s.io/owners +# approval on api packages bubbles to api-approvers reviewers: -- thockin -- lavalamp -- smarterclayton -- wojtek-t -- deads2k -- caesarxuchao -- sttts -- saad-ali -- ncdc -- soltysh -- dims -- errordeveloper +- sig-apps-api-reviewers +- sig-apps-api-approvers labels: - sig/apps diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go index 29a49f9e0d3e..77d5b6f281ae 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go @@ -183,9 +183,11 @@ type JobSpec struct { // for each index. // When value is `Indexed`, .spec.completions must be specified and // `.spec.parallelism` must be less than or equal to 10^5. + // In addition, The Pod name takes the form + // `$(job-name)-$(index)-$(random-string)`, + // the Pod hostname takes the form `$(job-name)-$(index)`. // - // This field is alpha-level and is only honored by servers that enable the - // IndexedJob feature gate. More completion modes can be added in the future. + // This field is beta-level. More completion modes can be added in the future. // If the Job controller observes a mode that it doesn't recognize, the // controller skips updates for the Job. // +optional diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS index 017e72e5d177..6e2dd31dd0a6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/OWNERS @@ -1,38 +1,4 @@ # See the OWNERS docs at https://go.k8s.io/owners -approvers: -- lavalamp -- smarterclayton -- thockin -- liggitt -reviewers: -- thockin -- lavalamp -- smarterclayton -- wojtek-t -- deads2k -- yujuhong -- brendandburns -- derekwaynecarr -- caesarxuchao -- vishh -- mikedanese -- liggitt -- davidopp -- pmorie -- sttts -- dchen1107 -- saad-ali -- luxas -- janetkuo -- justinsb -- pwittrock -- ncdc -- tallclair -- yifan-gu -- mwielgus -- soltysh -- piosz -- jsafrane labels: - sig/apps diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/annotation_key_constants.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/annotation_key_constants.go index b492e5584538..17523255b784 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/annotation_key_constants.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/annotation_key_constants.go @@ -23,9 +23,6 @@ const ( // webhook backend fails. ImagePolicyFailedOpenKey string = "alpha.image-policy.k8s.io/failed-open" - // PodPresetOptOutAnnotationKey represents the annotation key for a pod to exempt itself from pod preset manipulation - PodPresetOptOutAnnotationKey string = "podpreset.admission.kubernetes.io/exclude" - // MirrorPodAnnotationKey represents the annotation key set by kubelets when creating mirror pods MirrorPodAnnotationKey string = "kubernetes.io/config.mirror" diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/types.go index c75b011863e1..98f8e0379a32 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/types.go @@ -1826,12 +1826,13 @@ type EnvVar struct { Name string // Optional: no more than one of the following may be specified. // Optional: Defaults to ""; variable references $(VAR_NAME) are expanded - // using the previous defined environment variables in the container and + // using the previously defined environment variables in the container and // any service environment variables. If a variable cannot be resolved, - // the reference in the input string will be unchanged. The $(VAR_NAME) - // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped - // references will never be expanded, regardless of whether the variable - // exists or not. + // the reference in the input string will be unchanged. Double $$ are + // reduced to a single $, which allows for escaping the $(VAR_NAME) + // syntax: i.e. "$$(VAR_NAME)" will produce the string literal + // "$(VAR_NAME)". Escaped references will never be expanded, + // regardless of whether the variable exists or not. // +optional Value string // Optional: Specifies a source the value of this var should come from. @@ -2102,16 +2103,18 @@ type Container struct { Image string // Optional: The docker image's entrypoint is used if this is not provided; cannot be updated. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. // +optional Command []string // Optional: The docker image's cmd is used if this is not provided; cannot be updated. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. // +optional Args []string // Optional: Defaults to Docker's default. @@ -2580,7 +2583,7 @@ type PodAffinityTerm struct { // and the ones listed in the namespaces field. // null selector and null or empty namespaces list means "this pod's namespace". // An empty selector ({}) matches all namespaces. - // This field is alpha-level and is only honored when PodAffinityNamespaceSelector feature is enabled. + // This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. // +optional NamespaceSelector *metav1.LabelSelector } @@ -2833,14 +2836,14 @@ type PodSpec struct { // If specified, all readiness gates will be evaluated for pod readiness. // A pod is ready when all its containers are ready AND // all conditions specified in the readiness gates have status equal to "True" - // More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md + // More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates // +optional ReadinessGates []PodReadinessGate // RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used // to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. // If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an // empty definition that uses the default runtime handler. - // More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class/README.md + // More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class // +optional RuntimeClassName *string // Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. @@ -2849,7 +2852,7 @@ type PodSpec struct { // The RuntimeClass admission controller will reject Pod create requests which have the overhead already // set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value // defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. - // More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md + // More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead // This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature. // +optional Overhead ResourceList @@ -3079,16 +3082,18 @@ type EphemeralContainerCommon struct { Image string // Optional: The docker image's entrypoint is used if this is not provided; cannot be updated. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. // +optional Command []string // Optional: The docker image's cmd is used if this is not provided; cannot be updated. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. // +optional Args []string // Optional: Defaults to Docker's default. @@ -3555,11 +3560,6 @@ type LoadBalancerIngress struct { Ports []PortStatus } -const ( - // MaxServiceTopologyKeys is the largest number of topology keys allowed on a service - MaxServiceTopologyKeys = 16 -) - // IPFamily represents the IP Family (IPv4 or IPv6). This type is used // to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). type IPFamily string @@ -3727,23 +3727,6 @@ type ServiceSpec struct { // +optional PublishNotReadyAddresses bool - // topologyKeys is a preference-order list of topology keys which - // implementations of services should use to preferentially sort endpoints - // when accessing this Service, it can not be used at the same time as - // externalTrafficPolicy=Local. - // Topology keys must be valid label keys and at most 16 keys may be specified. - // Endpoints are chosen based on the first topology key with available backends. - // If this field is specified and all entries have no backends that match - // the topology of the client, the service has no backends for that client - // and connections should fail. - // The special value "*" may be used to mean "any topology". This catch-all - // value, if used, only makes sense as the last value in the list. - // If this is not specified or empty, no topology constraints will be applied. - // This field is alpha-level and is only honored by servers that enable the ServiceTopology feature. - // This field is deprecated and will be removed in a future version. - // +optional - TopologyKeys []string - // allocateLoadBalancerNodePorts defines if NodePorts will be automatically // allocated for services with type LoadBalancer. Default is "true". It may be // set to "false" if the cluster load-balancer does not rely on NodePorts. @@ -4201,6 +4184,7 @@ type PodSignature struct { // ContainerImage describe a container image type ContainerImage struct { // Names by which this image is known. + // +optional Names []string // The size of the image in bytes. // +optional @@ -4887,7 +4871,7 @@ const ( // Match all pod objects that have priority class mentioned ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass" // Match all pod objects that have cross-namespace pod (anti)affinity mentioned - // This is an alpha feature enabled by the PodAffinityNamespaceSelector feature flag. + // This is a beta feature enabled by the PodAffinityNamespaceSelector feature flag. ResourceQuotaScopeCrossNamespacePodAffinity ResourceQuotaScope = "CrossNamespacePodAffinity" ) @@ -5351,6 +5335,16 @@ type WindowsSecurityContextOptions struct { // PodSecurityContext, the value specified in SecurityContext takes precedence. // +optional RunAsUserName *string + + // HostProcess determines if a container should be run as a 'Host Process' container. + // This field is alpha-level and will only be honored by components that enable the + // WindowsHostProcessContainers feature flag. Setting this field without the feature + // flag will result in errors when validating the Pod. All of a Pod's containers must + // have the same effective HostProcess value (it is not allowed to have a mix of HostProcess + // containers and non-HostProcess containers). In addition, if HostProcess is true + // then HostNetwork must also be set to true. + // +optional + HostProcess *bool } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/validation/validation.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/validation/validation.go index f159fb60f5e0..4f7ca42e40fe 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/validation/validation.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/validation/validation.go @@ -23,10 +23,10 @@ import ( "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/validation" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/kubernetes/pkg/apis/core/helper" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" + apivalidation "k8s.io/kubernetes/pkg/apis/core/validation" ) const isNegativeErrorMsg string = `must be greater than or equal to 0` @@ -109,10 +109,7 @@ func ValidateNonnegativeQuantity(value resource.Quantity, fldPath *field.Path) f // Validate compute resource typename. // Refer to docs/design/resources.md for more details. func validateResourceName(value string, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - for _, msg := range validation.IsQualifiedName(value) { - allErrs = append(allErrs, field.Invalid(fldPath, value, msg)) - } + allErrs := apivalidation.ValidateQualifiedName(value, fldPath) if len(allErrs) != 0 { return allErrs } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go index 3fe7ced32be1..26cc97f56e7d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go @@ -7599,7 +7599,6 @@ func autoConvert_v1_ServiceSpec_To_core_ServiceSpec(in *v1.ServiceSpec, out *cor out.HealthCheckNodePort = in.HealthCheckNodePort out.PublishNotReadyAddresses = in.PublishNotReadyAddresses out.SessionAffinityConfig = (*core.SessionAffinityConfig)(unsafe.Pointer(in.SessionAffinityConfig)) - out.TopologyKeys = *(*[]string)(unsafe.Pointer(&in.TopologyKeys)) out.IPFamilies = *(*[]core.IPFamily)(unsafe.Pointer(&in.IPFamilies)) out.IPFamilyPolicy = (*core.IPFamilyPolicyType)(unsafe.Pointer(in.IPFamilyPolicy)) out.AllocateLoadBalancerNodePorts = (*bool)(unsafe.Pointer(in.AllocateLoadBalancerNodePorts)) @@ -7630,7 +7629,6 @@ func autoConvert_core_ServiceSpec_To_v1_ServiceSpec(in *core.ServiceSpec, out *v out.ExternalTrafficPolicy = v1.ServiceExternalTrafficPolicyType(in.ExternalTrafficPolicy) out.HealthCheckNodePort = in.HealthCheckNodePort out.PublishNotReadyAddresses = in.PublishNotReadyAddresses - out.TopologyKeys = *(*[]string)(unsafe.Pointer(&in.TopologyKeys)) out.AllocateLoadBalancerNodePorts = (*bool)(unsafe.Pointer(in.AllocateLoadBalancerNodePorts)) out.LoadBalancerClass = (*string)(unsafe.Pointer(in.LoadBalancerClass)) out.InternalTrafficPolicy = (*v1.ServiceInternalTrafficPolicyType)(unsafe.Pointer(in.InternalTrafficPolicy)) @@ -8212,6 +8210,7 @@ func autoConvert_v1_WindowsSecurityContextOptions_To_core_WindowsSecurityContext out.GMSACredentialSpecName = (*string)(unsafe.Pointer(in.GMSACredentialSpecName)) out.GMSACredentialSpec = (*string)(unsafe.Pointer(in.GMSACredentialSpec)) out.RunAsUserName = (*string)(unsafe.Pointer(in.RunAsUserName)) + out.HostProcess = (*bool)(unsafe.Pointer(in.HostProcess)) return nil } @@ -8224,6 +8223,7 @@ func autoConvert_core_WindowsSecurityContextOptions_To_v1_WindowsSecurityContext out.GMSACredentialSpecName = (*string)(unsafe.Pointer(in.GMSACredentialSpecName)) out.GMSACredentialSpec = (*string)(unsafe.Pointer(in.GMSACredentialSpec)) out.RunAsUserName = (*string)(unsafe.Pointer(in.RunAsUserName)) + out.HostProcess = (*bool)(unsafe.Pointer(in.HostProcess)) return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/events.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/events.go index 0aa0bde368a6..91b3ffb82312 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/events.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/events.go @@ -109,7 +109,7 @@ func validateV1EventSeries(event *core.Event) field.ErrorList { zeroTime := time.Time{} if event.Series != nil { if event.Series.Count < 2 { - allErrs = append(allErrs, field.Invalid(field.NewPath("series.count"), "", fmt.Sprintf("should be at least 2"))) + allErrs = append(allErrs, field.Invalid(field.NewPath("series.count"), "", "should be at least 2")) } if event.Series.LastObservedTime.Time == zeroTime { allErrs = append(allErrs, field.Required(field.NewPath("series.lastObservedTime"), "")) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go index d9ebd9f93994..c2e05ed61f0a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go @@ -1216,8 +1216,8 @@ func validateMountPropagation(mountPropagation *core.MountPropagationMode, conta } if container == nil { - // The container is not available yet, e.g. during validation of - // PodPreset. Stop validation now, Pod validation will refuse final + // The container is not available yet. + // Stop validation now, Pod validation will refuse final // Pods with Bidirectional propagation in non-privileged containers. return allErrs } @@ -2961,10 +2961,14 @@ const ( // restrictions in Linux libc name resolution handling. // Max number of DNS name servers. MaxDNSNameservers = 3 - // Max number of domains in search path. - MaxDNSSearchPaths = 6 - // Max number of characters in search path. - MaxDNSSearchListChars = 256 + // Expanded max number of domains in the search path list. + MaxDNSSearchPathsExpanded = 32 + // Expanded max number of characters in the search path. + MaxDNSSearchListCharsExpanded = 2048 + // Max number of domains in the search path list. + MaxDNSSearchPathsLegacy = 6 + // Max number of characters in the search path list. + MaxDNSSearchListCharsLegacy = 256 ) func validateReadinessGates(readinessGates []core.PodReadinessGate, fldPath *field.Path) field.ErrorList { @@ -2977,7 +2981,7 @@ func validateReadinessGates(readinessGates []core.PodReadinessGate, fldPath *fie return allErrs } -func validatePodDNSConfig(dnsConfig *core.PodDNSConfig, dnsPolicy *core.DNSPolicy, fldPath *field.Path) field.ErrorList { +func validatePodDNSConfig(dnsConfig *core.PodDNSConfig, dnsPolicy *core.DNSPolicy, fldPath *field.Path, opts PodValidationOptions) field.ErrorList { allErrs := field.ErrorList{} // Validate DNSNone case. Must provide at least one DNS name server. @@ -3001,12 +3005,16 @@ func validatePodDNSConfig(dnsConfig *core.PodDNSConfig, dnsPolicy *core.DNSPolic } } // Validate searches. - if len(dnsConfig.Searches) > MaxDNSSearchPaths { - allErrs = append(allErrs, field.Invalid(fldPath.Child("searches"), dnsConfig.Searches, fmt.Sprintf("must not have more than %v search paths", MaxDNSSearchPaths))) + maxDNSSearchPaths, maxDNSSearchListChars := MaxDNSSearchPathsLegacy, MaxDNSSearchListCharsLegacy + if opts.AllowExpandedDNSConfig { + maxDNSSearchPaths, maxDNSSearchListChars = MaxDNSSearchPathsExpanded, MaxDNSSearchListCharsExpanded + } + if len(dnsConfig.Searches) > maxDNSSearchPaths { + allErrs = append(allErrs, field.Invalid(fldPath.Child("searches"), dnsConfig.Searches, fmt.Sprintf("must not have more than %v search paths", maxDNSSearchPaths))) } // Include the space between search paths. - if len(strings.Join(dnsConfig.Searches, " ")) > MaxDNSSearchListChars { - allErrs = append(allErrs, field.Invalid(fldPath.Child("searches"), dnsConfig.Searches, "must not have more than 256 characters (including spaces) in the search list")) + if len(strings.Join(dnsConfig.Searches, " ")) > maxDNSSearchListChars { + allErrs = append(allErrs, field.Invalid(fldPath.Child("searches"), dnsConfig.Searches, fmt.Sprintf("must not have more than %v characters (including spaces) in the search list", maxDNSSearchListChars))) } for i, search := range dnsConfig.Searches { // it is fine to have a trailing dot @@ -3204,6 +3212,10 @@ type PodValidationOptions struct { AllowInvalidPodDeletionCost bool // Allow pod spec to use non-integer multiple of huge page unit size AllowIndivisibleHugePagesValues bool + // Allow hostProcess field to be set in windows security context + AllowWindowsHostProcessField bool + // Allow more DNSSearchPaths and longer DNSSearchListChars + AllowExpandedDNSConfig bool } // ValidatePodSingleHugePageResources checks if there are multiple huge @@ -3324,9 +3336,10 @@ func ValidatePodSpec(spec *core.PodSpec, podMeta *metav1.ObjectMeta, fldPath *fi allErrs = append(allErrs, ValidatePodSecurityContext(spec.SecurityContext, spec, fldPath, fldPath.Child("securityContext"))...) allErrs = append(allErrs, validateImagePullSecrets(spec.ImagePullSecrets, fldPath.Child("imagePullSecrets"))...) allErrs = append(allErrs, validateAffinity(spec.Affinity, fldPath.Child("affinity"))...) - allErrs = append(allErrs, validatePodDNSConfig(spec.DNSConfig, &spec.DNSPolicy, fldPath.Child("dnsConfig"))...) + allErrs = append(allErrs, validatePodDNSConfig(spec.DNSConfig, &spec.DNSPolicy, fldPath.Child("dnsConfig"), opts)...) allErrs = append(allErrs, validateReadinessGates(spec.ReadinessGates, fldPath.Child("readinessGates"))...) allErrs = append(allErrs, validateTopologySpreadConstraints(spec.TopologySpreadConstraints, fldPath.Child("topologySpreadConstraints"))...) + allErrs = append(allErrs, validateWindowsHostProcessPod(spec, fldPath, opts)...) if len(spec.ServiceAccountName) > 0 { for _, msg := range ValidateServiceAccountName(spec.ServiceAccountName, false) { allErrs = append(allErrs, field.Invalid(fldPath.Child("serviceAccountName"), spec.ServiceAccountName, msg)) @@ -4085,11 +4098,7 @@ func ValidatePodStatusUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions allErrs = append(allErrs, ValidateContainerStateTransition(newPod.Status.InitContainerStatuses, oldPod.Status.InitContainerStatuses, fldPath.Child("initContainerStatuses"), oldPod.Spec.RestartPolicy)...) if newIPErrs := validatePodIPs(newPod); len(newIPErrs) > 0 { - // Tolerate IP errors if IP errors already existed in the old pod. See http://issue.k8s.io/90625 - // TODO(liggitt): Drop the check of oldPod in 1.20 - if oldIPErrs := validatePodIPs(oldPod); len(oldIPErrs) == 0 { - allErrs = append(allErrs, newIPErrs...) - } + allErrs = append(allErrs, newIPErrs...) } return allErrs @@ -4318,35 +4327,6 @@ func ValidateService(service *core.Service) field.ErrorList { ports[key] = true } - // Validate TopologyKeys - if len(service.Spec.TopologyKeys) > 0 { - topoPath := specPath.Child("topologyKeys") - // topologyKeys is mutually exclusive with 'externalTrafficPolicy=Local' - if service.Spec.ExternalTrafficPolicy == core.ServiceExternalTrafficPolicyTypeLocal { - allErrs = append(allErrs, field.Forbidden(topoPath, "may not be specified when `externalTrafficPolicy=Local`")) - } - if len(service.Spec.TopologyKeys) > core.MaxServiceTopologyKeys { - allErrs = append(allErrs, field.TooMany(topoPath, len(service.Spec.TopologyKeys), core.MaxServiceTopologyKeys)) - } - topoKeys := sets.NewString() - for i, key := range service.Spec.TopologyKeys { - keyPath := topoPath.Index(i) - if topoKeys.Has(key) { - allErrs = append(allErrs, field.Duplicate(keyPath, key)) - } - topoKeys.Insert(key) - // "Any" must be the last value specified - if key == v1.TopologyKeyAny && i != len(service.Spec.TopologyKeys)-1 { - allErrs = append(allErrs, field.Invalid(keyPath, key, `"*" must be the last value specified`)) - } - if key != v1.TopologyKeyAny { - for _, msg := range validation.IsQualifiedName(key) { - allErrs = append(allErrs, field.Invalid(keyPath, service.Spec.TopologyKeys, msg)) - } - } - } - } - // Validate SourceRange field and annotation _, ok := service.Annotations[core.AnnotationLoadBalancerSourceRangesKey] if len(service.Spec.LoadBalancerSourceRanges) > 0 || ok { @@ -5978,6 +5958,91 @@ func validateWindowsSecurityContextOptions(windowsOptions *core.WindowsSecurityC return allErrs } +func validateWindowsHostProcessPod(podSpec *core.PodSpec, fieldPath *field.Path, opts PodValidationOptions) field.ErrorList { + allErrs := field.ErrorList{} + + // Keep track of container and hostProcess container count for validate + containerCount := 0 + hostProcessContainerCount := 0 + + var podHostProcess *bool + if podSpec.SecurityContext != nil && podSpec.SecurityContext.WindowsOptions != nil { + podHostProcess = podSpec.SecurityContext.WindowsOptions.HostProcess + } + + if !opts.AllowWindowsHostProcessField && podHostProcess != nil { + // Do not allow pods to persist data that sets hostProcess (true or false) + errMsg := "not allowed when feature gate 'WindowsHostProcessContainers' is not enabled" + allErrs = append(allErrs, field.Forbidden(fieldPath.Child("securityContext", "windowsOptions", "hostProcess"), errMsg)) + return allErrs + } + + hostNetwork := false + if podSpec.SecurityContext != nil { + hostNetwork = podSpec.SecurityContext.HostNetwork + } + + podshelper.VisitContainersWithPath(podSpec, fieldPath, func(c *core.Container, cFieldPath *field.Path) bool { + containerCount++ + + var containerHostProcess *bool = nil + if c.SecurityContext != nil && c.SecurityContext.WindowsOptions != nil { + containerHostProcess = c.SecurityContext.WindowsOptions.HostProcess + } + + if !opts.AllowWindowsHostProcessField && containerHostProcess != nil { + // Do not allow pods to persist data that sets hostProcess (true or false) + errMsg := "not allowed when feature gate 'WindowsHostProcessContainers' is not enabled" + allErrs = append(allErrs, field.Forbidden(cFieldPath.Child("securityContext", "windowsOptions", "hostProcess"), errMsg)) + } + + if podHostProcess != nil && containerHostProcess != nil && *podHostProcess != *containerHostProcess { + errMsg := fmt.Sprintf("pod hostProcess value must be identical if both are specified, was %v", *podHostProcess) + allErrs = append(allErrs, field.Invalid(cFieldPath.Child("securityContext", "windowsOptions", "hostProcess"), *containerHostProcess, errMsg)) + } + + switch { + case containerHostProcess != nil && *containerHostProcess: + // Container explitly sets hostProcess=true + hostProcessContainerCount++ + case containerHostProcess == nil && podHostProcess != nil && *podHostProcess: + // Container inherits hostProcess=true from pod settings + hostProcessContainerCount++ + } + + return true + }) + + if hostProcessContainerCount > 0 { + // Fail Pod validation if feature is not enabled (unless podspec already exists and contains HostProcess fields) instead of dropping fields based on PRR reivew. + if !opts.AllowWindowsHostProcessField { + errMsg := "pod must not contain Windows hostProcess containers when feature gate 'WindowsHostProcessContainers' is not enabled" + allErrs = append(allErrs, field.Forbidden(fieldPath, errMsg)) + return allErrs + } + + // At present, if a Windows Pods contains any HostProcess containers than all containers must be + // HostProcess containers (explicitly set or inherited). + if hostProcessContainerCount != containerCount { + errMsg := "If pod contains any hostProcess containers then all containers must be HostProcess containers" + allErrs = append(allErrs, field.Invalid(fieldPath, "", errMsg)) + } + + // At present Windows Pods which contain HostProcess containers must also set HostNetwork. + if hostNetwork != true { + errMsg := "hostNetwork must be true if pod contains any hostProcess containers" + allErrs = append(allErrs, field.Invalid(fieldPath.Child("hostNetwork"), hostNetwork, errMsg)) + } + + if !capabilities.Get().AllowPrivileged { + errMsg := "hostProcess containers are disallowed by cluster policy" + allErrs = append(allErrs, field.Forbidden(fieldPath, errMsg)) + } + } + + return allErrs +} + func ValidatePodLogOptions(opts *core.PodLogOptions) field.ErrorList { allErrs := field.ErrorList{} if opts.TailLines != nil && *opts.TailLines < 0 { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go index 9f265c21c2b9..cb5e272f166d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go @@ -5292,11 +5292,6 @@ func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec) { *out = make([]string, len(*in)) copy(*out, *in) } - if in.TopologyKeys != nil { - in, out := &in.TopologyKeys, &out.TopologyKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } if in.AllocateLoadBalancerNodePorts != nil { in, out := &in.AllocateLoadBalancerNodePorts, &out.AllocateLoadBalancerNodePorts *out = new(bool) @@ -5895,6 +5890,11 @@ func (in *WindowsSecurityContextOptions) DeepCopyInto(out *WindowsSecurityContex *out = new(string) **out = **in } + if in.HostProcess != nil { + in, out := &in.HostProcess, &out.HostProcess + *out = new(bool) + **out = **in + } return } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/networking/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/networking/types.go index 565aea9784a7..a8edea71eea0 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/networking/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/networking/types.go @@ -492,8 +492,8 @@ const ( type HTTPIngressPath struct { // Path is matched against the path of an incoming request. Currently it can // contain characters disallowed from the conventional "path" part of a URL - // as defined by RFC 3986. Paths must begin with a '/'. When unspecified, - // all paths from incoming requests are matched. + // as defined by RFC 3986. Paths must begin with a '/' and must be present + // when using PathType with value "Exact" or "Prefix". // +optional Path string diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/OWNERS index 31a0a7358d6f..09f9d9f7c32f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/OWNERS @@ -2,6 +2,7 @@ # approval on api packages bubbles to api-approvers reviewers: +- sig-apps-api-reviewers - sig-apps-api-approvers - sig-auth-policy-approvers - sig-auth-policy-reviewers diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/validation/validation.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/validation/validation.go index a18d850ce6c7..94ad2f428de6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/validation/validation.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/apis/policy/validation/validation.go @@ -432,7 +432,7 @@ func validatePodSecurityPolicySysctls(fldPath *field.Path, sysctls []string) fie coversAll := false for i, s := range sysctls { if len(s) == 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Index(i), sysctls[i], fmt.Sprintf("empty sysctl not allowed"))) + allErrs = append(allErrs, field.Invalid(fldPath.Index(i), sysctls[i], "empty sysctl not allowed")) } else if !IsValidSysctlPattern(string(s)) { allErrs = append( allErrs, @@ -447,7 +447,7 @@ func validatePodSecurityPolicySysctls(fldPath *field.Path, sysctls []string) fie } if coversAll && len(sysctls) > 1 { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("items"), fmt.Sprintf("if '*' is present, must not specify other sysctls"))) + allErrs = append(allErrs, field.Forbidden(fldPath.Child("items"), "if '*' is present, must not specify other sysctls")) } return allErrs diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/cluster/ports/ports.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/cluster/ports/ports.go index 7407060d9207..8fd44e01b401 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/cluster/ports/ports.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/cluster/ports/ports.go @@ -25,10 +25,6 @@ const ( // KubeletPort is the default port for the kubelet server on each host machine. // May be overridden by a flag at startup. KubeletPort = 10250 - // InsecureKubeControllerManagerPort is the default port for the controller manager status server. - // May be overridden by a flag at startup. - // Deprecated: use the secure KubeControllerManagerPort instead. - InsecureKubeControllerManagerPort = 10252 // KubeletReadOnlyPort exposes basic read-only services from the kubelet. // May be overridden by a flag at startup. // This is necessary for heapster to collect monitoring stats from the kubelet diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go index 9c623e5d047d..35d85d59ea8f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go @@ -445,13 +445,10 @@ func (r RealControllerRevisionControl) PatchControllerRevision(namespace, name s // PodControlInterface is an interface that knows how to add or delete pods // created as an interface to allow testing. type PodControlInterface interface { - // CreatePods creates new pods according to the spec. - CreatePods(namespace string, template *v1.PodTemplateSpec, object runtime.Object) error - // CreatePodsOnNode creates a new pod according to the spec on the specified node, - // and sets the ControllerRef. - CreatePodsOnNode(nodeName, namespace string, template *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error - // CreatePodsWithControllerRef creates new pods according to the spec, and sets object as the pod's controller. - CreatePodsWithControllerRef(namespace string, template *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error + // CreatePods creates new pods according to the spec, and sets object as the pod's controller. + CreatePods(namespace string, template *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error + // CreatePodsWithGenerateName creates new pods according to the spec, sets object as the pod's controller and sets pod's generateName. + CreatePodsWithGenerateName(namespace string, template *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference, generateName string) error // DeletePod deletes the pod identified by podID. DeletePod(namespace string, podID string, object runtime.Object) error // PatchPod patches the pod. @@ -516,22 +513,22 @@ func validateControllerRef(controllerRef *metav1.OwnerReference) error { return nil } -func (r RealPodControl) CreatePods(namespace string, template *v1.PodTemplateSpec, object runtime.Object) error { - return r.createPods("", namespace, template, object, nil) +func (r RealPodControl) CreatePods(namespace string, template *v1.PodTemplateSpec, controllerObject runtime.Object, controllerRef *metav1.OwnerReference) error { + return r.CreatePodsWithGenerateName(namespace, template, controllerObject, controllerRef, "") } -func (r RealPodControl) CreatePodsWithControllerRef(namespace string, template *v1.PodTemplateSpec, controllerObject runtime.Object, controllerRef *metav1.OwnerReference) error { +func (r RealPodControl) CreatePodsWithGenerateName(namespace string, template *v1.PodTemplateSpec, controllerObject runtime.Object, controllerRef *metav1.OwnerReference, generateName string) error { if err := validateControllerRef(controllerRef); err != nil { return err } - return r.createPods("", namespace, template, controllerObject, controllerRef) -} - -func (r RealPodControl) CreatePodsOnNode(nodeName, namespace string, template *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error { - if err := validateControllerRef(controllerRef); err != nil { + pod, err := GetPodFromTemplate(template, controllerObject, controllerRef) + if err != nil { return err } - return r.createPods(nodeName, namespace, template, object, controllerRef) + if len(generateName) > 0 { + pod.ObjectMeta.GenerateName = generateName + } + return r.createPods(namespace, pod, controllerObject) } func (r RealPodControl) PatchPod(namespace, name string, data []byte) error { @@ -564,14 +561,7 @@ func GetPodFromTemplate(template *v1.PodTemplateSpec, parentObject runtime.Objec return pod, nil } -func (r RealPodControl) createPods(nodeName, namespace string, template *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error { - pod, err := GetPodFromTemplate(template, object, controllerRef) - if err != nil { - return err - } - if len(nodeName) != 0 { - pod.Spec.NodeName = nodeName - } +func (r RealPodControl) createPods(namespace string, pod *v1.Pod, object runtime.Object) error { if len(labels.Set(pod.Labels)) == 0 { return fmt.Errorf("unable to create pods, no labels") } @@ -636,21 +626,7 @@ func (f *FakePodControl) PatchPod(namespace, name string, data []byte) error { return nil } -func (f *FakePodControl) CreatePods(namespace string, spec *v1.PodTemplateSpec, object runtime.Object) error { - f.Lock() - defer f.Unlock() - f.CreateCallCount++ - if f.CreateLimit != 0 && f.CreateCallCount > f.CreateLimit { - return fmt.Errorf("not creating pod, limit %d already reached (create call %d)", f.CreateLimit, f.CreateCallCount) - } - f.Templates = append(f.Templates, *spec) - if f.Err != nil { - return f.Err - } - return nil -} - -func (f *FakePodControl) CreatePodsWithControllerRef(namespace string, spec *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error { +func (f *FakePodControl) CreatePods(namespace string, spec *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error { f.Lock() defer f.Unlock() f.CreateCallCount++ @@ -665,14 +641,14 @@ func (f *FakePodControl) CreatePodsWithControllerRef(namespace string, spec *v1. return nil } -func (f *FakePodControl) CreatePodsOnNode(nodeName, namespace string, template *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error { +func (f *FakePodControl) CreatePodsWithGenerateName(namespace string, spec *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference, generateNamePrefix string) error { f.Lock() defer f.Unlock() f.CreateCallCount++ if f.CreateLimit != 0 && f.CreateCallCount > f.CreateLimit { return fmt.Errorf("not creating pod, limit %d already reached (create call %d)", f.CreateLimit, f.CreateCallCount) } - f.Templates = append(f.Templates, *template) + f.Templates = append(f.Templates, *spec) f.ControllerRefs = append(f.ControllerRefs, *controllerRef) if f.Err != nil { return f.Err diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/features/kube_features.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/features/kube_features.go index a3f4a2dc59ad..5d12521d39f7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/features/kube_features.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/features/kube_features.go @@ -27,6 +27,7 @@ const ( // Every feature gate should add method here following this template: // // // owner: @username + // // kep: http://kep.k8s.io/NNN // // alpha: v1.X // MyFeature featuregate.Feature = "MyFeature" @@ -147,6 +148,7 @@ const ( LegacyNodeRoleBehavior featuregate.Feature = "LegacyNodeRoleBehavior" // owner @brendandburns + // kep: http://kep.k8s.io/1143 // alpha: v1.9 // beta: v1.19 // ga: v1.21 @@ -179,6 +181,7 @@ const ( // owner: @mikedanese // alpha: v1.13 // beta: v1.21 + // ga: v1.22 // // Migrate ServiceAccount volumes to use a projected volume consisting of a // ServiceAccountTokenVolumeProjection. This feature adds new required flags @@ -196,13 +199,6 @@ const ( // intended to be used for service account token verification. ServiceAccountIssuerDiscovery featuregate.Feature = "ServiceAccountIssuerDiscovery" - // owner: @Random-Liu - // beta: v1.11 - // ga: v1.21 - // - // Enable container log rotation for cri container runtime - CRIContainerLogRotation featuregate.Feature = "CRIContainerLogRotation" - // owner: @krmayankk // beta: v1.14 // ga: v1.21 @@ -255,6 +251,7 @@ const ( // owner: @chendave // alpha: v1.21 + // beta: v1.22 // // PreferNominatedNode tells scheduler whether the nominated node will be checked first before looping // all the rest of nodes in the cluster. @@ -281,19 +278,12 @@ const ( NodeLease featuregate.Feature = "NodeLease" // owner: @rikatz + // kep: http://kep.k8s.io/2079 // alpha: v1.21 // // Enables the endPort field in NetworkPolicy to enable a Port Range behavior in Network Policies. NetworkPolicyEndPort featuregate.Feature = "NetworkPolicyEndPort" - // owner: @xing-yang - // alpha: v1.12 - // beta: v1.17 - // GA: v1.20 - // - // Enable volume snapshot data source support. - VolumeSnapshotDataSource featuregate.Feature = "VolumeSnapshotDataSource" - // owner: @jessfraz // alpha: v1.12 // @@ -308,6 +298,7 @@ const ( // owner: @alculquicondor // alpha: v1.21 + // beta: v1.22 // // Allows Job controller to manage Pod completions per completion index. IndexedJob featuregate.Feature = "IndexedJob" @@ -384,13 +375,6 @@ const ( // Enables the vSphere in-tree driver to vSphere CSI Driver migration feature. CSIMigrationvSphere featuregate.Feature = "CSIMigrationvSphere" - // owner: @divyenpatel - // beta: v1.19 (requires: vSphere vCenter/ESXi Version: 7.0u1, HW Version: VM version 15) - // - // Disables the vSphere in-tree driver. - // Expects vSphere CSI Driver to be installed and configured on all nodes. - CSIMigrationvSphereComplete featuregate.Feature = "CSIMigrationvSphereComplete" - // owner: @divyenpatel // alpha: v1.21 // @@ -453,6 +437,7 @@ const ( PodOverhead featuregate.Feature = "PodOverhead" // owner: @khenidak + // kep: http://kep.k8s.io/563 // alpha: v1.15 // beta: v1.21 // @@ -460,6 +445,7 @@ const ( IPv6DualStack featuregate.Feature = "IPv6DualStack" // owner: @robscott @freehan + // kep: http://kep.k8s.io/752 // alpha: v1.16 // beta: v1.18 // ga: v1.21 @@ -468,6 +454,7 @@ const ( EndpointSlice featuregate.Feature = "EndpointSlice" // owner: @robscott @freehan + // kep: http://kep.k8s.io/752 // alpha: v1.18 // beta: v1.19 // @@ -475,6 +462,7 @@ const ( EndpointSliceProxying featuregate.Feature = "EndpointSliceProxying" // owner: @robscott @kumarvin123 + // kep: http://kep.k8s.io/752 // alpha: v1.19 // beta: v1.21 // @@ -506,26 +494,20 @@ const ( // owner: @alaypatel07, @soltysh // alpha: v1.20 // beta: v1.21 + // GA: v1.22 // // CronJobControllerV2 controls whether the controller manager starts old cronjob // controller or new one which is implemented with informers and delaying queue - // - // This feature is deprecated, and will be removed in v1.22. CronJobControllerV2 featuregate.Feature = "CronJobControllerV2" // owner: @smarterclayton // alpha: v1.21 - // + // beta: v1.22 // DaemonSets allow workloads to maintain availability during update per node DaemonSetUpdateSurge featuregate.Feature = "DaemonSetUpdateSurge" - // owner: @m1093782566 - // alpha: v1.17 - // - // Enables topology aware service routing - ServiceTopology featuregate.Feature = "ServiceTopology" - // owner: @robscott + // kep: http://kep.k8s.io/1507 // alpha: v1.18 // beta: v1.19 // ga: v1.20 @@ -564,6 +546,7 @@ const ( AnyVolumeDataSource featuregate.Feature = "AnyVolumeDataSource" // owner: @javidiaz + // kep: http://kep.k8s.io/1797 // alpha: v1.19 // beta: v1.20 // @@ -598,22 +581,15 @@ const ( // in target pods HPAContainerMetrics featuregate.Feature = "HPAContainerMetrics" - // owner: @zshihang - // alpha: v1.13 - // beta: v1.20 - // ga: v1.21 - // - // Allows kube-controller-manager to publish kube-root-ca.crt configmap to - // every namespace. This feature is a prerequisite of BoundServiceAccountTokenVolume. - RootCAConfigMap featuregate.Feature = "RootCAConfigMap" - // owner: @andrewsykim + // kep: http://kep.k8s.io/1672 // alpha: v1.20 // // Enable Terminating condition in Endpoint Slices. EndpointSliceTerminatingCondition featuregate.Feature = "EndpointSliceTerminatingCondition" // owner: @robscott + // kep: http://kep.k8s.io/752 // alpha: v1.20 // // Enable NodeName field on Endpoint Slices. @@ -640,6 +616,12 @@ const ( // Enable kubelet exec plugins for image pull credentials. KubeletCredentialProviders featuregate.Feature = "KubeletCredentialProviders" + // owner: @andrewsykim + // alpha: v1.22 + // + // Disable any functionality in kube-apiserver, kube-controller-manager and kubelet related to the `--cloud-provider` component flag. + DisableCloudProviders featuregate.Feature = "DisableCloudProviders" + // owner: @zshihang // alpha: v1.20 // beta: v1.21 @@ -655,12 +637,14 @@ const ( GracefulNodeShutdown featuregate.Feature = "GracefulNodeShutdown" // owner: @andrewsykim @uablrek + // kep: http://kep.k8s.io/1864 // alpha: v1.20 // // Allows control if NodePorts shall be created for services with "type: LoadBalancer" by defining the spec.AllocateLoadBalancerNodePorts field (bool) ServiceLBNodePortControl featuregate.Feature = "ServiceLBNodePortControl" // owner: @janosi + // kep: http://kep.k8s.io/1435 // alpha: v1.20 // // Enables the usage of different protocols in the same Service with type=LoadBalancer @@ -678,6 +662,7 @@ const ( PodDeletionCost featuregate.Feature = "PodDeletionCost" // owner: @robscott + // kep: http://kep.k8s.io/2433 // alpha: v1.21 // // Enables topology aware hints for EndpointSlices @@ -691,11 +676,13 @@ const ( // owner: @ahg-g // alpha: v1.21 + // beta: v1.22 // // Allow specifying NamespaceSelector in PodAffinityTerm. PodAffinityNamespaceSelector featuregate.Feature = "PodAffinityNamespaceSelector" // owner: @andrewsykim @xudongliuharold + // kep: http://kep.k8s.io/1959 // alpha: v1.21 // // Enable support multiple Service "type: LoadBalancer" implementations in a cluster by specifying LoadBalancerClass @@ -708,12 +695,14 @@ const ( LogarithmicScaleDown featuregate.Feature = "LogarithmicScaleDown" // owner: @hbagdi + // kep: http://kep.k8s.io/2365 // alpha: v1.21 // // Enable Scope and Namespace fields on IngressClassParametersReference. IngressClassNamespacedParams featuregate.Feature = "IngressClassNamespacedParams" // owner: @maplain @andrewsykim + // kep: http://kep.k8s.io/2086 // alpha: v1.21 // // Enables node-local routing for Service internal traffic @@ -732,6 +721,7 @@ const ( KubeletPodResourcesGetAllocatable featuregate.Feature = "KubeletPodResourcesGetAllocatable" // owner: @jayunit100 @abhiraut @rikatz + // kep: http://kep.k8s.io/2161 // beta: v1.21 // ga: v1.22 // @@ -743,6 +733,25 @@ const ( // // Enables kubelet to detect CSI volume condition and send the event of the abnormal volume to the corresponding pod that is using it. CSIVolumeHealth featuregate.Feature = "CSIVolumeHealth" + + // owner: @marosset + // alpha: v1.22 + // + // Enables support for 'HostProcess' containers on Windows nodes. + WindowsHostProcessContainers featuregate.Feature = "WindowsHostProcessContainers" + + // owner: @ravig + // alpha: v1.22 + // + // StatefulSetMinReadySeconds allows minReadySeconds to be respected by StatefulSet controller + StatefulSetMinReadySeconds featuregate.Feature = "StatefulSetMinReadySeconds" + + // owner: @gjkim42 + // kep: http://kep.k8s.io/2595 + // alpha: v1.22 + // + // Enables apiserver and kubelet to allow up to 32 DNSSearchPaths and up to 2048 DNSSearchListChars. + ExpandedDNSConfig featuregate.Feature = "ExpandedDNSConfig" ) func init() { @@ -769,14 +778,13 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS MemoryManager: {Default: false, PreRelease: featuregate.Alpha}, CPUCFSQuotaPeriod: {Default: false, PreRelease: featuregate.Alpha}, TopologyManager: {Default: true, PreRelease: featuregate.Beta}, - ServiceNodeExclusion: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 + ServiceNodeExclusion: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 NodeDisruptionExclusion: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 StorageObjectInUseProtection: {Default: true, PreRelease: featuregate.GA}, SupportPodPidsLimit: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 SupportNodePidsLimit: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 - BoundServiceAccountTokenVolume: {Default: true, PreRelease: featuregate.Beta}, + BoundServiceAccountTokenVolume: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 ServiceAccountIssuerDiscovery: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 - CRIContainerLogRotation: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 CSIMigration: {Default: true, PreRelease: featuregate.Beta}, CSIMigrationGCE: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires GCE PD CSI Driver) InTreePluginGCEUnregister: {Default: false, PreRelease: featuregate.Alpha}, @@ -787,7 +795,6 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS CSIMigrationAzureFile: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires Azure File CSI driver) InTreePluginAzureFileUnregister: {Default: false, PreRelease: featuregate.Alpha}, CSIMigrationvSphere: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires vSphere CSI driver) - CSIMigrationvSphereComplete: {Default: false, PreRelease: featuregate.Beta}, // remove in 1.22 InTreePluginvSphereUnregister: {Default: false, PreRelease: featuregate.Alpha}, CSIMigrationOpenStack: {Default: true, PreRelease: featuregate.Beta}, InTreePluginOpenStackUnregister: {Default: false, PreRelease: featuregate.Alpha}, @@ -802,10 +809,9 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS RuntimeClass: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 NodeLease: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, NetworkPolicyEndPort: {Default: false, PreRelease: featuregate.Alpha}, - VolumeSnapshotDataSource: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21 ProcMountType: {Default: false, PreRelease: featuregate.Alpha}, TTLAfterFinished: {Default: true, PreRelease: featuregate.Beta}, - IndexedJob: {Default: false, PreRelease: featuregate.Alpha}, + IndexedJob: {Default: true, PreRelease: featuregate.Beta}, KubeletPodResources: {Default: true, PreRelease: featuregate.Beta}, LocalStorageCapacityIsolationFSQuotaMonitoring: {Default: false, PreRelease: featuregate.Alpha}, NonPreemptingPriority: {Default: true, PreRelease: featuregate.Beta}, @@ -819,10 +825,9 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS StartupProbe: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 AllowInsecureBackendProxy: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 PodDisruptionBudget: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25 - CronJobControllerV2: {Default: true, PreRelease: featuregate.Beta}, - DaemonSetUpdateSurge: {Default: false, PreRelease: featuregate.Alpha}, - ServiceTopology: {Default: false, PreRelease: featuregate.Alpha}, - ServiceAppProtocol: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + CronJobControllerV2: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + DaemonSetUpdateSurge: {Default: true, PreRelease: featuregate.Beta}, // on by default in 1.22 + ServiceAppProtocol: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 ImmutableEphemeralVolumes: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.24 HugePageStorageMediumSize: {Default: true, PreRelease: featuregate.Beta}, DownwardAPIHugePages: {Default: false, PreRelease: featuregate.Beta}, // on by default in 1.22 @@ -833,7 +838,6 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS WinDSR: {Default: false, PreRelease: featuregate.Alpha}, DisableAcceleratorUsageMetrics: {Default: true, PreRelease: featuregate.Beta}, HPAContainerMetrics: {Default: false, PreRelease: featuregate.Alpha}, - RootCAConfigMap: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 SizeMemoryBackedVolumes: {Default: true, PreRelease: featuregate.Beta}, ExecProbeTimeout: {Default: true, PreRelease: featuregate.GA}, // lock to default and remove after v1.22 based on KEP #1972 update KubeletCredentialProviders: {Default: false, PreRelease: featuregate.Alpha}, @@ -841,12 +845,12 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS ServiceLBNodePortControl: {Default: false, PreRelease: featuregate.Alpha}, MixedProtocolLBService: {Default: false, PreRelease: featuregate.Alpha}, VolumeCapacityPriority: {Default: false, PreRelease: featuregate.Alpha}, - PreferNominatedNode: {Default: false, PreRelease: featuregate.Alpha}, + PreferNominatedNode: {Default: true, PreRelease: featuregate.Beta}, ProbeTerminationGracePeriod: {Default: false, PreRelease: featuregate.Alpha}, RunAsGroup: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 PodDeletionCost: {Default: true, PreRelease: featuregate.Beta}, TopologyAwareHints: {Default: false, PreRelease: featuregate.Alpha}, - PodAffinityNamespaceSelector: {Default: false, PreRelease: featuregate.Alpha}, + PodAffinityNamespaceSelector: {Default: true, PreRelease: featuregate.Beta}, ServiceLoadBalancerClass: {Default: false, PreRelease: featuregate.Alpha}, LogarithmicScaleDown: {Default: false, PreRelease: featuregate.Alpha}, IngressClassNamespacedParams: {Default: false, PreRelease: featuregate.Alpha}, @@ -855,18 +859,22 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS KubeletPodResourcesGetAllocatable: {Default: false, PreRelease: featuregate.Alpha}, NamespaceDefaultLabelName: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.24 CSIVolumeHealth: {Default: false, PreRelease: featuregate.Alpha}, + WindowsHostProcessContainers: {Default: false, PreRelease: featuregate.Alpha}, + DisableCloudProviders: {Default: false, PreRelease: featuregate.Alpha}, + StatefulSetMinReadySeconds: {Default: false, PreRelease: featuregate.Alpha}, + ExpandedDNSConfig: {Default: false, PreRelease: featuregate.Alpha}, // inherited features from generic apiserver, relisted here to get a conflict if it is changed // unintentionally on either side: - genericfeatures.StreamingProxyRedirects: {Default: true, PreRelease: featuregate.Deprecated}, - genericfeatures.ValidateProxyRedirects: {Default: true, PreRelease: featuregate.Beta}, + genericfeatures.StreamingProxyRedirects: {Default: false, PreRelease: featuregate.Deprecated}, // remove in 1.24 + genericfeatures.ValidateProxyRedirects: {Default: true, PreRelease: featuregate.Deprecated}, genericfeatures.AdvancedAuditing: {Default: true, PreRelease: featuregate.GA}, genericfeatures.APIResponseCompression: {Default: true, PreRelease: featuregate.Beta}, genericfeatures.APIListChunking: {Default: true, PreRelease: featuregate.Beta}, genericfeatures.DryRun: {Default: true, PreRelease: featuregate.GA}, genericfeatures.ServerSideApply: {Default: true, PreRelease: featuregate.GA}, genericfeatures.APIPriorityAndFairness: {Default: true, PreRelease: featuregate.Beta}, - genericfeatures.WarningHeaders: {Default: true, PreRelease: featuregate.Beta}, + genericfeatures.WarningHeaders: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.24 // features that enable backwards compatibility but are scheduled to be removed // ... diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go index 991afe5fcfeb..51861d2b4e30 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go @@ -83,15 +83,20 @@ func New(imageFsInfoProvider ImageFsInfoProvider, rootPath string, cgroupRoots [ sysFs := sysfs.NewRealSysFs() includedMetrics := cadvisormetrics.MetricSet{ - cadvisormetrics.CpuUsageMetrics: struct{}{}, - cadvisormetrics.MemoryUsageMetrics: struct{}{}, - cadvisormetrics.CpuLoadMetrics: struct{}{}, - cadvisormetrics.DiskIOMetrics: struct{}{}, - cadvisormetrics.NetworkUsageMetrics: struct{}{}, - cadvisormetrics.AcceleratorUsageMetrics: struct{}{}, - cadvisormetrics.AppMetrics: struct{}{}, - cadvisormetrics.ProcessMetrics: struct{}{}, + cadvisormetrics.CpuUsageMetrics: struct{}{}, + cadvisormetrics.MemoryUsageMetrics: struct{}{}, + cadvisormetrics.CpuLoadMetrics: struct{}{}, + cadvisormetrics.DiskIOMetrics: struct{}{}, + cadvisormetrics.NetworkUsageMetrics: struct{}{}, + cadvisormetrics.AppMetrics: struct{}{}, + cadvisormetrics.ProcessMetrics: struct{}{}, } + + // Only add the Accelerator metrics if the feature is inactive + if !utilfeature.DefaultFeatureGate.Enabled(kubefeatures.DisableAcceleratorUsageMetrics) { + includedMetrics[cadvisormetrics.AcceleratorUsageMetrics] = struct{}{} + } + if usingLegacyStats || utilfeature.DefaultFeatureGate.Enabled(kubefeatures.LocalStorageCapacityIsolation) { includedMetrics[cadvisormetrics.DiskUsageMetrics] = struct{}{} } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go index f598d466b0b3..7d1687948ef5 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go @@ -17,6 +17,7 @@ limitations under the License. package cm import ( + "errors" "fmt" "io/ioutil" "os" @@ -29,6 +30,7 @@ import ( libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups" cgroupfs "github.com/opencontainers/runc/libcontainer/cgroups/fs" cgroupfs2 "github.com/opencontainers/runc/libcontainer/cgroups/fs2" + "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" cgroupsystemd "github.com/opencontainers/runc/libcontainer/cgroups/systemd" libcontainerconfigs "github.com/opencontainers/runc/libcontainer/configs" libcontainerdevices "github.com/opencontainers/runc/libcontainer/devices" @@ -330,53 +332,6 @@ func (m *cgroupManagerImpl) Destroy(cgroupConfig *CgroupConfig) error { return nil } -type subsystem interface { - // Name returns the name of the subsystem. - Name() string - // Set the cgroup represented by cgroup. - Set(path string, cgroup *libcontainerconfigs.Cgroup) error - // GetStats returns the statistics associated with the cgroup - GetStats(path string, stats *libcontainercgroups.Stats) error -} - -// getSupportedSubsystems returns a map of subsystem and if it must be mounted for the kubelet to function. -func getSupportedSubsystems() map[subsystem]bool { - supportedSubsystems := map[subsystem]bool{ - &cgroupfs.MemoryGroup{}: true, - &cgroupfs.CpuGroup{}: true, - &cgroupfs.PidsGroup{}: true, - } - // not all hosts support hugetlb cgroup, and in the absent of hugetlb, we will fail silently by reporting no capacity. - supportedSubsystems[&cgroupfs.HugetlbGroup{}] = false - return supportedSubsystems -} - -// setSupportedSubsystemsV1 sets cgroup resource limits on cgroup v1 only on the supported -// subsystems. ie. cpu and memory. We don't use libcontainer's cgroup/fs/Set() -// method as it doesn't allow us to skip updates on the devices cgroup -// Allowing or denying all devices by writing 'a' to devices.allow or devices.deny is -// not possible once the device cgroups has children. Once the pod level cgroup are -// created under the QOS level cgroup we cannot update the QOS level device cgroup. -// We would like to skip setting any values on the device cgroup in this case -// but this is not possible with libcontainers Set() method -// See https://github.com/opencontainers/runc/issues/932 -func setSupportedSubsystemsV1(cgroupConfig *libcontainerconfigs.Cgroup) error { - for sys, required := range getSupportedSubsystems() { - if _, ok := cgroupConfig.Paths[sys.Name()]; !ok { - if required { - return fmt.Errorf("failed to find subsystem mount for required subsystem: %v", sys.Name()) - } - // the cgroup is not mounted, but its not required so continue... - klog.V(6).InfoS("Unable to find subsystem mount for optional subsystem", "subsystemName", sys.Name()) - continue - } - if err := sys.Set(cgroupConfig.Paths[sys.Name()], cgroupConfig); err != nil { - return fmt.Errorf("failed to set config for supported subsystems : %v", err) - } - } - return nil -} - // getCpuWeight converts from the range [2, 262144] to [1, 10000] func getCpuWeight(cpuShares *uint64) uint64 { if cpuShares == nil { @@ -419,85 +374,6 @@ func getSupportedUnifiedControllers() sets.String { return supportedControllers.Intersection(availableRootControllers) } -// propagateControllers on an unified hierarchy enables all the supported controllers for the specified cgroup -func propagateControllers(path string) error { - if err := os.MkdirAll(filepath.Join(cmutil.CgroupRoot, path), 0755); err != nil { - return fmt.Errorf("failed to create cgroup %q : %v", path, err) - } - - // Retrieve all the supported controllers from the cgroup root - controllersFileContent, err := ioutil.ReadFile(filepath.Join(cmutil.CgroupRoot, "cgroup.controllers")) - if err != nil { - return fmt.Errorf("failed to read controllers from %q : %v", cmutil.CgroupRoot, err) - } - - supportedControllers := getSupportedUnifiedControllers() - - // The retrieved content looks like: "cpuset cpu io memory hugetlb pids". Prepend each of the controllers - // with '+', so we have something like "+cpuset +cpu +io +memory +hugetlb +pids" - controllers := "" - for _, controller := range strings.Fields(string(controllersFileContent)) { - // ignore controllers we don't care about - if !supportedControllers.Has(controller) { - continue - } - - sep := " +" - if controllers == "" { - sep = "+" - } - controllers = controllers + sep + controller - } - - current := cmutil.CgroupRoot - - // Write the controllers list to each "cgroup.subtree_control" file until it reaches the parent cgroup. - // For the /foo/bar/baz cgroup, controllers must be enabled sequentially in the files: - // - /sys/fs/cgroup/foo/cgroup.subtree_control - // - /sys/fs/cgroup/foo/bar/cgroup.subtree_control - for _, p := range strings.Split(filepath.Dir(path), "/") { - current = filepath.Join(current, p) - if err := ioutil.WriteFile(filepath.Join(current, "cgroup.subtree_control"), []byte(controllers), 0755); err != nil { - return fmt.Errorf("failed to enable controllers on %q: %v", cmutil.CgroupRoot, err) - } - } - return nil -} - -// setResourcesV2 sets cgroup resource limits on cgroup v2 -func setResourcesV2(cgroupConfig *libcontainerconfigs.Cgroup) error { - if err := propagateControllers(cgroupConfig.Path); err != nil { - return err - } - cgroupConfig.Resources.Devices = []*libcontainerdevices.Rule{ - { - Type: 'a', - Permissions: "rwm", - Allow: true, - Minor: libcontainerdevices.Wildcard, - Major: libcontainerdevices.Wildcard, - }, - } - cgroupConfig.Resources.SkipDevices = true - - // if the hugetlb controller is missing - supportedControllers := getSupportedUnifiedControllers() - if !supportedControllers.Has("hugetlb") { - cgroupConfig.Resources.HugetlbLimit = nil - // the cgroup is not present, but its not required so skip it - klog.V(6).InfoS("Optional subsystem not supported: hugetlb") - } - - manager, err := cgroupfs2.NewManager(cgroupConfig, filepath.Join(cmutil.CgroupRoot, cgroupConfig.Path), false) - if err != nil { - return fmt.Errorf("failed to create cgroup v2 manager: %v", err) - } - config := &libcontainerconfigs.Config{ - Cgroups: cgroupConfig, - } - return manager.Set(config) -} - func (m *cgroupManagerImpl) toResources(resourceConfig *ResourceConfig) *libcontainerconfigs.Resources { resources := &libcontainerconfigs.Resources{ Devices: []*libcontainerdevices.Rule{ @@ -577,10 +453,11 @@ func (m *cgroupManagerImpl) Update(cgroupConfig *CgroupConfig) error { } unified := libcontainercgroups.IsCgroup2UnifiedMode() + var paths map[string]string if unified { libcontainerCgroupConfig.Path = m.Name(cgroupConfig.Name) } else { - libcontainerCgroupConfig.Paths = m.buildCgroupPaths(cgroupConfig.Name) + paths = m.buildCgroupPaths(cgroupConfig.Name) } // libcontainer consumes a different field and expects a different syntax @@ -590,19 +467,25 @@ func (m *cgroupManagerImpl) Update(cgroupConfig *CgroupConfig) error { } if cgroupConfig.ResourceParameters != nil && cgroupConfig.ResourceParameters.PidsLimit != nil { - libcontainerCgroupConfig.PidsLimit = *cgroupConfig.ResourceParameters.PidsLimit + resources.PidsLimit = *cgroupConfig.ResourceParameters.PidsLimit } if unified { - if err := setResourcesV2(libcontainerCgroupConfig); err != nil { - return fmt.Errorf("failed to set resources for cgroup %v: %v", cgroupConfig.Name, err) - } - } else { - if err := setSupportedSubsystemsV1(libcontainerCgroupConfig); err != nil { - return fmt.Errorf("failed to set supported cgroup subsystems for cgroup %v: %v", cgroupConfig.Name, err) + supportedControllers := getSupportedUnifiedControllers() + if !supportedControllers.Has("hugetlb") { + resources.HugetlbLimit = nil + klog.V(6).InfoS("Optional subsystem not supported: hugetlb") } + } else if _, ok := m.subsystems.MountPoints["hugetlb"]; !ok { + resources.HugetlbLimit = nil + klog.V(6).InfoS("Optional subsystem not supported: hugetlb") } - return nil + + manager, err := m.adapter.newManager(libcontainerCgroupConfig, paths) + if err != nil { + return fmt.Errorf("failed to create cgroup manager: %v", err) + } + return manager.Set(resources) } // Create creates the specified cgroup @@ -718,53 +601,21 @@ func (m *cgroupManagerImpl) ReduceCPULimits(cgroupName CgroupName) error { return m.Update(containerConfig) } -func getStatsSupportedSubsystems(cgroupPaths map[string]string) (*libcontainercgroups.Stats, error) { - stats := libcontainercgroups.NewStats() - for sys, required := range getSupportedSubsystems() { - if _, ok := cgroupPaths[sys.Name()]; !ok { - if required { - return nil, fmt.Errorf("failed to find subsystem mount for required subsystem: %v", sys.Name()) - } - // the cgroup is not mounted, but its not required so continue... - klog.V(6).InfoS("Unable to find subsystem mount for optional subsystem", "subsystemName", sys.Name()) - continue - } - if err := sys.GetStats(cgroupPaths[sys.Name()], stats); err != nil { - return nil, fmt.Errorf("failed to get stats for supported subsystems : %v", err) - } - } - return stats, nil -} - -func toResourceStats(stats *libcontainercgroups.Stats) *ResourceStats { - return &ResourceStats{ - MemoryStats: &MemoryStats{ - Usage: int64(stats.MemoryStats.Usage.Usage), - }, - } -} - -// Get sets the ResourceParameters of the specified cgroup as read from the cgroup fs -func (m *cgroupManagerImpl) GetResourceStats(name CgroupName) (*ResourceStats, error) { - var err error - var stats *libcontainercgroups.Stats +// MemoryUsage returns the current memory usage of the specified cgroup, +// as read from cgroupfs. +func (m *cgroupManagerImpl) MemoryUsage(name CgroupName) (int64, error) { + var path, file string if libcontainercgroups.IsCgroup2UnifiedMode() { - cgroupPath := m.buildCgroupUnifiedPath(name) - manager, err := cgroupfs2.NewManager(nil, cgroupPath, false) - if err != nil { - return nil, fmt.Errorf("failed to create cgroup v2 manager: %v", err) - } - - stats, err = manager.GetStats() - if err != nil { - return nil, fmt.Errorf("failed to get stats for cgroup %v: %v", name, err) - } + path = m.buildCgroupUnifiedPath(name) + file = "memory.current" } else { - cgroupPaths := m.buildCgroupPaths(name) - stats, err = getStatsSupportedSubsystems(cgroupPaths) - if err != nil { - return nil, fmt.Errorf("failed to get stats supported cgroup subsystems for cgroup %v: %v", name, err) + mp, ok := m.subsystems.MountPoints["memory"] + if !ok { // should not happen + return -1, errors.New("no cgroup v1 mountpoint for memory controller found") } + path = mp + "/" + m.Name(name) + file = "memory.usage_in_bytes" } - return toResourceStats(stats), nil + val, err := fscommon.GetCgroupParamUint(path, file) + return int64(val), err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_unsupported.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_unsupported.go index e8aaf2d2ba46..fb7116a4d6d7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_unsupported.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_unsupported.go @@ -18,10 +18,12 @@ limitations under the License. package cm -import "fmt" +import "errors" type unsupportedCgroupManager struct{} +var errNotSupported = errors.New("Cgroup Manager is not supported in this build") + // Make sure that unsupportedCgroupManager implements the CgroupManager interface var _ CgroupManager = &unsupportedCgroupManager{} @@ -51,11 +53,11 @@ func (m *unsupportedCgroupManager) Update(_ *CgroupConfig) error { } func (m *unsupportedCgroupManager) Create(_ *CgroupConfig) error { - return fmt.Errorf("Cgroup Manager is not supported in this build") + return errNotSupported } -func (m *unsupportedCgroupManager) GetResourceStats(name CgroupName) (*ResourceStats, error) { - return nil, fmt.Errorf("Cgroup Manager is not supported in this build") +func (m *unsupportedCgroupManager) MemoryUsage(_ CgroupName) (int64, error) { + return -1, errNotSupported } func (m *unsupportedCgroupManager) Pids(_ CgroupName) []int { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go index 99ddd910189a..6406e03fa3f5 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go @@ -533,12 +533,8 @@ func (cm *containerManagerImpl) setupNode(activePods ActivePodsFunc) error { return err } - manager, err := createManager(cm.KubeletCgroupsName) - if err != nil { - return err - } cont.ensureStateFunc = func(_ cgroups.Manager) error { - return ensureProcessInContainerWithOOMScore(os.Getpid(), qos.KubeletOOMScoreAdj, manager) + return ensureProcessInContainerWithOOMScore(os.Getpid(), qos.KubeletOOMScoreAdj, cont.manager) } systemContainers = append(systemContainers, cont) } else { @@ -1034,7 +1030,7 @@ func ensureSystemCgroups(rootCgroupPath string, manager cgroups.Manager) error { return nil } - klog.InfoS("Moving non-kernel processes", "pids", pids) + klog.V(3).InfoS("Moving non-kernel processes", "pids", pids) for _, pid := range pids { err := manager.Apply(pid) if err != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go index cb4b9807529f..b599485151c0 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go @@ -42,12 +42,6 @@ func newCPUAccumulator(topo *topology.CPUTopology, availableCPUs cpuset.CPUSet, } } -func (a *cpuAccumulator) take(cpus cpuset.CPUSet) { - a.result = a.result.Union(cpus) - a.details = a.details.KeepOnly(a.details.CPUs().Difference(a.result)) - a.numCPUsNeeded -= cpus.Size() -} - // Returns true if the supplied socket is fully available in `topoDetails`. func (a *cpuAccumulator) isSocketFree(socketID int) bool { return a.details.CPUsInSockets(socketID).Size() == a.topo.CPUsPerSocket() @@ -58,82 +52,125 @@ func (a *cpuAccumulator) isCoreFree(coreID int) bool { return a.details.CPUsInCores(coreID).Size() == a.topo.CPUsPerCore() } -// Returns free socket IDs as a slice sorted by: -// - socket ID, ascending. +// Returns free socket IDs as a slice sorted by sortAvailableSockets(). func (a *cpuAccumulator) freeSockets() []int { - return a.details.Sockets().Filter(a.isSocketFree).ToSlice() + free := []int{} + for _, socket := range a.sortAvailableSockets() { + if a.isSocketFree(socket) { + free = append(free, socket) + } + } + return free } -// Returns core IDs as a slice sorted by: -// - the number of whole available cores on the socket, ascending -// - socket ID, ascending -// - core ID, ascending +// Returns free core IDs as a slice sorted by sortAvailableCores(). func (a *cpuAccumulator) freeCores() []int { - socketIDs := a.details.Sockets().ToSliceNoSort() - sort.Slice(socketIDs, - func(i, j int) bool { - iCores := a.details.CoresInSockets(socketIDs[i]).Filter(a.isCoreFree) - jCores := a.details.CoresInSockets(socketIDs[j]).Filter(a.isCoreFree) - return iCores.Size() < jCores.Size() || socketIDs[i] < socketIDs[j] - }) - - coreIDs := []int{} - for _, s := range socketIDs { - coreIDs = append(coreIDs, a.details.CoresInSockets(s).Filter(a.isCoreFree).ToSlice()...) + free := []int{} + for _, core := range a.sortAvailableCores() { + if a.isCoreFree(core) { + free = append(free, core) + } } - return coreIDs + return free } -// Returns CPU IDs as a slice sorted by: -// - socket affinity with result -// - number of CPUs available on the same socket -// - number of CPUs available on the same core -// - socket ID. -// - core ID. +// Returns free CPU IDs as a slice sorted by sortAvailableCPUs(). func (a *cpuAccumulator) freeCPUs() []int { - result := []int{} - cores := a.details.Cores().ToSlice() + return a.sortAvailableCPUs() +} - sort.Slice( - cores, +// Sorts the provided list of sockets/cores/cpus referenced in 'ids' by the +// number of available CPUs contained within them (smallest to largest). The +// 'getCPU()' paramater defines the function that should be called to retrieve +// the list of available CPUs for the type of socket/core/cpu being referenced. +// If two sockets/cores/cpus have the same number of available CPUs, they are +// sorted in ascending order by their id. +func (a *cpuAccumulator) sort(ids []int, getCPUs func(ids ...int) cpuset.CPUSet) { + sort.Slice(ids, func(i, j int) bool { - iCore := cores[i] - jCore := cores[j] - - iCPUs := a.topo.CPUDetails.CPUsInCores(iCore).ToSlice() - jCPUs := a.topo.CPUDetails.CPUsInCores(jCore).ToSlice() - - iSocket := a.topo.CPUDetails[iCPUs[0]].SocketID - jSocket := a.topo.CPUDetails[jCPUs[0]].SocketID - - // Compute the number of CPUs in the result reside on the same socket - // as each core. - iSocketColoScore := a.topo.CPUDetails.CPUsInSockets(iSocket).Intersection(a.result).Size() - jSocketColoScore := a.topo.CPUDetails.CPUsInSockets(jSocket).Intersection(a.result).Size() - - // Compute the number of available CPUs available on the same socket - // as each core. - iSocketFreeScore := a.details.CPUsInSockets(iSocket).Size() - jSocketFreeScore := a.details.CPUsInSockets(jSocket).Size() - - // Compute the number of available CPUs on each core. - iCoreFreeScore := a.details.CPUsInCores(iCore).Size() - jCoreFreeScore := a.details.CPUsInCores(jCore).Size() - - return iSocketColoScore > jSocketColoScore || - iSocketFreeScore < jSocketFreeScore || - iCoreFreeScore < jCoreFreeScore || - iSocket < jSocket || - iCore < jCore + iCPUs := getCPUs(ids[i]) + jCPUs := getCPUs(ids[j]) + if iCPUs.Size() < jCPUs.Size() { + return true + } + if iCPUs.Size() > jCPUs.Size() { + return false + } + return ids[i] < ids[j] }) +} + +// Sort all sockets with free CPUs using the sort() algorithm defined above. +func (a *cpuAccumulator) sortAvailableSockets() []int { + sockets := a.details.Sockets().ToSliceNoSort() + a.sort(sockets, a.details.CPUsInSockets) + return sockets +} - // For each core, append sorted CPU IDs to result. - for _, core := range cores { - result = append(result, a.details.CPUsInCores(core).ToSlice()...) +// Sort all cores with free CPUs: +// - First by socket using sortAvailableSockets(). +// - Then within each socket, using the sort() algorithm defined above. +func (a *cpuAccumulator) sortAvailableCores() []int { + var result []int + for _, socket := range a.sortAvailableSockets() { + cores := a.details.CoresInSockets(socket).ToSliceNoSort() + a.sort(cores, a.details.CPUsInCores) + result = append(result, cores...) } return result } +// Sort all available CPUs: +// - First by core using sortAvailableCores(). +// - Then within each core, using the sort() algorithm defined above. +func (a *cpuAccumulator) sortAvailableCPUs() []int { + var result []int + for _, core := range a.sortAvailableCores() { + cpus := a.details.CPUsInCores(core).ToSliceNoSort() + sort.Ints(cpus) + result = append(result, cpus...) + } + return result +} + +func (a *cpuAccumulator) take(cpus cpuset.CPUSet) { + a.result = a.result.Union(cpus) + a.details = a.details.KeepOnly(a.details.CPUs().Difference(a.result)) + a.numCPUsNeeded -= cpus.Size() +} + +func (a *cpuAccumulator) takeFullSockets() { + for _, socket := range a.freeSockets() { + cpusInSocket := a.topo.CPUDetails.CPUsInSockets(socket) + if !a.needs(cpusInSocket.Size()) { + continue + } + klog.V(4).InfoS("takeFullSockets: claiming socket", "socket", socket) + a.take(cpusInSocket) + } +} + +func (a *cpuAccumulator) takeFullCores() { + for _, core := range a.freeCores() { + cpusInCore := a.topo.CPUDetails.CPUsInCores(core) + if !a.needs(cpusInCore.Size()) { + continue + } + klog.V(4).InfoS("takeFullCores: claiming core", "core", core) + a.take(cpusInCore) + } +} + +func (a *cpuAccumulator) takeRemainingCPUs() { + for _, cpu := range a.sortAvailableCPUs() { + klog.V(4).InfoS("takeRemainingCPUs: claiming CPU", "cpu", cpu) + a.take(cpuset.NewCPUSet(cpu)) + if a.isSatisfied() { + return + } + } +} + func (a *cpuAccumulator) needs(n int) bool { return a.numCPUsNeeded >= n } @@ -158,45 +195,24 @@ func takeByTopology(topo *topology.CPUTopology, availableCPUs cpuset.CPUSet, num // Algorithm: topology-aware best-fit // 1. Acquire whole sockets, if available and the container requires at // least a socket's-worth of CPUs. - if acc.needs(acc.topo.CPUsPerSocket()) { - for _, s := range acc.freeSockets() { - klog.V(4).InfoS("takeByTopology: claiming socket", "socket", s) - acc.take(acc.details.CPUsInSockets(s)) - if acc.isSatisfied() { - return acc.result, nil - } - if !acc.needs(acc.topo.CPUsPerSocket()) { - break - } - } + acc.takeFullSockets() + if acc.isSatisfied() { + return acc.result, nil } // 2. Acquire whole cores, if available and the container requires at least // a core's-worth of CPUs. - if acc.needs(acc.topo.CPUsPerCore()) { - for _, c := range acc.freeCores() { - klog.V(4).InfoS("takeByTopology: claiming core", "core", c) - acc.take(acc.details.CPUsInCores(c)) - if acc.isSatisfied() { - return acc.result, nil - } - if !acc.needs(acc.topo.CPUsPerCore()) { - break - } - } + acc.takeFullCores() + if acc.isSatisfied() { + return acc.result, nil } // 3. Acquire single threads, preferring to fill partially-allocated cores // on the same sockets as the whole cores we have already taken in this // allocation. - for _, c := range acc.freeCPUs() { - klog.V(4).InfoS("takeByTopology: claiming CPU", "cpu", c) - if acc.needs(1) { - acc.take(cpuset.NewCPUSet(c)) - } - if acc.isSatisfied() { - return acc.result, nil - } + acc.takeRemainingCPUs() + if acc.isSatisfied() { + return acc.result, nil } return cpuset.NewCPUSet(), fmt.Errorf("failed to allocate cpus") diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go index 5a6e5082f15c..2e5b541ef014 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go @@ -101,6 +101,9 @@ type manager struct { // representation of state for the system to inspect and reconcile. state state.State + // lastUpdatedstate holds state for each container from the last time it was updated. + lastUpdateState state.State + // containerRuntime is the container runtime service interface needed // to make UpdateContainerResources() calls against the containers. containerRuntime runtimeService @@ -187,6 +190,7 @@ func NewManager(cpuPolicyName string, reconcilePeriod time.Duration, machineInfo manager := &manager{ policy: policy, reconcilePeriod: reconcilePeriod, + lastUpdateState: state.NewMemoryState(), topology: topo, nodeAllocatableReservation: nodeAllocatableReservation, stateFileDirectory: stateFileDirectory, @@ -248,6 +252,9 @@ func (m *manager) Allocate(p *v1.Pod, c *v1.Container) error { func (m *manager) AddContainer(pod *v1.Pod, container *v1.Container, containerID string) { m.Lock() defer m.Unlock() + if cset, exists := m.state.GetCPUSet(string(pod.UID), container.Name); exists { + m.lastUpdateState.SetCPUSet(string(pod.UID), container.Name, cset) + } m.containerMap.Add(string(pod.UID), container.Name, containerID) } @@ -272,6 +279,7 @@ func (m *manager) policyRemoveContainerByID(containerID string) error { err = m.policy.RemoveContainer(m.state, podUID, containerName) if err == nil { + m.lastUpdateState.Delete(podUID, containerName) m.containerMap.RemoveByContainerID(containerID) } @@ -281,6 +289,7 @@ func (m *manager) policyRemoveContainerByID(containerID string) error { func (m *manager) policyRemoveContainerByRef(podUID string, containerName string) error { err := m.policy.RemoveContainer(m.state, podUID, containerName) if err == nil { + m.lastUpdateState.Delete(podUID, containerName) m.containerMap.RemoveByContainerRef(podUID, containerName) } @@ -424,12 +433,16 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec continue } - klog.V(4).InfoS("ReconcileState: updating container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID, "cpuSet", cset) - err = m.updateContainerCPUSet(containerID, cset) - if err != nil { - klog.ErrorS(err, "ReconcileState: failed to update container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID, "cpuSet", cset) - failure = append(failure, reconciledContainer{pod.Name, container.Name, containerID}) - continue + lcset := m.lastUpdateState.GetCPUSetOrDefault(string(pod.UID), container.Name) + if !cset.Equals(lcset) { + klog.V(4).InfoS("ReconcileState: updating container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID, "cpuSet", cset) + err = m.updateContainerCPUSet(containerID, cset) + if err != nil { + klog.ErrorS(err, "ReconcileState: failed to update container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID, "cpuSet", cset) + failure = append(failure, reconciledContainer{pod.Name, container.Name, containerID}) + continue + } + m.lastUpdateState.SetCPUSet(string(pod.UID), container.Name, cset) } success = append(success, reconciledContainer{pod.Name, container.Name, containerID}) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpuset/cpuset.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpuset/cpuset.go index de72ba257569..24330e5a9e38 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpuset/cpuset.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpuset/cpuset.go @@ -301,7 +301,7 @@ func Parse(s string) (CPUSet, error) { ranges := strings.Split(s, ",") for _, r := range ranges { - boundaries := strings.Split(r, "-") + boundaries := strings.SplitN(r, "-", 2) if len(boundaries) == 1 { // Handle ranges that consist of only one element like "34". elem, err := strconv.Atoi(boundaries[0]) @@ -319,6 +319,11 @@ func Parse(s string) (CPUSet, error) { if err != nil { return NewCPUSet(), err } + if start > end { + return NewCPUSet(), fmt.Errorf("invalid range %q (%d >= %d)", r, start, end) + } + // start == end is acceptable (1-1 -> 1) + // Add all elements to the result. // e.g. "0-5", "46-48" => [0, 1, 2, 3, 4, 5, 46, 47, 48]. for e := start; e <= end; e++ { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go index 1708176fc9b4..3925a3fd6e6f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go @@ -791,9 +791,33 @@ func (m *ManagerImpl) filterByAffinity(podUID, contName, resource string, availa nodes = append(nodes, node) } - // Sort the list of nodes by how many devices they contain. + // Sort the list of nodes by: + // 1) Nodes contained in the 'hint's affinity set + // 2) Nodes not contained in the 'hint's affinity set + // 3) The fake NUMANode of -1 (assuming it is included in the list) + // Within each of the groups above, sort the nodes by how many devices they contain sort.Slice(nodes, func(i, j int) bool { - return perNodeDevices[i].Len() < perNodeDevices[j].Len() + // If one or the other of nodes[i] or nodes[j] is in the 'hint's affinity set + if hint.NUMANodeAffinity.IsSet(nodes[i]) && hint.NUMANodeAffinity.IsSet(nodes[j]) { + return perNodeDevices[nodes[i]].Len() < perNodeDevices[nodes[j]].Len() + } + if hint.NUMANodeAffinity.IsSet(nodes[i]) { + return true + } + if hint.NUMANodeAffinity.IsSet(nodes[j]) { + return false + } + + // If one or the other of nodes[i] or nodes[j] is the fake NUMA node -1 (they can't both be) + if nodes[i] == nodeWithoutTopology { + return false + } + if nodes[j] == nodeWithoutTopology { + return true + } + + // Otherwise both nodes[i] and nodes[j] are real NUMA nodes that are not in the 'hint's' affinity list. + return perNodeDevices[nodes[i]].Len() < perNodeDevices[nodes[j]].Len() }) // Generate three sorted lists of devices. Devices in the first list come @@ -1071,7 +1095,7 @@ func (m *ManagerImpl) GetAllocatableDevices() ResourceDeviceInstances { m.mutex.Lock() resp := m.allDevices.Clone() m.mutex.Unlock() - klog.V(4).InfoS("known devices", "numDevices", len(resp)) + klog.V(4).InfoS("Known devices", "numDevices", len(resp)) return resp } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go index b7bb2e2e8f12..8996930056cd 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go @@ -65,6 +65,8 @@ func (pdev *podDevices) size() int { } func (pdev *podDevices) hasPod(podUID string) bool { + pdev.RLock() + defer pdev.RUnlock() _, podExists := pdev.devs[podUID] return podExists } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/internal_container_lifecycle.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/internal_container_lifecycle.go index 278f13eb08e2..92b36c2f9af8 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/internal_container_lifecycle.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/internal_container_lifecycle.go @@ -50,10 +50,7 @@ func (i *internalContainerLifecycleImpl) PreStartContainer(pod *v1.Pod, containe } if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.TopologyManager) { - err := i.topologyManager.AddContainer(pod, containerID) - if err != nil { - return err - } + i.topologyManager.AddContainer(pod, container, containerID) } return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go index 209b70b717d2..0e3ba2c071ea 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go @@ -28,7 +28,7 @@ import ( units "github.com/docker/go-units" cgroupfs "github.com/opencontainers/runc/libcontainer/cgroups/fs" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/kubernetes/pkg/api/v1/resource" v1qos "k8s.io/kubernetes/pkg/apis/core/v1/helper/qos" @@ -247,12 +247,11 @@ func (m *qosContainerManagerImpl) retrySetMemoryReserve(configs map[v1.PodQOSCla // Attempt to set the limit near the current usage to put pressure // on the cgroup and prevent further growth. for qos, config := range configs { - stats, err := m.cgroupManager.GetResourceStats(config.Name) + usage, err := m.cgroupManager.MemoryUsage(config.Name) if err != nil { klog.V(2).InfoS("Failed to get resource stats", "err", err) return } - usage := stats.MemoryStats.Usage // Because there is no good way to determine of the original Update() // on the memory resource was successful, we determine failure of the diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go index 063cac65a27d..407691e98f0a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go @@ -22,7 +22,9 @@ import ( "k8s.io/kubernetes/pkg/kubelet/lifecycle" ) -type fakeManager struct{} +type fakeManager struct { + hint *TopologyHint +} //NewFakeManager returns an instance of FakeManager func NewFakeManager() Manager { @@ -30,18 +32,29 @@ func NewFakeManager() Manager { return &fakeManager{} } +// NewFakeManagerWithHint returns an instance of fake topology manager with specified topology hints +func NewFakeManagerWithHint(hint *TopologyHint) Manager { + klog.InfoS("NewFakeManagerWithHint") + return &fakeManager{ + hint: hint, + } +} + func (m *fakeManager) GetAffinity(podUID string, containerName string) TopologyHint { klog.InfoS("GetAffinity", "podUID", podUID, "containerName", containerName) - return TopologyHint{} + if m.hint == nil { + return TopologyHint{} + } + + return *m.hint } func (m *fakeManager) AddHintProvider(h HintProvider) { klog.InfoS("AddHintProvider", "hintProvider", h) } -func (m *fakeManager) AddContainer(pod *v1.Pod, containerID string) error { - klog.InfoS("AddContainer", "pod", klog.KObj(pod), "containerID", containerID) - return nil +func (m *fakeManager) AddContainer(pod *v1.Pod, container *v1.Container, containerID string) { + klog.InfoS("AddContainer", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID) } func (m *fakeManager) RemoveContainer(containerID string) error { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope.go index af90663368a4..c5c6f36be972 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope.go @@ -23,6 +23,7 @@ import ( "k8s.io/api/core/v1" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/kubelet/cm/containermap" "k8s.io/kubernetes/pkg/kubelet/lifecycle" ) @@ -43,7 +44,7 @@ type Scope interface { // wants to be consoluted with when making topology hints AddHintProvider(h HintProvider) // AddContainer adds pod to Manager for tracking - AddContainer(pod *v1.Pod, containerID string) error + AddContainer(pod *v1.Pod, container *v1.Container, containerID string) // RemoveContainer removes pod from Manager tracking RemoveContainer(containerID string) error // Store is the interface for storing pod topology hints @@ -60,8 +61,8 @@ type scope struct { hintProviders []HintProvider // Topology Manager Policy policy Policy - // Mapping of PodUID to ContainerID for Adding/Removing Pods from PodTopologyHints mapping - podMap map[string]string + // Mapping of (PodUid, ContainerName) to ContainerID for Adding/Removing Pods from PodTopologyHints mapping + podMap containermap.ContainerMap } func (s *scope) Name() string { @@ -94,12 +95,11 @@ func (s *scope) AddHintProvider(h HintProvider) { // It would be better to implement this function in topologymanager instead of scope // but topologymanager do not track mapping anymore -func (s *scope) AddContainer(pod *v1.Pod, containerID string) error { +func (s *scope) AddContainer(pod *v1.Pod, container *v1.Container, containerID string) { s.mutex.Lock() defer s.mutex.Unlock() - s.podMap[containerID] = string(pod.UID) - return nil + s.podMap.Add(string(pod.UID), container.Name, containerID) } // It would be better to implement this function in topologymanager instead of scope @@ -109,10 +109,18 @@ func (s *scope) RemoveContainer(containerID string) error { defer s.mutex.Unlock() klog.InfoS("RemoveContainer", "containerID", containerID) - podUIDString := s.podMap[containerID] - delete(s.podMap, containerID) - if _, exists := s.podTopologyHints[podUIDString]; exists { - delete(s.podTopologyHints[podUIDString], containerID) + // Get the podUID and containerName associated with the containerID to be removed and remove it + podUIDString, containerName, err := s.podMap.GetContainerRef(containerID) + if err != nil { + return nil + } + s.podMap.RemoveByContainerID(containerID) + + // In cases where a container has been restarted, it's possible that the same podUID and + // containerName are already associated with a *different* containerID now. Only remove + // the TopologyHints associated with that podUID and containerName if this is not true + if _, err := s.podMap.GetContainerID(podUIDString, containerName); err != nil { + delete(s.podTopologyHints[podUIDString], containerName) if len(s.podTopologyHints[podUIDString]) == 0 { delete(s.podTopologyHints, podUIDString) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go index e5d331e00e92..de45209625a6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go @@ -19,6 +19,7 @@ package topologymanager import ( "k8s.io/api/core/v1" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/kubelet/cm/containermap" "k8s.io/kubernetes/pkg/kubelet/lifecycle" ) @@ -36,7 +37,7 @@ func NewContainerScope(policy Policy) Scope { name: containerTopologyScope, podTopologyHints: podTopologyHints{}, policy: policy, - podMap: make(map[string]string), + podMap: containermap.NewContainerMap(), }, } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go index f4645bc4d768..9ccc6414dd9f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go @@ -19,6 +19,7 @@ package topologymanager import ( "k8s.io/api/core/v1" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/kubelet/cm/containermap" "k8s.io/kubernetes/pkg/kubelet/lifecycle" ) @@ -36,7 +37,7 @@ func NewPodScope(policy Policy) Scope { name: podTopologyScope, podTopologyHints: podTopologyHints{}, policy: policy, - podMap: make(map[string]string), + podMap: containermap.NewContainerMap(), }, } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go index f1e435260dec..4f327e6efc04 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go @@ -46,7 +46,7 @@ type Manager interface { // wants to be consulted with when making topology hints AddHintProvider(HintProvider) // AddContainer adds pod to Manager for tracking - AddContainer(pod *v1.Pod, containerID string) error + AddContainer(pod *v1.Pod, container *v1.Container, containerID string) // RemoveContainer removes pod from Manager tracking RemoveContainer(containerID string) error // Store is the interface for storing pod topology hints @@ -175,8 +175,8 @@ func (m *manager) AddHintProvider(h HintProvider) { m.scope.AddHintProvider(h) } -func (m *manager) AddContainer(pod *v1.Pod, containerID string) error { - return m.scope.AddContainer(pod, containerID) +func (m *manager) AddContainer(pod *v1.Pod, container *v1.Container, containerID string) { + m.scope.AddContainer(pod, container, containerID) } func (m *manager) RemoveContainer(containerID string) error { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/types.go index e60117974435..b28e2e93fcd4 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/types.go @@ -17,7 +17,7 @@ limitations under the License. package cm import ( - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" ) @@ -53,18 +53,6 @@ type CgroupConfig struct { ResourceParameters *ResourceConfig } -// MemoryStats holds the on-demand statistics from the memory cgroup -type MemoryStats struct { - // Memory usage (in bytes). - Usage int64 -} - -// ResourceStats holds on-demand statistics from various cgroup subsystems -type ResourceStats struct { - // Memory statistics. - MemoryStats *MemoryStats -} - // CgroupManager allows for cgroup management. // Supports Cgroup Creation ,Deletion and Updates. type CgroupManager interface { @@ -90,8 +78,8 @@ type CgroupManager interface { Pids(name CgroupName) []int // ReduceCPULimits reduces the CPU CFS values to the minimum amount of shares. ReduceCPULimits(cgroupName CgroupName) error - // GetResourceStats returns statistics of the specified cgroup as read from the cgroup fs. - GetResourceStats(name CgroupName) (*ResourceStats, error) + // MemoryUsage returns current memory usage of the specified cgroup, as read from the cgroupfs. + MemoryUsage(name CgroupName) (int64, error) } // QOSContainersInfo stores the names of containers per qos diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file.go index 8984f5dee483..79e2af6ed621 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/file.go @@ -26,7 +26,7 @@ import ( "k8s.io/klog/v2" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/cache" api "k8s.io/kubernetes/pkg/apis/core" @@ -164,7 +164,7 @@ func (s *sourceFile) extractFromDir(name string) ([]*v1.Pod, error) { return nil, fmt.Errorf("glob failed: %v", err) } - pods := make([]*v1.Pod, 0) + pods := make([]*v1.Pod, 0, len(dirents)) if len(dirents) == 0 { return pods, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/http.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/http.go index b0b49e517c37..b37608781433 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/http.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/config/http.go @@ -22,7 +22,7 @@ import ( "net/http" "time" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/wait" api "k8s.io/kubernetes/pkg/apis/core" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" @@ -129,7 +129,7 @@ func (s *sourceURL) extractFromURL() error { // It parsed but could not be used. return multiPodErr } - pods := make([]*v1.Pod, 0) + pods := make([]*v1.Pod, 0, len(podList.Items)) for i := range podList.Items { pods = append(pods, &podList.Items[i]) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go index 7e3314fec017..b48ba532db0d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go @@ -31,6 +31,7 @@ import ( "k8s.io/client-go/tools/record" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" podutil "k8s.io/kubernetes/pkg/api/v1/pod" + sc "k8s.io/kubernetes/pkg/securitycontext" hashutil "k8s.io/kubernetes/pkg/util/hash" "k8s.io/kubernetes/third_party/forked/golang/expansion" utilsnet "k8s.io/utils/net" @@ -310,6 +311,34 @@ func HasPrivilegedContainer(pod *v1.Pod) bool { return hasPrivileged } +// HasWindowsHostProcessContainer returns true if any of the containers in a pod are HostProcess containers. +func HasWindowsHostProcessContainer(pod *v1.Pod) bool { + var hasHostProcess bool + podutil.VisitContainers(&pod.Spec, podutil.AllFeatureEnabledContainers(), func(c *v1.Container, containerType podutil.ContainerType) bool { + if sc.HasWindowsHostProcessRequest(pod, c) { + hasHostProcess = true + return false + } + return true + }) + + return hasHostProcess +} + +// AllContainersAreWindowsHostProcess returns true if all containres in a pod are HostProcess containers. +func AllContainersAreWindowsHostProcess(pod *v1.Pod) bool { + allHostProcess := true + podutil.VisitContainers(&pod.Spec, podutil.AllFeatureEnabledContainers(), func(c *v1.Container, containerType podutil.ContainerType) bool { + if !sc.HasWindowsHostProcessRequest(pod, c) { + allHostProcess = false + return false + } + return true + }) + + return allHostProcess +} + // MakePortMappings creates internal port mapping from api port mapping. func MakePortMappings(container *v1.Container) (ports []PortMapping) { names := make(map[string]struct{}) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go index 52180087a155..b0baa29e4a21 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go @@ -95,7 +95,7 @@ type Runtime interface { // that are terminated, but not deleted will be evicted. Otherwise, only deleted pods will be GC'd. // TODO: Revisit this method and make it cleaner. GarbageCollect(gcPolicy GCPolicy, allSourcesReady bool, evictNonDeletedPods bool) error - // Syncs the running pod into the desired pod. + // SyncPod syncs the running pod into the desired pod. SyncPod(pod *v1.Pod, podStatus *PodStatus, pullSecrets []v1.Secret, backOff *flowcontrol.Backoff) PodSyncResult // KillPod kills all the containers of a pod. Pod may be nil, running pod must not be. // TODO(random-liu): Return PodSyncResult in KillPod. @@ -112,7 +112,7 @@ type Runtime interface { // stream the log. Set 'follow' to false and specify the number of lines (e.g. // "100" or "all") to tail the log. GetContainerLogs(ctx context.Context, pod *v1.Pod, containerID ContainerID, logOptions *v1.PodLogOptions, stdout, stderr io.Writer) (err error) - // Delete a container. If the container is still running, an error is returned. + // DeleteContainer deletes a container. If the container is still running, an error is returned. DeleteContainer(containerID ContainerID) error // ImageService provides methods to image-related methods. ImageService @@ -139,11 +139,11 @@ type ImageService interface { // GetImageRef gets the reference (digest or ID) of the image which has already been in // the local storage. It returns ("", nil) if the image isn't in the local storage. GetImageRef(image ImageSpec) (string, error) - // Gets all images currently on the machine. + // ListImages gets all images currently on the machine. ListImages() ([]Image, error) - // Removes the specified image. + // RemoveImage removes the specified image. RemoveImage(image ImageSpec) error - // Returns Image statistics. + // ImageStats returns Image statistics. ImageStats() (*ImageStats, error) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go index a0d27fe38eaa..c9f0d5e0c4d5 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go @@ -40,7 +40,7 @@ import ( ) const ( - defaultSandboxImage = "k8s.gcr.io/pause:3.4.1" + defaultSandboxImage = "k8s.gcr.io/pause:3.5" // Various default sandbox resources requests/limits. defaultSandboxCPUshares int64 = 2 diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go index 00890d662b86..8a9d2518862f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go @@ -387,6 +387,11 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, } } + if utilfeature.DefaultFeatureGate.Enabled(features.DisableCloudProviders) && cloudprovider.IsDeprecatedInternal(cloudProvider) { + cloudprovider.DisableWarningForProvider(cloudProvider) + return nil, fmt.Errorf("cloud provider %q was specified, but built-in cloud providers are disabled. Please set --cloud-provider=external and migrate to an external cloud provider", cloudProvider) + } + var nodeHasSynced cache.InformerSynced var nodeLister corelisters.NodeLister @@ -679,7 +684,8 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, klet.runtimeCache, kubeDeps.RemoteRuntimeService, kubeDeps.RemoteImageService, - hostStatsProvider) + hostStatsProvider, + utilfeature.DefaultFeatureGate.Enabled(features.DisableAcceleratorUsageMetrics)) } klet.pleg = pleg.NewGenericPLEG(klet.containerRuntime, plegChannelCapacity, plegRelistPeriod, klet.podCache, clock.RealClock{}) @@ -1421,7 +1427,7 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) { if err := kl.initializeModules(); err != nil { kl.recorder.Eventf(kl.nodeRef, v1.EventTypeWarning, events.KubeletSetupFailed, err.Error()) - klog.ErrorS(err, "failed to initialize internal modules") + klog.ErrorS(err, "Failed to initialize internal modules") os.Exit(1) } @@ -1633,7 +1639,7 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error { if err := kl.killPod(pod, nil, podStatus, nil); err == nil { podKilled = true } else { - klog.ErrorS(err, "killPod failed", "pod", klog.KObj(pod), "podStatus", podStatus) + klog.ErrorS(err, "KillPod failed", "pod", klog.KObj(pod), "podStatus", podStatus) } } // Create and Update pod's Cgroups @@ -1995,11 +2001,21 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle case update := <-kl.readinessManager.Updates(): ready := update.Result == proberesults.Success kl.statusManager.SetContainerReadiness(update.PodUID, update.ContainerID, ready) - handleProbeSync(kl, update, handler, "readiness", map[bool]string{true: "ready", false: ""}[ready]) + + status := "" + if ready { + status = "ready" + } + handleProbeSync(kl, update, handler, "readiness", status) case update := <-kl.startupManager.Updates(): started := update.Result == proberesults.Success kl.statusManager.SetContainerStartup(update.PodUID, update.ContainerID, started) - handleProbeSync(kl, update, handler, "startup", map[bool]string{true: "started", false: "unhealthy"}[started]) + + status := "unhealthy" + if started { + status = "started" + } + handleProbeSync(kl, update, handler, "startup", status) case <-housekeepingCh: if !kl.sourcesReady.AllReady() { // If the sources aren't ready or volume manager has not yet synced the states, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go index b610b47ff7fd..a7485f6c4765 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go @@ -779,12 +779,6 @@ func (kl *Kubelet) makeEnvironmentVariables(pod *v1.Pod, container *v1.Container runtimeVal = string(runtimeValBytes) } } - // Accesses apiserver+Pods. - // So, the master may set service env vars, or kubelet may. In case both are doing - // it, we delete the key from the kubelet-generated ones so we don't have duplicate - // env vars. - // TODO: remove this next line once all platforms use apiserver+Pods. - delete(serviceEnv, envVar.Name) tmpEnv[envVar.Name] = runtimeVal } @@ -1156,7 +1150,7 @@ type PodKiller interface { // PerformPodKillingWork performs the actual pod killing work via calling CRI // It returns after its Close() func is called and all outstanding pod killing requests are served PerformPodKillingWork() - // After Close() is called, this pod killer wouldn't accept any more pod killing requests + // Close ensures that after it's called, then this pod killer wouldn't accept any more pod killing requests Close() // IsPodPendingTerminationByPodName checks whether any pod for the given full pod name is pending termination (thread safe) IsPodPendingTerminationByPodName(podFullname string) bool @@ -1205,7 +1199,7 @@ func (pk *podKillerWithChannel) IsPodPendingTerminationByUID(uid types.UID) bool return false } -// IsMirrorPodPendingTerminationByPodName checks whether the given pod is in grace period of termination +// IsPodPendingTerminationByPodName checks whether the given pod is in grace period of termination func (pk *podKillerWithChannel) IsPodPendingTerminationByPodName(podFullname string) bool { pk.podKillingLock.RLock() defer pk.podKillingLock.RUnlock() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_volumes.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_volumes.go index 96e81ce00a53..9396a5c62c47 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_volumes.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_volumes.go @@ -133,6 +133,11 @@ func (kl *Kubelet) cleanupOrphanedPodDirs(pods []*v1.Pod, runningPods []*kubecon if allPods.Has(string(uid)) { continue } + // if the pod is within termination grace period, we shouldn't cleanup the underlying volumes + if kl.podKiller.IsPodPendingTerminationByUID(uid) { + klog.V(3).InfoS("Pod is pending termination", "podUID", uid) + continue + } // If volumes have not been unmounted/detached, do not delete directory. // Doing so may result in corruption of data. // TODO: getMountedVolumePathListFromDisk() call may be redundant with diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go index 3804e9b04a52..54b116e25566 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go @@ -21,12 +21,15 @@ import ( "errors" "fmt" "io" + "io/ioutil" "math/rand" "net/url" "os" "path/filepath" + "regexp" goruntime "runtime" "sort" + "strconv" "strings" "sync" "time" @@ -127,6 +130,40 @@ func (s *startSpec) getTargetID(podStatus *kubecontainer.PodStatus) (*kubecontai return &targetStatus.ID, nil } +func calcRestartCountByLogDir(path string) (int, error) { + // if the path doesn't exist then it's not an error + if _, err := os.Stat(path); err != nil { + return 0, nil + } + restartCount := int(0) + files, err := ioutil.ReadDir(path) + if err != nil { + return 0, err + } + if len(files) == 0 { + return 0, err + } + restartCountLogFileRegex := regexp.MustCompile(`(\d+).log(\..*)?`) + for _, file := range files { + if file.IsDir() { + continue + } + matches := restartCountLogFileRegex.FindStringSubmatch(file.Name()) + if len(matches) == 0 { + continue + } + count, err := strconv.Atoi(matches[1]) + if err != nil { + return restartCount, err + } + count++ + if count > restartCount { + restartCount = count + } + } + return restartCount, nil +} + // startContainer starts a container and returns a message indicates why it is failed on error. // It starts the container through the following steps: // * pull the image @@ -150,6 +187,22 @@ func (m *kubeGenericRuntimeManager) startContainer(podSandboxID string, podSandb containerStatus := podStatus.FindContainerStatusByName(container.Name) if containerStatus != nil { restartCount = containerStatus.RestartCount + 1 + } else { + // The container runtime keeps state on container statuses and + // what the container restart count is. When nodes are rebooted + // some container runtimes clear their state which causes the + // restartCount to be reset to 0. This causes the logfile to + // start at 0.log, which either overwrites or appends to the + // already existing log. + // + // We are checking to see if the log directory exists, and find + // the latest restartCount by checking the log name - + // {restartCount}.log - and adding 1 to it. + logDir := BuildContainerLogsDirectory(pod.Namespace, pod.Name, pod.UID, container.Name) + restartCount, err = calcRestartCountByLogDir(logDir) + if err != nil { + klog.InfoS("Log directory exists but could not calculate restartCount", "logDir", logDir, "err", err) + } } target, err := spec.getTargetID(podStatus) @@ -226,12 +279,14 @@ func (m *kubeGenericRuntimeManager) startContainer(podSandboxID string, podSandb } msg, handlerErr := m.runner.Run(kubeContainerID, pod, container, container.Lifecycle.PostStart) if handlerErr != nil { + klog.ErrorS(handlerErr, "Failed to execute PostStartHook", "pod", klog.KObj(pod), + "podUID", pod.UID, "containerName", container.Name, "containerID", kubeContainerID.String()) m.recordContainerEvent(pod, container, kubeContainerID.ID, v1.EventTypeWarning, events.FailedPostStartHook, msg) if err := m.killContainer(pod, kubeContainerID, container.Name, "FailedPostStartHook", reasonFailedPostStartHook, nil); err != nil { - klog.ErrorS(fmt.Errorf("%s: %v", ErrPostStartHook, handlerErr), "Failed to kill container", "pod", klog.KObj(pod), + klog.ErrorS(err, "Failed to kill container", "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", container.Name, "containerID", kubeContainerID.String()) } - return msg, fmt.Errorf("%s: %v", ErrPostStartHook, handlerErr) + return msg, ErrPostStartHook } } @@ -658,7 +713,7 @@ func (m *kubeGenericRuntimeManager) killContainer(pod *v1.Pod, containerID kubec "containerName", containerName, "containerID", containerID.String(), "gracePeriod", gracePeriod) } - klog.V(2).InfoS("Killing container with a grace period override", "pod", klog.KObj(pod), "podUID", pod.UID, + klog.V(2).InfoS("Killing container with a grace period", "pod", klog.KObj(pod), "podUID", pod.UID, "containerName", containerName, "containerID", containerID.String(), "gracePeriod", gracePeriod) err := m.runtimeService.StopContainer(containerID.ID, gracePeriod) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_windows.go index 5b4910e5fbfb..d295bc809314 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container_windows.go @@ -19,14 +19,16 @@ limitations under the License. package kuberuntime import ( + "fmt" "runtime" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" + utilfeature "k8s.io/apiserver/pkg/util/feature" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" + "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/features" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/securitycontext" - - "k8s.io/klog/v2" ) // applyPlatformSpecificContainerConfig applies platform specific configurations to runtimeapi.ContainerConfig. @@ -122,5 +124,12 @@ func (m *kubeGenericRuntimeManager) generateWindowsContainerConfig(container *v1 wc.SecurityContext.RunAsUsername = *effectiveSc.WindowsOptions.RunAsUserName } + if securitycontext.HasWindowsHostProcessRequest(pod, container) { + if !utilfeature.DefaultFeatureGate.Enabled(features.WindowsHostProcessContainers) { + return nil, fmt.Errorf("pod contains HostProcess containers but feature 'WindowsHostProcessContainers' is not enabled") + } + wc.SecurityContext.HostProcess = true + } + return wc, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go index d83e75e300a2..ad543e485325 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_manager.go @@ -152,7 +152,7 @@ type KubeGenericRuntime interface { // LegacyLogProvider gives the ability to use unsupported docker log drivers (e.g. journald) type LegacyLogProvider interface { - // Get the last few lines of the logs for a specific container. + // GetContainerLogTail gets the last few lines of the logs for a specific container. GetContainerLogTail(uid kubetypes.UID, name, namespace string, containerID kubecontainer.ContainerID) (string, error) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_sandbox.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_sandbox.go index 60cc9dbb04a1..95832f9f13e6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_sandbox.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_sandbox.go @@ -25,8 +25,10 @@ import ( v1 "k8s.io/api/core/v1" kubetypes "k8s.io/apimachinery/pkg/types" + utilfeature "k8s.io/apiserver/pkg/util/feature" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/features" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/kubelet/util" @@ -138,6 +140,14 @@ func (m *kubeGenericRuntimeManager) generatePodSandboxConfig(pod *v1.Pod, attemp } podSandboxConfig.Linux = lc + if runtime.GOOS == "windows" { + wc, err := m.generatePodSandboxWindowsConfig(pod) + if err != nil { + return nil, err + } + podSandboxConfig.Windows = wc + } + return podSandboxConfig, nil } @@ -206,6 +216,54 @@ func (m *kubeGenericRuntimeManager) generatePodSandboxLinuxConfig(pod *v1.Pod) ( return lc, nil } +// generatePodSandboxWindowsConfig generates WindowsPodSandboxConfig from v1.Pod. +// On Windows this will get called in addition to LinuxPodSandboxConfig because not all relevant fields have been added to +// WindowsPodSandboxConfig at this time. +func (m *kubeGenericRuntimeManager) generatePodSandboxWindowsConfig(pod *v1.Pod) (*runtimeapi.WindowsPodSandboxConfig, error) { + wc := &runtimeapi.WindowsPodSandboxConfig{ + SecurityContext: &runtimeapi.WindowsSandboxSecurityContext{}, + } + + sc := pod.Spec.SecurityContext + if sc == nil || sc.WindowsOptions == nil { + return wc, nil + } + + wo := sc.WindowsOptions + if wo.GMSACredentialSpec != nil { + wc.SecurityContext.CredentialSpec = *wo.GMSACredentialSpec + } + + if wo.RunAsUserName != nil { + wc.SecurityContext.RunAsUsername = *wo.RunAsUserName + } + + if kubecontainer.HasWindowsHostProcessContainer(pod) { + // Pods containing HostProcess containers should fail to schedule if feature is not + // enabled instead of trying to schedule containers as regular containers as stated in + // PRR review. + if !utilfeature.DefaultFeatureGate.Enabled(features.WindowsHostProcessContainers) { + return nil, fmt.Errorf("pod contains HostProcess containers but feature 'WindowsHostProcessContainers' is not enabled") + } + + if wo.HostProcess != nil && !*wo.HostProcess { + return nil, fmt.Errorf("pod must not contain any HostProcess containers if Pod's WindowsOptions.HostProcess is set to false") + } + // At present Windows all containers in a Windows pod must be HostProcess containers + // and HostNetwork is required to be set. + if !kubecontainer.AllContainersAreWindowsHostProcess(pod) { + return nil, fmt.Errorf("pod must not contain both HostProcess and non-HostProcess containers") + } + if !kubecontainer.IsHostNetworkPod(pod) { + return nil, fmt.Errorf("hostNetwork is required if Pod contains HostProcess containers") + } + + wc.SecurityContext.HostProcess = true + } + + return wc, nil +} + // getKubeletSandboxes lists all (or just the running) sandboxes managed by kubelet. func (m *kubeGenericRuntimeManager) getKubeletSandboxes(all bool) ([]*runtimeapi.PodSandbox, error) { var filter *runtimeapi.PodSandboxFilter diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/labels.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/labels.go index 2aaa1743ac67..4ee13e7337d7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/labels.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/labels.go @@ -18,13 +18,17 @@ package kuberuntime import ( "encoding/json" + "runtime" "strconv" v1 "k8s.io/api/core/v1" kubetypes "k8s.io/apimachinery/pkg/types" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/features" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/types" + sc "k8s.io/kubernetes/pkg/securitycontext" ) const ( @@ -38,6 +42,12 @@ const ( containerTerminationMessagePolicyLabel = "io.kubernetes.container.terminationMessagePolicy" containerPreStopHandlerLabel = "io.kubernetes.container.preStopHandler" containerPortsLabel = "io.kubernetes.container.ports" + + // TODO: remove this annotation when moving to beta for Windows hostprocess containers + // xref: https://github.com/kubernetes/kubernetes/pull/99576/commits/42fb66073214eed6fe43fa8b1586f396e30e73e3#r635392090 + // Currently, ContainerD on Windows does not yet fully support HostProcess containers + // but will pass annotations to hcsshim which does have support. + windowsHostProcessContainer = "microsoft.com/hostprocess-container" ) type labeledPodSandboxInfo struct { @@ -89,7 +99,23 @@ func newPodLabels(pod *v1.Pod) map[string]string { // newPodAnnotations creates pod annotations from v1.Pod. func newPodAnnotations(pod *v1.Pod) map[string]string { - return pod.Annotations + annotations := map[string]string{} + + // Get annotations from v1.Pod + for k, v := range pod.Annotations { + annotations[k] = v + } + + if runtime.GOOS == "windows" && utilfeature.DefaultFeatureGate.Enabled(features.WindowsHostProcessContainers) { + if kubecontainer.HasWindowsHostProcessContainer(pod) { + // While WindowsHostProcessContainers is in alpha pass 'microsoft.com/hostprocess-container' annotation + // to pod sandbox creations request. ContainerD on Windows does not yet fully support HostProcess + // containers but will pass annotations to hcsshim which does have support. + annotations[windowsHostProcessContainer] = "true" + } + } + + return annotations } // newContainerLabels creates container labels from v1.Container and v1.Pod. @@ -143,6 +169,15 @@ func newContainerAnnotations(container *v1.Container, pod *v1.Pod, restartCount } } + if runtime.GOOS == "windows" && utilfeature.DefaultFeatureGate.Enabled(features.WindowsHostProcessContainers) { + if sc.HasWindowsHostProcessRequest(pod, container) { + // While WindowsHostProcessContainers is in alpha pass 'microsoft.com/hostprocess-container' annotation + // to create containers request. ContainerD on Windows does not yet fully support HostProcess containers + // but will pass annotations to hcsshim which does have support. + annotations[windowsHostProcessContainer] = "true" + } + } + return annotations } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go index 681c2b9adafd..6ca98aa8518d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go @@ -20,10 +20,11 @@ import ( "fmt" v1 "k8s.io/api/core/v1" + "k8s.io/apiserver/pkg/util/feature" v1affinityhelper "k8s.io/component-helpers/scheduling/corev1/nodeaffinity" "k8s.io/klog/v2" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" - "k8s.io/kubernetes/pkg/kubelet/util/format" + "k8s.io/kubernetes/pkg/features" schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename" @@ -136,11 +137,11 @@ func (w *predicateAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult case *PredicateFailureError: reason = re.PredicateName message = re.Error() - klog.V(2).InfoS("Predicate failed on Pod", "pod", format.Pod(admitPod), "err", message) + klog.V(2).InfoS("Predicate failed on Pod", "pod", klog.KObj(admitPod), "err", message) case *InsufficientResourceError: reason = fmt.Sprintf("OutOf%s", re.ResourceName) message = re.Error() - klog.V(2).InfoS("Predicate failed on Pod", "pod", format.Pod(admitPod), "err", message) + klog.V(2).InfoS("Predicate failed on Pod", "pod", klog.KObj(admitPod), "err", message) default: reason = "UnexpectedPredicateFailureType" message = fmt.Sprintf("GeneralPredicates failed due to %v, which is unexpected.", r) @@ -227,7 +228,7 @@ func GeneralPredicates(pod *v1.Pod, nodeInfo *schedulerframework.NodeInfo) ([]Pr } var reasons []PredicateFailureReason - for _, r := range noderesources.Fits(pod, nodeInfo) { + for _, r := range noderesources.Fits(pod, nodeInfo, feature.DefaultFeatureGate.Enabled(features.PodOverhead)) { reasons = append(reasons, &InsufficientResourceError{ ResourceName: r.ResourceName, Requested: r.Requested, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/logs/container_log_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/logs/container_log_manager.go index 148922998aa3..b007fa0ab612 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/logs/container_log_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/logs/container_log_manager.go @@ -138,9 +138,6 @@ func parseMaxSize(size string) (int64, error) { if !ok { return 0, fmt.Errorf("invalid max log size") } - if maxSize < 0 { - return 0, fmt.Errorf("negative max log size %d", maxSize) - } return maxSize, nil } @@ -161,6 +158,10 @@ func NewContainerLogManager(runtimeService internalapi.RuntimeService, osInterfa if err != nil { return nil, fmt.Errorf("failed to parse container log max size %q: %v", maxSize, err) } + // Negative number means to disable container log rotation + if parsedMaxSize < 0 { + return NewStubContainerLogManager(), nil + } // policy LogRotatePolicy return &containerLogManager{ osInterface: osInterface, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go index 6fb40e1875ba..aa256093be09 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go @@ -412,12 +412,13 @@ var ( []string{"runtime_handler"}, ) - // RunningPodCount is a gauge that tracks the number of Pods currently running + // RunningPodCount is a gauge that tracks the number of Pods currently with a running sandbox + // It is used to expose the kubelet internal state: how many pods have running containers in the container runtime, and mainly for debugging purpose. RunningPodCount = metrics.NewGauge( &metrics.GaugeOpts{ Subsystem: KubeletSubsystem, Name: RunningPodsKey, - Help: "Number of pods currently running", + Help: "Number of pods that have a running pod sandbox", StabilityLevel: metrics.ALPHA, }, ) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/network/dns/dns.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/network/dns/dns.go index 7d5dec8a7c2c..02a2289efcd6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/network/dns/dns.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/network/dns/dns.go @@ -27,9 +27,12 @@ import ( "k8s.io/api/core/v1" utilerrors "k8s.io/apimachinery/pkg/util/errors" + utilvalidation "k8s.io/apimachinery/pkg/util/validation" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/tools/record" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "k8s.io/kubernetes/pkg/apis/core/validation" + "k8s.io/kubernetes/pkg/features" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/util/format" @@ -99,19 +102,37 @@ func omitDuplicates(strs []string) []string { func (c *Configurer) formDNSSearchFitsLimits(composedSearch []string, pod *v1.Pod) []string { limitsExceeded := false - if len(composedSearch) > validation.MaxDNSSearchPaths { - composedSearch = composedSearch[:validation.MaxDNSSearchPaths] + maxDNSSearchPaths, maxDNSSearchListChars := validation.MaxDNSSearchPathsLegacy, validation.MaxDNSSearchListCharsLegacy + if utilfeature.DefaultFeatureGate.Enabled(features.ExpandedDNSConfig) { + maxDNSSearchPaths, maxDNSSearchListChars = validation.MaxDNSSearchPathsExpanded, validation.MaxDNSSearchListCharsExpanded + } + + if len(composedSearch) > maxDNSSearchPaths { + composedSearch = composedSearch[:maxDNSSearchPaths] limitsExceeded = true } - if resolvSearchLineStrLen := len(strings.Join(composedSearch, " ")); resolvSearchLineStrLen > validation.MaxDNSSearchListChars { + // In some DNS resolvers(e.g. glibc 2.28), DNS resolving causes abort() if there is a + // search path exceeding 255 characters. We have to filter them out. + l := 0 + for _, search := range composedSearch { + if len(search) > utilvalidation.DNS1123SubdomainMaxLength { + limitsExceeded = true + continue + } + composedSearch[l] = search + l++ + } + composedSearch = composedSearch[:l] + + if resolvSearchLineStrLen := len(strings.Join(composedSearch, " ")); resolvSearchLineStrLen > maxDNSSearchListChars { cutDomainsNum := 0 cutDomainsLen := 0 for i := len(composedSearch) - 1; i >= 0; i-- { cutDomainsLen += len(composedSearch[i]) + 1 cutDomainsNum++ - if (resolvSearchLineStrLen - cutDomainsLen) <= validation.MaxDNSSearchListChars { + if (resolvSearchLineStrLen - cutDomainsLen) <= maxDNSSearchListChars { break } } @@ -173,7 +194,10 @@ func (c *Configurer) CheckLimitsForResolvConf() { return } - domainCountLimit := validation.MaxDNSSearchPaths + domainCountLimit, maxDNSSearchListChars := validation.MaxDNSSearchPathsLegacy, validation.MaxDNSSearchListCharsLegacy + if utilfeature.DefaultFeatureGate.Enabled(features.ExpandedDNSConfig) { + domainCountLimit, maxDNSSearchListChars = validation.MaxDNSSearchPathsExpanded, validation.MaxDNSSearchListCharsExpanded + } if c.ClusterDomain != "" { domainCountLimit -= 3 @@ -186,8 +210,17 @@ func (c *Configurer) CheckLimitsForResolvConf() { return } - if len(strings.Join(hostSearch, " ")) > validation.MaxDNSSearchListChars { - log := fmt.Sprintf("Resolv.conf file '%s' contains search line which length is more than allowed %d chars!", c.ResolverConfig, validation.MaxDNSSearchListChars) + for _, search := range hostSearch { + if len(search) > utilvalidation.DNS1123SubdomainMaxLength { + log := fmt.Sprintf("Resolv.conf file %q contains a search path which length is more than allowed %d chars!", c.ResolverConfig, utilvalidation.DNS1123SubdomainMaxLength) + c.recorder.Event(c.nodeRef, v1.EventTypeWarning, "CheckLimitsForResolvConf", log) + klog.V(4).InfoS("Check limits for resolv.conf failed", "eventlog", log) + return + } + } + + if len(strings.Join(hostSearch, " ")) > maxDNSSearchListChars { + log := fmt.Sprintf("Resolv.conf file '%s' contains search line which length is more than allowed %d chars!", c.ResolverConfig, maxDNSSearchListChars) c.recorder.Event(c.nodeRef, v1.EventTypeWarning, "CheckLimitsForResolvConf", log) klog.V(4).InfoS("Check limits for resolv.conf failed", "eventlog", log) return diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go index 432e07de558d..d3c09d316f40 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go @@ -138,19 +138,18 @@ func (bus *DBusCon) MonitorShutdown() (<-chan bool, error) { go func() { for { - select { - case event := <-busChan: - if event == nil || len(event.Body) == 0 { - klog.ErrorS(nil, "Failed obtaining shutdown event, PrepareForShutdown event was empty") - continue - } - shutdownActive, ok := event.Body[0].(bool) - if !ok { - klog.ErrorS(nil, "Failed obtaining shutdown event, PrepareForShutdown event was not bool type as expected") - continue - } - shutdownChan <- shutdownActive + event := <-busChan + if event == nil || len(event.Body) == 0 { + klog.ErrorS(nil, "Failed obtaining shutdown event, PrepareForShutdown event was empty") + continue } + shutdownActive, ok := event.Body[0].(bool) + if !ok { + klog.ErrorS(nil, "Failed obtaining shutdown event, PrepareForShutdown event was not bool type as expected") + continue + } + shutdownChan <- shutdownActive + } }() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pleg/generic.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pleg/generic.go index 1bc06466d45f..0d9573ebbb0d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pleg/generic.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pleg/generic.go @@ -292,7 +292,7 @@ func (g *GenericPLEG) relist() { } } if containerID, ok := events[i].Data.(string); ok { - if exitCode, ok := containerExitCode[containerID]; ok { + if exitCode, ok := containerExitCode[containerID]; ok && pod != nil { klog.V(2).InfoS("Generic (PLEG): container finished", "podID", pod.ID, "containerID", containerID, "exitCode", exitCode) } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go index 89f4c18f997a..b5f7490e59af 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go @@ -42,7 +42,7 @@ type MirrorClient interface { DeleteMirrorPod(podFullName string, uid *types.UID) (bool, error) } -// nodeGetter is a subset a NodeLister, simplified for testing. +// nodeGetter is a subset of NodeLister, simplified for testing. type nodeGetter interface { // Get retrieves the Node for a given name. Get(name string) (*v1.Node, error) @@ -122,7 +122,13 @@ func (mc *basicMirrorClient) DeleteMirrorPod(podFullName string, uid *types.UID) klog.ErrorS(err, "Failed to parse a pod full name", "podFullName", podFullName) return false, err } - klog.V(2).InfoS("Deleting a mirror pod", "pod", klog.KRef(namespace, name), "podUID", uid) + + var uidValue types.UID + if uid != nil { + uidValue = *uid + } + klog.V(2).InfoS("Deleting a mirror pod", "pod", klog.KRef(namespace, name), "podUID", uidValue) + var GracePeriodSeconds int64 if err := mc.apiserverClient.CoreV1().Pods(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{GracePeriodSeconds: &GracePeriodSeconds, Preconditions: &metav1.Preconditions{UID: uid}}); err != nil { // Unfortunately, there's no generic error for failing a precondition diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go index fcf059f56e33..5072cf18411f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go @@ -193,7 +193,7 @@ func (p *podWorkers) managePodLoop(podUpdates <-chan UpdatePodOptions) { } } -// Apply the new setting to the specified pod. +// UpdatePod apply the new setting to the specified pod. // If the options provide an OnCompleteFunc, the function is invoked if the update is accepted. // Update requests are ignored if a kill pod request is pending. func (p *podWorkers) UpdatePod(options *UpdatePodOptions) { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober_manager.go index af6c723ec088..83532a313c30 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/prober/prober_manager.go @@ -241,8 +241,8 @@ func (m *manager) UpdatePodStatus(podUID types.UID, podStatus *v1.PodStatus) { var ready bool if c.State.Running == nil { ready = false - } else if result, ok := m.readinessManager.Get(kubecontainer.ParseContainerID(c.ContainerID)); ok { - ready = result == results.Success + } else if result, ok := m.readinessManager.Get(kubecontainer.ParseContainerID(c.ContainerID)); ok && result == results.Success { + ready = true } else { // The check whether there is a probe which hasn't run yet. w, exists := m.getWorker(podUID, c.Name, readiness) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/volume_stat_calculator.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/volume_stat_calculator.go index 39396d2f5d9b..89cf5fd4c2a7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/volume_stat_calculator.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/server/stats/volume_stat_calculator.go @@ -112,7 +112,12 @@ func (s *volumeStatCalculator) calcAndStoreStats() { for name, v := range blockVolumes { // Only add the blockVolume if it implements the MetricsProvider interface if _, ok := v.(volume.MetricsProvider); ok { - metricVolumes[name] = v + // Some drivers inherit the MetricsProvider interface from Filesystem + // mode volumes, but do not implement it for Block mode. Checking + // SupportsMetrics() will prevent panics in that case. + if v.SupportsMetrics() { + metricVolumes[name] = v + } } } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/cri_stats_provider.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/cri_stats_provider.go index e8fe923e41f5..e2f6ed41a270 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/cri_stats_provider.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/cri_stats_provider.go @@ -67,8 +67,9 @@ type criStatsProvider struct { hostStatsProvider HostStatsProvider // cpuUsageCache caches the cpu usage for containers. - cpuUsageCache map[string]*cpuUsageRecord - mutex sync.RWMutex + cpuUsageCache map[string]*cpuUsageRecord + mutex sync.RWMutex + disableAcceleratorUsageMetrics bool } // newCRIStatsProvider returns a containerStatsProvider implementation that @@ -79,14 +80,16 @@ func newCRIStatsProvider( runtimeService internalapi.RuntimeService, imageService internalapi.ImageManagerService, hostStatsProvider HostStatsProvider, + disableAcceleratorUsageMetrics bool, ) containerStatsProvider { return &criStatsProvider{ - cadvisor: cadvisor, - resourceAnalyzer: resourceAnalyzer, - runtimeService: runtimeService, - imageService: imageService, - hostStatsProvider: hostStatsProvider, - cpuUsageCache: make(map[string]*cpuUsageRecord), + cadvisor: cadvisor, + resourceAnalyzer: resourceAnalyzer, + runtimeService: runtimeService, + imageService: imageService, + hostStatsProvider: hostStatsProvider, + cpuUsageCache: make(map[string]*cpuUsageRecord), + disableAcceleratorUsageMetrics: disableAcceleratorUsageMetrics, } } @@ -784,8 +787,11 @@ func (p *criStatsProvider) addCadvisorContainerStats( if memory != nil { cs.Memory = memory } - accelerators := cadvisorInfoToAcceleratorStats(caPodStats) - cs.Accelerators = accelerators + + if !p.disableAcceleratorUsageMetrics { + accelerators := cadvisorInfoToAcceleratorStats(caPodStats) + cs.Accelerators = accelerators + } } func (p *criStatsProvider) addCadvisorContainerCPUAndMemoryStats( diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/host_stats_provider.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/host_stats_provider.go index 108fbfb8f142..450b832bff5a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/host_stats_provider.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/host_stats_provider.go @@ -18,6 +18,7 @@ package stats import ( "fmt" + "os" "path/filepath" cadvisorapiv2 "github.com/google/cadvisor/info/v2" @@ -84,6 +85,10 @@ func (h hostStatsProvider) getPodEtcHostsStats(podUID types.UID, rootFsInfo *cad if !isEtcHostsSupported { return nil, nil } + // Some pods have an explicit /etc/hosts mount and the Kubelet will not create an etc-hosts file for them + if _, err := os.Stat(podEtcHostsPath); os.IsNotExist(err) { + return nil, nil + } metrics := volume.NewMetricsDu(podEtcHostsPath) hostMetrics, err := metrics.GetMetrics() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/provider.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/provider.go index 360c740315d7..fd3c5dd82480 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/provider.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/provider.go @@ -42,9 +42,10 @@ func NewCRIStatsProvider( runtimeService internalapi.RuntimeService, imageService internalapi.ImageManagerService, hostStatsProvider HostStatsProvider, + disableAcceleratorUsageMetrics bool, ) *Provider { return newStatsProvider(cadvisor, podManager, runtimeCache, newCRIStatsProvider(cadvisor, resourceAnalyzer, - runtimeService, imageService, hostStatsProvider)) + runtimeService, imageService, hostStatsProvider, disableAcceleratorUsageMetrics)) } // NewCadvisorStatsProvider returns a containerStatsProvider that provides both diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go index fb607ea8f8f0..c8ee37a5222b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go @@ -566,7 +566,7 @@ func (m *manager) syncPod(uid types.UID, status versionedPodStatus) { klog.InfoS("Failed to get status for pod", "podUID", uid, "pod", klog.KRef(status.podNamespace, status.podName), - "error", err) + "err", err) return } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler/reconciler.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler/reconciler.go index e09e269f1bcc..5966cd969d98 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler/reconciler.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler/reconciler.go @@ -408,7 +408,7 @@ func (rc *reconciler) syncStates() { continue } // No pod needs the volume. - klog.InfoS("Could not construct volume information, cleaning up mounts", "podName", volume.podName, "volumeSpecName", volume.volumeSpecName, "error", err) + klog.InfoS("Could not construct volume information, cleaning up mounts", "podName", volume.podName, "volumeSpecName", volume.volumeSpecName, "err", err) rc.cleanupMounts(volume) continue } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubemark/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubemark/OWNERS index df1812090709..1b1742e9350a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubemark/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubemark/OWNERS @@ -11,3 +11,6 @@ approvers: emeritus_approvers: - gmarek + +labels: + - sig/scalability diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubemark/hollow_kubelet.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubemark/hollow_kubelet.go index 0e7d067b50b9..1e87576b1699 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubemark/hollow_kubelet.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubemark/hollow_kubelet.go @@ -54,7 +54,6 @@ import ( "k8s.io/kubernetes/pkg/volume/projected" "k8s.io/kubernetes/pkg/volume/quobyte" "k8s.io/kubernetes/pkg/volume/rbd" - "k8s.io/kubernetes/pkg/volume/scaleio" "k8s.io/kubernetes/pkg/volume/secret" "k8s.io/kubernetes/pkg/volume/storageos" "k8s.io/kubernetes/pkg/volume/util/hostutil" @@ -86,7 +85,6 @@ func volumePlugins() []volume.VolumePlugin { allPlugins = append(allPlugins, configmap.ProbeVolumePlugins()...) allPlugins = append(allPlugins, projected.ProbeVolumePlugins()...) allPlugins = append(allPlugins, portworx.ProbeVolumePlugins()...) - allPlugins = append(allPlugins, scaleio.ProbeVolumePlugins()...) allPlugins = append(allPlugins, local.ProbeVolumePlugins()...) allPlugins = append(allPlugins, storageos.ProbeVolumePlugins()...) allPlugins = append(allPlugins, csi.ProbeVolumePlugins()...) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpointslicecache.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpointslicecache.go index ec3bb8b3292a..58f8ef3fbc03 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpointslicecache.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/endpointslicecache.go @@ -89,7 +89,7 @@ type endpointInfo struct { } // spToEndpointMap stores groups Endpoint objects by ServicePortName and -// IP address. +// endpoint string (returned by Endpoint.String()). type spToEndpointMap map[ServicePortName]map[string]Endpoint // NewEndpointSliceCache initializes an EndpointSliceCache. @@ -251,20 +251,20 @@ func (cache *EndpointSliceCache) endpointInfoByServicePort(serviceNN types.Names Protocol: *port.Protocol, } - endpointInfoBySP[svcPortName] = cache.addEndpointsByIP(serviceNN, int(*port.Port), endpointInfoBySP[svcPortName], sliceInfo.Endpoints) + endpointInfoBySP[svcPortName] = cache.addEndpoints(serviceNN, int(*port.Port), endpointInfoBySP[svcPortName], sliceInfo.Endpoints) } } return endpointInfoBySP } -// addEndpointsByIP adds endpointInfo for each IP. -func (cache *EndpointSliceCache) addEndpointsByIP(serviceNN types.NamespacedName, portNum int, endpointsByIP map[string]Endpoint, endpoints []*endpointInfo) map[string]Endpoint { - if endpointsByIP == nil { - endpointsByIP = map[string]Endpoint{} +// addEndpoints adds endpointInfo for each unique endpoint. +func (cache *EndpointSliceCache) addEndpoints(serviceNN types.NamespacedName, portNum int, endpointSet map[string]Endpoint, endpoints []*endpointInfo) map[string]Endpoint { + if endpointSet == nil { + endpointSet = map[string]Endpoint{} } - // iterate through endpoints to add them to endpointsByIP. + // iterate through endpoints to add them to endpointSet. for _, endpoint := range endpoints { if len(endpoint.Addresses) == 0 { klog.Warningf("ignoring invalid endpoint port %s with empty addresses", endpoint) @@ -290,15 +290,15 @@ func (cache *EndpointSliceCache) addEndpointsByIP(serviceNN types.NamespacedName endpointInfo := newBaseEndpointInfo(endpoint.Addresses[0], portNum, isLocal, endpoint.Topology, endpoint.Ready, endpoint.Serving, endpoint.Terminating, endpoint.ZoneHints) - // This logic ensures we're deduping potential overlapping endpoints - // isLocal should not vary between matching IPs, but if it does, we + // This logic ensures we're deduplicating potential overlapping endpoints + // isLocal should not vary between matching endpoints, but if it does, we // favor a true value here if it exists. - if _, exists := endpointsByIP[endpointInfo.IP()]; !exists || isLocal { - endpointsByIP[endpointInfo.IP()] = cache.makeEndpointInfo(endpointInfo) + if _, exists := endpointSet[endpointInfo.String()]; !exists || isLocal { + endpointSet[endpointInfo.String()] = cache.makeEndpointInfo(endpointInfo) } } - return endpointsByIP + return endpointSet } func (cache *EndpointSliceCache) isLocal(hostname string) bool { @@ -341,15 +341,15 @@ func endpointsMapFromEndpointInfo(endpointInfoBySP map[ServicePortName]map[strin endpointsMap := EndpointsMap{} // transform endpointInfoByServicePort into an endpointsMap with sorted IPs. - for svcPortName, endpointInfoByIP := range endpointInfoBySP { - if len(endpointInfoByIP) > 0 { + for svcPortName, endpointSet := range endpointInfoBySP { + if len(endpointSet) > 0 { endpointsMap[svcPortName] = []Endpoint{} - for _, endpointInfo := range endpointInfoByIP { + for _, endpointInfo := range endpointSet { endpointsMap[svcPortName] = append(endpointsMap[svcPortName], endpointInfo) } - // Ensure IPs are always returned in the same order to simplify diffing. - sort.Sort(byIP(endpointsMap[svcPortName])) + // Ensure endpoints are always returned in the same order to simplify diffing. + sort.Sort(byEndpoint(endpointsMap[svcPortName])) klog.V(3).Infof("Setting endpoints for %q to %+v", svcPortName, formatEndpointsList(endpointsMap[svcPortName])) } @@ -392,16 +392,16 @@ func (e byAddress) Less(i, j int) bool { return strings.Join(e[i].Addresses, ",") < strings.Join(e[j].Addresses, ",") } -// byIP helps sort endpoints by IP -type byIP []Endpoint +// byEndpoint helps sort endpoints by endpoint string. +type byEndpoint []Endpoint -func (e byIP) Len() int { +func (e byEndpoint) Len() int { return len(e) } -func (e byIP) Swap(i, j int) { +func (e byEndpoint) Swap(i, j int) { e[i], e[j] = e[j], e[i] } -func (e byIP) Less(i, j int) bool { +func (e byEndpoint) Less(i, j int) bool { return e[i].String() < e[j].String() } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/iptables/proxier.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/iptables/proxier.go index d186060396a7..0e7fb1a73cb9 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/iptables/proxier.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/iptables/proxier.go @@ -273,13 +273,13 @@ func NewProxier(ipt utiliptables.Interface, // are connected to a Linux bridge (but not SDN bridges). Until most // plugins handle this, log when config is missing if val, err := sysctl.GetSysctl(sysctlBridgeCallIPTables); err == nil && val != 1 { - klog.InfoS("missing br-netfilter module or unset sysctl br-nf-call-iptables; proxy may not work as intended") + klog.InfoS("Missing br-netfilter module or unset sysctl br-nf-call-iptables; proxy may not work as intended") } // Generate the masquerade mark to use for SNAT rules. masqueradeValue := 1 << uint(masqueradeBit) masqueradeMark := fmt.Sprintf("%#08x", masqueradeValue) - klog.V(2).InfoS("using iptables mark for masquerade", "ipFamily", ipt.Protocol(), "mark", masqueradeMark) + klog.V(2).InfoS("Using iptables mark for masquerade", "ipFamily", ipt.Protocol(), "mark", masqueradeMark) endpointSlicesEnabled := utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceProxying) @@ -294,7 +294,7 @@ func NewProxier(ipt utiliptables.Interface, nodePortAddresses = ipFamilyMap[ipFamily] // Log the IPs not matching the ipFamily if ips, ok := ipFamilyMap[utilproxy.OtherIPFamily(ipFamily)]; ok && len(ips) > 0 { - klog.InfoS("found node IPs of the wrong family", "ipFamily", ipFamily, "ips", strings.Join(ips, ",")) + klog.InfoS("Found node IPs of the wrong family", "ipFamily", ipFamily, "ips", strings.Join(ips, ",")) } proxier := &Proxier{ @@ -327,7 +327,7 @@ func NewProxier(ipt utiliptables.Interface, } burstSyncs := 2 - klog.V(2).InfoS("iptables sync params", "ipFamily", ipt.Protocol(), "minSyncPeriod", minSyncPeriod, "syncPeriod", syncPeriod, "burstSyncs", burstSyncs) + klog.V(2).InfoS("Iptables sync params", "ipFamily", ipt.Protocol(), "minSyncPeriod", minSyncPeriod, "syncPeriod", syncPeriod, "burstSyncs", burstSyncs) // We pass syncPeriod to ipt.Monitor, which will call us only if it needs to. // We need to pass *some* maxInterval to NewBoundedFrequencyRunner anyway though. // time.Hour is arbitrary. @@ -337,9 +337,9 @@ func NewProxier(ipt utiliptables.Interface, proxier.syncProxyRules, syncPeriod, wait.NeverStop) if ipt.HasRandomFully() { - klog.V(2).InfoS("iptables supports --random-fully", "ipFamily", ipt.Protocol()) + klog.V(2).InfoS("Iptables supports --random-fully", "ipFamily", ipt.Protocol()) } else { - klog.V(2).InfoS("iptables does not support --random-fully", "ipFamily", ipt.Protocol()) + klog.V(2).InfoS("Iptables does not support --random-fully", "ipFamily", ipt.Protocol()) } return proxier, nil @@ -829,7 +829,7 @@ func (proxier *Proxier) syncProxyRules() { start := time.Now() defer func() { metrics.SyncProxyRulesLatency.Observe(metrics.SinceInSeconds(start)) - klog.V(2).InfoS("syncProxyRules complete", "elapsed", time.Since(start)) + klog.V(2).InfoS("SyncProxyRules complete", "elapsed", time.Since(start)) }() // We assume that if this was called, we really want to sync them, @@ -1620,7 +1620,7 @@ func (proxier *Proxier) syncProxyRules() { numberNatIptablesRules := utilproxy.CountBytesLines(proxier.natRules.Bytes()) metrics.IptablesRulesTotal.WithLabelValues(string(utiliptables.TableNAT)).Set(float64(numberNatIptablesRules)) - klog.V(5).InfoS("Restoring iptables", "rules", string(proxier.iptablesData.Bytes())) + klog.V(5).InfoS("Restoring iptables", "rules", proxier.iptablesData.Bytes()) err = proxier.iptables.RestoreAll(proxier.iptablesData.Bytes(), utiliptables.NoFlushTables, utiliptables.RestoreCounters) if err != nil { klog.ErrorS(err, "Failed to execute iptables-restore") diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/proxier.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/proxier.go index de0bc4032c53..48b61d636dc2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/proxier.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/ipvs/proxier.go @@ -359,7 +359,7 @@ func NewProxier(ipt utiliptables.Interface, // are connected to a Linux bridge (but not SDN bridges). Until most // plugins handle this, log when config is missing if val, err := sysctl.GetSysctl(sysctlBridgeCallIPTables); err == nil && val != 1 { - klog.Infof("missing br-netfilter module or unset sysctl br-nf-call-iptables; proxy may not work as intended") + klog.InfoS("Missing br-netfilter module or unset sysctl br-nf-call-iptables; proxy may not work as intended") } // Set the conntrack sysctl we need for @@ -376,7 +376,7 @@ func NewProxier(ipt utiliptables.Interface, return nil, fmt.Errorf("error parsing kernel version %q: %v", kernelVersionStr, err) } if kernelVersion.LessThan(version.MustParseGeneric(connReuseMinSupportedKernelVersion)) { - klog.Errorf("can't set sysctl %s, kernel version must be at least %s", sysctlConnReuse, connReuseMinSupportedKernelVersion) + klog.ErrorS(nil, fmt.Sprintf("can't set sysctl %s, kernel version must be at least %s", sysctlConnReuse, connReuseMinSupportedKernelVersion)) } else { // Set the connection reuse mode if err := utilproxy.EnsureSysctl(sysctl, sysctlConnReuse, 0); err != nil { @@ -416,7 +416,7 @@ func NewProxier(ipt utiliptables.Interface, // current system timeout should be preserved if tcpTimeout > 0 || tcpFinTimeout > 0 || udpTimeout > 0 { if err := ipvs.ConfigureTimeouts(tcpTimeout, tcpFinTimeout, udpTimeout); err != nil { - klog.Warningf("failed to configure IPVS timeouts: %v", err) + klog.ErrorS(err, "failed to configure IPVS timeouts") } } @@ -429,10 +429,10 @@ func NewProxier(ipt utiliptables.Interface, ipFamily = v1.IPv6Protocol } - klog.V(2).Infof("nodeIP: %v, family: %v", nodeIP, ipFamily) + klog.V(2).InfoS("record nodeIP and family", "nodeIP", nodeIP, "family", ipFamily) if len(scheduler) == 0 { - klog.Warningf("IPVS scheduler not specified, use %s by default", DefaultScheduler) + klog.InfoS("IPVS scheduler not specified, use rr by default") scheduler = DefaultScheduler } @@ -444,7 +444,7 @@ func NewProxier(ipt utiliptables.Interface, nodePortAddresses = ipFamilyMap[ipFamily] // Log the IPs not matching the ipFamily if ips, ok := ipFamilyMap[utilproxy.OtherIPFamily(ipFamily)]; ok && len(ips) > 0 { - klog.Warningf("IP Family: %s, NodePortAddresses of wrong family; %s", ipFamily, strings.Join(ips, ",")) + klog.InfoS("found node IPs of the wrong family", "ipFamily", ipFamily, "ips", strings.Join(ips, ",")) } // excludeCIDRs has been validated before, here we just parse it to IPNet list @@ -492,8 +492,7 @@ func NewProxier(ipt utiliptables.Interface, proxier.ipsetList[is.name] = NewIPSet(ipset, is.name, is.setType, (ipFamily == v1.IPv6Protocol), is.comment) } burstSyncs := 2 - klog.V(2).Infof("ipvs(%s) sync params: minSyncPeriod=%v, syncPeriod=%v, burstSyncs=%d", - ipt.Protocol(), minSyncPeriod, syncPeriod, burstSyncs) + klog.V(2).InfoS("ipvs sync params", "ipFamily", ipt.Protocol(), "minSyncPeriod", minSyncPeriod, "syncPeriod", syncPeriod, "burstSyncs", burstSyncs) proxier.syncRunner = async.NewBoundedFrequencyRunner("sync-runner", proxier.syncProxyRules, minSyncPeriod, syncPeriod, burstSyncs) proxier.gracefuldeleteManager.Run() return proxier, nil @@ -618,7 +617,7 @@ func (handle *LinuxKernelHandler) GetModules() ([]string, error) { // Find out loaded kernel modules. If this is a full static kernel it will try to verify if the module is compiled using /boot/config-KERNELVERSION modulesFile, err := os.Open("/proc/modules") if err == os.ErrNotExist { - klog.Warningf("Failed to read file /proc/modules with error %v. Assuming this is a kernel without loadable modules support enabled", err) + klog.ErrorS(err, "Failed to read file /proc/modules. Assuming this is a kernel without loadable modules support enabled") kernelConfigFile := fmt.Sprintf("/boot/config-%s", kernelVersionStr) kConfig, err := ioutil.ReadFile(kernelConfigFile) if err != nil { @@ -643,7 +642,7 @@ func (handle *LinuxKernelHandler) GetModules() ([]string, error) { builtinModsFilePath := fmt.Sprintf("/lib/modules/%s/modules.builtin", kernelVersionStr) b, err := ioutil.ReadFile(builtinModsFilePath) if err != nil { - klog.Warningf("Failed to read file %s with error %v. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules", builtinModsFilePath, err) + klog.ErrorS(err, "Failed to read builtin modules file. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules", "filePath", builtinModsFilePath) } for _, module := range ipvsModules { @@ -653,8 +652,8 @@ func (handle *LinuxKernelHandler) GetModules() ([]string, error) { // Try to load the required IPVS kernel modules if not built in err := handle.executor.Command("modprobe", "--", module).Run() if err != nil { - klog.Warningf("Failed to load kernel module %v with modprobe. "+ - "You can ignore this message when kube-proxy is running inside container without mounting /lib/modules", module) + klog.InfoS("Failed to load kernel module with modprobe. "+ + "You can ignore this message when kube-proxy is running inside container without mounting /lib/modules", "moduleName", module) } else { lmods = append(lmods, module) } @@ -766,7 +765,7 @@ func cleanupIptablesLeftovers(ipt utiliptables.Interface) (encounteredError bool } if err := ipt.DeleteRule(jc.table, jc.from, args...); err != nil { if !utiliptables.IsNotFoundError(err) { - klog.Errorf("Error removing iptables rules in ipvs proxier: %v", err) + klog.ErrorS(err, "Error removing iptables rules in ipvs proxier") encounteredError = true } } @@ -776,7 +775,7 @@ func cleanupIptablesLeftovers(ipt utiliptables.Interface) (encounteredError bool for _, ch := range iptablesCleanupChains { if err := ipt.FlushChain(ch.table, ch.chain); err != nil { if !utiliptables.IsNotFoundError(err) { - klog.Errorf("Error removing iptables rules in ipvs proxier: %v", err) + klog.ErrorS(err, "Error removing iptables rules in ipvs proxier") encounteredError = true } } @@ -786,7 +785,7 @@ func cleanupIptablesLeftovers(ipt utiliptables.Interface) (encounteredError bool for _, ch := range iptablesCleanupChains { if err := ipt.DeleteChain(ch.table, ch.chain); err != nil { if !utiliptables.IsNotFoundError(err) { - klog.Errorf("Error removing iptables rules in ipvs proxier: %v", err) + klog.ErrorS(err, "Error removing iptables rules in ipvs proxier") encounteredError = true } } @@ -801,7 +800,7 @@ func CleanupLeftovers(ipvs utilipvs.Interface, ipt utiliptables.Interface, ipset if ipvs != nil { err := ipvs.Flush() if err != nil { - klog.Errorf("Error flushing IPVS rules: %v", err) + klog.ErrorS(err, "Error flushing IPVS rules") encounteredError = true } } @@ -809,7 +808,7 @@ func CleanupLeftovers(ipvs utilipvs.Interface, ipt utiliptables.Interface, ipset nl := NewNetLinkHandle(false) err := nl.DeleteDummyDevice(DefaultDummyDevice) if err != nil { - klog.Errorf("Error deleting dummy device %s created by IPVS proxier: %v", DefaultDummyDevice, err) + klog.ErrorS(err, "Error deleting dummy device created by IPVS proxier", "device", DefaultDummyDevice) encounteredError = true } // Clear iptables created by ipvs Proxier. @@ -820,7 +819,7 @@ func CleanupLeftovers(ipvs utilipvs.Interface, ipt utiliptables.Interface, ipset err = ipset.DestroySet(set.name) if err != nil { if !utilipset.IsNotFoundError(err) { - klog.Errorf("Error removing ipset %s, error: %v", set.name, err) + klog.ErrorS(err, "Error removing ipset", "ipset", set.name) encounteredError = true } } @@ -960,7 +959,7 @@ func (proxier *Proxier) OnEndpointSlicesSynced() { // is observed. func (proxier *Proxier) OnNodeAdd(node *v1.Node) { if node.Name != proxier.hostname { - klog.Errorf("Received a watch event for a node %s that doesn't match the current node %v", node.Name, proxier.hostname) + klog.ErrorS(nil, "Received a watch event for a node that doesn't match the current node", "eventNode", node.Name, "currentNode", proxier.hostname) return } @@ -983,7 +982,7 @@ func (proxier *Proxier) OnNodeAdd(node *v1.Node) { // node object is observed. func (proxier *Proxier) OnNodeUpdate(oldNode, node *v1.Node) { if node.Name != proxier.hostname { - klog.Errorf("Received a watch event for a node %s that doesn't match the current node %v", node.Name, proxier.hostname) + klog.ErrorS(nil, "Received a watch event for a node that doesn't match the current node", "eventNode", node.Name, "currentNode", proxier.hostname) return } @@ -1006,7 +1005,7 @@ func (proxier *Proxier) OnNodeUpdate(oldNode, node *v1.Node) { // object is observed. func (proxier *Proxier) OnNodeDelete(node *v1.Node) { if node.Name != proxier.hostname { - klog.Errorf("Received a watch event for a node %s that doesn't match the current node %v", node.Name, proxier.hostname) + klog.ErrorS(nil, "Received a watch event for a node that doesn't match the current node", "eventNode", node.Name, "currentNode", proxier.hostname) return } proxier.mu.Lock() @@ -1021,9 +1020,6 @@ func (proxier *Proxier) OnNodeDelete(node *v1.Node) { func (proxier *Proxier) OnNodeSynced() { } -// EntryInvalidErr indicates if an ipset entry is invalid or not -const EntryInvalidErr = "error adding entry %s to ipset %s" - // This is where all of the ipvs calls happen. // assumes proxier.mu is held func (proxier *Proxier) syncProxyRules() { @@ -1032,7 +1028,7 @@ func (proxier *Proxier) syncProxyRules() { // don't sync rules till we've received services and endpoints if !proxier.isInitialized() { - klog.V(2).Info("Not syncing ipvs rules until Services and Endpoints have been received from master") + klog.V(2).InfoS("Not syncing ipvs rules until Services and Endpoints have been received from master") return } @@ -1040,7 +1036,7 @@ func (proxier *Proxier) syncProxyRules() { start := time.Now() defer func() { metrics.SyncProxyRulesLatency.Observe(metrics.SinceInSeconds(start)) - klog.V(4).Infof("syncProxyRules took %v", time.Since(start)) + klog.V(4).InfoS("syncProxyRules complete", "elapsed", time.Since(start)) }() // We assume that if this was called, we really want to sync them, @@ -1053,7 +1049,7 @@ func (proxier *Proxier) syncProxyRules() { // merge stale services gathered from updateEndpointsMap for _, svcPortName := range endpointUpdateResult.StaleServiceNames { if svcInfo, ok := proxier.serviceMap[svcPortName]; ok && svcInfo != nil && conntrack.IsClearConntrackNeeded(svcInfo.Protocol()) { - klog.V(2).Infof("Stale %s service %v -> %s", strings.ToLower(string(svcInfo.Protocol())), svcPortName, svcInfo.ClusterIP().String()) + klog.V(2).InfoS("Stale service", "protocol", strings.ToLower(string(svcInfo.Protocol())), "svcPortName", svcPortName.String(), "clusterIP", svcInfo.ClusterIP().String()) staleServices.Insert(svcInfo.ClusterIP().String()) for _, extIP := range svcInfo.ExternalIPStrings() { staleServices.Insert(extIP) @@ -1061,7 +1057,7 @@ func (proxier *Proxier) syncProxyRules() { } } - klog.V(3).Infof("Syncing ipvs Proxier rules") + klog.V(3).InfoS("Syncing ipvs Proxier rules") // Begin install iptables @@ -1081,7 +1077,7 @@ func (proxier *Proxier) syncProxyRules() { // make sure dummy interface exists in the system where ipvs Proxier will bind service address on it _, err := proxier.netlinkHandle.EnsureDummyDevice(DefaultDummyDevice) if err != nil { - klog.Errorf("Failed to create dummy interface: %s, error: %v", DefaultDummyDevice, err) + klog.ErrorS(err, "Failed to create dummy interface", "interface", DefaultDummyDevice) return } @@ -1104,7 +1100,7 @@ func (proxier *Proxier) syncProxyRules() { bindedAddresses, err := proxier.ipGetter.BindedIPs() if err != nil { - klog.Errorf("error listing addresses binded to dummy interface, error: %v", err) + klog.ErrorS(err, "error listing addresses binded to dummy interface") } hasNodePort := false @@ -1128,7 +1124,7 @@ func (proxier *Proxier) syncProxyRules() { if hasNodePort { nodeAddrSet, err := utilproxy.GetNodeAddresses(proxier.nodePortAddresses, proxier.networkInterfacer) if err != nil { - klog.Errorf("Failed to get node ip address matching nodeport cidr: %v", err) + klog.ErrorS(err, "Failed to get node ip address matching nodeport cidr") } else { nodeAddresses = nodeAddrSet.List() for _, address := range nodeAddresses { @@ -1139,7 +1135,7 @@ func (proxier *Proxier) syncProxyRules() { if utilproxy.IsZeroCIDR(address) { nodeIPs, err = proxier.ipGetter.NodeIPs() if err != nil { - klog.Errorf("Failed to list all node IPs from host, err: %v", err) + klog.ErrorS(err, "Failed to list all node IPs from host") } break } @@ -1165,7 +1161,7 @@ func (proxier *Proxier) syncProxyRules() { for svcName, svc := range proxier.serviceMap { svcInfo, ok := svc.(*serviceInfo) if !ok { - klog.Errorf("Failed to cast serviceInfo %q", svcName.String()) + klog.ErrorS(nil, "Failed to cast serviceInfo", "svcName", svcName.String()) continue } isIPv6 := utilnet.IsIPv6(svcInfo.ClusterIP()) @@ -1182,7 +1178,7 @@ func (proxier *Proxier) syncProxyRules() { for _, e := range proxier.endpointsMap[svcName] { ep, ok := e.(*proxy.BaseEndpointInfo) if !ok { - klog.Errorf("Failed to cast BaseEndpointInfo %q", e.String()) + klog.ErrorS(nil, "Failed to cast BaseEndpointInfo", "endpoint", e.String()) continue } if !ep.IsLocal { @@ -1202,7 +1198,7 @@ func (proxier *Proxier) syncProxyRules() { SetType: utilipset.HashIPPortIP, } if valid := proxier.ipsetList[kubeLoopBackIPSet].validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, proxier.ipsetList[kubeLoopBackIPSet].Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", proxier.ipsetList[kubeLoopBackIPSet].Name) continue } proxier.ipsetList[kubeLoopBackIPSet].activeEntries.Insert(entry.String()) @@ -1219,7 +1215,7 @@ func (proxier *Proxier) syncProxyRules() { // add service Cluster IP:Port to kubeServiceAccess ip set for the purpose of solving hairpin. // proxier.kubeServiceAccessSet.activeEntries.Insert(entry.String()) if valid := proxier.ipsetList[kubeClusterIPSet].validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, proxier.ipsetList[kubeClusterIPSet].Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", proxier.ipsetList[kubeClusterIPSet].Name) continue } proxier.ipsetList[kubeClusterIPSet].activeEntries.Insert(entry.String()) @@ -1242,10 +1238,10 @@ func (proxier *Proxier) syncProxyRules() { // ExternalTrafficPolicy only works for NodePort and external LB traffic, does not affect ClusterIP // So we still need clusterIP rules in onlyNodeLocalEndpoints mode. if err := proxier.syncEndpoint(svcName, false, svcInfo.NodeLocalInternal(), serv); err != nil { - klog.Errorf("Failed to sync endpoint for service: %v, err: %v", serv, err) + klog.ErrorS(err, "Failed to sync endpoint for service", "service", serv.String()) } } else { - klog.Errorf("Failed to sync service: %v, err: %v", serv, err) + klog.ErrorS(err, "Failed to sync service", "service", serv.String()) } // Capture externalIPs. @@ -1263,7 +1259,7 @@ func (proxier *Proxier) syncProxyRules() { Protocol: utilnet.Protocol(svcInfo.Protocol()), } if proxier.portsMap[lp] != nil { - klog.V(4).Infof("Port %s was open before and is still needed", lp.String()) + klog.V(4).InfoS("Port was open before and is still needed", "port", lp.String()) replacementPortsMap[lp] = proxier.portsMap[lp] } else { socket, err := proxier.portMapper.OpenLocalPort(&lp) @@ -1280,7 +1276,7 @@ func (proxier *Proxier) syncProxyRules() { klog.ErrorS(err, "can't open port, skipping it", "port", lp.String()) continue } - klog.V(2).Infof("Opened local port %s", lp.String()) + klog.V(2).InfoS("Opened local port", "port", lp.String()) replacementPortsMap[lp] = socket } } // We're holding the port, so it's OK to install IPVS rules. @@ -1295,14 +1291,14 @@ func (proxier *Proxier) syncProxyRules() { if svcInfo.NodeLocalExternal() { if valid := proxier.ipsetList[kubeExternalIPLocalSet].validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, proxier.ipsetList[kubeExternalIPLocalSet].Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", proxier.ipsetList[kubeExternalIPLocalSet].Name) continue } proxier.ipsetList[kubeExternalIPLocalSet].activeEntries.Insert(entry.String()) } else { // We have to SNAT packets to external IPs. if valid := proxier.ipsetList[kubeExternalIPSet].validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, proxier.ipsetList[kubeExternalIPSet].Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", proxier.ipsetList[kubeExternalIPSet].Name) continue } proxier.ipsetList[kubeExternalIPSet].activeEntries.Insert(entry.String()) @@ -1326,10 +1322,10 @@ func (proxier *Proxier) syncProxyRules() { onlyNodeLocalEndpoints := svcInfo.NodeLocalExternal() onlyNodeLocalEndpointsForInternal := svcInfo.NodeLocalInternal() if err := proxier.syncEndpoint(svcName, onlyNodeLocalEndpoints, onlyNodeLocalEndpointsForInternal, serv); err != nil { - klog.Errorf("Failed to sync endpoint for service: %v, err: %v", serv, err) + klog.ErrorS(err, "Failed to sync endpoint for service", "service", serv.String()) } } else { - klog.Errorf("Failed to sync service: %v, err: %v", serv, err) + klog.ErrorS(err, "Failed to sync service", "service", serv.String()) } } @@ -1348,14 +1344,14 @@ func (proxier *Proxier) syncProxyRules() { // If we are proxying globally, we need to masquerade in case we cross nodes. // If we are proxying only locally, we can retain the source IP. if valid := proxier.ipsetList[kubeLoadBalancerSet].validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, proxier.ipsetList[kubeLoadBalancerSet].Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", proxier.ipsetList[kubeLoadBalancerSet].Name) continue } proxier.ipsetList[kubeLoadBalancerSet].activeEntries.Insert(entry.String()) // insert loadbalancer entry to lbIngressLocalSet if service externaltrafficpolicy=local if svcInfo.NodeLocalExternal() { if valid := proxier.ipsetList[kubeLoadBalancerLocalSet].validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, proxier.ipsetList[kubeLoadBalancerLocalSet].Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", proxier.ipsetList[kubeLoadBalancerLocalSet].Name) continue } proxier.ipsetList[kubeLoadBalancerLocalSet].activeEntries.Insert(entry.String()) @@ -1365,7 +1361,7 @@ func (proxier *Proxier) syncProxyRules() { // This currently works for loadbalancers that preserves source ips. // For loadbalancers which direct traffic to service NodePort, the firewall rules will not apply. if valid := proxier.ipsetList[kubeLoadbalancerFWSet].validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, proxier.ipsetList[kubeLoadbalancerFWSet].Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", proxier.ipsetList[kubeLoadbalancerFWSet].Name) continue } proxier.ipsetList[kubeLoadbalancerFWSet].activeEntries.Insert(entry.String()) @@ -1381,7 +1377,7 @@ func (proxier *Proxier) syncProxyRules() { } // enumerate all white list source cidr if valid := proxier.ipsetList[kubeLoadBalancerSourceCIDRSet].validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, proxier.ipsetList[kubeLoadBalancerSourceCIDRSet].Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", proxier.ipsetList[kubeLoadBalancerSourceCIDRSet].Name) continue } proxier.ipsetList[kubeLoadBalancerSourceCIDRSet].activeEntries.Insert(entry.String()) @@ -1405,7 +1401,7 @@ func (proxier *Proxier) syncProxyRules() { } // enumerate all white list source ip if valid := proxier.ipsetList[kubeLoadBalancerSourceIPSet].validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, proxier.ipsetList[kubeLoadBalancerSourceIPSet].Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", proxier.ipsetList[kubeLoadBalancerSourceIPSet].Name) continue } proxier.ipsetList[kubeLoadBalancerSourceIPSet].activeEntries.Insert(entry.String()) @@ -1427,10 +1423,10 @@ func (proxier *Proxier) syncProxyRules() { activeIPVSServices[serv.String()] = true activeBindAddrs[serv.Address.String()] = true if err := proxier.syncEndpoint(svcName, svcInfo.NodeLocalExternal(), svcInfo.NodeLocalInternal(), serv); err != nil { - klog.Errorf("Failed to sync endpoint for service: %v, err: %v", serv, err) + klog.ErrorS(err, "Failed to sync endpoint for service", "service", serv) } } else { - klog.Errorf("Failed to sync service: %v, err: %v", serv, err) + klog.ErrorS(err, "Failed to sync service", "service", serv) } } } @@ -1464,7 +1460,7 @@ func (proxier *Proxier) syncProxyRules() { // For ports on node IPs, open the actual port and hold it. for _, lp := range lps { if proxier.portsMap[lp] != nil { - klog.V(4).Infof("Port %s was open before and is still needed", lp.String()) + klog.V(4).InfoS("Port was open before and is still needed", "port", lp.String()) replacementPortsMap[lp] = proxier.portsMap[lp] // We do not start listening on SCTP ports, according to our agreement in the // SCTP support KEP @@ -1483,7 +1479,7 @@ func (proxier *Proxier) syncProxyRules() { klog.ErrorS(err, "can't open port, skipping it", "port", lp.String()) continue } - klog.V(2).Infof("Opened local port %s", lp.String()) + klog.V(2).InfoS("Opened local port", "port", lp.String()) if lp.Protocol == utilnet.UDP { conntrack.ClearEntriesForPort(proxier.exec, lp.Port, isIPv6, v1.ProtocolUDP) @@ -1531,13 +1527,13 @@ func (proxier *Proxier) syncProxyRules() { } default: // It should never hit - klog.Errorf("Unsupported protocol type: %s", protocol) + klog.ErrorS(nil, "Unsupported protocol type", "protocol", protocol) } if nodePortSet != nil { entryInvalidErr := false for _, entry := range entries { if valid := nodePortSet.validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, nodePortSet.Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", nodePortSet.Name) entryInvalidErr = true break } @@ -1560,13 +1556,13 @@ func (proxier *Proxier) syncProxyRules() { nodePortLocalSet = proxier.ipsetList[kubeNodePortLocalSetSCTP] default: // It should never hit - klog.Errorf("Unsupported protocol type: %s", protocol) + klog.ErrorS(nil, "Unsupported protocol type", "protocol", protocol) } if nodePortLocalSet != nil { entryInvalidErr := false for _, entry := range entries { if valid := nodePortLocalSet.validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, nodePortLocalSet.Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", nodePortLocalSet.Name) entryInvalidErr = true break } @@ -1595,10 +1591,10 @@ func (proxier *Proxier) syncProxyRules() { if err := proxier.syncService(svcNameString, serv, false, bindedAddresses); err == nil { activeIPVSServices[serv.String()] = true if err := proxier.syncEndpoint(svcName, svcInfo.NodeLocalExternal(), svcInfo.NodeLocalInternal(), serv); err != nil { - klog.Errorf("Failed to sync endpoint for service: %v, err: %v", serv, err) + klog.ErrorS(err, "Failed to sync endpoint for service", "service", serv) } } else { - klog.Errorf("Failed to sync service: %v, err: %v", serv, err) + klog.ErrorS(err, "Failed to sync service", "service", serv) } } } @@ -1613,7 +1609,7 @@ func (proxier *Proxier) syncProxyRules() { } if valid := nodePortSet.validateEntry(entry); !valid { - klog.Errorf("%s", fmt.Sprintf(EntryInvalidErr, entry, nodePortSet.Name)) + klog.ErrorS(nil, "error adding entry to ipset", "entry", entry.String(), "ipset", nodePortSet.Name) continue } nodePortSet.activeEntries.Insert(entry.String()) @@ -1637,10 +1633,10 @@ func (proxier *Proxier) syncProxyRules() { proxier.iptablesData.Write(proxier.filterChains.Bytes()) proxier.iptablesData.Write(proxier.filterRules.Bytes()) - klog.V(5).Infof("Restoring iptables rules: %s", proxier.iptablesData.Bytes()) + klog.V(5).InfoS("Restoring iptables", "rules", string(proxier.iptablesData.Bytes())) err = proxier.iptables.RestoreAll(proxier.iptablesData.Bytes(), utiliptables.NoFlushTables, utiliptables.RestoreCounters) if err != nil { - klog.Errorf("Failed to execute iptables-restore: %v\nRules:\n%s", err, proxier.iptablesData.Bytes()) + klog.ErrorS(err, "Failed to execute iptables-restore", "rules", string(proxier.iptablesData.Bytes())) metrics.IptablesRestoreFailuresTotal.Inc() // Revert new local ports. utilproxy.RevertPorts(replacementPortsMap, proxier.portsMap) @@ -1650,7 +1646,7 @@ func (proxier *Proxier) syncProxyRules() { for _, lastChangeTriggerTime := range lastChangeTriggerTimes { latency := metrics.SinceInSeconds(lastChangeTriggerTime) metrics.NetworkProgrammingLatency.Observe(latency) - klog.V(4).Infof("Network programming of %s took %f seconds", name, latency) + klog.V(4).InfoS("Network programming", "endpoint", klog.KRef(name.Namespace, name.Name), "elapsed", latency) } } @@ -1666,7 +1662,7 @@ func (proxier *Proxier) syncProxyRules() { // currentBindAddrs represents ip addresses bind to DefaultDummyDevice from the system currentBindAddrs, err := proxier.netlinkHandle.ListBindAddress(DefaultDummyDevice) if err != nil { - klog.Errorf("Failed to get bind address, err: %v", err) + klog.ErrorS(err, "Failed to get bind address") } legacyBindAddrs := proxier.getLegacyBindAddr(activeBindAddrs, currentBindAddrs) @@ -1677,7 +1673,7 @@ func (proxier *Proxier) syncProxyRules() { currentIPVSServices[appliedSvc.String()] = appliedSvc } } else { - klog.Errorf("Failed to get ipvs service, err: %v", err) + klog.ErrorS(err, "Failed to get ipvs service") } proxier.cleanLegacyService(activeIPVSServices, currentIPVSServices, legacyBindAddrs) @@ -1690,17 +1686,17 @@ func (proxier *Proxier) syncProxyRules() { // not "OnlyLocal", but the services list will not, and the serviceHealthServer // will just drop those endpoints. if err := proxier.serviceHealthServer.SyncServices(serviceUpdateResult.HCServiceNodePorts); err != nil { - klog.Errorf("Error syncing healthcheck services: %v", err) + klog.ErrorS(err, "Error syncing healthcheck services") } if err := proxier.serviceHealthServer.SyncEndpoints(endpointUpdateResult.HCEndpointsLocalIPSize); err != nil { - klog.Errorf("Error syncing healthcheck endpoints: %v", err) + klog.ErrorS(err, "Error syncing healthcheck endpoints") } // Finish housekeeping. // TODO: these could be made more consistent. for _, svcIP := range staleServices.UnsortedList() { if err := conntrack.ClearEntriesForIP(proxier.exec, svcIP, v1.ProtocolUDP); err != nil { - klog.Errorf("Failed to delete stale service IP %s connections, error: %v", svcIP, err) + klog.ErrorS(err, "Failed to delete stale service IP connections", "ip", svcIP) } } proxier.deleteEndpointConnections(endpointUpdateResult.StaleEndpoints) @@ -1928,7 +1924,7 @@ func (proxier *Proxier) createAndLinkKubeChain() { // ensure KUBE-MARK-DROP chain exist but do not change any rules for _, ch := range iptablesEnsureChains { if _, err := proxier.iptables.EnsureChain(ch.table, ch.chain); err != nil { - klog.Errorf("Failed to ensure that %s chain %s exists: %v", ch.table, ch.chain, err) + klog.ErrorS(err, "Failed to ensure chain exists", "table", ch.table, "chain", ch.chain) return } } @@ -1936,7 +1932,7 @@ func (proxier *Proxier) createAndLinkKubeChain() { // Make sure we keep stats for the top-level chains for _, ch := range iptablesChains { if _, err := proxier.iptables.EnsureChain(ch.table, ch.chain); err != nil { - klog.Errorf("Failed to ensure that %s chain %s exists: %v", ch.table, ch.chain, err) + klog.ErrorS(err, "Failed to ensure chain exists", "table", ch.table, "chain", ch.chain) return } if ch.table == utiliptables.TableNAT { @@ -1957,7 +1953,7 @@ func (proxier *Proxier) createAndLinkKubeChain() { for _, jc := range iptablesJumpChain { args := []string{"-m", "comment", "--comment", jc.comment, "-j", string(jc.to)} if _, err := proxier.iptables.EnsureRule(utiliptables.Prepend, jc.table, jc.from, args...); err != nil { - klog.Errorf("Failed to ensure that %s chain %s jumps to %s: %v", jc.table, jc.from, jc.to, err) + klog.ErrorS(err, "Failed to ensure chain jumps", "table", jc.table, "srcChain", jc.from, "dstChain", jc.to) } } @@ -1970,7 +1966,7 @@ func (proxier *Proxier) getExistingChains(buffer *bytes.Buffer, table utiliptabl buffer.Reset() err := proxier.iptables.SaveInto(table, buffer) if err != nil { // if we failed to get any rules - klog.Errorf("Failed to execute iptables-save, syncing all rules: %v", err) + klog.ErrorS(err, "Failed to execute iptables-save, syncing all rules") } else { // otherwise parse the output return utiliptables.GetChainLines(table, buffer.Bytes()) } @@ -1987,18 +1983,18 @@ func (proxier *Proxier) deleteEndpointConnections(connectionMap []proxy.ServiceE svcProto := svcInfo.Protocol() err := conntrack.ClearEntriesForNAT(proxier.exec, svcInfo.ClusterIP().String(), endpointIP, svcProto) if err != nil { - klog.Errorf("Failed to delete %s endpoint connections, error: %v", epSvcPair.ServicePortName.String(), err) + klog.ErrorS(err, "Failed to delete endpoint connections", "servicePortName", epSvcPair.ServicePortName.String()) } for _, extIP := range svcInfo.ExternalIPStrings() { err := conntrack.ClearEntriesForNAT(proxier.exec, extIP, endpointIP, svcProto) if err != nil { - klog.Errorf("Failed to delete %s endpoint connections for externalIP %s, error: %v", epSvcPair.ServicePortName.String(), extIP, err) + klog.ErrorS(err, "Failed to delete endpoint connections for externalIP", "servicePortName", epSvcPair.ServicePortName.String(), "ip", extIP) } } for _, lbIP := range svcInfo.LoadBalancerIPStrings() { err := conntrack.ClearEntriesForNAT(proxier.exec, lbIP, endpointIP, svcProto) if err != nil { - klog.Errorf("Failed to delete %s endpoint connections for LoadBalancerIP %s, error: %v", epSvcPair.ServicePortName.String(), lbIP, err) + klog.ErrorS(err, "Failed to delete endpoint connections for LoadBalancerIP", "servicePortName", epSvcPair.ServicePortName.String(), "ip", lbIP) } } } @@ -2010,17 +2006,17 @@ func (proxier *Proxier) syncService(svcName string, vs *utilipvs.VirtualServer, if appliedVirtualServer == nil || !appliedVirtualServer.Equal(vs) { if appliedVirtualServer == nil { // IPVS service is not found, create a new service - klog.V(3).Infof("Adding new service %q %s:%d/%s", svcName, vs.Address, vs.Port, vs.Protocol) + klog.V(3).InfoS("Adding new service", "svcName", svcName, "address", fmt.Sprintf("%s:%d/%s", vs.Address, vs.Port, vs.Protocol)) if err := proxier.ipvs.AddVirtualServer(vs); err != nil { - klog.Errorf("Failed to add IPVS service %q: %v", svcName, err) + klog.ErrorS(err, "Failed to add IPVS service", "svcName", svcName) return err } } else { // IPVS service was changed, update the existing one // During updates, service VIP will not go down - klog.V(3).Infof("IPVS service %s was changed", svcName) + klog.V(3).InfoS("IPVS service was changed", "svcName", svcName) if err := proxier.ipvs.UpdateVirtualServer(vs); err != nil { - klog.Errorf("Failed to update IPVS service, err:%v", err) + klog.ErrorS(err, "Failed to update IPVS service") return err } } @@ -2034,10 +2030,10 @@ func (proxier *Proxier) syncService(svcName string, vs *utilipvs.VirtualServer, return nil } - klog.V(4).Infof("Bind addr %s", vs.Address.String()) + klog.V(4).InfoS("Bind addr", "address", vs.Address.String()) _, err := proxier.netlinkHandle.EnsureAddressBind(vs.Address.String(), DefaultDummyDevice) if err != nil { - klog.Errorf("Failed to bind service address to dummy device %q: %v", svcName, err) + klog.ErrorS(err, "Failed to bind service address to dummy device", "svcName", svcName) return err } } @@ -2062,7 +2058,7 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode curDests, err := proxier.ipvs.GetRealServers(appliedVirtualServer) if err != nil { - klog.Errorf("Failed to list IPVS destinations, error: %v", err) + klog.ErrorS(err, "Failed to list IPVS destinations") return err } for _, des := range curDests { @@ -2077,7 +2073,7 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode // externalTrafficPolicy=Local. svcInfo, ok := proxier.serviceMap[svcPortName] if !ok { - klog.Warningf("Unable to filter endpoints due to missing Service info for %s", svcPortName) + klog.InfoS("Unable to filter endpoints due to missing Service info", "svcPortName", svcPortName) } else { endpoints = proxy.FilterEndpoints(endpoints, svcInfo, proxier.nodeLabels) } @@ -2098,12 +2094,12 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode for _, ep := range newEndpoints.List() { ip, port, err := net.SplitHostPort(ep) if err != nil { - klog.Errorf("Failed to parse endpoint: %v, error: %v", ep, err) + klog.ErrorS(err, "Failed to parse endpoint", "endpoint", ep) continue } portNum, err := strconv.Atoi(port) if err != nil { - klog.Errorf("Failed to parse endpoint port %s, error: %v", port, err) + klog.ErrorS(err, "Failed to parse endpoint port", "port", port) continue } @@ -2119,16 +2115,16 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode if !proxier.gracefuldeleteManager.InTerminationList(uniqueRS) { continue } - klog.V(5).Infof("new ep %q is in graceful delete list", uniqueRS) + klog.V(5).InfoS("new ep is in graceful delete list", "uniqueRS", uniqueRS) err := proxier.gracefuldeleteManager.MoveRSOutofGracefulDeleteList(uniqueRS) if err != nil { - klog.Errorf("Failed to delete endpoint: %v in gracefulDeleteQueue, error: %v", ep, err) + klog.ErrorS(err, "Failed to delete endpoint in gracefulDeleteQueue", "endpoint", ep) continue } } err = proxier.ipvs.AddRealServer(appliedVirtualServer, newDest) if err != nil { - klog.Errorf("Failed to add destination: %v, error: %v", newDest, err) + klog.ErrorS(err, "Failed to add destination", "newDest", newDest) continue } } @@ -2141,12 +2137,12 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode } ip, port, err := net.SplitHostPort(ep) if err != nil { - klog.Errorf("Failed to parse endpoint: %v, error: %v", ep, err) + klog.ErrorS(err, "Failed to parse endpoint", "endpoint", ep) continue } portNum, err := strconv.Atoi(port) if err != nil { - klog.Errorf("Failed to parse endpoint port %s, error: %v", port, err) + klog.ErrorS(err, "Failed to parse endpoint port", "port", port) continue } @@ -2155,10 +2151,10 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode Port: uint16(portNum), } - klog.V(5).Infof("Using graceful delete to delete: %v", uniqueRS) + klog.V(5).InfoS("Using graceful delete", "uniqueRS", uniqueRS) err = proxier.gracefuldeleteManager.GracefulDeleteRS(appliedVirtualServer, delDest) if err != nil { - klog.Errorf("Failed to delete destination: %v, error: %v", uniqueRS, err) + klog.ErrorS(err, "Failed to delete destination", "uniqueRS", uniqueRS) continue } } @@ -2177,15 +2173,15 @@ func (proxier *Proxier) cleanLegacyService(activeServices map[string]bool, curre continue } if _, ok := activeServices[cs]; !ok { - klog.V(4).Infof("Delete service %s", svc.String()) + klog.V(4).InfoS("Delete service", "service", svc.String()) if err := proxier.ipvs.DeleteVirtualServer(svc); err != nil { - klog.Errorf("Failed to delete service %s, error: %v", svc.String(), err) + klog.ErrorS(err, "Failed to delete service", "service", svc.String()) } addr := svc.Address.String() if _, ok := legacyBindAddrs[addr]; ok { - klog.V(4).Infof("Unbinding address %s", addr) + klog.V(4).InfoS("Unbinding address", "address", addr) if err := proxier.netlinkHandle.UnbindAddress(addr, DefaultDummyDevice); err != nil { - klog.Errorf("Failed to unbind service addr %s from dummy interface %s: %v", addr, DefaultDummyDevice, err) + klog.ErrorS(err, "Failed to unbind service from dummy interface", "interface", DefaultDummyDevice, "address", addr) } else { // In case we delete a multi-port service, avoid trying to unbind multiple times delete(legacyBindAddrs, addr) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/service.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/service.go index d56e0aed81a0..abd92528df55 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/service.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/service.go @@ -54,7 +54,6 @@ type BaseServiceInfo struct { nodeLocalExternal bool nodeLocalInternal bool internalTrafficPolicy *v1.ServiceInternalTrafficPolicyType - topologyKeys []string hintsAnnotation string } @@ -134,11 +133,6 @@ func (info *BaseServiceInfo) InternalTrafficPolicy() *v1.ServiceInternalTrafficP return info.internalTrafficPolicy } -// TopologyKeys is part of ServicePort interface. -func (info *BaseServiceInfo) TopologyKeys() []string { - return info.topologyKeys -} - // HintsAnnotation is part of ServicePort interface. func (info *BaseServiceInfo) HintsAnnotation() string { return info.hintsAnnotation @@ -170,7 +164,6 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *v1.ServicePort, servic nodeLocalExternal: nodeLocalExternal, nodeLocalInternal: nodeLocalInternal, internalTrafficPolicy: service.Spec.InternalTrafficPolicy, - topologyKeys: service.Spec.TopologyKeys, hintsAnnotation: service.Annotations[v1.AnnotationTopologyAwareHints], } @@ -201,7 +194,9 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *v1.ServicePort, servic // Obtain Load Balancer Ingress IPs var ips []string for _, ing := range service.Status.LoadBalancer.Ingress { - ips = append(ips, ing.IP) + if ing.IP != "" { + ips = append(ips, ing.IP) + } } if len(ips) > 0 { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/topology.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/topology.go index 377cc65184cf..0e0e85461a29 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/topology.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/topology.go @@ -31,10 +31,6 @@ func FilterEndpoints(endpoints []Endpoint, svcInfo ServicePort, nodeLabels map[s return endpoints } - if utilfeature.DefaultFeatureGate.Enabled(features.ServiceTopology) { - return deprecatedTopologyFilter(nodeLabels, svcInfo.TopologyKeys(), endpoints) - } - if utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) && svcInfo.NodeLocalInternal() { return filterEndpointsInternalTrafficPolicy(svcInfo.InternalTrafficPolicy(), endpoints) } @@ -81,72 +77,11 @@ func filterEndpointsWithHints(endpoints []Endpoint, hintsAnnotation string, node } } - if len(filteredEndpoints) > 0 { + if len(filteredEndpoints) == 0 { klog.Warningf("Skipping topology aware endpoint filtering since no hints were provided for zone %s", zone) - return filteredEndpoints - } - - return endpoints -} - -// deprecatedTopologyFilter returns the appropriate endpoints based on the -// cluster topology. This will be removed in an upcoming release along with the -// ServiceTopology feature gate. -// -// This uses the current node's labels, which contain topology information, and -// the required topologyKeys to find appropriate endpoints. If both the endpoint's -// topology and the current node have matching values for topologyKeys[0], the -// endpoint will be chosen. If no endpoints are chosen, toplogyKeys[1] will be -// considered, and so on. If either the node or the endpoint do not have values -// for a key, it is considered to not match. -// -// If topologyKeys is specified, but no endpoints are chosen for any key, the -// service has no viable endpoints for clients on this node, and connections -// should fail. -// -// The special key "*" may be used as the last entry in topologyKeys to indicate -// "any endpoint" is acceptable. -// -// If topologyKeys is not specified or empty, no topology constraints will be -// applied and this will return all endpoints. -func deprecatedTopologyFilter(nodeLabels map[string]string, topologyKeys []string, endpoints []Endpoint) []Endpoint { - // Do not filter endpoints if service has no topology keys. - if len(topologyKeys) == 0 { return endpoints } - filteredEndpoints := []Endpoint{} - - if len(nodeLabels) == 0 { - if topologyKeys[len(topologyKeys)-1] == v1.TopologyKeyAny { - // edge case: include all endpoints if topology key "Any" specified - // when we cannot determine current node's topology. - return endpoints - } - // edge case: do not include any endpoints if topology key "Any" is - // not specified when we cannot determine current node's topology. - return filteredEndpoints - } - - for _, key := range topologyKeys { - if key == v1.TopologyKeyAny { - return endpoints - } - topologyValue, found := nodeLabels[key] - if !found { - continue - } - - for _, ep := range endpoints { - topology := ep.GetTopology() - if value, found := topology[key]; found && value == topologyValue { - filteredEndpoints = append(filteredEndpoints, ep) - } - } - if len(filteredEndpoints) > 0 { - return filteredEndpoints - } - } return filteredEndpoints } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/types.go index a33d6ba145e6..19dad2b082cf 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/types.go @@ -90,8 +90,6 @@ type ServicePort interface { NodeLocalInternal() bool // InternalTrafficPolicy returns service InternalTrafficPolicy InternalTrafficPolicy() *v1.ServiceInternalTrafficPolicyType - // TopologyKeys returns service TopologyKeys as a string array. - TopologyKeys() []string // HintsAnnotation returns the value of the v1.AnnotationTopologyAwareHints annotation. HintsAnnotation() string } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/userspace/proxier.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/userspace/proxier.go index a2945f6fd089..b9c14d28a4ec 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/userspace/proxier.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/userspace/proxier.go @@ -108,7 +108,7 @@ func (info *ServiceInfo) IsAlive() bool { func logTimeout(err error) bool { if e, ok := err.(net.Error); ok { if e.Timeout() { - klog.V(3).InfoS("connection to endpoint closed due to inactivity") + klog.V(3).InfoS("Connection to endpoint closed due to inactivity") return true } } @@ -270,7 +270,7 @@ func createProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables exec: exec, stopChan: make(chan struct{}), } - klog.V(3).InfoS("record sync param", "minSyncPeriod", minSyncPeriod, "syncPeriod", syncPeriod, "burstSyncs", numBurstSyncs) + klog.V(3).InfoS("Record sync param", "minSyncPeriod", minSyncPeriod, "syncPeriod", syncPeriod, "burstSyncs", numBurstSyncs) proxier.syncRunner = async.NewBoundedFrequencyRunner("userspace-proxy-sync-runner", proxier.syncProxyRules, minSyncPeriod, syncPeriod, numBurstSyncs) return proxier, nil } @@ -368,7 +368,7 @@ func (proxier *Proxier) Sync() { func (proxier *Proxier) syncProxyRules() { start := time.Now() defer func() { - klog.V(4).InfoS("userspace syncProxyRules complete", "elapsed", time.Since(start)) + klog.V(4).InfoS("Userspace syncProxyRules complete", "elapsed", time.Since(start)) }() // don't sync rules till we've received services and endpoints @@ -412,7 +412,7 @@ func (proxier *Proxier) ensurePortals() { for name, info := range proxier.serviceMap { err := proxier.openPortal(name, info) if err != nil { - klog.ErrorS(err, "Failed to ensure portal", "servicePortName", name.String()) + klog.ErrorS(err, "Failed to ensure portal", "servicePortName", name) } } } @@ -469,7 +469,7 @@ func (proxier *Proxier) addServiceOnPortInternal(service proxy.ServicePortName, } proxier.serviceMap[service] = si - klog.V(2).InfoS("Proxying for service", "service", service.String(), "protocol", protocol, "port", portStr) + klog.V(2).InfoS("Proxying for service", "service", service, "protocol", protocol, "portNum", portNum) go func() { defer runtime.HandleCrash() sock.ProxyLoop(service, si, proxier.loadBalancer) @@ -508,7 +508,7 @@ func (proxier *Proxier) mergeService(service *v1.Service) sets.String { continue } if exists { - klog.V(4).InfoS("Something changed for service: stopping it", "serviceName", serviceName.String()) + klog.V(4).InfoS("Something changed for service: stopping it", "serviceName", serviceName) if err := proxier.cleanupPortalAndProxy(serviceName, info); err != nil { klog.ErrorS(err, "Failed to cleanup portal and proxy") } @@ -516,7 +516,7 @@ func (proxier *Proxier) mergeService(service *v1.Service) sets.String { } proxyPort, err := proxier.proxyPorts.AllocateNext() if err != nil { - klog.ErrorS(err, "Failed to allocate proxy port", "serviceName", serviceName.String()) + klog.ErrorS(err, "Failed to allocate proxy port", "serviceName", serviceName) continue } @@ -539,10 +539,10 @@ func (proxier *Proxier) mergeService(service *v1.Service) sets.String { info.stickyMaxAgeSeconds = int(*service.Spec.SessionAffinityConfig.ClientIP.TimeoutSeconds) } - klog.V(4).InfoS("record serviceInfo", "serviceInfo", info) + klog.V(4).InfoS("Record serviceInfo", "serviceInfo", info) if err := proxier.openPortal(serviceName, info); err != nil { - klog.ErrorS(err, "Failed to open portal", "serviceName", serviceName.String()) + klog.ErrorS(err, "Failed to open portal", "serviceName", serviceName) } proxier.loadBalancer.NewService(serviceName, info.sessionAffinityType, info.stickyMaxAgeSeconds) @@ -569,7 +569,7 @@ func (proxier *Proxier) unmergeService(service *v1.Service, existingPorts sets.S } serviceName := proxy.ServicePortName{NamespacedName: svcName, Port: servicePort.Name} - klog.V(1).InfoS("Stopping service", "serviceName", serviceName.String()) + klog.V(1).InfoS("Stopping service", "serviceName", serviceName) info, exists := proxier.serviceMap[serviceName] if !exists { klog.ErrorS(nil, "Service is being removed but doesn't exist", "serviceName", serviceName) @@ -581,7 +581,7 @@ func (proxier *Proxier) unmergeService(service *v1.Service, existingPorts sets.S } if err := proxier.cleanupPortalAndProxy(serviceName, info); err != nil { - klog.ErrorS(err, "clean up portal and proxy") + klog.ErrorS(err, "Clean up portal and proxy") } proxier.loadBalancer.DeleteService(serviceName) info.setFinished() @@ -600,7 +600,7 @@ func (proxier *Proxier) serviceChange(previous, current *v1.Service, detail stri } else { svcName = types.NamespacedName{Namespace: previous.Namespace, Name: previous.Name} } - klog.V(4).InfoS("record service change", "action", detail, "svcName", svcName.String()) + klog.V(4).InfoS("Record service change", "action", detail, "svcName", svcName) proxier.serviceChangesLock.Lock() defer proxier.serviceChangesLock.Unlock() @@ -648,7 +648,7 @@ func (proxier *Proxier) OnServiceDelete(service *v1.Service) { // OnServiceSynced is called once all the initial event handlers were // called and the state is fully propagated to local cache. func (proxier *Proxier) OnServiceSynced() { - klog.V(2).InfoS("userspace OnServiceSynced") + klog.V(2).InfoS("Userspace OnServiceSynced") // Mark services as initialized and (if endpoints are already // initialized) the entire proxy as initialized @@ -684,7 +684,7 @@ func (proxier *Proxier) OnEndpointsDelete(endpoints *v1.Endpoints) { // OnEndpointsSynced is called once all the initial event handlers were // called and the state is fully propagated to local cache. func (proxier *Proxier) OnEndpointsSynced() { - klog.V(2).InfoS("userspace OnEndpointsSynced") + klog.V(2).InfoS("Userspace OnEndpointsSynced") proxier.loadBalancer.OnEndpointsSynced() // Mark endpoints as initialized and (if services are already @@ -772,7 +772,7 @@ func (proxier *Proxier) openOnePortal(portal portal, protocol v1.Protocol, proxy portalAddress := net.JoinHostPort(portal.ip.String(), strconv.Itoa(portal.port)) existed, err := proxier.iptables.EnsureRule(iptables.Append, iptables.TableNAT, iptablesContainerPortalChain, args...) if err != nil { - klog.ErrorS(err, "Failed to install iptables rule for service", "chain", iptablesContainerPortalChain, "servicePortName", name.String(), "args", args) + klog.ErrorS(err, "Failed to install iptables rule for service", "chain", iptablesContainerPortalChain, "servicePortName", name, "args", args) return err } if !existed { @@ -857,7 +857,7 @@ func (proxier *Proxier) releaseNodePort(ip net.IP, port int, protocol v1.Protoco existing, found := proxier.portMap[key] if !found { // We tolerate this, it happens if we are cleaning up a failed allocation - klog.InfoS("Ignoring release on unowned port", "port", key.String()) + klog.InfoS("Ignoring release on unowned port", "port", key) return nil } if existing.owner != owner { @@ -881,32 +881,32 @@ func (proxier *Proxier) openNodePort(nodePort int, protocol v1.Protocol, proxyIP args := proxier.iptablesContainerPortalArgs(nil, false, false, nodePort, protocol, proxyIP, proxyPort, name) existed, err := proxier.iptables.EnsureRule(iptables.Append, iptables.TableNAT, iptablesContainerNodePortChain, args...) if err != nil { - klog.ErrorS(err, "Failed to install iptables rule for service", "chain", iptablesContainerNodePortChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to install iptables rule for service", "chain", iptablesContainerNodePortChain, "servicePortName", name) return err } if !existed { - klog.InfoS("Opened iptables from-containers public port for service", "servicePortName", name.String(), "protocol", protocol, "nodePort", nodePort) + klog.InfoS("Opened iptables from-containers public port for service", "servicePortName", name, "protocol", protocol, "nodePort", nodePort) } // Handle traffic from the host. args = proxier.iptablesHostNodePortArgs(nodePort, protocol, proxyIP, proxyPort, name) existed, err = proxier.iptables.EnsureRule(iptables.Append, iptables.TableNAT, iptablesHostNodePortChain, args...) if err != nil { - klog.ErrorS(err, "Failed to install iptables rule for service", "chain", iptablesHostNodePortChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to install iptables rule for service", "chain", iptablesHostNodePortChain, "servicePortName", name) return err } if !existed { - klog.InfoS("Opened iptables from-host public port for service", "servicePortName", name.String(), "protocol", protocol, "nodePort", nodePort) + klog.InfoS("Opened iptables from-host public port for service", "servicePortName", name, "protocol", protocol, "nodePort", nodePort) } args = proxier.iptablesNonLocalNodePortArgs(nodePort, protocol, proxyIP, proxyPort, name) existed, err = proxier.iptables.EnsureRule(iptables.Append, iptables.TableFilter, iptablesNonLocalNodePortChain, args...) if err != nil { - klog.ErrorS(err, "Failed to install iptables rule for service", "chain", iptablesNonLocalNodePortChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to install iptables rule for service", "chain", iptablesNonLocalNodePortChain, "servicePortName", name) return err } if !existed { - klog.InfoS("Opened iptables from-non-local public port for service", "servicePortName", name.String(), "protocol", protocol, "nodePort", nodePort) + klog.InfoS("Opened iptables from-non-local public port for service", "servicePortName", name, "protocol", protocol, "nodePort", nodePort) } return nil @@ -927,9 +927,9 @@ func (proxier *Proxier) closePortal(service proxy.ServicePortName, info *Service el = append(el, proxier.closeNodePort(info.nodePort, info.protocol, proxier.listenIP, info.proxyPort, service)...) } if len(el) == 0 { - klog.V(3).InfoS("Closed iptables portals for service", "servicePortName", service.String()) + klog.V(3).InfoS("Closed iptables portals for service", "servicePortName", service) } else { - klog.ErrorS(nil, "Some errors closing iptables portals for service", "servicePortName", service.String()) + klog.ErrorS(nil, "Some errors closing iptables portals for service", "servicePortName", service) } return utilerrors.NewAggregate(el) } @@ -945,20 +945,20 @@ func (proxier *Proxier) closeOnePortal(portal portal, protocol v1.Protocol, prox // Handle traffic from containers. args := proxier.iptablesContainerPortalArgs(portal.ip, portal.isExternal, false, portal.port, protocol, proxyIP, proxyPort, name) if err := proxier.iptables.DeleteRule(iptables.TableNAT, iptablesContainerPortalChain, args...); err != nil { - klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesContainerPortalChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesContainerPortalChain, "servicePortName", name) el = append(el, err) } if portal.isExternal { args := proxier.iptablesContainerPortalArgs(portal.ip, false, true, portal.port, protocol, proxyIP, proxyPort, name) if err := proxier.iptables.DeleteRule(iptables.TableNAT, iptablesContainerPortalChain, args...); err != nil { - klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesContainerPortalChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesContainerPortalChain, "servicePortName", name) el = append(el, err) } args = proxier.iptablesHostPortalArgs(portal.ip, true, portal.port, protocol, proxyIP, proxyPort, name) if err := proxier.iptables.DeleteRule(iptables.TableNAT, iptablesHostPortalChain, args...); err != nil { - klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesHostPortalChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesHostPortalChain, "servicePortName", name) el = append(el, err) } return el @@ -967,7 +967,7 @@ func (proxier *Proxier) closeOnePortal(portal portal, protocol v1.Protocol, prox // Handle traffic from the host (portalIP is not external). args = proxier.iptablesHostPortalArgs(portal.ip, false, portal.port, protocol, proxyIP, proxyPort, name) if err := proxier.iptables.DeleteRule(iptables.TableNAT, iptablesHostPortalChain, args...); err != nil { - klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesHostPortalChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesHostPortalChain, "servicePortName", name) el = append(el, err) } @@ -980,21 +980,21 @@ func (proxier *Proxier) closeNodePort(nodePort int, protocol v1.Protocol, proxyI // Handle traffic from containers. args := proxier.iptablesContainerPortalArgs(nil, false, false, nodePort, protocol, proxyIP, proxyPort, name) if err := proxier.iptables.DeleteRule(iptables.TableNAT, iptablesContainerNodePortChain, args...); err != nil { - klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesContainerNodePortChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesContainerNodePortChain, "servicePortName", name) el = append(el, err) } // Handle traffic from the host. args = proxier.iptablesHostNodePortArgs(nodePort, protocol, proxyIP, proxyPort, name) if err := proxier.iptables.DeleteRule(iptables.TableNAT, iptablesHostNodePortChain, args...); err != nil { - klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesHostNodePortChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesHostNodePortChain, "servicePortName", name) el = append(el, err) } // Handle traffic not local to the host args = proxier.iptablesNonLocalNodePortArgs(nodePort, protocol, proxyIP, proxyPort, name) if err := proxier.iptables.DeleteRule(iptables.TableFilter, iptablesNonLocalNodePortChain, args...); err != nil { - klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesNonLocalNodePortChain, "servicePortName", name.String()) + klog.ErrorS(err, "Failed to delete iptables rule for service", "chain", iptablesNonLocalNodePortChain, "servicePortName", name) el = append(el, err) } @@ -1103,7 +1103,7 @@ func iptablesFlush(ipt iptables.Interface) error { el = append(el, err) } if len(el) != 0 { - klog.ErrorS(nil, "Some errors flushing old iptables portals", "errors", el) + klog.ErrorS(utilerrors.NewAggregate(el), "Some errors flushing old iptables portals") } return utilerrors.NewAggregate(el) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/winkernel/proxier.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/winkernel/proxier.go index 382d8023d736..9d28d57d55eb 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/winkernel/proxier.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/proxy/winkernel/proxier.go @@ -354,7 +354,7 @@ func newSourceVIP(hns HostNetworkService, network string, ip string, mac string, func (ep *endpointsInfo) Cleanup() { Log(ep, "Endpoint Cleanup", 3) - if ep.refCount != nil { + if !ep.GetIsLocal() && ep.refCount != nil { *ep.refCount-- // Remove the remote hns endpoint, if no service is referring it @@ -1157,10 +1157,10 @@ func (proxier *Proxier) syncProxyRules() { } else { // We only share the refCounts for remote endpoints ep.refCount = proxier.endPointsRefCount.getRefCount(newHnsEndpoint.hnsID) + *ep.refCount++ } ep.hnsID = newHnsEndpoint.hnsID - *ep.refCount++ Log(ep, "Endpoint resource found", 3) } @@ -1250,7 +1250,7 @@ func (proxier *Proxier) syncProxyRules() { uint16(svcInfo.Port()), ) if err != nil { - klog.ErrorS(err, "Policy creation failed", err) + klog.ErrorS(err, "Policy creation failed") continue } externalIP.hnsID = hnsLoadBalancer.hnsID diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/algorithmprovider/registry.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/algorithmprovider/registry.go index c1adea5a44e3..d8d25380988c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/algorithmprovider/registry.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/algorithmprovider/registry.go @@ -17,8 +17,6 @@ limitations under the License. package algorithmprovider import ( - "fmt" - utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/features" @@ -43,32 +41,7 @@ import ( "k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone" ) -// ClusterAutoscalerProvider defines the default autoscaler provider -const ClusterAutoscalerProvider = "ClusterAutoscalerProvider" - -// Registry is a collection of all available algorithm providers. -type Registry map[string]*schedulerapi.Plugins - -// NewRegistry returns an algorithm provider registry instance. -func NewRegistry() Registry { - defaultConfig := getDefaultConfig() - applyFeatureGates(defaultConfig) - - caConfig := getClusterAutoscalerConfig() - applyFeatureGates(caConfig) - - return Registry{ - schedulerapi.SchedulerDefaultProviderName: defaultConfig, - ClusterAutoscalerProvider: caConfig, - } -} - -// ListAlgorithmProviders lists registered algorithm providers. -func ListAlgorithmProviders() string { - return fmt.Sprintf("%s | %s", ClusterAutoscalerProvider, schedulerapi.SchedulerDefaultProviderName) -} - -func getDefaultConfig() *schedulerapi.Plugins { +func GetDefaultConfig() *schedulerapi.Plugins { plugins := &schedulerapi.Plugins{ QueueSort: schedulerapi.PluginSet{ Enabled: []schedulerapi.Plugin{ @@ -148,24 +121,17 @@ func getDefaultConfig() *schedulerapi.Plugins { }, }, } - if utilfeature.DefaultFeatureGate.Enabled(features.VolumeCapacityPriority) { - plugins.Score.Enabled = append(plugins.Score.Enabled, schedulerapi.Plugin{Name: volumebinding.Name, Weight: 1}) - } + + applyFeatureGates(plugins) + return plugins } -func getClusterAutoscalerConfig() *schedulerapi.Plugins { - caConfig := getDefaultConfig() - // Replace least with most requested. - for i := range caConfig.Score.Enabled { - if caConfig.Score.Enabled[i].Name == noderesources.LeastAllocatedName { - caConfig.Score.Enabled[i].Name = noderesources.MostAllocatedName - } +func applyFeatureGates(config *schedulerapi.Plugins) { + if utilfeature.DefaultFeatureGate.Enabled(features.VolumeCapacityPriority) { + config.Score.Enabled = append(config.Score.Enabled, schedulerapi.Plugin{Name: volumebinding.Name, Weight: 1}) } - return caConfig -} -func applyFeatureGates(config *schedulerapi.Plugins) { if !utilfeature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) { // When feature is enabled, the default spreading is done by // PodTopologySpread plugin, which is enabled by default. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/OWNERS index 17b616c71cc6..26561c6513fe 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/OWNERS +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/OWNERS @@ -1,13 +1,14 @@ # See the OWNERS docs at https://go.k8s.io/owners +# Disable inheritance as this is an api owners file +options: + no_parent_owners: true approvers: - api-approvers -- sig-scheduling-maintainers -- sttts -- luxas reviewers: -- sig-scheduling - api-reviewers -- dixudx -- luxas -- sttts +- sig-scheduling-api-reviewers +- sig-scheduling-api-approvers +labels: +- kind/api-change +- sig/scheduling diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/conversion.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/conversion.go index 06a6c7073f79..17e0082a9ca9 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/conversion.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/conversion.go @@ -18,7 +18,7 @@ package v1 import ( "k8s.io/apimachinery/pkg/conversion" - v1 "k8s.io/kube-scheduler/config/v1" + "k8s.io/kube-scheduler/config/v1" "k8s.io/kubernetes/pkg/scheduler/apis/config" ) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/cycle_state.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/cycle_state.go index fd7f5543d8cc..652a257d9a1f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/cycle_state.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/cycle_state.go @@ -86,9 +86,10 @@ func (c *CycleState) Clone() *CycleState { // Read retrieves data with the given "key" from CycleState. If the key is not // present an error is returned. -// This function is not thread safe. In multi-threaded code, lock should be -// acquired first. +// This function is thread safe by acquiring an internal lock first. func (c *CycleState) Read(key StateKey) (StateData, error) { + c.mx.RLock() + defer c.mx.RUnlock() if v, ok := c.storage[key]; ok { return v, nil } @@ -96,35 +97,17 @@ func (c *CycleState) Read(key StateKey) (StateData, error) { } // Write stores the given "val" in CycleState with the given "key". -// This function is not thread safe. In multi-threaded code, lock should be -// acquired first. +// This function is thread safe by acquiring an internal lock first. func (c *CycleState) Write(key StateKey, val StateData) { + c.mx.Lock() c.storage[key] = val + c.mx.Unlock() } // Delete deletes data with the given key from CycleState. -// This function is not thread safe. In multi-threaded code, lock should be -// acquired first. +// This function is thread safe by acquiring an internal lock first. func (c *CycleState) Delete(key StateKey) { - delete(c.storage, key) -} - -// Lock acquires CycleState lock. -func (c *CycleState) Lock() { c.mx.Lock() -} - -// Unlock releases CycleState lock. -func (c *CycleState) Unlock() { + delete(c.storage, key) c.mx.Unlock() } - -// RLock acquires CycleState read lock. -func (c *CycleState) RLock() { - c.mx.RLock() -} - -// RUnlock releases CycleState read lock. -func (c *CycleState) RUnlock() { - c.mx.RUnlock() -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go index dedc053fab58..467ba394db0c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go @@ -471,41 +471,12 @@ type Framework interface { // cycle is aborted. RunPreFilterPlugins(ctx context.Context, state *CycleState, pod *v1.Pod) *Status - // RunFilterPlugins runs the set of configured Filter plugins for pod on - // the given node. Note that for the node being evaluated, the passed nodeInfo - // reference could be different from the one in NodeInfoSnapshot map (e.g., pods - // considered to be running on the node could be different). For example, during - // preemption, we may pass a copy of the original nodeInfo object that has some pods - // removed from it to evaluate the possibility of preempting them to - // schedule the target pod. - RunFilterPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeInfo *NodeInfo) PluginToStatus - // RunPostFilterPlugins runs the set of configured PostFilter plugins. // PostFilter plugins can either be informational, in which case should be configured // to execute first and return Unschedulable status, or ones that try to change the // cluster state to make the pod potentially schedulable in a future scheduling cycle. RunPostFilterPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, filteredNodeStatusMap NodeToStatusMap) (*PostFilterResult, *Status) - // RunPreFilterExtensionAddPod calls the AddPod interface for the set of configured - // PreFilter plugins. It returns directly if any of the plugins return any - // status other than Success. - RunPreFilterExtensionAddPod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podInfoToAdd *PodInfo, nodeInfo *NodeInfo) *Status - - // RunPreFilterExtensionRemovePod calls the RemovePod interface for the set of configured - // PreFilter plugins. It returns directly if any of the plugins return any - // status other than Success. - RunPreFilterExtensionRemovePod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podInfoToRemove *PodInfo, nodeInfo *NodeInfo) *Status - - // RunPreScorePlugins runs the set of configured PreScore plugins. If any - // of these plugins returns any status other than "Success", the given pod is rejected. - RunPreScorePlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodes []*v1.Node) *Status - - // RunScorePlugins runs the set of configured Score plugins. It returns a map that - // stores for each Score plugin name the corresponding NodeScoreList(s). - // It also returns *Status, which is set to non-success if any of the plugins returns - // a non-success status. - RunScorePlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodes []*v1.Node) (PluginToNodeScores, *Status) - // RunPreBindPlugins runs the set of configured PreBind plugins. It returns // *Status and its code is set to non-success if any of the plugins returns // anything but Success. If the Status code is "Unschedulable", it is @@ -629,14 +600,28 @@ type PodNominator interface { // This is used by preemption PostFilter plugins when evaluating the feasibility of // scheduling the pod on nodes when certain running pods get evicted. type PluginsRunner interface { - // RunPreScorePlugins runs the set of configured PreScore plugins for pod on the given nodes + // RunPreScorePlugins runs the set of configured PreScore plugins. If any + // of these plugins returns any status other than "Success", the given pod is rejected. RunPreScorePlugins(context.Context, *CycleState, *v1.Pod, []*v1.Node) *Status - // RunScorePlugins runs the set of configured Score plugins for pod on the given nodes + // RunScorePlugins runs the set of configured Score plugins. It returns a map that + // stores for each Score plugin name the corresponding NodeScoreList(s). + // It also returns *Status, which is set to non-success if any of the plugins returns + // a non-success status. RunScorePlugins(context.Context, *CycleState, *v1.Pod, []*v1.Node) (PluginToNodeScores, *Status) - // RunFilterPlugins runs the set of configured filter plugins for pod on the given node. + // RunFilterPlugins runs the set of configured Filter plugins for pod on + // the given node. Note that for the node being evaluated, the passed nodeInfo + // reference could be different from the one in NodeInfoSnapshot map (e.g., pods + // considered to be running on the node could be different). For example, during + // preemption, we may pass a copy of the original nodeInfo object that has some pods + // removed from it to evaluate the possibility of preempting them to + // schedule the target pod. RunFilterPlugins(context.Context, *CycleState, *v1.Pod, *NodeInfo) PluginToStatus - // RunPreFilterExtensionAddPod calls the AddPod interface for the set of configured PreFilter plugins. + // RunPreFilterExtensionAddPod calls the AddPod interface for the set of configured + // PreFilter plugins. It returns directly if any of the plugins return any + // status other than Success. RunPreFilterExtensionAddPod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podInfoToAdd *PodInfo, nodeInfo *NodeInfo) *Status - // RunPreFilterExtensionRemovePod calls the RemovePod interface for the set of configured PreFilter plugins. + // RunPreFilterExtensionRemovePod calls the RemovePod interface for the set of configured + // PreFilter plugins. It returns directly if any of the plugins return any + // status other than Success. RunPreFilterExtensionRemovePod(ctx context.Context, state *CycleState, podToSchedule *v1.Pod, podInfoToRemove *PodInfo, nodeInfo *NodeInfo) *Status } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go index 7884f289179d..70102739e2b3 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go @@ -33,17 +33,16 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" - utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" corelisters "k8s.io/client-go/listers/core/v1" policylisters "k8s.io/client-go/listers/policy/v1" corev1helpers "k8s.io/component-helpers/scheduling/corev1" extenderv1 "k8s.io/kube-scheduler/extender/v1" - kubefeatures "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/apis/config/validation" "k8s.io/kubernetes/pkg/scheduler/framework" + "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" "k8s.io/kubernetes/pkg/scheduler/metrics" "k8s.io/kubernetes/pkg/scheduler/util" ) @@ -69,7 +68,7 @@ func (pl *DefaultPreemption) Name() string { } // New initializes a new plugin and returns it. -func New(dpArgs runtime.Object, fh framework.Handle) (framework.Plugin, error) { +func New(dpArgs runtime.Object, fh framework.Handle, fts feature.Features) (framework.Plugin, error) { args, ok := dpArgs.(*config.DefaultPreemptionArgs) if !ok { return nil, fmt.Errorf("got args of type %T, want *DefaultPreemptionArgs", dpArgs) @@ -81,7 +80,7 @@ func New(dpArgs runtime.Object, fh framework.Handle) (framework.Plugin, error) { fh: fh, args: *args, podLister: fh.SharedInformerFactory().Core().V1().Pods().Lister(), - pdbLister: getPDBLister(fh.SharedInformerFactory()), + pdbLister: getPDBLister(fh.SharedInformerFactory(), fts.EnablePodDisruptionBudget), } return &pl, nil } @@ -335,7 +334,7 @@ func dryRunPreemption(ctx context.Context, fh framework.Handle, nodeInfoCopy := potentialNodes[(int(offset)+i)%len(potentialNodes)].Clone() stateCopy := state.Clone() pods, numPDBViolations, status := selectVictimsOnNode(ctx, fh, stateCopy, pod, nodeInfoCopy, pdbs) - if status.IsSuccess() { + if status.IsSuccess() && len(pods) != 0 { victims := extenderv1.Victims{ Pods: pods, NumPDBViolations: int64(numPDBViolations), @@ -353,11 +352,14 @@ func dryRunPreemption(ctx context.Context, fh framework.Handle, if nvcSize > 0 && nvcSize+vcSize >= numCandidates { cancel() } - } else { - statusesLock.Lock() - nodeStatuses[nodeInfoCopy.Node().Name] = status - statusesLock.Unlock() + return + } + if status.IsSuccess() && len(pods) == 0 { + status = framework.AsStatus(fmt.Errorf("expected at least one victim pod on node %q", nodeInfoCopy.Node().Name)) } + statusesLock.Lock() + nodeStatuses[nodeInfoCopy.Node().Name] = status + statusesLock.Unlock() } fh.Parallelizer().Until(parallelCtx, len(potentialNodes), checkNode) return append(nonViolatingCandidates.get(), violatingCandidates.get()...), nodeStatuses @@ -392,6 +394,18 @@ func CallExtenders(extenders []framework.Extender, pod *v1.Pod, nodeLister frame } return nil, framework.AsStatus(err) } + // Check if the returned victims are valid. + for nodeName, victims := range nodeNameToVictims { + if victims == nil || len(victims.Pods) == 0 { + if extender.IsIgnorable() { + delete(nodeNameToVictims, nodeName) + klog.InfoS("Ignoring node without victims", "node", nodeName) + continue + } + return nil, framework.AsStatus(fmt.Errorf("expected at least one victim pod on node %q", nodeName)) + } + } + // Replace victimsMap with new result after preemption. So the // rest of extenders can continue use it as parameter. victimsMap = nodeNameToVictims @@ -796,8 +810,8 @@ func filterPodsWithPDBViolation(podInfos []*framework.PodInfo, pdbs []*policy.Po return violatingPodInfos, nonViolatingPodInfos } -func getPDBLister(informerFactory informers.SharedInformerFactory) policylisters.PodDisruptionBudgetLister { - if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.PodDisruptionBudget) { +func getPDBLister(informerFactory informers.SharedInformerFactory, enablePodDisruptionBudget bool) policylisters.PodDisruptionBudgetLister { + if enablePodDisruptionBudget { return informerFactory.Policy().V1().PodDisruptionBudgets().Lister() } return nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature/feature.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature/feature.go index 54f8d2ed88f6..5575b9ab1344 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature/feature.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature/feature.go @@ -21,4 +21,7 @@ package feature // the internal k8s features pkg. type Features struct { EnablePodAffinityNamespaceSelector bool + EnablePodDisruptionBudget bool + EnablePodOverhead bool + EnableBalanceAttachedNodeVolumes bool } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper/spread.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper/spread.go index 4f06f1f53264..636bcaee4cc2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper/spread.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper/spread.go @@ -17,16 +17,30 @@ limitations under the License. package helper import ( + appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" appslisters "k8s.io/client-go/listers/apps/v1" corelisters "k8s.io/client-go/listers/core/v1" ) +var ( + rcKind = v1.SchemeGroupVersion.WithKind("ReplicationController") + rsKind = appsv1.SchemeGroupVersion.WithKind("ReplicaSet") + ssKind = appsv1.SchemeGroupVersion.WithKind("StatefulSet") +) + // DefaultSelector returns a selector deduced from the Services, Replication // Controllers, Replica Sets, and Stateful Sets matching the given pod. -func DefaultSelector(pod *v1.Pod, sl corelisters.ServiceLister, cl corelisters.ReplicationControllerLister, rsl appslisters.ReplicaSetLister, ssl appslisters.StatefulSetLister) labels.Selector { +func DefaultSelector( + pod *v1.Pod, + sl corelisters.ServiceLister, + cl corelisters.ReplicationControllerLister, + rsl appslisters.ReplicaSetLister, + ssl appslisters.StatefulSetLister, +) labels.Selector { labelSet := make(labels.Set) // Since services, RCs, RSs and SSs match the pod, they won't have conflicting // labels. Merging is safe. @@ -36,36 +50,43 @@ func DefaultSelector(pod *v1.Pod, sl corelisters.ServiceLister, cl corelisters.R labelSet = labels.Merge(labelSet, service.Spec.Selector) } } + selector := labelSet.AsSelector() - if rcs, err := cl.GetPodControllers(pod); err == nil { - for _, rc := range rcs { - labelSet = labels.Merge(labelSet, rc.Spec.Selector) - } + owner := metav1.GetControllerOfNoCopy(pod) + if owner == nil { + return selector } - selector := labels.NewSelector() - if len(labelSet) != 0 { - selector = labelSet.AsSelector() + gv, err := schema.ParseGroupVersion(owner.APIVersion) + if err != nil { + return selector } - if rss, err := rsl.GetPodReplicaSets(pod); err == nil { - for _, rs := range rss { + gvk := gv.WithKind(owner.Kind) + switch gvk { + case rcKind: + if rc, err := cl.ReplicationControllers(pod.Namespace).Get(owner.Name); err == nil { + labelSet = labels.Merge(labelSet, rc.Spec.Selector) + selector = labelSet.AsSelector() + } + case rsKind: + if rs, err := rsl.ReplicaSets(pod.Namespace).Get(owner.Name); err == nil { if other, err := metav1.LabelSelectorAsSelector(rs.Spec.Selector); err == nil { if r, ok := other.Requirements(); ok { selector = selector.Add(r...) } } } - } - - if sss, err := ssl.GetPodStatefulSets(pod); err == nil { - for _, ss := range sss { + case ssKind: + if ss, err := ssl.StatefulSets(pod.Namespace).Get(owner.Name); err == nil { if other, err := metav1.LabelSelectorAsSelector(ss.Spec.Selector); err == nil { if r, ok := other.Requirements(); ok { selector = selector.Add(r...) } } } + default: + // Not owned by a supported controller. } return selector diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go index d3e46ac2ea85..c5f0a6088cec 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go @@ -21,7 +21,7 @@ import ( "fmt" "sync/atomic" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/scheduler/framework" @@ -34,8 +34,6 @@ const ( // ErrReasonExistingAntiAffinityRulesNotMatch is used for ExistingPodsAntiAffinityRulesNotMatch predicate error. ErrReasonExistingAntiAffinityRulesNotMatch = "node(s) didn't satisfy existing pods anti-affinity rules" - // ErrReasonAffinityNotMatch is used for MatchInterPodAffinity predicate error. - ErrReasonAffinityNotMatch = "node(s) didn't match pod affinity/anti-affinity rules" // ErrReasonAffinityRulesNotMatch is used for PodAffinityRulesNotMatch predicate error. ErrReasonAffinityRulesNotMatch = "node(s) didn't match pod affinity rules" // ErrReasonAntiAffinityRulesNotMatch is used for PodAntiAffinityRulesNotMatch predicate error. @@ -384,15 +382,15 @@ func (pl *InterPodAffinity) Filter(ctx context.Context, cycleState *framework.Cy } if !satisfyPodAffinity(state, nodeInfo) { - return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonAffinityNotMatch, ErrReasonAffinityRulesNotMatch) + return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonAffinityRulesNotMatch) } if !satisfyPodAntiAffinity(state, nodeInfo) { - return framework.NewStatus(framework.Unschedulable, ErrReasonAffinityNotMatch, ErrReasonAntiAffinityRulesNotMatch) + return framework.NewStatus(framework.Unschedulable, ErrReasonAntiAffinityRulesNotMatch) } if !satisfyExistingPodsAntiAffinity(state, nodeInfo) { - return framework.NewStatus(framework.Unschedulable, ErrReasonAffinityNotMatch, ErrReasonExistingAntiAffinityRulesNotMatch) + return framework.NewStatus(framework.Unschedulable, ErrReasonExistingAntiAffinityRulesNotMatch) } return nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go index 27fa711b9b65..416928232900 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go @@ -36,7 +36,9 @@ type NodeAffinity struct { addedPrefSchedTerms *nodeaffinity.PreferredSchedulingTerms } +var _ framework.PreFilterPlugin = &NodeAffinity{} var _ framework.FilterPlugin = &NodeAffinity{} +var _ framework.PreScorePlugin = &NodeAffinity{} var _ framework.ScorePlugin = &NodeAffinity{} var _ framework.EnqueueExtensions = &NodeAffinity{} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodelabel/node_label.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodelabel/node_label.go index dfa48c03c48e..c16ca5574be8 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodelabel/node_label.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodelabel/node_label.go @@ -84,7 +84,7 @@ func (pl *NodeLabel) Name() string { // Alternately, eliminating nodes that have a certain label, regardless of value, is also useful // A node may have a label with "retiring" as key and the date as the value // and it may be desirable to avoid scheduling new pods on this node. -func (pl *NodeLabel) Filter(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { +func (pl *NodeLabel) Filter(ctx context.Context, _ *framework.CycleState, _ *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { node := nodeInfo.Node() if node == nil { return framework.NewStatus(framework.Error, "node not found") @@ -113,7 +113,7 @@ func (pl *NodeLabel) Filter(ctx context.Context, _ *framework.CycleState, pod *v } // Score invoked at the score extension point. -func (pl *NodeLabel) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { +func (pl *NodeLabel) Score(ctx context.Context, _ *framework.CycleState, _ *v1.Pod, nodeName string) (int64, *framework.Status) { nodeInfo, err := pl.handle.SnapshotSharedLister().NodeInfos().Get(nodeName) if err != nil { return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err)) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go index 93faebe5b696..dc8fd625ae2d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go @@ -23,9 +23,8 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/scheduler/framework" + "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" ) // BalancedAllocation is a score plugin that calculates the difference between the cpu and memory fraction @@ -67,13 +66,15 @@ func (ba *BalancedAllocation) ScoreExtensions() framework.ScoreExtensions { } // NewBalancedAllocation initializes a new plugin and returns it. -func NewBalancedAllocation(_ runtime.Object, h framework.Handle) (framework.Plugin, error) { +func NewBalancedAllocation(_ runtime.Object, h framework.Handle, fts feature.Features) (framework.Plugin, error) { return &BalancedAllocation{ handle: h, resourceAllocationScorer: resourceAllocationScorer{ - BalancedAllocationName, - balancedResourceScorer, - defaultRequestedRatioResources, + Name: BalancedAllocationName, + scorer: balancedResourceScorer, + resourceToWeightMap: defaultRequestedRatioResources, + enablePodOverhead: fts.EnablePodOverhead, + enableBalanceAttachedNodeVolumes: fts.EnableBalanceAttachedNodeVolumes, }, }, nil } @@ -88,7 +89,8 @@ func balancedResourceScorer(requested, allocable resourceToValueMap, includeVolu return 0 } - if includeVolumes && utilfeature.DefaultFeatureGate.Enabled(features.BalanceAttachedNodeVolumes) && allocatableVolumes > 0 { + // includeVolumes is only true when BalanceAttachedNodeVolumes feature gate is enabled (see resource_allocation.go#score()) + if includeVolumes && allocatableVolumes > 0 { volumeFraction := float64(requestedVolumes) / float64(allocatableVolumes) if volumeFraction >= 1 { // if requested >= capacity, the corresponding host should never be preferred. diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go index 6f2d0f95714b..4d47287dff33 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go @@ -24,12 +24,11 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" - utilfeature "k8s.io/apiserver/pkg/util/feature" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" - "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/apis/config/validation" "k8s.io/kubernetes/pkg/scheduler/framework" + "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" ) var _ framework.PreFilterPlugin = &Fit{} @@ -49,6 +48,7 @@ const ( type Fit struct { ignoredResources sets.String ignoredResourceGroups sets.String + enablePodOverhead bool } // preFilterState computed at PreFilter and used at Filter. @@ -67,7 +67,7 @@ func (f *Fit) Name() string { } // NewFit initializes a new plugin and returns it. -func NewFit(plArgs runtime.Object, _ framework.Handle) (framework.Plugin, error) { +func NewFit(plArgs runtime.Object, _ framework.Handle, fts feature.Features) (framework.Plugin, error) { args, ok := plArgs.(*config.NodeResourcesFitArgs) if !ok { return nil, fmt.Errorf("want args to be of type NodeResourcesFitArgs, got %T", plArgs) @@ -78,6 +78,7 @@ func NewFit(plArgs runtime.Object, _ framework.Handle) (framework.Plugin, error) return &Fit{ ignoredResources: sets.NewString(args.IgnoredResources...), ignoredResourceGroups: sets.NewString(args.IgnoredResourceGroups...), + enablePodOverhead: fts.EnablePodOverhead, }, nil } @@ -108,7 +109,7 @@ func NewFit(plArgs runtime.Object, _ framework.Handle) (framework.Plugin, error) // Memory: 1G // // Result: CPU: 3, Memory: 3G -func computePodResourceRequest(pod *v1.Pod) *preFilterState { +func computePodResourceRequest(pod *v1.Pod, enablePodOverhead bool) *preFilterState { result := &preFilterState{} for _, container := range pod.Spec.Containers { result.Add(container.Resources.Requests) @@ -120,7 +121,7 @@ func computePodResourceRequest(pod *v1.Pod) *preFilterState { } // If Overhead is being utilized, add to the total requests for the pod - if pod.Spec.Overhead != nil && utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) { + if pod.Spec.Overhead != nil && enablePodOverhead { result.Add(pod.Spec.Overhead) } @@ -129,7 +130,7 @@ func computePodResourceRequest(pod *v1.Pod) *preFilterState { // PreFilter invoked at the prefilter extension point. func (f *Fit) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status { - cycleState.Write(preFilterStateKey, computePodResourceRequest(pod)) + cycleState.Write(preFilterStateKey, computePodResourceRequest(pod, f.enablePodOverhead)) return nil } @@ -198,8 +199,8 @@ type InsufficientResource struct { } // Fits checks if node have enough resources to host the pod. -func Fits(pod *v1.Pod, nodeInfo *framework.NodeInfo) []InsufficientResource { - return fitsRequest(computePodResourceRequest(pod), nodeInfo, nil, nil) +func Fits(pod *v1.Pod, nodeInfo *framework.NodeInfo, enablePodOverhead bool) []InsufficientResource { + return fitsRequest(computePodResourceRequest(pod, enablePodOverhead), nodeInfo, nil, nil) } func fitsRequest(podRequest *preFilterState, nodeInfo *framework.NodeInfo, ignoredExtendedResources, ignoredResourceGroups sets.String) []InsufficientResource { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/least_allocated.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/least_allocated.go index 5257a2ad20fd..b4419e61d78a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/least_allocated.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/least_allocated.go @@ -25,6 +25,7 @@ import ( "k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/apis/config/validation" "k8s.io/kubernetes/pkg/scheduler/framework" + "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" ) // LeastAllocated is a score plugin that favors nodes with fewer allocation requested resources based on requested resources. @@ -65,7 +66,7 @@ func (la *LeastAllocated) ScoreExtensions() framework.ScoreExtensions { } // NewLeastAllocated initializes a new plugin and returns it. -func NewLeastAllocated(laArgs runtime.Object, h framework.Handle) (framework.Plugin, error) { +func NewLeastAllocated(laArgs runtime.Object, h framework.Handle, fts feature.Features) (framework.Plugin, error) { args, ok := laArgs.(*config.NodeResourcesLeastAllocatedArgs) if !ok { return nil, fmt.Errorf("want args to be of type NodeResourcesLeastAllocatedArgs, got %T", laArgs) @@ -85,6 +86,7 @@ func NewLeastAllocated(laArgs runtime.Object, h framework.Handle) (framework.Plu Name: LeastAllocatedName, scorer: leastResourceScorer(resToWeightMap), resourceToWeightMap: resToWeightMap, + enablePodOverhead: fts.EnablePodOverhead, }, }, nil } @@ -97,6 +99,9 @@ func leastResourceScorer(resToWeightMap resourceToWeightMap) func(resourceToValu nodeScore += resourceScore * weight weightSum += weight } + if weightSum == 0 { + return 0 + } return nodeScore / weightSum } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/most_allocated.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/most_allocated.go index 010643c1145b..3e77e2008f9e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/most_allocated.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/most_allocated.go @@ -25,6 +25,7 @@ import ( "k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/apis/config/validation" "k8s.io/kubernetes/pkg/scheduler/framework" + "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" ) // MostAllocated is a score plugin that favors nodes with high allocation based on requested resources. @@ -63,7 +64,7 @@ func (ma *MostAllocated) ScoreExtensions() framework.ScoreExtensions { } // NewMostAllocated initializes a new plugin and returns it. -func NewMostAllocated(maArgs runtime.Object, h framework.Handle) (framework.Plugin, error) { +func NewMostAllocated(maArgs runtime.Object, h framework.Handle, fts feature.Features) (framework.Plugin, error) { args, ok := maArgs.(*config.NodeResourcesMostAllocatedArgs) if !ok { return nil, fmt.Errorf("want args to be of type NodeResourcesMostAllocatedArgs, got %T", args) @@ -83,6 +84,7 @@ func NewMostAllocated(maArgs runtime.Object, h framework.Handle) (framework.Plug Name: MostAllocatedName, scorer: mostResourceScorer(resToWeightMap), resourceToWeightMap: resToWeightMap, + enablePodOverhead: fts.EnablePodOverhead, }, }, nil } @@ -95,6 +97,9 @@ func mostResourceScorer(resToWeightMap resourceToWeightMap) func(requested, allo nodeScore += resourceScore * weight weightSum += weight } + if weightSum == 0 { + return 0 + } return (nodeScore / weightSum) } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go index f9d7f9af65d1..d9cf416674ea 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go @@ -26,6 +26,7 @@ import ( "k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/apis/config/validation" "k8s.io/kubernetes/pkg/scheduler/framework" + "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper" ) @@ -36,7 +37,7 @@ const ( ) // NewRequestedToCapacityRatio initializes a new plugin and returns it. -func NewRequestedToCapacityRatio(plArgs runtime.Object, handle framework.Handle) (framework.Plugin, error) { +func NewRequestedToCapacityRatio(plArgs runtime.Object, handle framework.Handle, fts feature.Features) (framework.Plugin, error) { args, err := getRequestedToCapacityRatioArgs(plArgs) if err != nil { return nil, err @@ -68,9 +69,10 @@ func NewRequestedToCapacityRatio(plArgs runtime.Object, handle framework.Handle) return &RequestedToCapacityRatio{ handle: handle, resourceAllocationScorer: resourceAllocationScorer{ - RequestedToCapacityRatioName, - buildRequestedToCapacityRatioScorerFunction(shape, resourceToWeightMap), - resourceToWeightMap, + Name: RequestedToCapacityRatioName, + scorer: buildRequestedToCapacityRatioScorerFunction(shape, resourceToWeightMap), + resourceToWeightMap: resourceToWeightMap, + enablePodOverhead: fts.EnablePodOverhead, }, }, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go index 8326e5a90a06..e4a6e3f3ae10 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go @@ -18,9 +18,7 @@ package noderesources import ( v1 "k8s.io/api/core/v1" - utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/klog/v2" - "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/scheduler/framework" schedutil "k8s.io/kubernetes/pkg/scheduler/util" ) @@ -36,6 +34,9 @@ type resourceAllocationScorer struct { Name string scorer func(requested, allocable resourceToValueMap, includeVolumes bool, requestedVolumes int, allocatableVolumes int) int64 resourceToWeightMap resourceToWeightMap + + enablePodOverhead bool + enableBalanceAttachedNodeVolumes bool } // resourceToValueMap contains resource name and score. @@ -55,18 +56,18 @@ func (r *resourceAllocationScorer) score( requested := make(resourceToValueMap, len(r.resourceToWeightMap)) allocatable := make(resourceToValueMap, len(r.resourceToWeightMap)) for resource := range r.resourceToWeightMap { - allocatable[resource], requested[resource] = calculateResourceAllocatableRequest(nodeInfo, pod, resource) + allocatable[resource], requested[resource] = calculateResourceAllocatableRequest(nodeInfo, pod, resource, r.enablePodOverhead) } var score int64 // Check if the pod has volumes and this could be added to scorer function for balanced resource allocation. - if len(pod.Spec.Volumes) > 0 && utilfeature.DefaultFeatureGate.Enabled(features.BalanceAttachedNodeVolumes) && nodeInfo.TransientInfo != nil { + if len(pod.Spec.Volumes) > 0 && r.enableBalanceAttachedNodeVolumes && nodeInfo.TransientInfo != nil { score = r.scorer(requested, allocatable, true, nodeInfo.TransientInfo.TransNodeInfo.RequestedVolumes, nodeInfo.TransientInfo.TransNodeInfo.AllocatableVolumesCount) } else { score = r.scorer(requested, allocatable, false, 0, 0) } if klog.V(10).Enabled() { - if len(pod.Spec.Volumes) > 0 && utilfeature.DefaultFeatureGate.Enabled(features.BalanceAttachedNodeVolumes) && nodeInfo.TransientInfo != nil { + if len(pod.Spec.Volumes) > 0 && r.enableBalanceAttachedNodeVolumes && nodeInfo.TransientInfo != nil { klog.Infof( "%v -> %v: %v, map of allocatable resources %v, map of requested resources %v , allocatable volumes %d, requested volumes %d, score %d", pod.Name, node.Name, r.Name, @@ -88,8 +89,8 @@ func (r *resourceAllocationScorer) score( } // calculateResourceAllocatableRequest returns resources Allocatable and Requested values -func calculateResourceAllocatableRequest(nodeInfo *framework.NodeInfo, pod *v1.Pod, resource v1.ResourceName) (int64, int64) { - podRequest := calculatePodResourceRequest(pod, resource) +func calculateResourceAllocatableRequest(nodeInfo *framework.NodeInfo, pod *v1.Pod, resource v1.ResourceName, enablePodOverhead bool) (int64, int64) { + podRequest := calculatePodResourceRequest(pod, resource, enablePodOverhead) switch resource { case v1.ResourceCPU: return nodeInfo.Allocatable.MilliCPU, (nodeInfo.NonZeroRequested.MilliCPU + podRequest) @@ -99,7 +100,7 @@ func calculateResourceAllocatableRequest(nodeInfo *framework.NodeInfo, pod *v1.P case v1.ResourceEphemeralStorage: return nodeInfo.Allocatable.EphemeralStorage, (nodeInfo.Requested.EphemeralStorage + podRequest) default: - if schedutil.IsScalarResourceName(resource) { + if _, exists := nodeInfo.Allocatable.ScalarResources[resource]; exists { return nodeInfo.Allocatable.ScalarResources[resource], (nodeInfo.Requested.ScalarResources[resource] + podRequest) } } @@ -114,7 +115,7 @@ func calculateResourceAllocatableRequest(nodeInfo *framework.NodeInfo, pod *v1.P // calculatePodResourceRequest returns the total non-zero requests. If Overhead is defined for the pod and the // PodOverhead feature is enabled, the Overhead is added to the result. // podResourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead -func calculatePodResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64 { +func calculatePodResourceRequest(pod *v1.Pod, resource v1.ResourceName, enablePodOverhead bool) int64 { var podRequest int64 for i := range pod.Spec.Containers { container := &pod.Spec.Containers[i] @@ -131,7 +132,7 @@ func calculatePodResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64 { } // If Overhead is being utilized, add to the total requests for the pod - if pod.Spec.Overhead != nil && utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) { + if pod.Spec.Overhead != nil && enablePodOverhead { if quantity, found := pod.Spec.Overhead[resource]; found { podRequest += quantity.Value() } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go index 204f022f63a2..2d6aa94d6b1c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go @@ -57,6 +57,7 @@ type CSILimits struct { } var _ framework.FilterPlugin = &CSILimits{} +var _ framework.EnqueueExtensions = &CSILimits{} // CSIName is the name of the plugin used in the plugin registry and configurations. const CSIName = "NodeVolumeLimits" @@ -66,6 +67,15 @@ func (pl *CSILimits) Name() string { return CSIName } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *CSILimits) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + {Resource: framework.CSINode, ActionType: framework.Add}, + {Resource: framework.Pod, ActionType: framework.Delete}, + } +} + // Filter invoked at the filter extension point. func (pl *CSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { // If the new pod doesn't have any volume attached to it, the predicate will always be true @@ -75,7 +85,7 @@ func (pl *CSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v node := nodeInfo.Node() if node == nil { - return framework.NewStatus(framework.Error, fmt.Sprintf("node not found: %s", node.Name)) + return framework.NewStatus(framework.Error, "node not found") } // If CSINode doesn't exist, the predicate may read the limits from Node object diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go index cbfa7c320f7e..cbc622abe646 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go @@ -119,6 +119,7 @@ type nonCSILimits struct { } var _ framework.FilterPlugin = &nonCSILimits{} +var _ framework.EnqueueExtensions = &nonCSILimits{} // newNonCSILimitsWithInformerFactory returns a plugin with filter name and informer factory. func newNonCSILimitsWithInformerFactory( @@ -195,6 +196,15 @@ func (pl *nonCSILimits) Name() string { return pl.name } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *nonCSILimits) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + {Resource: framework.Node, ActionType: framework.Add}, + {Resource: framework.Pod, ActionType: framework.Delete}, + } +} + // Filter invoked at the filter extension point. func (pl *nonCSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { // If a pod doesn't have any volume attached to it, the predicate will always be true. @@ -215,7 +225,7 @@ func (pl *nonCSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod node := nodeInfo.Node() if node == nil { - return framework.NewStatus(framework.Error, fmt.Sprintf("node not found: %s", node.Name)) + return framework.NewStatus(framework.Error, "node not found") } var csiNode *storage.CSINode @@ -284,7 +294,7 @@ func (pl *nonCSILimits) filterVolumes(volumes []v1.Volume, namespace string, fil pvID := fmt.Sprintf("%s-%s/%s", pl.randomVolumeIDPrefix, namespace, pvcName) pvc, err := pl.pvcLister.PersistentVolumeClaims(namespace).Get(pvcName) - if err != nil || pvc == nil { + if err != nil { // If the PVC is invalid, we don't count the volume because // there's no guarantee that it belongs to the running predicate. klog.V(4).InfoS("Unable to look up PVC info, assuming PVC doesn't match predicate when counting limits", "PVC", fmt.Sprintf("%s/%s", namespace, pvcName), "err", err) @@ -305,7 +315,7 @@ func (pl *nonCSILimits) filterVolumes(volumes []v1.Volume, namespace string, fil } pv, err := pl.pvLister.Get(pvName) - if err != nil || pv == nil { + if err != nil { // If the PV is invalid and PVC belongs to the running predicate, // log the error and count the PV towards the PV limit. if pl.matchProvisioner(pvc) { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/registry.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/registry.go index 57d07aa377d3..9436b3c79ab2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/registry.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/registry.go @@ -18,7 +18,7 @@ package plugins import ( apiruntime "k8s.io/apimachinery/pkg/runtime" - utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/apiserver/pkg/util/feature" "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder" @@ -50,39 +50,54 @@ import ( // through the WithFrameworkOutOfTreeRegistry option. func NewInTreeRegistry() runtime.Registry { fts := plfeature.Features{ - EnablePodAffinityNamespaceSelector: utilfeature.DefaultFeatureGate.Enabled(features.PodAffinityNamespaceSelector), + EnablePodAffinityNamespaceSelector: feature.DefaultFeatureGate.Enabled(features.PodAffinityNamespaceSelector), + EnablePodDisruptionBudget: feature.DefaultFeatureGate.Enabled(features.PodDisruptionBudget), + EnablePodOverhead: feature.DefaultFeatureGate.Enabled(features.PodOverhead), + EnableBalanceAttachedNodeVolumes: feature.DefaultFeatureGate.Enabled(features.BalanceAttachedNodeVolumes), } return runtime.Registry{ - selectorspread.Name: selectorspread.New, - imagelocality.Name: imagelocality.New, - tainttoleration.Name: tainttoleration.New, - nodename.Name: nodename.New, - nodeports.Name: nodeports.New, - nodepreferavoidpods.Name: nodepreferavoidpods.New, - nodeaffinity.Name: nodeaffinity.New, - podtopologyspread.Name: podtopologyspread.New, - nodeunschedulable.Name: nodeunschedulable.New, - noderesources.FitName: noderesources.NewFit, - noderesources.BalancedAllocationName: noderesources.NewBalancedAllocation, - noderesources.MostAllocatedName: noderesources.NewMostAllocated, - noderesources.LeastAllocatedName: noderesources.NewLeastAllocated, - noderesources.RequestedToCapacityRatioName: noderesources.NewRequestedToCapacityRatio, - volumebinding.Name: volumebinding.New, - volumerestrictions.Name: volumerestrictions.New, - volumezone.Name: volumezone.New, - nodevolumelimits.CSIName: nodevolumelimits.NewCSI, - nodevolumelimits.EBSName: nodevolumelimits.NewEBS, - nodevolumelimits.GCEPDName: nodevolumelimits.NewGCEPD, - nodevolumelimits.AzureDiskName: nodevolumelimits.NewAzureDisk, - nodevolumelimits.CinderName: nodevolumelimits.NewCinder, + selectorspread.Name: selectorspread.New, + imagelocality.Name: imagelocality.New, + tainttoleration.Name: tainttoleration.New, + nodename.Name: nodename.New, + nodeports.Name: nodeports.New, + nodepreferavoidpods.Name: nodepreferavoidpods.New, + nodeaffinity.Name: nodeaffinity.New, + podtopologyspread.Name: podtopologyspread.New, + nodeunschedulable.Name: nodeunschedulable.New, + noderesources.FitName: func(plArgs apiruntime.Object, fh framework.Handle) (framework.Plugin, error) { + return noderesources.NewFit(plArgs, fh, fts) + }, + noderesources.BalancedAllocationName: func(plArgs apiruntime.Object, fh framework.Handle) (framework.Plugin, error) { + return noderesources.NewBalancedAllocation(plArgs, fh, fts) + }, + noderesources.MostAllocatedName: func(plArgs apiruntime.Object, fh framework.Handle) (framework.Plugin, error) { + return noderesources.NewMostAllocated(plArgs, fh, fts) + }, + noderesources.LeastAllocatedName: func(plArgs apiruntime.Object, fh framework.Handle) (framework.Plugin, error) { + return noderesources.NewLeastAllocated(plArgs, fh, fts) + }, + noderesources.RequestedToCapacityRatioName: func(plArgs apiruntime.Object, fh framework.Handle) (framework.Plugin, error) { + return noderesources.NewRequestedToCapacityRatio(plArgs, fh, fts) + }, + volumebinding.Name: volumebinding.New, + volumerestrictions.Name: volumerestrictions.New, + volumezone.Name: volumezone.New, + nodevolumelimits.CSIName: nodevolumelimits.NewCSI, + nodevolumelimits.EBSName: nodevolumelimits.NewEBS, + nodevolumelimits.GCEPDName: nodevolumelimits.NewGCEPD, + nodevolumelimits.AzureDiskName: nodevolumelimits.NewAzureDisk, + nodevolumelimits.CinderName: nodevolumelimits.NewCinder, interpodaffinity.Name: func(plArgs apiruntime.Object, fh framework.Handle) (framework.Plugin, error) { return interpodaffinity.New(plArgs, fh, fts) }, - nodelabel.Name: nodelabel.New, - serviceaffinity.Name: serviceaffinity.New, - queuesort.Name: queuesort.New, - defaultbinder.Name: defaultbinder.New, - defaultpreemption.Name: defaultpreemption.New, + nodelabel.Name: nodelabel.New, + serviceaffinity.Name: serviceaffinity.New, + queuesort.Name: queuesort.New, + defaultbinder.Name: defaultbinder.New, + defaultpreemption.Name: func(plArgs apiruntime.Object, fh framework.Handle) (framework.Plugin, error) { + return defaultpreemption.New(plArgs, fh, fts) + }, } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone/volume_zone.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone/volume_zone.go index 39c978e29a0b..3c0da9e3de6b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone/volume_zone.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone/volume_zone.go @@ -22,6 +22,7 @@ import ( v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" corelisters "k8s.io/client-go/listers/core/v1" @@ -109,39 +110,38 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod * } pvcName := volume.PersistentVolumeClaim.ClaimName if pvcName == "" { - return framework.NewStatus(framework.Error, "PersistentVolumeClaim had no name") + return framework.NewStatus(framework.UnschedulableAndUnresolvable, "PersistentVolumeClaim had no name") } pvc, err := pl.pvcLister.PersistentVolumeClaims(pod.Namespace).Get(pvcName) - if err != nil { - return framework.AsStatus(err) + if s := getErrorAsStatus(err); !s.IsSuccess() { + return s } pvName := pvc.Spec.VolumeName if pvName == "" { scName := storagehelpers.GetPersistentVolumeClaimClass(pvc) if len(scName) == 0 { - return framework.NewStatus(framework.Error, "PersistentVolumeClaim had no pv name and storageClass name") + return framework.NewStatus(framework.UnschedulableAndUnresolvable, "PersistentVolumeClaim had no pv name and storageClass name") } - class, _ := pl.scLister.Get(scName) - if class == nil { - return framework.NewStatus(framework.Error, fmt.Sprintf("StorageClass %q claimed by PersistentVolumeClaim %q not found", scName, pvcName)) - + class, err := pl.scLister.Get(scName) + if s := getErrorAsStatus(err); !s.IsSuccess() { + return s } if class.VolumeBindingMode == nil { - return framework.NewStatus(framework.Error, fmt.Sprintf("VolumeBindingMode not set for StorageClass %q", scName)) + return framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("VolumeBindingMode not set for StorageClass %q", scName)) } if *class.VolumeBindingMode == storage.VolumeBindingWaitForFirstConsumer { // Skip unbound volumes continue } - return framework.NewStatus(framework.Error, "PersistentVolume had no name") + return framework.NewStatus(framework.UnschedulableAndUnresolvable, "PersistentVolume had no name") } pv, err := pl.pvLister.Get(pvName) - if err != nil { - return framework.AsStatus(err) + if s := getErrorAsStatus(err); !s.IsSuccess() { + return s } for k, v := range pv.ObjectMeta.Labels { @@ -164,6 +164,16 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod * return nil } +func getErrorAsStatus(err error) *framework.Status { + if err != nil { + if errors.IsNotFound(err) { + return framework.NewStatus(framework.UnschedulableAndUnresolvable, err.Error()) + } + return framework.AsStatus(err) + } + return nil +} + // EventsToRegister returns the possible events that may make a Pod // failed by this plugin schedulable. func (pl *VolumeZone) EventsToRegister() []framework.ClusterEvent { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go index ae7fef1f9d8a..ed763381cec1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go @@ -75,21 +75,21 @@ var configDecoder = scheme.Codecs.UniversalDecoder() // frameworkImpl is the component responsible for initializing and running scheduler // plugins. type frameworkImpl struct { - registry Registry - snapshotSharedLister framework.SharedLister - waitingPods *waitingPodsMap - pluginNameToWeightMap map[string]int - queueSortPlugins []framework.QueueSortPlugin - preFilterPlugins []framework.PreFilterPlugin - filterPlugins []framework.FilterPlugin - postFilterPlugins []framework.PostFilterPlugin - preScorePlugins []framework.PreScorePlugin - scorePlugins []framework.ScorePlugin - reservePlugins []framework.ReservePlugin - preBindPlugins []framework.PreBindPlugin - bindPlugins []framework.BindPlugin - postBindPlugins []framework.PostBindPlugin - permitPlugins []framework.PermitPlugin + registry Registry + snapshotSharedLister framework.SharedLister + waitingPods *waitingPodsMap + scorePluginWeight map[string]int + queueSortPlugins []framework.QueueSortPlugin + preFilterPlugins []framework.PreFilterPlugin + filterPlugins []framework.FilterPlugin + postFilterPlugins []framework.PostFilterPlugin + preScorePlugins []framework.PreScorePlugin + scorePlugins []framework.ScorePlugin + reservePlugins []framework.ReservePlugin + preBindPlugins []framework.PreBindPlugin + bindPlugins []framework.BindPlugin + postBindPlugins []framework.PostBindPlugin + permitPlugins []framework.PermitPlugin clientSet clientset.Interface kubeConfig *restclient.Config @@ -258,19 +258,19 @@ func NewFramework(r Registry, profile *config.KubeSchedulerProfile, opts ...Opti } f := &frameworkImpl{ - registry: r, - snapshotSharedLister: options.snapshotSharedLister, - pluginNameToWeightMap: make(map[string]int), - waitingPods: newWaitingPodsMap(), - clientSet: options.clientSet, - kubeConfig: options.kubeConfig, - eventRecorder: options.eventRecorder, - informerFactory: options.informerFactory, - metricsRecorder: options.metricsRecorder, - runAllFilters: options.runAllFilters, - extenders: options.extenders, - PodNominator: options.podNominator, - parallelizer: options.parallelizer, + registry: r, + snapshotSharedLister: options.snapshotSharedLister, + scorePluginWeight: make(map[string]int), + waitingPods: newWaitingPodsMap(), + clientSet: options.clientSet, + kubeConfig: options.kubeConfig, + eventRecorder: options.eventRecorder, + informerFactory: options.informerFactory, + metricsRecorder: options.metricsRecorder, + runAllFilters: options.runAllFilters, + extenders: options.extenders, + PodNominator: options.podNominator, + parallelizer: options.parallelizer, } if profile == nil { @@ -282,6 +282,22 @@ func NewFramework(r Registry, profile *config.KubeSchedulerProfile, opts ...Opti return f, nil } + var totalPriority int64 + for _, e := range profile.Plugins.Score.Enabled { + // a weight of zero is not permitted, plugins can be disabled explicitly + // when configured. + f.scorePluginWeight[e.Name] = int(e.Weight) + if f.scorePluginWeight[e.Name] == 0 { + f.scorePluginWeight[e.Name] = 1 + } + + // Checks totalPriority against MaxTotalScore to avoid overflow + if int64(f.scorePluginWeight[e.Name])*framework.MaxNodeScore > framework.MaxTotalScore-totalPriority { + return nil, fmt.Errorf("total score of Score plugins could overflow") + } + totalPriority += int64(f.scorePluginWeight[e.Name]) * framework.MaxNodeScore + } + // get needed plugins from config pg := f.pluginsNeeded(profile.Plugins) @@ -300,7 +316,6 @@ func NewFramework(r Registry, profile *config.KubeSchedulerProfile, opts ...Opti } pluginsMap := make(map[string]framework.Plugin) - var totalPriority int64 for name, factory := range r { // initialize only needed plugins. if _, ok := pg[name]; !ok { @@ -325,18 +340,6 @@ func NewFramework(r Registry, profile *config.KubeSchedulerProfile, opts ...Opti // Update ClusterEventMap in place. fillEventToPluginMap(p, options.clusterEventMap) - - // a weight of zero is not permitted, plugins can be disabled explicitly - // when configured. - f.pluginNameToWeightMap[name] = int(pg[name].Weight) - if f.pluginNameToWeightMap[name] == 0 { - f.pluginNameToWeightMap[name] = 1 - } - // Checks totalPriority against MaxTotalScore to avoid overflow - if int64(f.pluginNameToWeightMap[name])*framework.MaxNodeScore > framework.MaxTotalScore-totalPriority { - return nil, fmt.Errorf("total score of Score plugins could overflow") - } - totalPriority += int64(f.pluginNameToWeightMap[name]) * framework.MaxNodeScore } for _, e := range f.getExtensionPoints(profile.Plugins) { @@ -348,7 +351,7 @@ func NewFramework(r Registry, profile *config.KubeSchedulerProfile, opts ...Opti // Verifying the score weights again since Plugin.Name() could return a different // value from the one used in the configuration. for _, scorePlugin := range f.scorePlugins { - if f.pluginNameToWeightMap[scorePlugin.Name()] == 0 { + if f.scorePluginWeight[scorePlugin.Name()] == 0 { return nil, fmt.Errorf("score plugin %q is not configured with weight", scorePlugin.Name()) } } @@ -820,7 +823,7 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy f.Parallelizer().Until(ctx, len(f.scorePlugins), func(index int) { pl := f.scorePlugins[index] // Score plugins' weight has been checked when they are initialized. - weight := f.pluginNameToWeightMap[pl.Name()] + weight := f.scorePluginWeight[pl.Name()] nodeScoreList := pluginToNodeScores[pl.Name()] for i, nodeScore := range nodeScoreList { @@ -1140,7 +1143,7 @@ func (f *frameworkImpl) ListPlugins() map[string][]config.Plugin { p := config.Plugin{Name: name} if extName == "ScorePlugin" { // Weights apply only to score plugins. - p.Weight = int32(f.pluginNameToWeightMap[name]) + p.Weight = int32(f.scorePluginWeight[name]) } cfgs = append(cfgs, p) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/util/non_zero.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/util/non_zero.go index bf8c47c53782..f8a95ab217ce 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/util/non_zero.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/util/non_zero.go @@ -47,6 +47,9 @@ func GetNonzeroRequests(requests *v1.ResourceList) (int64, int64) { // GetNonzeroRequestForResource returns the default resource request if none is found or // what is provided on the request. func GetNonzeroRequestForResource(resource v1.ResourceName, requests *v1.ResourceList) int64 { + if requests == nil { + return 0 + } switch resource { case v1.ResourceCPU: // Override if un-set, but not if explicitly set to zero @@ -72,13 +75,10 @@ func GetNonzeroRequestForResource(resource v1.ResourceName, requests *v1.Resourc } return quantity.Value() default: - if IsScalarResourceName(resource) { - quantity, found := (*requests)[resource] - if !found { - return 0 - } - return quantity.Value() + quantity, found := (*requests)[resource] + if !found { + return 0 } + return quantity.Value() } - return 0 } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/securitycontext/util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/securitycontext/util.go index e960dc9325f3..82a2fc5e0a90 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/securitycontext/util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/securitycontext/util.go @@ -44,6 +44,20 @@ func HasCapabilitiesRequest(container *v1.Container) bool { return len(container.SecurityContext.Capabilities.Add) > 0 || len(container.SecurityContext.Capabilities.Drop) > 0 } +// HasWindowsHostProcessRequest returns true if container should run as HostProcess container, +// taking into account nils +func HasWindowsHostProcessRequest(pod *v1.Pod, container *v1.Container) bool { + effectiveSc := DetermineEffectiveSecurityContext(pod, container) + + if effectiveSc.WindowsOptions == nil { + return false + } + if effectiveSc.WindowsOptions.HostProcess == nil { + return false + } + return *effectiveSc.WindowsOptions.HostProcess +} + // DetermineEffectiveSecurityContext returns a synthesized SecurityContext for reading effective configurations // from the provided pod's and container's security context. Container's fields take precedence in cases where both // are set @@ -79,6 +93,9 @@ func DetermineEffectiveSecurityContext(pod *v1.Pod, container *v1.Container) *v1 if containerSc.WindowsOptions.RunAsUserName != nil { effectiveSc.WindowsOptions.RunAsUserName = containerSc.WindowsOptions.RunAsUserName } + if containerSc.WindowsOptions.HostProcess != nil { + effectiveSc.WindowsOptions.HostProcess = containerSc.WindowsOptions.HostProcess + } } if containerSc.Capabilities != nil { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/bandwidth/unsupported.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/bandwidth/unsupported.go index 929f5e0584d9..914f435d9538 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/bandwidth/unsupported.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/bandwidth/unsupported.go @@ -27,7 +27,7 @@ import ( type unsupportedShaper struct { } -// NewTCShaper makes a new unsupportedShapper for the given interface +// NewTCShaper makes a new unsupportedShaper for the given interface func NewTCShaper(iface string) Shaper { return &unsupportedShaper{} } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_ebs.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_ebs.go index bee0ab3244ef..3ee135e24bab 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_ebs.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_ebs.go @@ -110,11 +110,11 @@ func (plugin *awsElasticBlockStorePlugin) GetVolumeLimits() (map[string]int64, e // default values from here will mean, no one can // override them. if cloud == nil { - return nil, fmt.Errorf("No cloudprovider present") + return nil, fmt.Errorf("no cloudprovider present") } if cloud.ProviderName() != aws.ProviderName { - return nil, fmt.Errorf("Expected aws cloud, found %s", cloud.ProviderName()) + return nil, fmt.Errorf("expected aws cloud, found %s", cloud.ProviderName()) } instances, ok := cloud.Instances() diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_ebs_block.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_ebs_block.go index d09a69ca027a..34c4e2869726 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_ebs_block.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_ebs_block.go @@ -98,7 +98,7 @@ func (plugin *awsElasticBlockStorePlugin) newBlockVolumeMapperInternal(spec *vol partition = strconv.Itoa(int(ebs.Partition)) } - return &awsElasticBlockStoreMapper{ + mapper := &awsElasticBlockStoreMapper{ awsElasticBlockStore: &awsElasticBlockStore{ podUID: podUID, volName: spec.Name(), @@ -108,7 +108,16 @@ func (plugin *awsElasticBlockStorePlugin) newBlockVolumeMapperInternal(spec *vol mounter: mounter, plugin: plugin, }, - readOnly: readOnly}, nil + readOnly: readOnly, + } + + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, fmt.Errorf("failed to get device path: %v", err) + } + mapper.MetricsProvider = volume.NewMetricsBlock(filepath.Join(blockPath, string(podUID))) + + return mapper, nil } func (plugin *awsElasticBlockStorePlugin) NewBlockVolumeUnmapper(volName string, podUID types.UID) (volume.BlockVolumeUnmapper, error) { @@ -156,3 +165,9 @@ func (ebs *awsElasticBlockStore) GetPodDeviceMapPath() (string, string) { name := awsElasticBlockStorePluginName return ebs.plugin.host.GetPodVolumeDeviceDir(ebs.podUID, utilstrings.EscapeQualifiedName(name)), ebs.volName } + +// SupportsMetrics returns true for awsElasticBlockStore as it initializes the +// MetricsProvider. +func (ebs *awsElasticBlockStore) SupportsMetrics() bool { + return true +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_util.go index e5f8e7fc6132..9bd14064b57d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/awsebs/aws_util.go @@ -116,7 +116,7 @@ func (util *AWSDiskUtil) CreateVolume(c *awsElasticBlockStoreProvisioner, node * labels, err := cloud.GetVolumeLabels(name) if err != nil { // We don't really want to leak the volume here... - klog.Errorf("error building labels for new EBS volume %q: %v", name, err) + klog.Errorf("Error building labels for new EBS volume %q: %v", name, err) } fstype := "" @@ -204,7 +204,7 @@ func populateVolumeOptions(pluginName, pvcName string, capacityGB resource.Quant func verifyDevicePath(devicePaths []string) (string, error) { for _, path := range devicePaths { if pathExists, err := mount.PathExists(path); err != nil { - return "", fmt.Errorf("Error checking if path exists: %v", err) + return "", fmt.Errorf("error checking if path exists: %v", err) } else if pathExists { return path, nil } @@ -232,14 +232,14 @@ func getDiskByIDPaths(volumeID aws.KubernetesVolumeID, partition string, deviceP // and we have to get the volume id from the nvme interface awsVolumeID, err := volumeID.MapToAWSVolumeID() if err != nil { - klog.Warningf("error mapping volume %q to AWS volume: %v", volumeID, err) + klog.Warningf("Error mapping volume %q to AWS volume: %v", volumeID, err) } else { // This is the magic name on which AWS presents NVME devices under /dev/disk/by-id/ // For example, vol-0fab1d5e3f72a5e23 creates a symlink at /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol0fab1d5e3f72a5e23 nvmeName := "nvme-Amazon_Elastic_Block_Store_" + strings.Replace(string(awsVolumeID), "-", "", -1) nvmePath, err := findNvmeVolume(nvmeName) if err != nil { - klog.Warningf("error looking for nvme volume %q: %v", volumeID, err) + klog.Warningf("Error looking for nvme volume %q: %v", volumeID, err) } else if nvmePath != "" { if partition != "" { nvmePath = nvmePath + nvmeDiskPartitionSuffix + partition @@ -251,11 +251,11 @@ func getDiskByIDPaths(volumeID aws.KubernetesVolumeID, partition string, deviceP return devicePaths } -// Return cloud provider +// Returns cloud provider func getCloudProvider(cloudProvider cloudprovider.Interface) (*aws.Cloud, error) { awsCloudProvider, ok := cloudProvider.(*aws.Cloud) if !ok || awsCloudProvider == nil { - return nil, fmt.Errorf("Failed to get AWS Cloud Provider. GetCloudProvider returned %v instead", cloudProvider) + return nil, fmt.Errorf("failed to get AWS Cloud Provider. GetCloudProvider returned %v instead", cloudProvider) } return awsCloudProvider, nil @@ -310,7 +310,7 @@ func formatVolumeID(volumeID string) (string, error) { } volName := names[length-1] if !strings.HasPrefix(volName, "vol-") { - return "", fmt.Errorf("Invalid volume name format for AWS volume (%q)", volName) + return "", fmt.Errorf("invalid volume name format for AWS volume (%q)", volName) } if length == 2 { sourceName = awsURLNamePrefix + "" + "/" + volName // empty zone label diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_file.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_file.go index 77196a15e6ca..0f9f1321d66b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_file.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_file.go @@ -397,7 +397,7 @@ func getSecretNameAndNamespace(spec *volume.Spec, defaultNamespace string) (stri func getAzureCloud(cloudProvider cloudprovider.Interface) (*azure.Cloud, error) { azure, ok := cloudProvider.(*azure.Cloud) if !ok || azure == nil { - return nil, fmt.Errorf("Failed to get Azure Cloud Provider. GetCloudProvider returned %v instead", cloudProvider) + return nil, fmt.Errorf("failed to get Azure Cloud Provider. GetCloudProvider returned %v instead", cloudProvider) } return azure, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_provision.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_provision.go index 4fa7f5b28853..bc4740f629e5 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_provision.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_provision.go @@ -277,7 +277,7 @@ func (a *azureFileProvisioner) Provision(selectedNode *v1.Node, allowedTopologie func getAzureCloudProvider(cloudProvider cloudprovider.Interface) (azureCloudProvider, string, error) { azureCloudProvider, ok := cloudProvider.(*azure.Cloud) if !ok || azureCloudProvider == nil { - return nil, "", fmt.Errorf("Failed to get Azure Cloud Provider. GetCloudProvider returned %v instead", cloudProvider) + return nil, "", fmt.Errorf("failed to get Azure Cloud Provider. GetCloudProvider returned %v instead", cloudProvider) } return azureCloudProvider, azureCloudProvider.ResourceGroup, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_util.go index 017f1ac22069..fc66547a5fd5 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azure_file/azure_util.go @@ -54,12 +54,12 @@ func (s *azureSvc) GetAzureCredentials(host volume.VolumeHost, nameSpace, secret var accountKey, accountName string kubeClient := host.GetKubeClient() if kubeClient == nil { - return "", "", fmt.Errorf("Cannot get kube client") + return "", "", fmt.Errorf("cannot get kube client") } keys, err := kubeClient.CoreV1().Secrets(nameSpace).Get(context.TODO(), secretName, metav1.GetOptions{}) if err != nil { - return "", "", fmt.Errorf("Couldn't get secret %v/%v", nameSpace, secretName) + return "", "", fmt.Errorf("couldn't get secret %v/%v", nameSpace, secretName) } for name, data := range keys.Data { if name == "azurestorageaccountname" { @@ -70,7 +70,7 @@ func (s *azureSvc) GetAzureCredentials(host volume.VolumeHost, nameSpace, secret } } if accountName == "" || accountKey == "" { - return "", "", fmt.Errorf("Invalid %v/%v, couldn't extract azurestorageaccountname or azurestorageaccountkey", nameSpace, secretName) + return "", "", fmt.Errorf("invalid %v/%v, couldn't extract azurestorageaccountname or azurestorageaccountkey", nameSpace, secretName) } accountName = strings.TrimSpace(accountName) return accountName, accountKey, nil @@ -79,7 +79,7 @@ func (s *azureSvc) GetAzureCredentials(host volume.VolumeHost, nameSpace, secret func (s *azureSvc) SetAzureCredentials(host volume.VolumeHost, nameSpace, accountName, accountKey string) (string, error) { kubeClient := host.GetKubeClient() if kubeClient == nil { - return "", fmt.Errorf("Cannot get kube client") + return "", fmt.Errorf("cannot get kube client") } secretName := "azure-storage-account-" + accountName + "-secret" secret := &v1.Secret{ @@ -98,7 +98,7 @@ func (s *azureSvc) SetAzureCredentials(host volume.VolumeHost, nameSpace, accoun err = nil } if err != nil { - return "", fmt.Errorf("Couldn't create secret %v", err) + return "", fmt.Errorf("couldn't create secret %v", err) } return secretName, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_dd_block.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_dd_block.go index b13618290a43..1217e4a01961 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_dd_block.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_dd_block.go @@ -104,10 +104,18 @@ func (plugin *azureDataDiskPlugin) newBlockVolumeMapperInternal(spec *volume.Spe disk := makeDataDisk(spec.Name(), podUID, volumeSource.DiskName, plugin.host, plugin) - return &azureDataDiskMapper{ + mapper := &azureDataDiskMapper{ dataDisk: disk, readOnly: readOnly, - }, nil + } + + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, fmt.Errorf("failed to get device path: %v", err) + } + mapper.MetricsProvider = volume.NewMetricsBlock(filepath.Join(blockPath, string(podUID))) + + return mapper, nil } func (plugin *azureDataDiskPlugin) NewBlockVolumeUnmapper(volName string, podUID types.UID) (volume.BlockVolumeUnmapper, error) { @@ -121,6 +129,7 @@ func (plugin *azureDataDiskPlugin) newUnmapperInternal(volName string, podUID ty type azureDataDiskUnmapper struct { *dataDisk + volume.MetricsNil } var _ volume.BlockVolumeUnmapper = &azureDataDiskUnmapper{} @@ -149,3 +158,9 @@ func (disk *dataDisk) GetPodDeviceMapPath() (string, string) { name := azureDataDiskPluginName return disk.plugin.host.GetPodVolumeDeviceDir(disk.podUID, utilstrings.EscapeQualifiedName(name)), disk.volumeName } + +// SupportsMetrics returns true for azureDataDiskMapper as it initializes the +// MetricsProvider. +func (addm *azureDataDiskMapper) SupportsMetrics() bool { + return true +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_mounter.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_mounter.go index 84bfb019f367..38d1e59403c4 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_mounter.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_mounter.go @@ -176,7 +176,7 @@ func (u *azureDiskUnmounter) TearDown() error { func (u *azureDiskUnmounter) TearDownAt(dir string) error { if pathExists, pathErr := mount.PathExists(dir); pathErr != nil { - return fmt.Errorf("Error checking if path exists: %v", pathErr) + return fmt.Errorf("error checking if path exists: %w", pathErr) } else if !pathExists { klog.Warningf("Warning: Unmount skipped because path does not exist: %v", dir) return nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_provision.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_provision.go index 04ba25db27dd..dd523b50831a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_provision.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/azuredd/azure_provision.go @@ -361,19 +361,19 @@ func (p *azureDiskProvisioner) Provision(selectedNode *v1.Node, allowedTopologie }) } } else { - // Set node affinity labels based on fault domains. + // Set node affinity labels based on topology. // This is required because unzoned AzureDisk can't be attached to zoned nodes. - // There are at most 3 fault domains available in each region. + // There are at most 3 Availability Zones per supported Azure region. // Refer https://docs.microsoft.com/en-us/azure/virtual-machines/windows/manage-availability. for i := 0; i < 3; i++ { requirements := []v1.NodeSelectorRequirement{ { - Key: v1.LabelFailureDomainBetaRegion, + Key: v1.LabelTopologyRegion, Operator: v1.NodeSelectorOpIn, Values: []string{diskController.GetLocation()}, }, { - Key: v1.LabelFailureDomainBetaZone, + Key: v1.LabelTopologyZone, Operator: v1.NodeSelectorOpIn, Values: []string{strconv.Itoa(i)}, }, diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cephfs/cephfs.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cephfs/cephfs.go index 20a4119ae09c..9e997e35f554 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cephfs/cephfs.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cephfs/cephfs.go @@ -103,11 +103,11 @@ func (plugin *cephfsPlugin) NewMounter(spec *volume.Spec, pod *v1.Pod, _ volume. // if secret is provideded, retrieve it kubeClient := plugin.host.GetKubeClient() if kubeClient == nil { - return nil, fmt.Errorf("Cannot get kube client") + return nil, fmt.Errorf("cannot get kube client") } secrets, err := kubeClient.CoreV1().Secrets(secretNs).Get(context.TODO(), secretName, metav1.GetOptions{}) if err != nil { - err = fmt.Errorf("Couldn't get secret %v/%v err: %v", secretNs, secretName, err) + err = fmt.Errorf("couldn't get secret %v/%v err: %w", secretNs, secretName, err) return nil, err } for name, data := range secrets.Data { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/attacher.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/attacher.go index 8f30b17e57d1..a882ba33879d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/attacher.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/attacher.go @@ -102,7 +102,7 @@ func (attacher *cinderDiskAttacher) waitOperationFinished(volumeID string) error }) if err == wait.ErrWaitTimeout { - err = fmt.Errorf("Volume %q is %s, can't finish within the alloted time", volumeID, volumeStatus) + err = fmt.Errorf("volume %q is %s, can't finish within the alloted time", volumeID, volumeStatus) } return err @@ -124,7 +124,7 @@ func (attacher *cinderDiskAttacher) waitDiskAttached(instanceID, volumeID string }) if err == wait.ErrWaitTimeout { - err = fmt.Errorf("Volume %q failed to be attached within the alloted time", volumeID) + err = fmt.Errorf("volume %q failed to be attached within the alloted time", volumeID) } return err @@ -346,7 +346,7 @@ func (detacher *cinderDiskDetacher) waitOperationFinished(volumeID string) error }) if err == wait.ErrWaitTimeout { - err = fmt.Errorf("Volume %q is %s, can't finish within the alloted time", volumeID, volumeStatus) + err = fmt.Errorf("volume %q is %s, can't finish within the alloted time", volumeID, volumeStatus) } return err @@ -368,7 +368,7 @@ func (detacher *cinderDiskDetacher) waitDiskDetached(instanceID, volumeID string }) if err == wait.ErrWaitTimeout { - err = fmt.Errorf("Volume %q failed to detach within the alloted time", volumeID) + err = fmt.Errorf("volume %q failed to detach within the alloted time", volumeID) } return err diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder.go index 98d5c2690b68..26e824e8275b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder.go @@ -135,11 +135,11 @@ func (plugin *cinderPlugin) GetVolumeLimits() (map[string]int64, error) { // default values from here will mean, no one can // override them. if cloud == nil { - return nil, fmt.Errorf("No cloudprovider present") + return nil, fmt.Errorf("no cloudprovider present") } if cloud.ProviderName() != openstack.ProviderName { - return nil, fmt.Errorf("Expected Openstack cloud, found %s", cloud.ProviderName()) + return nil, fmt.Errorf("expected Openstack cloud, found %s", cloud.ProviderName()) } openstackCloud, ok := cloud.(*openstack.OpenStack) @@ -477,9 +477,9 @@ func (c *cinderVolumeUnmounter) TearDown() error { // resource was the last reference to that disk on the kubelet. func (c *cinderVolumeUnmounter) TearDownAt(dir string) error { if pathExists, pathErr := mount.PathExists(dir); pathErr != nil { - return fmt.Errorf("Error checking if path exists: %v", pathErr) + return fmt.Errorf("error checking if path exists: %v", pathErr) } else if !pathExists { - klog.Warningf("Warning: Unmount skipped because path does not exist: %v", dir) + klog.Warningf("Warning: Unmount skipped because path does not exist: %w", dir) return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder_block.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder_block.go index b20680afcb93..ae3ab169b8e1 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder_block.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder_block.go @@ -101,7 +101,7 @@ func (plugin *cinderPlugin) newBlockVolumeMapperInternal(spec *volume.Spec, podU return nil, err } - return &cinderVolumeMapper{ + mapper := &cinderVolumeMapper{ cinderVolume: &cinderVolume{ podUID: podUID, volName: spec.Name(), @@ -111,7 +111,16 @@ func (plugin *cinderPlugin) newBlockVolumeMapperInternal(spec *volume.Spec, podU mounter: mounter, plugin: plugin, }, - readOnly: readOnly}, nil + readOnly: readOnly, + } + + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, fmt.Errorf("failed to get device path: %v", err) + } + mapper.MetricsProvider = volume.NewMetricsBlock(filepath.Join(blockPath, string(podUID))) + + return mapper, nil } func (plugin *cinderPlugin) NewBlockVolumeUnmapper(volName string, podUID types.UID) (volume.BlockVolumeUnmapper, error) { @@ -131,6 +140,7 @@ func (plugin *cinderPlugin) newUnmapperInternal(volName string, podUID types.UID type cinderPluginUnmapper struct { *cinderVolume + volume.MetricsNil } var _ volume.BlockVolumeUnmapper = &cinderPluginUnmapper{} @@ -159,3 +169,9 @@ func (cd *cinderVolume) GetPodDeviceMapPath() (string, string) { name := cinderVolumePluginName return cd.plugin.host.GetPodVolumeDeviceDir(cd.podUID, utilstrings.EscapeQualifiedName(name)), cd.volName } + +// SupportsMetrics returns true for cinderVolumeMapper as it initializes the +// MetricsProvider. +func (cvm *cinderVolumeMapper) SupportsMetrics() bool { + return true +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder_util.go index 734c6abe60c4..2fe0c1071a48 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/cinder/cinder_util.go @@ -77,7 +77,7 @@ func (util *DiskUtil) AttachDisk(b *cinderVolumeMounter, globalPDPath string) er } numTries++ if numTries == 10 { - return errors.New("Could not attach disk: Timeout after 60s") + return errors.New("could not attach disk: Timeout after 60s") } time.Sleep(time.Second * 6) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/configmap/configmap.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/configmap/configmap.go index 6a90aafc2be0..607587938f1c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/configmap/configmap.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/configmap/configmap.go @@ -268,7 +268,7 @@ func (b *configMapVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterA // MakePayload function is exported so that it can be called from the projection volume driver func MakePayload(mappings []v1.KeyToPath, configMap *v1.ConfigMap, defaultMode *int32, optional bool) (map[string]volumeutil.FileProjection, error) { if defaultMode == nil { - return nil, fmt.Errorf("No defaultMode used, not even the default value for it") + return nil, fmt.Errorf("no defaultMode used, not even the default value for it") } payload := make(map[string]volumeutil.FileProjection, (len(configMap.Data) + len(configMap.BinaryData))) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_attacher.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_attacher.go index 2cb6ec7bc8e8..59548e3944bf 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_attacher.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_attacher.go @@ -628,10 +628,7 @@ func getAttachmentName(volName, csiDriverName, nodeName string) string { // and false otherwise func isAttachmentName(unknownString string) bool { // 68 == "csi-" + len(sha256hash) - if strings.HasPrefix(unknownString, "csi-") && len(unknownString) == 68 { - return true - } - return false + return strings.HasPrefix(unknownString, "csi-") && len(unknownString) == 68 } func makeDeviceMountPath(plugin *csiPlugin, spec *volume.Spec) (string, error) { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_block.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_block.go index 687f2bc43859..7d768768ccca 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_block.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_block.go @@ -115,6 +115,12 @@ func (m *csiBlockMapper) GetStagingPath() string { return filepath.Join(m.plugin.host.GetVolumeDevicePluginDir(CSIPluginName), "staging", m.specName) } +// SupportsMetrics returns true for csiBlockMapper as it initializes the +// MetricsProvider. +func (m *csiBlockMapper) SupportsMetrics() bool { + return true +} + // getPublishDir returns path to a directory, where the volume is published to each pod. // Example: plugins/kubernetes.io/csi/volumeDevices/publish/{specName} func (m *csiBlockMapper) getPublishDir() string { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_plugin.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_plugin.go index 207b6e587dcb..e48b3d6deb74 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_plugin.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/csi_plugin.go @@ -287,7 +287,7 @@ func initializeCSINode(host volume.VolumeHost) error { klog.V(4).Infof("Initializing migrated drivers on CSINode") err := nim.InitializeCSINodeWithAnnotation() if err != nil { - kvh.SetKubeletError(fmt.Errorf("Failed to initialize CSINode: %v", err)) + kvh.SetKubeletError(fmt.Errorf("failed to initialize CSINode: %v", err)) klog.Errorf("Failed to initialize CSINode: %v", err) return false, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/expander.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/expander.go index 79f856a2feb9..0d4e9b26d262 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/expander.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csi/expander.go @@ -143,8 +143,5 @@ func inUseError(err error) bool { // if this is a failed precondition error then that means driver does not support expansion // of in-use volumes // More info - https://github.com/container-storage-interface/spec/blob/master/spec.md#controllerexpandvolume-errors - if st.Code() == codes.FailedPrecondition { - return true - } - return false + return st.Code() == codes.FailedPrecondition } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csimigration/plugin_manager.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csimigration/plugin_manager.go index 8870d12c3b38..ed0259df99db 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csimigration/plugin_manager.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/csimigration/plugin_manager.go @@ -71,7 +71,7 @@ func (pm PluginManager) IsMigrationCompleteForPlugin(pluginName string) bool { case csilibplugins.CinderInTreePluginName: return pm.featureGate.Enabled(features.InTreePluginOpenStackUnregister) case csilibplugins.VSphereInTreePluginName: - return pm.featureGate.Enabled(features.CSIMigrationvSphereComplete) || pm.featureGate.Enabled(features.InTreePluginvSphereUnregister) + return pm.featureGate.Enabled(features.InTreePluginvSphereUnregister) default: return false } @@ -152,21 +152,13 @@ func TranslateInTreeSpecToCSI(spec *volume.Spec, podNamespace string, translator // CheckMigrationFeatureFlags checks the configuration of feature flags related // to CSI Migration is valid. It will return whether the migration is complete -// by looking up the pluginMigrationComplete and pluginUnregister flag +// by looking up the pluginUnregister flag func CheckMigrationFeatureFlags(f featuregate.FeatureGate, pluginMigration, - pluginMigrationComplete, pluginUnregister featuregate.Feature) (migrationComplete bool, err error) { + pluginUnregister featuregate.Feature) (migrationComplete bool, err error) { if f.Enabled(pluginMigration) && !f.Enabled(features.CSIMigration) { return false, fmt.Errorf("enabling %q requires CSIMigration to be enabled", pluginMigration) } - // TODO: Remove the following two checks once the CSIMigrationXXComplete flag is removed - if pluginMigrationComplete != "" && f.Enabled(pluginMigrationComplete) && !f.Enabled(pluginMigration) { - return false, fmt.Errorf("enabling %q requires %q to be enabled", pluginMigrationComplete, pluginMigration) - } - // This is only needed for vSphere since we will deprecate the CSIMigrationvSphereComplete flag soon - if pluginMigrationComplete != "" && f.Enabled(features.CSIMigration) && - f.Enabled(pluginMigration) && f.Enabled(pluginMigrationComplete) { - return true, nil - } + // This is for other in-tree plugin that get migration finished if f.Enabled(pluginMigration) && f.Enabled(pluginUnregister) { return true, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/downwardapi/downwardapi.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/downwardapi/downwardapi.go index bf5ee6ff1e42..9e3dedba4726 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/downwardapi/downwardapi.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/downwardapi/downwardapi.go @@ -244,7 +244,7 @@ func (b *downwardAPIVolumeMounter) SetUpAt(dir string, mounterArgs volume.Mounte // Note: this function is exported so that it can be called from the projection volume driver func CollectData(items []v1.DownwardAPIVolumeFile, pod *v1.Pod, host volume.VolumeHost, defaultMode *int32) (map[string]volumeutil.FileProjection, error) { if defaultMode == nil { - return nil, fmt.Errorf("No defaultMode used, not even the default value for it") + return nil, fmt.Errorf("no defaultMode used, not even the default value for it") } errlist := []error{} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/emptydir/empty_dir.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/emptydir/empty_dir.go index f2bf8e2f3334..9b5f424e20b3 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/emptydir/empty_dir.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/emptydir/empty_dir.go @@ -88,10 +88,7 @@ func (plugin *emptyDirPlugin) GetVolumeName(spec *volume.Spec) (string, error) { } func (plugin *emptyDirPlugin) CanSupport(spec *volume.Spec) bool { - if spec.Volume != nil && spec.Volume.EmptyDir != nil { - return true - } - return false + return spec.Volume != nil && spec.Volume.EmptyDir != nil } func (plugin *emptyDirPlugin) RequiresRemount(spec *volume.Spec) bool { @@ -489,7 +486,7 @@ func (ed *emptyDir) TearDownAt(dir string) error { } if pathExists, pathErr := mount.PathExists(dir); pathErr != nil { - return fmt.Errorf("Error checking if path exists: %v", pathErr) + return fmt.Errorf("error checking if path exists: %w", pathErr) } else if !pathExists { klog.Warningf("Warning: Unmount skipped because path does not exist: %v", dir) return nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/attacher.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/attacher.go index c94c95d47a63..7b6495106a3f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/attacher.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/attacher.go @@ -23,13 +23,13 @@ import ( "strings" "time" - "k8s.io/klog/v2" - "k8s.io/mount-utils" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/volume" volumeutil "k8s.io/kubernetes/pkg/volume/util" + "k8s.io/mount-utils" ) type fcAttacher struct { @@ -172,12 +172,28 @@ func (detacher *fcDetacher) UnmountDevice(deviceMountPath string) error { if devName == "" { return nil } + unMounter := volumeSpecToUnmounter(detacher.mounter, detacher.host) - err = detacher.manager.DetachDisk(*unMounter, devName) + // The device is unmounted now. If UnmountDevice was retried, GetDeviceNameFromMount + // won't find any mount and won't return DetachDisk below. + // Therefore implement our own retry mechanism here. + // E.g. DetachDisk sometimes fails to flush a multipath device with "device is busy" when it was + // just unmounted. + // 2 minutes should be enough within 6 minute force detach timeout. + var detachError error + err = wait.PollImmediate(10*time.Second, 2*time.Minute, func() (bool, error) { + detachError = detacher.manager.DetachDisk(*unMounter, devName) + if detachError != nil { + klog.V(4).Infof("fc: failed to detach disk %s (%s): %v", devName, deviceMountPath, detachError) + return false, nil + } + return true, nil + }) if err != nil { - return fmt.Errorf("fc: failed to detach disk: %s\nError: %v", devName, err) + return fmt.Errorf("fc: failed to detach disk: %s: %v", devName, detachError) } - klog.V(4).Infof("fc: successfully detached disk: %s", devName) + + klog.V(2).Infof("fc: successfully detached disk: %s", devName) return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/fc.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/fc.go index ce441cd9e442..6cdfa9253299 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/fc.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/fc.go @@ -26,6 +26,7 @@ import ( "k8s.io/klog/v2" "k8s.io/mount-utils" utilexec "k8s.io/utils/exec" + "k8s.io/utils/io" utilstrings "k8s.io/utils/strings" v1 "k8s.io/api/core/v1" @@ -171,7 +172,7 @@ func (plugin *fcPlugin) newBlockVolumeMapperInternal(spec *volume.Spec, podUID t return nil, fmt.Errorf("fc: no fc disk information found. failed to make a new mapper") } - return &fcDiskMapper{ + mapper := &fcDiskMapper{ fcDisk: &fcDisk{ podUID: podUID, volName: spec.Name(), @@ -184,7 +185,15 @@ func (plugin *fcPlugin) newBlockVolumeMapperInternal(spec *volume.Spec, podUID t readOnly: readOnly, mounter: &mount.SafeFormatAndMount{Interface: mounter, Exec: exec}, deviceUtil: util.NewDeviceHandler(util.NewIOHandler()), - }, nil + } + + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, fmt.Errorf("failed to get device path: %v", err) + } + mapper.MetricsProvider = volume.NewMetricsBlock(filepath.Join(blockPath, string(podUID))) + + return mapper, nil } func (plugin *fcPlugin) NewUnmounter(volName string, podUID types.UID) (volume.Unmounter, error) { @@ -231,8 +240,18 @@ func (plugin *fcPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volu // mountPath: pods/{podUid}/volumes/kubernetes.io~fc/{volumeName} // globalPDPath : plugins/kubernetes.io/fc/50060e801049cfd1-lun-0 var globalPDPath string + mounter := plugin.host.GetMounter(plugin.GetPluginName()) - paths, err := mounter.GetMountRefs(mountPath) + // Try really hard to get the global mount of the volume, an error returned from here would + // leave the global mount still mounted, while marking the volume as unused. + // The volume can then be mounted on several nodes, resulting in volume + // corruption. + paths, err := util.GetReliableMountRefs(mounter, mountPath) + if io.IsInconsistentReadError(err) { + klog.Errorf("Failed to read mount refs from /proc/mounts for %s: %s", mountPath, err) + klog.Errorf("Kubelet cannot unmount volume at %s, please unmount it manually", mountPath) + return nil, err + } if err != nil { return nil, err } @@ -393,6 +412,7 @@ func (c *fcDiskUnmounter) TearDownAt(dir string) error { // Block Volumes Support type fcDiskMapper struct { *fcDisk + volume.MetricsProvider readOnly bool mounter mount.Interface deviceUtil util.DeviceUtil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/fc_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/fc_util.go index 806fef607d9c..94f5c7a9452f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/fc_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/fc/fc_util.go @@ -329,7 +329,7 @@ func (util *fcUtil) DetachBlockFCDisk(c fcDiskUnmapper, mapPath, devicePath stri // Retrieve volume plugin dependent path like '50060e801049cfd1-lun-0' from global map path arr := strings.Split(mapPath, "/") if len(arr) < 1 { - return fmt.Errorf("Fail to retrieve volume plugin information from global map path: %v", mapPath) + return fmt.Errorf("failed to retrieve volume plugin information from global map path: %v", mapPath) } volumeInfo := arr[len(arr)-1] @@ -402,7 +402,7 @@ func (util *fcUtil) deleteMultipathDevice(exec utilexec.Interface, dmDevice stri func checkPathExists(path string) (bool, error) { if pathExists, pathErr := mount.PathExists(path); pathErr != nil { - return pathExists, fmt.Errorf("Error checking if path exists: %v", pathErr) + return pathExists, fmt.Errorf("error checking if path exists: %w", pathErr) } else if !pathExists { klog.Warningf("Warning: Unmap skipped because path does not exist: %v", path) return pathExists, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/detacher.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/detacher.go index 3457c108b1bb..ee2849b5aa2f 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/detacher.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/detacher.go @@ -58,7 +58,7 @@ func (d *flexVolumeDetacher) UnmountDevice(deviceMountPath string) error { return nil } if pathErr != nil && !mount.IsCorruptedMnt(pathErr) { - return fmt.Errorf("Error checking path: %v", pathErr) + return fmt.Errorf("error checking path: %w", pathErr) } notmnt, err := isNotMounted(d.plugin.host.GetMounter(d.plugin.GetPluginName()), deviceMountPath) @@ -87,7 +87,7 @@ func (d *flexVolumeDetacher) UnmountDevice(deviceMountPath string) error { // Flexvolume driver may remove the directory. Ignore if it does. if pathExists, pathErr := mount.PathExists(deviceMountPath); pathErr != nil { - return fmt.Errorf("Error checking if path exists: %v", pathErr) + return fmt.Errorf("error checking if path exists: %w", pathErr) } else if !pathExists { return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/driver-call.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/driver-call.go index 55617e7c3fc4..ec0e74c3b82e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/driver-call.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/driver-call.go @@ -69,7 +69,7 @@ const ( ) var ( - errTimeout = fmt.Errorf("Timeout") + errTimeout = fmt.Errorf("timeout") ) // DriverCall implements the basic contract between FlexVolume and its driver. @@ -108,7 +108,7 @@ func (dc *DriverCall) AppendSpec(spec *volume.Spec, host volume.VolumeHost, extr jsonBytes, err := json.Marshal(optionsForDriver) if err != nil { - return fmt.Errorf("Failed to marshal spec, error: %s", err.Error()) + return fmt.Errorf("failed to marshal spec, error: %s", err.Error()) } dc.Append(string(jsonBytes)) @@ -249,11 +249,7 @@ func defaultCapabilities() *DriverCapabilities { // isCmdNotSupportedErr checks if the error corresponds to command not supported by // driver. func isCmdNotSupportedErr(err error) bool { - if err != nil && err.Error() == StatusNotSupported { - return true - } - - return false + return err != nil && err.Error() == StatusNotSupported } // handleCmdResponse processes the command output and returns the appropriate diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/probe.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/probe.go index 965c97fba7b0..0579cc18dff8 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/probe.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/probe.go @@ -104,7 +104,7 @@ func (prober *flexVolumeProber) probeAll() (events []volume.ProbeEvent, err erro allErrs := []error{} files, err := prober.fs.ReadDir(prober.pluginDir) if err != nil { - return nil, fmt.Errorf("Error reading the Flexvolume directory: %s", err) + return nil, fmt.Errorf("error reading the Flexvolume directory: %s", err) } for _, f := range files { // only directories with names that do not begin with '.' are counted as plugins @@ -132,7 +132,7 @@ func (prober *flexVolumeProber) newProbeEvent(driverDirName string, op volume.Pr plugin, pluginErr := prober.factory.NewFlexVolumePlugin(prober.pluginDir, driverDirName, prober.runner) if pluginErr != nil { pluginErr = fmt.Errorf( - "Error creating Flexvolume plugin from directory %s, skipping. Error: %s", + "error creating Flexvolume plugin from directory %s, skipping. Error: %s", driverDirName, pluginErr) return probeEvent, pluginErr } @@ -250,11 +250,11 @@ func (prober *flexVolumeProber) initWatcher() error { klog.Errorf("Received an error from watcher: %s", err) }) if err != nil { - return fmt.Errorf("Error initializing watcher: %s", err) + return fmt.Errorf("error initializing watcher: %s", err) } if err := prober.addWatchRecursive(prober.pluginDir); err != nil { - return fmt.Errorf("Error adding watch on Flexvolume directory: %s", err) + return fmt.Errorf("error adding watch on Flexvolume directory: %s", err) } prober.watcher.Run() @@ -268,7 +268,7 @@ func (prober *flexVolumeProber) createPluginDir() error { klog.Warningf("Flexvolume plugin directory at %s does not exist. Recreating.", prober.pluginDir) err := prober.fs.MkdirAll(prober.pluginDir, 0755) if err != nil { - return fmt.Errorf("Error (re-)creating driver directory: %s", err) + return fmt.Errorf("error (re-)creating driver directory: %s", err) } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/unmounter.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/unmounter.go index ae0fbc7e6773..d31469d7df42 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/unmounter.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/unmounter.go @@ -66,7 +66,7 @@ func (f *flexVolumeUnmounter) TearDownAt(dir string) error { // Flexvolume driver may remove the directory. Ignore if it does. if pathExists, pathErr := mount.PathExists(dir); pathErr != nil { - return fmt.Errorf("Error checking if path exists: %v", pathErr) + return fmt.Errorf("error checking if path exists: %w", pathErr) } else if !pathExists { return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/util.go index b87127d63ab4..7440ca7d7e49 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/util.go @@ -40,12 +40,12 @@ func addSecretsToOptions(options map[string]string, spec *volume.Spec, namespace kubeClient := host.GetKubeClient() if kubeClient == nil { - return fmt.Errorf("Cannot get kube client") + return fmt.Errorf("cannot get kube client") } secrets, err := util.GetSecretForPV(secretNamespace, secretName, driverName, host.GetKubeClient()) if err != nil { - err = fmt.Errorf("Couldn't get secret %v/%v err: %v", secretNamespace, secretName, err) + err = fmt.Errorf("couldn't get secret %v/%v err: %w", secretNamespace, secretName, err) return err } for name, data := range secrets { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flocker/flocker.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flocker/flocker.go index e1c7f246b305..74eedc7220e6 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flocker/flocker.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flocker/flocker.go @@ -200,7 +200,7 @@ func (b *flockerVolume) GetDatasetUUID() (datasetUUID string, err error) { } if b.flockerClient == nil { - return "", fmt.Errorf("Flocker client is not initialized") + return "", fmt.Errorf("flocker client is not initialized") } // lookup in flocker API otherwise @@ -285,12 +285,12 @@ func (b *flockerVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArg datasetUUID, err := b.GetDatasetUUID() if err != nil { - return fmt.Errorf("The datasetUUID for volume with datasetName='%s' can not be found using flocker: %s", b.datasetName, err) + return fmt.Errorf("the datasetUUID for volume with datasetName='%s' can not be found using flocker: %s", b.datasetName, err) } datasetState, err := b.flockerClient.GetDatasetState(datasetUUID) if err != nil { - return fmt.Errorf("The datasetState for volume with datasetUUID='%s' could not determinted uusing flocker: %s", datasetUUID, err) + return fmt.Errorf("the datasetState for volume with datasetUUID='%s' could not determinted uusing flocker: %s", datasetUUID, err) } primaryUUID, err := b.flockerClient.GetPrimaryUUID() @@ -304,7 +304,7 @@ func (b *flockerVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArg } _, err := b.flockerClient.GetDatasetState(datasetUUID) if err != nil { - return fmt.Errorf("The volume with datasetUUID='%s' migrated unsuccessfully", datasetUUID) + return fmt.Errorf("the volume with datasetUUID='%s' migrated unsuccessfully", datasetUUID) } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flocker/flocker_volume.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flocker/flocker_volume.go index 3ce91874de8a..2cc043b4af52 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flocker/flocker_volume.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/flocker/flocker_volume.go @@ -60,11 +60,11 @@ func (c *flockerVolumeProvisioner) Provision(selectedNode *v1.Node, allowedTopol } if len(c.options.Parameters) > 0 { - return nil, fmt.Errorf("Provisioning failed: Specified at least one unsupported parameter") + return nil, fmt.Errorf("provisioning failed: Specified at least one unsupported parameter") } if c.options.PVC.Spec.Selector != nil { - return nil, fmt.Errorf("Provisioning failed: Specified unsupported selector") + return nil, fmt.Errorf("provisioning failed: Specified unsupported selector") } if util.CheckPersistentVolumeClaimModeBlock(c.options.PVC) { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/gcepd/gce_pd_block.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/gcepd/gce_pd_block.go index 3811483c1e1d..59c9c524653d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/gcepd/gce_pd_block.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/gcepd/gce_pd_block.go @@ -108,7 +108,7 @@ func (plugin *gcePersistentDiskPlugin) newBlockVolumeMapperInternal(spec *volume partition = strconv.Itoa(int(volumeSource.Partition)) } - return &gcePersistentDiskMapper{ + mapper := &gcePersistentDiskMapper{ gcePersistentDisk: &gcePersistentDisk{ volName: spec.Name(), podUID: podUID, @@ -118,7 +118,16 @@ func (plugin *gcePersistentDiskPlugin) newBlockVolumeMapperInternal(spec *volume mounter: mounter, plugin: plugin, }, - readOnly: readOnly}, nil + readOnly: readOnly, + } + + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, fmt.Errorf("failed to get device path: %v", err) + } + mapper.MetricsProvider = volume.NewMetricsBlock(filepath.Join(blockPath, string(podUID))) + + return mapper, nil } func (plugin *gcePersistentDiskPlugin) NewBlockVolumeUnmapper(volName string, podUID types.UID) (volume.BlockVolumeUnmapper, error) { @@ -165,3 +174,9 @@ func (pd *gcePersistentDisk) GetPodDeviceMapPath() (string, string) { name := gcePersistentDiskPluginName return pd.plugin.host.GetPodVolumeDeviceDir(pd.podUID, utilstrings.EscapeQualifiedName(name)), pd.volName } + +// SupportsMetrics returns true for gcePersistentDisk as it initializes the +// MetricsProvider. +func (pd *gcePersistentDisk) SupportsMetrics() bool { + return true +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi.go index 8017c2d0d1e9..2e4c8873af59 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi.go @@ -27,6 +27,7 @@ import ( "k8s.io/klog/v2" "k8s.io/mount-utils" utilexec "k8s.io/utils/exec" + "k8s.io/utils/io" "k8s.io/utils/keymutex" utilstrings "k8s.io/utils/strings" @@ -34,6 +35,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/kubernetes/pkg/volume" + "k8s.io/kubernetes/pkg/volume/util" ioutil "k8s.io/kubernetes/pkg/volume/util" "k8s.io/kubernetes/pkg/volume/util/volumepathhandler" ) @@ -161,12 +163,20 @@ func (plugin *iscsiPlugin) newBlockVolumeMapperInternal(spec *volume.Spec, podUI if err != nil { return nil, err } - return &iscsiDiskMapper{ + mapper := &iscsiDiskMapper{ iscsiDisk: iscsiDisk, readOnly: readOnly, exec: exec, deviceUtil: ioutil.NewDeviceHandler(ioutil.NewIOHandler()), - }, nil + } + + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, fmt.Errorf("failed to get device path: %v", err) + } + mapper.MetricsProvider = volume.NewMetricsBlock(filepath.Join(blockPath, string(podUID))) + + return mapper, nil } func (plugin *iscsiPlugin) NewUnmounter(volName string, podUID types.UID) (volume.Unmounter, error) { @@ -210,10 +220,20 @@ func (plugin *iscsiPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*v // Find globalPDPath from pod volume directory(mountPath) var globalPDPath string mounter := plugin.host.GetMounter(plugin.GetPluginName()) - paths, err := mounter.GetMountRefs(mountPath) + // Try really hard to get the global mount of the volume, an error returned from here would + // leave the global mount still mounted, while marking the volume as unused. + // The volume can then be mounted on several nodes, resulting in volume + // corruption. + paths, err := util.GetReliableMountRefs(mounter, mountPath) + if io.IsInconsistentReadError(err) { + klog.Errorf("Failed to read mount refs from /proc/mounts for %s: %s", mountPath, err) + klog.Errorf("Kubelet cannot unmount volume at %s, please unmount it and all mounts of the same device manually.", mountPath) + return nil, err + } if err != nil { return nil, err } + for _, path := range paths { if strings.Contains(path, plugin.host.GetPluginDir(iscsiPluginName)) { globalPDPath = path @@ -385,6 +405,13 @@ type iscsiDiskUnmapper struct { *iscsiDisk exec utilexec.Interface deviceUtil ioutil.DeviceUtil + volume.MetricsNil +} + +// SupportsMetrics returns true for SupportsMetrics as it initializes the +// MetricsProvider. +func (idm *iscsiDiskMapper) SupportsMetrics() bool { + return true } var _ volume.BlockVolumeUnmapper = &iscsiDiskUnmapper{} @@ -589,11 +616,11 @@ func createSecretMap(spec *volume.Spec, plugin *iscsiPlugin, namespace string) ( // if secret is provideded, retrieve it kubeClient := plugin.host.GetKubeClient() if kubeClient == nil { - return nil, fmt.Errorf("Cannot get kube client") + return nil, fmt.Errorf("cannot get kube client") } secretObj, err := kubeClient.CoreV1().Secrets(secretNamespace).Get(context.TODO(), secretName, metav1.GetOptions{}) if err != nil { - err = fmt.Errorf("Couldn't get secret %v/%v error: %v", secretNamespace, secretName, err) + err = fmt.Errorf("couldn't get secret %v/%v error: %w", secretNamespace, secretName, err) return nil, err } secret = make(map[string]string) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi_util.go index 7f1e0daf5041..25a7b30bfe0d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/iscsi/iscsi_util.go @@ -253,7 +253,7 @@ func scanOneLun(hostNumber int, lunNumber int) error { if written, err := fd.WriteString(scanCmd); err != nil { return err } else if 0 == written { - return fmt.Errorf("No data written to file: %s", filename) + return fmt.Errorf("no data written to file: %s", filename) } klog.V(3).Infof("Scanned SCSI host %d LUN %d", hostNumber, lunNumber) @@ -404,7 +404,7 @@ func (util *ISCSIUtil) AttachDisk(b iscsiDiskMounter) (string, error) { if iscsiTransport == "" { klog.Errorf("iscsi: could not find transport name in iface %s", b.Iface) - return "", fmt.Errorf("Could not parse iface file for %s", b.Iface) + return "", fmt.Errorf("could not parse iface file for %s", b.Iface) } if iscsiTransport == "tcp" { devicePath = strings.Join([]string{"/dev/disk/by-path/ip", tp, "iscsi", b.Iqn, "lun", b.Lun}, "-") @@ -524,7 +524,7 @@ func deleteDevice(deviceName string) error { if written, err := fd.WriteString("1"); err != nil { return err } else if 0 == written { - return fmt.Errorf("No data written to file: %s", filename) + return fmt.Errorf("no data written to file: %s", filename) } klog.V(4).Infof("Deleted block device: %s", deviceName) return nil @@ -576,7 +576,7 @@ func deleteDevices(c iscsiDiskUnmounter) error { // DetachDisk unmounts and detaches a volume from node func (util *ISCSIUtil) DetachDisk(c iscsiDiskUnmounter, mntPath string) error { if pathExists, pathErr := mount.PathExists(mntPath); pathErr != nil { - return fmt.Errorf("Error checking if path exists: %v", pathErr) + return fmt.Errorf("error checking if path exists: %w", pathErr) } else if !pathExists { klog.Warningf("Warning: Unmount skipped because path does not exist: %v", mntPath) return nil @@ -652,7 +652,7 @@ func (util *ISCSIUtil) DetachDisk(c iscsiDiskUnmounter, mntPath string) error { // DetachBlockISCSIDisk removes loopback device for a volume and detaches a volume from node func (util *ISCSIUtil) DetachBlockISCSIDisk(c iscsiDiskUnmapper, mapPath string) error { if pathExists, pathErr := mount.PathExists(mapPath); pathErr != nil { - return fmt.Errorf("Error checking if path exists: %v", pathErr) + return fmt.Errorf("error checking if path exists: %w", pathErr) } else if !pathExists { klog.Warningf("Warning: Unmap skipped because path does not exist: %v", mapPath) return nil @@ -838,7 +838,7 @@ func parseIscsiadmShow(output string) (map[string]string, error) { } iface := strings.Fields(line) if len(iface) != 3 || iface[1] != "=" { - return nil, fmt.Errorf("Error: invalid iface setting: %v", iface) + return nil, fmt.Errorf("error: invalid iface setting: %v", iface) } // iscsi_ifacename is immutable once the iface is created if iface[0] == "iface.iscsi_ifacename" { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/local/local.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/local/local.go index 81a2f9424c8d..b2cfa9b28f6b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/local/local.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/local/local.go @@ -161,7 +161,7 @@ func (plugin *localVolumePlugin) NewBlockVolumeMapper(spec *volume.Spec, pod *v1 return nil, err } - return &localVolumeMapper{ + mapper := &localVolumeMapper{ localVolume: &localVolume{ podUID: pod.UID, volName: spec.Name(), @@ -169,8 +169,15 @@ func (plugin *localVolumePlugin) NewBlockVolumeMapper(spec *volume.Spec, pod *v1 plugin: plugin, }, readOnly: readOnly, - }, nil + } + + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, fmt.Errorf("failed to get device path: %v", err) + } + mapper.MetricsProvider = volume.NewMetricsBlock(filepath.Join(blockPath, string(pod.UID))) + return mapper, nil } func (plugin *localVolumePlugin) NewBlockVolumeUnmapper(volName string, @@ -626,9 +633,16 @@ func (m *localVolumeMapper) GetStagingPath() string { return "" } +// SupportsMetrics returns true for SupportsMetrics as it initializes the +// MetricsProvider. +func (m *localVolumeMapper) SupportsMetrics() bool { + return true +} + // localVolumeUnmapper implements the BlockVolumeUnmapper interface for local volumes. type localVolumeUnmapper struct { *localVolume + volume.MetricsNil } var _ volume.BlockVolumeUnmapper = &localVolumeUnmapper{} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_block.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_block.go new file mode 100644 index 000000000000..e0145ae91af1 --- /dev/null +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_block.go @@ -0,0 +1,87 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package volume + +import ( + "fmt" + "io" + "os" + "runtime" + + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +var _ MetricsProvider = &metricsBlock{} + +// metricsBlock represents a MetricsProvider that detects the size of the +// BlockMode Volume. +type metricsBlock struct { + // the device node where the volume is attached to. + device string +} + +// NewMetricsStatfs creates a new metricsBlock with the device node of the +// Volume. +func NewMetricsBlock(device string) MetricsProvider { + return &metricsBlock{device} +} + +// See MetricsProvider.GetMetrics +// GetMetrics detects the size of the BlockMode volume for the device node +// where the Volume is attached. +// +// Note that only the capacity of the device can be detected with standard +// tools. Storage systems may have more information that they can provide by +// going through specialized APIs. +func (mb *metricsBlock) GetMetrics() (*Metrics, error) { + // TODO: Windows does not yet support VolumeMode=Block + if runtime.GOOS == "windows" { + return nil, NewNotImplementedError("Windows does not support Block volumes") + } + + metrics := &Metrics{Time: metav1.Now()} + if mb.device == "" { + return metrics, NewNoPathDefinedError() + } + + err := mb.getBlockInfo(metrics) + if err != nil { + return metrics, err + } + + return metrics, nil +} + +// getBlockInfo fetches metrics.Capacity by opening the device and seeking to +// the end. +func (mb *metricsBlock) getBlockInfo(metrics *Metrics) error { + dev, err := os.Open(mb.device) + if err != nil { + return fmt.Errorf("unable to open device %q: %w", mb.device, err) + } + defer dev.Close() + + end, err := dev.Seek(0, io.SeekEnd) + if err != nil { + return fmt.Errorf("failed to detect size of %q: %w", mb.device, err) + } + + metrics.Capacity = resource.NewQuantity(end, resource.BinarySI) + + return nil +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_errors.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_errors.go index a6cbdbf72034..0f7987e0936b 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_errors.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_errors.go @@ -35,6 +35,14 @@ func NewNotSupportedError() *MetricsError { } } +// NewNotImplementedError creates a new MetricsError with code NotSupported. +func NewNotImplementedError(reason string) *MetricsError { + return &MetricsError{ + Code: ErrCodeNotSupported, + Msg: fmt.Sprintf("metrics support is not implemented: %s", reason), + } +} + // NewNotSupportedErrorWithDriverName creates a new MetricsError with code NotSupported. // driver name is added to the error message. func NewNotSupportedErrorWithDriverName(name string) *MetricsError { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_nil.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_nil.go index 5438dc3de353..11b74e079785 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_nil.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/metrics_nil.go @@ -23,6 +23,11 @@ var _ MetricsProvider = &MetricsNil{} // metrics. type MetricsNil struct{} +// SupportsMetrics returns false for the MetricsNil type. +func (*MetricsNil) SupportsMetrics() bool { + return false +} + // GetMetrics returns an empty Metrics and an error. // See MetricsProvider.GetMetrics func (*MetricsNil) GetMetrics() (*Metrics, error) { diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/nfs/nfs.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/nfs/nfs.go index db906a7b799d..5ad1d9c7372e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/nfs/nfs.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/nfs/nfs.go @@ -18,6 +18,7 @@ package nfs import ( "fmt" + netutil "k8s.io/utils/net" "os" "runtime" "time" @@ -121,7 +122,6 @@ func (plugin *nfsPlugin) newMounterInternal(spec *volume.Spec, pod *v1.Pod, moun if err != nil { return nil, err } - return &nfsMounter{ nfs: &nfs{ volName: spec.Name(), @@ -130,7 +130,7 @@ func (plugin *nfsPlugin) newMounterInternal(spec *volume.Spec, pod *v1.Pod, moun plugin: plugin, MetricsProvider: volume.NewMetricsStatFS(getPath(pod.UID, spec.Name(), plugin.host)), }, - server: source.Server, + server: getServerFromSource(source), exportPath: source.Path, readOnly: readOnly, mountOptions: util.MountOptionFromSpec(spec), @@ -206,15 +206,15 @@ func (nfsMounter *nfsMounter) CanMount() error { switch runtime.GOOS { case "linux": if _, err := exec.Command("test", "-x", "/sbin/mount.nfs").CombinedOutput(); err != nil { - return fmt.Errorf("Required binary /sbin/mount.nfs is missing") + return fmt.Errorf("required binary /sbin/mount.nfs is missing") } if _, err := exec.Command("test", "-x", "/sbin/mount.nfs4").CombinedOutput(); err != nil { - return fmt.Errorf("Required binary /sbin/mount.nfs4 is missing") + return fmt.Errorf("required binary /sbin/mount.nfs4 is missing") } return nil case "darwin": if _, err := exec.Command("test", "-x", "/sbin/mount_nfs").CombinedOutput(); err != nil { - return fmt.Errorf("Required binary /sbin/mount_nfs is missing") + return fmt.Errorf("required binary /sbin/mount_nfs is missing") } } return nil @@ -322,3 +322,10 @@ func getVolumeSource(spec *volume.Spec) (*v1.NFSVolumeSource, bool, error) { return nil, false, fmt.Errorf("Spec does not reference a NFS volume type") } + +func getServerFromSource(source *v1.NFSVolumeSource) string { + if netutil.IsIPv6String(source.Server) { + return fmt.Sprintf("[%s]", source.Server) + } + return source.Server +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/plugins.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/plugins.go index 3831ed216cd9..58ef46940d1d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/plugins.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/plugins.go @@ -71,8 +71,10 @@ const ( var ( deprecatedVolumeProviders = map[string]string{ - "kubernetes.io/cinder": "The Cinder volume provider is deprecated and will be removed in a future release", - "kubernetes.io/scaleio": "The ScaleIO volume provider is deprecated and will be removed in a future release", + "kubernetes.io/cinder": "The Cinder volume provider is deprecated and will be removed in a future release", + "kubernetes.io/storageos": "The StorageOS volume provider is deprecated and will be removed in a future release", + "kubernetes.io/quobyte": "The Quobyte volume provider is deprecated and will be removed in a future release", + "kubernetes.io/flocker": "The Flocker volume provider is deprecated and will be removed in a future release", } ) @@ -606,7 +608,7 @@ func (pm *VolumePluginMgr) InitPlugins(plugins []VolumePlugin, prober DynamicPlu } if err := pm.prober.Init(); err != nil { // Prober init failure should not affect the initialization of other plugins. - klog.Errorf("Error initializing dynamic plugin prober: %s", err) + klog.ErrorS(err, "Error initializing dynamic plugin prober") pm.prober = &dummyPluginProber{} } @@ -631,12 +633,12 @@ func (pm *VolumePluginMgr) InitPlugins(plugins []VolumePlugin, prober DynamicPlu } err := plugin.Init(host) if err != nil { - klog.Errorf("Failed to load volume plugin %s, error: %s", name, err.Error()) + klog.ErrorS(err, "Failed to load volume plugin", "pluginName", name) allErrs = append(allErrs, err) continue } pm.plugins[name] = plugin - klog.V(1).Infof("Loaded volume plugin %q", name) + klog.V(1).InfoS("Loaded volume plugin", "pluginName", name) } return utilerrors.NewAggregate(allErrs) } @@ -649,10 +651,10 @@ func (pm *VolumePluginMgr) initProbedPlugin(probedPlugin VolumePlugin) error { err := probedPlugin.Init(pm.Host) if err != nil { - return fmt.Errorf("Failed to load volume plugin %s, error: %s", name, err.Error()) + return fmt.Errorf("failed to load volume plugin %s, error: %s", name, err.Error()) } - klog.V(1).Infof("Loaded volume plugin %q", name) + klog.V(1).InfoS("Loaded volume plugin", "pluginName", name) return nil } @@ -664,7 +666,7 @@ func (pm *VolumePluginMgr) FindPluginBySpec(spec *Spec) (VolumePlugin, error) { defer pm.mutex.RUnlock() if spec == nil { - return nil, fmt.Errorf("Could not find plugin because volume spec is nil") + return nil, fmt.Errorf("could not find plugin because volume spec is nil") } matches := []VolumePlugin{} @@ -745,15 +747,15 @@ func (pm *VolumePluginMgr) logDeprecation(plugin string) { func (pm *VolumePluginMgr) refreshProbedPlugins() { events, err := pm.prober.Probe() if err != nil { - klog.Errorf("Error dynamically probing plugins: %s", err) + klog.ErrorS(err, "Error dynamically probing plugins") return // Use cached plugins upon failure. } for _, event := range events { if event.Op == ProbeAddOrUpdate { if err := pm.initProbedPlugin(event.Plugin); err != nil { - klog.Errorf("Error initializing dynamically probed plugin %s; error: %s", - event.Plugin.GetPluginName(), err) + klog.ErrorS(err, "Error initializing dynamically probed plugin", + "pluginName", event.Plugin.GetPluginName()) continue } pm.probedPlugins[event.Plugin.GetPluginName()] = event.Plugin @@ -761,8 +763,8 @@ func (pm *VolumePluginMgr) refreshProbedPlugins() { // Plugin is not available on ProbeRemove event, only PluginName delete(pm.probedPlugins, event.PluginName) } else { - klog.Errorf("Unknown Operation on PluginName: %s.", - event.Plugin.GetPluginName()) + klog.ErrorS(nil, "Unknown Operation on PluginName.", + "pluginName", event.Plugin.GetPluginName()) } } } @@ -787,7 +789,7 @@ func (pm *VolumePluginMgr) ListVolumePluginWithLimits() []VolumePluginWithAttach func (pm *VolumePluginMgr) FindPersistentPluginBySpec(spec *Spec) (PersistentVolumePlugin, error) { volumePlugin, err := pm.FindPluginBySpec(spec) if err != nil { - return nil, fmt.Errorf("Could not find volume plugin for spec: %#v", spec) + return nil, fmt.Errorf("could not find volume plugin for spec: %#v", spec) } if persistentVolumePlugin, ok := volumePlugin.(PersistentVolumePlugin); ok { return persistentVolumePlugin, nil @@ -800,7 +802,7 @@ func (pm *VolumePluginMgr) FindPersistentPluginBySpec(spec *Spec) (PersistentVol func (pm *VolumePluginMgr) FindVolumePluginWithLimitsBySpec(spec *Spec) (VolumePluginWithAttachLimits, error) { volumePlugin, err := pm.FindPluginBySpec(spec) if err != nil { - return nil, fmt.Errorf("Could not find volume plugin for spec : %#v", spec) + return nil, fmt.Errorf("could not find volume plugin for spec : %#v", spec) } if limitedPlugin, ok := volumePlugin.(VolumePluginWithAttachLimits); ok { @@ -956,10 +958,10 @@ func (pm *VolumePluginMgr) FindExpandablePluginBySpec(spec *Spec) (ExpandableVol if spec.IsKubeletExpandable() { // for kubelet expandable volumes, return a noop plugin that // returns success for expand on the controller - klog.V(4).Infof("FindExpandablePluginBySpec(%s) -> returning noopExpandableVolumePluginInstance", spec.Name()) + klog.V(4).InfoS("FindExpandablePluginBySpec -> returning noopExpandableVolumePluginInstance", "specName", spec.Name()) return &noopExpandableVolumePluginInstance{spec}, nil } - klog.V(4).Infof("FindExpandablePluginBySpec(%s) -> err:%v", spec.Name(), err) + klog.V(4).InfoS("FindExpandablePluginBySpec -> err", "specName", spec.Name(), "err", err) return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/portworx/portworx_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/portworx/portworx_util.go index 5885a1065d70..5ff253a74944 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/portworx/portworx_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/portworx/portworx_util.go @@ -360,7 +360,7 @@ func lookupPXAPIPortFromService(svc *v1.Service) int32 { func getPortworxService(host volume.VolumeHost) (*v1.Service, error) { kubeClient := host.GetKubeClient() if kubeClient == nil { - err := fmt.Errorf("Failed to get kubeclient when creating portworx client") + err := fmt.Errorf("failed to get kubeclient when creating portworx client") klog.Errorf(err.Error()) return nil, err } @@ -373,7 +373,7 @@ func getPortworxService(host volume.VolumeHost) (*v1.Service, error) { } if svc == nil { - err = fmt.Errorf("Service: %v not found. Consult Portworx docs to deploy it", pxServiceName) + err = fmt.Errorf("service: %v not found. Consult Portworx docs to deploy it", pxServiceName) klog.Errorf(err.Error()) return nil, err } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/projected/projected.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/projected/projected.go index 443c6f8eb5db..f6fca6d57901 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/projected/projected.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/projected/projected.go @@ -248,12 +248,12 @@ func (s *projectedVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterA func (s *projectedVolumeMounter) collectData(mounterArgs volume.MounterArgs) (map[string]volumeutil.FileProjection, error) { if s.source.DefaultMode == nil { - return nil, fmt.Errorf("No defaultMode used, not even the default value for it") + return nil, fmt.Errorf("no defaultMode used, not even the default value for it") } kubeClient := s.plugin.host.GetKubeClient() if kubeClient == nil { - return nil, fmt.Errorf("Cannot setup projected volume %v because kube client is not configured", s.volName) + return nil, fmt.Errorf("cannot setup projected volume %v because kube client is not configured", s.volName) } errlist := []error{} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/quobyte/quobyte.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/quobyte/quobyte.go index 8bc139245b9e..c3cd461f32b9 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/quobyte/quobyte.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/quobyte/quobyte.go @@ -416,7 +416,7 @@ func (provisioner *quobyteVolumeProvisioner) Provision(selectedNode *v1.Node, al } if !validateRegistry(provisioner.registry) { - return nil, fmt.Errorf("Quobyte registry missing or malformed: must be a host:port pair or multiple pairs separated by commas") + return nil, fmt.Errorf("quobyte registry missing or malformed: must be a host:port pair or multiple pairs separated by commas") } // create random image name @@ -493,7 +493,7 @@ func parseAPIConfig(plugin *quobytePlugin, params map[string]string) (*quobyteAP } if len(apiServer) == 0 { - return nil, fmt.Errorf("Quobyte API server missing or malformed: must be a http(s)://host:port pair or multiple pairs separated by commas") + return nil, fmt.Errorf("quobyte API server missing or malformed: must be a http(s)://host:port pair or multiple pairs separated by commas") } secretMap, err := util.GetSecretForPV(secretNamespace, secretName, quobytePluginName, plugin.host.GetKubeClient()) @@ -507,11 +507,11 @@ func parseAPIConfig(plugin *quobytePlugin, params map[string]string) (*quobyteAP var ok bool if cfg.quobyteUser, ok = secretMap["user"]; !ok { - return nil, fmt.Errorf("Missing \"user\" in secret %s/%s", secretNamespace, secretName) + return nil, fmt.Errorf("missing \"user\" in secret %s/%s", secretNamespace, secretName) } if cfg.quobytePassword, ok = secretMap["password"]; !ok { - return nil, fmt.Errorf("Missing \"password\" in secret %s/%s", secretNamespace, secretName) + return nil, fmt.Errorf("missing \"password\" in secret %s/%s", secretNamespace, secretName) } return cfg, nil diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/rbd/rbd.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/rbd/rbd.go index a624d736aa7e..cf9e1049f6c5 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/rbd/rbd.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/rbd/rbd.go @@ -524,13 +524,21 @@ func (plugin *rbdPlugin) newBlockVolumeMapperInternal(spec *volume.Spec, podUID return nil, err } - return &rbdDiskMapper{ + mapper := &rbdDiskMapper{ rbd: newRBD(podUID, spec.Name(), img, pool, ro, plugin, manager), mon: mon, id: id, keyring: keyring, secret: secret, - }, nil + } + + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, fmt.Errorf("failed to get device path: %v", err) + } + mapper.MetricsProvider = volume.NewMetricsBlock(filepath.Join(blockPath, string(podUID))) + + return mapper, nil } func (plugin *rbdPlugin) NewBlockVolumeUnmapper(volName string, podUID types.UID) (volume.BlockVolumeUnmapper, error) { @@ -930,6 +938,12 @@ func (rbd *rbd) rbdPodDeviceMapPath() (string, string) { return rbd.plugin.host.GetPodVolumeDeviceDir(rbd.podUID, utilstrings.EscapeQualifiedName(name)), rbd.volName } +// SupportsMetrics returns true for rbdDiskMapper as it initializes the +// MetricsProvider. +func (rdm *rbdDiskMapper) SupportsMetrics() bool { + return true +} + type rbdDiskUnmapper struct { *rbdDiskMapper } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go deleted file mode 100644 index fc761071a11f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go +++ /dev/null @@ -1,582 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package scaleio - -import ( - "errors" - "fmt" - "io/ioutil" - "net/http" - "os" - "path/filepath" - "regexp" - "strconv" - "strings" - "sync" - "time" - - utilexec "k8s.io/utils/exec" - - sio "github.com/thecodeteam/goscaleio" - siotypes "github.com/thecodeteam/goscaleio/types/v1" - "k8s.io/klog/v2" - proxyutil "k8s.io/kubernetes/pkg/proxy/util" -) - -var ( - sioDiskIDPath = "/dev/disk/by-id" -) - -type sioVolumeID string - -type sioInterface interface { - FindVolume(name string) (*siotypes.Volume, error) - Volume(sioVolumeID) (*siotypes.Volume, error) - CreateVolume(name string, sizeGB int64) (*siotypes.Volume, error) - AttachVolume(sioVolumeID, bool) error - DetachVolume(sioVolumeID) error - DeleteVolume(sioVolumeID) error - IID() (string, error) - Devs() (map[string]string, error) - WaitForAttachedDevice(token string) (string, error) - WaitForDetachedDevice(token string) error - GetVolumeRefs(sioVolumeID) (int, error) -} - -type sioClient struct { - client *sio.Client - gateway string - username string - password string `datapolicy:"password"` - insecure bool - certsEnabled bool - system *siotypes.System - sysName string - sysClient *sio.System - protectionDomain *siotypes.ProtectionDomain - pdName string - pdClient *sio.ProtectionDomain - storagePool *siotypes.StoragePool - spName string - spClient *sio.StoragePool - provisionMode string - sdcPath string - sdcGUID string - instanceID string - inited bool - diskRegex *regexp.Regexp - mtx sync.Mutex - exec utilexec.Interface - filteredDialOptions *proxyutil.FilteredDialOptions -} - -func newSioClient(gateway, username, password string, sslEnabled bool, exec utilexec.Interface, filteredDialOptions *proxyutil.FilteredDialOptions) (*sioClient, error) { - client := new(sioClient) - client.gateway = gateway - client.username = username - client.password = password - client.exec = exec - client.filteredDialOptions = filteredDialOptions - if sslEnabled { - client.insecure = false - client.certsEnabled = true - } else { - client.insecure = true - client.certsEnabled = false - } - r, err := regexp.Compile(`^emc-vol-\w*-\w*$`) - if err != nil { - klog.Error(log("failed to compile regex: %v", err)) - return nil, err - } - client.diskRegex = r - - // delay client setup/login until init() - return client, nil -} - -// init setups client and authenticate -func (c *sioClient) init() error { - c.mtx.Lock() - defer c.mtx.Unlock() - if c.inited { - return nil - } - klog.V(4).Infoln(log("initializing scaleio client")) - client, err := sio.NewClientWithArgs(c.gateway, "", c.insecure, c.certsEnabled) - if err != nil { - klog.Error(log("failed to create client: %v", err)) - return err - } - transport, ok := client.Http.Transport.(*http.Transport) - if !ok { - return errors.New("could not set http.Transport options for scaleio client") - } - //lint:ignore SA1019 DialTLS must be used to support legacy clients. - if transport.DialTLS != nil { - return errors.New("DialTLS will be used instead of DialContext") - } - transport.DialContext = proxyutil.NewFilteredDialContext(transport.DialContext, nil, c.filteredDialOptions) - c.client = client - if _, err = c.client.Authenticate( - &sio.ConfigConnect{ - Endpoint: c.gateway, - Version: "", - Username: c.username, - Password: c.password}, - ); err != nil { - // don't log error details from client calls in events - klog.V(4).Infof(log("client authentication failed: %v", err)) - return errors.New("client authentication failed") - } - - // retrieve system - if c.system, err = c.findSystem(c.sysName); err != nil { - klog.Error(log("unable to find system %s: %v", c.sysName, err)) - return err - } - - // retrieve protection domain - if c.protectionDomain, err = c.findProtectionDomain(c.pdName); err != nil { - klog.Error(log("unable to find protection domain %s: %v", c.protectionDomain, err)) - return err - } - // retrieve storage pool - if c.storagePool, err = c.findStoragePool(c.spName); err != nil { - klog.Error(log("unable to find storage pool %s: %v", c.storagePool, err)) - return err - } - c.inited = true - return nil -} - -func (c *sioClient) Volumes() ([]*siotypes.Volume, error) { - if err := c.init(); err != nil { - return nil, err - } - vols, err := c.getVolumes() - if err != nil { - klog.Error(log("failed to retrieve volumes: %v", err)) - return nil, err - } - return vols, nil -} - -func (c *sioClient) Volume(id sioVolumeID) (*siotypes.Volume, error) { - if err := c.init(); err != nil { - return nil, err - } - - vols, err := c.getVolumesByID(id) - if err != nil { - klog.Error(log("failed to retrieve volume by id: %v", err)) - return nil, err - } - vol := vols[0] - if vol == nil { - klog.V(4).Info(log("volume not found, id %s", id)) - return nil, errors.New("volume not found") - } - return vol, nil -} - -func (c *sioClient) FindVolume(name string) (*siotypes.Volume, error) { - if err := c.init(); err != nil { - return nil, err - } - - klog.V(4).Info(log("searching for volume %s", name)) - volumes, err := c.getVolumesByName(name) - if err != nil { - klog.Error(log("failed to find volume by name %v", err)) - return nil, err - } - - for _, volume := range volumes { - if volume.Name == name { - klog.V(4).Info(log("found volume %s", name)) - return volume, nil - } - } - klog.V(4).Info(log("volume not found, name %s", name)) - return nil, errors.New("volume not found") -} - -func (c *sioClient) CreateVolume(name string, sizeGB int64) (*siotypes.Volume, error) { - if err := c.init(); err != nil { - return nil, err - } - - params := &siotypes.VolumeParam{ - Name: name, - VolumeSizeInKb: strconv.Itoa(int(sizeGB) * 1024 * 1024), - VolumeType: c.provisionMode, - } - createResponse, err := c.client.CreateVolume(params, c.storagePool.Name) - if err != nil { - // don't log error details from client calls in events - klog.V(4).Infof(log("failed to create volume %s: %v", name, err)) - return nil, errors.New("failed to create volume: see kubernetes logs for details") - } - return c.Volume(sioVolumeID(createResponse.ID)) -} - -// AttachVolume maps the scaleio volume to an sdc node. If the multipleMappings flag -// is true, ScaleIO will allow other SDC to map to that volume. -func (c *sioClient) AttachVolume(id sioVolumeID, multipleMappings bool) error { - if err := c.init(); err != nil { - klog.Error(log("failed to init'd client in attach volume: %v", err)) - return err - } - - iid, err := c.IID() - if err != nil { - klog.Error(log("failed to get instanceIID for attach volume: %v", err)) - return err - } - - params := &siotypes.MapVolumeSdcParam{ - SdcID: iid, - AllowMultipleMappings: strconv.FormatBool(multipleMappings), - AllSdcs: "", - } - volClient := sio.NewVolume(c.client) - volClient.Volume = &siotypes.Volume{ID: string(id)} - - if err := volClient.MapVolumeSdc(params); err != nil { - // don't log error details from client calls in events - klog.V(4).Infof(log("failed to attach volume id %s: %v", id, err)) - return errors.New("failed to attach volume: see kubernetes logs for details") - } - - klog.V(4).Info(log("volume %s attached successfully", id)) - return nil -} - -// DetachVolume detaches the volume with specified id. -func (c *sioClient) DetachVolume(id sioVolumeID) error { - if err := c.init(); err != nil { - return err - } - - iid, err := c.IID() - if err != nil { - return err - } - params := &siotypes.UnmapVolumeSdcParam{ - SdcID: "", - IgnoreScsiInitiators: "true", - AllSdcs: iid, - } - volClient := sio.NewVolume(c.client) - volClient.Volume = &siotypes.Volume{ID: string(id)} - if err := volClient.UnmapVolumeSdc(params); err != nil { - // don't log error details from client calls in events - klog.V(4).Infof(log("failed to detach volume id %s: %v", id, err)) - return errors.New("failed to detach volume: see kubernetes logs for details") - } - return nil -} - -// DeleteVolume deletes the volume with the specified id -func (c *sioClient) DeleteVolume(id sioVolumeID) error { - if err := c.init(); err != nil { - return err - } - - vol, err := c.Volume(id) - if err != nil { - return err - } - volClient := sio.NewVolume(c.client) - volClient.Volume = vol - if err := volClient.RemoveVolume("ONLY_ME"); err != nil { - // don't log error details from client calls in events - klog.V(4).Infof(log("failed to remove volume id %s: %v", id, err)) - return errors.New("failed to remove volume: see kubernetes logs for details") - } - return nil -} - -// IID returns the scaleio instance id for node -func (c *sioClient) IID() (string, error) { - if err := c.init(); err != nil { - return "", err - } - - // if instanceID not set, retrieve it - if c.instanceID == "" { - guid, err := c.getGUID() - if err != nil { - return "", err - } - sdc, err := c.sysClient.FindSdc("SdcGUID", guid) - if err != nil { - // don't log error details from client calls in events - klog.V(4).Infof(log("failed to retrieve sdc info %s", err)) - return "", errors.New("failed to retrieve sdc info: see kubernetes logs for details") - } - c.instanceID = sdc.Sdc.ID - klog.V(4).Info(log("retrieved instanceID %s", c.instanceID)) - } - return c.instanceID, nil -} - -// getGUID returns instance GUID, if not set using resource labels -// it attempts to fallback to using drv_cfg binary -func (c *sioClient) getGUID() (string, error) { - if c.sdcGUID == "" { - klog.V(4).Info(log("sdc guid label not set, falling back to using drv_cfg")) - cmd := c.getSdcCmd() - output, err := c.exec.Command(cmd, "--query_guid").CombinedOutput() - if err != nil { - klog.Error(log("drv_cfg --query_guid failed: %v", err)) - return "", err - } - c.sdcGUID = strings.TrimSpace(string(output)) - } - return c.sdcGUID, nil -} - -// getSioDiskPaths traverse local disk devices to retrieve device path -// The path is extracted from /dev/disk/by-id; each sio device path has format: -// emc-vol- e.g.: -// emc-vol-788d9efb0a8f20cb-a2b8419300000000 -func (c *sioClient) getSioDiskPaths() ([]os.FileInfo, error) { - files, err := ioutil.ReadDir(sioDiskIDPath) - if err != nil { - if os.IsNotExist(err) { - // sioDiskIDPath may not exist yet which is fine - return []os.FileInfo{}, nil - } - klog.Error(log("failed to ReadDir %s: %v", sioDiskIDPath, err)) - return nil, err - - } - result := []os.FileInfo{} - for _, file := range files { - if c.diskRegex.MatchString(file.Name()) { - result = append(result, file) - } - } - - return result, nil - -} - -// GetVolumeRefs counts the number of references an SIO volume has a disk device. -// This is useful in preventing premature detach. -func (c *sioClient) GetVolumeRefs(volID sioVolumeID) (refs int, err error) { - files, err := c.getSioDiskPaths() - if err != nil { - return 0, err - } - for _, file := range files { - if strings.Contains(file.Name(), string(volID)) { - refs++ - } - } - return -} - -// Devs returns a map of local devices as map[] -func (c *sioClient) Devs() (map[string]string, error) { - volumeMap := make(map[string]string) - - files, err := c.getSioDiskPaths() - if err != nil { - return nil, err - } - - for _, f := range files { - // split emc-vol-- to pull out volumeID - parts := strings.Split(f.Name(), "-") - if len(parts) != 4 { - return nil, errors.New("unexpected ScaleIO device name format") - } - volumeID := parts[3] - devPath, err := filepath.EvalSymlinks(fmt.Sprintf("%s/%s", sioDiskIDPath, f.Name())) - if err != nil { - klog.Error(log("devicepath-to-volID mapping error: %v", err)) - return nil, err - } - // map volumeID to devicePath - volumeMap[volumeID] = devPath - } - return volumeMap, nil -} - -// WaitForAttachedDevice sets up a timer to wait for an attached device to appear in the instance's list. -func (c *sioClient) WaitForAttachedDevice(token string) (string, error) { - if token == "" { - return "", fmt.Errorf("invalid attach token") - } - - // wait for device to show up in local device list - ticker := time.NewTicker(time.Second) - defer ticker.Stop() - timer := time.NewTimer(30 * time.Second) - defer timer.Stop() - - for { - select { - case <-ticker.C: - devMap, err := c.Devs() - if err != nil { - klog.Error(log("failed while waiting for volume to attach: %v", err)) - return "", err - } - go func() { - klog.V(4).Info(log("waiting for volume %s to be mapped/attached", token)) - }() - if path, ok := devMap[token]; ok { - klog.V(4).Info(log("device %s mapped to vol %s", path, token)) - return path, nil - } - case <-timer.C: - klog.Error(log("timed out while waiting for volume to be mapped to a device")) - return "", fmt.Errorf("volume attach timeout") - } - } -} - -// waitForDetachedDevice waits for device to be detached -func (c *sioClient) WaitForDetachedDevice(token string) error { - if token == "" { - return fmt.Errorf("invalid detach token") - } - - // wait for attach.Token to show up in local device list - ticker := time.NewTicker(time.Second) - defer ticker.Stop() - timer := time.NewTimer(30 * time.Second) - defer timer.Stop() - - for { - select { - case <-ticker.C: - devMap, err := c.Devs() - if err != nil { - klog.Error(log("failed while waiting for volume to unmap/detach: %v", err)) - return err - } - go func() { - klog.V(4).Info(log("waiting for volume %s to be unmapped/detached", token)) - }() - // can't find vol id, then ok. - if _, ok := devMap[token]; !ok { - return nil - } - case <-timer.C: - klog.Error(log("timed out while waiting for volume %s to be unmapped/detached", token)) - return fmt.Errorf("volume detach timeout") - } - } -} - -// *********************************************************************** -// Little Helpers! -// *********************************************************************** -func (c *sioClient) findSystem(sysname string) (sys *siotypes.System, err error) { - if c.sysClient, err = c.client.FindSystem("", sysname, ""); err != nil { - // don't log error details from clients in events - klog.V(4).Infof(log("failed to find system %q: %v", sysname, err)) - return nil, errors.New("failed to find system: see kubernetes logs for details") - } - systems, err := c.client.GetInstance("") - if err != nil { - // don't log error details from clients in events - klog.V(4).Infof(log("failed to retrieve instances: %v", err)) - return nil, errors.New("failed to retrieve instances: see kubernetes logs for details") - } - for _, sys = range systems { - if sys.Name == sysname { - return sys, nil - } - } - klog.Error(log("system %s not found", sysname)) - return nil, errors.New("system not found") -} - -func (c *sioClient) findProtectionDomain(pdname string) (*siotypes.ProtectionDomain, error) { - c.pdClient = sio.NewProtectionDomain(c.client) - if c.sysClient != nil { - protectionDomain, err := c.sysClient.FindProtectionDomain("", pdname, "") - if err != nil { - // don't log error details from clients in events - klog.V(4).Infof(log("failed to retrieve protection domains: %v", err)) - return nil, errors.New("failed to retrieve protection domains: see kubernetes logs for details") - } - c.pdClient.ProtectionDomain = protectionDomain - return protectionDomain, nil - } - klog.Error(log("protection domain %s not set", pdname)) - return nil, errors.New("protection domain not set") -} - -func (c *sioClient) findStoragePool(spname string) (*siotypes.StoragePool, error) { - c.spClient = sio.NewStoragePool(c.client) - if c.pdClient != nil { - sp, err := c.pdClient.FindStoragePool("", spname, "") - if err != nil { - // don't log error details from clients in events - klog.V(4).Infof(log("failed to retrieve storage pool: %v", err)) - return nil, errors.New("failed to retrieve storage pool: see kubernetes logs for details") - } - c.spClient.StoragePool = sp - return sp, nil - } - klog.Error(log("storage pool %s not set", spname)) - return nil, errors.New("storage pool not set") -} - -func (c *sioClient) getVolumes() ([]*siotypes.Volume, error) { - volumes, err := c.client.GetVolume("", "", "", "", true) - if err != nil { - // don't log error details from clients in events - klog.V(4).Infof(log("failed to get volumes: %v", err)) - return nil, errors.New("failed to get volumes: see kubernetes logs for details") - } - return volumes, nil -} -func (c *sioClient) getVolumesByID(id sioVolumeID) ([]*siotypes.Volume, error) { - volumes, err := c.client.GetVolume("", string(id), "", "", true) - if err != nil { - // don't log error details from clients in events - klog.V(4).Infof(log("failed to get volumes by id: %v", err)) - return nil, errors.New("failed to get volumes by id: see kubernetes logs for details") - } - return volumes, nil -} - -func (c *sioClient) getVolumesByName(name string) ([]*siotypes.Volume, error) { - volumes, err := c.client.GetVolume("", "", "", name, true) - if err != nil { - // don't log error details from clients in events - klog.V(4).Infof(log("failed to get volumes by name: %v", err)) - return nil, errors.New("failed to get volumes by name: see kubernetes logs for details") - } - return volumes, nil -} - -func (c *sioClient) getSdcPath() string { - return sdcRootPath -} - -func (c *sioClient) getSdcCmd() string { - return filepath.Join(c.getSdcPath(), "drv_cfg") -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr.go deleted file mode 100644 index 159f040e23ab..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr.go +++ /dev/null @@ -1,241 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package scaleio - -import ( - "errors" - "strconv" - - "k8s.io/klog/v2" - "k8s.io/kubernetes/pkg/volume" - utilexec "k8s.io/utils/exec" - - siotypes "github.com/thecodeteam/goscaleio/types/v1" -) - -type sioMgr struct { - client sioInterface - configData map[string]string - exec utilexec.Interface - host volume.VolumeHost -} - -func newSioMgr(configs map[string]string, host volume.VolumeHost, exec utilexec.Interface) (*sioMgr, error) { - if configs == nil { - return nil, errors.New("missing configuration data") - } - configs[confKey.protectionDomain] = defaultString(configs[confKey.protectionDomain], "default") - configs[confKey.storagePool] = defaultString(configs[confKey.storagePool], "default") - configs[confKey.sdcRootPath] = defaultString(configs[confKey.sdcRootPath], sdcRootPath) - configs[confKey.storageMode] = defaultString(configs[confKey.storageMode], "ThinProvisioned") - - mgr := &sioMgr{configData: configs, host: host, exec: exec} - return mgr, nil -} - -// getClient safely returns an sioInterface -func (m *sioMgr) getClient() (sioInterface, error) { - if m.client == nil { - klog.V(4).Info(log("creating scaleio client")) - configs := m.configData - username := configs[confKey.username] - password := configs[confKey.password] - gateway := configs[confKey.gateway] - b, err := strconv.ParseBool(configs[confKey.sslEnabled]) - if err != nil { - klog.Error(log("failed to parse sslEnabled, must be either \"true\" or \"false\"")) - return nil, err - } - certsEnabled := b - - klog.V(4).Info(log("creating new client for gateway %s", gateway)) - client, err := newSioClient(gateway, username, password, certsEnabled, m.exec, m.host.GetFilteredDialOptions()) - if err != nil { - klog.Error(log("failed to create scaleio client: %v", err)) - return nil, err - } - - client.sysName = configs[confKey.system] - client.pdName = configs[confKey.protectionDomain] - client.spName = configs[confKey.storagePool] - client.sdcPath = configs[confKey.sdcRootPath] - client.provisionMode = configs[confKey.storageMode] - client.sdcGUID = configs[confKey.sdcGUID] - - m.client = client - - klog.V(4).Info(log("client created successfully [gateway=%s]", gateway)) - } - return m.client, nil -} - -// CreateVolume creates a new ScaleIO volume -func (m *sioMgr) CreateVolume(volName string, sizeGB int64) (*siotypes.Volume, error) { - client, err := m.getClient() - if err != nil { - return nil, err - } - - klog.V(4).Infof("scaleio: creating volume %s", volName) - vol, err := client.CreateVolume(volName, sizeGB) - if err != nil { - klog.V(4).Infof("scaleio: failed creating volume %s: %v", volName, err) - return nil, err - } - klog.V(4).Infof("scaleio: created volume %s successfully", volName) - return vol, nil -} - -// AttachVolume maps a ScaleIO volume to the running node. If flag multiMaps, -// ScaleIO will allow other SDC to map to volume. -func (m *sioMgr) AttachVolume(volName string, multipleMappings bool) (string, error) { - client, err := m.getClient() - if err != nil { - klog.Error(log("attach volume failed: %v", err)) - return "", err - } - - klog.V(4).Infoln(log("attaching volume %s", volName)) - iid, err := client.IID() - if err != nil { - klog.Error(log("failed to get instanceID")) - return "", err - } - klog.V(4).Info(log("attaching volume %s to host instance %s", volName, iid)) - - devs, err := client.Devs() - if err != nil { - return "", err - } - - vol, err := client.FindVolume(volName) - if err != nil { - klog.Error(log("failed to find volume %s: %v", volName, err)) - return "", err - } - - // handle vol if already attached - if len(vol.MappedSdcInfo) > 0 { - if m.isSdcMappedToVol(iid, vol) { - klog.V(4).Info(log("skipping attachment, volume %s already attached to sdc %s", volName, iid)) - return devs[vol.ID], nil - } - } - - // attach volume, get deviceName - if err := client.AttachVolume(sioVolumeID(vol.ID), multipleMappings); err != nil { - klog.Error(log("attachment for volume %s failed :%v", volName, err)) - return "", err - } - device, err := client.WaitForAttachedDevice(vol.ID) - if err != nil { - klog.Error(log("failed while waiting for device to attach: %v", err)) - return "", err - } - klog.V(4).Info(log("volume %s attached successfully as %s to instance %s", volName, device, iid)) - return device, nil -} - -// IsAttached verifies that the named ScaleIO volume is still attached -func (m *sioMgr) IsAttached(volName string) (bool, error) { - client, err := m.getClient() - if err != nil { - return false, err - } - iid, err := client.IID() - if err != nil { - klog.Error("scaleio: failed to get instanceID") - return false, err - } - - vol, err := client.FindVolume(volName) - if err != nil { - return false, err - } - return m.isSdcMappedToVol(iid, vol), nil -} - -// DetachVolume detaches the name ScaleIO volume from an instance -func (m *sioMgr) DetachVolume(volName string) error { - client, err := m.getClient() - if err != nil { - return err - } - iid, err := client.IID() - if err != nil { - klog.Error(log("failed to get instanceID: %v", err)) - return err - } - - vol, err := client.FindVolume(volName) - if err != nil { - return err - } - if !m.isSdcMappedToVol(iid, vol) { - klog.Warning(log( - "skipping detached, vol %s not attached to instance %s", - volName, iid, - )) - return nil - } - - if err := client.DetachVolume(sioVolumeID(vol.ID)); err != nil { - klog.Error(log("failed to detach vol %s: %v", volName, err)) - return err - } - - klog.V(4).Info(log("volume %s detached successfully", volName)) - - return nil -} - -// DeleteVolumes removes the ScaleIO volume -func (m *sioMgr) DeleteVolume(volName string) error { - client, err := m.getClient() - if err != nil { - return err - } - - vol, err := client.FindVolume(volName) - if err != nil { - return err - } - - if err := client.DeleteVolume(sioVolumeID(vol.ID)); err != nil { - klog.Error(log("failed to delete volume %s: %v", volName, err)) - return err - } - - klog.V(4).Info(log("deleted volume %s successfully", volName)) - return nil - -} - -// isSdcMappedToVol returns true if the sdc is mapped to the volume -func (m *sioMgr) isSdcMappedToVol(sdcID string, vol *siotypes.Volume) bool { - if len(vol.MappedSdcInfo) == 0 { - klog.V(4).Info(log("no attachment found")) - return false - } - - for _, sdcInfo := range vol.MappedSdcInfo { - if sdcInfo.SdcID == sdcID { - return true - } - } - return false -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_plugin.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_plugin.go deleted file mode 100644 index 4d0312232bde..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_plugin.go +++ /dev/null @@ -1,220 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package scaleio - -import ( - "errors" - - api "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/klog/v2" - "k8s.io/kubernetes/pkg/volume" - "k8s.io/utils/keymutex" -) - -const ( - sioPluginName = "kubernetes.io/scaleio" - sioConfigFileName = "sioconf.dat" -) - -type sioPlugin struct { - host volume.VolumeHost - volumeMtx keymutex.KeyMutex -} - -// ProbeVolumePlugins is the primary entrypoint for volume plugins. -func ProbeVolumePlugins() []volume.VolumePlugin { - p := &sioPlugin{ - host: nil, - } - return []volume.VolumePlugin{p} -} - -// ******************* -// VolumePlugin Impl -// ******************* -var _ volume.VolumePlugin = &sioPlugin{} - -func (p *sioPlugin) Init(host volume.VolumeHost) error { - p.host = host - p.volumeMtx = keymutex.NewHashed(0) - return nil -} - -func (p *sioPlugin) GetPluginName() string { - return sioPluginName -} - -func (p *sioPlugin) GetVolumeName(spec *volume.Spec) (string, error) { - attribs, err := getVolumeSourceAttribs(spec) - if err != nil { - return "", err - } - return attribs.volName, nil -} - -func (p *sioPlugin) CanSupport(spec *volume.Spec) bool { - return (spec.PersistentVolume != nil && spec.PersistentVolume.Spec.ScaleIO != nil) || - (spec.Volume != nil && spec.Volume.ScaleIO != nil) -} - -func (p *sioPlugin) RequiresRemount(spec *volume.Spec) bool { - return false -} - -func (p *sioPlugin) NewMounter( - spec *volume.Spec, - pod *api.Pod, - _ volume.VolumeOptions) (volume.Mounter, error) { - - // extract source info from either ScaleIOVolumeSource or ScaleIOPersistentVolumeSource type - attribs, err := getVolumeSourceAttribs(spec) - if err != nil { - return nil, errors.New(log("mounter failed to extract volume attributes from spec: %v", err)) - } - - secretName, secretNS, err := getSecretAndNamespaceFromSpec(spec, pod) - if err != nil { - return nil, errors.New(log("failed to get secret name or secretNamespace: %v", err)) - } - - return &sioVolume{ - pod: pod, - spec: spec, - secretName: secretName, - secretNamespace: secretNS, - volSpecName: spec.Name(), - volName: attribs.volName, - podUID: pod.UID, - readOnly: attribs.readOnly, - fsType: attribs.fsType, - plugin: p, - }, nil -} - -// NewUnmounter creates a representation of the volume to unmount -func (p *sioPlugin) NewUnmounter(specName string, podUID types.UID) (volume.Unmounter, error) { - klog.V(4).Info(log("Unmounter for %s", specName)) - - return &sioVolume{ - podUID: podUID, - volSpecName: specName, - plugin: p, - }, nil -} - -func (p *sioPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volume.Spec, error) { - sioVol := &api.Volume{ - Name: volumeName, - VolumeSource: api.VolumeSource{ - ScaleIO: &api.ScaleIOVolumeSource{}, - }, - } - return volume.NewSpecFromVolume(sioVol), nil -} - -// SupportsMountOption returns true if volume plugins supports Mount options -// Specifying mount options in a volume plugin that doesn't support -// user specified mount options will result in error creating persistent volumes -func (p *sioPlugin) SupportsMountOption() bool { - return false -} - -// SupportsBulkVolumeVerification checks if volume plugin type is capable -// of enabling bulk polling of all nodes. This can speed up verification of -// attached volumes by quite a bit, but underlying pluging must support it. -func (p *sioPlugin) SupportsBulkVolumeVerification() bool { - return false -} - -//****************************** -// PersistentVolumePlugin Impl -// ***************************** -var _ volume.PersistentVolumePlugin = &sioPlugin{} - -func (p *sioPlugin) GetAccessModes() []api.PersistentVolumeAccessMode { - return []api.PersistentVolumeAccessMode{ - api.ReadWriteOnce, - api.ReadOnlyMany, - } -} - -// *************************** -// DeletableVolumePlugin Impl -//**************************** -var _ volume.DeletableVolumePlugin = &sioPlugin{} - -func (p *sioPlugin) NewDeleter(spec *volume.Spec) (volume.Deleter, error) { - attribs, err := getVolumeSourceAttribs(spec) - if err != nil { - klog.Error(log("deleter failed to extract volume attributes from spec: %v", err)) - return nil, err - } - - secretName, secretNS, err := getSecretAndNamespaceFromSpec(spec, nil) - if err != nil { - return nil, errors.New(log("failed to get secret name or secretNamespace: %v", err)) - } - - return &sioVolume{ - spec: spec, - secretName: secretName, - secretNamespace: secretNS, - volSpecName: spec.Name(), - volName: attribs.volName, - plugin: p, - readOnly: attribs.readOnly, - }, nil -} - -// ********************************* -// ProvisionableVolumePlugin Impl -// ********************************* -var _ volume.ProvisionableVolumePlugin = &sioPlugin{} - -func (p *sioPlugin) NewProvisioner(options volume.VolumeOptions) (volume.Provisioner, error) { - klog.V(4).Info(log("creating Provisioner")) - - configData := options.Parameters - if configData == nil { - klog.Error(log("provisioner missing parameters, unable to continue")) - return nil, errors.New("option parameters missing") - } - - // Supports ref of name of secret a couple of ways: - // options.Parameters["secretRef"] for backward compat, or - // options.Parameters["secretName"] - secretName := configData[confKey.secretName] - if secretName == "" { - secretName = configData["secretName"] - configData[confKey.secretName] = secretName - } - - secretNS := configData[confKey.secretNamespace] - if secretNS == "" { - secretNS = options.PVC.Namespace - } - - return &sioVolume{ - configData: configData, - plugin: p, - options: options, - secretName: secretName, - secretNamespace: secretNS, - volSpecName: options.PVName, - }, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util.go deleted file mode 100644 index b184ffa08d2b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util.go +++ /dev/null @@ -1,336 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package scaleio - -import ( - "encoding/gob" - "errors" - "fmt" - "os" - "path" - "strconv" - - "k8s.io/klog/v2" - - api "k8s.io/api/core/v1" - "k8s.io/kubernetes/pkg/volume" - volutil "k8s.io/kubernetes/pkg/volume/util" -) - -type volSourceAttribs struct { - volName, - fsType string - readOnly bool -} - -var ( - confKey = struct { - gateway, - sslEnabled, - secretName, - system, - protectionDomain, - storagePool, - storageMode, - sdcRootPath, - volumeName, - volSpecName, - fsType, - readOnly, - username, - password, - secretNamespace, - sdcGUID string - }{ - gateway: "gateway", - sslEnabled: "sslEnabled", - secretName: "secretRef", - secretNamespace: "secretNamespace", - system: "system", - protectionDomain: "protectionDomain", - storagePool: "storagePool", - storageMode: "storageMode", - sdcRootPath: "sdcRootPath", - volumeName: "volumeName", - volSpecName: "volSpecName", - fsType: "fsType", - readOnly: "readOnly", - username: "username", - password: "password", - sdcGUID: "sdcGUID", - } - sdcGUIDLabelName = "scaleio.sdcGUID" - sdcRootPath = "/opt/emc/scaleio/sdc/bin" - - errSecretNotFound = errors.New("secret not found") - errGatewayNotProvided = errors.New("ScaleIO gateway not provided") - errSecretRefNotProvided = errors.New("secret ref not provided") - errSystemNotProvided = errors.New("ScaleIO system not provided") - errStoragePoolNotProvided = errors.New("ScaleIO storage pool not provided") - errProtectionDomainNotProvided = errors.New("ScaleIO protection domain not provided") -) - -// mapVolumeSpec maps attributes from either ScaleIOVolumeSource or ScaleIOPersistentVolumeSource to config -func mapVolumeSpec(config map[string]string, spec *volume.Spec) { - - if source, err := getScaleIOPersistentVolumeSourceFromSpec(spec); err == nil { - config[confKey.gateway] = source.Gateway - config[confKey.system] = source.System - config[confKey.volumeName] = source.VolumeName - config[confKey.sslEnabled] = strconv.FormatBool(source.SSLEnabled) - config[confKey.protectionDomain] = source.ProtectionDomain - config[confKey.storagePool] = source.StoragePool - config[confKey.storageMode] = source.StorageMode - config[confKey.fsType] = source.FSType - config[confKey.readOnly] = strconv.FormatBool(source.ReadOnly) - } - - if source, err := getScaleIOVolumeSourceFromSpec(spec); err == nil { - config[confKey.gateway] = source.Gateway - config[confKey.system] = source.System - config[confKey.volumeName] = source.VolumeName - config[confKey.sslEnabled] = strconv.FormatBool(source.SSLEnabled) - config[confKey.protectionDomain] = source.ProtectionDomain - config[confKey.storagePool] = source.StoragePool - config[confKey.storageMode] = source.StorageMode - config[confKey.fsType] = source.FSType - config[confKey.readOnly] = strconv.FormatBool(source.ReadOnly) - } - - //optionals - applyConfigDefaults(config) -} - -func validateConfigs(config map[string]string) error { - if config[confKey.gateway] == "" { - return errGatewayNotProvided - } - if config[confKey.secretName] == "" { - return errSecretRefNotProvided - } - if config[confKey.system] == "" { - return errSystemNotProvided - } - if config[confKey.storagePool] == "" { - return errStoragePoolNotProvided - } - if config[confKey.protectionDomain] == "" { - return errProtectionDomainNotProvided - } - - return nil -} - -// applyConfigDefaults apply known defaults to incoming spec for dynamic PVCs. -func applyConfigDefaults(config map[string]string) { - b, err := strconv.ParseBool(config[confKey.sslEnabled]) - if err != nil { - klog.Warning(log("failed to parse param sslEnabled, setting it to false")) - b = false - } - config[confKey.sslEnabled] = strconv.FormatBool(b) - config[confKey.storageMode] = defaultString(config[confKey.storageMode], "ThinProvisioned") - config[confKey.fsType] = defaultString(config[confKey.fsType], "xfs") - b, err = strconv.ParseBool(config[confKey.readOnly]) - if err != nil { - klog.Warning(log("failed to parse param readOnly, setting it to false")) - b = false - } - config[confKey.readOnly] = strconv.FormatBool(b) -} - -func defaultString(val, defVal string) string { - if val == "" { - return defVal - } - return val -} - -// loadConfig loads configuration data from a file on disk -func loadConfig(configName string) (map[string]string, error) { - klog.V(4).Info(log("loading config file %s", configName)) - file, err := os.Open(configName) - if err != nil { - klog.Error(log("failed to open config file %s: %v", configName, err)) - return nil, err - } - defer file.Close() - data := map[string]string{} - if err := gob.NewDecoder(file).Decode(&data); err != nil { - klog.Error(log("failed to parse config data %s: %v", configName, err)) - return nil, err - } - applyConfigDefaults(data) - if err := validateConfigs(data); err != nil { - klog.Error(log("failed to load ConfigMap %s: %v", err)) - return nil, err - } - - return data, nil -} - -// saveConfig saves the configuration data to local disk -func saveConfig(configName string, data map[string]string) error { - klog.V(4).Info(log("saving config file %s", configName)) - - dir := path.Dir(configName) - if _, err := os.Stat(dir); err != nil { - if !os.IsNotExist(err) { - return err - } - klog.V(4).Info(log("creating config dir for config data: %s", dir)) - if err := os.MkdirAll(dir, 0750); err != nil { - klog.Error(log("failed to create config data dir %v", err)) - return err - } - } - - file, err := os.Create(configName) - if err != nil { - klog.V(4).Info(log("failed to save config data file %s: %v", configName, err)) - return err - } - defer file.Close() - if err := gob.NewEncoder(file).Encode(data); err != nil { - klog.Error(log("failed to save config %s: %v", configName, err)) - return err - } - klog.V(4).Info(log("config data file saved successfully as %s", configName)) - return nil -} - -// attachSecret loads secret object and attaches to configData -func attachSecret(plug *sioPlugin, namespace string, configData map[string]string) error { - // load secret - secretRefName := configData[confKey.secretName] - kubeClient := plug.host.GetKubeClient() - secretMap, err := volutil.GetSecretForPV(namespace, secretRefName, sioPluginName, kubeClient) - if err != nil { - klog.Error(log("failed to get secret: %v", err)) - return errSecretNotFound - } - // merge secret data - for key, val := range secretMap { - configData[key] = val - } - - return nil -} - -// attachSdcGUID injects the sdc guid node label value into config -func attachSdcGUID(plug *sioPlugin, conf map[string]string) error { - guid, err := getSdcGUIDLabel(plug) - if err != nil { - return err - } - conf[confKey.sdcGUID] = guid - return nil -} - -// getSdcGUIDLabel fetches the scaleio.sdcGuid node label -// associated with the node executing this code. -func getSdcGUIDLabel(plug *sioPlugin) (string, error) { - nodeLabels, err := plug.host.GetNodeLabels() - if err != nil { - return "", err - } - label, ok := nodeLabels[sdcGUIDLabelName] - if !ok { - klog.V(4).Info(log("node label %s not found", sdcGUIDLabelName)) - return "", nil - } - - klog.V(4).Info(log("found node label %s=%s", sdcGUIDLabelName, label)) - return label, nil -} - -// getVolumeSourceFromSpec safely extracts ScaleIOVolumeSource or ScaleIOPersistentVolumeSource from spec -func getVolumeSourceFromSpec(spec *volume.Spec) (interface{}, error) { - if spec.Volume != nil && spec.Volume.ScaleIO != nil { - return spec.Volume.ScaleIO, nil - } - if spec.PersistentVolume != nil && - spec.PersistentVolume.Spec.ScaleIO != nil { - return spec.PersistentVolume.Spec.ScaleIO, nil - } - - return nil, fmt.Errorf("ScaleIO not defined in spec") -} - -func getVolumeSourceAttribs(spec *volume.Spec) (*volSourceAttribs, error) { - attribs := new(volSourceAttribs) - if pvSource, err := getScaleIOPersistentVolumeSourceFromSpec(spec); err == nil { - attribs.volName = pvSource.VolumeName - attribs.fsType = pvSource.FSType - attribs.readOnly = pvSource.ReadOnly - } else if pSource, err := getScaleIOVolumeSourceFromSpec(spec); err == nil { - attribs.volName = pSource.VolumeName - attribs.fsType = pSource.FSType - attribs.readOnly = pSource.ReadOnly - } else { - msg := log("failed to get ScaleIOVolumeSource or ScaleIOPersistentVolumeSource from spec") - klog.Error(msg) - return nil, errors.New(msg) - } - return attribs, nil -} - -func getScaleIOPersistentVolumeSourceFromSpec(spec *volume.Spec) (*api.ScaleIOPersistentVolumeSource, error) { - source, err := getVolumeSourceFromSpec(spec) - if err != nil { - return nil, err - } - if val, ok := source.(*api.ScaleIOPersistentVolumeSource); ok { - return val, nil - } - return nil, fmt.Errorf("spec is not a valid ScaleIOPersistentVolume type") -} - -func getScaleIOVolumeSourceFromSpec(spec *volume.Spec) (*api.ScaleIOVolumeSource, error) { - source, err := getVolumeSourceFromSpec(spec) - if err != nil { - return nil, err - } - if val, ok := source.(*api.ScaleIOVolumeSource); ok { - return val, nil - } - return nil, fmt.Errorf("spec is not a valid ScaleIOVolume type") -} - -func getSecretAndNamespaceFromSpec(spec *volume.Spec, pod *api.Pod) (secretName string, secretNS string, err error) { - if source, err := getScaleIOVolumeSourceFromSpec(spec); err == nil { - secretName = source.SecretRef.Name - if pod != nil { - secretNS = pod.Namespace - } - } else if source, err := getScaleIOPersistentVolumeSourceFromSpec(spec); err == nil { - if source.SecretRef != nil { - secretName = source.SecretRef.Name - secretNS = source.SecretRef.Namespace - if secretNS == "" && pod != nil { - secretNS = pod.Namespace - } - } - } else { - return "", "", errors.New("failed to get ScaleIOVolumeSource or ScaleIOPersistentVolumeSource") - } - return secretName, secretNS, nil -} - -func log(msg string, parts ...interface{}) string { - return fmt.Sprintf(fmt.Sprintf("scaleio: %s", msg), parts...) -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume.go deleted file mode 100644 index a0d4e26014e4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume.go +++ /dev/null @@ -1,530 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package scaleio - -import ( - "fmt" - "os" - "path/filepath" - "strconv" - "strings" - - "k8s.io/klog/v2" - "k8s.io/mount-utils" - utilstrings "k8s.io/utils/strings" - - api "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/uuid" - volumehelpers "k8s.io/cloud-provider/volume/helpers" - "k8s.io/kubernetes/pkg/volume" - "k8s.io/kubernetes/pkg/volume/util" -) - -type sioVolume struct { - sioMgr *sioMgr - plugin *sioPlugin - pod *api.Pod - podUID types.UID - spec *volume.Spec - secretName string - secretNamespace string - volSpecName string - volName string - readOnly bool - fsType string - options volume.VolumeOptions - configData map[string]string - - volume.MetricsNil -} - -const ( - minimumVolumeSizeGiB = 8 -) - -// ******************* -// volume.Volume Impl -var _ volume.Volume = &sioVolume{} - -// GetPath returns the path where the volume will be mounted. -func (v *sioVolume) GetPath() string { - return v.plugin.host.GetPodVolumeDir( - v.podUID, - utilstrings.EscapeQualifiedName(sioPluginName), - v.volSpecName) -} - -// ************* -// Mounter Impl -// ************* -var _ volume.Mounter = &sioVolume{} - -// CanMount checks to verify that the volume can be mounted prior to Setup. -// A nil error indicates that the volume is ready for mounitnig. -func (v *sioVolume) CanMount() error { - return nil -} - -func (v *sioVolume) SetUp(mounterArgs volume.MounterArgs) error { - return v.SetUpAt(v.GetPath(), mounterArgs) -} - -// SetUp bind mounts the disk global mount to the volume path. -func (v *sioVolume) SetUpAt(dir string, mounterArgs volume.MounterArgs) error { - v.plugin.volumeMtx.LockKey(v.volSpecName) - defer v.plugin.volumeMtx.UnlockKey(v.volSpecName) - - klog.V(4).Info(log("setting up volume for PV.spec %s", v.volSpecName)) - if err := v.setSioMgr(); err != nil { - klog.Error(log("setup failed to create scalio manager: %v", err)) - return err - } - - mounter := v.plugin.host.GetMounter(v.plugin.GetPluginName()) - notDevMnt, err := mounter.IsLikelyNotMountPoint(dir) - if err != nil && !os.IsNotExist(err) { - klog.Error(log("IsLikelyNotMountPoint test failed for dir %v", dir)) - return err - } - if !notDevMnt { - klog.V(4).Info(log("skipping setup, dir %s already a mount point", v.volName)) - return nil - } - - // should multiple-mapping be enabled - enableMultiMaps := false - isROM := false - if v.spec.PersistentVolume != nil { - ams := v.spec.PersistentVolume.Spec.AccessModes - for _, am := range ams { - if am == api.ReadOnlyMany { - enableMultiMaps = true - isROM = true - } - } - } - klog.V(4).Info(log("multiple mapping enabled = %v", enableMultiMaps)) - - volName := v.volName - devicePath, err := v.sioMgr.AttachVolume(volName, enableMultiMaps) - if err != nil { - klog.Error(log("setup of volume %v: %v", v.volSpecName, err)) - return err - } - options := []string{} - switch { - default: - options = append(options, "rw") - case isROM && !v.readOnly: - options = append(options, "rw") - case isROM: - options = append(options, "ro") - case v.readOnly: - options = append(options, "ro") - } - - klog.V(4).Info(log("mounting device %s -> %s", devicePath, dir)) - if err := os.MkdirAll(dir, 0750); err != nil { - klog.Error(log("failed to create dir %#v: %v", dir, err)) - return err - } - klog.V(4).Info(log("setup created mount point directory %s", dir)) - - diskMounter := util.NewSafeFormatAndMountFromHost(v.plugin.GetPluginName(), v.plugin.host) - err = diskMounter.FormatAndMount(devicePath, dir, v.fsType, options) - - if err != nil { - klog.Error(log("mount operation failed during setup: %v", err)) - if err := os.Remove(dir); err != nil && !os.IsNotExist(err) { - klog.Error(log("failed to remove dir %s during a failed mount at setup: %v", dir, err)) - return err - } - return err - } - - if !v.readOnly && mounterArgs.FsGroup != nil { - klog.V(4).Info(log("applying value FSGroup ownership")) - volume.SetVolumeOwnership(v, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(v.plugin, v.spec)) - } - - klog.V(4).Info(log("successfully setup PV %s: volume %s mapped as %s mounted at %s", v.volSpecName, v.volName, devicePath, dir)) - return nil -} - -func (v *sioVolume) GetAttributes() volume.Attributes { - return volume.Attributes{ - ReadOnly: v.readOnly, - Managed: !v.readOnly, - SupportsSELinux: true, - } -} - -// ********************** -// volume.Unmounter Impl -// ********************* -var _ volume.Unmounter = &sioVolume{} - -// TearDownAt unmounts the bind mount -func (v *sioVolume) TearDown() error { - return v.TearDownAt(v.GetPath()) -} - -// TearDown unmounts and remove the volume -func (v *sioVolume) TearDownAt(dir string) error { - v.plugin.volumeMtx.LockKey(v.volSpecName) - defer v.plugin.volumeMtx.UnlockKey(v.volSpecName) - - mounter := v.plugin.host.GetMounter(v.plugin.GetPluginName()) - dev, _, err := mount.GetDeviceNameFromMount(mounter, dir) - if err != nil { - klog.Errorf(log("failed to get reference count for volume: %s", dir)) - return err - } - - klog.V(4).Info(log("attempting to unmount %s", dir)) - if err := mount.CleanupMountPoint(dir, mounter, false); err != nil { - klog.Error(log("teardown failed while unmounting dir %s: %v ", dir, err)) - return err - } - klog.V(4).Info(log("dir %s unmounted successfully", dir)) - - // detach/unmap - kvh, ok := v.plugin.host.(volume.KubeletVolumeHost) - if !ok { - return fmt.Errorf("plugin volume host does not implement KubeletVolumeHost interface") - } - hu := kvh.GetHostUtil() - deviceBusy, err := hu.DeviceOpened(dev) - if err != nil { - klog.Error(log("teardown unable to get status for device %s: %v", dev, err)) - return err - } - - // Detach volume from node: - // use "last attempt wins" strategy to detach volume from node - // only allow volume to detach when it is not busy (not being used by other pods) - if !deviceBusy { - klog.V(4).Info(log("teardown is attempting to detach/unmap volume for PV %s", v.volSpecName)) - if err := v.resetSioMgr(); err != nil { - klog.Error(log("teardown failed, unable to reset scalio mgr: %v", err)) - } - volName := v.volName - if err := v.sioMgr.DetachVolume(volName); err != nil { - klog.Warning(log("warning: detaching failed for volume %s: %v", volName, err)) - return nil - } - klog.V(4).Infof(log("teardown of volume %v detached successfully", volName)) - } - return nil -} - -// ******************** -// volume.Deleter Impl -// ******************** -var _ volume.Deleter = &sioVolume{} - -func (v *sioVolume) Delete() error { - klog.V(4).Info(log("deleting pvc %s", v.volSpecName)) - - if err := v.setSioMgrFromSpec(); err != nil { - klog.Error(log("delete failed while setting sio manager: %v", err)) - return err - } - - err := v.sioMgr.DeleteVolume(v.volName) - if err != nil { - klog.Error(log("failed to delete volume %s: %v", v.volName, err)) - return err - } - - klog.V(4).Info(log("successfully deleted PV %s with volume %s", v.volSpecName, v.volName)) - return nil -} - -// ************************ -// volume.Provisioner Impl -// ************************ -var _ volume.Provisioner = &sioVolume{} - -func (v *sioVolume) Provision(selectedNode *api.Node, allowedTopologies []api.TopologySelectorTerm) (*api.PersistentVolume, error) { - klog.V(4).Info(log("attempting to dynamically provision pvc %v", v.options.PVC.Name)) - - if !util.AccessModesContainedInAll(v.plugin.GetAccessModes(), v.options.PVC.Spec.AccessModes) { - return nil, fmt.Errorf("invalid AccessModes %v: only AccessModes %v are supported", v.options.PVC.Spec.AccessModes, v.plugin.GetAccessModes()) - } - - if util.CheckPersistentVolumeClaimModeBlock(v.options.PVC) { - return nil, fmt.Errorf("%s does not support block volume provisioning", v.plugin.GetPluginName()) - } - - // setup volume attrributes - genName := v.generateName("k8svol", 11) - - capacity := v.options.PVC.Spec.Resources.Requests[api.ResourceName(api.ResourceStorage)] - - volSizeGiB, err := volumehelpers.RoundUpToGiB(capacity) - if err != nil { - return nil, err - } - - if volSizeGiB < minimumVolumeSizeGiB { - volSizeGiB = minimumVolumeSizeGiB - klog.V(4).Info(log("capacity less than 8Gi found, adjusted to %dGi", volSizeGiB)) - - } - - // create sio manager - if err := v.setSioMgrFromConfig(); err != nil { - klog.Error(log("provision failed while setting up sio mgr: %v", err)) - return nil, err - } - - // create volume - volName := genName - vol, err := v.sioMgr.CreateVolume(volName, volSizeGiB) - if err != nil { - klog.Error(log("provision failed while creating volume: %v", err)) - return nil, err - } - - // prepare data for pv - v.configData[confKey.volumeName] = volName - sslEnabled, err := strconv.ParseBool(v.configData[confKey.sslEnabled]) - if err != nil { - klog.Warning(log("failed to parse parameter sslEnabled, setting to false")) - sslEnabled = false - } - readOnly, err := strconv.ParseBool(v.configData[confKey.readOnly]) - if err != nil { - klog.Warning(log("failed to parse parameter readOnly, setting it to false")) - readOnly = false - } - - // describe created pv - pvName := genName - pv := &api.PersistentVolume{ - ObjectMeta: meta.ObjectMeta{ - Name: pvName, - Namespace: v.options.PVC.Namespace, - Labels: map[string]string{}, - Annotations: map[string]string{ - util.VolumeDynamicallyCreatedByKey: "scaleio-dynamic-provisioner", - }, - }, - Spec: api.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: v.options.PersistentVolumeReclaimPolicy, - AccessModes: v.options.PVC.Spec.AccessModes, - Capacity: api.ResourceList{ - api.ResourceName(api.ResourceStorage): resource.MustParse( - fmt.Sprintf("%dGi", volSizeGiB), - ), - }, - PersistentVolumeSource: api.PersistentVolumeSource{ - ScaleIO: &api.ScaleIOPersistentVolumeSource{ - Gateway: v.configData[confKey.gateway], - SSLEnabled: sslEnabled, - SecretRef: &api.SecretReference{Name: v.secretName, Namespace: v.secretNamespace}, - System: v.configData[confKey.system], - ProtectionDomain: v.configData[confKey.protectionDomain], - StoragePool: v.configData[confKey.storagePool], - StorageMode: v.configData[confKey.storageMode], - VolumeName: volName, - FSType: v.configData[confKey.fsType], - ReadOnly: readOnly, - }, - }, - }, - } - if len(v.options.PVC.Spec.AccessModes) == 0 { - pv.Spec.AccessModes = v.plugin.GetAccessModes() - } - - klog.V(4).Info(log("provisioner created pv %v and volume %s successfully", pvName, vol.Name)) - return pv, nil -} - -// setSioMgr creates scaleio mgr from cached config data if found -// otherwise, setups new config data and create mgr -func (v *sioVolume) setSioMgr() error { - klog.V(4).Info(log("setting up sio mgr for spec %s", v.volSpecName)) - podDir := v.plugin.host.GetPodPluginDir(v.podUID, sioPluginName) - configName := filepath.Join(podDir, sioConfigFileName) - if v.sioMgr == nil { - configData, err := loadConfig(configName) // try to load config if exist - if err != nil { - if !os.IsNotExist(err) { - klog.Error(log("failed to load config %s : %v", configName, err)) - return err - } - klog.V(4).Info(log("previous config file not found, creating new one")) - // prepare config data - configData = make(map[string]string) - mapVolumeSpec(configData, v.spec) - - // additional config data - configData[confKey.secretNamespace] = v.secretNamespace - configData[confKey.secretName] = v.secretName - configData[confKey.volSpecName] = v.volSpecName - - if err := validateConfigs(configData); err != nil { - klog.Error(log("config setup failed: %s", err)) - return err - } - - // persist config - if err := saveConfig(configName, configData); err != nil { - klog.Error(log("failed to save config data: %v", err)) - return err - } - } - // merge in secret - if err := attachSecret(v.plugin, v.secretNamespace, configData); err != nil { - klog.Error(log("failed to load secret: %v", err)) - return err - } - - // merge in Sdc Guid label value - if err := attachSdcGUID(v.plugin, configData); err != nil { - klog.Error(log("failed to retrieve sdc guid: %v", err)) - return err - } - mgr, err := newSioMgr(configData, v.plugin.host, v.plugin.host.GetExec(v.plugin.GetPluginName())) - - if err != nil { - klog.Error(log("failed to reset sio manager: %v", err)) - return err - } - - v.sioMgr = mgr - } - return nil -} - -// resetSioMgr creates scaleio manager from existing (cached) config data -func (v *sioVolume) resetSioMgr() error { - podDir := v.plugin.host.GetPodPluginDir(v.podUID, sioPluginName) - configName := filepath.Join(podDir, sioConfigFileName) - if v.sioMgr == nil { - // load config data from disk - configData, err := loadConfig(configName) - if err != nil { - klog.Error(log("failed to load config data: %v", err)) - return err - } - v.secretName = configData[confKey.secretName] - v.secretNamespace = configData[confKey.secretNamespace] - v.volName = configData[confKey.volumeName] - v.volSpecName = configData[confKey.volSpecName] - - // attach secret - if err := attachSecret(v.plugin, v.secretNamespace, configData); err != nil { - klog.Error(log("failed to load secret: %v", err)) - return err - } - - // merge in Sdc Guid label value - if err := attachSdcGUID(v.plugin, configData); err != nil { - klog.Error(log("failed to retrieve sdc guid: %v", err)) - return err - } - mgr, err := newSioMgr(configData, v.plugin.host, v.plugin.host.GetExec(v.plugin.GetPluginName())) - - if err != nil { - klog.Error(log("failed to reset scaleio mgr: %v", err)) - return err - } - v.sioMgr = mgr - } - return nil -} - -// setSioFromConfig sets up scaleio mgr from an available config data map -// designed to be called from dynamic provisioner -func (v *sioVolume) setSioMgrFromConfig() error { - klog.V(4).Info(log("setting scaleio mgr from available config")) - if v.sioMgr == nil { - applyConfigDefaults(v.configData) - - v.configData[confKey.volSpecName] = v.volSpecName - - if err := validateConfigs(v.configData); err != nil { - klog.Error(log("config data setup failed: %s", err)) - return err - } - - // copy config and attach secret - data := map[string]string{} - for k, v := range v.configData { - data[k] = v - } - - if err := attachSecret(v.plugin, v.secretNamespace, data); err != nil { - klog.Error(log("failed to load secret: %v", err)) - return err - } - mgr, err := newSioMgr(data, v.plugin.host, v.plugin.host.GetExec(v.plugin.GetPluginName())) - - if err != nil { - klog.Error(log("failed while setting scaleio mgr from config: %v", err)) - return err - } - v.sioMgr = mgr - } - return nil -} - -// setSioMgrFromSpec sets the scaleio manager from a spec object. -// The spec may be complete or incomplete depending on lifecycle phase. -func (v *sioVolume) setSioMgrFromSpec() error { - klog.V(4).Info(log("setting sio manager from spec")) - if v.sioMgr == nil { - // get config data form spec volume source - configData := map[string]string{} - mapVolumeSpec(configData, v.spec) - - // additional config - configData[confKey.secretNamespace] = v.secretNamespace - configData[confKey.secretName] = v.secretName - configData[confKey.volSpecName] = v.volSpecName - - if err := validateConfigs(configData); err != nil { - klog.Error(log("config setup failed: %s", err)) - return err - } - - // attach secret object to config data - if err := attachSecret(v.plugin, v.secretNamespace, configData); err != nil { - klog.Error(log("failed to load secret: %v", err)) - return err - } - mgr, err := newSioMgr(configData, v.plugin.host, v.plugin.host.GetExec(v.plugin.GetPluginName())) - - if err != nil { - klog.Error(log("failed to reset sio manager: %v", err)) - return err - } - v.sioMgr = mgr - } - return nil -} - -func (v *sioVolume) generateName(prefix string, size int) string { - return fmt.Sprintf("%s-%s", prefix, strings.Replace(string(uuid.NewUUID()), "-", "", -1)[0:size]) -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/secret/secret.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/secret/secret.go index 3c3ac552546b..8226b2209ee4 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/secret/secret.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/secret/secret.go @@ -263,7 +263,7 @@ func (b *secretVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs // MakePayload function is exported so that it can be called from the projection volume driver func MakePayload(mappings []v1.KeyToPath, secret *v1.Secret, defaultMode *int32, optional bool) (map[string]volumeutil.FileProjection, error) { if defaultMode == nil { - return nil, fmt.Errorf("No defaultMode used, not even the default value for it") + return nil, fmt.Errorf("no defaultMode used, not even the default value for it") } payload := make(map[string]volumeutil.FileProjection, len(secret.Data)) diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/storageos/storageos.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/storageos/storageos.go index 9d742df7d1da..bb3457870e1e 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/storageos/storageos.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/storageos/storageos.go @@ -452,7 +452,7 @@ func getVolumeInfo(pvName string, podUID types.UID, host volume.VolumeHost) (str volumeDir := filepath.Dir(host.GetPodVolumeDir(podUID, utilstrings.EscapeQualifiedName(storageosPluginName), pvName)) files, err := ioutil.ReadDir(volumeDir) if err != nil { - return "", "", fmt.Errorf("Could not read mounts from pod volume dir: %s", err) + return "", "", fmt.Errorf("could not read mounts from pod volume dir: %s", err) } for _, f := range files { if f.Mode().IsDir() && strings.HasPrefix(f.Name(), pvName+".") { @@ -461,7 +461,7 @@ func getVolumeInfo(pvName string, podUID types.UID, host volume.VolumeHost) (str } } } - return "", "", fmt.Errorf("Could not get info from unmounted pv %q at %q", pvName, volumeDir) + return "", "", fmt.Errorf("could not get info from unmounted pv %q at %q", pvName, volumeDir) } // Splits the volume ref on "." to return the volNamespace and pvName. Neither diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/storageos/storageos_util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/storageos/storageos_util.go index 8f080e39f9af..3199c9157097 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/storageos/storageos_util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/storageos/storageos_util.go @@ -19,6 +19,7 @@ package storageos import ( "errors" "fmt" + "io/ioutil" "os" "path/filepath" "strings" @@ -346,7 +347,7 @@ func pathDeviceType(path string) (deviceType, error) { // attachFileDevice takes a path to a regular file and makes it available as an // attached block device. func attachFileDevice(path string, exec utilexec.Interface) (string, error) { - blockDevicePath, err := getLoopDevice(path, exec) + blockDevicePath, err := getLoopDevice(path) if err != nil && err.Error() != ErrDeviceNotFound { return "", err } @@ -363,7 +364,7 @@ func attachFileDevice(path string, exec utilexec.Interface) (string, error) { } // Returns the full path to the loop device associated with the given path. -func getLoopDevice(path string, exec utilexec.Interface) (string, error) { +func getLoopDevice(path string) (string, error) { _, err := os.Stat(path) if os.IsNotExist(err) { return "", errors.New(ErrNotAvailable) @@ -372,23 +373,18 @@ func getLoopDevice(path string, exec utilexec.Interface) (string, error) { return "", fmt.Errorf("not attachable: %v", err) } - args := []string{"-j", path} - out, err := exec.Command(losetupPath, args...).CombinedOutput() - if err != nil { - klog.V(2).Infof("Failed device discover command for path %s: %v", path, err) - return "", err - } - return parseLosetupOutputForDevice(out) + return getLoopDeviceFromSysfs(path) } func makeLoopDevice(path string, exec utilexec.Interface) (string, error) { - args := []string{"-f", "-P", "--show", path} + args := []string{"-f", "-P", path} out, err := exec.Command(losetupPath, args...).CombinedOutput() if err != nil { - klog.V(2).Infof("Failed device create command for path %s: %v", path, err) + klog.V(2).Infof("Failed device create command for path %s: %v %s", path, err, out) return "", err } - return parseLosetupOutputForDevice(out) + + return getLoopDeviceFromSysfs(path) } func removeLoopDevice(device string, exec utilexec.Interface) error { @@ -406,16 +402,35 @@ func isLoopDevice(device string) bool { return strings.HasPrefix(device, "/dev/loop") } -func parseLosetupOutputForDevice(output []byte) (string, error) { - if len(output) == 0 { +// getLoopDeviceFromSysfs finds the backing file for a loop +// device from sysfs via "/sys/block/loop*/loop/backing_file". +func getLoopDeviceFromSysfs(path string) (string, error) { + // If the file is a symlink. + realPath, err := filepath.EvalSymlinks(path) + if err != nil { return "", errors.New(ErrDeviceNotFound) } - // losetup returns device in the format: - // /dev/loop1: [0073]:148662 (/var/lib/storageos/volumes/308f14af-cf0a-08ff-c9c3-b48104318e05) - device := strings.TrimSpace(strings.SplitN(string(output), ":", 2)[0]) - if len(device) == 0 { + devices, err := filepath.Glob("/sys/block/loop*") + if err != nil { return "", errors.New(ErrDeviceNotFound) } - return device, nil + + for _, device := range devices { + backingFile := fmt.Sprintf("%s/loop/backing_file", device) + + // The contents of this file is the absolute path of "path". + data, err := ioutil.ReadFile(backingFile) + if err != nil { + continue + } + + // Return the first match. + backingFilePath := strings.TrimSpace(string(data)) + if backingFilePath == path || backingFilePath == realPath { + return fmt.Sprintf("/dev/%s", filepath.Base(device)), nil + } + } + + return "", errors.New(ErrDeviceNotFound) } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/metrics.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/metrics.go index 2cacae3f8bb7..356566227bd7 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/metrics.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/metrics.go @@ -38,7 +38,7 @@ const ( /* * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/types/types.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/types/types.go index c07dcfe215c5..af309353ba75 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/types/types.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/types/types.go @@ -148,10 +148,7 @@ func IsOperationFinishedError(err error) bool { // on PVC and actual filesystem on disk did not match func IsFilesystemMismatchError(err error) bool { mountError := mount.MountError{} - if errors.As(err, &mountError) && mountError.Type == mount.FilesystemMismatch { - return true - } - return false + return errors.As(err, &mountError) && mountError.Type == mount.FilesystemMismatch } // IsUncertainProgressError checks if given error is of type that indicates diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/util.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/util.go index fdc7bfb1b049..0c160ced0959 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/util.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/util.go @@ -20,18 +20,12 @@ import ( "context" "fmt" "io/ioutil" - storagehelpers "k8s.io/component-helpers/storage/volume" "os" "path/filepath" "reflect" "runtime" "strings" - - "k8s.io/component-helpers/scheduling/corev1" - "k8s.io/klog/v2" - "k8s.io/mount-utils" - utilexec "k8s.io/utils/exec" - utilstrings "k8s.io/utils/strings" + "time" v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" @@ -40,13 +34,21 @@ import ( apiruntime "k8s.io/apimachinery/pkg/runtime" utypes "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/wait" clientset "k8s.io/client-go/kubernetes" + "k8s.io/component-helpers/scheduling/corev1" + storagehelpers "k8s.io/component-helpers/storage/volume" + "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/api/legacyscheme" podutil "k8s.io/kubernetes/pkg/api/v1/pod" "k8s.io/kubernetes/pkg/securitycontext" "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume/util/types" "k8s.io/kubernetes/pkg/volume/util/volumepathhandler" + "k8s.io/mount-utils" + utilexec "k8s.io/utils/exec" + "k8s.io/utils/io" + utilstrings "k8s.io/utils/strings" ) const ( @@ -130,7 +132,7 @@ func GetSecretForPod(pod *v1.Pod, secretName string, kubeClient clientset.Interf func GetSecretForPV(secretNamespace, secretName, volumePluginName string, kubeClient clientset.Interface) (map[string]string, error) { secret := make(map[string]string) if kubeClient == nil { - return secret, fmt.Errorf("Cannot get kube client") + return secret, fmt.Errorf("cannot get kube client") } secrets, err := kubeClient.CoreV1().Secrets(secretNamespace).Get(context.TODO(), secretName, metav1.GetOptions{}) if err != nil { @@ -732,3 +734,27 @@ func IsDeviceMountableVolume(volumeSpec *volume.Spec, volumePluginMgr *volume.Vo return false } + +// GetReliableMountRefs calls mounter.GetMountRefs and retries on IsInconsistentReadError. +// To be used in volume reconstruction of volume plugins that don't have any protection +// against mounting a single volume on multiple nodes (such as attach/detach). +func GetReliableMountRefs(mounter mount.Interface, mountPath string) ([]string, error) { + var paths []string + var lastErr error + err := wait.PollImmediate(10*time.Millisecond, time.Minute, func() (bool, error) { + var err error + paths, err = mounter.GetMountRefs(mountPath) + if io.IsInconsistentReadError(err) { + lastErr = err + return false, nil + } + if err != nil { + return false, err + } + return true, nil + }) + if err == wait.ErrWaitTimeout { + return nil, lastErr + } + return paths, err +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler_linux.go index 15e3a10c4e8b..2e4fb78ffb01 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler_linux.go @@ -19,9 +19,9 @@ limitations under the License. package volumepathhandler import ( - "bufio" "errors" "fmt" + "io/ioutil" "os" "os/exec" "path/filepath" @@ -83,32 +83,20 @@ func (v VolumePathHandler) GetLoopDevice(path string) (string, error) { return "", fmt.Errorf("not attachable: %v", err) } - args := []string{"-j", path} - cmd := exec.Command(losetupPath, args...) - out, err := cmd.CombinedOutput() - if err != nil { - klog.V(2).Infof("Failed device discover command for path %s: %v %s", path, err, out) - return "", fmt.Errorf("losetup -j %s failed: %v", path, err) - } - return parseLosetupOutputForDevice(out, path) + return getLoopDeviceFromSysfs(path) } func makeLoopDevice(path string) (string, error) { - args := []string{"-f", "--show", path} + args := []string{"-f", path} cmd := exec.Command(losetupPath, args...) + out, err := cmd.CombinedOutput() if err != nil { - klog.V(2).Infof("Failed device create command for path: %s %v %s ", path, err, out) - return "", fmt.Errorf("losetup -f --show %s failed: %v", path, err) + klog.V(2).Infof("Failed device create command for path: %s %v %s", path, err, out) + return "", fmt.Errorf("losetup %s failed: %v", strings.Join(args, " "), err) } - // losetup -f --show {path} returns device in the format: - // /dev/loop1 - if len(out) == 0 { - return "", errors.New(ErrDeviceNotFound) - } - - return strings.TrimSpace(string(out)), nil + return getLoopDeviceFromSysfs(path) } // removeLoopDevice removes specified loopback device @@ -126,51 +114,37 @@ func removeLoopDevice(device string) error { return nil } -func parseLosetupOutputForDevice(output []byte, path string) (string, error) { - if len(output) == 0 { - return "", errors.New(ErrDeviceNotFound) - } - +// getLoopDeviceFromSysfs finds the backing file for a loop +// device from sysfs via "/sys/block/loop*/loop/backing_file". +func getLoopDeviceFromSysfs(path string) (string, error) { + // If the file is a symlink. realPath, err := filepath.EvalSymlinks(path) if err != nil { return "", fmt.Errorf("failed to evaluate path %s: %s", path, err) } - // losetup -j {path} returns device in the format: - // /dev/loop1: [0073]:148662 ({path}) - // /dev/loop2: [0073]:148662 (/dev/sdX) - // - // losetup -j shows all the loop device for the same device that has the same - // major/minor number, by resolving symlink and matching major/minor number. - // Therefore, there will be other path than {path} in output, as shown in above output. - s := string(output) - // Find the line that exact matches to the path, or "({path})" - var matched string - scanner := bufio.NewScanner(strings.NewReader(s)) - for scanner.Scan() { - // losetup output has symlinks expanded - if strings.HasSuffix(scanner.Text(), "("+realPath+")") { - matched = scanner.Text() - break + devices, err := filepath.Glob("/sys/block/loop*") + if err != nil { + return "", fmt.Errorf("failed to list loop devices in sysfs: %s", err) + } + + for _, device := range devices { + backingFile := fmt.Sprintf("%s/loop/backing_file", device) + + // The contents of this file is the absolute path of "path". + data, err := ioutil.ReadFile(backingFile) + if err != nil { + continue } - // Just in case losetup changes, check for the original path too - if strings.HasSuffix(scanner.Text(), "("+path+")") { - matched = scanner.Text() - break + + // Return the first match. + backingFilePath := strings.TrimSpace(string(data)) + if backingFilePath == path || backingFilePath == realPath { + return fmt.Sprintf("/dev/%s", filepath.Base(device)), nil } } - if len(matched) == 0 { - return "", errors.New(ErrDeviceNotFound) - } - s = matched - // Get device name, or the 0th field of the output separated with ":". - // We don't need 1st field or later to be splitted, so passing 2 to SplitN. - device := strings.TrimSpace(strings.SplitN(s, ":", 2)[0]) - if len(device) == 0 { - return "", errors.New(ErrDeviceNotFound) - } - return device, nil + return "", errors.New(ErrDeviceNotFound) } // FindGlobalMapPathUUIDFromPod finds {pod uuid} bind mount under globalMapPath diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume.go index 642f72645f8f..63246a85a5d2 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/volume.go @@ -49,6 +49,10 @@ type BlockVolume interface { // ex. pods/{podUid}/{DefaultKubeletVolumeDevicesDirName}/{escapeQualifiedPluginName}/, {volumeName} GetPodDeviceMapPath() (string, string) + // SupportsMetrics should return true if the MetricsProvider is + // initialized + SupportsMetrics() bool + // MetricsProvider embeds methods for exposing metrics (e.g. // used, available space). MetricsProvider diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_block.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_block.go index f12080490693..721c252ebc9a 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_block.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_block.go @@ -97,7 +97,7 @@ func (plugin *vsphereVolumePlugin) newBlockVolumeMapperInternal(spec *volume.Spe return nil, err } volPath := volumeSource.VolumePath - return &vsphereBlockVolumeMapper{ + mapper := &vsphereBlockVolumeMapper{ vsphereVolume: &vsphereVolume{ volName: spec.Name(), podUID: podUID, @@ -107,8 +107,15 @@ func (plugin *vsphereVolumePlugin) newBlockVolumeMapperInternal(spec *volume.Spe plugin: plugin, MetricsProvider: volume.NewMetricsStatFS(getPath(podUID, spec.Name(), plugin.host)), }, - }, nil + } + blockPath, err := mapper.GetGlobalMapPath(spec) + if err != nil { + return nil, fmt.Errorf("failed to get device path: %v", err) + } + mapper.MetricsProvider = volume.NewMetricsBlock(filepath.Join(blockPath, string(podUID))) + + return mapper, nil } func (plugin *vsphereVolumePlugin) NewBlockVolumeUnmapper(volName string, podUID types.UID) (volume.BlockVolumeUnmapper, error) { @@ -137,6 +144,7 @@ var _ volume.BlockVolumeUnmapper = &vsphereBlockVolumeUnmapper{} type vsphereBlockVolumeUnmapper struct { *vsphereVolume + volume.MetricsNil } // GetGlobalMapPath returns global map path and error @@ -152,3 +160,9 @@ func (v *vsphereVolume) GetGlobalMapPath(spec *volume.Spec) (string, error) { func (v *vsphereVolume) GetPodDeviceMapPath() (string, string) { return v.plugin.host.GetPodVolumeDeviceDir(v.podUID, utilstrings.EscapeQualifiedName(vsphereVolumePluginName)), v.volName } + +// SupportsMetrics returns true for vsphereBlockVolumeMapper as it initializes the +// MetricsProvider. +func (vbvm *vsphereBlockVolumeMapper) SupportsMetrics() bool { + return true +} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_util_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_util_linux.go index 2ca2903deab4..7c8254eb9d75 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_util_linux.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/vsphere_volume/vsphere_volume_util_linux.go @@ -27,7 +27,7 @@ import ( func verifyDevicePath(path string) (string, error) { if pathExists, err := mount.PathExists(path); err != nil { - return "", fmt.Errorf("Error checking if path exists: %v", err) + return "", fmt.Errorf("error checking if path exists: %w", err) } else if pathExists { return path, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/test/utils/runners.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/test/utils/runners.go index b5d83b82cba2..2ca21e60ff4c 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/test/utils/runners.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/test/utils/runners.go @@ -80,7 +80,7 @@ func WaitUntilPodIsScheduled(c clientset.Interface, name, namespace string, time return p, nil } } - return nil, fmt.Errorf("Timed out after %v when waiting for pod %v/%v to start.", timeout, namespace, name) + return nil, fmt.Errorf("timed out after %v when waiting for pod %v/%v to start", timeout, namespace, name) } func RunPodAndGetNodeName(c clientset.Interface, pod *v1.Pod, timeout time.Duration) (string, error) { @@ -357,7 +357,7 @@ func (config *DeploymentConfig) create() error { config.applyTo(&deployment.Spec.Template) if err := CreateDeploymentWithRetries(config.Client, config.Namespace, deployment); err != nil { - return fmt.Errorf("Error creating deployment: %v", err) + return fmt.Errorf("error creating deployment: %v", err) } config.RCConfigLog("Created deployment with name: %v, namespace: %v, replica count: %v", deployment.Name, config.Namespace, removePtr(deployment.Spec.Replicas)) return nil @@ -435,7 +435,7 @@ func (config *ReplicaSetConfig) create() error { config.applyTo(&rs.Spec.Template) if err := CreateReplicaSetWithRetries(config.Client, config.Namespace, rs); err != nil { - return fmt.Errorf("Error creating replica set: %v", err) + return fmt.Errorf("error creating replica set: %v", err) } config.RCConfigLog("Created replica set with name: %v, namespace: %v, replica count: %v", rs.Name, config.Namespace, removePtr(rs.Spec.Replicas)) return nil @@ -509,7 +509,7 @@ func (config *JobConfig) create() error { config.applyTo(&job.Spec.Template) if err := CreateJobWithRetries(config.Client, config.Namespace, job); err != nil { - return fmt.Errorf("Error creating job: %v", err) + return fmt.Errorf("error creating job: %v", err) } config.RCConfigLog("Created job with name: %v, namespace: %v, parallelism/completions: %v", job.Name, config.Namespace, job.Spec.Parallelism) return nil @@ -628,7 +628,7 @@ func (config *RCConfig) create() error { config.applyTo(rc.Spec.Template) if err := CreateRCWithRetries(config.Client, config.Namespace, rc); err != nil { - return fmt.Errorf("Error creating replication controller: %v", err) + return fmt.Errorf("error creating replication controller: %v", err) } config.RCConfigLog("Created replication controller with name: %v, namespace: %v, replica count: %v", rc.Name, config.Namespace, removePtr(rc.Spec.Replicas)) return nil @@ -850,7 +850,7 @@ func (config *RCConfig) start() error { } else { config.RCConfigLog("Can't list pod debug info: %v", err) } - return fmt.Errorf("Only %d pods started out of %d", oldRunning, config.Replicas) + return fmt.Errorf("only %d pods started out of %d", oldRunning, config.Replicas) } return nil } @@ -880,7 +880,7 @@ func StartPods(c clientset.Interface, replicas int, namespace string, podNamePre label := labels.SelectorFromSet(labels.Set(map[string]string{"startPodsID": startPodsID})) err := WaitForPodsWithLabelRunning(c, namespace, label) if err != nil { - return fmt.Errorf("Error waiting for %d pods to be running - probably a timeout: %v", replicas, err) + return fmt.Errorf("error waiting for %d pods to be running - probably a timeout: %v", replicas, err) } } return nil @@ -920,7 +920,7 @@ func WaitForEnoughPodsWithLabelRunning(c clientset.Interface, ns string, label l break } if !running { - return fmt.Errorf("Timeout while waiting for pods with labels %q to be running", label.String()) + return fmt.Errorf("timeout while waiting for pods with labels %q to be running", label.String()) } return nil } @@ -1194,12 +1194,12 @@ func DoPrepareNode(client clientset.Interface, node *v1.Node, strategy PrepareNo break } if !apierrors.IsConflict(err) { - return fmt.Errorf("Error while applying patch %v to Node %v: %v", string(patch), node.Name, err) + return fmt.Errorf("error while applying patch %v to Node %v: %v", string(patch), node.Name, err) } time.Sleep(100 * time.Millisecond) } if err != nil { - return fmt.Errorf("Too many conflicts when applying patch %v to Node %v: %s", string(patch), node.Name, err) + return fmt.Errorf("too many conflicts when applying patch %v to Node %v: %s", string(patch), node.Name, err) } for attempt := 0; attempt < retries; attempt++ { @@ -1207,12 +1207,12 @@ func DoPrepareNode(client clientset.Interface, node *v1.Node, strategy PrepareNo break } if !apierrors.IsConflict(err) { - return fmt.Errorf("Error while preparing objects for node %s: %s", node.Name, err) + return fmt.Errorf("error while preparing objects for node %s: %s", node.Name, err) } time.Sleep(100 * time.Millisecond) } if err != nil { - return fmt.Errorf("Too many conflicts when creating objects for node %s: %s", node.Name, err) + return fmt.Errorf("too many conflicts when creating objects for node %s: %s", node.Name, err) } return nil } @@ -1220,9 +1220,10 @@ func DoPrepareNode(client clientset.Interface, node *v1.Node, strategy PrepareNo func DoCleanupNode(client clientset.Interface, nodeName string, strategy PrepareNodeStrategy) error { var err error for attempt := 0; attempt < retries; attempt++ { - node, err := client.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{}) + var node *v1.Node + node, err = client.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{}) if err != nil { - return fmt.Errorf("Skipping cleanup of Node: failed to get Node %v: %v", nodeName, err) + return fmt.Errorf("skipping cleanup of Node: failed to get Node %v: %v", nodeName, err) } updatedNode := strategy.CleanupNode(node) if apiequality.Semantic.DeepEqual(node, updatedNode) { @@ -1232,12 +1233,12 @@ func DoCleanupNode(client clientset.Interface, nodeName string, strategy Prepare break } if !apierrors.IsConflict(err) { - return fmt.Errorf("Error when updating Node %v: %v", nodeName, err) + return fmt.Errorf("error when updating Node %v: %v", nodeName, err) } time.Sleep(100 * time.Millisecond) } if err != nil { - return fmt.Errorf("Too many conflicts when trying to cleanup Node %v: %s", nodeName, err) + return fmt.Errorf("too many conflicts when trying to cleanup Node %v: %s", nodeName, err) } for attempt := 0; attempt < retries; attempt++ { @@ -1246,12 +1247,12 @@ func DoCleanupNode(client clientset.Interface, nodeName string, strategy Prepare break } if !apierrors.IsConflict(err) { - return fmt.Errorf("Error when cleaning up Node %v objects: %v", nodeName, err) + return fmt.Errorf("error when cleaning up Node %v objects: %v", nodeName, err) } time.Sleep(100 * time.Millisecond) } if err != nil { - return fmt.Errorf("Too many conflicts when trying to cleanup Node %v objects: %s", nodeName, err) + return fmt.Errorf("too many conflicts when trying to cleanup Node %v objects: %s", nodeName, err) } return nil } @@ -1303,7 +1304,7 @@ func MakePodSpec() v1.PodSpec { return v1.PodSpec{ Containers: []v1.Container{{ Name: "pause", - Image: "k8s.gcr.io/pause:3.4.1", + Image: "k8s.gcr.io/pause:3.5", Ports: []v1.ContainerPort{{ContainerPort: 80}}, Resources: v1.ResourceRequirements{ Limits: v1.ResourceList{ @@ -1321,7 +1322,7 @@ func MakePodSpec() v1.PodSpec { func makeCreatePod(client clientset.Interface, namespace string, podTemplate *v1.Pod) error { if err := CreatePodWithRetries(client, namespace, podTemplate); err != nil { - return fmt.Errorf("Error creating pod: %v", err) + return fmt.Errorf("error creating pod: %v", err) } return nil } @@ -1450,7 +1451,7 @@ func createController(client clientset.Interface, controllerName, namespace stri }, } if err := CreateRCWithRetries(client, namespace, rc); err != nil { - return fmt.Errorf("Error creating replication controller: %v", err) + return fmt.Errorf("error creating replication controller: %v", err) } return nil } @@ -1557,7 +1558,7 @@ func (config *SecretConfig) Run() error { } if err := CreateSecretWithRetries(config.Client, config.Namespace, secret); err != nil { - return fmt.Errorf("Error creating secret: %v", err) + return fmt.Errorf("error creating secret: %v", err) } config.LogFunc("Created secret %v/%v", config.Namespace, config.Name) return nil @@ -1565,7 +1566,7 @@ func (config *SecretConfig) Run() error { func (config *SecretConfig) Stop() error { if err := DeleteResourceWithRetries(config.Client, api.Kind("Secret"), config.Namespace, config.Name, metav1.DeleteOptions{}); err != nil { - return fmt.Errorf("Error deleting secret: %v", err) + return fmt.Errorf("error deleting secret: %v", err) } config.LogFunc("Deleted secret %v/%v", config.Namespace, config.Name) return nil @@ -1615,7 +1616,7 @@ func (config *ConfigMapConfig) Run() error { } if err := CreateConfigMapWithRetries(config.Client, config.Namespace, configMap); err != nil { - return fmt.Errorf("Error creating configmap: %v", err) + return fmt.Errorf("error creating configmap: %v", err) } config.LogFunc("Created configmap %v/%v", config.Namespace, config.Name) return nil @@ -1623,7 +1624,7 @@ func (config *ConfigMapConfig) Run() error { func (config *ConfigMapConfig) Stop() error { if err := DeleteResourceWithRetries(config.Client, api.Kind("ConfigMap"), config.Namespace, config.Name, metav1.DeleteOptions{}); err != nil { - return fmt.Errorf("Error deleting configmap: %v", err) + return fmt.Errorf("error deleting configmap: %v", err) } config.LogFunc("Deleted configmap %v/%v", config.Namespace, config.Name) return nil @@ -1725,7 +1726,7 @@ type DaemonConfig struct { func (config *DaemonConfig) Run() error { if config.Image == "" { - config.Image = "k8s.gcr.io/pause:3.4.1" + config.Image = "k8s.gcr.io/pause:3.5" } nameLabel := map[string]string{ "name": config.Name + "-daemon", @@ -1752,7 +1753,7 @@ func (config *DaemonConfig) Run() error { } if err := CreateDaemonSetWithRetries(config.Client, config.Namespace, daemon); err != nil { - return fmt.Errorf("Error creating daemonset: %v", err) + return fmt.Errorf("error creating daemonset: %v", err) } var nodes *v1.NodeList @@ -1763,7 +1764,7 @@ func (config *DaemonConfig) Run() error { if err == nil { break } else if i+1 == retries { - return fmt.Errorf("Error listing Nodes while waiting for DaemonSet %v: %v", config.Name, err) + return fmt.Errorf("error listing Nodes while waiting for DaemonSet %v: %v", config.Name, err) } } diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/test/utils/update_resources.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/test/utils/update_resources.go index f47c929103cb..96d30800f59d 100644 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/test/utils/update_resources.go +++ b/cluster-autoscaler/vendor/k8s.io/kubernetes/test/utils/update_resources.go @@ -55,7 +55,7 @@ func ScaleResourceWithRetries(scalesGetter scaleclient.ScalesGetter, namespace, err = scale.WaitForScaleHasDesiredReplicas(scalesGetter, gvr.GroupResource(), name, namespace, size, waitForReplicas) } if err != nil { - return fmt.Errorf("Error while scaling %s to %d replicas: %v", name, size, err) + return fmt.Errorf("error while scaling %s to %d replicas: %v", name, size, err) } return nil } diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go index 0fa011580458..3d59abc8879a 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go @@ -65,6 +65,10 @@ var ( defaultNlbHealthCheckThreshold = int64(3) defaultHealthCheckPort = "traffic-port" defaultHealthCheckPath = "/" + + // Defaults for ELB Target operations + defaultRegisterTargetsChunkSize = 100 + defaultDeregisterTargetsChunkSize = 100 ) func isNLB(annotations map[string]string) bool { @@ -563,6 +567,7 @@ func (c *Cloud) deleteListenerV2(listener *elbv2.Listener) error { // ensureTargetGroup creates a target group with a set of instances. func (c *Cloud) ensureTargetGroup(targetGroup *elbv2.TargetGroup, serviceName types.NamespacedName, mapping nlbPortMapping, instances []string, vpcID string, tags map[string]string) (*elbv2.TargetGroup, error) { dirty := false + expectedTargets := c.computeTargetGroupExpectedTargets(instances, mapping.TrafficPort) if targetGroup == nil { targetType := "instance" name := c.buildTargetGroupName(serviceName, mapping.FrontendPort, mapping.TrafficPort, mapping.TrafficProtocol, targetType, mapping) @@ -609,86 +614,23 @@ func (c *Cloud) ensureTargetGroup(targetGroup *elbv2.TargetGroup, serviceName ty } } - registerInput := &elbv2.RegisterTargetsInput{ - TargetGroupArn: result.TargetGroups[0].TargetGroupArn, - Targets: []*elbv2.TargetDescription{}, - } - for _, instanceID := range instances { - registerInput.Targets = append(registerInput.Targets, &elbv2.TargetDescription{ - Id: aws.String(string(instanceID)), - Port: aws.Int64(mapping.TrafficPort), - }) - } - - _, err = c.elbv2.RegisterTargets(registerInput) - if err != nil { - return nil, fmt.Errorf("error registering targets for load balancer: %q", err) + tg := result.TargetGroups[0] + tgARN := aws.StringValue(tg.TargetGroupArn) + if err := c.ensureTargetGroupTargets(tgARN, expectedTargets, nil); err != nil { + return nil, err } - - return result.TargetGroups[0], nil + return tg, nil } // handle instances in service { - healthResponse, err := c.elbv2.DescribeTargetHealth(&elbv2.DescribeTargetHealthInput{TargetGroupArn: targetGroup.TargetGroupArn}) + tgARN := aws.StringValue(targetGroup.TargetGroupArn) + actualTargets, err := c.obtainTargetGroupActualTargets(tgARN) if err != nil { - return nil, fmt.Errorf("error describing target group health: %q", err) - } - actualIDs := []string{} - for _, healthDescription := range healthResponse.TargetHealthDescriptions { - if aws.StringValue(healthDescription.TargetHealth.State) == elbv2.TargetHealthStateEnumHealthy { - actualIDs = append(actualIDs, *healthDescription.Target.Id) - } else if healthDescription.TargetHealth.Reason != nil { - switch aws.StringValue(healthDescription.TargetHealth.Reason) { - case elbv2.TargetHealthReasonEnumTargetDeregistrationInProgress: - // We don't need to count this instance in service if it is - // on its way out - default: - actualIDs = append(actualIDs, *healthDescription.Target.Id) - } - } - } - - actual := sets.NewString(actualIDs...) - expected := sets.NewString(instances...) - - additions := expected.Difference(actual) - removals := actual.Difference(expected) - - if len(additions) > 0 { - registerInput := &elbv2.RegisterTargetsInput{ - TargetGroupArn: targetGroup.TargetGroupArn, - Targets: []*elbv2.TargetDescription{}, - } - for instanceID := range additions { - registerInput.Targets = append(registerInput.Targets, &elbv2.TargetDescription{ - Id: aws.String(instanceID), - Port: aws.Int64(mapping.TrafficPort), - }) - } - _, err := c.elbv2.RegisterTargets(registerInput) - if err != nil { - return nil, fmt.Errorf("error registering new targets in target group: %q", err) - } - dirty = true + return nil, err } - - if len(removals) > 0 { - deregisterInput := &elbv2.DeregisterTargetsInput{ - TargetGroupArn: targetGroup.TargetGroupArn, - Targets: []*elbv2.TargetDescription{}, - } - for instanceID := range removals { - deregisterInput.Targets = append(deregisterInput.Targets, &elbv2.TargetDescription{ - Id: aws.String(instanceID), - Port: aws.Int64(mapping.TrafficPort), - }) - } - _, err := c.elbv2.DeregisterTargets(deregisterInput) - if err != nil { - return nil, fmt.Errorf("error trying to deregister targets in target group: %q", err) - } - dirty = true + if err := c.ensureTargetGroupTargets(tgARN, expectedTargets, actualTargets); err != nil { + return nil, err } } @@ -738,6 +680,101 @@ func (c *Cloud) ensureTargetGroup(targetGroup *elbv2.TargetGroup, serviceName ty return targetGroup, nil } +func (c *Cloud) ensureTargetGroupTargets(tgARN string, expectedTargets []*elbv2.TargetDescription, actualTargets []*elbv2.TargetDescription) error { + targetsToRegister, targetsToDeregister := c.diffTargetGroupTargets(expectedTargets, actualTargets) + if len(targetsToRegister) > 0 { + targetsToRegisterChunks := c.chunkTargetDescriptions(targetsToRegister, defaultRegisterTargetsChunkSize) + for _, targetsChunk := range targetsToRegisterChunks { + req := &elbv2.RegisterTargetsInput{ + TargetGroupArn: aws.String(tgARN), + Targets: targetsChunk, + } + if _, err := c.elbv2.RegisterTargets(req); err != nil { + return fmt.Errorf("error trying to register targets in target group: %q", err) + } + } + } + if len(targetsToDeregister) > 0 { + targetsToDeregisterChunks := c.chunkTargetDescriptions(targetsToDeregister, defaultDeregisterTargetsChunkSize) + for _, targetsChunk := range targetsToDeregisterChunks { + req := &elbv2.DeregisterTargetsInput{ + TargetGroupArn: aws.String(tgARN), + Targets: targetsChunk, + } + if _, err := c.elbv2.DeregisterTargets(req); err != nil { + return fmt.Errorf("error trying to deregister targets in target group: %q", err) + } + } + } + return nil +} + +func (c *Cloud) computeTargetGroupExpectedTargets(instanceIDs []string, port int64) []*elbv2.TargetDescription { + expectedTargets := make([]*elbv2.TargetDescription, 0, len(instanceIDs)) + for _, instanceID := range instanceIDs { + expectedTargets = append(expectedTargets, &elbv2.TargetDescription{ + Id: aws.String(instanceID), + Port: aws.Int64(port), + }) + } + return expectedTargets +} + +func (c *Cloud) obtainTargetGroupActualTargets(tgARN string) ([]*elbv2.TargetDescription, error) { + req := &elbv2.DescribeTargetHealthInput{ + TargetGroupArn: aws.String(tgARN), + } + resp, err := c.elbv2.DescribeTargetHealth(req) + if err != nil { + return nil, fmt.Errorf("error describing target group health: %q", err) + } + actualTargets := make([]*elbv2.TargetDescription, 0, len(resp.TargetHealthDescriptions)) + for _, targetDesc := range resp.TargetHealthDescriptions { + if targetDesc.TargetHealth.Reason != nil && aws.StringValue(targetDesc.TargetHealth.Reason) == elbv2.TargetHealthReasonEnumTargetDeregistrationInProgress { + continue + } + actualTargets = append(actualTargets, targetDesc.Target) + } + return actualTargets, nil +} + +// diffTargetGroupTargets computes the targets to register and targets to deregister based on existingTargets and desired instances. +func (c *Cloud) diffTargetGroupTargets(expectedTargets []*elbv2.TargetDescription, actualTargets []*elbv2.TargetDescription) (targetsToRegister []*elbv2.TargetDescription, targetsToDeregister []*elbv2.TargetDescription) { + expectedTargetsByUID := make(map[string]*elbv2.TargetDescription, len(expectedTargets)) + for _, target := range expectedTargets { + targetUID := fmt.Sprintf("%v:%v", aws.StringValue(target.Id), aws.Int64Value(target.Port)) + expectedTargetsByUID[targetUID] = target + } + actualTargetsByUID := make(map[string]*elbv2.TargetDescription, len(actualTargets)) + for _, target := range actualTargets { + targetUID := fmt.Sprintf("%v:%v", aws.StringValue(target.Id), aws.Int64Value(target.Port)) + actualTargetsByUID[targetUID] = target + } + + expectedTargetsUIDs := sets.StringKeySet(expectedTargetsByUID) + actualTargetsUIDs := sets.StringKeySet(actualTargetsByUID) + for _, targetUID := range expectedTargetsUIDs.Difference(actualTargetsUIDs).List() { + targetsToRegister = append(targetsToRegister, expectedTargetsByUID[targetUID]) + } + for _, targetUID := range actualTargetsUIDs.Difference(expectedTargetsUIDs).List() { + targetsToDeregister = append(targetsToDeregister, actualTargetsByUID[targetUID]) + } + return targetsToRegister, targetsToDeregister +} + +// chunkTargetDescriptions will split slice of TargetDescription into chunks +func (c *Cloud) chunkTargetDescriptions(targets []*elbv2.TargetDescription, chunkSize int) [][]*elbv2.TargetDescription { + var chunks [][]*elbv2.TargetDescription + for i := 0; i < len(targets); i += chunkSize { + end := i + chunkSize + if end > len(targets) { + end = len(targets) + } + chunks = append(chunks, targets[i:end]) + } + return chunks +} + // updateInstanceSecurityGroupsForNLB will adjust securityGroup's settings to allow inbound traffic into instances from clientCIDRs and portMappings. // TIP: if either instances or clientCIDRs or portMappings are nil, then the securityGroup rules for lbName are cleared. func (c *Cloud) updateInstanceSecurityGroupsForNLB(lbName string, instances map[InstanceID]*ec2.Instance, subnetCIDRs []string, clientCIDRs []string, portMappings []nlbPortMapping) error { diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure.go index 3e9d13dedc30..4ec67fad5bcc 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure.go @@ -92,12 +92,6 @@ const ( externalResourceGroupLabel = "kubernetes.azure.com/resource-group" managedByAzureLabel = "kubernetes.azure.com/managed" - - // LabelFailureDomainBetaZone refer to https://github.com/kubernetes/api/blob/8519c5ea46199d57724725d5b969c5e8e0533692/core/v1/well_known_labels.go#L22-L23 - LabelFailureDomainBetaZone = "failure-domain.beta.kubernetes.io/zone" - - // LabelFailureDomainBetaRegion failure-domain region label - LabelFailureDomainBetaRegion = "failure-domain.beta.kubernetes.io/region" ) const ( @@ -482,7 +476,7 @@ func (az *Cloud) InitializeCloudFromConfig(config *Config, fromSecret bool) erro az.Config = *config az.Environment = *env az.ResourceRequestBackoff = resourceRequestBackoff - az.metadata, err = NewInstanceMetadataService(metadataURL) + az.metadata, err = NewInstanceMetadataService(imdsServer) if err != nil { return err } @@ -751,8 +745,12 @@ func (az *Cloud) SetInformers(informerFactory informers.SharedInformerFactory) { UpdateFunc: func(prev, obj interface{}) { prevNode := prev.(*v1.Node) newNode := obj.(*v1.Node) - if newNode.Labels[LabelFailureDomainBetaZone] == - prevNode.Labels[LabelFailureDomainBetaZone] { + if newNode.Labels[v1.LabelFailureDomainBetaZone] == + prevNode.Labels[v1.LabelFailureDomainBetaZone] { + return + } + if newNode.Labels[v1.LabelTopologyZone] == + prevNode.Labels[v1.LabelTopologyZone] { return } az.updateNodeCaches(prevNode, newNode) @@ -785,11 +783,13 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) { defer az.nodeCachesLock.Unlock() if prevNode != nil { + // Remove from nodeNames cache. az.nodeNames.Delete(prevNode.ObjectMeta.Name) - // Remove from nodeZones cache. - prevZone, ok := prevNode.ObjectMeta.Labels[LabelFailureDomainBetaZone] + // Remove from nodeZones cache + prevZone, ok := prevNode.ObjectMeta.Labels[v1.LabelTopologyZone] + if ok && az.isAvailabilityZone(prevZone) { az.nodeZones[prevZone].Delete(prevNode.ObjectMeta.Name) if az.nodeZones[prevZone].Len() == 0 { @@ -797,6 +797,15 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) { } } + //Remove from nodeZones cache if using depreciated LabelFailureDomainBetaZone + prevZoneFailureDomain, ok := prevNode.ObjectMeta.Labels[v1.LabelFailureDomainBetaZone] + if ok && az.isAvailabilityZone(prevZoneFailureDomain) { + az.nodeZones[prevZone].Delete(prevNode.ObjectMeta.Name) + if az.nodeZones[prevZone].Len() == 0 { + az.nodeZones[prevZone] = nil + } + } + // Remove from nodeResourceGroups cache. _, ok = prevNode.ObjectMeta.Labels[externalResourceGroupLabel] if ok { @@ -815,7 +824,7 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) { az.nodeNames.Insert(newNode.ObjectMeta.Name) // Add to nodeZones cache. - newZone, ok := newNode.ObjectMeta.Labels[LabelFailureDomainBetaZone] + newZone, ok := newNode.ObjectMeta.Labels[v1.LabelTopologyZone] if ok && az.isAvailabilityZone(newZone) { if az.nodeZones[newZone] == nil { az.nodeZones[newZone] = sets.NewString() diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_instance_metadata.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_instance_metadata.go index 85036461d9ba..cfa63d2ab139 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_instance_metadata.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_instance_metadata.go @@ -25,13 +25,18 @@ import ( "net/http" "time" + "k8s.io/klog/v2" azcache "k8s.io/legacy-cloud-providers/azure/cache" ) const ( - metadataCacheTTL = time.Minute - metadataCacheKey = "InstanceMetadata" - metadataURL = "http://169.254.169.254/metadata/instance" + metadataCacheTTL = time.Minute + metadataCacheKey = "InstanceMetadata" + imdsInstanceAPIVersion = "2019-03-11" + imdsLoadBalancerAPIVersion = "2020-10-01" + imdsServer = "http://169.254.169.254" + imdsInstanceURI = "/metadata/instance" + imdsLoadBalancerURI = "/metadata/loadbalancer" ) // NetworkMetadata contains metadata about an instance's network @@ -86,19 +91,35 @@ type InstanceMetadata struct { Network *NetworkMetadata `json:"network,omitempty"` } +// PublicIPMetadata represents the public IP metadata. +type PublicIPMetadata struct { + FrontendIPAddress string `json:"frontendIpAddress,omitempty"` + PrivateIPAddress string `json:"privateIpAddress,omitempty"` +} + +// LoadbalancerProfile represents load balancer profile in IMDS. +type LoadbalancerProfile struct { + PublicIPAddresses []PublicIPMetadata `json:"publicIpAddresses,omitempty"` +} + +// LoadBalancerMetadata represents load balancer metadata. +type LoadBalancerMetadata struct { + LoadBalancer *LoadbalancerProfile `json:"loadbalancer,omitempty"` +} + // InstanceMetadataService knows how to query the Azure instance metadata server. type InstanceMetadataService struct { - metadataURL string - imsCache *azcache.TimedCache + imdsServer string + imsCache *azcache.TimedCache } // NewInstanceMetadataService creates an instance of the InstanceMetadataService accessor object. -func NewInstanceMetadataService(metadataURL string) (*InstanceMetadataService, error) { +func NewInstanceMetadataService(imdsServer string) (*InstanceMetadataService, error) { ims := &InstanceMetadataService{ - metadataURL: metadataURL, + imdsServer: imdsServer, } - imsCache, err := azcache.NewTimedcache(metadataCacheTTL, ims.getInstanceMetadata) + imsCache, err := azcache.NewTimedcache(metadataCacheTTL, ims.getMetadata) if err != nil { return nil, err } @@ -107,8 +128,52 @@ func NewInstanceMetadataService(metadataURL string) (*InstanceMetadataService, e return ims, nil } -func (ims *InstanceMetadataService) getInstanceMetadata(key string) (interface{}, error) { - req, err := http.NewRequest("GET", ims.metadataURL, nil) +func (ims *InstanceMetadataService) getMetadata(key string) (interface{}, error) { + instanceMetadata, err := ims.getInstanceMetadata(key) + if err != nil { + return nil, err + } + + if instanceMetadata.Network != nil && len(instanceMetadata.Network.Interface) > 0 { + netInterface := instanceMetadata.Network.Interface[0] + if (len(netInterface.IPV4.IPAddress) > 0 && len(netInterface.IPV4.IPAddress[0].PublicIP) > 0) || + (len(netInterface.IPV6.IPAddress) > 0 && len(netInterface.IPV6.IPAddress[0].PublicIP) > 0) { + // Return if public IP address has already part of instance metadata. + return instanceMetadata, nil + } + + loadBalancerMetadata, err := ims.getLoadBalancerMetadata() + if err != nil || loadBalancerMetadata == nil || loadBalancerMetadata.LoadBalancer == nil { + // Log a warning since loadbalancer metadata may not be available when the VM + // is not in standard LoadBalancer backend address pool. + klog.V(4).Infof("Warning: failed to get loadbalancer metadata: %v", err) + return instanceMetadata, nil + } + + publicIPs := loadBalancerMetadata.LoadBalancer.PublicIPAddresses + if len(netInterface.IPV4.IPAddress) > 0 && len(netInterface.IPV4.IPAddress[0].PrivateIP) > 0 { + for _, pip := range publicIPs { + if pip.PrivateIPAddress == netInterface.IPV4.IPAddress[0].PrivateIP { + netInterface.IPV4.IPAddress[0].PublicIP = pip.FrontendIPAddress + break + } + } + } + if len(netInterface.IPV6.IPAddress) > 0 && len(netInterface.IPV6.IPAddress[0].PrivateIP) > 0 { + for _, pip := range publicIPs { + if pip.PrivateIPAddress == netInterface.IPV6.IPAddress[0].PrivateIP { + netInterface.IPV6.IPAddress[0].PublicIP = pip.FrontendIPAddress + break + } + } + } + } + + return instanceMetadata, nil +} + +func (ims *InstanceMetadataService) getInstanceMetadata(key string) (*InstanceMetadata, error) { + req, err := http.NewRequest("GET", ims.imdsServer+imdsInstanceURI, nil) if err != nil { return nil, err } @@ -117,7 +182,7 @@ func (ims *InstanceMetadataService) getInstanceMetadata(key string) (interface{} q := req.URL.Query() q.Add("format", "json") - q.Add("api-version", "2019-03-11") + q.Add("api-version", imdsInstanceAPIVersion) req.URL.RawQuery = q.Encode() client := &http.Client{} @@ -145,6 +210,44 @@ func (ims *InstanceMetadataService) getInstanceMetadata(key string) (interface{} return &obj, nil } +func (ims *InstanceMetadataService) getLoadBalancerMetadata() (*LoadBalancerMetadata, error) { + req, err := http.NewRequest("GET", ims.imdsServer+imdsLoadBalancerURI, nil) + if err != nil { + return nil, err + } + req.Header.Add("Metadata", "True") + req.Header.Add("User-Agent", "golang/kubernetes-cloud-provider") + + q := req.URL.Query() + q.Add("format", "json") + q.Add("api-version", imdsLoadBalancerAPIVersion) + req.URL.RawQuery = q.Encode() + + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("failure of getting loadbalancer metadata with response %q", resp.Status) + } + + data, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + obj := LoadBalancerMetadata{} + err = json.Unmarshal(data, &obj) + if err != nil { + return nil, err + } + + return &obj, nil +} + // GetMetadata gets instance metadata from cache. // crt determines if we can get data from stalled cache/need fresh if cache expired. func (ims *InstanceMetadataService) GetMetadata(crt azcache.AzureCacheReadType) (*InstanceMetadata, error) { diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go index 2c1c4dfaa3f2..3d236437d277 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go @@ -99,11 +99,6 @@ const ( // to enable the high availability ports on the standard internal load balancer. ServiceAnnotationLoadBalancerEnableHighAvailabilityPorts = "service.beta.kubernetes.io/azure-load-balancer-enable-high-availability-ports" - // ServiceAnnotationLoadBalancerDisableTCPReset is the annotation used on the service - // to set enableTcpReset to false in load balancer rule. This only works for Azure standard load balancer backed service. - // TODO(feiskyer): disable-tcp-reset annotations has been depracated since v1.18, it would removed on v1.20. - ServiceAnnotationLoadBalancerDisableTCPReset = "service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset" - // ServiceAnnotationLoadBalancerHealthProbeProtocol determines the network protocol that the load balancer health probe use. // If not set, the local service would use the HTTP and the cluster service would use the TCP by default. ServiceAnnotationLoadBalancerHealthProbeProtocol = "service.beta.kubernetes.io/azure-load-balancer-health-probe-protocol" @@ -1627,9 +1622,6 @@ func (az *Cloud) reconcileLoadBalancerRule( var enableTCPReset *bool if az.useStandardLoadBalancer() { enableTCPReset = to.BoolPtr(true) - if _, ok := service.Annotations[ServiceAnnotationLoadBalancerDisableTCPReset]; ok { - klog.Warning("annotation service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset has been removed as of Kubernetes 1.20. TCP Resets are always enabled on Standard SKU load balancers.") - } } var expectedProbes []network.Probe @@ -2238,9 +2230,11 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa } dirtyPIP = true } - changed := az.ensurePIPTagged(service, &pip) - if changed { - dirtyPIP = true + if !isUserAssignedPIP { + changed := az.ensurePIPTagged(service, &pip) + if changed { + dirtyPIP = true + } } if shouldReleaseExistingOwnedPublicIP(&pip, wantLb, isInternal, isUserAssignedPIP, desiredPipName, serviceIPTagRequest) { // Then, release the public ip diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go index e93401eb5049..df6c83fbf6ab 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_managedDiskController.go @@ -21,6 +21,7 @@ package azure import ( "context" "fmt" + "net/http" "path" "strconv" "strings" @@ -236,6 +237,10 @@ func (c *ManagedDiskController) DeleteManagedDisk(diskURI string) error { rerr = c.common.cloud.DisksClient.Delete(ctx, resourceGroup, diskName) if rerr != nil { + if rerr.HTTPStatusCode == http.StatusNotFound { + klog.V(2).Infof("azureDisk - disk(%s) is already deleted", diskURI) + return nil + } return rerr.Error() } // We don't need poll here, k8s will immediately stop referencing the disk @@ -355,7 +360,7 @@ func (c *Cloud) GetAzureDiskLabels(diskURI string) (map[string]string, error) { } labels := map[string]string{ - LabelFailureDomainBetaRegion: c.Location, + v1.LabelTopologyRegion: c.Location, } // no azure credential is set, return nil if c.DisksClient == nil { @@ -384,6 +389,6 @@ func (c *Cloud) GetAzureDiskLabels(diskURI string) (map[string]string, error) { zone := c.makeZone(c.Location, zoneID) klog.V(4).Infof("Got zone %q for Azure disk %q", zone, diskName) - labels[LabelFailureDomainBetaZone] = zone + labels[v1.LabelTopologyZone] = zone return labels, nil } diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_standard.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_standard.go index 6f9fdb6dc931..32609f8ef746 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_standard.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_standard.go @@ -365,9 +365,13 @@ func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, serv klog.Warningf("serviceOwnsFrontendIP: unexpected error when finding match public IP of the service %s with loadBalancerLP %s: %v", service.Name, loadBalancerIP, err) return false, isPrimaryService, nil } - - if pip != nil && pip.ID != nil && pip.PublicIPAddressPropertiesFormat != nil && pip.IPAddress != nil { - if strings.EqualFold(*pip.ID, *fip.PublicIPAddress.ID) { + if pip != nil && + pip.ID != nil && + pip.PublicIPAddressPropertiesFormat != nil && + pip.IPAddress != nil && + fip.FrontendIPConfigurationPropertiesFormat != nil && + fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil { + if strings.EqualFold(to.String(pip.ID), to.String(fip.PublicIPAddress.ID)) { klog.V(4).Infof("serviceOwnsFrontendIP: found secondary service %s of the frontend IP config %s", service.Name, *fip.Name) return true, isPrimaryService, nil @@ -377,7 +381,7 @@ func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, serv return false, isPrimaryService, nil } - return false, isPrimaryService, fmt.Errorf("serviceOwnsFrontendIP: wrong parameters") + return false, isPrimaryService, nil } // for internal secondary service the private IP address on the frontend IP config should be checked diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss.go index 49e0d755fde0..64b599e01bcf 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss.go @@ -1034,7 +1034,6 @@ func (ss *scaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeNam }) primaryIPConfiguration.LoadBalancerBackendAddressPools = &newBackendPools newVM := &compute.VirtualMachineScaleSetVM{ - Sku: vm.Sku, Location: vm.Location, VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{ HardwareProfile: vm.HardwareProfile, @@ -1176,7 +1175,6 @@ func (ss *scaleSet) ensureVMSSInPool(service *v1.Service, nodes []*v1.Node, back }) primaryIPConfig.LoadBalancerBackendAddressPools = &loadBalancerBackendAddressPools newVMSS := compute.VirtualMachineScaleSet{ - Sku: vmss.Sku, Location: vmss.Location, VirtualMachineScaleSetProperties: &compute.VirtualMachineScaleSetProperties{ VirtualMachineProfile: &compute.VirtualMachineScaleSetVMProfile{ @@ -1357,7 +1355,6 @@ func (ss *scaleSet) ensureBackendPoolDeletedFromNode(nodeName, backendPoolID str // Compose a new vmssVM with added backendPoolID. primaryIPConfiguration.LoadBalancerBackendAddressPools = &newBackendPools newVM := &compute.VirtualMachineScaleSetVM{ - Sku: vm.Sku, Location: vm.Location, VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{ HardwareProfile: vm.HardwareProfile, @@ -1432,10 +1429,15 @@ func (ss *scaleSet) ensureBackendPoolDeletedFromVMSS(service *v1.Service, backen vmssNamesMap[vmSetName] = true } + vmssUpdaters := make([]func() error, 0, len(vmssNamesMap)) + errors := make([]error, 0, len(vmssNamesMap)) for vmssName := range vmssNamesMap { + vmssName := vmssName vmss, err := ss.getVMSS(vmssName, azcache.CacheReadTypeDefault) if err != nil { - return err + klog.Errorf("ensureBackendPoolDeletedFromVMSS: failed to get VMSS %s: %v", vmssName, err) + errors = append(errors, err) + continue } // When vmss is being deleted, CreateOrUpdate API would report "the vmss is being deleted" error. @@ -1451,11 +1453,15 @@ func (ss *scaleSet) ensureBackendPoolDeletedFromVMSS(service *v1.Service, backen vmssNIC := *vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations primaryNIC, err := ss.getPrimaryNetworkInterfaceConfigurationForScaleSet(vmssNIC, vmssName) if err != nil { - return err + klog.Errorf("ensureBackendPoolDeletedFromVMSS: failed to get the primary network interface config of the VMSS %s: %v", vmssName, err) + errors = append(errors, err) + continue } primaryIPConfig, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC) if err != nil { - return err + klog.Errorf("ensureBackendPoolDeletedFromVMSS: failed to the primary IP config from the VMSS %s's network config : %v", vmssName, err) + errors = append(errors, err) + continue } loadBalancerBackendAddressPools := []compute.SubResource{} if primaryIPConfig.LoadBalancerBackendAddressPools != nil { @@ -1476,26 +1482,38 @@ func (ss *scaleSet) ensureBackendPoolDeletedFromVMSS(service *v1.Service, backen continue } - // Compose a new vmss with added backendPoolID. - primaryIPConfig.LoadBalancerBackendAddressPools = &newBackendPools - newVMSS := compute.VirtualMachineScaleSet{ - Sku: vmss.Sku, - Location: vmss.Location, - VirtualMachineScaleSetProperties: &compute.VirtualMachineScaleSetProperties{ - VirtualMachineProfile: &compute.VirtualMachineScaleSetVMProfile{ - NetworkProfile: &compute.VirtualMachineScaleSetNetworkProfile{ - NetworkInterfaceConfigurations: &vmssNIC, + vmssUpdaters = append(vmssUpdaters, func() error { + // Compose a new vmss with added backendPoolID. + primaryIPConfig.LoadBalancerBackendAddressPools = &newBackendPools + newVMSS := compute.VirtualMachineScaleSet{ + Location: vmss.Location, + VirtualMachineScaleSetProperties: &compute.VirtualMachineScaleSetProperties{ + VirtualMachineProfile: &compute.VirtualMachineScaleSetVMProfile{ + NetworkProfile: &compute.VirtualMachineScaleSetNetworkProfile{ + NetworkInterfaceConfigurations: &vmssNIC, + }, }, }, - }, - } + } - klog.V(2).Infof("ensureBackendPoolDeletedFromVMSS begins to update vmss(%s) with backendPoolID %s", vmssName, backendPoolID) - rerr := ss.CreateOrUpdateVMSS(ss.ResourceGroup, vmssName, newVMSS) - if rerr != nil { - klog.Errorf("ensureBackendPoolDeletedFromVMSS CreateOrUpdateVMSS(%s) with new backendPoolID %s, err: %v", vmssName, backendPoolID, err) - return rerr.Error() - } + klog.V(2).Infof("ensureBackendPoolDeletedFromVMSS begins to update vmss(%s) with backendPoolID %s", vmssName, backendPoolID) + rerr := ss.CreateOrUpdateVMSS(ss.ResourceGroup, vmssName, newVMSS) + if rerr != nil { + klog.Errorf("ensureBackendPoolDeletedFromVMSS CreateOrUpdateVMSS(%s) with new backendPoolID %s, err: %v", vmssName, backendPoolID, rerr) + return rerr.Error() + } + + return nil + }) + } + + errs := utilerrors.AggregateGoroutines(vmssUpdaters...) + if errs != nil { + return utilerrors.Flatten(errs) + } + // Fail if there are other errors. + if len(errors) > 0 { + return utilerrors.Flatten(utilerrors.NewAggregate(errors)) } return nil diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go index 576e6539421c..3aa5319f99e9 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/azure/azure_vmss_cache.go @@ -198,6 +198,11 @@ func (ss *scaleSet) newVMSSVirtualMachinesCache(resourceGroupName, vmssName, cac } computerName := strings.ToLower(*vm.OsProfile.ComputerName) + if vm.NetworkProfile == nil || vm.NetworkProfile.NetworkInterfaces == nil { + klog.Warningf("skip caching vmssVM %s since its network profile hasn't initialized yet (probably still under creating)", computerName) + continue + } + vmssVMCacheEntry := &vmssVirtualMachinesEntry{ resourceGroup: resourceGroupName, vmssName: vmssName, diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_external.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_external.go index 65ef48af68a0..ecf5e2354092 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_external.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_external.go @@ -81,7 +81,12 @@ func (g *Cloud) ensureExternalLoadBalancer(clusterName string, clusterID string, return nil, err } klog.V(4).Infof("ensureExternalLoadBalancer(%s): Desired network tier %q.", lbRefStr, netTier) - g.deleteWrongNetworkTieredResources(loadBalancerName, lbRefStr, netTier) + // TODO: distinguish between unspecified and specified network tiers annotation properly in forwardingrule creation + // Only delete ForwardingRule when network tier annotation is specified, otherwise leave it only to avoid wrongful + // deletion against user intention when network tier annotation is not specified. + if _, ok := apiService.Annotations[NetworkTierAnnotationKey]; ok { + g.deleteWrongNetworkTieredResources(loadBalancerName, lbRefStr, netTier) + } // Check if the forwarding rule exists, and if so, what its IP is. fwdRuleExists, fwdRuleNeedsUpdate, fwdRuleIP, err := g.forwardingRuleNeedsUpdate(loadBalancerName, g.region, requestedIP, ports) diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/token_source.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/token_source.go index 8f5a5eb6758e..39ef31e89347 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/token_source.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/gce/token_source.go @@ -43,7 +43,7 @@ const ( /* * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) * * Promoting the stability level of the metric is a responsibility of the component owner, since it * involves explicitly acknowledging support for the metric across multiple releases, in accordance with diff --git a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/openstack/metadata.go b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/openstack/metadata.go index 638108caeca3..1072a737750e 100644 --- a/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/openstack/metadata.go +++ b/cluster-autoscaler/vendor/k8s.io/legacy-cloud-providers/openstack/metadata.go @@ -30,8 +30,8 @@ import ( "strings" "k8s.io/klog/v2" + "k8s.io/mount-utils" "k8s.io/utils/exec" - "k8s.io/utils/mount" ) const ( diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/go.mod b/cluster-autoscaler/vendor/k8s.io/mount-utils/go.mod index 4c83c0a0924a..938cb5b84c8c 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/go.mod +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/go.mod @@ -7,9 +7,9 @@ go 1.16 require ( github.com/kr/text v0.2.0 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.0 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect - k8s.io/klog/v2 v2.8.0 - k8s.io/utils v0.0.0-20201110183641-67b214c5f920 + k8s.io/klog/v2 v2.9.0 + k8s.io/utils v0.0.0-20210521133846-da695404a2bc ) diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/go.sum b/cluster-autoscaler/vendor/k8s.io/mount-utils/go.sum index 1c34048641d9..05c5153c2908 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/go.sum +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/go.sum @@ -16,8 +16,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= @@ -26,7 +26,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= +k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/utils v0.0.0-20210521133846-da695404a2bc h1:dx6VGe+PnOW/kD/2UV4aUSsRfJGd7+lcqgJ6Xg0HwUs= +k8s.io/utils v0.0.0-20210521133846-da695404a2bc/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_unix.go b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_unix.go index 2c14a27c7192..f3658647eea2 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_unix.go +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_helper_unix.go @@ -32,7 +32,7 @@ const ( // At least number of fields per line in /proc//mountinfo. expectedAtLeastNumFieldsPerMountInfo = 10 // How many times to retry for a consistent read of /proc/mounts. - maxListTries = 3 + maxListTries = 10 ) // IsCorruptedMnt return true if err is about corrupted mount point diff --git a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_windows.go b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_windows.go index 29d3bbbd376e..3706b38fefd1 100644 --- a/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_windows.go +++ b/cluster-autoscaler/vendor/k8s.io/mount-utils/mount_windows.go @@ -267,7 +267,7 @@ func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target } // format disk if it is unformatted(raw) - cmd := fmt.Sprintf("Get-Disk -Number %s | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru"+ + cmd := fmt.Sprintf("Get-Disk -Number %s | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle GPT -PassThru"+ " | New-Partition -UseMaximumSize | Format-Volume -FileSystem %s -Confirm:$false", source, fstype) if output, err := mounter.Exec.Command("powershell", "/c", cmd).CombinedOutput(); err != nil { return fmt.Errorf("diskMount: format disk failed, error: %v, output: %q", err, string(output)) diff --git a/cluster-autoscaler/vendor/k8s.io/utils/io/read.go b/cluster-autoscaler/vendor/k8s.io/utils/io/read.go index 16a638d764bf..f0af3c8ec8a3 100644 --- a/cluster-autoscaler/vendor/k8s.io/utils/io/read.go +++ b/cluster-autoscaler/vendor/k8s.io/utils/io/read.go @@ -30,6 +30,9 @@ var ErrLimitReached = errors.New("the read limit is reached") // ConsistentRead repeatedly reads a file until it gets the same content twice. // This is useful when reading files in /proc that are larger than page size // and kernel may modify them between individual read() syscalls. +// It returns InconsistentReadError when it cannot get a consistent read in +// given nr. of attempts. Caller should retry, kernel is probably under heavy +// mount/unmount load. func ConsistentRead(filename string, attempts int) ([]byte, error) { return consistentReadSync(filename, attempts, nil) } @@ -56,7 +59,28 @@ func consistentReadSync(filename string, attempts int, sync func(int)) ([]byte, // Files are different, continue reading oldContent = newContent } - return nil, fmt.Errorf("could not get consistent content of %s after %d attempts", filename, attempts) + return nil, InconsistentReadError{filename, attempts} +} + +// InconsistentReadError is returned from ConsistentRead when it cannot get +// a consistent read in given nr. of attempts. Caller should retry, kernel is +// probably under heavy mount/unmount load. +type InconsistentReadError struct { + filename string + attempts int +} + +func (i InconsistentReadError) Error() string { + return fmt.Sprintf("could not get consistent content of %s after %d attempts", i.filename, i.attempts) +} + +var _ error = InconsistentReadError{} + +func IsInconsistentReadError(err error) bool { + if _, ok := err.(InconsistentReadError); ok { + return true + } + return false } // ReadAtMost reads up to `limit` bytes from `r`, and reports an error diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/OWNERS b/cluster-autoscaler/vendor/k8s.io/utils/mount/OWNERS deleted file mode 100644 index aacc6685bdea..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/OWNERS +++ /dev/null @@ -1,15 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - jingxu97 - - saad-ali - - jsafrane - - msau42 - - andyzhangx - - gnufied -approvers: - - andyzhangx - - jingxu97 - - saad-ali - - jsafrane - diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/fake_mounter.go b/cluster-autoscaler/vendor/k8s.io/utils/mount/fake_mounter.go deleted file mode 100644 index f48c2badba65..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/fake_mounter.go +++ /dev/null @@ -1,216 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mount - -import ( - "os" - "path/filepath" - "sync" - - "k8s.io/klog/v2" -) - -// FakeMounter implements mount.Interface for tests. -type FakeMounter struct { - MountPoints []MountPoint - log []FakeAction - // Error to return for a path when calling IsLikelyNotMountPoint - MountCheckErrors map[string]error - // Some tests run things in parallel, make sure the mounter does not produce - // any golang's DATA RACE warnings. - mutex sync.Mutex - UnmountFunc UnmountFunc -} - -// UnmountFunc is a function callback to be executed during the Unmount() call. -type UnmountFunc func(path string) error - -var _ Interface = &FakeMounter{} - -const ( - // FakeActionMount is the string for specifying mount as FakeAction.Action - FakeActionMount = "mount" - // FakeActionUnmount is the string for specifying unmount as FakeAction.Action - FakeActionUnmount = "unmount" -) - -// FakeAction objects are logged every time a fake mount or unmount is called. -type FakeAction struct { - Action string // "mount" or "unmount" - Target string // applies to both mount and unmount actions - Source string // applies only to "mount" actions - FSType string // applies only to "mount" actions -} - -// NewFakeMounter returns a FakeMounter struct that implements Interface and is -// suitable for testing purposes. -func NewFakeMounter(mps []MountPoint) *FakeMounter { - return &FakeMounter{ - MountPoints: mps, - } -} - -// ResetLog clears all the log entries in FakeMounter -func (f *FakeMounter) ResetLog() { - f.mutex.Lock() - defer f.mutex.Unlock() - - f.log = []FakeAction{} -} - -// GetLog returns the slice of FakeActions taken by the mounter -func (f *FakeMounter) GetLog() []FakeAction { - f.mutex.Lock() - defer f.mutex.Unlock() - - return f.log -} - -// Mount records the mount event and updates the in-memory mount points for FakeMounter -func (f *FakeMounter) Mount(source string, target string, fstype string, options []string) error { - return f.MountSensitive(source, target, fstype, options, nil /* sensitiveOptions */) -} - -// Mount records the mount event and updates the in-memory mount points for FakeMounter -// sensitiveOptions to be passed in a separate parameter from the normal -// mount options and ensures the sensitiveOptions are never logged. This -// method should be used by callers that pass sensitive material (like -// passwords) as mount options. -func (f *FakeMounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - opts := []string{} - - for _, option := range options { - // find 'bind' option - if option == "bind" { - // This is a bind-mount. In order to mimic linux behaviour, we must - // use the original device of the bind-mount as the real source. - // E.g. when mounted /dev/sda like this: - // $ mount /dev/sda /mnt/test - // $ mount -o bind /mnt/test /mnt/bound - // then /proc/mount contains: - // /dev/sda /mnt/test - // /dev/sda /mnt/bound - // (and not /mnt/test /mnt/bound) - // I.e. we must use /dev/sda as source instead of /mnt/test in the - // bind mount. - for _, mnt := range f.MountPoints { - if source == mnt.Path { - source = mnt.Device - break - } - } - } - // reuse MountPoint.Opts field to mark mount as readonly - opts = append(opts, option) - } - - // If target is a symlink, get its absolute path - absTarget, err := filepath.EvalSymlinks(target) - if err != nil { - absTarget = target - } - f.MountPoints = append(f.MountPoints, MountPoint{Device: source, Path: absTarget, Type: fstype, Opts: append(opts, sensitiveOptions...)}) - klog.V(5).Infof("Fake mounter: mounted %s to %s", source, absTarget) - f.log = append(f.log, FakeAction{Action: FakeActionMount, Target: absTarget, Source: source, FSType: fstype}) - return nil -} - -// Unmount records the unmount event and updates the in-memory mount points for FakeMounter -func (f *FakeMounter) Unmount(target string) error { - f.mutex.Lock() - defer f.mutex.Unlock() - - // If target is a symlink, get its absolute path - absTarget, err := filepath.EvalSymlinks(target) - if err != nil { - absTarget = target - } - - newMountpoints := []MountPoint{} - for _, mp := range f.MountPoints { - if mp.Path == absTarget { - if f.UnmountFunc != nil { - err := f.UnmountFunc(absTarget) - if err != nil { - return err - } - } - klog.V(5).Infof("Fake mounter: unmounted %s from %s", mp.Device, absTarget) - // Don't copy it to newMountpoints - continue - } - newMountpoints = append(newMountpoints, MountPoint{Device: mp.Device, Path: mp.Path, Type: mp.Type}) - } - f.MountPoints = newMountpoints - f.log = append(f.log, FakeAction{Action: FakeActionUnmount, Target: absTarget}) - delete(f.MountCheckErrors, target) - return nil -} - -// List returns all the in-memory mountpoints for FakeMounter -func (f *FakeMounter) List() ([]MountPoint, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - return f.MountPoints, nil -} - -// IsLikelyNotMountPoint determines whether a path is a mountpoint by checking -// if the absolute path to file is in the in-memory mountpoints -func (f *FakeMounter) IsLikelyNotMountPoint(file string) (bool, error) { - f.mutex.Lock() - defer f.mutex.Unlock() - - err := f.MountCheckErrors[file] - if err != nil { - return false, err - } - - _, err = os.Stat(file) - if err != nil { - return true, err - } - - // If file is a symlink, get its absolute path - absFile, err := filepath.EvalSymlinks(file) - if err != nil { - absFile = file - } - - for _, mp := range f.MountPoints { - if mp.Path == absFile { - klog.V(5).Infof("isLikelyNotMountPoint for %s: mounted %s, false", file, mp.Path) - return false, nil - } - } - klog.V(5).Infof("isLikelyNotMountPoint for %s: true", file) - return true, nil -} - -// GetMountRefs finds all mount references to the path, returns a -// list of paths. -func (f *FakeMounter) GetMountRefs(pathname string) ([]string, error) { - realpath, err := filepath.EvalSymlinks(pathname) - if err != nil { - // Ignore error in FakeMounter, because we actually didn't create files. - realpath = pathname - } - return getMountRefsByDev(f, realpath) -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount.go b/cluster-autoscaler/vendor/k8s.io/utils/mount/mount.go deleted file mode 100644 index 14997a75c9bd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount.go +++ /dev/null @@ -1,370 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// TODO(thockin): This whole pkg is pretty linux-centric. As soon as we have -// an alternate platform, we will need to abstract further. - -package mount - -import ( - "fmt" - "os" - "path/filepath" - "strings" - - utilexec "k8s.io/utils/exec" -) - -const ( - // Default mount command if mounter path is not specified. - defaultMountCommand = "mount" - // Log message where sensitive mount options were removed - sensitiveOptionsRemoved = "" -) - -// Interface defines the set of methods to allow for mount operations on a system. -type Interface interface { - // Mount mounts source to target as fstype with given options. - // options MUST not contain sensitive material (like passwords). - Mount(source string, target string, fstype string, options []string) error - // MountSensitive is the same as Mount() but this method allows - // sensitiveOptions to be passed in a separate parameter from the normal - // mount options and ensures the sensitiveOptions are never logged. This - // method should be used by callers that pass sensitive material (like - // passwords) as mount options. - MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error - // Unmount unmounts given target. - Unmount(target string) error - // List returns a list of all mounted filesystems. This can be large. - // On some platforms, reading mounts directly from the OS is not guaranteed - // consistent (i.e. it could change between chunked reads). This is guaranteed - // to be consistent. - List() ([]MountPoint, error) - // IsLikelyNotMountPoint uses heuristics to determine if a directory - // is not a mountpoint. - // It should return ErrNotExist when the directory does not exist. - // IsLikelyNotMountPoint does NOT properly detect all mountpoint types - // most notably linux bind mounts and symbolic link. For callers that do not - // care about such situations, this is a faster alternative to calling List() - // and scanning that output. - IsLikelyNotMountPoint(file string) (bool, error) - // GetMountRefs finds all mount references to pathname, returning a slice of - // paths. Pathname can be a mountpoint path or a normal directory - // (for bind mount). On Linux, pathname is excluded from the slice. - // For example, if /dev/sdc was mounted at /path/a and /path/b, - // GetMountRefs("/path/a") would return ["/path/b"] - // GetMountRefs("/path/b") would return ["/path/a"] - // On Windows there is no way to query all mount points; as long as pathname is - // a valid mount, it will be returned. - GetMountRefs(pathname string) ([]string, error) -} - -// Compile-time check to ensure all Mounter implementations satisfy -// the mount interface. -var _ Interface = &Mounter{} - -// MountPoint represents a single line in /proc/mounts or /etc/fstab. -type MountPoint struct { // nolint: golint - Device string - Path string - Type string - Opts []string // Opts may contain sensitive mount options (like passwords) and MUST be treated as such (e.g. not logged). - Freq int - Pass int -} - -type MountErrorType string // nolint: golint - -const ( - FilesystemMismatch MountErrorType = "FilesystemMismatch" - HasFilesystemErrors MountErrorType = "HasFilesystemErrors" - UnformattedReadOnly MountErrorType = "UnformattedReadOnly" - FormatFailed MountErrorType = "FormatFailed" - GetDiskFormatFailed MountErrorType = "GetDiskFormatFailed" - UnknownMountError MountErrorType = "UnknownMountError" -) - -type MountError struct { // nolint: golint - Type MountErrorType - Message string -} - -func (mountError MountError) String() string { - return mountError.Message -} - -func (mountError MountError) Error() string { - return mountError.Message -} - -func NewMountError(mountErrorValue MountErrorType, format string, args ...interface{}) error { - mountError := MountError{ - Type: mountErrorValue, - Message: fmt.Sprintf(format, args...), - } - return mountError -} - -// SafeFormatAndMount probes a device to see if it is formatted. -// Namely it checks to see if a file system is present. If so it -// mounts it otherwise the device is formatted first then mounted. -type SafeFormatAndMount struct { - Interface - Exec utilexec.Interface -} - -// FormatAndMount formats the given disk, if needed, and mounts it. -// That is if the disk is not formatted and it is not being mounted as -// read-only it will format it first then mount it. Otherwise, if the -// disk is already formatted or it is being mounted as read-only, it -// will be mounted without formatting. -// options MUST not contain sensitive material (like passwords). -func (mounter *SafeFormatAndMount) FormatAndMount(source string, target string, fstype string, options []string) error { - return mounter.FormatAndMountSensitive(source, target, fstype, options, nil /* sensitiveOptions */) -} - -// FormatAndMountSensitive is the same as FormatAndMount but this method allows -// sensitiveOptions to be passed in a separate parameter from the normal mount -// options and ensures the sensitiveOptions are never logged. This method should -// be used by callers that pass sensitive material (like passwords) as mount -// options. -func (mounter *SafeFormatAndMount) FormatAndMountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - return mounter.formatAndMountSensitive(source, target, fstype, options, sensitiveOptions) -} - -// getMountRefsByDev finds all references to the device provided -// by mountPath; returns a list of paths. -// Note that mountPath should be path after the evaluation of any symblolic links. -func getMountRefsByDev(mounter Interface, mountPath string) ([]string, error) { - mps, err := mounter.List() - if err != nil { - return nil, err - } - - // Finding the device mounted to mountPath. - diskDev := "" - for i := range mps { - if mountPath == mps[i].Path { - diskDev = mps[i].Device - break - } - } - - // Find all references to the device. - var refs []string - for i := range mps { - if mps[i].Device == diskDev || mps[i].Device == mountPath { - if mps[i].Path != mountPath { - refs = append(refs, mps[i].Path) - } - } - } - return refs, nil -} - -// GetDeviceNameFromMount given a mnt point, find the device from /proc/mounts -// returns the device name, reference count, and error code. -func GetDeviceNameFromMount(mounter Interface, mountPath string) (string, int, error) { - mps, err := mounter.List() - if err != nil { - return "", 0, err - } - - // Find the device name. - // FIXME if multiple devices mounted on the same mount path, only the first one is returned. - device := "" - // If mountPath is symlink, need get its target path. - slTarget, err := filepath.EvalSymlinks(mountPath) - if err != nil { - slTarget = mountPath - } - for i := range mps { - if mps[i].Path == slTarget { - device = mps[i].Device - break - } - } - - // Find all references to the device. - refCount := 0 - for i := range mps { - if mps[i].Device == device { - refCount++ - } - } - return device, refCount, nil -} - -// IsNotMountPoint determines if a directory is a mountpoint. -// It should return ErrNotExist when the directory does not exist. -// IsNotMountPoint is more expensive than IsLikelyNotMountPoint. -// IsNotMountPoint detects bind mounts in linux. -// IsNotMountPoint enumerates all the mountpoints using List() and -// the list of mountpoints may be large, then it uses -// isMountPointMatch to evaluate whether the directory is a mountpoint. -func IsNotMountPoint(mounter Interface, file string) (bool, error) { - // IsLikelyNotMountPoint provides a quick check - // to determine whether file IS A mountpoint. - notMnt, notMntErr := mounter.IsLikelyNotMountPoint(file) - if notMntErr != nil && os.IsPermission(notMntErr) { - // We were not allowed to do the simple stat() check, e.g. on NFS with - // root_squash. Fall back to /proc/mounts check below. - notMnt = true - notMntErr = nil - } - if notMntErr != nil { - return notMnt, notMntErr - } - // identified as mountpoint, so return this fact. - if notMnt == false { - return notMnt, nil - } - - // Resolve any symlinks in file, kernel would do the same and use the resolved path in /proc/mounts. - resolvedFile, err := filepath.EvalSymlinks(file) - if err != nil { - return true, err - } - - // check all mountpoints since IsLikelyNotMountPoint - // is not reliable for some mountpoint types. - mountPoints, mountPointsErr := mounter.List() - if mountPointsErr != nil { - return notMnt, mountPointsErr - } - for _, mp := range mountPoints { - if isMountPointMatch(mp, resolvedFile) { - notMnt = false - break - } - } - return notMnt, nil -} - -// MakeBindOpts detects whether a bind mount is being requested and makes the remount options to -// use in case of bind mount, due to the fact that bind mount doesn't respect mount options. -// The list equals: -// options - 'bind' + 'remount' (no duplicate) -func MakeBindOpts(options []string) (bool, []string, []string) { - bind, bindOpts, bindRemountOpts, _ := MakeBindOptsSensitive(options, nil /* sensitiveOptions */) - return bind, bindOpts, bindRemountOpts -} - -// MakeBindOptsSensitive is the same as MakeBindOpts but this method allows -// sensitiveOptions to be passed in a separate parameter from the normal mount -// options and ensures the sensitiveOptions are never logged. This method should -// be used by callers that pass sensitive material (like passwords) as mount -// options. -func MakeBindOptsSensitive(options []string, sensitiveOptions []string) (bool, []string, []string, []string) { - // Because we have an FD opened on the subpath bind mount, the "bind" option - // needs to be included, otherwise the mount target will error as busy if you - // remount as readonly. - // - // As a consequence, all read only bind mounts will no longer change the underlying - // volume mount to be read only. - bindRemountOpts := []string{"bind", "remount"} - bindRemountSensitiveOpts := []string{} - bind := false - bindOpts := []string{"bind"} - - // _netdev is a userspace mount option and does not automatically get added when - // bind mount is created and hence we must carry it over. - if checkForNetDev(options, sensitiveOptions) { - bindOpts = append(bindOpts, "_netdev") - } - - for _, option := range options { - switch option { - case "bind": - bind = true - break - case "remount": - break - default: - bindRemountOpts = append(bindRemountOpts, option) - } - } - - for _, sensitiveOption := range sensitiveOptions { - switch sensitiveOption { - case "bind": - bind = true - break - case "remount": - break - default: - bindRemountSensitiveOpts = append(bindRemountSensitiveOpts, sensitiveOption) - } - } - - return bind, bindOpts, bindRemountOpts, bindRemountSensitiveOpts -} - -func checkForNetDev(options []string, sensitiveOptions []string) bool { - for _, option := range options { - if option == "_netdev" { - return true - } - } - for _, sensitiveOption := range sensitiveOptions { - if sensitiveOption == "_netdev" { - return true - } - } - return false -} - -// PathWithinBase checks if give path is within given base directory. -func PathWithinBase(fullPath, basePath string) bool { - rel, err := filepath.Rel(basePath, fullPath) - if err != nil { - return false - } - if StartsWithBackstep(rel) { - // Needed to escape the base path. - return false - } - return true -} - -// StartsWithBackstep checks if the given path starts with a backstep segment. -func StartsWithBackstep(rel string) bool { - // normalize to / and check for ../ - return rel == ".." || strings.HasPrefix(filepath.ToSlash(rel), "../") -} - -// sanitizedOptionsForLogging will return a comma separated string containing -// options and sensitiveOptions. Each entry in sensitiveOptions will be -// replaced with the string sensitiveOptionsRemoved -// e.g. o1,o2,, -func sanitizedOptionsForLogging(options []string, sensitiveOptions []string) string { - separator := "" - if len(options) > 0 && len(sensitiveOptions) > 0 { - separator = "," - } - - sensitiveOptionsStart := "" - sensitiveOptionsEnd := "" - if len(sensitiveOptions) > 0 { - sensitiveOptionsStart = strings.Repeat(sensitiveOptionsRemoved+",", len(sensitiveOptions)-1) - sensitiveOptionsEnd = sensitiveOptionsRemoved - } - - return strings.Join(options, ",") + - separator + - sensitiveOptionsStart + - sensitiveOptionsEnd -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_common.go b/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_common.go deleted file mode 100644 index 1d40549b5f42..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_common.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mount - -import ( - "fmt" - "os" - - "k8s.io/klog/v2" -) - -// CleanupMountPoint unmounts the given path and deletes the remaining directory -// if successful. If extensiveMountPointCheck is true IsNotMountPoint will be -// called instead of IsLikelyNotMountPoint. IsNotMountPoint is more expensive -// but properly handles bind mounts within the same fs. -func CleanupMountPoint(mountPath string, mounter Interface, extensiveMountPointCheck bool) error { - pathExists, pathErr := PathExists(mountPath) - if !pathExists { - klog.Warningf("Warning: Unmount skipped because path does not exist: %v", mountPath) - return nil - } - corruptedMnt := IsCorruptedMnt(pathErr) - if pathErr != nil && !corruptedMnt { - return fmt.Errorf("Error checking path: %v", pathErr) - } - return doCleanupMountPoint(mountPath, mounter, extensiveMountPointCheck, corruptedMnt) -} - -// doCleanupMountPoint unmounts the given path and -// deletes the remaining directory if successful. -// if extensiveMountPointCheck is true -// IsNotMountPoint will be called instead of IsLikelyNotMountPoint. -// IsNotMountPoint is more expensive but properly handles bind mounts within the same fs. -// if corruptedMnt is true, it means that the mountPath is a corrupted mountpoint, and the mount point check -// will be skipped -func doCleanupMountPoint(mountPath string, mounter Interface, extensiveMountPointCheck bool, corruptedMnt bool) error { - var notMnt bool - var err error - if !corruptedMnt { - if extensiveMountPointCheck { - notMnt, err = IsNotMountPoint(mounter, mountPath) - } else { - notMnt, err = mounter.IsLikelyNotMountPoint(mountPath) - } - - if err != nil { - return err - } - - if notMnt { - klog.Warningf("Warning: %q is not a mountpoint, deleting", mountPath) - return os.Remove(mountPath) - } - } - - // Unmount the mount path - klog.V(4).Infof("%q is a mountpoint, unmounting", mountPath) - if err := mounter.Unmount(mountPath); err != nil { - return err - } - - if extensiveMountPointCheck { - notMnt, err = IsNotMountPoint(mounter, mountPath) - } else { - notMnt, err = mounter.IsLikelyNotMountPoint(mountPath) - } - if err != nil { - return err - } - if notMnt { - klog.V(4).Infof("%q is unmounted, deleting the directory", mountPath) - return os.Remove(mountPath) - } - return fmt.Errorf("Failed to unmount path %v", mountPath) -} - -// PathExists returns true if the specified path exists. -// TODO: clean this up to use pkg/util/file/FileExists -func PathExists(path string) (bool, error) { - _, err := os.Stat(path) - if err == nil { - return true, nil - } else if os.IsNotExist(err) { - return false, nil - } else if IsCorruptedMnt(err) { - return true, err - } - return false, err -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_unix.go b/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_unix.go deleted file mode 100644 index 11b70ebc298c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_unix.go +++ /dev/null @@ -1,158 +0,0 @@ -// +build !windows - -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mount - -import ( - "fmt" - "os" - "strconv" - "strings" - "syscall" - - utilio "k8s.io/utils/io" -) - -const ( - // At least number of fields per line in /proc//mountinfo. - expectedAtLeastNumFieldsPerMountInfo = 10 - // How many times to retry for a consistent read of /proc/mounts. - maxListTries = 3 -) - -// IsCorruptedMnt return true if err is about corrupted mount point -func IsCorruptedMnt(err error) bool { - if err == nil { - return false - } - var underlyingError error - switch pe := err.(type) { - case nil: - return false - case *os.PathError: - underlyingError = pe.Err - case *os.LinkError: - underlyingError = pe.Err - case *os.SyscallError: - underlyingError = pe.Err - } - - return underlyingError == syscall.ENOTCONN || underlyingError == syscall.ESTALE || underlyingError == syscall.EIO || underlyingError == syscall.EACCES -} - -// MountInfo represents a single line in /proc//mountinfo. -type MountInfo struct { // nolint: golint - // Unique ID for the mount (maybe reused after umount). - ID int - // The ID of the parent mount (or of self for the root of this mount namespace's mount tree). - ParentID int - // Major indicates one half of the device ID which identifies the device class - // (parsed from `st_dev` for files on this filesystem). - Major int - // Minor indicates one half of the device ID which identifies a specific - // instance of device (parsed from `st_dev` for files on this filesystem). - Minor int - // The pathname of the directory in the filesystem which forms the root of this mount. - Root string - // Mount source, filesystem-specific information. e.g. device, tmpfs name. - Source string - // Mount point, the pathname of the mount point. - MountPoint string - // Optional fieds, zero or more fields of the form "tag[:value]". - OptionalFields []string - // The filesystem type in the form "type[.subtype]". - FsType string - // Per-mount options. - MountOptions []string - // Per-superblock options. - SuperOptions []string -} - -// ParseMountInfo parses /proc/xxx/mountinfo. -func ParseMountInfo(filename string) ([]MountInfo, error) { - content, err := utilio.ConsistentRead(filename, maxListTries) - if err != nil { - return []MountInfo{}, err - } - contentStr := string(content) - infos := []MountInfo{} - - for _, line := range strings.Split(contentStr, "\n") { - if line == "" { - // the last split() item is empty string following the last \n - continue - } - // See `man proc` for authoritative description of format of the file. - fields := strings.Fields(line) - if len(fields) < expectedAtLeastNumFieldsPerMountInfo { - return nil, fmt.Errorf("wrong number of fields in (expected at least %d, got %d): %s", expectedAtLeastNumFieldsPerMountInfo, len(fields), line) - } - id, err := strconv.Atoi(fields[0]) - if err != nil { - return nil, err - } - parentID, err := strconv.Atoi(fields[1]) - if err != nil { - return nil, err - } - mm := strings.Split(fields[2], ":") - if len(mm) != 2 { - return nil, fmt.Errorf("parsing '%s' failed: unexpected minor:major pair %s", line, mm) - } - major, err := strconv.Atoi(mm[0]) - if err != nil { - return nil, fmt.Errorf("parsing '%s' failed: unable to parse major device id, err:%v", mm[0], err) - } - minor, err := strconv.Atoi(mm[1]) - if err != nil { - return nil, fmt.Errorf("parsing '%s' failed: unable to parse minor device id, err:%v", mm[1], err) - } - - info := MountInfo{ - ID: id, - ParentID: parentID, - Major: major, - Minor: minor, - Root: fields[3], - MountPoint: fields[4], - MountOptions: strings.Split(fields[5], ","), - } - // All fields until "-" are "optional fields". - i := 6 - for ; i < len(fields) && fields[i] != "-"; i++ { - info.OptionalFields = append(info.OptionalFields, fields[i]) - } - // Parse the rest 3 fields. - i++ - if len(fields)-i < 3 { - return nil, fmt.Errorf("expect 3 fields in %s, got %d", line, len(fields)-i) - } - info.FsType = fields[i] - info.Source = fields[i+1] - info.SuperOptions = strings.Split(fields[i+2], ",") - infos = append(infos, info) - } - return infos, nil -} - -// isMountPointMatch returns true if the path in mp is the same as dir. -// Handles case where mountpoint dir has been renamed due to stale NFS mount. -func isMountPointMatch(mp MountPoint, dir string) bool { - deletedDir := fmt.Sprintf("%s\\040(deleted)", dir) - return ((mp.Path == dir) || (mp.Path == deletedDir)) -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_windows.go b/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_windows.go deleted file mode 100644 index b308ce76d2f9..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_helper_windows.go +++ /dev/null @@ -1,101 +0,0 @@ -// +build windows - -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mount - -import ( - "fmt" - "os" - "strconv" - "strings" - "syscall" - - "k8s.io/klog/v2" -) - -// following failure codes are from https://docs.microsoft.com/en-us/windows/desktop/debug/system-error-codes--1300-1699- -// ERROR_BAD_NETPATH = 53 -// ERROR_NETWORK_BUSY = 54 -// ERROR_UNEXP_NET_ERR = 59 -// ERROR_NETNAME_DELETED = 64 -// ERROR_NETWORK_ACCESS_DENIED = 65 -// ERROR_BAD_DEV_TYPE = 66 -// ERROR_BAD_NET_NAME = 67 -// ERROR_SESSION_CREDENTIAL_CONFLICT = 1219 -// ERROR_LOGON_FAILURE = 1326 -var errorNoList = [...]int{53, 54, 59, 64, 65, 66, 67, 1219, 1326} - -// IsCorruptedMnt return true if err is about corrupted mount point -func IsCorruptedMnt(err error) bool { - if err == nil { - return false - } - - var underlyingError error - switch pe := err.(type) { - case nil: - return false - case *os.PathError: - underlyingError = pe.Err - case *os.LinkError: - underlyingError = pe.Err - case *os.SyscallError: - underlyingError = pe.Err - } - - if ee, ok := underlyingError.(syscall.Errno); ok { - for _, errno := range errorNoList { - if int(ee) == errno { - klog.Warningf("IsCorruptedMnt failed with error: %v, error code: %v", err, errno) - return true - } - } - } - - return false -} - -// NormalizeWindowsPath makes sure the given path is a valid path on Windows -// systems by making sure all instances of `/` are replaced with `\\`, and the -// path beings with `c:` -func NormalizeWindowsPath(path string) string { - normalizedPath := strings.Replace(path, "/", "\\", -1) - if strings.HasPrefix(normalizedPath, "\\") { - normalizedPath = "c:" + normalizedPath - } - return normalizedPath -} - -// ValidateDiskNumber : disk number should be a number in [0, 99] -func ValidateDiskNumber(disk string) error { - diskNum, err := strconv.Atoi(disk) - if err != nil { - return fmt.Errorf("wrong disk number format: %q, err:%v", disk, err) - } - - if diskNum < 0 || diskNum > 99 { - return fmt.Errorf("disk number out of range: %q", disk) - } - - return nil -} - -// isMountPointMatch determines if the mountpoint matches the dir -func isMountPointMatch(mp MountPoint, dir string) bool { - return mp.Path == dir -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_linux.go b/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_linux.go deleted file mode 100644 index b7a443fdf6c6..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_linux.go +++ /dev/null @@ -1,551 +0,0 @@ -// +build linux - -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mount - -import ( - "fmt" - "os" - "os/exec" - "path/filepath" - "strconv" - "strings" - "syscall" - - "k8s.io/klog/v2" - utilexec "k8s.io/utils/exec" - utilio "k8s.io/utils/io" -) - -const ( - // Number of fields per line in /proc/mounts as per the fstab man page. - expectedNumFieldsPerLine = 6 - // Location of the mount file to use - procMountsPath = "/proc/mounts" - // Location of the mountinfo file - procMountInfoPath = "/proc/self/mountinfo" - // 'fsck' found errors and corrected them - fsckErrorsCorrected = 1 - // 'fsck' found errors but exited without correcting them - fsckErrorsUncorrected = 4 -) - -// Mounter provides the default implementation of mount.Interface -// for the linux platform. This implementation assumes that the -// kubelet is running in the host's root mount namespace. -type Mounter struct { - mounterPath string - withSystemd bool -} - -// New returns a mount.Interface for the current system. -// It provides options to override the default mounter behavior. -// mounterPath allows using an alternative to `/bin/mount` for mounting. -func New(mounterPath string) Interface { - return &Mounter{ - mounterPath: mounterPath, - withSystemd: detectSystemd(), - } -} - -// Mount mounts source to target as fstype with given options. 'source' and 'fstype' must -// be an empty string in case it's not required, e.g. for remount, or for auto filesystem -// type, where kernel handles fstype for you. The mount 'options' is a list of options, -// currently come from mount(8), e.g. "ro", "remount", "bind", etc. If no more option is -// required, call Mount with an empty string list or nil. -func (mounter *Mounter) Mount(source string, target string, fstype string, options []string) error { - return mounter.MountSensitive(source, target, fstype, options, nil) -} - -// MountSensitive is the same as Mount() but this method allows -// sensitiveOptions to be passed in a separate parameter from the normal -// mount options and ensures the sensitiveOptions are never logged. This -// method should be used by callers that pass sensitive material (like -// passwords) as mount options. -func (mounter *Mounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - // Path to mounter binary if containerized mounter is needed. Otherwise, it is set to empty. - // All Linux distros are expected to be shipped with a mount utility that a support bind mounts. - mounterPath := "" - bind, bindOpts, bindRemountOpts, bindRemountOptsSensitive := MakeBindOptsSensitive(options, sensitiveOptions) - if bind { - err := mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindOpts, bindRemountOptsSensitive) - if err != nil { - return err - } - return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindRemountOpts, bindRemountOptsSensitive) - } - // The list of filesystems that require containerized mounter on GCI image cluster - fsTypesNeedMounter := map[string]struct{}{ - "nfs": {}, - "glusterfs": {}, - "ceph": {}, - "cifs": {}, - } - if _, ok := fsTypesNeedMounter[fstype]; ok { - mounterPath = mounter.mounterPath - } - return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, options, sensitiveOptions) -} - -// doMount runs the mount command. mounterPath is the path to mounter binary if containerized mounter is used. -// sensitiveOptions is an extension of options except they will not be logged (because they may contain sensitive material) -func (mounter *Mounter) doMount(mounterPath string, mountCmd string, source string, target string, fstype string, options []string, sensitiveOptions []string) error { - mountArgs, mountArgsLogStr := MakeMountArgsSensitive(source, target, fstype, options, sensitiveOptions) - if len(mounterPath) > 0 { - mountArgs = append([]string{mountCmd}, mountArgs...) - mountArgsLogStr = mountCmd + " " + mountArgsLogStr - mountCmd = mounterPath - } - - if mounter.withSystemd { - // Try to run mount via systemd-run --scope. This will escape the - // service where kubelet runs and any fuse daemons will be started in a - // specific scope. kubelet service than can be restarted without killing - // these fuse daemons. - // - // Complete command line (when mounterPath is not used): - // systemd-run --description=... --scope -- mount -t - // - // Expected flow: - // * systemd-run creates a transient scope (=~ cgroup) and executes its - // argument (/bin/mount) there. - // * mount does its job, forks a fuse daemon if necessary and finishes. - // (systemd-run --scope finishes at this point, returning mount's exit - // code and stdout/stderr - thats one of --scope benefits). - // * systemd keeps the fuse daemon running in the scope (i.e. in its own - // cgroup) until the fuse daemon dies (another --scope benefit). - // Kubelet service can be restarted and the fuse daemon survives. - // * When the fuse daemon dies (e.g. during unmount) systemd removes the - // scope automatically. - // - // systemd-mount is not used because it's too new for older distros - // (CentOS 7, Debian Jessie). - mountCmd, mountArgs, mountArgsLogStr = AddSystemdScopeSensitive("systemd-run", target, mountCmd, mountArgs, mountArgsLogStr) - } else { - // No systemd-run on the host (or we failed to check it), assume kubelet - // does not run as a systemd service. - // No code here, mountCmd and mountArgs are already populated. - } - - // Logging with sensitive mount options removed. - klog.V(4).Infof("Mounting cmd (%s) with arguments (%s)", mountCmd, mountArgsLogStr) - command := exec.Command(mountCmd, mountArgs...) - output, err := command.CombinedOutput() - if err != nil { - klog.Errorf("Mount failed: %v\nMounting command: %s\nMounting arguments: %s\nOutput: %s\n", err, mountCmd, mountArgsLogStr, string(output)) - return fmt.Errorf("mount failed: %v\nMounting command: %s\nMounting arguments: %s\nOutput: %s", - err, mountCmd, mountArgsLogStr, string(output)) - } - return err -} - -// detectSystemd returns true if OS runs with systemd as init. When not sure -// (permission errors, ...), it returns false. -// There may be different ways how to detect systemd, this one makes sure that -// systemd-runs (needed by Mount()) works. -func detectSystemd() bool { - if _, err := exec.LookPath("systemd-run"); err != nil { - klog.V(2).Infof("Detected OS without systemd") - return false - } - // Try to run systemd-run --scope /bin/true, that should be enough - // to make sure that systemd is really running and not just installed, - // which happens when running in a container with a systemd-based image - // but with different pid 1. - cmd := exec.Command("systemd-run", "--description=Kubernetes systemd probe", "--scope", "true") - output, err := cmd.CombinedOutput() - if err != nil { - klog.V(2).Infof("Cannot run systemd-run, assuming non-systemd OS") - klog.V(4).Infof("systemd-run failed with: %v", err) - klog.V(4).Infof("systemd-run output: %s", string(output)) - return false - } - klog.V(2).Infof("Detected OS with systemd") - return true -} - -// MakeMountArgs makes the arguments to the mount(8) command. -// options MUST not contain sensitive material (like passwords). -func MakeMountArgs(source, target, fstype string, options []string) (mountArgs []string) { - mountArgs, _ = MakeMountArgsSensitive(source, target, fstype, options, nil /* sensitiveOptions */) - return mountArgs -} - -// MakeMountArgsSensitive makes the arguments to the mount(8) command. -// sensitiveOptions is an extension of options except they will not be logged (because they may contain sensitive material) -func MakeMountArgsSensitive(source, target, fstype string, options []string, sensitiveOptions []string) (mountArgs []string, mountArgsLogStr string) { - // Build mount command as follows: - // mount [-t $fstype] [-o $options] [$source] $target - mountArgs = []string{} - mountArgsLogStr = "" - if len(fstype) > 0 { - mountArgs = append(mountArgs, "-t", fstype) - mountArgsLogStr += strings.Join(mountArgs, " ") - } - if len(options) > 0 || len(sensitiveOptions) > 0 { - combinedOptions := []string{} - combinedOptions = append(combinedOptions, options...) - combinedOptions = append(combinedOptions, sensitiveOptions...) - mountArgs = append(mountArgs, "-o", strings.Join(combinedOptions, ",")) - // exclude sensitiveOptions from log string - mountArgsLogStr += " -o " + sanitizedOptionsForLogging(options, sensitiveOptions) - } - if len(source) > 0 { - mountArgs = append(mountArgs, source) - mountArgsLogStr += " " + source - } - mountArgs = append(mountArgs, target) - mountArgsLogStr += " " + target - - return mountArgs, mountArgsLogStr -} - -// AddSystemdScope adds "system-run --scope" to given command line -// If args contains sensitive material, use AddSystemdScopeSensitive to construct -// a safe to log string. -func AddSystemdScope(systemdRunPath, mountName, command string, args []string) (string, []string) { - descriptionArg := fmt.Sprintf("--description=Kubernetes transient mount for %s", mountName) - systemdRunArgs := []string{descriptionArg, "--scope", "--", command} - return systemdRunPath, append(systemdRunArgs, args...) -} - -// AddSystemdScopeSensitive adds "system-run --scope" to given command line -// It also accepts takes a sanitized string containing mount arguments, mountArgsLogStr, -// and returns the string appended to the systemd command for logging. -func AddSystemdScopeSensitive(systemdRunPath, mountName, command string, args []string, mountArgsLogStr string) (string, []string, string) { - descriptionArg := fmt.Sprintf("--description=Kubernetes transient mount for %s", mountName) - systemdRunArgs := []string{descriptionArg, "--scope", "--", command} - return systemdRunPath, append(systemdRunArgs, args...), strings.Join(systemdRunArgs, " ") + " " + mountArgsLogStr -} - -// Unmount unmounts the target. -func (mounter *Mounter) Unmount(target string) error { - klog.V(4).Infof("Unmounting %s", target) - command := exec.Command("umount", target) - output, err := command.CombinedOutput() - if err != nil { - return fmt.Errorf("unmount failed: %v\nUnmounting arguments: %s\nOutput: %s", err, target, string(output)) - } - return nil -} - -// List returns a list of all mounted filesystems. -func (*Mounter) List() ([]MountPoint, error) { - return ListProcMounts(procMountsPath) -} - -// IsLikelyNotMountPoint determines if a directory is not a mountpoint. -// It is fast but not necessarily ALWAYS correct. If the path is in fact -// a bind mount from one part of a mount to another it will not be detected. -// It also can not distinguish between mountpoints and symbolic links. -// mkdir /tmp/a /tmp/b; mount --bind /tmp/a /tmp/b; IsLikelyNotMountPoint("/tmp/b") -// will return true. When in fact /tmp/b is a mount point. If this situation -// is of interest to you, don't use this function... -func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) { - stat, err := os.Stat(file) - if err != nil { - return true, err - } - rootStat, err := os.Stat(filepath.Dir(strings.TrimSuffix(file, "/"))) - if err != nil { - return true, err - } - // If the directory has a different device as parent, then it is a mountpoint. - if stat.Sys().(*syscall.Stat_t).Dev != rootStat.Sys().(*syscall.Stat_t).Dev { - return false, nil - } - - return true, nil -} - -// GetMountRefs finds all mount references to pathname, returns a -// list of paths. Path could be a mountpoint or a normal -// directory (for bind mount). -func (mounter *Mounter) GetMountRefs(pathname string) ([]string, error) { - pathExists, pathErr := PathExists(pathname) - if !pathExists { - return []string{}, nil - } else if IsCorruptedMnt(pathErr) { - klog.Warningf("GetMountRefs found corrupted mount at %s, treating as unmounted path", pathname) - return []string{}, nil - } else if pathErr != nil { - return nil, fmt.Errorf("error checking path %s: %v", pathname, pathErr) - } - realpath, err := filepath.EvalSymlinks(pathname) - if err != nil { - return nil, err - } - return SearchMountPoints(realpath, procMountInfoPath) -} - -// checkAndRepairFileSystem checks and repairs filesystems using command fsck. -func (mounter *SafeFormatAndMount) checkAndRepairFilesystem(source string) error { - klog.V(4).Infof("Checking for issues with fsck on disk: %s", source) - args := []string{"-a", source} - out, err := mounter.Exec.Command("fsck", args...).CombinedOutput() - if err != nil { - ee, isExitError := err.(utilexec.ExitError) - switch { - case err == utilexec.ErrExecutableNotFound: - klog.Warningf("'fsck' not found on system; continuing mount without running 'fsck'.") - case isExitError && ee.ExitStatus() == fsckErrorsCorrected: - klog.Infof("Device %s has errors which were corrected by fsck.", source) - case isExitError && ee.ExitStatus() == fsckErrorsUncorrected: - return NewMountError(HasFilesystemErrors, "'fsck' found errors on device %s but could not correct them: %s", source, string(out)) - case isExitError && ee.ExitStatus() > fsckErrorsUncorrected: - klog.Infof("`fsck` error %s", string(out)) - } - } - return nil -} - -// formatAndMount uses unix utils to format and mount the given disk -func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - readOnly := false - for _, option := range options { - if option == "ro" { - readOnly = true - break - } - } - if !readOnly { - // Check sensitiveOptions for ro - for _, option := range sensitiveOptions { - if option == "ro" { - readOnly = true - break - } - } - } - - options = append(options, "defaults") - mountErrorValue := UnknownMountError - - // Check if the disk is already formatted - existingFormat, err := mounter.GetDiskFormat(source) - if err != nil { - return NewMountError(GetDiskFormatFailed, "failed to get disk format of disk %s: %v", source, err) - } - - // Use 'ext4' as the default - if len(fstype) == 0 { - fstype = "ext4" - } - - if existingFormat == "" { - // Do not attempt to format the disk if mounting as readonly, return an error to reflect this. - if readOnly { - return NewMountError(UnformattedReadOnly, "cannot mount unformatted disk %s as we are manipulating it in read-only mode", source) - } - - // Disk is unformatted so format it. - args := []string{source} - if fstype == "ext4" || fstype == "ext3" { - args = []string{ - "-F", // Force flag - "-m0", // Zero blocks reserved for super-user - source, - } - } - - klog.Infof("Disk %q appears to be unformatted, attempting to format as type: %q with options: %v", source, fstype, args) - output, err := mounter.Exec.Command("mkfs."+fstype, args...).CombinedOutput() - if err != nil { - // Do not log sensitiveOptions only options - sensitiveOptionsLog := sanitizedOptionsForLogging(options, sensitiveOptions) - detailedErr := fmt.Sprintf("format of disk %q failed: type:(%q) target:(%q) options:(%q) errcode:(%v) output:(%v) ", source, fstype, target, sensitiveOptionsLog, err, string(output)) - klog.Error(detailedErr) - return NewMountError(FormatFailed, detailedErr) - } - - klog.Infof("Disk successfully formatted (mkfs): %s - %s %s", fstype, source, target) - } else { - if fstype != existingFormat { - // Verify that the disk is formatted with filesystem type we are expecting - mountErrorValue = FilesystemMismatch - klog.Warningf("Configured to mount disk %s as %s but current format is %s, things might break", source, existingFormat, fstype) - } - - if !readOnly { - // Run check tools on the disk to fix repairable issues, only do this for formatted volumes requested as rw. - err := mounter.checkAndRepairFilesystem(source) - if err != nil { - return err - } - } - } - - // Mount the disk - klog.V(4).Infof("Attempting to mount disk %s in %s format at %s", source, fstype, target) - if err := mounter.MountSensitive(source, target, fstype, options, sensitiveOptions); err != nil { - return NewMountError(mountErrorValue, err.Error()) - } - - return nil -} - -// GetDiskFormat uses 'blkid' to see if the given disk is unformatted -func (mounter *SafeFormatAndMount) GetDiskFormat(disk string) (string, error) { - args := []string{"-p", "-s", "TYPE", "-s", "PTTYPE", "-o", "export", disk} - klog.V(4).Infof("Attempting to determine if disk %q is formatted using blkid with args: (%v)", disk, args) - dataOut, err := mounter.Exec.Command("blkid", args...).CombinedOutput() - output := string(dataOut) - klog.V(4).Infof("Output: %q, err: %v", output, err) - - if err != nil { - if exit, ok := err.(utilexec.ExitError); ok { - if exit.ExitStatus() == 2 { - // Disk device is unformatted. - // For `blkid`, if the specified token (TYPE/PTTYPE, etc) was - // not found, or no (specified) devices could be identified, an - // exit code of 2 is returned. - return "", nil - } - } - klog.Errorf("Could not determine if disk %q is formatted (%v)", disk, err) - return "", err - } - - var fstype, pttype string - - lines := strings.Split(output, "\n") - for _, l := range lines { - if len(l) <= 0 { - // Ignore empty line. - continue - } - cs := strings.Split(l, "=") - if len(cs) != 2 { - return "", fmt.Errorf("blkid returns invalid output: %s", output) - } - // TYPE is filesystem type, and PTTYPE is partition table type, according - // to https://www.kernel.org/pub/linux/utils/util-linux/v2.21/libblkid-docs/. - if cs[0] == "TYPE" { - fstype = cs[1] - } else if cs[0] == "PTTYPE" { - pttype = cs[1] - } - } - - if len(pttype) > 0 { - klog.V(4).Infof("Disk %s detected partition table type: %s", disk, pttype) - // Returns a special non-empty string as filesystem type, then kubelet - // will not format it. - return "unknown data, probably partitions", nil - } - - return fstype, nil -} - -// ListProcMounts is shared with NsEnterMounter -func ListProcMounts(mountFilePath string) ([]MountPoint, error) { - content, err := utilio.ConsistentRead(mountFilePath, maxListTries) - if err != nil { - return nil, err - } - return parseProcMounts(content) -} - -func parseProcMounts(content []byte) ([]MountPoint, error) { - out := []MountPoint{} - lines := strings.Split(string(content), "\n") - for _, line := range lines { - if line == "" { - // the last split() item is empty string following the last \n - continue - } - fields := strings.Fields(line) - if len(fields) != expectedNumFieldsPerLine { - // Do not log line in case it contains sensitive Mount options - return nil, fmt.Errorf("wrong number of fields (expected %d, got %d)", expectedNumFieldsPerLine, len(fields)) - } - - mp := MountPoint{ - Device: fields[0], - Path: fields[1], - Type: fields[2], - Opts: strings.Split(fields[3], ","), - } - - freq, err := strconv.Atoi(fields[4]) - if err != nil { - return nil, err - } - mp.Freq = freq - - pass, err := strconv.Atoi(fields[5]) - if err != nil { - return nil, err - } - mp.Pass = pass - - out = append(out, mp) - } - return out, nil -} - -// SearchMountPoints finds all mount references to the source, returns a list of -// mountpoints. -// The source can be a mount point or a normal directory (bind mount). We -// didn't support device because there is no use case by now. -// Some filesystems may share a source name, e.g. tmpfs. And for bind mounting, -// it's possible to mount a non-root path of a filesystem, so we need to use -// root path and major:minor to represent mount source uniquely. -// This implementation is shared between Linux and NsEnterMounter -func SearchMountPoints(hostSource, mountInfoPath string) ([]string, error) { - mis, err := ParseMountInfo(mountInfoPath) - if err != nil { - return nil, err - } - - mountID := 0 - rootPath := "" - major := -1 - minor := -1 - - // Finding the underlying root path and major:minor if possible. - // We need search in backward order because it's possible for later mounts - // to overlap earlier mounts. - for i := len(mis) - 1; i >= 0; i-- { - if hostSource == mis[i].MountPoint || PathWithinBase(hostSource, mis[i].MountPoint) { - // If it's a mount point or path under a mount point. - mountID = mis[i].ID - rootPath = filepath.Join(mis[i].Root, strings.TrimPrefix(hostSource, mis[i].MountPoint)) - major = mis[i].Major - minor = mis[i].Minor - break - } - } - - if rootPath == "" || major == -1 || minor == -1 { - return nil, fmt.Errorf("failed to get root path and major:minor for %s", hostSource) - } - - var refs []string - for i := range mis { - if mis[i].ID == mountID { - // Ignore mount entry for mount source itself. - continue - } - if mis[i].Root == rootPath && mis[i].Major == major && mis[i].Minor == minor { - refs = append(refs, mis[i].MountPoint) - } - } - - return refs, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_unsupported.go b/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_unsupported.go deleted file mode 100644 index 985edbe3d56d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_unsupported.go +++ /dev/null @@ -1,77 +0,0 @@ -// +build !linux,!windows - -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mount - -import ( - "errors" -) - -// Mounter implements mount.Interface for unsupported platforms -type Mounter struct { - mounterPath string -} - -var errUnsupported = errors.New("util/mount on this platform is not supported") - -// New returns a mount.Interface for the current system. -// It provides options to override the default mounter behavior. -// mounterPath allows using an alternative to `/bin/mount` for mounting. -func New(mounterPath string) Interface { - return &Mounter{ - mounterPath: mounterPath, - } -} - -// Mount always returns an error on unsupported platforms -func (mounter *Mounter) Mount(source string, target string, fstype string, options []string) error { - return errUnsupported -} - -// Mount always returns an error on unsupported platforms -func (mounter *Mounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - return errUnsupported -} - -// Unmount always returns an error on unsupported platforms -func (mounter *Mounter) Unmount(target string) error { - return errUnsupported -} - -// List always returns an error on unsupported platforms -func (mounter *Mounter) List() ([]MountPoint, error) { - return []MountPoint{}, errUnsupported -} - -// IsLikelyNotMountPoint always returns an error on unsupported platforms -func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) { - return true, errUnsupported -} - -// GetMountRefs always returns an error on unsupported platforms -func (mounter *Mounter) GetMountRefs(pathname string) ([]string, error) { - return nil, errUnsupported -} - -func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - return mounter.Interface.Mount(source, target, fstype, options) -} - -func (mounter *SafeFormatAndMount) diskLooksUnformatted(disk string) (bool, error) { - return true, errUnsupported -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_windows.go b/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_windows.go deleted file mode 100644 index 4ec70fbd18a5..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/mount/mount_windows.go +++ /dev/null @@ -1,313 +0,0 @@ -// +build windows - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mount - -import ( - "fmt" - "os" - "os/exec" - "path/filepath" - "strings" - - "k8s.io/klog/v2" - "k8s.io/utils/keymutex" -) - -const ( - accessDenied string = "access is denied" -) - -// Mounter provides the default implementation of mount.Interface -// for the windows platform. This implementation assumes that the -// kubelet is running in the host's root mount namespace. -type Mounter struct { - mounterPath string -} - -// New returns a mount.Interface for the current system. -// It provides options to override the default mounter behavior. -// mounterPath allows using an alternative to `/bin/mount` for mounting. -func New(mounterPath string) Interface { - return &Mounter{ - mounterPath: mounterPath, - } -} - -// acquire lock for smb mount -var getSMBMountMutex = keymutex.NewHashed(0) - -// Mount : mounts source to target with given options. -// currently only supports cifs(smb), bind mount(for disk) -func (mounter *Mounter) Mount(source string, target string, fstype string, options []string) error { - return mounter.MountSensitive(source, target, fstype, options, nil /* sensitiveOptions */) -} - -// MountSensitive is the same as Mount() but this method allows -// sensitiveOptions to be passed in a separate parameter from the normal -// mount options and ensures the sensitiveOptions are never logged. This -// method should be used by callers that pass sensitive material (like -// passwords) as mount options. -func (mounter *Mounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - target = NormalizeWindowsPath(target) - sanitizedOptionsForLogging := sanitizedOptionsForLogging(options, sensitiveOptions) - - if source == "tmpfs" { - klog.V(3).Infof("mounting source (%q), target (%q), with options (%q)", source, target, sanitizedOptionsForLogging) - return os.MkdirAll(target, 0755) - } - - parentDir := filepath.Dir(target) - if err := os.MkdirAll(parentDir, 0755); err != nil { - return err - } - - klog.V(4).Infof("mount options(%q) source:%q, target:%q, fstype:%q, begin to mount", - sanitizedOptionsForLogging, source, target, fstype) - bindSource := source - - if bind, _, _, _ := MakeBindOptsSensitive(options, sensitiveOptions); bind { - bindSource = NormalizeWindowsPath(source) - } else { - allOptions := []string{} - allOptions = append(allOptions, options...) - allOptions = append(allOptions, sensitiveOptions...) - if len(allOptions) < 2 { - return fmt.Errorf("mount options(%q) should have at least 2 options, current number:%d, source:%q, target:%q", - sanitizedOptionsForLogging, len(allOptions), source, target) - } - - // currently only cifs mount is supported - if strings.ToLower(fstype) != "cifs" { - return fmt.Errorf("only cifs mount is supported now, fstype: %q, mounting source (%q), target (%q), with options (%q)", fstype, source, target, sanitizedOptionsForLogging) - } - - // lock smb mount for the same source - getSMBMountMutex.LockKey(source) - defer getSMBMountMutex.UnlockKey(source) - - username := allOptions[0] - password := allOptions[1] - if output, err := newSMBMapping(username, password, source); err != nil { - klog.Warningf("SMB Mapping(%s) returned with error(%v), output(%s)", source, err, string(output)) - if isSMBMappingExist(source) { - valid, err := isValidPath(source) - if !valid { - if err == nil || isAccessDeniedError(err) { - klog.V(2).Infof("SMB Mapping(%s) already exists while it's not valid, return error: %v, now begin to remove and remount", source, err) - if output, err = removeSMBMapping(source); err != nil { - return fmt.Errorf("Remove-SmbGlobalMapping failed: %v, output: %q", err, output) - } - if output, err := newSMBMapping(username, password, source); err != nil { - return fmt.Errorf("New-SmbGlobalMapping(%s) failed: %v, output: %q", source, err, output) - } - } - } else { - klog.V(2).Infof("SMB Mapping(%s) already exists and is still valid, skip error(%v)", source, err) - } - } else { - return fmt.Errorf("New-SmbGlobalMapping(%s) failed: %v, output: %q", source, err, output) - } - } - } - - output, err := exec.Command("cmd", "/c", "mklink", "/D", target, bindSource).CombinedOutput() - if err != nil { - klog.Errorf("mklink failed: %v, source(%q) target(%q) output: %q", err, bindSource, target, string(output)) - return err - } - klog.V(2).Infof("mklink source(%q) on target(%q) successfully, output: %q", bindSource, target, string(output)) - - return nil -} - -// do the SMB mount with username, password, remotepath -// return (output, error) -func newSMBMapping(username, password, remotepath string) (string, error) { - if username == "" || password == "" || remotepath == "" { - return "", fmt.Errorf("invalid parameter(username: %s, password: %s, remoteapth: %s)", username, sensitiveOptionsRemoved, remotepath) - } - - // use PowerShell Environment Variables to store user input string to prevent command line injection - // https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-5.1 - cmdLine := `$PWord = ConvertTo-SecureString -String $Env:smbpassword -AsPlainText -Force` + - `;$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Env:smbuser, $PWord` + - `;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Credential $Credential` - cmd := exec.Command("powershell", "/c", cmdLine) - cmd.Env = append(os.Environ(), - fmt.Sprintf("smbuser=%s", username), - fmt.Sprintf("smbpassword=%s", password), - fmt.Sprintf("smbremotepath=%s", remotepath)) - - output, err := cmd.CombinedOutput() - return string(output), err -} - -// check whether remotepath is already mounted -func isSMBMappingExist(remotepath string) bool { - cmd := exec.Command("powershell", "/c", `Get-SmbGlobalMapping -RemotePath $Env:smbremotepath`) - cmd.Env = append(os.Environ(), fmt.Sprintf("smbremotepath=%s", remotepath)) - _, err := cmd.CombinedOutput() - return err == nil -} - -// check whether remotepath is valid -// return (true, nil) if remotepath is valid -func isValidPath(remotepath string) (bool, error) { - cmd := exec.Command("powershell", "/c", `Test-Path $Env:remoteapth`) - cmd.Env = append(os.Environ(), fmt.Sprintf("remoteapth=%s", remotepath)) - output, err := cmd.CombinedOutput() - if err != nil { - return false, fmt.Errorf("returned output: %s, error: %v", string(output), err) - } - - return strings.HasPrefix(strings.ToLower(string(output)), "true"), nil -} - -func isAccessDeniedError(err error) bool { - return err != nil && strings.Contains(strings.ToLower(err.Error()), accessDenied) -} - -// remove SMB mapping -func removeSMBMapping(remotepath string) (string, error) { - cmd := exec.Command("powershell", "/c", `Remove-SmbGlobalMapping -RemotePath $Env:smbremotepath -Force`) - cmd.Env = append(os.Environ(), fmt.Sprintf("smbremotepath=%s", remotepath)) - output, err := cmd.CombinedOutput() - return string(output), err -} - -// Unmount unmounts the target. -func (mounter *Mounter) Unmount(target string) error { - klog.V(4).Infof("azureMount: Unmount target (%q)", target) - target = NormalizeWindowsPath(target) - if output, err := exec.Command("cmd", "/c", "rmdir", target).CombinedOutput(); err != nil { - klog.Errorf("rmdir failed: %v, output: %q", err, string(output)) - return err - } - return nil -} - -// List returns a list of all mounted filesystems. todo -func (mounter *Mounter) List() ([]MountPoint, error) { - return []MountPoint{}, nil -} - -// IsLikelyNotMountPoint determines if a directory is not a mountpoint. -func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) { - stat, err := os.Lstat(file) - if err != nil { - return true, err - } - - if stat.Mode()&os.ModeSymlink != 0 { - return false, err - } - return true, nil -} - -// GetMountRefs : empty implementation here since there is no place to query all mount points on Windows -func (mounter *Mounter) GetMountRefs(pathname string) ([]string, error) { - windowsPath := NormalizeWindowsPath(pathname) - pathExists, pathErr := PathExists(windowsPath) - if !pathExists { - return []string{}, nil - } else if IsCorruptedMnt(pathErr) { - klog.Warningf("GetMountRefs found corrupted mount at %s, treating as unmounted path", windowsPath) - return []string{}, nil - } else if pathErr != nil { - return nil, fmt.Errorf("error checking path %s: %v", windowsPath, pathErr) - } - return []string{pathname}, nil -} - -func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error { - // Try to mount the disk - klog.V(4).Infof("Attempting to formatAndMount disk: %s %s %s", fstype, source, target) - - if err := ValidateDiskNumber(source); err != nil { - klog.Errorf("diskMount: formatAndMount failed, err: %v", err) - return err - } - - if len(fstype) == 0 { - // Use 'NTFS' as the default - fstype = "NTFS" - } - - // format disk if it is unformatted(raw) - cmd := fmt.Sprintf("Get-Disk -Number %s | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru"+ - " | New-Partition -UseMaximumSize | Format-Volume -FileSystem %s -Confirm:$false", source, fstype) - if output, err := mounter.Exec.Command("powershell", "/c", cmd).CombinedOutput(); err != nil { - return fmt.Errorf("diskMount: format disk failed, error: %v, output: %q", err, string(output)) - } - klog.V(4).Infof("diskMount: Disk successfully formatted, disk: %q, fstype: %q", source, fstype) - - volumeIds, err := listVolumesOnDisk(source) - if err != nil { - return err - } - driverPath := volumeIds[0] - target = NormalizeWindowsPath(target) - output, err := mounter.Exec.Command("cmd", "/c", "mklink", "/D", target, driverPath).CombinedOutput() - if err != nil { - klog.Errorf("mklink(%s, %s) failed: %v, output: %q", target, driverPath, err, string(output)) - return err - } - klog.V(2).Infof("formatAndMount disk(%s) fstype(%s) on(%s) with output(%s) successfully", driverPath, fstype, target, string(output)) - return nil -} - -// ListVolumesOnDisk - returns back list of volumes(volumeIDs) in the disk (requested in diskID). -func listVolumesOnDisk(diskID string) (volumeIDs []string, err error) { - cmd := fmt.Sprintf("(Get-Disk -DeviceId %s | Get-Partition | Get-Volume).UniqueId", diskID) - output, err := exec.Command("powershell", "/c", cmd).CombinedOutput() - klog.V(4).Infof("listVolumesOnDisk id from %s: %s", diskID, string(output)) - if err != nil { - return []string{}, fmt.Errorf("error list volumes on disk. cmd: %s, output: %s, error: %v", cmd, string(output), err) - } - - volumeIds := strings.Split(strings.TrimSpace(string(output)), "\r\n") - return volumeIds, nil -} - -// getAllParentLinks walks all symbolic links and return all the parent targets recursively -func getAllParentLinks(path string) ([]string, error) { - const maxIter = 255 - links := []string{} - for { - links = append(links, path) - if len(links) > maxIter { - return links, fmt.Errorf("unexpected length of parent links: %v", links) - } - - fi, err := os.Lstat(path) - if err != nil { - return links, fmt.Errorf("Lstat: %v", err) - } - if fi.Mode()&os.ModeSymlink == 0 { - break - } - - path, err = os.Readlink(path) - if err != nil { - return links, fmt.Errorf("Readlink error: %v", err) - } - } - - return links, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/pointer/pointer.go b/cluster-autoscaler/vendor/k8s.io/utils/pointer/pointer.go index 0a55a844ee71..1da6f6664a3d 100644 --- a/cluster-autoscaler/vendor/k8s.io/utils/pointer/pointer.go +++ b/cluster-autoscaler/vendor/k8s.io/utils/pointer/pointer.go @@ -46,86 +46,182 @@ func AllPtrFieldsNil(obj interface{}) bool { return true } -// Int32Ptr returns a pointer to an int32 -func Int32Ptr(i int32) *int32 { +// Int32 returns a pointer to an int32. +func Int32(i int32) *int32 { return &i } -// Int32PtrDerefOr dereference the int32 ptr and returns it if not nil, -// else returns def. -func Int32PtrDerefOr(ptr *int32, def int32) int32 { +var Int32Ptr = Int32 // for back-compat + +// Int32Deref dereferences the int32 ptr and returns it if not nil, or else +// returns def. +func Int32Deref(ptr *int32, def int32) int32 { if ptr != nil { return *ptr } return def } -// Int64Ptr returns a pointer to an int64 -func Int64Ptr(i int64) *int64 { +var Int32PtrDerefOr = Int32Deref // for back-compat + +// Int32Equal returns true if both arguments are nil or both arguments +// dereference to the same value. +func Int32Equal(a, b *int32) bool { + if (a == nil) != (b == nil) { + return false + } + if a == nil { + return true + } + return *a == *b +} + +// Int64 returns a pointer to an int64. +func Int64(i int64) *int64 { return &i } -// Int64PtrDerefOr dereference the int64 ptr and returns it if not nil, -// else returns def. -func Int64PtrDerefOr(ptr *int64, def int64) int64 { +var Int64Ptr = Int64 // for back-compat + +// Int64Deref dereferences the int64 ptr and returns it if not nil, or else +// returns def. +func Int64Deref(ptr *int64, def int64) int64 { if ptr != nil { return *ptr } return def } -// BoolPtr returns a pointer to a bool -func BoolPtr(b bool) *bool { +var Int64PtrDerefOr = Int64Deref // for back-compat + +// Int64Equal returns true if both arguments are nil or both arguments +// dereference to the same value. +func Int64Equal(a, b *int64) bool { + if (a == nil) != (b == nil) { + return false + } + if a == nil { + return true + } + return *a == *b +} + +// Bool returns a pointer to a bool. +func Bool(b bool) *bool { return &b } -// BoolPtrDerefOr dereference the bool ptr and returns it if not nil, -// else returns def. -func BoolPtrDerefOr(ptr *bool, def bool) bool { +var BoolPtr = Bool // for back-compat + +// BoolDeref dereferences the bool ptr and returns it if not nil, or else +// returns def. +func BoolDeref(ptr *bool, def bool) bool { if ptr != nil { return *ptr } return def } -// StringPtr returns a pointer to the passed string. -func StringPtr(s string) *string { +var BoolPtrDerefOr = BoolDeref // for back-compat + +// BoolEqual returns true if both arguments are nil or both arguments +// dereference to the same value. +func BoolEqual(a, b *bool) bool { + if (a == nil) != (b == nil) { + return false + } + if a == nil { + return true + } + return *a == *b +} + +// String returns a pointer to a string. +func String(s string) *string { return &s } -// StringPtrDerefOr dereference the string ptr and returns it if not nil, -// else returns def. -func StringPtrDerefOr(ptr *string, def string) string { +var StringPtr = String // for back-compat + +// StringDeref dereferences the string ptr and returns it if not nil, or else +// returns def. +func StringDeref(ptr *string, def string) string { if ptr != nil { return *ptr } return def } -// Float32Ptr returns a pointer to the passed float32. -func Float32Ptr(i float32) *float32 { +var StringPtrDerefOr = StringDeref // for back-compat + +// StringEqual returns true if both arguments are nil or both arguments +// dereference to the same value. +func StringEqual(a, b *string) bool { + if (a == nil) != (b == nil) { + return false + } + if a == nil { + return true + } + return *a == *b +} + +// Float32 returns a pointer to the a float32. +func Float32(i float32) *float32 { return &i } -// Float32PtrDerefOr dereference the float32 ptr and returns it if not nil, -// else returns def. -func Float32PtrDerefOr(ptr *float32, def float32) float32 { +var Float32Ptr = Float32 + +// Float32Deref dereferences the float32 ptr and returns it if not nil, or else +// returns def. +func Float32Deref(ptr *float32, def float32) float32 { if ptr != nil { return *ptr } return def } -// Float64Ptr returns a pointer to the passed float64. -func Float64Ptr(i float64) *float64 { +var Float32PtrDerefOr = Float32Deref // for back-compat + +// Float32Equal returns true if both arguments are nil or both arguments +// dereference to the same value. +func Float32Equal(a, b *float32) bool { + if (a == nil) != (b == nil) { + return false + } + if a == nil { + return true + } + return *a == *b +} + +// Float64 returns a pointer to the a float64. +func Float64(i float64) *float64 { return &i } -// Float64PtrDerefOr dereference the float64 ptr and returns it if not nil, -// else returns def. -func Float64PtrDerefOr(ptr *float64, def float64) float64 { +var Float64Ptr = Float64 + +// Float64Deref dereferences the float64 ptr and returns it if not nil, or else +// returns def. +func Float64Deref(ptr *float64, def float64) float64 { if ptr != nil { return *ptr } return def } + +var Float64PtrDerefOr = Float64Deref // for back-compat + +// Float64Equal returns true if both arguments are nil or both arguments +// dereference to the same value. +func Float64Equal(a, b *float64) bool { + if (a == nil) != (b == nil) { + return false + } + if a == nil { + return true + } + return *a == *b +} diff --git a/cluster-autoscaler/vendor/modules.txt b/cluster-autoscaler/vendor/modules.txt index 505524a63b45..cb2d9f7d322a 100644 --- a/cluster-autoscaler/vendor/modules.txt +++ b/cluster-autoscaler/vendor/modules.txt @@ -132,22 +132,23 @@ github.com/beorn7/perks/quantile github.com/blang/semver # github.com/cespare/xxhash/v2 v2.1.1 github.com/cespare/xxhash/v2 -# github.com/checkpoint-restore/go-criu/v4 v4.1.0 -github.com/checkpoint-restore/go-criu/v4 -github.com/checkpoint-restore/go-criu/v4/rpc -# github.com/cilium/ebpf v0.2.0 +# github.com/checkpoint-restore/go-criu/v5 v5.0.0 +github.com/checkpoint-restore/go-criu/v5 +github.com/checkpoint-restore/go-criu/v5/rpc +# github.com/cilium/ebpf v0.5.0 github.com/cilium/ebpf github.com/cilium/ebpf/asm github.com/cilium/ebpf/internal github.com/cilium/ebpf/internal/btf github.com/cilium/ebpf/internal/unix +github.com/cilium/ebpf/link # github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313 github.com/clusterhq/flocker-go # github.com/container-storage-interface/spec v1.3.0 github.com/container-storage-interface/spec/lib/go/csi # github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 github.com/containerd/cgroups/stats/v1 -# github.com/containerd/console v1.0.1 +# github.com/containerd/console v1.0.2 github.com/containerd/console # github.com/containerd/containerd v1.4.4 github.com/containerd/containerd/api/services/containers/v1 @@ -164,7 +165,7 @@ github.com/containerd/containerd/pkg/dialer github.com/containerd/containerd/platforms # github.com/containerd/ttrpc v1.0.2 github.com/containerd/ttrpc -# github.com/containernetworking/cni v0.8.0 +# github.com/containernetworking/cni v0.8.1 github.com/containernetworking/cni/libcni github.com/containernetworking/cni/pkg/invoke github.com/containernetworking/cni/pkg/types @@ -177,7 +178,7 @@ github.com/coreos/go-semver/semver # github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e github.com/coreos/go-systemd/daemon github.com/coreos/go-systemd/journal -# github.com/coreos/go-systemd/v22 v22.1.0 +# github.com/coreos/go-systemd/v22 v22.3.1 github.com/coreos/go-systemd/v22/dbus # github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f github.com/coreos/pkg/capnslog @@ -226,7 +227,7 @@ github.com/emicklei/go-restful github.com/emicklei/go-restful/log # github.com/euank/go-kmsg-parser v2.0.0+incompatible github.com/euank/go-kmsg-parser/kmsgparser -# github.com/evanphx/json-patch v4.9.0+incompatible +# github.com/evanphx/json-patch v4.11.0+incompatible github.com/evanphx/json-patch # github.com/form3tech-oss/jwt-go v3.2.2+incompatible github.com/form3tech-oss/jwt-go @@ -246,7 +247,7 @@ github.com/go-openapi/swag # github.com/go-ozzo/ozzo-validation v3.5.0+incompatible github.com/go-ozzo/ozzo-validation github.com/go-ozzo/ozzo-validation/is -# github.com/godbus/dbus/v5 v5.0.3 +# github.com/godbus/dbus/v5 v5.0.4 github.com/godbus/dbus/v5 # github.com/gofrs/uuid v4.0.0+incompatible github.com/gofrs/uuid @@ -269,7 +270,7 @@ github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp github.com/golang/protobuf/ptypes/wrappers -# github.com/google/cadvisor v0.39.0 +# github.com/google/cadvisor v0.39.2 github.com/google/cadvisor/accelerators github.com/google/cadvisor/cache/memory github.com/google/cadvisor/collector @@ -313,7 +314,7 @@ github.com/google/cadvisor/utils/sysinfo github.com/google/cadvisor/version github.com/google/cadvisor/watcher github.com/google/cadvisor/zfs -# github.com/google/go-cmp v0.5.2 +# github.com/google/go-cmp v0.5.4 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/cmpopts github.com/google/go-cmp/cmp/internal/diff @@ -387,8 +388,6 @@ github.com/jmespath/go-jmespath github.com/json-iterator/go # github.com/karrick/godirwalk v1.16.1 github.com/karrick/godirwalk -# github.com/konsorten/go-windows-terminal-sequences v1.0.3 -## explicit # github.com/libopenstorage/openstorage v1.0.0 github.com/libopenstorage/openstorage/api github.com/libopenstorage/openstorage/api/client @@ -418,7 +417,7 @@ github.com/moby/ipvs # github.com/moby/spdystream v0.2.0 github.com/moby/spdystream github.com/moby/spdystream/spdy -# github.com/moby/sys/mountinfo v0.4.0 +# github.com/moby/sys/mountinfo v0.4.1 github.com/moby/sys/mountinfo # github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 github.com/moby/term @@ -442,7 +441,7 @@ github.com/opencontainers/go-digest # github.com/opencontainers/image-spec v1.0.1 github.com/opencontainers/image-spec/specs-go github.com/opencontainers/image-spec/specs-go/v1 -# github.com/opencontainers/runc v1.0.0-rc93 +# github.com/opencontainers/runc v1.0.0-rc95 github.com/opencontainers/runc/libcontainer github.com/opencontainers/runc/libcontainer/apparmor github.com/opencontainers/runc/libcontainer/capabilities @@ -465,9 +464,10 @@ github.com/opencontainers/runc/libcontainer/seccomp/patchbpf github.com/opencontainers/runc/libcontainer/stacktrace github.com/opencontainers/runc/libcontainer/system github.com/opencontainers/runc/libcontainer/user +github.com/opencontainers/runc/libcontainer/userns github.com/opencontainers/runc/libcontainer/utils github.com/opencontainers/runc/types -# github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d +# github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 github.com/opencontainers/runtime-spec/specs-go # github.com/opencontainers/selinux v1.8.0 github.com/opencontainers/selinux/go-selinux @@ -486,7 +486,7 @@ github.com/prometheus/client_golang/prometheus/testutil github.com/prometheus/client_golang/prometheus/testutil/promlint # github.com/prometheus/client_model v0.2.0 github.com/prometheus/client_model/go -# github.com/prometheus/common v0.10.0 +# github.com/prometheus/common v0.26.0 github.com/prometheus/common/expfmt github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg github.com/prometheus/common/model @@ -520,7 +520,7 @@ github.com/storageos/go-api/serror github.com/storageos/go-api/types # github.com/stretchr/objx v0.2.0 github.com/stretchr/objx -# github.com/stretchr/testify v1.6.1 +# github.com/stretchr/testify v1.7.0 ## explicit github.com/stretchr/testify/assert github.com/stretchr/testify/mock @@ -528,9 +528,6 @@ github.com/stretchr/testify/require github.com/stretchr/testify/suite # github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 github.com/syndtr/gocapability/capability -# github.com/thecodeteam/goscaleio v0.1.0 -github.com/thecodeteam/goscaleio -github.com/thecodeteam/goscaleio/types/v1 # github.com/vishvananda/netlink v1.1.0 github.com/vishvananda/netlink github.com/vishvananda/netlink/nl @@ -656,7 +653,7 @@ golang.org/x/oauth2/jws golang.org/x/oauth2/jwt # golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 golang.org/x/sync/singleflight -# golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 +# golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 golang.org/x/sys/cpu golang.org/x/sys/internal/unsafeheader golang.org/x/sys/plan9 @@ -666,7 +663,7 @@ golang.org/x/sys/windows/registry golang.org/x/sys/windows/svc # golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d golang.org/x/term -# golang.org/x/text v0.3.4 +# golang.org/x/text v0.3.6 golang.org/x/text/encoding golang.org/x/text/encoding/internal golang.org/x/text/encoding/internal/identifier @@ -801,7 +798,7 @@ gopkg.in/warnings.v0 gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 gopkg.in/yaml.v3 -# k8s.io/api v0.22.0-alpha.1 => k8s.io/api v0.22.0-alpha.1 +# k8s.io/api v0.22.0-alpha.3 => k8s.io/api v0.22.0-alpha.3 ## explicit k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -848,7 +845,7 @@ k8s.io/api/scheduling/v1beta1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -# k8s.io/apimachinery v0.22.0-alpha.1 => k8s.io/apimachinery v0.22.0-alpha.1 +# k8s.io/apimachinery v0.22.0-alpha.3 => k8s.io/apimachinery v0.22.0-alpha.3 ## explicit k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -909,7 +906,7 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.22.0-alpha.1 => k8s.io/apiserver v0.22.0-alpha.1 +# k8s.io/apiserver v0.22.0-alpha.3 => k8s.io/apiserver v0.22.0-alpha.3 ## explicit k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/admission/configuration @@ -1028,6 +1025,7 @@ k8s.io/apiserver/pkg/util/openapi k8s.io/apiserver/pkg/util/shufflesharding k8s.io/apiserver/pkg/util/webhook k8s.io/apiserver/pkg/util/wsstream +k8s.io/apiserver/pkg/util/x509metrics k8s.io/apiserver/pkg/warning k8s.io/apiserver/plugin/pkg/audit/buffered k8s.io/apiserver/plugin/pkg/audit/log @@ -1035,7 +1033,7 @@ k8s.io/apiserver/plugin/pkg/audit/truncate k8s.io/apiserver/plugin/pkg/audit/webhook k8s.io/apiserver/plugin/pkg/authenticator/token/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook -# k8s.io/client-go v0.22.0-alpha.1 => k8s.io/client-go v0.22.0-alpha.1 +# k8s.io/client-go v0.22.0-alpha.3 => k8s.io/client-go v0.22.0-alpha.3 ## explicit k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1 @@ -1319,7 +1317,7 @@ k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/workqueue -# k8s.io/cloud-provider v0.22.0-alpha.1 => k8s.io/cloud-provider v0.22.0-alpha.1 +# k8s.io/cloud-provider v0.22.0-alpha.3 => k8s.io/cloud-provider v0.22.0-alpha.3 ## explicit k8s.io/cloud-provider k8s.io/cloud-provider/api @@ -1329,7 +1327,7 @@ k8s.io/cloud-provider/service/helpers k8s.io/cloud-provider/volume k8s.io/cloud-provider/volume/errors k8s.io/cloud-provider/volume/helpers -# k8s.io/component-base v0.22.0-alpha.1 => k8s.io/component-base v0.22.0-alpha.1 +# k8s.io/component-base v0.22.0-alpha.3 => k8s.io/component-base v0.22.0-alpha.3 ## explicit k8s.io/component-base/cli/flag k8s.io/component-base/codec @@ -1351,20 +1349,20 @@ k8s.io/component-base/metrics/prometheus/workqueue k8s.io/component-base/metrics/testutil k8s.io/component-base/version k8s.io/component-base/version/verflag -# k8s.io/component-helpers v0.22.0-alpha.1 => k8s.io/component-helpers v0.22.0-alpha.1 +# k8s.io/component-helpers v0.22.0-alpha.3 => k8s.io/component-helpers v0.22.0-alpha.3 ## explicit k8s.io/component-helpers/apimachinery/lease k8s.io/component-helpers/node/topology k8s.io/component-helpers/scheduling/corev1 k8s.io/component-helpers/scheduling/corev1/nodeaffinity k8s.io/component-helpers/storage/volume -# k8s.io/cri-api v0.0.0 => k8s.io/cri-api v0.22.0-alpha.1 +# k8s.io/cri-api v0.0.0 => k8s.io/cri-api v0.22.0-alpha.3 k8s.io/cri-api/pkg/apis k8s.io/cri-api/pkg/apis/runtime/v1alpha2 -# k8s.io/csi-translation-lib v0.22.0-alpha.1 => k8s.io/csi-translation-lib v0.22.0-alpha.1 +# k8s.io/csi-translation-lib v0.22.0-alpha.3 => k8s.io/csi-translation-lib v0.22.0-alpha.3 k8s.io/csi-translation-lib k8s.io/csi-translation-lib/plugins -# k8s.io/klog/v2 v2.8.0 +# k8s.io/klog/v2 v2.9.0 ## explicit k8s.io/klog/v2 # k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e @@ -1375,15 +1373,15 @@ k8s.io/kube-openapi/pkg/schemaconv k8s.io/kube-openapi/pkg/util k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/validation/spec -# k8s.io/kube-proxy v0.0.0 => k8s.io/kube-proxy v0.22.0-alpha.1 +# k8s.io/kube-proxy v0.0.0 => k8s.io/kube-proxy v0.22.0-alpha.3 k8s.io/kube-proxy/config/v1alpha1 -# k8s.io/kube-scheduler v0.0.0 => k8s.io/kube-scheduler v0.22.0-alpha.1 +# k8s.io/kube-scheduler v0.0.0 => k8s.io/kube-scheduler v0.22.0-alpha.3 k8s.io/kube-scheduler/config/v1 k8s.io/kube-scheduler/config/v1beta1 k8s.io/kube-scheduler/extender/v1 -# k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.22.0-alpha.1 +# k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.22.0-alpha.3 k8s.io/kubectl/pkg/scale -# k8s.io/kubelet v0.0.0 => k8s.io/kubelet v0.22.0-alpha.1 +# k8s.io/kubelet v0.0.0 => k8s.io/kubelet v0.22.0-alpha.3 ## explicit k8s.io/kubelet/config/v1alpha1 k8s.io/kubelet/config/v1beta1 @@ -1396,7 +1394,7 @@ k8s.io/kubelet/pkg/apis/pluginregistration/v1 k8s.io/kubelet/pkg/apis/podresources/v1 k8s.io/kubelet/pkg/apis/podresources/v1alpha1 k8s.io/kubelet/pkg/apis/stats/v1alpha1 -# k8s.io/kubernetes v1.22.0-alpha.1 +# k8s.io/kubernetes v1.22.0-alpha.3 ## explicit k8s.io/kubernetes/cmd/kube-proxy/app k8s.io/kubernetes/cmd/kubelet/app @@ -1668,7 +1666,6 @@ k8s.io/kubernetes/pkg/volume/portworx k8s.io/kubernetes/pkg/volume/projected k8s.io/kubernetes/pkg/volume/quobyte k8s.io/kubernetes/pkg/volume/rbd -k8s.io/kubernetes/pkg/volume/scaleio k8s.io/kubernetes/pkg/volume/secret k8s.io/kubernetes/pkg/volume/storageos k8s.io/kubernetes/pkg/volume/util @@ -1687,7 +1684,7 @@ k8s.io/kubernetes/pkg/volume/vsphere_volume k8s.io/kubernetes/pkg/windows/service k8s.io/kubernetes/test/utils k8s.io/kubernetes/third_party/forked/golang/expansion -# k8s.io/legacy-cloud-providers v0.0.0 => k8s.io/legacy-cloud-providers v0.22.0-alpha.1 +# k8s.io/legacy-cloud-providers v0.0.0 => k8s.io/legacy-cloud-providers v0.22.0-alpha.3 ## explicit k8s.io/legacy-cloud-providers/aws k8s.io/legacy-cloud-providers/azure @@ -1733,9 +1730,9 @@ k8s.io/legacy-cloud-providers/openstack k8s.io/legacy-cloud-providers/vsphere k8s.io/legacy-cloud-providers/vsphere/vclib k8s.io/legacy-cloud-providers/vsphere/vclib/diskmanagers -# k8s.io/mount-utils v0.0.0 => k8s.io/mount-utils v0.22.0-alpha.1 +# k8s.io/mount-utils v0.22.0-alpha.3 => k8s.io/mount-utils v0.22.0-alpha.3 k8s.io/mount-utils -# k8s.io/utils v0.0.0-20201110183641-67b214c5f920 +# k8s.io/utils v0.0.0-20210521133846-da695404a2bc ## explicit k8s.io/utils/buffer k8s.io/utils/clock @@ -1744,7 +1741,6 @@ k8s.io/utils/inotify k8s.io/utils/integer k8s.io/utils/io k8s.io/utils/keymutex -k8s.io/utils/mount k8s.io/utils/net k8s.io/utils/net/ebtables k8s.io/utils/nsenter @@ -1752,7 +1748,7 @@ k8s.io/utils/path k8s.io/utils/pointer k8s.io/utils/strings k8s.io/utils/trace -# sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15 +# sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19 sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client # sigs.k8s.io/structured-merge-diff/v4 v4.1.1 @@ -1765,29 +1761,30 @@ sigs.k8s.io/structured-merge-diff/v4/value sigs.k8s.io/yaml # github.com/digitalocean/godo => github.com/digitalocean/godo v1.27.0 # github.com/rancher/go-rancher => github.com/rancher/go-rancher v0.1.0 -# k8s.io/api => k8s.io/api v0.22.0-alpha.1 -# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0-alpha.1 -# k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.1 -# k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.1 -# k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.0-alpha.1 -# k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.1 -# k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0-alpha.1 -# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.0-alpha.1 -# k8s.io/code-generator => k8s.io/code-generator v0.22.0-alpha.1 -# k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.1 -# k8s.io/component-helpers => k8s.io/component-helpers v0.22.0-alpha.1 -# k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.1 -# k8s.io/cri-api => k8s.io/cri-api v0.22.0-alpha.1 -# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.22.0-alpha.1 -# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.22.0-alpha.1 -# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.22.0-alpha.1 -# k8s.io/kube-proxy => k8s.io/kube-proxy v0.22.0-alpha.1 -# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.22.0-alpha.1 -# k8s.io/kubectl => k8s.io/kubectl v0.22.0-alpha.1 -# k8s.io/kubelet => k8s.io/kubelet v0.22.0-alpha.1 -# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.22.0-alpha.1 -# k8s.io/metrics => k8s.io/metrics v0.22.0-alpha.1 -# k8s.io/mount-utils => k8s.io/mount-utils v0.22.0-alpha.1 -# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.0-alpha.1 -# k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.22.0-alpha.1 -# k8s.io/sample-controller => k8s.io/sample-controller v0.22.0-alpha.1 +# k8s.io/api => k8s.io/api v0.22.0-alpha.3 +# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0-alpha.3 +# k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.3 +# k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.3 +# k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.0-alpha.3 +# k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.3 +# k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0-alpha.3 +# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.0-alpha.3 +# k8s.io/code-generator => k8s.io/code-generator v0.22.0-alpha.3 +# k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.3 +# k8s.io/component-helpers => k8s.io/component-helpers v0.22.0-alpha.3 +# k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.3 +# k8s.io/cri-api => k8s.io/cri-api v0.22.0-alpha.3 +# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.22.0-alpha.3 +# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.22.0-alpha.3 +# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.22.0-alpha.3 +# k8s.io/kube-proxy => k8s.io/kube-proxy v0.22.0-alpha.3 +# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.22.0-alpha.3 +# k8s.io/kubectl => k8s.io/kubectl v0.22.0-alpha.3 +# k8s.io/kubelet => k8s.io/kubelet v0.22.0-alpha.3 +# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.22.0-alpha.3 +# k8s.io/metrics => k8s.io/metrics v0.22.0-alpha.3 +# k8s.io/mount-utils => k8s.io/mount-utils v0.22.0-alpha.3 +# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.0-alpha.3 +# k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.22.0-alpha.3 +# k8s.io/sample-controller => k8s.io/sample-controller v0.22.0-alpha.3 +# k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.22.0-alpha.3 diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go b/cluster-autoscaler/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go index 1d9a4950024e..9d1f6f911e0a 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go @@ -19,6 +19,7 @@ package client import ( "context" "errors" + "fmt" "io" "math/rand" "net" @@ -49,6 +50,10 @@ type grpcTunnel struct { conns map[int64]*conn pendingDialLock sync.RWMutex connsLock sync.RWMutex + + // The tunnel will be closed if the caller fails to read via conn.Read() + // more than readTimeoutSeconds after a packet has been received. + readTimeoutSeconds int } type clientConn interface { @@ -75,9 +80,10 @@ func CreateSingleUseGrpcTunnel(address string, opts ...grpc.DialOption) (Tunnel, } tunnel := &grpcTunnel{ - stream: stream, - pendingDial: make(map[int64]chan<- dialResult), - conns: make(map[int64]*conn), + stream: stream, + pendingDial: make(map[int64]chan<- dialResult), + conns: make(map[int64]*conn), + readTimeoutSeconds: 10, } go tunnel.serve(c) @@ -110,10 +116,17 @@ func (t *grpcTunnel) serve(c clientConn) { if !ok { klog.V(1).Infoln("DialResp not recognized; dropped") } else { - ch <- dialResult{ + result := dialResult{ err: resp.Error, connid: resp.ConnectID, } + select { + case ch <- result: + default: + klog.ErrorS(fmt.Errorf("blocked pending channel"), "Received second dial response for connection request", "connectionID", resp.ConnectID, "dialID", resp.Random) + // On multiple dial responses, avoid leaking serve goroutine. + return + } } if resp.Error != "" { @@ -129,7 +142,14 @@ func (t *grpcTunnel) serve(c clientConn) { t.connsLock.RUnlock() if ok { - conn.readCh <- resp.Data + timer := time.NewTimer((time.Duration)(t.readTimeoutSeconds) * time.Second) + select { + case conn.readCh <- resp.Data: + timer.Stop() + case <-timer.C: + klog.ErrorS(fmt.Errorf("timeout"), "readTimeout has been reached, the grpc connection to the proxy server will be closed", "connectionID", conn.connID, "readTimeoutSeconds", t.readTimeoutSeconds) + return + } } else { klog.V(1).InfoS("connection not recognized", "connectionID", resp.ConnectID) } @@ -160,8 +180,8 @@ func (t *grpcTunnel) Dial(protocol, address string) (net.Conn, error) { return nil, errors.New("protocol not supported") } - random := rand.Int63() - resCh := make(chan dialResult) + random := rand.Int63() /* #nosec G404 */ + resCh := make(chan dialResult, 1) t.pendingDialLock.Lock() t.pendingDial[random] = resCh t.pendingDialLock.Unlock() @@ -199,7 +219,7 @@ func (t *grpcTunnel) Dial(protocol, address string) (net.Conn, error) { } c.connID = res.connid c.readCh = make(chan []byte, 10) - c.closeCh = make(chan string) + c.closeCh = make(chan string, 1) t.connsLock.Lock() t.conns[res.connid] = c t.connsLock.Unlock() From 756a3e155ddc749959a52146604f8199e1062dd7 Mon Sep 17 00:00:00 2001 From: Marwan Ahmed Date: Wed, 9 Jun 2021 18:59:35 -0700 Subject: [PATCH 45/86] dont proactively decrement azure cache for unregistered nodes --- .../cloudprovider/azure/azure_scale_set.go | 17 ++-- .../azure/azure_scale_set_test.go | 77 +++++++++++++++++++ 2 files changed, 89 insertions(+), 5 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_scale_set.go b/cluster-autoscaler/cloudprovider/azure/azure_scale_set.go index e5d49bad31da..e64f230e23ed 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_scale_set.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_scale_set.go @@ -340,7 +340,7 @@ func (scaleSet *ScaleSet) Belongs(node *apiv1.Node) (bool, error) { } // DeleteInstances deletes the given instances. All instances must be controlled by the same ASG. -func (scaleSet *ScaleSet) DeleteInstances(instances []*azureRef) error { +func (scaleSet *ScaleSet) DeleteInstances(instances []*azureRef, hasUnregisteredNodes bool) error { if len(instances) == 0 { return nil } @@ -405,9 +405,12 @@ func (scaleSet *ScaleSet) DeleteInstances(instances []*azureRef) error { // Proactively decrement scale set size so that we don't // go below minimum node count if cache data is stale - scaleSet.sizeMutex.Lock() - scaleSet.curSize -= int64(len(instanceIDs)) - scaleSet.sizeMutex.Unlock() + // only do it for non-unregistered nodes + if !hasUnregisteredNodes { + scaleSet.sizeMutex.Lock() + scaleSet.curSize -= int64(len(instanceIDs)) + scaleSet.sizeMutex.Unlock() + } // Proactively set the status of the instances to be deleted in cache for _, instance := range instancesToDelete { @@ -432,6 +435,7 @@ func (scaleSet *ScaleSet) DeleteNodes(nodes []*apiv1.Node) error { } refs := make([]*azureRef, 0, len(nodes)) + hasUnregisteredNodes := false for _, node := range nodes { belongs, err := scaleSet.Belongs(node) if err != nil { @@ -442,13 +446,16 @@ func (scaleSet *ScaleSet) DeleteNodes(nodes []*apiv1.Node) error { return fmt.Errorf("%s belongs to a different asg than %s", node.Name, scaleSet.Id()) } + if node.Annotations[cloudprovider.FakeNodeReasonAnnotation] == cloudprovider.FakeNodeUnregistered { + hasUnregisteredNodes = true + } ref := &azureRef{ Name: node.Spec.ProviderID, } refs = append(refs, ref) } - return scaleSet.DeleteInstances(refs) + return scaleSet.DeleteInstances(refs, hasUnregisteredNodes) } // Id returns ScaleSet id. diff --git a/cluster-autoscaler/cloudprovider/azure/azure_scale_set_test.go b/cluster-autoscaler/cloudprovider/azure/azure_scale_set_test.go index 53291a8d48a0..dcb6185a1974 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_scale_set_test.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_scale_set_test.go @@ -18,6 +18,7 @@ package azure import ( "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "net/http" "testing" "time" @@ -346,6 +347,82 @@ func TestDeleteNodes(t *testing.T) { assert.Equal(t, instance2.Status.State, cloudprovider.InstanceDeleting) } +func TestDeleteNodeUnregistered(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + manager := newTestAzureManager(t) + vmssName := "test-asg" + var vmssCapacity int64 = 2 + + expectedScaleSets := []compute.VirtualMachineScaleSet{ + { + Name: &vmssName, + Sku: &compute.Sku{ + Capacity: &vmssCapacity, + }, + }, + } + expectedVMSSVMs := newTestVMSSVMList(2) + + mockVMSSClient := mockvmssclient.NewMockInterface(ctrl) + mockVMSSClient.EXPECT().List(gomock.Any(), manager.config.ResourceGroup).Return(expectedScaleSets, nil).Times(2) + mockVMSSClient.EXPECT().DeleteInstancesAsync(gomock.Any(), manager.config.ResourceGroup, gomock.Any(), gomock.Any()).Return(nil, nil) + mockVMSSClient.EXPECT().WaitForAsyncOperationResult(gomock.Any(), gomock.Any()).Return(&http.Response{StatusCode: http.StatusOK}, nil).AnyTimes() + manager.azClient.virtualMachineScaleSetsClient = mockVMSSClient + mockVMSSVMClient := mockvmssvmclient.NewMockInterface(ctrl) + mockVMSSVMClient.EXPECT().List(gomock.Any(), manager.config.ResourceGroup, "test-asg", gomock.Any()).Return(expectedVMSSVMs, nil).AnyTimes() + manager.azClient.virtualMachineScaleSetVMsClient = mockVMSSVMClient + err := manager.forceRefresh() + assert.NoError(t, err) + + resourceLimiter := cloudprovider.NewResourceLimiter( + map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, + map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}) + provider, err := BuildAzureCloudProvider(manager, resourceLimiter) + assert.NoError(t, err) + + registered := manager.RegisterNodeGroup( + newTestScaleSet(manager, "test-asg")) + manager.explicitlyConfigured["test-asg"] = true + assert.True(t, registered) + err = manager.forceRefresh() + assert.NoError(t, err) + + scaleSet, ok := provider.NodeGroups()[0].(*ScaleSet) + assert.True(t, ok) + + targetSize, err := scaleSet.TargetSize() + assert.NoError(t, err) + assert.Equal(t, 2, targetSize) + + // annotate node with unregistered annotation + annotations := make(map[string]string) + annotations[cloudprovider.FakeNodeReasonAnnotation] = cloudprovider.FakeNodeUnregistered + nodesToDelete := []*apiv1.Node{ + { + ObjectMeta: metav1.ObjectMeta{ + Annotations: annotations, + }, + Spec: apiv1.NodeSpec{ + ProviderID: "azure://" + fmt.Sprintf(fakeVirtualMachineScaleSetVMID, 0), + }, + }, + } + err = scaleSet.DeleteNodes(nodesToDelete) + assert.NoError(t, err) + + // Ensure the the cached size has NOT been proactively decremented + targetSize, err = scaleSet.TargetSize() + assert.NoError(t, err) + assert.Equal(t, 2, targetSize) + + // Ensure that the status for the instances is Deleting + instance0, found := scaleSet.getInstanceByProviderID("azure://" + fmt.Sprintf(fakeVirtualMachineScaleSetVMID, 0)) + assert.True(t, found, true) + assert.Equal(t, instance0.Status.State, cloudprovider.InstanceDeleting) +} + func TestDeleteNoConflictRequest(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() From 671df22f9af163a0dfadb14157d0f99587848231 Mon Sep 17 00:00:00 2001 From: Jayant Jain Date: Fri, 11 Jun 2021 12:37:36 +0000 Subject: [PATCH 46/86] Adding support for PERMISSIONS_ERROR in gce cloud provider --- .../cloudprovider/gce/autoscaling_gce_client.go | 13 ++++++++++++- .../gce/autoscaling_gce_client_test.go | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go index bca0f7bb4422..1424a349b823 100644 --- a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go +++ b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go @@ -50,6 +50,10 @@ const ( // exhausted. ErrorIPSpaceExhausted = "IP_SPACE_EXHAUSTED" + // ErrorCodePermissions is an error code used in InstanceErrorInfo if the user is facing + // permissions error + ErrorCodePermissions = "PERMISSIONS_ERROR" + // ErrorCodeOther is an error code used in InstanceErrorInfo if other error occurs. ErrorCodeOther = "OTHER" ) @@ -271,6 +275,9 @@ func (client *autoscalingGceClientV1) FetchMigInstances(migRef GceRef) ([]cloudp } else if isIPSpaceExhaustedErrorCode(instanceError.Code) { errorInfo.ErrorClass = cloudprovider.OtherErrorClass errorInfo.ErrorCode = ErrorIPSpaceExhausted + } else if isPermissionsError(instanceError.Code) { + errorInfo.ErrorClass = cloudprovider.OtherErrorClass + errorInfo.ErrorCode = ErrorCodePermissions } else if isInstanceNotRunningYet(gceInstance) { if !errorFound { // do not override error code with OTHER @@ -306,7 +313,7 @@ func (client *autoscalingGceClientV1) FetchMigInstances(migRef GceRef) ([]cloudp } klogx.V(4).Over(errorLoggingQuota).Infof("Got %v other GCE instances being created with lastAttemptErrors", -errorLoggingQuota.Left()) if len(errorCodeCounts) > 0 { - klog.V(4).Infof("Spotted following instance creation error codes: %#v", errorCodeCounts) + klog.Warningf("Spotted following instance creation error codes: %#v", errorCodeCounts) } return infos, nil } @@ -330,6 +337,10 @@ func isIPSpaceExhaustedErrorCode(errorCode string) bool { return strings.Contains(errorCode, "IP_SPACE_EXHAUSTED") } +func isPermissionsError(errorCode string) bool { + return strings.Contains(errorCode, "PERMISSIONS_ERROR") +} + func isInstanceNotRunningYet(gceInstance *gce.ManagedInstance) bool { return gceInstance.InstanceStatus == "" || gceInstance.InstanceStatus == "PROVISIONING" || gceInstance.InstanceStatus == "STAGING" } diff --git a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client_test.go b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client_test.go index 19e54e0638a0..a4c33d547122 100644 --- a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client_test.go +++ b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client_test.go @@ -126,6 +126,11 @@ func TestErrors(t *testing.T) { expectedErrorCode: "QUOTA_EXCEEDED", expectedErrorClass: cloudprovider.OutOfResourcesErrorClass, }, + { + errorCodes: []string{"PERMISSIONS_ERROR"}, + expectedErrorCode: "PERMISSIONS_ERROR", + expectedErrorClass: cloudprovider.OtherErrorClass, + }, { errorCodes: []string{"xyz", "abc"}, expectedErrorCode: "OTHER", From 7faca8b10bfae68617f6e6ea45616dce4002aa30 Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Tue, 15 Jun 2021 23:30:36 +0200 Subject: [PATCH 47/86] digitalocean: do not Refresh() on startup If the API is temporarily unavailable, cluster-autoscaler will be crash-looping on startup during the initial call to Refresh(). This makes for a bad user/operator experience since it aggravates differentiating between API and cluster/workload problems. Let autoscaler start up and retry fetching node pool information from the API as part of the pre-existing, periodic sync. This should be no different to experiencing transient API problems during runtime. --- .../digitalocean/digitalocean_cloud_provider.go | 17 ++++------------- .../digitalocean_cloud_provider_test.go | 11 +++++++---- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_cloud_provider.go b/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_cloud_provider.go index 4ad0b94458a7..36fb1e5e2e8a 100644 --- a/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_cloud_provider.go @@ -27,7 +27,7 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" "k8s.io/autoscaler/cluster-autoscaler/config" "k8s.io/autoscaler/cluster-autoscaler/utils/errors" - klog "k8s.io/klog/v2" + "k8s.io/klog/v2" ) var _ cloudprovider.CloudProvider = (*digitaloceanCloudProvider)(nil) @@ -45,15 +45,11 @@ type digitaloceanCloudProvider struct { resourceLimiter *cloudprovider.ResourceLimiter } -func newDigitalOceanCloudProvider(manager *Manager, rl *cloudprovider.ResourceLimiter) (*digitaloceanCloudProvider, error) { - if err := manager.Refresh(); err != nil { - return nil, err - } - +func newDigitalOceanCloudProvider(manager *Manager, rl *cloudprovider.ResourceLimiter) *digitaloceanCloudProvider { return &digitaloceanCloudProvider{ manager: manager, resourceLimiter: rl, - }, nil + } } // Name returns name of the cloud provider. @@ -185,12 +181,7 @@ func BuildDigitalOcean( // the cloud provider automatically uses all node pools in DigitalOcean. // This means we don't use the cloudprovider.NodeGroupDiscoveryOptions // flags (which can be set via '--node-group-auto-discovery' or '-nodes') - provider, err := newDigitalOceanCloudProvider(manager, rl) - if err != nil { - klog.Fatalf("Failed to create DigitalOcean cloud provider: %v", err) - } - - return provider + return newDigitalOceanCloudProvider(manager, rl) } // toProviderID returns a provider ID from the given node ID. diff --git a/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_cloud_provider_test.go b/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_cloud_provider_test.go index 9a17543a1ee8..e5772eac2fd7 100644 --- a/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_cloud_provider_test.go +++ b/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_cloud_provider_test.go @@ -83,10 +83,7 @@ func testCloudProvider(t *testing.T, client *doClientMock) *digitaloceanCloudPro manager.client = client - provider, err := newDigitalOceanCloudProvider(manager, rl) - assert.NoError(t, err) - return provider - + return newDigitalOceanCloudProvider(manager, rl) } func TestNewDigitalOceanCloudProvider(t *testing.T) { @@ -106,6 +103,8 @@ func TestDigitalOceanCloudProvider_Name(t *testing.T) { func TestDigitalOceanCloudProvider_NodeGroups(t *testing.T) { provider := testCloudProvider(t, nil) + err := provider.manager.Refresh() + assert.NoError(t, err) t.Run("success", func(t *testing.T) { nodes := provider.NodeGroups() @@ -150,6 +149,8 @@ func TestDigitalOceanCloudProvider_NodeGroupForNode(t *testing.T) { ).Once() provider := testCloudProvider(t, client) + err := provider.manager.Refresh() + assert.NoError(t, err) // let's get the nodeGroup for the node with ID 4 node := &apiv1.Node{ @@ -190,6 +191,8 @@ func TestDigitalOceanCloudProvider_NodeGroupForNode(t *testing.T) { ).Once() provider := testCloudProvider(t, client) + err := provider.manager.Refresh() + assert.NoError(t, err) node := &apiv1.Node{ Spec: apiv1.NodeSpec{ From 92751c4a5a461211d7666288fac3ed9473adbd68 Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Tue, 15 Jun 2021 16:34:45 -0500 Subject: [PATCH 48/86] improve addon-resizer deployment example This fixes the comment at the beginning of the addon-resizer deployment example so that it describes the correct key names to use for configuring the cpu and memory parameters. --- addon-resizer/deploy/example.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addon-resizer/deploy/example.yaml b/addon-resizer/deploy/example.yaml index 60c3e6264c04..7b2de4d87904 100644 --- a/addon-resizer/deploy/example.yaml +++ b/addon-resizer/deploy/example.yaml @@ -1,6 +1,7 @@ # Config map for resource configuration. -# Specify 'cpu', 'extra-cpu', 'memory' and 'extra-memory' -# to overwrite resource requirements. +# Specify 'baseCPU', 'cpuPerNode', 'baseMemory', and 'memoryPerNode' to +# overwrite the CLI resource options 'cpu', 'extra-cpu', 'memory' and 'extra-memory' +# respectively. apiVersion: v1 kind: ConfigMap metadata: From 0de2f81f7351d550c9a772628a9f40f29efd5e70 Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Tue, 15 Jun 2021 23:36:58 +0200 Subject: [PATCH 49/86] digitalocean: remove tag references from README An initial version of the DigitalOcean cloud provider implementation relied on tags to define the behavior but has since been transitioned to using the public DOKS API. Update the README accordingly. --- .../cloudprovider/digitalocean/README.md | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/digitalocean/README.md b/cluster-autoscaler/cloudprovider/digitalocean/README.md index 1bd3785b1acf..fbb0708eab36 100644 --- a/cluster-autoscaler/cloudprovider/digitalocean/README.md +++ b/cluster-autoscaler/cloudprovider/digitalocean/README.md @@ -6,31 +6,10 @@ offering which can be enabled/disable dynamically for an existing cluster. # Configuration -The `cluster-autoscaler` dynamically runs based on tags associated with node -pools. These are the current valid tags: - -``` -k8s-cluster-autoscaler-enabled:true -k8s-cluster-autoscaler-min:3 -k8s-cluster-autoscaler-max:10 -``` - -The syntax is in form of `key:value`. - -* If `k8s-cluster-autoscaler-enabled:true` is absent or - `k8s-cluster-autoscaler-enabled` is **not** set to `true`, the - `cluster-autoscaler` will not process the node pool by default. -* To set the minimum number of nodes to use `k8s-cluster-autoscaler-min` -* To set the maximum number of nodes to use `k8s-cluster-autoscaler-max` - - -If you don't set the minimum and maximum tags, node pools will have the -following default limits: - -``` -minimum number of nodes: 1 -maximum number of nodes: 200 -``` +Parameters of the autoscaler (such as whether it is on or off, and the +minimum/maximum values) are configured through the public DOKS API and +subsequently reflected by the node pool objects. The cloud provider periodically +picks up the configuration from the API and adjusts the behavior accordingly. # Development From 5076047bf8bbe4df72549cf01ba570a90ef6d1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Wr=C3=B3blewski?= Date: Tue, 15 Jun 2021 14:14:34 +0000 Subject: [PATCH 50/86] Skip iteration loop if node creation failed --- cluster-autoscaler/core/static_autoscaler.go | 12 ++++++++++-- cluster-autoscaler/core/static_autoscaler_test.go | 6 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cluster-autoscaler/core/static_autoscaler.go b/cluster-autoscaler/core/static_autoscaler.go index cfbf2c249f54..a0f54f960dd8 100644 --- a/cluster-autoscaler/core/static_autoscaler.go +++ b/cluster-autoscaler/core/static_autoscaler.go @@ -346,7 +346,10 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) errors.AutoscalerError return nil } - a.deleteCreatedNodesWithErrors() + if a.deleteCreatedNodesWithErrors() { + klog.V(0).Infof("Some nodes that failed to create were removed, skipping iteration") + return nil + } // Check if there has been a constant difference between the number of nodes in k8s and // the number of nodes on the cloud provider side. @@ -635,7 +638,7 @@ func removeOldUnregisteredNodes(unregisteredNodes []clusterstate.UnregisteredNod return removedAny, nil } -func (a *StaticAutoscaler) deleteCreatedNodesWithErrors() { +func (a *StaticAutoscaler) deleteCreatedNodesWithErrors() bool { // We always schedule deleting of incoming errornous nodes // TODO[lukaszos] Consider adding logic to not retry delete every loop iteration nodes := a.clusterStateRegistry.GetCreatedNodesWithErrors() @@ -656,6 +659,8 @@ func (a *StaticAutoscaler) deleteCreatedNodesWithErrors() { nodesToBeDeletedByNodeGroupId[nodeGroup.Id()] = append(nodesToBeDeletedByNodeGroupId[nodeGroup.Id()], node) } + deletedAny := false + for nodeGroupId, nodesToBeDeleted := range nodesToBeDeletedByNodeGroupId { var err error klog.V(1).Infof("Deleting %v from %v node group because of create errors", len(nodesToBeDeleted), nodeGroupId) @@ -671,8 +676,11 @@ func (a *StaticAutoscaler) deleteCreatedNodesWithErrors() { klog.Warningf("Error while trying to delete nodes from %v: %v", nodeGroupId, err) } + deletedAny = deletedAny || err == nil a.clusterStateRegistry.InvalidateNodeInstancesCacheEntry(nodeGroup) } + + return deletedAny } func (a *StaticAutoscaler) nodeGroupsById() map[string]cloudprovider.NodeGroup { diff --git a/cluster-autoscaler/core/static_autoscaler_test.go b/cluster-autoscaler/core/static_autoscaler_test.go index 8809fed019d1..e51c433fd5b3 100644 --- a/cluster-autoscaler/core/static_autoscaler_test.go +++ b/cluster-autoscaler/core/static_autoscaler_test.go @@ -1058,7 +1058,7 @@ func TestStaticAutoscalerInstaceCreationErrors(t *testing.T) { clusterState.UpdateNodes([]*apiv1.Node{}, nil, now) // delete nodes with create errors - autoscaler.deleteCreatedNodesWithErrors() + assert.True(t, autoscaler.deleteCreatedNodesWithErrors()) // check delete was called on correct nodes nodeGroupA.AssertCalled(t, "DeleteNodes", mock.MatchedBy( @@ -1082,7 +1082,7 @@ func TestStaticAutoscalerInstaceCreationErrors(t *testing.T) { clusterState.UpdateNodes([]*apiv1.Node{}, nil, now) // delete nodes with create errors - autoscaler.deleteCreatedNodesWithErrors() + assert.True(t, autoscaler.deleteCreatedNodesWithErrors()) // nodes should be deleted again nodeGroupA.AssertCalled(t, "DeleteNodes", mock.MatchedBy( @@ -1145,7 +1145,7 @@ func TestStaticAutoscalerInstaceCreationErrors(t *testing.T) { clusterState.UpdateNodes([]*apiv1.Node{}, nil, now) // delete nodes with create errors - autoscaler.deleteCreatedNodesWithErrors() + assert.False(t, autoscaler.deleteCreatedNodesWithErrors()) // we expect no more Delete Nodes nodeGroupA.AssertNumberOfCalls(t, "DeleteNodes", 2) From 05e2011096409e64065b6793e26ddbf69285ee0d Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Tue, 15 Jun 2021 23:43:55 +0200 Subject: [PATCH 51/86] digitalocean: support reading access token from file This makes it possible to securely store the access token in a file and load it into the cloud provider from there. Document DigitalOcean's cloud config format while we are here. --- .../cloudprovider/digitalocean/README.md | 14 ++++++++ .../digitalocean/digitalocean_manager.go | 24 +++++++++++-- .../digitalocean/digitalocean_manager_test.go | 36 +++++++++++++++++-- .../digitalocean/testdata/correct_token | 1 + .../digitalocean/testdata/empty_token | 0 .../digitalocean/testdata/whitespace_token | 2 ++ 6 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 cluster-autoscaler/cloudprovider/digitalocean/testdata/correct_token create mode 100644 cluster-autoscaler/cloudprovider/digitalocean/testdata/empty_token create mode 100644 cluster-autoscaler/cloudprovider/digitalocean/testdata/whitespace_token diff --git a/cluster-autoscaler/cloudprovider/digitalocean/README.md b/cluster-autoscaler/cloudprovider/digitalocean/README.md index fbb0708eab36..e5b33cb55529 100644 --- a/cluster-autoscaler/cloudprovider/digitalocean/README.md +++ b/cluster-autoscaler/cloudprovider/digitalocean/README.md @@ -6,6 +6,20 @@ offering which can be enabled/disable dynamically for an existing cluster. # Configuration +## Cloud config file + +The (JSON) configuration file of the DigitalOcean cloud provider supports the +following values: + +- `cluster_id`: the ID of the cluster (a UUID) +- `token`: the DigitalOcean access token literally defined +- `token_file`: a file path containing the DigitalOcean access token +- `url`: the DigitalOcean URL (optional; defaults to `https://api.digitalocean.com/`) + +Exactly one of `token` or `token_file` must be provided. + +## Behavior + Parameters of the autoscaler (such as whether it is on or off, and the minimum/maximum values) are configured through the public DOKS API and subsequently reflected by the node pool objects. The cloud provider periodically diff --git a/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_manager.go b/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_manager.go index f1450ed06c57..76ba538ef338 100644 --- a/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_manager.go +++ b/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_manager.go @@ -17,6 +17,7 @@ limitations under the License. package digitalocean import ( + "bytes" "context" "encoding/json" "errors" @@ -26,7 +27,7 @@ import ( "github.com/digitalocean/godo" "golang.org/x/oauth2" - klog "k8s.io/klog/v2" + "k8s.io/klog/v2" ) var ( @@ -62,6 +63,10 @@ type Config struct { // DigitalOcean Cluster Autoscaler is running. Token string `json:"token"` + // TokenFile references the token from the given file. It cannot be specified + // together with Token. + TokenFile string `json:"token_file"` + // URL points to DigitalOcean API. If empty, defaults to // https://api.digitalocean.com/ URL string `json:"url"` @@ -80,13 +85,28 @@ func newManager(configReader io.Reader) (*Manager, error) { } } - if cfg.Token == "" { + if cfg.Token == "" && cfg.TokenFile == "" { return nil, errors.New("access token is not provided") } + if cfg.Token != "" && cfg.TokenFile != "" { + return nil, errors.New("access token literal and access token file must not be provided together") + } if cfg.ClusterID == "" { return nil, errors.New("cluster ID is not provided") } + if cfg.TokenFile != "" { + tokenData, err := ioutil.ReadFile(cfg.TokenFile) + if err != nil { + return nil, fmt.Errorf("failed to read token file: %s", err) + } + tokenData = bytes.TrimSpace(tokenData) + if len(tokenData) == 0 { + return nil, fmt.Errorf("token file %q is empty", cfg.TokenFile) + } + cfg.Token = string(tokenData) + } + tokenSource := oauth2.StaticTokenSource(&oauth2.Token{ AccessToken: cfg.Token, }) diff --git a/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_manager_test.go b/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_manager_test.go index d34bd1ff1fbf..daff90c5c7d1 100644 --- a/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_manager_test.go +++ b/cluster-autoscaler/cloudprovider/digitalocean/digitalocean_manager_test.go @@ -24,14 +24,22 @@ import ( "github.com/digitalocean/godo" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestNewManager(t *testing.T) { - t.Run("success", func(t *testing.T) { + t.Run("success with literal token", func(t *testing.T) { cfg := `{"cluster_id": "123456", "token": "123-123-123", "url": "https://api.digitalocean.com/v2", "version": "dev"}` manager, err := newManager(bytes.NewBufferString(cfg)) - assert.NoError(t, err) + require.NoError(t, err) + assert.Equal(t, manager.clusterID, "123456", "cluster ID does not match") + }) + t.Run("success with token file", func(t *testing.T) { + cfg := `{"cluster_id": "123456", "token_file": "testdata/correct_token", "url": "https://api.digitalocean.com/v2", "version": "dev"}` + + manager, err := newManager(bytes.NewBufferString(cfg)) + require.NoError(t, err) assert.Equal(t, manager.clusterID, "123456", "cluster ID does not match") }) @@ -41,7 +49,31 @@ func TestNewManager(t *testing.T) { _, err := newManager(bytes.NewBufferString(cfg)) assert.EqualError(t, err, errors.New("access token is not provided").Error()) }) + t.Run("literal and token file", func(t *testing.T) { + cfg := `{"cluster_id": "123456", "token": "123-123-123", "token_file": "tokendata/correct_token", "url": "https://api.digitalocean.com/v2", "version": "dev"}` + + _, err := newManager(bytes.NewBufferString(cfg)) + assert.EqualError(t, err, errors.New("access token literal and access token file must not be provided together").Error()) + }) + t.Run("missing token file", func(t *testing.T) { + cfg := `{"cluster_id": "123456", "token_file": "testdata/missing_token", "url": "https://api.digitalocean.com/v2", "version": "dev"}` + _, err := newManager(bytes.NewBufferString(cfg)) + require.NotNil(t, err) + assert.Contains(t, err.Error(), "failed to read token file") + }) + t.Run("empty token file", func(t *testing.T) { + cfg := `{"cluster_id": "123456", "token_file": "testdata/empty_token", "url": "https://api.digitalocean.com/v2", "version": "dev"}` + + _, err := newManager(bytes.NewBufferString(cfg)) + assert.EqualError(t, err, errors.New(`token file "testdata/empty_token" is empty`).Error()) + }) + t.Run("all whitespace token file", func(t *testing.T) { + cfg := `{"cluster_id": "123456", "token_file": "testdata/whitespace_token", "url": "https://api.digitalocean.com/v2", "version": "dev"}` + + _, err := newManager(bytes.NewBufferString(cfg)) + assert.EqualError(t, err, errors.New(`token file "testdata/whitespace_token" is empty`).Error()) + }) t.Run("empty cluster ID", func(t *testing.T) { cfg := `{"cluster_id": "", "token": "123-123-123", "url": "https://api.digitalocean.com/v2", "version": "dev"}` diff --git a/cluster-autoscaler/cloudprovider/digitalocean/testdata/correct_token b/cluster-autoscaler/cloudprovider/digitalocean/testdata/correct_token new file mode 100644 index 000000000000..6674f2d87478 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/digitalocean/testdata/correct_token @@ -0,0 +1 @@ +123-123-123 diff --git a/cluster-autoscaler/cloudprovider/digitalocean/testdata/empty_token b/cluster-autoscaler/cloudprovider/digitalocean/testdata/empty_token new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/cluster-autoscaler/cloudprovider/digitalocean/testdata/whitespace_token b/cluster-autoscaler/cloudprovider/digitalocean/testdata/whitespace_token new file mode 100644 index 000000000000..139597f9cb07 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/digitalocean/testdata/whitespace_token @@ -0,0 +1,2 @@ + + From 6fd23f9c49dca84a32b7ffcd041fa16da7e9d112 Mon Sep 17 00:00:00 2001 From: Aleksandra Gacek Date: Thu, 17 Jun 2021 13:21:30 +0200 Subject: [PATCH 52/86] Allow overriding userAgent in Custom GCE client in gce cloud provider. --- cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go index 1424a349b823..0b6cd09360e2 100644 --- a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go +++ b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go @@ -107,13 +107,14 @@ func NewAutoscalingGceClientV1(client *http.Client, projectId string, userAgent // NewCustomAutoscalingGceClientV1 creates a new client using custom server url and timeouts // for communicating with GCE v1 API. -func NewCustomAutoscalingGceClientV1(client *http.Client, projectId, serverUrl string, +func NewCustomAutoscalingGceClientV1(client *http.Client, projectId, serverUrl, userAgent string, waitTimeout, pollInterval time.Duration, deletionPollInterval time.Duration) (*autoscalingGceClientV1, error) { gceService, err := gce.New(client) if err != nil { return nil, err } gceService.BasePath = serverUrl + gceService.UserAgent = userAgent return &autoscalingGceClientV1{ projectId: projectId, From 7f19fb1c8e88f69b18b6c02c1e85e8bb7025a3f7 Mon Sep 17 00:00:00 2001 From: Ferdinand Hofherr Date: Fri, 18 Jun 2021 12:34:22 +0200 Subject: [PATCH 53/86] Watch Action instead of polling Server Status We have recevied an issue from one of our customers that their autoscaler pod regularly crashes due to a nil pointer dereference panic. Analyzing the code we found out that the autoscaler polls the server status to find out if a server is running. The Hetzner Cloud Go client is implemented in such a way that it does not return an error if a resource could not be found. Instead it returns nil for the error and the resource. Ususally this is not an issue. However, in case the server creation fails the server gets deleted from Hetzner Cloud. This in turn leads to nil being returned and the abovementioned panic. The Hetzner Cloud API implements a concept called Actions. Whenever a long running process is triggered we return an object which can be used to get information about the progress of the task. The Action object reliably allows to detect if a server has been created and provides access to any error that may have occured. This commit replaces polling the server status with using the action object. --- .../hetzner/hetzner_node_group.go | 66 +++++++++++-------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go b/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go index 6a39b168f1f2..c232554a1227 100644 --- a/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go +++ b/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go @@ -18,6 +18,10 @@ package hetzner import ( "fmt" + "math/rand" + "sync" + "time" + apiv1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -26,10 +30,6 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/config" "k8s.io/klog/v2" schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" - "math/rand" - "strconv" - "sync" - "time" ) // hetznerNodeGroup implements cloudprovider.NodeGroup interface. hetznerNodeGroup contains @@ -365,14 +365,15 @@ func createServer(n *hetznerNodeGroup) error { if n.manager.network != nil { opts.Networks = []*hcloud.Network{n.manager.network} } - serverCreateResult, _, err := n.manager.client.Server.Create(n.manager.apiCallContext, opts) + serverCreateResult, _, err := n.manager.client.Server.Create(n.manager.apiCallContext, opts) if err != nil { return fmt.Errorf("could not create server type %s in region %s: %v", n.instanceType, n.region, err) } + action := serverCreateResult.Action server := serverCreateResult.Server - err = waitForServerStatus(n.manager, server, hcloud.ServerStatusRunning) + err = waitForServerAction(n.manager, server.Name, action) if err != nil { _ = n.manager.deleteServer(server) return fmt.Errorf("failed to start server %s error: %v", server.Name, err) @@ -381,32 +382,39 @@ func createServer(n *hetznerNodeGroup) error { return nil } -func waitForServerStatus(m *hetznerManager, server *hcloud.Server, status hcloud.ServerStatus) error { - errorResult := make(chan error) - - go func() { - for { - serverResponse, _, err := m.client.Server.Get(m.apiCallContext, strconv.Itoa(server.ID)) - if err != nil { - errorResult <- fmt.Errorf("failed to get server %s status error: %v", server.Name, err) - return - } - - if serverResponse.Status == status { - errorResult <- nil - return - } - - time.Sleep(1 * time.Second) - } - }() - +func waitForServerAction(m *hetznerManager, serverName string, action *hcloud.Action) error { + // The implementation of the Hetzner Cloud action client's WatchProgress + // method may be a little puzzling. The following comment thus explains how + // waitForServerAction works. + // + // WatchProgress returns two channels. The first channel is used to send a + // ballpark estimate for the action progress, the second to send any error + // that may occur. + // + // WatchProgress is implemented in such a way, that the first channel can + // be ignored. It is not necessary to consume it to avoid a deadlock in + // WatchProgress. Any write to this channel is wrapped in a select. + // Progress updates are simply not sent if nothing reads from the other + // side. + // + // Once the action completes successfully nil is send through the second + // channel. Then both channels are closed. + // + // The following code therefore only watches the second channel. If it + // reads an error from the channel the action is failed. Otherwise the + // action is successful. + _, errChan := m.client.Action.WatchProgress(m.apiCallContext, action) select { - case res := <-errorResult: - return res + case err := <-errChan: + if err != nil { + return fmt.Errorf("error while waiting for server action: %s: %v", serverName, err) + } + return nil case <-time.After(serverCreateTimeout): - return fmt.Errorf("waiting for server %s status %s timeout", server.Name, status) + return fmt.Errorf("timeout waiting for server %s", serverName) } + + return nil } func (n *hetznerNodeGroup) resetTargetSize(expectedDelta int) { From f5cf35ba39077f57ec4888f445d4fbaac01f4ed6 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Mon, 21 Jun 2021 07:27:23 +0100 Subject: [PATCH 54/86] fix: add missing RBAC permissions to autoscaler chart --- charts/cluster-autoscaler/Chart.yaml | 2 +- charts/cluster-autoscaler/templates/clusterrole.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index 596b9290cce0..d6a90d2b9818 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -17,4 +17,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.9.2 +version: 9.9.3 diff --git a/charts/cluster-autoscaler/templates/clusterrole.yaml b/charts/cluster-autoscaler/templates/clusterrole.yaml index 2ebadc3bb6c9..88d83781c681 100644 --- a/charts/cluster-autoscaler/templates/clusterrole.yaml +++ b/charts/cluster-autoscaler/templates/clusterrole.yaml @@ -106,6 +106,8 @@ rules: resources: - storageclasses - csinodes + - csidrivers + - csistoragecapacities verbs: - watch - list From b2ead3b2e30ee0968238c6b78cfb4e7e84efa444 Mon Sep 17 00:00:00 2001 From: Marvin Pinto Date: Mon, 21 Jun 2021 16:01:41 -0400 Subject: [PATCH 55/86] Add the ability to spin up Hetzner servers from custom snapshots This comes in handy when using tools such as Packer to generate customized images. --- .../cloudprovider/hetzner/README.md | 8 +++- .../cloudprovider/hetzner/hetzner_manager.go | 39 ++++++++++++++++--- .../hetzner/hetzner_node_group.go | 2 +- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/hetzner/README.md b/cluster-autoscaler/cloudprovider/hetzner/README.md index b3ba63c5ea8c..29af7e634c61 100644 --- a/cluster-autoscaler/cloudprovider/hetzner/README.md +++ b/cluster-autoscaler/cloudprovider/hetzner/README.md @@ -5,11 +5,17 @@ The cluster autoscaler for Hetzner Cloud scales worker nodes. # Configuration `HCLOUD_TOKEN` Required Hetzner Cloud token. + `HCLOUD_CLOUD_INIT` Base64 encoded Cloud Init yaml with commands to join the cluster, Sample [examples/cloud-init.txt for (Kubernetes 1.20.1)](examples/cloud-init.txt) -`HCLOUD_IMAGE` Defaults to `ubuntu-20.04`, @see https://docs.hetzner.cloud/#images + +`HCLOUD_IMAGE` Defaults to `ubuntu-20.04`, @see https://docs.hetzner.cloud/#images. You can also use an image ID here (e.g. `15512617`), or a label selector associated with a custom snapshot (e.g. `customized_ubuntu=true`). + `HCLOUD_NETWORK` Default empty , The name of the network that is used in the cluster , @see https://docs.hetzner.cloud/#networks + `HCLOUD_SSH_KEY` Default empty , This SSH Key will have access to the fresh created server, @see https://docs.hetzner.cloud/#ssh-keys + Node groups must be defined with the `--nodes=::::` flag. + Multiple flags will create multiple node pools. For example: ``` --nodes=1:10:CPX51:FSN1:pool1 diff --git a/cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go b/cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go index e76de37b6356..b4e8fc511394 100644 --- a/cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go +++ b/cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go @@ -39,7 +39,7 @@ type hetznerManager struct { nodeGroups map[string]*hetznerNodeGroup apiCallContext context.Context cloudInit string - image string + image *hcloud.Image sshKey *hcloud.SSHKey network *hcloud.Network } @@ -55,11 +55,6 @@ func newManager() (*hetznerManager, error) { return nil, errors.New("`HCLOUD_CLOUD_INIT` is not specified") } - image := os.Getenv("HCLOUD_IMAGE") - if image == "" { - image = "ubuntu-20.04" - } - client := hcloud.NewClient(hcloud.WithToken(token)) ctx := context.Background() cloudInit, err := base64.StdEncoding.DecodeString(cloudInitBase64) @@ -67,6 +62,38 @@ func newManager() (*hetznerManager, error) { return nil, fmt.Errorf("failed to parse cloud init error: %s", err) } + imageName := os.Getenv("HCLOUD_IMAGE") + if imageName == "" { + imageName = "ubuntu-20.04" + } + + // Search for an image ID corresponding to the supplied HCLOUD_IMAGE env + // variable. This value can either be an image ID itself (an int), a name + // (e.g. "ubuntu-20.04"), or a label selector associated with an image + // snapshot. In the latter case it will use the most recent snapshot. + image, _, err := client.Image.Get(ctx, imageName) + if err != nil || image == nil { + labelSelector := strings.Split(imageName, "=") + if len(labelSelector) != 2 { + return nil, fmt.Errorf("unable to find image %s: invalid label selector", imageName) + } + + images, err := client.Image.AllWithOpts(ctx, hcloud.ImageListOpts{ + Type: []hcloud.ImageType{hcloud.ImageTypeSnapshot}, + Status: []hcloud.ImageStatus{hcloud.ImageStatusAvailable}, + Sort: []string{"created:desc"}, + ListOpts: hcloud.ListOpts{ + LabelSelector: fmt.Sprintf("%s=%s", labelSelector[0], labelSelector[1]), + }, + }) + + if err != nil || len(images) == 0 { + return nil, fmt.Errorf("unable to find image %s: %v", imageName, err) + } + + image = images[0] + } + var network *hcloud.Network networkName := os.Getenv("HCLOUD_NETWORK") diff --git a/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go b/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go index c232554a1227..7d06be8c24e2 100644 --- a/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go +++ b/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go @@ -353,7 +353,7 @@ func createServer(n *hetznerNodeGroup) error { UserData: n.manager.cloudInit, Location: &hcloud.Location{Name: n.region}, ServerType: &hcloud.ServerType{Name: n.instanceType}, - Image: &hcloud.Image{Name: n.manager.image}, + Image: n.manager.image, StartAfterCreate: &StartAfterCreate, Labels: map[string]string{ nodeGroupLabel: n.id, From 838ea229c078e68ef19bb720a81f092a07e1e804 Mon Sep 17 00:00:00 2001 From: Marvin Pinto Date: Tue, 22 Jun 2021 06:58:15 -0400 Subject: [PATCH 56/86] Fixes to address code review comments --- cluster-autoscaler/cloudprovider/hetzner/README.md | 2 +- .../cloudprovider/hetzner/hetzner_manager.go | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/hetzner/README.md b/cluster-autoscaler/cloudprovider/hetzner/README.md index 29af7e634c61..76197defe1a2 100644 --- a/cluster-autoscaler/cloudprovider/hetzner/README.md +++ b/cluster-autoscaler/cloudprovider/hetzner/README.md @@ -8,7 +8,7 @@ The cluster autoscaler for Hetzner Cloud scales worker nodes. `HCLOUD_CLOUD_INIT` Base64 encoded Cloud Init yaml with commands to join the cluster, Sample [examples/cloud-init.txt for (Kubernetes 1.20.1)](examples/cloud-init.txt) -`HCLOUD_IMAGE` Defaults to `ubuntu-20.04`, @see https://docs.hetzner.cloud/#images. You can also use an image ID here (e.g. `15512617`), or a label selector associated with a custom snapshot (e.g. `customized_ubuntu=true`). +`HCLOUD_IMAGE` Defaults to `ubuntu-20.04`, @see https://docs.hetzner.cloud/#images. You can also use an image ID here (e.g. `15512617`), or a label selector associated with a custom snapshot (e.g. `customized_ubuntu=true`). The most recent snapshot will be used in the latter case. `HCLOUD_NETWORK` Default empty , The name of the network that is used in the cluster , @see https://docs.hetzner.cloud/#networks diff --git a/cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go b/cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go index b4e8fc511394..60dd429fb057 100644 --- a/cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go +++ b/cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go @@ -72,18 +72,16 @@ func newManager() (*hetznerManager, error) { // (e.g. "ubuntu-20.04"), or a label selector associated with an image // snapshot. In the latter case it will use the most recent snapshot. image, _, err := client.Image.Get(ctx, imageName) - if err != nil || image == nil { - labelSelector := strings.Split(imageName, "=") - if len(labelSelector) != 2 { - return nil, fmt.Errorf("unable to find image %s: invalid label selector", imageName) - } - + if err != nil { + return nil, fmt.Errorf("unable to find image %s: %v", imageName, err) + } + if image == nil { images, err := client.Image.AllWithOpts(ctx, hcloud.ImageListOpts{ Type: []hcloud.ImageType{hcloud.ImageTypeSnapshot}, Status: []hcloud.ImageStatus{hcloud.ImageStatusAvailable}, Sort: []string{"created:desc"}, ListOpts: hcloud.ListOpts{ - LabelSelector: fmt.Sprintf("%s=%s", labelSelector[0], labelSelector[1]), + LabelSelector: imageName, }, }) From 674de4f2af0eb8d656ba97553257fbdf37887294 Mon Sep 17 00:00:00 2001 From: Aleksandra Gacek Date: Tue, 22 Jun 2021 17:04:22 +0200 Subject: [PATCH 57/86] Use CreateInstances() API when scaling up in GCE cloud provider --- .../gce/autoscaling_gce_client.go | 35 ++++++++++++++ .../cloudprovider/gce/gce_cloud_provider.go | 2 +- .../gce/gce_cloud_provider_test.go | 7 ++- .../cloudprovider/gce/gce_manager.go | 18 ++++++++ .../cloudprovider/gce/gce_manager_test.go | 46 +++++++++++++++++++ 5 files changed, 106 insertions(+), 2 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go index 0b6cd09360e2..0b55a2ead220 100644 --- a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go +++ b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go @@ -27,6 +27,7 @@ import ( "time" "google.golang.org/api/googleapi" + "k8s.io/apimachinery/pkg/util/rand" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" "k8s.io/autoscaler/cluster-autoscaler/utils/errors" "k8s.io/autoscaler/cluster-autoscaler/utils/klogx" @@ -39,6 +40,7 @@ const ( defaultOperationWaitTimeout = 20 * time.Second defaultOperationPollInterval = 100 * time.Millisecond defaultOperationDeletionPollInterval = 1 * time.Second + instanceGroupNameSuffix = "-grp" // ErrorCodeQuotaExceeded is an error code used in InstanceErrorInfo if quota exceeded error occurs. ErrorCodeQuotaExceeded = "QUOTA_EXCEEDED" @@ -75,6 +77,7 @@ type AutoscalingGceClient interface { // modifying resources ResizeMig(GceRef, int64) error DeleteInstances(migRef GceRef, instances []GceRef) error + CreateInstances(GceRef, int64, []string) error } type autoscalingGceClientV1 struct { @@ -195,6 +198,26 @@ func (client *autoscalingGceClientV1) ResizeMig(migRef GceRef, size int64) error return client.waitForOp(op, migRef.Project, migRef.Zone, false) } +func (client *autoscalingGceClientV1) CreateInstances(migRef GceRef, delta int64, existingInstances []string) error { + registerRequest("instance_group_managers", "create_instances") + req := gce.InstanceGroupManagersCreateInstancesRequest{} + instanceNames := map[string]bool{} + for _, inst := range existingInstances { + instanceNames[inst] = true + } + req.Instances = make([]*gce.PerInstanceConfig, 0, delta) + for i := int64(0); i < delta; i++ { + newInstanceName := generateInstanceName(migRef, instanceNames) + instanceNames[newInstanceName] = true + req.Instances = append(req.Instances, &gce.PerInstanceConfig{Name: newInstanceName}) + } + op, err := client.gceService.InstanceGroupManagers.CreateInstances(migRef.Project, migRef.Zone, migRef.Name, &req).Do() + if err != nil { + return err + } + return client.waitForOp(op, migRef.Project, migRef.Zone, false) +} + func (client *autoscalingGceClientV1) waitForOp(operation *gce.Operation, project, zone string, isDeletion bool) error { pollInterval := client.operationPollInterval if isDeletion { @@ -346,6 +369,18 @@ func isInstanceNotRunningYet(gceInstance *gce.ManagedInstance) bool { return gceInstance.InstanceStatus == "" || gceInstance.InstanceStatus == "PROVISIONING" || gceInstance.InstanceStatus == "STAGING" } +func generateInstanceName(migRef GceRef, existingNames map[string]bool) string { + for i := 0; i < 100; i++ { + name := fmt.Sprintf("%v-%v", strings.TrimSuffix(migRef.Name, instanceGroupNameSuffix), rand.String(4)) + if ok, _ := existingNames[name]; !ok { + return name + } + } + klog.Warning("Unable to create unique name for a new instance, duplicate name might occur") + name := fmt.Sprintf("%v-%v", strings.TrimSuffix(migRef.Name, instanceGroupNameSuffix), rand.String(4)) + return name +} + func (client *autoscalingGceClientV1) FetchZones(region string) ([]string, error) { registerRequest("regions", "get") r, err := client.gceService.Regions.Get(client.projectId, region).Do() diff --git a/cluster-autoscaler/cloudprovider/gce/gce_cloud_provider.go b/cluster-autoscaler/cloudprovider/gce/gce_cloud_provider.go index 43ea53d55904..7018bcfe87dc 100644 --- a/cluster-autoscaler/cloudprovider/gce/gce_cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/gce/gce_cloud_provider.go @@ -220,7 +220,7 @@ func (mig *gceMig) IncreaseSize(delta int) error { if int(size)+delta > mig.MaxSize() { return fmt.Errorf("size increase too large - desired:%d max:%d", int(size)+delta, mig.MaxSize()) } - return mig.gceManager.SetMigSize(mig, size+int64(delta)) + return mig.gceManager.CreateInstances(mig, int64(delta)) } // DecreaseTargetSize decreases the target size of the node group. This function diff --git a/cluster-autoscaler/cloudprovider/gce/gce_cloud_provider_test.go b/cluster-autoscaler/cloudprovider/gce/gce_cloud_provider_test.go index bcc23901cef4..e6362a228c08 100644 --- a/cluster-autoscaler/cloudprovider/gce/gce_cloud_provider_test.go +++ b/cluster-autoscaler/cloudprovider/gce/gce_cloud_provider_test.go @@ -92,6 +92,11 @@ func (m *gceManagerMock) GetMigTemplateNode(mig Mig) (*apiv1.Node, error) { return args.Get(0).(*apiv1.Node), args.Error(1) } +func (m *gceManagerMock) CreateInstances(mig Mig, delta int64) error { + args := m.Called(mig, delta) + return args.Error(0) +} + func (m *gceManagerMock) getCpuAndMemoryForMachineType(machineType string, zone string) (cpu int64, mem int64, err error) { args := m.Called(machineType, zone) return args.Get(0).(int64), args.Get(1).(int64), args.Error(2) @@ -266,7 +271,7 @@ func TestMig(t *testing.T) { // Test IncreaseSize. gceManagerMock.On("GetMigSize", mock.AnythingOfType("*gce.gceMig")).Return(int64(2), nil).Once() - gceManagerMock.On("SetMigSize", mock.AnythingOfType("*gce.gceMig"), int64(3)).Return(nil).Once() + gceManagerMock.On("CreateInstances", mock.AnythingOfType("*gce.gceMig"), int64(1)).Return(nil).Once() err = mig1.IncreaseSize(1) assert.NoError(t, err) mock.AssertExpectationsForObjects(t, gceManagerMock) diff --git a/cluster-autoscaler/cloudprovider/gce/gce_manager.go b/cluster-autoscaler/cloudprovider/gce/gce_manager.go index a667abc25d8b..8e92ab6e1993 100644 --- a/cluster-autoscaler/cloudprovider/gce/gce_manager.go +++ b/cluster-autoscaler/cloudprovider/gce/gce_manager.go @@ -95,6 +95,8 @@ type GceManager interface { SetMigSize(mig Mig, size int64) error // DeleteInstances deletes the given instances. All instances must be controlled by the same MIG. DeleteInstances(instances []GceRef) error + // CreateInstances creates delta new instances in a given mig. + CreateInstances(mig Mig, delta int64) error } type gceManagerImpl struct { @@ -289,6 +291,22 @@ func (m *gceManagerImpl) Refresh() error { return m.forceRefresh() } +func (m *gceManagerImpl) CreateInstances(mig Mig, delta int64) error { + if delta == 0 { + return nil + } + instances, err := m.GetMigNodes(mig) + if err != nil { + return err + } + instancesNames := make([]string, 0, len(instances)) + for _, ins := range instances { + instancesNames = append(instancesNames, ins.Id) + } + m.cache.InvalidateMigTargetSize(mig.GceRef()) + return m.GceService.CreateInstances(mig.GceRef(), delta, instancesNames) +} + func (m *gceManagerImpl) forceRefresh() error { m.clearMachinesCache() if err := m.fetchAutoMigs(); err != nil { diff --git a/cluster-autoscaler/cloudprovider/gce/gce_manager_test.go b/cluster-autoscaler/cloudprovider/gce/gce_manager_test.go index 3e603d50790a..1d0c88b1e0a1 100644 --- a/cluster-autoscaler/cloudprovider/gce/gce_manager_test.go +++ b/cluster-autoscaler/cloudprovider/gce/gce_manager_test.go @@ -1530,3 +1530,49 @@ func TestParseMIGAutoDiscoverySpecs(t *testing.T) { }) } } + +const createInstancesResponse = `{ + "kind": "compute#operation", + "id": "2890052495600280364", + "name": "operation-1624366531120-5c55a4e128c15-fc5daa90-e1ef6c32", + "zone": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-b", + "operationType": "compute.instanceGroupManagers.createInstances", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-b/instanceGroupManagers/gke-cluster-1-default-pool-e25725dc-grp", + "targetId": "7836594831806456968", + "status": "DONE", + "user": "user@example.com", + "progress": 100, + "insertTime": "2021-06-22T05:55:31.903-07:00", + "startTime": "2021-06-22T05:55:31.907-07:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-b/operations/operation-1624366531120-5c55a4e128c15-fc5daa90-e1ef6c32" +}` + +const createInstancesOperationResponse = `{ + "kind": "compute#operation", + "id": "2890052495600280364", + "name": "operation-1624366531120-5c55a4e128c15-fc5daa90-e1ef6c32", + "zone": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-b", + "operationType": "compute.instanceGroupManagers.createInstances", + "targetLink": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-b/instanceGroupManagers/gke-cluster-1-default-pool-e25725dc-grp", + "targetId": "7836594831806456968", + "status": "DONE", + "user": "user@example.com", + "progress": 100, + "insertTime": "2021-06-22T05:55:31.903-07:00", + "startTime": "2021-06-22T05:55:31.907-07:00", + "selfLink": "https://www.googleapis.com/compute/v1/projects/project1/zones/us-central1-b/operations/operation-1624366531120-5c55a4e128c15-fc5daa90-e1ef6c32" +}` + +func TestAppendInstances(t *testing.T) { + server := NewHttpServerMock() + defer server.Close() + g := newTestGceManager(t, server.URL, false) + + defaultPoolMig := setupTestDefaultPool(g, true) + server.On("handle", "/project1/zones/us-central1-b/instanceGroupManagers/gke-cluster-1-default-pool/listManagedInstances").Return(buildFourRunningInstancesOnDefaultMigManagedInstancesResponse(zoneB)).Once() + server.On("handle", fmt.Sprintf("/project1/zones/us-central1-b/instanceGroupManagers/%v/createInstances", defaultPoolMig.gceRef.Name)).Return(createInstancesResponse).Once() + server.On("handle", "/project1/zones/us-central1-b/operations/operation-1624366531120-5c55a4e128c15-fc5daa90-e1ef6c32").Return(createInstancesOperationResponse).Once() + err := g.CreateInstances(defaultPoolMig, 2) + assert.NoError(t, err) + mock.AssertExpectationsForObjects(t, server) +} From 081c4664d302286e90019762966b3289c2f28e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20K=C5=82obuszewski?= Date: Thu, 24 Jun 2021 16:49:14 +0200 Subject: [PATCH 58/86] Add a flag to control DaemonSet eviction on non-empty nodes --- cluster-autoscaler/config/autoscaling_options.go | 2 ++ cluster-autoscaler/core/scale_down.go | 9 +++++++++ cluster-autoscaler/main.go | 2 ++ 3 files changed, 13 insertions(+) diff --git a/cluster-autoscaler/config/autoscaling_options.go b/cluster-autoscaler/config/autoscaling_options.go index 0071bfada451..4dcd95245f59 100644 --- a/cluster-autoscaler/config/autoscaling_options.go +++ b/cluster-autoscaler/config/autoscaling_options.go @@ -161,6 +161,8 @@ type AutoscalingOptions struct { CordonNodeBeforeTerminate bool // DaemonSetEvictionForEmptyNodes is whether CA will gracefully terminate DaemonSet pods from empty nodes. DaemonSetEvictionForEmptyNodes bool + // DaemonSetEvictionForOccupiedNodes is whether CA will gracefully terminate DaemonSet pods from non-empty nodes. + DaemonSetEvictionForOccupiedNodes bool // User agent to use for HTTP calls. UserAgent string } diff --git a/cluster-autoscaler/core/scale_down.go b/cluster-autoscaler/core/scale_down.go index ea543f0a833b..2f804a7d6c83 100644 --- a/cluster-autoscaler/core/scale_down.go +++ b/cluster-autoscaler/core/scale_down.go @@ -1226,6 +1226,8 @@ func (sd *ScaleDown) deleteNode(node *apiv1.Node, pods []*apiv1.Pod, daemonSetPo sd.context.Recorder.Eventf(node, apiv1.EventTypeNormal, "ScaleDown", "marked the node as toBeDeleted/unschedulable") + daemonSetPods = podsToEvict(daemonSetPods, sd.context.DaemonSetEvictionForOccupiedNodes) + // attempt drain evictionResults, err := drainNode(node, pods, daemonSetPods, sd.context.ClientSet, sd.context.Recorder, sd.context.MaxGracefulTerminationSec, MaxPodEvictionTime, EvictionRetryTime, PodEvictionHeadroom) if err != nil { @@ -1247,6 +1249,13 @@ func (sd *ScaleDown) deleteNode(node *apiv1.Node, pods []*apiv1.Pod, daemonSetPo return status.NodeDeleteResult{ResultType: status.NodeDeleteOk} } +func podsToEvict(pods []*apiv1.Pod, shouldEvict bool) []*apiv1.Pod { + if shouldEvict { + return pods + } + return []*apiv1.Pod{} +} + func evictPod(podToEvict *apiv1.Pod, isDaemonSetPod bool, client kube_client.Interface, recorder kube_record.EventRecorder, maxGracefulTerminationSec int, retryUntil time.Time, waitBetweenRetries time.Duration) status.PodEvictionResult { recorder.Eventf(podToEvict, apiv1.EventTypeNormal, "ScaleDown", "deleting pod for node scale down") diff --git a/cluster-autoscaler/main.go b/cluster-autoscaler/main.go index c7c18d22b12b..37459a175bf1 100644 --- a/cluster-autoscaler/main.go +++ b/cluster-autoscaler/main.go @@ -178,6 +178,7 @@ var ( clusterAPICloudConfigAuthoritative = flag.Bool("clusterapi-cloud-config-authoritative", false, "Treat the cloud-config flag authoritatively (do not fallback to using kubeconfig flag). ClusterAPI only") cordonNodeBeforeTerminate = flag.Bool("cordon-node-before-terminating", false, "Should CA cordon nodes before terminating during downscale process") daemonSetEvictionForEmptyNodes = flag.Bool("daemonset-eviction-for-empty-nodes", false, "DaemonSet pods will be gracefully terminated from empty nodes") + daemonSetEvictionForOccupiedNodes = flag.Bool("daemonset-eviction-for-occupied-nodes", true, "DaemonSet pods will be gracefully terminated from non-empty nodes") userAgent = flag.String("user-agent", "cluster-autoscaler", "User agent used for HTTP calls.") ) @@ -254,6 +255,7 @@ func createAutoscalingOptions() config.AutoscalingOptions { ClusterAPICloudConfigAuthoritative: *clusterAPICloudConfigAuthoritative, CordonNodeBeforeTerminate: *cordonNodeBeforeTerminate, DaemonSetEvictionForEmptyNodes: *daemonSetEvictionForEmptyNodes, + DaemonSetEvictionForOccupiedNodes: *daemonSetEvictionForOccupiedNodes, UserAgent: *userAgent, } } From 09b07ca5491368fa7252cb50121c2381979fb541 Mon Sep 17 00:00:00 2001 From: Michael Weibel <307427+mweibel@users.noreply.github.com> Date: Fri, 25 Jun 2021 18:37:05 +0200 Subject: [PATCH 59/86] add Standard_HB120rs_v3 --- .../cloudprovider/azure/azure_instance_types.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_instance_types.go b/cluster-autoscaler/cloudprovider/azure/azure_instance_types.go index ad59da295ba4..22e4977d6589 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_instance_types.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_instance_types.go @@ -1972,6 +1972,12 @@ var InstanceTypes = map[string]*InstanceType{ MemoryMb: 479232, GPU: 0, }, + "Standard_HB120rs_v3": { + InstanceType: "Standard_HB120rs_v3", + VCPU: 120, + MemoryMb: 479232, + GPU: 0, + }, "Standard_HB60rs": { InstanceType: "Standard_HB60rs", VCPU: 60, From 3fa210fbc0c599aa242b6f5cee29d8e9b5a94af9 Mon Sep 17 00:00:00 2001 From: rimas Date: Mon, 28 Jun 2021 12:08:01 +0300 Subject: [PATCH 60/86] Add support for AWS Osaka region --- .../vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index c303910847cd..b5d46ad03940 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -21,6 +21,7 @@ const ( ApEast1RegionID = "ap-east-1" // Asia Pacific (Hong Kong). ApNortheast1RegionID = "ap-northeast-1" // Asia Pacific (Tokyo). ApNortheast2RegionID = "ap-northeast-2" // Asia Pacific (Seoul). + ApNortheast3RegionID = "ap-northeast-3" // Asia Pacific (Osaka). ApSouth1RegionID = "ap-south-1" // Asia Pacific (Mumbai). ApSoutheast1RegionID = "ap-southeast-1" // Asia Pacific (Singapore). ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney). From 44b8d67d505b5563443fca226402e9df5e970803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20K=C5=82obuszewski?= Date: Tue, 29 Jun 2021 10:08:59 +0200 Subject: [PATCH 61/86] Allow DaemonSet pods to opt in/out from eviction --- cluster-autoscaler/core/scale_down.go | 22 ++--- cluster-autoscaler/core/scale_down_test.go | 85 +++++++++++++------ .../utils/daemonset/daemonset.go | 20 +++++ .../utils/daemonset/daemonset_test.go | 70 +++++++++++++++ 4 files changed, 158 insertions(+), 39 deletions(-) diff --git a/cluster-autoscaler/core/scale_down.go b/cluster-autoscaler/core/scale_down.go index 2f804a7d6c83..5ac748934f2b 100644 --- a/cluster-autoscaler/core/scale_down.go +++ b/cluster-autoscaler/core/scale_down.go @@ -34,6 +34,7 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/processors/customresources" "k8s.io/autoscaler/cluster-autoscaler/simulator" "k8s.io/autoscaler/cluster-autoscaler/utils" + "k8s.io/autoscaler/cluster-autoscaler/utils/daemonset" "k8s.io/autoscaler/cluster-autoscaler/utils/deletetaint" "k8s.io/autoscaler/cluster-autoscaler/utils/errors" "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" @@ -1114,7 +1115,7 @@ func (sd *ScaleDown) scheduleDeleteEmptyNodes(emptyNodes []*apiv1.Node, client k return deletedNodes, errors.ToAutoscalerError(errors.ApiCallError, taintErr) } deletedNodes = append(deletedNodes, node) - go func(nodeToDelete *apiv1.Node, nodeGroupForDeletedNode cloudprovider.NodeGroup, needToEvictDaemonSetPods bool) { + go func(nodeToDelete *apiv1.Node, nodeGroupForDeletedNode cloudprovider.NodeGroup, evictByDefault bool) { sd.nodeDeletionTracker.StartDeletion(nodeGroupForDeletedNode.Id()) defer sd.nodeDeletionTracker.EndDeletion(nodeGroupForDeletedNode.Id()) var result status.NodeDeleteResult @@ -1130,10 +1131,8 @@ func (sd *ScaleDown) scheduleDeleteEmptyNodes(emptyNodes []*apiv1.Node, client k sd.context.LogRecorder.Eventf(apiv1.EventTypeNormal, "ScaleDownEmpty", "Scale-down: empty node %s removed", nodeToDelete.Name) } }() - if needToEvictDaemonSetPods { - if err := evictDaemonSetPods(sd.context.ClusterSnapshot, nodeToDelete, client, sd.context.MaxGracefulTerminationSec, time.Now(), DaemonSetEvictionEmptyNodeTimeout, DeamonSetTimeBetweenEvictionRetries, recorder); err != nil { - klog.Warningf("error while evicting DS pods from an empty node: %v", err) - } + if err := evictDaemonSetPods(sd.context.ClusterSnapshot, nodeToDelete, client, sd.context.MaxGracefulTerminationSec, time.Now(), DaemonSetEvictionEmptyNodeTimeout, DeamonSetTimeBetweenEvictionRetries, recorder, evictByDefault); err != nil { + klog.Warningf("error while evicting DS pods from an empty node: %v", err) } deleteErr = waitForDelayDeletion(nodeToDelete, sd.context.ListerRegistry.AllNodeLister(), sd.context.AutoscalingOptions.NodeDeletionDelayTimeout) if deleteErr != nil { @@ -1161,7 +1160,7 @@ func (sd *ScaleDown) scheduleDeleteEmptyNodes(emptyNodes []*apiv1.Node, client k // Create eviction object for all DaemonSet pods on the node func evictDaemonSetPods(clusterSnapshot simulator.ClusterSnapshot, nodeToDelete *apiv1.Node, client kube_client.Interface, maxGracefulTerminationSec int, timeNow time.Time, dsEvictionTimeout time.Duration, waitBetweenRetries time.Duration, - recorder kube_record.EventRecorder) error { + recorder kube_record.EventRecorder, evictByDefault bool) error { nodeInfo, err := clusterSnapshot.NodeInfos().Get(nodeToDelete.Name) if err != nil { return fmt.Errorf("failed to get node info for %s", nodeToDelete.Name) @@ -1171,6 +1170,8 @@ func evictDaemonSetPods(clusterSnapshot simulator.ClusterSnapshot, nodeToDelete return fmt.Errorf("failed to get DaemonSet pods for %s (error: %v)", nodeToDelete.Name, err) } + daemonSetPods = daemonset.PodsToEvict(daemonSetPods, evictByDefault) + dsEviction := make(chan status.PodEvictionResult, len(daemonSetPods)) // Perform eviction of DaemonSet pods @@ -1226,7 +1227,7 @@ func (sd *ScaleDown) deleteNode(node *apiv1.Node, pods []*apiv1.Pod, daemonSetPo sd.context.Recorder.Eventf(node, apiv1.EventTypeNormal, "ScaleDown", "marked the node as toBeDeleted/unschedulable") - daemonSetPods = podsToEvict(daemonSetPods, sd.context.DaemonSetEvictionForOccupiedNodes) + daemonSetPods = daemonset.PodsToEvict(daemonSetPods, sd.context.DaemonSetEvictionForOccupiedNodes) // attempt drain evictionResults, err := drainNode(node, pods, daemonSetPods, sd.context.ClientSet, sd.context.Recorder, sd.context.MaxGracefulTerminationSec, MaxPodEvictionTime, EvictionRetryTime, PodEvictionHeadroom) @@ -1249,13 +1250,6 @@ func (sd *ScaleDown) deleteNode(node *apiv1.Node, pods []*apiv1.Pod, daemonSetPo return status.NodeDeleteResult{ResultType: status.NodeDeleteOk} } -func podsToEvict(pods []*apiv1.Pod, shouldEvict bool) []*apiv1.Pod { - if shouldEvict { - return pods - } - return []*apiv1.Pod{} -} - func evictPod(podToEvict *apiv1.Pod, isDaemonSetPod bool, client kube_client.Interface, recorder kube_record.EventRecorder, maxGracefulTerminationSec int, retryUntil time.Time, waitBetweenRetries time.Duration) status.PodEvictionResult { recorder.Eventf(podToEvict, apiv1.EventTypeNormal, "ScaleDown", "deleting pod for node scale down") diff --git a/cluster-autoscaler/core/scale_down_test.go b/cluster-autoscaler/core/scale_down_test.go index 918e467a5b21..5e1aace44eb3 100644 --- a/cluster-autoscaler/core/scale_down_test.go +++ b/cluster-autoscaler/core/scale_down_test.go @@ -38,6 +38,7 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/config" "k8s.io/autoscaler/cluster-autoscaler/context" "k8s.io/autoscaler/cluster-autoscaler/core/utils" + "k8s.io/autoscaler/cluster-autoscaler/utils/daemonset" "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" . "k8s.io/autoscaler/cluster-autoscaler/utils/test" @@ -1217,33 +1218,35 @@ func TestDaemonSetEvictionForEmptyNodes(t *testing.T) { dsEvictionTimeout time.Duration evictionSuccess bool err error + evictByDefault bool + extraAnnotationValue map[string]string + expectNotEvicted map[string]struct{} }{ { - name: "Successful attempt to evict DaemonSet pods", - dsPods: []string{"d1", "d2"}, - nodeInfoSuccess: true, - evictionTimeoutExceed: false, - dsEvictionTimeout: 5000 * time.Millisecond, - evictionSuccess: true, - err: nil, + name: "Successful attempt to evict DaemonSet pods", + dsPods: []string{"d1", "d2"}, + nodeInfoSuccess: true, + dsEvictionTimeout: 5000 * time.Millisecond, + evictionSuccess: true, + evictByDefault: true, }, { - name: "Failed to get node info", - dsPods: []string{"d1", "d2"}, - nodeInfoSuccess: false, - evictionTimeoutExceed: false, - dsEvictionTimeout: 5000 * time.Millisecond, - evictionSuccess: true, - err: fmt.Errorf("failed to get node info"), + name: "Failed to get node info", + dsPods: []string{"d1", "d2"}, + nodeInfoSuccess: false, + dsEvictionTimeout: 5000 * time.Millisecond, + evictionSuccess: true, + err: fmt.Errorf("failed to get node info"), + evictByDefault: true, }, { - name: "Failed to create DaemonSet eviction", - dsPods: []string{"d1", "d2"}, - nodeInfoSuccess: true, - evictionTimeoutExceed: false, - dsEvictionTimeout: 5000 * time.Millisecond, - evictionSuccess: false, - err: fmt.Errorf("following DaemonSet pod failed to evict on the"), + name: "Failed to create DaemonSet eviction", + dsPods: []string{"d1", "d2"}, + nodeInfoSuccess: true, + dsEvictionTimeout: 5000 * time.Millisecond, + evictionSuccess: false, + err: fmt.Errorf("following DaemonSet pod failed to evict on the"), + evictByDefault: true, }, { name: "Eviction timeout exceed", @@ -1253,11 +1256,33 @@ func TestDaemonSetEvictionForEmptyNodes(t *testing.T) { dsEvictionTimeout: 100 * time.Millisecond, evictionSuccess: true, err: fmt.Errorf("failed to create DaemonSet eviction for"), + evictByDefault: true, + }, + { + name: "Evict single pod due to annotation", + dsPods: []string{"d1", "d2"}, + nodeInfoSuccess: true, + dsEvictionTimeout: 5000 * time.Millisecond, + evictionSuccess: true, + extraAnnotationValue: map[string]string{"d1": "true"}, + expectNotEvicted: map[string]struct{}{"d2": {}}, + }, + { + name: "Don't evict single pod due to annotation", + dsPods: []string{"d1", "d2"}, + nodeInfoSuccess: true, + dsEvictionTimeout: 5000 * time.Millisecond, + evictionSuccess: true, + evictByDefault: true, + extraAnnotationValue: map[string]string{"d1": "false"}, + expectNotEvicted: map[string]struct{}{"d1": {}}, }, } for _, scenario := range testScenarios { + scenario := scenario t.Run(scenario.name, func(t *testing.T) { + t.Parallel() options := config.AutoscalingOptions{ NodeGroupDefaults: config.NodeGroupAutoscalingOptions{ ScaleDownUtilizationThreshold: 0.5, @@ -1277,6 +1302,9 @@ func TestDaemonSetEvictionForEmptyNodes(t *testing.T) { ds := BuildTestPod(dsName, 100, 0) ds.Spec.NodeName = "n1" ds.OwnerReferences = GenerateOwnerReferences("", "DaemonSet", "", "") + if v, ok := scenario.extraAnnotationValue[dsName]; ok { + ds.Annotations[daemonset.EnableDsEvictionKey] = v + } dsPods[i] = ds } @@ -1312,18 +1340,25 @@ func TestDaemonSetEvictionForEmptyNodes(t *testing.T) { simulator.InitializeClusterSnapshotOrDie(t, context.ClusterSnapshot, []*apiv1.Node{}, []*apiv1.Pod{}) } - err = evictDaemonSetPods(context.ClusterSnapshot, n1, fakeClient, options.MaxGracefulTerminationSec, timeNow, scenario.dsEvictionTimeout, waitBetweenRetries, kube_util.CreateEventRecorder(fakeClient)) + err = evictDaemonSetPods(context.ClusterSnapshot, n1, fakeClient, options.MaxGracefulTerminationSec, timeNow, scenario.dsEvictionTimeout, waitBetweenRetries, kube_util.CreateEventRecorder(fakeClient), scenario.evictByDefault) if scenario.err != nil { assert.NotNil(t, err) assert.Contains(t, err.Error(), scenario.err.Error()) return } assert.Nil(t, err) - deleted := make([]string, len(scenario.dsPods)) - for i := 0; i < len(scenario.dsPods); i++ { + var expectEvicted []string + for _, p := range scenario.dsPods { + if _, found := scenario.expectNotEvicted[p]; found { + continue + } + expectEvicted = append(expectEvicted, p) + } + deleted := make([]string, len(expectEvicted)) + for i := 0; i < len(expectEvicted); i++ { deleted[i] = utils.GetStringFromChan(deletedPods) } - assert.ElementsMatch(t, deleted, scenario.dsPods) + assert.ElementsMatch(t, deleted, expectEvicted) }) } } diff --git a/cluster-autoscaler/utils/daemonset/daemonset.go b/cluster-autoscaler/utils/daemonset/daemonset.go index b7bfbc1a3f8b..6469c53fd140 100644 --- a/cluster-autoscaler/utils/daemonset/daemonset.go +++ b/cluster-autoscaler/utils/daemonset/daemonset.go @@ -27,6 +27,12 @@ import ( schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" ) +const ( + // EnableDsEvictionKey is the name of annotation controlling whether a + // certain DaemonSet pod should be evicted. + EnableDsEvictionKey = "cluster-autoscaler.kubernetes.io/enable-ds-eviction" +) + // GetDaemonSetPodsForNode returns daemonset nodes for the given pod. func GetDaemonSetPodsForNode(nodeInfo *schedulerframework.NodeInfo, daemonsets []*appsv1.DaemonSet, predicateChecker simulator.PredicateChecker) ([]*apiv1.Pod, error) { result := make([]*apiv1.Pod, 0) @@ -66,3 +72,17 @@ func newPod(ds *appsv1.DaemonSet, nodeName string) *apiv1.Pod { newPod.Spec.NodeName = nodeName return newPod } + +// PodsToEvict returns a list of DaemonSet pods that should be evicted during scale down. +func PodsToEvict(pods []*apiv1.Pod, evictByDefault bool) (evictable []*apiv1.Pod) { + for _, pod := range pods { + if a, ok := pod.Annotations[EnableDsEvictionKey]; ok { + if a == "true" { + evictable = append(evictable, pod) + } + } else if evictByDefault { + evictable = append(evictable, pod) + } + } + return +} diff --git a/cluster-autoscaler/utils/daemonset/daemonset_test.go b/cluster-autoscaler/utils/daemonset/daemonset_test.go index 91ce9153493c..c522fb084176 100644 --- a/cluster-autoscaler/utils/daemonset/daemonset_test.go +++ b/cluster-autoscaler/utils/daemonset/daemonset_test.go @@ -68,6 +68,76 @@ func TestGetDaemonSetPodsForNode(t *testing.T) { } } +func TestEvictedPodsFilter(t *testing.T) { + testCases := []struct { + name string + pods map[string]string + evictionDefault bool + expectedPods []string + }{ + { + name: "all pods evicted by default", + pods: map[string]string{ + "p1": "", + "p2": "", + "p3": "", + }, + evictionDefault: true, + expectedPods: []string{"p1", "p2", "p3"}, + }, + { + name: "no pods evicted by default", + pods: map[string]string{ + "p1": "", + "p2": "", + "p3": "", + }, + evictionDefault: false, + expectedPods: []string{}, + }, + { + name: "all pods evicted by default, one opt-out", + pods: map[string]string{ + "p1": "", + "p2": "false", + "p3": "", + }, + evictionDefault: true, + expectedPods: []string{"p1", "p3"}, + }, + { + name: "no pods evicted by default, one opt-in", + pods: map[string]string{ + "p1": "", + "p2": "true", + "p3": "", + }, + evictionDefault: false, + expectedPods: []string{"p2"}, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + var dsPods []*apiv1.Pod + for n, av := range tc.pods { + p := BuildTestPod(n, 100, 0) + if av != "" { + p.Annotations[EnableDsEvictionKey] = av + } + dsPods = append(dsPods, p) + } + pte := PodsToEvict(dsPods, tc.evictionDefault) + got := make([]string, len(pte)) + for i, p := range pte { + got[i] = p.Name + } + assert.ElementsMatch(t, got, tc.expectedPods) + }) + } +} + func newDaemonSet(name string) *appsv1.DaemonSet { return &appsv1.DaemonSet{ ObjectMeta: metav1.ObjectMeta{ From 45f5b121a5224859b423a9f86ea06b42e5b3831e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20K=C5=82obuszewski?= Date: Tue, 29 Jun 2021 11:31:01 +0200 Subject: [PATCH 62/86] Document DaemonSet eviction opt in/out behavior --- cluster-autoscaler/FAQ.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/cluster-autoscaler/FAQ.md b/cluster-autoscaler/FAQ.md index 3f5def46260b..0bb03d1bfd45 100644 --- a/cluster-autoscaler/FAQ.md +++ b/cluster-autoscaler/FAQ.md @@ -32,6 +32,7 @@ this document: * [How can I scale a node group to 0?](#how-can-i-scale-a-node-group-to-0) * [How can I prevent Cluster Autoscaler from scaling down a particular node?](#how-can-i-prevent-cluster-autoscaler-from-scaling-down-a-particular-node) * [How can I configure overprovisioning with Cluster Autoscaler?](#how-can-i-configure-overprovisioning-with-cluster-autoscaler) + * [How can I enable/disable eviction for a specific DaemonSet](#how-can-i-enabledisable-eviction-for-a-specific-daemonset) * [Internals](#internals) * [Are all of the mentioned heuristics and timings final?](#are-all-of-the-mentioned-heuristics-and-timings-final) * [How does scale-up work?](#how-does-scale-up-work) @@ -434,6 +435,30 @@ spec: serviceAccountName: cluster-proportional-autoscaler-service-account ``` +### How can I enable/disable eviction for a specific DaemonSet + +Cluster Autoscaler will evict DaemonSets based on its configuration, which is +common for the entire cluster. It is possible, however, to specify the desired +behavior on a per pod basis. All DaemonSet pods will be evicted when they have +the following annotation. + +``` +"cluster-autoscaler.kubernetes.io/enable-ds-eviction": "true" +``` + +It is also possible to disable DaemonSet pods eviction expicitly: + + +``` +"cluster-autoscaler.kubernetes.io/enable-ds-eviction": "false" +``` + +Note that this annotation needs to be specified on DaemonSet pods, not the +DaemonSet object itself. In order to do that for all DaemonSet pods, it is +sufficient to modify the pod spec in the DaemonSet object. + +This annotation has no effect on pods that are not a part of any DaemonSet. + **************** # Internals @@ -512,6 +537,17 @@ What happens when a non-empty node is terminated? As mentioned above, all pods s elsewhere. Cluster Autoscaler does this by evicting them and tainting the node, so they aren't scheduled there again. +DaemonSet pods may also be evicted. This can be configured separately for empty +(i.e. containing only DaemonSet pods) and non-empty nodes with +`--daemonset-eviction-for-empty-nodes` and +`--daemonset-eviction-for-occupied-nodes` flags, respectively. Note that the +default behavior is different on each flag: by default DaemonSet pods eviction +will happen only on occupied nodes. Individual DaemonSet pods can also +explicitly choose to be evicted (or not). See [How can I enable/disable eviction +for a specific +DaemonSet](#how-can-i-enabledisable-eviction-for-a-specific-daemonset) for more +details. + Example scenario: Nodes A, B, C, X, Y. @@ -690,6 +726,8 @@ The following startup parameters are supported for cluster autoscaler: | `skip-nodes-with-system-pods` | If true cluster autoscaler will never delete nodes with pods from kube-system (except for DaemonSet or mirror pods) | true | `skip-nodes-with-local-storage`| If true cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath | true | `min-replica-count` | Minimum number or replicas that a replica set or replication controller should have to allow their pods deletion in scale down | 0 +| `daemonset-eviction-for-empty-nodes` | Whether DaemonSet pods will be gracefully terminated from empty nodes | false +| `daemonset-eviction-for-occupied-nodes` | Whether DaemonSet pods will be gracefully terminated from non-empty nodes | true # Troubleshooting: From 7ddbe272f817961a4276357d60b146fab71c8f27 Mon Sep 17 00:00:00 2001 From: Michael Weibel <307427+mweibel@users.noreply.github.com> Date: Thu, 1 Jul 2021 08:29:52 +0200 Subject: [PATCH 63/86] update cluster-autoscaler chart to 1.21.0 --- charts/cluster-autoscaler/Chart.yaml | 4 ++-- charts/cluster-autoscaler/README.md | 2 +- charts/cluster-autoscaler/values.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index 596b9290cce0..bb792ee2b721 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 1.20.0 +appVersion: 1.21.0 description: Scales Kubernetes worker nodes within autoscaling groups. engine: gotpl home: https://github.com/kubernetes/autoscaler @@ -17,4 +17,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.9.2 +version: 9.10.0 diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 7a6582622819..3a552bbed9a4 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -367,7 +367,7 @@ Though enough for the majority of installations, the default PodSecurityPolicy _ | image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | | image.pullSecrets | list | `[]` | Image pull secrets | | image.repository | string | `"k8s.gcr.io/autoscaling/cluster-autoscaler"` | Image repository | -| image.tag | string | `"v1.20.0"` | Image tag | +| image.tag | string | `"v1.21.0"` | Image tag | | kubeTargetVersionOverride | string | `""` | Allow overriding the `.Capabilities.KubeVersion.GitVersion` check. Useful for `helm template` commands. | | magnumCABundlePath | string | `"/etc/kubernetes/ca-bundle.crt"` | Path to the host's CA bundle, from `ca-file` in the cloud-config file. | | magnumClusterName | string | `""` | Cluster name or ID in Magnum. Required if `cloudProvider=magnum` and not setting `autoDiscovery.clusterName`. | diff --git a/charts/cluster-autoscaler/values.yaml b/charts/cluster-autoscaler/values.yaml index b4afd293867c..2ea7ce1bf79f 100644 --- a/charts/cluster-autoscaler/values.yaml +++ b/charts/cluster-autoscaler/values.yaml @@ -195,7 +195,7 @@ image: # image.repository -- Image repository repository: k8s.gcr.io/autoscaling/cluster-autoscaler # image.tag -- Image tag - tag: v1.20.0 + tag: v1.21.0 # image.pullPolicy -- Image pull policy pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. From 41520aace566ca531f1b5e7be70b98e6f60ca7a7 Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Thu, 8 Jul 2021 10:50:51 +0100 Subject: [PATCH 64/86] [chart] Bump version to valid semver Signed-off-by: Steve Hipwell --- charts/cluster-autoscaler/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index 68cf630020ee..0f3f7e87ad6b 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -17,4 +17,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.10.01 +version: 9.10.2 From 52392b3707cb8192bd2841b6f2e8da9678c13fd9 Mon Sep 17 00:00:00 2001 From: Maciek Pytel Date: Thu, 8 Jul 2021 15:14:26 +0200 Subject: [PATCH 65/86] Skipping metrics tests added in #4022 Each test works in isolation, but they cause panic when the entire suite is run (ex. make test-in-docker), because the underlying metrics library panics when the same metric is registered twice. --- cluster-autoscaler/metrics/metrics_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cluster-autoscaler/metrics/metrics_test.go b/cluster-autoscaler/metrics/metrics_test.go index 71789d2c7a48..4bbe87b526f6 100644 --- a/cluster-autoscaler/metrics/metrics_test.go +++ b/cluster-autoscaler/metrics/metrics_test.go @@ -24,12 +24,14 @@ import ( ) func TestDisabledPerNodeGroupMetrics(t *testing.T) { + t.Skip("Registering metrics multiple times causes panic. Skipping until the test is fixed to not impact other tests.") RegisterAll(false) assert.False(t, nodesGroupMinNodes.IsCreated()) assert.False(t, nodesGroupMaxNodes.IsCreated()) } func TestEnabledPerNodeGroupMetrics(t *testing.T) { + t.Skip("Registering metrics multiple times causes panic. Skipping until the test is fixed to not impact other tests.") RegisterAll(true) assert.True(t, nodesGroupMinNodes.IsCreated()) assert.True(t, nodesGroupMaxNodes.IsCreated()) From 1d0a9e46301c772c5b2605fb58392e00ccd7ca39 Mon Sep 17 00:00:00 2001 From: Maciek Pytel Date: Fri, 9 Jul 2021 13:30:18 +0200 Subject: [PATCH 66/86] Update dependencies to k8s 1.22.0-beta.1 Some changes in scheduler framework initialization in response to upstream refactors. --- cluster-autoscaler/go.mod | 85 +- cluster-autoscaler/go.sum | 422 +- .../scheduler_based_predicates_checker.go | 19 +- .../mgmt/2019-12-01/compute/CHANGELOG.md | 131 +- .../mgmt/2019-12-01/compute/_meta.json | 11 + .../compute/mgmt/2019-12-01/compute/models.go | 311 + .../2019-05-01/containerregistry/CHANGELOG.md | 24 +- .../2019-05-01/containerregistry/_meta.json | 11 + .../2019-05-01/containerregistry/models.go | 34 + .../2020-04-01/containerservice/CHANGELOG.md | 23 +- .../2020-04-01/containerservice/_meta.json | 11 + .../2020-04-01/containerservice/models.go | 43 + .../mgmt/2019-06-01/network/CHANGELOG.md | 206 +- .../mgmt/2019-06-01/network/_meta.json | 11 + .../network/mgmt/2019-06-01/network/models.go | 311 + .../mgmt/2017-05-10/resources/CHANGELOG.md | 21 +- .../mgmt/2017-05-10/resources/_meta.json | 11 + .../mgmt/2017-05-10/resources/models.go | 41 + .../mgmt/2019-06-01/storage/CHANGELOG.md | 38 +- .../mgmt/2019-06-01/storage/_meta.json | 11 + .../storage/mgmt/2019-06-01/storage/models.go | 183 + .../Azure/azure-sdk-for-go/storage/client.go | 8 +- .../Azure/azure-sdk-for-go/version/version.go | 20 +- .../github.com/Azure/go-ansiterm/go.mod | 5 + .../github.com/Azure/go-ansiterm/go.sum | 2 + .../Azure/go-ansiterm/winterm/ansi.go | 24 +- .../Azure/go-autorest/autorest/adal/go.mod | 1 + .../Azure/go-autorest/autorest/adal/go.sum | 2 + .../Azure/go-autorest/autorest/adal/sender.go | 1 + .../Azure/go-autorest/autorest/adal/token.go | 298 +- .../go-autorest/autorest/adal/token_1.13.go | 2 - .../go-autorest/autorest/adal/token_legacy.go | 2 - .../Azure/go-autorest/autorest/client.go | 4 + .../Azure/go-autorest/autorest/go.mod | 4 +- .../Azure/go-autorest/autorest/go.sum | 8 +- .../Azure/go-autorest/autorest/to/go.mod | 2 + .../Azure/go-autorest/autorest/to/go.sum | 2 + .../autorest/to/go_mod_tidy_hack.go | 24 + .../Azure/go-autorest/logger/logger.go | 9 + .../aws/aws-sdk-go/aws/client/client.go | 4 - .../aws/aws-sdk-go/aws/client/logger.go | 8 + .../github.com/aws/aws-sdk-go/aws/config.go | 32 +- .../aws-sdk-go/aws/corehandlers/handlers.go | 2 +- .../aws/credentials/ssocreds/doc.go | 60 + .../aws-sdk-go/aws/credentials/ssocreds/os.go | 9 + .../aws/credentials/ssocreds/os_windows.go | 7 + .../aws/credentials/ssocreds/provider.go | 180 + .../stscreds/assume_role_provider.go | 14 +- .../aws/aws-sdk-go/aws/endpoints/defaults.go | 1235 +- .../aws/aws-sdk-go/aws/endpoints/v3model.go | 8 +- .../aws/aws-sdk-go/aws/session/credentials.go | 31 +- .../aws/session/custom_transport.go | 27 + ...ransport.go => custom_transport_go1.12.go} | 4 +- ...sport_1_5.go => custom_transport_go1.5.go} | 2 +- ...sport_1_6.go => custom_transport_go1.6.go} | 2 +- .../aws/aws-sdk-go/aws/session/doc.go | 27 + .../aws/aws-sdk-go/aws/session/env_config.go | 25 +- .../aws/aws-sdk-go/aws/session/session.go | 189 +- .../aws-sdk-go/aws/session/shared_config.go | 96 +- .../aws/aws-sdk-go/aws/signer/v4/v4.go | 5 +- .../github.com/aws/aws-sdk-go/aws/version.go | 2 +- .../aws/aws-sdk-go/private/protocol/host.go | 44 +- .../private/protocol/restjson/restjson.go | 59 + .../protocol/restjson/unmarshal_error.go | 134 + .../private/protocol/xml/xmlutil/build.go | 2 + .../protocol/xml/xmlutil/xml_to_struct.go | 22 +- .../aws/aws-sdk-go/service/autoscaling/api.go | 2927 +++- .../aws/aws-sdk-go/service/autoscaling/doc.go | 10 +- .../aws/aws-sdk-go/service/ec2/api.go | 9359 +++++++++++- .../aws/aws-sdk-go/service/ec2/doc.go | 10 +- .../aws/aws-sdk-go/service/ec2/waiters.go | 2 +- .../aws/aws-sdk-go/service/ecr/api.go | 1167 +- .../aws/aws-sdk-go/service/ecr/errors.go | 14 + .../aws/aws-sdk-go/service/elbv2/api.go | 520 +- .../aws/aws-sdk-go/service/elbv2/doc.go | 22 +- .../aws/aws-sdk-go/service/kms/api.go | 1078 +- .../aws/aws-sdk-go/service/sso/api.go | 1210 ++ .../aws/aws-sdk-go/service/sso/doc.go | 44 + .../aws/aws-sdk-go/service/sso/errors.go | 44 + .../aws/aws-sdk-go/service/sso/service.go | 104 + .../service/sso/ssoiface/interface.go | 86 + .../aws/aws-sdk-go/service/sts/api.go | 404 +- .../spec/lib/go/csi/csi.pb.go | 663 +- .../github.com/coreos/go-systemd/LICENSE | 191 - .../github.com/coreos/go-systemd/NOTICE | 5 - .../go-systemd/{ => v22}/daemon/sdnotify.go | 0 .../go-systemd/{ => v22}/daemon/watchdog.go | 0 .../coreos/go-systemd/v22/dbus/dbus.go | 36 +- .../coreos/go-systemd/v22/dbus/methods.go | 303 +- .../coreos/go-systemd/v22/journal/journal.go | 46 + .../journal/journal_unix.go} | 25 +- .../go-systemd/v22/journal/journal_windows.go | 35 + .../vendor/github.com/coreos/pkg/NOTICE | 5 - .../github.com/coreos/pkg/capnslog/README.md | 39 - .../coreos/pkg/capnslog/formatters.go | 157 - .../coreos/pkg/capnslog/glog_formatter.go | 96 - .../github.com/coreos/pkg/capnslog/init.go | 49 - .../coreos/pkg/capnslog/journald_formatter.go | 68 - .../github.com/coreos/pkg/capnslog/logmap.go | 245 - .../coreos/pkg/capnslog/pkg_logger.go | 191 - .../coreos/pkg/capnslog/syslog_formatter.go | 65 - .../github.com/dgrijalva/jwt-go/.gitignore | 4 - .../github.com/dgrijalva/jwt-go/.travis.yml | 13 - .../github.com/dgrijalva/jwt-go/LICENSE | 8 - .../dgrijalva/jwt-go/MIGRATION_GUIDE.md | 97 - .../github.com/dgrijalva/jwt-go/README.md | 100 - .../dgrijalva/jwt-go/VERSION_HISTORY.md | 118 - .../github.com/dgrijalva/jwt-go/claims.go | 134 - .../vendor/github.com/dgrijalva/jwt-go/doc.go | 4 - .../github.com/dgrijalva/jwt-go/ecdsa.go | 148 - .../dgrijalva/jwt-go/ecdsa_utils.go | 67 - .../github.com/dgrijalva/jwt-go/errors.go | 59 - .../github.com/dgrijalva/jwt-go/hmac.go | 95 - .../github.com/dgrijalva/jwt-go/map_claims.go | 94 - .../github.com/dgrijalva/jwt-go/none.go | 52 - .../github.com/dgrijalva/jwt-go/parser.go | 148 - .../vendor/github.com/dgrijalva/jwt-go/rsa.go | 101 - .../github.com/dgrijalva/jwt-go/rsa_pss.go | 126 - .../github.com/dgrijalva/jwt-go/rsa_utils.go | 101 - .../dgrijalva/jwt-go/signing_method.go | 35 - .../github.com/dgrijalva/jwt-go/token.go | 108 - .../github.com/felixge/httpsnoop/.gitignore | 0 .../github.com/felixge/httpsnoop/.travis.yml | 6 + .../github.com/felixge/httpsnoop/LICENSE.txt | 19 + .../github.com/felixge/httpsnoop/Makefile | 10 + .../github.com/felixge/httpsnoop/README.md | 94 + .../felixge/httpsnoop/capture_metrics.go | 84 + .../github.com/felixge/httpsnoop/docs.go | 10 + .../github.com/felixge/httpsnoop/go.mod | 3 + .../httpsnoop/wrap_generated_gteq_1.8.go | 385 + .../httpsnoop/wrap_generated_lt_1.8.go | 243 + .../form3tech-oss/jwt-go/map_claims.go | 22 +- .../go-openapi/jsonpointer/.travis.yml | 4 +- .../go-openapi/jsonpointer/pointer.go | 60 +- .../go-openapi/jsonreference/.golangci.yml | 41 + .../go-openapi/jsonreference/.travis.yml | 15 +- .../go-openapi/jsonreference/README.md | 2 +- .../go-openapi/jsonreference/go.mod | 2 +- .../go-openapi/jsonreference/go.sum | 10 +- .../github.com/go-openapi/swag/.golangci.yml | 17 + .../github.com/go-openapi/swag/.travis.yml | 30 +- .../github.com/go-openapi/swag/README.md | 1 - .../github.com/go-openapi/swag/convert.go | 16 +- .../go-openapi/swag/convert_types.go | 195 +- .../vendor/github.com/go-openapi/swag/go.mod | 14 +- .../vendor/github.com/go-openapi/swag/go.sum | 29 +- .../vendor/github.com/go-openapi/swag/json.go | 8 +- .../github.com/go-openapi/swag/loading.go | 42 +- .../vendor/github.com/go-openapi/swag/util.go | 6 +- .../golang/protobuf/descriptor/descriptor.go | 180 + .../golang/protobuf/jsonpb/decode.go | 524 + .../golang/protobuf/jsonpb/encode.go | 559 + .../github.com/golang/protobuf/jsonpb/json.go | 69 + .../golang/protobuf/proto/registry.go | 10 +- .../github.com/golang/protobuf/ptypes/any.go | 14 + .../github.com/golang/protobuf/ptypes/doc.go | 4 + .../golang/protobuf/ptypes/duration.go | 4 + .../golang/protobuf/ptypes/timestamp.go | 9 + .../google/go-cmp/cmp/cmpopts/equate.go | 8 - .../google/go-cmp/cmp/cmpopts/errors_go113.go | 15 + .../go-cmp/cmp/cmpopts/errors_xerrors.go | 18 + .../google/go-cmp/cmp/report_compare.go | 4 +- .../google/go-cmp/cmp/report_slices.go | 25 +- .../googleapis/gnostic/compiler/context.go | 18 +- .../googleapis/gnostic/compiler/error.go | 13 +- .../googleapis/gnostic/compiler/helpers.go | 11 + .../gnostic/extensions/extension.pb.go | 26 +- .../gnostic/extensions/extension.proto | 5 +- .../googleapis/gnostic/openapiv2/OpenAPIv2.go | 313 +- .../gnostic/openapiv2/OpenAPIv2.pb.go | 27 +- .../gnostic/openapiv2/OpenAPIv2.proto | 2 +- .../googleapis/gnostic/openapiv2/document.go | 19 +- .../grpc-ecosystem/grpc-gateway/LICENSE.txt | 27 + .../grpc-gateway/internal/BUILD.bazel | 23 + .../grpc-gateway/internal/errors.pb.go | 189 + .../grpc-gateway/internal/errors.proto | 26 + .../grpc-gateway/runtime/BUILD.bazel | 85 + .../grpc-gateway/runtime/context.go | 291 + .../grpc-gateway/runtime/convert.go | 318 + .../grpc-gateway/runtime/doc.go | 5 + .../grpc-gateway/runtime/errors.go | 186 + .../grpc-gateway/runtime/fieldmask.go | 89 + .../grpc-gateway/runtime/handler.go | 212 + .../runtime/marshal_httpbodyproto.go | 43 + .../grpc-gateway/runtime/marshal_json.go | 45 + .../grpc-gateway/runtime/marshal_jsonpb.go | 262 + .../grpc-gateway/runtime/marshal_proto.go | 62 + .../grpc-gateway/runtime/marshaler.go | 55 + .../runtime/marshaler_registry.go | 99 + .../grpc-gateway/runtime/mux.go | 300 + .../grpc-gateway/runtime/pattern.go | 262 + .../grpc-gateway/runtime/proto2_convert.go | 80 + .../grpc-gateway/runtime/proto_errors.go | 106 + .../grpc-gateway/runtime/query.go | 406 + .../grpc-gateway/utilities/BUILD.bazel | 21 + .../grpc-gateway/utilities/doc.go | 2 + .../grpc-gateway/utilities/pattern.go | 22 + .../grpc-gateway/utilities/readerfactory.go | 20 + .../grpc-gateway/utilities/trie.go | 177 + .../hashicorp/golang-lru/.gitignore | 23 - .../github.com/hashicorp/golang-lru/2q.go | 223 - .../github.com/hashicorp/golang-lru/LICENSE | 362 - .../github.com/hashicorp/golang-lru/README.md | 25 - .../github.com/hashicorp/golang-lru/arc.go | 257 - .../github.com/hashicorp/golang-lru/doc.go | 21 - .../github.com/hashicorp/golang-lru/go.mod | 1 - .../github.com/hashicorp/golang-lru/lru.go | 116 - .../hashicorp/golang-lru/simplelru/lru.go | 161 - .../golang-lru/simplelru/lru_interface.go | 36 - .../heketi/client/api/go-client/client.go | 2 +- .../github.com/josharian/intern/README.md | 5 + .../vendor/github.com/josharian/intern/go.mod | 3 + .../github.com/josharian/intern/intern.go | 44 + .../github.com/josharian/intern/license.md | 21 + .../vendor/github.com/json-iterator/go/go.sum | 1 + .../github.com/json-iterator/go/iter_float.go | 3 + .../github.com/json-iterator/go/iter_int.go | 3 +- .../github.com/json-iterator/go/reflect.go | 2 +- .../go/reflect_json_raw_message.go | 24 +- .../go/reflect_struct_decoder.go | 5 + .../github.com/mailru/easyjson/buffer/pool.go | 72 +- .../mailru/easyjson/jlexer/lexer.go | 216 +- .../mailru/easyjson/jwriter/writer.go | 41 +- .../vendor/github.com/miekg/dns/.codecov.yml | 8 - .../vendor/github.com/miekg/dns/.gitignore | 4 - .../vendor/github.com/miekg/dns/.travis.yml | 17 - .../vendor/github.com/miekg/dns/AUTHORS | 1 - .../vendor/github.com/miekg/dns/CODEOWNERS | 1 - .../vendor/github.com/miekg/dns/CONTRIBUTORS | 10 - .../vendor/github.com/miekg/dns/COPYRIGHT | 9 - .../vendor/github.com/miekg/dns/Makefile.fuzz | 33 - .../github.com/miekg/dns/Makefile.release | 52 - .../vendor/github.com/miekg/dns/README.md | 174 - .../vendor/github.com/miekg/dns/acceptfunc.go | 61 - .../vendor/github.com/miekg/dns/client.go | 441 - .../github.com/miekg/dns/clientconfig.go | 135 - .../vendor/github.com/miekg/dns/dane.go | 43 - .../vendor/github.com/miekg/dns/defaults.go | 384 - .../vendor/github.com/miekg/dns/dns.go | 134 - .../vendor/github.com/miekg/dns/dnssec.go | 758 - .../github.com/miekg/dns/dnssec_keygen.go | 140 - .../github.com/miekg/dns/dnssec_keyscan.go | 310 - .../github.com/miekg/dns/dnssec_privkey.go | 78 - .../vendor/github.com/miekg/dns/doc.go | 268 - .../vendor/github.com/miekg/dns/duplicate.go | 37 - .../vendor/github.com/miekg/dns/edns.go | 675 - .../vendor/github.com/miekg/dns/format.go | 93 - .../vendor/github.com/miekg/dns/fuzz.go | 32 - .../vendor/github.com/miekg/dns/generate.go | 247 - .../vendor/github.com/miekg/dns/go.mod | 11 - .../vendor/github.com/miekg/dns/go.sum | 39 - .../vendor/github.com/miekg/dns/labels.go | 212 - .../github.com/miekg/dns/listen_go111.go | 44 - .../github.com/miekg/dns/listen_go_not111.go | 23 - .../vendor/github.com/miekg/dns/msg.go | 1190 -- .../github.com/miekg/dns/msg_helpers.go | 833 -- .../github.com/miekg/dns/msg_truncate.go | 112 - .../vendor/github.com/miekg/dns/nsecx.go | 95 - .../vendor/github.com/miekg/dns/privaterr.go | 113 - .../vendor/github.com/miekg/dns/reverse.go | 52 - .../vendor/github.com/miekg/dns/sanitize.go | 86 - .../vendor/github.com/miekg/dns/scan.go | 1352 -- .../vendor/github.com/miekg/dns/scan_rr.go | 1742 --- .../vendor/github.com/miekg/dns/serve_mux.go | 122 - .../vendor/github.com/miekg/dns/server.go | 828 -- .../vendor/github.com/miekg/dns/sig0.go | 197 - .../github.com/miekg/dns/singleinflight.go | 61 - .../vendor/github.com/miekg/dns/smimea.go | 44 - .../vendor/github.com/miekg/dns/svcb.go | 744 - .../vendor/github.com/miekg/dns/tlsa.go | 44 - .../vendor/github.com/miekg/dns/tsig.go | 413 - .../vendor/github.com/miekg/dns/types.go | 1533 -- .../vendor/github.com/miekg/dns/udp.go | 102 - .../github.com/miekg/dns/udp_windows.go | 35 - .../vendor/github.com/miekg/dns/update.go | 110 - .../vendor/github.com/miekg/dns/version.go | 15 - .../vendor/github.com/miekg/dns/xfr.go | 266 - .../vendor/github.com/miekg/dns/zduplicate.go | 1319 -- .../vendor/github.com/miekg/dns/zmsg.go | 2823 ---- .../vendor/github.com/miekg/dns/ztypes.go | 938 -- .../vendor/github.com/moby/term/go.mod | 2 +- .../vendor/github.com/moby/term/go.sum | 4 +- .../client_golang/prometheus/build_info.go | 29 - .../client_golang/prometheus/counter.go | 20 +- .../client_golang/prometheus/desc.go | 4 +- .../prometheus/expvar_collector.go | 39 +- .../client_golang/prometheus/gauge.go | 20 +- .../client_golang/prometheus/go_collector.go | 53 +- .../client_golang/prometheus/histogram.go | 31 +- .../client_golang/prometheus/metric.go | 6 +- .../prometheus/process_collector.go | 33 +- .../prometheus/promhttp/delegator.go | 6 +- .../client_golang/prometheus/promhttp/http.go | 10 +- .../prometheus/promhttp/instrument_server.go | 91 +- .../client_golang/prometheus/registry.go | 4 +- .../client_golang/prometheus/summary.go | 39 +- .../client_golang/prometheus/value.go | 15 +- .../client_golang/prometheus/vec.go | 114 +- .../client_golang/prometheus/wrap.go | 6 +- .../prometheus/procfs/Makefile.common | 4 +- .../github.com/prometheus/procfs/SECURITY.md | 6 + .../github.com/prometheus/procfs/arp.go | 4 +- .../github.com/prometheus/procfs/buddyinfo.go | 2 +- .../github.com/prometheus/procfs/cpuinfo.go | 31 +- .../procfs/cpuinfo_riscvx.go} | 15 +- .../github.com/prometheus/procfs/crypto.go | 4 +- .../prometheus/procfs/fixtures.ttar | 374 +- .../github.com/prometheus/procfs/fscache.go | 2 +- .../github.com/prometheus/procfs/go.mod | 8 +- .../github.com/prometheus/procfs/go.sum | 14 +- .../prometheus/procfs/internal/fs/fs.go | 4 +- .../github.com/prometheus/procfs/loadavg.go | 4 +- .../github.com/prometheus/procfs/mdstat.go | 42 +- .../github.com/prometheus/procfs/meminfo.go | 194 +- .../prometheus/procfs/mountstats.go | 15 +- .../prometheus/procfs/net_conntrackstat.go | 4 +- .../prometheus/procfs/net_ip_socket.go | 220 + .../prometheus/procfs/net_protocols.go | 180 + .../prometheus/procfs/net_sockstat.go | 4 +- .../prometheus/procfs/net_softnet.go | 2 +- .../github.com/prometheus/procfs/net_tcp.go | 64 + .../github.com/prometheus/procfs/net_udp.go | 183 +- .../github.com/prometheus/procfs/net_unix.go | 14 +- .../github.com/prometheus/procfs/proc.go | 6 +- .../prometheus/procfs/proc_cgroup.go | 2 +- .../prometheus/procfs/proc_fdinfo.go | 4 +- .../prometheus/procfs/proc_limits.go | 87 +- .../github.com/prometheus/procfs/proc_ns.go | 6 +- .../github.com/prometheus/procfs/proc_psi.go | 2 +- .../github.com/prometheus/procfs/proc_stat.go | 5 +- .../github.com/prometheus/procfs/schedstat.go | 15 +- .../github.com/prometheus/procfs/slab.go | 151 + .../github.com/prometheus/procfs/stat.go | 24 +- .../github.com/prometheus/procfs/xfrm.go | 3 +- .../github.com/prometheus/procfs/zoneinfo.go | 4 +- .../vendor/github.com/spf13/afero/.travis.yml | 21 - .../vendor/github.com/spf13/afero/README.md | 452 - .../vendor/github.com/spf13/afero/afero.go | 108 - .../github.com/spf13/afero/appveyor.yml | 15 - .../vendor/github.com/spf13/afero/basepath.go | 180 - .../github.com/spf13/afero/cacheOnReadFs.go | 290 - .../github.com/spf13/afero/copyOnWriteFs.go | 293 - .../vendor/github.com/spf13/afero/go.mod | 3 - .../vendor/github.com/spf13/afero/go.sum | 2 - .../vendor/github.com/spf13/afero/httpFs.go | 110 - .../vendor/github.com/spf13/afero/ioutil.go | 230 - .../vendor/github.com/spf13/afero/lstater.go | 27 - .../vendor/github.com/spf13/afero/match.go | 110 - .../vendor/github.com/spf13/afero/mem/dir.go | 37 - .../github.com/spf13/afero/mem/dirmap.go | 43 - .../vendor/github.com/spf13/afero/mem/file.go | 317 - .../vendor/github.com/spf13/afero/memmap.go | 365 - .../vendor/github.com/spf13/afero/os.go | 101 - .../vendor/github.com/spf13/afero/path.go | 106 - .../github.com/spf13/afero/readonlyfs.go | 80 - .../vendor/github.com/spf13/afero/regexpfs.go | 214 - .../github.com/spf13/afero/unionFile.go | 320 - .../vendor/github.com/spf13/afero/util.go | 330 - .../github.com/spf13/cobra/.golangci.yml | 48 + .../vendor/github.com/spf13/cobra/.travis.yml | 9 +- .../github.com/spf13/cobra/CHANGELOG.md | 35 +- .../vendor/github.com/spf13/cobra/CONDUCT.md | 37 + .../vendor/github.com/spf13/cobra/Makefile | 18 +- .../vendor/github.com/spf13/cobra/README.md | 32 +- .../spf13/cobra/bash_completions.go | 133 +- .../spf13/cobra/bash_completions.md | 2 +- .../vendor/github.com/spf13/cobra/cobra.go | 15 + .../vendor/github.com/spf13/cobra/command.go | 116 +- .../spf13/cobra/custom_completions.go | 4 +- .../spf13/cobra/fish_completions.go | 6 +- .../vendor/github.com/spf13/cobra/go.mod | 2 +- .../vendor/github.com/spf13/cobra/go.sum | 4 +- .../spf13/cobra/powershell_completions.go | 323 +- .../spf13/cobra/powershell_completions.md | 15 +- .../spf13/cobra/projects_using_cobra.md | 3 + .../spf13/cobra/shell_completions.md | 119 +- .../github.com/spf13/cobra/zsh_completions.go | 4 +- .../vendor/go.etcd.io/etcd/NOTICE | 5 - .../go.etcd.io/etcd/{ => api/v3}/LICENSE | 0 .../etcd/{auth => api/v3}/authpb/auth.pb.go | 599 +- .../etcd/{auth => api/v3}/authpb/auth.proto | 0 .../v3}/etcdserverpb/etcdserver.pb.go | 617 +- .../v3}/etcdserverpb/etcdserver.proto | 0 .../v3}/etcdserverpb/raft_internal.pb.go | 1520 +- .../v3}/etcdserverpb/raft_internal.proto | 6 + .../etcdserverpb/raft_internal_stringer.go | 0 .../v3}/etcdserverpb/rpc.pb.go | 12088 ++++++++++++---- .../v3}/etcdserverpb/rpc.proto | 59 +- .../etcd/api/v3/membershippb/membership.pb.go | 1454 ++ .../etcd/api/v3/membershippb/membership.proto | 43 + .../etcd/{mvcc => api/v3}/mvccpb/kv.pb.go | 408 +- .../etcd/{mvcc => api/v3}/mvccpb/kv.proto | 0 .../api => api/v3}/v3rpc/rpctypes/doc.go | 0 .../api => api/v3}/v3rpc/rpctypes/error.go | 24 + .../api => api/v3}/v3rpc/rpctypes/md.go | 0 .../v3}/v3rpc/rpctypes/metadatafields.go | 0 .../etcd/{ => api/v3}/version/version.go | 2 +- .../etcd/client/pkg/v3}/LICENSE | 8 +- .../pkg/v3}/fileutil/dir_unix.go | 1 + .../pkg/v3}/fileutil/dir_windows.go | 1 + .../{pkg => client/pkg/v3}/fileutil/doc.go | 0 .../pkg/v3}/fileutil/fileutil.go | 57 +- .../{pkg => client/pkg/v3}/fileutil/lock.go | 0 .../pkg/v3}/fileutil/lock_flock.go | 1 + .../pkg/v3}/fileutil/lock_linux.go | 16 +- .../pkg/v3}/fileutil/lock_plan9.go | 0 .../pkg/v3}/fileutil/lock_solaris.go | 1 + .../pkg/v3}/fileutil/lock_unix.go | 1 + .../pkg/v3}/fileutil/lock_windows.go | 3 +- .../pkg/v3}/fileutil/preallocate.go | 0 .../pkg/v3}/fileutil/preallocate_darwin.go | 22 +- .../pkg/v3}/fileutil/preallocate_unix.go | 1 + .../v3}/fileutil/preallocate_unsupported.go | 1 + .../{pkg => client/pkg/v3}/fileutil/purge.go | 15 +- .../pkg/v3}/fileutil/read_dir.go | 0 .../{pkg => client/pkg/v3}/fileutil/sync.go | 1 + .../pkg/v3}/fileutil/sync_darwin.go | 11 +- .../pkg/v3}/fileutil/sync_linux.go | 1 + .../{pkg => client/pkg/v3}/logutil/doc.go | 0 .../etcd/client/pkg/v3/logutil/log_level.go} | 29 +- .../{pkg => client/pkg/v3}/logutil/zap.go | 0 .../pkg/v3}/logutil/zap_journal.go | 5 +- .../{pkg => client/pkg/v3}/systemd/doc.go | 0 .../{pkg => client/pkg/v3}/systemd/journal.go | 2 +- .../client/pkg/v3/tlsutil/cipher_suites.go | 39 + .../{pkg => client/pkg/v3}/tlsutil/doc.go | 0 .../{pkg => client/pkg/v3}/tlsutil/tlsutil.go | 0 .../{pkg => client/pkg/v3}/transport/doc.go | 0 .../pkg/v3}/transport/keepalive_listener.go | 0 .../pkg/v3}/transport/limit_listen.go | 0 .../pkg/v3}/transport/listener.go | 171 +- .../client/pkg/v3/transport/listener_opts.go | 76 + .../pkg/v3}/transport/listener_tls.go | 0 .../etcd/client/pkg/v3/transport/sockopt.go | 45 + .../client/pkg/v3/transport/sockopt_unix.go | 22 + .../pkg/v3/transport/sockopt_windows.go | 19 + .../pkg/v3}/transport/timeout_conn.go | 12 +- .../pkg/v3}/transport/timeout_dialer.go | 6 +- .../pkg/v3}/transport/timeout_listener.go | 26 +- .../pkg/v3}/transport/timeout_transport.go | 0 .../{pkg => client/pkg/v3}/transport/tls.go | 0 .../pkg/v3}/transport/transport.go | 20 +- .../pkg/v3}/transport/unix_listener.go | 0 .../etcd/{pkg => client/pkg/v3}/types/doc.go | 0 .../etcd/{pkg => client/pkg/v3}/types/id.go | 0 .../etcd/{pkg => client/pkg/v3}/types/set.go | 0 .../{pkg => client/pkg/v3}/types/slice.go | 0 .../etcd/{pkg => client/pkg/v3}/types/urls.go | 0 .../{pkg => client/pkg/v3}/types/urlsmap.go | 0 .../vendor/go.etcd.io/etcd/client/v3/LICENSE | 202 + .../etcd/{clientv3 => client/v3}/README.md | 19 +- .../etcd/{clientv3 => client/v3}/auth.go | 60 +- .../etcd/{clientv3 => client/v3}/client.go | 317 +- .../etcd/{clientv3 => client/v3}/cluster.go | 6 +- .../{clientv3 => client/v3}/compact_op.go | 2 +- .../etcd/{clientv3 => client/v3}/compare.go | 2 +- .../etcd/{clientv3 => client/v3}/config.go | 4 + .../v3}/credentials/credentials.go | 54 +- .../etcd/{clientv3 => client/v3}/ctx.go | 22 +- .../etcd/{clientv3 => client/v3}/doc.go | 6 +- .../vendor/go.etcd.io/etcd/client/v3/go.mod | 28 + .../vendor/go.etcd.io/etcd/client/v3/go.sum | 269 + .../client/v3/internal/endpoint/endpoint.go | 137 + .../client/v3/internal/resolver/resolver.go | 74 + .../etcd/{clientv3 => client/v3}/kv.go | 2 +- .../etcd/{clientv3 => client/v3}/lease.go | 24 +- .../go.etcd.io/etcd/client/v3/logger.go | 77 + .../{clientv3 => client/v3}/maintenance.go | 17 +- .../etcd/{clientv3 => client/v3}/op.go | 14 +- .../etcd/{clientv3 => client/v3}/options.go | 12 +- .../etcd/{clientv3 => client/v3}/retry.go | 12 +- .../v3}/retry_interceptor.go | 35 +- .../etcd/{clientv3 => client/v3}/sort.go | 0 .../etcd/{clientv3 => client/v3}/txn.go | 2 +- .../etcd/{clientv3 => client/v3}/utils.go | 0 .../etcd/{clientv3 => client/v3}/watch.go | 151 +- .../etcd/clientv3/balancer/balancer.go | 293 - .../balancer/connectivity/connectivity.go | 93 - .../etcd/clientv3/balancer/picker/picker.go | 91 - .../balancer/picker/roundrobin_balanced.go | 95 - .../balancer/resolver/endpoint/endpoint.go | 247 - .../etcd/clientv3/balancer/utils.go | 68 - .../vendor/go.etcd.io/etcd/clientv3/logger.go | 101 - .../etcd/pkg/logutil/discard_logger.go | 46 - .../go.etcd.io/etcd/pkg/logutil/log_level.go | 70 - .../go.etcd.io/etcd/pkg/logutil/logger.go | 64 - .../etcd/pkg/logutil/merge_logger.go | 194 - .../etcd/pkg/logutil/package_logger.go | 60 - .../go.etcd.io/etcd/pkg/logutil/zap_grpc.go | 111 - .../go.etcd.io/etcd/pkg/logutil/zap_raft.go | 102 - .../etcd/pkg/tlsutil/cipher_suites.go | 51 - .../vendor/go.etcd.io/etcd/raft/OWNERS | 19 - .../vendor/go.etcd.io/etcd/raft/README.md | 197 - .../vendor/go.etcd.io/etcd/raft/bootstrap.go | 80 - .../etcd/raft/confchange/confchange.go | 425 - .../etcd/raft/confchange/restore.go | 155 - .../vendor/go.etcd.io/etcd/raft/design.md | 57 - .../vendor/go.etcd.io/etcd/raft/doc.go | 300 - .../vendor/go.etcd.io/etcd/raft/log.go | 372 - .../go.etcd.io/etcd/raft/log_unstable.go | 157 - .../vendor/go.etcd.io/etcd/raft/logger.go | 132 - .../vendor/go.etcd.io/etcd/raft/node.go | 584 - .../go.etcd.io/etcd/raft/quorum/joint.go | 75 - .../go.etcd.io/etcd/raft/quorum/majority.go | 210 - .../go.etcd.io/etcd/raft/quorum/quorum.go | 58 - .../etcd/raft/quorum/voteresult_string.go | 26 - .../vendor/go.etcd.io/etcd/raft/raft.go | 1656 --- .../go.etcd.io/etcd/raft/raftpb/confchange.go | 170 - .../go.etcd.io/etcd/raft/raftpb/confstate.go | 45 - .../go.etcd.io/etcd/raft/raftpb/raft.pb.go | 2646 ---- .../go.etcd.io/etcd/raft/raftpb/raft.proto | 177 - .../vendor/go.etcd.io/etcd/raft/rawnode.go | 239 - .../vendor/go.etcd.io/etcd/raft/read_only.go | 121 - .../vendor/go.etcd.io/etcd/raft/status.go | 106 - .../vendor/go.etcd.io/etcd/raft/storage.go | 273 - .../go.etcd.io/etcd/raft/tracker/inflights.go | 132 - .../go.etcd.io/etcd/raft/tracker/progress.go | 259 - .../go.etcd.io/etcd/raft/tracker/state.go | 42 - .../go.etcd.io/etcd/raft/tracker/tracker.go | 288 - .../vendor/go.etcd.io/etcd/raft/util.go | 233 - .../go.opentelemetry.io/contrib/.gitignore | 13 + .../go.opentelemetry.io/contrib/.golangci.yml | 32 + .../go.opentelemetry.io/contrib/CHANGELOG.md | 319 + .../go.opentelemetry.io/contrib/CODEOWNERS | 17 + .../contrib/CONTRIBUTING.md | 135 + .../contrib/LICENSE} | 29 +- .../go.opentelemetry.io/contrib/Makefile | 203 + .../go.opentelemetry.io/contrib/README.md | 25 + .../go.opentelemetry.io/contrib/RELEASING.md | 96 + .../go.opentelemetry.io/contrib/contrib.go | 28 + .../vendor/go.opentelemetry.io/contrib/doc.go | 20 + .../vendor/go.opentelemetry.io/contrib/go.mod | 3 + .../vendor/go.opentelemetry.io/contrib/go.sum | 0 .../instrumentation/net/http/otelhttp/LICENSE | 201 + .../net/http/otelhttp/client.go | 61 + .../net/http/otelhttp/common.go | 41 + .../net/http/otelhttp/config.go | 173 + .../instrumentation/net/http/otelhttp/doc.go | 18 + .../instrumentation/net/http/otelhttp/go.mod | 15 + .../instrumentation/net/http/otelhttp/go.sum | 25 + .../net/http/otelhttp/handler.go | 225 + .../net/http/otelhttp/labeler.go | 65 + .../net/http/otelhttp/transport.go | 136 + .../instrumentation/net/http/otelhttp/wrap.go | 96 + .../contrib/pre_release.sh | 158 + .../vendor/go.opentelemetry.io/contrib/tag.sh | 178 + .../go.opentelemetry.io/otel/.gitignore | 19 + .../go.opentelemetry.io/otel/.gitmodules | 3 + .../go.opentelemetry.io/otel/.golangci.yml | 32 + .../go.opentelemetry.io/otel/CHANGELOG.md | 1319 ++ .../go.opentelemetry.io/otel/CODEOWNERS | 17 + .../go.opentelemetry.io/otel/CONTRIBUTING.md | 380 + .../vendor/go.opentelemetry.io/otel/LICENSE | 201 + .../vendor/go.opentelemetry.io/otel/Makefile | 179 + .../vendor/go.opentelemetry.io/otel/README.md | 92 + .../go.opentelemetry.io/otel/RELEASING.md | 81 + .../go.opentelemetry.io/otel/VERSIONING.md | 217 + .../go.opentelemetry.io/otel/attribute/doc.go | 20 + .../otel/attribute/encoder.go | 150 + .../otel/attribute/iterator.go | 143 + .../go.opentelemetry.io/otel/attribute/key.go | 102 + .../go.opentelemetry.io/otel/attribute/kv.go | 108 + .../go.opentelemetry.io/otel/attribute/set.go | 471 + .../otel/attribute/type_string.go | 28 + .../otel/attribute/value.go | 204 + .../go.opentelemetry.io/otel/codes/codes.go | 106 + .../go.opentelemetry.io/otel/codes/doc.go | 25 + .../vendor/go.opentelemetry.io/otel/doc.go | 38 + .../otel/error_handler.go} | 23 +- .../otel/exporters/otlp/LICENSE | 201 + .../otel/exporters/otlp/README.md | 31 + .../otel/exporters/otlp/doc.go | 20 + .../otel/exporters/otlp/go.mod | 62 + .../otel/exporters/otlp/go.sum | 123 + .../otlp/internal/otlpconfig/envconfig.go | 196 + .../otlp/internal/otlpconfig/options.go | 376 + .../exporters/otlp/internal/otlpconfig/tls.go | 69 + .../otlp/internal/transform/attribute.go | 141 + .../internal/transform/instrumentation.go | 31 + .../otlp/internal/transform/metric.go | 631 + .../otlp/internal/transform/resource.go | 29 + .../exporters/otlp/internal/transform/span.go | 218 + .../otel/exporters/otlp/options.go | 45 + .../otel/exporters/otlp/optiontypes.go | 38 + .../otel/exporters/otlp/otlp.go | 179 + .../exporters/otlp/otlpgrpc/connection.go | 278 + .../otel/exporters/otlp/otlpgrpc/doc.go | 25 + .../otel/exporters/otlp/otlpgrpc/driver.go | 195 + .../otel/exporters/otlp/otlpgrpc/options.go | 202 + .../otel/exporters/otlp/protocoldriver.go | 145 + .../go.opentelemetry.io/otel/get_main_pkgs.sh | 41 + .../vendor/go.opentelemetry.io/otel/go.mod | 55 + .../vendor/go.opentelemetry.io/otel/go.sum | 15 + .../go.opentelemetry.io/otel/handler.go | 89 + .../otel/internal/baggage/baggage.go | 338 + .../otel/internal/global/meter.go | 348 + .../otel/internal/global/propagator.go | 82 + .../otel/internal/global/state.go | 143 + .../otel/internal/global/trace.go | 147 + .../otel/internal/metric/async.go | 148 + .../otel/internal/rawhelpers.go | 55 + .../otel/internal/trace/noop/noop.go} | 30 +- .../go.opentelemetry.io/otel/metric/LICENSE | 201 + .../go.opentelemetry.io/otel/metric/config.go | 128 + .../go.opentelemetry.io/otel/metric/doc.go | 67 + .../otel/metric/global/metric.go | 49 + .../go.opentelemetry.io/otel/metric/go.mod | 54 + .../go.opentelemetry.io/otel/metric/go.sum | 15 + .../otel/metric/instrumentkind_string.go | 28 + .../go.opentelemetry.io/otel/metric/metric.go | 577 + .../otel/metric/metric_instrument.go | 777 + .../otel/metric/metric_noop.go | 59 + .../otel/metric/metric_sdkapi.go | 95 + .../otel/metric/number/doc.go | 23 + .../otel/metric/number/kind_string.go | 24 + .../otel/metric/number/number.go | 538 + .../otel/metric/registry/doc.go | 24 + .../otel/metric/registry/registry.go | 170 + .../go.opentelemetry.io/otel/pre_release.sh | 95 + .../go.opentelemetry.io/otel/propagation.go | 31 + .../otel/propagation/baggage.go | 111 + .../otel/propagation/doc.go | 28 + .../otel/propagation/propagation.go | 105 + .../otel/propagation/trace_context.go | 178 + .../go.opentelemetry.io/otel/sdk/LICENSE | 201 + .../otel/sdk/export/metric/LICENSE | 201 + .../export/metric/aggregation/aggregation.go | 154 + .../sdk/export/metric/exportkind_string.go | 25 + .../otel/sdk/export/metric/go.mod | 54 + .../otel/sdk/export/metric/go.sum | 15 + .../otel/sdk/export/metric/metric.go | 445 + .../otel/sdk/instrumentation/library.go | 35 + .../otel/sdk/internal/internal.go | 37 + .../otel/sdk/internal/sanitize.go | 50 + .../otel/sdk/metric/LICENSE | 201 + .../otel/sdk/metric/aggregator/aggregator.go | 52 + .../otel/sdk/metric/aggregator/exact/exact.go | 130 + .../metric/aggregator/histogram/histogram.go | 270 + .../metric/aggregator/lastvalue/lastvalue.go | 135 + .../metric/aggregator/minmaxsumcount/mmsc.go | 165 + .../otel/sdk/metric/aggregator/sum/sum.go | 106 + .../otel/sdk/metric/atomicfields.go} | 18 +- .../sdk/metric/controller/basic/config.go | 122 + .../sdk/metric/controller/basic/controller.go | 312 + .../otel/sdk/metric/controller/time/time.go | 59 + .../otel/sdk/metric/doc.go | 141 + .../otel/sdk/metric/go.mod | 56 + .../otel/sdk/metric/go.sum | 17 + .../otel/sdk/metric/processor/basic/basic.go | 377 + .../otel/sdk/metric/processor/basic/config.go | 42 + .../otel/sdk/metric/refcount_mapped.go | 59 + .../otel/sdk/metric/sdk.go | 555 + .../otel/sdk/metric/selector/simple/simple.go | 120 + .../otel/sdk/resource/auto.go | 64 + .../otel/sdk/resource/builtin.go | 103 + .../otel/sdk/resource/config.go | 165 + .../otel/sdk/resource/doc.go | 32 + .../otel/sdk/resource/env.go | 72 + .../otel/sdk/resource/os.go | 39 + .../otel/sdk/resource/process.go | 237 + .../otel/sdk/resource/resource.go | 196 + .../otel/sdk/trace/attributesmap.go | 91 + .../otel/sdk/trace/batch_span_processor.go | 328 + .../otel/sdk/trace/config.go | 68 + .../go.opentelemetry.io/otel/sdk/trace/doc.go | 25 + .../otel/sdk/trace/evictedqueue.go | 38 + .../otel/sdk/trace/id_generator.go | 67 + .../otel/sdk/trace/provider.go | 324 + .../otel/sdk/trace/sampling.go | 290 + .../otel/sdk/trace/simple_span_processor.go | 80 + .../otel/sdk/trace/span.go | 617 + .../otel/sdk/trace/span_exporter.go | 39 + .../otel/sdk/trace/span_processor.go | 56 + .../otel/sdk/trace/tracer.go | 75 + .../go.opentelemetry.io/otel/semconv/doc.go | 24 + .../otel/semconv/exception.go | 39 + .../go.opentelemetry.io/otel/semconv/http.go | 297 + .../otel/semconv/resource.go | 257 + .../go.opentelemetry.io/otel/semconv/trace.go | 376 + .../vendor/go.opentelemetry.io/otel/tag.sh | 178 + .../vendor/go.opentelemetry.io/otel/trace.go | 44 + .../go.opentelemetry.io/otel/trace/LICENSE | 201 + .../go.opentelemetry.io/otel/trace/config.go | 205 + .../go.opentelemetry.io/otel/trace/context.go | 61 + .../go.opentelemetry.io/otel/trace/doc.go | 70 + .../go.opentelemetry.io/otel/trace/go.mod | 53 + .../go.opentelemetry.io/otel/trace/go.sum | 15 + .../otel/trace/nonrecording.go | 27 + .../go.opentelemetry.io/otel/trace/noop.go | 84 + .../go.opentelemetry.io/otel/trace/trace.go | 673 + .../go.opentelemetry.io/otel/unit/doc.go | 20 + .../otel/unit/unit.go} | 18 +- .../otel/verify_examples.sh | 85 + .../otel/version.go} | 10 +- .../go.opentelemetry.io/proto/otlp/LICENSE | 201 + .../metrics/v1/metrics_service.pb.go | 255 + .../metrics/v1/metrics_service.pb.gw.go | 169 + .../metrics/v1/metrics_service_grpc.pb.go | 101 + .../collector/trace/v1/trace_config.pb.go | 573 + .../collector/trace/v1/trace_service.pb.go | 252 + .../collector/trace/v1/trace_service.pb.gw.go | 169 + .../trace/v1/trace_service_grpc.pb.go | 101 + .../proto/otlp/common/v1/common.pb.go | 659 + .../proto/otlp/metrics/v1/metrics.pb.go | 2469 ++++ .../proto/otlp/resource/v1/resource.pb.go | 194 + .../proto/otlp/trace/v1/trace.pb.go | 1206 ++ .../vendor/go.uber.org/atomic/.codecov.yml | 4 + .../vendor/go.uber.org/atomic/.travis.yml | 4 +- .../vendor/go.uber.org/atomic/CHANGELOG.md | 12 + .../vendor/go.uber.org/atomic/Makefile | 51 +- .../vendor/go.uber.org/atomic/atomic.go | 356 - .../vendor/go.uber.org/atomic/bool.go | 81 + .../vendor/go.uber.org/atomic/bool_ext.go | 53 + .../vendor/go.uber.org/atomic/doc.go | 23 + .../vendor/go.uber.org/atomic/duration.go | 82 + .../vendor/go.uber.org/atomic/duration_ext.go | 40 + .../vendor/go.uber.org/atomic/error.go | 48 +- .../vendor/go.uber.org/atomic/error_ext.go | 39 + .../vendor/go.uber.org/atomic/float64.go | 76 + .../vendor/go.uber.org/atomic/float64_ext.go | 47 + .../vendor/go.uber.org/atomic/gen.go | 26 + .../vendor/go.uber.org/atomic/go.mod | 2 - .../vendor/go.uber.org/atomic/go.sum | 13 - .../vendor/go.uber.org/atomic/int32.go | 102 + .../vendor/go.uber.org/atomic/int64.go | 102 + .../vendor/go.uber.org/atomic/nocmp.go | 35 + .../vendor/go.uber.org/atomic/string.go | 41 +- .../vendor/go.uber.org/atomic/string_ext.go | 43 + .../vendor/go.uber.org/atomic/uint32.go | 102 + .../vendor/go.uber.org/atomic/uint64.go | 102 + .../vendor/go.uber.org/atomic/value.go | 31 + .../vendor/go.uber.org/multierr/.travis.yml | 10 +- .../vendor/go.uber.org/multierr/CHANGELOG.md | 6 + .../vendor/go.uber.org/multierr/Makefile | 6 +- .../vendor/go.uber.org/multierr/error.go | 2 +- .../vendor/go.uber.org/multierr/go.mod | 6 +- .../vendor/go.uber.org/multierr/go.sum | 38 +- .../vendor/go.uber.org/zap/.travis.yml | 23 - .../vendor/go.uber.org/zap/CHANGELOG.md | 28 + .../vendor/go.uber.org/zap/CONTRIBUTING.md | 6 - .../vendor/go.uber.org/zap/FAQ.md | 8 + .../vendor/go.uber.org/zap/Makefile | 16 +- .../vendor/go.uber.org/zap/README.md | 8 +- .../vendor/go.uber.org/zap/field.go | 10 + .../vendor/go.uber.org/zap/go.mod | 11 +- .../vendor/go.uber.org/zap/go.sum | 56 +- .../vendor/go.uber.org/zap/http_handler.go | 99 +- .../vendor/go.uber.org/zap/logger.go | 9 +- .../vendor/go.uber.org/zap/sugar.go | 27 +- .../zap/zapcore/console_encoder.go | 2 +- .../vendor/go.uber.org/zap/zapcore/error.go | 19 +- .../vendor/go.uber.org/zap/zapcore/field.go | 8 +- .../go.uber.org/zap/zapcore/write_syncer.go | 3 +- .../vendor/go.uber.org/zap/zapgrpc/zapgrpc.go | 241 + .../golang.org/x/crypto/ed25519/ed25519.go | 223 - .../x/crypto/ed25519/ed25519_go113.go | 74 - .../ed25519/internal/edwards25519/const.go | 1422 -- .../internal/edwards25519/edwards25519.go | 1793 --- .../vendor/golang.org/x/net/html/parse.go | 24 +- .../golang.org/x/net/http/httpguts/httplex.go | 10 +- .../vendor/golang.org/x/net/http2/Dockerfile | 2 +- .../vendor/golang.org/x/net/http2/ascii.go | 49 + .../x/net/http2/client_conn_pool.go | 79 +- .../vendor/golang.org/x/net/http2/go115.go | 27 + .../golang.org/x/net/http2/headermap.go | 7 +- .../golang.org/x/net/http2/not_go115.go | 31 + .../vendor/golang.org/x/net/http2/server.go | 56 +- .../golang.org/x/net/http2/transport.go | 68 +- .../vendor/golang.org/x/net/http2/write.go | 7 +- .../golang.org/x/net/idna/idna10.0.0.go | 113 +- .../vendor/golang.org/x/net/idna/idna9.0.0.go | 93 +- .../golang.org/x/net/internal/iana/const.go | 223 - .../x/net/internal/socket/cmsghdr.go | 12 - .../x/net/internal/socket/cmsghdr_bsd.go | 14 - .../internal/socket/cmsghdr_linux_32bit.go | 15 - .../internal/socket/cmsghdr_linux_64bit.go | 15 - .../internal/socket/cmsghdr_solaris_64bit.go | 14 - .../x/net/internal/socket/cmsghdr_stub.go | 28 - .../x/net/internal/socket/cmsghdr_unix.go | 22 - .../net/internal/socket/cmsghdr_zos_s390x.go | 25 - .../golang.org/x/net/internal/socket/empty.s | 7 - .../x/net/internal/socket/error_unix.go | 32 - .../x/net/internal/socket/error_windows.go | 26 - .../x/net/internal/socket/iovec_32bit.go | 20 - .../x/net/internal/socket/iovec_64bit.go | 20 - .../internal/socket/iovec_solaris_64bit.go | 19 - .../x/net/internal/socket/iovec_stub.go | 12 - .../x/net/internal/socket/mmsghdr_stub.go | 22 - .../x/net/internal/socket/mmsghdr_unix.go | 43 - .../x/net/internal/socket/msghdr_bsd.go | 40 - .../x/net/internal/socket/msghdr_bsdvar.go | 17 - .../x/net/internal/socket/msghdr_linux.go | 36 - .../net/internal/socket/msghdr_linux_32bit.go | 25 - .../net/internal/socket/msghdr_linux_64bit.go | 25 - .../x/net/internal/socket/msghdr_openbsd.go | 14 - .../internal/socket/msghdr_solaris_64bit.go | 36 - .../x/net/internal/socket/msghdr_stub.go | 15 - .../x/net/internal/socket/msghdr_zos_s390x.go | 36 - .../x/net/internal/socket/norace.go | 13 - .../golang.org/x/net/internal/socket/race.go | 38 - .../x/net/internal/socket/rawconn.go | 64 - .../x/net/internal/socket/rawconn_mmsg.go | 80 - .../x/net/internal/socket/rawconn_msg.go | 79 - .../x/net/internal/socket/rawconn_nommsg.go | 16 - .../x/net/internal/socket/rawconn_nomsg.go | 16 - .../x/net/internal/socket/socket.go | 280 - .../golang.org/x/net/internal/socket/sys.go | 23 - .../x/net/internal/socket/sys_bsd.go | 16 - .../x/net/internal/socket/sys_const_unix.go | 18 - .../x/net/internal/socket/sys_const_zos.go | 18 - .../x/net/internal/socket/sys_linkname.go | 43 - .../x/net/internal/socket/sys_linux.go | 23 - .../x/net/internal/socket/sys_linux_386.go | 53 - .../x/net/internal/socket/sys_linux_386.s | 11 - .../x/net/internal/socket/sys_linux_amd64.go | 10 - .../x/net/internal/socket/sys_linux_arm.go | 10 - .../x/net/internal/socket/sys_linux_arm64.go | 10 - .../x/net/internal/socket/sys_linux_mips.go | 10 - .../x/net/internal/socket/sys_linux_mips64.go | 10 - .../net/internal/socket/sys_linux_mips64le.go | 10 - .../x/net/internal/socket/sys_linux_mipsle.go | 10 - .../x/net/internal/socket/sys_linux_ppc64.go | 10 - .../net/internal/socket/sys_linux_ppc64le.go | 10 - .../net/internal/socket/sys_linux_riscv64.go | 13 - .../x/net/internal/socket/sys_linux_s390x.go | 53 - .../x/net/internal/socket/sys_linux_s390x.s | 11 - .../x/net/internal/socket/sys_netbsd.go | 25 - .../x/net/internal/socket/sys_posix.go | 184 - .../x/net/internal/socket/sys_solaris.go | 59 - .../x/net/internal/socket/sys_solaris_amd64.s | 11 - .../x/net/internal/socket/sys_stub.go | 50 - .../x/net/internal/socket/sys_unix.go | 34 - .../x/net/internal/socket/sys_windows.go | 71 - .../x/net/internal/socket/sys_zos_s390x.go | 38 - .../x/net/internal/socket/sys_zos_s390x.s | 11 - .../x/net/internal/socket/zsys_aix_ppc64.go | 60 - .../x/net/internal/socket/zsys_darwin_386.go | 50 - .../net/internal/socket/zsys_darwin_amd64.go | 52 - .../x/net/internal/socket/zsys_darwin_arm.go | 50 - .../net/internal/socket/zsys_darwin_arm64.go | 52 - .../internal/socket/zsys_dragonfly_amd64.go | 52 - .../x/net/internal/socket/zsys_freebsd_386.go | 50 - .../net/internal/socket/zsys_freebsd_amd64.go | 52 - .../x/net/internal/socket/zsys_freebsd_arm.go | 50 - .../net/internal/socket/zsys_freebsd_arm64.go | 52 - .../x/net/internal/socket/zsys_linux_386.go | 53 - .../x/net/internal/socket/zsys_linux_amd64.go | 56 - .../x/net/internal/socket/zsys_linux_arm.go | 53 - .../x/net/internal/socket/zsys_linux_arm64.go | 56 - .../x/net/internal/socket/zsys_linux_mips.go | 53 - .../net/internal/socket/zsys_linux_mips64.go | 56 - .../internal/socket/zsys_linux_mips64le.go | 56 - .../net/internal/socket/zsys_linux_mipsle.go | 53 - .../x/net/internal/socket/zsys_linux_ppc64.go | 56 - .../net/internal/socket/zsys_linux_ppc64le.go | 56 - .../net/internal/socket/zsys_linux_riscv64.go | 58 - .../x/net/internal/socket/zsys_linux_s390x.go | 56 - .../x/net/internal/socket/zsys_netbsd_386.go | 55 - .../net/internal/socket/zsys_netbsd_amd64.go | 58 - .../x/net/internal/socket/zsys_netbsd_arm.go | 55 - .../net/internal/socket/zsys_netbsd_arm64.go | 58 - .../x/net/internal/socket/zsys_openbsd_386.go | 50 - .../net/internal/socket/zsys_openbsd_amd64.go | 52 - .../x/net/internal/socket/zsys_openbsd_arm.go | 50 - .../net/internal/socket/zsys_openbsd_arm64.go | 52 - .../internal/socket/zsys_openbsd_mips64.go | 50 - .../net/internal/socket/zsys_solaris_amd64.go | 51 - .../x/net/internal/socket/zsys_zos_s390x.go | 32 - .../vendor/golang.org/x/net/ipv4/batch.go | 194 - .../vendor/golang.org/x/net/ipv4/control.go | 144 - .../golang.org/x/net/ipv4/control_bsd.go | 42 - .../golang.org/x/net/ipv4/control_pktinfo.go | 40 - .../golang.org/x/net/ipv4/control_stub.go | 14 - .../golang.org/x/net/ipv4/control_unix.go | 74 - .../golang.org/x/net/ipv4/control_windows.go | 12 - .../golang.org/x/net/ipv4/control_zos.go | 86 - .../vendor/golang.org/x/net/ipv4/dgramopt.go | 264 - .../vendor/golang.org/x/net/ipv4/doc.go | 244 - .../vendor/golang.org/x/net/ipv4/endpoint.go | 186 - .../golang.org/x/net/ipv4/genericopt.go | 55 - .../vendor/golang.org/x/net/ipv4/header.go | 172 - .../vendor/golang.org/x/net/ipv4/helper.go | 77 - .../vendor/golang.org/x/net/ipv4/iana.go | 38 - .../vendor/golang.org/x/net/ipv4/icmp.go | 57 - .../golang.org/x/net/ipv4/icmp_linux.go | 25 - .../vendor/golang.org/x/net/ipv4/icmp_stub.go | 26 - .../vendor/golang.org/x/net/ipv4/packet.go | 117 - .../vendor/golang.org/x/net/ipv4/payload.go | 23 - .../golang.org/x/net/ipv4/payload_cmsg.go | 85 - .../golang.org/x/net/ipv4/payload_nocmsg.go | 40 - .../vendor/golang.org/x/net/ipv4/sockopt.go | 44 - .../golang.org/x/net/ipv4/sockopt_posix.go | 72 - .../golang.org/x/net/ipv4/sockopt_stub.go | 43 - .../vendor/golang.org/x/net/ipv4/sys_aix.go | 39 - .../golang.org/x/net/ipv4/sys_asmreq.go | 123 - .../golang.org/x/net/ipv4/sys_asmreq_stub.go | 26 - .../golang.org/x/net/ipv4/sys_asmreqn.go | 43 - .../golang.org/x/net/ipv4/sys_asmreqn_stub.go | 22 - .../vendor/golang.org/x/net/ipv4/sys_bpf.go | 25 - .../golang.org/x/net/ipv4/sys_bpf_stub.go | 17 - .../vendor/golang.org/x/net/ipv4/sys_bsd.go | 38 - .../golang.org/x/net/ipv4/sys_darwin.go | 65 - .../golang.org/x/net/ipv4/sys_dragonfly.go | 35 - .../golang.org/x/net/ipv4/sys_freebsd.go | 76 - .../vendor/golang.org/x/net/ipv4/sys_linux.go | 60 - .../golang.org/x/net/ipv4/sys_solaris.go | 57 - .../golang.org/x/net/ipv4/sys_ssmreq.go | 53 - .../golang.org/x/net/ipv4/sys_ssmreq_stub.go | 22 - .../vendor/golang.org/x/net/ipv4/sys_stub.go | 14 - .../golang.org/x/net/ipv4/sys_windows.go | 67 - .../vendor/golang.org/x/net/ipv4/sys_zos.go | 55 - .../golang.org/x/net/ipv4/zsys_aix_ppc64.go | 34 - .../golang.org/x/net/ipv4/zsys_darwin.go | 99 - .../golang.org/x/net/ipv4/zsys_dragonfly.go | 31 - .../golang.org/x/net/ipv4/zsys_freebsd_386.go | 93 - .../x/net/ipv4/zsys_freebsd_amd64.go | 95 - .../golang.org/x/net/ipv4/zsys_freebsd_arm.go | 95 - .../x/net/ipv4/zsys_freebsd_arm64.go | 93 - .../golang.org/x/net/ipv4/zsys_linux_386.go | 130 - .../golang.org/x/net/ipv4/zsys_linux_amd64.go | 132 - .../golang.org/x/net/ipv4/zsys_linux_arm.go | 130 - .../golang.org/x/net/ipv4/zsys_linux_arm64.go | 132 - .../golang.org/x/net/ipv4/zsys_linux_mips.go | 130 - .../x/net/ipv4/zsys_linux_mips64.go | 132 - .../x/net/ipv4/zsys_linux_mips64le.go | 132 - .../x/net/ipv4/zsys_linux_mipsle.go | 130 - .../golang.org/x/net/ipv4/zsys_linux_ppc.go | 130 - .../golang.org/x/net/ipv4/zsys_linux_ppc64.go | 132 - .../x/net/ipv4/zsys_linux_ppc64le.go | 132 - .../x/net/ipv4/zsys_linux_riscv64.go | 135 - .../golang.org/x/net/ipv4/zsys_linux_s390x.go | 132 - .../golang.org/x/net/ipv4/zsys_netbsd.go | 30 - .../golang.org/x/net/ipv4/zsys_openbsd.go | 30 - .../golang.org/x/net/ipv4/zsys_solaris.go | 100 - .../golang.org/x/net/ipv4/zsys_zos_s390x.go | 80 - .../vendor/golang.org/x/net/ipv6/batch.go | 116 - .../vendor/golang.org/x/net/ipv6/control.go | 187 - .../x/net/ipv6/control_rfc2292_unix.go | 49 - .../x/net/ipv6/control_rfc3542_unix.go | 95 - .../golang.org/x/net/ipv6/control_stub.go | 14 - .../golang.org/x/net/ipv6/control_unix.go | 56 - .../golang.org/x/net/ipv6/control_windows.go | 12 - .../vendor/golang.org/x/net/ipv6/dgramopt.go | 301 - .../vendor/golang.org/x/net/ipv6/doc.go | 243 - .../vendor/golang.org/x/net/ipv6/endpoint.go | 127 - .../golang.org/x/net/ipv6/genericopt.go | 56 - .../vendor/golang.org/x/net/ipv6/header.go | 55 - .../vendor/golang.org/x/net/ipv6/helper.go | 58 - .../vendor/golang.org/x/net/ipv6/iana.go | 86 - .../vendor/golang.org/x/net/ipv6/icmp.go | 60 - .../vendor/golang.org/x/net/ipv6/icmp_bsd.go | 30 - .../golang.org/x/net/ipv6/icmp_linux.go | 27 - .../golang.org/x/net/ipv6/icmp_solaris.go | 27 - .../vendor/golang.org/x/net/ipv6/icmp_stub.go | 24 - .../golang.org/x/net/ipv6/icmp_windows.go | 22 - .../vendor/golang.org/x/net/ipv6/icmp_zos.go | 29 - .../vendor/golang.org/x/net/ipv6/payload.go | 23 - .../golang.org/x/net/ipv6/payload_cmsg.go | 71 - .../golang.org/x/net/ipv6/payload_nocmsg.go | 39 - .../vendor/golang.org/x/net/ipv6/sockopt.go | 43 - .../golang.org/x/net/ipv6/sockopt_posix.go | 90 - .../golang.org/x/net/ipv6/sockopt_stub.go | 47 - .../vendor/golang.org/x/net/ipv6/sys_aix.go | 78 - .../golang.org/x/net/ipv6/sys_asmreq.go | 25 - .../golang.org/x/net/ipv6/sys_asmreq_stub.go | 18 - .../vendor/golang.org/x/net/ipv6/sys_bpf.go | 25 - .../golang.org/x/net/ipv6/sys_bpf_stub.go | 17 - .../vendor/golang.org/x/net/ipv6/sys_bsd.go | 58 - .../golang.org/x/net/ipv6/sys_darwin.go | 78 - .../golang.org/x/net/ipv6/sys_freebsd.go | 92 - .../vendor/golang.org/x/net/ipv6/sys_linux.go | 75 - .../golang.org/x/net/ipv6/sys_solaris.go | 74 - .../golang.org/x/net/ipv6/sys_ssmreq.go | 55 - .../golang.org/x/net/ipv6/sys_ssmreq_stub.go | 22 - .../vendor/golang.org/x/net/ipv6/sys_stub.go | 14 - .../golang.org/x/net/ipv6/sys_windows.go | 75 - .../vendor/golang.org/x/net/ipv6/sys_zos.go | 70 - .../golang.org/x/net/ipv6/zsys_aix_ppc64.go | 104 - .../golang.org/x/net/ipv6/zsys_darwin.go | 131 - .../golang.org/x/net/ipv6/zsys_dragonfly.go | 88 - .../golang.org/x/net/ipv6/zsys_freebsd_386.go | 122 - .../x/net/ipv6/zsys_freebsd_amd64.go | 124 - .../golang.org/x/net/ipv6/zsys_freebsd_arm.go | 124 - .../x/net/ipv6/zsys_freebsd_arm64.go | 122 - .../golang.org/x/net/ipv6/zsys_linux_386.go | 152 - .../golang.org/x/net/ipv6/zsys_linux_amd64.go | 154 - .../golang.org/x/net/ipv6/zsys_linux_arm.go | 152 - .../golang.org/x/net/ipv6/zsys_linux_arm64.go | 154 - .../golang.org/x/net/ipv6/zsys_linux_mips.go | 152 - .../x/net/ipv6/zsys_linux_mips64.go | 154 - .../x/net/ipv6/zsys_linux_mips64le.go | 154 - .../x/net/ipv6/zsys_linux_mipsle.go | 152 - .../golang.org/x/net/ipv6/zsys_linux_ppc.go | 152 - .../golang.org/x/net/ipv6/zsys_linux_ppc64.go | 154 - .../x/net/ipv6/zsys_linux_ppc64le.go | 154 - .../x/net/ipv6/zsys_linux_riscv64.go | 157 - .../golang.org/x/net/ipv6/zsys_linux_s390x.go | 154 - .../golang.org/x/net/ipv6/zsys_netbsd.go | 84 - .../golang.org/x/net/ipv6/zsys_openbsd.go | 93 - .../golang.org/x/net/ipv6/zsys_solaris.go | 131 - .../golang.org/x/net/ipv6/zsys_zos_s390x.go | 106 - .../vendor/golang.org/x/sys/cpu/cpu.go | 5 +- .../vendor/golang.org/x/sys/cpu/cpu_aix.go | 1 + .../vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 4 + .../golang.org/x/sys/cpu/cpu_gccgo_x86.go | 6 + .../vendor/golang.org/x/sys/cpu/cpu_x86.go | 10 +- .../vendor/golang.org/x/sys/cpu/cpu_x86.s | 24 + .../vendor/golang.org/x/sys/unix/README.md | 6 +- .../golang.org/x/sys/unix/asm_bsd_386.s | 4 +- .../golang.org/x/sys/unix/asm_bsd_arm.s | 4 +- .../vendor/golang.org/x/sys/unix/fdset.go | 4 +- .../vendor/golang.org/x/sys/unix/mkall.sh | 12 - .../vendor/golang.org/x/sys/unix/mkerrors.sh | 9 + .../x/sys/unix/syscall_darwin.1_13.go | 4 +- .../golang.org/x/sys/unix/syscall_darwin.go | 33 + .../x/sys/unix/syscall_darwin_386.go | 51 - .../x/sys/unix/syscall_darwin_arm.go | 51 - .../x/sys/unix/syscall_darwin_libSystem.go | 9 +- .../golang.org/x/sys/unix/syscall_linux.go | 71 + .../x/sys/unix/syscall_linux_386.go | 4 + .../x/sys/unix/syscall_linux_amd64.go | 4 + .../x/sys/unix/syscall_linux_arm.go | 4 + .../x/sys/unix/syscall_linux_arm64.go | 4 + .../x/sys/unix/syscall_linux_mips64x.go | 4 + .../x/sys/unix/syscall_linux_mipsx.go | 4 + .../x/sys/unix/syscall_linux_ppc.go | 4 + .../x/sys/unix/syscall_linux_ppc64x.go | 4 + .../x/sys/unix/syscall_linux_riscv64.go | 4 + .../x/sys/unix/syscall_linux_s390x.go | 4 + .../x/sys/unix/syscall_linux_sparc64.go | 4 + .../x/sys/unix/syscall_zos_s390x.go | 52 +- .../x/sys/unix/zerrors_darwin_386.go | 1789 --- .../x/sys/unix/zerrors_darwin_amd64.go | 5 + .../x/sys/unix/zerrors_darwin_arm.go | 1789 --- .../x/sys/unix/zerrors_darwin_arm64.go | 5 + .../x/sys/unix/zerrors_freebsd_386.go | 5 + .../x/sys/unix/zerrors_freebsd_amd64.go | 5 + .../x/sys/unix/zerrors_freebsd_arm.go | 5 + .../x/sys/unix/zerrors_freebsd_arm64.go | 5 + .../golang.org/x/sys/unix/zerrors_linux.go | 96 + .../x/sys/unix/zerrors_linux_386.go | 19 + .../x/sys/unix/zerrors_linux_amd64.go | 19 + .../x/sys/unix/zerrors_linux_arm.go | 19 + .../x/sys/unix/zerrors_linux_arm64.go | 19 + .../x/sys/unix/zerrors_linux_mips.go | 19 + .../x/sys/unix/zerrors_linux_mips64.go | 19 + .../x/sys/unix/zerrors_linux_mips64le.go | 19 + .../x/sys/unix/zerrors_linux_mipsle.go | 19 + .../x/sys/unix/zerrors_linux_ppc.go | 19 + .../x/sys/unix/zerrors_linux_ppc64.go | 19 + .../x/sys/unix/zerrors_linux_ppc64le.go | 19 + .../x/sys/unix/zerrors_linux_riscv64.go | 19 + .../x/sys/unix/zerrors_linux_s390x.go | 19 + .../x/sys/unix/zerrors_linux_sparc64.go | 19 + .../x/sys/unix/zerrors_zos_s390x.go | 22 + .../x/sys/unix/zsyscall_darwin_386.1_13.go | 40 - .../x/sys/unix/zsyscall_darwin_386.1_13.s | 13 - .../x/sys/unix/zsyscall_darwin_386.go | 2431 ---- .../x/sys/unix/zsyscall_darwin_386.s | 291 - .../x/sys/unix/zsyscall_darwin_amd64.1_13.go | 8 +- .../x/sys/unix/zsyscall_darwin_amd64.1_13.s | 18 +- .../x/sys/unix/zsyscall_darwin_amd64.go | 572 +- .../x/sys/unix/zsyscall_darwin_amd64.s | 852 +- .../x/sys/unix/zsyscall_darwin_arm.1_13.go | 40 - .../x/sys/unix/zsyscall_darwin_arm.1_13.s | 13 - .../x/sys/unix/zsyscall_darwin_arm.go | 2417 --- .../x/sys/unix/zsyscall_darwin_arm.s | 289 - .../x/sys/unix/zsyscall_darwin_arm64.1_13.go | 8 +- .../x/sys/unix/zsyscall_darwin_arm64.1_13.s | 18 +- .../x/sys/unix/zsyscall_darwin_arm64.go | 572 +- .../x/sys/unix/zsyscall_darwin_arm64.s | 852 +- .../x/sys/unix/zsyscall_zos_s390x.go | 42 +- .../x/sys/unix/zsysnum_darwin_386.go | 438 - .../x/sys/unix/zsysnum_darwin_arm.go | 438 - .../x/sys/unix/ztypes_darwin_386.go | 524 - .../x/sys/unix/ztypes_darwin_amd64.go | 104 + .../x/sys/unix/ztypes_darwin_arm.go | 524 - .../x/sys/unix/ztypes_darwin_arm64.go | 104 + .../x/sys/unix/ztypes_dragonfly_amd64.go | 3 + .../x/sys/unix/ztypes_freebsd_386.go | 5 +- .../x/sys/unix/ztypes_freebsd_amd64.go | 5 +- .../x/sys/unix/ztypes_freebsd_arm.go | 5 +- .../x/sys/unix/ztypes_freebsd_arm64.go | 5 +- .../golang.org/x/sys/unix/ztypes_linux.go | 163 + .../golang.org/x/sys/unix/ztypes_linux_386.go | 18 +- .../x/sys/unix/ztypes_linux_amd64.go | 18 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 18 +- .../x/sys/unix/ztypes_linux_arm64.go | 18 +- .../x/sys/unix/ztypes_linux_mips.go | 18 +- .../x/sys/unix/ztypes_linux_mips64.go | 18 +- .../x/sys/unix/ztypes_linux_mips64le.go | 18 +- .../x/sys/unix/ztypes_linux_mipsle.go | 18 +- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 18 +- .../x/sys/unix/ztypes_linux_ppc64.go | 18 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 18 +- .../x/sys/unix/ztypes_linux_riscv64.go | 18 +- .../x/sys/unix/ztypes_linux_s390x.go | 18 +- .../x/sys/unix/ztypes_linux_sparc64.go | 18 +- .../x/sys/unix/ztypes_netbsd_386.go | 4 +- .../x/sys/unix/ztypes_netbsd_amd64.go | 4 +- .../x/sys/unix/ztypes_netbsd_arm.go | 4 +- .../x/sys/unix/ztypes_netbsd_arm64.go | 4 +- .../x/sys/unix/ztypes_openbsd_386.go | 4 +- .../x/sys/unix/ztypes_openbsd_amd64.go | 4 +- .../x/sys/unix/ztypes_openbsd_arm.go | 4 +- .../x/sys/unix/ztypes_openbsd_arm64.go | 4 +- .../x/sys/unix/ztypes_openbsd_mips64.go | 4 +- .../golang.org/x/sys/unix/ztypes_zos_s390x.go | 4 + .../vendor/golang.org/x/sys/windows/empty.s | 1 + .../golang.org/x/sys/windows/exec_windows.go | 81 +- .../x/sys/windows/syscall_windows.go | 1 + .../golang.org/x/sys/windows/types_windows.go | 17 +- .../x/sys/windows/zsyscall_windows.go | 13 + .../api/annotations/annotations.pb.go | 124 + .../googleapis/api/annotations/client.pb.go | 219 + .../api/annotations/field_behavior.pb.go | 246 + .../googleapis/api/annotations/http.pb.go | 783 + .../googleapis/api/annotations/resource.pb.go | 721 + .../googleapis/api/httpbody/httpbody.pb.go | 237 + .../protobuf/field_mask/field_mask.go | 23 + .../vendor/google.golang.org/grpc/.travis.yml | 18 +- .../google.golang.org/grpc/CONTRIBUTING.md | 1 - .../vendor/google.golang.org/grpc/Makefile | 31 +- .../vendor/google.golang.org/grpc/README.md | 132 +- .../vendor/google.golang.org/grpc/SECURITY.md | 3 + .../grpc/attributes/attributes.go | 11 +- .../vendor/google.golang.org/grpc/backoff.go | 5 +- .../vendor/google.golang.org/grpc/balancer.go | 391 - .../grpc/balancer/balancer.go | 174 +- .../grpc/balancer/base/balancer.go | 204 +- .../grpc/balancer/base/base.go | 28 +- .../grpc/balancer/grpclb/state/state.go | 51 + .../grpc/balancer/roundrobin/roundrobin.go | 10 +- .../grpc/balancer_conn_wrappers.go | 45 +- .../grpc/balancer_v1_wrapper.go | 334 - .../grpc_binarylog_v1/binarylog.pb.go | 1369 +- .../google.golang.org/grpc/clientconn.go | 276 +- .../google.golang.org/grpc/codes/codes.go | 46 + .../grpc/connectivity/connectivity.go | 16 +- .../grpc/credentials/credentials.go | 83 +- .../google.golang.org/grpc/credentials/tls.go | 86 +- .../google.golang.org/grpc/dialoptions.go | 134 +- .../vendor/google.golang.org/grpc/doc.go | 2 + .../grpc/encoding/encoding.go | 12 +- .../grpc/encoding/gzip/gzip.go | 133 + .../grpc/encoding/proto/proto.go | 70 +- .../vendor/google.golang.org/grpc/go.mod | 13 +- .../vendor/google.golang.org/grpc/go.sum | 53 +- .../grpc/grpclog/component.go | 117 + .../google.golang.org/grpc/grpclog/grpclog.go | 42 +- .../google.golang.org/grpc/grpclog/logger.go | 4 +- .../grpc/grpclog/loggerv2.go | 28 +- .../google.golang.org/grpc/install_gae.sh | 2 +- .../google.golang.org/grpc/interceptor.go | 36 +- .../grpc/internal/binarylog/binarylog.go | 7 +- .../grpc/internal/binarylog/env_config.go | 4 +- .../grpc/internal/binarylog/method_logger.go | 15 +- .../grpc/internal/binarylog/regenerate.sh | 33 - .../grpc/internal/binarylog/sink.go | 71 +- .../grpc/internal/binarylog/util.go | 41 - .../grpc/internal/channelz/funcs.go | 18 +- .../grpc/internal/channelz/logging.go | 102 + .../grpc/internal/channelz/types.go | 33 +- .../grpc/internal/channelz/types_nonlinux.go | 4 +- .../grpc/internal/credentials/credentials.go | 49 + .../grpc/internal/credentials/spiffe.go | 77 + .../credentials/spiffe_appengine.go} | 21 +- .../credentials}/syscallconn.go | 3 +- .../credentials}/syscallconn_appengine.go | 2 +- .../grpc/internal/credentials/util.go | 50 + .../grpc/internal/envconfig/envconfig.go | 2 +- .../grpc/internal/grpclog/grpclog.go | 126 + .../grpc/internal/grpclog/prefixLogger.go | 81 + .../grpc/internal/grpcutil/encode_duration.go | 63 + .../grpc/internal/grpcutil/metadata.go | 40 + .../grpc/internal/grpcutil/method.go | 84 + .../grpc/internal/grpcutil/target.go | 89 + .../grpc/internal/internal.go | 32 +- .../grpc/internal/metadata/metadata.go | 50 + .../grpc/internal/resolver/config_selector.go | 164 + .../internal/resolver/dns/dns_resolver.go | 64 +- .../grpc/internal/resolver/unix/unix.go | 63 + .../internal/serviceconfig/serviceconfig.go | 178 + .../grpc/internal/status/status.go | 162 + .../grpc/internal/syscall/syscall_linux.go | 26 +- .../grpc/internal/syscall/syscall_nonlinux.go | 7 +- .../grpc/internal/transport/controlbuf.go | 108 +- .../grpc/internal/transport/handler_server.go | 80 +- .../grpc/internal/transport/http2_client.go | 238 +- .../grpc/internal/transport/http2_server.go | 129 +- .../grpc/internal/transport/http_util.go | 139 +- .../grpc/internal/transport/log.go | 44 - .../transport/networktype/networktype.go | 46 + .../grpc/{ => internal/transport}/proxy.go | 52 +- .../grpc/internal/transport/transport.go | 26 +- .../grpc/internal/xds_handshake_cluster.go | 40 + .../grpc/metadata/metadata.go | 26 +- .../grpc/naming/dns_resolver.go | 293 - .../google.golang.org/grpc/naming/naming.go | 68 - .../google.golang.org/grpc/picker_wrapper.go | 76 +- .../google.golang.org/grpc/pickfirst.go | 53 +- .../google.golang.org/grpc/preloader.go | 5 +- .../google.golang.org/grpc/regenerate.sh | 119 + .../grpc/resolver/dns/dns_resolver.go | 36 - .../grpc/resolver/manual/manual.go | 80 + .../grpc/resolver/resolver.go | 13 +- .../grpc/resolver_conn_wrapper.go | 120 +- .../vendor/google.golang.org/grpc/rpc_util.go | 208 +- .../vendor/google.golang.org/grpc/server.go | 508 +- .../google.golang.org/grpc/service_config.go | 206 +- .../grpc/serviceconfig/serviceconfig.go | 5 +- .../google.golang.org/grpc/stats/stats.go | 21 +- .../google.golang.org/grpc/status/status.go | 127 +- .../vendor/google.golang.org/grpc/stream.go | 153 +- .../vendor/google.golang.org/grpc/tap/tap.go | 23 +- .../vendor/google.golang.org/grpc/version.go | 2 +- .../vendor/google.golang.org/grpc/vet.sh | 152 +- .../protobuf/encoding/protojson/decode.go | 665 + .../protobuf/encoding/protojson/doc.go | 11 + .../protobuf/encoding/protojson/encode.go | 344 + .../encoding/protojson/well_known_types.go | 889 ++ .../protobuf/encoding/prototext/decode.go | 30 +- .../protobuf/encoding/prototext/encode.go | 84 +- .../protobuf/internal/descfmt/stringer.go | 2 + .../protobuf/internal/detrand/rand.go | 8 + .../protobuf/internal/encoding/json/decode.go | 340 + .../internal/encoding/json/decode_number.go | 254 + .../internal/encoding/json/decode_string.go | 91 + .../internal/encoding/json/decode_token.go | 192 + .../protobuf/internal/encoding/json/encode.go | 276 + .../encoding/messageset/messageset.go | 33 +- .../protobuf/internal/encoding/tag/tag.go | 2 +- .../protobuf/internal/encoding/text/encode.go | 8 +- .../protobuf/internal/fieldsort/fieldsort.go | 40 - .../protobuf/internal/filedesc/build.go | 3 + .../protobuf/internal/filedesc/desc.go | 77 +- .../protobuf/internal/filedesc/desc_lazy.go | 4 +- .../protobuf/internal/filedesc/desc_list.go | 172 +- .../internal/filedesc/desc_list_gen.go | 11 + .../protobuf/internal/impl/api_export.go | 2 +- .../protobuf/internal/impl/codec_field.go | 18 +- .../protobuf/internal/impl/codec_gen.go | 974 +- .../protobuf/internal/impl/codec_map.go | 19 +- .../protobuf/internal/impl/codec_message.go | 68 +- .../internal/impl/codec_messageset.go | 21 +- .../protobuf/internal/impl/codec_reflect.go | 8 +- .../protobuf/internal/impl/convert.go | 29 + .../protobuf/internal/impl/decode.go | 16 +- .../protobuf/internal/impl/encode.go | 10 +- .../protobuf/internal/impl/legacy_export.go | 2 +- .../internal/impl/legacy_extension.go | 3 +- .../protobuf/internal/impl/legacy_message.go | 122 +- .../protobuf/internal/impl/merge.go | 6 +- .../protobuf/internal/impl/message.go | 69 +- .../protobuf/internal/impl/message_reflect.go | 125 +- .../internal/impl/message_reflect_field.go | 85 +- .../protobuf/internal/impl/pointer_reflect.go | 1 + .../protobuf/internal/impl/pointer_unsafe.go | 1 + .../protobuf/internal/mapsort/mapsort.go | 43 - .../protobuf/internal/order/order.go | 89 + .../protobuf/internal/order/range.go | 115 + .../protobuf/internal/version/version.go | 2 +- .../protobuf/proto/decode.go | 18 +- .../protobuf/proto/decode_gen.go | 128 +- .../protobuf/proto/encode.go | 55 +- .../google.golang.org/protobuf/proto/equal.go | 25 +- .../protobuf/proto/messageset.go | 7 +- .../google.golang.org/protobuf/proto/proto.go | 9 + .../protobuf/reflect/protodesc/desc.go | 276 + .../protobuf/reflect/protodesc/desc_init.go | 248 + .../reflect/protodesc/desc_resolve.go | 286 + .../reflect/protodesc/desc_validate.go | 374 + .../protobuf/reflect/protodesc/proto.go | 252 + .../protobuf/reflect/protoreflect/source.go | 84 +- .../reflect/protoreflect/source_gen.go | 461 + .../protobuf/reflect/protoreflect/type.go | 34 + .../reflect/protoregistry/registry.go | 157 +- .../types/descriptorpb/descriptor.pb.go | 19 +- .../protobuf/types/known/anypb/any.pb.go | 22 +- .../types/known/durationpb/duration.pb.go | 20 +- .../types/known/fieldmaskpb/field_mask.pb.go | 591 + .../types/known/timestamppb/timestamp.pb.go | 29 +- .../types/known/wrapperspb/wrappers.pb.go | 19 +- .../vendor/gopkg.in/yaml.v3/.travis.yml | 17 - .../vendor/gopkg.in/yaml.v3/decode.go | 6 +- .../vendor/gopkg.in/yaml.v3/emitterc.go | 34 +- .../vendor/gopkg.in/yaml.v3/encode.go | 5 + .../vendor/gopkg.in/yaml.v3/scannerc.go | 28 +- .../vendor/gopkg.in/yaml.v3/yaml.go | 5 + .../vendor/k8s.io/api/apps/v1/generated.pb.go | 526 +- .../vendor/k8s.io/api/apps/v1/generated.proto | 28 +- .../vendor/k8s.io/api/apps/v1/types.go | 45 +- .../apps/v1/types_swagger_doc_generated.go | 33 +- .../api/apps/v1/zz_generated.deepcopy.go | 21 + .../k8s.io/api/apps/v1beta1/generated.pb.go | 503 +- .../k8s.io/api/apps/v1beta1/generated.proto | 23 + .../vendor/k8s.io/api/apps/v1beta1/types.go | 40 + .../v1beta1/types_swagger_doc_generated.go | 31 +- .../api/apps/v1beta1/zz_generated.deepcopy.go | 21 + .../k8s.io/api/apps/v1beta2/generated.pb.go | 543 +- .../k8s.io/api/apps/v1beta2/generated.proto | 25 +- .../vendor/k8s.io/api/apps/v1beta2/types.go | 42 +- .../v1beta2/types_swagger_doc_generated.go | 33 +- .../api/apps/v1beta2/zz_generated.deepcopy.go | 21 + .../k8s.io/api/authentication/v1/types.go | 3 + .../k8s.io/api/autoscaling/v2beta2/types.go | 2 +- .../zz_generated.prerelease-lifecycle.go | 4 +- .../k8s.io/api/batch/v1/generated.proto | 8 +- .../vendor/k8s.io/api/batch/v1/types.go | 8 +- .../batch/v1/types_swagger_doc_generated.go | 2 +- .../api/certificates/v1/generated.pb.go | 143 +- .../api/certificates/v1/generated.proto | 26 +- .../k8s.io/api/certificates/v1/types.go | 26 +- .../v1/types_swagger_doc_generated.go | 19 +- .../certificates/v1/zz_generated.deepcopy.go | 5 + .../api/certificates/v1beta1/generated.pb.go | 143 +- .../api/certificates/v1beta1/generated.proto | 33 +- .../k8s.io/api/certificates/v1beta1/types.go | 35 +- .../v1beta1/types_swagger_doc_generated.go | 19 +- .../v1beta1/zz_generated.deepcopy.go | 5 + .../vendor/k8s.io/api/core/v1/generated.pb.go | 1531 +- .../vendor/k8s.io/api/core/v1/generated.proto | 49 +- .../vendor/k8s.io/api/core/v1/types.go | 93 +- .../core/v1/types_swagger_doc_generated.go | 15 +- .../api/core/v1/zz_generated.deepcopy.go | 5 + .../api/extensions/v1beta1/generated.proto | 6 +- .../k8s.io/api/extensions/v1beta1/types.go | 6 +- .../v1beta1/types_swagger_doc_generated.go | 4 +- .../api/flowcontrol/v1alpha1/generated.proto | 4 + .../k8s.io/api/flowcontrol/v1alpha1/types.go | 4 + .../v1alpha1/types_swagger_doc_generated.go | 7 +- .../api/flowcontrol/v1beta1/generated.proto | 4 + .../k8s.io/api/flowcontrol/v1beta1/types.go | 4 + .../v1beta1/types_swagger_doc_generated.go | 7 +- .../k8s.io/api/networking/v1/generated.proto | 4 +- .../vendor/k8s.io/api/networking/v1/types.go | 6 +- .../v1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/storage/v1/generated.proto | 6 - .../vendor/k8s.io/api/storage/v1/types.go | 6 - .../storage/v1/types_swagger_doc_generated.go | 4 +- .../api/storage/v1beta1/generated.proto | 6 - .../k8s.io/api/storage/v1beta1/types.go | 6 - .../v1beta1/types_swagger_doc_generated.go | 4 +- .../apimachinery/pkg/apis/meta/v1/helpers.go | 10 +- .../pkg/apis/meta/v1/validation/validation.go | 1 + .../apimachinery/pkg/labels/selector.go | 10 +- .../pkg/util/cache/lruexpirecache.go | 94 +- .../pkg/admission/metrics/metrics.go | 22 +- .../plugin/webhook/mutating/dispatcher.go | 6 +- .../plugin/webhook/validating/dispatcher.go | 6 +- .../apiserver/pkg/apis/apiserver/register.go | 1 + .../apiserver/pkg/apis/apiserver/types.go | 20 + .../pkg/apis/apiserver/v1alpha1/doc.go | 1 + .../pkg/apis/apiserver/v1alpha1/register.go | 8 + .../pkg/apis/apiserver/v1alpha1/types.go | 20 + .../v1alpha1/zz_generated.conversion.go | 32 + .../v1alpha1/zz_generated.deepcopy.go | 35 + .../apis/apiserver/zz_generated.deepcopy.go | 35 + .../authenticatorfactory/delegating.go | 7 +- .../authenticatorfactory/metrics.go | 69 + .../authorizerfactory/delegating.go | 6 +- .../authorizerfactory/metrics.go | 69 + .../apiserver/pkg/endpoints/filters/audit.go | 1 + .../pkg/endpoints/filters/impersonation.go | 19 +- .../apiserver/pkg/endpoints/filters/traces.go | 40 + .../pkg/endpoints/metrics/metrics.go | 23 +- .../apiserver/pkg/features/kube_features.go | 7 + .../generic/registry/storage_factory.go | 9 +- .../pkg/registry/generic/registry/store.go | 13 +- .../apiserver/pkg/registry/rest/delete.go | 19 + .../k8s.io/apiserver/pkg/server/config.go | 35 +- .../pkg/server/deprecated_insecure_serving.go | 2 +- .../server/egressselector/egress_selector.go | 13 +- .../server/filters/priority-and-fairness.go | 16 +- .../apiserver/pkg/server/genericapiserver.go | 64 +- .../k8s.io/apiserver/pkg/server/healthz.go | 5 +- .../apiserver/pkg/server/healthz/healthz.go | 26 +- .../apiserver/pkg/server/httplog/httplog.go | 14 +- .../apiserver/pkg/server/lifecycle_signals.go | 143 + .../pkg/server/options/authentication.go | 2 +- .../pkg/server/options/authorization.go | 2 +- .../apiserver/pkg/server/options/coreapi.go | 6 + .../apiserver/pkg/server/options/etcd.go | 11 + .../pkg/server/options/recommended.go | 22 +- .../pkg/server/options/server_run_options.go | 12 +- .../apiserver/pkg/server/options/tracing.go | 127 + .../apiserver/pkg/server/secure_serving.go | 72 +- .../apiserver/pkg/storage/cacher/cacher.go | 36 +- .../apiserver/pkg/storage/etcd3/compact.go | 2 +- .../apiserver/pkg/storage/etcd3/errors.go | 2 +- .../etcd3/etcd_object_count_tracker.go | 62 + .../apiserver/pkg/storage/etcd3/event.go | 4 +- .../pkg/storage/etcd3/lease_manager.go | 2 +- .../apiserver/pkg/storage/etcd3/logger.go | 16 +- .../apiserver/pkg/storage/etcd3/store.go | 2 +- .../apiserver/pkg/storage/etcd3/watcher.go | 2 +- .../pkg/storage/storagebackend/config.go | 2 + .../storage/storagebackend/factory/etcd3.go | 25 +- .../value/encrypt/envelope/envelope.go | 8 +- .../apiserver/pkg/storage/value/metrics.go | 4 +- .../k8s.io/apiserver/pkg/tracing/config.go | 115 + .../pkg/util/flowcontrol/apf_controller.go | 15 +- .../pkg/util/flowcontrol/apf_filter.go | 3 + .../util/flowcontrol/fairqueuing/interface.go | 3 +- .../fairqueuing/queueset/fifo_list.go | 27 +- .../fairqueuing/queueset/queueset.go | 127 +- .../flowcontrol/fairqueuing/queueset/types.go | 14 +- .../pkg/util/flowcontrol/metrics/metrics.go | 92 + .../request/object_count_tracker.go | 67 + .../pkg/util/flowcontrol/request/width.go | 47 + .../pkg/util/flowcontrol/watch_tracker.go | 148 + .../apiserver/pkg/util/webhook/client.go | 7 +- .../authenticator/token/webhook/metrics.go | 35 + .../authenticator/token/webhook/webhook.go | 100 +- .../plugin/pkg/authorizer/webhook/metrics.go | 35 + .../plugin/pkg/authorizer/webhook/webhook.go | 91 +- .../v1/mutatingwebhookconfiguration.go | 2 +- .../v1/validatingwebhookconfiguration.go | 2 +- .../v1beta1/mutatingwebhookconfiguration.go | 2 +- .../v1beta1/validatingwebhookconfiguration.go | 2 +- .../v1alpha1/storageversion.go | 2 +- .../apps/v1/controllerrevision.go | 2 +- .../applyconfigurations/apps/v1/daemonset.go | 2 +- .../applyconfigurations/apps/v1/deployment.go | 2 +- .../applyconfigurations/apps/v1/replicaset.go | 2 +- .../apps/v1/statefulset.go | 2 +- ...setpersistentvolumeclaimretentionpolicy.go | 52 + .../apps/v1/statefulsetspec.go | 27 +- .../apps/v1beta1/controllerrevision.go | 2 +- .../apps/v1beta1/deployment.go | 2 +- .../apps/v1beta1/statefulset.go | 2 +- ...setpersistentvolumeclaimretentionpolicy.go | 52 + .../apps/v1beta1/statefulsetspec.go | 27 +- .../apps/v1beta2/controllerrevision.go | 2 +- .../apps/v1beta2/daemonset.go | 2 +- .../apps/v1beta2/deployment.go | 2 +- .../apps/v1beta2/replicaset.go | 2 +- .../apps/v1beta2/statefulset.go | 2 +- ...setpersistentvolumeclaimretentionpolicy.go | 52 + .../apps/v1beta2/statefulsetspec.go | 27 +- .../autoscaling/v1/horizontalpodautoscaler.go | 2 +- .../v2beta1/horizontalpodautoscaler.go | 2 +- .../v2beta2/horizontalpodautoscaler.go | 2 +- .../applyconfigurations/batch/v1/cronjob.go | 2 +- .../applyconfigurations/batch/v1/job.go | 2 +- .../batch/v1beta1/cronjob.go | 2 +- .../v1/certificatesigningrequest.go | 2 +- .../v1/certificatesigningrequestspec.go | 23 +- .../v1beta1/certificatesigningrequest.go | 2 +- .../v1beta1/certificatesigningrequestspec.go | 23 +- .../coordination/v1/lease.go | 2 +- .../coordination/v1beta1/lease.go | 2 +- .../core/v1/componentstatus.go | 2 +- .../applyconfigurations/core/v1/configmap.go | 2 +- .../applyconfigurations/core/v1/endpoints.go | 2 +- .../applyconfigurations/core/v1/event.go | 2 +- .../applyconfigurations/core/v1/limitrange.go | 2 +- .../applyconfigurations/core/v1/namespace.go | 2 +- .../applyconfigurations/core/v1/node.go | 2 +- .../core/v1/persistentvolume.go | 2 +- .../core/v1/persistentvolumeclaim.go | 2 +- .../core/v1/persistentvolumeclaimspec.go | 9 + .../applyconfigurations/core/v1/pod.go | 2 +- .../core/v1/podtemplate.go | 2 +- .../core/v1/replicationcontroller.go | 2 +- .../core/v1/resourcequota.go | 2 +- .../applyconfigurations/core/v1/secret.go | 2 +- .../applyconfigurations/core/v1/service.go | 2 +- .../core/v1/serviceaccount.go | 2 +- .../discovery/v1/endpointslice.go | 2 +- .../discovery/v1beta1/endpointslice.go | 2 +- .../applyconfigurations/events/v1/event.go | 2 +- .../events/v1beta1/event.go | 2 +- .../extensions/v1beta1/daemonset.go | 2 +- .../extensions/v1beta1/deployment.go | 2 +- .../extensions/v1beta1/ingress.go | 2 +- .../extensions/v1beta1/networkpolicy.go | 2 +- .../extensions/v1beta1/podsecuritypolicy.go | 2 +- .../extensions/v1beta1/replicaset.go | 2 +- .../flowcontrol/v1alpha1/flowschema.go | 2 +- .../v1alpha1/prioritylevelconfiguration.go | 2 +- .../flowcontrol/v1beta1/flowschema.go | 2 +- .../v1beta1/prioritylevelconfiguration.go | 2 +- .../applyconfigurations/internal/internal.go | 45 + .../networking/v1/ingress.go | 2 +- .../networking/v1/ingressclass.go | 2 +- .../networking/v1/networkpolicy.go | 2 +- .../networking/v1beta1/ingress.go | 2 +- .../networking/v1beta1/ingressclass.go | 2 +- .../node/v1/runtimeclass.go | 2 +- .../node/v1alpha1/runtimeclass.go | 2 +- .../node/v1beta1/runtimeclass.go | 2 +- .../applyconfigurations/policy/v1/eviction.go | 2 +- .../policy/v1/poddisruptionbudget.go | 2 +- .../policy/v1beta1/eviction.go | 2 +- .../policy/v1beta1/poddisruptionbudget.go | 2 +- .../policy/v1beta1/podsecuritypolicy.go | 2 +- .../rbac/v1/clusterrole.go | 2 +- .../rbac/v1/clusterrolebinding.go | 2 +- .../applyconfigurations/rbac/v1/role.go | 2 +- .../rbac/v1/rolebinding.go | 2 +- .../rbac/v1alpha1/clusterrole.go | 2 +- .../rbac/v1alpha1/clusterrolebinding.go | 2 +- .../applyconfigurations/rbac/v1alpha1/role.go | 2 +- .../rbac/v1alpha1/rolebinding.go | 2 +- .../rbac/v1beta1/clusterrole.go | 2 +- .../rbac/v1beta1/clusterrolebinding.go | 2 +- .../applyconfigurations/rbac/v1beta1/role.go | 2 +- .../rbac/v1beta1/rolebinding.go | 2 +- .../scheduling/v1/priorityclass.go | 2 +- .../scheduling/v1alpha1/priorityclass.go | 2 +- .../scheduling/v1beta1/priorityclass.go | 2 +- .../storage/v1/csidriver.go | 2 +- .../applyconfigurations/storage/v1/csinode.go | 2 +- .../storage/v1/storageclass.go | 2 +- .../storage/v1/volumeattachment.go | 2 +- .../storage/v1alpha1/csistoragecapacity.go | 2 +- .../storage/v1alpha1/volumeattachment.go | 2 +- .../storage/v1beta1/csidriver.go | 2 +- .../storage/v1beta1/csinode.go | 2 +- .../storage/v1beta1/csistoragecapacity.go | 2 +- .../storage/v1beta1/storageclass.go | 2 +- .../storage/v1beta1/volumeattachment.go | 2 +- .../client-go/discovery/discovery_client.go | 2 +- .../clientauthentication/install/install.go | 36 + .../pkg/apis/clientauthentication/types.go | 2 +- .../clientauthentication/v1/conversion.go | 28 + .../pkg/apis/clientauthentication/v1/doc.go | 24 + .../apis/clientauthentication/v1/register.go | 55 + .../pkg/apis/clientauthentication/v1/types.go | 122 + .../v1/zz_generated.conversion.go | 200 + .../v1/zz_generated.deepcopy.go | 119 + .../v1/zz_generated.defaults.go | 32 + .../v1beta1/conversion.go | 2 +- .../clientauthentication/v1beta1/types.go | 3 + .../v1beta1/zz_generated.conversion.go | 3 +- .../plugin/pkg/client/auth/exec/exec.go | 78 +- .../vendor/k8s.io/client-go/rest/request.go | 4 +- .../k8s.io/client-go/testing/fixture.go | 8 +- .../k8s.io/client-go/tools/cache/reflector.go | 4 +- .../client-go/tools/clientcmd/api/types.go | 49 +- .../tools/clientcmd/api/v1/defaults.go | 37 + .../client-go/tools/clientcmd/api/v1/doc.go | 1 + .../tools/clientcmd/api/v1/register.go | 2 +- .../client-go/tools/clientcmd/api/v1/types.go | 32 + .../api/v1/zz_generated.conversion.go | 4 + .../clientcmd/api/v1/zz_generated.defaults.go | 42 + .../client-go/tools/clientcmd/validation.go | 8 + .../util/certificate/certificate_manager.go | 41 +- .../client-go/util/certificate/csr/csr.go | 21 +- .../vendor/k8s.io/cloud-provider/go.mod | 30 +- .../vendor/k8s.io/cloud-provider/go.sum | 291 +- .../cli/flag/string_slice_flag.go | 9 +- .../featuregate/feature_gate.go | 11 + .../vendor/k8s.io/component-base/logs/OWNERS | 3 + .../k8s.io/component-base/logs/config.go | 13 +- .../k8s.io/component-base/logs/json/json.go | 180 - .../k8s.io/component-base/logs/options.go | 31 +- .../k8s.io/component-base/logs/validate.go | 15 +- .../metrics/legacyregistry/registry.go | 2 + .../k8s.io/component-base/traces/OWNERS | 8 + .../k8s.io/component-base/traces/utils.go | 80 + .../pkg/apis/runtime/v1alpha2/api.pb.go | 859 +- .../pkg/apis/runtime/v1alpha2/api.proto | 6 + .../vendor/k8s.io/csi-translation-lib/go.mod | 8 +- .../vendor/k8s.io/csi-translation-lib/go.sum | 42 +- .../kube-scheduler/config/v1beta1/register.go | 1 + .../config/v1beta1/types_pluginargs.go | 85 +- .../config/v1beta1/zz_generated.deepcopy.go | 87 + .../config/v1beta2}/doc.go | 9 +- .../kube-scheduler/config/v1beta2/register.go | 50 + .../kube-scheduler/config/v1beta2/types.go | 311 + .../config/v1beta2/types_pluginargs.go | 226 + .../config/v1beta2/zz_generated.deepcopy.go | 565 + .../k8s.io/kubelet/config/v1beta1/types.go | 482 +- .../config/v1beta1/zz_generated.deepcopy.go | 22 + .../pkg/apis/podresources/v1/api.pb.go | 487 +- .../pkg/apis/podresources/v1/api.proto | 9 + .../kubernetes/cmd/kube-proxy/app/server.go | 21 +- .../cmd/kube-proxy/app/server_others.go | 10 +- .../cmd/kube-proxy/app/server_windows.go | 8 +- .../k8s.io/kubernetes/cmd/kubelet/app/auth.go | 12 +- .../cmd/kubelet/app/options/options.go | 27 +- .../kubernetes/cmd/kubelet/app/server.go | 24 +- .../k8s.io/kubernetes/pkg/api/pod/util.go | 32 - .../k8s.io/kubernetes/pkg/apis/apps/types.go | 42 +- .../pkg/apis/apps/validation/validation.go | 27 +- .../pkg/apis/apps/zz_generated.deepcopy.go | 21 + .../k8s.io/kubernetes/pkg/apis/batch/types.go | 8 +- .../pkg/apis/core/helper/helpers.go | 17 +- .../k8s.io/kubernetes/pkg/apis/core/types.go | 80 +- .../pkg/apis/core/v1/helper/helpers.go | 17 +- .../apis/core/v1/zz_generated.conversion.go | 2 + .../pkg/apis/core/validation/validation.go | 204 +- .../pkg/apis/core/zz_generated.deepcopy.go | 5 + .../kubernetes/pkg/apis/networking/types.go | 4 +- .../pkg/credentialprovider/plugin/plugin.go | 67 +- .../kubernetes/pkg/features/kube_features.go | 174 +- .../pkg/kubelet/apis/config/types.go | 15 + .../kubelet/apis/config/v1beta1/defaults.go | 3 + .../config/v1beta1/zz_generated.conversion.go | 42 + .../apis/config/validation/validation.go | 16 +- .../apis/config/zz_generated.deepcopy.go | 17 + .../kubelet/apis/podresources/server_v1.go | 6 +- .../pkg/kubelet/apis/podresources/types.go | 7 + .../certificate/bootstrap/bootstrap.go | 2 +- .../checkpointmanager/checkpoint_manager.go | 2 +- .../pkg/kubelet/cm/container_manager.go | 3 +- .../pkg/kubelet/cm/container_manager_linux.go | 57 +- .../pkg/kubelet/cm/container_manager_stub.go | 8 + .../kubelet/cm/container_manager_windows.go | 8 + .../pkg/kubelet/cm/cpumanager/cpu_manager.go | 12 +- .../pkg/kubelet/cm/cpuset/cpuset.go | 2 +- .../pkg/kubelet/cm/devicemanager/endpoint.go | 2 +- .../pkg/kubelet/cm/fake_container_manager.go | 13 + .../pkg/kubelet/cm/helpers_linux.go | 5 +- .../cm/memorymanager/fake_memory_manager.go | 16 +- .../cm/memorymanager/memory_manager.go | 57 +- .../pkg/kubelet/cm/memorymanager/policy.go | 4 +- .../kubelet/cm/memorymanager/policy_none.go | 8 +- .../kubelet/cm/memorymanager/policy_static.go | 281 +- .../kubernetes/pkg/kubelet/config/common.go | 15 +- .../k8s.io/kubernetes/pkg/kubelet/kubelet.go | 29 +- .../kubernetes/pkg/kubelet/kubelet_pods.go | 85 +- .../kubernetes/pkg/kubelet/kubelet_volumes.go | 126 +- .../pkg/kubelet/kubeletconfig/controller.go | 2 +- .../pkg/kubelet/kuberuntime/helpers.go | 40 +- .../kuberuntime_container_linux.go | 18 + .../kuberuntime/kuberuntime_manager.go | 10 + .../kubelet/kuberuntime/security_context.go | 4 +- .../metrics/collectors/resource_metrics.go | 17 + .../kubernetes/pkg/kubelet/metrics/metrics.go | 36 +- .../nodeshutdown_manager_linux.go | 70 +- .../nodeshutdown/systemd/inhibit_linux.go | 18 +- .../kubernetes/pkg/kubelet/pod_workers.go | 3 +- .../kubernetes/pkg/kubelet/server/server.go | 4 +- .../kubernetes/pkg/kubelet/types/constants.go | 6 + .../cache/actual_state_of_world.go | 83 + .../desired_state_of_world_populator.go | 4 +- .../kubelet/volumemanager/volume_manager.go | 21 + .../volumemanager/volume_manager_fake.go | 7 +- .../kubernetes/pkg/kubemark/hollow_proxy.go | 6 +- .../kubernetes/pkg/proxy/config/config.go | 4 +- .../k8s.io/kubernetes/pkg/proxy/endpoints.go | 53 +- .../pkg/proxy/endpointslicecache.go | 28 +- .../pkg/proxy/healthcheck/proxier_health.go | 12 +- .../pkg/proxy/healthcheck/service_health.go | 12 +- .../kubernetes/pkg/proxy/iptables/proxier.go | 123 +- .../kubernetes/pkg/proxy/ipvs/proxier.go | 103 +- .../pkg/proxy/metaproxier/meta_proxier.go | 2 +- .../k8s.io/kubernetes/pkg/proxy/service.go | 6 +- .../k8s.io/kubernetes/pkg/proxy/topology.go | 22 +- .../k8s.io/kubernetes/pkg/proxy/types.go | 6 +- .../kubernetes/pkg/proxy/userspace/proxier.go | 9 +- .../kubernetes/pkg/proxy/util/network.go | 14 +- .../k8s.io/kubernetes/pkg/proxy/util/utils.go | 45 +- .../kubernetes/pkg/proxy/winkernel/proxier.go | 68 +- .../pkg/proxy/winuserspace/proxier.go | 2 - .../pkg/proxy/winuserspace/proxysocket.go | 351 +- .../scheduler/algorithmprovider/registry.go | 144 - .../pkg/scheduler/apis/config/OWNERS | 3 - .../scheduler/apis/config/latest/latest.go | 43 + .../pkg/scheduler/apis/config/register.go | 1 + .../scheduler/apis/config/scheme/scheme.go | 16 +- .../pkg/scheduler/apis/config/types.go | 107 +- .../scheduler/apis/config/types_pluginargs.go | 74 +- .../apis/config/v1beta1/conversion.go | 10 +- .../apis/config/v1beta1/default_plugins.go | 180 + .../scheduler/apis/config/v1beta1/defaults.go | 125 +- .../config/v1beta1/zz_generated.conversion.go | 99 +- .../config/v1beta1/zz_generated.defaults.go | 12 + .../apis/config/v1beta2/conversion.go | 107 + .../apis/config/v1beta2/default_plugins.go | 185 + .../scheduler/apis/config/v1beta2/defaults.go | 304 + .../pkg/scheduler/apis/config/v1beta2/doc.go | 24 + .../scheduler/apis/config/v1beta2/register.go | 42 + .../config/v1beta2/zz_generated.conversion.go | 868 ++ .../config/v1beta2/zz_generated.deepcopy.go | 21 + .../config/v1beta2/zz_generated.defaults.go | 72 + .../apis/config/validation/validation.go | 169 +- .../validation/validation_pluginargs.go | 46 +- .../apis/config/zz_generated.deepcopy.go | 98 +- .../pkg/scheduler/framework/interface.go | 29 +- .../plugins/defaultbinder/default_binder.go | 3 +- .../defaultpreemption/default_preemption.go | 3 +- .../framework/plugins/feature/feature.go | 2 +- .../framework/plugins/helper/shape_score.go | 3 +- .../plugins/imagelocality/image_locality.go | 3 +- .../plugins/interpodaffinity/plugin.go | 3 +- .../framework/plugins/legacy_registry.go | 20 +- .../framework/plugins/names/names.go | 48 + .../plugins/nodeaffinity/node_affinity.go | 7 +- .../framework/plugins/nodelabel/node_label.go | 8 +- .../framework/plugins/nodename/node_name.go | 3 +- .../framework/plugins/nodeports/node_ports.go | 3 +- .../node_prefer_avoid_pods.go | 8 +- .../noderesources/balanced_allocation.go | 101 +- .../framework/plugins/noderesources/fit.go | 70 +- .../plugins/noderesources/least_allocated.go | 10 +- .../plugins/noderesources/most_allocated.go | 16 +- .../requested_to_capacity_ratio.go | 50 +- .../noderesources/resource_allocation.go | 76 +- .../nodeunschedulable/node_unschedulable.go | 3 +- .../framework/plugins/nodevolumelimits/csi.go | 6 +- .../plugins/nodevolumelimits/non_csi.go | 17 +- .../plugins/podtopologyspread/plugin.go | 3 +- .../plugins/queuesort/priority_sort.go | 3 +- .../scheduler/framework/plugins/registry.go | 8 +- .../plugins/selectorspread/selector_spread.go | 3 +- .../serviceaffinity/service_affinity.go | 8 +- .../tainttoleration/taint_toleration.go | 7 +- .../plugins/volumebinding/volume_binding.go | 51 +- .../volumerestrictions/volume_restrictions.go | 101 +- .../plugins/volumezone/volume_zone.go | 3 +- .../scheduler/framework/runtime/framework.go | 104 +- .../pkg/scheduler/framework/types.go | 78 +- .../kubernetes/pkg/scheduler/util/utils.go | 18 +- .../sysctl/mustmatchpatterns.go | 1 + .../pkg/util/filesystem/defaultfs.go | 77 +- .../kubernetes/pkg/util/filesystem/fakefs.go | 128 - .../exponentialbackoff/exponential_backoff.go | 2 +- .../kubernetes/pkg/util/ipconfig/ipconfig.go | 97 - .../kubernetes/pkg/util/ipvs/ipvs_linux.go | 36 +- .../kubernetes/pkg/util/removeall/OWNERS | 8 + .../pkg/util/removeall/removeall.go | 36 +- .../kubernetes/pkg/volume/awsebs/attacher.go | 2 +- .../kubernetes/pkg/volume/awsebs/aws_ebs.go | 2 +- .../pkg/volume/azure_file/azure_provision.go | 2 +- .../kubernetes/pkg/volume/azuredd/attacher.go | 2 +- .../pkg/volume/azuredd/azure_provision.go | 2 +- .../kubernetes/pkg/volume/cinder/attacher.go | 2 +- .../kubernetes/pkg/volume/cinder/cinder.go | 2 +- .../kubernetes/pkg/volume/csi/csi_attacher.go | 20 +- .../kubernetes/pkg/volume/csi/csi_block.go | 6 +- .../kubernetes/pkg/volume/csi/csi_client.go | 219 +- .../kubernetes/pkg/volume/csi/csi_mounter.go | 32 +- .../kubernetes/pkg/volume/csi/csi_plugin.go | 3 - .../kubernetes/pkg/volume/fc/attacher.go | 2 +- .../pkg/volume/flexvolume/attacher.go | 4 +- .../pkg/volume/flocker/flocker_volume.go | 2 +- .../kubernetes/pkg/volume/gcepd/attacher.go | 2 +- .../kubernetes/pkg/volume/gcepd/gce_pd.go | 2 +- .../pkg/volume/glusterfs/glusterfs.go | 2 +- .../kubernetes/pkg/volume/iscsi/attacher.go | 2 +- .../kubernetes/pkg/volume/local/local.go | 2 +- .../kubernetes/pkg/volume/metrics_du.go | 26 +- .../pkg/volume/portworx/portworx.go | 2 +- .../kubernetes/pkg/volume/quobyte/quobyte.go | 2 +- .../kubernetes/pkg/volume/rbd/attacher.go | 2 +- .../k8s.io/kubernetes/pkg/volume/rbd/rbd.go | 2 +- .../pkg/volume/storageos/storageos.go | 2 +- .../kubernetes/pkg/volume/util/fs/fs.go | 132 +- .../pkg/volume/util/fs/fs_unsupported.go | 17 +- .../pkg/volume/util/fs/fs_windows.go | 30 +- .../operationexecutor/operation_executor.go | 3 + .../operationexecutor/operation_generator.go | 83 +- .../k8s.io/kubernetes/pkg/volume/util/util.go | 10 +- .../k8s.io/kubernetes/pkg/volume/volume.go | 7 +- .../pkg/volume/vsphere_volume/attacher.go | 2 +- .../volume/vsphere_volume/vsphere_volume.go | 4 +- .../kubernetes/test/utils/create_resources.go | 52 +- .../kubernetes/test/utils/delete_resources.go | 4 +- .../kubernetes/test/utils/deployment.go | 3 +- .../kubernetes/test/utils/pki_helpers.go | 7 +- .../azure/azure_routes.go | 37 +- .../gce/gce_loadbalancer_external.go | 2 +- .../vsphere/nodemanager.go | 4 +- .../vsphere/shared_datastore.go | 4 +- .../vsphere/vclib/diskmanagers/vdm.go | 2 +- .../legacy-cloud-providers/vsphere/vsphere.go | 13 +- .../vendor/k8s.io/mount-utils/go.mod | 4 +- .../vendor/k8s.io/mount-utils/go.sum | 8 +- .../third_party/forked/golang}/LICENSE | 5 +- .../third_party/forked/golang/PATENTS | 22 + .../forked/golang/golang-lru/lru.go | 133 + .../third_party/forked/golang/net/ip.go | 236 + .../third_party/forked/golang/net/parse.go | 59 + .../vendor/k8s.io/utils/lru/lru.go | 79 + .../vendor/k8s.io/utils/net/ipnet.go | 4 +- .../vendor/k8s.io/utils/net/net.go | 12 +- .../vendor/k8s.io/utils/net/parse.go | 33 + .../vendor/k8s.io/utils/net/port.go | 2 +- .../vendor/k8s.io/utils/trace/trace.go | 2 +- cluster-autoscaler/vendor/modules.txt | 345 +- .../konnectivity-client/pkg/client/client.go | 14 +- .../v4/typed/reconcile_schema.go | 28 +- 1786 files changed, 108959 insertions(+), 89514 deletions(-) create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/_meta.json create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/_meta.json create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/_meta.json create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/_meta.json create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/_meta.json create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/_meta.json create mode 100644 cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/go.mod create mode 100644 cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/go.sum create mode 100644 cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go.sum create mode 100644 cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go_mod_tidy_hack.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/doc.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os_windows.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport.go rename cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/{cabundle_transport.go => custom_transport_go1.12.go} (88%) rename cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/{cabundle_transport_1_5.go => custom_transport_go1.5.go} (88%) rename cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/{cabundle_transport_1_6.go => custom_transport_go1.6.go} (90%) create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/api.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/errors.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/service.go create mode 100644 cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/ssoiface/interface.go delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/go-systemd/LICENSE delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/go-systemd/NOTICE rename cluster-autoscaler/vendor/github.com/coreos/go-systemd/{ => v22}/daemon/sdnotify.go (100%) rename cluster-autoscaler/vendor/github.com/coreos/go-systemd/{ => v22}/daemon/watchdog.go (100%) create mode 100644 cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal.go rename cluster-autoscaler/vendor/github.com/coreos/go-systemd/{journal/journal.go => v22/journal/journal_unix.go} (93%) create mode 100644 cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/pkg/NOTICE delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/README.md delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/formatters.go delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/glog_formatter.go delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/init.go delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/journald_formatter.go delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/logmap.go delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/pkg_logger.go delete mode 100644 cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/syslog_formatter.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/.gitignore delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/.travis.yml delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/LICENSE delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/README.md delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/claims.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/doc.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/ecdsa.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/errors.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/hmac.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/map_claims.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/none.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/parser.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa_pss.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa_utils.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/signing_method.go delete mode 100644 cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/token.go create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/.gitignore create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/.travis.yml create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/LICENSE.txt create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/Makefile create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/README.md create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/capture_metrics.go create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/docs.go create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/go.mod create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go create mode 100644 cluster-autoscaler/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go create mode 100644 cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/.golangci.yml create mode 100644 cluster-autoscaler/vendor/github.com/golang/protobuf/descriptor/descriptor.go create mode 100644 cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/decode.go create mode 100644 cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/encode.go create mode 100644 cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/json.go create mode 100644 cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/errors_go113.go create mode 100644 cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/errors_xerrors.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.pb.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.proto create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/BUILD.bazel create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/BUILD.bazel create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go create mode 100644 cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/.gitignore delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/2q.go delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/LICENSE delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/README.md delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/arc.go delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/doc.go delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/go.mod delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/lru.go delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go delete mode 100644 cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go create mode 100644 cluster-autoscaler/vendor/github.com/josharian/intern/README.md create mode 100644 cluster-autoscaler/vendor/github.com/josharian/intern/go.mod create mode 100644 cluster-autoscaler/vendor/github.com/josharian/intern/intern.go create mode 100644 cluster-autoscaler/vendor/github.com/josharian/intern/license.md delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/.codecov.yml delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/.gitignore delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/.travis.yml delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/AUTHORS delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/CODEOWNERS delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/CONTRIBUTORS delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/COPYRIGHT delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/Makefile.fuzz delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/Makefile.release delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/README.md delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/acceptfunc.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/client.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/clientconfig.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/dane.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/defaults.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/dns.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/dnssec.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_keygen.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_keyscan.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_privkey.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/doc.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/duplicate.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/edns.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/format.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/fuzz.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/generate.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/go.mod delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/go.sum delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/labels.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/listen_go111.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/listen_go_not111.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/msg.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/msg_helpers.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/msg_truncate.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/nsecx.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/privaterr.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/reverse.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/sanitize.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/scan.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/scan_rr.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/serve_mux.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/server.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/sig0.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/singleinflight.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/smimea.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/svcb.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/tlsa.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/tsig.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/types.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/udp.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/udp_windows.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/update.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/version.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/xfr.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/zduplicate.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/zmsg.go delete mode 100644 cluster-autoscaler/vendor/github.com/miekg/dns/ztypes.go delete mode 100644 cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/build_info.go create mode 100644 cluster-autoscaler/vendor/github.com/prometheus/procfs/SECURITY.md rename cluster-autoscaler/vendor/github.com/{spf13/afero/const_bsds.go => prometheus/procfs/cpuinfo_riscvx.go} (76%) create mode 100644 cluster-autoscaler/vendor/github.com/prometheus/procfs/net_ip_socket.go create mode 100644 cluster-autoscaler/vendor/github.com/prometheus/procfs/net_protocols.go create mode 100644 cluster-autoscaler/vendor/github.com/prometheus/procfs/net_tcp.go create mode 100644 cluster-autoscaler/vendor/github.com/prometheus/procfs/slab.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/.travis.yml delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/README.md delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/afero.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/appveyor.yml delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/basepath.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/cacheOnReadFs.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/copyOnWriteFs.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/go.mod delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/go.sum delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/httpFs.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/ioutil.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/lstater.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/match.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/mem/dir.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/mem/dirmap.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/mem/file.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/memmap.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/os.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/path.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/readonlyfs.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/regexpfs.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/unionFile.go delete mode 100644 cluster-autoscaler/vendor/github.com/spf13/afero/util.go create mode 100644 cluster-autoscaler/vendor/github.com/spf13/cobra/.golangci.yml create mode 100644 cluster-autoscaler/vendor/github.com/spf13/cobra/CONDUCT.md delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/NOTICE rename cluster-autoscaler/vendor/go.etcd.io/etcd/{ => api/v3}/LICENSE (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{auth => api/v3}/authpb/auth.pb.go (63%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{auth => api/v3}/authpb/auth.proto (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver => api/v3}/etcdserverpb/etcdserver.pb.go (72%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver => api/v3}/etcdserverpb/etcdserver.proto (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver => api/v3}/etcdserverpb/raft_internal.pb.go (53%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver => api/v3}/etcdserverpb/raft_internal.proto (88%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver => api/v3}/etcdserverpb/raft_internal_stringer.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver => api/v3}/etcdserverpb/rpc.pb.go (58%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver => api/v3}/etcdserverpb/rpc.proto (95%) create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.pb.go create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.proto rename cluster-autoscaler/vendor/go.etcd.io/etcd/{mvcc => api/v3}/mvccpb/kv.pb.go (73%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{mvcc => api/v3}/mvccpb/kv.proto (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver/api => api/v3}/v3rpc/rpctypes/doc.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver/api => api/v3}/v3rpc/rpctypes/error.go (87%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver/api => api/v3}/v3rpc/rpctypes/md.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{etcdserver/api => api/v3}/v3rpc/rpctypes/metadatafields.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{ => api/v3}/version/version.go (98%) rename cluster-autoscaler/vendor/{github.com/coreos/pkg => go.etcd.io/etcd/client/pkg/v3}/LICENSE (99%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/dir_unix.go (97%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/dir_windows.go (98%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/doc.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/fileutil.go (71%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/lock.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/lock_flock.go (96%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/lock_linux.go (87%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/lock_plan9.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/lock_solaris.go (98%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/lock_unix.go (94%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/lock_windows.go (95%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/preallocate.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/preallocate_darwin.go (82%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/preallocate_unix.go (98%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/preallocate_unsupported.go (96%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/purge.go (88%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/read_dir.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/sync.go (96%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/sync_darwin.go (87%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/fileutil/sync_linux.go (98%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/logutil/doc.go (100%) rename cluster-autoscaler/vendor/{github.com/coreos/pkg/capnslog/log_hijack.go => go.etcd.io/etcd/client/pkg/v3/logutil/log_level.go} (58%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/logutil/zap.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/logutil/zap_journal.go (95%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/systemd/doc.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/systemd/journal.go (92%) create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/cipher_suites.go rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/tlsutil/doc.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/tlsutil/tlsutil.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/doc.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/keepalive_listener.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/limit_listen.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/listener.go (69%) create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/listener_tls.go (100%) create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt.go create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_unix.go create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_windows.go rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/timeout_conn.go (77%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/timeout_dialer.go (91%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/timeout_listener.go (70%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/timeout_transport.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/tls.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/transport.go (74%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/transport/unix_listener.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/types/doc.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/types/id.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/types/set.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/types/slice.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/types/urls.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{pkg => client/pkg/v3}/types/urlsmap.go (100%) create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/LICENSE rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/README.md (71%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/auth.go (91%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/client.go (65%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/cluster.go (95%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/compact_op.go (96%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/compare.go (98%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/config.go (97%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/credentials/credentials.go (65%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/ctx.go (77%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/doc.go (93%) create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/go.mod create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/go.sum create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/internal/endpoint/endpoint.go create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/internal/resolver/resolver.go rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/kv.go (99%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/lease.go (97%) create mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/logger.go rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/maintenance.go (94%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/op.go (97%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/options.go (89%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/retry.go (96%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/retry_interceptor.go (89%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/sort.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/txn.go (98%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/utils.go (100%) rename cluster-autoscaler/vendor/go.etcd.io/etcd/{clientv3 => client/v3}/watch.go (92%) delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/balancer.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/connectivity/connectivity.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/picker.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/roundrobin_balanced.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/resolver/endpoint/endpoint.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/utils.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/logger.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/discard_logger.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/log_level.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/logger.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/merge_logger.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/package_logger.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_grpc.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_raft.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/tlsutil/cipher_suites.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/OWNERS delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/README.md delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/bootstrap.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/confchange/confchange.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/confchange/restore.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/design.md delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/doc.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/log.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/log_unstable.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/logger.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/node.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/joint.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/majority.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/quorum.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/voteresult_string.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raft.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/confchange.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/confstate.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/raft.pb.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/raft.proto delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/rawnode.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/read_only.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/status.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/storage.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/inflights.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/progress.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/state.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/tracker.go delete mode 100644 cluster-autoscaler/vendor/go.etcd.io/etcd/raft/util.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/.gitignore create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/.golangci.yml create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CHANGELOG.md create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CODEOWNERS create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CONTRIBUTING.md rename cluster-autoscaler/vendor/{github.com/spf13/afero/LICENSE.txt => go.opentelemetry.io/contrib/LICENSE} (88%) create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/Makefile create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/README.md create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/RELEASING.md create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/contrib.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/go.mod create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/go.sum create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/LICENSE create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.mod create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.sum create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/pre_release.sh create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/contrib/tag.sh create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/.gitignore create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/.gitmodules create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/.golangci.yml create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/CHANGELOG.md create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/CODEOWNERS create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/LICENSE create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/Makefile create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/README.md create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/RELEASING.md create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/VERSIONING.md create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/encoder.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/iterator.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/key.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/kv.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/set.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/type_string.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/value.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/codes/codes.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/codes/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/doc.go rename cluster-autoscaler/vendor/{github.com/spf13/afero/const_win_unix.go => go.opentelemetry.io/otel/error_handler.go} (61%) create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/LICENSE create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/README.md create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/go.mod create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/go.sum create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/envconfig.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/options.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/tls.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/attribute.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/instrumentation.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/metric.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/resource.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/span.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/options.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/optiontypes.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlp.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/connection.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/driver.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/options.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/protocoldriver.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/go.mod create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/go.sum create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/handler.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/meter.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/propagator.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/state.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/trace.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/metric/async.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go rename cluster-autoscaler/vendor/{go.etcd.io/etcd/clientv3/balancer/picker/err.go => go.opentelemetry.io/otel/internal/trace/noop/noop.go} (55%) create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/LICENSE create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/config.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/global/metric.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/go.mod create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/go.sum create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/instrumentkind_string.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_instrument.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_noop.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_sdkapi.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/kind_string.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/number.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/registry/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/registry/registry.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/pre_release.sh create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/baggage.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/propagation.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/trace_context.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/LICENSE create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/LICENSE create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/aggregation/aggregation.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/exportkind_string.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/go.mod create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/go.sum create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/metric.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/sanitize.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/LICENSE create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/aggregator.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/exact/exact.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/histogram/histogram.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue/lastvalue.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount/mmsc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/sum/sum.go rename cluster-autoscaler/vendor/{github.com/prometheus/client_golang/prometheus/build_info_pre_1.12.go => go.opentelemetry.io/otel/sdk/metric/atomicfields.go} (56%) create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/config.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/controller.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/time/time.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/go.mod create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/go.sum create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/basic.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/config.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/refcount_mapped.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/sdk.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/selector/simple/simple.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/config.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/env.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/os.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/process.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/attributesmap.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/config.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/exception.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/http.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/resource.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/trace.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/tag.sh create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/LICENSE create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/config.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/context.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/doc.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/go.mod create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/go.sum create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/nonrecording.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/noop.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/trace.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/unit/doc.go rename cluster-autoscaler/vendor/{github.com/coreos/pkg/capnslog/init_windows.go => go.opentelemetry.io/otel/unit/unit.go} (73%) create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/otel/verify_examples.sh rename cluster-autoscaler/vendor/{go.etcd.io/etcd/clientv3/balancer/picker/doc.go => go.opentelemetry.io/otel/version.go} (73%) create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/LICENSE create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.gw.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_config.pb.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.gw.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go create mode 100644 cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go delete mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/atomic.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/bool.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/bool_ext.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/doc.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/duration.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/duration_ext.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/error_ext.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/float64.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/float64_ext.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/gen.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/int32.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/int64.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/nocmp.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/string_ext.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/uint32.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/uint64.go create mode 100644 cluster-autoscaler/vendor/go.uber.org/atomic/value.go delete mode 100644 cluster-autoscaler/vendor/go.uber.org/zap/.travis.yml create mode 100644 cluster-autoscaler/vendor/go.uber.org/zap/zapgrpc/zapgrpc.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/ed25519.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go create mode 100644 cluster-autoscaler/vendor/golang.org/x/net/http2/ascii.go create mode 100644 cluster-autoscaler/vendor/golang.org/x/net/http2/go115.go create mode 100644 cluster-autoscaler/vendor/golang.org/x/net/http2/not_go115.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/iana/const.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/cmsghdr.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/empty.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/error_unix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/error_windows.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/iovec_32bit.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/iovec_64bit.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/iovec_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/msghdr_linux.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/msghdr_openbsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/msghdr_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/norace.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/race.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/rawconn.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/rawconn_msg.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/socket.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_bsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_const_unix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_const_zos.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linkname.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_386.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_mips.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_mips64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_mips64le.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_mipsle.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64le.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_netbsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_posix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_solaris.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_solaris_amd64.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_unix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_windows.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/batch.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/control.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/control_bsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/control_pktinfo.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/control_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/control_unix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/control_windows.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/control_zos.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/dgramopt.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/doc.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/endpoint.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/genericopt.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/header.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/helper.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/iana.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/icmp.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/icmp_linux.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/icmp_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/packet.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/payload.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/payload_cmsg.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/payload_nocmsg.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sockopt.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sockopt_posix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sockopt_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_aix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_asmreq.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_asmreqn.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_bpf.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_bsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_darwin.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_dragonfly.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_freebsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_linux.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_solaris.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_ssmreq.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_windows.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/sys_zos.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_darwin.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_netbsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_openbsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_solaris.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/batch.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/control.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/control_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/control_unix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/control_windows.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/dgramopt.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/doc.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/endpoint.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/genericopt.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/header.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/helper.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/iana.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/icmp.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/icmp_bsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/icmp_linux.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/icmp_solaris.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/icmp_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/icmp_windows.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/icmp_zos.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/payload.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/payload_cmsg.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/payload_nocmsg.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sockopt.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sockopt_posix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sockopt_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_aix.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_asmreq.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_bpf.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_bsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_darwin.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_freebsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_linux.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_solaris.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_ssmreq.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_stub.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_windows.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/sys_zos.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_darwin.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_netbsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_openbsd.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_solaris.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_darwin_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go delete mode 100644 cluster-autoscaler/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/SECURITY.md delete mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/balancer.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/balancer/grpclb/state/state.go delete mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/balancer_v1_wrapper.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/encoding/gzip/gzip.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/grpclog/component.go delete mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/binarylog/regenerate.sh delete mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/binarylog/util.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/channelz/logging.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/credentials/credentials.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/credentials/spiffe.go rename cluster-autoscaler/vendor/google.golang.org/grpc/{resolver/passthrough/passthrough.go => internal/credentials/spiffe_appengine.go} (58%) rename cluster-autoscaler/vendor/google.golang.org/grpc/{credentials/internal => internal/credentials}/syscallconn.go (96%) rename cluster-autoscaler/vendor/google.golang.org/grpc/{credentials/internal => internal/credentials}/syscallconn_appengine.go (97%) create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/credentials/util.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcutil/encode_duration.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcutil/metadata.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcutil/method.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcutil/target.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/metadata/metadata.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/resolver/config_selector.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/resolver/unix/unix.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/status/status.go delete mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/transport/log.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/transport/networktype/networktype.go rename cluster-autoscaler/vendor/google.golang.org/grpc/{ => internal/transport}/proxy.go (73%) create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/internal/xds_handshake_cluster.go delete mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/naming/dns_resolver.go delete mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/naming/naming.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/regenerate.sh delete mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/grpc/resolver/manual/manual.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/encoding/protojson/decode.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/encoding/protojson/doc.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/encoding/protojson/encode.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/internal/encoding/json/encode.go delete mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/internal/fieldsort/fieldsort.go delete mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/internal/mapsort/mapsort.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/internal/order/order.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/internal/order/range.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go create mode 100644 cluster-autoscaler/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go delete mode 100644 cluster-autoscaler/vendor/gopkg.in/yaml.v3/.travis.yml create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/metrics.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/metrics.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/endpoints/filters/traces.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/lifecycle_signals.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/tracing.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/etcd3/etcd_object_count_tracker.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/tracing/config.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/object_count_tracker.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/width.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/watch_tracker.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/metrics.go create mode 100644 cluster-autoscaler/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetpersistentvolumeclaimretentionpolicy.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetpersistentvolumeclaimretentionpolicy.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetpersistentvolumeclaimretentionpolicy.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/pkg/apis/clientauthentication/install/install.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/conversion.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/doc.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/register.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/types.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/zz_generated.conversion.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/zz_generated.deepcopy.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/zz_generated.defaults.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/tools/clientcmd/api/v1/defaults.go create mode 100644 cluster-autoscaler/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.defaults.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go create mode 100644 cluster-autoscaler/vendor/k8s.io/component-base/traces/OWNERS create mode 100644 cluster-autoscaler/vendor/k8s.io/component-base/traces/utils.go rename cluster-autoscaler/vendor/k8s.io/{kubernetes/pkg/util/ipconfig => kube-scheduler/config/v1beta2}/doc.go (72%) create mode 100644 cluster-autoscaler/vendor/k8s.io/kube-scheduler/config/v1beta2/register.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kube-scheduler/config/v1beta2/types.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kube-scheduler/config/v1beta2/types_pluginargs.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kube-scheduler/config/v1beta2/zz_generated.deepcopy.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/algorithmprovider/registry.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/latest/latest.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta1/default_plugins.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/conversion.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/default_plugins.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/defaults.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/doc.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/register.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.conversion.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.deepcopy.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.defaults.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/names/names.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/filesystem/fakefs.go delete mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/ipconfig/ipconfig.go create mode 100644 cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/removeall/OWNERS rename cluster-autoscaler/vendor/{github.com/miekg/dns => k8s.io/utils/internal/third_party/forked/golang}/LICENSE (88%) create mode 100644 cluster-autoscaler/vendor/k8s.io/utils/internal/third_party/forked/golang/PATENTS create mode 100644 cluster-autoscaler/vendor/k8s.io/utils/internal/third_party/forked/golang/golang-lru/lru.go create mode 100644 cluster-autoscaler/vendor/k8s.io/utils/internal/third_party/forked/golang/net/ip.go create mode 100644 cluster-autoscaler/vendor/k8s.io/utils/internal/third_party/forked/golang/net/parse.go create mode 100644 cluster-autoscaler/vendor/k8s.io/utils/lru/lru.go create mode 100644 cluster-autoscaler/vendor/k8s.io/utils/net/parse.go diff --git a/cluster-autoscaler/go.mod b/cluster-autoscaler/go.mod index c1f9848f3e99..c5cd09a22abe 100644 --- a/cluster-autoscaler/go.mod +++ b/cluster-autoscaler/go.mod @@ -4,19 +4,20 @@ go 1.16 require ( cloud.google.com/go v0.54.0 - github.com/Azure/azure-sdk-for-go v53.1.0+incompatible - github.com/Azure/go-autorest/autorest v0.11.17 - github.com/Azure/go-autorest/autorest/adal v0.9.10 + github.com/Azure/azure-sdk-for-go v55.0.0+incompatible + github.com/Azure/go-autorest/autorest v0.11.18 + github.com/Azure/go-autorest/autorest/adal v0.9.13 github.com/Azure/go-autorest/autorest/date v0.3.0 - github.com/Azure/go-autorest/autorest/to v0.2.0 - github.com/aws/aws-sdk-go v1.35.24 + github.com/Azure/go-autorest/autorest/to v0.4.0 + github.com/aws/aws-sdk-go v1.38.49 github.com/digitalocean/godo v1.27.0 github.com/ghodss/yaml v1.0.0 github.com/golang/mock v1.4.4 github.com/google/uuid v1.1.2 github.com/jmespath/go-jmespath v0.4.0 - github.com/json-iterator/go v1.1.10 + github.com/json-iterator/go v1.1.11 github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.11.0 github.com/satori/go.uuid v1.2.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.7.0 @@ -25,74 +26,74 @@ require ( google.golang.org/api v0.20.0 gopkg.in/gcfg.v1 v1.2.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.22.0-alpha.3 - k8s.io/apimachinery v0.22.0-alpha.3 - k8s.io/apiserver v0.22.0-alpha.3 - k8s.io/client-go v0.22.0-alpha.3 - k8s.io/cloud-provider v0.22.0-alpha.3 - k8s.io/component-base v0.22.0-alpha.3 - k8s.io/component-helpers v0.22.0-alpha.3 + k8s.io/api v0.22.0-beta.1 + k8s.io/apimachinery v0.22.0-beta.1 + k8s.io/apiserver v0.22.0-beta.1 + k8s.io/client-go v0.22.0-beta.1 + k8s.io/cloud-provider v0.22.0-beta.1 + k8s.io/component-base v0.22.0-beta.1 + k8s.io/component-helpers v0.22.0-beta.1 k8s.io/klog/v2 v2.9.0 k8s.io/kubelet v0.0.0 - k8s.io/kubernetes v1.22.0-alpha.3 + k8s.io/kubernetes v1.22.0-beta.1 k8s.io/legacy-cloud-providers v0.0.0 - k8s.io/utils v0.0.0-20210521133846-da695404a2bc + k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 ) replace github.com/digitalocean/godo => github.com/digitalocean/godo v1.27.0 replace github.com/rancher/go-rancher => github.com/rancher/go-rancher v0.1.0 -replace k8s.io/api => k8s.io/api v0.22.0-alpha.3 +replace k8s.io/api => k8s.io/api v0.22.0-beta.1 -replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0-alpha.3 +replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0-beta.1 -replace k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.3 +replace k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-beta.1 -replace k8s.io/apiserver => k8s.io/apiserver v0.22.0-alpha.3 +replace k8s.io/apiserver => k8s.io/apiserver v0.22.0-beta.1 -replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.0-alpha.3 +replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.0-beta.1 -replace k8s.io/client-go => k8s.io/client-go v0.22.0-alpha.3 +replace k8s.io/client-go => k8s.io/client-go v0.22.0-beta.1 -replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0-alpha.3 +replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0-beta.1 -replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.0-alpha.3 +replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.0-beta.1 -replace k8s.io/code-generator => k8s.io/code-generator v0.22.0-alpha.3 +replace k8s.io/code-generator => k8s.io/code-generator v0.22.0-beta.1 -replace k8s.io/component-base => k8s.io/component-base v0.22.0-alpha.3 +replace k8s.io/component-base => k8s.io/component-base v0.22.0-beta.1 -replace k8s.io/component-helpers => k8s.io/component-helpers v0.22.0-alpha.3 +replace k8s.io/component-helpers => k8s.io/component-helpers v0.22.0-beta.1 -replace k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-alpha.3 +replace k8s.io/controller-manager => k8s.io/controller-manager v0.22.0-beta.1 -replace k8s.io/cri-api => k8s.io/cri-api v0.22.0-alpha.3 +replace k8s.io/cri-api => k8s.io/cri-api v0.22.0-beta.1 -replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.22.0-alpha.3 +replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.22.0-beta.1 -replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.22.0-alpha.3 +replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.22.0-beta.1 -replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.22.0-alpha.3 +replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.22.0-beta.1 -replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.22.0-alpha.3 +replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.22.0-beta.1 -replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.22.0-alpha.3 +replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.22.0-beta.1 -replace k8s.io/kubectl => k8s.io/kubectl v0.22.0-alpha.3 +replace k8s.io/kubectl => k8s.io/kubectl v0.22.0-beta.1 -replace k8s.io/kubelet => k8s.io/kubelet v0.22.0-alpha.3 +replace k8s.io/kubelet => k8s.io/kubelet v0.22.0-beta.1 -replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.22.0-alpha.3 +replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.22.0-beta.1 -replace k8s.io/metrics => k8s.io/metrics v0.22.0-alpha.3 +replace k8s.io/metrics => k8s.io/metrics v0.22.0-beta.1 -replace k8s.io/mount-utils => k8s.io/mount-utils v0.22.0-alpha.3 +replace k8s.io/mount-utils => k8s.io/mount-utils v0.22.0-beta.1 -replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.0-alpha.3 +replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.0-beta.1 -replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.22.0-alpha.3 +replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.22.0-beta.1 -replace k8s.io/sample-controller => k8s.io/sample-controller v0.22.0-alpha.3 +replace k8s.io/sample-controller => k8s.io/sample-controller v0.22.0-beta.1 -replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.22.0-alpha.3 +replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.22.0-beta.1 diff --git a/cluster-autoscaler/go.sum b/cluster-autoscaler/go.sum index 4182fd8a2acd..b51668a9083a 100644 --- a/cluster-autoscaler/go.sum +++ b/cluster-autoscaler/go.sum @@ -26,27 +26,28 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v53.1.0+incompatible h1:f2h0KLVGa3zIaMDMHBe5Lazc0FT5+L78z0B8K9PmDyg= -github.com/Azure/azure-sdk-for-go v53.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= +github.com/Azure/azure-sdk-for-go v55.0.0+incompatible h1:L4/vUGbg1Xkw5L20LZD+hJI5I+ibWSytqQ68lTCfLwY= +github.com/Azure/azure-sdk-for-go v55.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.17 h1:2zCdHwNgRH+St1J+ZMf66xI8aLr/5KMy+wWLH97zwYM= -github.com/Azure/go-autorest/autorest v0.11.17/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.10 h1:r6fZHMaHD8B6LDCn0o5vyBFHIHrM6Ywwx7mb49lPItI= -github.com/Azure/go-autorest/autorest/adal v0.9.10/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest v0.11.18 h1:90Y4srNYrwOtAgVo3ndrQkTYn6kf1Eg/AjTFJ8Is2aM= +github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/to v0.2.0 h1:nQOZzFCudTh+TvquAtCRjM01VEYx85e9qbwt5ncW4L8= -github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= +github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= +github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= github.com/Azure/go-autorest/autorest/validation v0.1.0 h1:ISSNzGUh+ZSzizJWOWzs8bwpXIePbGLW4z/AmUFGH5A= github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= -github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= @@ -76,6 +77,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -83,25 +85,27 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7 h1:irR1cO6eek3n5uquIVaRAsQmZnlsfPuHNz31cXo4eyk= -github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7/go.mod h1:LWMyo4iOLWXHGdBki7NIht1kHru/0wM179h+d3g8ATM= -github.com/aws/aws-sdk-go v1.35.24 h1:U3GNTg8+7xSM6OAJ8zksiSM4bRqxBWmVwwehvOSNG3A= +github.com/auth0/go-jwt-middleware v1.0.1 h1:/fsQ4vRr4zod1wKReUH+0A3ySRjGiT9G34kypO/EKwI= +github.com/auth0/go-jwt-middleware v1.0.1/go.mod h1:YSeUX3z6+TF2H+7padiEqNJ73Zy9vXW72U//IgN0BIM= github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= +github.com/aws/aws-sdk-go v1.38.49 h1:E31vxjCe6a5I+mJLmUGaZobiWmg9KdWaud9IfceYeYQ= +github.com/aws/aws-sdk-go v1.38.49/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3K/aDCk9Tj+VM7YymsX66ERvzCJzw8rFCX2JU= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= 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/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/caddyserver/caddy v1.0.3/go.mod h1:G+ouvOY32gENkJC+jhgl62TyhvqEsFaDiZ4uw0RzP1E= -github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= @@ -109,7 +113,6 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/checkpoint-restore/go-criu/v5 v5.0.0 h1:TW8f/UvntYoVDMN1K2HlT82qH1rb0sOjpGw3m6Ym+i4= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -119,10 +122,13 @@ github.com/cilium/ebpf v0.5.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313 h1:eIHD9GNM3Hp7kcRW5mvcz7WTR3ETeoYYKwpgA04kaXE= github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/container-storage-interface/spec v1.3.0 h1:wMH4UIoWnK/TXYw8mbcIHgZmB6kHOeIsYsiaTJwa6bc= -github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= +github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/container-storage-interface/spec v1.5.0 h1:lvKxe3uLgqQeVQcrnL2CPQKISoKjTJxojEs9cBk+HXo= +github.com/container-storage-interface/spec v1.5.0/go.mod h1:8K96oQNkJ7pFcC2R9Z1ynGGBB1I93kcS6PGg3SsOk8s= github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 h1:qWj4qVYZ95vLWwqyNJCQg7rDsG5wPdze0UaPolH7DUk= github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= @@ -142,7 +148,8 @@ github.com/containerd/typeurl v1.0.1 h1:PvuK4E3D5S5q6IqsPDCy928FhP0LUIGcmZ/Yhgp5 github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= github.com/containernetworking/cni v0.8.1 h1:7zpDnQ3T3s4ucOuJ/ZCLrYBxzkg0AELFfII3Epo9TmI= github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/coredns/corefile-migration v1.0.11/go.mod h1:RMy/mXdeDlYwzt0vdMEJvT2hGJ2I86/eO0UdXmH9XNI= +github.com/coredns/caddy v1.1.0/go.mod h1:A6ntJQlAWuQfFlsd9hvigKbo2WS0VUs2l1e2F+BawD4= +github.com/coredns/corefile-migration v1.0.12/go.mod h1:NJOI8ceUF/NTgEwtjD+TUq3/BnH/GF7WAM3RzCa3hBo= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -150,18 +157,15 @@ github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHo github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.1 h1:7OO2CXWMYNDdaAzP51t4lCCZWwpQHmvPbm9sxWjm3So= github.com/coreos/go-systemd/v22 v22.3.1/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= +github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -171,7 +175,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs 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/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.27.0 h1:78iE9oVvTnAEqhMip2UHFvL01b8LJcydbNUpr0cAmN4= @@ -188,7 +191,6 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= @@ -196,30 +198,35 @@ github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkg github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/euank/go-kmsg-parser v2.0.0+incompatible h1:cHD53+PLQuuQyLZeriD1V/esuG4MuU0Pjs5y6iknohY= github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= 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/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-acme/lego v2.5.0+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M= -github.com/go-bindata/go-bindata v3.1.1+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -234,12 +241,15 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= +github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-ozzo/ozzo-validation v3.5.0+incompatible h1:sUy/in/P6askYr16XJgTKq/0SZhiWsdg4WZGaLsGQkM= github.com/go-ozzo/ozzo-validation v3.5.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -254,20 +264,18 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -282,12 +290,16 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cadvisor v0.39.2 h1:SzgL5IYoMZEFVA9usi0xCy8SXSVXKQ6aL/rYs/kQjXE= github.com/google/cadvisor v0.39.2/go.mod h1:kN93gpdevu+bpS227TyHVZyCU5bbqCzTj5T9drl34MI= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -296,8 +308,9 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -311,33 +324,34 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= +github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= +github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -351,17 +365,15 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/heketi/heketi v10.2.0+incompatible h1:kw0rXzWGCXZP5XMP07426kKiz4hGFgR9ok+GTg+wDS8= -github.com/heketi/heketi v10.2.0+incompatible/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o= +github.com/heketi/heketi v10.3.0+incompatible h1:X4DBFPzcyWZWhia32d94UhDECQJHH0M5kpRb1gxxUHk= +github.com/heketi/heketi v10.3.0+incompatible/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o= github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6 h1:oJ/NLadJn5HoxvonA6VxG31lg0d6XOURNA09BTtM4fY= github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6/go.mod h1:xGMAM8JLi7UkZt1i4FQeQy0R2T8GLUwQhOP5M1gBhy4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -371,18 +383,20 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/ishidawataru/sctp v0.0.0-20190723014705-7c296d48a2b5/go.mod h1:DM4VvS+hD/kDi1U1QsX2fnZowwBhqD0Dk3bRPKF/Oc8= -github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a/go.mod h1:wK6yTYYcgjHE1Z1QtXACPDjcFJyBskHEdagmnq3vsP8= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -395,7 +409,6 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -408,7 +421,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/libopenstorage/openstorage v1.0.0 h1:GLPam7/0mpdP8ZZtKjbfcXJBTIA/T1O6CBErVEFEyIM= github.com/libopenstorage/openstorage v1.0.0/go.mod h1:Sp1sIObHjat1BeXhfMqLZ14wnOzEhNx2YQedreMcUyc= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= @@ -416,30 +428,20 @@ github.com/lithammer/dedent v1.1.0 h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffkt github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lpabon/godbc v0.1.1 h1:ilqjArN1UOENJJdM34I2YHKmF/B0gGq4VLoSGy9iAao= github.com/lpabon/godbc v0.1.1/go.mod h1:Jo9QV0cf3U6jZABgiJ2skINAXb9j8m51r07g4KI92ZA= -github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04= -github.com/lucas-clemente/quic-clients v0.1.0/go.mod h1:y5xVIEoObKqULIKivu+gD/LU90pL73bTdtQjPBvtCBk= -github.com/lucas-clemente/quic-go v0.10.2/go.mod h1:hvaRS9IHjFLMq76puFJeWNfmn+H70QZ/CXoxqw9bzao= -github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced/go.mod h1:NCcRLrOTZbzhZvixZLlERbJtDtYsmMw8Jc4vS8Z0g58= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mholt/certmagic v0.6.2-0.20190624175158-6a42ef9fe8c2/go.mod h1:g4cOPxcjV0oFq3qwpjSA30LReKD8AoIfwAY9VvG35NY= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.35 h1:oTfOaDH+mZkdcgdIjH6yBajRGtIwcwcaR+rt23ZSrJs= -github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/mindprince/gonvml v0.0.0-20190828220739-9ebdce4bb989 h1:PS1dLCGtD8bb9RPKJrc8bS7qHL6JnW1CZvwzH9dPoUs= github.com/mindprince/gonvml v0.0.0-20190828220739-9ebdce4bb989/go.mod h1:2eu9pRWp8mo84xCg6KswZ+USQHjwgRhNp06sozOdsTY= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible h1:aKW/4cBs+yK6gpqU3K/oIwk9Q/XICqd3zOX/UFuvqmk= @@ -460,8 +462,9 @@ github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8 github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.4.1 h1:1O+1cHA1aujwEwwVMa2Xm2l+gIpUHyd3+D+d7LZh1kM= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= +github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 h1:yH0SvLzcbZxcJXho2yh7CqdENGMQe73Cw3woZBpPli0= +github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -483,23 +486,18 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= @@ -516,6 +514,7 @@ github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3 github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.0 h1:+77ba4ar4jsCbL1GLbFL8fFM57w6suPfSS9PDLDY7KM= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= @@ -530,8 +529,9 @@ github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prY github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -549,18 +549,19 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/quobyte/api v0.1.8 h1:+sOX1gIlC/OaLipqVZWrHgly9Kh9Qo8OygeS0mWAg30= github.com/quobyte/api v0.1.8/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H6VI= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/robfig/cron v1.1.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021 h1:if3/24+h9Sq6eDx8UUz1SO9cT9tizyIsATfB7b4D3tc= github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= -github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -578,22 +579,21 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= +github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -616,11 +616,10 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= @@ -640,35 +639,67 @@ github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6Ut github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489 h1:1JFLBqwIgdyHN1ZtgjTBwO+blA6gVOmZurpiMEsETKo= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0 h1:2aQv6F436YnN7I4VbI8PPYrBhu+SmrTaADcf8Mi/6PU= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0 h1:ftQ0nOOHMcbMS3KIaDQ0g5Qcd6bhaBrQT6b89DfwLTs= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v3 v3.5.0 h1:62Eh0XOro+rDwkrypAGDfgmNh5Joq+z+W9HZdlXMzek= +go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= +go.etcd.io/etcd/pkg/v3 v3.5.0 h1:ntrg6vvKRW26JRmHTE0iNlDgYK6JX3hg/4cD62X0ixk= +go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= +go.etcd.io/etcd/raft/v3 v3.5.0 h1:kw2TmO3yFTgE+F0mdKkG7xMxkit2duBDa2Hu6D/HMlw= +go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= +go.etcd.io/etcd/server/v3 v3.5.0 h1:jk8D/lwGEDlQU9kZXUFMSANkE22Sg5+mW27ip8xcF9E= +go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= +go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 h1:sO4WKdPAudZGKPcpZT4MJn6JaDmpyLrMPDGGyA1SttE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 h1:Q3C9yzW6I9jqEc8sawxzxZmY48fs9u220KXq6d5s3XU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= +go.opentelemetry.io/otel v0.20.0 h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg= +go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= +go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/sdk v0.20.0 h1:JsxtGXd06J8jrnya7fdI/U/MR6yXA5DtbZy+qoHQlr8= +go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0 h1:c5VRjxCXdQlx1HjzwGdQHzZaVI82b5EbBgOu2ljD92g= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= +go.opentelemetry.io/otel/sdk/metric v0.20.0 h1:7ao1wpzHRVKf0OQ7GIxiQJA6X7DLX9o14gmVon7mMK8= +go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= +go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -705,8 +736,8 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= @@ -717,8 +748,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ= golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -727,10 +758,8 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -739,9 +768,7 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -752,11 +779,14 @@ golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 h1:ADo5wSpq2gqaCGQWzk7S5vd//0iyyLeAratkEoG5dLE= +golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -770,8 +800,10 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -779,10 +811,8 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/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-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -792,10 +822,8 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -821,12 +849,18 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 h1:dXfMednGJh/SUUFjTLsWJz3P+TQt9qnR11GgeI3vWKs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= @@ -837,9 +871,9 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -867,15 +901,13 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -890,8 +922,7 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -940,19 +971,29 @@ google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4 google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a h1:pOwg4OoaRYScjmR4LlLgdtnyoHYTSAVhhqe5uPdpII8= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= 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= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -962,15 +1003,16 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.0 h1:0HIbH907iBTAntm+88IJV2qmJALDAh8sPekI9Vc1fm0= @@ -978,7 +1020,6 @@ gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mcuadros/go-syslog.v2 v2.2.1/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -991,6 +1032,7 @@ gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -998,8 +1040,9 @@ 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.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= @@ -1010,61 +1053,61 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.22.0-alpha.3 h1:rE7mI2nvuTyiSo3+C7iiVxWh1lmOqBTUVLloX+c9s4c= -k8s.io/api v0.22.0-alpha.3/go.mod h1:1XKmwk4lbdJRku2EqAElh5amCLsl9JvjSbQzUteQ1ac= -k8s.io/apiextensions-apiserver v0.22.0-alpha.3/go.mod h1:LdELmwoXLVdnTaWkQAvhP6NNmjZDbiU86Cl9uizIjOM= -k8s.io/apimachinery v0.22.0-alpha.3 h1:VIzKYyrRYpaPQDwhH6SZVy/04OR69ZKhovidSU+KjvY= -k8s.io/apimachinery v0.22.0-alpha.3/go.mod h1:5zcgojGmAy5Bo3S4mgZWAt6HwoKzaSh4MV3ITvlcOVM= -k8s.io/apiserver v0.22.0-alpha.3 h1:xcsUrEFSrN/u3MyIn3OK45fdMJwlmcvoD57FmWdQNSQ= -k8s.io/apiserver v0.22.0-alpha.3/go.mod h1:doQlHDHKpIHK6J/B8ERWxM7q0k3/dd+onnUpPaq8Ls8= -k8s.io/cli-runtime v0.22.0-alpha.3/go.mod h1:vlN/3GgRwydUHcTh2rH4/01wuOQrOBCuRx51V035y0k= -k8s.io/client-go v0.22.0-alpha.3 h1:kkvu6ggorI0tpU43aD9hRJZGhdC445d6RbMr0cb6HXY= -k8s.io/client-go v0.22.0-alpha.3/go.mod h1:ESvYVqJpwz3imRbIpr/eUZy20OaJ/TFene8F3ZTFtFY= -k8s.io/cloud-provider v0.22.0-alpha.3 h1:Tdw6HdvJqgllR3xoX9Pg9RxbXDRPntR5BALgDWW7Wy4= -k8s.io/cloud-provider v0.22.0-alpha.3/go.mod h1:vSb2HDvsKH335sOchf0rAynD1yLWKvQwIwyeX8Edqv0= -k8s.io/cluster-bootstrap v0.22.0-alpha.3/go.mod h1:EoRhJV7mutmGLtsfqJN+vnl6E34A6ZFSqA9kD8ZtfCw= -k8s.io/code-generator v0.22.0-alpha.3/go.mod h1:FSpIt1knsWe0QNfwrAq7+M1/AhwWXHWKjsbbfeeW+N4= -k8s.io/component-base v0.22.0-alpha.3 h1:2LkzKT/kOK2BArPE6E4GiaqQEHmUUqJOIzc+pw0y0pM= -k8s.io/component-base v0.22.0-alpha.3/go.mod h1:/uparSfFelitkoqeEEqpoJyJJMmc42rY3oJ7hNnQmzQ= -k8s.io/component-helpers v0.22.0-alpha.3 h1:vkyzAZSoFYe5BnZrQGhOkfFTkj3ISJVOsZnLsz9Vv3Q= -k8s.io/component-helpers v0.22.0-alpha.3/go.mod h1:21UmDnkTIFZV/lXWyG69N0OMVdza/QtdIGyayYJyWoA= -k8s.io/controller-manager v0.22.0-alpha.3/go.mod h1:DHADR6ytfFVL+UjOxSjZODjSv2mRiQ2oBBAcMUXUCJM= -k8s.io/cri-api v0.22.0-alpha.3 h1:83Agc7Dn/vcZ1KrDJGZ5YiabBe//UQwscC5g+WqhpYU= -k8s.io/cri-api v0.22.0-alpha.3/go.mod h1:ghgscVTPPM7yhyxA00ZgdNeX1JPnGC05fayZiNDC9qw= -k8s.io/csi-translation-lib v0.22.0-alpha.3 h1:C9j3mpzjiza/0xYJfSnAoUk3byT+FThfyPdd+ToZI2k= -k8s.io/csi-translation-lib v0.22.0-alpha.3/go.mod h1:rzrTyukePOFkWHjE/tLSPDfWBH8/SVve5i1NGiaBTMo= +k8s.io/api v0.22.0-beta.1 h1:5DemKXzK/W72kWEtBGm/deIzouR3SC1m0Po213pvRo0= +k8s.io/api v0.22.0-beta.1/go.mod h1:fi6APFYf34OAndBPyL9KjqGYI5OwoL8wBIKDOqsckDs= +k8s.io/apiextensions-apiserver v0.22.0-beta.1/go.mod h1:O7hmUkLEHQuvNN62uVuDJENCPwOkLwJ6gMFbPXiI+18= +k8s.io/apimachinery v0.22.0-beta.1 h1:VuoN5+rEtzq9iIpvjbcDVg+ZouwMVGWWmgkc/ubSsyU= +k8s.io/apimachinery v0.22.0-beta.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/apiserver v0.22.0-beta.1 h1:3QlKzIGfiygb2bfLFaSEEE4J0chF6FJYsr92D3r6a/I= +k8s.io/apiserver v0.22.0-beta.1/go.mod h1:O2uQe3uAm5A1tRRhYEstkyLwiNiWmkwDkMsfwbEYrSY= +k8s.io/cli-runtime v0.22.0-beta.1/go.mod h1:6Q/koeNVFlJoopJfoym51wQ5buU4117G1xNH5j54bcc= +k8s.io/client-go v0.22.0-beta.1 h1:8me4TQms+oRGA9zCjrBzp/QsOLtlwXGiLYweP2TSTGc= +k8s.io/client-go v0.22.0-beta.1/go.mod h1:5KlLMSC7tSopTR11e+r4TQ1PG2G2MTQ3D3riymWJp3k= +k8s.io/cloud-provider v0.22.0-beta.1 h1:yLRqBMxoXcjQ/nUudBJKwgoN6k7TdiYwzpg4UcqfZ2Q= +k8s.io/cloud-provider v0.22.0-beta.1/go.mod h1:WIHj14ttX5hX3sVOFC2kphg0b1xVPm5VCPqBxaec9J0= +k8s.io/cluster-bootstrap v0.22.0-beta.1/go.mod h1:hOSKdcYSG6Vfwdn9JBKo3Ju3h3REA3JKxbbMmDfegdQ= +k8s.io/code-generator v0.22.0-beta.1/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o= +k8s.io/component-base v0.22.0-beta.1 h1:ygIvvL7+WU8vLisI8my2gf9JImGYaf4uc2siasmZQ7Y= +k8s.io/component-base v0.22.0-beta.1/go.mod h1:aSG+PNay+9pkZ26a5+DOLEebeL59ebeAkfNdkMEsi78= +k8s.io/component-helpers v0.22.0-beta.1 h1:AwoHWFNxE7ypTwsV7YWFjfuawMVBiUb2FTwHM5eEM8A= +k8s.io/component-helpers v0.22.0-beta.1/go.mod h1:GOy9qdhvVixYEmd+UiOZQpsiI4PN4r9yMZoU0IRW9YA= +k8s.io/controller-manager v0.22.0-beta.1/go.mod h1:mDv9PkJnuXsBzJDyof7qxk9HYO7Vm+uEiTGWzNsyeBU= +k8s.io/cri-api v0.22.0-beta.1 h1:UcVM+SWD2MPZHrL6bQ3i2fWTHacq609KkwzhZuDKIE8= +k8s.io/cri-api v0.22.0-beta.1/go.mod h1:mj5DGUtElRyErU5AZ8EM0ahxbElYsaLAMTPhLPQ40Eg= +k8s.io/csi-translation-lib v0.22.0-beta.1 h1:nKOX2sHzDCBMnSbLd4DWp00fYJhGGAxjT+wCqdTFcI0= +k8s.io/csi-translation-lib v0.22.0-beta.1/go.mod h1:kQBOaNSce/bvwVN6VHmFyUvEDrXxFkxp+IGdLpOAbwE= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-aggregator v0.22.0-alpha.3/go.mod h1:GvNK5/wxNqUQjKIOEjspoGSjH6d1xZJXqqhU+e0sJ5Q= -k8s.io/kube-controller-manager v0.22.0-alpha.3/go.mod h1:/UvxpHA1cNPZAHqEnDajm2rbVQo83o1cSGMy8+ACUHk= +k8s.io/kube-aggregator v0.22.0-beta.1/go.mod h1:33KDXsAzYFMy/KIg+eRPTv5jK2XfWAmDmm8/NlGPYhc= +k8s.io/kube-controller-manager v0.22.0-beta.1/go.mod h1:1onp9E6RSmA39Oi4QmYsIH9jXgtyC8QKURiUrzd4wYk= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-proxy v0.22.0-alpha.3 h1:devRLMVpiwBs9rU3ZsL12tkiHkK2Db3tAeeHpjnBULQ= -k8s.io/kube-proxy v0.22.0-alpha.3/go.mod h1:D5JZAYjcQveInm108JIFMpQR14DJDHsuoaoKmtD7f0U= -k8s.io/kube-scheduler v0.22.0-alpha.3 h1:vsicj79CVNbjPG9zDRv7ZyjUXf+OX6wefpGn/LI07ig= -k8s.io/kube-scheduler v0.22.0-alpha.3/go.mod h1:30hb9bDYrKr70VpyOa9ijxV/decunuok7xtX0nVfq2I= -k8s.io/kubectl v0.22.0-alpha.3 h1:nXsB7dyMLFXnw+IWm4LoyXLUGaqw/0EMdODOvY4JfFk= -k8s.io/kubectl v0.22.0-alpha.3/go.mod h1:u036CbWS9qdsfu7FFLFJ1hPqZ15eivF4FZaKnMEK3ic= -k8s.io/kubelet v0.22.0-alpha.3 h1:2r8g4Tvqoz0f/BhQg6DiXBLhy8GoesuEFfwRWs+5+bI= -k8s.io/kubelet v0.22.0-alpha.3/go.mod h1:dr4AmkEHtUTtw3rbCJv44wsmW279htOEdTT/vsyLzEE= -k8s.io/kubernetes v1.22.0-alpha.3 h1:qxh3SNSAJgnKc009MsdBBuBH6RxfZERLVw6+lpfPqQ0= -k8s.io/kubernetes v1.22.0-alpha.3/go.mod h1:rapWw7YyYSxlvWmuma/fvGwGQOGVHTGR86jUp7DadxY= -k8s.io/legacy-cloud-providers v0.22.0-alpha.3 h1:8Jv9Bd4WJRilhy9UZGRrZmIXLf0VnI4MuvjfRGUzNXw= -k8s.io/legacy-cloud-providers v0.22.0-alpha.3/go.mod h1:aY5r6gn4Tjp3f8VQhllrQV9U4eX4BFzT0iI1MP2J3vo= -k8s.io/metrics v0.22.0-alpha.3/go.mod h1:DY5svwVJAqf8t5E/svWHLUv4hwv8Z5NE2lmtDEgH/GI= -k8s.io/mount-utils v0.22.0-alpha.3 h1:H8aNm5vbmrBhA9+wxVl/HfOMqSCMW4gy5Wp5RhWQ2qo= -k8s.io/mount-utils v0.22.0-alpha.3/go.mod h1:w7uswZidAfPsX5bpBbv8eGByzO1nPSz0aCTEbo7SL+Q= -k8s.io/sample-apiserver v0.22.0-alpha.3/go.mod h1:zj9mnpJvhHKX7a+5fJS4ryjMVnGZxIs+JlAx67KmSNA= -k8s.io/system-validators v1.4.0/go.mod h1:bPldcLgkIUK22ALflnsXk8pvkTEndYdNuaHH6gRrl0Q= +k8s.io/kube-proxy v0.22.0-beta.1 h1:Hj1y9IeI5tXVXEs2CvM9IjdPurAKCJpmc53VpeZDfGA= +k8s.io/kube-proxy v0.22.0-beta.1/go.mod h1:vodMb7laVZvZ14nNvobXwscrkqagXVw6pNvC+Tf1Ja8= +k8s.io/kube-scheduler v0.22.0-beta.1 h1:lQwOIs0Yx7X8dSDM5MI+98aZpQxv53VKaPsgEJliS7s= +k8s.io/kube-scheduler v0.22.0-beta.1/go.mod h1:/mom2UWOerJngWMKUOfd0y2It/azrRZ+8lT+ZtZE75s= +k8s.io/kubectl v0.22.0-beta.1 h1:VQC2V92flK0ttWRmixe83xwiG+R75IBe6/7LyADyFpI= +k8s.io/kubectl v0.22.0-beta.1/go.mod h1:10POMnLKF8lq7mB4j0NtV5oRHzJcTG+DaSk9AdMg0CA= +k8s.io/kubelet v0.22.0-beta.1 h1:LiUw/F7YocM5NFrXfctoKesc4HD73BCMPU97PYXKjOQ= +k8s.io/kubelet v0.22.0-beta.1/go.mod h1:gIf5h6ek6y+UsRVnrXfRmfRGpN3U3lE5jS+ozaUM07M= +k8s.io/kubernetes v1.22.0-beta.1 h1:LekbNa+aa4orHB1rCQM43Wak62VV5FO/ehSYQV9YB1M= +k8s.io/kubernetes v1.22.0-beta.1/go.mod h1:23US27qm6ep+HKyp7GT18eqzchndKMfOvjEd/CKX7e4= +k8s.io/legacy-cloud-providers v0.22.0-beta.1 h1:R+blGWqV97nViJUAzy26Mj7AJZiKH36VlDRgBOW5q74= +k8s.io/legacy-cloud-providers v0.22.0-beta.1/go.mod h1:MecfAP0OGMN3LRoDKf2UA7Hj7LSanScBvbxFfYAf6hs= +k8s.io/metrics v0.22.0-beta.1/go.mod h1:EOz4RhW/pRdS3n5rIVGKQvfCaNypFNhhG6z7kyXOGi8= +k8s.io/mount-utils v0.22.0-beta.1 h1:SEw2H0vy2fc42D9o676AAzsGRkc5WGM/nDFrkvbiybE= +k8s.io/mount-utils v0.22.0-beta.1/go.mod h1:gUi5ht+05KHYc/vJ9q9wbvG3MCYBeOsB5FdTyM60Pzo= +k8s.io/pod-security-admission v0.22.0-beta.1/go.mod h1:cuWMNQeaiGwBlUJxDxcPz+9FJqUrr/OgwSKP+a6y1uE= +k8s.io/sample-apiserver v0.22.0-beta.1/go.mod h1:x7REXTqqEr366SJzKKv65cET5TbKnmdtS9JSO60ScxQ= +k8s.io/system-validators v1.5.0/go.mod h1:bPldcLgkIUK22ALflnsXk8pvkTEndYdNuaHH6gRrl0Q= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210521133846-da695404a2bc h1:dx6VGe+PnOW/kD/2UV4aUSsRfJGd7+lcqgJ6Xg0HwUs= -k8s.io/utils v0.0.0-20210521133846-da695404a2bc/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 h1:imL9YgXQ9p7xmPzHFm/vVd/cF78jad+n4wK1ABwYtMM= +k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -1074,15 +1117,14 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19 h1:0jaDAAxtqIrrqas4vtTqxct4xS5kHfRNycTRLTyJmVM= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/kustomize/api v0.8.10/go.mod h1:ImeIkhUU7GIhamOtKPlkllt+fkBKL5f6/4NLhVwkinA= -sigs.k8s.io/kustomize/cmd/config v0.9.12/go.mod h1:hVG/nPSqccrnogZ4ehzw3cTSR2fT6hdWeyojILHZivA= -sigs.k8s.io/kustomize/kustomize/v4 v4.1.3/go.mod h1:Zw+pVPW6cHyb0zkOb24HU6NjJziqPY/abiiVLQVrzp4= -sigs.k8s.io/kustomize/kyaml v0.10.20/go.mod h1:TYWhGwW9vjoRh3rWqBwB/ZOXyEGRVWe7Ggc3+KZIO+c= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.21 h1:pZrqT6D1ELgaNLxcp5I2ArxqW7E5rMNFXUppOajqquo= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.21/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/kustomize/api v0.8.11/go.mod h1:a77Ls36JdfCWojpUqR6m60pdGY1AYFix4AH83nJtY1g= +sigs.k8s.io/kustomize/cmd/config v0.9.13/go.mod h1:7547FLF8W/lTaDf0BDqFTbZxM9zqwEJqCKN9sSR0xSs= +sigs.k8s.io/kustomize/kustomize/v4 v4.2.0/go.mod h1:MOkR6fmhwG7hEDRXBYELTi5GSFcLwfqwzTRHW3kv5go= +sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.1 h1:nYqY2A6oy37sKLYuSBXuQhbj4JVclzJK13BOIvJG5XU= -sigs.k8s.io/structured-merge-diff/v4 v4.1.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/cluster-autoscaler/simulator/scheduler_based_predicates_checker.go b/cluster-autoscaler/simulator/scheduler_based_predicates_checker.go index 85c711666b25..64bfa34ae472 100644 --- a/cluster-autoscaler/simulator/scheduler_based_predicates_checker.go +++ b/cluster-autoscaler/simulator/scheduler_based_predicates_checker.go @@ -25,13 +25,10 @@ import ( kube_client "k8s.io/client-go/kubernetes" v1listers "k8s.io/client-go/listers/core/v1" klog "k8s.io/klog/v2" - scheduler_apis_config "k8s.io/kubernetes/pkg/scheduler/apis/config" + scheduler_config "k8s.io/kubernetes/pkg/scheduler/apis/config/latest" schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" scheduler_plugins "k8s.io/kubernetes/pkg/scheduler/framework/plugins" schedulerframeworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime" - - // We need to import provider to initialize default scheduler. - "k8s.io/kubernetes/pkg/scheduler/algorithmprovider" ) // SchedulerBasedPredicateChecker checks whether all required predicates pass for given Pod and Node. @@ -47,16 +44,18 @@ type SchedulerBasedPredicateChecker struct { // NewSchedulerBasedPredicateChecker builds scheduler based PredicateChecker. func NewSchedulerBasedPredicateChecker(kubeClient kube_client.Interface, stop <-chan struct{}) (*SchedulerBasedPredicateChecker, error) { informerFactory := informers.NewSharedInformerFactory(kubeClient, 0) - plugins := algorithmprovider.GetDefaultConfig() - sharedLister := NewDelegatingSchedulerSharedLister() - kubeSchedulerProfile := &scheduler_apis_config.KubeSchedulerProfile{ - Plugins: plugins, - PluginConfig: nil, // This is fine + config, err := scheduler_config.Default() + if err != nil { + return nil, fmt.Errorf("couldn't create scheduler config: %v", err) } + if len(config.Profiles) != 1 || config.Profiles[0].SchedulerName != apiv1.DefaultSchedulerName { + return nil, fmt.Errorf("unexpected scheduler config: expected default scheduler profile only (found %d profiles)", len(config.Profiles)) + } + sharedLister := NewDelegatingSchedulerSharedLister() framework, err := schedulerframeworkruntime.NewFramework( scheduler_plugins.NewInTreeRegistry(), - kubeSchedulerProfile, + &config.Profiles[0], schedulerframeworkruntime.WithInformerFactory(informerFactory), schedulerframeworkruntime.WithSnapshotSharedLister(sharedLister), ) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md index c51c03e958f8..36998b6d59fb 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/CHANGELOG.md @@ -1,96 +1,43 @@ -Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/compute/resource-manager/readme.md tag: `package-2019-12-01` - -Code generator @microsoft.azure/autorest.go@2.1.178 +# Change History +## Additive Changes ### New Funcs -1. *ContainerServicesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ContainerServicesDeleteFuture.UnmarshalJSON([]byte) error -1. *DedicatedHostsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *DedicatedHostsDeleteFuture.UnmarshalJSON([]byte) error -1. *DedicatedHostsUpdateFuture.UnmarshalJSON([]byte) error -1. *DiskEncryptionSetsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *DiskEncryptionSetsDeleteFuture.UnmarshalJSON([]byte) error -1. *DiskEncryptionSetsUpdateFuture.UnmarshalJSON([]byte) error -1. *DisksCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *DisksDeleteFuture.UnmarshalJSON([]byte) error -1. *DisksGrantAccessFuture.UnmarshalJSON([]byte) error -1. *DisksRevokeAccessFuture.UnmarshalJSON([]byte) error -1. *DisksUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleriesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleriesDeleteFuture.UnmarshalJSON([]byte) error -1. *GalleriesUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleryApplicationVersionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleryApplicationVersionsDeleteFuture.UnmarshalJSON([]byte) error -1. *GalleryApplicationVersionsUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleryApplicationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleryApplicationsDeleteFuture.UnmarshalJSON([]byte) error -1. *GalleryApplicationsUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleryImageVersionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleryImageVersionsDeleteFuture.UnmarshalJSON([]byte) error -1. *GalleryImageVersionsUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleryImagesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *GalleryImagesDeleteFuture.UnmarshalJSON([]byte) error -1. *GalleryImagesUpdateFuture.UnmarshalJSON([]byte) error -1. *ImagesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ImagesDeleteFuture.UnmarshalJSON([]byte) error -1. *ImagesUpdateFuture.UnmarshalJSON([]byte) error -1. *LogAnalyticsExportRequestRateByIntervalFuture.UnmarshalJSON([]byte) error -1. *LogAnalyticsExportThrottledRequestsFuture.UnmarshalJSON([]byte) error -1. *SnapshotsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *SnapshotsDeleteFuture.UnmarshalJSON([]byte) error -1. *SnapshotsGrantAccessFuture.UnmarshalJSON([]byte) error -1. *SnapshotsRevokeAccessFuture.UnmarshalJSON([]byte) error -1. *SnapshotsUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineExtensionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineExtensionsDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineExtensionsUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetExtensionsDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetExtensionsUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetRollingUpgradesCancelFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMExtensionsDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMExtensionsUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsDeallocateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsPerformMaintenanceFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsPowerOffFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsRedeployFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsReimageAllFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsReimageFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsRestartFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsRunCommandFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsStartFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetVMsUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsDeallocateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsDeleteInstancesFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsPerformMaintenanceFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsPowerOffFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsRedeployFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsReimageAllFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsReimageFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsRestartFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsStartFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachineScaleSetsUpdateInstancesFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesCaptureFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesConvertToManagedDisksFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesDeallocateFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesPerformMaintenanceFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesPowerOffFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesReapplyFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesRedeployFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesReimageFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesRestartFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesRunCommandFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesStartFuture.UnmarshalJSON([]byte) error -1. *VirtualMachinesUpdateFuture.UnmarshalJSON([]byte) error +1. AccessURI.MarshalJSON() ([]byte, error) +1. BootDiagnosticsInstanceView.MarshalJSON() ([]byte, error) +1. DataDiskImage.MarshalJSON() ([]byte, error) +1. GalleryIdentifier.MarshalJSON() ([]byte, error) +1. LogAnalyticsOperationResult.MarshalJSON() ([]byte, error) +1. LogAnalyticsOutput.MarshalJSON() ([]byte, error) +1. OperationListResult.MarshalJSON() ([]byte, error) +1. OperationValueDisplay.MarshalJSON() ([]byte, error) +1. OrchestrationServiceSummary.MarshalJSON() ([]byte, error) +1. RecoveryWalkResponse.MarshalJSON() ([]byte, error) +1. RegionalReplicationStatus.MarshalJSON() ([]byte, error) +1. ReplicationStatus.MarshalJSON() ([]byte, error) +1. ResourceSku.MarshalJSON() ([]byte, error) +1. ResourceSkuCapabilities.MarshalJSON() ([]byte, error) +1. ResourceSkuCapacity.MarshalJSON() ([]byte, error) +1. ResourceSkuCosts.MarshalJSON() ([]byte, error) +1. ResourceSkuLocationInfo.MarshalJSON() ([]byte, error) +1. ResourceSkuRestrictionInfo.MarshalJSON() ([]byte, error) +1. ResourceSkuRestrictions.MarshalJSON() ([]byte, error) +1. ResourceSkuZoneDetails.MarshalJSON() ([]byte, error) +1. RollbackStatusInfo.MarshalJSON() ([]byte, error) +1. RollingUpgradeProgressInfo.MarshalJSON() ([]byte, error) +1. RollingUpgradeRunningStatus.MarshalJSON() ([]byte, error) +1. RollingUpgradeStatusInfoProperties.MarshalJSON() ([]byte, error) +1. ShareInfoElement.MarshalJSON() ([]byte, error) +1. SubResourceReadOnly.MarshalJSON() ([]byte, error) +1. UpgradeOperationHistoricalStatusInfo.MarshalJSON() ([]byte, error) +1. UpgradeOperationHistoricalStatusInfoProperties.MarshalJSON() ([]byte, error) +1. UpgradeOperationHistoryStatus.MarshalJSON() ([]byte, error) +1. VirtualMachineHealthStatus.MarshalJSON() ([]byte, error) +1. VirtualMachineIdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error) +1. VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error) +1. VirtualMachineScaleSetInstanceViewStatusesSummary.MarshalJSON() ([]byte, error) +1. VirtualMachineScaleSetSku.MarshalJSON() ([]byte, error) +1. VirtualMachineScaleSetSkuCapacity.MarshalJSON() ([]byte, error) +1. VirtualMachineScaleSetVMExtensionsSummary.MarshalJSON() ([]byte, error) +1. VirtualMachineStatusCodeCount.MarshalJSON() ([]byte, error) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/_meta.json new file mode 100644 index 000000000000..19bf9006ede8 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", + "tag": "package-2019-12-01", + "use": "@microsoft.azure/autorest.go@2.1.183", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2019-12-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go index d76fa9c6351c..4cb1fad422d4 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go @@ -27,6 +27,12 @@ type AccessURI struct { AccessSAS *string `json:"accessSAS,omitempty"` } +// MarshalJSON is the custom marshaler for AccessURI. +func (au AccessURI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale // set. type AdditionalCapabilities struct { @@ -509,6 +515,12 @@ type BootDiagnosticsInstanceView struct { Status *InstanceViewStatus `json:"status,omitempty"` } +// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. +func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // CloudError an error response from the Compute service. type CloudError struct { Error *APIError `json:"error,omitempty"` @@ -934,6 +946,7 @@ func (future *ContainerServicesCreateOrUpdateFuture) result(client ContainerServ return } if !done { + cs.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesCreateOrUpdateFuture") return } @@ -976,6 +989,7 @@ func (future *ContainerServicesDeleteFuture) result(client ContainerServicesClie return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesDeleteFuture") return } @@ -1146,6 +1160,12 @@ type DataDiskImage struct { Lun *int32 `json:"lun,omitempty"` } +// MarshalJSON is the custom marshaler for DataDiskImage. +func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // DataDiskImageEncryption contains encryption settings for a data disk image. type DataDiskImageEncryption struct { // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. @@ -1887,6 +1907,7 @@ func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsCl return } if !done { + dh.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") return } @@ -1929,6 +1950,7 @@ func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (a return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") return } @@ -1965,6 +1987,7 @@ func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (d return } if !done { + dh.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") return } @@ -2511,6 +2534,7 @@ func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncrypti return } if !done { + desVar.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") return } @@ -2553,6 +2577,7 @@ func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsCl return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") return } @@ -2589,6 +2614,7 @@ func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsCl return } if !done { + desVar.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") return } @@ -2950,6 +2976,7 @@ func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err return } if !done { + d.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") return } @@ -2991,6 +3018,7 @@ func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Respons return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") return } @@ -3027,6 +3055,7 @@ func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, return } if !done { + au.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") return } @@ -3086,6 +3115,7 @@ func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.R return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") return } @@ -3121,6 +3151,7 @@ func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) return } if !done { + d.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") return } @@ -3323,6 +3354,7 @@ func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g G return } if !done { + g.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") return } @@ -3365,6 +3397,7 @@ func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") return } @@ -3401,6 +3434,7 @@ func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, return } if !done { + g.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") return } @@ -3819,6 +3853,7 @@ func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryAppl return } if !done { + ga.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") return } @@ -3861,6 +3896,7 @@ func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplications return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") return } @@ -3897,6 +3933,7 @@ func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplications return } if !done { + ga.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") return } @@ -4355,6 +4392,7 @@ func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client Gall return } if !done { + gav.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") return } @@ -4397,6 +4435,7 @@ func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryAppli return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") return } @@ -4433,6 +4472,7 @@ func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryAppli return } if !done { + gav.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") return } @@ -4633,6 +4673,12 @@ type GalleryIdentifier struct { UniqueName *string `json:"uniqueName,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryIdentifier. +func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // GalleryImage specifies information about the gallery Image Definition that you want to create or update. type GalleryImage struct { autorest.Response `json:"-"` @@ -4999,6 +5045,7 @@ func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClie return } if !done { + gi.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") return } @@ -5041,6 +5088,7 @@ func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") return } @@ -5077,6 +5125,7 @@ func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi return } if !done { + gi.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") return } @@ -5523,6 +5572,7 @@ func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryIma return } if !done { + giv.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") return } @@ -5565,6 +5615,7 @@ func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersio return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") return } @@ -5609,6 +5660,7 @@ func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersio return } if !done { + giv.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") return } @@ -6443,6 +6495,7 @@ func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, return } if !done { + i.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") return } @@ -6484,6 +6537,7 @@ func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Respo return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") return } @@ -6529,6 +6583,7 @@ func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err erro return } if !done { + i.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") return } @@ -6863,6 +6918,7 @@ func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAn return } if !done { + laor.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") return } @@ -6905,6 +6961,7 @@ func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyt return } if !done { + laor.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") return } @@ -6941,12 +6998,24 @@ type LogAnalyticsOperationResult struct { Properties *LogAnalyticsOutput `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. +func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // LogAnalyticsOutput logAnalytics output properties type LogAnalyticsOutput struct { // Output - READ-ONLY; Output file Uri path to blob container. Output *string `json:"output,omitempty"` } +// MarshalJSON is the custom marshaler for LogAnalyticsOutput. +func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // MaintenanceRedeployStatus maintenance Operation Status. type MaintenanceRedeployStatus struct { // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. @@ -7052,6 +7121,12 @@ type OperationListResult struct { Value *[]OperationValue `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // OperationValue describes the properties of a Compute Operation value. type OperationValue struct { // Origin - READ-ONLY; The origin of the compute operation. @@ -7124,6 +7199,12 @@ type OperationValueDisplay struct { Provider *string `json:"provider,omitempty"` } +// MarshalJSON is the custom marshaler for OperationValueDisplay. +func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // OrchestrationServiceStateInput the input for OrchestrationServiceState type OrchestrationServiceStateInput struct { // ServiceName - The name of the service. Possible values include: 'AutomaticRepairs' @@ -7140,6 +7221,12 @@ type OrchestrationServiceSummary struct { ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` } +// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. +func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // OSDisk specifies information about the operating system disk used by the virtual machine.

For // more information about disks, see [About disks and VHDs for Azure virtual // machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). @@ -7547,6 +7634,12 @@ type RecoveryWalkResponse struct { NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` } +// MarshalJSON is the custom marshaler for RecoveryWalkResponse. +func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // RegionalReplicationStatus this is the regional replication status. type RegionalReplicationStatus struct { // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. @@ -7559,6 +7652,12 @@ type RegionalReplicationStatus struct { Progress *int32 `json:"progress,omitempty"` } +// MarshalJSON is the custom marshaler for RegionalReplicationStatus. +func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ReplicationStatus this is the replication status of the gallery Image Version. type ReplicationStatus struct { // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' @@ -7567,6 +7666,12 @@ type ReplicationStatus struct { Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` } +// MarshalJSON is the custom marshaler for ReplicationStatus. +func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. type RequestRateByIntervalInput struct { // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' @@ -7649,6 +7754,12 @@ type ResourceSku struct { Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceSku. +func (rs ResourceSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ResourceSkuCapabilities describes The SKU capabilities object. type ResourceSkuCapabilities struct { // Name - READ-ONLY; An invariant to describe the feature. @@ -7657,6 +7768,12 @@ type ResourceSkuCapabilities struct { Value *string `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. +func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ResourceSkuCapacity describes scaling information of a SKU. type ResourceSkuCapacity struct { // Minimum - READ-ONLY; The minimum capacity. @@ -7669,6 +7786,12 @@ type ResourceSkuCapacity struct { ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceSkuCapacity. +func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ResourceSkuCosts describes metadata for retrieving price info. type ResourceSkuCosts struct { // MeterID - READ-ONLY; Used for querying price from commerce. @@ -7679,6 +7802,12 @@ type ResourceSkuCosts struct { ExtendedUnit *string `json:"extendedUnit,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceSkuCosts. +func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ResourceSkuLocationInfo ... type ResourceSkuLocationInfo struct { // Location - READ-ONLY; Location of the SKU @@ -7689,6 +7818,12 @@ type ResourceSkuLocationInfo struct { ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. +func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ResourceSkuRestrictionInfo ... type ResourceSkuRestrictionInfo struct { // Locations - READ-ONLY; Locations where the SKU is restricted @@ -7697,6 +7832,12 @@ type ResourceSkuRestrictionInfo struct { Zones *[]string `json:"zones,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. +func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ResourceSkuRestrictions describes scaling information of a SKU. type ResourceSkuRestrictions struct { // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' @@ -7709,6 +7850,12 @@ type ResourceSkuRestrictions struct { ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. +func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ResourceSkusResult the List Resource Skus operation response. type ResourceSkusResult struct { autorest.Response `json:"-"` @@ -7876,6 +8023,12 @@ type ResourceSkuZoneDetails struct { Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. +func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. type RollbackStatusInfo struct { // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. @@ -7886,6 +8039,12 @@ type RollbackStatusInfo struct { RollbackError *APIError `json:"rollbackError,omitempty"` } +// MarshalJSON is the custom marshaler for RollbackStatusInfo. +func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. type RollingUpgradePolicy struct { // MaxBatchInstancePercent - The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. @@ -7911,6 +8070,12 @@ type RollingUpgradeProgressInfo struct { PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` } +// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. +func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // RollingUpgradeRunningStatus information about the current running state of the overall upgrade. type RollingUpgradeRunningStatus struct { // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' @@ -7923,6 +8088,12 @@ type RollingUpgradeRunningStatus struct { LastActionTime *date.Time `json:"lastActionTime,omitempty"` } +// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. +func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. type RollingUpgradeStatusInfo struct { autorest.Response `json:"-"` @@ -8035,6 +8206,12 @@ type RollingUpgradeStatusInfoProperties struct { Error *APIError `json:"error,omitempty"` } +// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. +func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // RunCommandDocument describes the properties of a Run Command. type RunCommandDocument struct { autorest.Response `json:"-"` @@ -8282,6 +8459,12 @@ type ShareInfoElement struct { VMURI *string `json:"vmUri,omitempty"` } +// MarshalJSON is the custom marshaler for ShareInfoElement. +func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware // the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU // name. @@ -8659,6 +8842,7 @@ func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s S return } if !done { + s.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") return } @@ -8701,6 +8885,7 @@ func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") return } @@ -8737,6 +8922,7 @@ func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au Acc return } if !done { + au.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") return } @@ -8796,6 +8982,7 @@ func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar au return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") return } @@ -8832,6 +9019,7 @@ func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, return } if !done { + s.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") return } @@ -9297,6 +9485,12 @@ type SubResourceReadOnly struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for SubResourceReadOnly. +func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // SubResourceWithColocationStatus ... type SubResourceWithColocationStatus struct { // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. @@ -9386,6 +9580,12 @@ type UpgradeOperationHistoricalStatusInfo struct { Location *string `json:"location,omitempty"` } +// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. +func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale // Set. type UpgradeOperationHistoricalStatusInfoProperties struct { @@ -9403,6 +9603,12 @@ type UpgradeOperationHistoricalStatusInfoProperties struct { RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` } +// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. +func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. type UpgradeOperationHistoryStatus struct { // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' @@ -9413,6 +9619,12 @@ type UpgradeOperationHistoryStatus struct { EndTime *date.Time `json:"endTime,omitempty"` } +// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. +func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. type UpgradePolicy struct { // Mode - Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'Automatic', 'Manual', 'Rolling' @@ -9990,6 +10202,7 @@ func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client Virtua return } if !done { + vme.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") return } @@ -10032,6 +10245,7 @@ func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachine return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") return } @@ -10075,6 +10289,7 @@ func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachine return } if !done { + vme.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") return } @@ -10164,6 +10379,12 @@ type VirtualMachineHealthStatus struct { Status *InstanceViewStatus `json:"status,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. +func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualMachineIdentity identity for the virtual machine. type VirtualMachineIdentity struct { // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. @@ -10196,6 +10417,12 @@ type VirtualMachineIdentityUserAssignedIdentitiesValue struct { ClientID *string `json:"clientId,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. +func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualMachineImage describes a Virtual Machine Image. type VirtualMachineImage struct { autorest.Response `json:"-"` @@ -11115,6 +11342,7 @@ func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(clien return } if !done { + vmsse.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") return } @@ -11157,6 +11385,7 @@ func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client Virtua return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") return } @@ -11193,6 +11422,7 @@ func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client Virtua return } if !done { + vmsse.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") return } @@ -11309,6 +11539,12 @@ type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { ClientID *string `json:"clientId,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. +func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. type VirtualMachineScaleSetInstanceView struct { autorest.Response `json:"-"` @@ -11338,6 +11574,12 @@ type VirtualMachineScaleSetInstanceViewStatusesSummary struct { StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. +func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP // configuration. type VirtualMachineScaleSetIPConfiguration struct { @@ -12406,6 +12648,7 @@ func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client V return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") return } @@ -12442,6 +12685,7 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") return } @@ -12478,6 +12722,7 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result( return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") return } @@ -12514,6 +12759,7 @@ func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client Virtual return } if !done { + vmss.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") return } @@ -12556,6 +12802,7 @@ func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMach return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") return } @@ -12592,6 +12839,7 @@ func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineS return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") return } @@ -12628,6 +12876,7 @@ func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client Virtua return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") return } @@ -12645,6 +12894,12 @@ type VirtualMachineScaleSetSku struct { Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. +func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. type VirtualMachineScaleSetSkuCapacity struct { // Minimum - READ-ONLY; The minimum capacity. @@ -12657,6 +12912,12 @@ type VirtualMachineScaleSetSkuCapacity struct { ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. +func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type VirtualMachineScaleSetsPerformMaintenanceFuture struct { @@ -12686,6 +12947,7 @@ func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client Vir return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") return } @@ -12722,6 +12984,7 @@ func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachin return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") return } @@ -12758,6 +13021,7 @@ func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachin return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") return } @@ -12794,6 +13058,7 @@ func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMach return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") return } @@ -12830,6 +13095,7 @@ func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachine return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") return } @@ -12866,6 +13132,7 @@ func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachine return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") return } @@ -12902,6 +13169,7 @@ func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result( return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") return } @@ -12938,6 +13206,7 @@ func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineSc return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") return } @@ -12984,6 +13253,7 @@ func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineS return } if !done { + vmss.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") return } @@ -13026,6 +13296,7 @@ func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client Virtua return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") return } @@ -13639,6 +13910,7 @@ func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(cli return } if !done { + vme.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") return } @@ -13681,6 +13953,7 @@ func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client Virt return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") return } @@ -13697,6 +13970,12 @@ type VirtualMachineScaleSetVMExtensionsSummary struct { StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. +func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { @@ -13726,6 +14005,7 @@ func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client Virt return } if !done { + vme.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") return } @@ -14121,6 +14401,7 @@ func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMa return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") return } @@ -14157,6 +14438,7 @@ func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachin return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") return } @@ -14193,6 +14475,7 @@ func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client V return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") return } @@ -14229,6 +14512,7 @@ func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMach return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") return } @@ -14265,6 +14549,7 @@ func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMach return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") return } @@ -14301,6 +14586,7 @@ func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMa return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") return } @@ -14337,6 +14623,7 @@ func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachi return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") return } @@ -14373,6 +14660,7 @@ func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachi return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") return } @@ -14409,6 +14697,7 @@ func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMa return } if !done { + rcr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") return } @@ -14451,6 +14740,7 @@ func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachine return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") return } @@ -14487,6 +14777,7 @@ func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachin return } if !done { + vmssv.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") return } @@ -14529,6 +14820,7 @@ func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) return } if !done { + vmcr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") return } @@ -14571,6 +14863,7 @@ func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualM return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") return } @@ -14607,6 +14900,7 @@ func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachines return } if !done { + VM.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") return } @@ -14649,6 +14943,7 @@ func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClie return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") return } @@ -14685,6 +14980,7 @@ func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") return } @@ -14744,6 +15040,7 @@ func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMach return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") return } @@ -14780,6 +15077,7 @@ func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") return } @@ -14816,6 +15114,7 @@ func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") return } @@ -14852,6 +15151,7 @@ func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") return } @@ -14888,6 +15188,7 @@ func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") return } @@ -14924,6 +15225,7 @@ func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") return } @@ -14960,6 +15262,7 @@ func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClie return } if !done { + rcr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") return } @@ -15002,6 +15305,7 @@ func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) ( return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") return } @@ -15018,6 +15322,12 @@ type VirtualMachineStatusCodeCount struct { Count *int32 `json:"count,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. +func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesUpdateFuture struct { @@ -15047,6 +15357,7 @@ func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) return } if !done { + VM.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") return } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/CHANGELOG.md index 16a73060963d..2ca630d29da8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/CHANGELOG.md +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/CHANGELOG.md @@ -1,23 +1,9 @@ -Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/containerregistry/resource-manager/readme.md tag: `package-2019-05` - -Code generator @microsoft.azure/autorest.go@2.1.178 +# Change History +## Additive Changes ### New Funcs -1. *RegistriesCreateFuture.UnmarshalJSON([]byte) error -1. *RegistriesDeleteFuture.UnmarshalJSON([]byte) error -1. *RegistriesImportImageFuture.UnmarshalJSON([]byte) error -1. *RegistriesScheduleRunFuture.UnmarshalJSON([]byte) error -1. *RegistriesUpdateFuture.UnmarshalJSON([]byte) error -1. *ReplicationsCreateFuture.UnmarshalJSON([]byte) error -1. *ReplicationsDeleteFuture.UnmarshalJSON([]byte) error -1. *ReplicationsUpdateFuture.UnmarshalJSON([]byte) error -1. *RunsCancelFuture.UnmarshalJSON([]byte) error -1. *RunsUpdateFuture.UnmarshalJSON([]byte) error -1. *TasksCreateFuture.UnmarshalJSON([]byte) error -1. *TasksDeleteFuture.UnmarshalJSON([]byte) error -1. *TasksUpdateFuture.UnmarshalJSON([]byte) error -1. *WebhooksCreateFuture.UnmarshalJSON([]byte) error -1. *WebhooksDeleteFuture.UnmarshalJSON([]byte) error -1. *WebhooksUpdateFuture.UnmarshalJSON([]byte) error +1. ProxyResource.MarshalJSON() ([]byte, error) +1. ReplicationProperties.MarshalJSON() ([]byte, error) +1. Status.MarshalJSON() ([]byte, error) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/_meta.json new file mode 100644 index 000000000000..857266b7c56e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "readme": "/_/azure-rest-api-specs/specification/containerregistry/resource-manager/readme.md", + "tag": "package-2019-05", + "use": "@microsoft.azure/autorest.go@2.1.183", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2019-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/containerregistry/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/models.go index 8561a3d87b4b..d43ac2746328 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry/models.go @@ -1580,6 +1580,12 @@ type ProxyResource struct { Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // QuarantinePolicy the quarantine policy for a container registry. type QuarantinePolicy struct { // Status - The value that indicates whether the policy is enabled or not. Possible values include: 'Enabled', 'Disabled' @@ -1621,6 +1627,7 @@ func (future *RegistriesCreateFuture) result(client RegistriesClient) (r Registr return } if !done { + r.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesCreateFuture") return } @@ -1663,6 +1670,7 @@ func (future *RegistriesDeleteFuture) result(client RegistriesClient) (ar autore return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesDeleteFuture") return } @@ -1699,6 +1707,7 @@ func (future *RegistriesImportImageFuture) result(client RegistriesClient) (ar a return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesImportImageFuture") return } @@ -1735,6 +1744,7 @@ func (future *RegistriesScheduleRunFuture) result(client RegistriesClient) (r Ru return } if !done { + r.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesScheduleRunFuture") return } @@ -1777,6 +1787,7 @@ func (future *RegistriesUpdateFuture) result(client RegistriesClient) (r Registr return } if !done { + r.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesUpdateFuture") return } @@ -2502,6 +2513,12 @@ type ReplicationProperties struct { Status *Status `json:"status,omitempty"` } +// MarshalJSON is the custom marshaler for ReplicationProperties. +func (rp ReplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ReplicationsCreateFuture struct { @@ -2531,6 +2548,7 @@ func (future *ReplicationsCreateFuture) result(client ReplicationsClient) (r Rep return } if !done { + r.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsCreateFuture") return } @@ -2573,6 +2591,7 @@ func (future *ReplicationsDeleteFuture) result(client ReplicationsClient) (ar au return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsDeleteFuture") return } @@ -2609,6 +2628,7 @@ func (future *ReplicationsUpdateFuture) result(client ReplicationsClient) (r Rep return } if !done { + r.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsUpdateFuture") return } @@ -3198,6 +3218,7 @@ func (future *RunsCancelFuture) result(client RunsClient) (ar autorest.Response, return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.RunsCancelFuture") return } @@ -3233,6 +3254,7 @@ func (future *RunsUpdateFuture) result(client RunsClient) (r Run, err error) { return } if !done { + r.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.RunsUpdateFuture") return } @@ -3394,6 +3416,12 @@ type Status struct { Timestamp *date.Time `json:"timestamp,omitempty"` } +// MarshalJSON is the custom marshaler for Status. +func (s Status) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // StorageAccountProperties the properties of a storage account for a container registry. Only applicable // to Classic SKU. type StorageAccountProperties struct { @@ -4024,6 +4052,7 @@ func (future *TasksCreateFuture) result(client TasksClient) (t Task, err error) return } if !done { + t.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.TasksCreateFuture") return } @@ -4065,6 +4094,7 @@ func (future *TasksDeleteFuture) result(client TasksClient) (ar autorest.Respons return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.TasksDeleteFuture") return } @@ -4310,6 +4340,7 @@ func (future *TasksUpdateFuture) result(client TasksClient) (t Task, err error) return } if !done { + t.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.TasksUpdateFuture") return } @@ -4915,6 +4946,7 @@ func (future *WebhooksCreateFuture) result(client WebhooksClient) (w Webhook, er return } if !done { + w.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksCreateFuture") return } @@ -4957,6 +4989,7 @@ func (future *WebhooksDeleteFuture) result(client WebhooksClient) (ar autorest.R return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksDeleteFuture") return } @@ -4993,6 +5026,7 @@ func (future *WebhooksUpdateFuture) result(client WebhooksClient) (w Webhook, er return } if !done { + w.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksUpdateFuture") return } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/CHANGELOG.md index 4adb7524e145..5e6d22160d6d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/CHANGELOG.md +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/CHANGELOG.md @@ -1,20 +1,11 @@ -Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/containerservice/resource-manager/readme.md tag: `package-2020-04` - -Code generator @microsoft.azure/autorest.go@2.1.178 +# Change History +## Additive Changes ### New Funcs -1. *AgentPoolsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *AgentPoolsDeleteFuture.UnmarshalJSON([]byte) error -1. *ContainerServicesCreateOrUpdateFutureType.UnmarshalJSON([]byte) error -1. *ContainerServicesDeleteFutureType.UnmarshalJSON([]byte) error -1. *ManagedClustersCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ManagedClustersDeleteFuture.UnmarshalJSON([]byte) error -1. *ManagedClustersResetAADProfileFuture.UnmarshalJSON([]byte) error -1. *ManagedClustersResetServicePrincipalProfileFuture.UnmarshalJSON([]byte) error -1. *ManagedClustersRotateClusterCertificatesFuture.UnmarshalJSON([]byte) error -1. *ManagedClustersUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *OpenShiftManagedClustersCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *OpenShiftManagedClustersDeleteFuture.UnmarshalJSON([]byte) error -1. *OpenShiftManagedClustersUpdateTagsFuture.UnmarshalJSON([]byte) error +1. CredentialResult.MarshalJSON() ([]byte, error) +1. CredentialResults.MarshalJSON() ([]byte, error) +1. OperationListResult.MarshalJSON() ([]byte, error) +1. OperationValueDisplay.MarshalJSON() ([]byte, error) +1. SubResource.MarshalJSON() ([]byte, error) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/_meta.json new file mode 100644 index 000000000000..091a36e92f59 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "readme": "/_/azure-rest-api-specs/specification/containerservice/resource-manager/readme.md", + "tag": "package-2020-04", + "use": "@microsoft.azure/autorest.go@2.1.183", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2020-04 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/containerservice/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/models.go index 71d00b2460a7..d530b962f7bb 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/models.go @@ -441,6 +441,7 @@ func (future *AgentPoolsCreateOrUpdateFuture) result(client AgentPoolsClient) (a return } if !done { + ap.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsCreateOrUpdateFuture") return } @@ -483,6 +484,7 @@ func (future *AgentPoolsDeleteFuture) result(client AgentPoolsClient) (ar autore return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsDeleteFuture") return } @@ -737,6 +739,7 @@ func (future *ContainerServicesCreateOrUpdateFutureType) result(client Container return } if !done { + cs.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesCreateOrUpdateFutureType") return } @@ -779,6 +782,7 @@ func (future *ContainerServicesDeleteFutureType) result(client ContainerServices return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesDeleteFutureType") return } @@ -794,6 +798,12 @@ type CredentialResult struct { Value *[]byte `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for CredentialResult. +func (cr CredentialResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // CredentialResults the list of credential result response. type CredentialResults struct { autorest.Response `json:"-"` @@ -801,6 +811,12 @@ type CredentialResults struct { Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"` } +// MarshalJSON is the custom marshaler for CredentialResults. +func (cr CredentialResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // CustomProfile properties to configure a custom container service cluster. type CustomProfile struct { // Orchestrator - The name of the custom orchestrator to use. @@ -1929,6 +1945,7 @@ func (future *ManagedClustersCreateOrUpdateFuture) result(client ManagedClusters return } if !done { + mc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture") return } @@ -1971,6 +1988,7 @@ func (future *ManagedClustersDeleteFuture) result(client ManagedClustersClient) return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture") return } @@ -2024,6 +2042,7 @@ func (future *ManagedClustersResetAADProfileFuture) result(client ManagedCluster return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetAADProfileFuture") return } @@ -2060,6 +2079,7 @@ func (future *ManagedClustersResetServicePrincipalProfileFuture) result(client M return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetServicePrincipalProfileFuture") return } @@ -2096,6 +2116,7 @@ func (future *ManagedClustersRotateClusterCertificatesFuture) result(client Mana return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRotateClusterCertificatesFuture") return } @@ -2132,6 +2153,7 @@ func (future *ManagedClustersUpdateTagsFuture) result(client ManagedClustersClie return } if !done { + mc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersUpdateTagsFuture") return } @@ -2880,6 +2902,7 @@ func (future *OpenShiftManagedClustersCreateOrUpdateFuture) result(client OpenSh return } if !done { + osmc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersCreateOrUpdateFuture") return } @@ -2922,6 +2945,7 @@ func (future *OpenShiftManagedClustersDeleteFuture) result(client OpenShiftManag return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersDeleteFuture") return } @@ -2958,6 +2982,7 @@ func (future *OpenShiftManagedClustersUpdateTagsFuture) result(client OpenShiftM return } if !done { + osmc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersUpdateTagsFuture") return } @@ -2997,6 +3022,12 @@ type OperationListResult struct { Value *[]OperationValue `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // OperationValue describes the properties of a Compute Operation value. type OperationValue struct { // Origin - READ-ONLY; The origin of the compute operation. @@ -3070,6 +3101,12 @@ type OperationValueDisplay struct { Provider *string `json:"provider,omitempty"` } +// MarshalJSON is the custom marshaler for OperationValueDisplay. +func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // OrchestratorProfile contains information about orchestrator. type OrchestratorProfile struct { // OrchestratorType - Orchestrator type. @@ -3310,6 +3347,12 @@ type SubResource struct { Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for SubResource. +func (sr SubResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // TagsObject tags object for patch operations. type TagsObject struct { // Tags - Resource tags. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/CHANGELOG.md index 31ca48a5d321..e842382779a5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/CHANGELOG.md +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/CHANGELOG.md @@ -1,186 +1,28 @@ -Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/network/resource-manager/readme.md tag: `package-2019-06` - -Code generator @microsoft.azure/autorest.go@2.1.178 +# Change History +## Additive Changes ### New Funcs -1. *ApplicationGatewaysBackendHealthFuture.UnmarshalJSON([]byte) error -1. *ApplicationGatewaysBackendHealthOnDemandFuture.UnmarshalJSON([]byte) error -1. *ApplicationGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ApplicationGatewaysDeleteFuture.UnmarshalJSON([]byte) error -1. *ApplicationGatewaysStartFuture.UnmarshalJSON([]byte) error -1. *ApplicationGatewaysStopFuture.UnmarshalJSON([]byte) error -1. *ApplicationGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *ApplicationSecurityGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ApplicationSecurityGroupsDeleteFuture.UnmarshalJSON([]byte) error -1. *ApplicationSecurityGroupsUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *AzureFirewallsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *AzureFirewallsDeleteFuture.UnmarshalJSON([]byte) error -1. *BastionHostsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *BastionHostsDeleteFuture.UnmarshalJSON([]byte) error -1. *BastionHostsUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *ConnectionMonitorsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ConnectionMonitorsDeleteFuture.UnmarshalJSON([]byte) error -1. *ConnectionMonitorsQueryFuture.UnmarshalJSON([]byte) error -1. *ConnectionMonitorsStartFuture.UnmarshalJSON([]byte) error -1. *ConnectionMonitorsStopFuture.UnmarshalJSON([]byte) error -1. *DdosCustomPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *DdosCustomPoliciesDeleteFuture.UnmarshalJSON([]byte) error -1. *DdosCustomPoliciesUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *DdosProtectionPlansCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *DdosProtectionPlansDeleteFuture.UnmarshalJSON([]byte) error -1. *DdosProtectionPlansUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitAuthorizationsDeleteFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitConnectionsDeleteFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitPeeringsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitPeeringsDeleteFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitsDeleteFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitsListArpTableFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitsListRoutesTableFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitsListRoutesTableSummaryFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCircuitsUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteConnectionsDeleteFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCrossConnectionPeeringsDeleteFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCrossConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCrossConnectionsListArpTableFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCrossConnectionsListRoutesTableFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteCrossConnectionsUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ExpressRouteGatewaysDeleteFuture.UnmarshalJSON([]byte) error -1. *ExpressRoutePortsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ExpressRoutePortsDeleteFuture.UnmarshalJSON([]byte) error -1. *ExpressRoutePortsUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *FirewallPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *FirewallPoliciesDeleteFuture.UnmarshalJSON([]byte) error -1. *FirewallPolicyRuleGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *FirewallPolicyRuleGroupsDeleteFuture.UnmarshalJSON([]byte) error -1. *InboundNatRulesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *InboundNatRulesDeleteFuture.UnmarshalJSON([]byte) error -1. *InterfaceTapConfigurationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *InterfaceTapConfigurationsDeleteFuture.UnmarshalJSON([]byte) error -1. *InterfacesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *InterfacesDeleteFuture.UnmarshalJSON([]byte) error -1. *InterfacesGetEffectiveRouteTableFuture.UnmarshalJSON([]byte) error -1. *InterfacesListEffectiveNetworkSecurityGroupsFuture.UnmarshalJSON([]byte) error -1. *InterfacesUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *LoadBalancersCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *LoadBalancersDeleteFuture.UnmarshalJSON([]byte) error -1. *LoadBalancersUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *LocalNetworkGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *LocalNetworkGatewaysDeleteFuture.UnmarshalJSON([]byte) error -1. *LocalNetworkGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *NatGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *NatGatewaysDeleteFuture.UnmarshalJSON([]byte) error -1. *P2sVpnGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *P2sVpnGatewaysDeleteFuture.UnmarshalJSON([]byte) error -1. *P2sVpnGatewaysGenerateVpnProfileFuture.UnmarshalJSON([]byte) error -1. *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture.UnmarshalJSON([]byte) error -1. *P2sVpnGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *P2sVpnServerConfigurationsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *P2sVpnServerConfigurationsDeleteFuture.UnmarshalJSON([]byte) error -1. *PacketCapturesCreateFuture.UnmarshalJSON([]byte) error -1. *PacketCapturesDeleteFuture.UnmarshalJSON([]byte) error -1. *PacketCapturesGetStatusFuture.UnmarshalJSON([]byte) error -1. *PacketCapturesStopFuture.UnmarshalJSON([]byte) error -1. *PrivateEndpointsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *PrivateEndpointsDeleteFuture.UnmarshalJSON([]byte) error -1. *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture.UnmarshalJSON([]byte) error -1. *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture.UnmarshalJSON([]byte) error -1. *PrivateLinkServicesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *PrivateLinkServicesDeleteFuture.UnmarshalJSON([]byte) error -1. *PrivateLinkServicesDeletePrivateEndpointConnectionFuture.UnmarshalJSON([]byte) error -1. *ProfilesDeleteFuture.UnmarshalJSON([]byte) error -1. *PublicIPAddressesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *PublicIPAddressesDeleteFuture.UnmarshalJSON([]byte) error -1. *PublicIPAddressesUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *PublicIPPrefixesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *PublicIPPrefixesDeleteFuture.UnmarshalJSON([]byte) error -1. *PublicIPPrefixesUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *RouteFilterRulesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *RouteFilterRulesDeleteFuture.UnmarshalJSON([]byte) error -1. *RouteFilterRulesUpdateFuture.UnmarshalJSON([]byte) error -1. *RouteFiltersCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *RouteFiltersDeleteFuture.UnmarshalJSON([]byte) error -1. *RouteFiltersUpdateFuture.UnmarshalJSON([]byte) error -1. *RouteTablesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *RouteTablesDeleteFuture.UnmarshalJSON([]byte) error -1. *RouteTablesUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *RoutesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *RoutesDeleteFuture.UnmarshalJSON([]byte) error -1. *SecurityGroupsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *SecurityGroupsDeleteFuture.UnmarshalJSON([]byte) error -1. *SecurityGroupsUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *SecurityRulesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *SecurityRulesDeleteFuture.UnmarshalJSON([]byte) error -1. *ServiceEndpointPoliciesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ServiceEndpointPoliciesDeleteFuture.UnmarshalJSON([]byte) error -1. *ServiceEndpointPoliciesUpdateFuture.UnmarshalJSON([]byte) error -1. *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *ServiceEndpointPolicyDefinitionsDeleteFuture.UnmarshalJSON([]byte) error -1. *SubnetsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *SubnetsDeleteFuture.UnmarshalJSON([]byte) error -1. *SubnetsPrepareNetworkPoliciesFuture.UnmarshalJSON([]byte) error -1. *SubnetsUnprepareNetworkPoliciesFuture.UnmarshalJSON([]byte) error -1. *VirtualHubsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualHubsDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualHubsUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewayConnectionsDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewayConnectionsResetSharedKeyFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewayConnectionsSetSharedKeyFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewayConnectionsUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysGenerateVpnProfileFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysGeneratevpnclientpackageFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysGetAdvertisedRoutesFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysGetBgpPeerStatusFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysGetLearnedRoutesFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysResetFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkPeeringsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkPeeringsDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkTapsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkTapsDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworkTapsUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworksCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworksDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualNetworksUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *VirtualWansCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VirtualWansDeleteFuture.UnmarshalJSON([]byte) error -1. *VirtualWansUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *VpnConnectionsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VpnConnectionsDeleteFuture.UnmarshalJSON([]byte) error -1. *VpnGatewaysCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VpnGatewaysDeleteFuture.UnmarshalJSON([]byte) error -1. *VpnGatewaysResetFuture.UnmarshalJSON([]byte) error -1. *VpnGatewaysUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *VpnSitesConfigurationDownloadFuture.UnmarshalJSON([]byte) error -1. *VpnSitesCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *VpnSitesDeleteFuture.UnmarshalJSON([]byte) error -1. *VpnSitesUpdateTagsFuture.UnmarshalJSON([]byte) error -1. *WatchersCheckConnectivityFuture.UnmarshalJSON([]byte) error -1. *WatchersDeleteFuture.UnmarshalJSON([]byte) error -1. *WatchersGetAzureReachabilityReportFuture.UnmarshalJSON([]byte) error -1. *WatchersGetFlowLogStatusFuture.UnmarshalJSON([]byte) error -1. *WatchersGetNetworkConfigurationDiagnosticFuture.UnmarshalJSON([]byte) error -1. *WatchersGetNextHopFuture.UnmarshalJSON([]byte) error -1. *WatchersGetTroubleshootingFuture.UnmarshalJSON([]byte) error -1. *WatchersGetTroubleshootingResultFuture.UnmarshalJSON([]byte) error -1. *WatchersGetVMSecurityRulesFuture.UnmarshalJSON([]byte) error -1. *WatchersListAvailableProvidersFuture.UnmarshalJSON([]byte) error -1. *WatchersSetFlowLogConfigurationFuture.UnmarshalJSON([]byte) error -1. *WatchersVerifyIPFlowFuture.UnmarshalJSON([]byte) error -1. *WebApplicationFirewallPoliciesDeleteFuture.UnmarshalJSON([]byte) error +1. ApplicationSecurityGroupPropertiesFormat.MarshalJSON() ([]byte, error) +1. AzureFirewallFqdnTagPropertiesFormat.MarshalJSON() ([]byte, error) +1. BgpPeerStatus.MarshalJSON() ([]byte, error) +1. ConfigurationDiagnosticResponse.MarshalJSON() ([]byte, error) +1. ConnectivityHop.MarshalJSON() ([]byte, error) +1. ConnectivityInformation.MarshalJSON() ([]byte, error) +1. ConnectivityIssue.MarshalJSON() ([]byte, error) +1. ContainerNetworkInterfaceIPConfigurationPropertiesFormat.MarshalJSON() ([]byte, error) +1. DdosProtectionPlanPropertiesFormat.MarshalJSON() ([]byte, error) +1. ExpressRouteConnectionID.MarshalJSON() ([]byte, error) +1. ExpressRoutePortsLocationBandwidths.MarshalJSON() ([]byte, error) +1. GatewayRoute.MarshalJSON() ([]byte, error) +1. ManagedServiceIdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error) +1. ServiceTagInformation.MarshalJSON() ([]byte, error) +1. ServiceTagInformationPropertiesFormat.MarshalJSON() ([]byte, error) +1. ServiceTagsListResult.MarshalJSON() ([]byte, error) +1. TunnelConnectionHealth.MarshalJSON() ([]byte, error) +1. VirtualNetworkUsage.MarshalJSON() ([]byte, error) +1. VirtualNetworkUsageName.MarshalJSON() ([]byte, error) +1. VpnClientConnectionHealthDetail.MarshalJSON() ([]byte, error) +1. VpnSiteID.MarshalJSON() ([]byte, error) +1. WebApplicationFirewallPolicyListResult.MarshalJSON() ([]byte, error) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/_meta.json new file mode 100644 index 000000000000..0a8c4c4c8d40 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "readme": "/_/azure-rest-api-specs/specification/network/resource-manager/readme.md", + "tag": "package-2019-06", + "use": "@microsoft.azure/autorest.go@2.1.183", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2019-06 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/network/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go index fd8d5c5175d4..03d784918fb2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network/models.go @@ -2410,6 +2410,7 @@ func (future *ApplicationGatewaysBackendHealthFuture) result(client ApplicationG return } if !done { + agbh.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthFuture") return } @@ -2452,6 +2453,7 @@ func (future *ApplicationGatewaysBackendHealthOnDemandFuture) result(client Appl return } if !done { + agbhod.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthOnDemandFuture") return } @@ -2494,6 +2496,7 @@ func (future *ApplicationGatewaysCreateOrUpdateFuture) result(client Application return } if !done { + ag.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture") return } @@ -2536,6 +2539,7 @@ func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGateways return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture") return } @@ -2783,6 +2787,7 @@ func (future *ApplicationGatewaysStartFuture) result(client ApplicationGatewaysC return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture") return } @@ -2819,6 +2824,7 @@ func (future *ApplicationGatewaysStopFuture) result(client ApplicationGatewaysCl return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture") return } @@ -2855,6 +2861,7 @@ func (future *ApplicationGatewaysUpdateTagsFuture) result(client ApplicationGate return } if !done { + ag.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysUpdateTagsFuture") return } @@ -3474,6 +3481,12 @@ type ApplicationSecurityGroupPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ApplicationSecurityGroupPropertiesFormat. +func (asgpf ApplicationSecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ApplicationSecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ApplicationSecurityGroupsCreateOrUpdateFuture struct { @@ -3503,6 +3516,7 @@ func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) result(client Appli return } if !done { + asg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsCreateOrUpdateFuture") return } @@ -3545,6 +3559,7 @@ func (future *ApplicationSecurityGroupsDeleteFuture) result(client ApplicationSe return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsDeleteFuture") return } @@ -3581,6 +3596,7 @@ func (future *ApplicationSecurityGroupsUpdateTagsFuture) result(client Applicati return } if !done { + asg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsUpdateTagsFuture") return } @@ -4901,6 +4917,12 @@ type AzureFirewallFqdnTagPropertiesFormat struct { FqdnTagName *string `json:"fqdnTagName,omitempty"` } +// MarshalJSON is the custom marshaler for AzureFirewallFqdnTagPropertiesFormat. +func (afftpf AzureFirewallFqdnTagPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // AzureFirewallIPConfiguration IP configuration of an Azure Firewall. type AzureFirewallIPConfiguration struct { // AzureFirewallIPConfigurationPropertiesFormat - Properties of the azure firewall IP configuration. @@ -5480,6 +5502,7 @@ func (future *AzureFirewallsCreateOrUpdateFuture) result(client AzureFirewallsCl return } if !done { + af.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsCreateOrUpdateFuture") return } @@ -5522,6 +5545,7 @@ func (future *AzureFirewallsDeleteFuture) result(client AzureFirewallsClient) (a return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsDeleteFuture") return } @@ -6112,6 +6136,7 @@ func (future *BastionHostsCreateOrUpdateFuture) result(client BastionHostsClient return } if !done { + bh.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.BastionHostsCreateOrUpdateFuture") return } @@ -6154,6 +6179,7 @@ func (future *BastionHostsDeleteFuture) result(client BastionHostsClient) (ar au return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.BastionHostsDeleteFuture") return } @@ -6190,6 +6216,7 @@ func (future *BastionHostsUpdateTagsFuture) result(client BastionHostsClient) (b return } if !done { + bh.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.BastionHostsUpdateTagsFuture") return } @@ -6239,6 +6266,12 @@ type BgpPeerStatus struct { MessagesReceived *int64 `json:"messagesReceived,omitempty"` } +// MarshalJSON is the custom marshaler for BgpPeerStatus. +func (bps BgpPeerStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // BgpPeerStatusListResult response for list BGP peer status API service call. type BgpPeerStatusListResult struct { autorest.Response `json:"-"` @@ -6583,6 +6616,12 @@ type ConfigurationDiagnosticResponse struct { Results *[]ConfigurationDiagnosticResult `json:"results,omitempty"` } +// MarshalJSON is the custom marshaler for ConfigurationDiagnosticResponse. +func (cdr ConfigurationDiagnosticResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ConfigurationDiagnosticResult network configuration diagnostic result corresponded to provided traffic // query. type ConfigurationDiagnosticResult struct { @@ -6859,6 +6898,7 @@ func (future *ConnectionMonitorsCreateOrUpdateFuture) result(client ConnectionMo return } if !done { + cmr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsCreateOrUpdateFuture") return } @@ -6901,6 +6941,7 @@ func (future *ConnectionMonitorsDeleteFuture) result(client ConnectionMonitorsCl return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsDeleteFuture") return } @@ -6945,6 +6986,7 @@ func (future *ConnectionMonitorsQueryFuture) result(client ConnectionMonitorsCli return } if !done { + cmqr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsQueryFuture") return } @@ -6987,6 +7029,7 @@ func (future *ConnectionMonitorsStartFuture) result(client ConnectionMonitorsCli return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStartFuture") return } @@ -7023,6 +7066,7 @@ func (future *ConnectionMonitorsStopFuture) result(client ConnectionMonitorsClie return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStopFuture") return } @@ -7129,6 +7173,12 @@ type ConnectivityHop struct { Issues *[]ConnectivityIssue `json:"issues,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectivityHop. +func (ch ConnectivityHop) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ConnectivityInformation information on the connectivity status. type ConnectivityInformation struct { autorest.Response `json:"-"` @@ -7148,6 +7198,12 @@ type ConnectivityInformation struct { ProbesFailed *int32 `json:"probesFailed,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectivityInformation. +func (ci ConnectivityInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ConnectivityIssue information about an issue encountered in the process of checking for connectivity. type ConnectivityIssue struct { // Origin - READ-ONLY; The origin of the issue. Possible values include: 'OriginLocal', 'OriginInbound', 'OriginOutbound' @@ -7160,6 +7216,12 @@ type ConnectivityIssue struct { Context *[]map[string]*string `json:"context,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectivityIssue. +func (ci ConnectivityIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ConnectivityParameters parameters that determine how the connectivity check will be performed. type ConnectivityParameters struct { // Source - Describes the source of the connection. @@ -7478,6 +7540,12 @@ type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceIPConfigurationPropertiesFormat. +func (cniicpf ContainerNetworkInterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ContainerNetworkInterfacePropertiesFormat properties of container network interface. type ContainerNetworkInterfacePropertiesFormat struct { // ContainerNetworkInterfaceConfiguration - Container network interface configuration from which this container network interface is created. @@ -7534,6 +7602,7 @@ func (future *DdosCustomPoliciesCreateOrUpdateFuture) result(client DdosCustomPo return } if !done { + dcp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.DdosCustomPoliciesCreateOrUpdateFuture") return } @@ -7576,6 +7645,7 @@ func (future *DdosCustomPoliciesDeleteFuture) result(client DdosCustomPoliciesCl return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.DdosCustomPoliciesDeleteFuture") return } @@ -7612,6 +7682,7 @@ func (future *DdosCustomPoliciesUpdateTagsFuture) result(client DdosCustomPolici return } if !done { + dcp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.DdosCustomPoliciesUpdateTagsFuture") return } @@ -8051,6 +8122,12 @@ type DdosProtectionPlanPropertiesFormat struct { VirtualNetworks *[]SubResource `json:"virtualNetworks,omitempty"` } +// MarshalJSON is the custom marshaler for DdosProtectionPlanPropertiesFormat. +func (dpppf DdosProtectionPlanPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // DdosProtectionPlansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DdosProtectionPlansCreateOrUpdateFuture struct { @@ -8080,6 +8157,7 @@ func (future *DdosProtectionPlansCreateOrUpdateFuture) result(client DdosProtect return } if !done { + dpp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansCreateOrUpdateFuture") return } @@ -8122,6 +8200,7 @@ func (future *DdosProtectionPlansDeleteFuture) result(client DdosProtectionPlans return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansDeleteFuture") return } @@ -8158,6 +8237,7 @@ func (future *DdosProtectionPlansUpdateTagsFuture) result(client DdosProtectionP return } if !done { + dpp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansUpdateTagsFuture") return } @@ -8917,6 +8997,7 @@ func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) result(clie return } if !done { + erca.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture") return } @@ -8959,6 +9040,7 @@ func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) result(client Expre return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture") return } @@ -9284,6 +9366,7 @@ func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) result(client return } if !done { + ercc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture") return } @@ -9326,6 +9409,7 @@ func (future *ExpressRouteCircuitConnectionsDeleteFuture) result(client ExpressR return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsDeleteFuture") return } @@ -9902,6 +9986,7 @@ func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) result(client Exp return } if !done { + ercp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture") return } @@ -9944,6 +10029,7 @@ func (future *ExpressRouteCircuitPeeringsDeleteFuture) result(client ExpressRout return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture") return } @@ -10101,6 +10187,7 @@ func (future *ExpressRouteCircuitsCreateOrUpdateFuture) result(client ExpressRou return } if !done { + erc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture") return } @@ -10143,6 +10230,7 @@ func (future *ExpressRouteCircuitsDeleteFuture) result(client ExpressRouteCircui return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture") return } @@ -10200,6 +10288,7 @@ func (future *ExpressRouteCircuitsListArpTableFuture) result(client ExpressRoute return } if !done { + ercatlr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture") return } @@ -10242,6 +10331,7 @@ func (future *ExpressRouteCircuitsListRoutesTableFuture) result(client ExpressRo return } if !done { + ercrtlr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture") return } @@ -10284,6 +10374,7 @@ func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) result(client Ex return } if !done { + ercrtslr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture") return } @@ -10359,6 +10450,7 @@ func (future *ExpressRouteCircuitsUpdateTagsFuture) result(client ExpressRouteCi return } if !done { + erc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsUpdateTagsFuture") return } @@ -10446,6 +10538,12 @@ type ExpressRouteConnectionID struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteConnectionID. +func (erci ExpressRouteConnectionID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ExpressRouteConnectionList expressRouteConnection list. type ExpressRouteConnectionList struct { autorest.Response `json:"-"` @@ -10494,6 +10592,7 @@ func (future *ExpressRouteConnectionsCreateOrUpdateFuture) result(client Express return } if !done { + erc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteConnectionsCreateOrUpdateFuture") return } @@ -10536,6 +10635,7 @@ func (future *ExpressRouteConnectionsDeleteFuture) result(client ExpressRouteCon return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteConnectionsDeleteFuture") return } @@ -11178,6 +11278,7 @@ func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) result(cl return } if !done { + erccp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture") return } @@ -11220,6 +11321,7 @@ func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) result(client Exp return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsDeleteFuture") return } @@ -11316,6 +11418,7 @@ func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) result(client Ex return } if !done { + ercc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsCreateOrUpdateFuture") return } @@ -11358,6 +11461,7 @@ func (future *ExpressRouteCrossConnectionsListArpTableFuture) result(client Expr return } if !done { + ercatlr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListArpTableFuture") return } @@ -11400,6 +11504,7 @@ func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) result(client E return } if !done { + ercrtlr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableFuture") return } @@ -11442,6 +11547,7 @@ func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) result(c return } if !done { + erccrtslr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture") return } @@ -11503,6 +11609,7 @@ func (future *ExpressRouteCrossConnectionsUpdateTagsFuture) result(client Expres return } if !done { + ercc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsUpdateTagsFuture") return } @@ -11709,6 +11816,7 @@ func (future *ExpressRouteGatewaysCreateOrUpdateFuture) result(client ExpressRou return } if !done { + erg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysCreateOrUpdateFuture") return } @@ -11751,6 +11859,7 @@ func (future *ExpressRouteGatewaysDeleteFuture) result(client ExpressRouteGatewa return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysDeleteFuture") return } @@ -12373,6 +12482,7 @@ func (future *ExpressRoutePortsCreateOrUpdateFuture) result(client ExpressRouteP return } if !done { + erp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortsCreateOrUpdateFuture") return } @@ -12415,6 +12525,7 @@ func (future *ExpressRoutePortsDeleteFuture) result(client ExpressRoutePortsClie return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortsDeleteFuture") return } @@ -12534,6 +12645,12 @@ type ExpressRoutePortsLocationBandwidths struct { ValueInGbps *int32 `json:"valueInGbps,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRoutePortsLocationBandwidths. +func (erplb ExpressRoutePortsLocationBandwidths) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ExpressRoutePortsLocationListResult response for ListExpressRoutePortsLocations API service call. type ExpressRoutePortsLocationListResult struct { autorest.Response `json:"-"` @@ -12745,6 +12862,7 @@ func (future *ExpressRoutePortsUpdateTagsFuture) result(client ExpressRoutePorts return } if !done { + erp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortsUpdateTagsFuture") return } @@ -13069,6 +13187,7 @@ func (future *FirewallPoliciesCreateOrUpdateFuture) result(client FirewallPolici return } if !done { + fp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.FirewallPoliciesCreateOrUpdateFuture") return } @@ -13111,6 +13230,7 @@ func (future *FirewallPoliciesDeleteFuture) result(client FirewallPoliciesClient return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.FirewallPoliciesDeleteFuture") return } @@ -14217,6 +14337,7 @@ func (future *FirewallPolicyRuleGroupsCreateOrUpdateFuture) result(client Firewa return } if !done { + fprg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.FirewallPolicyRuleGroupsCreateOrUpdateFuture") return } @@ -14259,6 +14380,7 @@ func (future *FirewallPolicyRuleGroupsDeleteFuture) result(client FirewallPolicy return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.FirewallPolicyRuleGroupsDeleteFuture") return } @@ -14539,6 +14661,12 @@ type GatewayRoute struct { Weight *int32 `json:"weight,omitempty"` } +// MarshalJSON is the custom marshaler for GatewayRoute. +func (gr GatewayRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // GatewayRouteListResult list of virtual network gateway routes. type GatewayRouteListResult struct { autorest.Response `json:"-"` @@ -15129,6 +15257,7 @@ func (future *InboundNatRulesCreateOrUpdateFuture) result(client InboundNatRules return } if !done { + inr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesCreateOrUpdateFuture") return } @@ -15171,6 +15300,7 @@ func (future *InboundNatRulesDeleteFuture) result(client InboundNatRulesClient) return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesDeleteFuture") return } @@ -16079,6 +16209,7 @@ func (future *InterfacesCreateOrUpdateFuture) result(client InterfacesClient) (i return } if !done { + i.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture") return } @@ -16121,6 +16252,7 @@ func (future *InterfacesDeleteFuture) result(client InterfacesClient) (ar autore return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture") return } @@ -16157,6 +16289,7 @@ func (future *InterfacesGetEffectiveRouteTableFuture) result(client InterfacesCl return } if !done { + erlr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.InterfacesGetEffectiveRouteTableFuture") return } @@ -16199,6 +16332,7 @@ func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) result(client return } if !done { + ensglr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture") return } @@ -16241,6 +16375,7 @@ func (future *InterfacesUpdateTagsFuture) result(client InterfacesClient) (i Int return } if !done { + i.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.InterfacesUpdateTagsFuture") return } @@ -16562,6 +16697,7 @@ func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) result(client Inte return } if !done { + itc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.InterfaceTapConfigurationsCreateOrUpdateFuture") return } @@ -16604,6 +16740,7 @@ func (future *InterfaceTapConfigurationsDeleteFuture) result(client InterfaceTap return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.InterfaceTapConfigurationsDeleteFuture") return } @@ -19670,6 +19807,7 @@ func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClie return } if !done { + lb.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") return } @@ -19712,6 +19850,7 @@ func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") return } @@ -19754,6 +19893,7 @@ func (future *LoadBalancersUpdateTagsFuture) result(client LoadBalancersClient) return } if !done { + lb.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.LoadBalancersUpdateTagsFuture") return } @@ -20236,6 +20376,7 @@ func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetwo return } if !done { + lng.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") return } @@ -20278,6 +20419,7 @@ func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewa return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") return } @@ -20314,6 +20456,7 @@ func (future *LocalNetworkGatewaysUpdateTagsFuture) result(client LocalNetworkGa return } if !done { + lng.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysUpdateTagsFuture") return } @@ -20369,6 +20512,12 @@ type ManagedServiceIdentityUserAssignedIdentitiesValue struct { ClientID *string `json:"clientId,omitempty"` } +// MarshalJSON is the custom marshaler for ManagedServiceIdentityUserAssignedIdentitiesValue. +func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // MatchCondition define match conditions. type MatchCondition struct { // MatchVariables - List of match variables. @@ -20802,6 +20951,7 @@ func (future *NatGatewaysCreateOrUpdateFuture) result(client NatGatewaysClient) return } if !done { + ng.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.NatGatewaysCreateOrUpdateFuture") return } @@ -20844,6 +20994,7 @@ func (future *NatGatewaysDeleteFuture) result(client NatGatewaysClient) (ar auto return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.NatGatewaysDeleteFuture") return } @@ -21444,6 +21595,7 @@ func (future *P2sVpnGatewaysCreateOrUpdateFuture) result(client P2sVpnGatewaysCl return } if !done { + pvg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysCreateOrUpdateFuture") return } @@ -21486,6 +21638,7 @@ func (future *P2sVpnGatewaysDeleteFuture) result(client P2sVpnGatewaysClient) (a return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysDeleteFuture") return } @@ -21522,6 +21675,7 @@ func (future *P2sVpnGatewaysGenerateVpnProfileFuture) result(client P2sVpnGatewa return } if !done { + vpr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGenerateVpnProfileFuture") return } @@ -21564,6 +21718,7 @@ func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) result(client P2sVp return } if !done { + pvg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture") return } @@ -21606,6 +21761,7 @@ func (future *P2sVpnGatewaysUpdateTagsFuture) result(client P2sVpnGatewaysClient return } if !done { + pvg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysUpdateTagsFuture") return } @@ -21997,6 +22153,7 @@ func (future *P2sVpnServerConfigurationsCreateOrUpdateFuture) result(client P2sV return } if !done { + pvsc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.P2sVpnServerConfigurationsCreateOrUpdateFuture") return } @@ -22039,6 +22196,7 @@ func (future *P2sVpnServerConfigurationsDeleteFuture) result(client P2sVpnServer return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.P2sVpnServerConfigurationsDeleteFuture") return } @@ -22461,6 +22619,7 @@ func (future *PacketCapturesCreateFuture) result(client PacketCapturesClient) (p return } if !done { + pcr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PacketCapturesCreateFuture") return } @@ -22503,6 +22662,7 @@ func (future *PacketCapturesDeleteFuture) result(client PacketCapturesClient) (a return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PacketCapturesDeleteFuture") return } @@ -22539,6 +22699,7 @@ func (future *PacketCapturesGetStatusFuture) result(client PacketCapturesClient) return } if !done { + pcqsr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PacketCapturesGetStatusFuture") return } @@ -22581,6 +22742,7 @@ func (future *PacketCapturesStopFuture) result(client PacketCapturesClient) (ar return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PacketCapturesStopFuture") return } @@ -23533,6 +23695,7 @@ func (future *PrivateEndpointsCreateOrUpdateFuture) result(client PrivateEndpoin return } if !done { + peVar.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PrivateEndpointsCreateOrUpdateFuture") return } @@ -23575,6 +23738,7 @@ func (future *PrivateEndpointsDeleteFuture) result(client PrivateEndpointsClient return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PrivateEndpointsDeleteFuture") return } @@ -24177,6 +24341,7 @@ func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGrou return } if !done { + plsv.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture") return } @@ -24219,6 +24384,7 @@ func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture) result return } if !done { + plsv.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture") return } @@ -24261,6 +24427,7 @@ func (future *PrivateLinkServicesCreateOrUpdateFuture) result(client PrivateLink return } if !done { + pls.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCreateOrUpdateFuture") return } @@ -24303,6 +24470,7 @@ func (future *PrivateLinkServicesDeleteFuture) result(client PrivateLinkServices return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesDeleteFuture") return } @@ -24339,6 +24507,7 @@ func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) result(c return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesDeletePrivateEndpointConnectionFuture") return } @@ -24818,6 +24987,7 @@ func (future *ProfilesDeleteFuture) result(client ProfilesClient) (ar autorest.R return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ProfilesDeleteFuture") return } @@ -25028,6 +25198,7 @@ func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddre return } if !done { + pia.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture") return } @@ -25070,6 +25241,7 @@ func (future *PublicIPAddressesDeleteFuture) result(client PublicIPAddressesClie return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture") return } @@ -25106,6 +25278,7 @@ func (future *PublicIPAddressesUpdateTagsFuture) result(client PublicIPAddresses return } if !done { + pia.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesUpdateTagsFuture") return } @@ -25521,6 +25694,7 @@ func (future *PublicIPPrefixesCreateOrUpdateFuture) result(client PublicIPPrefix return } if !done { + pip.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PublicIPPrefixesCreateOrUpdateFuture") return } @@ -25563,6 +25737,7 @@ func (future *PublicIPPrefixesDeleteFuture) result(client PublicIPPrefixesClient return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PublicIPPrefixesDeleteFuture") return } @@ -25599,6 +25774,7 @@ func (future *PublicIPPrefixesUpdateTagsFuture) result(client PublicIPPrefixesCl return } if !done { + pip.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.PublicIPPrefixesUpdateTagsFuture") return } @@ -26699,6 +26875,7 @@ func (future *RouteFilterRulesCreateOrUpdateFuture) result(client RouteFilterRul return } if !done { + rfr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesCreateOrUpdateFuture") return } @@ -26741,6 +26918,7 @@ func (future *RouteFilterRulesDeleteFuture) result(client RouteFilterRulesClient return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesDeleteFuture") return } @@ -26777,6 +26955,7 @@ func (future *RouteFilterRulesUpdateFuture) result(client RouteFilterRulesClient return } if !done { + rfr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesUpdateFuture") return } @@ -26819,6 +26998,7 @@ func (future *RouteFiltersCreateOrUpdateFuture) result(client RouteFiltersClient return } if !done { + rf.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RouteFiltersCreateOrUpdateFuture") return } @@ -26861,6 +27041,7 @@ func (future *RouteFiltersDeleteFuture) result(client RouteFiltersClient) (ar au return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RouteFiltersDeleteFuture") return } @@ -26897,6 +27078,7 @@ func (future *RouteFiltersUpdateFuture) result(client RouteFiltersClient) (rf Ro return } if !done { + rf.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RouteFiltersUpdateFuture") return } @@ -27110,6 +27292,7 @@ func (future *RoutesCreateOrUpdateFuture) result(client RoutesClient) (r Route, return } if !done { + r.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture") return } @@ -27151,6 +27334,7 @@ func (future *RoutesDeleteFuture) result(client RoutesClient) (ar autorest.Respo return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture") return } @@ -27491,6 +27675,7 @@ func (future *RouteTablesCreateOrUpdateFuture) result(client RouteTablesClient) return } if !done { + rt.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture") return } @@ -27533,6 +27718,7 @@ func (future *RouteTablesDeleteFuture) result(client RouteTablesClient) (ar auto return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture") return } @@ -27569,6 +27755,7 @@ func (future *RouteTablesUpdateTagsFuture) result(client RouteTablesClient) (rt return } if !done { + rt.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.RouteTablesUpdateTagsFuture") return } @@ -28013,6 +28200,7 @@ func (future *SecurityGroupsCreateOrUpdateFuture) result(client SecurityGroupsCl return } if !done { + sg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture") return } @@ -28055,6 +28243,7 @@ func (future *SecurityGroupsDeleteFuture) result(client SecurityGroupsClient) (a return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture") return } @@ -28091,6 +28280,7 @@ func (future *SecurityGroupsUpdateTagsFuture) result(client SecurityGroupsClient return } if !done { + sg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsUpdateTagsFuture") return } @@ -28436,6 +28626,7 @@ func (future *SecurityRulesCreateOrUpdateFuture) result(client SecurityRulesClie return } if !done { + sr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture") return } @@ -28478,6 +28669,7 @@ func (future *SecurityRulesDeleteFuture) result(client SecurityRulesClient) (ar return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture") return } @@ -28694,6 +28886,7 @@ func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) result(client Service return } if !done { + sep.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPoliciesCreateOrUpdateFuture") return } @@ -28736,6 +28929,7 @@ func (future *ServiceEndpointPoliciesDeleteFuture) result(client ServiceEndpoint return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPoliciesDeleteFuture") return } @@ -28772,6 +28966,7 @@ func (future *ServiceEndpointPoliciesUpdateFuture) result(client ServiceEndpoint return } if !done { + sep.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPoliciesUpdateFuture") return } @@ -29202,6 +29397,7 @@ func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) result(clien return } if !done { + sepd.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture") return } @@ -29244,6 +29440,7 @@ func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) result(client Servic return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPolicyDefinitionsDeleteFuture") return } @@ -29461,6 +29658,12 @@ type ServiceTagInformation struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceTagInformation. +func (sti ServiceTagInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ServiceTagInformationPropertiesFormat properties of the service tag information. type ServiceTagInformationPropertiesFormat struct { // ChangeNumber - READ-ONLY; The iteration number of service tag. @@ -29473,6 +29676,12 @@ type ServiceTagInformationPropertiesFormat struct { AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceTagInformationPropertiesFormat. +func (stipf ServiceTagInformationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ServiceTagsListResult response for the ListServiceTags API service call. type ServiceTagsListResult struct { autorest.Response `json:"-"` @@ -29490,6 +29699,12 @@ type ServiceTagsListResult struct { Values *[]ServiceTagInformation `json:"values,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceTagsListResult. +func (stlr ServiceTagsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // String ... type String struct { autorest.Response `json:"-"` @@ -29867,6 +30082,7 @@ func (future *SubnetsCreateOrUpdateFuture) result(client SubnetsClient) (s Subne return } if !done { + s.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture") return } @@ -29909,6 +30125,7 @@ func (future *SubnetsDeleteFuture) result(client SubnetsClient) (ar autorest.Res return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture") return } @@ -29945,6 +30162,7 @@ func (future *SubnetsPrepareNetworkPoliciesFuture) result(client SubnetsClient) return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.SubnetsPrepareNetworkPoliciesFuture") return } @@ -29981,6 +30199,7 @@ func (future *SubnetsUnprepareNetworkPoliciesFuture) result(client SubnetsClient return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.SubnetsUnprepareNetworkPoliciesFuture") return } @@ -30197,6 +30416,12 @@ type TunnelConnectionHealth struct { LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` } +// MarshalJSON is the custom marshaler for TunnelConnectionHealth. +func (tch TunnelConnectionHealth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // UnprepareNetworkPoliciesRequest details of UnprepareNetworkPolicies for Subnet. type UnprepareNetworkPoliciesRequest struct { // ServiceName - The name of the service for which subnet is being unprepared for. @@ -30615,6 +30840,7 @@ func (future *VirtualHubsCreateOrUpdateFuture) result(client VirtualHubsClient) return } if !done { + vh.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualHubsCreateOrUpdateFuture") return } @@ -30657,6 +30883,7 @@ func (future *VirtualHubsDeleteFuture) result(client VirtualHubsClient) (ar auto return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualHubsDeleteFuture") return } @@ -30693,6 +30920,7 @@ func (future *VirtualHubsUpdateTagsFuture) result(client VirtualHubsClient) (vh return } if !done { + vh.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualHubsUpdateTagsFuture") return } @@ -31563,6 +31791,7 @@ func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) result(clien return } if !done { + vngc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture") return } @@ -31605,6 +31834,7 @@ func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client Virtua return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture") return } @@ -31641,6 +31871,7 @@ func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) result(clien return } if !done { + crsk.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture") return } @@ -31683,6 +31914,7 @@ func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) result(client return } if !done { + csk.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture") return } @@ -31725,6 +31957,7 @@ func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) result(client Vi return } if !done { + vngc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsUpdateTagsFuture") return } @@ -32282,6 +32515,7 @@ func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) result(client VirtualN return } if !done { + vng.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture") return } @@ -32324,6 +32558,7 @@ func (future *VirtualNetworkGatewaysDeleteFuture) result(client VirtualNetworkGa return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture") return } @@ -32360,6 +32595,7 @@ func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) result(clien return } if !done { + s.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture") return } @@ -32402,6 +32638,7 @@ func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) result(client Virt return } if !done { + s.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGenerateVpnProfileFuture") return } @@ -32444,6 +32681,7 @@ func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) result(client Vir return } if !done { + grlr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture") return } @@ -32486,6 +32724,7 @@ func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) result(client Virtua return } if !done { + bpslr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture") return } @@ -32528,6 +32767,7 @@ func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) result(client Virtua return } if !done { + grlr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture") return } @@ -32570,6 +32810,7 @@ func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) result(c return } if !done { + vcchdlr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture") return } @@ -32612,6 +32853,7 @@ func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) result(cl return } if !done { + vcipp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture") return } @@ -32654,6 +32896,7 @@ func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) result(client return } if !done { + s.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture") return } @@ -32706,6 +32949,7 @@ func (future *VirtualNetworkGatewaysResetFuture) result(client VirtualNetworkGat return } if !done { + vng.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture") return } @@ -32748,6 +32992,7 @@ func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) result(client return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetVpnClientSharedKeyFuture") return } @@ -32784,6 +33029,7 @@ func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) result(cl return } if !done { + vcipp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture") return } @@ -32826,6 +33072,7 @@ func (future *VirtualNetworkGatewaysUpdateTagsFuture) result(client VirtualNetwo return } if !done { + vng.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysUpdateTagsFuture") return } @@ -33459,6 +33706,7 @@ func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) result(client VirtualN return } if !done { + vnp.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsCreateOrUpdateFuture") return } @@ -33501,6 +33749,7 @@ func (future *VirtualNetworkPeeringsDeleteFuture) result(client VirtualNetworkPe return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsDeleteFuture") return } @@ -33559,6 +33808,7 @@ func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworks return } if !done { + vn.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture") return } @@ -33601,6 +33851,7 @@ func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture") return } @@ -33637,6 +33888,7 @@ func (future *VirtualNetworksUpdateTagsFuture) result(client VirtualNetworksClie return } if !done { + vn.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksUpdateTagsFuture") return } @@ -33987,6 +34239,7 @@ func (future *VirtualNetworkTapsCreateOrUpdateFuture) result(client VirtualNetwo return } if !done { + vnt.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkTapsCreateOrUpdateFuture") return } @@ -34029,6 +34282,7 @@ func (future *VirtualNetworkTapsDeleteFuture) result(client VirtualNetworkTapsCl return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkTapsDeleteFuture") return } @@ -34065,6 +34319,7 @@ func (future *VirtualNetworkTapsUpdateTagsFuture) result(client VirtualNetworkTa return } if !done { + vnt.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkTapsUpdateTagsFuture") return } @@ -34092,6 +34347,12 @@ type VirtualNetworkUsage struct { Unit *string `json:"unit,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkUsage. +func (vnu VirtualNetworkUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualNetworkUsageName usage strings container. type VirtualNetworkUsageName struct { // LocalizedValue - READ-ONLY; Localized subnet size and usage string. @@ -34100,6 +34361,12 @@ type VirtualNetworkUsageName struct { Value *string `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkUsageName. +func (vnun VirtualNetworkUsageName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualWAN virtualWAN Resource. type VirtualWAN struct { autorest.Response `json:"-"` @@ -34293,6 +34560,7 @@ func (future *VirtualWansCreateOrUpdateFuture) result(client VirtualWansClient) return } if !done { + vw.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualWansCreateOrUpdateFuture") return } @@ -34335,6 +34603,7 @@ func (future *VirtualWansDeleteFuture) result(client VirtualWansClient) (ar auto return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualWansDeleteFuture") return } @@ -34388,6 +34657,7 @@ func (future *VirtualWansUpdateTagsFuture) result(client VirtualWansClient) (vw return } if !done { + vw.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VirtualWansUpdateTagsFuture") return } @@ -34477,6 +34747,12 @@ type VpnClientConnectionHealthDetail struct { MaxPacketsPerSecond *int64 `json:"maxPacketsPerSecond,omitempty"` } +// MarshalJSON is the custom marshaler for VpnClientConnectionHealthDetail. +func (vcchd VpnClientConnectionHealthDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VpnClientConnectionHealthDetailListResult list of virtual network gateway vpn client connection health. type VpnClientConnectionHealthDetailListResult struct { autorest.Response `json:"-"` @@ -34906,6 +35182,7 @@ func (future *VpnConnectionsCreateOrUpdateFuture) result(client VpnConnectionsCl return } if !done { + vc.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsCreateOrUpdateFuture") return } @@ -34948,6 +35225,7 @@ func (future *VpnConnectionsDeleteFuture) result(client VpnConnectionsClient) (a return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsDeleteFuture") return } @@ -35123,6 +35401,7 @@ func (future *VpnGatewaysCreateOrUpdateFuture) result(client VpnGatewaysClient) return } if !done { + vg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysCreateOrUpdateFuture") return } @@ -35165,6 +35444,7 @@ func (future *VpnGatewaysDeleteFuture) result(client VpnGatewaysClient) (ar auto return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysDeleteFuture") return } @@ -35201,6 +35481,7 @@ func (future *VpnGatewaysResetFuture) result(client VpnGatewaysClient) (vg VpnGa return } if !done { + vg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysResetFuture") return } @@ -35243,6 +35524,7 @@ func (future *VpnGatewaysUpdateTagsFuture) result(client VpnGatewaysClient) (vg return } if !done { + vg.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysUpdateTagsFuture") return } @@ -35400,6 +35682,12 @@ type VpnSiteID struct { VpnSite *string `json:"vpnSite,omitempty"` } +// MarshalJSON is the custom marshaler for VpnSiteID. +func (vsi VpnSiteID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VpnSiteLink vpnSiteLink Resource. type VpnSiteLink struct { autorest.Response `json:"-"` @@ -35717,6 +36005,7 @@ func (future *VpnSitesConfigurationDownloadFuture) result(client VpnSitesConfigu return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnSitesConfigurationDownloadFuture") return } @@ -35753,6 +36042,7 @@ func (future *VpnSitesCreateOrUpdateFuture) result(client VpnSitesClient) (vs Vp return } if !done { + vs.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnSitesCreateOrUpdateFuture") return } @@ -35795,6 +36085,7 @@ func (future *VpnSitesDeleteFuture) result(client VpnSitesClient) (ar autorest.R return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnSitesDeleteFuture") return } @@ -35831,6 +36122,7 @@ func (future *VpnSitesUpdateTagsFuture) result(client VpnSitesClient) (vs VpnSit return } if !done { + vs.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.VpnSitesUpdateTagsFuture") return } @@ -36004,6 +36296,7 @@ func (future *WatchersCheckConnectivityFuture) result(client WatchersClient) (ci return } if !done { + ci.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersCheckConnectivityFuture") return } @@ -36046,6 +36339,7 @@ func (future *WatchersDeleteFuture) result(client WatchersClient) (ar autorest.R return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersDeleteFuture") return } @@ -36082,6 +36376,7 @@ func (future *WatchersGetAzureReachabilityReportFuture) result(client WatchersCl return } if !done { + arr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersGetAzureReachabilityReportFuture") return } @@ -36124,6 +36419,7 @@ func (future *WatchersGetFlowLogStatusFuture) result(client WatchersClient) (fli return } if !done { + fli.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersGetFlowLogStatusFuture") return } @@ -36166,6 +36462,7 @@ func (future *WatchersGetNetworkConfigurationDiagnosticFuture) result(client Wat return } if !done { + cdr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersGetNetworkConfigurationDiagnosticFuture") return } @@ -36208,6 +36505,7 @@ func (future *WatchersGetNextHopFuture) result(client WatchersClient) (nhr NextH return } if !done { + nhr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersGetNextHopFuture") return } @@ -36250,6 +36548,7 @@ func (future *WatchersGetTroubleshootingFuture) result(client WatchersClient) (t return } if !done { + tr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingFuture") return } @@ -36292,6 +36591,7 @@ func (future *WatchersGetTroubleshootingResultFuture) result(client WatchersClie return } if !done { + tr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingResultFuture") return } @@ -36334,6 +36634,7 @@ func (future *WatchersGetVMSecurityRulesFuture) result(client WatchersClient) (s return } if !done { + sgvr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersGetVMSecurityRulesFuture") return } @@ -36376,6 +36677,7 @@ func (future *WatchersListAvailableProvidersFuture) result(client WatchersClient return } if !done { + apl.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersListAvailableProvidersFuture") return } @@ -36418,6 +36720,7 @@ func (future *WatchersSetFlowLogConfigurationFuture) result(client WatchersClien return } if !done { + fli.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersSetFlowLogConfigurationFuture") return } @@ -36460,6 +36763,7 @@ func (future *WatchersVerifyIPFlowFuture) result(client WatchersClient) (vifr Ve return } if !done { + vifr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WatchersVerifyIPFlowFuture") return } @@ -36539,6 +36843,7 @@ func (future *WebApplicationFirewallPoliciesDeleteFuture) result(client WebAppli return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("network.WebApplicationFirewallPoliciesDeleteFuture") return } @@ -36674,6 +36979,12 @@ type WebApplicationFirewallPolicyListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyListResult. +func (wafplr WebApplicationFirewallPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // WebApplicationFirewallPolicyListResultIterator provides access to a complete listing of // WebApplicationFirewallPolicy values. type WebApplicationFirewallPolicyListResultIterator struct { diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/CHANGELOG.md index 024d27202151..7ed92404977c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/CHANGELOG.md +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/CHANGELOG.md @@ -1,18 +1,11 @@ -Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/resources/resource-manager/readme.md tag: `package-resources-2017-05` - -Code generator @microsoft.azure/autorest.go@2.1.178 +# Change History +## Additive Changes ### New Funcs -1. *CreateOrUpdateByIDFuture.UnmarshalJSON([]byte) error -1. *CreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *DeleteByIDFuture.UnmarshalJSON([]byte) error -1. *DeleteFuture.UnmarshalJSON([]byte) error -1. *DeploymentsCreateOrUpdateFuture.UnmarshalJSON([]byte) error -1. *DeploymentsDeleteFuture.UnmarshalJSON([]byte) error -1. *GroupsDeleteFuture.UnmarshalJSON([]byte) error -1. *MoveResourcesFuture.UnmarshalJSON([]byte) error -1. *UpdateByIDFuture.UnmarshalJSON([]byte) error -1. *UpdateFuture.UnmarshalJSON([]byte) error -1. *ValidateMoveResourcesFuture.UnmarshalJSON([]byte) error +1. DeploymentOperationProperties.MarshalJSON() ([]byte, error) +1. ErrorAdditionalInfo.MarshalJSON() ([]byte, error) +1. ErrorResponse.MarshalJSON() ([]byte, error) +1. GroupProperties.MarshalJSON() ([]byte, error) +1. ManagementErrorWithDetails.MarshalJSON() ([]byte, error) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/_meta.json new file mode 100644 index 000000000000..cbc226d83ef1 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "readme": "/_/azure-rest-api-specs/specification/resources/resource-manager/readme.md", + "tag": "package-resources-2017-05", + "use": "@microsoft.azure/autorest.go@2.1.183", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-resources-2017-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/resources/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go index cf6b3a1a3d85..8e3362fcb178 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go @@ -80,6 +80,7 @@ func (future *CreateOrUpdateByIDFuture) result(client Client) (gr GenericResourc return } if !done { + gr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateByIDFuture") return } @@ -122,6 +123,7 @@ func (future *CreateOrUpdateFuture) result(client Client) (gr GenericResource, e return } if !done { + gr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateFuture") return } @@ -169,6 +171,7 @@ func (future *DeleteByIDFuture) result(client Client) (ar autorest.Response, err return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.DeleteByIDFuture") return } @@ -204,6 +207,7 @@ func (future *DeleteFuture) result(client Client) (ar autorest.Response, err err return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.DeleteFuture") return } @@ -473,6 +477,12 @@ type DeploymentOperationProperties struct { Response *HTTPMessage `json:"response,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentOperationProperties. +func (dop DeploymentOperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // DeploymentOperationsListResult list of deployment operations. type DeploymentOperationsListResult struct { autorest.Response `json:"-"` @@ -748,6 +758,7 @@ func (future *DeploymentsCreateOrUpdateFuture) result(client DeploymentsClient) return } if !done { + de.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateFuture") return } @@ -790,6 +801,7 @@ func (future *DeploymentsDeleteFuture) result(client DeploymentsClient) (ar auto return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteFuture") return } @@ -814,6 +826,12 @@ type ErrorAdditionalInfo struct { Info interface{} `json:"info,omitempty"` } +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ErrorResponse common error response for all Azure Resource Manager APIs to return error details for // failed operations. (This also follows the OData error response format.) type ErrorResponse struct { @@ -829,6 +847,12 @@ type ErrorResponse struct { AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` } +// MarshalJSON is the custom marshaler for ErrorResponse. +func (er ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ExportTemplateRequest export resource group template request parameters. type ExportTemplateRequest struct { // ResourcesProperty - The IDs of the resources to filter the export by. To export all resources, supply an array with single entry '*'. @@ -1223,6 +1247,12 @@ type GroupProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for GroupProperties. +func (gp GroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // GroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type GroupsDeleteFuture struct { azure.FutureAPI @@ -1251,6 +1281,7 @@ func (future *GroupsDeleteFuture) result(client GroupsClient) (ar autorest.Respo return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.GroupsDeleteFuture") return } @@ -1463,6 +1494,12 @@ type ManagementErrorWithDetails struct { Details *[]ManagementErrorWithDetails `json:"details,omitempty"` } +// MarshalJSON is the custom marshaler for ManagementErrorWithDetails. +func (mewd ManagementErrorWithDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // MoveInfo parameters of move resources. type MoveInfo struct { // ResourcesProperty - The IDs of the resources. @@ -1500,6 +1537,7 @@ func (future *MoveResourcesFuture) result(client Client) (ar autorest.Response, return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.MoveResourcesFuture") return } @@ -2099,6 +2137,7 @@ func (future *UpdateByIDFuture) result(client Client) (gr GenericResource, err e return } if !done { + gr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.UpdateByIDFuture") return } @@ -2140,6 +2179,7 @@ func (future *UpdateFuture) result(client Client) (gr GenericResource, err error return } if !done { + gr.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.UpdateFuture") return } @@ -2182,6 +2222,7 @@ func (future *ValidateMoveResourcesFuture) result(client Client) (ar autorest.Re return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("resources.ValidateMoveResourcesFuture") return } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/CHANGELOG.md index f455fd3a7344..7b5c5c968378 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/CHANGELOG.md +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/CHANGELOG.md @@ -1,10 +1,36 @@ -Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82//specification/storage/resource-manager/readme.md tag: `package-2019-06` - -Code generator @microsoft.azure/autorest.go@2.1.178 +# Change History +## Additive Changes ### New Funcs -1. *AccountsCreateFuture.UnmarshalJSON([]byte) error -1. *AccountsFailoverFuture.UnmarshalJSON([]byte) error -1. *AccountsRestoreBlobRangesFuture.UnmarshalJSON([]byte) error +1. AccountInternetEndpoints.MarshalJSON() ([]byte, error) +1. AccountKey.MarshalJSON() ([]byte, error) +1. AccountListKeysResult.MarshalJSON() ([]byte, error) +1. AccountListResult.MarshalJSON() ([]byte, error) +1. AccountMicrosoftEndpoints.MarshalJSON() ([]byte, error) +1. AzureEntityResource.MarshalJSON() ([]byte, error) +1. BlobRestoreStatus.MarshalJSON() ([]byte, error) +1. BlobServiceItems.MarshalJSON() ([]byte, error) +1. CheckNameAvailabilityResult.MarshalJSON() ([]byte, error) +1. EncryptionScopeListResult.MarshalJSON() ([]byte, error) +1. FileServiceItems.MarshalJSON() ([]byte, error) +1. FileShareItems.MarshalJSON() ([]byte, error) +1. GeoReplicationStats.MarshalJSON() ([]byte, error) +1. ListAccountSasResponse.MarshalJSON() ([]byte, error) +1. ListContainerItems.MarshalJSON() ([]byte, error) +1. ListQueueResource.MarshalJSON() ([]byte, error) +1. ListQueueServices.MarshalJSON() ([]byte, error) +1. ListServiceSasResponse.MarshalJSON() ([]byte, error) +1. ListTableResource.MarshalJSON() ([]byte, error) +1. ListTableServices.MarshalJSON() ([]byte, error) +1. PrivateEndpoint.MarshalJSON() ([]byte, error) +1. ProxyResource.MarshalJSON() ([]byte, error) +1. Resource.MarshalJSON() ([]byte, error) +1. SKUCapability.MarshalJSON() ([]byte, error) +1. SkuListResult.MarshalJSON() ([]byte, error) +1. TableProperties.MarshalJSON() ([]byte, error) +1. TagProperty.MarshalJSON() ([]byte, error) +1. UpdateHistoryProperty.MarshalJSON() ([]byte, error) +1. Usage.MarshalJSON() ([]byte, error) +1. UsageName.MarshalJSON() ([]byte, error) diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/_meta.json new file mode 100644 index 000000000000..e9e533452515 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "readme": "/_/azure-rest-api-specs/specification/storage/resource-manager/readme.md", + "tag": "package-2019-06", + "use": "@microsoft.azure/autorest.go@2.1.183", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2019-06 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/storage/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/models.go index 15dca422b61e..ba7702675388 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/models.go @@ -288,6 +288,12 @@ type AccountInternetEndpoints struct { Dfs *string `json:"dfs,omitempty"` } +// MarshalJSON is the custom marshaler for AccountInternetEndpoints. +func (aie AccountInternetEndpoints) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // AccountKey an access key for the storage account. type AccountKey struct { // KeyName - READ-ONLY; Name of the key. @@ -298,6 +304,12 @@ type AccountKey struct { Permissions KeyPermission `json:"permissions,omitempty"` } +// MarshalJSON is the custom marshaler for AccountKey. +func (ak AccountKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // AccountListKeysResult the response from the ListKeys operation. type AccountListKeysResult struct { autorest.Response `json:"-"` @@ -305,6 +317,12 @@ type AccountListKeysResult struct { Keys *[]AccountKey `json:"keys,omitempty"` } +// MarshalJSON is the custom marshaler for AccountListKeysResult. +func (alkr AccountListKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // AccountListResult the response from the List Storage Accounts operation. type AccountListResult struct { autorest.Response `json:"-"` @@ -314,6 +332,12 @@ type AccountListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for AccountListResult. +func (alr AccountListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // AccountListResultIterator provides access to a complete listing of Account values. type AccountListResultIterator struct { i int @@ -481,6 +505,12 @@ type AccountMicrosoftEndpoints struct { Dfs *string `json:"dfs,omitempty"` } +// MarshalJSON is the custom marshaler for AccountMicrosoftEndpoints. +func (ame AccountMicrosoftEndpoints) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // AccountProperties properties of the storage account. type AccountProperties struct { // ProvisioningState - READ-ONLY; Gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded' @@ -665,6 +695,7 @@ func (future *AccountsCreateFuture) result(client AccountsClient) (a Account, er return } if !done { + a.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("storage.AccountsCreateFuture") return } @@ -707,6 +738,7 @@ func (future *AccountsFailoverFuture) result(client AccountsClient) (ar autorest return } if !done { + ar.Response = future.Response() err = azure.NewAsyncOpIncompleteError("storage.AccountsFailoverFuture") return } @@ -743,6 +775,7 @@ func (future *AccountsRestoreBlobRangesFuture) result(client AccountsClient) (br return } if !done { + brs.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("storage.AccountsRestoreBlobRangesFuture") return } @@ -880,6 +913,12 @@ type AzureEntityResource struct { Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // AzureFilesIdentityBasedAuthentication settings for Azure Files identity based authentication. type AzureFilesIdentityBasedAuthentication struct { // DirectoryServiceOptions - Indicates the directory service used. Possible values include: 'DirectoryServiceOptionsNone', 'DirectoryServiceOptionsAADDS', 'DirectoryServiceOptionsAD' @@ -1001,6 +1040,12 @@ type BlobRestoreStatus struct { Parameters *BlobRestoreParameters `json:"parameters,omitempty"` } +// MarshalJSON is the custom marshaler for BlobRestoreStatus. +func (brs BlobRestoreStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // BlobServiceItems ... type BlobServiceItems struct { autorest.Response `json:"-"` @@ -1008,6 +1053,12 @@ type BlobServiceItems struct { Value *[]BlobServiceProperties `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for BlobServiceItems. +func (bsi BlobServiceItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // BlobServiceProperties the properties of a storage account’s Blob service. type BlobServiceProperties struct { autorest.Response `json:"-"` @@ -1129,6 +1180,12 @@ type CheckNameAvailabilityResult struct { Message *string `json:"message,omitempty"` } +// MarshalJSON is the custom marshaler for CheckNameAvailabilityResult. +func (cnar CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // CloudError an error response from the Storage service. type CloudError struct { Error *CloudErrorBody `json:"error,omitempty"` @@ -1366,6 +1423,12 @@ type EncryptionScopeListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for EncryptionScopeListResult. +func (eslr EncryptionScopeListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // EncryptionScopeListResultIterator provides access to a complete listing of EncryptionScope values. type EncryptionScopeListResultIterator struct { i int @@ -1627,6 +1690,12 @@ type FileServiceItems struct { Value *[]FileServiceProperties `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for FileServiceItems. +func (fsi FileServiceItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // FileServiceProperties the properties of File services in storage account. type FileServiceProperties struct { autorest.Response `json:"-"` @@ -1896,6 +1965,12 @@ type FileShareItems struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for FileShareItems. +func (fsi FileShareItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // FileShareItemsIterator provides access to a complete listing of FileShareItem values. type FileShareItemsIterator struct { i int @@ -2108,6 +2183,12 @@ type GeoReplicationStats struct { CanFailover *bool `json:"canFailover,omitempty"` } +// MarshalJSON is the custom marshaler for GeoReplicationStats. +func (grs GeoReplicationStats) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // Identity identity for the resource. type Identity struct { // PrincipalID - READ-ONLY; The principal ID of resource identity. @@ -2397,6 +2478,12 @@ type ListAccountSasResponse struct { AccountSasToken *string `json:"accountSasToken,omitempty"` } +// MarshalJSON is the custom marshaler for ListAccountSasResponse. +func (lasr ListAccountSasResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ListContainerItem the blob container properties be listed out. type ListContainerItem struct { // ContainerProperties - The blob container properties be listed out. @@ -2490,6 +2577,12 @@ type ListContainerItems struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ListContainerItems. +func (lci ListContainerItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ListContainerItemsIterator provides access to a complete listing of ListContainerItem values. type ListContainerItemsIterator struct { i int @@ -2736,6 +2829,12 @@ type ListQueueResource struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ListQueueResource. +func (lqr ListQueueResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ListQueueResourceIterator provides access to a complete listing of ListQueue values. type ListQueueResourceIterator struct { i int @@ -2893,6 +2992,12 @@ type ListQueueServices struct { Value *[]QueueServiceProperties `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for ListQueueServices. +func (lqs ListQueueServices) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ListServiceSasResponse the List service SAS credentials operation response. type ListServiceSasResponse struct { autorest.Response `json:"-"` @@ -2900,6 +3005,12 @@ type ListServiceSasResponse struct { ServiceSasToken *string `json:"serviceSasToken,omitempty"` } +// MarshalJSON is the custom marshaler for ListServiceSasResponse. +func (lssr ListServiceSasResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ListTableResource response schema. Contains list of tables returned type ListTableResource struct { autorest.Response `json:"-"` @@ -2909,6 +3020,12 @@ type ListTableResource struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ListTableResource. +func (ltr ListTableResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ListTableResourceIterator provides access to a complete listing of Table values. type ListTableResourceIterator struct { i int @@ -3066,6 +3183,12 @@ type ListTableServices struct { Value *[]TableServiceProperties `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for ListTableServices. +func (lts ListTableServices) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ManagementPolicy the Get Storage Account ManagementPolicies operation response. type ManagementPolicy struct { autorest.Response `json:"-"` @@ -3498,6 +3621,12 @@ type PrivateEndpoint struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for PrivateEndpoint. +func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // PrivateEndpointConnection the Private Endpoint Connection resource. type PrivateEndpointConnection struct { autorest.Response `json:"-"` @@ -3709,6 +3838,12 @@ type ProxyResource struct { Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // Queue ... type Queue struct { autorest.Response `json:"-"` @@ -3888,6 +4023,12 @@ type Resource struct { Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // RestorePolicyProperties the blob service properties for blob restore policy type RestorePolicyProperties struct { // Enabled - Blob restore is enabled if set to true. @@ -4005,6 +4146,12 @@ type SKUCapability struct { Value *string `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for SKUCapability. +func (sc SKUCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // SkuInformation storage SKU and its properties type SkuInformation struct { // Name - Possible values include: 'StandardLRS', 'StandardGRS', 'StandardRAGRS', 'StandardZRS', 'PremiumLRS', 'PremiumZRS', 'StandardGZRS', 'StandardRAGZRS' @@ -4045,6 +4192,12 @@ type SkuListResult struct { Value *[]SkuInformation `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for SkuListResult. +func (slr SkuListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // Table properties of the table, including Id, resource name, resource type. type Table struct { autorest.Response `json:"-"` @@ -4124,6 +4277,12 @@ type TableProperties struct { TableName *string `json:"tableName,omitempty"` } +// MarshalJSON is the custom marshaler for TableProperties. +func (tp TableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // TableServiceProperties the properties of a storage account’s Table service. type TableServiceProperties struct { autorest.Response `json:"-"` @@ -4227,6 +4386,12 @@ type TagProperty struct { Upn *string `json:"upn,omitempty"` } +// MarshalJSON is the custom marshaler for TagProperty. +func (tp TagProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource // which has 'tags' and a 'location' type TrackedResource struct { @@ -4270,6 +4435,12 @@ type UpdateHistoryProperty struct { Upn *string `json:"upn,omitempty"` } +// MarshalJSON is the custom marshaler for UpdateHistoryProperty. +func (uhp UpdateHistoryProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // Usage describes Storage Resource Usage. type Usage struct { // Unit - READ-ONLY; Gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond' @@ -4282,6 +4453,12 @@ type Usage struct { Name *UsageName `json:"name,omitempty"` } +// MarshalJSON is the custom marshaler for Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // UsageListResult the response from the List Usages operation. type UsageListResult struct { autorest.Response `json:"-"` @@ -4297,6 +4474,12 @@ type UsageName struct { LocalizedValue *string `json:"localizedValue,omitempty"` } +// MarshalJSON is the custom marshaler for UsageName. +func (un UsageName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // VirtualNetworkRule virtual Network rule. type VirtualNetworkRule struct { // VirtualNetworkResourceID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go index 0f4d6279e629..ce6e5a80d8d9 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go @@ -107,7 +107,7 @@ func (ds *DefaultSender) Send(c *Client, req *http.Request) (resp *http.Response return resp, err } resp, err = c.HTTPClient.Do(rr.Request()) - if err != nil || !autorest.ResponseHasStatusCode(resp, ds.ValidStatusCodes...) { + if err == nil && !autorest.ResponseHasStatusCode(resp, ds.ValidStatusCodes...) { return resp, err } drainRespBody(resp) @@ -953,8 +953,10 @@ func readAndCloseBody(body io.ReadCloser) ([]byte, error) { // reads the response body then closes it func drainRespBody(resp *http.Response) { - io.Copy(ioutil.Discard, resp.Body) - resp.Body.Close() + if resp != nil { + io.Copy(ioutil.Discard, resp.Body) + resp.Body.Close() + } } func serviceErrFromXML(body []byte, storageErr *AzureStorageServiceError) error { diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index 4d306904f00a..b2e48843615d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -1,21 +1,7 @@ package version -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. // Number contains the semantic version of this SDK. -const Number = "v53.1.0" +const Number = "v55.0.0" diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/go.mod b/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/go.mod new file mode 100644 index 000000000000..965cb8120ec9 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/go.mod @@ -0,0 +1,5 @@ +module github.com/Azure/go-ansiterm + +go 1.16 + +require golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/go.sum b/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/go.sum new file mode 100644 index 000000000000..9f05d9d3edde --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/go.sum @@ -0,0 +1,2 @@ +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go b/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go index a6732797263f..5599082ae9cb 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go @@ -10,6 +10,7 @@ import ( "syscall" "github.com/Azure/go-ansiterm" + windows "golang.org/x/sys/windows" ) // Windows keyboard constants @@ -162,15 +163,28 @@ func ensureInRange(n int16, min int16, max int16) int16 { func GetStdFile(nFile int) (*os.File, uintptr) { var file *os.File - switch nFile { - case syscall.STD_INPUT_HANDLE: + + // syscall uses negative numbers + // windows package uses very big uint32 + // Keep these switches split so we don't have to convert ints too much. + switch uint32(nFile) { + case windows.STD_INPUT_HANDLE: file = os.Stdin - case syscall.STD_OUTPUT_HANDLE: + case windows.STD_OUTPUT_HANDLE: file = os.Stdout - case syscall.STD_ERROR_HANDLE: + case windows.STD_ERROR_HANDLE: file = os.Stderr default: - panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile)) + switch nFile { + case syscall.STD_INPUT_HANDLE: + file = os.Stdin + case syscall.STD_OUTPUT_HANDLE: + file = os.Stdout + case syscall.STD_ERROR_HANDLE: + file = os.Stderr + default: + panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile)) + } } fd, err := syscall.GetStdHandle(nFile) diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/go.mod b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/go.mod index abcc27d4cc90..8c5d36ca61d1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/go.mod +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/go.mod @@ -6,6 +6,7 @@ require ( github.com/Azure/go-autorest v14.2.0+incompatible github.com/Azure/go-autorest/autorest/date v0.3.0 github.com/Azure/go-autorest/autorest/mocks v0.4.1 + github.com/Azure/go-autorest/logger v0.2.1 github.com/Azure/go-autorest/tracing v0.6.0 github.com/form3tech-oss/jwt-go v3.2.2+incompatible golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/go.sum b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/go.sum index 9d55b0f59611..5ee68e700106 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/go.sum +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/go.sum @@ -4,6 +4,8 @@ github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8K github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go index d7e4372bbc5a..1826a68dc825 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go @@ -28,6 +28,7 @@ const ( mimeTypeFormPost = "application/x-www-form-urlencoded" ) +// DO NOT ACCESS THIS DIRECTLY. go through sender() var defaultSender Sender var defaultSenderInit = &sync.Once{} diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go index addc91099970..c870ef4ec03e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go @@ -36,6 +36,7 @@ import ( "time" "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/logger" "github.com/form3tech-oss/jwt-go" ) @@ -70,13 +71,13 @@ const ( defaultMaxMSIRefreshAttempts = 5 // asMSIEndpointEnv is the environment variable used to store the endpoint on App Service and Functions - asMSIEndpointEnv = "MSI_ENDPOINT" + msiEndpointEnv = "MSI_ENDPOINT" // asMSISecretEnv is the environment variable used to store the request secret on App Service and Functions - asMSISecretEnv = "MSI_SECRET" + msiSecretEnv = "MSI_SECRET" - // the API version to use for the App Service MSI endpoint - appServiceAPIVersion = "2017-09-01" + // the API version to use for the legacy App Service MSI endpoint + appServiceAPIVersion2017 = "2017-09-01" // secret header used when authenticating against app service MSI endpoint secretHeader = "Secret" @@ -292,6 +293,8 @@ func (secret ServicePrincipalCertificateSecret) MarshalJSON() ([]byte, error) { // ServicePrincipalMSISecret implements ServicePrincipalSecret for machines running the MSI Extension. type ServicePrincipalMSISecret struct { + msiType msiType + clientResourceID string } // SetAuthenticationValues is a method of the interface ServicePrincipalSecret. @@ -662,96 +665,173 @@ func NewServicePrincipalTokenFromAuthorizationCode(oauthConfig OAuthConfig, clie ) } -// GetMSIVMEndpoint gets the MSI endpoint on Virtual Machines. -func GetMSIVMEndpoint() (string, error) { - return msiEndpoint, nil +type msiType int + +const ( + msiTypeUnavailable msiType = iota + msiTypeAppServiceV20170901 + msiTypeCloudShell + msiTypeIMDS +) + +func (m msiType) String() string { + switch m { + case msiTypeUnavailable: + return "unavailable" + case msiTypeAppServiceV20170901: + return "AppServiceV20170901" + case msiTypeCloudShell: + return "CloudShell" + case msiTypeIMDS: + return "IMDS" + default: + return fmt.Sprintf("unhandled MSI type %d", m) + } } -// NOTE: this only indicates if the ASE environment credentials have been set -// which does not necessarily mean that the caller is authenticating via ASE! -func isAppService() bool { - _, asMSIEndpointEnvExists := os.LookupEnv(asMSIEndpointEnv) - _, asMSISecretEnvExists := os.LookupEnv(asMSISecretEnv) +// returns the MSI type and endpoint, or an error +func getMSIType() (msiType, string, error) { + if endpointEnvVar := os.Getenv(msiEndpointEnv); endpointEnvVar != "" { + // if the env var MSI_ENDPOINT is set + if secretEnvVar := os.Getenv(msiSecretEnv); secretEnvVar != "" { + // if BOTH the env vars MSI_ENDPOINT and MSI_SECRET are set the msiType is AppService + return msiTypeAppServiceV20170901, endpointEnvVar, nil + } + // if ONLY the env var MSI_ENDPOINT is set the msiType is CloudShell + return msiTypeCloudShell, endpointEnvVar, nil + } else if msiAvailableHook(context.Background(), sender()) { + // if MSI_ENDPOINT is NOT set AND the IMDS endpoint is available the msiType is IMDS. This will timeout after 500 milliseconds + return msiTypeIMDS, msiEndpoint, nil + } else { + // if MSI_ENDPOINT is NOT set and IMDS endpoint is not available Managed Identity is not available + return msiTypeUnavailable, "", errors.New("MSI not available") + } +} - return asMSIEndpointEnvExists && asMSISecretEnvExists +// GetMSIVMEndpoint gets the MSI endpoint on Virtual Machines. +// NOTE: this always returns the IMDS endpoint, it does not work for app services or cloud shell. +// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint. +func GetMSIVMEndpoint() (string, error) { + return msiEndpoint, nil } -// GetMSIAppServiceEndpoint get the MSI endpoint for App Service and Functions +// GetMSIAppServiceEndpoint get the MSI endpoint for App Service and Functions. +// It will return an error when not running in an app service/functions environment. +// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint. func GetMSIAppServiceEndpoint() (string, error) { - asMSIEndpoint, asMSIEndpointEnvExists := os.LookupEnv(asMSIEndpointEnv) - - if asMSIEndpointEnvExists { - return asMSIEndpoint, nil + msiType, endpoint, err := getMSIType() + if err != nil { + return "", err + } + switch msiType { + case msiTypeAppServiceV20170901: + return endpoint, nil + default: + return "", fmt.Errorf("%s is not app service environment", msiType) } - return "", errors.New("MSI endpoint not found") } // GetMSIEndpoint get the appropriate MSI endpoint depending on the runtime environment +// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint. func GetMSIEndpoint() (string, error) { - if isAppService() { - return GetMSIAppServiceEndpoint() - } - return GetMSIVMEndpoint() + _, endpoint, err := getMSIType() + return endpoint, err } // NewServicePrincipalTokenFromMSI creates a ServicePrincipalToken via the MSI VM Extension. // It will use the system assigned identity when creating the token. +// msiEndpoint - empty string, or pass a non-empty string to override the default value. +// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead. func NewServicePrincipalTokenFromMSI(msiEndpoint, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - return newServicePrincipalTokenFromMSI(msiEndpoint, resource, nil, nil, callbacks...) + return newServicePrincipalTokenFromMSI(msiEndpoint, resource, "", "", callbacks...) } // NewServicePrincipalTokenFromMSIWithUserAssignedID creates a ServicePrincipalToken via the MSI VM Extension. // It will use the clientID of specified user assigned identity when creating the token. +// msiEndpoint - empty string, or pass a non-empty string to override the default value. +// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead. func NewServicePrincipalTokenFromMSIWithUserAssignedID(msiEndpoint, resource string, userAssignedID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - return newServicePrincipalTokenFromMSI(msiEndpoint, resource, &userAssignedID, nil, callbacks...) + if err := validateStringParam(userAssignedID, "userAssignedID"); err != nil { + return nil, err + } + return newServicePrincipalTokenFromMSI(msiEndpoint, resource, userAssignedID, "", callbacks...) } // NewServicePrincipalTokenFromMSIWithIdentityResourceID creates a ServicePrincipalToken via the MSI VM Extension. // It will use the azure resource id of user assigned identity when creating the token. +// msiEndpoint - empty string, or pass a non-empty string to override the default value. +// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead. func NewServicePrincipalTokenFromMSIWithIdentityResourceID(msiEndpoint, resource string, identityResourceID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - return newServicePrincipalTokenFromMSI(msiEndpoint, resource, nil, &identityResourceID, callbacks...) + if err := validateStringParam(identityResourceID, "identityResourceID"); err != nil { + return nil, err + } + return newServicePrincipalTokenFromMSI(msiEndpoint, resource, "", identityResourceID, callbacks...) } -func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedID *string, identityResourceID *string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateStringParam(msiEndpoint, "msiEndpoint"); err != nil { - return nil, err +// ManagedIdentityOptions contains optional values for configuring managed identity authentication. +type ManagedIdentityOptions struct { + // ClientID is the user-assigned identity to use during authentication. + // It is mutually exclusive with IdentityResourceID. + ClientID string + + // IdentityResourceID is the resource ID of the user-assigned identity to use during authentication. + // It is mutually exclusive with ClientID. + IdentityResourceID string +} + +// NewServicePrincipalTokenFromManagedIdentity creates a ServicePrincipalToken using a managed identity. +// It supports the following managed identity environments. +// - App Service Environment (API version 2017-09-01 only) +// - Cloud shell +// - IMDS with a system or user assigned identity +func NewServicePrincipalTokenFromManagedIdentity(resource string, options *ManagedIdentityOptions, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { + if options == nil { + options = &ManagedIdentityOptions{} } + return newServicePrincipalTokenFromMSI("", resource, options.ClientID, options.IdentityResourceID, callbacks...) +} + +func newServicePrincipalTokenFromMSI(msiEndpoint, resource, userAssignedID, identityResourceID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { if err := validateStringParam(resource, "resource"); err != nil { return nil, err } - if userAssignedID != nil { - if err := validateStringParam(*userAssignedID, "userAssignedID"); err != nil { - return nil, err - } - } - if identityResourceID != nil { - if err := validateStringParam(*identityResourceID, "identityResourceID"); err != nil { - return nil, err - } + if userAssignedID != "" && identityResourceID != "" { + return nil, errors.New("cannot specify userAssignedID and identityResourceID") } - // We set the oauth config token endpoint to be MSI's endpoint - msiEndpointURL, err := url.Parse(msiEndpoint) + msiType, endpoint, err := getMSIType() if err != nil { + logger.Instance.Writef(logger.LogError, "Error determining managed identity environment: %v", err) return nil, err } - - v := url.Values{} - v.Set("resource", resource) - // we only support token API version 2017-09-01 for app services - clientIDParam := "client_id" - if isASEEndpoint(*msiEndpointURL) { - v.Set("api-version", appServiceAPIVersion) - clientIDParam = "clientid" - } else { - v.Set("api-version", msiAPIVersion) + logger.Instance.Writef(logger.LogInfo, "Managed identity environment is %s, endpoint is %s", msiType, endpoint) + if msiEndpoint != "" { + endpoint = msiEndpoint + logger.Instance.Writef(logger.LogInfo, "Managed identity custom endpoint is %s", endpoint) } - if userAssignedID != nil { - v.Set(clientIDParam, *userAssignedID) + msiEndpointURL, err := url.Parse(endpoint) + if err != nil { + return nil, err } - if identityResourceID != nil { - v.Set("mi_res_id", *identityResourceID) + // cloud shell sends its data in the request body + if msiType != msiTypeCloudShell { + v := url.Values{} + v.Set("resource", resource) + clientIDParam := "client_id" + switch msiType { + case msiTypeAppServiceV20170901: + clientIDParam = "clientid" + v.Set("api-version", appServiceAPIVersion2017) + break + case msiTypeIMDS: + v.Set("api-version", msiAPIVersion) + } + if userAssignedID != "" { + v.Set(clientIDParam, userAssignedID) + } else if identityResourceID != "" { + v.Set("mi_res_id", identityResourceID) + } + msiEndpointURL.RawQuery = v.Encode() } - msiEndpointURL.RawQuery = v.Encode() spt := &ServicePrincipalToken{ inner: servicePrincipalToken{ @@ -759,10 +839,14 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI OauthConfig: OAuthConfig{ TokenEndpoint: *msiEndpointURL, }, - Secret: &ServicePrincipalMSISecret{}, + Secret: &ServicePrincipalMSISecret{ + msiType: msiType, + clientResourceID: identityResourceID, + }, Resource: resource, AutoRefresh: true, RefreshWithin: defaultRefresh, + ClientID: userAssignedID, }, refreshLock: &sync.RWMutex{}, sender: sender(), @@ -770,10 +854,6 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI MaxMSIRefreshAttempts: defaultMaxMSIRefreshAttempts, } - if userAssignedID != nil { - spt.inner.ClientID = *userAssignedID - } - return spt, nil } @@ -870,31 +950,6 @@ func (spt *ServicePrincipalToken) getGrantType() string { } } -func isIMDS(u url.URL) bool { - return isMSIEndpoint(u) == true || isASEEndpoint(u) == true -} - -func isMSIEndpoint(endpoint url.URL) bool { - msi, err := url.Parse(msiEndpoint) - if err != nil { - return false - } - return endpoint.Host == msi.Host && endpoint.Path == msi.Path -} - -func isASEEndpoint(endpoint url.URL) bool { - aseEndpoint, err := GetMSIAppServiceEndpoint() - if err != nil { - // app service environment isn't enabled - return false - } - ase, err := url.Parse(aseEndpoint) - if err != nil { - return false - } - return endpoint.Host == ase.Host && endpoint.Path == ase.Path -} - func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource string) error { if spt.customRefreshFunc != nil { token, err := spt.customRefreshFunc(ctx, resource) @@ -909,13 +964,40 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err) } req.Header.Add("User-Agent", UserAgent()) - // Add header when runtime is on App Service or Functions - if isASEEndpoint(spt.inner.OauthConfig.TokenEndpoint) { - asMSISecret, _ := os.LookupEnv(asMSISecretEnv) - req.Header.Add(secretHeader, asMSISecret) - } req = req.WithContext(ctx) - if !isIMDS(spt.inner.OauthConfig.TokenEndpoint) { + var resp *http.Response + authBodyFilter := func(b []byte) []byte { + if logger.Level() != logger.LogAuth { + return []byte("**REDACTED** authentication body") + } + return b + } + if msiSecret, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok { + switch msiSecret.msiType { + case msiTypeAppServiceV20170901: + req.Method = http.MethodGet + req.Header.Set("secret", os.Getenv(msiSecretEnv)) + break + case msiTypeCloudShell: + req.Header.Set("Metadata", "true") + data := url.Values{} + data.Set("resource", spt.inner.Resource) + if spt.inner.ClientID != "" { + data.Set("client_id", spt.inner.ClientID) + } else if msiSecret.clientResourceID != "" { + data.Set("msi_res_id", msiSecret.clientResourceID) + } + req.Body = ioutil.NopCloser(strings.NewReader(data.Encode())) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + break + case msiTypeIMDS: + req.Method = http.MethodGet + req.Header.Set("Metadata", "true") + break + } + logger.Instance.WriteRequest(req, logger.Filter{Body: authBodyFilter}) + resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts) + } else { v := url.Values{} v.Set("client_id", spt.inner.ClientID) v.Set("resource", resource) @@ -944,35 +1026,18 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource req.ContentLength = int64(len(s)) req.Header.Set(contentType, mimeTypeFormPost) req.Body = body - } - - if _, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok { - req.Method = http.MethodGet - // the metadata header isn't applicable for ASE - if !isASEEndpoint(spt.inner.OauthConfig.TokenEndpoint) { - req.Header.Set(metadataHeader, "true") - } - } - - var resp *http.Response - if isMSIEndpoint(spt.inner.OauthConfig.TokenEndpoint) { - resp, err = getMSIEndpoint(ctx, spt.sender) - if err != nil { - // return a TokenRefreshError here so that we don't keep retrying - return newTokenRefreshError(fmt.Sprintf("the MSI endpoint is not available. Failed HTTP request to MSI endpoint: %v", err), nil) - } - resp.Body.Close() - } - if isIMDS(spt.inner.OauthConfig.TokenEndpoint) { - resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts) - } else { + logger.Instance.WriteRequest(req, logger.Filter{Body: authBodyFilter}) resp, err = spt.sender.Do(req) } + + // don't return a TokenRefreshError here; this will allow retry logic to apply if err != nil { - // don't return a TokenRefreshError here; this will allow retry logic to apply return fmt.Errorf("adal: Failed to execute the refresh request. Error = '%v'", err) + } else if resp == nil { + return fmt.Errorf("adal: received nil response and error") } + logger.Instance.WriteResponse(resp, logger.Filter{Body: authBodyFilter}) defer resp.Body.Close() rb, err := ioutil.ReadAll(resp.Body) @@ -1264,3 +1329,8 @@ func MSIAvailable(ctx context.Context, sender Sender) bool { } return err == nil } + +// used for testing purposes +var msiAvailableHook = func(ctx context.Context, sender Sender) bool { + return MSIAvailable(ctx, sender) +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go index 54b4defefd57..953f75502827 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go @@ -24,8 +24,6 @@ import ( ) func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) { - // this cannot fail, the return sig is due to legacy reasons - msiEndpoint, _ := GetMSIVMEndpoint() tempCtx, cancel := context.WithTimeout(ctx, 500*time.Millisecond) defer cancel() // http.NewRequestWithContext() was added in Go 1.13 diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go index 6d73bae15e9d..729bfbd0abf0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go @@ -23,8 +23,6 @@ import ( ) func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) { - // this cannot fail, the return sig is due to legacy reasons - msiEndpoint, _ := GetMSIVMEndpoint() tempCtx, cancel := context.WithTimeout(ctx, 500*time.Millisecond) defer cancel() req, _ := http.NewRequest(http.MethodGet, msiEndpoint, nil) diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/client.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/client.go index 898db8b95424..0b7525f0f4ca 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/client.go @@ -17,6 +17,7 @@ package autorest import ( "bytes" "crypto/tls" + "errors" "fmt" "io" "io/ioutil" @@ -260,6 +261,9 @@ func (c Client) Do(r *http.Request) (*http.Response, error) { }, }) resp, err := SendWithSender(c.sender(tls.RenegotiateNever), r) + if resp == nil && err == nil { + err = errors.New("autorest: received nil response and error") + } logger.Instance.WriteResponse(resp, logger.Filter{}) Respond(resp, c.ByInspecting()) return resp, err diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/go.mod b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/go.mod index 75a534f10891..fd0b2c0c3279 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/go.mod +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/go.mod @@ -4,9 +4,9 @@ go 1.12 require ( github.com/Azure/go-autorest v14.2.0+incompatible - github.com/Azure/go-autorest/autorest/adal v0.9.5 + github.com/Azure/go-autorest/autorest/adal v0.9.13 github.com/Azure/go-autorest/autorest/mocks v0.4.1 - github.com/Azure/go-autorest/logger v0.2.0 + github.com/Azure/go-autorest/logger v0.2.1 github.com/Azure/go-autorest/tracing v0.6.0 golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 ) diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/go.sum b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/go.sum index fa27c68d1051..373d9c4e2557 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/go.sum +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/go.sum @@ -1,13 +1,13 @@ github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go.mod b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go.mod index a2054be36cd8..8fd041e2baef 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go.mod +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go.mod @@ -1,3 +1,5 @@ module github.com/Azure/go-autorest/autorest/to go 1.12 + +require github.com/Azure/go-autorest v14.2.0+incompatible diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go.sum b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go.sum new file mode 100644 index 000000000000..1fc56a962ee4 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go.sum @@ -0,0 +1,2 @@ +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go_mod_tidy_hack.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go_mod_tidy_hack.go new file mode 100644 index 000000000000..b7310f6b868f --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/to/go_mod_tidy_hack.go @@ -0,0 +1,24 @@ +// +build modhack + +package to + +// Copyright 2017 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file, and the github.com/Azure/go-autorest import, won't actually become part of +// the resultant binary. + +// Necessary for safely adding multi-module repo. +// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository +import _ "github.com/Azure/go-autorest" diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/logger/logger.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/logger/logger.go index da09f394c5d0..2f5d8cc1a197 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/logger/logger.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/logger/logger.go @@ -55,6 +55,10 @@ const ( // LogDebug tells a logger to log all LogDebug, LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it. LogDebug + + // LogAuth is a special case of LogDebug, it tells a logger to also log the body of an authentication request and response. + // NOTE: this can disclose sensitive information, use with care. + LogAuth ) const ( @@ -65,6 +69,7 @@ const ( logWarning = "WARNING" logInfo = "INFO" logDebug = "DEBUG" + logAuth = "AUTH" logUnknown = "UNKNOWN" ) @@ -83,6 +88,8 @@ func ParseLevel(s string) (lt LevelType, err error) { lt = LogInfo case logDebug: lt = LogDebug + case logAuth: + lt = LogAuth default: err = fmt.Errorf("bad log level '%s'", s) } @@ -106,6 +113,8 @@ func (lt LevelType) String() string { return logInfo case LogDebug: return logDebug + case LogAuth: + return logAuth default: return logUnknown } diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/client/client.go index 03334d69207b..74f35ccf0cdc 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/client/client.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/client/client.go @@ -88,10 +88,6 @@ func (c *Client) NewRequest(operation *request.Operation, params interface{}, da // AddDebugHandlers injects debug logging handlers into the service to log request // debug information. func (c *Client) AddDebugHandlers() { - if !c.Config.LogLevel.AtLeast(aws.LogDebug) { - return - } - c.Handlers.Send.PushFrontNamed(LogHTTPRequestHandler) c.Handlers.Send.PushBackNamed(LogHTTPResponseHandler) } diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go index 8958c32d4e9f..1d774cfa251f 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go @@ -53,6 +53,10 @@ var LogHTTPRequestHandler = request.NamedHandler{ } func logRequest(r *request.Request) { + if !r.Config.LogLevel.AtLeast(aws.LogDebug) { + return + } + logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) bodySeekable := aws.IsReaderSeekable(r.Body) @@ -120,6 +124,10 @@ var LogHTTPResponseHandler = request.NamedHandler{ } func logResponse(r *request.Request) { + if !r.Config.LogLevel.AtLeast(aws.LogDebug) { + return + } + lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)} if r.HTTPResponse == nil { diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/config.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/config.go index 3b809e8478c1..39fa6d5fe740 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -438,13 +438,6 @@ func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config { return c } -// MergeIn merges the passed in configs into the existing config object. -func (c *Config) MergeIn(cfgs ...*Config) { - for _, other := range cfgs { - mergeInConfig(c, other) - } -} - // WithSTSRegionalEndpoint will set whether or not to use regional endpoint flag // when resolving the endpoint for a service func (c *Config) WithSTSRegionalEndpoint(sre endpoints.STSRegionalEndpoint) *Config { @@ -459,6 +452,27 @@ func (c *Config) WithS3UsEast1RegionalEndpoint(sre endpoints.S3UsEast1RegionalEn return c } +// WithLowerCaseHeaderMaps sets a config LowerCaseHeaderMaps value +// returning a Config pointer for chaining. +func (c *Config) WithLowerCaseHeaderMaps(t bool) *Config { + c.LowerCaseHeaderMaps = &t + return c +} + +// WithDisableRestProtocolURICleaning sets a config DisableRestProtocolURICleaning value +// returning a Config pointer for chaining. +func (c *Config) WithDisableRestProtocolURICleaning(t bool) *Config { + c.DisableRestProtocolURICleaning = &t + return c +} + +// MergeIn merges the passed in configs into the existing config object. +func (c *Config) MergeIn(cfgs ...*Config) { + for _, other := range cfgs { + mergeInConfig(c, other) + } +} + func mergeInConfig(dst *Config, other *Config) { if other == nil { return @@ -571,6 +585,10 @@ func mergeInConfig(dst *Config, other *Config) { if other.S3UsEast1RegionalEndpoint != endpoints.UnsetS3UsEast1Endpoint { dst.S3UsEast1RegionalEndpoint = other.S3UsEast1RegionalEndpoint } + + if other.LowerCaseHeaderMaps != nil { + dst.LowerCaseHeaderMaps = other.LowerCaseHeaderMaps + } } // Copy will return a shallow copy of the Config object. If any additional diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index d95a5eb54080..36a915efea8c 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -178,7 +178,7 @@ func handleSendError(r *request.Request, err error) { var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) { if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 { // this may be replaced by an UnmarshalError handler - r.Error = awserr.New("UnknownError", "unknown error", nil) + r.Error = awserr.New("UnknownError", "unknown error", r.Error) } }} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/doc.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/doc.go new file mode 100644 index 000000000000..18c940ab3c36 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/doc.go @@ -0,0 +1,60 @@ +// Package ssocreds provides a credential provider for retrieving temporary AWS credentials using an SSO access token. +// +// IMPORTANT: The provider in this package does not initiate or perform the AWS SSO login flow. The SDK provider +// expects that you have already performed the SSO login flow using AWS CLI using the "aws sso login" command, or by +// some other mechanism. The provider must find a valid non-expired access token for the AWS SSO user portal URL in +// ~/.aws/sso/cache. If a cached token is not found, it is expired, or the file is malformed an error will be returned. +// +// Loading AWS SSO credentials with the AWS shared configuration file +// +// You can use configure AWS SSO credentials from the AWS shared configuration file by +// providing the specifying the required keys in the profile: +// +// sso_account_id +// sso_region +// sso_role_name +// sso_start_url +// +// For example, the following defines a profile "devsso" and specifies the AWS SSO parameters that defines the target +// account, role, sign-on portal, and the region where the user portal is located. Note: all SSO arguments must be +// provided, or an error will be returned. +// +// [profile devsso] +// sso_start_url = https://my-sso-portal.awsapps.com/start +// sso_role_name = SSOReadOnlyRole +// sso_region = us-east-1 +// sso_account_id = 123456789012 +// +// Using the config module, you can load the AWS SDK shared configuration, and specify that this profile be used to +// retrieve credentials. For example: +// +// sess, err := session.NewSessionWithOptions(session.Options{ +// SharedConfigState: session.SharedConfigEnable, +// Profile: "devsso", +// }) +// if err != nil { +// return err +// } +// +// Programmatically loading AWS SSO credentials directly +// +// You can programmatically construct the AWS SSO Provider in your application, and provide the necessary information +// to load and retrieve temporary credentials using an access token from ~/.aws/sso/cache. +// +// svc := sso.New(sess, &aws.Config{ +// Region: aws.String("us-west-2"), // Client Region must correspond to the AWS SSO user portal region +// }) +// +// provider := ssocreds.NewCredentialsWithClient(svc, "123456789012", "SSOReadOnlyRole", "https://my-sso-portal.awsapps.com/start") +// +// credentials, err := provider.Get() +// if err != nil { +// return err +// } +// +// Additional Resources +// +// Configuring the AWS CLI to use AWS Single Sign-On: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html +// +// AWS Single Sign-On User Guide: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html +package ssocreds diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os.go new file mode 100644 index 000000000000..ceca7dceecb7 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os.go @@ -0,0 +1,9 @@ +// +build !windows + +package ssocreds + +import "os" + +func getHomeDirectory() string { + return os.Getenv("HOME") +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os_windows.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os_windows.go new file mode 100644 index 000000000000..eb48f61e5bc8 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/os_windows.go @@ -0,0 +1,7 @@ +package ssocreds + +import "os" + +func getHomeDirectory() string { + return os.Getenv("USERPROFILE") +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go new file mode 100644 index 000000000000..6eda2a5557ff --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go @@ -0,0 +1,180 @@ +package ssocreds + +import ( + "crypto/sha1" + "encoding/hex" + "encoding/json" + "fmt" + "io/ioutil" + "path/filepath" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/service/sso" + "github.com/aws/aws-sdk-go/service/sso/ssoiface" +) + +// ErrCodeSSOProviderInvalidToken is the code type that is returned if loaded token has expired or is otherwise invalid. +// To refresh the SSO session run aws sso login with the corresponding profile. +const ErrCodeSSOProviderInvalidToken = "SSOProviderInvalidToken" + +const invalidTokenMessage = "the SSO session has expired or is invalid" + +func init() { + nowTime = time.Now + defaultCacheLocation = defaultCacheLocationImpl +} + +var nowTime func() time.Time + +// ProviderName is the name of the provider used to specify the source of credentials. +const ProviderName = "SSOProvider" + +var defaultCacheLocation func() string + +func defaultCacheLocationImpl() string { + return filepath.Join(getHomeDirectory(), ".aws", "sso", "cache") +} + +// Provider is an AWS credential provider that retrieves temporary AWS credentials by exchanging an SSO login token. +type Provider struct { + credentials.Expiry + + // The Client which is configured for the AWS Region where the AWS SSO user portal is located. + Client ssoiface.SSOAPI + + // The AWS account that is assigned to the user. + AccountID string + + // The role name that is assigned to the user. + RoleName string + + // The URL that points to the organization's AWS Single Sign-On (AWS SSO) user portal. + StartURL string +} + +// NewCredentials returns a new AWS Single Sign-On (AWS SSO) credential provider. The ConfigProvider is expected to be configured +// for the AWS Region where the AWS SSO user portal is located. +func NewCredentials(configProvider client.ConfigProvider, accountID, roleName, startURL string, optFns ...func(provider *Provider)) *credentials.Credentials { + return NewCredentialsWithClient(sso.New(configProvider), accountID, roleName, startURL, optFns...) +} + +// NewCredentialsWithClient returns a new AWS Single Sign-On (AWS SSO) credential provider. The provided client is expected to be configured +// for the AWS Region where the AWS SSO user portal is located. +func NewCredentialsWithClient(client ssoiface.SSOAPI, accountID, roleName, startURL string, optFns ...func(provider *Provider)) *credentials.Credentials { + p := &Provider{ + Client: client, + AccountID: accountID, + RoleName: roleName, + StartURL: startURL, + } + + for _, fn := range optFns { + fn(p) + } + + return credentials.NewCredentials(p) +} + +// Retrieve retrieves temporary AWS credentials from the configured Amazon Single Sign-On (AWS SSO) user portal +// by exchanging the accessToken present in ~/.aws/sso/cache. +func (p *Provider) Retrieve() (credentials.Value, error) { + return p.RetrieveWithContext(aws.BackgroundContext()) +} + +// RetrieveWithContext retrieves temporary AWS credentials from the configured Amazon Single Sign-On (AWS SSO) user portal +// by exchanging the accessToken present in ~/.aws/sso/cache. +func (p *Provider) RetrieveWithContext(ctx credentials.Context) (credentials.Value, error) { + tokenFile, err := loadTokenFile(p.StartURL) + if err != nil { + return credentials.Value{}, err + } + + output, err := p.Client.GetRoleCredentialsWithContext(ctx, &sso.GetRoleCredentialsInput{ + AccessToken: &tokenFile.AccessToken, + AccountId: &p.AccountID, + RoleName: &p.RoleName, + }) + if err != nil { + return credentials.Value{}, err + } + + expireTime := time.Unix(0, aws.Int64Value(output.RoleCredentials.Expiration)*int64(time.Millisecond)).UTC() + p.SetExpiration(expireTime, 0) + + return credentials.Value{ + AccessKeyID: aws.StringValue(output.RoleCredentials.AccessKeyId), + SecretAccessKey: aws.StringValue(output.RoleCredentials.SecretAccessKey), + SessionToken: aws.StringValue(output.RoleCredentials.SessionToken), + ProviderName: ProviderName, + }, nil +} + +func getCacheFileName(url string) (string, error) { + hash := sha1.New() + _, err := hash.Write([]byte(url)) + if err != nil { + return "", err + } + return strings.ToLower(hex.EncodeToString(hash.Sum(nil))) + ".json", nil +} + +type rfc3339 time.Time + +func (r *rfc3339) UnmarshalJSON(bytes []byte) error { + var value string + + if err := json.Unmarshal(bytes, &value); err != nil { + return err + } + + parse, err := time.Parse(time.RFC3339, value) + if err != nil { + return fmt.Errorf("expected RFC3339 timestamp: %v", err) + } + + *r = rfc3339(parse) + + return nil +} + +type token struct { + AccessToken string `json:"accessToken"` + ExpiresAt rfc3339 `json:"expiresAt"` + Region string `json:"region,omitempty"` + StartURL string `json:"startUrl,omitempty"` +} + +func (t token) Expired() bool { + return nowTime().Round(0).After(time.Time(t.ExpiresAt)) +} + +func loadTokenFile(startURL string) (t token, err error) { + key, err := getCacheFileName(startURL) + if err != nil { + return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, err) + } + + fileBytes, err := ioutil.ReadFile(filepath.Join(defaultCacheLocation(), key)) + if err != nil { + return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, err) + } + + if err := json.Unmarshal(fileBytes, &t); err != nil { + return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, err) + } + + if len(t.AccessToken) == 0 { + return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, nil) + } + + if t.Expired() { + return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, nil) + } + + return t, nil +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go index 6846ef6f8085..260a37cbbabe 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -95,7 +95,7 @@ import ( // StdinTokenProvider will prompt on stderr and read from stdin for a string value. // An error is returned if reading from stdin fails. // -// Use this function go read MFA tokens from stdin. The function makes no attempt +// Use this function to read MFA tokens from stdin. The function makes no attempt // to make atomic prompts from stdin across multiple gorouties. // // Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will @@ -244,9 +244,11 @@ type AssumeRoleProvider struct { MaxJitterFrac float64 } -// NewCredentials returns a pointer to a new Credentials object wrapping the +// NewCredentials returns a pointer to a new Credentials value wrapping the // AssumeRoleProvider. The credentials will expire every 15 minutes and the -// role will be named after a nanosecond timestamp of this operation. +// role will be named after a nanosecond timestamp of this operation. The +// Credentials value will attempt to refresh the credentials using the provider +// when Credentials.Get is called, if the cached credentials are expiring. // // Takes a Config provider to create the STS client. The ConfigProvider is // satisfied by the session.Session type. @@ -268,9 +270,11 @@ func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*As return credentials.NewCredentials(p) } -// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the +// NewCredentialsWithClient returns a pointer to a new Credentials value wrapping the // AssumeRoleProvider. The credentials will expire every 15 minutes and the -// role will be named after a nanosecond timestamp of this operation. +// role will be named after a nanosecond timestamp of this operation. The +// Credentials value will attempt to refresh the credentials using the provider +// when Credentials.Get is called, if the cached credentials are expiring. // // Takes an AssumeRoler which can be satisfied by the STS client. // diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index b5d46ad03940..2de69cc5bc85 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -122,6 +122,9 @@ var awsPartition = partition{ "ap-northeast-2": region{ Description: "Asia Pacific (Seoul)", }, + "ap-northeast-3": region{ + Description: "Asia Pacific (Osaka)", + }, "ap-south-1": region{ Description: "Asia Pacific (Mumbai)", }, @@ -185,6 +188,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -240,6 +244,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -297,6 +302,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -345,6 +351,37 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "airflow": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "amplifybackend": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "api.detective": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -367,9 +404,33 @@ var awsPartition = partition{ "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "api.detective-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "api.detective-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "api.detective-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "api.detective-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "api.ecr": service{ @@ -399,6 +460,12 @@ var awsPartition = partition{ Region: "ap-northeast-2", }, }, + "ap-northeast-3": endpoint{ + Hostname: "api.ecr.ap-northeast-3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-3", + }, + }, "ap-south-1": endpoint{ Hostname: "api.ecr.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ @@ -568,6 +635,24 @@ var awsPartition = partition{ }, }, }, + "api.fleethub.iot": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "api.mediatailor": service{ Endpoints: endpoints{ @@ -647,6 +732,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -665,6 +751,19 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "app-integrations": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "appflow": service{ Endpoints: endpoints{ @@ -694,6 +793,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -715,6 +815,7 @@ var awsPartition = partition{ "appmesh": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -736,6 +837,16 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "apprunner": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "appstream2": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -764,6 +875,7 @@ var awsPartition = partition{ "appsync": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -776,6 +888,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -786,6 +899,7 @@ var awsPartition = partition{ "athena": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -799,12 +913,36 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "athena-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "athena-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "athena-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "athena-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "autoscaling": service{ @@ -816,6 +954,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -868,6 +1007,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -889,9 +1029,11 @@ var awsPartition = partition{ "batch": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -964,12 +1106,11 @@ var awsPartition = partition{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Defaults: endpoint{ - SSLCommonName: "service.chime.aws.amazon.com", - Protocols: []string{"https"}, + Protocols: []string{"https"}, }, Endpoints: endpoints{ "aws-global": endpoint{ - Hostname: "service.chime.aws.amazon.com", + Hostname: "chime.us-east-1.amazonaws.com", Protocols: []string{"https"}, CredentialScope: credentialScope{ Region: "us-east-1", @@ -1022,6 +1163,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1195,7 +1337,10 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -1204,6 +1349,7 @@ var awsPartition = partition{ "codebuild": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -1255,6 +1401,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1286,6 +1433,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1328,9 +1476,25 @@ var awsPartition = partition{ }, }, }, + "codeguru-reviewer": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "codepipeline": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1339,6 +1503,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -1428,8 +1593,10 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "cognito-identity-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1448,8 +1615,10 @@ var awsPartition = partition{ Region: "us-west-2", }, }, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -1463,8 +1632,10 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "cognito-idp-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1477,14 +1648,22 @@ var awsPartition = partition{ Region: "us-east-2", }, }, + "fips-us-west-1": endpoint{ + Hostname: "cognito-idp-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, "fips-us-west-2": endpoint{ Hostname: "cognito-idp-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ Region: "us-west-2", }, }, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -1574,24 +1753,51 @@ var awsPartition = partition{ "config": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "config-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "config-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "config-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "config-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "connect": service{ @@ -1600,6 +1806,19 @@ var awsPartition = partition{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "contact-lens": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, @@ -1738,6 +1957,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1799,6 +2019,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1886,6 +2107,12 @@ var awsPartition = partition{ Region: "eu-west-3", }, }, + "sa-east-1": endpoint{ + Hostname: "rds.sa-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "sa-east-1", + }, + }, "us-east-1": endpoint{ Hostname: "rds.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1970,6 +2197,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2032,6 +2260,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2089,6 +2318,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2155,6 +2385,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2206,6 +2437,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2255,6 +2487,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2286,6 +2519,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2335,6 +2569,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2369,6 +2604,12 @@ var awsPartition = partition{ Region: "ap-northeast-2", }, }, + "fips-ap-northeast-3": endpoint{ + Hostname: "elasticfilesystem-fips.ap-northeast-3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-3", + }, + }, "fips-ap-south-1": endpoint{ Hostname: "elasticfilesystem-fips.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2482,6 +2723,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2534,6 +2776,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2610,6 +2853,27 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "emr-containers": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "entitlement.marketplace": service{ Defaults: endpoint{ CredentialScope: credentialScope{ @@ -2627,6 +2891,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2658,6 +2923,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2700,17 +2966,38 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "firehose": service{ + "finspace": service{ Endpoints: endpoints{ - "af-south-1": endpoint{}, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, + "ca-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "finspace-api": service{ + + Endpoints: endpoints{ + "ca-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "firehose": service{ + + Endpoints: endpoints{ + "af-south-1": endpoint{}, + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-south-1": endpoint{}, @@ -2768,6 +3055,18 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "fips-af-south-1": endpoint{ + Hostname: "fms-fips.af-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "af-south-1", + }, + }, + "fips-ap-east-1": endpoint{ + Hostname: "fms-fips.ap-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-east-1", + }, + }, "fips-ap-northeast-1": endpoint{ Hostname: "fms-fips.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2810,6 +3109,12 @@ var awsPartition = partition{ Region: "eu-central-1", }, }, + "fips-eu-south-1": endpoint{ + Hostname: "fms-fips.eu-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-south-1", + }, + }, "fips-eu-west-1": endpoint{ Hostname: "fms-fips.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2828,6 +3133,12 @@ var awsPartition = partition{ Region: "eu-west-3", }, }, + "fips-me-south-1": endpoint{ + Hostname: "fms-fips.me-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "me-south-1", + }, + }, "fips-sa-east-1": endpoint{ Hostname: "fms-fips.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2899,6 +3210,7 @@ var awsPartition = partition{ "fsx": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -2908,19 +3220,53 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-prod-ca-central-1": endpoint{ + Hostname: "fsx-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "fips-prod-us-east-1": endpoint{ + Hostname: "fsx-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-prod-us-east-2": endpoint{ + Hostname: "fsx-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-prod-us-west-1": endpoint{ + Hostname: "fsx-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-prod-us-west-2": endpoint{ + Hostname: "fsx-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "gamelift": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2928,8 +3274,12 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2946,6 +3296,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2997,9 +3348,11 @@ var awsPartition = partition{ "glue": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3065,9 +3418,17 @@ var awsPartition = partition{ Endpoints: endpoints{ "af-south-1": endpoint{}, + "ap-northeast-2": endpoint{}, "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "groundstation-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, "fips-us-east-2": endpoint{ Hostname: "groundstation-fips.us-east-2.amazonaws.com", CredentialScope: credentialScope{ @@ -3081,6 +3442,7 @@ var awsPartition = partition{ }, }, "me-south-1": endpoint{}, + "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, @@ -3095,6 +3457,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3148,6 +3511,14 @@ var awsPartition = partition{ }, }, }, + "healthlake": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, "honeycode": service{ Endpoints: endpoints{ @@ -3404,6 +3775,23 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "iotwireless": service{ + + Endpoints: endpoints{ + "eu-west-1": endpoint{ + Hostname: "api.iotwireless.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "us-east-1": endpoint{ + Hostname: "api.iotwireless.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, "kafka": service{ Endpoints: endpoints{ @@ -3435,6 +3823,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3528,6 +3917,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3549,6 +3939,8 @@ var awsPartition = partition{ "lakeformation": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -3585,11 +3977,12 @@ var awsPartition = partition{ Region: "us-west-2", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "lambda": service{ @@ -3599,6 +3992,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3648,6 +4042,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3700,6 +4095,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -3715,6 +4111,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3757,6 +4154,26 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "lookoutequipment": service{ + + Endpoints: endpoints{ + "ap-northeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + }, + }, + "lookoutvision": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "machinelearning": service{ Endpoints: endpoints{ @@ -3786,15 +4203,18 @@ var awsPartition = partition{ "macie2": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -3822,11 +4242,12 @@ var awsPartition = partition{ Region: "us-west-2", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "managedblockchain": service{ @@ -3999,6 +4420,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4049,7 +4471,19 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "models-fips.lex.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "models-fips.lex.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "monitoring": service{ @@ -4061,6 +4495,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4109,6 +4544,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4465,6 +4901,22 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "personalize": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "pinpoint": service{ Defaults: endpoint{ CredentialScope: credentialScope{ @@ -4613,6 +5065,18 @@ var awsPartition = partition{ }, }, }, + "profile": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "projects.iot1click": service{ Endpoints: endpoints{ @@ -4634,9 +5098,27 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "qldb-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "qldb-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "qldb-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "ram": service{ @@ -4646,6 +5128,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4656,12 +5139,42 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-ca-central-1": endpoint{ + Hostname: "ram-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "fips-us-east-1": endpoint{ + Hostname: "ram-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "ram-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "ram-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "ram-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "rds": service{ @@ -4671,6 +5184,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4728,6 +5242,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4831,6 +5346,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4919,6 +5435,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4951,7 +5468,19 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "runtime-fips.lex.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "runtime-fips.lex.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "runtime.sagemaker": service{ @@ -5014,6 +5543,90 @@ var awsPartition = partition{ DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ + "accesspoint-af-south-1": endpoint{ + Hostname: "s3-accesspoint.af-south-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-ap-east-1": endpoint{ + Hostname: "s3-accesspoint.ap-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-ap-northeast-1": endpoint{ + Hostname: "s3-accesspoint.ap-northeast-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-ap-northeast-2": endpoint{ + Hostname: "s3-accesspoint.ap-northeast-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-ap-northeast-3": endpoint{ + Hostname: "s3-accesspoint.ap-northeast-3.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-ap-south-1": endpoint{ + Hostname: "s3-accesspoint.ap-south-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-ap-southeast-1": endpoint{ + Hostname: "s3-accesspoint.ap-southeast-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-ap-southeast-2": endpoint{ + Hostname: "s3-accesspoint.ap-southeast-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-ca-central-1": endpoint{ + Hostname: "s3-accesspoint.ca-central-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-eu-central-1": endpoint{ + Hostname: "s3-accesspoint.eu-central-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-eu-north-1": endpoint{ + Hostname: "s3-accesspoint.eu-north-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-eu-south-1": endpoint{ + Hostname: "s3-accesspoint.eu-south-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-eu-west-1": endpoint{ + Hostname: "s3-accesspoint.eu-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-eu-west-2": endpoint{ + Hostname: "s3-accesspoint.eu-west-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-eu-west-3": endpoint{ + Hostname: "s3-accesspoint.eu-west-3.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-me-south-1": endpoint{ + Hostname: "s3-accesspoint.me-south-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-sa-east-1": endpoint{ + Hostname: "s3-accesspoint.sa-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-us-east-1": endpoint{ + Hostname: "s3-accesspoint.us-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-us-east-2": endpoint{ + Hostname: "s3-accesspoint.us-east-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-us-west-1": endpoint{ + Hostname: "s3-accesspoint.us-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-us-west-2": endpoint{ + Hostname: "s3-accesspoint.us-west-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{ @@ -5021,6 +5634,7 @@ var awsPartition = partition{ SignatureVersions: []string{"s3", "s3v4"}, }, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{ Hostname: "s3.ap-southeast-1.amazonaws.com", @@ -5045,8 +5659,28 @@ var awsPartition = partition{ Hostname: "s3.eu-west-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips-accesspoint-ca-central-1": endpoint{ + Hostname: "s3-accesspoint-fips.ca-central-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "fips-accesspoint-us-east-1": endpoint{ + Hostname: "s3-accesspoint-fips.us-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "fips-accesspoint-us-east-2": endpoint{ + Hostname: "s3-accesspoint-fips.us-east-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "fips-accesspoint-us-west-1": endpoint{ + Hostname: "s3-accesspoint-fips.us-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "fips-accesspoint-us-west-2": endpoint{ + Hostname: "s3-accesspoint-fips.us-west-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, "me-south-1": endpoint{}, "s3-external-1": endpoint{ Hostname: "s3-external-1.amazonaws.com", @@ -5097,6 +5731,13 @@ var awsPartition = partition{ Region: "ap-northeast-2", }, }, + "ap-northeast-3": endpoint{ + Hostname: "s3-control.ap-northeast-3.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "ap-northeast-3", + }, + }, "ap-south-1": endpoint{ Hostname: "s3-control.ap-south-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, @@ -5292,6 +5933,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5341,6 +5983,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5451,6 +6094,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5496,6 +6140,7 @@ var awsPartition = partition{ "servicediscovery": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -5505,6 +6150,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -5531,6 +6177,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5558,9 +6205,27 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "session.qldb-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "session.qldb-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "session.qldb-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "shield": service{ @@ -5637,9 +6302,11 @@ var awsPartition = partition{ "snowball": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5762,6 +6429,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5814,6 +6482,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5865,6 +6534,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5920,6 +6590,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6065,6 +6736,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6132,6 +6804,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6181,6 +6854,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6250,11 +6924,14 @@ var awsPartition = partition{ "transcribestreaming": service{ Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -6263,6 +6940,8 @@ var awsPartition = partition{ "transfer": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -6271,6 +6950,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -6304,11 +6984,12 @@ var awsPartition = partition{ Region: "us-west-2", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "translate": service{ @@ -6654,6 +7335,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, @@ -6684,6 +7366,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6694,12 +7377,36 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "xray-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "xray-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "xray-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "xray-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, }, @@ -6791,7 +7498,8 @@ var awscnPartition = partition{ "appsync": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, }, }, "athena": service{ @@ -6947,6 +7655,17 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "docdb": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{ + Hostname: "rds.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, "ds": service{ Endpoints: endpoints{ @@ -7116,6 +7835,16 @@ var awscnPartition = partition{ "cn-north-1": endpoint{}, }, }, + "guardduty": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "health": service{ Endpoints: endpoints{ @@ -7208,7 +7937,8 @@ var awscnPartition = partition{ "lakeformation": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, }, }, "lambda": service{ @@ -7252,6 +7982,13 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "mq": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "neptune": service{ Endpoints: endpoints{ @@ -7274,12 +8011,12 @@ var awscnPartition = partition{ Region: "cn-northwest-1", }, }, - "fips-aws-cn-global": endpoint{ - Hostname: "organizations.cn-northwest-1.amazonaws.com.cn", - CredentialScope: credentialScope{ - Region: "cn-northwest-1", - }, - }, + }, + }, + "personalize": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, }, }, "polly": service{ @@ -7288,6 +8025,13 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "ram": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "rds": service{ Endpoints: endpoints{ @@ -7322,6 +8066,15 @@ var awscnPartition = partition{ }, }, }, + "route53resolver": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "runtime.sagemaker": service{ Endpoints: endpoints{ @@ -7338,6 +8091,14 @@ var awscnPartition = partition{ DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ + "accesspoint-cn-north-1": endpoint{ + Hostname: "s3-accesspoint.cn-north-1.amazonaws.com.cn", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-cn-northwest-1": endpoint{ + Hostname: "s3-accesspoint.cn-northwest-1.amazonaws.com.cn", + SignatureVersions: []string{"s3v4"}, + }, "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, @@ -7394,6 +8155,13 @@ var awscnPartition = partition{ }, }, }, + "servicecatalog": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "servicediscovery": service{ Endpoints: endpoints{ @@ -7627,8 +8395,29 @@ var awsusgovPartition = partition{ Region: "us-gov-west-1", }, }, - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "api.detective": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "api.detective-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "api.detective-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, }, }, "api.ecr": service{ @@ -7973,10 +8762,28 @@ var awsusgovPartition = partition{ "config": service{ Endpoints: endpoints{ + "fips-us-gov-east-1": endpoint{ + Hostname: "config.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-us-gov-west-1": endpoint{ + Hostname: "config.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, + "connect": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "datasync": service{ Endpoints: endpoints{ @@ -8302,6 +9109,46 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "fms": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "fips-us-gov-east-1": endpoint{ + Hostname: "fms-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-us-gov-west-1": endpoint{ + Hostname: "fms-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "fsx": service{ + + Endpoints: endpoints{ + "fips-prod-us-gov-east-1": endpoint{ + Hostname: "fsx-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-prod-us-gov-west-1": endpoint{ + Hostname: "fsx-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "glacier": service{ Endpoints: endpoints{ @@ -8345,12 +9192,30 @@ var awsusgovPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "dataplane-us-gov-east-1": endpoint{ + Hostname: "greengrass-ats.iot.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, "dataplane-us-gov-west-1": endpoint{ Hostname: "greengrass-ats.iot.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, + "fips-us-gov-east-1": endpoint{ + Hostname: "greengrass-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-east-1": endpoint{ + Hostname: "greengrass.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, "us-gov-west-1": endpoint{ Hostname: "greengrass.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -8366,6 +9231,12 @@ var awsusgovPartition = partition{ }, Endpoints: endpoints{ "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "guardduty.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "guardduty.us-gov-west-1.amazonaws.com", @@ -8486,6 +9357,18 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "lakeformation": service{ + + Endpoints: endpoints{ + "fips-us-gov-west-1": endpoint{ + Hostname: "lakeformation-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-west-1": endpoint{}, + }, + }, "lambda": service{ Endpoints: endpoints{ @@ -8563,6 +9446,22 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "models.lex": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "lex", + }, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "models-fips.lex.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "monitoring": service{ Endpoints: endpoints{ @@ -8671,8 +9570,18 @@ var awsusgovPartition = partition{ "ram": service{ Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, + "us-gov-east-1": endpoint{ + Hostname: "ram.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "ram.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, }, }, "rds": service{ @@ -8768,10 +9677,32 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "runtime.lex": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "lex", + }, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "runtime-fips.lex.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "runtime.sagemaker": service{ Endpoints: endpoints{ "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "runtime.sagemaker.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, }, }, "s3": service{ @@ -8782,6 +9713,22 @@ var awsusgovPartition = partition{ DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", }, Endpoints: endpoints{ + "accesspoint-us-gov-east-1": endpoint{ + Hostname: "s3-accesspoint.us-gov-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "accesspoint-us-gov-west-1": endpoint{ + Hostname: "s3-accesspoint.us-gov-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "fips-accesspoint-us-gov-east-1": endpoint{ + Hostname: "s3-accesspoint-fips.us-gov-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, + "fips-accesspoint-us-gov-west-1": endpoint{ + Hostname: "s3-accesspoint-fips.us-gov-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + }, "fips-us-gov-west-1": endpoint{ Hostname: "s3-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -8915,6 +9862,27 @@ var awsusgovPartition = partition{ }, }, }, + "servicequotas": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "fips-us-gov-east-1": endpoint{ + Hostname: "servicequotas.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-us-gov-west-1": endpoint{ + Hostname: "servicequotas.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "sms": service{ Endpoints: endpoints{ @@ -9182,12 +10150,24 @@ var awsusgovPartition = partition{ "waf-regional": service{ Endpoints: endpoints{ + "fips-us-gov-east-1": endpoint{ + Hostname: "waf-regional-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, "fips-us-gov-west-1": endpoint{ Hostname: "waf-regional-fips.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, + "us-gov-east-1": endpoint{ + Hostname: "waf-regional.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, "us-gov-west-1": endpoint{ Hostname: "waf-regional.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -9211,6 +10191,18 @@ var awsusgovPartition = partition{ "xray": service{ Endpoints: endpoints{ + "fips-us-gov-east-1": endpoint{ + Hostname: "xray-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-us-gov-west-1": endpoint{ + Hostname: "xray-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, @@ -9382,6 +10374,18 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{}, }, }, + "elasticfilesystem": service{ + + Endpoints: endpoints{ + "fips-us-iso-east-1": endpoint{ + Hostname: "elasticfilesystem-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + "us-iso-east-1": endpoint{}, + }, + }, "elasticloadbalancing": service{ Endpoints: endpoints{ @@ -9410,6 +10414,12 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{}, }, }, + "firehose": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, "glacier": service{ Endpoints: endpoints{ @@ -9467,12 +10477,30 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{}, }, }, + "medialive": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "mediapackage": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, "monitoring": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, }, }, + "outposts": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, "rds": service{ Endpoints: endpoints{ @@ -9515,6 +10543,12 @@ var awsisoPartition = partition{ }, }, }, + "secretsmanager": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, "snowball": service{ Endpoints: endpoints{ @@ -9537,6 +10571,12 @@ var awsisoPartition = partition{ }, }, }, + "ssm": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, "states": service{ Endpoints: endpoints{ @@ -9594,6 +10634,14 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{}, }, }, + "translate": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, "workspaces": service{ Endpoints: endpoints{ @@ -9668,6 +10716,12 @@ var awsisobPartition = partition{ "us-isob-east-1": endpoint{}, }, }, + "codedeploy": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, "config": service{ Endpoints: endpoints{ @@ -9745,6 +10799,12 @@ var awsisobPartition = partition{ "us-isob-east-1": endpoint{}, }, }, + "es": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, "events": service{ Endpoints: endpoints{ @@ -9830,6 +10890,19 @@ var awsisobPartition = partition{ "us-isob-east-1": endpoint{}, }, }, + "route53": service{ + PartitionEndpoint: "aws-iso-b-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-iso-b-global": endpoint{ + Hostname: "route53.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, + }, + }, "s3": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go index 773613722f49..aaff68260814 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go @@ -178,14 +178,14 @@ type service struct { } func (s *service) endpointForRegion(region string) (endpoint, bool) { - if s.IsRegionalized == boxedFalse { - return s.Endpoints[s.PartitionEndpoint], region == s.PartitionEndpoint - } - if e, ok := s.Endpoints[region]; ok { return e, true } + if s.IsRegionalized == boxedFalse { + return s.Endpoints[s.PartitionEndpoint], region == s.PartitionEndpoint + } + // Unable to find any matching endpoint, return // blank that will be used for generic endpoint creation. return endpoint{}, false diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go index fe6dac1f4764..3efdac29ff42 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials/processcreds" + "github.com/aws/aws-sdk-go/aws/credentials/ssocreds" "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/defaults" "github.com/aws/aws-sdk-go/aws/request" @@ -100,10 +101,6 @@ func resolveCredsFromProfile(cfg *aws.Config, sharedCfg.Creds, ) - case len(sharedCfg.CredentialProcess) != 0: - // Get credentials from CredentialProcess - creds = processcreds.NewCredentials(sharedCfg.CredentialProcess) - case len(sharedCfg.CredentialSource) != 0: creds, err = resolveCredsFromSource(cfg, envCfg, sharedCfg, handlers, sessOpts, @@ -119,6 +116,13 @@ func resolveCredsFromProfile(cfg *aws.Config, sharedCfg.RoleSessionName, ) + case sharedCfg.hasSSOConfiguration(): + creds, err = resolveSSOCredentials(cfg, sharedCfg, handlers) + + case len(sharedCfg.CredentialProcess) != 0: + // Get credentials from CredentialProcess + creds = processcreds.NewCredentials(sharedCfg.CredentialProcess) + default: // Fallback to default credentials provider, include mock errors for // the credential chain so user can identify why credentials failed to @@ -151,6 +155,25 @@ func resolveCredsFromProfile(cfg *aws.Config, return creds, nil } +func resolveSSOCredentials(cfg *aws.Config, sharedCfg sharedConfig, handlers request.Handlers) (*credentials.Credentials, error) { + if err := sharedCfg.validateSSOConfiguration(); err != nil { + return nil, err + } + + cfgCopy := cfg.Copy() + cfgCopy.Region = &sharedCfg.SSORegion + + return ssocreds.NewCredentials( + &Session{ + Config: cfgCopy, + Handlers: handlers.Copy(), + }, + sharedCfg.SSOAccountID, + sharedCfg.SSORoleName, + sharedCfg.SSOStartURL, + ), nil +} + // valid credential source values const ( credSourceEc2Metadata = "Ec2InstanceMetadata" diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport.go new file mode 100644 index 000000000000..593aedc42189 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport.go @@ -0,0 +1,27 @@ +// +build go1.13 + +package session + +import ( + "net" + "net/http" + "time" +) + +// Transport that should be used when a custom CA bundle is specified with the +// SDK. +func getCustomTransport() *http.Transport { + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext, + ForceAttemptHTTP2: true, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + } +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.12.go similarity index 88% rename from cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go rename to cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.12.go index ea9ebb6f6a25..1bf31cf8e560 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.12.go @@ -1,4 +1,4 @@ -// +build go1.7 +// +build !go1.13,go1.7 package session @@ -10,7 +10,7 @@ import ( // Transport that should be used when a custom CA bundle is specified with the // SDK. -func getCABundleTransport() *http.Transport { +func getCustomTransport() *http.Transport { return &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.5.go similarity index 88% rename from cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go rename to cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.5.go index fec39dfc1264..253d7bc9d556 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.5.go @@ -10,7 +10,7 @@ import ( // Transport that should be used when a custom CA bundle is specified with the // SDK. -func getCABundleTransport() *http.Transport { +func getCustomTransport() *http.Transport { return &http.Transport{ Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.6.go similarity index 90% rename from cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go rename to cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.6.go index 1c5a5391e658..db2406054411 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/custom_transport_go1.6.go @@ -10,7 +10,7 @@ import ( // Transport that should be used when a custom CA bundle is specified with the // SDK. -func getCABundleTransport() *http.Transport { +func getCustomTransport() *http.Transport { return &http.Transport{ Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go index cc461bd3230d..9419b518d58a 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go @@ -208,6 +208,8 @@ env values as well. AWS_SDK_LOAD_CONFIG=1 +Custom Shared Config and Credential Files + Shared credentials file path can be set to instruct the SDK to use an alternative file for the shared credentials. If not set the file will be loaded from $HOME/.aws/credentials on Linux/Unix based systems, and @@ -222,6 +224,8 @@ $HOME/.aws/config on Linux/Unix based systems, and AWS_CONFIG_FILE=$HOME/my_shared_config +Custom CA Bundle + Path to a custom Credentials Authority (CA) bundle PEM file that the SDK will use instead of the default system's root CA bundle. Use this only if you want to replace the CA bundle the SDK uses for TLS requests. @@ -242,6 +246,29 @@ Setting a custom HTTPClient in the aws.Config options will override this setting To use this option and custom HTTP client, the HTTP client needs to be provided when creating the session. Not the service client. +Custom Client TLS Certificate + +The SDK supports the environment and session option being configured with +Client TLS certificates that are sent as a part of the client's TLS handshake +for client authentication. If used, both Cert and Key values are required. If +one is missing, or either fail to load the contents of the file an error will +be returned. + +HTTP Client's Transport concrete implementation must be a http.Transport +or creating the session will fail. + + AWS_SDK_GO_CLIENT_TLS_KEY=$HOME/my_client_key + AWS_SDK_GO_CLIENT_TLS_CERT=$HOME/my_client_cert + +This can also be configured via the session.Options ClientTLSCert and ClientTLSKey. + + sess, err := session.NewSessionWithOptions(session.Options{ + ClientTLSCert: myCertFile, + ClientTLSKey: myKeyFile, + }) + +Custom EC2 IMDS Endpoint + The endpoint of the EC2 IMDS client can be configured via the environment variable, AWS_EC2_METADATA_SERVICE_ENDPOINT when creating the client with a Session. See Options.EC2IMDSEndpoint for more details. diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go index d67c261d74f7..3cd5d4b5ae11 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go @@ -101,6 +101,18 @@ type envConfig struct { // AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle CustomCABundle string + // Sets the TLC client certificate that should be used by the SDK's HTTP transport + // when making requests. The certificate must be paired with a TLS client key file. + // + // AWS_SDK_GO_CLIENT_TLS_CERT=$HOME/my_client_cert + ClientTLSCert string + + // Sets the TLC client key that should be used by the SDK's HTTP transport + // when making requests. The key must be paired with a TLS client certificate file. + // + // AWS_SDK_GO_CLIENT_TLS_KEY=$HOME/my_client_key + ClientTLSKey string + csmEnabled string CSMEnabled *bool CSMPort string @@ -219,6 +231,15 @@ var ( ec2IMDSEndpointEnvKey = []string{ "AWS_EC2_METADATA_SERVICE_ENDPOINT", } + useCABundleKey = []string{ + "AWS_CA_BUNDLE", + } + useClientTLSCert = []string{ + "AWS_SDK_GO_CLIENT_TLS_CERT", + } + useClientTLSKey = []string{ + "AWS_SDK_GO_CLIENT_TLS_KEY", + } ) // loadEnvConfig retrieves the SDK's environment configuration. @@ -302,7 +323,9 @@ func envConfigLoad(enableSharedConfig bool) (envConfig, error) { cfg.SharedConfigFile = defaults.SharedConfigFilename() } - cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE") + setFromEnvVal(&cfg.CustomCABundle, useCABundleKey) + setFromEnvVal(&cfg.ClientTLSCert, useClientTLSCert) + setFromEnvVal(&cfg.ClientTLSKey, useClientTLSKey) var err error // STS Regional Endpoint variable diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/session.go index 6430a7f15261..038ae222ffc1 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/session.go @@ -25,11 +25,18 @@ const ( // ErrCodeSharedConfig represents an error that occurs in the shared // configuration logic ErrCodeSharedConfig = "SharedConfigErr" + + // ErrCodeLoadCustomCABundle error code for unable to load custom CA bundle. + ErrCodeLoadCustomCABundle = "LoadCustomCABundleError" + + // ErrCodeLoadClientTLSCert error code for unable to load client TLS + // certificate or key + ErrCodeLoadClientTLSCert = "LoadClientTLSCertError" ) // ErrSharedConfigSourceCollision will be returned if a section contains both // source_profile and credential_source -var ErrSharedConfigSourceCollision = awserr.New(ErrCodeSharedConfig, "only source profile or credential source can be specified, not both", nil) +var ErrSharedConfigSourceCollision = awserr.New(ErrCodeSharedConfig, "only one credential type may be specified per profile: source profile, credential source, credential process, web identity token, or sso", nil) // ErrSharedConfigECSContainerEnvVarEmpty will be returned if the environment // variables are empty and Environment was set as the credential source @@ -229,17 +236,46 @@ type Options struct { // the SDK will use instead of the default system's root CA bundle. Use this // only if you want to replace the CA bundle the SDK uses for TLS requests. // - // Enabling this option will attempt to merge the Transport into the SDK's HTTP - // client. If the client's Transport is not a http.Transport an error will be - // returned. If the Transport's TLS config is set this option will cause the SDK + // HTTP Client's Transport concrete implementation must be a http.Transport + // or creating the session will fail. + // + // If the Transport's TLS config is set this option will cause the SDK // to overwrite the Transport's TLS config's RootCAs value. If the CA // bundle reader contains multiple certificates all of them will be loaded. // - // The Session option CustomCABundle is also available when creating sessions - // to also enable this feature. CustomCABundle session option field has priority - // over the AWS_CA_BUNDLE environment variable, and will be used if both are set. + // Can also be specified via the environment variable: + // + // AWS_CA_BUNDLE=$HOME/ca_bundle + // + // Can also be specified via the shared config field: + // + // ca_bundle = $HOME/ca_bundle CustomCABundle io.Reader + // Reader for the TLC client certificate that should be used by the SDK's + // HTTP transport when making requests. The certificate must be paired with + // a TLS client key file. Will be ignored if both are not provided. + // + // HTTP Client's Transport concrete implementation must be a http.Transport + // or creating the session will fail. + // + // Can also be specified via the environment variable: + // + // AWS_SDK_GO_CLIENT_TLS_CERT=$HOME/my_client_cert + ClientTLSCert io.Reader + + // Reader for the TLC client key that should be used by the SDK's HTTP + // transport when making requests. The key must be paired with a TLS client + // certificate file. Will be ignored if both are not provided. + // + // HTTP Client's Transport concrete implementation must be a http.Transport + // or creating the session will fail. + // + // Can also be specified via the environment variable: + // + // AWS_SDK_GO_CLIENT_TLS_KEY=$HOME/my_client_key + ClientTLSKey io.Reader + // The handlers that the session and all API clients will be created with. // This must be a complete set of handlers. Use the defaults.Handlers() // function to initialize this value before changing the handlers to be @@ -319,17 +355,6 @@ func NewSessionWithOptions(opts Options) (*Session, error) { envCfg.EnableSharedConfig = true } - // Only use AWS_CA_BUNDLE if session option is not provided. - if len(envCfg.CustomCABundle) != 0 && opts.CustomCABundle == nil { - f, err := os.Open(envCfg.CustomCABundle) - if err != nil { - return nil, awserr.New("LoadCustomCABundleError", - "failed to open custom CA bundle PEM file", err) - } - defer f.Close() - opts.CustomCABundle = f - } - return newSession(opts, envCfg, &opts.Config) } @@ -460,6 +485,10 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, return nil, err } + if err := setTLSOptions(&opts, cfg, envCfg, sharedCfg); err != nil { + return nil, err + } + s := &Session{ Config: cfg, Handlers: handlers, @@ -479,13 +508,6 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, } } - // Setup HTTP client with custom cert bundle if enabled - if opts.CustomCABundle != nil { - if err := loadCustomCABundle(s, opts.CustomCABundle); err != nil { - return nil, err - } - } - return s, nil } @@ -529,22 +551,83 @@ func loadCSMConfig(envCfg envConfig, cfgFiles []string) (csmConfig, error) { return csmConfig{}, nil } -func loadCustomCABundle(s *Session, bundle io.Reader) error { +func setTLSOptions(opts *Options, cfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig) error { + // CA Bundle can be specified in both environment variable shared config file. + var caBundleFilename = envCfg.CustomCABundle + if len(caBundleFilename) == 0 { + caBundleFilename = sharedCfg.CustomCABundle + } + + // Only use environment value if session option is not provided. + customTLSOptions := map[string]struct { + filename string + field *io.Reader + errCode string + }{ + "custom CA bundle PEM": {filename: caBundleFilename, field: &opts.CustomCABundle, errCode: ErrCodeLoadCustomCABundle}, + "custom client TLS cert": {filename: envCfg.ClientTLSCert, field: &opts.ClientTLSCert, errCode: ErrCodeLoadClientTLSCert}, + "custom client TLS key": {filename: envCfg.ClientTLSKey, field: &opts.ClientTLSKey, errCode: ErrCodeLoadClientTLSCert}, + } + for name, v := range customTLSOptions { + if len(v.filename) != 0 && *v.field == nil { + f, err := os.Open(v.filename) + if err != nil { + return awserr.New(v.errCode, fmt.Sprintf("failed to open %s file", name), err) + } + defer f.Close() + *v.field = f + } + } + + // Setup HTTP client with custom cert bundle if enabled + if opts.CustomCABundle != nil { + if err := loadCustomCABundle(cfg.HTTPClient, opts.CustomCABundle); err != nil { + return err + } + } + + // Setup HTTP client TLS certificate and key for client TLS authentication. + if opts.ClientTLSCert != nil && opts.ClientTLSKey != nil { + if err := loadClientTLSCert(cfg.HTTPClient, opts.ClientTLSCert, opts.ClientTLSKey); err != nil { + return err + } + } else if opts.ClientTLSCert == nil && opts.ClientTLSKey == nil { + // Do nothing if neither values are available. + + } else { + return awserr.New(ErrCodeLoadClientTLSCert, + fmt.Sprintf("client TLS cert(%t) and key(%t) must both be provided", + opts.ClientTLSCert != nil, opts.ClientTLSKey != nil), nil) + } + + return nil +} + +func getHTTPTransport(client *http.Client) (*http.Transport, error) { var t *http.Transport - switch v := s.Config.HTTPClient.Transport.(type) { + switch v := client.Transport.(type) { case *http.Transport: t = v default: - if s.Config.HTTPClient.Transport != nil { - return awserr.New("LoadCustomCABundleError", - "unable to load custom CA bundle, HTTPClient's transport unsupported type", nil) + if client.Transport != nil { + return nil, fmt.Errorf("unsupported transport, %T", client.Transport) } } if t == nil { // Nil transport implies `http.DefaultTransport` should be used. Since // the SDK cannot modify, nor copy the `DefaultTransport` specifying // the values the next closest behavior. - t = getCABundleTransport() + t = getCustomTransport() + } + + return t, nil +} + +func loadCustomCABundle(client *http.Client, bundle io.Reader) error { + t, err := getHTTPTransport(client) + if err != nil { + return awserr.New(ErrCodeLoadCustomCABundle, + "unable to load custom CA bundle, HTTPClient's transport unsupported type", err) } p, err := loadCertPool(bundle) @@ -556,7 +639,7 @@ func loadCustomCABundle(s *Session, bundle io.Reader) error { } t.TLSClientConfig.RootCAs = p - s.Config.HTTPClient.Transport = t + client.Transport = t return nil } @@ -564,19 +647,57 @@ func loadCustomCABundle(s *Session, bundle io.Reader) error { func loadCertPool(r io.Reader) (*x509.CertPool, error) { b, err := ioutil.ReadAll(r) if err != nil { - return nil, awserr.New("LoadCustomCABundleError", + return nil, awserr.New(ErrCodeLoadCustomCABundle, "failed to read custom CA bundle PEM file", err) } p := x509.NewCertPool() if !p.AppendCertsFromPEM(b) { - return nil, awserr.New("LoadCustomCABundleError", + return nil, awserr.New(ErrCodeLoadCustomCABundle, "failed to load custom CA bundle PEM file", err) } return p, nil } +func loadClientTLSCert(client *http.Client, certFile, keyFile io.Reader) error { + t, err := getHTTPTransport(client) + if err != nil { + return awserr.New(ErrCodeLoadClientTLSCert, + "unable to get usable HTTP transport from client", err) + } + + cert, err := ioutil.ReadAll(certFile) + if err != nil { + return awserr.New(ErrCodeLoadClientTLSCert, + "unable to get read client TLS cert file", err) + } + + key, err := ioutil.ReadAll(keyFile) + if err != nil { + return awserr.New(ErrCodeLoadClientTLSCert, + "unable to get read client TLS key file", err) + } + + clientCert, err := tls.X509KeyPair(cert, key) + if err != nil { + return awserr.New(ErrCodeLoadClientTLSCert, + "unable to load x509 key pair from client cert", err) + } + + tlsCfg := t.TLSClientConfig + if tlsCfg == nil { + tlsCfg = &tls.Config{} + } + + tlsCfg.Certificates = append(tlsCfg.Certificates, clientCert) + + t.TLSClientConfig = tlsCfg + client.Transport = t + + return nil +} + func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go index 680805a38add..42b16a7db9ea 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go @@ -2,6 +2,7 @@ package session import ( "fmt" + "strings" "time" "github.com/aws/aws-sdk-go/aws/awserr" @@ -25,6 +26,12 @@ const ( roleSessionNameKey = `role_session_name` // optional roleDurationSecondsKey = "duration_seconds" // optional + // AWS Single Sign-On (AWS SSO) group + ssoAccountIDKey = "sso_account_id" + ssoRegionKey = "sso_region" + ssoRoleNameKey = "sso_role_name" + ssoStartURL = "sso_start_url" + // CSM options csmEnabledKey = `csm_enabled` csmHostKey = `csm_host` @@ -34,6 +41,9 @@ const ( // Additional Config fields regionKey = `region` + // custom CA Bundle filename + customCABundleKey = `ca_bundle` + // endpoint discovery group enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional @@ -60,6 +70,8 @@ const ( // sharedConfig represents the configuration fields of the SDK config files. type sharedConfig struct { + Profile string + // Credentials values from the config file. Both aws_access_key_id and // aws_secret_access_key must be provided together in the same file to be // considered valid. The values will be ignored if not a complete group. @@ -75,6 +87,11 @@ type sharedConfig struct { CredentialProcess string WebIdentityTokenFile string + SSOAccountID string + SSORegion string + SSORoleName string + SSOStartURL string + RoleARN string RoleSessionName string ExternalID string @@ -90,6 +107,15 @@ type sharedConfig struct { // region Region string + // CustomCABundle is the file path to a PEM file the SDK will read and + // use to configure the HTTP transport with additional CA certs that are + // not present in the platforms default CA store. + // + // This value will be ignored if the file does not exist. + // + // ca_bundle + CustomCABundle string + // EnableEndpointDiscovery can be enabled in the shared config by setting // endpoint_discovery_enabled to true // @@ -177,6 +203,8 @@ func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) { } func (cfg *sharedConfig) setFromIniFiles(profiles map[string]struct{}, profile string, files []sharedConfigFile, exOpts bool) error { + cfg.Profile = profile + // Trim files from the list that don't exist. var skippedFiles int var profileNotFoundErr error @@ -205,9 +233,9 @@ func (cfg *sharedConfig) setFromIniFiles(profiles map[string]struct{}, profile s cfg.clearAssumeRoleOptions() } else { // First time a profile has been seen, It must either be a assume role - // or credentials. Assert if the credential type requires a role ARN, - // the ARN is also set. - if err := cfg.validateCredentialsRequireARN(profile); err != nil { + // credentials, or SSO. Assert if the credential type requires a role ARN, + // the ARN is also set, or validate that the SSO configuration is complete. + if err := cfg.validateCredentialsConfig(profile); err != nil { return err } } @@ -276,6 +304,7 @@ func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, e updateString(&cfg.SourceProfileName, section, sourceProfileKey) updateString(&cfg.CredentialSource, section, credentialSourceKey) updateString(&cfg.Region, section, regionKey) + updateString(&cfg.CustomCABundle, section, customCABundleKey) if section.Has(roleDurationSecondsKey) { d := time.Duration(section.Int(roleDurationSecondsKey)) * time.Second @@ -299,6 +328,12 @@ func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, e } cfg.S3UsEast1RegionalEndpoint = sre } + + // AWS Single Sign-On (AWS SSO) + updateString(&cfg.SSOAccountID, section, ssoAccountIDKey) + updateString(&cfg.SSORegion, section, ssoRegionKey) + updateString(&cfg.SSORoleName, section, ssoRoleNameKey) + updateString(&cfg.SSOStartURL, section, ssoStartURL) } updateString(&cfg.CredentialProcess, section, credentialProcessKey) @@ -329,6 +364,14 @@ func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, e return nil } +func (cfg *sharedConfig) validateCredentialsConfig(profile string) error { + if err := cfg.validateCredentialsRequireARN(profile); err != nil { + return err + } + + return nil +} + func (cfg *sharedConfig) validateCredentialsRequireARN(profile string) error { var credSource string @@ -365,12 +408,43 @@ func (cfg *sharedConfig) validateCredentialType() error { return nil } +func (cfg *sharedConfig) validateSSOConfiguration() error { + if !cfg.hasSSOConfiguration() { + return nil + } + + var missing []string + if len(cfg.SSOAccountID) == 0 { + missing = append(missing, ssoAccountIDKey) + } + + if len(cfg.SSORegion) == 0 { + missing = append(missing, ssoRegionKey) + } + + if len(cfg.SSORoleName) == 0 { + missing = append(missing, ssoRoleNameKey) + } + + if len(cfg.SSOStartURL) == 0 { + missing = append(missing, ssoStartURL) + } + + if len(missing) > 0 { + return fmt.Errorf("profile %q is configured to use SSO but is missing required configuration: %s", + cfg.Profile, strings.Join(missing, ", ")) + } + + return nil +} + func (cfg *sharedConfig) hasCredentials() bool { switch { case len(cfg.SourceProfileName) != 0: case len(cfg.CredentialSource) != 0: case len(cfg.CredentialProcess) != 0: case len(cfg.WebIdentityTokenFile) != 0: + case cfg.hasSSOConfiguration(): case cfg.Creds.HasKeys(): default: return false @@ -384,6 +458,10 @@ func (cfg *sharedConfig) clearCredentialOptions() { cfg.CredentialProcess = "" cfg.WebIdentityTokenFile = "" cfg.Creds = credentials.Value{} + cfg.SSOAccountID = "" + cfg.SSORegion = "" + cfg.SSORoleName = "" + cfg.SSOStartURL = "" } func (cfg *sharedConfig) clearAssumeRoleOptions() { @@ -394,6 +472,18 @@ func (cfg *sharedConfig) clearAssumeRoleOptions() { cfg.SourceProfileName = "" } +func (cfg *sharedConfig) hasSSOConfiguration() bool { + switch { + case len(cfg.SSOAccountID) != 0: + case len(cfg.SSORegion) != 0: + case len(cfg.SSORoleName) != 0: + case len(cfg.SSOStartURL) != 0: + default: + return false + } + return true +} + func oneOrNone(bs ...bool) bool { var count int diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go index d71f7b3f4fa0..1737c2686de4 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go @@ -689,9 +689,12 @@ func (ctx *signingCtx) buildBodyDigest() error { if hash == "" { includeSHA256Header := ctx.unsignedPayload || ctx.ServiceName == "s3" || + ctx.ServiceName == "s3-object-lambda" || ctx.ServiceName == "glacier" - s3Presign := ctx.isPresign && ctx.ServiceName == "s3" + s3Presign := ctx.isPresign && + (ctx.ServiceName == "s3" || + ctx.ServiceName == "s3-object-lambda") if ctx.unsignedPayload || s3Presign { hash = "UNSIGNED-PAYLOAD" diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/version.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/version.go index cc41ca0bcda8..e0d4f2a86654 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.35.24" +const SDKVersion = "1.38.49" diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go index d7d42db0a6a5..1f1d27aea49f 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go @@ -1,9 +1,10 @@ package protocol import ( - "strings" - "github.com/aws/aws-sdk-go/aws/request" + "net" + "strconv" + "strings" ) // ValidateEndpointHostHandler is a request handler that will validate the @@ -22,8 +23,26 @@ var ValidateEndpointHostHandler = request.NamedHandler{ // 3986 host. Returns error if the host is not valid. func ValidateEndpointHost(opName, host string) error { paramErrs := request.ErrInvalidParams{Context: opName} - labels := strings.Split(host, ".") + var hostname string + var port string + var err error + + if strings.Contains(host, ":") { + hostname, port, err = net.SplitHostPort(host) + + if err != nil { + paramErrs.Add(request.NewErrParamFormat("endpoint", err.Error(), host)) + } + + if !ValidPortNumber(port) { + paramErrs.Add(request.NewErrParamFormat("endpoint port number", "[0-65535]", port)) + } + } else { + hostname = host + } + + labels := strings.Split(hostname, ".") for i, label := range labels { if i == len(labels)-1 && len(label) == 0 { // Allow trailing dot for FQDN hosts. @@ -36,7 +55,11 @@ func ValidateEndpointHost(opName, host string) error { } } - if len(host) > 255 { + if len(hostname) == 0 { + paramErrs.Add(request.NewErrParamMinLen("endpoint host", 1)) + } + + if len(hostname) > 255 { paramErrs.Add(request.NewErrParamMaxLen( "endpoint host", 255, host, )) @@ -66,3 +89,16 @@ func ValidHostLabel(label string) bool { return true } + +// ValidPortNumber return if the port is valid RFC 3986 port +func ValidPortNumber(port string) bool { + i, err := strconv.Atoi(port) + if err != nil { + return false + } + + if i < 0 || i > 65535 { + return false + } + return true +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go new file mode 100644 index 000000000000..2e0e205af37c --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go @@ -0,0 +1,59 @@ +// Package restjson provides RESTful JSON serialization of AWS +// requests and responses. +package restjson + +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/rest-json.json build_test.go +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/rest-json.json unmarshal_test.go + +import ( + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" + "github.com/aws/aws-sdk-go/private/protocol/rest" +) + +// BuildHandler is a named request handler for building restjson protocol +// requests +var BuildHandler = request.NamedHandler{ + Name: "awssdk.restjson.Build", + Fn: Build, +} + +// UnmarshalHandler is a named request handler for unmarshaling restjson +// protocol requests +var UnmarshalHandler = request.NamedHandler{ + Name: "awssdk.restjson.Unmarshal", + Fn: Unmarshal, +} + +// UnmarshalMetaHandler is a named request handler for unmarshaling restjson +// protocol request metadata +var UnmarshalMetaHandler = request.NamedHandler{ + Name: "awssdk.restjson.UnmarshalMeta", + Fn: UnmarshalMeta, +} + +// Build builds a request for the REST JSON protocol. +func Build(r *request.Request) { + rest.Build(r) + + if t := rest.PayloadType(r.Params); t == "structure" || t == "" { + if v := r.HTTPRequest.Header.Get("Content-Type"); len(v) == 0 { + r.HTTPRequest.Header.Set("Content-Type", "application/json") + } + jsonrpc.Build(r) + } +} + +// Unmarshal unmarshals a response body for the REST JSON protocol. +func Unmarshal(r *request.Request) { + if t := rest.PayloadType(r.Data); t == "structure" || t == "" { + jsonrpc.Unmarshal(r) + } else { + rest.Unmarshal(r) + } +} + +// UnmarshalMeta unmarshals response headers for the REST JSON protocol. +func UnmarshalMeta(r *request.Request) { + rest.UnmarshalMeta(r) +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go new file mode 100644 index 000000000000..d756d8cc5296 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go @@ -0,0 +1,134 @@ +package restjson + +import ( + "bytes" + "io" + "io/ioutil" + "net/http" + "strings" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" + "github.com/aws/aws-sdk-go/private/protocol/rest" +) + +const ( + errorTypeHeader = "X-Amzn-Errortype" + errorMessageHeader = "X-Amzn-Errormessage" +) + +// UnmarshalTypedError provides unmarshaling errors API response errors +// for both typed and untyped errors. +type UnmarshalTypedError struct { + exceptions map[string]func(protocol.ResponseMetadata) error +} + +// NewUnmarshalTypedError returns an UnmarshalTypedError initialized for the +// set of exception names to the error unmarshalers +func NewUnmarshalTypedError(exceptions map[string]func(protocol.ResponseMetadata) error) *UnmarshalTypedError { + return &UnmarshalTypedError{ + exceptions: exceptions, + } +} + +// UnmarshalError attempts to unmarshal the HTTP response error as a known +// error type. If unable to unmarshal the error type, the generic SDK error +// type will be used. +func (u *UnmarshalTypedError) UnmarshalError( + resp *http.Response, + respMeta protocol.ResponseMetadata, +) (error, error) { + + code := resp.Header.Get(errorTypeHeader) + msg := resp.Header.Get(errorMessageHeader) + + body := resp.Body + if len(code) == 0 { + // If unable to get code from HTTP headers have to parse JSON message + // to determine what kind of exception this will be. + var buf bytes.Buffer + var jsonErr jsonErrorResponse + teeReader := io.TeeReader(resp.Body, &buf) + err := jsonutil.UnmarshalJSONError(&jsonErr, teeReader) + if err != nil { + return nil, err + } + + body = ioutil.NopCloser(&buf) + code = jsonErr.Code + msg = jsonErr.Message + } + + // If code has colon separators remove them so can compare against modeled + // exception names. + code = strings.SplitN(code, ":", 2)[0] + + if fn, ok := u.exceptions[code]; ok { + // If exception code is know, use associated constructor to get a value + // for the exception that the JSON body can be unmarshaled into. + v := fn(respMeta) + if err := jsonutil.UnmarshalJSONCaseInsensitive(v, body); err != nil { + return nil, err + } + + if err := rest.UnmarshalResponse(resp, v, true); err != nil { + return nil, err + } + + return v, nil + } + + // fallback to unmodeled generic exceptions + return awserr.NewRequestFailure( + awserr.New(code, msg, nil), + respMeta.StatusCode, + respMeta.RequestID, + ), nil +} + +// UnmarshalErrorHandler is a named request handler for unmarshaling restjson +// protocol request errors +var UnmarshalErrorHandler = request.NamedHandler{ + Name: "awssdk.restjson.UnmarshalError", + Fn: UnmarshalError, +} + +// UnmarshalError unmarshals a response error for the REST JSON protocol. +func UnmarshalError(r *request.Request) { + defer r.HTTPResponse.Body.Close() + + var jsonErr jsonErrorResponse + err := jsonutil.UnmarshalJSONError(&jsonErr, r.HTTPResponse.Body) + if err != nil { + r.Error = awserr.NewRequestFailure( + awserr.New(request.ErrCodeSerialization, + "failed to unmarshal response error", err), + r.HTTPResponse.StatusCode, + r.RequestID, + ) + return + } + + code := r.HTTPResponse.Header.Get(errorTypeHeader) + if code == "" { + code = jsonErr.Code + } + msg := r.HTTPResponse.Header.Get(errorMessageHeader) + if msg == "" { + msg = jsonErr.Message + } + + code = strings.SplitN(code, ":", 2)[0] + r.Error = awserr.NewRequestFailure( + awserr.New(code, jsonErr.Message, nil), + r.HTTPResponse.StatusCode, + r.RequestID, + ) +} + +type jsonErrorResponse struct { + Code string `json:"code"` + Message string `json:"message"` +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go index 09ad951595e4..2fbb93ae76ad 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go @@ -308,6 +308,8 @@ func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag refl if tag.Get("xmlAttribute") != "" { // put into current node's attribute list attr := xml.Attr{Name: xname, Value: str} current.Attr = append(current.Attr, attr) + } else if len(xname.Local) == 0 { + current.Text = str } else { // regular text node current.AddChild(&XMLNode{Name: xname, Text: str}) } diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go index 42f71648eee3..c85b79fddd28 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go @@ -18,6 +18,14 @@ type XMLNode struct { parent *XMLNode } +// textEncoder is a string type alias that implemnts the TextMarshaler interface. +// This alias type is used to ensure that the line feed (\n) (U+000A) is escaped. +type textEncoder string + +func (t textEncoder) MarshalText() ([]byte, error) { + return []byte(t), nil +} + // NewXMLElement returns a pointer to a new XMLNode initialized to default values. func NewXMLElement(name xml.Name) *XMLNode { return &XMLNode{ @@ -130,11 +138,16 @@ func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error { attrs = sortedAttrs } - e.EncodeToken(xml.StartElement{Name: node.Name, Attr: attrs}) + startElement := xml.StartElement{Name: node.Name, Attr: attrs} if node.Text != "" { - e.EncodeToken(xml.CharData([]byte(node.Text))) - } else if sorted { + e.EncodeElement(textEncoder(node.Text), startElement) + return e.Flush() + } + + e.EncodeToken(startElement) + + if sorted { sortedNames := []string{} for k := range node.Children { sortedNames = append(sortedNames, k) @@ -154,6 +167,7 @@ func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error { } } - e.EncodeToken(xml.EndElement{Name: node.Name}) + e.EncodeToken(startElement.End()) + return e.Flush() } diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go index ae8e316f25c8..f8e274cc8f65 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go @@ -70,7 +70,7 @@ func (c *AutoScaling) AttachInstancesRequest(input *AttachInstancesInput) (req * // groups attached to your Auto Scaling group, the instances are also registered // with the target groups. // -// For more information, see Attach EC2 Instances to Your Auto Scaling Group +// For more information, see Attach EC2 instances to your Auto Scaling group // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-instance-asg.html) // in the Amazon EC2 Auto Scaling User Guide. // @@ -158,14 +158,22 @@ func (c *AutoScaling) AttachLoadBalancerTargetGroupsRequest(input *AttachLoadBal // // Attaches one or more target groups to the specified Auto Scaling group. // +// This operation is used with the following load balancer types: +// +// * Application Load Balancer - Operates at the application layer (layer +// 7) and supports HTTP and HTTPS. +// +// * Network Load Balancer - Operates at the transport layer (layer 4) and +// supports TCP, TLS, and UDP. +// +// * Gateway Load Balancer - Operates at the network layer (layer 3). +// // To describe the target groups for an Auto Scaling group, call the DescribeLoadBalancerTargetGroups // API. To detach the target group from the Auto Scaling group, call the DetachLoadBalancerTargetGroups // API. // -// With Application Load Balancers and Network Load Balancers, instances are -// registered as targets with a target group. With Classic Load Balancers, instances -// are registered with the load balancer. For more information, see Attaching -// a Load Balancer to Your Auto Scaling Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-load-balancer-asg.html) +// For more information, see Elastic Load Balancing and Amazon EC2 Auto Scaling +// (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -251,8 +259,8 @@ func (c *AutoScaling) AttachLoadBalancersRequest(input *AttachLoadBalancersInput // AttachLoadBalancers API operation for Auto Scaling. // // -// To attach an Application Load Balancer or a Network Load Balancer, use the -// AttachLoadBalancerTargetGroups API operation instead. +// To attach an Application Load Balancer, Network Load Balancer, or Gateway +// Load Balancer, use the AttachLoadBalancerTargetGroups API operation instead. // // Attaches one or more Classic Load Balancers to the specified Auto Scaling // group. Amazon EC2 Auto Scaling registers the running instances with these @@ -262,8 +270,8 @@ func (c *AutoScaling) AttachLoadBalancersRequest(input *AttachLoadBalancersInput // API. To detach the load balancer from the Auto Scaling group, call the DetachLoadBalancers // API. // -// For more information, see Attaching a Load Balancer to Your Auto Scaling -// Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-load-balancer-asg.html) +// For more information, see Elastic Load Balancing and Amazon EC2 Auto Scaling +// (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -428,8 +436,7 @@ func (c *AutoScaling) BatchPutScheduledUpdateGroupActionRequest(input *BatchPutS // BatchPutScheduledUpdateGroupAction API operation for Auto Scaling. // // Creates or updates one or more scheduled scaling actions for an Auto Scaling -// group. If you leave a parameter unspecified when updating a scheduled scaling -// action, the corresponding value remains unchanged. +// group. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -523,8 +530,9 @@ func (c *AutoScaling) CancelInstanceRefreshRequest(input *CancelInstanceRefreshI // roll back any replacements that have already been completed, but it prevents // new replacements from being started. // -// For more information, see Replacing Auto Scaling Instances Based on an Instance -// Refresh (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html). +// For more information, see Replacing Auto Scaling instances based on an instance +// refresh (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html) +// in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -637,7 +645,7 @@ func (c *AutoScaling) CompleteLifecycleActionRequest(input *CompleteLifecycleAct // // If you finish before the timeout period ends, complete the lifecycle action. // -// For more information, see Amazon EC2 Auto Scaling Lifecycle Hooks (https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) +// For more information, see Amazon EC2 Auto Scaling lifecycle hooks (https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -719,18 +727,21 @@ func (c *AutoScaling) CreateAutoScalingGroupRequest(input *CreateAutoScalingGrou // CreateAutoScalingGroup API operation for Auto Scaling. // +// We strongly recommend using a launch template when calling this operation +// to ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2. +// // Creates an Auto Scaling group with the specified name and attributes. // // If you exceed your maximum limit of Auto Scaling groups, the call fails. // To query this limit, call the DescribeAccountLimits API. For information -// about updating this limit, see Amazon EC2 Auto Scaling Service Quotas (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) +// about updating this limit, see Amazon EC2 Auto Scaling service quotas (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) // in the Amazon EC2 Auto Scaling User Guide. // // For introductory exercises for creating an Auto Scaling group, see Getting -// Started with Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/GettingStartedTutorial.html) -// and Tutorial: Set Up a Scaled and Load-Balanced Application (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-register-lbs-with-asg.html) +// started with Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/GettingStartedTutorial.html) +// and Tutorial: Set up a scaled and load-balanced application (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-register-lbs-with-asg.html) // in the Amazon EC2 Auto Scaling User Guide. For more information, see Auto -// Scaling Groups (https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html) +// Scaling groups (https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html) // in the Amazon EC2 Auto Scaling User Guide. // // Every Auto Scaling group has three size parameters (DesiredCapacity, MaxSize, @@ -835,10 +846,10 @@ func (c *AutoScaling) CreateLaunchConfigurationRequest(input *CreateLaunchConfig // // If you exceed your maximum limit of launch configurations, the call fails. // To query this limit, call the DescribeAccountLimits API. For information -// about updating this limit, see Amazon EC2 Auto Scaling Service Quotas (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) +// about updating this limit, see Amazon EC2 Auto Scaling service quotas (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) // in the Amazon EC2 Auto Scaling User Guide. // -// For more information, see Launch Configurations (https://docs.aws.amazon.com/autoscaling/ec2/userguide/LaunchConfiguration.html) +// For more information, see Launch configurations (https://docs.aws.amazon.com/autoscaling/ec2/userguide/LaunchConfiguration.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -935,7 +946,7 @@ func (c *AutoScaling) CreateOrUpdateTagsRequest(input *CreateOrUpdateTagsInput) // When you specify a tag with a key that already exists, the operation overwrites // the previous tag definition, and you do not get an error message. // -// For more information, see Tagging Auto Scaling Groups and Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) +// For more information, see Tagging Auto Scaling groups and instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1392,7 +1403,7 @@ func (c *AutoScaling) DeletePolicyRequest(input *DeletePolicyInput) (req *reques // the underlying alarm action, but does not delete the alarm, even if it no // longer has an associated action. // -// For more information, see Deleting a Scaling Policy (https://docs.aws.amazon.com/autoscaling/ec2/userguide/deleting-scaling-policy.html) +// For more information, see Deleting a scaling policy (https://docs.aws.amazon.com/autoscaling/ec2/userguide/deleting-scaling-policy.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1597,6 +1608,100 @@ func (c *AutoScaling) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsIn return out, req.Send() } +const opDeleteWarmPool = "DeleteWarmPool" + +// DeleteWarmPoolRequest generates a "aws/request.Request" representing the +// client's request for the DeleteWarmPool operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteWarmPool for more information on using the DeleteWarmPool +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteWarmPoolRequest method. +// req, resp := client.DeleteWarmPoolRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteWarmPool +func (c *AutoScaling) DeleteWarmPoolRequest(input *DeleteWarmPoolInput) (req *request.Request, output *DeleteWarmPoolOutput) { + op := &request.Operation{ + Name: opDeleteWarmPool, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteWarmPoolInput{} + } + + output = &DeleteWarmPoolOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteWarmPool API operation for Auto Scaling. +// +// Deletes the warm pool for the specified Auto Scaling group. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DeleteWarmPool for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Amazon EC2 Auto Scaling resources +// (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). +// For more information, see DescribeAccountLimits (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html) +// in the Amazon EC2 Auto Scaling API Reference. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Amazon EC2 Auto Scaling resource +// (for example, an Auto Scaling group, instance, or load balancer). +// +// * ErrCodeScalingActivityInProgressFault "ScalingActivityInProgress" +// The operation can't be performed because there are scaling activities in +// progress. +// +// * ErrCodeResourceInUseFault "ResourceInUse" +// The operation can't be performed because the resource is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DeleteWarmPool +func (c *AutoScaling) DeleteWarmPool(input *DeleteWarmPoolInput) (*DeleteWarmPoolOutput, error) { + req, out := c.DeleteWarmPoolRequest(input) + return out, req.Send() +} + +// DeleteWarmPoolWithContext is the same as DeleteWarmPool with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteWarmPool for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DeleteWarmPoolWithContext(ctx aws.Context, input *DeleteWarmPoolInput, opts ...request.Option) (*DeleteWarmPoolOutput, error) { + req, out := c.DeleteWarmPoolRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeAccountLimits = "DescribeAccountLimits" // DescribeAccountLimitsRequest generates a "aws/request.Request" representing the @@ -1645,7 +1750,7 @@ func (c *AutoScaling) DescribeAccountLimitsRequest(input *DescribeAccountLimitsI // account. // // For information about requesting an increase, see Amazon EC2 Auto Scaling -// Service Quotas (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) +// service quotas (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1824,6 +1929,10 @@ func (c *AutoScaling) DescribeAutoScalingGroupsRequest(input *DescribeAutoScalin // // Describes one or more Auto Scaling groups. // +// This operation returns information about instances in Auto Scaling groups. +// To retrieve information about the instances in a warm pool, you must call +// the DescribeWarmPool API. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2198,8 +2307,9 @@ func (c *AutoScaling) DescribeInstanceRefreshesRequest(input *DescribeInstanceRe // // * Cancelled - The operation is cancelled. // -// For more information, see Replacing Auto Scaling Instances Based on an Instance -// Refresh (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html). +// For more information, see Replacing Auto Scaling instances based on an instance +// refresh (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html) +// in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2672,8 +2782,8 @@ func (c *AutoScaling) DescribeLoadBalancersRequest(input *DescribeLoadBalancersI // Describes the load balancers for the specified Auto Scaling group. // // This operation describes only Classic Load Balancers. If you have Application -// Load Balancers or Network Load Balancers, use the DescribeLoadBalancerTargetGroups -// API instead. +// Load Balancers, Network Load Balancers, or Gateway Load Balancers, use the +// DescribeLoadBalancerTargetGroups API instead. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3130,6 +3240,12 @@ func (c *AutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingAct // // Describes one or more scaling activities for the specified Auto Scaling group. // +// To view the scaling activities from the Amazon EC2 Auto Scaling console, +// choose the Activity tab of the Auto Scaling group. When scaling events occur, +// you see scaling activity messages in the Activity history. For more information, +// see Verifying a scaling activity for an Auto Scaling group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-verify-scaling-activity.html) +// in the Amazon EC2 Auto Scaling User Guide. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3504,7 +3620,7 @@ func (c *AutoScaling) DescribeTagsRequest(input *DescribeTagsInput) (req *reques // a particular tag only if it matches all the filters. If there's no match, // no special message is returned. // -// For more information, see Tagging Auto Scaling Groups and Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) +// For more information, see Tagging Auto Scaling groups and instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -3642,8 +3758,8 @@ func (c *AutoScaling) DescribeTerminationPolicyTypesRequest(input *DescribeTermi // // Describes the termination policies supported by Amazon EC2 Auto Scaling. // -// For more information, see Controlling Which Auto Scaling Instances Terminate -// During Scale In (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html) +// For more information, see Controlling which Auto Scaling instances terminate +// during scale in (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -3680,6 +3796,95 @@ func (c *AutoScaling) DescribeTerminationPolicyTypesWithContext(ctx aws.Context, return out, req.Send() } +const opDescribeWarmPool = "DescribeWarmPool" + +// DescribeWarmPoolRequest generates a "aws/request.Request" representing the +// client's request for the DescribeWarmPool operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeWarmPool for more information on using the DescribeWarmPool +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeWarmPoolRequest method. +// req, resp := client.DescribeWarmPoolRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeWarmPool +func (c *AutoScaling) DescribeWarmPoolRequest(input *DescribeWarmPoolInput) (req *request.Request, output *DescribeWarmPoolOutput) { + op := &request.Operation{ + Name: opDescribeWarmPool, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeWarmPoolInput{} + } + + output = &DescribeWarmPoolOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeWarmPool API operation for Auto Scaling. +// +// Describes a warm pool and its instances. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation DescribeWarmPool for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The NextToken value is not valid. +// +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Amazon EC2 Auto Scaling resources +// (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). +// For more information, see DescribeAccountLimits (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html) +// in the Amazon EC2 Auto Scaling API Reference. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Amazon EC2 Auto Scaling resource +// (for example, an Auto Scaling group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeWarmPool +func (c *AutoScaling) DescribeWarmPool(input *DescribeWarmPoolInput) (*DescribeWarmPoolOutput, error) { + req, out := c.DescribeWarmPoolRequest(input) + return out, req.Send() +} + +// DescribeWarmPoolWithContext is the same as DescribeWarmPool with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeWarmPool for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) DescribeWarmPoolWithContext(ctx aws.Context, input *DescribeWarmPoolInput, opts ...request.Option) (*DescribeWarmPoolOutput, error) { + req, out := c.DescribeWarmPoolRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDetachInstances = "DetachInstances" // DetachInstancesRequest generates a "aws/request.Request" representing the @@ -3737,7 +3942,7 @@ func (c *AutoScaling) DetachInstancesRequest(input *DetachInstancesInput) (req * // attached to the Auto Scaling group, the instances are deregistered from the // target groups. // -// For more information, see Detach EC2 Instances from Your Auto Scaling Group +// For more information, see Detach EC2 instances from your Auto Scaling group // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/detach-instance-asg.html) // in the Amazon EC2 Auto Scaling User Guide. // @@ -3905,8 +4110,8 @@ func (c *AutoScaling) DetachLoadBalancersRequest(input *DetachLoadBalancersInput // group. // // This operation detaches only Classic Load Balancers. If you have Application -// Load Balancers or Network Load Balancers, use the DetachLoadBalancerTargetGroups -// API instead. +// Load Balancers, Network Load Balancers, or Gateway Load Balancers, use the +// DetachLoadBalancerTargetGroups API instead. // // When you detach a load balancer, it enters the Removing state while deregistering // the instances in the group. When all instances are deregistered, then you @@ -4074,7 +4279,8 @@ func (c *AutoScaling) EnableMetricsCollectionRequest(input *EnableMetricsCollect // EnableMetricsCollection API operation for Auto Scaling. // // Enables group metrics for the specified Auto Scaling group. For more information, -// see Monitoring Your Auto Scaling Groups and Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html) +// see Monitoring CloudWatch metrics for your Auto Scaling groups and instances +// (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -4166,8 +4372,8 @@ func (c *AutoScaling) EnterStandbyRequest(input *EnterStandbyInput) (req *reques // the Auto Scaling group launches new instances to replace the instances on // standby. // -// For more information, see Temporarily Removing Instances from Your Auto Scaling -// Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) +// For more information, see Temporarily removing instances from your Auto Scaling +// group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -4338,8 +4544,8 @@ func (c *AutoScaling) ExitStandbyRequest(input *ExitStandbyInput) (req *request. // // After you put the instances back in service, the desired capacity is incremented. // -// For more information, see Temporarily Removing Instances from Your Auto Scaling -// Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) +// For more information, see Temporarily removing instances from your Auto Scaling +// group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -4376,6 +4582,99 @@ func (c *AutoScaling) ExitStandbyWithContext(ctx aws.Context, input *ExitStandby return out, req.Send() } +const opGetPredictiveScalingForecast = "GetPredictiveScalingForecast" + +// GetPredictiveScalingForecastRequest generates a "aws/request.Request" representing the +// client's request for the GetPredictiveScalingForecast operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetPredictiveScalingForecast for more information on using the GetPredictiveScalingForecast +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetPredictiveScalingForecastRequest method. +// req, resp := client.GetPredictiveScalingForecastRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/GetPredictiveScalingForecast +func (c *AutoScaling) GetPredictiveScalingForecastRequest(input *GetPredictiveScalingForecastInput) (req *request.Request, output *GetPredictiveScalingForecastOutput) { + op := &request.Operation{ + Name: opGetPredictiveScalingForecast, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetPredictiveScalingForecastInput{} + } + + output = &GetPredictiveScalingForecastOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetPredictiveScalingForecast API operation for Auto Scaling. +// +// Retrieves the forecast data for a predictive scaling policy. +// +// Load forecasts are predictions of the hourly load values using historical +// load data from CloudWatch and an analysis of historical trends. Capacity +// forecasts are represented as predicted values for the minimum capacity that +// is needed on an hourly basis, based on the hourly load forecast. +// +// A minimum of 24 hours of data is required to create the initial forecasts. +// However, having a full 14 days of historical data results in more accurate +// forecasts. +// +// For more information, see Predictive scaling for Amazon EC2 Auto Scaling +// (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html) +// in the Amazon EC2 Auto Scaling User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation GetPredictiveScalingForecast for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Amazon EC2 Auto Scaling resource +// (for example, an Auto Scaling group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/GetPredictiveScalingForecast +func (c *AutoScaling) GetPredictiveScalingForecast(input *GetPredictiveScalingForecastInput) (*GetPredictiveScalingForecastOutput, error) { + req, out := c.GetPredictiveScalingForecastRequest(input) + return out, req.Send() +} + +// GetPredictiveScalingForecastWithContext is the same as GetPredictiveScalingForecast with the addition of +// the ability to pass a context and additional request options. +// +// See GetPredictiveScalingForecast for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) GetPredictiveScalingForecastWithContext(ctx aws.Context, input *GetPredictiveScalingForecastInput, opts ...request.Option) (*GetPredictiveScalingForecastOutput, error) { + req, out := c.GetPredictiveScalingForecastRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opPutLifecycleHook = "PutLifecycleHook" // PutLifecycleHookRequest generates a "aws/request.Request" representing the @@ -4448,7 +4747,7 @@ func (c *AutoScaling) PutLifecycleHookRequest(input *PutLifecycleHookInput) (req // If you finish before the timeout period ends, complete the lifecycle action // using the CompleteLifecycleAction API call. // -// For more information, see Amazon EC2 Auto Scaling Lifecycle Hooks (https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) +// For more information, see Amazon EC2 Auto Scaling lifecycle hooks (https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) // in the Amazon EC2 Auto Scaling User Guide. // // If you exceed your maximum limit of lifecycle hooks, which by default is @@ -4549,8 +4848,8 @@ func (c *AutoScaling) PutNotificationConfigurationRequest(input *PutNotification // // This configuration overwrites any existing configuration. // -// For more information, see Getting Amazon SNS Notifications When Your Auto -// Scaling Group Scales (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html) +// For more information, see Getting Amazon SNS notifications when your Auto +// Scaling group scales (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html) // in the Amazon EC2 Auto Scaling User Guide. // // If you exceed your maximum limit of SNS topics, which is 10 per Auto Scaling @@ -4643,13 +4942,24 @@ func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req // PutScalingPolicy API operation for Auto Scaling. // -// Creates or updates a scaling policy for an Auto Scaling group. +// Creates or updates a scaling policy for an Auto Scaling group. Scaling policies +// are used to scale an Auto Scaling group based on configurable metrics. If +// no policies are defined, the dynamic scaling and predictive scaling features +// are not used. +// +// For more information about using dynamic scaling, see Target tracking scaling +// policies (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html) +// and Step and simple scaling policies (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html) +// in the Amazon EC2 Auto Scaling User Guide. // -// For more information about using scaling policies to scale your Auto Scaling -// group, see Target Tracking Scaling Policies (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html) -// and Step and Simple Scaling Policies (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html) +// For more information about using predictive scaling, see Predictive scaling +// for Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html) // in the Amazon EC2 Auto Scaling User Guide. // +// You can view the scaling policies for an Auto Scaling group using the DescribePolicies +// API call. If you are no longer using a scaling policy, you can delete it +// by calling the DeletePolicy API. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -4739,12 +5049,14 @@ func (c *AutoScaling) PutScheduledUpdateGroupActionRequest(input *PutScheduledUp // PutScheduledUpdateGroupAction API operation for Auto Scaling. // // Creates or updates a scheduled scaling action for an Auto Scaling group. -// If you leave a parameter unspecified when updating a scheduled scaling action, -// the corresponding value remains unchanged. // -// For more information, see Scheduled Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html) +// For more information, see Scheduled scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html) // in the Amazon EC2 Auto Scaling User Guide. // +// You can view the scheduled actions for an Auto Scaling group using the DescribeScheduledActions +// API call. If you are no longer using a scheduled action, you can delete it +// by calling the DeleteScheduledAction API. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -4789,86 +5101,188 @@ func (c *AutoScaling) PutScheduledUpdateGroupActionWithContext(ctx aws.Context, return out, req.Send() } -const opRecordLifecycleActionHeartbeat = "RecordLifecycleActionHeartbeat" +const opPutWarmPool = "PutWarmPool" -// RecordLifecycleActionHeartbeatRequest generates a "aws/request.Request" representing the -// client's request for the RecordLifecycleActionHeartbeat operation. The "output" return +// PutWarmPoolRequest generates a "aws/request.Request" representing the +// client's request for the PutWarmPool operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RecordLifecycleActionHeartbeat for more information on using the RecordLifecycleActionHeartbeat +// See PutWarmPool for more information on using the PutWarmPool // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RecordLifecycleActionHeartbeatRequest method. -// req, resp := client.RecordLifecycleActionHeartbeatRequest(params) +// // Example sending a request using the PutWarmPoolRequest method. +// req, resp := client.PutWarmPoolRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/RecordLifecycleActionHeartbeat -func (c *AutoScaling) RecordLifecycleActionHeartbeatRequest(input *RecordLifecycleActionHeartbeatInput) (req *request.Request, output *RecordLifecycleActionHeartbeatOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutWarmPool +func (c *AutoScaling) PutWarmPoolRequest(input *PutWarmPoolInput) (req *request.Request, output *PutWarmPoolOutput) { op := &request.Operation{ - Name: opRecordLifecycleActionHeartbeat, + Name: opPutWarmPool, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RecordLifecycleActionHeartbeatInput{} + input = &PutWarmPoolInput{} } - output = &RecordLifecycleActionHeartbeatOutput{} + output = &PutWarmPoolOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RecordLifecycleActionHeartbeat API operation for Auto Scaling. -// -// Records a heartbeat for the lifecycle action associated with the specified -// token or instance. This extends the timeout by the length of time defined -// using the PutLifecycleHook API call. -// -// This step is a part of the procedure for adding a lifecycle hook to an Auto -// Scaling group: -// -// (Optional) Create a Lambda function and a rule that allows CloudWatch Events -// to invoke your Lambda function when Amazon EC2 Auto Scaling launches or terminates -// instances. -// -// (Optional) Create a notification target and an IAM role. The target can be -// either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon -// EC2 Auto Scaling to publish lifecycle notifications to the target. -// -// Create the lifecycle hook. Specify whether the hook is used when the instances -// launch or terminate. +// PutWarmPool API operation for Auto Scaling. // -// If you need more time, record the lifecycle action heartbeat to keep the -// instance in a pending state. +// Creates or updates a warm pool for the specified Auto Scaling group. A warm +// pool is a pool of pre-initialized EC2 instances that sits alongside the Auto +// Scaling group. Whenever your application needs to scale out, the Auto Scaling +// group can draw on the warm pool to meet its new desired capacity. For more +// information and example configurations, see Warm pools for Amazon EC2 Auto +// Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html) +// in the Amazon EC2 Auto Scaling User Guide. // -// If you finish before the timeout period ends, complete the lifecycle action. +// This operation must be called from the Region in which the Auto Scaling group +// was created. This operation cannot be called on an Auto Scaling group that +// has a mixed instances policy or a launch template or launch configuration +// that requests Spot Instances. // -// For more information, see Auto Scaling Lifecycle (https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroupLifecycle.html) -// in the Amazon EC2 Auto Scaling User Guide. +// You can view the instances in the warm pool using the DescribeWarmPool API +// call. If you are no longer using a warm pool, you can delete it by calling +// the DeleteWarmPool API. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Auto Scaling's -// API operation RecordLifecycleActionHeartbeat for usage and error information. +// API operation PutWarmPool for usage and error information. // // Returned Error Codes: -// * ErrCodeResourceContentionFault "ResourceContention" +// * ErrCodeLimitExceededFault "LimitExceeded" +// You have already reached a limit for your Amazon EC2 Auto Scaling resources +// (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). +// For more information, see DescribeAccountLimits (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html) +// in the Amazon EC2 Auto Scaling API Reference. +// +// * ErrCodeResourceContentionFault "ResourceContention" +// You already have a pending update to an Amazon EC2 Auto Scaling resource +// (for example, an Auto Scaling group, instance, or load balancer). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/PutWarmPool +func (c *AutoScaling) PutWarmPool(input *PutWarmPoolInput) (*PutWarmPoolOutput, error) { + req, out := c.PutWarmPoolRequest(input) + return out, req.Send() +} + +// PutWarmPoolWithContext is the same as PutWarmPool with the addition of +// the ability to pass a context and additional request options. +// +// See PutWarmPool for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AutoScaling) PutWarmPoolWithContext(ctx aws.Context, input *PutWarmPoolInput, opts ...request.Option) (*PutWarmPoolOutput, error) { + req, out := c.PutWarmPoolRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRecordLifecycleActionHeartbeat = "RecordLifecycleActionHeartbeat" + +// RecordLifecycleActionHeartbeatRequest generates a "aws/request.Request" representing the +// client's request for the RecordLifecycleActionHeartbeat operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RecordLifecycleActionHeartbeat for more information on using the RecordLifecycleActionHeartbeat +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RecordLifecycleActionHeartbeatRequest method. +// req, resp := client.RecordLifecycleActionHeartbeatRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/RecordLifecycleActionHeartbeat +func (c *AutoScaling) RecordLifecycleActionHeartbeatRequest(input *RecordLifecycleActionHeartbeatInput) (req *request.Request, output *RecordLifecycleActionHeartbeatOutput) { + op := &request.Operation{ + Name: opRecordLifecycleActionHeartbeat, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RecordLifecycleActionHeartbeatInput{} + } + + output = &RecordLifecycleActionHeartbeatOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// RecordLifecycleActionHeartbeat API operation for Auto Scaling. +// +// Records a heartbeat for the lifecycle action associated with the specified +// token or instance. This extends the timeout by the length of time defined +// using the PutLifecycleHook API call. +// +// This step is a part of the procedure for adding a lifecycle hook to an Auto +// Scaling group: +// +// (Optional) Create a Lambda function and a rule that allows CloudWatch Events +// to invoke your Lambda function when Amazon EC2 Auto Scaling launches or terminates +// instances. +// +// (Optional) Create a notification target and an IAM role. The target can be +// either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon +// EC2 Auto Scaling to publish lifecycle notifications to the target. +// +// Create the lifecycle hook. Specify whether the hook is used when the instances +// launch or terminate. +// +// If you need more time, record the lifecycle action heartbeat to keep the +// instance in a pending state. +// +// If you finish before the timeout period ends, complete the lifecycle action. +// +// For more information, see Amazon EC2 Auto Scaling lifecycle hooks (https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) +// in the Amazon EC2 Auto Scaling User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Auto Scaling's +// API operation RecordLifecycleActionHeartbeat for usage and error information. +// +// Returned Error Codes: +// * ErrCodeResourceContentionFault "ResourceContention" // You already have a pending update to an Amazon EC2 Auto Scaling resource // (for example, an Auto Scaling group, instance, or load balancer). // @@ -4939,10 +5353,10 @@ func (c *AutoScaling) ResumeProcessesRequest(input *ScalingProcessQuery) (req *r // ResumeProcesses API operation for Auto Scaling. // -// Resumes the specified suspended automatic scaling processes, or all suspended +// Resumes the specified suspended auto scaling processes, or all suspended // process, for the specified Auto Scaling group. // -// For more information, see Suspending and Resuming Scaling Processes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html) +// For more information, see Suspending and resuming scaling processes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -5033,7 +5447,7 @@ func (c *AutoScaling) SetDesiredCapacityRequest(input *SetDesiredCapacityInput) // that is lower than the current size of the group, the Auto Scaling group // uses its termination policy to determine which instances to terminate. // -// For more information, see Manual Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-manual-scaling.html) +// For more information, see Manual scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-manual-scaling.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -5121,7 +5535,7 @@ func (c *AutoScaling) SetInstanceHealthRequest(input *SetInstanceHealthInput) (r // // Sets the health status of the specified instance. // -// For more information, see Health Checks for Auto Scaling Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) +// For more information, see Health checks for Auto Scaling instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -5203,10 +5617,12 @@ func (c *AutoScaling) SetInstanceProtectionRequest(input *SetInstanceProtectionI // SetInstanceProtection API operation for Auto Scaling. // -// Updates the instance protection settings of the specified instances. +// Updates the instance protection settings of the specified instances. This +// operation cannot be called on instances in a warm pool. // // For more information about preventing instances that are part of an Auto -// Scaling group from terminating on scale in, see Instance Protection (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) +// Scaling group from terminating on scale in, see Instance scale-in protection +// (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) // in the Amazon EC2 Auto Scaling User Guide. // // If you exceed your maximum limit of instance IDs, which is 50 per Auto Scaling @@ -5297,8 +5713,8 @@ func (c *AutoScaling) StartInstanceRefreshRequest(input *StartInstanceRefreshInp // StartInstanceRefresh API operation for Auto Scaling. // // Starts a new instance refresh operation, which triggers a rolling replacement -// of all previously launched instances in the Auto Scaling group with a new -// group of instances. +// of previously launched instances in the Auto Scaling group with a new group +// of instances. // // If successful, this call creates a new instance refresh request with a unique // ID that you can use to track its progress. To query its status, call the @@ -5306,8 +5722,9 @@ func (c *AutoScaling) StartInstanceRefreshRequest(input *StartInstanceRefreshInp // already run, call the DescribeInstanceRefreshes API. To cancel an instance // refresh operation in progress, use the CancelInstanceRefresh API. // -// For more information, see Replacing Auto Scaling Instances Based on an Instance -// Refresh (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html). +// For more information, see Replacing Auto Scaling instances based on an instance +// refresh (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html) +// in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5398,12 +5815,12 @@ func (c *AutoScaling) SuspendProcessesRequest(input *ScalingProcessQuery) (req * // SuspendProcesses API operation for Auto Scaling. // -// Suspends the specified automatic scaling processes, or all processes, for -// the specified Auto Scaling group. +// Suspends the specified auto scaling processes, or all processes, for the +// specified Auto Scaling group. // // If you suspend either the Launch or Terminate process types, it can prevent // other process types from functioning properly. For more information, see -// Suspending and Resuming Scaling Processes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html) +// Suspending and resuming scaling processes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html) // in the Amazon EC2 Auto Scaling User Guide. // // To resume processes that have been suspended, call the ResumeProcesses API. @@ -5490,7 +5907,7 @@ func (c *AutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *Terminat // TerminateInstanceInAutoScalingGroup API operation for Auto Scaling. // // Terminates the specified instance and optionally adjusts the desired group -// size. +// size. This operation cannot be called on instances in a warm pool. // // This call simply makes a termination request. The instance is not terminated // immediately. When an instance is terminated, the instance status changes @@ -5504,7 +5921,7 @@ func (c *AutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *Terminat // Zones. If you decrement the desired capacity, your Auto Scaling group can // become unbalanced between Availability Zones. Amazon EC2 Auto Scaling tries // to rebalance the group, and rebalancing might terminate instances in other -// zones. For more information, see Rebalancing Activities (https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-benefits.html#AutoScalingBehavior.InstanceUsage) +// zones. For more information, see Rebalancing activities (https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-benefits.html#AutoScalingBehavior.InstanceUsage) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -5590,6 +6007,9 @@ func (c *AutoScaling) UpdateAutoScalingGroupRequest(input *UpdateAutoScalingGrou // UpdateAutoScalingGroup API operation for Auto Scaling. // +// We strongly recommend that all Auto Scaling groups use launch templates to +// ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2. +// // Updates the configuration for the specified Auto Scaling group. // // To update an Auto Scaling group, specify the name of the group and the parameter @@ -5682,11 +6102,17 @@ type Activity struct { // ActivityId is a required field ActivityId *string `type:"string" required:"true"` + // The Amazon Resource Name (ARN) of the Auto Scaling group. + AutoScalingGroupARN *string `min:"1" type:"string"` + // The name of the Auto Scaling group. // // AutoScalingGroupName is a required field AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + // The state of the Auto Scaling group, which is either InService or Deleted. + AutoScalingGroupState *string `min:"1" type:"string"` + // The reason the activity began. // // Cause is a required field @@ -5734,12 +6160,24 @@ func (s *Activity) SetActivityId(v string) *Activity { return s } +// SetAutoScalingGroupARN sets the AutoScalingGroupARN field's value. +func (s *Activity) SetAutoScalingGroupARN(v string) *Activity { + s.AutoScalingGroupARN = &v + return s +} + // SetAutoScalingGroupName sets the AutoScalingGroupName field's value. func (s *Activity) SetAutoScalingGroupName(v string) *Activity { s.AutoScalingGroupName = &v return s } +// SetAutoScalingGroupState sets the AutoScalingGroupState field's value. +func (s *Activity) SetAutoScalingGroupState(v string) *Activity { + s.AutoScalingGroupState = &v + return s +} + // SetCause sets the Cause field's value. func (s *Activity) SetCause(v string) *Activity { s.Cause = &v @@ -5919,7 +6357,9 @@ type AttachLoadBalancerTargetGroupsInput struct { AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // The Amazon Resource Names (ARN) of the target groups. You can specify up - // to 10 target groups. + // to 10 target groups. To get the ARN of a target group, use the Elastic Load + // Balancing DescribeTargetGroups (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) + // API operation. // // TargetGroupARNs is a required field TargetGroupARNs []*string `type:"list" required:"true"` @@ -6371,6 +6811,45 @@ func (s *CancelInstanceRefreshOutput) SetInstanceRefreshId(v string) *CancelInst return s } +// A GetPredictiveScalingForecast call returns the capacity forecast for a predictive +// scaling policy. This structure includes the data points for that capacity +// forecast, along with the timestamps of those data points. +type CapacityForecast struct { + _ struct{} `type:"structure"` + + // The time stamps for the data points, in UTC format. + // + // Timestamps is a required field + Timestamps []*time.Time `type:"list" required:"true"` + + // The values of the data points. + // + // Values is a required field + Values []*float64 `type:"list" required:"true"` +} + +// String returns the string representation +func (s CapacityForecast) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CapacityForecast) GoString() string { + return s.String() +} + +// SetTimestamps sets the Timestamps field's value. +func (s *CapacityForecast) SetTimestamps(v []*time.Time) *CapacityForecast { + s.Timestamps = v + return s +} + +// SetValues sets the Values field's value. +func (s *CapacityForecast) SetValues(v []*float64) *CapacityForecast { + s.Values = v + return s +} + type CompleteLifecycleActionInput struct { _ struct{} `type:"structure"` @@ -6493,122 +6972,100 @@ type CreateAutoScalingGroupInput struct { // AutoScalingGroupName is a required field AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // One or more Availability Zones for the group. This parameter is optional - // if you specify one or more subnets for VPCZoneIdentifier. + // A list of Availability Zones where instances in the Auto Scaling group can + // be created. This parameter is optional if you specify one or more subnets + // for VPCZoneIdentifier. // // Conditional: If your account supports EC2-Classic and VPC, this parameter // is required to launch instances into EC2-Classic. - AvailabilityZones []*string `min:"1" type:"list"` + AvailabilityZones []*string `type:"list"` - // Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance - // is disabled. - // - // You can enable capacity rebalancing for your Auto Scaling groups when using - // Spot Instances. When you turn on capacity rebalancing, Amazon EC2 Auto Scaling - // attempts to launch a Spot Instance whenever Amazon EC2 predicts that a Spot + // Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing + // is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling + // attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot // Instance is at an elevated risk of interruption. After launching a new instance, // it then terminates an old instance. For more information, see Amazon EC2 - // Auto Scaling capacity rebalancing (https://docs.aws.amazon.com/autoscaling/ec2/userguide/capacity-rebalance.html) + // Auto Scaling Capacity Rebalancing (https://docs.aws.amazon.com/autoscaling/ec2/userguide/capacity-rebalance.html) // in the Amazon EC2 Auto Scaling User Guide. CapacityRebalance *bool `type:"boolean"` // The amount of time, in seconds, after a scaling activity completes before - // another scaling activity can start. The default value is 300. - // - // This setting applies when using simple scaling policies, but not when using - // other scaling policies or scheduled scaling. For more information, see Scaling - // Cooldowns for Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // another scaling activity can start. The default value is 300. This setting + // applies when using simple scaling policies, but not when using other scaling + // policies or scheduled scaling. For more information, see Scaling cooldowns + // for Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) // in the Amazon EC2 Auto Scaling User Guide. DefaultCooldown *int64 `type:"integer"` // The desired capacity is the initial capacity of the Auto Scaling group at // the time of its creation and the capacity it attempts to maintain. It can - // scale beyond this capacity if you configure automatic scaling. - // - // This number must be greater than or equal to the minimum size of the group - // and less than or equal to the maximum size of the group. If you do not specify - // a desired capacity, the default is the minimum size of the group. + // scale beyond this capacity if you configure auto scaling. This number must + // be greater than or equal to the minimum size of the group and less than or + // equal to the maximum size of the group. If you do not specify a desired capacity, + // the default is the minimum size of the group. DesiredCapacity *int64 `type:"integer"` // The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before // checking the health status of an EC2 instance that has come into service. // During this time, any health check failures for the instance are ignored. - // The default value is 0. - // - // For more information, see Health Check Grace Period (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html#health-check-grace-period) + // The default value is 0. For more information, see Health check grace period + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html#health-check-grace-period) // in the Amazon EC2 Auto Scaling User Guide. // - // Required if you are adding an ELB health check. + // Conditional: Required if you are adding an ELB health check. HealthCheckGracePeriod *int64 `type:"integer"` - // The service to use for the health checks. The valid values are EC2 and ELB. - // The default value is EC2. If you configure an Auto Scaling group to use ELB + // The service to use for the health checks. The valid values are EC2 (default) + // and ELB. If you configure an Auto Scaling group to use load balancer (ELB) // health checks, it considers the instance unhealthy if it fails either the - // EC2 status checks or the load balancer health checks. - // - // For more information, see Health Checks for Auto Scaling Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) + // EC2 status checks or the load balancer health checks. For more information, + // see Health checks for Auto Scaling instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) // in the Amazon EC2 Auto Scaling User Guide. HealthCheckType *string `min:"1" type:"string"` - // The ID of the instance used to create a launch configuration for the group. - // To get the instance ID, use the Amazon EC2 DescribeInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html) - // API operation. - // - // When you specify an ID of an instance, Amazon EC2 Auto Scaling creates a - // new launch configuration and associates it with the group. This launch configuration - // derives its attributes from the specified instance, except for the block - // device mapping. - // - // You must specify one of the following parameters in your request: LaunchConfigurationName, - // LaunchTemplate, InstanceId, or MixedInstancesPolicy. + // The ID of the instance used to base the launch configuration on. If specified, + // Amazon EC2 Auto Scaling uses the configuration values from the specified + // instance to create a new launch configuration. To get the instance ID, use + // the Amazon EC2 DescribeInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html) + // API operation. For more information, see Creating an Auto Scaling group using + // an EC2 instance (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html) + // in the Amazon EC2 Auto Scaling User Guide. InstanceId *string `min:"1" type:"string"` - // The name of the launch configuration to use when an instance is launched. - // To get the launch configuration name, use the DescribeLaunchConfigurations - // API operation. New launch configurations can be created with the CreateLaunchConfiguration - // API. + // The name of the launch configuration to use to launch instances. // - // You must specify one of the following parameters in your request: LaunchConfigurationName, - // LaunchTemplate, InstanceId, or MixedInstancesPolicy. + // Conditional: You must specify either a launch template (LaunchTemplate or + // MixedInstancesPolicy) or a launch configuration (LaunchConfigurationName + // or InstanceId). LaunchConfigurationName *string `min:"1" type:"string"` - // Parameters used to specify the launch template and version to use when an - // instance is launched. - // - // For more information, see LaunchTemplateSpecification (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_LaunchTemplateSpecification.html) - // in the Amazon EC2 Auto Scaling API Reference. + // Parameters used to specify the launch template and version to use to launch + // instances. // - // You can alternatively associate a launch template to the Auto Scaling group - // by using the MixedInstancesPolicy parameter. + // Conditional: You must specify either a launch template (LaunchTemplate or + // MixedInstancesPolicy) or a launch configuration (LaunchConfigurationName + // or InstanceId). // - // You must specify one of the following parameters in your request: LaunchConfigurationName, - // LaunchTemplate, InstanceId, or MixedInstancesPolicy. + // The launch template that is specified must be configured for use with an + // Auto Scaling group. For more information, see Creating a launch template + // for an Auto Scaling group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) + // in the Amazon EC2 Auto Scaling User Guide. LaunchTemplate *LaunchTemplateSpecification `type:"structure"` - // One or more lifecycle hooks. + // One or more lifecycle hooks for the group, which specify actions to perform + // when Amazon EC2 Auto Scaling launches or terminates instances. LifecycleHookSpecificationList []*LifecycleHookSpecification `type:"list"` // A list of Classic Load Balancers associated with this Auto Scaling group. - // For Application Load Balancers and Network Load Balancers, specify a list - // of target groups using the TargetGroupARNs property instead. - // - // For more information, see Using a Load Balancer with an Auto Scaling Group - // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) - // in the Amazon EC2 Auto Scaling User Guide. + // For Application Load Balancers, Network Load Balancers, and Gateway Load + // Balancers, specify the TargetGroupARNs property instead. LoadBalancerNames []*string `type:"list"` // The maximum amount of time, in seconds, that an instance can be in service. - // The default is null. - // - // This parameter is optional, but if you specify a value for it, you must specify - // a value of at least 604,800 seconds (7 days). To clear a previously set value, - // specify a new value of 0. - // - // For more information, see Replacing Auto Scaling Instances Based on Maximum - // Instance Lifetime (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) + // The default is null. If specified, the value must be either 0 or a number + // equal to or greater than 86,400 seconds (1 day). For more information, see + // Replacing Auto Scaling instances based on maximum instance lifetime (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) // in the Amazon EC2 Auto Scaling User Guide. - // - // Valid Range: Minimum value of 0. MaxInstanceLifetime *int64 `type:"integer"` // The maximum size of the group. @@ -6628,81 +7085,70 @@ type CreateAutoScalingGroupInput struct { MinSize *int64 `type:"integer" required:"true"` // An embedded object that specifies a mixed instances policy. The required - // parameters must be specified. If optional parameters are unspecified, their + // properties must be specified. If optional properties are unspecified, their // default values are used. // - // The policy includes parameters that not only define the distribution of On-Demand + // The policy includes properties that not only define the distribution of On-Demand // Instances and Spot Instances, the maximum price to pay for Spot Instances, // and how the Auto Scaling group allocates instance types to fulfill On-Demand - // and Spot capacity, but also the parameters that specify the instance configuration - // information—the launch template and instance types. - // - // For more information, see MixedInstancesPolicy (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_MixedInstancesPolicy.html) - // in the Amazon EC2 Auto Scaling API Reference and Auto Scaling Groups with - // Multiple Instance Types and Purchase Options (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) + // and Spot capacities, but also the properties that specify the instance configuration + // information—the launch template and instance types. The policy can also + // include a weight for each instance type and different launch templates for + // individual instance types. For more information, see Auto Scaling groups + // with multiple instance types and purchase options (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) // in the Amazon EC2 Auto Scaling User Guide. - // - // You must specify one of the following parameters in your request: LaunchConfigurationName, - // LaunchTemplate, InstanceId, or MixedInstancesPolicy. MixedInstancesPolicy *MixedInstancesPolicy `type:"structure"` // Indicates whether newly launched instances are protected from termination - // by Amazon EC2 Auto Scaling when scaling in. - // - // For more information about preventing instances from terminating on scale - // in, see Instance Protection (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) + // by Amazon EC2 Auto Scaling when scaling in. For more information about preventing + // instances from terminating on scale in, see Instance scale-in protection + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) // in the Amazon EC2 Auto Scaling User Guide. NewInstancesProtectedFromScaleIn *bool `type:"boolean"` - // The name of the placement group into which to launch your instances, if any. - // A placement group is a logical grouping of instances within a single Availability - // Zone. You cannot specify multiple Availability Zones and a placement group. - // For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) + // The name of an existing placement group into which to launch your instances, + // if any. A placement group is a logical grouping of instances within a single + // Availability Zone. You cannot specify multiple Availability Zones and a placement + // group. For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) // in the Amazon EC2 User Guide for Linux Instances. PlacementGroup *string `min:"1" type:"string"` // The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling // group uses to call other AWS services on your behalf. By default, Amazon // EC2 Auto Scaling uses a service-linked role named AWSServiceRoleForAutoScaling, - // which it creates if it does not exist. For more information, see Service-Linked - // Roles (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html) + // which it creates if it does not exist. For more information, see Service-linked + // roles (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html) // in the Amazon EC2 Auto Scaling User Guide. ServiceLinkedRoleARN *string `min:"1" type:"string"` // One or more tags. You can tag your Auto Scaling group and propagate the tags - // to the Amazon EC2 instances it launches. - // - // Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS - // volumes, specify the tags in a launch template but use caution. If the launch - // template specifies an instance tag with a key that is also specified for - // the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that - // instance tag with the value specified by the Auto Scaling group. - // - // For more information, see Tagging Auto Scaling Groups and Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) + // to the Amazon EC2 instances it launches. Tags are not propagated to Amazon + // EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a launch + // template but use caution. If the launch template specifies an instance tag + // with a key that is also specified for the Auto Scaling group, Amazon EC2 + // Auto Scaling overrides the value of that instance tag with the value specified + // by the Auto Scaling group. For more information, see Tagging Auto Scaling + // groups and instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) // in the Amazon EC2 Auto Scaling User Guide. Tags []*Tag `type:"list"` // The Amazon Resource Names (ARN) of the target groups to associate with the // Auto Scaling group. Instances are registered as targets in a target group, - // and traffic is routed to the target group. - // - // For more information, see Using a Load Balancer with an Auto Scaling Group - // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) + // and traffic is routed to the target group. For more information, see Elastic + // Load Balancing and Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) // in the Amazon EC2 Auto Scaling User Guide. TargetGroupARNs []*string `type:"list"` - // One or more termination policies used to select the instance to terminate. - // These policies are executed in the order that they are listed. - // - // For more information, see Controlling Which Instances Auto Scaling Terminates - // During Scale In (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html) + // A policy or a list of policies that are used to select the instance to terminate. + // These policies are executed in the order that you list them. For more information, + // see Controlling which Auto Scaling instances terminate during scale in (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html) // in the Amazon EC2 Auto Scaling User Guide. TerminationPolicies []*string `type:"list"` - // A comma-separated list of subnet IDs for your virtual private cloud (VPC). - // - // If you specify VPCZoneIdentifier with AvailabilityZones, the subnets that - // you specify for this parameter must reside in those Availability Zones. + // A comma-separated list of subnet IDs for a virtual private cloud (VPC) where + // instances in the Auto Scaling group can be created. If you specify VPCZoneIdentifier + // with AvailabilityZones, the subnets that you specify for this parameter must + // reside in those Availability Zones. // // Conditional: If your account supports EC2-Classic and VPC, this parameter // is required to launch instances into a VPC. @@ -6728,9 +7174,6 @@ func (s *CreateAutoScalingGroupInput) Validate() error { if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) } - if s.AvailabilityZones != nil && len(s.AvailabilityZones) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AvailabilityZones", 1)) - } if s.HealthCheckType != nil && len(*s.HealthCheckType) < 1 { invalidParams.Add(request.NewErrParamMinLen("HealthCheckType", 1)) } @@ -6950,7 +7393,7 @@ type CreateLaunchConfigurationInput struct { // For Auto Scaling groups that are running in a virtual private cloud (VPC), // specifies whether to assign a public IP address to the group's instances. // If you specify true, each instance in the Auto Scaling group receives a unique - // public IP address. For more information, see Launching Auto Scaling Instances + // public IP address. For more information, see Launching Auto Scaling instances // in a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) // in the Amazon EC2 Auto Scaling User Guide. // @@ -6973,7 +7416,7 @@ type CreateLaunchConfigurationInput struct { // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. // For more information, see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic - // Instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) + // instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) // in the Amazon EC2 Auto Scaling User Guide. // // This parameter can only be used if you are launching EC2-Classic instances. @@ -6982,7 +7425,7 @@ type CreateLaunchConfigurationInput struct { // The IDs of one or more security groups for the specified ClassicLink-enabled // VPC. For more information, see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic - // Instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) + // instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) // in the Amazon EC2 Auto Scaling User Guide. // // If you specify the ClassicLinkVPCId parameter, you must specify this parameter. @@ -7004,8 +7447,8 @@ type CreateLaunchConfigurationInput struct { // with the IAM role for the instance. The instance profile contains the IAM // role. // - // For more information, see IAM Role for Applications That Run on Amazon EC2 - // Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html) + // For more information, see IAM role for applications that run on Amazon EC2 + // instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html) // in the Amazon EC2 Auto Scaling User Guide. IamInstanceProfile *string `min:"1" type:"string"` @@ -7023,7 +7466,7 @@ type CreateLaunchConfigurationInput struct { // To create a launch configuration with a block device mapping or override // any other instance attributes, specify them as part of the same request. // - // For more information, see Create a Launch Configuration Using an EC2 Instance + // For more information, see Creating a launch configuration using an EC2 instance // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-lc-with-instanceID.html) // in the Amazon EC2 Auto Scaling User Guide. // @@ -7080,7 +7523,8 @@ type CreateLaunchConfigurationInput struct { // If you specify PlacementTenancy, you must specify at least one subnet for // VPCZoneIdentifier when you create your group. // - // For more information, see Instance Placement Tenancy (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-vpc-tenancy) + // For more information, see Configuring instance tenancy with Amazon EC2 Auto + // Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-dedicated-instances.html) // in the Amazon EC2 Auto Scaling User Guide. // // Valid Values: default | dedicated @@ -7103,8 +7547,8 @@ type CreateLaunchConfigurationInput struct { // The maximum hourly price to be paid for any Spot Instance launched to fulfill // the request. Spot Instances are launched when the price you specify exceeds - // the current Spot price. For more information, see Launching Spot Instances - // in Your Auto Scaling Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html) + // the current Spot price. For more information, see Requesting Spot Instances + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html) // in the Amazon EC2 Auto Scaling User Guide. // // When you change your maximum price by creating a new launch configuration, @@ -7112,9 +7556,12 @@ type CreateLaunchConfigurationInput struct { // running instances is higher than the current Spot price. SpotPrice *string `min:"1" type:"string"` - // The Base64-encoded user data to make available to the launched EC2 instances. - // For more information, see Instance Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) - // in the Amazon EC2 User Guide for Linux Instances. + // The user data to make available to the launched EC2 instances. For more information, + // see Instance metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) + // (Linux) and Instance metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html) + // (Windows). If you are using a command line tool, base64-encoding is performed + // for you, and you can load the text from a file. Otherwise, you must provide + // base64-encoded text. User data is limited to 16 KB. UserData *string `type:"string"` } @@ -7503,7 +7950,8 @@ type DeleteAutoScalingGroupInput struct { // Specifies that the group is to be deleted along with all instances associated // with the group, without waiting for all instances to be terminated. This - // parameter also deletes any lifecycle actions associated with the group. + // parameter also deletes any outstanding lifecycle actions associated with + // the group. ForceDelete *bool `type:"boolean"` } @@ -7960,6 +8408,73 @@ func (s DeleteTagsOutput) GoString() string { return s.String() } +type DeleteWarmPoolInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // Specifies that the warm pool is to be deleted along with all of its associated + // instances, without waiting for all instances to be terminated. This parameter + // also deletes any outstanding lifecycle actions associated with the warm pool + // instances. + ForceDelete *bool `type:"boolean"` +} + +// String returns the string representation +func (s DeleteWarmPoolInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteWarmPoolInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteWarmPoolInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteWarmPoolInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DeleteWarmPoolInput) SetAutoScalingGroupName(v string) *DeleteWarmPoolInput { + s.AutoScalingGroupName = &v + return s +} + +// SetForceDelete sets the ForceDelete field's value. +func (s *DeleteWarmPoolInput) SetForceDelete(v bool) *DeleteWarmPoolInput { + s.ForceDelete = &v + return s +} + +type DeleteWarmPoolOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteWarmPoolOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteWarmPoolOutput) GoString() string { + return s.String() +} + type DescribeAccountLimitsInput struct { _ struct{} `type:"structure"` } @@ -8066,9 +8581,9 @@ func (s *DescribeAdjustmentTypesOutput) SetAdjustmentTypes(v []*AdjustmentType) type DescribeAutoScalingGroupsInput struct { _ struct{} `type:"structure"` - // The names of the Auto Scaling groups. Each name can be a maximum of 1600 - // characters. By default, you can only specify up to 50 names. You can optionally - // increase this limit using the MaxRecords parameter. + // The names of the Auto Scaling groups. By default, you can only specify up + // to 50 names. You can optionally increase this limit using the MaxRecords + // parameter. // // If you omit this parameter, all Auto Scaling groups are described. AutoScalingGroupNames []*string `type:"list"` @@ -8900,7 +9415,7 @@ type DescribePoliciesInput struct { PolicyNames []*string `type:"list"` // One or more policy types. The valid values are SimpleScaling, StepScaling, - // and TargetTrackingScaling. + // TargetTrackingScaling, and PredictiveScaling. PolicyTypes []*string `type:"list"` } @@ -9005,6 +9520,9 @@ type DescribeScalingActivitiesInput struct { // The name of the Auto Scaling group. AutoScalingGroupName *string `min:"1" type:"string"` + // Indicates whether to include scaling activity from deleted Auto Scaling groups. + IncludeDeletedGroups *bool `type:"boolean"` + // The maximum number of items to return with this call. The default value is // 100 and the maximum value is 100. MaxRecords *int64 `type:"integer"` @@ -9049,6 +9567,12 @@ func (s *DescribeScalingActivitiesInput) SetAutoScalingGroupName(v string) *Desc return s } +// SetIncludeDeletedGroups sets the IncludeDeletedGroups field's value. +func (s *DescribeScalingActivitiesInput) SetIncludeDeletedGroups(v bool) *DescribeScalingActivitiesInput { + s.IncludeDeletedGroups = &v + return s +} + // SetMaxRecords sets the MaxRecords field's value. func (s *DescribeScalingActivitiesInput) SetMaxRecords(v int64) *DescribeScalingActivitiesInput { s.MaxRecords = &v @@ -9376,7 +9900,7 @@ func (s *DescribeTerminationPolicyTypesOutput) SetTerminationPolicyTypes(v []*st return s } -type DetachInstancesInput struct { +type DescribeWarmPoolInput struct { _ struct{} `type:"structure"` // The name of the Auto Scaling group. @@ -9384,38 +9908,34 @@ type DetachInstancesInput struct { // AutoScalingGroupName is a required field AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // The IDs of the instances. You can specify up to 20 instances. - InstanceIds []*string `type:"list"` + // The maximum number of instances to return with this call. The maximum value + // is 50. + MaxRecords *int64 `type:"integer"` - // Indicates whether the Auto Scaling group decrements the desired capacity - // value by the number of instances detached. - // - // ShouldDecrementDesiredCapacity is a required field - ShouldDecrementDesiredCapacity *bool `type:"boolean" required:"true"` + // The token for the next set of instances to return. (You received this token + // from a previous call.) + NextToken *string `type:"string"` } // String returns the string representation -func (s DetachInstancesInput) String() string { +func (s DescribeWarmPoolInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DetachInstancesInput) GoString() string { +func (s DescribeWarmPoolInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DetachInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachInstancesInput"} +func (s *DescribeWarmPoolInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeWarmPoolInput"} if s.AutoScalingGroupName == nil { invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) } if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) } - if s.ShouldDecrementDesiredCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("ShouldDecrementDesiredCapacity")) - } if invalidParams.Len() > 0 { return invalidParams @@ -9424,15 +9944,122 @@ func (s *DetachInstancesInput) Validate() error { } // SetAutoScalingGroupName sets the AutoScalingGroupName field's value. -func (s *DetachInstancesInput) SetAutoScalingGroupName(v string) *DetachInstancesInput { +func (s *DescribeWarmPoolInput) SetAutoScalingGroupName(v string) *DescribeWarmPoolInput { s.AutoScalingGroupName = &v return s } -// SetInstanceIds sets the InstanceIds field's value. -func (s *DetachInstancesInput) SetInstanceIds(v []*string) *DetachInstancesInput { - s.InstanceIds = v - return s +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeWarmPoolInput) SetMaxRecords(v int64) *DescribeWarmPoolInput { + s.MaxRecords = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeWarmPoolInput) SetNextToken(v string) *DescribeWarmPoolInput { + s.NextToken = &v + return s +} + +type DescribeWarmPoolOutput struct { + _ struct{} `type:"structure"` + + // The instances that are currently in the warm pool. + Instances []*Instance `type:"list"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` + + // The warm pool configuration details. + WarmPoolConfiguration *WarmPoolConfiguration `type:"structure"` +} + +// String returns the string representation +func (s DescribeWarmPoolOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeWarmPoolOutput) GoString() string { + return s.String() +} + +// SetInstances sets the Instances field's value. +func (s *DescribeWarmPoolOutput) SetInstances(v []*Instance) *DescribeWarmPoolOutput { + s.Instances = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeWarmPoolOutput) SetNextToken(v string) *DescribeWarmPoolOutput { + s.NextToken = &v + return s +} + +// SetWarmPoolConfiguration sets the WarmPoolConfiguration field's value. +func (s *DescribeWarmPoolOutput) SetWarmPoolConfiguration(v *WarmPoolConfiguration) *DescribeWarmPoolOutput { + s.WarmPoolConfiguration = v + return s +} + +type DetachInstancesInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The IDs of the instances. You can specify up to 20 instances. + InstanceIds []*string `type:"list"` + + // Indicates whether the Auto Scaling group decrements the desired capacity + // value by the number of instances detached. + // + // ShouldDecrementDesiredCapacity is a required field + ShouldDecrementDesiredCapacity *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s DetachInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachInstancesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachInstancesInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.ShouldDecrementDesiredCapacity == nil { + invalidParams.Add(request.NewErrParamRequired("ShouldDecrementDesiredCapacity")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *DetachInstancesInput) SetAutoScalingGroupName(v string) *DetachInstancesInput { + s.AutoScalingGroupName = &v + return s +} + +// SetInstanceIds sets the InstanceIds field's value. +func (s *DetachInstancesInput) SetInstanceIds(v []*string) *DetachInstancesInput { + s.InstanceIds = v + return s } // SetShouldDecrementDesiredCapacity sets the ShouldDecrementDesiredCapacity field's value. @@ -9639,6 +10266,20 @@ type DisableMetricsCollectionInput struct { // // * GroupTotalCapacity // + // * WarmPoolDesiredCapacity + // + // * WarmPoolWarmedCapacity + // + // * WarmPoolPendingCapacity + // + // * WarmPoolTerminatingCapacity + // + // * WarmPoolTotalCapacity + // + // * GroupAndWarmPoolDesiredCapacity + // + // * GroupAndWarmPoolTotalCapacity + // // If you omit this parameter, all metrics are disabled. Metrics []*string `type:"list"` } @@ -9724,8 +10365,8 @@ type Ebs struct { // customer managed CMK, whether or not the snapshot was encrypted. // // For more information, see Using Encryption with EBS-Backed AMIs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html) - // in the Amazon EC2 User Guide for Linux Instances and Required CMK Key Policy - // for Use with Encrypted Volumes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/key-policy-requirements-EBS-encryption.html) + // in the Amazon EC2 User Guide for Linux Instances and Required CMK key policy + // for use with encrypted volumes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/key-policy-requirements-EBS-encryption.html) // in the Amazon EC2 Auto Scaling User Guide. Encrypted *bool `type:"boolean"` @@ -9879,6 +10520,22 @@ type EnableMetricsCollectionInput struct { // // * GroupTotalCapacity // + // The warm pools feature supports the following additional metrics: + // + // * WarmPoolDesiredCapacity + // + // * WarmPoolWarmedCapacity + // + // * WarmPoolPendingCapacity + // + // * WarmPoolTerminatingCapacity + // + // * WarmPoolTotalCapacity + // + // * GroupAndWarmPoolDesiredCapacity + // + // * GroupAndWarmPoolTotalCapacity + // // If you omit this parameter, all metrics are enabled. Metrics []*string `type:"list"` } @@ -9981,6 +10638,20 @@ type EnabledMetric struct { // * GroupTerminatingCapacity // // * GroupTotalCapacity + // + // * WarmPoolDesiredCapacity + // + // * WarmPoolWarmedCapacity + // + // * WarmPoolPendingCapacity + // + // * WarmPoolTerminatingCapacity + // + // * WarmPoolTotalCapacity + // + // * GroupAndWarmPoolDesiredCapacity + // + // * GroupAndWarmPoolTotalCapacity Metric *string `min:"1" type:"string"` } @@ -10109,7 +10780,7 @@ type ExecutePolicyInput struct { // complete before executing the policy. // // Valid only if the policy type is SimpleScaling. For more information, see - // Scaling Cooldowns for Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // Scaling cooldowns for Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) // in the Amazon EC2 Auto Scaling User Guide. HonorCooldown *bool `type:"boolean"` @@ -10324,7 +10995,7 @@ func (s *FailedScheduledUpdateGroupActionRequest) SetScheduledActionName(v strin // Describes a filter that is used to return a more specific list of results // when describing tags. // -// For more information, see Tagging Auto Scaling Groups and Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) +// For more information, see Tagging Auto Scaling groups and instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html) // in the Amazon EC2 Auto Scaling User Guide. type Filter struct { _ struct{} `type:"structure"` @@ -10359,6 +11030,145 @@ func (s *Filter) SetValues(v []*string) *Filter { return s } +type GetPredictiveScalingForecastInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The exclusive end time of the time range for the forecast data to get. The + // maximum time duration between the start and end time is 30 days. + // + // Although this parameter can accept a date and time that is more than two + // days in the future, the availability of forecast data has limits. Amazon + // EC2 Auto Scaling only issues forecasts for periods of two days in advance. + // + // EndTime is a required field + EndTime *time.Time `type:"timestamp" required:"true"` + + // The name of the policy. + // + // PolicyName is a required field + PolicyName *string `min:"1" type:"string" required:"true"` + + // The inclusive start time of the time range for the forecast data to get. + // At most, the date and time can be one year before the current date and time. + // + // StartTime is a required field + StartTime *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s GetPredictiveScalingForecastInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPredictiveScalingForecastInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPredictiveScalingForecastInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPredictiveScalingForecastInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.EndTime == nil { + invalidParams.Add(request.NewErrParamRequired("EndTime")) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.StartTime == nil { + invalidParams.Add(request.NewErrParamRequired("StartTime")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *GetPredictiveScalingForecastInput) SetAutoScalingGroupName(v string) *GetPredictiveScalingForecastInput { + s.AutoScalingGroupName = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *GetPredictiveScalingForecastInput) SetEndTime(v time.Time) *GetPredictiveScalingForecastInput { + s.EndTime = &v + return s +} + +// SetPolicyName sets the PolicyName field's value. +func (s *GetPredictiveScalingForecastInput) SetPolicyName(v string) *GetPredictiveScalingForecastInput { + s.PolicyName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *GetPredictiveScalingForecastInput) SetStartTime(v time.Time) *GetPredictiveScalingForecastInput { + s.StartTime = &v + return s +} + +type GetPredictiveScalingForecastOutput struct { + _ struct{} `type:"structure"` + + // The capacity forecast. + // + // CapacityForecast is a required field + CapacityForecast *CapacityForecast `type:"structure" required:"true"` + + // The load forecast. + // + // LoadForecast is a required field + LoadForecast []*LoadForecast `type:"list" required:"true"` + + // The time the forecast was made. + // + // UpdateTime is a required field + UpdateTime *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s GetPredictiveScalingForecastOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPredictiveScalingForecastOutput) GoString() string { + return s.String() +} + +// SetCapacityForecast sets the CapacityForecast field's value. +func (s *GetPredictiveScalingForecastOutput) SetCapacityForecast(v *CapacityForecast) *GetPredictiveScalingForecastOutput { + s.CapacityForecast = v + return s +} + +// SetLoadForecast sets the LoadForecast field's value. +func (s *GetPredictiveScalingForecastOutput) SetLoadForecast(v []*LoadForecast) *GetPredictiveScalingForecastOutput { + s.LoadForecast = v + return s +} + +// SetUpdateTime sets the UpdateTime field's value. +func (s *GetPredictiveScalingForecastOutput) SetUpdateTime(v time.Time) *GetPredictiveScalingForecastOutput { + s.UpdateTime = &v + return s +} + // Describes an Auto Scaling group. type Group struct { _ struct{} `type:"structure"` @@ -10374,9 +11184,9 @@ type Group struct { // One or more Availability Zones for the group. // // AvailabilityZones is a required field - AvailabilityZones []*string `min:"1" type:"list" required:"true"` + AvailabilityZones []*string `type:"list" required:"true"` - // Indicates whether capacity rebalance is enabled. + // Indicates whether Capacity Rebalancing is enabled. CapacityRebalance *bool `type:"boolean"` // The date and time the group was created. @@ -10446,6 +11256,9 @@ type Group struct { // The name of the placement group into which to launch your instances, if any. PlacementGroup *string `min:"1" type:"string"` + // The predicted capacity of the group when it has a predictive scaling policy. + PredictedCapacity *int64 `type:"integer"` + // The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling // group uses to call other AWS services on your behalf. ServiceLinkedRoleARN *string `min:"1" type:"string"` @@ -10468,6 +11281,12 @@ type Group struct { // One or more subnet IDs, if applicable, separated by commas. VPCZoneIdentifier *string `min:"1" type:"string"` + + // The warm pool for the group. + WarmPoolConfiguration *WarmPoolConfiguration `type:"structure"` + + // The current size of the warm pool. + WarmPoolSize *int64 `type:"integer"` } // String returns the string representation @@ -10600,6 +11419,12 @@ func (s *Group) SetPlacementGroup(v string) *Group { return s } +// SetPredictedCapacity sets the PredictedCapacity field's value. +func (s *Group) SetPredictedCapacity(v int64) *Group { + s.PredictedCapacity = &v + return s +} + // SetServiceLinkedRoleARN sets the ServiceLinkedRoleARN field's value. func (s *Group) SetServiceLinkedRoleARN(v string) *Group { s.ServiceLinkedRoleARN = &v @@ -10642,6 +11467,18 @@ func (s *Group) SetVPCZoneIdentifier(v string) *Group { return s } +// SetWarmPoolConfiguration sets the WarmPoolConfiguration field's value. +func (s *Group) SetWarmPoolConfiguration(v *WarmPoolConfiguration) *Group { + s.WarmPoolConfiguration = v + return s +} + +// SetWarmPoolSize sets the WarmPoolSize field's value. +func (s *Group) SetWarmPoolSize(v int64) *Group { + s.WarmPoolSize = &v + return s +} + // Describes an EC2 instance. type Instance struct { _ struct{} `type:"structure"` @@ -10674,7 +11511,8 @@ type Instance struct { LaunchTemplate *LaunchTemplateSpecification `type:"structure"` // A description of the current lifecycle state. The Quarantined state is not - // used. + // used. For information about lifecycle states, see Instance lifecycle (https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroupLifecycle.html) + // in the Amazon EC2 Auto Scaling User Guide. // // LifecycleState is a required field LifecycleState *string `type:"string" required:"true" enum:"LifecycleState"` @@ -10793,7 +11631,15 @@ type InstanceDetails struct { // The launch template for the instance. LaunchTemplate *LaunchTemplateSpecification `type:"structure"` - // The lifecycle state for the instance. + // The lifecycle state for the instance. The Quarantined state is not used. + // For information about lifecycle states, see Instance lifecycle (https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroupLifecycle.html) + // in the Amazon EC2 Auto Scaling User Guide. + // + // Valid Values: Pending | Pending:Wait | Pending:Proceed | Quarantined | InService + // | Terminating | Terminating:Wait | Terminating:Proceed | Terminated | Detaching + // | Detached | EnteringStandby | Standby | Warmed:Pending | Warmed:Pending:Wait + // | Warmed:Pending:Proceed | Warmed:Terminating | Warmed:Terminating:Wait | + // Warmed:Terminating:Proceed | Warmed:Terminated | Warmed:Stopped | Warmed:Running // // LifecycleState is a required field LifecycleState *string `min:"1" type:"string" required:"true"` @@ -10898,8 +11744,6 @@ type InstanceMetadataOptions struct { // larger the number, the further instance metadata requests can travel. // // Default: 1 - // - // Possible values: Integers from 1 to 64 HttpPutResponseHopLimit *int64 `min:"1" type:"integer"` // The state of token usage for your instance metadata requests. If the parameter @@ -11004,9 +11848,12 @@ type InstanceRefresh struct { // replacement, Amazon EC2 Auto Scaling tracks the instance's health status // and warm-up time. When the instance's health status changes to healthy and // the specified warm-up time passes, the instance is considered updated and - // added to the percentage complete. + // is added to the percentage complete. PercentageComplete *int64 `type:"integer"` + // Additional progress details for an Auto Scaling group that has a warm pool. + ProgressDetails *InstanceRefreshProgressDetails `type:"structure"` + // The date and time at which the instance refresh began. StartTime *time.Time `type:"timestamp"` @@ -11072,6 +11919,12 @@ func (s *InstanceRefresh) SetPercentageComplete(v int64) *InstanceRefresh { return s } +// SetProgressDetails sets the ProgressDetails field's value. +func (s *InstanceRefresh) SetProgressDetails(v *InstanceRefreshProgressDetails) *InstanceRefresh { + s.ProgressDetails = v + return s +} + // SetStartTime sets the StartTime field's value. func (s *InstanceRefresh) SetStartTime(v time.Time) *InstanceRefresh { s.StartTime = &v @@ -11090,92 +11943,186 @@ func (s *InstanceRefresh) SetStatusReason(v string) *InstanceRefresh { return s } -// Describes an instances distribution for an Auto Scaling group with a MixedInstancesPolicy. -// -// The instances distribution specifies the distribution of On-Demand Instances -// and Spot Instances, the maximum price to pay for Spot Instances, and how -// the Auto Scaling group allocates instance types to fulfill On-Demand and -// Spot capacity. -// -// When you update SpotAllocationStrategy, SpotInstancePools, or SpotMaxPrice, -// this update action does not deploy any changes across the running Amazon -// EC2 instances in the group. Your existing Spot Instances continue to run -// as long as the maximum price for those instances is higher than the current -// Spot price. When scale out occurs, Amazon EC2 Auto Scaling launches instances -// based on the new settings. When scale in occurs, Amazon EC2 Auto Scaling -// terminates instances according to the group's termination policies. -type InstancesDistribution struct { +// Reports the progress of an instance refresh on instances that are in the +// Auto Scaling group. +type InstanceRefreshLivePoolProgress struct { _ struct{} `type:"structure"` - // Indicates how to allocate instance types to fulfill On-Demand capacity. - // - // The only valid value is prioritized, which is also the default value. This - // strategy uses the order of instance type overrides for the LaunchTemplate - // to define the launch priority of each instance type. The first instance type - // in the array is prioritized higher than the last. If all your On-Demand capacity - // cannot be fulfilled using your highest priority instance, then the Auto Scaling - // groups launches the remaining capacity using the second priority instance - // type, and so on. - OnDemandAllocationStrategy *string `type:"string"` + // The number of instances remaining to update. + InstancesToUpdate *int64 `type:"integer"` + + // The percentage of instances in the Auto Scaling group that have been replaced. + // For each instance replacement, Amazon EC2 Auto Scaling tracks the instance's + // health status and warm-up time. When the instance's health status changes + // to healthy and the specified warm-up time passes, the instance is considered + // updated and is added to the percentage complete. + PercentageComplete *int64 `type:"integer"` +} + +// String returns the string representation +func (s InstanceRefreshLivePoolProgress) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceRefreshLivePoolProgress) GoString() string { + return s.String() +} + +// SetInstancesToUpdate sets the InstancesToUpdate field's value. +func (s *InstanceRefreshLivePoolProgress) SetInstancesToUpdate(v int64) *InstanceRefreshLivePoolProgress { + s.InstancesToUpdate = &v + return s +} + +// SetPercentageComplete sets the PercentageComplete field's value. +func (s *InstanceRefreshLivePoolProgress) SetPercentageComplete(v int64) *InstanceRefreshLivePoolProgress { + s.PercentageComplete = &v + return s +} + +// Reports the progress of an instance refresh on an Auto Scaling group that +// has a warm pool. This includes separate details for instances in the warm +// pool and instances in the Auto Scaling group (the live pool). +type InstanceRefreshProgressDetails struct { + _ struct{} `type:"structure"` + + // Indicates the progress of an instance refresh on instances that are in the + // Auto Scaling group. + LivePoolProgress *InstanceRefreshLivePoolProgress `type:"structure"` + + // Indicates the progress of an instance refresh on instances that are in the + // warm pool. + WarmPoolProgress *InstanceRefreshWarmPoolProgress `type:"structure"` +} + +// String returns the string representation +func (s InstanceRefreshProgressDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceRefreshProgressDetails) GoString() string { + return s.String() +} + +// SetLivePoolProgress sets the LivePoolProgress field's value. +func (s *InstanceRefreshProgressDetails) SetLivePoolProgress(v *InstanceRefreshLivePoolProgress) *InstanceRefreshProgressDetails { + s.LivePoolProgress = v + return s +} + +// SetWarmPoolProgress sets the WarmPoolProgress field's value. +func (s *InstanceRefreshProgressDetails) SetWarmPoolProgress(v *InstanceRefreshWarmPoolProgress) *InstanceRefreshProgressDetails { + s.WarmPoolProgress = v + return s +} + +// Reports the progress of an instance refresh on instances that are in the +// warm pool. +type InstanceRefreshWarmPoolProgress struct { + _ struct{} `type:"structure"` + + // The number of instances remaining to update. + InstancesToUpdate *int64 `type:"integer"` + + // The percentage of instances in the warm pool that have been replaced. For + // each instance replacement, Amazon EC2 Auto Scaling tracks the instance's + // health status and warm-up time. When the instance's health status changes + // to healthy and the specified warm-up time passes, the instance is considered + // updated and is added to the percentage complete. + PercentageComplete *int64 `type:"integer"` +} + +// String returns the string representation +func (s InstanceRefreshWarmPoolProgress) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceRefreshWarmPoolProgress) GoString() string { + return s.String() +} + +// SetInstancesToUpdate sets the InstancesToUpdate field's value. +func (s *InstanceRefreshWarmPoolProgress) SetInstancesToUpdate(v int64) *InstanceRefreshWarmPoolProgress { + s.InstancesToUpdate = &v + return s +} + +// SetPercentageComplete sets the PercentageComplete field's value. +func (s *InstanceRefreshWarmPoolProgress) SetPercentageComplete(v int64) *InstanceRefreshWarmPoolProgress { + s.PercentageComplete = &v + return s +} + +// Describes an instances distribution for an Auto Scaling group with a MixedInstancesPolicy. +// +// The instances distribution specifies the distribution of On-Demand Instances +// and Spot Instances, the maximum price to pay for Spot Instances, and how +// the Auto Scaling group allocates instance types to fulfill On-Demand and +// Spot capacities. +// +// When you update SpotAllocationStrategy, SpotInstancePools, or SpotMaxPrice, +// this update action does not deploy any changes across the running Amazon +// EC2 instances in the group. Your existing Spot Instances continue to run +// as long as the maximum price for those instances is higher than the current +// Spot price. When scale out occurs, Amazon EC2 Auto Scaling launches instances +// based on the new settings. When scale in occurs, Amazon EC2 Auto Scaling +// terminates instances according to the group's termination policies. +type InstancesDistribution struct { + _ struct{} `type:"structure"` + + // Indicates how to allocate instance types to fulfill On-Demand capacity. The + // only valid value is prioritized, which is also the default value. This strategy + // uses the order of instance types in the LaunchTemplateOverrides to define + // the launch priority of each instance type. The first instance type in the + // array is prioritized higher than the last. If all your On-Demand capacity + // cannot be fulfilled using your highest priority instance, then the Auto Scaling + // groups launches the remaining capacity using the second priority instance + // type, and so on. + OnDemandAllocationStrategy *string `type:"string"` // The minimum amount of the Auto Scaling group's capacity that must be fulfilled // by On-Demand Instances. This base portion is provisioned first as your group - // scales. - // - // Default if not set is 0. If you leave it set to 0, On-Demand Instances are - // launched as a percentage of the Auto Scaling group's desired capacity, per - // the OnDemandPercentageAboveBaseCapacity setting. - // - // An update to this setting means a gradual replacement of instances to maintain - // the specified number of On-Demand Instances for your base capacity. When - // replacing instances, Amazon EC2 Auto Scaling launches new instances before - // terminating the old ones. + // scales. Defaults to 0 if not specified. If you specify weights for the instance + // types in the overrides, set the value of OnDemandBaseCapacity in terms of + // the number of capacity units, and not the number of instances. OnDemandBaseCapacity *int64 `type:"integer"` // Controls the percentages of On-Demand Instances and Spot Instances for your - // additional capacity beyond OnDemandBaseCapacity. - // - // Default if not set is 100. If you leave it set to 100, the percentages are - // 100% for On-Demand Instances and 0% for Spot Instances. - // - // An update to this setting means a gradual replacement of instances to maintain - // the percentage of On-Demand Instances for your additional capacity above - // the base capacity. When replacing instances, Amazon EC2 Auto Scaling launches - // new instances before terminating the old ones. - // - // Valid Range: Minimum value of 0. Maximum value of 100. + // additional capacity beyond OnDemandBaseCapacity. Expressed as a number (for + // example, 20 specifies 20% On-Demand Instances, 80% Spot Instances). Defaults + // to 100 if not specified. If set to 100, only On-Demand Instances are provisioned. OnDemandPercentageAboveBaseCapacity *int64 `type:"integer"` // Indicates how to allocate instances across Spot Instance pools. // // If the allocation strategy is lowest-price, the Auto Scaling group launches // instances using the Spot pools with the lowest price, and evenly allocates - // your instances across the number of Spot pools that you specify. If the allocation - // strategy is capacity-optimized, the Auto Scaling group launches instances - // using Spot pools that are optimally chosen based on the available Spot capacity. - // - // The default Spot allocation strategy for calls that you make through the - // API, the AWS CLI, or the AWS SDKs is lowest-price. The default Spot allocation - // strategy for the AWS Management Console is capacity-optimized. - // - // Valid values: lowest-price | capacity-optimized + // your instances across the number of Spot pools that you specify. Defaults + // to lowest-price if not specified. + // + // If the allocation strategy is capacity-optimized (recommended), the Auto + // Scaling group launches instances using Spot pools that are optimally chosen + // based on the available Spot capacity. Alternatively, you can use capacity-optimized-prioritized + // and set the order of instance types in the list of launch template overrides + // from highest to lowest priority (from first to last in the list). Amazon + // EC2 Auto Scaling honors the instance type priorities on a best-effort basis + // but optimizes for capacity first. SpotAllocationStrategy *string `type:"string"` // The number of Spot Instance pools across which to allocate your Spot Instances. - // The Spot pools are determined from the different instance types in the Overrides - // array of LaunchTemplate. Default if not set is 2. - // - // Used only when the Spot allocation strategy is lowest-price. - // - // Valid Range: Minimum value of 1. Maximum value of 20. + // The Spot pools are determined from the different instance types in the overrides. + // Valid only when the Spot allocation strategy is lowest-price. Value must + // be in the range of 1 to 20. Defaults to 2 if not specified. SpotInstancePools *int64 `type:"integer"` // The maximum price per unit hour that you are willing to pay for a Spot Instance. - // If you leave the value of this parameter blank (which is the default), the - // maximum Spot price is set at the On-Demand price. - // - // To remove a value that you previously set, include the parameter but leave - // the value blank. + // If you leave the value at its default (empty), Amazon EC2 Auto Scaling uses + // the On-Demand price as the maximum Spot price. To remove a value that you + // previously set, include the property but specify an empty string ("") for + // the value. SpotMaxPrice *string `type:"string"` } @@ -11230,23 +12177,20 @@ type LaunchConfiguration struct { _ struct{} `type:"structure"` // For Auto Scaling groups that are running in a VPC, specifies whether to assign - // a public IP address to the group's instances. - // - // For more information, see Launching Auto Scaling Instances in a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) + // a public IP address to the group's instances. For more information, see Launching + // Auto Scaling instances in a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html) // in the Amazon EC2 Auto Scaling User Guide. AssociatePublicIpAddress *bool `type:"boolean"` // A block device mapping, which specifies the block devices for the instance. - // // For more information, see Block Device Mapping (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) // in the Amazon EC2 User Guide for Linux Instances. BlockDeviceMappings []*BlockDeviceMapping `type:"list"` // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. - // // For more information, see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic - // Instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) + // instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) // in the Amazon EC2 Auto Scaling User Guide. ClassicLinkVPCId *string `min:"1" type:"string"` @@ -11254,7 +12198,7 @@ type LaunchConfiguration struct { // // For more information, see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic - // Instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) + // instances to a VPC (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink) // in the Amazon EC2 Auto Scaling User Guide. ClassicLinkVPCSecurityGroups []*string `type:"list"` @@ -11264,23 +12208,19 @@ type LaunchConfiguration struct { CreatedTime *time.Time `type:"timestamp" required:"true"` // Specifies whether the launch configuration is optimized for EBS I/O (true) - // or not (false). - // - // For more information, see Amazon EBS-Optimized Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) - // in the Amazon EC2 User Guide for Linux Instances. + // or not (false). For more information, see Amazon EBS-Optimized Instances + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) in + // the Amazon EC2 User Guide for Linux Instances. EbsOptimized *bool `type:"boolean"` // The name or the Amazon Resource Name (ARN) of the instance profile associated // with the IAM role for the instance. The instance profile contains the IAM - // role. - // - // For more information, see IAM Role for Applications That Run on Amazon EC2 - // Instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html) + // role. For more information, see IAM role for applications that run on Amazon + // EC2 instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html) // in the Amazon EC2 Auto Scaling User Guide. IamInstanceProfile *string `min:"1" type:"string"` // The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. - // // For more information, see Finding an AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html) // in the Amazon EC2 User Guide for Linux Instances. // @@ -11330,7 +12270,8 @@ type LaunchConfiguration struct { // dedicated tenancy runs on isolated, single-tenant hardware and can only be // launched into a VPC. // - // For more information, see Instance Placement Tenancy (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-vpc-tenancy) + // For more information, see Configuring instance tenancy with Amazon EC2 Auto + // Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-dedicated-instances.html) // in the Amazon EC2 Auto Scaling User Guide. PlacementTenancy *string `min:"1" type:"string"` @@ -11338,25 +12279,24 @@ type LaunchConfiguration struct { RamdiskId *string `min:"1" type:"string"` // A list that contains the security groups to assign to the instances in the - // Auto Scaling group. - // - // For more information, see Security Groups for Your VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) + // Auto Scaling group. For more information, see Security Groups for Your VPC + // (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) // in the Amazon Virtual Private Cloud User Guide. SecurityGroups []*string `type:"list"` // The maximum hourly price to be paid for any Spot Instance launched to fulfill // the request. Spot Instances are launched when the price you specify exceeds - // the current Spot price. - // - // For more information, see Launching Spot Instances in Your Auto Scaling Group + // the current Spot price. For more information, see Requesting Spot Instances // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html) // in the Amazon EC2 Auto Scaling User Guide. SpotPrice *string `min:"1" type:"string"` - // The Base64-encoded user data to make available to the launched EC2 instances. - // - // For more information, see Instance Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) - // in the Amazon EC2 User Guide for Linux Instances. + // The user data to make available to the launched EC2 instances. For more information, + // see Instance metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) + // (Linux) and Instance metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html) + // (Windows). If you are using a command line tool, base64-encoding is performed + // for you, and you can load the text from a file. Otherwise, you must provide + // base64-encoded text. User data is limited to 16 KB. UserData *string `type:"string"` } @@ -11492,9 +12432,7 @@ func (s *LaunchConfiguration) SetUserData(v string) *LaunchConfiguration { // Describes a launch template and overrides. // -// The overrides are used to override the instance type specified by the launch -// template with multiple instance types that can be used to launch On-Demand -// Instances and Spot Instances. +// You specify these properties as part of a mixed instances policy. // // When you update the launch template or overrides, existing Amazon EC2 instances // continue to run. When scale out occurs, Amazon EC2 Auto Scaling launches @@ -11503,16 +12441,12 @@ func (s *LaunchConfiguration) SetUserData(v string) *LaunchConfiguration { type LaunchTemplate struct { _ struct{} `type:"structure"` - // The launch template to use. You must specify either the launch template ID - // or launch template name in the request. + // The launch template to use. LaunchTemplateSpecification *LaunchTemplateSpecification `type:"structure"` - // Any parameters that you specify override the same parameters in the launch - // template. Currently, the only supported override is instance type. You can - // specify between 1 and 20 instance types. - // - // If not provided, Amazon EC2 Auto Scaling will use the instance type specified - // in the launch template to launch instances. + // Any properties that you specify override the same properties in the launch + // template. If not provided, Amazon EC2 Auto Scaling uses the instance type + // specified in the launch template when it launches an instance. Overrides []*LaunchTemplateOverrides `type:"list"` } @@ -11563,33 +12497,41 @@ func (s *LaunchTemplate) SetOverrides(v []*LaunchTemplateOverrides) *LaunchTempl return s } -// Describes an override for a launch template. Currently, the only supported -// override is instance type. -// -// The maximum number of instance type overrides that can be associated with -// an Auto Scaling group is 20. +// Describes an override for a launch template. The maximum number of instance +// types that can be associated with an Auto Scaling group is 40. The maximum +// number of distinct launch templates you can define for an Auto Scaling group +// is 20. For more information about configuring overrides, see Configuring +// overrides (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-override-options.html) +// in the Amazon EC2 Auto Scaling User Guide. type LaunchTemplateOverrides struct { _ struct{} `type:"structure"` - // The instance type. You must use an instance type that is supported in your - // requested Region and Availability Zones. - // - // For information about available instance types, see Available Instance Types - // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes) + // The instance type, such as m3.xlarge. You must use an instance type that + // is supported in your requested Region and Availability Zones. For more information, + // see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) // in the Amazon Elastic Compute Cloud User Guide. InstanceType *string `min:"1" type:"string"` - // The number of capacity units, which gives the instance type a proportional - // weight to other instance types. For example, larger instance types are generally - // weighted more than smaller instance types. These are the same units that - // you chose to set the desired capacity in terms of instances, or a performance - // attribute such as vCPUs, memory, or I/O. - // - // For more information, see Instance Weighting for Amazon EC2 Auto Scaling - // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-weighting.html) + // Provides the launch template to be used when launching the instance type. + // For example, some instance types might require a launch template with a different + // AMI. If not provided, Amazon EC2 Auto Scaling uses the launch template that's + // defined for your mixed instances policy. For more information, see Specifying + // a different launch template for an instance type (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-template-overrides.html) // in the Amazon EC2 Auto Scaling User Guide. - // - // Valid Range: Minimum value of 1. Maximum value of 999. + LaunchTemplateSpecification *LaunchTemplateSpecification `type:"structure"` + + // The number of capacity units provided by the specified instance type in terms + // of virtual CPUs, memory, storage, throughput, or other relative performance + // characteristic. When a Spot or On-Demand Instance is provisioned, the capacity + // units count toward the desired capacity. Amazon EC2 Auto Scaling provisions + // instances until the desired capacity is totally fulfilled, even if this results + // in an overage. For example, if there are 2 units remaining to fulfill capacity, + // and Amazon EC2 Auto Scaling can only provision an instance with a WeightedCapacity + // of 5 units, the instance is provisioned, and the desired capacity is exceeded + // by 3 units. For more information, see Instance weighting for Amazon EC2 Auto + // Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-weighting.html) + // in the Amazon EC2 Auto Scaling User Guide. Value must be in the range of + // 1 to 999. WeightedCapacity *string `min:"1" type:"string"` } @@ -11612,6 +12554,11 @@ func (s *LaunchTemplateOverrides) Validate() error { if s.WeightedCapacity != nil && len(*s.WeightedCapacity) < 1 { invalidParams.Add(request.NewErrParamMinLen("WeightedCapacity", 1)) } + if s.LaunchTemplateSpecification != nil { + if err := s.LaunchTemplateSpecification.Validate(); err != nil { + invalidParams.AddNested("LaunchTemplateSpecification", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -11625,6 +12572,12 @@ func (s *LaunchTemplateOverrides) SetInstanceType(v string) *LaunchTemplateOverr return s } +// SetLaunchTemplateSpecification sets the LaunchTemplateSpecification field's value. +func (s *LaunchTemplateOverrides) SetLaunchTemplateSpecification(v *LaunchTemplateSpecification) *LaunchTemplateOverrides { + s.LaunchTemplateSpecification = v + return s +} + // SetWeightedCapacity sets the WeightedCapacity field's value. func (s *LaunchTemplateOverrides) SetWeightedCapacity(v string) *LaunchTemplateOverrides { s.WeightedCapacity = &v @@ -11635,8 +12588,8 @@ func (s *LaunchTemplateOverrides) SetWeightedCapacity(v string) *LaunchTemplateO // that can be used by an Auto Scaling group to configure Amazon EC2 instances. // // The launch template that is specified must be configured for use with an -// Auto Scaling group. For more information, see Creating a Launch Template -// for an Auto Scaling Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) +// Auto Scaling group. For more information, see Creating a launch template +// for an Auto Scaling group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) // in the Amazon EC2 Auto Scaling User Guide. type LaunchTemplateSpecification struct { _ struct{} `type:"structure"` @@ -11647,7 +12600,7 @@ type LaunchTemplateSpecification struct { // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html) // API. // - // You must specify either a template ID or a template name. + // Conditional: You must specify either a LaunchTemplateId or a LaunchTemplateName. LaunchTemplateId *string `min:"1" type:"string"` // The name of the launch template. To get the template name, use the Amazon @@ -11656,19 +12609,17 @@ type LaunchTemplateSpecification struct { // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html) // API. // - // You must specify either a template ID or a template name. + // Conditional: You must specify either a LaunchTemplateId or a LaunchTemplateName. LaunchTemplateName *string `min:"3" type:"string"` // The version number, $Latest, or $Default. To get the version number, use // the Amazon EC2 DescribeLaunchTemplateVersions (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplateVersions.html) // API operation. New launch template versions can be created using the Amazon // EC2 CreateLaunchTemplateVersion (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplateVersion.html) - // API. - // - // If the value is $Latest, Amazon EC2 Auto Scaling selects the latest version - // of the launch template when launching instances. If the value is $Default, - // Amazon EC2 Auto Scaling selects the default version of the launch template - // when launching instances. The default value is $Default. + // API. If the value is $Latest, Amazon EC2 Auto Scaling selects the latest + // version of the launch template when launching instances. If the value is + // $Default, Amazon EC2 Auto Scaling selects the default version of the launch + // template when launching instances. The default value is $Default. Version *string `min:"1" type:"string"` } @@ -11760,7 +12711,7 @@ type LifecycleHook struct { // The ARN of the target that Amazon EC2 Auto Scaling sends notifications to // when an instance is in the transition state for the lifecycle hook. The notification // target can be either an SQS queue or an SNS topic. - NotificationTargetARN *string `min:"1" type:"string"` + NotificationTargetARN *string `type:"string"` // The ARN of the IAM role that allows the Auto Scaling group to publish to // the specified notification target. @@ -11857,7 +12808,7 @@ func (s *LifecycleHook) SetRoleARN(v string) *LifecycleHook { // // If you finish before the timeout period ends, complete the lifecycle action. // -// For more information, see Amazon EC2 Auto Scaling Lifecycle Hooks (https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) +// For more information, see Amazon EC2 Auto Scaling lifecycle hooks (https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) // in the Amazon EC2 Auto Scaling User Guide. type LifecycleHookSpecification struct { _ struct{} `type:"structure"` @@ -12096,6 +13047,56 @@ func (s *LoadBalancerTargetGroupState) SetState(v string) *LoadBalancerTargetGro return s } +// A GetPredictiveScalingForecast call returns the load forecast for a predictive +// scaling policy. This structure includes the data points for that load forecast, +// along with the timestamps of those data points and the metric specification. +type LoadForecast struct { + _ struct{} `type:"structure"` + + // The metric specification for the load forecast. + // + // MetricSpecification is a required field + MetricSpecification *PredictiveScalingMetricSpecification `type:"structure" required:"true"` + + // The time stamps for the data points, in UTC format. + // + // Timestamps is a required field + Timestamps []*time.Time `type:"list" required:"true"` + + // The values of the data points. + // + // Values is a required field + Values []*float64 `type:"list" required:"true"` +} + +// String returns the string representation +func (s LoadForecast) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoadForecast) GoString() string { + return s.String() +} + +// SetMetricSpecification sets the MetricSpecification field's value. +func (s *LoadForecast) SetMetricSpecification(v *PredictiveScalingMetricSpecification) *LoadForecast { + s.MetricSpecification = v + return s +} + +// SetTimestamps sets the Timestamps field's value. +func (s *LoadForecast) SetTimestamps(v []*time.Time) *LoadForecast { + s.Timestamps = v + return s +} + +// SetValues sets the Values field's value. +func (s *LoadForecast) SetValues(v []*float64) *LoadForecast { + s.Values = v + return s +} + // Describes a metric. type MetricCollectionType struct { _ struct{} `type:"structure"` @@ -12127,6 +13128,20 @@ type MetricCollectionType struct { // * GroupTerminatingCapacity // // * GroupTotalCapacity + // + // * WarmPoolDesiredCapacity + // + // * WarmPoolWarmedCapacity + // + // * WarmPoolPendingCapacity + // + // * WarmPoolTerminatingCapacity + // + // * WarmPoolTotalCapacity + // + // * GroupAndWarmPoolDesiredCapacity + // + // * GroupAndWarmPoolTotalCapacity Metric *string `min:"1" type:"string"` } @@ -12226,26 +13241,23 @@ func (s *MetricGranularityType) SetGranularity(v string) *MetricGranularityType // Describes a mixed instances policy for an Auto Scaling group. With mixed // instances, your Auto Scaling group can provision a combination of On-Demand // Instances and Spot Instances across multiple instance types. For more information, -// see Auto Scaling Groups with Multiple Instance Types and Purchase Options +// see Auto Scaling groups with multiple instance types and purchase options // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) // in the Amazon EC2 Auto Scaling User Guide. // // You can create a mixed instances policy for a new Auto Scaling group, or // you can create it for an existing group by updating the group to specify -// MixedInstancesPolicy as the top-level parameter instead of a launch configuration -// or launch template. For more information, see CreateAutoScalingGroup and -// UpdateAutoScalingGroup. +// MixedInstancesPolicy as the top-level property instead of a launch configuration +// or launch template. type MixedInstancesPolicy struct { _ struct{} `type:"structure"` - // The instances distribution to use. - // - // If you leave this parameter unspecified, the value for each parameter in - // InstancesDistribution uses a default value. + // Specifies the instances distribution. If not provided, the value for each + // property in InstancesDistribution uses a default value. InstancesDistribution *InstancesDistribution `type:"structure"` - // The launch template and instance types (overrides). - // + // Specifies the launch template to use and optionally the instance types (overrides) + // that are used to provision EC2 instances to fulfill On-Demand and Spot capacities. // Required when creating a mixed instances policy. LaunchTemplate *LaunchTemplate `type:"structure"` } @@ -12360,16 +13372,495 @@ type PredefinedMetricSpecification struct { // an Application Load Balancer target group. // // PredefinedMetricType is a required field - PredefinedMetricType *string `type:"string" required:"true" enum:"MetricType"` + PredefinedMetricType *string `type:"string" required:"true" enum:"MetricType"` + + // Identifies the resource associated with the metric type. You can't specify + // a resource label unless the metric type is ALBRequestCountPerTarget and there + // is a target group attached to the Auto Scaling group. + // + // You create the resource label by appending the final portion of the load + // balancer ARN and the final portion of the target group ARN into a single + // value, separated by a forward slash (/). The format is app///targetgroup//, + // where: + // + // * app// is the final portion of + // the load balancer ARN + // + // * targetgroup// is the final portion + // of the target group ARN. + // + // This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d. + // + // To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers + // (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) + // API operation. To find the ARN for the target group, use the DescribeTargetGroups + // (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) + // API operation. + ResourceLabel *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PredefinedMetricSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PredefinedMetricSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PredefinedMetricSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PredefinedMetricSpecification"} + if s.PredefinedMetricType == nil { + invalidParams.Add(request.NewErrParamRequired("PredefinedMetricType")) + } + if s.ResourceLabel != nil && len(*s.ResourceLabel) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceLabel", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPredefinedMetricType sets the PredefinedMetricType field's value. +func (s *PredefinedMetricSpecification) SetPredefinedMetricType(v string) *PredefinedMetricSpecification { + s.PredefinedMetricType = &v + return s +} + +// SetResourceLabel sets the ResourceLabel field's value. +func (s *PredefinedMetricSpecification) SetResourceLabel(v string) *PredefinedMetricSpecification { + s.ResourceLabel = &v + return s +} + +// Represents a predictive scaling policy configuration to use with Amazon EC2 +// Auto Scaling. +type PredictiveScalingConfiguration struct { + _ struct{} `type:"structure"` + + // Defines the behavior that should be applied if the forecast capacity approaches + // or exceeds the maximum capacity of the Auto Scaling group. Defaults to HonorMaxCapacity + // if not specified. + // + // The following are possible values: + // + // * HonorMaxCapacity - Amazon EC2 Auto Scaling cannot scale out capacity + // higher than the maximum capacity. The maximum capacity is enforced as + // a hard limit. + // + // * IncreaseMaxCapacity - Amazon EC2 Auto Scaling can scale out capacity + // higher than the maximum capacity when the forecast capacity is close to + // or exceeds the maximum capacity. The upper limit is determined by the + // forecasted capacity and the value for MaxCapacityBuffer. + MaxCapacityBreachBehavior *string `type:"string" enum:"PredictiveScalingMaxCapacityBreachBehavior"` + + // The size of the capacity buffer to use when the forecast capacity is close + // to or exceeds the maximum capacity. The value is specified as a percentage + // relative to the forecast capacity. For example, if the buffer is 10, this + // means a 10 percent buffer, such that if the forecast capacity is 50, and + // the maximum capacity is 40, then the effective maximum capacity is 55. + // + // If set to 0, Amazon EC2 Auto Scaling may scale capacity higher than the maximum + // capacity to equal but not exceed forecast capacity. + // + // Required if the MaxCapacityBreachBehavior property is set to IncreaseMaxCapacity, + // and cannot be used otherwise. + MaxCapacityBuffer *int64 `type:"integer"` + + // This structure includes the metrics and target utilization to use for predictive + // scaling. + // + // This is an array, but we currently only support a single metric specification. + // That is, you can specify a target value and a single metric pair, or a target + // value and one scaling metric and one load metric. + // + // MetricSpecifications is a required field + MetricSpecifications []*PredictiveScalingMetricSpecification `type:"list" required:"true"` + + // The predictive scaling mode. Defaults to ForecastOnly if not specified. + Mode *string `type:"string" enum:"PredictiveScalingMode"` + + // The amount of time, in seconds, by which the instance launch time can be + // advanced. For example, the forecast says to add capacity at 10:00 AM, and + // you choose to pre-launch instances by 5 minutes. In that case, the instances + // will be launched at 9:55 AM. The intention is to give resources time to be + // provisioned. It can take a few minutes to launch an EC2 instance. The actual + // amount of time required depends on several factors, such as the size of the + // instance and whether there are startup scripts to complete. + // + // The value must be less than the forecast interval duration of 3600 seconds + // (60 minutes). Defaults to 300 seconds if not specified. + SchedulingBufferTime *int64 `type:"integer"` +} + +// String returns the string representation +func (s PredictiveScalingConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PredictiveScalingConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PredictiveScalingConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PredictiveScalingConfiguration"} + if s.MetricSpecifications == nil { + invalidParams.Add(request.NewErrParamRequired("MetricSpecifications")) + } + if s.MetricSpecifications != nil { + for i, v := range s.MetricSpecifications { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricSpecifications", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxCapacityBreachBehavior sets the MaxCapacityBreachBehavior field's value. +func (s *PredictiveScalingConfiguration) SetMaxCapacityBreachBehavior(v string) *PredictiveScalingConfiguration { + s.MaxCapacityBreachBehavior = &v + return s +} + +// SetMaxCapacityBuffer sets the MaxCapacityBuffer field's value. +func (s *PredictiveScalingConfiguration) SetMaxCapacityBuffer(v int64) *PredictiveScalingConfiguration { + s.MaxCapacityBuffer = &v + return s +} + +// SetMetricSpecifications sets the MetricSpecifications field's value. +func (s *PredictiveScalingConfiguration) SetMetricSpecifications(v []*PredictiveScalingMetricSpecification) *PredictiveScalingConfiguration { + s.MetricSpecifications = v + return s +} + +// SetMode sets the Mode field's value. +func (s *PredictiveScalingConfiguration) SetMode(v string) *PredictiveScalingConfiguration { + s.Mode = &v + return s +} + +// SetSchedulingBufferTime sets the SchedulingBufferTime field's value. +func (s *PredictiveScalingConfiguration) SetSchedulingBufferTime(v int64) *PredictiveScalingConfiguration { + s.SchedulingBufferTime = &v + return s +} + +// This structure specifies the metrics and target utilization settings for +// a predictive scaling policy. +// +// You must specify either a metric pair, or a load metric and a scaling metric +// individually. Specifying a metric pair instead of individual metrics provides +// a simpler way to configure metrics for a scaling policy. You choose the metric +// pair, and the policy automatically knows the correct sum and average statistics +// to use for the load metric and the scaling metric. +// +// Example +// +// * You create a predictive scaling policy and specify ALBRequestCount as +// the value for the metric pair and 1000.0 as the target value. For this +// type of metric, you must provide the metric dimension for the corresponding +// target group, so you also provide a resource label for the Application +// Load Balancer target group that is attached to your Auto Scaling group. +// +// * The number of requests the target group receives per minute provides +// the load metric, and the request count averaged between the members of +// the target group provides the scaling metric. In CloudWatch, this refers +// to the RequestCount and RequestCountPerTarget metrics, respectively. +// +// * For optimal use of predictive scaling, you adhere to the best practice +// of using a dynamic scaling policy to automatically scale between the minimum +// capacity and maximum capacity in response to real-time changes in resource +// utilization. +// +// * Amazon EC2 Auto Scaling consumes data points for the load metric over +// the last 14 days and creates an hourly load forecast for predictive scaling. +// (A minimum of 24 hours of data is required.) +// +// * After creating the load forecast, Amazon EC2 Auto Scaling determines +// when to reduce or increase the capacity of your Auto Scaling group in +// each hour of the forecast period so that the average number of requests +// received by each instance is as close to 1000 requests per minute as possible +// at all times. +type PredictiveScalingMetricSpecification struct { + _ struct{} `type:"structure"` + + // The load metric specification. + PredefinedLoadMetricSpecification *PredictiveScalingPredefinedLoadMetric `type:"structure"` + + // The metric pair specification from which Amazon EC2 Auto Scaling determines + // the appropriate scaling metric and load metric to use. + PredefinedMetricPairSpecification *PredictiveScalingPredefinedMetricPair `type:"structure"` + + // The scaling metric specification. + PredefinedScalingMetricSpecification *PredictiveScalingPredefinedScalingMetric `type:"structure"` + + // Specifies the target utilization. + // + // TargetValue is a required field + TargetValue *float64 `type:"double" required:"true"` +} + +// String returns the string representation +func (s PredictiveScalingMetricSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PredictiveScalingMetricSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PredictiveScalingMetricSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PredictiveScalingMetricSpecification"} + if s.TargetValue == nil { + invalidParams.Add(request.NewErrParamRequired("TargetValue")) + } + if s.PredefinedLoadMetricSpecification != nil { + if err := s.PredefinedLoadMetricSpecification.Validate(); err != nil { + invalidParams.AddNested("PredefinedLoadMetricSpecification", err.(request.ErrInvalidParams)) + } + } + if s.PredefinedMetricPairSpecification != nil { + if err := s.PredefinedMetricPairSpecification.Validate(); err != nil { + invalidParams.AddNested("PredefinedMetricPairSpecification", err.(request.ErrInvalidParams)) + } + } + if s.PredefinedScalingMetricSpecification != nil { + if err := s.PredefinedScalingMetricSpecification.Validate(); err != nil { + invalidParams.AddNested("PredefinedScalingMetricSpecification", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPredefinedLoadMetricSpecification sets the PredefinedLoadMetricSpecification field's value. +func (s *PredictiveScalingMetricSpecification) SetPredefinedLoadMetricSpecification(v *PredictiveScalingPredefinedLoadMetric) *PredictiveScalingMetricSpecification { + s.PredefinedLoadMetricSpecification = v + return s +} + +// SetPredefinedMetricPairSpecification sets the PredefinedMetricPairSpecification field's value. +func (s *PredictiveScalingMetricSpecification) SetPredefinedMetricPairSpecification(v *PredictiveScalingPredefinedMetricPair) *PredictiveScalingMetricSpecification { + s.PredefinedMetricPairSpecification = v + return s +} + +// SetPredefinedScalingMetricSpecification sets the PredefinedScalingMetricSpecification field's value. +func (s *PredictiveScalingMetricSpecification) SetPredefinedScalingMetricSpecification(v *PredictiveScalingPredefinedScalingMetric) *PredictiveScalingMetricSpecification { + s.PredefinedScalingMetricSpecification = v + return s +} + +// SetTargetValue sets the TargetValue field's value. +func (s *PredictiveScalingMetricSpecification) SetTargetValue(v float64) *PredictiveScalingMetricSpecification { + s.TargetValue = &v + return s +} + +// Describes a load metric for a predictive scaling policy. +// +// When returned in the output of DescribePolicies, it indicates that a predictive +// scaling policy uses individually specified load and scaling metrics instead +// of a metric pair. +type PredictiveScalingPredefinedLoadMetric struct { + _ struct{} `type:"structure"` + + // The metric type. + // + // PredefinedMetricType is a required field + PredefinedMetricType *string `type:"string" required:"true" enum:"PredefinedLoadMetricType"` + + // A label that uniquely identifies a specific Application Load Balancer target + // group from which to determine the request count served by your Auto Scaling + // group. You can't specify a resource label unless the target group is attached + // to the Auto Scaling group. + // + // You create the resource label by appending the final portion of the load + // balancer ARN and the final portion of the target group ARN into a single + // value, separated by a forward slash (/). The format of the resource label + // is: + // + // app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d. + // + // Where: + // + // * app// is the final portion of + // the load balancer ARN + // + // * targetgroup// is the final portion + // of the target group ARN. + // + // To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers + // (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) + // API operation. To find the ARN for the target group, use the DescribeTargetGroups + // (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) + // API operation. + ResourceLabel *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PredictiveScalingPredefinedLoadMetric) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PredictiveScalingPredefinedLoadMetric) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PredictiveScalingPredefinedLoadMetric) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PredictiveScalingPredefinedLoadMetric"} + if s.PredefinedMetricType == nil { + invalidParams.Add(request.NewErrParamRequired("PredefinedMetricType")) + } + if s.ResourceLabel != nil && len(*s.ResourceLabel) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceLabel", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPredefinedMetricType sets the PredefinedMetricType field's value. +func (s *PredictiveScalingPredefinedLoadMetric) SetPredefinedMetricType(v string) *PredictiveScalingPredefinedLoadMetric { + s.PredefinedMetricType = &v + return s +} + +// SetResourceLabel sets the ResourceLabel field's value. +func (s *PredictiveScalingPredefinedLoadMetric) SetResourceLabel(v string) *PredictiveScalingPredefinedLoadMetric { + s.ResourceLabel = &v + return s +} + +// Represents a metric pair for a predictive scaling policy. +type PredictiveScalingPredefinedMetricPair struct { + _ struct{} `type:"structure"` + + // Indicates which metrics to use. There are two different types of metrics + // for each metric type: one is a load metric and one is a scaling metric. For + // example, if the metric type is ASGCPUUtilization, the Auto Scaling group's + // total CPU metric is used as the load metric, and the average CPU metric is + // used for the scaling metric. + // + // PredefinedMetricType is a required field + PredefinedMetricType *string `type:"string" required:"true" enum:"PredefinedMetricPairType"` + + // A label that uniquely identifies a specific Application Load Balancer target + // group from which to determine the request count served by your Auto Scaling + // group. You can't specify a resource label unless the target group is attached + // to the Auto Scaling group. + // + // You create the resource label by appending the final portion of the load + // balancer ARN and the final portion of the target group ARN into a single + // value, separated by a forward slash (/). The format of the resource label + // is: + // + // app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d. + // + // Where: + // + // * app// is the final portion of + // the load balancer ARN + // + // * targetgroup// is the final portion + // of the target group ARN. + // + // To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers + // (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) + // API operation. To find the ARN for the target group, use the DescribeTargetGroups + // (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) + // API operation. + ResourceLabel *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PredictiveScalingPredefinedMetricPair) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PredictiveScalingPredefinedMetricPair) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PredictiveScalingPredefinedMetricPair) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PredictiveScalingPredefinedMetricPair"} + if s.PredefinedMetricType == nil { + invalidParams.Add(request.NewErrParamRequired("PredefinedMetricType")) + } + if s.ResourceLabel != nil && len(*s.ResourceLabel) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceLabel", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPredefinedMetricType sets the PredefinedMetricType field's value. +func (s *PredictiveScalingPredefinedMetricPair) SetPredefinedMetricType(v string) *PredictiveScalingPredefinedMetricPair { + s.PredefinedMetricType = &v + return s +} + +// SetResourceLabel sets the ResourceLabel field's value. +func (s *PredictiveScalingPredefinedMetricPair) SetResourceLabel(v string) *PredictiveScalingPredefinedMetricPair { + s.ResourceLabel = &v + return s +} + +// Describes a scaling metric for a predictive scaling policy. +// +// When returned in the output of DescribePolicies, it indicates that a predictive +// scaling policy uses individually specified load and scaling metrics instead +// of a metric pair. +type PredictiveScalingPredefinedScalingMetric struct { + _ struct{} `type:"structure"` + + // The metric type. + // + // PredefinedMetricType is a required field + PredefinedMetricType *string `type:"string" required:"true" enum:"PredefinedScalingMetricType"` - // Identifies the resource associated with the metric type. You can't specify - // a resource label unless the metric type is ALBRequestCountPerTarget and there - // is a target group attached to the Auto Scaling group. + // A label that uniquely identifies a specific Application Load Balancer target + // group from which to determine the request count served by your Auto Scaling + // group. You can't specify a resource label unless the target group is attached + // to the Auto Scaling group. // // You create the resource label by appending the final portion of the load // balancer ARN and the final portion of the target group ARN into a single - // value, separated by a forward slash (/). The format is app///targetgroup//, - // where: + // value, separated by a forward slash (/). The format of the resource label + // is: + // + // app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d. + // + // Where: // // * app// is the final portion of // the load balancer ARN @@ -12377,8 +13868,6 @@ type PredefinedMetricSpecification struct { // * targetgroup// is the final portion // of the target group ARN. // - // This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d. - // // To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers // (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) // API operation. To find the ARN for the target group, use the DescribeTargetGroups @@ -12388,18 +13877,18 @@ type PredefinedMetricSpecification struct { } // String returns the string representation -func (s PredefinedMetricSpecification) String() string { +func (s PredictiveScalingPredefinedScalingMetric) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PredefinedMetricSpecification) GoString() string { +func (s PredictiveScalingPredefinedScalingMetric) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *PredefinedMetricSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PredefinedMetricSpecification"} +func (s *PredictiveScalingPredefinedScalingMetric) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PredictiveScalingPredefinedScalingMetric"} if s.PredefinedMetricType == nil { invalidParams.Add(request.NewErrParamRequired("PredefinedMetricType")) } @@ -12414,20 +13903,20 @@ func (s *PredefinedMetricSpecification) Validate() error { } // SetPredefinedMetricType sets the PredefinedMetricType field's value. -func (s *PredefinedMetricSpecification) SetPredefinedMetricType(v string) *PredefinedMetricSpecification { +func (s *PredictiveScalingPredefinedScalingMetric) SetPredefinedMetricType(v string) *PredictiveScalingPredefinedScalingMetric { s.PredefinedMetricType = &v return s } // SetResourceLabel sets the ResourceLabel field's value. -func (s *PredefinedMetricSpecification) SetResourceLabel(v string) *PredefinedMetricSpecification { +func (s *PredictiveScalingPredefinedScalingMetric) SetResourceLabel(v string) *PredictiveScalingPredefinedScalingMetric { s.ResourceLabel = &v return s } // Describes a process type. // -// For more information, see Scaling Processes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html#process-types) +// For more information, see Scaling processes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html#process-types) // in the Amazon EC2 Auto Scaling User Guide. type ProcessType struct { _ struct{} `type:"structure"` @@ -12733,7 +14222,7 @@ type PutScalingPolicyInput struct { // and PercentChangeInCapacity. // // Required if the policy type is StepScaling or SimpleScaling. For more information, - // see Scaling Adjustment Types (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment) + // see Scaling adjustment types (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment) // in the Amazon EC2 Auto Scaling User Guide. AdjustmentType *string `min:"1" type:"string"` @@ -12747,13 +14236,13 @@ type PutScalingPolicyInput struct { // for the Auto Scaling group. // // Valid only if the policy type is SimpleScaling. For more information, see - // Scaling Cooldowns for Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // Scaling cooldowns for Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) // in the Amazon EC2 Auto Scaling User Guide. Cooldown *int64 `type:"integer"` // Indicates whether the scaling policy is enabled or disabled. The default - // is enabled. For more information, see Disabling a Scaling Policy for an Auto - // Scaling Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enable-disable-scaling-policy.html) + // is enabled. For more information, see Disabling a scaling policy for an Auto + // Scaling group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enable-disable-scaling-policy.html) // in the Amazon EC2 Auto Scaling User Guide. Enabled *bool `type:"boolean"` @@ -12779,7 +14268,7 @@ type PutScalingPolicyInput struct { // of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances. // // Valid only if the policy type is StepScaling or SimpleScaling. For more information, - // see Scaling Adjustment Types (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment) + // see Scaling adjustment types (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment) // in the Amazon EC2 Auto Scaling User Guide. // // Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude @@ -12801,8 +14290,21 @@ type PutScalingPolicyInput struct { // * StepScaling // // * SimpleScaling (default) + // + // * PredictiveScaling PolicyType *string `min:"1" type:"string"` + // A predictive scaling policy. Provides support for only predefined metrics. + // + // Predictive scaling works with CPU utilization, network in/out, and the Application + // Load Balancer request count. + // + // For more information, see PredictiveScalingConfiguration (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PredictiveScalingConfiguration.html) + // in the Amazon EC2 Auto Scaling API Reference. + // + // Required if the policy type is PredictiveScaling. + PredictiveScalingConfiguration *PredictiveScalingConfiguration `type:"structure"` + // The amount by which to scale, based on the specified adjustment type. A positive // value adds to the current capacity while a negative number removes from the // current capacity. For exact capacity, you must specify a positive value. @@ -12818,7 +14320,7 @@ type PutScalingPolicyInput struct { // type.) StepAdjustments []*StepAdjustment `type:"list"` - // A target tracking scaling policy. Includes support for predefined or customized + // A target tracking scaling policy. Provides support for predefined or customized // metrics. // // The following predefined metrics are available: @@ -12875,6 +14377,11 @@ func (s *PutScalingPolicyInput) Validate() error { if s.PolicyType != nil && len(*s.PolicyType) < 1 { invalidParams.Add(request.NewErrParamMinLen("PolicyType", 1)) } + if s.PredictiveScalingConfiguration != nil { + if err := s.PredictiveScalingConfiguration.Validate(); err != nil { + invalidParams.AddNested("PredictiveScalingConfiguration", err.(request.ErrInvalidParams)) + } + } if s.StepAdjustments != nil { for i, v := range s.StepAdjustments { if v == nil { @@ -12957,6 +14464,12 @@ func (s *PutScalingPolicyInput) SetPolicyType(v string) *PutScalingPolicyInput { return s } +// SetPredictiveScalingConfiguration sets the PredictiveScalingConfiguration field's value. +func (s *PutScalingPolicyInput) SetPredictiveScalingConfiguration(v *PredictiveScalingConfiguration) *PutScalingPolicyInput { + s.PredictiveScalingConfiguration = v + return s +} + // SetScalingAdjustment sets the ScalingAdjustment field's value. func (s *PutScalingPolicyInput) SetScalingAdjustment(v int64) *PutScalingPolicyInput { s.ScalingAdjustment = &v @@ -13021,8 +14534,7 @@ type PutScheduledUpdateGroupActionInput struct { // scale beyond this capacity if you add more scaling conditions. DesiredCapacity *int64 `type:"integer"` - // The date and time for the recurring schedule to end. Amazon EC2 Auto Scaling - // does not perform the action after this time. + // The date and time for the recurring schedule to end, in UTC. EndTime *time.Time `type:"timestamp"` // The maximum size of the Auto Scaling group. @@ -13031,14 +14543,15 @@ type PutScheduledUpdateGroupActionInput struct { // The minimum size of the Auto Scaling group. MinSize *int64 `type:"integer"` - // The recurring schedule for this action, in Unix cron syntax format. This - // format consists of five fields separated by white spaces: [Minute] [Hour] - // [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes - // (for example, "30 0 1 1,6,12 *"). For more information about this format, - // see Crontab (http://crontab.org). + // The recurring schedule for this action. This format consists of five fields + // separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] + // [Day_of_Week]. The value must be in quotes (for example, "30 0 1 1,6,12 *"). + // For more information about this format, see Crontab (http://crontab.org). // // When StartTime and EndTime are specified with Recurrence, they form the boundaries // of when the recurring action starts and stops. + // + // Cron expressions use Universal Coordinated Time (UTC) by default. Recurrence *string `min:"1" type:"string"` // The name of this scaling action. @@ -13059,6 +14572,15 @@ type PutScheduledUpdateGroupActionInput struct { // This parameter is no longer used. Time *time.Time `type:"timestamp"` + + // Specifies the time zone for a cron expression. If a time zone is not provided, + // UTC is used by default. + // + // Valid values are the canonical names of the IANA time zones, derived from + // the IANA Time Zone Database (such as Etc/GMT+9 or Pacific/Tahiti). For more + // information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + // (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + TimeZone *string `min:"1" type:"string"` } // String returns the string representation @@ -13089,6 +14611,9 @@ func (s *PutScheduledUpdateGroupActionInput) Validate() error { if s.ScheduledActionName != nil && len(*s.ScheduledActionName) < 1 { invalidParams.Add(request.NewErrParamMinLen("ScheduledActionName", 1)) } + if s.TimeZone != nil && len(*s.TimeZone) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TimeZone", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -13150,6 +14675,12 @@ func (s *PutScheduledUpdateGroupActionInput) SetTime(v time.Time) *PutScheduledU return s } +// SetTimeZone sets the TimeZone field's value. +func (s *PutScheduledUpdateGroupActionInput) SetTimeZone(v string) *PutScheduledUpdateGroupActionInput { + s.TimeZone = &v + return s +} + type PutScheduledUpdateGroupActionOutput struct { _ struct{} `type:"structure"` } @@ -13164,6 +14695,113 @@ func (s PutScheduledUpdateGroupActionOutput) GoString() string { return s.String() } +type PutWarmPoolInput struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group. + // + // AutoScalingGroupName is a required field + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // Specifies the maximum number of instances that are allowed to be in the warm + // pool or in any state except Terminated for the Auto Scaling group. This is + // an optional property. Specify it only if you do not want the warm pool size + // to be determined by the difference between the group's maximum capacity and + // its desired capacity. + // + // If a value for MaxGroupPreparedCapacity is not specified, Amazon EC2 Auto + // Scaling launches and maintains the difference between the group's maximum + // capacity and its desired capacity. If you specify a value for MaxGroupPreparedCapacity, + // Amazon EC2 Auto Scaling uses the difference between the MaxGroupPreparedCapacity + // and the desired capacity instead. + // + // The size of the warm pool is dynamic. Only when MaxGroupPreparedCapacity + // and MinSize are set to the same value does the warm pool have an absolute + // size. + // + // If the desired capacity of the Auto Scaling group is higher than the MaxGroupPreparedCapacity, + // the capacity of the warm pool is 0, unless you specify a value for MinSize. + // To remove a value that you previously set, include the property but specify + // -1 for the value. + MaxGroupPreparedCapacity *int64 `type:"integer"` + + // Specifies the minimum number of instances to maintain in the warm pool. This + // helps you to ensure that there is always a certain number of warmed instances + // available to handle traffic spikes. Defaults to 0 if not specified. + MinSize *int64 `type:"integer"` + + // Sets the instance state to transition to after the lifecycle actions are + // complete. Default is Stopped. + PoolState *string `type:"string" enum:"WarmPoolState"` +} + +// String returns the string representation +func (s PutWarmPoolInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutWarmPoolInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutWarmPoolInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutWarmPoolInput"} + if s.AutoScalingGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupName")) + } + if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) + } + if s.MaxGroupPreparedCapacity != nil && *s.MaxGroupPreparedCapacity < -1 { + invalidParams.Add(request.NewErrParamMinValue("MaxGroupPreparedCapacity", -1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupName sets the AutoScalingGroupName field's value. +func (s *PutWarmPoolInput) SetAutoScalingGroupName(v string) *PutWarmPoolInput { + s.AutoScalingGroupName = &v + return s +} + +// SetMaxGroupPreparedCapacity sets the MaxGroupPreparedCapacity field's value. +func (s *PutWarmPoolInput) SetMaxGroupPreparedCapacity(v int64) *PutWarmPoolInput { + s.MaxGroupPreparedCapacity = &v + return s +} + +// SetMinSize sets the MinSize field's value. +func (s *PutWarmPoolInput) SetMinSize(v int64) *PutWarmPoolInput { + s.MinSize = &v + return s +} + +// SetPoolState sets the PoolState field's value. +func (s *PutWarmPoolInput) SetPoolState(v string) *PutWarmPoolInput { + s.PoolState = &v + return s +} + +type PutWarmPoolOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutWarmPoolOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutWarmPoolOutput) GoString() string { + return s.String() +} + type RecordLifecycleActionHeartbeatInput struct { _ struct{} `type:"structure"` @@ -13263,9 +14901,26 @@ func (s RecordLifecycleActionHeartbeatOutput) GoString() string { } // Describes information used to start an instance refresh. +// +// All properties are optional. However, if you specify a value for CheckpointDelay, +// you must also provide a value for CheckpointPercentages. type RefreshPreferences struct { _ struct{} `type:"structure"` + // The amount of time, in seconds, to wait after a checkpoint before continuing. + // This property is optional, but if you specify a value for it, you must also + // specify a value for CheckpointPercentages. If you specify a value for CheckpointPercentages + // and not for CheckpointDelay, the CheckpointDelay defaults to 3600 (1 hour). + CheckpointDelay *int64 `type:"integer"` + + // Threshold values for each checkpoint in ascending order. Each number must + // be unique. To replace all instances in the Auto Scaling group, the last number + // in the array must be 100. + // + // For usage examples, see Adding checkpoints to an instance refresh (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-adding-checkpoints-instance-refresh.html) + // in the Amazon EC2 Auto Scaling User Guide. + CheckpointPercentages []*int64 `type:"list"` + // The number of seconds until a newly launched instance is configured and ready // to use. During this time, Amazon EC2 Auto Scaling does not immediately move // on to the next replacement. The default is to use the value for the health @@ -13289,6 +14944,18 @@ func (s RefreshPreferences) GoString() string { return s.String() } +// SetCheckpointDelay sets the CheckpointDelay field's value. +func (s *RefreshPreferences) SetCheckpointDelay(v int64) *RefreshPreferences { + s.CheckpointDelay = &v + return s +} + +// SetCheckpointPercentages sets the CheckpointPercentages field's value. +func (s *RefreshPreferences) SetCheckpointPercentages(v []*int64) *RefreshPreferences { + s.CheckpointPercentages = v + return s +} + // SetInstanceWarmup sets the InstanceWarmup field's value. func (s *RefreshPreferences) SetInstanceWarmup(v int64) *RefreshPreferences { s.InstanceWarmup = &v @@ -13364,11 +15031,16 @@ type ScalingPolicy struct { // // * SimpleScaling (default) // - // For more information, see Target Tracking Scaling Policies (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html) - // and Step and Simple Scaling Policies (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html) + // * PredictiveScaling + // + // For more information, see Target tracking scaling policies (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html) + // and Step and simple scaling policies (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html) // in the Amazon EC2 Auto Scaling User Guide. PolicyType *string `min:"1" type:"string"` + // A predictive scaling policy. + PredictiveScalingConfiguration *PredictiveScalingConfiguration `type:"structure"` + // The amount by which to scale, based on the specified adjustment type. A positive // value adds to the current capacity while a negative number removes from the // current capacity. @@ -13464,6 +15136,12 @@ func (s *ScalingPolicy) SetPolicyType(v string) *ScalingPolicy { return s } +// SetPredictiveScalingConfiguration sets the PredictiveScalingConfiguration field's value. +func (s *ScalingPolicy) SetPredictiveScalingConfiguration(v *PredictiveScalingConfiguration) *ScalingPolicy { + s.PredictiveScalingConfiguration = v + return s +} + // SetScalingAdjustment sets the ScalingAdjustment field's value. func (s *ScalingPolicy) SetScalingAdjustment(v int64) *ScalingPolicy { s.ScalingAdjustment = &v @@ -13590,6 +15268,9 @@ type ScheduledUpdateGroupAction struct { // This parameter is no longer used. Time *time.Time `type:"timestamp"` + + // The time zone for the cron expression. + TimeZone *string `min:"1" type:"string"` } // String returns the string representation @@ -13662,11 +15343,14 @@ func (s *ScheduledUpdateGroupAction) SetTime(v time.Time) *ScheduledUpdateGroupA return s } +// SetTimeZone sets the TimeZone field's value. +func (s *ScheduledUpdateGroupAction) SetTimeZone(v string) *ScheduledUpdateGroupAction { + s.TimeZone = &v + return s +} + // Describes information used for one or more scheduled scaling action updates // in a BatchPutScheduledUpdateGroupAction operation. -// -// When updating a scheduled scaling action, all optional parameters are left -// unchanged if not specified. type ScheduledUpdateGroupActionRequest struct { _ struct{} `type:"structure"` @@ -13674,8 +15358,7 @@ type ScheduledUpdateGroupActionRequest struct { // the scheduled action runs and the capacity it attempts to maintain. DesiredCapacity *int64 `type:"integer"` - // The date and time for the recurring schedule to end. Amazon EC2 Auto Scaling - // does not perform the action after this time. + // The date and time for the recurring schedule to end, in UTC. EndTime *time.Time `type:"timestamp"` // The maximum size of the Auto Scaling group. @@ -13691,6 +15374,8 @@ type ScheduledUpdateGroupActionRequest struct { // // When StartTime and EndTime are specified with Recurrence, they form the boundaries // of when the recurring action starts and stops. + // + // Cron expressions use Universal Coordinated Time (UTC) by default. Recurrence *string `min:"1" type:"string"` // The name of the scaling action. @@ -13708,6 +15393,15 @@ type ScheduledUpdateGroupActionRequest struct { // If you try to schedule the action in the past, Amazon EC2 Auto Scaling returns // an error message. StartTime *time.Time `type:"timestamp"` + + // Specifies the time zone for a cron expression. If a time zone is not provided, + // UTC is used by default. + // + // Valid values are the canonical names of the IANA time zones, derived from + // the IANA Time Zone Database (such as Etc/GMT+9 or Pacific/Tahiti). For more + // information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + // (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + TimeZone *string `min:"1" type:"string"` } // String returns the string representation @@ -13732,6 +15426,9 @@ func (s *ScheduledUpdateGroupActionRequest) Validate() error { if s.ScheduledActionName != nil && len(*s.ScheduledActionName) < 1 { invalidParams.Add(request.NewErrParamMinLen("ScheduledActionName", 1)) } + if s.TimeZone != nil && len(*s.TimeZone) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TimeZone", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -13781,6 +15478,12 @@ func (s *ScheduledUpdateGroupActionRequest) SetStartTime(v time.Time) *Scheduled return s } +// SetTimeZone sets the TimeZone field's value. +func (s *ScheduledUpdateGroupActionRequest) SetTimeZone(v string) *ScheduledUpdateGroupActionRequest { + s.TimeZone = &v + return s +} + type SetDesiredCapacityInput struct { _ struct{} `type:"structure"` @@ -13961,7 +15664,7 @@ type SetInstanceProtectionInput struct { // AutoScalingGroupName is a required field AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // One or more instance IDs. + // One or more instance IDs. You can specify up to 50 instances. // // InstanceIds is a required field InstanceIds []*string `type:"list" required:"true"` @@ -14160,7 +15863,7 @@ func (s *StartInstanceRefreshOutput) SetInstanceRefreshId(v string) *StartInstan // // * The upper and lower bound can't be null in the same step adjustment. // -// For more information, see Step Adjustments (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-steps) +// For more information, see Step adjustments (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-steps) // in the Amazon EC2 Auto Scaling User Guide. type StepAdjustment struct { _ struct{} `type:"structure"` @@ -14245,9 +15948,9 @@ func (s SuspendProcessesOutput) GoString() string { return s.String() } -// Describes an automatic scaling process that has been suspended. +// Describes an auto scaling process that has been suspended. // -// For more information, see Scaling Processes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html#process-types) +// For more information, see Scaling processes (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html#process-types) // in the Amazon EC2 Auto Scaling User Guide. type SuspendedProcess struct { _ struct{} `type:"structure"` @@ -14591,43 +16294,34 @@ type UpdateAutoScalingGroupInput struct { AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // One or more Availability Zones for the group. - AvailabilityZones []*string `min:"1" type:"list"` + AvailabilityZones []*string `type:"list"` - // Enables or disables capacity rebalance. - // - // You can enable capacity rebalancing for your Auto Scaling groups when using - // Spot Instances. When you turn on capacity rebalancing, Amazon EC2 Auto Scaling - // attempts to launch a Spot Instance whenever Amazon EC2 predicts that a Spot - // Instance is at an elevated risk of interruption. After launching a new instance, - // it then terminates an old instance. For more information, see Amazon EC2 - // Auto Scaling capacity rebalancing (https://docs.aws.amazon.com/autoscaling/ec2/userguide/capacity-rebalance.html) + // Enables or disables Capacity Rebalancing. For more information, see Amazon + // EC2 Auto Scaling Capacity Rebalancing (https://docs.aws.amazon.com/autoscaling/ec2/userguide/capacity-rebalance.html) // in the Amazon EC2 Auto Scaling User Guide. CapacityRebalance *bool `type:"boolean"` // The amount of time, in seconds, after a scaling activity completes before - // another scaling activity can start. The default value is 300. - // - // This setting applies when using simple scaling policies, but not when using - // other scaling policies or scheduled scaling. For more information, see Scaling - // Cooldowns for Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) + // another scaling activity can start. The default value is 300. This setting + // applies when using simple scaling policies, but not when using other scaling + // policies or scheduled scaling. For more information, see Scaling cooldowns + // for Amazon EC2 Auto Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) // in the Amazon EC2 Auto Scaling User Guide. DefaultCooldown *int64 `type:"integer"` // The desired capacity is the initial capacity of the Auto Scaling group after - // this operation completes and the capacity it attempts to maintain. - // - // This number must be greater than or equal to the minimum size of the group - // and less than or equal to the maximum size of the group. + // this operation completes and the capacity it attempts to maintain. This number + // must be greater than or equal to the minimum size of the group and less than + // or equal to the maximum size of the group. DesiredCapacity *int64 `type:"integer"` // The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before // checking the health status of an EC2 instance that has come into service. - // The default value is 0. - // - // For more information, see Health Check Grace Period (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html#health-check-grace-period) + // The default value is 0. For more information, see Health check grace period + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html#health-check-grace-period) // in the Amazon EC2 Auto Scaling User Guide. // - // Required if you are adding an ELB health check. + // Conditional: Required if you are adding an ELB health check. HealthCheckGracePeriod *int64 `type:"integer"` // The service to use for the health checks. The valid values are EC2 and ELB. @@ -14643,23 +16337,14 @@ type UpdateAutoScalingGroupInput struct { // The launch template and version to use to specify the updates. If you specify // LaunchTemplate in your update request, you can't specify LaunchConfigurationName // or MixedInstancesPolicy. - // - // For more information, see LaunchTemplateSpecification (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_LaunchTemplateSpecification.html) - // in the Amazon EC2 Auto Scaling API Reference. LaunchTemplate *LaunchTemplateSpecification `type:"structure"` // The maximum amount of time, in seconds, that an instance can be in service. - // The default is null. - // - // This parameter is optional, but if you specify a value for it, you must specify - // a value of at least 604,800 seconds (7 days). To clear a previously set value, - // specify a new value of 0. - // - // For more information, see Replacing Auto Scaling Instances Based on Maximum - // Instance Lifetime (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) + // The default is null. If specified, the value must be either 0 or a number + // equal to or greater than 86,400 seconds (1 day). To clear a previously set + // value, specify a new value of 0. For more information, see Replacing Auto + // Scaling instances based on maximum instance lifetime (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) // in the Amazon EC2 Auto Scaling User Guide. - // - // Valid Range: Minimum value of 0. MaxInstanceLifetime *int64 `type:"integer"` // The maximum size of the Auto Scaling group. @@ -14674,51 +16359,42 @@ type UpdateAutoScalingGroupInput struct { // The minimum size of the Auto Scaling group. MinSize *int64 `type:"integer"` - // An embedded object that specifies a mixed instances policy. - // - // In your call to UpdateAutoScalingGroup, you can make changes to the policy - // that is specified. All optional parameters are left unchanged if not specified. - // - // For more information, see MixedInstancesPolicy (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_MixedInstancesPolicy.html) - // in the Amazon EC2 Auto Scaling API Reference and Auto Scaling Groups with - // Multiple Instance Types and Purchase Options (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) + // An embedded object that specifies a mixed instances policy. When you make + // changes to an existing policy, all optional properties are left unchanged + // if not specified. For more information, see Auto Scaling groups with multiple + // instance types and purchase options (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html) // in the Amazon EC2 Auto Scaling User Guide. MixedInstancesPolicy *MixedInstancesPolicy `type:"structure"` // Indicates whether newly launched instances are protected from termination - // by Amazon EC2 Auto Scaling when scaling in. - // - // For more information about preventing instances from terminating on scale - // in, see Instance Protection (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) + // by Amazon EC2 Auto Scaling when scaling in. For more information about preventing + // instances from terminating on scale in, see Instance scale-in protection + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) // in the Amazon EC2 Auto Scaling User Guide. NewInstancesProtectedFromScaleIn *bool `type:"boolean"` - // The name of the placement group into which to launch your instances, if any. - // A placement group is a logical grouping of instances within a single Availability - // Zone. You cannot specify multiple Availability Zones and a placement group. - // For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) + // The name of an existing placement group into which to launch your instances, + // if any. A placement group is a logical grouping of instances within a single + // Availability Zone. You cannot specify multiple Availability Zones and a placement + // group. For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) // in the Amazon EC2 User Guide for Linux Instances. PlacementGroup *string `min:"1" type:"string"` // The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling // group uses to call other AWS services on your behalf. For more information, - // see Service-Linked Roles (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html) + // see Service-linked roles (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html) // in the Amazon EC2 Auto Scaling User Guide. ServiceLinkedRoleARN *string `min:"1" type:"string"` - // A standalone termination policy or a list of termination policies used to - // select the instance to terminate. The policies are executed in the order - // that they are listed. - // - // For more information, see Controlling Which Instances Auto Scaling Terminates - // During Scale In (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html) + // A policy or a list of policies that are used to select the instances to terminate. + // The policies are executed in the order that you list them. For more information, + // see Controlling which Auto Scaling instances terminate during scale in (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html) // in the Amazon EC2 Auto Scaling User Guide. TerminationPolicies []*string `type:"list"` - // A comma-separated list of subnet IDs for virtual private cloud (VPC). - // - // If you specify VPCZoneIdentifier with AvailabilityZones, the subnets that - // you specify for this parameter must reside in those Availability Zones. + // A comma-separated list of subnet IDs for a virtual private cloud (VPC). If + // you specify VPCZoneIdentifier with AvailabilityZones, the subnets that you + // specify for this parameter must reside in those Availability Zones. VPCZoneIdentifier *string `min:"1" type:"string"` } @@ -14741,9 +16417,6 @@ func (s *UpdateAutoScalingGroupInput) Validate() error { if s.AutoScalingGroupName != nil && len(*s.AutoScalingGroupName) < 1 { invalidParams.Add(request.NewErrParamMinLen("AutoScalingGroupName", 1)) } - if s.AvailabilityZones != nil && len(s.AvailabilityZones) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AvailabilityZones", 1)) - } if s.HealthCheckType != nil && len(*s.HealthCheckType) < 1 { invalidParams.Add(request.NewErrParamMinLen("HealthCheckType", 1)) } @@ -14898,6 +16571,58 @@ func (s UpdateAutoScalingGroupOutput) GoString() string { return s.String() } +// Describes a warm pool configuration. +type WarmPoolConfiguration struct { + _ struct{} `type:"structure"` + + // The maximum number of instances that are allowed to be in the warm pool or + // in any state except Terminated for the Auto Scaling group. + MaxGroupPreparedCapacity *int64 `type:"integer"` + + // The minimum number of instances to maintain in the warm pool. + MinSize *int64 `type:"integer"` + + // The instance state to transition to after the lifecycle actions are complete. + PoolState *string `type:"string" enum:"WarmPoolState"` + + // The status of a warm pool that is marked for deletion. + Status *string `type:"string" enum:"WarmPoolStatus"` +} + +// String returns the string representation +func (s WarmPoolConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WarmPoolConfiguration) GoString() string { + return s.String() +} + +// SetMaxGroupPreparedCapacity sets the MaxGroupPreparedCapacity field's value. +func (s *WarmPoolConfiguration) SetMaxGroupPreparedCapacity(v int64) *WarmPoolConfiguration { + s.MaxGroupPreparedCapacity = &v + return s +} + +// SetMinSize sets the MinSize field's value. +func (s *WarmPoolConfiguration) SetMinSize(v int64) *WarmPoolConfiguration { + s.MinSize = &v + return s +} + +// SetPoolState sets the PoolState field's value. +func (s *WarmPoolConfiguration) SetPoolState(v string) *WarmPoolConfiguration { + s.PoolState = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *WarmPoolConfiguration) SetStatus(v string) *WarmPoolConfiguration { + s.Status = &v + return s +} + const ( // InstanceMetadataEndpointStateDisabled is a InstanceMetadataEndpointState enum value InstanceMetadataEndpointStateDisabled = "disabled" @@ -15001,6 +16726,33 @@ const ( // LifecycleStateStandby is a LifecycleState enum value LifecycleStateStandby = "Standby" + + // LifecycleStateWarmedPending is a LifecycleState enum value + LifecycleStateWarmedPending = "Warmed:Pending" + + // LifecycleStateWarmedPendingWait is a LifecycleState enum value + LifecycleStateWarmedPendingWait = "Warmed:Pending:Wait" + + // LifecycleStateWarmedPendingProceed is a LifecycleState enum value + LifecycleStateWarmedPendingProceed = "Warmed:Pending:Proceed" + + // LifecycleStateWarmedTerminating is a LifecycleState enum value + LifecycleStateWarmedTerminating = "Warmed:Terminating" + + // LifecycleStateWarmedTerminatingWait is a LifecycleState enum value + LifecycleStateWarmedTerminatingWait = "Warmed:Terminating:Wait" + + // LifecycleStateWarmedTerminatingProceed is a LifecycleState enum value + LifecycleStateWarmedTerminatingProceed = "Warmed:Terminating:Proceed" + + // LifecycleStateWarmedTerminated is a LifecycleState enum value + LifecycleStateWarmedTerminated = "Warmed:Terminated" + + // LifecycleStateWarmedStopped is a LifecycleState enum value + LifecycleStateWarmedStopped = "Warmed:Stopped" + + // LifecycleStateWarmedRunning is a LifecycleState enum value + LifecycleStateWarmedRunning = "Warmed:Running" ) // LifecycleState_Values returns all elements of the LifecycleState enum @@ -15019,6 +16771,15 @@ func LifecycleState_Values() []string { LifecycleStateDetached, LifecycleStateEnteringStandby, LifecycleStateStandby, + LifecycleStateWarmedPending, + LifecycleStateWarmedPendingWait, + LifecycleStateWarmedPendingProceed, + LifecycleStateWarmedTerminating, + LifecycleStateWarmedTerminatingWait, + LifecycleStateWarmedTerminatingProceed, + LifecycleStateWarmedTerminated, + LifecycleStateWarmedStopped, + LifecycleStateWarmedRunning, } } @@ -15074,6 +16835,110 @@ func MetricType_Values() []string { } } +const ( + // PredefinedLoadMetricTypeAsgtotalCpuutilization is a PredefinedLoadMetricType enum value + PredefinedLoadMetricTypeAsgtotalCpuutilization = "ASGTotalCPUUtilization" + + // PredefinedLoadMetricTypeAsgtotalNetworkIn is a PredefinedLoadMetricType enum value + PredefinedLoadMetricTypeAsgtotalNetworkIn = "ASGTotalNetworkIn" + + // PredefinedLoadMetricTypeAsgtotalNetworkOut is a PredefinedLoadMetricType enum value + PredefinedLoadMetricTypeAsgtotalNetworkOut = "ASGTotalNetworkOut" + + // PredefinedLoadMetricTypeAlbtargetGroupRequestCount is a PredefinedLoadMetricType enum value + PredefinedLoadMetricTypeAlbtargetGroupRequestCount = "ALBTargetGroupRequestCount" +) + +// PredefinedLoadMetricType_Values returns all elements of the PredefinedLoadMetricType enum +func PredefinedLoadMetricType_Values() []string { + return []string{ + PredefinedLoadMetricTypeAsgtotalCpuutilization, + PredefinedLoadMetricTypeAsgtotalNetworkIn, + PredefinedLoadMetricTypeAsgtotalNetworkOut, + PredefinedLoadMetricTypeAlbtargetGroupRequestCount, + } +} + +const ( + // PredefinedMetricPairTypeAsgcpuutilization is a PredefinedMetricPairType enum value + PredefinedMetricPairTypeAsgcpuutilization = "ASGCPUUtilization" + + // PredefinedMetricPairTypeAsgnetworkIn is a PredefinedMetricPairType enum value + PredefinedMetricPairTypeAsgnetworkIn = "ASGNetworkIn" + + // PredefinedMetricPairTypeAsgnetworkOut is a PredefinedMetricPairType enum value + PredefinedMetricPairTypeAsgnetworkOut = "ASGNetworkOut" + + // PredefinedMetricPairTypeAlbrequestCount is a PredefinedMetricPairType enum value + PredefinedMetricPairTypeAlbrequestCount = "ALBRequestCount" +) + +// PredefinedMetricPairType_Values returns all elements of the PredefinedMetricPairType enum +func PredefinedMetricPairType_Values() []string { + return []string{ + PredefinedMetricPairTypeAsgcpuutilization, + PredefinedMetricPairTypeAsgnetworkIn, + PredefinedMetricPairTypeAsgnetworkOut, + PredefinedMetricPairTypeAlbrequestCount, + } +} + +const ( + // PredefinedScalingMetricTypeAsgaverageCpuutilization is a PredefinedScalingMetricType enum value + PredefinedScalingMetricTypeAsgaverageCpuutilization = "ASGAverageCPUUtilization" + + // PredefinedScalingMetricTypeAsgaverageNetworkIn is a PredefinedScalingMetricType enum value + PredefinedScalingMetricTypeAsgaverageNetworkIn = "ASGAverageNetworkIn" + + // PredefinedScalingMetricTypeAsgaverageNetworkOut is a PredefinedScalingMetricType enum value + PredefinedScalingMetricTypeAsgaverageNetworkOut = "ASGAverageNetworkOut" + + // PredefinedScalingMetricTypeAlbrequestCountPerTarget is a PredefinedScalingMetricType enum value + PredefinedScalingMetricTypeAlbrequestCountPerTarget = "ALBRequestCountPerTarget" +) + +// PredefinedScalingMetricType_Values returns all elements of the PredefinedScalingMetricType enum +func PredefinedScalingMetricType_Values() []string { + return []string{ + PredefinedScalingMetricTypeAsgaverageCpuutilization, + PredefinedScalingMetricTypeAsgaverageNetworkIn, + PredefinedScalingMetricTypeAsgaverageNetworkOut, + PredefinedScalingMetricTypeAlbrequestCountPerTarget, + } +} + +const ( + // PredictiveScalingMaxCapacityBreachBehaviorHonorMaxCapacity is a PredictiveScalingMaxCapacityBreachBehavior enum value + PredictiveScalingMaxCapacityBreachBehaviorHonorMaxCapacity = "HonorMaxCapacity" + + // PredictiveScalingMaxCapacityBreachBehaviorIncreaseMaxCapacity is a PredictiveScalingMaxCapacityBreachBehavior enum value + PredictiveScalingMaxCapacityBreachBehaviorIncreaseMaxCapacity = "IncreaseMaxCapacity" +) + +// PredictiveScalingMaxCapacityBreachBehavior_Values returns all elements of the PredictiveScalingMaxCapacityBreachBehavior enum +func PredictiveScalingMaxCapacityBreachBehavior_Values() []string { + return []string{ + PredictiveScalingMaxCapacityBreachBehaviorHonorMaxCapacity, + PredictiveScalingMaxCapacityBreachBehaviorIncreaseMaxCapacity, + } +} + +const ( + // PredictiveScalingModeForecastAndScale is a PredictiveScalingMode enum value + PredictiveScalingModeForecastAndScale = "ForecastAndScale" + + // PredictiveScalingModeForecastOnly is a PredictiveScalingMode enum value + PredictiveScalingModeForecastOnly = "ForecastOnly" +) + +// PredictiveScalingMode_Values returns all elements of the PredictiveScalingMode enum +func PredictiveScalingMode_Values() []string { + return []string{ + PredictiveScalingModeForecastAndScale, + PredictiveScalingModeForecastOnly, + } +} + const ( // RefreshStrategyRolling is a RefreshStrategy enum value RefreshStrategyRolling = "Rolling" @@ -15141,3 +17006,31 @@ func ScalingActivityStatusCode_Values() []string { ScalingActivityStatusCodeCancelled, } } + +const ( + // WarmPoolStateStopped is a WarmPoolState enum value + WarmPoolStateStopped = "Stopped" + + // WarmPoolStateRunning is a WarmPoolState enum value + WarmPoolStateRunning = "Running" +) + +// WarmPoolState_Values returns all elements of the WarmPoolState enum +func WarmPoolState_Values() []string { + return []string{ + WarmPoolStateStopped, + WarmPoolStateRunning, + } +} + +const ( + // WarmPoolStatusPendingDelete is a WarmPoolStatus enum value + WarmPoolStatusPendingDelete = "PendingDelete" +) + +// WarmPoolStatus_Values returns all elements of the WarmPoolStatus enum +func WarmPoolStatus_Values() []string { + return []string{ + WarmPoolStatusPendingDelete, + } +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go index 0a2fe8c30f34..27f32492ddf6 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go @@ -5,12 +5,14 @@ // // Amazon EC2 Auto Scaling is designed to automatically launch or terminate // EC2 instances based on user-defined scaling policies, scheduled actions, -// and health checks. Use this service with AWS Auto Scaling, Amazon CloudWatch, -// and Elastic Load Balancing. +// and health checks. // -// For more information, including information about granting IAM users required -// permissions for Amazon EC2 Auto Scaling actions, see the Amazon EC2 Auto +// For more information about Amazon EC2 Auto Scaling, see the Amazon EC2 Auto // Scaling User Guide (https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html). +// For information about granting IAM users required permissions for calls to +// Amazon EC2 Auto Scaling, see Granting IAM users required permissions for +// Amazon EC2 Auto Scaling resources (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/ec2-auto-scaling-api-permissions.html) +// in the Amazon EC2 Auto Scaling API Reference. // // See https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01 for more information on this service. // diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go index ba7661add13d..8550cffea5e4 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -88,6 +88,80 @@ func (c *EC2) AcceptReservedInstancesExchangeQuoteWithContext(ctx aws.Context, i return out, req.Send() } +const opAcceptTransitGatewayMulticastDomainAssociations = "AcceptTransitGatewayMulticastDomainAssociations" + +// AcceptTransitGatewayMulticastDomainAssociationsRequest generates a "aws/request.Request" representing the +// client's request for the AcceptTransitGatewayMulticastDomainAssociations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AcceptTransitGatewayMulticastDomainAssociations for more information on using the AcceptTransitGatewayMulticastDomainAssociations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AcceptTransitGatewayMulticastDomainAssociationsRequest method. +// req, resp := client.AcceptTransitGatewayMulticastDomainAssociationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptTransitGatewayMulticastDomainAssociations +func (c *EC2) AcceptTransitGatewayMulticastDomainAssociationsRequest(input *AcceptTransitGatewayMulticastDomainAssociationsInput) (req *request.Request, output *AcceptTransitGatewayMulticastDomainAssociationsOutput) { + op := &request.Operation{ + Name: opAcceptTransitGatewayMulticastDomainAssociations, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AcceptTransitGatewayMulticastDomainAssociationsInput{} + } + + output = &AcceptTransitGatewayMulticastDomainAssociationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// AcceptTransitGatewayMulticastDomainAssociations API operation for Amazon Elastic Compute Cloud. +// +// Accepts a request to associate subnets with a transit gateway multicast domain. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation AcceptTransitGatewayMulticastDomainAssociations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptTransitGatewayMulticastDomainAssociations +func (c *EC2) AcceptTransitGatewayMulticastDomainAssociations(input *AcceptTransitGatewayMulticastDomainAssociationsInput) (*AcceptTransitGatewayMulticastDomainAssociationsOutput, error) { + req, out := c.AcceptTransitGatewayMulticastDomainAssociationsRequest(input) + return out, req.Send() +} + +// AcceptTransitGatewayMulticastDomainAssociationsWithContext is the same as AcceptTransitGatewayMulticastDomainAssociations with the addition of +// the ability to pass a context and additional request options. +// +// See AcceptTransitGatewayMulticastDomainAssociations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) AcceptTransitGatewayMulticastDomainAssociationsWithContext(ctx aws.Context, input *AcceptTransitGatewayMulticastDomainAssociationsInput, opts ...request.Option) (*AcceptTransitGatewayMulticastDomainAssociationsOutput, error) { + req, out := c.AcceptTransitGatewayMulticastDomainAssociationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opAcceptTransitGatewayPeeringAttachment = "AcceptTransitGatewayPeeringAttachment" // AcceptTransitGatewayPeeringAttachmentRequest generates a "aws/request.Request" representing the @@ -1240,18 +1314,18 @@ func (c *EC2) AssociateEnclaveCertificateIamRoleRequest(input *AssociateEnclaveC // see AWS Certificate Manager for Nitro Enclaves (https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html) // in the AWS Nitro Enclaves User Guide. // -// When the IAM role is associated with the ACM certificate, places the certificate, -// certificate chain, and encrypted private key in an Amazon S3 bucket that -// only the associated IAM role can access. The private key of the certificate +// When the IAM role is associated with the ACM certificate, the certificate, +// certificate chain, and encrypted private key are placed in an Amazon S3 bucket +// that only the associated IAM role can access. The private key of the certificate // is encrypted with an AWS-managed KMS customer master (CMK) that has an attached // attestation-based CMK policy. // // To enable the IAM role to access the Amazon S3 object, you must grant it // permission to call s3:GetObject on the Amazon S3 bucket returned by the command. // To enable the IAM role to access the AWS KMS CMK, you must grant it permission -// to call kms:Decrypt on AWS KMS CMK returned by the command. For more information, -// see Grant the role permission to access the certificate and encryption key -// (https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html#add-policy) +// to call kms:Decrypt on the AWS KMS CMK returned by the command. For more +// information, see Grant the role permission to access the certificate and +// encryption key (https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html#add-policy) // in the AWS Nitro Enclaves User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2039,7 +2113,7 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Reques // the instance with the specified device name. // // Encrypted EBS volumes must be attached to instances that support Amazon EBS -// encryption. For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// encryption. For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // // After you attach an EBS volume, you must make it available. For more information, @@ -2941,7 +3015,7 @@ func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstanc // Marketplace. // // For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3323,14 +3397,26 @@ func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *request.Request, out // CopyImage API operation for Amazon Elastic Compute Cloud. // -// Initiates the copy of an AMI from the specified source Region to the current -// Region. You specify the destination Region by using its endpoint when making -// the request. -// -// Copies of encrypted backing snapshots for the AMI are encrypted. Copies of -// unencrypted backing snapshots remain unencrypted, unless you set Encrypted -// during the copy operation. You cannot create an unencrypted copy of an encrypted -// backing snapshot. +// Initiates the copy of an AMI. You can copy an AMI from one Region to another, +// or from a Region to an AWS Outpost. You can't copy an AMI from an Outpost +// to a Region, from one Outpost to another, or within the same Outpost. To +// copy an AMI to another partition, see CreateStoreImageTask (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateStoreImageTask.html). +// +// To copy an AMI from one Region to another, specify the source Region using +// the SourceRegion parameter, and specify the destination Region using its +// endpoint. Copies of encrypted backing snapshots for the AMI are encrypted. +// Copies of unencrypted backing snapshots remain unencrypted, unless you set +// Encrypted during the copy operation. You cannot create an unencrypted copy +// of an encrypted backing snapshot. +// +// To copy an AMI from a Region to an Outpost, specify the source Region using +// the SourceRegion parameter, and specify the ARN of the destination Outpost +// using DestinationOutpostArn. Backing snapshots copied to an Outpost are encrypted +// by default using the default encryption key for the Region, or a different +// key that you specify in the request using KmsKeyId. Outposts do not support +// unencrypted snapshots. For more information, Amazon EBS local snapshots on +// Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#ami) +// in the Amazon Elastic Compute Cloud User Guide. // // For more information about the prerequisites and limits when copying an AMI, // see Copying an AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html) @@ -3409,18 +3495,25 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Reques // CopySnapshot API operation for Amazon Elastic Compute Cloud. // // Copies a point-in-time snapshot of an EBS volume and stores it in Amazon -// S3. You can copy the snapshot within the same Region or from one Region to -// another. You can use the snapshot to create EBS volumes or Amazon Machine -// Images (AMIs). -// -// Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted -// snapshots remain unencrypted, unless you enable encryption for the snapshot -// copy operation. By default, encrypted snapshot copies use the default AWS -// Key Management Service (AWS KMS) customer master key (CMK); however, you -// can specify a different CMK. -// -// To copy an encrypted snapshot that has been shared from another account, -// you must have permissions for the CMK used to encrypt the snapshot. +// S3. You can copy a snapshot within the same Region, from one Region to another, +// or from a Region to an Outpost. You can't copy a snapshot from an Outpost +// to a Region, from one Outpost to another, or within the same Outpost. +// +// You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs). +// +// When copying snapshots to a Region, copies of encrypted EBS snapshots remain +// encrypted. Copies of unencrypted snapshots remain unencrypted, unless you +// enable encryption for the snapshot copy operation. By default, encrypted +// snapshot copies use the default AWS Key Management Service (AWS KMS) customer +// master key (CMK); however, you can specify a different CMK. To copy an encrypted +// snapshot that has been shared from another account, you must have permissions +// for the CMK used to encrypt the snapshot. +// +// Snapshots copied to an Outpost are encrypted by default using the default +// encryption key for the Region, or a different key that you specify in the +// request using KmsKeyId. Outposts do not support unencrypted snapshots. For +// more information, Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#ami) +// in the Amazon Elastic Compute Cloud User Guide. // // Snapshots created by copying another snapshot have an arbitrary volume ID // that should not be used for any purpose. @@ -3509,7 +3602,7 @@ func (c *EC2) CreateCapacityReservationRequest(input *CreateCapacityReservationI // you ensure that you always have access to Amazon EC2 capacity when you need // it, for as long as you need it. For more information, see Capacity Reservations // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Your request to create a Capacity Reservation could fail if Amazon EC2 does // not have sufficient capacity to fulfill the request. If your request fails @@ -3522,8 +3615,8 @@ func (c *EC2) CreateCapacityReservationRequest(input *CreateCapacityReservationI // Instance limit for the selected instance type. If your request fails due // to limit constraints, increase your On-Demand Instance limit for the required // instance type and try again. For more information about increasing your instance -// limits, see Amazon EC2 Service Limits (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html) -// in the Amazon Elastic Compute Cloud User Guide. +// limits, see Amazon EC2 Service Quotas (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html) +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4288,7 +4381,7 @@ func (c *EC2) CreateFleetRequest(input *CreateFleetInput) (req *request.Request, // that vary by instance type, AMI, Availability Zone, or subnet. // // For more information, see Launching an EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4619,7 +4712,7 @@ func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInp // // For information about the supported operating systems, image formats, and // known limitations for the types of instances you can export, see Exporting -// an Instance as a VM Using VM Import/Export (https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html) +// an instance as a VM Using VM Import/Export (https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html) // in the VM Import/Export User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -5448,6 +5541,84 @@ func (c *EC2) CreateNetworkAclEntryWithContext(ctx aws.Context, input *CreateNet return out, req.Send() } +const opCreateNetworkInsightsPath = "CreateNetworkInsightsPath" + +// CreateNetworkInsightsPathRequest generates a "aws/request.Request" representing the +// client's request for the CreateNetworkInsightsPath operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateNetworkInsightsPath for more information on using the CreateNetworkInsightsPath +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateNetworkInsightsPathRequest method. +// req, resp := client.CreateNetworkInsightsPathRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInsightsPath +func (c *EC2) CreateNetworkInsightsPathRequest(input *CreateNetworkInsightsPathInput) (req *request.Request, output *CreateNetworkInsightsPathOutput) { + op := &request.Operation{ + Name: opCreateNetworkInsightsPath, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateNetworkInsightsPathInput{} + } + + output = &CreateNetworkInsightsPathOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateNetworkInsightsPath API operation for Amazon Elastic Compute Cloud. +// +// Creates a path to analyze for reachability. +// +// Reachability Analyzer enables you to analyze and debug network reachability +// between two resources in your virtual private cloud (VPC). For more information, +// see What is Reachability Analyzer (https://docs.aws.amazon.com/vpc/latest/reachability/). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation CreateNetworkInsightsPath for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInsightsPath +func (c *EC2) CreateNetworkInsightsPath(input *CreateNetworkInsightsPathInput) (*CreateNetworkInsightsPathOutput, error) { + req, out := c.CreateNetworkInsightsPathRequest(input) + return out, req.Send() +} + +// CreateNetworkInsightsPathWithContext is the same as CreateNetworkInsightsPath with the addition of +// the ability to pass a context and additional request options. +// +// See CreateNetworkInsightsPath for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateNetworkInsightsPathWithContext(ctx aws.Context, input *CreateNetworkInsightsPathInput, opts ...request.Option) (*CreateNetworkInsightsPathOutput, error) { + req, out := c.CreateNetworkInsightsPathRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateNetworkInterface = "CreateNetworkInterface" // CreateNetworkInterfaceRequest generates a "aws/request.Request" representing the @@ -5659,7 +5830,7 @@ func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req // in another partition. // // For more information, see Placement groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5689,6 +5860,85 @@ func (c *EC2) CreatePlacementGroupWithContext(ctx aws.Context, input *CreatePlac return out, req.Send() } +const opCreateReplaceRootVolumeTask = "CreateReplaceRootVolumeTask" + +// CreateReplaceRootVolumeTaskRequest generates a "aws/request.Request" representing the +// client's request for the CreateReplaceRootVolumeTask operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateReplaceRootVolumeTask for more information on using the CreateReplaceRootVolumeTask +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateReplaceRootVolumeTaskRequest method. +// req, resp := client.CreateReplaceRootVolumeTaskRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReplaceRootVolumeTask +func (c *EC2) CreateReplaceRootVolumeTaskRequest(input *CreateReplaceRootVolumeTaskInput) (req *request.Request, output *CreateReplaceRootVolumeTaskOutput) { + op := &request.Operation{ + Name: opCreateReplaceRootVolumeTask, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateReplaceRootVolumeTaskInput{} + } + + output = &CreateReplaceRootVolumeTaskOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateReplaceRootVolumeTask API operation for Amazon Elastic Compute Cloud. +// +// Creates a root volume replacement task for an Amazon EC2 instance. The root +// volume can either be restored to its initial launch state, or it can be restored +// using a specific snapshot. +// +// For more information, see Replace a root volume (https://docs.aws.amazon.com/) +// in the Amazon Elastic Compute Cloud User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation CreateReplaceRootVolumeTask for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReplaceRootVolumeTask +func (c *EC2) CreateReplaceRootVolumeTask(input *CreateReplaceRootVolumeTaskInput) (*CreateReplaceRootVolumeTaskOutput, error) { + req, out := c.CreateReplaceRootVolumeTaskRequest(input) + return out, req.Send() +} + +// CreateReplaceRootVolumeTaskWithContext is the same as CreateReplaceRootVolumeTask with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReplaceRootVolumeTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateReplaceRootVolumeTaskWithContext(ctx aws.Context, input *CreateReplaceRootVolumeTaskInput, opts ...request.Option) (*CreateReplaceRootVolumeTaskOutput, error) { + req, out := c.CreateReplaceRootVolumeTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateReservedInstancesListing = "CreateReservedInstancesListing" // CreateReservedInstancesListingRequest generates a "aws/request.Request" representing the @@ -5755,7 +6005,7 @@ func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstanc // you can use the DescribeReservedInstancesListings operation. // // For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5785,6 +6035,88 @@ func (c *EC2) CreateReservedInstancesListingWithContext(ctx aws.Context, input * return out, req.Send() } +const opCreateRestoreImageTask = "CreateRestoreImageTask" + +// CreateRestoreImageTaskRequest generates a "aws/request.Request" representing the +// client's request for the CreateRestoreImageTask operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateRestoreImageTask for more information on using the CreateRestoreImageTask +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateRestoreImageTaskRequest method. +// req, resp := client.CreateRestoreImageTaskRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRestoreImageTask +func (c *EC2) CreateRestoreImageTaskRequest(input *CreateRestoreImageTaskInput) (req *request.Request, output *CreateRestoreImageTaskOutput) { + op := &request.Operation{ + Name: opCreateRestoreImageTask, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateRestoreImageTaskInput{} + } + + output = &CreateRestoreImageTaskOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateRestoreImageTask API operation for Amazon Elastic Compute Cloud. +// +// Starts a task that restores an AMI from an S3 object that was previously +// created by using CreateStoreImageTask (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateStoreImageTask.html). +// +// To use this API, you must have the required permissions. For more information, +// see Permissions for storing and restoring AMIs using S3 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html#ami-s3-permissions) +// in the Amazon Elastic Compute Cloud User Guide. +// +// For more information, see Store and restore an AMI using S3 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation CreateRestoreImageTask for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRestoreImageTask +func (c *EC2) CreateRestoreImageTask(input *CreateRestoreImageTaskInput) (*CreateRestoreImageTaskOutput, error) { + req, out := c.CreateRestoreImageTaskRequest(input) + return out, req.Send() +} + +// CreateRestoreImageTaskWithContext is the same as CreateRestoreImageTask with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRestoreImageTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateRestoreImageTaskWithContext(ctx aws.Context, input *CreateRestoreImageTaskInput, opts ...request.Option) (*CreateRestoreImageTaskOutput, error) { + req, out := c.CreateRestoreImageTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateRoute = "CreateRoute" // CreateRouteRequest generates a "aws/request.Request" representing the @@ -6103,12 +6435,18 @@ func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Re // snapshots for backups, to make copies of EBS volumes, and to save data before // shutting down an instance. // +// You can create snapshots of volumes in a Region and volumes on an Outpost. +// If you create a snapshot of a volume in a Region, the snapshot must be stored +// in the same Region as the volume. If you create a snapshot of a volume on +// an Outpost, the snapshot can be stored on the same Outpost as the volume, +// or in the Region for that Outpost. +// // When a snapshot is created, any AWS Marketplace product codes that are associated // with the source volume are propagated to the snapshot. // // You can take a snapshot of an attached volume that is in use. However, snapshots // only capture data that has been written to your EBS volume at the time the -// snapshot command is issued; this may exclude any data that has been cached +// snapshot command is issued; this might exclude any data that has been cached // by any applications or the operating system. If you can pause any file systems // on the volume long enough to take a snapshot, your snapshot should be complete. // However, if you cannot pause all file writes to the volume, you should unmount @@ -6129,7 +6467,7 @@ func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Re // in the Amazon Elastic Compute Cloud User Guide. // // For more information, see Amazon Elastic Block Store (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html) -// and Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// and Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -6209,6 +6547,12 @@ func (c *EC2) CreateSnapshotsRequest(input *CreateSnapshotsInput) (req *request. // will produce one snapshot each that is crash-consistent across the instance. // Boot volumes can be excluded by changing the parameters. // +// You can create multi-volume snapshots of instances in a Region and instances +// on an Outpost. If you create snapshots from an instance in a Region, the +// snapshots must be stored in the same Region as the instance. If you create +// snapshots from an instance on an Outpost, the snapshots can be stored on +// the same Outpost as the instance, or in the Region for that Outpost. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -6314,6 +6658,87 @@ func (c *EC2) CreateSpotDatafeedSubscriptionWithContext(ctx aws.Context, input * return out, req.Send() } +const opCreateStoreImageTask = "CreateStoreImageTask" + +// CreateStoreImageTaskRequest generates a "aws/request.Request" representing the +// client's request for the CreateStoreImageTask operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateStoreImageTask for more information on using the CreateStoreImageTask +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateStoreImageTaskRequest method. +// req, resp := client.CreateStoreImageTaskRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateStoreImageTask +func (c *EC2) CreateStoreImageTaskRequest(input *CreateStoreImageTaskInput) (req *request.Request, output *CreateStoreImageTaskOutput) { + op := &request.Operation{ + Name: opCreateStoreImageTask, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateStoreImageTaskInput{} + } + + output = &CreateStoreImageTaskOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateStoreImageTask API operation for Amazon Elastic Compute Cloud. +// +// Stores an AMI as a single object in an S3 bucket. +// +// To use this API, you must have the required permissions. For more information, +// see Permissions for storing and restoring AMIs using S3 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html#ami-s3-permissions) +// in the Amazon Elastic Compute Cloud User Guide. +// +// For more information, see Store and restore an AMI using S3 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation CreateStoreImageTask for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateStoreImageTask +func (c *EC2) CreateStoreImageTask(input *CreateStoreImageTaskInput) (*CreateStoreImageTaskOutput, error) { + req, out := c.CreateStoreImageTaskRequest(input) + return out, req.Send() +} + +// CreateStoreImageTaskWithContext is the same as CreateStoreImageTask with the addition of +// the ability to pass a context and additional request options. +// +// See CreateStoreImageTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateStoreImageTaskWithContext(ctx aws.Context, input *CreateStoreImageTaskInput, opts ...request.Option) (*CreateStoreImageTaskOutput, error) { + req, out := c.CreateStoreImageTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateSubnet = "CreateSubnet" // CreateSubnetRequest generates a "aws/request.Request" representing the @@ -6916,6 +7341,166 @@ func (c *EC2) CreateTransitGatewayWithContext(ctx aws.Context, input *CreateTran return out, req.Send() } +const opCreateTransitGatewayConnect = "CreateTransitGatewayConnect" + +// CreateTransitGatewayConnectRequest generates a "aws/request.Request" representing the +// client's request for the CreateTransitGatewayConnect operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTransitGatewayConnect for more information on using the CreateTransitGatewayConnect +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTransitGatewayConnectRequest method. +// req, resp := client.CreateTransitGatewayConnectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayConnect +func (c *EC2) CreateTransitGatewayConnectRequest(input *CreateTransitGatewayConnectInput) (req *request.Request, output *CreateTransitGatewayConnectOutput) { + op := &request.Operation{ + Name: opCreateTransitGatewayConnect, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateTransitGatewayConnectInput{} + } + + output = &CreateTransitGatewayConnectOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTransitGatewayConnect API operation for Amazon Elastic Compute Cloud. +// +// Creates a Connect attachment from a specified transit gateway attachment. +// A Connect attachment is a GRE-based tunnel attachment that you can use to +// establish a connection between a transit gateway and an appliance. +// +// A Connect attachment uses an existing VPC or AWS Direct Connect attachment +// as the underlying transport mechanism. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation CreateTransitGatewayConnect for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayConnect +func (c *EC2) CreateTransitGatewayConnect(input *CreateTransitGatewayConnectInput) (*CreateTransitGatewayConnectOutput, error) { + req, out := c.CreateTransitGatewayConnectRequest(input) + return out, req.Send() +} + +// CreateTransitGatewayConnectWithContext is the same as CreateTransitGatewayConnect with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTransitGatewayConnect for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateTransitGatewayConnectWithContext(ctx aws.Context, input *CreateTransitGatewayConnectInput, opts ...request.Option) (*CreateTransitGatewayConnectOutput, error) { + req, out := c.CreateTransitGatewayConnectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateTransitGatewayConnectPeer = "CreateTransitGatewayConnectPeer" + +// CreateTransitGatewayConnectPeerRequest generates a "aws/request.Request" representing the +// client's request for the CreateTransitGatewayConnectPeer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTransitGatewayConnectPeer for more information on using the CreateTransitGatewayConnectPeer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTransitGatewayConnectPeerRequest method. +// req, resp := client.CreateTransitGatewayConnectPeerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayConnectPeer +func (c *EC2) CreateTransitGatewayConnectPeerRequest(input *CreateTransitGatewayConnectPeerInput) (req *request.Request, output *CreateTransitGatewayConnectPeerOutput) { + op := &request.Operation{ + Name: opCreateTransitGatewayConnectPeer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateTransitGatewayConnectPeerInput{} + } + + output = &CreateTransitGatewayConnectPeerOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTransitGatewayConnectPeer API operation for Amazon Elastic Compute Cloud. +// +// Creates a Connect peer for a specified transit gateway Connect attachment +// between a transit gateway and an appliance. +// +// The peer address and transit gateway address must be the same IP address +// family (IPv4 or IPv6). +// +// For more information, see Connect peers (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html#tgw-connect-peer) +// in the Transit Gateways Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation CreateTransitGatewayConnectPeer for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayConnectPeer +func (c *EC2) CreateTransitGatewayConnectPeer(input *CreateTransitGatewayConnectPeerInput) (*CreateTransitGatewayConnectPeerOutput, error) { + req, out := c.CreateTransitGatewayConnectPeerRequest(input) + return out, req.Send() +} + +// CreateTransitGatewayConnectPeerWithContext is the same as CreateTransitGatewayConnectPeer with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTransitGatewayConnectPeer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateTransitGatewayConnectPeerWithContext(ctx aws.Context, input *CreateTransitGatewayConnectPeerInput, opts ...request.Option) (*CreateTransitGatewayConnectPeerOutput, error) { + req, out := c.CreateTransitGatewayConnectPeerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateTransitGatewayMulticastDomain = "CreateTransitGatewayMulticastDomain" // CreateTransitGatewayMulticastDomainRequest generates a "aws/request.Request" representing the @@ -7423,8 +8008,7 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Reques // CreateVolume API operation for Amazon Elastic Compute Cloud. // // Creates an EBS volume that can be attached to an instance in the same Availability -// Zone. The volume is created in the regional endpoint that you send the HTTP -// request to. For more information see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html). +// Zone. // // You can create a new empty volume or restore a volume from an EBS snapshot. // Any AWS Marketplace product codes from the snapshot are propagated to the @@ -7433,7 +8017,7 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Reques // You can create encrypted volumes. Encrypted volumes must be attached to instances // that support Amazon EBS encryption. Volumes that are created from encrypted // snapshots are also automatically encrypted. For more information, see Amazon -// EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // // You can tag your volumes during creation. For more information, see Tagging @@ -7624,6 +8208,10 @@ func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *requ // the subnets in which to create an endpoint, and the security groups to associate // with the endpoint network interface. // +// A GatewayLoadBalancer endpoint is a network interface in your subnet that +// serves an endpoint for communicating with a Gateway Load Balancer that you've +// configured as a VPC endpoint service. +// // Use DescribeVpcEndpointServices to get a list of supported services. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -7779,12 +8367,19 @@ func (c *EC2) CreateVpcEndpointServiceConfigurationRequest(input *CreateVpcEndpo // CreateVpcEndpointServiceConfiguration API operation for Amazon Elastic Compute Cloud. // // Creates a VPC endpoint service configuration to which service consumers (AWS -// accounts, IAM users, and IAM roles) can connect. Service consumers can create -// an interface VPC endpoint to connect to your service. +// accounts, IAM users, and IAM roles) can connect. // -// To create an endpoint service configuration, you must first create a Network -// Load Balancer for your service. For more information, see VPC Endpoint Services -// (https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html) +// To create an endpoint service configuration, you must first create one of +// the following for your service: +// +// * A Network Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html). +// Service consumers connect to your service using an interface endpoint. +// +// * A Gateway Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/introduction.html). +// Service consumers connect to your service using a Gateway Load Balancer +// endpoint. +// +// For more information, see VPC Endpoint Services (https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html) // in the Amazon Virtual Private Cloud User Guide. // // If you set the private DNS name, you must prove that you own the private @@ -8666,11 +9261,29 @@ func (c *EC2) DeleteFleetsRequest(input *DeleteFleetsInput) (req *request.Reques // // Deletes the specified EC2 Fleet. // -// After you delete an EC2 Fleet, it launches no new instances. You must specify -// whether an EC2 Fleet should also terminate its instances. If you terminate -// the instances, the EC2 Fleet enters the deleted_terminating state. Otherwise, -// the EC2 Fleet enters the deleted_running state, and the instances continue -// to run until they are interrupted or you terminate them manually. +// After you delete an EC2 Fleet, it launches no new instances. +// +// You must specify whether a deleted EC2 Fleet should also terminate its instances. +// If you choose to terminate the instances, the EC2 Fleet enters the deleted_terminating +// state. Otherwise, the EC2 Fleet enters the deleted_running state, and the +// instances continue to run until they are interrupted or you terminate them +// manually. +// +// For instant fleets, EC2 Fleet must terminate the instances when the fleet +// is deleted. A deleted instant fleet with running instances is not supported. +// +// Restrictions +// +// * You can delete up to 25 instant fleets in a single request. If you exceed +// this number, no instant fleets are deleted and an error is returned. There +// is no restriction on the number of fleets of type maintain or request +// that can be deleted in a single request. +// +// * Up to 1000 instances can be terminated in a single request to delete +// instant fleets. +// +// For more information, see Deleting an EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#delete-fleet) +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -9602,6 +10215,154 @@ func (c *EC2) DeleteNetworkAclEntryWithContext(ctx aws.Context, input *DeleteNet return out, req.Send() } +const opDeleteNetworkInsightsAnalysis = "DeleteNetworkInsightsAnalysis" + +// DeleteNetworkInsightsAnalysisRequest generates a "aws/request.Request" representing the +// client's request for the DeleteNetworkInsightsAnalysis operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteNetworkInsightsAnalysis for more information on using the DeleteNetworkInsightsAnalysis +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteNetworkInsightsAnalysisRequest method. +// req, resp := client.DeleteNetworkInsightsAnalysisRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInsightsAnalysis +func (c *EC2) DeleteNetworkInsightsAnalysisRequest(input *DeleteNetworkInsightsAnalysisInput) (req *request.Request, output *DeleteNetworkInsightsAnalysisOutput) { + op := &request.Operation{ + Name: opDeleteNetworkInsightsAnalysis, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteNetworkInsightsAnalysisInput{} + } + + output = &DeleteNetworkInsightsAnalysisOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteNetworkInsightsAnalysis API operation for Amazon Elastic Compute Cloud. +// +// Deletes the specified network insights analysis. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DeleteNetworkInsightsAnalysis for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInsightsAnalysis +func (c *EC2) DeleteNetworkInsightsAnalysis(input *DeleteNetworkInsightsAnalysisInput) (*DeleteNetworkInsightsAnalysisOutput, error) { + req, out := c.DeleteNetworkInsightsAnalysisRequest(input) + return out, req.Send() +} + +// DeleteNetworkInsightsAnalysisWithContext is the same as DeleteNetworkInsightsAnalysis with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteNetworkInsightsAnalysis for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteNetworkInsightsAnalysisWithContext(ctx aws.Context, input *DeleteNetworkInsightsAnalysisInput, opts ...request.Option) (*DeleteNetworkInsightsAnalysisOutput, error) { + req, out := c.DeleteNetworkInsightsAnalysisRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteNetworkInsightsPath = "DeleteNetworkInsightsPath" + +// DeleteNetworkInsightsPathRequest generates a "aws/request.Request" representing the +// client's request for the DeleteNetworkInsightsPath operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteNetworkInsightsPath for more information on using the DeleteNetworkInsightsPath +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteNetworkInsightsPathRequest method. +// req, resp := client.DeleteNetworkInsightsPathRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInsightsPath +func (c *EC2) DeleteNetworkInsightsPathRequest(input *DeleteNetworkInsightsPathInput) (req *request.Request, output *DeleteNetworkInsightsPathOutput) { + op := &request.Operation{ + Name: opDeleteNetworkInsightsPath, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteNetworkInsightsPathInput{} + } + + output = &DeleteNetworkInsightsPathOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteNetworkInsightsPath API operation for Amazon Elastic Compute Cloud. +// +// Deletes the specified path. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DeleteNetworkInsightsPath for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInsightsPath +func (c *EC2) DeleteNetworkInsightsPath(input *DeleteNetworkInsightsPathInput) (*DeleteNetworkInsightsPathOutput, error) { + req, out := c.DeleteNetworkInsightsPathRequest(input) + return out, req.Send() +} + +// DeleteNetworkInsightsPathWithContext is the same as DeleteNetworkInsightsPath with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteNetworkInsightsPath for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteNetworkInsightsPathWithContext(ctx aws.Context, input *DeleteNetworkInsightsPathInput, opts ...request.Option) (*DeleteNetworkInsightsPathOutput, error) { + req, out := c.DeleteNetworkInsightsPathRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteNetworkInterface = "DeleteNetworkInterface" // DeleteNetworkInterfaceRequest generates a "aws/request.Request" representing the @@ -9803,7 +10564,7 @@ func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req // Deletes the specified placement group. You must terminate all instances in // the placement group before you can delete the placement group. For more information, // see Placement groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -10833,6 +11594,155 @@ func (c *EC2) DeleteTransitGatewayWithContext(ctx aws.Context, input *DeleteTran return out, req.Send() } +const opDeleteTransitGatewayConnect = "DeleteTransitGatewayConnect" + +// DeleteTransitGatewayConnectRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTransitGatewayConnect operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTransitGatewayConnect for more information on using the DeleteTransitGatewayConnect +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTransitGatewayConnectRequest method. +// req, resp := client.DeleteTransitGatewayConnectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayConnect +func (c *EC2) DeleteTransitGatewayConnectRequest(input *DeleteTransitGatewayConnectInput) (req *request.Request, output *DeleteTransitGatewayConnectOutput) { + op := &request.Operation{ + Name: opDeleteTransitGatewayConnect, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteTransitGatewayConnectInput{} + } + + output = &DeleteTransitGatewayConnectOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteTransitGatewayConnect API operation for Amazon Elastic Compute Cloud. +// +// Deletes the specified Connect attachment. You must first delete any Connect +// peers for the attachment. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DeleteTransitGatewayConnect for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayConnect +func (c *EC2) DeleteTransitGatewayConnect(input *DeleteTransitGatewayConnectInput) (*DeleteTransitGatewayConnectOutput, error) { + req, out := c.DeleteTransitGatewayConnectRequest(input) + return out, req.Send() +} + +// DeleteTransitGatewayConnectWithContext is the same as DeleteTransitGatewayConnect with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTransitGatewayConnect for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteTransitGatewayConnectWithContext(ctx aws.Context, input *DeleteTransitGatewayConnectInput, opts ...request.Option) (*DeleteTransitGatewayConnectOutput, error) { + req, out := c.DeleteTransitGatewayConnectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteTransitGatewayConnectPeer = "DeleteTransitGatewayConnectPeer" + +// DeleteTransitGatewayConnectPeerRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTransitGatewayConnectPeer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTransitGatewayConnectPeer for more information on using the DeleteTransitGatewayConnectPeer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTransitGatewayConnectPeerRequest method. +// req, resp := client.DeleteTransitGatewayConnectPeerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayConnectPeer +func (c *EC2) DeleteTransitGatewayConnectPeerRequest(input *DeleteTransitGatewayConnectPeerInput) (req *request.Request, output *DeleteTransitGatewayConnectPeerOutput) { + op := &request.Operation{ + Name: opDeleteTransitGatewayConnectPeer, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteTransitGatewayConnectPeerInput{} + } + + output = &DeleteTransitGatewayConnectPeerOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteTransitGatewayConnectPeer API operation for Amazon Elastic Compute Cloud. +// +// Deletes the specified Connect peer. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DeleteTransitGatewayConnectPeer for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayConnectPeer +func (c *EC2) DeleteTransitGatewayConnectPeer(input *DeleteTransitGatewayConnectPeerInput) (*DeleteTransitGatewayConnectPeerOutput, error) { + req, out := c.DeleteTransitGatewayConnectPeerRequest(input) + return out, req.Send() +} + +// DeleteTransitGatewayConnectPeerWithContext is the same as DeleteTransitGatewayConnectPeer with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTransitGatewayConnectPeer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteTransitGatewayConnectPeerWithContext(ctx aws.Context, input *DeleteTransitGatewayConnectPeerInput, opts ...request.Option) (*DeleteTransitGatewayConnectPeerOutput, error) { + req, out := c.DeleteTransitGatewayConnectPeerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteTransitGatewayMulticastDomain = "DeleteTransitGatewayMulticastDomain" // DeleteTransitGatewayMulticastDomainRequest generates a "aws/request.Request" representing the @@ -11635,10 +12545,26 @@ func (c *EC2) DeleteVpcEndpointsRequest(input *DeleteVpcEndpointsInput) (req *re // DeleteVpcEndpoints API operation for Amazon Elastic Compute Cloud. // -// Deletes one or more specified VPC endpoints. Deleting a gateway endpoint -// also deletes the endpoint routes in the route tables that were associated -// with the endpoint. Deleting an interface endpoint deletes the endpoint network -// interfaces. +// Deletes one or more specified VPC endpoints. You can delete any of the following +// types of VPC endpoints. +// +// * Gateway endpoint, +// +// * Gateway Load Balancer endpoint, +// +// * Interface endpoint +// +// The following rules apply when you delete a VPC endpoint: +// +// * When you delete a gateway endpoint, we delete the endpoint routes in +// the route tables that are associated with the endpoint. +// +// * When you delete a Gateway Load Balancer endpoint, we delete the endpoint +// network interfaces. You can only delete Gateway Load Balancer endpoints +// when the routes that are associated with the endpoint are deleted. +// +// * When you delete an interface endpoint, we delete the endpoint network +// interfaces. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -12550,6 +13476,139 @@ func (c *EC2) DescribeAddressesWithContext(ctx aws.Context, input *DescribeAddre return out, req.Send() } +const opDescribeAddressesAttribute = "DescribeAddressesAttribute" + +// DescribeAddressesAttributeRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAddressesAttribute operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeAddressesAttribute for more information on using the DescribeAddressesAttribute +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeAddressesAttributeRequest method. +// req, resp := client.DescribeAddressesAttributeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddressesAttribute +func (c *EC2) DescribeAddressesAttributeRequest(input *DescribeAddressesAttributeInput) (req *request.Request, output *DescribeAddressesAttributeOutput) { + op := &request.Operation{ + Name: opDescribeAddressesAttribute, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeAddressesAttributeInput{} + } + + output = &DescribeAddressesAttributeOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeAddressesAttribute API operation for Amazon Elastic Compute Cloud. +// +// Describes the attributes of the specified Elastic IP addresses. For requirements, +// see Using reverse DNS for email applications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#Using_Elastic_Addressing_Reverse_DNS). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeAddressesAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddressesAttribute +func (c *EC2) DescribeAddressesAttribute(input *DescribeAddressesAttributeInput) (*DescribeAddressesAttributeOutput, error) { + req, out := c.DescribeAddressesAttributeRequest(input) + return out, req.Send() +} + +// DescribeAddressesAttributeWithContext is the same as DescribeAddressesAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAddressesAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeAddressesAttributeWithContext(ctx aws.Context, input *DescribeAddressesAttributeInput, opts ...request.Option) (*DescribeAddressesAttributeOutput, error) { + req, out := c.DescribeAddressesAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeAddressesAttributePages iterates over the pages of a DescribeAddressesAttribute operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeAddressesAttribute method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeAddressesAttribute operation. +// pageNum := 0 +// err := client.DescribeAddressesAttributePages(params, +// func(page *ec2.DescribeAddressesAttributeOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeAddressesAttributePages(input *DescribeAddressesAttributeInput, fn func(*DescribeAddressesAttributeOutput, bool) bool) error { + return c.DescribeAddressesAttributePagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeAddressesAttributePagesWithContext same as DescribeAddressesAttributePages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeAddressesAttributePagesWithContext(ctx aws.Context, input *DescribeAddressesAttributeInput, fn func(*DescribeAddressesAttributeOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeAddressesAttributeInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAddressesAttributeRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeAddressesAttributeOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeAggregateIdFormat = "DescribeAggregateIdFormat" // DescribeAggregateIdFormatRequest generates a "aws/request.Request" representing the @@ -15013,6 +16072,9 @@ func (c *EC2) DescribeFleetHistoryRequest(input *DescribeFleetHistoryInput) (req // This ensures that you can query by the last evaluated time and not miss a // recorded event. EC2 Fleet events are available for 48 hours. // +// For more information, see Monitoring your EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html#monitor-ec2-fleet) +// in the Amazon EC2 User Guide. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -15087,6 +16149,9 @@ func (c *EC2) DescribeFleetInstancesRequest(input *DescribeFleetInstancesInput) // // Describes the running instances for the specified EC2 Fleet. // +// For more information, see Monitoring your EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html#monitor-ec2-fleet) +// in the Amazon EC2 User Guide. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -15167,6 +16232,9 @@ func (c *EC2) DescribeFleetsRequest(input *DescribeFleetsInput) (req *request.Re // // Describes the specified EC2 Fleets or all of your EC2 Fleets. // +// For more information, see Monitoring your EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html#monitor-ec2-fleet) +// in the Amazon EC2 User Guide. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -15646,8 +16714,8 @@ func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReserva // Hosts. When purchasing an offering, ensure that the instance family and Region // of the offering matches that of the Dedicated Hosts with which it is to be // associated. For more information about supported instance types, see Dedicated -// Hosts Overview (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Hosts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html) +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -16886,7 +17954,7 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc // the call works normally. // // For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -17103,18 +18171,18 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) // to identify hardware and software issues. For more information, see Status // checks for your instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html) // and Troubleshooting instances with failed status checks (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // * Scheduled events - Amazon EC2 can schedule events (such as reboot, stop, // or terminate) for your instances related to hardware issues, software // updates, or system maintenance. For more information, see Scheduled events // for your instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // * Instance state - You can manage your instances from the moment you launch // them through their termination. For more information, see Instance lifecycle // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -19553,6 +20621,270 @@ func (c *EC2) DescribeNetworkAclsPagesWithContext(ctx aws.Context, input *Descri return p.Err() } +const opDescribeNetworkInsightsAnalyses = "DescribeNetworkInsightsAnalyses" + +// DescribeNetworkInsightsAnalysesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNetworkInsightsAnalyses operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeNetworkInsightsAnalyses for more information on using the DescribeNetworkInsightsAnalyses +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeNetworkInsightsAnalysesRequest method. +// req, resp := client.DescribeNetworkInsightsAnalysesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInsightsAnalyses +func (c *EC2) DescribeNetworkInsightsAnalysesRequest(input *DescribeNetworkInsightsAnalysesInput) (req *request.Request, output *DescribeNetworkInsightsAnalysesOutput) { + op := &request.Operation{ + Name: opDescribeNetworkInsightsAnalyses, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeNetworkInsightsAnalysesInput{} + } + + output = &DescribeNetworkInsightsAnalysesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeNetworkInsightsAnalyses API operation for Amazon Elastic Compute Cloud. +// +// Describes one or more of your network insights analyses. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeNetworkInsightsAnalyses for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInsightsAnalyses +func (c *EC2) DescribeNetworkInsightsAnalyses(input *DescribeNetworkInsightsAnalysesInput) (*DescribeNetworkInsightsAnalysesOutput, error) { + req, out := c.DescribeNetworkInsightsAnalysesRequest(input) + return out, req.Send() +} + +// DescribeNetworkInsightsAnalysesWithContext is the same as DescribeNetworkInsightsAnalyses with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNetworkInsightsAnalyses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeNetworkInsightsAnalysesWithContext(ctx aws.Context, input *DescribeNetworkInsightsAnalysesInput, opts ...request.Option) (*DescribeNetworkInsightsAnalysesOutput, error) { + req, out := c.DescribeNetworkInsightsAnalysesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeNetworkInsightsAnalysesPages iterates over the pages of a DescribeNetworkInsightsAnalyses operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeNetworkInsightsAnalyses method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeNetworkInsightsAnalyses operation. +// pageNum := 0 +// err := client.DescribeNetworkInsightsAnalysesPages(params, +// func(page *ec2.DescribeNetworkInsightsAnalysesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeNetworkInsightsAnalysesPages(input *DescribeNetworkInsightsAnalysesInput, fn func(*DescribeNetworkInsightsAnalysesOutput, bool) bool) error { + return c.DescribeNetworkInsightsAnalysesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeNetworkInsightsAnalysesPagesWithContext same as DescribeNetworkInsightsAnalysesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeNetworkInsightsAnalysesPagesWithContext(ctx aws.Context, input *DescribeNetworkInsightsAnalysesInput, fn func(*DescribeNetworkInsightsAnalysesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNetworkInsightsAnalysesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNetworkInsightsAnalysesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeNetworkInsightsAnalysesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeNetworkInsightsPaths = "DescribeNetworkInsightsPaths" + +// DescribeNetworkInsightsPathsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNetworkInsightsPaths operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeNetworkInsightsPaths for more information on using the DescribeNetworkInsightsPaths +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeNetworkInsightsPathsRequest method. +// req, resp := client.DescribeNetworkInsightsPathsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInsightsPaths +func (c *EC2) DescribeNetworkInsightsPathsRequest(input *DescribeNetworkInsightsPathsInput) (req *request.Request, output *DescribeNetworkInsightsPathsOutput) { + op := &request.Operation{ + Name: opDescribeNetworkInsightsPaths, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeNetworkInsightsPathsInput{} + } + + output = &DescribeNetworkInsightsPathsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeNetworkInsightsPaths API operation for Amazon Elastic Compute Cloud. +// +// Describes one or more of your paths. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeNetworkInsightsPaths for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInsightsPaths +func (c *EC2) DescribeNetworkInsightsPaths(input *DescribeNetworkInsightsPathsInput) (*DescribeNetworkInsightsPathsOutput, error) { + req, out := c.DescribeNetworkInsightsPathsRequest(input) + return out, req.Send() +} + +// DescribeNetworkInsightsPathsWithContext is the same as DescribeNetworkInsightsPaths with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNetworkInsightsPaths for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeNetworkInsightsPathsWithContext(ctx aws.Context, input *DescribeNetworkInsightsPathsInput, opts ...request.Option) (*DescribeNetworkInsightsPathsOutput, error) { + req, out := c.DescribeNetworkInsightsPathsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeNetworkInsightsPathsPages iterates over the pages of a DescribeNetworkInsightsPaths operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeNetworkInsightsPaths method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeNetworkInsightsPaths operation. +// pageNum := 0 +// err := client.DescribeNetworkInsightsPathsPages(params, +// func(page *ec2.DescribeNetworkInsightsPathsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeNetworkInsightsPathsPages(input *DescribeNetworkInsightsPathsInput, fn func(*DescribeNetworkInsightsPathsOutput, bool) bool) error { + return c.DescribeNetworkInsightsPathsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeNetworkInsightsPathsPagesWithContext same as DescribeNetworkInsightsPathsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeNetworkInsightsPathsPagesWithContext(ctx aws.Context, input *DescribeNetworkInsightsPathsInput, fn func(*DescribeNetworkInsightsPathsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNetworkInsightsPathsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNetworkInsightsPathsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeNetworkInsightsPathsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" // DescribeNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the @@ -19938,7 +21270,7 @@ func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput // // Describes the specified placement groups or all of your placement groups. // For more information, see Placement groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -20463,6 +21795,140 @@ func (c *EC2) DescribeRegionsWithContext(ctx aws.Context, input *DescribeRegions return out, req.Send() } +const opDescribeReplaceRootVolumeTasks = "DescribeReplaceRootVolumeTasks" + +// DescribeReplaceRootVolumeTasksRequest generates a "aws/request.Request" representing the +// client's request for the DescribeReplaceRootVolumeTasks operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeReplaceRootVolumeTasks for more information on using the DescribeReplaceRootVolumeTasks +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeReplaceRootVolumeTasksRequest method. +// req, resp := client.DescribeReplaceRootVolumeTasksRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReplaceRootVolumeTasks +func (c *EC2) DescribeReplaceRootVolumeTasksRequest(input *DescribeReplaceRootVolumeTasksInput) (req *request.Request, output *DescribeReplaceRootVolumeTasksOutput) { + op := &request.Operation{ + Name: opDescribeReplaceRootVolumeTasks, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeReplaceRootVolumeTasksInput{} + } + + output = &DescribeReplaceRootVolumeTasksOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeReplaceRootVolumeTasks API operation for Amazon Elastic Compute Cloud. +// +// Describes a root volume replacement task. For more information, see Replace +// a root volume (https://docs.aws.amazon.com/) in the Amazon Elastic Compute +// Cloud User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeReplaceRootVolumeTasks for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReplaceRootVolumeTasks +func (c *EC2) DescribeReplaceRootVolumeTasks(input *DescribeReplaceRootVolumeTasksInput) (*DescribeReplaceRootVolumeTasksOutput, error) { + req, out := c.DescribeReplaceRootVolumeTasksRequest(input) + return out, req.Send() +} + +// DescribeReplaceRootVolumeTasksWithContext is the same as DescribeReplaceRootVolumeTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeReplaceRootVolumeTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeReplaceRootVolumeTasksWithContext(ctx aws.Context, input *DescribeReplaceRootVolumeTasksInput, opts ...request.Option) (*DescribeReplaceRootVolumeTasksOutput, error) { + req, out := c.DescribeReplaceRootVolumeTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeReplaceRootVolumeTasksPages iterates over the pages of a DescribeReplaceRootVolumeTasks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeReplaceRootVolumeTasks method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeReplaceRootVolumeTasks operation. +// pageNum := 0 +// err := client.DescribeReplaceRootVolumeTasksPages(params, +// func(page *ec2.DescribeReplaceRootVolumeTasksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeReplaceRootVolumeTasksPages(input *DescribeReplaceRootVolumeTasksInput, fn func(*DescribeReplaceRootVolumeTasksOutput, bool) bool) error { + return c.DescribeReplaceRootVolumeTasksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeReplaceRootVolumeTasksPagesWithContext same as DescribeReplaceRootVolumeTasksPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeReplaceRootVolumeTasksPagesWithContext(ctx aws.Context, input *DescribeReplaceRootVolumeTasksInput, fn func(*DescribeReplaceRootVolumeTasksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReplaceRootVolumeTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReplaceRootVolumeTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeReplaceRootVolumeTasksOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeReservedInstances = "DescribeReservedInstances" // DescribeReservedInstancesRequest generates a "aws/request.Request" representing the @@ -20510,7 +21976,7 @@ func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesI // Describes one or more of the Reserved Instances that you purchased. // // For more information about Reserved Instances, see Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -20605,7 +22071,7 @@ func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedIn // that you purchase. // // For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -20691,7 +22157,7 @@ func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReser // about the specific modification is returned. // // For more information, see Modifying Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -20834,7 +22300,7 @@ func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedI // that you do not purchase your own Reserved Instances. // // For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -21589,7 +23055,7 @@ func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeI // Describes the specified attribute of the specified snapshot. You can specify // only one attribute at a time. // -// For more information about EBS snapshots, see Amazon EBS Snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) +// For more information about EBS snapshots, see Amazon EBS snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -21718,7 +23184,7 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ // // To get the state of fast snapshot restores for a snapshot, use DescribeFastSnapshotRestores. // -// For more information about EBS snapshots, see Amazon EBS Snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) +// For more information about EBS snapshots, see Amazon EBS snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -22367,10 +23833,10 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp // pricing history (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html) // in the Amazon EC2 User Guide for Linux Instances. // -// When you specify a start and end time, this operation returns the prices -// of the instance types within the time range that you specified and the time -// when the price changed. The price is valid within the time period that you -// specified; the response merely indicates the last time that the price changed. +// When you specify a start and end time, the operation returns the prices of +// the instance types within that time range. It also returns the last price +// change before the start time, which is the effective price as of the start +// time. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -22587,6 +24053,154 @@ func (c *EC2) DescribeStaleSecurityGroupsPagesWithContext(ctx aws.Context, input return p.Err() } +const opDescribeStoreImageTasks = "DescribeStoreImageTasks" + +// DescribeStoreImageTasksRequest generates a "aws/request.Request" representing the +// client's request for the DescribeStoreImageTasks operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeStoreImageTasks for more information on using the DescribeStoreImageTasks +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeStoreImageTasksRequest method. +// req, resp := client.DescribeStoreImageTasksRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStoreImageTasks +func (c *EC2) DescribeStoreImageTasksRequest(input *DescribeStoreImageTasksInput) (req *request.Request, output *DescribeStoreImageTasksOutput) { + op := &request.Operation{ + Name: opDescribeStoreImageTasks, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeStoreImageTasksInput{} + } + + output = &DescribeStoreImageTasksOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeStoreImageTasks API operation for Amazon Elastic Compute Cloud. +// +// Describes the progress of the AMI store tasks. You can describe the store +// tasks for specified AMIs. If you don't specify the AMIs, you get a paginated +// list of store tasks from the last 31 days. +// +// For each AMI task, the response indicates if the task is InProgress, Completed, +// or Failed. For tasks InProgress, the response shows the estimated progress +// as a percentage. +// +// Tasks are listed in reverse chronological order. Currently, only tasks from +// the past 31 days can be viewed. +// +// To use this API, you must have the required permissions. For more information, +// see Permissions for storing and restoring AMIs using S3 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html#ami-s3-permissions) +// in the Amazon Elastic Compute Cloud User Guide. +// +// For more information, see Store and restore an AMI using S3 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeStoreImageTasks for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStoreImageTasks +func (c *EC2) DescribeStoreImageTasks(input *DescribeStoreImageTasksInput) (*DescribeStoreImageTasksOutput, error) { + req, out := c.DescribeStoreImageTasksRequest(input) + return out, req.Send() +} + +// DescribeStoreImageTasksWithContext is the same as DescribeStoreImageTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStoreImageTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeStoreImageTasksWithContext(ctx aws.Context, input *DescribeStoreImageTasksInput, opts ...request.Option) (*DescribeStoreImageTasksOutput, error) { + req, out := c.DescribeStoreImageTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeStoreImageTasksPages iterates over the pages of a DescribeStoreImageTasks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeStoreImageTasks method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeStoreImageTasks operation. +// pageNum := 0 +// err := client.DescribeStoreImageTasksPages(params, +// func(page *ec2.DescribeStoreImageTasksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeStoreImageTasksPages(input *DescribeStoreImageTasksInput, fn func(*DescribeStoreImageTasksOutput, bool) bool) error { + return c.DescribeStoreImageTasksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeStoreImageTasksPagesWithContext same as DescribeStoreImageTasksPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeStoreImageTasksPagesWithContext(ctx aws.Context, input *DescribeStoreImageTasksInput, fn func(*DescribeStoreImageTasksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeStoreImageTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStoreImageTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeStoreImageTasksOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeSubnets = "DescribeSubnets" // DescribeSubnetsRequest generates a "aws/request.Request" representing the @@ -23389,6 +25003,270 @@ func (c *EC2) DescribeTransitGatewayAttachmentsPagesWithContext(ctx aws.Context, return p.Err() } +const opDescribeTransitGatewayConnectPeers = "DescribeTransitGatewayConnectPeers" + +// DescribeTransitGatewayConnectPeersRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTransitGatewayConnectPeers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeTransitGatewayConnectPeers for more information on using the DescribeTransitGatewayConnectPeers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTransitGatewayConnectPeersRequest method. +// req, resp := client.DescribeTransitGatewayConnectPeersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayConnectPeers +func (c *EC2) DescribeTransitGatewayConnectPeersRequest(input *DescribeTransitGatewayConnectPeersInput) (req *request.Request, output *DescribeTransitGatewayConnectPeersOutput) { + op := &request.Operation{ + Name: opDescribeTransitGatewayConnectPeers, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeTransitGatewayConnectPeersInput{} + } + + output = &DescribeTransitGatewayConnectPeersOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTransitGatewayConnectPeers API operation for Amazon Elastic Compute Cloud. +// +// Describes one or more Connect peers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeTransitGatewayConnectPeers for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayConnectPeers +func (c *EC2) DescribeTransitGatewayConnectPeers(input *DescribeTransitGatewayConnectPeersInput) (*DescribeTransitGatewayConnectPeersOutput, error) { + req, out := c.DescribeTransitGatewayConnectPeersRequest(input) + return out, req.Send() +} + +// DescribeTransitGatewayConnectPeersWithContext is the same as DescribeTransitGatewayConnectPeers with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTransitGatewayConnectPeers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewayConnectPeersWithContext(ctx aws.Context, input *DescribeTransitGatewayConnectPeersInput, opts ...request.Option) (*DescribeTransitGatewayConnectPeersOutput, error) { + req, out := c.DescribeTransitGatewayConnectPeersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeTransitGatewayConnectPeersPages iterates over the pages of a DescribeTransitGatewayConnectPeers operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGatewayConnectPeers method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeTransitGatewayConnectPeers operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayConnectPeersPages(params, +// func(page *ec2.DescribeTransitGatewayConnectPeersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayConnectPeersPages(input *DescribeTransitGatewayConnectPeersInput, fn func(*DescribeTransitGatewayConnectPeersOutput, bool) bool) error { + return c.DescribeTransitGatewayConnectPeersPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewayConnectPeersPagesWithContext same as DescribeTransitGatewayConnectPeersPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewayConnectPeersPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayConnectPeersInput, fn func(*DescribeTransitGatewayConnectPeersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayConnectPeersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayConnectPeersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeTransitGatewayConnectPeersOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeTransitGatewayConnects = "DescribeTransitGatewayConnects" + +// DescribeTransitGatewayConnectsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTransitGatewayConnects operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeTransitGatewayConnects for more information on using the DescribeTransitGatewayConnects +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTransitGatewayConnectsRequest method. +// req, resp := client.DescribeTransitGatewayConnectsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayConnects +func (c *EC2) DescribeTransitGatewayConnectsRequest(input *DescribeTransitGatewayConnectsInput) (req *request.Request, output *DescribeTransitGatewayConnectsOutput) { + op := &request.Operation{ + Name: opDescribeTransitGatewayConnects, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeTransitGatewayConnectsInput{} + } + + output = &DescribeTransitGatewayConnectsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTransitGatewayConnects API operation for Amazon Elastic Compute Cloud. +// +// Describes one or more Connect attachments. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeTransitGatewayConnects for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayConnects +func (c *EC2) DescribeTransitGatewayConnects(input *DescribeTransitGatewayConnectsInput) (*DescribeTransitGatewayConnectsOutput, error) { + req, out := c.DescribeTransitGatewayConnectsRequest(input) + return out, req.Send() +} + +// DescribeTransitGatewayConnectsWithContext is the same as DescribeTransitGatewayConnects with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTransitGatewayConnects for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewayConnectsWithContext(ctx aws.Context, input *DescribeTransitGatewayConnectsInput, opts ...request.Option) (*DescribeTransitGatewayConnectsOutput, error) { + req, out := c.DescribeTransitGatewayConnectsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeTransitGatewayConnectsPages iterates over the pages of a DescribeTransitGatewayConnects operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGatewayConnects method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeTransitGatewayConnects operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayConnectsPages(params, +// func(page *ec2.DescribeTransitGatewayConnectsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayConnectsPages(input *DescribeTransitGatewayConnectsInput, fn func(*DescribeTransitGatewayConnectsOutput, bool) bool) error { + return c.DescribeTransitGatewayConnectsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewayConnectsPagesWithContext same as DescribeTransitGatewayConnectsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewayConnectsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayConnectsInput, fn func(*DescribeTransitGatewayConnectsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayConnectsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayConnectsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeTransitGatewayConnectsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeTransitGatewayMulticastDomains = "DescribeTransitGatewayMulticastDomains" // DescribeTransitGatewayMulticastDomainsRequest generates a "aws/request.Request" representing the @@ -24099,7 +25977,7 @@ func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput // Describes the specified attribute of the specified volume. You can specify // only one attribute at a time. // -// For more information about EBS volumes, see Amazon EBS Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) +// For more information about EBS volumes, see Amazon EBS volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -24195,19 +26073,19 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req // Status: Reflects the current status of the volume. The possible values are // ok, impaired , warning, or insufficient-data. If all checks pass, the overall // status of the volume is ok. If the check fails, the overall status is impaired. -// If the status is insufficient-data, then the checks may still be taking place -// on your volume at the time. We recommend that you retry the request. For -// more information about volume status, see Monitoring the status of your volumes -// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html) +// If the status is insufficient-data, then the checks might still be taking +// place on your volume at the time. We recommend that you retry the request. +// For more information about volume status, see Monitoring the status of your +// volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html) // in the Amazon Elastic Compute Cloud User Guide. // -// Events: Reflect the cause of a volume status and may require you to take +// Events: Reflect the cause of a volume status and might require you to take // action. For example, if your volume returns an impaired status, then the // volume event might be potential-data-inconsistency. This means that your // volume has been affected by an issue with the underlying host, has all I/O -// operations disabled, and may have inconsistent data. +// operations disabled, and might have inconsistent data. // -// Actions: Reflect the actions you may have to take in response to an event. +// Actions: Reflect the actions you might have to take in response to an event. // For example, if the status of the volume is impaired and the volume event // shows potential-data-inconsistency, then the action shows enable-volume-io. // This means that you may want to enable the I/O operations for the volume @@ -24356,7 +26234,7 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request. // with a NextToken value that can be passed to a subsequent DescribeVolumes // request to retrieve the remaining results. // -// For more information about EBS volumes, see Amazon EBS Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) +// For more information about EBS volumes, see Amazon EBS volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -25446,12 +27324,12 @@ func (c *EC2) DescribeVpcEndpointServicesRequest(input *DescribeVpcEndpointServi // // Describes available services to which you can create a VPC endpoint. // -// When the service provider and the consumer have different accounts multiple +// When the service provider and the consumer have different accounts in multiple // Availability Zones, and the consumer views the VPC endpoint service information, // the response only includes the common Availability Zones. For example, when // the service provider account uses us-east-1a and us-east-1c and the consumer -// uses us-east-1a and us-east-1a and us-east-1b, the response includes the -// VPC endpoint services in the common Availability Zone, us-east-1a. +// uses us-east-1a and us-east-1b, the response includes the VPC endpoint services +// in the common Availability Zone, us-east-1a. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -26480,7 +28358,7 @@ func (c *EC2) DisableEbsEncryptionByDefaultRequest(input *DisableEbsEncryptionBy // Disabling encryption by default does not change the encryption status of // your existing volumes. // -// For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -26586,6 +28464,84 @@ func (c *EC2) DisableFastSnapshotRestoresWithContext(ctx aws.Context, input *Dis return out, req.Send() } +const opDisableSerialConsoleAccess = "DisableSerialConsoleAccess" + +// DisableSerialConsoleAccessRequest generates a "aws/request.Request" representing the +// client's request for the DisableSerialConsoleAccess operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisableSerialConsoleAccess for more information on using the DisableSerialConsoleAccess +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisableSerialConsoleAccessRequest method. +// req, resp := client.DisableSerialConsoleAccessRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableSerialConsoleAccess +func (c *EC2) DisableSerialConsoleAccessRequest(input *DisableSerialConsoleAccessInput) (req *request.Request, output *DisableSerialConsoleAccessOutput) { + op := &request.Operation{ + Name: opDisableSerialConsoleAccess, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisableSerialConsoleAccessInput{} + } + + output = &DisableSerialConsoleAccessOutput{} + req = c.newRequest(op, input, output) + return +} + +// DisableSerialConsoleAccess API operation for Amazon Elastic Compute Cloud. +// +// Disables access to the EC2 serial console of all instances for your account. +// By default, access to the EC2 serial console is disabled for your account. +// For more information, see Manage account access to the EC2 serial console +// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-access-to-serial-console.html#serial-console-account-access) +// in the Amazon EC2 User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DisableSerialConsoleAccess for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableSerialConsoleAccess +func (c *EC2) DisableSerialConsoleAccess(input *DisableSerialConsoleAccessInput) (*DisableSerialConsoleAccessOutput, error) { + req, out := c.DisableSerialConsoleAccessRequest(input) + return out, req.Send() +} + +// DisableSerialConsoleAccessWithContext is the same as DisableSerialConsoleAccess with the addition of +// the ability to pass a context and additional request options. +// +// See DisableSerialConsoleAccess for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DisableSerialConsoleAccessWithContext(ctx aws.Context, input *DisableSerialConsoleAccessInput, opts ...request.Option) (*DisableSerialConsoleAccessOutput, error) { + req, out := c.DisableSerialConsoleAccessRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDisableTransitGatewayRouteTablePropagation = "DisableTransitGatewayRouteTablePropagation" // DisableTransitGatewayRouteTablePropagationRequest generates a "aws/request.Request" representing the @@ -27646,8 +29602,8 @@ func (c *EC2) EnableEbsEncryptionByDefaultRequest(input *EnableEbsEncryptionByDe // Enables EBS encryption by default for your account in the current Region. // // After you enable encryption by default, the EBS volumes that you create are -// are always encrypted, either using the default CMK or the CMK that you specified -// when you created each volume. For more information, see Amazon EBS Encryption +// always encrypted, either using the default CMK or the CMK that you specified +// when you created each volume. For more information, see Amazon EBS encryption // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // @@ -27771,6 +29727,84 @@ func (c *EC2) EnableFastSnapshotRestoresWithContext(ctx aws.Context, input *Enab return out, req.Send() } +const opEnableSerialConsoleAccess = "EnableSerialConsoleAccess" + +// EnableSerialConsoleAccessRequest generates a "aws/request.Request" representing the +// client's request for the EnableSerialConsoleAccess operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See EnableSerialConsoleAccess for more information on using the EnableSerialConsoleAccess +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the EnableSerialConsoleAccessRequest method. +// req, resp := client.EnableSerialConsoleAccessRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableSerialConsoleAccess +func (c *EC2) EnableSerialConsoleAccessRequest(input *EnableSerialConsoleAccessInput) (req *request.Request, output *EnableSerialConsoleAccessOutput) { + op := &request.Operation{ + Name: opEnableSerialConsoleAccess, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &EnableSerialConsoleAccessInput{} + } + + output = &EnableSerialConsoleAccessOutput{} + req = c.newRequest(op, input, output) + return +} + +// EnableSerialConsoleAccess API operation for Amazon Elastic Compute Cloud. +// +// Enables access to the EC2 serial console of all instances for your account. +// By default, access to the EC2 serial console is disabled for your account. +// For more information, see Manage account access to the EC2 serial console +// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-access-to-serial-console.html#serial-console-account-access) +// in the Amazon EC2 User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation EnableSerialConsoleAccess for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableSerialConsoleAccess +func (c *EC2) EnableSerialConsoleAccess(input *EnableSerialConsoleAccessInput) (*EnableSerialConsoleAccessOutput, error) { + req, out := c.EnableSerialConsoleAccessRequest(input) + return out, req.Send() +} + +// EnableSerialConsoleAccessWithContext is the same as EnableSerialConsoleAccess with the addition of +// the ability to pass a context and additional request options. +// +// See EnableSerialConsoleAccess for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) EnableSerialConsoleAccessWithContext(ctx aws.Context, input *EnableSerialConsoleAccessInput, opts ...request.Option) (*EnableSerialConsoleAccessOutput, error) { + req, out := c.EnableSerialConsoleAccessRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opEnableTransitGatewayRouteTablePropagation = "EnableTransitGatewayRouteTablePropagation" // EnableTransitGatewayRouteTablePropagationRequest generates a "aws/request.Request" representing the @@ -28357,7 +30391,7 @@ func (c *EC2) ExportImageRequest(input *ExportImageInput) (req *request.Request, // ExportImage API operation for Amazon Elastic Compute Cloud. // // Exports an Amazon Machine Image (AMI) to a VM file. For more information, -// see Exporting a VM Directory from an Amazon Machine Image (AMI) (https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport_image.html) +// see Exporting a VM directly from an Amazon Machine Image (AMI) (https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport_image.html) // in the VM Import/Export User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -28891,8 +30925,8 @@ func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *reques // during the instance lifecycle. This option is supported on instance types // that use the Nitro hypervisor. // -// For more information, see Instance Console Output (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html#instance-console-console-output) -// in the Amazon Elastic Compute Cloud User Guide. +// For more information, see Instance console output (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html#instance-console-console-output) +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -29046,7 +31080,7 @@ func (c *EC2) GetDefaultCreditSpecificationRequest(input *GetDefaultCreditSpecif // instance family. // // For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -29124,7 +31158,7 @@ func (c *EC2) GetEbsDefaultKmsKeyIdRequest(input *GetEbsDefaultKmsKeyIdInput) (r // for your account in this Region. You can change the default CMK for encryption // by default using ModifyEbsDefaultKmsKeyId or ResetEbsDefaultKmsKeyId. // -// For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -29202,7 +31236,7 @@ func (c *EC2) GetEbsEncryptionByDefaultRequest(input *GetEbsEncryptionByDefaultI // Describes whether EBS encryption by default is enabled for your account in // the current Region. // -// For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -29233,6 +31267,93 @@ func (c *EC2) GetEbsEncryptionByDefaultWithContext(ctx aws.Context, input *GetEb return out, req.Send() } +const opGetFlowLogsIntegrationTemplate = "GetFlowLogsIntegrationTemplate" + +// GetFlowLogsIntegrationTemplateRequest generates a "aws/request.Request" representing the +// client's request for the GetFlowLogsIntegrationTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetFlowLogsIntegrationTemplate for more information on using the GetFlowLogsIntegrationTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetFlowLogsIntegrationTemplateRequest method. +// req, resp := client.GetFlowLogsIntegrationTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetFlowLogsIntegrationTemplate +func (c *EC2) GetFlowLogsIntegrationTemplateRequest(input *GetFlowLogsIntegrationTemplateInput) (req *request.Request, output *GetFlowLogsIntegrationTemplateOutput) { + op := &request.Operation{ + Name: opGetFlowLogsIntegrationTemplate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetFlowLogsIntegrationTemplateInput{} + } + + output = &GetFlowLogsIntegrationTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetFlowLogsIntegrationTemplate API operation for Amazon Elastic Compute Cloud. +// +// Generates a CloudFormation template that streamlines and automates the integration +// of VPC flow logs with Amazon Athena. This make it easier for you to query +// and gain insights from VPC flow logs data. Based on the information that +// you provide, we configure resources in the template to do the following: +// +// * Create a table in Athena that maps fields to a custom log format +// +// * Create a Lambda function that updates the table with new partitions +// on a daily, weekly, or monthly basis +// +// * Create a table partitioned between two timestamps in the past +// +// * Create a set of named queries in Athena that you can use to get started +// quickly +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation GetFlowLogsIntegrationTemplate for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetFlowLogsIntegrationTemplate +func (c *EC2) GetFlowLogsIntegrationTemplate(input *GetFlowLogsIntegrationTemplateInput) (*GetFlowLogsIntegrationTemplateOutput, error) { + req, out := c.GetFlowLogsIntegrationTemplateRequest(input) + return out, req.Send() +} + +// GetFlowLogsIntegrationTemplateWithContext is the same as GetFlowLogsIntegrationTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See GetFlowLogsIntegrationTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetFlowLogsIntegrationTemplateWithContext(ctx aws.Context, input *GetFlowLogsIntegrationTemplateInput, opts ...request.Option) (*GetFlowLogsIntegrationTemplateOutput, error) { + req, out := c.GetFlowLogsIntegrationTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetGroupsForCapacityReservation = "GetGroupsForCapacityReservation" // GetGroupsForCapacityReservationRequest generates a "aws/request.Request" representing the @@ -29840,7 +31961,7 @@ func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *request. // scripts (Windows Server 2016 and later). This usually only happens the first // time an instance is launched. For more information, see EC2Config (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_WinAMI.html) // and EC2Launch (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // For the EC2Config service, the password is not generated for rebundled AMIs // unless Ec2SetPassword is enabled before bundling. @@ -29958,6 +32079,84 @@ func (c *EC2) GetReservedInstancesExchangeQuoteWithContext(ctx aws.Context, inpu return out, req.Send() } +const opGetSerialConsoleAccessStatus = "GetSerialConsoleAccessStatus" + +// GetSerialConsoleAccessStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetSerialConsoleAccessStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetSerialConsoleAccessStatus for more information on using the GetSerialConsoleAccessStatus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetSerialConsoleAccessStatusRequest method. +// req, resp := client.GetSerialConsoleAccessStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetSerialConsoleAccessStatus +func (c *EC2) GetSerialConsoleAccessStatusRequest(input *GetSerialConsoleAccessStatusInput) (req *request.Request, output *GetSerialConsoleAccessStatusOutput) { + op := &request.Operation{ + Name: opGetSerialConsoleAccessStatus, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetSerialConsoleAccessStatusInput{} + } + + output = &GetSerialConsoleAccessStatusOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetSerialConsoleAccessStatus API operation for Amazon Elastic Compute Cloud. +// +// Retrieves the access status of your account to the EC2 serial console of +// all instances. By default, access to the EC2 serial console is disabled for +// your account. For more information, see Manage account access to the EC2 +// serial console (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-access-to-serial-console.html#serial-console-account-access) +// in the Amazon EC2 User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation GetSerialConsoleAccessStatus for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetSerialConsoleAccessStatus +func (c *EC2) GetSerialConsoleAccessStatus(input *GetSerialConsoleAccessStatusInput) (*GetSerialConsoleAccessStatusOutput, error) { + req, out := c.GetSerialConsoleAccessStatusRequest(input) + return out, req.Send() +} + +// GetSerialConsoleAccessStatusWithContext is the same as GetSerialConsoleAccessStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetSerialConsoleAccessStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetSerialConsoleAccessStatusWithContext(ctx aws.Context, input *GetSerialConsoleAccessStatusInput, opts ...request.Option) (*GetSerialConsoleAccessStatusOutput, error) { + req, out := c.GetSerialConsoleAccessStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetTransitGatewayAttachmentPropagations = "GetTransitGatewayAttachmentPropagations" // GetTransitGatewayAttachmentPropagationsRequest generates a "aws/request.Request" representing the @@ -30746,8 +32945,10 @@ func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *request.Request, // ImportImage API operation for Amazon Elastic Compute Cloud. // // Import single or multi-volume disk images or EBS snapshots into an Amazon -// Machine Image (AMI). For more information, see Importing a VM as an Image -// Using VM Import/Export (https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html) +// Machine Image (AMI). +// +// For more information, see Importing a VM as an image using VM Import/Export +// (https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html) // in the VM Import/Export User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -30823,9 +33024,14 @@ func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *request.Re // ImportInstance API operation for Amazon Elastic Compute Cloud. // // Creates an import instance task using metadata from the specified disk image. -// ImportInstance only supports single-volume VMs. To import multi-volume VMs, -// use ImportImage. For more information, see Importing a Virtual Machine Using -// the Amazon EC2 CLI (https://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html). +// +// This API action supports only single-volume VMs. To import multi-volume VMs, +// use ImportImage instead. +// +// This API action is not supported by the AWS Command Line Interface (AWS CLI). +// For information about using the Amazon EC2 CLI, which is deprecated, see +// Importing a VM to Amazon EC2 (https://awsdocs.s3.amazonaws.com/EC2/ec2-clt.pdf#UsingVirtualMachinesinAmazonEC2) +// in the Amazon EC2 CLI Reference PDF file. // // For information about the import manifest referenced by this API action, // see VM Import Manifest (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). @@ -30985,6 +33191,10 @@ func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *request.Re // // Imports a disk into an EBS snapshot. // +// For more information, see Importing a disk as a snapshot using VM Import/Export +// (https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-import-snapshot.html) +// in the VM Import/Export User Guide. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -31057,8 +33267,16 @@ func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *request.Reques // ImportVolume API operation for Amazon Elastic Compute Cloud. // -// Creates an import volume task using metadata from the specified disk image.For -// more information, see Importing Disks to Amazon EBS (https://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/importing-your-volumes-into-amazon-ebs.html). +// Creates an import volume task using metadata from the specified disk image. +// +// This API action supports only single-volume VMs. To import multi-volume VMs, +// use ImportImage instead. To import a disk to a snapshot, use ImportSnapshot +// instead. +// +// This API action is not supported by the AWS Command Line Interface (AWS CLI). +// For information about using the Amazon EC2 CLI, which is deprecated, see +// Importing Disks to Amazon EBS (https://awsdocs.s3.amazonaws.com/EC2/ec2-clt.pdf#importing-your-volumes-into-amazon-ebs) +// in the Amazon EC2 CLI Reference PDF file. // // For information about the import manifest referenced by this API action, // see VM Import Manifest (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). @@ -31091,6 +33309,81 @@ func (c *EC2) ImportVolumeWithContext(ctx aws.Context, input *ImportVolumeInput, return out, req.Send() } +const opModifyAddressAttribute = "ModifyAddressAttribute" + +// ModifyAddressAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyAddressAttribute operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyAddressAttribute for more information on using the ModifyAddressAttribute +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyAddressAttributeRequest method. +// req, resp := client.ModifyAddressAttributeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyAddressAttribute +func (c *EC2) ModifyAddressAttributeRequest(input *ModifyAddressAttributeInput) (req *request.Request, output *ModifyAddressAttributeOutput) { + op := &request.Operation{ + Name: opModifyAddressAttribute, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyAddressAttributeInput{} + } + + output = &ModifyAddressAttributeOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyAddressAttribute API operation for Amazon Elastic Compute Cloud. +// +// Modifies an attribute of the specified Elastic IP address. For requirements, +// see Using reverse DNS for email applications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#Using_Elastic_Addressing_Reverse_DNS). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation ModifyAddressAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyAddressAttribute +func (c *EC2) ModifyAddressAttribute(input *ModifyAddressAttributeInput) (*ModifyAddressAttributeOutput, error) { + req, out := c.ModifyAddressAttributeRequest(input) + return out, req.Send() +} + +// ModifyAddressAttributeWithContext is the same as ModifyAddressAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyAddressAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ModifyAddressAttributeWithContext(ctx aws.Context, input *ModifyAddressAttributeInput, opts ...request.Option) (*ModifyAddressAttributeOutput, error) { + req, out := c.ModifyAddressAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifyAvailabilityZoneGroup = "ModifyAvailabilityZoneGroup" // ModifyAvailabilityZoneGroupRequest generates a "aws/request.Request" representing the @@ -31381,7 +33674,7 @@ func (c *EC2) ModifyDefaultCreditSpecificationRequest(input *ModifyDefaultCredit // for updates. // // For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -31467,7 +33760,7 @@ func (c *EC2) ModifyEbsDefaultKmsKeyIdRequest(input *ModifyEbsDefaultKmsKeyIdInp // If you delete or disable the customer managed CMK that you specified for // use with encryption by default, your instances will fail to launch. // -// For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -32093,7 +34386,7 @@ func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput // // To modify some attributes, the instance must be stopped. For more information, // see Modifying attributes of a stopped instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -32248,7 +34541,7 @@ func (c *EC2) ModifyInstanceCreditSpecificationRequest(input *ModifyInstanceCred // performance instance. The credit options are standard and unlimited. // // For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -32402,7 +34695,8 @@ func (c *EC2) ModifyInstanceMetadataOptionsRequest(input *ModifyInstanceMetadata // the API responds with a state of “pending”. After the parameter modifications // are successfully applied to the instance, the state of the modifications // changes from “pending” to “applied” in subsequent describe-instances -// API calls. For more information, see Instance metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). +// API calls. For more information, see Instance metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -32810,7 +35104,7 @@ func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput // network platform, and instance type. // // For more information, see Modifying Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -33611,7 +35905,7 @@ func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Reques // // You can modify several parameters of an existing EBS volume, including volume // size, volume type, and IOPS capacity. If your EBS volume is attached to a -// current-generation EC2 instance type, you may be able to apply these changes +// current-generation EC2 instance type, you might be able to apply these changes // without stopping the instance or detaching the volume from it. For more information // about modifying an EBS volume running Linux, see Modifying the size, IOPS, // or type of an EBS volume on Linux (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html). @@ -33632,11 +35926,11 @@ func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Reques // For information about tracking status changes using either method, see Monitoring // volume modifications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). // -// With previous-generation instance types, resizing an EBS volume may require +// With previous-generation instance types, resizing an EBS volume might require // detaching and reattaching the volume or stopping and restarting the instance. -// For more information, see Modifying the size, IOPS, or type of an EBS volume -// on Linux (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html) -// and Modifying the size, IOPS, or type of an EBS volume on Windows (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). +// For more information, see Amazon EBS Elastic Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modify-volume.html) +// (Linux) or Amazon EBS Elastic Volumes (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-modify-volume.html) +// (Windows). // // If you reach the maximum volume modification rate per volume limit, you will // need to wait at least six hours before applying further modifications to @@ -33874,8 +36168,8 @@ func (c *EC2) ModifyVpcEndpointRequest(input *ModifyVpcEndpointInput) (req *requ // ModifyVpcEndpoint API operation for Amazon Elastic Compute Cloud. // // Modifies attributes of a specified VPC endpoint. The attributes that you -// can modify depend on the type of VPC endpoint (interface or gateway). For -// more information, see VPC Endpoints (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) +// can modify depend on the type of VPC endpoint (interface, gateway, or Gateway +// Load Balancer). For more information, see VPC Endpoints (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) // in the Amazon Virtual Private Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -34027,9 +36321,9 @@ func (c *EC2) ModifyVpcEndpointServiceConfigurationRequest(input *ModifyVpcEndpo // ModifyVpcEndpointServiceConfiguration API operation for Amazon Elastic Compute Cloud. // // Modifies the attributes of your VPC endpoint service configuration. You can -// change the Network Load Balancers for your service, and you can specify whether -// acceptance is required for requests to connect to your endpoint service through -// an interface VPC endpoint. +// change the Network Load Balancers or Gateway Load Balancers for your service, +// and you can specify whether acceptance is required for requests to connect +// to your endpoint service through an interface VPC endpoint. // // If you set or modify the private DNS name, you must prove that you own the // private DNS domain name. For more information, see VPC Endpoint Service Private @@ -34717,7 +37011,7 @@ func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *reques // Enables detailed monitoring for a running instance. Otherwise, basic monitoring // is enabled. For more information, see Monitoring your instances and volumes // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // To disable detailed monitoring, see . // @@ -35053,7 +37347,7 @@ func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedIn // // For more information, see Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) // and Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -35221,7 +37515,7 @@ func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request. // // For more information about troubleshooting, see Getting console output and // rebooting instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -35303,12 +37597,25 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ // For Amazon EBS-backed instances, CreateImage creates and registers the AMI // in a single request, so you don't have to register the AMI yourself. // -// You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from -// a snapshot of a root device volume. You specify the snapshot using the block -// device mapping. For more information, see Launching a Linux instance from -// a backup (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html) +// If needed, you can deregister an AMI at any time. Any modifications you make +// to an AMI backed by an instance store volume invalidates its registration. +// If you make changes to an image, deregister the previous image and register +// the new image. +// +// Register a snapshot of a root device volume +// +// You can use RegisterImage to create an Amazon EBS-backed Linux AMI from a +// snapshot of a root device volume. You specify the snapshot using a block +// device mapping. You can't set the encryption state of the volume using the +// block device mapping. If the snapshot is encrypted, or encryption by default +// is enabled, the root volume of an instance launched from the AMI is encrypted. +// +// For more information, see Create a Linux AMI from a snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html#creating-launching-ami-from-snapshot) +// and Use encryption with EBS-backed AMIs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // +// AWS Marketplace product codes +// // If any snapshots have AWS Marketplace product codes, they are copied to the // new AMI. // @@ -35334,11 +37641,6 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ // Obtaining billing information (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html) // in the Amazon Elastic Compute Cloud User Guide. // -// If needed, you can deregister an AMI at any time. Any modifications you make -// to an AMI backed by an instance store volume invalidates its registration. -// If you make changes to an image, deregister the previous image and register -// the new image. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -35608,6 +37910,81 @@ func (c *EC2) RegisterTransitGatewayMulticastGroupSourcesWithContext(ctx aws.Con return out, req.Send() } +const opRejectTransitGatewayMulticastDomainAssociations = "RejectTransitGatewayMulticastDomainAssociations" + +// RejectTransitGatewayMulticastDomainAssociationsRequest generates a "aws/request.Request" representing the +// client's request for the RejectTransitGatewayMulticastDomainAssociations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RejectTransitGatewayMulticastDomainAssociations for more information on using the RejectTransitGatewayMulticastDomainAssociations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RejectTransitGatewayMulticastDomainAssociationsRequest method. +// req, resp := client.RejectTransitGatewayMulticastDomainAssociationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectTransitGatewayMulticastDomainAssociations +func (c *EC2) RejectTransitGatewayMulticastDomainAssociationsRequest(input *RejectTransitGatewayMulticastDomainAssociationsInput) (req *request.Request, output *RejectTransitGatewayMulticastDomainAssociationsOutput) { + op := &request.Operation{ + Name: opRejectTransitGatewayMulticastDomainAssociations, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RejectTransitGatewayMulticastDomainAssociationsInput{} + } + + output = &RejectTransitGatewayMulticastDomainAssociationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// RejectTransitGatewayMulticastDomainAssociations API operation for Amazon Elastic Compute Cloud. +// +// Rejects a request to associate cross-account subnets with a transit gateway +// multicast domain. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation RejectTransitGatewayMulticastDomainAssociations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectTransitGatewayMulticastDomainAssociations +func (c *EC2) RejectTransitGatewayMulticastDomainAssociations(input *RejectTransitGatewayMulticastDomainAssociationsInput) (*RejectTransitGatewayMulticastDomainAssociationsOutput, error) { + req, out := c.RejectTransitGatewayMulticastDomainAssociationsRequest(input) + return out, req.Send() +} + +// RejectTransitGatewayMulticastDomainAssociationsWithContext is the same as RejectTransitGatewayMulticastDomainAssociations with the addition of +// the ability to pass a context and additional request options. +// +// See RejectTransitGatewayMulticastDomainAssociations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) RejectTransitGatewayMulticastDomainAssociationsWithContext(ctx aws.Context, input *RejectTransitGatewayMulticastDomainAssociationsInput, opts ...request.Option) (*RejectTransitGatewayMulticastDomainAssociationsOutput, error) { + req, out := c.RejectTransitGatewayMulticastDomainAssociationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opRejectTransitGatewayPeeringAttachment = "RejectTransitGatewayPeeringAttachment" // RejectTransitGatewayPeeringAttachmentRequest generates a "aws/request.Request" representing the @@ -36817,6 +39194,81 @@ func (c *EC2) RequestSpotInstancesWithContext(ctx aws.Context, input *RequestSpo return out, req.Send() } +const opResetAddressAttribute = "ResetAddressAttribute" + +// ResetAddressAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ResetAddressAttribute operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResetAddressAttribute for more information on using the ResetAddressAttribute +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResetAddressAttributeRequest method. +// req, resp := client.ResetAddressAttributeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetAddressAttribute +func (c *EC2) ResetAddressAttributeRequest(input *ResetAddressAttributeInput) (req *request.Request, output *ResetAddressAttributeOutput) { + op := &request.Operation{ + Name: opResetAddressAttribute, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ResetAddressAttributeInput{} + } + + output = &ResetAddressAttributeOutput{} + req = c.newRequest(op, input, output) + return +} + +// ResetAddressAttribute API operation for Amazon Elastic Compute Cloud. +// +// Resets the attribute of the specified IP address. For requirements, see Using +// reverse DNS for email applications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#Using_Elastic_Addressing_Reverse_DNS). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation ResetAddressAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetAddressAttribute +func (c *EC2) ResetAddressAttribute(input *ResetAddressAttributeInput) (*ResetAddressAttributeOutput, error) { + req, out := c.ResetAddressAttributeRequest(input) + return out, req.Send() +} + +// ResetAddressAttributeWithContext is the same as ResetAddressAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ResetAddressAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ResetAddressAttributeWithContext(ctx aws.Context, input *ResetAddressAttributeInput, opts ...request.Option) (*ResetAddressAttributeOutput, error) { + req, out := c.ResetAddressAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opResetEbsDefaultKmsKeyId = "ResetEbsDefaultKmsKeyId" // ResetEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the @@ -36866,7 +39318,7 @@ func (c *EC2) ResetEbsDefaultKmsKeyIdRequest(input *ResetEbsDefaultKmsKeyIdInput // // After resetting the default CMK to the AWS managed CMK, you can continue // to encrypt by a customer managed CMK by specifying it when you create the -// volume. For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// volume. For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -37102,7 +39554,7 @@ func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) // is enabled. The default value is true, which means checking is enabled. This // value must be false for a NAT instance to perform NAT. For more information, // see NAT Instances (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) -// in the Amazon Virtual Private Cloud User Guide. +// in the Amazon VPC User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -37789,13 +40241,11 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques // Linux instances have access to the public key of the key pair at boot. You // can use this key to provide secure access to the instance. Amazon EC2 public // images use this feature to provide secure access without passwords. For more -// information, see Key pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. +// information, see Key pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html). // // For troubleshooting, see What to do if an instance immediately terminates // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html), -// and Troubleshooting connecting to your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html) -// in the Amazon Elastic Compute Cloud User Guide. +// and Troubleshooting connecting to your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -37879,7 +40329,7 @@ func (c *EC2) RunScheduledInstancesRequest(input *RunScheduledInstancesInput) (r // If you terminate a Scheduled Instance before the current scheduled time period // ends, you can launch it again after a few minutes. For more information, // see Scheduled Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-scheduled-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -38406,7 +40856,7 @@ func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *request.Re // root device returns an error. // // For more information, see Stopping instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -38436,6 +40886,81 @@ func (c *EC2) StartInstancesWithContext(ctx aws.Context, input *StartInstancesIn return out, req.Send() } +const opStartNetworkInsightsAnalysis = "StartNetworkInsightsAnalysis" + +// StartNetworkInsightsAnalysisRequest generates a "aws/request.Request" representing the +// client's request for the StartNetworkInsightsAnalysis operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartNetworkInsightsAnalysis for more information on using the StartNetworkInsightsAnalysis +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartNetworkInsightsAnalysisRequest method. +// req, resp := client.StartNetworkInsightsAnalysisRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartNetworkInsightsAnalysis +func (c *EC2) StartNetworkInsightsAnalysisRequest(input *StartNetworkInsightsAnalysisInput) (req *request.Request, output *StartNetworkInsightsAnalysisOutput) { + op := &request.Operation{ + Name: opStartNetworkInsightsAnalysis, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartNetworkInsightsAnalysisInput{} + } + + output = &StartNetworkInsightsAnalysisOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartNetworkInsightsAnalysis API operation for Amazon Elastic Compute Cloud. +// +// Starts analyzing the specified path. If the path is reachable, the operation +// returns the shortest feasible path. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation StartNetworkInsightsAnalysis for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartNetworkInsightsAnalysis +func (c *EC2) StartNetworkInsightsAnalysis(input *StartNetworkInsightsAnalysisInput) (*StartNetworkInsightsAnalysisOutput, error) { + req, out := c.StartNetworkInsightsAnalysisRequest(input) + return out, req.Send() +} + +// StartNetworkInsightsAnalysisWithContext is the same as StartNetworkInsightsAnalysis with the addition of +// the ability to pass a context and additional request options. +// +// See StartNetworkInsightsAnalysis for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) StartNetworkInsightsAnalysisWithContext(ctx aws.Context, input *StartNetworkInsightsAnalysisInput, opts ...request.Option) (*StartNetworkInsightsAnalysisOutput, error) { + req, out := c.StartNetworkInsightsAnalysisRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opStartVpcEndpointServicePrivateDnsVerification = "StartVpcEndpointServicePrivateDnsVerification" // StartVpcEndpointServicePrivateDnsVerificationRequest generates a "aws/request.Request" representing the @@ -38569,7 +41094,7 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ // for hibernation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#enabling-hibernation) // and it meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). // For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // We don't charge usage for a stopped instance, or data transfer fees; however, // your root partition Amazon EBS volume remains and continues to persist your @@ -38585,7 +41110,7 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ // the Stop action to hibernate Spot Instances, but you can specify that Amazon // EC2 should hibernate Spot Instances when they are interrupted. For more information, // see Hibernating interrupted Spot Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html#hibernate-spot-instances) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // When you stop or hibernate an instance, we shut it down. You can restart // your instance at any time. Before stopping or hibernating an instance, make @@ -38601,13 +41126,13 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ // launch are automatically deleted. For more information about the differences // between rebooting, stopping, hibernating, and terminating instances, see // Instance lifecycle (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // When you stop an instance, we attempt to shut it down forcibly after a short // while. If your instance appears stuck in the stopping state after a period // of time, there may be an issue with the underlying host computer. For more // information, see Troubleshooting stopping your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -38777,11 +41302,11 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *re // device mapping parameter set to true are automatically deleted. For more // information about the differences between stopping and terminating instances, // see Instance lifecycle (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // For more information about troubleshooting, see Troubleshooting terminating // your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -39006,7 +41531,7 @@ func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *re // // Disables detailed monitoring for a running instance. For more information, // see Monitoring your instances and volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -39372,6 +41897,82 @@ func (s *AcceptReservedInstancesExchangeQuoteOutput) SetExchangeId(v string) *Ac return s } +type AcceptTransitGatewayMulticastDomainAssociationsInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The IDs of the subnets to associate with the transit gateway multicast domain. + SubnetIds []*string `locationNameList:"item" type:"list"` + + // The ID of the transit gateway attachment. + TransitGatewayAttachmentId *string `type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` +} + +// String returns the string representation +func (s AcceptTransitGatewayMulticastDomainAssociationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptTransitGatewayMulticastDomainAssociationsInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *AcceptTransitGatewayMulticastDomainAssociationsInput) SetDryRun(v bool) *AcceptTransitGatewayMulticastDomainAssociationsInput { + s.DryRun = &v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *AcceptTransitGatewayMulticastDomainAssociationsInput) SetSubnetIds(v []*string) *AcceptTransitGatewayMulticastDomainAssociationsInput { + s.SubnetIds = v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *AcceptTransitGatewayMulticastDomainAssociationsInput) SetTransitGatewayAttachmentId(v string) *AcceptTransitGatewayMulticastDomainAssociationsInput { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *AcceptTransitGatewayMulticastDomainAssociationsInput) SetTransitGatewayMulticastDomainId(v string) *AcceptTransitGatewayMulticastDomainAssociationsInput { + s.TransitGatewayMulticastDomainId = &v + return s +} + +type AcceptTransitGatewayMulticastDomainAssociationsOutput struct { + _ struct{} `type:"structure"` + + // Describes the multicast domain associations. + Associations *TransitGatewayMulticastDomainAssociations `locationName:"associations" type:"structure"` +} + +// String returns the string representation +func (s AcceptTransitGatewayMulticastDomainAssociationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptTransitGatewayMulticastDomainAssociationsOutput) GoString() string { + return s.String() +} + +// SetAssociations sets the Associations field's value. +func (s *AcceptTransitGatewayMulticastDomainAssociationsOutput) SetAssociations(v *TransitGatewayMulticastDomainAssociations) *AcceptTransitGatewayMulticastDomainAssociationsOutput { + s.Associations = v + return s +} + type AcceptTransitGatewayPeeringAttachmentInput struct { _ struct{} `type:"structure"` @@ -39970,6 +42571,57 @@ func (s *Address) SetTags(v []*Tag) *Address { return s } +// The attributes associated with an Elastic IP address. +type AddressAttribute struct { + _ struct{} `type:"structure"` + + // [EC2-VPC] The allocation ID. + AllocationId *string `locationName:"allocationId" type:"string"` + + // The pointer (PTR) record for the IP address. + PtrRecord *string `locationName:"ptrRecord" type:"string"` + + // The updated PTR record for the IP address. + PtrRecordUpdate *PtrUpdateStatus `locationName:"ptrRecordUpdate" type:"structure"` + + // The public IP address. + PublicIp *string `locationName:"publicIp" type:"string"` +} + +// String returns the string representation +func (s AddressAttribute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddressAttribute) GoString() string { + return s.String() +} + +// SetAllocationId sets the AllocationId field's value. +func (s *AddressAttribute) SetAllocationId(v string) *AddressAttribute { + s.AllocationId = &v + return s +} + +// SetPtrRecord sets the PtrRecord field's value. +func (s *AddressAttribute) SetPtrRecord(v string) *AddressAttribute { + s.PtrRecord = &v + return s +} + +// SetPtrRecordUpdate sets the PtrRecordUpdate field's value. +func (s *AddressAttribute) SetPtrRecordUpdate(v *PtrUpdateStatus) *AddressAttribute { + s.PtrRecordUpdate = v + return s +} + +// SetPublicIp sets the PublicIp field's value. +func (s *AddressAttribute) SetPublicIp(v string) *AddressAttribute { + s.PublicIp = &v + return s +} + type AdvertiseByoipCidrInput struct { _ struct{} `type:"structure"` @@ -40085,6 +42737,9 @@ type AllocateAddressInput struct { // EC2 select an address from the address pool. To specify a specific address // from the address pool, use the Address parameter instead. PublicIpv4Pool *string `type:"string"` + + // The tags to assign to the Elastic IP address. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -40133,6 +42788,12 @@ func (s *AllocateAddressInput) SetPublicIpv4Pool(v string) *AllocateAddressInput return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *AllocateAddressInput) SetTagSpecifications(v []*TagSpecification) *AllocateAddressInput { + s.TagSpecifications = v + return s +} + type AllocateAddressOutput struct { _ struct{} `type:"structure"` @@ -40229,8 +42890,8 @@ type AllocateHostsInput struct { // Indicates whether the host accepts any untargeted instance launches that // match its instance type configuration, or if it only accepts Host tenancy // instance launches that specify its unique host ID. For more information, - // see Understanding Instance Placement and Host Affinity (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding) - // in the Amazon EC2 User Guide for Linux Instances. + // see Understanding auto-placement and affinity (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding) + // in the Amazon EC2 User Guide. // // Default: on AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"` @@ -40241,13 +42902,13 @@ type AllocateHostsInput struct { AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `locationName:"clientToken" type:"string"` // Indicates whether to enable or disable host recovery for the Dedicated Host. - // Host recovery is disabled by default. For more information, see Host Recovery + // Host recovery is disabled by default. For more information, see Host recovery // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. // // Default: off HostRecovery *string `type:"string" enum:"HostRecovery"` @@ -40411,6 +43072,472 @@ func (s *AllowedPrincipal) SetPrincipalType(v string) *AllowedPrincipal { return s } +// Describes an potential intermediate component of a feasible path. +type AlternatePathHint struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component. + ComponentArn *string `locationName:"componentArn" type:"string"` + + // The ID of the component. + ComponentId *string `locationName:"componentId" type:"string"` +} + +// String returns the string representation +func (s AlternatePathHint) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlternatePathHint) GoString() string { + return s.String() +} + +// SetComponentArn sets the ComponentArn field's value. +func (s *AlternatePathHint) SetComponentArn(v string) *AlternatePathHint { + s.ComponentArn = &v + return s +} + +// SetComponentId sets the ComponentId field's value. +func (s *AlternatePathHint) SetComponentId(v string) *AlternatePathHint { + s.ComponentId = &v + return s +} + +// Describes a network access control (ACL) rule. +type AnalysisAclRule struct { + _ struct{} `type:"structure"` + + // The IPv4 address range, in CIDR notation. + Cidr *string `locationName:"cidr" type:"string"` + + // Indicates whether the rule is an outbound rule. + Egress *bool `locationName:"egress" type:"boolean"` + + // The range of ports. + PortRange *PortRange `locationName:"portRange" type:"structure"` + + // The protocol. + Protocol *string `locationName:"protocol" type:"string"` + + // Indicates whether to allow or deny traffic that matches the rule. + RuleAction *string `locationName:"ruleAction" type:"string"` + + // The rule number. + RuleNumber *int64 `locationName:"ruleNumber" type:"integer"` +} + +// String returns the string representation +func (s AnalysisAclRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalysisAclRule) GoString() string { + return s.String() +} + +// SetCidr sets the Cidr field's value. +func (s *AnalysisAclRule) SetCidr(v string) *AnalysisAclRule { + s.Cidr = &v + return s +} + +// SetEgress sets the Egress field's value. +func (s *AnalysisAclRule) SetEgress(v bool) *AnalysisAclRule { + s.Egress = &v + return s +} + +// SetPortRange sets the PortRange field's value. +func (s *AnalysisAclRule) SetPortRange(v *PortRange) *AnalysisAclRule { + s.PortRange = v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *AnalysisAclRule) SetProtocol(v string) *AnalysisAclRule { + s.Protocol = &v + return s +} + +// SetRuleAction sets the RuleAction field's value. +func (s *AnalysisAclRule) SetRuleAction(v string) *AnalysisAclRule { + s.RuleAction = &v + return s +} + +// SetRuleNumber sets the RuleNumber field's value. +func (s *AnalysisAclRule) SetRuleNumber(v int64) *AnalysisAclRule { + s.RuleNumber = &v + return s +} + +// Describes a path component. +type AnalysisComponent struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component. + Arn *string `locationName:"arn" type:"string"` + + // The ID of the component. + Id *string `locationName:"id" type:"string"` +} + +// String returns the string representation +func (s AnalysisComponent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalysisComponent) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *AnalysisComponent) SetArn(v string) *AnalysisComponent { + s.Arn = &v + return s +} + +// SetId sets the Id field's value. +func (s *AnalysisComponent) SetId(v string) *AnalysisComponent { + s.Id = &v + return s +} + +// Describes a load balancer listener. +type AnalysisLoadBalancerListener struct { + _ struct{} `type:"structure"` + + // [Classic Load Balancers] The back-end port for the listener. + InstancePort *int64 `locationName:"instancePort" min:"1" type:"integer"` + + // The port on which the load balancer is listening. + LoadBalancerPort *int64 `locationName:"loadBalancerPort" min:"1" type:"integer"` +} + +// String returns the string representation +func (s AnalysisLoadBalancerListener) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalysisLoadBalancerListener) GoString() string { + return s.String() +} + +// SetInstancePort sets the InstancePort field's value. +func (s *AnalysisLoadBalancerListener) SetInstancePort(v int64) *AnalysisLoadBalancerListener { + s.InstancePort = &v + return s +} + +// SetLoadBalancerPort sets the LoadBalancerPort field's value. +func (s *AnalysisLoadBalancerListener) SetLoadBalancerPort(v int64) *AnalysisLoadBalancerListener { + s.LoadBalancerPort = &v + return s +} + +// Describes a load balancer target. +type AnalysisLoadBalancerTarget struct { + _ struct{} `type:"structure"` + + // The IP address. + Address *string `locationName:"address" type:"string"` + + // The Availability Zone. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // Information about the instance. + Instance *AnalysisComponent `locationName:"instance" type:"structure"` + + // The port on which the target is listening. + Port *int64 `locationName:"port" min:"1" type:"integer"` +} + +// String returns the string representation +func (s AnalysisLoadBalancerTarget) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalysisLoadBalancerTarget) GoString() string { + return s.String() +} + +// SetAddress sets the Address field's value. +func (s *AnalysisLoadBalancerTarget) SetAddress(v string) *AnalysisLoadBalancerTarget { + s.Address = &v + return s +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *AnalysisLoadBalancerTarget) SetAvailabilityZone(v string) *AnalysisLoadBalancerTarget { + s.AvailabilityZone = &v + return s +} + +// SetInstance sets the Instance field's value. +func (s *AnalysisLoadBalancerTarget) SetInstance(v *AnalysisComponent) *AnalysisLoadBalancerTarget { + s.Instance = v + return s +} + +// SetPort sets the Port field's value. +func (s *AnalysisLoadBalancerTarget) SetPort(v int64) *AnalysisLoadBalancerTarget { + s.Port = &v + return s +} + +// Describes a header. Reflects any changes made by a component as traffic passes +// through. The fields of an inbound header are null except for the first component +// of a path. +type AnalysisPacketHeader struct { + _ struct{} `type:"structure"` + + // The destination addresses. + DestinationAddresses []*string `locationName:"destinationAddressSet" locationNameList:"item" type:"list"` + + // The destination port ranges. + DestinationPortRanges []*PortRange `locationName:"destinationPortRangeSet" locationNameList:"item" type:"list"` + + // The protocol. + Protocol *string `locationName:"protocol" type:"string"` + + // The source addresses. + SourceAddresses []*string `locationName:"sourceAddressSet" locationNameList:"item" type:"list"` + + // The source port ranges. + SourcePortRanges []*PortRange `locationName:"sourcePortRangeSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s AnalysisPacketHeader) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalysisPacketHeader) GoString() string { + return s.String() +} + +// SetDestinationAddresses sets the DestinationAddresses field's value. +func (s *AnalysisPacketHeader) SetDestinationAddresses(v []*string) *AnalysisPacketHeader { + s.DestinationAddresses = v + return s +} + +// SetDestinationPortRanges sets the DestinationPortRanges field's value. +func (s *AnalysisPacketHeader) SetDestinationPortRanges(v []*PortRange) *AnalysisPacketHeader { + s.DestinationPortRanges = v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *AnalysisPacketHeader) SetProtocol(v string) *AnalysisPacketHeader { + s.Protocol = &v + return s +} + +// SetSourceAddresses sets the SourceAddresses field's value. +func (s *AnalysisPacketHeader) SetSourceAddresses(v []*string) *AnalysisPacketHeader { + s.SourceAddresses = v + return s +} + +// SetSourcePortRanges sets the SourcePortRanges field's value. +func (s *AnalysisPacketHeader) SetSourcePortRanges(v []*PortRange) *AnalysisPacketHeader { + s.SourcePortRanges = v + return s +} + +// Describes a route table route. +type AnalysisRouteTableRoute struct { + _ struct{} `type:"structure"` + + // The destination IPv4 address, in CIDR notation. + DestinationCidr *string `locationName:"destinationCidr" type:"string"` + + // The prefix of the AWS service. + DestinationPrefixListId *string `locationName:"destinationPrefixListId" type:"string"` + + // The ID of an egress-only internet gateway. + EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` + + // The ID of the gateway, such as an internet gateway or virtual private gateway. + GatewayId *string `locationName:"gatewayId" type:"string"` + + // The ID of the instance, such as a NAT instance. + InstanceId *string `locationName:"instanceId" type:"string"` + + // The ID of a NAT gateway. + NatGatewayId *string `locationName:"natGatewayId" type:"string"` + + // The ID of a network interface. + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` + + // Describes how the route was created. The following are possible values: + // + // * CreateRouteTable - The route was automatically created when the route + // table was created. + // + // * CreateRoute - The route was manually added to the route table. + // + // * EnableVgwRoutePropagation - The route was propagated by route propagation. + Origin *string `locationName:"origin" type:"string"` + + // The ID of a transit gateway. + TransitGatewayId *string `locationName:"transitGatewayId" type:"string"` + + // The ID of a VPC peering connection. + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` +} + +// String returns the string representation +func (s AnalysisRouteTableRoute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalysisRouteTableRoute) GoString() string { + return s.String() +} + +// SetDestinationCidr sets the DestinationCidr field's value. +func (s *AnalysisRouteTableRoute) SetDestinationCidr(v string) *AnalysisRouteTableRoute { + s.DestinationCidr = &v + return s +} + +// SetDestinationPrefixListId sets the DestinationPrefixListId field's value. +func (s *AnalysisRouteTableRoute) SetDestinationPrefixListId(v string) *AnalysisRouteTableRoute { + s.DestinationPrefixListId = &v + return s +} + +// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. +func (s *AnalysisRouteTableRoute) SetEgressOnlyInternetGatewayId(v string) *AnalysisRouteTableRoute { + s.EgressOnlyInternetGatewayId = &v + return s +} + +// SetGatewayId sets the GatewayId field's value. +func (s *AnalysisRouteTableRoute) SetGatewayId(v string) *AnalysisRouteTableRoute { + s.GatewayId = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *AnalysisRouteTableRoute) SetInstanceId(v string) *AnalysisRouteTableRoute { + s.InstanceId = &v + return s +} + +// SetNatGatewayId sets the NatGatewayId field's value. +func (s *AnalysisRouteTableRoute) SetNatGatewayId(v string) *AnalysisRouteTableRoute { + s.NatGatewayId = &v + return s +} + +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *AnalysisRouteTableRoute) SetNetworkInterfaceId(v string) *AnalysisRouteTableRoute { + s.NetworkInterfaceId = &v + return s +} + +// SetOrigin sets the Origin field's value. +func (s *AnalysisRouteTableRoute) SetOrigin(v string) *AnalysisRouteTableRoute { + s.Origin = &v + return s +} + +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *AnalysisRouteTableRoute) SetTransitGatewayId(v string) *AnalysisRouteTableRoute { + s.TransitGatewayId = &v + return s +} + +// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. +func (s *AnalysisRouteTableRoute) SetVpcPeeringConnectionId(v string) *AnalysisRouteTableRoute { + s.VpcPeeringConnectionId = &v + return s +} + +// Describes a security group rule. +type AnalysisSecurityGroupRule struct { + _ struct{} `type:"structure"` + + // The IPv4 address range, in CIDR notation. + Cidr *string `locationName:"cidr" type:"string"` + + // The direction. The following are possible values: + // + // * egress + // + // * ingress + Direction *string `locationName:"direction" type:"string"` + + // The port range. + PortRange *PortRange `locationName:"portRange" type:"structure"` + + // The prefix list ID. + PrefixListId *string `locationName:"prefixListId" type:"string"` + + // The protocol name. + Protocol *string `locationName:"protocol" type:"string"` + + // The security group ID. + SecurityGroupId *string `locationName:"securityGroupId" type:"string"` +} + +// String returns the string representation +func (s AnalysisSecurityGroupRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalysisSecurityGroupRule) GoString() string { + return s.String() +} + +// SetCidr sets the Cidr field's value. +func (s *AnalysisSecurityGroupRule) SetCidr(v string) *AnalysisSecurityGroupRule { + s.Cidr = &v + return s +} + +// SetDirection sets the Direction field's value. +func (s *AnalysisSecurityGroupRule) SetDirection(v string) *AnalysisSecurityGroupRule { + s.Direction = &v + return s +} + +// SetPortRange sets the PortRange field's value. +func (s *AnalysisSecurityGroupRule) SetPortRange(v *PortRange) *AnalysisSecurityGroupRule { + s.PortRange = v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *AnalysisSecurityGroupRule) SetPrefixListId(v string) *AnalysisSecurityGroupRule { + s.PrefixListId = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *AnalysisSecurityGroupRule) SetProtocol(v string) *AnalysisSecurityGroupRule { + s.Protocol = &v + return s +} + +// SetSecurityGroupId sets the SecurityGroupId field's value. +func (s *AnalysisSecurityGroupRule) SetSecurityGroupId(v string) *AnalysisSecurityGroupRule { + s.SecurityGroupId = &v + return s +} + type ApplySecurityGroupsToClientVpnTargetNetworkInput struct { _ struct{} `type:"structure"` @@ -40516,8 +43643,10 @@ func (s *ApplySecurityGroupsToClientVpnTargetNetworkOutput) SetSecurityGroupIds( type AssignIpv6AddressesInput struct { _ struct{} `type:"structure"` - // The number of IPv6 addresses to assign to the network interface. Amazon EC2 - // automatically selects the IPv6 addresses from the subnet range. You can't + // The number of additional IPv6 addresses to assign to the network interface. + // The specified number of IPv6 addresses are assigned in addition to the existing + // IPv6 addresses that are already assigned to the network interface. Amazon + // EC2 automatically selects the IPv6 addresses from the subnet range. You can't // use this option if specifying specific IPv6 addresses. Ipv6AddressCount *int64 `locationName:"ipv6AddressCount" type:"integer"` @@ -40575,7 +43704,8 @@ func (s *AssignIpv6AddressesInput) SetNetworkInterfaceId(v string) *AssignIpv6Ad type AssignIpv6AddressesOutput struct { _ struct{} `type:"structure"` - // The IPv6 addresses assigned to the network interface. + // The new IPv6 addresses assigned to the network interface. Existing IPv6 addresses + // that were assigned to the network interface before the request are not included. AssignedIpv6Addresses []*string `locationName:"assignedIpv6Addresses" locationNameList:"item" type:"list"` // The ID of the network interface. @@ -40753,10 +43883,10 @@ type AssociateAddressInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you - // can specify either the instance ID or the network interface ID, but not both. - // The operation fails if you specify an instance ID unless exactly one network - // interface is attached. + // The ID of the instance. The instance must have exactly one attached network + // interface. For EC2-VPC, you can specify either the instance ID or the network + // interface ID, but not both. For EC2-Classic, you must specify an instance + // ID and the instance must be in the running state. InstanceId *string `type:"string"` // [EC2-VPC] The ID of the network interface. If the instance has more than @@ -40771,8 +43901,8 @@ type AssociateAddressInput struct { // address is associated with the primary private IP address. PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - // The Elastic IP address to associate with the instance. This is required for - // EC2-Classic. + // [EC2-Classic] The Elastic IP address to associate with the instance. This + // is required for EC2-Classic. PublicIp *string `type:"string"` } @@ -41105,7 +44235,7 @@ type AssociateEnclaveCertificateIamRoleOutput struct { CertificateS3BucketName *string `locationName:"certificateS3BucketName" type:"string"` // The Amazon S3 object key where the certificate, certificate chain, and encrypted - // private key bundle are stored. The object key is formatted as follows: certificate_arn/role_arn. + // private key bundle are stored. The object key is formatted as follows: role_arn/certificate_arn. CertificateS3ObjectKey *string `locationName:"certificateS3ObjectKey" type:"string"` // The ID of the AWS KMS CMK used to encrypt the private key of the certificate. @@ -41710,7 +44840,7 @@ type AssociatedRole struct { // The key of the Amazon S3 object ey where the certificate, certificate chain, // and encrypted private key bundle is stored. The object key is formated as - // follows: certificate_arn/role_arn. + // follows: role_arn/certificate_arn. CertificateS3ObjectKey *string `locationName:"certificateS3ObjectKey" type:"string"` // The ID of the KMS customer master key (CMK) used to encrypt the private key. @@ -41818,6 +44948,77 @@ func (s *AssociationStatus) SetMessage(v string) *AssociationStatus { return s } +// Describes integration options for Amazon Athena. +type AthenaIntegration struct { + _ struct{} `type:"structure"` + + // The location in Amazon S3 to store the generated CloudFormation template. + // + // IntegrationResultS3DestinationArn is a required field + IntegrationResultS3DestinationArn *string `type:"string" required:"true"` + + // The end date for the partition. + PartitionEndDate *time.Time `type:"timestamp"` + + // The schedule for adding new partitions to the table. + // + // PartitionLoadFrequency is a required field + PartitionLoadFrequency *string `type:"string" required:"true" enum:"PartitionLoadFrequency"` + + // The start date for the partition. + PartitionStartDate *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s AthenaIntegration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AthenaIntegration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AthenaIntegration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AthenaIntegration"} + if s.IntegrationResultS3DestinationArn == nil { + invalidParams.Add(request.NewErrParamRequired("IntegrationResultS3DestinationArn")) + } + if s.PartitionLoadFrequency == nil { + invalidParams.Add(request.NewErrParamRequired("PartitionLoadFrequency")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetIntegrationResultS3DestinationArn sets the IntegrationResultS3DestinationArn field's value. +func (s *AthenaIntegration) SetIntegrationResultS3DestinationArn(v string) *AthenaIntegration { + s.IntegrationResultS3DestinationArn = &v + return s +} + +// SetPartitionEndDate sets the PartitionEndDate field's value. +func (s *AthenaIntegration) SetPartitionEndDate(v time.Time) *AthenaIntegration { + s.PartitionEndDate = &v + return s +} + +// SetPartitionLoadFrequency sets the PartitionLoadFrequency field's value. +func (s *AthenaIntegration) SetPartitionLoadFrequency(v string) *AthenaIntegration { + s.PartitionLoadFrequency = &v + return s +} + +// SetPartitionStartDate sets the PartitionStartDate field's value. +func (s *AthenaIntegration) SetPartitionStartDate(v time.Time) *AthenaIntegration { + s.PartitionStartDate = &v + return s +} + type AttachClassicLinkVpcInput struct { _ struct{} `type:"structure"` @@ -43047,8 +46248,7 @@ type BlockDeviceMapping struct { // launched. Ebs *EbsBlockDevice `locationName:"ebs" type:"structure"` - // Suppresses the specified device included in the block device mapping of the - // AMI. + // To omit the device from the block device mapping, specify an empty string. NoDevice *string `locationName:"noDevice" type:"string"` // The virtual device name (ephemeralN). Instance store volumes are numbered @@ -44178,9 +47378,16 @@ type CapacityReservation struct { // The type of instance for which the Capacity Reservation reserves capacity. InstanceType *string `locationName:"instanceType" type:"string"` + // The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation + // was created. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // The ID of the AWS account that owns the Capacity Reservation. OwnerId *string `locationName:"ownerId" type:"string"` + // The date and time at which the Capacity Reservation was started. + StartDate *time.Time `locationName:"startDate" type:"timestamp"` + // The current state of the Capacity Reservation. A Capacity Reservation can // be in one of the following states: // @@ -44191,8 +47398,8 @@ type CapacityReservation struct { // and time specified in your request. The reserved capacity is no longer // available for your use. // - // * cancelled - The Capacity Reservation was manually cancelled. The reserved - // capacity is no longer available for your use. + // * cancelled - The Capacity Reservation was cancelled. The reserved capacity + // is no longer available for your use. // // * pending - The Capacity Reservation request was successful but the capacity // provisioning is still pending. @@ -44308,12 +47515,24 @@ func (s *CapacityReservation) SetInstanceType(v string) *CapacityReservation { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *CapacityReservation) SetOutpostArn(v string) *CapacityReservation { + s.OutpostArn = &v + return s +} + // SetOwnerId sets the OwnerId field's value. func (s *CapacityReservation) SetOwnerId(v string) *CapacityReservation { s.OwnerId = &v return s } +// SetStartDate sets the StartDate field's value. +func (s *CapacityReservation) SetStartDate(v time.Time) *CapacityReservation { + s.StartDate = &v + return s +} + // SetState sets the State field's value. func (s *CapacityReservation) SetState(v string) *CapacityReservation { s.State = &v @@ -44378,9 +47597,9 @@ func (s *CapacityReservationGroup) SetOwnerId(v string) *CapacityReservationGrou // // For more information about Capacity Reservations, see On-Demand Capacity // Reservations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html) -// in the Amazon Elastic Compute Cloud User Guide. For examples of using Capacity -// Reservations in an EC2 Fleet, see EC2 Fleet example configurations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-examples.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. For examples of using Capacity Reservations +// in an EC2 Fleet, see EC2 Fleet example configurations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-examples.html) +// in the Amazon EC2 User Guide. type CapacityReservationOptions struct { _ struct{} `type:"structure"` @@ -44423,9 +47642,9 @@ func (s *CapacityReservationOptions) SetUsageStrategy(v string) *CapacityReserva // // For more information about Capacity Reservations, see On-Demand Capacity // Reservations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html) -// in the Amazon Elastic Compute Cloud User Guide. For examples of using Capacity -// Reservations in an EC2 Fleet, see EC2 Fleet example configurations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-examples.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. For examples of using Capacity Reservations +// in an EC2 Fleet, see EC2 Fleet example configurations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-examples.html) +// in the Amazon EC2 User Guide. type CapacityReservationOptionsRequest struct { _ struct{} `type:"structure"` @@ -46426,13 +49645,23 @@ type CopyImageInput struct { _ struct{} `type:"structure"` // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. + // request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html) + // in the Amazon EC2 API Reference. ClientToken *string `type:"string"` // A description for the new AMI in the destination Region. Description *string `type:"string"` + // The Amazon Resource Name (ARN) of the Outpost to which to copy the AMI. Only + // specify this parameter when copying an AMI from an AWS Region to an Outpost. + // The AMI must be in the Region of the destination Outpost. You cannot copy + // an AMI from an Outpost to a Region, from one Outpost to another, or within + // the same Outpost. + // + // For more information, see Copying AMIs from an AWS Region to an Outpost (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#copy-amis) + // in the Amazon Elastic Compute Cloud User Guide. + DestinationOutpostArn *string `type:"string"` + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -46528,6 +49757,12 @@ func (s *CopyImageInput) SetDescription(v string) *CopyImageInput { return s } +// SetDestinationOutpostArn sets the DestinationOutpostArn field's value. +func (s *CopyImageInput) SetDestinationOutpostArn(v string) *CopyImageInput { + s.DestinationOutpostArn = &v + return s +} + // SetDryRun sets the DryRun field's value. func (s *CopyImageInput) SetDryRun(v bool) *CopyImageInput { s.DryRun = &v @@ -46594,6 +49829,17 @@ type CopySnapshotInput struct { // A description for the EBS snapshot. Description *string `type:"string"` + // The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. + // Only specify this parameter when copying a snapshot from an AWS Region to + // an Outpost. The snapshot must be in the Region for the destination Outpost. + // You cannot copy a snapshot from an Outpost to a Region, from one Outpost + // to another, or within the same Outpost. + // + // For more information, see Copying snapshots from an AWS Region to an Outpost + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#copy-snapshots) + // in the Amazon Elastic Compute Cloud User Guide. + DestinationOutpostArn *string `type:"string"` + // The destination Region to use in the PresignedUrl parameter of a snapshot // copy operation. This parameter is only valid for specifying the destination // Region in a PresignedUrl parameter, where it is required. @@ -46614,7 +49860,7 @@ type CopySnapshotInput struct { // not enabled, enable encryption using this parameter. Otherwise, omit this // parameter. Encrypted snapshots are encrypted, even if you omit this parameter // and encryption by default is not enabled. You cannot set this parameter to - // false. For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) + // false. For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. Encrypted *bool `locationName:"encrypted" type:"boolean"` @@ -46640,14 +49886,14 @@ type CopySnapshotInput struct { // When you copy an encrypted source snapshot using the Amazon EC2 Query API, // you must supply a pre-signed URL. This parameter is optional for unencrypted - // snapshots. For more information, see Query Requests (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html). + // snapshots. For more information, see Query requests (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html). // // The PresignedUrl should use the snapshot source endpoint, the CopySnapshot // action, and include the SourceRegion, SourceSnapshotId, and DestinationRegion // parameters. The PresignedUrl must be signed using AWS Signature Version 4. // Because EBS snapshots are stored in Amazon S3, the signing algorithm for - // this parameter uses the same logic that is described in Authenticating Requests - // by Using Query Parameters (AWS Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) + // this parameter uses the same logic that is described in Authenticating Requests: + // Using Query Parameters (AWS Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) // in the Amazon Simple Storage Service API Reference. An invalid or improperly // signed PresignedUrl will cause the copy operation to fail asynchronously, // and the snapshot will move to an error state. @@ -46699,6 +49945,12 @@ func (s *CopySnapshotInput) SetDescription(v string) *CopySnapshotInput { return s } +// SetDestinationOutpostArn sets the DestinationOutpostArn field's value. +func (s *CopySnapshotInput) SetDestinationOutpostArn(v string) *CopySnapshotInput { + s.DestinationOutpostArn = &v + return s +} + // SetDestinationRegion sets the DestinationRegion field's value. func (s *CopySnapshotInput) SetDestinationRegion(v string) *CopySnapshotInput { s.DestinationRegion = &v @@ -46857,7 +50109,7 @@ type CreateCapacityReservationInput struct { AvailabilityZoneId *string `type:"string"` // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // of the request. For more information, see Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `type:"string"` // Checks whether you have the required permissions for the action, without @@ -46929,12 +50181,16 @@ type CreateCapacityReservationInput struct { InstancePlatform *string `type:"string" required:"true" enum:"CapacityReservationInstancePlatform"` // The instance type for which to reserve capacity. For more information, see - // Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. + // Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon EC2 User Guide. // // InstanceType is a required field InstanceType *string `type:"string" required:"true"` + // The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity + // Reservation. + OutpostArn *string `type:"string"` + // The tags to apply to the Capacity Reservation during launch. TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"` @@ -47050,6 +50306,12 @@ func (s *CreateCapacityReservationInput) SetInstanceType(v string) *CreateCapaci return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *CreateCapacityReservationInput) SetOutpostArn(v string) *CreateCapacityReservationInput { + s.OutpostArn = &v + return s +} + // SetTagSpecifications sets the TagSpecifications field's value. func (s *CreateCapacityReservationInput) SetTagSpecifications(v []*TagSpecification) *CreateCapacityReservationInput { s.TagSpecifications = v @@ -48095,7 +51357,10 @@ type CreateFleetInput struct { // Describes the configuration of On-Demand Instances in an EC2 Fleet. OnDemandOptions *OnDemandOptionsRequest `type:"structure"` - // Indicates whether EC2 Fleet should replace unhealthy instances. + // Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported + // only for fleets of type maintain. For more information, see EC2 Fleet health + // checks (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks) + // in the Amazon EC2 User Guide. ReplaceUnhealthyInstances *bool `type:"boolean"` // Describes the configuration of Spot Instances in an EC2 Fleet. @@ -48118,7 +51383,7 @@ type CreateFleetInput struct { // The type of request. The default value is maintain. // - // * maintain - The EC2 Fleet plaees an asynchronous request for your desired + // * maintain - The EC2 Fleet places an asynchronous request for your desired // capacity, and continues to maintain your desired Spot capacity by replenishing // interrupted Spot Instances. // @@ -48132,7 +51397,7 @@ type CreateFleetInput struct { // be launched. // // For more information, see EC2 Fleet request types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. Type *string `type:"string" enum:"FleetType"` // The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). @@ -48774,10 +52039,25 @@ type CreateImageInput struct { Name *string `locationName:"name" type:"string" required:"true"` // By default, Amazon EC2 attempts to shut down and reboot the instance before - // creating the image. If the 'No Reboot' option is set, Amazon EC2 doesn't - // shut down the instance before creating the image. When this option is used, - // file system integrity on the created image can't be guaranteed. + // creating the image. If the No Reboot option is set, Amazon EC2 doesn't shut + // down the instance before creating the image. When this option is used, file + // system integrity on the created image can't be guaranteed. NoReboot *bool `locationName:"noReboot" type:"boolean"` + + // The tags to apply to the AMI and snapshots on creation. You can tag the AMI, + // the snapshots, or both. + // + // * To tag the AMI, the value for ResourceType must be image. + // + // * To tag the snapshots that are created of the root volume and of other + // EBS volumes that are attached to the instance, the value for ResourceType + // must be snapshot. The same tag is applied to all of the snapshots that + // are created. + // + // If you specify other values for ResourceType, the request fails. + // + // To tag an AMI or snapshot after it has been created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html). + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -48842,6 +52122,12 @@ func (s *CreateImageInput) SetNoReboot(v bool) *CreateImageInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateImageInput) SetTagSpecifications(v []*TagSpecification) *CreateImageInput { + s.TagSpecifications = v + return s +} + type CreateImageOutput struct { _ struct{} `type:"structure"` @@ -48872,7 +52158,7 @@ type CreateInstanceExportTaskInput struct { // maximum length is 255 characters. Description *string `locationName:"description" type:"string"` - // The format and location for an instance export task. + // The format and location for an export instance task. // // ExportToS3Task is a required field ExportToS3Task *ExportToS3TaskSpecification `locationName:"exportToS3" type:"structure" required:"true"` @@ -48882,7 +52168,7 @@ type CreateInstanceExportTaskInput struct { // InstanceId is a required field InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - // The tags to apply to the instance export task during creation. + // The tags to apply to the export instance task during creation. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` // The target virtualization environment. @@ -48953,7 +52239,7 @@ func (s *CreateInstanceExportTaskInput) SetTargetEnvironment(v string) *CreateIn type CreateInstanceExportTaskOutput struct { _ struct{} `type:"structure"` - // Information about the instance export task. + // Information about the export instance task. ExportTask *ExportTask `locationName:"exportTask" type:"structure"` } @@ -50150,6 +53436,156 @@ func (s *CreateNetworkAclOutput) SetNetworkAcl(v *NetworkAcl) *CreateNetworkAclO return s } +type CreateNetworkInsightsPathInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // The AWS resource that is the destination of the path. + // + // Destination is a required field + Destination *string `type:"string" required:"true"` + + // The IP address of the AWS resource that is the destination of the path. + DestinationIp *string `type:"string"` + + // The destination port. + DestinationPort *int64 `min:"1" type:"integer"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The protocol. + // + // Protocol is a required field + Protocol *string `type:"string" required:"true" enum:"Protocol"` + + // The AWS resource that is the source of the path. + // + // Source is a required field + Source *string `type:"string" required:"true"` + + // The IP address of the AWS resource that is the source of the path. + SourceIp *string `type:"string"` + + // The tags to add to the path. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s CreateNetworkInsightsPathInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNetworkInsightsPathInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateNetworkInsightsPathInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateNetworkInsightsPathInput"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } + if s.DestinationPort != nil && *s.DestinationPort < 1 { + invalidParams.Add(request.NewErrParamMinValue("DestinationPort", 1)) + } + if s.Protocol == nil { + invalidParams.Add(request.NewErrParamRequired("Protocol")) + } + if s.Source == nil { + invalidParams.Add(request.NewErrParamRequired("Source")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateNetworkInsightsPathInput) SetClientToken(v string) *CreateNetworkInsightsPathInput { + s.ClientToken = &v + return s +} + +// SetDestination sets the Destination field's value. +func (s *CreateNetworkInsightsPathInput) SetDestination(v string) *CreateNetworkInsightsPathInput { + s.Destination = &v + return s +} + +// SetDestinationIp sets the DestinationIp field's value. +func (s *CreateNetworkInsightsPathInput) SetDestinationIp(v string) *CreateNetworkInsightsPathInput { + s.DestinationIp = &v + return s +} + +// SetDestinationPort sets the DestinationPort field's value. +func (s *CreateNetworkInsightsPathInput) SetDestinationPort(v int64) *CreateNetworkInsightsPathInput { + s.DestinationPort = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateNetworkInsightsPathInput) SetDryRun(v bool) *CreateNetworkInsightsPathInput { + s.DryRun = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *CreateNetworkInsightsPathInput) SetProtocol(v string) *CreateNetworkInsightsPathInput { + s.Protocol = &v + return s +} + +// SetSource sets the Source field's value. +func (s *CreateNetworkInsightsPathInput) SetSource(v string) *CreateNetworkInsightsPathInput { + s.Source = &v + return s +} + +// SetSourceIp sets the SourceIp field's value. +func (s *CreateNetworkInsightsPathInput) SetSourceIp(v string) *CreateNetworkInsightsPathInput { + s.SourceIp = &v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateNetworkInsightsPathInput) SetTagSpecifications(v []*TagSpecification) *CreateNetworkInsightsPathInput { + s.TagSpecifications = v + return s +} + +type CreateNetworkInsightsPathOutput struct { + _ struct{} `type:"structure"` + + // Information about the path. + NetworkInsightsPath *NetworkInsightsPath `locationName:"networkInsightsPath" type:"structure"` +} + +// String returns the string representation +func (s CreateNetworkInsightsPathOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNetworkInsightsPathOutput) GoString() string { + return s.String() +} + +// SetNetworkInsightsPath sets the NetworkInsightsPath field's value. +func (s *CreateNetworkInsightsPathOutput) SetNetworkInsightsPath(v *NetworkInsightsPath) *CreateNetworkInsightsPathOutput { + s.NetworkInsightsPath = v + return s +} + // Contains the parameters for CreateNetworkInterface. type CreateNetworkInterfaceInput struct { _ struct{} `type:"structure"` @@ -50520,6 +53956,111 @@ func (s *CreatePlacementGroupOutput) SetPlacementGroup(v *PlacementGroup) *Creat return s } +type CreateReplaceRootVolumeTaskInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. If you do not specify a client token, a randomly generated token + // is used for the request to ensure idempotency. For more information, see + // Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the instance for which to replace the root volume. + // + // InstanceId is a required field + InstanceId *string `type:"string" required:"true"` + + // The ID of the snapshot from which to restore the replacement root volume. + // If you want to restore the volume to the initial launch state, omit this + // parameter. + SnapshotId *string `type:"string"` + + // The tags to apply to the root volume replacement task. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s CreateReplaceRootVolumeTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateReplaceRootVolumeTaskInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateReplaceRootVolumeTaskInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateReplaceRootVolumeTaskInput"} + if s.InstanceId == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateReplaceRootVolumeTaskInput) SetClientToken(v string) *CreateReplaceRootVolumeTaskInput { + s.ClientToken = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateReplaceRootVolumeTaskInput) SetDryRun(v bool) *CreateReplaceRootVolumeTaskInput { + s.DryRun = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *CreateReplaceRootVolumeTaskInput) SetInstanceId(v string) *CreateReplaceRootVolumeTaskInput { + s.InstanceId = &v + return s +} + +// SetSnapshotId sets the SnapshotId field's value. +func (s *CreateReplaceRootVolumeTaskInput) SetSnapshotId(v string) *CreateReplaceRootVolumeTaskInput { + s.SnapshotId = &v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateReplaceRootVolumeTaskInput) SetTagSpecifications(v []*TagSpecification) *CreateReplaceRootVolumeTaskInput { + s.TagSpecifications = v + return s +} + +type CreateReplaceRootVolumeTaskOutput struct { + _ struct{} `type:"structure"` + + // Information about the root volume replacement task. + ReplaceRootVolumeTask *ReplaceRootVolumeTask `locationName:"replaceRootVolumeTask" type:"structure"` +} + +// String returns the string representation +func (s CreateReplaceRootVolumeTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateReplaceRootVolumeTaskOutput) GoString() string { + return s.String() +} + +// SetReplaceRootVolumeTask sets the ReplaceRootVolumeTask field's value. +func (s *CreateReplaceRootVolumeTaskOutput) SetReplaceRootVolumeTask(v *ReplaceRootVolumeTask) *CreateReplaceRootVolumeTaskOutput { + s.ReplaceRootVolumeTask = v + return s +} + // Contains the parameters for CreateReservedInstancesListing. type CreateReservedInstancesListingInput struct { _ struct{} `type:"structure"` @@ -50631,6 +54172,119 @@ func (s *CreateReservedInstancesListingOutput) SetReservedInstancesListings(v [] return s } +type CreateRestoreImageTaskInput struct { + _ struct{} `type:"structure"` + + // The name of the S3 bucket that contains the stored AMI object. + // + // Bucket is a required field + Bucket *string `type:"string" required:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The name for the restored AMI. The name must be unique for AMIs in the Region + // for this account. If you do not provide a name, the new AMI gets the same + // name as the original AMI. + Name *string `type:"string"` + + // The name of the stored AMI object in the bucket. + // + // ObjectKey is a required field + ObjectKey *string `type:"string" required:"true"` + + // The tags to apply to the AMI and snapshots on restoration. You can tag the + // AMI, the snapshots, or both. + // + // * To tag the AMI, the value for ResourceType must be image. + // + // * To tag the snapshots, the value for ResourceType must be snapshot. The + // same tag is applied to all of the snapshots that are created. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s CreateRestoreImageTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRestoreImageTaskInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateRestoreImageTaskInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateRestoreImageTaskInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.ObjectKey == nil { + invalidParams.Add(request.NewErrParamRequired("ObjectKey")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *CreateRestoreImageTaskInput) SetBucket(v string) *CreateRestoreImageTaskInput { + s.Bucket = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateRestoreImageTaskInput) SetDryRun(v bool) *CreateRestoreImageTaskInput { + s.DryRun = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateRestoreImageTaskInput) SetName(v string) *CreateRestoreImageTaskInput { + s.Name = &v + return s +} + +// SetObjectKey sets the ObjectKey field's value. +func (s *CreateRestoreImageTaskInput) SetObjectKey(v string) *CreateRestoreImageTaskInput { + s.ObjectKey = &v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateRestoreImageTaskInput) SetTagSpecifications(v []*TagSpecification) *CreateRestoreImageTaskInput { + s.TagSpecifications = v + return s +} + +type CreateRestoreImageTaskOutput struct { + _ struct{} `type:"structure"` + + // The AMI ID. + ImageId *string `locationName:"imageId" type:"string"` +} + +// String returns the string representation +func (s CreateRestoreImageTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRestoreImageTaskOutput) GoString() string { + return s.String() +} + +// SetImageId sets the ImageId field's value. +func (s *CreateRestoreImageTaskOutput) SetImageId(v string) *CreateRestoreImageTaskOutput { + s.ImageId = &v + return s +} + type CreateRouteInput struct { _ struct{} `type:"structure"` @@ -50687,6 +54341,9 @@ type CreateRouteInput struct { // The ID of a transit gateway. TransitGatewayId *string `type:"string"` + // The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only. + VpcEndpointId *string `type:"string"` + // The ID of a VPC peering connection. VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` } @@ -50792,6 +54449,12 @@ func (s *CreateRouteInput) SetTransitGatewayId(v string) *CreateRouteInput { return s } +// SetVpcEndpointId sets the VpcEndpointId field's value. +func (s *CreateRouteInput) SetVpcEndpointId(v string) *CreateRouteInput { + s.VpcEndpointId = &v + return s +} + // SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. func (s *CreateRouteInput) SetVpcPeeringConnectionId(v string) *CreateRouteInput { s.VpcPeeringConnectionId = &v @@ -51041,6 +54704,25 @@ type CreateSnapshotInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // The Amazon Resource Name (ARN) of the AWS Outpost on which to create a local + // snapshot. + // + // * To create a snapshot of a volume in a Region, omit this parameter. The + // snapshot is created in the same Region as the volume. + // + // * To create a snapshot of a volume on an Outpost and store the snapshot + // in the Region, omit this parameter. The snapshot is created in the Region + // for the Outpost. + // + // * To create a snapshot of a volume on an Outpost and store the snapshot + // on an Outpost, specify the ARN of the destination Outpost. The snapshot + // must be created on the same Outpost as the volume. + // + // For more information, see Creating local snapshots from volumes on an Outpost + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#create-snapshot) + // in the Amazon Elastic Compute Cloud User Guide. + OutpostArn *string `type:"string"` + // The tags to apply to the snapshot during creation. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` @@ -51085,6 +54767,12 @@ func (s *CreateSnapshotInput) SetDryRun(v bool) *CreateSnapshotInput { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *CreateSnapshotInput) SetOutpostArn(v string) *CreateSnapshotInput { + s.OutpostArn = &v + return s +} + // SetTagSpecifications sets the TagSpecifications field's value. func (s *CreateSnapshotInput) SetTagSpecifications(v []*TagSpecification) *CreateSnapshotInput { s.TagSpecifications = v @@ -51117,6 +54805,25 @@ type CreateSnapshotsInput struct { // InstanceSpecification is a required field InstanceSpecification *InstanceSpecification `type:"structure" required:"true"` + // The Amazon Resource Name (ARN) of the AWS Outpost on which to create the + // local snapshots. + // + // * To create snapshots from an instance in a Region, omit this parameter. + // The snapshots are created in the same Region as the instance. + // + // * To create snapshots from an instance on an Outpost and store the snapshots + // in the Region, omit this parameter. The snapshots are created in the Region + // for the Outpost. + // + // * To create snapshots from an instance on an Outpost and store the snapshots + // on an Outpost, specify the ARN of the destination Outpost. The snapshots + // must be created on the same Outpost as the instance. + // + // For more information, see Creating multi-volume local snapshots from instances + // on an Outpost (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#create-multivol-snapshot) + // in the Amazon Elastic Compute Cloud User Guide. + OutpostArn *string `type:"string"` + // Tags to apply to every snapshot specified by the instance. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } @@ -51168,6 +54875,12 @@ func (s *CreateSnapshotsInput) SetInstanceSpecification(v *InstanceSpecification return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *CreateSnapshotsInput) SetOutpostArn(v string) *CreateSnapshotsInput { + s.OutpostArn = &v + return s +} + // SetTagSpecifications sets the TagSpecifications field's value. func (s *CreateSnapshotsInput) SetTagSpecifications(v []*TagSpecification) *CreateSnapshotsInput { s.TagSpecifications = v @@ -51284,6 +54997,104 @@ func (s *CreateSpotDatafeedSubscriptionOutput) SetSpotDatafeedSubscription(v *Sp return s } +type CreateStoreImageTaskInput struct { + _ struct{} `type:"structure"` + + // The name of the S3 bucket in which the AMI object will be stored. The bucket + // must be in the Region in which the request is being made. The AMI object + // appears in the bucket only after the upload task has completed. + // + // Bucket is a required field + Bucket *string `type:"string" required:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the AMI. + // + // ImageId is a required field + ImageId *string `type:"string" required:"true"` + + // The tags to apply to the AMI object that will be stored in the S3 bucket. + S3ObjectTags []*S3ObjectTag `locationName:"S3ObjectTag" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s CreateStoreImageTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateStoreImageTaskInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateStoreImageTaskInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateStoreImageTaskInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.ImageId == nil { + invalidParams.Add(request.NewErrParamRequired("ImageId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *CreateStoreImageTaskInput) SetBucket(v string) *CreateStoreImageTaskInput { + s.Bucket = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateStoreImageTaskInput) SetDryRun(v bool) *CreateStoreImageTaskInput { + s.DryRun = &v + return s +} + +// SetImageId sets the ImageId field's value. +func (s *CreateStoreImageTaskInput) SetImageId(v string) *CreateStoreImageTaskInput { + s.ImageId = &v + return s +} + +// SetS3ObjectTags sets the S3ObjectTags field's value. +func (s *CreateStoreImageTaskInput) SetS3ObjectTags(v []*S3ObjectTag) *CreateStoreImageTaskInput { + s.S3ObjectTags = v + return s +} + +type CreateStoreImageTaskOutput struct { + _ struct{} `type:"structure"` + + // The name of the stored AMI object in the S3 bucket. + ObjectKey *string `locationName:"objectKey" type:"string"` +} + +// String returns the string representation +func (s CreateStoreImageTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateStoreImageTaskOutput) GoString() string { + return s.String() +} + +// SetObjectKey sets the ObjectKey field's value. +func (s *CreateStoreImageTaskOutput) SetObjectKey(v string) *CreateStoreImageTaskOutput { + s.ObjectKey = &v + return s +} + type CreateSubnetInput struct { _ struct{} `type:"structure"` @@ -52096,6 +55907,283 @@ func (s *CreateTrafficMirrorTargetOutput) SetTrafficMirrorTarget(v *TrafficMirro return s } +type CreateTransitGatewayConnectInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The Connect attachment options. + // + // Options is a required field + Options *CreateTransitGatewayConnectRequestOptions `type:"structure" required:"true"` + + // The tags to apply to the Connect attachment. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The ID of the transit gateway attachment. You can specify a VPC attachment + // or a AWS Direct Connect attachment. + // + // TransportTransitGatewayAttachmentId is a required field + TransportTransitGatewayAttachmentId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTransitGatewayConnectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransitGatewayConnectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTransitGatewayConnectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayConnectInput"} + if s.Options == nil { + invalidParams.Add(request.NewErrParamRequired("Options")) + } + if s.TransportTransitGatewayAttachmentId == nil { + invalidParams.Add(request.NewErrParamRequired("TransportTransitGatewayAttachmentId")) + } + if s.Options != nil { + if err := s.Options.Validate(); err != nil { + invalidParams.AddNested("Options", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateTransitGatewayConnectInput) SetDryRun(v bool) *CreateTransitGatewayConnectInput { + s.DryRun = &v + return s +} + +// SetOptions sets the Options field's value. +func (s *CreateTransitGatewayConnectInput) SetOptions(v *CreateTransitGatewayConnectRequestOptions) *CreateTransitGatewayConnectInput { + s.Options = v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateTransitGatewayConnectInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayConnectInput { + s.TagSpecifications = v + return s +} + +// SetTransportTransitGatewayAttachmentId sets the TransportTransitGatewayAttachmentId field's value. +func (s *CreateTransitGatewayConnectInput) SetTransportTransitGatewayAttachmentId(v string) *CreateTransitGatewayConnectInput { + s.TransportTransitGatewayAttachmentId = &v + return s +} + +type CreateTransitGatewayConnectOutput struct { + _ struct{} `type:"structure"` + + // Information about the Connect attachment. + TransitGatewayConnect *TransitGatewayConnect `locationName:"transitGatewayConnect" type:"structure"` +} + +// String returns the string representation +func (s CreateTransitGatewayConnectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransitGatewayConnectOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayConnect sets the TransitGatewayConnect field's value. +func (s *CreateTransitGatewayConnectOutput) SetTransitGatewayConnect(v *TransitGatewayConnect) *CreateTransitGatewayConnectOutput { + s.TransitGatewayConnect = v + return s +} + +type CreateTransitGatewayConnectPeerInput struct { + _ struct{} `type:"structure"` + + // The BGP options for the Connect peer. + BgpOptions *TransitGatewayConnectRequestBgpOptions `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The range of inside IP addresses that are used for BGP peering. You must + // specify a size /29 IPv4 CIDR block from the 169.254.0.0/16 range. The first + // address from the range must be configured on the appliance as the BGP IP + // address. You can also optionally specify a size /125 IPv6 CIDR block from + // the fd00::/8 range. + // + // InsideCidrBlocks is a required field + InsideCidrBlocks []*string `locationNameList:"item" type:"list" required:"true"` + + // The peer IP address (GRE outer IP address) on the appliance side of the Connect + // peer. + // + // PeerAddress is a required field + PeerAddress *string `type:"string" required:"true"` + + // The tags to apply to the Connect peer. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The peer IP address (GRE outer IP address) on the transit gateway side of + // the Connect peer, which must be specified from a transit gateway CIDR block. + // If not specified, Amazon automatically assigns the first available IP address + // from the transit gateway CIDR block. + TransitGatewayAddress *string `type:"string"` + + // The ID of the Connect attachment. + // + // TransitGatewayAttachmentId is a required field + TransitGatewayAttachmentId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTransitGatewayConnectPeerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransitGatewayConnectPeerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTransitGatewayConnectPeerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayConnectPeerInput"} + if s.InsideCidrBlocks == nil { + invalidParams.Add(request.NewErrParamRequired("InsideCidrBlocks")) + } + if s.PeerAddress == nil { + invalidParams.Add(request.NewErrParamRequired("PeerAddress")) + } + if s.TransitGatewayAttachmentId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBgpOptions sets the BgpOptions field's value. +func (s *CreateTransitGatewayConnectPeerInput) SetBgpOptions(v *TransitGatewayConnectRequestBgpOptions) *CreateTransitGatewayConnectPeerInput { + s.BgpOptions = v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateTransitGatewayConnectPeerInput) SetDryRun(v bool) *CreateTransitGatewayConnectPeerInput { + s.DryRun = &v + return s +} + +// SetInsideCidrBlocks sets the InsideCidrBlocks field's value. +func (s *CreateTransitGatewayConnectPeerInput) SetInsideCidrBlocks(v []*string) *CreateTransitGatewayConnectPeerInput { + s.InsideCidrBlocks = v + return s +} + +// SetPeerAddress sets the PeerAddress field's value. +func (s *CreateTransitGatewayConnectPeerInput) SetPeerAddress(v string) *CreateTransitGatewayConnectPeerInput { + s.PeerAddress = &v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateTransitGatewayConnectPeerInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayConnectPeerInput { + s.TagSpecifications = v + return s +} + +// SetTransitGatewayAddress sets the TransitGatewayAddress field's value. +func (s *CreateTransitGatewayConnectPeerInput) SetTransitGatewayAddress(v string) *CreateTransitGatewayConnectPeerInput { + s.TransitGatewayAddress = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *CreateTransitGatewayConnectPeerInput) SetTransitGatewayAttachmentId(v string) *CreateTransitGatewayConnectPeerInput { + s.TransitGatewayAttachmentId = &v + return s +} + +type CreateTransitGatewayConnectPeerOutput struct { + _ struct{} `type:"structure"` + + // Information about the Connect peer. + TransitGatewayConnectPeer *TransitGatewayConnectPeer `locationName:"transitGatewayConnectPeer" type:"structure"` +} + +// String returns the string representation +func (s CreateTransitGatewayConnectPeerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransitGatewayConnectPeerOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayConnectPeer sets the TransitGatewayConnectPeer field's value. +func (s *CreateTransitGatewayConnectPeerOutput) SetTransitGatewayConnectPeer(v *TransitGatewayConnectPeer) *CreateTransitGatewayConnectPeerOutput { + s.TransitGatewayConnectPeer = v + return s +} + +// The options for a Connect attachment. +type CreateTransitGatewayConnectRequestOptions struct { + _ struct{} `type:"structure"` + + // The tunnel protocol. + // + // Protocol is a required field + Protocol *string `type:"string" required:"true" enum:"ProtocolValue"` +} + +// String returns the string representation +func (s CreateTransitGatewayConnectRequestOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransitGatewayConnectRequestOptions) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTransitGatewayConnectRequestOptions) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayConnectRequestOptions"} + if s.Protocol == nil { + invalidParams.Add(request.NewErrParamRequired("Protocol")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProtocol sets the Protocol field's value. +func (s *CreateTransitGatewayConnectRequestOptions) SetProtocol(v string) *CreateTransitGatewayConnectRequestOptions { + s.Protocol = &v + return s +} + type CreateTransitGatewayInput struct { _ struct{} `type:"structure"` @@ -52158,6 +56246,9 @@ type CreateTransitGatewayMulticastDomainInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` + // The options for the transit gateway multicast domain. + Options *CreateTransitGatewayMulticastDomainRequestOptions `type:"structure"` + // The tags for the transit gateway multicast domain. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` @@ -52196,6 +56287,12 @@ func (s *CreateTransitGatewayMulticastDomainInput) SetDryRun(v bool) *CreateTran return s } +// SetOptions sets the Options field's value. +func (s *CreateTransitGatewayMulticastDomainInput) SetOptions(v *CreateTransitGatewayMulticastDomainRequestOptions) *CreateTransitGatewayMulticastDomainInput { + s.Options = v + return s +} + // SetTagSpecifications sets the TagSpecifications field's value. func (s *CreateTransitGatewayMulticastDomainInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayMulticastDomainInput { s.TagSpecifications = v @@ -52231,6 +56328,51 @@ func (s *CreateTransitGatewayMulticastDomainOutput) SetTransitGatewayMulticastDo return s } +// The options for the transit gateway multicast domain. +type CreateTransitGatewayMulticastDomainRequestOptions struct { + _ struct{} `type:"structure"` + + // Indicates whether to automatically accept cross-account subnet associations + // that are associated with the transit gateway multicast domain. + AutoAcceptSharedAssociations *string `type:"string" enum:"AutoAcceptSharedAssociationsValue"` + + // Specify whether to enable Internet Group Management Protocol (IGMP) version + // 2 for the transit gateway multicast domain. + Igmpv2Support *string `type:"string" enum:"Igmpv2SupportValue"` + + // Specify whether to enable support for statically configuring multicast group + // sources for a domain. + StaticSourcesSupport *string `type:"string" enum:"StaticSourcesSupportValue"` +} + +// String returns the string representation +func (s CreateTransitGatewayMulticastDomainRequestOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransitGatewayMulticastDomainRequestOptions) GoString() string { + return s.String() +} + +// SetAutoAcceptSharedAssociations sets the AutoAcceptSharedAssociations field's value. +func (s *CreateTransitGatewayMulticastDomainRequestOptions) SetAutoAcceptSharedAssociations(v string) *CreateTransitGatewayMulticastDomainRequestOptions { + s.AutoAcceptSharedAssociations = &v + return s +} + +// SetIgmpv2Support sets the Igmpv2Support field's value. +func (s *CreateTransitGatewayMulticastDomainRequestOptions) SetIgmpv2Support(v string) *CreateTransitGatewayMulticastDomainRequestOptions { + s.Igmpv2Support = &v + return s +} + +// SetStaticSourcesSupport sets the StaticSourcesSupport field's value. +func (s *CreateTransitGatewayMulticastDomainRequestOptions) SetStaticSourcesSupport(v string) *CreateTransitGatewayMulticastDomainRequestOptions { + s.StaticSourcesSupport = &v + return s +} + type CreateTransitGatewayOutput struct { _ struct{} `type:"structure"` @@ -52805,7 +56947,7 @@ type CreateTransitGatewayVpcAttachmentRequestOptions struct { // Enable or disable DNS support. The default is enable. DnsSupport *string `type:"string" enum:"DnsSupportValue"` - // Enable or disable IPv6 support. + // Enable or disable IPv6 support. The default is disable. Ipv6Support *string `type:"string" enum:"Ipv6SupportValue"` } @@ -52851,7 +56993,7 @@ type CreateVolumeInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // Specifies whether the volume should be encrypted. The effect of setting the + // Indicates whether the volume should be encrypted. The effect of setting the // encryption state to true depends on the volume origin (new or from a snapshot), // starting encryption state, ownership, and whether encryption by default is // enabled. For more information, see Encryption by default (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) @@ -52861,15 +57003,26 @@ type CreateVolumeInput struct { // EBS encryption. For more information, see Supported instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). Encrypted *bool `locationName:"encrypted" type:"boolean"` - // The number of I/O operations per second (IOPS) to provision for an io1 or - // io2 volume, with a maximum ratio of 50 IOPS/GiB for io1, and 500 IOPS/GiB - // for io2. Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum - // IOPS of 64,000 is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). - // Other instance families guarantee performance up to 32,000 IOPS. For more - // information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. + // The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes, + // this represents the number of IOPS that are provisioned for the volume. For + // gp2 volumes, this represents the baseline performance of the volume and the + // rate at which the volume accumulates I/O credits for bursting. // - // This parameter is valid only for Provisioned IOPS SSD (io1 and io2) volumes. + // The following are the supported values for each volume type: + // + // * gp3: 3,000-16,000 IOPS + // + // * io1: 100-64,000 IOPS + // + // * io2: 100-64,000 IOPS + // + // For io1 and io2 volumes, we guarantee 64,000 IOPS only for Instances built + // on the Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Other instance families guarantee performance up to 32,000 IOPS. + // + // This parameter is required for io1 and io2 volumes. The default for gp3 volumes + // is 3,000 IOPS. This parameter is not supported for gp2, st1, sc1, or standard + // volumes. Iops *int64 `type:"integer"` // The identifier of the AWS Key Management Service (AWS KMS) customer master @@ -52892,10 +57045,11 @@ type CreateVolumeInput struct { // fails. KmsKeyId *string `type:"string"` - // Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, - // you can attach the volume to up to 16 Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) - // in the same Availability Zone. For more information, see Amazon EBS Multi-Attach - // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html) + // Indicates whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, + // you can attach the volume to up to 16 Instances built on the Nitro System + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) + // in the same Availability Zone. This parameter is supported with io1 and io2 + // volumes only. For more information, see Amazon EBS Multi-Attach (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html) // in the Amazon Elastic Compute Cloud User Guide. MultiAttachEnabled *bool `type:"boolean"` @@ -52903,14 +57057,19 @@ type CreateVolumeInput struct { OutpostArn *string `type:"string"` // The size of the volume, in GiBs. You must specify either a snapshot ID or - // a volume size. + // a volume size. If you specify a snapshot, the default is the snapshot size. + // You can specify a volume size that is equal to or larger than the snapshot + // size. // - // Constraints: 1-16,384 for gp2, 4-16,384 for io1 and io2, 500-16,384 for st1, - // 500-16,384 for sc1, and 1-1,024 for standard. If you specify a snapshot, - // the volume size must be equal to or larger than the snapshot size. + // The following are the supported volumes sizes for each volume type: // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. + // * gp2 and gp3: 1-16,384 + // + // * io1 and io2: 4-16,384 + // + // * st1 and sc1: 125-16,384 + // + // * standard: 1-1,024 Size *int64 `type:"integer"` // The snapshot from which to create the volume. You must specify either a snapshot @@ -52920,9 +57079,27 @@ type CreateVolumeInput struct { // The tags to apply to the volume during creation. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - // The volume type. This can be gp2 for General Purpose SSD, io1 or io2 for - // Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, - // or standard for Magnetic volumes. + // The throughput to provision for a volume, with a maximum of 1,000 MiB/s. + // + // This parameter is valid only for gp3 volumes. + // + // Valid Range: Minimum value of 125. Maximum value of 1000. + Throughput *int64 `type:"integer"` + + // The volume type. This parameter can be one of the following values: + // + // * General Purpose SSD: gp2 | gp3 + // + // * Provisioned IOPS SSD: io1 | io2 + // + // * Throughput Optimized HDD: st1 + // + // * Cold HDD: sc1 + // + // * Magnetic: standard + // + // For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // in the Amazon Elastic Compute Cloud User Guide. // // Default: gp2 VolumeType *string `type:"string" enum:"VolumeType"` @@ -53011,6 +57188,12 @@ func (s *CreateVolumeInput) SetTagSpecifications(v []*TagSpecification) *CreateV return s } +// SetThroughput sets the Throughput field's value. +func (s *CreateVolumeInput) SetThroughput(v int64) *CreateVolumeInput { + s.Throughput = &v + return s +} + // SetVolumeType sets the VolumeType field's value. func (s *CreateVolumeInput) SetVolumeType(v string) *CreateVolumeInput { s.VolumeType = &v @@ -53224,9 +57407,10 @@ type CreateVpcEndpointInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // A policy to attach to the endpoint that controls access to the service. The - // policy must be in valid JSON format. If this parameter is not specified, - // we attach a default policy that allows full access to the service. + // (Interface and gateway endpoints) A policy to attach to the endpoint that + // controls access to the service. The policy must be in valid JSON format. + // If this parameter is not specified, we attach a default policy that allows + // full access to the service. PolicyDocument *string `type:"string"` // (Interface endpoint) Indicates whether to associate a private hosted zone @@ -53257,8 +57441,9 @@ type CreateVpcEndpointInput struct { // ServiceName is a required field ServiceName *string `type:"string" required:"true"` - // (Interface endpoint) The ID of one or more subnets in which to create an - // endpoint network interface. + // (Interface and Gateway Load Balancer endpoints) The ID of one or more subnets + // in which to create an endpoint network interface. For a Gateway Load Balancer + // endpoint, you can specify one subnet only. SubnetIds []*string `locationName:"SubnetId" locationNameList:"item" type:"list"` // The tags to associate with the endpoint. @@ -53418,13 +57603,15 @@ type CreateVpcEndpointServiceConfigurationInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` + // The Amazon Resource Names (ARNs) of one or more Gateway Load Balancers. + GatewayLoadBalancerArns []*string `locationName:"GatewayLoadBalancerArn" locationNameList:"item" type:"list"` + // The Amazon Resource Names (ARNs) of one or more Network Load Balancers for // your service. - // - // NetworkLoadBalancerArns is a required field - NetworkLoadBalancerArns []*string `locationName:"NetworkLoadBalancerArn" locationNameList:"item" type:"list" required:"true"` + NetworkLoadBalancerArns []*string `locationName:"NetworkLoadBalancerArn" locationNameList:"item" type:"list"` - // The private DNS name to assign to the VPC endpoint service. + // (Interface endpoint configuration) The private DNS name to assign to the + // VPC endpoint service. PrivateDnsName *string `type:"string"` // The tags to associate with the service. @@ -53441,19 +57628,6 @@ func (s CreateVpcEndpointServiceConfigurationInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcEndpointServiceConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointServiceConfigurationInput"} - if s.NetworkLoadBalancerArns == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkLoadBalancerArns")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - // SetAcceptanceRequired sets the AcceptanceRequired field's value. func (s *CreateVpcEndpointServiceConfigurationInput) SetAcceptanceRequired(v bool) *CreateVpcEndpointServiceConfigurationInput { s.AcceptanceRequired = &v @@ -53472,6 +57646,12 @@ func (s *CreateVpcEndpointServiceConfigurationInput) SetDryRun(v bool) *CreateVp return s } +// SetGatewayLoadBalancerArns sets the GatewayLoadBalancerArns field's value. +func (s *CreateVpcEndpointServiceConfigurationInput) SetGatewayLoadBalancerArns(v []*string) *CreateVpcEndpointServiceConfigurationInput { + s.GatewayLoadBalancerArns = v + return s +} + // SetNetworkLoadBalancerArns sets the NetworkLoadBalancerArns field's value. func (s *CreateVpcEndpointServiceConfigurationInput) SetNetworkLoadBalancerArns(v []*string) *CreateVpcEndpointServiceConfigurationInput { s.NetworkLoadBalancerArns = v @@ -54789,8 +58969,14 @@ type DeleteFleetsInput struct { // FleetIds is a required field FleetIds []*string `locationName:"FleetId" type:"list" required:"true"` - // Indicates whether to terminate instances for an EC2 Fleet if it is deleted - // successfully. + // Indicates whether to terminate the instances when the EC2 Fleet is deleted. + // The default is to terminate the instances. + // + // To let the instances continue to run after the EC2 Fleet is deleted, specify + // NoTerminateInstances. Supported only for fleets of type maintain and request. + // + // For instant fleets, you cannot specify NoTerminateInstances. A deleted instant + // fleet with running instances is not supported. // // TerminateInstances is a required field TerminateInstances *bool `type:"boolean" required:"true"` @@ -55884,6 +60070,152 @@ func (s DeleteNetworkAclOutput) GoString() string { return s.String() } +type DeleteNetworkInsightsAnalysisInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the network insights analysis. + // + // NetworkInsightsAnalysisId is a required field + NetworkInsightsAnalysisId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteNetworkInsightsAnalysisInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNetworkInsightsAnalysisInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteNetworkInsightsAnalysisInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkInsightsAnalysisInput"} + if s.NetworkInsightsAnalysisId == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkInsightsAnalysisId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DeleteNetworkInsightsAnalysisInput) SetDryRun(v bool) *DeleteNetworkInsightsAnalysisInput { + s.DryRun = &v + return s +} + +// SetNetworkInsightsAnalysisId sets the NetworkInsightsAnalysisId field's value. +func (s *DeleteNetworkInsightsAnalysisInput) SetNetworkInsightsAnalysisId(v string) *DeleteNetworkInsightsAnalysisInput { + s.NetworkInsightsAnalysisId = &v + return s +} + +type DeleteNetworkInsightsAnalysisOutput struct { + _ struct{} `type:"structure"` + + // The ID of the network insights analysis. + NetworkInsightsAnalysisId *string `locationName:"networkInsightsAnalysisId" type:"string"` +} + +// String returns the string representation +func (s DeleteNetworkInsightsAnalysisOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNetworkInsightsAnalysisOutput) GoString() string { + return s.String() +} + +// SetNetworkInsightsAnalysisId sets the NetworkInsightsAnalysisId field's value. +func (s *DeleteNetworkInsightsAnalysisOutput) SetNetworkInsightsAnalysisId(v string) *DeleteNetworkInsightsAnalysisOutput { + s.NetworkInsightsAnalysisId = &v + return s +} + +type DeleteNetworkInsightsPathInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the path. + // + // NetworkInsightsPathId is a required field + NetworkInsightsPathId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteNetworkInsightsPathInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNetworkInsightsPathInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteNetworkInsightsPathInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkInsightsPathInput"} + if s.NetworkInsightsPathId == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkInsightsPathId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DeleteNetworkInsightsPathInput) SetDryRun(v bool) *DeleteNetworkInsightsPathInput { + s.DryRun = &v + return s +} + +// SetNetworkInsightsPathId sets the NetworkInsightsPathId field's value. +func (s *DeleteNetworkInsightsPathInput) SetNetworkInsightsPathId(v string) *DeleteNetworkInsightsPathInput { + s.NetworkInsightsPathId = &v + return s +} + +type DeleteNetworkInsightsPathOutput struct { + _ struct{} `type:"structure"` + + // The ID of the path. + NetworkInsightsPathId *string `locationName:"networkInsightsPathId" type:"string"` +} + +// String returns the string representation +func (s DeleteNetworkInsightsPathOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNetworkInsightsPathOutput) GoString() string { + return s.String() +} + +// SetNetworkInsightsPathId sets the NetworkInsightsPathId field's value. +func (s *DeleteNetworkInsightsPathOutput) SetNetworkInsightsPathId(v string) *DeleteNetworkInsightsPathOutput { + s.NetworkInsightsPathId = &v + return s +} + // Contains the parameters for DeleteNetworkInterface. type DeleteNetworkInterfaceInput struct { _ struct{} `type:"structure"` @@ -56977,6 +61309,152 @@ func (s *DeleteTrafficMirrorTargetOutput) SetTrafficMirrorTargetId(v string) *De return s } +type DeleteTransitGatewayConnectInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the Connect attachment. + // + // TransitGatewayAttachmentId is a required field + TransitGatewayAttachmentId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTransitGatewayConnectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTransitGatewayConnectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTransitGatewayConnectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayConnectInput"} + if s.TransitGatewayAttachmentId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DeleteTransitGatewayConnectInput) SetDryRun(v bool) *DeleteTransitGatewayConnectInput { + s.DryRun = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *DeleteTransitGatewayConnectInput) SetTransitGatewayAttachmentId(v string) *DeleteTransitGatewayConnectInput { + s.TransitGatewayAttachmentId = &v + return s +} + +type DeleteTransitGatewayConnectOutput struct { + _ struct{} `type:"structure"` + + // Information about the deleted Connect attachment. + TransitGatewayConnect *TransitGatewayConnect `locationName:"transitGatewayConnect" type:"structure"` +} + +// String returns the string representation +func (s DeleteTransitGatewayConnectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTransitGatewayConnectOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayConnect sets the TransitGatewayConnect field's value. +func (s *DeleteTransitGatewayConnectOutput) SetTransitGatewayConnect(v *TransitGatewayConnect) *DeleteTransitGatewayConnectOutput { + s.TransitGatewayConnect = v + return s +} + +type DeleteTransitGatewayConnectPeerInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the Connect peer. + // + // TransitGatewayConnectPeerId is a required field + TransitGatewayConnectPeerId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTransitGatewayConnectPeerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTransitGatewayConnectPeerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTransitGatewayConnectPeerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayConnectPeerInput"} + if s.TransitGatewayConnectPeerId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayConnectPeerId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DeleteTransitGatewayConnectPeerInput) SetDryRun(v bool) *DeleteTransitGatewayConnectPeerInput { + s.DryRun = &v + return s +} + +// SetTransitGatewayConnectPeerId sets the TransitGatewayConnectPeerId field's value. +func (s *DeleteTransitGatewayConnectPeerInput) SetTransitGatewayConnectPeerId(v string) *DeleteTransitGatewayConnectPeerInput { + s.TransitGatewayConnectPeerId = &v + return s +} + +type DeleteTransitGatewayConnectPeerOutput struct { + _ struct{} `type:"structure"` + + // Information about the deleted Connect peer. + TransitGatewayConnectPeer *TransitGatewayConnectPeer `locationName:"transitGatewayConnectPeer" type:"structure"` +} + +// String returns the string representation +func (s DeleteTransitGatewayConnectPeerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTransitGatewayConnectPeerOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayConnectPeer sets the TransitGatewayConnectPeer field's value. +func (s *DeleteTransitGatewayConnectPeerOutput) SetTransitGatewayConnectPeer(v *TransitGatewayConnectPeer) *DeleteTransitGatewayConnectPeerOutput { + s.TransitGatewayConnectPeer = v + return s +} + type DeleteTransitGatewayInput struct { _ struct{} `type:"structure"` @@ -58579,6 +63057,115 @@ func (s *DescribeAccountAttributesOutput) SetAccountAttributes(v []*AccountAttri return s } +type DescribeAddressesAttributeInput struct { + _ struct{} `type:"structure"` + + // [EC2-VPC] The allocation IDs. + AllocationIds []*string `locationName:"AllocationId" locationNameList:"item" type:"list"` + + // The attribute of the IP address. + Attribute *string `type:"string" enum:"AddressAttributeName"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeAddressesAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAddressesAttributeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAddressesAttributeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAddressesAttributeInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAllocationIds sets the AllocationIds field's value. +func (s *DescribeAddressesAttributeInput) SetAllocationIds(v []*string) *DescribeAddressesAttributeInput { + s.AllocationIds = v + return s +} + +// SetAttribute sets the Attribute field's value. +func (s *DescribeAddressesAttributeInput) SetAttribute(v string) *DescribeAddressesAttributeInput { + s.Attribute = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeAddressesAttributeInput) SetDryRun(v bool) *DescribeAddressesAttributeInput { + s.DryRun = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeAddressesAttributeInput) SetMaxResults(v int64) *DescribeAddressesAttributeInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeAddressesAttributeInput) SetNextToken(v string) *DescribeAddressesAttributeInput { + s.NextToken = &v + return s +} + +type DescribeAddressesAttributeOutput struct { + _ struct{} `type:"structure"` + + // Information about the IP addresses. + Addresses []*AddressAttribute `locationName:"addressSet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s DescribeAddressesAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAddressesAttributeOutput) GoString() string { + return s.String() +} + +// SetAddresses sets the Addresses field's value. +func (s *DescribeAddressesAttributeOutput) SetAddresses(v []*AddressAttribute) *DescribeAddressesAttributeOutput { + s.Addresses = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeAddressesAttributeOutput) SetNextToken(v string) *DescribeAddressesAttributeOutput { + s.NextToken = &v + return s +} + type DescribeAddressesInput struct { _ struct{} `type:"structure"` @@ -59090,17 +63677,23 @@ type DescribeCapacityReservationsInput struct { // AWS accounts. dedicated - The Capacity Reservation is created on single-tenant // hardware that is dedicated to a single AWS account. // + // * outpost-arn - The Amazon Resource Name (ARN) of the Outpost on which + // the Capacity Reservation was created. + // // * state - The current state of the Capacity Reservation. A Capacity Reservation // can be in one of the following states: active- The Capacity Reservation // is active and the capacity is available for your use. expired - The Capacity // Reservation expired automatically at the date and time specified in your // request. The reserved capacity is no longer available for your use. cancelled - // - The Capacity Reservation was manually cancelled. The reserved capacity - // is no longer available for your use. pending - The Capacity Reservation - // request was successful but the capacity provisioning is still pending. - // failed - The Capacity Reservation request has failed. A request might - // fail due to invalid request parameters, capacity constraints, or instance - // limit constraints. Failed requests are retained for 60 minutes. + // - The Capacity Reservation was cancelled. The reserved capacity is no + // longer available for your use. pending - The Capacity Reservation request + // was successful but the capacity provisioning is still pending. failed + // - The Capacity Reservation request has failed. A request might fail due + // to invalid request parameters, capacity constraints, or instance limit + // constraints. Failed requests are retained for 60 minutes. + // + // * start-date - The date and time at which the Capacity Reservation was + // started. // // * end-date - The date and time at which the Capacity Reservation expires. // When a Capacity Reservation expires, the reserved capacity is released @@ -62559,9 +67152,9 @@ type DescribeImageAttributeInput struct { // The AMI attribute. // - // Note: Depending on your account privileges, the blockDeviceMapping attribute - // may return a Client.AuthFailure error. If this happens, use DescribeImages - // to get information about the block device mapping for the AMI. + // Note: The blockDeviceMapping attribute is deprecated. Using this attribute + // returns the Client.AuthFailure error. To get information about the block + // device mappings for an AMI, use the DescribeImages action. // // Attribute is a required field Attribute *string `type:"string" required:"true" enum:"ImageAttributeName"` @@ -62629,6 +67222,9 @@ type DescribeImageAttributeOutput struct { // The block device mapping entries. BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` + // Describes a value for a resource attribute that is a String. + BootMode *AttributeValue `locationName:"bootMode" type:"structure"` + // A description for the AMI. Description *AttributeValue `locationName:"description" type:"structure"` @@ -62668,6 +67264,12 @@ func (s *DescribeImageAttributeOutput) SetBlockDeviceMappings(v []*BlockDeviceMa return s } +// SetBootMode sets the BootMode field's value. +func (s *DescribeImageAttributeOutput) SetBootMode(v *AttributeValue) *DescribeImageAttributeOutput { + s.BootMode = v + return s +} + // SetDescription sets the Description field's value. func (s *DescribeImageAttributeOutput) SetDescription(v *AttributeValue) *DescribeImageAttributeOutput { s.Description = v @@ -62764,13 +67366,13 @@ type DescribeImagesInput struct { // // * name - The name of the AMI (provided during image creation). // - // * owner-alias - The owner alias, from an Amazon-maintained list (amazon - // | aws-marketplace). This is not the user-configured AWS account alias - // set using the IAM console. We recommend that you use the related parameter - // instead of this filter. + // * owner-alias - The owner alias (amazon | aws-marketplace). The valid + // aliases are defined in an Amazon-maintained list. This is not the AWS + // account alias that can be set using the IAM console. We recommend that + // you use the Owner request parameter instead of this filter. // // * owner-id - The AWS account ID of the owner. We recommend that you use - // the related parameter instead of this filter. + // the Owner request parameter instead of this filter. // // * platform - The platform. To only list Windows-based AMIs, use windows. // @@ -63188,9 +67790,12 @@ type DescribeInstanceAttributeOutput struct { // The device name of the root device volume (for example, /dev/sda1). RootDeviceName *AttributeValue `locationName:"rootDeviceName" type:"structure"` - // Indicates whether source/destination checking is enabled. A value of true - // means that checking is enabled, and false means that checking is disabled. - // This value must be false for a NAT instance to perform NAT. + // Enable or disable source/destination checks, which ensure that the instance + // is either the source or the destination of any traffic that it receives. + // If the value is true, source/destination checks are enabled; otherwise, they + // are disabled. The default value is true. You must disable source/destination + // checks if the instance runs services such as network address translation, + // routing, or firewalls. SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` // Indicates whether enhanced networking with the Intel 82599 Virtual Function @@ -63823,6 +68428,9 @@ type DescribeInstanceTypesInput struct { // // * memory-info.size-in-mib - The memory size. // + // * network-info.efa-info.maximum-efa-interfaces - The maximum number of + // Elastic Fabric Adapters (EFAs) per instance. + // // * network-info.efa-supported - Indicates whether the instance type supports // Elastic Fabric Adapter (EFA) (true | false). // @@ -63850,6 +68458,8 @@ type DescribeInstanceTypesInput struct { // * processor-info.sustained-clock-speed-in-ghz - The CPU clock speed, in // GHz. // + // * supported-boot-mode - The boot mode (legacy-bios | uefi). + // // * supported-root-device-type - The root device type (ebs | instance-store). // // * supported-usage-class - The usage class (on-demand | spot). @@ -63872,8 +68482,8 @@ type DescribeInstanceTypesInput struct { // can be configured for the instance type. For example, "1" or "1,2". Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The instance types. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. + // The instance types. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon EC2 User Guide. InstanceTypes []*string `locationName:"InstanceType" type:"list"` // The maximum number of results to return for the request in a single page. @@ -63941,8 +68551,8 @@ func (s *DescribeInstanceTypesInput) SetNextToken(v string) *DescribeInstanceTyp type DescribeInstanceTypesOutput struct { _ struct{} `type:"structure"` - // The instance type. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. + // The instance type. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon EC2 User Guide. InstanceTypes []*InstanceTypeInfo `locationName:"instanceTypeSet" locationNameList:"item" type:"list"` // The token to use to retrieve the next page of results. This value is null @@ -64159,6 +68769,8 @@ type DescribeInstancesInput struct { // // * network-interface.vpc-id - The ID of the VPC for the network interface. // + // * outpost-arn - The Amazon Resource Name (ARN) of the Outpost. + // // * owner-id - The AWS account ID of the instance owner. // // * placement-group-name - The name of the placement group for the instance. @@ -66197,6 +70809,267 @@ func (s *DescribeNetworkAclsOutput) SetNextToken(v string) *DescribeNetworkAclsO return s } +type DescribeNetworkInsightsAnalysesInput struct { + _ struct{} `type:"structure"` + + // The time when the network insights analyses ended. + AnalysisEndTime *time.Time `type:"timestamp"` + + // The time when the network insights analyses started. + AnalysisStartTime *time.Time `type:"timestamp"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The filters. The following are possible values: + // + // * PathFound - A Boolean value that indicates whether a feasible path is + // found. + // + // * Status - The status of the analysis (running | succeeded | failed). + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"1" type:"integer"` + + // The ID of the network insights analyses. You must specify either analysis + // IDs or a path ID. + NetworkInsightsAnalysisIds []*string `locationName:"NetworkInsightsAnalysisId" locationNameList:"item" type:"list"` + + // The ID of the path. You must specify either a path ID or analysis IDs. + NetworkInsightsPathId *string `type:"string"` + + // The token for the next page of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeNetworkInsightsAnalysesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkInsightsAnalysesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeNetworkInsightsAnalysesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkInsightsAnalysesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalysisEndTime sets the AnalysisEndTime field's value. +func (s *DescribeNetworkInsightsAnalysesInput) SetAnalysisEndTime(v time.Time) *DescribeNetworkInsightsAnalysesInput { + s.AnalysisEndTime = &v + return s +} + +// SetAnalysisStartTime sets the AnalysisStartTime field's value. +func (s *DescribeNetworkInsightsAnalysesInput) SetAnalysisStartTime(v time.Time) *DescribeNetworkInsightsAnalysesInput { + s.AnalysisStartTime = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeNetworkInsightsAnalysesInput) SetDryRun(v bool) *DescribeNetworkInsightsAnalysesInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeNetworkInsightsAnalysesInput) SetFilters(v []*Filter) *DescribeNetworkInsightsAnalysesInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeNetworkInsightsAnalysesInput) SetMaxResults(v int64) *DescribeNetworkInsightsAnalysesInput { + s.MaxResults = &v + return s +} + +// SetNetworkInsightsAnalysisIds sets the NetworkInsightsAnalysisIds field's value. +func (s *DescribeNetworkInsightsAnalysesInput) SetNetworkInsightsAnalysisIds(v []*string) *DescribeNetworkInsightsAnalysesInput { + s.NetworkInsightsAnalysisIds = v + return s +} + +// SetNetworkInsightsPathId sets the NetworkInsightsPathId field's value. +func (s *DescribeNetworkInsightsAnalysesInput) SetNetworkInsightsPathId(v string) *DescribeNetworkInsightsAnalysesInput { + s.NetworkInsightsPathId = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeNetworkInsightsAnalysesInput) SetNextToken(v string) *DescribeNetworkInsightsAnalysesInput { + s.NextToken = &v + return s +} + +type DescribeNetworkInsightsAnalysesOutput struct { + _ struct{} `type:"structure"` + + // Information about the network insights analyses. + NetworkInsightsAnalyses []*NetworkInsightsAnalysis `locationName:"networkInsightsAnalysisSet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s DescribeNetworkInsightsAnalysesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkInsightsAnalysesOutput) GoString() string { + return s.String() +} + +// SetNetworkInsightsAnalyses sets the NetworkInsightsAnalyses field's value. +func (s *DescribeNetworkInsightsAnalysesOutput) SetNetworkInsightsAnalyses(v []*NetworkInsightsAnalysis) *DescribeNetworkInsightsAnalysesOutput { + s.NetworkInsightsAnalyses = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeNetworkInsightsAnalysesOutput) SetNextToken(v string) *DescribeNetworkInsightsAnalysesOutput { + s.NextToken = &v + return s +} + +type DescribeNetworkInsightsPathsInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The filters. The following are possible values: + // + // * Destination - The ID of the resource. + // + // * DestinationPort - The destination port. + // + // * Name - The path name. + // + // * Protocol - The protocol. + // + // * Source - The ID of the resource. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"1" type:"integer"` + + // The IDs of the paths. + NetworkInsightsPathIds []*string `locationName:"NetworkInsightsPathId" locationNameList:"item" type:"list"` + + // The token for the next page of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeNetworkInsightsPathsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkInsightsPathsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeNetworkInsightsPathsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkInsightsPathsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeNetworkInsightsPathsInput) SetDryRun(v bool) *DescribeNetworkInsightsPathsInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeNetworkInsightsPathsInput) SetFilters(v []*Filter) *DescribeNetworkInsightsPathsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeNetworkInsightsPathsInput) SetMaxResults(v int64) *DescribeNetworkInsightsPathsInput { + s.MaxResults = &v + return s +} + +// SetNetworkInsightsPathIds sets the NetworkInsightsPathIds field's value. +func (s *DescribeNetworkInsightsPathsInput) SetNetworkInsightsPathIds(v []*string) *DescribeNetworkInsightsPathsInput { + s.NetworkInsightsPathIds = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeNetworkInsightsPathsInput) SetNextToken(v string) *DescribeNetworkInsightsPathsInput { + s.NextToken = &v + return s +} + +type DescribeNetworkInsightsPathsOutput struct { + _ struct{} `type:"structure"` + + // Information about the paths. + NetworkInsightsPaths []*NetworkInsightsPath `locationName:"networkInsightsPathSet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s DescribeNetworkInsightsPathsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkInsightsPathsOutput) GoString() string { + return s.String() +} + +// SetNetworkInsightsPaths sets the NetworkInsightsPaths field's value. +func (s *DescribeNetworkInsightsPathsOutput) SetNetworkInsightsPaths(v []*NetworkInsightsPath) *DescribeNetworkInsightsPathsOutput { + s.NetworkInsightsPaths = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeNetworkInsightsPathsOutput) SetNextToken(v string) *DescribeNetworkInsightsPathsOutput { + s.NextToken = &v + return s +} + // Contains the parameters for DescribeNetworkInterfaceAttribute. type DescribeNetworkInterfaceAttributeInput struct { _ struct{} `type:"structure"` @@ -66511,8 +71384,8 @@ type DescribeNetworkInterfacesInput struct { // // * private-dns-name - The private DNS name of the network interface (IPv4). // - // * requester-id - The ID of the entity that launched the instance on your - // behalf (for example, AWS Management Console, Auto Scaling, and so on). + // * requester-id - The alias or AWS account ID of the principal or service + // that created the network interface. // // * requester-managed - Indicates whether the network interface is being // managed by an AWS service (for example, AWS Management Console, Auto Scaling, @@ -67138,6 +72011,118 @@ func (s *DescribeRegionsOutput) SetRegions(v []*Region) *DescribeRegionsOutput { return s } +type DescribeReplaceRootVolumeTasksInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // Filter to use: + // + // * instance-id - The ID of the instance for which the root volume replacement + // task was created. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The ID of the root volume replacement task to view. + ReplaceRootVolumeTaskIds []*string `locationName:"ReplaceRootVolumeTaskId" locationNameList:"ReplaceRootVolumeTaskId" type:"list"` +} + +// String returns the string representation +func (s DescribeReplaceRootVolumeTasksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReplaceRootVolumeTasksInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeReplaceRootVolumeTasksInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeReplaceRootVolumeTasksInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeReplaceRootVolumeTasksInput) SetDryRun(v bool) *DescribeReplaceRootVolumeTasksInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeReplaceRootVolumeTasksInput) SetFilters(v []*Filter) *DescribeReplaceRootVolumeTasksInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeReplaceRootVolumeTasksInput) SetMaxResults(v int64) *DescribeReplaceRootVolumeTasksInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeReplaceRootVolumeTasksInput) SetNextToken(v string) *DescribeReplaceRootVolumeTasksInput { + s.NextToken = &v + return s +} + +// SetReplaceRootVolumeTaskIds sets the ReplaceRootVolumeTaskIds field's value. +func (s *DescribeReplaceRootVolumeTasksInput) SetReplaceRootVolumeTaskIds(v []*string) *DescribeReplaceRootVolumeTasksInput { + s.ReplaceRootVolumeTaskIds = v + return s +} + +type DescribeReplaceRootVolumeTasksOutput struct { + _ struct{} `type:"structure"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the root volume replacement task. + ReplaceRootVolumeTasks []*ReplaceRootVolumeTask `locationName:"replaceRootVolumeTaskSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeReplaceRootVolumeTasksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReplaceRootVolumeTasksOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeReplaceRootVolumeTasksOutput) SetNextToken(v string) *DescribeReplaceRootVolumeTasksOutput { + s.NextToken = &v + return s +} + +// SetReplaceRootVolumeTasks sets the ReplaceRootVolumeTasks field's value. +func (s *DescribeReplaceRootVolumeTasksOutput) SetReplaceRootVolumeTasks(v []*ReplaceRootVolumeTask) *DescribeReplaceRootVolumeTasksOutput { + s.ReplaceRootVolumeTasks = v + return s +} + // Contains the parameters for DescribeReservedInstances. type DescribeReservedInstancesInput struct { _ struct{} `type:"structure"` @@ -67170,10 +72155,11 @@ type DescribeReservedInstancesInput struct { // will only be displayed to EC2-Classic account holders and are for use // with Amazon VPC (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | SUSE // Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise Linux - // (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL Server - // Standard | Windows with SQL Server Standard (Amazon VPC) | Windows with - // SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows with - // SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon VPC)). + // (Amazon VPC) | Red Hat Enterprise Linux with HA (Amazon VPC) | Windows + // | Windows (Amazon VPC) | Windows with SQL Server Standard | Windows with + // SQL Server Standard (Amazon VPC) | Windows with SQL Server Web | Windows + // with SQL Server Web (Amazon VPC) | Windows with SQL Server Enterprise + // | Windows with SQL Server Enterprise (Amazon VPC)). // // * reserved-instances-id - The ID of the Reserved Instance. // @@ -67471,11 +72457,11 @@ type DescribeReservedInstancesOfferingsInput struct { // will only be displayed to EC2-Classic account holders and are for use // with Amazon VPC. (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | // SUSE Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise - // Linux (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL - // Server Standard | Windows with SQL Server Standard (Amazon VPC) | Windows - // with SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows - // with SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon - // VPC)) + // Linux (Amazon VPC) | Red Hat Enterprise Linux with HA (Amazon VPC) | Windows + // | Windows (Amazon VPC) | Windows with SQL Server Standard | Windows with + // SQL Server Standard (Amazon VPC) | Windows with SQL Server Web | Windows + // with SQL Server Web (Amazon VPC) | Windows with SQL Server Enterprise + // | Windows with SQL Server Enterprise (Amazon VPC)) // // * reserved-instances-offering-id - The Reserved Instances offering ID. // @@ -67499,8 +72485,8 @@ type DescribeReservedInstancesOfferingsInput struct { InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` // The instance type that the reservation will cover (for example, m1.small). - // For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. + // For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon EC2 User Guide. InstanceType *string `type:"string" enum:"InstanceType"` // The maximum duration (in seconds) to filter when searching for offerings. @@ -68257,7 +73243,7 @@ type DescribeSecurityGroupsInput struct { // been referenced in an outbound security group rule. // // * egress.ip-permission.group-name - The name of a security group that - // has been referenced in an outbound security group rule. + // is referenced in an outbound security group rule. // // * egress.ip-permission.ipv6-cidr - An IPv6 CIDR block for an outbound // security group rule. @@ -68266,7 +73252,7 @@ type DescribeSecurityGroupsInput struct { // a security group rule allows outbound access. // // * egress.ip-permission.protocol - The IP protocol for an outbound security - // group rule (tcp | udp | icmp or a protocol number). + // group rule (tcp | udp | icmp, a protocol number, or -1 for all protocols). // // * egress.ip-permission.to-port - For an outbound rule, the end of port // range for the TCP and UDP protocols, or an ICMP code. @@ -68287,8 +73273,8 @@ type DescribeSecurityGroupsInput struct { // * ip-permission.group-id - The ID of a security group that has been referenced // in an inbound security group rule. // - // * ip-permission.group-name - The name of a security group that has been - // referenced in an inbound security group rule. + // * ip-permission.group-name - The name of a security group that is referenced + // in an inbound security group rule. // // * ip-permission.ipv6-cidr - An IPv6 CIDR block for an inbound security // group rule. @@ -68297,7 +73283,7 @@ type DescribeSecurityGroupsInput struct { // security group rule allows inbound access. // // * ip-permission.protocol - The IP protocol for an inbound security group - // rule (tcp | udp | icmp or a protocol number). + // rule (tcp | udp | icmp, a protocol number, or -1 for all protocols). // // * ip-permission.to-port - For an inbound rule, the end of port range for // the TCP and UDP protocols, or an ICMP code. @@ -68593,7 +73579,7 @@ type DescribeSnapshotsInput struct { // results in a single page along with a NextToken response element. The remaining // results of the initial request can be seen by sending another DescribeSnapshots // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results + // 1,000; if MaxResults is given a value larger than 1,000, only 1,000 results // are returned. If this parameter is not used, then DescribeSnapshots returns // all results. You cannot specify this parameter and the snapshot IDs parameter // in the same request. @@ -69595,6 +74581,124 @@ func (s *DescribeStaleSecurityGroupsOutput) SetStaleSecurityGroupSet(v []*StaleS return s } +type DescribeStoreImageTasksInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The filters. + // + // * task-state - Returns tasks in a certain state (InProgress | Completed + // | Failed) + // + // * bucket - Returns task information for tasks that targeted a specific + // bucket. For the filter value, specify the bucket name. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The AMI IDs for which to show progress. Up to 20 AMI IDs can be included + // in a request. + ImageIds []*string `locationName:"ImageId" locationNameList:"item" type:"list"` + + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 1 and 200. You cannot specify this parameter and the + // ImageIDs parameter in the same call. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeStoreImageTasksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStoreImageTasksInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeStoreImageTasksInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStoreImageTasksInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeStoreImageTasksInput) SetDryRun(v bool) *DescribeStoreImageTasksInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeStoreImageTasksInput) SetFilters(v []*Filter) *DescribeStoreImageTasksInput { + s.Filters = v + return s +} + +// SetImageIds sets the ImageIds field's value. +func (s *DescribeStoreImageTasksInput) SetImageIds(v []*string) *DescribeStoreImageTasksInput { + s.ImageIds = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeStoreImageTasksInput) SetMaxResults(v int64) *DescribeStoreImageTasksInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeStoreImageTasksInput) SetNextToken(v string) *DescribeStoreImageTasksInput { + s.NextToken = &v + return s +} + +type DescribeStoreImageTasksOutput struct { + _ struct{} `type:"structure"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // The information about the AMI store tasks. + StoreImageTaskResults []*StoreImageTaskResult `locationName:"storeImageTaskResultSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeStoreImageTasksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStoreImageTasksOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeStoreImageTasksOutput) SetNextToken(v string) *DescribeStoreImageTasksOutput { + s.NextToken = &v + return s +} + +// SetStoreImageTaskResults sets the StoreImageTaskResults field's value. +func (s *DescribeStoreImageTasksOutput) SetStoreImageTaskResults(v []*StoreImageTaskResult) *DescribeStoreImageTasksOutput { + s.StoreImageTaskResults = v + return s +} + type DescribeSubnetsInput struct { _ struct{} `type:"structure"` @@ -69631,6 +74735,8 @@ type DescribeSubnetsInput struct { // * ipv6-cidr-block-association.state - The state of an IPv6 CIDR block // associated with the subnet. // + // * outpost-arn - The Amazon Resource Name (ARN) of the Outpost. + // // * owner-id - The ID of the AWS account that owns the subnet. // // * state - The state of the subnet (pending | available). @@ -70240,7 +75346,7 @@ type DescribeTransitGatewayAttachmentsInput struct { // * resource-owner-id - The ID of the AWS account that owns the resource. // // * resource-type - The resource type. Valid values are vpc | vpn | direct-connect-gateway - // | peering. + // | peering | connect. // // * state - The state of the attachment. Valid values are available | deleted // | deleting | failed | failing | initiatingRequest | modifying | pendingAcceptance @@ -70351,6 +75457,244 @@ func (s *DescribeTransitGatewayAttachmentsOutput) SetTransitGatewayAttachments(v return s } +type DescribeTransitGatewayConnectPeersInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more filters. The possible values are: + // + // * state - The state of the Connect peer (pending | available | deleting + // | deleted). + // + // * transit-gateway-attachment-id - The ID of the attachment. + // + // * transit-gateway-connect-peer-id - The ID of the Connect peer. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The IDs of the Connect peers. + TransitGatewayConnectPeerIds []*string `locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeTransitGatewayConnectPeersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTransitGatewayConnectPeersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTransitGatewayConnectPeersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTransitGatewayConnectPeersInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeTransitGatewayConnectPeersInput) SetDryRun(v bool) *DescribeTransitGatewayConnectPeersInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeTransitGatewayConnectPeersInput) SetFilters(v []*Filter) *DescribeTransitGatewayConnectPeersInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeTransitGatewayConnectPeersInput) SetMaxResults(v int64) *DescribeTransitGatewayConnectPeersInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTransitGatewayConnectPeersInput) SetNextToken(v string) *DescribeTransitGatewayConnectPeersInput { + s.NextToken = &v + return s +} + +// SetTransitGatewayConnectPeerIds sets the TransitGatewayConnectPeerIds field's value. +func (s *DescribeTransitGatewayConnectPeersInput) SetTransitGatewayConnectPeerIds(v []*string) *DescribeTransitGatewayConnectPeersInput { + s.TransitGatewayConnectPeerIds = v + return s +} + +type DescribeTransitGatewayConnectPeersOutput struct { + _ struct{} `type:"structure"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the Connect peers. + TransitGatewayConnectPeers []*TransitGatewayConnectPeer `locationName:"transitGatewayConnectPeerSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeTransitGatewayConnectPeersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTransitGatewayConnectPeersOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTransitGatewayConnectPeersOutput) SetNextToken(v string) *DescribeTransitGatewayConnectPeersOutput { + s.NextToken = &v + return s +} + +// SetTransitGatewayConnectPeers sets the TransitGatewayConnectPeers field's value. +func (s *DescribeTransitGatewayConnectPeersOutput) SetTransitGatewayConnectPeers(v []*TransitGatewayConnectPeer) *DescribeTransitGatewayConnectPeersOutput { + s.TransitGatewayConnectPeers = v + return s +} + +type DescribeTransitGatewayConnectsInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more filters. The possible values are: + // + // * options.protocol - The tunnel protocol (gre). + // + // * state - The state of the attachment (initiating | initiatingRequest + // | pendingAcceptance | rollingBack | pending | available | modifying | + // deleting | deleted | failed | rejected | rejecting | failing). + // + // * transit-gateway-attachment-id - The ID of the Connect attachment. + // + // * transit-gateway-id - The ID of the transit gateway. + // + // * transport-transit-gateway-attachment-id - The ID of the transit gateway + // attachment from which the Connect attachment was created. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The IDs of the attachments. + TransitGatewayAttachmentIds []*string `type:"list"` +} + +// String returns the string representation +func (s DescribeTransitGatewayConnectsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTransitGatewayConnectsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTransitGatewayConnectsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTransitGatewayConnectsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeTransitGatewayConnectsInput) SetDryRun(v bool) *DescribeTransitGatewayConnectsInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeTransitGatewayConnectsInput) SetFilters(v []*Filter) *DescribeTransitGatewayConnectsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeTransitGatewayConnectsInput) SetMaxResults(v int64) *DescribeTransitGatewayConnectsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTransitGatewayConnectsInput) SetNextToken(v string) *DescribeTransitGatewayConnectsInput { + s.NextToken = &v + return s +} + +// SetTransitGatewayAttachmentIds sets the TransitGatewayAttachmentIds field's value. +func (s *DescribeTransitGatewayConnectsInput) SetTransitGatewayAttachmentIds(v []*string) *DescribeTransitGatewayConnectsInput { + s.TransitGatewayAttachmentIds = v + return s +} + +type DescribeTransitGatewayConnectsOutput struct { + _ struct{} `type:"structure"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the Connect attachments. + TransitGatewayConnects []*TransitGatewayConnect `locationName:"transitGatewayConnectSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeTransitGatewayConnectsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTransitGatewayConnectsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTransitGatewayConnectsOutput) SetNextToken(v string) *DescribeTransitGatewayConnectsOutput { + s.NextToken = &v + return s +} + +// SetTransitGatewayConnects sets the TransitGatewayConnects field's value. +func (s *DescribeTransitGatewayConnectsOutput) SetTransitGatewayConnects(v []*TransitGatewayConnect) *DescribeTransitGatewayConnectsOutput { + s.TransitGatewayConnects = v + return s +} + type DescribeTransitGatewayMulticastDomainsInput struct { _ struct{} `type:"structure"` @@ -71135,8 +76479,8 @@ type DescribeVolumeStatusInput struct { // paginated output. When this parameter is used, the request only returns MaxResults // results in a single page along with a NextToken response element. The remaining // results of the initial request can be seen by sending another request with - // the returned NextToken value. This value can be between 5 and 1000; if MaxResults - // is given a value larger than 1000, only 1000 results are returned. If this + // the returned NextToken value. This value can be between 5 and 1,000; if MaxResults + // is given a value larger than 1,000, only 1,000 results are returned. If this // parameter is not used, then DescribeVolumeStatus returns all results. You // cannot specify this parameter and the volume IDs parameter in the same request. MaxResults *int64 `type:"integer"` @@ -71281,9 +76625,8 @@ type DescribeVolumesInput struct { // // * volume-id - The volume ID. // - // * volume-type - The Amazon EBS volume type. This can be gp2 for General - // Purpose SSD, io1 or io2 for Provisioned IOPS SSD, st1 for Throughput Optimized - // HDD, sc1 for Cold HDD, or standard for Magnetic volumes. + // * volume-type - The Amazon EBS volume type (gp2 | gp3 | io1 | io2 | st1 + // | sc1| standard) Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` // The maximum number of volume results returned by DescribeVolumes in paginated @@ -72241,6 +77584,8 @@ type DescribeVpcEndpointServicesInput struct { // // * service-name - The name of the service. // + // * service-type - The type of service (Interface | Gateway). + // // * tag: - The key/value combination of a tag assigned to the resource. // Use the tag key in the filter name and the tag value as the filter value. // For example, to find all resources that have a tag with the key Owner @@ -72371,6 +77716,9 @@ type DescribeVpcEndpointsInput struct { // * vpc-endpoint-state - The state of the endpoint (pendingAcceptance | // pending | available | deleting | deleted | rejected | failed). // + // * vpc-endpoint-type - The type of VPC endpoint (Interface | Gateway | + // GatewayLoadBalancer). + // // * tag: - The key/value combination of a tag assigned to the resource. // Use the tag key in the filter name and the tag value as the filter value. // For example, to find all resources that have a tag with the key Owner @@ -73901,6 +79249,57 @@ func (s *DisableFastSnapshotRestoresOutput) SetUnsuccessful(v []*DisableFastSnap return s } +type DisableSerialConsoleAccessInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` +} + +// String returns the string representation +func (s DisableSerialConsoleAccessInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableSerialConsoleAccessInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *DisableSerialConsoleAccessInput) SetDryRun(v bool) *DisableSerialConsoleAccessInput { + s.DryRun = &v + return s +} + +type DisableSerialConsoleAccessOutput struct { + _ struct{} `type:"structure"` + + // If true, access to the EC2 serial console of all instances is enabled for + // your account. If false, access to the EC2 serial console of all instances + // is disabled for your account. + SerialConsoleAccessEnabled *bool `locationName:"serialConsoleAccessEnabled" type:"boolean"` +} + +// String returns the string representation +func (s DisableSerialConsoleAccessOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableSerialConsoleAccessOutput) GoString() string { + return s.String() +} + +// SetSerialConsoleAccessEnabled sets the SerialConsoleAccessEnabled field's value. +func (s *DisableSerialConsoleAccessOutput) SetSerialConsoleAccessEnabled(v bool) *DisableSerialConsoleAccessOutput { + s.SerialConsoleAccessEnabled = &v + return s +} + type DisableTransitGatewayRouteTablePropagationInput struct { _ struct{} `type:"structure"` @@ -75206,15 +80605,15 @@ type EbsBlockDevice struct { // Indicates whether the EBS volume is deleted on instance termination. For // more information, see Preserving Amazon EBS volumes on instance termination // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#preserving-volumes-on-termination) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` // Indicates whether the encryption state of an EBS volume is changed while // being restored from a backing snapshot. The effect of setting the encryption // state to true depends on the volume origin (new or from a snapshot), starting // encryption state, ownership, and whether encryption by default is enabled. - // For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-parameters) - // in the Amazon Elastic Compute Cloud User Guide. + // For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-parameters) + // in the Amazon EC2 User Guide. // // In no case can you remove encryption from an encrypted volume. // @@ -75224,22 +80623,25 @@ type EbsBlockDevice struct { // This parameter is not returned by . Encrypted *bool `locationName:"encrypted" type:"boolean"` - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1 and io2 volumes, this represents the number of IOPS that are provisioned - // for the volume. For gp2 volumes, this represents the baseline performance - // of the volume and the rate at which the volume accumulates I/O credits for - // bursting. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. + // The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes, + // this represents the number of IOPS that are provisioned for the volume. For + // gp2 volumes, this represents the baseline performance of the volume and the + // rate at which the volume accumulates I/O credits for bursting. // - // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000 IOPS - // for io1 and io2 volumes in most Regions. Maximum io1 and io2 IOPS of 64,000 - // is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). - // Other instance families guarantee performance up to 32,000 IOPS. For more - // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. + // The following are the supported values for each volume type: // - // Condition: This parameter is required for requests to create io1 and io2 - // volumes; it is not used in requests to create gp2, st1, sc1, or standard + // * gp3: 3,000-16,000 IOPS + // + // * io1: 100-64,000 IOPS + // + // * io2: 100-64,000 IOPS + // + // For io1 and io2 volumes, we guarantee 64,000 IOPS only for Instances built + // on the Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Other instance families guarantee performance up to 32,000 IOPS. + // + // This parameter is required for io1 and io2 volumes. The default for gp3 volumes + // is 3,000 IOPS. This parameter is not supported for gp2, st1, sc1, or standard // volumes. Iops *int64 `locationName:"iops" type:"integer"` @@ -75252,26 +80654,38 @@ type EbsBlockDevice struct { // and RequestSpotInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html). KmsKeyId *string `type:"string"` + // The ARN of the Outpost on which the snapshot is stored. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // The ID of the snapshot. SnapshotId *string `locationName:"snapshotId" type:"string"` - // The size of the volume, in GiB. + // The throughput that the volume supports, in MiB/s. // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. + // This parameter is valid only for gp3 volumes. // - // Constraints: 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned - // IOPS SSD (io1 and io2), 500-16384 for Throughput Optimized HDD (st1), 500-16384 - // for Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify - // a snapshot, the volume size must be equal to or larger than the snapshot + // Valid Range: Minimum value of 125. Maximum value of 1000. + Throughput *int64 `locationName:"throughput" type:"integer"` + + // The size of the volume, in GiBs. You must specify either a snapshot ID or + // a volume size. If you specify a snapshot, the default is the snapshot size. + // You can specify a volume size that is equal to or larger than the snapshot // size. + // + // The following are the supported volumes sizes for each volume type: + // + // * gp2 and gp3:1-16,384 + // + // * io1 and io2: 4-16,384 + // + // * st1 and sc1: 125-16,384 + // + // * standard: 1-1,024 VolumeSize *int64 `locationName:"volumeSize" type:"integer"` - // The volume type. If you set the type to io1 or io2, you must also specify - // the Iops parameter. If you set the type to gp2, st1, sc1, or standard, you - // must omit the Iops parameter. - // - // Default: gp2 + // The volume type. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // in the Amazon EC2 User Guide. If the volume type is io1 or io2, you must + // specify the IOPS that the volume supports. VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` } @@ -75309,12 +80723,24 @@ func (s *EbsBlockDevice) SetKmsKeyId(v string) *EbsBlockDevice { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *EbsBlockDevice) SetOutpostArn(v string) *EbsBlockDevice { + s.OutpostArn = &v + return s +} + // SetSnapshotId sets the SnapshotId field's value. func (s *EbsBlockDevice) SetSnapshotId(v string) *EbsBlockDevice { s.SnapshotId = &v return s } +// SetThroughput sets the Throughput field's value. +func (s *EbsBlockDevice) SetThroughput(v int64) *EbsBlockDevice { + s.Throughput = &v + return s +} + // SetVolumeSize sets the VolumeSize field's value. func (s *EbsBlockDevice) SetVolumeSize(v int64) *EbsBlockDevice { s.VolumeSize = &v @@ -75335,8 +80761,8 @@ type EbsInfo struct { EbsOptimizedInfo *EbsOptimizedInfo `locationName:"ebsOptimizedInfo" type:"structure"` // Indicates whether the instance type is Amazon EBS-optimized. For more information, - // see Amazon EBS-Optimized Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) - // in Amazon EC2 User Guide for Linux Instances. + // see Amazon EBS-optimized instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) + // in Amazon EC2 User Guide. EbsOptimizedSupport *string `locationName:"ebsOptimizedSupport" type:"string" enum:"EbsOptimizedSupport"` // Indicates whether Amazon EBS encryption is supported. @@ -75540,6 +80966,30 @@ func (s *EbsOptimizedInfo) SetMaximumThroughputInMBps(v float64) *EbsOptimizedIn return s } +// Describes the Elastic Fabric Adapters for the instance type. +type EfaInfo struct { + _ struct{} `type:"structure"` + + // The maximum number of Elastic Fabric Adapters for the instance type. + MaximumEfaInterfaces *int64 `locationName:"maximumEfaInterfaces" type:"integer"` +} + +// String returns the string representation +func (s EfaInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EfaInfo) GoString() string { + return s.String() +} + +// SetMaximumEfaInterfaces sets the MaximumEfaInterfaces field's value. +func (s *EfaInfo) SetMaximumEfaInterfaces(v int64) *EfaInfo { + s.MaximumEfaInterfaces = &v + return s +} + // Describes an egress-only internet gateway. type EgressOnlyInternetGateway struct { _ struct{} `type:"structure"` @@ -76278,6 +81728,57 @@ func (s *EnableFastSnapshotRestoresOutput) SetUnsuccessful(v []*EnableFastSnapsh return s } +type EnableSerialConsoleAccessInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` +} + +// String returns the string representation +func (s EnableSerialConsoleAccessInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableSerialConsoleAccessInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *EnableSerialConsoleAccessInput) SetDryRun(v bool) *EnableSerialConsoleAccessInput { + s.DryRun = &v + return s +} + +type EnableSerialConsoleAccessOutput struct { + _ struct{} `type:"structure"` + + // If true, access to the EC2 serial console of all instances is enabled for + // your account. If false, access to the EC2 serial console of all instances + // is disabled for your account. + SerialConsoleAccessEnabled *bool `locationName:"serialConsoleAccessEnabled" type:"boolean"` +} + +// String returns the string representation +func (s EnableSerialConsoleAccessOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableSerialConsoleAccessOutput) GoString() string { + return s.String() +} + +// SetSerialConsoleAccessEnabled sets the SerialConsoleAccessEnabled field's value. +func (s *EnableSerialConsoleAccessOutput) SetSerialConsoleAccessEnabled(v bool) *EnableSerialConsoleAccessOutput { + s.SerialConsoleAccessEnabled = &v + return s +} + type EnableTransitGatewayRouteTablePropagationInput struct { _ struct{} `type:"structure"` @@ -76786,6 +82287,431 @@ func (s *EventInformation) SetInstanceId(v string) *EventInformation { return s } +// Describes an explanation code for an unreachable path. For more information, +// see Reachability Analyzer explanation codes (https://docs.aws.amazon.com/vpc/latest/reachability/explanation-codes.html). +type Explanation struct { + _ struct{} `type:"structure"` + + // The network ACL. + Acl *AnalysisComponent `locationName:"acl" type:"structure"` + + // The network ACL rule. + AclRule *AnalysisAclRule `locationName:"aclRule" type:"structure"` + + // The IPv4 address, in CIDR notation. + Address *string `locationName:"address" type:"string"` + + // The IPv4 addresses, in CIDR notation. + Addresses []*string `locationName:"addressSet" locationNameList:"item" type:"list"` + + // The resource to which the component is attached. + AttachedTo *AnalysisComponent `locationName:"attachedTo" type:"structure"` + + // The Availability Zones. + AvailabilityZones []*string `locationName:"availabilityZoneSet" locationNameList:"item" type:"list"` + + // The CIDR ranges. + Cidrs []*string `locationName:"cidrSet" locationNameList:"item" type:"list"` + + // The listener for a Classic Load Balancer. + ClassicLoadBalancerListener *AnalysisLoadBalancerListener `locationName:"classicLoadBalancerListener" type:"structure"` + + // The component. + Component *AnalysisComponent `locationName:"component" type:"structure"` + + // The customer gateway. + CustomerGateway *AnalysisComponent `locationName:"customerGateway" type:"structure"` + + // The destination. + Destination *AnalysisComponent `locationName:"destination" type:"structure"` + + // The destination VPC. + DestinationVpc *AnalysisComponent `locationName:"destinationVpc" type:"structure"` + + // The direction. The following are possible values: + // + // * egress + // + // * ingress + Direction *string `locationName:"direction" type:"string"` + + // The load balancer listener. + ElasticLoadBalancerListener *AnalysisComponent `locationName:"elasticLoadBalancerListener" type:"structure"` + + // The explanation code. + ExplanationCode *string `locationName:"explanationCode" type:"string"` + + // The route table. + IngressRouteTable *AnalysisComponent `locationName:"ingressRouteTable" type:"structure"` + + // The internet gateway. + InternetGateway *AnalysisComponent `locationName:"internetGateway" type:"structure"` + + // The Amazon Resource Name (ARN) of the load balancer. + LoadBalancerArn *string `locationName:"loadBalancerArn" min:"1" type:"string"` + + // The listener port of the load balancer. + LoadBalancerListenerPort *int64 `locationName:"loadBalancerListenerPort" min:"1" type:"integer"` + + // The target. + LoadBalancerTarget *AnalysisLoadBalancerTarget `locationName:"loadBalancerTarget" type:"structure"` + + // The target group. + LoadBalancerTargetGroup *AnalysisComponent `locationName:"loadBalancerTargetGroup" type:"structure"` + + // The target groups. + LoadBalancerTargetGroups []*AnalysisComponent `locationName:"loadBalancerTargetGroupSet" locationNameList:"item" type:"list"` + + // The target port. + LoadBalancerTargetPort *int64 `locationName:"loadBalancerTargetPort" min:"1" type:"integer"` + + // The missing component. + MissingComponent *string `locationName:"missingComponent" type:"string"` + + // The NAT gateway. + NatGateway *AnalysisComponent `locationName:"natGateway" type:"structure"` + + // The network interface. + NetworkInterface *AnalysisComponent `locationName:"networkInterface" type:"structure"` + + // The packet field. + PacketField *string `locationName:"packetField" type:"string"` + + // The port. + Port *int64 `locationName:"port" min:"1" type:"integer"` + + // The port ranges. + PortRanges []*PortRange `locationName:"portRangeSet" locationNameList:"item" type:"list"` + + // The prefix list. + PrefixList *AnalysisComponent `locationName:"prefixList" type:"structure"` + + // The protocols. + Protocols []*string `locationName:"protocolSet" locationNameList:"item" type:"list"` + + // The route table. + RouteTable *AnalysisComponent `locationName:"routeTable" type:"structure"` + + // The route table route. + RouteTableRoute *AnalysisRouteTableRoute `locationName:"routeTableRoute" type:"structure"` + + // The security group. + SecurityGroup *AnalysisComponent `locationName:"securityGroup" type:"structure"` + + // The security group rule. + SecurityGroupRule *AnalysisSecurityGroupRule `locationName:"securityGroupRule" type:"structure"` + + // The security groups. + SecurityGroups []*AnalysisComponent `locationName:"securityGroupSet" locationNameList:"item" type:"list"` + + // The source VPC. + SourceVpc *AnalysisComponent `locationName:"sourceVpc" type:"structure"` + + // The state. + State *string `locationName:"state" type:"string"` + + // The subnet. + Subnet *AnalysisComponent `locationName:"subnet" type:"structure"` + + // The route table for the subnet. + SubnetRouteTable *AnalysisComponent `locationName:"subnetRouteTable" type:"structure"` + + // The component VPC. + Vpc *AnalysisComponent `locationName:"vpc" type:"structure"` + + // The VPC endpoint. + VpcEndpoint *AnalysisComponent `locationName:"vpcEndpoint" type:"structure"` + + // The VPC peering connection. + VpcPeeringConnection *AnalysisComponent `locationName:"vpcPeeringConnection" type:"structure"` + + // The VPN connection. + VpnConnection *AnalysisComponent `locationName:"vpnConnection" type:"structure"` + + // The VPN gateway. + VpnGateway *AnalysisComponent `locationName:"vpnGateway" type:"structure"` +} + +// String returns the string representation +func (s Explanation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Explanation) GoString() string { + return s.String() +} + +// SetAcl sets the Acl field's value. +func (s *Explanation) SetAcl(v *AnalysisComponent) *Explanation { + s.Acl = v + return s +} + +// SetAclRule sets the AclRule field's value. +func (s *Explanation) SetAclRule(v *AnalysisAclRule) *Explanation { + s.AclRule = v + return s +} + +// SetAddress sets the Address field's value. +func (s *Explanation) SetAddress(v string) *Explanation { + s.Address = &v + return s +} + +// SetAddresses sets the Addresses field's value. +func (s *Explanation) SetAddresses(v []*string) *Explanation { + s.Addresses = v + return s +} + +// SetAttachedTo sets the AttachedTo field's value. +func (s *Explanation) SetAttachedTo(v *AnalysisComponent) *Explanation { + s.AttachedTo = v + return s +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *Explanation) SetAvailabilityZones(v []*string) *Explanation { + s.AvailabilityZones = v + return s +} + +// SetCidrs sets the Cidrs field's value. +func (s *Explanation) SetCidrs(v []*string) *Explanation { + s.Cidrs = v + return s +} + +// SetClassicLoadBalancerListener sets the ClassicLoadBalancerListener field's value. +func (s *Explanation) SetClassicLoadBalancerListener(v *AnalysisLoadBalancerListener) *Explanation { + s.ClassicLoadBalancerListener = v + return s +} + +// SetComponent sets the Component field's value. +func (s *Explanation) SetComponent(v *AnalysisComponent) *Explanation { + s.Component = v + return s +} + +// SetCustomerGateway sets the CustomerGateway field's value. +func (s *Explanation) SetCustomerGateway(v *AnalysisComponent) *Explanation { + s.CustomerGateway = v + return s +} + +// SetDestination sets the Destination field's value. +func (s *Explanation) SetDestination(v *AnalysisComponent) *Explanation { + s.Destination = v + return s +} + +// SetDestinationVpc sets the DestinationVpc field's value. +func (s *Explanation) SetDestinationVpc(v *AnalysisComponent) *Explanation { + s.DestinationVpc = v + return s +} + +// SetDirection sets the Direction field's value. +func (s *Explanation) SetDirection(v string) *Explanation { + s.Direction = &v + return s +} + +// SetElasticLoadBalancerListener sets the ElasticLoadBalancerListener field's value. +func (s *Explanation) SetElasticLoadBalancerListener(v *AnalysisComponent) *Explanation { + s.ElasticLoadBalancerListener = v + return s +} + +// SetExplanationCode sets the ExplanationCode field's value. +func (s *Explanation) SetExplanationCode(v string) *Explanation { + s.ExplanationCode = &v + return s +} + +// SetIngressRouteTable sets the IngressRouteTable field's value. +func (s *Explanation) SetIngressRouteTable(v *AnalysisComponent) *Explanation { + s.IngressRouteTable = v + return s +} + +// SetInternetGateway sets the InternetGateway field's value. +func (s *Explanation) SetInternetGateway(v *AnalysisComponent) *Explanation { + s.InternetGateway = v + return s +} + +// SetLoadBalancerArn sets the LoadBalancerArn field's value. +func (s *Explanation) SetLoadBalancerArn(v string) *Explanation { + s.LoadBalancerArn = &v + return s +} + +// SetLoadBalancerListenerPort sets the LoadBalancerListenerPort field's value. +func (s *Explanation) SetLoadBalancerListenerPort(v int64) *Explanation { + s.LoadBalancerListenerPort = &v + return s +} + +// SetLoadBalancerTarget sets the LoadBalancerTarget field's value. +func (s *Explanation) SetLoadBalancerTarget(v *AnalysisLoadBalancerTarget) *Explanation { + s.LoadBalancerTarget = v + return s +} + +// SetLoadBalancerTargetGroup sets the LoadBalancerTargetGroup field's value. +func (s *Explanation) SetLoadBalancerTargetGroup(v *AnalysisComponent) *Explanation { + s.LoadBalancerTargetGroup = v + return s +} + +// SetLoadBalancerTargetGroups sets the LoadBalancerTargetGroups field's value. +func (s *Explanation) SetLoadBalancerTargetGroups(v []*AnalysisComponent) *Explanation { + s.LoadBalancerTargetGroups = v + return s +} + +// SetLoadBalancerTargetPort sets the LoadBalancerTargetPort field's value. +func (s *Explanation) SetLoadBalancerTargetPort(v int64) *Explanation { + s.LoadBalancerTargetPort = &v + return s +} + +// SetMissingComponent sets the MissingComponent field's value. +func (s *Explanation) SetMissingComponent(v string) *Explanation { + s.MissingComponent = &v + return s +} + +// SetNatGateway sets the NatGateway field's value. +func (s *Explanation) SetNatGateway(v *AnalysisComponent) *Explanation { + s.NatGateway = v + return s +} + +// SetNetworkInterface sets the NetworkInterface field's value. +func (s *Explanation) SetNetworkInterface(v *AnalysisComponent) *Explanation { + s.NetworkInterface = v + return s +} + +// SetPacketField sets the PacketField field's value. +func (s *Explanation) SetPacketField(v string) *Explanation { + s.PacketField = &v + return s +} + +// SetPort sets the Port field's value. +func (s *Explanation) SetPort(v int64) *Explanation { + s.Port = &v + return s +} + +// SetPortRanges sets the PortRanges field's value. +func (s *Explanation) SetPortRanges(v []*PortRange) *Explanation { + s.PortRanges = v + return s +} + +// SetPrefixList sets the PrefixList field's value. +func (s *Explanation) SetPrefixList(v *AnalysisComponent) *Explanation { + s.PrefixList = v + return s +} + +// SetProtocols sets the Protocols field's value. +func (s *Explanation) SetProtocols(v []*string) *Explanation { + s.Protocols = v + return s +} + +// SetRouteTable sets the RouteTable field's value. +func (s *Explanation) SetRouteTable(v *AnalysisComponent) *Explanation { + s.RouteTable = v + return s +} + +// SetRouteTableRoute sets the RouteTableRoute field's value. +func (s *Explanation) SetRouteTableRoute(v *AnalysisRouteTableRoute) *Explanation { + s.RouteTableRoute = v + return s +} + +// SetSecurityGroup sets the SecurityGroup field's value. +func (s *Explanation) SetSecurityGroup(v *AnalysisComponent) *Explanation { + s.SecurityGroup = v + return s +} + +// SetSecurityGroupRule sets the SecurityGroupRule field's value. +func (s *Explanation) SetSecurityGroupRule(v *AnalysisSecurityGroupRule) *Explanation { + s.SecurityGroupRule = v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *Explanation) SetSecurityGroups(v []*AnalysisComponent) *Explanation { + s.SecurityGroups = v + return s +} + +// SetSourceVpc sets the SourceVpc field's value. +func (s *Explanation) SetSourceVpc(v *AnalysisComponent) *Explanation { + s.SourceVpc = v + return s +} + +// SetState sets the State field's value. +func (s *Explanation) SetState(v string) *Explanation { + s.State = &v + return s +} + +// SetSubnet sets the Subnet field's value. +func (s *Explanation) SetSubnet(v *AnalysisComponent) *Explanation { + s.Subnet = v + return s +} + +// SetSubnetRouteTable sets the SubnetRouteTable field's value. +func (s *Explanation) SetSubnetRouteTable(v *AnalysisComponent) *Explanation { + s.SubnetRouteTable = v + return s +} + +// SetVpc sets the Vpc field's value. +func (s *Explanation) SetVpc(v *AnalysisComponent) *Explanation { + s.Vpc = v + return s +} + +// SetVpcEndpoint sets the VpcEndpoint field's value. +func (s *Explanation) SetVpcEndpoint(v *AnalysisComponent) *Explanation { + s.VpcEndpoint = v + return s +} + +// SetVpcPeeringConnection sets the VpcPeeringConnection field's value. +func (s *Explanation) SetVpcPeeringConnection(v *AnalysisComponent) *Explanation { + s.VpcPeeringConnection = v + return s +} + +// SetVpnConnection sets the VpnConnection field's value. +func (s *Explanation) SetVpnConnection(v *AnalysisComponent) *Explanation { + s.VpnConnection = v + return s +} + +// SetVpnGateway sets the VpnGateway field's value. +func (s *Explanation) SetVpnGateway(v *AnalysisComponent) *Explanation { + s.VpnGateway = v + return s +} + type ExportClientVpnClientCertificateRevocationListInput struct { _ struct{} `type:"structure"` @@ -76977,7 +82903,7 @@ type ExportImageInput struct { // S3ExportLocation is a required field S3ExportLocation *ExportTaskS3LocationRequest `type:"structure" required:"true"` - // The tags to apply to the image being exported. + // The tags to apply to the export image task during creation. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } @@ -77095,7 +83021,7 @@ type ExportImageOutput struct { // The status message for the export image task. StatusMessage *string `locationName:"statusMessage" type:"string"` - // Any tags assigned to the image being exported. + // Any tags assigned to the export image task. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } @@ -77195,7 +83121,7 @@ type ExportImageTask struct { // The status message for the export image task. StatusMessage *string `locationName:"statusMessage" type:"string"` - // Any tags assigned to the image being exported. + // Any tags assigned to the export image task. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } @@ -77257,7 +83183,7 @@ func (s *ExportImageTask) SetTags(v []*Tag) *ExportImageTask { return s } -// Describes an instance export task. +// Describes an export instance task. type ExportTask struct { _ struct{} `type:"structure"` @@ -77416,7 +83342,7 @@ func (s *ExportTaskS3LocationRequest) SetS3Prefix(v string) *ExportTaskS3Locatio return s } -// Describes the format and location for an instance export task. +// Describes the format and location for the export task. type ExportToS3Task struct { _ struct{} `type:"structure"` @@ -77469,7 +83395,7 @@ func (s *ExportToS3Task) SetS3Key(v string) *ExportToS3Task { return s } -// Describes an instance export task. +// Describes an export instance task. type ExportToS3TaskSpecification struct { _ struct{} `type:"structure"` @@ -77746,29 +83672,7 @@ func (s *FederatedAuthenticationRequest) SetSelfServiceSAMLProviderArn(v string) // A filter name and value pair that is used to return a more specific list // of results from a describe operation. Filters can be used to match a set -// of resources by specific criteria, such as tags, attributes, or IDs. The -// filters supported by a describe operation are documented with the describe -// operation. For example: -// -// * DescribeAvailabilityZones -// -// * DescribeImages -// -// * DescribeInstances -// -// * DescribeKeyPairs -// -// * DescribeSecurityGroups -// -// * DescribeSnapshots -// -// * DescribeSubnets -// -// * DescribeTags -// -// * DescribeVolumes -// -// * DescribeVpcs +// of resources by specific criteria, such as tags, attributes, or IDs. type Filter struct { _ struct{} `type:"structure"` @@ -77853,7 +83757,10 @@ type FleetData struct { // The allocation strategy of On-Demand Instances in an EC2 Fleet. OnDemandOptions *OnDemandOptions `locationName:"onDemandOptions" type:"structure"` - // Indicates whether EC2 Fleet should replace unhealthy instances. + // Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported + // only for fleets of type maintain. For more information, see EC2 Fleet health + // checks (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks) + // in the Amazon EC2 User Guide. ReplaceUnhealthyInstances *bool `locationName:"replaceUnhealthyInstances" type:"boolean"` // The configuration of Spot Instances in an EC2 Fleet. @@ -78067,6 +83974,9 @@ type FleetLaunchTemplateConfigRequest struct { // Any parameters that you specify override the same parameters in the launch // template. + // + // For fleets of type request and maintain, a maximum of 300 items is allowed + // across all launch templates. Overrides []*FleetLaunchTemplateOverridesRequest `locationNameList:"item" type:"list"` } @@ -78123,12 +84033,21 @@ type FleetLaunchTemplateOverrides struct { // The location where the instance launched, if applicable. Placement *PlacementResponse `locationName:"placement" type:"structure"` - // The priority for the launch template override. If AllocationStrategy is set - // to prioritized, EC2 Fleet uses priority to determine which launch template - // override to use first in fulfilling On-Demand capacity. The highest priority - // is launched first. Valid values are whole numbers starting at 0. The lower - // the number, the higher the priority. If no number is set, the override has - // the lowest priority. + // The priority for the launch template override. The highest priority is launched + // first. + // + // If the On-Demand AllocationStrategy is set to prioritized, EC2 Fleet uses + // priority to determine which launch template override to use first in fulfilling + // On-Demand capacity. + // + // If the Spot AllocationStrategy is set to capacity-optimized-prioritized, + // EC2 Fleet uses priority on a best-effort basis to determine which launch + // template override to use in fulfilling Spot capacity, but optimizes for capacity + // first. + // + // Valid values are whole numbers starting at 0. The lower the number, the higher + // the priority. If no number is set, the override has the lowest priority. + // You can set the same priority for different launch template overrides. Priority *float64 `locationName:"priority" type:"double"` // The ID of the subnet in which to launch the instances. @@ -78206,12 +84125,21 @@ type FleetLaunchTemplateOverridesRequest struct { // The location where the instance launched, if applicable. Placement *Placement `type:"structure"` - // The priority for the launch template override. If AllocationStrategy is set - // to prioritized, EC2 Fleet uses priority to determine which launch template - // override to use first in fulfilling On-Demand capacity. The highest priority - // is launched first. Valid values are whole numbers starting at 0. The lower - // the number, the higher the priority. If no number is set, the launch template - // override has the lowest priority. + // The priority for the launch template override. The highest priority is launched + // first. + // + // If the On-Demand AllocationStrategy is set to prioritized, EC2 Fleet uses + // priority to determine which launch template override to use first in fulfilling + // On-Demand capacity. + // + // If the Spot AllocationStrategy is set to capacity-optimized-prioritized, + // EC2 Fleet uses priority on a best-effort basis to determine which launch + // template override to use in fulfilling Spot capacity, but optimizes for capacity + // first. + // + // Valid values are whole numbers starting at 0. The lower the number, the higher + // the priority. If no number is set, the launch template override has the lowest + // priority. You can set the same priority for different launch template overrides. Priority *float64 `type:"double"` // The IDs of the subnets in which to launch the instances. Separate multiple @@ -78347,7 +84275,7 @@ func (s *FleetLaunchTemplateSpecification) SetVersion(v string) *FleetLaunchTemp // that can be used by an EC2 Fleet to configure Amazon EC2 instances. For information // about launch templates, see Launching an instance from a launch template // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. type FleetLaunchTemplateSpecificationRequest struct { _ struct{} `type:"structure"` @@ -78421,9 +84349,8 @@ type FleetSpotCapacityRebalance struct { // specify launch. Only available for fleets of type maintain. // // When a replacement instance is launched, the instance marked for rebalance - // is not automatically terminated. You can terminate it, or you can wait until - // Amazon EC2 interrupts it. You are charged for both instances while they are - // running. + // is not automatically terminated. You can terminate it, or you can leave it + // running. You are charged for both instances while they are running. ReplacementStrategy *string `locationName:"replacementStrategy" type:"string" enum:"FleetReplacementStrategy"` } @@ -78446,7 +84373,7 @@ func (s *FleetSpotCapacityRebalance) SetReplacementStrategy(v string) *FleetSpot // The Spot Instance replacement strategy to use when Amazon EC2 emits a signal // that your Spot Instance is at an elevated risk of being interrupted. For // more information, see Capacity rebalancing (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-capacity-rebalance) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. type FleetSpotCapacityRebalanceRequest struct { _ struct{} `type:"structure"` @@ -78457,9 +84384,8 @@ type FleetSpotCapacityRebalanceRequest struct { // specify launch. You must specify a value, otherwise you get an error. // // When a replacement instance is launched, the instance marked for rebalance - // is not automatically terminated. You can terminate it, or you can wait until - // Amazon EC2 interrupts it. You are charged for all instances while they are - // running. + // is not automatically terminated. You can terminate it, or you can leave it + // running. You are charged for all instances while they are running. ReplacementStrategy *string `type:"string" enum:"FleetReplacementStrategy"` } @@ -79333,8 +85259,8 @@ type GetCapacityReservationUsageOutput struct { // and time specified in your request. The reserved capacity is no longer // available for your use. // - // * cancelled - The Capacity Reservation was manually cancelled. The reserved - // capacity is no longer available for your use. + // * cancelled - The Capacity Reservation was cancelled. The reserved capacity + // is no longer available for your use. // // * pending - The Capacity Reservation request was successful but the capacity // provisioning is still pending. @@ -79896,6 +85822,113 @@ func (s *GetEbsEncryptionByDefaultOutput) SetEbsEncryptionByDefault(v bool) *Get return s } +type GetFlowLogsIntegrationTemplateInput struct { + _ struct{} `type:"structure"` + + // To store the CloudFormation template in Amazon S3, specify the location in + // Amazon S3. + // + // ConfigDeliveryS3DestinationArn is a required field + ConfigDeliveryS3DestinationArn *string `type:"string" required:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the flow log. + // + // FlowLogId is a required field + FlowLogId *string `type:"string" required:"true"` + + // Information about the service integration. + // + // IntegrateServices is a required field + IntegrateServices *IntegrateServices `locationName:"IntegrateService" type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetFlowLogsIntegrationTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFlowLogsIntegrationTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetFlowLogsIntegrationTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetFlowLogsIntegrationTemplateInput"} + if s.ConfigDeliveryS3DestinationArn == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigDeliveryS3DestinationArn")) + } + if s.FlowLogId == nil { + invalidParams.Add(request.NewErrParamRequired("FlowLogId")) + } + if s.IntegrateServices == nil { + invalidParams.Add(request.NewErrParamRequired("IntegrateServices")) + } + if s.IntegrateServices != nil { + if err := s.IntegrateServices.Validate(); err != nil { + invalidParams.AddNested("IntegrateServices", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConfigDeliveryS3DestinationArn sets the ConfigDeliveryS3DestinationArn field's value. +func (s *GetFlowLogsIntegrationTemplateInput) SetConfigDeliveryS3DestinationArn(v string) *GetFlowLogsIntegrationTemplateInput { + s.ConfigDeliveryS3DestinationArn = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *GetFlowLogsIntegrationTemplateInput) SetDryRun(v bool) *GetFlowLogsIntegrationTemplateInput { + s.DryRun = &v + return s +} + +// SetFlowLogId sets the FlowLogId field's value. +func (s *GetFlowLogsIntegrationTemplateInput) SetFlowLogId(v string) *GetFlowLogsIntegrationTemplateInput { + s.FlowLogId = &v + return s +} + +// SetIntegrateServices sets the IntegrateServices field's value. +func (s *GetFlowLogsIntegrationTemplateInput) SetIntegrateServices(v *IntegrateServices) *GetFlowLogsIntegrationTemplateInput { + s.IntegrateServices = v + return s +} + +type GetFlowLogsIntegrationTemplateOutput struct { + _ struct{} `type:"structure"` + + // The generated CloudFormation template. + Result *string `locationName:"result" type:"string"` +} + +// String returns the string representation +func (s GetFlowLogsIntegrationTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFlowLogsIntegrationTemplateOutput) GoString() string { + return s.String() +} + +// SetResult sets the Result field's value. +func (s *GetFlowLogsIntegrationTemplateOutput) SetResult(v string) *GetFlowLogsIntegrationTemplateOutput { + s.Result = &v + return s +} + type GetGroupsForCapacityReservationInput struct { _ struct{} `type:"structure"` @@ -80660,6 +86693,57 @@ func (s *GetReservedInstancesExchangeQuoteOutput) SetValidationFailureReason(v s return s } +type GetSerialConsoleAccessStatusInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` +} + +// String returns the string representation +func (s GetSerialConsoleAccessStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSerialConsoleAccessStatusInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *GetSerialConsoleAccessStatusInput) SetDryRun(v bool) *GetSerialConsoleAccessStatusInput { + s.DryRun = &v + return s +} + +type GetSerialConsoleAccessStatusOutput struct { + _ struct{} `type:"structure"` + + // If true, access to the EC2 serial console of all instances is enabled for + // your account. If false, access to the EC2 serial console of all instances + // is disabled for your account. + SerialConsoleAccessEnabled *bool `locationName:"serialConsoleAccessEnabled" type:"boolean"` +} + +// String returns the string representation +func (s GetSerialConsoleAccessStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSerialConsoleAccessStatusOutput) GoString() string { + return s.String() +} + +// SetSerialConsoleAccessEnabled sets the SerialConsoleAccessEnabled field's value. +func (s *GetSerialConsoleAccessStatusOutput) SetSerialConsoleAccessEnabled(v bool) *GetSerialConsoleAccessStatusOutput { + s.SerialConsoleAccessEnabled = &v + return s +} + type GetTransitGatewayAttachmentPropagationsInput struct { _ struct{} `type:"structure"` @@ -81042,7 +87126,7 @@ type GetTransitGatewayRouteTableAssociationsInput struct { // * resource-id - The ID of the resource. // // * resource-type - The resource type. Valid values are vpc | vpn | direct-connect-gateway - // | peering. + // | peering | connect. // // * transit-gateway-attachment-id - The ID of the attachment. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -81163,7 +87247,7 @@ type GetTransitGatewayRouteTablePropagationsInput struct { // * resource-id - The ID of the resource. // // * resource-type - The resource type. Valid values are vpc | vpn | direct-connect-gateway - // | peering. + // | peering | connect. // // * transit-gateway-attachment-id - The ID of the attachment. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -81415,7 +87499,7 @@ func (s *GroupIdentifier) SetGroupName(v string) *GroupIdentifier { // Indicates whether your instance is configured for hibernation. This parameter // is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). // For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. type HibernationOptions struct { _ struct{} `type:"structure"` @@ -81443,7 +87527,7 @@ func (s *HibernationOptions) SetConfigured(v bool) *HibernationOptions { // Indicates whether your instance is configured for hibernation. This parameter // is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). // For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) -// in the Amazon Elastic Compute Cloud User Guide. +// in the Amazon EC2 User Guide. type HibernationOptionsRequest struct { _ struct{} `type:"structure"` @@ -81570,10 +87654,9 @@ type Host struct { AllocationTime *time.Time `locationName:"allocationTime" type:"timestamp"` // Indicates whether the Dedicated Host supports multiple instance types of - // the same instance family, or a specific instance type only. one indicates - // that the Dedicated Host supports multiple instance types in the instance - // family. off indicates that the Dedicated Host supports a single instance - // type only. + // the same instance family. If the value is on, the Dedicated Host supports + // multiple instance types in the instance family. If the value is off, the + // Dedicated Host supports a single instance type only. AllowsMultipleInstanceTypes *string `locationName:"allowsMultipleInstanceTypes" type:"string" enum:"AllowsMultipleInstanceTypes"` // Whether auto-placement is on or off. @@ -81589,7 +87672,7 @@ type Host struct { AvailableCapacity *AvailableCapacity `locationName:"availableCapacity" type:"structure"` // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `locationName:"clientToken" type:"string"` // The ID of the Dedicated Host. @@ -82326,6 +88409,10 @@ type Image struct { // Any block device mapping entries. BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` + // The boot mode of the image. For more information, see Boot modes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) + // in the Amazon Elastic Compute Cloud User Guide. + BootMode *string `locationName:"bootMode" type:"string" enum:"BootModeValues"` + // The date and time the image was created. CreationDate *string `locationName:"creationDate" type:"string"` @@ -82436,6 +88523,12 @@ func (s *Image) SetBlockDeviceMappings(v []*BlockDeviceMapping) *Image { return s } +// SetBootMode sets the BootMode field's value. +func (s *Image) SetBootMode(v string) *Image { + s.BootMode = &v + return s +} + // SetCreationDate sets the CreationDate field's value. func (s *Image) SetCreationDate(v string) *Image { s.CreationDate = &v @@ -82592,7 +88685,7 @@ type ImageDiskContainer struct { // The format of the disk image being imported. // - // Valid values: OVA | VHD | VHDX |VMDK + // Valid values: OVA | VHD | VHDX | VMDK | RAW Format *string `type:"string"` // The ID of the EBS snapshot to be used for importing the snapshot. @@ -82835,7 +88928,7 @@ type ImportImageInput struct { // The name of the role to use when not using the default role, 'vmimport'. RoleName *string `type:"string"` - // The tags to apply to the image being imported. + // The tags to apply to the import image task during creation. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } @@ -83027,7 +89120,7 @@ type ImportImageOutput struct { // A detailed status message of the import task. StatusMessage *string `locationName:"statusMessage" type:"string"` - // Any tags assigned to the image being imported. + // Any tags assigned to the import image task. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } @@ -83832,7 +89925,7 @@ type ImportSnapshotInput struct { // The name of the role to use when not using the default role, 'vmimport'. RoleName *string `type:"string"` - // The tags to apply to the snapshot being imported. + // The tags to apply to the import snapshot task during creation. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } @@ -83912,7 +90005,7 @@ type ImportSnapshotOutput struct { // Information about the import snapshot task. SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` - // Any tags assigned to the snapshot being imported. + // Any tags assigned to the import snapshot task. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } @@ -84261,6 +90354,10 @@ type Instance struct { // Any block device mapping entries for the instance. BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` + // The boot mode of the instance. For more information, see Boot modes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) + // in the Amazon EC2 User Guide. + BootMode *string `locationName:"bootMode" type:"string" enum:"BootModeValues"` + // The ID of the Capacity Reservation. CapacityReservationId *string `locationName:"capacityReservationId" type:"string"` @@ -84386,12 +90483,7 @@ type Instance struct { // The security groups for the instance. SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - // Specifies whether to enable an instance launched in a VPC to perform NAT. - // This controls whether source/destination checking is enabled on the instance. - // A value of true means that checking is enabled, and false means that checking - // is disabled. The value must be false for the instance to perform NAT. For - // more information, see NAT Instances (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) - // in the Amazon Virtual Private Cloud User Guide. + // Indicates whether source/destination checking is enabled. SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` // If the request is a Spot Instance request, the ID of the request. @@ -84451,6 +90543,12 @@ func (s *Instance) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *Inst return s } +// SetBootMode sets the BootMode field's value. +func (s *Instance) SetBootMode(v string) *Instance { + s.BootMode = &v + return s +} + // SetCapacityReservationId sets the CapacityReservationId field's value. func (s *Instance) SetCapacityReservationId(v string) *Instance { s.CapacityReservationId = &v @@ -85318,7 +91416,7 @@ type InstanceNetworkInterface struct { // One or more private IPv4 addresses associated with the network interface. PrivateIpAddresses []*InstancePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` - // Indicates whether to validate network traffic to or from this network interface. + // Indicates whether source/destination checking is enabled. SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` // The status of the network interface. @@ -86295,8 +92393,8 @@ type InstanceTypeInfo struct { // Indicates whether instance storage is supported. InstanceStorageSupported *bool `locationName:"instanceStorageSupported" type:"boolean"` - // The instance type. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. + // The instance type. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon EC2 User Guide. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // Describes the memory for the instance type. @@ -86311,6 +92409,10 @@ type InstanceTypeInfo struct { // Describes the processor. ProcessorInfo *ProcessorInfo `locationName:"processorInfo" type:"structure"` + // The supported boot modes. For more information, see Boot modes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) + // in the Amazon EC2 User Guide. + SupportedBootModes []*string `locationName:"supportedBootModes" locationNameList:"item" type:"list"` + // The supported root device types. SupportedRootDeviceTypes []*string `locationName:"supportedRootDeviceTypes" locationNameList:"item" type:"list"` @@ -86448,6 +92550,12 @@ func (s *InstanceTypeInfo) SetProcessorInfo(v *ProcessorInfo) *InstanceTypeInfo return s } +// SetSupportedBootModes sets the SupportedBootModes field's value. +func (s *InstanceTypeInfo) SetSupportedBootModes(v []*string) *InstanceTypeInfo { + s.SupportedBootModes = v + return s +} + // SetSupportedRootDeviceTypes sets the SupportedRootDeviceTypes field's value. func (s *InstanceTypeInfo) SetSupportedRootDeviceTypes(v []*string) *InstanceTypeInfo { s.SupportedRootDeviceTypes = v @@ -86476,8 +92584,8 @@ func (s *InstanceTypeInfo) SetVCpuInfo(v *VCpuInfo) *InstanceTypeInfo { type InstanceTypeOffering struct { _ struct{} `type:"structure"` - // The instance type. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. + // The instance type. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon EC2 User Guide. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // The identifier for the location. This depends on the location type. For example, @@ -86550,6 +92658,53 @@ func (s *InstanceUsage) SetUsedInstanceCount(v int64) *InstanceUsage { return s } +// Describes service integrations with VPC Flow logs. +type IntegrateServices struct { + _ struct{} `type:"structure"` + + // Information about the integration with Amazon Athena. + AthenaIntegrations []*AthenaIntegration `locationName:"AthenaIntegration" locationNameList:"item" min:"1" type:"list"` +} + +// String returns the string representation +func (s IntegrateServices) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IntegrateServices) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *IntegrateServices) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "IntegrateServices"} + if s.AthenaIntegrations != nil && len(s.AthenaIntegrations) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AthenaIntegrations", 1)) + } + if s.AthenaIntegrations != nil { + for i, v := range s.AthenaIntegrations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AthenaIntegrations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAthenaIntegrations sets the AthenaIntegrations field's value. +func (s *IntegrateServices) SetAthenaIntegrations(v []*AthenaIntegration) *IntegrateServices { + s.AthenaIntegrations = v + return s +} + // Describes an internet gateway. type InternetGateway struct { _ struct{} `type:"structure"` @@ -87005,6 +93160,8 @@ type LaunchPermission struct { Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` // The AWS account ID. + // + // Constraints: Up to 10 000 account IDs can be specified in a single request. UserId *string `locationName:"userId" type:"string"` } @@ -87345,8 +93502,7 @@ type LaunchTemplateBlockDeviceMapping struct { // Information about the block device for an EBS volume. Ebs *LaunchTemplateEbsBlockDevice `locationName:"ebs" type:"structure"` - // Suppresses the specified device included in the block device mapping of the - // AMI. + // To omit the device from the block device mapping, specify an empty string. NoDevice *string `locationName:"noDevice" type:"string"` // The virtual device name (ephemeralN). @@ -87398,8 +93554,7 @@ type LaunchTemplateBlockDeviceMappingRequest struct { // launched. Ebs *LaunchTemplateEbsBlockDeviceRequest `type:"structure"` - // Suppresses the specified device included in the block device mapping of the - // AMI. + // To omit the device from the block device mapping, specify an empty string. NoDevice *string `type:"string"` // The virtual device name (ephemeralN). Instance store volumes are numbered @@ -87667,6 +93822,9 @@ type LaunchTemplateEbsBlockDevice struct { // The ID of the snapshot. SnapshotId *string `locationName:"snapshotId" type:"string"` + // The throughput that the volume supports, in MiB/s. + Throughput *int64 `locationName:"throughput" type:"integer"` + // The size of the volume, in GiB. VolumeSize *int64 `locationName:"volumeSize" type:"integer"` @@ -87714,6 +93872,12 @@ func (s *LaunchTemplateEbsBlockDevice) SetSnapshotId(v string) *LaunchTemplateEb return s } +// SetThroughput sets the Throughput field's value. +func (s *LaunchTemplateEbsBlockDevice) SetThroughput(v int64) *LaunchTemplateEbsBlockDevice { + s.Throughput = &v + return s +} + // SetVolumeSize sets the VolumeSize field's value. func (s *LaunchTemplateEbsBlockDevice) SetVolumeSize(v int64) *LaunchTemplateEbsBlockDevice { s.VolumeSize = &v @@ -87738,15 +93902,25 @@ type LaunchTemplateEbsBlockDeviceRequest struct { // a volume from a snapshot, you can't specify an encryption value. Encrypted *bool `type:"boolean"` - // The number of I/O operations per second (IOPS) to provision for an io1 or - // io2 volume, with a maximum ratio of 50 IOPS/GiB for io1, and 500 IOPS/GiB - // for io2. Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum - // IOPS of 64,000 is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). - // Other instance families guarantee performance up to 32,000 IOPS. For more - // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. + // The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes, + // this represents the number of IOPS that are provisioned for the volume. For + // gp2 volumes, this represents the baseline performance of the volume and the + // rate at which the volume accumulates I/O credits for bursting. // - // This parameter is valid only for Provisioned IOPS SSD (io1 and io2) volumes. + // The following are the supported values for each volume type: + // + // * gp3: 3,000-16,000 IOPS + // + // * io1: 100-64,000 IOPS + // + // * io2: 100-64,000 IOPS + // + // For io1 and io2 volumes, we guarantee 64,000 IOPS only for Instances built + // on the Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Other instance families guarantee performance up to 32,000 IOPS. + // + // This parameter is supported for io1, io2, and gp3 volumes only. This parameter + // is not supported for gp2, st1, sc1, or standard volumes. Iops *int64 `type:"integer"` // The ARN of the symmetric AWS Key Management Service (AWS KMS) CMK used for @@ -87756,13 +93930,26 @@ type LaunchTemplateEbsBlockDeviceRequest struct { // The ID of the snapshot. SnapshotId *string `type:"string"` - // The size of the volume, in GiB. + // The throughput to provision for a gp3 volume, with a maximum of 1,000 MiB/s. // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. + // Valid Range: Minimum value of 125. Maximum value of 1000. + Throughput *int64 `type:"integer"` + + // The size of the volume, in GiBs. You must specify either a snapshot ID or + // a volume size. The following are the supported volumes sizes for each volume + // type: + // + // * gp2 and gp3: 1-16,384 + // + // * io1 and io2: 4-16,384 + // + // * st1 and sc1: 125-16,384 + // + // * standard: 1-1,024 VolumeSize *int64 `type:"integer"` - // The volume type. + // The volume type. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // in the Amazon Elastic Compute Cloud User Guide. VolumeType *string `type:"string" enum:"VolumeType"` } @@ -87806,6 +93993,12 @@ func (s *LaunchTemplateEbsBlockDeviceRequest) SetSnapshotId(v string) *LaunchTem return s } +// SetThroughput sets the Throughput field's value. +func (s *LaunchTemplateEbsBlockDeviceRequest) SetThroughput(v int64) *LaunchTemplateEbsBlockDeviceRequest { + s.Throughput = &v + return s +} + // SetVolumeSize sets the VolumeSize field's value. func (s *LaunchTemplateEbsBlockDeviceRequest) SetVolumeSize(v int64) *LaunchTemplateEbsBlockDeviceRequest { s.VolumeSize = &v @@ -88668,12 +94861,20 @@ type LaunchTemplateOverrides struct { // The instance type. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - // The priority for the launch template override. If OnDemandAllocationStrategy - // is set to prioritized, Spot Fleet uses priority to determine which launch - // template override to use first in fulfilling On-Demand capacity. The highest - // priority is launched first. Valid values are whole numbers starting at 0. - // The lower the number, the higher the priority. If no number is set, the launch - // template override has the lowest priority. + // The priority for the launch template override. The highest priority is launched + // first. + // + // If OnDemandAllocationStrategy is set to prioritized, Spot Fleet uses priority + // to determine which launch template override to use first in fulfilling On-Demand + // capacity. + // + // If the Spot AllocationStrategy is set to capacityOptimizedPrioritized, Spot + // Fleet uses priority on a best-effort basis to determine which launch template + // override to use in fulfilling Spot capacity, but optimizes for capacity first. + // + // Valid values are whole numbers starting at 0. The lower the number, the higher + // the priority. If no number is set, the launch template override has the lowest + // priority. You can set the same priority for different launch template overrides. Priority *float64 `locationName:"priority" type:"double"` // The maximum price per unit hour that you are willing to pay for a Spot Instance. @@ -90172,6 +96373,88 @@ func (s *MemoryInfo) SetSizeInMiB(v int64) *MemoryInfo { return s } +type ModifyAddressAttributeInput struct { + _ struct{} `type:"structure"` + + // [EC2-VPC] The allocation ID. + // + // AllocationId is a required field + AllocationId *string `type:"string" required:"true"` + + // The domain name to modify for the IP address. + DomainName *string `type:"string"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` +} + +// String returns the string representation +func (s ModifyAddressAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyAddressAttributeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyAddressAttributeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyAddressAttributeInput"} + if s.AllocationId == nil { + invalidParams.Add(request.NewErrParamRequired("AllocationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAllocationId sets the AllocationId field's value. +func (s *ModifyAddressAttributeInput) SetAllocationId(v string) *ModifyAddressAttributeInput { + s.AllocationId = &v + return s +} + +// SetDomainName sets the DomainName field's value. +func (s *ModifyAddressAttributeInput) SetDomainName(v string) *ModifyAddressAttributeInput { + s.DomainName = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *ModifyAddressAttributeInput) SetDryRun(v bool) *ModifyAddressAttributeInput { + s.DryRun = &v + return s +} + +type ModifyAddressAttributeOutput struct { + _ struct{} `type:"structure"` + + // Information about the Elastic IP address. + Address *AddressAttribute `locationName:"address" type:"structure"` +} + +// String returns the string representation +func (s ModifyAddressAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyAddressAttributeOutput) GoString() string { + return s.String() +} + +// SetAddress sets the Address field's value. +func (s *ModifyAddressAttributeOutput) SetAddress(v *AddressAttribute) *ModifyAddressAttributeOutput { + s.Address = v + return s +} + type ModifyAvailabilityZoneGroupInput struct { _ struct{} `type:"structure"` @@ -90266,6 +96549,9 @@ func (s *ModifyAvailabilityZoneGroupOutput) SetReturn(v bool) *ModifyAvailabilit type ModifyCapacityReservationInput struct { _ struct{} `type:"structure"` + // Reserved. Capacity Reservations you have created are accepted by default. + Accept *bool `type:"boolean"` + // The ID of the Capacity Reservation. // // CapacityReservationId is a required field @@ -90327,6 +96613,12 @@ func (s *ModifyCapacityReservationInput) Validate() error { return nil } +// SetAccept sets the Accept field's value. +func (s *ModifyCapacityReservationInput) SetAccept(v bool) *ModifyCapacityReservationInput { + s.Accept = &v + return s +} + // SetCapacityReservationId sets the CapacityReservationId field's value. func (s *ModifyCapacityReservationInput) SetCapacityReservationId(v string) *ModifyCapacityReservationInput { s.CapacityReservationId = &v @@ -91022,8 +97314,8 @@ type ModifyHostsInput struct { HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list" required:"true"` // Indicates whether to enable or disable host recovery for the Dedicated Host. - // For more information, see Host Recovery (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html) - // in the Amazon Elastic Compute Cloud User Guide. + // For more information, see Host recovery (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html) + // in the Amazon EC2 User Guide. HostRecovery *string `type:"string" enum:"HostRecovery"` // Specifies the instance family to be supported by the Dedicated Host. Specify @@ -91454,7 +97746,7 @@ type ModifyInstanceAttributeInput struct { // To add instance store volumes to an Amazon EBS-backed instance, you must // add them when you launch the instance. For more information, see Updating // the block device mapping when launching an instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. BlockDeviceMappings []*InstanceBlockDeviceMappingSpecification `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` // If the value is true, you can't terminate the instance using the Amazon EC2 @@ -91481,9 +97773,10 @@ type ModifyInstanceAttributeInput struct { // a PV instance can make it unreachable. EnaSupport *AttributeBooleanValue `locationName:"enaSupport" type:"structure"` - // [EC2-VPC] Changes the security groups of the instance. You must specify at - // least one security group, even if it's just the default security group for - // the VPC. You must specify the security group ID, not the security group name. + // [EC2-VPC] Replaces the security groups of the instance with the specified + // security groups. You must specify at least one security group, even if it's + // just the default security group for the VPC. You must specify the security + // group ID, not the security group name. Groups []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` // The ID of the instance. @@ -91496,8 +97789,9 @@ type ModifyInstanceAttributeInput struct { InstanceInitiatedShutdownBehavior *AttributeValue `locationName:"instanceInitiatedShutdownBehavior" type:"structure"` // Changes the instance type to the specified value. For more information, see - // Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). - // If the instance type is not valid, the error returned is InvalidInstanceAttributeValue. + // Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon EC2 User Guide. If the instance type is not valid, the error + // returned is InvalidInstanceAttributeValue. InstanceType *AttributeValue `locationName:"instanceType" type:"structure"` // Changes the instance's kernel to the specified value. We recommend that you @@ -91510,9 +97804,12 @@ type ModifyInstanceAttributeInput struct { // PV-GRUB (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html). Ramdisk *AttributeValue `locationName:"ramdisk" type:"structure"` - // Specifies whether source/destination checking is enabled. A value of true - // means that checking is enabled, and false means that checking is disabled. - // This value must be false for a NAT instance to perform NAT. + // Enable or disable source/destination checks, which ensure that the instance + // is either the source or the destination of any traffic that it receives. + // If the value is true, source/destination checks are enabled; otherwise, they + // are disabled. The default value is true. You must disable source/destination + // checks if the instance runs services such as network address translation, + // routing, or firewalls. SourceDestCheck *AttributeBooleanValue `type:"structure"` // Set to simple to enable enhanced networking with the Intel 82599 Virtual @@ -92461,11 +98758,12 @@ type ModifyNetworkInterfaceAttributeInput struct { // NetworkInterfaceId is a required field NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` - // Indicates whether source/destination checking is enabled. A value of true - // means checking is enabled, and false means checking is disabled. This value - // must be false for a NAT instance to perform NAT. For more information, see - // NAT Instances (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) - // in the Amazon Virtual Private Cloud User Guide. + // Enable or disable source/destination checks, which ensure that the instance + // is either the source or the destination of any traffic that it receives. + // If the value is true, source/destination checks are enabled; otherwise, they + // are disabled. The default value is true. You must disable source/destination + // checks if the instance runs services such as network address translation, + // routing, or firewalls. SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` } @@ -93434,6 +99732,10 @@ func (s *ModifyTransitGatewayInput) SetTransitGatewayId(v string) *ModifyTransit type ModifyTransitGatewayOptions struct { _ struct{} `type:"structure"` + // Adds IPv4 or IPv6 CIDR blocks for the transit gateway. Must be a size /24 + // CIDR block or larger for IPv4, or a size /64 CIDR block or larger for IPv6. + AddTransitGatewayCidrBlocks []*string `locationNameList:"item" type:"list"` + // The ID of the default association route table. AssociationDefaultRouteTableId *string `type:"string"` @@ -93454,6 +99756,9 @@ type ModifyTransitGatewayOptions struct { // The ID of the default propagation route table. PropagationDefaultRouteTableId *string `type:"string"` + // Removes CIDR blocks for the transit gateway. + RemoveTransitGatewayCidrBlocks []*string `locationNameList:"item" type:"list"` + // Enable or disable Equal Cost Multipath Protocol support. VpnEcmpSupport *string `type:"string" enum:"VpnEcmpSupportValue"` } @@ -93468,6 +99773,12 @@ func (s ModifyTransitGatewayOptions) GoString() string { return s.String() } +// SetAddTransitGatewayCidrBlocks sets the AddTransitGatewayCidrBlocks field's value. +func (s *ModifyTransitGatewayOptions) SetAddTransitGatewayCidrBlocks(v []*string) *ModifyTransitGatewayOptions { + s.AddTransitGatewayCidrBlocks = v + return s +} + // SetAssociationDefaultRouteTableId sets the AssociationDefaultRouteTableId field's value. func (s *ModifyTransitGatewayOptions) SetAssociationDefaultRouteTableId(v string) *ModifyTransitGatewayOptions { s.AssociationDefaultRouteTableId = &v @@ -93504,6 +99815,12 @@ func (s *ModifyTransitGatewayOptions) SetPropagationDefaultRouteTableId(v string return s } +// SetRemoveTransitGatewayCidrBlocks sets the RemoveTransitGatewayCidrBlocks field's value. +func (s *ModifyTransitGatewayOptions) SetRemoveTransitGatewayCidrBlocks(v []*string) *ModifyTransitGatewayOptions { + s.RemoveTransitGatewayCidrBlocks = v + return s +} + // SetVpnEcmpSupport sets the VpnEcmpSupport field's value. func (s *ModifyTransitGatewayOptions) SetVpnEcmpSupport(v string) *ModifyTransitGatewayOptions { s.VpnEcmpSupport = &v @@ -93867,27 +100184,60 @@ type ModifyVolumeInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The target IOPS rate of the volume. + // The target IOPS rate of the volume. This parameter is valid only for gp3, + // io1, and io2 volumes. + // + // The following are the supported values for each volume type: // - // This is only valid for Provisioned IOPS SSD (io1 and io2) volumes. For moreinformation, - // see Provisioned IOPS SSD (io1 and io2) volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops). + // * gp3: 3,000-16,000 IOPS // - // Default: If no IOPS value is specified, the existing value is retained. + // * io1: 100-64,000 IOPS + // + // * io2: 100-64,000 IOPS + // + // Default: If no IOPS value is specified, the existing value is retained, unless + // a volume type is modified that supports different values. Iops *int64 `type:"integer"` + // Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, + // you can attach the volume to up to 16 Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) + // in the same Availability Zone. This parameter is supported with io1 and io2 + // volumes only. For more information, see Amazon EBS Multi-Attach (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html) + // in the Amazon Elastic Compute Cloud User Guide. + MultiAttachEnabled *bool `type:"boolean"` + // The target size of the volume, in GiB. The target volume size must be greater - // than or equal to than the existing size of the volume. For information about - // available EBS volume sizes, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html). + // than or equal to the existing size of the volume. + // + // The following are the supported volumes sizes for each volume type: + // + // * gp2 and gp3: 1-16,384 + // + // * io1 and io2: 4-16,384 + // + // * st1 and sc1: 125-16,384 + // + // * standard: 1-1,024 // // Default: If no size is specified, the existing size is retained. Size *int64 `type:"integer"` + // The target throughput of the volume, in MiB/s. This parameter is valid only + // for gp3 volumes. The maximum value is 1,000. + // + // Default: If no throughput value is specified, the existing value is retained. + // + // Valid Range: Minimum value of 125. Maximum value of 1000. + Throughput *int64 `type:"integer"` + // The ID of the volume. // // VolumeId is a required field VolumeId *string `type:"string" required:"true"` - // The target EBS volume type of the volume. + // The target EBS volume type of the volume. For more information, see Amazon + // EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // in the Amazon Elastic Compute Cloud User Guide. // // Default: If no type is specified, the existing type is retained. VolumeType *string `type:"string" enum:"VolumeType"` @@ -93928,12 +100278,24 @@ func (s *ModifyVolumeInput) SetIops(v int64) *ModifyVolumeInput { return s } +// SetMultiAttachEnabled sets the MultiAttachEnabled field's value. +func (s *ModifyVolumeInput) SetMultiAttachEnabled(v bool) *ModifyVolumeInput { + s.MultiAttachEnabled = &v + return s +} + // SetSize sets the Size field's value. func (s *ModifyVolumeInput) SetSize(v int64) *ModifyVolumeInput { s.Size = &v return s } +// SetThroughput sets the Throughput field's value. +func (s *ModifyVolumeInput) SetThroughput(v int64) *ModifyVolumeInput { + s.Throughput = &v + return s +} + // SetVolumeId sets the VolumeId field's value. func (s *ModifyVolumeInput) SetVolumeId(v string) *ModifyVolumeInput { s.VolumeId = &v @@ -94154,7 +100516,9 @@ type ModifyVpcEndpointInput struct { // network interface. AddSecurityGroupIds []*string `locationName:"AddSecurityGroupId" locationNameList:"item" type:"list"` - // (Interface endpoint) One or more subnet IDs in which to serve the endpoint. + // (Interface and Gateway Load Balancer endpoints) One or more subnet IDs in + // which to serve the endpoint. For a Gateway Load Balancer endpoint, you can + // specify only one subnet. AddSubnetIds []*string `locationName:"AddSubnetId" locationNameList:"item" type:"list"` // Checks whether you have the required permissions for the action, without @@ -94163,8 +100527,8 @@ type ModifyVpcEndpointInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // A policy to attach to the endpoint that controls access to the service. The - // policy must be in valid JSON format. + // (Interface and gateway endpoints) A policy to attach to the endpoint that + // controls access to the service. The policy must be in valid JSON format. PolicyDocument *string `type:"string"` // (Interface endpoint) Indicates whether a private hosted zone is associated @@ -94310,6 +100674,10 @@ type ModifyVpcEndpointServiceConfigurationInput struct { // accepted. AcceptanceRequired *bool `type:"boolean"` + // The Amazon Resource Names (ARNs) of Gateway Load Balancers to add to your + // service configuration. + AddGatewayLoadBalancerArns []*string `locationName:"AddGatewayLoadBalancerArn" locationNameList:"item" type:"list"` + // The Amazon Resource Names (ARNs) of Network Load Balancers to add to your // service configuration. AddNetworkLoadBalancerArns []*string `locationName:"AddNetworkLoadBalancerArn" locationNameList:"item" type:"list"` @@ -94320,14 +100688,20 @@ type ModifyVpcEndpointServiceConfigurationInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The private DNS name to assign to the endpoint service. + // (Interface endpoint configuration) The private DNS name to assign to the + // endpoint service. PrivateDnsName *string `type:"string"` + // The Amazon Resource Names (ARNs) of Gateway Load Balancers to remove from + // your service configuration. + RemoveGatewayLoadBalancerArns []*string `locationName:"RemoveGatewayLoadBalancerArn" locationNameList:"item" type:"list"` + // The Amazon Resource Names (ARNs) of Network Load Balancers to remove from // your service configuration. RemoveNetworkLoadBalancerArns []*string `locationName:"RemoveNetworkLoadBalancerArn" locationNameList:"item" type:"list"` - // Removes the private DNS name of the endpoint service. + // (Interface endpoint configuration) Removes the private DNS name of the endpoint + // service. RemovePrivateDnsName *bool `type:"boolean"` // The ID of the service. @@ -94365,6 +100739,12 @@ func (s *ModifyVpcEndpointServiceConfigurationInput) SetAcceptanceRequired(v boo return s } +// SetAddGatewayLoadBalancerArns sets the AddGatewayLoadBalancerArns field's value. +func (s *ModifyVpcEndpointServiceConfigurationInput) SetAddGatewayLoadBalancerArns(v []*string) *ModifyVpcEndpointServiceConfigurationInput { + s.AddGatewayLoadBalancerArns = v + return s +} + // SetAddNetworkLoadBalancerArns sets the AddNetworkLoadBalancerArns field's value. func (s *ModifyVpcEndpointServiceConfigurationInput) SetAddNetworkLoadBalancerArns(v []*string) *ModifyVpcEndpointServiceConfigurationInput { s.AddNetworkLoadBalancerArns = v @@ -94383,6 +100763,12 @@ func (s *ModifyVpcEndpointServiceConfigurationInput) SetPrivateDnsName(v string) return s } +// SetRemoveGatewayLoadBalancerArns sets the RemoveGatewayLoadBalancerArns field's value. +func (s *ModifyVpcEndpointServiceConfigurationInput) SetRemoveGatewayLoadBalancerArns(v []*string) *ModifyVpcEndpointServiceConfigurationInput { + s.RemoveGatewayLoadBalancerArns = v + return s +} + // SetRemoveNetworkLoadBalancerArns sets the RemoveNetworkLoadBalancerArns field's value. func (s *ModifyVpcEndpointServiceConfigurationInput) SetRemoveNetworkLoadBalancerArns(v []*string) *ModifyVpcEndpointServiceConfigurationInput { s.RemoveNetworkLoadBalancerArns = v @@ -96051,6 +102437,9 @@ type NetworkInfo struct { // The index of the default network card, starting at 0. DefaultNetworkCardIndex *int64 `locationName:"defaultNetworkCardIndex" type:"integer"` + // Describes the Elastic Fabric Adapters for the instance type. + EfaInfo *EfaInfo `locationName:"efaInfo" type:"structure"` + // Indicates whether Elastic Fabric Adapter (EFA) is supported. EfaSupported *bool `locationName:"efaSupported" type:"boolean"` @@ -96096,6 +102485,12 @@ func (s *NetworkInfo) SetDefaultNetworkCardIndex(v int64) *NetworkInfo { return s } +// SetEfaInfo sets the EfaInfo field's value. +func (s *NetworkInfo) SetEfaInfo(v *EfaInfo) *NetworkInfo { + s.EfaInfo = v + return s +} + // SetEfaSupported sets the EfaSupported field's value. func (s *NetworkInfo) SetEfaSupported(v bool) *NetworkInfo { s.EfaSupported = &v @@ -96150,6 +102545,244 @@ func (s *NetworkInfo) SetNetworkPerformance(v string) *NetworkInfo { return s } +// Describes a network insights analysis. +type NetworkInsightsAnalysis struct { + _ struct{} `type:"structure"` + + // Potential intermediate components. + AlternatePathHints []*AlternatePathHint `locationName:"alternatePathHintSet" locationNameList:"item" type:"list"` + + // The explanations. For more information, see Reachability Analyzer explanation + // codes (https://docs.aws.amazon.com/vpc/latest/reachability/explanation-codes.html). + Explanations []*Explanation `locationName:"explanationSet" locationNameList:"item" type:"list"` + + // The Amazon Resource Names (ARN) of the AWS resources that the path must traverse. + FilterInArns []*string `locationName:"filterInArnSet" locationNameList:"item" type:"list"` + + // The components in the path from source to destination. + ForwardPathComponents []*PathComponent `locationName:"forwardPathComponentSet" locationNameList:"item" type:"list"` + + // The Amazon Resource Name (ARN) of the network insights analysis. + NetworkInsightsAnalysisArn *string `locationName:"networkInsightsAnalysisArn" min:"1" type:"string"` + + // The ID of the network insights analysis. + NetworkInsightsAnalysisId *string `locationName:"networkInsightsAnalysisId" type:"string"` + + // The ID of the path. + NetworkInsightsPathId *string `locationName:"networkInsightsPathId" type:"string"` + + // Indicates whether the destination is reachable from the source. + NetworkPathFound *bool `locationName:"networkPathFound" type:"boolean"` + + // The components in the path from destination to source. + ReturnPathComponents []*PathComponent `locationName:"returnPathComponentSet" locationNameList:"item" type:"list"` + + // The time the analysis started. + StartDate *time.Time `locationName:"startDate" type:"timestamp"` + + // The status of the network insights analysis. + Status *string `locationName:"status" type:"string" enum:"AnalysisStatus"` + + // The status message, if the status is failed. + StatusMessage *string `locationName:"statusMessage" type:"string"` + + // The tags. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s NetworkInsightsAnalysis) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkInsightsAnalysis) GoString() string { + return s.String() +} + +// SetAlternatePathHints sets the AlternatePathHints field's value. +func (s *NetworkInsightsAnalysis) SetAlternatePathHints(v []*AlternatePathHint) *NetworkInsightsAnalysis { + s.AlternatePathHints = v + return s +} + +// SetExplanations sets the Explanations field's value. +func (s *NetworkInsightsAnalysis) SetExplanations(v []*Explanation) *NetworkInsightsAnalysis { + s.Explanations = v + return s +} + +// SetFilterInArns sets the FilterInArns field's value. +func (s *NetworkInsightsAnalysis) SetFilterInArns(v []*string) *NetworkInsightsAnalysis { + s.FilterInArns = v + return s +} + +// SetForwardPathComponents sets the ForwardPathComponents field's value. +func (s *NetworkInsightsAnalysis) SetForwardPathComponents(v []*PathComponent) *NetworkInsightsAnalysis { + s.ForwardPathComponents = v + return s +} + +// SetNetworkInsightsAnalysisArn sets the NetworkInsightsAnalysisArn field's value. +func (s *NetworkInsightsAnalysis) SetNetworkInsightsAnalysisArn(v string) *NetworkInsightsAnalysis { + s.NetworkInsightsAnalysisArn = &v + return s +} + +// SetNetworkInsightsAnalysisId sets the NetworkInsightsAnalysisId field's value. +func (s *NetworkInsightsAnalysis) SetNetworkInsightsAnalysisId(v string) *NetworkInsightsAnalysis { + s.NetworkInsightsAnalysisId = &v + return s +} + +// SetNetworkInsightsPathId sets the NetworkInsightsPathId field's value. +func (s *NetworkInsightsAnalysis) SetNetworkInsightsPathId(v string) *NetworkInsightsAnalysis { + s.NetworkInsightsPathId = &v + return s +} + +// SetNetworkPathFound sets the NetworkPathFound field's value. +func (s *NetworkInsightsAnalysis) SetNetworkPathFound(v bool) *NetworkInsightsAnalysis { + s.NetworkPathFound = &v + return s +} + +// SetReturnPathComponents sets the ReturnPathComponents field's value. +func (s *NetworkInsightsAnalysis) SetReturnPathComponents(v []*PathComponent) *NetworkInsightsAnalysis { + s.ReturnPathComponents = v + return s +} + +// SetStartDate sets the StartDate field's value. +func (s *NetworkInsightsAnalysis) SetStartDate(v time.Time) *NetworkInsightsAnalysis { + s.StartDate = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *NetworkInsightsAnalysis) SetStatus(v string) *NetworkInsightsAnalysis { + s.Status = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *NetworkInsightsAnalysis) SetStatusMessage(v string) *NetworkInsightsAnalysis { + s.StatusMessage = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *NetworkInsightsAnalysis) SetTags(v []*Tag) *NetworkInsightsAnalysis { + s.Tags = v + return s +} + +// Describes a path. +type NetworkInsightsPath struct { + _ struct{} `type:"structure"` + + // The time stamp when the path was created. + CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"` + + // The AWS resource that is the destination of the path. + Destination *string `locationName:"destination" type:"string"` + + // The IP address of the AWS resource that is the destination of the path. + DestinationIp *string `locationName:"destinationIp" type:"string"` + + // The destination port. + DestinationPort *int64 `locationName:"destinationPort" type:"integer"` + + // The Amazon Resource Name (ARN) of the path. + NetworkInsightsPathArn *string `locationName:"networkInsightsPathArn" min:"1" type:"string"` + + // The ID of the path. + NetworkInsightsPathId *string `locationName:"networkInsightsPathId" type:"string"` + + // The protocol. + Protocol *string `locationName:"protocol" type:"string" enum:"Protocol"` + + // The AWS resource that is the source of the path. + Source *string `locationName:"source" type:"string"` + + // The IP address of the AWS resource that is the source of the path. + SourceIp *string `locationName:"sourceIp" type:"string"` + + // The tags associated with the path. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s NetworkInsightsPath) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkInsightsPath) GoString() string { + return s.String() +} + +// SetCreatedDate sets the CreatedDate field's value. +func (s *NetworkInsightsPath) SetCreatedDate(v time.Time) *NetworkInsightsPath { + s.CreatedDate = &v + return s +} + +// SetDestination sets the Destination field's value. +func (s *NetworkInsightsPath) SetDestination(v string) *NetworkInsightsPath { + s.Destination = &v + return s +} + +// SetDestinationIp sets the DestinationIp field's value. +func (s *NetworkInsightsPath) SetDestinationIp(v string) *NetworkInsightsPath { + s.DestinationIp = &v + return s +} + +// SetDestinationPort sets the DestinationPort field's value. +func (s *NetworkInsightsPath) SetDestinationPort(v int64) *NetworkInsightsPath { + s.DestinationPort = &v + return s +} + +// SetNetworkInsightsPathArn sets the NetworkInsightsPathArn field's value. +func (s *NetworkInsightsPath) SetNetworkInsightsPathArn(v string) *NetworkInsightsPath { + s.NetworkInsightsPathArn = &v + return s +} + +// SetNetworkInsightsPathId sets the NetworkInsightsPathId field's value. +func (s *NetworkInsightsPath) SetNetworkInsightsPathId(v string) *NetworkInsightsPath { + s.NetworkInsightsPathId = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *NetworkInsightsPath) SetProtocol(v string) *NetworkInsightsPath { + s.Protocol = &v + return s +} + +// SetSource sets the Source field's value. +func (s *NetworkInsightsPath) SetSource(v string) *NetworkInsightsPath { + s.Source = &v + return s +} + +// SetSourceIp sets the SourceIp field's value. +func (s *NetworkInsightsPath) SetSourceIp(v string) *NetworkInsightsPath { + s.SourceIp = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *NetworkInsightsPath) SetTags(v []*Tag) *NetworkInsightsPath { + s.Tags = v + return s +} + // Describes a network interface. type NetworkInterface struct { _ struct{} `type:"structure"` @@ -96197,14 +102830,14 @@ type NetworkInterface struct { // The private IPv4 addresses associated with the network interface. PrivateIpAddresses []*NetworkInterfacePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` - // The ID of the entity that launched the instance on your behalf (for example, - // AWS Management Console or Auto Scaling). + // The alias or AWS account ID of the principal or service that created the + // network interface. RequesterId *string `locationName:"requesterId" type:"string"` // Indicates whether the network interface is being managed by AWS. RequesterManaged *bool `locationName:"requesterManaged" type:"boolean"` - // Indicates whether traffic to or from the instance is validated. + // Indicates whether source/destination checking is enabled. SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` // The status of the network interface. @@ -96926,6 +103559,120 @@ func (s *OnDemandOptionsRequest) SetSingleInstanceType(v bool) *OnDemandOptionsR return s } +// Describes a path component. +type PathComponent struct { + _ struct{} `type:"structure"` + + // The network ACL rule. + AclRule *AnalysisAclRule `locationName:"aclRule" type:"structure"` + + // The component. + Component *AnalysisComponent `locationName:"component" type:"structure"` + + // The destination VPC. + DestinationVpc *AnalysisComponent `locationName:"destinationVpc" type:"structure"` + + // The inbound header. + InboundHeader *AnalysisPacketHeader `locationName:"inboundHeader" type:"structure"` + + // The outbound header. + OutboundHeader *AnalysisPacketHeader `locationName:"outboundHeader" type:"structure"` + + // The route table route. + RouteTableRoute *AnalysisRouteTableRoute `locationName:"routeTableRoute" type:"structure"` + + // The security group rule. + SecurityGroupRule *AnalysisSecurityGroupRule `locationName:"securityGroupRule" type:"structure"` + + // The sequence number. + SequenceNumber *int64 `locationName:"sequenceNumber" type:"integer"` + + // The source VPC. + SourceVpc *AnalysisComponent `locationName:"sourceVpc" type:"structure"` + + // The subnet. + Subnet *AnalysisComponent `locationName:"subnet" type:"structure"` + + // The component VPC. + Vpc *AnalysisComponent `locationName:"vpc" type:"structure"` +} + +// String returns the string representation +func (s PathComponent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PathComponent) GoString() string { + return s.String() +} + +// SetAclRule sets the AclRule field's value. +func (s *PathComponent) SetAclRule(v *AnalysisAclRule) *PathComponent { + s.AclRule = v + return s +} + +// SetComponent sets the Component field's value. +func (s *PathComponent) SetComponent(v *AnalysisComponent) *PathComponent { + s.Component = v + return s +} + +// SetDestinationVpc sets the DestinationVpc field's value. +func (s *PathComponent) SetDestinationVpc(v *AnalysisComponent) *PathComponent { + s.DestinationVpc = v + return s +} + +// SetInboundHeader sets the InboundHeader field's value. +func (s *PathComponent) SetInboundHeader(v *AnalysisPacketHeader) *PathComponent { + s.InboundHeader = v + return s +} + +// SetOutboundHeader sets the OutboundHeader field's value. +func (s *PathComponent) SetOutboundHeader(v *AnalysisPacketHeader) *PathComponent { + s.OutboundHeader = v + return s +} + +// SetRouteTableRoute sets the RouteTableRoute field's value. +func (s *PathComponent) SetRouteTableRoute(v *AnalysisRouteTableRoute) *PathComponent { + s.RouteTableRoute = v + return s +} + +// SetSecurityGroupRule sets the SecurityGroupRule field's value. +func (s *PathComponent) SetSecurityGroupRule(v *AnalysisSecurityGroupRule) *PathComponent { + s.SecurityGroupRule = v + return s +} + +// SetSequenceNumber sets the SequenceNumber field's value. +func (s *PathComponent) SetSequenceNumber(v int64) *PathComponent { + s.SequenceNumber = &v + return s +} + +// SetSourceVpc sets the SourceVpc field's value. +func (s *PathComponent) SetSourceVpc(v *AnalysisComponent) *PathComponent { + s.SourceVpc = v + return s +} + +// SetSubnet sets the Subnet field's value. +func (s *PathComponent) SetSubnet(v *AnalysisComponent) *PathComponent { + s.Subnet = v + return s +} + +// SetVpc sets the Vpc field's value. +func (s *PathComponent) SetVpc(v *AnalysisComponent) *PathComponent { + s.Vpc = v + return s +} + // Describes the data that identifies an Amazon FPGA image (AFI) on the PCI // bus. type PciId struct { @@ -98038,6 +104785,30 @@ func (s *PrincipalIdFormat) SetStatuses(v []*IdFormat) *PrincipalIdFormat { return s } +// Information about the Private DNS name for interface endpoints. +type PrivateDnsDetails struct { + _ struct{} `type:"structure"` + + // The private DNS name assigned to the VPC endpoint service. + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` +} + +// String returns the string representation +func (s PrivateDnsDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PrivateDnsDetails) GoString() string { + return s.String() +} + +// SetPrivateDnsName sets the PrivateDnsName field's value. +func (s *PrivateDnsDetails) SetPrivateDnsName(v string) *PrivateDnsDetails { + s.PrivateDnsName = &v + return s +} + // Information about the private DNS name for the service endpoint. For more // information about these parameters, see VPC Endpoint Service Private DNS // Name Verification (https://docs.aws.amazon.com/vpc/latest/userguide/ndpoint-services-dns-validation.html) @@ -98414,6 +105185,48 @@ func (s *ProvisionedBandwidth) SetStatus(v string) *ProvisionedBandwidth { return s } +// The status of an updated pointer (PTR) record for an Elastic IP address. +type PtrUpdateStatus struct { + _ struct{} `type:"structure"` + + // The reason for the PTR record update. + Reason *string `locationName:"reason" type:"string"` + + // The status of the PTR record update. + Status *string `locationName:"status" type:"string"` + + // The value for the PTR record update. + Value *string `locationName:"value" type:"string"` +} + +// String returns the string representation +func (s PtrUpdateStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PtrUpdateStatus) GoString() string { + return s.String() +} + +// SetReason sets the Reason field's value. +func (s *PtrUpdateStatus) SetReason(v string) *PtrUpdateStatus { + s.Reason = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *PtrUpdateStatus) SetStatus(v string) *PtrUpdateStatus { + s.Status = &v + return s +} + +// SetValue sets the Value field's value. +func (s *PtrUpdateStatus) SetValue(v string) *PtrUpdateStatus { + s.Value = &v + return s +} + // Describes an IPv4 address pool. type PublicIpv4Pool struct { _ struct{} `type:"structure"` @@ -98638,7 +105451,7 @@ type PurchaseHostReservationInput struct { _ struct{} `type:"structure"` // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `type:"string"` // The currency in which the totalUpfrontPrice, LimitPrice, and totalHourlyPrice @@ -98733,7 +105546,7 @@ type PurchaseHostReservationOutput struct { _ struct{} `type:"structure"` // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `locationName:"clientToken" type:"string"` // The currency in which the totalUpfrontPrice and totalHourlyPrice amounts @@ -99207,8 +106020,21 @@ type RegisterImageInput struct { BillingProducts []*string `locationName:"BillingProduct" locationNameList:"item" type:"list"` // The block device mapping entries. + // + // If you specify an EBS volume using the ID of an EBS snapshot, you can't specify + // the encryption state of the volume. + // + // If you create an AMI on an Outpost, then all backing snapshots must be on + // the same Outpost or in the Region of that Outpost. AMIs on an Outpost that + // include local snapshots can be used to launch instances on the same Outpost + // only. For more information, Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#ami) + // in the Amazon Elastic Compute Cloud User Guide. BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` + // The boot mode of the AMI. For more information, see Boot modes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) + // in the Amazon Elastic Compute Cloud User Guide. + BootMode *string `type:"string" enum:"BootModeValues"` + // A description for your AMI. Description *string `locationName:"description" type:"string"` @@ -99306,6 +106132,12 @@ func (s *RegisterImageInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *Re return s } +// SetBootMode sets the BootMode field's value. +func (s *RegisterImageInput) SetBootMode(v string) *RegisterImageInput { + s.BootMode = &v + return s +} + // SetDescription sets the Description field's value. func (s *RegisterImageInput) SetDescription(v string) *RegisterImageInput { s.Description = &v @@ -99639,6 +106471,82 @@ func (s *RegisterTransitGatewayMulticastGroupSourcesOutput) SetRegisteredMultica return s } +type RejectTransitGatewayMulticastDomainAssociationsInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The IDs of the subnets to associate with the transit gateway multicast domain. + SubnetIds []*string `locationNameList:"item" type:"list"` + + // The ID of the transit gateway attachment. + TransitGatewayAttachmentId *string `type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` +} + +// String returns the string representation +func (s RejectTransitGatewayMulticastDomainAssociationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectTransitGatewayMulticastDomainAssociationsInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *RejectTransitGatewayMulticastDomainAssociationsInput) SetDryRun(v bool) *RejectTransitGatewayMulticastDomainAssociationsInput { + s.DryRun = &v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *RejectTransitGatewayMulticastDomainAssociationsInput) SetSubnetIds(v []*string) *RejectTransitGatewayMulticastDomainAssociationsInput { + s.SubnetIds = v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *RejectTransitGatewayMulticastDomainAssociationsInput) SetTransitGatewayAttachmentId(v string) *RejectTransitGatewayMulticastDomainAssociationsInput { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *RejectTransitGatewayMulticastDomainAssociationsInput) SetTransitGatewayMulticastDomainId(v string) *RejectTransitGatewayMulticastDomainAssociationsInput { + s.TransitGatewayMulticastDomainId = &v + return s +} + +type RejectTransitGatewayMulticastDomainAssociationsOutput struct { + _ struct{} `type:"structure"` + + // Describes the multicast domain associations. + Associations *TransitGatewayMulticastDomainAssociations `locationName:"associations" type:"structure"` +} + +// String returns the string representation +func (s RejectTransitGatewayMulticastDomainAssociationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectTransitGatewayMulticastDomainAssociationsOutput) GoString() string { + return s.String() +} + +// SetAssociations sets the Associations field's value. +func (s *RejectTransitGatewayMulticastDomainAssociationsOutput) SetAssociations(v *TransitGatewayMulticastDomainAssociations) *RejectTransitGatewayMulticastDomainAssociationsOutput { + s.Associations = v + return s +} + type RejectTransitGatewayPeeringAttachmentInput struct { _ struct{} `type:"structure"` @@ -100459,6 +107367,94 @@ func (s ReplaceNetworkAclEntryOutput) GoString() string { return s.String() } +// Information about a root volume replacement task. +type ReplaceRootVolumeTask struct { + _ struct{} `type:"structure"` + + // The time the task completed. + CompleteTime *string `locationName:"completeTime" type:"string"` + + // The ID of the instance for which the root volume replacement task was created. + InstanceId *string `locationName:"instanceId" type:"string"` + + // The ID of the root volume replacement task. + ReplaceRootVolumeTaskId *string `locationName:"replaceRootVolumeTaskId" type:"string"` + + // The time the task was started. + StartTime *string `locationName:"startTime" type:"string"` + + // The tags assigned to the task. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The state of the task. The task can be in one of the following states: + // + // * pending - the replacement volume is being created. + // + // * in-progress - the original volume is being detached and the replacement + // volume is being attached. + // + // * succeeded - the replacement volume has been successfully attached to + // the instance and the instance is available. + // + // * failing - the replacement task is in the process of failing. + // + // * failed - the replacement task has failed but the original root volume + // is still attached. + // + // * failing-detached - the replacement task is in the process of failing. + // The instance might have no root volume attached. + // + // * failed-detached - the replacement task has failed and the instance has + // no root volume attached. + TaskState *string `locationName:"taskState" type:"string" enum:"ReplaceRootVolumeTaskState"` +} + +// String returns the string representation +func (s ReplaceRootVolumeTask) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceRootVolumeTask) GoString() string { + return s.String() +} + +// SetCompleteTime sets the CompleteTime field's value. +func (s *ReplaceRootVolumeTask) SetCompleteTime(v string) *ReplaceRootVolumeTask { + s.CompleteTime = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *ReplaceRootVolumeTask) SetInstanceId(v string) *ReplaceRootVolumeTask { + s.InstanceId = &v + return s +} + +// SetReplaceRootVolumeTaskId sets the ReplaceRootVolumeTaskId field's value. +func (s *ReplaceRootVolumeTask) SetReplaceRootVolumeTaskId(v string) *ReplaceRootVolumeTask { + s.ReplaceRootVolumeTaskId = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *ReplaceRootVolumeTask) SetStartTime(v string) *ReplaceRootVolumeTask { + s.StartTime = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ReplaceRootVolumeTask) SetTags(v []*Tag) *ReplaceRootVolumeTask { + s.Tags = v + return s +} + +// SetTaskState sets the TaskState field's value. +func (s *ReplaceRootVolumeTask) SetTaskState(v string) *ReplaceRootVolumeTask { + s.TaskState = &v + return s +} + type ReplaceRouteInput struct { _ struct{} `type:"structure"` @@ -100511,6 +107507,9 @@ type ReplaceRouteInput struct { // The ID of a transit gateway. TransitGatewayId *string `type:"string"` + // The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only. + VpcEndpointId *string `type:"string"` + // The ID of a VPC peering connection. VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` } @@ -100622,6 +107621,12 @@ func (s *ReplaceRouteInput) SetTransitGatewayId(v string) *ReplaceRouteInput { return s } +// SetVpcEndpointId sets the VpcEndpointId field's value. +func (s *ReplaceRouteInput) SetVpcEndpointId(v string) *ReplaceRouteInput { + s.VpcEndpointId = &v + return s +} + // SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. func (s *ReplaceRouteInput) SetVpcPeeringConnectionId(v string) *ReplaceRouteInput { s.VpcPeeringConnectionId = &v @@ -101039,7 +108044,7 @@ type RequestLaunchTemplateData struct { // in the Amazon Elastic Compute Cloud User Guide. HibernationOptions *LaunchTemplateHibernationOptionsRequest `type:"structure"` - // The IAM instance profile. + // The name or Amazon Resource Name (ARN) of an IAM instance profile. IamInstanceProfile *LaunchTemplateIamInstanceProfileSpecificationRequest `type:"structure"` // The ID of the AMI. @@ -101703,9 +108708,7 @@ type RequestSpotLaunchSpecification struct { // you can specify the names or the IDs of the security groups. SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"item" type:"list"` - // The IDs of the subnets in which to launch the instance. To specify multiple - // subnets, separate them using commas; for example, "subnet-1234abcdeexample1, - // subnet-0987cdef6example2". + // The ID of the subnet in which to launch the instance. SubnetId *string `locationName:"subnetId" type:"string"` // The Base64-encoded user data for the instance. User data is limited to 16 @@ -102672,6 +109675,93 @@ func (s *ReservedInstancesOffering) SetUsagePrice(v float64) *ReservedInstancesO return s } +type ResetAddressAttributeInput struct { + _ struct{} `type:"structure"` + + // [EC2-VPC] The allocation ID. + // + // AllocationId is a required field + AllocationId *string `type:"string" required:"true"` + + // The attribute of the IP address. + // + // Attribute is a required field + Attribute *string `type:"string" required:"true" enum:"AddressAttributeName"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` +} + +// String returns the string representation +func (s ResetAddressAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetAddressAttributeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResetAddressAttributeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResetAddressAttributeInput"} + if s.AllocationId == nil { + invalidParams.Add(request.NewErrParamRequired("AllocationId")) + } + if s.Attribute == nil { + invalidParams.Add(request.NewErrParamRequired("Attribute")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAllocationId sets the AllocationId field's value. +func (s *ResetAddressAttributeInput) SetAllocationId(v string) *ResetAddressAttributeInput { + s.AllocationId = &v + return s +} + +// SetAttribute sets the Attribute field's value. +func (s *ResetAddressAttributeInput) SetAttribute(v string) *ResetAddressAttributeInput { + s.Attribute = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *ResetAddressAttributeInput) SetDryRun(v bool) *ResetAddressAttributeInput { + s.DryRun = &v + return s +} + +type ResetAddressAttributeOutput struct { + _ struct{} `type:"structure"` + + // Information about the IP address. + Address *AddressAttribute `locationName:"address" type:"structure"` +} + +// String returns the string representation +func (s ResetAddressAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetAddressAttributeOutput) GoString() string { + return s.String() +} + +// SetAddress sets the Address field's value. +func (s *ResetAddressAttributeOutput) SetAddress(v *AddressAttribute) *ResetAddressAttributeOutput { + s.Address = v + return s +} + type ResetEbsDefaultKmsKeyIdInput struct { _ struct{} `type:"structure"` @@ -104380,14 +111470,14 @@ type RunInstancesInput struct { // The CPU options for the instance. For more information, see Optimizing CPU // options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. CpuOptions *CpuOptionsRequest `type:"structure"` // The credit option for CPU usage of the burstable performance instance. Valid // values are standard and unlimited. To change this attribute after launch, // use ModifyInstanceCreditSpecification (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html). // For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. // // Default: standard (T2 instances) or unlimited (T3/T3a instances) CreditSpecification *CreditSpecificationRequest `type:"structure"` @@ -104419,7 +111509,7 @@ type RunInstancesInput struct { // An elastic GPU to associate with the instance. An Elastic GPU is a GPU resource // that you can attach to your Windows instance to accelerate the graphics performance // of your applications. For more information, see Amazon EC2 Elastic GPUs (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-graphics.html) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. ElasticGpuSpecification []*ElasticGpuSpecification `locationNameList:"item" type:"list"` // An elastic inference accelerator to associate with the instance. Elastic @@ -104438,12 +111528,12 @@ type RunInstancesInput struct { // Indicates whether an instance is enabled for hibernation. For more information, // see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. // // You can't enable hibernation and AWS Nitro Enclaves on the same instance. HibernationOptions *HibernationOptionsRequest `type:"structure"` - // The IAM instance profile. + // The name or Amazon Resource Name (ARN) of an IAM instance profile. IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI. An AMI ID is required to launch an instance and must be @@ -104463,7 +111553,7 @@ type RunInstancesInput struct { InstanceMarketOptions *InstanceMarketOptionsRequest `type:"structure"` // The instance type. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. // // Default: m1.small InstanceType *string `type:"string" enum:"InstanceType"` @@ -104491,7 +111581,7 @@ type RunInstancesInput struct { // // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more // information, see PV-GRUB (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. KernelId *string `type:"string"` // The name of the key pair. You can create a key pair using CreateKeyPair (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html) @@ -104567,7 +111657,7 @@ type RunInstancesInput struct { // // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more // information, see PV-GRUB (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. RamdiskId *string `type:"string"` // The IDs of the security groups. You can create a security group using CreateSecurityGroup @@ -105041,6 +112131,47 @@ func (s *RunScheduledInstancesOutput) SetInstanceIdSet(v []*string) *RunSchedule return s } +// The tags to apply to the AMI object that will be stored in the S3 bucket. +// For more information, see Categorizing your storage using tags (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html) +// in the Amazon Simple Storage Service User Guide. +type S3ObjectTag struct { + _ struct{} `type:"structure"` + + // The key of the tag. + // + // Constraints: Tag keys are case-sensitive and can be up to 128 Unicode characters + // in length. May not begin with aws:. + Key *string `type:"string"` + + // The value of the tag. + // + // Constraints: Tag values are case-sensitive and can be up to 256 Unicode characters + // in length. + Value *string `type:"string"` +} + +// String returns the string representation +func (s S3ObjectTag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3ObjectTag) GoString() string { + return s.String() +} + +// SetKey sets the Key field's value. +func (s *S3ObjectTag) SetKey(v string) *S3ObjectTag { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *S3ObjectTag) SetValue(v string) *S3ObjectTag { + s.Value = &v + return s +} + // Describes the storage parameters for S3 and S3 buckets for an instance store-backed // AMI. type S3Storage struct { @@ -105534,8 +112665,7 @@ type ScheduledInstancesBlockDeviceMapping struct { // launched. Ebs *ScheduledInstancesEbs `type:"structure"` - // Suppresses the specified device included in the block device mapping of the - // AMI. + // To omit the device from the block device mapping, specify an empty string. NoDevice *string `type:"string"` // The virtual device name (ephemeralN). Instance store volumes are numbered @@ -105599,10 +112729,11 @@ type ScheduledInstancesEbs struct { // The number of I/O operations per second (IOPS) to provision for an io1 or // io2 volume, with a maximum ratio of 50 IOPS/GiB for io1, and 500 IOPS/GiB // for io2. Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum - // IOPS of 64,000 is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // IOPS of 64,000 is guaranteed only on instances built on the Nitro System + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). // Other instance families guarantee performance up to 32,000 IOPS. For more - // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. + // information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // in the Amazon EC2 User Guide. // // This parameter is valid only for Provisioned IOPS SSD (io1 and io2) volumes. Iops *int64 `type:"integer"` @@ -106378,7 +113509,7 @@ type SearchTransitGatewayRoutesInput struct { // * attachment.resource-id - The resource id of the transit gateway attachment. // // * attachment.resource-type - The attachment resource type. Valid values - // are vpc | vpn | direct-connect-gateway | peering. + // are vpc | vpn | direct-connect-gateway | peering | connect. // // * prefix-list-id - The ID of the prefix list. // @@ -106736,6 +113867,9 @@ type ServiceConfiguration struct { // The DNS names for the service. BaseEndpointDnsNames []*string `locationName:"baseEndpointDnsNameSet" locationNameList:"item" type:"list"` + // The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service. + GatewayLoadBalancerArns []*string `locationName:"gatewayLoadBalancerArnSet" locationNameList:"item" type:"list"` + // Indicates whether the service manages its VPC endpoints. Management of the // service VPC endpoints using the VPC endpoint API is restricted. ManagesVpcEndpoints *bool `locationName:"managesVpcEndpoints" type:"boolean"` @@ -106793,6 +113927,12 @@ func (s *ServiceConfiguration) SetBaseEndpointDnsNames(v []*string) *ServiceConf return s } +// SetGatewayLoadBalancerArns sets the GatewayLoadBalancerArns field's value. +func (s *ServiceConfiguration) SetGatewayLoadBalancerArns(v []*string) *ServiceConfiguration { + s.GatewayLoadBalancerArns = v + return s +} + // SetManagesVpcEndpoints sets the ManagesVpcEndpoints field's value. func (s *ServiceConfiguration) SetManagesVpcEndpoints(v bool) *ServiceConfiguration { s.ManagesVpcEndpoints = &v @@ -106877,6 +114017,9 @@ type ServiceDetail struct { // is not verified. PrivateDnsNameVerificationState *string `locationName:"privateDnsNameVerificationState" type:"string" enum:"DnsNameState"` + // The private DNS names assigned to the VPC endpoint service. + PrivateDnsNames []*PrivateDnsDetails `locationName:"privateDnsNameSet" locationNameList:"item" type:"list"` + // The ID of the endpoint service. ServiceId *string `locationName:"serviceId" type:"string"` @@ -106945,6 +114088,12 @@ func (s *ServiceDetail) SetPrivateDnsNameVerificationState(v string) *ServiceDet return s } +// SetPrivateDnsNames sets the PrivateDnsNames field's value. +func (s *ServiceDetail) SetPrivateDnsNames(v []*PrivateDnsDetails) *ServiceDetail { + s.PrivateDnsNames = v + return s +} + // SetServiceId sets the ServiceId field's value. func (s *ServiceDetail) SetServiceId(v string) *ServiceDetail { s.ServiceId = &v @@ -107111,6 +114260,11 @@ type Snapshot struct { // key for the parent volume. KmsKeyId *string `locationName:"kmsKeyId" type:"string"` + // The ARN of the AWS Outpost on which the snapshot is stored. For more information, + // see EBS Local Snapshot on Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html) + // in the Amazon Elastic Compute Cloud User Guide. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // The AWS owner alias, from an Amazon-maintained list (amazon). This is not // the user-configured AWS account alias set using the IAM console. OwnerAlias *string `locationName:"ownerAlias" type:"string"` @@ -107184,6 +114338,12 @@ func (s *Snapshot) SetKmsKeyId(v string) *Snapshot { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *Snapshot) SetOutpostArn(v string) *Snapshot { + s.OutpostArn = &v + return s +} + // SetOwnerAlias sets the OwnerAlias field's value. func (s *Snapshot) SetOwnerAlias(v string) *Snapshot { s.OwnerAlias = &v @@ -107358,7 +114518,7 @@ type SnapshotDiskContainer struct { // The format of the disk image being imported. // - // Valid values: VHD | VMDK + // Valid values: VHD | VMDK | RAW Format *string `type:"string"` // The URL to the Amazon S3-based disk image being imported. It can either be @@ -107414,6 +114574,11 @@ type SnapshotInfo struct { // Indicates whether the snapshot is encrypted. Encrypted *bool `locationName:"encrypted" type:"boolean"` + // The ARN of the AWS Outpost on which the snapshot is stored. For more information, + // see EBS Local Snapshot on Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html) + // in the Amazon Elastic Compute Cloud User Guide. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // Account id used when creating this snapshot. OwnerId *string `locationName:"ownerId" type:"string"` @@ -107462,6 +114627,12 @@ func (s *SnapshotInfo) SetEncrypted(v bool) *SnapshotInfo { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *SnapshotInfo) SetOutpostArn(v string) *SnapshotInfo { + s.OutpostArn = &v + return s +} + // SetOwnerId sets the OwnerId field's value. func (s *SnapshotInfo) SetOwnerId(v string) *SnapshotInfo { s.OwnerId = &v @@ -107640,9 +114811,8 @@ type SpotCapacityRebalance struct { // launch. // // When a replacement instance is launched, the instance marked for rebalance - // is not automatically terminated. You can terminate it, or you can wait until - // Amazon EC2 interrupts it. You are charged for all instances while they are - // running. + // is not automatically terminated. You can terminate it, or you can leave it + // running. You are charged for all instances while they are running. ReplacementStrategy *string `locationName:"replacementStrategy" type:"string" enum:"ReplacementStrategy"` } @@ -108045,9 +115215,16 @@ type SpotFleetRequestConfigData struct { // If the allocation strategy is diversified, Spot Fleet launches instances // from all the Spot Instance pools that you specify. // - // If the allocation strategy is capacityOptimized, Spot Fleet launches instances - // from Spot Instance pools with optimal capacity for the number of instances - // that are launching. + // If the allocation strategy is capacityOptimized (recommended), Spot Fleet + // launches instances from Spot Instance pools with optimal capacity for the + // number of instances that are launching. To give certain instance types a + // higher chance of launching first, use capacityOptimizedPrioritized. Set a + // priority for each instance type by using the Priority parameter for LaunchTemplateOverrides. + // You can assign the same priority to different LaunchTemplateOverrides. EC2 + // implements the priorities on a best-effort basis, but optimizes for capacity + // first. capacityOptimizedPrioritized is supported only if your Spot Fleet + // uses a launch template. Note that if the OnDemandAllocationStrategy is set + // to prioritized, the same priority is applied when fulfilling On-Demand capacity. AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"AllocationStrategy"` // A unique, case-sensitive identifier that you provide to ensure the idempotency @@ -108753,8 +115930,8 @@ type SpotMarketOptions struct { MaxPrice *string `type:"string"` // The Spot Instance request type. For RunInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances), - // persistent Spot Instance requests are only supported when InstanceInterruptionBehavior - // is set to either hibernate or stop. + // persistent Spot Instance requests are only supported when the instance interruption + // behavior is either hibernate or stop. SpotInstanceType *string `type:"string" enum:"SpotInstanceType"` // The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). Supported @@ -108823,9 +116000,16 @@ type SpotOptions struct { // If the allocation strategy is diversified, EC2 Fleet launches instances from // all of the Spot Instance pools that you specify. // - // If the allocation strategy is capacity-optimized, EC2 Fleet launches instances - // from Spot Instance pools with optimal capacity for the number of instances - // that are launching. + // If the allocation strategy is capacity-optimized (recommended), EC2 Fleet + // launches instances from Spot Instance pools with optimal capacity for the + // number of instances that are launching. To give certain instance types a + // higher chance of launching first, use capacity-optimized-prioritized. Set + // a priority for each instance type by using the Priority parameter for LaunchTemplateOverrides. + // You can assign the same priority to different LaunchTemplateOverrides. EC2 + // implements the priorities on a best-effort basis, but optimizes for capacity + // first. capacity-optimized-prioritized is supported only if your fleet uses + // a launch template. Note that if the On-Demand AllocationStrategy is set to + // prioritized, the same priority is applied when fulfilling On-Demand capacity. AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"SpotAllocationStrategy"` // The behavior when a Spot Instance is interrupted. The default is terminate. @@ -108929,9 +116113,16 @@ type SpotOptionsRequest struct { // If the allocation strategy is diversified, EC2 Fleet launches instances from // all of the Spot Instance pools that you specify. // - // If the allocation strategy is capacity-optimized, EC2 Fleet launches instances - // from Spot Instance pools with optimal capacity for the number of instances - // that are launching. + // If the allocation strategy is capacity-optimized (recommended), EC2 Fleet + // launches instances from Spot Instance pools with optimal capacity for the + // number of instances that are launching. To give certain instance types a + // higher chance of launching first, use capacity-optimized-prioritized. Set + // a priority for each instance type by using the Priority parameter for LaunchTemplateOverrides. + // You can assign the same priority to different LaunchTemplateOverrides. EC2 + // implements the priorities on a best-effort basis, but optimizes for capacity + // first. capacity-optimized-prioritized is supported only if your fleet uses + // a launch template. Note that if the On-Demand AllocationStrategy is set to + // prioritized, the same priority is applied when fulfilling On-Demand capacity. AllocationStrategy *string `type:"string" enum:"SpotAllocationStrategy"` // The behavior when a Spot Instance is interrupted. The default is terminate. @@ -109353,6 +116544,107 @@ func (s *StartInstancesOutput) SetStartingInstances(v []*InstanceStateChange) *S return s } +type StartNetworkInsightsAnalysisInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The Amazon Resource Names (ARN) of the resources that the path must traverse. + FilterInArns []*string `locationName:"FilterInArn" locationNameList:"item" type:"list"` + + // The ID of the path. + // + // NetworkInsightsPathId is a required field + NetworkInsightsPathId *string `type:"string" required:"true"` + + // The tags to apply. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s StartNetworkInsightsAnalysisInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartNetworkInsightsAnalysisInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartNetworkInsightsAnalysisInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartNetworkInsightsAnalysisInput"} + if s.NetworkInsightsPathId == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkInsightsPathId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *StartNetworkInsightsAnalysisInput) SetClientToken(v string) *StartNetworkInsightsAnalysisInput { + s.ClientToken = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *StartNetworkInsightsAnalysisInput) SetDryRun(v bool) *StartNetworkInsightsAnalysisInput { + s.DryRun = &v + return s +} + +// SetFilterInArns sets the FilterInArns field's value. +func (s *StartNetworkInsightsAnalysisInput) SetFilterInArns(v []*string) *StartNetworkInsightsAnalysisInput { + s.FilterInArns = v + return s +} + +// SetNetworkInsightsPathId sets the NetworkInsightsPathId field's value. +func (s *StartNetworkInsightsAnalysisInput) SetNetworkInsightsPathId(v string) *StartNetworkInsightsAnalysisInput { + s.NetworkInsightsPathId = &v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *StartNetworkInsightsAnalysisInput) SetTagSpecifications(v []*TagSpecification) *StartNetworkInsightsAnalysisInput { + s.TagSpecifications = v + return s +} + +type StartNetworkInsightsAnalysisOutput struct { + _ struct{} `type:"structure"` + + // Information about the network insights analysis. + NetworkInsightsAnalysis *NetworkInsightsAnalysis `locationName:"networkInsightsAnalysis" type:"structure"` +} + +// String returns the string representation +func (s StartNetworkInsightsAnalysisOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartNetworkInsightsAnalysisOutput) GoString() string { + return s.String() +} + +// SetNetworkInsightsAnalysis sets the NetworkInsightsAnalysis field's value. +func (s *StartNetworkInsightsAnalysisOutput) SetNetworkInsightsAnalysis(v *NetworkInsightsAnalysis) *StartNetworkInsightsAnalysisOutput { + s.NetworkInsightsAnalysis = v + return s +} + type StartVpcEndpointServicePrivateDnsVerificationInput struct { _ struct{} `type:"structure"` @@ -109517,7 +116809,7 @@ type StopInstancesInput struct { // Hibernates the instance if the instance was enabled for hibernation at launch. // If the instance cannot hibernate successfully, a normal shutdown occurs. // For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) - // in the Amazon Elastic Compute Cloud User Guide. + // in the Amazon EC2 User Guide. // // Default: false Hibernate *bool `type:"boolean"` @@ -109655,6 +116947,85 @@ func (s *StorageLocation) SetKey(v string) *StorageLocation { return s } +// The information about the AMI store task, including the progress of the task. +type StoreImageTaskResult struct { + _ struct{} `type:"structure"` + + // The ID of the AMI that is being stored. + AmiId *string `locationName:"amiId" type:"string"` + + // The name of the S3 bucket that contains the stored AMI object. + Bucket *string `locationName:"bucket" type:"string"` + + // The progress of the task as a percentage. + ProgressPercentage *int64 `locationName:"progressPercentage" type:"integer"` + + // The name of the stored AMI object in the bucket. + S3objectKey *string `locationName:"s3objectKey" type:"string"` + + // If the tasks fails, the reason for the failure is returned. If the task succeeds, + // null is returned. + StoreTaskFailureReason *string `locationName:"storeTaskFailureReason" type:"string"` + + // The state of the store task (InProgress, Completed, or Failed). + StoreTaskState *string `locationName:"storeTaskState" type:"string"` + + // The time the task started. + TaskStartTime *time.Time `locationName:"taskStartTime" type:"timestamp"` +} + +// String returns the string representation +func (s StoreImageTaskResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StoreImageTaskResult) GoString() string { + return s.String() +} + +// SetAmiId sets the AmiId field's value. +func (s *StoreImageTaskResult) SetAmiId(v string) *StoreImageTaskResult { + s.AmiId = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *StoreImageTaskResult) SetBucket(v string) *StoreImageTaskResult { + s.Bucket = &v + return s +} + +// SetProgressPercentage sets the ProgressPercentage field's value. +func (s *StoreImageTaskResult) SetProgressPercentage(v int64) *StoreImageTaskResult { + s.ProgressPercentage = &v + return s +} + +// SetS3objectKey sets the S3objectKey field's value. +func (s *StoreImageTaskResult) SetS3objectKey(v string) *StoreImageTaskResult { + s.S3objectKey = &v + return s +} + +// SetStoreTaskFailureReason sets the StoreTaskFailureReason field's value. +func (s *StoreImageTaskResult) SetStoreTaskFailureReason(v string) *StoreImageTaskResult { + s.StoreTaskFailureReason = &v + return s +} + +// SetStoreTaskState sets the StoreTaskState field's value. +func (s *StoreImageTaskResult) SetStoreTaskState(v string) *StoreImageTaskResult { + s.StoreTaskState = &v + return s +} + +// SetTaskStartTime sets the TaskStartTime field's value. +func (s *StoreImageTaskResult) SetTaskStartTime(v time.Time) *StoreImageTaskResult { + s.TaskStartTime = &v + return s +} + // Describes a subnet. type Subnet struct { _ struct{} `type:"structure"` @@ -110081,16 +117452,18 @@ type TagSpecification struct { // The type of resource to tag. Currently, the resource types that support tagging // on creation are: capacity-reservation | carrier-gateway | client-vpn-endpoint - // | customer-gateway | dedicated-host | dhcp-options | export-image-task | - // export-instance-task | fleet | fpga-image | host-reservation | import-image-task - // | import-snapshot-task | instance | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 - // | key-pair | launch-template | placement-group | prefix-list | natgateway - // | network-acl | route-table | security-group | spot-fleet-request | spot-instances-request + // | customer-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway + // | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet + // | fpga-image | host-reservation | image| import-image-task | import-snapshot-task + // | instance | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | + // launch-template | local-gateway-route-table-vpc-association | placement-group + // | prefix-list | natgateway | network-acl | network-interface | reserved-instances + // |route-table | security-group| snapshot | spot-fleet-request | spot-instances-request // | snapshot | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target - // | transit-gateway | transit-gateway-attachment | transit-gateway-route-table - // | volume |vpc | vpc-peering-connection | vpc-endpoint (for interface and - // gateway endpoints) | vpc-endpoint-service (for AWS PrivateLink) | vpc-flow-log - // | vpn-connection | vpn-gateway. + // | transit-gateway | transit-gateway-attachment | transit-gateway-multicast-domain + // | transit-gateway-route-table | volume |vpc | vpc-peering-connection | vpc-endpoint + // (for interface and gateway endpoints) | vpc-endpoint-service (for AWS PrivateLink) + // | vpc-flow-log | vpn-connection | vpn-gateway. // // To tag a resource after it has been created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html). ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` @@ -110135,7 +117508,7 @@ func (s *TagSpecification) SetTags(v []*Tag) *TagSpecification { // you're willing to pay is reached, the fleet stops launching instances even // if it hasn’t met the target capacity. The MaxTotalPrice parameters are // located in OnDemandOptions (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_OnDemandOptions.html) -// and SpotOptions (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotOptions) +// and SpotOptions (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotOptions). type TargetCapacitySpecification struct { _ struct{} `type:"structure"` @@ -111479,6 +118852,66 @@ func (s *TransitGatewayAttachmentAssociation) SetTransitGatewayRouteTableId(v st return s } +// The BGP configuration information. +type TransitGatewayAttachmentBgpConfiguration struct { + _ struct{} `type:"structure"` + + // The BGP status. + BgpStatus *string `locationName:"bgpStatus" type:"string" enum:"BgpStatus"` + + // The interior BGP peer IP address for the appliance. + PeerAddress *string `locationName:"peerAddress" type:"string"` + + // The peer Autonomous System Number (ASN). + PeerAsn *int64 `locationName:"peerAsn" type:"long"` + + // The interior BGP peer IP address for the transit gateway. + TransitGatewayAddress *string `locationName:"transitGatewayAddress" type:"string"` + + // The transit gateway Autonomous System Number (ASN). + TransitGatewayAsn *int64 `locationName:"transitGatewayAsn" type:"long"` +} + +// String returns the string representation +func (s TransitGatewayAttachmentBgpConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayAttachmentBgpConfiguration) GoString() string { + return s.String() +} + +// SetBgpStatus sets the BgpStatus field's value. +func (s *TransitGatewayAttachmentBgpConfiguration) SetBgpStatus(v string) *TransitGatewayAttachmentBgpConfiguration { + s.BgpStatus = &v + return s +} + +// SetPeerAddress sets the PeerAddress field's value. +func (s *TransitGatewayAttachmentBgpConfiguration) SetPeerAddress(v string) *TransitGatewayAttachmentBgpConfiguration { + s.PeerAddress = &v + return s +} + +// SetPeerAsn sets the PeerAsn field's value. +func (s *TransitGatewayAttachmentBgpConfiguration) SetPeerAsn(v int64) *TransitGatewayAttachmentBgpConfiguration { + s.PeerAsn = &v + return s +} + +// SetTransitGatewayAddress sets the TransitGatewayAddress field's value. +func (s *TransitGatewayAttachmentBgpConfiguration) SetTransitGatewayAddress(v string) *TransitGatewayAttachmentBgpConfiguration { + s.TransitGatewayAddress = &v + return s +} + +// SetTransitGatewayAsn sets the TransitGatewayAsn field's value. +func (s *TransitGatewayAttachmentBgpConfiguration) SetTransitGatewayAsn(v int64) *TransitGatewayAttachmentBgpConfiguration { + s.TransitGatewayAsn = &v + return s +} + // Describes a propagation route table. type TransitGatewayAttachmentPropagation struct { _ struct{} `type:"structure"` @@ -111512,6 +118945,261 @@ func (s *TransitGatewayAttachmentPropagation) SetTransitGatewayRouteTableId(v st return s } +// Describes a transit gateway Connect attachment. +type TransitGatewayConnect struct { + _ struct{} `type:"structure"` + + // The creation time. + CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` + + // The Connect attachment options. + Options *TransitGatewayConnectOptions `locationName:"options" type:"structure"` + + // The state of the attachment. + State *string `locationName:"state" type:"string" enum:"TransitGatewayAttachmentState"` + + // The tags for the attachment. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the Connect attachment. + TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"` + + // The ID of the transit gateway. + TransitGatewayId *string `locationName:"transitGatewayId" type:"string"` + + // The ID of the attachment from which the Connect attachment was created. + TransportTransitGatewayAttachmentId *string `locationName:"transportTransitGatewayAttachmentId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayConnect) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayConnect) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *TransitGatewayConnect) SetCreationTime(v time.Time) *TransitGatewayConnect { + s.CreationTime = &v + return s +} + +// SetOptions sets the Options field's value. +func (s *TransitGatewayConnect) SetOptions(v *TransitGatewayConnectOptions) *TransitGatewayConnect { + s.Options = v + return s +} + +// SetState sets the State field's value. +func (s *TransitGatewayConnect) SetState(v string) *TransitGatewayConnect { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *TransitGatewayConnect) SetTags(v []*Tag) *TransitGatewayConnect { + s.Tags = v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *TransitGatewayConnect) SetTransitGatewayAttachmentId(v string) *TransitGatewayConnect { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *TransitGatewayConnect) SetTransitGatewayId(v string) *TransitGatewayConnect { + s.TransitGatewayId = &v + return s +} + +// SetTransportTransitGatewayAttachmentId sets the TransportTransitGatewayAttachmentId field's value. +func (s *TransitGatewayConnect) SetTransportTransitGatewayAttachmentId(v string) *TransitGatewayConnect { + s.TransportTransitGatewayAttachmentId = &v + return s +} + +// Describes the Connect attachment options. +type TransitGatewayConnectOptions struct { + _ struct{} `type:"structure"` + + // The tunnel protocol. + Protocol *string `locationName:"protocol" type:"string" enum:"ProtocolValue"` +} + +// String returns the string representation +func (s TransitGatewayConnectOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayConnectOptions) GoString() string { + return s.String() +} + +// SetProtocol sets the Protocol field's value. +func (s *TransitGatewayConnectOptions) SetProtocol(v string) *TransitGatewayConnectOptions { + s.Protocol = &v + return s +} + +// Describes a transit gateway Connect peer. +type TransitGatewayConnectPeer struct { + _ struct{} `type:"structure"` + + // The Connect peer details. + ConnectPeerConfiguration *TransitGatewayConnectPeerConfiguration `locationName:"connectPeerConfiguration" type:"structure"` + + // The creation time. + CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` + + // The state of the Connect peer. + State *string `locationName:"state" type:"string" enum:"TransitGatewayConnectPeerState"` + + // The tags for the Connect peer. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the Connect attachment. + TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"` + + // The ID of the Connect peer. + TransitGatewayConnectPeerId *string `locationName:"transitGatewayConnectPeerId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayConnectPeer) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayConnectPeer) GoString() string { + return s.String() +} + +// SetConnectPeerConfiguration sets the ConnectPeerConfiguration field's value. +func (s *TransitGatewayConnectPeer) SetConnectPeerConfiguration(v *TransitGatewayConnectPeerConfiguration) *TransitGatewayConnectPeer { + s.ConnectPeerConfiguration = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *TransitGatewayConnectPeer) SetCreationTime(v time.Time) *TransitGatewayConnectPeer { + s.CreationTime = &v + return s +} + +// SetState sets the State field's value. +func (s *TransitGatewayConnectPeer) SetState(v string) *TransitGatewayConnectPeer { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *TransitGatewayConnectPeer) SetTags(v []*Tag) *TransitGatewayConnectPeer { + s.Tags = v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *TransitGatewayConnectPeer) SetTransitGatewayAttachmentId(v string) *TransitGatewayConnectPeer { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayConnectPeerId sets the TransitGatewayConnectPeerId field's value. +func (s *TransitGatewayConnectPeer) SetTransitGatewayConnectPeerId(v string) *TransitGatewayConnectPeer { + s.TransitGatewayConnectPeerId = &v + return s +} + +// Describes the Connect peer details. +type TransitGatewayConnectPeerConfiguration struct { + _ struct{} `type:"structure"` + + // The BGP configuration details. + BgpConfigurations []*TransitGatewayAttachmentBgpConfiguration `locationName:"bgpConfigurations" locationNameList:"item" type:"list"` + + // The range of interior BGP peer IP addresses. + InsideCidrBlocks []*string `locationName:"insideCidrBlocks" locationNameList:"item" type:"list"` + + // The Connect peer IP address on the appliance side of the tunnel. + PeerAddress *string `locationName:"peerAddress" type:"string"` + + // The tunnel protocol. + Protocol *string `locationName:"protocol" type:"string" enum:"ProtocolValue"` + + // The Connect peer IP address on the transit gateway side of the tunnel. + TransitGatewayAddress *string `locationName:"transitGatewayAddress" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayConnectPeerConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayConnectPeerConfiguration) GoString() string { + return s.String() +} + +// SetBgpConfigurations sets the BgpConfigurations field's value. +func (s *TransitGatewayConnectPeerConfiguration) SetBgpConfigurations(v []*TransitGatewayAttachmentBgpConfiguration) *TransitGatewayConnectPeerConfiguration { + s.BgpConfigurations = v + return s +} + +// SetInsideCidrBlocks sets the InsideCidrBlocks field's value. +func (s *TransitGatewayConnectPeerConfiguration) SetInsideCidrBlocks(v []*string) *TransitGatewayConnectPeerConfiguration { + s.InsideCidrBlocks = v + return s +} + +// SetPeerAddress sets the PeerAddress field's value. +func (s *TransitGatewayConnectPeerConfiguration) SetPeerAddress(v string) *TransitGatewayConnectPeerConfiguration { + s.PeerAddress = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *TransitGatewayConnectPeerConfiguration) SetProtocol(v string) *TransitGatewayConnectPeerConfiguration { + s.Protocol = &v + return s +} + +// SetTransitGatewayAddress sets the TransitGatewayAddress field's value. +func (s *TransitGatewayConnectPeerConfiguration) SetTransitGatewayAddress(v string) *TransitGatewayConnectPeerConfiguration { + s.TransitGatewayAddress = &v + return s +} + +// The BGP options for the Connect attachment. +type TransitGatewayConnectRequestBgpOptions struct { + _ struct{} `type:"structure"` + + // The peer Autonomous System Number (ASN). + PeerAsn *int64 `type:"long"` +} + +// String returns the string representation +func (s TransitGatewayConnectRequestBgpOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayConnectRequestBgpOptions) GoString() string { + return s.String() +} + +// SetPeerAsn sets the PeerAsn field's value. +func (s *TransitGatewayConnectRequestBgpOptions) SetPeerAsn(v int64) *TransitGatewayConnectRequestBgpOptions { + s.PeerAsn = &v + return s +} + // Describes the deregistered transit gateway multicast group members. type TransitGatewayMulticastDeregisteredGroupMembers struct { _ struct{} `type:"structure"` @@ -111603,6 +119291,12 @@ type TransitGatewayMulticastDomain struct { // The time the transit gateway multicast domain was created. CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` + // The options for the transit gateway multicast domain. + Options *TransitGatewayMulticastDomainOptions `locationName:"options" type:"structure"` + + // The ID of the AWS account that owns the transit gateway multiicast domain. + OwnerId *string `locationName:"ownerId" type:"string"` + // The state of the transit gateway multicast domain. State *string `locationName:"state" type:"string" enum:"TransitGatewayMulticastDomainState"` @@ -111612,6 +119306,9 @@ type TransitGatewayMulticastDomain struct { // The ID of the transit gateway. TransitGatewayId *string `locationName:"transitGatewayId" type:"string"` + // The Amazon Resource Name (ARN) of the transit gateway multicast domain. + TransitGatewayMulticastDomainArn *string `locationName:"transitGatewayMulticastDomainArn" type:"string"` + // The ID of the transit gateway multicast domain. TransitGatewayMulticastDomainId *string `locationName:"transitGatewayMulticastDomainId" type:"string"` } @@ -111632,6 +119329,18 @@ func (s *TransitGatewayMulticastDomain) SetCreationTime(v time.Time) *TransitGat return s } +// SetOptions sets the Options field's value. +func (s *TransitGatewayMulticastDomain) SetOptions(v *TransitGatewayMulticastDomainOptions) *TransitGatewayMulticastDomain { + s.Options = v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *TransitGatewayMulticastDomain) SetOwnerId(v string) *TransitGatewayMulticastDomain { + s.OwnerId = &v + return s +} + // SetState sets the State field's value. func (s *TransitGatewayMulticastDomain) SetState(v string) *TransitGatewayMulticastDomain { s.State = &v @@ -111650,6 +119359,12 @@ func (s *TransitGatewayMulticastDomain) SetTransitGatewayId(v string) *TransitGa return s } +// SetTransitGatewayMulticastDomainArn sets the TransitGatewayMulticastDomainArn field's value. +func (s *TransitGatewayMulticastDomain) SetTransitGatewayMulticastDomainArn(v string) *TransitGatewayMulticastDomain { + s.TransitGatewayMulticastDomainArn = &v + return s +} + // SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. func (s *TransitGatewayMulticastDomain) SetTransitGatewayMulticastDomainId(v string) *TransitGatewayMulticastDomain { s.TransitGatewayMulticastDomainId = &v @@ -111663,6 +119378,10 @@ type TransitGatewayMulticastDomainAssociation struct { // The ID of the resource. ResourceId *string `locationName:"resourceId" type:"string"` + // The ID of the AWS account that owns the transit gateway multicast domain + // association resource. + ResourceOwnerId *string `locationName:"resourceOwnerId" type:"string"` + // The type of resource, for example a VPC attachment. ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` @@ -111689,6 +119408,12 @@ func (s *TransitGatewayMulticastDomainAssociation) SetResourceId(v string) *Tran return s } +// SetResourceOwnerId sets the ResourceOwnerId field's value. +func (s *TransitGatewayMulticastDomainAssociation) SetResourceOwnerId(v string) *TransitGatewayMulticastDomainAssociation { + s.ResourceOwnerId = &v + return s +} + // SetResourceType sets the ResourceType field's value. func (s *TransitGatewayMulticastDomainAssociation) SetResourceType(v string) *TransitGatewayMulticastDomainAssociation { s.ResourceType = &v @@ -111714,6 +119439,9 @@ type TransitGatewayMulticastDomainAssociations struct { // The ID of the resource. ResourceId *string `locationName:"resourceId" type:"string"` + // The ID of the AWS account that owns the resource. + ResourceOwnerId *string `locationName:"resourceOwnerId" type:"string"` + // The type of resource, for example a VPC attachment. ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` @@ -111743,6 +119471,12 @@ func (s *TransitGatewayMulticastDomainAssociations) SetResourceId(v string) *Tra return s } +// SetResourceOwnerId sets the ResourceOwnerId field's value. +func (s *TransitGatewayMulticastDomainAssociations) SetResourceOwnerId(v string) *TransitGatewayMulticastDomainAssociations { + s.ResourceOwnerId = &v + return s +} + // SetResourceType sets the ResourceType field's value. func (s *TransitGatewayMulticastDomainAssociations) SetResourceType(v string) *TransitGatewayMulticastDomainAssociations { s.ResourceType = &v @@ -111767,6 +119501,51 @@ func (s *TransitGatewayMulticastDomainAssociations) SetTransitGatewayMulticastDo return s } +// Describes the options for a transit gateway multicast domain. +type TransitGatewayMulticastDomainOptions struct { + _ struct{} `type:"structure"` + + // Indicates whether to automatically cross-account subnet associations that + // are associated with the transit gateway multicast domain. + AutoAcceptSharedAssociations *string `locationName:"autoAcceptSharedAssociations" type:"string" enum:"AutoAcceptSharedAssociationsValue"` + + // Indicates whether Internet Group Management Protocol (IGMP) version 2 is + // turned on for the transit gateway multicast domain. + Igmpv2Support *string `locationName:"igmpv2Support" type:"string" enum:"Igmpv2SupportValue"` + + // Indicates whether support for statically configuring transit gateway multicast + // group sources is turned on. + StaticSourcesSupport *string `locationName:"staticSourcesSupport" type:"string" enum:"StaticSourcesSupportValue"` +} + +// String returns the string representation +func (s TransitGatewayMulticastDomainOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayMulticastDomainOptions) GoString() string { + return s.String() +} + +// SetAutoAcceptSharedAssociations sets the AutoAcceptSharedAssociations field's value. +func (s *TransitGatewayMulticastDomainOptions) SetAutoAcceptSharedAssociations(v string) *TransitGatewayMulticastDomainOptions { + s.AutoAcceptSharedAssociations = &v + return s +} + +// SetIgmpv2Support sets the Igmpv2Support field's value. +func (s *TransitGatewayMulticastDomainOptions) SetIgmpv2Support(v string) *TransitGatewayMulticastDomainOptions { + s.Igmpv2Support = &v + return s +} + +// SetStaticSourcesSupport sets the StaticSourcesSupport field's value. +func (s *TransitGatewayMulticastDomainOptions) SetStaticSourcesSupport(v string) *TransitGatewayMulticastDomainOptions { + s.StaticSourcesSupport = &v + return s +} + // Describes the transit gateway multicast group resources. type TransitGatewayMulticastGroup struct { _ struct{} `type:"structure"` @@ -111789,6 +119568,10 @@ type TransitGatewayMulticastGroup struct { // The ID of the resource. ResourceId *string `locationName:"resourceId" type:"string"` + // The ID of the AWS account that owns the transit gateway multicast domain + // group resource. + ResourceOwnerId *string `locationName:"resourceOwnerId" type:"string"` + // The type of resource, for example a VPC attachment. ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` @@ -111848,6 +119631,12 @@ func (s *TransitGatewayMulticastGroup) SetResourceId(v string) *TransitGatewayMu return s } +// SetResourceOwnerId sets the ResourceOwnerId field's value. +func (s *TransitGatewayMulticastGroup) SetResourceOwnerId(v string) *TransitGatewayMulticastGroup { + s.ResourceOwnerId = &v + return s +} + // SetResourceType sets the ResourceType field's value. func (s *TransitGatewayMulticastGroup) SetResourceType(v string) *TransitGatewayMulticastGroup { s.ResourceType = &v @@ -111989,6 +119778,9 @@ type TransitGatewayOptions struct { // The ID of the default propagation route table. PropagationDefaultRouteTableId *string `locationName:"propagationDefaultRouteTableId" type:"string"` + // The transit gateway CIDR blocks. + TransitGatewayCidrBlocks []*string `locationName:"transitGatewayCidrBlocks" locationNameList:"item" type:"list"` + // Indicates whether Equal Cost Multipath Protocol support is enabled. VpnEcmpSupport *string `locationName:"vpnEcmpSupport" type:"string" enum:"VpnEcmpSupportValue"` } @@ -112051,6 +119843,12 @@ func (s *TransitGatewayOptions) SetPropagationDefaultRouteTableId(v string) *Tra return s } +// SetTransitGatewayCidrBlocks sets the TransitGatewayCidrBlocks field's value. +func (s *TransitGatewayOptions) SetTransitGatewayCidrBlocks(v []*string) *TransitGatewayOptions { + s.TransitGatewayCidrBlocks = v + return s +} + // SetVpnEcmpSupport sets the VpnEcmpSupport field's value. func (s *TransitGatewayOptions) SetVpnEcmpSupport(v string) *TransitGatewayOptions { s.VpnEcmpSupport = &v @@ -112334,6 +120132,11 @@ type TransitGatewayRequestOptions struct { // Indicates whether multicast is enabled on the transit gateway MulticastSupport *string `type:"string" enum:"MulticastSupportValue"` + // One or more IPv4 or IPv6 CIDR blocks for the transit gateway. Must be a size + // /24 CIDR block or larger for IPv4, or a size /64 CIDR block or larger for + // IPv6. + TransitGatewayCidrBlocks []*string `locationNameList:"item" type:"list"` + // Enable or disable Equal Cost Multipath Protocol support. Enabled by default. VpnEcmpSupport *string `type:"string" enum:"VpnEcmpSupportValue"` } @@ -112384,6 +120187,12 @@ func (s *TransitGatewayRequestOptions) SetMulticastSupport(v string) *TransitGat return s } +// SetTransitGatewayCidrBlocks sets the TransitGatewayCidrBlocks field's value. +func (s *TransitGatewayRequestOptions) SetTransitGatewayCidrBlocks(v []*string) *TransitGatewayRequestOptions { + s.TransitGatewayCidrBlocks = v + return s +} + // SetVpnEcmpSupport sets the VpnEcmpSupport field's value. func (s *TransitGatewayRequestOptions) SetVpnEcmpSupport(v string) *TransitGatewayRequestOptions { s.VpnEcmpSupport = &v @@ -113953,22 +121762,10 @@ type Volume struct { // Indicates whether the volume was created using fast snapshot restore. FastRestored *bool `locationName:"fastRestored" type:"boolean"` - // The number of I/O operations per second (IOPS) that the volume supports. - // For Provisioned IOPS SSD volumes, this represents the number of IOPS that - // are provisioned for the volume. For General Purpose SSD volumes, this represents - // the baseline performance of the volume and the rate at which the volume accumulates - // I/O credits for bursting. For more information, see Amazon EBS volume types - // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000 IOPS - // for io1 and io2 volumes, in most Regions. The maximum IOPS for io1 and io2 - // of 64,000 is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). - // Other instance families guarantee performance up to 32,000 IOPS. - // - // Condition: This parameter is required for requests to create io1 and io2 - // volumes; it is not used in requests to create gp2, st1, sc1, or standard - // volumes. + // The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes, + // this represents the number of IOPS that are provisioned for the volume. For + // gp2 volumes, this represents the baseline performance of the volume and the + // rate at which the volume accumulates I/O credits for bursting. Iops *int64 `locationName:"iops" type:"integer"` // The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) @@ -113994,12 +121791,13 @@ type Volume struct { // Any tags assigned to the volume. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The throughput that the volume supports, in MiB/s. + Throughput *int64 `locationName:"throughput" type:"integer"` + // The ID of the volume. VolumeId *string `locationName:"volumeId" type:"string"` - // The volume type. This can be gp2 for General Purpose SSD, io1 or io2 for - // Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, - // or standard for Magnetic volumes. + // The volume type. VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` } @@ -114091,6 +121889,12 @@ func (s *Volume) SetTags(v []*Tag) *Volume { return s } +// SetThroughput sets the Throughput field's value. +func (s *Volume) SetThroughput(v int64) *Volume { + s.Throughput = &v + return s +} + // SetVolumeId sets the VolumeId field's value. func (s *Volume) SetVolumeId(v string) *Volume { s.VolumeId = &v @@ -114227,9 +122031,15 @@ type VolumeModification struct { // The original IOPS rate of the volume. OriginalIops *int64 `locationName:"originalIops" type:"integer"` + // The original setting for Amazon EBS Multi-Attach. + OriginalMultiAttachEnabled *bool `locationName:"originalMultiAttachEnabled" type:"boolean"` + // The original size of the volume, in GiB. OriginalSize *int64 `locationName:"originalSize" type:"integer"` + // The original throughput of the volume, in MiB/s. + OriginalThroughput *int64 `locationName:"originalThroughput" type:"integer"` + // The original EBS volume type of the volume. OriginalVolumeType *string `locationName:"originalVolumeType" type:"string" enum:"VolumeType"` @@ -114245,9 +122055,15 @@ type VolumeModification struct { // The target IOPS rate of the volume. TargetIops *int64 `locationName:"targetIops" type:"integer"` + // The target setting for Amazon EBS Multi-Attach. + TargetMultiAttachEnabled *bool `locationName:"targetMultiAttachEnabled" type:"boolean"` + // The target size of the volume, in GiB. TargetSize *int64 `locationName:"targetSize" type:"integer"` + // The target throughput of the volume, in MiB/s. + TargetThroughput *int64 `locationName:"targetThroughput" type:"integer"` + // The target EBS volume type of the volume. TargetVolumeType *string `locationName:"targetVolumeType" type:"string" enum:"VolumeType"` @@ -114283,12 +122099,24 @@ func (s *VolumeModification) SetOriginalIops(v int64) *VolumeModification { return s } +// SetOriginalMultiAttachEnabled sets the OriginalMultiAttachEnabled field's value. +func (s *VolumeModification) SetOriginalMultiAttachEnabled(v bool) *VolumeModification { + s.OriginalMultiAttachEnabled = &v + return s +} + // SetOriginalSize sets the OriginalSize field's value. func (s *VolumeModification) SetOriginalSize(v int64) *VolumeModification { s.OriginalSize = &v return s } +// SetOriginalThroughput sets the OriginalThroughput field's value. +func (s *VolumeModification) SetOriginalThroughput(v int64) *VolumeModification { + s.OriginalThroughput = &v + return s +} + // SetOriginalVolumeType sets the OriginalVolumeType field's value. func (s *VolumeModification) SetOriginalVolumeType(v string) *VolumeModification { s.OriginalVolumeType = &v @@ -114319,12 +122147,24 @@ func (s *VolumeModification) SetTargetIops(v int64) *VolumeModification { return s } +// SetTargetMultiAttachEnabled sets the TargetMultiAttachEnabled field's value. +func (s *VolumeModification) SetTargetMultiAttachEnabled(v bool) *VolumeModification { + s.TargetMultiAttachEnabled = &v + return s +} + // SetTargetSize sets the TargetSize field's value. func (s *VolumeModification) SetTargetSize(v int64) *VolumeModification { s.TargetSize = &v return s } +// SetTargetThroughput sets the TargetThroughput field's value. +func (s *VolumeModification) SetTargetThroughput(v int64) *VolumeModification { + s.TargetThroughput = &v + return s +} + // SetTargetVolumeType sets the TargetVolumeType field's value. func (s *VolumeModification) SetTargetVolumeType(v string) *VolumeModification { s.TargetVolumeType = &v @@ -115069,6 +122909,9 @@ type VpcEndpointConnection struct { // The DNS entries for the VPC endpoint. DnsEntries []*DnsEntry `locationName:"dnsEntrySet" locationNameList:"item" type:"list"` + // The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service. + GatewayLoadBalancerArns []*string `locationName:"gatewayLoadBalancerArnSet" locationNameList:"item" type:"list"` + // The Amazon Resource Names (ARNs) of the network load balancers for the service. NetworkLoadBalancerArns []*string `locationName:"networkLoadBalancerArnSet" locationNameList:"item" type:"list"` @@ -115107,6 +122950,12 @@ func (s *VpcEndpointConnection) SetDnsEntries(v []*DnsEntry) *VpcEndpointConnect return s } +// SetGatewayLoadBalancerArns sets the GatewayLoadBalancerArns field's value. +func (s *VpcEndpointConnection) SetGatewayLoadBalancerArns(v []*string) *VpcEndpointConnection { + s.GatewayLoadBalancerArns = v + return s +} + // SetNetworkLoadBalancerArns sets the NetworkLoadBalancerArns field's value. func (s *VpcEndpointConnection) SetNetworkLoadBalancerArns(v []*string) *VpcEndpointConnection { s.NetworkLoadBalancerArns = v @@ -116241,6 +124090,18 @@ func ActivityStatus_Values() []string { } } +const ( + // AddressAttributeNameDomainName is a AddressAttributeName enum value + AddressAttributeNameDomainName = "domain-name" +) + +// AddressAttributeName_Values returns all elements of the AddressAttributeName enum +func AddressAttributeName_Values() []string { + return []string{ + AddressAttributeNameDomainName, + } +} + const ( // AffinityDefault is a Affinity enum value AffinityDefault = "default" @@ -116298,6 +124159,9 @@ const ( // AllocationStrategyCapacityOptimized is a AllocationStrategy enum value AllocationStrategyCapacityOptimized = "capacityOptimized" + + // AllocationStrategyCapacityOptimizedPrioritized is a AllocationStrategy enum value + AllocationStrategyCapacityOptimizedPrioritized = "capacityOptimizedPrioritized" ) // AllocationStrategy_Values returns all elements of the AllocationStrategy enum @@ -116306,6 +124170,7 @@ func AllocationStrategy_Values() []string { AllocationStrategyLowestPrice, AllocationStrategyDiversified, AllocationStrategyCapacityOptimized, + AllocationStrategyCapacityOptimizedPrioritized, } } @@ -116325,6 +124190,26 @@ func AllowsMultipleInstanceTypes_Values() []string { } } +const ( + // AnalysisStatusRunning is a AnalysisStatus enum value + AnalysisStatusRunning = "running" + + // AnalysisStatusSucceeded is a AnalysisStatus enum value + AnalysisStatusSucceeded = "succeeded" + + // AnalysisStatusFailed is a AnalysisStatus enum value + AnalysisStatusFailed = "failed" +) + +// AnalysisStatus_Values returns all elements of the AnalysisStatus enum +func AnalysisStatus_Values() []string { + return []string{ + AnalysisStatusRunning, + AnalysisStatusSucceeded, + AnalysisStatusFailed, + } +} + const ( // ApplianceModeSupportValueEnable is a ApplianceModeSupportValue enum value ApplianceModeSupportValueEnable = "enable" @@ -116445,6 +124330,22 @@ func AttachmentStatus_Values() []string { } } +const ( + // AutoAcceptSharedAssociationsValueEnable is a AutoAcceptSharedAssociationsValue enum value + AutoAcceptSharedAssociationsValueEnable = "enable" + + // AutoAcceptSharedAssociationsValueDisable is a AutoAcceptSharedAssociationsValue enum value + AutoAcceptSharedAssociationsValueDisable = "disable" +) + +// AutoAcceptSharedAssociationsValue_Values returns all elements of the AutoAcceptSharedAssociationsValue enum +func AutoAcceptSharedAssociationsValue_Values() []string { + return []string{ + AutoAcceptSharedAssociationsValueEnable, + AutoAcceptSharedAssociationsValueDisable, + } +} + const ( // AutoAcceptSharedAttachmentsValueEnable is a AutoAcceptSharedAttachmentsValue enum value AutoAcceptSharedAttachmentsValueEnable = "enable" @@ -116557,6 +124458,54 @@ func BatchState_Values() []string { } } +const ( + // BgpStatusUp is a BgpStatus enum value + BgpStatusUp = "up" + + // BgpStatusDown is a BgpStatus enum value + BgpStatusDown = "down" +) + +// BgpStatus_Values returns all elements of the BgpStatus enum +func BgpStatus_Values() []string { + return []string{ + BgpStatusUp, + BgpStatusDown, + } +} + +const ( + // BootModeTypeLegacyBios is a BootModeType enum value + BootModeTypeLegacyBios = "legacy-bios" + + // BootModeTypeUefi is a BootModeType enum value + BootModeTypeUefi = "uefi" +) + +// BootModeType_Values returns all elements of the BootModeType enum +func BootModeType_Values() []string { + return []string{ + BootModeTypeLegacyBios, + BootModeTypeUefi, + } +} + +const ( + // BootModeValuesLegacyBios is a BootModeValues enum value + BootModeValuesLegacyBios = "legacy-bios" + + // BootModeValuesUefi is a BootModeValues enum value + BootModeValuesUefi = "uefi" +) + +// BootModeValues_Values returns all elements of the BootModeValues enum +func BootModeValues_Values() []string { + return []string{ + BootModeValuesLegacyBios, + BootModeValuesUefi, + } +} + const ( // BundleTaskStatePending is a BundleTaskState enum value BundleTaskStatePending = "pending" @@ -117873,6 +125822,22 @@ func IamInstanceProfileAssociationState_Values() []string { } } +const ( + // Igmpv2SupportValueEnable is a Igmpv2SupportValue enum value + Igmpv2SupportValueEnable = "enable" + + // Igmpv2SupportValueDisable is a Igmpv2SupportValue enum value + Igmpv2SupportValueDisable = "disable" +) + +// Igmpv2SupportValue_Values returns all elements of the Igmpv2SupportValue enum +func Igmpv2SupportValue_Values() []string { + return []string{ + Igmpv2SupportValueEnable, + Igmpv2SupportValueDisable, + } +} + const ( // ImageAttributeNameDescription is a ImageAttributeName enum value ImageAttributeNameDescription = "description" @@ -117894,6 +125859,9 @@ const ( // ImageAttributeNameSriovNetSupport is a ImageAttributeName enum value ImageAttributeNameSriovNetSupport = "sriovNetSupport" + + // ImageAttributeNameBootMode is a ImageAttributeName enum value + ImageAttributeNameBootMode = "bootMode" ) // ImageAttributeName_Values returns all elements of the ImageAttributeName enum @@ -117906,6 +125874,7 @@ func ImageAttributeName_Values() []string { ImageAttributeNameProductCodes, ImageAttributeNameBlockDeviceMapping, ImageAttributeNameSriovNetSupport, + ImageAttributeNameBootMode, } } @@ -118407,6 +126376,33 @@ const ( // InstanceTypeR5a24xlarge is a InstanceType enum value InstanceTypeR5a24xlarge = "r5a.24xlarge" + // InstanceTypeR5bLarge is a InstanceType enum value + InstanceTypeR5bLarge = "r5b.large" + + // InstanceTypeR5bXlarge is a InstanceType enum value + InstanceTypeR5bXlarge = "r5b.xlarge" + + // InstanceTypeR5b2xlarge is a InstanceType enum value + InstanceTypeR5b2xlarge = "r5b.2xlarge" + + // InstanceTypeR5b4xlarge is a InstanceType enum value + InstanceTypeR5b4xlarge = "r5b.4xlarge" + + // InstanceTypeR5b8xlarge is a InstanceType enum value + InstanceTypeR5b8xlarge = "r5b.8xlarge" + + // InstanceTypeR5b12xlarge is a InstanceType enum value + InstanceTypeR5b12xlarge = "r5b.12xlarge" + + // InstanceTypeR5b16xlarge is a InstanceType enum value + InstanceTypeR5b16xlarge = "r5b.16xlarge" + + // InstanceTypeR5b24xlarge is a InstanceType enum value + InstanceTypeR5b24xlarge = "r5b.24xlarge" + + // InstanceTypeR5bMetal is a InstanceType enum value + InstanceTypeR5bMetal = "r5b.metal" + // InstanceTypeR5dLarge is a InstanceType enum value InstanceTypeR5dLarge = "r5d.large" @@ -118755,6 +126751,9 @@ const ( // InstanceTypeC5n18xlarge is a InstanceType enum value InstanceTypeC5n18xlarge = "c5n.18xlarge" + // InstanceTypeC5nMetal is a InstanceType enum value + InstanceTypeC5nMetal = "c5n.metal" + // InstanceTypeC6gMetal is a InstanceType enum value InstanceTypeC6gMetal = "c6g.metal" @@ -118809,6 +126808,30 @@ const ( // InstanceTypeC6gd16xlarge is a InstanceType enum value InstanceTypeC6gd16xlarge = "c6gd.16xlarge" + // InstanceTypeC6gnMedium is a InstanceType enum value + InstanceTypeC6gnMedium = "c6gn.medium" + + // InstanceTypeC6gnLarge is a InstanceType enum value + InstanceTypeC6gnLarge = "c6gn.large" + + // InstanceTypeC6gnXlarge is a InstanceType enum value + InstanceTypeC6gnXlarge = "c6gn.xlarge" + + // InstanceTypeC6gn2xlarge is a InstanceType enum value + InstanceTypeC6gn2xlarge = "c6gn.2xlarge" + + // InstanceTypeC6gn4xlarge is a InstanceType enum value + InstanceTypeC6gn4xlarge = "c6gn.4xlarge" + + // InstanceTypeC6gn8xlarge is a InstanceType enum value + InstanceTypeC6gn8xlarge = "c6gn.8xlarge" + + // InstanceTypeC6gn12xlarge is a InstanceType enum value + InstanceTypeC6gn12xlarge = "c6gn.12xlarge" + + // InstanceTypeC6gn16xlarge is a InstanceType enum value + InstanceTypeC6gn16xlarge = "c6gn.16xlarge" + // InstanceTypeCc14xlarge is a InstanceType enum value InstanceTypeCc14xlarge = "cc1.4xlarge" @@ -118833,6 +126856,15 @@ const ( // InstanceTypeG3sXlarge is a InstanceType enum value InstanceTypeG3sXlarge = "g3s.xlarge" + // InstanceTypeG4ad4xlarge is a InstanceType enum value + InstanceTypeG4ad4xlarge = "g4ad.4xlarge" + + // InstanceTypeG4ad8xlarge is a InstanceType enum value + InstanceTypeG4ad8xlarge = "g4ad.8xlarge" + + // InstanceTypeG4ad16xlarge is a InstanceType enum value + InstanceTypeG4ad16xlarge = "g4ad.16xlarge" + // InstanceTypeG4dnXlarge is a InstanceType enum value InstanceTypeG4dnXlarge = "g4dn.xlarge" @@ -118893,6 +126925,36 @@ const ( // InstanceTypeD28xlarge is a InstanceType enum value InstanceTypeD28xlarge = "d2.8xlarge" + // InstanceTypeD3Xlarge is a InstanceType enum value + InstanceTypeD3Xlarge = "d3.xlarge" + + // InstanceTypeD32xlarge is a InstanceType enum value + InstanceTypeD32xlarge = "d3.2xlarge" + + // InstanceTypeD34xlarge is a InstanceType enum value + InstanceTypeD34xlarge = "d3.4xlarge" + + // InstanceTypeD38xlarge is a InstanceType enum value + InstanceTypeD38xlarge = "d3.8xlarge" + + // InstanceTypeD3enXlarge is a InstanceType enum value + InstanceTypeD3enXlarge = "d3en.xlarge" + + // InstanceTypeD3en2xlarge is a InstanceType enum value + InstanceTypeD3en2xlarge = "d3en.2xlarge" + + // InstanceTypeD3en4xlarge is a InstanceType enum value + InstanceTypeD3en4xlarge = "d3en.4xlarge" + + // InstanceTypeD3en6xlarge is a InstanceType enum value + InstanceTypeD3en6xlarge = "d3en.6xlarge" + + // InstanceTypeD3en8xlarge is a InstanceType enum value + InstanceTypeD3en8xlarge = "d3en.8xlarge" + + // InstanceTypeD3en12xlarge is a InstanceType enum value + InstanceTypeD3en12xlarge = "d3en.12xlarge" + // InstanceTypeF12xlarge is a InstanceType enum value InstanceTypeF12xlarge = "f1.2xlarge" @@ -119004,6 +127066,27 @@ const ( // InstanceTypeM5ad24xlarge is a InstanceType enum value InstanceTypeM5ad24xlarge = "m5ad.24xlarge" + // InstanceTypeM5znLarge is a InstanceType enum value + InstanceTypeM5znLarge = "m5zn.large" + + // InstanceTypeM5znXlarge is a InstanceType enum value + InstanceTypeM5znXlarge = "m5zn.xlarge" + + // InstanceTypeM5zn2xlarge is a InstanceType enum value + InstanceTypeM5zn2xlarge = "m5zn.2xlarge" + + // InstanceTypeM5zn3xlarge is a InstanceType enum value + InstanceTypeM5zn3xlarge = "m5zn.3xlarge" + + // InstanceTypeM5zn6xlarge is a InstanceType enum value + InstanceTypeM5zn6xlarge = "m5zn.6xlarge" + + // InstanceTypeM5zn12xlarge is a InstanceType enum value + InstanceTypeM5zn12xlarge = "m5zn.12xlarge" + + // InstanceTypeM5znMetal is a InstanceType enum value + InstanceTypeM5znMetal = "m5zn.metal" + // InstanceTypeH12xlarge is a InstanceType enum value InstanceTypeH12xlarge = "h1.2xlarge" @@ -119037,6 +127120,18 @@ const ( // InstanceTypeZ1dMetal is a InstanceType enum value InstanceTypeZ1dMetal = "z1d.metal" + // InstanceTypeU6tb156xlarge is a InstanceType enum value + InstanceTypeU6tb156xlarge = "u-6tb1.56xlarge" + + // InstanceTypeU6tb1112xlarge is a InstanceType enum value + InstanceTypeU6tb1112xlarge = "u-6tb1.112xlarge" + + // InstanceTypeU9tb1112xlarge is a InstanceType enum value + InstanceTypeU9tb1112xlarge = "u-9tb1.112xlarge" + + // InstanceTypeU12tb1112xlarge is a InstanceType enum value + InstanceTypeU12tb1112xlarge = "u-12tb1.112xlarge" + // InstanceTypeU6tb1Metal is a InstanceType enum value InstanceTypeU6tb1Metal = "u-6tb1.metal" @@ -119231,6 +127326,36 @@ const ( // InstanceTypeM6gd16xlarge is a InstanceType enum value InstanceTypeM6gd16xlarge = "m6gd.16xlarge" + + // InstanceTypeMac1Metal is a InstanceType enum value + InstanceTypeMac1Metal = "mac1.metal" + + // InstanceTypeX2gdMedium is a InstanceType enum value + InstanceTypeX2gdMedium = "x2gd.medium" + + // InstanceTypeX2gdLarge is a InstanceType enum value + InstanceTypeX2gdLarge = "x2gd.large" + + // InstanceTypeX2gdXlarge is a InstanceType enum value + InstanceTypeX2gdXlarge = "x2gd.xlarge" + + // InstanceTypeX2gd2xlarge is a InstanceType enum value + InstanceTypeX2gd2xlarge = "x2gd.2xlarge" + + // InstanceTypeX2gd4xlarge is a InstanceType enum value + InstanceTypeX2gd4xlarge = "x2gd.4xlarge" + + // InstanceTypeX2gd8xlarge is a InstanceType enum value + InstanceTypeX2gd8xlarge = "x2gd.8xlarge" + + // InstanceTypeX2gd12xlarge is a InstanceType enum value + InstanceTypeX2gd12xlarge = "x2gd.12xlarge" + + // InstanceTypeX2gd16xlarge is a InstanceType enum value + InstanceTypeX2gd16xlarge = "x2gd.16xlarge" + + // InstanceTypeX2gdMetal is a InstanceType enum value + InstanceTypeX2gdMetal = "x2gd.metal" ) // InstanceType_Values returns all elements of the InstanceType enum @@ -119311,6 +127436,15 @@ func InstanceType_Values() []string { InstanceTypeR5a12xlarge, InstanceTypeR5a16xlarge, InstanceTypeR5a24xlarge, + InstanceTypeR5bLarge, + InstanceTypeR5bXlarge, + InstanceTypeR5b2xlarge, + InstanceTypeR5b4xlarge, + InstanceTypeR5b8xlarge, + InstanceTypeR5b12xlarge, + InstanceTypeR5b16xlarge, + InstanceTypeR5b24xlarge, + InstanceTypeR5bMetal, InstanceTypeR5dLarge, InstanceTypeR5dXlarge, InstanceTypeR5d2xlarge, @@ -119427,6 +127561,7 @@ func InstanceType_Values() []string { InstanceTypeC5n4xlarge, InstanceTypeC5n9xlarge, InstanceTypeC5n18xlarge, + InstanceTypeC5nMetal, InstanceTypeC6gMetal, InstanceTypeC6gMedium, InstanceTypeC6gLarge, @@ -119445,6 +127580,14 @@ func InstanceType_Values() []string { InstanceTypeC6gd8xlarge, InstanceTypeC6gd12xlarge, InstanceTypeC6gd16xlarge, + InstanceTypeC6gnMedium, + InstanceTypeC6gnLarge, + InstanceTypeC6gnXlarge, + InstanceTypeC6gn2xlarge, + InstanceTypeC6gn4xlarge, + InstanceTypeC6gn8xlarge, + InstanceTypeC6gn12xlarge, + InstanceTypeC6gn16xlarge, InstanceTypeCc14xlarge, InstanceTypeCc28xlarge, InstanceTypeG22xlarge, @@ -119453,6 +127596,9 @@ func InstanceType_Values() []string { InstanceTypeG38xlarge, InstanceTypeG316xlarge, InstanceTypeG3sXlarge, + InstanceTypeG4ad4xlarge, + InstanceTypeG4ad8xlarge, + InstanceTypeG4ad16xlarge, InstanceTypeG4dnXlarge, InstanceTypeG4dn2xlarge, InstanceTypeG4dn4xlarge, @@ -119473,6 +127619,16 @@ func InstanceType_Values() []string { InstanceTypeD22xlarge, InstanceTypeD24xlarge, InstanceTypeD28xlarge, + InstanceTypeD3Xlarge, + InstanceTypeD32xlarge, + InstanceTypeD34xlarge, + InstanceTypeD38xlarge, + InstanceTypeD3enXlarge, + InstanceTypeD3en2xlarge, + InstanceTypeD3en4xlarge, + InstanceTypeD3en6xlarge, + InstanceTypeD3en8xlarge, + InstanceTypeD3en12xlarge, InstanceTypeF12xlarge, InstanceTypeF14xlarge, InstanceTypeF116xlarge, @@ -119510,6 +127666,13 @@ func InstanceType_Values() []string { InstanceTypeM5ad12xlarge, InstanceTypeM5ad16xlarge, InstanceTypeM5ad24xlarge, + InstanceTypeM5znLarge, + InstanceTypeM5znXlarge, + InstanceTypeM5zn2xlarge, + InstanceTypeM5zn3xlarge, + InstanceTypeM5zn6xlarge, + InstanceTypeM5zn12xlarge, + InstanceTypeM5znMetal, InstanceTypeH12xlarge, InstanceTypeH14xlarge, InstanceTypeH18xlarge, @@ -119521,6 +127684,10 @@ func InstanceType_Values() []string { InstanceTypeZ1d6xlarge, InstanceTypeZ1d12xlarge, InstanceTypeZ1dMetal, + InstanceTypeU6tb156xlarge, + InstanceTypeU6tb1112xlarge, + InstanceTypeU9tb1112xlarge, + InstanceTypeU12tb1112xlarge, InstanceTypeU6tb1Metal, InstanceTypeU9tb1Metal, InstanceTypeU12tb1Metal, @@ -119586,6 +127753,16 @@ func InstanceType_Values() []string { InstanceTypeM6gd8xlarge, InstanceTypeM6gd12xlarge, InstanceTypeM6gd16xlarge, + InstanceTypeMac1Metal, + InstanceTypeX2gdMedium, + InstanceTypeX2gdLarge, + InstanceTypeX2gdXlarge, + InstanceTypeX2gd2xlarge, + InstanceTypeX2gd4xlarge, + InstanceTypeX2gd8xlarge, + InstanceTypeX2gd12xlarge, + InstanceTypeX2gd16xlarge, + InstanceTypeX2gdMetal, } } @@ -120161,6 +128338,30 @@ func OperationType_Values() []string { } } +const ( + // PartitionLoadFrequencyNone is a PartitionLoadFrequency enum value + PartitionLoadFrequencyNone = "none" + + // PartitionLoadFrequencyDaily is a PartitionLoadFrequency enum value + PartitionLoadFrequencyDaily = "daily" + + // PartitionLoadFrequencyWeekly is a PartitionLoadFrequency enum value + PartitionLoadFrequencyWeekly = "weekly" + + // PartitionLoadFrequencyMonthly is a PartitionLoadFrequency enum value + PartitionLoadFrequencyMonthly = "monthly" +) + +// PartitionLoadFrequency_Values returns all elements of the PartitionLoadFrequency enum +func PartitionLoadFrequency_Values() []string { + return []string{ + PartitionLoadFrequencyNone, + PartitionLoadFrequencyDaily, + PartitionLoadFrequencyWeekly, + PartitionLoadFrequencyMonthly, + } +} + const ( // PaymentOptionAllUpfront is a PaymentOption enum value PaymentOptionAllUpfront = "AllUpfront" @@ -120373,6 +128574,34 @@ func ProductCodeValues_Values() []string { } } +const ( + // ProtocolTcp is a Protocol enum value + ProtocolTcp = "tcp" + + // ProtocolUdp is a Protocol enum value + ProtocolUdp = "udp" +) + +// Protocol_Values returns all elements of the Protocol enum +func Protocol_Values() []string { + return []string{ + ProtocolTcp, + ProtocolUdp, + } +} + +const ( + // ProtocolValueGre is a ProtocolValue enum value + ProtocolValueGre = "gre" +) + +// ProtocolValue_Values returns all elements of the ProtocolValue enum +func ProtocolValue_Values() []string { + return []string{ + ProtocolValueGre, + } +} + const ( // RIProductDescriptionLinuxUnix is a RIProductDescription enum value RIProductDescriptionLinuxUnix = "Linux/UNIX" @@ -120409,6 +128638,38 @@ func RecurringChargeFrequency_Values() []string { } } +const ( + // ReplaceRootVolumeTaskStatePending is a ReplaceRootVolumeTaskState enum value + ReplaceRootVolumeTaskStatePending = "pending" + + // ReplaceRootVolumeTaskStateInProgress is a ReplaceRootVolumeTaskState enum value + ReplaceRootVolumeTaskStateInProgress = "in-progress" + + // ReplaceRootVolumeTaskStateFailing is a ReplaceRootVolumeTaskState enum value + ReplaceRootVolumeTaskStateFailing = "failing" + + // ReplaceRootVolumeTaskStateSucceeded is a ReplaceRootVolumeTaskState enum value + ReplaceRootVolumeTaskStateSucceeded = "succeeded" + + // ReplaceRootVolumeTaskStateFailed is a ReplaceRootVolumeTaskState enum value + ReplaceRootVolumeTaskStateFailed = "failed" + + // ReplaceRootVolumeTaskStateFailedDetached is a ReplaceRootVolumeTaskState enum value + ReplaceRootVolumeTaskStateFailedDetached = "failed-detached" +) + +// ReplaceRootVolumeTaskState_Values returns all elements of the ReplaceRootVolumeTaskState enum +func ReplaceRootVolumeTaskState_Values() []string { + return []string{ + ReplaceRootVolumeTaskStatePending, + ReplaceRootVolumeTaskStateInProgress, + ReplaceRootVolumeTaskStateFailing, + ReplaceRootVolumeTaskStateSucceeded, + ReplaceRootVolumeTaskStateFailed, + ReplaceRootVolumeTaskStateFailedDetached, + } +} + const ( // ReplacementStrategyLaunch is a ReplacementStrategy enum value ReplacementStrategyLaunch = "launch" @@ -120631,6 +128892,12 @@ const ( // ResourceTypeNetworkInterface is a ResourceType enum value ResourceTypeNetworkInterface = "network-interface" + // ResourceTypeNetworkInsightsAnalysis is a ResourceType enum value + ResourceTypeNetworkInsightsAnalysis = "network-insights-analysis" + + // ResourceTypeNetworkInsightsPath is a ResourceType enum value + ResourceTypeNetworkInsightsPath = "network-insights-path" + // ResourceTypePlacementGroup is a ResourceType enum value ResourceTypePlacementGroup = "placement-group" @@ -120670,6 +128937,9 @@ const ( // ResourceTypeTransitGatewayAttachment is a ResourceType enum value ResourceTypeTransitGatewayAttachment = "transit-gateway-attachment" + // ResourceTypeTransitGatewayConnectPeer is a ResourceType enum value + ResourceTypeTransitGatewayConnectPeer = "transit-gateway-connect-peer" + // ResourceTypeTransitGatewayMulticastDomain is a ResourceType enum value ResourceTypeTransitGatewayMulticastDomain = "transit-gateway-multicast-domain" @@ -120721,6 +128991,8 @@ func ResourceType_Values() []string { ResourceTypeNatgateway, ResourceTypeNetworkAcl, ResourceTypeNetworkInterface, + ResourceTypeNetworkInsightsAnalysis, + ResourceTypeNetworkInsightsPath, ResourceTypePlacementGroup, ResourceTypeReservedInstances, ResourceTypeRouteTable, @@ -120734,6 +129006,7 @@ func ResourceType_Values() []string { ResourceTypeTrafficMirrorTarget, ResourceTypeTransitGateway, ResourceTypeTransitGatewayAttachment, + ResourceTypeTransitGatewayConnectPeer, ResourceTypeTransitGatewayMulticastDomain, ResourceTypeTransitGatewayRouteTable, ResourceTypeVolume, @@ -120907,6 +129180,9 @@ const ( // ServiceTypeGateway is a ServiceType enum value ServiceTypeGateway = "Gateway" + + // ServiceTypeGatewayLoadBalancer is a ServiceType enum value + ServiceTypeGatewayLoadBalancer = "GatewayLoadBalancer" ) // ServiceType_Values returns all elements of the ServiceType enum @@ -120914,6 +129190,7 @@ func ServiceType_Values() []string { return []string{ ServiceTypeInterface, ServiceTypeGateway, + ServiceTypeGatewayLoadBalancer, } } @@ -120978,6 +129255,9 @@ const ( // SpotAllocationStrategyCapacityOptimized is a SpotAllocationStrategy enum value SpotAllocationStrategyCapacityOptimized = "capacity-optimized" + + // SpotAllocationStrategyCapacityOptimizedPrioritized is a SpotAllocationStrategy enum value + SpotAllocationStrategyCapacityOptimizedPrioritized = "capacity-optimized-prioritized" ) // SpotAllocationStrategy_Values returns all elements of the SpotAllocationStrategy enum @@ -120986,6 +129266,7 @@ func SpotAllocationStrategy_Values() []string { SpotAllocationStrategyLowestPrice, SpotAllocationStrategyDiversified, SpotAllocationStrategyCapacityOptimized, + SpotAllocationStrategyCapacityOptimizedPrioritized, } } @@ -121093,6 +129374,22 @@ func State_Values() []string { } } +const ( + // StaticSourcesSupportValueEnable is a StaticSourcesSupportValue enum value + StaticSourcesSupportValueEnable = "enable" + + // StaticSourcesSupportValueDisable is a StaticSourcesSupportValue enum value + StaticSourcesSupportValueDisable = "disable" +) + +// StaticSourcesSupportValue_Values returns all elements of the StaticSourcesSupportValue enum +func StaticSourcesSupportValue_Values() []string { + return []string{ + StaticSourcesSupportValueEnable, + StaticSourcesSupportValueDisable, + } +} + const ( // StatusMoveInProgress is a Status enum value StatusMoveInProgress = "MoveInProgress" @@ -121419,6 +129716,9 @@ const ( // TransitGatewayAttachmentResourceTypeDirectConnectGateway is a TransitGatewayAttachmentResourceType enum value TransitGatewayAttachmentResourceTypeDirectConnectGateway = "direct-connect-gateway" + // TransitGatewayAttachmentResourceTypeConnect is a TransitGatewayAttachmentResourceType enum value + TransitGatewayAttachmentResourceTypeConnect = "connect" + // TransitGatewayAttachmentResourceTypePeering is a TransitGatewayAttachmentResourceType enum value TransitGatewayAttachmentResourceTypePeering = "peering" @@ -121432,6 +129732,7 @@ func TransitGatewayAttachmentResourceType_Values() []string { TransitGatewayAttachmentResourceTypeVpc, TransitGatewayAttachmentResourceTypeVpn, TransitGatewayAttachmentResourceTypeDirectConnectGateway, + TransitGatewayAttachmentResourceTypeConnect, TransitGatewayAttachmentResourceTypePeering, TransitGatewayAttachmentResourceTypeTgwPeering, } @@ -121498,6 +129799,33 @@ func TransitGatewayAttachmentState_Values() []string { } const ( + // TransitGatewayConnectPeerStatePending is a TransitGatewayConnectPeerState enum value + TransitGatewayConnectPeerStatePending = "pending" + + // TransitGatewayConnectPeerStateAvailable is a TransitGatewayConnectPeerState enum value + TransitGatewayConnectPeerStateAvailable = "available" + + // TransitGatewayConnectPeerStateDeleting is a TransitGatewayConnectPeerState enum value + TransitGatewayConnectPeerStateDeleting = "deleting" + + // TransitGatewayConnectPeerStateDeleted is a TransitGatewayConnectPeerState enum value + TransitGatewayConnectPeerStateDeleted = "deleted" +) + +// TransitGatewayConnectPeerState_Values returns all elements of the TransitGatewayConnectPeerState enum +func TransitGatewayConnectPeerState_Values() []string { + return []string{ + TransitGatewayConnectPeerStatePending, + TransitGatewayConnectPeerStateAvailable, + TransitGatewayConnectPeerStateDeleting, + TransitGatewayConnectPeerStateDeleted, + } +} + +const ( + // TransitGatewayMulitcastDomainAssociationStatePendingAcceptance is a TransitGatewayMulitcastDomainAssociationState enum value + TransitGatewayMulitcastDomainAssociationStatePendingAcceptance = "pendingAcceptance" + // TransitGatewayMulitcastDomainAssociationStateAssociating is a TransitGatewayMulitcastDomainAssociationState enum value TransitGatewayMulitcastDomainAssociationStateAssociating = "associating" @@ -121509,15 +129837,24 @@ const ( // TransitGatewayMulitcastDomainAssociationStateDisassociated is a TransitGatewayMulitcastDomainAssociationState enum value TransitGatewayMulitcastDomainAssociationStateDisassociated = "disassociated" + + // TransitGatewayMulitcastDomainAssociationStateRejected is a TransitGatewayMulitcastDomainAssociationState enum value + TransitGatewayMulitcastDomainAssociationStateRejected = "rejected" + + // TransitGatewayMulitcastDomainAssociationStateFailed is a TransitGatewayMulitcastDomainAssociationState enum value + TransitGatewayMulitcastDomainAssociationStateFailed = "failed" ) // TransitGatewayMulitcastDomainAssociationState_Values returns all elements of the TransitGatewayMulitcastDomainAssociationState enum func TransitGatewayMulitcastDomainAssociationState_Values() []string { return []string{ + TransitGatewayMulitcastDomainAssociationStatePendingAcceptance, TransitGatewayMulitcastDomainAssociationStateAssociating, TransitGatewayMulitcastDomainAssociationStateAssociated, TransitGatewayMulitcastDomainAssociationStateDisassociating, TransitGatewayMulitcastDomainAssociationStateDisassociated, + TransitGatewayMulitcastDomainAssociationStateRejected, + TransitGatewayMulitcastDomainAssociationStateFailed, } } @@ -121955,6 +130292,9 @@ const ( // VolumeTypeSt1 is a VolumeType enum value VolumeTypeSt1 = "st1" + + // VolumeTypeGp3 is a VolumeType enum value + VolumeTypeGp3 = "gp3" ) // VolumeType_Values returns all elements of the VolumeType enum @@ -121966,6 +130306,7 @@ func VolumeType_Values() []string { VolumeTypeGp2, VolumeTypeSc1, VolumeTypeSt1, + VolumeTypeGp3, } } @@ -122023,6 +130364,9 @@ const ( // VpcEndpointTypeGateway is a VpcEndpointType enum value VpcEndpointTypeGateway = "Gateway" + + // VpcEndpointTypeGatewayLoadBalancer is a VpcEndpointType enum value + VpcEndpointTypeGatewayLoadBalancer = "GatewayLoadBalancer" ) // VpcEndpointType_Values returns all elements of the VpcEndpointType enum @@ -122030,6 +130374,7 @@ func VpcEndpointType_Values() []string { return []string{ VpcEndpointTypeInterface, VpcEndpointTypeGateway, + VpcEndpointTypeGatewayLoadBalancer, } } diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go index 31c314e0e5f5..47c44cc9df5b 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go @@ -4,8 +4,14 @@ // requests to Amazon Elastic Compute Cloud. // // Amazon Elastic Compute Cloud (Amazon EC2) provides secure and resizable computing -// capacity in the AWS cloud. Using Amazon EC2 eliminates the need to invest +// capacity in the AWS Cloud. Using Amazon EC2 eliminates the need to invest // in hardware up front, so you can develop and deploy applications faster. +// Amazon Virtual Private Cloud (Amazon VPC) enables you to provision a logically +// isolated section of the AWS Cloud where you can launch AWS resources in a +// virtual network that you've defined. Amazon Elastic Block Store (Amazon EBS) +// provides block level storage volumes for use with EC2 instances. EBS volumes +// are highly available and reliable storage volumes that can be attached to +// any running instance and used like a hard drive. // // To learn more, see the following resources: // @@ -13,7 +19,7 @@ // EC2 documentation (http://aws.amazon.com/documentation/ec2) // // * Amazon EBS: Amazon EBS product page (http://aws.amazon.com/ebs), Amazon -// EBS documentation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html) +// EBS documentation (http://aws.amazon.com/documentation/ebs) // // * Amazon VPC: Amazon VPC product page (http://aws.amazon.com/vpc), Amazon // VPC documentation (http://aws.amazon.com/documentation/vpc) diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go index b9bdbde157f4..15b26e741d21 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go @@ -982,7 +982,7 @@ func (c *EC2) WaitUntilSecurityGroupExistsWithContext(ctx aws.Context, input *De { State: request.RetryWaiterState, Matcher: request.ErrorWaiterMatch, - Expected: "InvalidGroupNotFound", + Expected: "InvalidGroup.NotFound", }, }, Logger: c.Config.Logger, diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go index 462b049cc3c5..9f85b3d434d2 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go @@ -604,6 +604,92 @@ func (c *ECR) DeleteLifecyclePolicyWithContext(ctx aws.Context, input *DeleteLif return out, req.Send() } +const opDeleteRegistryPolicy = "DeleteRegistryPolicy" + +// DeleteRegistryPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRegistryPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRegistryPolicy for more information on using the DeleteRegistryPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRegistryPolicyRequest method. +// req, resp := client.DeleteRegistryPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRegistryPolicy +func (c *ECR) DeleteRegistryPolicyRequest(input *DeleteRegistryPolicyInput) (req *request.Request, output *DeleteRegistryPolicyOutput) { + op := &request.Operation{ + Name: opDeleteRegistryPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteRegistryPolicyInput{} + } + + output = &DeleteRegistryPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteRegistryPolicy API operation for Amazon EC2 Container Registry. +// +// Deletes the registry permissions policy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EC2 Container Registry's +// API operation DeleteRegistryPolicy for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * RegistryPolicyNotFoundException +// The registry doesn't have an associated registry policy. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteRegistryPolicy +func (c *ECR) DeleteRegistryPolicy(input *DeleteRegistryPolicyInput) (*DeleteRegistryPolicyOutput, error) { + req, out := c.DeleteRegistryPolicyRequest(input) + return out, req.Send() +} + +// DeleteRegistryPolicyWithContext is the same as DeleteRegistryPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRegistryPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECR) DeleteRegistryPolicyWithContext(ctx aws.Context, input *DeleteRegistryPolicyInput, opts ...request.Option) (*DeleteRegistryPolicyOutput, error) { + req, out := c.DeleteRegistryPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteRepository = "DeleteRepository" // DeleteRepositoryRequest generates a "aws/request.Request" representing the @@ -1096,6 +1182,94 @@ func (c *ECR) DescribeImagesPagesWithContext(ctx aws.Context, input *DescribeIma return p.Err() } +const opDescribeRegistry = "DescribeRegistry" + +// DescribeRegistryRequest generates a "aws/request.Request" representing the +// client's request for the DescribeRegistry operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeRegistry for more information on using the DescribeRegistry +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeRegistryRequest method. +// req, resp := client.DescribeRegistryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeRegistry +func (c *ECR) DescribeRegistryRequest(input *DescribeRegistryInput) (req *request.Request, output *DescribeRegistryOutput) { + op := &request.Operation{ + Name: opDescribeRegistry, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeRegistryInput{} + } + + output = &DescribeRegistryOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeRegistry API operation for Amazon EC2 Container Registry. +// +// Describes the settings for a registry. The replication configuration for +// a repository can be created or updated with the PutReplicationConfiguration +// API action. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EC2 Container Registry's +// API operation DescribeRegistry for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ValidationException +// There was an exception validating this request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeRegistry +func (c *ECR) DescribeRegistry(input *DescribeRegistryInput) (*DescribeRegistryOutput, error) { + req, out := c.DescribeRegistryRequest(input) + return out, req.Send() +} + +// DescribeRegistryWithContext is the same as DescribeRegistry with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeRegistry for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECR) DescribeRegistryWithContext(ctx aws.Context, input *DescribeRegistryInput, opts ...request.Option) (*DescribeRegistryOutput, error) { + req, out := c.DescribeRegistryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeRepositories = "DescribeRepositories" // DescribeRepositoriesRequest generates a "aws/request.Request" representing the @@ -1675,6 +1849,92 @@ func (c *ECR) GetLifecyclePolicyPreviewPagesWithContext(ctx aws.Context, input * return p.Err() } +const opGetRegistryPolicy = "GetRegistryPolicy" + +// GetRegistryPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetRegistryPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetRegistryPolicy for more information on using the GetRegistryPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetRegistryPolicyRequest method. +// req, resp := client.GetRegistryPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetRegistryPolicy +func (c *ECR) GetRegistryPolicyRequest(input *GetRegistryPolicyInput) (req *request.Request, output *GetRegistryPolicyOutput) { + op := &request.Operation{ + Name: opGetRegistryPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetRegistryPolicyInput{} + } + + output = &GetRegistryPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetRegistryPolicy API operation for Amazon EC2 Container Registry. +// +// Retrieves the permissions policy for a registry. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EC2 Container Registry's +// API operation GetRegistryPolicy for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * RegistryPolicyNotFoundException +// The registry doesn't have an associated registry policy. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetRegistryPolicy +func (c *ECR) GetRegistryPolicy(input *GetRegistryPolicyInput) (*GetRegistryPolicyOutput, error) { + req, out := c.GetRegistryPolicyRequest(input) + return out, req.Send() +} + +// GetRegistryPolicyWithContext is the same as GetRegistryPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetRegistryPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECR) GetRegistryPolicyWithContext(ctx aws.Context, input *GetRegistryPolicyInput, opts ...request.Option) (*GetRegistryPolicyOutput, error) { + req, out := c.GetRegistryPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetRepositoryPolicy = "GetRepositoryPolicy" // GetRepositoryPolicyRequest generates a "aws/request.Request" representing the @@ -2489,52 +2749,55 @@ func (c *ECR) PutLifecyclePolicyWithContext(ctx aws.Context, input *PutLifecycle return out, req.Send() } -const opSetRepositoryPolicy = "SetRepositoryPolicy" +const opPutRegistryPolicy = "PutRegistryPolicy" -// SetRepositoryPolicyRequest generates a "aws/request.Request" representing the -// client's request for the SetRepositoryPolicy operation. The "output" return +// PutRegistryPolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutRegistryPolicy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SetRepositoryPolicy for more information on using the SetRepositoryPolicy +// See PutRegistryPolicy for more information on using the PutRegistryPolicy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SetRepositoryPolicyRequest method. -// req, resp := client.SetRepositoryPolicyRequest(params) +// // Example sending a request using the PutRegistryPolicyRequest method. +// req, resp := client.PutRegistryPolicyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/SetRepositoryPolicy -func (c *ECR) SetRepositoryPolicyRequest(input *SetRepositoryPolicyInput) (req *request.Request, output *SetRepositoryPolicyOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutRegistryPolicy +func (c *ECR) PutRegistryPolicyRequest(input *PutRegistryPolicyInput) (req *request.Request, output *PutRegistryPolicyOutput) { op := &request.Operation{ - Name: opSetRepositoryPolicy, + Name: opPutRegistryPolicy, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &SetRepositoryPolicyInput{} + input = &PutRegistryPolicyInput{} } - output = &SetRepositoryPolicyOutput{} + output = &PutRegistryPolicyOutput{} req = c.newRequest(op, input, output) return } -// SetRepositoryPolicy API operation for Amazon EC2 Container Registry. +// PutRegistryPolicy API operation for Amazon EC2 Container Registry. // -// Applies a repository policy to the specified repository to control access -// permissions. For more information, see Amazon ECR Repository Policies (https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html) +// Creates or updates the permissions policy for your registry. +// +// A registry policy is used to specify permissions for another AWS account +// and is used when configuring cross-account replication. For more information, +// see Registry permissions (https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html) // in the Amazon Elastic Container Registry User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2542,7 +2805,7 @@ func (c *ECR) SetRepositoryPolicyRequest(input *SetRepositoryPolicyInput) (req * // the error. // // See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation SetRepositoryPolicy for usage and error information. +// API operation PutRegistryPolicy for usage and error information. // // Returned Error Types: // * ServerException @@ -2552,87 +2815,90 @@ func (c *ECR) SetRepositoryPolicyRequest(input *SetRepositoryPolicyInput) (req * // The specified parameter is invalid. Review the available parameters for the // API request. // -// * RepositoryNotFoundException -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/SetRepositoryPolicy -func (c *ECR) SetRepositoryPolicy(input *SetRepositoryPolicyInput) (*SetRepositoryPolicyOutput, error) { - req, out := c.SetRepositoryPolicyRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutRegistryPolicy +func (c *ECR) PutRegistryPolicy(input *PutRegistryPolicyInput) (*PutRegistryPolicyOutput, error) { + req, out := c.PutRegistryPolicyRequest(input) return out, req.Send() } -// SetRepositoryPolicyWithContext is the same as SetRepositoryPolicy with the addition of +// PutRegistryPolicyWithContext is the same as PutRegistryPolicy with the addition of // the ability to pass a context and additional request options. // -// See SetRepositoryPolicy for details on how to use this API operation. +// See PutRegistryPolicy for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ECR) SetRepositoryPolicyWithContext(ctx aws.Context, input *SetRepositoryPolicyInput, opts ...request.Option) (*SetRepositoryPolicyOutput, error) { - req, out := c.SetRepositoryPolicyRequest(input) +func (c *ECR) PutRegistryPolicyWithContext(ctx aws.Context, input *PutRegistryPolicyInput, opts ...request.Option) (*PutRegistryPolicyOutput, error) { + req, out := c.PutRegistryPolicyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStartImageScan = "StartImageScan" +const opPutReplicationConfiguration = "PutReplicationConfiguration" -// StartImageScanRequest generates a "aws/request.Request" representing the -// client's request for the StartImageScan operation. The "output" return +// PutReplicationConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutReplicationConfiguration operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartImageScan for more information on using the StartImageScan +// See PutReplicationConfiguration for more information on using the PutReplicationConfiguration // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartImageScanRequest method. -// req, resp := client.StartImageScanRequest(params) +// // Example sending a request using the PutReplicationConfigurationRequest method. +// req, resp := client.PutReplicationConfigurationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartImageScan -func (c *ECR) StartImageScanRequest(input *StartImageScanInput) (req *request.Request, output *StartImageScanOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutReplicationConfiguration +func (c *ECR) PutReplicationConfigurationRequest(input *PutReplicationConfigurationInput) (req *request.Request, output *PutReplicationConfigurationOutput) { op := &request.Operation{ - Name: opStartImageScan, + Name: opPutReplicationConfiguration, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StartImageScanInput{} + input = &PutReplicationConfigurationInput{} } - output = &StartImageScanOutput{} + output = &PutReplicationConfigurationOutput{} req = c.newRequest(op, input, output) return } -// StartImageScan API operation for Amazon EC2 Container Registry. +// PutReplicationConfiguration API operation for Amazon EC2 Container Registry. // -// Starts an image vulnerability scan. An image scan can only be started once -// per day on an individual image. This limit includes if an image was scanned -// on initial push. For more information, see Image Scanning (https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html) +// Creates or updates the replication configuration for a registry. The existing +// replication configuration for a repository can be retrieved with the DescribeRegistry +// API action. The first time the PutReplicationConfiguration API is called, +// a service-linked IAM role is created in your account for the replication +// process. For more information, see Using Service-Linked Roles for Amazon +// ECR (https://docs.aws.amazon.com/AmazonECR/latest/userguide/using-service-linked-roles.html) // in the Amazon Elastic Container Registry User Guide. // +// When configuring cross-account replication, the destination account must +// grant the source account permission to replicate. This permission is controlled +// using a registry permissions policy. For more information, see PutRegistryPolicy. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon EC2 Container Registry's -// API operation StartImageScan for usage and error information. +// API operation PutReplicationConfiguration for usage and error information. // // Returned Error Types: // * ServerException @@ -2642,44 +2908,222 @@ func (c *ECR) StartImageScanRequest(input *StartImageScanInput) (req *request.Re // The specified parameter is invalid. Review the available parameters for the // API request. // -// * UnsupportedImageTypeException -// The image is of a type that cannot be scanned. -// -// * LimitExceededException -// The operation did not succeed because it would have exceeded a service limit -// for your account. For more information, see Amazon ECR Service Quotas (https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html) -// in the Amazon Elastic Container Registry User Guide. -// -// * RepositoryNotFoundException -// The specified repository could not be found. Check the spelling of the specified -// repository and ensure that you are performing operations on the correct registry. -// -// * ImageNotFoundException -// The image requested does not exist in the specified repository. +// * ValidationException +// There was an exception validating this request. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartImageScan -func (c *ECR) StartImageScan(input *StartImageScanInput) (*StartImageScanOutput, error) { - req, out := c.StartImageScanRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutReplicationConfiguration +func (c *ECR) PutReplicationConfiguration(input *PutReplicationConfigurationInput) (*PutReplicationConfigurationOutput, error) { + req, out := c.PutReplicationConfigurationRequest(input) return out, req.Send() } -// StartImageScanWithContext is the same as StartImageScan with the addition of +// PutReplicationConfigurationWithContext is the same as PutReplicationConfiguration with the addition of // the ability to pass a context and additional request options. // -// See StartImageScan for details on how to use this API operation. +// See PutReplicationConfiguration for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ECR) StartImageScanWithContext(ctx aws.Context, input *StartImageScanInput, opts ...request.Option) (*StartImageScanOutput, error) { - req, out := c.StartImageScanRequest(input) +func (c *ECR) PutReplicationConfigurationWithContext(ctx aws.Context, input *PutReplicationConfigurationInput, opts ...request.Option) (*PutReplicationConfigurationOutput, error) { + req, out := c.PutReplicationConfigurationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStartLifecyclePolicyPreview = "StartLifecyclePolicyPreview" +const opSetRepositoryPolicy = "SetRepositoryPolicy" + +// SetRepositoryPolicyRequest generates a "aws/request.Request" representing the +// client's request for the SetRepositoryPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SetRepositoryPolicy for more information on using the SetRepositoryPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SetRepositoryPolicyRequest method. +// req, resp := client.SetRepositoryPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/SetRepositoryPolicy +func (c *ECR) SetRepositoryPolicyRequest(input *SetRepositoryPolicyInput) (req *request.Request, output *SetRepositoryPolicyOutput) { + op := &request.Operation{ + Name: opSetRepositoryPolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SetRepositoryPolicyInput{} + } + + output = &SetRepositoryPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// SetRepositoryPolicy API operation for Amazon EC2 Container Registry. +// +// Applies a repository policy to the specified repository to control access +// permissions. For more information, see Amazon ECR Repository Policies (https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html) +// in the Amazon Elastic Container Registry User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EC2 Container Registry's +// API operation SetRepositoryPolicy for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * RepositoryNotFoundException +// The specified repository could not be found. Check the spelling of the specified +// repository and ensure that you are performing operations on the correct registry. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/SetRepositoryPolicy +func (c *ECR) SetRepositoryPolicy(input *SetRepositoryPolicyInput) (*SetRepositoryPolicyOutput, error) { + req, out := c.SetRepositoryPolicyRequest(input) + return out, req.Send() +} + +// SetRepositoryPolicyWithContext is the same as SetRepositoryPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See SetRepositoryPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECR) SetRepositoryPolicyWithContext(ctx aws.Context, input *SetRepositoryPolicyInput, opts ...request.Option) (*SetRepositoryPolicyOutput, error) { + req, out := c.SetRepositoryPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartImageScan = "StartImageScan" + +// StartImageScanRequest generates a "aws/request.Request" representing the +// client's request for the StartImageScan operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartImageScan for more information on using the StartImageScan +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartImageScanRequest method. +// req, resp := client.StartImageScanRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartImageScan +func (c *ECR) StartImageScanRequest(input *StartImageScanInput) (req *request.Request, output *StartImageScanOutput) { + op := &request.Operation{ + Name: opStartImageScan, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartImageScanInput{} + } + + output = &StartImageScanOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartImageScan API operation for Amazon EC2 Container Registry. +// +// Starts an image vulnerability scan. An image scan can only be started once +// per day on an individual image. This limit includes if an image was scanned +// on initial push. For more information, see Image Scanning (https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html) +// in the Amazon Elastic Container Registry User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon EC2 Container Registry's +// API operation StartImageScan for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * UnsupportedImageTypeException +// The image is of a type that cannot be scanned. +// +// * LimitExceededException +// The operation did not succeed because it would have exceeded a service limit +// for your account. For more information, see Amazon ECR Service Quotas (https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html) +// in the Amazon Elastic Container Registry User Guide. +// +// * RepositoryNotFoundException +// The specified repository could not be found. Check the spelling of the specified +// repository and ensure that you are performing operations on the correct registry. +// +// * ImageNotFoundException +// The image requested does not exist in the specified repository. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartImageScan +func (c *ECR) StartImageScan(input *StartImageScanInput) (*StartImageScanOutput, error) { + req, out := c.StartImageScanRequest(input) + return out, req.Send() +} + +// StartImageScanWithContext is the same as StartImageScan with the addition of +// the ability to pass a context and additional request options. +// +// See StartImageScan for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECR) StartImageScanWithContext(ctx aws.Context, input *StartImageScanInput, opts ...request.Option) (*StartImageScanOutput, error) { + req, out := c.StartImageScanRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartLifecyclePolicyPreview = "StartLifecyclePolicyPreview" // StartLifecyclePolicyPreviewRequest generates a "aws/request.Request" representing the // client's request for the StartLifecyclePolicyPreview operation. The "output" return @@ -3852,6 +4296,52 @@ func (s *DeleteLifecyclePolicyOutput) SetRepositoryName(v string) *DeleteLifecyc return s } +type DeleteRegistryPolicyInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRegistryPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRegistryPolicyInput) GoString() string { + return s.String() +} + +type DeleteRegistryPolicyOutput struct { + _ struct{} `type:"structure"` + + // The contents of the registry permissions policy that was deleted. + PolicyText *string `locationName:"policyText" type:"string"` + + // The registry ID associated with the request. + RegistryId *string `locationName:"registryId" type:"string"` +} + +// String returns the string representation +func (s DeleteRegistryPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRegistryPolicyOutput) GoString() string { + return s.String() +} + +// SetPolicyText sets the PolicyText field's value. +func (s *DeleteRegistryPolicyOutput) SetPolicyText(v string) *DeleteRegistryPolicyOutput { + s.PolicyText = &v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *DeleteRegistryPolicyOutput) SetRegistryId(v string) *DeleteRegistryPolicyOutput { + s.RegistryId = &v + return s +} + type DeleteRepositoryInput struct { _ struct{} `type:"structure"` @@ -4378,32 +4868,78 @@ func (s *DescribeImagesOutput) SetNextToken(v string) *DescribeImagesOutput { return s } -type DescribeRepositoriesInput struct { +type DescribeRegistryInput struct { _ struct{} `type:"structure"` +} - // The maximum number of repository results returned by DescribeRepositories - // in paginated output. When this parameter is used, DescribeRepositories only - // returns maxResults results in a single page along with a nextToken response - // element. The remaining results of the initial request can be seen by sending - // another DescribeRepositories request with the returned nextToken value. This - // value can be between 1 and 1000. If this parameter is not used, then DescribeRepositories - // returns up to 100 results and a nextToken value, if applicable. This option - // cannot be used when you specify repositories with repositoryNames. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` +// String returns the string representation +func (s DescribeRegistryInput) String() string { + return awsutil.Prettify(s) +} - // The nextToken value returned from a previous paginated DescribeRepositories - // request where maxResults was used and the results exceeded the value of that - // parameter. Pagination continues from the end of the previous results that - // returned the nextToken value. This value is null when there are no more results - // to return. This option cannot be used when you specify repositories with - // repositoryNames. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` +// GoString returns the string representation +func (s DescribeRegistryInput) GoString() string { + return s.String() +} - // The AWS account ID associated with the registry that contains the repositories - // to be described. If you do not specify a registry, the default registry is +type DescribeRegistryOutput struct { + _ struct{} `type:"structure"` + + // The ID of the registry. + RegistryId *string `locationName:"registryId" type:"string"` + + // The replication configuration for the registry. + ReplicationConfiguration *ReplicationConfiguration `locationName:"replicationConfiguration" type:"structure"` +} + +// String returns the string representation +func (s DescribeRegistryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeRegistryOutput) GoString() string { + return s.String() +} + +// SetRegistryId sets the RegistryId field's value. +func (s *DescribeRegistryOutput) SetRegistryId(v string) *DescribeRegistryOutput { + s.RegistryId = &v + return s +} + +// SetReplicationConfiguration sets the ReplicationConfiguration field's value. +func (s *DescribeRegistryOutput) SetReplicationConfiguration(v *ReplicationConfiguration) *DescribeRegistryOutput { + s.ReplicationConfiguration = v + return s +} + +type DescribeRepositoriesInput struct { + _ struct{} `type:"structure"` + + // The maximum number of repository results returned by DescribeRepositories + // in paginated output. When this parameter is used, DescribeRepositories only + // returns maxResults results in a single page along with a nextToken response + // element. The remaining results of the initial request can be seen by sending + // another DescribeRepositories request with the returned nextToken value. This + // value can be between 1 and 1000. If this parameter is not used, then DescribeRepositories + // returns up to 100 results and a nextToken value, if applicable. This option + // cannot be used when you specify repositories with repositoryNames. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // The nextToken value returned from a previous paginated DescribeRepositories + // request where maxResults was used and the results exceeded the value of that + // parameter. Pagination continues from the end of the previous results that + // returned the nextToken value. This value is null when there are no more results + // to return. This option cannot be used when you specify repositories with + // repositoryNames. + // + // This token should be treated as an opaque identifier that is only used to + // retrieve the next items in a list and not for other programmatic purposes. + NextToken *string `locationName:"nextToken" type:"string"` + + // The AWS account ID associated with the registry that contains the repositories + // to be described. If you do not specify a registry, the default registry is // assumed. RegistryId *string `locationName:"registryId" type:"string"` @@ -4641,7 +5177,9 @@ type GetAuthorizationTokenInput struct { // A list of AWS account IDs that are associated with the registries for which // to get AuthorizationData objects. If you do not specify a registry, the default // registry is assumed. - RegistryIds []*string `locationName:"registryIds" min:"1" type:"list"` + // + // Deprecated: This field is deprecated. The returned authorization token can be used to access any Amazon ECR registry that the IAM principal has access to, specifying a registry ID doesn't change the permissions scope of the authorization token. + RegistryIds []*string `locationName:"registryIds" min:"1" deprecated:"true" type:"list"` } // String returns the string representation @@ -5091,6 +5629,52 @@ func (s *GetLifecyclePolicyPreviewOutput) SetSummary(v *LifecyclePolicyPreviewSu return s } +type GetRegistryPolicyInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetRegistryPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRegistryPolicyInput) GoString() string { + return s.String() +} + +type GetRegistryPolicyOutput struct { + _ struct{} `type:"structure"` + + // The JSON text of the permissions policy for a registry. + PolicyText *string `locationName:"policyText" type:"string"` + + // The ID of the registry. + RegistryId *string `locationName:"registryId" type:"string"` +} + +// String returns the string representation +func (s GetRegistryPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRegistryPolicyOutput) GoString() string { + return s.String() +} + +// SetPolicyText sets the PolicyText field's value. +func (s *GetRegistryPolicyOutput) SetPolicyText(v string) *GetRegistryPolicyOutput { + s.PolicyText = &v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *GetRegistryPolicyOutput) SetRegistryId(v string) *GetRegistryPolicyOutput { + s.RegistryId = &v + return s +} + type GetRepositoryPolicyInput struct { _ struct{} `type:"structure"` @@ -7631,6 +8215,145 @@ func (s *PutLifecyclePolicyOutput) SetRepositoryName(v string) *PutLifecyclePoli return s } +type PutRegistryPolicyInput struct { + _ struct{} `type:"structure"` + + // The JSON policy text to apply to your registry. The policy text follows the + // same format as IAM policy text. For more information, see Registry permissions + // (https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html) + // in the Amazon Elastic Container Registry User Guide. + // + // PolicyText is a required field + PolicyText *string `locationName:"policyText" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutRegistryPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutRegistryPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutRegistryPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutRegistryPolicyInput"} + if s.PolicyText == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyText")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyText sets the PolicyText field's value. +func (s *PutRegistryPolicyInput) SetPolicyText(v string) *PutRegistryPolicyInput { + s.PolicyText = &v + return s +} + +type PutRegistryPolicyOutput struct { + _ struct{} `type:"structure"` + + // The JSON policy text for your registry. + PolicyText *string `locationName:"policyText" type:"string"` + + // The registry ID. + RegistryId *string `locationName:"registryId" type:"string"` +} + +// String returns the string representation +func (s PutRegistryPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutRegistryPolicyOutput) GoString() string { + return s.String() +} + +// SetPolicyText sets the PolicyText field's value. +func (s *PutRegistryPolicyOutput) SetPolicyText(v string) *PutRegistryPolicyOutput { + s.PolicyText = &v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *PutRegistryPolicyOutput) SetRegistryId(v string) *PutRegistryPolicyOutput { + s.RegistryId = &v + return s +} + +type PutReplicationConfigurationInput struct { + _ struct{} `type:"structure"` + + // An object representing the replication configuration for a registry. + // + // ReplicationConfiguration is a required field + ReplicationConfiguration *ReplicationConfiguration `locationName:"replicationConfiguration" type:"structure" required:"true"` +} + +// String returns the string representation +func (s PutReplicationConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutReplicationConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutReplicationConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutReplicationConfigurationInput"} + if s.ReplicationConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("ReplicationConfiguration")) + } + if s.ReplicationConfiguration != nil { + if err := s.ReplicationConfiguration.Validate(); err != nil { + invalidParams.AddNested("ReplicationConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetReplicationConfiguration sets the ReplicationConfiguration field's value. +func (s *PutReplicationConfigurationInput) SetReplicationConfiguration(v *ReplicationConfiguration) *PutReplicationConfigurationInput { + s.ReplicationConfiguration = v + return s +} + +type PutReplicationConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The contents of the replication configuration for the registry. + ReplicationConfiguration *ReplicationConfiguration `locationName:"replicationConfiguration" type:"structure"` +} + +// String returns the string representation +func (s PutReplicationConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutReplicationConfigurationOutput) GoString() string { + return s.String() +} + +// SetReplicationConfiguration sets the ReplicationConfiguration field's value. +func (s *PutReplicationConfigurationOutput) SetReplicationConfiguration(v *ReplicationConfiguration) *PutReplicationConfigurationOutput { + s.ReplicationConfiguration = v + return s +} + // The manifest list is referencing an image that does not exist. type ReferencedImagesNotFoundException struct { _ struct{} `type:"structure"` @@ -7687,6 +8410,220 @@ func (s *ReferencedImagesNotFoundException) RequestID() string { return s.RespMetadata.RequestID } +// The registry doesn't have an associated registry policy. +type RegistryPolicyNotFoundException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RegistryPolicyNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegistryPolicyNotFoundException) GoString() string { + return s.String() +} + +func newErrorRegistryPolicyNotFoundException(v protocol.ResponseMetadata) error { + return &RegistryPolicyNotFoundException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *RegistryPolicyNotFoundException) Code() string { + return "RegistryPolicyNotFoundException" +} + +// Message returns the exception's message. +func (s *RegistryPolicyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *RegistryPolicyNotFoundException) OrigErr() error { + return nil +} + +func (s *RegistryPolicyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *RegistryPolicyNotFoundException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *RegistryPolicyNotFoundException) RequestID() string { + return s.RespMetadata.RequestID +} + +// The replication configuration for a registry. +type ReplicationConfiguration struct { + _ struct{} `type:"structure"` + + // An array of objects representing the replication rules for a replication + // configuration. A replication configuration may contain only one replication + // rule but the rule may contain one or more replication destinations. + // + // Rules is a required field + Rules []*ReplicationRule `locationName:"rules" type:"list" required:"true"` +} + +// String returns the string representation +func (s ReplicationConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicationConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicationConfiguration"} + if s.Rules == nil { + invalidParams.Add(request.NewErrParamRequired("Rules")) + } + if s.Rules != nil { + for i, v := range s.Rules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRules sets the Rules field's value. +func (s *ReplicationConfiguration) SetRules(v []*ReplicationRule) *ReplicationConfiguration { + s.Rules = v + return s +} + +// An array of objects representing the details of a replication destination. +type ReplicationDestination struct { + _ struct{} `type:"structure"` + + // A Region to replicate to. + // + // Region is a required field + Region *string `locationName:"region" min:"2" type:"string" required:"true"` + + // The account ID of the destination registry to replicate to. + // + // RegistryId is a required field + RegistryId *string `locationName:"registryId" type:"string" required:"true"` +} + +// String returns the string representation +func (s ReplicationDestination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationDestination) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicationDestination) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicationDestination"} + if s.Region == nil { + invalidParams.Add(request.NewErrParamRequired("Region")) + } + if s.Region != nil && len(*s.Region) < 2 { + invalidParams.Add(request.NewErrParamMinLen("Region", 2)) + } + if s.RegistryId == nil { + invalidParams.Add(request.NewErrParamRequired("RegistryId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRegion sets the Region field's value. +func (s *ReplicationDestination) SetRegion(v string) *ReplicationDestination { + s.Region = &v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *ReplicationDestination) SetRegistryId(v string) *ReplicationDestination { + s.RegistryId = &v + return s +} + +// An array of objects representing the replication destinations for a replication +// configuration. A replication configuration may contain only one replication +// rule but the rule may contain one or more replication destinations. +type ReplicationRule struct { + _ struct{} `type:"structure"` + + // An array of objects representing the details of a replication destination. + // + // Destinations is a required field + Destinations []*ReplicationDestination `locationName:"destinations" type:"list" required:"true"` +} + +// String returns the string representation +func (s ReplicationRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicationRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicationRule"} + if s.Destinations == nil { + invalidParams.Add(request.NewErrParamRequired("Destinations")) + } + if s.Destinations != nil { + for i, v := range s.Destinations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Destinations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinations sets the Destinations field's value. +func (s *ReplicationRule) SetDestinations(v []*ReplicationDestination) *ReplicationRule { + s.Destinations = v + return s +} + // An object representing a repository. type Repository struct { _ struct{} `type:"structure"` @@ -8985,6 +9922,62 @@ func (s *UploadNotFoundException) RequestID() string { return s.RespMetadata.RequestID } +// There was an exception validating this request. +type ValidationException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s *ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ValidationException) OrigErr() error { + return nil +} + +func (s *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *ValidationException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ValidationException) RequestID() string { + return s.RespMetadata.RequestID +} + const ( // EncryptionTypeAes256 is a EncryptionType enum value EncryptionTypeAes256 = "AES256" diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go index 8191013264f1..12b2b9570ad4 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go @@ -135,6 +135,12 @@ const ( // The manifest list is referencing an image that does not exist. ErrCodeReferencedImagesNotFoundException = "ReferencedImagesNotFoundException" + // ErrCodeRegistryPolicyNotFoundException for service response error code + // "RegistryPolicyNotFoundException". + // + // The registry doesn't have an associated registry policy. + ErrCodeRegistryPolicyNotFoundException = "RegistryPolicyNotFoundException" + // ErrCodeRepositoryAlreadyExistsException for service response error code // "RepositoryAlreadyExistsException". // @@ -194,6 +200,12 @@ const ( // The upload could not be found, or the specified upload ID is not valid for // this repository. ErrCodeUploadNotFoundException = "UploadNotFoundException" + + // ErrCodeValidationException for service response error code + // "ValidationException". + // + // There was an exception validating this request. + ErrCodeValidationException = "ValidationException" ) var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ @@ -216,6 +228,7 @@ var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ "LifecyclePolicyPreviewNotFoundException": newErrorLifecyclePolicyPreviewNotFoundException, "LimitExceededException": newErrorLimitExceededException, "ReferencedImagesNotFoundException": newErrorReferencedImagesNotFoundException, + "RegistryPolicyNotFoundException": newErrorRegistryPolicyNotFoundException, "RepositoryAlreadyExistsException": newErrorRepositoryAlreadyExistsException, "RepositoryNotEmptyException": newErrorRepositoryNotEmptyException, "RepositoryNotFoundException": newErrorRepositoryNotFoundException, @@ -225,4 +238,5 @@ var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ "TooManyTagsException": newErrorTooManyTagsException, "UnsupportedImageTypeException": newErrorUnsupportedImageTypeException, "UploadNotFoundException": newErrorUploadNotFoundException, + "ValidationException": newErrorValidationException, } diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go index 254ddb44f5d1..3df9030e94e3 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go @@ -63,12 +63,9 @@ func (c *ELBV2) AddListenerCertificatesRequest(input *AddListenerCertificatesInp // If the certificate in already in the certificate list, the call is successful // but the certificate is not added again. // -// To get the certificate list for a listener, use DescribeListenerCertificates. -// To remove certificates from the certificate list for a listener, use RemoveListenerCertificates. -// To replace the default certificate for a listener, use ModifyListener. -// -// For more information, see SSL Certificates (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#https-listener-certificates) -// in the Application Load Balancers Guide. +// For more information, see HTTPS listeners (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html) +// in the Application Load Balancers Guide or TLS listeners (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html) +// in the Network Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -155,15 +152,12 @@ func (c *ELBV2) AddTagsRequest(input *AddTagsInput) (req *request.Request, outpu // AddTags API operation for Elastic Load Balancing. // // Adds the specified tags to the specified Elastic Load Balancing resource. -// You can tag your Application Load Balancers, Network Load Balancers, target -// groups, listeners, and rules. +// You can tag your Application Load Balancers, Network Load Balancers, Gateway +// Load Balancers, target groups, listeners, and rules. // // Each tag consists of a key and an optional value. If a resource already has // a tag with the same key, AddTags updates its value. // -// To list the current tags for your resources, use DescribeTags. To remove -// tags from your resources, use RemoveTags. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -250,22 +244,21 @@ func (c *ELBV2) CreateListenerRequest(input *CreateListenerInput) (req *request. // CreateListener API operation for Elastic Load Balancing. // -// Creates a listener for the specified Application Load Balancer or Network -// Load Balancer. +// Creates a listener for the specified Application Load Balancer, Network Load +// Balancer, or Gateway Load Balancer. // -// To update a listener, use ModifyListener. When you are finished with a listener, -// you can delete it using DeleteListener. If you are finished with both the -// listener and the load balancer, you can delete them both using DeleteLoadBalancer. +// For more information, see the following: +// +// * Listeners for your Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html) +// +// * Listeners for your Network Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-listeners.html) +// +// * Listeners for your Gateway Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/gateway-listeners.html) // // This operation is idempotent, which means that it completes at most one time. // If you attempt to create multiple listeners with the same settings, each // call succeeds. // -// For more information, see Listeners for Your Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html) -// in the Application Load Balancers Guide and Listeners for Your Network Load -// Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-listeners.html) -// in the Network Load Balancers Guide. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -397,29 +390,21 @@ func (c *ELBV2) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req * // CreateLoadBalancer API operation for Elastic Load Balancing. // -// Creates an Application Load Balancer or a Network Load Balancer. +// Creates an Application Load Balancer, Network Load Balancer, or Gateway Load +// Balancer. // -// When you create a load balancer, you can specify security groups, public -// subnets, IP address type, and tags. Otherwise, you could do so later using -// SetSecurityGroups, SetSubnets, SetIpAddressType, and AddTags. +// For more information, see the following: // -// To create listeners for your load balancer, use CreateListener. To describe -// your current load balancers, see DescribeLoadBalancers. When you are finished -// with a load balancer, you can delete it using DeleteLoadBalancer. +// * Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html) // -// For limit information, see Limits for Your Application Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html) -// in the Application Load Balancers Guide and Limits for Your Network Load -// Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-limits.html) -// in the Network Load Balancers Guide. +// * Network Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html) +// +// * Gateway Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/gateway-load-balancers.html) // // This operation is idempotent, which means that it completes at most one time. // If you attempt to create multiple load balancers with the same settings, // each call succeeds. // -// For more information, see Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html) -// in the Application Load Balancers Guide and Network Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html) -// in the Network Load Balancers Guide. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -540,13 +525,9 @@ func (c *ELBV2) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, // Rules are evaluated in priority order, from the lowest value to the highest // value. When the conditions for a rule are met, its actions are performed. // If the conditions for no rules are met, the actions for the default rule -// are performed. For more information, see Listener Rules (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#listener-rules) +// are performed. For more information, see Listener rules (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#listener-rules) // in the Application Load Balancers Guide. // -// To view your current rules, use DescribeRules. To update a rule, use ModifyRule. -// To set the priorities of your rules, use SetRulePriorities. To delete a rule, -// use DeleteRule. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -671,25 +652,18 @@ func (c *ELBV2) CreateTargetGroupRequest(input *CreateTargetGroupInput) (req *re // // Creates a target group. // -// To register targets with the target group, use RegisterTargets. To update -// the health check settings for the target group, use ModifyTargetGroup. To -// monitor the health of targets in the target group, use DescribeTargetHealth. +// For more information, see the following: // -// To route traffic to the targets in a target group, specify the target group -// in an action using CreateListener or CreateRule. +// * Target groups for your Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html) // -// To delete a target group, use DeleteTargetGroup. +// * Target groups for your Network Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html) +// +// * Target groups for your Gateway Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/target-groups.html) // // This operation is idempotent, which means that it completes at most one time. // If you attempt to create multiple target groups with the same settings, each // call succeeds. // -// For more information, see Target Groups for Your Application Load Balancers -// (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html) -// in the Application Load Balancers Guide or Target Groups for Your Network -// Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html) -// in the Network Load Balancers Guide. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -780,7 +754,7 @@ func (c *ELBV2) DeleteListenerRequest(input *DeleteListenerInput) (req *request. // Deletes the specified listener. // // Alternatively, your listener is deleted when you delete the load balancer -// to which it is attached, using DeleteLoadBalancer. +// to which it is attached. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -860,8 +834,8 @@ func (c *ELBV2) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req * // DeleteLoadBalancer API operation for Elastic Load Balancing. // -// Deletes the specified Application Load Balancer or Network Load Balancer -// and its attached listeners. +// Deletes the specified Application Load Balancer, Network Load Balancer, or +// Gateway Load Balancer. Deleting a load balancer also deletes its listeners. // // You can't delete a load balancer if deletion protection is enabled. If the // load balancer does not exist or has already been deleted, the call succeeds. @@ -1043,7 +1017,9 @@ func (c *ELBV2) DeleteTargetGroupRequest(input *DeleteTargetGroupInput) (req *re // Deletes the specified target group. // // You can delete a target group if it is not referenced by any actions. Deleting -// a target group also deletes any associated health checks. +// a target group also deletes any associated health checks. Deleting a target +// group does not affect its registered targets. For example, any EC2 instances +// continue to run until you stop or terminate them. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1211,10 +1187,13 @@ func (c *ELBV2) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) // Describes the current Elastic Load Balancing resource limits for your AWS // account. // -// For more information, see Limits for Your Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html) -// in the Application Load Balancer Guide or Limits for Your Network Load Balancers -// (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-limits.html) -// in the Network Load Balancers Guide. +// For more information, see the following: +// +// * Quotas for your Application Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html) +// +// * Quotas for your Network Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-limits.html) +// +// * Quotas for your Gateway Load Balancers (https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/quotas-limits.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1295,8 +1274,9 @@ func (c *ELBV2) DescribeListenerCertificatesRequest(input *DescribeListenerCerti // in the results (once with IsDefault set to true and once with IsDefault set // to false). // -// For more information, see SSL Certificates (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#https-listener-certificates) -// in the Application Load Balancers Guide. +// For more information, see SSL certificates (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#https-listener-certificates) +// in the Application Load Balancers Guide or Server certificates (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#tls-listener-certificate) +// in the Network Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1382,12 +1362,8 @@ func (c *ELBV2) DescribeListenersRequest(input *DescribeListenersInput) (req *re // DescribeListeners API operation for Elastic Load Balancing. // // Describes the specified listeners or the listeners for the specified Application -// Load Balancer or Network Load Balancer. You must specify either a load balancer -// or one or more listeners. -// -// For an HTTPS or TLS listener, the output includes the default certificate -// for the listener. To describe the certificate list for the listener, use -// DescribeListenerCertificates. +// Load Balancer, Network Load Balancer, or Gateway Load Balancer. You must +// specify either a load balancer or one or more listeners. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1524,12 +1500,19 @@ func (c *ELBV2) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalance // DescribeLoadBalancerAttributes API operation for Elastic Load Balancing. // -// Describes the attributes for the specified Application Load Balancer or Network -// Load Balancer. +// Describes the attributes for the specified Application Load Balancer, Network +// Load Balancer, or Gateway Load Balancer. // -// For more information, see Load Balancer Attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#load-balancer-attributes) -// in the Application Load Balancers Guide or Load Balancer Attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html#load-balancer-attributes) -// in the Network Load Balancers Guide. +// For more information, see the following: +// +// * Load balancer attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#load-balancer-attributes) +// in the Application Load Balancers Guide +// +// * Load balancer attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html#load-balancer-attributes) +// in the Network Load Balancers Guide +// +// * Load balancer attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/gateway-load-balancers.html#load-balancer-attributes) +// in the Gateway Load Balancers Guide // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1616,9 +1599,6 @@ func (c *ELBV2) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) // // Describes the specified load balancers or all of your load balancers. // -// To describe the listeners for a load balancer, use DescribeListeners. To -// describe the attributes for a load balancer, use DescribeLoadBalancerAttributes. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1836,8 +1816,9 @@ func (c *ELBV2) DescribeSSLPoliciesRequest(input *DescribeSSLPoliciesInput) (req // // Describes the specified policies or all policies used for SSL negotiation. // -// For more information, see Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) -// in the Application Load Balancers Guide. +// For more information, see Security policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) +// in the Application Load Balancers Guide or Security policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) +// in the Network Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1918,7 +1899,7 @@ func (c *ELBV2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Requ // // Describes the tags for the specified Elastic Load Balancing resources. You // can describe the tags for one or more Application Load Balancers, Network -// Load Balancers, target groups, listeners, or rules. +// Load Balancers, Gateway Load Balancers, target groups, listeners, or rules. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2008,9 +1989,16 @@ func (c *ELBV2) DescribeTargetGroupAttributesRequest(input *DescribeTargetGroupA // // Describes the attributes for the specified target group. // -// For more information, see Target Group Attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#target-group-attributes) -// in the Application Load Balancers Guide or Target Group Attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#target-group-attributes) -// in the Network Load Balancers Guide. +// For more information, see the following: +// +// * Target group attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#target-group-attributes) +// in the Application Load Balancers Guide +// +// * Target group attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#target-group-attributes) +// in the Network Load Balancers Guide +// +// * Target group attributes (https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/target-groups.html#target-group-attributes) +// in the Gateway Load Balancers Guide // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2100,9 +2088,6 @@ func (c *ELBV2) DescribeTargetGroupsRequest(input *DescribeTargetGroupsInput) (r // following to filter the results: the ARN of the load balancer, the names // of one or more target groups, or the ARNs of one or more target groups. // -// To describe the targets for a target group, use DescribeTargetHealth. To -// describe the attributes of a target group, use DescribeTargetGroupAttributes. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2462,8 +2447,8 @@ func (c *ELBV2) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAtt // ModifyLoadBalancerAttributes API operation for Elastic Load Balancing. // -// Modifies the specified attributes of the specified Application Load Balancer -// or Network Load Balancer. +// Modifies the specified attributes of the specified Application Load Balancer, +// Network Load Balancer, or Gateway Load Balancer. // // If any of the specified attributes can't be modified as requested, the call // fails. Any existing attributes that you do not modify retain their current @@ -2556,8 +2541,6 @@ func (c *ELBV2) ModifyRuleRequest(input *ModifyRuleInput) (req *request.Request, // a list, you must provide the entire list. For example, to add an action, // specify a list with the current actions plus the new action. // -// To modify the actions for the default rule, use ModifyListener. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2671,8 +2654,6 @@ func (c *ELBV2) ModifyTargetGroupRequest(input *ModifyTargetGroupInput) (req *re // Modifies the health checks used when evaluating the health state of the targets // in the specified target group. // -// To monitor the health of the targets, use DescribeTargetHealth. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2851,8 +2832,6 @@ func (c *ELBV2) RegisterTargetsRequest(input *RegisterTargetsInput) (req *reques // G1, G2, HI1, HS1, M1, M2, M3, and T1. You can register instances of these // types by IP address. // -// To remove a target from a target group, use DeregisterTargets. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2945,11 +2924,6 @@ func (c *ELBV2) RemoveListenerCertificatesRequest(input *RemoveListenerCertifica // Removes the specified certificate from the certificate list for the specified // HTTPS or TLS listener. // -// You can't remove the default certificate for a listener. To replace the default -// certificate, call ModifyListener. -// -// To list the certificates for your listener, use DescribeListenerCertificates. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3033,9 +3007,7 @@ func (c *ELBV2) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, // // Removes the specified tags from the specified Elastic Load Balancing resources. // You can remove the tags for one or more Application Load Balancers, Network -// Load Balancers, target groups, listeners, or rules. -// -// To list the current tags for your resources, use DescribeTags. +// Load Balancers, Gateway Load Balancers, target groups, listeners, or rules. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3305,7 +3277,8 @@ func (c *ELBV2) SetSecurityGroupsRequest(input *SetSecurityGroupsInput) (req *re // Balancer. The specified security groups override the previously associated // security groups. // -// You can't specify a security group for a Network Load Balancer. +// You can't specify a security group for a Network Load Balancer or Gateway +// Load Balancer. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3391,7 +3364,8 @@ func (c *ELBV2) SetSubnetsRequest(input *SetSubnetsInput) (req *request.Request, // SetSubnets API operation for Elastic Load Balancing. // // Enables the Availability Zones for the specified public subnets for the specified -// load balancer. The specified subnets replace the previously enabled subnets. +// Application Load Balancer or Network Load Balancer. The specified subnets +// replace the previously enabled subnets. // // When you specify subnets for a Network Load Balancer, you must include all // subnets that were enabled previously, with their existing configurations, @@ -4186,15 +4160,13 @@ type CreateListenerInput struct { // // * None // - // For more information, see ALPN Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#alpn-policies) + // For more information, see ALPN policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#alpn-policies) // in the Network Load Balancers Guide. AlpnPolicy []*string `type:"list"` // [HTTPS and TLS listeners] The default certificate for the listener. You must // provide exactly one certificate. Set CertificateArn to the certificate ARN // but do not set IsDefault. - // - // To create a certificate list for the listener, use AddListenerCertificates. Certificates []*Certificate `type:"list"` // The actions for the default rule. @@ -4207,41 +4179,22 @@ type CreateListenerInput struct { // LoadBalancerArn is a required field LoadBalancerArn *string `type:"string" required:"true"` - // The port on which the load balancer is listening. - // - // Port is a required field - Port *int64 `min:"1" type:"integer" required:"true"` + // The port on which the load balancer is listening. You cannot specify a port + // for a Gateway Load Balancer. + Port *int64 `min:"1" type:"integer"` // The protocol for connections from clients to the load balancer. For Application // Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load - // Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. - // - // Protocol is a required field - Protocol *string `type:"string" required:"true" enum:"ProtocolEnum"` + // Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. You can’t + // specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You cannot + // specify a protocol for a Gateway Load Balancer. + Protocol *string `type:"string" enum:"ProtocolEnum"` // [HTTPS and TLS listeners] The security policy that defines which protocols - // and ciphers are supported. The following are the possible values: - // - // * ELBSecurityPolicy-2016-08 - // - // * ELBSecurityPolicy-TLS-1-0-2015-04 - // - // * ELBSecurityPolicy-TLS-1-1-2017-01 - // - // * ELBSecurityPolicy-TLS-1-2-2017-01 - // - // * ELBSecurityPolicy-TLS-1-2-Ext-2018-06 - // - // * ELBSecurityPolicy-FS-2018-06 - // - // * ELBSecurityPolicy-FS-1-1-2019-08 - // - // * ELBSecurityPolicy-FS-1-2-2019-08 - // - // * ELBSecurityPolicy-FS-1-2-Res-2019-08 + // and ciphers are supported. // - // For more information, see Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) - // in the Application Load Balancers Guide and Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) + // For more information, see Security policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) + // in the Application Load Balancers Guide and Security policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) // in the Network Load Balancers Guide. SslPolicy *string `type:"string"` @@ -4268,15 +4221,9 @@ func (s *CreateListenerInput) Validate() error { if s.LoadBalancerArn == nil { invalidParams.Add(request.NewErrParamRequired("LoadBalancerArn")) } - if s.Port == nil { - invalidParams.Add(request.NewErrParamRequired("Port")) - } if s.Port != nil && *s.Port < 1 { invalidParams.Add(request.NewErrParamMinValue("Port", 1)) } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } if s.Tags != nil && len(s.Tags) < 1 { invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) } @@ -4385,10 +4332,9 @@ type CreateLoadBalancerInput struct { // pool (CoIP pool). CustomerOwnedIpv4Pool *string `type:"string"` - // [Application Load Balancers] The type of IP addresses used by the subnets - // for your load balancer. The possible values are ipv4 (for IPv4 addresses) - // and dualstack (for IPv4 and IPv6 addresses). Internal load balancers must - // use ipv4. + // The type of IP addresses used by the subnets for your load balancer. The + // possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and + // IPv6 addresses). Internal load balancers must use ipv4. IpAddressType *string `type:"string" enum:"IpAddressType"` // The name of the load balancer. @@ -4411,6 +4357,8 @@ type CreateLoadBalancerInput struct { // only from clients with access to the VPC for the load balancer. // // The default is an Internet-facing load balancer. + // + // You cannot specify a scheme for a Gateway Load Balancer. Scheme *string `type:"string" enum:"LoadBalancerSchemeEnum"` // [Application Load Balancers] The IDs of the security groups for the load @@ -4432,7 +4380,11 @@ type CreateLoadBalancerInput struct { // Zones. You can specify one Elastic IP address per subnet if you need static // IP addresses for your internet-facing load balancer. For internal load balancers, // you can specify one private IP address per subnet from the IPv4 range of - // the subnet. + // the subnet. For internet-facing load balancer, you can specify one IPv6 address + // per subnet. + // + // [Gateway Load Balancers] You can specify subnets from one or more Availability + // Zones. You cannot specify Elastic IP addresses for your subnets. SubnetMappings []*SubnetMapping `type:"list"` // The IDs of the public subnets. You can specify only one subnet per Availability @@ -4448,6 +4400,9 @@ type CreateLoadBalancerInput struct { // // [Network Load Balancers] You can specify subnets from one or more Availability // Zones. + // + // [Gateway Load Balancers] You can specify subnets from one or more Availability + // Zones. Subnets []*string `type:"list"` // The tags to assign to the load balancer. @@ -4717,10 +4672,10 @@ type CreateTargetGroupInput struct { HealthCheckEnabled *bool `type:"boolean"` // The approximate amount of time, in seconds, between health checks of an individual - // target. For HTTP and HTTPS health checks, the range is 5–300 seconds. For - // TCP health checks, the supported values are 10 and 30 seconds. If the target - // type is instance or ip, the default is 30 seconds. If the target type is - // lambda, the default is 35 seconds. + // target. If the target group protocol is TCP, TLS, UDP, or TCP_UDP, the supported + // values are 10 and 30 seconds. If the target group protocol is HTTP or HTTPS, + // the default is 30 seconds. If the target group protocol is GENEVE, the default + // is 10 seconds. If the target type is lambda, the default is 35 seconds. HealthCheckIntervalSeconds *int64 `min:"5" type:"integer"` // [HTTP/HTTPS health checks] The destination for health checks on the targets. @@ -4732,29 +4687,30 @@ type CreateTargetGroupInput struct { HealthCheckPath *string `min:"1" type:"string"` // The port the load balancer uses when performing health checks on targets. - // The default is traffic-port, which is the port on which each target receives - // traffic from the load balancer. + // If the protocol is HTTP, HTTPS, TCP, TLS, UDP, or TCP_UDP, the default is + // traffic-port, which is the port on which each target receives traffic from + // the load balancer. If the protocol is GENEVE, the default is port 80. HealthCheckPort *string `type:"string"` // The protocol the load balancer uses when performing health checks on targets. - // For Application Load Balancers, the default is HTTP. For Network Load Balancers, - // the default is TCP. The TCP protocol is supported for health checks only - // if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, - // UDP, and TCP_UDP protocols are not supported for health checks. + // For Application Load Balancers, the default is HTTP. For Network Load Balancers + // and Gateway Load Balancers, the default is TCP. The TCP protocol is not supported + // for health checks if the protocol of the target group is HTTP or HTTPS. The + // GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health checks. HealthCheckProtocol *string `type:"string" enum:"ProtocolEnum"` // The amount of time, in seconds, during which no response from a target means - // a failed health check. For target groups with a protocol of HTTP or HTTPS, - // the default is 5 seconds. For target groups with a protocol of TCP or TLS, - // this value must be 6 seconds for HTTP health checks and 10 seconds for TCP - // and HTTPS health checks. If the target type is lambda, the default is 30 - // seconds. + // a failed health check. For target groups with a protocol of HTTP, HTTPS, + // or GENEVE, the default is 5 seconds. For target groups with a protocol of + // TCP or TLS, this value must be 6 seconds for HTTP health checks and 10 seconds + // for TCP and HTTPS health checks. If the target type is lambda, the default + // is 30 seconds. HealthCheckTimeoutSeconds *int64 `min:"2" type:"integer"` // The number of consecutive health checks successes required before considering // an unhealthy target healthy. For target groups with a protocol of HTTP or - // HTTPS, the default is 5. For target groups with a protocol of TCP or TLS, - // the default is 3. If the target type is lambda, the default is 5. + // HTTPS, the default is 5. For target groups with a protocol of TCP, TLS, or + // GENEVE, the default is 3. If the target type is lambda, the default is 5. HealthyThresholdCount *int64 `min:"2" type:"integer"` // [HTTP/HTTPS health checks] The HTTP or gRPC codes to use when checking for @@ -4772,14 +4728,16 @@ type CreateTargetGroupInput struct { // The port on which the targets receive traffic. This port is used unless you // specify a port override when registering the target. If the target is a Lambda - // function, this parameter does not apply. + // function, this parameter does not apply. If the protocol is GENEVE, the supported + // port is 6081. Port *int64 `min:"1" type:"integer"` // The protocol to use for routing traffic to the targets. For Application Load // Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, - // the supported protocols are TCP, TLS, UDP, or TCP_UDP. A TCP_UDP listener - // must be associated with a TCP_UDP target group. If the target is a Lambda - // function, this parameter does not apply. + // the supported protocols are TCP, TLS, UDP, or TCP_UDP. For Gateway Load Balancers, + // the supported protocol is GENEVE. A TCP_UDP listener must be associated with + // a TCP_UDP target group. If the target is a Lambda function, this parameter + // does not apply. Protocol *string `type:"string" enum:"ProtocolEnum"` // [HTTP/HTTPS protocol] The protocol version. Specify GRPC to send requests @@ -4794,23 +4752,22 @@ type CreateTargetGroupInput struct { // target group. You can't specify targets for a target group using more than // one target type. // - // * instance - Targets are specified by instance ID. This is the default - // value. + // * instance - Register targets by instance ID. This is the default value. // - // * ip - Targets are specified by IP address. You can specify IP addresses - // from the subnets of the virtual private cloud (VPC) for the target group, - // the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16), and - // the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable - // IP addresses. + // * ip - Register targets by IP address. You can specify IP addresses from + // the subnets of the virtual private cloud (VPC) for the target group, the + // RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16), and the + // RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP + // addresses. // - // * lambda - The target groups contains a single Lambda function. + // * lambda - Register a single Lambda function as a target. TargetType *string `type:"string" enum:"TargetTypeEnum"` // The number of consecutive health check failures required before considering - // a target unhealthy. For target groups with a protocol of HTTP or HTTPS, the - // default is 2. For target groups with a protocol of TCP or TLS, this value - // must be the same as the healthy threshold count. If the target type is lambda, - // the default is 2. + // a target unhealthy. If the target group protocol is HTTP or HTTPS, the default + // is 2. If the target group protocol is TCP or TLS, this value must be the + // same as the healthy threshold count. If the target group protocol is GENEVE, + // the default is 3. If the target type is lambda, the default is 2. UnhealthyThresholdCount *int64 `min:"2" type:"integer"` // The identifier of the virtual private cloud (VPC). If the target is a Lambda @@ -6419,6 +6376,16 @@ type Limit struct { // // * application-load-balancers // + // * condition-values-per-alb-rule + // + // * condition-wildcards-per-alb-rule + // + // * gateway-load-balancers + // + // * gateway-load-balancers-per-vpc + // + // * geneve-target-groups + // // * listeners-per-application-load-balancer // // * listeners-per-network-load-balancer @@ -6437,6 +6404,8 @@ type Limit struct { // // * targets-per-application-load-balancer // + // * targets-per-availability-zone-per-gateway-load-balancer + // // * targets-per-availability-zone-per-network-load-balancer // // * targets-per-network-load-balancer @@ -6705,6 +6674,9 @@ type LoadBalancerAddress struct { // an internal-facing load balancer. AllocationId *string `type:"string"` + // [Network Load Balancers] The IPv6 address. + IPv6Address *string `type:"string"` + // The static IP address. IpAddress *string `type:"string"` @@ -6728,6 +6700,12 @@ func (s *LoadBalancerAddress) SetAllocationId(v string) *LoadBalancerAddress { return s } +// SetIPv6Address sets the IPv6Address field's value. +func (s *LoadBalancerAddress) SetIPv6Address(v string) *LoadBalancerAddress { + s.IPv6Address = &v + return s +} + // SetIpAddress sets the IpAddress field's value. func (s *LoadBalancerAddress) SetIpAddress(v string) *LoadBalancerAddress { s.IpAddress = &v @@ -6746,6 +6724,11 @@ type LoadBalancerAttribute struct { // The name of the attribute. // + // The following attribute is supported by all load balancers: + // + // * deletion_protection.enabled - Indicates whether deletion protection + // is enabled. The value is true or false. The default is false. + // // The following attributes are supported by both Application Load Balancers // and Network Load Balancers: // @@ -6760,9 +6743,6 @@ type LoadBalancerAttribute struct { // * access_logs.s3.prefix - The prefix for the location in the S3 bucket // for the access logs. // - // * deletion_protection.enabled - Indicates whether deletion protection - // is enabled. The value is true or false. The default is false. - // // The following attributes are supported by only Application Load Balancers: // // * idle_timeout.timeout_seconds - The idle timeout value, in seconds. The @@ -6781,7 +6761,12 @@ type LoadBalancerAttribute struct { // is true or false. The default is true. Elastic Load Balancing requires // that message header names contain only alphanumeric characters and hyphens. // - // The following attributes are supported by only Network Load Balancers: + // * waf.fail_open.enabled - Indicates whether to allow a WAF-enabled load + // balancer to route requests to targets if it is unable to forward the request + // to AWS WAF. The value is true or false. The default is false. + // + // The following attribute is supported by Network Load Balancers and Gateway + // Load Balancers: // // * load_balancing.cross_zone.enabled - Indicates whether cross-zone load // balancing is enabled. The value is true or false. The default is false. @@ -6819,7 +6804,9 @@ type LoadBalancerState struct { // The state code. The initial state of the load balancer is provisioning. After // the load balancer is fully set up and ready to route traffic, its state is - // active. If the load balancer could not be set up, its state is failed. + // active. If load balancer is routing traffic but does not have the resources + // it needs to scale, its state isactive_impaired. If the load balancer could + // not be set up, its state is failed. Code *string `type:"string" enum:"LoadBalancerStateEnum"` // A description of the state. @@ -6863,7 +6850,7 @@ type Matcher struct { // and the default value is 200. You can specify multiple values (for example, // "200,202") or a range of values (for example, "200-299"). // - // For Network Load Balancers, this is "200–399". + // For Network Load Balancers and Gateway Load Balancers, this must be "200–399". HttpCode *string `type:"string"` } @@ -6905,15 +6892,13 @@ type ModifyListenerInput struct { // // * None // - // For more information, see ALPN Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#alpn-policies) + // For more information, see ALPN policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#alpn-policies) // in the Network Load Balancers Guide. AlpnPolicy []*string `type:"list"` // [HTTPS and TLS listeners] The default certificate for the listener. You must // provide exactly one certificate. Set CertificateArn to the certificate ARN // but do not set IsDefault. - // - // To create a certificate list, use AddListenerCertificates. Certificates []*Certificate `type:"list"` // The actions for the default rule. @@ -6924,37 +6909,22 @@ type ModifyListenerInput struct { // ListenerArn is a required field ListenerArn *string `type:"string" required:"true"` - // The port for connections from clients to the load balancer. + // The port for connections from clients to the load balancer. You cannot specify + // a port for a Gateway Load Balancer. Port *int64 `min:"1" type:"integer"` // The protocol for connections from clients to the load balancer. Application // Load Balancers support the HTTP and HTTPS protocols. Network Load Balancers - // support the TCP, TLS, UDP, and TCP_UDP protocols. + // support the TCP, TLS, UDP, and TCP_UDP protocols. You can’t change the + // protocol to UDP or TCP_UDP if dual-stack mode is enabled. You cannot specify + // a protocol for a Gateway Load Balancer. Protocol *string `type:"string" enum:"ProtocolEnum"` // [HTTPS and TLS listeners] The security policy that defines which protocols - // and ciphers are supported. The following are the possible values: - // - // * ELBSecurityPolicy-2016-08 - // - // * ELBSecurityPolicy-TLS-1-0-2015-04 - // - // * ELBSecurityPolicy-TLS-1-1-2017-01 - // - // * ELBSecurityPolicy-TLS-1-2-2017-01 - // - // * ELBSecurityPolicy-TLS-1-2-Ext-2018-06 - // - // * ELBSecurityPolicy-FS-2018-06 - // - // * ELBSecurityPolicy-FS-1-1-2019-08 - // - // * ELBSecurityPolicy-FS-1-2-2019-08 - // - // * ELBSecurityPolicy-FS-1-2-Res-2019-08 + // and ciphers are supported. // - // For more information, see Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) - // in the Application Load Balancers Guide and Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) + // For more information, see Security policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) + // in the Application Load Balancers Guide or Security policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) // in the Network Load Balancers Guide. SslPolicy *string `type:"string"` } @@ -7306,8 +7276,7 @@ type ModifyTargetGroupInput struct { HealthCheckEnabled *bool `type:"boolean"` // The approximate amount of time, in seconds, between health checks of an individual - // target. For HTTP and HTTPS health checks, the range is 5 to 300 seconds. - // For TPC health checks, the supported values are 10 or 30 seconds. + // target. For TCP health checks, the supported values are 10 or 30 seconds. // // With Network Load Balancers, you can't modify this setting. HealthCheckIntervalSeconds *int64 `min:"5" type:"integer"` @@ -7325,8 +7294,8 @@ type ModifyTargetGroupInput struct { // The protocol the load balancer uses when performing health checks on targets. // The TCP protocol is supported for health checks only if the protocol of the - // target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols - // are not supported for health checks. + // target group is TCP, TLS, UDP, or TCP_UDP. The GENEVE, TLS, UDP, and TCP_UDP + // protocols are not supported for health checks. // // With Network Load Balancers, you can't modify this setting. HealthCheckProtocol *string `type:"string" enum:"ProtocolEnum"` @@ -8156,7 +8125,8 @@ type SetIpAddressTypeInput struct { // The IP address type. The possible values are ipv4 (for IPv4 addresses) and // dualstack (for IPv4 and IPv6 addresses). Internal load balancers must use - // ipv4. Network Load Balancers must use ipv4. + // ipv4. You can’t specify dualstack for a load balancer with a UDP or TCP_UDP + // listener. // // IpAddressType is a required field IpAddressType *string `type:"string" required:"true" enum:"IpAddressType"` @@ -8377,6 +8347,13 @@ func (s *SetSecurityGroupsOutput) SetSecurityGroupIds(v []*string) *SetSecurityG type SetSubnetsInput struct { _ struct{} `type:"structure"` + // [Network Load Balancers] The type of IP addresses used by the subnets for + // your load balancer. The possible values are ipv4 (for IPv4 addresses) and + // dualstack (for IPv4 and IPv6 addresses). You can’t specify dualstack for + // a load balancer with a UDP or TCP_UDP listener. Internal load balancers must + // use ipv4. + IpAddressType *string `type:"string" enum:"IpAddressType"` + // The Amazon Resource Name (ARN) of the load balancer. // // LoadBalancerArn is a required field @@ -8388,16 +8365,32 @@ type SetSubnetsInput struct { // [Application Load Balancers] You must specify subnets from at least two Availability // Zones. You cannot specify Elastic IP addresses for your subnets. // + // [Application Load Balancers on Outposts] You must specify one Outpost subnet. + // + // [Application Load Balancers on Local Zones] You can specify subnets from + // one or more Local Zones. + // // [Network Load Balancers] You can specify subnets from one or more Availability - // Zones. If you need static IP addresses for your internet-facing load balancer, - // you can specify one Elastic IP address per subnet. For internal load balancers, + // Zones. You can specify one Elastic IP address per subnet if you need static + // IP addresses for your internet-facing load balancer. For internal load balancers, // you can specify one private IP address per subnet from the IPv4 range of - // the subnet. + // the subnet. For internet-facing load balancer, you can specify one IPv6 address + // per subnet. SubnetMappings []*SubnetMapping `type:"list"` - // The IDs of the public subnets. You must specify subnets from at least two - // Availability Zones. You can specify only one subnet per Availability Zone. - // You must specify either subnets or subnet mappings. + // The IDs of the public subnets. You can specify only one subnet per Availability + // Zone. You must specify either subnets or subnet mappings. + // + // [Application Load Balancers] You must specify subnets from at least two Availability + // Zones. + // + // [Application Load Balancers on Outposts] You must specify one Outpost subnet. + // + // [Application Load Balancers on Local Zones] You can specify subnets from + // one or more Local Zones. + // + // [Network Load Balancers] You can specify subnets from one or more Availability + // Zones. Subnets []*string `type:"list"` } @@ -8424,6 +8417,12 @@ func (s *SetSubnetsInput) Validate() error { return nil } +// SetIpAddressType sets the IpAddressType field's value. +func (s *SetSubnetsInput) SetIpAddressType(v string) *SetSubnetsInput { + s.IpAddressType = &v + return s +} + // SetLoadBalancerArn sets the LoadBalancerArn field's value. func (s *SetSubnetsInput) SetLoadBalancerArn(v string) *SetSubnetsInput { s.LoadBalancerArn = &v @@ -8447,6 +8446,9 @@ type SetSubnetsOutput struct { // Information about the subnets. AvailabilityZones []*AvailabilityZone `type:"list"` + + // [Network Load Balancers] The IP address type. + IpAddressType *string `type:"string" enum:"IpAddressType"` } // String returns the string representation @@ -8465,6 +8467,12 @@ func (s *SetSubnetsOutput) SetAvailabilityZones(v []*AvailabilityZone) *SetSubne return s } +// SetIpAddressType sets the IpAddressType field's value. +func (s *SetSubnetsOutput) SetIpAddressType(v string) *SetSubnetsOutput { + s.IpAddressType = &v + return s +} + // Information about a source IP condition. // // You can use this condition to route based on the IP address of the source @@ -8549,6 +8557,9 @@ type SubnetMapping struct { // an internet-facing load balancer. AllocationId *string `type:"string"` + // [Network Load Balancers] The IPv6 address. + IPv6Address *string `type:"string"` + // [Network Load Balancers] The private IPv4 address for an internal load balancer. PrivateIPv4Address *string `type:"string"` @@ -8572,6 +8583,12 @@ func (s *SubnetMapping) SetAllocationId(v string) *SubnetMapping { return s } +// SetIPv6Address sets the IPv6Address field's value. +func (s *SubnetMapping) SetIPv6Address(v string) *SubnetMapping { + s.IPv6Address = &v + return s +} + // SetPrivateIPv4Address sets the PrivateIPv4Address field's value. func (s *SubnetMapping) SetPrivateIPv4Address(v string) *SubnetMapping { s.PrivateIPv4Address = &v @@ -8698,8 +8715,8 @@ type TargetDescription struct { // Id is a required field Id *string `type:"string" required:"true"` - // The port on which the target is listening. Not used if the target is a Lambda - // function. + // The port on which the target is listening. If the target group protocol is + // GENEVE, the supported port is 6081. Not used if the target is a Lambda function. Port *int64 `min:"1" type:"integer"` } @@ -8764,7 +8781,8 @@ type TargetGroup struct { // The port to use to connect with the target. HealthCheckPort *string `type:"string"` - // The protocol to use to connect with the target. + // The protocol to use to connect with the target. The GENEVE, TLS, UDP, and + // TCP_UDP protocols are not supported for health checks. HealthCheckProtocol *string `type:"string" enum:"ProtocolEnum"` // The amount of time, in seconds, during which no response means a failed health @@ -8801,8 +8819,9 @@ type TargetGroup struct { TargetGroupName *string `type:"string"` // The type of target that you must specify when registering targets with this - // target group. The possible values are instance (targets are specified by - // instance ID) or ip (targets are specified by IP address). + // target group. The possible values are instance (register targets by instance + // ID), ip (register targets by IP address), or lambda (register a single Lambda + // function as a target). TargetType *string `type:"string" enum:"TargetTypeEnum"` // The number of consecutive health check failures required before considering @@ -8931,8 +8950,7 @@ type TargetGroupAttribute struct { // The name of the attribute. // - // The following attributes are supported by both Application Load Balancers - // and Network Load Balancers: + // The following attribute is supported by all load balancers: // // * deregistration_delay.timeout_seconds - The amount of time, in seconds, // for Elastic Load Balancing to wait before changing the state of a deregistering @@ -8940,12 +8958,15 @@ type TargetGroupAttribute struct { // value is 300 seconds. If the target is a Lambda function, this attribute // is not supported. // + // The following attributes are supported by both Application Load Balancers + // and Network Load Balancers: + // // * stickiness.enabled - Indicates whether sticky sessions are enabled. // The value is true or false. The default is false. // // * stickiness.type - The type of sticky sessions. The possible values are - // lb_cookie for Application Load Balancers or source_ip for Network Load - // Balancers. + // lb_cookie and app_cookie for Application Load Balancers or source_ip for + // Network Load Balancers. // // The following attributes are supported only if the load balancer is an Application // Load Balancer and the target is an instance or an IP address: @@ -8960,6 +8981,16 @@ type TargetGroupAttribute struct { // its full share of traffic. The range is 30-900 seconds (15 minutes). The // default is 0 seconds (disabled). // + // * stickiness.app_cookie.cookie_name - Indicates the name of the application-based + // cookie. Names that start with the following names are not allowed: AWSALB, + // AWSALBAPP, and AWSALBTG. They're reserved for use by the load balancer. + // + // * stickiness.app_cookie.duration_seconds - The time period, in seconds, + // during which requests from a client should be routed to the same target. + // After this time period expires, the application-based cookie is considered + // stale. The range is 1 second to 1 week (604800 seconds). The default value + // is 1 day (86400 seconds). + // // * stickiness.lb_cookie.duration_seconds - The time period, in seconds, // during which requests from a client should be routed to the same target. // After this time period expires, the load balancer-generated cookie is @@ -8976,7 +9007,17 @@ type TargetGroupAttribute struct { // contains a duplicate header field name or query parameter key, the load // balancer uses the last value sent by the client. // - // The following attribute is supported only by Network Load Balancers: + // The following attributes are supported only by Network Load Balancers: + // + // * deregistration_delay.connection_termination.enabled - Indicates whether + // the load balancer terminates connections at the end of the deregistration + // timeout. The value is true or false. The default is false. + // + // * preserve_client_ip.enabled - Indicates whether client IP preservation + // is enabled. The value is true or false. The default is disabled if the + // target group type is IP address and the target group protocol is TCP or + // TLS. Otherwise, the default is enabled. Client IP preservation cannot + // be disabled for UDP and TCP_UDP target groups. // // * proxy_protocol_v2.enabled - Indicates whether Proxy Protocol version // 2 is enabled. The value is true or false. The default is false. @@ -9101,10 +9142,11 @@ type TargetHealth struct { // values: // // * Target.ResponseCodeMismatch - The health checks did not return an expected - // HTTP code. Applies only to Application Load Balancers. + // HTTP code. Applies only to Application Load Balancers and Gateway Load + // Balancers. // // * Target.Timeout - The health check requests timed out. Applies only to - // Application Load Balancers. + // Application Load Balancers and Gateway Load Balancers. // // * Target.FailedHealthChecks - The load balancer received an error while // establishing a connection to the target or the target response was malformed. @@ -9346,6 +9388,9 @@ const ( // LoadBalancerTypeEnumNetwork is a LoadBalancerTypeEnum enum value LoadBalancerTypeEnumNetwork = "network" + + // LoadBalancerTypeEnumGateway is a LoadBalancerTypeEnum enum value + LoadBalancerTypeEnumGateway = "gateway" ) // LoadBalancerTypeEnum_Values returns all elements of the LoadBalancerTypeEnum enum @@ -9353,6 +9398,7 @@ func LoadBalancerTypeEnum_Values() []string { return []string{ LoadBalancerTypeEnumApplication, LoadBalancerTypeEnumNetwork, + LoadBalancerTypeEnumGateway, } } @@ -9374,6 +9420,9 @@ const ( // ProtocolEnumTcpUdp is a ProtocolEnum enum value ProtocolEnumTcpUdp = "TCP_UDP" + + // ProtocolEnumGeneve is a ProtocolEnum enum value + ProtocolEnumGeneve = "GENEVE" ) // ProtocolEnum_Values returns all elements of the ProtocolEnum enum @@ -9385,6 +9434,7 @@ func ProtocolEnum_Values() []string { ProtocolEnumTls, ProtocolEnumUdp, ProtocolEnumTcpUdp, + ProtocolEnumGeneve, } } diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/elbv2/doc.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/elbv2/doc.go index 9a67fe299321..e542d15bcc42 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/elbv2/doc.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/elbv2/doc.go @@ -15,16 +15,18 @@ // the targets. // // Elastic Load Balancing supports the following types of load balancers: Application -// Load Balancers, Network Load Balancers, and Classic Load Balancers. This -// reference covers Application Load Balancers and Network Load Balancers. -// -// An Application Load Balancer makes routing and load balancing decisions at -// the application layer (HTTP/HTTPS). A Network Load Balancer makes routing -// and load balancing decisions at the transport layer (TCP/TLS). Both Application -// Load Balancers and Network Load Balancers can route requests to one or more -// ports on each EC2 instance or container instance in your virtual private -// cloud (VPC). For more information, see the Elastic Load Balancing User Guide -// (https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/). +// Load Balancers, Network Load Balancers, Gateway Load Balancers, and Classic +// Load Balancers. This reference covers the following load balancer types: +// +// * Application Load Balancer - Operates at the application layer (layer +// 7) and supports HTTP and HTTPS. +// +// * Network Load Balancer - Operates at the transport layer (layer 4) and +// supports TCP, TLS, and UDP. +// +// * Gateway Load Balancer - Operates at the network layer (layer 3). +// +// For more information, see the Elastic Load Balancing User Guide (https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/). // // All Elastic Load Balancing operations are idempotent, which means that they // complete at most one time. If you repeat an operation, it succeeds. diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/kms/api.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/kms/api.go index 8e2aae8e5d63..0a9db87ab0e7 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/kms/api.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/kms/api.go @@ -59,7 +59,6 @@ func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *requ // // Cancels the deletion of a customer master key (CMK). When this operation // succeeds, the key state of the CMK is Disabled. To enable the CMK, use EnableKey. -// You cannot perform this operation on a CMK in a different AWS account. // // For more information about scheduling and canceling deletion of a CMK, see // Deleting Customer Master Keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) @@ -69,6 +68,14 @@ func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *requ // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:CancelKeyDeletion (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: ScheduleKeyDeletion +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -208,6 +215,24 @@ func (c *KMS) ConnectCustomKeyStoreRequest(input *ConnectCustomKeyStoreInput) (r // see Troubleshooting a Custom Key Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a custom key +// store in a different AWS account. +// +// Required permissions: kms:ConnectCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) +// +// Related operations +// +// * CreateCustomKeyStore +// +// * DeleteCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * DisconnectCustomKeyStore +// +// * UpdateCustomKeyStore +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -349,71 +374,53 @@ func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, // CreateAlias API operation for AWS Key Management Service. // -// Creates a display name for a customer managed customer master key (CMK). -// You can use an alias to identify a CMK in cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations), -// such as Encrypt and GenerateDataKey. You can change the CMK associated with -// the alias at any time. +// Creates a friendly name for a customer master key (CMK). You can use an alias +// to identify a CMK in the AWS KMS console, in the DescribeKey operation and +// in cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations), +// such as Encrypt and GenerateDataKey. +// +// You can also change the CMK that's associated with the alias (UpdateAlias) +// or delete the alias (DeleteAlias) at any time. These operations don't affect +// the underlying CMK. // -// Aliases are easier to remember than key IDs. They can also help to simplify -// your applications. For example, if you use an alias in your code, you can -// change the CMK your code uses by associating a given alias with a different -// CMK. +// You can associate the alias with any customer managed CMK in the same AWS +// Region. Each alias is associated with only on CMK at a time, but a CMK can +// have multiple aliases. A valid CMK is required. You can't create an alias +// without a CMK. // -// To run the same code in multiple AWS regions, use an alias in your code, -// such as alias/ApplicationKey. Then, in each AWS Region, create an alias/ApplicationKey -// alias that is associated with a CMK in that Region. When you run your code, -// it uses the alias/ApplicationKey CMK for that AWS Region without any Region-specific -// code. +// The alias must be unique in the account and Region, but you can have aliases +// with the same name in different Regions. For detailed information about aliases, +// see Using aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html) +// in the AWS Key Management Service Developer Guide. // // This operation does not return a response. To get the alias that you created, // use the ListAliases operation. // -// To use aliases successfully, be aware of the following information. +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the AWS Key Management Service Developer Guide. // -// * Each alias points to only one CMK at a time, although a single CMK can -// have multiple aliases. The alias and its associated CMK must be in the -// same AWS account and Region. +// Cross-account use: No. You cannot perform this operation on an alias in a +// different AWS account. // -// * You can associate an alias with any customer managed CMK in the same -// AWS account and Region. However, you do not have permission to associate -// an alias with an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) -// or an AWS owned CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk). +// Required permissions // -// * To change the CMK associated with an alias, use the UpdateAlias operation. -// The current CMK and the new CMK must be the same type (both symmetric -// or both asymmetric) and they must have the same key usage (ENCRYPT_DECRYPT -// or SIGN_VERIFY). This restriction prevents cryptographic errors in code -// that uses aliases. +// * kms:CreateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the alias (IAM policy). // -// * The alias name must begin with alias/ followed by a name, such as alias/ExampleAlias. -// It can contain only alphanumeric characters, forward slashes (/), underscores -// (_), and dashes (-). The alias name cannot begin with alias/aws/. The -// alias/aws/ prefix is reserved for AWS managed CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). +// * kms:CreateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the CMK (key policy). // -// * The alias name must be unique within an AWS Region. However, you can -// use the same alias name in multiple Regions of the same AWS account. Each -// instance of the alias is associated with a CMK in its Region. +// For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the AWS Key Management Service Developer Guide. // -// * After you create an alias, you cannot change its alias name. However, -// you can use the DeleteAlias operation to delete the alias and then create -// a new alias with the desired name. +// Related operations: // -// * You can use an alias name or alias ARN to identify a CMK in AWS KMS -// cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) -// and in the DescribeKey operation. However, you cannot use alias names -// or alias ARNs in API operations that manage CMKs, such as DisableKey or -// GetKeyPolicy. For information about the valid CMK identifiers for each -// AWS KMS API operation, see the descriptions of the KeyId parameter in -// the API operation documentation. +// * DeleteAlias // -// Because an alias is not a property of a CMK, you can delete and change the -// aliases of a CMK without affecting the CMK. Also, aliases do not appear in -// the response from the DescribeKey operation. To get the aliases and alias -// ARNs of CMKs in each AWS account and Region, use the ListAliases operation. +// * ListAliases // -// The CMK that you use for this operation must be in a compatible key state. -// For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// * UpdateAlias // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -545,6 +552,24 @@ func (c *KMS) CreateCustomKeyStoreRequest(input *CreateCustomKeyStoreInput) (req // For help with failures, see Troubleshooting a Custom Key Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a custom key +// store in a different AWS account. +// +// Required permissions: kms:CreateCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy). +// +// Related operations: +// +// * ConnectCustomKeyStore +// +// * DeleteCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * DisconnectCustomKeyStore +// +// * UpdateCustomKeyStore +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -723,17 +748,30 @@ func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, // // For information about symmetric and asymmetric CMKs, see Using Symmetric // and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) -// in the AWS Key Management Service Developer Guide. -// -// To perform this operation on a CMK in a different AWS account, specify the -// key ARN in the value of the KeyId parameter. For more information about grants, -// see Grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) +// in the AWS Key Management Service Developer Guide. For more information about +// grants, see Grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) // in the AWS Key Management Service Developer Guide . // // The CMK that you use for this operation must be in a compatible key state. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: Yes. To perform this operation on a CMK in a different +// AWS account, specify the key ARN in the value of the KeyId parameter. +// +// Required permissions: kms:CreateGrant (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * ListGrants +// +// * ListRetirableGrants +// +// * RetireGrant +// +// * RevokeGrant +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -844,8 +882,7 @@ func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, out // CreateKey API operation for AWS Key Management Service. // // Creates a unique customer managed customer master key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master-keys) -// (CMK) in your AWS account and Region. You cannot use this operation to create -// a CMK in a different AWS account. +// (CMK) in your AWS account and Region. // // You can use the CreateKey operation to create symmetric or asymmetric CMKs. // @@ -906,6 +943,23 @@ func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, out // about custom key stores in AWS KMS see Using Custom Key Stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) // in the AWS Key Management Service Developer Guide . // +// Cross-account use: No. You cannot use this operation to create a CMK in a +// different AWS account. +// +// Required permissions: kms:CreateKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy). To use the Tags parameter, kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy). For examples and information about related permissions, see +// Allow a user to create CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-create-key) +// in the AWS Key Management Service Developer Guide. +// +// Related operations: +// +// * DescribeKey +// +// * ListKeys +// +// * ScheduleKeyDeletion +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1091,12 +1145,15 @@ func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output // These libraries return a ciphertext format that is incompatible with AWS // KMS. // -// If the ciphertext was encrypted under a symmetric CMK, you do not need to -// specify the CMK or the encryption algorithm. AWS KMS can get this information -// from metadata that it adds to the symmetric ciphertext blob. However, if -// you prefer, you can specify the KeyId to ensure that a particular CMK is -// used to decrypt the ciphertext. If you specify a different CMK than the one -// used to encrypt the ciphertext, the Decrypt operation fails. +// If the ciphertext was encrypted under a symmetric CMK, the KeyId parameter +// is optional. AWS KMS can get this information from metadata that it adds +// to the symmetric ciphertext blob. This feature adds durability to your implementation +// by ensuring that authorized users can decrypt ciphertext decades after it +// was encrypted, even if they've lost track of the CMK ID. However, specifying +// the CMK is always recommended as a best practice. When you use the KeyId +// parameter to specify a CMK, AWS KMS only uses the CMK you specify. If the +// ciphertext was encrypted under a different CMK, the Decrypt operation fails. +// This practice ensures that you use the CMK that you intend. // // Whenever possible, use key policies to give users permission to call the // Decrypt operation on a particular CMK, instead of using IAM policies. Otherwise, @@ -1104,12 +1161,30 @@ func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output // on all CMKs. This user could decrypt ciphertext that was encrypted by CMKs // in other accounts if the key policy for the cross-account CMK permits it. // If you must use an IAM policy for Decrypt permissions, limit the user to -// particular CMKs or particular trusted accounts. +// particular CMKs or particular trusted accounts. For details, see Best practices +// for IAM policies (https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policies-best-practices) +// in the AWS Key Management Service Developer Guide. // // The CMK that you use for this operation must be in a compatible key state. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: Yes. You can decrypt a ciphertext using a CMK in a different +// AWS account. +// +// Required permissions: kms:Decrypt (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * Encrypt +// +// * GenerateDataKey +// +// * GenerateDataKeyPair +// +// * ReEncrypt +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1244,8 +1319,7 @@ func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, // DeleteAlias API operation for AWS Key Management Service. // -// Deletes the specified alias. You cannot perform this operation on an alias -// in a different AWS account. +// Deletes the specified alias. // // Because an alias is not a property of a CMK, you can delete and change the // aliases of a CMK without affecting the CMK. Also, aliases do not appear in @@ -1256,6 +1330,28 @@ func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, // to delete the current alias and CreateAlias to create a new alias. To associate // an existing alias with a different customer master key (CMK), call UpdateAlias. // +// Cross-account use: No. You cannot perform this operation on an alias in a +// different AWS account. +// +// Required permissions +// +// * kms:DeleteAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the alias (IAM policy). +// +// * kms:DeleteAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the CMK (key policy). +// +// For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the AWS Key Management Service Developer Guide. +// +// Related operations: +// +// * CreateAlias +// +// * ListAliases +// +// * UpdateAlias +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1381,6 +1477,24 @@ func (c *KMS) DeleteCustomKeyStoreRequest(input *DeleteCustomKeyStoreInput) (req // feature in AWS KMS, which combines the convenience and extensive integration // of AWS KMS with the isolation and control of a single-tenant key store. // +// Cross-account use: No. You cannot perform this operation on a custom key +// store in a different AWS account. +// +// Required permissions: kms:DeleteCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) +// +// Related operations: +// +// * ConnectCustomKeyStore +// +// * CreateCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * DisconnectCustomKeyStore +// +// * UpdateCustomKeyStore +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1492,8 +1606,7 @@ func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialI // Deletes key material that you previously imported. This operation makes the // specified customer master key (CMK) unusable. For more information about // importing key material into AWS KMS, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) -// in the AWS Key Management Service Developer Guide. You cannot perform this -// operation on a CMK in a different AWS account. +// in the AWS Key Management Service Developer Guide. // // When the specified CMK is in the PendingDeletion state, this operation does // not change the CMK's state. Otherwise, it changes the CMK's state to PendingImport. @@ -1505,6 +1618,18 @@ func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialI // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:DeleteImportedKeyMaterial (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * GetParametersForImport +// +// * ImportKeyMaterial +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1635,6 +1760,24 @@ func (c *KMS) DescribeCustomKeyStoresRequest(input *DescribeCustomKeyStoresInput // Key Stores (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) // topic in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a custom key +// store in a different AWS account. +// +// Required permissions: kms:DescribeCustomKeyStores (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) +// +// Related operations: +// +// * ConnectCustomKeyStore +// +// * CreateCustomKeyStore +// +// * DeleteCustomKeyStore +// +// * DisconnectCustomKeyStore +// +// * UpdateCustomKeyStore +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1750,8 +1893,27 @@ func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, // Then, it associates the alias with the new CMK, and returns the KeyId and // Arn of the new CMK in the response. // -// To perform this operation on a CMK in a different AWS account, specify the -// key ARN or alias ARN in the value of the KeyId parameter. +// Cross-account use: Yes. To perform this operation with a CMK in a different +// AWS account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// +// Required permissions: kms:DescribeKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * GetKeyPolicy +// +// * GetKeyRotationStatus +// +// * ListAliases +// +// * ListGrants +// +// * ListKeys +// +// * ListResourceTags +// +// * ListRetirableGrants // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1844,9 +2006,8 @@ func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, o // DisableKey API operation for AWS Key Management Service. // -// Sets the state of a customer master key (CMK) to disabled, thereby preventing -// its use for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations). -// You cannot perform this operation on a CMK in a different AWS account. +// Sets the state of a customer master key (CMK) to disabled. This change temporarily +// prevents use of the CMK for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations). // // For more information about how key state affects the use of a CMK, see How // Key State Affects the Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) @@ -1856,6 +2017,14 @@ func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, o // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:DisableKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: EnableKey +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1960,12 +2129,23 @@ func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *re // // You cannot enable automatic rotation of asymmetric CMKs, CMKs with imported // key material, or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). -// You cannot perform this operation on a CMK in a different AWS account. // // The CMK that you use for this operation must be in a compatible key state. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:DisableKeyRotation (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * EnableKeyRotation +// +// * GetKeyRotationStatus +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2094,6 +2274,24 @@ func (c *KMS) DisconnectCustomKeyStoreRequest(input *DisconnectCustomKeyStoreInp // feature in AWS KMS, which combines the convenience and extensive integration // of AWS KMS with the isolation and control of a single-tenant key store. // +// Cross-account use: No. You cannot perform this operation on a custom key +// store in a different AWS account. +// +// Required permissions: kms:DisconnectCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) +// +// Related operations: +// +// * ConnectCustomKeyStore +// +// * CreateCustomKeyStore +// +// * DeleteCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * UpdateCustomKeyStore +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2198,12 +2396,19 @@ func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, out // // Sets the key state of a customer master key (CMK) to enabled. This allows // you to use the CMK for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations). -// You cannot perform this operation on a CMK in a different AWS account. // // The CMK that you use for this operation must be in a compatible key state. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:EnableKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: DisableKey +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2309,8 +2514,7 @@ func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *requ // EnableKeyRotation API operation for AWS Key Management Service. // // Enables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) -// for the specified symmetric customer master key (CMK). You cannot perform -// this operation on a CMK in a different AWS account. +// for the specified symmetric customer master key (CMK). // // You cannot enable automatic rotation of asymmetric CMKs, CMKs with imported // key material, or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). @@ -2319,6 +2523,18 @@ func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *requ // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:EnableKeyRotation (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * DisableKeyRotation +// +// * GetKeyRotationStatus +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2484,8 +2700,19 @@ func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // -// To perform this operation on a CMK in a different AWS account, specify the -// key ARN or alias ARN in the value of the KeyId parameter. +// Cross-account use: Yes. To perform this operation with a CMK in a different +// AWS account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// +// Required permissions: kms:Encrypt (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * Decrypt +// +// * GenerateDataKey +// +// * GenerateDataKeyPair // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2663,6 +2890,24 @@ func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request. // Use the plaintext data key to decrypt data outside of AWS KMS, then erase // the plaintext data key from memory. // +// Cross-account use: Yes. To perform this operation with a CMK in a different +// AWS account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// +// Required permissions: kms:GenerateDataKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKeyPair +// +// * GenerateDataKeyPairWithoutPlaintext +// +// * GenerateDataKeyWithoutPlaintext +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2820,6 +3065,24 @@ func (c *KMS) GenerateDataKeyPairRequest(input *GenerateDataKeyPairInput) (req * // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: Yes. To perform this operation with a CMK in a different +// AWS account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// +// Required permissions: kms:GenerateDataKeyPair (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKey +// +// * GenerateDataKeyPairWithoutPlaintext +// +// * GenerateDataKeyWithoutPlaintext +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2974,6 +3237,24 @@ func (c *KMS) GenerateDataKeyPairWithoutPlaintextRequest(input *GenerateDataKeyP // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: Yes. To perform this operation with a CMK in a different +// AWS account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// +// Required permissions: kms:GenerateDataKeyPairWithoutPlaintext (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKey +// +// * GenerateDataKeyPair +// +// * GenerateDataKeyWithoutPlaintext +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3140,6 +3421,24 @@ func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWitho // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: Yes. To perform this operation with a CMK in a different +// AWS account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// +// Required permissions: kms:GenerateDataKeyWithoutPlaintext (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKey +// +// * GenerateDataKeyPair +// +// * GenerateDataKeyPairWithoutPlaintext +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3270,6 +3569,9 @@ func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Re // AWS Key Management Service Cryptographic Details (https://d0.awsstatic.com/whitepapers/KMS-Cryptographic-Details.pdf) // whitepaper. // +// Required permissions: kms:GenerateRandom (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3375,8 +3677,15 @@ func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Reques // GetKeyPolicy API operation for AWS Key Management Service. // -// Gets a key policy attached to the specified customer master key (CMK). You -// cannot perform this operation on a CMK in a different AWS account. +// Gets a key policy attached to the specified customer master key (CMK). +// +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:GetKeyPolicy (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: PutKeyPolicy // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3496,8 +3805,17 @@ func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req // status is false and AWS KMS does not rotate the backing key. If you cancel // the deletion, the original key rotation status is restored. // -// To perform this operation on a CMK in a different AWS account, specify the -// key ARN in the value of the KeyId parameter. +// Cross-account use: Yes. To perform this operation on a CMK in a different +// AWS account, specify the key ARN in the value of the KeyId parameter. +// +// Required permissions: kms:GetKeyRotationStatus (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * DisableKeyRotation +// +// * EnableKeyRotation // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3626,6 +3944,18 @@ func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:GetParametersForImport (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * ImportKeyMaterial +// +// * DeleteImportedKeyMaterial +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3770,6 +4100,14 @@ func (c *KMS) GetPublicKeyRequest(input *GetPublicKeyInput) (req *request.Reques // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: Yes. To perform this operation with a CMK in a different +// AWS account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// +// Required permissions: kms:GetPublicKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: CreateKey +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3945,6 +4283,18 @@ func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *requ // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:ImportKeyMaterial (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * DeleteImportedKeyMaterial +// +// * GetParametersForImport +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -4076,12 +4426,12 @@ func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, // ListAliases API operation for AWS Key Management Service. // -// Gets a list of aliases in the caller's AWS account and region. You cannot -// list aliases in other accounts. For more information about aliases, see CreateAlias. +// Gets a list of aliases in the caller's AWS account and region. For more information +// about aliases, see CreateAlias. // -// By default, the ListAliases command returns all aliases in the account and -// region. To get only the aliases that point to a particular customer master -// key (CMK), use the KeyId parameter. +// By default, the ListAliases operation returns all aliases in the account +// and region. To get only the aliases associated with a particular customer +// master key (CMK), use the KeyId parameter. // // The ListAliases response can include aliases that you created and associated // with your customer managed CMKs, and aliases that AWS created and associated @@ -4093,6 +4443,22 @@ func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, // a CMK. Aliases that AWS creates in your account, including predefined aliases, // do not count against your AWS KMS aliases quota (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#aliases-limit). // +// Cross-account use: No. ListAliases does not return aliases in other AWS accounts. +// +// Required permissions: kms:ListAliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) +// +// For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the AWS Key Management Service Developer Guide. +// +// Related operations: +// +// * CreateAlias +// +// * DeleteAlias +// +// * UpdateAlias +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -4247,8 +4613,8 @@ func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, o // // Gets a list of all grants for the specified customer master key (CMK). // -// To perform this operation on a CMK in a different AWS account, specify the -// key ARN in the value of the KeyId parameter. +// You must specify the CMK in all requests. You can filter the grant list by +// grant ID or grantee principal. // // The GranteePrincipal field in the ListGrants response usually contains the // user or role designated as the grantee principal in the grant. However, when @@ -4256,6 +4622,22 @@ func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, o // field contains the service principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services), // which might represent several different grantee principals. // +// Cross-account use: Yes. To perform this operation on a CMK in a different +// AWS account, specify the key ARN in the value of the KeyId parameter. +// +// Required permissions: kms:ListGrants (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * CreateGrant +// +// * ListRetirableGrants +// +// * RetireGrant +// +// * RevokeGrant +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -4276,6 +4658,9 @@ func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, o // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // +// * InvalidGrantIdException +// The request was rejected because the specified GrantId is not valid. +// // * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. @@ -4419,7 +4804,18 @@ func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request. // Gets the names of the key policies that are attached to a customer master // key (CMK). This operation is designed to get policy names that you can use // in a GetKeyPolicy operation. However, the only valid policy name is default. -// You cannot perform this operation on a CMK in a different AWS account. +// +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:ListKeyPolicies (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * GetKeyPolicy +// +// * PutKeyPolicy // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4580,6 +4976,22 @@ func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, outpu // Gets a list of all customer master keys (CMKs) in the caller's AWS account // and Region. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:ListKeys (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) +// +// Related operations: +// +// * CreateKey +// +// * DescribeKey +// +// * ListAliases +// +// * ListResourceTags +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -4718,9 +5130,24 @@ func (c *KMS) ListResourceTagsRequest(input *ListResourceTagsInput) (req *reques // ListResourceTags API operation for AWS Key Management Service. // -// Returns a list of all tags for the specified customer master key (CMK). +// Returns all tags on the specified customer master key (CMK). +// +// For general information about tags, including the format and syntax, see +// Tagging AWS resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the Amazon Web Services General Reference. For information about using +// tags in AWS KMS, see Tagging keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). +// +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:ListResourceTags (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) // -// You cannot perform this operation on a CMK in a different AWS account. +// Related operations: +// +// * TagResource +// +// * UntagResource // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4812,11 +5239,32 @@ func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req * // ListRetirableGrants API operation for AWS Key Management Service. // -// Returns a list of all grants for which the grant's RetiringPrincipal matches -// the one specified. +// Returns all grants in which the specified principal is the RetiringPrincipal +// in the grant. +// +// You can specify any principal in your AWS account. The grants that are returned +// include grants for CMKs in your AWS account and other AWS accounts. +// +// You might use this operation to determine which grants you may retire. To +// retire a grant, use the RetireGrant operation. +// +// Cross-account use: You must specify a principal in your AWS account. However, +// this operation can return grants in any AWS account. You do not need kms:ListRetirableGrants +// permission (or any other additional permission) in any AWS account other +// than your own. +// +// Required permissions: kms:ListRetirableGrants (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) in your AWS account. // -// A typical use is to list all grants that you are able to retire. To retire -// a grant, use RetireGrant. +// Related operations: +// +// * CreateGrant +// +// * ListGrants +// +// * RetireGrant +// +// * RevokeGrant // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4913,12 +5361,23 @@ func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Reques // PutKeyPolicy API operation for AWS Key Management Service. // -// Attaches a key policy to the specified customer master key (CMK). You cannot -// perform this operation on a CMK in a different AWS account. +// Attaches a key policy to the specified customer master key (CMK). // // For more information about key policies, see Key Policies (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) +// in the AWS Key Management Service Developer Guide. For help writing and formatting +// a JSON policy document, see the IAM JSON Policy Reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) +// in the IAM User Guide . For examples of adding a key policy in multiple programming +// languages, see Setting a key policy (https://docs.aws.amazon.com/kms/latest/developerguide/programming-key-policies.html#put-policy) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: GetKeyPolicy +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -5051,17 +5510,23 @@ func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, out // When you use the ReEncrypt operation, you need to provide information for // the decrypt operation and the subsequent encrypt operation. // -// * If your ciphertext was encrypted under an asymmetric CMK, you must identify -// the source CMK, that is, the CMK that encrypted the ciphertext. You must -// also supply the encryption algorithm that was used. This information is -// required to decrypt the data. -// -// * It is optional, but you can specify a source CMK even when the ciphertext -// was encrypted under a symmetric CMK. This ensures that the ciphertext -// is decrypted only by using a particular CMK. If the CMK that you specify -// cannot decrypt the ciphertext, the ReEncrypt operation fails. -// -// * To reencrypt the data, you must specify the destination CMK, that is, +// * If your ciphertext was encrypted under an asymmetric CMK, you must use +// the SourceKeyId parameter to identify the CMK that encrypted the ciphertext. +// You must also supply the encryption algorithm that was used. This information +// is required to decrypt the data. +// +// * If your ciphertext was encrypted under a symmetric CMK, the SourceKeyId +// parameter is optional. AWS KMS can get this information from metadata +// that it adds to the symmetric ciphertext blob. This feature adds durability +// to your implementation by ensuring that authorized users can decrypt ciphertext +// decades after it was encrypted, even if they've lost track of the CMK +// ID. However, specifying the source CMK is always recommended as a best +// practice. When you use the SourceKeyId parameter to specify a CMK, AWS +// KMS uses only the CMK you specify. If the ciphertext was encrypted under +// a different CMK, the ReEncrypt operation fails. This practice ensures +// that you use the CMK that you intend. +// +// * To reencrypt the data, you must use the DestinationKeyId parameter specify // the CMK that re-encrypts the data after it is decrypted. You can select // a symmetric or asymmetric CMK. If the destination CMK is an asymmetric // CMK, you must also provide the encryption algorithm. The algorithm that @@ -5076,11 +5541,21 @@ func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, out // with asymmetric keys. The standard format for asymmetric key ciphertext // does not include configurable fields. // -// Unlike other AWS KMS API operations, ReEncrypt callers must have two permissions: +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the AWS Key Management Service Developer Guide. // -// * kms:ReEncryptFrom permission on the source CMK +// Cross-account use: Yes. The source CMK and destination CMK can be in different +// AWS accounts. Either or both CMKs can be in a different account than the +// caller. // -// * kms:ReEncryptTo permission on the destination CMK +// Required permissions: +// +// * kms:ReEncryptFrom (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// permission on the source CMK (key policy) +// +// * kms:ReEncryptTo (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// permission on the destination CMK (key policy) // // To permit reencryption from or to a CMK, include the "kms:ReEncrypt*" permission // in your key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html). @@ -5089,9 +5564,15 @@ func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, out // a CMK programmatically or when you use the PutKeyPolicy operation to set // a key policy. // -// The CMK that you use for this operation must be in a compatible key state. -// For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKey +// +// * GenerateDataKeyPair // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5244,6 +5725,24 @@ func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, // A grant ID is a 64 character unique identifier of a grant. The CreateGrant // operation returns both. // +// Cross-account use: Yes. You can retire a grant on a CMK in a different AWS +// account. +// +// Required permissions:: Permission to retire a grant is specified in the grant. +// You cannot control access to this operation in a policy. For more information, +// see Using grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) +// in the AWS Key Management Service Developer Guide. +// +// Related operations: +// +// * CreateGrant +// +// * ListGrants +// +// * ListRetirableGrants +// +// * RevokeGrant +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -5352,8 +5851,21 @@ func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, // Revokes the specified grant for the specified customer master key (CMK). // You can revoke a grant to actively deny operations that depend on it. // -// To perform this operation on a CMK in a different AWS account, specify the -// key ARN in the value of the KeyId parameter. +// Cross-account use: Yes. To perform this operation on a CMK in a different +// AWS account, specify the key ARN in the value of the KeyId parameter. +// +// Required permissions: kms:RevokeGrant (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: +// +// * CreateGrant +// +// * ListGrants +// +// * ListRetirableGrants +// +// * RetireGrant // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5476,8 +5988,6 @@ func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req * // delete the orphaned key material (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key) // from the cluster and its backups. // -// You cannot perform this operation on a CMK in a different AWS account. -// // For more information about scheduling a CMK for deletion, see Deleting Customer // Master Keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) // in the AWS Key Management Service Developer Guide. @@ -5486,6 +5996,18 @@ func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req * // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:ScheduleKeyDeletion (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations +// +// * CancelKeyDeletion +// +// * DisableKey +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -5623,6 +6145,14 @@ func (c *KMS) SignRequest(input *SignInput) (req *request.Request, output *SignO // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: Yes. To perform this operation with a CMK in a different +// AWS account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// +// Required permissions: kms:Sign (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: Verify +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -5743,23 +6273,40 @@ func (c *KMS) TagResourceRequest(input *TagResourceInput) (req *request.Request, // TagResource API operation for AWS Key Management Service. // -// Adds or edits tags for a customer master key (CMK). You cannot perform this -// operation on a CMK in a different AWS account. +// Adds or edits tags on a customer managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). // -// Each tag consists of a tag key and a tag value. Tag keys and tag values are -// both required, but tag values can be empty (null) strings. +// Each tag consists of a tag key and a tag value, both of which are case-sensitive +// strings. The tag value can be an empty (null) string. // -// You can only use a tag key once for each CMK. If you use the tag key again, -// AWS KMS replaces the current tag value with the specified value. +// To add a tag, specify a new tag key and a tag value. To edit a tag, specify +// an existing tag key and a new tag value. // -// For information about the rules that apply to tag keys and tag values, see -// User-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html) -// in the AWS Billing and Cost Management User Guide. +// You can use this operation to tag a customer managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), +// but you cannot tag an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk), +// an AWS owned CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk), +// or an alias. +// +// For general information about tags, including the format and syntax, see +// Tagging AWS resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the Amazon Web Services General Reference. For information about using +// tags in AWS KMS, see Tagging keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). // // The CMK that you use for this operation must be in a compatible key state. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations +// +// * UntagResource +// +// * ListResourceTags +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -5863,16 +6410,35 @@ func (c *KMS) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // UntagResource API operation for AWS Key Management Service. // -// Removes the specified tags from the specified customer master key (CMK). -// You cannot perform this operation on a CMK in a different AWS account. +// Deletes tags from a customer managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). +// To delete a tag, specify the tag key and the CMK. // -// To remove a tag, specify the tag key. To change the tag value of an existing -// tag key, use TagResource. +// When it succeeds, the UntagResource operation doesn't return any output. +// Also, if the specified tag key isn't found on the CMK, it doesn't throw an +// exception or return a response. To confirm that the operation worked, use +// the ListResourceTags operation. +// +// For general information about tags, including the format and syntax, see +// Tagging AWS resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the Amazon Web Services General Reference. For information about using +// tags in AWS KMS, see Tagging keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). // // The CMK that you use for this operation must be in a compatible key state. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:UntagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations +// +// * TagResource +// +// * ListResourceTags +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -5974,8 +6540,7 @@ func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, // Associates an existing AWS KMS alias with a different customer master key // (CMK). Each alias is associated with only one CMK at a time, although a CMK // can have multiple aliases. The alias and the CMK must be in the same AWS -// account and region. You cannot perform this operation on an alias in a different -// AWS account. +// account and region. // // The current and new CMK must be the same type (both symmetric or both asymmetric), // and they must have the same key usage (ENCRYPT_DECRYPT or SIGN_VERIFY). This @@ -5995,6 +6560,31 @@ func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions +// +// * kms:UpdateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the alias (IAM policy). +// +// * kms:UpdateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the current CMK (key policy). +// +// * kms:UpdateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the new CMK (key policy). +// +// For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the AWS Key Management Service Developer Guide. +// +// Related operations: +// +// * CreateAlias +// +// * DeleteAlias +// +// * ListAliases +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -6130,6 +6720,24 @@ func (c *KMS) UpdateCustomKeyStoreRequest(input *UpdateCustomKeyStoreInput) (req // feature in AWS KMS, which combines the convenience and extensive integration // of AWS KMS with the isolation and control of a single-tenant key store. // +// Cross-account use: No. You cannot perform this operation on a custom key +// store in a different AWS account. +// +// Required permissions: kms:UpdateCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) +// +// Related operations: +// +// * ConnectCustomKeyStore +// +// * CreateCustomKeyStore +// +// * DeleteCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * DisconnectCustomKeyStore +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -6298,12 +6906,22 @@ func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req // Updates the description of a customer master key (CMK). To see the description // of a CMK, use DescribeKey. // -// You cannot perform this operation on a CMK in a different AWS account. -// // The CMK that you use for this operation must be in a compatible key state. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. +// +// Required permissions: kms:UpdateKeyDescription (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations +// +// * CreateKey +// +// * DescribeKey +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -6433,6 +7051,14 @@ func (c *KMS) VerifyRequest(input *VerifyInput) (req *request.Request, output *V // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // +// Cross-account use: Yes. To perform this operation with a CMK in a different +// AWS account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// +// Required permissions: kms:Verify (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) +// +// Related operations: Sign +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -6523,6 +7149,10 @@ type AliasListEntry struct { // String that contains the alias. This value begins with alias/. AliasName *string `min:"1" type:"string"` + CreationDate *time.Time `type:"timestamp"` + + LastUpdatedDate *time.Time `type:"timestamp"` + // String that contains the key identifier referred to by the alias. TargetKeyId *string `min:"1" type:"string"` } @@ -6549,6 +7179,18 @@ func (s *AliasListEntry) SetAliasName(v string) *AliasListEntry { return s } +// SetCreationDate sets the CreationDate field's value. +func (s *AliasListEntry) SetCreationDate(v time.Time) *AliasListEntry { + s.CreationDate = &v + return s +} + +// SetLastUpdatedDate sets the LastUpdatedDate field's value. +func (s *AliasListEntry) SetLastUpdatedDate(v time.Time) *AliasListEntry { + s.LastUpdatedDate = &v + return s +} + // SetTargetKeyId sets the TargetKeyId field's value. func (s *AliasListEntry) SetTargetKeyId(v string) *AliasListEntry { s.TargetKeyId = &v @@ -7081,17 +7723,35 @@ type CreateAliasInput struct { _ struct{} `type:"structure"` // Specifies the alias name. This value must begin with alias/ followed by a - // name, such as alias/ExampleAlias. The alias name cannot begin with alias/aws/. - // The alias/aws/ prefix is reserved for AWS managed CMKs. + // name, such as alias/ExampleAlias. + // + // The AliasName value must be string of 1-256 characters. It can contain only + // alphanumeric characters, forward slashes (/), underscores (_), and dashes + // (-). The alias name cannot begin with alias/aws/. The alias/aws/ prefix is + // reserved for AWS managed CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). // // AliasName is a required field AliasName *string `min:"1" type:"string" required:"true"` - // Identifies the CMK to which the alias refers. Specify the key ID or the Amazon - // Resource Name (ARN) of the CMK. You cannot specify another alias. For help - // finding the key ID and ARN, see Finding the Key ID and ARN (https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) + // Associates the alias with the specified customer managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). + // The CMK must be in the same AWS Region. + // + // A valid CMK ID is required. If you supply a null or empty string value, this + // operation returns an error. + // + // For help finding the key ID and ARN, see Finding the Key ID and ARN (https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) // in the AWS Key Management Service Developer Guide. // + // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. + // // TargetKeyId is a required field TargetKeyId *string `min:"1" type:"string" required:"true"` } @@ -7290,6 +7950,10 @@ type CreateGrantInput struct { // specified in this structure. For more information about encryption context, // see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) // in the AWS Key Management Service Developer Guide . + // + // Grant constraints are not applied to operations that do not support an encryption + // context, such as cryptographic operations with asymmetric CMKs and management + // operations, such as DescribeKey or RetireGrant. Constraints *GrantConstraints `type:"structure"` // A list of grant tokens. @@ -7328,8 +7992,8 @@ type CreateGrantInput struct { // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` - // A friendly name for identifying the grant. Use this value to prevent the - // unintended creation of duplicate grants when retrying this request. + // A friendly name for the grant. Use this value to prevent the unintended creation + // of duplicate grants when retrying this request. // // When this value is absent, all CreateGrant requests result in a new grant // with a unique GrantId even if all the supplied parameters are identical. @@ -7339,7 +8003,7 @@ type CreateGrantInput struct { // parameters; if the grant already exists, the original GrantId is returned // without creating a new grant. Note that the returned grant token is unique // with every CreateGrant request, even when a duplicate GrantId is returned. - // All grant tokens obtained in this way can be used interchangeably. + // All grant tokens for the same grant ID can be used interchangeably. Name *string `min:"1" type:"string"` // A list of operations that the grant permits. @@ -7447,7 +8111,7 @@ type CreateGrantOutput struct { // The unique identifier for the grant. // - // You can use the GrantId in a subsequent RetireGrant or RevokeGrant operation. + // You can use the GrantId in a ListGrants, RetireGrant, or RevokeGrant operation. GrantId *string `min:"1" type:"string"` // The grant token. @@ -7615,6 +8279,10 @@ type CreateKeyInput struct { // in the AWS Key Management Service Developer Guide. // // The key policy size quota is 32 kilobytes (32768 bytes). + // + // For help writing and formatting a JSON policy document, see the IAM JSON + // Policy Reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) + // in the IAM User Guide . Policy *string `min:"1" type:"string"` // One or more tags. Each tag consists of a tag key and a tag value. Both the @@ -7627,6 +8295,9 @@ type CreateKeyInput struct { // // Use this parameter to tag the CMK when it is created. To add tags to an existing // CMK, use the TagResource operation. + // + // To use this parameter, you must have kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) + // permission in an IAM policy. Tags []*Tag `type:"list"` } @@ -8175,20 +8846,18 @@ type DecryptInput struct { // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` - // Specifies the customer master key (CMK) that AWS KMS will use to decrypt - // the ciphertext. Enter a key ID of the CMK that was used to encrypt the ciphertext. - // - // If you specify a KeyId value, the Decrypt operation succeeds only if the - // specified CMK was used to encrypt the ciphertext. + // Specifies the customer master key (CMK) that AWS KMS uses to decrypt the + // ciphertext. Enter a key ID of the CMK that was used to encrypt the ciphertext. // // This parameter is required only when the ciphertext was encrypted under an - // asymmetric CMK. Otherwise, AWS KMS uses the metadata that it adds to the - // ciphertext blob to determine which CMK was used to encrypt the ciphertext. - // However, you can use this parameter to ensure that a particular CMK (of any - // kind) is used to decrypt the ciphertext. + // asymmetric CMK. If you used a symmetric CMK, AWS KMS can get the CMK from + // metadata that it adds to the symmetric ciphertext blob. However, it is always + // recommended as a best practice. This practice ensures that you use the CMK + // that you intend. // // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, - // or alias ARN. When using an alias name, prefix it with "alias/". + // or alias ARN. When using an alias name, prefix it with "alias/". To specify + // a CMK in a different AWS account, you must use the key ARN or alias ARN. // // For example: // @@ -8842,8 +9511,8 @@ func (s DisableKeyOutput) GoString() string { type DisableKeyRotationInput struct { _ struct{} `type:"structure"` - // Identifies a symmetric customer master key (CMK). You cannot enable automatic - // rotation of asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks), + // Identifies a symmetric customer master key (CMK). You cannot enable or disable + // automatic rotation of asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks), // CMKs with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html), // or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). // @@ -9753,7 +10422,8 @@ type GenerateDataKeyPairWithoutPlaintextInput struct { // operation. // // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, - // or alias ARN. When using an alias name, prefix it with "alias/". + // or alias ARN. When using an alias name, prefix it with "alias/". To specify + // a CMK in a different AWS account, you must use the key ARN or alias ARN. // // For example: // @@ -10597,7 +11267,7 @@ func (s *GetPublicKeyOutput) SetSigningAlgorithms(v []*string) *GetPublicKeyOutp // a symmetric CMK (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#symmetric-cmks). // Grant constraints are not applied to operations that do not support an encryption // context, such as cryptographic operations with asymmetric CMKs and management -// operations, such as DescribeKey or ScheduleKeyDeletion. +// operations, such as DescribeKey or RetireGrant. // // In a cryptographic operation, the encryption context in the decryption operation // must be an exact, case-sensitive match for the keys and values in the encryption @@ -12075,12 +12745,21 @@ func (s *LimitExceededException) RequestID() string { type ListAliasesInput struct { _ struct{} `type:"structure"` - // Lists only aliases that refer to the specified CMK. The value of this parameter - // can be the ID or Amazon Resource Name (ARN) of a CMK in the caller's account - // and region. You cannot use an alias name or alias ARN in this value. + // Lists only aliases that are associated with the specified CMK. Enter a CMK + // in your AWS account. // // This parameter is optional. If you omit it, ListAliases returns all aliases - // in the account and region. + // in the account and Region. + // + // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. KeyId *string `min:"1" type:"string"` // Use this parameter to specify the maximum number of items to return. When @@ -12192,7 +12871,16 @@ func (s *ListAliasesOutput) SetTruncated(v bool) *ListAliasesOutput { type ListGrantsInput struct { _ struct{} `type:"structure"` - // A unique identifier for the customer master key (CMK). + // Returns only the grant with the specified grant ID. The grant ID uniquely + // identifies the grant. + GrantId *string `min:"1" type:"string"` + + // Returns only grants where the specified principal is the grantee principal + // for the grant. + GranteePrincipal *string `min:"1" type:"string"` + + // Returns only grants for the specified customer master key (CMK). This parameter + // is required. // // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify // a CMK in a different AWS account, you must use the key ARN. @@ -12235,6 +12923,12 @@ func (s ListGrantsInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *ListGrantsInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ListGrantsInput"} + if s.GrantId != nil && len(*s.GrantId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GrantId", 1)) + } + if s.GranteePrincipal != nil && len(*s.GranteePrincipal) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GranteePrincipal", 1)) + } if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } @@ -12254,6 +12948,18 @@ func (s *ListGrantsInput) Validate() error { return nil } +// SetGrantId sets the GrantId field's value. +func (s *ListGrantsInput) SetGrantId(v string) *ListGrantsInput { + s.GrantId = &v + return s +} + +// SetGranteePrincipal sets the GranteePrincipal field's value. +func (s *ListGrantsInput) SetGranteePrincipal(v string) *ListGrantsInput { + s.GranteePrincipal = &v + return s +} + // SetKeyId sets the KeyId field's value. func (s *ListGrantsInput) SetKeyId(v string) *ListGrantsInput { s.KeyId = &v @@ -12694,7 +13400,8 @@ type ListRetirableGrantsInput struct { // you just received. Marker *string `min:"1" type:"string"` - // The retiring principal for which to list grants. + // The retiring principal for which to list grants. Enter a principal in your + // AWS account. // // To specify the retiring principal, use the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM @@ -13100,20 +13807,19 @@ type ReEncryptInput struct { // in the AWS Key Management Service Developer Guide. SourceEncryptionContext map[string]*string `type:"map"` - // A unique identifier for the CMK that is used to decrypt the ciphertext before - // it reencrypts it using the destination CMK. + // Specifies the customer master key (CMK) that AWS KMS will use to decrypt + // the ciphertext before it is re-encrypted. Enter a key ID of the CMK that + // was used to encrypt the ciphertext. // // This parameter is required only when the ciphertext was encrypted under an - // asymmetric CMK. Otherwise, AWS KMS uses the metadata that it adds to the - // ciphertext blob to determine which CMK was used to encrypt the ciphertext. - // However, you can use this parameter to ensure that a particular CMK (of any - // kind) is used to decrypt the ciphertext before it is reencrypted. - // - // If you specify a KeyId value, the decrypt part of the ReEncrypt operation - // succeeds only if the specified CMK was used to encrypt the ciphertext. + // asymmetric CMK. If you used a symmetric CMK, AWS KMS can get the CMK from + // metadata that it adds to the symmetric ciphertext blob. However, it is always + // recommended as a best practice. This practice ensures that you use the CMK + // that you intend. // // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, - // or alias ARN. When using an alias name, prefix it with "alias/". + // or alias ARN. When using an alias name, prefix it with "alias/". To specify + // a CMK in a different AWS account, you must use the key ARN or alias ARN. // // For example: // @@ -13838,7 +14544,7 @@ func (s *TagException) RequestID() string { type TagResourceInput struct { _ struct{} `type:"structure"` - // A unique identifier for the CMK you are tagging. + // Identifies a customer managed CMK in the account and Region. // // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. // @@ -13853,7 +14559,14 @@ type TagResourceInput struct { // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` - // One or more tags. Each tag consists of a tag key and a tag value. + // One or more tags. + // + // Each tag consists of a tag key and a tag value. The tag value can be an empty + // (null) string. + // + // You cannot have more than one tag on a CMK with the same tag key. If you + // specify an existing tag key with a different tag value, AWS KMS replaces + // the current tag value with the specified one. // // Tags is a required field Tags []*Tag `type:"list" required:"true"` @@ -13984,7 +14697,7 @@ func (s *UnsupportedOperationException) RequestID() string { type UntagResourceInput struct { _ struct{} `type:"structure"` - // A unique identifier for the CMK from which you are removing tags. + // Identifies the CMK from which you are removing tags. // // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. // @@ -14070,8 +14783,9 @@ type UpdateAliasInput struct { // AliasName is a required field AliasName *string `min:"1" type:"string" required:"true"` - // Identifies the CMK to associate with the alias. When the update operation - // completes, the alias will point to this CMK. + // Identifies the customer managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) + // to associate with the alias. You don't have permission to associate an alias + // with an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). // // The CMK must be in the same AWS account and Region as the alias. Also, the // new target CMK must be the same type as the current target CMK (both symmetric diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/api.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/api.go new file mode 100644 index 000000000000..4498f285e476 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/api.go @@ -0,0 +1,1210 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package sso + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +const opGetRoleCredentials = "GetRoleCredentials" + +// GetRoleCredentialsRequest generates a "aws/request.Request" representing the +// client's request for the GetRoleCredentials operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetRoleCredentials for more information on using the GetRoleCredentials +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetRoleCredentialsRequest method. +// req, resp := client.GetRoleCredentialsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/GetRoleCredentials +func (c *SSO) GetRoleCredentialsRequest(input *GetRoleCredentialsInput) (req *request.Request, output *GetRoleCredentialsOutput) { + op := &request.Operation{ + Name: opGetRoleCredentials, + HTTPMethod: "GET", + HTTPPath: "/federation/credentials", + } + + if input == nil { + input = &GetRoleCredentialsInput{} + } + + output = &GetRoleCredentialsOutput{} + req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials + return +} + +// GetRoleCredentials API operation for AWS Single Sign-On. +// +// Returns the STS short-term credentials for a given role name that is assigned +// to the user. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Single Sign-On's +// API operation GetRoleCredentials for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// Indicates that a problem occurred with the input to the request. For example, +// a required parameter might be missing or out of range. +// +// * UnauthorizedException +// Indicates that the request is not authorized. This can happen due to an invalid +// access token in the request. +// +// * TooManyRequestsException +// Indicates that the request is being made too frequently and is more than +// what the server can handle. +// +// * ResourceNotFoundException +// The specified resource doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/GetRoleCredentials +func (c *SSO) GetRoleCredentials(input *GetRoleCredentialsInput) (*GetRoleCredentialsOutput, error) { + req, out := c.GetRoleCredentialsRequest(input) + return out, req.Send() +} + +// GetRoleCredentialsWithContext is the same as GetRoleCredentials with the addition of +// the ability to pass a context and additional request options. +// +// See GetRoleCredentials for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSO) GetRoleCredentialsWithContext(ctx aws.Context, input *GetRoleCredentialsInput, opts ...request.Option) (*GetRoleCredentialsOutput, error) { + req, out := c.GetRoleCredentialsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListAccountRoles = "ListAccountRoles" + +// ListAccountRolesRequest generates a "aws/request.Request" representing the +// client's request for the ListAccountRoles operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAccountRoles for more information on using the ListAccountRoles +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAccountRolesRequest method. +// req, resp := client.ListAccountRolesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccountRoles +func (c *SSO) ListAccountRolesRequest(input *ListAccountRolesInput) (req *request.Request, output *ListAccountRolesOutput) { + op := &request.Operation{ + Name: opListAccountRoles, + HTTPMethod: "GET", + HTTPPath: "/assignment/roles", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListAccountRolesInput{} + } + + output = &ListAccountRolesOutput{} + req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials + return +} + +// ListAccountRoles API operation for AWS Single Sign-On. +// +// Lists all roles that are assigned to the user for a given AWS account. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Single Sign-On's +// API operation ListAccountRoles for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// Indicates that a problem occurred with the input to the request. For example, +// a required parameter might be missing or out of range. +// +// * UnauthorizedException +// Indicates that the request is not authorized. This can happen due to an invalid +// access token in the request. +// +// * TooManyRequestsException +// Indicates that the request is being made too frequently and is more than +// what the server can handle. +// +// * ResourceNotFoundException +// The specified resource doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccountRoles +func (c *SSO) ListAccountRoles(input *ListAccountRolesInput) (*ListAccountRolesOutput, error) { + req, out := c.ListAccountRolesRequest(input) + return out, req.Send() +} + +// ListAccountRolesWithContext is the same as ListAccountRoles with the addition of +// the ability to pass a context and additional request options. +// +// See ListAccountRoles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSO) ListAccountRolesWithContext(ctx aws.Context, input *ListAccountRolesInput, opts ...request.Option) (*ListAccountRolesOutput, error) { + req, out := c.ListAccountRolesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListAccountRolesPages iterates over the pages of a ListAccountRoles operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAccountRoles method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a ListAccountRoles operation. +// pageNum := 0 +// err := client.ListAccountRolesPages(params, +// func(page *sso.ListAccountRolesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SSO) ListAccountRolesPages(input *ListAccountRolesInput, fn func(*ListAccountRolesOutput, bool) bool) error { + return c.ListAccountRolesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAccountRolesPagesWithContext same as ListAccountRolesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSO) ListAccountRolesPagesWithContext(ctx aws.Context, input *ListAccountRolesInput, fn func(*ListAccountRolesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAccountRolesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAccountRolesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAccountRolesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListAccounts = "ListAccounts" + +// ListAccountsRequest generates a "aws/request.Request" representing the +// client's request for the ListAccounts operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAccounts for more information on using the ListAccounts +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAccountsRequest method. +// req, resp := client.ListAccountsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccounts +func (c *SSO) ListAccountsRequest(input *ListAccountsInput) (req *request.Request, output *ListAccountsOutput) { + op := &request.Operation{ + Name: opListAccounts, + HTTPMethod: "GET", + HTTPPath: "/assignment/accounts", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListAccountsInput{} + } + + output = &ListAccountsOutput{} + req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials + return +} + +// ListAccounts API operation for AWS Single Sign-On. +// +// Lists all AWS accounts assigned to the user. These AWS accounts are assigned +// by the administrator of the account. For more information, see Assign User +// Access (https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers) +// in the AWS SSO User Guide. This operation returns a paginated response. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Single Sign-On's +// API operation ListAccounts for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// Indicates that a problem occurred with the input to the request. For example, +// a required parameter might be missing or out of range. +// +// * UnauthorizedException +// Indicates that the request is not authorized. This can happen due to an invalid +// access token in the request. +// +// * TooManyRequestsException +// Indicates that the request is being made too frequently and is more than +// what the server can handle. +// +// * ResourceNotFoundException +// The specified resource doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccounts +func (c *SSO) ListAccounts(input *ListAccountsInput) (*ListAccountsOutput, error) { + req, out := c.ListAccountsRequest(input) + return out, req.Send() +} + +// ListAccountsWithContext is the same as ListAccounts with the addition of +// the ability to pass a context and additional request options. +// +// See ListAccounts for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSO) ListAccountsWithContext(ctx aws.Context, input *ListAccountsInput, opts ...request.Option) (*ListAccountsOutput, error) { + req, out := c.ListAccountsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListAccountsPages iterates over the pages of a ListAccounts operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAccounts method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a ListAccounts operation. +// pageNum := 0 +// err := client.ListAccountsPages(params, +// func(page *sso.ListAccountsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SSO) ListAccountsPages(input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool) error { + return c.ListAccountsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAccountsPagesWithContext same as ListAccountsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSO) ListAccountsPagesWithContext(ctx aws.Context, input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAccountsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAccountsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAccountsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opLogout = "Logout" + +// LogoutRequest generates a "aws/request.Request" representing the +// client's request for the Logout operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See Logout for more information on using the Logout +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the LogoutRequest method. +// req, resp := client.LogoutRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/Logout +func (c *SSO) LogoutRequest(input *LogoutInput) (req *request.Request, output *LogoutOutput) { + op := &request.Operation{ + Name: opLogout, + HTTPMethod: "POST", + HTTPPath: "/logout", + } + + if input == nil { + input = &LogoutInput{} + } + + output = &LogoutOutput{} + req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// Logout API operation for AWS Single Sign-On. +// +// Removes the client- and server-side session that is associated with the user. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Single Sign-On's +// API operation Logout for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// Indicates that a problem occurred with the input to the request. For example, +// a required parameter might be missing or out of range. +// +// * UnauthorizedException +// Indicates that the request is not authorized. This can happen due to an invalid +// access token in the request. +// +// * TooManyRequestsException +// Indicates that the request is being made too frequently and is more than +// what the server can handle. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/Logout +func (c *SSO) Logout(input *LogoutInput) (*LogoutOutput, error) { + req, out := c.LogoutRequest(input) + return out, req.Send() +} + +// LogoutWithContext is the same as Logout with the addition of +// the ability to pass a context and additional request options. +// +// See Logout for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSO) LogoutWithContext(ctx aws.Context, input *LogoutInput, opts ...request.Option) (*LogoutOutput, error) { + req, out := c.LogoutRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Provides information about your AWS account. +type AccountInfo struct { + _ struct{} `type:"structure"` + + // The identifier of the AWS account that is assigned to the user. + AccountId *string `locationName:"accountId" type:"string"` + + // The display name of the AWS account that is assigned to the user. + AccountName *string `locationName:"accountName" type:"string"` + + // The email address of the AWS account that is assigned to the user. + EmailAddress *string `locationName:"emailAddress" min:"1" type:"string"` +} + +// String returns the string representation +func (s AccountInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountInfo) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *AccountInfo) SetAccountId(v string) *AccountInfo { + s.AccountId = &v + return s +} + +// SetAccountName sets the AccountName field's value. +func (s *AccountInfo) SetAccountName(v string) *AccountInfo { + s.AccountName = &v + return s +} + +// SetEmailAddress sets the EmailAddress field's value. +func (s *AccountInfo) SetEmailAddress(v string) *AccountInfo { + s.EmailAddress = &v + return s +} + +type GetRoleCredentialsInput struct { + _ struct{} `type:"structure"` + + // The token issued by the CreateToken API call. For more information, see CreateToken + // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the AWS SSO OIDC API Reference Guide. + // + // AccessToken is a required field + AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"` + + // The identifier for the AWS account that is assigned to the user. + // + // AccountId is a required field + AccountId *string `location:"querystring" locationName:"account_id" type:"string" required:"true"` + + // The friendly name of the role that is assigned to the user. + // + // RoleName is a required field + RoleName *string `location:"querystring" locationName:"role_name" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetRoleCredentialsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRoleCredentialsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetRoleCredentialsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetRoleCredentialsInput"} + if s.AccessToken == nil { + invalidParams.Add(request.NewErrParamRequired("AccessToken")) + } + if s.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.RoleName == nil { + invalidParams.Add(request.NewErrParamRequired("RoleName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessToken sets the AccessToken field's value. +func (s *GetRoleCredentialsInput) SetAccessToken(v string) *GetRoleCredentialsInput { + s.AccessToken = &v + return s +} + +// SetAccountId sets the AccountId field's value. +func (s *GetRoleCredentialsInput) SetAccountId(v string) *GetRoleCredentialsInput { + s.AccountId = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *GetRoleCredentialsInput) SetRoleName(v string) *GetRoleCredentialsInput { + s.RoleName = &v + return s +} + +type GetRoleCredentialsOutput struct { + _ struct{} `type:"structure"` + + // The credentials for the role that is assigned to the user. + RoleCredentials *RoleCredentials `locationName:"roleCredentials" type:"structure"` +} + +// String returns the string representation +func (s GetRoleCredentialsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRoleCredentialsOutput) GoString() string { + return s.String() +} + +// SetRoleCredentials sets the RoleCredentials field's value. +func (s *GetRoleCredentialsOutput) SetRoleCredentials(v *RoleCredentials) *GetRoleCredentialsOutput { + s.RoleCredentials = v + return s +} + +// Indicates that a problem occurred with the input to the request. For example, +// a required parameter might be missing or out of range. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s *InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidRequestException) OrigErr() error { + return nil +} + +func (s *InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *InvalidRequestException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidRequestException) RequestID() string { + return s.RespMetadata.RequestID +} + +type ListAccountRolesInput struct { + _ struct{} `type:"structure"` + + // The token issued by the CreateToken API call. For more information, see CreateToken + // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the AWS SSO OIDC API Reference Guide. + // + // AccessToken is a required field + AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"` + + // The identifier for the AWS account that is assigned to the user. + // + // AccountId is a required field + AccountId *string `location:"querystring" locationName:"account_id" type:"string" required:"true"` + + // The number of items that clients can request per page. + MaxResults *int64 `location:"querystring" locationName:"max_result" min:"1" type:"integer"` + + // The page token from the previous response output when you request subsequent + // pages. + NextToken *string `location:"querystring" locationName:"next_token" type:"string"` +} + +// String returns the string representation +func (s ListAccountRolesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccountRolesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAccountRolesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAccountRolesInput"} + if s.AccessToken == nil { + invalidParams.Add(request.NewErrParamRequired("AccessToken")) + } + if s.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessToken sets the AccessToken field's value. +func (s *ListAccountRolesInput) SetAccessToken(v string) *ListAccountRolesInput { + s.AccessToken = &v + return s +} + +// SetAccountId sets the AccountId field's value. +func (s *ListAccountRolesInput) SetAccountId(v string) *ListAccountRolesInput { + s.AccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListAccountRolesInput) SetMaxResults(v int64) *ListAccountRolesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAccountRolesInput) SetNextToken(v string) *ListAccountRolesInput { + s.NextToken = &v + return s +} + +type ListAccountRolesOutput struct { + _ struct{} `type:"structure"` + + // The page token client that is used to retrieve the list of accounts. + NextToken *string `locationName:"nextToken" type:"string"` + + // A paginated response with the list of roles and the next token if more results + // are available. + RoleList []*RoleInfo `locationName:"roleList" type:"list"` +} + +// String returns the string representation +func (s ListAccountRolesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccountRolesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAccountRolesOutput) SetNextToken(v string) *ListAccountRolesOutput { + s.NextToken = &v + return s +} + +// SetRoleList sets the RoleList field's value. +func (s *ListAccountRolesOutput) SetRoleList(v []*RoleInfo) *ListAccountRolesOutput { + s.RoleList = v + return s +} + +type ListAccountsInput struct { + _ struct{} `type:"structure"` + + // The token issued by the CreateToken API call. For more information, see CreateToken + // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the AWS SSO OIDC API Reference Guide. + // + // AccessToken is a required field + AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"` + + // This is the number of items clients can request per page. + MaxResults *int64 `location:"querystring" locationName:"max_result" min:"1" type:"integer"` + + // (Optional) When requesting subsequent pages, this is the page token from + // the previous response output. + NextToken *string `location:"querystring" locationName:"next_token" type:"string"` +} + +// String returns the string representation +func (s ListAccountsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccountsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAccountsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAccountsInput"} + if s.AccessToken == nil { + invalidParams.Add(request.NewErrParamRequired("AccessToken")) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessToken sets the AccessToken field's value. +func (s *ListAccountsInput) SetAccessToken(v string) *ListAccountsInput { + s.AccessToken = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListAccountsInput) SetMaxResults(v int64) *ListAccountsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAccountsInput) SetNextToken(v string) *ListAccountsInput { + s.NextToken = &v + return s +} + +type ListAccountsOutput struct { + _ struct{} `type:"structure"` + + // A paginated response with the list of account information and the next token + // if more results are available. + AccountList []*AccountInfo `locationName:"accountList" type:"list"` + + // The page token client that is used to retrieve the list of accounts. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListAccountsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccountsOutput) GoString() string { + return s.String() +} + +// SetAccountList sets the AccountList field's value. +func (s *ListAccountsOutput) SetAccountList(v []*AccountInfo) *ListAccountsOutput { + s.AccountList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAccountsOutput) SetNextToken(v string) *ListAccountsOutput { + s.NextToken = &v + return s +} + +type LogoutInput struct { + _ struct{} `type:"structure"` + + // The token issued by the CreateToken API call. For more information, see CreateToken + // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the AWS SSO OIDC API Reference Guide. + // + // AccessToken is a required field + AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"` +} + +// String returns the string representation +func (s LogoutInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LogoutInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LogoutInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LogoutInput"} + if s.AccessToken == nil { + invalidParams.Add(request.NewErrParamRequired("AccessToken")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessToken sets the AccessToken field's value. +func (s *LogoutInput) SetAccessToken(v string) *LogoutInput { + s.AccessToken = &v + return s +} + +type LogoutOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s LogoutOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LogoutOutput) GoString() string { + return s.String() +} + +// The specified resource doesn't exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s *ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *ResourceNotFoundException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ResourceNotFoundException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Provides information about the role credentials that are assigned to the +// user. +type RoleCredentials struct { + _ struct{} `type:"structure"` + + // The identifier used for the temporary security credentials. For more information, + // see Using Temporary Security Credentials to Request Access to AWS Resources + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) + // in the AWS IAM User Guide. + AccessKeyId *string `locationName:"accessKeyId" type:"string"` + + // The date on which temporary security credentials expire. + Expiration *int64 `locationName:"expiration" type:"long"` + + // The key that is used to sign the request. For more information, see Using + // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) + // in the AWS IAM User Guide. + SecretAccessKey *string `locationName:"secretAccessKey" type:"string" sensitive:"true"` + + // The token used for temporary credentials. For more information, see Using + // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) + // in the AWS IAM User Guide. + SessionToken *string `locationName:"sessionToken" type:"string" sensitive:"true"` +} + +// String returns the string representation +func (s RoleCredentials) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RoleCredentials) GoString() string { + return s.String() +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *RoleCredentials) SetAccessKeyId(v string) *RoleCredentials { + s.AccessKeyId = &v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *RoleCredentials) SetExpiration(v int64) *RoleCredentials { + s.Expiration = &v + return s +} + +// SetSecretAccessKey sets the SecretAccessKey field's value. +func (s *RoleCredentials) SetSecretAccessKey(v string) *RoleCredentials { + s.SecretAccessKey = &v + return s +} + +// SetSessionToken sets the SessionToken field's value. +func (s *RoleCredentials) SetSessionToken(v string) *RoleCredentials { + s.SessionToken = &v + return s +} + +// Provides information about the role that is assigned to the user. +type RoleInfo struct { + _ struct{} `type:"structure"` + + // The identifier of the AWS account assigned to the user. + AccountId *string `locationName:"accountId" type:"string"` + + // The friendly name of the role that is assigned to the user. + RoleName *string `locationName:"roleName" type:"string"` +} + +// String returns the string representation +func (s RoleInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RoleInfo) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *RoleInfo) SetAccountId(v string) *RoleInfo { + s.AccountId = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *RoleInfo) SetRoleName(v string) *RoleInfo { + s.RoleName = &v + return s +} + +// Indicates that the request is being made too frequently and is more than +// what the server can handle. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s *TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *TooManyRequestsException) OrigErr() error { + return nil +} + +func (s *TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *TooManyRequestsException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *TooManyRequestsException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Indicates that the request is not authorized. This can happen due to an invalid +// access token in the request. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s *UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *UnauthorizedException) OrigErr() error { + return nil +} + +func (s *UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s *UnauthorizedException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *UnauthorizedException) RequestID() string { + return s.RespMetadata.RequestID +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go new file mode 100644 index 000000000000..92d82b2afb68 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go @@ -0,0 +1,44 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package sso provides the client and types for making API +// requests to AWS Single Sign-On. +// +// AWS Single Sign-On Portal is a web service that makes it easy for you to +// assign user access to AWS SSO resources such as the user portal. Users can +// get AWS account applications and roles assigned to them and get federated +// into the application. +// +// For general information about AWS SSO, see What is AWS Single Sign-On? (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) +// in the AWS SSO User Guide. +// +// This API reference guide describes the AWS SSO Portal operations that you +// can call programatically and includes detailed information on data types +// and errors. +// +// AWS provides SDKs that consist of libraries and sample code for various programming +// languages and platforms, such as Java, Ruby, .Net, iOS, or Android. The SDKs +// provide a convenient way to create programmatic access to AWS SSO and other +// AWS services. For more information about the AWS SDKs, including how to download +// and install them, see Tools for Amazon Web Services (http://aws.amazon.com/tools/). +// +// See https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10 for more information on this service. +// +// See sso package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/sso/ +// +// Using the Client +// +// To contact AWS Single Sign-On with the SDK use the New function to create +// a new service client. With that client you can make API requests to the service. +// These clients are safe to use concurrently. +// +// See the SDK's documentation for more information on how to use the SDK. +// https://docs.aws.amazon.com/sdk-for-go/api/ +// +// See aws.Config documentation for more information on configuring SDK clients. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config +// +// See the AWS Single Sign-On client SSO for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/sso/#New +package sso diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/errors.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/errors.go new file mode 100644 index 000000000000..77a6792e352c --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/errors.go @@ -0,0 +1,44 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package sso + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeInvalidRequestException for service response error code + // "InvalidRequestException". + // + // Indicates that a problem occurred with the input to the request. For example, + // a required parameter might be missing or out of range. + ErrCodeInvalidRequestException = "InvalidRequestException" + + // ErrCodeResourceNotFoundException for service response error code + // "ResourceNotFoundException". + // + // The specified resource doesn't exist. + ErrCodeResourceNotFoundException = "ResourceNotFoundException" + + // ErrCodeTooManyRequestsException for service response error code + // "TooManyRequestsException". + // + // Indicates that the request is being made too frequently and is more than + // what the server can handle. + ErrCodeTooManyRequestsException = "TooManyRequestsException" + + // ErrCodeUnauthorizedException for service response error code + // "UnauthorizedException". + // + // Indicates that the request is not authorized. This can happen due to an invalid + // access token in the request. + ErrCodeUnauthorizedException = "UnauthorizedException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InvalidRequestException": newErrorInvalidRequestException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnauthorizedException": newErrorUnauthorizedException, +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/service.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/service.go new file mode 100644 index 000000000000..35175331fc79 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/service.go @@ -0,0 +1,104 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package sso + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +// SSO provides the API operation methods for making requests to +// AWS Single Sign-On. See this package's package overview docs +// for details on the service. +// +// SSO methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type SSO struct { + *client.Client +} + +// Used for custom client initialization logic +var initClient func(*client.Client) + +// Used for custom request initialization logic +var initRequest func(*request.Request) + +// Service information constants +const ( + ServiceName = "SSO" // Name of service. + EndpointsID = "portal.sso" // ID to lookup a service endpoint with. + ServiceID = "SSO" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the SSO client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a SSO client from just a session. +// svc := sso.New(mySession) +// +// // Create a SSO client with additional configuration +// svc := sso.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *SSO { + c := p.ClientConfig(EndpointsID, cfgs...) + if c.SigningNameDerived || len(c.SigningName) == 0 { + c.SigningName = "awsssoportal" + } + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SSO { + svc := &SSO{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2019-06-10", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a SSO operation and runs any +// custom request initialization. +func (c *SSO) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(req) + } + + return req +} diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/ssoiface/interface.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/ssoiface/interface.go new file mode 100644 index 000000000000..4cac247c1889 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sso/ssoiface/interface.go @@ -0,0 +1,86 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package ssoiface provides an interface to enable mocking the AWS Single Sign-On service client +// for testing your code. +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. +package ssoiface + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/sso" +) + +// SSOAPI provides an interface to enable mocking the +// sso.SSO service client's API operation, +// paginators, and waiters. This make unit testing your code that calls out +// to the SDK's service client's calls easier. +// +// The best way to use this interface is so the SDK's service client's calls +// can be stubbed out for unit testing your code with the SDK without needing +// to inject custom request handlers into the SDK's request pipeline. +// +// // myFunc uses an SDK service client to make a request to +// // AWS Single Sign-On. +// func myFunc(svc ssoiface.SSOAPI) bool { +// // Make svc.GetRoleCredentials request +// } +// +// func main() { +// sess := session.New() +// svc := sso.New(sess) +// +// myFunc(svc) +// } +// +// In your _test.go file: +// +// // Define a mock struct to be used in your unit tests of myFunc. +// type mockSSOClient struct { +// ssoiface.SSOAPI +// } +// func (m *mockSSOClient) GetRoleCredentials(input *sso.GetRoleCredentialsInput) (*sso.GetRoleCredentialsOutput, error) { +// // mock response/functionality +// } +// +// func TestMyFunc(t *testing.T) { +// // Setup Test +// mockSvc := &mockSSOClient{} +// +// myfunc(mockSvc) +// +// // Verify myFunc's functionality +// } +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. Its suggested to use the pattern above for testing, or using +// tooling to generate mocks to satisfy the interfaces. +type SSOAPI interface { + GetRoleCredentials(*sso.GetRoleCredentialsInput) (*sso.GetRoleCredentialsOutput, error) + GetRoleCredentialsWithContext(aws.Context, *sso.GetRoleCredentialsInput, ...request.Option) (*sso.GetRoleCredentialsOutput, error) + GetRoleCredentialsRequest(*sso.GetRoleCredentialsInput) (*request.Request, *sso.GetRoleCredentialsOutput) + + ListAccountRoles(*sso.ListAccountRolesInput) (*sso.ListAccountRolesOutput, error) + ListAccountRolesWithContext(aws.Context, *sso.ListAccountRolesInput, ...request.Option) (*sso.ListAccountRolesOutput, error) + ListAccountRolesRequest(*sso.ListAccountRolesInput) (*request.Request, *sso.ListAccountRolesOutput) + + ListAccountRolesPages(*sso.ListAccountRolesInput, func(*sso.ListAccountRolesOutput, bool) bool) error + ListAccountRolesPagesWithContext(aws.Context, *sso.ListAccountRolesInput, func(*sso.ListAccountRolesOutput, bool) bool, ...request.Option) error + + ListAccounts(*sso.ListAccountsInput) (*sso.ListAccountsOutput, error) + ListAccountsWithContext(aws.Context, *sso.ListAccountsInput, ...request.Option) (*sso.ListAccountsOutput, error) + ListAccountsRequest(*sso.ListAccountsInput) (*request.Request, *sso.ListAccountsOutput) + + ListAccountsPages(*sso.ListAccountsInput, func(*sso.ListAccountsOutput, bool) bool) error + ListAccountsPagesWithContext(aws.Context, *sso.ListAccountsInput, func(*sso.ListAccountsOutput, bool) bool, ...request.Option) error + + Logout(*sso.LogoutInput) (*sso.LogoutOutput, error) + LogoutWithContext(aws.Context, *sso.LogoutInput, ...request.Option) (*sso.LogoutOutput, error) + LogoutRequest(*sso.LogoutInput) (*request.Request, *sso.LogoutOutput) +} + +var _ SSOAPI = (*sso.SSO)(nil) diff --git a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sts/api.go index bfc4372f9fde..17c46378899f 100644 --- a/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sts/api.go +++ b/cluster-autoscaler/vendor/github.com/aws/aws-sdk-go/service/sts/api.go @@ -65,34 +65,6 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. // -// You cannot use AWS account root user credentials to call AssumeRole. You -// must use credentials for an IAM user or an IAM role to call AssumeRole. -// -// For cross-account access, imagine that you own multiple accounts and need -// to access resources in each account. You could create long-term credentials -// in each account to access those resources. However, managing all those credentials -// and remembering which one can access which account can be time consuming. -// Instead, you can create one set of long-term credentials in one account. -// Then use temporary security credentials to access all the other accounts -// by assuming roles in those accounts. For more information about roles, see -// IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) -// in the IAM User Guide. -// -// Session Duration -// -// By default, the temporary security credentials created by AssumeRole last -// for one hour. However, you can use the optional DurationSeconds parameter -// to specify the duration of your session. You can provide a value from 900 -// seconds (15 minutes) up to the maximum session duration setting for the role. -// This setting can have a value from 1 hour to 12 hours. To learn how to view -// the maximum value for your role, see View the Maximum Session Duration Setting -// for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) -// in the IAM User Guide. The maximum session duration limit applies when you -// use the AssumeRole* API operations or the assume-role* CLI commands. However -// the limit does not apply when you use those operations to create a console -// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) -// in the IAM User Guide. -// // Permissions // // The temporary security credentials created by AssumeRole can be used to make @@ -102,7 +74,7 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to -// use as managed session policies. The plain text that you use for both inline +// use as managed session policies. The plaintext that you use for both inline // and managed session policies can't exceed 2,048 characters. Passing policies // to this operation returns new temporary credentials. The resulting session's // permissions are the intersection of the role's identity-based policy and @@ -308,6 +280,15 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) // in the IAM User Guide. // +// Role chaining (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining) +// limits your AWS CLI or AWS API role session to a maximum of one hour. When +// you use the AssumeRole API operation to assume a role, you can specify the +// duration of your role session with the DurationSeconds parameter. You can +// specify a parameter value of up to 43200 seconds (12 hours), depending on +// the maximum session duration setting for your role. However, if you assume +// a role using role chaining and provide a DurationSeconds parameter value +// greater than one hour, the operation fails. +// // Permissions // // The temporary security credentials created by AssumeRoleWithSAML can be used @@ -317,7 +298,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to -// use as managed session policies. The plain text that you use for both inline +// use as managed session policies. The plaintext that you use for both inline // and managed session policies can't exceed 2,048 characters. Passing policies // to this operation returns new temporary credentials. The resulting session's // permissions are the intersection of the role's identity-based policy and @@ -346,16 +327,16 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) // in the IAM User Guide. // -// You can pass up to 50 session tags. The plain text session tag keys can’t +// You can pass up to 50 session tags. The plaintext session tag keys can’t // exceed 128 characters and the values can’t exceed 256 characters. For these // and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) // in the IAM User Guide. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail -// for this limit even if your plain text meets the other requirements. The -// PackedPolicySize response element indicates by percentage how close the policies -// and tags for your request are to the upper size limit. +// for this limit even if your plaintext meets the other requirements. The PackedPolicySize +// response element indicates by percentage how close the policies and tags +// for your request are to the upper size limit. // // You can pass a session tag with the same key as a tag that is attached to // the role. When you do, session tags override the role's tags with the same @@ -564,7 +545,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to -// use as managed session policies. The plain text that you use for both inline +// use as managed session policies. The plaintext that you use for both inline // and managed session policies can't exceed 2,048 characters. Passing policies // to this operation returns new temporary credentials. The resulting session's // permissions are the intersection of the role's identity-based policy and @@ -583,16 +564,16 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) // in the IAM User Guide. // -// You can pass up to 50 session tags. The plain text session tag keys can’t +// You can pass up to 50 session tags. The plaintext session tag keys can’t // exceed 128 characters and the values can’t exceed 256 characters. For these // and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) // in the IAM User Guide. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail -// for this limit even if your plain text meets the other requirements. The -// PackedPolicySize response element indicates by percentage how close the policies -// and tags for your request are to the upper size limit. +// for this limit even if your plaintext meets the other requirements. The PackedPolicySize +// response element indicates by percentage how close the policies and tags +// for your request are to the upper size limit. // // You can pass a session tag with the same key as a tag that is attached to // the role. When you do, the session tag overrides the role tag with the same @@ -619,7 +600,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // // Calling AssumeRoleWithWebIdentity can result in an entry in your AWS CloudTrail // logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims) -// of the provided Web Identity Token. We recommend that you avoid using any +// of the provided web identity token. We recommend that you avoid using any // personally identifiable information (PII) in this field. For example, you // could instead use a GUID or a pairwise identifier, as suggested in the OIDC // specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes). @@ -1108,6 +1089,70 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to +// use as managed session policies. The plaintext that you use for both inline +// and managed session policies can't exceed 2,048 characters. +// +// Though the session policy parameters are optional, if you do not pass a policy, +// then the resulting federated user session has no permissions. When you pass +// session policies, the session permissions are the intersection of the IAM +// user policies and the session policies that you pass. This gives you a way +// to further restrict the permissions for a federated user. You cannot use +// session policies to grant more permissions than those that are defined in +// the permissions policy of the IAM user. For more information, see Session +// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// in the IAM User Guide. For information about using GetFederationToken to +// create temporary security credentials, see GetFederationToken—Federation +// Through a Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken). +// +// You can use the credentials to access a resource that has a resource-based +// policy. If that policy specifically references the federated user session +// in the Principal element of the policy, the session has the permissions allowed +// by the policy. These permissions are granted in addition to the permissions +// granted by the session policies. +// +// Tags +// +// (Optional) You can pass tag key-value pairs to your session. These are called +// session tags. For more information about session tags, see Passing Session +// Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You can create a mobile-based or browser-based app that can authenticate +// users using a web identity provider like Login with Amazon, Facebook, Google, +// or an OpenID Connect-compatible identity provider. In this case, we recommend +// that you use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity. +// For more information, see Federation Through a Web-based Identity Provider +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) +// in the IAM User Guide. +// +// You can also call GetFederationToken using the security credentials of an +// AWS account root user, but we do not recommend it. Instead, we recommend +// that you create an IAM user for the purpose of the proxy application. Then +// attach a policy to the IAM user that limits federated users to only the actions +// and resources that they need to access. For more information, see IAM Best +// Practices (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) +// in the IAM User Guide. +// +// Session duration +// +// The temporary credentials are valid for the specified duration, from 900 +// seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default +// session duration is 43,200 seconds (12 hours). Temporary credentials that +// are obtained by using AWS account root user credentials have a maximum duration +// of 3,600 seconds (1 hour). +// +// Permissions +// +// You can use the temporary credentials created by GetFederationToken in any +// AWS service except the following: +// +// * You cannot call any IAM operations using the AWS CLI or the AWS API. +// +// * You cannot call any STS operations except GetCallerIdentity. +// +// You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// to this operation. You can pass a single JSON policy document to use as an +// inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline // and managed session policies can't exceed 2,048 characters. // @@ -1338,14 +1383,15 @@ func (c *STS) GetSessionTokenWithContext(ctx aws.Context, input *GetSessionToken type AssumeRoleInput struct { _ struct{} `type:"structure"` - // The duration, in seconds, of the role session. The value can range from 900 - // seconds (15 minutes) up to the maximum session duration setting for the role. - // This setting can have a value from 1 hour to 12 hours. If you specify a value - // higher than this setting, the operation fails. For example, if you specify - // a session duration of 12 hours, but your administrator set the maximum session - // duration to 6 hours, your operation fails. To learn how to view the maximum - // value for your role, see View the Maximum Session Duration Setting for a - // Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // The duration, in seconds, of the role session. The value specified can can + // range from 900 seconds (15 minutes) up to the maximum session duration that + // is set for the role. The maximum session duration setting can have a value + // from 1 hour to 12 hours. If you specify a value higher than this setting + // or the administrator setting (whichever is lower), the operation fails. For + // example, if you specify a session duration of 12 hours, but your administrator + // set the maximum session duration to 6 hours, your operation fails. To learn + // how to view the maximum value for your role, see View the Maximum Session + // Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) // in the IAM User Guide. // // By default, the value is set to 3600 seconds. @@ -1387,17 +1433,17 @@ type AssumeRoleInput struct { // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // - // The plain text that you use for both inline and managed session policies - // can't exceed 2,048 characters. The JSON policy characters can be any ASCII - // character from the space character to the end of the valid character list - // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), - // and carriage return (\u000D) characters. + // The plaintext that you use for both inline and managed session policies can't + // exceed 2,048 characters. The JSON policy characters can be any ASCII character + // from the space character to the end of the valid character list (\u0020 through + // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage + // return (\u000D) characters. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -1405,16 +1451,16 @@ type AssumeRoleInput struct { // as the role. // // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plain text that you use for both inline and managed session - // policies can't exceed 2,048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // However, the plaintext that you use for both inline and managed session policies + // can't exceed 2,048 characters. For more information about ARNs, see Amazon + // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. // // Passing policies to this operation returns new temporary credentials. The // resulting session's permissions are the intersection of the role's identity-based @@ -1459,22 +1505,41 @@ type AssumeRoleInput struct { // also include underscores or any of the following characters: =,.@- SerialNumber *string `min:"9" type:"string"` + // The source identity specified by the principal that is calling the AssumeRole + // operation. + // + // You can require users to specify a source identity when they assume a role. + // You do this by using the sts:SourceIdentity condition key in a role trust + // policy. You can use source identity information in AWS CloudTrail logs to + // determine who took actions with a role. You can use the aws:SourceIdentity + // condition key to further control access to AWS resources based on the value + // of source identity. For more information about using source identity, see + // Monitor and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can + // also include underscores or any of the following characters: =,.@-. You cannot + // use a value that begins with the text aws:. This prefix is reserved for AWS + // internal use. + SourceIdentity *string `min:"2" type:"string"` + // A list of session tags that you want to pass. Each session tag consists of // a key name and an associated value. For more information about session tags, // see Tagging AWS STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) // in the IAM User Guide. // - // This parameter is optional. You can pass up to 50 session tags. The plain - // text session tag keys can’t exceed 128 characters, and the values can’t - // exceed 256 characters. For these and additional limits, see IAM and STS Character + // This parameter is optional. You can pass up to 50 session tags. The plaintext + // session tag keys can’t exceed 128 characters, and the values can’t exceed + // 256 characters. For these and additional limits, see IAM and STS Character // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) // in the IAM User Guide. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. // // You can pass a session tag with the same key as a tag that is already attached // to the role. When you do, session tags override a role tag with the same @@ -1495,9 +1560,10 @@ type AssumeRoleInput struct { Tags []*Tag `type:"list"` // The value provided by the MFA device, if the trust policy of the role being - // assumed requires MFA (that is, if the policy includes a condition that tests - // for MFA). If the role being assumed requires MFA and if the TokenCode value - // is missing or expired, the AssumeRole call returns an "access denied" error. + // assumed requires MFA. (In other words, if the policy includes a condition + // that tests for MFA). If the role being assumed requires MFA and if the TokenCode + // value is missing or expired, the AssumeRole call returns an "access denied" + // error. // // The format for this parameter, as described by its regex pattern, is a sequence // of six numeric digits. @@ -1554,6 +1620,9 @@ func (s *AssumeRoleInput) Validate() error { if s.SerialNumber != nil && len(*s.SerialNumber) < 9 { invalidParams.Add(request.NewErrParamMinLen("SerialNumber", 9)) } + if s.SourceIdentity != nil && len(*s.SourceIdentity) < 2 { + invalidParams.Add(request.NewErrParamMinLen("SourceIdentity", 2)) + } if s.TokenCode != nil && len(*s.TokenCode) < 6 { invalidParams.Add(request.NewErrParamMinLen("TokenCode", 6)) } @@ -1626,6 +1695,12 @@ func (s *AssumeRoleInput) SetSerialNumber(v string) *AssumeRoleInput { return s } +// SetSourceIdentity sets the SourceIdentity field's value. +func (s *AssumeRoleInput) SetSourceIdentity(v string) *AssumeRoleInput { + s.SourceIdentity = &v + return s +} + // SetTags sets the Tags field's value. func (s *AssumeRoleInput) SetTags(v []*Tag) *AssumeRoleInput { s.Tags = v @@ -1668,6 +1743,23 @@ type AssumeRoleOutput struct { // packed size is greater than 100 percent, which means the policies and tags // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` + + // The source identity specified by the principal that is calling the AssumeRole + // operation. + // + // You can require users to specify a source identity when they assume a role. + // You do this by using the sts:SourceIdentity condition key in a role trust + // policy. You can use source identity information in AWS CloudTrail logs to + // determine who took actions with a role. You can use the aws:SourceIdentity + // condition key to further control access to AWS resources based on the value + // of source identity. For more information about using source identity, see + // Monitor and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can + // also include underscores or any of the following characters: =,.@- + SourceIdentity *string `min:"2" type:"string"` } // String returns the string representation @@ -1698,6 +1790,12 @@ func (s *AssumeRoleOutput) SetPackedPolicySize(v int64) *AssumeRoleOutput { return s } +// SetSourceIdentity sets the SourceIdentity field's value. +func (s *AssumeRoleOutput) SetSourceIdentity(v string) *AssumeRoleOutput { + s.SourceIdentity = &v + return s +} + type AssumeRoleWithSAMLInput struct { _ struct{} `type:"structure"` @@ -1736,17 +1834,17 @@ type AssumeRoleWithSAMLInput struct { // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // - // The plain text that you use for both inline and managed session policies - // can't exceed 2,048 characters. The JSON policy characters can be any ASCII - // character from the space character to the end of the valid character list - // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), - // and carriage return (\u000D) characters. + // The plaintext that you use for both inline and managed session policies can't + // exceed 2,048 characters. The JSON policy characters can be any ASCII character + // from the space character to the end of the valid character list (\u0020 through + // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage + // return (\u000D) characters. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -1754,16 +1852,16 @@ type AssumeRoleWithSAMLInput struct { // as the role. // // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plain text that you use for both inline and managed session - // policies can't exceed 2,048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // However, the plaintext that you use for both inline and managed session policies + // can't exceed 2,048 characters. For more information about ARNs, see Amazon + // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. // // Passing policies to this operation returns new temporary credentials. The // resulting session's permissions are the intersection of the role's identity-based @@ -1786,7 +1884,7 @@ type AssumeRoleWithSAMLInput struct { // RoleArn is a required field RoleArn *string `min:"20" type:"string" required:"true"` - // The base-64 encoded SAML authentication response provided by the IdP. + // The base64 encoded SAML authentication response provided by the IdP. // // For more information, see Configuring a Relying Party and Adding Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) // in the IAM User Guide. @@ -1908,10 +2006,17 @@ type AssumeRoleWithSAMLOutput struct { // The value of the Issuer element of the SAML assertion. Issuer *string `type:"string"` - // A hash value based on the concatenation of the Issuer response value, the - // AWS account ID, and the friendly name (the last part of the ARN) of the SAML - // provider in IAM. The combination of NameQualifier and Subject can be used - // to uniquely identify a federated user. + // A hash value based on the concatenation of the following: + // + // * The Issuer response value. + // + // * The AWS account ID. + // + // * The friendly name (the last part of the ARN) of the SAML provider in + // IAM. + // + // The combination of NameQualifier and Subject can be used to uniquely identify + // a federated user. // // The following pseudocode shows how the hash value is calculated: // @@ -1925,6 +2030,26 @@ type AssumeRoleWithSAMLOutput struct { // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` + // The value in the SourceIdentity attribute in the SAML assertion. + // + // You can require users to set a source identity value when they assume a role. + // You do this by using the sts:SourceIdentity condition key in a role trust + // policy. That way, actions that are taken with the role are associated with + // that user. After the source identity is set, the value cannot be changed. + // It is present in the request for all actions that are taken by the role and + // persists across chained role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining) + // sessions. You can configure your SAML identity provider to use an attribute + // associated with your users, like user name or email, as the source identity + // when calling AssumeRoleWithSAML. You do this by adding an attribute to the + // SAML assertion. For more information about using source identity, see Monitor + // and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can + // also include underscores or any of the following characters: =,.@- + SourceIdentity *string `min:"2" type:"string"` + // The value of the NameID element in the Subject element of the SAML assertion. Subject *string `type:"string"` @@ -1985,6 +2110,12 @@ func (s *AssumeRoleWithSAMLOutput) SetPackedPolicySize(v int64) *AssumeRoleWithS return s } +// SetSourceIdentity sets the SourceIdentity field's value. +func (s *AssumeRoleWithSAMLOutput) SetSourceIdentity(v string) *AssumeRoleWithSAMLOutput { + s.SourceIdentity = &v + return s +} + // SetSubject sets the Subject field's value. func (s *AssumeRoleWithSAMLOutput) SetSubject(v string) *AssumeRoleWithSAMLOutput { s.Subject = &v @@ -2032,17 +2163,17 @@ type AssumeRoleWithWebIdentityInput struct { // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // - // The plain text that you use for both inline and managed session policies - // can't exceed 2,048 characters. The JSON policy characters can be any ASCII - // character from the space character to the end of the valid character list - // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), - // and carriage return (\u000D) characters. + // The plaintext that you use for both inline and managed session policies can't + // exceed 2,048 characters. The JSON policy characters can be any ASCII character + // from the space character to the end of the valid character list (\u0020 through + // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage + // return (\u000D) characters. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -2050,16 +2181,16 @@ type AssumeRoleWithWebIdentityInput struct { // as the role. // // This parameter is optional. You can provide up to 10 managed policy ARNs. - // However, the plain text that you use for both inline and managed session - // policies can't exceed 2,048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // However, the plaintext that you use for both inline and managed session policies + // can't exceed 2,048 characters. For more information about ARNs, see Amazon + // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. // // Passing policies to this operation returns new temporary credentials. The // resulting session's permissions are the intersection of the role's identity-based @@ -2242,6 +2373,29 @@ type AssumeRoleWithWebIdentityOutput struct { // in the AssumeRoleWithWebIdentity request. Provider *string `type:"string"` + // The value of the source identity that is returned in the JSON web token (JWT) + // from the identity provider. + // + // You can require users to set a source identity value when they assume a role. + // You do this by using the sts:SourceIdentity condition key in a role trust + // policy. That way, actions that are taken with the role are associated with + // that user. After the source identity is set, the value cannot be changed. + // It is present in the request for all actions that are taken by the role and + // persists across chained role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining) + // sessions. You can configure your identity provider to use an attribute associated + // with your users, like user name or email, as the source identity when calling + // AssumeRoleWithWebIdentity. You do this by adding a claim to the JSON web + // token. To learn more about OIDC tokens and claims, see Using Tokens with + // User Pools (https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html) + // in the Amazon Cognito Developer Guide. For more information about using source + // identity, see Monitor and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can + // also include underscores or any of the following characters: =,.@- + SourceIdentity *string `min:"2" type:"string"` + // The unique user identifier that is returned by the identity provider. This // identifier is associated with the WebIdentityToken that was submitted with // the AssumeRoleWithWebIdentity call. The identifier is typically unique to @@ -2291,6 +2445,12 @@ func (s *AssumeRoleWithWebIdentityOutput) SetProvider(v string) *AssumeRoleWithW return s } +// SetSourceIdentity sets the SourceIdentity field's value. +func (s *AssumeRoleWithWebIdentityOutput) SetSourceIdentity(v string) *AssumeRoleWithWebIdentityOutput { + s.SourceIdentity = &v + return s +} + // SetSubjectFromWebIdentityToken sets the SubjectFromWebIdentityToken field's value. func (s *AssumeRoleWithWebIdentityOutput) SetSubjectFromWebIdentityToken(v string) *AssumeRoleWithWebIdentityOutput { s.SubjectFromWebIdentityToken = &v @@ -2682,17 +2842,17 @@ type GetFederationTokenInput struct { // by the policy. These permissions are granted in addition to the permissions // that are granted by the session policies. // - // The plain text that you use for both inline and managed session policies - // can't exceed 2,048 characters. The JSON policy characters can be any ASCII - // character from the space character to the end of the valid character list - // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), - // and carriage return (\u000D) characters. + // The plaintext that you use for both inline and managed session policies can't + // exceed 2,048 characters. The JSON policy characters can be any ASCII character + // from the space character to the end of the valid character list (\u0020 through + // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage + // return (\u000D) characters. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -2702,7 +2862,7 @@ type GetFederationTokenInput struct { // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to - // use as managed session policies. The plain text that you use for both inline + // use as managed session policies. The plaintext that you use for both inline // and managed session policies can't exceed 2,048 characters. You can provide // up to 10 managed policy ARNs. For more information about ARNs, see Amazon // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) @@ -2727,9 +2887,9 @@ type GetFederationTokenInput struct { // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. PolicyArns []*PolicyDescriptorType `type:"list"` // A list of session tags. Each session tag consists of a key name and an associated @@ -2737,17 +2897,17 @@ type GetFederationTokenInput struct { // in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) // in the IAM User Guide. // - // This parameter is optional. You can pass up to 50 session tags. The plain - // text session tag keys can’t exceed 128 characters and the values can’t - // exceed 256 characters. For these and additional limits, see IAM and STS Character + // This parameter is optional. You can pass up to 50 session tags. The plaintext + // session tag keys can’t exceed 128 characters and the values can’t exceed + // 256 characters. For these and additional limits, see IAM and STS Character // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) // in the IAM User Guide. // // An AWS conversion compresses the passed session policies and session tags // into a packed binary format that has a separate limit. Your request can fail - // for this limit even if your plain text meets the other requirements. The - // PackedPolicySize response element indicates by percentage how close the policies - // and tags for your request are to the upper size limit. + // for this limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags + // for your request are to the upper size limit. // // You can pass a session tag with the same key as a tag that is already attached // to the user you are federating. When you do, session tags override a user diff --git a/cluster-autoscaler/vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go b/cluster-autoscaler/vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go index 35f59755d39f..47a6b7b1d19a 100644 --- a/cluster-autoscaler/vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go +++ b/cluster-autoscaler/vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go @@ -150,6 +150,16 @@ const ( // Can be published as read/write at multiple nodes // simultaneously. VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER VolumeCapability_AccessMode_Mode = 5 + // Can only be published once as read/write at a single workload + // on a single node, at any given time. SHOULD be used instead of + // SINGLE_NODE_WRITER for COs using the experimental + // SINGLE_NODE_MULTI_WRITER capability. + VolumeCapability_AccessMode_SINGLE_NODE_SINGLE_WRITER VolumeCapability_AccessMode_Mode = 6 + // Can be published as read/write at multiple workloads on a + // single node simultaneously. SHOULD be used instead of + // SINGLE_NODE_WRITER for COs using the experimental + // SINGLE_NODE_MULTI_WRITER capability. + VolumeCapability_AccessMode_SINGLE_NODE_MULTI_WRITER VolumeCapability_AccessMode_Mode = 7 ) var VolumeCapability_AccessMode_Mode_name = map[int32]string{ @@ -159,15 +169,19 @@ var VolumeCapability_AccessMode_Mode_name = map[int32]string{ 3: "MULTI_NODE_READER_ONLY", 4: "MULTI_NODE_SINGLE_WRITER", 5: "MULTI_NODE_MULTI_WRITER", + 6: "SINGLE_NODE_SINGLE_WRITER", + 7: "SINGLE_NODE_MULTI_WRITER", } var VolumeCapability_AccessMode_Mode_value = map[string]int32{ - "UNKNOWN": 0, - "SINGLE_NODE_WRITER": 1, - "SINGLE_NODE_READER_ONLY": 2, - "MULTI_NODE_READER_ONLY": 3, - "MULTI_NODE_SINGLE_WRITER": 4, - "MULTI_NODE_MULTI_WRITER": 5, + "UNKNOWN": 0, + "SINGLE_NODE_WRITER": 1, + "SINGLE_NODE_READER_ONLY": 2, + "MULTI_NODE_READER_ONLY": 3, + "MULTI_NODE_SINGLE_WRITER": 4, + "MULTI_NODE_MULTI_WRITER": 5, + "SINGLE_NODE_SINGLE_WRITER": 6, + "SINGLE_NODE_MULTI_WRITER": 7, } func (x VolumeCapability_AccessMode_Mode) String() string { @@ -221,6 +235,15 @@ const ( // This enables COs to, for example, fetch per volume // condition after a volume is provisioned. ControllerServiceCapability_RPC_GET_VOLUME ControllerServiceCapability_RPC_Type = 12 + // Indicates the SP supports the SINGLE_NODE_SINGLE_WRITER and/or + // SINGLE_NODE_MULTI_WRITER access modes. + // These access modes are intended to replace the + // SINGLE_NODE_WRITER access mode to clarify the number of writers + // for a volume on a single node. Plugins MUST accept and allow + // use of the SINGLE_NODE_WRITER access mode when either + // SINGLE_NODE_SINGLE_WRITER and/or SINGLE_NODE_MULTI_WRITER are + // supported, in order to permit older COs to continue working. + ControllerServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER ControllerServiceCapability_RPC_Type = 13 ) var ControllerServiceCapability_RPC_Type_name = map[int32]string{ @@ -237,6 +260,7 @@ var ControllerServiceCapability_RPC_Type_name = map[int32]string{ 10: "LIST_VOLUMES_PUBLISHED_NODES", 11: "VOLUME_CONDITION", 12: "GET_VOLUME", + 13: "SINGLE_NODE_MULTI_WRITER", } var ControllerServiceCapability_RPC_Type_value = map[string]int32{ @@ -253,6 +277,7 @@ var ControllerServiceCapability_RPC_Type_value = map[string]int32{ "LIST_VOLUMES_PUBLISHED_NODES": 10, "VOLUME_CONDITION": 11, "GET_VOLUME": 12, + "SINGLE_NODE_MULTI_WRITER": 13, } func (x ControllerServiceCapability_RPC_Type) String() string { @@ -314,6 +339,20 @@ const ( // Note that, for alpha, `VolumeCondition` is intended to be // informative for humans only, not for automation. NodeServiceCapability_RPC_VOLUME_CONDITION NodeServiceCapability_RPC_Type = 4 + // Indicates the SP supports the SINGLE_NODE_SINGLE_WRITER and/or + // SINGLE_NODE_MULTI_WRITER access modes. + // These access modes are intended to replace the + // SINGLE_NODE_WRITER access mode to clarify the number of writers + // for a volume on a single node. Plugins MUST accept and allow + // use of the SINGLE_NODE_WRITER access mode (subject to the + // processing rules for NodePublishVolume), when either + // SINGLE_NODE_SINGLE_WRITER and/or SINGLE_NODE_MULTI_WRITER are + // supported, in order to permit older COs to continue working. + NodeServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER NodeServiceCapability_RPC_Type = 5 + // Indicates that Node service supports mounting volumes + // with provided volume group identifier during node stage + // or node publish RPC calls. + NodeServiceCapability_RPC_VOLUME_MOUNT_GROUP NodeServiceCapability_RPC_Type = 6 ) var NodeServiceCapability_RPC_Type_name = map[int32]string{ @@ -322,14 +361,18 @@ var NodeServiceCapability_RPC_Type_name = map[int32]string{ 2: "GET_VOLUME_STATS", 3: "EXPAND_VOLUME", 4: "VOLUME_CONDITION", + 5: "SINGLE_NODE_MULTI_WRITER", + 6: "VOLUME_MOUNT_GROUP", } var NodeServiceCapability_RPC_Type_value = map[string]int32{ - "UNKNOWN": 0, - "STAGE_UNSTAGE_VOLUME": 1, - "GET_VOLUME_STATS": 2, - "EXPAND_VOLUME": 3, - "VOLUME_CONDITION": 4, + "UNKNOWN": 0, + "STAGE_UNSTAGE_VOLUME": 1, + "GET_VOLUME_STATS": 2, + "EXPAND_VOLUME": 3, + "VOLUME_CONDITION": 4, + "SINGLE_NODE_MULTI_WRITER": 5, + "VOLUME_MOUNT_GROUP": 6, } func (x NodeServiceCapability_RPC_Type) String() string { @@ -1252,7 +1295,19 @@ type VolumeCapability_MountVolume struct { // Therefore, the CO and the Plugin MUST NOT leak this information // to untrusted entities. The total size of this repeated field // SHALL NOT exceed 4 KiB. - MountFlags []string `protobuf:"bytes,2,rep,name=mount_flags,json=mountFlags,proto3" json:"mount_flags,omitempty"` + MountFlags []string `protobuf:"bytes,2,rep,name=mount_flags,json=mountFlags,proto3" json:"mount_flags,omitempty"` + // If SP has VOLUME_MOUNT_GROUP node capability and CO provides + // this field then SP MUST ensure that the volume_mount_group + // parameter is passed as the group identifier to the underlying + // operating system mount system call, with the understanding + // that the set of available mount call parameters and/or + // mount implementations may vary across operating systems. + // Additionally, new file and/or directory entries written to + // the underlying filesystem SHOULD be permission-labeled in such a + // manner, unless otherwise modified by a workload, that they are + // both readable and writable by said mount group identifier. + // This is an OPTIONAL field. + VolumeMountGroup string `protobuf:"bytes,3,opt,name=volume_mount_group,json=volumeMountGroup,proto3" json:"volume_mount_group,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1297,6 +1352,13 @@ func (m *VolumeCapability_MountVolume) GetMountFlags() []string { return nil } +func (m *VolumeCapability_MountVolume) GetVolumeMountGroup() string { + if m != nil { + return m.VolumeMountGroup + } + return "" +} + // Specify how a volume can be accessed. type VolumeCapability_AccessMode struct { // This field is REQUIRED. @@ -2749,10 +2811,42 @@ type GetCapacityResponse struct { // consideration when calculating the available capacity of the // storage. This field is REQUIRED. // The value of this field MUST NOT be negative. - AvailableCapacity int64 `protobuf:"varint,1,opt,name=available_capacity,json=availableCapacity,proto3" json:"available_capacity,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + AvailableCapacity int64 `protobuf:"varint,1,opt,name=available_capacity,json=availableCapacity,proto3" json:"available_capacity,omitempty"` + // The largest size that may be used in a + // CreateVolumeRequest.capacity_range.required_bytes field + // to create a volume with the same parameters as those in + // GetCapacityRequest. + // + // If `volume_capabilities` or `parameters` is + // specified in the request, the Plugin SHALL take those into + // consideration when calculating the minimum volume size of the + // storage. + // + // This field is OPTIONAL. MUST NOT be negative. + // The Plugin SHOULD provide a value for this field if it has + // a maximum size for individual volumes and leave it unset + // otherwise. COs MAY use it to make decision about + // where to create volumes. + MaximumVolumeSize *wrappers.Int64Value `protobuf:"bytes,2,opt,name=maximum_volume_size,json=maximumVolumeSize,proto3" json:"maximum_volume_size,omitempty"` + // The smallest size that may be used in a + // CreateVolumeRequest.capacity_range.limit_bytes field + // to create a volume with the same parameters as those in + // GetCapacityRequest. + // + // If `volume_capabilities` or `parameters` is + // specified in the request, the Plugin SHALL take those into + // consideration when calculating the maximum volume size of the + // storage. + // + // This field is OPTIONAL. MUST NOT be negative. + // The Plugin SHOULD provide a value for this field if it has + // a minimum size for individual volumes and leave it unset + // otherwise. COs MAY use it to make decision about + // where to create volumes. + MinimumVolumeSize *wrappers.Int64Value `protobuf:"bytes,3,opt,name=minimum_volume_size,json=minimumVolumeSize,proto3" json:"minimum_volume_size,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *GetCapacityResponse) Reset() { *m = GetCapacityResponse{} } @@ -2787,6 +2881,20 @@ func (m *GetCapacityResponse) GetAvailableCapacity() int64 { return 0 } +func (m *GetCapacityResponse) GetMaximumVolumeSize() *wrappers.Int64Value { + if m != nil { + return m.MaximumVolumeSize + } + return nil +} + +func (m *GetCapacityResponse) GetMinimumVolumeSize() *wrappers.Int64Value { + if m != nil { + return m.MinimumVolumeSize + } + return nil +} + type ControllerGetCapabilitiesRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -3600,6 +3708,10 @@ type NodeStageVolumeRequest struct { // CO SHALL be responsible for creating the directory if it does not // exist. // This is a REQUIRED field. + // This field overrides the general CSI size limit. + // SP SHOULD support the maximum path length allowed by the operating + // system/filesystem, but, at a minimum, SP MUST accept a max path + // length of at least 128 bytes. StagingTargetPath string `protobuf:"bytes,3,opt,name=staging_target_path,json=stagingTargetPath,proto3" json:"staging_target_path,omitempty"` // Volume capability describing how the CO intends to use this volume. // SP MUST ensure the CO can use the staged volume as described. @@ -3724,6 +3836,10 @@ type NodeUnstageVolumeRequest struct { // The path at which the volume was staged. It MUST be an absolute // path in the root filesystem of the process serving this request. // This is a REQUIRED field. + // This field overrides the general CSI size limit. + // SP SHOULD support the maximum path length allowed by the operating + // system/filesystem, but, at a minimum, SP MUST accept a max path + // length of at least 128 bytes. StagingTargetPath string `protobuf:"bytes,2,opt,name=staging_target_path,json=stagingTargetPath,proto3" json:"staging_target_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -3815,6 +3931,10 @@ type NodePublishVolumeRequest struct { // It MUST be set if the Node Plugin implements the // `STAGE_UNSTAGE_VOLUME` node capability. // This is an OPTIONAL field. + // This field overrides the general CSI size limit. + // SP SHOULD support the maximum path length allowed by the operating + // system/filesystem, but, at a minimum, SP MUST accept a max path + // length of at least 128 bytes. StagingTargetPath string `protobuf:"bytes,3,opt,name=staging_target_path,json=stagingTargetPath,proto3" json:"staging_target_path,omitempty"` // The path to which the volume will be published. It MUST be an // absolute path in the root filesystem of the process serving this @@ -3828,6 +3948,10 @@ type NodePublishVolumeRequest struct { // mounted directory at target_path. // Creation of target_path is the responsibility of the SP. // This is a REQUIRED field. + // This field overrides the general CSI size limit. + // SP SHOULD support the maximum path length allowed by the operating + // system/filesystem, but, at a minimum, SP MUST accept a max path + // length of at least 128 bytes. TargetPath string `protobuf:"bytes,4,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` // Volume capability describing how the CO intends to use this volume. // SP MUST ensure the CO can use the published volume as described. @@ -3970,6 +4094,10 @@ type NodeUnpublishVolumeRequest struct { // path in the root filesystem of the process serving this request. // The SP MUST delete the file or directory it created at this path. // This is a REQUIRED field. + // This field overrides the general CSI size limit. + // SP SHOULD support the maximum path length allowed by the operating + // system/filesystem, but, at a minimum, SP MUST accept a max path + // length of at least 128 bytes. TargetPath string `protobuf:"bytes,2,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -4054,12 +4182,20 @@ type NodeGetVolumeStatsRequest struct { // It MUST be an absolute path in the root filesystem of // the process serving this request. // This is a REQUIRED field. + // This field overrides the general CSI size limit. + // SP SHOULD support the maximum path length allowed by the operating + // system/filesystem, but, at a minimum, SP MUST accept a max path + // length of at least 128 bytes. VolumePath string `protobuf:"bytes,2,opt,name=volume_path,json=volumePath,proto3" json:"volume_path,omitempty"` // The path where the volume is staged, if the plugin has the // STAGE_UNSTAGE_VOLUME capability, otherwise empty. // If not empty, it MUST be an absolute path in the root // filesystem of the process serving this request. // This field is OPTIONAL. + // This field overrides the general CSI size limit. + // SP SHOULD support the maximum path length allowed by the operating + // system/filesystem, but, at a minimum, SP MUST accept a max path + // length of at least 128 bytes. StagingTargetPath string `protobuf:"bytes,3,opt,name=staging_target_path,json=stagingTargetPath,proto3" json:"staging_target_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -4504,6 +4640,10 @@ type NodeGetInfoResponse struct { // `ControllerPublishVolume`, to refer to this node. // The SP is NOT responsible for global uniqueness of node_id across // multiple SPs. + // This field overrides the general CSI size limit. + // The size of this field SHALL NOT exceed 256 bytes. The general + // CSI size limit, 128 byte, is RECOMMENDED for best backwards + // compatibility. NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // Maximum number of volumes that controller can publish to the node. // If value is not set or zero CO SHALL decide how many volumes of @@ -4584,6 +4724,10 @@ type NodeExpandVolumeRequest struct { // The ID of the volume. This field is REQUIRED. VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` // The path on which volume is available. This field is REQUIRED. + // This field overrides the general CSI size limit. + // SP SHOULD support the maximum path length allowed by the operating + // system/filesystem, but, at a minimum, SP MUST accept a max path + // length of at least 128 bytes. VolumePath string `protobuf:"bytes,2,opt,name=volume_path,json=volumePath,proto3" json:"volume_path,omitempty"` // This allows CO to specify the capacity requirements of the volume // after expansion. If capacity_range is omitted then a plugin MAY @@ -4597,6 +4741,10 @@ type NodeExpandVolumeRequest struct { // If not empty, it MUST be an absolute path in the root // filesystem of the process serving this request. // This field is OPTIONAL. + // This field overrides the general CSI size limit. + // SP SHOULD support the maximum path length allowed by the operating + // system/filesystem, but, at a minimum, SP MUST accept a max path + // length of at least 128 bytes. StagingTargetPath string `protobuf:"bytes,4,opt,name=staging_target_path,json=stagingTargetPath,proto3" json:"staging_target_path,omitempty"` // Volume capability describing how the CO intends to use this volume. // This allows SP to determine if volume is being used as a block @@ -4607,7 +4755,11 @@ type NodeExpandVolumeRequest struct { // volume_capability is omitted the SP MAY determine // access_type from given volume_path for the volume and perform // node expansion. This is an OPTIONAL field. - VolumeCapability *VolumeCapability `protobuf:"bytes,5,opt,name=volume_capability,json=volumeCapability,proto3" json:"volume_capability,omitempty"` + VolumeCapability *VolumeCapability `protobuf:"bytes,5,opt,name=volume_capability,json=volumeCapability,proto3" json:"volume_capability,omitempty"` + // Secrets required by plugin to complete node expand volume request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + Secrets map[string]string `protobuf:"bytes,6,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -4673,6 +4825,13 @@ func (m *NodeExpandVolumeRequest) GetVolumeCapability() *VolumeCapability { return nil } +func (m *NodeExpandVolumeRequest) GetSecrets() map[string]string { + if m != nil { + return m.Secrets + } + return nil +} + type NodeExpandVolumeResponse struct { // The capacity of the volume in bytes. This field is OPTIONAL. CapacityBytes int64 `protobuf:"varint,1,opt,name=capacity_bytes,json=capacityBytes,proto3" json:"capacity_bytes,omitempty"` @@ -4883,6 +5042,7 @@ func init() { proto.RegisterType((*NodeGetInfoRequest)(nil), "csi.v1.NodeGetInfoRequest") proto.RegisterType((*NodeGetInfoResponse)(nil), "csi.v1.NodeGetInfoResponse") proto.RegisterType((*NodeExpandVolumeRequest)(nil), "csi.v1.NodeExpandVolumeRequest") + proto.RegisterMapType((map[string]string)(nil), "csi.v1.NodeExpandVolumeRequest.SecretsEntry") proto.RegisterType((*NodeExpandVolumeResponse)(nil), "csi.v1.NodeExpandVolumeResponse") proto.RegisterExtension(E_AlphaEnum) proto.RegisterExtension(E_AlphaEnumValue) @@ -4898,236 +5058,245 @@ func init() { } var fileDescriptor_9cdb00adce470e01 = []byte{ - // 3651 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x3b, 0x4b, 0x6c, 0x1b, 0xd7, - 0xb5, 0x1a, 0x7e, 0xf4, 0x39, 0x94, 0x64, 0xfa, 0xea, 0x63, 0x7a, 0x24, 0xd9, 0xf2, 0x38, 0x76, - 0x64, 0xc7, 0xa6, 0x13, 0x25, 0x0e, 0x5e, 0x64, 0xe7, 0x43, 0x52, 0xb4, 0xc4, 0x98, 0xa6, 0x94, - 0x21, 0x65, 0xc7, 0x7e, 0x2f, 0x98, 0x8c, 0xc8, 0x2b, 0x79, 0x10, 0x72, 0x86, 0x9e, 0x19, 0xea, - 0x59, 0x6f, 0xf3, 0x1e, 0x5e, 0xd1, 0x45, 0xd1, 0x16, 0xe8, 0x2e, 0xdd, 0xb5, 0x68, 0xbb, 0x2a, - 0x12, 0x64, 0xd3, 0xa2, 0xcb, 0x02, 0x5d, 0x16, 0x68, 0xd1, 0x5d, 0x8b, 0x76, 0x91, 0x7d, 0x90, - 0x02, 0x59, 0x75, 0xd1, 0x55, 0x31, 0xf7, 0xde, 0x19, 0xce, 0x9f, 0xa4, 0x65, 0x23, 0x8b, 0xae, - 0xc4, 0x39, 0xf7, 0x9c, 0x73, 0xcf, 0xbd, 0xf7, 0x9c, 0x73, 0xcf, 0xe7, 0x0a, 0x6e, 0x1e, 0x2a, - 0xe6, 0xe3, 0xde, 0x7e, 0xbe, 0xa9, 0x75, 0x6e, 0x34, 0x35, 0xd5, 0x94, 0x15, 0x15, 0xeb, 0xd7, - 0x0d, 0x53, 0xd3, 0xe5, 0x43, 0x7c, 0x5d, 0x51, 0x4d, 0xac, 0x1f, 0xc8, 0x4d, 0x7c, 0xc3, 0xe8, - 0xe2, 0xe6, 0x8d, 0xa6, 0xa1, 0xe4, 0xbb, 0xba, 0x66, 0x6a, 0x68, 0xdc, 0xfa, 0x79, 0xf4, 0x1a, - 0xbf, 0x7a, 0xa8, 0x69, 0x87, 0x6d, 0x7c, 0x83, 0x40, 0xf7, 0x7b, 0x07, 0x37, 0x5a, 0xd8, 0x68, - 0xea, 0x4a, 0xd7, 0xd4, 0x74, 0x8a, 0xc9, 0x9f, 0xf7, 0x63, 0x98, 0x4a, 0x07, 0x1b, 0xa6, 0xdc, - 0xe9, 0x32, 0x84, 0x73, 0x7e, 0x84, 0xff, 0xd6, 0xe5, 0x6e, 0x17, 0xeb, 0x06, 0x1d, 0x17, 0x16, - 0x61, 0x7e, 0x0b, 0x9b, 0xbb, 0xed, 0xde, 0xa1, 0xa2, 0x56, 0xd4, 0x03, 0x4d, 0xc4, 0x4f, 0x7a, - 0xd8, 0x30, 0x85, 0xbf, 0x70, 0xb0, 0xe0, 0x1b, 0x30, 0xba, 0x9a, 0x6a, 0x60, 0x84, 0x20, 0xa5, - 0xca, 0x1d, 0x9c, 0xe3, 0x56, 0xb9, 0xb5, 0x29, 0x91, 0xfc, 0x46, 0x97, 0x60, 0xf6, 0x08, 0xab, - 0x2d, 0x4d, 0x97, 0x8e, 0xb0, 0x6e, 0x28, 0x9a, 0x9a, 0x4b, 0x90, 0xd1, 0x19, 0x0a, 0xbd, 0x4f, - 0x81, 0x68, 0x0b, 0x26, 0x3b, 0xb2, 0xaa, 0x1c, 0x60, 0xc3, 0xcc, 0x25, 0x57, 0x93, 0x6b, 0x99, - 0xf5, 0x57, 0xf2, 0x74, 0xa9, 0xf9, 0xd0, 0xb9, 0xf2, 0xf7, 0x18, 0x76, 0x59, 0x35, 0xf5, 0x63, - 0xd1, 0x21, 0xe6, 0x6f, 0xc1, 0x8c, 0x67, 0x08, 0x65, 0x21, 0xf9, 0x09, 0x3e, 0x66, 0x32, 0x59, - 0x3f, 0xd1, 0x3c, 0xa4, 0x8f, 0xe4, 0x76, 0x0f, 0x33, 0x49, 0xe8, 0xc7, 0x46, 0xe2, 0x3f, 0x38, - 0xe1, 0x1c, 0x2c, 0x3b, 0xb3, 0x95, 0xe4, 0xae, 0xbc, 0xaf, 0xb4, 0x15, 0x53, 0xc1, 0x86, 0xbd, - 0xf4, 0x8f, 0x60, 0x25, 0x62, 0x9c, 0xed, 0xc0, 0x6d, 0x98, 0x6e, 0xba, 0xe0, 0x39, 0x8e, 0x2c, - 0x25, 0x67, 0x2f, 0xc5, 0x47, 0x79, 0x2c, 0x7a, 0xb0, 0x85, 0x3f, 0x26, 0x21, 0xeb, 0x47, 0x41, - 0xb7, 0x61, 0xc2, 0xc0, 0xfa, 0x91, 0xd2, 0xa4, 0xfb, 0x9a, 0x59, 0x5f, 0x8d, 0xe2, 0x96, 0xaf, - 0x53, 0xbc, 0xed, 0x31, 0xd1, 0x26, 0x41, 0x7b, 0x90, 0x3d, 0xd2, 0xda, 0xbd, 0x0e, 0x96, 0xf0, - 0xd3, 0xae, 0xac, 0x3a, 0x07, 0x90, 0x59, 0x5f, 0x8b, 0x64, 0x73, 0x9f, 0x10, 0x94, 0x6d, 0xfc, - 0xed, 0x31, 0xf1, 0xd4, 0x91, 0x17, 0xc4, 0x7f, 0xca, 0xc1, 0x04, 0x9b, 0x0d, 0xbd, 0x05, 0x29, - 0xf3, 0xb8, 0x4b, 0xa5, 0x9b, 0x5d, 0xbf, 0x34, 0x48, 0xba, 0x7c, 0xe3, 0xb8, 0x8b, 0x45, 0x42, - 0x22, 0x7c, 0x00, 0x29, 0xeb, 0x0b, 0x65, 0x60, 0x62, 0xaf, 0x76, 0xb7, 0xb6, 0xf3, 0xa0, 0x96, - 0x1d, 0x43, 0x8b, 0x80, 0x4a, 0x3b, 0xb5, 0x86, 0xb8, 0x53, 0xad, 0x96, 0x45, 0xa9, 0x5e, 0x16, - 0xef, 0x57, 0x4a, 0xe5, 0x2c, 0x87, 0x5e, 0x82, 0xd5, 0xfb, 0x3b, 0xd5, 0xbd, 0x7b, 0x65, 0xa9, - 0x50, 0x2a, 0x95, 0xeb, 0xf5, 0x4a, 0xb1, 0x52, 0xad, 0x34, 0x1e, 0x4a, 0xa5, 0x9d, 0x5a, 0xbd, - 0x21, 0x16, 0x2a, 0xb5, 0x46, 0x3d, 0x9b, 0xe0, 0xff, 0x9f, 0x83, 0x53, 0xbe, 0x05, 0xa0, 0x82, - 0x47, 0xc2, 0xeb, 0xc3, 0x2e, 0xdc, 0x2d, 0xe9, 0xb5, 0x30, 0x49, 0x01, 0xc6, 0x77, 0x6a, 0xd5, - 0x4a, 0xcd, 0x92, 0x2e, 0x03, 0x13, 0x3b, 0x77, 0xee, 0x90, 0x8f, 0x44, 0x71, 0x9c, 0x4e, 0x28, - 0xcc, 0xc2, 0xf4, 0xae, 0xae, 0xed, 0x63, 0x5b, 0x7f, 0x0a, 0x30, 0xc3, 0xbe, 0x99, 0xbe, 0xbc, - 0x0a, 0x69, 0x1d, 0xcb, 0xad, 0x63, 0x76, 0xb4, 0x7c, 0x9e, 0xda, 0x64, 0xde, 0xb6, 0xc9, 0x7c, - 0x51, 0xd3, 0xda, 0xf7, 0x2d, 0xfd, 0x14, 0x29, 0xa2, 0xf0, 0x4d, 0x0a, 0xe6, 0x4a, 0x3a, 0x96, - 0x4d, 0x4c, 0xa5, 0x65, 0xac, 0x43, 0x6d, 0xef, 0x36, 0xcc, 0x5a, 0xfa, 0xd5, 0x54, 0xcc, 0x63, - 0x49, 0x97, 0xd5, 0x43, 0xcc, 0x8e, 0x7e, 0xc1, 0xde, 0x81, 0x12, 0x1b, 0x15, 0xad, 0x41, 0x71, - 0xa6, 0xe9, 0xfe, 0x44, 0x15, 0x98, 0x63, 0xaa, 0xe3, 0x51, 0xe9, 0xa4, 0x57, 0xa5, 0xa9, 0x14, - 0x2e, 0x95, 0x46, 0x47, 0x5e, 0x88, 0x82, 0x0d, 0x74, 0x17, 0xa0, 0x2b, 0xeb, 0x72, 0x07, 0x9b, - 0x58, 0x37, 0x72, 0x29, 0xaf, 0x7d, 0x87, 0xac, 0x26, 0xbf, 0xeb, 0x60, 0x53, 0xfb, 0x76, 0x91, - 0xa3, 0x2d, 0xcb, 0x20, 0x9a, 0x3a, 0x36, 0x8d, 0x5c, 0x9a, 0x70, 0x5a, 0x8b, 0xe3, 0x54, 0xa7, - 0xa8, 0x84, 0x4d, 0x31, 0xf9, 0xe3, 0x22, 0x27, 0xda, 0xd4, 0x68, 0x07, 0x16, 0xec, 0x05, 0x6a, - 0xaa, 0x89, 0x55, 0x53, 0x32, 0xb4, 0x9e, 0xde, 0xc4, 0xb9, 0x71, 0xb2, 0x4b, 0x4b, 0xbe, 0x25, - 0x52, 0x9c, 0x3a, 0x41, 0x11, 0xd9, 0xd6, 0x78, 0x80, 0xe8, 0x11, 0xf0, 0x72, 0xb3, 0x89, 0x0d, - 0x43, 0xa1, 0x7b, 0x21, 0xe9, 0xf8, 0x49, 0x4f, 0xd1, 0x71, 0x07, 0xab, 0xa6, 0x91, 0x9b, 0xf0, - 0x72, 0x6d, 0x68, 0x5d, 0xad, 0xad, 0x1d, 0x1e, 0x8b, 0x7d, 0x1c, 0xf1, 0xac, 0x87, 0xdc, 0x35, - 0x62, 0xf0, 0x6f, 0xc3, 0x29, 0xdf, 0xa6, 0x8c, 0xe2, 0xd9, 0xf8, 0x0d, 0x98, 0x76, 0xef, 0xc4, - 0x48, 0x5e, 0xf1, 0xfb, 0x09, 0x98, 0x0b, 0xd9, 0x03, 0xb4, 0x0d, 0x93, 0x86, 0x2a, 0x77, 0x8d, - 0xc7, 0x9a, 0xc9, 0xf4, 0xf7, 0x6a, 0xcc, 0x96, 0xe5, 0xeb, 0x0c, 0x97, 0x7e, 0x6e, 0x8f, 0x89, - 0x0e, 0x35, 0x2a, 0xc2, 0x38, 0xdd, 0x4f, 0xbf, 0x6f, 0x0a, 0xe3, 0x43, 0x61, 0x0e, 0x17, 0x46, - 0xc9, 0xbf, 0x06, 0xb3, 0xde, 0x19, 0xd0, 0x79, 0xc8, 0xd8, 0x33, 0x48, 0x4a, 0x8b, 0xad, 0x15, - 0x6c, 0x50, 0xa5, 0xc5, 0xbf, 0x02, 0xd3, 0x6e, 0x66, 0x68, 0x09, 0xa6, 0x98, 0x42, 0x38, 0xe8, - 0x93, 0x14, 0x50, 0x69, 0x39, 0x36, 0xfd, 0x0e, 0xcc, 0x7b, 0xf5, 0x8c, 0x99, 0xf2, 0x65, 0x67, - 0x0d, 0x74, 0x2f, 0x66, 0xbd, 0x6b, 0xb0, 0xe5, 0x14, 0x7e, 0x99, 0x82, 0xac, 0xdf, 0x68, 0xd0, - 0x6d, 0x48, 0xef, 0xb7, 0xb5, 0xe6, 0x27, 0x8c, 0xf6, 0xa5, 0x28, 0xeb, 0xca, 0x17, 0x2d, 0x2c, - 0x0a, 0xdd, 0x1e, 0x13, 0x29, 0x91, 0x45, 0xdd, 0xd1, 0x7a, 0xaa, 0xc9, 0x76, 0x2f, 0x9a, 0xfa, - 0x9e, 0x85, 0xd5, 0xa7, 0x26, 0x44, 0x68, 0x13, 0x32, 0x54, 0xed, 0xa4, 0x8e, 0xd6, 0xc2, 0xb9, - 0x24, 0xe1, 0x71, 0x31, 0x92, 0x47, 0x81, 0xe0, 0xde, 0xd3, 0x5a, 0x58, 0x04, 0xd9, 0xf9, 0xcd, - 0xcf, 0x40, 0xc6, 0x25, 0x1b, 0xbf, 0x05, 0x19, 0xd7, 0x64, 0xe8, 0x0c, 0x4c, 0x1c, 0x18, 0x92, - 0xe3, 0x84, 0xa7, 0xc4, 0xf1, 0x03, 0x83, 0xf8, 0xd3, 0xf3, 0x90, 0x21, 0x52, 0x48, 0x07, 0x6d, - 0xf9, 0xd0, 0xc8, 0x25, 0x56, 0x93, 0xd6, 0x19, 0x11, 0xd0, 0x1d, 0x0b, 0xc2, 0x7f, 0xcd, 0x01, - 0xf4, 0xa7, 0x44, 0xb7, 0x21, 0x45, 0xa4, 0xa4, 0xae, 0x7c, 0x6d, 0x08, 0x29, 0xf3, 0x44, 0x54, - 0x42, 0x25, 0xfc, 0x84, 0x83, 0x14, 0x61, 0xe3, 0xbf, 0x70, 0xea, 0x95, 0xda, 0x56, 0xb5, 0x2c, - 0xd5, 0x76, 0x36, 0xcb, 0xd2, 0x03, 0xb1, 0xd2, 0x28, 0x8b, 0x59, 0x0e, 0x2d, 0xc1, 0x19, 0x37, - 0x5c, 0x2c, 0x17, 0x36, 0xcb, 0xa2, 0xb4, 0x53, 0xab, 0x3e, 0xcc, 0x26, 0x10, 0x0f, 0x8b, 0xf7, - 0xf6, 0xaa, 0x8d, 0x4a, 0x70, 0x2c, 0x89, 0x96, 0x21, 0xe7, 0x1a, 0x63, 0x3c, 0x18, 0xdb, 0x94, - 0xc5, 0xd6, 0x35, 0x4a, 0x7f, 0xb2, 0xc1, 0x74, 0x71, 0xc6, 0x39, 0x0c, 0xa2, 0x6c, 0x0f, 0x60, - 0xc6, 0xe3, 0xa3, 0xad, 0x70, 0x8a, 0x39, 0x95, 0x96, 0xb4, 0x7f, 0x6c, 0x92, 0x10, 0x83, 0x5b, - 0x4b, 0x8a, 0x33, 0x36, 0xb4, 0x68, 0x01, 0xad, 0x6d, 0x6d, 0x2b, 0x1d, 0xc5, 0x64, 0x38, 0x09, - 0x82, 0x03, 0x04, 0x44, 0x10, 0x84, 0x2f, 0x13, 0x30, 0xce, 0xce, 0xe6, 0x92, 0xeb, 0x96, 0xf0, - 0xb0, 0xb4, 0xa1, 0x94, 0xa5, 0xc7, 0x38, 0x12, 0x5e, 0xe3, 0x40, 0xdb, 0x30, 0xeb, 0x76, 0xa5, - 0x4f, 0xed, 0x20, 0xee, 0x82, 0xf7, 0x80, 0xdc, 0xf6, 0xfc, 0x94, 0x85, 0x6e, 0x33, 0x47, 0x6e, - 0x18, 0x2a, 0xc2, 0xac, 0xcf, 0x1b, 0xa7, 0x06, 0x7b, 0xe3, 0x99, 0xa6, 0xc7, 0x31, 0x15, 0x60, - 0xce, 0x76, 0xa4, 0x6d, 0x2c, 0x99, 0xcc, 0xd1, 0xb2, 0xdb, 0x22, 0x1b, 0x70, 0xc0, 0xa8, 0x8f, - 0x6c, 0xc3, 0xf8, 0xf7, 0x00, 0x05, 0x65, 0x1d, 0xc9, 0x6b, 0xf6, 0x60, 0x2e, 0xc4, 0xc5, 0xa3, - 0x3c, 0x4c, 0x91, 0xa3, 0x32, 0x14, 0x13, 0xb3, 0xf0, 0x30, 0x28, 0x51, 0x1f, 0xc5, 0xc2, 0xef, - 0xea, 0xf8, 0x00, 0xeb, 0x3a, 0x6e, 0x11, 0xf3, 0x08, 0xc5, 0x77, 0x50, 0x84, 0xef, 0x70, 0x30, - 0x69, 0xc3, 0xd1, 0x06, 0x4c, 0x1a, 0xf8, 0x90, 0x5e, 0x3f, 0x74, 0xae, 0x73, 0x7e, 0xda, 0x7c, - 0x9d, 0x21, 0xb0, 0x40, 0xda, 0xc6, 0xb7, 0x02, 0x69, 0xcf, 0xd0, 0x48, 0x8b, 0xff, 0x0d, 0x07, - 0x73, 0x9b, 0xb8, 0x8d, 0xfd, 0x51, 0x4a, 0x9c, 0x87, 0x75, 0x5f, 0xec, 0x09, 0xef, 0xc5, 0x1e, - 0xc2, 0x2a, 0xe6, 0x62, 0x3f, 0xd1, 0x65, 0xb7, 0x08, 0xf3, 0xde, 0xd9, 0xa8, 0x7b, 0x17, 0xfe, - 0x9e, 0x84, 0x73, 0x96, 0x2e, 0xe8, 0x5a, 0xbb, 0x8d, 0xf5, 0xdd, 0xde, 0x7e, 0x5b, 0x31, 0x1e, - 0x8f, 0xb0, 0xb8, 0x33, 0x30, 0xa1, 0x6a, 0x2d, 0x97, 0xf1, 0x8c, 0x5b, 0x9f, 0x95, 0x16, 0x2a, - 0xc3, 0x69, 0x7f, 0x98, 0x75, 0xcc, 0x9c, 0x70, 0x74, 0x90, 0x95, 0x3d, 0xf2, 0xdf, 0x20, 0x3c, - 0x4c, 0x5a, 0x01, 0xa2, 0xa6, 0xb6, 0x8f, 0x89, 0xc5, 0x4c, 0x8a, 0xce, 0x37, 0x12, 0xfd, 0x11, - 0xd3, 0xeb, 0x4e, 0xc4, 0x14, 0xbb, 0xa2, 0xb8, 0xe0, 0xe9, 0xe3, 0x80, 0xc5, 0x8f, 0x13, 0xd6, - 0x6f, 0x0d, 0xc9, 0x7a, 0xa0, 0x27, 0x38, 0xc9, 0x29, 0x3e, 0x07, 0xf3, 0xfd, 0x3d, 0x07, 0xe7, - 0x23, 0x97, 0xc0, 0xae, 0xfc, 0x16, 0x9c, 0xea, 0xd2, 0x01, 0x67, 0x13, 0xa8, 0x95, 0xdd, 0x1a, - 0xb8, 0x09, 0x2c, 0x8b, 0x65, 0x50, 0xcf, 0x36, 0xcc, 0x76, 0x3d, 0x40, 0xbe, 0x00, 0x73, 0x21, - 0x68, 0x23, 0x2d, 0xe6, 0x2b, 0x0e, 0x56, 0xfb, 0xa2, 0xec, 0xa9, 0xdd, 0xe7, 0xa7, 0xbe, 0x8d, - 0xbe, 0x6e, 0x51, 0x97, 0x7f, 0x33, 0xb8, 0xf6, 0xf0, 0x09, 0x5f, 0x94, 0x05, 0x5f, 0x84, 0x0b, - 0x31, 0x53, 0x33, 0x73, 0xfe, 0x32, 0x05, 0x17, 0xee, 0xcb, 0x6d, 0xa5, 0xe5, 0x04, 0x72, 0x21, - 0xf9, 0x7e, 0xfc, 0x96, 0x34, 0x03, 0x16, 0x40, 0xbd, 0xd6, 0x6d, 0xc7, 0x6a, 0x07, 0xf1, 0x1f, - 0xe2, 0x3a, 0x7c, 0x8e, 0x49, 0xd8, 0xc3, 0x90, 0x24, 0xec, 0xad, 0xe1, 0x65, 0x8d, 0x4b, 0xc9, - 0xf6, 0xfc, 0x0e, 0xe6, 0xcd, 0xe1, 0xf9, 0xc6, 0x68, 0xc1, 0x89, 0xad, 0xf8, 0xdb, 0xcc, 0x9a, - 0x7e, 0x97, 0x02, 0x21, 0x6e, 0xf5, 0xcc, 0x87, 0x88, 0x30, 0xd5, 0xd4, 0xd4, 0x03, 0x45, 0xef, - 0xe0, 0x16, 0x8b, 0xfe, 0xdf, 0x18, 0x66, 0xf3, 0x98, 0x03, 0x29, 0xd9, 0xb4, 0x62, 0x9f, 0x0d, - 0xca, 0xc1, 0x44, 0x07, 0x1b, 0x86, 0x7c, 0x68, 0x8b, 0x65, 0x7f, 0xf2, 0x9f, 0x27, 0x61, 0xca, - 0x21, 0x41, 0x6a, 0x40, 0x83, 0xa9, 0xfb, 0xda, 0x7a, 0x16, 0x01, 0x9e, 0x5d, 0x99, 0x13, 0xcf, - 0xa0, 0xcc, 0x2d, 0x8f, 0x32, 0x53, 0x73, 0xd8, 0x7c, 0x26, 0xb1, 0x63, 0xf4, 0xfa, 0x5b, 0x57, - 0x40, 0xe1, 0xbf, 0x00, 0x55, 0x15, 0x83, 0x65, 0x51, 0x8e, 0x5b, 0xb2, 0x92, 0x26, 0xf9, 0xa9, - 0x84, 0x55, 0x53, 0x57, 0x58, 0xb8, 0x9e, 0x16, 0xa1, 0x23, 0x3f, 0x2d, 0x53, 0x88, 0x15, 0xd2, - 0x1b, 0xa6, 0xac, 0x9b, 0x8a, 0x7a, 0x28, 0x99, 0xda, 0x27, 0xd8, 0x29, 0xba, 0xda, 0xd0, 0x86, - 0x05, 0x14, 0xbe, 0x4e, 0xc0, 0x9c, 0x87, 0x3d, 0xd3, 0xc9, 0x5b, 0x30, 0xd1, 0xe7, 0xed, 0x09, - 0xe3, 0x43, 0xb0, 0xf3, 0x74, 0xdb, 0x6c, 0x0a, 0xb4, 0x02, 0xa0, 0xe2, 0xa7, 0xa6, 0x67, 0xde, - 0x29, 0x0b, 0x42, 0xe6, 0xe4, 0xbf, 0xcb, 0x39, 0x49, 0xb7, 0x29, 0x9b, 0x3d, 0x03, 0x5d, 0x03, - 0xc4, 0x5c, 0x34, 0x6e, 0x49, 0xec, 0x8e, 0xa1, 0xf3, 0x4e, 0x89, 0x59, 0x67, 0xa4, 0x46, 0x6e, - 0x1b, 0x03, 0x6d, 0x39, 0xf5, 0xcc, 0xa6, 0xa6, 0xb6, 0x14, 0xb3, 0x5f, 0xcf, 0x3c, 0x13, 0x48, - 0x10, 0xe8, 0x70, 0x31, 0xf9, 0xd3, 0x22, 0x67, 0x57, 0x30, 0x1d, 0x28, 0xff, 0x04, 0xd2, 0xf4, - 0x38, 0x86, 0xcc, 0xdb, 0xd1, 0x7b, 0x30, 0x6e, 0x10, 0x89, 0xfd, 0x35, 0x8a, 0xb0, 0x3d, 0x71, - 0xaf, 0x50, 0x64, 0x74, 0xc2, 0x3b, 0xc0, 0xf7, 0x2f, 0xa6, 0x2d, 0x6c, 0x0e, 0x7f, 0xfd, 0x6e, - 0x58, 0x6b, 0x10, 0x3e, 0x4d, 0xc0, 0x52, 0x28, 0x83, 0xd1, 0x2a, 0x10, 0x68, 0xdb, 0xb7, 0x92, - 0x57, 0x83, 0x37, 0x76, 0x80, 0x79, 0xe8, 0x8a, 0xf8, 0xff, 0x3b, 0xd9, 0x61, 0x16, 0x47, 0x3e, - 0xcc, 0xc0, 0x39, 0xd2, 0x9d, 0xf9, 0x3c, 0x01, 0x68, 0x0b, 0x9b, 0x4e, 0xaa, 0xcc, 0xb6, 0x34, - 0xc2, 0xdf, 0x70, 0xcf, 0xe0, 0x6f, 0xde, 0xf7, 0xf8, 0x1b, 0xea, 0xb1, 0xae, 0xba, 0x3a, 0x14, - 0xbe, 0xa9, 0x63, 0x6f, 0xcb, 0x88, 0xf4, 0x94, 0xc6, 0xfc, 0xc3, 0xa5, 0xa7, 0x27, 0x74, 0x2b, - 0x9b, 0x30, 0xe7, 0x91, 0x99, 0x29, 0xd0, 0x75, 0x40, 0xf2, 0x91, 0xac, 0xb4, 0x65, 0x4b, 0x2e, - 0x3b, 0xfb, 0x67, 0xd5, 0x80, 0xd3, 0xce, 0x88, 0x4d, 0x26, 0x08, 0xee, 0xa0, 0x92, 0xf1, 0xf3, - 0x77, 0x4c, 0xda, 0xee, 0x60, 0x2c, 0x80, 0xc3, 0xe6, 0xdd, 0x0a, 0xed, 0x9a, 0x5c, 0x0c, 0xaa, - 0x25, 0x6b, 0x21, 0x44, 0x36, 0x50, 0xfe, 0x96, 0x74, 0x5b, 0x48, 0x00, 0x1b, 0xdd, 0x82, 0xa4, - 0xde, 0x6d, 0x32, 0xf3, 0x78, 0x79, 0x08, 0xfe, 0x79, 0x71, 0xb7, 0xb4, 0x3d, 0x26, 0x5a, 0x54, - 0xfc, 0x3f, 0x12, 0x90, 0x14, 0x77, 0x4b, 0xe8, 0x3d, 0x4f, 0x37, 0xe1, 0xda, 0x90, 0x5c, 0xdc, - 0xcd, 0x84, 0xcf, 0x12, 0x61, 0xdd, 0x84, 0x1c, 0xcc, 0x97, 0xc4, 0x72, 0xa1, 0x51, 0x96, 0x36, - 0xcb, 0xd5, 0x72, 0xa3, 0x2c, 0xd1, 0x6e, 0x47, 0x96, 0x43, 0xcb, 0x90, 0xdb, 0xdd, 0x2b, 0x56, - 0x2b, 0xf5, 0x6d, 0x69, 0xaf, 0x66, 0xff, 0x62, 0xa3, 0x09, 0x94, 0x85, 0xe9, 0x6a, 0xa5, 0xde, - 0x60, 0x80, 0x7a, 0x36, 0x69, 0x41, 0xb6, 0xca, 0x0d, 0xa9, 0x54, 0xd8, 0x2d, 0x94, 0x2a, 0x8d, - 0x87, 0xd9, 0x14, 0xe2, 0x61, 0xd1, 0xcb, 0xbb, 0x5e, 0x2b, 0xec, 0xd6, 0xb7, 0x77, 0x1a, 0xd9, - 0x34, 0x42, 0x30, 0x4b, 0xe8, 0x6d, 0x50, 0x3d, 0x3b, 0x6e, 0x71, 0x28, 0x55, 0x77, 0x6a, 0x8e, - 0x0c, 0x13, 0x68, 0x1e, 0xb2, 0xf6, 0xcc, 0x62, 0xb9, 0xb0, 0x49, 0x2a, 0x5d, 0x93, 0xe8, 0x34, - 0xcc, 0x94, 0x3f, 0xdc, 0x2d, 0xd4, 0x36, 0x6d, 0xc4, 0x29, 0xb4, 0x0a, 0xcb, 0x6e, 0x71, 0x24, - 0x46, 0x55, 0xde, 0x24, 0xf5, 0xae, 0x7a, 0x16, 0xd0, 0x59, 0xc8, 0xb2, 0x46, 0x4e, 0x69, 0xa7, - 0xb6, 0x59, 0x69, 0x54, 0x76, 0x6a, 0xd9, 0x0c, 0x6f, 0x19, 0x32, 0x9a, 0x03, 0xb0, 0x24, 0x67, - 0xcc, 0xa6, 0x09, 0xd0, 0xa9, 0xbc, 0x7e, 0x95, 0x80, 0x05, 0x5a, 0x7a, 0xb5, 0x0b, 0xbd, 0xb6, - 0xa1, 0xaf, 0x41, 0x96, 0x16, 0x8b, 0x24, 0xbf, 0x0b, 0x9d, 0xa5, 0xf0, 0xfb, 0x76, 0xd0, 0x6e, - 0xb7, 0x49, 0x12, 0xae, 0x36, 0x49, 0xc5, 0x9f, 0xc2, 0x5c, 0xf5, 0x36, 0x14, 0x7c, 0xb3, 0xc5, - 0x65, 0xc5, 0xf7, 0x42, 0x62, 0xec, 0xeb, 0xf1, 0xdc, 0xe2, 0xe2, 0x8f, 0x93, 0xa4, 0xc0, 0x27, - 0x74, 0x11, 0x77, 0x60, 0xd1, 0x2f, 0x2f, 0xb3, 0xd6, 0x6b, 0x81, 0xb2, 0xbf, 0xe3, 0xb3, 0x1c, - 0x5c, 0x07, 0x43, 0xf8, 0x33, 0x07, 0x93, 0x36, 0xd8, 0x8a, 0x0d, 0x0c, 0xe5, 0x7f, 0xb0, 0xa7, - 0xcc, 0x38, 0x65, 0x41, 0x9c, 0xaa, 0xa5, 0xbb, 0x60, 0x9f, 0xf0, 0x17, 0xec, 0x43, 0xcf, 0x39, - 0x19, 0x7a, 0xce, 0xef, 0xc2, 0x4c, 0xd3, 0x12, 0x5f, 0xd1, 0x54, 0xc9, 0x54, 0x3a, 0x76, 0x15, - 0x31, 0xd8, 0x60, 0x6b, 0xd8, 0x5d, 0x71, 0x71, 0xda, 0x26, 0xb0, 0x40, 0x68, 0x15, 0xa6, 0x49, - 0xc3, 0x4d, 0x32, 0x35, 0xa9, 0x67, 0xe0, 0x5c, 0x9a, 0xd4, 0x54, 0x80, 0xc0, 0x1a, 0xda, 0x9e, - 0x81, 0x85, 0xdf, 0x72, 0xb0, 0x40, 0x4b, 0x45, 0x7e, 0x75, 0x1c, 0xd4, 0x78, 0x70, 0x6b, 0x9c, - 0xef, 0x2a, 0x09, 0x65, 0xf8, 0xa2, 0x32, 0xe5, 0x1c, 0x2c, 0xfa, 0xe7, 0x63, 0xe9, 0xf1, 0x17, - 0x09, 0x98, 0xb7, 0xe2, 0x1a, 0x7b, 0xe0, 0x79, 0x87, 0x9e, 0x23, 0x9c, 0xa4, 0x6f, 0x33, 0x53, - 0x81, 0xcd, 0xdc, 0xf6, 0x27, 0x9f, 0x57, 0xdc, 0x91, 0x99, 0x7f, 0x05, 0x2f, 0x6a, 0x2f, 0x3f, - 0xe3, 0x60, 0xc1, 0x37, 0x1f, 0xb3, 0x97, 0xb7, 0xfd, 0xd1, 0xf4, 0xc5, 0x08, 0xf9, 0x9e, 0x29, - 0x9e, 0xbe, 0x69, 0xc7, 0xb1, 0xa3, 0x99, 0xe5, 0x9f, 0x12, 0xb0, 0xd2, 0xbf, 0xb1, 0x48, 0xcb, - 0xbb, 0x35, 0x42, 0x39, 0xe8, 0x64, 0x9d, 0xe5, 0x0f, 0xfc, 0x0e, 0x77, 0x3d, 0x78, 0x89, 0x86, - 0x88, 0x14, 0xe7, 0x78, 0x43, 0xab, 0xa8, 0xa9, 0x51, 0xab, 0xa8, 0x27, 0xd2, 0x80, 0xff, 0x75, - 0x17, 0x88, 0xbd, 0xe2, 0x33, 0x4d, 0x18, 0xb2, 0xd3, 0xf2, 0x26, 0x9c, 0x21, 0xa1, 0xb3, 0xf3, - 0x62, 0xc3, 0xee, 0x23, 0x53, 0x97, 0x38, 0x29, 0x2e, 0x58, 0xc3, 0xce, 0x33, 0x05, 0xd6, 0x5d, - 0x68, 0x09, 0xdf, 0xa4, 0x60, 0xd1, 0x0a, 0xad, 0xeb, 0xa6, 0x7c, 0x38, 0x4a, 0xdd, 0xfd, 0x3f, - 0x83, 0x65, 0xcc, 0x84, 0xf7, 0x58, 0xc2, 0xb9, 0x0e, 0x53, 0xbd, 0x44, 0x79, 0x98, 0x33, 0x4c, - 0xf9, 0x90, 0xb8, 0x03, 0x59, 0x3f, 0xc4, 0xa6, 0xd4, 0x95, 0xcd, 0xc7, 0xcc, 0xd6, 0x4f, 0xb3, - 0xa1, 0x06, 0x19, 0xd9, 0x95, 0xcd, 0xc7, 0xcf, 0xe9, 0x20, 0xd1, 0xfb, 0x7e, 0xa7, 0xf0, 0xca, - 0x80, 0xb5, 0xc4, 0xe8, 0xd6, 0x87, 0x11, 0xa5, 0xee, 0xd7, 0x06, 0xb0, 0x1c, 0x5c, 0xe2, 0x3e, - 0x79, 0x69, 0xf7, 0x5b, 0xae, 0x92, 0x9f, 0x85, 0x33, 0x81, 0xc5, 0xb3, 0x2b, 0xe4, 0x10, 0x72, - 0xd6, 0xd0, 0x9e, 0x6a, 0x8c, 0xa8, 0x8e, 0x11, 0x1a, 0x93, 0x88, 0xd0, 0x18, 0x61, 0x09, 0xce, - 0x86, 0x4c, 0xc4, 0xa4, 0xf8, 0x75, 0x9a, 0x8a, 0x31, 0x7a, 0xc3, 0xe6, 0xa3, 0x28, 0xab, 0x78, - 0xc3, 0x7d, 0xec, 0xa1, 0xbd, 0x8d, 0x17, 0x61, 0x17, 0xe7, 0x21, 0xe3, 0xc6, 0x63, 0xd7, 0xa0, - 0x39, 0xc0, 0x70, 0xd2, 0x27, 0xea, 0x23, 0x8d, 0xfb, 0xfa, 0x48, 0xd5, 0xbe, 0x51, 0x4d, 0x78, - 0x43, 0xdb, 0xc8, 0xad, 0x88, 0x31, 0xab, 0x47, 0x01, 0xb3, 0x9a, 0xf4, 0x36, 0xa7, 0x22, 0x99, - 0xfe, 0x1b, 0x18, 0x16, 0x53, 0xea, 0xd0, 0xae, 0x91, 0xf0, 0x08, 0x78, 0xaa, 0xf1, 0xa3, 0xf7, - 0x71, 0x7c, 0x6a, 0x94, 0xf0, 0xab, 0x91, 0xb0, 0x02, 0x4b, 0xa1, 0xbc, 0xd9, 0xd4, 0xdf, 0xe3, - 0xa8, 0x60, 0x4e, 0x81, 0xa8, 0x6e, 0xca, 0xa6, 0x31, 0xec, 0xd4, 0x6c, 0xd0, 0x3d, 0x35, 0x05, - 0x11, 0x0d, 0x1e, 0xd1, 0x24, 0x84, 0x1f, 0x71, 0x74, 0x1f, 0xfc, 0xb2, 0xb0, 0xdb, 0xf6, 0x0a, - 0xa4, 0x7b, 0xa4, 0x06, 0x4e, 0xa3, 0xae, 0x39, 0xaf, 0x11, 0xec, 0x59, 0x43, 0x22, 0xc5, 0x78, - 0x6e, 0x55, 0x45, 0xe1, 0x0b, 0x0e, 0x32, 0x2e, 0xfe, 0x68, 0x19, 0xa6, 0x9c, 0xba, 0x89, 0x9d, - 0xef, 0x38, 0x00, 0xeb, 0xf8, 0x4d, 0xcd, 0x94, 0xdb, 0xec, 0x7d, 0x06, 0xfd, 0xb0, 0x52, 0xd4, - 0x9e, 0x81, 0x69, 0x38, 0x9c, 0x14, 0xc9, 0x6f, 0x74, 0x0d, 0x52, 0x3d, 0x55, 0x31, 0x89, 0xd9, - 0xcf, 0xfa, 0xed, 0x99, 0x4c, 0x95, 0xdf, 0x53, 0x15, 0x53, 0x24, 0x58, 0xc2, 0x55, 0x48, 0x59, - 0x5f, 0xde, 0xf2, 0xc2, 0x14, 0xa4, 0x8b, 0x0f, 0x1b, 0xe5, 0x7a, 0x96, 0x43, 0x00, 0xe3, 0x15, - 0x9a, 0x8c, 0x27, 0x84, 0xaa, 0xfd, 0x5c, 0xd2, 0x59, 0x84, 0xe5, 0x02, 0xe4, 0x7d, 0x55, 0xd3, - 0x3b, 0x72, 0x9b, 0xc8, 0x3c, 0x29, 0x3a, 0xdf, 0xd1, 0xad, 0x05, 0x5a, 0x88, 0x5b, 0x76, 0x4e, - 0x24, 0xac, 0x18, 0xf4, 0x31, 0xd5, 0xad, 0xa8, 0x32, 0x50, 0x21, 0xb4, 0x0c, 0xb4, 0xe2, 0xb9, - 0x65, 0x07, 0x14, 0x80, 0x7e, 0x98, 0x80, 0x85, 0x50, 0x3c, 0x74, 0xd3, 0x5d, 0xfa, 0xb9, 0x10, - 0xcb, 0xd3, 0x5d, 0xf4, 0xf9, 0x15, 0x47, 0x8b, 0x3e, 0x1b, 0x9e, 0xa2, 0xcf, 0xe5, 0x81, 0xf4, - 0xee, 0x72, 0xcf, 0x93, 0x88, 0x6a, 0x4f, 0xbd, 0x51, 0xd8, 0x2a, 0x4b, 0x7b, 0x35, 0xfa, 0xd7, - 0xa9, 0xf6, 0xcc, 0x43, 0xb6, 0x5f, 0x03, 0x91, 0xea, 0x8d, 0x42, 0xa3, 0x9e, 0x4d, 0x04, 0x2b, - 0x2d, 0xc9, 0xd0, 0x3a, 0x4a, 0xca, 0x5b, 0x32, 0x99, 0x07, 0xc4, 0x76, 0xdc, 0xfd, 0x82, 0xfb, - 0x67, 0x1c, 0xcc, 0x79, 0xc0, 0xec, 0x00, 0x5c, 0x4d, 0x5e, 0xce, 0xd3, 0xe4, 0xbd, 0x01, 0xf3, - 0x56, 0xd6, 0x47, 0xb5, 0xdd, 0x90, 0xba, 0x58, 0x27, 0xc5, 0x5d, 0xa6, 0xb7, 0xa7, 0x3b, 0xf2, - 0x53, 0x56, 0x00, 0xdf, 0xc5, 0xba, 0xc5, 0xf8, 0x39, 0x94, 0x38, 0x85, 0x1f, 0x24, 0x68, 0x6c, - 0x31, 0x72, 0x6e, 0x32, 0xd0, 0xcf, 0x04, 0x93, 0x97, 0xe4, 0x08, 0xc9, 0x4b, 0x84, 0x97, 0x4a, - 0x8d, 0x14, 0xd0, 0x8e, 0x7c, 0x2f, 0x0b, 0x05, 0x1a, 0xc7, 0x9c, 0x20, 0xaf, 0x58, 0xff, 0x27, - 0x07, 0x93, 0x95, 0x16, 0x56, 0x4d, 0xcb, 0x1e, 0x6a, 0x30, 0xe3, 0x79, 0x58, 0x8f, 0x96, 0x23, - 0xde, 0xdb, 0x93, 0x1d, 0xe7, 0x57, 0x62, 0x5f, 0xe3, 0x0b, 0x63, 0xe8, 0xc0, 0xf5, 0x4f, 0x01, - 0x9e, 0xca, 0xf9, 0x4b, 0x01, 0xca, 0x10, 0xd7, 0xc0, 0x5f, 0x1a, 0x80, 0xe5, 0xcc, 0xf3, 0x26, - 0xa4, 0xc9, 0x13, 0x6a, 0x34, 0xef, 0x3c, 0xe3, 0x76, 0xbd, 0xb0, 0xe6, 0x17, 0x7c, 0x50, 0x9b, - 0x6e, 0xfd, 0x0f, 0x53, 0x00, 0xfd, 0xf4, 0x0c, 0xdd, 0x85, 0x69, 0xf7, 0x2b, 0x4e, 0xb4, 0x14, - 0xf3, 0x86, 0x98, 0x5f, 0x0e, 0x1f, 0x74, 0x64, 0xba, 0x0b, 0xd3, 0xee, 0x37, 0x43, 0x7d, 0x66, - 0x21, 0xef, 0x96, 0xfa, 0xcc, 0x42, 0x9f, 0x19, 0x8d, 0xa1, 0x36, 0x9c, 0x89, 0x78, 0x35, 0x82, - 0x2e, 0x0f, 0xf7, 0xb6, 0x86, 0x7f, 0x79, 0xc8, 0xe7, 0x27, 0xc2, 0x18, 0xd2, 0xe1, 0x6c, 0xe4, - 0x63, 0x09, 0xb4, 0x36, 0xec, 0x53, 0x0e, 0xfe, 0xca, 0x10, 0x98, 0xce, 0x9c, 0x3d, 0xe0, 0xa3, - 0x3b, 0xb4, 0xe8, 0xca, 0xd0, 0x4f, 0x07, 0xf8, 0xab, 0xc3, 0x37, 0x7c, 0x85, 0x31, 0xb4, 0x0d, - 0x19, 0x57, 0xab, 0x0e, 0xf1, 0xa1, 0xfd, 0x3b, 0xca, 0x78, 0x29, 0xa6, 0xb7, 0x47, 0x39, 0xb9, - 0xda, 0x27, 0x7d, 0x4e, 0xc1, 0x3e, 0x50, 0x9f, 0x53, 0x48, 0xbf, 0xc5, 0xbf, 0xfd, 0xbe, 0x7b, - 0x31, 0x6c, 0xfb, 0xc3, 0x2f, 0xd6, 0xb0, 0xed, 0x8f, 0xb8, 0x64, 0x85, 0x31, 0xf4, 0x01, 0xcc, - 0x7a, 0x2b, 0xbb, 0x68, 0x25, 0xb6, 0x42, 0xcd, 0x9f, 0x8b, 0x1a, 0x76, 0xb3, 0xf4, 0x16, 0x12, - 0xfb, 0x2c, 0x43, 0x0b, 0x9a, 0x7d, 0x96, 0x11, 0xf5, 0xc7, 0x31, 0xcb, 0x3f, 0x79, 0xca, 0x63, - 0x7d, 0xff, 0x14, 0x56, 0xd5, 0xeb, 0xfb, 0xa7, 0xd0, 0x9a, 0x9a, 0x30, 0x86, 0x14, 0x58, 0x0c, - 0xaf, 0xce, 0xa0, 0x4b, 0x43, 0x15, 0x9f, 0xf8, 0xcb, 0x83, 0xd0, 0x9c, 0xa9, 0x9a, 0x30, 0x17, - 0xd2, 0x49, 0x45, 0x42, 0x6c, 0x9b, 0x95, 0x4e, 0x72, 0x71, 0x88, 0x56, 0xac, 0x60, 0xdd, 0xf0, - 0xeb, 0x7f, 0x4d, 0x43, 0x8a, 0x5c, 0xb5, 0x0d, 0x38, 0xe5, 0x4b, 0xc1, 0xd1, 0xb9, 0xf8, 0xc2, - 0x04, 0x7f, 0x3e, 0x72, 0xdc, 0x59, 0xc3, 0x23, 0x38, 0x1d, 0x48, 0xaa, 0xd1, 0xaa, 0x9b, 0x2e, - 0x2c, 0xb1, 0xe7, 0x2f, 0xc4, 0x60, 0xf8, 0x79, 0x7b, 0x7d, 0xdb, 0xea, 0xa0, 0xac, 0xcf, 0xcb, - 0x3b, 0xca, 0x9f, 0x7d, 0x4c, 0x23, 0x1b, 0xbf, 0x27, 0x13, 0xbc, 0x72, 0x85, 0xfa, 0xb0, 0x8b, - 0xb1, 0x38, 0xce, 0x0c, 0x1f, 0x39, 0x21, 0x95, 0x2b, 0xe9, 0x40, 0x1e, 0xe1, 0x42, 0x93, 0x23, - 0x5e, 0x88, 0x43, 0x71, 0xd8, 0x3f, 0x80, 0xac, 0xff, 0x9e, 0x47, 0x9e, 0xf3, 0x0a, 0xd3, 0xcd, - 0xd5, 0x68, 0x04, 0xff, 0xce, 0xf8, 0x9d, 0x8c, 0x5f, 0xaa, 0x30, 0xf7, 0x72, 0x31, 0x16, 0xc7, - 0xed, 0x16, 0x5d, 0x51, 0x65, 0xdf, 0x2d, 0x06, 0x23, 0xd0, 0xbe, 0x5b, 0x0c, 0x09, 0x43, 0x85, - 0xb1, 0x8d, 0xdb, 0x00, 0x72, 0xbb, 0xfb, 0x58, 0x96, 0xb0, 0xda, 0xeb, 0xa0, 0xe5, 0x40, 0xd3, - 0xa6, 0xac, 0xf6, 0x3a, 0x3b, 0x5d, 0x2b, 0x59, 0x31, 0x72, 0xbf, 0x98, 0x24, 0x29, 0xca, 0x14, - 0x21, 0xb0, 0x06, 0x36, 0xaa, 0x90, 0xed, 0x53, 0x4b, 0x24, 0xa7, 0x46, 0x17, 0x42, 0x79, 0x90, - 0xff, 0xac, 0xf2, 0x31, 0x9a, 0x75, 0x18, 0x91, 0xd1, 0x8d, 0xb7, 0x01, 0x9a, 0x86, 0x22, 0xd1, - 0xaa, 0x05, 0x5a, 0x09, 0xf0, 0xb9, 0xa3, 0xe0, 0x76, 0xcb, 0xe6, 0xf1, 0x73, 0x26, 0x4c, 0xd3, - 0x50, 0x68, 0xf1, 0x60, 0xe3, 0x5d, 0xc8, 0x50, 0x61, 0x0e, 0x2c, 0xbc, 0x41, 0xf4, 0x4c, 0x06, - 0xba, 0x7a, 0x32, 0xb2, 0x51, 0x86, 0x19, 0xca, 0x80, 0x25, 0x5a, 0xe8, 0x7c, 0x80, 0xc5, 0x3d, - 0x3a, 0xe2, 0x63, 0x32, 0x4d, 0xc8, 0xd8, 0xd8, 0x46, 0x11, 0xa6, 0x6d, 0x36, 0xe6, 0x63, 0xad, - 0x85, 0xce, 0x85, 0x70, 0xb1, 0x06, 0x7c, 0x4c, 0x32, 0x8c, 0x89, 0x35, 0xd4, 0x17, 0xc5, 0xfe, - 0xef, 0xc2, 0xa0, 0x28, 0x2c, 0x19, 0x0a, 0x15, 0x85, 0x8d, 0x15, 0xd3, 0x8f, 0x92, 0x4d, 0x43, - 0xd9, 0x1f, 0x27, 0x44, 0xaf, 0xff, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x60, 0x93, 0x14, 0xd0, 0x0a, - 0x3b, 0x00, 0x00, + // 3797 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x3b, 0x4b, 0x6c, 0x1b, 0x49, + 0x76, 0x6a, 0xfe, 0x24, 0x3d, 0x4a, 0x32, 0x5d, 0xfa, 0x98, 0x6e, 0x49, 0x96, 0xdc, 0x1e, 0x7b, + 0x65, 0x8f, 0x4d, 0xaf, 0xb5, 0x63, 0x23, 0x23, 0x7b, 0x76, 0x87, 0xa4, 0x68, 0x89, 0x6b, 0x8a, + 0xd4, 0x34, 0x29, 0x7b, 0xed, 0x64, 0xd0, 0xd3, 0x22, 0x4b, 0x74, 0x63, 0xc8, 0x6e, 0x4e, 0x77, + 0x53, 0x91, 0xe6, 0x92, 0x20, 0x41, 0x0e, 0x41, 0x2e, 0xb9, 0xed, 0xe4, 0xb6, 0x48, 0xf6, 0x98, + 0xc5, 0x22, 0x08, 0x82, 0x1c, 0x03, 0xe4, 0x18, 0x20, 0x9b, 0xdc, 0x12, 0xe4, 0xb2, 0xb7, 0x20, + 0x58, 0x24, 0xc0, 0x5c, 0x72, 0xc9, 0x21, 0x08, 0xba, 0xaa, 0xba, 0xd9, 0x5f, 0x7e, 0x2c, 0x19, + 0x73, 0xc8, 0x49, 0xec, 0x57, 0xef, 0xbd, 0x7a, 0x55, 0xf5, 0xde, 0xab, 0xf7, 0x29, 0xc1, 0xe3, + 0xb6, 0x62, 0xbe, 0xed, 0x1f, 0xe7, 0x9a, 0x5a, 0xf7, 0x61, 0x53, 0x53, 0x4d, 0x59, 0x51, 0xb1, + 0xfe, 0xc0, 0x30, 0x35, 0x5d, 0x6e, 0xe3, 0x07, 0x8a, 0x6a, 0x62, 0xfd, 0x44, 0x6e, 0xe2, 0x87, + 0x46, 0x0f, 0x37, 0x1f, 0x36, 0x0d, 0x25, 0xd7, 0xd3, 0x35, 0x53, 0x43, 0x29, 0xeb, 0xe7, 0xe9, + 0x23, 0x7e, 0xb3, 0xad, 0x69, 0xed, 0x0e, 0x7e, 0x48, 0xa0, 0xc7, 0xfd, 0x93, 0x87, 0x2d, 0x6c, + 0x34, 0x75, 0xa5, 0x67, 0x6a, 0x3a, 0xc5, 0xe4, 0x37, 0xfc, 0x18, 0xa6, 0xd2, 0xc5, 0x86, 0x29, + 0x77, 0x7b, 0x0c, 0xe1, 0x86, 0x1f, 0xe1, 0x77, 0x75, 0xb9, 0xd7, 0xc3, 0xba, 0x41, 0xc7, 0x85, + 0x15, 0x58, 0xda, 0xc3, 0xe6, 0x61, 0xa7, 0xdf, 0x56, 0xd4, 0xb2, 0x7a, 0xa2, 0x89, 0xf8, 0xab, + 0x3e, 0x36, 0x4c, 0xe1, 0x5f, 0x39, 0x58, 0xf6, 0x0d, 0x18, 0x3d, 0x4d, 0x35, 0x30, 0x42, 0x90, + 0x50, 0xe5, 0x2e, 0xce, 0x72, 0x9b, 0xdc, 0xd6, 0xac, 0x48, 0x7e, 0xa3, 0xdb, 0xb0, 0x70, 0x8a, + 0xd5, 0x96, 0xa6, 0x4b, 0xa7, 0x58, 0x37, 0x14, 0x4d, 0xcd, 0xc6, 0xc8, 0xe8, 0x3c, 0x85, 0xbe, + 0xa4, 0x40, 0xb4, 0x07, 0x33, 0x5d, 0x59, 0x55, 0x4e, 0xb0, 0x61, 0x66, 0xe3, 0x9b, 0xf1, 0xad, + 0xf4, 0xf6, 0x87, 0x39, 0xba, 0xd4, 0x5c, 0xe8, 0x5c, 0xb9, 0x03, 0x86, 0x5d, 0x52, 0x4d, 0xfd, + 0x5c, 0x74, 0x88, 0xf9, 0xa7, 0x30, 0xef, 0x19, 0x42, 0x19, 0x88, 0x7f, 0x89, 0xcf, 0x99, 0x4c, + 0xd6, 0x4f, 0xb4, 0x04, 0xc9, 0x53, 0xb9, 0xd3, 0xc7, 0x4c, 0x12, 0xfa, 0xb1, 0x13, 0xfb, 0x2d, + 0x4e, 0xb8, 0x01, 0x6b, 0xce, 0x6c, 0x45, 0xb9, 0x27, 0x1f, 0x2b, 0x1d, 0xc5, 0x54, 0xb0, 0x61, + 0x2f, 0xfd, 0x73, 0x58, 0x8f, 0x18, 0x67, 0x3b, 0xf0, 0x0c, 0xe6, 0x9a, 0x2e, 0x78, 0x96, 0x23, + 0x4b, 0xc9, 0xda, 0x4b, 0xf1, 0x51, 0x9e, 0x8b, 0x1e, 0x6c, 0xe1, 0x57, 0x71, 0xc8, 0xf8, 0x51, + 0xd0, 0x33, 0x98, 0x36, 0xb0, 0x7e, 0xaa, 0x34, 0xe9, 0xbe, 0xa6, 0xb7, 0x37, 0xa3, 0xb8, 0xe5, + 0xea, 0x14, 0x6f, 0x7f, 0x4a, 0xb4, 0x49, 0xd0, 0x11, 0x64, 0x4e, 0xb5, 0x4e, 0xbf, 0x8b, 0x25, + 0x7c, 0xd6, 0x93, 0x55, 0xe7, 0x00, 0xd2, 0xdb, 0x5b, 0x91, 0x6c, 0x5e, 0x12, 0x82, 0x92, 0x8d, + 0xbf, 0x3f, 0x25, 0x5e, 0x39, 0xf5, 0x82, 0xf8, 0x9f, 0x72, 0x30, 0xcd, 0x66, 0x43, 0x1f, 0x43, + 0xc2, 0x3c, 0xef, 0x51, 0xe9, 0x16, 0xb6, 0x6f, 0x8f, 0x92, 0x2e, 0xd7, 0x38, 0xef, 0x61, 0x91, + 0x90, 0x08, 0x9f, 0x41, 0xc2, 0xfa, 0x42, 0x69, 0x98, 0x3e, 0xaa, 0xbe, 0xa8, 0xd6, 0x5e, 0x55, + 0x33, 0x53, 0x68, 0x05, 0x50, 0xb1, 0x56, 0x6d, 0x88, 0xb5, 0x4a, 0xa5, 0x24, 0x4a, 0xf5, 0x92, + 0xf8, 0xb2, 0x5c, 0x2c, 0x65, 0x38, 0xf4, 0x01, 0x6c, 0xbe, 0xac, 0x55, 0x8e, 0x0e, 0x4a, 0x52, + 0xbe, 0x58, 0x2c, 0xd5, 0xeb, 0xe5, 0x42, 0xb9, 0x52, 0x6e, 0xbc, 0x96, 0x8a, 0xb5, 0x6a, 0xbd, + 0x21, 0xe6, 0xcb, 0xd5, 0x46, 0x3d, 0x13, 0xe3, 0xff, 0x80, 0x83, 0x2b, 0xbe, 0x05, 0xa0, 0xbc, + 0x47, 0xc2, 0x07, 0xe3, 0x2e, 0xdc, 0x2d, 0xe9, 0xfd, 0x30, 0x49, 0x01, 0x52, 0xb5, 0x6a, 0xa5, + 0x5c, 0xb5, 0xa4, 0x4b, 0xc3, 0x74, 0xed, 0xf9, 0x73, 0xf2, 0x11, 0x2b, 0xa4, 0xe8, 0x84, 0xc2, + 0x02, 0xcc, 0x1d, 0xea, 0xda, 0x31, 0xb6, 0xf5, 0x27, 0x0f, 0xf3, 0xec, 0x9b, 0xe9, 0xcb, 0xf7, + 0x21, 0xa9, 0x63, 0xb9, 0x75, 0xce, 0x8e, 0x96, 0xcf, 0x51, 0x9b, 0xcc, 0xd9, 0x36, 0x99, 0x2b, + 0x68, 0x5a, 0xe7, 0xa5, 0xa5, 0x9f, 0x22, 0x45, 0x14, 0xbe, 0x4d, 0xc0, 0x62, 0x51, 0xc7, 0xb2, + 0x89, 0xa9, 0xb4, 0x8c, 0x75, 0xa8, 0xed, 0x3d, 0x83, 0x05, 0x4b, 0xbf, 0x9a, 0x8a, 0x79, 0x2e, + 0xe9, 0xb2, 0xda, 0xc6, 0xec, 0xe8, 0x97, 0xed, 0x1d, 0x28, 0xb2, 0x51, 0xd1, 0x1a, 0x14, 0xe7, + 0x9b, 0xee, 0x4f, 0x54, 0x86, 0x45, 0xa6, 0x3a, 0x1e, 0x95, 0x8e, 0x7b, 0x55, 0x9a, 0x4a, 0xe1, + 0x52, 0x69, 0x74, 0xea, 0x85, 0x28, 0xd8, 0x40, 0x2f, 0x00, 0x7a, 0xb2, 0x2e, 0x77, 0xb1, 0x89, + 0x75, 0x23, 0x9b, 0xf0, 0xda, 0x77, 0xc8, 0x6a, 0x72, 0x87, 0x0e, 0x36, 0xb5, 0x6f, 0x17, 0x39, + 0xda, 0xb3, 0x0c, 0xa2, 0xa9, 0x63, 0xd3, 0xc8, 0x26, 0x09, 0xa7, 0xad, 0x61, 0x9c, 0xea, 0x14, + 0x95, 0xb0, 0x29, 0xc4, 0xbf, 0x29, 0x70, 0xa2, 0x4d, 0x8d, 0x6a, 0xb0, 0x6c, 0x2f, 0x50, 0x53, + 0x4d, 0xac, 0x9a, 0x92, 0xa1, 0xf5, 0xf5, 0x26, 0xce, 0xa6, 0xc8, 0x2e, 0xad, 0xfa, 0x96, 0x48, + 0x71, 0xea, 0x04, 0x45, 0x64, 0x5b, 0xe3, 0x01, 0xa2, 0x37, 0xc0, 0xcb, 0xcd, 0x26, 0x36, 0x0c, + 0x85, 0xee, 0x85, 0xa4, 0xe3, 0xaf, 0xfa, 0x8a, 0x8e, 0xbb, 0x58, 0x35, 0x8d, 0xec, 0xb4, 0x97, + 0x6b, 0x43, 0xeb, 0x69, 0x1d, 0xad, 0x7d, 0x2e, 0x0e, 0x70, 0xc4, 0xeb, 0x1e, 0x72, 0xd7, 0x88, + 0xc1, 0x7f, 0x02, 0x57, 0x7c, 0x9b, 0x32, 0x89, 0x67, 0xe3, 0x77, 0x60, 0xce, 0xbd, 0x13, 0x13, + 0x79, 0xc5, 0x3f, 0x89, 0xc1, 0x62, 0xc8, 0x1e, 0xa0, 0x7d, 0x98, 0x31, 0x54, 0xb9, 0x67, 0xbc, + 0xd5, 0x4c, 0xa6, 0xbf, 0xf7, 0x86, 0x6c, 0x59, 0xae, 0xce, 0x70, 0xe9, 0xe7, 0xfe, 0x94, 0xe8, + 0x50, 0xa3, 0x02, 0xa4, 0xe8, 0x7e, 0xfa, 0x7d, 0x53, 0x18, 0x1f, 0x0a, 0x73, 0xb8, 0x30, 0x4a, + 0xfe, 0x11, 0x2c, 0x78, 0x67, 0x40, 0x1b, 0x90, 0xb6, 0x67, 0x90, 0x94, 0x16, 0x5b, 0x2b, 0xd8, + 0xa0, 0x72, 0x8b, 0xff, 0x10, 0xe6, 0xdc, 0xcc, 0xd0, 0x2a, 0xcc, 0x32, 0x85, 0x70, 0xd0, 0x67, + 0x28, 0xa0, 0xdc, 0x72, 0x6c, 0xfa, 0x87, 0xb0, 0xe4, 0xd5, 0x33, 0x66, 0xca, 0x77, 0x9c, 0x35, + 0xd0, 0xbd, 0x58, 0xf0, 0xae, 0xc1, 0x96, 0x53, 0xf8, 0x79, 0x12, 0x32, 0x7e, 0xa3, 0x41, 0xcf, + 0x20, 0x79, 0xdc, 0xd1, 0x9a, 0x5f, 0x32, 0xda, 0x0f, 0xa2, 0xac, 0x2b, 0x57, 0xb0, 0xb0, 0x28, + 0x74, 0x7f, 0x4a, 0xa4, 0x44, 0x16, 0x75, 0x57, 0xeb, 0xab, 0x26, 0xdb, 0xbd, 0x68, 0xea, 0x03, + 0x0b, 0x6b, 0x40, 0x4d, 0x88, 0xd0, 0x2e, 0xa4, 0xa9, 0xda, 0x49, 0x5d, 0xad, 0x85, 0xb3, 0x71, + 0xc2, 0xe3, 0x56, 0x24, 0x8f, 0x3c, 0xc1, 0x3d, 0xd0, 0x5a, 0x58, 0x04, 0xd9, 0xf9, 0xcd, 0xcf, + 0x43, 0xda, 0x25, 0x1b, 0xff, 0x35, 0xa4, 0x5d, 0x93, 0xa1, 0x6b, 0x30, 0x7d, 0x62, 0x48, 0x8e, + 0x13, 0x9e, 0x15, 0x53, 0x27, 0x06, 0xf1, 0xa7, 0x1b, 0x90, 0x26, 0x52, 0x48, 0x27, 0x1d, 0xb9, + 0x6d, 0x64, 0x63, 0x9b, 0x71, 0xeb, 0x8c, 0x08, 0xe8, 0xb9, 0x05, 0x41, 0x8f, 0x80, 0x39, 0x14, + 0x89, 0xe2, 0xb5, 0x75, 0xad, 0xdf, 0x23, 0x42, 0xce, 0x16, 0xe2, 0x3f, 0x2b, 0x70, 0x22, 0xbb, + 0xdf, 0xc8, 0x6c, 0x7b, 0xd6, 0x20, 0xff, 0xd7, 0x31, 0x80, 0x81, 0x94, 0xe8, 0x19, 0x24, 0xc8, + 0xc2, 0xa8, 0xf7, 0xdf, 0x1a, 0x63, 0x61, 0x39, 0xb2, 0x3a, 0x42, 0x25, 0xfc, 0x3b, 0x07, 0x09, + 0xc2, 0xc6, 0x7f, 0x47, 0xd5, 0xcb, 0xd5, 0xbd, 0x4a, 0x49, 0xaa, 0xd6, 0x76, 0x4b, 0xd2, 0x2b, + 0xb1, 0xdc, 0x28, 0x89, 0x19, 0x0e, 0xad, 0xc2, 0x35, 0x37, 0x5c, 0x2c, 0xe5, 0x77, 0x4b, 0xa2, + 0x54, 0xab, 0x56, 0x5e, 0x67, 0x62, 0x88, 0x87, 0x95, 0x83, 0xa3, 0x4a, 0xa3, 0x1c, 0x1c, 0x8b, + 0xa3, 0x35, 0xc8, 0xba, 0xc6, 0x18, 0x0f, 0xc6, 0x36, 0x61, 0xb1, 0x75, 0x8d, 0xd2, 0x9f, 0x6c, + 0x30, 0x89, 0x04, 0xb8, 0xee, 0x9e, 0xd3, 0x4b, 0x9b, 0xe2, 0xad, 0x4d, 0x42, 0x37, 0x21, 0xeb, + 0xc6, 0xf1, 0x70, 0x98, 0x26, 0x28, 0x85, 0x79, 0x47, 0x0d, 0x88, 0x9a, 0xbf, 0x82, 0x79, 0xcf, + 0xed, 0x60, 0x05, 0x72, 0xcc, 0x9d, 0xb5, 0xa4, 0xe3, 0x73, 0x93, 0x04, 0x37, 0xdc, 0x56, 0x5c, + 0x9c, 0xb7, 0xa1, 0x05, 0x0b, 0x68, 0x1d, 0x68, 0x47, 0xe9, 0x2a, 0x26, 0xc3, 0x89, 0x11, 0x1c, + 0x20, 0x20, 0x82, 0x20, 0xfc, 0x3a, 0x06, 0x29, 0xa6, 0x15, 0xb7, 0x5d, 0xf7, 0x93, 0x87, 0xa5, + 0x0d, 0xa5, 0x2c, 0x3d, 0x66, 0x19, 0xf3, 0x9a, 0x25, 0xda, 0x87, 0x05, 0xb7, 0x13, 0x3f, 0xb3, + 0xc3, 0xc7, 0x9b, 0xde, 0x73, 0x76, 0x7b, 0x92, 0x33, 0x16, 0x34, 0xce, 0x9f, 0xba, 0x61, 0xa8, + 0x00, 0x0b, 0xbe, 0x7b, 0x20, 0x31, 0xfa, 0x1e, 0x98, 0x6f, 0x7a, 0x5c, 0x62, 0x1e, 0x16, 0x6d, + 0x17, 0xde, 0xc1, 0x92, 0xc9, 0x5c, 0x3c, 0xbb, 0xa7, 0x32, 0x01, 0xd7, 0x8f, 0x06, 0xc8, 0x36, + 0x8c, 0xff, 0x14, 0x50, 0x50, 0xd6, 0x89, 0xfc, 0x75, 0x1f, 0x16, 0x43, 0x2e, 0x17, 0x94, 0x83, + 0x59, 0x72, 0x54, 0x86, 0x62, 0x62, 0x16, 0x98, 0x06, 0x25, 0x1a, 0xa0, 0x58, 0xf8, 0x3d, 0x1d, + 0x9f, 0x60, 0x5d, 0xc7, 0x2d, 0x62, 0x98, 0xa1, 0xf8, 0x0e, 0x8a, 0xf0, 0x87, 0x1c, 0xcc, 0xd8, + 0x70, 0xb4, 0x03, 0x33, 0x06, 0x6e, 0xd3, 0x8b, 0x8f, 0xce, 0x75, 0xc3, 0x4f, 0x9b, 0xab, 0x33, + 0x04, 0x16, 0xc2, 0xdb, 0xf8, 0x56, 0x08, 0xef, 0x19, 0x9a, 0x68, 0xf1, 0x7f, 0xcb, 0xc1, 0xe2, + 0x2e, 0xee, 0x60, 0x7f, 0x7c, 0x34, 0xcc, 0xb7, 0xbb, 0x43, 0x8a, 0x98, 0x37, 0xa4, 0x08, 0x61, + 0x35, 0x24, 0xa4, 0xb8, 0xd0, 0x35, 0xbb, 0x02, 0x4b, 0xde, 0xd9, 0xe8, 0xc5, 0x22, 0xfc, 0x57, + 0x1c, 0x6e, 0x58, 0xba, 0xa0, 0x6b, 0x9d, 0x0e, 0xd6, 0x0f, 0xfb, 0xc7, 0x1d, 0xc5, 0x78, 0x3b, + 0xc1, 0xe2, 0xae, 0xc1, 0xb4, 0xaa, 0xb5, 0x5c, 0xc6, 0x93, 0xb2, 0x3e, 0xcb, 0x2d, 0x54, 0x82, + 0xab, 0xfe, 0x00, 0xef, 0x9c, 0xb9, 0xff, 0xe8, 0xf0, 0x2e, 0x73, 0xea, 0xbf, 0xbb, 0x78, 0x98, + 0xb1, 0x42, 0x53, 0x4d, 0xed, 0x9c, 0x13, 0x8b, 0x99, 0x11, 0x9d, 0x6f, 0x24, 0xfa, 0x63, 0xb5, + 0x1f, 0x38, 0xb1, 0xda, 0xd0, 0x15, 0x0d, 0x0b, 0xdb, 0xbe, 0x08, 0x58, 0x7c, 0x8a, 0xb0, 0xfe, + 0x78, 0x4c, 0xd6, 0x23, 0x3d, 0xc1, 0x45, 0x4e, 0xf1, 0x12, 0xcc, 0xf7, 0x1f, 0x38, 0xd8, 0x88, + 0x5c, 0x02, 0x0b, 0x36, 0x5a, 0x70, 0xa5, 0x47, 0x07, 0x9c, 0x4d, 0xa0, 0x56, 0xf6, 0x74, 0xe4, + 0x26, 0xb0, 0xfc, 0x99, 0x41, 0x3d, 0xdb, 0xb0, 0xd0, 0xf3, 0x00, 0xf9, 0x3c, 0x2c, 0x86, 0xa0, + 0x4d, 0xb4, 0x98, 0xdf, 0x70, 0xb0, 0x39, 0x10, 0xe5, 0x48, 0xed, 0x5d, 0x9e, 0xfa, 0x36, 0x06, + 0xba, 0x45, 0x5d, 0xfe, 0xe3, 0xe0, 0xda, 0xc3, 0x27, 0x7c, 0x5f, 0x16, 0x7c, 0x0b, 0x6e, 0x0e, + 0x99, 0x9a, 0x99, 0xf3, 0xaf, 0x13, 0x70, 0xf3, 0xa5, 0xdc, 0x51, 0x5a, 0x4e, 0x08, 0x19, 0x52, + 0x69, 0x18, 0xbe, 0x25, 0xcd, 0x80, 0x05, 0x50, 0xaf, 0xf5, 0xcc, 0xb1, 0xda, 0x51, 0xfc, 0xc7, + 0xb8, 0x0e, 0x2f, 0x31, 0xfd, 0x7b, 0x1d, 0x92, 0xfe, 0x7d, 0x3c, 0xbe, 0xac, 0xc3, 0x92, 0xc1, + 0x23, 0xbf, 0x83, 0x79, 0x32, 0x3e, 0xdf, 0x21, 0x5a, 0x70, 0x61, 0x2b, 0xfe, 0x2e, 0xf3, 0xb5, + 0xbf, 0x4f, 0x80, 0x30, 0x6c, 0xf5, 0xcc, 0x87, 0x88, 0x30, 0xdb, 0xd4, 0xd4, 0x13, 0x45, 0xef, + 0xe2, 0x16, 0xcb, 0x3b, 0x3e, 0x1a, 0x67, 0xf3, 0x98, 0x03, 0x29, 0xda, 0xb4, 0xe2, 0x80, 0x0d, + 0xca, 0xc2, 0x74, 0x17, 0x1b, 0x86, 0xdc, 0xb6, 0xc5, 0xb2, 0x3f, 0xf9, 0x5f, 0xc4, 0x61, 0xd6, + 0x21, 0x41, 0x6a, 0x40, 0x83, 0xa9, 0xfb, 0xda, 0x7b, 0x17, 0x01, 0xde, 0x5d, 0x99, 0x63, 0xef, + 0xa0, 0xcc, 0x2d, 0x8f, 0x32, 0x53, 0x73, 0xd8, 0x7d, 0x27, 0xb1, 0x87, 0xe8, 0xf5, 0x77, 0xae, + 0x80, 0xc2, 0xef, 0x00, 0xaa, 0x28, 0x06, 0xcb, 0xdf, 0x1c, 0xb7, 0x64, 0xa5, 0x6b, 0xf2, 0x99, + 0x84, 0x55, 0x53, 0x57, 0x58, 0xb8, 0x9e, 0x14, 0xa1, 0x2b, 0x9f, 0x95, 0x28, 0xc4, 0x0a, 0xe9, + 0x0d, 0x53, 0xd6, 0x4d, 0x45, 0x6d, 0x4b, 0xa6, 0xf6, 0x25, 0x76, 0xca, 0xbd, 0x36, 0xb4, 0x61, + 0x01, 0x85, 0xff, 0x8c, 0xc1, 0xa2, 0x87, 0x3d, 0xd3, 0xc9, 0xa7, 0x30, 0x3d, 0xe0, 0xed, 0x09, + 0xe3, 0x43, 0xb0, 0x73, 0x74, 0xdb, 0x6c, 0x0a, 0xb4, 0x0e, 0xa0, 0xe2, 0x33, 0xd3, 0x33, 0xef, + 0xac, 0x05, 0x21, 0x73, 0xf2, 0x7f, 0xc4, 0x39, 0xe9, 0xbe, 0x29, 0x9b, 0x7d, 0x03, 0xdd, 0x07, + 0xc4, 0x5c, 0x34, 0x6e, 0x49, 0xec, 0x8e, 0xa1, 0xf3, 0xce, 0x8a, 0x19, 0x67, 0xa4, 0x4a, 0x6e, + 0x1b, 0x03, 0xed, 0x39, 0x95, 0xd4, 0xa6, 0xa6, 0xb6, 0x14, 0x73, 0x50, 0x49, 0xbd, 0x16, 0x48, + 0x10, 0xe8, 0x30, 0xcd, 0x4f, 0xaf, 0x9c, 0x7a, 0xa1, 0xfc, 0x57, 0x90, 0xa4, 0xc7, 0x31, 0x66, + 0xc5, 0x00, 0x7d, 0x0a, 0x29, 0x83, 0x48, 0xec, 0xaf, 0x8e, 0x84, 0xed, 0x89, 0x7b, 0x85, 0x22, + 0xa3, 0x13, 0x7e, 0x08, 0xfc, 0xe0, 0x62, 0xda, 0xc3, 0xe6, 0xf8, 0xd7, 0xef, 0x8e, 0xb5, 0x06, + 0xe1, 0xa7, 0x31, 0x58, 0x0d, 0x65, 0x30, 0x59, 0xed, 0x03, 0xed, 0xfb, 0x56, 0xf2, 0xfd, 0xe0, + 0x8d, 0x1d, 0x60, 0x1e, 0xba, 0x22, 0xfe, 0xf7, 0x2f, 0x76, 0x98, 0x85, 0x89, 0x0f, 0x33, 0x70, + 0x8e, 0x74, 0x67, 0x7e, 0x11, 0x03, 0xb4, 0x87, 0x4d, 0x27, 0x55, 0x66, 0x5b, 0x1a, 0xe1, 0x6f, + 0xb8, 0x77, 0xf0, 0x37, 0x3f, 0xf6, 0xf8, 0x1b, 0xea, 0xb1, 0xee, 0xb9, 0x7a, 0x23, 0xbe, 0xa9, + 0x87, 0xde, 0x96, 0x11, 0xe9, 0x29, 0x8d, 0xf9, 0xc7, 0x4b, 0x4f, 0x2f, 0xe8, 0x56, 0xfe, 0x83, + 0x83, 0x45, 0x8f, 0xd0, 0x4c, 0x83, 0x1e, 0x00, 0x92, 0x4f, 0x65, 0xa5, 0x23, 0x5b, 0x82, 0xd9, + 0xe9, 0x3f, 0x2b, 0x07, 0x5c, 0x75, 0x46, 0x6c, 0x32, 0x74, 0x08, 0x8b, 0x5d, 0xf9, 0x4c, 0xe9, + 0xf6, 0xbb, 0x12, 0xdb, 0x67, 0x43, 0xf9, 0xda, 0xae, 0x1e, 0xae, 0x06, 0xaa, 0xe8, 0x65, 0xd5, + 0x7c, 0xf2, 0x11, 0x29, 0xa3, 0x53, 0x9b, 0xbc, 0xca, 0x88, 0x99, 0x06, 0x29, 0x5f, 0x63, 0xc2, + 0x51, 0x51, 0x03, 0x1c, 0xe3, 0x63, 0x73, 0xa4, 0xc4, 0x03, 0x8e, 0x82, 0xe0, 0x8e, 0x7c, 0xd9, + 0x9a, 0xfd, 0x0d, 0xa5, 0x8e, 0x3b, 0x62, 0x0c, 0xe0, 0xb0, 0xbd, 0xd9, 0x0b, 0x6d, 0x2a, 0xdd, + 0x0a, 0xda, 0x0e, 0xeb, 0xb0, 0x44, 0xf6, 0x97, 0xfe, 0x37, 0xee, 0x36, 0xe3, 0x00, 0x36, 0x7a, + 0x0a, 0x71, 0xbd, 0xd7, 0x64, 0x36, 0xfc, 0xbd, 0x31, 0xf8, 0xe7, 0xc4, 0xc3, 0xe2, 0xfe, 0x94, + 0x68, 0x51, 0xf1, 0x7f, 0x16, 0x87, 0xb8, 0x78, 0x58, 0x44, 0x9f, 0x7a, 0x9a, 0x2d, 0xf7, 0xc7, + 0xe4, 0xe2, 0xee, 0xb5, 0xfc, 0x53, 0x2c, 0xac, 0xd9, 0x92, 0x85, 0xa5, 0xa2, 0x58, 0xca, 0x37, + 0x4a, 0xd2, 0x6e, 0xa9, 0x52, 0x6a, 0x94, 0x24, 0xda, 0x0c, 0xca, 0x70, 0x68, 0x0d, 0xb2, 0x87, + 0x47, 0x85, 0x4a, 0xb9, 0xbe, 0x2f, 0x1d, 0x55, 0xed, 0x5f, 0x6c, 0x34, 0x86, 0x32, 0x30, 0x57, + 0x29, 0xd7, 0x1b, 0x0c, 0x50, 0xcf, 0xc4, 0x2d, 0xc8, 0x5e, 0xa9, 0x21, 0x15, 0xf3, 0x87, 0xf9, + 0x62, 0xb9, 0xf1, 0x3a, 0x93, 0x40, 0x3c, 0xac, 0x78, 0x79, 0xd7, 0xab, 0xf9, 0xc3, 0xfa, 0x7e, + 0xad, 0x91, 0x49, 0x22, 0x04, 0x0b, 0x84, 0xde, 0x06, 0xd5, 0x33, 0x29, 0x8b, 0x43, 0xb1, 0x52, + 0xab, 0x3a, 0x32, 0x4c, 0xa3, 0x25, 0xc8, 0xd8, 0x33, 0x8b, 0xa5, 0xfc, 0x2e, 0xa9, 0xea, 0xcd, + 0xa0, 0xab, 0x30, 0x5f, 0xfa, 0xc9, 0x61, 0xbe, 0xba, 0x6b, 0x23, 0xce, 0xa2, 0x4d, 0x58, 0x73, + 0x8b, 0x23, 0x31, 0xaa, 0xd2, 0x2e, 0xa9, 0xcc, 0xd5, 0x33, 0x80, 0xae, 0x43, 0x86, 0xf5, 0xb9, + 0x8a, 0xb5, 0xea, 0x6e, 0xb9, 0x51, 0xae, 0x55, 0x33, 0x69, 0x5a, 0xc6, 0x5b, 0x04, 0xb0, 0x24, + 0x67, 0xcc, 0xe6, 0x46, 0xd7, 0xf6, 0xe6, 0x69, 0x6d, 0xcf, 0xae, 0x5d, 0xff, 0x26, 0x06, 0xcb, + 0xb4, 0x78, 0x6d, 0x97, 0xca, 0x6d, 0x87, 0xb5, 0x05, 0x19, 0x5a, 0xf4, 0x92, 0xfc, 0x57, 0xc1, + 0x02, 0x85, 0xbf, 0xb4, 0x93, 0x0f, 0xbb, 0xd1, 0x14, 0x73, 0x35, 0x9a, 0xca, 0xfe, 0x54, 0xec, + 0x9e, 0xb7, 0x25, 0xe3, 0x9b, 0x6d, 0x58, 0x76, 0x7f, 0x10, 0x92, 0x2b, 0x3c, 0x18, 0xce, 0x6d, + 0x58, 0x1c, 0x75, 0x91, 0x54, 0xfe, 0x82, 0xae, 0xee, 0x39, 0xac, 0xf8, 0xe5, 0x65, 0x06, 0x7d, + 0x3f, 0xd0, 0x38, 0x71, 0x7c, 0xaf, 0x83, 0xeb, 0x60, 0x08, 0xff, 0xc2, 0xc1, 0x8c, 0x0d, 0xb6, + 0x62, 0x1c, 0xcb, 0x2f, 0x79, 0xca, 0xa5, 0xb3, 0x16, 0xc4, 0xa9, 0xbe, 0xba, 0x5b, 0x1e, 0x31, + 0x7f, 0xcb, 0x23, 0xf4, 0x9c, 0xe3, 0xa1, 0xe7, 0xfc, 0x23, 0x98, 0x6f, 0x5a, 0xe2, 0x2b, 0x9a, + 0x2a, 0x99, 0x4a, 0xd7, 0xae, 0x86, 0x06, 0x5b, 0x94, 0x0d, 0xfb, 0x5d, 0x81, 0x38, 0x67, 0x13, + 0x58, 0x20, 0xb4, 0x09, 0x73, 0xa4, 0x65, 0x29, 0x99, 0x9a, 0xd4, 0x37, 0x70, 0x36, 0x49, 0x6a, + 0x43, 0x40, 0x60, 0x0d, 0xed, 0xc8, 0xc0, 0xc2, 0xdf, 0x71, 0xb0, 0x4c, 0x4b, 0x5e, 0x7e, 0x75, + 0x1c, 0xd5, 0xba, 0x71, 0x6b, 0x9c, 0xef, 0x4a, 0x0c, 0x65, 0xf8, 0xbe, 0x32, 0xfe, 0x2c, 0xac, + 0xf8, 0xe7, 0x63, 0x69, 0xfe, 0x2f, 0x63, 0xb0, 0x64, 0xc5, 0x67, 0xf6, 0xc0, 0x65, 0x87, 0xd0, + 0x13, 0x9c, 0xa4, 0x6f, 0x33, 0x13, 0x81, 0xcd, 0xdc, 0xf7, 0x27, 0xd1, 0x77, 0xdd, 0x11, 0xa6, + 0x7f, 0x05, 0xef, 0x6b, 0x2f, 0xff, 0x92, 0x83, 0x65, 0xdf, 0x7c, 0xcc, 0x5e, 0x3e, 0xf1, 0x67, + 0x05, 0xb7, 0x22, 0xe4, 0x7b, 0xa7, 0xbc, 0xe0, 0xb1, 0x1d, 0x8f, 0x4f, 0x66, 0x96, 0xff, 0x1c, + 0x83, 0xf5, 0xc1, 0xa5, 0x46, 0x1e, 0x0d, 0xb4, 0x26, 0x28, 0x6b, 0x5d, 0xac, 0x37, 0xff, 0x99, + 0xdf, 0xe1, 0x6e, 0x07, 0xef, 0xd9, 0x10, 0x91, 0x86, 0x39, 0xde, 0xd0, 0x6a, 0x70, 0x62, 0xd2, + 0x6a, 0xf0, 0x85, 0x34, 0xe0, 0xf7, 0xdc, 0x85, 0x6e, 0xaf, 0xf8, 0x4c, 0x13, 0xc6, 0xec, 0x18, + 0x3d, 0x81, 0x6b, 0x24, 0x05, 0x70, 0xde, 0xbc, 0xd8, 0x9d, 0x78, 0xea, 0x12, 0x67, 0xc4, 0x65, + 0x6b, 0xd8, 0x79, 0xe8, 0xc1, 0xba, 0x24, 0x2d, 0xe1, 0xdb, 0x04, 0xac, 0x58, 0x29, 0x42, 0xdd, + 0x94, 0xdb, 0x93, 0xf4, 0x0f, 0x7e, 0x3b, 0x58, 0x8e, 0x8d, 0x79, 0x8f, 0x25, 0x9c, 0xeb, 0x38, + 0x55, 0x58, 0x94, 0x83, 0x45, 0xc3, 0x94, 0xdb, 0xc4, 0x1d, 0xc8, 0x7a, 0x1b, 0x9b, 0x52, 0x4f, + 0x36, 0xdf, 0x32, 0x5b, 0xbf, 0xca, 0x86, 0x1a, 0x64, 0xe4, 0x50, 0x36, 0xdf, 0x5e, 0xd2, 0x41, + 0xa2, 0x1f, 0xfb, 0x9d, 0xc2, 0x87, 0x23, 0xd6, 0x32, 0x44, 0xb7, 0x7e, 0x12, 0x51, 0xb2, 0x7f, + 0x34, 0x82, 0xe5, 0xe8, 0x52, 0xfd, 0xc5, 0x4b, 0xd4, 0xdf, 0x71, 0xb5, 0xff, 0x3a, 0x5c, 0x0b, + 0x2c, 0x9e, 0x5d, 0x21, 0x6d, 0xc8, 0x5a, 0x43, 0x47, 0xaa, 0x31, 0xa1, 0x3a, 0x46, 0x68, 0x4c, + 0x2c, 0x42, 0x63, 0x84, 0x55, 0xb8, 0x1e, 0x32, 0x11, 0x93, 0xe2, 0x6f, 0x92, 0x54, 0x8c, 0xc9, + 0x1b, 0x4f, 0x9f, 0x47, 0x59, 0xc5, 0x47, 0xee, 0x63, 0x0f, 0xed, 0xd1, 0xbc, 0x0f, 0xbb, 0xd8, + 0x80, 0xb4, 0x1b, 0x8f, 0x5d, 0x83, 0xe6, 0x08, 0xc3, 0x49, 0x5e, 0xa8, 0x1f, 0x96, 0xf2, 0xf5, + 0xc3, 0x2a, 0x03, 0xa3, 0x9a, 0xf6, 0x86, 0xb6, 0x91, 0x5b, 0x31, 0xc4, 0xac, 0xde, 0x04, 0xcc, + 0x6a, 0xc6, 0xdb, 0x64, 0x8b, 0x64, 0xfa, 0xff, 0xc0, 0xb0, 0x98, 0x52, 0x87, 0x76, 0xbf, 0x84, + 0x37, 0xc0, 0x53, 0x8d, 0x9f, 0xbc, 0x1f, 0xe5, 0x53, 0xa3, 0x98, 0x5f, 0x8d, 0x84, 0x75, 0x58, + 0x0d, 0xe5, 0xcd, 0xa6, 0xfe, 0x63, 0x8e, 0x0a, 0xe6, 0x14, 0xba, 0xea, 0xa6, 0x6c, 0x1a, 0xe3, + 0x4e, 0xcd, 0x06, 0xdd, 0x53, 0x53, 0x10, 0xd1, 0xe0, 0x09, 0x4d, 0x42, 0xf8, 0x53, 0x8e, 0xee, + 0x83, 0x5f, 0x16, 0x76, 0xdb, 0xde, 0x85, 0x64, 0x9f, 0xd4, 0xf2, 0x69, 0xd4, 0xb5, 0xe8, 0x35, + 0x82, 0x23, 0x6b, 0x48, 0xa4, 0x18, 0x97, 0x56, 0x1d, 0x15, 0x7e, 0xc9, 0x41, 0xda, 0xc5, 0x1f, + 0xad, 0xc1, 0xac, 0x53, 0xfe, 0xb1, 0xf3, 0x1d, 0x07, 0x60, 0x1d, 0xbf, 0xa9, 0x99, 0x72, 0x87, + 0xbd, 0x33, 0xa1, 0x1f, 0x56, 0x8a, 0xda, 0x37, 0x30, 0x0d, 0x87, 0xe3, 0x22, 0xf9, 0x8d, 0xee, + 0x43, 0xa2, 0xaf, 0x2a, 0x26, 0x31, 0xfb, 0x05, 0xbf, 0x3d, 0x93, 0xa9, 0x72, 0x47, 0xaa, 0x62, + 0x8a, 0x04, 0x4b, 0xb8, 0x07, 0x09, 0xeb, 0xcb, 0x5b, 0x81, 0x98, 0x85, 0x64, 0xe1, 0x75, 0xa3, + 0x54, 0xcf, 0x70, 0x08, 0x20, 0x55, 0xa6, 0xf9, 0x7a, 0x4c, 0xa8, 0xd8, 0x0f, 0x4e, 0x9d, 0x45, + 0x58, 0x2e, 0x40, 0x3e, 0x56, 0x35, 0xbd, 0x2b, 0x77, 0x88, 0xcc, 0x33, 0xa2, 0xf3, 0x1d, 0xdd, + 0x22, 0xa1, 0x05, 0xc5, 0x35, 0xe7, 0x44, 0xc2, 0xea, 0x45, 0x5f, 0x50, 0xdd, 0x8a, 0xaa, 0x14, + 0xe5, 0x43, 0x2b, 0x45, 0xeb, 0x9e, 0x5b, 0x76, 0x44, 0x8d, 0xe8, 0x57, 0x31, 0x58, 0x0e, 0xc5, + 0x43, 0x8f, 0xdd, 0xd5, 0xa1, 0x9b, 0x43, 0x79, 0xba, 0xeb, 0x42, 0xff, 0xcd, 0xd1, 0xba, 0xd0, + 0x8e, 0xa7, 0x2e, 0x74, 0x67, 0x24, 0xbd, 0xbb, 0x22, 0xf4, 0x57, 0x5c, 0x44, 0x45, 0xa8, 0xde, + 0xc8, 0xef, 0x95, 0xa4, 0xa3, 0x2a, 0xfd, 0xeb, 0x54, 0x84, 0x96, 0x20, 0x33, 0xa8, 0x93, 0x48, + 0xf5, 0x46, 0xbe, 0x51, 0xcf, 0xc4, 0x82, 0xd5, 0x98, 0x78, 0x68, 0xad, 0x25, 0x31, 0xba, 0xac, + 0x92, 0xa4, 0x28, 0xab, 0x80, 0x18, 0xf5, 0x41, 0xed, 0xa8, 0xda, 0x90, 0xf6, 0xc4, 0xda, 0xd1, + 0x21, 0x7b, 0x72, 0xe5, 0xd4, 0x5c, 0x96, 0x00, 0xb1, 0x23, 0x73, 0x3f, 0xa2, 0xff, 0x73, 0x0e, + 0x16, 0x3d, 0x60, 0x76, 0x82, 0xae, 0x6e, 0x37, 0xe7, 0xe9, 0x76, 0x3f, 0x84, 0x25, 0x2b, 0x6d, + 0xa4, 0xe6, 0x62, 0x48, 0x3d, 0xac, 0x93, 0x2a, 0x37, 0x53, 0xfc, 0xab, 0x5d, 0xf9, 0x8c, 0x75, + 0x02, 0x0e, 0xb1, 0x6e, 0x31, 0xbe, 0x84, 0x5a, 0xaf, 0xf0, 0x4d, 0x9c, 0x06, 0x27, 0x13, 0x27, + 0x37, 0x23, 0x1d, 0x55, 0x30, 0xfb, 0x89, 0x4f, 0x90, 0xfd, 0x44, 0xb8, 0xb9, 0xc4, 0x44, 0x11, + 0xf1, 0xe4, 0x17, 0x7b, 0x75, 0x70, 0x79, 0xd3, 0xf0, 0xf5, 0xbe, 0x5b, 0x89, 0x47, 0xa6, 0x5b, + 0xa9, 0x6f, 0x0a, 0xdc, 0xcf, 0x2e, 0x2b, 0x59, 0xce, 0xd3, 0xa0, 0xec, 0x02, 0x49, 0xd2, 0xf6, + 0xff, 0x70, 0x30, 0x53, 0x6e, 0x61, 0xd5, 0xa4, 0x6b, 0x9b, 0xf7, 0xfc, 0x9f, 0x05, 0x5a, 0x8b, + 0xf8, 0xf7, 0x0b, 0xb2, 0x30, 0x7e, 0x7d, 0xe8, 0x3f, 0x67, 0x08, 0x53, 0xe8, 0xc4, 0xf5, 0x3f, + 0x22, 0x9e, 0x76, 0xc6, 0x07, 0x01, 0xca, 0x10, 0x3f, 0xc7, 0xdf, 0x1e, 0x81, 0xe5, 0xcc, 0xf3, + 0x04, 0x92, 0xe4, 0x45, 0x3d, 0x5a, 0x72, 0x5e, 0xf5, 0xbb, 0x1e, 0xdc, 0xf3, 0xcb, 0x3e, 0xa8, + 0x4d, 0xb7, 0xfd, 0x8f, 0xb3, 0x00, 0x83, 0x5c, 0x13, 0xbd, 0x80, 0x39, 0xf7, 0xa3, 0x5e, 0xb4, + 0x3a, 0xe4, 0x49, 0x39, 0xbf, 0x16, 0x3e, 0xe8, 0xc8, 0xf4, 0x02, 0xe6, 0xdc, 0x0f, 0xb9, 0x06, + 0xcc, 0x42, 0x1e, 0x93, 0x0d, 0x98, 0x85, 0xbe, 0xfd, 0x9a, 0x42, 0x1d, 0xb8, 0x16, 0xf1, 0x94, + 0x07, 0xdd, 0x19, 0xef, 0xc1, 0x13, 0xff, 0xbd, 0x31, 0xdf, 0x04, 0x09, 0x53, 0x48, 0x87, 0xeb, + 0x91, 0x2f, 0x58, 0xd0, 0xd6, 0xb8, 0xef, 0x6b, 0xf8, 0xbb, 0x63, 0x60, 0x3a, 0x73, 0xf6, 0x81, + 0x8f, 0x6e, 0x9b, 0xa3, 0xbb, 0x63, 0xbf, 0xe7, 0xe0, 0xef, 0x8d, 0xdf, 0x85, 0x17, 0xa6, 0xd0, + 0x3e, 0xa4, 0x5d, 0xfd, 0x53, 0xc4, 0x87, 0x36, 0x55, 0x29, 0xe3, 0xd5, 0x21, 0x0d, 0x57, 0xca, + 0xc9, 0xd5, 0xd2, 0x1a, 0x70, 0x0a, 0x36, 0xe7, 0x06, 0x9c, 0x42, 0x7a, 0x60, 0xfe, 0xed, 0xf7, + 0x5d, 0xf2, 0x61, 0xdb, 0x1f, 0x1e, 0x25, 0x84, 0x6d, 0x7f, 0x44, 0xc4, 0x20, 0x4c, 0xa1, 0xcf, + 0x60, 0xc1, 0x5b, 0xa6, 0x46, 0xeb, 0x43, 0xcb, 0xed, 0xfc, 0x8d, 0xa8, 0x61, 0x37, 0x4b, 0x6f, + 0x55, 0x74, 0xc0, 0x32, 0xb4, 0x3a, 0x3b, 0x60, 0x19, 0x51, 0x4c, 0x9d, 0xb2, 0xfc, 0x93, 0xa7, + 0xd6, 0x37, 0xf0, 0x4f, 0x61, 0x25, 0xca, 0x81, 0x7f, 0x0a, 0x2d, 0x10, 0x0a, 0x53, 0x48, 0x81, + 0x95, 0xf0, 0x52, 0x13, 0xba, 0x3d, 0x56, 0x25, 0x8d, 0xbf, 0x33, 0x0a, 0xcd, 0x99, 0xaa, 0x09, + 0x8b, 0x21, 0xed, 0x6d, 0x24, 0x0c, 0xed, 0x7d, 0xd3, 0x49, 0x6e, 0x8d, 0xd1, 0x1f, 0x17, 0xac, + 0x68, 0x63, 0xfb, 0xdf, 0x92, 0x90, 0x20, 0xd7, 0x7e, 0x03, 0xae, 0xf8, 0xea, 0x09, 0xe8, 0xc6, + 0xf0, 0x2a, 0x0b, 0xbf, 0x11, 0x39, 0xee, 0xac, 0xe1, 0x0d, 0x5c, 0x0d, 0x54, 0x08, 0xd0, 0xa6, + 0x9b, 0x2e, 0xac, 0x4a, 0xc1, 0xdf, 0x1c, 0x82, 0xe1, 0xe7, 0xed, 0xf5, 0x6d, 0x9b, 0xa3, 0x52, + 0x58, 0x2f, 0xef, 0x28, 0x7f, 0xf6, 0x05, 0x8d, 0xb2, 0xfc, 0x9e, 0x4c, 0xf0, 0xca, 0x15, 0xea, + 0xc3, 0x6e, 0x0d, 0xc5, 0x71, 0x66, 0xf8, 0xdc, 0x09, 0xef, 0x5c, 0x19, 0x14, 0xf2, 0x08, 0x17, + 0x9a, 0xe9, 0xf1, 0xc2, 0x30, 0x14, 0x87, 0xfd, 0x2b, 0xc8, 0xf8, 0xef, 0x79, 0xb4, 0x31, 0x22, + 0xec, 0xe0, 0x37, 0xa3, 0x11, 0xfc, 0x3b, 0xe3, 0x77, 0x32, 0x7e, 0xa9, 0xc2, 0xdc, 0xcb, 0xad, + 0xa1, 0x38, 0x6e, 0xb7, 0xe8, 0x8a, 0x70, 0x07, 0x6e, 0x31, 0x18, 0x0d, 0x0f, 0xdc, 0x62, 0x48, + 0x48, 0x2c, 0x4c, 0xed, 0x3c, 0x03, 0x90, 0x3b, 0xbd, 0xb7, 0xb2, 0x84, 0xd5, 0x7e, 0x17, 0xad, + 0x05, 0x3a, 0x50, 0x25, 0xb5, 0xdf, 0xad, 0xf5, 0xac, 0xcc, 0xcb, 0xc8, 0xfe, 0x7c, 0x86, 0xe4, + 0x5b, 0xb3, 0x84, 0xc0, 0x1a, 0xd8, 0xa9, 0x40, 0x66, 0x40, 0x2d, 0x91, 0x10, 0x0a, 0xdd, 0x0c, + 0xe5, 0x41, 0xfa, 0xf9, 0x3e, 0x46, 0x0b, 0x0e, 0x23, 0x32, 0xba, 0xf3, 0x09, 0x40, 0xd3, 0x50, + 0x24, 0x1a, 0xc3, 0xa1, 0xf5, 0x00, 0x9f, 0xe7, 0x0a, 0xee, 0xb4, 0x6c, 0x1e, 0x7f, 0xc1, 0x84, + 0x69, 0x1a, 0x0a, 0x8d, 0xf4, 0x76, 0x7e, 0x04, 0x69, 0x2a, 0xcc, 0x89, 0x85, 0x37, 0x8a, 0x9e, + 0xc9, 0x40, 0x57, 0x4f, 0x46, 0x76, 0x4a, 0x30, 0x4f, 0x19, 0xb0, 0xac, 0x11, 0x6d, 0x04, 0x58, + 0x1c, 0xd0, 0x11, 0x1f, 0x93, 0x39, 0x42, 0xc6, 0xc6, 0x76, 0x0a, 0x30, 0x67, 0xb3, 0x31, 0xdf, + 0x6a, 0x2d, 0x74, 0x23, 0x84, 0x8b, 0x35, 0xe0, 0x63, 0x92, 0x66, 0x4c, 0xac, 0xa1, 0x81, 0x28, + 0xf6, 0x3f, 0x9b, 0x06, 0x45, 0x61, 0x99, 0x5d, 0xa8, 0x28, 0x6c, 0xac, 0x90, 0x7c, 0x13, 0x6f, + 0x1a, 0xca, 0x71, 0x8a, 0x10, 0xfd, 0xe0, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x5e, 0xa7, 0xda, + 0x94, 0x19, 0x3d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/LICENSE b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/LICENSE deleted file mode 100644 index 37ec93a14fdc..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/NOTICE b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/NOTICE deleted file mode 100644 index 23a0ada2fbb5..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -CoreOS Project -Copyright 2018 CoreOS, Inc - -This product includes software developed at CoreOS, Inc. -(http://www.coreos.com/). diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/daemon/sdnotify.go b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify.go similarity index 100% rename from cluster-autoscaler/vendor/github.com/coreos/go-systemd/daemon/sdnotify.go rename to cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify.go diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/daemon/watchdog.go b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go similarity index 100% rename from cluster-autoscaler/vendor/github.com/coreos/go-systemd/daemon/watchdog.go rename to cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/dbus.go b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/dbus.go index e843a4613d51..cff5af1a64c3 100644 --- a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/dbus.go +++ b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/dbus.go @@ -111,14 +111,13 @@ type Conn struct { } } -// New establishes a connection to any available bus and authenticates. -// Callers should call Close() when done with the connection. -// Deprecated: use NewWithContext instead +// Deprecated: use NewWithContext instead. func New() (*Conn, error) { return NewWithContext(context.Background()) } -// NewWithContext same as New with context +// NewWithContext establishes a connection to any available bus and authenticates. +// Callers should call Close() when done with the connection. func NewWithContext(ctx context.Context) (*Conn, error) { conn, err := NewSystemConnectionContext(ctx) if err != nil && os.Geteuid() == 0 { @@ -127,44 +126,41 @@ func NewWithContext(ctx context.Context) (*Conn, error) { return conn, err } -// NewSystemConnection establishes a connection to the system bus and authenticates. -// Callers should call Close() when done with the connection -// Deprecated: use NewSystemConnectionContext instead +// Deprecated: use NewSystemConnectionContext instead. func NewSystemConnection() (*Conn, error) { return NewSystemConnectionContext(context.Background()) } -// NewSystemConnectionContext same as NewSystemConnection with context +// NewSystemConnectionContext establishes a connection to the system bus and authenticates. +// Callers should call Close() when done with the connection. func NewSystemConnectionContext(ctx context.Context) (*Conn, error) { return NewConnection(func() (*dbus.Conn, error) { return dbusAuthHelloConnection(ctx, dbus.SystemBusPrivate) }) } -// NewUserConnection establishes a connection to the session bus and -// authenticates. This can be used to connect to systemd user instances. -// Callers should call Close() when done with the connection. -// Deprecated: use NewUserConnectionContext instead +// Deprecated: use NewUserConnectionContext instead. func NewUserConnection() (*Conn, error) { return NewUserConnectionContext(context.Background()) } -// NewUserConnectionContext same as NewUserConnection with context +// NewUserConnectionContext establishes a connection to the session bus and +// authenticates. This can be used to connect to systemd user instances. +// Callers should call Close() when done with the connection. func NewUserConnectionContext(ctx context.Context) (*Conn, error) { return NewConnection(func() (*dbus.Conn, error) { return dbusAuthHelloConnection(ctx, dbus.SessionBusPrivate) }) } -// NewSystemdConnection establishes a private, direct connection to systemd. -// This can be used for communicating with systemd without a dbus daemon. -// Callers should call Close() when done with the connection. -// Deprecated: use NewSystemdConnectionContext instead +// Deprecated: use NewSystemdConnectionContext instead. func NewSystemdConnection() (*Conn, error) { return NewSystemdConnectionContext(context.Background()) } -// NewSystemdConnectionContext same as NewSystemdConnection with context +// NewSystemdConnectionContext establishes a private, direct connection to systemd. +// This can be used for communicating with systemd without a dbus daemon. +// Callers should call Close() when done with the connection. func NewSystemdConnectionContext(ctx context.Context) (*Conn, error) { return NewConnection(func() (*dbus.Conn, error) { // We skip Hello when talking directly to systemd. @@ -174,7 +170,7 @@ func NewSystemdConnectionContext(ctx context.Context) (*Conn, error) { }) } -// Close closes an established connection +// Close closes an established connection. func (c *Conn) Close() { c.sysconn.Close() c.sigconn.Close() @@ -217,7 +213,7 @@ func NewConnection(dialBus func() (*dbus.Conn, error)) (*Conn, error) { // GetManagerProperty returns the value of a property on the org.freedesktop.systemd1.Manager // interface. The value is returned in its string representation, as defined at -// https://developer.gnome.org/glib/unstable/gvariant-text.html +// https://developer.gnome.org/glib/unstable/gvariant-text.html. func (c *Conn) GetManagerProperty(prop string) (string, error) { variant, err := c.sysobj.GetProperty("org.freedesktop.systemd1.Manager." + prop) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/methods.go b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/methods.go index 01879ba1580a..fa04afc708e7 100644 --- a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/methods.go +++ b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/dbus/methods.go @@ -73,7 +73,12 @@ func (c *Conn) startJob(ctx context.Context, ch chan<- string, job string, args return jobID, nil } -// StartUnit enqueues a start job and depending jobs, if any (unless otherwise +// Deprecated: use StartUnitContext instead. +func (c *Conn) StartUnit(name string, mode string, ch chan<- string) (int, error) { + return c.StartUnitContext(context.Background(), name, mode, ch) +} + +// StartUnitContext enqueues a start job and depending jobs, if any (unless otherwise // specified by the mode string). // // Takes the unit to activate, plus a mode string. The mode needs to be one of @@ -103,137 +108,124 @@ func (c *Conn) startJob(ctx context.Context, ch chan<- string, job string, args // should not be considered authoritative. // // If an error does occur, it will be returned to the user alongside a job ID of 0. -// Deprecated: use StartUnitContext instead -func (c *Conn) StartUnit(name string, mode string, ch chan<- string) (int, error) { - return c.StartUnitContext(context.Background(), name, mode, ch) -} - -// StartUnitContext same as StartUnit with context func (c *Conn) StartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.StartUnit", name, mode) } -// StopUnit is similar to StartUnit but stops the specified unit rather -// than starting it. -// Deprecated: use StopUnitContext instead +// Deprecated: use StopUnitContext instead. func (c *Conn) StopUnit(name string, mode string, ch chan<- string) (int, error) { return c.StopUnitContext(context.Background(), name, mode, ch) } -// StopUnitContext same as StopUnit with context +// StopUnitContext is similar to StartUnitContext, but stops the specified unit +// rather than starting it. func (c *Conn) StopUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.StopUnit", name, mode) } -// ReloadUnit reloads a unit. Reloading is done only if the unit is already running and fails otherwise. -// Deprecated: use ReloadUnitContext instead +// Deprecated: use ReloadUnitContext instead. func (c *Conn) ReloadUnit(name string, mode string, ch chan<- string) (int, error) { return c.ReloadUnitContext(context.Background(), name, mode, ch) } -// ReloadUnitContext same as ReloadUnit with context +// ReloadUnitContext reloads a unit. Reloading is done only if the unit +// is already running, and fails otherwise. func (c *Conn) ReloadUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.ReloadUnit", name, mode) } -// RestartUnit restarts a service. If a service is restarted that isn't -// running it will be started. -// Deprecated: use RestartUnitContext instead +// Deprecated: use RestartUnitContext instead. func (c *Conn) RestartUnit(name string, mode string, ch chan<- string) (int, error) { return c.RestartUnitContext(context.Background(), name, mode, ch) } -// RestartUnitContext same as RestartUnit with context +// RestartUnitContext restarts a service. If a service is restarted that isn't +// running it will be started. func (c *Conn) RestartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.RestartUnit", name, mode) } -// TryRestartUnit is like RestartUnit, except that a service that isn't running -// is not affected by the restart. -// Deprecated: use TryRestartUnitContext instead +// Deprecated: use TryRestartUnitContext instead. func (c *Conn) TryRestartUnit(name string, mode string, ch chan<- string) (int, error) { return c.TryRestartUnitContext(context.Background(), name, mode, ch) } -// TryRestartUnitContext same as TryRestartUnit with context +// TryRestartUnitContext is like RestartUnitContext, except that a service that +// isn't running is not affected by the restart. func (c *Conn) TryRestartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.TryRestartUnit", name, mode) } -// ReloadOrRestartUnit attempts a reload if the unit supports it and use a restart -// otherwise. -// Deprecated: use ReloadOrRestartUnitContext instead +// Deprecated: use ReloadOrRestartUnitContext instead. func (c *Conn) ReloadOrRestartUnit(name string, mode string, ch chan<- string) (int, error) { return c.ReloadOrRestartUnitContext(context.Background(), name, mode, ch) } -// ReloadOrRestartUnitContext same as ReloadOrRestartUnit with context +// ReloadOrRestartUnitContext attempts a reload if the unit supports it and use +// a restart otherwise. func (c *Conn) ReloadOrRestartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.ReloadOrRestartUnit", name, mode) } -// ReloadOrTryRestartUnit attempts a reload if the unit supports it and use a "Try" -// flavored restart otherwise. -// Deprecated: use ReloadOrTryRestartUnitContext instead +// Deprecated: use ReloadOrTryRestartUnitContext instead. func (c *Conn) ReloadOrTryRestartUnit(name string, mode string, ch chan<- string) (int, error) { return c.ReloadOrTryRestartUnitContext(context.Background(), name, mode, ch) } -// ReloadOrTryRestartUnitContext same as ReloadOrTryRestartUnit with context +// ReloadOrTryRestartUnitContext attempts a reload if the unit supports it, +// and use a "Try" flavored restart otherwise. func (c *Conn) ReloadOrTryRestartUnitContext(ctx context.Context, name string, mode string, ch chan<- string) (int, error) { return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.ReloadOrTryRestartUnit", name, mode) } -// StartTransientUnit() may be used to create and start a transient unit, which -// will be released as soon as it is not running or referenced anymore or the -// system is rebooted. name is the unit name including suffix, and must be -// unique. mode is the same as in StartUnit(), properties contains properties -// of the unit. -// Deprecated: use StartTransientUnitContext instead +// Deprecated: use StartTransientUnitContext instead. func (c *Conn) StartTransientUnit(name string, mode string, properties []Property, ch chan<- string) (int, error) { return c.StartTransientUnitContext(context.Background(), name, mode, properties, ch) } -// StartTransientUnitContext same as StartTransientUnit with context +// StartTransientUnitContext may be used to create and start a transient unit, which +// will be released as soon as it is not running or referenced anymore or the +// system is rebooted. name is the unit name including suffix, and must be +// unique. mode is the same as in StartUnitContext, properties contains properties +// of the unit. func (c *Conn) StartTransientUnitContext(ctx context.Context, name string, mode string, properties []Property, ch chan<- string) (int, error) { return c.startJob(ctx, ch, "org.freedesktop.systemd1.Manager.StartTransientUnit", name, mode, properties, make([]PropertyCollection, 0)) } -// KillUnit takes the unit name and a UNIX signal number to send. All of the unit's -// processes are killed. -// Deprecated: use KillUnitContext instead +// Deprecated: use KillUnitContext instead. func (c *Conn) KillUnit(name string, signal int32) { c.KillUnitContext(context.Background(), name, signal) } -// KillUnitContext same as KillUnit with context +// KillUnitContext takes the unit name and a UNIX signal number to send. +// All of the unit's processes are killed. func (c *Conn) KillUnitContext(ctx context.Context, name string, signal int32) { c.KillUnitWithTarget(ctx, name, All, signal) } -// KillUnitWithTarget is like KillUnitContext, but allows you to specify which process in the unit to send the signal to +// KillUnitWithTarget is like KillUnitContext, but allows you to specify which +// process in the unit to send the signal to. func (c *Conn) KillUnitWithTarget(ctx context.Context, name string, target Who, signal int32) error { return c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.KillUnit", 0, name, string(target), signal).Store() } -// ResetFailedUnit resets the "failed" state of a specific unit. -// Deprecated: use ResetFailedUnitContext instead +// Deprecated: use ResetFailedUnitContext instead. func (c *Conn) ResetFailedUnit(name string) error { return c.ResetFailedUnitContext(context.Background(), name) } -// ResetFailedUnitContext same as ResetFailedUnit with context +// ResetFailedUnitContext resets the "failed" state of a specific unit. func (c *Conn) ResetFailedUnitContext(ctx context.Context, name string) error { return c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ResetFailedUnit", 0, name).Store() } -// SystemState returns the systemd state. Equivalent to `systemctl is-system-running`. -// Deprecated: use SystemStateContext instead +// Deprecated: use SystemStateContext instead. func (c *Conn) SystemState() (*Property, error) { return c.SystemStateContext(context.Background()) } -// SystemStateContext same as SystemState with context +// SystemStateContext returns the systemd state. Equivalent to +// systemctl is-system-running. func (c *Conn) SystemStateContext(ctx context.Context) (*Property, error) { var err error var prop dbus.Variant @@ -247,7 +239,7 @@ func (c *Conn) SystemStateContext(ctx context.Context) (*Property, error) { return &Property{Name: "SystemState", Value: prop}, nil } -// getProperties takes the unit path and returns all of its dbus object properties, for the given dbus interface +// getProperties takes the unit path and returns all of its dbus object properties, for the given dbus interface. func (c *Conn) getProperties(ctx context.Context, path dbus.ObjectPath, dbusInterface string) (map[string]interface{}, error) { var err error var props map[string]dbus.Variant @@ -270,36 +262,36 @@ func (c *Conn) getProperties(ctx context.Context, path dbus.ObjectPath, dbusInte return out, nil } -// GetUnitProperties takes the (unescaped) unit name and returns all of its dbus object properties. -// Deprecated: use GetUnitPropertiesContext instead +// Deprecated: use GetUnitPropertiesContext instead. func (c *Conn) GetUnitProperties(unit string) (map[string]interface{}, error) { return c.GetUnitPropertiesContext(context.Background(), unit) } -// GetUnitPropertiesContext same as GetUnitPropertiesContext with context +// GetUnitPropertiesContext takes the (unescaped) unit name and returns all of +// its dbus object properties. func (c *Conn) GetUnitPropertiesContext(ctx context.Context, unit string) (map[string]interface{}, error) { path := unitPath(unit) return c.getProperties(ctx, path, "org.freedesktop.systemd1.Unit") } -// GetUnitPathProperties takes the (escaped) unit path and returns all of its dbus object properties. -// Deprecated: use GetUnitPathPropertiesContext instead +// Deprecated: use GetUnitPathPropertiesContext instead. func (c *Conn) GetUnitPathProperties(path dbus.ObjectPath) (map[string]interface{}, error) { return c.GetUnitPathPropertiesContext(context.Background(), path) } -// GetUnitPathPropertiesContext same as GetUnitPathProperties with context +// GetUnitPathPropertiesContext takes the (escaped) unit path and returns all +// of its dbus object properties. func (c *Conn) GetUnitPathPropertiesContext(ctx context.Context, path dbus.ObjectPath) (map[string]interface{}, error) { return c.getProperties(ctx, path, "org.freedesktop.systemd1.Unit") } -// GetAllProperties takes the (unescaped) unit name and returns all of its dbus object properties. -// Deprecated: use GetAllPropertiesContext instead +// Deprecated: use GetAllPropertiesContext instead. func (c *Conn) GetAllProperties(unit string) (map[string]interface{}, error) { return c.GetAllPropertiesContext(context.Background(), unit) } -// GetAllPropertiesContext same as GetAllProperties with context +// GetAllPropertiesContext takes the (unescaped) unit name and returns all of +// its dbus object properties. func (c *Conn) GetAllPropertiesContext(ctx context.Context, unit string) (map[string]interface{}, error) { path := unitPath(unit) return c.getProperties(ctx, path, "") @@ -323,64 +315,63 @@ func (c *Conn) getProperty(ctx context.Context, unit string, dbusInterface strin return &Property{Name: propertyName, Value: prop}, nil } -// Deprecated: use GetUnitPropertyContext instead +// Deprecated: use GetUnitPropertyContext instead. func (c *Conn) GetUnitProperty(unit string, propertyName string) (*Property, error) { return c.GetUnitPropertyContext(context.Background(), unit, propertyName) } -// GetUnitPropertyContext same as GetUnitProperty with context +// GetUnitPropertyContext takes an (unescaped) unit name, and a property name, +// and returns the property value. func (c *Conn) GetUnitPropertyContext(ctx context.Context, unit string, propertyName string) (*Property, error) { return c.getProperty(ctx, unit, "org.freedesktop.systemd1.Unit", propertyName) } -// GetServiceProperty returns property for given service name and property name -// Deprecated: use GetServicePropertyContext instead +// Deprecated: use GetServicePropertyContext instead. func (c *Conn) GetServiceProperty(service string, propertyName string) (*Property, error) { return c.GetServicePropertyContext(context.Background(), service, propertyName) } -// GetServicePropertyContext same as GetServiceProperty with context +// GetServiceProperty returns property for given service name and property name. func (c *Conn) GetServicePropertyContext(ctx context.Context, service string, propertyName string) (*Property, error) { return c.getProperty(ctx, service, "org.freedesktop.systemd1.Service", propertyName) } -// GetUnitTypeProperties returns the extra properties for a unit, specific to the unit type. -// Valid values for unitType: Service, Socket, Target, Device, Mount, Automount, Snapshot, Timer, Swap, Path, Slice, Scope -// return "dbus.Error: Unknown interface" if the unitType is not the correct type of the unit -// Deprecated: use GetUnitTypePropertiesContext instead +// Deprecated: use GetUnitTypePropertiesContext instead. func (c *Conn) GetUnitTypeProperties(unit string, unitType string) (map[string]interface{}, error) { return c.GetUnitTypePropertiesContext(context.Background(), unit, unitType) } -// GetUnitTypePropertiesContext same as GetUnitTypeProperties with context +// GetUnitTypePropertiesContext returns the extra properties for a unit, specific to the unit type. +// Valid values for unitType: Service, Socket, Target, Device, Mount, Automount, Snapshot, Timer, Swap, Path, Slice, Scope. +// Returns "dbus.Error: Unknown interface" error if the unitType is not the correct type of the unit. func (c *Conn) GetUnitTypePropertiesContext(ctx context.Context, unit string, unitType string) (map[string]interface{}, error) { path := unitPath(unit) return c.getProperties(ctx, path, "org.freedesktop.systemd1."+unitType) } -// SetUnitProperties() may be used to modify certain unit properties at runtime. +// Deprecated: use SetUnitPropertiesContext instead. +func (c *Conn) SetUnitProperties(name string, runtime bool, properties ...Property) error { + return c.SetUnitPropertiesContext(context.Background(), name, runtime, properties...) +} + +// SetUnitPropertiesContext may be used to modify certain unit properties at runtime. // Not all properties may be changed at runtime, but many resource management // settings (primarily those in systemd.cgroup(5)) may. The changes are applied // instantly, and stored on disk for future boots, unless runtime is true, in which // case the settings only apply until the next reboot. name is the name of the unit // to modify. properties are the settings to set, encoded as an array of property // name and value pairs. -// Deprecated: use SetUnitPropertiesContext instead -func (c *Conn) SetUnitProperties(name string, runtime bool, properties ...Property) error { - return c.SetUnitPropertiesContext(context.Background(), name, runtime, properties...) -} - -// SetUnitPropertiesContext same as SetUnitProperties with context func (c *Conn) SetUnitPropertiesContext(ctx context.Context, name string, runtime bool, properties ...Property) error { return c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.SetUnitProperties", 0, name, runtime, properties).Store() } -// Deprecated: use GetUnitTypePropertyContext instead +// Deprecated: use GetUnitTypePropertyContext instead. func (c *Conn) GetUnitTypeProperty(unit string, unitType string, propertyName string) (*Property, error) { return c.GetUnitTypePropertyContext(context.Background(), unit, unitType, propertyName) } -// GetUnitTypePropertyContext same as GetUnitTypeProperty with context +// GetUnitTypePropertyContext takes a property name, a unit name, and a unit type, +// and returns a property value. For valid values of unitType, see GetUnitTypePropertiesContext. func (c *Conn) GetUnitTypePropertyContext(ctx context.Context, unit string, unitType string, propertyName string) (*Property, error) { return c.getProperty(ctx, unit, "org.freedesktop.systemd1."+unitType, propertyName) } @@ -426,58 +417,55 @@ func (c *Conn) listUnitsInternal(f storeFunc) ([]UnitStatus, error) { return status, nil } -// ListUnits returns an array with all currently loaded units. Note that -// units may be known by multiple names at the same time, and hence there might -// be more unit names loaded than actual units behind them. -// Also note that a unit is only loaded if it is active and/or enabled. -// Units that are both disabled and inactive will thus not be returned. -// Deprecated: use ListUnitsContext instead +// Deprecated: use ListUnitsContext instead. func (c *Conn) ListUnits() ([]UnitStatus, error) { return c.ListUnitsContext(context.Background()) } -// ListUnitsContext same as ListUnits with context +// ListUnitsContext returns an array with all currently loaded units. Note that +// units may be known by multiple names at the same time, and hence there might +// be more unit names loaded than actual units behind them. +// Also note that a unit is only loaded if it is active and/or enabled. +// Units that are both disabled and inactive will thus not be returned. func (c *Conn) ListUnitsContext(ctx context.Context) ([]UnitStatus, error) { return c.listUnitsInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnits", 0).Store) } -// ListUnitsFiltered returns an array with units filtered by state. -// It takes a list of units' statuses to filter. -// Deprecated: use ListUnitsFilteredContext instead +// Deprecated: use ListUnitsFilteredContext instead. func (c *Conn) ListUnitsFiltered(states []string) ([]UnitStatus, error) { return c.ListUnitsFilteredContext(context.Background(), states) } -// ListUnitsFilteredContext same as ListUnitsFiltered with context +// ListUnitsFilteredContext returns an array with units filtered by state. +// It takes a list of units' statuses to filter. func (c *Conn) ListUnitsFilteredContext(ctx context.Context, states []string) ([]UnitStatus, error) { return c.listUnitsInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitsFiltered", 0, states).Store) } -// ListUnitsByPatterns returns an array with units. -// It takes a list of units' statuses and names to filter. -// Note that units may be known by multiple names at the same time, -// and hence there might be more unit names loaded than actual units behind them. -// Deprecated: use ListUnitsByPatternsContext instead +// Deprecated: use ListUnitsByPatternsContext instead. func (c *Conn) ListUnitsByPatterns(states []string, patterns []string) ([]UnitStatus, error) { return c.ListUnitsByPatternsContext(context.Background(), states, patterns) } -// ListUnitsByPatternsContext same as ListUnitsByPatterns with context +// ListUnitsByPatternsContext returns an array with units. +// It takes a list of units' statuses and names to filter. +// Note that units may be known by multiple names at the same time, +// and hence there might be more unit names loaded than actual units behind them. func (c *Conn) ListUnitsByPatternsContext(ctx context.Context, states []string, patterns []string) ([]UnitStatus, error) { return c.listUnitsInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitsByPatterns", 0, states, patterns).Store) } -// ListUnitsByNames returns an array with units. It takes a list of units' -// names and returns an UnitStatus array. Comparing to ListUnitsByPatterns -// method, this method returns statuses even for inactive or non-existing -// units. Input array should contain exact unit names, but not patterns. -// Note: Requires systemd v230 or higher -// Deprecated: use ListUnitsByNamesContext instead +// Deprecated: use ListUnitsByNamesContext instead. func (c *Conn) ListUnitsByNames(units []string) ([]UnitStatus, error) { return c.ListUnitsByNamesContext(context.Background(), units) } -// ListUnitsByNamesContext same as ListUnitsByNames with context +// ListUnitsByNamesContext returns an array with units. It takes a list of units' +// names and returns an UnitStatus array. Comparing to ListUnitsByPatternsContext +// method, this method returns statuses even for inactive or non-existing +// units. Input array should contain exact unit names, but not patterns. +// +// Requires systemd v230 or higher. func (c *Conn) ListUnitsByNamesContext(ctx context.Context, units []string) ([]UnitStatus, error) { return c.listUnitsInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitsByNames", 0, units).Store) } @@ -513,37 +501,43 @@ func (c *Conn) listUnitFilesInternal(f storeFunc) ([]UnitFile, error) { return files, nil } -// ListUnitFiles returns an array of all available units on disk. -// Deprecated: use ListUnitFilesContext instead +// Deprecated: use ListUnitFilesContext instead. func (c *Conn) ListUnitFiles() ([]UnitFile, error) { return c.ListUnitFilesContext(context.Background()) } -// ListUnitFilesContext same as ListUnitFiles with context +// ListUnitFiles returns an array of all available units on disk. func (c *Conn) ListUnitFilesContext(ctx context.Context) ([]UnitFile, error) { return c.listUnitFilesInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitFiles", 0).Store) } -// ListUnitFilesByPatterns returns an array of all available units on disk matched the patterns. -// Deprecated: use ListUnitFilesByPatternsContext instead +// Deprecated: use ListUnitFilesByPatternsContext instead. func (c *Conn) ListUnitFilesByPatterns(states []string, patterns []string) ([]UnitFile, error) { return c.ListUnitFilesByPatternsContext(context.Background(), states, patterns) } -// ListUnitFilesByPatternsContext same as ListUnitFilesByPatterns with context +// ListUnitFilesByPatternsContext returns an array of all available units on disk matched the patterns. func (c *Conn) ListUnitFilesByPatternsContext(ctx context.Context, states []string, patterns []string) ([]UnitFile, error) { return c.listUnitFilesInternal(c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.ListUnitFilesByPatterns", 0, states, patterns).Store) } type LinkUnitFileChange EnableUnitFileChange -// LinkUnitFiles() links unit files (that are located outside of the +// Deprecated: use LinkUnitFilesContext instead. +func (c *Conn) LinkUnitFiles(files []string, runtime bool, force bool) ([]LinkUnitFileChange, error) { + return c.LinkUnitFilesContext(context.Background(), files, runtime, force) +} + +// LinkUnitFilesContext links unit files (that are located outside of the // usual unit search paths) into the unit search path. // // It takes a list of absolute paths to unit files to link and two -// booleans. The first boolean controls whether the unit shall be +// booleans. +// +// The first boolean controls whether the unit shall be // enabled for runtime only (true, /run), or persistently (false, // /etc). +// // The second controls whether symlinks pointing to other units shall // be replaced if necessary. // @@ -551,12 +545,6 @@ type LinkUnitFileChange EnableUnitFileChange // structures with three strings: the type of the change (one of symlink // or unlink), the file name of the symlink and the destination of the // symlink. -// Deprecated: use LinkUnitFilesContext instead -func (c *Conn) LinkUnitFiles(files []string, runtime bool, force bool) ([]LinkUnitFileChange, error) { - return c.LinkUnitFilesContext(context.Background(), files, runtime, force) -} - -// LinkUnitFilesContext same as LinkUnitFiles with context func (c *Conn) LinkUnitFilesContext(ctx context.Context, files []string, runtime bool, force bool) ([]LinkUnitFileChange, error) { result := make([][]interface{}, 0) err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.LinkUnitFiles", 0, files, runtime, force).Store(&result) @@ -583,8 +571,13 @@ func (c *Conn) LinkUnitFilesContext(ctx context.Context, files []string, runtime return changes, nil } -// EnableUnitFiles() may be used to enable one or more units in the system (by -// creating symlinks to them in /etc or /run). +// Deprecated: use EnableUnitFilesContext instead. +func (c *Conn) EnableUnitFiles(files []string, runtime bool, force bool) (bool, []EnableUnitFileChange, error) { + return c.EnableUnitFilesContext(context.Background(), files, runtime, force) +} + +// EnableUnitFilesContext may be used to enable one or more units in the system +// (by creating symlinks to them in /etc or /run). // // It takes a list of unit files to enable (either just file names or full // absolute paths if the unit files are residing outside the usual unit @@ -599,12 +592,6 @@ func (c *Conn) LinkUnitFilesContext(ctx context.Context, files []string, runtime // structures with three strings: the type of the change (one of symlink // or unlink), the file name of the symlink and the destination of the // symlink. -// Deprecated: use EnableUnitFilesContext instead -func (c *Conn) EnableUnitFiles(files []string, runtime bool, force bool) (bool, []EnableUnitFileChange, error) { - return c.EnableUnitFilesContext(context.Background(), files, runtime, force) -} - -// EnableUnitFilesContext same as EnableUnitFiles with context func (c *Conn) EnableUnitFilesContext(ctx context.Context, files []string, runtime bool, force bool) (bool, []EnableUnitFileChange, error) { var carries_install_info bool @@ -639,8 +626,13 @@ type EnableUnitFileChange struct { Destination string // Destination of the symlink } -// DisableUnitFiles() may be used to disable one or more units in the system (by -// removing symlinks to them from /etc or /run). +// Deprecated: use DisableUnitFilesContext instead. +func (c *Conn) DisableUnitFiles(files []string, runtime bool) ([]DisableUnitFileChange, error) { + return c.DisableUnitFilesContext(context.Background(), files, runtime) +} + +// DisableUnitFilesContext may be used to disable one or more units in the +// system (by removing symlinks to them from /etc or /run). // // It takes a list of unit files to disable (either just file names or full // absolute paths if the unit files are residing outside the usual unit @@ -651,12 +643,6 @@ type EnableUnitFileChange struct { // consists of structures with three strings: the type of the change (one of // symlink or unlink), the file name of the symlink and the destination of the // symlink. -// Deprecated: use DisableUnitFilesContext instead -func (c *Conn) DisableUnitFiles(files []string, runtime bool) ([]DisableUnitFileChange, error) { - return c.DisableUnitFilesContext(context.Background(), files, runtime) -} - -// DisableUnitFilesContext same as DisableUnitFiles with context func (c *Conn) DisableUnitFilesContext(ctx context.Context, files []string, runtime bool) ([]DisableUnitFileChange, error) { result := make([][]interface{}, 0) err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.DisableUnitFiles", 0, files, runtime).Store(&result) @@ -689,21 +675,20 @@ type DisableUnitFileChange struct { Destination string // Destination of the symlink } -// MaskUnitFiles masks one or more units in the system -// -// It takes three arguments: -// * list of units to mask (either just file names or full -// absolute paths if the unit files are residing outside -// the usual unit search paths) -// * runtime to specify whether the unit was enabled for runtime -// only (true, /run/systemd/..), or persistently (false, /etc/systemd/..) -// * force flag -// Deprecated: use MaskUnitFilesContext instead +// Deprecated: use MaskUnitFilesContext instead. func (c *Conn) MaskUnitFiles(files []string, runtime bool, force bool) ([]MaskUnitFileChange, error) { return c.MaskUnitFilesContext(context.Background(), files, runtime, force) } -// MaskUnitFilesContext same as MaskUnitFiles with context +// MaskUnitFilesContext masks one or more units in the system. +// +// The files argument contains a list of units to mask (either just file names +// or full absolute paths if the unit files are residing outside the usual unit +// search paths). +// +// The runtime argument is used to specify whether the unit was enabled for +// runtime only (true, /run/systemd/..), or persistently (false, +// /etc/systemd/..). func (c *Conn) MaskUnitFilesContext(ctx context.Context, files []string, runtime bool, force bool) ([]MaskUnitFileChange, error) { result := make([][]interface{}, 0) err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.MaskUnitFiles", 0, files, runtime, force).Store(&result) @@ -736,20 +721,18 @@ type MaskUnitFileChange struct { Destination string // Destination of the symlink } -// UnmaskUnitFiles unmasks one or more units in the system -// -// It takes two arguments: -// * list of unit files to mask (either just file names or full -// absolute paths if the unit files are residing outside -// the usual unit search paths) -// * runtime to specify whether the unit was enabled for runtime -// only (true, /run/systemd/..), or persistently (false, /etc/systemd/..) -// Deprecated: use UnmaskUnitFilesContext instead +// Deprecated: use UnmaskUnitFilesContext instead. func (c *Conn) UnmaskUnitFiles(files []string, runtime bool) ([]UnmaskUnitFileChange, error) { return c.UnmaskUnitFilesContext(context.Background(), files, runtime) } -// UnmaskUnitFilesContext same as UnmaskUnitFiles with context +// UnmaskUnitFilesContext unmasks one or more units in the system. +// +// It takes the list of unit files to mask (either just file names or full +// absolute paths if the unit files are residing outside the usual unit search +// paths), and a boolean runtime flag to specify whether the unit was enabled +// for runtime only (true, /run/systemd/..), or persistently (false, +// /etc/systemd/..). func (c *Conn) UnmaskUnitFilesContext(ctx context.Context, files []string, runtime bool) ([]UnmaskUnitFileChange, error) { result := make([][]interface{}, 0) err := c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.UnmaskUnitFiles", 0, files, runtime).Store(&result) @@ -782,14 +765,13 @@ type UnmaskUnitFileChange struct { Destination string // Destination of the symlink } -// Reload instructs systemd to scan for and reload unit files. This is -// equivalent to a 'systemctl daemon-reload'. -// Deprecated: use ReloadContext instead +// Deprecated: use ReloadContext instead. func (c *Conn) Reload() error { return c.ReloadContext(context.Background()) } -// ReloadContext same as Reload with context +// ReloadContext instructs systemd to scan for and reload unit files. This is +// an equivalent to systemctl daemon-reload. func (c *Conn) ReloadContext(ctx context.Context) error { return c.sysobj.CallWithContext(ctx, "org.freedesktop.systemd1.Manager.Reload", 0).Store() } @@ -798,12 +780,12 @@ func unitPath(name string) dbus.ObjectPath { return dbus.ObjectPath("/org/freedesktop/systemd1/unit/" + PathBusEscape(name)) } -// unitName returns the unescaped base element of the supplied escaped path +// unitName returns the unescaped base element of the supplied escaped path. func unitName(dpath dbus.ObjectPath) string { return pathBusUnescape(path.Base(string(dpath))) } -// Currently queued job definition +// JobStatus holds a currently queued job definition. type JobStatus struct { Id uint32 // The numeric job id Unit string // The primary unit name for this job @@ -813,13 +795,12 @@ type JobStatus struct { UnitPath dbus.ObjectPath // The unit object path } -// ListJobs returns an array with all currently queued jobs -// Deprecated: use ListJobsContext instead +// Deprecated: use ListJobsContext instead. func (c *Conn) ListJobs() ([]JobStatus, error) { return c.ListJobsContext(context.Background()) } -// ListJobsContext same as ListJobs with context +// ListJobsContext returns an array with all currently queued jobs. func (c *Conn) ListJobsContext(ctx context.Context) ([]JobStatus, error) { return c.listJobsInternal(ctx) } diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal.go b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal.go new file mode 100644 index 000000000000..ac24c7767d35 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal.go @@ -0,0 +1,46 @@ +// Copyright 2015 CoreOS, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package journal provides write bindings to the local systemd journal. +// It is implemented in pure Go and connects to the journal directly over its +// unix socket. +// +// To read from the journal, see the "sdjournal" package, which wraps the +// sd-journal a C API. +// +// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html +package journal + +import ( + "fmt" +) + +// Priority of a journal message +type Priority int + +const ( + PriEmerg Priority = iota + PriAlert + PriCrit + PriErr + PriWarning + PriNotice + PriInfo + PriDebug +) + +// Print prints a message to the local systemd journal using Send(). +func Print(priority Priority, format string, a ...interface{}) error { + return Send(fmt.Sprintf(format, a...), priority, nil) +} diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/journal/journal.go b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go similarity index 93% rename from cluster-autoscaler/vendor/github.com/coreos/go-systemd/journal/journal.go rename to cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go index a0f4837a02c9..8d58ca0fbca0 100644 --- a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/journal/journal.go +++ b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +build !windows + // Package journal provides write bindings to the local systemd journal. // It is implemented in pure Go and connects to the journal directly over its // unix socket. @@ -39,20 +41,6 @@ import ( "unsafe" ) -// Priority of a journal message -type Priority int - -const ( - PriEmerg Priority = iota - PriAlert - PriCrit - PriErr - PriWarning - PriNotice - PriInfo - PriDebug -) - var ( // This can be overridden at build-time: // https://github.com/golang/go/wiki/GcToolchainTricks#including-build-information-in-the-executable @@ -77,9 +65,11 @@ func Enabled() bool { return false } - if _, err := net.Dial("unixgram", journalSocket); err != nil { + conn, err := net.Dial("unixgram", journalSocket) + if err != nil { return false } + defer conn.Close() return true } @@ -136,11 +126,6 @@ func Send(message string, priority Priority, vars map[string]string) error { return nil } -// Print prints a message to the local systemd journal using Send(). -func Print(priority Priority, format string, a ...interface{}) error { - return Send(fmt.Sprintf(format, a...), priority, nil) -} - func appendVariable(w io.Writer, name, value string) { if err := validVarName(name); err != nil { fmt.Fprintf(os.Stderr, "variable name %s contains invalid character, ignoring\n", name) diff --git a/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go new file mode 100644 index 000000000000..677aca68ed20 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go @@ -0,0 +1,35 @@ +// Copyright 2015 CoreOS, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package journal provides write bindings to the local systemd journal. +// It is implemented in pure Go and connects to the journal directly over its +// unix socket. +// +// To read from the journal, see the "sdjournal" package, which wraps the +// sd-journal a C API. +// +// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html +package journal + +import ( + "errors" +) + +func Enabled() bool { + return false +} + +func Send(message string, priority Priority, vars map[string]string) error { + return errors.New("could not initialize socket to journald") +} diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/NOTICE b/cluster-autoscaler/vendor/github.com/coreos/pkg/NOTICE deleted file mode 100644 index b39ddfa5cbde..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -CoreOS Project -Copyright 2014 CoreOS, Inc - -This product includes software developed at CoreOS, Inc. -(http://www.coreos.com/). diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/README.md b/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/README.md deleted file mode 100644 index f79dbfca5cbe..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# capnslog, the CoreOS logging package - -There are far too many logging packages out there, with varying degrees of licenses, far too many features (colorization, all sorts of log frameworks) or are just a pain to use (lack of `Fatalln()`?). -capnslog provides a simple but consistent logging interface suitable for all kinds of projects. - -### Design Principles - -##### `package main` is the place where logging gets turned on and routed - -A library should not touch log options, only generate log entries. Libraries are silent until main lets them speak. - -##### All log options are runtime-configurable. - -Still the job of `main` to expose these configurations. `main` may delegate this to, say, a configuration webhook, but does so explicitly. - -##### There is one log object per package. It is registered under its repository and package name. - -`main` activates logging for its repository and any dependency repositories it would also like to have output in its logstream. `main` also dictates at which level each subpackage logs. - -##### There is *one* output stream, and it is an `io.Writer` composed with a formatter. - -Splitting streams is probably not the job of your program, but rather, your log aggregation framework. If you must split output streams, again, `main` configures this and you can write a very simple two-output struct that satisfies io.Writer. - -Fancy colorful formatting and JSON output are beyond the scope of a basic logging framework -- they're application/log-collector dependent. These are, at best, provided as options, but more likely, provided by your application. - -##### Log objects are an interface - -An object knows best how to print itself. Log objects can collect more interesting metadata if they wish, however, because text isn't going away anytime soon, they must all be marshalable to text. The simplest log object is a string, which returns itself. If you wish to do more fancy tricks for printing your log objects, see also JSON output -- introspect and write a formatter which can handle your advanced log interface. Making strings is the only thing guaranteed. - -##### Log levels have specific meanings: - - * Critical: Unrecoverable. Must fail. - * Error: Data has been lost, a request has failed for a bad reason, or a required resource has been lost - * Warning: (Hopefully) Temporary conditions that may cause errors, but may work fine. A replica disappearing (that may reconnect) is a warning. - * Notice: Normal, but important (uncommon) log information. - * Info: Normal, working log information, everything is fine, but helpful notices for auditing or common operations. - * Debug: Everything is still fine, but even common operations may be logged, and less helpful but more quantity of notices. - * Trace: Anything goes, from logging every function call as part of a common operation, to tracing execution of a query. - diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/formatters.go b/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/formatters.go deleted file mode 100644 index b305a845fb2b..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/formatters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package capnslog - -import ( - "bufio" - "fmt" - "io" - "log" - "runtime" - "strings" - "time" -) - -type Formatter interface { - Format(pkg string, level LogLevel, depth int, entries ...interface{}) - Flush() -} - -func NewStringFormatter(w io.Writer) Formatter { - return &StringFormatter{ - w: bufio.NewWriter(w), - } -} - -type StringFormatter struct { - w *bufio.Writer -} - -func (s *StringFormatter) Format(pkg string, l LogLevel, i int, entries ...interface{}) { - now := time.Now().UTC() - s.w.WriteString(now.Format(time.RFC3339)) - s.w.WriteByte(' ') - writeEntries(s.w, pkg, l, i, entries...) - s.Flush() -} - -func writeEntries(w *bufio.Writer, pkg string, _ LogLevel, _ int, entries ...interface{}) { - if pkg != "" { - w.WriteString(pkg + ": ") - } - str := fmt.Sprint(entries...) - endsInNL := strings.HasSuffix(str, "\n") - w.WriteString(str) - if !endsInNL { - w.WriteString("\n") - } -} - -func (s *StringFormatter) Flush() { - s.w.Flush() -} - -func NewPrettyFormatter(w io.Writer, debug bool) Formatter { - return &PrettyFormatter{ - w: bufio.NewWriter(w), - debug: debug, - } -} - -type PrettyFormatter struct { - w *bufio.Writer - debug bool -} - -func (c *PrettyFormatter) Format(pkg string, l LogLevel, depth int, entries ...interface{}) { - now := time.Now() - ts := now.Format("2006-01-02 15:04:05") - c.w.WriteString(ts) - ms := now.Nanosecond() / 1000 - c.w.WriteString(fmt.Sprintf(".%06d", ms)) - if c.debug { - _, file, line, ok := runtime.Caller(depth) // It's always the same number of frames to the user's call. - if !ok { - file = "???" - line = 1 - } else { - slash := strings.LastIndex(file, "/") - if slash >= 0 { - file = file[slash+1:] - } - } - if line < 0 { - line = 0 // not a real line number - } - c.w.WriteString(fmt.Sprintf(" [%s:%d]", file, line)) - } - c.w.WriteString(fmt.Sprint(" ", l.Char(), " | ")) - writeEntries(c.w, pkg, l, depth, entries...) - c.Flush() -} - -func (c *PrettyFormatter) Flush() { - c.w.Flush() -} - -// LogFormatter emulates the form of the traditional built-in logger. -type LogFormatter struct { - logger *log.Logger - prefix string -} - -// NewLogFormatter is a helper to produce a new LogFormatter struct. It uses the -// golang log package to actually do the logging work so that logs look similar. -func NewLogFormatter(w io.Writer, prefix string, flag int) Formatter { - return &LogFormatter{ - logger: log.New(w, "", flag), // don't use prefix here - prefix: prefix, // save it instead - } -} - -// Format builds a log message for the LogFormatter. The LogLevel is ignored. -func (lf *LogFormatter) Format(pkg string, _ LogLevel, _ int, entries ...interface{}) { - str := fmt.Sprint(entries...) - prefix := lf.prefix - if pkg != "" { - prefix = fmt.Sprintf("%s%s: ", prefix, pkg) - } - lf.logger.Output(5, fmt.Sprintf("%s%v", prefix, str)) // call depth is 5 -} - -// Flush is included so that the interface is complete, but is a no-op. -func (lf *LogFormatter) Flush() { - // noop -} - -// NilFormatter is a no-op log formatter that does nothing. -type NilFormatter struct { -} - -// NewNilFormatter is a helper to produce a new LogFormatter struct. It logs no -// messages so that you can cause part of your logging to be silent. -func NewNilFormatter() Formatter { - return &NilFormatter{} -} - -// Format does nothing. -func (_ *NilFormatter) Format(_ string, _ LogLevel, _ int, _ ...interface{}) { - // noop -} - -// Flush is included so that the interface is complete, but is a no-op. -func (_ *NilFormatter) Flush() { - // noop -} diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/glog_formatter.go b/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/glog_formatter.go deleted file mode 100644 index 426603ef305c..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/glog_formatter.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package capnslog - -import ( - "bufio" - "bytes" - "io" - "os" - "runtime" - "strconv" - "strings" - "time" -) - -var pid = os.Getpid() - -type GlogFormatter struct { - StringFormatter -} - -func NewGlogFormatter(w io.Writer) *GlogFormatter { - g := &GlogFormatter{} - g.w = bufio.NewWriter(w) - return g -} - -func (g GlogFormatter) Format(pkg string, level LogLevel, depth int, entries ...interface{}) { - g.w.Write(GlogHeader(level, depth+1)) - g.StringFormatter.Format(pkg, level, depth+1, entries...) -} - -func GlogHeader(level LogLevel, depth int) []byte { - // Lmmdd hh:mm:ss.uuuuuu threadid file:line] - now := time.Now().UTC() - _, file, line, ok := runtime.Caller(depth) // It's always the same number of frames to the user's call. - if !ok { - file = "???" - line = 1 - } else { - slash := strings.LastIndex(file, "/") - if slash >= 0 { - file = file[slash+1:] - } - } - if line < 0 { - line = 0 // not a real line number - } - buf := &bytes.Buffer{} - buf.Grow(30) - _, month, day := now.Date() - hour, minute, second := now.Clock() - buf.WriteString(level.Char()) - twoDigits(buf, int(month)) - twoDigits(buf, day) - buf.WriteByte(' ') - twoDigits(buf, hour) - buf.WriteByte(':') - twoDigits(buf, minute) - buf.WriteByte(':') - twoDigits(buf, second) - buf.WriteByte('.') - buf.WriteString(strconv.Itoa(now.Nanosecond() / 1000)) - buf.WriteByte('Z') - buf.WriteByte(' ') - buf.WriteString(strconv.Itoa(pid)) - buf.WriteByte(' ') - buf.WriteString(file) - buf.WriteByte(':') - buf.WriteString(strconv.Itoa(line)) - buf.WriteByte(']') - buf.WriteByte(' ') - return buf.Bytes() -} - -const digits = "0123456789" - -func twoDigits(b *bytes.Buffer, d int) { - c2 := digits[d%10] - d /= 10 - c1 := digits[d%10] - b.WriteByte(c1) - b.WriteByte(c2) -} diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/init.go b/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/init.go deleted file mode 100644 index 38ce6d261844..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/init.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// +build !windows - -package capnslog - -import ( - "io" - "os" - "syscall" -) - -// Here's where the opinionation comes in. We need some sensible defaults, -// especially after taking over the log package. Your project (whatever it may -// be) may see things differently. That's okay; there should be no defaults in -// the main package that cannot be controlled or overridden programatically, -// otherwise it's a bug. Doing so is creating your own init_log.go file much -// like this one. - -func init() { - initHijack() - - // Go `log` package uses os.Stderr. - SetFormatter(NewDefaultFormatter(os.Stderr)) - SetGlobalLogLevel(INFO) -} - -func NewDefaultFormatter(out io.Writer) Formatter { - if syscall.Getppid() == 1 { - // We're running under init, which may be systemd. - f, err := NewJournaldFormatter() - if err == nil { - return f - } - } - return NewPrettyFormatter(out, false) -} diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/journald_formatter.go b/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/journald_formatter.go deleted file mode 100644 index 72e05207c52c..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/journald_formatter.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// +build !windows - -package capnslog - -import ( - "errors" - "fmt" - "os" - "path/filepath" - - "github.com/coreos/go-systemd/journal" -) - -func NewJournaldFormatter() (Formatter, error) { - if !journal.Enabled() { - return nil, errors.New("No systemd detected") - } - return &journaldFormatter{}, nil -} - -type journaldFormatter struct{} - -func (j *journaldFormatter) Format(pkg string, l LogLevel, _ int, entries ...interface{}) { - var pri journal.Priority - switch l { - case CRITICAL: - pri = journal.PriCrit - case ERROR: - pri = journal.PriErr - case WARNING: - pri = journal.PriWarning - case NOTICE: - pri = journal.PriNotice - case INFO: - pri = journal.PriInfo - case DEBUG: - pri = journal.PriDebug - case TRACE: - pri = journal.PriDebug - default: - panic("Unhandled loglevel") - } - msg := fmt.Sprint(entries...) - tags := map[string]string{ - "PACKAGE": pkg, - "SYSLOG_IDENTIFIER": filepath.Base(os.Args[0]), - } - err := journal.Send(msg, pri, tags) - if err != nil { - fmt.Fprintln(os.Stderr, err) - } -} - -func (j *journaldFormatter) Flush() {} diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/logmap.go b/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/logmap.go deleted file mode 100644 index 226b60c22534..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/logmap.go +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package capnslog - -import ( - "errors" - "strings" - "sync" -) - -// LogLevel is the set of all log levels. -type LogLevel int8 - -const ( - // CRITICAL is the lowest log level; only errors which will end the program will be propagated. - CRITICAL LogLevel = iota - 1 - // ERROR is for errors that are not fatal but lead to troubling behavior. - ERROR - // WARNING is for errors which are not fatal and not errors, but are unusual. Often sourced from misconfigurations. - WARNING - // NOTICE is for normal but significant conditions. - NOTICE - // INFO is a log level for common, everyday log updates. - INFO - // DEBUG is the default hidden level for more verbose updates about internal processes. - DEBUG - // TRACE is for (potentially) call by call tracing of programs. - TRACE -) - -// Char returns a single-character representation of the log level. -func (l LogLevel) Char() string { - switch l { - case CRITICAL: - return "C" - case ERROR: - return "E" - case WARNING: - return "W" - case NOTICE: - return "N" - case INFO: - return "I" - case DEBUG: - return "D" - case TRACE: - return "T" - default: - panic("Unhandled loglevel") - } -} - -// String returns a multi-character representation of the log level. -func (l LogLevel) String() string { - switch l { - case CRITICAL: - return "CRITICAL" - case ERROR: - return "ERROR" - case WARNING: - return "WARNING" - case NOTICE: - return "NOTICE" - case INFO: - return "INFO" - case DEBUG: - return "DEBUG" - case TRACE: - return "TRACE" - default: - panic("Unhandled loglevel") - } -} - -// Update using the given string value. Fulfills the flag.Value interface. -func (l *LogLevel) Set(s string) error { - value, err := ParseLevel(s) - if err != nil { - return err - } - - *l = value - return nil -} - -// Returns an empty string, only here to fulfill the pflag.Value interface. -func (l *LogLevel) Type() string { - return "" -} - -// ParseLevel translates some potential loglevel strings into their corresponding levels. -func ParseLevel(s string) (LogLevel, error) { - switch s { - case "CRITICAL", "C": - return CRITICAL, nil - case "ERROR", "0", "E": - return ERROR, nil - case "WARNING", "1", "W": - return WARNING, nil - case "NOTICE", "2", "N": - return NOTICE, nil - case "INFO", "3", "I": - return INFO, nil - case "DEBUG", "4", "D": - return DEBUG, nil - case "TRACE", "5", "T": - return TRACE, nil - } - return CRITICAL, errors.New("couldn't parse log level " + s) -} - -type RepoLogger map[string]*PackageLogger - -type loggerStruct struct { - sync.Mutex - repoMap map[string]RepoLogger - formatter Formatter -} - -// logger is the global logger -var logger = new(loggerStruct) - -// SetGlobalLogLevel sets the log level for all packages in all repositories -// registered with capnslog. -func SetGlobalLogLevel(l LogLevel) { - logger.Lock() - defer logger.Unlock() - for _, r := range logger.repoMap { - r.setRepoLogLevelInternal(l) - } -} - -// GetRepoLogger may return the handle to the repository's set of packages' loggers. -func GetRepoLogger(repo string) (RepoLogger, error) { - logger.Lock() - defer logger.Unlock() - r, ok := logger.repoMap[repo] - if !ok { - return nil, errors.New("no packages registered for repo " + repo) - } - return r, nil -} - -// MustRepoLogger returns the handle to the repository's packages' loggers. -func MustRepoLogger(repo string) RepoLogger { - r, err := GetRepoLogger(repo) - if err != nil { - panic(err) - } - return r -} - -// SetRepoLogLevel sets the log level for all packages in the repository. -func (r RepoLogger) SetRepoLogLevel(l LogLevel) { - logger.Lock() - defer logger.Unlock() - r.setRepoLogLevelInternal(l) -} - -func (r RepoLogger) setRepoLogLevelInternal(l LogLevel) { - for _, v := range r { - v.level = l - } -} - -// ParseLogLevelConfig parses a comma-separated string of "package=loglevel", in -// order, and returns a map of the results, for use in SetLogLevel. -func (r RepoLogger) ParseLogLevelConfig(conf string) (map[string]LogLevel, error) { - setlist := strings.Split(conf, ",") - out := make(map[string]LogLevel) - for _, setstring := range setlist { - setting := strings.Split(setstring, "=") - if len(setting) != 2 { - return nil, errors.New("oddly structured `pkg=level` option: " + setstring) - } - l, err := ParseLevel(setting[1]) - if err != nil { - return nil, err - } - out[setting[0]] = l - } - return out, nil -} - -// SetLogLevel takes a map of package names within a repository to their desired -// loglevel, and sets the levels appropriately. Unknown packages are ignored. -// "*" is a special package name that corresponds to all packages, and will be -// processed first. -func (r RepoLogger) SetLogLevel(m map[string]LogLevel) { - logger.Lock() - defer logger.Unlock() - if l, ok := m["*"]; ok { - r.setRepoLogLevelInternal(l) - } - for k, v := range m { - l, ok := r[k] - if !ok { - continue - } - l.level = v - } -} - -// SetFormatter sets the formatting function for all logs. -func SetFormatter(f Formatter) { - logger.Lock() - defer logger.Unlock() - logger.formatter = f -} - -// NewPackageLogger creates a package logger object. -// This should be defined as a global var in your package, referencing your repo. -func NewPackageLogger(repo string, pkg string) (p *PackageLogger) { - logger.Lock() - defer logger.Unlock() - if logger.repoMap == nil { - logger.repoMap = make(map[string]RepoLogger) - } - r, rok := logger.repoMap[repo] - if !rok { - logger.repoMap[repo] = make(RepoLogger) - r = logger.repoMap[repo] - } - p, pok := r[pkg] - if !pok { - r[pkg] = &PackageLogger{ - pkg: pkg, - level: INFO, - } - p = r[pkg] - } - return -} diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/pkg_logger.go b/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/pkg_logger.go deleted file mode 100644 index 00ff37149aeb..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/pkg_logger.go +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package capnslog - -import ( - "fmt" - "os" -) - -type PackageLogger struct { - pkg string - level LogLevel -} - -const calldepth = 2 - -func (p *PackageLogger) internalLog(depth int, inLevel LogLevel, entries ...interface{}) { - logger.Lock() - defer logger.Unlock() - if inLevel != CRITICAL && p.level < inLevel { - return - } - if logger.formatter != nil { - logger.formatter.Format(p.pkg, inLevel, depth+1, entries...) - } -} - -// SetLevel allows users to change the current logging level. -func (p *PackageLogger) SetLevel(l LogLevel) { - logger.Lock() - defer logger.Unlock() - p.level = l -} - -// LevelAt checks if the given log level will be outputted under current setting. -func (p *PackageLogger) LevelAt(l LogLevel) bool { - logger.Lock() - defer logger.Unlock() - return p.level >= l -} - -// Log a formatted string at any level between ERROR and TRACE -func (p *PackageLogger) Logf(l LogLevel, format string, args ...interface{}) { - p.internalLog(calldepth, l, fmt.Sprintf(format, args...)) -} - -// Log a message at any level between ERROR and TRACE -func (p *PackageLogger) Log(l LogLevel, args ...interface{}) { - p.internalLog(calldepth, l, fmt.Sprint(args...)) -} - -// log stdlib compatibility - -func (p *PackageLogger) Println(args ...interface{}) { - p.internalLog(calldepth, INFO, fmt.Sprintln(args...)) -} - -func (p *PackageLogger) Printf(format string, args ...interface{}) { - p.Logf(INFO, format, args...) -} - -func (p *PackageLogger) Print(args ...interface{}) { - p.internalLog(calldepth, INFO, fmt.Sprint(args...)) -} - -// Panic and fatal - -func (p *PackageLogger) Panicf(format string, args ...interface{}) { - s := fmt.Sprintf(format, args...) - p.internalLog(calldepth, CRITICAL, s) - panic(s) -} - -func (p *PackageLogger) Panic(args ...interface{}) { - s := fmt.Sprint(args...) - p.internalLog(calldepth, CRITICAL, s) - panic(s) -} - -func (p *PackageLogger) Panicln(args ...interface{}) { - s := fmt.Sprintln(args...) - p.internalLog(calldepth, CRITICAL, s) - panic(s) -} - -func (p *PackageLogger) Fatalf(format string, args ...interface{}) { - p.Logf(CRITICAL, format, args...) - os.Exit(1) -} - -func (p *PackageLogger) Fatal(args ...interface{}) { - s := fmt.Sprint(args...) - p.internalLog(calldepth, CRITICAL, s) - os.Exit(1) -} - -func (p *PackageLogger) Fatalln(args ...interface{}) { - s := fmt.Sprintln(args...) - p.internalLog(calldepth, CRITICAL, s) - os.Exit(1) -} - -// Error Functions - -func (p *PackageLogger) Errorf(format string, args ...interface{}) { - p.Logf(ERROR, format, args...) -} - -func (p *PackageLogger) Error(entries ...interface{}) { - p.internalLog(calldepth, ERROR, entries...) -} - -// Warning Functions - -func (p *PackageLogger) Warningf(format string, args ...interface{}) { - p.Logf(WARNING, format, args...) -} - -func (p *PackageLogger) Warning(entries ...interface{}) { - p.internalLog(calldepth, WARNING, entries...) -} - -// Notice Functions - -func (p *PackageLogger) Noticef(format string, args ...interface{}) { - p.Logf(NOTICE, format, args...) -} - -func (p *PackageLogger) Notice(entries ...interface{}) { - p.internalLog(calldepth, NOTICE, entries...) -} - -// Info Functions - -func (p *PackageLogger) Infof(format string, args ...interface{}) { - p.Logf(INFO, format, args...) -} - -func (p *PackageLogger) Info(entries ...interface{}) { - p.internalLog(calldepth, INFO, entries...) -} - -// Debug Functions - -func (p *PackageLogger) Debugf(format string, args ...interface{}) { - if p.level < DEBUG { - return - } - p.Logf(DEBUG, format, args...) -} - -func (p *PackageLogger) Debug(entries ...interface{}) { - if p.level < DEBUG { - return - } - p.internalLog(calldepth, DEBUG, entries...) -} - -// Trace Functions - -func (p *PackageLogger) Tracef(format string, args ...interface{}) { - if p.level < TRACE { - return - } - p.Logf(TRACE, format, args...) -} - -func (p *PackageLogger) Trace(entries ...interface{}) { - if p.level < TRACE { - return - } - p.internalLog(calldepth, TRACE, entries...) -} - -func (p *PackageLogger) Flush() { - logger.Lock() - defer logger.Unlock() - logger.formatter.Flush() -} diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/syslog_formatter.go b/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/syslog_formatter.go deleted file mode 100644 index 4be5a1f2de39..000000000000 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/syslog_formatter.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// +build !windows - -package capnslog - -import ( - "fmt" - "log/syslog" -) - -func NewSyslogFormatter(w *syslog.Writer) Formatter { - return &syslogFormatter{w} -} - -func NewDefaultSyslogFormatter(tag string) (Formatter, error) { - w, err := syslog.New(syslog.LOG_DEBUG, tag) - if err != nil { - return nil, err - } - return NewSyslogFormatter(w), nil -} - -type syslogFormatter struct { - w *syslog.Writer -} - -func (s *syslogFormatter) Format(pkg string, l LogLevel, _ int, entries ...interface{}) { - for _, entry := range entries { - str := fmt.Sprint(entry) - switch l { - case CRITICAL: - s.w.Crit(str) - case ERROR: - s.w.Err(str) - case WARNING: - s.w.Warning(str) - case NOTICE: - s.w.Notice(str) - case INFO: - s.w.Info(str) - case DEBUG: - s.w.Debug(str) - case TRACE: - s.w.Debug(str) - default: - panic("Unhandled loglevel") - } - } -} - -func (s *syslogFormatter) Flush() { -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/.gitignore b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/.gitignore deleted file mode 100644 index 80bed650ec03..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -bin - - diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/.travis.yml b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/.travis.yml deleted file mode 100644 index 1027f56cd94d..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -script: - - go vet ./... - - go test -v ./... - -go: - - 1.3 - - 1.4 - - 1.5 - - 1.6 - - 1.7 - - tip diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/LICENSE b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/LICENSE deleted file mode 100644 index df83a9c2f019..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/LICENSE +++ /dev/null @@ -1,8 +0,0 @@ -Copyright (c) 2012 Dave Grijalva - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md deleted file mode 100644 index 7fc1f793cbc4..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md +++ /dev/null @@ -1,97 +0,0 @@ -## Migration Guide from v2 -> v3 - -Version 3 adds several new, frequently requested features. To do so, it introduces a few breaking changes. We've worked to keep these as minimal as possible. This guide explains the breaking changes and how you can quickly update your code. - -### `Token.Claims` is now an interface type - -The most requested feature from the 2.0 verison of this library was the ability to provide a custom type to the JSON parser for claims. This was implemented by introducing a new interface, `Claims`, to replace `map[string]interface{}`. We also included two concrete implementations of `Claims`: `MapClaims` and `StandardClaims`. - -`MapClaims` is an alias for `map[string]interface{}` with built in validation behavior. It is the default claims type when using `Parse`. The usage is unchanged except you must type cast the claims property. - -The old example for parsing a token looked like this.. - -```go - if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil { - fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"]) - } -``` - -is now directly mapped to... - -```go - if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil { - claims := token.Claims.(jwt.MapClaims) - fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"]) - } -``` - -`StandardClaims` is designed to be embedded in your custom type. You can supply a custom claims type with the new `ParseWithClaims` function. Here's an example of using a custom claims type. - -```go - type MyCustomClaims struct { - User string - *StandardClaims - } - - if token, err := jwt.ParseWithClaims(tokenString, &MyCustomClaims{}, keyLookupFunc); err == nil { - claims := token.Claims.(*MyCustomClaims) - fmt.Printf("Token for user %v expires %v", claims.User, claims.StandardClaims.ExpiresAt) - } -``` - -### `ParseFromRequest` has been moved - -To keep this library focused on the tokens without becoming overburdened with complex request processing logic, `ParseFromRequest` and its new companion `ParseFromRequestWithClaims` have been moved to a subpackage, `request`. The method signatues have also been augmented to receive a new argument: `Extractor`. - -`Extractors` do the work of picking the token string out of a request. The interface is simple and composable. - -This simple parsing example: - -```go - if token, err := jwt.ParseFromRequest(tokenString, req, keyLookupFunc); err == nil { - fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"]) - } -``` - -is directly mapped to: - -```go - if token, err := request.ParseFromRequest(req, request.OAuth2Extractor, keyLookupFunc); err == nil { - claims := token.Claims.(jwt.MapClaims) - fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"]) - } -``` - -There are several concrete `Extractor` types provided for your convenience: - -* `HeaderExtractor` will search a list of headers until one contains content. -* `ArgumentExtractor` will search a list of keys in request query and form arguments until one contains content. -* `MultiExtractor` will try a list of `Extractors` in order until one returns content. -* `AuthorizationHeaderExtractor` will look in the `Authorization` header for a `Bearer` token. -* `OAuth2Extractor` searches the places an OAuth2 token would be specified (per the spec): `Authorization` header and `access_token` argument -* `PostExtractionFilter` wraps an `Extractor`, allowing you to process the content before it's parsed. A simple example is stripping the `Bearer ` text from a header - - -### RSA signing methods no longer accept `[]byte` keys - -Due to a [critical vulnerability](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/), we've decided the convenience of accepting `[]byte` instead of `rsa.PublicKey` or `rsa.PrivateKey` isn't worth the risk of misuse. - -To replace this behavior, we've added two helper methods: `ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error)` and `ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error)`. These are just simple helpers for unpacking PEM encoded PKCS1 and PKCS8 keys. If your keys are encoded any other way, all you need to do is convert them to the `crypto/rsa` package's types. - -```go - func keyLookupFunc(*Token) (interface{}, error) { - // Don't forget to validate the alg is what you expect: - if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { - return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"]) - } - - // Look up key - key, err := lookupPublicKey(token.Header["kid"]) - if err != nil { - return nil, err - } - - // Unpack key from PEM encoded PKCS8 - return jwt.ParseRSAPublicKeyFromPEM(key) - } -``` diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/README.md b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/README.md deleted file mode 100644 index d358d881b8dd..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# jwt-go - -[![Build Status](https://travis-ci.org/dgrijalva/jwt-go.svg?branch=master)](https://travis-ci.org/dgrijalva/jwt-go) -[![GoDoc](https://godoc.org/github.com/dgrijalva/jwt-go?status.svg)](https://godoc.org/github.com/dgrijalva/jwt-go) - -A [go](http://www.golang.org) (or 'golang' for search engine friendliness) implementation of [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html) - -**NEW VERSION COMING:** There have been a lot of improvements suggested since the version 3.0.0 released in 2016. I'm working now on cutting two different releases: 3.2.0 will contain any non-breaking changes or enhancements. 4.0.0 will follow shortly which will include breaking changes. See the 4.0.0 milestone to get an idea of what's coming. If you have other ideas, or would like to participate in 4.0.0, now's the time. If you depend on this library and don't want to be interrupted, I recommend you use your dependency mangement tool to pin to version 3. - -**SECURITY NOTICE:** Some older versions of Go have a security issue in the cryotp/elliptic. Recommendation is to upgrade to at least 1.8.3. See issue #216 for more detail. - -**SECURITY NOTICE:** It's important that you [validate the `alg` presented is what you expect](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/). This library attempts to make it easy to do the right thing by requiring key types match the expected alg, but you should take the extra step to verify it in your usage. See the examples provided. - -## What the heck is a JWT? - -JWT.io has [a great introduction](https://jwt.io/introduction) to JSON Web Tokens. - -In short, it's a signed JSON object that does something useful (for example, authentication). It's commonly used for `Bearer` tokens in Oauth 2. A token is made of three parts, separated by `.`'s. The first two parts are JSON objects, that have been [base64url](http://tools.ietf.org/html/rfc4648) encoded. The last part is the signature, encoded the same way. - -The first part is called the header. It contains the necessary information for verifying the last part, the signature. For example, which encryption method was used for signing and what key was used. - -The part in the middle is the interesting bit. It's called the Claims and contains the actual stuff you care about. Refer to [the RFC](http://self-issued.info/docs/draft-jones-json-web-token.html) for information about reserved keys and the proper way to add your own. - -## What's in the box? - -This library supports the parsing and verification as well as the generation and signing of JWTs. Current supported signing algorithms are HMAC SHA, RSA, RSA-PSS, and ECDSA, though hooks are present for adding your own. - -## Examples - -See [the project documentation](https://godoc.org/github.com/dgrijalva/jwt-go) for examples of usage: - -* [Simple example of parsing and validating a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-Parse--Hmac) -* [Simple example of building and signing a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-New--Hmac) -* [Directory of Examples](https://godoc.org/github.com/dgrijalva/jwt-go#pkg-examples) - -## Extensions - -This library publishes all the necessary components for adding your own signing methods. Simply implement the `SigningMethod` interface and register a factory method using `RegisterSigningMethod`. - -Here's an example of an extension that integrates with the Google App Engine signing tools: https://github.com/someone1/gcp-jwt-go - -## Compliance - -This library was last reviewed to comply with [RTF 7519](http://www.rfc-editor.org/info/rfc7519) dated May 2015 with a few notable differences: - -* In order to protect against accidental use of [Unsecured JWTs](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#UnsecuredJWT), tokens using `alg=none` will only be accepted if the constant `jwt.UnsafeAllowNoneSignatureType` is provided as the key. - -## Project Status & Versioning - -This library is considered production ready. Feedback and feature requests are appreciated. The API should be considered stable. There should be very few backwards-incompatible changes outside of major version updates (and only with good reason). - -This project uses [Semantic Versioning 2.0.0](http://semver.org). Accepted pull requests will land on `master`. Periodically, versions will be tagged from `master`. You can find all the releases on [the project releases page](https://github.com/dgrijalva/jwt-go/releases). - -While we try to make it obvious when we make breaking changes, there isn't a great mechanism for pushing announcements out to users. You may want to use this alternative package include: `gopkg.in/dgrijalva/jwt-go.v3`. It will do the right thing WRT semantic versioning. - -**BREAKING CHANGES:*** -* Version 3.0.0 includes _a lot_ of changes from the 2.x line, including a few that break the API. We've tried to break as few things as possible, so there should just be a few type signature changes. A full list of breaking changes is available in `VERSION_HISTORY.md`. See `MIGRATION_GUIDE.md` for more information on updating your code. - -## Usage Tips - -### Signing vs Encryption - -A token is simply a JSON object that is signed by its author. this tells you exactly two things about the data: - -* The author of the token was in the possession of the signing secret -* The data has not been modified since it was signed - -It's important to know that JWT does not provide encryption, which means anyone who has access to the token can read its contents. If you need to protect (encrypt) the data, there is a companion spec, `JWE`, that provides this functionality. JWE is currently outside the scope of this library. - -### Choosing a Signing Method - -There are several signing methods available, and you should probably take the time to learn about the various options before choosing one. The principal design decision is most likely going to be symmetric vs asymmetric. - -Symmetric signing methods, such as HSA, use only a single secret. This is probably the simplest signing method to use since any `[]byte` can be used as a valid secret. They are also slightly computationally faster to use, though this rarely is enough to matter. Symmetric signing methods work the best when both producers and consumers of tokens are trusted, or even the same system. Since the same secret is used to both sign and validate tokens, you can't easily distribute the key for validation. - -Asymmetric signing methods, such as RSA, use different keys for signing and verifying tokens. This makes it possible to produce tokens with a private key, and allow any consumer to access the public key for verification. - -### Signing Methods and Key Types - -Each signing method expects a different object type for its signing keys. See the package documentation for details. Here are the most common ones: - -* The [HMAC signing method](https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethodHMAC) (`HS256`,`HS384`,`HS512`) expect `[]byte` values for signing and validation -* The [RSA signing method](https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethodRSA) (`RS256`,`RS384`,`RS512`) expect `*rsa.PrivateKey` for signing and `*rsa.PublicKey` for validation -* The [ECDSA signing method](https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethodECDSA) (`ES256`,`ES384`,`ES512`) expect `*ecdsa.PrivateKey` for signing and `*ecdsa.PublicKey` for validation - -### JWT and OAuth - -It's worth mentioning that OAuth and JWT are not the same thing. A JWT token is simply a signed JSON object. It can be used anywhere such a thing is useful. There is some confusion, though, as JWT is the most common type of bearer token used in OAuth2 authentication. - -Without going too far down the rabbit hole, here's a description of the interaction of these technologies: - -* OAuth is a protocol for allowing an identity provider to be separate from the service a user is logging in to. For example, whenever you use Facebook to log into a different service (Yelp, Spotify, etc), you are using OAuth. -* OAuth defines several options for passing around authentication data. One popular method is called a "bearer token". A bearer token is simply a string that _should_ only be held by an authenticated user. Thus, simply presenting this token proves your identity. You can probably derive from here why a JWT might make a good bearer token. -* Because bearer tokens are used for authentication, it's important they're kept secret. This is why transactions that use bearer tokens typically happen over SSL. - -## More - -Documentation can be found [on godoc.org](http://godoc.org/github.com/dgrijalva/jwt-go). - -The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration. You'll also find several implementation examples in the documentation. diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md deleted file mode 100644 index 6370298313a6..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md +++ /dev/null @@ -1,118 +0,0 @@ -## `jwt-go` Version History - -#### 3.2.0 - -* Added method `ParseUnverified` to allow users to split up the tasks of parsing and validation -* HMAC signing method returns `ErrInvalidKeyType` instead of `ErrInvalidKey` where appropriate -* Added options to `request.ParseFromRequest`, which allows for an arbitrary list of modifiers to parsing behavior. Initial set include `WithClaims` and `WithParser`. Existing usage of this function will continue to work as before. -* Deprecated `ParseFromRequestWithClaims` to simplify API in the future. - -#### 3.1.0 - -* Improvements to `jwt` command line tool -* Added `SkipClaimsValidation` option to `Parser` -* Documentation updates - -#### 3.0.0 - -* **Compatibility Breaking Changes**: See MIGRATION_GUIDE.md for tips on updating your code - * Dropped support for `[]byte` keys when using RSA signing methods. This convenience feature could contribute to security vulnerabilities involving mismatched key types with signing methods. - * `ParseFromRequest` has been moved to `request` subpackage and usage has changed - * The `Claims` property on `Token` is now type `Claims` instead of `map[string]interface{}`. The default value is type `MapClaims`, which is an alias to `map[string]interface{}`. This makes it possible to use a custom type when decoding claims. -* Other Additions and Changes - * Added `Claims` interface type to allow users to decode the claims into a custom type - * Added `ParseWithClaims`, which takes a third argument of type `Claims`. Use this function instead of `Parse` if you have a custom type you'd like to decode into. - * Dramatically improved the functionality and flexibility of `ParseFromRequest`, which is now in the `request` subpackage - * Added `ParseFromRequestWithClaims` which is the `FromRequest` equivalent of `ParseWithClaims` - * Added new interface type `Extractor`, which is used for extracting JWT strings from http requests. Used with `ParseFromRequest` and `ParseFromRequestWithClaims`. - * Added several new, more specific, validation errors to error type bitmask - * Moved examples from README to executable example files - * Signing method registry is now thread safe - * Added new property to `ValidationError`, which contains the raw error returned by calls made by parse/verify (such as those returned by keyfunc or json parser) - -#### 2.7.0 - -This will likely be the last backwards compatible release before 3.0.0, excluding essential bug fixes. - -* Added new option `-show` to the `jwt` command that will just output the decoded token without verifying -* Error text for expired tokens includes how long it's been expired -* Fixed incorrect error returned from `ParseRSAPublicKeyFromPEM` -* Documentation updates - -#### 2.6.0 - -* Exposed inner error within ValidationError -* Fixed validation errors when using UseJSONNumber flag -* Added several unit tests - -#### 2.5.0 - -* Added support for signing method none. You shouldn't use this. The API tries to make this clear. -* Updated/fixed some documentation -* Added more helpful error message when trying to parse tokens that begin with `BEARER ` - -#### 2.4.0 - -* Added new type, Parser, to allow for configuration of various parsing parameters - * You can now specify a list of valid signing methods. Anything outside this set will be rejected. - * You can now opt to use the `json.Number` type instead of `float64` when parsing token JSON -* Added support for [Travis CI](https://travis-ci.org/dgrijalva/jwt-go) -* Fixed some bugs with ECDSA parsing - -#### 2.3.0 - -* Added support for ECDSA signing methods -* Added support for RSA PSS signing methods (requires go v1.4) - -#### 2.2.0 - -* Gracefully handle a `nil` `Keyfunc` being passed to `Parse`. Result will now be the parsed token and an error, instead of a panic. - -#### 2.1.0 - -Backwards compatible API change that was missed in 2.0.0. - -* The `SignedString` method on `Token` now takes `interface{}` instead of `[]byte` - -#### 2.0.0 - -There were two major reasons for breaking backwards compatibility with this update. The first was a refactor required to expand the width of the RSA and HMAC-SHA signing implementations. There will likely be no required code changes to support this change. - -The second update, while unfortunately requiring a small change in integration, is required to open up this library to other signing methods. Not all keys used for all signing methods have a single standard on-disk representation. Requiring `[]byte` as the type for all keys proved too limiting. Additionally, this implementation allows for pre-parsed tokens to be reused, which might matter in an application that parses a high volume of tokens with a small set of keys. Backwards compatibilty has been maintained for passing `[]byte` to the RSA signing methods, but they will also accept `*rsa.PublicKey` and `*rsa.PrivateKey`. - -It is likely the only integration change required here will be to change `func(t *jwt.Token) ([]byte, error)` to `func(t *jwt.Token) (interface{}, error)` when calling `Parse`. - -* **Compatibility Breaking Changes** - * `SigningMethodHS256` is now `*SigningMethodHMAC` instead of `type struct` - * `SigningMethodRS256` is now `*SigningMethodRSA` instead of `type struct` - * `KeyFunc` now returns `interface{}` instead of `[]byte` - * `SigningMethod.Sign` now takes `interface{}` instead of `[]byte` for the key - * `SigningMethod.Verify` now takes `interface{}` instead of `[]byte` for the key -* Renamed type `SigningMethodHS256` to `SigningMethodHMAC`. Specific sizes are now just instances of this type. - * Added public package global `SigningMethodHS256` - * Added public package global `SigningMethodHS384` - * Added public package global `SigningMethodHS512` -* Renamed type `SigningMethodRS256` to `SigningMethodRSA`. Specific sizes are now just instances of this type. - * Added public package global `SigningMethodRS256` - * Added public package global `SigningMethodRS384` - * Added public package global `SigningMethodRS512` -* Moved sample private key for HMAC tests from an inline value to a file on disk. Value is unchanged. -* Refactored the RSA implementation to be easier to read -* Exposed helper methods `ParseRSAPrivateKeyFromPEM` and `ParseRSAPublicKeyFromPEM` - -#### 1.0.2 - -* Fixed bug in parsing public keys from certificates -* Added more tests around the parsing of keys for RS256 -* Code refactoring in RS256 implementation. No functional changes - -#### 1.0.1 - -* Fixed panic if RS256 signing method was passed an invalid key - -#### 1.0.0 - -* First versioned release -* API stabilized -* Supports creating, signing, parsing, and validating JWT tokens -* Supports RS256 and HS256 signing methods \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/claims.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/claims.go deleted file mode 100644 index f0228f02e033..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/claims.go +++ /dev/null @@ -1,134 +0,0 @@ -package jwt - -import ( - "crypto/subtle" - "fmt" - "time" -) - -// For a type to be a Claims object, it must just have a Valid method that determines -// if the token is invalid for any supported reason -type Claims interface { - Valid() error -} - -// Structured version of Claims Section, as referenced at -// https://tools.ietf.org/html/rfc7519#section-4.1 -// See examples for how to use this with your own claim types -type StandardClaims struct { - Audience string `json:"aud,omitempty"` - ExpiresAt int64 `json:"exp,omitempty"` - Id string `json:"jti,omitempty"` - IssuedAt int64 `json:"iat,omitempty"` - Issuer string `json:"iss,omitempty"` - NotBefore int64 `json:"nbf,omitempty"` - Subject string `json:"sub,omitempty"` -} - -// Validates time based claims "exp, iat, nbf". -// There is no accounting for clock skew. -// As well, if any of the above claims are not in the token, it will still -// be considered a valid claim. -func (c StandardClaims) Valid() error { - vErr := new(ValidationError) - now := TimeFunc().Unix() - - // The claims below are optional, by default, so if they are set to the - // default value in Go, let's not fail the verification for them. - if c.VerifyExpiresAt(now, false) == false { - delta := time.Unix(now, 0).Sub(time.Unix(c.ExpiresAt, 0)) - vErr.Inner = fmt.Errorf("token is expired by %v", delta) - vErr.Errors |= ValidationErrorExpired - } - - if c.VerifyIssuedAt(now, false) == false { - vErr.Inner = fmt.Errorf("Token used before issued") - vErr.Errors |= ValidationErrorIssuedAt - } - - if c.VerifyNotBefore(now, false) == false { - vErr.Inner = fmt.Errorf("token is not valid yet") - vErr.Errors |= ValidationErrorNotValidYet - } - - if vErr.valid() { - return nil - } - - return vErr -} - -// Compares the aud claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool { - return verifyAud(c.Audience, cmp, req) -} - -// Compares the exp claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool { - return verifyExp(c.ExpiresAt, cmp, req) -} - -// Compares the iat claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool { - return verifyIat(c.IssuedAt, cmp, req) -} - -// Compares the iss claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool { - return verifyIss(c.Issuer, cmp, req) -} - -// Compares the nbf claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool { - return verifyNbf(c.NotBefore, cmp, req) -} - -// ----- helpers - -func verifyAud(aud string, cmp string, required bool) bool { - if aud == "" { - return !required - } - if subtle.ConstantTimeCompare([]byte(aud), []byte(cmp)) != 0 { - return true - } else { - return false - } -} - -func verifyExp(exp int64, now int64, required bool) bool { - if exp == 0 { - return !required - } - return now <= exp -} - -func verifyIat(iat int64, now int64, required bool) bool { - if iat == 0 { - return !required - } - return now >= iat -} - -func verifyIss(iss string, cmp string, required bool) bool { - if iss == "" { - return !required - } - if subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 { - return true - } else { - return false - } -} - -func verifyNbf(nbf int64, now int64, required bool) bool { - if nbf == 0 { - return !required - } - return now >= nbf -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/doc.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/doc.go deleted file mode 100644 index a86dc1a3b348..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html -// -// See README.md for more info. -package jwt diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/ecdsa.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/ecdsa.go deleted file mode 100644 index f977381240e3..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/ecdsa.go +++ /dev/null @@ -1,148 +0,0 @@ -package jwt - -import ( - "crypto" - "crypto/ecdsa" - "crypto/rand" - "errors" - "math/big" -) - -var ( - // Sadly this is missing from crypto/ecdsa compared to crypto/rsa - ErrECDSAVerification = errors.New("crypto/ecdsa: verification error") -) - -// Implements the ECDSA family of signing methods signing methods -// Expects *ecdsa.PrivateKey for signing and *ecdsa.PublicKey for verification -type SigningMethodECDSA struct { - Name string - Hash crypto.Hash - KeySize int - CurveBits int -} - -// Specific instances for EC256 and company -var ( - SigningMethodES256 *SigningMethodECDSA - SigningMethodES384 *SigningMethodECDSA - SigningMethodES512 *SigningMethodECDSA -) - -func init() { - // ES256 - SigningMethodES256 = &SigningMethodECDSA{"ES256", crypto.SHA256, 32, 256} - RegisterSigningMethod(SigningMethodES256.Alg(), func() SigningMethod { - return SigningMethodES256 - }) - - // ES384 - SigningMethodES384 = &SigningMethodECDSA{"ES384", crypto.SHA384, 48, 384} - RegisterSigningMethod(SigningMethodES384.Alg(), func() SigningMethod { - return SigningMethodES384 - }) - - // ES512 - SigningMethodES512 = &SigningMethodECDSA{"ES512", crypto.SHA512, 66, 521} - RegisterSigningMethod(SigningMethodES512.Alg(), func() SigningMethod { - return SigningMethodES512 - }) -} - -func (m *SigningMethodECDSA) Alg() string { - return m.Name -} - -// Implements the Verify method from SigningMethod -// For this verify method, key must be an ecdsa.PublicKey struct -func (m *SigningMethodECDSA) Verify(signingString, signature string, key interface{}) error { - var err error - - // Decode the signature - var sig []byte - if sig, err = DecodeSegment(signature); err != nil { - return err - } - - // Get the key - var ecdsaKey *ecdsa.PublicKey - switch k := key.(type) { - case *ecdsa.PublicKey: - ecdsaKey = k - default: - return ErrInvalidKeyType - } - - if len(sig) != 2*m.KeySize { - return ErrECDSAVerification - } - - r := big.NewInt(0).SetBytes(sig[:m.KeySize]) - s := big.NewInt(0).SetBytes(sig[m.KeySize:]) - - // Create hasher - if !m.Hash.Available() { - return ErrHashUnavailable - } - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Verify the signature - if verifystatus := ecdsa.Verify(ecdsaKey, hasher.Sum(nil), r, s); verifystatus == true { - return nil - } else { - return ErrECDSAVerification - } -} - -// Implements the Sign method from SigningMethod -// For this signing method, key must be an ecdsa.PrivateKey struct -func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) (string, error) { - // Get the key - var ecdsaKey *ecdsa.PrivateKey - switch k := key.(type) { - case *ecdsa.PrivateKey: - ecdsaKey = k - default: - return "", ErrInvalidKeyType - } - - // Create the hasher - if !m.Hash.Available() { - return "", ErrHashUnavailable - } - - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Sign the string and return r, s - if r, s, err := ecdsa.Sign(rand.Reader, ecdsaKey, hasher.Sum(nil)); err == nil { - curveBits := ecdsaKey.Curve.Params().BitSize - - if m.CurveBits != curveBits { - return "", ErrInvalidKey - } - - keyBytes := curveBits / 8 - if curveBits%8 > 0 { - keyBytes += 1 - } - - // We serialize the outpus (r and s) into big-endian byte arrays and pad - // them with zeros on the left to make sure the sizes work out. Both arrays - // must be keyBytes long, and the output must be 2*keyBytes long. - rBytes := r.Bytes() - rBytesPadded := make([]byte, keyBytes) - copy(rBytesPadded[keyBytes-len(rBytes):], rBytes) - - sBytes := s.Bytes() - sBytesPadded := make([]byte, keyBytes) - copy(sBytesPadded[keyBytes-len(sBytes):], sBytes) - - out := append(rBytesPadded, sBytesPadded...) - - return EncodeSegment(out), nil - } else { - return "", err - } -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go deleted file mode 100644 index d19624b7264f..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go +++ /dev/null @@ -1,67 +0,0 @@ -package jwt - -import ( - "crypto/ecdsa" - "crypto/x509" - "encoding/pem" - "errors" -) - -var ( - ErrNotECPublicKey = errors.New("Key is not a valid ECDSA public key") - ErrNotECPrivateKey = errors.New("Key is not a valid ECDSA private key") -) - -// Parse PEM encoded Elliptic Curve Private Key Structure -func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - // Parse the key - var parsedKey interface{} - if parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil { - return nil, err - } - - var pkey *ecdsa.PrivateKey - var ok bool - if pkey, ok = parsedKey.(*ecdsa.PrivateKey); !ok { - return nil, ErrNotECPrivateKey - } - - return pkey, nil -} - -// Parse PEM encoded PKCS1 or PKCS8 public key -func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - // Parse the key - var parsedKey interface{} - if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { - if cert, err := x509.ParseCertificate(block.Bytes); err == nil { - parsedKey = cert.PublicKey - } else { - return nil, err - } - } - - var pkey *ecdsa.PublicKey - var ok bool - if pkey, ok = parsedKey.(*ecdsa.PublicKey); !ok { - return nil, ErrNotECPublicKey - } - - return pkey, nil -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/errors.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/errors.go deleted file mode 100644 index 1c93024aad2e..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/errors.go +++ /dev/null @@ -1,59 +0,0 @@ -package jwt - -import ( - "errors" -) - -// Error constants -var ( - ErrInvalidKey = errors.New("key is invalid") - ErrInvalidKeyType = errors.New("key is of invalid type") - ErrHashUnavailable = errors.New("the requested hash function is unavailable") -) - -// The errors that might occur when parsing and validating a token -const ( - ValidationErrorMalformed uint32 = 1 << iota // Token is malformed - ValidationErrorUnverifiable // Token could not be verified because of signing problems - ValidationErrorSignatureInvalid // Signature validation failed - - // Standard Claim validation errors - ValidationErrorAudience // AUD validation failed - ValidationErrorExpired // EXP validation failed - ValidationErrorIssuedAt // IAT validation failed - ValidationErrorIssuer // ISS validation failed - ValidationErrorNotValidYet // NBF validation failed - ValidationErrorId // JTI validation failed - ValidationErrorClaimsInvalid // Generic claims validation error -) - -// Helper for constructing a ValidationError with a string error message -func NewValidationError(errorText string, errorFlags uint32) *ValidationError { - return &ValidationError{ - text: errorText, - Errors: errorFlags, - } -} - -// The error from Parse if token is not valid -type ValidationError struct { - Inner error // stores the error returned by external dependencies, i.e.: KeyFunc - Errors uint32 // bitfield. see ValidationError... constants - text string // errors that do not have a valid error just have text -} - -// Validation error is an error type -func (e ValidationError) Error() string { - if e.Inner != nil { - return e.Inner.Error() - } else if e.text != "" { - return e.text - } else { - return "token is invalid" - } -} - -// No errors -func (e *ValidationError) valid() bool { - return e.Errors == 0 -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/hmac.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/hmac.go deleted file mode 100644 index addbe5d40182..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/hmac.go +++ /dev/null @@ -1,95 +0,0 @@ -package jwt - -import ( - "crypto" - "crypto/hmac" - "errors" -) - -// Implements the HMAC-SHA family of signing methods signing methods -// Expects key type of []byte for both signing and validation -type SigningMethodHMAC struct { - Name string - Hash crypto.Hash -} - -// Specific instances for HS256 and company -var ( - SigningMethodHS256 *SigningMethodHMAC - SigningMethodHS384 *SigningMethodHMAC - SigningMethodHS512 *SigningMethodHMAC - ErrSignatureInvalid = errors.New("signature is invalid") -) - -func init() { - // HS256 - SigningMethodHS256 = &SigningMethodHMAC{"HS256", crypto.SHA256} - RegisterSigningMethod(SigningMethodHS256.Alg(), func() SigningMethod { - return SigningMethodHS256 - }) - - // HS384 - SigningMethodHS384 = &SigningMethodHMAC{"HS384", crypto.SHA384} - RegisterSigningMethod(SigningMethodHS384.Alg(), func() SigningMethod { - return SigningMethodHS384 - }) - - // HS512 - SigningMethodHS512 = &SigningMethodHMAC{"HS512", crypto.SHA512} - RegisterSigningMethod(SigningMethodHS512.Alg(), func() SigningMethod { - return SigningMethodHS512 - }) -} - -func (m *SigningMethodHMAC) Alg() string { - return m.Name -} - -// Verify the signature of HSXXX tokens. Returns nil if the signature is valid. -func (m *SigningMethodHMAC) Verify(signingString, signature string, key interface{}) error { - // Verify the key is the right type - keyBytes, ok := key.([]byte) - if !ok { - return ErrInvalidKeyType - } - - // Decode signature, for comparison - sig, err := DecodeSegment(signature) - if err != nil { - return err - } - - // Can we use the specified hashing method? - if !m.Hash.Available() { - return ErrHashUnavailable - } - - // This signing method is symmetric, so we validate the signature - // by reproducing the signature from the signing string and key, then - // comparing that against the provided signature. - hasher := hmac.New(m.Hash.New, keyBytes) - hasher.Write([]byte(signingString)) - if !hmac.Equal(sig, hasher.Sum(nil)) { - return ErrSignatureInvalid - } - - // No validation errors. Signature is good. - return nil -} - -// Implements the Sign method from SigningMethod for this signing method. -// Key must be []byte -func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) (string, error) { - if keyBytes, ok := key.([]byte); ok { - if !m.Hash.Available() { - return "", ErrHashUnavailable - } - - hasher := hmac.New(m.Hash.New, keyBytes) - hasher.Write([]byte(signingString)) - - return EncodeSegment(hasher.Sum(nil)), nil - } - - return "", ErrInvalidKeyType -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/map_claims.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/map_claims.go deleted file mode 100644 index 291213c460d4..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/map_claims.go +++ /dev/null @@ -1,94 +0,0 @@ -package jwt - -import ( - "encoding/json" - "errors" - // "fmt" -) - -// Claims type that uses the map[string]interface{} for JSON decoding -// This is the default claims type if you don't supply one -type MapClaims map[string]interface{} - -// Compares the aud claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyAudience(cmp string, req bool) bool { - aud, _ := m["aud"].(string) - return verifyAud(aud, cmp, req) -} - -// Compares the exp claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool { - switch exp := m["exp"].(type) { - case float64: - return verifyExp(int64(exp), cmp, req) - case json.Number: - v, _ := exp.Int64() - return verifyExp(v, cmp, req) - } - return req == false -} - -// Compares the iat claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyIssuedAt(cmp int64, req bool) bool { - switch iat := m["iat"].(type) { - case float64: - return verifyIat(int64(iat), cmp, req) - case json.Number: - v, _ := iat.Int64() - return verifyIat(v, cmp, req) - } - return req == false -} - -// Compares the iss claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyIssuer(cmp string, req bool) bool { - iss, _ := m["iss"].(string) - return verifyIss(iss, cmp, req) -} - -// Compares the nbf claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyNotBefore(cmp int64, req bool) bool { - switch nbf := m["nbf"].(type) { - case float64: - return verifyNbf(int64(nbf), cmp, req) - case json.Number: - v, _ := nbf.Int64() - return verifyNbf(v, cmp, req) - } - return req == false -} - -// Validates time based claims "exp, iat, nbf". -// There is no accounting for clock skew. -// As well, if any of the above claims are not in the token, it will still -// be considered a valid claim. -func (m MapClaims) Valid() error { - vErr := new(ValidationError) - now := TimeFunc().Unix() - - if m.VerifyExpiresAt(now, false) == false { - vErr.Inner = errors.New("Token is expired") - vErr.Errors |= ValidationErrorExpired - } - - if m.VerifyIssuedAt(now, false) == false { - vErr.Inner = errors.New("Token used before issued") - vErr.Errors |= ValidationErrorIssuedAt - } - - if m.VerifyNotBefore(now, false) == false { - vErr.Inner = errors.New("Token is not valid yet") - vErr.Errors |= ValidationErrorNotValidYet - } - - if vErr.valid() { - return nil - } - - return vErr -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/none.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/none.go deleted file mode 100644 index f04d189d067b..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/none.go +++ /dev/null @@ -1,52 +0,0 @@ -package jwt - -// Implements the none signing method. This is required by the spec -// but you probably should never use it. -var SigningMethodNone *signingMethodNone - -const UnsafeAllowNoneSignatureType unsafeNoneMagicConstant = "none signing method allowed" - -var NoneSignatureTypeDisallowedError error - -type signingMethodNone struct{} -type unsafeNoneMagicConstant string - -func init() { - SigningMethodNone = &signingMethodNone{} - NoneSignatureTypeDisallowedError = NewValidationError("'none' signature type is not allowed", ValidationErrorSignatureInvalid) - - RegisterSigningMethod(SigningMethodNone.Alg(), func() SigningMethod { - return SigningMethodNone - }) -} - -func (m *signingMethodNone) Alg() string { - return "none" -} - -// Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key -func (m *signingMethodNone) Verify(signingString, signature string, key interface{}) (err error) { - // Key must be UnsafeAllowNoneSignatureType to prevent accidentally - // accepting 'none' signing method - if _, ok := key.(unsafeNoneMagicConstant); !ok { - return NoneSignatureTypeDisallowedError - } - // If signing method is none, signature must be an empty string - if signature != "" { - return NewValidationError( - "'none' signing method with non-empty signature", - ValidationErrorSignatureInvalid, - ) - } - - // Accept 'none' signing method. - return nil -} - -// Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key -func (m *signingMethodNone) Sign(signingString string, key interface{}) (string, error) { - if _, ok := key.(unsafeNoneMagicConstant); ok { - return "", nil - } - return "", NoneSignatureTypeDisallowedError -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/parser.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/parser.go deleted file mode 100644 index d6901d9adb52..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/parser.go +++ /dev/null @@ -1,148 +0,0 @@ -package jwt - -import ( - "bytes" - "encoding/json" - "fmt" - "strings" -) - -type Parser struct { - ValidMethods []string // If populated, only these methods will be considered valid - UseJSONNumber bool // Use JSON Number format in JSON decoder - SkipClaimsValidation bool // Skip claims validation during token parsing -} - -// Parse, validate, and return a token. -// keyFunc will receive the parsed token and should return the key for validating. -// If everything is kosher, err will be nil -func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { - return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc) -} - -func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) { - token, parts, err := p.ParseUnverified(tokenString, claims) - if err != nil { - return token, err - } - - // Verify signing method is in the required set - if p.ValidMethods != nil { - var signingMethodValid = false - var alg = token.Method.Alg() - for _, m := range p.ValidMethods { - if m == alg { - signingMethodValid = true - break - } - } - if !signingMethodValid { - // signing method is not in the listed set - return token, NewValidationError(fmt.Sprintf("signing method %v is invalid", alg), ValidationErrorSignatureInvalid) - } - } - - // Lookup key - var key interface{} - if keyFunc == nil { - // keyFunc was not provided. short circuiting validation - return token, NewValidationError("no Keyfunc was provided.", ValidationErrorUnverifiable) - } - if key, err = keyFunc(token); err != nil { - // keyFunc returned an error - if ve, ok := err.(*ValidationError); ok { - return token, ve - } - return token, &ValidationError{Inner: err, Errors: ValidationErrorUnverifiable} - } - - vErr := &ValidationError{} - - // Validate Claims - if !p.SkipClaimsValidation { - if err := token.Claims.Valid(); err != nil { - - // If the Claims Valid returned an error, check if it is a validation error, - // If it was another error type, create a ValidationError with a generic ClaimsInvalid flag set - if e, ok := err.(*ValidationError); !ok { - vErr = &ValidationError{Inner: err, Errors: ValidationErrorClaimsInvalid} - } else { - vErr = e - } - } - } - - // Perform validation - token.Signature = parts[2] - if err = token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil { - vErr.Inner = err - vErr.Errors |= ValidationErrorSignatureInvalid - } - - if vErr.valid() { - token.Valid = true - return token, nil - } - - return token, vErr -} - -// WARNING: Don't use this method unless you know what you're doing -// -// This method parses the token but doesn't validate the signature. It's only -// ever useful in cases where you know the signature is valid (because it has -// been checked previously in the stack) and you want to extract values from -// it. -func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error) { - parts = strings.Split(tokenString, ".") - if len(parts) != 3 { - return nil, parts, NewValidationError("token contains an invalid number of segments", ValidationErrorMalformed) - } - - token = &Token{Raw: tokenString} - - // parse Header - var headerBytes []byte - if headerBytes, err = DecodeSegment(parts[0]); err != nil { - if strings.HasPrefix(strings.ToLower(tokenString), "bearer ") { - return token, parts, NewValidationError("tokenstring should not contain 'bearer '", ValidationErrorMalformed) - } - return token, parts, &ValidationError{Inner: err, Errors: ValidationErrorMalformed} - } - if err = json.Unmarshal(headerBytes, &token.Header); err != nil { - return token, parts, &ValidationError{Inner: err, Errors: ValidationErrorMalformed} - } - - // parse Claims - var claimBytes []byte - token.Claims = claims - - if claimBytes, err = DecodeSegment(parts[1]); err != nil { - return token, parts, &ValidationError{Inner: err, Errors: ValidationErrorMalformed} - } - dec := json.NewDecoder(bytes.NewBuffer(claimBytes)) - if p.UseJSONNumber { - dec.UseNumber() - } - // JSON Decode. Special case for map type to avoid weird pointer behavior - if c, ok := token.Claims.(MapClaims); ok { - err = dec.Decode(&c) - } else { - err = dec.Decode(&claims) - } - // Handle decode error - if err != nil { - return token, parts, &ValidationError{Inner: err, Errors: ValidationErrorMalformed} - } - - // Lookup signature method - if method, ok := token.Header["alg"].(string); ok { - if token.Method = GetSigningMethod(method); token.Method == nil { - return token, parts, NewValidationError("signing method (alg) is unavailable.", ValidationErrorUnverifiable) - } - } else { - return token, parts, NewValidationError("signing method (alg) is unspecified.", ValidationErrorUnverifiable) - } - - return token, parts, nil -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa.go deleted file mode 100644 index e4caf1ca4a11..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa.go +++ /dev/null @@ -1,101 +0,0 @@ -package jwt - -import ( - "crypto" - "crypto/rand" - "crypto/rsa" -) - -// Implements the RSA family of signing methods signing methods -// Expects *rsa.PrivateKey for signing and *rsa.PublicKey for validation -type SigningMethodRSA struct { - Name string - Hash crypto.Hash -} - -// Specific instances for RS256 and company -var ( - SigningMethodRS256 *SigningMethodRSA - SigningMethodRS384 *SigningMethodRSA - SigningMethodRS512 *SigningMethodRSA -) - -func init() { - // RS256 - SigningMethodRS256 = &SigningMethodRSA{"RS256", crypto.SHA256} - RegisterSigningMethod(SigningMethodRS256.Alg(), func() SigningMethod { - return SigningMethodRS256 - }) - - // RS384 - SigningMethodRS384 = &SigningMethodRSA{"RS384", crypto.SHA384} - RegisterSigningMethod(SigningMethodRS384.Alg(), func() SigningMethod { - return SigningMethodRS384 - }) - - // RS512 - SigningMethodRS512 = &SigningMethodRSA{"RS512", crypto.SHA512} - RegisterSigningMethod(SigningMethodRS512.Alg(), func() SigningMethod { - return SigningMethodRS512 - }) -} - -func (m *SigningMethodRSA) Alg() string { - return m.Name -} - -// Implements the Verify method from SigningMethod -// For this signing method, must be an *rsa.PublicKey structure. -func (m *SigningMethodRSA) Verify(signingString, signature string, key interface{}) error { - var err error - - // Decode the signature - var sig []byte - if sig, err = DecodeSegment(signature); err != nil { - return err - } - - var rsaKey *rsa.PublicKey - var ok bool - - if rsaKey, ok = key.(*rsa.PublicKey); !ok { - return ErrInvalidKeyType - } - - // Create hasher - if !m.Hash.Available() { - return ErrHashUnavailable - } - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Verify the signature - return rsa.VerifyPKCS1v15(rsaKey, m.Hash, hasher.Sum(nil), sig) -} - -// Implements the Sign method from SigningMethod -// For this signing method, must be an *rsa.PrivateKey structure. -func (m *SigningMethodRSA) Sign(signingString string, key interface{}) (string, error) { - var rsaKey *rsa.PrivateKey - var ok bool - - // Validate type of key - if rsaKey, ok = key.(*rsa.PrivateKey); !ok { - return "", ErrInvalidKey - } - - // Create the hasher - if !m.Hash.Available() { - return "", ErrHashUnavailable - } - - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Sign the string and return the encoded bytes - if sigBytes, err := rsa.SignPKCS1v15(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil)); err == nil { - return EncodeSegment(sigBytes), nil - } else { - return "", err - } -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa_pss.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa_pss.go deleted file mode 100644 index 10ee9db8a4ed..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa_pss.go +++ /dev/null @@ -1,126 +0,0 @@ -// +build go1.4 - -package jwt - -import ( - "crypto" - "crypto/rand" - "crypto/rsa" -) - -// Implements the RSAPSS family of signing methods signing methods -type SigningMethodRSAPSS struct { - *SigningMethodRSA - Options *rsa.PSSOptions -} - -// Specific instances for RS/PS and company -var ( - SigningMethodPS256 *SigningMethodRSAPSS - SigningMethodPS384 *SigningMethodRSAPSS - SigningMethodPS512 *SigningMethodRSAPSS -) - -func init() { - // PS256 - SigningMethodPS256 = &SigningMethodRSAPSS{ - &SigningMethodRSA{ - Name: "PS256", - Hash: crypto.SHA256, - }, - &rsa.PSSOptions{ - SaltLength: rsa.PSSSaltLengthAuto, - Hash: crypto.SHA256, - }, - } - RegisterSigningMethod(SigningMethodPS256.Alg(), func() SigningMethod { - return SigningMethodPS256 - }) - - // PS384 - SigningMethodPS384 = &SigningMethodRSAPSS{ - &SigningMethodRSA{ - Name: "PS384", - Hash: crypto.SHA384, - }, - &rsa.PSSOptions{ - SaltLength: rsa.PSSSaltLengthAuto, - Hash: crypto.SHA384, - }, - } - RegisterSigningMethod(SigningMethodPS384.Alg(), func() SigningMethod { - return SigningMethodPS384 - }) - - // PS512 - SigningMethodPS512 = &SigningMethodRSAPSS{ - &SigningMethodRSA{ - Name: "PS512", - Hash: crypto.SHA512, - }, - &rsa.PSSOptions{ - SaltLength: rsa.PSSSaltLengthAuto, - Hash: crypto.SHA512, - }, - } - RegisterSigningMethod(SigningMethodPS512.Alg(), func() SigningMethod { - return SigningMethodPS512 - }) -} - -// Implements the Verify method from SigningMethod -// For this verify method, key must be an rsa.PublicKey struct -func (m *SigningMethodRSAPSS) Verify(signingString, signature string, key interface{}) error { - var err error - - // Decode the signature - var sig []byte - if sig, err = DecodeSegment(signature); err != nil { - return err - } - - var rsaKey *rsa.PublicKey - switch k := key.(type) { - case *rsa.PublicKey: - rsaKey = k - default: - return ErrInvalidKey - } - - // Create hasher - if !m.Hash.Available() { - return ErrHashUnavailable - } - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - return rsa.VerifyPSS(rsaKey, m.Hash, hasher.Sum(nil), sig, m.Options) -} - -// Implements the Sign method from SigningMethod -// For this signing method, key must be an rsa.PrivateKey struct -func (m *SigningMethodRSAPSS) Sign(signingString string, key interface{}) (string, error) { - var rsaKey *rsa.PrivateKey - - switch k := key.(type) { - case *rsa.PrivateKey: - rsaKey = k - default: - return "", ErrInvalidKeyType - } - - // Create the hasher - if !m.Hash.Available() { - return "", ErrHashUnavailable - } - - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Sign the string and return the encoded bytes - if sigBytes, err := rsa.SignPSS(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil), m.Options); err == nil { - return EncodeSegment(sigBytes), nil - } else { - return "", err - } -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa_utils.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa_utils.go deleted file mode 100644 index a5ababf956c4..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/rsa_utils.go +++ /dev/null @@ -1,101 +0,0 @@ -package jwt - -import ( - "crypto/rsa" - "crypto/x509" - "encoding/pem" - "errors" -) - -var ( - ErrKeyMustBePEMEncoded = errors.New("Invalid Key: Key must be PEM encoded PKCS1 or PKCS8 private key") - ErrNotRSAPrivateKey = errors.New("Key is not a valid RSA private key") - ErrNotRSAPublicKey = errors.New("Key is not a valid RSA public key") -) - -// Parse PEM encoded PKCS1 or PKCS8 private key -func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - var parsedKey interface{} - if parsedKey, err = x509.ParsePKCS1PrivateKey(block.Bytes); err != nil { - if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil { - return nil, err - } - } - - var pkey *rsa.PrivateKey - var ok bool - if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok { - return nil, ErrNotRSAPrivateKey - } - - return pkey, nil -} - -// Parse PEM encoded PKCS1 or PKCS8 private key protected with password -func ParseRSAPrivateKeyFromPEMWithPassword(key []byte, password string) (*rsa.PrivateKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - var parsedKey interface{} - - var blockDecrypted []byte - if blockDecrypted, err = x509.DecryptPEMBlock(block, []byte(password)); err != nil { - return nil, err - } - - if parsedKey, err = x509.ParsePKCS1PrivateKey(blockDecrypted); err != nil { - if parsedKey, err = x509.ParsePKCS8PrivateKey(blockDecrypted); err != nil { - return nil, err - } - } - - var pkey *rsa.PrivateKey - var ok bool - if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok { - return nil, ErrNotRSAPrivateKey - } - - return pkey, nil -} - -// Parse PEM encoded PKCS1 or PKCS8 public key -func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - // Parse the key - var parsedKey interface{} - if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { - if cert, err := x509.ParseCertificate(block.Bytes); err == nil { - parsedKey = cert.PublicKey - } else { - return nil, err - } - } - - var pkey *rsa.PublicKey - var ok bool - if pkey, ok = parsedKey.(*rsa.PublicKey); !ok { - return nil, ErrNotRSAPublicKey - } - - return pkey, nil -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/signing_method.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/signing_method.go deleted file mode 100644 index ed1f212b21e1..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/signing_method.go +++ /dev/null @@ -1,35 +0,0 @@ -package jwt - -import ( - "sync" -) - -var signingMethods = map[string]func() SigningMethod{} -var signingMethodLock = new(sync.RWMutex) - -// Implement SigningMethod to add new methods for signing or verifying tokens. -type SigningMethod interface { - Verify(signingString, signature string, key interface{}) error // Returns nil if signature is valid - Sign(signingString string, key interface{}) (string, error) // Returns encoded signature or error - Alg() string // returns the alg identifier for this method (example: 'HS256') -} - -// Register the "alg" name and a factory function for signing method. -// This is typically done during init() in the method's implementation -func RegisterSigningMethod(alg string, f func() SigningMethod) { - signingMethodLock.Lock() - defer signingMethodLock.Unlock() - - signingMethods[alg] = f -} - -// Get a signing method from an "alg" string -func GetSigningMethod(alg string) (method SigningMethod) { - signingMethodLock.RLock() - defer signingMethodLock.RUnlock() - - if methodF, ok := signingMethods[alg]; ok { - method = methodF() - } - return -} diff --git a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/token.go b/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/token.go deleted file mode 100644 index d637e0867c65..000000000000 --- a/cluster-autoscaler/vendor/github.com/dgrijalva/jwt-go/token.go +++ /dev/null @@ -1,108 +0,0 @@ -package jwt - -import ( - "encoding/base64" - "encoding/json" - "strings" - "time" -) - -// TimeFunc provides the current time when parsing token to validate "exp" claim (expiration time). -// You can override it to use another time value. This is useful for testing or if your -// server uses a different time zone than your tokens. -var TimeFunc = time.Now - -// Parse methods use this callback function to supply -// the key for verification. The function receives the parsed, -// but unverified Token. This allows you to use properties in the -// Header of the token (such as `kid`) to identify which key to use. -type Keyfunc func(*Token) (interface{}, error) - -// A JWT Token. Different fields will be used depending on whether you're -// creating or parsing/verifying a token. -type Token struct { - Raw string // The raw token. Populated when you Parse a token - Method SigningMethod // The signing method used or to be used - Header map[string]interface{} // The first segment of the token - Claims Claims // The second segment of the token - Signature string // The third segment of the token. Populated when you Parse a token - Valid bool // Is the token valid? Populated when you Parse/Verify a token -} - -// Create a new Token. Takes a signing method -func New(method SigningMethod) *Token { - return NewWithClaims(method, MapClaims{}) -} - -func NewWithClaims(method SigningMethod, claims Claims) *Token { - return &Token{ - Header: map[string]interface{}{ - "typ": "JWT", - "alg": method.Alg(), - }, - Claims: claims, - Method: method, - } -} - -// Get the complete, signed token -func (t *Token) SignedString(key interface{}) (string, error) { - var sig, sstr string - var err error - if sstr, err = t.SigningString(); err != nil { - return "", err - } - if sig, err = t.Method.Sign(sstr, key); err != nil { - return "", err - } - return strings.Join([]string{sstr, sig}, "."), nil -} - -// Generate the signing string. This is the -// most expensive part of the whole deal. Unless you -// need this for something special, just go straight for -// the SignedString. -func (t *Token) SigningString() (string, error) { - var err error - parts := make([]string, 2) - for i, _ := range parts { - var jsonValue []byte - if i == 0 { - if jsonValue, err = json.Marshal(t.Header); err != nil { - return "", err - } - } else { - if jsonValue, err = json.Marshal(t.Claims); err != nil { - return "", err - } - } - - parts[i] = EncodeSegment(jsonValue) - } - return strings.Join(parts, "."), nil -} - -// Parse, validate, and return a token. -// keyFunc will receive the parsed token and should return the key for validating. -// If everything is kosher, err will be nil -func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { - return new(Parser).Parse(tokenString, keyFunc) -} - -func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) { - return new(Parser).ParseWithClaims(tokenString, claims, keyFunc) -} - -// Encode JWT specific base64url encoding with padding stripped -func EncodeSegment(seg []byte) string { - return strings.TrimRight(base64.URLEncoding.EncodeToString(seg), "=") -} - -// Decode JWT specific base64url encoding with padding stripped -func DecodeSegment(seg string) ([]byte, error) { - if l := len(seg) % 4; l > 0 { - seg += strings.Repeat("=", 4-l) - } - - return base64.URLEncoding.DecodeString(seg) -} diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/.gitignore b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/.travis.yml b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/.travis.yml new file mode 100644 index 000000000000..bfc421200d0e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/.travis.yml @@ -0,0 +1,6 @@ +language: go + +go: + - 1.6 + - 1.7 + - 1.8 diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/LICENSE.txt b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/LICENSE.txt new file mode 100644 index 000000000000..e028b46a9b04 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2016 Felix Geisendörfer (felix@debuggable.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/Makefile b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/Makefile new file mode 100644 index 000000000000..2d84889aed79 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/Makefile @@ -0,0 +1,10 @@ +.PHONY: ci generate clean + +ci: clean generate + go test -v ./... + +generate: + go generate . + +clean: + rm -rf *_generated*.go diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/README.md b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/README.md new file mode 100644 index 000000000000..ae44137e9b04 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/README.md @@ -0,0 +1,94 @@ +# httpsnoop + +Package httpsnoop provides an easy way to capture http related metrics (i.e. +response time, bytes written, and http status code) from your application's +http.Handlers. + +Doing this requires non-trivial wrapping of the http.ResponseWriter interface, +which is also exposed for users interested in a more low-level API. + +[![GoDoc](https://godoc.org/github.com/felixge/httpsnoop?status.svg)](https://godoc.org/github.com/felixge/httpsnoop) +[![Build Status](https://travis-ci.org/felixge/httpsnoop.svg?branch=master)](https://travis-ci.org/felixge/httpsnoop) + +## Usage Example + +```go +// myH is your app's http handler, perhaps a http.ServeMux or similar. +var myH http.Handler +// wrappedH wraps myH in order to log every request. +wrappedH := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + m := httpsnoop.CaptureMetrics(myH, w, r) + log.Printf( + "%s %s (code=%d dt=%s written=%d)", + r.Method, + r.URL, + m.Code, + m.Duration, + m.Written, + ) +}) +http.ListenAndServe(":8080", wrappedH) +``` + +## Why this package exists + +Instrumenting an application's http.Handler is surprisingly difficult. + +However if you google for e.g. "capture ResponseWriter status code" you'll find +lots of advise and code examples that suggest it to be a fairly trivial +undertaking. Unfortunately everything I've seen so far has a high chance of +breaking your application. + +The main problem is that a `http.ResponseWriter` often implements additional +interfaces such as `http.Flusher`, `http.CloseNotifier`, `http.Hijacker`, `http.Pusher`, and +`io.ReaderFrom`. So the naive approach of just wrapping `http.ResponseWriter` +in your own struct that also implements the `http.ResponseWriter` interface +will hide the additional interfaces mentioned above. This has a high change of +introducing subtle bugs into any non-trivial application. + +Another approach I've seen people take is to return a struct that implements +all of the interfaces above. However, that's also problematic, because it's +difficult to fake some of these interfaces behaviors when the underlying +`http.ResponseWriter` doesn't have an implementation. It's also dangerous, +because an application may choose to operate differently, merely because it +detects the presence of these additional interfaces. + +This package solves this problem by checking which additional interfaces a +`http.ResponseWriter` implements, returning a wrapped version implementing the +exact same set of interfaces. + +Additionally this package properly handles edge cases such as `WriteHeader` not +being called, or called more than once, as well as concurrent calls to +`http.ResponseWriter` methods, and even calls happening after the wrapped +`ServeHTTP` has already returned. + +Unfortunately this package is not perfect either. It's possible that it is +still missing some interfaces provided by the go core (let me know if you find +one), and it won't work for applications adding their own interfaces into the +mix. + +However, hopefully the explanation above has sufficiently scared you of rolling +your own solution to this problem. httpsnoop may still break your application, +but at least it tries to avoid it as much as possible. + +Anyway, the real problem here is that smuggling additional interfaces inside +`http.ResponseWriter` is a problematic design choice, but it probably goes as +deep as the Go language specification itself. But that's okay, I still prefer +Go over the alternatives ;). + +## Performance + +``` +BenchmarkBaseline-8 20000 94912 ns/op +BenchmarkCaptureMetrics-8 20000 95461 ns/op +``` + +As you can see, using `CaptureMetrics` on a vanilla http.Handler introduces an +overhead of ~500 ns per http request on my machine. However, the margin of +error appears to be larger than that, therefor it should be reasonable to +assume that the overhead introduced by `CaptureMetrics` is absolutely +negligible. + +## License + +MIT diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/capture_metrics.go b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/capture_metrics.go new file mode 100644 index 000000000000..4c45b1a8c15f --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/capture_metrics.go @@ -0,0 +1,84 @@ +package httpsnoop + +import ( + "io" + "net/http" + "sync" + "time" +) + +// Metrics holds metrics captured from CaptureMetrics. +type Metrics struct { + // Code is the first http response code passed to the WriteHeader func of + // the ResponseWriter. If no such call is made, a default code of 200 is + // assumed instead. + Code int + // Duration is the time it took to execute the handler. + Duration time.Duration + // Written is the number of bytes successfully written by the Write or + // ReadFrom function of the ResponseWriter. ResponseWriters may also write + // data to their underlaying connection directly (e.g. headers), but those + // are not tracked. Therefor the number of Written bytes will usually match + // the size of the response body. + Written int64 +} + +// CaptureMetrics wraps the given hnd, executes it with the given w and r, and +// returns the metrics it captured from it. +func CaptureMetrics(hnd http.Handler, w http.ResponseWriter, r *http.Request) Metrics { + return CaptureMetricsFn(w, func(ww http.ResponseWriter) { + hnd.ServeHTTP(ww, r) + }) +} + +// CaptureMetricsFn wraps w and calls fn with the wrapped w and returns the +// resulting metrics. This is very similar to CaptureMetrics (which is just +// sugar on top of this func), but is a more usable interface if your +// application doesn't use the Go http.Handler interface. +func CaptureMetricsFn(w http.ResponseWriter, fn func(http.ResponseWriter)) Metrics { + var ( + start = time.Now() + m = Metrics{Code: http.StatusOK} + headerWritten bool + lock sync.Mutex + hooks = Hooks{ + WriteHeader: func(next WriteHeaderFunc) WriteHeaderFunc { + return func(code int) { + next(code) + lock.Lock() + defer lock.Unlock() + if !headerWritten { + m.Code = code + headerWritten = true + } + } + }, + + Write: func(next WriteFunc) WriteFunc { + return func(p []byte) (int, error) { + n, err := next(p) + lock.Lock() + defer lock.Unlock() + m.Written += int64(n) + headerWritten = true + return n, err + } + }, + + ReadFrom: func(next ReadFromFunc) ReadFromFunc { + return func(src io.Reader) (int64, error) { + n, err := next(src) + lock.Lock() + defer lock.Unlock() + headerWritten = true + m.Written += n + return n, err + } + }, + } + ) + + fn(Wrap(w, hooks)) + m.Duration = time.Since(start) + return m +} diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/docs.go b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/docs.go new file mode 100644 index 000000000000..203c35b3c6d1 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/docs.go @@ -0,0 +1,10 @@ +// Package httpsnoop provides an easy way to capture http related metrics (i.e. +// response time, bytes written, and http status code) from your application's +// http.Handlers. +// +// Doing this requires non-trivial wrapping of the http.ResponseWriter +// interface, which is also exposed for users interested in a more low-level +// API. +package httpsnoop + +//go:generate go run codegen/main.go diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/go.mod b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/go.mod new file mode 100644 index 000000000000..73b3946905ab --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/go.mod @@ -0,0 +1,3 @@ +module github.com/felixge/httpsnoop + +go 1.13 diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go new file mode 100644 index 000000000000..41a20da9eab4 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go @@ -0,0 +1,385 @@ +// +build go1.8 +// Code generated by "httpsnoop/codegen"; DO NOT EDIT + +package httpsnoop + +import ( + "bufio" + "io" + "net" + "net/http" +) + +// HeaderFunc is part of the http.ResponseWriter interface. +type HeaderFunc func() http.Header + +// WriteHeaderFunc is part of the http.ResponseWriter interface. +type WriteHeaderFunc func(code int) + +// WriteFunc is part of the http.ResponseWriter interface. +type WriteFunc func(b []byte) (int, error) + +// FlushFunc is part of the http.Flusher interface. +type FlushFunc func() + +// CloseNotifyFunc is part of the http.CloseNotifier interface. +type CloseNotifyFunc func() <-chan bool + +// HijackFunc is part of the http.Hijacker interface. +type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) + +// ReadFromFunc is part of the io.ReaderFrom interface. +type ReadFromFunc func(src io.Reader) (int64, error) + +// PushFunc is part of the http.Pusher interface. +type PushFunc func(target string, opts *http.PushOptions) error + +// Hooks defines a set of method interceptors for methods included in +// http.ResponseWriter as well as some others. You can think of them as +// middleware for the function calls they target. See Wrap for more details. +type Hooks struct { + Header func(HeaderFunc) HeaderFunc + WriteHeader func(WriteHeaderFunc) WriteHeaderFunc + Write func(WriteFunc) WriteFunc + Flush func(FlushFunc) FlushFunc + CloseNotify func(CloseNotifyFunc) CloseNotifyFunc + Hijack func(HijackFunc) HijackFunc + ReadFrom func(ReadFromFunc) ReadFromFunc + Push func(PushFunc) PushFunc +} + +// Wrap returns a wrapped version of w that provides the exact same interface +// as w. Specifically if w implements any combination of: +// +// - http.Flusher +// - http.CloseNotifier +// - http.Hijacker +// - io.ReaderFrom +// - http.Pusher +// +// The wrapped version will implement the exact same combination. If no hooks +// are set, the wrapped version also behaves exactly as w. Hooks targeting +// methods not supported by w are ignored. Any other hooks will intercept the +// method they target and may modify the call's arguments and/or return values. +// The CaptureMetrics implementation serves as a working example for how the +// hooks can be used. +func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { + rw := &rw{w: w, h: hooks} + _, i0 := w.(http.Flusher) + _, i1 := w.(http.CloseNotifier) + _, i2 := w.(http.Hijacker) + _, i3 := w.(io.ReaderFrom) + _, i4 := w.(http.Pusher) + switch { + // combination 1/32 + case !i0 && !i1 && !i2 && !i3 && !i4: + return struct { + http.ResponseWriter + }{rw} + // combination 2/32 + case !i0 && !i1 && !i2 && !i3 && i4: + return struct { + http.ResponseWriter + http.Pusher + }{rw, rw} + // combination 3/32 + case !i0 && !i1 && !i2 && i3 && !i4: + return struct { + http.ResponseWriter + io.ReaderFrom + }{rw, rw} + // combination 4/32 + case !i0 && !i1 && !i2 && i3 && i4: + return struct { + http.ResponseWriter + io.ReaderFrom + http.Pusher + }{rw, rw, rw} + // combination 5/32 + case !i0 && !i1 && i2 && !i3 && !i4: + return struct { + http.ResponseWriter + http.Hijacker + }{rw, rw} + // combination 6/32 + case !i0 && !i1 && i2 && !i3 && i4: + return struct { + http.ResponseWriter + http.Hijacker + http.Pusher + }{rw, rw, rw} + // combination 7/32 + case !i0 && !i1 && i2 && i3 && !i4: + return struct { + http.ResponseWriter + http.Hijacker + io.ReaderFrom + }{rw, rw, rw} + // combination 8/32 + case !i0 && !i1 && i2 && i3 && i4: + return struct { + http.ResponseWriter + http.Hijacker + io.ReaderFrom + http.Pusher + }{rw, rw, rw, rw} + // combination 9/32 + case !i0 && i1 && !i2 && !i3 && !i4: + return struct { + http.ResponseWriter + http.CloseNotifier + }{rw, rw} + // combination 10/32 + case !i0 && i1 && !i2 && !i3 && i4: + return struct { + http.ResponseWriter + http.CloseNotifier + http.Pusher + }{rw, rw, rw} + // combination 11/32 + case !i0 && i1 && !i2 && i3 && !i4: + return struct { + http.ResponseWriter + http.CloseNotifier + io.ReaderFrom + }{rw, rw, rw} + // combination 12/32 + case !i0 && i1 && !i2 && i3 && i4: + return struct { + http.ResponseWriter + http.CloseNotifier + io.ReaderFrom + http.Pusher + }{rw, rw, rw, rw} + // combination 13/32 + case !i0 && i1 && i2 && !i3 && !i4: + return struct { + http.ResponseWriter + http.CloseNotifier + http.Hijacker + }{rw, rw, rw} + // combination 14/32 + case !i0 && i1 && i2 && !i3 && i4: + return struct { + http.ResponseWriter + http.CloseNotifier + http.Hijacker + http.Pusher + }{rw, rw, rw, rw} + // combination 15/32 + case !i0 && i1 && i2 && i3 && !i4: + return struct { + http.ResponseWriter + http.CloseNotifier + http.Hijacker + io.ReaderFrom + }{rw, rw, rw, rw} + // combination 16/32 + case !i0 && i1 && i2 && i3 && i4: + return struct { + http.ResponseWriter + http.CloseNotifier + http.Hijacker + io.ReaderFrom + http.Pusher + }{rw, rw, rw, rw, rw} + // combination 17/32 + case i0 && !i1 && !i2 && !i3 && !i4: + return struct { + http.ResponseWriter + http.Flusher + }{rw, rw} + // combination 18/32 + case i0 && !i1 && !i2 && !i3 && i4: + return struct { + http.ResponseWriter + http.Flusher + http.Pusher + }{rw, rw, rw} + // combination 19/32 + case i0 && !i1 && !i2 && i3 && !i4: + return struct { + http.ResponseWriter + http.Flusher + io.ReaderFrom + }{rw, rw, rw} + // combination 20/32 + case i0 && !i1 && !i2 && i3 && i4: + return struct { + http.ResponseWriter + http.Flusher + io.ReaderFrom + http.Pusher + }{rw, rw, rw, rw} + // combination 21/32 + case i0 && !i1 && i2 && !i3 && !i4: + return struct { + http.ResponseWriter + http.Flusher + http.Hijacker + }{rw, rw, rw} + // combination 22/32 + case i0 && !i1 && i2 && !i3 && i4: + return struct { + http.ResponseWriter + http.Flusher + http.Hijacker + http.Pusher + }{rw, rw, rw, rw} + // combination 23/32 + case i0 && !i1 && i2 && i3 && !i4: + return struct { + http.ResponseWriter + http.Flusher + http.Hijacker + io.ReaderFrom + }{rw, rw, rw, rw} + // combination 24/32 + case i0 && !i1 && i2 && i3 && i4: + return struct { + http.ResponseWriter + http.Flusher + http.Hijacker + io.ReaderFrom + http.Pusher + }{rw, rw, rw, rw, rw} + // combination 25/32 + case i0 && i1 && !i2 && !i3 && !i4: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + }{rw, rw, rw} + // combination 26/32 + case i0 && i1 && !i2 && !i3 && i4: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + http.Pusher + }{rw, rw, rw, rw} + // combination 27/32 + case i0 && i1 && !i2 && i3 && !i4: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + io.ReaderFrom + }{rw, rw, rw, rw} + // combination 28/32 + case i0 && i1 && !i2 && i3 && i4: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + io.ReaderFrom + http.Pusher + }{rw, rw, rw, rw, rw} + // combination 29/32 + case i0 && i1 && i2 && !i3 && !i4: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + http.Hijacker + }{rw, rw, rw, rw} + // combination 30/32 + case i0 && i1 && i2 && !i3 && i4: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + http.Hijacker + http.Pusher + }{rw, rw, rw, rw, rw} + // combination 31/32 + case i0 && i1 && i2 && i3 && !i4: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + http.Hijacker + io.ReaderFrom + }{rw, rw, rw, rw, rw} + // combination 32/32 + case i0 && i1 && i2 && i3 && i4: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + http.Hijacker + io.ReaderFrom + http.Pusher + }{rw, rw, rw, rw, rw, rw} + } + panic("unreachable") +} + +type rw struct { + w http.ResponseWriter + h Hooks +} + +func (w *rw) Header() http.Header { + f := w.w.(http.ResponseWriter).Header + if w.h.Header != nil { + f = w.h.Header(f) + } + return f() +} + +func (w *rw) WriteHeader(code int) { + f := w.w.(http.ResponseWriter).WriteHeader + if w.h.WriteHeader != nil { + f = w.h.WriteHeader(f) + } + f(code) +} + +func (w *rw) Write(b []byte) (int, error) { + f := w.w.(http.ResponseWriter).Write + if w.h.Write != nil { + f = w.h.Write(f) + } + return f(b) +} + +func (w *rw) Flush() { + f := w.w.(http.Flusher).Flush + if w.h.Flush != nil { + f = w.h.Flush(f) + } + f() +} + +func (w *rw) CloseNotify() <-chan bool { + f := w.w.(http.CloseNotifier).CloseNotify + if w.h.CloseNotify != nil { + f = w.h.CloseNotify(f) + } + return f() +} + +func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { + f := w.w.(http.Hijacker).Hijack + if w.h.Hijack != nil { + f = w.h.Hijack(f) + } + return f() +} + +func (w *rw) ReadFrom(src io.Reader) (int64, error) { + f := w.w.(io.ReaderFrom).ReadFrom + if w.h.ReadFrom != nil { + f = w.h.ReadFrom(f) + } + return f(src) +} + +func (w *rw) Push(target string, opts *http.PushOptions) error { + f := w.w.(http.Pusher).Push + if w.h.Push != nil { + f = w.h.Push(f) + } + return f(target, opts) +} diff --git a/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go new file mode 100644 index 000000000000..36bb59b837c9 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go @@ -0,0 +1,243 @@ +// +build !go1.8 +// Code generated by "httpsnoop/codegen"; DO NOT EDIT + +package httpsnoop + +import ( + "bufio" + "io" + "net" + "net/http" +) + +// HeaderFunc is part of the http.ResponseWriter interface. +type HeaderFunc func() http.Header + +// WriteHeaderFunc is part of the http.ResponseWriter interface. +type WriteHeaderFunc func(code int) + +// WriteFunc is part of the http.ResponseWriter interface. +type WriteFunc func(b []byte) (int, error) + +// FlushFunc is part of the http.Flusher interface. +type FlushFunc func() + +// CloseNotifyFunc is part of the http.CloseNotifier interface. +type CloseNotifyFunc func() <-chan bool + +// HijackFunc is part of the http.Hijacker interface. +type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) + +// ReadFromFunc is part of the io.ReaderFrom interface. +type ReadFromFunc func(src io.Reader) (int64, error) + +// Hooks defines a set of method interceptors for methods included in +// http.ResponseWriter as well as some others. You can think of them as +// middleware for the function calls they target. See Wrap for more details. +type Hooks struct { + Header func(HeaderFunc) HeaderFunc + WriteHeader func(WriteHeaderFunc) WriteHeaderFunc + Write func(WriteFunc) WriteFunc + Flush func(FlushFunc) FlushFunc + CloseNotify func(CloseNotifyFunc) CloseNotifyFunc + Hijack func(HijackFunc) HijackFunc + ReadFrom func(ReadFromFunc) ReadFromFunc +} + +// Wrap returns a wrapped version of w that provides the exact same interface +// as w. Specifically if w implements any combination of: +// +// - http.Flusher +// - http.CloseNotifier +// - http.Hijacker +// - io.ReaderFrom +// +// The wrapped version will implement the exact same combination. If no hooks +// are set, the wrapped version also behaves exactly as w. Hooks targeting +// methods not supported by w are ignored. Any other hooks will intercept the +// method they target and may modify the call's arguments and/or return values. +// The CaptureMetrics implementation serves as a working example for how the +// hooks can be used. +func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { + rw := &rw{w: w, h: hooks} + _, i0 := w.(http.Flusher) + _, i1 := w.(http.CloseNotifier) + _, i2 := w.(http.Hijacker) + _, i3 := w.(io.ReaderFrom) + switch { + // combination 1/16 + case !i0 && !i1 && !i2 && !i3: + return struct { + http.ResponseWriter + }{rw} + // combination 2/16 + case !i0 && !i1 && !i2 && i3: + return struct { + http.ResponseWriter + io.ReaderFrom + }{rw, rw} + // combination 3/16 + case !i0 && !i1 && i2 && !i3: + return struct { + http.ResponseWriter + http.Hijacker + }{rw, rw} + // combination 4/16 + case !i0 && !i1 && i2 && i3: + return struct { + http.ResponseWriter + http.Hijacker + io.ReaderFrom + }{rw, rw, rw} + // combination 5/16 + case !i0 && i1 && !i2 && !i3: + return struct { + http.ResponseWriter + http.CloseNotifier + }{rw, rw} + // combination 6/16 + case !i0 && i1 && !i2 && i3: + return struct { + http.ResponseWriter + http.CloseNotifier + io.ReaderFrom + }{rw, rw, rw} + // combination 7/16 + case !i0 && i1 && i2 && !i3: + return struct { + http.ResponseWriter + http.CloseNotifier + http.Hijacker + }{rw, rw, rw} + // combination 8/16 + case !i0 && i1 && i2 && i3: + return struct { + http.ResponseWriter + http.CloseNotifier + http.Hijacker + io.ReaderFrom + }{rw, rw, rw, rw} + // combination 9/16 + case i0 && !i1 && !i2 && !i3: + return struct { + http.ResponseWriter + http.Flusher + }{rw, rw} + // combination 10/16 + case i0 && !i1 && !i2 && i3: + return struct { + http.ResponseWriter + http.Flusher + io.ReaderFrom + }{rw, rw, rw} + // combination 11/16 + case i0 && !i1 && i2 && !i3: + return struct { + http.ResponseWriter + http.Flusher + http.Hijacker + }{rw, rw, rw} + // combination 12/16 + case i0 && !i1 && i2 && i3: + return struct { + http.ResponseWriter + http.Flusher + http.Hijacker + io.ReaderFrom + }{rw, rw, rw, rw} + // combination 13/16 + case i0 && i1 && !i2 && !i3: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + }{rw, rw, rw} + // combination 14/16 + case i0 && i1 && !i2 && i3: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + io.ReaderFrom + }{rw, rw, rw, rw} + // combination 15/16 + case i0 && i1 && i2 && !i3: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + http.Hijacker + }{rw, rw, rw, rw} + // combination 16/16 + case i0 && i1 && i2 && i3: + return struct { + http.ResponseWriter + http.Flusher + http.CloseNotifier + http.Hijacker + io.ReaderFrom + }{rw, rw, rw, rw, rw} + } + panic("unreachable") +} + +type rw struct { + w http.ResponseWriter + h Hooks +} + +func (w *rw) Header() http.Header { + f := w.w.(http.ResponseWriter).Header + if w.h.Header != nil { + f = w.h.Header(f) + } + return f() +} + +func (w *rw) WriteHeader(code int) { + f := w.w.(http.ResponseWriter).WriteHeader + if w.h.WriteHeader != nil { + f = w.h.WriteHeader(f) + } + f(code) +} + +func (w *rw) Write(b []byte) (int, error) { + f := w.w.(http.ResponseWriter).Write + if w.h.Write != nil { + f = w.h.Write(f) + } + return f(b) +} + +func (w *rw) Flush() { + f := w.w.(http.Flusher).Flush + if w.h.Flush != nil { + f = w.h.Flush(f) + } + f() +} + +func (w *rw) CloseNotify() <-chan bool { + f := w.w.(http.CloseNotifier).CloseNotify + if w.h.CloseNotify != nil { + f = w.h.CloseNotify(f) + } + return f() +} + +func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { + f := w.w.(http.Hijacker).Hijack + if w.h.Hijack != nil { + f = w.h.Hijack(f) + } + return f() +} + +func (w *rw) ReadFrom(src io.Reader) (int64, error) { + f := w.w.(io.ReaderFrom).ReadFrom + if w.h.ReadFrom != nil { + f = w.h.ReadFrom(f) + } + return f(src) +} diff --git a/cluster-autoscaler/vendor/github.com/form3tech-oss/jwt-go/map_claims.go b/cluster-autoscaler/vendor/github.com/form3tech-oss/jwt-go/map_claims.go index 90ab6bea350a..bcc37b15bf86 100644 --- a/cluster-autoscaler/vendor/github.com/form3tech-oss/jwt-go/map_claims.go +++ b/cluster-autoscaler/vendor/github.com/form3tech-oss/jwt-go/map_claims.go @@ -13,15 +13,23 @@ type MapClaims map[string]interface{} // Compares the aud claim against cmp. // If required is false, this method will return true if the value matches or is unset func (m MapClaims) VerifyAudience(cmp string, req bool) bool { - aud, ok := m["aud"].([]string) - if !ok { - strAud, ok := m["aud"].(string) - if !ok { - return false + var aud []string + switch v := m["aud"].(type) { + case []string: + aud = v + case []interface{}: + for _, a := range v { + vs, ok := a.(string) + if !ok { + return false + } + aud = append(aud, vs) } - aud = append(aud, strAud) + case string: + aud = append(aud, v) + default: + return false } - return verifyAud(aud, cmp, req) } diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/jsonpointer/.travis.yml b/cluster-autoscaler/vendor/github.com/go-openapi/jsonpointer/.travis.yml index 9aef9184e86d..03a22fe06fd8 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/jsonpointer/.travis.yml +++ b/cluster-autoscaler/vendor/github.com/go-openapi/jsonpointer/.travis.yml @@ -1,8 +1,8 @@ after_success: - bash <(curl -s https://codecov.io/bash) go: -- 1.11.x -- 1.12.x +- 1.14.x +- 1.15.x install: - GO111MODULE=off go get -u gotest.tools/gotestsum env: diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/jsonpointer/pointer.go b/cluster-autoscaler/vendor/github.com/go-openapi/jsonpointer/pointer.go index b284eb77a628..7df9853def68 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ b/cluster-autoscaler/vendor/github.com/go-openapi/jsonpointer/pointer.go @@ -114,16 +114,16 @@ func getSingleImpl(node interface{}, decodedToken string, nameProvider *swag.Nam rValue := reflect.Indirect(reflect.ValueOf(node)) kind := rValue.Kind() - switch kind { + if rValue.Type().Implements(jsonPointableType) { + r, err := node.(JSONPointable).JSONLookup(decodedToken) + if err != nil { + return nil, kind, err + } + return r, kind, nil + } + switch kind { case reflect.Struct: - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return nil, kind, err - } - return r, kind, nil - } nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { return nil, kind, fmt.Errorf("object has no field %q", decodedToken) @@ -161,17 +161,17 @@ func getSingleImpl(node interface{}, decodedToken string, nameProvider *swag.Nam func setSingleImpl(node, data interface{}, decodedToken string, nameProvider *swag.NameProvider) error { rValue := reflect.Indirect(reflect.ValueOf(node)) - switch rValue.Kind() { - case reflect.Struct: - if ns, ok := node.(JSONSetable); ok { // pointer impl - return ns.JSONSet(decodedToken, data) - } + if ns, ok := node.(JSONSetable); ok { // pointer impl + return ns.JSONSet(decodedToken, data) + } - if rValue.Type().Implements(jsonSetableType) { - return node.(JSONSetable).JSONSet(decodedToken, data) - } + if rValue.Type().Implements(jsonSetableType) { + return node.(JSONSetable).JSONSet(decodedToken, data) + } + switch rValue.Kind() { + case reflect.Struct: nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { return fmt.Errorf("object has no field %q", decodedToken) @@ -270,22 +270,22 @@ func (p *Pointer) set(node, data interface{}, nameProvider *swag.NameProvider) e rValue := reflect.Indirect(reflect.ValueOf(node)) kind := rValue.Kind() - switch kind { - - case reflect.Struct: - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return err - } - fld := reflect.ValueOf(r) - if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { - node = fld.Addr().Interface() - continue - } - node = r + if rValue.Type().Implements(jsonPointableType) { + r, err := node.(JSONPointable).JSONLookup(decodedToken) + if err != nil { + return err + } + fld := reflect.ValueOf(r) + if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { + node = fld.Addr().Interface() continue } + node = r + continue + } + + switch kind { + case reflect.Struct: nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { return fmt.Errorf("object has no field %q", decodedToken) diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/.golangci.yml new file mode 100644 index 000000000000..f9381aee5419 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/.golangci.yml @@ -0,0 +1,41 @@ +linters-settings: + govet: + check-shadowing: true + golint: + min-confidence: 0 + gocyclo: + min-complexity: 30 + maligned: + suggest-new: true + dupl: + threshold: 100 + goconst: + min-len: 2 + min-occurrences: 4 +linters: + enable-all: true + disable: + - maligned + - lll + - gochecknoglobals + - godox + - gocognit + - whitespace + - wsl + - funlen + - gochecknoglobals + - gochecknoinits + - scopelint + - wrapcheck + - exhaustivestruct + - exhaustive + - nlreturn + - testpackage + - gci + - gofumpt + - goerr113 + - gomnd + - tparallel + - nestif + - godot + - errorlint diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/.travis.yml b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/.travis.yml index 40b90757d894..05482f4b90cb 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/.travis.yml +++ b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/.travis.yml @@ -1,10 +1,19 @@ after_success: - bash <(curl -s https://codecov.io/bash) go: -- 1.11.x -- 1.12.x +- 1.14.x +- 1.x install: -- GO111MODULE=off go get -u gotest.tools/gotestsum +- go get gotest.tools/gotestsum +jobs: + include: + # include linting job, but only for latest go version and amd64 arch + - go: 1.x + arch: amd64 + install: + go get github.com/golangci/golangci-lint/cmd/golangci-lint + script: + - golangci-lint run --new-from-rev master env: - GO111MODULE=on language: go diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/README.md b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/README.md index 66345f4c61fb..b94753aa527e 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/README.md +++ b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/README.md @@ -4,7 +4,7 @@ An implementation of JSON Reference - Go language ## Status -Work in progress ( 90% done ) +Feature complete. Stable API ## Dependencies https://github.com/go-openapi/jsonpointer diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/go.mod b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/go.mod index aff1d0163ec2..e6c2ec4d929f 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/go.mod +++ b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/go.mod @@ -6,7 +6,7 @@ require ( github.com/go-openapi/jsonpointer v0.19.3 github.com/stretchr/testify v1.3.0 golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect - golang.org/x/text v0.3.2 // indirect + golang.org/x/text v0.3.3 // indirect ) go 1.13 diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/go.sum b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/go.sum index c7ceab5802d6..b37f873e5533 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/go.sum +++ b/cluster-autoscaler/vendor/github.com/go-openapi/jsonreference/go.sum @@ -5,12 +5,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdko 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/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -28,14 +24,12 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/.golangci.yml b/cluster-autoscaler/vendor/github.com/go-openapi/swag/.golangci.yml index 625c3d6affe1..813c47aa6436 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/.golangci.yml +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/.golangci.yml @@ -20,3 +20,20 @@ linters: - lll - gochecknoinits - gochecknoglobals + - nlreturn + - testpackage + - wrapcheck + - gomnd + - exhaustive + - exhaustivestruct + - goerr113 + - wsl + - whitespace + - gofumpt + - godot + - nestif + - godox + - funlen + - gci + - gocognit + - paralleltest diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/.travis.yml b/cluster-autoscaler/vendor/github.com/go-openapi/swag/.travis.yml index aa26d8763aa3..fc25a887286c 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/.travis.yml +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/.travis.yml @@ -1,12 +1,34 @@ after_success: - bash <(curl -s https://codecov.io/bash) go: -- 1.11.x -- 1.12.x +- 1.14.x +- 1.x +arch: +- amd64 +jobs: + include: + # include arch ppc, but only for latest go version - skip testing for race + - go: 1.x + arch: ppc64le + install: ~ + script: + - go test -v + + #- go: 1.x + # arch: arm + # install: ~ + # script: + # - go test -v + + # include linting job, but only for latest go version and amd64 arch + - go: 1.x + arch: amd64 + install: + go get github.com/golangci/golangci-lint/cmd/golangci-lint + script: + - golangci-lint run --new-from-rev master install: - GO111MODULE=off go get -u gotest.tools/gotestsum -env: -- GO111MODULE=on language: go notifications: slack: diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/README.md b/cluster-autoscaler/vendor/github.com/go-openapi/swag/README.md index eb60ae80abe6..217f6fa5054e 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/README.md +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/README.md @@ -2,7 +2,6 @@ [![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/swag?status.svg)](http://godoc.org/github.com/go-openapi/swag) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/swag.svg)](https://golangci.com) [![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/swag)](https://goreportcard.com/report/github.com/go-openapi/swag) Contains a bunch of helper functions for go-openapi and go-swagger projects. diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/convert.go b/cluster-autoscaler/vendor/github.com/go-openapi/swag/convert.go index 7da35c316e51..fc085aeb8ea5 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/convert.go +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/convert.go @@ -88,7 +88,7 @@ func ConvertFloat64(str string) (float64, error) { return strconv.ParseFloat(str, 64) } -// ConvertInt8 turn a string into int8 boolean +// ConvertInt8 turn a string into an int8 func ConvertInt8(str string) (int8, error) { i, err := strconv.ParseInt(str, 10, 8) if err != nil { @@ -97,7 +97,7 @@ func ConvertInt8(str string) (int8, error) { return int8(i), nil } -// ConvertInt16 turn a string into a int16 +// ConvertInt16 turn a string into an int16 func ConvertInt16(str string) (int16, error) { i, err := strconv.ParseInt(str, 10, 16) if err != nil { @@ -106,7 +106,7 @@ func ConvertInt16(str string) (int16, error) { return int16(i), nil } -// ConvertInt32 turn a string into a int32 +// ConvertInt32 turn a string into an int32 func ConvertInt32(str string) (int32, error) { i, err := strconv.ParseInt(str, 10, 32) if err != nil { @@ -115,12 +115,12 @@ func ConvertInt32(str string) (int32, error) { return int32(i), nil } -// ConvertInt64 turn a string into a int64 +// ConvertInt64 turn a string into an int64 func ConvertInt64(str string) (int64, error) { return strconv.ParseInt(str, 10, 64) } -// ConvertUint8 turn a string into a uint8 +// ConvertUint8 turn a string into an uint8 func ConvertUint8(str string) (uint8, error) { i, err := strconv.ParseUint(str, 10, 8) if err != nil { @@ -129,7 +129,7 @@ func ConvertUint8(str string) (uint8, error) { return uint8(i), nil } -// ConvertUint16 turn a string into a uint16 +// ConvertUint16 turn a string into an uint16 func ConvertUint16(str string) (uint16, error) { i, err := strconv.ParseUint(str, 10, 16) if err != nil { @@ -138,7 +138,7 @@ func ConvertUint16(str string) (uint16, error) { return uint16(i), nil } -// ConvertUint32 turn a string into a uint32 +// ConvertUint32 turn a string into an uint32 func ConvertUint32(str string) (uint32, error) { i, err := strconv.ParseUint(str, 10, 32) if err != nil { @@ -147,7 +147,7 @@ func ConvertUint32(str string) (uint32, error) { return uint32(i), nil } -// ConvertUint64 turn a string into a uint64 +// ConvertUint64 turn a string into an uint64 func ConvertUint64(str string) (uint64, error) { return strconv.ParseUint(str, 10, 64) } diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/convert_types.go b/cluster-autoscaler/vendor/github.com/go-openapi/swag/convert_types.go index c95e4e78bdd7..c49cc473a8c2 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/convert_types.go +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/convert_types.go @@ -181,12 +181,12 @@ func IntValueMap(src map[string]*int) map[string]int { return dst } -// Int32 returns a pointer to of the int64 value passed in. +// Int32 returns a pointer to of the int32 value passed in. func Int32(v int32) *int32 { return &v } -// Int32Value returns the value of the int64 pointer passed in or +// Int32Value returns the value of the int32 pointer passed in or // 0 if the pointer is nil. func Int32Value(v *int32) int32 { if v != nil { @@ -195,7 +195,7 @@ func Int32Value(v *int32) int32 { return 0 } -// Int32Slice converts a slice of int64 values into a slice of +// Int32Slice converts a slice of int32 values into a slice of // int32 pointers func Int32Slice(src []int32) []*int32 { dst := make([]*int32, len(src)) @@ -299,13 +299,80 @@ func Int64ValueMap(src map[string]*int64) map[string]int64 { return dst } -// Uint returns a pouinter to of the uint value passed in. +// Uint16 returns a pointer to of the uint16 value passed in. +func Uint16(v uint16) *uint16 { + return &v +} + +// Uint16Value returns the value of the uint16 pointer passed in or +// 0 if the pointer is nil. +func Uint16Value(v *uint16) uint16 { + if v != nil { + return *v + } + + return 0 +} + +// Uint16Slice converts a slice of uint16 values into a slice of +// uint16 pointers +func Uint16Slice(src []uint16) []*uint16 { + dst := make([]*uint16, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + + return dst +} + +// Uint16ValueSlice converts a slice of uint16 pointers into a slice of +// uint16 values +func Uint16ValueSlice(src []*uint16) []uint16 { + dst := make([]uint16, len(src)) + + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + + return dst +} + +// Uint16Map converts a string map of uint16 values into a string +// map of uint16 pointers +func Uint16Map(src map[string]uint16) map[string]*uint16 { + dst := make(map[string]*uint16) + + for k, val := range src { + v := val + dst[k] = &v + } + + return dst +} + +// Uint16ValueMap converts a string map of uint16 pointers into a string +// map of uint16 values +func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { + dst := make(map[string]uint16) + + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + + return dst +} + +// Uint returns a pointer to of the uint value passed in. func Uint(v uint) *uint { return &v } -// UintValue returns the value of the uint pouinter passed in or -// 0 if the pouinter is nil. +// UintValue returns the value of the uint pointer passed in or +// 0 if the pointer is nil. func UintValue(v *uint) uint { if v != nil { return *v @@ -313,8 +380,8 @@ func UintValue(v *uint) uint { return 0 } -// UintSlice converts a slice of uint values uinto a slice of -// uint pouinters +// UintSlice converts a slice of uint values into a slice of +// uint pointers func UintSlice(src []uint) []*uint { dst := make([]*uint, len(src)) for i := 0; i < len(src); i++ { @@ -323,7 +390,7 @@ func UintSlice(src []uint) []*uint { return dst } -// UintValueSlice converts a slice of uint pouinters uinto a slice of +// UintValueSlice converts a slice of uint pointers into a slice of // uint values func UintValueSlice(src []*uint) []uint { dst := make([]uint, len(src)) @@ -335,8 +402,8 @@ func UintValueSlice(src []*uint) []uint { return dst } -// UintMap converts a string map of uint values uinto a string -// map of uint pouinters +// UintMap converts a string map of uint values into a string +// map of uint pointers func UintMap(src map[string]uint) map[string]*uint { dst := make(map[string]*uint) for k, val := range src { @@ -346,7 +413,7 @@ func UintMap(src map[string]uint) map[string]*uint { return dst } -// UintValueMap converts a string map of uint pouinters uinto a string +// UintValueMap converts a string map of uint pointers into a string // map of uint values func UintValueMap(src map[string]*uint) map[string]uint { dst := make(map[string]uint) @@ -358,13 +425,13 @@ func UintValueMap(src map[string]*uint) map[string]uint { return dst } -// Uint32 returns a pouinter to of the uint64 value passed in. +// Uint32 returns a pointer to of the uint32 value passed in. func Uint32(v uint32) *uint32 { return &v } -// Uint32Value returns the value of the uint64 pouinter passed in or -// 0 if the pouinter is nil. +// Uint32Value returns the value of the uint32 pointer passed in or +// 0 if the pointer is nil. func Uint32Value(v *uint32) uint32 { if v != nil { return *v @@ -372,8 +439,8 @@ func Uint32Value(v *uint32) uint32 { return 0 } -// Uint32Slice converts a slice of uint64 values uinto a slice of -// uint32 pouinters +// Uint32Slice converts a slice of uint32 values into a slice of +// uint32 pointers func Uint32Slice(src []uint32) []*uint32 { dst := make([]*uint32, len(src)) for i := 0; i < len(src); i++ { @@ -382,7 +449,7 @@ func Uint32Slice(src []uint32) []*uint32 { return dst } -// Uint32ValueSlice converts a slice of uint32 pouinters uinto a slice of +// Uint32ValueSlice converts a slice of uint32 pointers into a slice of // uint32 values func Uint32ValueSlice(src []*uint32) []uint32 { dst := make([]uint32, len(src)) @@ -394,8 +461,8 @@ func Uint32ValueSlice(src []*uint32) []uint32 { return dst } -// Uint32Map converts a string map of uint32 values uinto a string -// map of uint32 pouinters +// Uint32Map converts a string map of uint32 values into a string +// map of uint32 pointers func Uint32Map(src map[string]uint32) map[string]*uint32 { dst := make(map[string]*uint32) for k, val := range src { @@ -405,7 +472,7 @@ func Uint32Map(src map[string]uint32) map[string]*uint32 { return dst } -// Uint32ValueMap converts a string map of uint32 pouinters uinto a string +// Uint32ValueMap converts a string map of uint32 pointers into a string // map of uint32 values func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { dst := make(map[string]uint32) @@ -417,13 +484,13 @@ func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { return dst } -// Uint64 returns a pouinter to of the uint64 value passed in. +// Uint64 returns a pointer to of the uint64 value passed in. func Uint64(v uint64) *uint64 { return &v } -// Uint64Value returns the value of the uint64 pouinter passed in or -// 0 if the pouinter is nil. +// Uint64Value returns the value of the uint64 pointer passed in or +// 0 if the pointer is nil. func Uint64Value(v *uint64) uint64 { if v != nil { return *v @@ -431,8 +498,8 @@ func Uint64Value(v *uint64) uint64 { return 0 } -// Uint64Slice converts a slice of uint64 values uinto a slice of -// uint64 pouinters +// Uint64Slice converts a slice of uint64 values into a slice of +// uint64 pointers func Uint64Slice(src []uint64) []*uint64 { dst := make([]*uint64, len(src)) for i := 0; i < len(src); i++ { @@ -441,7 +508,7 @@ func Uint64Slice(src []uint64) []*uint64 { return dst } -// Uint64ValueSlice converts a slice of uint64 pouinters uinto a slice of +// Uint64ValueSlice converts a slice of uint64 pointers into a slice of // uint64 values func Uint64ValueSlice(src []*uint64) []uint64 { dst := make([]uint64, len(src)) @@ -453,8 +520,8 @@ func Uint64ValueSlice(src []*uint64) []uint64 { return dst } -// Uint64Map converts a string map of uint64 values uinto a string -// map of uint64 pouinters +// Uint64Map converts a string map of uint64 values into a string +// map of uint64 pointers func Uint64Map(src map[string]uint64) map[string]*uint64 { dst := make(map[string]*uint64) for k, val := range src { @@ -464,7 +531,7 @@ func Uint64Map(src map[string]uint64) map[string]*uint64 { return dst } -// Uint64ValueMap converts a string map of uint64 pouinters uinto a string +// Uint64ValueMap converts a string map of uint64 pointers into a string // map of uint64 values func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { dst := make(map[string]uint64) @@ -476,6 +543,74 @@ func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { return dst } +// Float32 returns a pointer to of the float32 value passed in. +func Float32(v float32) *float32 { + return &v +} + +// Float32Value returns the value of the float32 pointer passed in or +// 0 if the pointer is nil. +func Float32Value(v *float32) float32 { + if v != nil { + return *v + } + + return 0 +} + +// Float32Slice converts a slice of float32 values into a slice of +// float32 pointers +func Float32Slice(src []float32) []*float32 { + dst := make([]*float32, len(src)) + + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + + return dst +} + +// Float32ValueSlice converts a slice of float32 pointers into a slice of +// float32 values +func Float32ValueSlice(src []*float32) []float32 { + dst := make([]float32, len(src)) + + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + + return dst +} + +// Float32Map converts a string map of float32 values into a string +// map of float32 pointers +func Float32Map(src map[string]float32) map[string]*float32 { + dst := make(map[string]*float32) + + for k, val := range src { + v := val + dst[k] = &v + } + + return dst +} + +// Float32ValueMap converts a string map of float32 pointers into a string +// map of float32 values +func Float32ValueMap(src map[string]*float32) map[string]float32 { + dst := make(map[string]float32) + + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + + return dst +} + // Float64 returns a pointer to of the float64 value passed in. func Float64(v float64) *float64 { return &v diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/go.mod b/cluster-autoscaler/vendor/github.com/go-openapi/swag/go.mod index 15bbb082227e..fb29b65b2565 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/go.mod +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/go.mod @@ -2,13 +2,17 @@ module github.com/go-openapi/swag require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/pretty v0.1.0 // indirect - github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 - github.com/stretchr/testify v1.3.0 - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect - gopkg.in/yaml.v2 v2.2.2 + github.com/kr/text v0.2.0 // indirect + github.com/mailru/easyjson v0.7.6 + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect + github.com/stretchr/testify v1.6.1 + gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect + gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect ) replace github.com/golang/lint => golang.org/x/lint v0.0.0-20190409202823-959b441ac422 replace sourcegraph.com/sourcegraph/go-diff => github.com/sourcegraph/go-diff v0.5.1 + +go 1.11 diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/go.sum b/cluster-autoscaler/vendor/github.com/go-openapi/swag/go.sum index 33469f54acbd..a45da809afac 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/go.sum +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/go.sum @@ -1,20 +1,29 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= 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/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +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.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/json.go b/cluster-autoscaler/vendor/github.com/go-openapi/swag/json.go index edf93d84c60d..7e9902ca314b 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/json.go +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/json.go @@ -51,7 +51,7 @@ type ejUnmarshaler interface { UnmarshalEasyJSON(w *jlexer.Lexer) } -// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaller +// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaler // so it takes the fastest option available. func WriteJSON(data interface{}) ([]byte, error) { if d, ok := data.(ejMarshaler); ok { @@ -65,8 +65,8 @@ func WriteJSON(data interface{}) ([]byte, error) { return json.Marshal(data) } -// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaller -// so it takes the fastes option available +// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaler +// so it takes the fastest option available func ReadJSON(data []byte, value interface{}) error { trimmedData := bytes.Trim(data, "\x00") if d, ok := value.(ejUnmarshaler); ok { @@ -189,7 +189,7 @@ func FromDynamicJSON(data, target interface{}) error { return json.Unmarshal(b, target) } -// NameProvider represents an object capabale of translating from go property names +// NameProvider represents an object capable of translating from go property names // to json property names // This type is thread-safe. type NameProvider struct { diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/loading.go b/cluster-autoscaler/vendor/github.com/go-openapi/swag/loading.go index 70f4fb361c13..9a60409725e4 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/loading.go +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/loading.go @@ -19,7 +19,9 @@ import ( "io/ioutil" "log" "net/http" + "net/url" "path/filepath" + "runtime" "strings" "time" ) @@ -27,6 +29,15 @@ import ( // LoadHTTPTimeout the default timeout for load requests var LoadHTTPTimeout = 30 * time.Second +// LoadHTTPBasicAuthUsername the username to use when load requests require basic auth +var LoadHTTPBasicAuthUsername = "" + +// LoadHTTPBasicAuthPassword the password to use when load requests require basic auth +var LoadHTTPBasicAuthPassword = "" + +// LoadHTTPCustomHeaders an optional collection of custom HTTP headers for load requests +var LoadHTTPCustomHeaders = map[string]string{} + // LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in func LoadFromFileOrHTTP(path string) ([]byte, error) { return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) @@ -48,6 +59,26 @@ func LoadStrategy(path string, local, remote func(string) ([]byte, error)) func( if err != nil { return nil, err } + + if strings.HasPrefix(pth, `file://`) { + if runtime.GOOS == "windows" { + // support for canonical file URIs on windows. + // Zero tolerance here for dodgy URIs. + u, _ := url.Parse(upth) + if u.Host != "" { + // assume UNC name (volume share) + // file://host/share/folder\... ==> \\host\share\path\folder + // NOTE: UNC port not yet supported + upth = strings.Join([]string{`\`, u.Host, u.Path}, `\`) + } else { + // file:///c:/folder/... ==> just remove the leading slash + upth = strings.TrimPrefix(upth, `file:///`) + } + } else { + upth = strings.TrimPrefix(upth, `file://`) + } + } + return local(filepath.FromSlash(upth)) } } @@ -55,10 +86,19 @@ func LoadStrategy(path string, local, remote func(string) ([]byte, error)) func( func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { return func(path string) ([]byte, error) { client := &http.Client{Timeout: timeout} - req, err := http.NewRequest("GET", path, nil) + req, err := http.NewRequest("GET", path, nil) // nolint: noctx if err != nil { return nil, err } + + if LoadHTTPBasicAuthUsername != "" && LoadHTTPBasicAuthPassword != "" { + req.SetBasicAuth(LoadHTTPBasicAuthUsername, LoadHTTPBasicAuthPassword) + } + + for key, val := range LoadHTTPCustomHeaders { + req.Header.Set(key, val) + } + resp, err := client.Do(req) defer func() { if resp != nil { diff --git a/cluster-autoscaler/vendor/github.com/go-openapi/swag/util.go b/cluster-autoscaler/vendor/github.com/go-openapi/swag/util.go index 9eac16afb2e1..193702f2cec0 100644 --- a/cluster-autoscaler/vendor/github.com/go-openapi/swag/util.go +++ b/cluster-autoscaler/vendor/github.com/go-openapi/swag/util.go @@ -31,7 +31,7 @@ var isInitialism func(string) bool // GoNamePrefixFunc sets an optional rule to prefix go names // which do not start with a letter. // -// e.g. to help converting "123" into "{prefix}123" +// e.g. to help convert "123" into "{prefix}123" // // The default is to prefix with "X" var GoNamePrefixFunc func(string) string @@ -91,7 +91,7 @@ func init() { } const ( - //collectionFormatComma = "csv" + // collectionFormatComma = "csv" collectionFormatSpace = "ssv" collectionFormatTab = "tsv" collectionFormatPipe = "pipes" @@ -370,7 +370,7 @@ func IsZero(data interface{}) bool { // AddInitialisms add additional initialisms func AddInitialisms(words ...string) { for _, word := range words { - //commonInitialisms[upper(word)] = true + // commonInitialisms[upper(word)] = true commonInitialisms.add(upper(word)) } // sort again diff --git a/cluster-autoscaler/vendor/github.com/golang/protobuf/descriptor/descriptor.go b/cluster-autoscaler/vendor/github.com/golang/protobuf/descriptor/descriptor.go new file mode 100644 index 000000000000..ffde8a65081e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/golang/protobuf/descriptor/descriptor.go @@ -0,0 +1,180 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package descriptor provides functions for obtaining the protocol buffer +// descriptors of generated Go types. +// +// Deprecated: See the "google.golang.org/protobuf/reflect/protoreflect" package +// for how to obtain an EnumDescriptor or MessageDescriptor in order to +// programatically interact with the protobuf type system. +package descriptor + +import ( + "bytes" + "compress/gzip" + "io/ioutil" + "sync" + + "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/reflect/protodesc" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/runtime/protoimpl" + + descriptorpb "github.com/golang/protobuf/protoc-gen-go/descriptor" +) + +// Message is proto.Message with a method to return its descriptor. +// +// Deprecated: The Descriptor method may not be generated by future +// versions of protoc-gen-go, meaning that this interface may not +// be implemented by many concrete message types. +type Message interface { + proto.Message + Descriptor() ([]byte, []int) +} + +// ForMessage returns the file descriptor proto containing +// the message and the message descriptor proto for the message itself. +// The returned proto messages must not be mutated. +// +// Deprecated: Not all concrete message types satisfy the Message interface. +// Use MessageDescriptorProto instead. If possible, the calling code should +// be rewritten to use protobuf reflection instead. +// See package "google.golang.org/protobuf/reflect/protoreflect" for details. +func ForMessage(m Message) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto) { + return MessageDescriptorProto(m) +} + +type rawDesc struct { + fileDesc []byte + indexes []int +} + +var rawDescCache sync.Map // map[protoreflect.Descriptor]*rawDesc + +func deriveRawDescriptor(d protoreflect.Descriptor) ([]byte, []int) { + // Fast-path: check whether raw descriptors are already cached. + origDesc := d + if v, ok := rawDescCache.Load(origDesc); ok { + return v.(*rawDesc).fileDesc, v.(*rawDesc).indexes + } + + // Slow-path: derive the raw descriptor from the v2 descriptor. + + // Start with the leaf (a given enum or message declaration) and + // ascend upwards until we hit the parent file descriptor. + var idxs []int + for { + idxs = append(idxs, d.Index()) + d = d.Parent() + if d == nil { + // TODO: We could construct a FileDescriptor stub for standalone + // descriptors to satisfy the API. + return nil, nil + } + if _, ok := d.(protoreflect.FileDescriptor); ok { + break + } + } + + // Obtain the raw file descriptor. + fd := d.(protoreflect.FileDescriptor) + b, _ := proto.Marshal(protodesc.ToFileDescriptorProto(fd)) + file := protoimpl.X.CompressGZIP(b) + + // Reverse the indexes, since we populated it in reverse. + for i, j := 0, len(idxs)-1; i < j; i, j = i+1, j-1 { + idxs[i], idxs[j] = idxs[j], idxs[i] + } + + if v, ok := rawDescCache.LoadOrStore(origDesc, &rawDesc{file, idxs}); ok { + return v.(*rawDesc).fileDesc, v.(*rawDesc).indexes + } + return file, idxs +} + +// EnumRawDescriptor returns the GZIP'd raw file descriptor representing +// the enum and the index path to reach the enum declaration. +// The returned slices must not be mutated. +func EnumRawDescriptor(e proto.GeneratedEnum) ([]byte, []int) { + if ev, ok := e.(interface{ EnumDescriptor() ([]byte, []int) }); ok { + return ev.EnumDescriptor() + } + ed := protoimpl.X.EnumTypeOf(e) + return deriveRawDescriptor(ed.Descriptor()) +} + +// MessageRawDescriptor returns the GZIP'd raw file descriptor representing +// the message and the index path to reach the message declaration. +// The returned slices must not be mutated. +func MessageRawDescriptor(m proto.GeneratedMessage) ([]byte, []int) { + if mv, ok := m.(interface{ Descriptor() ([]byte, []int) }); ok { + return mv.Descriptor() + } + md := protoimpl.X.MessageTypeOf(m) + return deriveRawDescriptor(md.Descriptor()) +} + +var fileDescCache sync.Map // map[*byte]*descriptorpb.FileDescriptorProto + +func deriveFileDescriptor(rawDesc []byte) *descriptorpb.FileDescriptorProto { + // Fast-path: check whether descriptor protos are already cached. + if v, ok := fileDescCache.Load(&rawDesc[0]); ok { + return v.(*descriptorpb.FileDescriptorProto) + } + + // Slow-path: derive the descriptor proto from the GZIP'd message. + zr, err := gzip.NewReader(bytes.NewReader(rawDesc)) + if err != nil { + panic(err) + } + b, err := ioutil.ReadAll(zr) + if err != nil { + panic(err) + } + fd := new(descriptorpb.FileDescriptorProto) + if err := proto.Unmarshal(b, fd); err != nil { + panic(err) + } + if v, ok := fileDescCache.LoadOrStore(&rawDesc[0], fd); ok { + return v.(*descriptorpb.FileDescriptorProto) + } + return fd +} + +// EnumDescriptorProto returns the file descriptor proto representing +// the enum and the enum descriptor proto for the enum itself. +// The returned proto messages must not be mutated. +func EnumDescriptorProto(e proto.GeneratedEnum) (*descriptorpb.FileDescriptorProto, *descriptorpb.EnumDescriptorProto) { + rawDesc, idxs := EnumRawDescriptor(e) + if rawDesc == nil || idxs == nil { + return nil, nil + } + fd := deriveFileDescriptor(rawDesc) + if len(idxs) == 1 { + return fd, fd.EnumType[idxs[0]] + } + md := fd.MessageType[idxs[0]] + for _, i := range idxs[1 : len(idxs)-1] { + md = md.NestedType[i] + } + ed := md.EnumType[idxs[len(idxs)-1]] + return fd, ed +} + +// MessageDescriptorProto returns the file descriptor proto representing +// the message and the message descriptor proto for the message itself. +// The returned proto messages must not be mutated. +func MessageDescriptorProto(m proto.GeneratedMessage) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto) { + rawDesc, idxs := MessageRawDescriptor(m) + if rawDesc == nil || idxs == nil { + return nil, nil + } + fd := deriveFileDescriptor(rawDesc) + md := fd.MessageType[idxs[0]] + for _, i := range idxs[1:] { + md = md.NestedType[i] + } + return fd, md +} diff --git a/cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/decode.go b/cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/decode.go new file mode 100644 index 000000000000..60e82caa9a2d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/decode.go @@ -0,0 +1,524 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package jsonpb + +import ( + "encoding/json" + "errors" + "fmt" + "io" + "math" + "reflect" + "strconv" + "strings" + "time" + + "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/encoding/protojson" + protoV2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" +) + +const wrapJSONUnmarshalV2 = false + +// UnmarshalNext unmarshals the next JSON object from d into m. +func UnmarshalNext(d *json.Decoder, m proto.Message) error { + return new(Unmarshaler).UnmarshalNext(d, m) +} + +// Unmarshal unmarshals a JSON object from r into m. +func Unmarshal(r io.Reader, m proto.Message) error { + return new(Unmarshaler).Unmarshal(r, m) +} + +// UnmarshalString unmarshals a JSON object from s into m. +func UnmarshalString(s string, m proto.Message) error { + return new(Unmarshaler).Unmarshal(strings.NewReader(s), m) +} + +// Unmarshaler is a configurable object for converting from a JSON +// representation to a protocol buffer object. +type Unmarshaler struct { + // AllowUnknownFields specifies whether to allow messages to contain + // unknown JSON fields, as opposed to failing to unmarshal. + AllowUnknownFields bool + + // AnyResolver is used to resolve the google.protobuf.Any well-known type. + // If unset, the global registry is used by default. + AnyResolver AnyResolver +} + +// JSONPBUnmarshaler is implemented by protobuf messages that customize the way +// they are unmarshaled from JSON. Messages that implement this should also +// implement JSONPBMarshaler so that the custom format can be produced. +// +// The JSON unmarshaling must follow the JSON to proto specification: +// https://developers.google.com/protocol-buffers/docs/proto3#json +// +// Deprecated: Custom types should implement protobuf reflection instead. +type JSONPBUnmarshaler interface { + UnmarshalJSONPB(*Unmarshaler, []byte) error +} + +// Unmarshal unmarshals a JSON object from r into m. +func (u *Unmarshaler) Unmarshal(r io.Reader, m proto.Message) error { + return u.UnmarshalNext(json.NewDecoder(r), m) +} + +// UnmarshalNext unmarshals the next JSON object from d into m. +func (u *Unmarshaler) UnmarshalNext(d *json.Decoder, m proto.Message) error { + if m == nil { + return errors.New("invalid nil message") + } + + // Parse the next JSON object from the stream. + raw := json.RawMessage{} + if err := d.Decode(&raw); err != nil { + return err + } + + // Check for custom unmarshalers first since they may not properly + // implement protobuf reflection that the logic below relies on. + if jsu, ok := m.(JSONPBUnmarshaler); ok { + return jsu.UnmarshalJSONPB(u, raw) + } + + mr := proto.MessageReflect(m) + + // NOTE: For historical reasons, a top-level null is treated as a noop. + // This is incorrect, but kept for compatibility. + if string(raw) == "null" && mr.Descriptor().FullName() != "google.protobuf.Value" { + return nil + } + + if wrapJSONUnmarshalV2 { + // NOTE: If input message is non-empty, we need to preserve merge semantics + // of the old jsonpb implementation. These semantics are not supported by + // the protobuf JSON specification. + isEmpty := true + mr.Range(func(protoreflect.FieldDescriptor, protoreflect.Value) bool { + isEmpty = false // at least one iteration implies non-empty + return false + }) + if !isEmpty { + // Perform unmarshaling into a newly allocated, empty message. + mr = mr.New() + + // Use a defer to copy all unmarshaled fields into the original message. + dst := proto.MessageReflect(m) + defer mr.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { + dst.Set(fd, v) + return true + }) + } + + // Unmarshal using the v2 JSON unmarshaler. + opts := protojson.UnmarshalOptions{ + DiscardUnknown: u.AllowUnknownFields, + } + if u.AnyResolver != nil { + opts.Resolver = anyResolver{u.AnyResolver} + } + return opts.Unmarshal(raw, mr.Interface()) + } else { + if err := u.unmarshalMessage(mr, raw); err != nil { + return err + } + return protoV2.CheckInitialized(mr.Interface()) + } +} + +func (u *Unmarshaler) unmarshalMessage(m protoreflect.Message, in []byte) error { + md := m.Descriptor() + fds := md.Fields() + + if jsu, ok := proto.MessageV1(m.Interface()).(JSONPBUnmarshaler); ok { + return jsu.UnmarshalJSONPB(u, in) + } + + if string(in) == "null" && md.FullName() != "google.protobuf.Value" { + return nil + } + + switch wellKnownType(md.FullName()) { + case "Any": + var jsonObject map[string]json.RawMessage + if err := json.Unmarshal(in, &jsonObject); err != nil { + return err + } + + rawTypeURL, ok := jsonObject["@type"] + if !ok { + return errors.New("Any JSON doesn't have '@type'") + } + typeURL, err := unquoteString(string(rawTypeURL)) + if err != nil { + return fmt.Errorf("can't unmarshal Any's '@type': %q", rawTypeURL) + } + m.Set(fds.ByNumber(1), protoreflect.ValueOfString(typeURL)) + + var m2 protoreflect.Message + if u.AnyResolver != nil { + mi, err := u.AnyResolver.Resolve(typeURL) + if err != nil { + return err + } + m2 = proto.MessageReflect(mi) + } else { + mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL) + if err != nil { + if err == protoregistry.NotFound { + return fmt.Errorf("could not resolve Any message type: %v", typeURL) + } + return err + } + m2 = mt.New() + } + + if wellKnownType(m2.Descriptor().FullName()) != "" { + rawValue, ok := jsonObject["value"] + if !ok { + return errors.New("Any JSON doesn't have 'value'") + } + if err := u.unmarshalMessage(m2, rawValue); err != nil { + return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err) + } + } else { + delete(jsonObject, "@type") + rawJSON, err := json.Marshal(jsonObject) + if err != nil { + return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", err) + } + if err = u.unmarshalMessage(m2, rawJSON); err != nil { + return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err) + } + } + + rawWire, err := protoV2.Marshal(m2.Interface()) + if err != nil { + return fmt.Errorf("can't marshal proto %v into Any.Value: %v", typeURL, err) + } + m.Set(fds.ByNumber(2), protoreflect.ValueOfBytes(rawWire)) + return nil + case "BoolValue", "BytesValue", "StringValue", + "Int32Value", "UInt32Value", "FloatValue", + "Int64Value", "UInt64Value", "DoubleValue": + fd := fds.ByNumber(1) + v, err := u.unmarshalValue(m.NewField(fd), in, fd) + if err != nil { + return err + } + m.Set(fd, v) + return nil + case "Duration": + v, err := unquoteString(string(in)) + if err != nil { + return err + } + d, err := time.ParseDuration(v) + if err != nil { + return fmt.Errorf("bad Duration: %v", err) + } + + sec := d.Nanoseconds() / 1e9 + nsec := d.Nanoseconds() % 1e9 + m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec))) + m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec))) + return nil + case "Timestamp": + v, err := unquoteString(string(in)) + if err != nil { + return err + } + t, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return fmt.Errorf("bad Timestamp: %v", err) + } + + sec := t.Unix() + nsec := t.Nanosecond() + m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec))) + m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec))) + return nil + case "Value": + switch { + case string(in) == "null": + m.Set(fds.ByNumber(1), protoreflect.ValueOfEnum(0)) + case string(in) == "true": + m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(true)) + case string(in) == "false": + m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(false)) + case hasPrefixAndSuffix('"', in, '"'): + s, err := unquoteString(string(in)) + if err != nil { + return fmt.Errorf("unrecognized type for Value %q", in) + } + m.Set(fds.ByNumber(3), protoreflect.ValueOfString(s)) + case hasPrefixAndSuffix('[', in, ']'): + v := m.Mutable(fds.ByNumber(6)) + return u.unmarshalMessage(v.Message(), in) + case hasPrefixAndSuffix('{', in, '}'): + v := m.Mutable(fds.ByNumber(5)) + return u.unmarshalMessage(v.Message(), in) + default: + f, err := strconv.ParseFloat(string(in), 0) + if err != nil { + return fmt.Errorf("unrecognized type for Value %q", in) + } + m.Set(fds.ByNumber(2), protoreflect.ValueOfFloat64(f)) + } + return nil + case "ListValue": + var jsonArray []json.RawMessage + if err := json.Unmarshal(in, &jsonArray); err != nil { + return fmt.Errorf("bad ListValue: %v", err) + } + + lv := m.Mutable(fds.ByNumber(1)).List() + for _, raw := range jsonArray { + ve := lv.NewElement() + if err := u.unmarshalMessage(ve.Message(), raw); err != nil { + return err + } + lv.Append(ve) + } + return nil + case "Struct": + var jsonObject map[string]json.RawMessage + if err := json.Unmarshal(in, &jsonObject); err != nil { + return fmt.Errorf("bad StructValue: %v", err) + } + + mv := m.Mutable(fds.ByNumber(1)).Map() + for key, raw := range jsonObject { + kv := protoreflect.ValueOf(key).MapKey() + vv := mv.NewValue() + if err := u.unmarshalMessage(vv.Message(), raw); err != nil { + return fmt.Errorf("bad value in StructValue for key %q: %v", key, err) + } + mv.Set(kv, vv) + } + return nil + } + + var jsonObject map[string]json.RawMessage + if err := json.Unmarshal(in, &jsonObject); err != nil { + return err + } + + // Handle known fields. + for i := 0; i < fds.Len(); i++ { + fd := fds.Get(i) + if fd.IsWeak() && fd.Message().IsPlaceholder() { + continue // weak reference is not linked in + } + + // Search for any raw JSON value associated with this field. + var raw json.RawMessage + name := string(fd.Name()) + if fd.Kind() == protoreflect.GroupKind { + name = string(fd.Message().Name()) + } + if v, ok := jsonObject[name]; ok { + delete(jsonObject, name) + raw = v + } + name = string(fd.JSONName()) + if v, ok := jsonObject[name]; ok { + delete(jsonObject, name) + raw = v + } + + field := m.NewField(fd) + // Unmarshal the field value. + if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) { + continue + } + v, err := u.unmarshalValue(field, raw, fd) + if err != nil { + return err + } + m.Set(fd, v) + } + + // Handle extension fields. + for name, raw := range jsonObject { + if !strings.HasPrefix(name, "[") || !strings.HasSuffix(name, "]") { + continue + } + + // Resolve the extension field by name. + xname := protoreflect.FullName(name[len("[") : len(name)-len("]")]) + xt, _ := protoregistry.GlobalTypes.FindExtensionByName(xname) + if xt == nil && isMessageSet(md) { + xt, _ = protoregistry.GlobalTypes.FindExtensionByName(xname.Append("message_set_extension")) + } + if xt == nil { + continue + } + delete(jsonObject, name) + fd := xt.TypeDescriptor() + if fd.ContainingMessage().FullName() != m.Descriptor().FullName() { + return fmt.Errorf("extension field %q does not extend message %q", xname, m.Descriptor().FullName()) + } + + field := m.NewField(fd) + // Unmarshal the field value. + if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) { + continue + } + v, err := u.unmarshalValue(field, raw, fd) + if err != nil { + return err + } + m.Set(fd, v) + } + + if !u.AllowUnknownFields && len(jsonObject) > 0 { + for name := range jsonObject { + return fmt.Errorf("unknown field %q in %v", name, md.FullName()) + } + } + return nil +} + +func isSingularWellKnownValue(fd protoreflect.FieldDescriptor) bool { + if md := fd.Message(); md != nil { + return md.FullName() == "google.protobuf.Value" && fd.Cardinality() != protoreflect.Repeated + } + return false +} + +func isSingularJSONPBUnmarshaler(v protoreflect.Value, fd protoreflect.FieldDescriptor) bool { + if fd.Message() != nil && fd.Cardinality() != protoreflect.Repeated { + _, ok := proto.MessageV1(v.Interface()).(JSONPBUnmarshaler) + return ok + } + return false +} + +func (u *Unmarshaler) unmarshalValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { + switch { + case fd.IsList(): + var jsonArray []json.RawMessage + if err := json.Unmarshal(in, &jsonArray); err != nil { + return v, err + } + lv := v.List() + for _, raw := range jsonArray { + ve, err := u.unmarshalSingularValue(lv.NewElement(), raw, fd) + if err != nil { + return v, err + } + lv.Append(ve) + } + return v, nil + case fd.IsMap(): + var jsonObject map[string]json.RawMessage + if err := json.Unmarshal(in, &jsonObject); err != nil { + return v, err + } + kfd := fd.MapKey() + vfd := fd.MapValue() + mv := v.Map() + for key, raw := range jsonObject { + var kv protoreflect.MapKey + if kfd.Kind() == protoreflect.StringKind { + kv = protoreflect.ValueOf(key).MapKey() + } else { + v, err := u.unmarshalSingularValue(kfd.Default(), []byte(key), kfd) + if err != nil { + return v, err + } + kv = v.MapKey() + } + + vv, err := u.unmarshalSingularValue(mv.NewValue(), raw, vfd) + if err != nil { + return v, err + } + mv.Set(kv, vv) + } + return v, nil + default: + return u.unmarshalSingularValue(v, in, fd) + } +} + +var nonFinite = map[string]float64{ + `"NaN"`: math.NaN(), + `"Infinity"`: math.Inf(+1), + `"-Infinity"`: math.Inf(-1), +} + +func (u *Unmarshaler) unmarshalSingularValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { + switch fd.Kind() { + case protoreflect.BoolKind: + return unmarshalValue(in, new(bool)) + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + return unmarshalValue(trimQuote(in), new(int32)) + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + return unmarshalValue(trimQuote(in), new(int64)) + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + return unmarshalValue(trimQuote(in), new(uint32)) + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + return unmarshalValue(trimQuote(in), new(uint64)) + case protoreflect.FloatKind: + if f, ok := nonFinite[string(in)]; ok { + return protoreflect.ValueOfFloat32(float32(f)), nil + } + return unmarshalValue(trimQuote(in), new(float32)) + case protoreflect.DoubleKind: + if f, ok := nonFinite[string(in)]; ok { + return protoreflect.ValueOfFloat64(float64(f)), nil + } + return unmarshalValue(trimQuote(in), new(float64)) + case protoreflect.StringKind: + return unmarshalValue(in, new(string)) + case protoreflect.BytesKind: + return unmarshalValue(in, new([]byte)) + case protoreflect.EnumKind: + if hasPrefixAndSuffix('"', in, '"') { + vd := fd.Enum().Values().ByName(protoreflect.Name(trimQuote(in))) + if vd == nil { + return v, fmt.Errorf("unknown value %q for enum %s", in, fd.Enum().FullName()) + } + return protoreflect.ValueOfEnum(vd.Number()), nil + } + return unmarshalValue(in, new(protoreflect.EnumNumber)) + case protoreflect.MessageKind, protoreflect.GroupKind: + err := u.unmarshalMessage(v.Message(), in) + return v, err + default: + panic(fmt.Sprintf("invalid kind %v", fd.Kind())) + } +} + +func unmarshalValue(in []byte, v interface{}) (protoreflect.Value, error) { + err := json.Unmarshal(in, v) + return protoreflect.ValueOf(reflect.ValueOf(v).Elem().Interface()), err +} + +func unquoteString(in string) (out string, err error) { + err = json.Unmarshal([]byte(in), &out) + return out, err +} + +func hasPrefixAndSuffix(prefix byte, in []byte, suffix byte) bool { + if len(in) >= 2 && in[0] == prefix && in[len(in)-1] == suffix { + return true + } + return false +} + +// trimQuote is like unquoteString but simply strips surrounding quotes. +// This is incorrect, but is behavior done by the legacy implementation. +func trimQuote(in []byte) []byte { + if len(in) >= 2 && in[0] == '"' && in[len(in)-1] == '"' { + in = in[1 : len(in)-1] + } + return in +} diff --git a/cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/encode.go b/cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/encode.go new file mode 100644 index 000000000000..685c80a62bc9 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/encode.go @@ -0,0 +1,559 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package jsonpb + +import ( + "encoding/json" + "errors" + "fmt" + "io" + "math" + "reflect" + "sort" + "strconv" + "strings" + "time" + + "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/encoding/protojson" + protoV2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" +) + +const wrapJSONMarshalV2 = false + +// Marshaler is a configurable object for marshaling protocol buffer messages +// to the specified JSON representation. +type Marshaler struct { + // OrigName specifies whether to use the original protobuf name for fields. + OrigName bool + + // EnumsAsInts specifies whether to render enum values as integers, + // as opposed to string values. + EnumsAsInts bool + + // EmitDefaults specifies whether to render fields with zero values. + EmitDefaults bool + + // Indent controls whether the output is compact or not. + // If empty, the output is compact JSON. Otherwise, every JSON object + // entry and JSON array value will be on its own line. + // Each line will be preceded by repeated copies of Indent, where the + // number of copies is the current indentation depth. + Indent string + + // AnyResolver is used to resolve the google.protobuf.Any well-known type. + // If unset, the global registry is used by default. + AnyResolver AnyResolver +} + +// JSONPBMarshaler is implemented by protobuf messages that customize the +// way they are marshaled to JSON. Messages that implement this should also +// implement JSONPBUnmarshaler so that the custom format can be parsed. +// +// The JSON marshaling must follow the proto to JSON specification: +// https://developers.google.com/protocol-buffers/docs/proto3#json +// +// Deprecated: Custom types should implement protobuf reflection instead. +type JSONPBMarshaler interface { + MarshalJSONPB(*Marshaler) ([]byte, error) +} + +// Marshal serializes a protobuf message as JSON into w. +func (jm *Marshaler) Marshal(w io.Writer, m proto.Message) error { + b, err := jm.marshal(m) + if len(b) > 0 { + if _, err := w.Write(b); err != nil { + return err + } + } + return err +} + +// MarshalToString serializes a protobuf message as JSON in string form. +func (jm *Marshaler) MarshalToString(m proto.Message) (string, error) { + b, err := jm.marshal(m) + if err != nil { + return "", err + } + return string(b), nil +} + +func (jm *Marshaler) marshal(m proto.Message) ([]byte, error) { + v := reflect.ValueOf(m) + if m == nil || (v.Kind() == reflect.Ptr && v.IsNil()) { + return nil, errors.New("Marshal called with nil") + } + + // Check for custom marshalers first since they may not properly + // implement protobuf reflection that the logic below relies on. + if jsm, ok := m.(JSONPBMarshaler); ok { + return jsm.MarshalJSONPB(jm) + } + + if wrapJSONMarshalV2 { + opts := protojson.MarshalOptions{ + UseProtoNames: jm.OrigName, + UseEnumNumbers: jm.EnumsAsInts, + EmitUnpopulated: jm.EmitDefaults, + Indent: jm.Indent, + } + if jm.AnyResolver != nil { + opts.Resolver = anyResolver{jm.AnyResolver} + } + return opts.Marshal(proto.MessageReflect(m).Interface()) + } else { + // Check for unpopulated required fields first. + m2 := proto.MessageReflect(m) + if err := protoV2.CheckInitialized(m2.Interface()); err != nil { + return nil, err + } + + w := jsonWriter{Marshaler: jm} + err := w.marshalMessage(m2, "", "") + return w.buf, err + } +} + +type jsonWriter struct { + *Marshaler + buf []byte +} + +func (w *jsonWriter) write(s string) { + w.buf = append(w.buf, s...) +} + +func (w *jsonWriter) marshalMessage(m protoreflect.Message, indent, typeURL string) error { + if jsm, ok := proto.MessageV1(m.Interface()).(JSONPBMarshaler); ok { + b, err := jsm.MarshalJSONPB(w.Marshaler) + if err != nil { + return err + } + if typeURL != "" { + // we are marshaling this object to an Any type + var js map[string]*json.RawMessage + if err = json.Unmarshal(b, &js); err != nil { + return fmt.Errorf("type %T produced invalid JSON: %v", m.Interface(), err) + } + turl, err := json.Marshal(typeURL) + if err != nil { + return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err) + } + js["@type"] = (*json.RawMessage)(&turl) + if b, err = json.Marshal(js); err != nil { + return err + } + } + w.write(string(b)) + return nil + } + + md := m.Descriptor() + fds := md.Fields() + + // Handle well-known types. + const secondInNanos = int64(time.Second / time.Nanosecond) + switch wellKnownType(md.FullName()) { + case "Any": + return w.marshalAny(m, indent) + case "BoolValue", "BytesValue", "StringValue", + "Int32Value", "UInt32Value", "FloatValue", + "Int64Value", "UInt64Value", "DoubleValue": + fd := fds.ByNumber(1) + return w.marshalValue(fd, m.Get(fd), indent) + case "Duration": + const maxSecondsInDuration = 315576000000 + // "Generated output always contains 0, 3, 6, or 9 fractional digits, + // depending on required precision." + s := m.Get(fds.ByNumber(1)).Int() + ns := m.Get(fds.ByNumber(2)).Int() + if s < -maxSecondsInDuration || s > maxSecondsInDuration { + return fmt.Errorf("seconds out of range %v", s) + } + if ns <= -secondInNanos || ns >= secondInNanos { + return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos) + } + if (s > 0 && ns < 0) || (s < 0 && ns > 0) { + return errors.New("signs of seconds and nanos do not match") + } + var sign string + if s < 0 || ns < 0 { + sign, s, ns = "-", -1*s, -1*ns + } + x := fmt.Sprintf("%s%d.%09d", sign, s, ns) + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, ".000") + w.write(fmt.Sprintf(`"%vs"`, x)) + return nil + case "Timestamp": + // "RFC 3339, where generated output will always be Z-normalized + // and uses 0, 3, 6 or 9 fractional digits." + s := m.Get(fds.ByNumber(1)).Int() + ns := m.Get(fds.ByNumber(2)).Int() + if ns < 0 || ns >= secondInNanos { + return fmt.Errorf("ns out of range [0, %v)", secondInNanos) + } + t := time.Unix(s, ns).UTC() + // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits). + x := t.Format("2006-01-02T15:04:05.000000000") + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, ".000") + w.write(fmt.Sprintf(`"%vZ"`, x)) + return nil + case "Value": + // JSON value; which is a null, number, string, bool, object, or array. + od := md.Oneofs().Get(0) + fd := m.WhichOneof(od) + if fd == nil { + return errors.New("nil Value") + } + return w.marshalValue(fd, m.Get(fd), indent) + case "Struct", "ListValue": + // JSON object or array. + fd := fds.ByNumber(1) + return w.marshalValue(fd, m.Get(fd), indent) + } + + w.write("{") + if w.Indent != "" { + w.write("\n") + } + + firstField := true + if typeURL != "" { + if err := w.marshalTypeURL(indent, typeURL); err != nil { + return err + } + firstField = false + } + + for i := 0; i < fds.Len(); { + fd := fds.Get(i) + if od := fd.ContainingOneof(); od != nil { + fd = m.WhichOneof(od) + i += od.Fields().Len() + if fd == nil { + continue + } + } else { + i++ + } + + v := m.Get(fd) + + if !m.Has(fd) { + if !w.EmitDefaults || fd.ContainingOneof() != nil { + continue + } + if fd.Cardinality() != protoreflect.Repeated && (fd.Message() != nil || fd.Syntax() == protoreflect.Proto2) { + v = protoreflect.Value{} // use "null" for singular messages or proto2 scalars + } + } + + if !firstField { + w.writeComma() + } + if err := w.marshalField(fd, v, indent); err != nil { + return err + } + firstField = false + } + + // Handle proto2 extensions. + if md.ExtensionRanges().Len() > 0 { + // Collect a sorted list of all extension descriptor and values. + type ext struct { + desc protoreflect.FieldDescriptor + val protoreflect.Value + } + var exts []ext + m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { + if fd.IsExtension() { + exts = append(exts, ext{fd, v}) + } + return true + }) + sort.Slice(exts, func(i, j int) bool { + return exts[i].desc.Number() < exts[j].desc.Number() + }) + + for _, ext := range exts { + if !firstField { + w.writeComma() + } + if err := w.marshalField(ext.desc, ext.val, indent); err != nil { + return err + } + firstField = false + } + } + + if w.Indent != "" { + w.write("\n") + w.write(indent) + } + w.write("}") + return nil +} + +func (w *jsonWriter) writeComma() { + if w.Indent != "" { + w.write(",\n") + } else { + w.write(",") + } +} + +func (w *jsonWriter) marshalAny(m protoreflect.Message, indent string) error { + // "If the Any contains a value that has a special JSON mapping, + // it will be converted as follows: {"@type": xxx, "value": yyy}. + // Otherwise, the value will be converted into a JSON object, + // and the "@type" field will be inserted to indicate the actual data type." + md := m.Descriptor() + typeURL := m.Get(md.Fields().ByNumber(1)).String() + rawVal := m.Get(md.Fields().ByNumber(2)).Bytes() + + var m2 protoreflect.Message + if w.AnyResolver != nil { + mi, err := w.AnyResolver.Resolve(typeURL) + if err != nil { + return err + } + m2 = proto.MessageReflect(mi) + } else { + mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL) + if err != nil { + return err + } + m2 = mt.New() + } + + if err := protoV2.Unmarshal(rawVal, m2.Interface()); err != nil { + return err + } + + if wellKnownType(m2.Descriptor().FullName()) == "" { + return w.marshalMessage(m2, indent, typeURL) + } + + w.write("{") + if w.Indent != "" { + w.write("\n") + } + if err := w.marshalTypeURL(indent, typeURL); err != nil { + return err + } + w.writeComma() + if w.Indent != "" { + w.write(indent) + w.write(w.Indent) + w.write(`"value": `) + } else { + w.write(`"value":`) + } + if err := w.marshalMessage(m2, indent+w.Indent, ""); err != nil { + return err + } + if w.Indent != "" { + w.write("\n") + w.write(indent) + } + w.write("}") + return nil +} + +func (w *jsonWriter) marshalTypeURL(indent, typeURL string) error { + if w.Indent != "" { + w.write(indent) + w.write(w.Indent) + } + w.write(`"@type":`) + if w.Indent != "" { + w.write(" ") + } + b, err := json.Marshal(typeURL) + if err != nil { + return err + } + w.write(string(b)) + return nil +} + +// marshalField writes field description and value to the Writer. +func (w *jsonWriter) marshalField(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { + if w.Indent != "" { + w.write(indent) + w.write(w.Indent) + } + w.write(`"`) + switch { + case fd.IsExtension(): + // For message set, use the fname of the message as the extension name. + name := string(fd.FullName()) + if isMessageSet(fd.ContainingMessage()) { + name = strings.TrimSuffix(name, ".message_set_extension") + } + + w.write("[" + name + "]") + case w.OrigName: + name := string(fd.Name()) + if fd.Kind() == protoreflect.GroupKind { + name = string(fd.Message().Name()) + } + w.write(name) + default: + w.write(string(fd.JSONName())) + } + w.write(`":`) + if w.Indent != "" { + w.write(" ") + } + return w.marshalValue(fd, v, indent) +} + +func (w *jsonWriter) marshalValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { + switch { + case fd.IsList(): + w.write("[") + comma := "" + lv := v.List() + for i := 0; i < lv.Len(); i++ { + w.write(comma) + if w.Indent != "" { + w.write("\n") + w.write(indent) + w.write(w.Indent) + w.write(w.Indent) + } + if err := w.marshalSingularValue(fd, lv.Get(i), indent+w.Indent); err != nil { + return err + } + comma = "," + } + if w.Indent != "" { + w.write("\n") + w.write(indent) + w.write(w.Indent) + } + w.write("]") + return nil + case fd.IsMap(): + kfd := fd.MapKey() + vfd := fd.MapValue() + mv := v.Map() + + // Collect a sorted list of all map keys and values. + type entry struct{ key, val protoreflect.Value } + var entries []entry + mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { + entries = append(entries, entry{k.Value(), v}) + return true + }) + sort.Slice(entries, func(i, j int) bool { + switch kfd.Kind() { + case protoreflect.BoolKind: + return !entries[i].key.Bool() && entries[j].key.Bool() + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + return entries[i].key.Int() < entries[j].key.Int() + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + return entries[i].key.Uint() < entries[j].key.Uint() + case protoreflect.StringKind: + return entries[i].key.String() < entries[j].key.String() + default: + panic("invalid kind") + } + }) + + w.write(`{`) + comma := "" + for _, entry := range entries { + w.write(comma) + if w.Indent != "" { + w.write("\n") + w.write(indent) + w.write(w.Indent) + w.write(w.Indent) + } + + s := fmt.Sprint(entry.key.Interface()) + b, err := json.Marshal(s) + if err != nil { + return err + } + w.write(string(b)) + + w.write(`:`) + if w.Indent != "" { + w.write(` `) + } + + if err := w.marshalSingularValue(vfd, entry.val, indent+w.Indent); err != nil { + return err + } + comma = "," + } + if w.Indent != "" { + w.write("\n") + w.write(indent) + w.write(w.Indent) + } + w.write(`}`) + return nil + default: + return w.marshalSingularValue(fd, v, indent) + } +} + +func (w *jsonWriter) marshalSingularValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { + switch { + case !v.IsValid(): + w.write("null") + return nil + case fd.Message() != nil: + return w.marshalMessage(v.Message(), indent+w.Indent, "") + case fd.Enum() != nil: + if fd.Enum().FullName() == "google.protobuf.NullValue" { + w.write("null") + return nil + } + + vd := fd.Enum().Values().ByNumber(v.Enum()) + if vd == nil || w.EnumsAsInts { + w.write(strconv.Itoa(int(v.Enum()))) + } else { + w.write(`"` + string(vd.Name()) + `"`) + } + return nil + default: + switch v.Interface().(type) { + case float32, float64: + switch { + case math.IsInf(v.Float(), +1): + w.write(`"Infinity"`) + return nil + case math.IsInf(v.Float(), -1): + w.write(`"-Infinity"`) + return nil + case math.IsNaN(v.Float()): + w.write(`"NaN"`) + return nil + } + case int64, uint64: + w.write(fmt.Sprintf(`"%d"`, v.Interface())) + return nil + } + + b, err := json.Marshal(v.Interface()) + if err != nil { + return err + } + w.write(string(b)) + return nil + } +} diff --git a/cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/json.go b/cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/json.go new file mode 100644 index 000000000000..480e2448de66 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/golang/protobuf/jsonpb/json.go @@ -0,0 +1,69 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package jsonpb provides functionality to marshal and unmarshal between a +// protocol buffer message and JSON. It follows the specification at +// https://developers.google.com/protocol-buffers/docs/proto3#json. +// +// Do not rely on the default behavior of the standard encoding/json package +// when called on generated message types as it does not operate correctly. +// +// Deprecated: Use the "google.golang.org/protobuf/encoding/protojson" +// package instead. +package jsonpb + +import ( + "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/runtime/protoimpl" +) + +// AnyResolver takes a type URL, present in an Any message, +// and resolves it into an instance of the associated message. +type AnyResolver interface { + Resolve(typeURL string) (proto.Message, error) +} + +type anyResolver struct{ AnyResolver } + +func (r anyResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { + return r.FindMessageByURL(string(message)) +} + +func (r anyResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { + m, err := r.Resolve(url) + if err != nil { + return nil, err + } + return protoimpl.X.MessageTypeOf(m), nil +} + +func (r anyResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { + return protoregistry.GlobalTypes.FindExtensionByName(field) +} + +func (r anyResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { + return protoregistry.GlobalTypes.FindExtensionByNumber(message, field) +} + +func wellKnownType(s protoreflect.FullName) string { + if s.Parent() == "google.protobuf" { + switch s.Name() { + case "Empty", "Any", + "BoolValue", "BytesValue", "StringValue", + "Int32Value", "UInt32Value", "FloatValue", + "Int64Value", "UInt64Value", "DoubleValue", + "Duration", "Timestamp", + "NullValue", "Struct", "Value", "ListValue": + return string(s.Name()) + } + } + return "" +} + +func isMessageSet(md protoreflect.MessageDescriptor) bool { + ms, ok := md.(interface{ IsMessageSet() bool }) + return ok && ms.IsMessageSet() +} diff --git a/cluster-autoscaler/vendor/github.com/golang/protobuf/proto/registry.go b/cluster-autoscaler/vendor/github.com/golang/protobuf/proto/registry.go index 1e7ff6420577..066b4323b499 100644 --- a/cluster-autoscaler/vendor/github.com/golang/protobuf/proto/registry.go +++ b/cluster-autoscaler/vendor/github.com/golang/protobuf/proto/registry.go @@ -13,6 +13,7 @@ import ( "strings" "sync" + "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/runtime/protoimpl" @@ -62,14 +63,7 @@ func FileDescriptor(s filePath) fileDescGZIP { // Find the descriptor in the v2 registry. var b []byte if fd, _ := protoregistry.GlobalFiles.FindFileByPath(s); fd != nil { - if fd, ok := fd.(interface{ ProtoLegacyRawDesc() []byte }); ok { - b = fd.ProtoLegacyRawDesc() - } else { - // TODO: Use protodesc.ToFileDescriptorProto to construct - // a descriptorpb.FileDescriptorProto and marshal it. - // However, doing so causes the proto package to have a dependency - // on descriptorpb, leading to cyclic dependency issues. - } + b, _ = Marshal(protodesc.ToFileDescriptorProto(fd)) } // Locally cache the raw descriptor form for the file. diff --git a/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/any.go b/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/any.go index e729dcff13c2..85f9f57365fd 100644 --- a/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/any.go +++ b/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/any.go @@ -19,6 +19,8 @@ const urlPrefix = "type.googleapis.com/" // AnyMessageName returns the message name contained in an anypb.Any message. // Most type assertions should use the Is function instead. +// +// Deprecated: Call the any.MessageName method instead. func AnyMessageName(any *anypb.Any) (string, error) { name, err := anyMessageName(any) return string(name), err @@ -38,6 +40,8 @@ func anyMessageName(any *anypb.Any) (protoreflect.FullName, error) { } // MarshalAny marshals the given message m into an anypb.Any message. +// +// Deprecated: Call the anypb.New function instead. func MarshalAny(m proto.Message) (*anypb.Any, error) { switch dm := m.(type) { case DynamicAny: @@ -58,6 +62,9 @@ func MarshalAny(m proto.Message) (*anypb.Any, error) { // Empty returns a new message of the type specified in an anypb.Any message. // It returns protoregistry.NotFound if the corresponding message type could not // be resolved in the global registry. +// +// Deprecated: Use protoregistry.GlobalTypes.FindMessageByName instead +// to resolve the message name and create a new instance of it. func Empty(any *anypb.Any) (proto.Message, error) { name, err := anyMessageName(any) if err != nil { @@ -76,6 +83,8 @@ func Empty(any *anypb.Any) (proto.Message, error) { // // The target message m may be a *DynamicAny message. If the underlying message // type could not be resolved, then this returns protoregistry.NotFound. +// +// Deprecated: Call the any.UnmarshalTo method instead. func UnmarshalAny(any *anypb.Any, m proto.Message) error { if dm, ok := m.(*DynamicAny); ok { if dm.Message == nil { @@ -100,6 +109,8 @@ func UnmarshalAny(any *anypb.Any, m proto.Message) error { } // Is reports whether the Any message contains a message of the specified type. +// +// Deprecated: Call the any.MessageIs method instead. func Is(any *anypb.Any, m proto.Message) bool { if any == nil || m == nil { return false @@ -119,6 +130,9 @@ func Is(any *anypb.Any, m proto.Message) bool { // var x ptypes.DynamicAny // if err := ptypes.UnmarshalAny(a, &x); err != nil { ... } // fmt.Printf("unmarshaled message: %v", x.Message) +// +// Deprecated: Use the any.UnmarshalNew method instead to unmarshal +// the any message contents into a new instance of the underlying message. type DynamicAny struct{ proto.Message } func (m DynamicAny) String() string { diff --git a/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/doc.go b/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/doc.go index fb9edd5c6273..d3c33259d28d 100644 --- a/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/doc.go +++ b/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/doc.go @@ -3,4 +3,8 @@ // license that can be found in the LICENSE file. // Package ptypes provides functionality for interacting with well-known types. +// +// Deprecated: Well-known types have specialized functionality directly +// injected into the generated packages for each message type. +// See the deprecation notice for each function for the suggested alternative. package ptypes diff --git a/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/duration.go b/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/duration.go index 6110ae8a41d9..b2b55dd851f5 100644 --- a/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/duration.go +++ b/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/duration.go @@ -21,6 +21,8 @@ const ( // Duration converts a durationpb.Duration to a time.Duration. // Duration returns an error if dur is invalid or overflows a time.Duration. +// +// Deprecated: Call the dur.AsDuration and dur.CheckValid methods instead. func Duration(dur *durationpb.Duration) (time.Duration, error) { if err := validateDuration(dur); err != nil { return 0, err @@ -39,6 +41,8 @@ func Duration(dur *durationpb.Duration) (time.Duration, error) { } // DurationProto converts a time.Duration to a durationpb.Duration. +// +// Deprecated: Call the durationpb.New function instead. func DurationProto(d time.Duration) *durationpb.Duration { nanos := d.Nanoseconds() secs := nanos / 1e9 diff --git a/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/timestamp.go b/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/timestamp.go index 026d0d49155d..8368a3f70d38 100644 --- a/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/timestamp.go +++ b/cluster-autoscaler/vendor/github.com/golang/protobuf/ptypes/timestamp.go @@ -33,6 +33,8 @@ const ( // // A nil Timestamp returns an error. The first return value in that case is // undefined. +// +// Deprecated: Call the ts.AsTime and ts.CheckValid methods instead. func Timestamp(ts *timestamppb.Timestamp) (time.Time, error) { // Don't return the zero value on error, because corresponds to a valid // timestamp. Instead return whatever time.Unix gives us. @@ -46,6 +48,8 @@ func Timestamp(ts *timestamppb.Timestamp) (time.Time, error) { } // TimestampNow returns a google.protobuf.Timestamp for the current time. +// +// Deprecated: Call the timestamppb.Now function instead. func TimestampNow() *timestamppb.Timestamp { ts, err := TimestampProto(time.Now()) if err != nil { @@ -56,6 +60,8 @@ func TimestampNow() *timestamppb.Timestamp { // TimestampProto converts the time.Time to a google.protobuf.Timestamp proto. // It returns an error if the resulting Timestamp is invalid. +// +// Deprecated: Call the timestamppb.New function instead. func TimestampProto(t time.Time) (*timestamppb.Timestamp, error) { ts := ×tamppb.Timestamp{ Seconds: t.Unix(), @@ -69,6 +75,9 @@ func TimestampProto(t time.Time) (*timestamppb.Timestamp, error) { // TimestampString returns the RFC 3339 string for valid Timestamps. // For invalid Timestamps, it returns an error message in parentheses. +// +// Deprecated: Call the ts.AsTime method instead, +// followed by a call to the Format method on the time.Time value. func TimestampString(ts *timestamppb.Timestamp) string { t, err := Timestamp(ts) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go index 51ce36fb60da..e4ffca838a17 100644 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go @@ -11,7 +11,6 @@ import ( "time" "github.com/google/go-cmp/cmp" - "golang.org/x/xerrors" ) func equateAlways(_, _ interface{}) bool { return true } @@ -147,10 +146,3 @@ func areConcreteErrors(x, y interface{}) bool { _, ok2 := y.(error) return ok1 && ok2 } - -func compareErrors(x, y interface{}) bool { - xe := x.(error) - ye := y.(error) - // TODO(≥go1.13): Use standard definition of errors.Is. - return xerrors.Is(xe, ye) || xerrors.Is(ye, xe) -} diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/errors_go113.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/errors_go113.go new file mode 100644 index 000000000000..26fe25d6afbc --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/errors_go113.go @@ -0,0 +1,15 @@ +// Copyright 2021, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.13 + +package cmpopts + +import "errors" + +func compareErrors(x, y interface{}) bool { + xe := x.(error) + ye := y.(error) + return errors.Is(xe, ye) || errors.Is(ye, xe) +} diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/errors_xerrors.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/errors_xerrors.go new file mode 100644 index 000000000000..6eeb8d6e6543 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/cmpopts/errors_xerrors.go @@ -0,0 +1,18 @@ +// Copyright 2021, The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.13 + +// TODO(≥go1.13): For support on 0: return false // Some ignore option was used case v.NumTransformed > 0: @@ -45,7 +43,16 @@ func (opts formatOptions) CanFormatDiffSlice(v *valueNode) bool { return false } - switch t := v.Type; t.Kind() { + // Check whether this is an interface with the same concrete types. + t := v.Type + vx, vy := v.ValueX, v.ValueY + if t.Kind() == reflect.Interface && !vx.IsNil() && !vy.IsNil() && vx.Elem().Type() == vy.Elem().Type() { + vx, vy = vx.Elem(), vy.Elem() + t = vx.Type() + } + + // Check whether we provide specialized diffing for this type. + switch t.Kind() { case reflect.String: case reflect.Array, reflect.Slice: // Only slices of primitive types have specialized handling. @@ -57,6 +64,11 @@ func (opts formatOptions) CanFormatDiffSlice(v *valueNode) bool { return false } + // Both slice values have to be non-empty. + if t.Kind() == reflect.Slice && (vx.Len() == 0 || vy.Len() == 0) { + return false + } + // If a sufficient number of elements already differ, // use specialized formatting even if length requirement is not met. if v.NumDiff > v.NumSame { @@ -68,7 +80,7 @@ func (opts formatOptions) CanFormatDiffSlice(v *valueNode) bool { // Use specialized string diffing for longer slices or strings. const minLength = 64 - return v.ValueX.Len() >= minLength && v.ValueY.Len() >= minLength + return vx.Len() >= minLength && vy.Len() >= minLength } // FormatDiffSlice prints a diff for the slices (or strings) represented by v. @@ -77,6 +89,11 @@ func (opts formatOptions) CanFormatDiffSlice(v *valueNode) bool { func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { assert(opts.DiffMode == diffUnknown) t, vx, vy := v.Type, v.ValueX, v.ValueY + if t.Kind() == reflect.Interface { + vx, vy = vx.Elem(), vy.Elem() + t = vx.Type() + opts = opts.WithTypeMode(emitType) + } // Auto-detect the type of the data. var isLinedText, isText, isBinary bool diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/context.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/context.go index 1250a6c592bd..1bfe9612194b 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/context.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/context.go @@ -14,30 +14,36 @@ package compiler +import ( + yaml "gopkg.in/yaml.v3" +) + // Context contains state of the compiler as it traverses a document. type Context struct { Parent *Context Name string + Node *yaml.Node ExtensionHandlers *[]ExtensionHandler } // NewContextWithExtensions returns a new object representing the compiler state -func NewContextWithExtensions(name string, parent *Context, extensionHandlers *[]ExtensionHandler) *Context { - return &Context{Name: name, Parent: parent, ExtensionHandlers: extensionHandlers} +func NewContextWithExtensions(name string, node *yaml.Node, parent *Context, extensionHandlers *[]ExtensionHandler) *Context { + return &Context{Name: name, Node: node, Parent: parent, ExtensionHandlers: extensionHandlers} } // NewContext returns a new object representing the compiler state -func NewContext(name string, parent *Context) *Context { +func NewContext(name string, node *yaml.Node, parent *Context) *Context { if parent != nil { - return &Context{Name: name, Parent: parent, ExtensionHandlers: parent.ExtensionHandlers} + return &Context{Name: name, Node: node, Parent: parent, ExtensionHandlers: parent.ExtensionHandlers} } return &Context{Name: name, Parent: parent, ExtensionHandlers: nil} } // Description returns a text description of the compiler state func (context *Context) Description() string { + name := context.Name if context.Parent != nil { - return context.Parent.Description() + "." + context.Name + name = context.Parent.Description() + "." + name } - return context.Name + return name } diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/error.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/error.go index 7db23997bad9..6f40515d6b6e 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/error.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/error.go @@ -14,6 +14,8 @@ package compiler +import "fmt" + // Error represents compiler errors and their location in the document. type Error struct { Context *Context @@ -25,12 +27,19 @@ func NewError(context *Context, message string) *Error { return &Error{Context: context, Message: message} } +func (err *Error) locationDescription() string { + if err.Context.Node != nil { + return fmt.Sprintf("[%d,%d] %s", err.Context.Node.Line, err.Context.Node.Column, err.Context.Description()) + } + return err.Context.Description() +} + // Error returns the string value of an Error. func (err *Error) Error() string { if err.Context == nil { - return "ERROR " + err.Message + return err.Message } - return "ERROR " + err.Context.Description() + " " + err.Message + return err.locationDescription() + " " + err.Message } // ErrorGroup is a container for groups of Error values. diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/helpers.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/helpers.go index a580f40ac311..48f02f3950ec 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/helpers.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/compiler/helpers.go @@ -176,6 +176,8 @@ func StringForScalarNode(node *yaml.Node) (string, bool) { return node.Value, true case "!!str": return node.Value, true + case "!!timestamp": + return node.Value, true case "!!null": return "", true default: @@ -241,6 +243,15 @@ func InvalidKeysInMap(m *yaml.Node, allowedKeys []string, allowedPatterns []*reg return invalidKeys } +// NewNullNode creates a new Null node. +func NewNullNode() *yaml.Node { + node := &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: "!!null", + } + return node +} + // NewMappingNode creates a new Mapping node. func NewMappingNode() *yaml.Node { return &yaml.Node{ diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go index 4198fa17e9b4..5aab58ebfbe4 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go @@ -14,17 +14,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.26.0 +// protoc v3.15.5 // source: extensions/extension.proto package gnostic_extension_v1 import ( - proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" reflect "reflect" sync "sync" ) @@ -36,10 +35,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // The version number of Gnostic. type Version struct { state protoimpl.MessageState @@ -191,7 +186,7 @@ type ExtensionHandlerResponse struct { // status code. Errors []string `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"` // text output - Value *any.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + Value *anypb.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` } func (x *ExtensionHandlerResponse) Reset() { @@ -240,7 +235,7 @@ func (x *ExtensionHandlerResponse) GetErrors() []string { return nil } -func (x *ExtensionHandlerResponse) GetValue() *any.Any { +func (x *ExtensionHandlerResponse) GetValue() *anypb.Any { if x != nil { return x.Value } @@ -350,12 +345,13 @@ var file_extensions_extension_proto_rawDesc = []byte{ 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x42, 0x4b, 0x0a, 0x0e, 0x6f, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x42, 0x4d, 0x0a, 0x0e, 0x6f, 0x72, 0x67, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x47, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x50, - 0x01, 0x5a, 0x1f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x67, 0x6e, - 0x6f, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x4e, 0x58, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x21, 0x2e, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3b, + 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x4e, 0x58, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -376,7 +372,7 @@ var file_extensions_extension_proto_goTypes = []interface{}{ (*ExtensionHandlerRequest)(nil), // 1: gnostic.extension.v1.ExtensionHandlerRequest (*ExtensionHandlerResponse)(nil), // 2: gnostic.extension.v1.ExtensionHandlerResponse (*Wrapper)(nil), // 3: gnostic.extension.v1.Wrapper - (*any.Any)(nil), // 4: google.protobuf.Any + (*anypb.Any)(nil), // 4: google.protobuf.Any } var file_extensions_extension_proto_depIdxs = []int32{ 3, // 0: gnostic.extension.v1.ExtensionHandlerRequest.wrapper:type_name -> gnostic.extension.v1.Wrapper diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.proto b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.proto index 8ac1faffc056..875137c1a860 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.proto +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/extensions/extension.proto @@ -38,10 +38,11 @@ option java_package = "org.gnostic.v1"; // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. // -option objc_class_prefix = "GNX"; // "Gnostic Extension" +// "Gnostic Extension" +option objc_class_prefix = "GNX"; // The Go package name. -option go_package = "extensions;gnostic_extension_v1"; +option go_package = "./extensions;gnostic_extension_v1"; // The version number of Gnostic. message Version { diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.go index af6c0eee0797..727d7f4ad525 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.go @@ -39,7 +39,7 @@ func NewAdditionalPropertiesItem(in *yaml.Node, context *compiler.Context) (*Add m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewSchema(m, compiler.NewContext("schema", context)) + t, matchingError := NewSchema(m, compiler.NewContext("schema", m, context)) if matchingError == nil { x.Oneof = &AdditionalPropertiesItem_Schema{Schema: t} matched = true @@ -57,6 +57,10 @@ func NewAdditionalPropertiesItem(in *yaml.Node, context *compiler.Context) (*Add if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) + } else { + message := fmt.Sprintf("contains an invalid AdditionalPropertiesItem") + err := compiler.NewError(context, message) + errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } @@ -162,7 +166,7 @@ func NewApiKeySecurity(in *yaml.Node, context *compiler.Context) (*ApiKeySecurit pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -243,7 +247,7 @@ func NewBasicAuthenticationSecurity(in *yaml.Node, context *compiler.Context) (* pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -324,7 +328,7 @@ func NewBodyParameter(in *yaml.Node, context *compiler.Context) (*BodyParameter, v5 := compiler.MapValueForKey(m, "schema") if v5 != nil { var err error - x.Schema, err = NewSchema(v5, compiler.NewContext("schema", context)) + x.Schema, err = NewSchema(v5, compiler.NewContext("schema", v5, context)) if err != nil { errors = append(errors, err) } @@ -351,7 +355,7 @@ func NewBodyParameter(in *yaml.Node, context *compiler.Context) (*BodyParameter, pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -429,7 +433,7 @@ func NewContact(in *yaml.Node, context *compiler.Context) (*Contact, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -472,7 +476,7 @@ func NewDefault(in *yaml.Node, context *compiler.Context) (*Default, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -503,7 +507,7 @@ func NewDefinitions(in *yaml.Node, context *compiler.Context) (*Definitions, err pair := &NamedSchema{} pair.Name = k var err error - pair.Value, err = NewSchema(v, compiler.NewContext(k, context)) + pair.Value, err = NewSchema(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -555,7 +559,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { v2 := compiler.MapValueForKey(m, "info") if v2 != nil { var err error - x.Info, err = NewInfo(v2, compiler.NewContext("info", context)) + x.Info, err = NewInfo(v2, compiler.NewContext("info", v2, context)) if err != nil { errors = append(errors, err) } @@ -621,7 +625,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { v8 := compiler.MapValueForKey(m, "paths") if v8 != nil { var err error - x.Paths, err = NewPaths(v8, compiler.NewContext("paths", context)) + x.Paths, err = NewPaths(v8, compiler.NewContext("paths", v8, context)) if err != nil { errors = append(errors, err) } @@ -630,7 +634,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { v9 := compiler.MapValueForKey(m, "definitions") if v9 != nil { var err error - x.Definitions, err = NewDefinitions(v9, compiler.NewContext("definitions", context)) + x.Definitions, err = NewDefinitions(v9, compiler.NewContext("definitions", v9, context)) if err != nil { errors = append(errors, err) } @@ -639,7 +643,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { v10 := compiler.MapValueForKey(m, "parameters") if v10 != nil { var err error - x.Parameters, err = NewParameterDefinitions(v10, compiler.NewContext("parameters", context)) + x.Parameters, err = NewParameterDefinitions(v10, compiler.NewContext("parameters", v10, context)) if err != nil { errors = append(errors, err) } @@ -648,7 +652,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { v11 := compiler.MapValueForKey(m, "responses") if v11 != nil { var err error - x.Responses, err = NewResponseDefinitions(v11, compiler.NewContext("responses", context)) + x.Responses, err = NewResponseDefinitions(v11, compiler.NewContext("responses", v11, context)) if err != nil { errors = append(errors, err) } @@ -661,7 +665,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { a, ok := compiler.SequenceNodeForNode(v12) if ok { for _, item := range a.Content { - y, err := NewSecurityRequirement(item, compiler.NewContext("security", context)) + y, err := NewSecurityRequirement(item, compiler.NewContext("security", item, context)) if err != nil { errors = append(errors, err) } @@ -673,7 +677,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { v13 := compiler.MapValueForKey(m, "securityDefinitions") if v13 != nil { var err error - x.SecurityDefinitions, err = NewSecurityDefinitions(v13, compiler.NewContext("securityDefinitions", context)) + x.SecurityDefinitions, err = NewSecurityDefinitions(v13, compiler.NewContext("securityDefinitions", v13, context)) if err != nil { errors = append(errors, err) } @@ -686,7 +690,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { a, ok := compiler.SequenceNodeForNode(v14) if ok { for _, item := range a.Content { - y, err := NewTag(item, compiler.NewContext("tags", context)) + y, err := NewTag(item, compiler.NewContext("tags", item, context)) if err != nil { errors = append(errors, err) } @@ -698,7 +702,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { v15 := compiler.MapValueForKey(m, "externalDocs") if v15 != nil { var err error - x.ExternalDocs, err = NewExternalDocs(v15, compiler.NewContext("externalDocs", context)) + x.ExternalDocs, err = NewExternalDocs(v15, compiler.NewContext("externalDocs", v15, context)) if err != nil { errors = append(errors, err) } @@ -725,7 +729,7 @@ func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -768,7 +772,7 @@ func NewExamples(in *yaml.Node, context *compiler.Context) (*Examples, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -842,7 +846,7 @@ func NewExternalDocs(in *yaml.Node, context *compiler.Context) (*ExternalDocs, e pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -908,7 +912,7 @@ func NewFileSchema(in *yaml.Node, context *compiler.Context) (*FileSchema, error v4 := compiler.MapValueForKey(m, "default") if v4 != nil { var err error - x.Default, err = NewAny(v4, compiler.NewContext("default", context)) + x.Default, err = NewAny(v4, compiler.NewContext("default", v4, context)) if err != nil { errors = append(errors, err) } @@ -952,7 +956,7 @@ func NewFileSchema(in *yaml.Node, context *compiler.Context) (*FileSchema, error v8 := compiler.MapValueForKey(m, "externalDocs") if v8 != nil { var err error - x.ExternalDocs, err = NewExternalDocs(v8, compiler.NewContext("externalDocs", context)) + x.ExternalDocs, err = NewExternalDocs(v8, compiler.NewContext("externalDocs", v8, context)) if err != nil { errors = append(errors, err) } @@ -961,7 +965,7 @@ func NewFileSchema(in *yaml.Node, context *compiler.Context) (*FileSchema, error v9 := compiler.MapValueForKey(m, "example") if v9 != nil { var err error - x.Example, err = NewAny(v9, compiler.NewContext("example", context)) + x.Example, err = NewAny(v9, compiler.NewContext("example", v9, context)) if err != nil { errors = append(errors, err) } @@ -988,7 +992,7 @@ func NewFileSchema(in *yaml.Node, context *compiler.Context) (*FileSchema, error pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -1096,7 +1100,7 @@ func NewFormDataParameterSubSchema(in *yaml.Node, context *compiler.Context) (*F v8 := compiler.MapValueForKey(m, "items") if v8 != nil { var err error - x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", context)) + x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", v8, context)) if err != nil { errors = append(errors, err) } @@ -1120,7 +1124,7 @@ func NewFormDataParameterSubSchema(in *yaml.Node, context *compiler.Context) (*F v10 := compiler.MapValueForKey(m, "default") if v10 != nil { var err error - x.Default, err = NewAny(v10, compiler.NewContext("default", context)) + x.Default, err = NewAny(v10, compiler.NewContext("default", v10, context)) if err != nil { errors = append(errors, err) } @@ -1235,7 +1239,7 @@ func NewFormDataParameterSubSchema(in *yaml.Node, context *compiler.Context) (*F a, ok := compiler.SequenceNodeForNode(v21) if ok { for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", context)) + y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } @@ -1276,7 +1280,7 @@ func NewFormDataParameterSubSchema(in *yaml.Node, context *compiler.Context) (*F pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -1339,7 +1343,7 @@ func NewHeader(in *yaml.Node, context *compiler.Context) (*Header, error) { v3 := compiler.MapValueForKey(m, "items") if v3 != nil { var err error - x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", context)) + x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", v3, context)) if err != nil { errors = append(errors, err) } @@ -1363,7 +1367,7 @@ func NewHeader(in *yaml.Node, context *compiler.Context) (*Header, error) { v5 := compiler.MapValueForKey(m, "default") if v5 != nil { var err error - x.Default, err = NewAny(v5, compiler.NewContext("default", context)) + x.Default, err = NewAny(v5, compiler.NewContext("default", v5, context)) if err != nil { errors = append(errors, err) } @@ -1478,7 +1482,7 @@ func NewHeader(in *yaml.Node, context *compiler.Context) (*Header, error) { a, ok := compiler.SequenceNodeForNode(v16) if ok { for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", context)) + y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } @@ -1528,7 +1532,7 @@ func NewHeader(in *yaml.Node, context *compiler.Context) (*Header, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -1627,7 +1631,7 @@ func NewHeaderParameterSubSchema(in *yaml.Node, context *compiler.Context) (*Hea v7 := compiler.MapValueForKey(m, "items") if v7 != nil { var err error - x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", context)) + x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", v7, context)) if err != nil { errors = append(errors, err) } @@ -1651,7 +1655,7 @@ func NewHeaderParameterSubSchema(in *yaml.Node, context *compiler.Context) (*Hea v9 := compiler.MapValueForKey(m, "default") if v9 != nil { var err error - x.Default, err = NewAny(v9, compiler.NewContext("default", context)) + x.Default, err = NewAny(v9, compiler.NewContext("default", v9, context)) if err != nil { errors = append(errors, err) } @@ -1766,7 +1770,7 @@ func NewHeaderParameterSubSchema(in *yaml.Node, context *compiler.Context) (*Hea a, ok := compiler.SequenceNodeForNode(v20) if ok { for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", context)) + y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } @@ -1807,7 +1811,7 @@ func NewHeaderParameterSubSchema(in *yaml.Node, context *compiler.Context) (*Hea pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -1839,7 +1843,7 @@ func NewHeaders(in *yaml.Node, context *compiler.Context) (*Headers, error) { pair := &NamedHeader{} pair.Name = k var err error - pair.Value, err = NewHeader(v, compiler.NewContext(k, context)) + pair.Value, err = NewHeader(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -1912,7 +1916,7 @@ func NewInfo(in *yaml.Node, context *compiler.Context) (*Info, error) { v5 := compiler.MapValueForKey(m, "contact") if v5 != nil { var err error - x.Contact, err = NewContact(v5, compiler.NewContext("contact", context)) + x.Contact, err = NewContact(v5, compiler.NewContext("contact", v5, context)) if err != nil { errors = append(errors, err) } @@ -1921,7 +1925,7 @@ func NewInfo(in *yaml.Node, context *compiler.Context) (*Info, error) { v6 := compiler.MapValueForKey(m, "license") if v6 != nil { var err error - x.License, err = NewLicense(v6, compiler.NewContext("license", context)) + x.License, err = NewLicense(v6, compiler.NewContext("license", v6, context)) if err != nil { errors = append(errors, err) } @@ -1948,7 +1952,7 @@ func NewInfo(in *yaml.Node, context *compiler.Context) (*Info, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -1971,7 +1975,7 @@ func NewItemsItem(in *yaml.Node, context *compiler.Context) (*ItemsItem, error) errors = append(errors, compiler.NewError(context, message)) } else { x.Schema = make([]*Schema, 0) - y, err := NewSchema(m, compiler.NewContext("", context)) + y, err := NewSchema(m, compiler.NewContext("", m, context)) if err != nil { return nil, err } @@ -2079,7 +2083,7 @@ func NewLicense(in *yaml.Node, context *compiler.Context) (*License, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -2121,7 +2125,7 @@ func NewNamedAny(in *yaml.Node, context *compiler.Context) (*NamedAny, error) { v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error - x.Value, err = NewAny(v2, compiler.NewContext("value", context)) + x.Value, err = NewAny(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } @@ -2159,7 +2163,7 @@ func NewNamedHeader(in *yaml.Node, context *compiler.Context) (*NamedHeader, err v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error - x.Value, err = NewHeader(v2, compiler.NewContext("value", context)) + x.Value, err = NewHeader(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } @@ -2197,7 +2201,7 @@ func NewNamedParameter(in *yaml.Node, context *compiler.Context) (*NamedParamete v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error - x.Value, err = NewParameter(v2, compiler.NewContext("value", context)) + x.Value, err = NewParameter(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } @@ -2235,7 +2239,7 @@ func NewNamedPathItem(in *yaml.Node, context *compiler.Context) (*NamedPathItem, v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error - x.Value, err = NewPathItem(v2, compiler.NewContext("value", context)) + x.Value, err = NewPathItem(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } @@ -2273,7 +2277,7 @@ func NewNamedResponse(in *yaml.Node, context *compiler.Context) (*NamedResponse, v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error - x.Value, err = NewResponse(v2, compiler.NewContext("value", context)) + x.Value, err = NewResponse(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } @@ -2311,7 +2315,7 @@ func NewNamedResponseValue(in *yaml.Node, context *compiler.Context) (*NamedResp v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error - x.Value, err = NewResponseValue(v2, compiler.NewContext("value", context)) + x.Value, err = NewResponseValue(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } @@ -2349,7 +2353,7 @@ func NewNamedSchema(in *yaml.Node, context *compiler.Context) (*NamedSchema, err v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error - x.Value, err = NewSchema(v2, compiler.NewContext("value", context)) + x.Value, err = NewSchema(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } @@ -2387,7 +2391,7 @@ func NewNamedSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) ( v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error - x.Value, err = NewSecurityDefinitionsItem(v2, compiler.NewContext("value", context)) + x.Value, err = NewSecurityDefinitionsItem(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } @@ -2463,7 +2467,7 @@ func NewNamedStringArray(in *yaml.Node, context *compiler.Context) (*NamedString v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error - x.Value, err = NewStringArray(v2, compiler.NewContext("value", context)) + x.Value, err = NewStringArray(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } @@ -2491,7 +2495,7 @@ func NewNonBodyParameter(in *yaml.Node, context *compiler.Context) (*NonBodyPara // HeaderParameterSubSchema header_parameter_sub_schema = 1; { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewHeaderParameterSubSchema(m, compiler.NewContext("headerParameterSubSchema", context)) + t, matchingError := NewHeaderParameterSubSchema(m, compiler.NewContext("headerParameterSubSchema", m, context)) if matchingError == nil { x.Oneof = &NonBodyParameter_HeaderParameterSubSchema{HeaderParameterSubSchema: t} matched = true @@ -2502,7 +2506,7 @@ func NewNonBodyParameter(in *yaml.Node, context *compiler.Context) (*NonBodyPara // FormDataParameterSubSchema form_data_parameter_sub_schema = 2; { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewFormDataParameterSubSchema(m, compiler.NewContext("formDataParameterSubSchema", context)) + t, matchingError := NewFormDataParameterSubSchema(m, compiler.NewContext("formDataParameterSubSchema", m, context)) if matchingError == nil { x.Oneof = &NonBodyParameter_FormDataParameterSubSchema{FormDataParameterSubSchema: t} matched = true @@ -2513,7 +2517,7 @@ func NewNonBodyParameter(in *yaml.Node, context *compiler.Context) (*NonBodyPara // QueryParameterSubSchema query_parameter_sub_schema = 3; { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewQueryParameterSubSchema(m, compiler.NewContext("queryParameterSubSchema", context)) + t, matchingError := NewQueryParameterSubSchema(m, compiler.NewContext("queryParameterSubSchema", m, context)) if matchingError == nil { x.Oneof = &NonBodyParameter_QueryParameterSubSchema{QueryParameterSubSchema: t} matched = true @@ -2524,7 +2528,7 @@ func NewNonBodyParameter(in *yaml.Node, context *compiler.Context) (*NonBodyPara // PathParameterSubSchema path_parameter_sub_schema = 4; { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewPathParameterSubSchema(m, compiler.NewContext("pathParameterSubSchema", context)) + t, matchingError := NewPathParameterSubSchema(m, compiler.NewContext("pathParameterSubSchema", m, context)) if matchingError == nil { x.Oneof = &NonBodyParameter_PathParameterSubSchema{PathParameterSubSchema: t} matched = true @@ -2536,6 +2540,10 @@ func NewNonBodyParameter(in *yaml.Node, context *compiler.Context) (*NonBodyPara if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) + } else { + message := fmt.Sprintf("contains an invalid NonBodyParameter") + err := compiler.NewError(context, message) + errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } @@ -2596,7 +2604,7 @@ func NewOauth2AccessCodeSecurity(in *yaml.Node, context *compiler.Context) (*Oau v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error - x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context)) + x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) if err != nil { errors = append(errors, err) } @@ -2650,7 +2658,7 @@ func NewOauth2AccessCodeSecurity(in *yaml.Node, context *compiler.Context) (*Oau pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -2719,7 +2727,7 @@ func NewOauth2ApplicationSecurity(in *yaml.Node, context *compiler.Context) (*Oa v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error - x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context)) + x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) if err != nil { errors = append(errors, err) } @@ -2764,7 +2772,7 @@ func NewOauth2ApplicationSecurity(in *yaml.Node, context *compiler.Context) (*Oa pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -2833,7 +2841,7 @@ func NewOauth2ImplicitSecurity(in *yaml.Node, context *compiler.Context) (*Oauth v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error - x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context)) + x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) if err != nil { errors = append(errors, err) } @@ -2878,7 +2886,7 @@ func NewOauth2ImplicitSecurity(in *yaml.Node, context *compiler.Context) (*Oauth pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -2947,7 +2955,7 @@ func NewOauth2PasswordSecurity(in *yaml.Node, context *compiler.Context) (*Oauth v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error - x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context)) + x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) if err != nil { errors = append(errors, err) } @@ -2992,7 +3000,7 @@ func NewOauth2PasswordSecurity(in *yaml.Node, context *compiler.Context) (*Oauth pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -3086,7 +3094,7 @@ func NewOperation(in *yaml.Node, context *compiler.Context) (*Operation, error) v4 := compiler.MapValueForKey(m, "externalDocs") if v4 != nil { var err error - x.ExternalDocs, err = NewExternalDocs(v4, compiler.NewContext("externalDocs", context)) + x.ExternalDocs, err = NewExternalDocs(v4, compiler.NewContext("externalDocs", v4, context)) if err != nil { errors = append(errors, err) } @@ -3130,7 +3138,7 @@ func NewOperation(in *yaml.Node, context *compiler.Context) (*Operation, error) a, ok := compiler.SequenceNodeForNode(v8) if ok { for _, item := range a.Content { - y, err := NewParametersItem(item, compiler.NewContext("parameters", context)) + y, err := NewParametersItem(item, compiler.NewContext("parameters", item, context)) if err != nil { errors = append(errors, err) } @@ -3142,7 +3150,7 @@ func NewOperation(in *yaml.Node, context *compiler.Context) (*Operation, error) v9 := compiler.MapValueForKey(m, "responses") if v9 != nil { var err error - x.Responses, err = NewResponses(v9, compiler.NewContext("responses", context)) + x.Responses, err = NewResponses(v9, compiler.NewContext("responses", v9, context)) if err != nil { errors = append(errors, err) } @@ -3181,7 +3189,7 @@ func NewOperation(in *yaml.Node, context *compiler.Context) (*Operation, error) a, ok := compiler.SequenceNodeForNode(v12) if ok { for _, item := range a.Content { - y, err := NewSecurityRequirement(item, compiler.NewContext("security", context)) + y, err := NewSecurityRequirement(item, compiler.NewContext("security", item, context)) if err != nil { errors = append(errors, err) } @@ -3211,7 +3219,7 @@ func NewOperation(in *yaml.Node, context *compiler.Context) (*Operation, error) pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -3234,7 +3242,7 @@ func NewParameter(in *yaml.Node, context *compiler.Context) (*Parameter, error) m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewBodyParameter(m, compiler.NewContext("bodyParameter", context)) + t, matchingError := NewBodyParameter(m, compiler.NewContext("bodyParameter", m, context)) if matchingError == nil { x.Oneof = &Parameter_BodyParameter{BodyParameter: t} matched = true @@ -3248,7 +3256,7 @@ func NewParameter(in *yaml.Node, context *compiler.Context) (*Parameter, error) m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewNonBodyParameter(m, compiler.NewContext("nonBodyParameter", context)) + t, matchingError := NewNonBodyParameter(m, compiler.NewContext("nonBodyParameter", m, context)) if matchingError == nil { x.Oneof = &Parameter_NonBodyParameter{NonBodyParameter: t} matched = true @@ -3260,6 +3268,10 @@ func NewParameter(in *yaml.Node, context *compiler.Context) (*Parameter, error) if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) + } else { + message := fmt.Sprintf("contains an invalid Parameter") + err := compiler.NewError(context, message) + errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } @@ -3283,7 +3295,7 @@ func NewParameterDefinitions(in *yaml.Node, context *compiler.Context) (*Paramet pair := &NamedParameter{} pair.Name = k var err error - pair.Value, err = NewParameter(v, compiler.NewContext(k, context)) + pair.Value, err = NewParameter(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -3304,7 +3316,7 @@ func NewParametersItem(in *yaml.Node, context *compiler.Context) (*ParametersIte m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewParameter(m, compiler.NewContext("parameter", context)) + t, matchingError := NewParameter(m, compiler.NewContext("parameter", m, context)) if matchingError == nil { x.Oneof = &ParametersItem_Parameter{Parameter: t} matched = true @@ -3318,7 +3330,7 @@ func NewParametersItem(in *yaml.Node, context *compiler.Context) (*ParametersIte m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", context)) + t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", m, context)) if matchingError == nil { x.Oneof = &ParametersItem_JsonReference{JsonReference: t} matched = true @@ -3330,6 +3342,10 @@ func NewParametersItem(in *yaml.Node, context *compiler.Context) (*ParametersIte if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) + } else { + message := fmt.Sprintf("contains an invalid ParametersItem") + err := compiler.NewError(context, message) + errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } @@ -3363,7 +3379,7 @@ func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { v2 := compiler.MapValueForKey(m, "get") if v2 != nil { var err error - x.Get, err = NewOperation(v2, compiler.NewContext("get", context)) + x.Get, err = NewOperation(v2, compiler.NewContext("get", v2, context)) if err != nil { errors = append(errors, err) } @@ -3372,7 +3388,7 @@ func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { v3 := compiler.MapValueForKey(m, "put") if v3 != nil { var err error - x.Put, err = NewOperation(v3, compiler.NewContext("put", context)) + x.Put, err = NewOperation(v3, compiler.NewContext("put", v3, context)) if err != nil { errors = append(errors, err) } @@ -3381,7 +3397,7 @@ func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { v4 := compiler.MapValueForKey(m, "post") if v4 != nil { var err error - x.Post, err = NewOperation(v4, compiler.NewContext("post", context)) + x.Post, err = NewOperation(v4, compiler.NewContext("post", v4, context)) if err != nil { errors = append(errors, err) } @@ -3390,7 +3406,7 @@ func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { v5 := compiler.MapValueForKey(m, "delete") if v5 != nil { var err error - x.Delete, err = NewOperation(v5, compiler.NewContext("delete", context)) + x.Delete, err = NewOperation(v5, compiler.NewContext("delete", v5, context)) if err != nil { errors = append(errors, err) } @@ -3399,7 +3415,7 @@ func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { v6 := compiler.MapValueForKey(m, "options") if v6 != nil { var err error - x.Options, err = NewOperation(v6, compiler.NewContext("options", context)) + x.Options, err = NewOperation(v6, compiler.NewContext("options", v6, context)) if err != nil { errors = append(errors, err) } @@ -3408,7 +3424,7 @@ func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { v7 := compiler.MapValueForKey(m, "head") if v7 != nil { var err error - x.Head, err = NewOperation(v7, compiler.NewContext("head", context)) + x.Head, err = NewOperation(v7, compiler.NewContext("head", v7, context)) if err != nil { errors = append(errors, err) } @@ -3417,7 +3433,7 @@ func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { v8 := compiler.MapValueForKey(m, "patch") if v8 != nil { var err error - x.Patch, err = NewOperation(v8, compiler.NewContext("patch", context)) + x.Patch, err = NewOperation(v8, compiler.NewContext("patch", v8, context)) if err != nil { errors = append(errors, err) } @@ -3430,7 +3446,7 @@ func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { a, ok := compiler.SequenceNodeForNode(v9) if ok { for _, item := range a.Content { - y, err := NewParametersItem(item, compiler.NewContext("parameters", context)) + y, err := NewParametersItem(item, compiler.NewContext("parameters", item, context)) if err != nil { errors = append(errors, err) } @@ -3460,7 +3476,7 @@ func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -3565,7 +3581,7 @@ func NewPathParameterSubSchema(in *yaml.Node, context *compiler.Context) (*PathP v7 := compiler.MapValueForKey(m, "items") if v7 != nil { var err error - x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", context)) + x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", v7, context)) if err != nil { errors = append(errors, err) } @@ -3589,7 +3605,7 @@ func NewPathParameterSubSchema(in *yaml.Node, context *compiler.Context) (*PathP v9 := compiler.MapValueForKey(m, "default") if v9 != nil { var err error - x.Default, err = NewAny(v9, compiler.NewContext("default", context)) + x.Default, err = NewAny(v9, compiler.NewContext("default", v9, context)) if err != nil { errors = append(errors, err) } @@ -3704,7 +3720,7 @@ func NewPathParameterSubSchema(in *yaml.Node, context *compiler.Context) (*PathP a, ok := compiler.SequenceNodeForNode(v20) if ok { for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", context)) + y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } @@ -3745,7 +3761,7 @@ func NewPathParameterSubSchema(in *yaml.Node, context *compiler.Context) (*PathP pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -3796,7 +3812,7 @@ func NewPaths(in *yaml.Node, context *compiler.Context) (*Paths, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -3816,7 +3832,7 @@ func NewPaths(in *yaml.Node, context *compiler.Context) (*Paths, error) { pair := &NamedPathItem{} pair.Name = k var err error - pair.Value, err = NewPathItem(v, compiler.NewContext(k, context)) + pair.Value, err = NewPathItem(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -3872,7 +3888,7 @@ func NewPrimitivesItems(in *yaml.Node, context *compiler.Context) (*PrimitivesIt v3 := compiler.MapValueForKey(m, "items") if v3 != nil { var err error - x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", context)) + x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", v3, context)) if err != nil { errors = append(errors, err) } @@ -3896,7 +3912,7 @@ func NewPrimitivesItems(in *yaml.Node, context *compiler.Context) (*PrimitivesIt v5 := compiler.MapValueForKey(m, "default") if v5 != nil { var err error - x.Default, err = NewAny(v5, compiler.NewContext("default", context)) + x.Default, err = NewAny(v5, compiler.NewContext("default", v5, context)) if err != nil { errors = append(errors, err) } @@ -4011,7 +4027,7 @@ func NewPrimitivesItems(in *yaml.Node, context *compiler.Context) (*PrimitivesIt a, ok := compiler.SequenceNodeForNode(v16) if ok { for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", context)) + y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } @@ -4052,7 +4068,7 @@ func NewPrimitivesItems(in *yaml.Node, context *compiler.Context) (*PrimitivesIt pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -4084,7 +4100,7 @@ func NewProperties(in *yaml.Node, context *compiler.Context) (*Properties, error pair := &NamedSchema{} pair.Name = k var err error - pair.Value, err = NewSchema(v, compiler.NewContext(k, context)) + pair.Value, err = NewSchema(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -4190,7 +4206,7 @@ func NewQueryParameterSubSchema(in *yaml.Node, context *compiler.Context) (*Quer v8 := compiler.MapValueForKey(m, "items") if v8 != nil { var err error - x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", context)) + x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", v8, context)) if err != nil { errors = append(errors, err) } @@ -4214,7 +4230,7 @@ func NewQueryParameterSubSchema(in *yaml.Node, context *compiler.Context) (*Quer v10 := compiler.MapValueForKey(m, "default") if v10 != nil { var err error - x.Default, err = NewAny(v10, compiler.NewContext("default", context)) + x.Default, err = NewAny(v10, compiler.NewContext("default", v10, context)) if err != nil { errors = append(errors, err) } @@ -4329,7 +4345,7 @@ func NewQueryParameterSubSchema(in *yaml.Node, context *compiler.Context) (*Quer a, ok := compiler.SequenceNodeForNode(v21) if ok { for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", context)) + y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } @@ -4370,7 +4386,7 @@ func NewQueryParameterSubSchema(in *yaml.Node, context *compiler.Context) (*Quer pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -4418,7 +4434,7 @@ func NewResponse(in *yaml.Node, context *compiler.Context) (*Response, error) { v2 := compiler.MapValueForKey(m, "schema") if v2 != nil { var err error - x.Schema, err = NewSchemaItem(v2, compiler.NewContext("schema", context)) + x.Schema, err = NewSchemaItem(v2, compiler.NewContext("schema", v2, context)) if err != nil { errors = append(errors, err) } @@ -4427,7 +4443,7 @@ func NewResponse(in *yaml.Node, context *compiler.Context) (*Response, error) { v3 := compiler.MapValueForKey(m, "headers") if v3 != nil { var err error - x.Headers, err = NewHeaders(v3, compiler.NewContext("headers", context)) + x.Headers, err = NewHeaders(v3, compiler.NewContext("headers", v3, context)) if err != nil { errors = append(errors, err) } @@ -4436,7 +4452,7 @@ func NewResponse(in *yaml.Node, context *compiler.Context) (*Response, error) { v4 := compiler.MapValueForKey(m, "examples") if v4 != nil { var err error - x.Examples, err = NewExamples(v4, compiler.NewContext("examples", context)) + x.Examples, err = NewExamples(v4, compiler.NewContext("examples", v4, context)) if err != nil { errors = append(errors, err) } @@ -4463,7 +4479,7 @@ func NewResponse(in *yaml.Node, context *compiler.Context) (*Response, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -4495,7 +4511,7 @@ func NewResponseDefinitions(in *yaml.Node, context *compiler.Context) (*Response pair := &NamedResponse{} pair.Name = k var err error - pair.Value, err = NewResponse(v, compiler.NewContext(k, context)) + pair.Value, err = NewResponse(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -4516,7 +4532,7 @@ func NewResponseValue(in *yaml.Node, context *compiler.Context) (*ResponseValue, m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewResponse(m, compiler.NewContext("response", context)) + t, matchingError := NewResponse(m, compiler.NewContext("response", m, context)) if matchingError == nil { x.Oneof = &ResponseValue_Response{Response: t} matched = true @@ -4530,7 +4546,7 @@ func NewResponseValue(in *yaml.Node, context *compiler.Context) (*ResponseValue, m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", context)) + t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", m, context)) if matchingError == nil { x.Oneof = &ResponseValue_JsonReference{JsonReference: t} matched = true @@ -4542,6 +4558,10 @@ func NewResponseValue(in *yaml.Node, context *compiler.Context) (*ResponseValue, if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) + } else { + message := fmt.Sprintf("contains an invalid ResponseValue") + err := compiler.NewError(context, message) + errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } @@ -4573,7 +4593,7 @@ func NewResponses(in *yaml.Node, context *compiler.Context) (*Responses, error) pair := &NamedResponseValue{} pair.Name = k var err error - pair.Value, err = NewResponseValue(v, compiler.NewContext(k, context)) + pair.Value, err = NewResponseValue(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -4603,7 +4623,7 @@ func NewResponses(in *yaml.Node, context *compiler.Context) (*Responses, error) pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -4672,7 +4692,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { v5 := compiler.MapValueForKey(m, "default") if v5 != nil { var err error - x.Default, err = NewAny(v5, compiler.NewContext("default", context)) + x.Default, err = NewAny(v5, compiler.NewContext("default", v5, context)) if err != nil { errors = append(errors, err) } @@ -4831,7 +4851,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { a, ok := compiler.SequenceNodeForNode(v20) if ok { for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", context)) + y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } @@ -4843,7 +4863,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { v21 := compiler.MapValueForKey(m, "additionalProperties") if v21 != nil { var err error - x.AdditionalProperties, err = NewAdditionalPropertiesItem(v21, compiler.NewContext("additionalProperties", context)) + x.AdditionalProperties, err = NewAdditionalPropertiesItem(v21, compiler.NewContext("additionalProperties", v21, context)) if err != nil { errors = append(errors, err) } @@ -4852,7 +4872,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { v22 := compiler.MapValueForKey(m, "type") if v22 != nil { var err error - x.Type, err = NewTypeItem(v22, compiler.NewContext("type", context)) + x.Type, err = NewTypeItem(v22, compiler.NewContext("type", v22, context)) if err != nil { errors = append(errors, err) } @@ -4861,7 +4881,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { v23 := compiler.MapValueForKey(m, "items") if v23 != nil { var err error - x.Items, err = NewItemsItem(v23, compiler.NewContext("items", context)) + x.Items, err = NewItemsItem(v23, compiler.NewContext("items", v23, context)) if err != nil { errors = append(errors, err) } @@ -4874,7 +4894,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { a, ok := compiler.SequenceNodeForNode(v24) if ok { for _, item := range a.Content { - y, err := NewSchema(item, compiler.NewContext("allOf", context)) + y, err := NewSchema(item, compiler.NewContext("allOf", item, context)) if err != nil { errors = append(errors, err) } @@ -4886,7 +4906,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { v25 := compiler.MapValueForKey(m, "properties") if v25 != nil { var err error - x.Properties, err = NewProperties(v25, compiler.NewContext("properties", context)) + x.Properties, err = NewProperties(v25, compiler.NewContext("properties", v25, context)) if err != nil { errors = append(errors, err) } @@ -4913,7 +4933,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { v28 := compiler.MapValueForKey(m, "xml") if v28 != nil { var err error - x.Xml, err = NewXml(v28, compiler.NewContext("xml", context)) + x.Xml, err = NewXml(v28, compiler.NewContext("xml", v28, context)) if err != nil { errors = append(errors, err) } @@ -4922,7 +4942,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { v29 := compiler.MapValueForKey(m, "externalDocs") if v29 != nil { var err error - x.ExternalDocs, err = NewExternalDocs(v29, compiler.NewContext("externalDocs", context)) + x.ExternalDocs, err = NewExternalDocs(v29, compiler.NewContext("externalDocs", v29, context)) if err != nil { errors = append(errors, err) } @@ -4931,7 +4951,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { v30 := compiler.MapValueForKey(m, "example") if v30 != nil { var err error - x.Example, err = NewAny(v30, compiler.NewContext("example", context)) + x.Example, err = NewAny(v30, compiler.NewContext("example", v30, context)) if err != nil { errors = append(errors, err) } @@ -4958,7 +4978,7 @@ func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -4981,7 +5001,7 @@ func NewSchemaItem(in *yaml.Node, context *compiler.Context) (*SchemaItem, error m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewSchema(m, compiler.NewContext("schema", context)) + t, matchingError := NewSchema(m, compiler.NewContext("schema", m, context)) if matchingError == nil { x.Oneof = &SchemaItem_Schema{Schema: t} matched = true @@ -4995,7 +5015,7 @@ func NewSchemaItem(in *yaml.Node, context *compiler.Context) (*SchemaItem, error m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewFileSchema(m, compiler.NewContext("fileSchema", context)) + t, matchingError := NewFileSchema(m, compiler.NewContext("fileSchema", m, context)) if matchingError == nil { x.Oneof = &SchemaItem_FileSchema{FileSchema: t} matched = true @@ -5007,6 +5027,10 @@ func NewSchemaItem(in *yaml.Node, context *compiler.Context) (*SchemaItem, error if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) + } else { + message := fmt.Sprintf("contains an invalid SchemaItem") + err := compiler.NewError(context, message) + errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } @@ -5030,7 +5054,7 @@ func NewSecurityDefinitions(in *yaml.Node, context *compiler.Context) (*Security pair := &NamedSecurityDefinitionsItem{} pair.Name = k var err error - pair.Value, err = NewSecurityDefinitionsItem(v, compiler.NewContext(k, context)) + pair.Value, err = NewSecurityDefinitionsItem(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -5051,7 +5075,7 @@ func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*Secu m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewBasicAuthenticationSecurity(m, compiler.NewContext("basicAuthenticationSecurity", context)) + t, matchingError := NewBasicAuthenticationSecurity(m, compiler.NewContext("basicAuthenticationSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_BasicAuthenticationSecurity{BasicAuthenticationSecurity: t} matched = true @@ -5065,7 +5089,7 @@ func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*Secu m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewApiKeySecurity(m, compiler.NewContext("apiKeySecurity", context)) + t, matchingError := NewApiKeySecurity(m, compiler.NewContext("apiKeySecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_ApiKeySecurity{ApiKeySecurity: t} matched = true @@ -5079,7 +5103,7 @@ func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*Secu m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewOauth2ImplicitSecurity(m, compiler.NewContext("oauth2ImplicitSecurity", context)) + t, matchingError := NewOauth2ImplicitSecurity(m, compiler.NewContext("oauth2ImplicitSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2ImplicitSecurity{Oauth2ImplicitSecurity: t} matched = true @@ -5093,7 +5117,7 @@ func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*Secu m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewOauth2PasswordSecurity(m, compiler.NewContext("oauth2PasswordSecurity", context)) + t, matchingError := NewOauth2PasswordSecurity(m, compiler.NewContext("oauth2PasswordSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2PasswordSecurity{Oauth2PasswordSecurity: t} matched = true @@ -5107,7 +5131,7 @@ func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*Secu m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewOauth2ApplicationSecurity(m, compiler.NewContext("oauth2ApplicationSecurity", context)) + t, matchingError := NewOauth2ApplicationSecurity(m, compiler.NewContext("oauth2ApplicationSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2ApplicationSecurity{Oauth2ApplicationSecurity: t} matched = true @@ -5121,7 +5145,7 @@ func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*Secu m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewOauth2AccessCodeSecurity(m, compiler.NewContext("oauth2AccessCodeSecurity", context)) + t, matchingError := NewOauth2AccessCodeSecurity(m, compiler.NewContext("oauth2AccessCodeSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2AccessCodeSecurity{Oauth2AccessCodeSecurity: t} matched = true @@ -5133,6 +5157,10 @@ func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*Secu if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) + } else { + message := fmt.Sprintf("contains an invalid SecurityDefinitionsItem") + err := compiler.NewError(context, message) + errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } @@ -5156,7 +5184,7 @@ func NewSecurityRequirement(in *yaml.Node, context *compiler.Context) (*Security pair := &NamedStringArray{} pair.Name = k var err error - pair.Value, err = NewStringArray(v, compiler.NewContext(k, context)) + pair.Value, err = NewStringArray(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -5223,7 +5251,7 @@ func NewTag(in *yaml.Node, context *compiler.Context) (*Tag, error) { v3 := compiler.MapValueForKey(m, "externalDocs") if v3 != nil { var err error - x.ExternalDocs, err = NewExternalDocs(v3, compiler.NewContext("externalDocs", context)) + x.ExternalDocs, err = NewExternalDocs(v3, compiler.NewContext("externalDocs", v3, context)) if err != nil { errors = append(errors, err) } @@ -5250,7 +5278,7 @@ func NewTag(in *yaml.Node, context *compiler.Context) (*Tag, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -5321,7 +5349,7 @@ func NewVendorExtension(in *yaml.Node, context *compiler.Context) (*VendorExtens pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -5416,7 +5444,7 @@ func NewXml(in *yaml.Node, context *compiler.Context) (*Xml, error) { pair.Value = result } } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, context)) + pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } @@ -6817,7 +6845,7 @@ func (m *AdditionalPropertiesItem) ToRawInfo() *yaml.Node { if v1, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { return compiler.NewScalarNodeForBool(v1.Boolean) } - return nil + return compiler.NewNullNode() } // ToRawInfo returns a description of Any suitable for JSON or YAML export. @@ -6830,10 +6858,8 @@ func (m *Any) ToRawInfo() *yaml.Node { return node.Content[0] } return &node - } else { - return nil } - return nil + return compiler.NewNullNode() } // ToRawInfo returns a description of ApiKeySecurity suitable for JSON or YAML export. @@ -7559,7 +7585,10 @@ func (m *NamedAny) ToRawInfo() *yaml.Node { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } - // &{Name:value Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} + if m.Value != nil { + info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) + info.Content = append(info.Content, m.Value.ToRawInfo()) + } return info } @@ -7716,7 +7745,7 @@ func (m *NonBodyParameter) ToRawInfo() *yaml.Node { if v3 != nil { return v3.ToRawInfo() } - return nil + return compiler.NewNullNode() } // ToRawInfo returns a description of Oauth2AccessCodeSecurity suitable for JSON or YAML export. @@ -7944,7 +7973,7 @@ func (m *Parameter) ToRawInfo() *yaml.Node { if v1 != nil { return v1.ToRawInfo() } - return nil + return compiler.NewNullNode() } // ToRawInfo returns a description of ParameterDefinitions suitable for JSON or YAML export. @@ -7976,7 +8005,7 @@ func (m *ParametersItem) ToRawInfo() *yaml.Node { if v1 != nil { return v1.ToRawInfo() } - return nil + return compiler.NewNullNode() } // ToRawInfo returns a description of PathItem suitable for JSON or YAML export. @@ -8425,7 +8454,7 @@ func (m *ResponseValue) ToRawInfo() *yaml.Node { if v1 != nil { return v1.ToRawInfo() } - return nil + return compiler.NewNullNode() } // ToRawInfo returns a description of Responses suitable for JSON or YAML export. @@ -8618,7 +8647,7 @@ func (m *SchemaItem) ToRawInfo() *yaml.Node { if v1 != nil { return v1.ToRawInfo() } - return nil + return compiler.NewNullNode() } // ToRawInfo returns a description of SecurityDefinitions suitable for JSON or YAML export. @@ -8670,7 +8699,7 @@ func (m *SecurityDefinitionsItem) ToRawInfo() *yaml.Node { if v5 != nil { return v5.ToRawInfo() } - return nil + return compiler.NewNullNode() } // ToRawInfo returns a description of SecurityRequirement suitable for JSON or YAML export. diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go index 559ddea1ab8d..8a5f302f337a 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go @@ -16,17 +16,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.26.0 +// protoc v3.15.5 // source: openapiv2/OpenAPIv2.proto package openapi_v2 import ( - proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" reflect "reflect" sync "sync" ) @@ -38,10 +37,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type AdditionalPropertiesItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -127,8 +122,8 @@ type Any struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Value *any.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` + Value *anypb.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` } func (x *Any) Reset() { @@ -163,7 +158,7 @@ func (*Any) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{1} } -func (x *Any) GetValue() *any.Any { +func (x *Any) GetValue() *anypb.Any { if x != nil { return x.Value } @@ -6341,11 +6336,11 @@ var file_openapiv2_OpenAPIv2_proto_rawDesc = []byte{ 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x3c, 0x0a, 0x0e, 0x6f, 0x72, 0x67, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x3e, 0x0a, 0x0e, 0x6f, 0x72, 0x67, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x32, 0x42, 0x0c, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x14, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, - 0x32, 0x3b, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4f, - 0x41, 0x53, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x16, 0x2e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x3b, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x32, 0xa2, 0x02, + 0x03, 0x4f, 0x41, 0x53, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6422,7 +6417,7 @@ var file_openapiv2_OpenAPIv2_proto_goTypes = []interface{}{ (*TypeItem)(nil), // 57: openapi.v2.TypeItem (*VendorExtension)(nil), // 58: openapi.v2.VendorExtension (*Xml)(nil), // 59: openapi.v2.Xml - (*any.Any)(nil), // 60: google.protobuf.Any + (*anypb.Any)(nil), // 60: google.protobuf.Any } var file_openapiv2_OpenAPIv2_proto_depIdxs = []int32{ 50, // 0: openapi.v2.AdditionalPropertiesItem.schema:type_name -> openapi.v2.Schema diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto index 00ac1b0a080e..1c59b2f4ae13 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto @@ -42,7 +42,7 @@ option java_package = "org.openapi_v2"; option objc_class_prefix = "OAS"; // The Go package name. -option go_package = "openapiv2;openapi_v2"; +option go_package = "./openapiv2;openapi_v2"; message AdditionalPropertiesItem { oneof oneof { diff --git a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/document.go b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/document.go index ddeed5c89721..56e5966b4cbe 100644 --- a/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/document.go +++ b/cluster-autoscaler/vendor/github.com/googleapis/gnostic/openapiv2/document.go @@ -14,7 +14,10 @@ package openapi_v2 -import "github.com/googleapis/gnostic/compiler" +import ( + "github.com/googleapis/gnostic/compiler" + "gopkg.in/yaml.v3" +) // ParseDocument reads an OpenAPI v2 description from a YAML/JSON representation. func ParseDocument(b []byte) (*Document, error) { @@ -22,5 +25,17 @@ func ParseDocument(b []byte) (*Document, error) { if err != nil { return nil, err } - return NewDocument(info.Content[0], compiler.NewContextWithExtensions("$root", nil, nil)) + root := info.Content[0] + return NewDocument(root, compiler.NewContextWithExtensions("$root", root, nil, nil)) +} + +// YAMLValue produces a serialized YAML representation of the document. +func (d *Document) YAMLValue(comment string) ([]byte, error) { + rawInfo := d.ToRawInfo() + rawInfo = &yaml.Node{ + Kind: yaml.DocumentNode, + Content: []*yaml.Node{rawInfo}, + HeadComment: comment, + } + return yaml.Marshal(rawInfo) } diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt new file mode 100644 index 000000000000..364516251b93 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt @@ -0,0 +1,27 @@ +Copyright (c) 2015, Gengo, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Gengo, Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel new file mode 100644 index 000000000000..5242751fb2d5 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") + +package(default_visibility = ["//visibility:public"]) + +proto_library( + name = "internal_proto", + srcs = ["errors.proto"], + deps = ["@com_google_protobuf//:any_proto"], +) + +go_proto_library( + name = "internal_go_proto", + importpath = "github.com/grpc-ecosystem/grpc-gateway/internal", + proto = ":internal_proto", +) + +go_library( + name = "go_default_library", + embed = [":internal_go_proto"], + importpath = "github.com/grpc-ecosystem/grpc-gateway/internal", +) diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.pb.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.pb.go new file mode 100644 index 000000000000..61101d7177f0 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.pb.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: internal/errors.proto + +package internal + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// Error is the generic error returned from unary RPCs. +type Error struct { + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + // This is to make the error more compatible with users that expect errors to be Status objects: + // https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto + // It should be the exact same message as the Error field. + Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + Details []*any.Any `protobuf:"bytes,4,rep,name=details,proto3" json:"details,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Error) Reset() { *m = Error{} } +func (m *Error) String() string { return proto.CompactTextString(m) } +func (*Error) ProtoMessage() {} +func (*Error) Descriptor() ([]byte, []int) { + return fileDescriptor_9b093362ca6d1e03, []int{0} +} + +func (m *Error) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Error.Unmarshal(m, b) +} +func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Error.Marshal(b, m, deterministic) +} +func (m *Error) XXX_Merge(src proto.Message) { + xxx_messageInfo_Error.Merge(m, src) +} +func (m *Error) XXX_Size() int { + return xxx_messageInfo_Error.Size(m) +} +func (m *Error) XXX_DiscardUnknown() { + xxx_messageInfo_Error.DiscardUnknown(m) +} + +var xxx_messageInfo_Error proto.InternalMessageInfo + +func (m *Error) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func (m *Error) GetCode() int32 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *Error) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *Error) GetDetails() []*any.Any { + if m != nil { + return m.Details + } + return nil +} + +// StreamError is a response type which is returned when +// streaming rpc returns an error. +type StreamError struct { + GrpcCode int32 `protobuf:"varint,1,opt,name=grpc_code,json=grpcCode,proto3" json:"grpc_code,omitempty"` + HttpCode int32 `protobuf:"varint,2,opt,name=http_code,json=httpCode,proto3" json:"http_code,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + HttpStatus string `protobuf:"bytes,4,opt,name=http_status,json=httpStatus,proto3" json:"http_status,omitempty"` + Details []*any.Any `protobuf:"bytes,5,rep,name=details,proto3" json:"details,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StreamError) Reset() { *m = StreamError{} } +func (m *StreamError) String() string { return proto.CompactTextString(m) } +func (*StreamError) ProtoMessage() {} +func (*StreamError) Descriptor() ([]byte, []int) { + return fileDescriptor_9b093362ca6d1e03, []int{1} +} + +func (m *StreamError) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StreamError.Unmarshal(m, b) +} +func (m *StreamError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StreamError.Marshal(b, m, deterministic) +} +func (m *StreamError) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamError.Merge(m, src) +} +func (m *StreamError) XXX_Size() int { + return xxx_messageInfo_StreamError.Size(m) +} +func (m *StreamError) XXX_DiscardUnknown() { + xxx_messageInfo_StreamError.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamError proto.InternalMessageInfo + +func (m *StreamError) GetGrpcCode() int32 { + if m != nil { + return m.GrpcCode + } + return 0 +} + +func (m *StreamError) GetHttpCode() int32 { + if m != nil { + return m.HttpCode + } + return 0 +} + +func (m *StreamError) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *StreamError) GetHttpStatus() string { + if m != nil { + return m.HttpStatus + } + return "" +} + +func (m *StreamError) GetDetails() []*any.Any { + if m != nil { + return m.Details + } + return nil +} + +func init() { + proto.RegisterType((*Error)(nil), "grpc.gateway.runtime.Error") + proto.RegisterType((*StreamError)(nil), "grpc.gateway.runtime.StreamError") +} + +func init() { proto.RegisterFile("internal/errors.proto", fileDescriptor_9b093362ca6d1e03) } + +var fileDescriptor_9b093362ca6d1e03 = []byte{ + // 252 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xc1, 0x4a, 0xc4, 0x30, + 0x10, 0x86, 0x89, 0xbb, 0x75, 0xdb, 0xe9, 0x2d, 0x54, 0x88, 0xee, 0xc1, 0xb2, 0xa7, 0x9e, 0x52, + 0xd0, 0x27, 0xd0, 0xc5, 0x17, 0xe8, 0xde, 0xbc, 0x2c, 0xd9, 0xdd, 0x31, 0x16, 0xda, 0xa4, 0x24, + 0x53, 0xa4, 0xf8, 0x56, 0x3e, 0xa1, 0x24, 0xa5, 0xb0, 0x27, 0xf1, 0xd6, 0xf9, 0xfb, 0xcf, 0x7c, + 0x1f, 0x81, 0xbb, 0xd6, 0x10, 0x3a, 0xa3, 0xba, 0x1a, 0x9d, 0xb3, 0xce, 0xcb, 0xc1, 0x59, 0xb2, + 0xbc, 0xd0, 0x6e, 0x38, 0x4b, 0xad, 0x08, 0xbf, 0xd4, 0x24, 0xdd, 0x68, 0xa8, 0xed, 0xf1, 0xe1, + 0x5e, 0x5b, 0xab, 0x3b, 0xac, 0x63, 0xe7, 0x34, 0x7e, 0xd4, 0xca, 0x4c, 0xf3, 0xc2, 0xee, 0x1b, + 0x92, 0xb7, 0x70, 0x80, 0x17, 0x90, 0xc4, 0x4b, 0x82, 0x95, 0xac, 0xca, 0x9a, 0x79, 0xe0, 0x1c, + 0xd6, 0x67, 0x7b, 0x41, 0x71, 0x53, 0xb2, 0x2a, 0x69, 0xe2, 0x37, 0x17, 0xb0, 0xe9, 0xd1, 0x7b, + 0xa5, 0x51, 0xac, 0x62, 0x77, 0x19, 0xb9, 0x84, 0xcd, 0x05, 0x49, 0xb5, 0x9d, 0x17, 0xeb, 0x72, + 0x55, 0xe5, 0x4f, 0x85, 0x9c, 0xc9, 0x72, 0x21, 0xcb, 0x17, 0x33, 0x35, 0x4b, 0x69, 0xf7, 0xc3, + 0x20, 0x3f, 0x90, 0x43, 0xd5, 0xcf, 0x0e, 0x5b, 0xc8, 0x82, 0xff, 0x31, 0x22, 0x59, 0x44, 0xa6, + 0x21, 0xd8, 0x07, 0xec, 0x16, 0xb2, 0x4f, 0xa2, 0xe1, 0x78, 0xe5, 0x93, 0x86, 0x60, 0xff, 0xb7, + 0xd3, 0x23, 0xe4, 0x71, 0xcd, 0x93, 0xa2, 0x31, 0x78, 0x85, 0xbf, 0x10, 0xa2, 0x43, 0x4c, 0xae, + 0xa5, 0x93, 0x7f, 0x48, 0xbf, 0xc2, 0x7b, 0xba, 0xbc, 0xfd, 0xe9, 0x36, 0x56, 0x9e, 0x7f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0xde, 0x72, 0x6b, 0x83, 0x8e, 0x01, 0x00, 0x00, +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.proto b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.proto new file mode 100644 index 000000000000..4fb212c6b690 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package grpc.gateway.runtime; +option go_package = "internal"; + +import "google/protobuf/any.proto"; + +// Error is the generic error returned from unary RPCs. +message Error { + string error = 1; + // This is to make the error more compatible with users that expect errors to be Status objects: + // https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto + // It should be the exact same message as the Error field. + int32 code = 2; + string message = 3; + repeated google.protobuf.Any details = 4; +} + +// StreamError is a response type which is returned when +// streaming rpc returns an error. +message StreamError { + int32 grpc_code = 1; + int32 http_code = 2; + string message = 3; + string http_status = 4; + repeated google.protobuf.Any details = 5; +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/BUILD.bazel b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/BUILD.bazel new file mode 100644 index 000000000000..58b72b9cf751 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/BUILD.bazel @@ -0,0 +1,85 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +package(default_visibility = ["//visibility:public"]) + +go_library( + name = "go_default_library", + srcs = [ + "context.go", + "convert.go", + "doc.go", + "errors.go", + "fieldmask.go", + "handler.go", + "marshal_httpbodyproto.go", + "marshal_json.go", + "marshal_jsonpb.go", + "marshal_proto.go", + "marshaler.go", + "marshaler_registry.go", + "mux.go", + "pattern.go", + "proto2_convert.go", + "proto_errors.go", + "query.go", + ], + importpath = "github.com/grpc-ecosystem/grpc-gateway/runtime", + deps = [ + "//internal:go_default_library", + "//utilities:go_default_library", + "@com_github_golang_protobuf//descriptor:go_default_library_gen", + "@com_github_golang_protobuf//jsonpb:go_default_library_gen", + "@com_github_golang_protobuf//proto:go_default_library", + "@go_googleapis//google/api:httpbody_go_proto", + "@io_bazel_rules_go//proto/wkt:any_go_proto", + "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", + "@io_bazel_rules_go//proto/wkt:duration_go_proto", + "@io_bazel_rules_go//proto/wkt:field_mask_go_proto", + "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", + "@io_bazel_rules_go//proto/wkt:wrappers_go_proto", + "@org_golang_google_grpc//codes:go_default_library", + "@org_golang_google_grpc//grpclog:go_default_library", + "@org_golang_google_grpc//metadata:go_default_library", + "@org_golang_google_grpc//status:go_default_library", + ], +) + +go_test( + name = "go_default_test", + size = "small", + srcs = [ + "context_test.go", + "convert_test.go", + "errors_test.go", + "fieldmask_test.go", + "handler_test.go", + "marshal_httpbodyproto_test.go", + "marshal_json_test.go", + "marshal_jsonpb_test.go", + "marshal_proto_test.go", + "marshaler_registry_test.go", + "mux_test.go", + "pattern_test.go", + "query_test.go", + ], + embed = [":go_default_library"], + deps = [ + "//internal:go_default_library", + "//runtime/internal/examplepb:go_default_library", + "//utilities:go_default_library", + "@com_github_golang_protobuf//jsonpb:go_default_library_gen", + "@com_github_golang_protobuf//proto:go_default_library", + "@com_github_golang_protobuf//ptypes:go_default_library_gen", + "@go_googleapis//google/api:httpbody_go_proto", + "@go_googleapis//google/rpc:errdetails_go_proto", + "@io_bazel_rules_go//proto/wkt:duration_go_proto", + "@io_bazel_rules_go//proto/wkt:empty_go_proto", + "@io_bazel_rules_go//proto/wkt:field_mask_go_proto", + "@io_bazel_rules_go//proto/wkt:struct_go_proto", + "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", + "@io_bazel_rules_go//proto/wkt:wrappers_go_proto", + "@org_golang_google_grpc//codes:go_default_library", + "@org_golang_google_grpc//metadata:go_default_library", + "@org_golang_google_grpc//status:go_default_library", + ], +) diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go new file mode 100644 index 000000000000..d8cbd4cc96b0 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go @@ -0,0 +1,291 @@ +package runtime + +import ( + "context" + "encoding/base64" + "fmt" + "net" + "net/http" + "net/textproto" + "strconv" + "strings" + "sync" + "time" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// MetadataHeaderPrefix is the http prefix that represents custom metadata +// parameters to or from a gRPC call. +const MetadataHeaderPrefix = "Grpc-Metadata-" + +// MetadataPrefix is prepended to permanent HTTP header keys (as specified +// by the IANA) when added to the gRPC context. +const MetadataPrefix = "grpcgateway-" + +// MetadataTrailerPrefix is prepended to gRPC metadata as it is converted to +// HTTP headers in a response handled by grpc-gateway +const MetadataTrailerPrefix = "Grpc-Trailer-" + +const metadataGrpcTimeout = "Grpc-Timeout" +const metadataHeaderBinarySuffix = "-Bin" + +const xForwardedFor = "X-Forwarded-For" +const xForwardedHost = "X-Forwarded-Host" + +var ( + // DefaultContextTimeout is used for gRPC call context.WithTimeout whenever a Grpc-Timeout inbound + // header isn't present. If the value is 0 the sent `context` will not have a timeout. + DefaultContextTimeout = 0 * time.Second +) + +func decodeBinHeader(v string) ([]byte, error) { + if len(v)%4 == 0 { + // Input was padded, or padding was not necessary. + return base64.StdEncoding.DecodeString(v) + } + return base64.RawStdEncoding.DecodeString(v) +} + +/* +AnnotateContext adds context information such as metadata from the request. + +At a minimum, the RemoteAddr is included in the fashion of "X-Forwarded-For", +except that the forwarded destination is not another HTTP service but rather +a gRPC service. +*/ +func AnnotateContext(ctx context.Context, mux *ServeMux, req *http.Request) (context.Context, error) { + ctx, md, err := annotateContext(ctx, mux, req) + if err != nil { + return nil, err + } + if md == nil { + return ctx, nil + } + + return metadata.NewOutgoingContext(ctx, md), nil +} + +// AnnotateIncomingContext adds context information such as metadata from the request. +// Attach metadata as incoming context. +func AnnotateIncomingContext(ctx context.Context, mux *ServeMux, req *http.Request) (context.Context, error) { + ctx, md, err := annotateContext(ctx, mux, req) + if err != nil { + return nil, err + } + if md == nil { + return ctx, nil + } + + return metadata.NewIncomingContext(ctx, md), nil +} + +func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request) (context.Context, metadata.MD, error) { + var pairs []string + timeout := DefaultContextTimeout + if tm := req.Header.Get(metadataGrpcTimeout); tm != "" { + var err error + timeout, err = timeoutDecode(tm) + if err != nil { + return nil, nil, status.Errorf(codes.InvalidArgument, "invalid grpc-timeout: %s", tm) + } + } + + for key, vals := range req.Header { + key = textproto.CanonicalMIMEHeaderKey(key) + for _, val := range vals { + // For backwards-compatibility, pass through 'authorization' header with no prefix. + if key == "Authorization" { + pairs = append(pairs, "authorization", val) + } + if h, ok := mux.incomingHeaderMatcher(key); ok { + // Handles "-bin" metadata in grpc, since grpc will do another base64 + // encode before sending to server, we need to decode it first. + if strings.HasSuffix(key, metadataHeaderBinarySuffix) { + b, err := decodeBinHeader(val) + if err != nil { + return nil, nil, status.Errorf(codes.InvalidArgument, "invalid binary header %s: %s", key, err) + } + + val = string(b) + } + pairs = append(pairs, h, val) + } + } + } + if host := req.Header.Get(xForwardedHost); host != "" { + pairs = append(pairs, strings.ToLower(xForwardedHost), host) + } else if req.Host != "" { + pairs = append(pairs, strings.ToLower(xForwardedHost), req.Host) + } + + if addr := req.RemoteAddr; addr != "" { + if remoteIP, _, err := net.SplitHostPort(addr); err == nil { + if fwd := req.Header.Get(xForwardedFor); fwd == "" { + pairs = append(pairs, strings.ToLower(xForwardedFor), remoteIP) + } else { + pairs = append(pairs, strings.ToLower(xForwardedFor), fmt.Sprintf("%s, %s", fwd, remoteIP)) + } + } + } + + if timeout != 0 { + ctx, _ = context.WithTimeout(ctx, timeout) + } + if len(pairs) == 0 { + return ctx, nil, nil + } + md := metadata.Pairs(pairs...) + for _, mda := range mux.metadataAnnotators { + md = metadata.Join(md, mda(ctx, req)) + } + return ctx, md, nil +} + +// ServerMetadata consists of metadata sent from gRPC server. +type ServerMetadata struct { + HeaderMD metadata.MD + TrailerMD metadata.MD +} + +type serverMetadataKey struct{} + +// NewServerMetadataContext creates a new context with ServerMetadata +func NewServerMetadataContext(ctx context.Context, md ServerMetadata) context.Context { + return context.WithValue(ctx, serverMetadataKey{}, md) +} + +// ServerMetadataFromContext returns the ServerMetadata in ctx +func ServerMetadataFromContext(ctx context.Context) (md ServerMetadata, ok bool) { + md, ok = ctx.Value(serverMetadataKey{}).(ServerMetadata) + return +} + +// ServerTransportStream implements grpc.ServerTransportStream. +// It should only be used by the generated files to support grpc.SendHeader +// outside of gRPC server use. +type ServerTransportStream struct { + mu sync.Mutex + header metadata.MD + trailer metadata.MD +} + +// Method returns the method for the stream. +func (s *ServerTransportStream) Method() string { + return "" +} + +// Header returns the header metadata of the stream. +func (s *ServerTransportStream) Header() metadata.MD { + s.mu.Lock() + defer s.mu.Unlock() + return s.header.Copy() +} + +// SetHeader sets the header metadata. +func (s *ServerTransportStream) SetHeader(md metadata.MD) error { + if md.Len() == 0 { + return nil + } + + s.mu.Lock() + s.header = metadata.Join(s.header, md) + s.mu.Unlock() + return nil +} + +// SendHeader sets the header metadata. +func (s *ServerTransportStream) SendHeader(md metadata.MD) error { + return s.SetHeader(md) +} + +// Trailer returns the cached trailer metadata. +func (s *ServerTransportStream) Trailer() metadata.MD { + s.mu.Lock() + defer s.mu.Unlock() + return s.trailer.Copy() +} + +// SetTrailer sets the trailer metadata. +func (s *ServerTransportStream) SetTrailer(md metadata.MD) error { + if md.Len() == 0 { + return nil + } + + s.mu.Lock() + s.trailer = metadata.Join(s.trailer, md) + s.mu.Unlock() + return nil +} + +func timeoutDecode(s string) (time.Duration, error) { + size := len(s) + if size < 2 { + return 0, fmt.Errorf("timeout string is too short: %q", s) + } + d, ok := timeoutUnitToDuration(s[size-1]) + if !ok { + return 0, fmt.Errorf("timeout unit is not recognized: %q", s) + } + t, err := strconv.ParseInt(s[:size-1], 10, 64) + if err != nil { + return 0, err + } + return d * time.Duration(t), nil +} + +func timeoutUnitToDuration(u uint8) (d time.Duration, ok bool) { + switch u { + case 'H': + return time.Hour, true + case 'M': + return time.Minute, true + case 'S': + return time.Second, true + case 'm': + return time.Millisecond, true + case 'u': + return time.Microsecond, true + case 'n': + return time.Nanosecond, true + default: + } + return +} + +// isPermanentHTTPHeader checks whether hdr belongs to the list of +// permanent request headers maintained by IANA. +// http://www.iana.org/assignments/message-headers/message-headers.xml +func isPermanentHTTPHeader(hdr string) bool { + switch hdr { + case + "Accept", + "Accept-Charset", + "Accept-Language", + "Accept-Ranges", + "Authorization", + "Cache-Control", + "Content-Type", + "Cookie", + "Date", + "Expect", + "From", + "Host", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Schedule-Tag-Match", + "If-Unmodified-Since", + "Max-Forwards", + "Origin", + "Pragma", + "Referer", + "User-Agent", + "Via", + "Warning": + return true + } + return false +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go new file mode 100644 index 000000000000..2c279344dc41 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go @@ -0,0 +1,318 @@ +package runtime + +import ( + "encoding/base64" + "fmt" + "strconv" + "strings" + + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/ptypes/duration" + "github.com/golang/protobuf/ptypes/timestamp" + "github.com/golang/protobuf/ptypes/wrappers" +) + +// String just returns the given string. +// It is just for compatibility to other types. +func String(val string) (string, error) { + return val, nil +} + +// StringSlice converts 'val' where individual strings are separated by +// 'sep' into a string slice. +func StringSlice(val, sep string) ([]string, error) { + return strings.Split(val, sep), nil +} + +// Bool converts the given string representation of a boolean value into bool. +func Bool(val string) (bool, error) { + return strconv.ParseBool(val) +} + +// BoolSlice converts 'val' where individual booleans are separated by +// 'sep' into a bool slice. +func BoolSlice(val, sep string) ([]bool, error) { + s := strings.Split(val, sep) + values := make([]bool, len(s)) + for i, v := range s { + value, err := Bool(v) + if err != nil { + return values, err + } + values[i] = value + } + return values, nil +} + +// Float64 converts the given string representation into representation of a floating point number into float64. +func Float64(val string) (float64, error) { + return strconv.ParseFloat(val, 64) +} + +// Float64Slice converts 'val' where individual floating point numbers are separated by +// 'sep' into a float64 slice. +func Float64Slice(val, sep string) ([]float64, error) { + s := strings.Split(val, sep) + values := make([]float64, len(s)) + for i, v := range s { + value, err := Float64(v) + if err != nil { + return values, err + } + values[i] = value + } + return values, nil +} + +// Float32 converts the given string representation of a floating point number into float32. +func Float32(val string) (float32, error) { + f, err := strconv.ParseFloat(val, 32) + if err != nil { + return 0, err + } + return float32(f), nil +} + +// Float32Slice converts 'val' where individual floating point numbers are separated by +// 'sep' into a float32 slice. +func Float32Slice(val, sep string) ([]float32, error) { + s := strings.Split(val, sep) + values := make([]float32, len(s)) + for i, v := range s { + value, err := Float32(v) + if err != nil { + return values, err + } + values[i] = value + } + return values, nil +} + +// Int64 converts the given string representation of an integer into int64. +func Int64(val string) (int64, error) { + return strconv.ParseInt(val, 0, 64) +} + +// Int64Slice converts 'val' where individual integers are separated by +// 'sep' into a int64 slice. +func Int64Slice(val, sep string) ([]int64, error) { + s := strings.Split(val, sep) + values := make([]int64, len(s)) + for i, v := range s { + value, err := Int64(v) + if err != nil { + return values, err + } + values[i] = value + } + return values, nil +} + +// Int32 converts the given string representation of an integer into int32. +func Int32(val string) (int32, error) { + i, err := strconv.ParseInt(val, 0, 32) + if err != nil { + return 0, err + } + return int32(i), nil +} + +// Int32Slice converts 'val' where individual integers are separated by +// 'sep' into a int32 slice. +func Int32Slice(val, sep string) ([]int32, error) { + s := strings.Split(val, sep) + values := make([]int32, len(s)) + for i, v := range s { + value, err := Int32(v) + if err != nil { + return values, err + } + values[i] = value + } + return values, nil +} + +// Uint64 converts the given string representation of an integer into uint64. +func Uint64(val string) (uint64, error) { + return strconv.ParseUint(val, 0, 64) +} + +// Uint64Slice converts 'val' where individual integers are separated by +// 'sep' into a uint64 slice. +func Uint64Slice(val, sep string) ([]uint64, error) { + s := strings.Split(val, sep) + values := make([]uint64, len(s)) + for i, v := range s { + value, err := Uint64(v) + if err != nil { + return values, err + } + values[i] = value + } + return values, nil +} + +// Uint32 converts the given string representation of an integer into uint32. +func Uint32(val string) (uint32, error) { + i, err := strconv.ParseUint(val, 0, 32) + if err != nil { + return 0, err + } + return uint32(i), nil +} + +// Uint32Slice converts 'val' where individual integers are separated by +// 'sep' into a uint32 slice. +func Uint32Slice(val, sep string) ([]uint32, error) { + s := strings.Split(val, sep) + values := make([]uint32, len(s)) + for i, v := range s { + value, err := Uint32(v) + if err != nil { + return values, err + } + values[i] = value + } + return values, nil +} + +// Bytes converts the given string representation of a byte sequence into a slice of bytes +// A bytes sequence is encoded in URL-safe base64 without padding +func Bytes(val string) ([]byte, error) { + b, err := base64.StdEncoding.DecodeString(val) + if err != nil { + b, err = base64.URLEncoding.DecodeString(val) + if err != nil { + return nil, err + } + } + return b, nil +} + +// BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe +// base64 without padding, are separated by 'sep' into a slice of bytes slices slice. +func BytesSlice(val, sep string) ([][]byte, error) { + s := strings.Split(val, sep) + values := make([][]byte, len(s)) + for i, v := range s { + value, err := Bytes(v) + if err != nil { + return values, err + } + values[i] = value + } + return values, nil +} + +// Timestamp converts the given RFC3339 formatted string into a timestamp.Timestamp. +func Timestamp(val string) (*timestamp.Timestamp, error) { + var r timestamp.Timestamp + err := jsonpb.UnmarshalString(val, &r) + if err != nil { + return nil, err + } + return &r, nil +} + +// Duration converts the given string into a timestamp.Duration. +func Duration(val string) (*duration.Duration, error) { + var r duration.Duration + err := jsonpb.UnmarshalString(val, &r) + if err != nil { + return nil, err + } + return &r, nil +} + +// Enum converts the given string into an int32 that should be type casted into the +// correct enum proto type. +func Enum(val string, enumValMap map[string]int32) (int32, error) { + e, ok := enumValMap[val] + if ok { + return e, nil + } + + i, err := Int32(val) + if err != nil { + return 0, fmt.Errorf("%s is not valid", val) + } + for _, v := range enumValMap { + if v == i { + return i, nil + } + } + return 0, fmt.Errorf("%s is not valid", val) +} + +// EnumSlice converts 'val' where individual enums are separated by 'sep' +// into a int32 slice. Each individual int32 should be type casted into the +// correct enum proto type. +func EnumSlice(val, sep string, enumValMap map[string]int32) ([]int32, error) { + s := strings.Split(val, sep) + values := make([]int32, len(s)) + for i, v := range s { + value, err := Enum(v, enumValMap) + if err != nil { + return values, err + } + values[i] = value + } + return values, nil +} + +/* + Support fot google.protobuf.wrappers on top of primitive types +*/ + +// StringValue well-known type support as wrapper around string type +func StringValue(val string) (*wrappers.StringValue, error) { + return &wrappers.StringValue{Value: val}, nil +} + +// FloatValue well-known type support as wrapper around float32 type +func FloatValue(val string) (*wrappers.FloatValue, error) { + parsedVal, err := Float32(val) + return &wrappers.FloatValue{Value: parsedVal}, err +} + +// DoubleValue well-known type support as wrapper around float64 type +func DoubleValue(val string) (*wrappers.DoubleValue, error) { + parsedVal, err := Float64(val) + return &wrappers.DoubleValue{Value: parsedVal}, err +} + +// BoolValue well-known type support as wrapper around bool type +func BoolValue(val string) (*wrappers.BoolValue, error) { + parsedVal, err := Bool(val) + return &wrappers.BoolValue{Value: parsedVal}, err +} + +// Int32Value well-known type support as wrapper around int32 type +func Int32Value(val string) (*wrappers.Int32Value, error) { + parsedVal, err := Int32(val) + return &wrappers.Int32Value{Value: parsedVal}, err +} + +// UInt32Value well-known type support as wrapper around uint32 type +func UInt32Value(val string) (*wrappers.UInt32Value, error) { + parsedVal, err := Uint32(val) + return &wrappers.UInt32Value{Value: parsedVal}, err +} + +// Int64Value well-known type support as wrapper around int64 type +func Int64Value(val string) (*wrappers.Int64Value, error) { + parsedVal, err := Int64(val) + return &wrappers.Int64Value{Value: parsedVal}, err +} + +// UInt64Value well-known type support as wrapper around uint64 type +func UInt64Value(val string) (*wrappers.UInt64Value, error) { + parsedVal, err := Uint64(val) + return &wrappers.UInt64Value{Value: parsedVal}, err +} + +// BytesValue well-known type support as wrapper around bytes[] type +func BytesValue(val string) (*wrappers.BytesValue, error) { + parsedVal, err := Bytes(val) + return &wrappers.BytesValue{Value: parsedVal}, err +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go new file mode 100644 index 000000000000..b6e5ddf7a9f1 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go @@ -0,0 +1,5 @@ +/* +Package runtime contains runtime helper functions used by +servers which protoc-gen-grpc-gateway generates. +*/ +package runtime diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go new file mode 100644 index 000000000000..b2ce743bddcd --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go @@ -0,0 +1,186 @@ +package runtime + +import ( + "context" + "io" + "net/http" + "strings" + + "github.com/grpc-ecosystem/grpc-gateway/internal" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status. +// See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto +func HTTPStatusFromCode(code codes.Code) int { + switch code { + case codes.OK: + return http.StatusOK + case codes.Canceled: + return http.StatusRequestTimeout + case codes.Unknown: + return http.StatusInternalServerError + case codes.InvalidArgument: + return http.StatusBadRequest + case codes.DeadlineExceeded: + return http.StatusGatewayTimeout + case codes.NotFound: + return http.StatusNotFound + case codes.AlreadyExists: + return http.StatusConflict + case codes.PermissionDenied: + return http.StatusForbidden + case codes.Unauthenticated: + return http.StatusUnauthorized + case codes.ResourceExhausted: + return http.StatusTooManyRequests + case codes.FailedPrecondition: + // Note, this deliberately doesn't translate to the similarly named '412 Precondition Failed' HTTP response status. + return http.StatusBadRequest + case codes.Aborted: + return http.StatusConflict + case codes.OutOfRange: + return http.StatusBadRequest + case codes.Unimplemented: + return http.StatusNotImplemented + case codes.Internal: + return http.StatusInternalServerError + case codes.Unavailable: + return http.StatusServiceUnavailable + case codes.DataLoss: + return http.StatusInternalServerError + } + + grpclog.Infof("Unknown gRPC error code: %v", code) + return http.StatusInternalServerError +} + +var ( + // HTTPError replies to the request with an error. + // + // HTTPError is called: + // - From generated per-endpoint gateway handler code, when calling the backend results in an error. + // - From gateway runtime code, when forwarding the response message results in an error. + // + // The default value for HTTPError calls the custom error handler configured on the ServeMux via the + // WithProtoErrorHandler serve option if that option was used, calling GlobalHTTPErrorHandler otherwise. + // + // To customize the error handling of a particular ServeMux instance, use the WithProtoErrorHandler + // serve option. + // + // To customize the error format for all ServeMux instances not using the WithProtoErrorHandler serve + // option, set GlobalHTTPErrorHandler to a custom function. + // + // Setting this variable directly to customize error format is deprecated. + HTTPError = MuxOrGlobalHTTPError + + // GlobalHTTPErrorHandler is the HTTPError handler for all ServeMux instances not using the + // WithProtoErrorHandler serve option. + // + // You can set a custom function to this variable to customize error format. + GlobalHTTPErrorHandler = DefaultHTTPError + + // OtherErrorHandler handles gateway errors from parsing and routing client requests for all + // ServeMux instances not using the WithProtoErrorHandler serve option. + // + // It returns the following error codes: StatusMethodNotAllowed StatusNotFound StatusBadRequest + // + // To customize parsing and routing error handling of a particular ServeMux instance, use the + // WithProtoErrorHandler serve option. + // + // To customize parsing and routing error handling of all ServeMux instances not using the + // WithProtoErrorHandler serve option, set a custom function to this variable. + OtherErrorHandler = DefaultOtherErrorHandler +) + +// MuxOrGlobalHTTPError uses the mux-configured error handler, falling back to GlobalErrorHandler. +func MuxOrGlobalHTTPError(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, r *http.Request, err error) { + if mux.protoErrorHandler != nil { + mux.protoErrorHandler(ctx, mux, marshaler, w, r, err) + } else { + GlobalHTTPErrorHandler(ctx, mux, marshaler, w, r, err) + } +} + +// DefaultHTTPError is the default implementation of HTTPError. +// If "err" is an error from gRPC system, the function replies with the status code mapped by HTTPStatusFromCode. +// If otherwise, it replies with http.StatusInternalServerError. +// +// The response body returned by this function is a JSON object, +// which contains a member whose key is "error" and whose value is err.Error(). +func DefaultHTTPError(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, r *http.Request, err error) { + const fallback = `{"error": "failed to marshal error message"}` + + s, ok := status.FromError(err) + if !ok { + s = status.New(codes.Unknown, err.Error()) + } + + w.Header().Del("Trailer") + w.Header().Del("Transfer-Encoding") + + contentType := marshaler.ContentType() + // Check marshaler on run time in order to keep backwards compatibility + // An interface param needs to be added to the ContentType() function on + // the Marshal interface to be able to remove this check + if typeMarshaler, ok := marshaler.(contentTypeMarshaler); ok { + pb := s.Proto() + contentType = typeMarshaler.ContentTypeFromMessage(pb) + } + w.Header().Set("Content-Type", contentType) + + body := &internal.Error{ + Error: s.Message(), + Message: s.Message(), + Code: int32(s.Code()), + Details: s.Proto().GetDetails(), + } + + buf, merr := marshaler.Marshal(body) + if merr != nil { + grpclog.Infof("Failed to marshal error message %q: %v", body, merr) + w.WriteHeader(http.StatusInternalServerError) + if _, err := io.WriteString(w, fallback); err != nil { + grpclog.Infof("Failed to write response: %v", err) + } + return + } + + md, ok := ServerMetadataFromContext(ctx) + if !ok { + grpclog.Infof("Failed to extract ServerMetadata from context") + } + + handleForwardResponseServerMetadata(w, mux, md) + + // RFC 7230 https://tools.ietf.org/html/rfc7230#section-4.1.2 + // Unless the request includes a TE header field indicating "trailers" + // is acceptable, as described in Section 4.3, a server SHOULD NOT + // generate trailer fields that it believes are necessary for the user + // agent to receive. + var wantsTrailers bool + + if te := r.Header.Get("TE"); strings.Contains(strings.ToLower(te), "trailers") { + wantsTrailers = true + handleForwardResponseTrailerHeader(w, md) + w.Header().Set("Transfer-Encoding", "chunked") + } + + st := HTTPStatusFromCode(s.Code()) + w.WriteHeader(st) + if _, err := w.Write(buf); err != nil { + grpclog.Infof("Failed to write response: %v", err) + } + + if wantsTrailers { + handleForwardResponseTrailer(w, md) + } +} + +// DefaultOtherErrorHandler is the default implementation of OtherErrorHandler. +// It simply writes a string representation of the given error into "w". +func DefaultOtherErrorHandler(w http.ResponseWriter, _ *http.Request, msg string, code int) { + http.Error(w, msg, code) +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go new file mode 100644 index 000000000000..aef645e40b92 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go @@ -0,0 +1,89 @@ +package runtime + +import ( + "encoding/json" + "io" + "strings" + + descriptor2 "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/protoc-gen-go/descriptor" + "google.golang.org/genproto/protobuf/field_mask" +) + +func translateName(name string, md *descriptor.DescriptorProto) (string, *descriptor.DescriptorProto) { + // TODO - should really gate this with a test that the marshaller has used json names + if md != nil { + for _, f := range md.Field { + if f.JsonName != nil && f.Name != nil && *f.JsonName == name { + var subType *descriptor.DescriptorProto + + // If the field has a TypeName then we retrieve the nested type for translating the embedded message names. + if f.TypeName != nil { + typeSplit := strings.Split(*f.TypeName, ".") + typeName := typeSplit[len(typeSplit)-1] + for _, t := range md.NestedType { + if typeName == *t.Name { + subType = t + } + } + } + return *f.Name, subType + } + } + } + return name, nil +} + +// FieldMaskFromRequestBody creates a FieldMask printing all complete paths from the JSON body. +func FieldMaskFromRequestBody(r io.Reader, md *descriptor.DescriptorProto) (*field_mask.FieldMask, error) { + fm := &field_mask.FieldMask{} + var root interface{} + if err := json.NewDecoder(r).Decode(&root); err != nil { + if err == io.EOF { + return fm, nil + } + return nil, err + } + + queue := []fieldMaskPathItem{{node: root, md: md}} + for len(queue) > 0 { + // dequeue an item + item := queue[0] + queue = queue[1:] + + if m, ok := item.node.(map[string]interface{}); ok { + // if the item is an object, then enqueue all of its children + for k, v := range m { + protoName, subMd := translateName(k, item.md) + if subMsg, ok := v.(descriptor2.Message); ok { + _, subMd = descriptor2.ForMessage(subMsg) + } + + var path string + if item.path == "" { + path = protoName + } else { + path = item.path + "." + protoName + } + queue = append(queue, fieldMaskPathItem{path: path, node: v, md: subMd}) + } + } else if len(item.path) > 0 { + // otherwise, it's a leaf node so print its path + fm.Paths = append(fm.Paths, item.path) + } + } + + return fm, nil +} + +// fieldMaskPathItem stores a in-progress deconstruction of a path for a fieldmask +type fieldMaskPathItem struct { + // the list of prior fields leading up to node connected by dots + path string + + // a generic decoded json object the current item to inspect for further path extraction + node interface{} + + // descriptor for parent message + md *descriptor.DescriptorProto +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go new file mode 100644 index 000000000000..e6e8f286e129 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go @@ -0,0 +1,212 @@ +package runtime + +import ( + "context" + "errors" + "fmt" + "io" + "net/http" + "net/textproto" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/internal" + "google.golang.org/grpc/grpclog" +) + +var errEmptyResponse = errors.New("empty response") + +// ForwardResponseStream forwards the stream from gRPC server to REST client. +func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, recv func() (proto.Message, error), opts ...func(context.Context, http.ResponseWriter, proto.Message) error) { + f, ok := w.(http.Flusher) + if !ok { + grpclog.Infof("Flush not supported in %T", w) + http.Error(w, "unexpected type of web server", http.StatusInternalServerError) + return + } + + md, ok := ServerMetadataFromContext(ctx) + if !ok { + grpclog.Infof("Failed to extract ServerMetadata from context") + http.Error(w, "unexpected error", http.StatusInternalServerError) + return + } + handleForwardResponseServerMetadata(w, mux, md) + + w.Header().Set("Transfer-Encoding", "chunked") + w.Header().Set("Content-Type", marshaler.ContentType()) + if err := handleForwardResponseOptions(ctx, w, nil, opts); err != nil { + HTTPError(ctx, mux, marshaler, w, req, err) + return + } + + var delimiter []byte + if d, ok := marshaler.(Delimited); ok { + delimiter = d.Delimiter() + } else { + delimiter = []byte("\n") + } + + var wroteHeader bool + for { + resp, err := recv() + if err == io.EOF { + return + } + if err != nil { + handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err) + return + } + if err := handleForwardResponseOptions(ctx, w, resp, opts); err != nil { + handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err) + return + } + + var buf []byte + switch { + case resp == nil: + buf, err = marshaler.Marshal(errorChunk(streamError(ctx, mux.streamErrorHandler, errEmptyResponse))) + default: + result := map[string]interface{}{"result": resp} + if rb, ok := resp.(responseBody); ok { + result["result"] = rb.XXX_ResponseBody() + } + + buf, err = marshaler.Marshal(result) + } + + if err != nil { + grpclog.Infof("Failed to marshal response chunk: %v", err) + handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err) + return + } + if _, err = w.Write(buf); err != nil { + grpclog.Infof("Failed to send response chunk: %v", err) + return + } + wroteHeader = true + if _, err = w.Write(delimiter); err != nil { + grpclog.Infof("Failed to send delimiter chunk: %v", err) + return + } + f.Flush() + } +} + +func handleForwardResponseServerMetadata(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) { + for k, vs := range md.HeaderMD { + if h, ok := mux.outgoingHeaderMatcher(k); ok { + for _, v := range vs { + w.Header().Add(h, v) + } + } + } +} + +func handleForwardResponseTrailerHeader(w http.ResponseWriter, md ServerMetadata) { + for k := range md.TrailerMD { + tKey := textproto.CanonicalMIMEHeaderKey(fmt.Sprintf("%s%s", MetadataTrailerPrefix, k)) + w.Header().Add("Trailer", tKey) + } +} + +func handleForwardResponseTrailer(w http.ResponseWriter, md ServerMetadata) { + for k, vs := range md.TrailerMD { + tKey := fmt.Sprintf("%s%s", MetadataTrailerPrefix, k) + for _, v := range vs { + w.Header().Add(tKey, v) + } + } +} + +// responseBody interface contains method for getting field for marshaling to the response body +// this method is generated for response struct from the value of `response_body` in the `google.api.HttpRule` +type responseBody interface { + XXX_ResponseBody() interface{} +} + +// ForwardResponseMessage forwards the message "resp" from gRPC server to REST client. +func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, resp proto.Message, opts ...func(context.Context, http.ResponseWriter, proto.Message) error) { + md, ok := ServerMetadataFromContext(ctx) + if !ok { + grpclog.Infof("Failed to extract ServerMetadata from context") + } + + handleForwardResponseServerMetadata(w, mux, md) + handleForwardResponseTrailerHeader(w, md) + + contentType := marshaler.ContentType() + // Check marshaler on run time in order to keep backwards compatibility + // An interface param needs to be added to the ContentType() function on + // the Marshal interface to be able to remove this check + if typeMarshaler, ok := marshaler.(contentTypeMarshaler); ok { + contentType = typeMarshaler.ContentTypeFromMessage(resp) + } + w.Header().Set("Content-Type", contentType) + + if err := handleForwardResponseOptions(ctx, w, resp, opts); err != nil { + HTTPError(ctx, mux, marshaler, w, req, err) + return + } + var buf []byte + var err error + if rb, ok := resp.(responseBody); ok { + buf, err = marshaler.Marshal(rb.XXX_ResponseBody()) + } else { + buf, err = marshaler.Marshal(resp) + } + if err != nil { + grpclog.Infof("Marshal error: %v", err) + HTTPError(ctx, mux, marshaler, w, req, err) + return + } + + if _, err = w.Write(buf); err != nil { + grpclog.Infof("Failed to write response: %v", err) + } + + handleForwardResponseTrailer(w, md) +} + +func handleForwardResponseOptions(ctx context.Context, w http.ResponseWriter, resp proto.Message, opts []func(context.Context, http.ResponseWriter, proto.Message) error) error { + if len(opts) == 0 { + return nil + } + for _, opt := range opts { + if err := opt(ctx, w, resp); err != nil { + grpclog.Infof("Error handling ForwardResponseOptions: %v", err) + return err + } + } + return nil +} + +func handleForwardResponseStreamError(ctx context.Context, wroteHeader bool, marshaler Marshaler, w http.ResponseWriter, req *http.Request, mux *ServeMux, err error) { + serr := streamError(ctx, mux.streamErrorHandler, err) + if !wroteHeader { + w.WriteHeader(int(serr.HttpCode)) + } + buf, merr := marshaler.Marshal(errorChunk(serr)) + if merr != nil { + grpclog.Infof("Failed to marshal an error: %v", merr) + return + } + if _, werr := w.Write(buf); werr != nil { + grpclog.Infof("Failed to notify error to client: %v", werr) + return + } +} + +// streamError returns the payload for the final message in a response stream +// that represents the given err. +func streamError(ctx context.Context, errHandler StreamErrorHandlerFunc, err error) *StreamError { + serr := errHandler(ctx, err) + if serr != nil { + return serr + } + // TODO: log about misbehaving stream error handler? + return DefaultHTTPStreamErrorHandler(ctx, err) +} + +func errorChunk(err *StreamError) map[string]proto.Message { + return map[string]proto.Message{"error": (*internal.StreamError)(err)} +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go new file mode 100644 index 000000000000..525b0338c747 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go @@ -0,0 +1,43 @@ +package runtime + +import ( + "google.golang.org/genproto/googleapis/api/httpbody" +) + +// SetHTTPBodyMarshaler overwrite the default marshaler with the HTTPBodyMarshaler +func SetHTTPBodyMarshaler(serveMux *ServeMux) { + serveMux.marshalers.mimeMap[MIMEWildcard] = &HTTPBodyMarshaler{ + Marshaler: &JSONPb{OrigName: true}, + } +} + +// HTTPBodyMarshaler is a Marshaler which supports marshaling of a +// google.api.HttpBody message as the full response body if it is +// the actual message used as the response. If not, then this will +// simply fallback to the Marshaler specified as its default Marshaler. +type HTTPBodyMarshaler struct { + Marshaler +} + +// ContentType implementation to keep backwards compatibility with marshal interface +func (h *HTTPBodyMarshaler) ContentType() string { + return h.ContentTypeFromMessage(nil) +} + +// ContentTypeFromMessage in case v is a google.api.HttpBody message it returns +// its specified content type otherwise fall back to the default Marshaler. +func (h *HTTPBodyMarshaler) ContentTypeFromMessage(v interface{}) string { + if httpBody, ok := v.(*httpbody.HttpBody); ok { + return httpBody.GetContentType() + } + return h.Marshaler.ContentType() +} + +// Marshal marshals "v" by returning the body bytes if v is a +// google.api.HttpBody message, otherwise it falls back to the default Marshaler. +func (h *HTTPBodyMarshaler) Marshal(v interface{}) ([]byte, error) { + if httpBody, ok := v.(*httpbody.HttpBody); ok { + return httpBody.Data, nil + } + return h.Marshaler.Marshal(v) +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go new file mode 100644 index 000000000000..f9d3a585a4c0 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go @@ -0,0 +1,45 @@ +package runtime + +import ( + "encoding/json" + "io" +) + +// JSONBuiltin is a Marshaler which marshals/unmarshals into/from JSON +// with the standard "encoding/json" package of Golang. +// Although it is generally faster for simple proto messages than JSONPb, +// it does not support advanced features of protobuf, e.g. map, oneof, .... +// +// The NewEncoder and NewDecoder types return *json.Encoder and +// *json.Decoder respectively. +type JSONBuiltin struct{} + +// ContentType always Returns "application/json". +func (*JSONBuiltin) ContentType() string { + return "application/json" +} + +// Marshal marshals "v" into JSON +func (j *JSONBuiltin) Marshal(v interface{}) ([]byte, error) { + return json.Marshal(v) +} + +// Unmarshal unmarshals JSON data into "v". +func (j *JSONBuiltin) Unmarshal(data []byte, v interface{}) error { + return json.Unmarshal(data, v) +} + +// NewDecoder returns a Decoder which reads JSON stream from "r". +func (j *JSONBuiltin) NewDecoder(r io.Reader) Decoder { + return json.NewDecoder(r) +} + +// NewEncoder returns an Encoder which writes JSON stream into "w". +func (j *JSONBuiltin) NewEncoder(w io.Writer) Encoder { + return json.NewEncoder(w) +} + +// Delimiter for newline encoded JSON streams. +func (j *JSONBuiltin) Delimiter() []byte { + return []byte("\n") +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go new file mode 100644 index 000000000000..f0de351b212d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go @@ -0,0 +1,262 @@ +package runtime + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "reflect" + + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" +) + +// JSONPb is a Marshaler which marshals/unmarshals into/from JSON +// with the "github.com/golang/protobuf/jsonpb". +// It supports fully functionality of protobuf unlike JSONBuiltin. +// +// The NewDecoder method returns a DecoderWrapper, so the underlying +// *json.Decoder methods can be used. +type JSONPb jsonpb.Marshaler + +// ContentType always returns "application/json". +func (*JSONPb) ContentType() string { + return "application/json" +} + +// Marshal marshals "v" into JSON. +func (j *JSONPb) Marshal(v interface{}) ([]byte, error) { + if _, ok := v.(proto.Message); !ok { + return j.marshalNonProtoField(v) + } + + var buf bytes.Buffer + if err := j.marshalTo(&buf, v); err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +func (j *JSONPb) marshalTo(w io.Writer, v interface{}) error { + p, ok := v.(proto.Message) + if !ok { + buf, err := j.marshalNonProtoField(v) + if err != nil { + return err + } + _, err = w.Write(buf) + return err + } + return (*jsonpb.Marshaler)(j).Marshal(w, p) +} + +var ( + // protoMessageType is stored to prevent constant lookup of the same type at runtime. + protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem() +) + +// marshalNonProto marshals a non-message field of a protobuf message. +// This function does not correctly marshals arbitrary data structure into JSON, +// but it is only capable of marshaling non-message field values of protobuf, +// i.e. primitive types, enums; pointers to primitives or enums; maps from +// integer/string types to primitives/enums/pointers to messages. +func (j *JSONPb) marshalNonProtoField(v interface{}) ([]byte, error) { + if v == nil { + return []byte("null"), nil + } + rv := reflect.ValueOf(v) + for rv.Kind() == reflect.Ptr { + if rv.IsNil() { + return []byte("null"), nil + } + rv = rv.Elem() + } + + if rv.Kind() == reflect.Slice { + if rv.IsNil() { + if j.EmitDefaults { + return []byte("[]"), nil + } + return []byte("null"), nil + } + + if rv.Type().Elem().Implements(protoMessageType) { + var buf bytes.Buffer + err := buf.WriteByte('[') + if err != nil { + return nil, err + } + for i := 0; i < rv.Len(); i++ { + if i != 0 { + err = buf.WriteByte(',') + if err != nil { + return nil, err + } + } + if err = (*jsonpb.Marshaler)(j).Marshal(&buf, rv.Index(i).Interface().(proto.Message)); err != nil { + return nil, err + } + } + err = buf.WriteByte(']') + if err != nil { + return nil, err + } + + return buf.Bytes(), nil + } + } + + if rv.Kind() == reflect.Map { + m := make(map[string]*json.RawMessage) + for _, k := range rv.MapKeys() { + buf, err := j.Marshal(rv.MapIndex(k).Interface()) + if err != nil { + return nil, err + } + m[fmt.Sprintf("%v", k.Interface())] = (*json.RawMessage)(&buf) + } + if j.Indent != "" { + return json.MarshalIndent(m, "", j.Indent) + } + return json.Marshal(m) + } + if enum, ok := rv.Interface().(protoEnum); ok && !j.EnumsAsInts { + return json.Marshal(enum.String()) + } + return json.Marshal(rv.Interface()) +} + +// Unmarshal unmarshals JSON "data" into "v" +func (j *JSONPb) Unmarshal(data []byte, v interface{}) error { + return unmarshalJSONPb(data, v) +} + +// NewDecoder returns a Decoder which reads JSON stream from "r". +func (j *JSONPb) NewDecoder(r io.Reader) Decoder { + d := json.NewDecoder(r) + return DecoderWrapper{Decoder: d} +} + +// DecoderWrapper is a wrapper around a *json.Decoder that adds +// support for protos to the Decode method. +type DecoderWrapper struct { + *json.Decoder +} + +// Decode wraps the embedded decoder's Decode method to support +// protos using a jsonpb.Unmarshaler. +func (d DecoderWrapper) Decode(v interface{}) error { + return decodeJSONPb(d.Decoder, v) +} + +// NewEncoder returns an Encoder which writes JSON stream into "w". +func (j *JSONPb) NewEncoder(w io.Writer) Encoder { + return EncoderFunc(func(v interface{}) error { + if err := j.marshalTo(w, v); err != nil { + return err + } + // mimic json.Encoder by adding a newline (makes output + // easier to read when it contains multiple encoded items) + _, err := w.Write(j.Delimiter()) + return err + }) +} + +func unmarshalJSONPb(data []byte, v interface{}) error { + d := json.NewDecoder(bytes.NewReader(data)) + return decodeJSONPb(d, v) +} + +func decodeJSONPb(d *json.Decoder, v interface{}) error { + p, ok := v.(proto.Message) + if !ok { + return decodeNonProtoField(d, v) + } + unmarshaler := &jsonpb.Unmarshaler{AllowUnknownFields: allowUnknownFields} + return unmarshaler.UnmarshalNext(d, p) +} + +func decodeNonProtoField(d *json.Decoder, v interface{}) error { + rv := reflect.ValueOf(v) + if rv.Kind() != reflect.Ptr { + return fmt.Errorf("%T is not a pointer", v) + } + for rv.Kind() == reflect.Ptr { + if rv.IsNil() { + rv.Set(reflect.New(rv.Type().Elem())) + } + if rv.Type().ConvertibleTo(typeProtoMessage) { + unmarshaler := &jsonpb.Unmarshaler{AllowUnknownFields: allowUnknownFields} + return unmarshaler.UnmarshalNext(d, rv.Interface().(proto.Message)) + } + rv = rv.Elem() + } + if rv.Kind() == reflect.Map { + if rv.IsNil() { + rv.Set(reflect.MakeMap(rv.Type())) + } + conv, ok := convFromType[rv.Type().Key().Kind()] + if !ok { + return fmt.Errorf("unsupported type of map field key: %v", rv.Type().Key()) + } + + m := make(map[string]*json.RawMessage) + if err := d.Decode(&m); err != nil { + return err + } + for k, v := range m { + result := conv.Call([]reflect.Value{reflect.ValueOf(k)}) + if err := result[1].Interface(); err != nil { + return err.(error) + } + bk := result[0] + bv := reflect.New(rv.Type().Elem()) + if err := unmarshalJSONPb([]byte(*v), bv.Interface()); err != nil { + return err + } + rv.SetMapIndex(bk, bv.Elem()) + } + return nil + } + if _, ok := rv.Interface().(protoEnum); ok { + var repr interface{} + if err := d.Decode(&repr); err != nil { + return err + } + switch repr.(type) { + case string: + // TODO(yugui) Should use proto.StructProperties? + return fmt.Errorf("unmarshaling of symbolic enum %q not supported: %T", repr, rv.Interface()) + case float64: + rv.Set(reflect.ValueOf(int32(repr.(float64))).Convert(rv.Type())) + return nil + default: + return fmt.Errorf("cannot assign %#v into Go type %T", repr, rv.Interface()) + } + } + return d.Decode(v) +} + +type protoEnum interface { + fmt.Stringer + EnumDescriptor() ([]byte, []int) +} + +var typeProtoMessage = reflect.TypeOf((*proto.Message)(nil)).Elem() + +// Delimiter for newline encoded JSON streams. +func (j *JSONPb) Delimiter() []byte { + return []byte("\n") +} + +// allowUnknownFields helps not to return an error when the destination +// is a struct and the input contains object keys which do not match any +// non-ignored, exported fields in the destination. +var allowUnknownFields = true + +// DisallowUnknownFields enables option in decoder (unmarshaller) to +// return an error when it finds an unknown field. This function must be +// called before using the JSON marshaller. +func DisallowUnknownFields() { + allowUnknownFields = false +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go new file mode 100644 index 000000000000..f65d1a2676b8 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go @@ -0,0 +1,62 @@ +package runtime + +import ( + "io" + + "errors" + "github.com/golang/protobuf/proto" + "io/ioutil" +) + +// ProtoMarshaller is a Marshaller which marshals/unmarshals into/from serialize proto bytes +type ProtoMarshaller struct{} + +// ContentType always returns "application/octet-stream". +func (*ProtoMarshaller) ContentType() string { + return "application/octet-stream" +} + +// Marshal marshals "value" into Proto +func (*ProtoMarshaller) Marshal(value interface{}) ([]byte, error) { + message, ok := value.(proto.Message) + if !ok { + return nil, errors.New("unable to marshal non proto field") + } + return proto.Marshal(message) +} + +// Unmarshal unmarshals proto "data" into "value" +func (*ProtoMarshaller) Unmarshal(data []byte, value interface{}) error { + message, ok := value.(proto.Message) + if !ok { + return errors.New("unable to unmarshal non proto field") + } + return proto.Unmarshal(data, message) +} + +// NewDecoder returns a Decoder which reads proto stream from "reader". +func (marshaller *ProtoMarshaller) NewDecoder(reader io.Reader) Decoder { + return DecoderFunc(func(value interface{}) error { + buffer, err := ioutil.ReadAll(reader) + if err != nil { + return err + } + return marshaller.Unmarshal(buffer, value) + }) +} + +// NewEncoder returns an Encoder which writes proto stream into "writer". +func (marshaller *ProtoMarshaller) NewEncoder(writer io.Writer) Encoder { + return EncoderFunc(func(value interface{}) error { + buffer, err := marshaller.Marshal(value) + if err != nil { + return err + } + _, err = writer.Write(buffer) + if err != nil { + return err + } + + return nil + }) +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go new file mode 100644 index 000000000000..46153294217f --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go @@ -0,0 +1,55 @@ +package runtime + +import ( + "io" +) + +// Marshaler defines a conversion between byte sequence and gRPC payloads / fields. +type Marshaler interface { + // Marshal marshals "v" into byte sequence. + Marshal(v interface{}) ([]byte, error) + // Unmarshal unmarshals "data" into "v". + // "v" must be a pointer value. + Unmarshal(data []byte, v interface{}) error + // NewDecoder returns a Decoder which reads byte sequence from "r". + NewDecoder(r io.Reader) Decoder + // NewEncoder returns an Encoder which writes bytes sequence into "w". + NewEncoder(w io.Writer) Encoder + // ContentType returns the Content-Type which this marshaler is responsible for. + ContentType() string +} + +// Marshalers that implement contentTypeMarshaler will have their ContentTypeFromMessage method called +// to set the Content-Type header on the response +type contentTypeMarshaler interface { + // ContentTypeFromMessage returns the Content-Type this marshaler produces from the provided message + ContentTypeFromMessage(v interface{}) string +} + +// Decoder decodes a byte sequence +type Decoder interface { + Decode(v interface{}) error +} + +// Encoder encodes gRPC payloads / fields into byte sequence. +type Encoder interface { + Encode(v interface{}) error +} + +// DecoderFunc adapts an decoder function into Decoder. +type DecoderFunc func(v interface{}) error + +// Decode delegates invocations to the underlying function itself. +func (f DecoderFunc) Decode(v interface{}) error { return f(v) } + +// EncoderFunc adapts an encoder function into Encoder +type EncoderFunc func(v interface{}) error + +// Encode delegates invocations to the underlying function itself. +func (f EncoderFunc) Encode(v interface{}) error { return f(v) } + +// Delimited defines the streaming delimiter. +type Delimited interface { + // Delimiter returns the record separator for the stream. + Delimiter() []byte +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go new file mode 100644 index 000000000000..8dd5c24db427 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go @@ -0,0 +1,99 @@ +package runtime + +import ( + "errors" + "mime" + "net/http" + + "google.golang.org/grpc/grpclog" +) + +// MIMEWildcard is the fallback MIME type used for requests which do not match +// a registered MIME type. +const MIMEWildcard = "*" + +var ( + acceptHeader = http.CanonicalHeaderKey("Accept") + contentTypeHeader = http.CanonicalHeaderKey("Content-Type") + + defaultMarshaler = &JSONPb{OrigName: true} +) + +// MarshalerForRequest returns the inbound/outbound marshalers for this request. +// It checks the registry on the ServeMux for the MIME type set by the Content-Type header. +// If it isn't set (or the request Content-Type is empty), checks for "*". +// If there are multiple Content-Type headers set, choose the first one that it can +// exactly match in the registry. +// Otherwise, it follows the above logic for "*"/InboundMarshaler/OutboundMarshaler. +func MarshalerForRequest(mux *ServeMux, r *http.Request) (inbound Marshaler, outbound Marshaler) { + for _, acceptVal := range r.Header[acceptHeader] { + if m, ok := mux.marshalers.mimeMap[acceptVal]; ok { + outbound = m + break + } + } + + for _, contentTypeVal := range r.Header[contentTypeHeader] { + contentType, _, err := mime.ParseMediaType(contentTypeVal) + if err != nil { + grpclog.Infof("Failed to parse Content-Type %s: %v", contentTypeVal, err) + continue + } + if m, ok := mux.marshalers.mimeMap[contentType]; ok { + inbound = m + break + } + } + + if inbound == nil { + inbound = mux.marshalers.mimeMap[MIMEWildcard] + } + if outbound == nil { + outbound = inbound + } + + return inbound, outbound +} + +// marshalerRegistry is a mapping from MIME types to Marshalers. +type marshalerRegistry struct { + mimeMap map[string]Marshaler +} + +// add adds a marshaler for a case-sensitive MIME type string ("*" to match any +// MIME type). +func (m marshalerRegistry) add(mime string, marshaler Marshaler) error { + if len(mime) == 0 { + return errors.New("empty MIME type") + } + + m.mimeMap[mime] = marshaler + + return nil +} + +// makeMarshalerMIMERegistry returns a new registry of marshalers. +// It allows for a mapping of case-sensitive Content-Type MIME type string to runtime.Marshaler interfaces. +// +// For example, you could allow the client to specify the use of the runtime.JSONPb marshaler +// with a "application/jsonpb" Content-Type and the use of the runtime.JSONBuiltin marshaler +// with a "application/json" Content-Type. +// "*" can be used to match any Content-Type. +// This can be attached to a ServerMux with the marshaler option. +func makeMarshalerMIMERegistry() marshalerRegistry { + return marshalerRegistry{ + mimeMap: map[string]Marshaler{ + MIMEWildcard: defaultMarshaler, + }, + } +} + +// WithMarshalerOption returns a ServeMuxOption which associates inbound and outbound +// Marshalers to a MIME type in mux. +func WithMarshalerOption(mime string, marshaler Marshaler) ServeMuxOption { + return func(mux *ServeMux) { + if err := mux.marshalers.add(mime, marshaler); err != nil { + panic(err) + } + } +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go new file mode 100644 index 000000000000..523a9cb43c93 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go @@ -0,0 +1,300 @@ +package runtime + +import ( + "context" + "fmt" + "net/http" + "net/textproto" + "strings" + + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// A HandlerFunc handles a specific pair of path pattern and HTTP method. +type HandlerFunc func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) + +// ErrUnknownURI is the error supplied to a custom ProtoErrorHandlerFunc when +// a request is received with a URI path that does not match any registered +// service method. +// +// Since gRPC servers return an "Unimplemented" code for requests with an +// unrecognized URI path, this error also has a gRPC "Unimplemented" code. +var ErrUnknownURI = status.Error(codes.Unimplemented, http.StatusText(http.StatusNotImplemented)) + +// ServeMux is a request multiplexer for grpc-gateway. +// It matches http requests to patterns and invokes the corresponding handler. +type ServeMux struct { + // handlers maps HTTP method to a list of handlers. + handlers map[string][]handler + forwardResponseOptions []func(context.Context, http.ResponseWriter, proto.Message) error + marshalers marshalerRegistry + incomingHeaderMatcher HeaderMatcherFunc + outgoingHeaderMatcher HeaderMatcherFunc + metadataAnnotators []func(context.Context, *http.Request) metadata.MD + streamErrorHandler StreamErrorHandlerFunc + protoErrorHandler ProtoErrorHandlerFunc + disablePathLengthFallback bool + lastMatchWins bool +} + +// ServeMuxOption is an option that can be given to a ServeMux on construction. +type ServeMuxOption func(*ServeMux) + +// WithForwardResponseOption returns a ServeMuxOption representing the forwardResponseOption. +// +// forwardResponseOption is an option that will be called on the relevant context.Context, +// http.ResponseWriter, and proto.Message before every forwarded response. +// +// The message may be nil in the case where just a header is being sent. +func WithForwardResponseOption(forwardResponseOption func(context.Context, http.ResponseWriter, proto.Message) error) ServeMuxOption { + return func(serveMux *ServeMux) { + serveMux.forwardResponseOptions = append(serveMux.forwardResponseOptions, forwardResponseOption) + } +} + +// SetQueryParameterParser sets the query parameter parser, used to populate message from query parameters. +// Configuring this will mean the generated swagger output is no longer correct, and it should be +// done with careful consideration. +func SetQueryParameterParser(queryParameterParser QueryParameterParser) ServeMuxOption { + return func(serveMux *ServeMux) { + currentQueryParser = queryParameterParser + } +} + +// HeaderMatcherFunc checks whether a header key should be forwarded to/from gRPC context. +type HeaderMatcherFunc func(string) (string, bool) + +// DefaultHeaderMatcher is used to pass http request headers to/from gRPC context. This adds permanent HTTP header +// keys (as specified by the IANA) to gRPC context with grpcgateway- prefix. HTTP headers that start with +// 'Grpc-Metadata-' are mapped to gRPC metadata after removing prefix 'Grpc-Metadata-'. +func DefaultHeaderMatcher(key string) (string, bool) { + key = textproto.CanonicalMIMEHeaderKey(key) + if isPermanentHTTPHeader(key) { + return MetadataPrefix + key, true + } else if strings.HasPrefix(key, MetadataHeaderPrefix) { + return key[len(MetadataHeaderPrefix):], true + } + return "", false +} + +// WithIncomingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for incoming request to gateway. +// +// This matcher will be called with each header in http.Request. If matcher returns true, that header will be +// passed to gRPC context. To transform the header before passing to gRPC context, matcher should return modified header. +func WithIncomingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption { + return func(mux *ServeMux) { + mux.incomingHeaderMatcher = fn + } +} + +// WithOutgoingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for outgoing response from gateway. +// +// This matcher will be called with each header in response header metadata. If matcher returns true, that header will be +// passed to http response returned from gateway. To transform the header before passing to response, +// matcher should return modified header. +func WithOutgoingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption { + return func(mux *ServeMux) { + mux.outgoingHeaderMatcher = fn + } +} + +// WithMetadata returns a ServeMuxOption for passing metadata to a gRPC context. +// +// This can be used by services that need to read from http.Request and modify gRPC context. A common use case +// is reading token from cookie and adding it in gRPC context. +func WithMetadata(annotator func(context.Context, *http.Request) metadata.MD) ServeMuxOption { + return func(serveMux *ServeMux) { + serveMux.metadataAnnotators = append(serveMux.metadataAnnotators, annotator) + } +} + +// WithProtoErrorHandler returns a ServeMuxOption for configuring a custom error handler. +// +// This can be used to handle an error as general proto message defined by gRPC. +// When this option is used, the mux uses the configured error handler instead of HTTPError and +// OtherErrorHandler. +func WithProtoErrorHandler(fn ProtoErrorHandlerFunc) ServeMuxOption { + return func(serveMux *ServeMux) { + serveMux.protoErrorHandler = fn + } +} + +// WithDisablePathLengthFallback returns a ServeMuxOption for disable path length fallback. +func WithDisablePathLengthFallback() ServeMuxOption { + return func(serveMux *ServeMux) { + serveMux.disablePathLengthFallback = true + } +} + +// WithStreamErrorHandler returns a ServeMuxOption that will use the given custom stream +// error handler, which allows for customizing the error trailer for server-streaming +// calls. +// +// For stream errors that occur before any response has been written, the mux's +// ProtoErrorHandler will be invoked. However, once data has been written, the errors must +// be handled differently: they must be included in the response body. The response body's +// final message will include the error details returned by the stream error handler. +func WithStreamErrorHandler(fn StreamErrorHandlerFunc) ServeMuxOption { + return func(serveMux *ServeMux) { + serveMux.streamErrorHandler = fn + } +} + +// WithLastMatchWins returns a ServeMuxOption that will enable "last +// match wins" behavior, where if multiple path patterns match a +// request path, the last one defined in the .proto file will be used. +func WithLastMatchWins() ServeMuxOption { + return func(serveMux *ServeMux) { + serveMux.lastMatchWins = true + } +} + +// NewServeMux returns a new ServeMux whose internal mapping is empty. +func NewServeMux(opts ...ServeMuxOption) *ServeMux { + serveMux := &ServeMux{ + handlers: make(map[string][]handler), + forwardResponseOptions: make([]func(context.Context, http.ResponseWriter, proto.Message) error, 0), + marshalers: makeMarshalerMIMERegistry(), + streamErrorHandler: DefaultHTTPStreamErrorHandler, + } + + for _, opt := range opts { + opt(serveMux) + } + + if serveMux.incomingHeaderMatcher == nil { + serveMux.incomingHeaderMatcher = DefaultHeaderMatcher + } + + if serveMux.outgoingHeaderMatcher == nil { + serveMux.outgoingHeaderMatcher = func(key string) (string, bool) { + return fmt.Sprintf("%s%s", MetadataHeaderPrefix, key), true + } + } + + return serveMux +} + +// Handle associates "h" to the pair of HTTP method and path pattern. +func (s *ServeMux) Handle(meth string, pat Pattern, h HandlerFunc) { + if s.lastMatchWins { + s.handlers[meth] = append([]handler{handler{pat: pat, h: h}}, s.handlers[meth]...) + } else { + s.handlers[meth] = append(s.handlers[meth], handler{pat: pat, h: h}) + } +} + +// ServeHTTP dispatches the request to the first handler whose pattern matches to r.Method and r.Path. +func (s *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + path := r.URL.Path + if !strings.HasPrefix(path, "/") { + if s.protoErrorHandler != nil { + _, outboundMarshaler := MarshalerForRequest(s, r) + sterr := status.Error(codes.InvalidArgument, http.StatusText(http.StatusBadRequest)) + s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, sterr) + } else { + OtherErrorHandler(w, r, http.StatusText(http.StatusBadRequest), http.StatusBadRequest) + } + return + } + + components := strings.Split(path[1:], "/") + l := len(components) + var verb string + if idx := strings.LastIndex(components[l-1], ":"); idx == 0 { + if s.protoErrorHandler != nil { + _, outboundMarshaler := MarshalerForRequest(s, r) + s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, ErrUnknownURI) + } else { + OtherErrorHandler(w, r, http.StatusText(http.StatusNotFound), http.StatusNotFound) + } + return + } else if idx > 0 { + c := components[l-1] + components[l-1], verb = c[:idx], c[idx+1:] + } + + if override := r.Header.Get("X-HTTP-Method-Override"); override != "" && s.isPathLengthFallback(r) { + r.Method = strings.ToUpper(override) + if err := r.ParseForm(); err != nil { + if s.protoErrorHandler != nil { + _, outboundMarshaler := MarshalerForRequest(s, r) + sterr := status.Error(codes.InvalidArgument, err.Error()) + s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, sterr) + } else { + OtherErrorHandler(w, r, err.Error(), http.StatusBadRequest) + } + return + } + } + for _, h := range s.handlers[r.Method] { + pathParams, err := h.pat.Match(components, verb) + if err != nil { + continue + } + h.h(w, r, pathParams) + return + } + + // lookup other methods to handle fallback from GET to POST and + // to determine if it is MethodNotAllowed or NotFound. + for m, handlers := range s.handlers { + if m == r.Method { + continue + } + for _, h := range handlers { + pathParams, err := h.pat.Match(components, verb) + if err != nil { + continue + } + // X-HTTP-Method-Override is optional. Always allow fallback to POST. + if s.isPathLengthFallback(r) { + if err := r.ParseForm(); err != nil { + if s.protoErrorHandler != nil { + _, outboundMarshaler := MarshalerForRequest(s, r) + sterr := status.Error(codes.InvalidArgument, err.Error()) + s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, sterr) + } else { + OtherErrorHandler(w, r, err.Error(), http.StatusBadRequest) + } + return + } + h.h(w, r, pathParams) + return + } + if s.protoErrorHandler != nil { + _, outboundMarshaler := MarshalerForRequest(s, r) + s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, ErrUnknownURI) + } else { + OtherErrorHandler(w, r, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) + } + return + } + } + + if s.protoErrorHandler != nil { + _, outboundMarshaler := MarshalerForRequest(s, r) + s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, ErrUnknownURI) + } else { + OtherErrorHandler(w, r, http.StatusText(http.StatusNotFound), http.StatusNotFound) + } +} + +// GetForwardResponseOptions returns the ForwardResponseOptions associated with this ServeMux. +func (s *ServeMux) GetForwardResponseOptions() []func(context.Context, http.ResponseWriter, proto.Message) error { + return s.forwardResponseOptions +} + +func (s *ServeMux) isPathLengthFallback(r *http.Request) bool { + return !s.disablePathLengthFallback && r.Method == "POST" && r.Header.Get("Content-Type") == "application/x-www-form-urlencoded" +} + +type handler struct { + pat Pattern + h HandlerFunc +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go new file mode 100644 index 000000000000..09053695da7e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go @@ -0,0 +1,262 @@ +package runtime + +import ( + "errors" + "fmt" + "strings" + + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc/grpclog" +) + +var ( + // ErrNotMatch indicates that the given HTTP request path does not match to the pattern. + ErrNotMatch = errors.New("not match to the path pattern") + // ErrInvalidPattern indicates that the given definition of Pattern is not valid. + ErrInvalidPattern = errors.New("invalid pattern") +) + +type op struct { + code utilities.OpCode + operand int +} + +// Pattern is a template pattern of http request paths defined in github.com/googleapis/googleapis/google/api/http.proto. +type Pattern struct { + // ops is a list of operations + ops []op + // pool is a constant pool indexed by the operands or vars. + pool []string + // vars is a list of variables names to be bound by this pattern + vars []string + // stacksize is the max depth of the stack + stacksize int + // tailLen is the length of the fixed-size segments after a deep wildcard + tailLen int + // verb is the VERB part of the path pattern. It is empty if the pattern does not have VERB part. + verb string + // assumeColonVerb indicates whether a path suffix after a final + // colon may only be interpreted as a verb. + assumeColonVerb bool +} + +type patternOptions struct { + assumeColonVerb bool +} + +// PatternOpt is an option for creating Patterns. +type PatternOpt func(*patternOptions) + +// NewPattern returns a new Pattern from the given definition values. +// "ops" is a sequence of op codes. "pool" is a constant pool. +// "verb" is the verb part of the pattern. It is empty if the pattern does not have the part. +// "version" must be 1 for now. +// It returns an error if the given definition is invalid. +func NewPattern(version int, ops []int, pool []string, verb string, opts ...PatternOpt) (Pattern, error) { + options := patternOptions{ + assumeColonVerb: true, + } + for _, o := range opts { + o(&options) + } + + if version != 1 { + grpclog.Infof("unsupported version: %d", version) + return Pattern{}, ErrInvalidPattern + } + + l := len(ops) + if l%2 != 0 { + grpclog.Infof("odd number of ops codes: %d", l) + return Pattern{}, ErrInvalidPattern + } + + var ( + typedOps []op + stack, maxstack int + tailLen int + pushMSeen bool + vars []string + ) + for i := 0; i < l; i += 2 { + op := op{code: utilities.OpCode(ops[i]), operand: ops[i+1]} + switch op.code { + case utilities.OpNop: + continue + case utilities.OpPush: + if pushMSeen { + tailLen++ + } + stack++ + case utilities.OpPushM: + if pushMSeen { + grpclog.Infof("pushM appears twice") + return Pattern{}, ErrInvalidPattern + } + pushMSeen = true + stack++ + case utilities.OpLitPush: + if op.operand < 0 || len(pool) <= op.operand { + grpclog.Infof("negative literal index: %d", op.operand) + return Pattern{}, ErrInvalidPattern + } + if pushMSeen { + tailLen++ + } + stack++ + case utilities.OpConcatN: + if op.operand <= 0 { + grpclog.Infof("negative concat size: %d", op.operand) + return Pattern{}, ErrInvalidPattern + } + stack -= op.operand + if stack < 0 { + grpclog.Print("stack underflow") + return Pattern{}, ErrInvalidPattern + } + stack++ + case utilities.OpCapture: + if op.operand < 0 || len(pool) <= op.operand { + grpclog.Infof("variable name index out of bound: %d", op.operand) + return Pattern{}, ErrInvalidPattern + } + v := pool[op.operand] + op.operand = len(vars) + vars = append(vars, v) + stack-- + if stack < 0 { + grpclog.Infof("stack underflow") + return Pattern{}, ErrInvalidPattern + } + default: + grpclog.Infof("invalid opcode: %d", op.code) + return Pattern{}, ErrInvalidPattern + } + + if maxstack < stack { + maxstack = stack + } + typedOps = append(typedOps, op) + } + return Pattern{ + ops: typedOps, + pool: pool, + vars: vars, + stacksize: maxstack, + tailLen: tailLen, + verb: verb, + assumeColonVerb: options.assumeColonVerb, + }, nil +} + +// MustPattern is a helper function which makes it easier to call NewPattern in variable initialization. +func MustPattern(p Pattern, err error) Pattern { + if err != nil { + grpclog.Fatalf("Pattern initialization failed: %v", err) + } + return p +} + +// Match examines components if it matches to the Pattern. +// If it matches, the function returns a mapping from field paths to their captured values. +// If otherwise, the function returns an error. +func (p Pattern) Match(components []string, verb string) (map[string]string, error) { + if p.verb != verb { + if p.assumeColonVerb || p.verb != "" { + return nil, ErrNotMatch + } + if len(components) == 0 { + components = []string{":" + verb} + } else { + components = append([]string{}, components...) + components[len(components)-1] += ":" + verb + } + verb = "" + } + + var pos int + stack := make([]string, 0, p.stacksize) + captured := make([]string, len(p.vars)) + l := len(components) + for _, op := range p.ops { + switch op.code { + case utilities.OpNop: + continue + case utilities.OpPush, utilities.OpLitPush: + if pos >= l { + return nil, ErrNotMatch + } + c := components[pos] + if op.code == utilities.OpLitPush { + if lit := p.pool[op.operand]; c != lit { + return nil, ErrNotMatch + } + } + stack = append(stack, c) + pos++ + case utilities.OpPushM: + end := len(components) + if end < pos+p.tailLen { + return nil, ErrNotMatch + } + end -= p.tailLen + stack = append(stack, strings.Join(components[pos:end], "/")) + pos = end + case utilities.OpConcatN: + n := op.operand + l := len(stack) - n + stack = append(stack[:l], strings.Join(stack[l:], "/")) + case utilities.OpCapture: + n := len(stack) - 1 + captured[op.operand] = stack[n] + stack = stack[:n] + } + } + if pos < l { + return nil, ErrNotMatch + } + bindings := make(map[string]string) + for i, val := range captured { + bindings[p.vars[i]] = val + } + return bindings, nil +} + +// Verb returns the verb part of the Pattern. +func (p Pattern) Verb() string { return p.verb } + +func (p Pattern) String() string { + var stack []string + for _, op := range p.ops { + switch op.code { + case utilities.OpNop: + continue + case utilities.OpPush: + stack = append(stack, "*") + case utilities.OpLitPush: + stack = append(stack, p.pool[op.operand]) + case utilities.OpPushM: + stack = append(stack, "**") + case utilities.OpConcatN: + n := op.operand + l := len(stack) - n + stack = append(stack[:l], strings.Join(stack[l:], "/")) + case utilities.OpCapture: + n := len(stack) - 1 + stack[n] = fmt.Sprintf("{%s=%s}", p.vars[op.operand], stack[n]) + } + } + segs := strings.Join(stack, "/") + if p.verb != "" { + return fmt.Sprintf("/%s:%s", segs, p.verb) + } + return "/" + segs +} + +// AssumeColonVerbOpt indicates whether a path suffix after a final +// colon may only be interpreted as a verb. +func AssumeColonVerbOpt(val bool) PatternOpt { + return PatternOpt(func(o *patternOptions) { + o.assumeColonVerb = val + }) +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go new file mode 100644 index 000000000000..a3151e2a5528 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go @@ -0,0 +1,80 @@ +package runtime + +import ( + "github.com/golang/protobuf/proto" +) + +// StringP returns a pointer to a string whose pointee is same as the given string value. +func StringP(val string) (*string, error) { + return proto.String(val), nil +} + +// BoolP parses the given string representation of a boolean value, +// and returns a pointer to a bool whose value is same as the parsed value. +func BoolP(val string) (*bool, error) { + b, err := Bool(val) + if err != nil { + return nil, err + } + return proto.Bool(b), nil +} + +// Float64P parses the given string representation of a floating point number, +// and returns a pointer to a float64 whose value is same as the parsed number. +func Float64P(val string) (*float64, error) { + f, err := Float64(val) + if err != nil { + return nil, err + } + return proto.Float64(f), nil +} + +// Float32P parses the given string representation of a floating point number, +// and returns a pointer to a float32 whose value is same as the parsed number. +func Float32P(val string) (*float32, error) { + f, err := Float32(val) + if err != nil { + return nil, err + } + return proto.Float32(f), nil +} + +// Int64P parses the given string representation of an integer +// and returns a pointer to a int64 whose value is same as the parsed integer. +func Int64P(val string) (*int64, error) { + i, err := Int64(val) + if err != nil { + return nil, err + } + return proto.Int64(i), nil +} + +// Int32P parses the given string representation of an integer +// and returns a pointer to a int32 whose value is same as the parsed integer. +func Int32P(val string) (*int32, error) { + i, err := Int32(val) + if err != nil { + return nil, err + } + return proto.Int32(i), err +} + +// Uint64P parses the given string representation of an integer +// and returns a pointer to a uint64 whose value is same as the parsed integer. +func Uint64P(val string) (*uint64, error) { + i, err := Uint64(val) + if err != nil { + return nil, err + } + return proto.Uint64(i), err +} + +// Uint32P parses the given string representation of an integer +// and returns a pointer to a uint32 whose value is same as the parsed integer. +func Uint32P(val string) (*uint32, error) { + i, err := Uint32(val) + if err != nil { + return nil, err + } + return proto.Uint32(i), err +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go new file mode 100644 index 000000000000..3fd30da22a70 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go @@ -0,0 +1,106 @@ +package runtime + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/ptypes/any" + "github.com/grpc-ecosystem/grpc-gateway/internal" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// StreamErrorHandlerFunc accepts an error as a gRPC error generated via status package and translates it into a +// a proto struct used to represent error at the end of a stream. +type StreamErrorHandlerFunc func(context.Context, error) *StreamError + +// StreamError is the payload for the final message in a server stream in the event that the server returns an +// error after a response message has already been sent. +type StreamError internal.StreamError + +// ProtoErrorHandlerFunc handles the error as a gRPC error generated via status package and replies to the request. +type ProtoErrorHandlerFunc func(context.Context, *ServeMux, Marshaler, http.ResponseWriter, *http.Request, error) + +var _ ProtoErrorHandlerFunc = DefaultHTTPProtoErrorHandler + +// DefaultHTTPProtoErrorHandler is an implementation of HTTPError. +// If "err" is an error from gRPC system, the function replies with the status code mapped by HTTPStatusFromCode. +// If otherwise, it replies with http.StatusInternalServerError. +// +// The response body returned by this function is a Status message marshaled by a Marshaler. +// +// Do not set this function to HTTPError variable directly, use WithProtoErrorHandler option instead. +func DefaultHTTPProtoErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, _ *http.Request, err error) { + // return Internal when Marshal failed + const fallback = `{"code": 13, "message": "failed to marshal error message"}` + + s, ok := status.FromError(err) + if !ok { + s = status.New(codes.Unknown, err.Error()) + } + + w.Header().Del("Trailer") + + contentType := marshaler.ContentType() + // Check marshaler on run time in order to keep backwards compatibility + // An interface param needs to be added to the ContentType() function on + // the Marshal interface to be able to remove this check + if typeMarshaler, ok := marshaler.(contentTypeMarshaler); ok { + pb := s.Proto() + contentType = typeMarshaler.ContentTypeFromMessage(pb) + } + w.Header().Set("Content-Type", contentType) + + buf, merr := marshaler.Marshal(s.Proto()) + if merr != nil { + grpclog.Infof("Failed to marshal error message %q: %v", s.Proto(), merr) + w.WriteHeader(http.StatusInternalServerError) + if _, err := io.WriteString(w, fallback); err != nil { + grpclog.Infof("Failed to write response: %v", err) + } + return + } + + md, ok := ServerMetadataFromContext(ctx) + if !ok { + grpclog.Infof("Failed to extract ServerMetadata from context") + } + + handleForwardResponseServerMetadata(w, mux, md) + handleForwardResponseTrailerHeader(w, md) + st := HTTPStatusFromCode(s.Code()) + w.WriteHeader(st) + if _, err := w.Write(buf); err != nil { + grpclog.Infof("Failed to write response: %v", err) + } + + handleForwardResponseTrailer(w, md) +} + +// DefaultHTTPStreamErrorHandler converts the given err into a *StreamError via +// default logic. +// +// It extracts the gRPC status from err if possible. The fields of the status are +// used to populate the returned StreamError, and the HTTP status code is derived +// from the gRPC code via HTTPStatusFromCode. If the given err does not contain a +// gRPC status, an "Unknown" gRPC code is used and "Internal Server Error" HTTP code. +func DefaultHTTPStreamErrorHandler(_ context.Context, err error) *StreamError { + grpcCode := codes.Unknown + grpcMessage := err.Error() + var grpcDetails []*any.Any + if s, ok := status.FromError(err); ok { + grpcCode = s.Code() + grpcMessage = s.Message() + grpcDetails = s.Proto().GetDetails() + } + httpCode := HTTPStatusFromCode(grpcCode) + return &StreamError{ + GrpcCode: int32(grpcCode), + HttpCode: int32(httpCode), + Message: grpcMessage, + HttpStatus: http.StatusText(httpCode), + Details: grpcDetails, + } +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go new file mode 100644 index 000000000000..ba66842c3309 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go @@ -0,0 +1,406 @@ +package runtime + +import ( + "encoding/base64" + "fmt" + "net/url" + "reflect" + "regexp" + "strconv" + "strings" + "time" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc/grpclog" +) + +var valuesKeyRegexp = regexp.MustCompile("^(.*)\\[(.*)\\]$") + +var currentQueryParser QueryParameterParser = &defaultQueryParser{} + +// QueryParameterParser defines interface for all query parameter parsers +type QueryParameterParser interface { + Parse(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error +} + +// PopulateQueryParameters parses query parameters +// into "msg" using current query parser +func PopulateQueryParameters(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error { + return currentQueryParser.Parse(msg, values, filter) +} + +type defaultQueryParser struct{} + +// Parse populates "values" into "msg". +// A value is ignored if its key starts with one of the elements in "filter". +func (*defaultQueryParser) Parse(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error { + for key, values := range values { + match := valuesKeyRegexp.FindStringSubmatch(key) + if len(match) == 3 { + key = match[1] + values = append([]string{match[2]}, values...) + } + fieldPath := strings.Split(key, ".") + if filter.HasCommonPrefix(fieldPath) { + continue + } + if err := populateFieldValueFromPath(msg, fieldPath, values); err != nil { + return err + } + } + return nil +} + +// PopulateFieldFromPath sets a value in a nested Protobuf structure. +// It instantiates missing protobuf fields as it goes. +func PopulateFieldFromPath(msg proto.Message, fieldPathString string, value string) error { + fieldPath := strings.Split(fieldPathString, ".") + return populateFieldValueFromPath(msg, fieldPath, []string{value}) +} + +func populateFieldValueFromPath(msg proto.Message, fieldPath []string, values []string) error { + m := reflect.ValueOf(msg) + if m.Kind() != reflect.Ptr { + return fmt.Errorf("unexpected type %T: %v", msg, msg) + } + var props *proto.Properties + m = m.Elem() + for i, fieldName := range fieldPath { + isLast := i == len(fieldPath)-1 + if !isLast && m.Kind() != reflect.Struct { + return fmt.Errorf("non-aggregate type in the mid of path: %s", strings.Join(fieldPath, ".")) + } + var f reflect.Value + var err error + f, props, err = fieldByProtoName(m, fieldName) + if err != nil { + return err + } else if !f.IsValid() { + grpclog.Infof("field not found in %T: %s", msg, strings.Join(fieldPath, ".")) + return nil + } + + switch f.Kind() { + case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.String, reflect.Uint32, reflect.Uint64: + if !isLast { + return fmt.Errorf("unexpected nested field %s in %s", fieldPath[i+1], strings.Join(fieldPath[:i+1], ".")) + } + m = f + case reflect.Slice: + if !isLast { + return fmt.Errorf("unexpected repeated field in %s", strings.Join(fieldPath, ".")) + } + // Handle []byte + if f.Type().Elem().Kind() == reflect.Uint8 { + m = f + break + } + return populateRepeatedField(f, values, props) + case reflect.Ptr: + if f.IsNil() { + m = reflect.New(f.Type().Elem()) + f.Set(m.Convert(f.Type())) + } + m = f.Elem() + continue + case reflect.Struct: + m = f + continue + case reflect.Map: + if !isLast { + return fmt.Errorf("unexpected nested field %s in %s", fieldPath[i+1], strings.Join(fieldPath[:i+1], ".")) + } + return populateMapField(f, values, props) + default: + return fmt.Errorf("unexpected type %s in %T", f.Type(), msg) + } + } + switch len(values) { + case 0: + return fmt.Errorf("no value of field: %s", strings.Join(fieldPath, ".")) + case 1: + default: + grpclog.Infof("too many field values: %s", strings.Join(fieldPath, ".")) + } + return populateField(m, values[0], props) +} + +// fieldByProtoName looks up a field whose corresponding protobuf field name is "name". +// "m" must be a struct value. It returns zero reflect.Value if no such field found. +func fieldByProtoName(m reflect.Value, name string) (reflect.Value, *proto.Properties, error) { + props := proto.GetProperties(m.Type()) + + // look up field name in oneof map + for _, op := range props.OneofTypes { + if name == op.Prop.OrigName || name == op.Prop.JSONName { + v := reflect.New(op.Type.Elem()) + field := m.Field(op.Field) + if !field.IsNil() { + return reflect.Value{}, nil, fmt.Errorf("field already set for %s oneof", props.Prop[op.Field].OrigName) + } + field.Set(v) + return v.Elem().Field(0), op.Prop, nil + } + } + + for _, p := range props.Prop { + if p.OrigName == name { + return m.FieldByName(p.Name), p, nil + } + if p.JSONName == name { + return m.FieldByName(p.Name), p, nil + } + } + return reflect.Value{}, nil, nil +} + +func populateMapField(f reflect.Value, values []string, props *proto.Properties) error { + if len(values) != 2 { + return fmt.Errorf("more than one value provided for key %s in map %s", values[0], props.Name) + } + + key, value := values[0], values[1] + keyType := f.Type().Key() + valueType := f.Type().Elem() + if f.IsNil() { + f.Set(reflect.MakeMap(f.Type())) + } + + keyConv, ok := convFromType[keyType.Kind()] + if !ok { + return fmt.Errorf("unsupported key type %s in map %s", keyType, props.Name) + } + valueConv, ok := convFromType[valueType.Kind()] + if !ok { + return fmt.Errorf("unsupported value type %s in map %s", valueType, props.Name) + } + + keyV := keyConv.Call([]reflect.Value{reflect.ValueOf(key)}) + if err := keyV[1].Interface(); err != nil { + return err.(error) + } + valueV := valueConv.Call([]reflect.Value{reflect.ValueOf(value)}) + if err := valueV[1].Interface(); err != nil { + return err.(error) + } + + f.SetMapIndex(keyV[0].Convert(keyType), valueV[0].Convert(valueType)) + + return nil +} + +func populateRepeatedField(f reflect.Value, values []string, props *proto.Properties) error { + elemType := f.Type().Elem() + + // is the destination field a slice of an enumeration type? + if enumValMap := proto.EnumValueMap(props.Enum); enumValMap != nil { + return populateFieldEnumRepeated(f, values, enumValMap) + } + + conv, ok := convFromType[elemType.Kind()] + if !ok { + return fmt.Errorf("unsupported field type %s", elemType) + } + f.Set(reflect.MakeSlice(f.Type(), len(values), len(values)).Convert(f.Type())) + for i, v := range values { + result := conv.Call([]reflect.Value{reflect.ValueOf(v)}) + if err := result[1].Interface(); err != nil { + return err.(error) + } + f.Index(i).Set(result[0].Convert(f.Index(i).Type())) + } + return nil +} + +func populateField(f reflect.Value, value string, props *proto.Properties) error { + i := f.Addr().Interface() + + // Handle protobuf well known types + var name string + switch m := i.(type) { + case interface{ XXX_WellKnownType() string }: + name = m.XXX_WellKnownType() + case proto.Message: + const wktPrefix = "google.protobuf." + if fullName := proto.MessageName(m); strings.HasPrefix(fullName, wktPrefix) { + name = fullName[len(wktPrefix):] + } + } + switch name { + case "Timestamp": + if value == "null" { + f.FieldByName("Seconds").SetInt(0) + f.FieldByName("Nanos").SetInt(0) + return nil + } + + t, err := time.Parse(time.RFC3339Nano, value) + if err != nil { + return fmt.Errorf("bad Timestamp: %v", err) + } + f.FieldByName("Seconds").SetInt(int64(t.Unix())) + f.FieldByName("Nanos").SetInt(int64(t.Nanosecond())) + return nil + case "Duration": + if value == "null" { + f.FieldByName("Seconds").SetInt(0) + f.FieldByName("Nanos").SetInt(0) + return nil + } + d, err := time.ParseDuration(value) + if err != nil { + return fmt.Errorf("bad Duration: %v", err) + } + + ns := d.Nanoseconds() + s := ns / 1e9 + ns %= 1e9 + f.FieldByName("Seconds").SetInt(s) + f.FieldByName("Nanos").SetInt(ns) + return nil + case "DoubleValue": + fallthrough + case "FloatValue": + float64Val, err := strconv.ParseFloat(value, 64) + if err != nil { + return fmt.Errorf("bad DoubleValue: %s", value) + } + f.FieldByName("Value").SetFloat(float64Val) + return nil + case "Int64Value": + fallthrough + case "Int32Value": + int64Val, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return fmt.Errorf("bad DoubleValue: %s", value) + } + f.FieldByName("Value").SetInt(int64Val) + return nil + case "UInt64Value": + fallthrough + case "UInt32Value": + uint64Val, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return fmt.Errorf("bad DoubleValue: %s", value) + } + f.FieldByName("Value").SetUint(uint64Val) + return nil + case "BoolValue": + if value == "true" { + f.FieldByName("Value").SetBool(true) + } else if value == "false" { + f.FieldByName("Value").SetBool(false) + } else { + return fmt.Errorf("bad BoolValue: %s", value) + } + return nil + case "StringValue": + f.FieldByName("Value").SetString(value) + return nil + case "BytesValue": + bytesVal, err := base64.StdEncoding.DecodeString(value) + if err != nil { + return fmt.Errorf("bad BytesValue: %s", value) + } + f.FieldByName("Value").SetBytes(bytesVal) + return nil + case "FieldMask": + p := f.FieldByName("Paths") + for _, v := range strings.Split(value, ",") { + if v != "" { + p.Set(reflect.Append(p, reflect.ValueOf(v))) + } + } + return nil + } + + // Handle Time and Duration stdlib types + switch t := i.(type) { + case *time.Time: + pt, err := time.Parse(time.RFC3339Nano, value) + if err != nil { + return fmt.Errorf("bad Timestamp: %v", err) + } + *t = pt + return nil + case *time.Duration: + d, err := time.ParseDuration(value) + if err != nil { + return fmt.Errorf("bad Duration: %v", err) + } + *t = d + return nil + } + + // is the destination field an enumeration type? + if enumValMap := proto.EnumValueMap(props.Enum); enumValMap != nil { + return populateFieldEnum(f, value, enumValMap) + } + + conv, ok := convFromType[f.Kind()] + if !ok { + return fmt.Errorf("field type %T is not supported in query parameters", i) + } + result := conv.Call([]reflect.Value{reflect.ValueOf(value)}) + if err := result[1].Interface(); err != nil { + return err.(error) + } + f.Set(result[0].Convert(f.Type())) + return nil +} + +func convertEnum(value string, t reflect.Type, enumValMap map[string]int32) (reflect.Value, error) { + // see if it's an enumeration string + if enumVal, ok := enumValMap[value]; ok { + return reflect.ValueOf(enumVal).Convert(t), nil + } + + // check for an integer that matches an enumeration value + eVal, err := strconv.Atoi(value) + if err != nil { + return reflect.Value{}, fmt.Errorf("%s is not a valid %s", value, t) + } + for _, v := range enumValMap { + if v == int32(eVal) { + return reflect.ValueOf(eVal).Convert(t), nil + } + } + return reflect.Value{}, fmt.Errorf("%s is not a valid %s", value, t) +} + +func populateFieldEnum(f reflect.Value, value string, enumValMap map[string]int32) error { + cval, err := convertEnum(value, f.Type(), enumValMap) + if err != nil { + return err + } + f.Set(cval) + return nil +} + +func populateFieldEnumRepeated(f reflect.Value, values []string, enumValMap map[string]int32) error { + elemType := f.Type().Elem() + f.Set(reflect.MakeSlice(f.Type(), len(values), len(values)).Convert(f.Type())) + for i, v := range values { + result, err := convertEnum(v, elemType, enumValMap) + if err != nil { + return err + } + f.Index(i).Set(result) + } + return nil +} + +var ( + convFromType = map[reflect.Kind]reflect.Value{ + reflect.String: reflect.ValueOf(String), + reflect.Bool: reflect.ValueOf(Bool), + reflect.Float64: reflect.ValueOf(Float64), + reflect.Float32: reflect.ValueOf(Float32), + reflect.Int64: reflect.ValueOf(Int64), + reflect.Int32: reflect.ValueOf(Int32), + reflect.Uint64: reflect.ValueOf(Uint64), + reflect.Uint32: reflect.ValueOf(Uint32), + reflect.Slice: reflect.ValueOf(Bytes), + } +) diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/BUILD.bazel b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/BUILD.bazel new file mode 100644 index 000000000000..7109d7932318 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +package(default_visibility = ["//visibility:public"]) + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "pattern.go", + "readerfactory.go", + "trie.go", + ], + importpath = "github.com/grpc-ecosystem/grpc-gateway/utilities", +) + +go_test( + name = "go_default_test", + size = "small", + srcs = ["trie_test.go"], + embed = [":go_default_library"], +) diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go new file mode 100644 index 000000000000..cf79a4d58860 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go @@ -0,0 +1,2 @@ +// Package utilities provides members for internal use in grpc-gateway. +package utilities diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go new file mode 100644 index 000000000000..dfe7de4864ab --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go @@ -0,0 +1,22 @@ +package utilities + +// An OpCode is a opcode of compiled path patterns. +type OpCode int + +// These constants are the valid values of OpCode. +const ( + // OpNop does nothing + OpNop = OpCode(iota) + // OpPush pushes a component to stack + OpPush + // OpLitPush pushes a component to stack if it matches to the literal + OpLitPush + // OpPushM concatenates the remaining components and pushes it to stack + OpPushM + // OpConcatN pops N items from stack, concatenates them and pushes it back to stack + OpConcatN + // OpCapture pops an item and binds it to the variable + OpCapture + // OpEnd is the least positive invalid opcode. + OpEnd +) diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go new file mode 100644 index 000000000000..6dd3854665f1 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go @@ -0,0 +1,20 @@ +package utilities + +import ( + "bytes" + "io" + "io/ioutil" +) + +// IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins +// at the start of the stream +func IOReaderFactory(r io.Reader) (func() io.Reader, error) { + b, err := ioutil.ReadAll(r) + if err != nil { + return nil, err + } + + return func() io.Reader { + return bytes.NewReader(b) + }, nil +} diff --git a/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go new file mode 100644 index 000000000000..c2b7b30dd917 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go @@ -0,0 +1,177 @@ +package utilities + +import ( + "sort" +) + +// DoubleArray is a Double Array implementation of trie on sequences of strings. +type DoubleArray struct { + // Encoding keeps an encoding from string to int + Encoding map[string]int + // Base is the base array of Double Array + Base []int + // Check is the check array of Double Array + Check []int +} + +// NewDoubleArray builds a DoubleArray from a set of sequences of strings. +func NewDoubleArray(seqs [][]string) *DoubleArray { + da := &DoubleArray{Encoding: make(map[string]int)} + if len(seqs) == 0 { + return da + } + + encoded := registerTokens(da, seqs) + sort.Sort(byLex(encoded)) + + root := node{row: -1, col: -1, left: 0, right: len(encoded)} + addSeqs(da, encoded, 0, root) + + for i := len(da.Base); i > 0; i-- { + if da.Check[i-1] != 0 { + da.Base = da.Base[:i] + da.Check = da.Check[:i] + break + } + } + return da +} + +func registerTokens(da *DoubleArray, seqs [][]string) [][]int { + var result [][]int + for _, seq := range seqs { + var encoded []int + for _, token := range seq { + if _, ok := da.Encoding[token]; !ok { + da.Encoding[token] = len(da.Encoding) + } + encoded = append(encoded, da.Encoding[token]) + } + result = append(result, encoded) + } + for i := range result { + result[i] = append(result[i], len(da.Encoding)) + } + return result +} + +type node struct { + row, col int + left, right int +} + +func (n node) value(seqs [][]int) int { + return seqs[n.row][n.col] +} + +func (n node) children(seqs [][]int) []*node { + var result []*node + lastVal := int(-1) + last := new(node) + for i := n.left; i < n.right; i++ { + if lastVal == seqs[i][n.col+1] { + continue + } + last.right = i + last = &node{ + row: i, + col: n.col + 1, + left: i, + } + result = append(result, last) + } + last.right = n.right + return result +} + +func addSeqs(da *DoubleArray, seqs [][]int, pos int, n node) { + ensureSize(da, pos) + + children := n.children(seqs) + var i int + for i = 1; ; i++ { + ok := func() bool { + for _, child := range children { + code := child.value(seqs) + j := i + code + ensureSize(da, j) + if da.Check[j] != 0 { + return false + } + } + return true + }() + if ok { + break + } + } + da.Base[pos] = i + for _, child := range children { + code := child.value(seqs) + j := i + code + da.Check[j] = pos + 1 + } + terminator := len(da.Encoding) + for _, child := range children { + code := child.value(seqs) + if code == terminator { + continue + } + j := i + code + addSeqs(da, seqs, j, *child) + } +} + +func ensureSize(da *DoubleArray, i int) { + for i >= len(da.Base) { + da.Base = append(da.Base, make([]int, len(da.Base)+1)...) + da.Check = append(da.Check, make([]int, len(da.Check)+1)...) + } +} + +type byLex [][]int + +func (l byLex) Len() int { return len(l) } +func (l byLex) Swap(i, j int) { l[i], l[j] = l[j], l[i] } +func (l byLex) Less(i, j int) bool { + si := l[i] + sj := l[j] + var k int + for k = 0; k < len(si) && k < len(sj); k++ { + if si[k] < sj[k] { + return true + } + if si[k] > sj[k] { + return false + } + } + if k < len(sj) { + return true + } + return false +} + +// HasCommonPrefix determines if any sequence in the DoubleArray is a prefix of the given sequence. +func (da *DoubleArray) HasCommonPrefix(seq []string) bool { + if len(da.Base) == 0 { + return false + } + + var i int + for _, t := range seq { + code, ok := da.Encoding[t] + if !ok { + break + } + j := da.Base[i] + code + if len(da.Check) <= j || da.Check[j] != i+1 { + break + } + i = j + } + j := da.Base[i] + len(da.Encoding) + if len(da.Check) <= j || da.Check[j] != i+1 { + return false + } + return true +} diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/.gitignore b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/.gitignore deleted file mode 100644 index 836562412fe8..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/2q.go b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/2q.go deleted file mode 100644 index e474cd07581a..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/2q.go +++ /dev/null @@ -1,223 +0,0 @@ -package lru - -import ( - "fmt" - "sync" - - "github.com/hashicorp/golang-lru/simplelru" -) - -const ( - // Default2QRecentRatio is the ratio of the 2Q cache dedicated - // to recently added entries that have only been accessed once. - Default2QRecentRatio = 0.25 - - // Default2QGhostEntries is the default ratio of ghost - // entries kept to track entries recently evicted - Default2QGhostEntries = 0.50 -) - -// TwoQueueCache is a thread-safe fixed size 2Q cache. -// 2Q is an enhancement over the standard LRU cache -// in that it tracks both frequently and recently used -// entries separately. This avoids a burst in access to new -// entries from evicting frequently used entries. It adds some -// additional tracking overhead to the standard LRU cache, and is -// computationally about 2x the cost, and adds some metadata over -// head. The ARCCache is similar, but does not require setting any -// parameters. -type TwoQueueCache struct { - size int - recentSize int - - recent simplelru.LRUCache - frequent simplelru.LRUCache - recentEvict simplelru.LRUCache - lock sync.RWMutex -} - -// New2Q creates a new TwoQueueCache using the default -// values for the parameters. -func New2Q(size int) (*TwoQueueCache, error) { - return New2QParams(size, Default2QRecentRatio, Default2QGhostEntries) -} - -// New2QParams creates a new TwoQueueCache using the provided -// parameter values. -func New2QParams(size int, recentRatio float64, ghostRatio float64) (*TwoQueueCache, error) { - if size <= 0 { - return nil, fmt.Errorf("invalid size") - } - if recentRatio < 0.0 || recentRatio > 1.0 { - return nil, fmt.Errorf("invalid recent ratio") - } - if ghostRatio < 0.0 || ghostRatio > 1.0 { - return nil, fmt.Errorf("invalid ghost ratio") - } - - // Determine the sub-sizes - recentSize := int(float64(size) * recentRatio) - evictSize := int(float64(size) * ghostRatio) - - // Allocate the LRUs - recent, err := simplelru.NewLRU(size, nil) - if err != nil { - return nil, err - } - frequent, err := simplelru.NewLRU(size, nil) - if err != nil { - return nil, err - } - recentEvict, err := simplelru.NewLRU(evictSize, nil) - if err != nil { - return nil, err - } - - // Initialize the cache - c := &TwoQueueCache{ - size: size, - recentSize: recentSize, - recent: recent, - frequent: frequent, - recentEvict: recentEvict, - } - return c, nil -} - -// Get looks up a key's value from the cache. -func (c *TwoQueueCache) Get(key interface{}) (value interface{}, ok bool) { - c.lock.Lock() - defer c.lock.Unlock() - - // Check if this is a frequent value - if val, ok := c.frequent.Get(key); ok { - return val, ok - } - - // If the value is contained in recent, then we - // promote it to frequent - if val, ok := c.recent.Peek(key); ok { - c.recent.Remove(key) - c.frequent.Add(key, val) - return val, ok - } - - // No hit - return nil, false -} - -// Add adds a value to the cache. -func (c *TwoQueueCache) Add(key, value interface{}) { - c.lock.Lock() - defer c.lock.Unlock() - - // Check if the value is frequently used already, - // and just update the value - if c.frequent.Contains(key) { - c.frequent.Add(key, value) - return - } - - // Check if the value is recently used, and promote - // the value into the frequent list - if c.recent.Contains(key) { - c.recent.Remove(key) - c.frequent.Add(key, value) - return - } - - // If the value was recently evicted, add it to the - // frequently used list - if c.recentEvict.Contains(key) { - c.ensureSpace(true) - c.recentEvict.Remove(key) - c.frequent.Add(key, value) - return - } - - // Add to the recently seen list - c.ensureSpace(false) - c.recent.Add(key, value) - return -} - -// ensureSpace is used to ensure we have space in the cache -func (c *TwoQueueCache) ensureSpace(recentEvict bool) { - // If we have space, nothing to do - recentLen := c.recent.Len() - freqLen := c.frequent.Len() - if recentLen+freqLen < c.size { - return - } - - // If the recent buffer is larger than - // the target, evict from there - if recentLen > 0 && (recentLen > c.recentSize || (recentLen == c.recentSize && !recentEvict)) { - k, _, _ := c.recent.RemoveOldest() - c.recentEvict.Add(k, nil) - return - } - - // Remove from the frequent list otherwise - c.frequent.RemoveOldest() -} - -// Len returns the number of items in the cache. -func (c *TwoQueueCache) Len() int { - c.lock.RLock() - defer c.lock.RUnlock() - return c.recent.Len() + c.frequent.Len() -} - -// Keys returns a slice of the keys in the cache. -// The frequently used keys are first in the returned slice. -func (c *TwoQueueCache) Keys() []interface{} { - c.lock.RLock() - defer c.lock.RUnlock() - k1 := c.frequent.Keys() - k2 := c.recent.Keys() - return append(k1, k2...) -} - -// Remove removes the provided key from the cache. -func (c *TwoQueueCache) Remove(key interface{}) { - c.lock.Lock() - defer c.lock.Unlock() - if c.frequent.Remove(key) { - return - } - if c.recent.Remove(key) { - return - } - if c.recentEvict.Remove(key) { - return - } -} - -// Purge is used to completely clear the cache. -func (c *TwoQueueCache) Purge() { - c.lock.Lock() - defer c.lock.Unlock() - c.recent.Purge() - c.frequent.Purge() - c.recentEvict.Purge() -} - -// Contains is used to check if the cache contains a key -// without updating recency or frequency. -func (c *TwoQueueCache) Contains(key interface{}) bool { - c.lock.RLock() - defer c.lock.RUnlock() - return c.frequent.Contains(key) || c.recent.Contains(key) -} - -// Peek is used to inspect the cache value of a key -// without updating recency or frequency. -func (c *TwoQueueCache) Peek(key interface{}) (value interface{}, ok bool) { - c.lock.RLock() - defer c.lock.RUnlock() - if val, ok := c.frequent.Peek(key); ok { - return val, ok - } - return c.recent.Peek(key) -} diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/LICENSE b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/LICENSE deleted file mode 100644 index be2cc4dfb609..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/LICENSE +++ /dev/null @@ -1,362 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/README.md b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/README.md deleted file mode 100644 index 33e58cfaf97e..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/README.md +++ /dev/null @@ -1,25 +0,0 @@ -golang-lru -========== - -This provides the `lru` package which implements a fixed-size -thread safe LRU cache. It is based on the cache in Groupcache. - -Documentation -============= - -Full docs are available on [Godoc](http://godoc.org/github.com/hashicorp/golang-lru) - -Example -======= - -Using the LRU is very simple: - -```go -l, _ := New(128) -for i := 0; i < 256; i++ { - l.Add(i, nil) -} -if l.Len() != 128 { - panic(fmt.Sprintf("bad len: %v", l.Len())) -} -``` diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/arc.go b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/arc.go deleted file mode 100644 index 555225a218c9..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/arc.go +++ /dev/null @@ -1,257 +0,0 @@ -package lru - -import ( - "sync" - - "github.com/hashicorp/golang-lru/simplelru" -) - -// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC). -// ARC is an enhancement over the standard LRU cache in that tracks both -// frequency and recency of use. This avoids a burst in access to new -// entries from evicting the frequently used older entries. It adds some -// additional tracking overhead to a standard LRU cache, computationally -// it is roughly 2x the cost, and the extra memory overhead is linear -// with the size of the cache. ARC has been patented by IBM, but is -// similar to the TwoQueueCache (2Q) which requires setting parameters. -type ARCCache struct { - size int // Size is the total capacity of the cache - p int // P is the dynamic preference towards T1 or T2 - - t1 simplelru.LRUCache // T1 is the LRU for recently accessed items - b1 simplelru.LRUCache // B1 is the LRU for evictions from t1 - - t2 simplelru.LRUCache // T2 is the LRU for frequently accessed items - b2 simplelru.LRUCache // B2 is the LRU for evictions from t2 - - lock sync.RWMutex -} - -// NewARC creates an ARC of the given size -func NewARC(size int) (*ARCCache, error) { - // Create the sub LRUs - b1, err := simplelru.NewLRU(size, nil) - if err != nil { - return nil, err - } - b2, err := simplelru.NewLRU(size, nil) - if err != nil { - return nil, err - } - t1, err := simplelru.NewLRU(size, nil) - if err != nil { - return nil, err - } - t2, err := simplelru.NewLRU(size, nil) - if err != nil { - return nil, err - } - - // Initialize the ARC - c := &ARCCache{ - size: size, - p: 0, - t1: t1, - b1: b1, - t2: t2, - b2: b2, - } - return c, nil -} - -// Get looks up a key's value from the cache. -func (c *ARCCache) Get(key interface{}) (value interface{}, ok bool) { - c.lock.Lock() - defer c.lock.Unlock() - - // If the value is contained in T1 (recent), then - // promote it to T2 (frequent) - if val, ok := c.t1.Peek(key); ok { - c.t1.Remove(key) - c.t2.Add(key, val) - return val, ok - } - - // Check if the value is contained in T2 (frequent) - if val, ok := c.t2.Get(key); ok { - return val, ok - } - - // No hit - return nil, false -} - -// Add adds a value to the cache. -func (c *ARCCache) Add(key, value interface{}) { - c.lock.Lock() - defer c.lock.Unlock() - - // Check if the value is contained in T1 (recent), and potentially - // promote it to frequent T2 - if c.t1.Contains(key) { - c.t1.Remove(key) - c.t2.Add(key, value) - return - } - - // Check if the value is already in T2 (frequent) and update it - if c.t2.Contains(key) { - c.t2.Add(key, value) - return - } - - // Check if this value was recently evicted as part of the - // recently used list - if c.b1.Contains(key) { - // T1 set is too small, increase P appropriately - delta := 1 - b1Len := c.b1.Len() - b2Len := c.b2.Len() - if b2Len > b1Len { - delta = b2Len / b1Len - } - if c.p+delta >= c.size { - c.p = c.size - } else { - c.p += delta - } - - // Potentially need to make room in the cache - if c.t1.Len()+c.t2.Len() >= c.size { - c.replace(false) - } - - // Remove from B1 - c.b1.Remove(key) - - // Add the key to the frequently used list - c.t2.Add(key, value) - return - } - - // Check if this value was recently evicted as part of the - // frequently used list - if c.b2.Contains(key) { - // T2 set is too small, decrease P appropriately - delta := 1 - b1Len := c.b1.Len() - b2Len := c.b2.Len() - if b1Len > b2Len { - delta = b1Len / b2Len - } - if delta >= c.p { - c.p = 0 - } else { - c.p -= delta - } - - // Potentially need to make room in the cache - if c.t1.Len()+c.t2.Len() >= c.size { - c.replace(true) - } - - // Remove from B2 - c.b2.Remove(key) - - // Add the key to the frequently used list - c.t2.Add(key, value) - return - } - - // Potentially need to make room in the cache - if c.t1.Len()+c.t2.Len() >= c.size { - c.replace(false) - } - - // Keep the size of the ghost buffers trim - if c.b1.Len() > c.size-c.p { - c.b1.RemoveOldest() - } - if c.b2.Len() > c.p { - c.b2.RemoveOldest() - } - - // Add to the recently seen list - c.t1.Add(key, value) - return -} - -// replace is used to adaptively evict from either T1 or T2 -// based on the current learned value of P -func (c *ARCCache) replace(b2ContainsKey bool) { - t1Len := c.t1.Len() - if t1Len > 0 && (t1Len > c.p || (t1Len == c.p && b2ContainsKey)) { - k, _, ok := c.t1.RemoveOldest() - if ok { - c.b1.Add(k, nil) - } - } else { - k, _, ok := c.t2.RemoveOldest() - if ok { - c.b2.Add(k, nil) - } - } -} - -// Len returns the number of cached entries -func (c *ARCCache) Len() int { - c.lock.RLock() - defer c.lock.RUnlock() - return c.t1.Len() + c.t2.Len() -} - -// Keys returns all the cached keys -func (c *ARCCache) Keys() []interface{} { - c.lock.RLock() - defer c.lock.RUnlock() - k1 := c.t1.Keys() - k2 := c.t2.Keys() - return append(k1, k2...) -} - -// Remove is used to purge a key from the cache -func (c *ARCCache) Remove(key interface{}) { - c.lock.Lock() - defer c.lock.Unlock() - if c.t1.Remove(key) { - return - } - if c.t2.Remove(key) { - return - } - if c.b1.Remove(key) { - return - } - if c.b2.Remove(key) { - return - } -} - -// Purge is used to clear the cache -func (c *ARCCache) Purge() { - c.lock.Lock() - defer c.lock.Unlock() - c.t1.Purge() - c.t2.Purge() - c.b1.Purge() - c.b2.Purge() -} - -// Contains is used to check if the cache contains a key -// without updating recency or frequency. -func (c *ARCCache) Contains(key interface{}) bool { - c.lock.RLock() - defer c.lock.RUnlock() - return c.t1.Contains(key) || c.t2.Contains(key) -} - -// Peek is used to inspect the cache value of a key -// without updating recency or frequency. -func (c *ARCCache) Peek(key interface{}) (value interface{}, ok bool) { - c.lock.RLock() - defer c.lock.RUnlock() - if val, ok := c.t1.Peek(key); ok { - return val, ok - } - return c.t2.Peek(key) -} diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/doc.go b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/doc.go deleted file mode 100644 index 2547df979d0b..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -// Package lru provides three different LRU caches of varying sophistication. -// -// Cache is a simple LRU cache. It is based on the -// LRU implementation in groupcache: -// https://github.com/golang/groupcache/tree/master/lru -// -// TwoQueueCache tracks frequently used and recently used entries separately. -// This avoids a burst of accesses from taking out frequently used entries, -// at the cost of about 2x computational overhead and some extra bookkeeping. -// -// ARCCache is an adaptive replacement cache. It tracks recent evictions as -// well as recent usage in both the frequent and recent caches. Its -// computational overhead is comparable to TwoQueueCache, but the memory -// overhead is linear with the size of the cache. -// -// ARC has been patented by IBM, so do not use it if that is problematic for -// your program. -// -// All caches in this package take locks while operating, and are therefore -// thread-safe for consumers. -package lru diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/go.mod b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/go.mod deleted file mode 100644 index 824cb97e8346..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/go.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/hashicorp/golang-lru diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/lru.go b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/lru.go deleted file mode 100644 index 1cbe04b7d0fc..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/lru.go +++ /dev/null @@ -1,116 +0,0 @@ -package lru - -import ( - "sync" - - "github.com/hashicorp/golang-lru/simplelru" -) - -// Cache is a thread-safe fixed size LRU cache. -type Cache struct { - lru simplelru.LRUCache - lock sync.RWMutex -} - -// New creates an LRU of the given size. -func New(size int) (*Cache, error) { - return NewWithEvict(size, nil) -} - -// NewWithEvict constructs a fixed size cache with the given eviction -// callback. -func NewWithEvict(size int, onEvicted func(key interface{}, value interface{})) (*Cache, error) { - lru, err := simplelru.NewLRU(size, simplelru.EvictCallback(onEvicted)) - if err != nil { - return nil, err - } - c := &Cache{ - lru: lru, - } - return c, nil -} - -// Purge is used to completely clear the cache. -func (c *Cache) Purge() { - c.lock.Lock() - c.lru.Purge() - c.lock.Unlock() -} - -// Add adds a value to the cache. Returns true if an eviction occurred. -func (c *Cache) Add(key, value interface{}) (evicted bool) { - c.lock.Lock() - evicted = c.lru.Add(key, value) - c.lock.Unlock() - return evicted -} - -// Get looks up a key's value from the cache. -func (c *Cache) Get(key interface{}) (value interface{}, ok bool) { - c.lock.Lock() - value, ok = c.lru.Get(key) - c.lock.Unlock() - return value, ok -} - -// Contains checks if a key is in the cache, without updating the -// recent-ness or deleting it for being stale. -func (c *Cache) Contains(key interface{}) bool { - c.lock.RLock() - containKey := c.lru.Contains(key) - c.lock.RUnlock() - return containKey -} - -// Peek returns the key value (or undefined if not found) without updating -// the "recently used"-ness of the key. -func (c *Cache) Peek(key interface{}) (value interface{}, ok bool) { - c.lock.RLock() - value, ok = c.lru.Peek(key) - c.lock.RUnlock() - return value, ok -} - -// ContainsOrAdd checks if a key is in the cache without updating the -// recent-ness or deleting it for being stale, and if not, adds the value. -// Returns whether found and whether an eviction occurred. -func (c *Cache) ContainsOrAdd(key, value interface{}) (ok, evicted bool) { - c.lock.Lock() - defer c.lock.Unlock() - - if c.lru.Contains(key) { - return true, false - } - evicted = c.lru.Add(key, value) - return false, evicted -} - -// Remove removes the provided key from the cache. -func (c *Cache) Remove(key interface{}) { - c.lock.Lock() - c.lru.Remove(key) - c.lock.Unlock() -} - -// RemoveOldest removes the oldest item from the cache. -func (c *Cache) RemoveOldest() { - c.lock.Lock() - c.lru.RemoveOldest() - c.lock.Unlock() -} - -// Keys returns a slice of the keys in the cache, from oldest to newest. -func (c *Cache) Keys() []interface{} { - c.lock.RLock() - keys := c.lru.Keys() - c.lock.RUnlock() - return keys -} - -// Len returns the number of items in the cache. -func (c *Cache) Len() int { - c.lock.RLock() - length := c.lru.Len() - c.lock.RUnlock() - return length -} diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go deleted file mode 100644 index 5673773b22be..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go +++ /dev/null @@ -1,161 +0,0 @@ -package simplelru - -import ( - "container/list" - "errors" -) - -// EvictCallback is used to get a callback when a cache entry is evicted -type EvictCallback func(key interface{}, value interface{}) - -// LRU implements a non-thread safe fixed size LRU cache -type LRU struct { - size int - evictList *list.List - items map[interface{}]*list.Element - onEvict EvictCallback -} - -// entry is used to hold a value in the evictList -type entry struct { - key interface{} - value interface{} -} - -// NewLRU constructs an LRU of the given size -func NewLRU(size int, onEvict EvictCallback) (*LRU, error) { - if size <= 0 { - return nil, errors.New("Must provide a positive size") - } - c := &LRU{ - size: size, - evictList: list.New(), - items: make(map[interface{}]*list.Element), - onEvict: onEvict, - } - return c, nil -} - -// Purge is used to completely clear the cache. -func (c *LRU) Purge() { - for k, v := range c.items { - if c.onEvict != nil { - c.onEvict(k, v.Value.(*entry).value) - } - delete(c.items, k) - } - c.evictList.Init() -} - -// Add adds a value to the cache. Returns true if an eviction occurred. -func (c *LRU) Add(key, value interface{}) (evicted bool) { - // Check for existing item - if ent, ok := c.items[key]; ok { - c.evictList.MoveToFront(ent) - ent.Value.(*entry).value = value - return false - } - - // Add new item - ent := &entry{key, value} - entry := c.evictList.PushFront(ent) - c.items[key] = entry - - evict := c.evictList.Len() > c.size - // Verify size not exceeded - if evict { - c.removeOldest() - } - return evict -} - -// Get looks up a key's value from the cache. -func (c *LRU) Get(key interface{}) (value interface{}, ok bool) { - if ent, ok := c.items[key]; ok { - c.evictList.MoveToFront(ent) - return ent.Value.(*entry).value, true - } - return -} - -// Contains checks if a key is in the cache, without updating the recent-ness -// or deleting it for being stale. -func (c *LRU) Contains(key interface{}) (ok bool) { - _, ok = c.items[key] - return ok -} - -// Peek returns the key value (or undefined if not found) without updating -// the "recently used"-ness of the key. -func (c *LRU) Peek(key interface{}) (value interface{}, ok bool) { - var ent *list.Element - if ent, ok = c.items[key]; ok { - return ent.Value.(*entry).value, true - } - return nil, ok -} - -// Remove removes the provided key from the cache, returning if the -// key was contained. -func (c *LRU) Remove(key interface{}) (present bool) { - if ent, ok := c.items[key]; ok { - c.removeElement(ent) - return true - } - return false -} - -// RemoveOldest removes the oldest item from the cache. -func (c *LRU) RemoveOldest() (key interface{}, value interface{}, ok bool) { - ent := c.evictList.Back() - if ent != nil { - c.removeElement(ent) - kv := ent.Value.(*entry) - return kv.key, kv.value, true - } - return nil, nil, false -} - -// GetOldest returns the oldest entry -func (c *LRU) GetOldest() (key interface{}, value interface{}, ok bool) { - ent := c.evictList.Back() - if ent != nil { - kv := ent.Value.(*entry) - return kv.key, kv.value, true - } - return nil, nil, false -} - -// Keys returns a slice of the keys in the cache, from oldest to newest. -func (c *LRU) Keys() []interface{} { - keys := make([]interface{}, len(c.items)) - i := 0 - for ent := c.evictList.Back(); ent != nil; ent = ent.Prev() { - keys[i] = ent.Value.(*entry).key - i++ - } - return keys -} - -// Len returns the number of items in the cache. -func (c *LRU) Len() int { - return c.evictList.Len() -} - -// removeOldest removes the oldest item from the cache. -func (c *LRU) removeOldest() { - ent := c.evictList.Back() - if ent != nil { - c.removeElement(ent) - } -} - -// removeElement is used to remove a given list element from the cache -func (c *LRU) removeElement(e *list.Element) { - c.evictList.Remove(e) - kv := e.Value.(*entry) - delete(c.items, kv.key) - if c.onEvict != nil { - c.onEvict(kv.key, kv.value) - } -} diff --git a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go b/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go deleted file mode 100644 index 74c7077440c9..000000000000 --- a/cluster-autoscaler/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go +++ /dev/null @@ -1,36 +0,0 @@ -package simplelru - -// LRUCache is the interface for simple LRU cache. -type LRUCache interface { - // Adds a value to the cache, returns true if an eviction occurred and - // updates the "recently used"-ness of the key. - Add(key, value interface{}) bool - - // Returns key's value from the cache and - // updates the "recently used"-ness of the key. #value, isFound - Get(key interface{}) (value interface{}, ok bool) - - // Check if a key exsists in cache without updating the recent-ness. - Contains(key interface{}) (ok bool) - - // Returns key's value without updating the "recently used"-ness of the key. - Peek(key interface{}) (value interface{}, ok bool) - - // Removes a key from the cache. - Remove(key interface{}) bool - - // Removes the oldest entry from cache. - RemoveOldest() (interface{}, interface{}, bool) - - // Returns the oldest entry from the cache. #key, value, isFound - GetOldest() (interface{}, interface{}, bool) - - // Returns a slice of the keys in the cache, from oldest to newest. - Keys() []interface{} - - // Returns the number of items in the cache. - Len() int - - // Clear all cache entries - Purge() -} diff --git a/cluster-autoscaler/vendor/github.com/heketi/heketi/client/api/go-client/client.go b/cluster-autoscaler/vendor/github.com/heketi/heketi/client/api/go-client/client.go index e8a629138927..927548575ccb 100644 --- a/cluster-autoscaler/vendor/github.com/heketi/heketi/client/api/go-client/client.go +++ b/cluster-autoscaler/vendor/github.com/heketi/heketi/client/api/go-client/client.go @@ -25,7 +25,7 @@ import ( "strconv" "time" - jwt "github.com/dgrijalva/jwt-go" + jwt "github.com/form3tech-oss/jwt-go" "github.com/heketi/heketi/pkg/utils" ) diff --git a/cluster-autoscaler/vendor/github.com/josharian/intern/README.md b/cluster-autoscaler/vendor/github.com/josharian/intern/README.md new file mode 100644 index 000000000000..ffc44b219b2f --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/josharian/intern/README.md @@ -0,0 +1,5 @@ +Docs: https://godoc.org/github.com/josharian/intern + +See also [Go issue 5160](https://golang.org/issue/5160). + +License: MIT diff --git a/cluster-autoscaler/vendor/github.com/josharian/intern/go.mod b/cluster-autoscaler/vendor/github.com/josharian/intern/go.mod new file mode 100644 index 000000000000..f2262ff0d54a --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/josharian/intern/go.mod @@ -0,0 +1,3 @@ +module github.com/josharian/intern + +go 1.5 diff --git a/cluster-autoscaler/vendor/github.com/josharian/intern/intern.go b/cluster-autoscaler/vendor/github.com/josharian/intern/intern.go new file mode 100644 index 000000000000..7acb1fe90a11 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/josharian/intern/intern.go @@ -0,0 +1,44 @@ +// Package intern interns strings. +// Interning is best effort only. +// Interned strings may be removed automatically +// at any time without notification. +// All functions may be called concurrently +// with themselves and each other. +package intern + +import "sync" + +var ( + pool sync.Pool = sync.Pool{ + New: func() interface{} { + return make(map[string]string) + }, + } +) + +// String returns s, interned. +func String(s string) string { + m := pool.Get().(map[string]string) + c, ok := m[s] + if ok { + pool.Put(m) + return c + } + m[s] = s + pool.Put(m) + return s +} + +// Bytes returns b converted to a string, interned. +func Bytes(b []byte) string { + m := pool.Get().(map[string]string) + c, ok := m[string(b)] + if ok { + pool.Put(m) + return c + } + s := string(b) + m[s] = s + pool.Put(m) + return s +} diff --git a/cluster-autoscaler/vendor/github.com/josharian/intern/license.md b/cluster-autoscaler/vendor/github.com/josharian/intern/license.md new file mode 100644 index 000000000000..353d3055f0b4 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/josharian/intern/license.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Josh Bleecher Snyder + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/cluster-autoscaler/vendor/github.com/json-iterator/go/go.sum b/cluster-autoscaler/vendor/github.com/json-iterator/go/go.sum index d778b5a14d63..be00a6df969d 100644 --- a/cluster-autoscaler/vendor/github.com/json-iterator/go/go.sum +++ b/cluster-autoscaler/vendor/github.com/json-iterator/go/go.sum @@ -9,6 +9,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLD github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 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/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/cluster-autoscaler/vendor/github.com/json-iterator/go/iter_float.go b/cluster-autoscaler/vendor/github.com/json-iterator/go/iter_float.go index b9754638e888..8a3d8b6fb43c 100644 --- a/cluster-autoscaler/vendor/github.com/json-iterator/go/iter_float.go +++ b/cluster-autoscaler/vendor/github.com/json-iterator/go/iter_float.go @@ -288,6 +288,9 @@ non_decimal_loop: return iter.readFloat64SlowPath() } value = (value << 3) + (value << 1) + uint64(ind) + if value > maxFloat64 { + return iter.readFloat64SlowPath() + } } } return iter.readFloat64SlowPath() diff --git a/cluster-autoscaler/vendor/github.com/json-iterator/go/iter_int.go b/cluster-autoscaler/vendor/github.com/json-iterator/go/iter_int.go index 2142320355e8..d786a89fe1a3 100644 --- a/cluster-autoscaler/vendor/github.com/json-iterator/go/iter_int.go +++ b/cluster-autoscaler/vendor/github.com/json-iterator/go/iter_int.go @@ -9,6 +9,7 @@ var intDigits []int8 const uint32SafeToMultiply10 = uint32(0xffffffff)/10 - 1 const uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1 +const maxFloat64 = 1<<53 - 1 func init() { intDigits = make([]int8, 256) @@ -339,7 +340,7 @@ func (iter *Iterator) readUint64(c byte) (ret uint64) { } func (iter *Iterator) assertInteger() { - if iter.head < len(iter.buf) && iter.buf[iter.head] == '.' { + if iter.head < iter.tail && iter.buf[iter.head] == '.' { iter.ReportError("assertInteger", "can not decode float as int") } } diff --git a/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect.go b/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect.go index 74974ba74b06..39acb320ace7 100644 --- a/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect.go +++ b/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect.go @@ -65,7 +65,7 @@ func (iter *Iterator) ReadVal(obj interface{}) { decoder := iter.cfg.getDecoderFromCache(cacheKey) if decoder == nil { typ := reflect2.TypeOf(obj) - if typ.Kind() != reflect.Ptr { + if typ == nil || typ.Kind() != reflect.Ptr { iter.ReportError("ReadVal", "can only unmarshal into pointer") return } diff --git a/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect_json_raw_message.go b/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect_json_raw_message.go index f2619936c88f..eba434f2f16a 100644 --- a/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect_json_raw_message.go +++ b/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect_json_raw_message.go @@ -33,11 +33,19 @@ type jsonRawMessageCodec struct { } func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { - *((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes()) + if iter.ReadNil() { + *((*json.RawMessage)(ptr)) = nil + } else { + *((*json.RawMessage)(ptr)) = iter.SkipAndReturnBytes() + } } func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) { - stream.WriteRaw(string(*((*json.RawMessage)(ptr)))) + if *((*json.RawMessage)(ptr)) == nil { + stream.WriteNil() + } else { + stream.WriteRaw(string(*((*json.RawMessage)(ptr)))) + } } func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool { @@ -48,11 +56,19 @@ type jsoniterRawMessageCodec struct { } func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { - *((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes()) + if iter.ReadNil() { + *((*RawMessage)(ptr)) = nil + } else { + *((*RawMessage)(ptr)) = iter.SkipAndReturnBytes() + } } func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) { - stream.WriteRaw(string(*((*RawMessage)(ptr)))) + if *((*RawMessage)(ptr)) == nil { + stream.WriteNil() + } else { + stream.WriteRaw(string(*((*RawMessage)(ptr)))) + } } func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool { diff --git a/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect_struct_decoder.go b/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect_struct_decoder.go index d7eb0eb5caa8..92ae912dc248 100644 --- a/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect_struct_decoder.go +++ b/cluster-autoscaler/vendor/github.com/json-iterator/go/reflect_struct_decoder.go @@ -1075,6 +1075,11 @@ type stringModeNumberDecoder struct { } func (decoder *stringModeNumberDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { + if iter.WhatIsNext() == NilValue { + decoder.elemDecoder.Decode(ptr, iter) + return + } + c := iter.nextToken() if c != '"' { iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c})) diff --git a/cluster-autoscaler/vendor/github.com/mailru/easyjson/buffer/pool.go b/cluster-autoscaler/vendor/github.com/mailru/easyjson/buffer/pool.go index 07fb4bc1f7bf..598a54af9dbf 100644 --- a/cluster-autoscaler/vendor/github.com/mailru/easyjson/buffer/pool.go +++ b/cluster-autoscaler/vendor/github.com/mailru/easyjson/buffer/pool.go @@ -4,6 +4,7 @@ package buffer import ( "io" + "net" "sync" ) @@ -52,14 +53,12 @@ func putBuf(buf []byte) { // getBuf gets a chunk from reuse pool or creates a new one if reuse failed. func getBuf(size int) []byte { - if size < config.PooledSize { - return make([]byte, 0, size) - } - - if c := buffers[size]; c != nil { - v := c.Get() - if v != nil { - return v.([]byte) + if size >= config.PooledSize { + if c := buffers[size]; c != nil { + v := c.Get() + if v != nil { + return v.([]byte) + } } } return make([]byte, 0, size) @@ -78,9 +77,12 @@ type Buffer struct { // EnsureSpace makes sure that the current chunk contains at least s free bytes, // possibly creating a new chunk. func (b *Buffer) EnsureSpace(s int) { - if cap(b.Buf)-len(b.Buf) >= s { - return + if cap(b.Buf)-len(b.Buf) < s { + b.ensureSpaceSlow(s) } +} + +func (b *Buffer) ensureSpaceSlow(s int) { l := len(b.Buf) if l > 0 { if cap(b.toPool) != cap(b.Buf) { @@ -105,18 +107,22 @@ func (b *Buffer) EnsureSpace(s int) { // AppendByte appends a single byte to buffer. func (b *Buffer) AppendByte(data byte) { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } + b.EnsureSpace(1) b.Buf = append(b.Buf, data) } // AppendBytes appends a byte slice to buffer. func (b *Buffer) AppendBytes(data []byte) { + if len(data) <= cap(b.Buf)-len(b.Buf) { + b.Buf = append(b.Buf, data...) // fast path + } else { + b.appendBytesSlow(data) + } +} + +func (b *Buffer) appendBytesSlow(data []byte) { for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } + b.EnsureSpace(1) sz := cap(b.Buf) - len(b.Buf) if sz > len(data) { @@ -128,12 +134,18 @@ func (b *Buffer) AppendBytes(data []byte) { } } -// AppendBytes appends a string to buffer. +// AppendString appends a string to buffer. func (b *Buffer) AppendString(data string) { + if len(data) <= cap(b.Buf)-len(b.Buf) { + b.Buf = append(b.Buf, data...) // fast path + } else { + b.appendStringSlow(data) + } +} + +func (b *Buffer) appendStringSlow(data string) { for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } + b.EnsureSpace(1) sz := cap(b.Buf) - len(b.Buf) if sz > len(data) { @@ -156,18 +168,14 @@ func (b *Buffer) Size() int { // DumpTo outputs the contents of a buffer to a writer and resets the buffer. func (b *Buffer) DumpTo(w io.Writer) (written int, err error) { - var n int - for _, buf := range b.bufs { - if err == nil { - n, err = w.Write(buf) - written += n - } - putBuf(buf) + bufs := net.Buffers(b.bufs) + if len(b.Buf) > 0 { + bufs = append(bufs, b.Buf) } + n, err := bufs.WriteTo(w) - if err == nil { - n, err = w.Write(b.Buf) - written += n + for _, buf := range b.bufs { + putBuf(buf) } putBuf(b.toPool) @@ -175,7 +183,7 @@ func (b *Buffer) DumpTo(w io.Writer) (written int, err error) { b.Buf = nil b.toPool = nil - return + return int(n), err } // BuildBytes creates a single byte slice with all the contents of the buffer. Data is @@ -192,7 +200,7 @@ func (b *Buffer) BuildBytes(reuse ...[]byte) []byte { var ret []byte size := b.Size() - // If we got a buffer as argument and it is big enought, reuse it. + // If we got a buffer as argument and it is big enough, reuse it. if len(reuse) == 1 && cap(reuse[0]) >= size { ret = reuse[0][:0] } else { diff --git a/cluster-autoscaler/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/cluster-autoscaler/vendor/github.com/mailru/easyjson/jlexer/lexer.go index ddd376b844cb..a42e9d65ad79 100644 --- a/cluster-autoscaler/vendor/github.com/mailru/easyjson/jlexer/lexer.go +++ b/cluster-autoscaler/vendor/github.com/mailru/easyjson/jlexer/lexer.go @@ -5,6 +5,7 @@ package jlexer import ( + "bytes" "encoding/base64" "encoding/json" "errors" @@ -14,6 +15,8 @@ import ( "unicode" "unicode/utf16" "unicode/utf8" + + "github.com/josharian/intern" ) // tokenKind determines type of a token. @@ -32,9 +35,10 @@ const ( type token struct { kind tokenKind // Type of a token. - boolValue bool // Value if a boolean literal token. - byteValue []byte // Raw value of a token. - delimValue byte + boolValue bool // Value if a boolean literal token. + byteValueCloned bool // true if byteValue was allocated and does not refer to original json body + byteValue []byte // Raw value of a token. + delimValue byte } // Lexer is a JSON lexer: it iterates over JSON tokens in a byte slice. @@ -240,23 +244,65 @@ func (r *Lexer) fetchNumber() { // findStringLen tries to scan into the string literal for ending quote char to determine required size. // The size will be exact if no escapes are present and may be inexact if there are escaped chars. -func findStringLen(data []byte) (isValid, hasEscapes bool, length int) { - delta := 0 - - for i := 0; i < len(data); i++ { - switch data[i] { - case '\\': - i++ - delta++ - if i < len(data) && data[i] == 'u' { - delta++ - } - case '"': - return true, (delta > 0), (i - delta) +func findStringLen(data []byte) (isValid bool, length int) { + for { + idx := bytes.IndexByte(data, '"') + if idx == -1 { + return false, len(data) + } + if idx == 0 || (idx > 0 && data[idx-1] != '\\') { + return true, length + idx + } + + // count \\\\\\\ sequences. even number of slashes means quote is not really escaped + cnt := 1 + for idx-cnt-1 >= 0 && data[idx-cnt-1] == '\\' { + cnt++ + } + if cnt%2 == 0 { + return true, length + idx + } + + length += idx + 1 + data = data[idx+1:] + } +} + +// unescapeStringToken performs unescaping of string token. +// if no escaping is needed, original string is returned, otherwise - a new one allocated +func (r *Lexer) unescapeStringToken() (err error) { + data := r.token.byteValue + var unescapedData []byte + + for { + i := bytes.IndexByte(data, '\\') + if i == -1 { + break + } + + escapedRune, escapedBytes, err := decodeEscape(data[i:]) + if err != nil { + r.errParse(err.Error()) + return err } + + if unescapedData == nil { + unescapedData = make([]byte, 0, len(r.token.byteValue)) + } + + var d [4]byte + s := utf8.EncodeRune(d[:], escapedRune) + unescapedData = append(unescapedData, data[:i]...) + unescapedData = append(unescapedData, d[:s]...) + + data = data[i+escapedBytes:] } - return false, false, len(data) + if unescapedData != nil { + r.token.byteValue = append(unescapedData, data...) + r.token.byteValueCloned = true + } + return } // getu4 decodes \uXXXX from the beginning of s, returning the hex value, @@ -286,36 +332,30 @@ func getu4(s []byte) rune { return val } -// processEscape processes a single escape sequence and returns number of bytes processed. -func (r *Lexer) processEscape(data []byte) (int, error) { +// decodeEscape processes a single escape sequence and returns number of bytes processed. +func decodeEscape(data []byte) (decoded rune, bytesProcessed int, err error) { if len(data) < 2 { - return 0, fmt.Errorf("syntax error at %v", string(data)) + return 0, 0, errors.New("incorrect escape symbol \\ at the end of token") } c := data[1] switch c { case '"', '/', '\\': - r.token.byteValue = append(r.token.byteValue, c) - return 2, nil + return rune(c), 2, nil case 'b': - r.token.byteValue = append(r.token.byteValue, '\b') - return 2, nil + return '\b', 2, nil case 'f': - r.token.byteValue = append(r.token.byteValue, '\f') - return 2, nil + return '\f', 2, nil case 'n': - r.token.byteValue = append(r.token.byteValue, '\n') - return 2, nil + return '\n', 2, nil case 'r': - r.token.byteValue = append(r.token.byteValue, '\r') - return 2, nil + return '\r', 2, nil case 't': - r.token.byteValue = append(r.token.byteValue, '\t') - return 2, nil + return '\t', 2, nil case 'u': rr := getu4(data) if rr < 0 { - return 0, errors.New("syntax error") + return 0, 0, errors.New("incorrectly escaped \\uXXXX sequence") } read := 6 @@ -328,13 +368,10 @@ func (r *Lexer) processEscape(data []byte) (int, error) { rr = unicode.ReplacementChar } } - var d [4]byte - s := utf8.EncodeRune(d[:], rr) - r.token.byteValue = append(r.token.byteValue, d[:s]...) - return read, nil + return rr, read, nil } - return 0, errors.New("syntax error") + return 0, 0, errors.New("incorrectly escaped bytes") } // fetchString scans a string literal token. @@ -342,43 +379,14 @@ func (r *Lexer) fetchString() { r.pos++ data := r.Data[r.pos:] - isValid, hasEscapes, length := findStringLen(data) + isValid, length := findStringLen(data) if !isValid { r.pos += length r.errParse("unterminated string literal") return } - if !hasEscapes { - r.token.byteValue = data[:length] - r.pos += length + 1 - return - } - - r.token.byteValue = make([]byte, 0, length) - p := 0 - for i := 0; i < len(data); { - switch data[i] { - case '"': - r.pos += i + 1 - r.token.byteValue = append(r.token.byteValue, data[p:i]...) - i++ - return - - case '\\': - r.token.byteValue = append(r.token.byteValue, data[p:i]...) - off, err := r.processEscape(data[i:]) - if err != nil { - r.errParse(err.Error()) - return - } - i += off - p = i - - default: - i++ - } - } - r.errParse("unterminated string literal") + r.token.byteValue = data[:length] + r.pos += length + 1 // skip closing '"' as well } // scanToken scans the next token if no token is currently available in the lexer. @@ -602,7 +610,7 @@ func (r *Lexer) Consumed() { } } -func (r *Lexer) unsafeString() (string, []byte) { +func (r *Lexer) unsafeString(skipUnescape bool) (string, []byte) { if r.token.kind == tokenUndef && r.Ok() { r.FetchToken() } @@ -610,6 +618,13 @@ func (r *Lexer) unsafeString() (string, []byte) { r.errInvalidToken("string") return "", nil } + if !skipUnescape { + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return "", nil + } + } + bytes := r.token.byteValue ret := bytesToStr(r.token.byteValue) r.consume() @@ -621,13 +636,19 @@ func (r *Lexer) unsafeString() (string, []byte) { // Warning: returned string may point to the input buffer, so the string should not outlive // the input buffer. Intended pattern of usage is as an argument to a switch statement. func (r *Lexer) UnsafeString() string { - ret, _ := r.unsafeString() + ret, _ := r.unsafeString(false) return ret } // UnsafeBytes returns the byte slice if the token is a string literal. func (r *Lexer) UnsafeBytes() []byte { - _, ret := r.unsafeString() + _, ret := r.unsafeString(false) + return ret +} + +// UnsafeFieldName returns current member name string token +func (r *Lexer) UnsafeFieldName(skipUnescape bool) string { + ret, _ := r.unsafeString(skipUnescape) return ret } @@ -640,7 +661,34 @@ func (r *Lexer) String() string { r.errInvalidToken("string") return "" } - ret := string(r.token.byteValue) + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return "" + } + var ret string + if r.token.byteValueCloned { + ret = bytesToStr(r.token.byteValue) + } else { + ret = string(r.token.byteValue) + } + r.consume() + return ret +} + +// StringIntern reads a string literal, and performs string interning on it. +func (r *Lexer) StringIntern() string { + if r.token.kind == tokenUndef && r.Ok() { + r.FetchToken() + } + if !r.Ok() || r.token.kind != tokenString { + r.errInvalidToken("string") + return "" + } + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return "" + } + ret := intern.Bytes(r.token.byteValue) r.consume() return ret } @@ -839,7 +887,7 @@ func (r *Lexer) Int() int { } func (r *Lexer) Uint8Str() uint8 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -856,7 +904,7 @@ func (r *Lexer) Uint8Str() uint8 { } func (r *Lexer) Uint16Str() uint16 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -873,7 +921,7 @@ func (r *Lexer) Uint16Str() uint16 { } func (r *Lexer) Uint32Str() uint32 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -890,7 +938,7 @@ func (r *Lexer) Uint32Str() uint32 { } func (r *Lexer) Uint64Str() uint64 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -915,7 +963,7 @@ func (r *Lexer) UintptrStr() uintptr { } func (r *Lexer) Int8Str() int8 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -932,7 +980,7 @@ func (r *Lexer) Int8Str() int8 { } func (r *Lexer) Int16Str() int16 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -949,7 +997,7 @@ func (r *Lexer) Int16Str() int16 { } func (r *Lexer) Int32Str() int32 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -966,7 +1014,7 @@ func (r *Lexer) Int32Str() int32 { } func (r *Lexer) Int64Str() int64 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -1004,7 +1052,7 @@ func (r *Lexer) Float32() float32 { } func (r *Lexer) Float32Str() float32 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -1037,7 +1085,7 @@ func (r *Lexer) Float64() float64 { } func (r *Lexer) Float64Str() float64 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } diff --git a/cluster-autoscaler/vendor/github.com/mailru/easyjson/jwriter/writer.go b/cluster-autoscaler/vendor/github.com/mailru/easyjson/jwriter/writer.go index b9ed7ccaa8bc..2c5b20105bb9 100644 --- a/cluster-autoscaler/vendor/github.com/mailru/easyjson/jwriter/writer.go +++ b/cluster-autoscaler/vendor/github.com/mailru/easyjson/jwriter/writer.go @@ -270,16 +270,25 @@ func (w *Writer) Bool(v bool) { const chars = "0123456789abcdef" -func isNotEscapedSingleChar(c byte, escapeHTML bool) bool { - // Note: might make sense to use a table if there are more chars to escape. With 4 chars - // it benchmarks the same. - if escapeHTML { - return c != '<' && c != '>' && c != '&' && c != '\\' && c != '"' && c >= 0x20 && c < utf8.RuneSelf - } else { - return c != '\\' && c != '"' && c >= 0x20 && c < utf8.RuneSelf +func getTable(falseValues ...int) [128]bool { + table := [128]bool{} + + for i := 0; i < 128; i++ { + table[i] = true + } + + for _, v := range falseValues { + table[v] = false } + + return table } +var ( + htmlEscapeTable = getTable(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, '"', '&', '<', '>', '\\') + htmlNoEscapeTable = getTable(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, '"', '\\') +) + func (w *Writer) String(s string) { w.Buffer.AppendByte('"') @@ -288,15 +297,21 @@ func (w *Writer) String(s string) { p := 0 // last non-escape symbol + escapeTable := &htmlEscapeTable + if w.NoEscapeHTML { + escapeTable = &htmlNoEscapeTable + } + for i := 0; i < len(s); { c := s[i] - if isNotEscapedSingleChar(c, !w.NoEscapeHTML) { - // single-width character, no escaping is required - i++ - continue - } else if c < utf8.RuneSelf { - // single-with character, need to escape + if c < utf8.RuneSelf { + if escapeTable[c] { + // single-width character, no escaping is required + i++ + continue + } + w.Buffer.AppendString(s[p:i]) switch c { case '\t': diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/.codecov.yml b/cluster-autoscaler/vendor/github.com/miekg/dns/.codecov.yml deleted file mode 100644 index f91e5c1fe57c..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/.codecov.yml +++ /dev/null @@ -1,8 +0,0 @@ -coverage: - status: - project: - default: - target: 40% - threshold: null - patch: false - changes: false diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/.gitignore b/cluster-autoscaler/vendor/github.com/miekg/dns/.gitignore deleted file mode 100644 index 776cd950c25c..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.6 -tags -test.out -a.out diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/.travis.yml b/cluster-autoscaler/vendor/github.com/miekg/dns/.travis.yml deleted file mode 100644 index 7d9b17275664..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: go -sudo: false - -go: - - 1.14.x - - 1.15.x - - tip - -env: - - GO111MODULE=on - -script: - - go generate ./... && test `git ls-files --modified | wc -l` = 0 - - go test -race -v -bench=. -coverprofile=coverage.txt -covermode=atomic ./... - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/AUTHORS b/cluster-autoscaler/vendor/github.com/miekg/dns/AUTHORS deleted file mode 100644 index 1965683525ad..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Miek Gieben diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/CODEOWNERS b/cluster-autoscaler/vendor/github.com/miekg/dns/CODEOWNERS deleted file mode 100644 index e0917031bc18..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @miekg @tmthrgd diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/CONTRIBUTORS b/cluster-autoscaler/vendor/github.com/miekg/dns/CONTRIBUTORS deleted file mode 100644 index 5903779d81fa..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/CONTRIBUTORS +++ /dev/null @@ -1,10 +0,0 @@ -Alex A. Skinner -Andrew Tunnell-Jones -Ask Bjørn Hansen -Dave Cheney -Dusty Wilson -Marek Majkowski -Peter van Dijk -Omri Bahumi -Alex Sergeyev -James Hartig diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/COPYRIGHT b/cluster-autoscaler/vendor/github.com/miekg/dns/COPYRIGHT deleted file mode 100644 index 35702b10e87e..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/COPYRIGHT +++ /dev/null @@ -1,9 +0,0 @@ -Copyright 2009 The Go Authors. All rights reserved. Use of this source code -is governed by a BSD-style license that can be found in the LICENSE file. -Extensions of the original work are copyright (c) 2011 Miek Gieben - -Copyright 2011 Miek Gieben. All rights reserved. Use of this source code is -governed by a BSD-style license that can be found in the LICENSE file. - -Copyright 2014 CloudFlare. All rights reserved. Use of this source code is -governed by a BSD-style license that can be found in the LICENSE file. diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/Makefile.fuzz b/cluster-autoscaler/vendor/github.com/miekg/dns/Makefile.fuzz deleted file mode 100644 index dc158c4acee1..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/Makefile.fuzz +++ /dev/null @@ -1,33 +0,0 @@ -# Makefile for fuzzing -# -# Use go-fuzz and needs the tools installed. -# See https://blog.cloudflare.com/dns-parser-meet-go-fuzzer/ -# -# Installing go-fuzz: -# $ make -f Makefile.fuzz get -# Installs: -# * github.com/dvyukov/go-fuzz/go-fuzz -# * get github.com/dvyukov/go-fuzz/go-fuzz-build - -all: build - -.PHONY: build -build: - go-fuzz-build -tags fuzz github.com/miekg/dns - -.PHONY: build-newrr -build-newrr: - go-fuzz-build -func FuzzNewRR -tags fuzz github.com/miekg/dns - -.PHONY: fuzz -fuzz: - go-fuzz -bin=dns-fuzz.zip -workdir=fuzz - -.PHONY: get -get: - go get github.com/dvyukov/go-fuzz/go-fuzz - go get github.com/dvyukov/go-fuzz/go-fuzz-build - -.PHONY: clean -clean: - rm *-fuzz.zip diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/Makefile.release b/cluster-autoscaler/vendor/github.com/miekg/dns/Makefile.release deleted file mode 100644 index 8fb748e8aaef..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/Makefile.release +++ /dev/null @@ -1,52 +0,0 @@ -# Makefile for releasing. -# -# The release is controlled from version.go. The version found there is -# used to tag the git repo, we're not building any artifects so there is nothing -# to upload to github. -# -# * Up the version in version.go -# * Run: make -f Makefile.release release -# * will *commit* your change with 'Release $VERSION' -# * push to github -# - -define GO -//+build ignore - -package main - -import ( - "fmt" - - "github.com/miekg/dns" -) - -func main() { - fmt.Println(dns.Version.String()) -} -endef - -$(file > version_release.go,$(GO)) -VERSION:=$(shell go run version_release.go) -TAG="v$(VERSION)" - -all: - @echo Use the \'release\' target to start a release $(VERSION) - rm -f version_release.go - -.PHONY: release -release: commit push - @echo Released $(VERSION) - rm -f version_release.go - -.PHONY: commit -commit: - @echo Committing release $(VERSION) - git commit -am"Release $(VERSION)" - git tag $(TAG) - -.PHONY: push -push: - @echo Pushing release $(VERSION) to master - git push --tags - git push diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/README.md b/cluster-autoscaler/vendor/github.com/miekg/dns/README.md deleted file mode 100644 index fc8394e2697a..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/README.md +++ /dev/null @@ -1,174 +0,0 @@ -[![Build Status](https://travis-ci.org/miekg/dns.svg?branch=master)](https://travis-ci.org/miekg/dns) -[![Code Coverage](https://img.shields.io/codecov/c/github/miekg/dns/master.svg)](https://codecov.io/github/miekg/dns?branch=master) -[![Go Report Card](https://goreportcard.com/badge/github.com/miekg/dns)](https://goreportcard.com/report/miekg/dns) -[![](https://godoc.org/github.com/miekg/dns?status.svg)](https://godoc.org/github.com/miekg/dns) - -# Alternative (more granular) approach to a DNS library - -> Less is more. - -Complete and usable DNS library. All Resource Records are supported, including the DNSSEC types. -It follows a lean and mean philosophy. If there is stuff you should know as a DNS programmer there -isn't a convenience function for it. Server side and client side programming is supported, i.e. you -can build servers and resolvers with it. - -We try to keep the "master" branch as sane as possible and at the bleeding edge of standards, -avoiding breaking changes wherever reasonable. We support the last two versions of Go. - -# Goals - -* KISS; -* Fast; -* Small API. If it's easy to code in Go, don't make a function for it. - -# Users - -A not-so-up-to-date-list-that-may-be-actually-current: - -* https://github.com/coredns/coredns -* https://github.com/abh/geodns -* https://github.com/baidu/bfe -* http://www.statdns.com/ -* http://www.dnsinspect.com/ -* https://github.com/chuangbo/jianbing-dictionary-dns -* http://www.dns-lg.com/ -* https://github.com/fcambus/rrda -* https://github.com/kenshinx/godns -* https://github.com/skynetservices/skydns -* https://github.com/hashicorp/consul -* https://github.com/DevelopersPL/godnsagent -* https://github.com/duedil-ltd/discodns -* https://github.com/StalkR/dns-reverse-proxy -* https://github.com/tianon/rawdns -* https://mesosphere.github.io/mesos-dns/ -* https://github.com/fcambus/statzone -* https://github.com/benschw/dns-clb-go -* https://github.com/corny/dnscheck for -* https://github.com/miekg/unbound -* https://github.com/miekg/exdns -* https://dnslookup.org -* https://github.com/looterz/grimd -* https://github.com/phamhongviet/serf-dns -* https://github.com/mehrdadrad/mylg -* https://github.com/bamarni/dockness -* https://github.com/fffaraz/microdns -* https://github.com/ipdcode/hades -* https://github.com/StackExchange/dnscontrol/ -* https://www.dnsperf.com/ -* https://dnssectest.net/ -* https://github.com/oif/apex -* https://github.com/jedisct1/dnscrypt-proxy -* https://github.com/jedisct1/rpdns -* https://github.com/xor-gate/sshfp -* https://github.com/rs/dnstrace -* https://blitiri.com.ar/p/dnss ([github mirror](https://github.com/albertito/dnss)) -* https://render.com -* https://github.com/peterzen/goresolver -* https://github.com/folbricht/routedns -* https://domainr.com/ -* https://zonedb.org/ -* https://router7.org/ -* https://github.com/fortio/dnsping - -Send pull request if you want to be listed here. - -# Features - -* UDP/TCP queries, IPv4 and IPv6 -* RFC 1035 zone file parsing ($INCLUDE, $ORIGIN, $TTL and $GENERATE (for all record types) are supported -* Fast -* Server side programming (mimicking the net/http package) -* Client side programming -* DNSSEC: signing, validating and key generation for DSA, RSA, ECDSA and Ed25519 -* EDNS0, NSID, Cookies -* AXFR/IXFR -* TSIG, SIG(0) -* DNS over TLS (DoT): encrypted connection between client and server over TCP -* DNS name compression - -Have fun! - -Miek Gieben - 2010-2012 - -DNS Authors 2012- - -# Building - -This library uses Go modules and uses semantic versioning. Building is done with the `go` tool, so -the following should work: - - go get github.com/miekg/dns - go build github.com/miekg/dns - -## Examples - -A short "how to use the API" is at the beginning of doc.go (this also will show when you call `godoc -github.com/miekg/dns`). - -Example programs can be found in the `github.com/miekg/exdns` repository. - -## Supported RFCs - -*all of them* - -* 103{4,5} - DNS standard -* 1348 - NSAP record (removed the record) -* 1982 - Serial Arithmetic -* 1876 - LOC record -* 1995 - IXFR -* 1996 - DNS notify -* 2136 - DNS Update (dynamic updates) -* 2181 - RRset definition - there is no RRset type though, just []RR -* 2537 - RSAMD5 DNS keys -* 2065 - DNSSEC (updated in later RFCs) -* 2671 - EDNS record -* 2782 - SRV record -* 2845 - TSIG record -* 2915 - NAPTR record -* 2929 - DNS IANA Considerations -* 3110 - RSASHA1 DNS keys -* 3123 - APL record -* 3225 - DO bit (DNSSEC OK) -* 340{1,2,3} - NAPTR record -* 3445 - Limiting the scope of (DNS)KEY -* 3597 - Unknown RRs -* 403{3,4,5} - DNSSEC + validation functions -* 4255 - SSHFP record -* 4343 - Case insensitivity -* 4408 - SPF record -* 4509 - SHA256 Hash in DS -* 4592 - Wildcards in the DNS -* 4635 - HMAC SHA TSIG -* 4701 - DHCID -* 4892 - id.server -* 5001 - NSID -* 5155 - NSEC3 record -* 5205 - HIP record -* 5702 - SHA2 in the DNS -* 5936 - AXFR -* 5966 - TCP implementation recommendations -* 6605 - ECDSA -* 6725 - IANA Registry Update -* 6742 - ILNP DNS -* 6840 - Clarifications and Implementation Notes for DNS Security -* 6844 - CAA record -* 6891 - EDNS0 update -* 6895 - DNS IANA considerations -* 6944 - DNSSEC DNSKEY Algorithm Status -* 6975 - Algorithm Understanding in DNSSEC -* 7043 - EUI48/EUI64 records -* 7314 - DNS (EDNS) EXPIRE Option -* 7477 - CSYNC RR -* 7828 - edns-tcp-keepalive EDNS0 Option -* 7553 - URI record -* 7858 - DNS over TLS: Initiation and Performance Considerations -* 7871 - EDNS0 Client Subnet -* 7873 - Domain Name System (DNS) Cookies -* 8080 - EdDSA for DNSSEC -* 8499 - DNS Terminology - -## Loosely Based Upon - -* ldns - -* NSD - -* Net::DNS - -* GRONG - diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/acceptfunc.go b/cluster-autoscaler/vendor/github.com/miekg/dns/acceptfunc.go deleted file mode 100644 index 825617fe215b..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/acceptfunc.go +++ /dev/null @@ -1,61 +0,0 @@ -package dns - -// MsgAcceptFunc is used early in the server code to accept or reject a message with RcodeFormatError. -// It returns a MsgAcceptAction to indicate what should happen with the message. -type MsgAcceptFunc func(dh Header) MsgAcceptAction - -// DefaultMsgAcceptFunc checks the request and will reject if: -// -// * isn't a request (don't respond in that case) -// -// * opcode isn't OpcodeQuery or OpcodeNotify -// -// * Zero bit isn't zero -// -// * has more than 1 question in the question section -// -// * has more than 1 RR in the Answer section -// -// * has more than 0 RRs in the Authority section -// -// * has more than 2 RRs in the Additional section -// -var DefaultMsgAcceptFunc MsgAcceptFunc = defaultMsgAcceptFunc - -// MsgAcceptAction represents the action to be taken. -type MsgAcceptAction int - -const ( - MsgAccept MsgAcceptAction = iota // Accept the message - MsgReject // Reject the message with a RcodeFormatError - MsgIgnore // Ignore the error and send nothing back. - MsgRejectNotImplemented // Reject the message with a RcodeNotImplemented -) - -func defaultMsgAcceptFunc(dh Header) MsgAcceptAction { - if isResponse := dh.Bits&_QR != 0; isResponse { - return MsgIgnore - } - - // Don't allow dynamic updates, because then the sections can contain a whole bunch of RRs. - opcode := int(dh.Bits>>11) & 0xF - if opcode != OpcodeQuery && opcode != OpcodeNotify { - return MsgRejectNotImplemented - } - - if dh.Qdcount != 1 { - return MsgReject - } - // NOTIFY requests can have a SOA in the ANSWER section. See RFC 1996 Section 3.7 and 3.11. - if dh.Ancount > 1 { - return MsgReject - } - // IXFR request could have one SOA RR in the NS section. See RFC 1995, section 3. - if dh.Nscount > 1 { - return MsgReject - } - if dh.Arcount > 2 { - return MsgReject - } - return MsgAccept -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/client.go b/cluster-autoscaler/vendor/github.com/miekg/dns/client.go deleted file mode 100644 index e7ff786a237f..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/client.go +++ /dev/null @@ -1,441 +0,0 @@ -package dns - -// A client implementation. - -import ( - "context" - "crypto/tls" - "encoding/binary" - "fmt" - "io" - "net" - "strings" - "time" -) - -const ( - dnsTimeout time.Duration = 2 * time.Second - tcpIdleTimeout time.Duration = 8 * time.Second -) - -// A Conn represents a connection to a DNS server. -type Conn struct { - net.Conn // a net.Conn holding the connection - UDPSize uint16 // minimum receive buffer for UDP messages - TsigSecret map[string]string // secret(s) for Tsig map[], zonename must be in canonical form (lowercase, fqdn, see RFC 4034 Section 6.2) - tsigRequestMAC string -} - -// A Client defines parameters for a DNS client. -type Client struct { - Net string // if "tcp" or "tcp-tls" (DNS over TLS) a TCP query will be initiated, otherwise an UDP one (default is "" for UDP) - UDPSize uint16 // minimum receive buffer for UDP messages - TLSConfig *tls.Config // TLS connection configuration - Dialer *net.Dialer // a net.Dialer used to set local address, timeouts and more - // Timeout is a cumulative timeout for dial, write and read, defaults to 0 (disabled) - overrides DialTimeout, ReadTimeout, - // WriteTimeout when non-zero. Can be overridden with net.Dialer.Timeout (see Client.ExchangeWithDialer and - // Client.Dialer) or context.Context.Deadline (see ExchangeContext) - Timeout time.Duration - DialTimeout time.Duration // net.DialTimeout, defaults to 2 seconds, or net.Dialer.Timeout if expiring earlier - overridden by Timeout when that value is non-zero - ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections, defaults to 2 seconds - overridden by Timeout when that value is non-zero - WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections, defaults to 2 seconds - overridden by Timeout when that value is non-zero - TsigSecret map[string]string // secret(s) for Tsig map[], zonename must be in canonical form (lowercase, fqdn, see RFC 4034 Section 6.2) - SingleInflight bool // if true suppress multiple outstanding queries for the same Qname, Qtype and Qclass - group singleflight -} - -// Exchange performs a synchronous UDP query. It sends the message m to the address -// contained in a and waits for a reply. Exchange does not retry a failed query, nor -// will it fall back to TCP in case of truncation. -// See client.Exchange for more information on setting larger buffer sizes. -func Exchange(m *Msg, a string) (r *Msg, err error) { - client := Client{Net: "udp"} - r, _, err = client.Exchange(m, a) - return r, err -} - -func (c *Client) dialTimeout() time.Duration { - if c.Timeout != 0 { - return c.Timeout - } - if c.DialTimeout != 0 { - return c.DialTimeout - } - return dnsTimeout -} - -func (c *Client) readTimeout() time.Duration { - if c.ReadTimeout != 0 { - return c.ReadTimeout - } - return dnsTimeout -} - -func (c *Client) writeTimeout() time.Duration { - if c.WriteTimeout != 0 { - return c.WriteTimeout - } - return dnsTimeout -} - -// Dial connects to the address on the named network. -func (c *Client) Dial(address string) (conn *Conn, err error) { - // create a new dialer with the appropriate timeout - var d net.Dialer - if c.Dialer == nil { - d = net.Dialer{Timeout: c.getTimeoutForRequest(c.dialTimeout())} - } else { - d = *c.Dialer - } - - network := c.Net - if network == "" { - network = "udp" - } - - useTLS := strings.HasPrefix(network, "tcp") && strings.HasSuffix(network, "-tls") - - conn = new(Conn) - if useTLS { - network = strings.TrimSuffix(network, "-tls") - - conn.Conn, err = tls.DialWithDialer(&d, network, address, c.TLSConfig) - } else { - conn.Conn, err = d.Dial(network, address) - } - if err != nil { - return nil, err - } - conn.UDPSize = c.UDPSize - return conn, nil -} - -// Exchange performs a synchronous query. It sends the message m to the address -// contained in a and waits for a reply. Basic use pattern with a *dns.Client: -// -// c := new(dns.Client) -// in, rtt, err := c.Exchange(message, "127.0.0.1:53") -// -// Exchange does not retry a failed query, nor will it fall back to TCP in -// case of truncation. -// It is up to the caller to create a message that allows for larger responses to be -// returned. Specifically this means adding an EDNS0 OPT RR that will advertise a larger -// buffer, see SetEdns0. Messages without an OPT RR will fallback to the historic limit -// of 512 bytes -// To specify a local address or a timeout, the caller has to set the `Client.Dialer` -// attribute appropriately - -func (c *Client) Exchange(m *Msg, address string) (r *Msg, rtt time.Duration, err error) { - co, err := c.Dial(address) - - if err != nil { - return nil, 0, err - } - defer co.Close() - return c.ExchangeWithConn(m, co) -} - -// ExchangeWithConn has the same behavior as Exchange, just with a predetermined connection -// that will be used instead of creating a new one. -// Usage pattern with a *dns.Client: -// c := new(dns.Client) -// // connection management logic goes here -// -// conn := c.Dial(address) -// in, rtt, err := c.ExchangeWithConn(message, conn) -// -// This allows users of the library to implement their own connection management, -// as opposed to Exchange, which will always use new connections and incur the added overhead -// that entails when using "tcp" and especially "tcp-tls" clients. -func (c *Client) ExchangeWithConn(m *Msg, conn *Conn) (r *Msg, rtt time.Duration, err error) { - if !c.SingleInflight { - return c.exchange(m, conn) - } - - q := m.Question[0] - key := fmt.Sprintf("%s:%d:%d", q.Name, q.Qtype, q.Qclass) - r, rtt, err, shared := c.group.Do(key, func() (*Msg, time.Duration, error) { - return c.exchange(m, conn) - }) - if r != nil && shared { - r = r.Copy() - } - - return r, rtt, err -} - -func (c *Client) exchange(m *Msg, co *Conn) (r *Msg, rtt time.Duration, err error) { - - opt := m.IsEdns0() - // If EDNS0 is used use that for size. - if opt != nil && opt.UDPSize() >= MinMsgSize { - co.UDPSize = opt.UDPSize() - } - // Otherwise use the client's configured UDP size. - if opt == nil && c.UDPSize >= MinMsgSize { - co.UDPSize = c.UDPSize - } - - co.TsigSecret = c.TsigSecret - t := time.Now() - // write with the appropriate write timeout - co.SetWriteDeadline(t.Add(c.getTimeoutForRequest(c.writeTimeout()))) - if err = co.WriteMsg(m); err != nil { - return nil, 0, err - } - - co.SetReadDeadline(time.Now().Add(c.getTimeoutForRequest(c.readTimeout()))) - if _, ok := co.Conn.(net.PacketConn); ok { - for { - r, err = co.ReadMsg() - // Ignore replies with mismatched IDs because they might be - // responses to earlier queries that timed out. - if err != nil || r.Id == m.Id { - break - } - } - } else { - r, err = co.ReadMsg() - if err == nil && r.Id != m.Id { - err = ErrId - } - } - rtt = time.Since(t) - return r, rtt, err -} - -// ReadMsg reads a message from the connection co. -// If the received message contains a TSIG record the transaction signature -// is verified. This method always tries to return the message, however if an -// error is returned there are no guarantees that the returned message is a -// valid representation of the packet read. -func (co *Conn) ReadMsg() (*Msg, error) { - p, err := co.ReadMsgHeader(nil) - if err != nil { - return nil, err - } - - m := new(Msg) - if err := m.Unpack(p); err != nil { - // If an error was returned, we still want to allow the user to use - // the message, but naively they can just check err if they don't want - // to use an erroneous message - return m, err - } - if t := m.IsTsig(); t != nil { - if _, ok := co.TsigSecret[t.Hdr.Name]; !ok { - return m, ErrSecret - } - // Need to work on the original message p, as that was used to calculate the tsig. - err = TsigVerify(p, co.TsigSecret[t.Hdr.Name], co.tsigRequestMAC, false) - } - return m, err -} - -// ReadMsgHeader reads a DNS message, parses and populates hdr (when hdr is not nil). -// Returns message as a byte slice to be parsed with Msg.Unpack later on. -// Note that error handling on the message body is not possible as only the header is parsed. -func (co *Conn) ReadMsgHeader(hdr *Header) ([]byte, error) { - var ( - p []byte - n int - err error - ) - - if _, ok := co.Conn.(net.PacketConn); ok { - if co.UDPSize > MinMsgSize { - p = make([]byte, co.UDPSize) - } else { - p = make([]byte, MinMsgSize) - } - n, err = co.Read(p) - } else { - var length uint16 - if err := binary.Read(co.Conn, binary.BigEndian, &length); err != nil { - return nil, err - } - - p = make([]byte, length) - n, err = io.ReadFull(co.Conn, p) - } - - if err != nil { - return nil, err - } else if n < headerSize { - return nil, ErrShortRead - } - - p = p[:n] - if hdr != nil { - dh, _, err := unpackMsgHdr(p, 0) - if err != nil { - return nil, err - } - *hdr = dh - } - return p, err -} - -// Read implements the net.Conn read method. -func (co *Conn) Read(p []byte) (n int, err error) { - if co.Conn == nil { - return 0, ErrConnEmpty - } - - if _, ok := co.Conn.(net.PacketConn); ok { - // UDP connection - return co.Conn.Read(p) - } - - var length uint16 - if err := binary.Read(co.Conn, binary.BigEndian, &length); err != nil { - return 0, err - } - if int(length) > len(p) { - return 0, io.ErrShortBuffer - } - - return io.ReadFull(co.Conn, p[:length]) -} - -// WriteMsg sends a message through the connection co. -// If the message m contains a TSIG record the transaction -// signature is calculated. -func (co *Conn) WriteMsg(m *Msg) (err error) { - var out []byte - if t := m.IsTsig(); t != nil { - mac := "" - if _, ok := co.TsigSecret[t.Hdr.Name]; !ok { - return ErrSecret - } - out, mac, err = TsigGenerate(m, co.TsigSecret[t.Hdr.Name], co.tsigRequestMAC, false) - // Set for the next read, although only used in zone transfers - co.tsigRequestMAC = mac - } else { - out, err = m.Pack() - } - if err != nil { - return err - } - _, err = co.Write(out) - return err -} - -// Write implements the net.Conn Write method. -func (co *Conn) Write(p []byte) (int, error) { - if len(p) > MaxMsgSize { - return 0, &Error{err: "message too large"} - } - - if _, ok := co.Conn.(net.PacketConn); ok { - return co.Conn.Write(p) - } - - l := make([]byte, 2) - binary.BigEndian.PutUint16(l, uint16(len(p))) - - n, err := (&net.Buffers{l, p}).WriteTo(co.Conn) - return int(n), err -} - -// Return the appropriate timeout for a specific request -func (c *Client) getTimeoutForRequest(timeout time.Duration) time.Duration { - var requestTimeout time.Duration - if c.Timeout != 0 { - requestTimeout = c.Timeout - } else { - requestTimeout = timeout - } - // net.Dialer.Timeout has priority if smaller than the timeouts computed so - // far - if c.Dialer != nil && c.Dialer.Timeout != 0 { - if c.Dialer.Timeout < requestTimeout { - requestTimeout = c.Dialer.Timeout - } - } - return requestTimeout -} - -// Dial connects to the address on the named network. -func Dial(network, address string) (conn *Conn, err error) { - conn = new(Conn) - conn.Conn, err = net.Dial(network, address) - if err != nil { - return nil, err - } - return conn, nil -} - -// ExchangeContext performs a synchronous UDP query, like Exchange. It -// additionally obeys deadlines from the passed Context. -func ExchangeContext(ctx context.Context, m *Msg, a string) (r *Msg, err error) { - client := Client{Net: "udp"} - r, _, err = client.ExchangeContext(ctx, m, a) - // ignorint rtt to leave the original ExchangeContext API unchanged, but - // this function will go away - return r, err -} - -// ExchangeConn performs a synchronous query. It sends the message m via the connection -// c and waits for a reply. The connection c is not closed by ExchangeConn. -// Deprecated: This function is going away, but can easily be mimicked: -// -// co := &dns.Conn{Conn: c} // c is your net.Conn -// co.WriteMsg(m) -// in, _ := co.ReadMsg() -// co.Close() -// -func ExchangeConn(c net.Conn, m *Msg) (r *Msg, err error) { - println("dns: ExchangeConn: this function is deprecated") - co := new(Conn) - co.Conn = c - if err = co.WriteMsg(m); err != nil { - return nil, err - } - r, err = co.ReadMsg() - if err == nil && r.Id != m.Id { - err = ErrId - } - return r, err -} - -// DialTimeout acts like Dial but takes a timeout. -func DialTimeout(network, address string, timeout time.Duration) (conn *Conn, err error) { - client := Client{Net: network, Dialer: &net.Dialer{Timeout: timeout}} - return client.Dial(address) -} - -// DialWithTLS connects to the address on the named network with TLS. -func DialWithTLS(network, address string, tlsConfig *tls.Config) (conn *Conn, err error) { - if !strings.HasSuffix(network, "-tls") { - network += "-tls" - } - client := Client{Net: network, TLSConfig: tlsConfig} - return client.Dial(address) -} - -// DialTimeoutWithTLS acts like DialWithTLS but takes a timeout. -func DialTimeoutWithTLS(network, address string, tlsConfig *tls.Config, timeout time.Duration) (conn *Conn, err error) { - if !strings.HasSuffix(network, "-tls") { - network += "-tls" - } - client := Client{Net: network, Dialer: &net.Dialer{Timeout: timeout}, TLSConfig: tlsConfig} - return client.Dial(address) -} - -// ExchangeContext acts like Exchange, but honors the deadline on the provided -// context, if present. If there is both a context deadline and a configured -// timeout on the client, the earliest of the two takes effect. -func (c *Client) ExchangeContext(ctx context.Context, m *Msg, a string) (r *Msg, rtt time.Duration, err error) { - var timeout time.Duration - if deadline, ok := ctx.Deadline(); !ok { - timeout = 0 - } else { - timeout = time.Until(deadline) - } - // not passing the context to the underlying calls, as the API does not support - // context. For timeouts you should set up Client.Dialer and call Client.Exchange. - // TODO(tmthrgd,miekg): this is a race condition. - c.Dialer = &net.Dialer{Timeout: timeout} - return c.Exchange(m, a) -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/clientconfig.go b/cluster-autoscaler/vendor/github.com/miekg/dns/clientconfig.go deleted file mode 100644 index e11b630df9f0..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/clientconfig.go +++ /dev/null @@ -1,135 +0,0 @@ -package dns - -import ( - "bufio" - "io" - "os" - "strconv" - "strings" -) - -// ClientConfig wraps the contents of the /etc/resolv.conf file. -type ClientConfig struct { - Servers []string // servers to use - Search []string // suffixes to append to local name - Port string // what port to use - Ndots int // number of dots in name to trigger absolute lookup - Timeout int // seconds before giving up on packet - Attempts int // lost packets before giving up on server, not used in the package dns -} - -// ClientConfigFromFile parses a resolv.conf(5) like file and returns -// a *ClientConfig. -func ClientConfigFromFile(resolvconf string) (*ClientConfig, error) { - file, err := os.Open(resolvconf) - if err != nil { - return nil, err - } - defer file.Close() - return ClientConfigFromReader(file) -} - -// ClientConfigFromReader works like ClientConfigFromFile but takes an io.Reader as argument -func ClientConfigFromReader(resolvconf io.Reader) (*ClientConfig, error) { - c := new(ClientConfig) - scanner := bufio.NewScanner(resolvconf) - c.Servers = make([]string, 0) - c.Search = make([]string, 0) - c.Port = "53" - c.Ndots = 1 - c.Timeout = 5 - c.Attempts = 2 - - for scanner.Scan() { - if err := scanner.Err(); err != nil { - return nil, err - } - line := scanner.Text() - f := strings.Fields(line) - if len(f) < 1 { - continue - } - switch f[0] { - case "nameserver": // add one name server - if len(f) > 1 { - // One more check: make sure server name is - // just an IP address. Otherwise we need DNS - // to look it up. - name := f[1] - c.Servers = append(c.Servers, name) - } - - case "domain": // set search path to just this domain - if len(f) > 1 { - c.Search = make([]string, 1) - c.Search[0] = f[1] - } else { - c.Search = make([]string, 0) - } - - case "search": // set search path to given servers - c.Search = append([]string(nil), f[1:]...) - - case "options": // magic options - for _, s := range f[1:] { - switch { - case len(s) >= 6 && s[:6] == "ndots:": - n, _ := strconv.Atoi(s[6:]) - if n < 0 { - n = 0 - } else if n > 15 { - n = 15 - } - c.Ndots = n - case len(s) >= 8 && s[:8] == "timeout:": - n, _ := strconv.Atoi(s[8:]) - if n < 1 { - n = 1 - } - c.Timeout = n - case len(s) >= 9 && s[:9] == "attempts:": - n, _ := strconv.Atoi(s[9:]) - if n < 1 { - n = 1 - } - c.Attempts = n - case s == "rotate": - /* not imp */ - } - } - } - } - return c, nil -} - -// NameList returns all of the names that should be queried based on the -// config. It is based off of go's net/dns name building, but it does not -// check the length of the resulting names. -func (c *ClientConfig) NameList(name string) []string { - // if this domain is already fully qualified, no append needed. - if IsFqdn(name) { - return []string{name} - } - - // Check to see if the name has more labels than Ndots. Do this before making - // the domain fully qualified. - hasNdots := CountLabel(name) > c.Ndots - // Make the domain fully qualified. - name = Fqdn(name) - - // Make a list of names based off search. - names := []string{} - - // If name has enough dots, try that first. - if hasNdots { - names = append(names, name) - } - for _, s := range c.Search { - names = append(names, Fqdn(name+s)) - } - // If we didn't have enough dots, try after suffixes. - if !hasNdots { - names = append(names, name) - } - return names -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/dane.go b/cluster-autoscaler/vendor/github.com/miekg/dns/dane.go deleted file mode 100644 index 8c4a14ef1906..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/dane.go +++ /dev/null @@ -1,43 +0,0 @@ -package dns - -import ( - "crypto/sha256" - "crypto/sha512" - "crypto/x509" - "encoding/hex" - "errors" -) - -// CertificateToDANE converts a certificate to a hex string as used in the TLSA or SMIMEA records. -func CertificateToDANE(selector, matchingType uint8, cert *x509.Certificate) (string, error) { - switch matchingType { - case 0: - switch selector { - case 0: - return hex.EncodeToString(cert.Raw), nil - case 1: - return hex.EncodeToString(cert.RawSubjectPublicKeyInfo), nil - } - case 1: - h := sha256.New() - switch selector { - case 0: - h.Write(cert.Raw) - return hex.EncodeToString(h.Sum(nil)), nil - case 1: - h.Write(cert.RawSubjectPublicKeyInfo) - return hex.EncodeToString(h.Sum(nil)), nil - } - case 2: - h := sha512.New() - switch selector { - case 0: - h.Write(cert.Raw) - return hex.EncodeToString(h.Sum(nil)), nil - case 1: - h.Write(cert.RawSubjectPublicKeyInfo) - return hex.EncodeToString(h.Sum(nil)), nil - } - } - return "", errors.New("dns: bad MatchingType or Selector") -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/defaults.go b/cluster-autoscaler/vendor/github.com/miekg/dns/defaults.go deleted file mode 100644 index d874e3008c21..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/defaults.go +++ /dev/null @@ -1,384 +0,0 @@ -package dns - -import ( - "errors" - "net" - "strconv" - "strings" -) - -const hexDigit = "0123456789abcdef" - -// Everything is assumed in ClassINET. - -// SetReply creates a reply message from a request message. -func (dns *Msg) SetReply(request *Msg) *Msg { - dns.Id = request.Id - dns.Response = true - dns.Opcode = request.Opcode - if dns.Opcode == OpcodeQuery { - dns.RecursionDesired = request.RecursionDesired // Copy rd bit - dns.CheckingDisabled = request.CheckingDisabled // Copy cd bit - } - dns.Rcode = RcodeSuccess - if len(request.Question) > 0 { - dns.Question = make([]Question, 1) - dns.Question[0] = request.Question[0] - } - return dns -} - -// SetQuestion creates a question message, it sets the Question -// section, generates an Id and sets the RecursionDesired (RD) -// bit to true. -func (dns *Msg) SetQuestion(z string, t uint16) *Msg { - dns.Id = Id() - dns.RecursionDesired = true - dns.Question = make([]Question, 1) - dns.Question[0] = Question{z, t, ClassINET} - return dns -} - -// SetNotify creates a notify message, it sets the Question -// section, generates an Id and sets the Authoritative (AA) -// bit to true. -func (dns *Msg) SetNotify(z string) *Msg { - dns.Opcode = OpcodeNotify - dns.Authoritative = true - dns.Id = Id() - dns.Question = make([]Question, 1) - dns.Question[0] = Question{z, TypeSOA, ClassINET} - return dns -} - -// SetRcode creates an error message suitable for the request. -func (dns *Msg) SetRcode(request *Msg, rcode int) *Msg { - dns.SetReply(request) - dns.Rcode = rcode - return dns -} - -// SetRcodeFormatError creates a message with FormError set. -func (dns *Msg) SetRcodeFormatError(request *Msg) *Msg { - dns.Rcode = RcodeFormatError - dns.Opcode = OpcodeQuery - dns.Response = true - dns.Authoritative = false - dns.Id = request.Id - return dns -} - -// SetUpdate makes the message a dynamic update message. It -// sets the ZONE section to: z, TypeSOA, ClassINET. -func (dns *Msg) SetUpdate(z string) *Msg { - dns.Id = Id() - dns.Response = false - dns.Opcode = OpcodeUpdate - dns.Compress = false // BIND9 cannot handle compression - dns.Question = make([]Question, 1) - dns.Question[0] = Question{z, TypeSOA, ClassINET} - return dns -} - -// SetIxfr creates message for requesting an IXFR. -func (dns *Msg) SetIxfr(z string, serial uint32, ns, mbox string) *Msg { - dns.Id = Id() - dns.Question = make([]Question, 1) - dns.Ns = make([]RR, 1) - s := new(SOA) - s.Hdr = RR_Header{z, TypeSOA, ClassINET, defaultTtl, 0} - s.Serial = serial - s.Ns = ns - s.Mbox = mbox - dns.Question[0] = Question{z, TypeIXFR, ClassINET} - dns.Ns[0] = s - return dns -} - -// SetAxfr creates message for requesting an AXFR. -func (dns *Msg) SetAxfr(z string) *Msg { - dns.Id = Id() - dns.Question = make([]Question, 1) - dns.Question[0] = Question{z, TypeAXFR, ClassINET} - return dns -} - -// SetTsig appends a TSIG RR to the message. -// This is only a skeleton TSIG RR that is added as the last RR in the -// additional section. The TSIG is calculated when the message is being send. -func (dns *Msg) SetTsig(z, algo string, fudge uint16, timesigned int64) *Msg { - t := new(TSIG) - t.Hdr = RR_Header{z, TypeTSIG, ClassANY, 0, 0} - t.Algorithm = algo - t.Fudge = fudge - t.TimeSigned = uint64(timesigned) - t.OrigId = dns.Id - dns.Extra = append(dns.Extra, t) - return dns -} - -// SetEdns0 appends a EDNS0 OPT RR to the message. -// TSIG should always the last RR in a message. -func (dns *Msg) SetEdns0(udpsize uint16, do bool) *Msg { - e := new(OPT) - e.Hdr.Name = "." - e.Hdr.Rrtype = TypeOPT - e.SetUDPSize(udpsize) - if do { - e.SetDo() - } - dns.Extra = append(dns.Extra, e) - return dns -} - -// IsTsig checks if the message has a TSIG record as the last record -// in the additional section. It returns the TSIG record found or nil. -func (dns *Msg) IsTsig() *TSIG { - if len(dns.Extra) > 0 { - if dns.Extra[len(dns.Extra)-1].Header().Rrtype == TypeTSIG { - return dns.Extra[len(dns.Extra)-1].(*TSIG) - } - } - return nil -} - -// IsEdns0 checks if the message has a EDNS0 (OPT) record, any EDNS0 -// record in the additional section will do. It returns the OPT record -// found or nil. -func (dns *Msg) IsEdns0() *OPT { - // RFC 6891, Section 6.1.1 allows the OPT record to appear - // anywhere in the additional record section, but it's usually at - // the end so start there. - for i := len(dns.Extra) - 1; i >= 0; i-- { - if dns.Extra[i].Header().Rrtype == TypeOPT { - return dns.Extra[i].(*OPT) - } - } - return nil -} - -// popEdns0 is like IsEdns0, but it removes the record from the message. -func (dns *Msg) popEdns0() *OPT { - // RFC 6891, Section 6.1.1 allows the OPT record to appear - // anywhere in the additional record section, but it's usually at - // the end so start there. - for i := len(dns.Extra) - 1; i >= 0; i-- { - if dns.Extra[i].Header().Rrtype == TypeOPT { - opt := dns.Extra[i].(*OPT) - dns.Extra = append(dns.Extra[:i], dns.Extra[i+1:]...) - return opt - } - } - return nil -} - -// IsDomainName checks if s is a valid domain name, it returns the number of -// labels and true, when a domain name is valid. Note that non fully qualified -// domain name is considered valid, in this case the last label is counted in -// the number of labels. When false is returned the number of labels is not -// defined. Also note that this function is extremely liberal; almost any -// string is a valid domain name as the DNS is 8 bit protocol. It checks if each -// label fits in 63 characters and that the entire name will fit into the 255 -// octet wire format limit. -func IsDomainName(s string) (labels int, ok bool) { - // XXX: The logic in this function was copied from packDomainName and - // should be kept in sync with that function. - - const lenmsg = 256 - - if len(s) == 0 { // Ok, for instance when dealing with update RR without any rdata. - return 0, false - } - - s = Fqdn(s) - - // Each dot ends a segment of the name. Except for escaped dots (\.), which - // are normal dots. - - var ( - off int - begin int - wasDot bool - ) - for i := 0; i < len(s); i++ { - switch s[i] { - case '\\': - if off+1 > lenmsg { - return labels, false - } - - // check for \DDD - if i+3 < len(s) && isDigit(s[i+1]) && isDigit(s[i+2]) && isDigit(s[i+3]) { - i += 3 - begin += 3 - } else { - i++ - begin++ - } - - wasDot = false - case '.': - if wasDot { - // two dots back to back is not legal - return labels, false - } - wasDot = true - - labelLen := i - begin - if labelLen >= 1<<6 { // top two bits of length must be clear - return labels, false - } - - // off can already (we're in a loop) be bigger than lenmsg - // this happens when a name isn't fully qualified - off += 1 + labelLen - if off > lenmsg { - return labels, false - } - - labels++ - begin = i + 1 - default: - wasDot = false - } - } - - return labels, true -} - -// IsSubDomain checks if child is indeed a child of the parent. If child and parent -// are the same domain true is returned as well. -func IsSubDomain(parent, child string) bool { - // Entire child is contained in parent - return CompareDomainName(parent, child) == CountLabel(parent) -} - -// IsMsg sanity checks buf and returns an error if it isn't a valid DNS packet. -// The checking is performed on the binary payload. -func IsMsg(buf []byte) error { - // Header - if len(buf) < headerSize { - return errors.New("dns: bad message header") - } - // Header: Opcode - // TODO(miek): more checks here, e.g. check all header bits. - return nil -} - -// IsFqdn checks if a domain name is fully qualified. -func IsFqdn(s string) bool { - s2 := strings.TrimSuffix(s, ".") - if s == s2 { - return false - } - - i := strings.LastIndexFunc(s2, func(r rune) bool { - return r != '\\' - }) - - // Test whether we have an even number of escape sequences before - // the dot or none. - return (len(s2)-i)%2 != 0 -} - -// IsRRset checks if a set of RRs is a valid RRset as defined by RFC 2181. -// This means the RRs need to have the same type, name, and class. Returns true -// if the RR set is valid, otherwise false. -func IsRRset(rrset []RR) bool { - if len(rrset) == 0 { - return false - } - if len(rrset) == 1 { - return true - } - rrHeader := rrset[0].Header() - rrType := rrHeader.Rrtype - rrClass := rrHeader.Class - rrName := rrHeader.Name - - for _, rr := range rrset[1:] { - curRRHeader := rr.Header() - if curRRHeader.Rrtype != rrType || curRRHeader.Class != rrClass || curRRHeader.Name != rrName { - // Mismatch between the records, so this is not a valid rrset for - //signing/verifying - return false - } - } - - return true -} - -// Fqdn return the fully qualified domain name from s. -// If s is already fully qualified, it behaves as the identity function. -func Fqdn(s string) string { - if IsFqdn(s) { - return s - } - return s + "." -} - -// CanonicalName returns the domain name in canonical form. A name in canonical -// form is lowercase and fully qualified. See Section 6.2 in RFC 4034. -func CanonicalName(s string) string { - return strings.ToLower(Fqdn(s)) -} - -// Copied from the official Go code. - -// ReverseAddr returns the in-addr.arpa. or ip6.arpa. hostname of the IP -// address suitable for reverse DNS (PTR) record lookups or an error if it fails -// to parse the IP address. -func ReverseAddr(addr string) (arpa string, err error) { - ip := net.ParseIP(addr) - if ip == nil { - return "", &Error{err: "unrecognized address: " + addr} - } - if v4 := ip.To4(); v4 != nil { - buf := make([]byte, 0, net.IPv4len*4+len("in-addr.arpa.")) - // Add it, in reverse, to the buffer - for i := len(v4) - 1; i >= 0; i-- { - buf = strconv.AppendInt(buf, int64(v4[i]), 10) - buf = append(buf, '.') - } - // Append "in-addr.arpa." and return (buf already has the final .) - buf = append(buf, "in-addr.arpa."...) - return string(buf), nil - } - // Must be IPv6 - buf := make([]byte, 0, net.IPv6len*4+len("ip6.arpa.")) - // Add it, in reverse, to the buffer - for i := len(ip) - 1; i >= 0; i-- { - v := ip[i] - buf = append(buf, hexDigit[v&0xF]) - buf = append(buf, '.') - buf = append(buf, hexDigit[v>>4]) - buf = append(buf, '.') - } - // Append "ip6.arpa." and return (buf already has the final .) - buf = append(buf, "ip6.arpa."...) - return string(buf), nil -} - -// String returns the string representation for the type t. -func (t Type) String() string { - if t1, ok := TypeToString[uint16(t)]; ok { - return t1 - } - return "TYPE" + strconv.Itoa(int(t)) -} - -// String returns the string representation for the class c. -func (c Class) String() string { - if s, ok := ClassToString[uint16(c)]; ok { - // Only emit mnemonics when they are unambiguous, specially ANY is in both. - if _, ok := StringToType[s]; !ok { - return s - } - } - return "CLASS" + strconv.Itoa(int(c)) -} - -// String returns the string representation for the name n. -func (n Name) String() string { - return sprintName(string(n)) -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/dns.go b/cluster-autoscaler/vendor/github.com/miekg/dns/dns.go deleted file mode 100644 index ad83a27ecfab..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/dns.go +++ /dev/null @@ -1,134 +0,0 @@ -package dns - -import "strconv" - -const ( - year68 = 1 << 31 // For RFC1982 (Serial Arithmetic) calculations in 32 bits. - defaultTtl = 3600 // Default internal TTL. - - // DefaultMsgSize is the standard default for messages larger than 512 bytes. - DefaultMsgSize = 4096 - // MinMsgSize is the minimal size of a DNS packet. - MinMsgSize = 512 - // MaxMsgSize is the largest possible DNS packet. - MaxMsgSize = 65535 -) - -// Error represents a DNS error. -type Error struct{ err string } - -func (e *Error) Error() string { - if e == nil { - return "dns: " - } - return "dns: " + e.err -} - -// An RR represents a resource record. -type RR interface { - // Header returns the header of an resource record. The header contains - // everything up to the rdata. - Header() *RR_Header - // String returns the text representation of the resource record. - String() string - - // copy returns a copy of the RR - copy() RR - - // len returns the length (in octets) of the compressed or uncompressed RR in wire format. - // - // If compression is nil, the uncompressed size will be returned, otherwise the compressed - // size will be returned and domain names will be added to the map for future compression. - len(off int, compression map[string]struct{}) int - - // pack packs the records RDATA into wire format. The header will - // already have been packed into msg. - pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) - - // unpack unpacks an RR from wire format. - // - // This will only be called on a new and empty RR type with only the header populated. It - // will only be called if the record's RDATA is non-empty. - unpack(msg []byte, off int) (off1 int, err error) - - // parse parses an RR from zone file format. - // - // This will only be called on a new and empty RR type with only the header populated. - parse(c *zlexer, origin string) *ParseError - - // isDuplicate returns whether the two RRs are duplicates. - isDuplicate(r2 RR) bool -} - -// RR_Header is the header all DNS resource records share. -type RR_Header struct { - Name string `dns:"cdomain-name"` - Rrtype uint16 - Class uint16 - Ttl uint32 - Rdlength uint16 // Length of data after header. -} - -// Header returns itself. This is here to make RR_Header implements the RR interface. -func (h *RR_Header) Header() *RR_Header { return h } - -// Just to implement the RR interface. -func (h *RR_Header) copy() RR { return nil } - -func (h *RR_Header) String() string { - var s string - - if h.Rrtype == TypeOPT { - s = ";" - // and maybe other things - } - - s += sprintName(h.Name) + "\t" - s += strconv.FormatInt(int64(h.Ttl), 10) + "\t" - s += Class(h.Class).String() + "\t" - s += Type(h.Rrtype).String() + "\t" - return s -} - -func (h *RR_Header) len(off int, compression map[string]struct{}) int { - l := domainNameLen(h.Name, off, compression, true) - l += 10 // rrtype(2) + class(2) + ttl(4) + rdlength(2) - return l -} - -func (h *RR_Header) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - // RR_Header has no RDATA to pack. - return off, nil -} - -func (h *RR_Header) unpack(msg []byte, off int) (int, error) { - panic("dns: internal error: unpack should never be called on RR_Header") -} - -func (h *RR_Header) parse(c *zlexer, origin string) *ParseError { - panic("dns: internal error: parse should never be called on RR_Header") -} - -// ToRFC3597 converts a known RR to the unknown RR representation from RFC 3597. -func (rr *RFC3597) ToRFC3597(r RR) error { - buf := make([]byte, Len(r)*2) - headerEnd, off, err := packRR(r, buf, 0, compressionMap{}, false) - if err != nil { - return err - } - buf = buf[:off] - - *rr = RFC3597{Hdr: *r.Header()} - rr.Hdr.Rdlength = uint16(off - headerEnd) - - if noRdata(rr.Hdr) { - return nil - } - - _, err = rr.unpack(buf, headerEnd) - if err != nil { - return err - } - - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec.go b/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec.go deleted file mode 100644 index 900f6e059d89..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec.go +++ /dev/null @@ -1,758 +0,0 @@ -package dns - -import ( - "bytes" - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - _ "crypto/sha1" - _ "crypto/sha256" - _ "crypto/sha512" - "encoding/asn1" - "encoding/binary" - "encoding/hex" - "math/big" - "sort" - "strings" - "time" - - "golang.org/x/crypto/ed25519" -) - -// DNSSEC encryption algorithm codes. -const ( - _ uint8 = iota - RSAMD5 - DH - DSA - _ // Skip 4, RFC 6725, section 2.1 - RSASHA1 - DSANSEC3SHA1 - RSASHA1NSEC3SHA1 - RSASHA256 - _ // Skip 9, RFC 6725, section 2.1 - RSASHA512 - _ // Skip 11, RFC 6725, section 2.1 - ECCGOST - ECDSAP256SHA256 - ECDSAP384SHA384 - ED25519 - ED448 - INDIRECT uint8 = 252 - PRIVATEDNS uint8 = 253 // Private (experimental keys) - PRIVATEOID uint8 = 254 -) - -// AlgorithmToString is a map of algorithm IDs to algorithm names. -var AlgorithmToString = map[uint8]string{ - RSAMD5: "RSAMD5", - DH: "DH", - DSA: "DSA", - RSASHA1: "RSASHA1", - DSANSEC3SHA1: "DSA-NSEC3-SHA1", - RSASHA1NSEC3SHA1: "RSASHA1-NSEC3-SHA1", - RSASHA256: "RSASHA256", - RSASHA512: "RSASHA512", - ECCGOST: "ECC-GOST", - ECDSAP256SHA256: "ECDSAP256SHA256", - ECDSAP384SHA384: "ECDSAP384SHA384", - ED25519: "ED25519", - ED448: "ED448", - INDIRECT: "INDIRECT", - PRIVATEDNS: "PRIVATEDNS", - PRIVATEOID: "PRIVATEOID", -} - -// AlgorithmToHash is a map of algorithm crypto hash IDs to crypto.Hash's. -var AlgorithmToHash = map[uint8]crypto.Hash{ - RSAMD5: crypto.MD5, // Deprecated in RFC 6725 - DSA: crypto.SHA1, - RSASHA1: crypto.SHA1, - RSASHA1NSEC3SHA1: crypto.SHA1, - RSASHA256: crypto.SHA256, - ECDSAP256SHA256: crypto.SHA256, - ECDSAP384SHA384: crypto.SHA384, - RSASHA512: crypto.SHA512, - ED25519: crypto.Hash(0), -} - -// DNSSEC hashing algorithm codes. -const ( - _ uint8 = iota - SHA1 // RFC 4034 - SHA256 // RFC 4509 - GOST94 // RFC 5933 - SHA384 // Experimental - SHA512 // Experimental -) - -// HashToString is a map of hash IDs to names. -var HashToString = map[uint8]string{ - SHA1: "SHA1", - SHA256: "SHA256", - GOST94: "GOST94", - SHA384: "SHA384", - SHA512: "SHA512", -} - -// DNSKEY flag values. -const ( - SEP = 1 - REVOKE = 1 << 7 - ZONE = 1 << 8 -) - -// The RRSIG needs to be converted to wireformat with some of the rdata (the signature) missing. -type rrsigWireFmt struct { - TypeCovered uint16 - Algorithm uint8 - Labels uint8 - OrigTtl uint32 - Expiration uint32 - Inception uint32 - KeyTag uint16 - SignerName string `dns:"domain-name"` - /* No Signature */ -} - -// Used for converting DNSKEY's rdata to wirefmt. -type dnskeyWireFmt struct { - Flags uint16 - Protocol uint8 - Algorithm uint8 - PublicKey string `dns:"base64"` - /* Nothing is left out */ -} - -func divRoundUp(a, b int) int { - return (a + b - 1) / b -} - -// KeyTag calculates the keytag (or key-id) of the DNSKEY. -func (k *DNSKEY) KeyTag() uint16 { - if k == nil { - return 0 - } - var keytag int - switch k.Algorithm { - case RSAMD5: - // Look at the bottom two bytes of the modules, which the last - // item in the pubkey. - // This algorithm has been deprecated, but keep this key-tag calculation. - modulus, _ := fromBase64([]byte(k.PublicKey)) - if len(modulus) > 1 { - x := binary.BigEndian.Uint16(modulus[len(modulus)-2:]) - keytag = int(x) - } - default: - keywire := new(dnskeyWireFmt) - keywire.Flags = k.Flags - keywire.Protocol = k.Protocol - keywire.Algorithm = k.Algorithm - keywire.PublicKey = k.PublicKey - wire := make([]byte, DefaultMsgSize) - n, err := packKeyWire(keywire, wire) - if err != nil { - return 0 - } - wire = wire[:n] - for i, v := range wire { - if i&1 != 0 { - keytag += int(v) // must be larger than uint32 - } else { - keytag += int(v) << 8 - } - } - keytag += keytag >> 16 & 0xFFFF - keytag &= 0xFFFF - } - return uint16(keytag) -} - -// ToDS converts a DNSKEY record to a DS record. -func (k *DNSKEY) ToDS(h uint8) *DS { - if k == nil { - return nil - } - ds := new(DS) - ds.Hdr.Name = k.Hdr.Name - ds.Hdr.Class = k.Hdr.Class - ds.Hdr.Rrtype = TypeDS - ds.Hdr.Ttl = k.Hdr.Ttl - ds.Algorithm = k.Algorithm - ds.DigestType = h - ds.KeyTag = k.KeyTag() - - keywire := new(dnskeyWireFmt) - keywire.Flags = k.Flags - keywire.Protocol = k.Protocol - keywire.Algorithm = k.Algorithm - keywire.PublicKey = k.PublicKey - wire := make([]byte, DefaultMsgSize) - n, err := packKeyWire(keywire, wire) - if err != nil { - return nil - } - wire = wire[:n] - - owner := make([]byte, 255) - off, err1 := PackDomainName(CanonicalName(k.Hdr.Name), owner, 0, nil, false) - if err1 != nil { - return nil - } - owner = owner[:off] - // RFC4034: - // digest = digest_algorithm( DNSKEY owner name | DNSKEY RDATA); - // "|" denotes concatenation - // DNSKEY RDATA = Flags | Protocol | Algorithm | Public Key. - - var hash crypto.Hash - switch h { - case SHA1: - hash = crypto.SHA1 - case SHA256: - hash = crypto.SHA256 - case SHA384: - hash = crypto.SHA384 - case SHA512: - hash = crypto.SHA512 - default: - return nil - } - - s := hash.New() - s.Write(owner) - s.Write(wire) - ds.Digest = hex.EncodeToString(s.Sum(nil)) - return ds -} - -// ToCDNSKEY converts a DNSKEY record to a CDNSKEY record. -func (k *DNSKEY) ToCDNSKEY() *CDNSKEY { - c := &CDNSKEY{DNSKEY: *k} - c.Hdr = k.Hdr - c.Hdr.Rrtype = TypeCDNSKEY - return c -} - -// ToCDS converts a DS record to a CDS record. -func (d *DS) ToCDS() *CDS { - c := &CDS{DS: *d} - c.Hdr = d.Hdr - c.Hdr.Rrtype = TypeCDS - return c -} - -// Sign signs an RRSet. The signature needs to be filled in with the values: -// Inception, Expiration, KeyTag, SignerName and Algorithm. The rest is copied -// from the RRset. Sign returns a non-nill error when the signing went OK. -// There is no check if RRSet is a proper (RFC 2181) RRSet. If OrigTTL is non -// zero, it is used as-is, otherwise the TTL of the RRset is used as the -// OrigTTL. -func (rr *RRSIG) Sign(k crypto.Signer, rrset []RR) error { - if k == nil { - return ErrPrivKey - } - // s.Inception and s.Expiration may be 0 (rollover etc.), the rest must be set - if rr.KeyTag == 0 || len(rr.SignerName) == 0 || rr.Algorithm == 0 { - return ErrKey - } - - h0 := rrset[0].Header() - rr.Hdr.Rrtype = TypeRRSIG - rr.Hdr.Name = h0.Name - rr.Hdr.Class = h0.Class - if rr.OrigTtl == 0 { // If set don't override - rr.OrigTtl = h0.Ttl - } - rr.TypeCovered = h0.Rrtype - rr.Labels = uint8(CountLabel(h0.Name)) - - if strings.HasPrefix(h0.Name, "*") { - rr.Labels-- // wildcard, remove from label count - } - - sigwire := new(rrsigWireFmt) - sigwire.TypeCovered = rr.TypeCovered - sigwire.Algorithm = rr.Algorithm - sigwire.Labels = rr.Labels - sigwire.OrigTtl = rr.OrigTtl - sigwire.Expiration = rr.Expiration - sigwire.Inception = rr.Inception - sigwire.KeyTag = rr.KeyTag - // For signing, lowercase this name - sigwire.SignerName = CanonicalName(rr.SignerName) - - // Create the desired binary blob - signdata := make([]byte, DefaultMsgSize) - n, err := packSigWire(sigwire, signdata) - if err != nil { - return err - } - signdata = signdata[:n] - wire, err := rawSignatureData(rrset, rr) - if err != nil { - return err - } - - hash, ok := AlgorithmToHash[rr.Algorithm] - if !ok { - return ErrAlg - } - - switch rr.Algorithm { - case ED25519: - // ed25519 signs the raw message and performs hashing internally. - // All other supported signature schemes operate over the pre-hashed - // message, and thus ed25519 must be handled separately here. - // - // The raw message is passed directly into sign and crypto.Hash(0) is - // used to signal to the crypto.Signer that the data has not been hashed. - signature, err := sign(k, append(signdata, wire...), crypto.Hash(0), rr.Algorithm) - if err != nil { - return err - } - - rr.Signature = toBase64(signature) - return nil - case RSAMD5, DSA, DSANSEC3SHA1: - // See RFC 6944. - return ErrAlg - default: - h := hash.New() - h.Write(signdata) - h.Write(wire) - - signature, err := sign(k, h.Sum(nil), hash, rr.Algorithm) - if err != nil { - return err - } - - rr.Signature = toBase64(signature) - return nil - } -} - -func sign(k crypto.Signer, hashed []byte, hash crypto.Hash, alg uint8) ([]byte, error) { - signature, err := k.Sign(rand.Reader, hashed, hash) - if err != nil { - return nil, err - } - - switch alg { - case RSASHA1, RSASHA1NSEC3SHA1, RSASHA256, RSASHA512: - return signature, nil - case ECDSAP256SHA256, ECDSAP384SHA384: - ecdsaSignature := &struct { - R, S *big.Int - }{} - if _, err := asn1.Unmarshal(signature, ecdsaSignature); err != nil { - return nil, err - } - - var intlen int - switch alg { - case ECDSAP256SHA256: - intlen = 32 - case ECDSAP384SHA384: - intlen = 48 - } - - signature := intToBytes(ecdsaSignature.R, intlen) - signature = append(signature, intToBytes(ecdsaSignature.S, intlen)...) - return signature, nil - case ED25519: - return signature, nil - default: - return nil, ErrAlg - } -} - -// Verify validates an RRSet with the signature and key. This is only the -// cryptographic test, the signature validity period must be checked separately. -// This function copies the rdata of some RRs (to lowercase domain names) for the validation to work. -func (rr *RRSIG) Verify(k *DNSKEY, rrset []RR) error { - // First the easy checks - if !IsRRset(rrset) { - return ErrRRset - } - if rr.KeyTag != k.KeyTag() { - return ErrKey - } - if rr.Hdr.Class != k.Hdr.Class { - return ErrKey - } - if rr.Algorithm != k.Algorithm { - return ErrKey - } - if !strings.EqualFold(rr.SignerName, k.Hdr.Name) { - return ErrKey - } - if k.Protocol != 3 { - return ErrKey - } - - // IsRRset checked that we have at least one RR and that the RRs in - // the set have consistent type, class, and name. Also check that type and - // class matches the RRSIG record. - if h0 := rrset[0].Header(); h0.Class != rr.Hdr.Class || h0.Rrtype != rr.TypeCovered { - return ErrRRset - } - - // RFC 4035 5.3.2. Reconstructing the Signed Data - // Copy the sig, except the rrsig data - sigwire := new(rrsigWireFmt) - sigwire.TypeCovered = rr.TypeCovered - sigwire.Algorithm = rr.Algorithm - sigwire.Labels = rr.Labels - sigwire.OrigTtl = rr.OrigTtl - sigwire.Expiration = rr.Expiration - sigwire.Inception = rr.Inception - sigwire.KeyTag = rr.KeyTag - sigwire.SignerName = CanonicalName(rr.SignerName) - // Create the desired binary blob - signeddata := make([]byte, DefaultMsgSize) - n, err := packSigWire(sigwire, signeddata) - if err != nil { - return err - } - signeddata = signeddata[:n] - wire, err := rawSignatureData(rrset, rr) - if err != nil { - return err - } - - sigbuf := rr.sigBuf() // Get the binary signature data - if rr.Algorithm == PRIVATEDNS { // PRIVATEOID - // TODO(miek) - // remove the domain name and assume its ours? - } - - hash, ok := AlgorithmToHash[rr.Algorithm] - if !ok { - return ErrAlg - } - - switch rr.Algorithm { - case RSASHA1, RSASHA1NSEC3SHA1, RSASHA256, RSASHA512: - // TODO(mg): this can be done quicker, ie. cache the pubkey data somewhere?? - pubkey := k.publicKeyRSA() // Get the key - if pubkey == nil { - return ErrKey - } - - h := hash.New() - h.Write(signeddata) - h.Write(wire) - return rsa.VerifyPKCS1v15(pubkey, hash, h.Sum(nil), sigbuf) - - case ECDSAP256SHA256, ECDSAP384SHA384: - pubkey := k.publicKeyECDSA() - if pubkey == nil { - return ErrKey - } - - // Split sigbuf into the r and s coordinates - r := new(big.Int).SetBytes(sigbuf[:len(sigbuf)/2]) - s := new(big.Int).SetBytes(sigbuf[len(sigbuf)/2:]) - - h := hash.New() - h.Write(signeddata) - h.Write(wire) - if ecdsa.Verify(pubkey, h.Sum(nil), r, s) { - return nil - } - return ErrSig - - case ED25519: - pubkey := k.publicKeyED25519() - if pubkey == nil { - return ErrKey - } - - if ed25519.Verify(pubkey, append(signeddata, wire...), sigbuf) { - return nil - } - return ErrSig - - default: - return ErrAlg - } -} - -// ValidityPeriod uses RFC1982 serial arithmetic to calculate -// if a signature period is valid. If t is the zero time, the -// current time is taken other t is. Returns true if the signature -// is valid at the given time, otherwise returns false. -func (rr *RRSIG) ValidityPeriod(t time.Time) bool { - var utc int64 - if t.IsZero() { - utc = time.Now().UTC().Unix() - } else { - utc = t.UTC().Unix() - } - modi := (int64(rr.Inception) - utc) / year68 - mode := (int64(rr.Expiration) - utc) / year68 - ti := int64(rr.Inception) + modi*year68 - te := int64(rr.Expiration) + mode*year68 - return ti <= utc && utc <= te -} - -// Return the signatures base64 encodedig sigdata as a byte slice. -func (rr *RRSIG) sigBuf() []byte { - sigbuf, err := fromBase64([]byte(rr.Signature)) - if err != nil { - return nil - } - return sigbuf -} - -// publicKeyRSA returns the RSA public key from a DNSKEY record. -func (k *DNSKEY) publicKeyRSA() *rsa.PublicKey { - keybuf, err := fromBase64([]byte(k.PublicKey)) - if err != nil { - return nil - } - - if len(keybuf) < 1+1+64 { - // Exponent must be at least 1 byte and modulus at least 64 - return nil - } - - // RFC 2537/3110, section 2. RSA Public KEY Resource Records - // Length is in the 0th byte, unless its zero, then it - // it in bytes 1 and 2 and its a 16 bit number - explen := uint16(keybuf[0]) - keyoff := 1 - if explen == 0 { - explen = uint16(keybuf[1])<<8 | uint16(keybuf[2]) - keyoff = 3 - } - - if explen > 4 || explen == 0 || keybuf[keyoff] == 0 { - // Exponent larger than supported by the crypto package, - // empty, or contains prohibited leading zero. - return nil - } - - modoff := keyoff + int(explen) - modlen := len(keybuf) - modoff - if modlen < 64 || modlen > 512 || keybuf[modoff] == 0 { - // Modulus is too small, large, or contains prohibited leading zero. - return nil - } - - pubkey := new(rsa.PublicKey) - - var expo uint64 - // The exponent of length explen is between keyoff and modoff. - for _, v := range keybuf[keyoff:modoff] { - expo <<= 8 - expo |= uint64(v) - } - if expo > 1<<31-1 { - // Larger exponent than supported by the crypto package. - return nil - } - - pubkey.E = int(expo) - pubkey.N = new(big.Int).SetBytes(keybuf[modoff:]) - return pubkey -} - -// publicKeyECDSA returns the Curve public key from the DNSKEY record. -func (k *DNSKEY) publicKeyECDSA() *ecdsa.PublicKey { - keybuf, err := fromBase64([]byte(k.PublicKey)) - if err != nil { - return nil - } - pubkey := new(ecdsa.PublicKey) - switch k.Algorithm { - case ECDSAP256SHA256: - pubkey.Curve = elliptic.P256() - if len(keybuf) != 64 { - // wrongly encoded key - return nil - } - case ECDSAP384SHA384: - pubkey.Curve = elliptic.P384() - if len(keybuf) != 96 { - // Wrongly encoded key - return nil - } - } - pubkey.X = new(big.Int).SetBytes(keybuf[:len(keybuf)/2]) - pubkey.Y = new(big.Int).SetBytes(keybuf[len(keybuf)/2:]) - return pubkey -} - -func (k *DNSKEY) publicKeyED25519() ed25519.PublicKey { - keybuf, err := fromBase64([]byte(k.PublicKey)) - if err != nil { - return nil - } - if len(keybuf) != ed25519.PublicKeySize { - return nil - } - return keybuf -} - -type wireSlice [][]byte - -func (p wireSlice) Len() int { return len(p) } -func (p wireSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } -func (p wireSlice) Less(i, j int) bool { - _, ioff, _ := UnpackDomainName(p[i], 0) - _, joff, _ := UnpackDomainName(p[j], 0) - return bytes.Compare(p[i][ioff+10:], p[j][joff+10:]) < 0 -} - -// Return the raw signature data. -func rawSignatureData(rrset []RR, s *RRSIG) (buf []byte, err error) { - wires := make(wireSlice, len(rrset)) - for i, r := range rrset { - r1 := r.copy() - h := r1.Header() - h.Ttl = s.OrigTtl - labels := SplitDomainName(h.Name) - // 6.2. Canonical RR Form. (4) - wildcards - if len(labels) > int(s.Labels) { - // Wildcard - h.Name = "*." + strings.Join(labels[len(labels)-int(s.Labels):], ".") + "." - } - // RFC 4034: 6.2. Canonical RR Form. (2) - domain name to lowercase - h.Name = CanonicalName(h.Name) - // 6.2. Canonical RR Form. (3) - domain rdata to lowercase. - // NS, MD, MF, CNAME, SOA, MB, MG, MR, PTR, - // HINFO, MINFO, MX, RP, AFSDB, RT, SIG, PX, NXT, NAPTR, KX, - // SRV, DNAME, A6 - // - // RFC 6840 - Clarifications and Implementation Notes for DNS Security (DNSSEC): - // Section 6.2 of [RFC4034] also erroneously lists HINFO as a record - // that needs conversion to lowercase, and twice at that. Since HINFO - // records contain no domain names, they are not subject to case - // conversion. - switch x := r1.(type) { - case *NS: - x.Ns = CanonicalName(x.Ns) - case *MD: - x.Md = CanonicalName(x.Md) - case *MF: - x.Mf = CanonicalName(x.Mf) - case *CNAME: - x.Target = CanonicalName(x.Target) - case *SOA: - x.Ns = CanonicalName(x.Ns) - x.Mbox = CanonicalName(x.Mbox) - case *MB: - x.Mb = CanonicalName(x.Mb) - case *MG: - x.Mg = CanonicalName(x.Mg) - case *MR: - x.Mr = CanonicalName(x.Mr) - case *PTR: - x.Ptr = CanonicalName(x.Ptr) - case *MINFO: - x.Rmail = CanonicalName(x.Rmail) - x.Email = CanonicalName(x.Email) - case *MX: - x.Mx = CanonicalName(x.Mx) - case *RP: - x.Mbox = CanonicalName(x.Mbox) - x.Txt = CanonicalName(x.Txt) - case *AFSDB: - x.Hostname = CanonicalName(x.Hostname) - case *RT: - x.Host = CanonicalName(x.Host) - case *SIG: - x.SignerName = CanonicalName(x.SignerName) - case *PX: - x.Map822 = CanonicalName(x.Map822) - x.Mapx400 = CanonicalName(x.Mapx400) - case *NAPTR: - x.Replacement = CanonicalName(x.Replacement) - case *KX: - x.Exchanger = CanonicalName(x.Exchanger) - case *SRV: - x.Target = CanonicalName(x.Target) - case *DNAME: - x.Target = CanonicalName(x.Target) - } - // 6.2. Canonical RR Form. (5) - origTTL - wire := make([]byte, Len(r1)+1) // +1 to be safe(r) - off, err1 := PackRR(r1, wire, 0, nil, false) - if err1 != nil { - return nil, err1 - } - wire = wire[:off] - wires[i] = wire - } - sort.Sort(wires) - for i, wire := range wires { - if i > 0 && bytes.Equal(wire, wires[i-1]) { - continue - } - buf = append(buf, wire...) - } - return buf, nil -} - -func packSigWire(sw *rrsigWireFmt, msg []byte) (int, error) { - // copied from zmsg.go RRSIG packing - off, err := packUint16(sw.TypeCovered, msg, 0) - if err != nil { - return off, err - } - off, err = packUint8(sw.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(sw.Labels, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(sw.OrigTtl, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(sw.Expiration, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(sw.Inception, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(sw.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = PackDomainName(sw.SignerName, msg, off, nil, false) - if err != nil { - return off, err - } - return off, nil -} - -func packKeyWire(dw *dnskeyWireFmt, msg []byte) (int, error) { - // copied from zmsg.go DNSKEY packing - off, err := packUint16(dw.Flags, msg, 0) - if err != nil { - return off, err - } - off, err = packUint8(dw.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(dw.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(dw.PublicKey, msg, off) - if err != nil { - return off, err - } - return off, nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_keygen.go b/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_keygen.go deleted file mode 100644 index 2ab7b6d73b80..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_keygen.go +++ /dev/null @@ -1,140 +0,0 @@ -package dns - -import ( - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - "math/big" - - "golang.org/x/crypto/ed25519" -) - -// Generate generates a DNSKEY of the given bit size. -// The public part is put inside the DNSKEY record. -// The Algorithm in the key must be set as this will define -// what kind of DNSKEY will be generated. -// The ECDSA algorithms imply a fixed keysize, in that case -// bits should be set to the size of the algorithm. -func (k *DNSKEY) Generate(bits int) (crypto.PrivateKey, error) { - switch k.Algorithm { - case RSASHA1, RSASHA256, RSASHA1NSEC3SHA1: - if bits < 512 || bits > 4096 { - return nil, ErrKeySize - } - case RSASHA512: - if bits < 1024 || bits > 4096 { - return nil, ErrKeySize - } - case ECDSAP256SHA256: - if bits != 256 { - return nil, ErrKeySize - } - case ECDSAP384SHA384: - if bits != 384 { - return nil, ErrKeySize - } - case ED25519: - if bits != 256 { - return nil, ErrKeySize - } - default: - return nil, ErrAlg - } - - switch k.Algorithm { - case RSASHA1, RSASHA256, RSASHA512, RSASHA1NSEC3SHA1: - priv, err := rsa.GenerateKey(rand.Reader, bits) - if err != nil { - return nil, err - } - k.setPublicKeyRSA(priv.PublicKey.E, priv.PublicKey.N) - return priv, nil - case ECDSAP256SHA256, ECDSAP384SHA384: - var c elliptic.Curve - switch k.Algorithm { - case ECDSAP256SHA256: - c = elliptic.P256() - case ECDSAP384SHA384: - c = elliptic.P384() - } - priv, err := ecdsa.GenerateKey(c, rand.Reader) - if err != nil { - return nil, err - } - k.setPublicKeyECDSA(priv.PublicKey.X, priv.PublicKey.Y) - return priv, nil - case ED25519: - pub, priv, err := ed25519.GenerateKey(rand.Reader) - if err != nil { - return nil, err - } - k.setPublicKeyED25519(pub) - return priv, nil - default: - return nil, ErrAlg - } -} - -// Set the public key (the value E and N) -func (k *DNSKEY) setPublicKeyRSA(_E int, _N *big.Int) bool { - if _E == 0 || _N == nil { - return false - } - buf := exponentToBuf(_E) - buf = append(buf, _N.Bytes()...) - k.PublicKey = toBase64(buf) - return true -} - -// Set the public key for Elliptic Curves -func (k *DNSKEY) setPublicKeyECDSA(_X, _Y *big.Int) bool { - if _X == nil || _Y == nil { - return false - } - var intlen int - switch k.Algorithm { - case ECDSAP256SHA256: - intlen = 32 - case ECDSAP384SHA384: - intlen = 48 - } - k.PublicKey = toBase64(curveToBuf(_X, _Y, intlen)) - return true -} - -// Set the public key for Ed25519 -func (k *DNSKEY) setPublicKeyED25519(_K ed25519.PublicKey) bool { - if _K == nil { - return false - } - k.PublicKey = toBase64(_K) - return true -} - -// Set the public key (the values E and N) for RSA -// RFC 3110: Section 2. RSA Public KEY Resource Records -func exponentToBuf(_E int) []byte { - var buf []byte - i := big.NewInt(int64(_E)).Bytes() - if len(i) < 256 { - buf = make([]byte, 1, 1+len(i)) - buf[0] = uint8(len(i)) - } else { - buf = make([]byte, 3, 3+len(i)) - buf[0] = 0 - buf[1] = uint8(len(i) >> 8) - buf[2] = uint8(len(i)) - } - buf = append(buf, i...) - return buf -} - -// Set the public key for X and Y for Curve. The two -// values are just concatenated. -func curveToBuf(_X, _Y *big.Int, intlen int) []byte { - buf := intToBytes(_X, intlen) - buf = append(buf, intToBytes(_Y, intlen)...) - return buf -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_keyscan.go b/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_keyscan.go deleted file mode 100644 index 6cbc28483f13..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_keyscan.go +++ /dev/null @@ -1,310 +0,0 @@ -package dns - -import ( - "bufio" - "crypto" - "crypto/ecdsa" - "crypto/rsa" - "io" - "math/big" - "strconv" - "strings" - - "golang.org/x/crypto/ed25519" -) - -// NewPrivateKey returns a PrivateKey by parsing the string s. -// s should be in the same form of the BIND private key files. -func (k *DNSKEY) NewPrivateKey(s string) (crypto.PrivateKey, error) { - if s == "" || s[len(s)-1] != '\n' { // We need a closing newline - return k.ReadPrivateKey(strings.NewReader(s+"\n"), "") - } - return k.ReadPrivateKey(strings.NewReader(s), "") -} - -// ReadPrivateKey reads a private key from the io.Reader q. The string file is -// only used in error reporting. -// The public key must be known, because some cryptographic algorithms embed -// the public inside the privatekey. -func (k *DNSKEY) ReadPrivateKey(q io.Reader, file string) (crypto.PrivateKey, error) { - m, err := parseKey(q, file) - if m == nil { - return nil, err - } - if _, ok := m["private-key-format"]; !ok { - return nil, ErrPrivKey - } - if m["private-key-format"] != "v1.2" && m["private-key-format"] != "v1.3" { - return nil, ErrPrivKey - } - // TODO(mg): check if the pubkey matches the private key - algo, err := strconv.ParseUint(strings.SplitN(m["algorithm"], " ", 2)[0], 10, 8) - if err != nil { - return nil, ErrPrivKey - } - switch uint8(algo) { - case RSASHA1, RSASHA1NSEC3SHA1, RSASHA256, RSASHA512: - priv, err := readPrivateKeyRSA(m) - if err != nil { - return nil, err - } - pub := k.publicKeyRSA() - if pub == nil { - return nil, ErrKey - } - priv.PublicKey = *pub - return priv, nil - case ECDSAP256SHA256, ECDSAP384SHA384: - priv, err := readPrivateKeyECDSA(m) - if err != nil { - return nil, err - } - pub := k.publicKeyECDSA() - if pub == nil { - return nil, ErrKey - } - priv.PublicKey = *pub - return priv, nil - case ED25519: - return readPrivateKeyED25519(m) - default: - return nil, ErrAlg - } -} - -// Read a private key (file) string and create a public key. Return the private key. -func readPrivateKeyRSA(m map[string]string) (*rsa.PrivateKey, error) { - p := new(rsa.PrivateKey) - p.Primes = []*big.Int{nil, nil} - for k, v := range m { - switch k { - case "modulus", "publicexponent", "privateexponent", "prime1", "prime2": - v1, err := fromBase64([]byte(v)) - if err != nil { - return nil, err - } - switch k { - case "modulus": - p.PublicKey.N = new(big.Int).SetBytes(v1) - case "publicexponent": - i := new(big.Int).SetBytes(v1) - p.PublicKey.E = int(i.Int64()) // int64 should be large enough - case "privateexponent": - p.D = new(big.Int).SetBytes(v1) - case "prime1": - p.Primes[0] = new(big.Int).SetBytes(v1) - case "prime2": - p.Primes[1] = new(big.Int).SetBytes(v1) - } - case "exponent1", "exponent2", "coefficient": - // not used in Go (yet) - case "created", "publish", "activate": - // not used in Go (yet) - } - } - return p, nil -} - -func readPrivateKeyECDSA(m map[string]string) (*ecdsa.PrivateKey, error) { - p := new(ecdsa.PrivateKey) - p.D = new(big.Int) - // TODO: validate that the required flags are present - for k, v := range m { - switch k { - case "privatekey": - v1, err := fromBase64([]byte(v)) - if err != nil { - return nil, err - } - p.D.SetBytes(v1) - case "created", "publish", "activate": - /* not used in Go (yet) */ - } - } - return p, nil -} - -func readPrivateKeyED25519(m map[string]string) (ed25519.PrivateKey, error) { - var p ed25519.PrivateKey - // TODO: validate that the required flags are present - for k, v := range m { - switch k { - case "privatekey": - p1, err := fromBase64([]byte(v)) - if err != nil { - return nil, err - } - if len(p1) != ed25519.SeedSize { - return nil, ErrPrivKey - } - p = ed25519.NewKeyFromSeed(p1) - case "created", "publish", "activate": - /* not used in Go (yet) */ - } - } - return p, nil -} - -// parseKey reads a private key from r. It returns a map[string]string, -// with the key-value pairs, or an error when the file is not correct. -func parseKey(r io.Reader, file string) (map[string]string, error) { - m := make(map[string]string) - var k string - - c := newKLexer(r) - - for l, ok := c.Next(); ok; l, ok = c.Next() { - // It should alternate - switch l.value { - case zKey: - k = l.token - case zValue: - if k == "" { - return nil, &ParseError{file, "no private key seen", l} - } - - m[strings.ToLower(k)] = l.token - k = "" - } - } - - // Surface any read errors from r. - if err := c.Err(); err != nil { - return nil, &ParseError{file: file, err: err.Error()} - } - - return m, nil -} - -type klexer struct { - br io.ByteReader - - readErr error - - line int - column int - - key bool - - eol bool // end-of-line -} - -func newKLexer(r io.Reader) *klexer { - br, ok := r.(io.ByteReader) - if !ok { - br = bufio.NewReaderSize(r, 1024) - } - - return &klexer{ - br: br, - - line: 1, - - key: true, - } -} - -func (kl *klexer) Err() error { - if kl.readErr == io.EOF { - return nil - } - - return kl.readErr -} - -// readByte returns the next byte from the input -func (kl *klexer) readByte() (byte, bool) { - if kl.readErr != nil { - return 0, false - } - - c, err := kl.br.ReadByte() - if err != nil { - kl.readErr = err - return 0, false - } - - // delay the newline handling until the next token is delivered, - // fixes off-by-one errors when reporting a parse error. - if kl.eol { - kl.line++ - kl.column = 0 - kl.eol = false - } - - if c == '\n' { - kl.eol = true - } else { - kl.column++ - } - - return c, true -} - -func (kl *klexer) Next() (lex, bool) { - var ( - l lex - - str strings.Builder - - commt bool - ) - - for x, ok := kl.readByte(); ok; x, ok = kl.readByte() { - l.line, l.column = kl.line, kl.column - - switch x { - case ':': - if commt || !kl.key { - break - } - - kl.key = false - - // Next token is a space, eat it - kl.readByte() - - l.value = zKey - l.token = str.String() - return l, true - case ';': - commt = true - case '\n': - if commt { - // Reset a comment - commt = false - } - - if kl.key && str.Len() == 0 { - // ignore empty lines - break - } - - kl.key = true - - l.value = zValue - l.token = str.String() - return l, true - default: - if commt { - break - } - - str.WriteByte(x) - } - } - - if kl.readErr != nil && kl.readErr != io.EOF { - // Don't return any tokens after a read error occurs. - return lex{value: zEOF}, false - } - - if str.Len() > 0 { - // Send remainder - l.value = zValue - l.token = str.String() - return l, true - } - - return lex{value: zEOF}, false -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_privkey.go b/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_privkey.go deleted file mode 100644 index 072e445dadfa..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/dnssec_privkey.go +++ /dev/null @@ -1,78 +0,0 @@ -package dns - -import ( - "crypto" - "crypto/ecdsa" - "crypto/rsa" - "math/big" - "strconv" - - "golang.org/x/crypto/ed25519" -) - -const format = "Private-key-format: v1.3\n" - -var bigIntOne = big.NewInt(1) - -// PrivateKeyString converts a PrivateKey to a string. This string has the same -// format as the private-key-file of BIND9 (Private-key-format: v1.3). -// It needs some info from the key (the algorithm), so its a method of the DNSKEY. -// It supports *rsa.PrivateKey, *ecdsa.PrivateKey and ed25519.PrivateKey. -func (r *DNSKEY) PrivateKeyString(p crypto.PrivateKey) string { - algorithm := strconv.Itoa(int(r.Algorithm)) - algorithm += " (" + AlgorithmToString[r.Algorithm] + ")" - - switch p := p.(type) { - case *rsa.PrivateKey: - modulus := toBase64(p.PublicKey.N.Bytes()) - e := big.NewInt(int64(p.PublicKey.E)) - publicExponent := toBase64(e.Bytes()) - privateExponent := toBase64(p.D.Bytes()) - prime1 := toBase64(p.Primes[0].Bytes()) - prime2 := toBase64(p.Primes[1].Bytes()) - // Calculate Exponent1/2 and Coefficient as per: http://en.wikipedia.org/wiki/RSA#Using_the_Chinese_remainder_algorithm - // and from: http://code.google.com/p/go/issues/detail?id=987 - p1 := new(big.Int).Sub(p.Primes[0], bigIntOne) - q1 := new(big.Int).Sub(p.Primes[1], bigIntOne) - exp1 := new(big.Int).Mod(p.D, p1) - exp2 := new(big.Int).Mod(p.D, q1) - coeff := new(big.Int).ModInverse(p.Primes[1], p.Primes[0]) - - exponent1 := toBase64(exp1.Bytes()) - exponent2 := toBase64(exp2.Bytes()) - coefficient := toBase64(coeff.Bytes()) - - return format + - "Algorithm: " + algorithm + "\n" + - "Modulus: " + modulus + "\n" + - "PublicExponent: " + publicExponent + "\n" + - "PrivateExponent: " + privateExponent + "\n" + - "Prime1: " + prime1 + "\n" + - "Prime2: " + prime2 + "\n" + - "Exponent1: " + exponent1 + "\n" + - "Exponent2: " + exponent2 + "\n" + - "Coefficient: " + coefficient + "\n" - - case *ecdsa.PrivateKey: - var intlen int - switch r.Algorithm { - case ECDSAP256SHA256: - intlen = 32 - case ECDSAP384SHA384: - intlen = 48 - } - private := toBase64(intToBytes(p.D, intlen)) - return format + - "Algorithm: " + algorithm + "\n" + - "PrivateKey: " + private + "\n" - - case ed25519.PrivateKey: - private := toBase64(p.Seed()) - return format + - "Algorithm: " + algorithm + "\n" + - "PrivateKey: " + private + "\n" - - default: - return "" - } -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/doc.go b/cluster-autoscaler/vendor/github.com/miekg/dns/doc.go deleted file mode 100644 index 6861de774b70..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/doc.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -Package dns implements a full featured interface to the Domain Name System. -Both server- and client-side programming is supported. The package allows -complete control over what is sent out to the DNS. The API follows the -less-is-more principle, by presenting a small, clean interface. - -It supports (asynchronous) querying/replying, incoming/outgoing zone transfers, -TSIG, EDNS0, dynamic updates, notifies and DNSSEC validation/signing. - -Note that domain names MUST be fully qualified before sending them, unqualified -names in a message will result in a packing failure. - -Resource records are native types. They are not stored in wire format. Basic -usage pattern for creating a new resource record: - - r := new(dns.MX) - r.Hdr = dns.RR_Header{Name: "miek.nl.", Rrtype: dns.TypeMX, Class: dns.ClassINET, Ttl: 3600} - r.Preference = 10 - r.Mx = "mx.miek.nl." - -Or directly from a string: - - mx, err := dns.NewRR("miek.nl. 3600 IN MX 10 mx.miek.nl.") - -Or when the default origin (.) and TTL (3600) and class (IN) suit you: - - mx, err := dns.NewRR("miek.nl MX 10 mx.miek.nl") - -Or even: - - mx, err := dns.NewRR("$ORIGIN nl.\nmiek 1H IN MX 10 mx.miek") - -In the DNS messages are exchanged, these messages contain resource records -(sets). Use pattern for creating a message: - - m := new(dns.Msg) - m.SetQuestion("miek.nl.", dns.TypeMX) - -Or when not certain if the domain name is fully qualified: - - m.SetQuestion(dns.Fqdn("miek.nl"), dns.TypeMX) - -The message m is now a message with the question section set to ask the MX -records for the miek.nl. zone. - -The following is slightly more verbose, but more flexible: - - m1 := new(dns.Msg) - m1.Id = dns.Id() - m1.RecursionDesired = true - m1.Question = make([]dns.Question, 1) - m1.Question[0] = dns.Question{"miek.nl.", dns.TypeMX, dns.ClassINET} - -After creating a message it can be sent. Basic use pattern for synchronous -querying the DNS at a server configured on 127.0.0.1 and port 53: - - c := new(dns.Client) - in, rtt, err := c.Exchange(m1, "127.0.0.1:53") - -Suppressing multiple outstanding queries (with the same question, type and -class) is as easy as setting: - - c.SingleInflight = true - -More advanced options are available using a net.Dialer and the corresponding API. -For example it is possible to set a timeout, or to specify a source IP address -and port to use for the connection: - - c := new(dns.Client) - laddr := net.UDPAddr{ - IP: net.ParseIP("[::1]"), - Port: 12345, - Zone: "", - } - c.Dialer := &net.Dialer{ - Timeout: 200 * time.Millisecond, - LocalAddr: &laddr, - } - in, rtt, err := c.Exchange(m1, "8.8.8.8:53") - -If these "advanced" features are not needed, a simple UDP query can be sent, -with: - - in, err := dns.Exchange(m1, "127.0.0.1:53") - -When this functions returns you will get DNS message. A DNS message consists -out of four sections. -The question section: in.Question, the answer section: in.Answer, -the authority section: in.Ns and the additional section: in.Extra. - -Each of these sections (except the Question section) contain a []RR. Basic -use pattern for accessing the rdata of a TXT RR as the first RR in -the Answer section: - - if t, ok := in.Answer[0].(*dns.TXT); ok { - // do something with t.Txt - } - -Domain Name and TXT Character String Representations - -Both domain names and TXT character strings are converted to presentation form -both when unpacked and when converted to strings. - -For TXT character strings, tabs, carriage returns and line feeds will be -converted to \t, \r and \n respectively. Back slashes and quotations marks will -be escaped. Bytes below 32 and above 127 will be converted to \DDD form. - -For domain names, in addition to the above rules brackets, periods, spaces, -semicolons and the at symbol are escaped. - -DNSSEC - -DNSSEC (DNS Security Extension) adds a layer of security to the DNS. It uses -public key cryptography to sign resource records. The public keys are stored in -DNSKEY records and the signatures in RRSIG records. - -Requesting DNSSEC information for a zone is done by adding the DO (DNSSEC OK) -bit to a request. - - m := new(dns.Msg) - m.SetEdns0(4096, true) - -Signature generation, signature verification and key generation are all supported. - -DYNAMIC UPDATES - -Dynamic updates reuses the DNS message format, but renames three of the -sections. Question is Zone, Answer is Prerequisite, Authority is Update, only -the Additional is not renamed. See RFC 2136 for the gory details. - -You can set a rather complex set of rules for the existence of absence of -certain resource records or names in a zone to specify if resource records -should be added or removed. The table from RFC 2136 supplemented with the Go -DNS function shows which functions exist to specify the prerequisites. - - 3.2.4 - Table Of Metavalues Used In Prerequisite Section - - CLASS TYPE RDATA Meaning Function - -------------------------------------------------------------- - ANY ANY empty Name is in use dns.NameUsed - ANY rrset empty RRset exists (value indep) dns.RRsetUsed - NONE ANY empty Name is not in use dns.NameNotUsed - NONE rrset empty RRset does not exist dns.RRsetNotUsed - zone rrset rr RRset exists (value dep) dns.Used - -The prerequisite section can also be left empty. If you have decided on the -prerequisites you can tell what RRs should be added or deleted. The next table -shows the options you have and what functions to call. - - 3.4.2.6 - Table Of Metavalues Used In Update Section - - CLASS TYPE RDATA Meaning Function - --------------------------------------------------------------- - ANY ANY empty Delete all RRsets from name dns.RemoveName - ANY rrset empty Delete an RRset dns.RemoveRRset - NONE rrset rr Delete an RR from RRset dns.Remove - zone rrset rr Add to an RRset dns.Insert - -TRANSACTION SIGNATURE - -An TSIG or transaction signature adds a HMAC TSIG record to each message sent. -The supported algorithms include: HmacMD5, HmacSHA1, HmacSHA256 and HmacSHA512. - -Basic use pattern when querying with a TSIG name "axfr." (note that these key names -must be fully qualified - as they are domain names) and the base64 secret -"so6ZGir4GPAqINNh9U5c3A==": - -If an incoming message contains a TSIG record it MUST be the last record in -the additional section (RFC2845 3.2). This means that you should make the -call to SetTsig last, right before executing the query. If you make any -changes to the RRset after calling SetTsig() the signature will be incorrect. - - c := new(dns.Client) - c.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} - m := new(dns.Msg) - m.SetQuestion("miek.nl.", dns.TypeMX) - m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) - ... - // When sending the TSIG RR is calculated and filled in before sending - -When requesting an zone transfer (almost all TSIG usage is when requesting zone -transfers), with TSIG, this is the basic use pattern. In this example we -request an AXFR for miek.nl. with TSIG key named "axfr." and secret -"so6ZGir4GPAqINNh9U5c3A==" and using the server 176.58.119.54: - - t := new(dns.Transfer) - m := new(dns.Msg) - t.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} - m.SetAxfr("miek.nl.") - m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) - c, err := t.In(m, "176.58.119.54:53") - for r := range c { ... } - -You can now read the records from the transfer as they come in. Each envelope -is checked with TSIG. If something is not correct an error is returned. - -Basic use pattern validating and replying to a message that has TSIG set. - - server := &dns.Server{Addr: ":53", Net: "udp"} - server.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} - go server.ListenAndServe() - dns.HandleFunc(".", handleRequest) - - func handleRequest(w dns.ResponseWriter, r *dns.Msg) { - m := new(dns.Msg) - m.SetReply(r) - if r.IsTsig() != nil { - if w.TsigStatus() == nil { - // *Msg r has an TSIG record and it was validated - m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix()) - } else { - // *Msg r has an TSIG records and it was not validated - } - } - w.WriteMsg(m) - } - -PRIVATE RRS - -RFC 6895 sets aside a range of type codes for private use. This range is 65,280 -- 65,534 (0xFF00 - 0xFFFE). When experimenting with new Resource Records these -can be used, before requesting an official type code from IANA. - -See https://miek.nl/2014/september/21/idn-and-private-rr-in-go-dns/ for more -information. - -EDNS0 - -EDNS0 is an extension mechanism for the DNS defined in RFC 2671 and updated by -RFC 6891. It defines an new RR type, the OPT RR, which is then completely -abused. - -Basic use pattern for creating an (empty) OPT RR: - - o := new(dns.OPT) - o.Hdr.Name = "." // MUST be the root zone, per definition. - o.Hdr.Rrtype = dns.TypeOPT - -The rdata of an OPT RR consists out of a slice of EDNS0 (RFC 6891) interfaces. -Currently only a few have been standardized: EDNS0_NSID (RFC 5001) and -EDNS0_SUBNET (RFC 7871). Note that these options may be combined in an OPT RR. -Basic use pattern for a server to check if (and which) options are set: - - // o is a dns.OPT - for _, s := range o.Option { - switch e := s.(type) { - case *dns.EDNS0_NSID: - // do stuff with e.Nsid - case *dns.EDNS0_SUBNET: - // access e.Family, e.Address, etc. - } - } - -SIG(0) - -From RFC 2931: - - SIG(0) provides protection for DNS transactions and requests .... - ... protection for glue records, DNS requests, protection for message headers - on requests and responses, and protection of the overall integrity of a response. - -It works like TSIG, except that SIG(0) uses public key cryptography, instead of -the shared secret approach in TSIG. Supported algorithms: ECDSAP256SHA256, -ECDSAP384SHA384, RSASHA1, RSASHA256 and RSASHA512. - -Signing subsequent messages in multi-message sessions is not implemented. -*/ -package dns diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/duplicate.go b/cluster-autoscaler/vendor/github.com/miekg/dns/duplicate.go deleted file mode 100644 index d21ae1cac156..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/duplicate.go +++ /dev/null @@ -1,37 +0,0 @@ -package dns - -//go:generate go run duplicate_generate.go - -// IsDuplicate checks of r1 and r2 are duplicates of each other, excluding the TTL. -// So this means the header data is equal *and* the RDATA is the same. Returns true -// if so, otherwise false. It's a protocol violation to have identical RRs in a message. -func IsDuplicate(r1, r2 RR) bool { - // Check whether the record header is identical. - if !r1.Header().isDuplicate(r2.Header()) { - return false - } - - // Check whether the RDATA is identical. - return r1.isDuplicate(r2) -} - -func (r1 *RR_Header) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*RR_Header) - if !ok { - return false - } - if r1.Class != r2.Class { - return false - } - if r1.Rrtype != r2.Rrtype { - return false - } - if !isDuplicateName(r1.Name, r2.Name) { - return false - } - // ignore TTL - return true -} - -// isDuplicateName checks if the domain names s1 and s2 are equal. -func isDuplicateName(s1, s2 string) bool { return equal(s1, s2) } diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/edns.go b/cluster-autoscaler/vendor/github.com/miekg/dns/edns.go deleted file mode 100644 index 04808d57897d..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/edns.go +++ /dev/null @@ -1,675 +0,0 @@ -package dns - -import ( - "encoding/binary" - "encoding/hex" - "errors" - "fmt" - "net" - "strconv" -) - -// EDNS0 Option codes. -const ( - EDNS0LLQ = 0x1 // long lived queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01 - EDNS0UL = 0x2 // update lease draft: http://files.dns-sd.org/draft-sekar-dns-ul.txt - EDNS0NSID = 0x3 // nsid (See RFC 5001) - EDNS0DAU = 0x5 // DNSSEC Algorithm Understood - EDNS0DHU = 0x6 // DS Hash Understood - EDNS0N3U = 0x7 // NSEC3 Hash Understood - EDNS0SUBNET = 0x8 // client-subnet (See RFC 7871) - EDNS0EXPIRE = 0x9 // EDNS0 expire - EDNS0COOKIE = 0xa // EDNS0 Cookie - EDNS0TCPKEEPALIVE = 0xb // EDNS0 tcp keep alive (See RFC 7828) - EDNS0PADDING = 0xc // EDNS0 padding (See RFC 7830) - EDNS0LOCALSTART = 0xFDE9 // Beginning of range reserved for local/experimental use (See RFC 6891) - EDNS0LOCALEND = 0xFFFE // End of range reserved for local/experimental use (See RFC 6891) - _DO = 1 << 15 // DNSSEC OK -) - -// OPT is the EDNS0 RR appended to messages to convey extra (meta) information. -// See RFC 6891. -type OPT struct { - Hdr RR_Header - Option []EDNS0 `dns:"opt"` -} - -func (rr *OPT) String() string { - s := "\n;; OPT PSEUDOSECTION:\n; EDNS: version " + strconv.Itoa(int(rr.Version())) + "; " - if rr.Do() { - s += "flags: do; " - } else { - s += "flags: ; " - } - s += "udp: " + strconv.Itoa(int(rr.UDPSize())) - - for _, o := range rr.Option { - switch o.(type) { - case *EDNS0_NSID: - s += "\n; NSID: " + o.String() - h, e := o.pack() - var r string - if e == nil { - for _, c := range h { - r += "(" + string(c) + ")" - } - s += " " + r - } - case *EDNS0_SUBNET: - s += "\n; SUBNET: " + o.String() - case *EDNS0_COOKIE: - s += "\n; COOKIE: " + o.String() - case *EDNS0_UL: - s += "\n; UPDATE LEASE: " + o.String() - case *EDNS0_LLQ: - s += "\n; LONG LIVED QUERIES: " + o.String() - case *EDNS0_DAU: - s += "\n; DNSSEC ALGORITHM UNDERSTOOD: " + o.String() - case *EDNS0_DHU: - s += "\n; DS HASH UNDERSTOOD: " + o.String() - case *EDNS0_N3U: - s += "\n; NSEC3 HASH UNDERSTOOD: " + o.String() - case *EDNS0_LOCAL: - s += "\n; LOCAL OPT: " + o.String() - case *EDNS0_PADDING: - s += "\n; PADDING: " + o.String() - } - } - return s -} - -func (rr *OPT) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - for _, o := range rr.Option { - l += 4 // Account for 2-byte option code and 2-byte option length. - lo, _ := o.pack() - l += len(lo) - } - return l -} - -func (rr *OPT) parse(c *zlexer, origin string) *ParseError { - panic("dns: internal error: parse should never be called on OPT") -} - -func (r1 *OPT) isDuplicate(r2 RR) bool { return false } - -// return the old value -> delete SetVersion? - -// Version returns the EDNS version used. Only zero is defined. -func (rr *OPT) Version() uint8 { - return uint8(rr.Hdr.Ttl & 0x00FF0000 >> 16) -} - -// SetVersion sets the version of EDNS. This is usually zero. -func (rr *OPT) SetVersion(v uint8) { - rr.Hdr.Ttl = rr.Hdr.Ttl&0xFF00FFFF | uint32(v)<<16 -} - -// ExtendedRcode returns the EDNS extended RCODE field (the upper 8 bits of the TTL). -func (rr *OPT) ExtendedRcode() int { - return int(rr.Hdr.Ttl&0xFF000000>>24) << 4 -} - -// SetExtendedRcode sets the EDNS extended RCODE field. -// -// If the RCODE is not an extended RCODE, will reset the extended RCODE field to 0. -func (rr *OPT) SetExtendedRcode(v uint16) { - rr.Hdr.Ttl = rr.Hdr.Ttl&0x00FFFFFF | uint32(v>>4)<<24 -} - -// UDPSize returns the UDP buffer size. -func (rr *OPT) UDPSize() uint16 { - return rr.Hdr.Class -} - -// SetUDPSize sets the UDP buffer size. -func (rr *OPT) SetUDPSize(size uint16) { - rr.Hdr.Class = size -} - -// Do returns the value of the DO (DNSSEC OK) bit. -func (rr *OPT) Do() bool { - return rr.Hdr.Ttl&_DO == _DO -} - -// SetDo sets the DO (DNSSEC OK) bit. -// If we pass an argument, set the DO bit to that value. -// It is possible to pass 2 or more arguments. Any arguments after the 1st is silently ignored. -func (rr *OPT) SetDo(do ...bool) { - if len(do) == 1 { - if do[0] { - rr.Hdr.Ttl |= _DO - } else { - rr.Hdr.Ttl &^= _DO - } - } else { - rr.Hdr.Ttl |= _DO - } -} - -// EDNS0 defines an EDNS0 Option. An OPT RR can have multiple options appended to it. -type EDNS0 interface { - // Option returns the option code for the option. - Option() uint16 - // pack returns the bytes of the option data. - pack() ([]byte, error) - // unpack sets the data as found in the buffer. Is also sets - // the length of the slice as the length of the option data. - unpack([]byte) error - // String returns the string representation of the option. - String() string - // copy returns a deep-copy of the option. - copy() EDNS0 -} - -// EDNS0_NSID option is used to retrieve a nameserver -// identifier. When sending a request Nsid must be set to the empty string -// The identifier is an opaque string encoded as hex. -// Basic use pattern for creating an nsid option: -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_NSID) -// e.Code = dns.EDNS0NSID -// e.Nsid = "AA" -// o.Option = append(o.Option, e) -type EDNS0_NSID struct { - Code uint16 // Always EDNS0NSID - Nsid string // This string needs to be hex encoded -} - -func (e *EDNS0_NSID) pack() ([]byte, error) { - h, err := hex.DecodeString(e.Nsid) - if err != nil { - return nil, err - } - return h, nil -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_NSID) Option() uint16 { return EDNS0NSID } // Option returns the option code. -func (e *EDNS0_NSID) unpack(b []byte) error { e.Nsid = hex.EncodeToString(b); return nil } -func (e *EDNS0_NSID) String() string { return e.Nsid } -func (e *EDNS0_NSID) copy() EDNS0 { return &EDNS0_NSID{e.Code, e.Nsid} } - -// EDNS0_SUBNET is the subnet option that is used to give the remote nameserver -// an idea of where the client lives. See RFC 7871. It can then give back a different -// answer depending on the location or network topology. -// Basic use pattern for creating an subnet option: -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_SUBNET) -// e.Code = dns.EDNS0SUBNET -// e.Family = 1 // 1 for IPv4 source address, 2 for IPv6 -// e.SourceNetmask = 32 // 32 for IPV4, 128 for IPv6 -// e.SourceScope = 0 -// e.Address = net.ParseIP("127.0.0.1").To4() // for IPv4 -// // e.Address = net.ParseIP("2001:7b8:32a::2") // for IPV6 -// o.Option = append(o.Option, e) -// -// This code will parse all the available bits when unpacking (up to optlen). -// When packing it will apply SourceNetmask. If you need more advanced logic, -// patches welcome and good luck. -type EDNS0_SUBNET struct { - Code uint16 // Always EDNS0SUBNET - Family uint16 // 1 for IP, 2 for IP6 - SourceNetmask uint8 - SourceScope uint8 - Address net.IP -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_SUBNET) Option() uint16 { return EDNS0SUBNET } - -func (e *EDNS0_SUBNET) pack() ([]byte, error) { - b := make([]byte, 4) - binary.BigEndian.PutUint16(b[0:], e.Family) - b[2] = e.SourceNetmask - b[3] = e.SourceScope - switch e.Family { - case 0: - // "dig" sets AddressFamily to 0 if SourceNetmask is also 0 - // We might don't need to complain either - if e.SourceNetmask != 0 { - return nil, errors.New("dns: bad address family") - } - case 1: - if e.SourceNetmask > net.IPv4len*8 { - return nil, errors.New("dns: bad netmask") - } - if len(e.Address.To4()) != net.IPv4len { - return nil, errors.New("dns: bad address") - } - ip := e.Address.To4().Mask(net.CIDRMask(int(e.SourceNetmask), net.IPv4len*8)) - needLength := (e.SourceNetmask + 8 - 1) / 8 // division rounding up - b = append(b, ip[:needLength]...) - case 2: - if e.SourceNetmask > net.IPv6len*8 { - return nil, errors.New("dns: bad netmask") - } - if len(e.Address) != net.IPv6len { - return nil, errors.New("dns: bad address") - } - ip := e.Address.Mask(net.CIDRMask(int(e.SourceNetmask), net.IPv6len*8)) - needLength := (e.SourceNetmask + 8 - 1) / 8 // division rounding up - b = append(b, ip[:needLength]...) - default: - return nil, errors.New("dns: bad address family") - } - return b, nil -} - -func (e *EDNS0_SUBNET) unpack(b []byte) error { - if len(b) < 4 { - return ErrBuf - } - e.Family = binary.BigEndian.Uint16(b) - e.SourceNetmask = b[2] - e.SourceScope = b[3] - switch e.Family { - case 0: - // "dig" sets AddressFamily to 0 if SourceNetmask is also 0 - // It's okay to accept such a packet - if e.SourceNetmask != 0 { - return errors.New("dns: bad address family") - } - e.Address = net.IPv4(0, 0, 0, 0) - case 1: - if e.SourceNetmask > net.IPv4len*8 || e.SourceScope > net.IPv4len*8 { - return errors.New("dns: bad netmask") - } - addr := make(net.IP, net.IPv4len) - copy(addr, b[4:]) - e.Address = addr.To16() - case 2: - if e.SourceNetmask > net.IPv6len*8 || e.SourceScope > net.IPv6len*8 { - return errors.New("dns: bad netmask") - } - addr := make(net.IP, net.IPv6len) - copy(addr, b[4:]) - e.Address = addr - default: - return errors.New("dns: bad address family") - } - return nil -} - -func (e *EDNS0_SUBNET) String() (s string) { - if e.Address == nil { - s = "" - } else if e.Address.To4() != nil { - s = e.Address.String() - } else { - s = "[" + e.Address.String() + "]" - } - s += "/" + strconv.Itoa(int(e.SourceNetmask)) + "/" + strconv.Itoa(int(e.SourceScope)) - return -} - -func (e *EDNS0_SUBNET) copy() EDNS0 { - return &EDNS0_SUBNET{ - e.Code, - e.Family, - e.SourceNetmask, - e.SourceScope, - e.Address, - } -} - -// The EDNS0_COOKIE option is used to add a DNS Cookie to a message. -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_COOKIE) -// e.Code = dns.EDNS0COOKIE -// e.Cookie = "24a5ac.." -// o.Option = append(o.Option, e) -// -// The Cookie field consists out of a client cookie (RFC 7873 Section 4), that is -// always 8 bytes. It may then optionally be followed by the server cookie. The server -// cookie is of variable length, 8 to a maximum of 32 bytes. In other words: -// -// cCookie := o.Cookie[:16] -// sCookie := o.Cookie[16:] -// -// There is no guarantee that the Cookie string has a specific length. -type EDNS0_COOKIE struct { - Code uint16 // Always EDNS0COOKIE - Cookie string // Hex-encoded cookie data -} - -func (e *EDNS0_COOKIE) pack() ([]byte, error) { - h, err := hex.DecodeString(e.Cookie) - if err != nil { - return nil, err - } - return h, nil -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_COOKIE) Option() uint16 { return EDNS0COOKIE } -func (e *EDNS0_COOKIE) unpack(b []byte) error { e.Cookie = hex.EncodeToString(b); return nil } -func (e *EDNS0_COOKIE) String() string { return e.Cookie } -func (e *EDNS0_COOKIE) copy() EDNS0 { return &EDNS0_COOKIE{e.Code, e.Cookie} } - -// The EDNS0_UL (Update Lease) (draft RFC) option is used to tell the server to set -// an expiration on an update RR. This is helpful for clients that cannot clean -// up after themselves. This is a draft RFC and more information can be found at -// https://tools.ietf.org/html/draft-sekar-dns-ul-02 -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_UL) -// e.Code = dns.EDNS0UL -// e.Lease = 120 // in seconds -// o.Option = append(o.Option, e) -type EDNS0_UL struct { - Code uint16 // Always EDNS0UL - Lease uint32 - KeyLease uint32 -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_UL) Option() uint16 { return EDNS0UL } -func (e *EDNS0_UL) String() string { return fmt.Sprintf("%d %d", e.Lease, e.KeyLease) } -func (e *EDNS0_UL) copy() EDNS0 { return &EDNS0_UL{e.Code, e.Lease, e.KeyLease} } - -// Copied: http://golang.org/src/pkg/net/dnsmsg.go -func (e *EDNS0_UL) pack() ([]byte, error) { - var b []byte - if e.KeyLease == 0 { - b = make([]byte, 4) - } else { - b = make([]byte, 8) - binary.BigEndian.PutUint32(b[4:], e.KeyLease) - } - binary.BigEndian.PutUint32(b, e.Lease) - return b, nil -} - -func (e *EDNS0_UL) unpack(b []byte) error { - switch len(b) { - case 4: - e.KeyLease = 0 - case 8: - e.KeyLease = binary.BigEndian.Uint32(b[4:]) - default: - return ErrBuf - } - e.Lease = binary.BigEndian.Uint32(b) - return nil -} - -// EDNS0_LLQ stands for Long Lived Queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01 -// Implemented for completeness, as the EDNS0 type code is assigned. -type EDNS0_LLQ struct { - Code uint16 // Always EDNS0LLQ - Version uint16 - Opcode uint16 - Error uint16 - Id uint64 - LeaseLife uint32 -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_LLQ) Option() uint16 { return EDNS0LLQ } - -func (e *EDNS0_LLQ) pack() ([]byte, error) { - b := make([]byte, 18) - binary.BigEndian.PutUint16(b[0:], e.Version) - binary.BigEndian.PutUint16(b[2:], e.Opcode) - binary.BigEndian.PutUint16(b[4:], e.Error) - binary.BigEndian.PutUint64(b[6:], e.Id) - binary.BigEndian.PutUint32(b[14:], e.LeaseLife) - return b, nil -} - -func (e *EDNS0_LLQ) unpack(b []byte) error { - if len(b) < 18 { - return ErrBuf - } - e.Version = binary.BigEndian.Uint16(b[0:]) - e.Opcode = binary.BigEndian.Uint16(b[2:]) - e.Error = binary.BigEndian.Uint16(b[4:]) - e.Id = binary.BigEndian.Uint64(b[6:]) - e.LeaseLife = binary.BigEndian.Uint32(b[14:]) - return nil -} - -func (e *EDNS0_LLQ) String() string { - s := strconv.FormatUint(uint64(e.Version), 10) + " " + strconv.FormatUint(uint64(e.Opcode), 10) + - " " + strconv.FormatUint(uint64(e.Error), 10) + " " + strconv.FormatUint(e.Id, 10) + - " " + strconv.FormatUint(uint64(e.LeaseLife), 10) - return s -} -func (e *EDNS0_LLQ) copy() EDNS0 { - return &EDNS0_LLQ{e.Code, e.Version, e.Opcode, e.Error, e.Id, e.LeaseLife} -} - -// EDNS0_DUA implements the EDNS0 "DNSSEC Algorithm Understood" option. See RFC 6975. -type EDNS0_DAU struct { - Code uint16 // Always EDNS0DAU - AlgCode []uint8 -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_DAU) Option() uint16 { return EDNS0DAU } -func (e *EDNS0_DAU) pack() ([]byte, error) { return e.AlgCode, nil } -func (e *EDNS0_DAU) unpack(b []byte) error { e.AlgCode = b; return nil } - -func (e *EDNS0_DAU) String() string { - s := "" - for _, alg := range e.AlgCode { - if a, ok := AlgorithmToString[alg]; ok { - s += " " + a - } else { - s += " " + strconv.Itoa(int(alg)) - } - } - return s -} -func (e *EDNS0_DAU) copy() EDNS0 { return &EDNS0_DAU{e.Code, e.AlgCode} } - -// EDNS0_DHU implements the EDNS0 "DS Hash Understood" option. See RFC 6975. -type EDNS0_DHU struct { - Code uint16 // Always EDNS0DHU - AlgCode []uint8 -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_DHU) Option() uint16 { return EDNS0DHU } -func (e *EDNS0_DHU) pack() ([]byte, error) { return e.AlgCode, nil } -func (e *EDNS0_DHU) unpack(b []byte) error { e.AlgCode = b; return nil } - -func (e *EDNS0_DHU) String() string { - s := "" - for _, alg := range e.AlgCode { - if a, ok := HashToString[alg]; ok { - s += " " + a - } else { - s += " " + strconv.Itoa(int(alg)) - } - } - return s -} -func (e *EDNS0_DHU) copy() EDNS0 { return &EDNS0_DHU{e.Code, e.AlgCode} } - -// EDNS0_N3U implements the EDNS0 "NSEC3 Hash Understood" option. See RFC 6975. -type EDNS0_N3U struct { - Code uint16 // Always EDNS0N3U - AlgCode []uint8 -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_N3U) Option() uint16 { return EDNS0N3U } -func (e *EDNS0_N3U) pack() ([]byte, error) { return e.AlgCode, nil } -func (e *EDNS0_N3U) unpack(b []byte) error { e.AlgCode = b; return nil } - -func (e *EDNS0_N3U) String() string { - // Re-use the hash map - s := "" - for _, alg := range e.AlgCode { - if a, ok := HashToString[alg]; ok { - s += " " + a - } else { - s += " " + strconv.Itoa(int(alg)) - } - } - return s -} -func (e *EDNS0_N3U) copy() EDNS0 { return &EDNS0_N3U{e.Code, e.AlgCode} } - -// EDNS0_EXPIRE implementes the EDNS0 option as described in RFC 7314. -type EDNS0_EXPIRE struct { - Code uint16 // Always EDNS0EXPIRE - Expire uint32 -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_EXPIRE) Option() uint16 { return EDNS0EXPIRE } -func (e *EDNS0_EXPIRE) String() string { return strconv.FormatUint(uint64(e.Expire), 10) } -func (e *EDNS0_EXPIRE) copy() EDNS0 { return &EDNS0_EXPIRE{e.Code, e.Expire} } - -func (e *EDNS0_EXPIRE) pack() ([]byte, error) { - b := make([]byte, 4) - binary.BigEndian.PutUint32(b, e.Expire) - return b, nil -} - -func (e *EDNS0_EXPIRE) unpack(b []byte) error { - if len(b) == 0 { - // zero-length EXPIRE query, see RFC 7314 Section 2 - return nil - } - if len(b) < 4 { - return ErrBuf - } - e.Expire = binary.BigEndian.Uint32(b) - return nil -} - -// The EDNS0_LOCAL option is used for local/experimental purposes. The option -// code is recommended to be within the range [EDNS0LOCALSTART, EDNS0LOCALEND] -// (RFC6891), although any unassigned code can actually be used. The content of -// the option is made available in Data, unaltered. -// Basic use pattern for creating a local option: -// -// o := new(dns.OPT) -// o.Hdr.Name = "." -// o.Hdr.Rrtype = dns.TypeOPT -// e := new(dns.EDNS0_LOCAL) -// e.Code = dns.EDNS0LOCALSTART -// e.Data = []byte{72, 82, 74} -// o.Option = append(o.Option, e) -type EDNS0_LOCAL struct { - Code uint16 - Data []byte -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_LOCAL) Option() uint16 { return e.Code } -func (e *EDNS0_LOCAL) String() string { - return strconv.FormatInt(int64(e.Code), 10) + ":0x" + hex.EncodeToString(e.Data) -} -func (e *EDNS0_LOCAL) copy() EDNS0 { - b := make([]byte, len(e.Data)) - copy(b, e.Data) - return &EDNS0_LOCAL{e.Code, b} -} - -func (e *EDNS0_LOCAL) pack() ([]byte, error) { - b := make([]byte, len(e.Data)) - copied := copy(b, e.Data) - if copied != len(e.Data) { - return nil, ErrBuf - } - return b, nil -} - -func (e *EDNS0_LOCAL) unpack(b []byte) error { - e.Data = make([]byte, len(b)) - copied := copy(e.Data, b) - if copied != len(b) { - return ErrBuf - } - return nil -} - -// EDNS0_TCP_KEEPALIVE is an EDNS0 option that instructs the server to keep -// the TCP connection alive. See RFC 7828. -type EDNS0_TCP_KEEPALIVE struct { - Code uint16 // Always EDNSTCPKEEPALIVE - Length uint16 // the value 0 if the TIMEOUT is omitted, the value 2 if it is present; - Timeout uint16 // an idle timeout value for the TCP connection, specified in units of 100 milliseconds, encoded in network byte order. -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_TCP_KEEPALIVE) Option() uint16 { return EDNS0TCPKEEPALIVE } - -func (e *EDNS0_TCP_KEEPALIVE) pack() ([]byte, error) { - if e.Timeout != 0 && e.Length != 2 { - return nil, errors.New("dns: timeout specified but length is not 2") - } - if e.Timeout == 0 && e.Length != 0 { - return nil, errors.New("dns: timeout not specified but length is not 0") - } - b := make([]byte, 4+e.Length) - binary.BigEndian.PutUint16(b[0:], e.Code) - binary.BigEndian.PutUint16(b[2:], e.Length) - if e.Length == 2 { - binary.BigEndian.PutUint16(b[4:], e.Timeout) - } - return b, nil -} - -func (e *EDNS0_TCP_KEEPALIVE) unpack(b []byte) error { - if len(b) < 4 { - return ErrBuf - } - e.Length = binary.BigEndian.Uint16(b[2:4]) - if e.Length != 0 && e.Length != 2 { - return errors.New("dns: length mismatch, want 0/2 but got " + strconv.FormatUint(uint64(e.Length), 10)) - } - if e.Length == 2 { - if len(b) < 6 { - return ErrBuf - } - e.Timeout = binary.BigEndian.Uint16(b[4:6]) - } - return nil -} - -func (e *EDNS0_TCP_KEEPALIVE) String() (s string) { - s = "use tcp keep-alive" - if e.Length == 0 { - s += ", timeout omitted" - } else { - s += fmt.Sprintf(", timeout %dms", e.Timeout*100) - } - return -} -func (e *EDNS0_TCP_KEEPALIVE) copy() EDNS0 { return &EDNS0_TCP_KEEPALIVE{e.Code, e.Length, e.Timeout} } - -// EDNS0_PADDING option is used to add padding to a request/response. The default -// value of padding SHOULD be 0x0 but other values MAY be used, for instance if -// compression is applied before encryption which may break signatures. -type EDNS0_PADDING struct { - Padding []byte -} - -// Option implements the EDNS0 interface. -func (e *EDNS0_PADDING) Option() uint16 { return EDNS0PADDING } -func (e *EDNS0_PADDING) pack() ([]byte, error) { return e.Padding, nil } -func (e *EDNS0_PADDING) unpack(b []byte) error { e.Padding = b; return nil } -func (e *EDNS0_PADDING) String() string { return fmt.Sprintf("%0X", e.Padding) } -func (e *EDNS0_PADDING) copy() EDNS0 { - b := make([]byte, len(e.Padding)) - copy(b, e.Padding) - return &EDNS0_PADDING{b} -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/format.go b/cluster-autoscaler/vendor/github.com/miekg/dns/format.go deleted file mode 100644 index 0ec79f2fc126..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/format.go +++ /dev/null @@ -1,93 +0,0 @@ -package dns - -import ( - "net" - "reflect" - "strconv" -) - -// NumField returns the number of rdata fields r has. -func NumField(r RR) int { - return reflect.ValueOf(r).Elem().NumField() - 1 // Remove RR_Header -} - -// Field returns the rdata field i as a string. Fields are indexed starting from 1. -// RR types that holds slice data, for instance the NSEC type bitmap will return a single -// string where the types are concatenated using a space. -// Accessing non existing fields will cause a panic. -func Field(r RR, i int) string { - if i == 0 { - return "" - } - d := reflect.ValueOf(r).Elem().Field(i) - switch d.Kind() { - case reflect.String: - return d.String() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return strconv.FormatInt(d.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return strconv.FormatUint(d.Uint(), 10) - case reflect.Slice: - switch reflect.ValueOf(r).Elem().Type().Field(i).Tag { - case `dns:"a"`: - // TODO(miek): Hmm store this as 16 bytes - if d.Len() < net.IPv4len { - return "" - } - if d.Len() < net.IPv6len { - return net.IPv4(byte(d.Index(0).Uint()), - byte(d.Index(1).Uint()), - byte(d.Index(2).Uint()), - byte(d.Index(3).Uint())).String() - } - return net.IPv4(byte(d.Index(12).Uint()), - byte(d.Index(13).Uint()), - byte(d.Index(14).Uint()), - byte(d.Index(15).Uint())).String() - case `dns:"aaaa"`: - if d.Len() < net.IPv6len { - return "" - } - return net.IP{ - byte(d.Index(0).Uint()), - byte(d.Index(1).Uint()), - byte(d.Index(2).Uint()), - byte(d.Index(3).Uint()), - byte(d.Index(4).Uint()), - byte(d.Index(5).Uint()), - byte(d.Index(6).Uint()), - byte(d.Index(7).Uint()), - byte(d.Index(8).Uint()), - byte(d.Index(9).Uint()), - byte(d.Index(10).Uint()), - byte(d.Index(11).Uint()), - byte(d.Index(12).Uint()), - byte(d.Index(13).Uint()), - byte(d.Index(14).Uint()), - byte(d.Index(15).Uint()), - }.String() - case `dns:"nsec"`: - if d.Len() == 0 { - return "" - } - s := Type(d.Index(0).Uint()).String() - for i := 1; i < d.Len(); i++ { - s += " " + Type(d.Index(i).Uint()).String() - } - return s - default: - // if it does not have a tag its a string slice - fallthrough - case `dns:"txt"`: - if d.Len() == 0 { - return "" - } - s := d.Index(0).String() - for i := 1; i < d.Len(); i++ { - s += " " + d.Index(i).String() - } - return s - } - } - return "" -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/fuzz.go b/cluster-autoscaler/vendor/github.com/miekg/dns/fuzz.go deleted file mode 100644 index 57410acda75e..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/fuzz.go +++ /dev/null @@ -1,32 +0,0 @@ -// +build fuzz - -package dns - -import "strings" - -func Fuzz(data []byte) int { - msg := new(Msg) - - if err := msg.Unpack(data); err != nil { - return 0 - } - if _, err := msg.Pack(); err != nil { - return 0 - } - - return 1 -} - -func FuzzNewRR(data []byte) int { - str := string(data) - // Do not fuzz lines that include the $INCLUDE keyword and hint the fuzzer - // at avoiding them. - // See GH#1025 for context. - if strings.Contains(strings.ToUpper(str), "$INCLUDE") { - return -1 - } - if _, err := NewRR(str); err != nil { - return 0 - } - return 1 -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/generate.go b/cluster-autoscaler/vendor/github.com/miekg/dns/generate.go deleted file mode 100644 index f713074a181c..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/generate.go +++ /dev/null @@ -1,247 +0,0 @@ -package dns - -import ( - "bytes" - "fmt" - "io" - "strconv" - "strings" -) - -// Parse the $GENERATE statement as used in BIND9 zones. -// See http://www.zytrax.com/books/dns/ch8/generate.html for instance. -// We are called after '$GENERATE '. After which we expect: -// * the range (12-24/2) -// * lhs (ownername) -// * [[ttl][class]] -// * type -// * rhs (rdata) -// But we are lazy here, only the range is parsed *all* occurrences -// of $ after that are interpreted. -func (zp *ZoneParser) generate(l lex) (RR, bool) { - token := l.token - step := int64(1) - if i := strings.IndexByte(token, '/'); i >= 0 { - if i+1 == len(token) { - return zp.setParseError("bad step in $GENERATE range", l) - } - - s, err := strconv.ParseInt(token[i+1:], 10, 64) - if err != nil || s <= 0 { - return zp.setParseError("bad step in $GENERATE range", l) - } - - step = s - token = token[:i] - } - - sx := strings.SplitN(token, "-", 2) - if len(sx) != 2 { - return zp.setParseError("bad start-stop in $GENERATE range", l) - } - - start, err := strconv.ParseInt(sx[0], 10, 64) - if err != nil { - return zp.setParseError("bad start in $GENERATE range", l) - } - - end, err := strconv.ParseInt(sx[1], 10, 64) - if err != nil { - return zp.setParseError("bad stop in $GENERATE range", l) - } - if end < 0 || start < 0 || end < start || (end-start)/step > 65535 { - return zp.setParseError("bad range in $GENERATE range", l) - } - - // _BLANK - l, ok := zp.c.Next() - if !ok || l.value != zBlank { - return zp.setParseError("garbage after $GENERATE range", l) - } - - // Create a complete new string, which we then parse again. - var s string - for l, ok := zp.c.Next(); ok; l, ok = zp.c.Next() { - if l.err { - return zp.setParseError("bad data in $GENERATE directive", l) - } - if l.value == zNewline { - break - } - - s += l.token - } - - r := &generateReader{ - s: s, - - cur: int(start), - start: int(start), - end: int(end), - step: int(step), - - file: zp.file, - lex: &l, - } - zp.sub = NewZoneParser(r, zp.origin, zp.file) - zp.sub.includeDepth, zp.sub.includeAllowed = zp.includeDepth, zp.includeAllowed - zp.sub.generateDisallowed = true - zp.sub.SetDefaultTTL(defaultTtl) - return zp.subNext() -} - -type generateReader struct { - s string - si int - - cur int - start int - end int - step int - - mod bytes.Buffer - - escape bool - - eof bool - - file string - lex *lex -} - -func (r *generateReader) parseError(msg string, end int) *ParseError { - r.eof = true // Make errors sticky. - - l := *r.lex - l.token = r.s[r.si-1 : end] - l.column += r.si // l.column starts one zBLANK before r.s - - return &ParseError{r.file, msg, l} -} - -func (r *generateReader) Read(p []byte) (int, error) { - // NewZLexer, through NewZoneParser, should use ReadByte and - // not end up here. - - panic("not implemented") -} - -func (r *generateReader) ReadByte() (byte, error) { - if r.eof { - return 0, io.EOF - } - if r.mod.Len() > 0 { - return r.mod.ReadByte() - } - - if r.si >= len(r.s) { - r.si = 0 - r.cur += r.step - - r.eof = r.cur > r.end || r.cur < 0 - return '\n', nil - } - - si := r.si - r.si++ - - switch r.s[si] { - case '\\': - if r.escape { - r.escape = false - return '\\', nil - } - - r.escape = true - return r.ReadByte() - case '$': - if r.escape { - r.escape = false - return '$', nil - } - - mod := "%d" - - if si >= len(r.s)-1 { - // End of the string - fmt.Fprintf(&r.mod, mod, r.cur) - return r.mod.ReadByte() - } - - if r.s[si+1] == '$' { - r.si++ - return '$', nil - } - - var offset int - - // Search for { and } - if r.s[si+1] == '{' { - // Modifier block - sep := strings.Index(r.s[si+2:], "}") - if sep < 0 { - return 0, r.parseError("bad modifier in $GENERATE", len(r.s)) - } - - var errMsg string - mod, offset, errMsg = modToPrintf(r.s[si+2 : si+2+sep]) - if errMsg != "" { - return 0, r.parseError(errMsg, si+3+sep) - } - if r.start+offset < 0 || int64(r.end) + int64(offset) > 1<<31-1 { - return 0, r.parseError("bad offset in $GENERATE", si+3+sep) - } - - r.si += 2 + sep // Jump to it - } - - fmt.Fprintf(&r.mod, mod, r.cur+offset) - return r.mod.ReadByte() - default: - if r.escape { // Pretty useless here - r.escape = false - return r.ReadByte() - } - - return r.s[si], nil - } -} - -// Convert a $GENERATE modifier 0,0,d to something Printf can deal with. -func modToPrintf(s string) (string, int, string) { - // Modifier is { offset [ ,width [ ,base ] ] } - provide default - // values for optional width and type, if necessary. - var offStr, widthStr, base string - switch xs := strings.Split(s, ","); len(xs) { - case 1: - offStr, widthStr, base = xs[0], "0", "d" - case 2: - offStr, widthStr, base = xs[0], xs[1], "d" - case 3: - offStr, widthStr, base = xs[0], xs[1], xs[2] - default: - return "", 0, "bad modifier in $GENERATE" - } - - switch base { - case "o", "d", "x", "X": - default: - return "", 0, "bad base in $GENERATE" - } - - offset, err := strconv.ParseInt(offStr, 10, 64) - if err != nil { - return "", 0, "bad offset in $GENERATE" - } - - width, err := strconv.ParseInt(widthStr, 10, 64) - if err != nil || width < 0 || width > 255 { - return "", 0, "bad width in $GENERATE" - } - - if width == 0 { - return "%" + base, int(offset), "" - } - - return "%0" + widthStr + base, int(offset), "" -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/go.mod b/cluster-autoscaler/vendor/github.com/miekg/dns/go.mod deleted file mode 100644 index 6003d0573c6e..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module github.com/miekg/dns - -go 1.12 - -require ( - golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 - golang.org/x/net v0.0.0-20190923162816-aa69164e4478 - golang.org/x/sync v0.0.0-20190423024810-112230192c58 - golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe - golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 // indirect -) diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/go.sum b/cluster-autoscaler/vendor/github.com/miekg/dns/go.sum deleted file mode 100644 index 96bda3a94128..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/go.sum +++ /dev/null @@ -1,39 +0,0 @@ -golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4 h1:Vk3wNqEZwyGyei9yq5ekj7frek2u7HUfffJ1/opblzc= -golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 h1:Gv7RPwsi3eZ2Fgewe3CBsuOebPwO27PoXzRpJPsvSSM= -golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 h1:dgd4x4kJt7G4k4m93AYLzM8Ni6h2qLTfh9n9vXJT3/0= -golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180928133829-e4b3c5e90611 h1:O33LKL7WyJgjN9CvxfTIomjIClbd/Kq86/iipowHQU0= -golang.org/x/sys v0.0.0-20180928133829-e4b3c5e90611/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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe h1:6fAMxZRR6sl1Uq8U61gxU+kPTs2tR8uOySCbBP7BN/M= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/labels.go b/cluster-autoscaler/vendor/github.com/miekg/dns/labels.go deleted file mode 100644 index df1675dfd280..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/labels.go +++ /dev/null @@ -1,212 +0,0 @@ -package dns - -// Holds a bunch of helper functions for dealing with labels. - -// SplitDomainName splits a name string into it's labels. -// www.miek.nl. returns []string{"www", "miek", "nl"} -// .www.miek.nl. returns []string{"", "www", "miek", "nl"}, -// The root label (.) returns nil. Note that using -// strings.Split(s) will work in most cases, but does not handle -// escaped dots (\.) for instance. -// s must be a syntactically valid domain name, see IsDomainName. -func SplitDomainName(s string) (labels []string) { - if len(s) == 0 { - return nil - } - fqdnEnd := 0 // offset of the final '.' or the length of the name - idx := Split(s) - begin := 0 - if IsFqdn(s) { - fqdnEnd = len(s) - 1 - } else { - fqdnEnd = len(s) - } - - switch len(idx) { - case 0: - return nil - case 1: - // no-op - default: - for _, end := range idx[1:] { - labels = append(labels, s[begin:end-1]) - begin = end - } - } - - return append(labels, s[begin:fqdnEnd]) -} - -// CompareDomainName compares the names s1 and s2 and -// returns how many labels they have in common starting from the *right*. -// The comparison stops at the first inequality. The names are downcased -// before the comparison. -// -// www.miek.nl. and miek.nl. have two labels in common: miek and nl -// www.miek.nl. and www.bla.nl. have one label in common: nl -// -// s1 and s2 must be syntactically valid domain names. -func CompareDomainName(s1, s2 string) (n int) { - // the first check: root label - if s1 == "." || s2 == "." { - return 0 - } - - l1 := Split(s1) - l2 := Split(s2) - - j1 := len(l1) - 1 // end - i1 := len(l1) - 2 // start - j2 := len(l2) - 1 - i2 := len(l2) - 2 - // the second check can be done here: last/only label - // before we fall through into the for-loop below - if equal(s1[l1[j1]:], s2[l2[j2]:]) { - n++ - } else { - return - } - for { - if i1 < 0 || i2 < 0 { - break - } - if equal(s1[l1[i1]:l1[j1]], s2[l2[i2]:l2[j2]]) { - n++ - } else { - break - } - j1-- - i1-- - j2-- - i2-- - } - return -} - -// CountLabel counts the number of labels in the string s. -// s must be a syntactically valid domain name. -func CountLabel(s string) (labels int) { - if s == "." { - return - } - off := 0 - end := false - for { - off, end = NextLabel(s, off) - labels++ - if end { - return - } - } -} - -// Split splits a name s into its label indexes. -// www.miek.nl. returns []int{0, 4, 9}, www.miek.nl also returns []int{0, 4, 9}. -// The root name (.) returns nil. Also see SplitDomainName. -// s must be a syntactically valid domain name. -func Split(s string) []int { - if s == "." { - return nil - } - idx := make([]int, 1, 3) - off := 0 - end := false - - for { - off, end = NextLabel(s, off) - if end { - return idx - } - idx = append(idx, off) - } -} - -// NextLabel returns the index of the start of the next label in the -// string s starting at offset. -// The bool end is true when the end of the string has been reached. -// Also see PrevLabel. -func NextLabel(s string, offset int) (i int, end bool) { - if s == "" { - return 0, true - } - for i = offset; i < len(s)-1; i++ { - if s[i] != '.' { - continue - } - j := i - 1 - for j >= 0 && s[j] == '\\' { - j-- - } - - if (j-i)%2 == 0 { - continue - } - - return i + 1, false - } - return i + 1, true -} - -// PrevLabel returns the index of the label when starting from the right and -// jumping n labels to the left. -// The bool start is true when the start of the string has been overshot. -// Also see NextLabel. -func PrevLabel(s string, n int) (i int, start bool) { - if s == "" { - return 0, true - } - if n == 0 { - return len(s), false - } - - l := len(s) - 1 - if s[l] == '.' { - l-- - } - - for ; l >= 0 && n > 0; l-- { - if s[l] != '.' { - continue - } - j := l - 1 - for j >= 0 && s[j] == '\\' { - j-- - } - - if (j-l)%2 == 0 { - continue - } - - n-- - if n == 0 { - return l + 1, false - } - } - - return 0, n > 1 -} - -// equal compares a and b while ignoring case. It returns true when equal otherwise false. -func equal(a, b string) bool { - // might be lifted into API function. - la := len(a) - lb := len(b) - if la != lb { - return false - } - - for i := la - 1; i >= 0; i-- { - ai := a[i] - bi := b[i] - if ai >= 'A' && ai <= 'Z' { - ai |= 'a' - 'A' - } - if bi >= 'A' && bi <= 'Z' { - bi |= 'a' - 'A' - } - if ai != bi { - return false - } - } - return true -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/listen_go111.go b/cluster-autoscaler/vendor/github.com/miekg/dns/listen_go111.go deleted file mode 100644 index fad195cfeb4d..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/listen_go111.go +++ /dev/null @@ -1,44 +0,0 @@ -// +build go1.11 -// +build aix darwin dragonfly freebsd linux netbsd openbsd - -package dns - -import ( - "context" - "net" - "syscall" - - "golang.org/x/sys/unix" -) - -const supportsReusePort = true - -func reuseportControl(network, address string, c syscall.RawConn) error { - var opErr error - err := c.Control(func(fd uintptr) { - opErr = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1) - }) - if err != nil { - return err - } - - return opErr -} - -func listenTCP(network, addr string, reuseport bool) (net.Listener, error) { - var lc net.ListenConfig - if reuseport { - lc.Control = reuseportControl - } - - return lc.Listen(context.Background(), network, addr) -} - -func listenUDP(network, addr string, reuseport bool) (net.PacketConn, error) { - var lc net.ListenConfig - if reuseport { - lc.Control = reuseportControl - } - - return lc.ListenPacket(context.Background(), network, addr) -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/listen_go_not111.go b/cluster-autoscaler/vendor/github.com/miekg/dns/listen_go_not111.go deleted file mode 100644 index b9201417abeb..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/listen_go_not111.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build !go1.11 !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd - -package dns - -import "net" - -const supportsReusePort = false - -func listenTCP(network, addr string, reuseport bool) (net.Listener, error) { - if reuseport { - // TODO(tmthrgd): return an error? - } - - return net.Listen(network, addr) -} - -func listenUDP(network, addr string, reuseport bool) (net.PacketConn, error) { - if reuseport { - // TODO(tmthrgd): return an error? - } - - return net.ListenPacket(network, addr) -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/msg.go b/cluster-autoscaler/vendor/github.com/miekg/dns/msg.go deleted file mode 100644 index 7001f6da79c8..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/msg.go +++ /dev/null @@ -1,1190 +0,0 @@ -// DNS packet assembly, see RFC 1035. Converting from - Unpack() - -// and to - Pack() - wire format. -// All the packers and unpackers take a (msg []byte, off int) -// and return (off1 int, ok bool). If they return ok==false, they -// also return off1==len(msg), so that the next unpacker will -// also fail. This lets us avoid checks of ok until the end of a -// packing sequence. - -package dns - -//go:generate go run msg_generate.go - -import ( - "crypto/rand" - "encoding/binary" - "fmt" - "math/big" - "strconv" - "strings" -) - -const ( - maxCompressionOffset = 2 << 13 // We have 14 bits for the compression pointer - maxDomainNameWireOctets = 255 // See RFC 1035 section 2.3.4 - - // This is the maximum number of compression pointers that should occur in a - // semantically valid message. Each label in a domain name must be at least one - // octet and is separated by a period. The root label won't be represented by a - // compression pointer to a compression pointer, hence the -2 to exclude the - // smallest valid root label. - // - // It is possible to construct a valid message that has more compression pointers - // than this, and still doesn't loop, by pointing to a previous pointer. This is - // not something a well written implementation should ever do, so we leave them - // to trip the maximum compression pointer check. - maxCompressionPointers = (maxDomainNameWireOctets+1)/2 - 2 - - // This is the maximum length of a domain name in presentation format. The - // maximum wire length of a domain name is 255 octets (see above), with the - // maximum label length being 63. The wire format requires one extra byte over - // the presentation format, reducing the number of octets by 1. Each label in - // the name will be separated by a single period, with each octet in the label - // expanding to at most 4 bytes (\DDD). If all other labels are of the maximum - // length, then the final label can only be 61 octets long to not exceed the - // maximum allowed wire length. - maxDomainNamePresentationLength = 61*4 + 1 + 63*4 + 1 + 63*4 + 1 + 63*4 + 1 -) - -// Errors defined in this package. -var ( - ErrAlg error = &Error{err: "bad algorithm"} // ErrAlg indicates an error with the (DNSSEC) algorithm. - ErrAuth error = &Error{err: "bad authentication"} // ErrAuth indicates an error in the TSIG authentication. - ErrBuf error = &Error{err: "buffer size too small"} // ErrBuf indicates that the buffer used is too small for the message. - ErrConnEmpty error = &Error{err: "conn has no connection"} // ErrConnEmpty indicates a connection is being used before it is initialized. - ErrExtendedRcode error = &Error{err: "bad extended rcode"} // ErrExtendedRcode ... - ErrFqdn error = &Error{err: "domain must be fully qualified"} // ErrFqdn indicates that a domain name does not have a closing dot. - ErrId error = &Error{err: "id mismatch"} // ErrId indicates there is a mismatch with the message's ID. - ErrKeyAlg error = &Error{err: "bad key algorithm"} // ErrKeyAlg indicates that the algorithm in the key is not valid. - ErrKey error = &Error{err: "bad key"} - ErrKeySize error = &Error{err: "bad key size"} - ErrLongDomain error = &Error{err: fmt.Sprintf("domain name exceeded %d wire-format octets", maxDomainNameWireOctets)} - ErrNoSig error = &Error{err: "no signature found"} - ErrPrivKey error = &Error{err: "bad private key"} - ErrRcode error = &Error{err: "bad rcode"} - ErrRdata error = &Error{err: "bad rdata"} - ErrRRset error = &Error{err: "bad rrset"} - ErrSecret error = &Error{err: "no secrets defined"} - ErrShortRead error = &Error{err: "short read"} - ErrSig error = &Error{err: "bad signature"} // ErrSig indicates that a signature can not be cryptographically validated. - ErrSoa error = &Error{err: "no SOA"} // ErrSOA indicates that no SOA RR was seen when doing zone transfers. - ErrTime error = &Error{err: "bad time"} // ErrTime indicates a timing error in TSIG authentication. -) - -// Id by default returns a 16-bit random number to be used as a message id. The -// number is drawn from a cryptographically secure random number generator. -// This being a variable the function can be reassigned to a custom function. -// For instance, to make it return a static value for testing: -// -// dns.Id = func() uint16 { return 3 } -var Id = id - -// id returns a 16 bits random number to be used as a -// message id. The random provided should be good enough. -func id() uint16 { - var output uint16 - err := binary.Read(rand.Reader, binary.BigEndian, &output) - if err != nil { - panic("dns: reading random id failed: " + err.Error()) - } - return output -} - -// MsgHdr is a a manually-unpacked version of (id, bits). -type MsgHdr struct { - Id uint16 - Response bool - Opcode int - Authoritative bool - Truncated bool - RecursionDesired bool - RecursionAvailable bool - Zero bool - AuthenticatedData bool - CheckingDisabled bool - Rcode int -} - -// Msg contains the layout of a DNS message. -type Msg struct { - MsgHdr - Compress bool `json:"-"` // If true, the message will be compressed when converted to wire format. - Question []Question // Holds the RR(s) of the question section. - Answer []RR // Holds the RR(s) of the answer section. - Ns []RR // Holds the RR(s) of the authority section. - Extra []RR // Holds the RR(s) of the additional section. -} - -// ClassToString is a maps Classes to strings for each CLASS wire type. -var ClassToString = map[uint16]string{ - ClassINET: "IN", - ClassCSNET: "CS", - ClassCHAOS: "CH", - ClassHESIOD: "HS", - ClassNONE: "NONE", - ClassANY: "ANY", -} - -// OpcodeToString maps Opcodes to strings. -var OpcodeToString = map[int]string{ - OpcodeQuery: "QUERY", - OpcodeIQuery: "IQUERY", - OpcodeStatus: "STATUS", - OpcodeNotify: "NOTIFY", - OpcodeUpdate: "UPDATE", -} - -// RcodeToString maps Rcodes to strings. -var RcodeToString = map[int]string{ - RcodeSuccess: "NOERROR", - RcodeFormatError: "FORMERR", - RcodeServerFailure: "SERVFAIL", - RcodeNameError: "NXDOMAIN", - RcodeNotImplemented: "NOTIMP", - RcodeRefused: "REFUSED", - RcodeYXDomain: "YXDOMAIN", // See RFC 2136 - RcodeYXRrset: "YXRRSET", - RcodeNXRrset: "NXRRSET", - RcodeNotAuth: "NOTAUTH", - RcodeNotZone: "NOTZONE", - RcodeBadSig: "BADSIG", // Also known as RcodeBadVers, see RFC 6891 - // RcodeBadVers: "BADVERS", - RcodeBadKey: "BADKEY", - RcodeBadTime: "BADTIME", - RcodeBadMode: "BADMODE", - RcodeBadName: "BADNAME", - RcodeBadAlg: "BADALG", - RcodeBadTrunc: "BADTRUNC", - RcodeBadCookie: "BADCOOKIE", -} - -// compressionMap is used to allow a more efficient compression map -// to be used for internal packDomainName calls without changing the -// signature or functionality of public API. -// -// In particular, map[string]uint16 uses 25% less per-entry memory -// than does map[string]int. -type compressionMap struct { - ext map[string]int // external callers - int map[string]uint16 // internal callers -} - -func (m compressionMap) valid() bool { - return m.int != nil || m.ext != nil -} - -func (m compressionMap) insert(s string, pos int) { - if m.ext != nil { - m.ext[s] = pos - } else { - m.int[s] = uint16(pos) - } -} - -func (m compressionMap) find(s string) (int, bool) { - if m.ext != nil { - pos, ok := m.ext[s] - return pos, ok - } - - pos, ok := m.int[s] - return int(pos), ok -} - -// Domain names are a sequence of counted strings -// split at the dots. They end with a zero-length string. - -// PackDomainName packs a domain name s into msg[off:]. -// If compression is wanted compress must be true and the compression -// map needs to hold a mapping between domain names and offsets -// pointing into msg. -func PackDomainName(s string, msg []byte, off int, compression map[string]int, compress bool) (off1 int, err error) { - return packDomainName(s, msg, off, compressionMap{ext: compression}, compress) -} - -func packDomainName(s string, msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - // XXX: A logical copy of this function exists in IsDomainName and - // should be kept in sync with this function. - - ls := len(s) - if ls == 0 { // Ok, for instance when dealing with update RR without any rdata. - return off, nil - } - - // If not fully qualified, error out. - if !IsFqdn(s) { - return len(msg), ErrFqdn - } - - // Each dot ends a segment of the name. - // We trade each dot byte for a length byte. - // Except for escaped dots (\.), which are normal dots. - // There is also a trailing zero. - - // Compression - pointer := -1 - - // Emit sequence of counted strings, chopping at dots. - var ( - begin int - compBegin int - compOff int - bs []byte - wasDot bool - ) -loop: - for i := 0; i < ls; i++ { - var c byte - if bs == nil { - c = s[i] - } else { - c = bs[i] - } - - switch c { - case '\\': - if off+1 > len(msg) { - return len(msg), ErrBuf - } - - if bs == nil { - bs = []byte(s) - } - - // check for \DDD - if i+3 < ls && isDigit(bs[i+1]) && isDigit(bs[i+2]) && isDigit(bs[i+3]) { - bs[i] = dddToByte(bs[i+1:]) - copy(bs[i+1:ls-3], bs[i+4:]) - ls -= 3 - compOff += 3 - } else { - copy(bs[i:ls-1], bs[i+1:]) - ls-- - compOff++ - } - - wasDot = false - case '.': - if wasDot { - // two dots back to back is not legal - return len(msg), ErrRdata - } - wasDot = true - - labelLen := i - begin - if labelLen >= 1<<6 { // top two bits of length must be clear - return len(msg), ErrRdata - } - - // off can already (we're in a loop) be bigger than len(msg) - // this happens when a name isn't fully qualified - if off+1+labelLen > len(msg) { - return len(msg), ErrBuf - } - - // Don't try to compress '.' - // We should only compress when compress is true, but we should also still pick - // up names that can be used for *future* compression(s). - if compression.valid() && !isRootLabel(s, bs, begin, ls) { - if p, ok := compression.find(s[compBegin:]); ok { - // The first hit is the longest matching dname - // keep the pointer offset we get back and store - // the offset of the current name, because that's - // where we need to insert the pointer later - - // If compress is true, we're allowed to compress this dname - if compress { - pointer = p // Where to point to - break loop - } - } else if off < maxCompressionOffset { - // Only offsets smaller than maxCompressionOffset can be used. - compression.insert(s[compBegin:], off) - } - } - - // The following is covered by the length check above. - msg[off] = byte(labelLen) - - if bs == nil { - copy(msg[off+1:], s[begin:i]) - } else { - copy(msg[off+1:], bs[begin:i]) - } - off += 1 + labelLen - - begin = i + 1 - compBegin = begin + compOff - default: - wasDot = false - } - } - - // Root label is special - if isRootLabel(s, bs, 0, ls) { - return off, nil - } - - // If we did compression and we find something add the pointer here - if pointer != -1 { - // We have two bytes (14 bits) to put the pointer in - binary.BigEndian.PutUint16(msg[off:], uint16(pointer^0xC000)) - return off + 2, nil - } - - if off < len(msg) { - msg[off] = 0 - } - - return off + 1, nil -} - -// isRootLabel returns whether s or bs, from off to end, is the root -// label ".". -// -// If bs is nil, s will be checked, otherwise bs will be checked. -func isRootLabel(s string, bs []byte, off, end int) bool { - if bs == nil { - return s[off:end] == "." - } - - return end-off == 1 && bs[off] == '.' -} - -// Unpack a domain name. -// In addition to the simple sequences of counted strings above, -// domain names are allowed to refer to strings elsewhere in the -// packet, to avoid repeating common suffixes when returning -// many entries in a single domain. The pointers are marked -// by a length byte with the top two bits set. Ignoring those -// two bits, that byte and the next give a 14 bit offset from msg[0] -// where we should pick up the trail. -// Note that if we jump elsewhere in the packet, -// we return off1 == the offset after the first pointer we found, -// which is where the next record will start. -// In theory, the pointers are only allowed to jump backward. -// We let them jump anywhere and stop jumping after a while. - -// UnpackDomainName unpacks a domain name into a string. It returns -// the name, the new offset into msg and any error that occurred. -// -// When an error is encountered, the unpacked name will be discarded -// and len(msg) will be returned as the offset. -func UnpackDomainName(msg []byte, off int) (string, int, error) { - s := make([]byte, 0, maxDomainNamePresentationLength) - off1 := 0 - lenmsg := len(msg) - budget := maxDomainNameWireOctets - ptr := 0 // number of pointers followed -Loop: - for { - if off >= lenmsg { - return "", lenmsg, ErrBuf - } - c := int(msg[off]) - off++ - switch c & 0xC0 { - case 0x00: - if c == 0x00 { - // end of name - break Loop - } - // literal string - if off+c > lenmsg { - return "", lenmsg, ErrBuf - } - budget -= c + 1 // +1 for the label separator - if budget <= 0 { - return "", lenmsg, ErrLongDomain - } - for _, b := range msg[off : off+c] { - if isDomainNameLabelSpecial(b) { - s = append(s, '\\', b) - } else if b < ' ' || b > '~' { - s = append(s, escapeByte(b)...) - } else { - s = append(s, b) - } - } - s = append(s, '.') - off += c - case 0xC0: - // pointer to somewhere else in msg. - // remember location after first ptr, - // since that's how many bytes we consumed. - // also, don't follow too many pointers -- - // maybe there's a loop. - if off >= lenmsg { - return "", lenmsg, ErrBuf - } - c1 := msg[off] - off++ - if ptr == 0 { - off1 = off - } - if ptr++; ptr > maxCompressionPointers { - return "", lenmsg, &Error{err: "too many compression pointers"} - } - // pointer should guarantee that it advances and points forwards at least - // but the condition on previous three lines guarantees that it's - // at least loop-free - off = (c^0xC0)<<8 | int(c1) - default: - // 0x80 and 0x40 are reserved - return "", lenmsg, ErrRdata - } - } - if ptr == 0 { - off1 = off - } - if len(s) == 0 { - return ".", off1, nil - } - return string(s), off1, nil -} - -func packTxt(txt []string, msg []byte, offset int, tmp []byte) (int, error) { - if len(txt) == 0 { - if offset >= len(msg) { - return offset, ErrBuf - } - msg[offset] = 0 - return offset, nil - } - var err error - for _, s := range txt { - if len(s) > len(tmp) { - return offset, ErrBuf - } - offset, err = packTxtString(s, msg, offset, tmp) - if err != nil { - return offset, err - } - } - return offset, nil -} - -func packTxtString(s string, msg []byte, offset int, tmp []byte) (int, error) { - lenByteOffset := offset - if offset >= len(msg) || len(s) > len(tmp) { - return offset, ErrBuf - } - offset++ - bs := tmp[:len(s)] - copy(bs, s) - for i := 0; i < len(bs); i++ { - if len(msg) <= offset { - return offset, ErrBuf - } - if bs[i] == '\\' { - i++ - if i == len(bs) { - break - } - // check for \DDD - if i+2 < len(bs) && isDigit(bs[i]) && isDigit(bs[i+1]) && isDigit(bs[i+2]) { - msg[offset] = dddToByte(bs[i:]) - i += 2 - } else { - msg[offset] = bs[i] - } - } else { - msg[offset] = bs[i] - } - offset++ - } - l := offset - lenByteOffset - 1 - if l > 255 { - return offset, &Error{err: "string exceeded 255 bytes in txt"} - } - msg[lenByteOffset] = byte(l) - return offset, nil -} - -func packOctetString(s string, msg []byte, offset int, tmp []byte) (int, error) { - if offset >= len(msg) || len(s) > len(tmp) { - return offset, ErrBuf - } - bs := tmp[:len(s)] - copy(bs, s) - for i := 0; i < len(bs); i++ { - if len(msg) <= offset { - return offset, ErrBuf - } - if bs[i] == '\\' { - i++ - if i == len(bs) { - break - } - // check for \DDD - if i+2 < len(bs) && isDigit(bs[i]) && isDigit(bs[i+1]) && isDigit(bs[i+2]) { - msg[offset] = dddToByte(bs[i:]) - i += 2 - } else { - msg[offset] = bs[i] - } - } else { - msg[offset] = bs[i] - } - offset++ - } - return offset, nil -} - -func unpackTxt(msg []byte, off0 int) (ss []string, off int, err error) { - off = off0 - var s string - for off < len(msg) && err == nil { - s, off, err = unpackString(msg, off) - if err == nil { - ss = append(ss, s) - } - } - return -} - -// Helpers for dealing with escaped bytes -func isDigit(b byte) bool { return b >= '0' && b <= '9' } - -func dddToByte(s []byte) byte { - _ = s[2] // bounds check hint to compiler; see golang.org/issue/14808 - return byte((s[0]-'0')*100 + (s[1]-'0')*10 + (s[2] - '0')) -} - -func dddStringToByte(s string) byte { - _ = s[2] // bounds check hint to compiler; see golang.org/issue/14808 - return byte((s[0]-'0')*100 + (s[1]-'0')*10 + (s[2] - '0')) -} - -// Helper function for packing and unpacking -func intToBytes(i *big.Int, length int) []byte { - buf := i.Bytes() - if len(buf) < length { - b := make([]byte, length) - copy(b[length-len(buf):], buf) - return b - } - return buf -} - -// PackRR packs a resource record rr into msg[off:]. -// See PackDomainName for documentation about the compression. -func PackRR(rr RR, msg []byte, off int, compression map[string]int, compress bool) (off1 int, err error) { - headerEnd, off1, err := packRR(rr, msg, off, compressionMap{ext: compression}, compress) - if err == nil { - // packRR no longer sets the Rdlength field on the rr, but - // callers might be expecting it so we set it here. - rr.Header().Rdlength = uint16(off1 - headerEnd) - } - return off1, err -} - -func packRR(rr RR, msg []byte, off int, compression compressionMap, compress bool) (headerEnd int, off1 int, err error) { - if rr == nil { - return len(msg), len(msg), &Error{err: "nil rr"} - } - - headerEnd, err = rr.Header().packHeader(msg, off, compression, compress) - if err != nil { - return headerEnd, len(msg), err - } - - off1, err = rr.pack(msg, headerEnd, compression, compress) - if err != nil { - return headerEnd, len(msg), err - } - - rdlength := off1 - headerEnd - if int(uint16(rdlength)) != rdlength { // overflow - return headerEnd, len(msg), ErrRdata - } - - // The RDLENGTH field is the last field in the header and we set it here. - binary.BigEndian.PutUint16(msg[headerEnd-2:], uint16(rdlength)) - return headerEnd, off1, nil -} - -// UnpackRR unpacks msg[off:] into an RR. -func UnpackRR(msg []byte, off int) (rr RR, off1 int, err error) { - h, off, msg, err := unpackHeader(msg, off) - if err != nil { - return nil, len(msg), err - } - - return UnpackRRWithHeader(h, msg, off) -} - -// UnpackRRWithHeader unpacks the record type specific payload given an existing -// RR_Header. -func UnpackRRWithHeader(h RR_Header, msg []byte, off int) (rr RR, off1 int, err error) { - if newFn, ok := TypeToRR[h.Rrtype]; ok { - rr = newFn() - *rr.Header() = h - } else { - rr = &RFC3597{Hdr: h} - } - - if noRdata(h) { - return rr, off, nil - } - - end := off + int(h.Rdlength) - - off, err = rr.unpack(msg, off) - if err != nil { - return nil, end, err - } - if off != end { - return &h, end, &Error{err: "bad rdlength"} - } - - return rr, off, nil -} - -// unpackRRslice unpacks msg[off:] into an []RR. -// If we cannot unpack the whole array, then it will return nil -func unpackRRslice(l int, msg []byte, off int) (dst1 []RR, off1 int, err error) { - var r RR - // Don't pre-allocate, l may be under attacker control - var dst []RR - for i := 0; i < l; i++ { - off1 := off - r, off, err = UnpackRR(msg, off) - if err != nil { - off = len(msg) - break - } - // If offset does not increase anymore, l is a lie - if off1 == off { - break - } - dst = append(dst, r) - } - if err != nil && off == len(msg) { - dst = nil - } - return dst, off, err -} - -// Convert a MsgHdr to a string, with dig-like headers: -// -//;; opcode: QUERY, status: NOERROR, id: 48404 -// -//;; flags: qr aa rd ra; -func (h *MsgHdr) String() string { - if h == nil { - return " MsgHdr" - } - - s := ";; opcode: " + OpcodeToString[h.Opcode] - s += ", status: " + RcodeToString[h.Rcode] - s += ", id: " + strconv.Itoa(int(h.Id)) + "\n" - - s += ";; flags:" - if h.Response { - s += " qr" - } - if h.Authoritative { - s += " aa" - } - if h.Truncated { - s += " tc" - } - if h.RecursionDesired { - s += " rd" - } - if h.RecursionAvailable { - s += " ra" - } - if h.Zero { // Hmm - s += " z" - } - if h.AuthenticatedData { - s += " ad" - } - if h.CheckingDisabled { - s += " cd" - } - - s += ";" - return s -} - -// Pack packs a Msg: it is converted to to wire format. -// If the dns.Compress is true the message will be in compressed wire format. -func (dns *Msg) Pack() (msg []byte, err error) { - return dns.PackBuffer(nil) -} - -// PackBuffer packs a Msg, using the given buffer buf. If buf is too small a new buffer is allocated. -func (dns *Msg) PackBuffer(buf []byte) (msg []byte, err error) { - // If this message can't be compressed, avoid filling the - // compression map and creating garbage. - if dns.Compress && dns.isCompressible() { - compression := make(map[string]uint16) // Compression pointer mappings. - return dns.packBufferWithCompressionMap(buf, compressionMap{int: compression}, true) - } - - return dns.packBufferWithCompressionMap(buf, compressionMap{}, false) -} - -// packBufferWithCompressionMap packs a Msg, using the given buffer buf. -func (dns *Msg) packBufferWithCompressionMap(buf []byte, compression compressionMap, compress bool) (msg []byte, err error) { - if dns.Rcode < 0 || dns.Rcode > 0xFFF { - return nil, ErrRcode - } - - // Set extended rcode unconditionally if we have an opt, this will allow - // reseting the extended rcode bits if they need to. - if opt := dns.IsEdns0(); opt != nil { - opt.SetExtendedRcode(uint16(dns.Rcode)) - } else if dns.Rcode > 0xF { - // If Rcode is an extended one and opt is nil, error out. - return nil, ErrExtendedRcode - } - - // Convert convenient Msg into wire-like Header. - var dh Header - dh.Id = dns.Id - dh.Bits = uint16(dns.Opcode)<<11 | uint16(dns.Rcode&0xF) - if dns.Response { - dh.Bits |= _QR - } - if dns.Authoritative { - dh.Bits |= _AA - } - if dns.Truncated { - dh.Bits |= _TC - } - if dns.RecursionDesired { - dh.Bits |= _RD - } - if dns.RecursionAvailable { - dh.Bits |= _RA - } - if dns.Zero { - dh.Bits |= _Z - } - if dns.AuthenticatedData { - dh.Bits |= _AD - } - if dns.CheckingDisabled { - dh.Bits |= _CD - } - - dh.Qdcount = uint16(len(dns.Question)) - dh.Ancount = uint16(len(dns.Answer)) - dh.Nscount = uint16(len(dns.Ns)) - dh.Arcount = uint16(len(dns.Extra)) - - // We need the uncompressed length here, because we first pack it and then compress it. - msg = buf - uncompressedLen := msgLenWithCompressionMap(dns, nil) - if packLen := uncompressedLen + 1; len(msg) < packLen { - msg = make([]byte, packLen) - } - - // Pack it in: header and then the pieces. - off := 0 - off, err = dh.pack(msg, off, compression, compress) - if err != nil { - return nil, err - } - for _, r := range dns.Question { - off, err = r.pack(msg, off, compression, compress) - if err != nil { - return nil, err - } - } - for _, r := range dns.Answer { - _, off, err = packRR(r, msg, off, compression, compress) - if err != nil { - return nil, err - } - } - for _, r := range dns.Ns { - _, off, err = packRR(r, msg, off, compression, compress) - if err != nil { - return nil, err - } - } - for _, r := range dns.Extra { - _, off, err = packRR(r, msg, off, compression, compress) - if err != nil { - return nil, err - } - } - return msg[:off], nil -} - -func (dns *Msg) unpack(dh Header, msg []byte, off int) (err error) { - // If we are at the end of the message we should return *just* the - // header. This can still be useful to the caller. 9.9.9.9 sends these - // when responding with REFUSED for instance. - if off == len(msg) { - // reset sections before returning - dns.Question, dns.Answer, dns.Ns, dns.Extra = nil, nil, nil, nil - return nil - } - - // Qdcount, Ancount, Nscount, Arcount can't be trusted, as they are - // attacker controlled. This means we can't use them to pre-allocate - // slices. - dns.Question = nil - for i := 0; i < int(dh.Qdcount); i++ { - off1 := off - var q Question - q, off, err = unpackQuestion(msg, off) - if err != nil { - return err - } - if off1 == off { // Offset does not increase anymore, dh.Qdcount is a lie! - dh.Qdcount = uint16(i) - break - } - dns.Question = append(dns.Question, q) - } - - dns.Answer, off, err = unpackRRslice(int(dh.Ancount), msg, off) - // The header counts might have been wrong so we need to update it - dh.Ancount = uint16(len(dns.Answer)) - if err == nil { - dns.Ns, off, err = unpackRRslice(int(dh.Nscount), msg, off) - } - // The header counts might have been wrong so we need to update it - dh.Nscount = uint16(len(dns.Ns)) - if err == nil { - dns.Extra, off, err = unpackRRslice(int(dh.Arcount), msg, off) - } - // The header counts might have been wrong so we need to update it - dh.Arcount = uint16(len(dns.Extra)) - - // Set extended Rcode - if opt := dns.IsEdns0(); opt != nil { - dns.Rcode |= opt.ExtendedRcode() - } - - if off != len(msg) { - // TODO(miek) make this an error? - // use PackOpt to let people tell how detailed the error reporting should be? - // println("dns: extra bytes in dns packet", off, "<", len(msg)) - } - return err - -} - -// Unpack unpacks a binary message to a Msg structure. -func (dns *Msg) Unpack(msg []byte) (err error) { - dh, off, err := unpackMsgHdr(msg, 0) - if err != nil { - return err - } - - dns.setHdr(dh) - return dns.unpack(dh, msg, off) -} - -// Convert a complete message to a string with dig-like output. -func (dns *Msg) String() string { - if dns == nil { - return " MsgHdr" - } - s := dns.MsgHdr.String() + " " - s += "QUERY: " + strconv.Itoa(len(dns.Question)) + ", " - s += "ANSWER: " + strconv.Itoa(len(dns.Answer)) + ", " - s += "AUTHORITY: " + strconv.Itoa(len(dns.Ns)) + ", " - s += "ADDITIONAL: " + strconv.Itoa(len(dns.Extra)) + "\n" - if len(dns.Question) > 0 { - s += "\n;; QUESTION SECTION:\n" - for _, r := range dns.Question { - s += r.String() + "\n" - } - } - if len(dns.Answer) > 0 { - s += "\n;; ANSWER SECTION:\n" - for _, r := range dns.Answer { - if r != nil { - s += r.String() + "\n" - } - } - } - if len(dns.Ns) > 0 { - s += "\n;; AUTHORITY SECTION:\n" - for _, r := range dns.Ns { - if r != nil { - s += r.String() + "\n" - } - } - } - if len(dns.Extra) > 0 { - s += "\n;; ADDITIONAL SECTION:\n" - for _, r := range dns.Extra { - if r != nil { - s += r.String() + "\n" - } - } - } - return s -} - -// isCompressible returns whether the msg may be compressible. -func (dns *Msg) isCompressible() bool { - // If we only have one question, there is nothing we can ever compress. - return len(dns.Question) > 1 || len(dns.Answer) > 0 || - len(dns.Ns) > 0 || len(dns.Extra) > 0 -} - -// Len returns the message length when in (un)compressed wire format. -// If dns.Compress is true compression it is taken into account. Len() -// is provided to be a faster way to get the size of the resulting packet, -// than packing it, measuring the size and discarding the buffer. -func (dns *Msg) Len() int { - // If this message can't be compressed, avoid filling the - // compression map and creating garbage. - if dns.Compress && dns.isCompressible() { - compression := make(map[string]struct{}) - return msgLenWithCompressionMap(dns, compression) - } - - return msgLenWithCompressionMap(dns, nil) -} - -func msgLenWithCompressionMap(dns *Msg, compression map[string]struct{}) int { - l := headerSize - - for _, r := range dns.Question { - l += r.len(l, compression) - } - for _, r := range dns.Answer { - if r != nil { - l += r.len(l, compression) - } - } - for _, r := range dns.Ns { - if r != nil { - l += r.len(l, compression) - } - } - for _, r := range dns.Extra { - if r != nil { - l += r.len(l, compression) - } - } - - return l -} - -func domainNameLen(s string, off int, compression map[string]struct{}, compress bool) int { - if s == "" || s == "." { - return 1 - } - - escaped := strings.Contains(s, "\\") - - if compression != nil && (compress || off < maxCompressionOffset) { - // compressionLenSearch will insert the entry into the compression - // map if it doesn't contain it. - if l, ok := compressionLenSearch(compression, s, off); ok && compress { - if escaped { - return escapedNameLen(s[:l]) + 2 - } - - return l + 2 - } - } - - if escaped { - return escapedNameLen(s) + 1 - } - - return len(s) + 1 -} - -func escapedNameLen(s string) int { - nameLen := len(s) - for i := 0; i < len(s); i++ { - if s[i] != '\\' { - continue - } - - if i+3 < len(s) && isDigit(s[i+1]) && isDigit(s[i+2]) && isDigit(s[i+3]) { - nameLen -= 3 - i += 3 - } else { - nameLen-- - i++ - } - } - - return nameLen -} - -func compressionLenSearch(c map[string]struct{}, s string, msgOff int) (int, bool) { - for off, end := 0, false; !end; off, end = NextLabel(s, off) { - if _, ok := c[s[off:]]; ok { - return off, true - } - - if msgOff+off < maxCompressionOffset { - c[s[off:]] = struct{}{} - } - } - - return 0, false -} - -// Copy returns a new RR which is a deep-copy of r. -func Copy(r RR) RR { return r.copy() } - -// Len returns the length (in octets) of the uncompressed RR in wire format. -func Len(r RR) int { return r.len(0, nil) } - -// Copy returns a new *Msg which is a deep-copy of dns. -func (dns *Msg) Copy() *Msg { return dns.CopyTo(new(Msg)) } - -// CopyTo copies the contents to the provided message using a deep-copy and returns the copy. -func (dns *Msg) CopyTo(r1 *Msg) *Msg { - r1.MsgHdr = dns.MsgHdr - r1.Compress = dns.Compress - - if len(dns.Question) > 0 { - r1.Question = make([]Question, len(dns.Question)) - copy(r1.Question, dns.Question) // TODO(miek): Question is an immutable value, ok to do a shallow-copy - } - - rrArr := make([]RR, len(dns.Answer)+len(dns.Ns)+len(dns.Extra)) - r1.Answer, rrArr = rrArr[:0:len(dns.Answer)], rrArr[len(dns.Answer):] - r1.Ns, rrArr = rrArr[:0:len(dns.Ns)], rrArr[len(dns.Ns):] - r1.Extra = rrArr[:0:len(dns.Extra)] - - for _, r := range dns.Answer { - r1.Answer = append(r1.Answer, r.copy()) - } - - for _, r := range dns.Ns { - r1.Ns = append(r1.Ns, r.copy()) - } - - for _, r := range dns.Extra { - r1.Extra = append(r1.Extra, r.copy()) - } - - return r1 -} - -func (q *Question) pack(msg []byte, off int, compression compressionMap, compress bool) (int, error) { - off, err := packDomainName(q.Name, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packUint16(q.Qtype, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(q.Qclass, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func unpackQuestion(msg []byte, off int) (Question, int, error) { - var ( - q Question - err error - ) - q.Name, off, err = UnpackDomainName(msg, off) - if err != nil { - return q, off, err - } - if off == len(msg) { - return q, off, nil - } - q.Qtype, off, err = unpackUint16(msg, off) - if err != nil { - return q, off, err - } - if off == len(msg) { - return q, off, nil - } - q.Qclass, off, err = unpackUint16(msg, off) - if off == len(msg) { - return q, off, nil - } - return q, off, err -} - -func (dh *Header) pack(msg []byte, off int, compression compressionMap, compress bool) (int, error) { - off, err := packUint16(dh.Id, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Bits, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Qdcount, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Ancount, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Nscount, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(dh.Arcount, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func unpackMsgHdr(msg []byte, off int) (Header, int, error) { - var ( - dh Header - err error - ) - dh.Id, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Bits, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Qdcount, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Ancount, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Nscount, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - dh.Arcount, off, err = unpackUint16(msg, off) - if err != nil { - return dh, off, err - } - return dh, off, nil -} - -// setHdr set the header in the dns using the binary data in dh. -func (dns *Msg) setHdr(dh Header) { - dns.Id = dh.Id - dns.Response = dh.Bits&_QR != 0 - dns.Opcode = int(dh.Bits>>11) & 0xF - dns.Authoritative = dh.Bits&_AA != 0 - dns.Truncated = dh.Bits&_TC != 0 - dns.RecursionDesired = dh.Bits&_RD != 0 - dns.RecursionAvailable = dh.Bits&_RA != 0 - dns.Zero = dh.Bits&_Z != 0 // _Z covers the zero bit, which should be zero; not sure why we set it to the opposite. - dns.AuthenticatedData = dh.Bits&_AD != 0 - dns.CheckingDisabled = dh.Bits&_CD != 0 - dns.Rcode = int(dh.Bits & 0xF) -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/msg_helpers.go b/cluster-autoscaler/vendor/github.com/miekg/dns/msg_helpers.go deleted file mode 100644 index 47625ed0902d..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/msg_helpers.go +++ /dev/null @@ -1,833 +0,0 @@ -package dns - -import ( - "encoding/base32" - "encoding/base64" - "encoding/binary" - "encoding/hex" - "net" - "sort" - "strings" -) - -// helper functions called from the generated zmsg.go - -// These function are named after the tag to help pack/unpack, if there is no tag it is the name -// of the type they pack/unpack (string, int, etc). We prefix all with unpackData or packData, so packDataA or -// packDataDomainName. - -func unpackDataA(msg []byte, off int) (net.IP, int, error) { - if off+net.IPv4len > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking a"} - } - a := append(make(net.IP, 0, net.IPv4len), msg[off:off+net.IPv4len]...) - off += net.IPv4len - return a, off, nil -} - -func packDataA(a net.IP, msg []byte, off int) (int, error) { - switch len(a) { - case net.IPv4len, net.IPv6len: - // It must be a slice of 4, even if it is 16, we encode only the first 4 - if off+net.IPv4len > len(msg) { - return len(msg), &Error{err: "overflow packing a"} - } - - copy(msg[off:], a.To4()) - off += net.IPv4len - case 0: - // Allowed, for dynamic updates. - default: - return len(msg), &Error{err: "overflow packing a"} - } - return off, nil -} - -func unpackDataAAAA(msg []byte, off int) (net.IP, int, error) { - if off+net.IPv6len > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking aaaa"} - } - aaaa := append(make(net.IP, 0, net.IPv6len), msg[off:off+net.IPv6len]...) - off += net.IPv6len - return aaaa, off, nil -} - -func packDataAAAA(aaaa net.IP, msg []byte, off int) (int, error) { - switch len(aaaa) { - case net.IPv6len: - if off+net.IPv6len > len(msg) { - return len(msg), &Error{err: "overflow packing aaaa"} - } - - copy(msg[off:], aaaa) - off += net.IPv6len - case 0: - // Allowed, dynamic updates. - default: - return len(msg), &Error{err: "overflow packing aaaa"} - } - return off, nil -} - -// unpackHeader unpacks an RR header, returning the offset to the end of the header and a -// re-sliced msg according to the expected length of the RR. -func unpackHeader(msg []byte, off int) (rr RR_Header, off1 int, truncmsg []byte, err error) { - hdr := RR_Header{} - if off == len(msg) { - return hdr, off, msg, nil - } - - hdr.Name, off, err = UnpackDomainName(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - hdr.Rrtype, off, err = unpackUint16(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - hdr.Class, off, err = unpackUint16(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - hdr.Ttl, off, err = unpackUint32(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - hdr.Rdlength, off, err = unpackUint16(msg, off) - if err != nil { - return hdr, len(msg), msg, err - } - msg, err = truncateMsgFromRdlength(msg, off, hdr.Rdlength) - return hdr, off, msg, err -} - -// packHeader packs an RR header, returning the offset to the end of the header. -// See PackDomainName for documentation about the compression. -func (hdr RR_Header) packHeader(msg []byte, off int, compression compressionMap, compress bool) (int, error) { - if off == len(msg) { - return off, nil - } - - off, err := packDomainName(hdr.Name, msg, off, compression, compress) - if err != nil { - return len(msg), err - } - off, err = packUint16(hdr.Rrtype, msg, off) - if err != nil { - return len(msg), err - } - off, err = packUint16(hdr.Class, msg, off) - if err != nil { - return len(msg), err - } - off, err = packUint32(hdr.Ttl, msg, off) - if err != nil { - return len(msg), err - } - off, err = packUint16(0, msg, off) // The RDLENGTH field will be set later in packRR. - if err != nil { - return len(msg), err - } - return off, nil -} - -// helper helper functions. - -// truncateMsgFromRdLength truncates msg to match the expected length of the RR. -// Returns an error if msg is smaller than the expected size. -func truncateMsgFromRdlength(msg []byte, off int, rdlength uint16) (truncmsg []byte, err error) { - lenrd := off + int(rdlength) - if lenrd > len(msg) { - return msg, &Error{err: "overflowing header size"} - } - return msg[:lenrd], nil -} - -var base32HexNoPadEncoding = base32.HexEncoding.WithPadding(base32.NoPadding) - -func fromBase32(s []byte) (buf []byte, err error) { - for i, b := range s { - if b >= 'a' && b <= 'z' { - s[i] = b - 32 - } - } - buflen := base32HexNoPadEncoding.DecodedLen(len(s)) - buf = make([]byte, buflen) - n, err := base32HexNoPadEncoding.Decode(buf, s) - buf = buf[:n] - return -} - -func toBase32(b []byte) string { - return base32HexNoPadEncoding.EncodeToString(b) -} - -func fromBase64(s []byte) (buf []byte, err error) { - buflen := base64.StdEncoding.DecodedLen(len(s)) - buf = make([]byte, buflen) - n, err := base64.StdEncoding.Decode(buf, s) - buf = buf[:n] - return -} - -func toBase64(b []byte) string { return base64.StdEncoding.EncodeToString(b) } - -// dynamicUpdate returns true if the Rdlength is zero. -func noRdata(h RR_Header) bool { return h.Rdlength == 0 } - -func unpackUint8(msg []byte, off int) (i uint8, off1 int, err error) { - if off+1 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint8"} - } - return msg[off], off + 1, nil -} - -func packUint8(i uint8, msg []byte, off int) (off1 int, err error) { - if off+1 > len(msg) { - return len(msg), &Error{err: "overflow packing uint8"} - } - msg[off] = i - return off + 1, nil -} - -func unpackUint16(msg []byte, off int) (i uint16, off1 int, err error) { - if off+2 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint16"} - } - return binary.BigEndian.Uint16(msg[off:]), off + 2, nil -} - -func packUint16(i uint16, msg []byte, off int) (off1 int, err error) { - if off+2 > len(msg) { - return len(msg), &Error{err: "overflow packing uint16"} - } - binary.BigEndian.PutUint16(msg[off:], i) - return off + 2, nil -} - -func unpackUint32(msg []byte, off int) (i uint32, off1 int, err error) { - if off+4 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint32"} - } - return binary.BigEndian.Uint32(msg[off:]), off + 4, nil -} - -func packUint32(i uint32, msg []byte, off int) (off1 int, err error) { - if off+4 > len(msg) { - return len(msg), &Error{err: "overflow packing uint32"} - } - binary.BigEndian.PutUint32(msg[off:], i) - return off + 4, nil -} - -func unpackUint48(msg []byte, off int) (i uint64, off1 int, err error) { - if off+6 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint64 as uint48"} - } - // Used in TSIG where the last 48 bits are occupied, so for now, assume a uint48 (6 bytes) - i = uint64(msg[off])<<40 | uint64(msg[off+1])<<32 | uint64(msg[off+2])<<24 | uint64(msg[off+3])<<16 | - uint64(msg[off+4])<<8 | uint64(msg[off+5]) - off += 6 - return i, off, nil -} - -func packUint48(i uint64, msg []byte, off int) (off1 int, err error) { - if off+6 > len(msg) { - return len(msg), &Error{err: "overflow packing uint64 as uint48"} - } - msg[off] = byte(i >> 40) - msg[off+1] = byte(i >> 32) - msg[off+2] = byte(i >> 24) - msg[off+3] = byte(i >> 16) - msg[off+4] = byte(i >> 8) - msg[off+5] = byte(i) - off += 6 - return off, nil -} - -func unpackUint64(msg []byte, off int) (i uint64, off1 int, err error) { - if off+8 > len(msg) { - return 0, len(msg), &Error{err: "overflow unpacking uint64"} - } - return binary.BigEndian.Uint64(msg[off:]), off + 8, nil -} - -func packUint64(i uint64, msg []byte, off int) (off1 int, err error) { - if off+8 > len(msg) { - return len(msg), &Error{err: "overflow packing uint64"} - } - binary.BigEndian.PutUint64(msg[off:], i) - off += 8 - return off, nil -} - -func unpackString(msg []byte, off int) (string, int, error) { - if off+1 > len(msg) { - return "", off, &Error{err: "overflow unpacking txt"} - } - l := int(msg[off]) - off++ - if off+l > len(msg) { - return "", off, &Error{err: "overflow unpacking txt"} - } - var s strings.Builder - consumed := 0 - for i, b := range msg[off : off+l] { - switch { - case b == '"' || b == '\\': - if consumed == 0 { - s.Grow(l * 2) - } - s.Write(msg[off+consumed : off+i]) - s.WriteByte('\\') - s.WriteByte(b) - consumed = i + 1 - case b < ' ' || b > '~': // unprintable - if consumed == 0 { - s.Grow(l * 2) - } - s.Write(msg[off+consumed : off+i]) - s.WriteString(escapeByte(b)) - consumed = i + 1 - } - } - if consumed == 0 { // no escaping needed - return string(msg[off : off+l]), off + l, nil - } - s.Write(msg[off+consumed : off+l]) - return s.String(), off + l, nil -} - -func packString(s string, msg []byte, off int) (int, error) { - txtTmp := make([]byte, 256*4+1) - off, err := packTxtString(s, msg, off, txtTmp) - if err != nil { - return len(msg), err - } - return off, nil -} - -func unpackStringBase32(msg []byte, off, end int) (string, int, error) { - if end > len(msg) { - return "", len(msg), &Error{err: "overflow unpacking base32"} - } - s := toBase32(msg[off:end]) - return s, end, nil -} - -func packStringBase32(s string, msg []byte, off int) (int, error) { - b32, err := fromBase32([]byte(s)) - if err != nil { - return len(msg), err - } - if off+len(b32) > len(msg) { - return len(msg), &Error{err: "overflow packing base32"} - } - copy(msg[off:off+len(b32)], b32) - off += len(b32) - return off, nil -} - -func unpackStringBase64(msg []byte, off, end int) (string, int, error) { - // Rest of the RR is base64 encoded value, so we don't need an explicit length - // to be set. Thus far all RR's that have base64 encoded fields have those as their - // last one. What we do need is the end of the RR! - if end > len(msg) { - return "", len(msg), &Error{err: "overflow unpacking base64"} - } - s := toBase64(msg[off:end]) - return s, end, nil -} - -func packStringBase64(s string, msg []byte, off int) (int, error) { - b64, err := fromBase64([]byte(s)) - if err != nil { - return len(msg), err - } - if off+len(b64) > len(msg) { - return len(msg), &Error{err: "overflow packing base64"} - } - copy(msg[off:off+len(b64)], b64) - off += len(b64) - return off, nil -} - -func unpackStringHex(msg []byte, off, end int) (string, int, error) { - // Rest of the RR is hex encoded value, so we don't need an explicit length - // to be set. NSEC and TSIG have hex fields with a length field. - // What we do need is the end of the RR! - if end > len(msg) { - return "", len(msg), &Error{err: "overflow unpacking hex"} - } - - s := hex.EncodeToString(msg[off:end]) - return s, end, nil -} - -func packStringHex(s string, msg []byte, off int) (int, error) { - h, err := hex.DecodeString(s) - if err != nil { - return len(msg), err - } - if off+len(h) > len(msg) { - return len(msg), &Error{err: "overflow packing hex"} - } - copy(msg[off:off+len(h)], h) - off += len(h) - return off, nil -} - -func unpackStringAny(msg []byte, off, end int) (string, int, error) { - if end > len(msg) { - return "", len(msg), &Error{err: "overflow unpacking anything"} - } - return string(msg[off:end]), end, nil -} - -func packStringAny(s string, msg []byte, off int) (int, error) { - if off+len(s) > len(msg) { - return len(msg), &Error{err: "overflow packing anything"} - } - copy(msg[off:off+len(s)], s) - off += len(s) - return off, nil -} - -func unpackStringTxt(msg []byte, off int) ([]string, int, error) { - txt, off, err := unpackTxt(msg, off) - if err != nil { - return nil, len(msg), err - } - return txt, off, nil -} - -func packStringTxt(s []string, msg []byte, off int) (int, error) { - txtTmp := make([]byte, 256*4+1) // If the whole string consists out of \DDD we need this many. - off, err := packTxt(s, msg, off, txtTmp) - if err != nil { - return len(msg), err - } - return off, nil -} - -func unpackDataOpt(msg []byte, off int) ([]EDNS0, int, error) { - var edns []EDNS0 -Option: - var code uint16 - if off+4 > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking opt"} - } - code = binary.BigEndian.Uint16(msg[off:]) - off += 2 - optlen := binary.BigEndian.Uint16(msg[off:]) - off += 2 - if off+int(optlen) > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking opt"} - } - e := makeDataOpt(code) - if err := e.unpack(msg[off : off+int(optlen)]); err != nil { - return nil, len(msg), err - } - edns = append(edns, e) - off += int(optlen) - - if off < len(msg) { - goto Option - } - - return edns, off, nil -} - -func makeDataOpt(code uint16) EDNS0 { - switch code { - case EDNS0NSID: - return new(EDNS0_NSID) - case EDNS0SUBNET: - return new(EDNS0_SUBNET) - case EDNS0COOKIE: - return new(EDNS0_COOKIE) - case EDNS0EXPIRE: - return new(EDNS0_EXPIRE) - case EDNS0UL: - return new(EDNS0_UL) - case EDNS0LLQ: - return new(EDNS0_LLQ) - case EDNS0DAU: - return new(EDNS0_DAU) - case EDNS0DHU: - return new(EDNS0_DHU) - case EDNS0N3U: - return new(EDNS0_N3U) - case EDNS0PADDING: - return new(EDNS0_PADDING) - default: - e := new(EDNS0_LOCAL) - e.Code = code - return e - } -} - -func packDataOpt(options []EDNS0, msg []byte, off int) (int, error) { - for _, el := range options { - b, err := el.pack() - if err != nil || off+4 > len(msg) { - return len(msg), &Error{err: "overflow packing opt"} - } - binary.BigEndian.PutUint16(msg[off:], el.Option()) // Option code - binary.BigEndian.PutUint16(msg[off+2:], uint16(len(b))) // Length - off += 4 - if off+len(b) > len(msg) { - return len(msg), &Error{err: "overflow packing opt"} - } - // Actual data - copy(msg[off:off+len(b)], b) - off += len(b) - } - return off, nil -} - -func unpackStringOctet(msg []byte, off int) (string, int, error) { - s := string(msg[off:]) - return s, len(msg), nil -} - -func packStringOctet(s string, msg []byte, off int) (int, error) { - txtTmp := make([]byte, 256*4+1) - off, err := packOctetString(s, msg, off, txtTmp) - if err != nil { - return len(msg), err - } - return off, nil -} - -func unpackDataNsec(msg []byte, off int) ([]uint16, int, error) { - var nsec []uint16 - length, window, lastwindow := 0, 0, -1 - for off < len(msg) { - if off+2 > len(msg) { - return nsec, len(msg), &Error{err: "overflow unpacking nsecx"} - } - window = int(msg[off]) - length = int(msg[off+1]) - off += 2 - if window <= lastwindow { - // RFC 4034: Blocks are present in the NSEC RR RDATA in - // increasing numerical order. - return nsec, len(msg), &Error{err: "out of order NSEC block"} - } - if length == 0 { - // RFC 4034: Blocks with no types present MUST NOT be included. - return nsec, len(msg), &Error{err: "empty NSEC block"} - } - if length > 32 { - return nsec, len(msg), &Error{err: "NSEC block too long"} - } - if off+length > len(msg) { - return nsec, len(msg), &Error{err: "overflowing NSEC block"} - } - - // Walk the bytes in the window and extract the type bits - for j, b := range msg[off : off+length] { - // Check the bits one by one, and set the type - if b&0x80 == 0x80 { - nsec = append(nsec, uint16(window*256+j*8+0)) - } - if b&0x40 == 0x40 { - nsec = append(nsec, uint16(window*256+j*8+1)) - } - if b&0x20 == 0x20 { - nsec = append(nsec, uint16(window*256+j*8+2)) - } - if b&0x10 == 0x10 { - nsec = append(nsec, uint16(window*256+j*8+3)) - } - if b&0x8 == 0x8 { - nsec = append(nsec, uint16(window*256+j*8+4)) - } - if b&0x4 == 0x4 { - nsec = append(nsec, uint16(window*256+j*8+5)) - } - if b&0x2 == 0x2 { - nsec = append(nsec, uint16(window*256+j*8+6)) - } - if b&0x1 == 0x1 { - nsec = append(nsec, uint16(window*256+j*8+7)) - } - } - off += length - lastwindow = window - } - return nsec, off, nil -} - -// typeBitMapLen is a helper function which computes the "maximum" length of -// a the NSEC Type BitMap field. -func typeBitMapLen(bitmap []uint16) int { - var l int - var lastwindow, lastlength uint16 - for _, t := range bitmap { - window := t / 256 - length := (t-window*256)/8 + 1 - if window > lastwindow && lastlength != 0 { // New window, jump to the new offset - l += int(lastlength) + 2 - lastlength = 0 - } - if window < lastwindow || length < lastlength { - // packDataNsec would return Error{err: "nsec bits out of order"} here, but - // when computing the length, we want do be liberal. - continue - } - lastwindow, lastlength = window, length - } - l += int(lastlength) + 2 - return l -} - -func packDataNsec(bitmap []uint16, msg []byte, off int) (int, error) { - if len(bitmap) == 0 { - return off, nil - } - var lastwindow, lastlength uint16 - for _, t := range bitmap { - window := t / 256 - length := (t-window*256)/8 + 1 - if window > lastwindow && lastlength != 0 { // New window, jump to the new offset - off += int(lastlength) + 2 - lastlength = 0 - } - if window < lastwindow || length < lastlength { - return len(msg), &Error{err: "nsec bits out of order"} - } - if off+2+int(length) > len(msg) { - return len(msg), &Error{err: "overflow packing nsec"} - } - // Setting the window # - msg[off] = byte(window) - // Setting the octets length - msg[off+1] = byte(length) - // Setting the bit value for the type in the right octet - msg[off+1+int(length)] |= byte(1 << (7 - t%8)) - lastwindow, lastlength = window, length - } - off += int(lastlength) + 2 - return off, nil -} - -func unpackDataSVCB(msg []byte, off int) ([]SVCBKeyValue, int, error) { - var xs []SVCBKeyValue - var code uint16 - var length uint16 - var err error - for off < len(msg) { - code, off, err = unpackUint16(msg, off) - if err != nil { - return nil, len(msg), &Error{err: "overflow unpacking SVCB"} - } - length, off, err = unpackUint16(msg, off) - if err != nil || off+int(length) > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking SVCB"} - } - e := makeSVCBKeyValue(SVCBKey(code)) - if e == nil { - return nil, len(msg), &Error{err: "bad SVCB key"} - } - if err := e.unpack(msg[off : off+int(length)]); err != nil { - return nil, len(msg), err - } - if len(xs) > 0 && e.Key() <= xs[len(xs)-1].Key() { - return nil, len(msg), &Error{err: "SVCB keys not in strictly increasing order"} - } - xs = append(xs, e) - off += int(length) - } - return xs, off, nil -} - -func packDataSVCB(pairs []SVCBKeyValue, msg []byte, off int) (int, error) { - pairs = append([]SVCBKeyValue(nil), pairs...) - sort.Slice(pairs, func(i, j int) bool { - return pairs[i].Key() < pairs[j].Key() - }) - prev := svcb_RESERVED - for _, el := range pairs { - if el.Key() == prev { - return len(msg), &Error{err: "repeated SVCB keys are not allowed"} - } - prev = el.Key() - packed, err := el.pack() - if err != nil { - return len(msg), err - } - off, err = packUint16(uint16(el.Key()), msg, off) - if err != nil { - return len(msg), &Error{err: "overflow packing SVCB"} - } - off, err = packUint16(uint16(len(packed)), msg, off) - if err != nil || off+len(packed) > len(msg) { - return len(msg), &Error{err: "overflow packing SVCB"} - } - copy(msg[off:off+len(packed)], packed) - off += len(packed) - } - return off, nil -} - -func unpackDataDomainNames(msg []byte, off, end int) ([]string, int, error) { - var ( - servers []string - s string - err error - ) - if end > len(msg) { - return nil, len(msg), &Error{err: "overflow unpacking domain names"} - } - for off < end { - s, off, err = UnpackDomainName(msg, off) - if err != nil { - return servers, len(msg), err - } - servers = append(servers, s) - } - return servers, off, nil -} - -func packDataDomainNames(names []string, msg []byte, off int, compression compressionMap, compress bool) (int, error) { - var err error - for _, name := range names { - off, err = packDomainName(name, msg, off, compression, compress) - if err != nil { - return len(msg), err - } - } - return off, nil -} - -func packDataApl(data []APLPrefix, msg []byte, off int) (int, error) { - var err error - for i := range data { - off, err = packDataAplPrefix(&data[i], msg, off) - if err != nil { - return len(msg), err - } - } - return off, nil -} - -func packDataAplPrefix(p *APLPrefix, msg []byte, off int) (int, error) { - if len(p.Network.IP) != len(p.Network.Mask) { - return len(msg), &Error{err: "address and mask lengths don't match"} - } - - var err error - prefix, _ := p.Network.Mask.Size() - addr := p.Network.IP.Mask(p.Network.Mask)[:(prefix+7)/8] - - switch len(p.Network.IP) { - case net.IPv4len: - off, err = packUint16(1, msg, off) - case net.IPv6len: - off, err = packUint16(2, msg, off) - default: - err = &Error{err: "unrecognized address family"} - } - if err != nil { - return len(msg), err - } - - off, err = packUint8(uint8(prefix), msg, off) - if err != nil { - return len(msg), err - } - - var n uint8 - if p.Negation { - n = 0x80 - } - - // trim trailing zero bytes as specified in RFC3123 Sections 4.1 and 4.2. - i := len(addr) - 1 - for ; i >= 0 && addr[i] == 0; i-- { - } - addr = addr[:i+1] - - adflen := uint8(len(addr)) & 0x7f - off, err = packUint8(n|adflen, msg, off) - if err != nil { - return len(msg), err - } - - if off+len(addr) > len(msg) { - return len(msg), &Error{err: "overflow packing APL prefix"} - } - off += copy(msg[off:], addr) - - return off, nil -} - -func unpackDataApl(msg []byte, off int) ([]APLPrefix, int, error) { - var result []APLPrefix - for off < len(msg) { - prefix, end, err := unpackDataAplPrefix(msg, off) - if err != nil { - return nil, len(msg), err - } - off = end - result = append(result, prefix) - } - return result, off, nil -} - -func unpackDataAplPrefix(msg []byte, off int) (APLPrefix, int, error) { - family, off, err := unpackUint16(msg, off) - if err != nil { - return APLPrefix{}, len(msg), &Error{err: "overflow unpacking APL prefix"} - } - prefix, off, err := unpackUint8(msg, off) - if err != nil { - return APLPrefix{}, len(msg), &Error{err: "overflow unpacking APL prefix"} - } - nlen, off, err := unpackUint8(msg, off) - if err != nil { - return APLPrefix{}, len(msg), &Error{err: "overflow unpacking APL prefix"} - } - - var ip []byte - switch family { - case 1: - ip = make([]byte, net.IPv4len) - case 2: - ip = make([]byte, net.IPv6len) - default: - return APLPrefix{}, len(msg), &Error{err: "unrecognized APL address family"} - } - if int(prefix) > 8*len(ip) { - return APLPrefix{}, len(msg), &Error{err: "APL prefix too long"} - } - afdlen := int(nlen & 0x7f) - if afdlen > len(ip) { - return APLPrefix{}, len(msg), &Error{err: "APL length too long"} - } - if off+afdlen > len(msg) { - return APLPrefix{}, len(msg), &Error{err: "overflow unpacking APL address"} - } - off += copy(ip, msg[off:off+afdlen]) - if afdlen > 0 { - last := ip[afdlen-1] - if last == 0 { - return APLPrefix{}, len(msg), &Error{err: "extra APL address bits"} - } - } - ipnet := net.IPNet{ - IP: ip, - Mask: net.CIDRMask(int(prefix), 8*len(ip)), - } - network := ipnet.IP.Mask(ipnet.Mask) - if !network.Equal(ipnet.IP) { - return APLPrefix{}, len(msg), &Error{err: "invalid APL address length"} - } - - return APLPrefix{ - Negation: (nlen & 0x80) != 0, - Network: ipnet, - }, off, nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/msg_truncate.go b/cluster-autoscaler/vendor/github.com/miekg/dns/msg_truncate.go deleted file mode 100644 index 156c5a0e876a..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/msg_truncate.go +++ /dev/null @@ -1,112 +0,0 @@ -package dns - -// Truncate ensures the reply message will fit into the requested buffer -// size by removing records that exceed the requested size. -// -// It will first check if the reply fits without compression and then with -// compression. If it won't fit with compression, Truncate then walks the -// record adding as many records as possible without exceeding the -// requested buffer size. -// -// The TC bit will be set if any records were excluded from the message. -// If the TC bit is already set on the message it will be retained. -// TC indicates that the client should retry over TCP. -// -// According to RFC 2181, the TC bit should only be set if not all of the -// "required" RRs can be included in the response. Unfortunately, we have -// no way of knowing which RRs are required so we set the TC bit if any RR -// had to be omitted from the response. -// -// The appropriate buffer size can be retrieved from the requests OPT -// record, if present, and is transport specific otherwise. dns.MinMsgSize -// should be used for UDP requests without an OPT record, and -// dns.MaxMsgSize for TCP requests without an OPT record. -func (dns *Msg) Truncate(size int) { - if dns.IsTsig() != nil { - // To simplify this implementation, we don't perform - // truncation on responses with a TSIG record. - return - } - - // RFC 6891 mandates that the payload size in an OPT record - // less than 512 (MinMsgSize) bytes must be treated as equal to 512 bytes. - // - // For ease of use, we impose that restriction here. - if size < MinMsgSize { - size = MinMsgSize - } - - l := msgLenWithCompressionMap(dns, nil) // uncompressed length - if l <= size { - // Don't waste effort compressing this message. - dns.Compress = false - return - } - - dns.Compress = true - - edns0 := dns.popEdns0() - if edns0 != nil { - // Account for the OPT record that gets added at the end, - // by subtracting that length from our budget. - // - // The EDNS(0) OPT record must have the root domain and - // it's length is thus unaffected by compression. - size -= Len(edns0) - } - - compression := make(map[string]struct{}) - - l = headerSize - for _, r := range dns.Question { - l += r.len(l, compression) - } - - var numAnswer int - if l < size { - l, numAnswer = truncateLoop(dns.Answer, size, l, compression) - } - - var numNS int - if l < size { - l, numNS = truncateLoop(dns.Ns, size, l, compression) - } - - var numExtra int - if l < size { - _, numExtra = truncateLoop(dns.Extra, size, l, compression) - } - - // See the function documentation for when we set this. - dns.Truncated = dns.Truncated || len(dns.Answer) > numAnswer || - len(dns.Ns) > numNS || len(dns.Extra) > numExtra - - dns.Answer = dns.Answer[:numAnswer] - dns.Ns = dns.Ns[:numNS] - dns.Extra = dns.Extra[:numExtra] - - if edns0 != nil { - // Add the OPT record back onto the additional section. - dns.Extra = append(dns.Extra, edns0) - } -} - -func truncateLoop(rrs []RR, size, l int, compression map[string]struct{}) (int, int) { - for i, r := range rrs { - if r == nil { - continue - } - - l += r.len(l, compression) - if l > size { - // Return size, rather than l prior to this record, - // to prevent any further records being added. - return size, i - } - if l == size { - return l, i + 1 - } - } - - return l, len(rrs) -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/nsecx.go b/cluster-autoscaler/vendor/github.com/miekg/dns/nsecx.go deleted file mode 100644 index f8826817b398..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/nsecx.go +++ /dev/null @@ -1,95 +0,0 @@ -package dns - -import ( - "crypto/sha1" - "encoding/hex" - "strings" -) - -// HashName hashes a string (label) according to RFC 5155. It returns the hashed string in uppercase. -func HashName(label string, ha uint8, iter uint16, salt string) string { - if ha != SHA1 { - return "" - } - - wireSalt := make([]byte, hex.DecodedLen(len(salt))) - n, err := packStringHex(salt, wireSalt, 0) - if err != nil { - return "" - } - wireSalt = wireSalt[:n] - - name := make([]byte, 255) - off, err := PackDomainName(strings.ToLower(label), name, 0, nil, false) - if err != nil { - return "" - } - name = name[:off] - - s := sha1.New() - // k = 0 - s.Write(name) - s.Write(wireSalt) - nsec3 := s.Sum(nil) - - // k > 0 - for k := uint16(0); k < iter; k++ { - s.Reset() - s.Write(nsec3) - s.Write(wireSalt) - nsec3 = s.Sum(nsec3[:0]) - } - - return toBase32(nsec3) -} - -// Cover returns true if a name is covered by the NSEC3 record. -func (rr *NSEC3) Cover(name string) bool { - nameHash := HashName(name, rr.Hash, rr.Iterations, rr.Salt) - owner := strings.ToUpper(rr.Hdr.Name) - labelIndices := Split(owner) - if len(labelIndices) < 2 { - return false - } - ownerHash := owner[:labelIndices[1]-1] - ownerZone := owner[labelIndices[1]:] - if !IsSubDomain(ownerZone, strings.ToUpper(name)) { // name is outside owner zone - return false - } - - nextHash := rr.NextDomain - - // if empty interval found, try cover wildcard hashes so nameHash shouldn't match with ownerHash - if ownerHash == nextHash && nameHash != ownerHash { // empty interval - return true - } - if ownerHash > nextHash { // end of zone - if nameHash > ownerHash { // covered since there is nothing after ownerHash - return true - } - return nameHash < nextHash // if nameHash is before beginning of zone it is covered - } - if nameHash < ownerHash { // nameHash is before ownerHash, not covered - return false - } - return nameHash < nextHash // if nameHash is before nextHash is it covered (between ownerHash and nextHash) -} - -// Match returns true if a name matches the NSEC3 record -func (rr *NSEC3) Match(name string) bool { - nameHash := HashName(name, rr.Hash, rr.Iterations, rr.Salt) - owner := strings.ToUpper(rr.Hdr.Name) - labelIndices := Split(owner) - if len(labelIndices) < 2 { - return false - } - ownerHash := owner[:labelIndices[1]-1] - ownerZone := owner[labelIndices[1]:] - if !IsSubDomain(ownerZone, strings.ToUpper(name)) { // name is outside owner zone - return false - } - if ownerHash == nameHash { - return true - } - return false -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/privaterr.go b/cluster-autoscaler/vendor/github.com/miekg/dns/privaterr.go deleted file mode 100644 index cda6cae31e12..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/privaterr.go +++ /dev/null @@ -1,113 +0,0 @@ -package dns - -import "strings" - -// PrivateRdata is an interface used for implementing "Private Use" RR types, see -// RFC 6895. This allows one to experiment with new RR types, without requesting an -// official type code. Also see dns.PrivateHandle and dns.PrivateHandleRemove. -type PrivateRdata interface { - // String returns the text presentaton of the Rdata of the Private RR. - String() string - // Parse parses the Rdata of the private RR. - Parse([]string) error - // Pack is used when packing a private RR into a buffer. - Pack([]byte) (int, error) - // Unpack is used when unpacking a private RR from a buffer. - Unpack([]byte) (int, error) - // Copy copies the Rdata into the PrivateRdata argument. - Copy(PrivateRdata) error - // Len returns the length in octets of the Rdata. - Len() int -} - -// PrivateRR represents an RR that uses a PrivateRdata user-defined type. -// It mocks normal RRs and implements dns.RR interface. -type PrivateRR struct { - Hdr RR_Header - Data PrivateRdata - - generator func() PrivateRdata // for copy -} - -// Header return the RR header of r. -func (r *PrivateRR) Header() *RR_Header { return &r.Hdr } - -func (r *PrivateRR) String() string { return r.Hdr.String() + r.Data.String() } - -// Private len and copy parts to satisfy RR interface. -func (r *PrivateRR) len(off int, compression map[string]struct{}) int { - l := r.Hdr.len(off, compression) - l += r.Data.Len() - return l -} - -func (r *PrivateRR) copy() RR { - // make new RR like this: - rr := &PrivateRR{r.Hdr, r.generator(), r.generator} - - if err := r.Data.Copy(rr.Data); err != nil { - panic("dns: got value that could not be used to copy Private rdata: " + err.Error()) - } - - return rr -} - -func (r *PrivateRR) pack(msg []byte, off int, compression compressionMap, compress bool) (int, error) { - n, err := r.Data.Pack(msg[off:]) - if err != nil { - return len(msg), err - } - off += n - return off, nil -} - -func (r *PrivateRR) unpack(msg []byte, off int) (int, error) { - off1, err := r.Data.Unpack(msg[off:]) - off += off1 - return off, err -} - -func (r *PrivateRR) parse(c *zlexer, origin string) *ParseError { - var l lex - text := make([]string, 0, 2) // could be 0..N elements, median is probably 1 -Fetch: - for { - // TODO(miek): we could also be returning _QUOTE, this might or might not - // be an issue (basically parsing TXT becomes hard) - switch l, _ = c.Next(); l.value { - case zNewline, zEOF: - break Fetch - case zString: - text = append(text, l.token) - } - } - - err := r.Data.Parse(text) - if err != nil { - return &ParseError{"", err.Error(), l} - } - - return nil -} - -func (r1 *PrivateRR) isDuplicate(r2 RR) bool { return false } - -// PrivateHandle registers a private resource record type. It requires -// string and numeric representation of private RR type and generator function as argument. -func PrivateHandle(rtypestr string, rtype uint16, generator func() PrivateRdata) { - rtypestr = strings.ToUpper(rtypestr) - - TypeToRR[rtype] = func() RR { return &PrivateRR{RR_Header{}, generator(), generator} } - TypeToString[rtype] = rtypestr - StringToType[rtypestr] = rtype -} - -// PrivateHandleRemove removes definitions required to support private RR type. -func PrivateHandleRemove(rtype uint16) { - rtypestr, ok := TypeToString[rtype] - if ok { - delete(TypeToRR, rtype) - delete(TypeToString, rtype) - delete(StringToType, rtypestr) - } -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/reverse.go b/cluster-autoscaler/vendor/github.com/miekg/dns/reverse.go deleted file mode 100644 index 28151af83598..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/reverse.go +++ /dev/null @@ -1,52 +0,0 @@ -package dns - -// StringToType is the reverse of TypeToString, needed for string parsing. -var StringToType = reverseInt16(TypeToString) - -// StringToClass is the reverse of ClassToString, needed for string parsing. -var StringToClass = reverseInt16(ClassToString) - -// StringToOpcode is a map of opcodes to strings. -var StringToOpcode = reverseInt(OpcodeToString) - -// StringToRcode is a map of rcodes to strings. -var StringToRcode = reverseInt(RcodeToString) - -func init() { - // Preserve previous NOTIMP typo, see github.com/miekg/dns/issues/733. - StringToRcode["NOTIMPL"] = RcodeNotImplemented -} - -// StringToAlgorithm is the reverse of AlgorithmToString. -var StringToAlgorithm = reverseInt8(AlgorithmToString) - -// StringToHash is a map of names to hash IDs. -var StringToHash = reverseInt8(HashToString) - -// StringToCertType is the reverseof CertTypeToString. -var StringToCertType = reverseInt16(CertTypeToString) - -// Reverse a map -func reverseInt8(m map[uint8]string) map[string]uint8 { - n := make(map[string]uint8, len(m)) - for u, s := range m { - n[s] = u - } - return n -} - -func reverseInt16(m map[uint16]string) map[string]uint16 { - n := make(map[string]uint16, len(m)) - for u, s := range m { - n[s] = u - } - return n -} - -func reverseInt(m map[int]string) map[string]int { - n := make(map[string]int, len(m)) - for u, s := range m { - n[s] = u - } - return n -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/sanitize.go b/cluster-autoscaler/vendor/github.com/miekg/dns/sanitize.go deleted file mode 100644 index a638e862e3ab..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/sanitize.go +++ /dev/null @@ -1,86 +0,0 @@ -package dns - -// Dedup removes identical RRs from rrs. It preserves the original ordering. -// The lowest TTL of any duplicates is used in the remaining one. Dedup modifies -// rrs. -// m is used to store the RRs temporary. If it is nil a new map will be allocated. -func Dedup(rrs []RR, m map[string]RR) []RR { - - if m == nil { - m = make(map[string]RR) - } - // Save the keys, so we don't have to call normalizedString twice. - keys := make([]*string, 0, len(rrs)) - - for _, r := range rrs { - key := normalizedString(r) - keys = append(keys, &key) - if mr, ok := m[key]; ok { - // Shortest TTL wins. - rh, mrh := r.Header(), mr.Header() - if mrh.Ttl > rh.Ttl { - mrh.Ttl = rh.Ttl - } - continue - } - - m[key] = r - } - // If the length of the result map equals the amount of RRs we got, - // it means they were all different. We can then just return the original rrset. - if len(m) == len(rrs) { - return rrs - } - - j := 0 - for i, r := range rrs { - // If keys[i] lives in the map, we should copy and remove it. - if _, ok := m[*keys[i]]; ok { - delete(m, *keys[i]) - rrs[j] = r - j++ - } - - if len(m) == 0 { - break - } - } - - return rrs[:j] -} - -// normalizedString returns a normalized string from r. The TTL -// is removed and the domain name is lowercased. We go from this: -// DomainNameTTLCLASSTYPERDATA to: -// lowercasenameCLASSTYPE... -func normalizedString(r RR) string { - // A string Go DNS makes has: domainnameTTL... - b := []byte(r.String()) - - // find the first non-escaped tab, then another, so we capture where the TTL lives. - esc := false - ttlStart, ttlEnd := 0, 0 - for i := 0; i < len(b) && ttlEnd == 0; i++ { - switch { - case b[i] == '\\': - esc = !esc - case b[i] == '\t' && !esc: - if ttlStart == 0 { - ttlStart = i - continue - } - if ttlEnd == 0 { - ttlEnd = i - } - case b[i] >= 'A' && b[i] <= 'Z' && !esc: - b[i] += 32 - default: - esc = false - } - } - - // remove TTL. - copy(b[ttlStart:], b[ttlEnd:]) - cut := ttlEnd - ttlStart - return string(b[:len(b)-cut]) -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/scan.go b/cluster-autoscaler/vendor/github.com/miekg/dns/scan.go deleted file mode 100644 index aa2840efba89..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/scan.go +++ /dev/null @@ -1,1352 +0,0 @@ -package dns - -import ( - "bufio" - "fmt" - "io" - "os" - "path/filepath" - "strconv" - "strings" -) - -const maxTok = 2048 // Largest token we can return. - -// The maximum depth of $INCLUDE directives supported by the -// ZoneParser API. -const maxIncludeDepth = 7 - -// Tokinize a RFC 1035 zone file. The tokenizer will normalize it: -// * Add ownernames if they are left blank; -// * Suppress sequences of spaces; -// * Make each RR fit on one line (_NEWLINE is send as last) -// * Handle comments: ; -// * Handle braces - anywhere. -const ( - // Zonefile - zEOF = iota - zString - zBlank - zQuote - zNewline - zRrtpe - zOwner - zClass - zDirOrigin // $ORIGIN - zDirTTL // $TTL - zDirInclude // $INCLUDE - zDirGenerate // $GENERATE - - // Privatekey file - zValue - zKey - - zExpectOwnerDir // Ownername - zExpectOwnerBl // Whitespace after the ownername - zExpectAny // Expect rrtype, ttl or class - zExpectAnyNoClass // Expect rrtype or ttl - zExpectAnyNoClassBl // The whitespace after _EXPECT_ANY_NOCLASS - zExpectAnyNoTTL // Expect rrtype or class - zExpectAnyNoTTLBl // Whitespace after _EXPECT_ANY_NOTTL - zExpectRrtype // Expect rrtype - zExpectRrtypeBl // Whitespace BEFORE rrtype - zExpectRdata // The first element of the rdata - zExpectDirTTLBl // Space after directive $TTL - zExpectDirTTL // Directive $TTL - zExpectDirOriginBl // Space after directive $ORIGIN - zExpectDirOrigin // Directive $ORIGIN - zExpectDirIncludeBl // Space after directive $INCLUDE - zExpectDirInclude // Directive $INCLUDE - zExpectDirGenerate // Directive $GENERATE - zExpectDirGenerateBl // Space after directive $GENERATE -) - -// ParseError is a parsing error. It contains the parse error and the location in the io.Reader -// where the error occurred. -type ParseError struct { - file string - err string - lex lex -} - -func (e *ParseError) Error() (s string) { - if e.file != "" { - s = e.file + ": " - } - s += "dns: " + e.err + ": " + strconv.QuoteToASCII(e.lex.token) + " at line: " + - strconv.Itoa(e.lex.line) + ":" + strconv.Itoa(e.lex.column) - return -} - -type lex struct { - token string // text of the token - err bool // when true, token text has lexer error - value uint8 // value: zString, _BLANK, etc. - torc uint16 // type or class as parsed in the lexer, we only need to look this up in the grammar - line int // line in the file - column int // column in the file -} - -// ttlState describes the state necessary to fill in an omitted RR TTL -type ttlState struct { - ttl uint32 // ttl is the current default TTL - isByDirective bool // isByDirective indicates whether ttl was set by a $TTL directive -} - -// NewRR reads the RR contained in the string s. Only the first RR is returned. -// If s contains no records, NewRR will return nil with no error. -// -// The class defaults to IN and TTL defaults to 3600. The full zone file syntax -// like $TTL, $ORIGIN, etc. is supported. All fields of the returned RR are -// set, except RR.Header().Rdlength which is set to 0. -func NewRR(s string) (RR, error) { - if len(s) > 0 && s[len(s)-1] != '\n' { // We need a closing newline - return ReadRR(strings.NewReader(s+"\n"), "") - } - return ReadRR(strings.NewReader(s), "") -} - -// ReadRR reads the RR contained in r. -// -// The string file is used in error reporting and to resolve relative -// $INCLUDE directives. -// -// See NewRR for more documentation. -func ReadRR(r io.Reader, file string) (RR, error) { - zp := NewZoneParser(r, ".", file) - zp.SetDefaultTTL(defaultTtl) - zp.SetIncludeAllowed(true) - rr, _ := zp.Next() - return rr, zp.Err() -} - -// ZoneParser is a parser for an RFC 1035 style zonefile. -// -// Each parsed RR in the zone is returned sequentially from Next. An -// optional comment can be retrieved with Comment. -// -// The directives $INCLUDE, $ORIGIN, $TTL and $GENERATE are all -// supported. Although $INCLUDE is disabled by default. -// Note that $GENERATE's range support up to a maximum of 65535 steps. -// -// Basic usage pattern when reading from a string (z) containing the -// zone data: -// -// zp := NewZoneParser(strings.NewReader(z), "", "") -// -// for rr, ok := zp.Next(); ok; rr, ok = zp.Next() { -// // Do something with rr -// } -// -// if err := zp.Err(); err != nil { -// // log.Println(err) -// } -// -// Comments specified after an RR (and on the same line!) are -// returned too: -// -// foo. IN A 10.0.0.1 ; this is a comment -// -// The text "; this is comment" is returned from Comment. Comments inside -// the RR are returned concatenated along with the RR. Comments on a line -// by themselves are discarded. -type ZoneParser struct { - c *zlexer - - parseErr *ParseError - - origin string - file string - - defttl *ttlState - - h RR_Header - - // sub is used to parse $INCLUDE files and $GENERATE directives. - // Next, by calling subNext, forwards the resulting RRs from this - // sub parser to the calling code. - sub *ZoneParser - osFile *os.File - - includeDepth uint8 - - includeAllowed bool - generateDisallowed bool -} - -// NewZoneParser returns an RFC 1035 style zonefile parser that reads -// from r. -// -// The string file is used in error reporting and to resolve relative -// $INCLUDE directives. The string origin is used as the initial -// origin, as if the file would start with an $ORIGIN directive. -func NewZoneParser(r io.Reader, origin, file string) *ZoneParser { - var pe *ParseError - if origin != "" { - origin = Fqdn(origin) - if _, ok := IsDomainName(origin); !ok { - pe = &ParseError{file, "bad initial origin name", lex{}} - } - } - - return &ZoneParser{ - c: newZLexer(r), - - parseErr: pe, - - origin: origin, - file: file, - } -} - -// SetDefaultTTL sets the parsers default TTL to ttl. -func (zp *ZoneParser) SetDefaultTTL(ttl uint32) { - zp.defttl = &ttlState{ttl, false} -} - -// SetIncludeAllowed controls whether $INCLUDE directives are -// allowed. $INCLUDE directives are not supported by default. -// -// The $INCLUDE directive will open and read from a user controlled -// file on the system. Even if the file is not a valid zonefile, the -// contents of the file may be revealed in error messages, such as: -// -// /etc/passwd: dns: not a TTL: "root:x:0:0:root:/root:/bin/bash" at line: 1:31 -// /etc/shadow: dns: not a TTL: "root:$6$::0:99999:7:::" at line: 1:125 -func (zp *ZoneParser) SetIncludeAllowed(v bool) { - zp.includeAllowed = v -} - -// Err returns the first non-EOF error that was encountered by the -// ZoneParser. -func (zp *ZoneParser) Err() error { - if zp.parseErr != nil { - return zp.parseErr - } - - if zp.sub != nil { - if err := zp.sub.Err(); err != nil { - return err - } - } - - return zp.c.Err() -} - -func (zp *ZoneParser) setParseError(err string, l lex) (RR, bool) { - zp.parseErr = &ParseError{zp.file, err, l} - return nil, false -} - -// Comment returns an optional text comment that occurred alongside -// the RR. -func (zp *ZoneParser) Comment() string { - if zp.parseErr != nil { - return "" - } - - if zp.sub != nil { - return zp.sub.Comment() - } - - return zp.c.Comment() -} - -func (zp *ZoneParser) subNext() (RR, bool) { - if rr, ok := zp.sub.Next(); ok { - return rr, true - } - - if zp.sub.osFile != nil { - zp.sub.osFile.Close() - zp.sub.osFile = nil - } - - if zp.sub.Err() != nil { - // We have errors to surface. - return nil, false - } - - zp.sub = nil - return zp.Next() -} - -// Next advances the parser to the next RR in the zonefile and -// returns the (RR, true). It will return (nil, false) when the -// parsing stops, either by reaching the end of the input or an -// error. After Next returns (nil, false), the Err method will return -// any error that occurred during parsing. -func (zp *ZoneParser) Next() (RR, bool) { - if zp.parseErr != nil { - return nil, false - } - if zp.sub != nil { - return zp.subNext() - } - - // 6 possible beginnings of a line (_ is a space): - // - // 0. zRRTYPE -> all omitted until the rrtype - // 1. zOwner _ zRrtype -> class/ttl omitted - // 2. zOwner _ zString _ zRrtype -> class omitted - // 3. zOwner _ zString _ zClass _ zRrtype -> ttl/class - // 4. zOwner _ zClass _ zRrtype -> ttl omitted - // 5. zOwner _ zClass _ zString _ zRrtype -> class/ttl (reversed) - // - // After detecting these, we know the zRrtype so we can jump to functions - // handling the rdata for each of these types. - - st := zExpectOwnerDir // initial state - h := &zp.h - - for l, ok := zp.c.Next(); ok; l, ok = zp.c.Next() { - // zlexer spotted an error already - if l.err { - return zp.setParseError(l.token, l) - } - - switch st { - case zExpectOwnerDir: - // We can also expect a directive, like $TTL or $ORIGIN - if zp.defttl != nil { - h.Ttl = zp.defttl.ttl - } - - h.Class = ClassINET - - switch l.value { - case zNewline: - st = zExpectOwnerDir - case zOwner: - name, ok := toAbsoluteName(l.token, zp.origin) - if !ok { - return zp.setParseError("bad owner name", l) - } - - h.Name = name - - st = zExpectOwnerBl - case zDirTTL: - st = zExpectDirTTLBl - case zDirOrigin: - st = zExpectDirOriginBl - case zDirInclude: - st = zExpectDirIncludeBl - case zDirGenerate: - st = zExpectDirGenerateBl - case zRrtpe: - h.Rrtype = l.torc - - st = zExpectRdata - case zClass: - h.Class = l.torc - - st = zExpectAnyNoClassBl - case zBlank: - // Discard, can happen when there is nothing on the - // line except the RR type - case zString: - ttl, ok := stringToTTL(l.token) - if !ok { - return zp.setParseError("not a TTL", l) - } - - h.Ttl = ttl - - if zp.defttl == nil || !zp.defttl.isByDirective { - zp.defttl = &ttlState{ttl, false} - } - - st = zExpectAnyNoTTLBl - default: - return zp.setParseError("syntax error at beginning", l) - } - case zExpectDirIncludeBl: - if l.value != zBlank { - return zp.setParseError("no blank after $INCLUDE-directive", l) - } - - st = zExpectDirInclude - case zExpectDirInclude: - if l.value != zString { - return zp.setParseError("expecting $INCLUDE value, not this...", l) - } - - neworigin := zp.origin // There may be optionally a new origin set after the filename, if not use current one - switch l, _ := zp.c.Next(); l.value { - case zBlank: - l, _ := zp.c.Next() - if l.value == zString { - name, ok := toAbsoluteName(l.token, zp.origin) - if !ok { - return zp.setParseError("bad origin name", l) - } - - neworigin = name - } - case zNewline, zEOF: - // Ok - default: - return zp.setParseError("garbage after $INCLUDE", l) - } - - if !zp.includeAllowed { - return zp.setParseError("$INCLUDE directive not allowed", l) - } - if zp.includeDepth >= maxIncludeDepth { - return zp.setParseError("too deeply nested $INCLUDE", l) - } - - // Start with the new file - includePath := l.token - if !filepath.IsAbs(includePath) { - includePath = filepath.Join(filepath.Dir(zp.file), includePath) - } - - r1, e1 := os.Open(includePath) - if e1 != nil { - var as string - if !filepath.IsAbs(l.token) { - as = fmt.Sprintf(" as `%s'", includePath) - } - - msg := fmt.Sprintf("failed to open `%s'%s: %v", l.token, as, e1) - return zp.setParseError(msg, l) - } - - zp.sub = NewZoneParser(r1, neworigin, includePath) - zp.sub.defttl, zp.sub.includeDepth, zp.sub.osFile = zp.defttl, zp.includeDepth+1, r1 - zp.sub.SetIncludeAllowed(true) - return zp.subNext() - case zExpectDirTTLBl: - if l.value != zBlank { - return zp.setParseError("no blank after $TTL-directive", l) - } - - st = zExpectDirTTL - case zExpectDirTTL: - if l.value != zString { - return zp.setParseError("expecting $TTL value, not this...", l) - } - - if err := slurpRemainder(zp.c); err != nil { - return zp.setParseError(err.err, err.lex) - } - - ttl, ok := stringToTTL(l.token) - if !ok { - return zp.setParseError("expecting $TTL value, not this...", l) - } - - zp.defttl = &ttlState{ttl, true} - - st = zExpectOwnerDir - case zExpectDirOriginBl: - if l.value != zBlank { - return zp.setParseError("no blank after $ORIGIN-directive", l) - } - - st = zExpectDirOrigin - case zExpectDirOrigin: - if l.value != zString { - return zp.setParseError("expecting $ORIGIN value, not this...", l) - } - - if err := slurpRemainder(zp.c); err != nil { - return zp.setParseError(err.err, err.lex) - } - - name, ok := toAbsoluteName(l.token, zp.origin) - if !ok { - return zp.setParseError("bad origin name", l) - } - - zp.origin = name - - st = zExpectOwnerDir - case zExpectDirGenerateBl: - if l.value != zBlank { - return zp.setParseError("no blank after $GENERATE-directive", l) - } - - st = zExpectDirGenerate - case zExpectDirGenerate: - if zp.generateDisallowed { - return zp.setParseError("nested $GENERATE directive not allowed", l) - } - if l.value != zString { - return zp.setParseError("expecting $GENERATE value, not this...", l) - } - - return zp.generate(l) - case zExpectOwnerBl: - if l.value != zBlank { - return zp.setParseError("no blank after owner", l) - } - - st = zExpectAny - case zExpectAny: - switch l.value { - case zRrtpe: - if zp.defttl == nil { - return zp.setParseError("missing TTL with no previous value", l) - } - - h.Rrtype = l.torc - - st = zExpectRdata - case zClass: - h.Class = l.torc - - st = zExpectAnyNoClassBl - case zString: - ttl, ok := stringToTTL(l.token) - if !ok { - return zp.setParseError("not a TTL", l) - } - - h.Ttl = ttl - - if zp.defttl == nil || !zp.defttl.isByDirective { - zp.defttl = &ttlState{ttl, false} - } - - st = zExpectAnyNoTTLBl - default: - return zp.setParseError("expecting RR type, TTL or class, not this...", l) - } - case zExpectAnyNoClassBl: - if l.value != zBlank { - return zp.setParseError("no blank before class", l) - } - - st = zExpectAnyNoClass - case zExpectAnyNoTTLBl: - if l.value != zBlank { - return zp.setParseError("no blank before TTL", l) - } - - st = zExpectAnyNoTTL - case zExpectAnyNoTTL: - switch l.value { - case zClass: - h.Class = l.torc - - st = zExpectRrtypeBl - case zRrtpe: - h.Rrtype = l.torc - - st = zExpectRdata - default: - return zp.setParseError("expecting RR type or class, not this...", l) - } - case zExpectAnyNoClass: - switch l.value { - case zString: - ttl, ok := stringToTTL(l.token) - if !ok { - return zp.setParseError("not a TTL", l) - } - - h.Ttl = ttl - - if zp.defttl == nil || !zp.defttl.isByDirective { - zp.defttl = &ttlState{ttl, false} - } - - st = zExpectRrtypeBl - case zRrtpe: - h.Rrtype = l.torc - - st = zExpectRdata - default: - return zp.setParseError("expecting RR type or TTL, not this...", l) - } - case zExpectRrtypeBl: - if l.value != zBlank { - return zp.setParseError("no blank before RR type", l) - } - - st = zExpectRrtype - case zExpectRrtype: - if l.value != zRrtpe { - return zp.setParseError("unknown RR type", l) - } - - h.Rrtype = l.torc - - st = zExpectRdata - case zExpectRdata: - var rr RR - if newFn, ok := TypeToRR[h.Rrtype]; ok && canParseAsRR(h.Rrtype) { - rr = newFn() - *rr.Header() = *h - } else { - rr = &RFC3597{Hdr: *h} - } - - _, isPrivate := rr.(*PrivateRR) - if !isPrivate && zp.c.Peek().token == "" { - // This is a dynamic update rr. - - // TODO(tmthrgd): Previously slurpRemainder was only called - // for certain RR types, which may have been important. - if err := slurpRemainder(zp.c); err != nil { - return zp.setParseError(err.err, err.lex) - } - - return rr, true - } else if l.value == zNewline { - return zp.setParseError("unexpected newline", l) - } - - if err := rr.parse(zp.c, zp.origin); err != nil { - // err is a concrete *ParseError without the file field set. - // The setParseError call below will construct a new - // *ParseError with file set to zp.file. - - // If err.lex is nil than we have encounter an unknown RR type - // in that case we substitute our current lex token. - if err.lex == (lex{}) { - return zp.setParseError(err.err, l) - } - - return zp.setParseError(err.err, err.lex) - } - - return rr, true - } - } - - // If we get here, we and the h.Rrtype is still zero, we haven't parsed anything, this - // is not an error, because an empty zone file is still a zone file. - return nil, false -} - -// canParseAsRR returns true if the record type can be parsed as a -// concrete RR. It blacklists certain record types that must be parsed -// according to RFC 3597 because they lack a presentation format. -func canParseAsRR(rrtype uint16) bool { - switch rrtype { - case TypeANY, TypeNULL, TypeOPT, TypeTSIG: - return false - default: - return true - } -} - -type zlexer struct { - br io.ByteReader - - readErr error - - line int - column int - - comBuf string - comment string - - l lex - cachedL *lex - - brace int - quote bool - space bool - commt bool - rrtype bool - owner bool - - nextL bool - - eol bool // end-of-line -} - -func newZLexer(r io.Reader) *zlexer { - br, ok := r.(io.ByteReader) - if !ok { - br = bufio.NewReaderSize(r, 1024) - } - - return &zlexer{ - br: br, - - line: 1, - - owner: true, - } -} - -func (zl *zlexer) Err() error { - if zl.readErr == io.EOF { - return nil - } - - return zl.readErr -} - -// readByte returns the next byte from the input -func (zl *zlexer) readByte() (byte, bool) { - if zl.readErr != nil { - return 0, false - } - - c, err := zl.br.ReadByte() - if err != nil { - zl.readErr = err - return 0, false - } - - // delay the newline handling until the next token is delivered, - // fixes off-by-one errors when reporting a parse error. - if zl.eol { - zl.line++ - zl.column = 0 - zl.eol = false - } - - if c == '\n' { - zl.eol = true - } else { - zl.column++ - } - - return c, true -} - -func (zl *zlexer) Peek() lex { - if zl.nextL { - return zl.l - } - - l, ok := zl.Next() - if !ok { - return l - } - - if zl.nextL { - // Cache l. Next returns zl.cachedL then zl.l. - zl.cachedL = &l - } else { - // In this case l == zl.l, so we just tell Next to return zl.l. - zl.nextL = true - } - - return l -} - -func (zl *zlexer) Next() (lex, bool) { - l := &zl.l - switch { - case zl.cachedL != nil: - l, zl.cachedL = zl.cachedL, nil - return *l, true - case zl.nextL: - zl.nextL = false - return *l, true - case l.err: - // Parsing errors should be sticky. - return lex{value: zEOF}, false - } - - var ( - str [maxTok]byte // Hold string text - com [maxTok]byte // Hold comment text - - stri int // Offset in str (0 means empty) - comi int // Offset in com (0 means empty) - - escape bool - ) - - if zl.comBuf != "" { - comi = copy(com[:], zl.comBuf) - zl.comBuf = "" - } - - zl.comment = "" - - for x, ok := zl.readByte(); ok; x, ok = zl.readByte() { - l.line, l.column = zl.line, zl.column - - if stri >= len(str) { - l.token = "token length insufficient for parsing" - l.err = true - return *l, true - } - if comi >= len(com) { - l.token = "comment length insufficient for parsing" - l.err = true - return *l, true - } - - switch x { - case ' ', '\t': - if escape || zl.quote { - // Inside quotes or escaped this is legal. - str[stri] = x - stri++ - - escape = false - break - } - - if zl.commt { - com[comi] = x - comi++ - break - } - - var retL lex - if stri == 0 { - // Space directly in the beginning, handled in the grammar - } else if zl.owner { - // If we have a string and its the first, make it an owner - l.value = zOwner - l.token = string(str[:stri]) - - // escape $... start with a \ not a $, so this will work - switch strings.ToUpper(l.token) { - case "$TTL": - l.value = zDirTTL - case "$ORIGIN": - l.value = zDirOrigin - case "$INCLUDE": - l.value = zDirInclude - case "$GENERATE": - l.value = zDirGenerate - } - - retL = *l - } else { - l.value = zString - l.token = string(str[:stri]) - - if !zl.rrtype { - tokenUpper := strings.ToUpper(l.token) - if t, ok := StringToType[tokenUpper]; ok { - l.value = zRrtpe - l.torc = t - - zl.rrtype = true - } else if strings.HasPrefix(tokenUpper, "TYPE") { - t, ok := typeToInt(l.token) - if !ok { - l.token = "unknown RR type" - l.err = true - return *l, true - } - - l.value = zRrtpe - l.torc = t - - zl.rrtype = true - } - - if t, ok := StringToClass[tokenUpper]; ok { - l.value = zClass - l.torc = t - } else if strings.HasPrefix(tokenUpper, "CLASS") { - t, ok := classToInt(l.token) - if !ok { - l.token = "unknown class" - l.err = true - return *l, true - } - - l.value = zClass - l.torc = t - } - } - - retL = *l - } - - zl.owner = false - - if !zl.space { - zl.space = true - - l.value = zBlank - l.token = " " - - if retL == (lex{}) { - return *l, true - } - - zl.nextL = true - } - - if retL != (lex{}) { - return retL, true - } - case ';': - if escape || zl.quote { - // Inside quotes or escaped this is legal. - str[stri] = x - stri++ - - escape = false - break - } - - zl.commt = true - zl.comBuf = "" - - if comi > 1 { - // A newline was previously seen inside a comment that - // was inside braces and we delayed adding it until now. - com[comi] = ' ' // convert newline to space - comi++ - if comi >= len(com) { - l.token = "comment length insufficient for parsing" - l.err = true - return *l, true - } - } - - com[comi] = ';' - comi++ - - if stri > 0 { - zl.comBuf = string(com[:comi]) - - l.value = zString - l.token = string(str[:stri]) - return *l, true - } - case '\r': - escape = false - - if zl.quote { - str[stri] = x - stri++ - } - - // discard if outside of quotes - case '\n': - escape = false - - // Escaped newline - if zl.quote { - str[stri] = x - stri++ - break - } - - if zl.commt { - // Reset a comment - zl.commt = false - zl.rrtype = false - - // If not in a brace this ends the comment AND the RR - if zl.brace == 0 { - zl.owner = true - - l.value = zNewline - l.token = "\n" - zl.comment = string(com[:comi]) - return *l, true - } - - zl.comBuf = string(com[:comi]) - break - } - - if zl.brace == 0 { - // If there is previous text, we should output it here - var retL lex - if stri != 0 { - l.value = zString - l.token = string(str[:stri]) - - if !zl.rrtype { - tokenUpper := strings.ToUpper(l.token) - if t, ok := StringToType[tokenUpper]; ok { - zl.rrtype = true - - l.value = zRrtpe - l.torc = t - } - } - - retL = *l - } - - l.value = zNewline - l.token = "\n" - - zl.comment = zl.comBuf - zl.comBuf = "" - zl.rrtype = false - zl.owner = true - - if retL != (lex{}) { - zl.nextL = true - return retL, true - } - - return *l, true - } - case '\\': - // comments do not get escaped chars, everything is copied - if zl.commt { - com[comi] = x - comi++ - break - } - - // something already escaped must be in string - if escape { - str[stri] = x - stri++ - - escape = false - break - } - - // something escaped outside of string gets added to string - str[stri] = x - stri++ - - escape = true - case '"': - if zl.commt { - com[comi] = x - comi++ - break - } - - if escape { - str[stri] = x - stri++ - - escape = false - break - } - - zl.space = false - - // send previous gathered text and the quote - var retL lex - if stri != 0 { - l.value = zString - l.token = string(str[:stri]) - - retL = *l - } - - // send quote itself as separate token - l.value = zQuote - l.token = "\"" - - zl.quote = !zl.quote - - if retL != (lex{}) { - zl.nextL = true - return retL, true - } - - return *l, true - case '(', ')': - if zl.commt { - com[comi] = x - comi++ - break - } - - if escape || zl.quote { - // Inside quotes or escaped this is legal. - str[stri] = x - stri++ - - escape = false - break - } - - switch x { - case ')': - zl.brace-- - - if zl.brace < 0 { - l.token = "extra closing brace" - l.err = true - return *l, true - } - case '(': - zl.brace++ - } - default: - escape = false - - if zl.commt { - com[comi] = x - comi++ - break - } - - str[stri] = x - stri++ - - zl.space = false - } - } - - if zl.readErr != nil && zl.readErr != io.EOF { - // Don't return any tokens after a read error occurs. - return lex{value: zEOF}, false - } - - var retL lex - if stri > 0 { - // Send remainder of str - l.value = zString - l.token = string(str[:stri]) - retL = *l - - if comi <= 0 { - return retL, true - } - } - - if comi > 0 { - // Send remainder of com - l.value = zNewline - l.token = "\n" - zl.comment = string(com[:comi]) - - if retL != (lex{}) { - zl.nextL = true - return retL, true - } - - return *l, true - } - - if zl.brace != 0 { - l.token = "unbalanced brace" - l.err = true - return *l, true - } - - return lex{value: zEOF}, false -} - -func (zl *zlexer) Comment() string { - if zl.l.err { - return "" - } - - return zl.comment -} - -// Extract the class number from CLASSxx -func classToInt(token string) (uint16, bool) { - offset := 5 - if len(token) < offset+1 { - return 0, false - } - class, err := strconv.ParseUint(token[offset:], 10, 16) - if err != nil { - return 0, false - } - return uint16(class), true -} - -// Extract the rr number from TYPExxx -func typeToInt(token string) (uint16, bool) { - offset := 4 - if len(token) < offset+1 { - return 0, false - } - typ, err := strconv.ParseUint(token[offset:], 10, 16) - if err != nil { - return 0, false - } - return uint16(typ), true -} - -// stringToTTL parses things like 2w, 2m, etc, and returns the time in seconds. -func stringToTTL(token string) (uint32, bool) { - var s, i uint32 - for _, c := range token { - switch c { - case 's', 'S': - s += i - i = 0 - case 'm', 'M': - s += i * 60 - i = 0 - case 'h', 'H': - s += i * 60 * 60 - i = 0 - case 'd', 'D': - s += i * 60 * 60 * 24 - i = 0 - case 'w', 'W': - s += i * 60 * 60 * 24 * 7 - i = 0 - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - i *= 10 - i += uint32(c) - '0' - default: - return 0, false - } - } - return s + i, true -} - -// Parse LOC records' [.][mM] into a -// mantissa exponent format. Token should contain the entire -// string (i.e. no spaces allowed) -func stringToCm(token string) (e, m uint8, ok bool) { - if token[len(token)-1] == 'M' || token[len(token)-1] == 'm' { - token = token[0 : len(token)-1] - } - s := strings.SplitN(token, ".", 2) - var meters, cmeters, val int - var err error - switch len(s) { - case 2: - if cmeters, err = strconv.Atoi(s[1]); err != nil { - return - } - // There's no point in having more than 2 digits in this part, and would rather make the implementation complicated ('123' should be treated as '12'). - // So we simply reject it. - // We also make sure the first character is a digit to reject '+-' signs. - if len(s[1]) > 2 || s[1][0] < '0' || s[1][0] > '9' { - return - } - if len(s[1]) == 1 { - // 'nn.1' must be treated as 'nn-meters and 10cm, not 1cm. - cmeters *= 10 - } - if len(s[0]) == 0 { - // This will allow omitting the 'meter' part, like .01 (meaning 0.01m = 1cm). - break - } - fallthrough - case 1: - if meters, err = strconv.Atoi(s[0]); err != nil { - return - } - // RFC1876 states the max value is 90000000.00. The latter two conditions enforce it. - if s[0][0] < '0' || s[0][0] > '9' || meters > 90000000 || (meters == 90000000 && cmeters != 0) { - return - } - case 0: - // huh? - return 0, 0, false - } - ok = true - if meters > 0 { - e = 2 - val = meters - } else { - e = 0 - val = cmeters - } - for val >= 10 { - e++ - val /= 10 - } - m = uint8(val) - return -} - -func toAbsoluteName(name, origin string) (absolute string, ok bool) { - // check for an explicit origin reference - if name == "@" { - // require a nonempty origin - if origin == "" { - return "", false - } - return origin, true - } - - // require a valid domain name - _, ok = IsDomainName(name) - if !ok || name == "" { - return "", false - } - - // check if name is already absolute - if IsFqdn(name) { - return name, true - } - - // require a nonempty origin - if origin == "" { - return "", false - } - return appendOrigin(name, origin), true -} - -func appendOrigin(name, origin string) string { - if origin == "." { - return name + origin - } - return name + "." + origin -} - -// LOC record helper function -func locCheckNorth(token string, latitude uint32) (uint32, bool) { - if latitude > 90 * 1000 * 60 * 60 { - return latitude, false - } - switch token { - case "n", "N": - return LOC_EQUATOR + latitude, true - case "s", "S": - return LOC_EQUATOR - latitude, true - } - return latitude, false -} - -// LOC record helper function -func locCheckEast(token string, longitude uint32) (uint32, bool) { - if longitude > 180 * 1000 * 60 * 60 { - return longitude, false - } - switch token { - case "e", "E": - return LOC_EQUATOR + longitude, true - case "w", "W": - return LOC_EQUATOR - longitude, true - } - return longitude, false -} - -// "Eat" the rest of the "line" -func slurpRemainder(c *zlexer) *ParseError { - l, _ := c.Next() - switch l.value { - case zBlank: - l, _ = c.Next() - if l.value != zNewline && l.value != zEOF { - return &ParseError{"", "garbage after rdata", l} - } - case zNewline: - case zEOF: - default: - return &ParseError{"", "garbage after rdata", l} - } - return nil -} - -// Parse a 64 bit-like ipv6 address: "0014:4fff:ff20:ee64" -// Used for NID and L64 record. -func stringToNodeID(l lex) (uint64, *ParseError) { - if len(l.token) < 19 { - return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l} - } - // There must be three colons at fixes postitions, if not its a parse error - if l.token[4] != ':' && l.token[9] != ':' && l.token[14] != ':' { - return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l} - } - s := l.token[0:4] + l.token[5:9] + l.token[10:14] + l.token[15:19] - u, err := strconv.ParseUint(s, 16, 64) - if err != nil { - return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l} - } - return u, nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/scan_rr.go b/cluster-autoscaler/vendor/github.com/miekg/dns/scan_rr.go deleted file mode 100644 index 69f10052f4eb..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/scan_rr.go +++ /dev/null @@ -1,1742 +0,0 @@ -package dns - -import ( - "bytes" - "encoding/base64" - "net" - "strconv" - "strings" -) - -// A remainder of the rdata with embedded spaces, return the parsed string (sans the spaces) -// or an error -func endingToString(c *zlexer, errstr string) (string, *ParseError) { - var buffer bytes.Buffer - l, _ := c.Next() // zString - for l.value != zNewline && l.value != zEOF { - if l.err { - return buffer.String(), &ParseError{"", errstr, l} - } - switch l.value { - case zString: - buffer.WriteString(l.token) - case zBlank: // Ok - default: - return "", &ParseError{"", errstr, l} - } - l, _ = c.Next() - } - - return buffer.String(), nil -} - -// A remainder of the rdata with embedded spaces, split on unquoted whitespace -// and return the parsed string slice or an error -func endingToTxtSlice(c *zlexer, errstr string) ([]string, *ParseError) { - // Get the remaining data until we see a zNewline - l, _ := c.Next() - if l.err { - return nil, &ParseError{"", errstr, l} - } - - // Build the slice - s := make([]string, 0) - quote := false - empty := false - for l.value != zNewline && l.value != zEOF { - if l.err { - return nil, &ParseError{"", errstr, l} - } - switch l.value { - case zString: - empty = false - if len(l.token) > 255 { - // split up tokens that are larger than 255 into 255-chunks - sx := []string{} - p, i := 0, 255 - for { - if i <= len(l.token) { - sx = append(sx, l.token[p:i]) - } else { - sx = append(sx, l.token[p:]) - break - - } - p, i = p+255, i+255 - } - s = append(s, sx...) - break - } - - s = append(s, l.token) - case zBlank: - if quote { - // zBlank can only be seen in between txt parts. - return nil, &ParseError{"", errstr, l} - } - case zQuote: - if empty && quote { - s = append(s, "") - } - quote = !quote - empty = true - default: - return nil, &ParseError{"", errstr, l} - } - l, _ = c.Next() - } - - if quote { - return nil, &ParseError{"", errstr, l} - } - - return s, nil -} - -func (rr *A) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - rr.A = net.ParseIP(l.token) - // IPv4 addresses cannot include ":". - // We do this rather than use net.IP's To4() because - // To4() treats IPv4-mapped IPv6 addresses as being - // IPv4. - isIPv4 := !strings.Contains(l.token, ":") - if rr.A == nil || !isIPv4 || l.err { - return &ParseError{"", "bad A A", l} - } - return slurpRemainder(c) -} - -func (rr *AAAA) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - rr.AAAA = net.ParseIP(l.token) - // IPv6 addresses must include ":", and IPv4 - // addresses cannot include ":". - isIPv6 := strings.Contains(l.token, ":") - if rr.AAAA == nil || !isIPv6 || l.err { - return &ParseError{"", "bad AAAA AAAA", l} - } - return slurpRemainder(c) -} - -func (rr *NS) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad NS Ns", l} - } - rr.Ns = name - return slurpRemainder(c) -} - -func (rr *PTR) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad PTR Ptr", l} - } - rr.Ptr = name - return slurpRemainder(c) -} - -func (rr *NSAPPTR) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad NSAP-PTR Ptr", l} - } - rr.Ptr = name - return slurpRemainder(c) -} - -func (rr *RP) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - mbox, mboxOk := toAbsoluteName(l.token, o) - if l.err || !mboxOk { - return &ParseError{"", "bad RP Mbox", l} - } - rr.Mbox = mbox - - c.Next() // zBlank - l, _ = c.Next() - rr.Txt = l.token - - txt, txtOk := toAbsoluteName(l.token, o) - if l.err || !txtOk { - return &ParseError{"", "bad RP Txt", l} - } - rr.Txt = txt - - return slurpRemainder(c) -} - -func (rr *MR) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad MR Mr", l} - } - rr.Mr = name - return slurpRemainder(c) -} - -func (rr *MB) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad MB Mb", l} - } - rr.Mb = name - return slurpRemainder(c) -} - -func (rr *MG) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad MG Mg", l} - } - rr.Mg = name - return slurpRemainder(c) -} - -func (rr *HINFO) parse(c *zlexer, o string) *ParseError { - chunks, e := endingToTxtSlice(c, "bad HINFO Fields") - if e != nil { - return e - } - - if ln := len(chunks); ln == 0 { - return nil - } else if ln == 1 { - // Can we split it? - if out := strings.Fields(chunks[0]); len(out) > 1 { - chunks = out - } else { - chunks = append(chunks, "") - } - } - - rr.Cpu = chunks[0] - rr.Os = strings.Join(chunks[1:], " ") - - return nil -} - -func (rr *MINFO) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - rmail, rmailOk := toAbsoluteName(l.token, o) - if l.err || !rmailOk { - return &ParseError{"", "bad MINFO Rmail", l} - } - rr.Rmail = rmail - - c.Next() // zBlank - l, _ = c.Next() - rr.Email = l.token - - email, emailOk := toAbsoluteName(l.token, o) - if l.err || !emailOk { - return &ParseError{"", "bad MINFO Email", l} - } - rr.Email = email - - return slurpRemainder(c) -} - -func (rr *MF) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad MF Mf", l} - } - rr.Mf = name - return slurpRemainder(c) -} - -func (rr *MD) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad MD Md", l} - } - rr.Md = name - return slurpRemainder(c) -} - -func (rr *MX) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad MX Pref", l} - } - rr.Preference = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Mx = l.token - - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad MX Mx", l} - } - rr.Mx = name - - return slurpRemainder(c) -} - -func (rr *RT) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil { - return &ParseError{"", "bad RT Preference", l} - } - rr.Preference = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Host = l.token - - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad RT Host", l} - } - rr.Host = name - - return slurpRemainder(c) -} - -func (rr *AFSDB) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad AFSDB Subtype", l} - } - rr.Subtype = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Hostname = l.token - - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad AFSDB Hostname", l} - } - rr.Hostname = name - return slurpRemainder(c) -} - -func (rr *X25) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - if l.err { - return &ParseError{"", "bad X25 PSDNAddress", l} - } - rr.PSDNAddress = l.token - return slurpRemainder(c) -} - -func (rr *KX) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad KX Pref", l} - } - rr.Preference = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Exchanger = l.token - - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad KX Exchanger", l} - } - rr.Exchanger = name - return slurpRemainder(c) -} - -func (rr *CNAME) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad CNAME Target", l} - } - rr.Target = name - return slurpRemainder(c) -} - -func (rr *DNAME) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad DNAME Target", l} - } - rr.Target = name - return slurpRemainder(c) -} - -func (rr *SOA) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - ns, nsOk := toAbsoluteName(l.token, o) - if l.err || !nsOk { - return &ParseError{"", "bad SOA Ns", l} - } - rr.Ns = ns - - c.Next() // zBlank - l, _ = c.Next() - rr.Mbox = l.token - - mbox, mboxOk := toAbsoluteName(l.token, o) - if l.err || !mboxOk { - return &ParseError{"", "bad SOA Mbox", l} - } - rr.Mbox = mbox - - c.Next() // zBlank - - var ( - v uint32 - ok bool - ) - for i := 0; i < 5; i++ { - l, _ = c.Next() - if l.err { - return &ParseError{"", "bad SOA zone parameter", l} - } - if j, err := strconv.ParseUint(l.token, 10, 32); err != nil { - if i == 0 { - // Serial must be a number - return &ParseError{"", "bad SOA zone parameter", l} - } - // We allow other fields to be unitful duration strings - if v, ok = stringToTTL(l.token); !ok { - return &ParseError{"", "bad SOA zone parameter", l} - - } - } else { - v = uint32(j) - } - switch i { - case 0: - rr.Serial = v - c.Next() // zBlank - case 1: - rr.Refresh = v - c.Next() // zBlank - case 2: - rr.Retry = v - c.Next() // zBlank - case 3: - rr.Expire = v - c.Next() // zBlank - case 4: - rr.Minttl = v - } - } - return slurpRemainder(c) -} - -func (rr *SRV) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad SRV Priority", l} - } - rr.Priority = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - i, e1 := strconv.ParseUint(l.token, 10, 16) - if e1 != nil || l.err { - return &ParseError{"", "bad SRV Weight", l} - } - rr.Weight = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - i, e2 := strconv.ParseUint(l.token, 10, 16) - if e2 != nil || l.err { - return &ParseError{"", "bad SRV Port", l} - } - rr.Port = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Target = l.token - - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad SRV Target", l} - } - rr.Target = name - return slurpRemainder(c) -} - -func (rr *NAPTR) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad NAPTR Order", l} - } - rr.Order = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - i, e1 := strconv.ParseUint(l.token, 10, 16) - if e1 != nil || l.err { - return &ParseError{"", "bad NAPTR Preference", l} - } - rr.Preference = uint16(i) - - // Flags - c.Next() // zBlank - l, _ = c.Next() // _QUOTE - if l.value != zQuote { - return &ParseError{"", "bad NAPTR Flags", l} - } - l, _ = c.Next() // Either String or Quote - if l.value == zString { - rr.Flags = l.token - l, _ = c.Next() // _QUOTE - if l.value != zQuote { - return &ParseError{"", "bad NAPTR Flags", l} - } - } else if l.value == zQuote { - rr.Flags = "" - } else { - return &ParseError{"", "bad NAPTR Flags", l} - } - - // Service - c.Next() // zBlank - l, _ = c.Next() // _QUOTE - if l.value != zQuote { - return &ParseError{"", "bad NAPTR Service", l} - } - l, _ = c.Next() // Either String or Quote - if l.value == zString { - rr.Service = l.token - l, _ = c.Next() // _QUOTE - if l.value != zQuote { - return &ParseError{"", "bad NAPTR Service", l} - } - } else if l.value == zQuote { - rr.Service = "" - } else { - return &ParseError{"", "bad NAPTR Service", l} - } - - // Regexp - c.Next() // zBlank - l, _ = c.Next() // _QUOTE - if l.value != zQuote { - return &ParseError{"", "bad NAPTR Regexp", l} - } - l, _ = c.Next() // Either String or Quote - if l.value == zString { - rr.Regexp = l.token - l, _ = c.Next() // _QUOTE - if l.value != zQuote { - return &ParseError{"", "bad NAPTR Regexp", l} - } - } else if l.value == zQuote { - rr.Regexp = "" - } else { - return &ParseError{"", "bad NAPTR Regexp", l} - } - - // After quote no space?? - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Replacement = l.token - - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad NAPTR Replacement", l} - } - rr.Replacement = name - return slurpRemainder(c) -} - -func (rr *TALINK) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - previousName, previousNameOk := toAbsoluteName(l.token, o) - if l.err || !previousNameOk { - return &ParseError{"", "bad TALINK PreviousName", l} - } - rr.PreviousName = previousName - - c.Next() // zBlank - l, _ = c.Next() - rr.NextName = l.token - - nextName, nextNameOk := toAbsoluteName(l.token, o) - if l.err || !nextNameOk { - return &ParseError{"", "bad TALINK NextName", l} - } - rr.NextName = nextName - - return slurpRemainder(c) -} - -func (rr *LOC) parse(c *zlexer, o string) *ParseError { - // Non zero defaults for LOC record, see RFC 1876, Section 3. - rr.Size = 0x12 // 1e2 cm (1m) - rr.HorizPre = 0x16 // 1e6 cm (10000m) - rr.VertPre = 0x13 // 1e3 cm (10m) - ok := false - - // North - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 32) - if e != nil || l.err || i > 90 { - return &ParseError{"", "bad LOC Latitude", l} - } - rr.Latitude = 1000 * 60 * 60 * uint32(i) - - c.Next() // zBlank - // Either number, 'N' or 'S' - l, _ = c.Next() - if rr.Latitude, ok = locCheckNorth(l.token, rr.Latitude); ok { - goto East - } - if i, err := strconv.ParseUint(l.token, 10, 32); err != nil || l.err || i > 59 { - return &ParseError{"", "bad LOC Latitude minutes", l} - } else { - rr.Latitude += 1000 * 60 * uint32(i) - } - - c.Next() // zBlank - l, _ = c.Next() - if i, err := strconv.ParseFloat(l.token, 32); err != nil || l.err || i < 0 || i >= 60 { - return &ParseError{"", "bad LOC Latitude seconds", l} - } else { - rr.Latitude += uint32(1000 * i) - } - c.Next() // zBlank - // Either number, 'N' or 'S' - l, _ = c.Next() - if rr.Latitude, ok = locCheckNorth(l.token, rr.Latitude); ok { - goto East - } - // If still alive, flag an error - return &ParseError{"", "bad LOC Latitude North/South", l} - -East: - // East - c.Next() // zBlank - l, _ = c.Next() - if i, err := strconv.ParseUint(l.token, 10, 32); err != nil || l.err || i > 180 { - return &ParseError{"", "bad LOC Longitude", l} - } else { - rr.Longitude = 1000 * 60 * 60 * uint32(i) - } - c.Next() // zBlank - // Either number, 'E' or 'W' - l, _ = c.Next() - if rr.Longitude, ok = locCheckEast(l.token, rr.Longitude); ok { - goto Altitude - } - if i, err := strconv.ParseUint(l.token, 10, 32); err != nil || l.err || i > 59 { - return &ParseError{"", "bad LOC Longitude minutes", l} - } else { - rr.Longitude += 1000 * 60 * uint32(i) - } - c.Next() // zBlank - l, _ = c.Next() - if i, err := strconv.ParseFloat(l.token, 32); err != nil || l.err || i < 0 || i >= 60 { - return &ParseError{"", "bad LOC Longitude seconds", l} - } else { - rr.Longitude += uint32(1000 * i) - } - c.Next() // zBlank - // Either number, 'E' or 'W' - l, _ = c.Next() - if rr.Longitude, ok = locCheckEast(l.token, rr.Longitude); ok { - goto Altitude - } - // If still alive, flag an error - return &ParseError{"", "bad LOC Longitude East/West", l} - -Altitude: - c.Next() // zBlank - l, _ = c.Next() - if len(l.token) == 0 || l.err { - return &ParseError{"", "bad LOC Altitude", l} - } - if l.token[len(l.token)-1] == 'M' || l.token[len(l.token)-1] == 'm' { - l.token = l.token[0 : len(l.token)-1] - } - if i, err := strconv.ParseFloat(l.token, 64); err != nil { - return &ParseError{"", "bad LOC Altitude", l} - } else { - rr.Altitude = uint32(i*100.0 + 10000000.0 + 0.5) - } - - // And now optionally the other values - l, _ = c.Next() - count := 0 - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zString: - switch count { - case 0: // Size - exp, m, ok := stringToCm(l.token) - if !ok { - return &ParseError{"", "bad LOC Size", l} - } - rr.Size = exp&0x0f | m<<4&0xf0 - case 1: // HorizPre - exp, m, ok := stringToCm(l.token) - if !ok { - return &ParseError{"", "bad LOC HorizPre", l} - } - rr.HorizPre = exp&0x0f | m<<4&0xf0 - case 2: // VertPre - exp, m, ok := stringToCm(l.token) - if !ok { - return &ParseError{"", "bad LOC VertPre", l} - } - rr.VertPre = exp&0x0f | m<<4&0xf0 - } - count++ - case zBlank: - // Ok - default: - return &ParseError{"", "bad LOC Size, HorizPre or VertPre", l} - } - l, _ = c.Next() - } - return nil -} - -func (rr *HIP) parse(c *zlexer, o string) *ParseError { - // HitLength is not represented - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 8) - if e != nil || l.err { - return &ParseError{"", "bad HIP PublicKeyAlgorithm", l} - } - rr.PublicKeyAlgorithm = uint8(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - if len(l.token) == 0 || l.err { - return &ParseError{"", "bad HIP Hit", l} - } - rr.Hit = l.token // This can not contain spaces, see RFC 5205 Section 6. - rr.HitLength = uint8(len(rr.Hit)) / 2 - - c.Next() // zBlank - l, _ = c.Next() // zString - if len(l.token) == 0 || l.err { - return &ParseError{"", "bad HIP PublicKey", l} - } - rr.PublicKey = l.token // This cannot contain spaces - rr.PublicKeyLength = uint16(base64.StdEncoding.DecodedLen(len(rr.PublicKey))) - - // RendezvousServers (if any) - l, _ = c.Next() - var xs []string - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zString: - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad HIP RendezvousServers", l} - } - xs = append(xs, name) - case zBlank: - // Ok - default: - return &ParseError{"", "bad HIP RendezvousServers", l} - } - l, _ = c.Next() - } - - rr.RendezvousServers = xs - return nil -} - -func (rr *CERT) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - if v, ok := StringToCertType[l.token]; ok { - rr.Type = v - } else if i, err := strconv.ParseUint(l.token, 10, 16); err != nil { - return &ParseError{"", "bad CERT Type", l} - } else { - rr.Type = uint16(i) - } - c.Next() // zBlank - l, _ = c.Next() // zString - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad CERT KeyTag", l} - } - rr.KeyTag = uint16(i) - c.Next() // zBlank - l, _ = c.Next() // zString - if v, ok := StringToAlgorithm[l.token]; ok { - rr.Algorithm = v - } else if i, err := strconv.ParseUint(l.token, 10, 8); err != nil { - return &ParseError{"", "bad CERT Algorithm", l} - } else { - rr.Algorithm = uint8(i) - } - s, e1 := endingToString(c, "bad CERT Certificate") - if e1 != nil { - return e1 - } - rr.Certificate = s - return nil -} - -func (rr *OPENPGPKEY) parse(c *zlexer, o string) *ParseError { - s, e := endingToString(c, "bad OPENPGPKEY PublicKey") - if e != nil { - return e - } - rr.PublicKey = s - return nil -} - -func (rr *CSYNC) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - j, e := strconv.ParseUint(l.token, 10, 32) - if e != nil { - // Serial must be a number - return &ParseError{"", "bad CSYNC serial", l} - } - rr.Serial = uint32(j) - - c.Next() // zBlank - - l, _ = c.Next() - j, e1 := strconv.ParseUint(l.token, 10, 16) - if e1 != nil { - // Serial must be a number - return &ParseError{"", "bad CSYNC flags", l} - } - rr.Flags = uint16(j) - - rr.TypeBitMap = make([]uint16, 0) - var ( - k uint16 - ok bool - ) - l, _ = c.Next() - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zBlank: - // Ok - case zString: - tokenUpper := strings.ToUpper(l.token) - if k, ok = StringToType[tokenUpper]; !ok { - if k, ok = typeToInt(l.token); !ok { - return &ParseError{"", "bad CSYNC TypeBitMap", l} - } - } - rr.TypeBitMap = append(rr.TypeBitMap, k) - default: - return &ParseError{"", "bad CSYNC TypeBitMap", l} - } - l, _ = c.Next() - } - return nil -} - -func (rr *SIG) parse(c *zlexer, o string) *ParseError { return rr.RRSIG.parse(c, o) } - -func (rr *RRSIG) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - tokenUpper := strings.ToUpper(l.token) - if t, ok := StringToType[tokenUpper]; !ok { - if strings.HasPrefix(tokenUpper, "TYPE") { - t, ok = typeToInt(l.token) - if !ok { - return &ParseError{"", "bad RRSIG Typecovered", l} - } - rr.TypeCovered = t - } else { - return &ParseError{"", "bad RRSIG Typecovered", l} - } - } else { - rr.TypeCovered = t - } - - c.Next() // zBlank - l, _ = c.Next() - i, e := strconv.ParseUint(l.token, 10, 8) - if e != nil || l.err { - return &ParseError{"", "bad RRSIG Algorithm", l} - } - rr.Algorithm = uint8(i) - - c.Next() // zBlank - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad RRSIG Labels", l} - } - rr.Labels = uint8(i) - - c.Next() // zBlank - l, _ = c.Next() - i, e2 := strconv.ParseUint(l.token, 10, 32) - if e2 != nil || l.err { - return &ParseError{"", "bad RRSIG OrigTtl", l} - } - rr.OrigTtl = uint32(i) - - c.Next() // zBlank - l, _ = c.Next() - if i, err := StringToTime(l.token); err != nil { - // Try to see if all numeric and use it as epoch - if i, err := strconv.ParseUint(l.token, 10, 32); err == nil { - rr.Expiration = uint32(i) - } else { - return &ParseError{"", "bad RRSIG Expiration", l} - } - } else { - rr.Expiration = i - } - - c.Next() // zBlank - l, _ = c.Next() - if i, err := StringToTime(l.token); err != nil { - if i, err := strconv.ParseUint(l.token, 10, 32); err == nil { - rr.Inception = uint32(i) - } else { - return &ParseError{"", "bad RRSIG Inception", l} - } - } else { - rr.Inception = i - } - - c.Next() // zBlank - l, _ = c.Next() - i, e3 := strconv.ParseUint(l.token, 10, 16) - if e3 != nil || l.err { - return &ParseError{"", "bad RRSIG KeyTag", l} - } - rr.KeyTag = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() - rr.SignerName = l.token - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad RRSIG SignerName", l} - } - rr.SignerName = name - - s, e4 := endingToString(c, "bad RRSIG Signature") - if e4 != nil { - return e4 - } - rr.Signature = s - - return nil -} - -func (rr *NSEC) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad NSEC NextDomain", l} - } - rr.NextDomain = name - - rr.TypeBitMap = make([]uint16, 0) - var ( - k uint16 - ok bool - ) - l, _ = c.Next() - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zBlank: - // Ok - case zString: - tokenUpper := strings.ToUpper(l.token) - if k, ok = StringToType[tokenUpper]; !ok { - if k, ok = typeToInt(l.token); !ok { - return &ParseError{"", "bad NSEC TypeBitMap", l} - } - } - rr.TypeBitMap = append(rr.TypeBitMap, k) - default: - return &ParseError{"", "bad NSEC TypeBitMap", l} - } - l, _ = c.Next() - } - return nil -} - -func (rr *NSEC3) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 8) - if e != nil || l.err { - return &ParseError{"", "bad NSEC3 Hash", l} - } - rr.Hash = uint8(i) - c.Next() // zBlank - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad NSEC3 Flags", l} - } - rr.Flags = uint8(i) - c.Next() // zBlank - l, _ = c.Next() - i, e2 := strconv.ParseUint(l.token, 10, 16) - if e2 != nil || l.err { - return &ParseError{"", "bad NSEC3 Iterations", l} - } - rr.Iterations = uint16(i) - c.Next() - l, _ = c.Next() - if len(l.token) == 0 || l.err { - return &ParseError{"", "bad NSEC3 Salt", l} - } - if l.token != "-" { - rr.SaltLength = uint8(len(l.token)) / 2 - rr.Salt = l.token - } - - c.Next() - l, _ = c.Next() - if len(l.token) == 0 || l.err { - return &ParseError{"", "bad NSEC3 NextDomain", l} - } - rr.HashLength = 20 // Fix for NSEC3 (sha1 160 bits) - rr.NextDomain = l.token - - rr.TypeBitMap = make([]uint16, 0) - var ( - k uint16 - ok bool - ) - l, _ = c.Next() - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zBlank: - // Ok - case zString: - tokenUpper := strings.ToUpper(l.token) - if k, ok = StringToType[tokenUpper]; !ok { - if k, ok = typeToInt(l.token); !ok { - return &ParseError{"", "bad NSEC3 TypeBitMap", l} - } - } - rr.TypeBitMap = append(rr.TypeBitMap, k) - default: - return &ParseError{"", "bad NSEC3 TypeBitMap", l} - } - l, _ = c.Next() - } - return nil -} - -func (rr *NSEC3PARAM) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 8) - if e != nil || l.err { - return &ParseError{"", "bad NSEC3PARAM Hash", l} - } - rr.Hash = uint8(i) - c.Next() // zBlank - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad NSEC3PARAM Flags", l} - } - rr.Flags = uint8(i) - c.Next() // zBlank - l, _ = c.Next() - i, e2 := strconv.ParseUint(l.token, 10, 16) - if e2 != nil || l.err { - return &ParseError{"", "bad NSEC3PARAM Iterations", l} - } - rr.Iterations = uint16(i) - c.Next() - l, _ = c.Next() - if l.token != "-" { - rr.SaltLength = uint8(len(l.token) / 2) - rr.Salt = l.token - } - return slurpRemainder(c) -} - -func (rr *EUI48) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - if len(l.token) != 17 || l.err { - return &ParseError{"", "bad EUI48 Address", l} - } - addr := make([]byte, 12) - dash := 0 - for i := 0; i < 10; i += 2 { - addr[i] = l.token[i+dash] - addr[i+1] = l.token[i+1+dash] - dash++ - if l.token[i+1+dash] != '-' { - return &ParseError{"", "bad EUI48 Address", l} - } - } - addr[10] = l.token[15] - addr[11] = l.token[16] - - i, e := strconv.ParseUint(string(addr), 16, 48) - if e != nil { - return &ParseError{"", "bad EUI48 Address", l} - } - rr.Address = i - return slurpRemainder(c) -} - -func (rr *EUI64) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - if len(l.token) != 23 || l.err { - return &ParseError{"", "bad EUI64 Address", l} - } - addr := make([]byte, 16) - dash := 0 - for i := 0; i < 14; i += 2 { - addr[i] = l.token[i+dash] - addr[i+1] = l.token[i+1+dash] - dash++ - if l.token[i+1+dash] != '-' { - return &ParseError{"", "bad EUI64 Address", l} - } - } - addr[14] = l.token[21] - addr[15] = l.token[22] - - i, e := strconv.ParseUint(string(addr), 16, 64) - if e != nil { - return &ParseError{"", "bad EUI68 Address", l} - } - rr.Address = i - return slurpRemainder(c) -} - -func (rr *SSHFP) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 8) - if e != nil || l.err { - return &ParseError{"", "bad SSHFP Algorithm", l} - } - rr.Algorithm = uint8(i) - c.Next() // zBlank - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad SSHFP Type", l} - } - rr.Type = uint8(i) - c.Next() // zBlank - s, e2 := endingToString(c, "bad SSHFP Fingerprint") - if e2 != nil { - return e2 - } - rr.FingerPrint = s - return nil -} - -func (rr *DNSKEY) parseDNSKEY(c *zlexer, o, typ string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad " + typ + " Flags", l} - } - rr.Flags = uint16(i) - c.Next() // zBlank - l, _ = c.Next() // zString - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad " + typ + " Protocol", l} - } - rr.Protocol = uint8(i) - c.Next() // zBlank - l, _ = c.Next() // zString - i, e2 := strconv.ParseUint(l.token, 10, 8) - if e2 != nil || l.err { - return &ParseError{"", "bad " + typ + " Algorithm", l} - } - rr.Algorithm = uint8(i) - s, e3 := endingToString(c, "bad "+typ+" PublicKey") - if e3 != nil { - return e3 - } - rr.PublicKey = s - return nil -} - -func (rr *DNSKEY) parse(c *zlexer, o string) *ParseError { return rr.parseDNSKEY(c, o, "DNSKEY") } -func (rr *KEY) parse(c *zlexer, o string) *ParseError { return rr.parseDNSKEY(c, o, "KEY") } -func (rr *CDNSKEY) parse(c *zlexer, o string) *ParseError { return rr.parseDNSKEY(c, o, "CDNSKEY") } -func (rr *DS) parse(c *zlexer, o string) *ParseError { return rr.parseDS(c, o, "DS") } -func (rr *DLV) parse(c *zlexer, o string) *ParseError { return rr.parseDS(c, o, "DLV") } -func (rr *CDS) parse(c *zlexer, o string) *ParseError { return rr.parseDS(c, o, "CDS") } - -func (rr *RKEY) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad RKEY Flags", l} - } - rr.Flags = uint16(i) - c.Next() // zBlank - l, _ = c.Next() // zString - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad RKEY Protocol", l} - } - rr.Protocol = uint8(i) - c.Next() // zBlank - l, _ = c.Next() // zString - i, e2 := strconv.ParseUint(l.token, 10, 8) - if e2 != nil || l.err { - return &ParseError{"", "bad RKEY Algorithm", l} - } - rr.Algorithm = uint8(i) - s, e3 := endingToString(c, "bad RKEY PublicKey") - if e3 != nil { - return e3 - } - rr.PublicKey = s - return nil -} - -func (rr *EID) parse(c *zlexer, o string) *ParseError { - s, e := endingToString(c, "bad EID Endpoint") - if e != nil { - return e - } - rr.Endpoint = s - return nil -} - -func (rr *NIMLOC) parse(c *zlexer, o string) *ParseError { - s, e := endingToString(c, "bad NIMLOC Locator") - if e != nil { - return e - } - rr.Locator = s - return nil -} - -func (rr *GPOS) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - _, e := strconv.ParseFloat(l.token, 64) - if e != nil || l.err { - return &ParseError{"", "bad GPOS Longitude", l} - } - rr.Longitude = l.token - c.Next() // zBlank - l, _ = c.Next() - _, e1 := strconv.ParseFloat(l.token, 64) - if e1 != nil || l.err { - return &ParseError{"", "bad GPOS Latitude", l} - } - rr.Latitude = l.token - c.Next() // zBlank - l, _ = c.Next() - _, e2 := strconv.ParseFloat(l.token, 64) - if e2 != nil || l.err { - return &ParseError{"", "bad GPOS Altitude", l} - } - rr.Altitude = l.token - return slurpRemainder(c) -} - -func (rr *DS) parseDS(c *zlexer, o, typ string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad " + typ + " KeyTag", l} - } - rr.KeyTag = uint16(i) - c.Next() // zBlank - l, _ = c.Next() - if i, err := strconv.ParseUint(l.token, 10, 8); err != nil { - tokenUpper := strings.ToUpper(l.token) - i, ok := StringToAlgorithm[tokenUpper] - if !ok || l.err { - return &ParseError{"", "bad " + typ + " Algorithm", l} - } - rr.Algorithm = i - } else { - rr.Algorithm = uint8(i) - } - c.Next() // zBlank - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad " + typ + " DigestType", l} - } - rr.DigestType = uint8(i) - s, e2 := endingToString(c, "bad "+typ+" Digest") - if e2 != nil { - return e2 - } - rr.Digest = s - return nil -} - -func (rr *TA) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad TA KeyTag", l} - } - rr.KeyTag = uint16(i) - c.Next() // zBlank - l, _ = c.Next() - if i, err := strconv.ParseUint(l.token, 10, 8); err != nil { - tokenUpper := strings.ToUpper(l.token) - i, ok := StringToAlgorithm[tokenUpper] - if !ok || l.err { - return &ParseError{"", "bad TA Algorithm", l} - } - rr.Algorithm = i - } else { - rr.Algorithm = uint8(i) - } - c.Next() // zBlank - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad TA DigestType", l} - } - rr.DigestType = uint8(i) - s, e2 := endingToString(c, "bad TA Digest") - if e2 != nil { - return e2 - } - rr.Digest = s - return nil -} - -func (rr *TLSA) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 8) - if e != nil || l.err { - return &ParseError{"", "bad TLSA Usage", l} - } - rr.Usage = uint8(i) - c.Next() // zBlank - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad TLSA Selector", l} - } - rr.Selector = uint8(i) - c.Next() // zBlank - l, _ = c.Next() - i, e2 := strconv.ParseUint(l.token, 10, 8) - if e2 != nil || l.err { - return &ParseError{"", "bad TLSA MatchingType", l} - } - rr.MatchingType = uint8(i) - // So this needs be e2 (i.e. different than e), because...??t - s, e3 := endingToString(c, "bad TLSA Certificate") - if e3 != nil { - return e3 - } - rr.Certificate = s - return nil -} - -func (rr *SMIMEA) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 8) - if e != nil || l.err { - return &ParseError{"", "bad SMIMEA Usage", l} - } - rr.Usage = uint8(i) - c.Next() // zBlank - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad SMIMEA Selector", l} - } - rr.Selector = uint8(i) - c.Next() // zBlank - l, _ = c.Next() - i, e2 := strconv.ParseUint(l.token, 10, 8) - if e2 != nil || l.err { - return &ParseError{"", "bad SMIMEA MatchingType", l} - } - rr.MatchingType = uint8(i) - // So this needs be e2 (i.e. different than e), because...??t - s, e3 := endingToString(c, "bad SMIMEA Certificate") - if e3 != nil { - return e3 - } - rr.Certificate = s - return nil -} - -func (rr *RFC3597) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - if l.token != "\\#" { - return &ParseError{"", "bad RFC3597 Rdata", l} - } - - c.Next() // zBlank - l, _ = c.Next() - rdlength, e := strconv.Atoi(l.token) - if e != nil || l.err { - return &ParseError{"", "bad RFC3597 Rdata ", l} - } - - s, e1 := endingToString(c, "bad RFC3597 Rdata") - if e1 != nil { - return e1 - } - if rdlength*2 != len(s) { - return &ParseError{"", "bad RFC3597 Rdata", l} - } - rr.Rdata = s - return nil -} - -func (rr *SPF) parse(c *zlexer, o string) *ParseError { - s, e := endingToTxtSlice(c, "bad SPF Txt") - if e != nil { - return e - } - rr.Txt = s - return nil -} - -func (rr *AVC) parse(c *zlexer, o string) *ParseError { - s, e := endingToTxtSlice(c, "bad AVC Txt") - if e != nil { - return e - } - rr.Txt = s - return nil -} - -func (rr *TXT) parse(c *zlexer, o string) *ParseError { - // no zBlank reading here, because all this rdata is TXT - s, e := endingToTxtSlice(c, "bad TXT Txt") - if e != nil { - return e - } - rr.Txt = s - return nil -} - -// identical to setTXT -func (rr *NINFO) parse(c *zlexer, o string) *ParseError { - s, e := endingToTxtSlice(c, "bad NINFO ZSData") - if e != nil { - return e - } - rr.ZSData = s - return nil -} - -func (rr *URI) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad URI Priority", l} - } - rr.Priority = uint16(i) - c.Next() // zBlank - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 16) - if e1 != nil || l.err { - return &ParseError{"", "bad URI Weight", l} - } - rr.Weight = uint16(i) - - c.Next() // zBlank - s, e2 := endingToTxtSlice(c, "bad URI Target") - if e2 != nil { - return e2 - } - if len(s) != 1 { - return &ParseError{"", "bad URI Target", l} - } - rr.Target = s[0] - return nil -} - -func (rr *DHCID) parse(c *zlexer, o string) *ParseError { - // awesome record to parse! - s, e := endingToString(c, "bad DHCID Digest") - if e != nil { - return e - } - rr.Digest = s - return nil -} - -func (rr *NID) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad NID Preference", l} - } - rr.Preference = uint16(i) - c.Next() // zBlank - l, _ = c.Next() // zString - u, e1 := stringToNodeID(l) - if e1 != nil || l.err { - return e1 - } - rr.NodeID = u - return slurpRemainder(c) -} - -func (rr *L32) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad L32 Preference", l} - } - rr.Preference = uint16(i) - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Locator32 = net.ParseIP(l.token) - if rr.Locator32 == nil || l.err { - return &ParseError{"", "bad L32 Locator", l} - } - return slurpRemainder(c) -} - -func (rr *LP) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad LP Preference", l} - } - rr.Preference = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Fqdn = l.token - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{"", "bad LP Fqdn", l} - } - rr.Fqdn = name - return slurpRemainder(c) -} - -func (rr *L64) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad L64 Preference", l} - } - rr.Preference = uint16(i) - c.Next() // zBlank - l, _ = c.Next() // zString - u, e1 := stringToNodeID(l) - if e1 != nil || l.err { - return e1 - } - rr.Locator64 = u - return slurpRemainder(c) -} - -func (rr *UID) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 32) - if e != nil || l.err { - return &ParseError{"", "bad UID Uid", l} - } - rr.Uid = uint32(i) - return slurpRemainder(c) -} - -func (rr *GID) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 32) - if e != nil || l.err { - return &ParseError{"", "bad GID Gid", l} - } - rr.Gid = uint32(i) - return slurpRemainder(c) -} - -func (rr *UINFO) parse(c *zlexer, o string) *ParseError { - s, e := endingToTxtSlice(c, "bad UINFO Uinfo") - if e != nil { - return e - } - if ln := len(s); ln == 0 { - return nil - } - rr.Uinfo = s[0] // silently discard anything after the first character-string - return nil -} - -func (rr *PX) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{"", "bad PX Preference", l} - } - rr.Preference = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Map822 = l.token - map822, map822Ok := toAbsoluteName(l.token, o) - if l.err || !map822Ok { - return &ParseError{"", "bad PX Map822", l} - } - rr.Map822 = map822 - - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Mapx400 = l.token - mapx400, mapx400Ok := toAbsoluteName(l.token, o) - if l.err || !mapx400Ok { - return &ParseError{"", "bad PX Mapx400", l} - } - rr.Mapx400 = mapx400 - return slurpRemainder(c) -} - -func (rr *CAA) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 8) - if e != nil || l.err { - return &ParseError{"", "bad CAA Flag", l} - } - rr.Flag = uint8(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - if l.value != zString { - return &ParseError{"", "bad CAA Tag", l} - } - rr.Tag = l.token - - c.Next() // zBlank - s, e1 := endingToTxtSlice(c, "bad CAA Value") - if e1 != nil { - return e1 - } - if len(s) != 1 { - return &ParseError{"", "bad CAA Value", l} - } - rr.Value = s[0] - return nil -} - -func (rr *TKEY) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - - // Algorithm - if l.value != zString { - return &ParseError{"", "bad TKEY algorithm", l} - } - rr.Algorithm = l.token - c.Next() // zBlank - - // Get the key length and key values - l, _ = c.Next() - i, e := strconv.ParseUint(l.token, 10, 8) - if e != nil || l.err { - return &ParseError{"", "bad TKEY key length", l} - } - rr.KeySize = uint16(i) - c.Next() // zBlank - l, _ = c.Next() - if l.value != zString { - return &ParseError{"", "bad TKEY key", l} - } - rr.Key = l.token - c.Next() // zBlank - - // Get the otherdata length and string data - l, _ = c.Next() - i, e1 := strconv.ParseUint(l.token, 10, 8) - if e1 != nil || l.err { - return &ParseError{"", "bad TKEY otherdata length", l} - } - rr.OtherLen = uint16(i) - c.Next() // zBlank - l, _ = c.Next() - if l.value != zString { - return &ParseError{"", "bad TKEY otherday", l} - } - rr.OtherData = l.token - return nil -} - -func (rr *APL) parse(c *zlexer, o string) *ParseError { - var prefixes []APLPrefix - - for { - l, _ := c.Next() - if l.value == zNewline || l.value == zEOF { - break - } - if l.value == zBlank && prefixes != nil { - continue - } - if l.value != zString { - return &ParseError{"", "unexpected APL field", l} - } - - // Expected format: [!]afi:address/prefix - - colon := strings.IndexByte(l.token, ':') - if colon == -1 { - return &ParseError{"", "missing colon in APL field", l} - } - - family, cidr := l.token[:colon], l.token[colon+1:] - - var negation bool - if family != "" && family[0] == '!' { - negation = true - family = family[1:] - } - - afi, e := strconv.ParseUint(family, 10, 16) - if e != nil { - return &ParseError{"", "failed to parse APL family: " + e.Error(), l} - } - var addrLen int - switch afi { - case 1: - addrLen = net.IPv4len - case 2: - addrLen = net.IPv6len - default: - return &ParseError{"", "unrecognized APL family", l} - } - - ip, subnet, e1 := net.ParseCIDR(cidr) - if e1 != nil { - return &ParseError{"", "failed to parse APL address: " + e1.Error(), l} - } - if !ip.Equal(subnet.IP) { - return &ParseError{"", "extra bits in APL address", l} - } - - if len(subnet.IP) != addrLen { - return &ParseError{"", "address mismatch with the APL family", l} - } - - prefixes = append(prefixes, APLPrefix{ - Negation: negation, - Network: *subnet, - }) - } - - rr.Prefixes = prefixes - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/serve_mux.go b/cluster-autoscaler/vendor/github.com/miekg/dns/serve_mux.go deleted file mode 100644 index e7f36e221824..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/serve_mux.go +++ /dev/null @@ -1,122 +0,0 @@ -package dns - -import ( - "sync" -) - -// ServeMux is an DNS request multiplexer. It matches the zone name of -// each incoming request against a list of registered patterns add calls -// the handler for the pattern that most closely matches the zone name. -// -// ServeMux is DNSSEC aware, meaning that queries for the DS record are -// redirected to the parent zone (if that is also registered), otherwise -// the child gets the query. -// -// ServeMux is also safe for concurrent access from multiple goroutines. -// -// The zero ServeMux is empty and ready for use. -type ServeMux struct { - z map[string]Handler - m sync.RWMutex -} - -// NewServeMux allocates and returns a new ServeMux. -func NewServeMux() *ServeMux { - return new(ServeMux) -} - -// DefaultServeMux is the default ServeMux used by Serve. -var DefaultServeMux = NewServeMux() - -func (mux *ServeMux) match(q string, t uint16) Handler { - mux.m.RLock() - defer mux.m.RUnlock() - if mux.z == nil { - return nil - } - - q = CanonicalName(q) - - var handler Handler - for off, end := 0, false; !end; off, end = NextLabel(q, off) { - if h, ok := mux.z[q[off:]]; ok { - if t != TypeDS { - return h - } - // Continue for DS to see if we have a parent too, if so delegate to the parent - handler = h - } - } - - // Wildcard match, if we have found nothing try the root zone as a last resort. - if h, ok := mux.z["."]; ok { - return h - } - - return handler -} - -// Handle adds a handler to the ServeMux for pattern. -func (mux *ServeMux) Handle(pattern string, handler Handler) { - if pattern == "" { - panic("dns: invalid pattern " + pattern) - } - mux.m.Lock() - if mux.z == nil { - mux.z = make(map[string]Handler) - } - mux.z[CanonicalName(pattern)] = handler - mux.m.Unlock() -} - -// HandleFunc adds a handler function to the ServeMux for pattern. -func (mux *ServeMux) HandleFunc(pattern string, handler func(ResponseWriter, *Msg)) { - mux.Handle(pattern, HandlerFunc(handler)) -} - -// HandleRemove deregisters the handler specific for pattern from the ServeMux. -func (mux *ServeMux) HandleRemove(pattern string) { - if pattern == "" { - panic("dns: invalid pattern " + pattern) - } - mux.m.Lock() - delete(mux.z, CanonicalName(pattern)) - mux.m.Unlock() -} - -// ServeDNS dispatches the request to the handler whose pattern most -// closely matches the request message. -// -// ServeDNS is DNSSEC aware, meaning that queries for the DS record -// are redirected to the parent zone (if that is also registered), -// otherwise the child gets the query. -// -// If no handler is found, or there is no question, a standard REFUSED -// message is returned -func (mux *ServeMux) ServeDNS(w ResponseWriter, req *Msg) { - var h Handler - if len(req.Question) >= 1 { // allow more than one question - h = mux.match(req.Question[0].Name, req.Question[0].Qtype) - } - - if h != nil { - h.ServeDNS(w, req) - } else { - handleRefused(w, req) - } -} - -// Handle registers the handler with the given pattern -// in the DefaultServeMux. The documentation for -// ServeMux explains how patterns are matched. -func Handle(pattern string, handler Handler) { DefaultServeMux.Handle(pattern, handler) } - -// HandleRemove deregisters the handle with the given pattern -// in the DefaultServeMux. -func HandleRemove(pattern string) { DefaultServeMux.HandleRemove(pattern) } - -// HandleFunc registers the handler function with the given pattern -// in the DefaultServeMux. -func HandleFunc(pattern string, handler func(ResponseWriter, *Msg)) { - DefaultServeMux.HandleFunc(pattern, handler) -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/server.go b/cluster-autoscaler/vendor/github.com/miekg/dns/server.go deleted file mode 100644 index 30dfd41def49..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/server.go +++ /dev/null @@ -1,828 +0,0 @@ -// DNS server implementation. - -package dns - -import ( - "context" - "crypto/tls" - "encoding/binary" - "errors" - "io" - "net" - "strings" - "sync" - "time" -) - -// Default maximum number of TCP queries before we close the socket. -const maxTCPQueries = 128 - -// aLongTimeAgo is a non-zero time, far in the past, used for -// immediate cancelation of network operations. -var aLongTimeAgo = time.Unix(1, 0) - -// Handler is implemented by any value that implements ServeDNS. -type Handler interface { - ServeDNS(w ResponseWriter, r *Msg) -} - -// The HandlerFunc type is an adapter to allow the use of -// ordinary functions as DNS handlers. If f is a function -// with the appropriate signature, HandlerFunc(f) is a -// Handler object that calls f. -type HandlerFunc func(ResponseWriter, *Msg) - -// ServeDNS calls f(w, r). -func (f HandlerFunc) ServeDNS(w ResponseWriter, r *Msg) { - f(w, r) -} - -// A ResponseWriter interface is used by an DNS handler to -// construct an DNS response. -type ResponseWriter interface { - // LocalAddr returns the net.Addr of the server - LocalAddr() net.Addr - // RemoteAddr returns the net.Addr of the client that sent the current request. - RemoteAddr() net.Addr - // WriteMsg writes a reply back to the client. - WriteMsg(*Msg) error - // Write writes a raw buffer back to the client. - Write([]byte) (int, error) - // Close closes the connection. - Close() error - // TsigStatus returns the status of the Tsig. - TsigStatus() error - // TsigTimersOnly sets the tsig timers only boolean. - TsigTimersOnly(bool) - // Hijack lets the caller take over the connection. - // After a call to Hijack(), the DNS package will not do anything with the connection. - Hijack() -} - -// A ConnectionStater interface is used by a DNS Handler to access TLS connection state -// when available. -type ConnectionStater interface { - ConnectionState() *tls.ConnectionState -} - -type response struct { - closed bool // connection has been closed - hijacked bool // connection has been hijacked by handler - tsigTimersOnly bool - tsigStatus error - tsigRequestMAC string - tsigSecret map[string]string // the tsig secrets - udp net.PacketConn // i/o connection if UDP was used - tcp net.Conn // i/o connection if TCP was used - udpSession *SessionUDP // oob data to get egress interface right - pcSession net.Addr // address to use when writing to a generic net.PacketConn - writer Writer // writer to output the raw DNS bits -} - -// handleRefused returns a HandlerFunc that returns REFUSED for every request it gets. -func handleRefused(w ResponseWriter, r *Msg) { - m := new(Msg) - m.SetRcode(r, RcodeRefused) - w.WriteMsg(m) -} - -// HandleFailed returns a HandlerFunc that returns SERVFAIL for every request it gets. -// Deprecated: This function is going away. -func HandleFailed(w ResponseWriter, r *Msg) { - m := new(Msg) - m.SetRcode(r, RcodeServerFailure) - // does not matter if this write fails - w.WriteMsg(m) -} - -// ListenAndServe Starts a server on address and network specified Invoke handler -// for incoming queries. -func ListenAndServe(addr string, network string, handler Handler) error { - server := &Server{Addr: addr, Net: network, Handler: handler} - return server.ListenAndServe() -} - -// ListenAndServeTLS acts like http.ListenAndServeTLS, more information in -// http://golang.org/pkg/net/http/#ListenAndServeTLS -func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error { - cert, err := tls.LoadX509KeyPair(certFile, keyFile) - if err != nil { - return err - } - - config := tls.Config{ - Certificates: []tls.Certificate{cert}, - } - - server := &Server{ - Addr: addr, - Net: "tcp-tls", - TLSConfig: &config, - Handler: handler, - } - - return server.ListenAndServe() -} - -// ActivateAndServe activates a server with a listener from systemd, -// l and p should not both be non-nil. -// If both l and p are not nil only p will be used. -// Invoke handler for incoming queries. -func ActivateAndServe(l net.Listener, p net.PacketConn, handler Handler) error { - server := &Server{Listener: l, PacketConn: p, Handler: handler} - return server.ActivateAndServe() -} - -// Writer writes raw DNS messages; each call to Write should send an entire message. -type Writer interface { - io.Writer -} - -// Reader reads raw DNS messages; each call to ReadTCP or ReadUDP should return an entire message. -type Reader interface { - // ReadTCP reads a raw message from a TCP connection. Implementations may alter - // connection properties, for example the read-deadline. - ReadTCP(conn net.Conn, timeout time.Duration) ([]byte, error) - // ReadUDP reads a raw message from a UDP connection. Implementations may alter - // connection properties, for example the read-deadline. - ReadUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) -} - -// PacketConnReader is an optional interface that Readers can implement to support using generic net.PacketConns. -type PacketConnReader interface { - Reader - - // ReadPacketConn reads a raw message from a generic net.PacketConn UDP connection. Implementations may - // alter connection properties, for example the read-deadline. - ReadPacketConn(conn net.PacketConn, timeout time.Duration) ([]byte, net.Addr, error) -} - -// defaultReader is an adapter for the Server struct that implements the Reader and -// PacketConnReader interfaces using the readTCP, readUDP and readPacketConn funcs -// of the embedded Server. -type defaultReader struct { - *Server -} - -var _ PacketConnReader = defaultReader{} - -func (dr defaultReader) ReadTCP(conn net.Conn, timeout time.Duration) ([]byte, error) { - return dr.readTCP(conn, timeout) -} - -func (dr defaultReader) ReadUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) { - return dr.readUDP(conn, timeout) -} - -func (dr defaultReader) ReadPacketConn(conn net.PacketConn, timeout time.Duration) ([]byte, net.Addr, error) { - return dr.readPacketConn(conn, timeout) -} - -// DecorateReader is a decorator hook for extending or supplanting the functionality of a Reader. -// Implementations should never return a nil Reader. -// Readers should also implement the optional PacketConnReader interface. -// PacketConnReader is required to use a generic net.PacketConn. -type DecorateReader func(Reader) Reader - -// DecorateWriter is a decorator hook for extending or supplanting the functionality of a Writer. -// Implementations should never return a nil Writer. -type DecorateWriter func(Writer) Writer - -// A Server defines parameters for running an DNS server. -type Server struct { - // Address to listen on, ":dns" if empty. - Addr string - // if "tcp" or "tcp-tls" (DNS over TLS) it will invoke a TCP listener, otherwise an UDP one - Net string - // TCP Listener to use, this is to aid in systemd's socket activation. - Listener net.Listener - // TLS connection configuration - TLSConfig *tls.Config - // UDP "Listener" to use, this is to aid in systemd's socket activation. - PacketConn net.PacketConn - // Handler to invoke, dns.DefaultServeMux if nil. - Handler Handler - // Default buffer size to use to read incoming UDP messages. If not set - // it defaults to MinMsgSize (512 B). - UDPSize int - // The net.Conn.SetReadTimeout value for new connections, defaults to 2 * time.Second. - ReadTimeout time.Duration - // The net.Conn.SetWriteTimeout value for new connections, defaults to 2 * time.Second. - WriteTimeout time.Duration - // TCP idle timeout for multiple queries, if nil, defaults to 8 * time.Second (RFC 5966). - IdleTimeout func() time.Duration - // Secret(s) for Tsig map[]. The zonename must be in canonical form (lowercase, fqdn, see RFC 4034 Section 6.2). - TsigSecret map[string]string - // If NotifyStartedFunc is set it is called once the server has started listening. - NotifyStartedFunc func() - // DecorateReader is optional, allows customization of the process that reads raw DNS messages. - DecorateReader DecorateReader - // DecorateWriter is optional, allows customization of the process that writes raw DNS messages. - DecorateWriter DecorateWriter - // Maximum number of TCP queries before we close the socket. Default is maxTCPQueries (unlimited if -1). - MaxTCPQueries int - // Whether to set the SO_REUSEPORT socket option, allowing multiple listeners to be bound to a single address. - // It is only supported on go1.11+ and when using ListenAndServe. - ReusePort bool - // AcceptMsgFunc will check the incoming message and will reject it early in the process. - // By default DefaultMsgAcceptFunc will be used. - MsgAcceptFunc MsgAcceptFunc - - // Shutdown handling - lock sync.RWMutex - started bool - shutdown chan struct{} - conns map[net.Conn]struct{} - - // A pool for UDP message buffers. - udpPool sync.Pool -} - -func (srv *Server) isStarted() bool { - srv.lock.RLock() - started := srv.started - srv.lock.RUnlock() - return started -} - -func makeUDPBuffer(size int) func() interface{} { - return func() interface{} { - return make([]byte, size) - } -} - -func (srv *Server) init() { - srv.shutdown = make(chan struct{}) - srv.conns = make(map[net.Conn]struct{}) - - if srv.UDPSize == 0 { - srv.UDPSize = MinMsgSize - } - if srv.MsgAcceptFunc == nil { - srv.MsgAcceptFunc = DefaultMsgAcceptFunc - } - if srv.Handler == nil { - srv.Handler = DefaultServeMux - } - - srv.udpPool.New = makeUDPBuffer(srv.UDPSize) -} - -func unlockOnce(l sync.Locker) func() { - var once sync.Once - return func() { once.Do(l.Unlock) } -} - -// ListenAndServe starts a nameserver on the configured address in *Server. -func (srv *Server) ListenAndServe() error { - unlock := unlockOnce(&srv.lock) - srv.lock.Lock() - defer unlock() - - if srv.started { - return &Error{err: "server already started"} - } - - addr := srv.Addr - if addr == "" { - addr = ":domain" - } - - srv.init() - - switch srv.Net { - case "tcp", "tcp4", "tcp6": - l, err := listenTCP(srv.Net, addr, srv.ReusePort) - if err != nil { - return err - } - srv.Listener = l - srv.started = true - unlock() - return srv.serveTCP(l) - case "tcp-tls", "tcp4-tls", "tcp6-tls": - if srv.TLSConfig == nil || (len(srv.TLSConfig.Certificates) == 0 && srv.TLSConfig.GetCertificate == nil) { - return errors.New("dns: neither Certificates nor GetCertificate set in Config") - } - network := strings.TrimSuffix(srv.Net, "-tls") - l, err := listenTCP(network, addr, srv.ReusePort) - if err != nil { - return err - } - l = tls.NewListener(l, srv.TLSConfig) - srv.Listener = l - srv.started = true - unlock() - return srv.serveTCP(l) - case "udp", "udp4", "udp6": - l, err := listenUDP(srv.Net, addr, srv.ReusePort) - if err != nil { - return err - } - u := l.(*net.UDPConn) - if e := setUDPSocketOptions(u); e != nil { - return e - } - srv.PacketConn = l - srv.started = true - unlock() - return srv.serveUDP(u) - } - return &Error{err: "bad network"} -} - -// ActivateAndServe starts a nameserver with the PacketConn or Listener -// configured in *Server. Its main use is to start a server from systemd. -func (srv *Server) ActivateAndServe() error { - unlock := unlockOnce(&srv.lock) - srv.lock.Lock() - defer unlock() - - if srv.started { - return &Error{err: "server already started"} - } - - srv.init() - - if srv.PacketConn != nil { - // Check PacketConn interface's type is valid and value - // is not nil - if t, ok := srv.PacketConn.(*net.UDPConn); ok && t != nil { - if e := setUDPSocketOptions(t); e != nil { - return e - } - } - srv.started = true - unlock() - return srv.serveUDP(srv.PacketConn) - } - if srv.Listener != nil { - srv.started = true - unlock() - return srv.serveTCP(srv.Listener) - } - return &Error{err: "bad listeners"} -} - -// Shutdown shuts down a server. After a call to Shutdown, ListenAndServe and -// ActivateAndServe will return. -func (srv *Server) Shutdown() error { - return srv.ShutdownContext(context.Background()) -} - -// ShutdownContext shuts down a server. After a call to ShutdownContext, -// ListenAndServe and ActivateAndServe will return. -// -// A context.Context may be passed to limit how long to wait for connections -// to terminate. -func (srv *Server) ShutdownContext(ctx context.Context) error { - srv.lock.Lock() - if !srv.started { - srv.lock.Unlock() - return &Error{err: "server not started"} - } - - srv.started = false - - if srv.PacketConn != nil { - srv.PacketConn.SetReadDeadline(aLongTimeAgo) // Unblock reads - } - - if srv.Listener != nil { - srv.Listener.Close() - } - - for rw := range srv.conns { - rw.SetReadDeadline(aLongTimeAgo) // Unblock reads - } - - srv.lock.Unlock() - - if testShutdownNotify != nil { - testShutdownNotify.Broadcast() - } - - var ctxErr error - select { - case <-srv.shutdown: - case <-ctx.Done(): - ctxErr = ctx.Err() - } - - if srv.PacketConn != nil { - srv.PacketConn.Close() - } - - return ctxErr -} - -var testShutdownNotify *sync.Cond - -// getReadTimeout is a helper func to use system timeout if server did not intend to change it. -func (srv *Server) getReadTimeout() time.Duration { - if srv.ReadTimeout != 0 { - return srv.ReadTimeout - } - return dnsTimeout -} - -// serveTCP starts a TCP listener for the server. -func (srv *Server) serveTCP(l net.Listener) error { - defer l.Close() - - if srv.NotifyStartedFunc != nil { - srv.NotifyStartedFunc() - } - - var wg sync.WaitGroup - defer func() { - wg.Wait() - close(srv.shutdown) - }() - - for srv.isStarted() { - rw, err := l.Accept() - if err != nil { - if !srv.isStarted() { - return nil - } - if neterr, ok := err.(net.Error); ok && neterr.Temporary() { - continue - } - return err - } - srv.lock.Lock() - // Track the connection to allow unblocking reads on shutdown. - srv.conns[rw] = struct{}{} - srv.lock.Unlock() - wg.Add(1) - go srv.serveTCPConn(&wg, rw) - } - - return nil -} - -// serveUDP starts a UDP listener for the server. -func (srv *Server) serveUDP(l net.PacketConn) error { - defer l.Close() - - reader := Reader(defaultReader{srv}) - if srv.DecorateReader != nil { - reader = srv.DecorateReader(reader) - } - - lUDP, isUDP := l.(*net.UDPConn) - readerPC, canPacketConn := reader.(PacketConnReader) - if !isUDP && !canPacketConn { - return &Error{err: "PacketConnReader was not implemented on Reader returned from DecorateReader but is required for net.PacketConn"} - } - - if srv.NotifyStartedFunc != nil { - srv.NotifyStartedFunc() - } - - var wg sync.WaitGroup - defer func() { - wg.Wait() - close(srv.shutdown) - }() - - rtimeout := srv.getReadTimeout() - // deadline is not used here - for srv.isStarted() { - var ( - m []byte - sPC net.Addr - sUDP *SessionUDP - err error - ) - if isUDP { - m, sUDP, err = reader.ReadUDP(lUDP, rtimeout) - } else { - m, sPC, err = readerPC.ReadPacketConn(l, rtimeout) - } - if err != nil { - if !srv.isStarted() { - return nil - } - if netErr, ok := err.(net.Error); ok && netErr.Temporary() { - continue - } - return err - } - if len(m) < headerSize { - if cap(m) == srv.UDPSize { - srv.udpPool.Put(m[:srv.UDPSize]) - } - continue - } - wg.Add(1) - go srv.serveUDPPacket(&wg, m, l, sUDP, sPC) - } - - return nil -} - -// Serve a new TCP connection. -func (srv *Server) serveTCPConn(wg *sync.WaitGroup, rw net.Conn) { - w := &response{tsigSecret: srv.TsigSecret, tcp: rw} - if srv.DecorateWriter != nil { - w.writer = srv.DecorateWriter(w) - } else { - w.writer = w - } - - reader := Reader(defaultReader{srv}) - if srv.DecorateReader != nil { - reader = srv.DecorateReader(reader) - } - - idleTimeout := tcpIdleTimeout - if srv.IdleTimeout != nil { - idleTimeout = srv.IdleTimeout() - } - - timeout := srv.getReadTimeout() - - limit := srv.MaxTCPQueries - if limit == 0 { - limit = maxTCPQueries - } - - for q := 0; (q < limit || limit == -1) && srv.isStarted(); q++ { - m, err := reader.ReadTCP(w.tcp, timeout) - if err != nil { - // TODO(tmthrgd): handle error - break - } - srv.serveDNS(m, w) - if w.closed { - break // Close() was called - } - if w.hijacked { - break // client will call Close() themselves - } - // The first read uses the read timeout, the rest use the - // idle timeout. - timeout = idleTimeout - } - - if !w.hijacked { - w.Close() - } - - srv.lock.Lock() - delete(srv.conns, w.tcp) - srv.lock.Unlock() - - wg.Done() -} - -// Serve a new UDP request. -func (srv *Server) serveUDPPacket(wg *sync.WaitGroup, m []byte, u net.PacketConn, udpSession *SessionUDP, pcSession net.Addr) { - w := &response{tsigSecret: srv.TsigSecret, udp: u, udpSession: udpSession, pcSession: pcSession} - if srv.DecorateWriter != nil { - w.writer = srv.DecorateWriter(w) - } else { - w.writer = w - } - - srv.serveDNS(m, w) - wg.Done() -} - -func (srv *Server) serveDNS(m []byte, w *response) { - dh, off, err := unpackMsgHdr(m, 0) - if err != nil { - // Let client hang, they are sending crap; any reply can be used to amplify. - return - } - - req := new(Msg) - req.setHdr(dh) - - switch action := srv.MsgAcceptFunc(dh); action { - case MsgAccept: - if req.unpack(dh, m, off) == nil { - break - } - - fallthrough - case MsgReject, MsgRejectNotImplemented: - opcode := req.Opcode - req.SetRcodeFormatError(req) - req.Zero = false - if action == MsgRejectNotImplemented { - req.Opcode = opcode - req.Rcode = RcodeNotImplemented - } - - // Are we allowed to delete any OPT records here? - req.Ns, req.Answer, req.Extra = nil, nil, nil - - w.WriteMsg(req) - fallthrough - case MsgIgnore: - if w.udp != nil && cap(m) == srv.UDPSize { - srv.udpPool.Put(m[:srv.UDPSize]) - } - - return - } - - w.tsigStatus = nil - if w.tsigSecret != nil { - if t := req.IsTsig(); t != nil { - if secret, ok := w.tsigSecret[t.Hdr.Name]; ok { - w.tsigStatus = TsigVerify(m, secret, "", false) - } else { - w.tsigStatus = ErrSecret - } - w.tsigTimersOnly = false - w.tsigRequestMAC = req.Extra[len(req.Extra)-1].(*TSIG).MAC - } - } - - if w.udp != nil && cap(m) == srv.UDPSize { - srv.udpPool.Put(m[:srv.UDPSize]) - } - - srv.Handler.ServeDNS(w, req) // Writes back to the client -} - -func (srv *Server) readTCP(conn net.Conn, timeout time.Duration) ([]byte, error) { - // If we race with ShutdownContext, the read deadline may - // have been set in the distant past to unblock the read - // below. We must not override it, otherwise we may block - // ShutdownContext. - srv.lock.RLock() - if srv.started { - conn.SetReadDeadline(time.Now().Add(timeout)) - } - srv.lock.RUnlock() - - var length uint16 - if err := binary.Read(conn, binary.BigEndian, &length); err != nil { - return nil, err - } - - m := make([]byte, length) - if _, err := io.ReadFull(conn, m); err != nil { - return nil, err - } - - return m, nil -} - -func (srv *Server) readUDP(conn *net.UDPConn, timeout time.Duration) ([]byte, *SessionUDP, error) { - srv.lock.RLock() - if srv.started { - // See the comment in readTCP above. - conn.SetReadDeadline(time.Now().Add(timeout)) - } - srv.lock.RUnlock() - - m := srv.udpPool.Get().([]byte) - n, s, err := ReadFromSessionUDP(conn, m) - if err != nil { - srv.udpPool.Put(m) - return nil, nil, err - } - m = m[:n] - return m, s, nil -} - -func (srv *Server) readPacketConn(conn net.PacketConn, timeout time.Duration) ([]byte, net.Addr, error) { - srv.lock.RLock() - if srv.started { - // See the comment in readTCP above. - conn.SetReadDeadline(time.Now().Add(timeout)) - } - srv.lock.RUnlock() - - m := srv.udpPool.Get().([]byte) - n, addr, err := conn.ReadFrom(m) - if err != nil { - srv.udpPool.Put(m) - return nil, nil, err - } - m = m[:n] - return m, addr, nil -} - -// WriteMsg implements the ResponseWriter.WriteMsg method. -func (w *response) WriteMsg(m *Msg) (err error) { - if w.closed { - return &Error{err: "WriteMsg called after Close"} - } - - var data []byte - if w.tsigSecret != nil { // if no secrets, dont check for the tsig (which is a longer check) - if t := m.IsTsig(); t != nil { - data, w.tsigRequestMAC, err = TsigGenerate(m, w.tsigSecret[t.Hdr.Name], w.tsigRequestMAC, w.tsigTimersOnly) - if err != nil { - return err - } - _, err = w.writer.Write(data) - return err - } - } - data, err = m.Pack() - if err != nil { - return err - } - _, err = w.writer.Write(data) - return err -} - -// Write implements the ResponseWriter.Write method. -func (w *response) Write(m []byte) (int, error) { - if w.closed { - return 0, &Error{err: "Write called after Close"} - } - - switch { - case w.udp != nil: - if u, ok := w.udp.(*net.UDPConn); ok { - return WriteToSessionUDP(u, m, w.udpSession) - } - return w.udp.WriteTo(m, w.pcSession) - case w.tcp != nil: - if len(m) > MaxMsgSize { - return 0, &Error{err: "message too large"} - } - - l := make([]byte, 2) - binary.BigEndian.PutUint16(l, uint16(len(m))) - - n, err := (&net.Buffers{l, m}).WriteTo(w.tcp) - return int(n), err - default: - panic("dns: internal error: udp and tcp both nil") - } -} - -// LocalAddr implements the ResponseWriter.LocalAddr method. -func (w *response) LocalAddr() net.Addr { - switch { - case w.udp != nil: - return w.udp.LocalAddr() - case w.tcp != nil: - return w.tcp.LocalAddr() - default: - panic("dns: internal error: udp and tcp both nil") - } -} - -// RemoteAddr implements the ResponseWriter.RemoteAddr method. -func (w *response) RemoteAddr() net.Addr { - switch { - case w.udpSession != nil: - return w.udpSession.RemoteAddr() - case w.pcSession != nil: - return w.pcSession - case w.tcp != nil: - return w.tcp.RemoteAddr() - default: - panic("dns: internal error: udpSession, pcSession and tcp are all nil") - } -} - -// TsigStatus implements the ResponseWriter.TsigStatus method. -func (w *response) TsigStatus() error { return w.tsigStatus } - -// TsigTimersOnly implements the ResponseWriter.TsigTimersOnly method. -func (w *response) TsigTimersOnly(b bool) { w.tsigTimersOnly = b } - -// Hijack implements the ResponseWriter.Hijack method. -func (w *response) Hijack() { w.hijacked = true } - -// Close implements the ResponseWriter.Close method -func (w *response) Close() error { - if w.closed { - return &Error{err: "connection already closed"} - } - w.closed = true - - switch { - case w.udp != nil: - // Can't close the udp conn, as that is actually the listener. - return nil - case w.tcp != nil: - return w.tcp.Close() - default: - panic("dns: internal error: udp and tcp both nil") - } -} - -// ConnectionState() implements the ConnectionStater.ConnectionState() interface. -func (w *response) ConnectionState() *tls.ConnectionState { - type tlsConnectionStater interface { - ConnectionState() tls.ConnectionState - } - if v, ok := w.tcp.(tlsConnectionStater); ok { - t := v.ConnectionState() - return &t - } - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/sig0.go b/cluster-autoscaler/vendor/github.com/miekg/dns/sig0.go deleted file mode 100644 index 9ef13ccf3926..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/sig0.go +++ /dev/null @@ -1,197 +0,0 @@ -package dns - -import ( - "crypto" - "crypto/ecdsa" - "crypto/rsa" - "encoding/binary" - "math/big" - "strings" - "time" -) - -// Sign signs a dns.Msg. It fills the signature with the appropriate data. -// The SIG record should have the SignerName, KeyTag, Algorithm, Inception -// and Expiration set. -func (rr *SIG) Sign(k crypto.Signer, m *Msg) ([]byte, error) { - if k == nil { - return nil, ErrPrivKey - } - if rr.KeyTag == 0 || len(rr.SignerName) == 0 || rr.Algorithm == 0 { - return nil, ErrKey - } - - rr.Hdr = RR_Header{Name: ".", Rrtype: TypeSIG, Class: ClassANY, Ttl: 0} - rr.OrigTtl, rr.TypeCovered, rr.Labels = 0, 0, 0 - - buf := make([]byte, m.Len()+Len(rr)) - mbuf, err := m.PackBuffer(buf) - if err != nil { - return nil, err - } - if &buf[0] != &mbuf[0] { - return nil, ErrBuf - } - off, err := PackRR(rr, buf, len(mbuf), nil, false) - if err != nil { - return nil, err - } - buf = buf[:off:cap(buf)] - - hash, ok := AlgorithmToHash[rr.Algorithm] - if !ok { - return nil, ErrAlg - } - - hasher := hash.New() - // Write SIG rdata - hasher.Write(buf[len(mbuf)+1+2+2+4+2:]) - // Write message - hasher.Write(buf[:len(mbuf)]) - - signature, err := sign(k, hasher.Sum(nil), hash, rr.Algorithm) - if err != nil { - return nil, err - } - - rr.Signature = toBase64(signature) - - buf = append(buf, signature...) - if len(buf) > int(^uint16(0)) { - return nil, ErrBuf - } - // Adjust sig data length - rdoff := len(mbuf) + 1 + 2 + 2 + 4 - rdlen := binary.BigEndian.Uint16(buf[rdoff:]) - rdlen += uint16(len(signature)) - binary.BigEndian.PutUint16(buf[rdoff:], rdlen) - // Adjust additional count - adc := binary.BigEndian.Uint16(buf[10:]) - adc++ - binary.BigEndian.PutUint16(buf[10:], adc) - return buf, nil -} - -// Verify validates the message buf using the key k. -// It's assumed that buf is a valid message from which rr was unpacked. -func (rr *SIG) Verify(k *KEY, buf []byte) error { - if k == nil { - return ErrKey - } - if rr.KeyTag == 0 || len(rr.SignerName) == 0 || rr.Algorithm == 0 { - return ErrKey - } - - var hash crypto.Hash - switch rr.Algorithm { - case RSASHA1: - hash = crypto.SHA1 - case RSASHA256, ECDSAP256SHA256: - hash = crypto.SHA256 - case ECDSAP384SHA384: - hash = crypto.SHA384 - case RSASHA512: - hash = crypto.SHA512 - default: - return ErrAlg - } - hasher := hash.New() - - buflen := len(buf) - qdc := binary.BigEndian.Uint16(buf[4:]) - anc := binary.BigEndian.Uint16(buf[6:]) - auc := binary.BigEndian.Uint16(buf[8:]) - adc := binary.BigEndian.Uint16(buf[10:]) - offset := headerSize - var err error - for i := uint16(0); i < qdc && offset < buflen; i++ { - _, offset, err = UnpackDomainName(buf, offset) - if err != nil { - return err - } - // Skip past Type and Class - offset += 2 + 2 - } - for i := uint16(1); i < anc+auc+adc && offset < buflen; i++ { - _, offset, err = UnpackDomainName(buf, offset) - if err != nil { - return err - } - // Skip past Type, Class and TTL - offset += 2 + 2 + 4 - if offset+1 >= buflen { - continue - } - rdlen := binary.BigEndian.Uint16(buf[offset:]) - offset += 2 - offset += int(rdlen) - } - if offset >= buflen { - return &Error{err: "overflowing unpacking signed message"} - } - - // offset should be just prior to SIG - bodyend := offset - // owner name SHOULD be root - _, offset, err = UnpackDomainName(buf, offset) - if err != nil { - return err - } - // Skip Type, Class, TTL, RDLen - offset += 2 + 2 + 4 + 2 - sigstart := offset - // Skip Type Covered, Algorithm, Labels, Original TTL - offset += 2 + 1 + 1 + 4 - if offset+4+4 >= buflen { - return &Error{err: "overflow unpacking signed message"} - } - expire := binary.BigEndian.Uint32(buf[offset:]) - offset += 4 - incept := binary.BigEndian.Uint32(buf[offset:]) - offset += 4 - now := uint32(time.Now().Unix()) - if now < incept || now > expire { - return ErrTime - } - // Skip key tag - offset += 2 - var signername string - signername, offset, err = UnpackDomainName(buf, offset) - if err != nil { - return err - } - // If key has come from the DNS name compression might - // have mangled the case of the name - if !strings.EqualFold(signername, k.Header().Name) { - return &Error{err: "signer name doesn't match key name"} - } - sigend := offset - hasher.Write(buf[sigstart:sigend]) - hasher.Write(buf[:10]) - hasher.Write([]byte{ - byte((adc - 1) << 8), - byte(adc - 1), - }) - hasher.Write(buf[12:bodyend]) - - hashed := hasher.Sum(nil) - sig := buf[sigend:] - switch k.Algorithm { - case RSASHA1, RSASHA256, RSASHA512: - pk := k.publicKeyRSA() - if pk != nil { - return rsa.VerifyPKCS1v15(pk, hash, hashed, sig) - } - case ECDSAP256SHA256, ECDSAP384SHA384: - pk := k.publicKeyECDSA() - r := new(big.Int).SetBytes(sig[:len(sig)/2]) - s := new(big.Int).SetBytes(sig[len(sig)/2:]) - if pk != nil { - if ecdsa.Verify(pk, hashed, r, s) { - return nil - } - return ErrSig - } - } - return ErrKeyAlg -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/singleinflight.go b/cluster-autoscaler/vendor/github.com/miekg/dns/singleinflight.go deleted file mode 100644 index febcc300fe17..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/singleinflight.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Adapted for dns package usage by Miek Gieben. - -package dns - -import "sync" -import "time" - -// call is an in-flight or completed singleflight.Do call -type call struct { - wg sync.WaitGroup - val *Msg - rtt time.Duration - err error - dups int -} - -// singleflight represents a class of work and forms a namespace in -// which units of work can be executed with duplicate suppression. -type singleflight struct { - sync.Mutex // protects m - m map[string]*call // lazily initialized - - dontDeleteForTesting bool // this is only to be used by TestConcurrentExchanges -} - -// Do executes and returns the results of the given function, making -// sure that only one execution is in-flight for a given key at a -// time. If a duplicate comes in, the duplicate caller waits for the -// original to complete and receives the same results. -// The return value shared indicates whether v was given to multiple callers. -func (g *singleflight) Do(key string, fn func() (*Msg, time.Duration, error)) (v *Msg, rtt time.Duration, err error, shared bool) { - g.Lock() - if g.m == nil { - g.m = make(map[string]*call) - } - if c, ok := g.m[key]; ok { - c.dups++ - g.Unlock() - c.wg.Wait() - return c.val, c.rtt, c.err, true - } - c := new(call) - c.wg.Add(1) - g.m[key] = c - g.Unlock() - - c.val, c.rtt, c.err = fn() - c.wg.Done() - - if !g.dontDeleteForTesting { - g.Lock() - delete(g.m, key) - g.Unlock() - } - - return c.val, c.rtt, c.err, c.dups > 0 -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/smimea.go b/cluster-autoscaler/vendor/github.com/miekg/dns/smimea.go deleted file mode 100644 index 89f09f0d10c1..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/smimea.go +++ /dev/null @@ -1,44 +0,0 @@ -package dns - -import ( - "crypto/sha256" - "crypto/x509" - "encoding/hex" -) - -// Sign creates a SMIMEA record from an SSL certificate. -func (r *SMIMEA) Sign(usage, selector, matchingType int, cert *x509.Certificate) (err error) { - r.Hdr.Rrtype = TypeSMIMEA - r.Usage = uint8(usage) - r.Selector = uint8(selector) - r.MatchingType = uint8(matchingType) - - r.Certificate, err = CertificateToDANE(r.Selector, r.MatchingType, cert) - return err -} - -// Verify verifies a SMIMEA record against an SSL certificate. If it is OK -// a nil error is returned. -func (r *SMIMEA) Verify(cert *x509.Certificate) error { - c, err := CertificateToDANE(r.Selector, r.MatchingType, cert) - if err != nil { - return err // Not also ErrSig? - } - if r.Certificate == c { - return nil - } - return ErrSig // ErrSig, really? -} - -// SMIMEAName returns the ownername of a SMIMEA resource record as per the -// format specified in RFC 'draft-ietf-dane-smime-12' Section 2 and 3 -func SMIMEAName(email, domain string) (string, error) { - hasher := sha256.New() - hasher.Write([]byte(email)) - - // RFC Section 3: "The local-part is hashed using the SHA2-256 - // algorithm with the hash truncated to 28 octets and - // represented in its hexadecimal representation to become the - // left-most label in the prepared domain name" - return hex.EncodeToString(hasher.Sum(nil)[:28]) + "." + "_smimecert." + domain, nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/svcb.go b/cluster-autoscaler/vendor/github.com/miekg/dns/svcb.go deleted file mode 100644 index f44dc67d7b50..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/svcb.go +++ /dev/null @@ -1,744 +0,0 @@ -package dns - -import ( - "bytes" - "encoding/binary" - "errors" - "net" - "sort" - "strconv" - "strings" -) - -type SVCBKey uint16 - -// Keys defined in draft-ietf-dnsop-svcb-https-01 Section 12.3.2. -const ( - SVCB_MANDATORY SVCBKey = 0 - SVCB_ALPN SVCBKey = 1 - SVCB_NO_DEFAULT_ALPN SVCBKey = 2 - SVCB_PORT SVCBKey = 3 - SVCB_IPV4HINT SVCBKey = 4 - SVCB_ECHCONFIG SVCBKey = 5 - SVCB_IPV6HINT SVCBKey = 6 - svcb_RESERVED SVCBKey = 65535 -) - -var svcbKeyToStringMap = map[SVCBKey]string{ - SVCB_MANDATORY: "mandatory", - SVCB_ALPN: "alpn", - SVCB_NO_DEFAULT_ALPN: "no-default-alpn", - SVCB_PORT: "port", - SVCB_IPV4HINT: "ipv4hint", - SVCB_ECHCONFIG: "echconfig", - SVCB_IPV6HINT: "ipv6hint", -} - -var svcbStringToKeyMap = reverseSVCBKeyMap(svcbKeyToStringMap) - -func reverseSVCBKeyMap(m map[SVCBKey]string) map[string]SVCBKey { - n := make(map[string]SVCBKey, len(m)) - for u, s := range m { - n[s] = u - } - return n -} - -// String takes the numerical code of an SVCB key and returns its name. -// Returns an empty string for reserved keys. -// Accepts unassigned keys as well as experimental/private keys. -func (key SVCBKey) String() string { - if x := svcbKeyToStringMap[key]; x != "" { - return x - } - if key == svcb_RESERVED { - return "" - } - return "key" + strconv.FormatUint(uint64(key), 10) -} - -// svcbStringToKey returns the numerical code of an SVCB key. -// Returns svcb_RESERVED for reserved/invalid keys. -// Accepts unassigned keys as well as experimental/private keys. -func svcbStringToKey(s string) SVCBKey { - if strings.HasPrefix(s, "key") { - a, err := strconv.ParseUint(s[3:], 10, 16) - // no leading zeros - // key shouldn't be registered - if err != nil || a == 65535 || s[3] == '0' || svcbKeyToStringMap[SVCBKey(a)] != "" { - return svcb_RESERVED - } - return SVCBKey(a) - } - if key, ok := svcbStringToKeyMap[s]; ok { - return key - } - return svcb_RESERVED -} - -func (rr *SVCB) parse(c *zlexer, o string) *ParseError { - l, _ := c.Next() - i, e := strconv.ParseUint(l.token, 10, 16) - if e != nil || l.err { - return &ParseError{l.token, "bad SVCB priority", l} - } - rr.Priority = uint16(i) - - c.Next() // zBlank - l, _ = c.Next() // zString - rr.Target = l.token - - name, nameOk := toAbsoluteName(l.token, o) - if l.err || !nameOk { - return &ParseError{l.token, "bad SVCB Target", l} - } - rr.Target = name - - // Values (if any) - l, _ = c.Next() - var xs []SVCBKeyValue - // Helps require whitespace between pairs. - // Prevents key1000="a"key1001=... - canHaveNextKey := true - for l.value != zNewline && l.value != zEOF { - switch l.value { - case zString: - if !canHaveNextKey { - // The key we can now read was probably meant to be - // a part of the last value. - return &ParseError{l.token, "bad SVCB value quotation", l} - } - - // In key=value pairs, value does not have to be quoted unless value - // contains whitespace. And keys don't need to have values. - // Similarly, keys with an equality signs after them don't need values. - // l.token includes at least up to the first equality sign. - idx := strings.IndexByte(l.token, '=') - var key, value string - if idx < 0 { - // Key with no value and no equality sign - key = l.token - } else if idx == 0 { - return &ParseError{l.token, "bad SVCB key", l} - } else { - key, value = l.token[:idx], l.token[idx+1:] - - if value == "" { - // We have a key and an equality sign. Maybe we have nothing - // after "=" or we have a double quote. - l, _ = c.Next() - if l.value == zQuote { - // Only needed when value ends with double quotes. - // Any value starting with zQuote ends with it. - canHaveNextKey = false - - l, _ = c.Next() - switch l.value { - case zString: - // We have a value in double quotes. - value = l.token - l, _ = c.Next() - if l.value != zQuote { - return &ParseError{l.token, "SVCB unterminated value", l} - } - case zQuote: - // There's nothing in double quotes. - default: - return &ParseError{l.token, "bad SVCB value", l} - } - } - } - } - kv := makeSVCBKeyValue(svcbStringToKey(key)) - if kv == nil { - return &ParseError{l.token, "bad SVCB key", l} - } - if err := kv.parse(value); err != nil { - return &ParseError{l.token, err.Error(), l} - } - xs = append(xs, kv) - case zQuote: - return &ParseError{l.token, "SVCB key can't contain double quotes", l} - case zBlank: - canHaveNextKey = true - default: - return &ParseError{l.token, "bad SVCB values", l} - } - l, _ = c.Next() - } - rr.Value = xs - if rr.Priority == 0 && len(xs) > 0 { - return &ParseError{l.token, "SVCB aliasform can't have values", l} - } - return nil -} - -// makeSVCBKeyValue returns an SVCBKeyValue struct with the key or nil for reserved keys. -func makeSVCBKeyValue(key SVCBKey) SVCBKeyValue { - switch key { - case SVCB_MANDATORY: - return new(SVCBMandatory) - case SVCB_ALPN: - return new(SVCBAlpn) - case SVCB_NO_DEFAULT_ALPN: - return new(SVCBNoDefaultAlpn) - case SVCB_PORT: - return new(SVCBPort) - case SVCB_IPV4HINT: - return new(SVCBIPv4Hint) - case SVCB_ECHCONFIG: - return new(SVCBECHConfig) - case SVCB_IPV6HINT: - return new(SVCBIPv6Hint) - case svcb_RESERVED: - return nil - default: - e := new(SVCBLocal) - e.KeyCode = key - return e - } -} - -// SVCB RR. See RFC xxxx (https://tools.ietf.org/html/draft-ietf-dnsop-svcb-https-01). -type SVCB struct { - Hdr RR_Header - Priority uint16 - Target string `dns:"domain-name"` - Value []SVCBKeyValue `dns:"pairs"` // Value must be empty if Priority is non-zero. -} - -// HTTPS RR. Everything valid for SVCB applies to HTTPS as well. -// Except that the HTTPS record is intended for use with the HTTP and HTTPS protocols. -type HTTPS struct { - SVCB -} - -func (rr *HTTPS) String() string { - return rr.SVCB.String() -} - -func (rr *HTTPS) parse(c *zlexer, o string) *ParseError { - return rr.SVCB.parse(c, o) -} - -// SVCBKeyValue defines a key=value pair for the SVCB RR type. -// An SVCB RR can have multiple SVCBKeyValues appended to it. -type SVCBKeyValue interface { - Key() SVCBKey // Key returns the numerical key code. - pack() ([]byte, error) // pack returns the encoded value. - unpack([]byte) error // unpack sets the value. - String() string // String returns the string representation of the value. - parse(string) error // parse sets the value to the given string representation of the value. - copy() SVCBKeyValue // copy returns a deep-copy of the pair. - len() int // len returns the length of value in the wire format. -} - -// SVCBMandatory pair adds to required keys that must be interpreted for the RR -// to be functional. -// Basic use pattern for creating a mandatory option: -// -// s := &dns.SVCB{Hdr: dns.RR_Header{Name: ".", Rrtype: dns.TypeSVCB, Class: dns.ClassINET}} -// e := new(dns.SVCBMandatory) -// e.Code = []uint16{65403} -// s.Value = append(s.Value, e) -type SVCBMandatory struct { - Code []SVCBKey // Must not include mandatory -} - -func (*SVCBMandatory) Key() SVCBKey { return SVCB_MANDATORY } - -func (s *SVCBMandatory) String() string { - str := make([]string, len(s.Code)) - for i, e := range s.Code { - str[i] = e.String() - } - return strings.Join(str, ",") -} - -func (s *SVCBMandatory) pack() ([]byte, error) { - codes := append([]SVCBKey(nil), s.Code...) - sort.Slice(codes, func(i, j int) bool { - return codes[i] < codes[j] - }) - b := make([]byte, 2*len(codes)) - for i, e := range codes { - binary.BigEndian.PutUint16(b[2*i:], uint16(e)) - } - return b, nil -} - -func (s *SVCBMandatory) unpack(b []byte) error { - if len(b)%2 != 0 { - return errors.New("dns: svcbmandatory: value length is not a multiple of 2") - } - codes := make([]SVCBKey, 0, len(b)/2) - for i := 0; i < len(b); i += 2 { - // We assume strictly increasing order. - codes = append(codes, SVCBKey(binary.BigEndian.Uint16(b[i:]))) - } - s.Code = codes - return nil -} - -func (s *SVCBMandatory) parse(b string) error { - str := strings.Split(b, ",") - codes := make([]SVCBKey, 0, len(str)) - for _, e := range str { - codes = append(codes, svcbStringToKey(e)) - } - s.Code = codes - return nil -} - -func (s *SVCBMandatory) len() int { - return 2 * len(s.Code) -} - -func (s *SVCBMandatory) copy() SVCBKeyValue { - return &SVCBMandatory{ - append([]SVCBKey(nil), s.Code...), - } -} - -// SVCBAlpn pair is used to list supported connection protocols. -// Protocol ids can be found at: -// https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids -// Basic use pattern for creating an alpn option: -// -// h := new(dns.HTTPS) -// h.Hdr = dns.RR_Header{Name: ".", Rrtype: dns.TypeHTTPS, Class: dns.ClassINET} -// e := new(dns.SVCBAlpn) -// e.Alpn = []string{"h2", "http/1.1"} -// h.Value = append(o.Value, e) -type SVCBAlpn struct { - Alpn []string -} - -func (*SVCBAlpn) Key() SVCBKey { return SVCB_ALPN } -func (s *SVCBAlpn) String() string { return strings.Join(s.Alpn, ",") } - -func (s *SVCBAlpn) pack() ([]byte, error) { - // Liberally estimate the size of an alpn as 10 octets - b := make([]byte, 0, 10*len(s.Alpn)) - for _, e := range s.Alpn { - if len(e) == 0 { - return nil, errors.New("dns: svcbalpn: empty alpn-id") - } - if len(e) > 255 { - return nil, errors.New("dns: svcbalpn: alpn-id too long") - } - b = append(b, byte(len(e))) - b = append(b, e...) - } - return b, nil -} - -func (s *SVCBAlpn) unpack(b []byte) error { - // Estimate the size of the smallest alpn as 4 bytes - alpn := make([]string, 0, len(b)/4) - for i := 0; i < len(b); { - length := int(b[i]) - i++ - if i+length > len(b) { - return errors.New("dns: svcbalpn: alpn array overflowing") - } - alpn = append(alpn, string(b[i:i+length])) - i += length - } - s.Alpn = alpn - return nil -} - -func (s *SVCBAlpn) parse(b string) error { - s.Alpn = strings.Split(b, ",") - return nil -} - -func (s *SVCBAlpn) len() int { - var l int - for _, e := range s.Alpn { - l += 1 + len(e) - } - return l -} - -func (s *SVCBAlpn) copy() SVCBKeyValue { - return &SVCBAlpn{ - append([]string(nil), s.Alpn...), - } -} - -// SVCBNoDefaultAlpn pair signifies no support for default connection protocols. -// Basic use pattern for creating a no-default-alpn option: -// -// s := &dns.SVCB{Hdr: dns.RR_Header{Name: ".", Rrtype: dns.TypeSVCB, Class: dns.ClassINET}} -// e := new(dns.SVCBNoDefaultAlpn) -// s.Value = append(s.Value, e) -type SVCBNoDefaultAlpn struct{} - -func (*SVCBNoDefaultAlpn) Key() SVCBKey { return SVCB_NO_DEFAULT_ALPN } -func (*SVCBNoDefaultAlpn) copy() SVCBKeyValue { return &SVCBNoDefaultAlpn{} } -func (*SVCBNoDefaultAlpn) pack() ([]byte, error) { return []byte{}, nil } -func (*SVCBNoDefaultAlpn) String() string { return "" } -func (*SVCBNoDefaultAlpn) len() int { return 0 } - -func (*SVCBNoDefaultAlpn) unpack(b []byte) error { - if len(b) != 0 { - return errors.New("dns: svcbnodefaultalpn: no_default_alpn must have no value") - } - return nil -} - -func (*SVCBNoDefaultAlpn) parse(b string) error { - if len(b) != 0 { - return errors.New("dns: svcbnodefaultalpn: no_default_alpn must have no value") - } - return nil -} - -// SVCBPort pair defines the port for connection. -// Basic use pattern for creating a port option: -// -// s := &dns.SVCB{Hdr: dns.RR_Header{Name: ".", Rrtype: dns.TypeSVCB, Class: dns.ClassINET}} -// e := new(dns.SVCBPort) -// e.Port = 80 -// s.Value = append(s.Value, e) -type SVCBPort struct { - Port uint16 -} - -func (*SVCBPort) Key() SVCBKey { return SVCB_PORT } -func (*SVCBPort) len() int { return 2 } -func (s *SVCBPort) String() string { return strconv.FormatUint(uint64(s.Port), 10) } -func (s *SVCBPort) copy() SVCBKeyValue { return &SVCBPort{s.Port} } - -func (s *SVCBPort) unpack(b []byte) error { - if len(b) != 2 { - return errors.New("dns: svcbport: port length is not exactly 2 octets") - } - s.Port = binary.BigEndian.Uint16(b) - return nil -} - -func (s *SVCBPort) pack() ([]byte, error) { - b := make([]byte, 2) - binary.BigEndian.PutUint16(b, s.Port) - return b, nil -} - -func (s *SVCBPort) parse(b string) error { - port, err := strconv.ParseUint(b, 10, 16) - if err != nil { - return errors.New("dns: svcbport: port out of range") - } - s.Port = uint16(port) - return nil -} - -// SVCBIPv4Hint pair suggests an IPv4 address which may be used to open connections -// if A and AAAA record responses for SVCB's Target domain haven't been received. -// In that case, optionally, A and AAAA requests can be made, after which the connection -// to the hinted IP address may be terminated and a new connection may be opened. -// Basic use pattern for creating an ipv4hint option: -// -// h := new(dns.HTTPS) -// h.Hdr = dns.RR_Header{Name: ".", Rrtype: dns.TypeHTTPS, Class: dns.ClassINET} -// e := new(dns.SVCBIPv4Hint) -// e.Hint = []net.IP{net.IPv4(1,1,1,1).To4()} -// -// Or -// -// e.Hint = []net.IP{net.ParseIP("1.1.1.1").To4()} -// h.Value = append(h.Value, e) -type SVCBIPv4Hint struct { - Hint []net.IP -} - -func (*SVCBIPv4Hint) Key() SVCBKey { return SVCB_IPV4HINT } -func (s *SVCBIPv4Hint) len() int { return 4 * len(s.Hint) } - -func (s *SVCBIPv4Hint) pack() ([]byte, error) { - b := make([]byte, 0, 4*len(s.Hint)) - for _, e := range s.Hint { - x := e.To4() - if x == nil { - return nil, errors.New("dns: svcbipv4hint: expected ipv4, hint is ipv6") - } - b = append(b, x...) - } - return b, nil -} - -func (s *SVCBIPv4Hint) unpack(b []byte) error { - if len(b) == 0 || len(b)%4 != 0 { - return errors.New("dns: svcbipv4hint: ipv4 address byte array length is not a multiple of 4") - } - x := make([]net.IP, 0, len(b)/4) - for i := 0; i < len(b); i += 4 { - x = append(x, net.IP(b[i:i+4])) - } - s.Hint = x - return nil -} - -func (s *SVCBIPv4Hint) String() string { - str := make([]string, len(s.Hint)) - for i, e := range s.Hint { - x := e.To4() - if x == nil { - return "" - } - str[i] = x.String() - } - return strings.Join(str, ",") -} - -func (s *SVCBIPv4Hint) parse(b string) error { - if strings.Contains(b, ":") { - return errors.New("dns: svcbipv4hint: expected ipv4, got ipv6") - } - str := strings.Split(b, ",") - dst := make([]net.IP, len(str)) - for i, e := range str { - ip := net.ParseIP(e).To4() - if ip == nil { - return errors.New("dns: svcbipv4hint: bad ip") - } - dst[i] = ip - } - s.Hint = dst - return nil -} - -func (s *SVCBIPv4Hint) copy() SVCBKeyValue { - return &SVCBIPv4Hint{ - append([]net.IP(nil), s.Hint...), - } -} - -// SVCBECHConfig pair contains the ECHConfig structure defined in draft-ietf-tls-esni [RFC xxxx]. -// Basic use pattern for creating an echconfig option: -// -// h := new(dns.HTTPS) -// h.Hdr = dns.RR_Header{Name: ".", Rrtype: dns.TypeHTTPS, Class: dns.ClassINET} -// e := new(dns.SVCBECHConfig) -// e.ECH = []byte{0xfe, 0x08, ...} -// h.Value = append(h.Value, e) -type SVCBECHConfig struct { - ECH []byte -} - -func (*SVCBECHConfig) Key() SVCBKey { return SVCB_ECHCONFIG } -func (s *SVCBECHConfig) String() string { return toBase64(s.ECH) } -func (s *SVCBECHConfig) len() int { return len(s.ECH) } - -func (s *SVCBECHConfig) pack() ([]byte, error) { - return append([]byte(nil), s.ECH...), nil -} - -func (s *SVCBECHConfig) copy() SVCBKeyValue { - return &SVCBECHConfig{ - append([]byte(nil), s.ECH...), - } -} - -func (s *SVCBECHConfig) unpack(b []byte) error { - s.ECH = append([]byte(nil), b...) - return nil -} -func (s *SVCBECHConfig) parse(b string) error { - x, err := fromBase64([]byte(b)) - if err != nil { - return errors.New("dns: svcbechconfig: bad base64 echconfig") - } - s.ECH = x - return nil -} - -// SVCBIPv6Hint pair suggests an IPv6 address which may be used to open connections -// if A and AAAA record responses for SVCB's Target domain haven't been received. -// In that case, optionally, A and AAAA requests can be made, after which the -// connection to the hinted IP address may be terminated and a new connection may be opened. -// Basic use pattern for creating an ipv6hint option: -// -// h := new(dns.HTTPS) -// h.Hdr = dns.RR_Header{Name: ".", Rrtype: dns.TypeHTTPS, Class: dns.ClassINET} -// e := new(dns.SVCBIPv6Hint) -// e.Hint = []net.IP{net.ParseIP("2001:db8::1")} -// h.Value = append(h.Value, e) -type SVCBIPv6Hint struct { - Hint []net.IP -} - -func (*SVCBIPv6Hint) Key() SVCBKey { return SVCB_IPV6HINT } -func (s *SVCBIPv6Hint) len() int { return 16 * len(s.Hint) } - -func (s *SVCBIPv6Hint) pack() ([]byte, error) { - b := make([]byte, 0, 16*len(s.Hint)) - for _, e := range s.Hint { - if len(e) != net.IPv6len || e.To4() != nil { - return nil, errors.New("dns: svcbipv6hint: expected ipv6, hint is ipv4") - } - b = append(b, e...) - } - return b, nil -} - -func (s *SVCBIPv6Hint) unpack(b []byte) error { - if len(b) == 0 || len(b)%16 != 0 { - return errors.New("dns: svcbipv6hint: ipv6 address byte array length not a multiple of 16") - } - x := make([]net.IP, 0, len(b)/16) - for i := 0; i < len(b); i += 16 { - ip := net.IP(b[i : i+16]) - if ip.To4() != nil { - return errors.New("dns: svcbipv6hint: expected ipv6, got ipv4") - } - x = append(x, ip) - } - s.Hint = x - return nil -} - -func (s *SVCBIPv6Hint) String() string { - str := make([]string, len(s.Hint)) - for i, e := range s.Hint { - if x := e.To4(); x != nil { - return "" - } - str[i] = e.String() - } - return strings.Join(str, ",") -} - -func (s *SVCBIPv6Hint) parse(b string) error { - if strings.Contains(b, ".") { - return errors.New("dns: svcbipv6hint: expected ipv6, got ipv4") - } - str := strings.Split(b, ",") - dst := make([]net.IP, len(str)) - for i, e := range str { - ip := net.ParseIP(e) - if ip == nil { - return errors.New("dns: svcbipv6hint: bad ip") - } - dst[i] = ip - } - s.Hint = dst - return nil -} - -func (s *SVCBIPv6Hint) copy() SVCBKeyValue { - return &SVCBIPv6Hint{ - append([]net.IP(nil), s.Hint...), - } -} - -// SVCBLocal pair is intended for experimental/private use. The key is recommended -// to be in the range [SVCB_PRIVATE_LOWER, SVCB_PRIVATE_UPPER]. -// Basic use pattern for creating a keyNNNNN option: -// -// h := new(dns.HTTPS) -// h.Hdr = dns.RR_Header{Name: ".", Rrtype: dns.TypeHTTPS, Class: dns.ClassINET} -// e := new(dns.SVCBLocal) -// e.KeyCode = 65400 -// e.Data = []byte("abc") -// h.Value = append(h.Value, e) -type SVCBLocal struct { - KeyCode SVCBKey // Never 65535 or any assigned keys. - Data []byte // All byte sequences are allowed. -} - -func (s *SVCBLocal) Key() SVCBKey { return s.KeyCode } -func (s *SVCBLocal) pack() ([]byte, error) { return append([]byte(nil), s.Data...), nil } -func (s *SVCBLocal) len() int { return len(s.Data) } - -func (s *SVCBLocal) unpack(b []byte) error { - s.Data = append([]byte(nil), b...) - return nil -} - -func (s *SVCBLocal) String() string { - var str strings.Builder - str.Grow(4 * len(s.Data)) - for _, e := range s.Data { - if ' ' <= e && e <= '~' { - switch e { - case '"', ';', ' ', '\\': - str.WriteByte('\\') - str.WriteByte(e) - default: - str.WriteByte(e) - } - } else { - str.WriteString(escapeByte(e)) - } - } - return str.String() -} - -func (s *SVCBLocal) parse(b string) error { - data := make([]byte, 0, len(b)) - for i := 0; i < len(b); { - if b[i] != '\\' { - data = append(data, b[i]) - i++ - continue - } - if i+1 == len(b) { - return errors.New("dns: svcblocal: svcb private/experimental key escape unterminated") - } - if isDigit(b[i+1]) { - if i+3 < len(b) && isDigit(b[i+2]) && isDigit(b[i+3]) { - a, err := strconv.ParseUint(b[i+1:i+4], 10, 8) - if err == nil { - i += 4 - data = append(data, byte(a)) - continue - } - } - return errors.New("dns: svcblocal: svcb private/experimental key bad escaped octet") - } else { - data = append(data, b[i+1]) - i += 2 - } - } - s.Data = data - return nil -} - -func (s *SVCBLocal) copy() SVCBKeyValue { - return &SVCBLocal{s.KeyCode, - append([]byte(nil), s.Data...), - } -} - -func (rr *SVCB) String() string { - s := rr.Hdr.String() + - strconv.Itoa(int(rr.Priority)) + " " + - sprintName(rr.Target) - for _, e := range rr.Value { - s += " " + e.Key().String() + "=\"" + e.String() + "\"" - } - return s -} - -// areSVCBPairArraysEqual checks if SVCBKeyValue arrays are equal after sorting their -// copies. arrA and arrB have equal lengths, otherwise zduplicate.go wouldn't call this function. -func areSVCBPairArraysEqual(a []SVCBKeyValue, b []SVCBKeyValue) bool { - a = append([]SVCBKeyValue(nil), a...) - b = append([]SVCBKeyValue(nil), b...) - sort.Slice(a, func(i, j int) bool { return a[i].Key() < a[j].Key() }) - sort.Slice(b, func(i, j int) bool { return b[i].Key() < b[j].Key() }) - for i, e := range a { - if e.Key() != b[i].Key() { - return false - } - b1, err1 := e.pack() - b2, err2 := b[i].pack() - if err1 != nil || err2 != nil || !bytes.Equal(b1, b2) { - return false - } - } - return true -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/tlsa.go b/cluster-autoscaler/vendor/github.com/miekg/dns/tlsa.go deleted file mode 100644 index 4e07983b9787..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/tlsa.go +++ /dev/null @@ -1,44 +0,0 @@ -package dns - -import ( - "crypto/x509" - "net" - "strconv" -) - -// Sign creates a TLSA record from an SSL certificate. -func (r *TLSA) Sign(usage, selector, matchingType int, cert *x509.Certificate) (err error) { - r.Hdr.Rrtype = TypeTLSA - r.Usage = uint8(usage) - r.Selector = uint8(selector) - r.MatchingType = uint8(matchingType) - - r.Certificate, err = CertificateToDANE(r.Selector, r.MatchingType, cert) - return err -} - -// Verify verifies a TLSA record against an SSL certificate. If it is OK -// a nil error is returned. -func (r *TLSA) Verify(cert *x509.Certificate) error { - c, err := CertificateToDANE(r.Selector, r.MatchingType, cert) - if err != nil { - return err // Not also ErrSig? - } - if r.Certificate == c { - return nil - } - return ErrSig // ErrSig, really? -} - -// TLSAName returns the ownername of a TLSA resource record as per the -// rules specified in RFC 6698, Section 3. -func TLSAName(name, service, network string) (string, error) { - if !IsFqdn(name) { - return "", ErrFqdn - } - p, err := net.LookupPort(network, service) - if err != nil { - return "", err - } - return "_" + strconv.Itoa(p) + "._" + network + "." + name, nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/tsig.go b/cluster-autoscaler/vendor/github.com/miekg/dns/tsig.go deleted file mode 100644 index 59904dd6a090..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/tsig.go +++ /dev/null @@ -1,413 +0,0 @@ -package dns - -import ( - "crypto/hmac" - "crypto/sha1" - "crypto/sha256" - "crypto/sha512" - "encoding/binary" - "encoding/hex" - "hash" - "strconv" - "strings" - "time" -) - -// HMAC hashing codes. These are transmitted as domain names. -const ( - HmacSHA1 = "hmac-sha1." - HmacSHA224 = "hmac-sha224." - HmacSHA256 = "hmac-sha256." - HmacSHA384 = "hmac-sha384." - HmacSHA512 = "hmac-sha512." - - HmacMD5 = "hmac-md5.sig-alg.reg.int." // Deprecated: HmacMD5 is no longer supported. -) - -// TSIG is the RR the holds the transaction signature of a message. -// See RFC 2845 and RFC 4635. -type TSIG struct { - Hdr RR_Header - Algorithm string `dns:"domain-name"` - TimeSigned uint64 `dns:"uint48"` - Fudge uint16 - MACSize uint16 - MAC string `dns:"size-hex:MACSize"` - OrigId uint16 - Error uint16 - OtherLen uint16 - OtherData string `dns:"size-hex:OtherLen"` -} - -// TSIG has no official presentation format, but this will suffice. - -func (rr *TSIG) String() string { - s := "\n;; TSIG PSEUDOSECTION:\n; " // add another semi-colon to signify TSIG does not have a presentation format - s += rr.Hdr.String() + - " " + rr.Algorithm + - " " + tsigTimeToString(rr.TimeSigned) + - " " + strconv.Itoa(int(rr.Fudge)) + - " " + strconv.Itoa(int(rr.MACSize)) + - " " + strings.ToUpper(rr.MAC) + - " " + strconv.Itoa(int(rr.OrigId)) + - " " + strconv.Itoa(int(rr.Error)) + // BIND prints NOERROR - " " + strconv.Itoa(int(rr.OtherLen)) + - " " + rr.OtherData - return s -} - -func (rr *TSIG) parse(c *zlexer, origin string) *ParseError { - panic("dns: internal error: parse should never be called on TSIG") -} - -// The following values must be put in wireformat, so that the MAC can be calculated. -// RFC 2845, section 3.4.2. TSIG Variables. -type tsigWireFmt struct { - // From RR_Header - Name string `dns:"domain-name"` - Class uint16 - Ttl uint32 - // Rdata of the TSIG - Algorithm string `dns:"domain-name"` - TimeSigned uint64 `dns:"uint48"` - Fudge uint16 - // MACSize, MAC and OrigId excluded - Error uint16 - OtherLen uint16 - OtherData string `dns:"size-hex:OtherLen"` -} - -// If we have the MAC use this type to convert it to wiredata. Section 3.4.3. Request MAC -type macWireFmt struct { - MACSize uint16 - MAC string `dns:"size-hex:MACSize"` -} - -// 3.3. Time values used in TSIG calculations -type timerWireFmt struct { - TimeSigned uint64 `dns:"uint48"` - Fudge uint16 -} - -// TsigGenerate fills out the TSIG record attached to the message. -// The message should contain -// a "stub" TSIG RR with the algorithm, key name (owner name of the RR), -// time fudge (defaults to 300 seconds) and the current time -// The TSIG MAC is saved in that Tsig RR. -// When TsigGenerate is called for the first time requestMAC is set to the empty string and -// timersOnly is false. -// If something goes wrong an error is returned, otherwise it is nil. -func TsigGenerate(m *Msg, secret, requestMAC string, timersOnly bool) ([]byte, string, error) { - if m.IsTsig() == nil { - panic("dns: TSIG not last RR in additional") - } - // If we barf here, the caller is to blame - rawsecret, err := fromBase64([]byte(secret)) - if err != nil { - return nil, "", err - } - - rr := m.Extra[len(m.Extra)-1].(*TSIG) - m.Extra = m.Extra[0 : len(m.Extra)-1] // kill the TSIG from the msg - mbuf, err := m.Pack() - if err != nil { - return nil, "", err - } - buf, err := tsigBuffer(mbuf, rr, requestMAC, timersOnly) - if err != nil { - return nil, "", err - } - - t := new(TSIG) - var h hash.Hash - switch CanonicalName(rr.Algorithm) { - case HmacSHA1: - h = hmac.New(sha1.New, rawsecret) - case HmacSHA224: - h = hmac.New(sha256.New224, rawsecret) - case HmacSHA256: - h = hmac.New(sha256.New, rawsecret) - case HmacSHA384: - h = hmac.New(sha512.New384, rawsecret) - case HmacSHA512: - h = hmac.New(sha512.New, rawsecret) - default: - return nil, "", ErrKeyAlg - } - h.Write(buf) - // Copy all TSIG fields except MAC and its size, which are filled using the computed digest. - *t = *rr - t.MAC = hex.EncodeToString(h.Sum(nil)) - t.MACSize = uint16(len(t.MAC) / 2) // Size is half! - - tbuf := make([]byte, Len(t)) - off, err := PackRR(t, tbuf, 0, nil, false) - if err != nil { - return nil, "", err - } - mbuf = append(mbuf, tbuf[:off]...) - // Update the ArCount directly in the buffer. - binary.BigEndian.PutUint16(mbuf[10:], uint16(len(m.Extra)+1)) - - return mbuf, t.MAC, nil -} - -// TsigVerify verifies the TSIG on a message. -// If the signature does not validate err contains the -// error, otherwise it is nil. -func TsigVerify(msg []byte, secret, requestMAC string, timersOnly bool) error { - return tsigVerify(msg, secret, requestMAC, timersOnly, uint64(time.Now().Unix())) -} - -// actual implementation of TsigVerify, taking the current time ('now') as a parameter for the convenience of tests. -func tsigVerify(msg []byte, secret, requestMAC string, timersOnly bool, now uint64) error { - rawsecret, err := fromBase64([]byte(secret)) - if err != nil { - return err - } - // Strip the TSIG from the incoming msg - stripped, tsig, err := stripTsig(msg) - if err != nil { - return err - } - - msgMAC, err := hex.DecodeString(tsig.MAC) - if err != nil { - return err - } - - buf, err := tsigBuffer(stripped, tsig, requestMAC, timersOnly) - if err != nil { - return err - } - - var h hash.Hash - switch CanonicalName(tsig.Algorithm) { - case HmacSHA1: - h = hmac.New(sha1.New, rawsecret) - case HmacSHA224: - h = hmac.New(sha256.New224, rawsecret) - case HmacSHA256: - h = hmac.New(sha256.New, rawsecret) - case HmacSHA384: - h = hmac.New(sha512.New384, rawsecret) - case HmacSHA512: - h = hmac.New(sha512.New, rawsecret) - default: - return ErrKeyAlg - } - h.Write(buf) - if !hmac.Equal(h.Sum(nil), msgMAC) { - return ErrSig - } - - // Fudge factor works both ways. A message can arrive before it was signed because - // of clock skew. - // We check this after verifying the signature, following draft-ietf-dnsop-rfc2845bis - // instead of RFC2845, in order to prevent a security vulnerability as reported in CVE-2017-3142/3143. - ti := now - tsig.TimeSigned - if now < tsig.TimeSigned { - ti = tsig.TimeSigned - now - } - if uint64(tsig.Fudge) < ti { - return ErrTime - } - - return nil -} - -// Create a wiredata buffer for the MAC calculation. -func tsigBuffer(msgbuf []byte, rr *TSIG, requestMAC string, timersOnly bool) ([]byte, error) { - var buf []byte - if rr.TimeSigned == 0 { - rr.TimeSigned = uint64(time.Now().Unix()) - } - if rr.Fudge == 0 { - rr.Fudge = 300 // Standard (RFC) default. - } - - // Replace message ID in header with original ID from TSIG - binary.BigEndian.PutUint16(msgbuf[0:2], rr.OrigId) - - if requestMAC != "" { - m := new(macWireFmt) - m.MACSize = uint16(len(requestMAC) / 2) - m.MAC = requestMAC - buf = make([]byte, len(requestMAC)) // long enough - n, err := packMacWire(m, buf) - if err != nil { - return nil, err - } - buf = buf[:n] - } - - tsigvar := make([]byte, DefaultMsgSize) - if timersOnly { - tsig := new(timerWireFmt) - tsig.TimeSigned = rr.TimeSigned - tsig.Fudge = rr.Fudge - n, err := packTimerWire(tsig, tsigvar) - if err != nil { - return nil, err - } - tsigvar = tsigvar[:n] - } else { - tsig := new(tsigWireFmt) - tsig.Name = CanonicalName(rr.Hdr.Name) - tsig.Class = ClassANY - tsig.Ttl = rr.Hdr.Ttl - tsig.Algorithm = CanonicalName(rr.Algorithm) - tsig.TimeSigned = rr.TimeSigned - tsig.Fudge = rr.Fudge - tsig.Error = rr.Error - tsig.OtherLen = rr.OtherLen - tsig.OtherData = rr.OtherData - n, err := packTsigWire(tsig, tsigvar) - if err != nil { - return nil, err - } - tsigvar = tsigvar[:n] - } - - if requestMAC != "" { - x := append(buf, msgbuf...) - buf = append(x, tsigvar...) - } else { - buf = append(msgbuf, tsigvar...) - } - return buf, nil -} - -// Strip the TSIG from the raw message. -func stripTsig(msg []byte) ([]byte, *TSIG, error) { - // Copied from msg.go's Unpack() Header, but modified. - var ( - dh Header - err error - ) - off, tsigoff := 0, 0 - - if dh, off, err = unpackMsgHdr(msg, off); err != nil { - return nil, nil, err - } - if dh.Arcount == 0 { - return nil, nil, ErrNoSig - } - - // Rcode, see msg.go Unpack() - if int(dh.Bits&0xF) == RcodeNotAuth { - return nil, nil, ErrAuth - } - - for i := 0; i < int(dh.Qdcount); i++ { - _, off, err = unpackQuestion(msg, off) - if err != nil { - return nil, nil, err - } - } - - _, off, err = unpackRRslice(int(dh.Ancount), msg, off) - if err != nil { - return nil, nil, err - } - _, off, err = unpackRRslice(int(dh.Nscount), msg, off) - if err != nil { - return nil, nil, err - } - - rr := new(TSIG) - var extra RR - for i := 0; i < int(dh.Arcount); i++ { - tsigoff = off - extra, off, err = UnpackRR(msg, off) - if err != nil { - return nil, nil, err - } - if extra.Header().Rrtype == TypeTSIG { - rr = extra.(*TSIG) - // Adjust Arcount. - arcount := binary.BigEndian.Uint16(msg[10:]) - binary.BigEndian.PutUint16(msg[10:], arcount-1) - break - } - } - if rr == nil { - return nil, nil, ErrNoSig - } - return msg[:tsigoff], rr, nil -} - -// Translate the TSIG time signed into a date. There is no -// need for RFC1982 calculations as this date is 48 bits. -func tsigTimeToString(t uint64) string { - ti := time.Unix(int64(t), 0).UTC() - return ti.Format("20060102150405") -} - -func packTsigWire(tw *tsigWireFmt, msg []byte) (int, error) { - // copied from zmsg.go TSIG packing - // RR_Header - off, err := PackDomainName(tw.Name, msg, 0, nil, false) - if err != nil { - return off, err - } - off, err = packUint16(tw.Class, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(tw.Ttl, msg, off) - if err != nil { - return off, err - } - - off, err = PackDomainName(tw.Algorithm, msg, off, nil, false) - if err != nil { - return off, err - } - off, err = packUint48(tw.TimeSigned, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(tw.Fudge, msg, off) - if err != nil { - return off, err - } - - off, err = packUint16(tw.Error, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(tw.OtherLen, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(tw.OtherData, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func packMacWire(mw *macWireFmt, msg []byte) (int, error) { - off, err := packUint16(mw.MACSize, msg, 0) - if err != nil { - return off, err - } - off, err = packStringHex(mw.MAC, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func packTimerWire(tw *timerWireFmt, msg []byte) (int, error) { - off, err := packUint48(tw.TimeSigned, msg, 0) - if err != nil { - return off, err - } - off, err = packUint16(tw.Fudge, msg, off) - if err != nil { - return off, err - } - return off, nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/types.go b/cluster-autoscaler/vendor/github.com/miekg/dns/types.go deleted file mode 100644 index 1f385bd229bf..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/types.go +++ /dev/null @@ -1,1533 +0,0 @@ -package dns - -import ( - "bytes" - "fmt" - "net" - "strconv" - "strings" - "time" -) - -type ( - // Type is a DNS type. - Type uint16 - // Class is a DNS class. - Class uint16 - // Name is a DNS domain name. - Name string -) - -// Packet formats - -// Wire constants and supported types. -const ( - // valid RR_Header.Rrtype and Question.qtype - - TypeNone uint16 = 0 - TypeA uint16 = 1 - TypeNS uint16 = 2 - TypeMD uint16 = 3 - TypeMF uint16 = 4 - TypeCNAME uint16 = 5 - TypeSOA uint16 = 6 - TypeMB uint16 = 7 - TypeMG uint16 = 8 - TypeMR uint16 = 9 - TypeNULL uint16 = 10 - TypePTR uint16 = 12 - TypeHINFO uint16 = 13 - TypeMINFO uint16 = 14 - TypeMX uint16 = 15 - TypeTXT uint16 = 16 - TypeRP uint16 = 17 - TypeAFSDB uint16 = 18 - TypeX25 uint16 = 19 - TypeISDN uint16 = 20 - TypeRT uint16 = 21 - TypeNSAPPTR uint16 = 23 - TypeSIG uint16 = 24 - TypeKEY uint16 = 25 - TypePX uint16 = 26 - TypeGPOS uint16 = 27 - TypeAAAA uint16 = 28 - TypeLOC uint16 = 29 - TypeNXT uint16 = 30 - TypeEID uint16 = 31 - TypeNIMLOC uint16 = 32 - TypeSRV uint16 = 33 - TypeATMA uint16 = 34 - TypeNAPTR uint16 = 35 - TypeKX uint16 = 36 - TypeCERT uint16 = 37 - TypeDNAME uint16 = 39 - TypeOPT uint16 = 41 // EDNS - TypeAPL uint16 = 42 - TypeDS uint16 = 43 - TypeSSHFP uint16 = 44 - TypeRRSIG uint16 = 46 - TypeNSEC uint16 = 47 - TypeDNSKEY uint16 = 48 - TypeDHCID uint16 = 49 - TypeNSEC3 uint16 = 50 - TypeNSEC3PARAM uint16 = 51 - TypeTLSA uint16 = 52 - TypeSMIMEA uint16 = 53 - TypeHIP uint16 = 55 - TypeNINFO uint16 = 56 - TypeRKEY uint16 = 57 - TypeTALINK uint16 = 58 - TypeCDS uint16 = 59 - TypeCDNSKEY uint16 = 60 - TypeOPENPGPKEY uint16 = 61 - TypeCSYNC uint16 = 62 - TypeSVCB uint16 = 64 - TypeHTTPS uint16 = 65 - TypeSPF uint16 = 99 - TypeUINFO uint16 = 100 - TypeUID uint16 = 101 - TypeGID uint16 = 102 - TypeUNSPEC uint16 = 103 - TypeNID uint16 = 104 - TypeL32 uint16 = 105 - TypeL64 uint16 = 106 - TypeLP uint16 = 107 - TypeEUI48 uint16 = 108 - TypeEUI64 uint16 = 109 - TypeURI uint16 = 256 - TypeCAA uint16 = 257 - TypeAVC uint16 = 258 - - TypeTKEY uint16 = 249 - TypeTSIG uint16 = 250 - - // valid Question.Qtype only - TypeIXFR uint16 = 251 - TypeAXFR uint16 = 252 - TypeMAILB uint16 = 253 - TypeMAILA uint16 = 254 - TypeANY uint16 = 255 - - TypeTA uint16 = 32768 - TypeDLV uint16 = 32769 - TypeReserved uint16 = 65535 - - // valid Question.Qclass - ClassINET = 1 - ClassCSNET = 2 - ClassCHAOS = 3 - ClassHESIOD = 4 - ClassNONE = 254 - ClassANY = 255 - - // Message Response Codes, see https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml - RcodeSuccess = 0 // NoError - No Error [DNS] - RcodeFormatError = 1 // FormErr - Format Error [DNS] - RcodeServerFailure = 2 // ServFail - Server Failure [DNS] - RcodeNameError = 3 // NXDomain - Non-Existent Domain [DNS] - RcodeNotImplemented = 4 // NotImp - Not Implemented [DNS] - RcodeRefused = 5 // Refused - Query Refused [DNS] - RcodeYXDomain = 6 // YXDomain - Name Exists when it should not [DNS Update] - RcodeYXRrset = 7 // YXRRSet - RR Set Exists when it should not [DNS Update] - RcodeNXRrset = 8 // NXRRSet - RR Set that should exist does not [DNS Update] - RcodeNotAuth = 9 // NotAuth - Server Not Authoritative for zone [DNS Update] - RcodeNotZone = 10 // NotZone - Name not contained in zone [DNS Update/TSIG] - RcodeBadSig = 16 // BADSIG - TSIG Signature Failure [TSIG] - RcodeBadVers = 16 // BADVERS - Bad OPT Version [EDNS0] - RcodeBadKey = 17 // BADKEY - Key not recognized [TSIG] - RcodeBadTime = 18 // BADTIME - Signature out of time window [TSIG] - RcodeBadMode = 19 // BADMODE - Bad TKEY Mode [TKEY] - RcodeBadName = 20 // BADNAME - Duplicate key name [TKEY] - RcodeBadAlg = 21 // BADALG - Algorithm not supported [TKEY] - RcodeBadTrunc = 22 // BADTRUNC - Bad Truncation [TSIG] - RcodeBadCookie = 23 // BADCOOKIE - Bad/missing Server Cookie [DNS Cookies] - - // Message Opcodes. There is no 3. - OpcodeQuery = 0 - OpcodeIQuery = 1 - OpcodeStatus = 2 - OpcodeNotify = 4 - OpcodeUpdate = 5 -) - -// Header is the wire format for the DNS packet header. -type Header struct { - Id uint16 - Bits uint16 - Qdcount, Ancount, Nscount, Arcount uint16 -} - -const ( - headerSize = 12 - - // Header.Bits - _QR = 1 << 15 // query/response (response=1) - _AA = 1 << 10 // authoritative - _TC = 1 << 9 // truncated - _RD = 1 << 8 // recursion desired - _RA = 1 << 7 // recursion available - _Z = 1 << 6 // Z - _AD = 1 << 5 // authenticated data - _CD = 1 << 4 // checking disabled -) - -// Various constants used in the LOC RR. See RFC 1887. -const ( - LOC_EQUATOR = 1 << 31 // RFC 1876, Section 2. - LOC_PRIMEMERIDIAN = 1 << 31 // RFC 1876, Section 2. - LOC_HOURS = 60 * 1000 - LOC_DEGREES = 60 * LOC_HOURS - LOC_ALTITUDEBASE = 100000 -) - -// Different Certificate Types, see RFC 4398, Section 2.1 -const ( - CertPKIX = 1 + iota - CertSPKI - CertPGP - CertIPIX - CertISPKI - CertIPGP - CertACPKIX - CertIACPKIX - CertURI = 253 - CertOID = 254 -) - -// CertTypeToString converts the Cert Type to its string representation. -// See RFC 4398 and RFC 6944. -var CertTypeToString = map[uint16]string{ - CertPKIX: "PKIX", - CertSPKI: "SPKI", - CertPGP: "PGP", - CertIPIX: "IPIX", - CertISPKI: "ISPKI", - CertIPGP: "IPGP", - CertACPKIX: "ACPKIX", - CertIACPKIX: "IACPKIX", - CertURI: "URI", - CertOID: "OID", -} - -//go:generate go run types_generate.go - -// Question holds a DNS question. Usually there is just one. While the -// original DNS RFCs allow multiple questions in the question section of a -// message, in practice it never works. Because most DNS servers see multiple -// questions as an error, it is recommended to only have one question per -// message. -type Question struct { - Name string `dns:"cdomain-name"` // "cdomain-name" specifies encoding (and may be compressed) - Qtype uint16 - Qclass uint16 -} - -func (q *Question) len(off int, compression map[string]struct{}) int { - l := domainNameLen(q.Name, off, compression, true) - l += 2 + 2 - return l -} - -func (q *Question) String() (s string) { - // prefix with ; (as in dig) - s = ";" + sprintName(q.Name) + "\t" - s += Class(q.Qclass).String() + "\t" - s += " " + Type(q.Qtype).String() - return s -} - -// ANY is a wild card record. See RFC 1035, Section 3.2.3. ANY -// is named "*" there. -type ANY struct { - Hdr RR_Header - // Does not have any rdata -} - -func (rr *ANY) String() string { return rr.Hdr.String() } - -func (rr *ANY) parse(c *zlexer, origin string) *ParseError { - panic("dns: internal error: parse should never be called on ANY") -} - -// NULL RR. See RFC 1035. -type NULL struct { - Hdr RR_Header - Data string `dns:"any"` -} - -func (rr *NULL) String() string { - // There is no presentation format; prefix string with a comment. - return ";" + rr.Hdr.String() + rr.Data -} - -func (rr *NULL) parse(c *zlexer, origin string) *ParseError { - panic("dns: internal error: parse should never be called on NULL") -} - -// CNAME RR. See RFC 1034. -type CNAME struct { - Hdr RR_Header - Target string `dns:"cdomain-name"` -} - -func (rr *CNAME) String() string { return rr.Hdr.String() + sprintName(rr.Target) } - -// HINFO RR. See RFC 1034. -type HINFO struct { - Hdr RR_Header - Cpu string - Os string -} - -func (rr *HINFO) String() string { - return rr.Hdr.String() + sprintTxt([]string{rr.Cpu, rr.Os}) -} - -// MB RR. See RFC 1035. -type MB struct { - Hdr RR_Header - Mb string `dns:"cdomain-name"` -} - -func (rr *MB) String() string { return rr.Hdr.String() + sprintName(rr.Mb) } - -// MG RR. See RFC 1035. -type MG struct { - Hdr RR_Header - Mg string `dns:"cdomain-name"` -} - -func (rr *MG) String() string { return rr.Hdr.String() + sprintName(rr.Mg) } - -// MINFO RR. See RFC 1035. -type MINFO struct { - Hdr RR_Header - Rmail string `dns:"cdomain-name"` - Email string `dns:"cdomain-name"` -} - -func (rr *MINFO) String() string { - return rr.Hdr.String() + sprintName(rr.Rmail) + " " + sprintName(rr.Email) -} - -// MR RR. See RFC 1035. -type MR struct { - Hdr RR_Header - Mr string `dns:"cdomain-name"` -} - -func (rr *MR) String() string { - return rr.Hdr.String() + sprintName(rr.Mr) -} - -// MF RR. See RFC 1035. -type MF struct { - Hdr RR_Header - Mf string `dns:"cdomain-name"` -} - -func (rr *MF) String() string { - return rr.Hdr.String() + sprintName(rr.Mf) -} - -// MD RR. See RFC 1035. -type MD struct { - Hdr RR_Header - Md string `dns:"cdomain-name"` -} - -func (rr *MD) String() string { - return rr.Hdr.String() + sprintName(rr.Md) -} - -// MX RR. See RFC 1035. -type MX struct { - Hdr RR_Header - Preference uint16 - Mx string `dns:"cdomain-name"` -} - -func (rr *MX) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Mx) -} - -// AFSDB RR. See RFC 1183. -type AFSDB struct { - Hdr RR_Header - Subtype uint16 - Hostname string `dns:"domain-name"` -} - -func (rr *AFSDB) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Subtype)) + " " + sprintName(rr.Hostname) -} - -// X25 RR. See RFC 1183, Section 3.1. -type X25 struct { - Hdr RR_Header - PSDNAddress string -} - -func (rr *X25) String() string { - return rr.Hdr.String() + rr.PSDNAddress -} - -// RT RR. See RFC 1183, Section 3.3. -type RT struct { - Hdr RR_Header - Preference uint16 - Host string `dns:"domain-name"` // RFC 3597 prohibits compressing records not defined in RFC 1035. -} - -func (rr *RT) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Host) -} - -// NS RR. See RFC 1035. -type NS struct { - Hdr RR_Header - Ns string `dns:"cdomain-name"` -} - -func (rr *NS) String() string { - return rr.Hdr.String() + sprintName(rr.Ns) -} - -// PTR RR. See RFC 1035. -type PTR struct { - Hdr RR_Header - Ptr string `dns:"cdomain-name"` -} - -func (rr *PTR) String() string { - return rr.Hdr.String() + sprintName(rr.Ptr) -} - -// RP RR. See RFC 1138, Section 2.2. -type RP struct { - Hdr RR_Header - Mbox string `dns:"domain-name"` - Txt string `dns:"domain-name"` -} - -func (rr *RP) String() string { - return rr.Hdr.String() + sprintName(rr.Mbox) + " " + sprintName(rr.Txt) -} - -// SOA RR. See RFC 1035. -type SOA struct { - Hdr RR_Header - Ns string `dns:"cdomain-name"` - Mbox string `dns:"cdomain-name"` - Serial uint32 - Refresh uint32 - Retry uint32 - Expire uint32 - Minttl uint32 -} - -func (rr *SOA) String() string { - return rr.Hdr.String() + sprintName(rr.Ns) + " " + sprintName(rr.Mbox) + - " " + strconv.FormatInt(int64(rr.Serial), 10) + - " " + strconv.FormatInt(int64(rr.Refresh), 10) + - " " + strconv.FormatInt(int64(rr.Retry), 10) + - " " + strconv.FormatInt(int64(rr.Expire), 10) + - " " + strconv.FormatInt(int64(rr.Minttl), 10) -} - -// TXT RR. See RFC 1035. -type TXT struct { - Hdr RR_Header - Txt []string `dns:"txt"` -} - -func (rr *TXT) String() string { return rr.Hdr.String() + sprintTxt(rr.Txt) } - -func sprintName(s string) string { - var dst strings.Builder - - for i := 0; i < len(s); { - if s[i] == '.' { - if dst.Len() != 0 { - dst.WriteByte('.') - } - i++ - continue - } - - b, n := nextByte(s, i) - if n == 0 { - // Drop "dangling" incomplete escapes. - if dst.Len() == 0 { - return s[:i] - } - break - } - if isDomainNameLabelSpecial(b) { - if dst.Len() == 0 { - dst.Grow(len(s) * 2) - dst.WriteString(s[:i]) - } - dst.WriteByte('\\') - dst.WriteByte(b) - } else if b < ' ' || b > '~' { // unprintable, use \DDD - if dst.Len() == 0 { - dst.Grow(len(s) * 2) - dst.WriteString(s[:i]) - } - dst.WriteString(escapeByte(b)) - } else { - if dst.Len() != 0 { - dst.WriteByte(b) - } - } - i += n - } - if dst.Len() == 0 { - return s - } - return dst.String() -} - -func sprintTxtOctet(s string) string { - var dst strings.Builder - dst.Grow(2 + len(s)) - dst.WriteByte('"') - for i := 0; i < len(s); { - if i+1 < len(s) && s[i] == '\\' && s[i+1] == '.' { - dst.WriteString(s[i : i+2]) - i += 2 - continue - } - - b, n := nextByte(s, i) - if n == 0 { - i++ // dangling back slash - } else { - writeTXTStringByte(&dst, b) - } - i += n - } - dst.WriteByte('"') - return dst.String() -} - -func sprintTxt(txt []string) string { - var out strings.Builder - for i, s := range txt { - out.Grow(3 + len(s)) - if i > 0 { - out.WriteString(` "`) - } else { - out.WriteByte('"') - } - for j := 0; j < len(s); { - b, n := nextByte(s, j) - if n == 0 { - break - } - writeTXTStringByte(&out, b) - j += n - } - out.WriteByte('"') - } - return out.String() -} - -func writeTXTStringByte(s *strings.Builder, b byte) { - switch { - case b == '"' || b == '\\': - s.WriteByte('\\') - s.WriteByte(b) - case b < ' ' || b > '~': - s.WriteString(escapeByte(b)) - default: - s.WriteByte(b) - } -} - -const ( - escapedByteSmall = "" + - `\000\001\002\003\004\005\006\007\008\009` + - `\010\011\012\013\014\015\016\017\018\019` + - `\020\021\022\023\024\025\026\027\028\029` + - `\030\031` - escapedByteLarge = `\127\128\129` + - `\130\131\132\133\134\135\136\137\138\139` + - `\140\141\142\143\144\145\146\147\148\149` + - `\150\151\152\153\154\155\156\157\158\159` + - `\160\161\162\163\164\165\166\167\168\169` + - `\170\171\172\173\174\175\176\177\178\179` + - `\180\181\182\183\184\185\186\187\188\189` + - `\190\191\192\193\194\195\196\197\198\199` + - `\200\201\202\203\204\205\206\207\208\209` + - `\210\211\212\213\214\215\216\217\218\219` + - `\220\221\222\223\224\225\226\227\228\229` + - `\230\231\232\233\234\235\236\237\238\239` + - `\240\241\242\243\244\245\246\247\248\249` + - `\250\251\252\253\254\255` -) - -// escapeByte returns the \DDD escaping of b which must -// satisfy b < ' ' || b > '~'. -func escapeByte(b byte) string { - if b < ' ' { - return escapedByteSmall[b*4 : b*4+4] - } - - b -= '~' + 1 - // The cast here is needed as b*4 may overflow byte. - return escapedByteLarge[int(b)*4 : int(b)*4+4] -} - -// isDomainNameLabelSpecial returns true if -// a domain name label byte should be prefixed -// with an escaping backslash. -func isDomainNameLabelSpecial(b byte) bool { - switch b { - case '.', ' ', '\'', '@', ';', '(', ')', '"', '\\': - return true - } - return false -} - -func nextByte(s string, offset int) (byte, int) { - if offset >= len(s) { - return 0, 0 - } - if s[offset] != '\\' { - // not an escape sequence - return s[offset], 1 - } - switch len(s) - offset { - case 1: // dangling escape - return 0, 0 - case 2, 3: // too short to be \ddd - default: // maybe \ddd - if isDigit(s[offset+1]) && isDigit(s[offset+2]) && isDigit(s[offset+3]) { - return dddStringToByte(s[offset+1:]), 4 - } - } - // not \ddd, just an RFC 1035 "quoted" character - return s[offset+1], 2 -} - -// SPF RR. See RFC 4408, Section 3.1.1. -type SPF struct { - Hdr RR_Header - Txt []string `dns:"txt"` -} - -func (rr *SPF) String() string { return rr.Hdr.String() + sprintTxt(rr.Txt) } - -// AVC RR. See https://www.iana.org/assignments/dns-parameters/AVC/avc-completed-template. -type AVC struct { - Hdr RR_Header - Txt []string `dns:"txt"` -} - -func (rr *AVC) String() string { return rr.Hdr.String() + sprintTxt(rr.Txt) } - -// SRV RR. See RFC 2782. -type SRV struct { - Hdr RR_Header - Priority uint16 - Weight uint16 - Port uint16 - Target string `dns:"domain-name"` -} - -func (rr *SRV) String() string { - return rr.Hdr.String() + - strconv.Itoa(int(rr.Priority)) + " " + - strconv.Itoa(int(rr.Weight)) + " " + - strconv.Itoa(int(rr.Port)) + " " + sprintName(rr.Target) -} - -// NAPTR RR. See RFC 2915. -type NAPTR struct { - Hdr RR_Header - Order uint16 - Preference uint16 - Flags string - Service string - Regexp string - Replacement string `dns:"domain-name"` -} - -func (rr *NAPTR) String() string { - return rr.Hdr.String() + - strconv.Itoa(int(rr.Order)) + " " + - strconv.Itoa(int(rr.Preference)) + " " + - "\"" + rr.Flags + "\" " + - "\"" + rr.Service + "\" " + - "\"" + rr.Regexp + "\" " + - rr.Replacement -} - -// CERT RR. See RFC 4398. -type CERT struct { - Hdr RR_Header - Type uint16 - KeyTag uint16 - Algorithm uint8 - Certificate string `dns:"base64"` -} - -func (rr *CERT) String() string { - var ( - ok bool - certtype, algorithm string - ) - if certtype, ok = CertTypeToString[rr.Type]; !ok { - certtype = strconv.Itoa(int(rr.Type)) - } - if algorithm, ok = AlgorithmToString[rr.Algorithm]; !ok { - algorithm = strconv.Itoa(int(rr.Algorithm)) - } - return rr.Hdr.String() + certtype + - " " + strconv.Itoa(int(rr.KeyTag)) + - " " + algorithm + - " " + rr.Certificate -} - -// DNAME RR. See RFC 2672. -type DNAME struct { - Hdr RR_Header - Target string `dns:"domain-name"` -} - -func (rr *DNAME) String() string { - return rr.Hdr.String() + sprintName(rr.Target) -} - -// A RR. See RFC 1035. -type A struct { - Hdr RR_Header - A net.IP `dns:"a"` -} - -func (rr *A) String() string { - if rr.A == nil { - return rr.Hdr.String() - } - return rr.Hdr.String() + rr.A.String() -} - -// AAAA RR. See RFC 3596. -type AAAA struct { - Hdr RR_Header - AAAA net.IP `dns:"aaaa"` -} - -func (rr *AAAA) String() string { - if rr.AAAA == nil { - return rr.Hdr.String() - } - return rr.Hdr.String() + rr.AAAA.String() -} - -// PX RR. See RFC 2163. -type PX struct { - Hdr RR_Header - Preference uint16 - Map822 string `dns:"domain-name"` - Mapx400 string `dns:"domain-name"` -} - -func (rr *PX) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Map822) + " " + sprintName(rr.Mapx400) -} - -// GPOS RR. See RFC 1712. -type GPOS struct { - Hdr RR_Header - Longitude string - Latitude string - Altitude string -} - -func (rr *GPOS) String() string { - return rr.Hdr.String() + rr.Longitude + " " + rr.Latitude + " " + rr.Altitude -} - -// LOC RR. See RFC RFC 1876. -type LOC struct { - Hdr RR_Header - Version uint8 - Size uint8 - HorizPre uint8 - VertPre uint8 - Latitude uint32 - Longitude uint32 - Altitude uint32 -} - -// cmToM takes a cm value expressed in RFC 1876 SIZE mantissa/exponent -// format and returns a string in m (two decimals for the cm). -func cmToM(m, e uint8) string { - if e < 2 { - if e == 1 { - m *= 10 - } - - return fmt.Sprintf("0.%02d", m) - } - - s := fmt.Sprintf("%d", m) - for e > 2 { - s += "0" - e-- - } - return s -} - -func (rr *LOC) String() string { - s := rr.Hdr.String() - - lat := rr.Latitude - ns := "N" - if lat > LOC_EQUATOR { - lat = lat - LOC_EQUATOR - } else { - ns = "S" - lat = LOC_EQUATOR - lat - } - h := lat / LOC_DEGREES - lat = lat % LOC_DEGREES - m := lat / LOC_HOURS - lat = lat % LOC_HOURS - s += fmt.Sprintf("%02d %02d %0.3f %s ", h, m, float64(lat)/1000, ns) - - lon := rr.Longitude - ew := "E" - if lon > LOC_PRIMEMERIDIAN { - lon = lon - LOC_PRIMEMERIDIAN - } else { - ew = "W" - lon = LOC_PRIMEMERIDIAN - lon - } - h = lon / LOC_DEGREES - lon = lon % LOC_DEGREES - m = lon / LOC_HOURS - lon = lon % LOC_HOURS - s += fmt.Sprintf("%02d %02d %0.3f %s ", h, m, float64(lon)/1000, ew) - - var alt = float64(rr.Altitude) / 100 - alt -= LOC_ALTITUDEBASE - if rr.Altitude%100 != 0 { - s += fmt.Sprintf("%.2fm ", alt) - } else { - s += fmt.Sprintf("%.0fm ", alt) - } - - s += cmToM(rr.Size&0xf0>>4, rr.Size&0x0f) + "m " - s += cmToM(rr.HorizPre&0xf0>>4, rr.HorizPre&0x0f) + "m " - s += cmToM(rr.VertPre&0xf0>>4, rr.VertPre&0x0f) + "m" - - return s -} - -// SIG RR. See RFC 2535. The SIG RR is identical to RRSIG and nowadays only used for SIG(0), See RFC 2931. -type SIG struct { - RRSIG -} - -// RRSIG RR. See RFC 4034 and RFC 3755. -type RRSIG struct { - Hdr RR_Header - TypeCovered uint16 - Algorithm uint8 - Labels uint8 - OrigTtl uint32 - Expiration uint32 - Inception uint32 - KeyTag uint16 - SignerName string `dns:"domain-name"` - Signature string `dns:"base64"` -} - -func (rr *RRSIG) String() string { - s := rr.Hdr.String() - s += Type(rr.TypeCovered).String() - s += " " + strconv.Itoa(int(rr.Algorithm)) + - " " + strconv.Itoa(int(rr.Labels)) + - " " + strconv.FormatInt(int64(rr.OrigTtl), 10) + - " " + TimeToString(rr.Expiration) + - " " + TimeToString(rr.Inception) + - " " + strconv.Itoa(int(rr.KeyTag)) + - " " + sprintName(rr.SignerName) + - " " + rr.Signature - return s -} - -// NSEC RR. See RFC 4034 and RFC 3755. -type NSEC struct { - Hdr RR_Header - NextDomain string `dns:"domain-name"` - TypeBitMap []uint16 `dns:"nsec"` -} - -func (rr *NSEC) String() string { - s := rr.Hdr.String() + sprintName(rr.NextDomain) - for _, t := range rr.TypeBitMap { - s += " " + Type(t).String() - } - return s -} - -func (rr *NSEC) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.NextDomain, off+l, compression, false) - l += typeBitMapLen(rr.TypeBitMap) - return l -} - -// DLV RR. See RFC 4431. -type DLV struct{ DS } - -// CDS RR. See RFC 7344. -type CDS struct{ DS } - -// DS RR. See RFC 4034 and RFC 3658. -type DS struct { - Hdr RR_Header - KeyTag uint16 - Algorithm uint8 - DigestType uint8 - Digest string `dns:"hex"` -} - -func (rr *DS) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.KeyTag)) + - " " + strconv.Itoa(int(rr.Algorithm)) + - " " + strconv.Itoa(int(rr.DigestType)) + - " " + strings.ToUpper(rr.Digest) -} - -// KX RR. See RFC 2230. -type KX struct { - Hdr RR_Header - Preference uint16 - Exchanger string `dns:"domain-name"` -} - -func (rr *KX) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + - " " + sprintName(rr.Exchanger) -} - -// TA RR. See http://www.watson.org/~weiler/INI1999-19.pdf. -type TA struct { - Hdr RR_Header - KeyTag uint16 - Algorithm uint8 - DigestType uint8 - Digest string `dns:"hex"` -} - -func (rr *TA) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.KeyTag)) + - " " + strconv.Itoa(int(rr.Algorithm)) + - " " + strconv.Itoa(int(rr.DigestType)) + - " " + strings.ToUpper(rr.Digest) -} - -// TALINK RR. See https://www.iana.org/assignments/dns-parameters/TALINK/talink-completed-template. -type TALINK struct { - Hdr RR_Header - PreviousName string `dns:"domain-name"` - NextName string `dns:"domain-name"` -} - -func (rr *TALINK) String() string { - return rr.Hdr.String() + - sprintName(rr.PreviousName) + " " + sprintName(rr.NextName) -} - -// SSHFP RR. See RFC RFC 4255. -type SSHFP struct { - Hdr RR_Header - Algorithm uint8 - Type uint8 - FingerPrint string `dns:"hex"` -} - -func (rr *SSHFP) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Algorithm)) + - " " + strconv.Itoa(int(rr.Type)) + - " " + strings.ToUpper(rr.FingerPrint) -} - -// KEY RR. See RFC RFC 2535. -type KEY struct { - DNSKEY -} - -// CDNSKEY RR. See RFC 7344. -type CDNSKEY struct { - DNSKEY -} - -// DNSKEY RR. See RFC 4034 and RFC 3755. -type DNSKEY struct { - Hdr RR_Header - Flags uint16 - Protocol uint8 - Algorithm uint8 - PublicKey string `dns:"base64"` -} - -func (rr *DNSKEY) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Flags)) + - " " + strconv.Itoa(int(rr.Protocol)) + - " " + strconv.Itoa(int(rr.Algorithm)) + - " " + rr.PublicKey -} - -// RKEY RR. See https://www.iana.org/assignments/dns-parameters/RKEY/rkey-completed-template. -type RKEY struct { - Hdr RR_Header - Flags uint16 - Protocol uint8 - Algorithm uint8 - PublicKey string `dns:"base64"` -} - -func (rr *RKEY) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Flags)) + - " " + strconv.Itoa(int(rr.Protocol)) + - " " + strconv.Itoa(int(rr.Algorithm)) + - " " + rr.PublicKey -} - -// NSAPPTR RR. See RFC 1348. -type NSAPPTR struct { - Hdr RR_Header - Ptr string `dns:"domain-name"` -} - -func (rr *NSAPPTR) String() string { return rr.Hdr.String() + sprintName(rr.Ptr) } - -// NSEC3 RR. See RFC 5155. -type NSEC3 struct { - Hdr RR_Header - Hash uint8 - Flags uint8 - Iterations uint16 - SaltLength uint8 - Salt string `dns:"size-hex:SaltLength"` - HashLength uint8 - NextDomain string `dns:"size-base32:HashLength"` - TypeBitMap []uint16 `dns:"nsec"` -} - -func (rr *NSEC3) String() string { - s := rr.Hdr.String() - s += strconv.Itoa(int(rr.Hash)) + - " " + strconv.Itoa(int(rr.Flags)) + - " " + strconv.Itoa(int(rr.Iterations)) + - " " + saltToString(rr.Salt) + - " " + rr.NextDomain - for _, t := range rr.TypeBitMap { - s += " " + Type(t).String() - } - return s -} - -func (rr *NSEC3) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 6 + len(rr.Salt)/2 + 1 + len(rr.NextDomain) + 1 - l += typeBitMapLen(rr.TypeBitMap) - return l -} - -// NSEC3PARAM RR. See RFC 5155. -type NSEC3PARAM struct { - Hdr RR_Header - Hash uint8 - Flags uint8 - Iterations uint16 - SaltLength uint8 - Salt string `dns:"size-hex:SaltLength"` -} - -func (rr *NSEC3PARAM) String() string { - s := rr.Hdr.String() - s += strconv.Itoa(int(rr.Hash)) + - " " + strconv.Itoa(int(rr.Flags)) + - " " + strconv.Itoa(int(rr.Iterations)) + - " " + saltToString(rr.Salt) - return s -} - -// TKEY RR. See RFC 2930. -type TKEY struct { - Hdr RR_Header - Algorithm string `dns:"domain-name"` - Inception uint32 - Expiration uint32 - Mode uint16 - Error uint16 - KeySize uint16 - Key string `dns:"size-hex:KeySize"` - OtherLen uint16 - OtherData string `dns:"size-hex:OtherLen"` -} - -// TKEY has no official presentation format, but this will suffice. -func (rr *TKEY) String() string { - s := ";" + rr.Hdr.String() + - " " + rr.Algorithm + - " " + TimeToString(rr.Inception) + - " " + TimeToString(rr.Expiration) + - " " + strconv.Itoa(int(rr.Mode)) + - " " + strconv.Itoa(int(rr.Error)) + - " " + strconv.Itoa(int(rr.KeySize)) + - " " + rr.Key + - " " + strconv.Itoa(int(rr.OtherLen)) + - " " + rr.OtherData - return s -} - -// RFC3597 represents an unknown/generic RR. See RFC 3597. -type RFC3597 struct { - Hdr RR_Header - Rdata string `dns:"hex"` -} - -func (rr *RFC3597) String() string { - // Let's call it a hack - s := rfc3597Header(rr.Hdr) - - s += "\\# " + strconv.Itoa(len(rr.Rdata)/2) + " " + rr.Rdata - return s -} - -func rfc3597Header(h RR_Header) string { - var s string - - s += sprintName(h.Name) + "\t" - s += strconv.FormatInt(int64(h.Ttl), 10) + "\t" - s += "CLASS" + strconv.Itoa(int(h.Class)) + "\t" - s += "TYPE" + strconv.Itoa(int(h.Rrtype)) + "\t" - return s -} - -// URI RR. See RFC 7553. -type URI struct { - Hdr RR_Header - Priority uint16 - Weight uint16 - Target string `dns:"octet"` -} - -// rr.Target to be parsed as a sequence of character encoded octets according to RFC 3986 -func (rr *URI) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Priority)) + - " " + strconv.Itoa(int(rr.Weight)) + " " + sprintTxtOctet(rr.Target) -} - -// DHCID RR. See RFC 4701. -type DHCID struct { - Hdr RR_Header - Digest string `dns:"base64"` -} - -func (rr *DHCID) String() string { return rr.Hdr.String() + rr.Digest } - -// TLSA RR. See RFC 6698. -type TLSA struct { - Hdr RR_Header - Usage uint8 - Selector uint8 - MatchingType uint8 - Certificate string `dns:"hex"` -} - -func (rr *TLSA) String() string { - return rr.Hdr.String() + - strconv.Itoa(int(rr.Usage)) + - " " + strconv.Itoa(int(rr.Selector)) + - " " + strconv.Itoa(int(rr.MatchingType)) + - " " + rr.Certificate -} - -// SMIMEA RR. See RFC 8162. -type SMIMEA struct { - Hdr RR_Header - Usage uint8 - Selector uint8 - MatchingType uint8 - Certificate string `dns:"hex"` -} - -func (rr *SMIMEA) String() string { - s := rr.Hdr.String() + - strconv.Itoa(int(rr.Usage)) + - " " + strconv.Itoa(int(rr.Selector)) + - " " + strconv.Itoa(int(rr.MatchingType)) - - // Every Nth char needs a space on this output. If we output - // this as one giant line, we can't read it can in because in some cases - // the cert length overflows scan.maxTok (2048). - sx := splitN(rr.Certificate, 1024) // conservative value here - s += " " + strings.Join(sx, " ") - return s -} - -// HIP RR. See RFC 8005. -type HIP struct { - Hdr RR_Header - HitLength uint8 - PublicKeyAlgorithm uint8 - PublicKeyLength uint16 - Hit string `dns:"size-hex:HitLength"` - PublicKey string `dns:"size-base64:PublicKeyLength"` - RendezvousServers []string `dns:"domain-name"` -} - -func (rr *HIP) String() string { - s := rr.Hdr.String() + - strconv.Itoa(int(rr.PublicKeyAlgorithm)) + - " " + rr.Hit + - " " + rr.PublicKey - for _, d := range rr.RendezvousServers { - s += " " + sprintName(d) - } - return s -} - -// NINFO RR. See https://www.iana.org/assignments/dns-parameters/NINFO/ninfo-completed-template. -type NINFO struct { - Hdr RR_Header - ZSData []string `dns:"txt"` -} - -func (rr *NINFO) String() string { return rr.Hdr.String() + sprintTxt(rr.ZSData) } - -// NID RR. See RFC RFC 6742. -type NID struct { - Hdr RR_Header - Preference uint16 - NodeID uint64 -} - -func (rr *NID) String() string { - s := rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) - node := fmt.Sprintf("%0.16x", rr.NodeID) - s += " " + node[0:4] + ":" + node[4:8] + ":" + node[8:12] + ":" + node[12:16] - return s -} - -// L32 RR, See RFC 6742. -type L32 struct { - Hdr RR_Header - Preference uint16 - Locator32 net.IP `dns:"a"` -} - -func (rr *L32) String() string { - if rr.Locator32 == nil { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) - } - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + - " " + rr.Locator32.String() -} - -// L64 RR, See RFC 6742. -type L64 struct { - Hdr RR_Header - Preference uint16 - Locator64 uint64 -} - -func (rr *L64) String() string { - s := rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) - node := fmt.Sprintf("%0.16X", rr.Locator64) - s += " " + node[0:4] + ":" + node[4:8] + ":" + node[8:12] + ":" + node[12:16] - return s -} - -// LP RR. See RFC 6742. -type LP struct { - Hdr RR_Header - Preference uint16 - Fqdn string `dns:"domain-name"` -} - -func (rr *LP) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) + " " + sprintName(rr.Fqdn) -} - -// EUI48 RR. See RFC 7043. -type EUI48 struct { - Hdr RR_Header - Address uint64 `dns:"uint48"` -} - -func (rr *EUI48) String() string { return rr.Hdr.String() + euiToString(rr.Address, 48) } - -// EUI64 RR. See RFC 7043. -type EUI64 struct { - Hdr RR_Header - Address uint64 -} - -func (rr *EUI64) String() string { return rr.Hdr.String() + euiToString(rr.Address, 64) } - -// CAA RR. See RFC 6844. -type CAA struct { - Hdr RR_Header - Flag uint8 - Tag string - Value string `dns:"octet"` -} - -// rr.Value Is the character-string encoding of the value field as specified in RFC 1035, Section 5.1. -func (rr *CAA) String() string { - return rr.Hdr.String() + strconv.Itoa(int(rr.Flag)) + " " + rr.Tag + " " + sprintTxtOctet(rr.Value) -} - -// UID RR. Deprecated, IANA-Reserved. -type UID struct { - Hdr RR_Header - Uid uint32 -} - -func (rr *UID) String() string { return rr.Hdr.String() + strconv.FormatInt(int64(rr.Uid), 10) } - -// GID RR. Deprecated, IANA-Reserved. -type GID struct { - Hdr RR_Header - Gid uint32 -} - -func (rr *GID) String() string { return rr.Hdr.String() + strconv.FormatInt(int64(rr.Gid), 10) } - -// UINFO RR. Deprecated, IANA-Reserved. -type UINFO struct { - Hdr RR_Header - Uinfo string -} - -func (rr *UINFO) String() string { return rr.Hdr.String() + sprintTxt([]string{rr.Uinfo}) } - -// EID RR. See http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt. -type EID struct { - Hdr RR_Header - Endpoint string `dns:"hex"` -} - -func (rr *EID) String() string { return rr.Hdr.String() + strings.ToUpper(rr.Endpoint) } - -// NIMLOC RR. See http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt. -type NIMLOC struct { - Hdr RR_Header - Locator string `dns:"hex"` -} - -func (rr *NIMLOC) String() string { return rr.Hdr.String() + strings.ToUpper(rr.Locator) } - -// OPENPGPKEY RR. See RFC 7929. -type OPENPGPKEY struct { - Hdr RR_Header - PublicKey string `dns:"base64"` -} - -func (rr *OPENPGPKEY) String() string { return rr.Hdr.String() + rr.PublicKey } - -// CSYNC RR. See RFC 7477. -type CSYNC struct { - Hdr RR_Header - Serial uint32 - Flags uint16 - TypeBitMap []uint16 `dns:"nsec"` -} - -func (rr *CSYNC) String() string { - s := rr.Hdr.String() + strconv.FormatInt(int64(rr.Serial), 10) + " " + strconv.Itoa(int(rr.Flags)) - - for _, t := range rr.TypeBitMap { - s += " " + Type(t).String() - } - return s -} - -func (rr *CSYNC) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 4 + 2 - l += typeBitMapLen(rr.TypeBitMap) - return l -} - -// APL RR. See RFC 3123. -type APL struct { - Hdr RR_Header - Prefixes []APLPrefix `dns:"apl"` -} - -// APLPrefix is an address prefix hold by an APL record. -type APLPrefix struct { - Negation bool - Network net.IPNet -} - -// String returns presentation form of the APL record. -func (rr *APL) String() string { - var sb strings.Builder - sb.WriteString(rr.Hdr.String()) - for i, p := range rr.Prefixes { - if i > 0 { - sb.WriteByte(' ') - } - sb.WriteString(p.str()) - } - return sb.String() -} - -// str returns presentation form of the APL prefix. -func (p *APLPrefix) str() string { - var sb strings.Builder - if p.Negation { - sb.WriteByte('!') - } - - switch len(p.Network.IP) { - case net.IPv4len: - sb.WriteByte('1') - case net.IPv6len: - sb.WriteByte('2') - } - - sb.WriteByte(':') - - switch len(p.Network.IP) { - case net.IPv4len: - sb.WriteString(p.Network.IP.String()) - case net.IPv6len: - // add prefix for IPv4-mapped IPv6 - if v4 := p.Network.IP.To4(); v4 != nil { - sb.WriteString("::ffff:") - } - sb.WriteString(p.Network.IP.String()) - } - - sb.WriteByte('/') - - prefix, _ := p.Network.Mask.Size() - sb.WriteString(strconv.Itoa(prefix)) - - return sb.String() -} - -// equals reports whether two APL prefixes are identical. -func (a *APLPrefix) equals(b *APLPrefix) bool { - return a.Negation == b.Negation && - bytes.Equal(a.Network.IP, b.Network.IP) && - bytes.Equal(a.Network.Mask, b.Network.Mask) -} - -// copy returns a copy of the APL prefix. -func (p *APLPrefix) copy() APLPrefix { - return APLPrefix{ - Negation: p.Negation, - Network: copyNet(p.Network), - } -} - -// len returns size of the prefix in wire format. -func (p *APLPrefix) len() int { - // 4-byte header and the network address prefix (see Section 4 of RFC 3123) - prefix, _ := p.Network.Mask.Size() - return 4 + (prefix+7)/8 -} - -// TimeToString translates the RRSIG's incep. and expir. times to the -// string representation used when printing the record. -// It takes serial arithmetic (RFC 1982) into account. -func TimeToString(t uint32) string { - mod := (int64(t)-time.Now().Unix())/year68 - 1 - if mod < 0 { - mod = 0 - } - ti := time.Unix(int64(t)-mod*year68, 0).UTC() - return ti.Format("20060102150405") -} - -// StringToTime translates the RRSIG's incep. and expir. times from -// string values like "20110403154150" to an 32 bit integer. -// It takes serial arithmetic (RFC 1982) into account. -func StringToTime(s string) (uint32, error) { - t, err := time.Parse("20060102150405", s) - if err != nil { - return 0, err - } - mod := t.Unix()/year68 - 1 - if mod < 0 { - mod = 0 - } - return uint32(t.Unix() - mod*year68), nil -} - -// saltToString converts a NSECX salt to uppercase and returns "-" when it is empty. -func saltToString(s string) string { - if len(s) == 0 { - return "-" - } - return strings.ToUpper(s) -} - -func euiToString(eui uint64, bits int) (hex string) { - switch bits { - case 64: - hex = fmt.Sprintf("%16.16x", eui) - hex = hex[0:2] + "-" + hex[2:4] + "-" + hex[4:6] + "-" + hex[6:8] + - "-" + hex[8:10] + "-" + hex[10:12] + "-" + hex[12:14] + "-" + hex[14:16] - case 48: - hex = fmt.Sprintf("%12.12x", eui) - hex = hex[0:2] + "-" + hex[2:4] + "-" + hex[4:6] + "-" + hex[6:8] + - "-" + hex[8:10] + "-" + hex[10:12] - } - return -} - -// copyIP returns a copy of ip. -func copyIP(ip net.IP) net.IP { - p := make(net.IP, len(ip)) - copy(p, ip) - return p -} - -// copyNet returns a copy of a subnet. -func copyNet(n net.IPNet) net.IPNet { - m := make(net.IPMask, len(n.Mask)) - copy(m, n.Mask) - - return net.IPNet{ - IP: copyIP(n.IP), - Mask: m, - } -} - -// SplitN splits a string into N sized string chunks. -// This might become an exported function once. -func splitN(s string, n int) []string { - if len(s) < n { - return []string{s} - } - sx := []string{} - p, i := 0, n - for { - if i <= len(s) { - sx = append(sx, s[p:i]) - } else { - sx = append(sx, s[p:]) - break - - } - p, i = p+n, i+n - } - - return sx -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/udp.go b/cluster-autoscaler/vendor/github.com/miekg/dns/udp.go deleted file mode 100644 index a4826ee2ffd6..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/udp.go +++ /dev/null @@ -1,102 +0,0 @@ -// +build !windows - -package dns - -import ( - "net" - - "golang.org/x/net/ipv4" - "golang.org/x/net/ipv6" -) - -// This is the required size of the OOB buffer to pass to ReadMsgUDP. -var udpOOBSize = func() int { - // We can't know whether we'll get an IPv4 control message or an - // IPv6 control message ahead of time. To get around this, we size - // the buffer equal to the largest of the two. - - oob4 := ipv4.NewControlMessage(ipv4.FlagDst | ipv4.FlagInterface) - oob6 := ipv6.NewControlMessage(ipv6.FlagDst | ipv6.FlagInterface) - - if len(oob4) > len(oob6) { - return len(oob4) - } - - return len(oob6) -}() - -// SessionUDP holds the remote address and the associated -// out-of-band data. -type SessionUDP struct { - raddr *net.UDPAddr - context []byte -} - -// RemoteAddr returns the remote network address. -func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr } - -// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a -// net.UDPAddr. -func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { - oob := make([]byte, udpOOBSize) - n, oobn, _, raddr, err := conn.ReadMsgUDP(b, oob) - if err != nil { - return n, nil, err - } - return n, &SessionUDP{raddr, oob[:oobn]}, err -} - -// WriteToSessionUDP acts just like net.UDPConn.WriteTo(), but uses a *SessionUDP instead of a net.Addr. -func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { - oob := correctSource(session.context) - n, _, err := conn.WriteMsgUDP(b, oob, session.raddr) - return n, err -} - -func setUDPSocketOptions(conn *net.UDPConn) error { - // Try setting the flags for both families and ignore the errors unless they - // both error. - err6 := ipv6.NewPacketConn(conn).SetControlMessage(ipv6.FlagDst|ipv6.FlagInterface, true) - err4 := ipv4.NewPacketConn(conn).SetControlMessage(ipv4.FlagDst|ipv4.FlagInterface, true) - if err6 != nil && err4 != nil { - return err4 - } - return nil -} - -// parseDstFromOOB takes oob data and returns the destination IP. -func parseDstFromOOB(oob []byte) net.IP { - // Start with IPv6 and then fallback to IPv4 - // TODO(fastest963): Figure out a way to prefer one or the other. Looking at - // the lvl of the header for a 0 or 41 isn't cross-platform. - cm6 := new(ipv6.ControlMessage) - if cm6.Parse(oob) == nil && cm6.Dst != nil { - return cm6.Dst - } - cm4 := new(ipv4.ControlMessage) - if cm4.Parse(oob) == nil && cm4.Dst != nil { - return cm4.Dst - } - return nil -} - -// correctSource takes oob data and returns new oob data with the Src equal to the Dst -func correctSource(oob []byte) []byte { - dst := parseDstFromOOB(oob) - if dst == nil { - return nil - } - // If the dst is definitely an IPv6, then use ipv6's ControlMessage to - // respond otherwise use ipv4's because ipv6's marshal ignores ipv4 - // addresses. - if dst.To4() == nil { - cm := new(ipv6.ControlMessage) - cm.Src = dst - oob = cm.Marshal() - } else { - cm := new(ipv4.ControlMessage) - cm.Src = dst - oob = cm.Marshal() - } - return oob -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/udp_windows.go b/cluster-autoscaler/vendor/github.com/miekg/dns/udp_windows.go deleted file mode 100644 index e7dd8ca313c0..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/udp_windows.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build windows - -package dns - -import "net" - -// SessionUDP holds the remote address -type SessionUDP struct { - raddr *net.UDPAddr -} - -// RemoteAddr returns the remote network address. -func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr } - -// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a -// net.UDPAddr. -// TODO(fastest963): Once go1.10 is released, use ReadMsgUDP. -func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { - n, raddr, err := conn.ReadFrom(b) - if err != nil { - return n, nil, err - } - return n, &SessionUDP{raddr.(*net.UDPAddr)}, err -} - -// WriteToSessionUDP acts just like net.UDPConn.WriteTo(), but uses a *SessionUDP instead of a net.Addr. -// TODO(fastest963): Once go1.10 is released, use WriteMsgUDP. -func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { - return conn.WriteTo(b, session.raddr) -} - -// TODO(fastest963): Once go1.10 is released and we can use *MsgUDP methods -// use the standard method in udp.go for these. -func setUDPSocketOptions(*net.UDPConn) error { return nil } -func parseDstFromOOB([]byte, net.IP) net.IP { return nil } diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/update.go b/cluster-autoscaler/vendor/github.com/miekg/dns/update.go deleted file mode 100644 index 69dd38652224..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/update.go +++ /dev/null @@ -1,110 +0,0 @@ -package dns - -// NameUsed sets the RRs in the prereq section to -// "Name is in use" RRs. RFC 2136 section 2.4.4. -func (u *Msg) NameUsed(rr []RR) { - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassANY}}) - } -} - -// NameNotUsed sets the RRs in the prereq section to -// "Name is in not use" RRs. RFC 2136 section 2.4.5. -func (u *Msg) NameNotUsed(rr []RR) { - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassNONE}}) - } -} - -// Used sets the RRs in the prereq section to -// "RRset exists (value dependent -- with rdata)" RRs. RFC 2136 section 2.4.2. -func (u *Msg) Used(rr []RR) { - if len(u.Question) == 0 { - panic("dns: empty question section") - } - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - r.Header().Class = u.Question[0].Qclass - u.Answer = append(u.Answer, r) - } -} - -// RRsetUsed sets the RRs in the prereq section to -// "RRset exists (value independent -- no rdata)" RRs. RFC 2136 section 2.4.1. -func (u *Msg) RRsetUsed(rr []RR) { - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - h := r.Header() - u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: h.Name, Ttl: 0, Rrtype: h.Rrtype, Class: ClassANY}}) - } -} - -// RRsetNotUsed sets the RRs in the prereq section to -// "RRset does not exist" RRs. RFC 2136 section 2.4.3. -func (u *Msg) RRsetNotUsed(rr []RR) { - if u.Answer == nil { - u.Answer = make([]RR, 0, len(rr)) - } - for _, r := range rr { - h := r.Header() - u.Answer = append(u.Answer, &ANY{Hdr: RR_Header{Name: h.Name, Ttl: 0, Rrtype: h.Rrtype, Class: ClassNONE}}) - } -} - -// Insert creates a dynamic update packet that adds an complete RRset, see RFC 2136 section 2.5.1. -func (u *Msg) Insert(rr []RR) { - if len(u.Question) == 0 { - panic("dns: empty question section") - } - if u.Ns == nil { - u.Ns = make([]RR, 0, len(rr)) - } - for _, r := range rr { - r.Header().Class = u.Question[0].Qclass - u.Ns = append(u.Ns, r) - } -} - -// RemoveRRset creates a dynamic update packet that deletes an RRset, see RFC 2136 section 2.5.2. -func (u *Msg) RemoveRRset(rr []RR) { - if u.Ns == nil { - u.Ns = make([]RR, 0, len(rr)) - } - for _, r := range rr { - h := r.Header() - u.Ns = append(u.Ns, &ANY{Hdr: RR_Header{Name: h.Name, Ttl: 0, Rrtype: h.Rrtype, Class: ClassANY}}) - } -} - -// RemoveName creates a dynamic update packet that deletes all RRsets of a name, see RFC 2136 section 2.5.3 -func (u *Msg) RemoveName(rr []RR) { - if u.Ns == nil { - u.Ns = make([]RR, 0, len(rr)) - } - for _, r := range rr { - u.Ns = append(u.Ns, &ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassANY}}) - } -} - -// Remove creates a dynamic update packet deletes RR from a RRSset, see RFC 2136 section 2.5.4 -func (u *Msg) Remove(rr []RR) { - if u.Ns == nil { - u.Ns = make([]RR, 0, len(rr)) - } - for _, r := range rr { - h := r.Header() - h.Class = ClassNONE - h.Ttl = 0 - u.Ns = append(u.Ns, r) - } -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/version.go b/cluster-autoscaler/vendor/github.com/miekg/dns/version.go deleted file mode 100644 index 5c75851b41dc..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/version.go +++ /dev/null @@ -1,15 +0,0 @@ -package dns - -import "fmt" - -// Version is current version of this library. -var Version = v{1, 1, 35} - -// v holds the version of this library. -type v struct { - Major, Minor, Patch int -} - -func (v v) String() string { - return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch) -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/xfr.go b/cluster-autoscaler/vendor/github.com/miekg/dns/xfr.go deleted file mode 100644 index 43970e64f39b..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/xfr.go +++ /dev/null @@ -1,266 +0,0 @@ -package dns - -import ( - "fmt" - "time" -) - -// Envelope is used when doing a zone transfer with a remote server. -type Envelope struct { - RR []RR // The set of RRs in the answer section of the xfr reply message. - Error error // If something went wrong, this contains the error. -} - -// A Transfer defines parameters that are used during a zone transfer. -type Transfer struct { - *Conn - DialTimeout time.Duration // net.DialTimeout, defaults to 2 seconds - ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections, defaults to 2 seconds - WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections, defaults to 2 seconds - TsigSecret map[string]string // Secret(s) for Tsig map[], zonename must be in canonical form (lowercase, fqdn, see RFC 4034 Section 6.2) - tsigTimersOnly bool -} - -// Think we need to away to stop the transfer - -// In performs an incoming transfer with the server in a. -// If you would like to set the source IP, or some other attribute -// of a Dialer for a Transfer, you can do so by specifying the attributes -// in the Transfer.Conn: -// -// d := net.Dialer{LocalAddr: transfer_source} -// con, err := d.Dial("tcp", master) -// dnscon := &dns.Conn{Conn:con} -// transfer = &dns.Transfer{Conn: dnscon} -// channel, err := transfer.In(message, master) -// -func (t *Transfer) In(q *Msg, a string) (env chan *Envelope, err error) { - switch q.Question[0].Qtype { - case TypeAXFR, TypeIXFR: - default: - return nil, &Error{"unsupported question type"} - } - - timeout := dnsTimeout - if t.DialTimeout != 0 { - timeout = t.DialTimeout - } - - if t.Conn == nil { - t.Conn, err = DialTimeout("tcp", a, timeout) - if err != nil { - return nil, err - } - } - - if err := t.WriteMsg(q); err != nil { - return nil, err - } - - env = make(chan *Envelope) - switch q.Question[0].Qtype { - case TypeAXFR: - go t.inAxfr(q, env) - case TypeIXFR: - go t.inIxfr(q, env) - } - - return env, nil -} - -func (t *Transfer) inAxfr(q *Msg, c chan *Envelope) { - first := true - defer t.Close() - defer close(c) - timeout := dnsTimeout - if t.ReadTimeout != 0 { - timeout = t.ReadTimeout - } - for { - t.Conn.SetReadDeadline(time.Now().Add(timeout)) - in, err := t.ReadMsg() - if err != nil { - c <- &Envelope{nil, err} - return - } - if q.Id != in.Id { - c <- &Envelope{in.Answer, ErrId} - return - } - if first { - if in.Rcode != RcodeSuccess { - c <- &Envelope{in.Answer, &Error{err: fmt.Sprintf(errXFR, in.Rcode)}} - return - } - if !isSOAFirst(in) { - c <- &Envelope{in.Answer, ErrSoa} - return - } - first = !first - // only one answer that is SOA, receive more - if len(in.Answer) == 1 { - t.tsigTimersOnly = true - c <- &Envelope{in.Answer, nil} - continue - } - } - - if !first { - t.tsigTimersOnly = true // Subsequent envelopes use this. - if isSOALast(in) { - c <- &Envelope{in.Answer, nil} - return - } - c <- &Envelope{in.Answer, nil} - } - } -} - -func (t *Transfer) inIxfr(q *Msg, c chan *Envelope) { - var serial uint32 // The first serial seen is the current server serial - axfr := true - n := 0 - qser := q.Ns[0].(*SOA).Serial - defer t.Close() - defer close(c) - timeout := dnsTimeout - if t.ReadTimeout != 0 { - timeout = t.ReadTimeout - } - for { - t.SetReadDeadline(time.Now().Add(timeout)) - in, err := t.ReadMsg() - if err != nil { - c <- &Envelope{nil, err} - return - } - if q.Id != in.Id { - c <- &Envelope{in.Answer, ErrId} - return - } - if in.Rcode != RcodeSuccess { - c <- &Envelope{in.Answer, &Error{err: fmt.Sprintf(errXFR, in.Rcode)}} - return - } - if n == 0 { - // Check if the returned answer is ok - if !isSOAFirst(in) { - c <- &Envelope{in.Answer, ErrSoa} - return - } - // This serial is important - serial = in.Answer[0].(*SOA).Serial - // Check if there are no changes in zone - if qser >= serial { - c <- &Envelope{in.Answer, nil} - return - } - } - // Now we need to check each message for SOA records, to see what we need to do - t.tsigTimersOnly = true - for _, rr := range in.Answer { - if v, ok := rr.(*SOA); ok { - if v.Serial == serial { - n++ - // quit if it's a full axfr or the the servers' SOA is repeated the third time - if axfr && n == 2 || n == 3 { - c <- &Envelope{in.Answer, nil} - return - } - } else if axfr { - // it's an ixfr - axfr = false - } - } - } - c <- &Envelope{in.Answer, nil} - } -} - -// Out performs an outgoing transfer with the client connecting in w. -// Basic use pattern: -// -// ch := make(chan *dns.Envelope) -// tr := new(dns.Transfer) -// var wg sync.WaitGroup -// go func() { -// tr.Out(w, r, ch) -// wg.Done() -// }() -// ch <- &dns.Envelope{RR: []dns.RR{soa, rr1, rr2, rr3, soa}} -// close(ch) -// wg.Wait() // wait until everything is written out -// w.Close() // close connection -// -// The server is responsible for sending the correct sequence of RRs through the channel ch. -func (t *Transfer) Out(w ResponseWriter, q *Msg, ch chan *Envelope) error { - for x := range ch { - r := new(Msg) - // Compress? - r.SetReply(q) - r.Authoritative = true - // assume it fits TODO(miek): fix - r.Answer = append(r.Answer, x.RR...) - if tsig := q.IsTsig(); tsig != nil && w.TsigStatus() == nil { - r.SetTsig(tsig.Hdr.Name, tsig.Algorithm, tsig.Fudge, time.Now().Unix()) - } - if err := w.WriteMsg(r); err != nil { - return err - } - w.TsigTimersOnly(true) - } - return nil -} - -// ReadMsg reads a message from the transfer connection t. -func (t *Transfer) ReadMsg() (*Msg, error) { - m := new(Msg) - p := make([]byte, MaxMsgSize) - n, err := t.Read(p) - if err != nil && n == 0 { - return nil, err - } - p = p[:n] - if err := m.Unpack(p); err != nil { - return nil, err - } - if ts := m.IsTsig(); ts != nil && t.TsigSecret != nil { - if _, ok := t.TsigSecret[ts.Hdr.Name]; !ok { - return m, ErrSecret - } - // Need to work on the original message p, as that was used to calculate the tsig. - err = TsigVerify(p, t.TsigSecret[ts.Hdr.Name], t.tsigRequestMAC, t.tsigTimersOnly) - t.tsigRequestMAC = ts.MAC - } - return m, err -} - -// WriteMsg writes a message through the transfer connection t. -func (t *Transfer) WriteMsg(m *Msg) (err error) { - var out []byte - if ts := m.IsTsig(); ts != nil && t.TsigSecret != nil { - if _, ok := t.TsigSecret[ts.Hdr.Name]; !ok { - return ErrSecret - } - out, t.tsigRequestMAC, err = TsigGenerate(m, t.TsigSecret[ts.Hdr.Name], t.tsigRequestMAC, t.tsigTimersOnly) - } else { - out, err = m.Pack() - } - if err != nil { - return err - } - _, err = t.Write(out) - return err -} - -func isSOAFirst(in *Msg) bool { - return len(in.Answer) > 0 && - in.Answer[0].Header().Rrtype == TypeSOA -} - -func isSOALast(in *Msg) bool { - return len(in.Answer) > 0 && - in.Answer[len(in.Answer)-1].Header().Rrtype == TypeSOA -} - -const errXFR = "bad xfr rcode: %d" diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/zduplicate.go b/cluster-autoscaler/vendor/github.com/miekg/dns/zduplicate.go deleted file mode 100644 index 0d3b34bd9b24..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/zduplicate.go +++ /dev/null @@ -1,1319 +0,0 @@ -// Code generated by "go run duplicate_generate.go"; DO NOT EDIT. - -package dns - -// isDuplicate() functions - -func (r1 *A) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*A) - if !ok { - return false - } - _ = r2 - if !r1.A.Equal(r2.A) { - return false - } - return true -} - -func (r1 *AAAA) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*AAAA) - if !ok { - return false - } - _ = r2 - if !r1.AAAA.Equal(r2.AAAA) { - return false - } - return true -} - -func (r1 *AFSDB) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*AFSDB) - if !ok { - return false - } - _ = r2 - if r1.Subtype != r2.Subtype { - return false - } - if !isDuplicateName(r1.Hostname, r2.Hostname) { - return false - } - return true -} - -func (r1 *ANY) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*ANY) - if !ok { - return false - } - _ = r2 - return true -} - -func (r1 *APL) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*APL) - if !ok { - return false - } - _ = r2 - if len(r1.Prefixes) != len(r2.Prefixes) { - return false - } - for i := 0; i < len(r1.Prefixes); i++ { - if !r1.Prefixes[i].equals(&r2.Prefixes[i]) { - return false - } - } - return true -} - -func (r1 *AVC) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*AVC) - if !ok { - return false - } - _ = r2 - if len(r1.Txt) != len(r2.Txt) { - return false - } - for i := 0; i < len(r1.Txt); i++ { - if r1.Txt[i] != r2.Txt[i] { - return false - } - } - return true -} - -func (r1 *CAA) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*CAA) - if !ok { - return false - } - _ = r2 - if r1.Flag != r2.Flag { - return false - } - if r1.Tag != r2.Tag { - return false - } - if r1.Value != r2.Value { - return false - } - return true -} - -func (r1 *CDNSKEY) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*CDNSKEY) - if !ok { - return false - } - _ = r2 - if r1.Flags != r2.Flags { - return false - } - if r1.Protocol != r2.Protocol { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.PublicKey != r2.PublicKey { - return false - } - return true -} - -func (r1 *CDS) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*CDS) - if !ok { - return false - } - _ = r2 - if r1.KeyTag != r2.KeyTag { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.DigestType != r2.DigestType { - return false - } - if r1.Digest != r2.Digest { - return false - } - return true -} - -func (r1 *CERT) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*CERT) - if !ok { - return false - } - _ = r2 - if r1.Type != r2.Type { - return false - } - if r1.KeyTag != r2.KeyTag { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.Certificate != r2.Certificate { - return false - } - return true -} - -func (r1 *CNAME) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*CNAME) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Target, r2.Target) { - return false - } - return true -} - -func (r1 *CSYNC) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*CSYNC) - if !ok { - return false - } - _ = r2 - if r1.Serial != r2.Serial { - return false - } - if r1.Flags != r2.Flags { - return false - } - if len(r1.TypeBitMap) != len(r2.TypeBitMap) { - return false - } - for i := 0; i < len(r1.TypeBitMap); i++ { - if r1.TypeBitMap[i] != r2.TypeBitMap[i] { - return false - } - } - return true -} - -func (r1 *DHCID) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*DHCID) - if !ok { - return false - } - _ = r2 - if r1.Digest != r2.Digest { - return false - } - return true -} - -func (r1 *DLV) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*DLV) - if !ok { - return false - } - _ = r2 - if r1.KeyTag != r2.KeyTag { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.DigestType != r2.DigestType { - return false - } - if r1.Digest != r2.Digest { - return false - } - return true -} - -func (r1 *DNAME) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*DNAME) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Target, r2.Target) { - return false - } - return true -} - -func (r1 *DNSKEY) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*DNSKEY) - if !ok { - return false - } - _ = r2 - if r1.Flags != r2.Flags { - return false - } - if r1.Protocol != r2.Protocol { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.PublicKey != r2.PublicKey { - return false - } - return true -} - -func (r1 *DS) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*DS) - if !ok { - return false - } - _ = r2 - if r1.KeyTag != r2.KeyTag { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.DigestType != r2.DigestType { - return false - } - if r1.Digest != r2.Digest { - return false - } - return true -} - -func (r1 *EID) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*EID) - if !ok { - return false - } - _ = r2 - if r1.Endpoint != r2.Endpoint { - return false - } - return true -} - -func (r1 *EUI48) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*EUI48) - if !ok { - return false - } - _ = r2 - if r1.Address != r2.Address { - return false - } - return true -} - -func (r1 *EUI64) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*EUI64) - if !ok { - return false - } - _ = r2 - if r1.Address != r2.Address { - return false - } - return true -} - -func (r1 *GID) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*GID) - if !ok { - return false - } - _ = r2 - if r1.Gid != r2.Gid { - return false - } - return true -} - -func (r1 *GPOS) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*GPOS) - if !ok { - return false - } - _ = r2 - if r1.Longitude != r2.Longitude { - return false - } - if r1.Latitude != r2.Latitude { - return false - } - if r1.Altitude != r2.Altitude { - return false - } - return true -} - -func (r1 *HINFO) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*HINFO) - if !ok { - return false - } - _ = r2 - if r1.Cpu != r2.Cpu { - return false - } - if r1.Os != r2.Os { - return false - } - return true -} - -func (r1 *HIP) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*HIP) - if !ok { - return false - } - _ = r2 - if r1.HitLength != r2.HitLength { - return false - } - if r1.PublicKeyAlgorithm != r2.PublicKeyAlgorithm { - return false - } - if r1.PublicKeyLength != r2.PublicKeyLength { - return false - } - if r1.Hit != r2.Hit { - return false - } - if r1.PublicKey != r2.PublicKey { - return false - } - if len(r1.RendezvousServers) != len(r2.RendezvousServers) { - return false - } - for i := 0; i < len(r1.RendezvousServers); i++ { - if !isDuplicateName(r1.RendezvousServers[i], r2.RendezvousServers[i]) { - return false - } - } - return true -} - -func (r1 *HTTPS) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*HTTPS) - if !ok { - return false - } - _ = r2 - if r1.Priority != r2.Priority { - return false - } - if !isDuplicateName(r1.Target, r2.Target) { - return false - } - if len(r1.Value) != len(r2.Value) { - return false - } - if !areSVCBPairArraysEqual(r1.Value, r2.Value) { - return false - } - return true -} - -func (r1 *KEY) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*KEY) - if !ok { - return false - } - _ = r2 - if r1.Flags != r2.Flags { - return false - } - if r1.Protocol != r2.Protocol { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.PublicKey != r2.PublicKey { - return false - } - return true -} - -func (r1 *KX) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*KX) - if !ok { - return false - } - _ = r2 - if r1.Preference != r2.Preference { - return false - } - if !isDuplicateName(r1.Exchanger, r2.Exchanger) { - return false - } - return true -} - -func (r1 *L32) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*L32) - if !ok { - return false - } - _ = r2 - if r1.Preference != r2.Preference { - return false - } - if !r1.Locator32.Equal(r2.Locator32) { - return false - } - return true -} - -func (r1 *L64) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*L64) - if !ok { - return false - } - _ = r2 - if r1.Preference != r2.Preference { - return false - } - if r1.Locator64 != r2.Locator64 { - return false - } - return true -} - -func (r1 *LOC) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*LOC) - if !ok { - return false - } - _ = r2 - if r1.Version != r2.Version { - return false - } - if r1.Size != r2.Size { - return false - } - if r1.HorizPre != r2.HorizPre { - return false - } - if r1.VertPre != r2.VertPre { - return false - } - if r1.Latitude != r2.Latitude { - return false - } - if r1.Longitude != r2.Longitude { - return false - } - if r1.Altitude != r2.Altitude { - return false - } - return true -} - -func (r1 *LP) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*LP) - if !ok { - return false - } - _ = r2 - if r1.Preference != r2.Preference { - return false - } - if !isDuplicateName(r1.Fqdn, r2.Fqdn) { - return false - } - return true -} - -func (r1 *MB) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*MB) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Mb, r2.Mb) { - return false - } - return true -} - -func (r1 *MD) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*MD) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Md, r2.Md) { - return false - } - return true -} - -func (r1 *MF) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*MF) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Mf, r2.Mf) { - return false - } - return true -} - -func (r1 *MG) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*MG) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Mg, r2.Mg) { - return false - } - return true -} - -func (r1 *MINFO) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*MINFO) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Rmail, r2.Rmail) { - return false - } - if !isDuplicateName(r1.Email, r2.Email) { - return false - } - return true -} - -func (r1 *MR) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*MR) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Mr, r2.Mr) { - return false - } - return true -} - -func (r1 *MX) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*MX) - if !ok { - return false - } - _ = r2 - if r1.Preference != r2.Preference { - return false - } - if !isDuplicateName(r1.Mx, r2.Mx) { - return false - } - return true -} - -func (r1 *NAPTR) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NAPTR) - if !ok { - return false - } - _ = r2 - if r1.Order != r2.Order { - return false - } - if r1.Preference != r2.Preference { - return false - } - if r1.Flags != r2.Flags { - return false - } - if r1.Service != r2.Service { - return false - } - if r1.Regexp != r2.Regexp { - return false - } - if !isDuplicateName(r1.Replacement, r2.Replacement) { - return false - } - return true -} - -func (r1 *NID) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NID) - if !ok { - return false - } - _ = r2 - if r1.Preference != r2.Preference { - return false - } - if r1.NodeID != r2.NodeID { - return false - } - return true -} - -func (r1 *NIMLOC) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NIMLOC) - if !ok { - return false - } - _ = r2 - if r1.Locator != r2.Locator { - return false - } - return true -} - -func (r1 *NINFO) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NINFO) - if !ok { - return false - } - _ = r2 - if len(r1.ZSData) != len(r2.ZSData) { - return false - } - for i := 0; i < len(r1.ZSData); i++ { - if r1.ZSData[i] != r2.ZSData[i] { - return false - } - } - return true -} - -func (r1 *NS) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NS) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Ns, r2.Ns) { - return false - } - return true -} - -func (r1 *NSAPPTR) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NSAPPTR) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Ptr, r2.Ptr) { - return false - } - return true -} - -func (r1 *NSEC) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NSEC) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.NextDomain, r2.NextDomain) { - return false - } - if len(r1.TypeBitMap) != len(r2.TypeBitMap) { - return false - } - for i := 0; i < len(r1.TypeBitMap); i++ { - if r1.TypeBitMap[i] != r2.TypeBitMap[i] { - return false - } - } - return true -} - -func (r1 *NSEC3) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NSEC3) - if !ok { - return false - } - _ = r2 - if r1.Hash != r2.Hash { - return false - } - if r1.Flags != r2.Flags { - return false - } - if r1.Iterations != r2.Iterations { - return false - } - if r1.SaltLength != r2.SaltLength { - return false - } - if r1.Salt != r2.Salt { - return false - } - if r1.HashLength != r2.HashLength { - return false - } - if r1.NextDomain != r2.NextDomain { - return false - } - if len(r1.TypeBitMap) != len(r2.TypeBitMap) { - return false - } - for i := 0; i < len(r1.TypeBitMap); i++ { - if r1.TypeBitMap[i] != r2.TypeBitMap[i] { - return false - } - } - return true -} - -func (r1 *NSEC3PARAM) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NSEC3PARAM) - if !ok { - return false - } - _ = r2 - if r1.Hash != r2.Hash { - return false - } - if r1.Flags != r2.Flags { - return false - } - if r1.Iterations != r2.Iterations { - return false - } - if r1.SaltLength != r2.SaltLength { - return false - } - if r1.Salt != r2.Salt { - return false - } - return true -} - -func (r1 *NULL) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*NULL) - if !ok { - return false - } - _ = r2 - if r1.Data != r2.Data { - return false - } - return true -} - -func (r1 *OPENPGPKEY) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*OPENPGPKEY) - if !ok { - return false - } - _ = r2 - if r1.PublicKey != r2.PublicKey { - return false - } - return true -} - -func (r1 *PTR) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*PTR) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Ptr, r2.Ptr) { - return false - } - return true -} - -func (r1 *PX) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*PX) - if !ok { - return false - } - _ = r2 - if r1.Preference != r2.Preference { - return false - } - if !isDuplicateName(r1.Map822, r2.Map822) { - return false - } - if !isDuplicateName(r1.Mapx400, r2.Mapx400) { - return false - } - return true -} - -func (r1 *RFC3597) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*RFC3597) - if !ok { - return false - } - _ = r2 - if r1.Rdata != r2.Rdata { - return false - } - return true -} - -func (r1 *RKEY) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*RKEY) - if !ok { - return false - } - _ = r2 - if r1.Flags != r2.Flags { - return false - } - if r1.Protocol != r2.Protocol { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.PublicKey != r2.PublicKey { - return false - } - return true -} - -func (r1 *RP) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*RP) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Mbox, r2.Mbox) { - return false - } - if !isDuplicateName(r1.Txt, r2.Txt) { - return false - } - return true -} - -func (r1 *RRSIG) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*RRSIG) - if !ok { - return false - } - _ = r2 - if r1.TypeCovered != r2.TypeCovered { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.Labels != r2.Labels { - return false - } - if r1.OrigTtl != r2.OrigTtl { - return false - } - if r1.Expiration != r2.Expiration { - return false - } - if r1.Inception != r2.Inception { - return false - } - if r1.KeyTag != r2.KeyTag { - return false - } - if !isDuplicateName(r1.SignerName, r2.SignerName) { - return false - } - if r1.Signature != r2.Signature { - return false - } - return true -} - -func (r1 *RT) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*RT) - if !ok { - return false - } - _ = r2 - if r1.Preference != r2.Preference { - return false - } - if !isDuplicateName(r1.Host, r2.Host) { - return false - } - return true -} - -func (r1 *SIG) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*SIG) - if !ok { - return false - } - _ = r2 - if r1.TypeCovered != r2.TypeCovered { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.Labels != r2.Labels { - return false - } - if r1.OrigTtl != r2.OrigTtl { - return false - } - if r1.Expiration != r2.Expiration { - return false - } - if r1.Inception != r2.Inception { - return false - } - if r1.KeyTag != r2.KeyTag { - return false - } - if !isDuplicateName(r1.SignerName, r2.SignerName) { - return false - } - if r1.Signature != r2.Signature { - return false - } - return true -} - -func (r1 *SMIMEA) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*SMIMEA) - if !ok { - return false - } - _ = r2 - if r1.Usage != r2.Usage { - return false - } - if r1.Selector != r2.Selector { - return false - } - if r1.MatchingType != r2.MatchingType { - return false - } - if r1.Certificate != r2.Certificate { - return false - } - return true -} - -func (r1 *SOA) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*SOA) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Ns, r2.Ns) { - return false - } - if !isDuplicateName(r1.Mbox, r2.Mbox) { - return false - } - if r1.Serial != r2.Serial { - return false - } - if r1.Refresh != r2.Refresh { - return false - } - if r1.Retry != r2.Retry { - return false - } - if r1.Expire != r2.Expire { - return false - } - if r1.Minttl != r2.Minttl { - return false - } - return true -} - -func (r1 *SPF) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*SPF) - if !ok { - return false - } - _ = r2 - if len(r1.Txt) != len(r2.Txt) { - return false - } - for i := 0; i < len(r1.Txt); i++ { - if r1.Txt[i] != r2.Txt[i] { - return false - } - } - return true -} - -func (r1 *SRV) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*SRV) - if !ok { - return false - } - _ = r2 - if r1.Priority != r2.Priority { - return false - } - if r1.Weight != r2.Weight { - return false - } - if r1.Port != r2.Port { - return false - } - if !isDuplicateName(r1.Target, r2.Target) { - return false - } - return true -} - -func (r1 *SSHFP) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*SSHFP) - if !ok { - return false - } - _ = r2 - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.Type != r2.Type { - return false - } - if r1.FingerPrint != r2.FingerPrint { - return false - } - return true -} - -func (r1 *SVCB) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*SVCB) - if !ok { - return false - } - _ = r2 - if r1.Priority != r2.Priority { - return false - } - if !isDuplicateName(r1.Target, r2.Target) { - return false - } - if len(r1.Value) != len(r2.Value) { - return false - } - if !areSVCBPairArraysEqual(r1.Value, r2.Value) { - return false - } - return true -} - -func (r1 *TA) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*TA) - if !ok { - return false - } - _ = r2 - if r1.KeyTag != r2.KeyTag { - return false - } - if r1.Algorithm != r2.Algorithm { - return false - } - if r1.DigestType != r2.DigestType { - return false - } - if r1.Digest != r2.Digest { - return false - } - return true -} - -func (r1 *TALINK) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*TALINK) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.PreviousName, r2.PreviousName) { - return false - } - if !isDuplicateName(r1.NextName, r2.NextName) { - return false - } - return true -} - -func (r1 *TKEY) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*TKEY) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Algorithm, r2.Algorithm) { - return false - } - if r1.Inception != r2.Inception { - return false - } - if r1.Expiration != r2.Expiration { - return false - } - if r1.Mode != r2.Mode { - return false - } - if r1.Error != r2.Error { - return false - } - if r1.KeySize != r2.KeySize { - return false - } - if r1.Key != r2.Key { - return false - } - if r1.OtherLen != r2.OtherLen { - return false - } - if r1.OtherData != r2.OtherData { - return false - } - return true -} - -func (r1 *TLSA) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*TLSA) - if !ok { - return false - } - _ = r2 - if r1.Usage != r2.Usage { - return false - } - if r1.Selector != r2.Selector { - return false - } - if r1.MatchingType != r2.MatchingType { - return false - } - if r1.Certificate != r2.Certificate { - return false - } - return true -} - -func (r1 *TSIG) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*TSIG) - if !ok { - return false - } - _ = r2 - if !isDuplicateName(r1.Algorithm, r2.Algorithm) { - return false - } - if r1.TimeSigned != r2.TimeSigned { - return false - } - if r1.Fudge != r2.Fudge { - return false - } - if r1.MACSize != r2.MACSize { - return false - } - if r1.MAC != r2.MAC { - return false - } - if r1.OrigId != r2.OrigId { - return false - } - if r1.Error != r2.Error { - return false - } - if r1.OtherLen != r2.OtherLen { - return false - } - if r1.OtherData != r2.OtherData { - return false - } - return true -} - -func (r1 *TXT) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*TXT) - if !ok { - return false - } - _ = r2 - if len(r1.Txt) != len(r2.Txt) { - return false - } - for i := 0; i < len(r1.Txt); i++ { - if r1.Txt[i] != r2.Txt[i] { - return false - } - } - return true -} - -func (r1 *UID) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*UID) - if !ok { - return false - } - _ = r2 - if r1.Uid != r2.Uid { - return false - } - return true -} - -func (r1 *UINFO) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*UINFO) - if !ok { - return false - } - _ = r2 - if r1.Uinfo != r2.Uinfo { - return false - } - return true -} - -func (r1 *URI) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*URI) - if !ok { - return false - } - _ = r2 - if r1.Priority != r2.Priority { - return false - } - if r1.Weight != r2.Weight { - return false - } - if r1.Target != r2.Target { - return false - } - return true -} - -func (r1 *X25) isDuplicate(_r2 RR) bool { - r2, ok := _r2.(*X25) - if !ok { - return false - } - _ = r2 - if r1.PSDNAddress != r2.PSDNAddress { - return false - } - return true -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/zmsg.go b/cluster-autoscaler/vendor/github.com/miekg/dns/zmsg.go deleted file mode 100644 index d24a10fa2426..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/zmsg.go +++ /dev/null @@ -1,2823 +0,0 @@ -// Code generated by "go run msg_generate.go"; DO NOT EDIT. - -package dns - -// pack*() functions - -func (rr *A) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDataA(rr.A, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *AAAA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDataAAAA(rr.AAAA, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *AFSDB) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Subtype, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Hostname, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *ANY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - return off, nil -} - -func (rr *APL) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDataApl(rr.Prefixes, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *AVC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringTxt(rr.Txt, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CAA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint8(rr.Flag, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Tag, msg, off) - if err != nil { - return off, err - } - off, err = packStringOctet(rr.Value, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CDNSKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CDS) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.DigestType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Digest, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CERT) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Type, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.Certificate, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CNAME) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Target, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CSYNC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint32(rr.Serial, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packDataNsec(rr.TypeBitMap, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DHCID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringBase64(rr.Digest, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DLV) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.DigestType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Digest, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DNAME) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Target, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DNSKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DS) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.DigestType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Digest, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *EID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringHex(rr.Endpoint, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *EUI48) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint48(rr.Address, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *EUI64) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint64(rr.Address, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *GID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint32(rr.Gid, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *GPOS) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packString(rr.Longitude, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Latitude, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Altitude, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *HINFO) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packString(rr.Cpu, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Os, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *HIP) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint8(rr.HitLength, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.PublicKeyAlgorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.PublicKeyLength, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Hit, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - off, err = packDataDomainNames(rr.RendezvousServers, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *HTTPS) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Priority, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Target, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packDataSVCB(rr.Value, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *KEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *KX) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Exchanger, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *L32) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packDataA(rr.Locator32, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *L64) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packUint64(rr.Locator64, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *LOC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint8(rr.Version, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Size, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.HorizPre, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.VertPre, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Latitude, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Longitude, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Altitude, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *LP) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Fqdn, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MB) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Mb, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MD) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Md, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MF) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Mf, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MG) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Mg, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MINFO) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Rmail, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Email, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MR) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Mr, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MX) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Mx, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NAPTR) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Order, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Service, msg, off) - if err != nil { - return off, err - } - off, err = packString(rr.Regexp, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Replacement, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packUint64(rr.NodeID, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NIMLOC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringHex(rr.Locator, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NINFO) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringTxt(rr.ZSData, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NS) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Ns, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NSAPPTR) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Ptr, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NSEC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.NextDomain, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packDataNsec(rr.TypeBitMap, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NSEC3) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint8(rr.Hash, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Iterations, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.SaltLength, msg, off) - if err != nil { - return off, err - } - // Only pack salt if value is not "-", i.e. empty - if rr.Salt != "-" { - off, err = packStringHex(rr.Salt, msg, off) - if err != nil { - return off, err - } - } - off, err = packUint8(rr.HashLength, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase32(rr.NextDomain, msg, off) - if err != nil { - return off, err - } - off, err = packDataNsec(rr.TypeBitMap, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NSEC3PARAM) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint8(rr.Hash, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Iterations, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.SaltLength, msg, off) - if err != nil { - return off, err - } - // Only pack salt if value is not "-", i.e. empty - if rr.Salt != "-" { - off, err = packStringHex(rr.Salt, msg, off) - if err != nil { - return off, err - } - } - return off, nil -} - -func (rr *NULL) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringAny(rr.Data, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *OPENPGPKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *OPT) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDataOpt(rr.Option, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *PTR) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Ptr, msg, off, compression, compress) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *PX) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Map822, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Mapx400, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RFC3597) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringHex(rr.Rdata, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Flags, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Protocol, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.PublicKey, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RP) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Mbox, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Txt, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RRSIG) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.TypeCovered, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Labels, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.OrigTtl, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Expiration, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Inception, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.SignerName, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.Signature, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RT) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Preference, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Host, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SIG) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.TypeCovered, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Labels, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.OrigTtl, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Expiration, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Inception, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.SignerName, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packStringBase64(rr.Signature, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SMIMEA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint8(rr.Usage, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Selector, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.MatchingType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Certificate, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SOA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Ns, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Mbox, msg, off, compression, compress) - if err != nil { - return off, err - } - off, err = packUint32(rr.Serial, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Refresh, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Retry, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Expire, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Minttl, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SPF) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringTxt(rr.Txt, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SRV) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Priority, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Weight, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Port, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Target, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SSHFP) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Type, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.FingerPrint, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SVCB) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Priority, msg, off) - if err != nil { - return off, err - } - off, err = packDomainName(rr.Target, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packDataSVCB(rr.Value, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.KeyTag, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Algorithm, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.DigestType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Digest, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TALINK) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.PreviousName, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packDomainName(rr.NextName, msg, off, compression, false) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Algorithm, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packUint32(rr.Inception, msg, off) - if err != nil { - return off, err - } - off, err = packUint32(rr.Expiration, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Mode, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Error, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.KeySize, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Key, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.OtherLen, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.OtherData, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TLSA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint8(rr.Usage, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.Selector, msg, off) - if err != nil { - return off, err - } - off, err = packUint8(rr.MatchingType, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.Certificate, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TSIG) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packDomainName(rr.Algorithm, msg, off, compression, false) - if err != nil { - return off, err - } - off, err = packUint48(rr.TimeSigned, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Fudge, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.MACSize, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.MAC, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.OrigId, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Error, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.OtherLen, msg, off) - if err != nil { - return off, err - } - off, err = packStringHex(rr.OtherData, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TXT) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packStringTxt(rr.Txt, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *UID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint32(rr.Uid, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *UINFO) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packString(rr.Uinfo, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *URI) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packUint16(rr.Priority, msg, off) - if err != nil { - return off, err - } - off, err = packUint16(rr.Weight, msg, off) - if err != nil { - return off, err - } - off, err = packStringOctet(rr.Target, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *X25) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) { - off, err = packString(rr.PSDNAddress, msg, off) - if err != nil { - return off, err - } - return off, nil -} - -// unpack*() functions - -func (rr *A) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.A, off, err = unpackDataA(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *AAAA) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.AAAA, off, err = unpackDataAAAA(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *AFSDB) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Subtype, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Hostname, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *ANY) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - return off, nil -} - -func (rr *APL) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Prefixes, off, err = unpackDataApl(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *AVC) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Txt, off, err = unpackStringTxt(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CAA) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Flag, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Tag, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Value, off, err = unpackStringOctet(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CDNSKEY) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Flags, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Protocol, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CDS) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.DigestType, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CERT) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Type, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Certificate, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CNAME) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Target, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *CSYNC) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Serial, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Flags, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.TypeBitMap, off, err = unpackDataNsec(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DHCID) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Digest, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DLV) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.DigestType, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DNAME) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Target, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DNSKEY) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Flags, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Protocol, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *DS) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.DigestType, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *EID) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Endpoint, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *EUI48) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Address, off, err = unpackUint48(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *EUI64) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Address, off, err = unpackUint64(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *GID) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Gid, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *GPOS) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Longitude, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Latitude, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Altitude, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *HINFO) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Cpu, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Os, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *HIP) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.HitLength, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.PublicKeyAlgorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.PublicKeyLength, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Hit, off, err = unpackStringHex(msg, off, off+int(rr.HitLength)) - if err != nil { - return off, err - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, off+int(rr.PublicKeyLength)) - if err != nil { - return off, err - } - rr.RendezvousServers, off, err = unpackDataDomainNames(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *HTTPS) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Priority, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Target, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Value, off, err = unpackDataSVCB(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *KEY) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Flags, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Protocol, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *KX) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Exchanger, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *L32) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Locator32, off, err = unpackDataA(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *L64) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Locator64, off, err = unpackUint64(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *LOC) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Version, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Size, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.HorizPre, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.VertPre, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Latitude, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Longitude, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Altitude, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *LP) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Fqdn, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MB) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Mb, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MD) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Md, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MF) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Mf, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MG) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Mg, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MINFO) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Rmail, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Email, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MR) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Mr, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *MX) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Mx, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NAPTR) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Order, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Flags, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Service, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Regexp, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Replacement, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NID) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.NodeID, off, err = unpackUint64(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NIMLOC) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Locator, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NINFO) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.ZSData, off, err = unpackStringTxt(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NS) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Ns, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NSAPPTR) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Ptr, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NSEC) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.NextDomain, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.TypeBitMap, off, err = unpackDataNsec(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NSEC3) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Hash, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Flags, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Iterations, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.SaltLength, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Salt, off, err = unpackStringHex(msg, off, off+int(rr.SaltLength)) - if err != nil { - return off, err - } - rr.HashLength, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.NextDomain, off, err = unpackStringBase32(msg, off, off+int(rr.HashLength)) - if err != nil { - return off, err - } - rr.TypeBitMap, off, err = unpackDataNsec(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NSEC3PARAM) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Hash, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Flags, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Iterations, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.SaltLength, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Salt, off, err = unpackStringHex(msg, off, off+int(rr.SaltLength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *NULL) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Data, off, err = unpackStringAny(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *OPENPGPKEY) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *OPT) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Option, off, err = unpackDataOpt(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *PTR) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Ptr, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *PX) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Map822, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Mapx400, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RFC3597) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Rdata, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RKEY) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Flags, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Protocol, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RP) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Mbox, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Txt, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RRSIG) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.TypeCovered, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Labels, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.OrigTtl, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Expiration, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Inception, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.SignerName, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Signature, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *RT) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Preference, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Host, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SIG) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.TypeCovered, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Labels, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.OrigTtl, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Expiration, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Inception, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.SignerName, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Signature, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SMIMEA) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Usage, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Selector, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.MatchingType, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Certificate, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SOA) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Ns, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Mbox, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Serial, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Refresh, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Retry, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Expire, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Minttl, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SPF) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Txt, off, err = unpackStringTxt(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SRV) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Priority, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Weight, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Port, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Target, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SSHFP) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Type, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.FingerPrint, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *SVCB) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Priority, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Target, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Value, off, err = unpackDataSVCB(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TA) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.KeyTag, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Algorithm, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.DigestType, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TALINK) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.PreviousName, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.NextName, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TKEY) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Algorithm, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Inception, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Expiration, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Mode, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Error, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.KeySize, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Key, off, err = unpackStringHex(msg, off, off+int(rr.KeySize)) - if err != nil { - return off, err - } - rr.OtherLen, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.OtherData, off, err = unpackStringHex(msg, off, off+int(rr.OtherLen)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TLSA) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Usage, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Selector, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.MatchingType, off, err = unpackUint8(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Certificate, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TSIG) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Algorithm, off, err = UnpackDomainName(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.TimeSigned, off, err = unpackUint48(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Fudge, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.MACSize, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.MAC, off, err = unpackStringHex(msg, off, off+int(rr.MACSize)) - if err != nil { - return off, err - } - rr.OrigId, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Error, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.OtherLen, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.OtherData, off, err = unpackStringHex(msg, off, off+int(rr.OtherLen)) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *TXT) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Txt, off, err = unpackStringTxt(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *UID) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Uid, off, err = unpackUint32(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *UINFO) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Uinfo, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *URI) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.Priority, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Weight, off, err = unpackUint16(msg, off) - if err != nil { - return off, err - } - if off == len(msg) { - return off, nil - } - rr.Target, off, err = unpackStringOctet(msg, off) - if err != nil { - return off, err - } - return off, nil -} - -func (rr *X25) unpack(msg []byte, off int) (off1 int, err error) { - rdStart := off - _ = rdStart - - rr.PSDNAddress, off, err = unpackString(msg, off) - if err != nil { - return off, err - } - return off, nil -} diff --git a/cluster-autoscaler/vendor/github.com/miekg/dns/ztypes.go b/cluster-autoscaler/vendor/github.com/miekg/dns/ztypes.go deleted file mode 100644 index 11b51bf21710..000000000000 --- a/cluster-autoscaler/vendor/github.com/miekg/dns/ztypes.go +++ /dev/null @@ -1,938 +0,0 @@ -// Code generated by "go run types_generate.go"; DO NOT EDIT. - -package dns - -import ( - "encoding/base64" - "net" -) - -// TypeToRR is a map of constructors for each RR type. -var TypeToRR = map[uint16]func() RR{ - TypeA: func() RR { return new(A) }, - TypeAAAA: func() RR { return new(AAAA) }, - TypeAFSDB: func() RR { return new(AFSDB) }, - TypeANY: func() RR { return new(ANY) }, - TypeAPL: func() RR { return new(APL) }, - TypeAVC: func() RR { return new(AVC) }, - TypeCAA: func() RR { return new(CAA) }, - TypeCDNSKEY: func() RR { return new(CDNSKEY) }, - TypeCDS: func() RR { return new(CDS) }, - TypeCERT: func() RR { return new(CERT) }, - TypeCNAME: func() RR { return new(CNAME) }, - TypeCSYNC: func() RR { return new(CSYNC) }, - TypeDHCID: func() RR { return new(DHCID) }, - TypeDLV: func() RR { return new(DLV) }, - TypeDNAME: func() RR { return new(DNAME) }, - TypeDNSKEY: func() RR { return new(DNSKEY) }, - TypeDS: func() RR { return new(DS) }, - TypeEID: func() RR { return new(EID) }, - TypeEUI48: func() RR { return new(EUI48) }, - TypeEUI64: func() RR { return new(EUI64) }, - TypeGID: func() RR { return new(GID) }, - TypeGPOS: func() RR { return new(GPOS) }, - TypeHINFO: func() RR { return new(HINFO) }, - TypeHIP: func() RR { return new(HIP) }, - TypeHTTPS: func() RR { return new(HTTPS) }, - TypeKEY: func() RR { return new(KEY) }, - TypeKX: func() RR { return new(KX) }, - TypeL32: func() RR { return new(L32) }, - TypeL64: func() RR { return new(L64) }, - TypeLOC: func() RR { return new(LOC) }, - TypeLP: func() RR { return new(LP) }, - TypeMB: func() RR { return new(MB) }, - TypeMD: func() RR { return new(MD) }, - TypeMF: func() RR { return new(MF) }, - TypeMG: func() RR { return new(MG) }, - TypeMINFO: func() RR { return new(MINFO) }, - TypeMR: func() RR { return new(MR) }, - TypeMX: func() RR { return new(MX) }, - TypeNAPTR: func() RR { return new(NAPTR) }, - TypeNID: func() RR { return new(NID) }, - TypeNIMLOC: func() RR { return new(NIMLOC) }, - TypeNINFO: func() RR { return new(NINFO) }, - TypeNS: func() RR { return new(NS) }, - TypeNSAPPTR: func() RR { return new(NSAPPTR) }, - TypeNSEC: func() RR { return new(NSEC) }, - TypeNSEC3: func() RR { return new(NSEC3) }, - TypeNSEC3PARAM: func() RR { return new(NSEC3PARAM) }, - TypeNULL: func() RR { return new(NULL) }, - TypeOPENPGPKEY: func() RR { return new(OPENPGPKEY) }, - TypeOPT: func() RR { return new(OPT) }, - TypePTR: func() RR { return new(PTR) }, - TypePX: func() RR { return new(PX) }, - TypeRKEY: func() RR { return new(RKEY) }, - TypeRP: func() RR { return new(RP) }, - TypeRRSIG: func() RR { return new(RRSIG) }, - TypeRT: func() RR { return new(RT) }, - TypeSIG: func() RR { return new(SIG) }, - TypeSMIMEA: func() RR { return new(SMIMEA) }, - TypeSOA: func() RR { return new(SOA) }, - TypeSPF: func() RR { return new(SPF) }, - TypeSRV: func() RR { return new(SRV) }, - TypeSSHFP: func() RR { return new(SSHFP) }, - TypeSVCB: func() RR { return new(SVCB) }, - TypeTA: func() RR { return new(TA) }, - TypeTALINK: func() RR { return new(TALINK) }, - TypeTKEY: func() RR { return new(TKEY) }, - TypeTLSA: func() RR { return new(TLSA) }, - TypeTSIG: func() RR { return new(TSIG) }, - TypeTXT: func() RR { return new(TXT) }, - TypeUID: func() RR { return new(UID) }, - TypeUINFO: func() RR { return new(UINFO) }, - TypeURI: func() RR { return new(URI) }, - TypeX25: func() RR { return new(X25) }, -} - -// TypeToString is a map of strings for each RR type. -var TypeToString = map[uint16]string{ - TypeA: "A", - TypeAAAA: "AAAA", - TypeAFSDB: "AFSDB", - TypeANY: "ANY", - TypeAPL: "APL", - TypeATMA: "ATMA", - TypeAVC: "AVC", - TypeAXFR: "AXFR", - TypeCAA: "CAA", - TypeCDNSKEY: "CDNSKEY", - TypeCDS: "CDS", - TypeCERT: "CERT", - TypeCNAME: "CNAME", - TypeCSYNC: "CSYNC", - TypeDHCID: "DHCID", - TypeDLV: "DLV", - TypeDNAME: "DNAME", - TypeDNSKEY: "DNSKEY", - TypeDS: "DS", - TypeEID: "EID", - TypeEUI48: "EUI48", - TypeEUI64: "EUI64", - TypeGID: "GID", - TypeGPOS: "GPOS", - TypeHINFO: "HINFO", - TypeHIP: "HIP", - TypeHTTPS: "HTTPS", - TypeISDN: "ISDN", - TypeIXFR: "IXFR", - TypeKEY: "KEY", - TypeKX: "KX", - TypeL32: "L32", - TypeL64: "L64", - TypeLOC: "LOC", - TypeLP: "LP", - TypeMAILA: "MAILA", - TypeMAILB: "MAILB", - TypeMB: "MB", - TypeMD: "MD", - TypeMF: "MF", - TypeMG: "MG", - TypeMINFO: "MINFO", - TypeMR: "MR", - TypeMX: "MX", - TypeNAPTR: "NAPTR", - TypeNID: "NID", - TypeNIMLOC: "NIMLOC", - TypeNINFO: "NINFO", - TypeNS: "NS", - TypeNSEC: "NSEC", - TypeNSEC3: "NSEC3", - TypeNSEC3PARAM: "NSEC3PARAM", - TypeNULL: "NULL", - TypeNXT: "NXT", - TypeNone: "None", - TypeOPENPGPKEY: "OPENPGPKEY", - TypeOPT: "OPT", - TypePTR: "PTR", - TypePX: "PX", - TypeRKEY: "RKEY", - TypeRP: "RP", - TypeRRSIG: "RRSIG", - TypeRT: "RT", - TypeReserved: "Reserved", - TypeSIG: "SIG", - TypeSMIMEA: "SMIMEA", - TypeSOA: "SOA", - TypeSPF: "SPF", - TypeSRV: "SRV", - TypeSSHFP: "SSHFP", - TypeSVCB: "SVCB", - TypeTA: "TA", - TypeTALINK: "TALINK", - TypeTKEY: "TKEY", - TypeTLSA: "TLSA", - TypeTSIG: "TSIG", - TypeTXT: "TXT", - TypeUID: "UID", - TypeUINFO: "UINFO", - TypeUNSPEC: "UNSPEC", - TypeURI: "URI", - TypeX25: "X25", - TypeNSAPPTR: "NSAP-PTR", -} - -func (rr *A) Header() *RR_Header { return &rr.Hdr } -func (rr *AAAA) Header() *RR_Header { return &rr.Hdr } -func (rr *AFSDB) Header() *RR_Header { return &rr.Hdr } -func (rr *ANY) Header() *RR_Header { return &rr.Hdr } -func (rr *APL) Header() *RR_Header { return &rr.Hdr } -func (rr *AVC) Header() *RR_Header { return &rr.Hdr } -func (rr *CAA) Header() *RR_Header { return &rr.Hdr } -func (rr *CDNSKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *CDS) Header() *RR_Header { return &rr.Hdr } -func (rr *CERT) Header() *RR_Header { return &rr.Hdr } -func (rr *CNAME) Header() *RR_Header { return &rr.Hdr } -func (rr *CSYNC) Header() *RR_Header { return &rr.Hdr } -func (rr *DHCID) Header() *RR_Header { return &rr.Hdr } -func (rr *DLV) Header() *RR_Header { return &rr.Hdr } -func (rr *DNAME) Header() *RR_Header { return &rr.Hdr } -func (rr *DNSKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *DS) Header() *RR_Header { return &rr.Hdr } -func (rr *EID) Header() *RR_Header { return &rr.Hdr } -func (rr *EUI48) Header() *RR_Header { return &rr.Hdr } -func (rr *EUI64) Header() *RR_Header { return &rr.Hdr } -func (rr *GID) Header() *RR_Header { return &rr.Hdr } -func (rr *GPOS) Header() *RR_Header { return &rr.Hdr } -func (rr *HINFO) Header() *RR_Header { return &rr.Hdr } -func (rr *HIP) Header() *RR_Header { return &rr.Hdr } -func (rr *HTTPS) Header() *RR_Header { return &rr.Hdr } -func (rr *KEY) Header() *RR_Header { return &rr.Hdr } -func (rr *KX) Header() *RR_Header { return &rr.Hdr } -func (rr *L32) Header() *RR_Header { return &rr.Hdr } -func (rr *L64) Header() *RR_Header { return &rr.Hdr } -func (rr *LOC) Header() *RR_Header { return &rr.Hdr } -func (rr *LP) Header() *RR_Header { return &rr.Hdr } -func (rr *MB) Header() *RR_Header { return &rr.Hdr } -func (rr *MD) Header() *RR_Header { return &rr.Hdr } -func (rr *MF) Header() *RR_Header { return &rr.Hdr } -func (rr *MG) Header() *RR_Header { return &rr.Hdr } -func (rr *MINFO) Header() *RR_Header { return &rr.Hdr } -func (rr *MR) Header() *RR_Header { return &rr.Hdr } -func (rr *MX) Header() *RR_Header { return &rr.Hdr } -func (rr *NAPTR) Header() *RR_Header { return &rr.Hdr } -func (rr *NID) Header() *RR_Header { return &rr.Hdr } -func (rr *NIMLOC) Header() *RR_Header { return &rr.Hdr } -func (rr *NINFO) Header() *RR_Header { return &rr.Hdr } -func (rr *NS) Header() *RR_Header { return &rr.Hdr } -func (rr *NSAPPTR) Header() *RR_Header { return &rr.Hdr } -func (rr *NSEC) Header() *RR_Header { return &rr.Hdr } -func (rr *NSEC3) Header() *RR_Header { return &rr.Hdr } -func (rr *NSEC3PARAM) Header() *RR_Header { return &rr.Hdr } -func (rr *NULL) Header() *RR_Header { return &rr.Hdr } -func (rr *OPENPGPKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *OPT) Header() *RR_Header { return &rr.Hdr } -func (rr *PTR) Header() *RR_Header { return &rr.Hdr } -func (rr *PX) Header() *RR_Header { return &rr.Hdr } -func (rr *RFC3597) Header() *RR_Header { return &rr.Hdr } -func (rr *RKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *RP) Header() *RR_Header { return &rr.Hdr } -func (rr *RRSIG) Header() *RR_Header { return &rr.Hdr } -func (rr *RT) Header() *RR_Header { return &rr.Hdr } -func (rr *SIG) Header() *RR_Header { return &rr.Hdr } -func (rr *SMIMEA) Header() *RR_Header { return &rr.Hdr } -func (rr *SOA) Header() *RR_Header { return &rr.Hdr } -func (rr *SPF) Header() *RR_Header { return &rr.Hdr } -func (rr *SRV) Header() *RR_Header { return &rr.Hdr } -func (rr *SSHFP) Header() *RR_Header { return &rr.Hdr } -func (rr *SVCB) Header() *RR_Header { return &rr.Hdr } -func (rr *TA) Header() *RR_Header { return &rr.Hdr } -func (rr *TALINK) Header() *RR_Header { return &rr.Hdr } -func (rr *TKEY) Header() *RR_Header { return &rr.Hdr } -func (rr *TLSA) Header() *RR_Header { return &rr.Hdr } -func (rr *TSIG) Header() *RR_Header { return &rr.Hdr } -func (rr *TXT) Header() *RR_Header { return &rr.Hdr } -func (rr *UID) Header() *RR_Header { return &rr.Hdr } -func (rr *UINFO) Header() *RR_Header { return &rr.Hdr } -func (rr *URI) Header() *RR_Header { return &rr.Hdr } -func (rr *X25) Header() *RR_Header { return &rr.Hdr } - -// len() functions -func (rr *A) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - if len(rr.A) != 0 { - l += net.IPv4len - } - return l -} -func (rr *AAAA) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - if len(rr.AAAA) != 0 { - l += net.IPv6len - } - return l -} -func (rr *AFSDB) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Subtype - l += domainNameLen(rr.Hostname, off+l, compression, false) - return l -} -func (rr *ANY) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - return l -} -func (rr *APL) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - for _, x := range rr.Prefixes { - l += x.len() - } - return l -} -func (rr *AVC) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - for _, x := range rr.Txt { - l += len(x) + 1 - } - return l -} -func (rr *CAA) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l++ // Flag - l += len(rr.Tag) + 1 - l += len(rr.Value) - return l -} -func (rr *CERT) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Type - l += 2 // KeyTag - l++ // Algorithm - l += base64.StdEncoding.DecodedLen(len(rr.Certificate)) - return l -} -func (rr *CNAME) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Target, off+l, compression, true) - return l -} -func (rr *DHCID) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += base64.StdEncoding.DecodedLen(len(rr.Digest)) - return l -} -func (rr *DNAME) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Target, off+l, compression, false) - return l -} -func (rr *DNSKEY) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Flags - l++ // Protocol - l++ // Algorithm - l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) - return l -} -func (rr *DS) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // KeyTag - l++ // Algorithm - l++ // DigestType - l += len(rr.Digest) / 2 - return l -} -func (rr *EID) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += len(rr.Endpoint) / 2 - return l -} -func (rr *EUI48) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 6 // Address - return l -} -func (rr *EUI64) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 8 // Address - return l -} -func (rr *GID) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 4 // Gid - return l -} -func (rr *GPOS) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += len(rr.Longitude) + 1 - l += len(rr.Latitude) + 1 - l += len(rr.Altitude) + 1 - return l -} -func (rr *HINFO) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += len(rr.Cpu) + 1 - l += len(rr.Os) + 1 - return l -} -func (rr *HIP) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l++ // HitLength - l++ // PublicKeyAlgorithm - l += 2 // PublicKeyLength - l += len(rr.Hit) / 2 - l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) - for _, x := range rr.RendezvousServers { - l += domainNameLen(x, off+l, compression, false) - } - return l -} -func (rr *KX) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Preference - l += domainNameLen(rr.Exchanger, off+l, compression, false) - return l -} -func (rr *L32) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Preference - if len(rr.Locator32) != 0 { - l += net.IPv4len - } - return l -} -func (rr *L64) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Preference - l += 8 // Locator64 - return l -} -func (rr *LOC) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l++ // Version - l++ // Size - l++ // HorizPre - l++ // VertPre - l += 4 // Latitude - l += 4 // Longitude - l += 4 // Altitude - return l -} -func (rr *LP) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Preference - l += domainNameLen(rr.Fqdn, off+l, compression, false) - return l -} -func (rr *MB) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Mb, off+l, compression, true) - return l -} -func (rr *MD) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Md, off+l, compression, true) - return l -} -func (rr *MF) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Mf, off+l, compression, true) - return l -} -func (rr *MG) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Mg, off+l, compression, true) - return l -} -func (rr *MINFO) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Rmail, off+l, compression, true) - l += domainNameLen(rr.Email, off+l, compression, true) - return l -} -func (rr *MR) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Mr, off+l, compression, true) - return l -} -func (rr *MX) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Preference - l += domainNameLen(rr.Mx, off+l, compression, true) - return l -} -func (rr *NAPTR) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Order - l += 2 // Preference - l += len(rr.Flags) + 1 - l += len(rr.Service) + 1 - l += len(rr.Regexp) + 1 - l += domainNameLen(rr.Replacement, off+l, compression, false) - return l -} -func (rr *NID) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Preference - l += 8 // NodeID - return l -} -func (rr *NIMLOC) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += len(rr.Locator) / 2 - return l -} -func (rr *NINFO) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - for _, x := range rr.ZSData { - l += len(x) + 1 - } - return l -} -func (rr *NS) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Ns, off+l, compression, true) - return l -} -func (rr *NSAPPTR) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Ptr, off+l, compression, false) - return l -} -func (rr *NSEC3PARAM) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l++ // Hash - l++ // Flags - l += 2 // Iterations - l++ // SaltLength - l += len(rr.Salt) / 2 - return l -} -func (rr *NULL) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += len(rr.Data) - return l -} -func (rr *OPENPGPKEY) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) - return l -} -func (rr *PTR) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Ptr, off+l, compression, true) - return l -} -func (rr *PX) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Preference - l += domainNameLen(rr.Map822, off+l, compression, false) - l += domainNameLen(rr.Mapx400, off+l, compression, false) - return l -} -func (rr *RFC3597) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += len(rr.Rdata) / 2 - return l -} -func (rr *RKEY) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Flags - l++ // Protocol - l++ // Algorithm - l += base64.StdEncoding.DecodedLen(len(rr.PublicKey)) - return l -} -func (rr *RP) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Mbox, off+l, compression, false) - l += domainNameLen(rr.Txt, off+l, compression, false) - return l -} -func (rr *RRSIG) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // TypeCovered - l++ // Algorithm - l++ // Labels - l += 4 // OrigTtl - l += 4 // Expiration - l += 4 // Inception - l += 2 // KeyTag - l += domainNameLen(rr.SignerName, off+l, compression, false) - l += base64.StdEncoding.DecodedLen(len(rr.Signature)) - return l -} -func (rr *RT) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Preference - l += domainNameLen(rr.Host, off+l, compression, false) - return l -} -func (rr *SMIMEA) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l++ // Usage - l++ // Selector - l++ // MatchingType - l += len(rr.Certificate) / 2 - return l -} -func (rr *SOA) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Ns, off+l, compression, true) - l += domainNameLen(rr.Mbox, off+l, compression, true) - l += 4 // Serial - l += 4 // Refresh - l += 4 // Retry - l += 4 // Expire - l += 4 // Minttl - return l -} -func (rr *SPF) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - for _, x := range rr.Txt { - l += len(x) + 1 - } - return l -} -func (rr *SRV) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Priority - l += 2 // Weight - l += 2 // Port - l += domainNameLen(rr.Target, off+l, compression, false) - return l -} -func (rr *SSHFP) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l++ // Algorithm - l++ // Type - l += len(rr.FingerPrint) / 2 - return l -} -func (rr *SVCB) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Priority - l += domainNameLen(rr.Target, off+l, compression, false) - for _, x := range rr.Value { - l += 4 + int(x.len()) - } - return l -} -func (rr *TA) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // KeyTag - l++ // Algorithm - l++ // DigestType - l += len(rr.Digest) / 2 - return l -} -func (rr *TALINK) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.PreviousName, off+l, compression, false) - l += domainNameLen(rr.NextName, off+l, compression, false) - return l -} -func (rr *TKEY) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Algorithm, off+l, compression, false) - l += 4 // Inception - l += 4 // Expiration - l += 2 // Mode - l += 2 // Error - l += 2 // KeySize - l += len(rr.Key) / 2 - l += 2 // OtherLen - l += len(rr.OtherData) / 2 - return l -} -func (rr *TLSA) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l++ // Usage - l++ // Selector - l++ // MatchingType - l += len(rr.Certificate) / 2 - return l -} -func (rr *TSIG) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += domainNameLen(rr.Algorithm, off+l, compression, false) - l += 6 // TimeSigned - l += 2 // Fudge - l += 2 // MACSize - l += len(rr.MAC) / 2 - l += 2 // OrigId - l += 2 // Error - l += 2 // OtherLen - l += len(rr.OtherData) / 2 - return l -} -func (rr *TXT) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - for _, x := range rr.Txt { - l += len(x) + 1 - } - return l -} -func (rr *UID) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 4 // Uid - return l -} -func (rr *UINFO) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += len(rr.Uinfo) + 1 - return l -} -func (rr *URI) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += 2 // Priority - l += 2 // Weight - l += len(rr.Target) - return l -} -func (rr *X25) len(off int, compression map[string]struct{}) int { - l := rr.Hdr.len(off, compression) - l += len(rr.PSDNAddress) + 1 - return l -} - -// copy() functions -func (rr *A) copy() RR { - return &A{rr.Hdr, copyIP(rr.A)} -} -func (rr *AAAA) copy() RR { - return &AAAA{rr.Hdr, copyIP(rr.AAAA)} -} -func (rr *AFSDB) copy() RR { - return &AFSDB{rr.Hdr, rr.Subtype, rr.Hostname} -} -func (rr *ANY) copy() RR { - return &ANY{rr.Hdr} -} -func (rr *APL) copy() RR { - Prefixes := make([]APLPrefix, len(rr.Prefixes)) - for i, e := range rr.Prefixes { - Prefixes[i] = e.copy() - } - return &APL{rr.Hdr, Prefixes} -} -func (rr *AVC) copy() RR { - Txt := make([]string, len(rr.Txt)) - copy(Txt, rr.Txt) - return &AVC{rr.Hdr, Txt} -} -func (rr *CAA) copy() RR { - return &CAA{rr.Hdr, rr.Flag, rr.Tag, rr.Value} -} -func (rr *CDNSKEY) copy() RR { - return &CDNSKEY{*rr.DNSKEY.copy().(*DNSKEY)} -} -func (rr *CDS) copy() RR { - return &CDS{*rr.DS.copy().(*DS)} -} -func (rr *CERT) copy() RR { - return &CERT{rr.Hdr, rr.Type, rr.KeyTag, rr.Algorithm, rr.Certificate} -} -func (rr *CNAME) copy() RR { - return &CNAME{rr.Hdr, rr.Target} -} -func (rr *CSYNC) copy() RR { - TypeBitMap := make([]uint16, len(rr.TypeBitMap)) - copy(TypeBitMap, rr.TypeBitMap) - return &CSYNC{rr.Hdr, rr.Serial, rr.Flags, TypeBitMap} -} -func (rr *DHCID) copy() RR { - return &DHCID{rr.Hdr, rr.Digest} -} -func (rr *DLV) copy() RR { - return &DLV{*rr.DS.copy().(*DS)} -} -func (rr *DNAME) copy() RR { - return &DNAME{rr.Hdr, rr.Target} -} -func (rr *DNSKEY) copy() RR { - return &DNSKEY{rr.Hdr, rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey} -} -func (rr *DS) copy() RR { - return &DS{rr.Hdr, rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest} -} -func (rr *EID) copy() RR { - return &EID{rr.Hdr, rr.Endpoint} -} -func (rr *EUI48) copy() RR { - return &EUI48{rr.Hdr, rr.Address} -} -func (rr *EUI64) copy() RR { - return &EUI64{rr.Hdr, rr.Address} -} -func (rr *GID) copy() RR { - return &GID{rr.Hdr, rr.Gid} -} -func (rr *GPOS) copy() RR { - return &GPOS{rr.Hdr, rr.Longitude, rr.Latitude, rr.Altitude} -} -func (rr *HINFO) copy() RR { - return &HINFO{rr.Hdr, rr.Cpu, rr.Os} -} -func (rr *HIP) copy() RR { - RendezvousServers := make([]string, len(rr.RendezvousServers)) - copy(RendezvousServers, rr.RendezvousServers) - return &HIP{rr.Hdr, rr.HitLength, rr.PublicKeyAlgorithm, rr.PublicKeyLength, rr.Hit, rr.PublicKey, RendezvousServers} -} -func (rr *HTTPS) copy() RR { - return &HTTPS{*rr.SVCB.copy().(*SVCB)} -} -func (rr *KEY) copy() RR { - return &KEY{*rr.DNSKEY.copy().(*DNSKEY)} -} -func (rr *KX) copy() RR { - return &KX{rr.Hdr, rr.Preference, rr.Exchanger} -} -func (rr *L32) copy() RR { - return &L32{rr.Hdr, rr.Preference, copyIP(rr.Locator32)} -} -func (rr *L64) copy() RR { - return &L64{rr.Hdr, rr.Preference, rr.Locator64} -} -func (rr *LOC) copy() RR { - return &LOC{rr.Hdr, rr.Version, rr.Size, rr.HorizPre, rr.VertPre, rr.Latitude, rr.Longitude, rr.Altitude} -} -func (rr *LP) copy() RR { - return &LP{rr.Hdr, rr.Preference, rr.Fqdn} -} -func (rr *MB) copy() RR { - return &MB{rr.Hdr, rr.Mb} -} -func (rr *MD) copy() RR { - return &MD{rr.Hdr, rr.Md} -} -func (rr *MF) copy() RR { - return &MF{rr.Hdr, rr.Mf} -} -func (rr *MG) copy() RR { - return &MG{rr.Hdr, rr.Mg} -} -func (rr *MINFO) copy() RR { - return &MINFO{rr.Hdr, rr.Rmail, rr.Email} -} -func (rr *MR) copy() RR { - return &MR{rr.Hdr, rr.Mr} -} -func (rr *MX) copy() RR { - return &MX{rr.Hdr, rr.Preference, rr.Mx} -} -func (rr *NAPTR) copy() RR { - return &NAPTR{rr.Hdr, rr.Order, rr.Preference, rr.Flags, rr.Service, rr.Regexp, rr.Replacement} -} -func (rr *NID) copy() RR { - return &NID{rr.Hdr, rr.Preference, rr.NodeID} -} -func (rr *NIMLOC) copy() RR { - return &NIMLOC{rr.Hdr, rr.Locator} -} -func (rr *NINFO) copy() RR { - ZSData := make([]string, len(rr.ZSData)) - copy(ZSData, rr.ZSData) - return &NINFO{rr.Hdr, ZSData} -} -func (rr *NS) copy() RR { - return &NS{rr.Hdr, rr.Ns} -} -func (rr *NSAPPTR) copy() RR { - return &NSAPPTR{rr.Hdr, rr.Ptr} -} -func (rr *NSEC) copy() RR { - TypeBitMap := make([]uint16, len(rr.TypeBitMap)) - copy(TypeBitMap, rr.TypeBitMap) - return &NSEC{rr.Hdr, rr.NextDomain, TypeBitMap} -} -func (rr *NSEC3) copy() RR { - TypeBitMap := make([]uint16, len(rr.TypeBitMap)) - copy(TypeBitMap, rr.TypeBitMap) - return &NSEC3{rr.Hdr, rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt, rr.HashLength, rr.NextDomain, TypeBitMap} -} -func (rr *NSEC3PARAM) copy() RR { - return &NSEC3PARAM{rr.Hdr, rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt} -} -func (rr *NULL) copy() RR { - return &NULL{rr.Hdr, rr.Data} -} -func (rr *OPENPGPKEY) copy() RR { - return &OPENPGPKEY{rr.Hdr, rr.PublicKey} -} -func (rr *OPT) copy() RR { - Option := make([]EDNS0, len(rr.Option)) - for i, e := range rr.Option { - Option[i] = e.copy() - } - return &OPT{rr.Hdr, Option} -} -func (rr *PTR) copy() RR { - return &PTR{rr.Hdr, rr.Ptr} -} -func (rr *PX) copy() RR { - return &PX{rr.Hdr, rr.Preference, rr.Map822, rr.Mapx400} -} -func (rr *RFC3597) copy() RR { - return &RFC3597{rr.Hdr, rr.Rdata} -} -func (rr *RKEY) copy() RR { - return &RKEY{rr.Hdr, rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey} -} -func (rr *RP) copy() RR { - return &RP{rr.Hdr, rr.Mbox, rr.Txt} -} -func (rr *RRSIG) copy() RR { - return &RRSIG{rr.Hdr, rr.TypeCovered, rr.Algorithm, rr.Labels, rr.OrigTtl, rr.Expiration, rr.Inception, rr.KeyTag, rr.SignerName, rr.Signature} -} -func (rr *RT) copy() RR { - return &RT{rr.Hdr, rr.Preference, rr.Host} -} -func (rr *SIG) copy() RR { - return &SIG{*rr.RRSIG.copy().(*RRSIG)} -} -func (rr *SMIMEA) copy() RR { - return &SMIMEA{rr.Hdr, rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate} -} -func (rr *SOA) copy() RR { - return &SOA{rr.Hdr, rr.Ns, rr.Mbox, rr.Serial, rr.Refresh, rr.Retry, rr.Expire, rr.Minttl} -} -func (rr *SPF) copy() RR { - Txt := make([]string, len(rr.Txt)) - copy(Txt, rr.Txt) - return &SPF{rr.Hdr, Txt} -} -func (rr *SRV) copy() RR { - return &SRV{rr.Hdr, rr.Priority, rr.Weight, rr.Port, rr.Target} -} -func (rr *SSHFP) copy() RR { - return &SSHFP{rr.Hdr, rr.Algorithm, rr.Type, rr.FingerPrint} -} -func (rr *SVCB) copy() RR { - Value := make([]SVCBKeyValue, len(rr.Value)) - for i, e := range rr.Value { - Value[i] = e.copy() - } - return &SVCB{rr.Hdr, rr.Priority, rr.Target, Value} -} -func (rr *TA) copy() RR { - return &TA{rr.Hdr, rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest} -} -func (rr *TALINK) copy() RR { - return &TALINK{rr.Hdr, rr.PreviousName, rr.NextName} -} -func (rr *TKEY) copy() RR { - return &TKEY{rr.Hdr, rr.Algorithm, rr.Inception, rr.Expiration, rr.Mode, rr.Error, rr.KeySize, rr.Key, rr.OtherLen, rr.OtherData} -} -func (rr *TLSA) copy() RR { - return &TLSA{rr.Hdr, rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate} -} -func (rr *TSIG) copy() RR { - return &TSIG{rr.Hdr, rr.Algorithm, rr.TimeSigned, rr.Fudge, rr.MACSize, rr.MAC, rr.OrigId, rr.Error, rr.OtherLen, rr.OtherData} -} -func (rr *TXT) copy() RR { - Txt := make([]string, len(rr.Txt)) - copy(Txt, rr.Txt) - return &TXT{rr.Hdr, Txt} -} -func (rr *UID) copy() RR { - return &UID{rr.Hdr, rr.Uid} -} -func (rr *UINFO) copy() RR { - return &UINFO{rr.Hdr, rr.Uinfo} -} -func (rr *URI) copy() RR { - return &URI{rr.Hdr, rr.Priority, rr.Weight, rr.Target} -} -func (rr *X25) copy() RR { - return &X25{rr.Hdr, rr.PSDNAddress} -} diff --git a/cluster-autoscaler/vendor/github.com/moby/term/go.mod b/cluster-autoscaler/vendor/github.com/moby/term/go.mod index f453204333a8..25cef43781a4 100644 --- a/cluster-autoscaler/vendor/github.com/moby/term/go.mod +++ b/cluster-autoscaler/vendor/github.com/moby/term/go.mod @@ -3,7 +3,7 @@ module github.com/moby/term go 1.13 require ( - github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 + github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795 github.com/creack/pty v1.1.11 github.com/google/go-cmp v0.4.0 github.com/pkg/errors v0.9.1 // indirect diff --git a/cluster-autoscaler/vendor/github.com/moby/term/go.sum b/cluster-autoscaler/vendor/github.com/moby/term/go.sum index 441e06137acd..deeff00ee7a3 100644 --- a/cluster-autoscaler/vendor/github.com/moby/term/go.sum +++ b/cluster-autoscaler/vendor/github.com/moby/term/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795 h1:q4kDoSrHgRoD6okimjwWJOVKyxEUNS2JIuwt+EqcIqQ= +github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/build_info.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/build_info.go deleted file mode 100644 index 288f0e854885..000000000000 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/build_info.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2019 The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build go1.12 - -package prometheus - -import "runtime/debug" - -// readBuildInfo is a wrapper around debug.ReadBuildInfo for Go 1.12+. -func readBuildInfo() (path, version, sum string) { - path, version, sum = "unknown", "unknown", "unknown" - if bi, ok := debug.ReadBuildInfo(); ok { - path = bi.Main.Path - version = bi.Main.Version - sum = bi.Main.Sum - } - return -} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/counter.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/counter.go index 0e1b48c03f14..3f8fd790d66a 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/counter.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/counter.go @@ -163,7 +163,7 @@ func (c *counter) updateExemplar(v float64, l Labels) { // (e.g. number of HTTP requests, partitioned by response code and // method). Create instances with NewCounterVec. type CounterVec struct { - *metricVec + *MetricVec } // NewCounterVec creates a new CounterVec based on the provided CounterOpts and @@ -176,11 +176,11 @@ func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec { opts.ConstLabels, ) return &CounterVec{ - metricVec: newMetricVec(desc, func(lvs ...string) Metric { + MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { if len(lvs) != len(desc.variableLabels) { panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, lvs)) } - result := &counter{desc: desc, labelPairs: makeLabelPairs(desc, lvs), now: time.Now} + result := &counter{desc: desc, labelPairs: MakeLabelPairs(desc, lvs), now: time.Now} result.init(result) // Init self-collection. return result }), @@ -188,7 +188,7 @@ func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec { } // GetMetricWithLabelValues returns the Counter for the given slice of label -// values (same order as the VariableLabels in Desc). If that combination of +// values (same order as the variable labels in Desc). If that combination of // label values is accessed for the first time, a new Counter is created. // // It is possible to call this method without using the returned Counter to only @@ -202,7 +202,7 @@ func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec { // Counter with the same label values is created later. // // An error is returned if the number of label values is not the same as the -// number of VariableLabels in Desc (minus any curried labels). +// number of variable labels in Desc (minus any curried labels). // // Note that for more than one label value, this method is prone to mistakes // caused by an incorrect order of arguments. Consider GetMetricWith(Labels) as @@ -211,7 +211,7 @@ func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec { // with a performance overhead (for creating and processing the Labels map). // See also the GaugeVec example. func (v *CounterVec) GetMetricWithLabelValues(lvs ...string) (Counter, error) { - metric, err := v.metricVec.getMetricWithLabelValues(lvs...) + metric, err := v.MetricVec.GetMetricWithLabelValues(lvs...) if metric != nil { return metric.(Counter), err } @@ -219,19 +219,19 @@ func (v *CounterVec) GetMetricWithLabelValues(lvs ...string) (Counter, error) { } // GetMetricWith returns the Counter for the given Labels map (the label names -// must match those of the VariableLabels in Desc). If that label map is +// must match those of the variable labels in Desc). If that label map is // accessed for the first time, a new Counter is created. Implications of // creating a Counter without using it and keeping the Counter for later use are // the same as for GetMetricWithLabelValues. // // An error is returned if the number and names of the Labels are inconsistent -// with those of the VariableLabels in Desc (minus any curried labels). +// with those of the variable labels in Desc (minus any curried labels). // // This method is used for the same purpose as // GetMetricWithLabelValues(...string). See there for pros and cons of the two // methods. func (v *CounterVec) GetMetricWith(labels Labels) (Counter, error) { - metric, err := v.metricVec.getMetricWith(labels) + metric, err := v.MetricVec.GetMetricWith(labels) if metric != nil { return metric.(Counter), err } @@ -275,7 +275,7 @@ func (v *CounterVec) With(labels Labels) Counter { // registered with a given registry (usually the uncurried version). The Reset // method deletes all metrics, even if called on a curried vector. func (v *CounterVec) CurryWith(labels Labels) (*CounterVec, error) { - vec, err := v.curryWith(labels) + vec, err := v.MetricVec.CurryWith(labels) if vec != nil { return &CounterVec{vec}, err } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/desc.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/desc.go index 2f19f5e1e7ea..4bb816ab75ac 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/desc.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/desc.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/cespare/xxhash/v2" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/prometheus/common/model" @@ -51,7 +51,7 @@ type Desc struct { // constLabelPairs contains precalculated DTO label pairs based on // the constant labels. constLabelPairs []*dto.LabelPair - // VariableLabels contains names of labels for which the metric + // variableLabels contains names of labels for which the metric // maintains variable values. variableLabels []string // id is a hash of the values of the ConstLabels and fqName. This diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go index 18a99d5faaa5..c41ab37f3bb9 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go @@ -22,43 +22,10 @@ type expvarCollector struct { exports map[string]*Desc } -// NewExpvarCollector returns a newly allocated expvar Collector that still has -// to be registered with a Prometheus registry. +// NewExpvarCollector is the obsolete version of collectors.NewExpvarCollector. +// See there for documentation. // -// An expvar Collector collects metrics from the expvar interface. It provides a -// quick way to expose numeric values that are already exported via expvar as -// Prometheus metrics. Note that the data models of expvar and Prometheus are -// fundamentally different, and that the expvar Collector is inherently slower -// than native Prometheus metrics. Thus, the expvar Collector is probably great -// for experiments and prototying, but you should seriously consider a more -// direct implementation of Prometheus metrics for monitoring production -// systems. -// -// The exports map has the following meaning: -// -// The keys in the map correspond to expvar keys, i.e. for every expvar key you -// want to export as Prometheus metric, you need an entry in the exports -// map. The descriptor mapped to each key describes how to export the expvar -// value. It defines the name and the help string of the Prometheus metric -// proxying the expvar value. The type will always be Untyped. -// -// For descriptors without variable labels, the expvar value must be a number or -// a bool. The number is then directly exported as the Prometheus sample -// value. (For a bool, 'false' translates to 0 and 'true' to 1). Expvar values -// that are not numbers or bools are silently ignored. -// -// If the descriptor has one variable label, the expvar value must be an expvar -// map. The keys in the expvar map become the various values of the one -// Prometheus label. The values in the expvar map must be numbers or bools again -// as above. -// -// For descriptors with more than one variable label, the expvar must be a -// nested expvar map, i.e. where the values of the topmost map are maps again -// etc. until a depth is reached that corresponds to the number of labels. The -// leaves of that structure must be numbers or bools as above to serve as the -// sample values. -// -// Anything that does not fit into the scheme above is silently ignored. +// Deprecated: Use collectors.NewExpvarCollector instead. func NewExpvarCollector(exports map[string]*Desc) Collector { return &expvarCollector{ exports: exports, diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/gauge.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/gauge.go index d67573f767a9..bd0733d6a7d6 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/gauge.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/gauge.go @@ -132,7 +132,7 @@ func (g *gauge) Write(out *dto.Metric) error { // (e.g. number of operations queued, partitioned by user and operation // type). Create instances with NewGaugeVec. type GaugeVec struct { - *metricVec + *MetricVec } // NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and @@ -145,11 +145,11 @@ func NewGaugeVec(opts GaugeOpts, labelNames []string) *GaugeVec { opts.ConstLabels, ) return &GaugeVec{ - metricVec: newMetricVec(desc, func(lvs ...string) Metric { + MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { if len(lvs) != len(desc.variableLabels) { panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, lvs)) } - result := &gauge{desc: desc, labelPairs: makeLabelPairs(desc, lvs)} + result := &gauge{desc: desc, labelPairs: MakeLabelPairs(desc, lvs)} result.init(result) // Init self-collection. return result }), @@ -157,7 +157,7 @@ func NewGaugeVec(opts GaugeOpts, labelNames []string) *GaugeVec { } // GetMetricWithLabelValues returns the Gauge for the given slice of label -// values (same order as the VariableLabels in Desc). If that combination of +// values (same order as the variable labels in Desc). If that combination of // label values is accessed for the first time, a new Gauge is created. // // It is possible to call this method without using the returned Gauge to only @@ -172,7 +172,7 @@ func NewGaugeVec(opts GaugeOpts, labelNames []string) *GaugeVec { // example. // // An error is returned if the number of label values is not the same as the -// number of VariableLabels in Desc (minus any curried labels). +// number of variable labels in Desc (minus any curried labels). // // Note that for more than one label value, this method is prone to mistakes // caused by an incorrect order of arguments. Consider GetMetricWith(Labels) as @@ -180,7 +180,7 @@ func NewGaugeVec(opts GaugeOpts, labelNames []string) *GaugeVec { // latter has a much more readable (albeit more verbose) syntax, but it comes // with a performance overhead (for creating and processing the Labels map). func (v *GaugeVec) GetMetricWithLabelValues(lvs ...string) (Gauge, error) { - metric, err := v.metricVec.getMetricWithLabelValues(lvs...) + metric, err := v.MetricVec.GetMetricWithLabelValues(lvs...) if metric != nil { return metric.(Gauge), err } @@ -188,19 +188,19 @@ func (v *GaugeVec) GetMetricWithLabelValues(lvs ...string) (Gauge, error) { } // GetMetricWith returns the Gauge for the given Labels map (the label names -// must match those of the VariableLabels in Desc). If that label map is +// must match those of the variable labels in Desc). If that label map is // accessed for the first time, a new Gauge is created. Implications of // creating a Gauge without using it and keeping the Gauge for later use are // the same as for GetMetricWithLabelValues. // // An error is returned if the number and names of the Labels are inconsistent -// with those of the VariableLabels in Desc (minus any curried labels). +// with those of the variable labels in Desc (minus any curried labels). // // This method is used for the same purpose as // GetMetricWithLabelValues(...string). See there for pros and cons of the two // methods. func (v *GaugeVec) GetMetricWith(labels Labels) (Gauge, error) { - metric, err := v.metricVec.getMetricWith(labels) + metric, err := v.MetricVec.GetMetricWith(labels) if metric != nil { return metric.(Gauge), err } @@ -244,7 +244,7 @@ func (v *GaugeVec) With(labels Labels) Gauge { // registered with a given registry (usually the uncurried version). The Reset // method deletes all metrics, even if called on a curried vector. func (v *GaugeVec) CurryWith(labels Labels) (*GaugeVec, error) { - vec, err := v.curryWith(labels) + vec, err := v.MetricVec.CurryWith(labels) if vec != nil { return &GaugeVec{vec}, err } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go index ea05cf429f2b..a96ed1cee885 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go @@ -36,31 +36,10 @@ type goCollector struct { msMaxAge time.Duration // Maximum allowed age of old memstats. } -// NewGoCollector returns a collector that exports metrics about the current Go -// process. This includes memory stats. To collect those, runtime.ReadMemStats -// is called. This requires to “stop the world”, which usually only happens for -// garbage collection (GC). Take the following implications into account when -// deciding whether to use the Go collector: +// NewGoCollector is the obsolete version of collectors.NewGoCollector. +// See there for documentation. // -// 1. The performance impact of stopping the world is the more relevant the more -// frequently metrics are collected. However, with Go1.9 or later the -// stop-the-world time per metrics collection is very short (~25µs) so that the -// performance impact will only matter in rare cases. However, with older Go -// versions, the stop-the-world duration depends on the heap size and can be -// quite significant (~1.7 ms/GiB as per -// https://go-review.googlesource.com/c/go/+/34937). -// -// 2. During an ongoing GC, nothing else can stop the world. Therefore, if the -// metrics collection happens to coincide with GC, it will only complete after -// GC has finished. Usually, GC is fast enough to not cause problems. However, -// with a very large heap, GC might take multiple seconds, which is enough to -// cause scrape timeouts in common setups. To avoid this problem, the Go -// collector will use the memstats from a previous collection if -// runtime.ReadMemStats takes more than 1s. However, if there are no previously -// collected memstats, or their collection is more than 5m ago, the collection -// will block until runtime.ReadMemStats succeeds. (The problem might be solved -// in Go1.13, see https://github.com/golang/go/issues/19812 for the related Go -// issue.) +// Deprecated: Use collectors.NewGoCollector instead. func NewGoCollector() Collector { return &goCollector{ goroutinesDesc: NewDesc( @@ -365,25 +344,17 @@ type memStatsMetrics []struct { valType ValueType } -// NewBuildInfoCollector returns a collector collecting a single metric -// "go_build_info" with the constant value 1 and three labels "path", "version", -// and "checksum". Their label values contain the main module path, version, and -// checksum, respectively. The labels will only have meaningful values if the -// binary is built with Go module support and from source code retrieved from -// the source repository (rather than the local file system). This is usually -// accomplished by building from outside of GOPATH, specifying the full address -// of the main package, e.g. "GO111MODULE=on go run -// github.com/prometheus/client_golang/examples/random". If built without Go -// module support, all label values will be "unknown". If built with Go module -// support but using the source code from the local file system, the "path" will -// be set appropriately, but "checksum" will be empty and "version" will be -// "(devel)". +// NewBuildInfoCollector is the obsolete version of collectors.NewBuildInfoCollector. +// See there for documentation. // -// This collector uses only the build information for the main module. See -// https://github.com/povilasv/prommod for an example of a collector for the -// module dependencies. +// Deprecated: Use collectors.NewBuildInfoCollector instead. func NewBuildInfoCollector() Collector { - path, version, sum := readBuildInfo() + path, version, sum := "unknown", "unknown", "unknown" + if bi, ok := debug.ReadBuildInfo(); ok { + path = bi.Main.Path + version = bi.Main.Version + sum = bi.Main.Sum + } c := &selfCollector{MustNewConstMetric( NewDesc( "go_build_info", diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/histogram.go index d4ea301a33ce..8425640b390a 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/histogram.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/histogram.go @@ -22,7 +22,7 @@ import ( "sync/atomic" "time" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go" @@ -47,7 +47,12 @@ type Histogram interface { Metric Collector - // Observe adds a single observation to the histogram. + // Observe adds a single observation to the histogram. Observations are + // usually positive or zero. Negative observations are accepted but + // prevent current versions of Prometheus from properly detecting + // counter resets in the sum of observations. See + // https://prometheus.io/docs/practices/histograms/#count-and-sum-of-observations + // for details. Observe(float64) } @@ -192,7 +197,7 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr h := &histogram{ desc: desc, upperBounds: opts.Buckets, - labelPairs: makeLabelPairs(desc, labelValues), + labelPairs: MakeLabelPairs(desc, labelValues), counts: [2]*histogramCounts{{}, {}}, now: time.Now, } @@ -409,7 +414,7 @@ func (h *histogram) updateExemplar(v float64, bucket int, l Labels) { // (e.g. HTTP request latencies, partitioned by status code and method). Create // instances with NewHistogramVec. type HistogramVec struct { - *metricVec + *MetricVec } // NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and @@ -422,14 +427,14 @@ func NewHistogramVec(opts HistogramOpts, labelNames []string) *HistogramVec { opts.ConstLabels, ) return &HistogramVec{ - metricVec: newMetricVec(desc, func(lvs ...string) Metric { + MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { return newHistogram(desc, opts, lvs...) }), } } // GetMetricWithLabelValues returns the Histogram for the given slice of label -// values (same order as the VariableLabels in Desc). If that combination of +// values (same order as the variable labels in Desc). If that combination of // label values is accessed for the first time, a new Histogram is created. // // It is possible to call this method without using the returned Histogram to only @@ -444,7 +449,7 @@ func NewHistogramVec(opts HistogramOpts, labelNames []string) *HistogramVec { // example. // // An error is returned if the number of label values is not the same as the -// number of VariableLabels in Desc (minus any curried labels). +// number of variable labels in Desc (minus any curried labels). // // Note that for more than one label value, this method is prone to mistakes // caused by an incorrect order of arguments. Consider GetMetricWith(Labels) as @@ -453,7 +458,7 @@ func NewHistogramVec(opts HistogramOpts, labelNames []string) *HistogramVec { // with a performance overhead (for creating and processing the Labels map). // See also the GaugeVec example. func (v *HistogramVec) GetMetricWithLabelValues(lvs ...string) (Observer, error) { - metric, err := v.metricVec.getMetricWithLabelValues(lvs...) + metric, err := v.MetricVec.GetMetricWithLabelValues(lvs...) if metric != nil { return metric.(Observer), err } @@ -461,19 +466,19 @@ func (v *HistogramVec) GetMetricWithLabelValues(lvs ...string) (Observer, error) } // GetMetricWith returns the Histogram for the given Labels map (the label names -// must match those of the VariableLabels in Desc). If that label map is +// must match those of the variable labels in Desc). If that label map is // accessed for the first time, a new Histogram is created. Implications of // creating a Histogram without using it and keeping the Histogram for later use // are the same as for GetMetricWithLabelValues. // // An error is returned if the number and names of the Labels are inconsistent -// with those of the VariableLabels in Desc (minus any curried labels). +// with those of the variable labels in Desc (minus any curried labels). // // This method is used for the same purpose as // GetMetricWithLabelValues(...string). See there for pros and cons of the two // methods. func (v *HistogramVec) GetMetricWith(labels Labels) (Observer, error) { - metric, err := v.metricVec.getMetricWith(labels) + metric, err := v.MetricVec.GetMetricWith(labels) if metric != nil { return metric.(Observer), err } @@ -517,7 +522,7 @@ func (v *HistogramVec) With(labels Labels) Observer { // registered with a given registry (usually the uncurried version). The Reset // method deletes all metrics, even if called on a curried vector. func (v *HistogramVec) CurryWith(labels Labels) (ObserverVec, error) { - vec, err := v.curryWith(labels) + vec, err := v.MetricVec.CurryWith(labels) if vec != nil { return &HistogramVec{vec}, err } @@ -602,7 +607,7 @@ func NewConstHistogram( count: count, sum: sum, buckets: buckets, - labelPairs: makeLabelPairs(desc, labelValues), + labelPairs: MakeLabelPairs(desc, labelValues), }, nil } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/metric.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/metric.go index 35bd8bde34c7..dc121910a520 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/metric.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/metric.go @@ -17,7 +17,7 @@ import ( "strings" "time" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/prometheus/common/model" @@ -58,7 +58,7 @@ type Metric interface { } // Opts bundles the options for creating most Metric types. Each metric -// implementation XXX has its own XXXOpts type, but in most cases, it is just be +// implementation XXX has its own XXXOpts type, but in most cases, it is just // an alias of this type (which might change when the requirement arises.) // // It is mandatory to set Name to a non-empty string. All other fields are @@ -89,7 +89,7 @@ type Opts struct { // better covered by target labels set by the scraping Prometheus // server, or by one specific metric (e.g. a build_info or a // machine_role metric). See also - // https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels,-not-static-scraped-labels + // https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels-not-static-scraped-labels ConstLabels Labels } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go index 9b809794212d..5bfe0ff5bbc9 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go @@ -15,7 +15,11 @@ package prometheus import ( "errors" + "fmt" + "io/ioutil" "os" + "strconv" + "strings" ) type processCollector struct { @@ -50,16 +54,10 @@ type ProcessCollectorOpts struct { ReportErrors bool } -// NewProcessCollector returns a collector which exports the current state of -// process metrics including CPU, memory and file descriptor usage as well as -// the process start time. The detailed behavior is defined by the provided -// ProcessCollectorOpts. The zero value of ProcessCollectorOpts creates a -// collector for the current process with an empty namespace string and no error -// reporting. +// NewProcessCollector is the obsolete version of collectors.NewProcessCollector. +// See there for documentation. // -// The collector only works on operating systems with a Linux-style proc -// filesystem and on Microsoft Windows. On other operating systems, it will not -// collect any metrics. +// Deprecated: Use collectors.NewProcessCollector instead. func NewProcessCollector(opts ProcessCollectorOpts) Collector { ns := "" if len(opts.Namespace) > 0 { @@ -149,3 +147,20 @@ func (c *processCollector) reportError(ch chan<- Metric, desc *Desc, err error) } ch <- NewInvalidMetric(desc, err) } + +// NewPidFileFn returns a function that retrieves a pid from the specified file. +// It is meant to be used for the PidFn field in ProcessCollectorOpts. +func NewPidFileFn(pidFilePath string) func() (int, error) { + return func() (int, error) { + content, err := ioutil.ReadFile(pidFilePath) + if err != nil { + return 0, fmt.Errorf("can't read pid file %q: %+v", pidFilePath, err) + } + pid, err := strconv.Atoi(strings.TrimSpace(string(content))) + if err != nil { + return 0, fmt.Errorf("can't parse pid file %q: %+v", pidFilePath, err) + } + + return pid, nil + } +} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go index 5070e72e28fe..e7c0d05464fa 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go @@ -83,8 +83,7 @@ type readerFromDelegator struct{ *responseWriterDelegator } type pusherDelegator struct{ *responseWriterDelegator } func (d closeNotifierDelegator) CloseNotify() <-chan bool { - //lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to - //remove support from client_golang yet. + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. return d.ResponseWriter.(http.CloseNotifier).CloseNotify() } func (d flusherDelegator) Flush() { @@ -348,8 +347,7 @@ func newDelegator(w http.ResponseWriter, observeWriteHeaderFunc func(int)) deleg } id := 0 - //lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to - //remove support from client_golang yet. + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. if _, ok := w.(http.CloseNotifier); ok { id += closeNotifier } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go index 5e1c4546ceb8..d86d0cf4b0e9 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go @@ -99,7 +99,7 @@ func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { inFlightSem = make(chan struct{}, opts.MaxRequestsInFlight) } if opts.Registry != nil { - // Initialize all possibilites that can occur below. + // Initialize all possibilities that can occur below. errCnt.WithLabelValues("gathering") errCnt.WithLabelValues("encoding") if err := opts.Registry.Register(errCnt); err != nil { @@ -303,8 +303,12 @@ type Logger interface { // HandlerOpts specifies options how to serve metrics via an http.Handler. The // zero value of HandlerOpts is a reasonable default. type HandlerOpts struct { - // ErrorLog specifies an optional logger for errors collecting and - // serving metrics. If nil, errors are not logged at all. + // ErrorLog specifies an optional Logger for errors collecting and + // serving metrics. If nil, errors are not logged at all. Note that the + // type of a reported error is often prometheus.MultiError, which + // formats into a multi-line error string. If you want to avoid the + // latter, create a Logger implementation that detects a + // prometheus.MultiError and formats the contained errors into one line. ErrorLog Logger // ErrorHandling defines how errors are handled. Note that errors are // logged regardless of the configured ErrorHandling provided ErrorLog diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go index 9db24380533a..ab037db86198 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go @@ -43,14 +43,14 @@ func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handl // InstrumentHandlerDuration is a middleware that wraps the provided // http.Handler to observe the request duration with the provided ObserverVec. -// The ObserverVec must have zero, one, or two non-const non-curried labels. For -// those, the only allowed label names are "code" and "method". The function -// panics otherwise. The Observe method of the Observer in the ObserverVec is -// called with the request duration in seconds. Partitioning happens by HTTP -// status code and/or HTTP method if the respective instance label names are -// present in the ObserverVec. For unpartitioned observations, use an -// ObserverVec with zero labels. Note that partitioning of Histograms is -// expensive and should be used judiciously. +// The ObserverVec must have valid metric and label names and must have zero, +// one, or two non-const non-curried labels. For those, the only allowed label +// names are "code" and "method". The function panics otherwise. The Observe +// method of the Observer in the ObserverVec is called with the request duration +// in seconds. Partitioning happens by HTTP status code and/or HTTP method if +// the respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. // // If the wrapped Handler does not set a status code, a status code of 200 is assumed. // @@ -79,12 +79,13 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler) ht } // InstrumentHandlerCounter is a middleware that wraps the provided http.Handler -// to observe the request result with the provided CounterVec. The CounterVec -// must have zero, one, or two non-const non-curried labels. For those, the only -// allowed label names are "code" and "method". The function panics -// otherwise. Partitioning of the CounterVec happens by HTTP status code and/or -// HTTP method if the respective instance label names are present in the -// CounterVec. For unpartitioned counting, use a CounterVec with zero labels. +// to observe the request result with the provided CounterVec. The CounterVec +// must have valid metric and label names and must have zero, one, or two +// non-const non-curried labels. For those, the only allowed label names are +// "code" and "method". The function panics otherwise. Partitioning of the +// CounterVec happens by HTTP status code and/or HTTP method if the respective +// instance label names are present in the CounterVec. For unpartitioned +// counting, use a CounterVec with zero labels. // // If the wrapped Handler does not set a status code, a status code of 200 is assumed. // @@ -110,14 +111,15 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler) // InstrumentHandlerTimeToWriteHeader is a middleware that wraps the provided // http.Handler to observe with the provided ObserverVec the request duration -// until the response headers are written. The ObserverVec must have zero, one, -// or two non-const non-curried labels. For those, the only allowed label names -// are "code" and "method". The function panics otherwise. The Observe method of -// the Observer in the ObserverVec is called with the request duration in -// seconds. Partitioning happens by HTTP status code and/or HTTP method if the -// respective instance label names are present in the ObserverVec. For -// unpartitioned observations, use an ObserverVec with zero labels. Note that -// partitioning of Histograms is expensive and should be used judiciously. +// until the response headers are written. The ObserverVec must have valid +// metric and label names and must have zero, one, or two non-const non-curried +// labels. For those, the only allowed label names are "code" and "method". The +// function panics otherwise. The Observe method of the Observer in the +// ObserverVec is called with the request duration in seconds. Partitioning +// happens by HTTP status code and/or HTTP method if the respective instance +// label names are present in the ObserverVec. For unpartitioned observations, +// use an ObserverVec with zero labels. Note that partitioning of Histograms is +// expensive and should be used judiciously. // // If the wrapped Handler panics before calling WriteHeader, no value is // reported. @@ -139,15 +141,15 @@ func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Ha } // InstrumentHandlerRequestSize is a middleware that wraps the provided -// http.Handler to observe the request size with the provided ObserverVec. The -// ObserverVec must have zero, one, or two non-const non-curried labels. For -// those, the only allowed label names are "code" and "method". The function -// panics otherwise. The Observe method of the Observer in the ObserverVec is -// called with the request size in bytes. Partitioning happens by HTTP status -// code and/or HTTP method if the respective instance label names are present in -// the ObserverVec. For unpartitioned observations, use an ObserverVec with zero -// labels. Note that partitioning of Histograms is expensive and should be used -// judiciously. +// http.Handler to observe the request size with the provided ObserverVec. The +// ObserverVec must have valid metric and label names and must have zero, one, +// or two non-const non-curried labels. For those, the only allowed label names +// are "code" and "method". The function panics otherwise. The Observe method of +// the Observer in the ObserverVec is called with the request size in +// bytes. Partitioning happens by HTTP status code and/or HTTP method if the +// respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. // // If the wrapped Handler does not set a status code, a status code of 200 is assumed. // @@ -174,15 +176,15 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler) } // InstrumentHandlerResponseSize is a middleware that wraps the provided -// http.Handler to observe the response size with the provided ObserverVec. The -// ObserverVec must have zero, one, or two non-const non-curried labels. For -// those, the only allowed label names are "code" and "method". The function -// panics otherwise. The Observe method of the Observer in the ObserverVec is -// called with the response size in bytes. Partitioning happens by HTTP status -// code and/or HTTP method if the respective instance label names are present in -// the ObserverVec. For unpartitioned observations, use an ObserverVec with zero -// labels. Note that partitioning of Histograms is expensive and should be used -// judiciously. +// http.Handler to observe the response size with the provided ObserverVec. The +// ObserverVec must have valid metric and label names and must have zero, one, +// or two non-const non-curried labels. For those, the only allowed label names +// are "code" and "method". The function panics otherwise. The Observe method of +// the Observer in the ObserverVec is called with the response size in +// bytes. Partitioning happens by HTTP status code and/or HTTP method if the +// respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. // // If the wrapped Handler does not set a status code, a status code of 200 is assumed. // @@ -198,6 +200,11 @@ func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler }) } +// checkLabels returns whether the provided Collector has a non-const, +// non-curried label named "code" and/or "method". It panics if the provided +// Collector does not have a Desc or has more than one Desc or its Desc is +// invalid. It also panics if the Collector has any non-const, non-curried +// labels that are not named "code" or "method". func checkLabels(c prometheus.Collector) (code bool, method bool) { // TODO(beorn7): Remove this hacky way to check for instance labels // once Descriptors can have their dimensionality queried. @@ -225,6 +232,10 @@ func checkLabels(c prometheus.Collector) (code bool, method bool) { close(descc) + // Make sure the Collector has a valid Desc by registering it with a + // temporary registry. + prometheus.NewRegistry().MustRegister(c) + // Create a ConstMetric with the Desc. Since we don't know how many // variable labels there are, try for as long as it needs. for err := errors.New("dummy"); err != nil; lvs = append(lvs, magicString) { diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/registry.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/registry.go index ba94405af4ca..383a7f5941a5 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/registry.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/registry.go @@ -26,7 +26,7 @@ import ( "unicode/utf8" "github.com/cespare/xxhash/v2" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/prometheus/common/expfmt" @@ -215,6 +215,8 @@ func (err AlreadyRegisteredError) Error() string { // by a Gatherer to report multiple errors during MetricFamily gathering. type MultiError []error +// Error formats the contained errors as a bullet point list, preceded by the +// total number of errors. Note that this results in a multi-line string. func (errs MultiError) Error() string { if len(errs) == 0 { return "" diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/summary.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/summary.go index f3c1440d1c65..c5fa8ed7c71a 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/summary.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/summary.go @@ -23,7 +23,7 @@ import ( "time" "github.com/beorn7/perks/quantile" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go" @@ -55,7 +55,12 @@ type Summary interface { Metric Collector - // Observe adds a single observation to the summary. + // Observe adds a single observation to the summary. Observations are + // usually positive or zero. Negative observations are accepted but + // prevent current versions of Prometheus from properly detecting + // counter resets in the sum of observations. See + // https://prometheus.io/docs/practices/histograms/#count-and-sum-of-observations + // for details. Observe(float64) } @@ -110,7 +115,7 @@ type SummaryOpts struct { // better covered by target labels set by the scraping Prometheus // server, or by one specific metric (e.g. a build_info or a // machine_role metric). See also - // https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels,-not-static-scraped-labels + // https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels-not-static-scraped-labels ConstLabels Labels // Objectives defines the quantile rank estimates with their respective @@ -121,7 +126,9 @@ type SummaryOpts struct { Objectives map[float64]float64 // MaxAge defines the duration for which an observation stays relevant - // for the summary. Must be positive. The default value is DefMaxAge. + // for the summary. Only applies to pre-calculated quantiles, does not + // apply to _sum and _count. Must be positive. The default value is + // DefMaxAge. MaxAge time.Duration // AgeBuckets is the number of buckets used to exclude observations that @@ -208,7 +215,7 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary { // Use the lock-free implementation of a Summary without objectives. s := &noObjectivesSummary{ desc: desc, - labelPairs: makeLabelPairs(desc, labelValues), + labelPairs: MakeLabelPairs(desc, labelValues), counts: [2]*summaryCounts{{}, {}}, } s.init(s) // Init self-collection. @@ -221,7 +228,7 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary { objectives: opts.Objectives, sortedObjectives: make([]float64, 0, len(opts.Objectives)), - labelPairs: makeLabelPairs(desc, labelValues), + labelPairs: MakeLabelPairs(desc, labelValues), hotBuf: make([]float64, 0, opts.BufCap), coldBuf: make([]float64, 0, opts.BufCap), @@ -513,7 +520,7 @@ func (s quantSort) Less(i, j int) bool { // (e.g. HTTP request latencies, partitioned by status code and method). Create // instances with NewSummaryVec. type SummaryVec struct { - *metricVec + *MetricVec } // NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and @@ -535,14 +542,14 @@ func NewSummaryVec(opts SummaryOpts, labelNames []string) *SummaryVec { opts.ConstLabels, ) return &SummaryVec{ - metricVec: newMetricVec(desc, func(lvs ...string) Metric { + MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { return newSummary(desc, opts, lvs...) }), } } // GetMetricWithLabelValues returns the Summary for the given slice of label -// values (same order as the VariableLabels in Desc). If that combination of +// values (same order as the variable labels in Desc). If that combination of // label values is accessed for the first time, a new Summary is created. // // It is possible to call this method without using the returned Summary to only @@ -557,7 +564,7 @@ func NewSummaryVec(opts SummaryOpts, labelNames []string) *SummaryVec { // example. // // An error is returned if the number of label values is not the same as the -// number of VariableLabels in Desc (minus any curried labels). +// number of variable labels in Desc (minus any curried labels). // // Note that for more than one label value, this method is prone to mistakes // caused by an incorrect order of arguments. Consider GetMetricWith(Labels) as @@ -566,7 +573,7 @@ func NewSummaryVec(opts SummaryOpts, labelNames []string) *SummaryVec { // with a performance overhead (for creating and processing the Labels map). // See also the GaugeVec example. func (v *SummaryVec) GetMetricWithLabelValues(lvs ...string) (Observer, error) { - metric, err := v.metricVec.getMetricWithLabelValues(lvs...) + metric, err := v.MetricVec.GetMetricWithLabelValues(lvs...) if metric != nil { return metric.(Observer), err } @@ -574,19 +581,19 @@ func (v *SummaryVec) GetMetricWithLabelValues(lvs ...string) (Observer, error) { } // GetMetricWith returns the Summary for the given Labels map (the label names -// must match those of the VariableLabels in Desc). If that label map is +// must match those of the variable labels in Desc). If that label map is // accessed for the first time, a new Summary is created. Implications of // creating a Summary without using it and keeping the Summary for later use are // the same as for GetMetricWithLabelValues. // // An error is returned if the number and names of the Labels are inconsistent -// with those of the VariableLabels in Desc (minus any curried labels). +// with those of the variable labels in Desc (minus any curried labels). // // This method is used for the same purpose as // GetMetricWithLabelValues(...string). See there for pros and cons of the two // methods. func (v *SummaryVec) GetMetricWith(labels Labels) (Observer, error) { - metric, err := v.metricVec.getMetricWith(labels) + metric, err := v.MetricVec.GetMetricWith(labels) if metric != nil { return metric.(Observer), err } @@ -630,7 +637,7 @@ func (v *SummaryVec) With(labels Labels) Observer { // registered with a given registry (usually the uncurried version). The Reset // method deletes all metrics, even if called on a curried vector. func (v *SummaryVec) CurryWith(labels Labels) (ObserverVec, error) { - vec, err := v.curryWith(labels) + vec, err := v.MetricVec.CurryWith(labels) if vec != nil { return &SummaryVec{vec}, err } @@ -716,7 +723,7 @@ func NewConstSummary( count: count, sum: sum, quantiles: quantiles, - labelPairs: makeLabelPairs(desc, labelValues), + labelPairs: MakeLabelPairs(desc, labelValues), }, nil } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/value.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/value.go index 6206928cc67c..c778711b8abb 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/value.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/value.go @@ -19,7 +19,7 @@ import ( "time" "unicode/utf8" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" @@ -63,7 +63,7 @@ func newValueFunc(desc *Desc, valueType ValueType, function func() float64) *val desc: desc, valType: valueType, function: function, - labelPairs: makeLabelPairs(desc, nil), + labelPairs: MakeLabelPairs(desc, nil), } result.init(result) return result @@ -95,7 +95,7 @@ func NewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues desc: desc, valType: valueType, val: value, - labelPairs: makeLabelPairs(desc, labelValues), + labelPairs: MakeLabelPairs(desc, labelValues), }, nil } @@ -145,7 +145,14 @@ func populateMetric( return nil } -func makeLabelPairs(desc *Desc, labelValues []string) []*dto.LabelPair { +// MakeLabelPairs is a helper function to create protobuf LabelPairs from the +// variable and constant labels in the provided Desc. The values for the +// variable labels are defined by the labelValues slice, which must be in the +// same order as the corresponding variable labels in the Desc. +// +// This function is only needed for custom Metric implementations. See MetricVec +// example. +func MakeLabelPairs(desc *Desc, labelValues []string) []*dto.LabelPair { totalLen := len(desc.variableLabels) + len(desc.constLabelPairs) if totalLen == 0 { // Super fast path. diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/vec.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/vec.go index d53848dc4810..4ababe6c9812 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/vec.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/vec.go @@ -20,12 +20,20 @@ import ( "github.com/prometheus/common/model" ) -// metricVec is a Collector to bundle metrics of the same name that differ in -// their label values. metricVec is not used directly (and therefore -// unexported). It is used as a building block for implementations of vectors of -// a given metric type, like GaugeVec, CounterVec, SummaryVec, and HistogramVec. -// It also handles label currying. -type metricVec struct { +// MetricVec is a Collector to bundle metrics of the same name that differ in +// their label values. MetricVec is not used directly but as a building block +// for implementations of vectors of a given metric type, like GaugeVec, +// CounterVec, SummaryVec, and HistogramVec. It is exported so that it can be +// used for custom Metric implementations. +// +// To create a FooVec for custom Metric Foo, embed a pointer to MetricVec in +// FooVec and initialize it with NewMetricVec. Implement wrappers for +// GetMetricWithLabelValues and GetMetricWith that return (Foo, error) rather +// than (Metric, error). Similarly, create a wrapper for CurryWith that returns +// (*FooVec, error) rather than (*MetricVec, error). It is recommended to also +// add the convenience methods WithLabelValues, With, and MustCurryWith, which +// panic instead of returning errors. See also the MetricVec example. +type MetricVec struct { *metricMap curry []curriedLabelValue @@ -35,9 +43,9 @@ type metricVec struct { hashAddByte func(h uint64, b byte) uint64 } -// newMetricVec returns an initialized metricVec. -func newMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *metricVec { - return &metricVec{ +// NewMetricVec returns an initialized metricVec. +func NewMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *MetricVec { + return &MetricVec{ metricMap: &metricMap{ metrics: map[uint64][]metricWithLabelValues{}, desc: desc, @@ -63,7 +71,7 @@ func newMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *metricVec { // latter has a much more readable (albeit more verbose) syntax, but it comes // with a performance overhead (for creating and processing the Labels map). // See also the CounterVec example. -func (m *metricVec) DeleteLabelValues(lvs ...string) bool { +func (m *MetricVec) DeleteLabelValues(lvs ...string) bool { h, err := m.hashLabelValues(lvs) if err != nil { return false @@ -82,7 +90,7 @@ func (m *metricVec) DeleteLabelValues(lvs ...string) bool { // // This method is used for the same purpose as DeleteLabelValues(...string). See // there for pros and cons of the two methods. -func (m *metricVec) Delete(labels Labels) bool { +func (m *MetricVec) Delete(labels Labels) bool { h, err := m.hashLabels(labels) if err != nil { return false @@ -95,15 +103,32 @@ func (m *metricVec) Delete(labels Labels) bool { // show up in GoDoc. // Describe implements Collector. -func (m *metricVec) Describe(ch chan<- *Desc) { m.metricMap.Describe(ch) } +func (m *MetricVec) Describe(ch chan<- *Desc) { m.metricMap.Describe(ch) } // Collect implements Collector. -func (m *metricVec) Collect(ch chan<- Metric) { m.metricMap.Collect(ch) } +func (m *MetricVec) Collect(ch chan<- Metric) { m.metricMap.Collect(ch) } // Reset deletes all metrics in this vector. -func (m *metricVec) Reset() { m.metricMap.Reset() } - -func (m *metricVec) curryWith(labels Labels) (*metricVec, error) { +func (m *MetricVec) Reset() { m.metricMap.Reset() } + +// CurryWith returns a vector curried with the provided labels, i.e. the +// returned vector has those labels pre-set for all labeled operations performed +// on it. The cardinality of the curried vector is reduced accordingly. The +// order of the remaining labels stays the same (just with the curried labels +// taken out of the sequence – which is relevant for the +// (GetMetric)WithLabelValues methods). It is possible to curry a curried +// vector, but only with labels not yet used for currying before. +// +// The metrics contained in the MetricVec are shared between the curried and +// uncurried vectors. They are just accessed differently. Curried and uncurried +// vectors behave identically in terms of collection. Only one must be +// registered with a given registry (usually the uncurried version). The Reset +// method deletes all metrics, even if called on a curried vector. +// +// Note that CurryWith is usually not called directly but through a wrapper +// around MetricVec, implementing a vector for a specific Metric +// implementation, for example GaugeVec. +func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) { var ( newCurry []curriedLabelValue oldCurry = m.curry @@ -128,7 +153,7 @@ func (m *metricVec) curryWith(labels Labels) (*metricVec, error) { return nil, fmt.Errorf("%d unknown label(s) found during currying", l) } - return &metricVec{ + return &MetricVec{ metricMap: m.metricMap, curry: newCurry, hashAdd: m.hashAdd, @@ -136,7 +161,34 @@ func (m *metricVec) curryWith(labels Labels) (*metricVec, error) { }, nil } -func (m *metricVec) getMetricWithLabelValues(lvs ...string) (Metric, error) { +// GetMetricWithLabelValues returns the Metric for the given slice of label +// values (same order as the variable labels in Desc). If that combination of +// label values is accessed for the first time, a new Metric is created (by +// calling the newMetric function provided during construction of the +// MetricVec). +// +// It is possible to call this method without using the returned Metric to only +// create the new Metric but leave it in its initial state. +// +// Keeping the Metric for later use is possible (and should be considered if +// performance is critical), but keep in mind that Reset, DeleteLabelValues and +// Delete can be used to delete the Metric from the MetricVec. In that case, the +// Metric will still exist, but it will not be exported anymore, even if a +// Metric with the same label values is created later. +// +// An error is returned if the number of label values is not the same as the +// number of variable labels in Desc (minus any curried labels). +// +// Note that for more than one label value, this method is prone to mistakes +// caused by an incorrect order of arguments. Consider GetMetricWith(Labels) as +// an alternative to avoid that type of mistake. For higher label numbers, the +// latter has a much more readable (albeit more verbose) syntax, but it comes +// with a performance overhead (for creating and processing the Labels map). +// +// Note that GetMetricWithLabelValues is usually not called directly but through +// a wrapper around MetricVec, implementing a vector for a specific Metric +// implementation, for example GaugeVec. +func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) { h, err := m.hashLabelValues(lvs) if err != nil { return nil, err @@ -145,7 +197,23 @@ func (m *metricVec) getMetricWithLabelValues(lvs ...string) (Metric, error) { return m.metricMap.getOrCreateMetricWithLabelValues(h, lvs, m.curry), nil } -func (m *metricVec) getMetricWith(labels Labels) (Metric, error) { +// GetMetricWith returns the Metric for the given Labels map (the label names +// must match those of the variable labels in Desc). If that label map is +// accessed for the first time, a new Metric is created. Implications of +// creating a Metric without using it and keeping the Metric for later use +// are the same as for GetMetricWithLabelValues. +// +// An error is returned if the number and names of the Labels are inconsistent +// with those of the variable labels in Desc (minus any curried labels). +// +// This method is used for the same purpose as +// GetMetricWithLabelValues(...string). See there for pros and cons of the two +// methods. +// +// Note that GetMetricWith is usually not called directly but through a wrapper +// around MetricVec, implementing a vector for a specific Metric implementation, +// for example GaugeVec. +func (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) { h, err := m.hashLabels(labels) if err != nil { return nil, err @@ -154,7 +222,7 @@ func (m *metricVec) getMetricWith(labels Labels) (Metric, error) { return m.metricMap.getOrCreateMetricWithLabels(h, labels, m.curry), nil } -func (m *metricVec) hashLabelValues(vals []string) (uint64, error) { +func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) { if err := validateLabelValues(vals, len(m.desc.variableLabels)-len(m.curry)); err != nil { return 0, err } @@ -177,7 +245,7 @@ func (m *metricVec) hashLabelValues(vals []string) (uint64, error) { return h, nil } -func (m *metricVec) hashLabels(labels Labels) (uint64, error) { +func (m *MetricVec) hashLabels(labels Labels) (uint64, error) { if err := validateValuesInLabels(labels, len(m.desc.variableLabels)-len(m.curry)); err != nil { return 0, err } @@ -276,7 +344,9 @@ func (m *metricMap) deleteByHashWithLabelValues( } if len(metrics) > 1 { + old := metrics m.metrics[h] = append(metrics[:i], metrics[i+1:]...) + old[len(old)-1] = metricWithLabelValues{} } else { delete(m.metrics, h) } @@ -302,7 +372,9 @@ func (m *metricMap) deleteByHashWithLabels( } if len(metrics) > 1 { + old := metrics m.metrics[h] = append(metrics[:i], metrics[i+1:]...) + old[len(old)-1] = metricWithLabelValues{} } else { delete(m.metrics, h) } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/wrap.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/wrap.go index 438aa5e9247d..74ee93280fed 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/wrap.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/wrap.go @@ -17,7 +17,7 @@ import ( "fmt" "sort" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go" @@ -32,7 +32,9 @@ import ( // in a no-op Registerer. // // WrapRegistererWith provides a way to add fixed labels to a subset of -// Collectors. It should not be used to add fixed labels to all metrics exposed. +// Collectors. It should not be used to add fixed labels to all metrics +// exposed. See also +// https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels-not-static-scraped-labels // // Conflicts between Collectors registered through the original Registerer with // Collectors registered through the wrapping Registerer will still be diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/Makefile.common b/cluster-autoscaler/vendor/github.com/prometheus/procfs/Makefile.common index 9320176ca24f..3ac29c636c6b 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/Makefile.common +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/Makefile.common @@ -78,7 +78,7 @@ ifneq ($(shell which gotestsum),) endif endif -PROMU_VERSION ?= 0.5.0 +PROMU_VERSION ?= 0.7.0 PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz GOLANGCI_LINT := @@ -245,10 +245,12 @@ common-docker-publish: $(PUBLISH_DOCKER_ARCHS) $(PUBLISH_DOCKER_ARCHS): common-docker-publish-%: docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" +DOCKER_MAJOR_VERSION_TAG = $(firstword $(subst ., ,$(shell cat VERSION))) .PHONY: common-docker-tag-latest $(TAG_DOCKER_ARCHS) common-docker-tag-latest: $(TAG_DOCKER_ARCHS) $(TAG_DOCKER_ARCHS): common-docker-tag-latest-%: docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)" .PHONY: common-docker-manifest common-docker-manifest: diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/SECURITY.md b/cluster-autoscaler/vendor/github.com/prometheus/procfs/SECURITY.md new file mode 100644 index 000000000000..67741f015af1 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/SECURITY.md @@ -0,0 +1,6 @@ +# Reporting a security issue + +The Prometheus security policy, including how to report vulnerabilities, can be +found here: + +https://prometheus.io/docs/operating/security/ diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/arp.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/arp.go index 916c9182a8b1..4e47e6172096 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/arp.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/arp.go @@ -36,7 +36,7 @@ type ARPEntry struct { func (fs FS) GatherARPEntries() ([]ARPEntry, error) { data, err := ioutil.ReadFile(fs.proc.Path("net/arp")) if err != nil { - return nil, fmt.Errorf("error reading arp %s: %s", fs.proc.Path("net/arp"), err) + return nil, fmt.Errorf("error reading arp %q: %w", fs.proc.Path("net/arp"), err) } return parseARPEntries(data) @@ -59,7 +59,7 @@ func parseARPEntries(data []byte) ([]ARPEntry, error) { } else if width == expectedDataWidth { entry, err := parseARPEntry(columns) if err != nil { - return []ARPEntry{}, fmt.Errorf("failed to parse ARP entry: %s", err) + return []ARPEntry{}, fmt.Errorf("failed to parse ARP entry: %w", err) } entries = append(entries, entry) } else { diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/buddyinfo.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/buddyinfo.go index 10bd067a0a55..f5b7939b266a 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/buddyinfo.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/buddyinfo.go @@ -74,7 +74,7 @@ func parseBuddyInfo(r io.Reader) ([]BuddyInfo, error) { for i := 0; i < arraySize; i++ { sizes[i], err = strconv.ParseFloat(parts[i+4], 64) if err != nil { - return nil, fmt.Errorf("invalid value in buddyinfo: %s", err) + return nil, fmt.Errorf("invalid value in buddyinfo: %w", err) } } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/cpuinfo.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/cpuinfo.go index b9fb589aa1e0..5623b24a161f 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/cpuinfo.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/cpuinfo.go @@ -19,6 +19,7 @@ import ( "bufio" "bytes" "errors" + "fmt" "regexp" "strconv" "strings" @@ -77,7 +78,7 @@ func parseCPUInfoX86(info []byte) ([]CPUInfo, error) { // find the first "processor" line firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") { - return nil, errors.New("invalid cpuinfo file: " + firstLine) + return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) } field := strings.SplitN(firstLine, ": ", 2) v, err := strconv.ParseUint(field[1], 0, 32) @@ -192,7 +193,7 @@ func parseCPUInfoARM(info []byte) ([]CPUInfo, error) { firstLine := firstNonEmptyLine(scanner) match, _ := regexp.MatchString("^[Pp]rocessor", firstLine) if !match || !strings.Contains(firstLine, ":") { - return nil, errors.New("invalid cpuinfo file: " + firstLine) + return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) } field := strings.SplitN(firstLine, ": ", 2) cpuinfo := []CPUInfo{} @@ -256,7 +257,7 @@ func parseCPUInfoS390X(info []byte) ([]CPUInfo, error) { firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "vendor_id") || !strings.Contains(firstLine, ":") { - return nil, errors.New("invalid cpuinfo file: " + firstLine) + return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) } field := strings.SplitN(firstLine, ": ", 2) cpuinfo := []CPUInfo{} @@ -281,7 +282,7 @@ func parseCPUInfoS390X(info []byte) ([]CPUInfo, error) { if strings.HasPrefix(line, "processor") { match := cpuinfoS390XProcessorRegexp.FindStringSubmatch(line) if len(match) < 2 { - return nil, errors.New("Invalid line found in cpuinfo: " + line) + return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) } cpu := commonCPUInfo v, err := strconv.ParseUint(match[1], 0, 32) @@ -313,6 +314,22 @@ func parseCPUInfoS390X(info []byte) ([]CPUInfo, error) { return nil, err } cpuinfo[i].CPUMHz = v + case "physical id": + cpuinfo[i].PhysicalID = field[1] + case "core id": + cpuinfo[i].CoreID = field[1] + case "cpu cores": + v, err := strconv.ParseUint(field[1], 0, 32) + if err != nil { + return nil, err + } + cpuinfo[i].CPUCores = uint(v) + case "siblings": + v, err := strconv.ParseUint(field[1], 0, 32) + if err != nil { + return nil, err + } + cpuinfo[i].Siblings = uint(v) } } @@ -325,7 +342,7 @@ func parseCPUInfoMips(info []byte) ([]CPUInfo, error) { // find the first "processor" line firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "system type") || !strings.Contains(firstLine, ":") { - return nil, errors.New("invalid cpuinfo file: " + firstLine) + return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) } field := strings.SplitN(firstLine, ": ", 2) cpuinfo := []CPUInfo{} @@ -367,7 +384,7 @@ func parseCPUInfoPPC(info []byte) ([]CPUInfo, error) { firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") { - return nil, errors.New("invalid cpuinfo file: " + firstLine) + return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) } field := strings.SplitN(firstLine, ": ", 2) v, err := strconv.ParseUint(field[1], 0, 32) @@ -412,7 +429,7 @@ func parseCPUInfoRISCV(info []byte) ([]CPUInfo, error) { firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") { - return nil, errors.New("invalid cpuinfo file: " + firstLine) + return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) } field := strings.SplitN(firstLine, ": ", 2) v, err := strconv.ParseUint(field[1], 0, 32) diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/const_bsds.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go similarity index 76% rename from cluster-autoscaler/vendor/github.com/spf13/afero/const_bsds.go rename to cluster-autoscaler/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go index 5728243d962d..e83c2e207c18 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/const_bsds.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go @@ -1,8 +1,8 @@ -// Copyright © 2016 Steve Francia . -// +// Copyright 2020 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at +// // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software @@ -11,12 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build darwin openbsd freebsd netbsd dragonfly - -package afero +// +build linux +// +build riscv riscv64 -import ( - "syscall" -) +package procfs -const BADFD = syscall.EBADF +var parseCPUInfo = parseCPUInfoRISCV diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/crypto.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/crypto.go index a9589337577b..5048ad1f2147 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/crypto.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/crypto.go @@ -55,12 +55,12 @@ func (fs FS) Crypto() ([]Crypto, error) { path := fs.proc.Path("crypto") b, err := util.ReadFileNoStat(path) if err != nil { - return nil, fmt.Errorf("error reading crypto %s: %s", path, err) + return nil, fmt.Errorf("error reading crypto %q: %w", path, err) } crypto, err := parseCrypto(bytes.NewReader(b)) if err != nil { - return nil, fmt.Errorf("error parsing crypto %s: %s", path, err) + return nil, fmt.Errorf("error parsing crypto %q: %w", path, err) } return crypto, nil diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/fixtures.ttar b/cluster-autoscaler/vendor/github.com/prometheus/procfs/fixtures.ttar index 12494d742448..1e76173da0a3 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/fixtures.ttar +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/fixtures.ttar @@ -111,7 +111,7 @@ Max core file size 0 unlimited bytes Max resident set unlimited unlimited bytes Max processes 62898 62898 processes Max open files 2048 4096 files -Max locked memory 65536 65536 bytes +Max locked memory 18446744073708503040 18446744073708503040 bytes Max address space 8589934592 unlimited bytes Max file locks unlimited unlimited locks Max pending signals 62898 62898 signals @@ -1080,7 +1080,6 @@ internal : yes type : skcipher async : yes blocksize : 1 -min keysize : 16 max keysize : 32 ivsize : 16 chunksize : 16 @@ -1839,6 +1838,7 @@ min keysize : 16 max keysize : 32 Mode: 444 +Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/diskstats Lines: 52 @@ -2129,6 +2129,24 @@ Lines: 6 4 1FB3C 0 1282A8F 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/net/protocols +Lines: 14 +protocol size sockets memory press maxhdr slab module cl co di ac io in de sh ss gs se re sp bi br ha uh gp em +PACKET 1344 2 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n +PINGv6 1112 0 -1 NI 0 yes kernel y y y n n y n n y y y y n y y y y y n +RAWv6 1112 1 -1 NI 0 yes kernel y y y n y y y n y y y y n y y y y n n +UDPLITEv6 1216 0 57 NI 0 yes kernel y y y n y y y n y y y y n n n y y y n +UDPv6 1216 10 57 NI 0 yes kernel y y y n y y y n y y y y n n n y y y n +TCPv6 2144 1937 1225378 no 320 yes kernel y y y y y y y y y y y y y n y y y y y +UNIX 1024 120 -1 NI 0 yes kernel n n n n n n n n n n n n n n n n n n n +UDP-Lite 1024 0 57 NI 0 yes kernel y y y n y y y n y y y y y n n y y y n +PING 904 0 -1 NI 0 yes kernel y y y n n y n n y y y y n y y y y y n +RAW 912 0 -1 NI 0 yes kernel y y y n y y y n y y y y n y y y y n n +UDP 1024 73 57 NI 0 yes kernel y y y n y y y n y y y y y n n y y y n +TCP 1984 93064 1225378 yes 320 yes kernel y y y y y y y y y y y y y n y y y y y +NETLINK 1040 16 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/proc/net/rpc Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2186,10 +2204,25 @@ Lines: 1 00015c73 00020e76 F0000769 00000000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/net/tcp +Lines: 4 + sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode + 0: 0500000A:0016 00000000:0000 0A 00000000:00000001 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 + 1: 00000000:0016 00000000:0000 0A 00000001:00000000 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 + 2: 00000000:0016 00000000:0000 0A 00000001:00000001 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/net/tcp6 +Lines: 3 + sl local_address remote_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode ref pointer drops + 1315: 00000000000000000000000000000000:14EB 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000 981 0 21040 2 0000000013726323 0 + 6073: 000080FE00000000FFADE15609667CFE:C781 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000 1000 0 11337031 2 00000000b9256fdd 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/net/udp Lines: 4 sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode - 0: 0A000005:0016 00000000:0000 0A 00000000:00000001 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 + 0: 0500000A:0016 00000000:0000 0A 00000000:00000001 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 1: 00000000:0016 00000000:0000 0A 00000001:00000000 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 2: 00000000:0016 00000000:0000 0A 00000001:00000001 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 Mode: 644 @@ -2292,6 +2325,312 @@ Mode: 644 Path: fixtures/proc/self SymlinkTo: 26231 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/slabinfo +Lines: 302 +slabinfo - version: 2.1 +# name : tunables : slabdata +pid_3 375 532 576 28 4 : tunables 0 0 0 : slabdata 19 19 0 +pid_2 3 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 +nvidia_p2p_page_cache 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +nvidia_pte_cache 9022 9152 368 22 2 : tunables 0 0 0 : slabdata 416 416 0 +nvidia_stack_cache 321 326 12624 2 8 : tunables 0 0 0 : slabdata 163 163 0 +kvm_async_pf 0 0 472 34 4 : tunables 0 0 0 : slabdata 0 0 0 +kvm_vcpu 0 0 15552 2 8 : tunables 0 0 0 : slabdata 0 0 0 +kvm_mmu_page_header 0 0 504 32 4 : tunables 0 0 0 : slabdata 0 0 0 +pte_list_desc 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +x86_emulator 0 0 3024 10 8 : tunables 0 0 0 : slabdata 0 0 0 +x86_fpu 0 0 4608 7 8 : tunables 0 0 0 : slabdata 0 0 0 +iwl_cmd_pool:0000:04:00.0 0 128 512 32 4 : tunables 0 0 0 : slabdata 4 4 0 +ext4_groupinfo_4k 3719 3740 480 34 4 : tunables 0 0 0 : slabdata 110 110 0 +bio-6 32 75 640 25 4 : tunables 0 0 0 : slabdata 3 3 0 +bio-5 16 48 1344 24 8 : tunables 0 0 0 : slabdata 2 2 0 +bio-4 17 92 1408 23 8 : tunables 0 0 0 : slabdata 4 4 0 +fat_inode_cache 0 0 1056 31 8 : tunables 0 0 0 : slabdata 0 0 0 +fat_cache 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +ovl_aio_req 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 +ovl_inode 0 0 1000 32 8 : tunables 0 0 0 : slabdata 0 0 0 +squashfs_inode_cache 0 0 1088 30 8 : tunables 0 0 0 : slabdata 0 0 0 +fuse_request 0 0 472 34 4 : tunables 0 0 0 : slabdata 0 0 0 +fuse_inode 0 0 1152 28 8 : tunables 0 0 0 : slabdata 0 0 0 +xfs_dqtrx 0 0 864 37 8 : tunables 0 0 0 : slabdata 0 0 0 +xfs_dquot 0 0 832 39 8 : tunables 0 0 0 : slabdata 0 0 0 +xfs_buf 0 0 768 21 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_bui_item 0 0 544 30 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_bud_item 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_cui_item 0 0 768 21 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_cud_item 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_rui_item 0 0 1024 32 8 : tunables 0 0 0 : slabdata 0 0 0 +xfs_rud_item 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_icr 0 0 520 31 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_ili 0 0 528 31 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_inode 0 0 1344 24 8 : tunables 0 0 0 : slabdata 0 0 0 +xfs_efi_item 0 0 768 21 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_efd_item 0 0 776 21 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_buf_item 0 0 608 26 4 : tunables 0 0 0 : slabdata 0 0 0 +xf_trans 0 0 568 28 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_ifork 0 0 376 21 2 : tunables 0 0 0 : slabdata 0 0 0 +xfs_da_state 0 0 816 20 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_btree_cur 0 0 560 29 4 : tunables 0 0 0 : slabdata 0 0 0 +xfs_bmap_free_item 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 +xfs_log_ticket 0 0 520 31 4 : tunables 0 0 0 : slabdata 0 0 0 +nfs_direct_cache 0 0 560 29 4 : tunables 0 0 0 : slabdata 0 0 0 +nfs_commit_data 4 28 1152 28 8 : tunables 0 0 0 : slabdata 1 1 0 +nfs_write_data 32 50 1280 25 8 : tunables 0 0 0 : slabdata 2 2 0 +nfs_read_data 0 0 1280 25 8 : tunables 0 0 0 : slabdata 0 0 0 +nfs_inode_cache 0 0 1408 23 8 : tunables 0 0 0 : slabdata 0 0 0 +nfs_page 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 +rpc_inode_cache 0 0 1024 32 8 : tunables 0 0 0 : slabdata 0 0 0 +rpc_buffers 8 13 2496 13 8 : tunables 0 0 0 : slabdata 1 1 0 +rpc_tasks 8 25 640 25 4 : tunables 0 0 0 : slabdata 1 1 0 +fscache_cookie_jar 1 35 464 35 4 : tunables 0 0 0 : slabdata 1 1 0 +jfs_mp 32 35 464 35 4 : tunables 0 0 0 : slabdata 1 1 0 +jfs_ip 0 0 1592 20 8 : tunables 0 0 0 : slabdata 0 0 0 +reiser_inode_cache 0 0 1096 29 8 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_end_io_wq 0 0 464 35 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_prelim_ref 0 0 424 38 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_delayed_extent_op 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_delayed_data_ref 0 0 448 36 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_delayed_tree_ref 0 0 440 37 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_delayed_ref_head 0 0 480 34 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_inode_defrag 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_delayed_node 0 0 648 25 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_ordered_extent 0 0 752 21 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_extent_map 0 0 480 34 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_extent_state 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 +bio-3 35 92 704 23 4 : tunables 0 0 0 : slabdata 4 4 0 +btrfs_extent_buffer 0 0 600 27 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_free_space_bitmap 0 0 12288 2 8 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_free_space 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_path 0 0 448 36 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_trans_handle 0 0 440 37 4 : tunables 0 0 0 : slabdata 0 0 0 +btrfs_inode 0 0 1496 21 8 : tunables 0 0 0 : slabdata 0 0 0 +ext4_inode_cache 84136 84755 1400 23 8 : tunables 0 0 0 : slabdata 3685 3685 0 +ext4_free_data 22 80 392 20 2 : tunables 0 0 0 : slabdata 4 4 0 +ext4_allocation_context 0 70 464 35 4 : tunables 0 0 0 : slabdata 2 2 0 +ext4_prealloc_space 24 74 440 37 4 : tunables 0 0 0 : slabdata 2 2 0 +ext4_system_zone 267 273 376 21 2 : tunables 0 0 0 : slabdata 13 13 0 +ext4_io_end_vec 0 88 368 22 2 : tunables 0 0 0 : slabdata 4 4 0 +ext4_io_end 0 80 400 20 2 : tunables 0 0 0 : slabdata 4 4 0 +ext4_bio_post_read_ctx 128 147 384 21 2 : tunables 0 0 0 : slabdata 7 7 0 +ext4_pending_reservation 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +ext4_extent_status 79351 79422 376 21 2 : tunables 0 0 0 : slabdata 3782 3782 0 +jbd2_transaction_s 44 100 640 25 4 : tunables 0 0 0 : slabdata 4 4 0 +jbd2_inode 6785 6840 400 20 2 : tunables 0 0 0 : slabdata 342 342 0 +jbd2_journal_handle 0 80 392 20 2 : tunables 0 0 0 : slabdata 4 4 0 +jbd2_journal_head 824 1944 448 36 4 : tunables 0 0 0 : slabdata 54 54 0 +jbd2_revoke_table_s 4 23 352 23 2 : tunables 0 0 0 : slabdata 1 1 0 +jbd2_revoke_record_s 0 156 416 39 4 : tunables 0 0 0 : slabdata 4 4 0 +ext2_inode_cache 0 0 1144 28 8 : tunables 0 0 0 : slabdata 0 0 0 +mbcache 0 0 392 20 2 : tunables 0 0 0 : slabdata 0 0 0 +dm_thin_new_mapping 0 152 424 38 4 : tunables 0 0 0 : slabdata 4 4 0 +dm_snap_pending_exception 0 0 464 35 4 : tunables 0 0 0 : slabdata 0 0 0 +dm_exception 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +dm_dirty_log_flush_entry 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +dm_bio_prison_cell_v2 0 0 432 37 4 : tunables 0 0 0 : slabdata 0 0 0 +dm_bio_prison_cell 0 148 432 37 4 : tunables 0 0 0 : slabdata 4 4 0 +kcopyd_job 0 8 3648 8 8 : tunables 0 0 0 : slabdata 1 1 0 +io 0 32 512 32 4 : tunables 0 0 0 : slabdata 1 1 0 +dm_uevent 0 0 3224 10 8 : tunables 0 0 0 : slabdata 0 0 0 +dax_cache 1 28 1152 28 8 : tunables 0 0 0 : slabdata 1 1 0 +aic94xx_ascb 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 +aic94xx_dma_token 0 0 384 21 2 : tunables 0 0 0 : slabdata 0 0 0 +asd_sas_event 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 +sas_task 0 0 704 23 4 : tunables 0 0 0 : slabdata 0 0 0 +qla2xxx_srbs 0 0 832 39 8 : tunables 0 0 0 : slabdata 0 0 0 +sd_ext_cdb 2 22 368 22 2 : tunables 0 0 0 : slabdata 1 1 0 +scsi_sense_cache 258 288 512 32 4 : tunables 0 0 0 : slabdata 9 9 0 +virtio_scsi_cmd 64 75 640 25 4 : tunables 0 0 0 : slabdata 3 3 0 +L2TP/IPv6 0 0 1536 21 8 : tunables 0 0 0 : slabdata 0 0 0 +L2TP/IP 0 0 1408 23 8 : tunables 0 0 0 : slabdata 0 0 0 +ip6-frags 0 0 520 31 4 : tunables 0 0 0 : slabdata 0 0 0 +fib6_nodes 5 32 512 32 4 : tunables 0 0 0 : slabdata 1 1 0 +ip6_dst_cache 4 25 640 25 4 : tunables 0 0 0 : slabdata 1 1 0 +ip6_mrt_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 +PINGv6 0 0 1600 20 8 : tunables 0 0 0 : slabdata 0 0 0 +RAWv6 25 40 1600 20 8 : tunables 0 0 0 : slabdata 2 2 0 +UDPLITEv6 0 0 1728 18 8 : tunables 0 0 0 : slabdata 0 0 0 +UDPv6 3 54 1728 18 8 : tunables 0 0 0 : slabdata 3 3 0 +tw_sock_TCPv6 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 +request_sock_TCPv6 0 0 632 25 4 : tunables 0 0 0 : slabdata 0 0 0 +TCPv6 0 33 2752 11 8 : tunables 0 0 0 : slabdata 3 3 0 +uhci_urb_priv 0 0 392 20 2 : tunables 0 0 0 : slabdata 0 0 0 +sgpool-128 2 14 4544 7 8 : tunables 0 0 0 : slabdata 2 2 0 +sgpool-64 2 13 2496 13 8 : tunables 0 0 0 : slabdata 1 1 0 +sgpool-32 2 44 1472 22 8 : tunables 0 0 0 : slabdata 2 2 0 +sgpool-16 2 68 960 34 8 : tunables 0 0 0 : slabdata 2 2 0 +sgpool-8 2 46 704 23 4 : tunables 0 0 0 : slabdata 2 2 0 +btree_node 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 +bfq_io_cq 0 0 488 33 4 : tunables 0 0 0 : slabdata 0 0 0 +bfq_queue 0 0 848 38 8 : tunables 0 0 0 : slabdata 0 0 0 +mqueue_inode_cache 1 24 1344 24 8 : tunables 0 0 0 : slabdata 1 1 0 +isofs_inode_cache 0 0 968 33 8 : tunables 0 0 0 : slabdata 0 0 0 +io_kiocb 0 0 640 25 4 : tunables 0 0 0 : slabdata 0 0 0 +kioctx 0 30 1088 30 8 : tunables 0 0 0 : slabdata 1 1 0 +aio_kiocb 0 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 +userfaultfd_ctx_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 +fanotify_path_event 0 0 392 20 2 : tunables 0 0 0 : slabdata 0 0 0 +fanotify_fid_event 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 +fsnotify_mark 0 0 408 20 2 : tunables 0 0 0 : slabdata 0 0 0 +dnotify_mark 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 +dnotify_struct 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +dio 0 0 1088 30 8 : tunables 0 0 0 : slabdata 0 0 0 +bio-2 4 25 640 25 4 : tunables 0 0 0 : slabdata 1 1 0 +fasync_cache 0 0 384 21 2 : tunables 0 0 0 : slabdata 0 0 0 +audit_tree_mark 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 +pid_namespace 30 34 480 34 4 : tunables 0 0 0 : slabdata 1 1 0 +posix_timers_cache 0 27 592 27 4 : tunables 0 0 0 : slabdata 1 1 0 +iommu_devinfo 24 32 512 32 4 : tunables 0 0 0 : slabdata 1 1 0 +iommu_domain 10 10 3264 10 8 : tunables 0 0 0 : slabdata 1 1 0 +iommu_iova 8682 8748 448 36 4 : tunables 0 0 0 : slabdata 243 243 0 +UNIX 529 814 1472 22 8 : tunables 0 0 0 : slabdata 37 37 0 +ip4-frags 0 0 536 30 4 : tunables 0 0 0 : slabdata 0 0 0 +ip_mrt_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 +UDP-Lite 0 0 1536 21 8 : tunables 0 0 0 : slabdata 0 0 0 +tcp_bind_bucket 7 128 512 32 4 : tunables 0 0 0 : slabdata 4 4 0 +inet_peer_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 +xfrm_dst_cache 0 0 704 23 4 : tunables 0 0 0 : slabdata 0 0 0 +xfrm_state 0 0 1152 28 8 : tunables 0 0 0 : slabdata 0 0 0 +ip_fib_trie 7 21 384 21 2 : tunables 0 0 0 : slabdata 1 1 0 +ip_fib_alias 9 20 392 20 2 : tunables 0 0 0 : slabdata 1 1 0 +ip_dst_cache 27 84 576 28 4 : tunables 0 0 0 : slabdata 3 3 0 +PING 0 0 1408 23 8 : tunables 0 0 0 : slabdata 0 0 0 +RAW 32 46 1408 23 8 : tunables 0 0 0 : slabdata 2 2 0 +UDP 11 168 1536 21 8 : tunables 0 0 0 : slabdata 8 8 0 +tw_sock_TCP 1 56 576 28 4 : tunables 0 0 0 : slabdata 2 2 0 +request_sock_TCP 0 25 632 25 4 : tunables 0 0 0 : slabdata 1 1 0 +TCP 10 60 2624 12 8 : tunables 0 0 0 : slabdata 5 5 0 +hugetlbfs_inode_cache 2 35 928 35 8 : tunables 0 0 0 : slabdata 1 1 0 +dquot 0 0 640 25 4 : tunables 0 0 0 : slabdata 0 0 0 +bio-1 32 46 704 23 4 : tunables 0 0 0 : slabdata 2 2 0 +eventpoll_pwq 409 600 408 20 2 : tunables 0 0 0 : slabdata 30 30 0 +eventpoll_epi 408 672 576 28 4 : tunables 0 0 0 : slabdata 24 24 0 +inotify_inode_mark 58 195 416 39 4 : tunables 0 0 0 : slabdata 5 5 0 +scsi_data_buffer 0 0 360 22 2 : tunables 0 0 0 : slabdata 0 0 0 +bio_crypt_ctx 128 147 376 21 2 : tunables 0 0 0 : slabdata 7 7 0 +request_queue 29 39 2408 13 8 : tunables 0 0 0 : slabdata 3 3 0 +blkdev_ioc 81 148 440 37 4 : tunables 0 0 0 : slabdata 4 4 0 +bio-0 125 200 640 25 4 : tunables 0 0 0 : slabdata 8 8 0 +biovec-max 166 196 4544 7 8 : tunables 0 0 0 : slabdata 28 28 0 +biovec-128 0 52 2496 13 8 : tunables 0 0 0 : slabdata 4 4 0 +biovec-64 0 88 1472 22 8 : tunables 0 0 0 : slabdata 4 4 0 +biovec-16 0 92 704 23 4 : tunables 0 0 0 : slabdata 4 4 0 +bio_integrity_payload 4 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 +khugepaged_mm_slot 59 180 448 36 4 : tunables 0 0 0 : slabdata 5 5 0 +ksm_mm_slot 0 0 384 21 2 : tunables 0 0 0 : slabdata 0 0 0 +ksm_stable_node 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 +ksm_rmap_item 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 +user_namespace 2 37 864 37 8 : tunables 0 0 0 : slabdata 1 1 0 +uid_cache 5 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 +dmaengine-unmap-256 1 13 2496 13 8 : tunables 0 0 0 : slabdata 1 1 0 +dmaengine-unmap-128 1 22 1472 22 8 : tunables 0 0 0 : slabdata 1 1 0 +dmaengine-unmap-16 1 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 +dmaengine-unmap-2 1 36 448 36 4 : tunables 0 0 0 : slabdata 1 1 0 +audit_buffer 0 22 360 22 2 : tunables 0 0 0 : slabdata 1 1 0 +sock_inode_cache 663 1170 1216 26 8 : tunables 0 0 0 : slabdata 45 45 0 +skbuff_ext_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 +skbuff_fclone_cache 1 72 896 36 8 : tunables 0 0 0 : slabdata 2 2 0 +skbuff_head_cache 3 650 640 25 4 : tunables 0 0 0 : slabdata 26 26 0 +configfs_dir_cache 7 38 424 38 4 : tunables 0 0 0 : slabdata 1 1 0 +file_lock_cache 27 116 552 29 4 : tunables 0 0 0 : slabdata 4 4 0 +file_lock_ctx 106 120 392 20 2 : tunables 0 0 0 : slabdata 6 6 0 +fsnotify_mark_connector 52 66 368 22 2 : tunables 0 0 0 : slabdata 3 3 0 +net_namespace 1 6 5312 6 8 : tunables 0 0 0 : slabdata 1 1 0 +task_delay_info 784 1560 416 39 4 : tunables 0 0 0 : slabdata 40 40 0 +taskstats 45 92 688 23 4 : tunables 0 0 0 : slabdata 4 4 0 +proc_dir_entry 678 682 528 31 4 : tunables 0 0 0 : slabdata 22 22 0 +pde_opener 0 189 376 21 2 : tunables 0 0 0 : slabdata 9 9 0 +proc_inode_cache 7150 8250 992 33 8 : tunables 0 0 0 : slabdata 250 250 0 +seq_file 60 735 456 35 4 : tunables 0 0 0 : slabdata 21 21 0 +sigqueue 0 156 416 39 4 : tunables 0 0 0 : slabdata 4 4 0 +bdev_cache 36 78 1216 26 8 : tunables 0 0 0 : slabdata 3 3 0 +shmem_inode_cache 1599 2208 1016 32 8 : tunables 0 0 0 : slabdata 69 69 0 +kernfs_iattrs_cache 1251 1254 424 38 4 : tunables 0 0 0 : slabdata 33 33 0 +kernfs_node_cache 52898 52920 464 35 4 : tunables 0 0 0 : slabdata 1512 1512 0 +mnt_cache 42 46 704 23 4 : tunables 0 0 0 : slabdata 2 2 0 +filp 4314 6371 704 23 4 : tunables 0 0 0 : slabdata 277 277 0 +inode_cache 28695 29505 920 35 8 : tunables 0 0 0 : slabdata 843 843 0 +dentry 166069 169074 528 31 4 : tunables 0 0 0 : slabdata 5454 5454 0 +names_cache 0 35 4544 7 8 : tunables 0 0 0 : slabdata 5 5 0 +hashtab_node 0 0 360 22 2 : tunables 0 0 0 : slabdata 0 0 0 +ebitmap_node 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 +avtab_extended_perms 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +avtab_node 0 0 360 22 2 : tunables 0 0 0 : slabdata 0 0 0 +avc_xperms_data 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +avc_xperms_decision_node 0 0 384 21 2 : tunables 0 0 0 : slabdata 0 0 0 +avc_xperms_node 0 0 392 20 2 : tunables 0 0 0 : slabdata 0 0 0 +avc_node 37 40 408 20 2 : tunables 0 0 0 : slabdata 2 2 0 +iint_cache 0 0 448 36 4 : tunables 0 0 0 : slabdata 0 0 0 +lsm_inode_cache 122284 122340 392 20 2 : tunables 0 0 0 : slabdata 6117 6117 0 +lsm_file_cache 4266 4485 352 23 2 : tunables 0 0 0 : slabdata 195 195 0 +key_jar 8 25 640 25 4 : tunables 0 0 0 : slabdata 1 1 0 +buffer_head 255622 257076 440 37 4 : tunables 0 0 0 : slabdata 6948 6948 0 +uts_namespace 0 0 776 21 4 : tunables 0 0 0 : slabdata 0 0 0 +nsproxy 31 40 408 20 2 : tunables 0 0 0 : slabdata 2 2 0 +vm_area_struct 39115 43214 528 31 4 : tunables 0 0 0 : slabdata 1394 1394 0 +mm_struct 96 529 1408 23 8 : tunables 0 0 0 : slabdata 23 23 0 +fs_cache 102 756 448 36 4 : tunables 0 0 0 : slabdata 21 21 0 +files_cache 102 588 1152 28 8 : tunables 0 0 0 : slabdata 21 21 0 +signal_cache 266 672 1536 21 8 : tunables 0 0 0 : slabdata 32 32 0 +sighand_cache 266 507 2496 13 8 : tunables 0 0 0 : slabdata 39 39 0 +task_struct 783 963 10240 3 8 : tunables 0 0 0 : slabdata 321 321 0 +cred_jar 364 952 576 28 4 : tunables 0 0 0 : slabdata 34 34 0 +anon_vma_chain 63907 67821 416 39 4 : tunables 0 0 0 : slabdata 1739 1739 0 +anon_vma 25891 28899 416 39 4 : tunables 0 0 0 : slabdata 741 741 0 +pid 408 992 512 32 4 : tunables 0 0 0 : slabdata 31 31 0 +Acpi-Operand 6682 6740 408 20 2 : tunables 0 0 0 : slabdata 337 337 0 +Acpi-ParseExt 0 39 416 39 4 : tunables 0 0 0 : slabdata 1 1 0 +Acpi-Parse 0 80 392 20 2 : tunables 0 0 0 : slabdata 4 4 0 +Acpi-State 0 78 416 39 4 : tunables 0 0 0 : slabdata 2 2 0 +Acpi-Namespace 3911 3948 384 21 2 : tunables 0 0 0 : slabdata 188 188 0 +trace_event_file 2638 2660 424 38 4 : tunables 0 0 0 : slabdata 70 70 0 +ftrace_event_field 6592 6594 384 21 2 : tunables 0 0 0 : slabdata 314 314 0 +pool_workqueue 41 64 1024 32 8 : tunables 0 0 0 : slabdata 2 2 0 +radix_tree_node 21638 24045 912 35 8 : tunables 0 0 0 : slabdata 687 687 0 +task_group 48 78 1216 26 8 : tunables 0 0 0 : slabdata 3 3 0 +vmap_area 4411 4680 400 20 2 : tunables 0 0 0 : slabdata 234 234 0 +dma-kmalloc-8k 0 0 24576 1 8 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-4k 0 0 12288 2 8 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-2k 0 0 6144 5 8 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-1k 0 0 3072 10 8 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-512 0 0 1536 21 8 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-256 0 0 1024 32 8 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-128 0 0 640 25 4 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-64 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-32 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-16 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-8 0 0 344 23 2 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-192 0 0 528 31 4 : tunables 0 0 0 : slabdata 0 0 0 +dma-kmalloc-96 0 0 432 37 4 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-8k 0 0 24576 1 8 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-4k 0 0 12288 2 8 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-2k 0 0 6144 5 8 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-1k 0 0 3072 10 8 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-512 0 0 1536 21 8 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-256 0 0 1024 32 8 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-192 0 0 528 31 4 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-128 31 75 640 25 4 : tunables 0 0 0 : slabdata 3 3 0 +kmalloc-rcl-96 3371 3626 432 37 4 : tunables 0 0 0 : slabdata 98 98 0 +kmalloc-rcl-64 2080 2272 512 32 4 : tunables 0 0 0 : slabdata 71 71 0 +kmalloc-rcl-32 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-16 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-rcl-8 0 0 344 23 2 : tunables 0 0 0 : slabdata 0 0 0 +kmalloc-8k 133 140 24576 1 8 : tunables 0 0 0 : slabdata 140 140 0 +kmalloc-4k 403 444 12288 2 8 : tunables 0 0 0 : slabdata 222 222 0 +kmalloc-2k 2391 2585 6144 5 8 : tunables 0 0 0 : slabdata 517 517 0 +kmalloc-1k 2163 2420 3072 10 8 : tunables 0 0 0 : slabdata 242 242 0 +kmalloc-512 2972 3633 1536 21 8 : tunables 0 0 0 : slabdata 173 173 0 +kmalloc-256 1841 1856 1024 32 8 : tunables 0 0 0 : slabdata 58 58 0 +kmalloc-192 2165 2914 528 31 4 : tunables 0 0 0 : slabdata 94 94 0 +kmalloc-128 1137 1175 640 25 4 : tunables 0 0 0 : slabdata 47 47 0 +kmalloc-96 1925 2590 432 37 4 : tunables 0 0 0 : slabdata 70 70 0 +kmalloc-64 9433 10688 512 32 4 : tunables 0 0 0 : slabdata 334 334 0 +kmalloc-32 9098 10062 416 39 4 : tunables 0 0 0 : slabdata 258 258 0 +kmalloc-16 10914 10956 368 22 2 : tunables 0 0 0 : slabdata 498 498 0 +kmalloc-8 7576 7705 344 23 2 : tunables 0 0 0 : slabdata 335 335 0 +kmem_cache_node 904 928 512 32 4 : tunables 0 0 0 : slabdata 29 29 0 +kmem_cache 904 936 832 39 8 : tunables 0 0 0 : slabdata 24 24 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/stat Lines: 16 cpu 301854 612 111922 8979004 3552 2 3944 0 0 0 @@ -4639,6 +4978,35 @@ Mode: 644 Directory: fixtures/sys/devices/system Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/system/node +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/system/node/node1 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/system/node/node1/vmstat +Lines: 6 +nr_free_pages 1 +nr_zone_inactive_anon 2 +nr_zone_active_anon 3 +nr_zone_inactive_file 4 +nr_zone_active_file 5 +nr_zone_unevictable 6 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/system/node/node2 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/system/node/node2/vmstat +Lines: 6 +nr_free_pages 7 +nr_zone_inactive_anon 8 +nr_zone_active_anon 9 +nr_zone_inactive_file 10 +nr_zone_active_file 11 +nr_zone_unevictable 12 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/devices/system/clocksource Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/fscache.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/fscache.go index 8783cf3cc18c..f8070e6e2bec 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/fscache.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/fscache.go @@ -236,7 +236,7 @@ func (fs FS) Fscacheinfo() (Fscacheinfo, error) { m, err := parseFscacheinfo(bytes.NewReader(b)) if err != nil { - return Fscacheinfo{}, fmt.Errorf("failed to parse Fscacheinfo: %v", err) + return Fscacheinfo{}, fmt.Errorf("failed to parse Fscacheinfo: %w", err) } return *m, nil diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/go.mod b/cluster-autoscaler/vendor/github.com/prometheus/procfs/go.mod index ded48253cd66..ba6681f52177 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/go.mod +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/go.mod @@ -1,9 +1,9 @@ module github.com/prometheus/procfs -go 1.12 +go 1.13 require ( - github.com/google/go-cmp v0.3.1 - golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e - golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e + github.com/google/go-cmp v0.5.4 + golang.org/x/sync v0.0.0-20201207232520-09787c993a3a + golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c ) diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/go.sum b/cluster-autoscaler/vendor/github.com/prometheus/procfs/go.sum index 54b5f330339f..7ceaf56b7d59 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/go.sum +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/go.sum @@ -1,6 +1,8 @@ -github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e h1:LwyF2AFISC9nVbS6MgzsaQNSUsRXI49GS+YQ5KX/QH0= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/internal/fs/fs.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/internal/fs/fs.go index 565e89e42c4d..0040753b1c18 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/internal/fs/fs.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/internal/fs/fs.go @@ -39,10 +39,10 @@ type FS string func NewFS(mountPoint string) (FS, error) { info, err := os.Stat(mountPoint) if err != nil { - return "", fmt.Errorf("could not read %s: %s", mountPoint, err) + return "", fmt.Errorf("could not read %q: %w", mountPoint, err) } if !info.IsDir() { - return "", fmt.Errorf("mount point %s is not a directory", mountPoint) + return "", fmt.Errorf("mount point %q is not a directory", mountPoint) } return FS(mountPoint), nil diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/loadavg.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/loadavg.go index 00bbe1441727..0cce190ec22b 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/loadavg.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/loadavg.go @@ -44,14 +44,14 @@ func parseLoad(loadavgBytes []byte) (*LoadAvg, error) { loads := make([]float64, 3) parts := strings.Fields(string(loadavgBytes)) if len(parts) < 3 { - return nil, fmt.Errorf("malformed loadavg line: too few fields in loadavg string: %s", string(loadavgBytes)) + return nil, fmt.Errorf("malformed loadavg line: too few fields in loadavg string: %q", string(loadavgBytes)) } var err error for i, load := range parts[0:3] { loads[i], err = strconv.ParseFloat(load, 64) if err != nil { - return nil, fmt.Errorf("could not parse load '%s': %s", load, err) + return nil, fmt.Errorf("could not parse load %q: %w", load, err) } } return &LoadAvg{ diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/mdstat.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/mdstat.go index 98e37aa8cafd..4c4493bfa505 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/mdstat.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/mdstat.go @@ -22,8 +22,9 @@ import ( ) var ( - statusLineRE = regexp.MustCompile(`(\d+) blocks .*\[(\d+)/(\d+)\] \[[U_]+\]`) - recoveryLineRE = regexp.MustCompile(`\((\d+)/\d+\)`) + statusLineRE = regexp.MustCompile(`(\d+) blocks .*\[(\d+)/(\d+)\] \[[U_]+\]`) + recoveryLineRE = regexp.MustCompile(`\((\d+)/\d+\)`) + componentDeviceRE = regexp.MustCompile(`(.*)\[\d+\]`) ) // MDStat holds info parsed from /proc/mdstat. @@ -44,6 +45,8 @@ type MDStat struct { BlocksTotal int64 // Number of blocks on the device that are in sync. BlocksSynced int64 + // Name of md component devices + Devices []string } // MDStat parses an mdstat-file (/proc/mdstat) and returns a slice of @@ -56,7 +59,7 @@ func (fs FS) MDStat() ([]MDStat, error) { } mdstat, err := parseMDStat(data) if err != nil { - return nil, fmt.Errorf("error parsing mdstat %s: %s", fs.proc.Path("mdstat"), err) + return nil, fmt.Errorf("error parsing mdstat %q: %w", fs.proc.Path("mdstat"), err) } return mdstat, nil } @@ -82,10 +85,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) { state := deviceFields[2] // active or inactive if len(lines) <= i+3 { - return nil, fmt.Errorf( - "error parsing %s: too few lines for md device", - mdName, - ) + return nil, fmt.Errorf("error parsing %q: too few lines for md device", mdName) } // Failed disks have the suffix (F) & Spare disks have the suffix (S). @@ -94,7 +94,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) { active, total, size, err := evalStatusLine(lines[i], lines[i+1]) if err != nil { - return nil, fmt.Errorf("error parsing md device lines: %s", err) + return nil, fmt.Errorf("error parsing md device lines: %w", err) } syncLineIdx := i + 2 @@ -126,7 +126,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) { } else { syncedBlocks, err = evalRecoveryLine(lines[syncLineIdx]) if err != nil { - return nil, fmt.Errorf("error parsing sync line in md device %s: %s", mdName, err) + return nil, fmt.Errorf("error parsing sync line in md device %q: %w", mdName, err) } } } @@ -140,6 +140,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) { DisksTotal: total, BlocksTotal: size, BlocksSynced: syncedBlocks, + Devices: evalComponentDevices(deviceFields), }) } @@ -151,7 +152,7 @@ func evalStatusLine(deviceLine, statusLine string) (active, total, size int64, e sizeStr := strings.Fields(statusLine)[0] size, err = strconv.ParseInt(sizeStr, 10, 64) if err != nil { - return 0, 0, 0, fmt.Errorf("unexpected statusLine %s: %s", statusLine, err) + return 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err) } if strings.Contains(deviceLine, "raid0") || strings.Contains(deviceLine, "linear") { @@ -171,12 +172,12 @@ func evalStatusLine(deviceLine, statusLine string) (active, total, size int64, e total, err = strconv.ParseInt(matches[2], 10, 64) if err != nil { - return 0, 0, 0, fmt.Errorf("unexpected statusLine %s: %s", statusLine, err) + return 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err) } active, err = strconv.ParseInt(matches[3], 10, 64) if err != nil { - return 0, 0, 0, fmt.Errorf("unexpected statusLine %s: %s", statusLine, err) + return 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err) } return active, total, size, nil @@ -190,8 +191,23 @@ func evalRecoveryLine(recoveryLine string) (syncedBlocks int64, err error) { syncedBlocks, err = strconv.ParseInt(matches[1], 10, 64) if err != nil { - return 0, fmt.Errorf("%s in recoveryLine: %s", err, recoveryLine) + return 0, fmt.Errorf("error parsing int from recoveryLine %q: %w", recoveryLine, err) } return syncedBlocks, nil } + +func evalComponentDevices(deviceFields []string) []string { + mdComponentDevices := make([]string, 0) + if len(deviceFields) > 3 { + for _, field := range deviceFields[4:] { + match := componentDeviceRE.FindStringSubmatch(field) + if match == nil { + continue + } + mdComponentDevices = append(mdComponentDevices, match[1]) + } + } + + return mdComponentDevices +} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/meminfo.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/meminfo.go index 50dab4bcd59f..f65e174e57b3 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/meminfo.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/meminfo.go @@ -28,9 +28,9 @@ import ( type Meminfo struct { // Total usable ram (i.e. physical ram minus a few reserved // bits and the kernel binary code) - MemTotal uint64 + MemTotal *uint64 // The sum of LowFree+HighFree - MemFree uint64 + MemFree *uint64 // An estimate of how much memory is available for starting // new applications, without swapping. Calculated from // MemFree, SReclaimable, the size of the file LRU lists, and @@ -39,59 +39,59 @@ type Meminfo struct { // well, and that not all reclaimable slab will be // reclaimable, due to items being in use. The impact of those // factors will vary from system to system. - MemAvailable uint64 + MemAvailable *uint64 // Relatively temporary storage for raw disk blocks shouldn't // get tremendously large (20MB or so) - Buffers uint64 - Cached uint64 + Buffers *uint64 + Cached *uint64 // Memory that once was swapped out, is swapped back in but // still also is in the swapfile (if memory is needed it // doesn't need to be swapped out AGAIN because it is already // in the swapfile. This saves I/O) - SwapCached uint64 + SwapCached *uint64 // Memory that has been used more recently and usually not // reclaimed unless absolutely necessary. - Active uint64 + Active *uint64 // Memory which has been less recently used. It is more // eligible to be reclaimed for other purposes - Inactive uint64 - ActiveAnon uint64 - InactiveAnon uint64 - ActiveFile uint64 - InactiveFile uint64 - Unevictable uint64 - Mlocked uint64 + Inactive *uint64 + ActiveAnon *uint64 + InactiveAnon *uint64 + ActiveFile *uint64 + InactiveFile *uint64 + Unevictable *uint64 + Mlocked *uint64 // total amount of swap space available - SwapTotal uint64 + SwapTotal *uint64 // Memory which has been evicted from RAM, and is temporarily // on the disk - SwapFree uint64 + SwapFree *uint64 // Memory which is waiting to get written back to the disk - Dirty uint64 + Dirty *uint64 // Memory which is actively being written back to the disk - Writeback uint64 + Writeback *uint64 // Non-file backed pages mapped into userspace page tables - AnonPages uint64 + AnonPages *uint64 // files which have been mapped, such as libraries - Mapped uint64 - Shmem uint64 + Mapped *uint64 + Shmem *uint64 // in-kernel data structures cache - Slab uint64 + Slab *uint64 // Part of Slab, that might be reclaimed, such as caches - SReclaimable uint64 + SReclaimable *uint64 // Part of Slab, that cannot be reclaimed on memory pressure - SUnreclaim uint64 - KernelStack uint64 + SUnreclaim *uint64 + KernelStack *uint64 // amount of memory dedicated to the lowest level of page // tables. - PageTables uint64 + PageTables *uint64 // NFS pages sent to the server, but not yet committed to // stable storage - NFSUnstable uint64 + NFSUnstable *uint64 // Memory used for block device "bounce buffers" - Bounce uint64 + Bounce *uint64 // Memory used by FUSE for temporary writeback buffers - WritebackTmp uint64 + WritebackTmp *uint64 // Based on the overcommit ratio ('vm.overcommit_ratio'), // this is the total amount of memory currently available to // be allocated on the system. This limit is only adhered to @@ -105,7 +105,7 @@ type Meminfo struct { // yield a CommitLimit of 7.3G. // For more details, see the memory overcommit documentation // in vm/overcommit-accounting. - CommitLimit uint64 + CommitLimit *uint64 // The amount of memory presently allocated on the system. // The committed memory is a sum of all of the memory which // has been allocated by processes, even if it has not been @@ -119,27 +119,27 @@ type Meminfo struct { // This is useful if one needs to guarantee that processes will // not fail due to lack of memory once that memory has been // successfully allocated. - CommittedAS uint64 + CommittedAS *uint64 // total size of vmalloc memory area - VmallocTotal uint64 + VmallocTotal *uint64 // amount of vmalloc area which is used - VmallocUsed uint64 + VmallocUsed *uint64 // largest contiguous block of vmalloc area which is free - VmallocChunk uint64 - HardwareCorrupted uint64 - AnonHugePages uint64 - ShmemHugePages uint64 - ShmemPmdMapped uint64 - CmaTotal uint64 - CmaFree uint64 - HugePagesTotal uint64 - HugePagesFree uint64 - HugePagesRsvd uint64 - HugePagesSurp uint64 - Hugepagesize uint64 - DirectMap4k uint64 - DirectMap2M uint64 - DirectMap1G uint64 + VmallocChunk *uint64 + HardwareCorrupted *uint64 + AnonHugePages *uint64 + ShmemHugePages *uint64 + ShmemPmdMapped *uint64 + CmaTotal *uint64 + CmaFree *uint64 + HugePagesTotal *uint64 + HugePagesFree *uint64 + HugePagesRsvd *uint64 + HugePagesSurp *uint64 + Hugepagesize *uint64 + DirectMap4k *uint64 + DirectMap2M *uint64 + DirectMap1G *uint64 } // Meminfo returns an information about current kernel/system memory statistics. @@ -152,7 +152,7 @@ func (fs FS) Meminfo() (Meminfo, error) { m, err := parseMemInfo(bytes.NewReader(b)) if err != nil { - return Meminfo{}, fmt.Errorf("failed to parse meminfo: %v", err) + return Meminfo{}, fmt.Errorf("failed to parse meminfo: %w", err) } return *m, nil @@ -175,101 +175,101 @@ func parseMemInfo(r io.Reader) (*Meminfo, error) { switch fields[0] { case "MemTotal:": - m.MemTotal = v + m.MemTotal = &v case "MemFree:": - m.MemFree = v + m.MemFree = &v case "MemAvailable:": - m.MemAvailable = v + m.MemAvailable = &v case "Buffers:": - m.Buffers = v + m.Buffers = &v case "Cached:": - m.Cached = v + m.Cached = &v case "SwapCached:": - m.SwapCached = v + m.SwapCached = &v case "Active:": - m.Active = v + m.Active = &v case "Inactive:": - m.Inactive = v + m.Inactive = &v case "Active(anon):": - m.ActiveAnon = v + m.ActiveAnon = &v case "Inactive(anon):": - m.InactiveAnon = v + m.InactiveAnon = &v case "Active(file):": - m.ActiveFile = v + m.ActiveFile = &v case "Inactive(file):": - m.InactiveFile = v + m.InactiveFile = &v case "Unevictable:": - m.Unevictable = v + m.Unevictable = &v case "Mlocked:": - m.Mlocked = v + m.Mlocked = &v case "SwapTotal:": - m.SwapTotal = v + m.SwapTotal = &v case "SwapFree:": - m.SwapFree = v + m.SwapFree = &v case "Dirty:": - m.Dirty = v + m.Dirty = &v case "Writeback:": - m.Writeback = v + m.Writeback = &v case "AnonPages:": - m.AnonPages = v + m.AnonPages = &v case "Mapped:": - m.Mapped = v + m.Mapped = &v case "Shmem:": - m.Shmem = v + m.Shmem = &v case "Slab:": - m.Slab = v + m.Slab = &v case "SReclaimable:": - m.SReclaimable = v + m.SReclaimable = &v case "SUnreclaim:": - m.SUnreclaim = v + m.SUnreclaim = &v case "KernelStack:": - m.KernelStack = v + m.KernelStack = &v case "PageTables:": - m.PageTables = v + m.PageTables = &v case "NFS_Unstable:": - m.NFSUnstable = v + m.NFSUnstable = &v case "Bounce:": - m.Bounce = v + m.Bounce = &v case "WritebackTmp:": - m.WritebackTmp = v + m.WritebackTmp = &v case "CommitLimit:": - m.CommitLimit = v + m.CommitLimit = &v case "Committed_AS:": - m.CommittedAS = v + m.CommittedAS = &v case "VmallocTotal:": - m.VmallocTotal = v + m.VmallocTotal = &v case "VmallocUsed:": - m.VmallocUsed = v + m.VmallocUsed = &v case "VmallocChunk:": - m.VmallocChunk = v + m.VmallocChunk = &v case "HardwareCorrupted:": - m.HardwareCorrupted = v + m.HardwareCorrupted = &v case "AnonHugePages:": - m.AnonHugePages = v + m.AnonHugePages = &v case "ShmemHugePages:": - m.ShmemHugePages = v + m.ShmemHugePages = &v case "ShmemPmdMapped:": - m.ShmemPmdMapped = v + m.ShmemPmdMapped = &v case "CmaTotal:": - m.CmaTotal = v + m.CmaTotal = &v case "CmaFree:": - m.CmaFree = v + m.CmaFree = &v case "HugePages_Total:": - m.HugePagesTotal = v + m.HugePagesTotal = &v case "HugePages_Free:": - m.HugePagesFree = v + m.HugePagesFree = &v case "HugePages_Rsvd:": - m.HugePagesRsvd = v + m.HugePagesRsvd = &v case "HugePages_Surp:": - m.HugePagesSurp = v + m.HugePagesSurp = &v case "Hugepagesize:": - m.Hugepagesize = v + m.Hugepagesize = &v case "DirectMap4k:": - m.DirectMap4k = v + m.DirectMap4k = &v case "DirectMap2M:": - m.DirectMap2M = v + m.DirectMap2M = &v case "DirectMap1G:": - m.DirectMap1G = v + m.DirectMap1G = &v } } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/mountstats.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/mountstats.go index 861ced9da030..f7a828bb1da7 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/mountstats.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/mountstats.go @@ -338,12 +338,12 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e if len(ss) == 0 { break } - if len(ss) < 2 { - return nil, fmt.Errorf("not enough information for NFS stats: %v", ss) - } switch ss[0] { case fieldOpts: + if len(ss) < 2 { + return nil, fmt.Errorf("not enough information for NFS stats: %v", ss) + } if stats.Opts == nil { stats.Opts = map[string]string{} } @@ -356,6 +356,9 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e } } case fieldAge: + if len(ss) < 2 { + return nil, fmt.Errorf("not enough information for NFS stats: %v", ss) + } // Age integer is in seconds d, err := time.ParseDuration(ss[1] + "s") if err != nil { @@ -364,6 +367,9 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e stats.Age = d case fieldBytes: + if len(ss) < 2 { + return nil, fmt.Errorf("not enough information for NFS stats: %v", ss) + } bstats, err := parseNFSBytesStats(ss[1:]) if err != nil { return nil, err @@ -371,6 +377,9 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e stats.Bytes = *bstats case fieldEvents: + if len(ss) < 2 { + return nil, fmt.Errorf("not enough information for NFS stats: %v", ss) + } estats, err := parseNFSEventsStats(ss[1:]) if err != nil { return nil, err diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_conntrackstat.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_conntrackstat.go index b637be98458f..9964a3600b4b 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_conntrackstat.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_conntrackstat.go @@ -55,7 +55,7 @@ func readConntrackStat(path string) ([]ConntrackStatEntry, error) { stat, err := parseConntrackStat(bytes.NewReader(b)) if err != nil { - return nil, fmt.Errorf("failed to read conntrack stats from %q: %v", path, err) + return nil, fmt.Errorf("failed to read conntrack stats from %q: %w", path, err) } return stat, nil @@ -147,7 +147,7 @@ func parseConntrackStatEntry(fields []string) (*ConntrackStatEntry, error) { func parseConntrackStatField(field string) (uint64, error) { val, err := strconv.ParseUint(field, 16, 64) if err != nil { - return 0, fmt.Errorf("couldn't parse \"%s\" field: %s", field, err) + return 0, fmt.Errorf("couldn't parse %q field: %w", field, err) } return val, err } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_ip_socket.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_ip_socket.go new file mode 100644 index 000000000000..ac01dd84753f --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_ip_socket.go @@ -0,0 +1,220 @@ +// Copyright 2020 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "encoding/hex" + "fmt" + "io" + "net" + "os" + "strconv" + "strings" +) + +const ( + // readLimit is used by io.LimitReader while reading the content of the + // /proc/net/udp{,6} files. The number of lines inside such a file is dynamic + // as each line represents a single used socket. + // In theory, the number of available sockets is 65535 (2^16 - 1) per IP. + // With e.g. 150 Byte per line and the maximum number of 65535, + // the reader needs to handle 150 Byte * 65535 =~ 10 MB for a single IP. + readLimit = 4294967296 // Byte -> 4 GiB +) + +// this contains generic data structures for both udp and tcp sockets +type ( + // NetIPSocket represents the contents of /proc/net/{t,u}dp{,6} file without the header. + NetIPSocket []*netIPSocketLine + + // NetIPSocketSummary provides already computed values like the total queue lengths or + // the total number of used sockets. In contrast to NetIPSocket it does not collect + // the parsed lines into a slice. + NetIPSocketSummary struct { + // TxQueueLength shows the total queue length of all parsed tx_queue lengths. + TxQueueLength uint64 + // RxQueueLength shows the total queue length of all parsed rx_queue lengths. + RxQueueLength uint64 + // UsedSockets shows the total number of parsed lines representing the + // number of used sockets. + UsedSockets uint64 + } + + // netIPSocketLine represents the fields parsed from a single line + // in /proc/net/{t,u}dp{,6}. Fields which are not used by IPSocket are skipped. + // For the proc file format details, see https://linux.die.net/man/5/proc. + netIPSocketLine struct { + Sl uint64 + LocalAddr net.IP + LocalPort uint64 + RemAddr net.IP + RemPort uint64 + St uint64 + TxQueue uint64 + RxQueue uint64 + UID uint64 + } +) + +func newNetIPSocket(file string) (NetIPSocket, error) { + f, err := os.Open(file) + if err != nil { + return nil, err + } + defer f.Close() + + var netIPSocket NetIPSocket + + lr := io.LimitReader(f, readLimit) + s := bufio.NewScanner(lr) + s.Scan() // skip first line with headers + for s.Scan() { + fields := strings.Fields(s.Text()) + line, err := parseNetIPSocketLine(fields) + if err != nil { + return nil, err + } + netIPSocket = append(netIPSocket, line) + } + if err := s.Err(); err != nil { + return nil, err + } + return netIPSocket, nil +} + +// newNetIPSocketSummary creates a new NetIPSocket{,6} from the contents of the given file. +func newNetIPSocketSummary(file string) (*NetIPSocketSummary, error) { + f, err := os.Open(file) + if err != nil { + return nil, err + } + defer f.Close() + + var netIPSocketSummary NetIPSocketSummary + + lr := io.LimitReader(f, readLimit) + s := bufio.NewScanner(lr) + s.Scan() // skip first line with headers + for s.Scan() { + fields := strings.Fields(s.Text()) + line, err := parseNetIPSocketLine(fields) + if err != nil { + return nil, err + } + netIPSocketSummary.TxQueueLength += line.TxQueue + netIPSocketSummary.RxQueueLength += line.RxQueue + netIPSocketSummary.UsedSockets++ + } + if err := s.Err(); err != nil { + return nil, err + } + return &netIPSocketSummary, nil +} + +// the /proc/net/{t,u}dp{,6} files are network byte order for ipv4 and for ipv6 the address is four words consisting of four bytes each. In each of those four words the four bytes are written in reverse order. + +func parseIP(hexIP string) (net.IP, error) { + var byteIP []byte + byteIP, err := hex.DecodeString(hexIP) + if err != nil { + return nil, fmt.Errorf("cannot parse address field in socket line %q", hexIP) + } + switch len(byteIP) { + case 4: + return net.IP{byteIP[3], byteIP[2], byteIP[1], byteIP[0]}, nil + case 16: + i := net.IP{ + byteIP[3], byteIP[2], byteIP[1], byteIP[0], + byteIP[7], byteIP[6], byteIP[5], byteIP[4], + byteIP[11], byteIP[10], byteIP[9], byteIP[8], + byteIP[15], byteIP[14], byteIP[13], byteIP[12], + } + return i, nil + default: + return nil, fmt.Errorf("Unable to parse IP %s", hexIP) + } +} + +// parseNetIPSocketLine parses a single line, represented by a list of fields. +func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) { + line := &netIPSocketLine{} + if len(fields) < 8 { + return nil, fmt.Errorf( + "cannot parse net socket line as it has less then 8 columns %q", + strings.Join(fields, " "), + ) + } + var err error // parse error + + // sl + s := strings.Split(fields[0], ":") + if len(s) != 2 { + return nil, fmt.Errorf("cannot parse sl field in socket line %q", fields[0]) + } + + if line.Sl, err = strconv.ParseUint(s[0], 0, 64); err != nil { + return nil, fmt.Errorf("cannot parse sl value in socket line: %w", err) + } + // local_address + l := strings.Split(fields[1], ":") + if len(l) != 2 { + return nil, fmt.Errorf("cannot parse local_address field in socket line %q", fields[1]) + } + if line.LocalAddr, err = parseIP(l[0]); err != nil { + return nil, err + } + if line.LocalPort, err = strconv.ParseUint(l[1], 16, 64); err != nil { + return nil, fmt.Errorf("cannot parse local_address port value in socket line: %w", err) + } + + // remote_address + r := strings.Split(fields[2], ":") + if len(r) != 2 { + return nil, fmt.Errorf("cannot parse rem_address field in socket line %q", fields[1]) + } + if line.RemAddr, err = parseIP(r[0]); err != nil { + return nil, err + } + if line.RemPort, err = strconv.ParseUint(r[1], 16, 64); err != nil { + return nil, fmt.Errorf("cannot parse rem_address port value in socket line: %w", err) + } + + // st + if line.St, err = strconv.ParseUint(fields[3], 16, 64); err != nil { + return nil, fmt.Errorf("cannot parse st value in socket line: %w", err) + } + + // tx_queue and rx_queue + q := strings.Split(fields[4], ":") + if len(q) != 2 { + return nil, fmt.Errorf( + "cannot parse tx/rx queues in socket line as it has a missing colon %q", + fields[4], + ) + } + if line.TxQueue, err = strconv.ParseUint(q[0], 16, 64); err != nil { + return nil, fmt.Errorf("cannot parse tx_queue value in socket line: %w", err) + } + if line.RxQueue, err = strconv.ParseUint(q[1], 16, 64); err != nil { + return nil, fmt.Errorf("cannot parse rx_queue value in socket line: %w", err) + } + + // uid + if line.UID, err = strconv.ParseUint(fields[7], 0, 64); err != nil { + return nil, fmt.Errorf("cannot parse uid value in socket line: %w", err) + } + + return line, nil +} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_protocols.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_protocols.go new file mode 100644 index 000000000000..8c6de3791baf --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_protocols.go @@ -0,0 +1,180 @@ +// Copyright 2020 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "bytes" + "fmt" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// NetProtocolStats stores the contents from /proc/net/protocols +type NetProtocolStats map[string]NetProtocolStatLine + +// NetProtocolStatLine contains a single line parsed from /proc/net/protocols. We +// only care about the first six columns as the rest are not likely to change +// and only serve to provide a set of capabilities for each protocol. +type NetProtocolStatLine struct { + Name string // 0 The name of the protocol + Size uint64 // 1 The size, in bytes, of a given protocol structure. e.g. sizeof(struct tcp_sock) or sizeof(struct unix_sock) + Sockets int64 // 2 Number of sockets in use by this protocol + Memory int64 // 3 Number of 4KB pages allocated by all sockets of this protocol + Pressure int // 4 This is either yes, no, or NI (not implemented). For the sake of simplicity we treat NI as not experiencing memory pressure. + MaxHeader uint64 // 5 Protocol specific max header size + Slab bool // 6 Indicates whether or not memory is allocated from the SLAB + ModuleName string // 7 The name of the module that implemented this protocol or "kernel" if not from a module + Capabilities NetProtocolCapabilities +} + +// NetProtocolCapabilities contains a list of capabilities for each protocol +type NetProtocolCapabilities struct { + Close bool // 8 + Connect bool // 9 + Disconnect bool // 10 + Accept bool // 11 + IoCtl bool // 12 + Init bool // 13 + Destroy bool // 14 + Shutdown bool // 15 + SetSockOpt bool // 16 + GetSockOpt bool // 17 + SendMsg bool // 18 + RecvMsg bool // 19 + SendPage bool // 20 + Bind bool // 21 + BacklogRcv bool // 22 + Hash bool // 23 + UnHash bool // 24 + GetPort bool // 25 + EnterMemoryPressure bool // 26 +} + +// NetProtocols reads stats from /proc/net/protocols and returns a map of +// PortocolStatLine entries. As of this writing no official Linux Documentation +// exists, however the source is fairly self-explanatory and the format seems +// stable since its introduction in 2.6.12-rc2 +// Linux 2.6.12-rc2 - https://elixir.bootlin.com/linux/v2.6.12-rc2/source/net/core/sock.c#L1452 +// Linux 5.10 - https://elixir.bootlin.com/linux/v5.10.4/source/net/core/sock.c#L3586 +func (fs FS) NetProtocols() (NetProtocolStats, error) { + data, err := util.ReadFileNoStat(fs.proc.Path("net/protocols")) + if err != nil { + return NetProtocolStats{}, err + } + return parseNetProtocols(bufio.NewScanner(bytes.NewReader(data))) +} + +func parseNetProtocols(s *bufio.Scanner) (NetProtocolStats, error) { + nps := NetProtocolStats{} + + // Skip the header line + s.Scan() + + for s.Scan() { + line, err := nps.parseLine(s.Text()) + if err != nil { + return NetProtocolStats{}, err + } + + nps[line.Name] = *line + } + return nps, nil +} + +func (ps NetProtocolStats) parseLine(rawLine string) (*NetProtocolStatLine, error) { + line := &NetProtocolStatLine{Capabilities: NetProtocolCapabilities{}} + var err error + const enabled = "yes" + const disabled = "no" + + fields := strings.Fields(rawLine) + line.Name = fields[0] + line.Size, err = strconv.ParseUint(fields[1], 10, 64) + if err != nil { + return nil, err + } + line.Sockets, err = strconv.ParseInt(fields[2], 10, 64) + if err != nil { + return nil, err + } + line.Memory, err = strconv.ParseInt(fields[3], 10, 64) + if err != nil { + return nil, err + } + if fields[4] == enabled { + line.Pressure = 1 + } else if fields[4] == disabled { + line.Pressure = 0 + } else { + line.Pressure = -1 + } + line.MaxHeader, err = strconv.ParseUint(fields[5], 10, 64) + if err != nil { + return nil, err + } + if fields[6] == enabled { + line.Slab = true + } else if fields[6] == disabled { + line.Slab = false + } else { + return nil, fmt.Errorf("unable to parse capability for protocol: %s", line.Name) + } + line.ModuleName = fields[7] + + err = line.Capabilities.parseCapabilities(fields[8:]) + if err != nil { + return nil, err + } + + return line, nil +} + +func (pc *NetProtocolCapabilities) parseCapabilities(capabilities []string) error { + // The capabilities are all bools so we can loop over to map them + capabilityFields := [...]*bool{ + &pc.Close, + &pc.Connect, + &pc.Disconnect, + &pc.Accept, + &pc.IoCtl, + &pc.Init, + &pc.Destroy, + &pc.Shutdown, + &pc.SetSockOpt, + &pc.GetSockOpt, + &pc.SendMsg, + &pc.RecvMsg, + &pc.SendPage, + &pc.Bind, + &pc.BacklogRcv, + &pc.Hash, + &pc.UnHash, + &pc.GetPort, + &pc.EnterMemoryPressure, + } + + for i := 0; i < len(capabilities); i++ { + if capabilities[i] == "y" { + *capabilityFields[i] = true + } else if capabilities[i] == "n" { + *capabilityFields[i] = false + } else { + return fmt.Errorf("unable to parse capability block for protocol: position %d", i) + } + } + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_sockstat.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_sockstat.go index f91ef5523761..e36f4872dd62 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_sockstat.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_sockstat.go @@ -70,7 +70,7 @@ func readSockstat(name string) (*NetSockstat, error) { stat, err := parseSockstat(bytes.NewReader(b)) if err != nil { - return nil, fmt.Errorf("failed to read sockstats from %q: %v", name, err) + return nil, fmt.Errorf("failed to read sockstats from %q: %w", name, err) } return stat, nil @@ -90,7 +90,7 @@ func parseSockstat(r io.Reader) (*NetSockstat, error) { // The remaining fields are key/value pairs. kvs, err := parseSockstatKVs(fields[1:]) if err != nil { - return nil, fmt.Errorf("error parsing sockstat key/value pairs from %q: %v", s.Text(), err) + return nil, fmt.Errorf("error parsing sockstat key/value pairs from %q: %w", s.Text(), err) } // The first field is the protocol. We must trim its colon suffix. diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_softnet.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_softnet.go index db5debdf4a1f..46f12c61d3e9 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_softnet.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_softnet.go @@ -51,7 +51,7 @@ func (fs FS) NetSoftnetStat() ([]SoftnetStat, error) { entries, err := parseSoftnet(bytes.NewReader(b)) if err != nil { - return nil, fmt.Errorf("failed to parse /proc/net/softnet_stat: %v", err) + return nil, fmt.Errorf("failed to parse /proc/net/softnet_stat: %w", err) } return entries, nil diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_tcp.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_tcp.go new file mode 100644 index 000000000000..52776295572d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_tcp.go @@ -0,0 +1,64 @@ +// Copyright 2020 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +type ( + // NetTCP represents the contents of /proc/net/tcp{,6} file without the header. + NetTCP []*netIPSocketLine + + // NetTCPSummary provides already computed values like the total queue lengths or + // the total number of used sockets. In contrast to NetTCP it does not collect + // the parsed lines into a slice. + NetTCPSummary NetIPSocketSummary +) + +// NetTCP returns the IPv4 kernel/networking statistics for TCP datagrams +// read from /proc/net/tcp. +func (fs FS) NetTCP() (NetTCP, error) { + return newNetTCP(fs.proc.Path("net/tcp")) +} + +// NetTCP6 returns the IPv6 kernel/networking statistics for TCP datagrams +// read from /proc/net/tcp6. +func (fs FS) NetTCP6() (NetTCP, error) { + return newNetTCP(fs.proc.Path("net/tcp6")) +} + +// NetTCPSummary returns already computed statistics like the total queue lengths +// for TCP datagrams read from /proc/net/tcp. +func (fs FS) NetTCPSummary() (*NetTCPSummary, error) { + return newNetTCPSummary(fs.proc.Path("net/tcp")) +} + +// NetTCP6Summary returns already computed statistics like the total queue lengths +// for TCP datagrams read from /proc/net/tcp6. +func (fs FS) NetTCP6Summary() (*NetTCPSummary, error) { + return newNetTCPSummary(fs.proc.Path("net/tcp6")) +} + +// newNetTCP creates a new NetTCP{,6} from the contents of the given file. +func newNetTCP(file string) (NetTCP, error) { + n, err := newNetIPSocket(file) + n1 := NetTCP(n) + return n1, err +} + +func newNetTCPSummary(file string) (*NetTCPSummary, error) { + n, err := newNetIPSocketSummary(file) + if n == nil { + return nil, err + } + n1 := NetTCPSummary(*n) + return &n1, err +} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_udp.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_udp.go index d017e3f18da0..9ac3daf2d4c5 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_udp.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_udp.go @@ -13,58 +13,14 @@ package procfs -import ( - "bufio" - "encoding/hex" - "fmt" - "io" - "net" - "os" - "strconv" - "strings" -) - -const ( - // readLimit is used by io.LimitReader while reading the content of the - // /proc/net/udp{,6} files. The number of lines inside such a file is dynamic - // as each line represents a single used socket. - // In theory, the number of available sockets is 65535 (2^16 - 1) per IP. - // With e.g. 150 Byte per line and the maximum number of 65535, - // the reader needs to handle 150 Byte * 65535 =~ 10 MB for a single IP. - readLimit = 4294967296 // Byte -> 4 GiB -) - type ( // NetUDP represents the contents of /proc/net/udp{,6} file without the header. - NetUDP []*netUDPLine + NetUDP []*netIPSocketLine // NetUDPSummary provides already computed values like the total queue lengths or // the total number of used sockets. In contrast to NetUDP it does not collect // the parsed lines into a slice. - NetUDPSummary struct { - // TxQueueLength shows the total queue length of all parsed tx_queue lengths. - TxQueueLength uint64 - // RxQueueLength shows the total queue length of all parsed rx_queue lengths. - RxQueueLength uint64 - // UsedSockets shows the total number of parsed lines representing the - // number of used sockets. - UsedSockets uint64 - } - - // netUDPLine represents the fields parsed from a single line - // in /proc/net/udp{,6}. Fields which are not used by UDP are skipped. - // For the proc file format details, see https://linux.die.net/man/5/proc. - netUDPLine struct { - Sl uint64 - LocalAddr net.IP - LocalPort uint64 - RemAddr net.IP - RemPort uint64 - St uint64 - TxQueue uint64 - RxQueue uint64 - UID uint64 - } + NetUDPSummary NetIPSocketSummary ) // NetUDP returns the IPv4 kernel/networking statistics for UDP datagrams @@ -93,137 +49,16 @@ func (fs FS) NetUDP6Summary() (*NetUDPSummary, error) { // newNetUDP creates a new NetUDP{,6} from the contents of the given file. func newNetUDP(file string) (NetUDP, error) { - f, err := os.Open(file) - if err != nil { - return nil, err - } - defer f.Close() - - netUDP := NetUDP{} - - lr := io.LimitReader(f, readLimit) - s := bufio.NewScanner(lr) - s.Scan() // skip first line with headers - for s.Scan() { - fields := strings.Fields(s.Text()) - line, err := parseNetUDPLine(fields) - if err != nil { - return nil, err - } - netUDP = append(netUDP, line) - } - if err := s.Err(); err != nil { - return nil, err - } - return netUDP, nil + n, err := newNetIPSocket(file) + n1 := NetUDP(n) + return n1, err } -// newNetUDPSummary creates a new NetUDP{,6} from the contents of the given file. func newNetUDPSummary(file string) (*NetUDPSummary, error) { - f, err := os.Open(file) - if err != nil { - return nil, err - } - defer f.Close() - - netUDPSummary := &NetUDPSummary{} - - lr := io.LimitReader(f, readLimit) - s := bufio.NewScanner(lr) - s.Scan() // skip first line with headers - for s.Scan() { - fields := strings.Fields(s.Text()) - line, err := parseNetUDPLine(fields) - if err != nil { - return nil, err - } - netUDPSummary.TxQueueLength += line.TxQueue - netUDPSummary.RxQueueLength += line.RxQueue - netUDPSummary.UsedSockets++ - } - if err := s.Err(); err != nil { + n, err := newNetIPSocketSummary(file) + if n == nil { return nil, err } - return netUDPSummary, nil -} - -// parseNetUDPLine parses a single line, represented by a list of fields. -func parseNetUDPLine(fields []string) (*netUDPLine, error) { - line := &netUDPLine{} - if len(fields) < 8 { - return nil, fmt.Errorf( - "cannot parse net udp socket line as it has less then 8 columns: %s", - strings.Join(fields, " "), - ) - } - var err error // parse error - - // sl - s := strings.Split(fields[0], ":") - if len(s) != 2 { - return nil, fmt.Errorf( - "cannot parse sl field in udp socket line: %s", fields[0]) - } - - if line.Sl, err = strconv.ParseUint(s[0], 0, 64); err != nil { - return nil, fmt.Errorf("cannot parse sl value in udp socket line: %s", err) - } - // local_address - l := strings.Split(fields[1], ":") - if len(l) != 2 { - return nil, fmt.Errorf( - "cannot parse local_address field in udp socket line: %s", fields[1]) - } - if line.LocalAddr, err = hex.DecodeString(l[0]); err != nil { - return nil, fmt.Errorf( - "cannot parse local_address value in udp socket line: %s", err) - } - if line.LocalPort, err = strconv.ParseUint(l[1], 16, 64); err != nil { - return nil, fmt.Errorf( - "cannot parse local_address port value in udp socket line: %s", err) - } - - // remote_address - r := strings.Split(fields[2], ":") - if len(r) != 2 { - return nil, fmt.Errorf( - "cannot parse rem_address field in udp socket line: %s", fields[1]) - } - if line.RemAddr, err = hex.DecodeString(r[0]); err != nil { - return nil, fmt.Errorf( - "cannot parse rem_address value in udp socket line: %s", err) - } - if line.RemPort, err = strconv.ParseUint(r[1], 16, 64); err != nil { - return nil, fmt.Errorf( - "cannot parse rem_address port value in udp socket line: %s", err) - } - - // st - if line.St, err = strconv.ParseUint(fields[3], 16, 64); err != nil { - return nil, fmt.Errorf( - "cannot parse st value in udp socket line: %s", err) - } - - // tx_queue and rx_queue - q := strings.Split(fields[4], ":") - if len(q) != 2 { - return nil, fmt.Errorf( - "cannot parse tx/rx queues in udp socket line as it has a missing colon: %s", - fields[4], - ) - } - if line.TxQueue, err = strconv.ParseUint(q[0], 16, 64); err != nil { - return nil, fmt.Errorf("cannot parse tx_queue value in udp socket line: %s", err) - } - if line.RxQueue, err = strconv.ParseUint(q[1], 16, 64); err != nil { - return nil, fmt.Errorf("cannot parse rx_queue value in udp socket line: %s", err) - } - - // uid - if line.UID, err = strconv.ParseUint(fields[7], 0, 64); err != nil { - return nil, fmt.Errorf( - "cannot parse uid value in udp socket line: %s", err) - } - - return line, nil + n1 := NetUDPSummary(*n) + return &n1, err } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_unix.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_unix.go index c55b4b18e4f3..98aa8e1c31c1 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_unix.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_unix.go @@ -108,14 +108,14 @@ func parseNetUNIX(r io.Reader) (*NetUNIX, error) { line := s.Text() item, err := nu.parseLine(line, hasInode, minFields) if err != nil { - return nil, fmt.Errorf("failed to parse /proc/net/unix data %q: %v", line, err) + return nil, fmt.Errorf("failed to parse /proc/net/unix data %q: %w", line, err) } nu.Rows = append(nu.Rows, item) } if err := s.Err(); err != nil { - return nil, fmt.Errorf("failed to scan /proc/net/unix data: %v", err) + return nil, fmt.Errorf("failed to scan /proc/net/unix data: %w", err) } return &nu, nil @@ -136,29 +136,29 @@ func (u *NetUNIX) parseLine(line string, hasInode bool, min int) (*NetUNIXLine, users, err := u.parseUsers(fields[1]) if err != nil { - return nil, fmt.Errorf("failed to parse ref count(%s): %v", fields[1], err) + return nil, fmt.Errorf("failed to parse ref count %q: %w", fields[1], err) } flags, err := u.parseFlags(fields[3]) if err != nil { - return nil, fmt.Errorf("failed to parse flags(%s): %v", fields[3], err) + return nil, fmt.Errorf("failed to parse flags %q: %w", fields[3], err) } typ, err := u.parseType(fields[4]) if err != nil { - return nil, fmt.Errorf("failed to parse type(%s): %v", fields[4], err) + return nil, fmt.Errorf("failed to parse type %q: %w", fields[4], err) } state, err := u.parseState(fields[5]) if err != nil { - return nil, fmt.Errorf("failed to parse state(%s): %v", fields[5], err) + return nil, fmt.Errorf("failed to parse state %q: %w", fields[5], err) } var inode uint64 if hasInode { inode, err = u.parseInode(fields[6]) if err != nil { - return nil, fmt.Errorf("failed to parse inode(%s): %v", fields[6], err) + return nil, fmt.Errorf("failed to parse inode %q: %w", fields[6], err) } } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc.go index 9f97b6e5236a..28f696803f6f 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc.go @@ -105,7 +105,7 @@ func (fs FS) AllProcs() (Procs, error) { names, err := d.Readdirnames(-1) if err != nil { - return Procs{}, fmt.Errorf("could not read %s: %s", d.Name(), err) + return Procs{}, fmt.Errorf("could not read %q: %w", d.Name(), err) } p := Procs{} @@ -206,7 +206,7 @@ func (p Proc) FileDescriptors() ([]uintptr, error) { for i, n := range names { fd, err := strconv.ParseInt(n, 10, 32) if err != nil { - return nil, fmt.Errorf("could not parse fd %s: %s", n, err) + return nil, fmt.Errorf("could not parse fd %q: %w", n, err) } fds[i] = uintptr(fd) } @@ -278,7 +278,7 @@ func (p Proc) fileDescriptors() ([]string, error) { names, err := d.Readdirnames(-1) if err != nil { - return nil, fmt.Errorf("could not read %s: %s", d.Name(), err) + return nil, fmt.Errorf("could not read %q: %w", d.Name(), err) } return names, nil diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_cgroup.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_cgroup.go index 4abd46451c69..0094a13c05dc 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_cgroup.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_cgroup.go @@ -49,7 +49,7 @@ type Cgroup struct { func parseCgroupString(cgroupStr string) (*Cgroup, error) { var err error - fields := strings.Split(cgroupStr, ":") + fields := strings.SplitN(cgroupStr, ":", 3) if len(fields) < 3 { return nil, fmt.Errorf("at least 3 fields required, found %d fields in cgroup string: %s", len(fields), cgroupStr) } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_fdinfo.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_fdinfo.go index a76ca7079194..cf63227f064f 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_fdinfo.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_fdinfo.go @@ -16,7 +16,7 @@ package procfs import ( "bufio" "bytes" - "errors" + "fmt" "regexp" "github.com/prometheus/procfs/internal/util" @@ -112,7 +112,7 @@ func parseInotifyInfo(line string) (*InotifyInfo, error) { } return i, nil } - return nil, errors.New("invalid inode entry: " + line) + return nil, fmt.Errorf("invalid inode entry: %q", line) } // ProcFDInfos represents a list of ProcFDInfo structs. diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_limits.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_limits.go index 91ee24df8bde..dd20f198a308 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_limits.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_limits.go @@ -26,55 +26,55 @@ import ( // http://man7.org/linux/man-pages/man2/getrlimit.2.html. type ProcLimits struct { // CPU time limit in seconds. - CPUTime int64 + CPUTime uint64 // Maximum size of files that the process may create. - FileSize int64 + FileSize uint64 // Maximum size of the process's data segment (initialized data, // uninitialized data, and heap). - DataSize int64 + DataSize uint64 // Maximum size of the process stack in bytes. - StackSize int64 + StackSize uint64 // Maximum size of a core file. - CoreFileSize int64 + CoreFileSize uint64 // Limit of the process's resident set in pages. - ResidentSet int64 + ResidentSet uint64 // Maximum number of processes that can be created for the real user ID of // the calling process. - Processes int64 + Processes uint64 // Value one greater than the maximum file descriptor number that can be // opened by this process. - OpenFiles int64 + OpenFiles uint64 // Maximum number of bytes of memory that may be locked into RAM. - LockedMemory int64 + LockedMemory uint64 // Maximum size of the process's virtual memory address space in bytes. - AddressSpace int64 + AddressSpace uint64 // Limit on the combined number of flock(2) locks and fcntl(2) leases that // this process may establish. - FileLocks int64 + FileLocks uint64 // Limit of signals that may be queued for the real user ID of the calling // process. - PendingSignals int64 + PendingSignals uint64 // Limit on the number of bytes that can be allocated for POSIX message // queues for the real user ID of the calling process. - MsqqueueSize int64 + MsqqueueSize uint64 // Limit of the nice priority set using setpriority(2) or nice(2). - NicePriority int64 + NicePriority uint64 // Limit of the real-time priority set using sched_setscheduler(2) or // sched_setparam(2). - RealtimePriority int64 + RealtimePriority uint64 // Limit (in microseconds) on the amount of CPU time that a process // scheduled under a real-time scheduling policy may consume without making // a blocking system call. - RealtimeTimeout int64 + RealtimeTimeout uint64 } const ( - limitsFields = 3 + limitsFields = 4 limitsUnlimited = "unlimited" ) var ( - limitsDelimiter = regexp.MustCompile(" +") + limitsMatch = regexp.MustCompile(`(Max \w+\s{0,1}?\w*\s{0,1}\w*)\s{2,}(\w+)\s+(\w+)`) ) // NewLimits returns the current soft limits of the process. @@ -96,46 +96,49 @@ func (p Proc) Limits() (ProcLimits, error) { l = ProcLimits{} s = bufio.NewScanner(f) ) + + s.Scan() // Skip limits header + for s.Scan() { - fields := limitsDelimiter.Split(s.Text(), limitsFields) + //fields := limitsMatch.Split(s.Text(), limitsFields) + fields := limitsMatch.FindStringSubmatch(s.Text()) if len(fields) != limitsFields { - return ProcLimits{}, fmt.Errorf( - "couldn't parse %s line %s", f.Name(), s.Text()) + return ProcLimits{}, fmt.Errorf("couldn't parse %q line %q", f.Name(), s.Text()) } - switch fields[0] { + switch fields[1] { case "Max cpu time": - l.CPUTime, err = parseInt(fields[1]) + l.CPUTime, err = parseUint(fields[2]) case "Max file size": - l.FileSize, err = parseInt(fields[1]) + l.FileSize, err = parseUint(fields[2]) case "Max data size": - l.DataSize, err = parseInt(fields[1]) + l.DataSize, err = parseUint(fields[2]) case "Max stack size": - l.StackSize, err = parseInt(fields[1]) + l.StackSize, err = parseUint(fields[2]) case "Max core file size": - l.CoreFileSize, err = parseInt(fields[1]) + l.CoreFileSize, err = parseUint(fields[2]) case "Max resident set": - l.ResidentSet, err = parseInt(fields[1]) + l.ResidentSet, err = parseUint(fields[2]) case "Max processes": - l.Processes, err = parseInt(fields[1]) + l.Processes, err = parseUint(fields[2]) case "Max open files": - l.OpenFiles, err = parseInt(fields[1]) + l.OpenFiles, err = parseUint(fields[2]) case "Max locked memory": - l.LockedMemory, err = parseInt(fields[1]) + l.LockedMemory, err = parseUint(fields[2]) case "Max address space": - l.AddressSpace, err = parseInt(fields[1]) + l.AddressSpace, err = parseUint(fields[2]) case "Max file locks": - l.FileLocks, err = parseInt(fields[1]) + l.FileLocks, err = parseUint(fields[2]) case "Max pending signals": - l.PendingSignals, err = parseInt(fields[1]) + l.PendingSignals, err = parseUint(fields[2]) case "Max msgqueue size": - l.MsqqueueSize, err = parseInt(fields[1]) + l.MsqqueueSize, err = parseUint(fields[2]) case "Max nice priority": - l.NicePriority, err = parseInt(fields[1]) + l.NicePriority, err = parseUint(fields[2]) case "Max realtime priority": - l.RealtimePriority, err = parseInt(fields[1]) + l.RealtimePriority, err = parseUint(fields[2]) case "Max realtime timeout": - l.RealtimeTimeout, err = parseInt(fields[1]) + l.RealtimeTimeout, err = parseUint(fields[2]) } if err != nil { return ProcLimits{}, err @@ -145,13 +148,13 @@ func (p Proc) Limits() (ProcLimits, error) { return l, s.Err() } -func parseInt(s string) (int64, error) { +func parseUint(s string) (uint64, error) { if s == limitsUnlimited { - return -1, nil + return 18446744073709551615, nil } - i, err := strconv.ParseInt(s, 10, 64) + i, err := strconv.ParseUint(s, 10, 64) if err != nil { - return 0, fmt.Errorf("couldn't parse value %s: %s", s, err) + return 0, fmt.Errorf("couldn't parse value %q: %w", s, err) } return i, nil } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_ns.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_ns.go index c66740ff746a..391b4cbd11b9 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_ns.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_ns.go @@ -40,7 +40,7 @@ func (p Proc) Namespaces() (Namespaces, error) { names, err := d.Readdirnames(-1) if err != nil { - return nil, fmt.Errorf("failed to read contents of ns dir: %v", err) + return nil, fmt.Errorf("failed to read contents of ns dir: %w", err) } ns := make(Namespaces, len(names)) @@ -52,13 +52,13 @@ func (p Proc) Namespaces() (Namespaces, error) { fields := strings.SplitN(target, ":", 2) if len(fields) != 2 { - return nil, fmt.Errorf("failed to parse namespace type and inode from '%v'", target) + return nil, fmt.Errorf("failed to parse namespace type and inode from %q", target) } typ := fields[0] inode, err := strconv.ParseUint(strings.Trim(fields[1], "[]"), 10, 32) if err != nil { - return nil, fmt.Errorf("failed to parse inode from '%v': %v", fields[1], err) + return nil, fmt.Errorf("failed to parse inode from %q: %w", fields[1], err) } ns[name] = Namespace{typ, uint32(inode)} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_psi.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_psi.go index 0d7bee54cac3..dc6c14f0a4c1 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_psi.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_psi.go @@ -59,7 +59,7 @@ type PSIStats struct { func (fs FS) PSIStatsForResource(resource string) (PSIStats, error) { data, err := util.ReadFileNoStat(fs.proc.Path(fmt.Sprintf("%s/%s", "pressure", resource))) if err != nil { - return PSIStats{}, fmt.Errorf("psi_stats: unavailable for %s", resource) + return PSIStats{}, fmt.Errorf("psi_stats: unavailable for %q: %w", resource, err) } return parsePSIStats(resource, bytes.NewReader(data)) diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_stat.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_stat.go index 4517d2e9dd01..67ca0e9fbc90 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_stat.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/proc_stat.go @@ -127,10 +127,7 @@ func (p Proc) Stat() (ProcStat, error) { ) if l < 0 || r < 0 { - return ProcStat{}, fmt.Errorf( - "unexpected format, couldn't extract comm: %s", - data, - ) + return ProcStat{}, fmt.Errorf("unexpected format, couldn't extract comm %q", data) } s.Comm = string(data[l+1 : r]) diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/schedstat.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/schedstat.go index a4c4089ac529..28228164efba 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/schedstat.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/schedstat.go @@ -95,24 +95,27 @@ func (fs FS) Schedstat() (*Schedstat, error) { return stats, nil } -func parseProcSchedstat(contents string) (stats ProcSchedstat, err error) { +func parseProcSchedstat(contents string) (ProcSchedstat, error) { + var ( + stats ProcSchedstat + err error + ) match := procLineRE.FindStringSubmatch(contents) if match != nil { stats.RunningNanoseconds, err = strconv.ParseUint(match[1], 10, 64) if err != nil { - return + return stats, err } stats.WaitingNanoseconds, err = strconv.ParseUint(match[2], 10, 64) if err != nil { - return + return stats, err } stats.RunTimeslices, err = strconv.ParseUint(match[3], 10, 64) - return + return stats, err } - err = errors.New("could not parse schedstat") - return + return stats, errors.New("could not parse schedstat") } diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/slab.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/slab.go new file mode 100644 index 000000000000..7896fd724283 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/slab.go @@ -0,0 +1,151 @@ +// Copyright 2020 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "bytes" + "fmt" + "regexp" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +var ( + slabSpace = regexp.MustCompile(`\s+`) + slabVer = regexp.MustCompile(`slabinfo -`) + slabHeader = regexp.MustCompile(`# name`) +) + +// Slab represents a slab pool in the kernel. +type Slab struct { + Name string + ObjActive int64 + ObjNum int64 + ObjSize int64 + ObjPerSlab int64 + PagesPerSlab int64 + // tunables + Limit int64 + Batch int64 + SharedFactor int64 + SlabActive int64 + SlabNum int64 + SharedAvail int64 +} + +// SlabInfo represents info for all slabs. +type SlabInfo struct { + Slabs []*Slab +} + +func shouldParseSlab(line string) bool { + if slabVer.MatchString(line) { + return false + } + if slabHeader.MatchString(line) { + return false + } + return true +} + +// parseV21SlabEntry is used to parse a line from /proc/slabinfo version 2.1. +func parseV21SlabEntry(line string) (*Slab, error) { + // First cleanup whitespace. + l := slabSpace.ReplaceAllString(line, " ") + s := strings.Split(l, " ") + if len(s) != 16 { + return nil, fmt.Errorf("unable to parse: %q", line) + } + var err error + i := &Slab{Name: s[0]} + i.ObjActive, err = strconv.ParseInt(s[1], 10, 64) + if err != nil { + return nil, err + } + i.ObjNum, err = strconv.ParseInt(s[2], 10, 64) + if err != nil { + return nil, err + } + i.ObjSize, err = strconv.ParseInt(s[3], 10, 64) + if err != nil { + return nil, err + } + i.ObjPerSlab, err = strconv.ParseInt(s[4], 10, 64) + if err != nil { + return nil, err + } + i.PagesPerSlab, err = strconv.ParseInt(s[5], 10, 64) + if err != nil { + return nil, err + } + i.Limit, err = strconv.ParseInt(s[8], 10, 64) + if err != nil { + return nil, err + } + i.Batch, err = strconv.ParseInt(s[9], 10, 64) + if err != nil { + return nil, err + } + i.SharedFactor, err = strconv.ParseInt(s[10], 10, 64) + if err != nil { + return nil, err + } + i.SlabActive, err = strconv.ParseInt(s[13], 10, 64) + if err != nil { + return nil, err + } + i.SlabNum, err = strconv.ParseInt(s[14], 10, 64) + if err != nil { + return nil, err + } + i.SharedAvail, err = strconv.ParseInt(s[15], 10, 64) + if err != nil { + return nil, err + } + return i, nil +} + +// parseSlabInfo21 is used to parse a slabinfo 2.1 file. +func parseSlabInfo21(r *bytes.Reader) (SlabInfo, error) { + scanner := bufio.NewScanner(r) + s := SlabInfo{Slabs: []*Slab{}} + for scanner.Scan() { + line := scanner.Text() + if !shouldParseSlab(line) { + continue + } + slab, err := parseV21SlabEntry(line) + if err != nil { + return s, err + } + s.Slabs = append(s.Slabs, slab) + } + return s, nil +} + +// SlabInfo reads data from /proc/slabinfo +func (fs FS) SlabInfo() (SlabInfo, error) { + // TODO: Consider passing options to allow for parsing different + // slabinfo versions. However, slabinfo 2.1 has been stable since + // kernel 2.6.10 and later. + data, err := util.ReadFileNoStat(fs.proc.Path("slabinfo")) + if err != nil { + return SlabInfo{}, err + } + + return parseSlabInfo21(bytes.NewReader(data)) +} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/stat.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/stat.go index b2a6fc994c11..6d8727541e40 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/stat.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/stat.go @@ -93,10 +93,10 @@ func parseCPUStat(line string) (CPUStat, int64, error) { &cpuStat.Guest, &cpuStat.GuestNice) if err != nil && err != io.EOF { - return CPUStat{}, -1, fmt.Errorf("couldn't parse %s (cpu): %s", line, err) + return CPUStat{}, -1, fmt.Errorf("couldn't parse %q (cpu): %w", line, err) } if count == 0 { - return CPUStat{}, -1, fmt.Errorf("couldn't parse %s (cpu): 0 elements parsed", line) + return CPUStat{}, -1, fmt.Errorf("couldn't parse %q (cpu): 0 elements parsed", line) } cpuStat.User /= userHZ @@ -116,7 +116,7 @@ func parseCPUStat(line string) (CPUStat, int64, error) { cpuID, err := strconv.ParseInt(cpu[3:], 10, 64) if err != nil { - return CPUStat{}, -1, fmt.Errorf("couldn't parse %s (cpu/cpuid): %s", line, err) + return CPUStat{}, -1, fmt.Errorf("couldn't parse %q (cpu/cpuid): %w", line, err) } return cpuStat, cpuID, nil @@ -136,7 +136,7 @@ func parseSoftIRQStat(line string) (SoftIRQStat, uint64, error) { &softIRQStat.Hrtimer, &softIRQStat.Rcu) if err != nil { - return SoftIRQStat{}, 0, fmt.Errorf("couldn't parse %s (softirq): %s", line, err) + return SoftIRQStat{}, 0, fmt.Errorf("couldn't parse %q (softirq): %w", line, err) } return softIRQStat, total, nil @@ -184,34 +184,34 @@ func (fs FS) Stat() (Stat, error) { switch { case parts[0] == "btime": if stat.BootTime, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %s (btime): %s", parts[1], err) + return Stat{}, fmt.Errorf("couldn't parse %q (btime): %w", parts[1], err) } case parts[0] == "intr": if stat.IRQTotal, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %s (intr): %s", parts[1], err) + return Stat{}, fmt.Errorf("couldn't parse %q (intr): %w", parts[1], err) } numberedIRQs := parts[2:] stat.IRQ = make([]uint64, len(numberedIRQs)) for i, count := range numberedIRQs { if stat.IRQ[i], err = strconv.ParseUint(count, 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %s (intr%d): %s", count, i, err) + return Stat{}, fmt.Errorf("couldn't parse %q (intr%d): %w", count, i, err) } } case parts[0] == "ctxt": if stat.ContextSwitches, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %s (ctxt): %s", parts[1], err) + return Stat{}, fmt.Errorf("couldn't parse %q (ctxt): %w", parts[1], err) } case parts[0] == "processes": if stat.ProcessCreated, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %s (processes): %s", parts[1], err) + return Stat{}, fmt.Errorf("couldn't parse %q (processes): %w", parts[1], err) } case parts[0] == "procs_running": if stat.ProcessesRunning, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %s (procs_running): %s", parts[1], err) + return Stat{}, fmt.Errorf("couldn't parse %q (procs_running): %w", parts[1], err) } case parts[0] == "procs_blocked": if stat.ProcessesBlocked, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %s (procs_blocked): %s", parts[1], err) + return Stat{}, fmt.Errorf("couldn't parse %q (procs_blocked): %w", parts[1], err) } case parts[0] == "softirq": softIRQStats, total, err := parseSoftIRQStat(line) @@ -237,7 +237,7 @@ func (fs FS) Stat() (Stat, error) { } if err := scanner.Err(); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %s: %s", fileName, err) + return Stat{}, fmt.Errorf("couldn't parse %q: %w", fileName, err) } return stat, nil diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/xfrm.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/xfrm.go index 30aa417d530f..eed07c7d7748 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/xfrm.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/xfrm.go @@ -112,8 +112,7 @@ func (fs FS) NewXfrmStat() (XfrmStat, error) { fields := strings.Fields(s.Text()) if len(fields) != 2 { - return XfrmStat{}, fmt.Errorf( - "couldn't parse %s line %s", file.Name(), s.Text()) + return XfrmStat{}, fmt.Errorf("couldn't parse %q line %q", file.Name(), s.Text()) } name := fields[0] diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/zoneinfo.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/zoneinfo.go index e941503d5cdd..0b9bb6796b3d 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/zoneinfo.go +++ b/cluster-autoscaler/vendor/github.com/prometheus/procfs/zoneinfo.go @@ -74,11 +74,11 @@ var nodeZoneRE = regexp.MustCompile(`(\d+), zone\s+(\w+)`) func (fs FS) Zoneinfo() ([]Zoneinfo, error) { data, err := ioutil.ReadFile(fs.proc.Path("zoneinfo")) if err != nil { - return nil, fmt.Errorf("error reading zoneinfo %s: %s", fs.proc.Path("zoneinfo"), err) + return nil, fmt.Errorf("error reading zoneinfo %q: %w", fs.proc.Path("zoneinfo"), err) } zoneinfo, err := parseZoneinfo(data) if err != nil { - return nil, fmt.Errorf("error parsing zoneinfo %s: %s", fs.proc.Path("zoneinfo"), err) + return nil, fmt.Errorf("error parsing zoneinfo %q: %w", fs.proc.Path("zoneinfo"), err) } return zoneinfo, nil } diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/.travis.yml b/cluster-autoscaler/vendor/github.com/spf13/afero/.travis.yml deleted file mode 100644 index 0637db726dee..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: false -language: go - -go: - - 1.9 - - "1.10" - - tip - -os: - - linux - - osx - -matrix: - allow_failures: - - go: tip - fast_finish: true - -script: - - go build - - go test -race -v ./... - diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/README.md b/cluster-autoscaler/vendor/github.com/spf13/afero/README.md deleted file mode 100644 index 0c9b04b53fcb..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/README.md +++ /dev/null @@ -1,452 +0,0 @@ -![afero logo-sm](https://cloud.githubusercontent.com/assets/173412/11490338/d50e16dc-97a5-11e5-8b12-019a300d0fcb.png) - -A FileSystem Abstraction System for Go - -[![Build Status](https://travis-ci.org/spf13/afero.svg)](https://travis-ci.org/spf13/afero) [![Build status](https://ci.appveyor.com/api/projects/status/github/spf13/afero?branch=master&svg=true)](https://ci.appveyor.com/project/spf13/afero) [![GoDoc](https://godoc.org/github.com/spf13/afero?status.svg)](https://godoc.org/github.com/spf13/afero) [![Join the chat at https://gitter.im/spf13/afero](https://badges.gitter.im/Dev%20Chat.svg)](https://gitter.im/spf13/afero?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -# Overview - -Afero is an filesystem framework providing a simple, uniform and universal API -interacting with any filesystem, as an abstraction layer providing interfaces, -types and methods. Afero has an exceptionally clean interface and simple design -without needless constructors or initialization methods. - -Afero is also a library providing a base set of interoperable backend -filesystems that make it easy to work with afero while retaining all the power -and benefit of the os and ioutil packages. - -Afero provides significant improvements over using the os package alone, most -notably the ability to create mock and testing filesystems without relying on the disk. - -It is suitable for use in a any situation where you would consider using the OS -package as it provides an additional abstraction that makes it easy to use a -memory backed file system during testing. It also adds support for the http -filesystem for full interoperability. - - -## Afero Features - -* A single consistent API for accessing a variety of filesystems -* Interoperation between a variety of file system types -* A set of interfaces to encourage and enforce interoperability between backends -* An atomic cross platform memory backed file system -* Support for compositional (union) file systems by combining multiple file systems acting as one -* Specialized backends which modify existing filesystems (Read Only, Regexp filtered) -* A set of utility functions ported from io, ioutil & hugo to be afero aware - - -# Using Afero - -Afero is easy to use and easier to adopt. - -A few different ways you could use Afero: - -* Use the interfaces alone to define you own file system. -* Wrap for the OS packages. -* Define different filesystems for different parts of your application. -* Use Afero for mock filesystems while testing - -## Step 1: Install Afero - -First use go get to install the latest version of the library. - - $ go get github.com/spf13/afero - -Next include Afero in your application. -```go -import "github.com/spf13/afero" -``` - -## Step 2: Declare a backend - -First define a package variable and set it to a pointer to a filesystem. -```go -var AppFs = afero.NewMemMapFs() - -or - -var AppFs = afero.NewOsFs() -``` -It is important to note that if you repeat the composite literal you -will be using a completely new and isolated filesystem. In the case of -OsFs it will still use the same underlying filesystem but will reduce -the ability to drop in other filesystems as desired. - -## Step 3: Use it like you would the OS package - -Throughout your application use any function and method like you normally -would. - -So if my application before had: -```go -os.Open('/tmp/foo') -``` -We would replace it with: -```go -AppFs.Open('/tmp/foo') -``` - -`AppFs` being the variable we defined above. - - -## List of all available functions - -File System Methods Available: -```go -Chmod(name string, mode os.FileMode) : error -Chtimes(name string, atime time.Time, mtime time.Time) : error -Create(name string) : File, error -Mkdir(name string, perm os.FileMode) : error -MkdirAll(path string, perm os.FileMode) : error -Name() : string -Open(name string) : File, error -OpenFile(name string, flag int, perm os.FileMode) : File, error -Remove(name string) : error -RemoveAll(path string) : error -Rename(oldname, newname string) : error -Stat(name string) : os.FileInfo, error -``` -File Interfaces and Methods Available: -```go -io.Closer -io.Reader -io.ReaderAt -io.Seeker -io.Writer -io.WriterAt - -Name() : string -Readdir(count int) : []os.FileInfo, error -Readdirnames(n int) : []string, error -Stat() : os.FileInfo, error -Sync() : error -Truncate(size int64) : error -WriteString(s string) : ret int, err error -``` -In some applications it may make sense to define a new package that -simply exports the file system variable for easy access from anywhere. - -## Using Afero's utility functions - -Afero provides a set of functions to make it easier to use the underlying file systems. -These functions have been primarily ported from io & ioutil with some developed for Hugo. - -The afero utilities support all afero compatible backends. - -The list of utilities includes: - -```go -DirExists(path string) (bool, error) -Exists(path string) (bool, error) -FileContainsBytes(filename string, subslice []byte) (bool, error) -GetTempDir(subPath string) string -IsDir(path string) (bool, error) -IsEmpty(path string) (bool, error) -ReadDir(dirname string) ([]os.FileInfo, error) -ReadFile(filename string) ([]byte, error) -SafeWriteReader(path string, r io.Reader) (err error) -TempDir(dir, prefix string) (name string, err error) -TempFile(dir, prefix string) (f File, err error) -Walk(root string, walkFn filepath.WalkFunc) error -WriteFile(filename string, data []byte, perm os.FileMode) error -WriteReader(path string, r io.Reader) (err error) -``` -For a complete list see [Afero's GoDoc](https://godoc.org/github.com/spf13/afero) - -They are available under two different approaches to use. You can either call -them directly where the first parameter of each function will be the file -system, or you can declare a new `Afero`, a custom type used to bind these -functions as methods to a given filesystem. - -### Calling utilities directly - -```go -fs := new(afero.MemMapFs) -f, err := afero.TempFile(fs,"", "ioutil-test") - -``` - -### Calling via Afero - -```go -fs := afero.NewMemMapFs() -afs := &afero.Afero{Fs: fs} -f, err := afs.TempFile("", "ioutil-test") -``` - -## Using Afero for Testing - -There is a large benefit to using a mock filesystem for testing. It has a -completely blank state every time it is initialized and can be easily -reproducible regardless of OS. You could create files to your heart’s content -and the file access would be fast while also saving you from all the annoying -issues with deleting temporary files, Windows file locking, etc. The MemMapFs -backend is perfect for testing. - -* Much faster than performing I/O operations on disk -* Avoid security issues and permissions -* Far more control. 'rm -rf /' with confidence -* Test setup is far more easier to do -* No test cleanup needed - -One way to accomplish this is to define a variable as mentioned above. -In your application this will be set to afero.NewOsFs() during testing you -can set it to afero.NewMemMapFs(). - -It wouldn't be uncommon to have each test initialize a blank slate memory -backend. To do this I would define my `appFS = afero.NewOsFs()` somewhere -appropriate in my application code. This approach ensures that Tests are order -independent, with no test relying on the state left by an earlier test. - -Then in my tests I would initialize a new MemMapFs for each test: -```go -func TestExist(t *testing.T) { - appFS := afero.NewMemMapFs() - // create test files and directories - appFS.MkdirAll("src/a", 0755) - afero.WriteFile(appFS, "src/a/b", []byte("file b"), 0644) - afero.WriteFile(appFS, "src/c", []byte("file c"), 0644) - name := "src/c" - _, err := appFS.Stat(name) - if os.IsNotExist(err) { - t.Errorf("file \"%s\" does not exist.\n", name) - } -} -``` - -# Available Backends - -## Operating System Native - -### OsFs - -The first is simply a wrapper around the native OS calls. This makes it -very easy to use as all of the calls are the same as the existing OS -calls. It also makes it trivial to have your code use the OS during -operation and a mock filesystem during testing or as needed. - -```go -appfs := afero.NewOsFs() -appfs.MkdirAll("src/a", 0755)) -``` - -## Memory Backed Storage - -### MemMapFs - -Afero also provides a fully atomic memory backed filesystem perfect for use in -mocking and to speed up unnecessary disk io when persistence isn’t -necessary. It is fully concurrent and will work within go routines -safely. - -```go -mm := afero.NewMemMapFs() -mm.MkdirAll("src/a", 0755)) -``` - -#### InMemoryFile - -As part of MemMapFs, Afero also provides an atomic, fully concurrent memory -backed file implementation. This can be used in other memory backed file -systems with ease. Plans are to add a radix tree memory stored file -system using InMemoryFile. - -## Network Interfaces - -### SftpFs - -Afero has experimental support for secure file transfer protocol (sftp). Which can -be used to perform file operations over a encrypted channel. - -## Filtering Backends - -### BasePathFs - -The BasePathFs restricts all operations to a given path within an Fs. -The given file name to the operations on this Fs will be prepended with -the base path before calling the source Fs. - -```go -bp := afero.NewBasePathFs(afero.NewOsFs(), "/base/path") -``` - -### ReadOnlyFs - -A thin wrapper around the source Fs providing a read only view. - -```go -fs := afero.NewReadOnlyFs(afero.NewOsFs()) -_, err := fs.Create("/file.txt") -// err = syscall.EPERM -``` - -# RegexpFs - -A filtered view on file names, any file NOT matching -the passed regexp will be treated as non-existing. -Files not matching the regexp provided will not be created. -Directories are not filtered. - -```go -fs := afero.NewRegexpFs(afero.NewMemMapFs(), regexp.MustCompile(`\.txt$`)) -_, err := fs.Create("/file.html") -// err = syscall.ENOENT -``` - -### HttpFs - -Afero provides an http compatible backend which can wrap any of the existing -backends. - -The Http package requires a slightly specific version of Open which -returns an http.File type. - -Afero provides an httpFs file system which satisfies this requirement. -Any Afero FileSystem can be used as an httpFs. - -```go -httpFs := afero.NewHttpFs() -fileserver := http.FileServer(httpFs.Dir())) -http.Handle("/", fileserver) -``` - -## Composite Backends - -Afero provides the ability have two filesystems (or more) act as a single -file system. - -### CacheOnReadFs - -The CacheOnReadFs will lazily make copies of any accessed files from the base -layer into the overlay. Subsequent reads will be pulled from the overlay -directly permitting the request is within the cache duration of when it was -created in the overlay. - -If the base filesystem is writeable, any changes to files will be -done first to the base, then to the overlay layer. Write calls to open file -handles like `Write()` or `Truncate()` to the overlay first. - -To writing files to the overlay only, you can use the overlay Fs directly (not -via the union Fs). - -Cache files in the layer for the given time.Duration, a cache duration of 0 -means "forever" meaning the file will not be re-requested from the base ever. - -A read-only base will make the overlay also read-only but still copy files -from the base to the overlay when they're not present (or outdated) in the -caching layer. - -```go -base := afero.NewOsFs() -layer := afero.NewMemMapFs() -ufs := afero.NewCacheOnReadFs(base, layer, 100 * time.Second) -``` - -### CopyOnWriteFs() - -The CopyOnWriteFs is a read only base file system with a potentially -writeable layer on top. - -Read operations will first look in the overlay and if not found there, will -serve the file from the base. - -Changes to the file system will only be made in the overlay. - -Any attempt to modify a file found only in the base will copy the file to the -overlay layer before modification (including opening a file with a writable -handle). - -Removing and Renaming files present only in the base layer is not currently -permitted. If a file is present in the base layer and the overlay, only the -overlay will be removed/renamed. - -```go - base := afero.NewOsFs() - roBase := afero.NewReadOnlyFs(base) - ufs := afero.NewCopyOnWriteFs(roBase, afero.NewMemMapFs()) - - fh, _ = ufs.Create("/home/test/file2.txt") - fh.WriteString("This is a test") - fh.Close() -``` - -In this example all write operations will only occur in memory (MemMapFs) -leaving the base filesystem (OsFs) untouched. - - -## Desired/possible backends - -The following is a short list of possible backends we hope someone will -implement: - -* SSH -* ZIP -* TAR -* S3 - -# About the project - -## What's in the name - -Afero comes from the latin roots Ad-Facere. - -**"Ad"** is a prefix meaning "to". - -**"Facere"** is a form of the root "faciō" making "make or do". - -The literal meaning of afero is "to make" or "to do" which seems very fitting -for a library that allows one to make files and directories and do things with them. - -The English word that shares the same roots as Afero is "affair". Affair shares -the same concept but as a noun it means "something that is made or done" or "an -object of a particular type". - -It's also nice that unlike some of my other libraries (hugo, cobra, viper) it -Googles very well. - -## Release Notes - -* **0.10.0** 2015.12.10 - * Full compatibility with Windows - * Introduction of afero utilities - * Test suite rewritten to work cross platform - * Normalize paths for MemMapFs - * Adding Sync to the file interface - * **Breaking Change** Walk and ReadDir have changed parameter order - * Moving types used by MemMapFs to a subpackage - * General bugfixes and improvements -* **0.9.0** 2015.11.05 - * New Walk function similar to filepath.Walk - * MemMapFs.OpenFile handles O_CREATE, O_APPEND, O_TRUNC - * MemMapFs.Remove now really deletes the file - * InMemoryFile.Readdir and Readdirnames work correctly - * InMemoryFile functions lock it for concurrent access - * Test suite improvements -* **0.8.0** 2014.10.28 - * First public version - * Interfaces feel ready for people to build using - * Interfaces satisfy all known uses - * MemMapFs passes the majority of the OS test suite - * OsFs passes the majority of the OS test suite - -## Contributing - -1. Fork it -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request - -## Contributors - -Names in no particular order: - -* [spf13](https://github.com/spf13) -* [jaqx0r](https://github.com/jaqx0r) -* [mbertschler](https://github.com/mbertschler) -* [xor-gate](https://github.com/xor-gate) - -## License - -Afero is released under the Apache 2.0 license. See -[LICENSE.txt](https://github.com/spf13/afero/blob/master/LICENSE.txt) diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/afero.go b/cluster-autoscaler/vendor/github.com/spf13/afero/afero.go deleted file mode 100644 index f5b5e127cd6a..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/afero.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright © 2014 Steve Francia . -// Copyright 2013 tsuru authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package afero provides types and methods for interacting with the filesystem, -// as an abstraction layer. - -// Afero also provides a few implementations that are mostly interoperable. One that -// uses the operating system filesystem, one that uses memory to store files -// (cross platform) and an interface that should be implemented if you want to -// provide your own filesystem. - -package afero - -import ( - "errors" - "io" - "os" - "time" -) - -type Afero struct { - Fs -} - -// File represents a file in the filesystem. -type File interface { - io.Closer - io.Reader - io.ReaderAt - io.Seeker - io.Writer - io.WriterAt - - Name() string - Readdir(count int) ([]os.FileInfo, error) - Readdirnames(n int) ([]string, error) - Stat() (os.FileInfo, error) - Sync() error - Truncate(size int64) error - WriteString(s string) (ret int, err error) -} - -// Fs is the filesystem interface. -// -// Any simulated or real filesystem should implement this interface. -type Fs interface { - // Create creates a file in the filesystem, returning the file and an - // error, if any happens. - Create(name string) (File, error) - - // Mkdir creates a directory in the filesystem, return an error if any - // happens. - Mkdir(name string, perm os.FileMode) error - - // MkdirAll creates a directory path and all parents that does not exist - // yet. - MkdirAll(path string, perm os.FileMode) error - - // Open opens a file, returning it or an error, if any happens. - Open(name string) (File, error) - - // OpenFile opens a file using the given flags and the given mode. - OpenFile(name string, flag int, perm os.FileMode) (File, error) - - // Remove removes a file identified by name, returning an error, if any - // happens. - Remove(name string) error - - // RemoveAll removes a directory path and any children it contains. It - // does not fail if the path does not exist (return nil). - RemoveAll(path string) error - - // Rename renames a file. - Rename(oldname, newname string) error - - // Stat returns a FileInfo describing the named file, or an error, if any - // happens. - Stat(name string) (os.FileInfo, error) - - // The name of this FileSystem - Name() string - - //Chmod changes the mode of the named file to mode. - Chmod(name string, mode os.FileMode) error - - //Chtimes changes the access and modification times of the named file - Chtimes(name string, atime time.Time, mtime time.Time) error -} - -var ( - ErrFileClosed = errors.New("File is closed") - ErrOutOfRange = errors.New("Out of range") - ErrTooLarge = errors.New("Too large") - ErrFileNotFound = os.ErrNotExist - ErrFileExists = os.ErrExist - ErrDestinationExists = os.ErrExist -) diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/appveyor.yml b/cluster-autoscaler/vendor/github.com/spf13/afero/appveyor.yml deleted file mode 100644 index a633ad500c16..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/appveyor.yml +++ /dev/null @@ -1,15 +0,0 @@ -version: '{build}' -clone_folder: C:\gopath\src\github.com\spf13\afero -environment: - GOPATH: C:\gopath -build_script: -- cmd: >- - go version - - go env - - go get -v github.com/spf13/afero/... - - go build github.com/spf13/afero -test_script: -- cmd: go test -race -v github.com/spf13/afero/... diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/basepath.go b/cluster-autoscaler/vendor/github.com/spf13/afero/basepath.go deleted file mode 100644 index 616ff8ff74c5..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/basepath.go +++ /dev/null @@ -1,180 +0,0 @@ -package afero - -import ( - "os" - "path/filepath" - "runtime" - "strings" - "time" -) - -var _ Lstater = (*BasePathFs)(nil) - -// The BasePathFs restricts all operations to a given path within an Fs. -// The given file name to the operations on this Fs will be prepended with -// the base path before calling the base Fs. -// Any file name (after filepath.Clean()) outside this base path will be -// treated as non existing file. -// -// Note that it does not clean the error messages on return, so you may -// reveal the real path on errors. -type BasePathFs struct { - source Fs - path string -} - -type BasePathFile struct { - File - path string -} - -func (f *BasePathFile) Name() string { - sourcename := f.File.Name() - return strings.TrimPrefix(sourcename, filepath.Clean(f.path)) -} - -func NewBasePathFs(source Fs, path string) Fs { - return &BasePathFs{source: source, path: path} -} - -// on a file outside the base path it returns the given file name and an error, -// else the given file with the base path prepended -func (b *BasePathFs) RealPath(name string) (path string, err error) { - if err := validateBasePathName(name); err != nil { - return name, err - } - - bpath := filepath.Clean(b.path) - path = filepath.Clean(filepath.Join(bpath, name)) - if !strings.HasPrefix(path, bpath) { - return name, os.ErrNotExist - } - - return path, nil -} - -func validateBasePathName(name string) error { - if runtime.GOOS != "windows" { - // Not much to do here; - // the virtual file paths all look absolute on *nix. - return nil - } - - // On Windows a common mistake would be to provide an absolute OS path - // We could strip out the base part, but that would not be very portable. - if filepath.IsAbs(name) { - return os.ErrNotExist - } - - return nil -} - -func (b *BasePathFs) Chtimes(name string, atime, mtime time.Time) (err error) { - if name, err = b.RealPath(name); err != nil { - return &os.PathError{Op: "chtimes", Path: name, Err: err} - } - return b.source.Chtimes(name, atime, mtime) -} - -func (b *BasePathFs) Chmod(name string, mode os.FileMode) (err error) { - if name, err = b.RealPath(name); err != nil { - return &os.PathError{Op: "chmod", Path: name, Err: err} - } - return b.source.Chmod(name, mode) -} - -func (b *BasePathFs) Name() string { - return "BasePathFs" -} - -func (b *BasePathFs) Stat(name string) (fi os.FileInfo, err error) { - if name, err = b.RealPath(name); err != nil { - return nil, &os.PathError{Op: "stat", Path: name, Err: err} - } - return b.source.Stat(name) -} - -func (b *BasePathFs) Rename(oldname, newname string) (err error) { - if oldname, err = b.RealPath(oldname); err != nil { - return &os.PathError{Op: "rename", Path: oldname, Err: err} - } - if newname, err = b.RealPath(newname); err != nil { - return &os.PathError{Op: "rename", Path: newname, Err: err} - } - return b.source.Rename(oldname, newname) -} - -func (b *BasePathFs) RemoveAll(name string) (err error) { - if name, err = b.RealPath(name); err != nil { - return &os.PathError{Op: "remove_all", Path: name, Err: err} - } - return b.source.RemoveAll(name) -} - -func (b *BasePathFs) Remove(name string) (err error) { - if name, err = b.RealPath(name); err != nil { - return &os.PathError{Op: "remove", Path: name, Err: err} - } - return b.source.Remove(name) -} - -func (b *BasePathFs) OpenFile(name string, flag int, mode os.FileMode) (f File, err error) { - if name, err = b.RealPath(name); err != nil { - return nil, &os.PathError{Op: "openfile", Path: name, Err: err} - } - sourcef, err := b.source.OpenFile(name, flag, mode) - if err != nil { - return nil, err - } - return &BasePathFile{sourcef, b.path}, nil -} - -func (b *BasePathFs) Open(name string) (f File, err error) { - if name, err = b.RealPath(name); err != nil { - return nil, &os.PathError{Op: "open", Path: name, Err: err} - } - sourcef, err := b.source.Open(name) - if err != nil { - return nil, err - } - return &BasePathFile{File: sourcef, path: b.path}, nil -} - -func (b *BasePathFs) Mkdir(name string, mode os.FileMode) (err error) { - if name, err = b.RealPath(name); err != nil { - return &os.PathError{Op: "mkdir", Path: name, Err: err} - } - return b.source.Mkdir(name, mode) -} - -func (b *BasePathFs) MkdirAll(name string, mode os.FileMode) (err error) { - if name, err = b.RealPath(name); err != nil { - return &os.PathError{Op: "mkdir", Path: name, Err: err} - } - return b.source.MkdirAll(name, mode) -} - -func (b *BasePathFs) Create(name string) (f File, err error) { - if name, err = b.RealPath(name); err != nil { - return nil, &os.PathError{Op: "create", Path: name, Err: err} - } - sourcef, err := b.source.Create(name) - if err != nil { - return nil, err - } - return &BasePathFile{File: sourcef, path: b.path}, nil -} - -func (b *BasePathFs) LstatIfPossible(name string) (os.FileInfo, bool, error) { - name, err := b.RealPath(name) - if err != nil { - return nil, false, &os.PathError{Op: "lstat", Path: name, Err: err} - } - if lstater, ok := b.source.(Lstater); ok { - return lstater.LstatIfPossible(name) - } - fi, err := b.source.Stat(name) - return fi, false, err -} - -// vim: ts=4 sw=4 noexpandtab nolist syn=go diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/cacheOnReadFs.go b/cluster-autoscaler/vendor/github.com/spf13/afero/cacheOnReadFs.go deleted file mode 100644 index 29a26c67dd5d..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/cacheOnReadFs.go +++ /dev/null @@ -1,290 +0,0 @@ -package afero - -import ( - "os" - "syscall" - "time" -) - -// If the cache duration is 0, cache time will be unlimited, i.e. once -// a file is in the layer, the base will never be read again for this file. -// -// For cache times greater than 0, the modification time of a file is -// checked. Note that a lot of file system implementations only allow a -// resolution of a second for timestamps... or as the godoc for os.Chtimes() -// states: "The underlying filesystem may truncate or round the values to a -// less precise time unit." -// -// This caching union will forward all write calls also to the base file -// system first. To prevent writing to the base Fs, wrap it in a read-only -// filter - Note: this will also make the overlay read-only, for writing files -// in the overlay, use the overlay Fs directly, not via the union Fs. -type CacheOnReadFs struct { - base Fs - layer Fs - cacheTime time.Duration -} - -func NewCacheOnReadFs(base Fs, layer Fs, cacheTime time.Duration) Fs { - return &CacheOnReadFs{base: base, layer: layer, cacheTime: cacheTime} -} - -type cacheState int - -const ( - // not present in the overlay, unknown if it exists in the base: - cacheMiss cacheState = iota - // present in the overlay and in base, base file is newer: - cacheStale - // present in the overlay - with cache time == 0 it may exist in the base, - // with cacheTime > 0 it exists in the base and is same age or newer in the - // overlay - cacheHit - // happens if someone writes directly to the overlay without - // going through this union - cacheLocal -) - -func (u *CacheOnReadFs) cacheStatus(name string) (state cacheState, fi os.FileInfo, err error) { - var lfi, bfi os.FileInfo - lfi, err = u.layer.Stat(name) - if err == nil { - if u.cacheTime == 0 { - return cacheHit, lfi, nil - } - if lfi.ModTime().Add(u.cacheTime).Before(time.Now()) { - bfi, err = u.base.Stat(name) - if err != nil { - return cacheLocal, lfi, nil - } - if bfi.ModTime().After(lfi.ModTime()) { - return cacheStale, bfi, nil - } - } - return cacheHit, lfi, nil - } - - if err == syscall.ENOENT || os.IsNotExist(err) { - return cacheMiss, nil, nil - } - - return cacheMiss, nil, err -} - -func (u *CacheOnReadFs) copyToLayer(name string) error { - return copyToLayer(u.base, u.layer, name) -} - -func (u *CacheOnReadFs) Chtimes(name string, atime, mtime time.Time) error { - st, _, err := u.cacheStatus(name) - if err != nil { - return err - } - switch st { - case cacheLocal: - case cacheHit: - err = u.base.Chtimes(name, atime, mtime) - case cacheStale, cacheMiss: - if err := u.copyToLayer(name); err != nil { - return err - } - err = u.base.Chtimes(name, atime, mtime) - } - if err != nil { - return err - } - return u.layer.Chtimes(name, atime, mtime) -} - -func (u *CacheOnReadFs) Chmod(name string, mode os.FileMode) error { - st, _, err := u.cacheStatus(name) - if err != nil { - return err - } - switch st { - case cacheLocal: - case cacheHit: - err = u.base.Chmod(name, mode) - case cacheStale, cacheMiss: - if err := u.copyToLayer(name); err != nil { - return err - } - err = u.base.Chmod(name, mode) - } - if err != nil { - return err - } - return u.layer.Chmod(name, mode) -} - -func (u *CacheOnReadFs) Stat(name string) (os.FileInfo, error) { - st, fi, err := u.cacheStatus(name) - if err != nil { - return nil, err - } - switch st { - case cacheMiss: - return u.base.Stat(name) - default: // cacheStale has base, cacheHit and cacheLocal the layer os.FileInfo - return fi, nil - } -} - -func (u *CacheOnReadFs) Rename(oldname, newname string) error { - st, _, err := u.cacheStatus(oldname) - if err != nil { - return err - } - switch st { - case cacheLocal: - case cacheHit: - err = u.base.Rename(oldname, newname) - case cacheStale, cacheMiss: - if err := u.copyToLayer(oldname); err != nil { - return err - } - err = u.base.Rename(oldname, newname) - } - if err != nil { - return err - } - return u.layer.Rename(oldname, newname) -} - -func (u *CacheOnReadFs) Remove(name string) error { - st, _, err := u.cacheStatus(name) - if err != nil { - return err - } - switch st { - case cacheLocal: - case cacheHit, cacheStale, cacheMiss: - err = u.base.Remove(name) - } - if err != nil { - return err - } - return u.layer.Remove(name) -} - -func (u *CacheOnReadFs) RemoveAll(name string) error { - st, _, err := u.cacheStatus(name) - if err != nil { - return err - } - switch st { - case cacheLocal: - case cacheHit, cacheStale, cacheMiss: - err = u.base.RemoveAll(name) - } - if err != nil { - return err - } - return u.layer.RemoveAll(name) -} - -func (u *CacheOnReadFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - st, _, err := u.cacheStatus(name) - if err != nil { - return nil, err - } - switch st { - case cacheLocal, cacheHit: - default: - if err := u.copyToLayer(name); err != nil { - return nil, err - } - } - if flag&(os.O_WRONLY|syscall.O_RDWR|os.O_APPEND|os.O_CREATE|os.O_TRUNC) != 0 { - bfi, err := u.base.OpenFile(name, flag, perm) - if err != nil { - return nil, err - } - lfi, err := u.layer.OpenFile(name, flag, perm) - if err != nil { - bfi.Close() // oops, what if O_TRUNC was set and file opening in the layer failed...? - return nil, err - } - return &UnionFile{Base: bfi, Layer: lfi}, nil - } - return u.layer.OpenFile(name, flag, perm) -} - -func (u *CacheOnReadFs) Open(name string) (File, error) { - st, fi, err := u.cacheStatus(name) - if err != nil { - return nil, err - } - - switch st { - case cacheLocal: - return u.layer.Open(name) - - case cacheMiss: - bfi, err := u.base.Stat(name) - if err != nil { - return nil, err - } - if bfi.IsDir() { - return u.base.Open(name) - } - if err := u.copyToLayer(name); err != nil { - return nil, err - } - return u.layer.Open(name) - - case cacheStale: - if !fi.IsDir() { - if err := u.copyToLayer(name); err != nil { - return nil, err - } - return u.layer.Open(name) - } - case cacheHit: - if !fi.IsDir() { - return u.layer.Open(name) - } - } - // the dirs from cacheHit, cacheStale fall down here: - bfile, _ := u.base.Open(name) - lfile, err := u.layer.Open(name) - if err != nil && bfile == nil { - return nil, err - } - return &UnionFile{Base: bfile, Layer: lfile}, nil -} - -func (u *CacheOnReadFs) Mkdir(name string, perm os.FileMode) error { - err := u.base.Mkdir(name, perm) - if err != nil { - return err - } - return u.layer.MkdirAll(name, perm) // yes, MkdirAll... we cannot assume it exists in the cache -} - -func (u *CacheOnReadFs) Name() string { - return "CacheOnReadFs" -} - -func (u *CacheOnReadFs) MkdirAll(name string, perm os.FileMode) error { - err := u.base.MkdirAll(name, perm) - if err != nil { - return err - } - return u.layer.MkdirAll(name, perm) -} - -func (u *CacheOnReadFs) Create(name string) (File, error) { - bfh, err := u.base.Create(name) - if err != nil { - return nil, err - } - lfh, err := u.layer.Create(name) - if err != nil { - // oops, see comment about OS_TRUNC above, should we remove? then we have to - // remember if the file did not exist before - bfh.Close() - return nil, err - } - return &UnionFile{Base: bfh, Layer: lfh}, nil -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/copyOnWriteFs.go b/cluster-autoscaler/vendor/github.com/spf13/afero/copyOnWriteFs.go deleted file mode 100644 index e8108a851e15..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/copyOnWriteFs.go +++ /dev/null @@ -1,293 +0,0 @@ -package afero - -import ( - "fmt" - "os" - "path/filepath" - "syscall" - "time" -) - -var _ Lstater = (*CopyOnWriteFs)(nil) - -// The CopyOnWriteFs is a union filesystem: a read only base file system with -// a possibly writeable layer on top. Changes to the file system will only -// be made in the overlay: Changing an existing file in the base layer which -// is not present in the overlay will copy the file to the overlay ("changing" -// includes also calls to e.g. Chtimes() and Chmod()). -// -// Reading directories is currently only supported via Open(), not OpenFile(). -type CopyOnWriteFs struct { - base Fs - layer Fs -} - -func NewCopyOnWriteFs(base Fs, layer Fs) Fs { - return &CopyOnWriteFs{base: base, layer: layer} -} - -// Returns true if the file is not in the overlay -func (u *CopyOnWriteFs) isBaseFile(name string) (bool, error) { - if _, err := u.layer.Stat(name); err == nil { - return false, nil - } - _, err := u.base.Stat(name) - if err != nil { - if oerr, ok := err.(*os.PathError); ok { - if oerr.Err == os.ErrNotExist || oerr.Err == syscall.ENOENT || oerr.Err == syscall.ENOTDIR { - return false, nil - } - } - if err == syscall.ENOENT { - return false, nil - } - } - return true, err -} - -func (u *CopyOnWriteFs) copyToLayer(name string) error { - return copyToLayer(u.base, u.layer, name) -} - -func (u *CopyOnWriteFs) Chtimes(name string, atime, mtime time.Time) error { - b, err := u.isBaseFile(name) - if err != nil { - return err - } - if b { - if err := u.copyToLayer(name); err != nil { - return err - } - } - return u.layer.Chtimes(name, atime, mtime) -} - -func (u *CopyOnWriteFs) Chmod(name string, mode os.FileMode) error { - b, err := u.isBaseFile(name) - if err != nil { - return err - } - if b { - if err := u.copyToLayer(name); err != nil { - return err - } - } - return u.layer.Chmod(name, mode) -} - -func (u *CopyOnWriteFs) Stat(name string) (os.FileInfo, error) { - fi, err := u.layer.Stat(name) - if err != nil { - isNotExist := u.isNotExist(err) - if isNotExist { - return u.base.Stat(name) - } - return nil, err - } - return fi, nil -} - -func (u *CopyOnWriteFs) LstatIfPossible(name string) (os.FileInfo, bool, error) { - llayer, ok1 := u.layer.(Lstater) - lbase, ok2 := u.base.(Lstater) - - if ok1 { - fi, b, err := llayer.LstatIfPossible(name) - if err == nil { - return fi, b, nil - } - - if !u.isNotExist(err) { - return nil, b, err - } - } - - if ok2 { - fi, b, err := lbase.LstatIfPossible(name) - if err == nil { - return fi, b, nil - } - if !u.isNotExist(err) { - return nil, b, err - } - } - - fi, err := u.Stat(name) - - return fi, false, err -} - -func (u *CopyOnWriteFs) isNotExist(err error) bool { - if e, ok := err.(*os.PathError); ok { - err = e.Err - } - if err == os.ErrNotExist || err == syscall.ENOENT || err == syscall.ENOTDIR { - return true - } - return false -} - -// Renaming files present only in the base layer is not permitted -func (u *CopyOnWriteFs) Rename(oldname, newname string) error { - b, err := u.isBaseFile(oldname) - if err != nil { - return err - } - if b { - return syscall.EPERM - } - return u.layer.Rename(oldname, newname) -} - -// Removing files present only in the base layer is not permitted. If -// a file is present in the base layer and the overlay, only the overlay -// will be removed. -func (u *CopyOnWriteFs) Remove(name string) error { - err := u.layer.Remove(name) - switch err { - case syscall.ENOENT: - _, err = u.base.Stat(name) - if err == nil { - return syscall.EPERM - } - return syscall.ENOENT - default: - return err - } -} - -func (u *CopyOnWriteFs) RemoveAll(name string) error { - err := u.layer.RemoveAll(name) - switch err { - case syscall.ENOENT: - _, err = u.base.Stat(name) - if err == nil { - return syscall.EPERM - } - return syscall.ENOENT - default: - return err - } -} - -func (u *CopyOnWriteFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - b, err := u.isBaseFile(name) - if err != nil { - return nil, err - } - - if flag&(os.O_WRONLY|os.O_RDWR|os.O_APPEND|os.O_CREATE|os.O_TRUNC) != 0 { - if b { - if err = u.copyToLayer(name); err != nil { - return nil, err - } - return u.layer.OpenFile(name, flag, perm) - } - - dir := filepath.Dir(name) - isaDir, err := IsDir(u.base, dir) - if err != nil && !os.IsNotExist(err) { - return nil, err - } - if isaDir { - if err = u.layer.MkdirAll(dir, 0777); err != nil { - return nil, err - } - return u.layer.OpenFile(name, flag, perm) - } - - isaDir, err = IsDir(u.layer, dir) - if err != nil { - return nil, err - } - if isaDir { - return u.layer.OpenFile(name, flag, perm) - } - - return nil, &os.PathError{Op: "open", Path: name, Err: syscall.ENOTDIR} // ...or os.ErrNotExist? - } - if b { - return u.base.OpenFile(name, flag, perm) - } - return u.layer.OpenFile(name, flag, perm) -} - -// This function handles the 9 different possibilities caused -// by the union which are the intersection of the following... -// layer: doesn't exist, exists as a file, and exists as a directory -// base: doesn't exist, exists as a file, and exists as a directory -func (u *CopyOnWriteFs) Open(name string) (File, error) { - // Since the overlay overrides the base we check that first - b, err := u.isBaseFile(name) - if err != nil { - return nil, err - } - - // If overlay doesn't exist, return the base (base state irrelevant) - if b { - return u.base.Open(name) - } - - // If overlay is a file, return it (base state irrelevant) - dir, err := IsDir(u.layer, name) - if err != nil { - return nil, err - } - if !dir { - return u.layer.Open(name) - } - - // Overlay is a directory, base state now matters. - // Base state has 3 states to check but 2 outcomes: - // A. It's a file or non-readable in the base (return just the overlay) - // B. It's an accessible directory in the base (return a UnionFile) - - // If base is file or nonreadable, return overlay - dir, err = IsDir(u.base, name) - if !dir || err != nil { - return u.layer.Open(name) - } - - // Both base & layer are directories - // Return union file (if opens are without error) - bfile, bErr := u.base.Open(name) - lfile, lErr := u.layer.Open(name) - - // If either have errors at this point something is very wrong. Return nil and the errors - if bErr != nil || lErr != nil { - return nil, fmt.Errorf("BaseErr: %v\nOverlayErr: %v", bErr, lErr) - } - - return &UnionFile{Base: bfile, Layer: lfile}, nil -} - -func (u *CopyOnWriteFs) Mkdir(name string, perm os.FileMode) error { - dir, err := IsDir(u.base, name) - if err != nil { - return u.layer.MkdirAll(name, perm) - } - if dir { - return ErrFileExists - } - return u.layer.MkdirAll(name, perm) -} - -func (u *CopyOnWriteFs) Name() string { - return "CopyOnWriteFs" -} - -func (u *CopyOnWriteFs) MkdirAll(name string, perm os.FileMode) error { - dir, err := IsDir(u.base, name) - if err != nil { - return u.layer.MkdirAll(name, perm) - } - if dir { - // This is in line with how os.MkdirAll behaves. - return nil - } - return u.layer.MkdirAll(name, perm) -} - -func (u *CopyOnWriteFs) Create(name string) (File, error) { - return u.OpenFile(name, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0666) -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/go.mod b/cluster-autoscaler/vendor/github.com/spf13/afero/go.mod deleted file mode 100644 index 086855099574..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/spf13/afero - -require golang.org/x/text v0.3.0 diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/go.sum b/cluster-autoscaler/vendor/github.com/spf13/afero/go.sum deleted file mode 100644 index 6bad37b2a772..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/httpFs.go b/cluster-autoscaler/vendor/github.com/spf13/afero/httpFs.go deleted file mode 100644 index c42193688ceb..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/httpFs.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright © 2014 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package afero - -import ( - "errors" - "net/http" - "os" - "path" - "path/filepath" - "strings" - "time" -) - -type httpDir struct { - basePath string - fs HttpFs -} - -func (d httpDir) Open(name string) (http.File, error) { - if filepath.Separator != '/' && strings.IndexRune(name, filepath.Separator) >= 0 || - strings.Contains(name, "\x00") { - return nil, errors.New("http: invalid character in file path") - } - dir := string(d.basePath) - if dir == "" { - dir = "." - } - - f, err := d.fs.Open(filepath.Join(dir, filepath.FromSlash(path.Clean("/"+name)))) - if err != nil { - return nil, err - } - return f, nil -} - -type HttpFs struct { - source Fs -} - -func NewHttpFs(source Fs) *HttpFs { - return &HttpFs{source: source} -} - -func (h HttpFs) Dir(s string) *httpDir { - return &httpDir{basePath: s, fs: h} -} - -func (h HttpFs) Name() string { return "h HttpFs" } - -func (h HttpFs) Create(name string) (File, error) { - return h.source.Create(name) -} - -func (h HttpFs) Chmod(name string, mode os.FileMode) error { - return h.source.Chmod(name, mode) -} - -func (h HttpFs) Chtimes(name string, atime time.Time, mtime time.Time) error { - return h.source.Chtimes(name, atime, mtime) -} - -func (h HttpFs) Mkdir(name string, perm os.FileMode) error { - return h.source.Mkdir(name, perm) -} - -func (h HttpFs) MkdirAll(path string, perm os.FileMode) error { - return h.source.MkdirAll(path, perm) -} - -func (h HttpFs) Open(name string) (http.File, error) { - f, err := h.source.Open(name) - if err == nil { - if httpfile, ok := f.(http.File); ok { - return httpfile, nil - } - } - return nil, err -} - -func (h HttpFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - return h.source.OpenFile(name, flag, perm) -} - -func (h HttpFs) Remove(name string) error { - return h.source.Remove(name) -} - -func (h HttpFs) RemoveAll(path string) error { - return h.source.RemoveAll(path) -} - -func (h HttpFs) Rename(oldname, newname string) error { - return h.source.Rename(oldname, newname) -} - -func (h HttpFs) Stat(name string) (os.FileInfo, error) { - return h.source.Stat(name) -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/ioutil.go b/cluster-autoscaler/vendor/github.com/spf13/afero/ioutil.go deleted file mode 100644 index 5c3a3d8fffc9..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/ioutil.go +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright ©2015 The Go Authors -// Copyright ©2015 Steve Francia -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package afero - -import ( - "bytes" - "io" - "os" - "path/filepath" - "sort" - "strconv" - "sync" - "time" -) - -// byName implements sort.Interface. -type byName []os.FileInfo - -func (f byName) Len() int { return len(f) } -func (f byName) Less(i, j int) bool { return f[i].Name() < f[j].Name() } -func (f byName) Swap(i, j int) { f[i], f[j] = f[j], f[i] } - -// ReadDir reads the directory named by dirname and returns -// a list of sorted directory entries. -func (a Afero) ReadDir(dirname string) ([]os.FileInfo, error) { - return ReadDir(a.Fs, dirname) -} - -func ReadDir(fs Fs, dirname string) ([]os.FileInfo, error) { - f, err := fs.Open(dirname) - if err != nil { - return nil, err - } - list, err := f.Readdir(-1) - f.Close() - if err != nil { - return nil, err - } - sort.Sort(byName(list)) - return list, nil -} - -// ReadFile reads the file named by filename and returns the contents. -// A successful call returns err == nil, not err == EOF. Because ReadFile -// reads the whole file, it does not treat an EOF from Read as an error -// to be reported. -func (a Afero) ReadFile(filename string) ([]byte, error) { - return ReadFile(a.Fs, filename) -} - -func ReadFile(fs Fs, filename string) ([]byte, error) { - f, err := fs.Open(filename) - if err != nil { - return nil, err - } - defer f.Close() - // It's a good but not certain bet that FileInfo will tell us exactly how much to - // read, so let's try it but be prepared for the answer to be wrong. - var n int64 - - if fi, err := f.Stat(); err == nil { - // Don't preallocate a huge buffer, just in case. - if size := fi.Size(); size < 1e9 { - n = size - } - } - // As initial capacity for readAll, use n + a little extra in case Size is zero, - // and to avoid another allocation after Read has filled the buffer. The readAll - // call will read into its allocated internal buffer cheaply. If the size was - // wrong, we'll either waste some space off the end or reallocate as needed, but - // in the overwhelmingly common case we'll get it just right. - return readAll(f, n+bytes.MinRead) -} - -// readAll reads from r until an error or EOF and returns the data it read -// from the internal buffer allocated with a specified capacity. -func readAll(r io.Reader, capacity int64) (b []byte, err error) { - buf := bytes.NewBuffer(make([]byte, 0, capacity)) - // If the buffer overflows, we will get bytes.ErrTooLarge. - // Return that as an error. Any other panic remains. - defer func() { - e := recover() - if e == nil { - return - } - if panicErr, ok := e.(error); ok && panicErr == bytes.ErrTooLarge { - err = panicErr - } else { - panic(e) - } - }() - _, err = buf.ReadFrom(r) - return buf.Bytes(), err -} - -// ReadAll reads from r until an error or EOF and returns the data it read. -// A successful call returns err == nil, not err == EOF. Because ReadAll is -// defined to read from src until EOF, it does not treat an EOF from Read -// as an error to be reported. -func ReadAll(r io.Reader) ([]byte, error) { - return readAll(r, bytes.MinRead) -} - -// WriteFile writes data to a file named by filename. -// If the file does not exist, WriteFile creates it with permissions perm; -// otherwise WriteFile truncates it before writing. -func (a Afero) WriteFile(filename string, data []byte, perm os.FileMode) error { - return WriteFile(a.Fs, filename, data, perm) -} - -func WriteFile(fs Fs, filename string, data []byte, perm os.FileMode) error { - f, err := fs.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) - if err != nil { - return err - } - n, err := f.Write(data) - if err == nil && n < len(data) { - err = io.ErrShortWrite - } - if err1 := f.Close(); err == nil { - err = err1 - } - return err -} - -// Random number state. -// We generate random temporary file names so that there's a good -// chance the file doesn't exist yet - keeps the number of tries in -// TempFile to a minimum. -var rand uint32 -var randmu sync.Mutex - -func reseed() uint32 { - return uint32(time.Now().UnixNano() + int64(os.Getpid())) -} - -func nextSuffix() string { - randmu.Lock() - r := rand - if r == 0 { - r = reseed() - } - r = r*1664525 + 1013904223 // constants from Numerical Recipes - rand = r - randmu.Unlock() - return strconv.Itoa(int(1e9 + r%1e9))[1:] -} - -// TempFile creates a new temporary file in the directory dir -// with a name beginning with prefix, opens the file for reading -// and writing, and returns the resulting *File. -// If dir is the empty string, TempFile uses the default directory -// for temporary files (see os.TempDir). -// Multiple programs calling TempFile simultaneously -// will not choose the same file. The caller can use f.Name() -// to find the pathname of the file. It is the caller's responsibility -// to remove the file when no longer needed. -func (a Afero) TempFile(dir, prefix string) (f File, err error) { - return TempFile(a.Fs, dir, prefix) -} - -func TempFile(fs Fs, dir, prefix string) (f File, err error) { - if dir == "" { - dir = os.TempDir() - } - - nconflict := 0 - for i := 0; i < 10000; i++ { - name := filepath.Join(dir, prefix+nextSuffix()) - f, err = fs.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) - if os.IsExist(err) { - if nconflict++; nconflict > 10 { - randmu.Lock() - rand = reseed() - randmu.Unlock() - } - continue - } - break - } - return -} - -// TempDir creates a new temporary directory in the directory dir -// with a name beginning with prefix and returns the path of the -// new directory. If dir is the empty string, TempDir uses the -// default directory for temporary files (see os.TempDir). -// Multiple programs calling TempDir simultaneously -// will not choose the same directory. It is the caller's responsibility -// to remove the directory when no longer needed. -func (a Afero) TempDir(dir, prefix string) (name string, err error) { - return TempDir(a.Fs, dir, prefix) -} -func TempDir(fs Fs, dir, prefix string) (name string, err error) { - if dir == "" { - dir = os.TempDir() - } - - nconflict := 0 - for i := 0; i < 10000; i++ { - try := filepath.Join(dir, prefix+nextSuffix()) - err = fs.Mkdir(try, 0700) - if os.IsExist(err) { - if nconflict++; nconflict > 10 { - randmu.Lock() - rand = reseed() - randmu.Unlock() - } - continue - } - if err == nil { - name = try - } - break - } - return -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/lstater.go b/cluster-autoscaler/vendor/github.com/spf13/afero/lstater.go deleted file mode 100644 index 89c1bfc0a7d7..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/lstater.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright © 2018 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package afero - -import ( - "os" -) - -// Lstater is an optional interface in Afero. It is only implemented by the -// filesystems saying so. -// It will call Lstat if the filesystem iself is, or it delegates to, the os filesystem. -// Else it will call Stat. -// In addtion to the FileInfo, it will return a boolean telling whether Lstat was called or not. -type Lstater interface { - LstatIfPossible(name string) (os.FileInfo, bool, error) -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/match.go b/cluster-autoscaler/vendor/github.com/spf13/afero/match.go deleted file mode 100644 index c18a87fb713d..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/match.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright © 2014 Steve Francia . -// Copyright 2009 The Go Authors. All rights reserved. - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package afero - -import ( - "path/filepath" - "sort" - "strings" -) - -// Glob returns the names of all files matching pattern or nil -// if there is no matching file. The syntax of patterns is the same -// as in Match. The pattern may describe hierarchical names such as -// /usr/*/bin/ed (assuming the Separator is '/'). -// -// Glob ignores file system errors such as I/O errors reading directories. -// The only possible returned error is ErrBadPattern, when pattern -// is malformed. -// -// This was adapted from (http://golang.org/pkg/path/filepath) and uses several -// built-ins from that package. -func Glob(fs Fs, pattern string) (matches []string, err error) { - if !hasMeta(pattern) { - // Lstat not supported by a ll filesystems. - if _, err = lstatIfPossible(fs, pattern); err != nil { - return nil, nil - } - return []string{pattern}, nil - } - - dir, file := filepath.Split(pattern) - switch dir { - case "": - dir = "." - case string(filepath.Separator): - // nothing - default: - dir = dir[0 : len(dir)-1] // chop off trailing separator - } - - if !hasMeta(dir) { - return glob(fs, dir, file, nil) - } - - var m []string - m, err = Glob(fs, dir) - if err != nil { - return - } - for _, d := range m { - matches, err = glob(fs, d, file, matches) - if err != nil { - return - } - } - return -} - -// glob searches for files matching pattern in the directory dir -// and appends them to matches. If the directory cannot be -// opened, it returns the existing matches. New matches are -// added in lexicographical order. -func glob(fs Fs, dir, pattern string, matches []string) (m []string, e error) { - m = matches - fi, err := fs.Stat(dir) - if err != nil { - return - } - if !fi.IsDir() { - return - } - d, err := fs.Open(dir) - if err != nil { - return - } - defer d.Close() - - names, _ := d.Readdirnames(-1) - sort.Strings(names) - - for _, n := range names { - matched, err := filepath.Match(pattern, n) - if err != nil { - return m, err - } - if matched { - m = append(m, filepath.Join(dir, n)) - } - } - return -} - -// hasMeta reports whether path contains any of the magic characters -// recognized by Match. -func hasMeta(path string) bool { - // TODO(niemeyer): Should other magic characters be added here? - return strings.IndexAny(path, "*?[") >= 0 -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/mem/dir.go b/cluster-autoscaler/vendor/github.com/spf13/afero/mem/dir.go deleted file mode 100644 index e104013f4571..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/mem/dir.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright © 2014 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package mem - -type Dir interface { - Len() int - Names() []string - Files() []*FileData - Add(*FileData) - Remove(*FileData) -} - -func RemoveFromMemDir(dir *FileData, f *FileData) { - dir.memDir.Remove(f) -} - -func AddToMemDir(dir *FileData, f *FileData) { - dir.memDir.Add(f) -} - -func InitializeDir(d *FileData) { - if d.memDir == nil { - d.dir = true - d.memDir = &DirMap{} - } -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/mem/dirmap.go b/cluster-autoscaler/vendor/github.com/spf13/afero/mem/dirmap.go deleted file mode 100644 index 03a57ee5b52e..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/mem/dirmap.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package mem - -import "sort" - -type DirMap map[string]*FileData - -func (m DirMap) Len() int { return len(m) } -func (m DirMap) Add(f *FileData) { m[f.name] = f } -func (m DirMap) Remove(f *FileData) { delete(m, f.name) } -func (m DirMap) Files() (files []*FileData) { - for _, f := range m { - files = append(files, f) - } - sort.Sort(filesSorter(files)) - return files -} - -// implement sort.Interface for []*FileData -type filesSorter []*FileData - -func (s filesSorter) Len() int { return len(s) } -func (s filesSorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s filesSorter) Less(i, j int) bool { return s[i].name < s[j].name } - -func (m DirMap) Names() (names []string) { - for x := range m { - names = append(names, x) - } - return names -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/mem/file.go b/cluster-autoscaler/vendor/github.com/spf13/afero/mem/file.go deleted file mode 100644 index 7af2fb56ff46..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/mem/file.go +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright © 2015 Steve Francia . -// Copyright 2013 tsuru authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package mem - -import ( - "bytes" - "errors" - "io" - "os" - "path/filepath" - "sync" - "sync/atomic" -) - -import "time" - -const FilePathSeparator = string(filepath.Separator) - -type File struct { - // atomic requires 64-bit alignment for struct field access - at int64 - readDirCount int64 - closed bool - readOnly bool - fileData *FileData -} - -func NewFileHandle(data *FileData) *File { - return &File{fileData: data} -} - -func NewReadOnlyFileHandle(data *FileData) *File { - return &File{fileData: data, readOnly: true} -} - -func (f File) Data() *FileData { - return f.fileData -} - -type FileData struct { - sync.Mutex - name string - data []byte - memDir Dir - dir bool - mode os.FileMode - modtime time.Time -} - -func (d *FileData) Name() string { - d.Lock() - defer d.Unlock() - return d.name -} - -func CreateFile(name string) *FileData { - return &FileData{name: name, mode: os.ModeTemporary, modtime: time.Now()} -} - -func CreateDir(name string) *FileData { - return &FileData{name: name, memDir: &DirMap{}, dir: true} -} - -func ChangeFileName(f *FileData, newname string) { - f.Lock() - f.name = newname - f.Unlock() -} - -func SetMode(f *FileData, mode os.FileMode) { - f.Lock() - f.mode = mode - f.Unlock() -} - -func SetModTime(f *FileData, mtime time.Time) { - f.Lock() - setModTime(f, mtime) - f.Unlock() -} - -func setModTime(f *FileData, mtime time.Time) { - f.modtime = mtime -} - -func GetFileInfo(f *FileData) *FileInfo { - return &FileInfo{f} -} - -func (f *File) Open() error { - atomic.StoreInt64(&f.at, 0) - atomic.StoreInt64(&f.readDirCount, 0) - f.fileData.Lock() - f.closed = false - f.fileData.Unlock() - return nil -} - -func (f *File) Close() error { - f.fileData.Lock() - f.closed = true - if !f.readOnly { - setModTime(f.fileData, time.Now()) - } - f.fileData.Unlock() - return nil -} - -func (f *File) Name() string { - return f.fileData.Name() -} - -func (f *File) Stat() (os.FileInfo, error) { - return &FileInfo{f.fileData}, nil -} - -func (f *File) Sync() error { - return nil -} - -func (f *File) Readdir(count int) (res []os.FileInfo, err error) { - if !f.fileData.dir { - return nil, &os.PathError{Op: "readdir", Path: f.fileData.name, Err: errors.New("not a dir")} - } - var outLength int64 - - f.fileData.Lock() - files := f.fileData.memDir.Files()[f.readDirCount:] - if count > 0 { - if len(files) < count { - outLength = int64(len(files)) - } else { - outLength = int64(count) - } - if len(files) == 0 { - err = io.EOF - } - } else { - outLength = int64(len(files)) - } - f.readDirCount += outLength - f.fileData.Unlock() - - res = make([]os.FileInfo, outLength) - for i := range res { - res[i] = &FileInfo{files[i]} - } - - return res, err -} - -func (f *File) Readdirnames(n int) (names []string, err error) { - fi, err := f.Readdir(n) - names = make([]string, len(fi)) - for i, f := range fi { - _, names[i] = filepath.Split(f.Name()) - } - return names, err -} - -func (f *File) Read(b []byte) (n int, err error) { - f.fileData.Lock() - defer f.fileData.Unlock() - if f.closed == true { - return 0, ErrFileClosed - } - if len(b) > 0 && int(f.at) == len(f.fileData.data) { - return 0, io.EOF - } - if int(f.at) > len(f.fileData.data) { - return 0, io.ErrUnexpectedEOF - } - if len(f.fileData.data)-int(f.at) >= len(b) { - n = len(b) - } else { - n = len(f.fileData.data) - int(f.at) - } - copy(b, f.fileData.data[f.at:f.at+int64(n)]) - atomic.AddInt64(&f.at, int64(n)) - return -} - -func (f *File) ReadAt(b []byte, off int64) (n int, err error) { - atomic.StoreInt64(&f.at, off) - return f.Read(b) -} - -func (f *File) Truncate(size int64) error { - if f.closed == true { - return ErrFileClosed - } - if f.readOnly { - return &os.PathError{Op: "truncate", Path: f.fileData.name, Err: errors.New("file handle is read only")} - } - if size < 0 { - return ErrOutOfRange - } - if size > int64(len(f.fileData.data)) { - diff := size - int64(len(f.fileData.data)) - f.fileData.data = append(f.fileData.data, bytes.Repeat([]byte{00}, int(diff))...) - } else { - f.fileData.data = f.fileData.data[0:size] - } - setModTime(f.fileData, time.Now()) - return nil -} - -func (f *File) Seek(offset int64, whence int) (int64, error) { - if f.closed == true { - return 0, ErrFileClosed - } - switch whence { - case 0: - atomic.StoreInt64(&f.at, offset) - case 1: - atomic.AddInt64(&f.at, int64(offset)) - case 2: - atomic.StoreInt64(&f.at, int64(len(f.fileData.data))+offset) - } - return f.at, nil -} - -func (f *File) Write(b []byte) (n int, err error) { - if f.readOnly { - return 0, &os.PathError{Op: "write", Path: f.fileData.name, Err: errors.New("file handle is read only")} - } - n = len(b) - cur := atomic.LoadInt64(&f.at) - f.fileData.Lock() - defer f.fileData.Unlock() - diff := cur - int64(len(f.fileData.data)) - var tail []byte - if n+int(cur) < len(f.fileData.data) { - tail = f.fileData.data[n+int(cur):] - } - if diff > 0 { - f.fileData.data = append(bytes.Repeat([]byte{00}, int(diff)), b...) - f.fileData.data = append(f.fileData.data, tail...) - } else { - f.fileData.data = append(f.fileData.data[:cur], b...) - f.fileData.data = append(f.fileData.data, tail...) - } - setModTime(f.fileData, time.Now()) - - atomic.StoreInt64(&f.at, int64(len(f.fileData.data))) - return -} - -func (f *File) WriteAt(b []byte, off int64) (n int, err error) { - atomic.StoreInt64(&f.at, off) - return f.Write(b) -} - -func (f *File) WriteString(s string) (ret int, err error) { - return f.Write([]byte(s)) -} - -func (f *File) Info() *FileInfo { - return &FileInfo{f.fileData} -} - -type FileInfo struct { - *FileData -} - -// Implements os.FileInfo -func (s *FileInfo) Name() string { - s.Lock() - _, name := filepath.Split(s.name) - s.Unlock() - return name -} -func (s *FileInfo) Mode() os.FileMode { - s.Lock() - defer s.Unlock() - return s.mode -} -func (s *FileInfo) ModTime() time.Time { - s.Lock() - defer s.Unlock() - return s.modtime -} -func (s *FileInfo) IsDir() bool { - s.Lock() - defer s.Unlock() - return s.dir -} -func (s *FileInfo) Sys() interface{} { return nil } -func (s *FileInfo) Size() int64 { - if s.IsDir() { - return int64(42) - } - s.Lock() - defer s.Unlock() - return int64(len(s.data)) -} - -var ( - ErrFileClosed = errors.New("File is closed") - ErrOutOfRange = errors.New("Out of range") - ErrTooLarge = errors.New("Too large") - ErrFileNotFound = os.ErrNotExist - ErrFileExists = os.ErrExist - ErrDestinationExists = os.ErrExist -) diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/memmap.go b/cluster-autoscaler/vendor/github.com/spf13/afero/memmap.go deleted file mode 100644 index 09498e70fbaa..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/memmap.go +++ /dev/null @@ -1,365 +0,0 @@ -// Copyright © 2014 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package afero - -import ( - "fmt" - "log" - "os" - "path/filepath" - "strings" - "sync" - "time" - - "github.com/spf13/afero/mem" -) - -type MemMapFs struct { - mu sync.RWMutex - data map[string]*mem.FileData - init sync.Once -} - -func NewMemMapFs() Fs { - return &MemMapFs{} -} - -func (m *MemMapFs) getData() map[string]*mem.FileData { - m.init.Do(func() { - m.data = make(map[string]*mem.FileData) - // Root should always exist, right? - // TODO: what about windows? - m.data[FilePathSeparator] = mem.CreateDir(FilePathSeparator) - }) - return m.data -} - -func (*MemMapFs) Name() string { return "MemMapFS" } - -func (m *MemMapFs) Create(name string) (File, error) { - name = normalizePath(name) - m.mu.Lock() - file := mem.CreateFile(name) - m.getData()[name] = file - m.registerWithParent(file) - m.mu.Unlock() - return mem.NewFileHandle(file), nil -} - -func (m *MemMapFs) unRegisterWithParent(fileName string) error { - f, err := m.lockfreeOpen(fileName) - if err != nil { - return err - } - parent := m.findParent(f) - if parent == nil { - log.Panic("parent of ", f.Name(), " is nil") - } - - parent.Lock() - mem.RemoveFromMemDir(parent, f) - parent.Unlock() - return nil -} - -func (m *MemMapFs) findParent(f *mem.FileData) *mem.FileData { - pdir, _ := filepath.Split(f.Name()) - pdir = filepath.Clean(pdir) - pfile, err := m.lockfreeOpen(pdir) - if err != nil { - return nil - } - return pfile -} - -func (m *MemMapFs) registerWithParent(f *mem.FileData) { - if f == nil { - return - } - parent := m.findParent(f) - if parent == nil { - pdir := filepath.Dir(filepath.Clean(f.Name())) - err := m.lockfreeMkdir(pdir, 0777) - if err != nil { - //log.Println("Mkdir error:", err) - return - } - parent, err = m.lockfreeOpen(pdir) - if err != nil { - //log.Println("Open after Mkdir error:", err) - return - } - } - - parent.Lock() - mem.InitializeDir(parent) - mem.AddToMemDir(parent, f) - parent.Unlock() -} - -func (m *MemMapFs) lockfreeMkdir(name string, perm os.FileMode) error { - name = normalizePath(name) - x, ok := m.getData()[name] - if ok { - // Only return ErrFileExists if it's a file, not a directory. - i := mem.FileInfo{FileData: x} - if !i.IsDir() { - return ErrFileExists - } - } else { - item := mem.CreateDir(name) - m.getData()[name] = item - m.registerWithParent(item) - } - return nil -} - -func (m *MemMapFs) Mkdir(name string, perm os.FileMode) error { - name = normalizePath(name) - - m.mu.RLock() - _, ok := m.getData()[name] - m.mu.RUnlock() - if ok { - return &os.PathError{Op: "mkdir", Path: name, Err: ErrFileExists} - } - - m.mu.Lock() - item := mem.CreateDir(name) - m.getData()[name] = item - m.registerWithParent(item) - m.mu.Unlock() - - m.Chmod(name, perm|os.ModeDir) - - return nil -} - -func (m *MemMapFs) MkdirAll(path string, perm os.FileMode) error { - err := m.Mkdir(path, perm) - if err != nil { - if err.(*os.PathError).Err == ErrFileExists { - return nil - } - return err - } - return nil -} - -// Handle some relative paths -func normalizePath(path string) string { - path = filepath.Clean(path) - - switch path { - case ".": - return FilePathSeparator - case "..": - return FilePathSeparator - default: - return path - } -} - -func (m *MemMapFs) Open(name string) (File, error) { - f, err := m.open(name) - if f != nil { - return mem.NewReadOnlyFileHandle(f), err - } - return nil, err -} - -func (m *MemMapFs) openWrite(name string) (File, error) { - f, err := m.open(name) - if f != nil { - return mem.NewFileHandle(f), err - } - return nil, err -} - -func (m *MemMapFs) open(name string) (*mem.FileData, error) { - name = normalizePath(name) - - m.mu.RLock() - f, ok := m.getData()[name] - m.mu.RUnlock() - if !ok { - return nil, &os.PathError{Op: "open", Path: name, Err: ErrFileNotFound} - } - return f, nil -} - -func (m *MemMapFs) lockfreeOpen(name string) (*mem.FileData, error) { - name = normalizePath(name) - f, ok := m.getData()[name] - if ok { - return f, nil - } else { - return nil, ErrFileNotFound - } -} - -func (m *MemMapFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - chmod := false - file, err := m.openWrite(name) - if os.IsNotExist(err) && (flag&os.O_CREATE > 0) { - file, err = m.Create(name) - chmod = true - } - if err != nil { - return nil, err - } - if flag == os.O_RDONLY { - file = mem.NewReadOnlyFileHandle(file.(*mem.File).Data()) - } - if flag&os.O_APPEND > 0 { - _, err = file.Seek(0, os.SEEK_END) - if err != nil { - file.Close() - return nil, err - } - } - if flag&os.O_TRUNC > 0 && flag&(os.O_RDWR|os.O_WRONLY) > 0 { - err = file.Truncate(0) - if err != nil { - file.Close() - return nil, err - } - } - if chmod { - m.Chmod(name, perm) - } - return file, nil -} - -func (m *MemMapFs) Remove(name string) error { - name = normalizePath(name) - - m.mu.Lock() - defer m.mu.Unlock() - - if _, ok := m.getData()[name]; ok { - err := m.unRegisterWithParent(name) - if err != nil { - return &os.PathError{Op: "remove", Path: name, Err: err} - } - delete(m.getData(), name) - } else { - return &os.PathError{Op: "remove", Path: name, Err: os.ErrNotExist} - } - return nil -} - -func (m *MemMapFs) RemoveAll(path string) error { - path = normalizePath(path) - m.mu.Lock() - m.unRegisterWithParent(path) - m.mu.Unlock() - - m.mu.RLock() - defer m.mu.RUnlock() - - for p, _ := range m.getData() { - if strings.HasPrefix(p, path) { - m.mu.RUnlock() - m.mu.Lock() - delete(m.getData(), p) - m.mu.Unlock() - m.mu.RLock() - } - } - return nil -} - -func (m *MemMapFs) Rename(oldname, newname string) error { - oldname = normalizePath(oldname) - newname = normalizePath(newname) - - if oldname == newname { - return nil - } - - m.mu.RLock() - defer m.mu.RUnlock() - if _, ok := m.getData()[oldname]; ok { - m.mu.RUnlock() - m.mu.Lock() - m.unRegisterWithParent(oldname) - fileData := m.getData()[oldname] - delete(m.getData(), oldname) - mem.ChangeFileName(fileData, newname) - m.getData()[newname] = fileData - m.registerWithParent(fileData) - m.mu.Unlock() - m.mu.RLock() - } else { - return &os.PathError{Op: "rename", Path: oldname, Err: ErrFileNotFound} - } - return nil -} - -func (m *MemMapFs) Stat(name string) (os.FileInfo, error) { - f, err := m.Open(name) - if err != nil { - return nil, err - } - fi := mem.GetFileInfo(f.(*mem.File).Data()) - return fi, nil -} - -func (m *MemMapFs) Chmod(name string, mode os.FileMode) error { - name = normalizePath(name) - - m.mu.RLock() - f, ok := m.getData()[name] - m.mu.RUnlock() - if !ok { - return &os.PathError{Op: "chmod", Path: name, Err: ErrFileNotFound} - } - - m.mu.Lock() - mem.SetMode(f, mode) - m.mu.Unlock() - - return nil -} - -func (m *MemMapFs) Chtimes(name string, atime time.Time, mtime time.Time) error { - name = normalizePath(name) - - m.mu.RLock() - f, ok := m.getData()[name] - m.mu.RUnlock() - if !ok { - return &os.PathError{Op: "chtimes", Path: name, Err: ErrFileNotFound} - } - - m.mu.Lock() - mem.SetModTime(f, mtime) - m.mu.Unlock() - - return nil -} - -func (m *MemMapFs) List() { - for _, x := range m.data { - y := mem.FileInfo{FileData: x} - fmt.Println(x.Name(), y.Size()) - } -} - -// func debugMemMapList(fs Fs) { -// if x, ok := fs.(*MemMapFs); ok { -// x.List() -// } -// } diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/os.go b/cluster-autoscaler/vendor/github.com/spf13/afero/os.go deleted file mode 100644 index 13cc1b84c933..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/os.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright © 2014 Steve Francia . -// Copyright 2013 tsuru authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package afero - -import ( - "os" - "time" -) - -var _ Lstater = (*OsFs)(nil) - -// OsFs is a Fs implementation that uses functions provided by the os package. -// -// For details in any method, check the documentation of the os package -// (http://golang.org/pkg/os/). -type OsFs struct{} - -func NewOsFs() Fs { - return &OsFs{} -} - -func (OsFs) Name() string { return "OsFs" } - -func (OsFs) Create(name string) (File, error) { - f, e := os.Create(name) - if f == nil { - // while this looks strange, we need to return a bare nil (of type nil) not - // a nil value of type *os.File or nil won't be nil - return nil, e - } - return f, e -} - -func (OsFs) Mkdir(name string, perm os.FileMode) error { - return os.Mkdir(name, perm) -} - -func (OsFs) MkdirAll(path string, perm os.FileMode) error { - return os.MkdirAll(path, perm) -} - -func (OsFs) Open(name string) (File, error) { - f, e := os.Open(name) - if f == nil { - // while this looks strange, we need to return a bare nil (of type nil) not - // a nil value of type *os.File or nil won't be nil - return nil, e - } - return f, e -} - -func (OsFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - f, e := os.OpenFile(name, flag, perm) - if f == nil { - // while this looks strange, we need to return a bare nil (of type nil) not - // a nil value of type *os.File or nil won't be nil - return nil, e - } - return f, e -} - -func (OsFs) Remove(name string) error { - return os.Remove(name) -} - -func (OsFs) RemoveAll(path string) error { - return os.RemoveAll(path) -} - -func (OsFs) Rename(oldname, newname string) error { - return os.Rename(oldname, newname) -} - -func (OsFs) Stat(name string) (os.FileInfo, error) { - return os.Stat(name) -} - -func (OsFs) Chmod(name string, mode os.FileMode) error { - return os.Chmod(name, mode) -} - -func (OsFs) Chtimes(name string, atime time.Time, mtime time.Time) error { - return os.Chtimes(name, atime, mtime) -} - -func (OsFs) LstatIfPossible(name string) (os.FileInfo, bool, error) { - fi, err := os.Lstat(name) - return fi, true, err -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/path.go b/cluster-autoscaler/vendor/github.com/spf13/afero/path.go deleted file mode 100644 index 18f60a0f6b69..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/path.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright ©2015 The Go Authors -// Copyright ©2015 Steve Francia -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package afero - -import ( - "os" - "path/filepath" - "sort" -) - -// readDirNames reads the directory named by dirname and returns -// a sorted list of directory entries. -// adapted from https://golang.org/src/path/filepath/path.go -func readDirNames(fs Fs, dirname string) ([]string, error) { - f, err := fs.Open(dirname) - if err != nil { - return nil, err - } - names, err := f.Readdirnames(-1) - f.Close() - if err != nil { - return nil, err - } - sort.Strings(names) - return names, nil -} - -// walk recursively descends path, calling walkFn -// adapted from https://golang.org/src/path/filepath/path.go -func walk(fs Fs, path string, info os.FileInfo, walkFn filepath.WalkFunc) error { - err := walkFn(path, info, nil) - if err != nil { - if info.IsDir() && err == filepath.SkipDir { - return nil - } - return err - } - - if !info.IsDir() { - return nil - } - - names, err := readDirNames(fs, path) - if err != nil { - return walkFn(path, info, err) - } - - for _, name := range names { - filename := filepath.Join(path, name) - fileInfo, err := lstatIfPossible(fs, filename) - if err != nil { - if err := walkFn(filename, fileInfo, err); err != nil && err != filepath.SkipDir { - return err - } - } else { - err = walk(fs, filename, fileInfo, walkFn) - if err != nil { - if !fileInfo.IsDir() || err != filepath.SkipDir { - return err - } - } - } - } - return nil -} - -// if the filesystem supports it, use Lstat, else use fs.Stat -func lstatIfPossible(fs Fs, path string) (os.FileInfo, error) { - if lfs, ok := fs.(Lstater); ok { - fi, _, err := lfs.LstatIfPossible(path) - return fi, err - } - return fs.Stat(path) -} - -// Walk walks the file tree rooted at root, calling walkFn for each file or -// directory in the tree, including root. All errors that arise visiting files -// and directories are filtered by walkFn. The files are walked in lexical -// order, which makes the output deterministic but means that for very -// large directories Walk can be inefficient. -// Walk does not follow symbolic links. - -func (a Afero) Walk(root string, walkFn filepath.WalkFunc) error { - return Walk(a.Fs, root, walkFn) -} - -func Walk(fs Fs, root string, walkFn filepath.WalkFunc) error { - info, err := lstatIfPossible(fs, root) - if err != nil { - return walkFn(root, nil, err) - } - return walk(fs, root, info, walkFn) -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/readonlyfs.go b/cluster-autoscaler/vendor/github.com/spf13/afero/readonlyfs.go deleted file mode 100644 index c6376ec373aa..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/readonlyfs.go +++ /dev/null @@ -1,80 +0,0 @@ -package afero - -import ( - "os" - "syscall" - "time" -) - -var _ Lstater = (*ReadOnlyFs)(nil) - -type ReadOnlyFs struct { - source Fs -} - -func NewReadOnlyFs(source Fs) Fs { - return &ReadOnlyFs{source: source} -} - -func (r *ReadOnlyFs) ReadDir(name string) ([]os.FileInfo, error) { - return ReadDir(r.source, name) -} - -func (r *ReadOnlyFs) Chtimes(n string, a, m time.Time) error { - return syscall.EPERM -} - -func (r *ReadOnlyFs) Chmod(n string, m os.FileMode) error { - return syscall.EPERM -} - -func (r *ReadOnlyFs) Name() string { - return "ReadOnlyFilter" -} - -func (r *ReadOnlyFs) Stat(name string) (os.FileInfo, error) { - return r.source.Stat(name) -} - -func (r *ReadOnlyFs) LstatIfPossible(name string) (os.FileInfo, bool, error) { - if lsf, ok := r.source.(Lstater); ok { - return lsf.LstatIfPossible(name) - } - fi, err := r.Stat(name) - return fi, false, err -} - -func (r *ReadOnlyFs) Rename(o, n string) error { - return syscall.EPERM -} - -func (r *ReadOnlyFs) RemoveAll(p string) error { - return syscall.EPERM -} - -func (r *ReadOnlyFs) Remove(n string) error { - return syscall.EPERM -} - -func (r *ReadOnlyFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - if flag&(os.O_WRONLY|syscall.O_RDWR|os.O_APPEND|os.O_CREATE|os.O_TRUNC) != 0 { - return nil, syscall.EPERM - } - return r.source.OpenFile(name, flag, perm) -} - -func (r *ReadOnlyFs) Open(n string) (File, error) { - return r.source.Open(n) -} - -func (r *ReadOnlyFs) Mkdir(n string, p os.FileMode) error { - return syscall.EPERM -} - -func (r *ReadOnlyFs) MkdirAll(n string, p os.FileMode) error { - return syscall.EPERM -} - -func (r *ReadOnlyFs) Create(n string) (File, error) { - return nil, syscall.EPERM -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/regexpfs.go b/cluster-autoscaler/vendor/github.com/spf13/afero/regexpfs.go deleted file mode 100644 index 9d92dbc051ff..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/regexpfs.go +++ /dev/null @@ -1,214 +0,0 @@ -package afero - -import ( - "os" - "regexp" - "syscall" - "time" -) - -// The RegexpFs filters files (not directories) by regular expression. Only -// files matching the given regexp will be allowed, all others get a ENOENT error ( -// "No such file or directory"). -// -type RegexpFs struct { - re *regexp.Regexp - source Fs -} - -func NewRegexpFs(source Fs, re *regexp.Regexp) Fs { - return &RegexpFs{source: source, re: re} -} - -type RegexpFile struct { - f File - re *regexp.Regexp -} - -func (r *RegexpFs) matchesName(name string) error { - if r.re == nil { - return nil - } - if r.re.MatchString(name) { - return nil - } - return syscall.ENOENT -} - -func (r *RegexpFs) dirOrMatches(name string) error { - dir, err := IsDir(r.source, name) - if err != nil { - return err - } - if dir { - return nil - } - return r.matchesName(name) -} - -func (r *RegexpFs) Chtimes(name string, a, m time.Time) error { - if err := r.dirOrMatches(name); err != nil { - return err - } - return r.source.Chtimes(name, a, m) -} - -func (r *RegexpFs) Chmod(name string, mode os.FileMode) error { - if err := r.dirOrMatches(name); err != nil { - return err - } - return r.source.Chmod(name, mode) -} - -func (r *RegexpFs) Name() string { - return "RegexpFs" -} - -func (r *RegexpFs) Stat(name string) (os.FileInfo, error) { - if err := r.dirOrMatches(name); err != nil { - return nil, err - } - return r.source.Stat(name) -} - -func (r *RegexpFs) Rename(oldname, newname string) error { - dir, err := IsDir(r.source, oldname) - if err != nil { - return err - } - if dir { - return nil - } - if err := r.matchesName(oldname); err != nil { - return err - } - if err := r.matchesName(newname); err != nil { - return err - } - return r.source.Rename(oldname, newname) -} - -func (r *RegexpFs) RemoveAll(p string) error { - dir, err := IsDir(r.source, p) - if err != nil { - return err - } - if !dir { - if err := r.matchesName(p); err != nil { - return err - } - } - return r.source.RemoveAll(p) -} - -func (r *RegexpFs) Remove(name string) error { - if err := r.dirOrMatches(name); err != nil { - return err - } - return r.source.Remove(name) -} - -func (r *RegexpFs) OpenFile(name string, flag int, perm os.FileMode) (File, error) { - if err := r.dirOrMatches(name); err != nil { - return nil, err - } - return r.source.OpenFile(name, flag, perm) -} - -func (r *RegexpFs) Open(name string) (File, error) { - dir, err := IsDir(r.source, name) - if err != nil { - return nil, err - } - if !dir { - if err := r.matchesName(name); err != nil { - return nil, err - } - } - f, err := r.source.Open(name) - return &RegexpFile{f: f, re: r.re}, nil -} - -func (r *RegexpFs) Mkdir(n string, p os.FileMode) error { - return r.source.Mkdir(n, p) -} - -func (r *RegexpFs) MkdirAll(n string, p os.FileMode) error { - return r.source.MkdirAll(n, p) -} - -func (r *RegexpFs) Create(name string) (File, error) { - if err := r.matchesName(name); err != nil { - return nil, err - } - return r.source.Create(name) -} - -func (f *RegexpFile) Close() error { - return f.f.Close() -} - -func (f *RegexpFile) Read(s []byte) (int, error) { - return f.f.Read(s) -} - -func (f *RegexpFile) ReadAt(s []byte, o int64) (int, error) { - return f.f.ReadAt(s, o) -} - -func (f *RegexpFile) Seek(o int64, w int) (int64, error) { - return f.f.Seek(o, w) -} - -func (f *RegexpFile) Write(s []byte) (int, error) { - return f.f.Write(s) -} - -func (f *RegexpFile) WriteAt(s []byte, o int64) (int, error) { - return f.f.WriteAt(s, o) -} - -func (f *RegexpFile) Name() string { - return f.f.Name() -} - -func (f *RegexpFile) Readdir(c int) (fi []os.FileInfo, err error) { - var rfi []os.FileInfo - rfi, err = f.f.Readdir(c) - if err != nil { - return nil, err - } - for _, i := range rfi { - if i.IsDir() || f.re.MatchString(i.Name()) { - fi = append(fi, i) - } - } - return fi, nil -} - -func (f *RegexpFile) Readdirnames(c int) (n []string, err error) { - fi, err := f.Readdir(c) - if err != nil { - return nil, err - } - for _, s := range fi { - n = append(n, s.Name()) - } - return n, nil -} - -func (f *RegexpFile) Stat() (os.FileInfo, error) { - return f.f.Stat() -} - -func (f *RegexpFile) Sync() error { - return f.f.Sync() -} - -func (f *RegexpFile) Truncate(s int64) error { - return f.f.Truncate(s) -} - -func (f *RegexpFile) WriteString(s string) (int, error) { - return f.f.WriteString(s) -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/unionFile.go b/cluster-autoscaler/vendor/github.com/spf13/afero/unionFile.go deleted file mode 100644 index eda96312df6b..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/unionFile.go +++ /dev/null @@ -1,320 +0,0 @@ -package afero - -import ( - "io" - "os" - "path/filepath" - "syscall" -) - -// The UnionFile implements the afero.File interface and will be returned -// when reading a directory present at least in the overlay or opening a file -// for writing. -// -// The calls to -// Readdir() and Readdirnames() merge the file os.FileInfo / names from the -// base and the overlay - for files present in both layers, only those -// from the overlay will be used. -// -// When opening files for writing (Create() / OpenFile() with the right flags) -// the operations will be done in both layers, starting with the overlay. A -// successful read in the overlay will move the cursor position in the base layer -// by the number of bytes read. -type UnionFile struct { - Base File - Layer File - Merger DirsMerger - off int - files []os.FileInfo -} - -func (f *UnionFile) Close() error { - // first close base, so we have a newer timestamp in the overlay. If we'd close - // the overlay first, we'd get a cacheStale the next time we access this file - // -> cache would be useless ;-) - if f.Base != nil { - f.Base.Close() - } - if f.Layer != nil { - return f.Layer.Close() - } - return BADFD -} - -func (f *UnionFile) Read(s []byte) (int, error) { - if f.Layer != nil { - n, err := f.Layer.Read(s) - if (err == nil || err == io.EOF) && f.Base != nil { - // advance the file position also in the base file, the next - // call may be a write at this position (or a seek with SEEK_CUR) - if _, seekErr := f.Base.Seek(int64(n), os.SEEK_CUR); seekErr != nil { - // only overwrite err in case the seek fails: we need to - // report an eventual io.EOF to the caller - err = seekErr - } - } - return n, err - } - if f.Base != nil { - return f.Base.Read(s) - } - return 0, BADFD -} - -func (f *UnionFile) ReadAt(s []byte, o int64) (int, error) { - if f.Layer != nil { - n, err := f.Layer.ReadAt(s, o) - if (err == nil || err == io.EOF) && f.Base != nil { - _, err = f.Base.Seek(o+int64(n), os.SEEK_SET) - } - return n, err - } - if f.Base != nil { - return f.Base.ReadAt(s, o) - } - return 0, BADFD -} - -func (f *UnionFile) Seek(o int64, w int) (pos int64, err error) { - if f.Layer != nil { - pos, err = f.Layer.Seek(o, w) - if (err == nil || err == io.EOF) && f.Base != nil { - _, err = f.Base.Seek(o, w) - } - return pos, err - } - if f.Base != nil { - return f.Base.Seek(o, w) - } - return 0, BADFD -} - -func (f *UnionFile) Write(s []byte) (n int, err error) { - if f.Layer != nil { - n, err = f.Layer.Write(s) - if err == nil && f.Base != nil { // hmm, do we have fixed size files where a write may hit the EOF mark? - _, err = f.Base.Write(s) - } - return n, err - } - if f.Base != nil { - return f.Base.Write(s) - } - return 0, BADFD -} - -func (f *UnionFile) WriteAt(s []byte, o int64) (n int, err error) { - if f.Layer != nil { - n, err = f.Layer.WriteAt(s, o) - if err == nil && f.Base != nil { - _, err = f.Base.WriteAt(s, o) - } - return n, err - } - if f.Base != nil { - return f.Base.WriteAt(s, o) - } - return 0, BADFD -} - -func (f *UnionFile) Name() string { - if f.Layer != nil { - return f.Layer.Name() - } - return f.Base.Name() -} - -// DirsMerger is how UnionFile weaves two directories together. -// It takes the FileInfo slices from the layer and the base and returns a -// single view. -type DirsMerger func(lofi, bofi []os.FileInfo) ([]os.FileInfo, error) - -var defaultUnionMergeDirsFn = func(lofi, bofi []os.FileInfo) ([]os.FileInfo, error) { - var files = make(map[string]os.FileInfo) - - for _, fi := range lofi { - files[fi.Name()] = fi - } - - for _, fi := range bofi { - if _, exists := files[fi.Name()]; !exists { - files[fi.Name()] = fi - } - } - - rfi := make([]os.FileInfo, len(files)) - - i := 0 - for _, fi := range files { - rfi[i] = fi - i++ - } - - return rfi, nil - -} - -// Readdir will weave the two directories together and -// return a single view of the overlayed directories. -// At the end of the directory view, the error is io.EOF if c > 0. -func (f *UnionFile) Readdir(c int) (ofi []os.FileInfo, err error) { - var merge DirsMerger = f.Merger - if merge == nil { - merge = defaultUnionMergeDirsFn - } - - if f.off == 0 { - var lfi []os.FileInfo - if f.Layer != nil { - lfi, err = f.Layer.Readdir(-1) - if err != nil { - return nil, err - } - } - - var bfi []os.FileInfo - if f.Base != nil { - bfi, err = f.Base.Readdir(-1) - if err != nil { - return nil, err - } - - } - merged, err := merge(lfi, bfi) - if err != nil { - return nil, err - } - f.files = append(f.files, merged...) - } - - if c <= 0 && len(f.files) == 0 { - return f.files, nil - } - - if f.off >= len(f.files) { - return nil, io.EOF - } - - if c <= 0 { - return f.files[f.off:], nil - } - - if c > len(f.files) { - c = len(f.files) - } - - defer func() { f.off += c }() - return f.files[f.off:c], nil -} - -func (f *UnionFile) Readdirnames(c int) ([]string, error) { - rfi, err := f.Readdir(c) - if err != nil { - return nil, err - } - var names []string - for _, fi := range rfi { - names = append(names, fi.Name()) - } - return names, nil -} - -func (f *UnionFile) Stat() (os.FileInfo, error) { - if f.Layer != nil { - return f.Layer.Stat() - } - if f.Base != nil { - return f.Base.Stat() - } - return nil, BADFD -} - -func (f *UnionFile) Sync() (err error) { - if f.Layer != nil { - err = f.Layer.Sync() - if err == nil && f.Base != nil { - err = f.Base.Sync() - } - return err - } - if f.Base != nil { - return f.Base.Sync() - } - return BADFD -} - -func (f *UnionFile) Truncate(s int64) (err error) { - if f.Layer != nil { - err = f.Layer.Truncate(s) - if err == nil && f.Base != nil { - err = f.Base.Truncate(s) - } - return err - } - if f.Base != nil { - return f.Base.Truncate(s) - } - return BADFD -} - -func (f *UnionFile) WriteString(s string) (n int, err error) { - if f.Layer != nil { - n, err = f.Layer.WriteString(s) - if err == nil && f.Base != nil { - _, err = f.Base.WriteString(s) - } - return n, err - } - if f.Base != nil { - return f.Base.WriteString(s) - } - return 0, BADFD -} - -func copyToLayer(base Fs, layer Fs, name string) error { - bfh, err := base.Open(name) - if err != nil { - return err - } - defer bfh.Close() - - // First make sure the directory exists - exists, err := Exists(layer, filepath.Dir(name)) - if err != nil { - return err - } - if !exists { - err = layer.MkdirAll(filepath.Dir(name), 0777) // FIXME? - if err != nil { - return err - } - } - - // Create the file on the overlay - lfh, err := layer.Create(name) - if err != nil { - return err - } - n, err := io.Copy(lfh, bfh) - if err != nil { - // If anything fails, clean up the file - layer.Remove(name) - lfh.Close() - return err - } - - bfi, err := bfh.Stat() - if err != nil || bfi.Size() != n { - layer.Remove(name) - lfh.Close() - return syscall.EIO - } - - err = lfh.Close() - if err != nil { - layer.Remove(name) - lfh.Close() - return err - } - return layer.Chtimes(name, bfi.ModTime(), bfi.ModTime()) -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/util.go b/cluster-autoscaler/vendor/github.com/spf13/afero/util.go deleted file mode 100644 index 4f253f481edd..000000000000 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/util.go +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright ©2015 Steve Francia -// Portions Copyright ©2015 The Hugo Authors -// Portions Copyright 2016-present Bjørn Erik Pedersen -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package afero - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "strings" - "unicode" - - "golang.org/x/text/transform" - "golang.org/x/text/unicode/norm" -) - -// Filepath separator defined by os.Separator. -const FilePathSeparator = string(filepath.Separator) - -// Takes a reader and a path and writes the content -func (a Afero) WriteReader(path string, r io.Reader) (err error) { - return WriteReader(a.Fs, path, r) -} - -func WriteReader(fs Fs, path string, r io.Reader) (err error) { - dir, _ := filepath.Split(path) - ospath := filepath.FromSlash(dir) - - if ospath != "" { - err = fs.MkdirAll(ospath, 0777) // rwx, rw, r - if err != nil { - if err != os.ErrExist { - return err - } - } - } - - file, err := fs.Create(path) - if err != nil { - return - } - defer file.Close() - - _, err = io.Copy(file, r) - return -} - -// Same as WriteReader but checks to see if file/directory already exists. -func (a Afero) SafeWriteReader(path string, r io.Reader) (err error) { - return SafeWriteReader(a.Fs, path, r) -} - -func SafeWriteReader(fs Fs, path string, r io.Reader) (err error) { - dir, _ := filepath.Split(path) - ospath := filepath.FromSlash(dir) - - if ospath != "" { - err = fs.MkdirAll(ospath, 0777) // rwx, rw, r - if err != nil { - return - } - } - - exists, err := Exists(fs, path) - if err != nil { - return - } - if exists { - return fmt.Errorf("%v already exists", path) - } - - file, err := fs.Create(path) - if err != nil { - return - } - defer file.Close() - - _, err = io.Copy(file, r) - return -} - -func (a Afero) GetTempDir(subPath string) string { - return GetTempDir(a.Fs, subPath) -} - -// GetTempDir returns the default temp directory with trailing slash -// if subPath is not empty then it will be created recursively with mode 777 rwx rwx rwx -func GetTempDir(fs Fs, subPath string) string { - addSlash := func(p string) string { - if FilePathSeparator != p[len(p)-1:] { - p = p + FilePathSeparator - } - return p - } - dir := addSlash(os.TempDir()) - - if subPath != "" { - // preserve windows backslash :-( - if FilePathSeparator == "\\" { - subPath = strings.Replace(subPath, "\\", "____", -1) - } - dir = dir + UnicodeSanitize((subPath)) - if FilePathSeparator == "\\" { - dir = strings.Replace(dir, "____", "\\", -1) - } - - if exists, _ := Exists(fs, dir); exists { - return addSlash(dir) - } - - err := fs.MkdirAll(dir, 0777) - if err != nil { - panic(err) - } - dir = addSlash(dir) - } - return dir -} - -// Rewrite string to remove non-standard path characters -func UnicodeSanitize(s string) string { - source := []rune(s) - target := make([]rune, 0, len(source)) - - for _, r := range source { - if unicode.IsLetter(r) || - unicode.IsDigit(r) || - unicode.IsMark(r) || - r == '.' || - r == '/' || - r == '\\' || - r == '_' || - r == '-' || - r == '%' || - r == ' ' || - r == '#' { - target = append(target, r) - } - } - - return string(target) -} - -// Transform characters with accents into plain forms. -func NeuterAccents(s string) string { - t := transform.Chain(norm.NFD, transform.RemoveFunc(isMn), norm.NFC) - result, _, _ := transform.String(t, string(s)) - - return result -} - -func isMn(r rune) bool { - return unicode.Is(unicode.Mn, r) // Mn: nonspacing marks -} - -func (a Afero) FileContainsBytes(filename string, subslice []byte) (bool, error) { - return FileContainsBytes(a.Fs, filename, subslice) -} - -// Check if a file contains a specified byte slice. -func FileContainsBytes(fs Fs, filename string, subslice []byte) (bool, error) { - f, err := fs.Open(filename) - if err != nil { - return false, err - } - defer f.Close() - - return readerContainsAny(f, subslice), nil -} - -func (a Afero) FileContainsAnyBytes(filename string, subslices [][]byte) (bool, error) { - return FileContainsAnyBytes(a.Fs, filename, subslices) -} - -// Check if a file contains any of the specified byte slices. -func FileContainsAnyBytes(fs Fs, filename string, subslices [][]byte) (bool, error) { - f, err := fs.Open(filename) - if err != nil { - return false, err - } - defer f.Close() - - return readerContainsAny(f, subslices...), nil -} - -// readerContains reports whether any of the subslices is within r. -func readerContainsAny(r io.Reader, subslices ...[]byte) bool { - - if r == nil || len(subslices) == 0 { - return false - } - - largestSlice := 0 - - for _, sl := range subslices { - if len(sl) > largestSlice { - largestSlice = len(sl) - } - } - - if largestSlice == 0 { - return false - } - - bufflen := largestSlice * 4 - halflen := bufflen / 2 - buff := make([]byte, bufflen) - var err error - var n, i int - - for { - i++ - if i == 1 { - n, err = io.ReadAtLeast(r, buff[:halflen], halflen) - } else { - if i != 2 { - // shift left to catch overlapping matches - copy(buff[:], buff[halflen:]) - } - n, err = io.ReadAtLeast(r, buff[halflen:], halflen) - } - - if n > 0 { - for _, sl := range subslices { - if bytes.Contains(buff, sl) { - return true - } - } - } - - if err != nil { - break - } - } - return false -} - -func (a Afero) DirExists(path string) (bool, error) { - return DirExists(a.Fs, path) -} - -// DirExists checks if a path exists and is a directory. -func DirExists(fs Fs, path string) (bool, error) { - fi, err := fs.Stat(path) - if err == nil && fi.IsDir() { - return true, nil - } - if os.IsNotExist(err) { - return false, nil - } - return false, err -} - -func (a Afero) IsDir(path string) (bool, error) { - return IsDir(a.Fs, path) -} - -// IsDir checks if a given path is a directory. -func IsDir(fs Fs, path string) (bool, error) { - fi, err := fs.Stat(path) - if err != nil { - return false, err - } - return fi.IsDir(), nil -} - -func (a Afero) IsEmpty(path string) (bool, error) { - return IsEmpty(a.Fs, path) -} - -// IsEmpty checks if a given file or directory is empty. -func IsEmpty(fs Fs, path string) (bool, error) { - if b, _ := Exists(fs, path); !b { - return false, fmt.Errorf("%q path does not exist", path) - } - fi, err := fs.Stat(path) - if err != nil { - return false, err - } - if fi.IsDir() { - f, err := fs.Open(path) - if err != nil { - return false, err - } - defer f.Close() - list, err := f.Readdir(-1) - return len(list) == 0, nil - } - return fi.Size() == 0, nil -} - -func (a Afero) Exists(path string) (bool, error) { - return Exists(a.Fs, path) -} - -// Check if a file or directory exists. -func Exists(fs Fs, path string) (bool, error) { - _, err := fs.Stat(path) - if err == nil { - return true, nil - } - if os.IsNotExist(err) { - return false, nil - } - return false, err -} - -func FullBaseFsPath(basePathFs *BasePathFs, relativePath string) string { - combinedPath := filepath.Join(basePathFs.path, relativePath) - if parent, ok := basePathFs.source.(*BasePathFs); ok { - return FullBaseFsPath(parent, combinedPath) - } - - return combinedPath -} diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/.golangci.yml b/cluster-autoscaler/vendor/github.com/spf13/cobra/.golangci.yml new file mode 100644 index 000000000000..0d6e61793a77 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/.golangci.yml @@ -0,0 +1,48 @@ +run: + deadline: 5m + +linters: + disable-all: true + enable: + #- bodyclose + - deadcode + #- depguard + #- dogsled + #- dupl + - errcheck + #- exhaustive + #- funlen + - gas + #- gochecknoinits + - goconst + #- gocritic + #- gocyclo + #- gofmt + - goimports + - golint + #- gomnd + #- goprintffuncname + #- gosec + #- gosimple + - govet + - ineffassign + - interfacer + #- lll + - maligned + - megacheck + #- misspell + #- nakedret + #- noctx + #- nolintlint + #- rowserrcheck + #- scopelint + #- staticcheck + - structcheck + #- stylecheck + #- typecheck + - unconvert + #- unparam + #- unused + - varcheck + #- whitespace + fast: false diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/.travis.yml b/cluster-autoscaler/vendor/github.com/spf13/cobra/.travis.yml index a9bd4e54785c..e0a3b50043bb 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/.travis.yml +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/.travis.yml @@ -1,7 +1,6 @@ language: go stages: - - diff - test - build @@ -10,20 +9,20 @@ go: - 1.13.x - tip +env: GO111MODULE=on + before_install: - go get -u github.com/kyoh86/richgo - go get -u github.com/mitchellh/gox + - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest matrix: allow_failures: - go: tip include: - - stage: diff - go: 1.13.x - script: make fmt - stage: build go: 1.13.x script: make cobra_generator -script: +script: - make test diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/spf13/cobra/CHANGELOG.md index 742d6d6e24ae..8a23b4f8513a 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/CHANGELOG.md +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/CHANGELOG.md @@ -1,11 +1,40 @@ # Cobra Changelog -## Pending -* Fix man page doc generation - no auto generated tag when `cmd.DisableAutoGenTag = true` @jpmcb +## v1.1.3 + +* **Fix:** release-branch.cobra1.1 only: Revert "Deprecate Go < 1.14" to maintain backward compatibility + +## v1.1.2 + +### Notable Changes + +* Bump license year to 2021 in golden files (#1309) @Bowbaq +* Enhance PowerShell completion with custom comp (#1208) @Luap99 +* Update gopkg.in/yaml.v2 to v2.4.0: The previous breaking change in yaml.v2 v2.3.0 has been reverted, see go-yaml/yaml#670 +* Documentation readability improvements (#1228 etc.) @zaataylor etc. +* Use golangci-lint: Repair warnings and errors resulting from linting (#1044) @umarcor + +## v1.1.1 + +* **Fix:** yaml.v2 2.3.0 contained a unintended breaking change. This release reverts to yaml.v2 v2.2.8 which has recent critical CVE fixes, but does not have the breaking changes. See https://github.com/spf13/cobra/pull/1259 for context. +* **Fix:** correct internal formatting for go-md2man v2 (which caused man page generation to be broken). See https://github.com/spf13/cobra/issues/1049 for context. + +## v1.1.0 + +### Notable Changes + +* Extend Go completions and revamp zsh comp (#1070) +* Fix man page doc generation - no auto generated tag when `cmd.DisableAutoGenTag = true` (#1104) @jpmcb +* Add completion for help command (#1136) +* Complete subcommands when TraverseChildren is set (#1171) +* Fix stderr printing functions (#894) +* fix: fish output redirection (#1247) ## v1.0.0 + Announcing v1.0.0 of Cobra. 🎉 -**Notable Changes** + +### Notable Changes * Fish completion (including support for Go custom completion) @marckhouzam * API (urgent): Rename BashCompDirectives to ShellCompDirectives @marckhouzam * Remove/replace SetOutput on Command - deprecated @jpmcb diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/CONDUCT.md b/cluster-autoscaler/vendor/github.com/spf13/cobra/CONDUCT.md new file mode 100644 index 000000000000..9d16f88fd129 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/CONDUCT.md @@ -0,0 +1,37 @@ +## Cobra User Contract + +### Versioning +Cobra will follow a steady release cadence. Non breaking changes will be released as minor versions quarterly. Patch bug releases are at the discretion of the maintainers. Users can expect security patch fixes to be released within relatively short order of a CVE becoming known. For more information on security patch fixes see the CVE section below. Releases will follow [Semantic Versioning](https://semver.org/). Users tracking the Master branch should expect unpredictable breaking changes as the project continues to move forward. For stability, it is highly recommended to use a release. + +### Backward Compatibility +We will maintain two major releases in a moving window. The N-1 release will only receive bug fixes and security updates and will be dropped once N+1 is released. + +### Deprecation +Deprecation of Go versions or dependent packages will only occur in major releases. To reduce the change of this taking users by surprise, any large deprecation will be preceded by an announcement in the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) and an Issue on Github. + +### CVE +Maintainers will make every effort to release security patches in the case of a medium to high severity CVE directly impacting the library. The speed in which these patches reach a release is up to the discretion of the maintainers. A low severity CVE may be a lower priority than a high severity one. + +### Communication +Cobra maintainers will use GitHub issues and the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) as the primary means of communication with the community. This is to foster open communication with all users and contributors. + +### Breaking Changes +Breaking changes are generally allowed in the master branch, as this is the branch used to develop the next release of Cobra. + +There may be times, however, when master is closed for breaking changes. This is likely to happen as we near the release of a new version. + +Breaking changes are not allowed in release branches, as these represent minor versions that have already been released. These version have consumers who expect the APIs, behaviors, etc, to remain stable during the lifetime of the patch stream for the minor release. + +Examples of breaking changes include: +- Removing or renaming exported constant, variable, type, or function. +- Updating the version of critical libraries such as `spf13/pflag`, `spf13/viper` etc... + - Some version updates may be acceptable for picking up bug fixes, but maintainers must exercise caution when reviewing. + +There may, at times, need to be exceptions where breaking changes are allowed in release branches. These are at the discretion of the project's maintainers, and must be carefully considered before merging. + +### CI Testing +Maintainers will ensure the Cobra test suite utilizes the current supported versions of Golang. + +### Disclaimer +Changes to this document and the contents therein are at the discretion of the maintainers. +None of the contents of this document are legally binding in any way to the maintainers or the users. diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/Makefile b/cluster-autoscaler/vendor/github.com/spf13/cobra/Makefile index e9740d1e1752..472c73bf16f0 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/Makefile +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/Makefile @@ -1,21 +1,29 @@ BIN="./bin" SRC=$(shell find . -name "*.go") +ifeq (, $(shell which golangci-lint)) +$(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh") +endif + ifeq (, $(shell which richgo)) $(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo") endif -.PHONY: fmt vet test cobra_generator install_deps clean +.PHONY: fmt lint test cobra_generator install_deps clean default: all -all: fmt vet test cobra_generator +all: fmt test cobra_generator fmt: $(info ******************** checking formatting ********************) @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1) -test: install_deps vet +lint: + $(info ******************** running lint tools ********************) + golangci-lint run -v + +test: install_deps lint $(info ******************** running tests ********************) richgo test -v ./... @@ -28,9 +36,5 @@ install_deps: $(info ******************** downloading dependencies ********************) go get -v ./... -vet: - $(info ******************** vetting ********************) - go vet ./... - clean: rm -rf $(BIN) diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/README.md b/cluster-autoscaler/vendor/github.com/spf13/cobra/README.md index 3cf1b25d8e7f..a1b13ddda6ca 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/README.md +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/README.md @@ -6,6 +6,7 @@ Cobra is used in many Go projects such as [Kubernetes](http://kubernetes.io/), [Hugo](https://gohugo.io), and [Github CLI](https://github.com/cli/cli) to name a few. [This list](./projects_using_cobra.md) contains a more extensive list of projects using Cobra. +[![](https://img.shields.io/github/workflow/status/spf13/cobra/Test?longCache=tru&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest) [![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) [![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra) [![Go Report Card](https://goreportcard.com/badge/github.com/spf13/cobra)](https://goreportcard.com/report/github.com/spf13/cobra) @@ -62,8 +63,8 @@ Cobra is built on a structure of commands, arguments & flags. **Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions. -The best applications will read like sentences when used. Users will know how -to use the application because they will natively understand how to use it. +The best applications read like sentences when used, and as a result, users +intuitively know how to interact with them. The pattern to follow is `APPNAME VERB NOUN --ADJECTIVE.` @@ -234,11 +235,6 @@ func init() { rootCmd.AddCommand(initCmd) } -func er(msg interface{}) { - fmt.Println("Error:", msg) - os.Exit(1) -} - func initConfig() { if cfgFile != "" { // Use config file from the flag. @@ -246,9 +242,7 @@ func initConfig() { } else { // Find home directory. home, err := homedir.Dir() - if err != nil { - er(err) - } + cobra.CheckErr(err) // Search config in home directory with name ".cobra" (without extension). viper.AddConfigPath(home) @@ -268,7 +262,7 @@ func initConfig() { With the root command you need to have your main function execute it. Execute should be run on the root for clarity, though it can be called on any command. -In a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra. +In a Cobra app, typically the main.go file is very bare. It serves one purpose: to initialize Cobra. ```go package main @@ -363,7 +357,7 @@ There are two different approaches to assign a flag. ### Persistent Flags -A flag can be 'persistent' meaning that this flag will be available to the +A flag can be 'persistent', meaning that this flag will be available to the command it's assigned to as well as every command under that command. For global flags, assign a flag as a persistent flag on the root. @@ -373,7 +367,7 @@ rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose out ### Local Flags -A flag can also be assigned locally which will only apply to that specific command. +A flag can also be assigned locally, which will only apply to that specific command. ```go localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") @@ -381,8 +375,8 @@ localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to rea ### Local Flag on Parent Commands -By default Cobra only parses local flags on the target command, any local flags on -parent commands are ignored. By enabling `Command.TraverseChildren` Cobra will +By default, Cobra only parses local flags on the target command, and any local flags on +parent commands are ignored. By enabling `Command.TraverseChildren`, Cobra will parse local flags on each command before executing the target command. ```go @@ -404,8 +398,8 @@ func init() { } ``` -In this example the persistent flag `author` is bound with `viper`. -**Note**, that the variable `author` will not be set to the value from config, +In this example, the persistent flag `author` is bound with `viper`. +**Note**: the variable `author` will not be set to the value from config, when the `--author` flag is not provided by user. More in [viper documentation](https://github.com/spf13/viper#working-with-flags). @@ -465,7 +459,7 @@ var cmd = &cobra.Command{ In the example below, we have defined three commands. Two are at the top level and one (cmdTimes) is a child of one of the top commands. In this case the root -is not executable meaning that a subcommand is required. This is accomplished +is not executable, meaning that a subcommand is required. This is accomplished by not providing a 'Run' for the 'rootCmd'. We have only defined one flag for a single command. @@ -759,7 +753,7 @@ Cobra can generate documentation based on subcommands, flags, etc. Read more abo ## Generating shell completions -Cobra can generate a shell-completion file for the following shells: Bash, Zsh, Fish, Powershell. If you add more information to your commands, these completions can be amazingly powerful and flexible. Read more about it in [Shell Completions](shell_completions.md). +Cobra can generate a shell-completion file for the following shells: bash, zsh, fish, PowerShell. If you add more information to your commands, these completions can be amazingly powerful and flexible. Read more about it in [Shell Completions](shell_completions.md). # License diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/bash_completions.go b/cluster-autoscaler/vendor/github.com/spf13/cobra/bash_completions.go index 846636d75b13..7106147937e8 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/bash_completions.go +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/bash_completions.go @@ -19,9 +19,9 @@ const ( BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir" ) -func writePreamble(buf *bytes.Buffer, name string) { - buf.WriteString(fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) - buf.WriteString(fmt.Sprintf(` +func writePreamble(buf io.StringWriter, name string) { + WriteStringAndCheck(buf, fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(` __%[1]s_debug() { if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then @@ -380,10 +380,10 @@ __%[1]s_handle_word() ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) } -func writePostscript(buf *bytes.Buffer, name string) { +func writePostscript(buf io.StringWriter, name string) { name = strings.Replace(name, ":", "__", -1) - buf.WriteString(fmt.Sprintf("__start_%s()\n", name)) - buf.WriteString(fmt.Sprintf(`{ + WriteStringAndCheck(buf, fmt.Sprintf("__start_%s()\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(`{ local cur prev words cword declare -A flaghash 2>/dev/null || : declare -A aliashash 2>/dev/null || : @@ -410,33 +410,33 @@ func writePostscript(buf *bytes.Buffer, name string) { } `, name)) - buf.WriteString(fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then + WriteStringAndCheck(buf, fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then complete -o default -F __start_%s %s else complete -o default -o nospace -F __start_%s %s fi `, name, name, name, name)) - buf.WriteString("# ex: ts=4 sw=4 et filetype=sh\n") + WriteStringAndCheck(buf, "# ex: ts=4 sw=4 et filetype=sh\n") } -func writeCommands(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" commands=()\n") +func writeCommands(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " commands=()\n") for _, c := range cmd.Commands() { if !c.IsAvailableCommand() && c != cmd.helpCommand { continue } - buf.WriteString(fmt.Sprintf(" commands+=(%q)\n", c.Name())) + WriteStringAndCheck(buf, fmt.Sprintf(" commands+=(%q)\n", c.Name())) writeCmdAliases(buf, c) } - buf.WriteString("\n") + WriteStringAndCheck(buf, "\n") } -func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]string, cmd *Command) { +func writeFlagHandler(buf io.StringWriter, name string, annotations map[string][]string, cmd *Command) { for key, value := range annotations { switch key { case BashCompFilenameExt: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) > 0 { @@ -444,17 +444,18 @@ func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]s } else { ext = "_filedir" } - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) case BashCompCustom: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + if len(value) > 0 { handlers := strings.Join(value, "; ") - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) } else { - buf.WriteString(" flags_completion+=(:)\n") + WriteStringAndCheck(buf, " flags_completion+=(:)\n") } case BashCompSubdirsInDir: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) == 1 { @@ -462,46 +463,48 @@ func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]s } else { ext = "_filedir -d" } - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) } } } -func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { +const cbn = "\")\n" + +func writeShortFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { name := flag.Shorthand format := " " if len(flag.NoOptDefVal) == 0 { format += "two_word_" } - format += "flags+=(\"-%s\")\n" - buf.WriteString(fmt.Sprintf(format, name)) + format += "flags+=(\"-%s" + cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) writeFlagHandler(buf, "-"+name, flag.Annotations, cmd) } -func writeFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { +func writeFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { name := flag.Name format := " flags+=(\"--%s" if len(flag.NoOptDefVal) == 0 { format += "=" } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, name)) + format += cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) if len(flag.NoOptDefVal) == 0 { - format = " two_word_flags+=(\"--%s\")\n" - buf.WriteString(fmt.Sprintf(format, name)) + format = " two_word_flags+=(\"--%s" + cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) } writeFlagHandler(buf, "--"+name, flag.Annotations, cmd) } -func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) { +func writeLocalNonPersistentFlag(buf io.StringWriter, flag *pflag.Flag) { name := flag.Name - format := " local_nonpersistent_flags+=(\"--%[1]s\")\n" + format := " local_nonpersistent_flags+=(\"--%[1]s" + cbn if len(flag.NoOptDefVal) == 0 { - format += " local_nonpersistent_flags+=(\"--%[1]s=\")\n" + format += " local_nonpersistent_flags+=(\"--%[1]s=" + cbn } - buf.WriteString(fmt.Sprintf(format, name)) + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) if len(flag.Shorthand) > 0 { - buf.WriteString(fmt.Sprintf(" local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand)) + WriteStringAndCheck(buf, fmt.Sprintf(" local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand)) } } @@ -519,9 +522,9 @@ func prepareCustomAnnotationsForFlags(cmd *Command) { } } -func writeFlags(buf *bytes.Buffer, cmd *Command) { +func writeFlags(buf io.StringWriter, cmd *Command) { prepareCustomAnnotationsForFlags(cmd) - buf.WriteString(` flags=() + WriteStringAndCheck(buf, ` flags=() two_word_flags=() local_nonpersistent_flags=() flags_with_completion=() @@ -553,11 +556,11 @@ func writeFlags(buf *bytes.Buffer, cmd *Command) { } }) - buf.WriteString("\n") + WriteStringAndCheck(buf, "\n") } -func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" must_have_one_flag=()\n") +func writeRequiredFlag(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " must_have_one_flag=()\n") flags := cmd.NonInheritedFlags() flags.VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { @@ -570,55 +573,55 @@ func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) { if flag.Value.Type() != "bool" { format += "=" } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, flag.Name)) + format += cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, flag.Name)) if len(flag.Shorthand) > 0 { - buf.WriteString(fmt.Sprintf(" must_have_one_flag+=(\"-%s\")\n", flag.Shorthand)) + WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_flag+=(\"-%s"+cbn, flag.Shorthand)) } } } }) } -func writeRequiredNouns(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" must_have_one_noun=()\n") - sort.Sort(sort.StringSlice(cmd.ValidArgs)) +func writeRequiredNouns(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " must_have_one_noun=()\n") + sort.Strings(cmd.ValidArgs) for _, value := range cmd.ValidArgs { // Remove any description that may be included following a tab character. // Descriptions are not supported by bash completion. value = strings.Split(value, "\t")[0] - buf.WriteString(fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) + WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) } if cmd.ValidArgsFunction != nil { - buf.WriteString(" has_completion_function=1\n") + WriteStringAndCheck(buf, " has_completion_function=1\n") } } -func writeCmdAliases(buf *bytes.Buffer, cmd *Command) { +func writeCmdAliases(buf io.StringWriter, cmd *Command) { if len(cmd.Aliases) == 0 { return } - sort.Sort(sort.StringSlice(cmd.Aliases)) + sort.Strings(cmd.Aliases) - buf.WriteString(fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n")) + WriteStringAndCheck(buf, fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n")) for _, value := range cmd.Aliases { - buf.WriteString(fmt.Sprintf(" command_aliases+=(%q)\n", value)) - buf.WriteString(fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) + WriteStringAndCheck(buf, fmt.Sprintf(" command_aliases+=(%q)\n", value)) + WriteStringAndCheck(buf, fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) } - buf.WriteString(` fi`) - buf.WriteString("\n") + WriteStringAndCheck(buf, ` fi`) + WriteStringAndCheck(buf, "\n") } -func writeArgAliases(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" noun_aliases=()\n") - sort.Sort(sort.StringSlice(cmd.ArgAliases)) +func writeArgAliases(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " noun_aliases=()\n") + sort.Strings(cmd.ArgAliases) for _, value := range cmd.ArgAliases { - buf.WriteString(fmt.Sprintf(" noun_aliases+=(%q)\n", value)) + WriteStringAndCheck(buf, fmt.Sprintf(" noun_aliases+=(%q)\n", value)) } } -func gen(buf *bytes.Buffer, cmd *Command) { +func gen(buf io.StringWriter, cmd *Command) { for _, c := range cmd.Commands() { if !c.IsAvailableCommand() && c != cmd.helpCommand { continue @@ -630,22 +633,22 @@ func gen(buf *bytes.Buffer, cmd *Command) { commandName = strings.Replace(commandName, ":", "__", -1) if cmd.Root() == cmd { - buf.WriteString(fmt.Sprintf("_%s_root_command()\n{\n", commandName)) + WriteStringAndCheck(buf, fmt.Sprintf("_%s_root_command()\n{\n", commandName)) } else { - buf.WriteString(fmt.Sprintf("_%s()\n{\n", commandName)) + WriteStringAndCheck(buf, fmt.Sprintf("_%s()\n{\n", commandName)) } - buf.WriteString(fmt.Sprintf(" last_command=%q\n", commandName)) - buf.WriteString("\n") - buf.WriteString(" command_aliases=()\n") - buf.WriteString("\n") + WriteStringAndCheck(buf, fmt.Sprintf(" last_command=%q\n", commandName)) + WriteStringAndCheck(buf, "\n") + WriteStringAndCheck(buf, " command_aliases=()\n") + WriteStringAndCheck(buf, "\n") writeCommands(buf, cmd) writeFlags(buf, cmd) writeRequiredFlag(buf, cmd) writeRequiredNouns(buf, cmd) writeArgAliases(buf, cmd) - buf.WriteString("}\n\n") + WriteStringAndCheck(buf, "}\n\n") } // GenBashCompletion generates bash completion file and writes to the passed writer. diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/bash_completions.md b/cluster-autoscaler/vendor/github.com/spf13/cobra/bash_completions.md index a82d5bb8b423..130f99b92308 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/bash_completions.md +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/bash_completions.md @@ -4,7 +4,7 @@ Please refer to [Shell Completions](shell_completions.md) for details. ## Bash legacy dynamic completions -For backwards-compatibility, Cobra still supports its legacy dynamic completion solution (described below). Unlike the `ValidArgsFunction` solution, the legacy solution will only work for Bash shell-completion and not for other shells. This legacy solution can be used along-side `ValidArgsFunction` and `RegisterFlagCompletionFunc()`, as long as both solutions are not used for the same command. This provides a path to gradually migrate from the legacy solution to the new solution. +For backward compatibility, Cobra still supports its legacy dynamic completion solution (described below). Unlike the `ValidArgsFunction` solution, the legacy solution will only work for Bash shell-completion and not for other shells. This legacy solution can be used along-side `ValidArgsFunction` and `RegisterFlagCompletionFunc()`, as long as both solutions are not used for the same command. This provides a path to gradually migrate from the legacy solution to the new solution. The legacy solution allows you to inject bash functions into the bash completion script. Those bash functions are responsible for providing the completion choices for your own completions. diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/cobra.go b/cluster-autoscaler/vendor/github.com/spf13/cobra/cobra.go index d01becc8fa6c..d6cbfd719858 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/cobra.go +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/cobra.go @@ -19,6 +19,7 @@ package cobra import ( "fmt" "io" + "os" "reflect" "strconv" "strings" @@ -205,3 +206,17 @@ func stringInSlice(a string, list []string) bool { } return false } + +// CheckErr prints the msg with the prefix 'Error:' and exits with error code 1. If the msg is nil, it does nothing. +func CheckErr(msg interface{}) { + if msg != nil { + fmt.Fprintln(os.Stderr, "Error:", msg) + os.Exit(1) + } +} + +// WriteStringAndCheck writes a string into a buffer, and checks if the error is not nil. +func WriteStringAndCheck(b io.StringWriter, s string) { + _, err := b.WriteString(s) + CheckErr(err) +} diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/command.go b/cluster-autoscaler/vendor/github.com/spf13/cobra/command.go index 77b399e02ee2..d6732ad11540 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/command.go +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/command.go @@ -84,9 +84,6 @@ type Command struct { // Deprecated defines, if this command is deprecated and should print this string when used. Deprecated string - // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. - Hidden bool - // Annotations are key/value pairs that can be used by applications to identify or // group commands. Annotations map[string]string @@ -126,55 +123,6 @@ type Command struct { // PersistentPostRunE: PersistentPostRun but returns an error. PersistentPostRunE func(cmd *Command, args []string) error - // SilenceErrors is an option to quiet errors down stream. - SilenceErrors bool - - // SilenceUsage is an option to silence usage when an error occurs. - SilenceUsage bool - - // DisableFlagParsing disables the flag parsing. - // If this is true all flags will be passed to the command as arguments. - DisableFlagParsing bool - - // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") - // will be printed by generating docs for this command. - DisableAutoGenTag bool - - // DisableFlagsInUseLine will disable the addition of [flags] to the usage - // line of a command when printing help or generating docs - DisableFlagsInUseLine bool - - // DisableSuggestions disables the suggestions based on Levenshtein distance - // that go along with 'unknown command' messages. - DisableSuggestions bool - // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. - // Must be > 0. - SuggestionsMinimumDistance int - - // TraverseChildren parses flags on all parents before executing child command. - TraverseChildren bool - - // FParseErrWhitelist flag parse errors to be ignored - FParseErrWhitelist FParseErrWhitelist - - ctx context.Context - - // commands is the list of commands supported by this program. - commands []*Command - // parent is a parent command for this command. - parent *Command - // Max lengths of commands' string lengths for use in padding. - commandsMaxUseLen int - commandsMaxCommandPathLen int - commandsMaxNameLen int - // commandsAreSorted defines, if command slice are sorted or not. - commandsAreSorted bool - // commandCalledAs is the name or alias value used to call this command. - commandCalledAs struct { - name string - called bool - } - // args is actual args parsed from flags. args []string // flagErrorBuf contains all error messages from pflag. @@ -216,6 +164,60 @@ type Command struct { outWriter io.Writer // errWriter is a writer defined by the user that replaces stderr errWriter io.Writer + + //FParseErrWhitelist flag parse errors to be ignored + FParseErrWhitelist FParseErrWhitelist + + // commandsAreSorted defines, if command slice are sorted or not. + commandsAreSorted bool + // commandCalledAs is the name or alias value used to call this command. + commandCalledAs struct { + name string + called bool + } + + ctx context.Context + + // commands is the list of commands supported by this program. + commands []*Command + // parent is a parent command for this command. + parent *Command + // Max lengths of commands' string lengths for use in padding. + commandsMaxUseLen int + commandsMaxCommandPathLen int + commandsMaxNameLen int + + // TraverseChildren parses flags on all parents before executing child command. + TraverseChildren bool + + // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. + Hidden bool + + // SilenceErrors is an option to quiet errors down stream. + SilenceErrors bool + + // SilenceUsage is an option to silence usage when an error occurs. + SilenceUsage bool + + // DisableFlagParsing disables the flag parsing. + // If this is true all flags will be passed to the command as arguments. + DisableFlagParsing bool + + // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") + // will be printed by generating docs for this command. + DisableAutoGenTag bool + + // DisableFlagsInUseLine will disable the addition of [flags] to the usage + // line of a command when printing help or generating docs + DisableFlagsInUseLine bool + + // DisableSuggestions disables the suggestions based on Levenshtein distance + // that go along with 'unknown command' messages. + DisableSuggestions bool + + // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. + // Must be > 0. + SuggestionsMinimumDistance int } // Context returns underlying command context. If command wasn't @@ -418,7 +420,7 @@ func (c *Command) UsageString() string { c.outWriter = bb c.errWriter = bb - c.Usage() + CheckErr(c.Usage()) // Setting things back to normal c.outWriter = tmpOutput @@ -964,13 +966,13 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { return cmd, nil } - // If root command has SilentErrors flagged, + // If root command has SilenceErrors flagged, // all subcommands should respect it if !cmd.SilenceErrors && !c.SilenceErrors { c.PrintErrln("Error:", err.Error()) } - // If root command has SilentUsage flagged, + // If root command has SilenceUsage flagged, // all subcommands should respect it if !cmd.SilenceUsage && !c.SilenceUsage { c.Println(cmd.UsageString()) @@ -1087,10 +1089,10 @@ Simply type ` + c.Name() + ` help [path to command] for full details.`, cmd, _, e := c.Root().Find(args) if cmd == nil || e != nil { c.Printf("Unknown help topic %#q\n", args) - c.Root().Usage() + CheckErr(c.Root().Usage()) } else { cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown - cmd.Help() + CheckErr(cmd.Help()) } }, } diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/custom_completions.go b/cluster-autoscaler/vendor/github.com/spf13/cobra/custom_completions.go index f9e88e081fc0..fa060c147bef 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/custom_completions.go +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/custom_completions.go @@ -527,13 +527,13 @@ func CompDebug(msg string, printToStdErr bool) { os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err == nil { defer f.Close() - f.WriteString(msg) + WriteStringAndCheck(f, msg) } } if printToStdErr { // Must print to stderr for this not to be read by the completion script. - fmt.Fprintf(os.Stderr, msg) + fmt.Fprint(os.Stderr, msg) } } diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/fish_completions.go b/cluster-autoscaler/vendor/github.com/spf13/cobra/fish_completions.go index eaae9bca8668..3e112347d7b9 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/fish_completions.go +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/fish_completions.go @@ -8,7 +8,7 @@ import ( "strings" ) -func genFishComp(buf *bytes.Buffer, name string, includeDesc bool) { +func genFishComp(buf io.StringWriter, name string, includeDesc bool) { // Variables should not contain a '-' or ':' character nameForVar := name nameForVar = strings.Replace(nameForVar, "-", "_", -1) @@ -18,8 +18,8 @@ func genFishComp(buf *bytes.Buffer, name string, includeDesc bool) { if !includeDesc { compCmd = ShellCompNoDescRequestCmd } - buf.WriteString(fmt.Sprintf("# fish completion for %-36s -*- shell-script -*-\n", name)) - buf.WriteString(fmt.Sprintf(` + WriteStringAndCheck(buf, fmt.Sprintf("# fish completion for %-36s -*- shell-script -*-\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(` function __%[1]s_debug set file "$BASH_COMP_DEBUG_FILE" if test -n "$file" diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/go.mod b/cluster-autoscaler/vendor/github.com/spf13/cobra/go.mod index 57e3244d5e32..ff56144056a0 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/go.mod +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/go.mod @@ -8,5 +8,5 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.7.0 - gopkg.in/yaml.v2 v2.2.8 + gopkg.in/yaml.v2 v2.4.0 ) diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/go.sum b/cluster-autoscaler/vendor/github.com/spf13/cobra/go.sum index 0aae738631c1..9328ee3ee7c6 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/go.sum +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/go.sum @@ -304,8 +304,8 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/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= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/powershell_completions.go b/cluster-autoscaler/vendor/github.com/spf13/cobra/powershell_completions.go index 756c61b9dcb3..c55be71cd14c 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/powershell_completions.go +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/powershell_completions.go @@ -1,6 +1,3 @@ -// PowerShell completions are based on the amazing work from clap: -// https://github.com/clap-rs/clap/blob/3294d18efe5f264d12c9035f404c7d189d4824e1/src/completions/powershell.rs -// // The generated scripts require PowerShell v5.0+ (which comes Windows 10, but // can be downloaded separately for windows 7 or 8.1). @@ -11,90 +8,278 @@ import ( "fmt" "io" "os" - "strings" - - "github.com/spf13/pflag" ) -var powerShellCompletionTemplate = `using namespace System.Management.Automation -using namespace System.Management.Automation.Language -Register-ArgumentCompleter -Native -CommandName '%s' -ScriptBlock { - param($wordToComplete, $commandAst, $cursorPosition) - $commandElements = $commandAst.CommandElements - $command = @( - '%s' - for ($i = 1; $i -lt $commandElements.Count; $i++) { - $element = $commandElements[$i] - if ($element -isnot [StringConstantExpressionAst] -or - $element.StringConstantType -ne [StringConstantType]::BareWord -or - $element.Value.StartsWith('-')) { - break - } - $element.Value - } - ) -join ';' - $completions = @(switch ($command) {%s - }) - $completions.Where{ $_.CompletionText -like "$wordToComplete*" } | - Sort-Object -Property ListItemText -}` - -func generatePowerShellSubcommandCases(out io.Writer, cmd *Command, previousCommandName string) { - var cmdName string - if previousCommandName == "" { - cmdName = cmd.Name() - } else { - cmdName = fmt.Sprintf("%s;%s", previousCommandName, cmd.Name()) - } - - fmt.Fprintf(out, "\n '%s' {", cmdName) - - cmd.Flags().VisitAll(func(flag *pflag.Flag) { - if nonCompletableFlag(flag) { - return - } - usage := escapeStringForPowerShell(flag.Usage) - if len(flag.Shorthand) > 0 { - fmt.Fprintf(out, "\n [CompletionResult]::new('-%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Shorthand, flag.Shorthand, usage) - } - fmt.Fprintf(out, "\n [CompletionResult]::new('--%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Name, flag.Name, usage) - }) - - for _, subCmd := range cmd.Commands() { - usage := escapeStringForPowerShell(subCmd.Short) - fmt.Fprintf(out, "\n [CompletionResult]::new('%s', '%s', [CompletionResultType]::ParameterValue, '%s')", subCmd.Name(), subCmd.Name(), usage) +func genPowerShellComp(buf io.StringWriter, name string, includeDesc bool) { + compCmd := ShellCompRequestCmd + if !includeDesc { + compCmd = ShellCompNoDescRequestCmd } + WriteStringAndCheck(buf, fmt.Sprintf(`# powershell completion for %-36[1]s -*- shell-script -*- - fmt.Fprint(out, "\n break\n }") - - for _, subCmd := range cmd.Commands() { - generatePowerShellSubcommandCases(out, subCmd, cmdName) - } +function __%[1]s_debug { + if ($env:BASH_COMP_DEBUG_FILE) { + "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE" + } } -func escapeStringForPowerShell(s string) string { - return strings.Replace(s, "'", "''", -1) +filter __%[1]s_escapeStringWithSpecialChars { +`+" $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|\"|`|\\||<|>|&','`$&'"+` } -// GenPowerShellCompletion generates PowerShell completion file and writes to the passed writer. -func (c *Command) GenPowerShellCompletion(w io.Writer) error { - buf := new(bytes.Buffer) +Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock { + param( + $WordToComplete, + $CommandAst, + $CursorPosition + ) + + # Get the current command line and convert into a string + $Command = $CommandAst.CommandElements + $Command = "$Command" + + __%[1]s_debug "" + __%[1]s_debug "========= starting completion logic ==========" + __%[1]s_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CursorPosition location, so we need + # to truncate the command-line ($Command) up to the $CursorPosition location. + # Make sure the $Command is longer then the $CursorPosition before we truncate. + # This happens because the $Command does not include the last space. + if ($Command.Length -gt $CursorPosition) { + $Command=$Command.Substring(0,$CursorPosition) + } + __%[1]s_debug "Truncated command: $Command" + + $ShellCompDirectiveError=%[3]d + $ShellCompDirectiveNoSpace=%[4]d + $ShellCompDirectiveNoFileComp=%[5]d + $ShellCompDirectiveFilterFileExt=%[6]d + $ShellCompDirectiveFilterDirs=%[7]d + + # Prepare the command to request completions for the program. + # Split the command at the first space to separate the program and arguments. + $Program,$Arguments = $Command.Split(" ",2) + $RequestComp="$Program %[2]s $Arguments" + __%[1]s_debug "RequestComp: $RequestComp" + + # we cannot use $WordToComplete because it + # has the wrong values if the cursor was moved + # so use the last argument + if ($WordToComplete -ne "" ) { + $WordToComplete = $Arguments.Split(" ")[-1] + } + __%[1]s_debug "New WordToComplete: $WordToComplete" + + + # Check for flag with equal sign + $IsEqualFlag = ($WordToComplete -Like "--*=*" ) + if ( $IsEqualFlag ) { + __%[1]s_debug "Completing equal sign flag" + # Remove the flag part + $Flag,$WordToComplete = $WordToComplete.Split("=",2) + } + + if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) { + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go method. + __%[1]s_debug "Adding extra empty parameter" +`+" # We need to use `\"`\" to pass an empty argument a \"\" or '' does not work!!!"+` +`+" $RequestComp=\"$RequestComp\" + ' `\"`\"' "+` + } + + __%[1]s_debug "Calling $RequestComp" + #call the command store the output in $out and redirect stderr and stdout to null + # $Out is an array contains each line per element + Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null + + + # get directive from last line + [int]$Directive = $Out[-1].TrimStart(':') + if ($Directive -eq "") { + # There is no directive specified + $Directive = 0 + } + __%[1]s_debug "The completion directive is: $Directive" + + # remove directive (last element) from out + $Out = $Out | Where-Object { $_ -ne $Out[-1] } + __%[1]s_debug "The completions are: $Out" + + if (($Directive -band $ShellCompDirectiveError) -ne 0 ) { + # Error code. No completion. + __%[1]s_debug "Received error from custom completion go code" + return + } + + $Longest = 0 + $Values = $Out | ForEach-Object { + #Split the output in name and description +`+" $Name, $Description = $_.Split(\"`t\",2)"+` + __%[1]s_debug "Name: $Name Description: $Description" + + # Look for the longest completion so that we can format things nicely + if ($Longest -lt $Name.Length) { + $Longest = $Name.Length + } + + # Set the description to a one space string if there is none set. + # This is needed because the CompletionResult does not accept an empty string as argument + if (-Not $Description) { + $Description = " " + } + @{Name="$Name";Description="$Description"} + } + + + $Space = " " + if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) { + # remove the space here + __%[1]s_debug "ShellCompDirectiveNoSpace is called" + $Space = "" + } + + if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) { + __%[1]s_debug "ShellCompDirectiveNoFileComp is called" + + if ($Values.Length -eq 0) { + # Just print an empty string here so the + # shell does not start to complete paths. + # We cannot use CompletionResult here because + # it does not accept an empty string as argument. + "" + return + } + } + + if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or + (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) { + __%[1]s_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported" + + # return here to prevent the completion of the extensions + return + } - var subCommandCases bytes.Buffer - generatePowerShellSubcommandCases(&subCommandCases, c, "") - fmt.Fprintf(buf, powerShellCompletionTemplate, c.Name(), c.Name(), subCommandCases.String()) + $Values = $Values | Where-Object { + # filter the result + $_.Name -like "$WordToComplete*" + # Join the flag back if we have a equal sign flag + if ( $IsEqualFlag ) { + __%[1]s_debug "Join the equal sign flag back to the completion value" + $_.Name = $Flag + "=" + $_.Name + } + } + + # Get the current mode + $Mode = (Get-PSReadLineKeyHandler | Where-Object {$_.Key -eq "Tab" }).Function + __%[1]s_debug "Mode: $Mode" + + $Values | ForEach-Object { + + # store temporay because switch will overwrite $_ + $comp = $_ + + # PowerShell supports three different completion modes + # - TabCompleteNext (default windows style - on each key press the next option is displayed) + # - Complete (works like bash) + # - MenuComplete (works like zsh) + # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function + + # CompletionResult Arguments: + # 1) CompletionText text to be used as the auto completion result + # 2) ListItemText text to be displayed in the suggestion list + # 3) ResultType type of completion result + # 4) ToolTip text for the tooltip with details about the object + + switch ($Mode) { + + # bash like + "Complete" { + + if ($Values.Length -eq 1) { + __%[1]s_debug "Only one completion left" + + # insert space after value + [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + + } else { + # Add the proper number of spaces to align the descriptions + while($comp.Name.Length -lt $Longest) { + $comp.Name = $comp.Name + " " + } + + # Check for empty description and only add parentheses if needed + if ($($comp.Description) -eq " " ) { + $Description = "" + } else { + $Description = " ($($comp.Description))" + } + + [System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)") + } + } + + # zsh like + "MenuComplete" { + # insert space after value + # MenuComplete will automatically show the ToolTip of + # the highlighted value at the bottom of the suggestions. + [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } + + # TabCompleteNext and in case we get something unknown + Default { + # Like MenuComplete but we don't want to add a space here because + # the user need to press space anyway to get the completion. + # Description will not be shown because thats not possible with TabCompleteNext + [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } + } + + } +} +`, name, compCmd, + ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, + ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) +} + +func (c *Command) genPowerShellCompletion(w io.Writer, includeDesc bool) error { + buf := new(bytes.Buffer) + genPowerShellComp(buf, c.Name(), includeDesc) _, err := buf.WriteTo(w) return err } -// GenPowerShellCompletionFile generates PowerShell completion file. -func (c *Command) GenPowerShellCompletionFile(filename string) error { +func (c *Command) genPowerShellCompletionFile(filename string, includeDesc bool) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() - return c.GenPowerShellCompletion(outFile) + return c.genPowerShellCompletion(outFile, includeDesc) +} + +// GenPowerShellCompletionFile generates powershell completion file without descriptions. +func (c *Command) GenPowerShellCompletionFile(filename string) error { + return c.genPowerShellCompletionFile(filename, false) +} + +// GenPowerShellCompletion generates powershell completion file without descriptions +// and writes it to the passed writer. +func (c *Command) GenPowerShellCompletion(w io.Writer) error { + return c.genPowerShellCompletion(w, false) +} + +// GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. +func (c *Command) GenPowerShellCompletionFileWithDesc(filename string) error { + return c.genPowerShellCompletionFile(filename, true) +} + +// GenPowerShellCompletionWithDesc generates powershell completion file with descriptions +// and writes it to the passed writer. +func (c *Command) GenPowerShellCompletionWithDesc(w io.Writer) error { + return c.genPowerShellCompletion(w, true) } diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/powershell_completions.md b/cluster-autoscaler/vendor/github.com/spf13/cobra/powershell_completions.md index 55f154a68fcc..c449f1e5c0f5 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/powershell_completions.md +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/powershell_completions.md @@ -1,16 +1,3 @@ # Generating PowerShell Completions For Your Own cobra.Command -Cobra can generate PowerShell completion scripts. Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. - -*Note*: PowerShell completions have not (yet?) been aligned to Cobra's generic shell completion support. This implies the PowerShell completions are not as rich as for other shells (see [What's not yet supported](#whats-not-yet-supported)), and may behave slightly differently. They are still very useful for PowerShell users. - -# What's supported - -- Completion for subcommands using their `.Short` description -- Completion for non-hidden flags using their `.Name` and `.Shorthand` - -# What's not yet supported - -- Command aliases -- Required, filename or custom flags (they will work like normal flags) -- Custom completion scripts +Please refer to [Shell Completions](shell_completions.md#powershell-completions) for details. diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/projects_using_cobra.md b/cluster-autoscaler/vendor/github.com/spf13/cobra/projects_using_cobra.md index 31c272036a92..d98a71e36f96 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/projects_using_cobra.md +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/projects_using_cobra.md @@ -25,6 +25,8 @@ - [Moby (former Docker)](https://github.com/moby/moby) - [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) - [OpenShift](https://www.openshift.com/) +- [Ory Hydra](https://github.com/ory/hydra) +- [Ory Kratos](https://github.com/ory/kratos) - [Pouch](https://github.com/alibaba/pouch) - [ProjectAtomic (enterprise)](http://www.projectatomic.io/) - [Prototool](https://github.com/uber/prototool) @@ -32,4 +34,5 @@ - [Rclone](https://rclone.org/) - [Skaffold](https://skaffold.dev/) - [Tendermint](https://github.com/tendermint/tendermint) +- [Twitch CLI](https://github.com/twitchdev/twitch-cli) - [Werf](https://werf.io/) diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/shell_completions.md b/cluster-autoscaler/vendor/github.com/spf13/cobra/shell_completions.md index d8416ab1dc95..cd533ac3d448 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/shell_completions.md +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/shell_completions.md @@ -4,10 +4,10 @@ Cobra can generate shell completions for multiple shells. The currently supported shells are: - Bash - Zsh -- Fish +- fish - PowerShell -If you are using the generator you can create a completion command by running +If you are using the generator, you can create a completion command by running ```bash cobra add completion @@ -17,38 +17,46 @@ and then modifying the generated `cmd/completion.go` file to look something like ```go var completionCmd = &cobra.Command{ - Use: "completion [bash|zsh|fish|powershell]", - Short: "Generate completion script", + Use: "completion [bash|zsh|fish|powershell]", + Short: "Generate completion script", Long: `To load completions: Bash: -$ source <(yourprogram completion bash) + $ source <(yourprogram completion bash) -# To load completions for each session, execute once: -Linux: + # To load completions for each session, execute once: + # Linux: $ yourprogram completion bash > /etc/bash_completion.d/yourprogram -MacOS: + # macOS: $ yourprogram completion bash > /usr/local/etc/bash_completion.d/yourprogram Zsh: -# If shell completion is not already enabled in your environment you will need -# to enable it. You can execute the following once: + # If shell completion is not already enabled in your environment, + # you will need to enable it. You can execute the following once: -$ echo "autoload -U compinit; compinit" >> ~/.zshrc + $ echo "autoload -U compinit; compinit" >> ~/.zshrc -# To load completions for each session, execute once: -$ yourprogram completion zsh > "${fpath[1]}/_yourprogram" + # To load completions for each session, execute once: + $ yourprogram completion zsh > "${fpath[1]}/_yourprogram" -# You will need to start a new shell for this setup to take effect. + # You will need to start a new shell for this setup to take effect. -Fish: +fish: -$ yourprogram completion fish | source + $ yourprogram completion fish | source -# To load completions for each session, execute once: -$ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish + # To load completions for each session, execute once: + $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish + +PowerShell: + + PS> yourprogram completion powershell | Out-String | Invoke-Expression + + # To load completions for every new session, run: + PS> yourprogram completion powershell > yourprogram.ps1 + # and source this file from your PowerShell profile. `, DisableFlagsInUseLine: true, ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, @@ -68,7 +76,7 @@ $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish } ``` -**Note:** The cobra generator may include messages printed to stdout for example if the config file is loaded, this will break the auto complete script so must be removed. +**Note:** The cobra generator may include messages printed to stdout, for example, if the config file is loaded; this will break the auto-completion script so must be removed. # Customizing completions @@ -91,8 +99,7 @@ cmd := &cobra.Command{ Long: get_long, Example: get_example, Run: func(cmd *cobra.Command, args []string) { - err := RunGet(f, out, cmd, args) - util.CheckErr(err) + cobra.CheckErr(RunGet(f, out, cmd, args)) }, ValidArgs: validArgs, } @@ -124,7 +131,7 @@ the completion algorithm if entered manually, e.g. in: ```bash $ kubectl get rc [tab][tab] -backend frontend database +backend frontend database ``` Note that without declaring `rc` as an alias, the completion algorithm would not know to show the list of @@ -246,7 +253,7 @@ and you'll get something like ```bash $ kubectl exec [tab][tab] --c --container= -p --pod= +-c --container= -p --pod= ``` ### Specify dynamic flag completion @@ -316,7 +323,7 @@ cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, ``` ### Descriptions for completions -Both `zsh` and `fish` allow for descriptions to annotate completion choices. For commands and flags, Cobra will provide the descriptions automatically, based on usage information. For example, using zsh: +`zsh`, `fish` and `powershell` allow for descriptions to annotate completion choices. For commands and flags, Cobra will provide the descriptions automatically, based on usage information. For example, using zsh: ``` $ helm s[tab] search -- search for a keyword in charts @@ -361,12 +368,12 @@ completion firstcommand secondcommand ``` ### Bash legacy dynamic completions -For backwards-compatibility, Cobra still supports its bash legacy dynamic completion solution. +For backward compatibility, Cobra still supports its bash legacy dynamic completion solution. Please refer to [Bash Completions](bash_completions.md) for details. ## Zsh completions -Cobra supports native Zsh completion generated from the root `cobra.Command`. +Cobra supports native zsh completion generated from the root `cobra.Command`. The generated completion script should be put somewhere in your `$fpath` and be named `_`. You will need to start a new shell for the completions to become available. @@ -385,23 +392,23 @@ status -- displays the status of the named release $ helm s[tab] search show status ``` -*Note*: Because of backwards-compatibility requirements, we were forced to have a different API to disable completion descriptions between `Zsh` and `Fish`. +*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`. ### Limitations * Custom completions implemented in Bash scripting (legacy) are not supported and will be ignored for `zsh` (including the use of the `BashCompCustom` flag annotation). - * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`). + * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). * The function `MarkFlagCustom()` is not supported and will be ignored for `zsh`. * You should instead use `RegisterFlagCompletionFunc()`. ### Zsh completions standardization -Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backwards-compatible, some small changes in behavior were introduced. +Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backward-compatible, some small changes in behavior were introduced. Please refer to [Zsh Completions](zsh_completions.md) for details. -## Fish completions +## fish completions -Cobra supports native Fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. +Cobra supports native fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. ``` # With descriptions $ helm s[tab] @@ -411,12 +418,12 @@ search (search for a keyword in charts) show (show information of a chart) s $ helm s[tab] search show status ``` -*Note*: Because of backwards-compatibility requirements, we were forced to have a different API to disable completion descriptions between `Zsh` and `Fish`. +*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`. ### Limitations -* Custom completions implemented in Bash scripting (legacy) are not supported and will be ignored for `fish` (including the use of the `BashCompCustom` flag annotation). - * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`). +* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `fish` (including the use of the `BashCompCustom` flag annotation). + * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). * The function `MarkFlagCustom()` is not supported and will be ignored for `fish`. * You should instead use `RegisterFlagCompletionFunc()`. * The following flag completion annotations are not supported and will be ignored for `fish`: @@ -431,4 +438,46 @@ search show status ## PowerShell completions -Please refer to [PowerShell Completions](powershell_completions.md) for details. +Cobra supports native PowerShell completions generated from the root `cobra.Command`. You can use the `command.GenPowerShellCompletion()` or `command.GenPowerShellCompletionFile()` functions. To include descriptions use `command.GenPowerShellCompletionWithDesc()` and `command.GenPowerShellCompletionFileWithDesc()`. Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. + +The script is designed to support all three PowerShell completion modes: + +* TabCompleteNext (default windows style - on each key press the next option is displayed) +* Complete (works like bash) +* MenuComplete (works like zsh) + +You set the mode with `Set-PSReadLineKeyHandler -Key Tab -Function `. Descriptions are only displayed when using the `Complete` or `MenuComplete` mode. + +Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. + +``` +# With descriptions and Mode 'Complete' +$ helm s[tab] +search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release) + +# With descriptions and Mode 'MenuComplete' The description of the current selected value will be displayed below the suggestions. +$ helm s[tab] +search show status + +search for a keyword in charts + +# Without descriptions +$ helm s[tab] +search show status +``` + +### Limitations + +* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `powershell` (including the use of the `BashCompCustom` flag annotation). + * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). +* The function `MarkFlagCustom()` is not supported and will be ignored for `powershell`. + * You should instead use `RegisterFlagCompletionFunc()`. +* The following flag completion annotations are not supported and will be ignored for `powershell`: + * `BashCompFilenameExt` (filtering by file extension) + * `BashCompSubdirsInDir` (filtering by directory) +* The functions corresponding to the above annotations are consequently not supported and will be ignored for `powershell`: + * `MarkFlagFilename()` and `MarkPersistentFlagFilename()` (filtering by file extension) + * `MarkFlagDirname()` and `MarkPersistentFlagDirname()` (filtering by directory) +* Similarly, the following completion directives are not supported and will be ignored for `powershell`: + * `ShellCompDirectiveFilterFileExt` (filtering by file extension) + * `ShellCompDirectiveFilterDirs` (filtering by directory) diff --git a/cluster-autoscaler/vendor/github.com/spf13/cobra/zsh_completions.go b/cluster-autoscaler/vendor/github.com/spf13/cobra/zsh_completions.go index 92a70394a9d1..2e840285f389 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/cobra/zsh_completions.go +++ b/cluster-autoscaler/vendor/github.com/spf13/cobra/zsh_completions.go @@ -70,12 +70,12 @@ func (c *Command) genZshCompletion(w io.Writer, includeDesc bool) error { return err } -func genZshComp(buf *bytes.Buffer, name string, includeDesc bool) { +func genZshComp(buf io.StringWriter, name string, includeDesc bool) { compCmd := ShellCompRequestCmd if !includeDesc { compCmd = ShellCompNoDescRequestCmd } - buf.WriteString(fmt.Sprintf(`#compdef _%[1]s %[1]s + WriteStringAndCheck(buf, fmt.Sprintf(`#compdef _%[1]s %[1]s # zsh completion for %-36[1]s -*- shell-script -*- diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/NOTICE b/cluster-autoscaler/vendor/go.etcd.io/etcd/NOTICE deleted file mode 100644 index b39ddfa5cbde..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -CoreOS Project -Copyright 2014 CoreOS, Inc - -This product includes software developed at CoreOS, Inc. -(http://www.coreos.com/). diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/LICENSE b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/LICENSE similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/LICENSE rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/LICENSE diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/auth/authpb/auth.pb.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/authpb/auth.pb.go similarity index 63% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/auth/authpb/auth.pb.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/authpb/auth.pb.go index 7e038df0146c..16affcd62cf0 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/auth/authpb/auth.pb.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/authpb/auth.pb.go @@ -1,30 +1,16 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: auth.proto -/* - Package authpb is a generated protocol buffer package. - - It is generated from these files: - auth.proto - - It has these top-level messages: - UserAddOptions - User - Permission - Role -*/ package authpb import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - + fmt "fmt" + io "io" math "math" + math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" - - io "io" + proto "github.com/golang/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. @@ -36,7 +22,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Permission_Type int32 @@ -51,6 +37,7 @@ var Permission_Type_name = map[int32]string{ 1: "WRITE", 2: "READWRITE", } + var Permission_Type_value = map[string]int32{ "READ": 0, "WRITE": 1, @@ -60,64 +47,220 @@ var Permission_Type_value = map[string]int32{ func (x Permission_Type) String() string { return proto.EnumName(Permission_Type_name, int32(x)) } -func (Permission_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorAuth, []int{2, 0} } + +func (Permission_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_8bbd6f3875b0e874, []int{2, 0} +} type UserAddOptions struct { - NoPassword bool `protobuf:"varint,1,opt,name=no_password,json=noPassword,proto3" json:"no_password,omitempty"` + NoPassword bool `protobuf:"varint,1,opt,name=no_password,json=noPassword,proto3" json:"no_password,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserAddOptions) Reset() { *m = UserAddOptions{} } +func (m *UserAddOptions) String() string { return proto.CompactTextString(m) } +func (*UserAddOptions) ProtoMessage() {} +func (*UserAddOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_8bbd6f3875b0e874, []int{0} +} +func (m *UserAddOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UserAddOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UserAddOptions.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UserAddOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserAddOptions.Merge(m, src) +} +func (m *UserAddOptions) XXX_Size() int { + return m.Size() +} +func (m *UserAddOptions) XXX_DiscardUnknown() { + xxx_messageInfo_UserAddOptions.DiscardUnknown(m) } -func (m *UserAddOptions) Reset() { *m = UserAddOptions{} } -func (m *UserAddOptions) String() string { return proto.CompactTextString(m) } -func (*UserAddOptions) ProtoMessage() {} -func (*UserAddOptions) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{0} } +var xxx_messageInfo_UserAddOptions proto.InternalMessageInfo // User is a single entry in the bucket authUsers type User struct { - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - Roles []string `protobuf:"bytes,3,rep,name=roles" json:"roles,omitempty"` - Options *UserAddOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"` + Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + Roles []string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"` + Options *UserAddOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *User) Reset() { *m = User{} } +func (m *User) String() string { return proto.CompactTextString(m) } +func (*User) ProtoMessage() {} +func (*User) Descriptor() ([]byte, []int) { + return fileDescriptor_8bbd6f3875b0e874, []int{1} +} +func (m *User) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_User.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *User) XXX_Merge(src proto.Message) { + xxx_messageInfo_User.Merge(m, src) +} +func (m *User) XXX_Size() int { + return m.Size() +} +func (m *User) XXX_DiscardUnknown() { + xxx_messageInfo_User.DiscardUnknown(m) } -func (m *User) Reset() { *m = User{} } -func (m *User) String() string { return proto.CompactTextString(m) } -func (*User) ProtoMessage() {} -func (*User) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{1} } +var xxx_messageInfo_User proto.InternalMessageInfo // Permission is a single entity type Permission struct { - PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` + PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Permission) Reset() { *m = Permission{} } +func (m *Permission) String() string { return proto.CompactTextString(m) } +func (*Permission) ProtoMessage() {} +func (*Permission) Descriptor() ([]byte, []int) { + return fileDescriptor_8bbd6f3875b0e874, []int{2} +} +func (m *Permission) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Permission.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Permission) XXX_Merge(src proto.Message) { + xxx_messageInfo_Permission.Merge(m, src) +} +func (m *Permission) XXX_Size() int { + return m.Size() +} +func (m *Permission) XXX_DiscardUnknown() { + xxx_messageInfo_Permission.DiscardUnknown(m) } -func (m *Permission) Reset() { *m = Permission{} } -func (m *Permission) String() string { return proto.CompactTextString(m) } -func (*Permission) ProtoMessage() {} -func (*Permission) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{2} } +var xxx_messageInfo_Permission proto.InternalMessageInfo // Role is a single entry in the bucket authRoles type Role struct { - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - KeyPermission []*Permission `protobuf:"bytes,2,rep,name=keyPermission" json:"keyPermission,omitempty"` + Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + KeyPermission []*Permission `protobuf:"bytes,2,rep,name=keyPermission,proto3" json:"keyPermission,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Role) Reset() { *m = Role{} } +func (m *Role) String() string { return proto.CompactTextString(m) } +func (*Role) ProtoMessage() {} +func (*Role) Descriptor() ([]byte, []int) { + return fileDescriptor_8bbd6f3875b0e874, []int{3} +} +func (m *Role) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Role.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Role) XXX_Merge(src proto.Message) { + xxx_messageInfo_Role.Merge(m, src) +} +func (m *Role) XXX_Size() int { + return m.Size() +} +func (m *Role) XXX_DiscardUnknown() { + xxx_messageInfo_Role.DiscardUnknown(m) } -func (m *Role) Reset() { *m = Role{} } -func (m *Role) String() string { return proto.CompactTextString(m) } -func (*Role) ProtoMessage() {} -func (*Role) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{3} } +var xxx_messageInfo_Role proto.InternalMessageInfo func init() { + proto.RegisterEnum("authpb.Permission_Type", Permission_Type_name, Permission_Type_value) proto.RegisterType((*UserAddOptions)(nil), "authpb.UserAddOptions") proto.RegisterType((*User)(nil), "authpb.User") proto.RegisterType((*Permission)(nil), "authpb.Permission") proto.RegisterType((*Role)(nil), "authpb.Role") - proto.RegisterEnum("authpb.Permission_Type", Permission_Type_name, Permission_Type_value) } + +func init() { proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874) } + +var fileDescriptor_8bbd6f3875b0e874 = []byte{ + // 338 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4e, 0xea, 0x40, + 0x14, 0xc6, 0x3b, 0xb4, 0x70, 0xdb, 0xc3, 0x85, 0x90, 0x13, 0x72, 0x6f, 0x83, 0x49, 0x6d, 0xba, + 0x6a, 0x5c, 0x54, 0x85, 0x8d, 0x5b, 0x8c, 0x2c, 0x5c, 0x49, 0x26, 0x18, 0x97, 0xa4, 0xa4, 0x13, + 0x24, 0xc0, 0x4c, 0x33, 0x83, 0x31, 0x6c, 0x7c, 0x0e, 0x17, 0x3e, 0x10, 0x4b, 0x1e, 0x41, 0xf0, + 0x45, 0x4c, 0x67, 0xf8, 0x13, 0xa2, 0xbb, 0xef, 0x7c, 0xe7, 0xfb, 0x66, 0x7e, 0x99, 0x01, 0x48, + 0x5f, 0x16, 0xcf, 0x49, 0x2e, 0xc5, 0x42, 0x60, 0xa5, 0xd0, 0xf9, 0xa8, 0xd5, 0x1c, 0x8b, 0xb1, + 0xd0, 0xd6, 0x65, 0xa1, 0xcc, 0x36, 0xba, 0x86, 0xfa, 0xa3, 0x62, 0xb2, 0x9b, 0x65, 0x0f, 0xf9, + 0x62, 0x22, 0xb8, 0xc2, 0x73, 0xa8, 0x72, 0x31, 0xcc, 0x53, 0xa5, 0x5e, 0x85, 0xcc, 0x7c, 0x12, + 0x92, 0xd8, 0xa5, 0xc0, 0x45, 0x7f, 0xe7, 0x44, 0x6f, 0xe0, 0x14, 0x15, 0x44, 0x70, 0x78, 0x3a, + 0x67, 0x3a, 0xf1, 0x97, 0x6a, 0x8d, 0x2d, 0x70, 0x0f, 0xcd, 0x92, 0xf6, 0x0f, 0x33, 0x36, 0xa1, + 0x2c, 0xc5, 0x8c, 0x29, 0xdf, 0x0e, 0xed, 0xd8, 0xa3, 0x66, 0xc0, 0x2b, 0xf8, 0x23, 0xcc, 0xcd, + 0xbe, 0x13, 0x92, 0xb8, 0xda, 0xfe, 0x97, 0x18, 0xe0, 0xe4, 0x94, 0x8b, 0xee, 0x63, 0xd1, 0x07, + 0x01, 0xe8, 0x33, 0x39, 0x9f, 0x28, 0x35, 0x11, 0x1c, 0x3b, 0xe0, 0xe6, 0x4c, 0xce, 0x07, 0xcb, + 0xdc, 0xa0, 0xd4, 0xdb, 0xff, 0xf7, 0x27, 0x1c, 0x53, 0x49, 0xb1, 0xa6, 0x87, 0x20, 0x36, 0xc0, + 0x9e, 0xb2, 0xe5, 0x0e, 0xb1, 0x90, 0x78, 0x06, 0x9e, 0x4c, 0xf9, 0x98, 0x0d, 0x19, 0xcf, 0x7c, + 0xdb, 0xa0, 0x6b, 0xa3, 0xc7, 0xb3, 0xe8, 0x02, 0x1c, 0x5d, 0x73, 0xc1, 0xa1, 0xbd, 0xee, 0x5d, + 0xc3, 0x42, 0x0f, 0xca, 0x4f, 0xf4, 0x7e, 0xd0, 0x6b, 0x10, 0xac, 0x81, 0x57, 0x98, 0x66, 0x2c, + 0x45, 0x03, 0x70, 0xa8, 0x98, 0xb1, 0x5f, 0x9f, 0xe7, 0x06, 0x6a, 0x53, 0xb6, 0x3c, 0x62, 0xf9, + 0xa5, 0xd0, 0x8e, 0xab, 0x6d, 0xfc, 0x09, 0x4c, 0x4f, 0x83, 0xb7, 0xfe, 0x6a, 0x13, 0x58, 0xeb, + 0x4d, 0x60, 0xad, 0xb6, 0x01, 0x59, 0x6f, 0x03, 0xf2, 0xb9, 0x0d, 0xc8, 0xfb, 0x57, 0x60, 0x8d, + 0x2a, 0xfa, 0x23, 0x3b, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0x66, 0xc6, 0x9d, 0xf4, 0x01, + 0x00, 0x00, +} + func (m *UserAddOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -125,27 +268,36 @@ func (m *UserAddOptions) Marshal() (dAtA []byte, err error) { } func (m *UserAddOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserAddOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.NoPassword { - dAtA[i] = 0x8 - i++ + i-- if m.NoPassword { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *User) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -153,54 +305,61 @@ func (m *User) Marshal() (dAtA []byte, err error) { } func (m *User) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) + if m.Options != nil { + { + size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuth(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if len(m.Roles) > 0 { - for _, s := range m.Roles { + for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Roles[iNdEx]) + copy(dAtA[i:], m.Roles[iNdEx]) + i = encodeVarintAuth(dAtA, i, uint64(len(m.Roles[iNdEx]))) + i-- dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.Options != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintAuth(dAtA, i, uint64(m.Options.Size())) - n1, err := m.Options.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + if len(m.Password) > 0 { + i -= len(m.Password) + copy(dAtA[i:], m.Password) + i = encodeVarintAuth(dAtA, i, uint64(len(m.Password))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Permission) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -208,34 +367,45 @@ func (m *Permission) Marshal() (dAtA []byte, err error) { } func (m *Permission) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.PermType != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintAuth(dAtA, i, uint64(m.PermType)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.RangeEnd) > 0 { + i -= len(m.RangeEnd) + copy(dAtA[i:], m.RangeEnd) + i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd))) + i-- + dAtA[i] = 0x1a } if len(m.Key) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Key) + copy(dAtA[i:], m.Key) i = encodeVarintAuth(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + i-- + dAtA[i] = 0x12 } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) + if m.PermType != 0 { + i = encodeVarintAuth(dAtA, i, uint64(m.PermType)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *Role) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -243,50 +413,73 @@ func (m *Role) Marshal() (dAtA []byte, err error) { } func (m *Role) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Role) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.KeyPermission) > 0 { - for _, msg := range m.KeyPermission { - dAtA[i] = 0x12 - i++ - i = encodeVarintAuth(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.KeyPermission) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.KeyPermission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuth(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { + offset -= sovAuth(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *UserAddOptions) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.NoPassword { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *User) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -307,10 +500,16 @@ func (m *User) Size() (n int) { l = m.Options.Size() n += 1 + l + sovAuth(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Permission) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.PermType != 0 { @@ -324,10 +523,16 @@ func (m *Permission) Size() (n int) { if l > 0 { n += 1 + l + sovAuth(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Role) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -340,18 +545,14 @@ func (m *Role) Size() (n int) { n += 1 + l + sovAuth(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func sovAuth(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozAuth(x uint64) (n int) { return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -371,7 +572,7 @@ func (m *UserAddOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -399,7 +600,7 @@ func (m *UserAddOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -411,12 +612,13 @@ func (m *UserAddOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -441,7 +643,7 @@ func (m *User) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -469,7 +671,7 @@ func (m *User) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -478,6 +680,9 @@ func (m *User) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -500,7 +705,7 @@ func (m *User) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -509,6 +714,9 @@ func (m *User) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -531,7 +739,7 @@ func (m *User) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -541,6 +749,9 @@ func (m *User) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -560,7 +771,7 @@ func (m *User) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -569,6 +780,9 @@ func (m *User) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -585,12 +799,13 @@ func (m *User) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -615,7 +830,7 @@ func (m *Permission) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -643,7 +858,7 @@ func (m *Permission) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.PermType |= (Permission_Type(b) & 0x7F) << shift + m.PermType |= Permission_Type(b&0x7F) << shift if b < 0x80 { break } @@ -662,7 +877,7 @@ func (m *Permission) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -671,6 +886,9 @@ func (m *Permission) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -693,7 +911,7 @@ func (m *Permission) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -702,6 +920,9 @@ func (m *Permission) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -716,12 +937,13 @@ func (m *Permission) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -746,7 +968,7 @@ func (m *Role) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -774,7 +996,7 @@ func (m *Role) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -783,6 +1005,9 @@ func (m *Role) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -805,7 +1030,7 @@ func (m *Role) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -814,6 +1039,9 @@ func (m *Role) Unmarshal(dAtA []byte) error { return ErrInvalidLengthAuth } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuth + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -828,12 +1056,13 @@ func (m *Role) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -846,6 +1075,7 @@ func (m *Role) Unmarshal(dAtA []byte) error { func skipAuth(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -877,10 +1107,8 @@ func skipAuth(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -897,81 +1125,34 @@ func skipAuth(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthAuth } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipAuth(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuth + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuth + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("auth.proto", fileDescriptorAuth) } - -var fileDescriptorAuth = []byte{ - // 338 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4e, 0xea, 0x40, - 0x14, 0xc6, 0x3b, 0xb4, 0x70, 0xdb, 0xc3, 0x85, 0x90, 0x13, 0x72, 0x6f, 0x83, 0x49, 0x6d, 0xba, - 0x6a, 0x5c, 0x54, 0x85, 0x8d, 0x5b, 0x8c, 0x2c, 0x5c, 0x49, 0x26, 0x18, 0x97, 0xa4, 0xa4, 0x13, - 0x24, 0xc0, 0x4c, 0x33, 0x83, 0x31, 0x6c, 0x7c, 0x0e, 0x17, 0x3e, 0x10, 0x4b, 0x1e, 0x41, 0xf0, - 0x45, 0x4c, 0x67, 0xf8, 0x13, 0xa2, 0xbb, 0xef, 0x7c, 0xe7, 0xfb, 0x66, 0x7e, 0x99, 0x01, 0x48, - 0x5f, 0x16, 0xcf, 0x49, 0x2e, 0xc5, 0x42, 0x60, 0xa5, 0xd0, 0xf9, 0xa8, 0xd5, 0x1c, 0x8b, 0xb1, - 0xd0, 0xd6, 0x65, 0xa1, 0xcc, 0x36, 0xba, 0x86, 0xfa, 0xa3, 0x62, 0xb2, 0x9b, 0x65, 0x0f, 0xf9, - 0x62, 0x22, 0xb8, 0xc2, 0x73, 0xa8, 0x72, 0x31, 0xcc, 0x53, 0xa5, 0x5e, 0x85, 0xcc, 0x7c, 0x12, - 0x92, 0xd8, 0xa5, 0xc0, 0x45, 0x7f, 0xe7, 0x44, 0x6f, 0xe0, 0x14, 0x15, 0x44, 0x70, 0x78, 0x3a, - 0x67, 0x3a, 0xf1, 0x97, 0x6a, 0x8d, 0x2d, 0x70, 0x0f, 0xcd, 0x92, 0xf6, 0x0f, 0x33, 0x36, 0xa1, - 0x2c, 0xc5, 0x8c, 0x29, 0xdf, 0x0e, 0xed, 0xd8, 0xa3, 0x66, 0xc0, 0x2b, 0xf8, 0x23, 0xcc, 0xcd, - 0xbe, 0x13, 0x92, 0xb8, 0xda, 0xfe, 0x97, 0x18, 0xe0, 0xe4, 0x94, 0x8b, 0xee, 0x63, 0xd1, 0x07, - 0x01, 0xe8, 0x33, 0x39, 0x9f, 0x28, 0x35, 0x11, 0x1c, 0x3b, 0xe0, 0xe6, 0x4c, 0xce, 0x07, 0xcb, - 0xdc, 0xa0, 0xd4, 0xdb, 0xff, 0xf7, 0x27, 0x1c, 0x53, 0x49, 0xb1, 0xa6, 0x87, 0x20, 0x36, 0xc0, - 0x9e, 0xb2, 0xe5, 0x0e, 0xb1, 0x90, 0x78, 0x06, 0x9e, 0x4c, 0xf9, 0x98, 0x0d, 0x19, 0xcf, 0x7c, - 0xdb, 0xa0, 0x6b, 0xa3, 0xc7, 0xb3, 0xe8, 0x02, 0x1c, 0x5d, 0x73, 0xc1, 0xa1, 0xbd, 0xee, 0x5d, - 0xc3, 0x42, 0x0f, 0xca, 0x4f, 0xf4, 0x7e, 0xd0, 0x6b, 0x10, 0xac, 0x81, 0x57, 0x98, 0x66, 0x2c, - 0x45, 0x03, 0x70, 0xa8, 0x98, 0xb1, 0x5f, 0x9f, 0xe7, 0x06, 0x6a, 0x53, 0xb6, 0x3c, 0x62, 0xf9, - 0xa5, 0xd0, 0x8e, 0xab, 0x6d, 0xfc, 0x09, 0x4c, 0x4f, 0x83, 0xb7, 0xfe, 0x6a, 0x13, 0x58, 0xeb, - 0x4d, 0x60, 0xad, 0xb6, 0x01, 0x59, 0x6f, 0x03, 0xf2, 0xb9, 0x0d, 0xc8, 0xfb, 0x57, 0x60, 0x8d, - 0x2a, 0xfa, 0x23, 0x3b, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0x66, 0xc6, 0x9d, 0xf4, 0x01, - 0x00, 0x00, -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/auth/authpb/auth.proto b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/authpb/auth.proto similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/auth/authpb/auth.proto rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/authpb/auth.proto diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/etcdserver.pb.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.pb.go similarity index 72% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/etcdserver.pb.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.pb.go index 9e9b42ceac73..38434d09c564 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/etcdserver.pb.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.pb.go @@ -1,125 +1,16 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: etcdserver.proto -/* - Package etcdserverpb is a generated protocol buffer package. - - It is generated from these files: - etcdserver.proto - raft_internal.proto - rpc.proto - - It has these top-level messages: - Request - Metadata - RequestHeader - InternalRaftRequest - EmptyResponse - InternalAuthenticateRequest - ResponseHeader - RangeRequest - RangeResponse - PutRequest - PutResponse - DeleteRangeRequest - DeleteRangeResponse - RequestOp - ResponseOp - Compare - TxnRequest - TxnResponse - CompactionRequest - CompactionResponse - HashRequest - HashKVRequest - HashKVResponse - HashResponse - SnapshotRequest - SnapshotResponse - WatchRequest - WatchCreateRequest - WatchCancelRequest - WatchProgressRequest - WatchResponse - LeaseGrantRequest - LeaseGrantResponse - LeaseRevokeRequest - LeaseRevokeResponse - LeaseCheckpoint - LeaseCheckpointRequest - LeaseCheckpointResponse - LeaseKeepAliveRequest - LeaseKeepAliveResponse - LeaseTimeToLiveRequest - LeaseTimeToLiveResponse - LeaseLeasesRequest - LeaseStatus - LeaseLeasesResponse - Member - MemberAddRequest - MemberAddResponse - MemberRemoveRequest - MemberRemoveResponse - MemberUpdateRequest - MemberUpdateResponse - MemberListRequest - MemberListResponse - MemberPromoteRequest - MemberPromoteResponse - DefragmentRequest - DefragmentResponse - MoveLeaderRequest - MoveLeaderResponse - AlarmRequest - AlarmMember - AlarmResponse - StatusRequest - StatusResponse - AuthEnableRequest - AuthDisableRequest - AuthenticateRequest - AuthUserAddRequest - AuthUserGetRequest - AuthUserDeleteRequest - AuthUserChangePasswordRequest - AuthUserGrantRoleRequest - AuthUserRevokeRoleRequest - AuthRoleAddRequest - AuthRoleGetRequest - AuthUserListRequest - AuthRoleListRequest - AuthRoleDeleteRequest - AuthRoleGrantPermissionRequest - AuthRoleRevokePermissionRequest - AuthEnableResponse - AuthDisableResponse - AuthenticateResponse - AuthUserAddResponse - AuthUserGetResponse - AuthUserDeleteResponse - AuthUserChangePasswordResponse - AuthUserGrantRoleResponse - AuthUserRevokeRoleResponse - AuthRoleAddResponse - AuthRoleGetResponse - AuthRoleListResponse - AuthUserListResponse - AuthRoleDeleteResponse - AuthRoleGrantPermissionResponse - AuthRoleRevokePermissionResponse -*/ package etcdserverpb import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - + fmt "fmt" + io "io" math "math" + math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" - - io "io" + proto "github.com/golang/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. @@ -131,53 +22,144 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Request struct { - ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"` - Method string `protobuf:"bytes,2,opt,name=Method" json:"Method"` - Path string `protobuf:"bytes,3,opt,name=Path" json:"Path"` - Val string `protobuf:"bytes,4,opt,name=Val" json:"Val"` - Dir bool `protobuf:"varint,5,opt,name=Dir" json:"Dir"` - PrevValue string `protobuf:"bytes,6,opt,name=PrevValue" json:"PrevValue"` - PrevIndex uint64 `protobuf:"varint,7,opt,name=PrevIndex" json:"PrevIndex"` - PrevExist *bool `protobuf:"varint,8,opt,name=PrevExist" json:"PrevExist,omitempty"` - Expiration int64 `protobuf:"varint,9,opt,name=Expiration" json:"Expiration"` - Wait bool `protobuf:"varint,10,opt,name=Wait" json:"Wait"` - Since uint64 `protobuf:"varint,11,opt,name=Since" json:"Since"` - Recursive bool `protobuf:"varint,12,opt,name=Recursive" json:"Recursive"` - Sorted bool `protobuf:"varint,13,opt,name=Sorted" json:"Sorted"` - Quorum bool `protobuf:"varint,14,opt,name=Quorum" json:"Quorum"` - Time int64 `protobuf:"varint,15,opt,name=Time" json:"Time"` - Stream bool `protobuf:"varint,16,opt,name=Stream" json:"Stream"` - Refresh *bool `protobuf:"varint,17,opt,name=Refresh" json:"Refresh,omitempty"` - XXX_unrecognized []byte `json:"-"` + ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"` + Method string `protobuf:"bytes,2,opt,name=Method" json:"Method"` + Path string `protobuf:"bytes,3,opt,name=Path" json:"Path"` + Val string `protobuf:"bytes,4,opt,name=Val" json:"Val"` + Dir bool `protobuf:"varint,5,opt,name=Dir" json:"Dir"` + PrevValue string `protobuf:"bytes,6,opt,name=PrevValue" json:"PrevValue"` + PrevIndex uint64 `protobuf:"varint,7,opt,name=PrevIndex" json:"PrevIndex"` + PrevExist *bool `protobuf:"varint,8,opt,name=PrevExist" json:"PrevExist,omitempty"` + Expiration int64 `protobuf:"varint,9,opt,name=Expiration" json:"Expiration"` + Wait bool `protobuf:"varint,10,opt,name=Wait" json:"Wait"` + Since uint64 `protobuf:"varint,11,opt,name=Since" json:"Since"` + Recursive bool `protobuf:"varint,12,opt,name=Recursive" json:"Recursive"` + Sorted bool `protobuf:"varint,13,opt,name=Sorted" json:"Sorted"` + Quorum bool `protobuf:"varint,14,opt,name=Quorum" json:"Quorum"` + Time int64 `protobuf:"varint,15,opt,name=Time" json:"Time"` + Stream bool `protobuf:"varint,16,opt,name=Stream" json:"Stream"` + Refresh *bool `protobuf:"varint,17,opt,name=Refresh" json:"Refresh,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorEtcdserver, []int{0} } +func (m *Request) Reset() { *m = Request{} } +func (m *Request) String() string { return proto.CompactTextString(m) } +func (*Request) ProtoMessage() {} +func (*Request) Descriptor() ([]byte, []int) { + return fileDescriptor_09ffbeb3bebbce7e, []int{0} +} +func (m *Request) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Request.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Request) XXX_Merge(src proto.Message) { + xxx_messageInfo_Request.Merge(m, src) +} +func (m *Request) XXX_Size() int { + return m.Size() +} +func (m *Request) XXX_DiscardUnknown() { + xxx_messageInfo_Request.DiscardUnknown(m) +} + +var xxx_messageInfo_Request proto.InternalMessageInfo type Metadata struct { - NodeID uint64 `protobuf:"varint,1,opt,name=NodeID" json:"NodeID"` - ClusterID uint64 `protobuf:"varint,2,opt,name=ClusterID" json:"ClusterID"` - XXX_unrecognized []byte `json:"-"` + NodeID uint64 `protobuf:"varint,1,opt,name=NodeID" json:"NodeID"` + ClusterID uint64 `protobuf:"varint,2,opt,name=ClusterID" json:"ClusterID"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Metadata) Reset() { *m = Metadata{} } +func (m *Metadata) String() string { return proto.CompactTextString(m) } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_09ffbeb3bebbce7e, []int{1} +} +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(m, src) +} +func (m *Metadata) XXX_Size() int { + return m.Size() +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) } -func (m *Metadata) Reset() { *m = Metadata{} } -func (m *Metadata) String() string { return proto.CompactTextString(m) } -func (*Metadata) ProtoMessage() {} -func (*Metadata) Descriptor() ([]byte, []int) { return fileDescriptorEtcdserver, []int{1} } +var xxx_messageInfo_Metadata proto.InternalMessageInfo func init() { proto.RegisterType((*Request)(nil), "etcdserverpb.Request") proto.RegisterType((*Metadata)(nil), "etcdserverpb.Metadata") } + +func init() { proto.RegisterFile("etcdserver.proto", fileDescriptor_09ffbeb3bebbce7e) } + +var fileDescriptor_09ffbeb3bebbce7e = []byte{ + // 380 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0xd2, 0xdd, 0x6e, 0xda, 0x30, + 0x14, 0x07, 0x70, 0x0c, 0xe1, 0xcb, 0x63, 0x1b, 0xb3, 0xd0, 0x74, 0x84, 0xa6, 0x2c, 0x42, 0xbb, + 0xc8, 0xd5, 0xf6, 0x0e, 0x2c, 0x5c, 0x44, 0x2a, 0x15, 0x0d, 0x15, 0xbd, 0x76, 0xc9, 0x29, 0x58, + 0x02, 0x4c, 0x1d, 0x07, 0xf1, 0x06, 0x7d, 0x85, 0x3e, 0x12, 0x97, 0x7d, 0x82, 0xaa, 0xa5, 0x2f, + 0x52, 0x39, 0x24, 0xc4, 0xed, 0x5d, 0xf4, 0xfb, 0x9f, 0x1c, 0x1f, 0x7f, 0xd0, 0x2e, 0xea, 0x79, + 0x9c, 0xa0, 0xda, 0xa1, 0xfa, 0xbb, 0x55, 0x52, 0x4b, 0xd6, 0x29, 0x65, 0x7b, 0xdb, 0xef, 0x2d, + 0xe4, 0x42, 0x66, 0xc1, 0x3f, 0xf3, 0x75, 0xaa, 0x19, 0x3c, 0x38, 0xb4, 0x19, 0xe1, 0x7d, 0x8a, + 0x89, 0x66, 0x3d, 0x5a, 0x0d, 0x03, 0x20, 0x1e, 0xf1, 0x9d, 0xa1, 0x73, 0x78, 0xfe, 0x5d, 0x89, + 0xaa, 0x61, 0xc0, 0x7e, 0xd1, 0xc6, 0x18, 0xf5, 0x52, 0xc6, 0x50, 0xf5, 0x88, 0xdf, 0xce, 0x93, + 0xdc, 0x18, 0x50, 0x67, 0xc2, 0xf5, 0x12, 0x6a, 0x56, 0x96, 0x09, 0xfb, 0x49, 0x6b, 0x33, 0xbe, + 0x02, 0xc7, 0x0a, 0x0c, 0x18, 0x0f, 0x84, 0x82, 0xba, 0x47, 0xfc, 0x56, 0xe1, 0x81, 0x50, 0x6c, + 0x40, 0xdb, 0x13, 0x85, 0xbb, 0x19, 0x5f, 0xa5, 0x08, 0x0d, 0xeb, 0xaf, 0x92, 0x8b, 0x9a, 0x70, + 0x13, 0xe3, 0x1e, 0x9a, 0xd6, 0xa0, 0x25, 0x17, 0x35, 0xa3, 0xbd, 0x48, 0x34, 0xb4, 0xce, 0xab, + 0x90, 0xa8, 0x64, 0xf6, 0x87, 0xd2, 0xd1, 0x7e, 0x2b, 0x14, 0xd7, 0x42, 0x6e, 0xa0, 0xed, 0x11, + 0xbf, 0x96, 0x37, 0xb2, 0xdc, 0xec, 0xed, 0x86, 0x0b, 0x0d, 0xd4, 0x1a, 0x35, 0x13, 0xd6, 0xa7, + 0xf5, 0xa9, 0xd8, 0xcc, 0x11, 0xbe, 0x58, 0x33, 0x9c, 0xc8, 0xac, 0x1f, 0xe1, 0x3c, 0x55, 0x89, + 0xd8, 0x21, 0x74, 0xac, 0x5f, 0x4b, 0x36, 0x67, 0x3a, 0x95, 0x4a, 0x63, 0x0c, 0x5f, 0xad, 0x82, + 0xdc, 0x4c, 0x7a, 0x95, 0x4a, 0x95, 0xae, 0xe1, 0x9b, 0x9d, 0x9e, 0xcc, 0x4c, 0x75, 0x2d, 0xd6, + 0x08, 0xdf, 0xad, 0xa9, 0x33, 0xc9, 0xba, 0x6a, 0x85, 0x7c, 0x0d, 0xdd, 0x0f, 0x5d, 0x33, 0x63, + 0xae, 0xb9, 0xe8, 0x3b, 0x85, 0xc9, 0x12, 0x7e, 0x58, 0xa7, 0x52, 0xe0, 0xe0, 0x82, 0xb6, 0xc6, + 0xa8, 0x79, 0xcc, 0x35, 0x37, 0x9d, 0x2e, 0x65, 0x8c, 0x9f, 0x5e, 0x43, 0x6e, 0x66, 0x87, 0xff, + 0x57, 0x69, 0xa2, 0x51, 0x85, 0x41, 0xf6, 0x28, 0xce, 0xb7, 0x70, 0xe6, 0x61, 0xef, 0xf0, 0xea, + 0x56, 0x0e, 0x47, 0x97, 0x3c, 0x1d, 0x5d, 0xf2, 0x72, 0x74, 0xc9, 0xe3, 0x9b, 0x5b, 0x79, 0x0f, + 0x00, 0x00, 0xff, 0xff, 0xee, 0x40, 0xba, 0xd6, 0xa4, 0x02, 0x00, 0x00, +} + func (m *Request) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -185,123 +167,133 @@ func (m *Request) Marshal() (dAtA []byte, err error) { } func (m *Request) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.ID)) - dAtA[i] = 0x12 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Method))) - i += copy(dAtA[i:], m.Method) - dAtA[i] = 0x1a - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Path))) - i += copy(dAtA[i:], m.Path) - dAtA[i] = 0x22 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Val))) - i += copy(dAtA[i:], m.Val) - dAtA[i] = 0x28 - i++ - if m.Dir { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i++ - dAtA[i] = 0x32 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.PrevValue))) - i += copy(dAtA[i:], m.PrevValue) - dAtA[i] = 0x38 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.PrevIndex)) - if m.PrevExist != nil { - dAtA[i] = 0x40 - i++ - if *m.PrevExist { + if m.Refresh != nil { + i-- + if *m.Refresh { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 } - dAtA[i] = 0x48 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.Expiration)) - dAtA[i] = 0x50 - i++ - if m.Wait { + i-- + if m.Stream { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - dAtA[i] = 0x58 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.Since)) - dAtA[i] = 0x60 - i++ - if m.Recursive { + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + i = encodeVarintEtcdserver(dAtA, i, uint64(m.Time)) + i-- + dAtA[i] = 0x78 + i-- + if m.Quorum { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - dAtA[i] = 0x68 - i++ + i-- + dAtA[i] = 0x70 + i-- if m.Sorted { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - dAtA[i] = 0x70 - i++ - if m.Quorum { + i-- + dAtA[i] = 0x68 + i-- + if m.Recursive { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - dAtA[i] = 0x78 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.Time)) - dAtA[i] = 0x80 - i++ - dAtA[i] = 0x1 - i++ - if m.Stream { + i-- + dAtA[i] = 0x60 + i = encodeVarintEtcdserver(dAtA, i, uint64(m.Since)) + i-- + dAtA[i] = 0x58 + i-- + if m.Wait { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - if m.Refresh != nil { - dAtA[i] = 0x88 - i++ - dAtA[i] = 0x1 - i++ - if *m.Refresh { + i-- + dAtA[i] = 0x50 + i = encodeVarintEtcdserver(dAtA, i, uint64(m.Expiration)) + i-- + dAtA[i] = 0x48 + if m.PrevExist != nil { + i-- + if *m.PrevExist { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x40 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i = encodeVarintEtcdserver(dAtA, i, uint64(m.PrevIndex)) + i-- + dAtA[i] = 0x38 + i -= len(m.PrevValue) + copy(dAtA[i:], m.PrevValue) + i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.PrevValue))) + i-- + dAtA[i] = 0x32 + i-- + if m.Dir { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - return i, nil + i-- + dAtA[i] = 0x28 + i -= len(m.Val) + copy(dAtA[i:], m.Val) + i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Val))) + i-- + dAtA[i] = 0x22 + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x1a + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x12 + i = encodeVarintEtcdserver(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil } func (m *Metadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -309,32 +301,43 @@ func (m *Metadata) Marshal() (dAtA []byte, err error) { } func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.NodeID)) - dAtA[i] = 0x10 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.ClusterID)) if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + i = encodeVarintEtcdserver(dAtA, i, uint64(m.ClusterID)) + i-- + dAtA[i] = 0x10 + i = encodeVarintEtcdserver(dAtA, i, uint64(m.NodeID)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil } func encodeVarintEtcdserver(dAtA []byte, offset int, v uint64) int { + offset -= sovEtcdserver(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Request) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l n += 1 + sovEtcdserver(uint64(m.ID)) @@ -369,6 +372,9 @@ func (m *Request) Size() (n int) { } func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l n += 1 + sovEtcdserver(uint64(m.NodeID)) @@ -380,14 +386,7 @@ func (m *Metadata) Size() (n int) { } func sovEtcdserver(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozEtcdserver(x uint64) (n int) { return sovEtcdserver(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -407,7 +406,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -435,7 +434,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.ID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -454,7 +453,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -464,6 +463,9 @@ func (m *Request) Unmarshal(dAtA []byte) error { return ErrInvalidLengthEtcdserver } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEtcdserver + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -483,7 +485,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -493,6 +495,9 @@ func (m *Request) Unmarshal(dAtA []byte) error { return ErrInvalidLengthEtcdserver } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEtcdserver + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -512,7 +517,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -522,6 +527,9 @@ func (m *Request) Unmarshal(dAtA []byte) error { return ErrInvalidLengthEtcdserver } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEtcdserver + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -541,7 +549,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -561,7 +569,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -571,6 +579,9 @@ func (m *Request) Unmarshal(dAtA []byte) error { return ErrInvalidLengthEtcdserver } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEtcdserver + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -590,7 +601,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.PrevIndex |= (uint64(b) & 0x7F) << shift + m.PrevIndex |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -609,7 +620,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -630,7 +641,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Expiration |= (int64(b) & 0x7F) << shift + m.Expiration |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -649,7 +660,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -669,7 +680,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Since |= (uint64(b) & 0x7F) << shift + m.Since |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -688,7 +699,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -708,7 +719,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -728,7 +739,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -748,7 +759,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Time |= (int64(b) & 0x7F) << shift + m.Time |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -767,7 +778,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -787,7 +798,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -800,7 +811,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthEtcdserver } if (iNdEx + skippy) > l { @@ -831,7 +842,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -859,7 +870,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NodeID |= (uint64(b) & 0x7F) << shift + m.NodeID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -878,7 +889,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ClusterID |= (uint64(b) & 0x7F) << shift + m.ClusterID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -889,7 +900,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthEtcdserver } if (iNdEx + skippy) > l { @@ -908,6 +919,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { func skipEtcdserver(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -939,10 +951,8 @@ func skipEtcdserver(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -959,83 +969,34 @@ func skipEtcdserver(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthEtcdserver } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipEtcdserver(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEtcdserver + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthEtcdserver + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthEtcdserver = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEtcdserver = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthEtcdserver = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEtcdserver = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEtcdserver = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("etcdserver.proto", fileDescriptorEtcdserver) } - -var fileDescriptorEtcdserver = []byte{ - // 380 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0xd2, 0xdd, 0x6e, 0xda, 0x30, - 0x14, 0x07, 0x70, 0x0c, 0xe1, 0xcb, 0x63, 0x1b, 0xb3, 0xd0, 0x74, 0x84, 0xa6, 0x2c, 0x42, 0xbb, - 0xc8, 0xd5, 0xf6, 0x0e, 0x2c, 0x5c, 0x44, 0x2a, 0x15, 0x0d, 0x15, 0xbd, 0x76, 0xc9, 0x29, 0x58, - 0x02, 0x4c, 0x1d, 0x07, 0xf1, 0x06, 0x7d, 0x85, 0x3e, 0x12, 0x97, 0x7d, 0x82, 0xaa, 0xa5, 0x2f, - 0x52, 0x39, 0x24, 0xc4, 0xed, 0x5d, 0xf4, 0xfb, 0x9f, 0x1c, 0x1f, 0x7f, 0xd0, 0x2e, 0xea, 0x79, - 0x9c, 0xa0, 0xda, 0xa1, 0xfa, 0xbb, 0x55, 0x52, 0x4b, 0xd6, 0x29, 0x65, 0x7b, 0xdb, 0xef, 0x2d, - 0xe4, 0x42, 0x66, 0xc1, 0x3f, 0xf3, 0x75, 0xaa, 0x19, 0x3c, 0x38, 0xb4, 0x19, 0xe1, 0x7d, 0x8a, - 0x89, 0x66, 0x3d, 0x5a, 0x0d, 0x03, 0x20, 0x1e, 0xf1, 0x9d, 0xa1, 0x73, 0x78, 0xfe, 0x5d, 0x89, - 0xaa, 0x61, 0xc0, 0x7e, 0xd1, 0xc6, 0x18, 0xf5, 0x52, 0xc6, 0x50, 0xf5, 0x88, 0xdf, 0xce, 0x93, - 0xdc, 0x18, 0x50, 0x67, 0xc2, 0xf5, 0x12, 0x6a, 0x56, 0x96, 0x09, 0xfb, 0x49, 0x6b, 0x33, 0xbe, - 0x02, 0xc7, 0x0a, 0x0c, 0x18, 0x0f, 0x84, 0x82, 0xba, 0x47, 0xfc, 0x56, 0xe1, 0x81, 0x50, 0x6c, - 0x40, 0xdb, 0x13, 0x85, 0xbb, 0x19, 0x5f, 0xa5, 0x08, 0x0d, 0xeb, 0xaf, 0x92, 0x8b, 0x9a, 0x70, - 0x13, 0xe3, 0x1e, 0x9a, 0xd6, 0xa0, 0x25, 0x17, 0x35, 0xa3, 0xbd, 0x48, 0x34, 0xb4, 0xce, 0xab, - 0x90, 0xa8, 0x64, 0xf6, 0x87, 0xd2, 0xd1, 0x7e, 0x2b, 0x14, 0xd7, 0x42, 0x6e, 0xa0, 0xed, 0x11, - 0xbf, 0x96, 0x37, 0xb2, 0xdc, 0xec, 0xed, 0x86, 0x0b, 0x0d, 0xd4, 0x1a, 0x35, 0x13, 0xd6, 0xa7, - 0xf5, 0xa9, 0xd8, 0xcc, 0x11, 0xbe, 0x58, 0x33, 0x9c, 0xc8, 0xac, 0x1f, 0xe1, 0x3c, 0x55, 0x89, - 0xd8, 0x21, 0x74, 0xac, 0x5f, 0x4b, 0x36, 0x67, 0x3a, 0x95, 0x4a, 0x63, 0x0c, 0x5f, 0xad, 0x82, - 0xdc, 0x4c, 0x7a, 0x95, 0x4a, 0x95, 0xae, 0xe1, 0x9b, 0x9d, 0x9e, 0xcc, 0x4c, 0x75, 0x2d, 0xd6, - 0x08, 0xdf, 0xad, 0xa9, 0x33, 0xc9, 0xba, 0x6a, 0x85, 0x7c, 0x0d, 0xdd, 0x0f, 0x5d, 0x33, 0x63, - 0xae, 0xb9, 0xe8, 0x3b, 0x85, 0xc9, 0x12, 0x7e, 0x58, 0xa7, 0x52, 0xe0, 0xe0, 0x82, 0xb6, 0xc6, - 0xa8, 0x79, 0xcc, 0x35, 0x37, 0x9d, 0x2e, 0x65, 0x8c, 0x9f, 0x5e, 0x43, 0x6e, 0x66, 0x87, 0xff, - 0x57, 0x69, 0xa2, 0x51, 0x85, 0x41, 0xf6, 0x28, 0xce, 0xb7, 0x70, 0xe6, 0x61, 0xef, 0xf0, 0xea, - 0x56, 0x0e, 0x47, 0x97, 0x3c, 0x1d, 0x5d, 0xf2, 0x72, 0x74, 0xc9, 0xe3, 0x9b, 0x5b, 0x79, 0x0f, - 0x00, 0x00, 0xff, 0xff, 0xee, 0x40, 0xba, 0xd6, 0xa4, 0x02, 0x00, 0x00, -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/etcdserver.proto b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.proto similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/etcdserver.proto rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.proto diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/raft_internal.pb.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.pb.go similarity index 53% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/raft_internal.pb.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.pb.go index b170499e4b6c..b94a7bfd9d96 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/raft_internal.pb.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.pb.go @@ -4,15 +4,14 @@ package etcdserverpb import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - + fmt "fmt" + io "io" math "math" + math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" - - io "io" + proto "github.com/golang/protobuf/proto" + membershippb "go.etcd.io/etcd/api/v3/membershippb" ) // Reference imports to suppress errors if they are not otherwise used. @@ -20,64 +19,167 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + type RequestHeader struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // username is a username that is associated with an auth token of gRPC connection Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // auth_revision is a revision number of auth.authStore. It is not related to mvcc - AuthRevision uint64 `protobuf:"varint,3,opt,name=auth_revision,json=authRevision,proto3" json:"auth_revision,omitempty"` + AuthRevision uint64 `protobuf:"varint,3,opt,name=auth_revision,json=authRevision,proto3" json:"auth_revision,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestHeader) Reset() { *m = RequestHeader{} } -func (m *RequestHeader) String() string { return proto.CompactTextString(m) } -func (*RequestHeader) ProtoMessage() {} -func (*RequestHeader) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{0} } +func (m *RequestHeader) Reset() { *m = RequestHeader{} } +func (m *RequestHeader) String() string { return proto.CompactTextString(m) } +func (*RequestHeader) ProtoMessage() {} +func (*RequestHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_b4c9a9be0cfca103, []int{0} +} +func (m *RequestHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestHeader.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RequestHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestHeader.Merge(m, src) +} +func (m *RequestHeader) XXX_Size() int { + return m.Size() +} +func (m *RequestHeader) XXX_DiscardUnknown() { + xxx_messageInfo_RequestHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestHeader proto.InternalMessageInfo // An InternalRaftRequest is the union of all requests which can be // sent via raft. type InternalRaftRequest struct { - Header *RequestHeader `protobuf:"bytes,100,opt,name=header" json:"header,omitempty"` - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - V2 *Request `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"` - Range *RangeRequest `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"` - Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"` - DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range,json=deleteRange" json:"delete_range,omitempty"` - Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"` - Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"` - LeaseGrant *LeaseGrantRequest `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant" json:"lease_grant,omitempty"` - LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke" json:"lease_revoke,omitempty"` - Alarm *AlarmRequest `protobuf:"bytes,10,opt,name=alarm" json:"alarm,omitempty"` - LeaseCheckpoint *LeaseCheckpointRequest `protobuf:"bytes,11,opt,name=lease_checkpoint,json=leaseCheckpoint" json:"lease_checkpoint,omitempty"` - AuthEnable *AuthEnableRequest `protobuf:"bytes,1000,opt,name=auth_enable,json=authEnable" json:"auth_enable,omitempty"` - AuthDisable *AuthDisableRequest `protobuf:"bytes,1011,opt,name=auth_disable,json=authDisable" json:"auth_disable,omitempty"` - Authenticate *InternalAuthenticateRequest `protobuf:"bytes,1012,opt,name=authenticate" json:"authenticate,omitempty"` - AuthUserAdd *AuthUserAddRequest `protobuf:"bytes,1100,opt,name=auth_user_add,json=authUserAdd" json:"auth_user_add,omitempty"` - AuthUserDelete *AuthUserDeleteRequest `protobuf:"bytes,1101,opt,name=auth_user_delete,json=authUserDelete" json:"auth_user_delete,omitempty"` - AuthUserGet *AuthUserGetRequest `protobuf:"bytes,1102,opt,name=auth_user_get,json=authUserGet" json:"auth_user_get,omitempty"` - AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,1103,opt,name=auth_user_change_password,json=authUserChangePassword" json:"auth_user_change_password,omitempty"` - AuthUserGrantRole *AuthUserGrantRoleRequest `protobuf:"bytes,1104,opt,name=auth_user_grant_role,json=authUserGrantRole" json:"auth_user_grant_role,omitempty"` - AuthUserRevokeRole *AuthUserRevokeRoleRequest `protobuf:"bytes,1105,opt,name=auth_user_revoke_role,json=authUserRevokeRole" json:"auth_user_revoke_role,omitempty"` - AuthUserList *AuthUserListRequest `protobuf:"bytes,1106,opt,name=auth_user_list,json=authUserList" json:"auth_user_list,omitempty"` - AuthRoleList *AuthRoleListRequest `protobuf:"bytes,1107,opt,name=auth_role_list,json=authRoleList" json:"auth_role_list,omitempty"` - AuthRoleAdd *AuthRoleAddRequest `protobuf:"bytes,1200,opt,name=auth_role_add,json=authRoleAdd" json:"auth_role_add,omitempty"` - AuthRoleDelete *AuthRoleDeleteRequest `protobuf:"bytes,1201,opt,name=auth_role_delete,json=authRoleDelete" json:"auth_role_delete,omitempty"` - AuthRoleGet *AuthRoleGetRequest `protobuf:"bytes,1202,opt,name=auth_role_get,json=authRoleGet" json:"auth_role_get,omitempty"` - AuthRoleGrantPermission *AuthRoleGrantPermissionRequest `protobuf:"bytes,1203,opt,name=auth_role_grant_permission,json=authRoleGrantPermission" json:"auth_role_grant_permission,omitempty"` - AuthRoleRevokePermission *AuthRoleRevokePermissionRequest `protobuf:"bytes,1204,opt,name=auth_role_revoke_permission,json=authRoleRevokePermission" json:"auth_role_revoke_permission,omitempty"` + Header *RequestHeader `protobuf:"bytes,100,opt,name=header,proto3" json:"header,omitempty"` + ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + V2 *Request `protobuf:"bytes,2,opt,name=v2,proto3" json:"v2,omitempty"` + Range *RangeRequest `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"` + Put *PutRequest `protobuf:"bytes,4,opt,name=put,proto3" json:"put,omitempty"` + DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range,json=deleteRange,proto3" json:"delete_range,omitempty"` + Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn,proto3" json:"txn,omitempty"` + Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction,proto3" json:"compaction,omitempty"` + LeaseGrant *LeaseGrantRequest `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant,proto3" json:"lease_grant,omitempty"` + LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke,proto3" json:"lease_revoke,omitempty"` + Alarm *AlarmRequest `protobuf:"bytes,10,opt,name=alarm,proto3" json:"alarm,omitempty"` + LeaseCheckpoint *LeaseCheckpointRequest `protobuf:"bytes,11,opt,name=lease_checkpoint,json=leaseCheckpoint,proto3" json:"lease_checkpoint,omitempty"` + AuthEnable *AuthEnableRequest `protobuf:"bytes,1000,opt,name=auth_enable,json=authEnable,proto3" json:"auth_enable,omitempty"` + AuthDisable *AuthDisableRequest `protobuf:"bytes,1011,opt,name=auth_disable,json=authDisable,proto3" json:"auth_disable,omitempty"` + AuthStatus *AuthStatusRequest `protobuf:"bytes,1013,opt,name=auth_status,json=authStatus,proto3" json:"auth_status,omitempty"` + Authenticate *InternalAuthenticateRequest `protobuf:"bytes,1012,opt,name=authenticate,proto3" json:"authenticate,omitempty"` + AuthUserAdd *AuthUserAddRequest `protobuf:"bytes,1100,opt,name=auth_user_add,json=authUserAdd,proto3" json:"auth_user_add,omitempty"` + AuthUserDelete *AuthUserDeleteRequest `protobuf:"bytes,1101,opt,name=auth_user_delete,json=authUserDelete,proto3" json:"auth_user_delete,omitempty"` + AuthUserGet *AuthUserGetRequest `protobuf:"bytes,1102,opt,name=auth_user_get,json=authUserGet,proto3" json:"auth_user_get,omitempty"` + AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,1103,opt,name=auth_user_change_password,json=authUserChangePassword,proto3" json:"auth_user_change_password,omitempty"` + AuthUserGrantRole *AuthUserGrantRoleRequest `protobuf:"bytes,1104,opt,name=auth_user_grant_role,json=authUserGrantRole,proto3" json:"auth_user_grant_role,omitempty"` + AuthUserRevokeRole *AuthUserRevokeRoleRequest `protobuf:"bytes,1105,opt,name=auth_user_revoke_role,json=authUserRevokeRole,proto3" json:"auth_user_revoke_role,omitempty"` + AuthUserList *AuthUserListRequest `protobuf:"bytes,1106,opt,name=auth_user_list,json=authUserList,proto3" json:"auth_user_list,omitempty"` + AuthRoleList *AuthRoleListRequest `protobuf:"bytes,1107,opt,name=auth_role_list,json=authRoleList,proto3" json:"auth_role_list,omitempty"` + AuthRoleAdd *AuthRoleAddRequest `protobuf:"bytes,1200,opt,name=auth_role_add,json=authRoleAdd,proto3" json:"auth_role_add,omitempty"` + AuthRoleDelete *AuthRoleDeleteRequest `protobuf:"bytes,1201,opt,name=auth_role_delete,json=authRoleDelete,proto3" json:"auth_role_delete,omitempty"` + AuthRoleGet *AuthRoleGetRequest `protobuf:"bytes,1202,opt,name=auth_role_get,json=authRoleGet,proto3" json:"auth_role_get,omitempty"` + AuthRoleGrantPermission *AuthRoleGrantPermissionRequest `protobuf:"bytes,1203,opt,name=auth_role_grant_permission,json=authRoleGrantPermission,proto3" json:"auth_role_grant_permission,omitempty"` + AuthRoleRevokePermission *AuthRoleRevokePermissionRequest `protobuf:"bytes,1204,opt,name=auth_role_revoke_permission,json=authRoleRevokePermission,proto3" json:"auth_role_revoke_permission,omitempty"` + ClusterVersionSet *membershippb.ClusterVersionSetRequest `protobuf:"bytes,1300,opt,name=cluster_version_set,json=clusterVersionSet,proto3" json:"cluster_version_set,omitempty"` + ClusterMemberAttrSet *membershippb.ClusterMemberAttrSetRequest `protobuf:"bytes,1301,opt,name=cluster_member_attr_set,json=clusterMemberAttrSet,proto3" json:"cluster_member_attr_set,omitempty"` + DowngradeInfoSet *membershippb.DowngradeInfoSetRequest `protobuf:"bytes,1302,opt,name=downgrade_info_set,json=downgradeInfoSet,proto3" json:"downgrade_info_set,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } +func (m *InternalRaftRequest) String() string { return proto.CompactTextString(m) } +func (*InternalRaftRequest) ProtoMessage() {} +func (*InternalRaftRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b4c9a9be0cfca103, []int{1} +} +func (m *InternalRaftRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InternalRaftRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InternalRaftRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *InternalRaftRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InternalRaftRequest.Merge(m, src) +} +func (m *InternalRaftRequest) XXX_Size() int { + return m.Size() +} +func (m *InternalRaftRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InternalRaftRequest.DiscardUnknown(m) } -func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } -func (m *InternalRaftRequest) String() string { return proto.CompactTextString(m) } -func (*InternalRaftRequest) ProtoMessage() {} -func (*InternalRaftRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{1} } +var xxx_messageInfo_InternalRaftRequest proto.InternalMessageInfo type EmptyResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EmptyResponse) Reset() { *m = EmptyResponse{} } +func (m *EmptyResponse) String() string { return proto.CompactTextString(m) } +func (*EmptyResponse) ProtoMessage() {} +func (*EmptyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b4c9a9be0cfca103, []int{2} +} +func (m *EmptyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EmptyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EmptyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EmptyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_EmptyResponse.Merge(m, src) +} +func (m *EmptyResponse) XXX_Size() int { + return m.Size() +} +func (m *EmptyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_EmptyResponse.DiscardUnknown(m) } -func (m *EmptyResponse) Reset() { *m = EmptyResponse{} } -func (m *EmptyResponse) String() string { return proto.CompactTextString(m) } -func (*EmptyResponse) ProtoMessage() {} -func (*EmptyResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{2} } +var xxx_messageInfo_EmptyResponse proto.InternalMessageInfo // What is the difference between AuthenticateRequest (defined in rpc.proto) and InternalAuthenticateRequest? // InternalAuthenticateRequest has a member that is filled by etcdserver and shouldn't be user-facing. @@ -86,26 +188,125 @@ type InternalAuthenticateRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // simple_token is generated in API layer (etcdserver/v3_server.go) - SimpleToken string `protobuf:"bytes,3,opt,name=simple_token,json=simpleToken,proto3" json:"simple_token,omitempty"` + SimpleToken string `protobuf:"bytes,3,opt,name=simple_token,json=simpleToken,proto3" json:"simple_token,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *InternalAuthenticateRequest) Reset() { *m = InternalAuthenticateRequest{} } func (m *InternalAuthenticateRequest) String() string { return proto.CompactTextString(m) } func (*InternalAuthenticateRequest) ProtoMessage() {} func (*InternalAuthenticateRequest) Descriptor() ([]byte, []int) { - return fileDescriptorRaftInternal, []int{3} + return fileDescriptor_b4c9a9be0cfca103, []int{3} +} +func (m *InternalAuthenticateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InternalAuthenticateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InternalAuthenticateRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *InternalAuthenticateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InternalAuthenticateRequest.Merge(m, src) +} +func (m *InternalAuthenticateRequest) XXX_Size() int { + return m.Size() +} +func (m *InternalAuthenticateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InternalAuthenticateRequest.DiscardUnknown(m) } +var xxx_messageInfo_InternalAuthenticateRequest proto.InternalMessageInfo + func init() { proto.RegisterType((*RequestHeader)(nil), "etcdserverpb.RequestHeader") proto.RegisterType((*InternalRaftRequest)(nil), "etcdserverpb.InternalRaftRequest") proto.RegisterType((*EmptyResponse)(nil), "etcdserverpb.EmptyResponse") proto.RegisterType((*InternalAuthenticateRequest)(nil), "etcdserverpb.InternalAuthenticateRequest") } + +func init() { proto.RegisterFile("raft_internal.proto", fileDescriptor_b4c9a9be0cfca103) } + +var fileDescriptor_b4c9a9be0cfca103 = []byte{ + // 1003 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0xd9, 0x72, 0x1b, 0x45, + 0x14, 0x86, 0x23, 0xc5, 0x71, 0xac, 0x96, 0xed, 0x38, 0x6d, 0x87, 0x34, 0x72, 0x95, 0x70, 0x1c, + 0x12, 0xcc, 0x66, 0x53, 0xca, 0x03, 0x80, 0x90, 0x5c, 0x8e, 0xab, 0x42, 0x70, 0x4d, 0xcc, 0x52, + 0xc5, 0xc5, 0xd0, 0x9a, 0x39, 0x96, 0x06, 0xcf, 0x46, 0x77, 0x4b, 0x31, 0xef, 0x11, 0x28, 0x1e, + 0x83, 0xed, 0x21, 0x72, 0xc1, 0x62, 0xe0, 0x05, 0xc0, 0xdc, 0x70, 0x0f, 0xdc, 0x53, 0xbd, 0xcc, + 0x26, 0xb5, 0x7c, 0xa7, 0xf9, 0xcf, 0x7f, 0xbe, 0x73, 0xba, 0xe7, 0xf4, 0xa8, 0xd1, 0x3a, 0xa3, + 0x27, 0xc2, 0x0d, 0x62, 0x01, 0x2c, 0xa6, 0xe1, 0x6e, 0xca, 0x12, 0x91, 0xe0, 0x65, 0x10, 0x9e, + 0xcf, 0x81, 0x4d, 0x80, 0xa5, 0x83, 0xd6, 0xc6, 0x30, 0x19, 0x26, 0x2a, 0xb0, 0x27, 0x7f, 0x69, + 0x4f, 0x6b, 0xad, 0xf0, 0x18, 0xa5, 0xc1, 0x52, 0xcf, 0xfc, 0xbc, 0x2f, 0x83, 0x7b, 0x34, 0x0d, + 0xf6, 0x22, 0x88, 0x06, 0xc0, 0xf8, 0x28, 0x48, 0xd3, 0x41, 0xe9, 0x41, 0xfb, 0xb6, 0x3f, 0x45, + 0x2b, 0x0e, 0x7c, 0x3e, 0x06, 0x2e, 0x1e, 0x02, 0xf5, 0x81, 0xe1, 0x55, 0x54, 0x3f, 0xec, 0x93, + 0xda, 0x56, 0x6d, 0x67, 0xc1, 0xa9, 0x1f, 0xf6, 0x71, 0x0b, 0x2d, 0x8d, 0xb9, 0x6c, 0x2d, 0x02, + 0x52, 0xdf, 0xaa, 0xed, 0x34, 0x9c, 0xfc, 0x19, 0xdf, 0x45, 0x2b, 0x74, 0x2c, 0x46, 0x2e, 0x83, + 0x49, 0xc0, 0x83, 0x24, 0x26, 0x57, 0x55, 0xda, 0xb2, 0x14, 0x1d, 0xa3, 0x6d, 0x3f, 0xc3, 0x68, + 0xfd, 0xd0, 0xac, 0xce, 0xa1, 0x27, 0xc2, 0x94, 0xc3, 0x0f, 0xd0, 0xe2, 0x48, 0x95, 0x24, 0xfe, + 0x56, 0x6d, 0xa7, 0xd9, 0xd9, 0xdc, 0x2d, 0xaf, 0x79, 0xb7, 0xd2, 0x95, 0x63, 0xac, 0x33, 0xdd, + 0xdd, 0x43, 0xf5, 0x49, 0x47, 0xf5, 0xd5, 0xec, 0xdc, 0xb2, 0x02, 0x9c, 0xfa, 0xa4, 0x83, 0xdf, + 0x42, 0xd7, 0x18, 0x8d, 0x87, 0xa0, 0x1a, 0x6c, 0x76, 0x5a, 0x53, 0x4e, 0x19, 0xca, 0xec, 0xda, + 0x88, 0x5f, 0x43, 0x57, 0xd3, 0xb1, 0x20, 0x0b, 0xca, 0x4f, 0xaa, 0xfe, 0xa3, 0x71, 0xb6, 0x08, + 0x47, 0x9a, 0x70, 0x0f, 0x2d, 0xfb, 0x10, 0x82, 0x00, 0x57, 0x17, 0xb9, 0xa6, 0x92, 0xb6, 0xaa, + 0x49, 0x7d, 0xe5, 0xa8, 0x94, 0x6a, 0xfa, 0x85, 0x26, 0x0b, 0x8a, 0xb3, 0x98, 0x2c, 0xda, 0x0a, + 0x1e, 0x9f, 0xc5, 0x79, 0x41, 0x71, 0x16, 0xe3, 0xb7, 0x11, 0xf2, 0x92, 0x28, 0xa5, 0x9e, 0x90, + 0x9b, 0x7e, 0x5d, 0xa5, 0xbc, 0x54, 0x4d, 0xe9, 0xe5, 0xf1, 0x2c, 0xb3, 0x94, 0x82, 0xdf, 0x41, + 0xcd, 0x10, 0x28, 0x07, 0x77, 0xc8, 0x68, 0x2c, 0xc8, 0x92, 0x8d, 0xf0, 0x48, 0x1a, 0x0e, 0x64, + 0x3c, 0x27, 0x84, 0xb9, 0x24, 0xd7, 0xac, 0x09, 0x0c, 0x26, 0xc9, 0x29, 0x90, 0x86, 0x6d, 0xcd, + 0x0a, 0xe1, 0x28, 0x43, 0xbe, 0xe6, 0xb0, 0xd0, 0xe4, 0x6b, 0xa1, 0x21, 0x65, 0x11, 0x41, 0xb6, + 0xd7, 0xd2, 0x95, 0xa1, 0xfc, 0xb5, 0x28, 0x23, 0x7e, 0x1f, 0xad, 0xe9, 0xb2, 0xde, 0x08, 0xbc, + 0xd3, 0x34, 0x09, 0x62, 0x41, 0x9a, 0x2a, 0xf9, 0x65, 0x4b, 0xe9, 0x5e, 0x6e, 0xca, 0x30, 0x37, + 0xc2, 0xaa, 0x8e, 0xbb, 0xa8, 0xa9, 0x46, 0x18, 0x62, 0x3a, 0x08, 0x81, 0xfc, 0x6d, 0xdd, 0xcc, + 0xee, 0x58, 0x8c, 0xf6, 0x95, 0x21, 0xdf, 0x0a, 0x9a, 0x4b, 0xb8, 0x8f, 0xd4, 0xc0, 0xbb, 0x7e, + 0xc0, 0x15, 0xe3, 0x9f, 0xeb, 0xb6, 0xbd, 0x90, 0x8c, 0xbe, 0x76, 0xe4, 0x7b, 0x41, 0x0b, 0x2d, + 0x6f, 0x84, 0x0b, 0x2a, 0xc6, 0x9c, 0xfc, 0x37, 0xb7, 0x91, 0x27, 0xca, 0x50, 0x69, 0x44, 0x4b, + 0xf8, 0xb1, 0x6e, 0x04, 0x62, 0x11, 0x78, 0x54, 0x00, 0xf9, 0x57, 0x33, 0x5e, 0xad, 0x32, 0xb2, + 0xb3, 0xd8, 0x2d, 0x59, 0x33, 0x5a, 0x25, 0x1f, 0xef, 0x9b, 0xe3, 0x2d, 0xcf, 0xbb, 0x4b, 0x7d, + 0x9f, 0xfc, 0xb8, 0x34, 0x6f, 0x65, 0x1f, 0x70, 0x60, 0x5d, 0xdf, 0xaf, 0xac, 0xcc, 0x68, 0xf8, + 0x31, 0x5a, 0x2b, 0x30, 0x7a, 0xe4, 0xc9, 0x4f, 0x9a, 0x74, 0xd7, 0x4e, 0x32, 0x67, 0xc5, 0xc0, + 0x56, 0x69, 0x45, 0xae, 0xb6, 0x35, 0x04, 0x41, 0x7e, 0xbe, 0xb4, 0xad, 0x03, 0x10, 0x33, 0x6d, + 0x1d, 0x80, 0xc0, 0x43, 0xf4, 0x62, 0x81, 0xf1, 0x46, 0xf2, 0x10, 0xba, 0x29, 0xe5, 0xfc, 0x69, + 0xc2, 0x7c, 0xf2, 0x8b, 0x46, 0xbe, 0x6e, 0x47, 0xf6, 0x94, 0xfb, 0xc8, 0x98, 0x33, 0xfa, 0x0b, + 0xd4, 0x1a, 0xc6, 0x1f, 0xa3, 0x8d, 0x52, 0xbf, 0xf2, 0xf4, 0xb8, 0x2c, 0x09, 0x81, 0x9c, 0xeb, + 0x1a, 0xf7, 0xe7, 0xb4, 0xad, 0x4e, 0x5e, 0x52, 0x4c, 0xcb, 0x4d, 0x3a, 0x1d, 0xc1, 0x9f, 0xa0, + 0x5b, 0x05, 0x59, 0x1f, 0x44, 0x8d, 0xfe, 0x55, 0xa3, 0x5f, 0xb1, 0xa3, 0xcd, 0x89, 0x2c, 0xb1, + 0x31, 0x9d, 0x09, 0xe1, 0x87, 0x68, 0xb5, 0x80, 0x87, 0x01, 0x17, 0xe4, 0x37, 0x4d, 0xbd, 0x63, + 0xa7, 0x3e, 0x0a, 0xb8, 0xa8, 0xcc, 0x51, 0x26, 0xe6, 0x24, 0xd9, 0x9a, 0x26, 0xfd, 0x3e, 0x97, + 0x24, 0x4b, 0xcf, 0x90, 0x32, 0x31, 0x7f, 0xf5, 0x8a, 0x24, 0x27, 0xf2, 0x9b, 0xc6, 0xbc, 0x57, + 0x2f, 0x73, 0xa6, 0x27, 0xd2, 0x68, 0xf9, 0x44, 0x2a, 0x8c, 0x99, 0xc8, 0x6f, 0x1b, 0xf3, 0x26, + 0x52, 0x66, 0x59, 0x26, 0xb2, 0x90, 0xab, 0x6d, 0xc9, 0x89, 0xfc, 0xee, 0xd2, 0xb6, 0xa6, 0x27, + 0xd2, 0x68, 0xf8, 0x33, 0xd4, 0x2a, 0x61, 0xd4, 0xa0, 0xa4, 0xc0, 0xa2, 0x80, 0xab, 0xff, 0xd6, + 0xef, 0x35, 0xf3, 0x8d, 0x39, 0x4c, 0x69, 0x3f, 0xca, 0xdd, 0x19, 0xff, 0x36, 0xb5, 0xc7, 0x71, + 0x84, 0x36, 0x8b, 0x5a, 0x66, 0x74, 0x4a, 0xc5, 0x7e, 0xd0, 0xc5, 0xde, 0xb4, 0x17, 0xd3, 0x53, + 0x32, 0x5b, 0x8d, 0xd0, 0x39, 0x06, 0xfc, 0x11, 0x5a, 0xf7, 0xc2, 0x31, 0x17, 0xc0, 0xdc, 0x09, + 0x30, 0x29, 0xb9, 0x1c, 0x04, 0x79, 0x86, 0xcc, 0x11, 0x28, 0x5f, 0x52, 0x76, 0x7b, 0xda, 0xf9, + 0xa1, 0x36, 0x3e, 0x29, 0x76, 0xeb, 0xa6, 0x37, 0x1d, 0xc1, 0x14, 0xdd, 0xce, 0xc0, 0x9a, 0xe1, + 0x52, 0x21, 0x98, 0x82, 0x7f, 0x89, 0xcc, 0xe7, 0xcf, 0x06, 0x7f, 0x4f, 0x69, 0x5d, 0x21, 0x58, + 0x89, 0xbf, 0xe1, 0x59, 0x82, 0xf8, 0x18, 0x61, 0x3f, 0x79, 0x1a, 0x0f, 0x19, 0xf5, 0xc1, 0x0d, + 0xe2, 0x93, 0x44, 0xd1, 0xbf, 0xd2, 0xf4, 0x7b, 0x55, 0x7a, 0x3f, 0x33, 0x1e, 0xc6, 0x27, 0x49, + 0x89, 0xbc, 0xe6, 0x4f, 0x05, 0xb6, 0x6f, 0xa0, 0x95, 0xfd, 0x28, 0x15, 0x5f, 0x38, 0xc0, 0xd3, + 0x24, 0xe6, 0xb0, 0x9d, 0xa2, 0xcd, 0x4b, 0x3e, 0xcd, 0x18, 0xa3, 0x05, 0x75, 0x07, 0xab, 0xa9, + 0x3b, 0x98, 0xfa, 0x2d, 0xef, 0x66, 0xf9, 0x17, 0xcb, 0xdc, 0xcd, 0xb2, 0x67, 0x7c, 0x07, 0x2d, + 0xf3, 0x20, 0x4a, 0x43, 0x70, 0x45, 0x72, 0x0a, 0xfa, 0x6a, 0xd6, 0x70, 0x9a, 0x5a, 0x3b, 0x96, + 0xd2, 0xbb, 0x1b, 0xcf, 0xff, 0x6c, 0x5f, 0x79, 0x7e, 0xd1, 0xae, 0x9d, 0x5f, 0xb4, 0x6b, 0x7f, + 0x5c, 0xb4, 0x6b, 0x5f, 0xff, 0xd5, 0xbe, 0x32, 0x58, 0x54, 0x17, 0xc3, 0x07, 0xff, 0x07, 0x00, + 0x00, 0xff, 0xff, 0x94, 0x6f, 0x64, 0x0a, 0x98, 0x0a, 0x00, 0x00, +} + func (m *RequestHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -113,33 +314,43 @@ func (m *RequestHeader) Marshal() (dAtA []byte, err error) { } func (m *RequestHeader) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.AuthRevision != 0 { + i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRevision)) + i-- + dAtA[i] = 0x18 } if len(m.Username) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Username) + copy(dAtA[i:], m.Username) i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Username))) - i += copy(dAtA[i:], m.Username) + i-- + dAtA[i] = 0x12 } - if m.AuthRevision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRevision)) + if m.ID != 0 { + i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -147,326 +358,445 @@ func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { } func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InternalRaftRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.V2 != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.V2.Size())) - n1, err := m.V2.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.DowngradeInfoSet != nil { + { + size, err := m.DowngradeInfoSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n1 - } - if m.Range != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Range.Size())) - n2, err := m.Range.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + i-- + dAtA[i] = 0x51 + i-- + dAtA[i] = 0xb2 + } + if m.ClusterMemberAttrSet != nil { + { + size, err := m.ClusterMemberAttrSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x51 + i-- + dAtA[i] = 0xaa + } + if m.ClusterVersionSet != nil { + { + size, err := m.ClusterVersionSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x51 + i-- + dAtA[i] = 0xa2 } - if m.Put != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Put.Size())) - n3, err := m.Put.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthRoleRevokePermission != nil { + { + size, err := m.AuthRoleRevokePermission.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x4b + i-- + dAtA[i] = 0xa2 } - if m.DeleteRange != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.DeleteRange.Size())) - n4, err := m.DeleteRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthRoleGrantPermission != nil { + { + size, err := m.AuthRoleGrantPermission.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x4b + i-- + dAtA[i] = 0x9a } - if m.Txn != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Txn.Size())) - n5, err := m.Txn.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthRoleGet != nil { + { + size, err := m.AuthRoleGet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x4b + i-- + dAtA[i] = 0x92 } - if m.Compaction != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Compaction.Size())) - n6, err := m.Compaction.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthRoleDelete != nil { + { + size, err := m.AuthRoleDelete.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x4b + i-- + dAtA[i] = 0x8a } - if m.LeaseGrant != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.LeaseGrant.Size())) - n7, err := m.LeaseGrant.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthRoleAdd != nil { + { + size, err := m.AuthRoleAdd.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x4b + i-- + dAtA[i] = 0x82 } - if m.LeaseRevoke != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.LeaseRevoke.Size())) - n8, err := m.LeaseRevoke.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthRoleList != nil { + { + size, err := m.AuthRoleList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x45 + i-- + dAtA[i] = 0x9a } - if m.Alarm != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Alarm.Size())) - n9, err := m.Alarm.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthUserList != nil { + { + size, err := m.AuthUserList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x45 + i-- + dAtA[i] = 0x92 } - if m.LeaseCheckpoint != nil { - dAtA[i] = 0x5a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.LeaseCheckpoint.Size())) - n10, err := m.LeaseCheckpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthUserRevokeRole != nil { + { + size, err := m.AuthUserRevokeRole.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x45 + i-- + dAtA[i] = 0x8a } - if m.Header != nil { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x6 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Header.Size())) - n11, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthUserGrantRole != nil { + { + size, err := m.AuthUserGrantRole.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x45 + i-- + dAtA[i] = 0x82 } - if m.AuthEnable != nil { - dAtA[i] = 0xc2 - i++ - dAtA[i] = 0x3e - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthEnable.Size())) - n12, err := m.AuthEnable.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthUserChangePassword != nil { + { + size, err := m.AuthUserChangePassword.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x44 + i-- + dAtA[i] = 0xfa } - if m.AuthDisable != nil { - dAtA[i] = 0x9a - i++ - dAtA[i] = 0x3f - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthDisable.Size())) - n13, err := m.AuthDisable.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthUserGet != nil { + { + size, err := m.AuthUserGet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x44 + i-- + dAtA[i] = 0xf2 } - if m.Authenticate != nil { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x3f - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Authenticate.Size())) - n14, err := m.Authenticate.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthUserDelete != nil { + { + size, err := m.AuthUserDelete.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x44 + i-- + dAtA[i] = 0xea } if m.AuthUserAdd != nil { - dAtA[i] = 0xe2 - i++ + { + size, err := m.AuthUserAdd.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x44 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserAdd.Size())) - n15, err := m.AuthUserAdd.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + i-- + dAtA[i] = 0xe2 + } + if m.AuthStatus != nil { + { + size, err := m.AuthStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0x3f + i-- + dAtA[i] = 0xaa } - if m.AuthUserDelete != nil { - dAtA[i] = 0xea - i++ - dAtA[i] = 0x44 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserDelete.Size())) - n16, err := m.AuthUserDelete.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Authenticate != nil { + { + size, err := m.Authenticate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n16 + i-- + dAtA[i] = 0x3f + i-- + dAtA[i] = 0xa2 } - if m.AuthUserGet != nil { - dAtA[i] = 0xf2 - i++ - dAtA[i] = 0x44 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGet.Size())) - n17, err := m.AuthUserGet.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthDisable != nil { + { + size, err := m.AuthDisable.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0x3f + i-- + dAtA[i] = 0x9a } - if m.AuthUserChangePassword != nil { - dAtA[i] = 0xfa - i++ - dAtA[i] = 0x44 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserChangePassword.Size())) - n18, err := m.AuthUserChangePassword.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AuthEnable != nil { + { + size, err := m.AuthEnable.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0x3e + i-- + dAtA[i] = 0xc2 } - if m.AuthUserGrantRole != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x45 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGrantRole.Size())) - n19, err := m.AuthUserGrantRole.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0x6 + i-- + dAtA[i] = 0xa2 } - if m.AuthUserRevokeRole != nil { - dAtA[i] = 0x8a - i++ - dAtA[i] = 0x45 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserRevokeRole.Size())) - n20, err := m.AuthUserRevokeRole.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.LeaseCheckpoint != nil { + { + size, err := m.LeaseCheckpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n20 + i-- + dAtA[i] = 0x5a } - if m.AuthUserList != nil { - dAtA[i] = 0x92 - i++ - dAtA[i] = 0x45 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserList.Size())) - n21, err := m.AuthUserList.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Alarm != nil { + { + size, err := m.Alarm.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n21 + i-- + dAtA[i] = 0x52 } - if m.AuthRoleList != nil { - dAtA[i] = 0x9a - i++ - dAtA[i] = 0x45 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleList.Size())) - n22, err := m.AuthRoleList.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.LeaseRevoke != nil { + { + size, err := m.LeaseRevoke.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n22 + i-- + dAtA[i] = 0x4a } - if m.AuthRoleAdd != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleAdd.Size())) - n23, err := m.AuthRoleAdd.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.LeaseGrant != nil { + { + size, err := m.LeaseGrant.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n23 + i-- + dAtA[i] = 0x42 } - if m.AuthRoleDelete != nil { - dAtA[i] = 0x8a - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleDelete.Size())) - n24, err := m.AuthRoleDelete.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Compaction != nil { + { + size, err := m.Compaction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n24 + i-- + dAtA[i] = 0x3a } - if m.AuthRoleGet != nil { - dAtA[i] = 0x92 - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGet.Size())) - n25, err := m.AuthRoleGet.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Txn != nil { + { + size, err := m.Txn.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n25 + i-- + dAtA[i] = 0x32 } - if m.AuthRoleGrantPermission != nil { - dAtA[i] = 0x9a - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGrantPermission.Size())) - n26, err := m.AuthRoleGrantPermission.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.DeleteRange != nil { + { + size, err := m.DeleteRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Put != nil { + { + size, err := m.Put.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Range != nil { + { + size, err := m.Range.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n26 + i-- + dAtA[i] = 0x1a } - if m.AuthRoleRevokePermission != nil { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleRevokePermission.Size())) - n27, err := m.AuthRoleRevokePermission.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.V2 != nil { + { + size, err := m.V2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) } - i += n27 + i-- + dAtA[i] = 0x12 + } + if m.ID != 0 { + i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *EmptyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -474,17 +804,26 @@ func (m *EmptyResponse) Marshal() (dAtA []byte, err error) { } func (m *EmptyResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EmptyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *InternalAuthenticateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -492,41 +831,58 @@ func (m *InternalAuthenticateRequest) Marshal() (dAtA []byte, err error) { } func (m *InternalAuthenticateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InternalAuthenticateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.SimpleToken) > 0 { + i -= len(m.SimpleToken) + copy(dAtA[i:], m.SimpleToken) + i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.SimpleToken))) + i-- + dAtA[i] = 0x1a } if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Password) + copy(dAtA[i:], m.Password) i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) + i-- + dAtA[i] = 0x12 } - if len(m.SimpleToken) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.SimpleToken))) - i += copy(dAtA[i:], m.SimpleToken) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintRaftInternal(dAtA []byte, offset int, v uint64) int { + offset -= sovRaftInternal(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *RequestHeader) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { @@ -539,10 +895,16 @@ func (m *RequestHeader) Size() (n int) { if m.AuthRevision != 0 { n += 1 + sovRaftInternal(uint64(m.AuthRevision)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *InternalRaftRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { @@ -604,6 +966,10 @@ func (m *InternalRaftRequest) Size() (n int) { l = m.Authenticate.Size() n += 2 + l + sovRaftInternal(uint64(l)) } + if m.AuthStatus != nil { + l = m.AuthStatus.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } if m.AuthUserAdd != nil { l = m.AuthUserAdd.Size() n += 2 + l + sovRaftInternal(uint64(l)) @@ -656,16 +1022,40 @@ func (m *InternalRaftRequest) Size() (n int) { l = m.AuthRoleRevokePermission.Size() n += 2 + l + sovRaftInternal(uint64(l)) } + if m.ClusterVersionSet != nil { + l = m.ClusterVersionSet.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.ClusterMemberAttrSet != nil { + l = m.ClusterMemberAttrSet.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.DowngradeInfoSet != nil { + l = m.DowngradeInfoSet.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *EmptyResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *InternalAuthenticateRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -680,18 +1070,14 @@ func (m *InternalAuthenticateRequest) Size() (n int) { if l > 0 { n += 1 + l + sovRaftInternal(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func sovRaftInternal(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozRaftInternal(x uint64) (n int) { return sovRaftInternal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -711,7 +1097,7 @@ func (m *RequestHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -739,7 +1125,7 @@ func (m *RequestHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.ID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -758,7 +1144,7 @@ func (m *RequestHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -768,6 +1154,9 @@ func (m *RequestHeader) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -787,7 +1176,7 @@ func (m *RequestHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AuthRevision |= (uint64(b) & 0x7F) << shift + m.AuthRevision |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -798,12 +1187,13 @@ func (m *RequestHeader) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaftInternal } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -828,7 +1218,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -856,7 +1246,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.ID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -875,7 +1265,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -884,6 +1274,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -908,7 +1301,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -917,6 +1310,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -941,7 +1337,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -950,6 +1346,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -974,7 +1373,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -983,6 +1382,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1007,7 +1409,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1016,6 +1418,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1040,7 +1445,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1049,6 +1454,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1073,7 +1481,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1082,6 +1490,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1106,7 +1517,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1115,6 +1526,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1139,7 +1553,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1148,6 +1562,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1172,7 +1589,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1181,6 +1598,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1205,7 +1625,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1214,6 +1634,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1238,7 +1661,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1247,6 +1670,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1271,7 +1697,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1280,6 +1706,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1304,7 +1733,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1313,6 +1742,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1323,6 +1755,42 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 1013: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthStatus == nil { + m.AuthStatus = &AuthStatusRequest{} + } + if err := m.AuthStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 1100: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthUserAdd", wireType) @@ -1337,7 +1805,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1346,6 +1814,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1370,7 +1841,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1379,6 +1850,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1403,7 +1877,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1412,6 +1886,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1436,7 +1913,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1445,6 +1922,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1469,7 +1949,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1478,6 +1958,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1502,7 +1985,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1511,6 +1994,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1535,7 +2021,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1544,6 +2030,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1568,7 +2057,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1577,6 +2066,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1601,7 +2093,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1610,6 +2102,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1634,7 +2129,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1643,6 +2138,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1667,7 +2165,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1676,6 +2174,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1700,7 +2201,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1709,6 +2210,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1733,7 +2237,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1742,6 +2246,9 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1752,18 +2259,127 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 1300: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterVersionSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClusterVersionSet == nil { + m.ClusterVersionSet = &membershippb.ClusterVersionSetRequest{} + } + if err := m.ClusterVersionSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1301: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterMemberAttrSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClusterMemberAttrSet == nil { + m.ClusterMemberAttrSet = &membershippb.ClusterMemberAttrSetRequest{} + } + if err := m.ClusterMemberAttrSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1302: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DowngradeInfoSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DowngradeInfoSet == nil { + m.DowngradeInfoSet = &membershippb.DowngradeInfoSetRequest{} + } + if err := m.DowngradeInfoSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRaftInternal(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaftInternal } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1788,7 +2404,7 @@ func (m *EmptyResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1808,12 +2424,13 @@ func (m *EmptyResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaftInternal } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1838,7 +2455,7 @@ func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1866,7 +2483,7 @@ func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1876,6 +2493,9 @@ func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1895,7 +2515,7 @@ func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1905,6 +2525,9 @@ func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1924,7 +2547,7 @@ func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1934,6 +2557,9 @@ func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1945,12 +2571,13 @@ func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaftInternal } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1963,6 +2590,7 @@ func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { func skipRaftInternal(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1994,10 +2622,8 @@ func skipRaftInternal(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2014,114 +2640,34 @@ func skipRaftInternal(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthRaftInternal } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRaftInternal(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRaftInternal + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthRaftInternal + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthRaftInternal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRaftInternal = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthRaftInternal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRaftInternal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRaftInternal = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("raft_internal.proto", fileDescriptorRaftInternal) } - -var fileDescriptorRaftInternal = []byte{ - // 867 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0xcb, 0x52, 0x33, 0x45, - 0x14, 0xc7, 0x49, 0xb8, 0xa6, 0x13, 0x2e, 0x36, 0xa0, 0x6d, 0xa8, 0x8a, 0x10, 0xbc, 0xe0, 0x0d, - 0xad, 0xf0, 0x00, 0x1a, 0x13, 0x0a, 0xa8, 0xa2, 0x90, 0x9a, 0xc2, 0x2a, 0xab, 0x5c, 0x8c, 0xcd, - 0xcc, 0x21, 0x19, 0x99, 0xcc, 0x8c, 0x3d, 0x9d, 0x88, 0x6f, 0xe2, 0x63, 0x78, 0xdb, 0xbb, 0x65, - 0xe1, 0x05, 0xf5, 0x05, 0x14, 0x37, 0xee, 0xbf, 0xef, 0x01, 0xbe, 0xea, 0xcb, 0xf4, 0x64, 0x92, - 0x0e, 0xbb, 0xc9, 0x39, 0xff, 0xf3, 0xfb, 0x9f, 0x99, 0x3e, 0x07, 0x1a, 0x6d, 0x32, 0x7a, 0xc3, - 0xdd, 0x20, 0xe2, 0xc0, 0x22, 0x1a, 0x1e, 0x26, 0x2c, 0xe6, 0x31, 0xae, 0x01, 0xf7, 0xfc, 0x14, - 0xd8, 0x08, 0x58, 0x72, 0x5d, 0xdf, 0xea, 0xc5, 0xbd, 0x58, 0x26, 0x3e, 0x10, 0x4f, 0x4a, 0x53, - 0xdf, 0xc8, 0x35, 0x3a, 0x52, 0x61, 0x89, 0xa7, 0x1e, 0x9b, 0x5f, 0xa2, 0x55, 0x07, 0xbe, 0x1e, - 0x42, 0xca, 0x4f, 0x81, 0xfa, 0xc0, 0xf0, 0x1a, 0x2a, 0x9f, 0x75, 0x49, 0x69, 0xb7, 0x74, 0xb0, - 0xe0, 0x94, 0xcf, 0xba, 0xb8, 0x8e, 0x56, 0x86, 0xa9, 0xb0, 0x1c, 0x00, 0x29, 0xef, 0x96, 0x0e, - 0x2a, 0x8e, 0xf9, 0x8d, 0xf7, 0xd1, 0x2a, 0x1d, 0xf2, 0xbe, 0xcb, 0x60, 0x14, 0xa4, 0x41, 0x1c, - 0x91, 0x79, 0x59, 0x56, 0x13, 0x41, 0x47, 0xc7, 0x9a, 0xbf, 0xac, 0xa3, 0xcd, 0x33, 0xdd, 0xb5, - 0x43, 0x6f, 0xb8, 0xb6, 0x9b, 0x32, 0x7a, 0x03, 0x95, 0x47, 0x2d, 0x69, 0x51, 0x6d, 0x6d, 0x1f, - 0x8e, 0xbf, 0xd7, 0xa1, 0x2e, 0x71, 0xca, 0xa3, 0x16, 0xfe, 0x10, 0x2d, 0x32, 0x1a, 0xf5, 0x40, - 0x7a, 0x55, 0x5b, 0xf5, 0x09, 0xa5, 0x48, 0x65, 0x72, 0x25, 0xc4, 0xef, 0xa0, 0xf9, 0x64, 0xc8, - 0xc9, 0x82, 0xd4, 0x93, 0xa2, 0xfe, 0x72, 0x98, 0xf5, 0xe3, 0x08, 0x11, 0xee, 0xa0, 0x9a, 0x0f, - 0x21, 0x70, 0x70, 0x95, 0xc9, 0xa2, 0x2c, 0xda, 0x2d, 0x16, 0x75, 0xa5, 0xa2, 0x60, 0x55, 0xf5, - 0xf3, 0x98, 0x30, 0xe4, 0x77, 0x11, 0x59, 0xb2, 0x19, 0x5e, 0xdd, 0x45, 0xc6, 0x90, 0xdf, 0x45, - 0xf8, 0x23, 0x84, 0xbc, 0x78, 0x90, 0x50, 0x8f, 0x8b, 0xef, 0xb7, 0x2c, 0x4b, 0x5e, 0x2b, 0x96, - 0x74, 0x4c, 0x3e, 0xab, 0x1c, 0x2b, 0xc1, 0x1f, 0xa3, 0x6a, 0x08, 0x34, 0x05, 0xb7, 0xc7, 0x68, - 0xc4, 0xc9, 0x8a, 0x8d, 0x70, 0x2e, 0x04, 0x27, 0x22, 0x6f, 0x08, 0xa1, 0x09, 0x89, 0x77, 0x56, - 0x04, 0x06, 0xa3, 0xf8, 0x16, 0x48, 0xc5, 0xf6, 0xce, 0x12, 0xe1, 0x48, 0x81, 0x79, 0xe7, 0x30, - 0x8f, 0x89, 0x63, 0xa1, 0x21, 0x65, 0x03, 0x82, 0x6c, 0xc7, 0xd2, 0x16, 0x29, 0x73, 0x2c, 0x52, - 0x88, 0x3f, 0x45, 0x1b, 0xca, 0xd6, 0xeb, 0x83, 0x77, 0x9b, 0xc4, 0x41, 0xc4, 0x49, 0x55, 0x16, - 0xbf, 0x6e, 0xb1, 0xee, 0x18, 0x51, 0x86, 0x59, 0x0f, 0x8b, 0x71, 0x7c, 0x84, 0x96, 0xfa, 0x72, - 0x86, 0x89, 0x2f, 0x31, 0x3b, 0xd6, 0x21, 0x52, 0x63, 0xee, 0x68, 0x29, 0x6e, 0xa3, 0xaa, 0x1c, - 0x61, 0x88, 0xe8, 0x75, 0x08, 0xe4, 0x7f, 0xeb, 0x09, 0xb4, 0x87, 0xbc, 0x7f, 0x2c, 0x05, 0xe6, - 0xfb, 0x51, 0x13, 0xc2, 0x5d, 0x24, 0x07, 0xde, 0xf5, 0x83, 0x54, 0x32, 0x9e, 0x2d, 0xdb, 0x3e, - 0xa0, 0x60, 0x74, 0x95, 0xc2, 0x7c, 0x40, 0x9a, 0xc7, 0xf0, 0x85, 0xa2, 0x40, 0xc4, 0x03, 0x8f, - 0x72, 0x20, 0xcf, 0x15, 0xe5, 0xed, 0x22, 0x25, 0x5b, 0xa4, 0xf6, 0x98, 0x34, 0xc3, 0x15, 0xea, - 0xf1, 0xb1, 0xde, 0x4d, 0xb1, 0xac, 0x2e, 0xf5, 0x7d, 0xf2, 0xeb, 0xca, 0xac, 0xb6, 0x3e, 0x4b, - 0x81, 0xb5, 0x7d, 0xbf, 0xd0, 0x96, 0x8e, 0xe1, 0x0b, 0xb4, 0x91, 0x63, 0xd4, 0x90, 0x93, 0xdf, - 0x14, 0x69, 0xdf, 0x4e, 0xd2, 0xdb, 0xa1, 0x61, 0x6b, 0xb4, 0x10, 0x2e, 0xb6, 0xd5, 0x03, 0x4e, - 0x7e, 0x7f, 0xb2, 0xad, 0x13, 0xe0, 0x53, 0x6d, 0x9d, 0x00, 0xc7, 0x3d, 0xf4, 0x6a, 0x8e, 0xf1, - 0xfa, 0x62, 0xed, 0xdc, 0x84, 0xa6, 0xe9, 0x37, 0x31, 0xf3, 0xc9, 0x1f, 0x0a, 0xf9, 0xae, 0x1d, - 0xd9, 0x91, 0xea, 0x4b, 0x2d, 0xce, 0xe8, 0x2f, 0x53, 0x6b, 0x1a, 0x7f, 0x8e, 0xb6, 0xc6, 0xfa, - 0x15, 0xfb, 0xe2, 0xb2, 0x38, 0x04, 0xf2, 0xa0, 0x3c, 0xde, 0x9c, 0xd1, 0xb6, 0xdc, 0xb5, 0x38, - 0x3f, 0xea, 0x97, 0xe8, 0x64, 0x06, 0x7f, 0x81, 0xb6, 0x73, 0xb2, 0x5a, 0x3d, 0x85, 0xfe, 0x53, - 0xa1, 0xdf, 0xb2, 0xa3, 0xf5, 0x0e, 0x8e, 0xb1, 0x31, 0x9d, 0x4a, 0xe1, 0x53, 0xb4, 0x96, 0xc3, - 0xc3, 0x20, 0xe5, 0xe4, 0x2f, 0x45, 0xdd, 0xb3, 0x53, 0xcf, 0x83, 0x94, 0x17, 0xe6, 0x28, 0x0b, - 0x1a, 0x92, 0x68, 0x4d, 0x91, 0xfe, 0x9e, 0x49, 0x12, 0xd6, 0x53, 0xa4, 0x2c, 0x68, 0x8e, 0x5e, - 0x92, 0xc4, 0x44, 0x7e, 0x5f, 0x99, 0x75, 0xf4, 0xa2, 0x66, 0x72, 0x22, 0x75, 0xcc, 0x4c, 0xa4, - 0xc4, 0xe8, 0x89, 0xfc, 0xa1, 0x32, 0x6b, 0x22, 0x45, 0x95, 0x65, 0x22, 0xf3, 0x70, 0xb1, 0x2d, - 0x31, 0x91, 0x3f, 0x3e, 0xd9, 0xd6, 0xe4, 0x44, 0xea, 0x18, 0xfe, 0x0a, 0xd5, 0xc7, 0x30, 0x72, - 0x50, 0x12, 0x60, 0x83, 0x20, 0x95, 0xff, 0x18, 0x7f, 0x52, 0xcc, 0xf7, 0x66, 0x30, 0x85, 0xfc, - 0xd2, 0xa8, 0x33, 0xfe, 0x2b, 0xd4, 0x9e, 0xc7, 0x03, 0xb4, 0x93, 0x7b, 0xe9, 0xd1, 0x19, 0x33, - 0xfb, 0x59, 0x99, 0xbd, 0x6f, 0x37, 0x53, 0x53, 0x32, 0xed, 0x46, 0xe8, 0x0c, 0x41, 0x73, 0x1d, - 0xad, 0x1e, 0x0f, 0x12, 0xfe, 0xad, 0x03, 0x69, 0x12, 0x47, 0x29, 0x34, 0x13, 0xb4, 0xf3, 0xc4, - 0x1f, 0x22, 0x8c, 0xd1, 0x82, 0xbc, 0x2e, 0x94, 0xe4, 0x75, 0x41, 0x3e, 0x8b, 0x6b, 0x84, 0xd9, - 0x4f, 0x7d, 0x8d, 0xc8, 0x7e, 0xe3, 0x3d, 0x54, 0x4b, 0x83, 0x41, 0x12, 0x82, 0xcb, 0xe3, 0x5b, - 0x50, 0xb7, 0x88, 0x8a, 0x53, 0x55, 0xb1, 0x2b, 0x11, 0xfa, 0x64, 0xeb, 0xfe, 0xdf, 0xc6, 0xdc, - 0xfd, 0x63, 0xa3, 0xf4, 0xf0, 0xd8, 0x28, 0xfd, 0xf3, 0xd8, 0x28, 0x7d, 0xf7, 0x5f, 0x63, 0xee, - 0x7a, 0x49, 0xde, 0x61, 0x8e, 0x5e, 0x04, 0x00, 0x00, 0xff, 0xff, 0xed, 0x36, 0xf0, 0x6f, 0x1b, - 0x09, 0x00, 0x00, -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/raft_internal.proto b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.proto similarity index 88% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/raft_internal.proto rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.proto index 7111f4572b21..68926e59f6c9 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/raft_internal.proto +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.proto @@ -4,6 +4,7 @@ package etcdserverpb; import "gogoproto/gogo.proto"; import "etcdserver.proto"; import "rpc.proto"; +import "etcd/api/membershippb/membership.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; @@ -41,6 +42,7 @@ message InternalRaftRequest { AuthEnableRequest auth_enable = 1000; AuthDisableRequest auth_disable = 1011; + AuthStatusRequest auth_status = 1013; InternalAuthenticateRequest authenticate = 1012; @@ -58,6 +60,10 @@ message InternalRaftRequest { AuthRoleGetRequest auth_role_get = 1202; AuthRoleGrantPermissionRequest auth_role_grant_permission = 1203; AuthRoleRevokePermissionRequest auth_role_revoke_permission = 1204; + + membershippb.ClusterVersionSetRequest cluster_version_set = 1300; + membershippb.ClusterMemberAttrSetRequest cluster_member_attr_set = 1301; + membershippb.DowngradeInfoSetRequest downgrade_info_set = 1302; } message EmptyResponse { diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/raft_internal_stringer.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal_stringer.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/raft_internal_stringer.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal_stringer.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/rpc.pb.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.pb.go similarity index 58% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/rpc.pb.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.pb.go index 6cbccc797c43..34c1824426e5 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/rpc.pb.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.pb.go @@ -4,23 +4,20 @@ package etcdserverpb import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - + context "context" + fmt "fmt" + io "io" math "math" + math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" - - mvccpb "go.etcd.io/etcd/mvcc/mvccpb" - - authpb "go.etcd.io/etcd/auth/authpb" - - context "golang.org/x/net/context" - + proto "github.com/golang/protobuf/proto" + authpb "go.etcd.io/etcd/api/v3/authpb" + mvccpb "go.etcd.io/etcd/api/v3/mvccpb" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" - - io "io" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" ) // Reference imports to suppress errors if they are not otherwise used. @@ -28,6 +25,12 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + type AlarmType int32 const ( @@ -41,6 +44,7 @@ var AlarmType_name = map[int32]string{ 1: "NOSPACE", 2: "CORRUPT", } + var AlarmType_value = map[string]int32{ "NONE": 0, "NOSPACE": 1, @@ -50,7 +54,10 @@ var AlarmType_value = map[string]int32{ func (x AlarmType) String() string { return proto.EnumName(AlarmType_name, int32(x)) } -func (AlarmType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{0} } + +func (AlarmType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{0} +} type RangeRequest_SortOrder int32 @@ -65,6 +72,7 @@ var RangeRequest_SortOrder_name = map[int32]string{ 1: "ASCEND", 2: "DESCEND", } + var RangeRequest_SortOrder_value = map[string]int32{ "NONE": 0, "ASCEND": 1, @@ -74,7 +82,10 @@ var RangeRequest_SortOrder_value = map[string]int32{ func (x RangeRequest_SortOrder) String() string { return proto.EnumName(RangeRequest_SortOrder_name, int32(x)) } -func (RangeRequest_SortOrder) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1, 0} } + +func (RangeRequest_SortOrder) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{1, 0} +} type RangeRequest_SortTarget int32 @@ -93,6 +104,7 @@ var RangeRequest_SortTarget_name = map[int32]string{ 3: "MOD", 4: "VALUE", } + var RangeRequest_SortTarget_value = map[string]int32{ "KEY": 0, "VERSION": 1, @@ -104,8 +116,9 @@ var RangeRequest_SortTarget_value = map[string]int32{ func (x RangeRequest_SortTarget) String() string { return proto.EnumName(RangeRequest_SortTarget_name, int32(x)) } + func (RangeRequest_SortTarget) EnumDescriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{1, 1} + return fileDescriptor_77a6da22d6a3feb1, []int{1, 1} } type Compare_CompareResult int32 @@ -123,6 +136,7 @@ var Compare_CompareResult_name = map[int32]string{ 2: "LESS", 3: "NOT_EQUAL", } + var Compare_CompareResult_value = map[string]int32{ "EQUAL": 0, "GREATER": 1, @@ -133,7 +147,10 @@ var Compare_CompareResult_value = map[string]int32{ func (x Compare_CompareResult) String() string { return proto.EnumName(Compare_CompareResult_name, int32(x)) } -func (Compare_CompareResult) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9, 0} } + +func (Compare_CompareResult) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{9, 0} +} type Compare_CompareTarget int32 @@ -152,6 +169,7 @@ var Compare_CompareTarget_name = map[int32]string{ 3: "VALUE", 4: "LEASE", } + var Compare_CompareTarget_value = map[string]int32{ "VERSION": 0, "CREATE": 1, @@ -163,7 +181,10 @@ var Compare_CompareTarget_value = map[string]int32{ func (x Compare_CompareTarget) String() string { return proto.EnumName(Compare_CompareTarget_name, int32(x)) } -func (Compare_CompareTarget) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9, 1} } + +func (Compare_CompareTarget) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{9, 1} +} type WatchCreateRequest_FilterType int32 @@ -178,6 +199,7 @@ var WatchCreateRequest_FilterType_name = map[int32]string{ 0: "NOPUT", 1: "NODELETE", } + var WatchCreateRequest_FilterType_value = map[string]int32{ "NOPUT": 0, "NODELETE": 1, @@ -186,8 +208,9 @@ var WatchCreateRequest_FilterType_value = map[string]int32{ func (x WatchCreateRequest_FilterType) String() string { return proto.EnumName(WatchCreateRequest_FilterType_name, int32(x)) } + func (WatchCreateRequest_FilterType) EnumDescriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{21, 0} + return fileDescriptor_77a6da22d6a3feb1, []int{21, 0} } type AlarmRequest_AlarmAction int32 @@ -203,6 +226,7 @@ var AlarmRequest_AlarmAction_name = map[int32]string{ 1: "ACTIVATE", 2: "DEACTIVATE", } + var AlarmRequest_AlarmAction_value = map[string]int32{ "GET": 0, "ACTIVATE": 1, @@ -212,8 +236,37 @@ var AlarmRequest_AlarmAction_value = map[string]int32{ func (x AlarmRequest_AlarmAction) String() string { return proto.EnumName(AlarmRequest_AlarmAction_name, int32(x)) } + func (AlarmRequest_AlarmAction) EnumDescriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{54, 0} + return fileDescriptor_77a6da22d6a3feb1, []int{54, 0} +} + +type DowngradeRequest_DowngradeAction int32 + +const ( + DowngradeRequest_VALIDATE DowngradeRequest_DowngradeAction = 0 + DowngradeRequest_ENABLE DowngradeRequest_DowngradeAction = 1 + DowngradeRequest_CANCEL DowngradeRequest_DowngradeAction = 2 +) + +var DowngradeRequest_DowngradeAction_name = map[int32]string{ + 0: "VALIDATE", + 1: "ENABLE", + 2: "CANCEL", +} + +var DowngradeRequest_DowngradeAction_value = map[string]int32{ + "VALIDATE": 0, + "ENABLE": 1, + "CANCEL": 2, +} + +func (x DowngradeRequest_DowngradeAction) String() string { + return proto.EnumName(DowngradeRequest_DowngradeAction_name, int32(x)) +} + +func (DowngradeRequest_DowngradeAction) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{57, 0} } type ResponseHeader struct { @@ -227,13 +280,44 @@ type ResponseHeader struct { // header.revision number. Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` // raft_term is the raft term when the request was applied. - RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,json=raftTerm,proto3" json:"raft_term,omitempty"` + RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,json=raftTerm,proto3" json:"raft_term,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResponseHeader) Reset() { *m = ResponseHeader{} } +func (m *ResponseHeader) String() string { return proto.CompactTextString(m) } +func (*ResponseHeader) ProtoMessage() {} +func (*ResponseHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{0} +} +func (m *ResponseHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseHeader.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ResponseHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseHeader.Merge(m, src) +} +func (m *ResponseHeader) XXX_Size() int { + return m.Size() +} +func (m *ResponseHeader) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseHeader.DiscardUnknown(m) } -func (m *ResponseHeader) Reset() { *m = ResponseHeader{} } -func (m *ResponseHeader) String() string { return proto.CompactTextString(m) } -func (*ResponseHeader) ProtoMessage() {} -func (*ResponseHeader) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{0} } +var xxx_messageInfo_ResponseHeader proto.InternalMessageInfo func (m *ResponseHeader) GetClusterId() uint64 { if m != nil { @@ -305,13 +389,44 @@ type RangeRequest struct { MinCreateRevision int64 `protobuf:"varint,12,opt,name=min_create_revision,json=minCreateRevision,proto3" json:"min_create_revision,omitempty"` // max_create_revision is the upper bound for returned key create revisions; all keys with // greater create revisions will be filtered away. - MaxCreateRevision int64 `protobuf:"varint,13,opt,name=max_create_revision,json=maxCreateRevision,proto3" json:"max_create_revision,omitempty"` + MaxCreateRevision int64 `protobuf:"varint,13,opt,name=max_create_revision,json=maxCreateRevision,proto3" json:"max_create_revision,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RangeRequest) Reset() { *m = RangeRequest{} } +func (m *RangeRequest) String() string { return proto.CompactTextString(m) } +func (*RangeRequest) ProtoMessage() {} +func (*RangeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{1} +} +func (m *RangeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RangeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RangeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RangeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RangeRequest.Merge(m, src) +} +func (m *RangeRequest) XXX_Size() int { + return m.Size() +} +func (m *RangeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RangeRequest.DiscardUnknown(m) } -func (m *RangeRequest) Reset() { *m = RangeRequest{} } -func (m *RangeRequest) String() string { return proto.CompactTextString(m) } -func (*RangeRequest) ProtoMessage() {} -func (*RangeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1} } +var xxx_messageInfo_RangeRequest proto.InternalMessageInfo func (m *RangeRequest) GetKey() []byte { if m != nil { @@ -405,20 +520,51 @@ func (m *RangeRequest) GetMaxCreateRevision() int64 { } type RangeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // kvs is the list of key-value pairs matched by the range request. // kvs is empty when count is requested. - Kvs []*mvccpb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"` + Kvs []*mvccpb.KeyValue `protobuf:"bytes,2,rep,name=kvs,proto3" json:"kvs,omitempty"` // more indicates if there are more keys to return in the requested range. More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"` // count is set to the number of keys within the range when requested. - Count int64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` + Count int64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RangeResponse) Reset() { *m = RangeResponse{} } +func (m *RangeResponse) String() string { return proto.CompactTextString(m) } +func (*RangeResponse) ProtoMessage() {} +func (*RangeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{2} +} +func (m *RangeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RangeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RangeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RangeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RangeResponse.Merge(m, src) +} +func (m *RangeResponse) XXX_Size() int { + return m.Size() +} +func (m *RangeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RangeResponse.DiscardUnknown(m) } -func (m *RangeResponse) Reset() { *m = RangeResponse{} } -func (m *RangeResponse) String() string { return proto.CompactTextString(m) } -func (*RangeResponse) ProtoMessage() {} -func (*RangeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{2} } +var xxx_messageInfo_RangeResponse proto.InternalMessageInfo func (m *RangeResponse) GetHeader() *ResponseHeader { if m != nil { @@ -464,13 +610,44 @@ type PutRequest struct { IgnoreValue bool `protobuf:"varint,5,opt,name=ignore_value,json=ignoreValue,proto3" json:"ignore_value,omitempty"` // If ignore_lease is set, etcd updates the key using its current lease. // Returns an error if the key does not exist. - IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,json=ignoreLease,proto3" json:"ignore_lease,omitempty"` + IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,json=ignoreLease,proto3" json:"ignore_lease,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PutRequest) Reset() { *m = PutRequest{} } +func (m *PutRequest) String() string { return proto.CompactTextString(m) } +func (*PutRequest) ProtoMessage() {} +func (*PutRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{3} +} +func (m *PutRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PutRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PutRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PutRequest.Merge(m, src) +} +func (m *PutRequest) XXX_Size() int { + return m.Size() +} +func (m *PutRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PutRequest.DiscardUnknown(m) } -func (m *PutRequest) Reset() { *m = PutRequest{} } -func (m *PutRequest) String() string { return proto.CompactTextString(m) } -func (*PutRequest) ProtoMessage() {} -func (*PutRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{3} } +var xxx_messageInfo_PutRequest proto.InternalMessageInfo func (m *PutRequest) GetKey() []byte { if m != nil { @@ -515,15 +692,46 @@ func (m *PutRequest) GetIgnoreLease() bool { } type PutResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // if prev_kv is set in the request, the previous key-value pair will be returned. - PrevKv *mvccpb.KeyValue `protobuf:"bytes,2,opt,name=prev_kv,json=prevKv" json:"prev_kv,omitempty"` + PrevKv *mvccpb.KeyValue `protobuf:"bytes,2,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PutResponse) Reset() { *m = PutResponse{} } +func (m *PutResponse) String() string { return proto.CompactTextString(m) } +func (*PutResponse) ProtoMessage() {} +func (*PutResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{4} +} +func (m *PutResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PutResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PutResponse.Merge(m, src) +} +func (m *PutResponse) XXX_Size() int { + return m.Size() +} +func (m *PutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PutResponse.DiscardUnknown(m) } -func (m *PutResponse) Reset() { *m = PutResponse{} } -func (m *PutResponse) String() string { return proto.CompactTextString(m) } -func (*PutResponse) ProtoMessage() {} -func (*PutResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{4} } +var xxx_messageInfo_PutResponse proto.InternalMessageInfo func (m *PutResponse) GetHeader() *ResponseHeader { if m != nil { @@ -550,13 +758,44 @@ type DeleteRangeRequest struct { RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` // If prev_kv is set, etcd gets the previous key-value pairs before deleting it. // The previous key-value pairs will be returned in the delete response. - PrevKv bool `protobuf:"varint,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` + PrevKv bool `protobuf:"varint,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} } +func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteRangeRequest) ProtoMessage() {} +func (*DeleteRangeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{5} +} +func (m *DeleteRangeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteRangeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteRangeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteRangeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteRangeRequest.Merge(m, src) +} +func (m *DeleteRangeRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteRangeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteRangeRequest.DiscardUnknown(m) } -func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} } -func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRangeRequest) ProtoMessage() {} -func (*DeleteRangeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{5} } +var xxx_messageInfo_DeleteRangeRequest proto.InternalMessageInfo func (m *DeleteRangeRequest) GetKey() []byte { if m != nil { @@ -580,17 +819,48 @@ func (m *DeleteRangeRequest) GetPrevKv() bool { } type DeleteRangeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // deleted is the number of keys deleted by the delete range request. Deleted int64 `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` // if prev_kv is set in the request, the previous key-value pairs will be returned. - PrevKvs []*mvccpb.KeyValue `protobuf:"bytes,3,rep,name=prev_kvs,json=prevKvs" json:"prev_kvs,omitempty"` + PrevKvs []*mvccpb.KeyValue `protobuf:"bytes,3,rep,name=prev_kvs,json=prevKvs,proto3" json:"prev_kvs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} } +func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteRangeResponse) ProtoMessage() {} +func (*DeleteRangeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{6} +} +func (m *DeleteRangeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteRangeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteRangeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteRangeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteRangeResponse.Merge(m, src) +} +func (m *DeleteRangeResponse) XXX_Size() int { + return m.Size() +} +func (m *DeleteRangeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteRangeResponse.DiscardUnknown(m) } -func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} } -func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteRangeResponse) ProtoMessage() {} -func (*DeleteRangeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{6} } +var xxx_messageInfo_DeleteRangeResponse proto.InternalMessageInfo func (m *DeleteRangeResponse) GetHeader() *ResponseHeader { if m != nil { @@ -621,13 +891,44 @@ type RequestOp struct { // *RequestOp_RequestPut // *RequestOp_RequestDeleteRange // *RequestOp_RequestTxn - Request isRequestOp_Request `protobuf_oneof:"request"` + Request isRequestOp_Request `protobuf_oneof:"request"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RequestOp) Reset() { *m = RequestOp{} } +func (m *RequestOp) String() string { return proto.CompactTextString(m) } +func (*RequestOp) ProtoMessage() {} +func (*RequestOp) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{7} +} +func (m *RequestOp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestOp.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RequestOp) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestOp.Merge(m, src) +} +func (m *RequestOp) XXX_Size() int { + return m.Size() +} +func (m *RequestOp) XXX_DiscardUnknown() { + xxx_messageInfo_RequestOp.DiscardUnknown(m) } -func (m *RequestOp) Reset() { *m = RequestOp{} } -func (m *RequestOp) String() string { return proto.CompactTextString(m) } -func (*RequestOp) ProtoMessage() {} -func (*RequestOp) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{7} } +var xxx_messageInfo_RequestOp proto.InternalMessageInfo type isRequestOp_Request interface { isRequestOp_Request() @@ -636,16 +937,16 @@ type isRequestOp_Request interface { } type RequestOp_RequestRange struct { - RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range,json=requestRange,oneof"` + RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range,json=requestRange,proto3,oneof" json:"request_range,omitempty"` } type RequestOp_RequestPut struct { - RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put,json=requestPut,oneof"` + RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put,json=requestPut,proto3,oneof" json:"request_put,omitempty"` } type RequestOp_RequestDeleteRange struct { - RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range,json=requestDeleteRange,oneof"` + RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range,json=requestDeleteRange,proto3,oneof" json:"request_delete_range,omitempty"` } type RequestOp_RequestTxn struct { - RequestTxn *TxnRequest `protobuf:"bytes,4,opt,name=request_txn,json=requestTxn,oneof"` + RequestTxn *TxnRequest `protobuf:"bytes,4,opt,name=request_txn,json=requestTxn,proto3,oneof" json:"request_txn,omitempty"` } func (*RequestOp_RequestRange) isRequestOp_Request() {} @@ -688,9 +989,9 @@ func (m *RequestOp) GetRequestTxn() *TxnRequest { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*RequestOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _RequestOp_OneofMarshaler, _RequestOp_OneofUnmarshaler, _RequestOp_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*RequestOp) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*RequestOp_RequestRange)(nil), (*RequestOp_RequestPut)(nil), (*RequestOp_RequestDeleteRange)(nil), @@ -698,108 +999,6 @@ func (*RequestOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) err } } -func _RequestOp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*RequestOp) - // request - switch x := m.Request.(type) { - case *RequestOp_RequestRange: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.RequestRange); err != nil { - return err - } - case *RequestOp_RequestPut: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.RequestPut); err != nil { - return err - } - case *RequestOp_RequestDeleteRange: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.RequestDeleteRange); err != nil { - return err - } - case *RequestOp_RequestTxn: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.RequestTxn); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("RequestOp.Request has unexpected type %T", x) - } - return nil -} - -func _RequestOp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*RequestOp) - switch tag { - case 1: // request.request_range - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(RangeRequest) - err := b.DecodeMessage(msg) - m.Request = &RequestOp_RequestRange{msg} - return true, err - case 2: // request.request_put - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(PutRequest) - err := b.DecodeMessage(msg) - m.Request = &RequestOp_RequestPut{msg} - return true, err - case 3: // request.request_delete_range - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(DeleteRangeRequest) - err := b.DecodeMessage(msg) - m.Request = &RequestOp_RequestDeleteRange{msg} - return true, err - case 4: // request.request_txn - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(TxnRequest) - err := b.DecodeMessage(msg) - m.Request = &RequestOp_RequestTxn{msg} - return true, err - default: - return false, nil - } -} - -func _RequestOp_OneofSizer(msg proto.Message) (n int) { - m := msg.(*RequestOp) - // request - switch x := m.Request.(type) { - case *RequestOp_RequestRange: - s := proto.Size(x.RequestRange) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *RequestOp_RequestPut: - s := proto.Size(x.RequestPut) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *RequestOp_RequestDeleteRange: - s := proto.Size(x.RequestDeleteRange) - n += proto.SizeVarint(3<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *RequestOp_RequestTxn: - s := proto.Size(x.RequestTxn) - n += proto.SizeVarint(4<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type ResponseOp struct { // response is a union of response types returned by a transaction. // @@ -808,13 +1007,44 @@ type ResponseOp struct { // *ResponseOp_ResponsePut // *ResponseOp_ResponseDeleteRange // *ResponseOp_ResponseTxn - Response isResponseOp_Response `protobuf_oneof:"response"` + Response isResponseOp_Response `protobuf_oneof:"response"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResponseOp) Reset() { *m = ResponseOp{} } +func (m *ResponseOp) String() string { return proto.CompactTextString(m) } +func (*ResponseOp) ProtoMessage() {} +func (*ResponseOp) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{8} +} +func (m *ResponseOp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseOp.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ResponseOp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseOp.Merge(m, src) +} +func (m *ResponseOp) XXX_Size() int { + return m.Size() +} +func (m *ResponseOp) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseOp.DiscardUnknown(m) } -func (m *ResponseOp) Reset() { *m = ResponseOp{} } -func (m *ResponseOp) String() string { return proto.CompactTextString(m) } -func (*ResponseOp) ProtoMessage() {} -func (*ResponseOp) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{8} } +var xxx_messageInfo_ResponseOp proto.InternalMessageInfo type isResponseOp_Response interface { isResponseOp_Response() @@ -823,16 +1053,16 @@ type isResponseOp_Response interface { } type ResponseOp_ResponseRange struct { - ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range,json=responseRange,oneof"` + ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range,json=responseRange,proto3,oneof" json:"response_range,omitempty"` } type ResponseOp_ResponsePut struct { - ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put,json=responsePut,oneof"` + ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put,json=responsePut,proto3,oneof" json:"response_put,omitempty"` } type ResponseOp_ResponseDeleteRange struct { - ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range,json=responseDeleteRange,oneof"` + ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range,json=responseDeleteRange,proto3,oneof" json:"response_delete_range,omitempty"` } type ResponseOp_ResponseTxn struct { - ResponseTxn *TxnResponse `protobuf:"bytes,4,opt,name=response_txn,json=responseTxn,oneof"` + ResponseTxn *TxnResponse `protobuf:"bytes,4,opt,name=response_txn,json=responseTxn,proto3,oneof" json:"response_txn,omitempty"` } func (*ResponseOp_ResponseRange) isResponseOp_Response() {} @@ -875,9 +1105,9 @@ func (m *ResponseOp) GetResponseTxn() *TxnResponse { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ResponseOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _ResponseOp_OneofMarshaler, _ResponseOp_OneofUnmarshaler, _ResponseOp_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ResponseOp) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*ResponseOp_ResponseRange)(nil), (*ResponseOp_ResponsePut)(nil), (*ResponseOp_ResponseDeleteRange)(nil), @@ -885,108 +1115,6 @@ func (*ResponseOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) er } } -func _ResponseOp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ResponseOp) - // response - switch x := m.Response.(type) { - case *ResponseOp_ResponseRange: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ResponseRange); err != nil { - return err - } - case *ResponseOp_ResponsePut: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ResponsePut); err != nil { - return err - } - case *ResponseOp_ResponseDeleteRange: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ResponseDeleteRange); err != nil { - return err - } - case *ResponseOp_ResponseTxn: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ResponseTxn); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ResponseOp.Response has unexpected type %T", x) - } - return nil -} - -func _ResponseOp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ResponseOp) - switch tag { - case 1: // response.response_range - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(RangeResponse) - err := b.DecodeMessage(msg) - m.Response = &ResponseOp_ResponseRange{msg} - return true, err - case 2: // response.response_put - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(PutResponse) - err := b.DecodeMessage(msg) - m.Response = &ResponseOp_ResponsePut{msg} - return true, err - case 3: // response.response_delete_range - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(DeleteRangeResponse) - err := b.DecodeMessage(msg) - m.Response = &ResponseOp_ResponseDeleteRange{msg} - return true, err - case 4: // response.response_txn - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(TxnResponse) - err := b.DecodeMessage(msg) - m.Response = &ResponseOp_ResponseTxn{msg} - return true, err - default: - return false, nil - } -} - -func _ResponseOp_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ResponseOp) - // response - switch x := m.Response.(type) { - case *ResponseOp_ResponseRange: - s := proto.Size(x.ResponseRange) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *ResponseOp_ResponsePut: - s := proto.Size(x.ResponsePut) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *ResponseOp_ResponseDeleteRange: - s := proto.Size(x.ResponseDeleteRange) - n += proto.SizeVarint(3<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *ResponseOp_ResponseTxn: - s := proto.Size(x.ResponseTxn) - n += proto.SizeVarint(4<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type Compare struct { // result is logical comparison operation for this comparison. Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"` @@ -1003,13 +1131,44 @@ type Compare struct { TargetUnion isCompare_TargetUnion `protobuf_oneof:"target_union"` // range_end compares the given target to all keys in the range [key, range_end). // See RangeRequest for more details on key ranges. - RangeEnd []byte `protobuf:"bytes,64,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` + RangeEnd []byte `protobuf:"bytes,64,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Compare) Reset() { *m = Compare{} } +func (m *Compare) String() string { return proto.CompactTextString(m) } +func (*Compare) ProtoMessage() {} +func (*Compare) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{9} +} +func (m *Compare) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Compare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Compare.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Compare) XXX_Merge(src proto.Message) { + xxx_messageInfo_Compare.Merge(m, src) +} +func (m *Compare) XXX_Size() int { + return m.Size() +} +func (m *Compare) XXX_DiscardUnknown() { + xxx_messageInfo_Compare.DiscardUnknown(m) } -func (m *Compare) Reset() { *m = Compare{} } -func (m *Compare) String() string { return proto.CompactTextString(m) } -func (*Compare) ProtoMessage() {} -func (*Compare) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9} } +var xxx_messageInfo_Compare proto.InternalMessageInfo type isCompare_TargetUnion interface { isCompare_TargetUnion() @@ -1018,19 +1177,19 @@ type isCompare_TargetUnion interface { } type Compare_Version struct { - Version int64 `protobuf:"varint,4,opt,name=version,proto3,oneof"` + Version int64 `protobuf:"varint,4,opt,name=version,proto3,oneof" json:"version,omitempty"` } type Compare_CreateRevision struct { - CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,json=createRevision,proto3,oneof"` + CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,json=createRevision,proto3,oneof" json:"create_revision,omitempty"` } type Compare_ModRevision struct { - ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,json=modRevision,proto3,oneof"` + ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,json=modRevision,proto3,oneof" json:"mod_revision,omitempty"` } type Compare_Value struct { - Value []byte `protobuf:"bytes,7,opt,name=value,proto3,oneof"` + Value []byte `protobuf:"bytes,7,opt,name=value,proto3,oneof" json:"value,omitempty"` } type Compare_Lease struct { - Lease int64 `protobuf:"varint,8,opt,name=lease,proto3,oneof"` + Lease int64 `protobuf:"varint,8,opt,name=lease,proto3,oneof" json:"lease,omitempty"` } func (*Compare_Version) isCompare_TargetUnion() {} @@ -1109,9 +1268,9 @@ func (m *Compare) GetRangeEnd() []byte { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Compare) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Compare_OneofMarshaler, _Compare_OneofUnmarshaler, _Compare_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Compare) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Compare_Version)(nil), (*Compare_CreateRevision)(nil), (*Compare_ModRevision)(nil), @@ -1120,102 +1279,6 @@ func (*Compare) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error } } -func _Compare_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Compare) - // target_union - switch x := m.TargetUnion.(type) { - case *Compare_Version: - _ = b.EncodeVarint(4<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.Version)) - case *Compare_CreateRevision: - _ = b.EncodeVarint(5<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.CreateRevision)) - case *Compare_ModRevision: - _ = b.EncodeVarint(6<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.ModRevision)) - case *Compare_Value: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - _ = b.EncodeRawBytes(x.Value) - case *Compare_Lease: - _ = b.EncodeVarint(8<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.Lease)) - case nil: - default: - return fmt.Errorf("Compare.TargetUnion has unexpected type %T", x) - } - return nil -} - -func _Compare_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Compare) - switch tag { - case 4: // target_union.version - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.TargetUnion = &Compare_Version{int64(x)} - return true, err - case 5: // target_union.create_revision - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.TargetUnion = &Compare_CreateRevision{int64(x)} - return true, err - case 6: // target_union.mod_revision - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.TargetUnion = &Compare_ModRevision{int64(x)} - return true, err - case 7: // target_union.value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeRawBytes(true) - m.TargetUnion = &Compare_Value{x} - return true, err - case 8: // target_union.lease - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.TargetUnion = &Compare_Lease{int64(x)} - return true, err - default: - return false, nil - } -} - -func _Compare_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Compare) - // target_union - switch x := m.TargetUnion.(type) { - case *Compare_Version: - n += proto.SizeVarint(4<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.Version)) - case *Compare_CreateRevision: - n += proto.SizeVarint(5<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.CreateRevision)) - case *Compare_ModRevision: - n += proto.SizeVarint(6<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.ModRevision)) - case *Compare_Value: - n += proto.SizeVarint(7<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(len(x.Value))) - n += len(x.Value) - case *Compare_Lease: - n += proto.SizeVarint(8<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.Lease)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // From google paxosdb paper: // Our implementation hinges around a powerful primitive which we call MultiOp. All other database // operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically @@ -1237,17 +1300,48 @@ type TxnRequest struct { // and the response will contain their respective responses in order. // If the comparisons fail, then the failure requests will be processed in order, // and the response will contain their respective responses in order. - Compare []*Compare `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"` + Compare []*Compare `protobuf:"bytes,1,rep,name=compare,proto3" json:"compare,omitempty"` // success is a list of requests which will be applied when compare evaluates to true. - Success []*RequestOp `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"` + Success []*RequestOp `protobuf:"bytes,2,rep,name=success,proto3" json:"success,omitempty"` // failure is a list of requests which will be applied when compare evaluates to false. - Failure []*RequestOp `protobuf:"bytes,3,rep,name=failure" json:"failure,omitempty"` + Failure []*RequestOp `protobuf:"bytes,3,rep,name=failure,proto3" json:"failure,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxnRequest) Reset() { *m = TxnRequest{} } +func (m *TxnRequest) String() string { return proto.CompactTextString(m) } +func (*TxnRequest) ProtoMessage() {} +func (*TxnRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{10} +} +func (m *TxnRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxnRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxnRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TxnRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxnRequest.Merge(m, src) +} +func (m *TxnRequest) XXX_Size() int { + return m.Size() +} +func (m *TxnRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TxnRequest.DiscardUnknown(m) } -func (m *TxnRequest) Reset() { *m = TxnRequest{} } -func (m *TxnRequest) String() string { return proto.CompactTextString(m) } -func (*TxnRequest) ProtoMessage() {} -func (*TxnRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{10} } +var xxx_messageInfo_TxnRequest proto.InternalMessageInfo func (m *TxnRequest) GetCompare() []*Compare { if m != nil { @@ -1271,18 +1365,49 @@ func (m *TxnRequest) GetFailure() []*RequestOp { } type TxnResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // succeeded is set to true if the compare evaluated to true or false otherwise. Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"` // responses is a list of responses corresponding to the results from applying // success if succeeded is true or failure if succeeded is false. - Responses []*ResponseOp `protobuf:"bytes,3,rep,name=responses" json:"responses,omitempty"` + Responses []*ResponseOp `protobuf:"bytes,3,rep,name=responses,proto3" json:"responses,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxnResponse) Reset() { *m = TxnResponse{} } +func (m *TxnResponse) String() string { return proto.CompactTextString(m) } +func (*TxnResponse) ProtoMessage() {} +func (*TxnResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{11} +} +func (m *TxnResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxnResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TxnResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxnResponse.Merge(m, src) +} +func (m *TxnResponse) XXX_Size() int { + return m.Size() +} +func (m *TxnResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TxnResponse.DiscardUnknown(m) } -func (m *TxnResponse) Reset() { *m = TxnResponse{} } -func (m *TxnResponse) String() string { return proto.CompactTextString(m) } -func (*TxnResponse) ProtoMessage() {} -func (*TxnResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{11} } +var xxx_messageInfo_TxnResponse proto.InternalMessageInfo func (m *TxnResponse) GetHeader() *ResponseHeader { if m != nil { @@ -1313,13 +1438,44 @@ type CompactionRequest struct { // physical is set so the RPC will wait until the compaction is physically // applied to the local database such that compacted entries are totally // removed from the backend database. - Physical bool `protobuf:"varint,2,opt,name=physical,proto3" json:"physical,omitempty"` + Physical bool `protobuf:"varint,2,opt,name=physical,proto3" json:"physical,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompactionRequest) Reset() { *m = CompactionRequest{} } +func (m *CompactionRequest) String() string { return proto.CompactTextString(m) } +func (*CompactionRequest) ProtoMessage() {} +func (*CompactionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{12} +} +func (m *CompactionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CompactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CompactionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CompactionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompactionRequest.Merge(m, src) +} +func (m *CompactionRequest) XXX_Size() int { + return m.Size() +} +func (m *CompactionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CompactionRequest.DiscardUnknown(m) } -func (m *CompactionRequest) Reset() { *m = CompactionRequest{} } -func (m *CompactionRequest) String() string { return proto.CompactTextString(m) } -func (*CompactionRequest) ProtoMessage() {} -func (*CompactionRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{12} } +var xxx_messageInfo_CompactionRequest proto.InternalMessageInfo func (m *CompactionRequest) GetRevision() int64 { if m != nil { @@ -1336,13 +1492,44 @@ func (m *CompactionRequest) GetPhysical() bool { } type CompactionResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CompactionResponse) Reset() { *m = CompactionResponse{} } +func (m *CompactionResponse) String() string { return proto.CompactTextString(m) } +func (*CompactionResponse) ProtoMessage() {} +func (*CompactionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{13} +} +func (m *CompactionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CompactionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CompactionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CompactionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompactionResponse.Merge(m, src) +} +func (m *CompactionResponse) XXX_Size() int { + return m.Size() +} +func (m *CompactionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CompactionResponse.DiscardUnknown(m) } -func (m *CompactionResponse) Reset() { *m = CompactionResponse{} } -func (m *CompactionResponse) String() string { return proto.CompactTextString(m) } -func (*CompactionResponse) ProtoMessage() {} -func (*CompactionResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{13} } +var xxx_messageInfo_CompactionResponse proto.InternalMessageInfo func (m *CompactionResponse) GetHeader() *ResponseHeader { if m != nil { @@ -1352,22 +1539,84 @@ func (m *CompactionResponse) GetHeader() *ResponseHeader { } type HashRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HashRequest) Reset() { *m = HashRequest{} } +func (m *HashRequest) String() string { return proto.CompactTextString(m) } +func (*HashRequest) ProtoMessage() {} +func (*HashRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{14} +} +func (m *HashRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HashRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_HashRequest.Merge(m, src) +} +func (m *HashRequest) XXX_Size() int { + return m.Size() +} +func (m *HashRequest) XXX_DiscardUnknown() { + xxx_messageInfo_HashRequest.DiscardUnknown(m) } -func (m *HashRequest) Reset() { *m = HashRequest{} } -func (m *HashRequest) String() string { return proto.CompactTextString(m) } -func (*HashRequest) ProtoMessage() {} -func (*HashRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{14} } +var xxx_messageInfo_HashRequest proto.InternalMessageInfo type HashKVRequest struct { // revision is the key-value store revision for the hash operation. - Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HashKVRequest) Reset() { *m = HashKVRequest{} } +func (m *HashKVRequest) String() string { return proto.CompactTextString(m) } +func (*HashKVRequest) ProtoMessage() {} +func (*HashKVRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{15} +} +func (m *HashKVRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HashKVRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HashKVRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HashKVRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_HashKVRequest.Merge(m, src) +} +func (m *HashKVRequest) XXX_Size() int { + return m.Size() +} +func (m *HashKVRequest) XXX_DiscardUnknown() { + xxx_messageInfo_HashKVRequest.DiscardUnknown(m) } -func (m *HashKVRequest) Reset() { *m = HashKVRequest{} } -func (m *HashKVRequest) String() string { return proto.CompactTextString(m) } -func (*HashKVRequest) ProtoMessage() {} -func (*HashKVRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{15} } +var xxx_messageInfo_HashKVRequest proto.InternalMessageInfo func (m *HashKVRequest) GetRevision() int64 { if m != nil { @@ -1377,17 +1626,48 @@ func (m *HashKVRequest) GetRevision() int64 { } type HashKVResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // hash is the hash value computed from the responding member's MVCC keys up to a given revision. Hash uint32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` // compact_revision is the compacted revision of key-value store when hash begins. - CompactRevision int64 `protobuf:"varint,3,opt,name=compact_revision,json=compactRevision,proto3" json:"compact_revision,omitempty"` + CompactRevision int64 `protobuf:"varint,3,opt,name=compact_revision,json=compactRevision,proto3" json:"compact_revision,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HashKVResponse) Reset() { *m = HashKVResponse{} } +func (m *HashKVResponse) String() string { return proto.CompactTextString(m) } +func (*HashKVResponse) ProtoMessage() {} +func (*HashKVResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{16} +} +func (m *HashKVResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HashKVResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HashKVResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HashKVResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_HashKVResponse.Merge(m, src) +} +func (m *HashKVResponse) XXX_Size() int { + return m.Size() +} +func (m *HashKVResponse) XXX_DiscardUnknown() { + xxx_messageInfo_HashKVResponse.DiscardUnknown(m) } -func (m *HashKVResponse) Reset() { *m = HashKVResponse{} } -func (m *HashKVResponse) String() string { return proto.CompactTextString(m) } -func (*HashKVResponse) ProtoMessage() {} -func (*HashKVResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{16} } +var xxx_messageInfo_HashKVResponse proto.InternalMessageInfo func (m *HashKVResponse) GetHeader() *ResponseHeader { if m != nil { @@ -1411,15 +1691,46 @@ func (m *HashKVResponse) GetCompactRevision() int64 { } type HashResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // hash is the hash value computed from the responding member's KV's backend. - Hash uint32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` + Hash uint32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HashResponse) Reset() { *m = HashResponse{} } +func (m *HashResponse) String() string { return proto.CompactTextString(m) } +func (*HashResponse) ProtoMessage() {} +func (*HashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{17} +} +func (m *HashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HashResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_HashResponse.Merge(m, src) +} +func (m *HashResponse) XXX_Size() int { + return m.Size() +} +func (m *HashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_HashResponse.DiscardUnknown(m) } -func (m *HashResponse) Reset() { *m = HashResponse{} } -func (m *HashResponse) String() string { return proto.CompactTextString(m) } -func (*HashResponse) ProtoMessage() {} -func (*HashResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{17} } +var xxx_messageInfo_HashResponse proto.InternalMessageInfo func (m *HashResponse) GetHeader() *ResponseHeader { if m != nil { @@ -1436,27 +1747,89 @@ func (m *HashResponse) GetHash() uint32 { } type SnapshotRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SnapshotRequest) Reset() { *m = SnapshotRequest{} } +func (m *SnapshotRequest) String() string { return proto.CompactTextString(m) } +func (*SnapshotRequest) ProtoMessage() {} +func (*SnapshotRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{18} +} +func (m *SnapshotRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SnapshotRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotRequest.Merge(m, src) +} +func (m *SnapshotRequest) XXX_Size() int { + return m.Size() +} +func (m *SnapshotRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotRequest.DiscardUnknown(m) } -func (m *SnapshotRequest) Reset() { *m = SnapshotRequest{} } -func (m *SnapshotRequest) String() string { return proto.CompactTextString(m) } -func (*SnapshotRequest) ProtoMessage() {} -func (*SnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{18} } +var xxx_messageInfo_SnapshotRequest proto.InternalMessageInfo type SnapshotResponse struct { // header has the current key-value store information. The first header in the snapshot // stream indicates the point in time of the snapshot. - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // remaining_bytes is the number of blob bytes to be sent after this message RemainingBytes uint64 `protobuf:"varint,2,opt,name=remaining_bytes,json=remainingBytes,proto3" json:"remaining_bytes,omitempty"` // blob contains the next chunk of the snapshot in the snapshot stream. - Blob []byte `protobuf:"bytes,3,opt,name=blob,proto3" json:"blob,omitempty"` + Blob []byte `protobuf:"bytes,3,opt,name=blob,proto3" json:"blob,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SnapshotResponse) Reset() { *m = SnapshotResponse{} } +func (m *SnapshotResponse) String() string { return proto.CompactTextString(m) } +func (*SnapshotResponse) ProtoMessage() {} +func (*SnapshotResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{19} +} +func (m *SnapshotResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SnapshotResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotResponse.Merge(m, src) +} +func (m *SnapshotResponse) XXX_Size() int { + return m.Size() +} +func (m *SnapshotResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotResponse.DiscardUnknown(m) } -func (m *SnapshotResponse) Reset() { *m = SnapshotResponse{} } -func (m *SnapshotResponse) String() string { return proto.CompactTextString(m) } -func (*SnapshotResponse) ProtoMessage() {} -func (*SnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{19} } +var xxx_messageInfo_SnapshotResponse proto.InternalMessageInfo func (m *SnapshotResponse) GetHeader() *ResponseHeader { if m != nil { @@ -1486,13 +1859,44 @@ type WatchRequest struct { // *WatchRequest_CreateRequest // *WatchRequest_CancelRequest // *WatchRequest_ProgressRequest - RequestUnion isWatchRequest_RequestUnion `protobuf_oneof:"request_union"` + RequestUnion isWatchRequest_RequestUnion `protobuf_oneof:"request_union"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WatchRequest) Reset() { *m = WatchRequest{} } +func (m *WatchRequest) String() string { return proto.CompactTextString(m) } +func (*WatchRequest) ProtoMessage() {} +func (*WatchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{20} +} +func (m *WatchRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WatchRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WatchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WatchRequest.Merge(m, src) +} +func (m *WatchRequest) XXX_Size() int { + return m.Size() +} +func (m *WatchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WatchRequest.DiscardUnknown(m) } -func (m *WatchRequest) Reset() { *m = WatchRequest{} } -func (m *WatchRequest) String() string { return proto.CompactTextString(m) } -func (*WatchRequest) ProtoMessage() {} -func (*WatchRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{20} } +var xxx_messageInfo_WatchRequest proto.InternalMessageInfo type isWatchRequest_RequestUnion interface { isWatchRequest_RequestUnion() @@ -1501,13 +1905,13 @@ type isWatchRequest_RequestUnion interface { } type WatchRequest_CreateRequest struct { - CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request,json=createRequest,oneof"` + CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request,json=createRequest,proto3,oneof" json:"create_request,omitempty"` } type WatchRequest_CancelRequest struct { - CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request,json=cancelRequest,oneof"` + CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request,json=cancelRequest,proto3,oneof" json:"cancel_request,omitempty"` } type WatchRequest_ProgressRequest struct { - ProgressRequest *WatchProgressRequest `protobuf:"bytes,3,opt,name=progress_request,json=progressRequest,oneof"` + ProgressRequest *WatchProgressRequest `protobuf:"bytes,3,opt,name=progress_request,json=progressRequest,proto3,oneof" json:"progress_request,omitempty"` } func (*WatchRequest_CreateRequest) isWatchRequest_RequestUnion() {} @@ -1542,99 +1946,15 @@ func (m *WatchRequest) GetProgressRequest() *WatchProgressRequest { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*WatchRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _WatchRequest_OneofMarshaler, _WatchRequest_OneofUnmarshaler, _WatchRequest_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*WatchRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*WatchRequest_CreateRequest)(nil), (*WatchRequest_CancelRequest)(nil), (*WatchRequest_ProgressRequest)(nil), } } -func _WatchRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*WatchRequest) - // request_union - switch x := m.RequestUnion.(type) { - case *WatchRequest_CreateRequest: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.CreateRequest); err != nil { - return err - } - case *WatchRequest_CancelRequest: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.CancelRequest); err != nil { - return err - } - case *WatchRequest_ProgressRequest: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ProgressRequest); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("WatchRequest.RequestUnion has unexpected type %T", x) - } - return nil -} - -func _WatchRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*WatchRequest) - switch tag { - case 1: // request_union.create_request - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WatchCreateRequest) - err := b.DecodeMessage(msg) - m.RequestUnion = &WatchRequest_CreateRequest{msg} - return true, err - case 2: // request_union.cancel_request - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WatchCancelRequest) - err := b.DecodeMessage(msg) - m.RequestUnion = &WatchRequest_CancelRequest{msg} - return true, err - case 3: // request_union.progress_request - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WatchProgressRequest) - err := b.DecodeMessage(msg) - m.RequestUnion = &WatchRequest_ProgressRequest{msg} - return true, err - default: - return false, nil - } -} - -func _WatchRequest_OneofSizer(msg proto.Message) (n int) { - m := msg.(*WatchRequest) - // request_union - switch x := m.RequestUnion.(type) { - case *WatchRequest_CreateRequest: - s := proto.Size(x.CreateRequest) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *WatchRequest_CancelRequest: - s := proto.Size(x.CancelRequest) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *WatchRequest_ProgressRequest: - s := proto.Size(x.ProgressRequest) - n += proto.SizeVarint(3<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type WatchCreateRequest struct { // key is the key to register for watching. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` @@ -1652,7 +1972,7 @@ type WatchCreateRequest struct { // The etcd server may decide how often it will send notifications based on current load. ProgressNotify bool `protobuf:"varint,4,opt,name=progress_notify,json=progressNotify,proto3" json:"progress_notify,omitempty"` // filters filter the events at server side before it sends back to the watcher. - Filters []WatchCreateRequest_FilterType `protobuf:"varint,5,rep,packed,name=filters,enum=etcdserverpb.WatchCreateRequest_FilterType" json:"filters,omitempty"` + Filters []WatchCreateRequest_FilterType `protobuf:"varint,5,rep,packed,name=filters,proto3,enum=etcdserverpb.WatchCreateRequest_FilterType" json:"filters,omitempty"` // If prev_kv is set, created watcher gets the previous KV before the event happens. // If the previous KV is already compacted, nothing will be returned. PrevKv bool `protobuf:"varint,6,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` @@ -1663,13 +1983,44 @@ type WatchCreateRequest struct { // use on the stream will cause an error to be returned. WatchId int64 `protobuf:"varint,7,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` // fragment enables splitting large revisions into multiple watch responses. - Fragment bool `protobuf:"varint,8,opt,name=fragment,proto3" json:"fragment,omitempty"` + Fragment bool `protobuf:"varint,8,opt,name=fragment,proto3" json:"fragment,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WatchCreateRequest) Reset() { *m = WatchCreateRequest{} } +func (m *WatchCreateRequest) String() string { return proto.CompactTextString(m) } +func (*WatchCreateRequest) ProtoMessage() {} +func (*WatchCreateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{21} +} +func (m *WatchCreateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WatchCreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WatchCreateRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WatchCreateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WatchCreateRequest.Merge(m, src) +} +func (m *WatchCreateRequest) XXX_Size() int { + return m.Size() +} +func (m *WatchCreateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WatchCreateRequest.DiscardUnknown(m) } -func (m *WatchCreateRequest) Reset() { *m = WatchCreateRequest{} } -func (m *WatchCreateRequest) String() string { return proto.CompactTextString(m) } -func (*WatchCreateRequest) ProtoMessage() {} -func (*WatchCreateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{21} } +var xxx_messageInfo_WatchCreateRequest proto.InternalMessageInfo func (m *WatchCreateRequest) GetKey() []byte { if m != nil { @@ -1729,13 +2080,44 @@ func (m *WatchCreateRequest) GetFragment() bool { type WatchCancelRequest struct { // watch_id is the watcher id to cancel so that no more events are transmitted. - WatchId int64 `protobuf:"varint,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` + WatchId int64 `protobuf:"varint,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WatchCancelRequest) Reset() { *m = WatchCancelRequest{} } +func (m *WatchCancelRequest) String() string { return proto.CompactTextString(m) } +func (*WatchCancelRequest) ProtoMessage() {} +func (*WatchCancelRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{22} +} +func (m *WatchCancelRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WatchCancelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WatchCancelRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WatchCancelRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WatchCancelRequest.Merge(m, src) +} +func (m *WatchCancelRequest) XXX_Size() int { + return m.Size() +} +func (m *WatchCancelRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WatchCancelRequest.DiscardUnknown(m) } -func (m *WatchCancelRequest) Reset() { *m = WatchCancelRequest{} } -func (m *WatchCancelRequest) String() string { return proto.CompactTextString(m) } -func (*WatchCancelRequest) ProtoMessage() {} -func (*WatchCancelRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{22} } +var xxx_messageInfo_WatchCancelRequest proto.InternalMessageInfo func (m *WatchCancelRequest) GetWatchId() int64 { if m != nil { @@ -1747,15 +2129,46 @@ func (m *WatchCancelRequest) GetWatchId() int64 { // Requests the a watch stream progress status be sent in the watch response stream as soon as // possible. type WatchProgressRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WatchProgressRequest) Reset() { *m = WatchProgressRequest{} } +func (m *WatchProgressRequest) String() string { return proto.CompactTextString(m) } +func (*WatchProgressRequest) ProtoMessage() {} +func (*WatchProgressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{23} +} +func (m *WatchProgressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WatchProgressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WatchProgressRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WatchProgressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WatchProgressRequest.Merge(m, src) +} +func (m *WatchProgressRequest) XXX_Size() int { + return m.Size() +} +func (m *WatchProgressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WatchProgressRequest.DiscardUnknown(m) } -func (m *WatchProgressRequest) Reset() { *m = WatchProgressRequest{} } -func (m *WatchProgressRequest) String() string { return proto.CompactTextString(m) } -func (*WatchProgressRequest) ProtoMessage() {} -func (*WatchProgressRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{23} } +var xxx_messageInfo_WatchProgressRequest proto.InternalMessageInfo type WatchResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // watch_id is the ID of the watcher that corresponds to the response. WatchId int64 `protobuf:"varint,2,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` // created is set to true if the response is for a create watch request. @@ -1778,14 +2191,45 @@ type WatchResponse struct { // cancel_reason indicates the reason for canceling the watcher. CancelReason string `protobuf:"bytes,6,opt,name=cancel_reason,json=cancelReason,proto3" json:"cancel_reason,omitempty"` // framgment is true if large watch response was split over multiple responses. - Fragment bool `protobuf:"varint,7,opt,name=fragment,proto3" json:"fragment,omitempty"` - Events []*mvccpb.Event `protobuf:"bytes,11,rep,name=events" json:"events,omitempty"` + Fragment bool `protobuf:"varint,7,opt,name=fragment,proto3" json:"fragment,omitempty"` + Events []*mvccpb.Event `protobuf:"bytes,11,rep,name=events,proto3" json:"events,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WatchResponse) Reset() { *m = WatchResponse{} } +func (m *WatchResponse) String() string { return proto.CompactTextString(m) } +func (*WatchResponse) ProtoMessage() {} +func (*WatchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{24} +} +func (m *WatchResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WatchResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WatchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_WatchResponse.Merge(m, src) +} +func (m *WatchResponse) XXX_Size() int { + return m.Size() +} +func (m *WatchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_WatchResponse.DiscardUnknown(m) } -func (m *WatchResponse) Reset() { *m = WatchResponse{} } -func (m *WatchResponse) String() string { return proto.CompactTextString(m) } -func (*WatchResponse) ProtoMessage() {} -func (*WatchResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{24} } +var xxx_messageInfo_WatchResponse proto.InternalMessageInfo func (m *WatchResponse) GetHeader() *ResponseHeader { if m != nil { @@ -1847,13 +2291,44 @@ type LeaseGrantRequest struct { // TTL is the advisory time-to-live in seconds. Expired lease will return -1. TTL int64 `protobuf:"varint,1,opt,name=TTL,proto3" json:"TTL,omitempty"` // ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. - ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` + ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseGrantRequest) Reset() { *m = LeaseGrantRequest{} } +func (m *LeaseGrantRequest) String() string { return proto.CompactTextString(m) } +func (*LeaseGrantRequest) ProtoMessage() {} +func (*LeaseGrantRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{25} +} +func (m *LeaseGrantRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseGrantRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseGrantRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseGrantRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseGrantRequest.Merge(m, src) +} +func (m *LeaseGrantRequest) XXX_Size() int { + return m.Size() +} +func (m *LeaseGrantRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseGrantRequest.DiscardUnknown(m) } -func (m *LeaseGrantRequest) Reset() { *m = LeaseGrantRequest{} } -func (m *LeaseGrantRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseGrantRequest) ProtoMessage() {} -func (*LeaseGrantRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{25} } +var xxx_messageInfo_LeaseGrantRequest proto.InternalMessageInfo func (m *LeaseGrantRequest) GetTTL() int64 { if m != nil { @@ -1870,18 +2345,49 @@ func (m *LeaseGrantRequest) GetID() int64 { } type LeaseGrantResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // ID is the lease ID for the granted lease. ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` // TTL is the server chosen lease time-to-live in seconds. - TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` - Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` + TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` + Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseGrantResponse) Reset() { *m = LeaseGrantResponse{} } +func (m *LeaseGrantResponse) String() string { return proto.CompactTextString(m) } +func (*LeaseGrantResponse) ProtoMessage() {} +func (*LeaseGrantResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{26} +} +func (m *LeaseGrantResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseGrantResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseGrantResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseGrantResponse.Merge(m, src) +} +func (m *LeaseGrantResponse) XXX_Size() int { + return m.Size() +} +func (m *LeaseGrantResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseGrantResponse.DiscardUnknown(m) } -func (m *LeaseGrantResponse) Reset() { *m = LeaseGrantResponse{} } -func (m *LeaseGrantResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseGrantResponse) ProtoMessage() {} -func (*LeaseGrantResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{26} } +var xxx_messageInfo_LeaseGrantResponse proto.InternalMessageInfo func (m *LeaseGrantResponse) GetHeader() *ResponseHeader { if m != nil { @@ -1913,13 +2419,44 @@ func (m *LeaseGrantResponse) GetError() string { type LeaseRevokeRequest struct { // ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseRevokeRequest) Reset() { *m = LeaseRevokeRequest{} } +func (m *LeaseRevokeRequest) String() string { return proto.CompactTextString(m) } +func (*LeaseRevokeRequest) ProtoMessage() {} +func (*LeaseRevokeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{27} +} +func (m *LeaseRevokeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseRevokeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseRevokeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } - -func (m *LeaseRevokeRequest) Reset() { *m = LeaseRevokeRequest{} } -func (m *LeaseRevokeRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseRevokeRequest) ProtoMessage() {} -func (*LeaseRevokeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{27} } +func (m *LeaseRevokeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseRevokeRequest.Merge(m, src) +} +func (m *LeaseRevokeRequest) XXX_Size() int { + return m.Size() +} +func (m *LeaseRevokeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseRevokeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LeaseRevokeRequest proto.InternalMessageInfo func (m *LeaseRevokeRequest) GetID() int64 { if m != nil { @@ -1929,13 +2466,44 @@ func (m *LeaseRevokeRequest) GetID() int64 { } type LeaseRevokeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseRevokeResponse) Reset() { *m = LeaseRevokeResponse{} } +func (m *LeaseRevokeResponse) String() string { return proto.CompactTextString(m) } +func (*LeaseRevokeResponse) ProtoMessage() {} +func (*LeaseRevokeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{28} +} +func (m *LeaseRevokeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseRevokeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseRevokeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseRevokeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseRevokeResponse.Merge(m, src) +} +func (m *LeaseRevokeResponse) XXX_Size() int { + return m.Size() +} +func (m *LeaseRevokeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseRevokeResponse.DiscardUnknown(m) } -func (m *LeaseRevokeResponse) Reset() { *m = LeaseRevokeResponse{} } -func (m *LeaseRevokeResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseRevokeResponse) ProtoMessage() {} -func (*LeaseRevokeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{28} } +var xxx_messageInfo_LeaseRevokeResponse proto.InternalMessageInfo func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader { if m != nil { @@ -1948,13 +2516,44 @@ type LeaseCheckpoint struct { // ID is the lease ID to checkpoint. ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // Remaining_TTL is the remaining time until expiry of the lease. - Remaining_TTL int64 `protobuf:"varint,2,opt,name=remaining_TTL,json=remainingTTL,proto3" json:"remaining_TTL,omitempty"` + Remaining_TTL int64 `protobuf:"varint,2,opt,name=remaining_TTL,json=remainingTTL,proto3" json:"remaining_TTL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseCheckpoint) Reset() { *m = LeaseCheckpoint{} } +func (m *LeaseCheckpoint) String() string { return proto.CompactTextString(m) } +func (*LeaseCheckpoint) ProtoMessage() {} +func (*LeaseCheckpoint) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{29} +} +func (m *LeaseCheckpoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseCheckpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseCheckpoint.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseCheckpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseCheckpoint.Merge(m, src) +} +func (m *LeaseCheckpoint) XXX_Size() int { + return m.Size() +} +func (m *LeaseCheckpoint) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseCheckpoint.DiscardUnknown(m) } -func (m *LeaseCheckpoint) Reset() { *m = LeaseCheckpoint{} } -func (m *LeaseCheckpoint) String() string { return proto.CompactTextString(m) } -func (*LeaseCheckpoint) ProtoMessage() {} -func (*LeaseCheckpoint) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{29} } +var xxx_messageInfo_LeaseCheckpoint proto.InternalMessageInfo func (m *LeaseCheckpoint) GetID() int64 { if m != nil { @@ -1971,13 +2570,44 @@ func (m *LeaseCheckpoint) GetRemaining_TTL() int64 { } type LeaseCheckpointRequest struct { - Checkpoints []*LeaseCheckpoint `protobuf:"bytes,1,rep,name=checkpoints" json:"checkpoints,omitempty"` + Checkpoints []*LeaseCheckpoint `protobuf:"bytes,1,rep,name=checkpoints,proto3" json:"checkpoints,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseCheckpointRequest) Reset() { *m = LeaseCheckpointRequest{} } +func (m *LeaseCheckpointRequest) String() string { return proto.CompactTextString(m) } +func (*LeaseCheckpointRequest) ProtoMessage() {} +func (*LeaseCheckpointRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{30} +} +func (m *LeaseCheckpointRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseCheckpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseCheckpointRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseCheckpointRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseCheckpointRequest.Merge(m, src) +} +func (m *LeaseCheckpointRequest) XXX_Size() int { + return m.Size() +} +func (m *LeaseCheckpointRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseCheckpointRequest.DiscardUnknown(m) } -func (m *LeaseCheckpointRequest) Reset() { *m = LeaseCheckpointRequest{} } -func (m *LeaseCheckpointRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseCheckpointRequest) ProtoMessage() {} -func (*LeaseCheckpointRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{30} } +var xxx_messageInfo_LeaseCheckpointRequest proto.InternalMessageInfo func (m *LeaseCheckpointRequest) GetCheckpoints() []*LeaseCheckpoint { if m != nil { @@ -1987,13 +2617,44 @@ func (m *LeaseCheckpointRequest) GetCheckpoints() []*LeaseCheckpoint { } type LeaseCheckpointResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseCheckpointResponse) Reset() { *m = LeaseCheckpointResponse{} } +func (m *LeaseCheckpointResponse) String() string { return proto.CompactTextString(m) } +func (*LeaseCheckpointResponse) ProtoMessage() {} +func (*LeaseCheckpointResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{31} +} +func (m *LeaseCheckpointResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseCheckpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseCheckpointResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseCheckpointResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseCheckpointResponse.Merge(m, src) +} +func (m *LeaseCheckpointResponse) XXX_Size() int { + return m.Size() +} +func (m *LeaseCheckpointResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseCheckpointResponse.DiscardUnknown(m) } -func (m *LeaseCheckpointResponse) Reset() { *m = LeaseCheckpointResponse{} } -func (m *LeaseCheckpointResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseCheckpointResponse) ProtoMessage() {} -func (*LeaseCheckpointResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{31} } +var xxx_messageInfo_LeaseCheckpointResponse proto.InternalMessageInfo func (m *LeaseCheckpointResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2004,13 +2665,44 @@ func (m *LeaseCheckpointResponse) GetHeader() *ResponseHeader { type LeaseKeepAliveRequest struct { // ID is the lease ID for the lease to keep alive. - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseKeepAliveRequest) Reset() { *m = LeaseKeepAliveRequest{} } +func (m *LeaseKeepAliveRequest) String() string { return proto.CompactTextString(m) } +func (*LeaseKeepAliveRequest) ProtoMessage() {} +func (*LeaseKeepAliveRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{32} +} +func (m *LeaseKeepAliveRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseKeepAliveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseKeepAliveRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseKeepAliveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseKeepAliveRequest.Merge(m, src) +} +func (m *LeaseKeepAliveRequest) XXX_Size() int { + return m.Size() +} +func (m *LeaseKeepAliveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseKeepAliveRequest.DiscardUnknown(m) } -func (m *LeaseKeepAliveRequest) Reset() { *m = LeaseKeepAliveRequest{} } -func (m *LeaseKeepAliveRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseKeepAliveRequest) ProtoMessage() {} -func (*LeaseKeepAliveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{32} } +var xxx_messageInfo_LeaseKeepAliveRequest proto.InternalMessageInfo func (m *LeaseKeepAliveRequest) GetID() int64 { if m != nil { @@ -2020,17 +2712,48 @@ func (m *LeaseKeepAliveRequest) GetID() int64 { } type LeaseKeepAliveResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // ID is the lease ID from the keep alive request. ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` // TTL is the new time-to-live for the lease. - TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` + TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseKeepAliveResponse) Reset() { *m = LeaseKeepAliveResponse{} } +func (m *LeaseKeepAliveResponse) String() string { return proto.CompactTextString(m) } +func (*LeaseKeepAliveResponse) ProtoMessage() {} +func (*LeaseKeepAliveResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{33} +} +func (m *LeaseKeepAliveResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseKeepAliveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseKeepAliveResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseKeepAliveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseKeepAliveResponse.Merge(m, src) +} +func (m *LeaseKeepAliveResponse) XXX_Size() int { + return m.Size() +} +func (m *LeaseKeepAliveResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseKeepAliveResponse.DiscardUnknown(m) } -func (m *LeaseKeepAliveResponse) Reset() { *m = LeaseKeepAliveResponse{} } -func (m *LeaseKeepAliveResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseKeepAliveResponse) ProtoMessage() {} -func (*LeaseKeepAliveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{33} } +var xxx_messageInfo_LeaseKeepAliveResponse proto.InternalMessageInfo func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2057,13 +2780,44 @@ type LeaseTimeToLiveRequest struct { // ID is the lease ID for the lease. ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // keys is true to query all the keys attached to this lease. - Keys bool `protobuf:"varint,2,opt,name=keys,proto3" json:"keys,omitempty"` + Keys bool `protobuf:"varint,2,opt,name=keys,proto3" json:"keys,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseTimeToLiveRequest) Reset() { *m = LeaseTimeToLiveRequest{} } +func (m *LeaseTimeToLiveRequest) String() string { return proto.CompactTextString(m) } +func (*LeaseTimeToLiveRequest) ProtoMessage() {} +func (*LeaseTimeToLiveRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{34} +} +func (m *LeaseTimeToLiveRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseTimeToLiveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseTimeToLiveRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseTimeToLiveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseTimeToLiveRequest.Merge(m, src) +} +func (m *LeaseTimeToLiveRequest) XXX_Size() int { + return m.Size() +} +func (m *LeaseTimeToLiveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseTimeToLiveRequest.DiscardUnknown(m) } -func (m *LeaseTimeToLiveRequest) Reset() { *m = LeaseTimeToLiveRequest{} } -func (m *LeaseTimeToLiveRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseTimeToLiveRequest) ProtoMessage() {} -func (*LeaseTimeToLiveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{34} } +var xxx_messageInfo_LeaseTimeToLiveRequest proto.InternalMessageInfo func (m *LeaseTimeToLiveRequest) GetID() int64 { if m != nil { @@ -2080,7 +2834,7 @@ func (m *LeaseTimeToLiveRequest) GetKeys() bool { } type LeaseTimeToLiveResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // ID is the lease ID from the keep alive request. ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. @@ -2088,13 +2842,44 @@ type LeaseTimeToLiveResponse struct { // GrantedTTL is the initial granted time in seconds upon lease creation/renewal. GrantedTTL int64 `protobuf:"varint,4,opt,name=grantedTTL,proto3" json:"grantedTTL,omitempty"` // Keys is the list of keys attached to this lease. - Keys [][]byte `protobuf:"bytes,5,rep,name=keys" json:"keys,omitempty"` + Keys [][]byte `protobuf:"bytes,5,rep,name=keys,proto3" json:"keys,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseTimeToLiveResponse) Reset() { *m = LeaseTimeToLiveResponse{} } +func (m *LeaseTimeToLiveResponse) String() string { return proto.CompactTextString(m) } +func (*LeaseTimeToLiveResponse) ProtoMessage() {} +func (*LeaseTimeToLiveResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{35} +} +func (m *LeaseTimeToLiveResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseTimeToLiveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseTimeToLiveResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseTimeToLiveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseTimeToLiveResponse.Merge(m, src) +} +func (m *LeaseTimeToLiveResponse) XXX_Size() int { + return m.Size() +} +func (m *LeaseTimeToLiveResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseTimeToLiveResponse.DiscardUnknown(m) } -func (m *LeaseTimeToLiveResponse) Reset() { *m = LeaseTimeToLiveResponse{} } -func (m *LeaseTimeToLiveResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseTimeToLiveResponse) ProtoMessage() {} -func (*LeaseTimeToLiveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{35} } +var xxx_messageInfo_LeaseTimeToLiveResponse proto.InternalMessageInfo func (m *LeaseTimeToLiveResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2132,21 +2917,83 @@ func (m *LeaseTimeToLiveResponse) GetKeys() [][]byte { } type LeaseLeasesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseLeasesRequest) Reset() { *m = LeaseLeasesRequest{} } +func (m *LeaseLeasesRequest) String() string { return proto.CompactTextString(m) } +func (*LeaseLeasesRequest) ProtoMessage() {} +func (*LeaseLeasesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{36} +} +func (m *LeaseLeasesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseLeasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseLeasesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseLeasesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseLeasesRequest.Merge(m, src) +} +func (m *LeaseLeasesRequest) XXX_Size() int { + return m.Size() +} +func (m *LeaseLeasesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseLeasesRequest.DiscardUnknown(m) } -func (m *LeaseLeasesRequest) Reset() { *m = LeaseLeasesRequest{} } -func (m *LeaseLeasesRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseLeasesRequest) ProtoMessage() {} -func (*LeaseLeasesRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{36} } +var xxx_messageInfo_LeaseLeasesRequest proto.InternalMessageInfo type LeaseStatus struct { - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseStatus) Reset() { *m = LeaseStatus{} } +func (m *LeaseStatus) String() string { return proto.CompactTextString(m) } +func (*LeaseStatus) ProtoMessage() {} +func (*LeaseStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{37} +} +func (m *LeaseStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseStatus.Merge(m, src) +} +func (m *LeaseStatus) XXX_Size() int { + return m.Size() +} +func (m *LeaseStatus) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseStatus.DiscardUnknown(m) } -func (m *LeaseStatus) Reset() { *m = LeaseStatus{} } -func (m *LeaseStatus) String() string { return proto.CompactTextString(m) } -func (*LeaseStatus) ProtoMessage() {} -func (*LeaseStatus) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{37} } +var xxx_messageInfo_LeaseStatus proto.InternalMessageInfo func (m *LeaseStatus) GetID() int64 { if m != nil { @@ -2156,14 +3003,45 @@ func (m *LeaseStatus) GetID() int64 { } type LeaseLeasesResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Leases []*LeaseStatus `protobuf:"bytes,2,rep,name=leases" json:"leases,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Leases []*LeaseStatus `protobuf:"bytes,2,rep,name=leases,proto3" json:"leases,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LeaseLeasesResponse) Reset() { *m = LeaseLeasesResponse{} } +func (m *LeaseLeasesResponse) String() string { return proto.CompactTextString(m) } +func (*LeaseLeasesResponse) ProtoMessage() {} +func (*LeaseLeasesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{38} +} +func (m *LeaseLeasesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseLeasesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LeaseLeasesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LeaseLeasesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseLeasesResponse.Merge(m, src) +} +func (m *LeaseLeasesResponse) XXX_Size() int { + return m.Size() +} +func (m *LeaseLeasesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseLeasesResponse.DiscardUnknown(m) } -func (m *LeaseLeasesResponse) Reset() { *m = LeaseLeasesResponse{} } -func (m *LeaseLeasesResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseLeasesResponse) ProtoMessage() {} -func (*LeaseLeasesResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{38} } +var xxx_messageInfo_LeaseLeasesResponse proto.InternalMessageInfo func (m *LeaseLeasesResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2185,17 +3063,48 @@ type Member struct { // name is the human-readable name of the member. If the member is not started, the name will be an empty string. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // peerURLs is the list of URLs the member exposes to the cluster for communication. - PeerURLs []string `protobuf:"bytes,3,rep,name=peerURLs" json:"peerURLs,omitempty"` + PeerURLs []string `protobuf:"bytes,3,rep,name=peerURLs,proto3" json:"peerURLs,omitempty"` // clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty. - ClientURLs []string `protobuf:"bytes,4,rep,name=clientURLs" json:"clientURLs,omitempty"` + ClientURLs []string `protobuf:"bytes,4,rep,name=clientURLs,proto3" json:"clientURLs,omitempty"` // isLearner indicates if the member is raft learner. - IsLearner bool `protobuf:"varint,5,opt,name=isLearner,proto3" json:"isLearner,omitempty"` + IsLearner bool `protobuf:"varint,5,opt,name=isLearner,proto3" json:"isLearner,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Member) Reset() { *m = Member{} } +func (m *Member) String() string { return proto.CompactTextString(m) } +func (*Member) ProtoMessage() {} +func (*Member) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{39} +} +func (m *Member) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Member) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Member.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Member) XXX_Merge(src proto.Message) { + xxx_messageInfo_Member.Merge(m, src) +} +func (m *Member) XXX_Size() int { + return m.Size() +} +func (m *Member) XXX_DiscardUnknown() { + xxx_messageInfo_Member.DiscardUnknown(m) } -func (m *Member) Reset() { *m = Member{} } -func (m *Member) String() string { return proto.CompactTextString(m) } -func (*Member) ProtoMessage() {} -func (*Member) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{39} } +var xxx_messageInfo_Member proto.InternalMessageInfo func (m *Member) GetID() uint64 { if m != nil { @@ -2234,15 +3143,46 @@ func (m *Member) GetIsLearner() bool { type MemberAddRequest struct { // peerURLs is the list of URLs the added member will use to communicate with the cluster. - PeerURLs []string `protobuf:"bytes,1,rep,name=peerURLs" json:"peerURLs,omitempty"` + PeerURLs []string `protobuf:"bytes,1,rep,name=peerURLs,proto3" json:"peerURLs,omitempty"` // isLearner indicates if the added member is raft learner. - IsLearner bool `protobuf:"varint,2,opt,name=isLearner,proto3" json:"isLearner,omitempty"` + IsLearner bool `protobuf:"varint,2,opt,name=isLearner,proto3" json:"isLearner,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberAddRequest) Reset() { *m = MemberAddRequest{} } +func (m *MemberAddRequest) String() string { return proto.CompactTextString(m) } +func (*MemberAddRequest) ProtoMessage() {} +func (*MemberAddRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{40} +} +func (m *MemberAddRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberAddRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberAddRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberAddRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberAddRequest.Merge(m, src) +} +func (m *MemberAddRequest) XXX_Size() int { + return m.Size() +} +func (m *MemberAddRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MemberAddRequest.DiscardUnknown(m) } -func (m *MemberAddRequest) Reset() { *m = MemberAddRequest{} } -func (m *MemberAddRequest) String() string { return proto.CompactTextString(m) } -func (*MemberAddRequest) ProtoMessage() {} -func (*MemberAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{40} } +var xxx_messageInfo_MemberAddRequest proto.InternalMessageInfo func (m *MemberAddRequest) GetPeerURLs() []string { if m != nil { @@ -2259,17 +3199,48 @@ func (m *MemberAddRequest) GetIsLearner() bool { } type MemberAddResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // member is the member information for the added member. - Member *Member `protobuf:"bytes,2,opt,name=member" json:"member,omitempty"` + Member *Member `protobuf:"bytes,2,opt,name=member,proto3" json:"member,omitempty"` // members is a list of all members after adding the new member. - Members []*Member `protobuf:"bytes,3,rep,name=members" json:"members,omitempty"` + Members []*Member `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberAddResponse) Reset() { *m = MemberAddResponse{} } +func (m *MemberAddResponse) String() string { return proto.CompactTextString(m) } +func (*MemberAddResponse) ProtoMessage() {} +func (*MemberAddResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{41} +} +func (m *MemberAddResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberAddResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberAddResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberAddResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberAddResponse.Merge(m, src) +} +func (m *MemberAddResponse) XXX_Size() int { + return m.Size() +} +func (m *MemberAddResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MemberAddResponse.DiscardUnknown(m) } -func (m *MemberAddResponse) Reset() { *m = MemberAddResponse{} } -func (m *MemberAddResponse) String() string { return proto.CompactTextString(m) } -func (*MemberAddResponse) ProtoMessage() {} -func (*MemberAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{41} } +var xxx_messageInfo_MemberAddResponse proto.InternalMessageInfo func (m *MemberAddResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2294,13 +3265,44 @@ func (m *MemberAddResponse) GetMembers() []*Member { type MemberRemoveRequest struct { // ID is the member ID of the member to remove. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberRemoveRequest) Reset() { *m = MemberRemoveRequest{} } +func (m *MemberRemoveRequest) String() string { return proto.CompactTextString(m) } +func (*MemberRemoveRequest) ProtoMessage() {} +func (*MemberRemoveRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{42} +} +func (m *MemberRemoveRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberRemoveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberRemoveRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberRemoveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberRemoveRequest.Merge(m, src) +} +func (m *MemberRemoveRequest) XXX_Size() int { + return m.Size() +} +func (m *MemberRemoveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MemberRemoveRequest.DiscardUnknown(m) } -func (m *MemberRemoveRequest) Reset() { *m = MemberRemoveRequest{} } -func (m *MemberRemoveRequest) String() string { return proto.CompactTextString(m) } -func (*MemberRemoveRequest) ProtoMessage() {} -func (*MemberRemoveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{42} } +var xxx_messageInfo_MemberRemoveRequest proto.InternalMessageInfo func (m *MemberRemoveRequest) GetID() uint64 { if m != nil { @@ -2310,15 +3312,46 @@ func (m *MemberRemoveRequest) GetID() uint64 { } type MemberRemoveResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // members is a list of all members after removing the member. - Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` + Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberRemoveResponse) Reset() { *m = MemberRemoveResponse{} } +func (m *MemberRemoveResponse) String() string { return proto.CompactTextString(m) } +func (*MemberRemoveResponse) ProtoMessage() {} +func (*MemberRemoveResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{43} +} +func (m *MemberRemoveResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberRemoveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberRemoveResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberRemoveResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberRemoveResponse.Merge(m, src) +} +func (m *MemberRemoveResponse) XXX_Size() int { + return m.Size() +} +func (m *MemberRemoveResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MemberRemoveResponse.DiscardUnknown(m) } -func (m *MemberRemoveResponse) Reset() { *m = MemberRemoveResponse{} } -func (m *MemberRemoveResponse) String() string { return proto.CompactTextString(m) } -func (*MemberRemoveResponse) ProtoMessage() {} -func (*MemberRemoveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{43} } +var xxx_messageInfo_MemberRemoveResponse proto.InternalMessageInfo func (m *MemberRemoveResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2338,13 +3371,44 @@ type MemberUpdateRequest struct { // ID is the member ID of the member to update. ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // peerURLs is the new list of URLs the member will use to communicate with the cluster. - PeerURLs []string `protobuf:"bytes,2,rep,name=peerURLs" json:"peerURLs,omitempty"` + PeerURLs []string `protobuf:"bytes,2,rep,name=peerURLs,proto3" json:"peerURLs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberUpdateRequest) Reset() { *m = MemberUpdateRequest{} } +func (m *MemberUpdateRequest) String() string { return proto.CompactTextString(m) } +func (*MemberUpdateRequest) ProtoMessage() {} +func (*MemberUpdateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{44} +} +func (m *MemberUpdateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberUpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberUpdateRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberUpdateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberUpdateRequest.Merge(m, src) +} +func (m *MemberUpdateRequest) XXX_Size() int { + return m.Size() +} +func (m *MemberUpdateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MemberUpdateRequest.DiscardUnknown(m) } -func (m *MemberUpdateRequest) Reset() { *m = MemberUpdateRequest{} } -func (m *MemberUpdateRequest) String() string { return proto.CompactTextString(m) } -func (*MemberUpdateRequest) ProtoMessage() {} -func (*MemberUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{44} } +var xxx_messageInfo_MemberUpdateRequest proto.InternalMessageInfo func (m *MemberUpdateRequest) GetID() uint64 { if m != nil { @@ -2361,15 +3425,46 @@ func (m *MemberUpdateRequest) GetPeerURLs() []string { } type MemberUpdateResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // members is a list of all members after updating the member. - Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` + Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberUpdateResponse) Reset() { *m = MemberUpdateResponse{} } +func (m *MemberUpdateResponse) String() string { return proto.CompactTextString(m) } +func (*MemberUpdateResponse) ProtoMessage() {} +func (*MemberUpdateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{45} +} +func (m *MemberUpdateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberUpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberUpdateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberUpdateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberUpdateResponse.Merge(m, src) +} +func (m *MemberUpdateResponse) XXX_Size() int { + return m.Size() +} +func (m *MemberUpdateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MemberUpdateResponse.DiscardUnknown(m) } -func (m *MemberUpdateResponse) Reset() { *m = MemberUpdateResponse{} } -func (m *MemberUpdateResponse) String() string { return proto.CompactTextString(m) } -func (*MemberUpdateResponse) ProtoMessage() {} -func (*MemberUpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{45} } +var xxx_messageInfo_MemberUpdateResponse proto.InternalMessageInfo func (m *MemberUpdateResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2386,23 +3481,93 @@ func (m *MemberUpdateResponse) GetMembers() []*Member { } type MemberListRequest struct { + Linearizable bool `protobuf:"varint,1,opt,name=linearizable,proto3" json:"linearizable,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberListRequest) Reset() { *m = MemberListRequest{} } +func (m *MemberListRequest) String() string { return proto.CompactTextString(m) } +func (*MemberListRequest) ProtoMessage() {} +func (*MemberListRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{46} +} +func (m *MemberListRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberListRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberListRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberListRequest.Merge(m, src) +} +func (m *MemberListRequest) XXX_Size() int { + return m.Size() +} +func (m *MemberListRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MemberListRequest.DiscardUnknown(m) } -func (m *MemberListRequest) Reset() { *m = MemberListRequest{} } -func (m *MemberListRequest) String() string { return proto.CompactTextString(m) } -func (*MemberListRequest) ProtoMessage() {} -func (*MemberListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{46} } +var xxx_messageInfo_MemberListRequest proto.InternalMessageInfo + +func (m *MemberListRequest) GetLinearizable() bool { + if m != nil { + return m.Linearizable + } + return false +} type MemberListResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // members is a list of all members associated with the cluster. - Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` + Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberListResponse) Reset() { *m = MemberListResponse{} } +func (m *MemberListResponse) String() string { return proto.CompactTextString(m) } +func (*MemberListResponse) ProtoMessage() {} +func (*MemberListResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{47} +} +func (m *MemberListResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberListResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberListResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberListResponse.Merge(m, src) +} +func (m *MemberListResponse) XXX_Size() int { + return m.Size() +} +func (m *MemberListResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MemberListResponse.DiscardUnknown(m) } -func (m *MemberListResponse) Reset() { *m = MemberListResponse{} } -func (m *MemberListResponse) String() string { return proto.CompactTextString(m) } -func (*MemberListResponse) ProtoMessage() {} -func (*MemberListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{47} } +var xxx_messageInfo_MemberListResponse proto.InternalMessageInfo func (m *MemberListResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2420,13 +3585,44 @@ func (m *MemberListResponse) GetMembers() []*Member { type MemberPromoteRequest struct { // ID is the member ID of the member to promote. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberPromoteRequest) Reset() { *m = MemberPromoteRequest{} } +func (m *MemberPromoteRequest) String() string { return proto.CompactTextString(m) } +func (*MemberPromoteRequest) ProtoMessage() {} +func (*MemberPromoteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{48} +} +func (m *MemberPromoteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberPromoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberPromoteRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberPromoteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberPromoteRequest.Merge(m, src) +} +func (m *MemberPromoteRequest) XXX_Size() int { + return m.Size() +} +func (m *MemberPromoteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MemberPromoteRequest.DiscardUnknown(m) } -func (m *MemberPromoteRequest) Reset() { *m = MemberPromoteRequest{} } -func (m *MemberPromoteRequest) String() string { return proto.CompactTextString(m) } -func (*MemberPromoteRequest) ProtoMessage() {} -func (*MemberPromoteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{48} } +var xxx_messageInfo_MemberPromoteRequest proto.InternalMessageInfo func (m *MemberPromoteRequest) GetID() uint64 { if m != nil { @@ -2436,15 +3632,46 @@ func (m *MemberPromoteRequest) GetID() uint64 { } type MemberPromoteResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // members is a list of all members after promoting the member. - Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` + Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberPromoteResponse) Reset() { *m = MemberPromoteResponse{} } +func (m *MemberPromoteResponse) String() string { return proto.CompactTextString(m) } +func (*MemberPromoteResponse) ProtoMessage() {} +func (*MemberPromoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{49} +} +func (m *MemberPromoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemberPromoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemberPromoteResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemberPromoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberPromoteResponse.Merge(m, src) +} +func (m *MemberPromoteResponse) XXX_Size() int { + return m.Size() +} +func (m *MemberPromoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MemberPromoteResponse.DiscardUnknown(m) } -func (m *MemberPromoteResponse) Reset() { *m = MemberPromoteResponse{} } -func (m *MemberPromoteResponse) String() string { return proto.CompactTextString(m) } -func (*MemberPromoteResponse) ProtoMessage() {} -func (*MemberPromoteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{49} } +var xxx_messageInfo_MemberPromoteResponse proto.InternalMessageInfo func (m *MemberPromoteResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2461,21 +3688,83 @@ func (m *MemberPromoteResponse) GetMembers() []*Member { } type DefragmentRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DefragmentRequest) Reset() { *m = DefragmentRequest{} } +func (m *DefragmentRequest) String() string { return proto.CompactTextString(m) } +func (*DefragmentRequest) ProtoMessage() {} +func (*DefragmentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{50} +} +func (m *DefragmentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DefragmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DefragmentRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DefragmentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DefragmentRequest.Merge(m, src) +} +func (m *DefragmentRequest) XXX_Size() int { + return m.Size() +} +func (m *DefragmentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DefragmentRequest.DiscardUnknown(m) } -func (m *DefragmentRequest) Reset() { *m = DefragmentRequest{} } -func (m *DefragmentRequest) String() string { return proto.CompactTextString(m) } -func (*DefragmentRequest) ProtoMessage() {} -func (*DefragmentRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{50} } +var xxx_messageInfo_DefragmentRequest proto.InternalMessageInfo type DefragmentResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DefragmentResponse) Reset() { *m = DefragmentResponse{} } +func (m *DefragmentResponse) String() string { return proto.CompactTextString(m) } +func (*DefragmentResponse) ProtoMessage() {} +func (*DefragmentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{51} +} +func (m *DefragmentResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DefragmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DefragmentResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DefragmentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DefragmentResponse.Merge(m, src) +} +func (m *DefragmentResponse) XXX_Size() int { + return m.Size() +} +func (m *DefragmentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DefragmentResponse.DiscardUnknown(m) } -func (m *DefragmentResponse) Reset() { *m = DefragmentResponse{} } -func (m *DefragmentResponse) String() string { return proto.CompactTextString(m) } -func (*DefragmentResponse) ProtoMessage() {} -func (*DefragmentResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{51} } +var xxx_messageInfo_DefragmentResponse proto.InternalMessageInfo func (m *DefragmentResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2486,13 +3775,44 @@ func (m *DefragmentResponse) GetHeader() *ResponseHeader { type MoveLeaderRequest struct { // targetID is the node ID for the new leader. - TargetID uint64 `protobuf:"varint,1,opt,name=targetID,proto3" json:"targetID,omitempty"` + TargetID uint64 `protobuf:"varint,1,opt,name=targetID,proto3" json:"targetID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MoveLeaderRequest) Reset() { *m = MoveLeaderRequest{} } +func (m *MoveLeaderRequest) String() string { return proto.CompactTextString(m) } +func (*MoveLeaderRequest) ProtoMessage() {} +func (*MoveLeaderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{52} +} +func (m *MoveLeaderRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MoveLeaderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MoveLeaderRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MoveLeaderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MoveLeaderRequest.Merge(m, src) +} +func (m *MoveLeaderRequest) XXX_Size() int { + return m.Size() +} +func (m *MoveLeaderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MoveLeaderRequest.DiscardUnknown(m) } -func (m *MoveLeaderRequest) Reset() { *m = MoveLeaderRequest{} } -func (m *MoveLeaderRequest) String() string { return proto.CompactTextString(m) } -func (*MoveLeaderRequest) ProtoMessage() {} -func (*MoveLeaderRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{52} } +var xxx_messageInfo_MoveLeaderRequest proto.InternalMessageInfo func (m *MoveLeaderRequest) GetTargetID() uint64 { if m != nil { @@ -2502,13 +3822,44 @@ func (m *MoveLeaderRequest) GetTargetID() uint64 { } type MoveLeaderResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MoveLeaderResponse) Reset() { *m = MoveLeaderResponse{} } +func (m *MoveLeaderResponse) String() string { return proto.CompactTextString(m) } +func (*MoveLeaderResponse) ProtoMessage() {} +func (*MoveLeaderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{53} +} +func (m *MoveLeaderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MoveLeaderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MoveLeaderResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MoveLeaderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MoveLeaderResponse.Merge(m, src) +} +func (m *MoveLeaderResponse) XXX_Size() int { + return m.Size() +} +func (m *MoveLeaderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MoveLeaderResponse.DiscardUnknown(m) } -func (m *MoveLeaderResponse) Reset() { *m = MoveLeaderResponse{} } -func (m *MoveLeaderResponse) String() string { return proto.CompactTextString(m) } -func (*MoveLeaderResponse) ProtoMessage() {} -func (*MoveLeaderResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{53} } +var xxx_messageInfo_MoveLeaderResponse proto.InternalMessageInfo func (m *MoveLeaderResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2526,13 +3877,44 @@ type AlarmRequest struct { // alarm request covers all members. MemberID uint64 `protobuf:"varint,2,opt,name=memberID,proto3" json:"memberID,omitempty"` // alarm is the type of alarm to consider for this request. - Alarm AlarmType `protobuf:"varint,3,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` + Alarm AlarmType `protobuf:"varint,3,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AlarmRequest) Reset() { *m = AlarmRequest{} } +func (m *AlarmRequest) String() string { return proto.CompactTextString(m) } +func (*AlarmRequest) ProtoMessage() {} +func (*AlarmRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{54} +} +func (m *AlarmRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AlarmRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AlarmRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AlarmRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AlarmRequest.Merge(m, src) +} +func (m *AlarmRequest) XXX_Size() int { + return m.Size() +} +func (m *AlarmRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AlarmRequest.DiscardUnknown(m) } -func (m *AlarmRequest) Reset() { *m = AlarmRequest{} } -func (m *AlarmRequest) String() string { return proto.CompactTextString(m) } -func (*AlarmRequest) ProtoMessage() {} -func (*AlarmRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{54} } +var xxx_messageInfo_AlarmRequest proto.InternalMessageInfo func (m *AlarmRequest) GetAction() AlarmRequest_AlarmAction { if m != nil { @@ -2559,13 +3941,44 @@ type AlarmMember struct { // memberID is the ID of the member associated with the raised alarm. MemberID uint64 `protobuf:"varint,1,opt,name=memberID,proto3" json:"memberID,omitempty"` // alarm is the type of alarm which has been raised. - Alarm AlarmType `protobuf:"varint,2,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` + Alarm AlarmType `protobuf:"varint,2,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AlarmMember) Reset() { *m = AlarmMember{} } +func (m *AlarmMember) String() string { return proto.CompactTextString(m) } +func (*AlarmMember) ProtoMessage() {} +func (*AlarmMember) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{55} +} +func (m *AlarmMember) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AlarmMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AlarmMember.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AlarmMember) XXX_Merge(src proto.Message) { + xxx_messageInfo_AlarmMember.Merge(m, src) +} +func (m *AlarmMember) XXX_Size() int { + return m.Size() +} +func (m *AlarmMember) XXX_DiscardUnknown() { + xxx_messageInfo_AlarmMember.DiscardUnknown(m) } -func (m *AlarmMember) Reset() { *m = AlarmMember{} } -func (m *AlarmMember) String() string { return proto.CompactTextString(m) } -func (*AlarmMember) ProtoMessage() {} -func (*AlarmMember) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{55} } +var xxx_messageInfo_AlarmMember proto.InternalMessageInfo func (m *AlarmMember) GetMemberID() uint64 { if m != nil { @@ -2582,15 +3995,46 @@ func (m *AlarmMember) GetAlarm() AlarmType { } type AlarmResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // alarms is a list of alarms associated with the alarm request. - Alarms []*AlarmMember `protobuf:"bytes,2,rep,name=alarms" json:"alarms,omitempty"` + Alarms []*AlarmMember `protobuf:"bytes,2,rep,name=alarms,proto3" json:"alarms,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AlarmResponse) Reset() { *m = AlarmResponse{} } +func (m *AlarmResponse) String() string { return proto.CompactTextString(m) } +func (*AlarmResponse) ProtoMessage() {} +func (*AlarmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{56} +} +func (m *AlarmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AlarmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AlarmResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AlarmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AlarmResponse.Merge(m, src) +} +func (m *AlarmResponse) XXX_Size() int { + return m.Size() +} +func (m *AlarmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AlarmResponse.DiscardUnknown(m) } -func (m *AlarmResponse) Reset() { *m = AlarmResponse{} } -func (m *AlarmResponse) String() string { return proto.CompactTextString(m) } -func (*AlarmResponse) ProtoMessage() {} -func (*AlarmResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{56} } +var xxx_messageInfo_AlarmResponse proto.InternalMessageInfo func (m *AlarmResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2606,16 +4050,162 @@ func (m *AlarmResponse) GetAlarms() []*AlarmMember { return nil } +type DowngradeRequest struct { + // action is the kind of downgrade request to issue. The action may + // VALIDATE the target version, DOWNGRADE the cluster version, + // or CANCEL the current downgrading job. + Action DowngradeRequest_DowngradeAction `protobuf:"varint,1,opt,name=action,proto3,enum=etcdserverpb.DowngradeRequest_DowngradeAction" json:"action,omitempty"` + // version is the target version to downgrade. + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DowngradeRequest) Reset() { *m = DowngradeRequest{} } +func (m *DowngradeRequest) String() string { return proto.CompactTextString(m) } +func (*DowngradeRequest) ProtoMessage() {} +func (*DowngradeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{57} +} +func (m *DowngradeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DowngradeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DowngradeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DowngradeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DowngradeRequest.Merge(m, src) +} +func (m *DowngradeRequest) XXX_Size() int { + return m.Size() +} +func (m *DowngradeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DowngradeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DowngradeRequest proto.InternalMessageInfo + +func (m *DowngradeRequest) GetAction() DowngradeRequest_DowngradeAction { + if m != nil { + return m.Action + } + return DowngradeRequest_VALIDATE +} + +func (m *DowngradeRequest) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +type DowngradeResponse struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // version is the current cluster version. + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DowngradeResponse) Reset() { *m = DowngradeResponse{} } +func (m *DowngradeResponse) String() string { return proto.CompactTextString(m) } +func (*DowngradeResponse) ProtoMessage() {} +func (*DowngradeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{58} +} +func (m *DowngradeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DowngradeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DowngradeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DowngradeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DowngradeResponse.Merge(m, src) +} +func (m *DowngradeResponse) XXX_Size() int { + return m.Size() +} +func (m *DowngradeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DowngradeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DowngradeResponse proto.InternalMessageInfo + +func (m *DowngradeResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *DowngradeResponse) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + type StatusRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StatusRequest) Reset() { *m = StatusRequest{} } +func (m *StatusRequest) String() string { return proto.CompactTextString(m) } +func (*StatusRequest) ProtoMessage() {} +func (*StatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{59} +} +func (m *StatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusRequest.Merge(m, src) +} +func (m *StatusRequest) XXX_Size() int { + return m.Size() +} +func (m *StatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StatusRequest.DiscardUnknown(m) } -func (m *StatusRequest) Reset() { *m = StatusRequest{} } -func (m *StatusRequest) String() string { return proto.CompactTextString(m) } -func (*StatusRequest) ProtoMessage() {} -func (*StatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{57} } +var xxx_messageInfo_StatusRequest proto.InternalMessageInfo type StatusResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // version is the cluster protocol version used by the responding member. Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // dbSize is the size of the backend database physically allocated, in bytes, of the responding member. @@ -2629,17 +4219,48 @@ type StatusResponse struct { // raftAppliedIndex is the current raft applied index of the responding member. RaftAppliedIndex uint64 `protobuf:"varint,7,opt,name=raftAppliedIndex,proto3" json:"raftAppliedIndex,omitempty"` // errors contains alarm/health information and status. - Errors []string `protobuf:"bytes,8,rep,name=errors" json:"errors,omitempty"` + Errors []string `protobuf:"bytes,8,rep,name=errors,proto3" json:"errors,omitempty"` // dbSizeInUse is the size of the backend database logically in use, in bytes, of the responding member. DbSizeInUse int64 `protobuf:"varint,9,opt,name=dbSizeInUse,proto3" json:"dbSizeInUse,omitempty"` // isLearner indicates if the member is raft learner. - IsLearner bool `protobuf:"varint,10,opt,name=isLearner,proto3" json:"isLearner,omitempty"` + IsLearner bool `protobuf:"varint,10,opt,name=isLearner,proto3" json:"isLearner,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StatusResponse) Reset() { *m = StatusResponse{} } +func (m *StatusResponse) String() string { return proto.CompactTextString(m) } +func (*StatusResponse) ProtoMessage() {} +func (*StatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{60} +} +func (m *StatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusResponse.Merge(m, src) +} +func (m *StatusResponse) XXX_Size() int { + return m.Size() +} +func (m *StatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StatusResponse.DiscardUnknown(m) } -func (m *StatusResponse) Reset() { *m = StatusResponse{} } -func (m *StatusResponse) String() string { return proto.CompactTextString(m) } -func (*StatusResponse) ProtoMessage() {} -func (*StatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{58} } +var xxx_messageInfo_StatusResponse proto.InternalMessageInfo func (m *StatusResponse) GetHeader() *ResponseHeader { if m != nil { @@ -2712,30 +4333,162 @@ func (m *StatusResponse) GetIsLearner() bool { } type AuthEnableRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthEnableRequest) Reset() { *m = AuthEnableRequest{} } +func (m *AuthEnableRequest) String() string { return proto.CompactTextString(m) } +func (*AuthEnableRequest) ProtoMessage() {} +func (*AuthEnableRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{61} +} +func (m *AuthEnableRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthEnableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthEnableRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } - -func (m *AuthEnableRequest) Reset() { *m = AuthEnableRequest{} } -func (m *AuthEnableRequest) String() string { return proto.CompactTextString(m) } -func (*AuthEnableRequest) ProtoMessage() {} -func (*AuthEnableRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{59} } - -type AuthDisableRequest struct { +func (m *AuthEnableRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthEnableRequest.Merge(m, src) } - -func (m *AuthDisableRequest) Reset() { *m = AuthDisableRequest{} } -func (m *AuthDisableRequest) String() string { return proto.CompactTextString(m) } -func (*AuthDisableRequest) ProtoMessage() {} -func (*AuthDisableRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{60} } - -type AuthenticateRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` +func (m *AuthEnableRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthEnableRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthEnableRequest.DiscardUnknown(m) } -func (m *AuthenticateRequest) Reset() { *m = AuthenticateRequest{} } -func (m *AuthenticateRequest) String() string { return proto.CompactTextString(m) } -func (*AuthenticateRequest) ProtoMessage() {} -func (*AuthenticateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{61} } +var xxx_messageInfo_AuthEnableRequest proto.InternalMessageInfo + +type AuthDisableRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthDisableRequest) Reset() { *m = AuthDisableRequest{} } +func (m *AuthDisableRequest) String() string { return proto.CompactTextString(m) } +func (*AuthDisableRequest) ProtoMessage() {} +func (*AuthDisableRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{62} +} +func (m *AuthDisableRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthDisableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthDisableRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthDisableRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthDisableRequest.Merge(m, src) +} +func (m *AuthDisableRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthDisableRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthDisableRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthDisableRequest proto.InternalMessageInfo + +type AuthStatusRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthStatusRequest) Reset() { *m = AuthStatusRequest{} } +func (m *AuthStatusRequest) String() string { return proto.CompactTextString(m) } +func (*AuthStatusRequest) ProtoMessage() {} +func (*AuthStatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{63} +} +func (m *AuthStatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthStatusRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthStatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthStatusRequest.Merge(m, src) +} +func (m *AuthStatusRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthStatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthStatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthStatusRequest proto.InternalMessageInfo + +type AuthenticateRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthenticateRequest) Reset() { *m = AuthenticateRequest{} } +func (m *AuthenticateRequest) String() string { return proto.CompactTextString(m) } +func (*AuthenticateRequest) ProtoMessage() {} +func (*AuthenticateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{64} +} +func (m *AuthenticateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthenticateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthenticateRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthenticateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthenticateRequest.Merge(m, src) +} +func (m *AuthenticateRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthenticateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthenticateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthenticateRequest proto.InternalMessageInfo func (m *AuthenticateRequest) GetName() string { if m != nil { @@ -2752,15 +4505,47 @@ func (m *AuthenticateRequest) GetPassword() string { } type AuthUserAddRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - Options *authpb.UserAddOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + Options *authpb.UserAddOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` + HashedPassword string `protobuf:"bytes,4,opt,name=hashedPassword,proto3" json:"hashedPassword,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserAddRequest) Reset() { *m = AuthUserAddRequest{} } +func (m *AuthUserAddRequest) String() string { return proto.CompactTextString(m) } +func (*AuthUserAddRequest) ProtoMessage() {} +func (*AuthUserAddRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{65} +} +func (m *AuthUserAddRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserAddRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserAddRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserAddRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserAddRequest.Merge(m, src) +} +func (m *AuthUserAddRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthUserAddRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserAddRequest.DiscardUnknown(m) } -func (m *AuthUserAddRequest) Reset() { *m = AuthUserAddRequest{} } -func (m *AuthUserAddRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserAddRequest) ProtoMessage() {} -func (*AuthUserAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{62} } +var xxx_messageInfo_AuthUserAddRequest proto.InternalMessageInfo func (m *AuthUserAddRequest) GetName() string { if m != nil { @@ -2783,14 +4568,52 @@ func (m *AuthUserAddRequest) GetOptions() *authpb.UserAddOptions { return nil } +func (m *AuthUserAddRequest) GetHashedPassword() string { + if m != nil { + return m.HashedPassword + } + return "" +} + type AuthUserGetRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserGetRequest) Reset() { *m = AuthUserGetRequest{} } +func (m *AuthUserGetRequest) String() string { return proto.CompactTextString(m) } +func (*AuthUserGetRequest) ProtoMessage() {} +func (*AuthUserGetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{66} +} +func (m *AuthUserGetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserGetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserGetRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserGetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserGetRequest.Merge(m, src) +} +func (m *AuthUserGetRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthUserGetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserGetRequest.DiscardUnknown(m) } -func (m *AuthUserGetRequest) Reset() { *m = AuthUserGetRequest{} } -func (m *AuthUserGetRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserGetRequest) ProtoMessage() {} -func (*AuthUserGetRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{63} } +var xxx_messageInfo_AuthUserGetRequest proto.InternalMessageInfo func (m *AuthUserGetRequest) GetName() string { if m != nil { @@ -2801,13 +4624,44 @@ func (m *AuthUserGetRequest) GetName() string { type AuthUserDeleteRequest struct { // name is the name of the user to delete. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserDeleteRequest) Reset() { *m = AuthUserDeleteRequest{} } +func (m *AuthUserDeleteRequest) String() string { return proto.CompactTextString(m) } +func (*AuthUserDeleteRequest) ProtoMessage() {} +func (*AuthUserDeleteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{67} +} +func (m *AuthUserDeleteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserDeleteRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserDeleteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserDeleteRequest.Merge(m, src) +} +func (m *AuthUserDeleteRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthUserDeleteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserDeleteRequest.DiscardUnknown(m) } -func (m *AuthUserDeleteRequest) Reset() { *m = AuthUserDeleteRequest{} } -func (m *AuthUserDeleteRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserDeleteRequest) ProtoMessage() {} -func (*AuthUserDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{64} } +var xxx_messageInfo_AuthUserDeleteRequest proto.InternalMessageInfo func (m *AuthUserDeleteRequest) GetName() string { if m != nil { @@ -2819,17 +4673,48 @@ func (m *AuthUserDeleteRequest) GetName() string { type AuthUserChangePasswordRequest struct { // name is the name of the user whose password is being changed. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // password is the new password for the user. + // password is the new password for the user. Note that this field will be removed in the API layer. Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + // hashedPassword is the new password for the user. Note that this field will be initialized in the API layer. + HashedPassword string `protobuf:"bytes,3,opt,name=hashedPassword,proto3" json:"hashedPassword,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AuthUserChangePasswordRequest) Reset() { *m = AuthUserChangePasswordRequest{} } func (m *AuthUserChangePasswordRequest) String() string { return proto.CompactTextString(m) } func (*AuthUserChangePasswordRequest) ProtoMessage() {} func (*AuthUserChangePasswordRequest) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{65} + return fileDescriptor_77a6da22d6a3feb1, []int{68} +} +func (m *AuthUserChangePasswordRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserChangePasswordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserChangePasswordRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserChangePasswordRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserChangePasswordRequest.Merge(m, src) +} +func (m *AuthUserChangePasswordRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthUserChangePasswordRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserChangePasswordRequest.DiscardUnknown(m) } +var xxx_messageInfo_AuthUserChangePasswordRequest proto.InternalMessageInfo + func (m *AuthUserChangePasswordRequest) GetName() string { if m != nil { return m.Name @@ -2844,17 +4729,55 @@ func (m *AuthUserChangePasswordRequest) GetPassword() string { return "" } +func (m *AuthUserChangePasswordRequest) GetHashedPassword() string { + if m != nil { + return m.HashedPassword + } + return "" +} + type AuthUserGrantRoleRequest struct { // user is the name of the user which should be granted a given role. User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // role is the name of the role to grant to the user. - Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` + Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserGrantRoleRequest) Reset() { *m = AuthUserGrantRoleRequest{} } +func (m *AuthUserGrantRoleRequest) String() string { return proto.CompactTextString(m) } +func (*AuthUserGrantRoleRequest) ProtoMessage() {} +func (*AuthUserGrantRoleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{69} +} +func (m *AuthUserGrantRoleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserGrantRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserGrantRoleRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserGrantRoleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserGrantRoleRequest.Merge(m, src) +} +func (m *AuthUserGrantRoleRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthUserGrantRoleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserGrantRoleRequest.DiscardUnknown(m) } -func (m *AuthUserGrantRoleRequest) Reset() { *m = AuthUserGrantRoleRequest{} } -func (m *AuthUserGrantRoleRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserGrantRoleRequest) ProtoMessage() {} -func (*AuthUserGrantRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{66} } +var xxx_messageInfo_AuthUserGrantRoleRequest proto.InternalMessageInfo func (m *AuthUserGrantRoleRequest) GetUser() string { if m != nil { @@ -2871,14 +4794,45 @@ func (m *AuthUserGrantRoleRequest) GetRole() string { } type AuthUserRevokeRoleRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserRevokeRoleRequest) Reset() { *m = AuthUserRevokeRoleRequest{} } +func (m *AuthUserRevokeRoleRequest) String() string { return proto.CompactTextString(m) } +func (*AuthUserRevokeRoleRequest) ProtoMessage() {} +func (*AuthUserRevokeRoleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{70} +} +func (m *AuthUserRevokeRoleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserRevokeRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserRevokeRoleRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserRevokeRoleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserRevokeRoleRequest.Merge(m, src) +} +func (m *AuthUserRevokeRoleRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthUserRevokeRoleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserRevokeRoleRequest.DiscardUnknown(m) } -func (m *AuthUserRevokeRoleRequest) Reset() { *m = AuthUserRevokeRoleRequest{} } -func (m *AuthUserRevokeRoleRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserRevokeRoleRequest) ProtoMessage() {} -func (*AuthUserRevokeRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{67} } +var xxx_messageInfo_AuthUserRevokeRoleRequest proto.InternalMessageInfo func (m *AuthUserRevokeRoleRequest) GetName() string { if m != nil { @@ -2896,13 +4850,44 @@ func (m *AuthUserRevokeRoleRequest) GetRole() string { type AuthRoleAddRequest struct { // name is the name of the role to add to the authentication system. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthRoleAddRequest) Reset() { *m = AuthRoleAddRequest{} } +func (m *AuthRoleAddRequest) String() string { return proto.CompactTextString(m) } +func (*AuthRoleAddRequest) ProtoMessage() {} +func (*AuthRoleAddRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{71} +} +func (m *AuthRoleAddRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleAddRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleAddRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleAddRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleAddRequest.Merge(m, src) +} +func (m *AuthRoleAddRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleAddRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleAddRequest.DiscardUnknown(m) } -func (m *AuthRoleAddRequest) Reset() { *m = AuthRoleAddRequest{} } -func (m *AuthRoleAddRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleAddRequest) ProtoMessage() {} -func (*AuthRoleAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{68} } +var xxx_messageInfo_AuthRoleAddRequest proto.InternalMessageInfo func (m *AuthRoleAddRequest) GetName() string { if m != nil { @@ -2912,13 +4897,44 @@ func (m *AuthRoleAddRequest) GetName() string { } type AuthRoleGetRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthRoleGetRequest) Reset() { *m = AuthRoleGetRequest{} } +func (m *AuthRoleGetRequest) String() string { return proto.CompactTextString(m) } +func (*AuthRoleGetRequest) ProtoMessage() {} +func (*AuthRoleGetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{72} +} +func (m *AuthRoleGetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleGetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleGetRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleGetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleGetRequest.Merge(m, src) +} +func (m *AuthRoleGetRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleGetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleGetRequest.DiscardUnknown(m) } -func (m *AuthRoleGetRequest) Reset() { *m = AuthRoleGetRequest{} } -func (m *AuthRoleGetRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGetRequest) ProtoMessage() {} -func (*AuthRoleGetRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{69} } +var xxx_messageInfo_AuthRoleGetRequest proto.InternalMessageInfo func (m *AuthRoleGetRequest) GetRole() string { if m != nil { @@ -2928,29 +4944,122 @@ func (m *AuthRoleGetRequest) GetRole() string { } type AuthUserListRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserListRequest) Reset() { *m = AuthUserListRequest{} } +func (m *AuthUserListRequest) String() string { return proto.CompactTextString(m) } +func (*AuthUserListRequest) ProtoMessage() {} +func (*AuthUserListRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{73} +} +func (m *AuthUserListRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserListRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserListRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserListRequest.Merge(m, src) +} +func (m *AuthUserListRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthUserListRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserListRequest.DiscardUnknown(m) } -func (m *AuthUserListRequest) Reset() { *m = AuthUserListRequest{} } -func (m *AuthUserListRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserListRequest) ProtoMessage() {} -func (*AuthUserListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{70} } +var xxx_messageInfo_AuthUserListRequest proto.InternalMessageInfo type AuthRoleListRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthRoleListRequest) Reset() { *m = AuthRoleListRequest{} } +func (m *AuthRoleListRequest) String() string { return proto.CompactTextString(m) } +func (*AuthRoleListRequest) ProtoMessage() {} +func (*AuthRoleListRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{74} +} +func (m *AuthRoleListRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleListRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleListRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleListRequest.Merge(m, src) +} +func (m *AuthRoleListRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleListRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleListRequest.DiscardUnknown(m) } -func (m *AuthRoleListRequest) Reset() { *m = AuthRoleListRequest{} } -func (m *AuthRoleListRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleListRequest) ProtoMessage() {} -func (*AuthRoleListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{71} } +var xxx_messageInfo_AuthRoleListRequest proto.InternalMessageInfo type AuthRoleDeleteRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthRoleDeleteRequest) Reset() { *m = AuthRoleDeleteRequest{} } +func (m *AuthRoleDeleteRequest) String() string { return proto.CompactTextString(m) } +func (*AuthRoleDeleteRequest) ProtoMessage() {} +func (*AuthRoleDeleteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{75} +} +func (m *AuthRoleDeleteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleDeleteRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleDeleteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleDeleteRequest.Merge(m, src) +} +func (m *AuthRoleDeleteRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleDeleteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleDeleteRequest.DiscardUnknown(m) } -func (m *AuthRoleDeleteRequest) Reset() { *m = AuthRoleDeleteRequest{} } -func (m *AuthRoleDeleteRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleDeleteRequest) ProtoMessage() {} -func (*AuthRoleDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{72} } +var xxx_messageInfo_AuthRoleDeleteRequest proto.InternalMessageInfo func (m *AuthRoleDeleteRequest) GetRole() string { if m != nil { @@ -2963,16 +5072,45 @@ type AuthRoleGrantPermissionRequest struct { // name is the name of the role which will be granted the permission. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // perm is the permission to grant to the role. - Perm *authpb.Permission `protobuf:"bytes,2,opt,name=perm" json:"perm,omitempty"` + Perm *authpb.Permission `protobuf:"bytes,2,opt,name=perm,proto3" json:"perm,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AuthRoleGrantPermissionRequest) Reset() { *m = AuthRoleGrantPermissionRequest{} } func (m *AuthRoleGrantPermissionRequest) String() string { return proto.CompactTextString(m) } func (*AuthRoleGrantPermissionRequest) ProtoMessage() {} func (*AuthRoleGrantPermissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{73} + return fileDescriptor_77a6da22d6a3feb1, []int{76} +} +func (m *AuthRoleGrantPermissionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleGrantPermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleGrantPermissionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleGrantPermissionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleGrantPermissionRequest.Merge(m, src) +} +func (m *AuthRoleGrantPermissionRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleGrantPermissionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleGrantPermissionRequest.DiscardUnknown(m) } +var xxx_messageInfo_AuthRoleGrantPermissionRequest proto.InternalMessageInfo + func (m *AuthRoleGrantPermissionRequest) GetName() string { if m != nil { return m.Name @@ -2988,17 +5126,46 @@ func (m *AuthRoleGrantPermissionRequest) GetPerm() *authpb.Permission { } type AuthRoleRevokePermissionRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AuthRoleRevokePermissionRequest) Reset() { *m = AuthRoleRevokePermissionRequest{} } func (m *AuthRoleRevokePermissionRequest) String() string { return proto.CompactTextString(m) } func (*AuthRoleRevokePermissionRequest) ProtoMessage() {} func (*AuthRoleRevokePermissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{74} + return fileDescriptor_77a6da22d6a3feb1, []int{77} +} +func (m *AuthRoleRevokePermissionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleRevokePermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleRevokePermissionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleRevokePermissionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleRevokePermissionRequest.Merge(m, src) +} +func (m *AuthRoleRevokePermissionRequest) XXX_Size() int { + return m.Size() } +func (m *AuthRoleRevokePermissionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleRevokePermissionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthRoleRevokePermissionRequest proto.InternalMessageInfo func (m *AuthRoleRevokePermissionRequest) GetRole() string { if m != nil { @@ -3022,13 +5189,44 @@ func (m *AuthRoleRevokePermissionRequest) GetRangeEnd() []byte { } type AuthEnableResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthEnableResponse) Reset() { *m = AuthEnableResponse{} } +func (m *AuthEnableResponse) String() string { return proto.CompactTextString(m) } +func (*AuthEnableResponse) ProtoMessage() {} +func (*AuthEnableResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{78} +} +func (m *AuthEnableResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthEnableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthEnableResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthEnableResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthEnableResponse.Merge(m, src) +} +func (m *AuthEnableResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthEnableResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthEnableResponse.DiscardUnknown(m) } -func (m *AuthEnableResponse) Reset() { *m = AuthEnableResponse{} } -func (m *AuthEnableResponse) String() string { return proto.CompactTextString(m) } -func (*AuthEnableResponse) ProtoMessage() {} -func (*AuthEnableResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{75} } +var xxx_messageInfo_AuthEnableResponse proto.InternalMessageInfo func (m *AuthEnableResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3038,13 +5236,44 @@ func (m *AuthEnableResponse) GetHeader() *ResponseHeader { } type AuthDisableResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthDisableResponse) Reset() { *m = AuthDisableResponse{} } +func (m *AuthDisableResponse) String() string { return proto.CompactTextString(m) } +func (*AuthDisableResponse) ProtoMessage() {} +func (*AuthDisableResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{79} +} +func (m *AuthDisableResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthDisableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthDisableResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthDisableResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthDisableResponse.Merge(m, src) +} +func (m *AuthDisableResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthDisableResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthDisableResponse.DiscardUnknown(m) } -func (m *AuthDisableResponse) Reset() { *m = AuthDisableResponse{} } -func (m *AuthDisableResponse) String() string { return proto.CompactTextString(m) } -func (*AuthDisableResponse) ProtoMessage() {} -func (*AuthDisableResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{76} } +var xxx_messageInfo_AuthDisableResponse proto.InternalMessageInfo func (m *AuthDisableResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3053,16 +5282,111 @@ func (m *AuthDisableResponse) GetHeader() *ResponseHeader { return nil } +type AuthStatusResponse struct { + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` + // authRevision is the current revision of auth store + AuthRevision uint64 `protobuf:"varint,3,opt,name=authRevision,proto3" json:"authRevision,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthStatusResponse) Reset() { *m = AuthStatusResponse{} } +func (m *AuthStatusResponse) String() string { return proto.CompactTextString(m) } +func (*AuthStatusResponse) ProtoMessage() {} +func (*AuthStatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{80} +} +func (m *AuthStatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthStatusResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthStatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthStatusResponse.Merge(m, src) +} +func (m *AuthStatusResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthStatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthStatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthStatusResponse proto.InternalMessageInfo + +func (m *AuthStatusResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *AuthStatusResponse) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *AuthStatusResponse) GetAuthRevision() uint64 { + if m != nil { + return m.AuthRevision + } + return 0 +} + type AuthenticateResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // token is an authorized token that can be used in succeeding RPCs - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthenticateResponse) Reset() { *m = AuthenticateResponse{} } +func (m *AuthenticateResponse) String() string { return proto.CompactTextString(m) } +func (*AuthenticateResponse) ProtoMessage() {} +func (*AuthenticateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{81} +} +func (m *AuthenticateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthenticateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthenticateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthenticateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthenticateResponse.Merge(m, src) +} +func (m *AuthenticateResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthenticateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthenticateResponse.DiscardUnknown(m) } -func (m *AuthenticateResponse) Reset() { *m = AuthenticateResponse{} } -func (m *AuthenticateResponse) String() string { return proto.CompactTextString(m) } -func (*AuthenticateResponse) ProtoMessage() {} -func (*AuthenticateResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{77} } +var xxx_messageInfo_AuthenticateResponse proto.InternalMessageInfo func (m *AuthenticateResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3079,13 +5403,44 @@ func (m *AuthenticateResponse) GetToken() string { } type AuthUserAddResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserAddResponse) Reset() { *m = AuthUserAddResponse{} } +func (m *AuthUserAddResponse) String() string { return proto.CompactTextString(m) } +func (*AuthUserAddResponse) ProtoMessage() {} +func (*AuthUserAddResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{82} +} +func (m *AuthUserAddResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserAddResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserAddResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserAddResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserAddResponse.Merge(m, src) +} +func (m *AuthUserAddResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthUserAddResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserAddResponse.DiscardUnknown(m) } -func (m *AuthUserAddResponse) Reset() { *m = AuthUserAddResponse{} } -func (m *AuthUserAddResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserAddResponse) ProtoMessage() {} -func (*AuthUserAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{78} } +var xxx_messageInfo_AuthUserAddResponse proto.InternalMessageInfo func (m *AuthUserAddResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3095,14 +5450,45 @@ func (m *AuthUserAddResponse) GetHeader() *ResponseHeader { } type AuthUserGetResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Roles []string `protobuf:"bytes,2,rep,name=roles" json:"roles,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserGetResponse) Reset() { *m = AuthUserGetResponse{} } +func (m *AuthUserGetResponse) String() string { return proto.CompactTextString(m) } +func (*AuthUserGetResponse) ProtoMessage() {} +func (*AuthUserGetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{83} +} +func (m *AuthUserGetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserGetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserGetResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserGetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserGetResponse.Merge(m, src) +} +func (m *AuthUserGetResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthUserGetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserGetResponse.DiscardUnknown(m) } -func (m *AuthUserGetResponse) Reset() { *m = AuthUserGetResponse{} } -func (m *AuthUserGetResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserGetResponse) ProtoMessage() {} -func (*AuthUserGetResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{79} } +var xxx_messageInfo_AuthUserGetResponse proto.InternalMessageInfo func (m *AuthUserGetResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3119,13 +5505,44 @@ func (m *AuthUserGetResponse) GetRoles() []string { } type AuthUserDeleteResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserDeleteResponse) Reset() { *m = AuthUserDeleteResponse{} } +func (m *AuthUserDeleteResponse) String() string { return proto.CompactTextString(m) } +func (*AuthUserDeleteResponse) ProtoMessage() {} +func (*AuthUserDeleteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{84} +} +func (m *AuthUserDeleteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserDeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserDeleteResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserDeleteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserDeleteResponse.Merge(m, src) +} +func (m *AuthUserDeleteResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthUserDeleteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserDeleteResponse.DiscardUnknown(m) } -func (m *AuthUserDeleteResponse) Reset() { *m = AuthUserDeleteResponse{} } -func (m *AuthUserDeleteResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserDeleteResponse) ProtoMessage() {} -func (*AuthUserDeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{80} } +var xxx_messageInfo_AuthUserDeleteResponse proto.InternalMessageInfo func (m *AuthUserDeleteResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3135,15 +5552,44 @@ func (m *AuthUserDeleteResponse) GetHeader() *ResponseHeader { } type AuthUserChangePasswordResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AuthUserChangePasswordResponse) Reset() { *m = AuthUserChangePasswordResponse{} } func (m *AuthUserChangePasswordResponse) String() string { return proto.CompactTextString(m) } func (*AuthUserChangePasswordResponse) ProtoMessage() {} func (*AuthUserChangePasswordResponse) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{81} + return fileDescriptor_77a6da22d6a3feb1, []int{85} +} +func (m *AuthUserChangePasswordResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } +func (m *AuthUserChangePasswordResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserChangePasswordResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserChangePasswordResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserChangePasswordResponse.Merge(m, src) +} +func (m *AuthUserChangePasswordResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthUserChangePasswordResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserChangePasswordResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthUserChangePasswordResponse proto.InternalMessageInfo func (m *AuthUserChangePasswordResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3153,13 +5599,44 @@ func (m *AuthUserChangePasswordResponse) GetHeader() *ResponseHeader { } type AuthUserGrantRoleResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserGrantRoleResponse) Reset() { *m = AuthUserGrantRoleResponse{} } +func (m *AuthUserGrantRoleResponse) String() string { return proto.CompactTextString(m) } +func (*AuthUserGrantRoleResponse) ProtoMessage() {} +func (*AuthUserGrantRoleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{86} +} +func (m *AuthUserGrantRoleResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserGrantRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserGrantRoleResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserGrantRoleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserGrantRoleResponse.Merge(m, src) +} +func (m *AuthUserGrantRoleResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthUserGrantRoleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserGrantRoleResponse.DiscardUnknown(m) } -func (m *AuthUserGrantRoleResponse) Reset() { *m = AuthUserGrantRoleResponse{} } -func (m *AuthUserGrantRoleResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserGrantRoleResponse) ProtoMessage() {} -func (*AuthUserGrantRoleResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{82} } +var xxx_messageInfo_AuthUserGrantRoleResponse proto.InternalMessageInfo func (m *AuthUserGrantRoleResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3169,13 +5646,44 @@ func (m *AuthUserGrantRoleResponse) GetHeader() *ResponseHeader { } type AuthUserRevokeRoleResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserRevokeRoleResponse) Reset() { *m = AuthUserRevokeRoleResponse{} } +func (m *AuthUserRevokeRoleResponse) String() string { return proto.CompactTextString(m) } +func (*AuthUserRevokeRoleResponse) ProtoMessage() {} +func (*AuthUserRevokeRoleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{87} +} +func (m *AuthUserRevokeRoleResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserRevokeRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserRevokeRoleResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserRevokeRoleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserRevokeRoleResponse.Merge(m, src) +} +func (m *AuthUserRevokeRoleResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthUserRevokeRoleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserRevokeRoleResponse.DiscardUnknown(m) } -func (m *AuthUserRevokeRoleResponse) Reset() { *m = AuthUserRevokeRoleResponse{} } -func (m *AuthUserRevokeRoleResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserRevokeRoleResponse) ProtoMessage() {} -func (*AuthUserRevokeRoleResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{83} } +var xxx_messageInfo_AuthUserRevokeRoleResponse proto.InternalMessageInfo func (m *AuthUserRevokeRoleResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3185,13 +5693,44 @@ func (m *AuthUserRevokeRoleResponse) GetHeader() *ResponseHeader { } type AuthRoleAddResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthRoleAddResponse) Reset() { *m = AuthRoleAddResponse{} } +func (m *AuthRoleAddResponse) String() string { return proto.CompactTextString(m) } +func (*AuthRoleAddResponse) ProtoMessage() {} +func (*AuthRoleAddResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{88} +} +func (m *AuthRoleAddResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleAddResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleAddResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleAddResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleAddResponse.Merge(m, src) +} +func (m *AuthRoleAddResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleAddResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleAddResponse.DiscardUnknown(m) } -func (m *AuthRoleAddResponse) Reset() { *m = AuthRoleAddResponse{} } -func (m *AuthRoleAddResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleAddResponse) ProtoMessage() {} -func (*AuthRoleAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{84} } +var xxx_messageInfo_AuthRoleAddResponse proto.InternalMessageInfo func (m *AuthRoleAddResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3201,14 +5740,45 @@ func (m *AuthRoleAddResponse) GetHeader() *ResponseHeader { } type AuthRoleGetResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Perm []*authpb.Permission `protobuf:"bytes,2,rep,name=perm" json:"perm,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Perm []*authpb.Permission `protobuf:"bytes,2,rep,name=perm,proto3" json:"perm,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthRoleGetResponse) Reset() { *m = AuthRoleGetResponse{} } +func (m *AuthRoleGetResponse) String() string { return proto.CompactTextString(m) } +func (*AuthRoleGetResponse) ProtoMessage() {} +func (*AuthRoleGetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{89} +} +func (m *AuthRoleGetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleGetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleGetResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleGetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleGetResponse.Merge(m, src) +} +func (m *AuthRoleGetResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleGetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleGetResponse.DiscardUnknown(m) } -func (m *AuthRoleGetResponse) Reset() { *m = AuthRoleGetResponse{} } -func (m *AuthRoleGetResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGetResponse) ProtoMessage() {} -func (*AuthRoleGetResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{85} } +var xxx_messageInfo_AuthRoleGetResponse proto.InternalMessageInfo func (m *AuthRoleGetResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3225,14 +5795,45 @@ func (m *AuthRoleGetResponse) GetPerm() []*authpb.Permission { } type AuthRoleListResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Roles []string `protobuf:"bytes,2,rep,name=roles" json:"roles,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthRoleListResponse) Reset() { *m = AuthRoleListResponse{} } +func (m *AuthRoleListResponse) String() string { return proto.CompactTextString(m) } +func (*AuthRoleListResponse) ProtoMessage() {} +func (*AuthRoleListResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{90} +} +func (m *AuthRoleListResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleListResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleListResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleListResponse.Merge(m, src) +} +func (m *AuthRoleListResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleListResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleListResponse.DiscardUnknown(m) } -func (m *AuthRoleListResponse) Reset() { *m = AuthRoleListResponse{} } -func (m *AuthRoleListResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleListResponse) ProtoMessage() {} -func (*AuthRoleListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{86} } +var xxx_messageInfo_AuthRoleListResponse proto.InternalMessageInfo func (m *AuthRoleListResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3249,14 +5850,45 @@ func (m *AuthRoleListResponse) GetRoles() []string { } type AuthUserListResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Users []string `protobuf:"bytes,2,rep,name=users" json:"users,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Users []string `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthUserListResponse) Reset() { *m = AuthUserListResponse{} } +func (m *AuthUserListResponse) String() string { return proto.CompactTextString(m) } +func (*AuthUserListResponse) ProtoMessage() {} +func (*AuthUserListResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{91} +} +func (m *AuthUserListResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthUserListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthUserListResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthUserListResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthUserListResponse.Merge(m, src) +} +func (m *AuthUserListResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthUserListResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthUserListResponse.DiscardUnknown(m) } -func (m *AuthUserListResponse) Reset() { *m = AuthUserListResponse{} } -func (m *AuthUserListResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserListResponse) ProtoMessage() {} -func (*AuthUserListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{87} } +var xxx_messageInfo_AuthUserListResponse proto.InternalMessageInfo func (m *AuthUserListResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3273,13 +5905,44 @@ func (m *AuthUserListResponse) GetUsers() []string { } type AuthRoleDeleteResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthRoleDeleteResponse) Reset() { *m = AuthRoleDeleteResponse{} } +func (m *AuthRoleDeleteResponse) String() string { return proto.CompactTextString(m) } +func (*AuthRoleDeleteResponse) ProtoMessage() {} +func (*AuthRoleDeleteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_77a6da22d6a3feb1, []int{92} +} +func (m *AuthRoleDeleteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleDeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleDeleteResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleDeleteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleDeleteResponse.Merge(m, src) +} +func (m *AuthRoleDeleteResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleDeleteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleDeleteResponse.DiscardUnknown(m) } -func (m *AuthRoleDeleteResponse) Reset() { *m = AuthRoleDeleteResponse{} } -func (m *AuthRoleDeleteResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleDeleteResponse) ProtoMessage() {} -func (*AuthRoleDeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{88} } +var xxx_messageInfo_AuthRoleDeleteResponse proto.InternalMessageInfo func (m *AuthRoleDeleteResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3289,33 +5952,91 @@ func (m *AuthRoleDeleteResponse) GetHeader() *ResponseHeader { } type AuthRoleGrantPermissionResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AuthRoleGrantPermissionResponse) Reset() { *m = AuthRoleGrantPermissionResponse{} } func (m *AuthRoleGrantPermissionResponse) String() string { return proto.CompactTextString(m) } func (*AuthRoleGrantPermissionResponse) ProtoMessage() {} func (*AuthRoleGrantPermissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{89} + return fileDescriptor_77a6da22d6a3feb1, []int{93} } - -func (m *AuthRoleGrantPermissionResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil +func (m *AuthRoleGrantPermissionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthRoleGrantPermissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleGrantPermissionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleGrantPermissionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleGrantPermissionResponse.Merge(m, src) +} +func (m *AuthRoleGrantPermissionResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleGrantPermissionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleGrantPermissionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthRoleGrantPermissionResponse proto.InternalMessageInfo + +func (m *AuthRoleGrantPermissionResponse) GetHeader() *ResponseHeader { + if m != nil { + return m.Header + } + return nil } type AuthRoleRevokePermissionResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AuthRoleRevokePermissionResponse) Reset() { *m = AuthRoleRevokePermissionResponse{} } func (m *AuthRoleRevokePermissionResponse) String() string { return proto.CompactTextString(m) } func (*AuthRoleRevokePermissionResponse) ProtoMessage() {} func (*AuthRoleRevokePermissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{90} + return fileDescriptor_77a6da22d6a3feb1, []int{94} +} +func (m *AuthRoleRevokePermissionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } +func (m *AuthRoleRevokePermissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthRoleRevokePermissionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuthRoleRevokePermissionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRoleRevokePermissionResponse.Merge(m, src) +} +func (m *AuthRoleRevokePermissionResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthRoleRevokePermissionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRoleRevokePermissionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthRoleRevokePermissionResponse proto.InternalMessageInfo func (m *AuthRoleRevokePermissionResponse) GetHeader() *ResponseHeader { if m != nil { @@ -3325,6 +6046,14 @@ func (m *AuthRoleRevokePermissionResponse) GetHeader() *ResponseHeader { } func init() { + proto.RegisterEnum("etcdserverpb.AlarmType", AlarmType_name, AlarmType_value) + proto.RegisterEnum("etcdserverpb.RangeRequest_SortOrder", RangeRequest_SortOrder_name, RangeRequest_SortOrder_value) + proto.RegisterEnum("etcdserverpb.RangeRequest_SortTarget", RangeRequest_SortTarget_name, RangeRequest_SortTarget_value) + proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value) + proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value) + proto.RegisterEnum("etcdserverpb.WatchCreateRequest_FilterType", WatchCreateRequest_FilterType_name, WatchCreateRequest_FilterType_value) + proto.RegisterEnum("etcdserverpb.AlarmRequest_AlarmAction", AlarmRequest_AlarmAction_name, AlarmRequest_AlarmAction_value) + proto.RegisterEnum("etcdserverpb.DowngradeRequest_DowngradeAction", DowngradeRequest_DowngradeAction_name, DowngradeRequest_DowngradeAction_value) proto.RegisterType((*ResponseHeader)(nil), "etcdserverpb.ResponseHeader") proto.RegisterType((*RangeRequest)(nil), "etcdserverpb.RangeRequest") proto.RegisterType((*RangeResponse)(nil), "etcdserverpb.RangeResponse") @@ -3382,10 +6111,13 @@ func init() { proto.RegisterType((*AlarmRequest)(nil), "etcdserverpb.AlarmRequest") proto.RegisterType((*AlarmMember)(nil), "etcdserverpb.AlarmMember") proto.RegisterType((*AlarmResponse)(nil), "etcdserverpb.AlarmResponse") + proto.RegisterType((*DowngradeRequest)(nil), "etcdserverpb.DowngradeRequest") + proto.RegisterType((*DowngradeResponse)(nil), "etcdserverpb.DowngradeResponse") proto.RegisterType((*StatusRequest)(nil), "etcdserverpb.StatusRequest") proto.RegisterType((*StatusResponse)(nil), "etcdserverpb.StatusResponse") proto.RegisterType((*AuthEnableRequest)(nil), "etcdserverpb.AuthEnableRequest") proto.RegisterType((*AuthDisableRequest)(nil), "etcdserverpb.AuthDisableRequest") + proto.RegisterType((*AuthStatusRequest)(nil), "etcdserverpb.AuthStatusRequest") proto.RegisterType((*AuthenticateRequest)(nil), "etcdserverpb.AuthenticateRequest") proto.RegisterType((*AuthUserAddRequest)(nil), "etcdserverpb.AuthUserAddRequest") proto.RegisterType((*AuthUserGetRequest)(nil), "etcdserverpb.AuthUserGetRequest") @@ -3402,6 +6134,7 @@ func init() { proto.RegisterType((*AuthRoleRevokePermissionRequest)(nil), "etcdserverpb.AuthRoleRevokePermissionRequest") proto.RegisterType((*AuthEnableResponse)(nil), "etcdserverpb.AuthEnableResponse") proto.RegisterType((*AuthDisableResponse)(nil), "etcdserverpb.AuthDisableResponse") + proto.RegisterType((*AuthStatusResponse)(nil), "etcdserverpb.AuthStatusResponse") proto.RegisterType((*AuthenticateResponse)(nil), "etcdserverpb.AuthenticateResponse") proto.RegisterType((*AuthUserAddResponse)(nil), "etcdserverpb.AuthUserAddResponse") proto.RegisterType((*AuthUserGetResponse)(nil), "etcdserverpb.AuthUserGetResponse") @@ -3416,13 +6149,269 @@ func init() { proto.RegisterType((*AuthRoleDeleteResponse)(nil), "etcdserverpb.AuthRoleDeleteResponse") proto.RegisterType((*AuthRoleGrantPermissionResponse)(nil), "etcdserverpb.AuthRoleGrantPermissionResponse") proto.RegisterType((*AuthRoleRevokePermissionResponse)(nil), "etcdserverpb.AuthRoleRevokePermissionResponse") - proto.RegisterEnum("etcdserverpb.AlarmType", AlarmType_name, AlarmType_value) - proto.RegisterEnum("etcdserverpb.RangeRequest_SortOrder", RangeRequest_SortOrder_name, RangeRequest_SortOrder_value) - proto.RegisterEnum("etcdserverpb.RangeRequest_SortTarget", RangeRequest_SortTarget_name, RangeRequest_SortTarget_value) - proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value) - proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value) - proto.RegisterEnum("etcdserverpb.WatchCreateRequest_FilterType", WatchCreateRequest_FilterType_name, WatchCreateRequest_FilterType_value) - proto.RegisterEnum("etcdserverpb.AlarmRequest_AlarmAction", AlarmRequest_AlarmAction_name, AlarmRequest_AlarmAction_value) +} + +func init() { proto.RegisterFile("rpc.proto", fileDescriptor_77a6da22d6a3feb1) } + +var fileDescriptor_77a6da22d6a3feb1 = []byte{ + // 4107 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x5b, 0x5b, 0x73, 0x1b, 0xc9, + 0x75, 0xe6, 0x00, 0xc4, 0xed, 0xe0, 0x42, 0xb0, 0x79, 0x11, 0x84, 0x95, 0x28, 0x6e, 0x6b, 0xa5, + 0xe5, 0x4a, 0xbb, 0xc4, 0x9a, 0xb6, 0xb3, 0x55, 0x4a, 0xe2, 0x18, 0x22, 0xb1, 0x12, 0x97, 0x14, + 0xc9, 0x1d, 0x42, 0xda, 0x4b, 0xb9, 0xc2, 0x1a, 0x02, 0x2d, 0x72, 0x42, 0x60, 0x06, 0x9e, 0x19, + 0x40, 0xe4, 0xe6, 0xe2, 0x94, 0xcb, 0x71, 0x25, 0xaf, 0x76, 0x55, 0x2a, 0x79, 0x48, 0x5e, 0x52, + 0x29, 0x97, 0x1f, 0xfc, 0x9c, 0xbf, 0x90, 0xa7, 0x5c, 0x2a, 0x7f, 0x20, 0xb5, 0xf1, 0x4b, 0xf2, + 0x23, 0x52, 0xae, 0xbe, 0xcd, 0xf4, 0xdc, 0x40, 0xd9, 0xd8, 0xdd, 0x17, 0x11, 0x7d, 0xfa, 0xf4, + 0xf9, 0x4e, 0x9f, 0xee, 0x3e, 0xe7, 0xf4, 0xe9, 0x11, 0x94, 0x9c, 0x51, 0x6f, 0x73, 0xe4, 0xd8, + 0x9e, 0x8d, 0x2a, 0xc4, 0xeb, 0xf5, 0x5d, 0xe2, 0x4c, 0x88, 0x33, 0x3a, 0x6d, 0x2e, 0x9f, 0xd9, + 0x67, 0x36, 0xeb, 0x68, 0xd1, 0x5f, 0x9c, 0xa7, 0xd9, 0xa0, 0x3c, 0x2d, 0x63, 0x64, 0xb6, 0x86, + 0x93, 0x5e, 0x6f, 0x74, 0xda, 0xba, 0x98, 0x88, 0x9e, 0xa6, 0xdf, 0x63, 0x8c, 0xbd, 0xf3, 0xd1, + 0x29, 0xfb, 0x23, 0xfa, 0x6e, 0x9d, 0xd9, 0xf6, 0xd9, 0x80, 0xf0, 0x5e, 0xcb, 0xb2, 0x3d, 0xc3, + 0x33, 0x6d, 0xcb, 0xe5, 0xbd, 0xf8, 0xaf, 0x34, 0xa8, 0xe9, 0xc4, 0x1d, 0xd9, 0x96, 0x4b, 0x9e, + 0x12, 0xa3, 0x4f, 0x1c, 0x74, 0x1b, 0xa0, 0x37, 0x18, 0xbb, 0x1e, 0x71, 0x4e, 0xcc, 0x7e, 0x43, + 0x5b, 0xd7, 0x36, 0xe6, 0xf5, 0x92, 0xa0, 0xec, 0xf6, 0xd1, 0x1b, 0x50, 0x1a, 0x92, 0xe1, 0x29, + 0xef, 0xcd, 0xb0, 0xde, 0x22, 0x27, 0xec, 0xf6, 0x51, 0x13, 0x8a, 0x0e, 0x99, 0x98, 0xae, 0x69, + 0x5b, 0x8d, 0xec, 0xba, 0xb6, 0x91, 0xd5, 0xfd, 0x36, 0x1d, 0xe8, 0x18, 0x2f, 0xbd, 0x13, 0x8f, + 0x38, 0xc3, 0xc6, 0x3c, 0x1f, 0x48, 0x09, 0x5d, 0xe2, 0x0c, 0xf1, 0x4f, 0x72, 0x50, 0xd1, 0x0d, + 0xeb, 0x8c, 0xe8, 0xe4, 0x87, 0x63, 0xe2, 0x7a, 0xa8, 0x0e, 0xd9, 0x0b, 0x72, 0xc5, 0xe0, 0x2b, + 0x3a, 0xfd, 0xc9, 0xc7, 0x5b, 0x67, 0xe4, 0x84, 0x58, 0x1c, 0xb8, 0x42, 0xc7, 0x5b, 0x67, 0xa4, + 0x63, 0xf5, 0xd1, 0x32, 0xe4, 0x06, 0xe6, 0xd0, 0xf4, 0x04, 0x2a, 0x6f, 0x84, 0xd4, 0x99, 0x8f, + 0xa8, 0xb3, 0x0d, 0xe0, 0xda, 0x8e, 0x77, 0x62, 0x3b, 0x7d, 0xe2, 0x34, 0x72, 0xeb, 0xda, 0x46, + 0x6d, 0xeb, 0xad, 0x4d, 0x75, 0x19, 0x36, 0x55, 0x85, 0x36, 0x8f, 0x6d, 0xc7, 0x3b, 0xa4, 0xbc, + 0x7a, 0xc9, 0x95, 0x3f, 0xd1, 0x87, 0x50, 0x66, 0x42, 0x3c, 0xc3, 0x39, 0x23, 0x5e, 0x23, 0xcf, + 0xa4, 0xdc, 0xbb, 0x46, 0x4a, 0x97, 0x31, 0xeb, 0x0c, 0x9e, 0xff, 0x46, 0x18, 0x2a, 0x2e, 0x71, + 0x4c, 0x63, 0x60, 0x7e, 0x61, 0x9c, 0x0e, 0x48, 0xa3, 0xb0, 0xae, 0x6d, 0x14, 0xf5, 0x10, 0x8d, + 0xce, 0xff, 0x82, 0x5c, 0xb9, 0x27, 0xb6, 0x35, 0xb8, 0x6a, 0x14, 0x19, 0x43, 0x91, 0x12, 0x0e, + 0xad, 0xc1, 0x15, 0x5b, 0x34, 0x7b, 0x6c, 0x79, 0xbc, 0xb7, 0xc4, 0x7a, 0x4b, 0x8c, 0xc2, 0xba, + 0x37, 0xa0, 0x3e, 0x34, 0xad, 0x93, 0xa1, 0xdd, 0x3f, 0xf1, 0x0d, 0x02, 0xcc, 0x20, 0xb5, 0xa1, + 0x69, 0x3d, 0xb3, 0xfb, 0xba, 0x34, 0x0b, 0xe5, 0x34, 0x2e, 0xc3, 0x9c, 0x65, 0xc1, 0x69, 0x5c, + 0xaa, 0x9c, 0x9b, 0xb0, 0x44, 0x65, 0xf6, 0x1c, 0x62, 0x78, 0x24, 0x60, 0xae, 0x30, 0xe6, 0xc5, + 0xa1, 0x69, 0x6d, 0xb3, 0x9e, 0x10, 0xbf, 0x71, 0x19, 0xe3, 0xaf, 0x0a, 0x7e, 0xe3, 0x32, 0xcc, + 0x8f, 0x37, 0xa1, 0xe4, 0xdb, 0x1c, 0x15, 0x61, 0xfe, 0xe0, 0xf0, 0xa0, 0x53, 0x9f, 0x43, 0x00, + 0xf9, 0xf6, 0xf1, 0x76, 0xe7, 0x60, 0xa7, 0xae, 0xa1, 0x32, 0x14, 0x76, 0x3a, 0xbc, 0x91, 0xc1, + 0x8f, 0x01, 0x02, 0xeb, 0xa2, 0x02, 0x64, 0xf7, 0x3a, 0x9f, 0xd5, 0xe7, 0x28, 0xcf, 0x8b, 0x8e, + 0x7e, 0xbc, 0x7b, 0x78, 0x50, 0xd7, 0xe8, 0xe0, 0x6d, 0xbd, 0xd3, 0xee, 0x76, 0xea, 0x19, 0xca, + 0xf1, 0xec, 0x70, 0xa7, 0x9e, 0x45, 0x25, 0xc8, 0xbd, 0x68, 0xef, 0x3f, 0xef, 0xd4, 0xe7, 0xf1, + 0xcf, 0x35, 0xa8, 0x8a, 0xf5, 0xe2, 0x67, 0x02, 0x7d, 0x07, 0xf2, 0xe7, 0xec, 0x5c, 0xb0, 0xad, + 0x58, 0xde, 0xba, 0x15, 0x59, 0xdc, 0xd0, 0xd9, 0xd1, 0x05, 0x2f, 0xc2, 0x90, 0xbd, 0x98, 0xb8, + 0x8d, 0xcc, 0x7a, 0x76, 0xa3, 0xbc, 0x55, 0xdf, 0xe4, 0xe7, 0x75, 0x73, 0x8f, 0x5c, 0xbd, 0x30, + 0x06, 0x63, 0xa2, 0xd3, 0x4e, 0x84, 0x60, 0x7e, 0x68, 0x3b, 0x84, 0xed, 0xd8, 0xa2, 0xce, 0x7e, + 0xd3, 0x6d, 0xcc, 0x16, 0x4d, 0xec, 0x56, 0xde, 0xc0, 0xbf, 0xd4, 0x00, 0x8e, 0xc6, 0x5e, 0xfa, + 0xd1, 0x58, 0x86, 0xdc, 0x84, 0x0a, 0x16, 0xc7, 0x82, 0x37, 0xd8, 0x99, 0x20, 0x86, 0x4b, 0xfc, + 0x33, 0x41, 0x1b, 0xe8, 0x06, 0x14, 0x46, 0x0e, 0x99, 0x9c, 0x5c, 0x4c, 0x18, 0x48, 0x51, 0xcf, + 0xd3, 0xe6, 0xde, 0x04, 0xbd, 0x09, 0x15, 0xf3, 0xcc, 0xb2, 0x1d, 0x72, 0xc2, 0x65, 0xe5, 0x58, + 0x6f, 0x99, 0xd3, 0x98, 0xde, 0x0a, 0x0b, 0x17, 0x9c, 0x57, 0x59, 0xf6, 0x29, 0x09, 0x5b, 0x50, + 0x66, 0xaa, 0xce, 0x64, 0xbe, 0x77, 0x02, 0x1d, 0x33, 0x6c, 0x58, 0xdc, 0x84, 0x42, 0x6b, 0xfc, + 0x03, 0x40, 0x3b, 0x64, 0x40, 0x3c, 0x32, 0x8b, 0xf7, 0x50, 0x6c, 0x92, 0x55, 0x6d, 0x82, 0x7f, + 0xa6, 0xc1, 0x52, 0x48, 0xfc, 0x4c, 0xd3, 0x6a, 0x40, 0xa1, 0xcf, 0x84, 0x71, 0x0d, 0xb2, 0xba, + 0x6c, 0xa2, 0x87, 0x50, 0x14, 0x0a, 0xb8, 0x8d, 0x6c, 0xca, 0xa6, 0x29, 0x70, 0x9d, 0x5c, 0xfc, + 0xcb, 0x0c, 0x94, 0xc4, 0x44, 0x0f, 0x47, 0xa8, 0x0d, 0x55, 0x87, 0x37, 0x4e, 0xd8, 0x7c, 0x84, + 0x46, 0xcd, 0x74, 0x27, 0xf4, 0x74, 0x4e, 0xaf, 0x88, 0x21, 0x8c, 0x8c, 0x7e, 0x1f, 0xca, 0x52, + 0xc4, 0x68, 0xec, 0x09, 0x93, 0x37, 0xc2, 0x02, 0x82, 0xfd, 0xf7, 0x74, 0x4e, 0x07, 0xc1, 0x7e, + 0x34, 0xf6, 0x50, 0x17, 0x96, 0xe5, 0x60, 0x3e, 0x1b, 0xa1, 0x46, 0x96, 0x49, 0x59, 0x0f, 0x4b, + 0x89, 0x2f, 0xd5, 0xd3, 0x39, 0x1d, 0x89, 0xf1, 0x4a, 0xa7, 0xaa, 0x92, 0x77, 0xc9, 0x9d, 0x77, + 0x4c, 0xa5, 0xee, 0xa5, 0x15, 0x57, 0xa9, 0x7b, 0x69, 0x3d, 0x2e, 0x41, 0x41, 0xb4, 0xf0, 0xbf, + 0x64, 0x00, 0xe4, 0x6a, 0x1c, 0x8e, 0xd0, 0x0e, 0xd4, 0x1c, 0xd1, 0x0a, 0x59, 0xeb, 0x8d, 0x44, + 0x6b, 0x89, 0x45, 0x9c, 0xd3, 0xab, 0x72, 0x10, 0x57, 0xee, 0x7b, 0x50, 0xf1, 0xa5, 0x04, 0x06, + 0xbb, 0x99, 0x60, 0x30, 0x5f, 0x42, 0x59, 0x0e, 0xa0, 0x26, 0xfb, 0x04, 0x56, 0xfc, 0xf1, 0x09, + 0x36, 0x7b, 0x73, 0x8a, 0xcd, 0x7c, 0x81, 0x4b, 0x52, 0x82, 0x6a, 0x35, 0x55, 0xb1, 0xc0, 0x6c, + 0x37, 0x13, 0xcc, 0x16, 0x57, 0x8c, 0x1a, 0x0e, 0x68, 0xbc, 0xe4, 0x4d, 0xfc, 0xbf, 0x59, 0x28, + 0x6c, 0xdb, 0xc3, 0x91, 0xe1, 0xd0, 0xd5, 0xc8, 0x3b, 0xc4, 0x1d, 0x0f, 0x3c, 0x66, 0xae, 0xda, + 0xd6, 0xdd, 0xb0, 0x44, 0xc1, 0x26, 0xff, 0xea, 0x8c, 0x55, 0x17, 0x43, 0xe8, 0x60, 0x11, 0x1e, + 0x33, 0xaf, 0x31, 0x58, 0x04, 0x47, 0x31, 0x44, 0x1e, 0xe4, 0x6c, 0x70, 0x90, 0x9b, 0x50, 0x98, + 0x10, 0x27, 0x08, 0xe9, 0x4f, 0xe7, 0x74, 0x49, 0x40, 0xef, 0xc0, 0x42, 0x34, 0xbc, 0xe4, 0x04, + 0x4f, 0xad, 0x17, 0x8e, 0x46, 0x77, 0xa1, 0x12, 0x8a, 0x71, 0x79, 0xc1, 0x57, 0x1e, 0x2a, 0x21, + 0x6e, 0x55, 0xfa, 0x55, 0x1a, 0x8f, 0x2b, 0x4f, 0xe7, 0xa4, 0x67, 0x5d, 0x95, 0x9e, 0xb5, 0x28, + 0x46, 0x09, 0xdf, 0x1a, 0x72, 0x32, 0xdf, 0x0f, 0x3b, 0x19, 0xfc, 0x7d, 0xa8, 0x86, 0x0c, 0x44, + 0xe3, 0x4e, 0xe7, 0xe3, 0xe7, 0xed, 0x7d, 0x1e, 0xa4, 0x9e, 0xb0, 0xb8, 0xa4, 0xd7, 0x35, 0x1a, + 0xeb, 0xf6, 0x3b, 0xc7, 0xc7, 0xf5, 0x0c, 0xaa, 0x42, 0xe9, 0xe0, 0xb0, 0x7b, 0xc2, 0xb9, 0xb2, + 0xf8, 0x89, 0x2f, 0x41, 0x04, 0x39, 0x25, 0xb6, 0xcd, 0x29, 0xb1, 0x4d, 0x93, 0xb1, 0x2d, 0x13, + 0xc4, 0x36, 0x16, 0xe6, 0xf6, 0x3b, 0xed, 0xe3, 0x4e, 0x7d, 0xfe, 0x71, 0x0d, 0x2a, 0xdc, 0xbe, + 0x27, 0x63, 0x8b, 0x86, 0xda, 0x7f, 0xd2, 0x00, 0x82, 0xd3, 0x84, 0x5a, 0x50, 0xe8, 0x71, 0x9c, + 0x86, 0xc6, 0x9c, 0xd1, 0x4a, 0xe2, 0x92, 0xe9, 0x92, 0x0b, 0x7d, 0x0b, 0x0a, 0xee, 0xb8, 0xd7, + 0x23, 0xae, 0x0c, 0x79, 0x37, 0xa2, 0xfe, 0x50, 0x78, 0x2b, 0x5d, 0xf2, 0xd1, 0x21, 0x2f, 0x0d, + 0x73, 0x30, 0x66, 0x01, 0x70, 0xfa, 0x10, 0xc1, 0x87, 0xff, 0x5e, 0x83, 0xb2, 0xb2, 0x79, 0x7f, + 0x47, 0x27, 0x7c, 0x0b, 0x4a, 0x4c, 0x07, 0xd2, 0x17, 0x6e, 0xb8, 0xa8, 0x07, 0x04, 0xf4, 0x7b, + 0x50, 0x92, 0x27, 0x40, 0x7a, 0xe2, 0x46, 0xb2, 0xd8, 0xc3, 0x91, 0x1e, 0xb0, 0xe2, 0x3d, 0x58, + 0x64, 0x56, 0xe9, 0xd1, 0xe4, 0x5a, 0xda, 0x51, 0x4d, 0x3f, 0xb5, 0x48, 0xfa, 0xd9, 0x84, 0xe2, + 0xe8, 0xfc, 0xca, 0x35, 0x7b, 0xc6, 0x40, 0x68, 0xe1, 0xb7, 0xf1, 0x47, 0x80, 0x54, 0x61, 0xb3, + 0x4c, 0x17, 0x57, 0xa1, 0xfc, 0xd4, 0x70, 0xcf, 0x85, 0x4a, 0xf8, 0x21, 0x54, 0x69, 0x73, 0xef, + 0xc5, 0x6b, 0xe8, 0xc8, 0x2e, 0x07, 0x92, 0x7b, 0x26, 0x9b, 0x23, 0x98, 0x3f, 0x37, 0xdc, 0x73, + 0x36, 0xd1, 0xaa, 0xce, 0x7e, 0xa3, 0x77, 0xa0, 0xde, 0xe3, 0x93, 0x3c, 0x89, 0x5c, 0x19, 0x16, + 0x04, 0xdd, 0xcf, 0x04, 0x3f, 0x85, 0x0a, 0x9f, 0xc3, 0x57, 0xad, 0x04, 0x5e, 0x84, 0x85, 0x63, + 0xcb, 0x18, 0xb9, 0xe7, 0xb6, 0x8c, 0x6e, 0x74, 0xd2, 0xf5, 0x80, 0x36, 0x13, 0xe2, 0xdb, 0xb0, + 0xe0, 0x90, 0xa1, 0x61, 0x5a, 0xa6, 0x75, 0x76, 0x72, 0x7a, 0xe5, 0x11, 0x57, 0x5c, 0x98, 0x6a, + 0x3e, 0xf9, 0x31, 0xa5, 0x52, 0xd5, 0x4e, 0x07, 0xf6, 0xa9, 0x70, 0x73, 0xec, 0x37, 0xfe, 0x69, + 0x06, 0x2a, 0x9f, 0x18, 0x5e, 0x4f, 0x2e, 0x1d, 0xda, 0x85, 0x9a, 0xef, 0xdc, 0x18, 0x45, 0xe8, + 0x12, 0x09, 0xb1, 0x6c, 0x8c, 0x4c, 0xa5, 0x65, 0x74, 0xac, 0xf6, 0x54, 0x02, 0x13, 0x65, 0x58, + 0x3d, 0x32, 0xf0, 0x45, 0x65, 0xd2, 0x45, 0x31, 0x46, 0x55, 0x94, 0x4a, 0x40, 0x87, 0x50, 0x1f, + 0x39, 0xf6, 0x99, 0x43, 0x5c, 0xd7, 0x17, 0xc6, 0xc3, 0x18, 0x4e, 0x10, 0x76, 0x24, 0x58, 0x03, + 0x71, 0x0b, 0xa3, 0x30, 0xe9, 0xf1, 0x42, 0x90, 0xcf, 0x70, 0xe7, 0xf4, 0x9f, 0x19, 0x40, 0xf1, + 0x49, 0xfd, 0xb6, 0x29, 0xde, 0x3d, 0xa8, 0xb9, 0x9e, 0xe1, 0xc4, 0x36, 0x5b, 0x95, 0x51, 0x7d, + 0x8f, 0xff, 0x36, 0xf8, 0x0a, 0x9d, 0x58, 0xb6, 0x67, 0xbe, 0xbc, 0x12, 0x59, 0x72, 0x4d, 0x92, + 0x0f, 0x18, 0x15, 0x75, 0xa0, 0xf0, 0xd2, 0x1c, 0x78, 0xc4, 0x71, 0x1b, 0xb9, 0xf5, 0xec, 0x46, + 0x6d, 0xeb, 0xe1, 0x75, 0xcb, 0xb0, 0xf9, 0x21, 0xe3, 0xef, 0x5e, 0x8d, 0x88, 0x2e, 0xc7, 0xaa, + 0x99, 0x67, 0x3e, 0x94, 0x8d, 0xdf, 0x84, 0xe2, 0x2b, 0x2a, 0x82, 0xde, 0xb2, 0x0b, 0x3c, 0x59, + 0x64, 0x6d, 0x7e, 0xc9, 0x7e, 0xe9, 0x18, 0x67, 0x43, 0x62, 0x79, 0xf2, 0x1e, 0x28, 0xdb, 0xf8, + 0x1e, 0x40, 0x00, 0x43, 0x5d, 0xfe, 0xc1, 0xe1, 0xd1, 0xf3, 0x6e, 0x7d, 0x0e, 0x55, 0xa0, 0x78, + 0x70, 0xb8, 0xd3, 0xd9, 0xef, 0xd0, 0xf8, 0x80, 0x5b, 0xd2, 0xa4, 0xa1, 0xb5, 0x54, 0x31, 0xb5, + 0x10, 0x26, 0x5e, 0x85, 0xe5, 0xa4, 0x05, 0xa4, 0xb9, 0x68, 0x55, 0xec, 0xd2, 0x99, 0x8e, 0x8a, + 0x0a, 0x9d, 0x09, 0x4f, 0xb7, 0x01, 0x05, 0xbe, 0x7b, 0xfb, 0x22, 0x39, 0x97, 0x4d, 0x6a, 0x08, + 0xbe, 0x19, 0x49, 0x5f, 0xac, 0x92, 0xdf, 0x4e, 0x74, 0x2f, 0xb9, 0x44, 0xf7, 0x82, 0xee, 0x42, + 0xd5, 0x3f, 0x0d, 0x86, 0x2b, 0x72, 0x81, 0x92, 0x5e, 0x91, 0x1b, 0x9d, 0xd2, 0x42, 0x46, 0x2f, + 0x84, 0x8d, 0x8e, 0xee, 0x41, 0x9e, 0x4c, 0x88, 0xe5, 0xb9, 0x8d, 0x32, 0x8b, 0x18, 0x55, 0x99, + 0xbb, 0x77, 0x28, 0x55, 0x17, 0x9d, 0xf8, 0xbb, 0xb0, 0xc8, 0xee, 0x48, 0x4f, 0x1c, 0xc3, 0x52, + 0x2f, 0x73, 0xdd, 0xee, 0xbe, 0x30, 0x37, 0xfd, 0x89, 0x6a, 0x90, 0xd9, 0xdd, 0x11, 0x46, 0xc8, + 0xec, 0xee, 0xe0, 0x1f, 0x6b, 0x80, 0xd4, 0x71, 0x33, 0xd9, 0x39, 0x22, 0x5c, 0xc2, 0x67, 0x03, + 0xf8, 0x65, 0xc8, 0x11, 0xc7, 0xb1, 0x1d, 0x66, 0xd1, 0x92, 0xce, 0x1b, 0xf8, 0x2d, 0xa1, 0x83, + 0x4e, 0x26, 0xf6, 0x85, 0x7f, 0x06, 0xb9, 0x34, 0xcd, 0x57, 0x75, 0x0f, 0x96, 0x42, 0x5c, 0x33, + 0x45, 0xae, 0x0f, 0x61, 0x81, 0x09, 0xdb, 0x3e, 0x27, 0xbd, 0x8b, 0x91, 0x6d, 0x5a, 0x31, 0x3c, + 0xba, 0x72, 0x81, 0x83, 0xa5, 0xf3, 0xe0, 0x13, 0xab, 0xf8, 0xc4, 0x6e, 0x77, 0x1f, 0x7f, 0x06, + 0xab, 0x11, 0x39, 0x52, 0xfd, 0x3f, 0x82, 0x72, 0xcf, 0x27, 0xba, 0x22, 0xd7, 0xb9, 0x1d, 0x56, + 0x2e, 0x3a, 0x54, 0x1d, 0x81, 0x0f, 0xe1, 0x46, 0x4c, 0xf4, 0x4c, 0x73, 0x7e, 0x1b, 0x56, 0x98, + 0xc0, 0x3d, 0x42, 0x46, 0xed, 0x81, 0x39, 0x49, 0xb5, 0xf4, 0x48, 0x4c, 0x4a, 0x61, 0xfc, 0x7a, + 0xf7, 0x05, 0xfe, 0x03, 0x81, 0xd8, 0x35, 0x87, 0xa4, 0x6b, 0xef, 0xa7, 0xeb, 0x46, 0xa3, 0xd9, + 0x05, 0xb9, 0x72, 0x45, 0x5a, 0xc3, 0x7e, 0xe3, 0x7f, 0xd6, 0x84, 0xa9, 0xd4, 0xe1, 0x5f, 0xf3, + 0x4e, 0x5e, 0x03, 0x38, 0xa3, 0x47, 0x86, 0xf4, 0x69, 0x07, 0xaf, 0xa8, 0x28, 0x14, 0x5f, 0x4f, + 0xea, 0xbf, 0x2b, 0x42, 0xcf, 0x65, 0xb1, 0xcf, 0xd9, 0x3f, 0xbe, 0x97, 0xbb, 0x0d, 0x65, 0x46, + 0x38, 0xf6, 0x0c, 0x6f, 0xec, 0xc6, 0x16, 0xe3, 0x2f, 0xc4, 0xb6, 0x97, 0x83, 0x66, 0x9a, 0xd7, + 0xb7, 0x20, 0xcf, 0x2e, 0x13, 0x32, 0x95, 0xbe, 0x99, 0xb0, 0x1f, 0xb9, 0x1e, 0xba, 0x60, 0xc4, + 0x3f, 0xd5, 0x20, 0xff, 0x8c, 0x95, 0x60, 0x15, 0xd5, 0xe6, 0xe5, 0x5a, 0x58, 0xc6, 0x90, 0x17, + 0x86, 0x4a, 0x3a, 0xfb, 0xcd, 0x52, 0x4f, 0x42, 0x9c, 0xe7, 0xfa, 0x3e, 0x4f, 0x71, 0x4b, 0xba, + 0xdf, 0xa6, 0x36, 0xeb, 0x0d, 0x4c, 0x62, 0x79, 0xac, 0x77, 0x9e, 0xf5, 0x2a, 0x14, 0x9a, 0x3d, + 0x9b, 0xee, 0x3e, 0x31, 0x1c, 0x4b, 0x14, 0x4d, 0x8b, 0x7a, 0x40, 0xc0, 0xfb, 0x50, 0xe7, 0x7a, + 0xb4, 0xfb, 0x7d, 0x25, 0xc1, 0xf4, 0xd1, 0xb4, 0x08, 0x5a, 0x48, 0x5a, 0x26, 0x2a, 0xed, 0x17, + 0x1a, 0x2c, 0x2a, 0xe2, 0x66, 0xb2, 0xea, 0xbb, 0x90, 0xe7, 0x45, 0x6a, 0x91, 0xe9, 0x2c, 0x87, + 0x47, 0x71, 0x18, 0x5d, 0xf0, 0xa0, 0x4d, 0x28, 0xf0, 0x5f, 0xf2, 0x0e, 0x90, 0xcc, 0x2e, 0x99, + 0xf0, 0x3d, 0x58, 0x12, 0x24, 0x32, 0xb4, 0x93, 0x0e, 0x06, 0x5b, 0x0c, 0xfc, 0x67, 0xb0, 0x1c, + 0x66, 0x9b, 0x69, 0x4a, 0x8a, 0x92, 0x99, 0xd7, 0x51, 0xb2, 0x2d, 0x95, 0x7c, 0x3e, 0xea, 0x2b, + 0x79, 0x54, 0x74, 0xc7, 0xa8, 0xeb, 0x95, 0x09, 0xaf, 0x57, 0x30, 0x01, 0x29, 0xe2, 0x1b, 0x9d, + 0xc0, 0x07, 0x72, 0x3b, 0xec, 0x9b, 0xae, 0xef, 0xc3, 0x31, 0x54, 0x06, 0xa6, 0x45, 0x0c, 0x47, + 0x54, 0xce, 0x35, 0x5e, 0x39, 0x57, 0x69, 0xf8, 0x0b, 0x40, 0xea, 0xc0, 0x6f, 0x54, 0xe9, 0xfb, + 0xd2, 0x64, 0x47, 0x8e, 0x3d, 0xb4, 0x53, 0xcd, 0x8e, 0xff, 0x1c, 0x56, 0x22, 0x7c, 0xdf, 0xa8, + 0x9a, 0x4b, 0xb0, 0xb8, 0x43, 0x64, 0x42, 0x23, 0xdd, 0xde, 0x47, 0x80, 0x54, 0xe2, 0x4c, 0x91, + 0xad, 0x05, 0x8b, 0xcf, 0xec, 0x09, 0x75, 0x91, 0x94, 0x1a, 0xf8, 0x06, 0x5e, 0x87, 0xf0, 0x4d, + 0xe1, 0xb7, 0x29, 0xb8, 0x3a, 0x60, 0x26, 0xf0, 0x7f, 0xd7, 0xa0, 0xd2, 0x1e, 0x18, 0xce, 0x50, + 0x02, 0x7f, 0x0f, 0xf2, 0xfc, 0x76, 0x2d, 0x0a, 0x5a, 0xf7, 0xc3, 0x62, 0x54, 0x5e, 0xde, 0x68, + 0xf3, 0xbb, 0xb8, 0x18, 0x45, 0x15, 0x17, 0x6f, 0x5e, 0x3b, 0x91, 0x37, 0xb0, 0x1d, 0xf4, 0x1e, + 0xe4, 0x0c, 0x3a, 0x84, 0x85, 0xa2, 0x5a, 0xb4, 0xae, 0xc1, 0xa4, 0xb1, 0x3b, 0x00, 0xe7, 0xc2, + 0xdf, 0x81, 0xb2, 0x82, 0x80, 0x0a, 0x90, 0x7d, 0xd2, 0x11, 0x09, 0x7b, 0x7b, 0xbb, 0xbb, 0xfb, + 0x82, 0x17, 0x74, 0x6a, 0x00, 0x3b, 0x1d, 0xbf, 0x9d, 0xc1, 0x9f, 0x8a, 0x51, 0xc2, 0xed, 0xab, + 0xfa, 0x68, 0x69, 0xfa, 0x64, 0x5e, 0x4b, 0x9f, 0x4b, 0xa8, 0x8a, 0xe9, 0xcf, 0x1a, 0xc6, 0x98, + 0xbc, 0x94, 0x30, 0xa6, 0x28, 0xaf, 0x0b, 0x46, 0xfc, 0x2b, 0x0d, 0xea, 0x3b, 0xf6, 0x2b, 0xeb, + 0xcc, 0x31, 0xfa, 0xfe, 0x39, 0xf9, 0x30, 0xb2, 0x52, 0x9b, 0x91, 0xe2, 0x68, 0x84, 0x3f, 0x20, + 0x44, 0x56, 0xac, 0x11, 0x94, 0x0d, 0x79, 0x2c, 0x94, 0x4d, 0xfc, 0x01, 0x2c, 0x44, 0x06, 0x51, + 0xdb, 0xbf, 0x68, 0xef, 0xef, 0xee, 0x50, 0x5b, 0xb3, 0xc2, 0x5a, 0xe7, 0xa0, 0xfd, 0x78, 0xbf, + 0x23, 0x1e, 0x90, 0xda, 0x07, 0xdb, 0x9d, 0xfd, 0x7a, 0x06, 0xf7, 0x60, 0x51, 0x81, 0x9f, 0xf5, + 0x65, 0x20, 0x45, 0xbb, 0x05, 0xa8, 0x8a, 0x68, 0x2f, 0x0e, 0xe5, 0xbf, 0x65, 0xa0, 0x26, 0x29, + 0x5f, 0x0f, 0x26, 0x5a, 0x85, 0x7c, 0xff, 0xf4, 0xd8, 0xfc, 0x42, 0xbe, 0x1c, 0x89, 0x16, 0xa5, + 0x0f, 0x38, 0x0e, 0x7f, 0xbe, 0x15, 0x2d, 0x1a, 0xc6, 0x1d, 0xe3, 0xa5, 0xb7, 0x6b, 0xf5, 0xc9, + 0x25, 0x4b, 0x0a, 0xe6, 0xf5, 0x80, 0xc0, 0x2a, 0x4c, 0xe2, 0x99, 0x97, 0xdd, 0xac, 0x94, 0x67, + 0x5f, 0xf4, 0x00, 0xea, 0xf4, 0x77, 0x7b, 0x34, 0x1a, 0x98, 0xa4, 0xcf, 0x05, 0x14, 0x18, 0x4f, + 0x8c, 0x4e, 0xd1, 0xd9, 0x5d, 0xc4, 0x6d, 0x14, 0x59, 0x58, 0x12, 0x2d, 0xb4, 0x0e, 0x65, 0xae, + 0xdf, 0xae, 0xf5, 0xdc, 0x25, 0xec, 0xed, 0x33, 0xab, 0xab, 0xa4, 0x70, 0x9a, 0x01, 0xd1, 0x34, + 0x63, 0x09, 0x16, 0xdb, 0x63, 0xef, 0xbc, 0x63, 0xd1, 0x58, 0x21, 0xad, 0xbc, 0x0c, 0x88, 0x12, + 0x77, 0x4c, 0x57, 0xa5, 0x0a, 0xd6, 0xf0, 0x82, 0x74, 0x60, 0x89, 0x12, 0x89, 0xe5, 0x99, 0x3d, + 0x25, 0xae, 0xca, 0xcc, 0x4b, 0x8b, 0x64, 0x5e, 0x86, 0xeb, 0xbe, 0xb2, 0x9d, 0xbe, 0xb0, 0xb9, + 0xdf, 0xc6, 0xff, 0xa8, 0x71, 0xc8, 0xe7, 0x6e, 0x28, 0x7d, 0xfa, 0x2d, 0xc5, 0xa0, 0xf7, 0xa1, + 0x60, 0x8f, 0xd8, 0x0b, 0xbf, 0x28, 0xc3, 0xac, 0x6e, 0xf2, 0x6f, 0x02, 0x36, 0x85, 0xe0, 0x43, + 0xde, 0xab, 0x4b, 0x36, 0x74, 0x1f, 0x6a, 0xe7, 0x86, 0x7b, 0x4e, 0xfa, 0x47, 0x52, 0x26, 0xbf, + 0xf9, 0x45, 0xa8, 0x78, 0x23, 0xd0, 0xef, 0x09, 0xf1, 0xa6, 0xe8, 0x87, 0x1f, 0xc2, 0x8a, 0xe4, + 0x14, 0xaf, 0x13, 0x53, 0x98, 0x5f, 0xc1, 0x6d, 0xc9, 0xbc, 0x7d, 0x6e, 0x58, 0x67, 0x44, 0x02, + 0xfe, 0xae, 0x16, 0x88, 0xcf, 0x27, 0x9b, 0x38, 0x9f, 0xc7, 0xd0, 0xf0, 0xe7, 0xc3, 0x6e, 0xd6, + 0xf6, 0x40, 0x55, 0x74, 0xec, 0x8a, 0xf3, 0x54, 0xd2, 0xd9, 0x6f, 0x4a, 0x73, 0xec, 0x81, 0x9f, + 0x4a, 0xd3, 0xdf, 0x78, 0x1b, 0x6e, 0x4a, 0x19, 0xe2, 0xce, 0x1b, 0x16, 0x12, 0x53, 0x3c, 0x49, + 0x88, 0x30, 0x2c, 0x1d, 0x3a, 0x7d, 0xe1, 0x55, 0xce, 0xf0, 0x12, 0x30, 0x99, 0x9a, 0x22, 0x73, + 0x85, 0x6f, 0x4a, 0xaa, 0x98, 0x92, 0x2d, 0x49, 0x32, 0x15, 0xa0, 0x92, 0xc5, 0x82, 0x51, 0x72, + 0x6c, 0xc1, 0x62, 0xa2, 0x7f, 0x00, 0x6b, 0xbe, 0x12, 0xd4, 0x6e, 0x47, 0xc4, 0x19, 0x9a, 0xae, + 0xab, 0xd4, 0xbd, 0x93, 0x26, 0x7e, 0x1f, 0xe6, 0x47, 0x44, 0x04, 0xa1, 0xf2, 0x16, 0x92, 0x9b, + 0x52, 0x19, 0xcc, 0xfa, 0x71, 0x1f, 0xee, 0x48, 0xe9, 0xdc, 0xa2, 0x89, 0xe2, 0xa3, 0x4a, 0xc9, + 0x6a, 0x60, 0x26, 0xa5, 0x1a, 0x98, 0x8d, 0xbc, 0xc5, 0x7c, 0xc4, 0x0d, 0x29, 0xcf, 0xfc, 0x4c, + 0xc9, 0xc5, 0x1e, 0xb7, 0xa9, 0xef, 0x2a, 0x66, 0x12, 0xf6, 0xd7, 0xc2, 0x0b, 0x7c, 0x55, 0x1e, + 0x9e, 0xb0, 0x19, 0xca, 0x87, 0x0e, 0xd9, 0xa4, 0x59, 0x33, 0x5d, 0x00, 0x5d, 0xad, 0x85, 0xce, + 0xeb, 0x21, 0x1a, 0x3e, 0x85, 0xe5, 0xb0, 0x5f, 0x9b, 0x49, 0x97, 0x65, 0xc8, 0x79, 0xf6, 0x05, + 0x91, 0xb1, 0x86, 0x37, 0xa4, 0xed, 0x7c, 0x9f, 0x37, 0x93, 0xed, 0x8c, 0x40, 0x18, 0x3b, 0x1d, + 0xb3, 0xea, 0x4b, 0x37, 0x96, 0xbc, 0x03, 0xf1, 0x06, 0x3e, 0x80, 0xd5, 0xa8, 0x67, 0x9b, 0x49, + 0xe5, 0x17, 0xfc, 0x2c, 0x25, 0x39, 0xbf, 0x99, 0xe4, 0x7e, 0x1c, 0xf8, 0x25, 0xc5, 0xb7, 0xcd, + 0x24, 0x52, 0x87, 0x66, 0x92, 0xab, 0xfb, 0x2a, 0x8e, 0x8e, 0xef, 0xf9, 0x66, 0x12, 0xe6, 0x06, + 0xc2, 0x66, 0x5f, 0xfe, 0xc0, 0x5d, 0x65, 0xa7, 0xba, 0x2b, 0x71, 0x48, 0x02, 0x87, 0xfa, 0x35, + 0x6c, 0x3a, 0x81, 0x11, 0xf8, 0xf2, 0x59, 0x31, 0x68, 0x38, 0xf3, 0x31, 0x58, 0x43, 0x6e, 0x6c, + 0x35, 0x02, 0xcc, 0xb4, 0x18, 0x9f, 0x04, 0x6e, 0x3c, 0x16, 0x24, 0x66, 0x12, 0xfc, 0x29, 0xac, + 0xa7, 0xc7, 0x87, 0x59, 0x24, 0x3f, 0x68, 0x41, 0xc9, 0xbf, 0x0c, 0x29, 0xdf, 0x9b, 0x95, 0xa1, + 0x70, 0x70, 0x78, 0x7c, 0xd4, 0xde, 0xee, 0xf0, 0x0f, 0xce, 0xb6, 0x0f, 0x75, 0xfd, 0xf9, 0x51, + 0xb7, 0x9e, 0xd9, 0xfa, 0x75, 0x16, 0x32, 0x7b, 0x2f, 0xd0, 0x67, 0x90, 0xe3, 0x5f, 0x5f, 0x4c, + 0xf9, 0xe4, 0xa6, 0x39, 0xed, 0x03, 0x13, 0x7c, 0xe3, 0xc7, 0xff, 0xf5, 0xeb, 0x9f, 0x67, 0x16, + 0x71, 0xa5, 0x35, 0xf9, 0x76, 0xeb, 0x62, 0xd2, 0x62, 0x61, 0xea, 0x91, 0xf6, 0x00, 0x7d, 0x0c, + 0xd9, 0xa3, 0xb1, 0x87, 0x52, 0x3f, 0xc5, 0x69, 0xa6, 0x7f, 0x73, 0x82, 0x57, 0x98, 0xd0, 0x05, + 0x0c, 0x42, 0xe8, 0x68, 0xec, 0x51, 0x91, 0x3f, 0x84, 0xb2, 0xfa, 0xc5, 0xc8, 0xb5, 0xdf, 0xe7, + 0x34, 0xaf, 0xff, 0x1a, 0x05, 0xdf, 0x66, 0x50, 0x37, 0x30, 0x12, 0x50, 0xfc, 0x9b, 0x16, 0x75, + 0x16, 0xdd, 0x4b, 0x0b, 0xa5, 0x7e, 0xbd, 0xd3, 0x4c, 0xff, 0x40, 0x25, 0x36, 0x0b, 0xef, 0xd2, + 0xa2, 0x22, 0xff, 0x44, 0x7c, 0x9b, 0xd2, 0xf3, 0xd0, 0x9d, 0x84, 0x6f, 0x13, 0xd4, 0x57, 0xf8, + 0xe6, 0x7a, 0x3a, 0x83, 0x00, 0xb9, 0xc5, 0x40, 0x56, 0xf1, 0xa2, 0x00, 0xe9, 0xf9, 0x2c, 0x8f, + 0xb4, 0x07, 0x5b, 0x3d, 0xc8, 0xb1, 0x17, 0x2e, 0xf4, 0xb9, 0xfc, 0xd1, 0x4c, 0x78, 0xea, 0x4b, + 0x59, 0xe8, 0xd0, 0xdb, 0x18, 0x5e, 0x66, 0x40, 0x35, 0x5c, 0xa2, 0x40, 0xec, 0x7d, 0xeb, 0x91, + 0xf6, 0x60, 0x43, 0x7b, 0x5f, 0xdb, 0xfa, 0x55, 0x0e, 0x72, 0xac, 0xb4, 0x8b, 0x2e, 0x00, 0x82, + 0xd7, 0x9e, 0xe8, 0xec, 0x62, 0xef, 0x47, 0xd1, 0xd9, 0xc5, 0x1f, 0x8a, 0x70, 0x93, 0x81, 0x2e, + 0xe3, 0x05, 0x0a, 0xca, 0x2a, 0xc6, 0x2d, 0x56, 0x04, 0xa7, 0x76, 0xfc, 0x1b, 0x4d, 0x54, 0xb6, + 0xf9, 0x59, 0x42, 0x49, 0xd2, 0x42, 0x4f, 0x3e, 0xd1, 0xed, 0x90, 0xf0, 0xdc, 0x83, 0xbf, 0xcb, + 0x00, 0x5b, 0xb8, 0x1e, 0x00, 0x3a, 0x8c, 0xe3, 0x91, 0xf6, 0xe0, 0xf3, 0x06, 0x5e, 0x12, 0x56, + 0x8e, 0xf4, 0xa0, 0x1f, 0x41, 0x2d, 0xfc, 0xa4, 0x81, 0xee, 0x26, 0x60, 0x45, 0x5f, 0x46, 0x9a, + 0x6f, 0x4d, 0x67, 0x12, 0x3a, 0xad, 0x31, 0x9d, 0x04, 0x38, 0x47, 0xbe, 0x20, 0x64, 0x64, 0x50, + 0x26, 0xb1, 0x06, 0xe8, 0x1f, 0x34, 0xf1, 0xe2, 0x14, 0xbc, 0x51, 0xa0, 0x24, 0xe9, 0xb1, 0x17, + 0x90, 0xe6, 0xbd, 0x6b, 0xb8, 0x84, 0x12, 0x7f, 0xc8, 0x94, 0xf8, 0x00, 0x2f, 0x07, 0x4a, 0x78, + 0xe6, 0x90, 0x78, 0xb6, 0xd0, 0xe2, 0xf3, 0x5b, 0xf8, 0x46, 0xc8, 0x38, 0xa1, 0xde, 0x60, 0xb1, + 0xf8, 0x3b, 0x43, 0xe2, 0x62, 0x85, 0xde, 0x2d, 0x12, 0x17, 0x2b, 0xfc, 0x48, 0x91, 0xb4, 0x58, + 0xfc, 0x55, 0x21, 0x69, 0xb1, 0xfc, 0x9e, 0xad, 0xff, 0x9b, 0x87, 0xc2, 0x36, 0xff, 0x26, 0x1c, + 0xd9, 0x50, 0xf2, 0xcb, 0xf4, 0x68, 0x2d, 0xa9, 0xce, 0x18, 0x5c, 0x6b, 0x9a, 0x77, 0x52, 0xfb, + 0x85, 0x42, 0x6f, 0x32, 0x85, 0xde, 0xc0, 0xab, 0x14, 0x59, 0x7c, 0x76, 0xde, 0xe2, 0xc5, 0xac, + 0x96, 0xd1, 0xef, 0x53, 0x43, 0xfc, 0x29, 0x54, 0xd4, 0x3a, 0x3a, 0x7a, 0x33, 0xb1, 0xb6, 0xa9, + 0x96, 0xe2, 0x9b, 0x78, 0x1a, 0x8b, 0x40, 0x7e, 0x8b, 0x21, 0xaf, 0xe1, 0x9b, 0x09, 0xc8, 0x0e, + 0x63, 0x0d, 0x81, 0xf3, 0x1a, 0x78, 0x32, 0x78, 0xa8, 0xc4, 0x9e, 0x0c, 0x1e, 0x2e, 0xa1, 0x4f, + 0x05, 0x1f, 0x33, 0x56, 0x0a, 0xee, 0x02, 0x04, 0x95, 0x6c, 0x94, 0x68, 0x4b, 0xe5, 0x5e, 0x17, + 0x75, 0x0e, 0xf1, 0x22, 0x38, 0xc6, 0x0c, 0x56, 0xec, 0xbb, 0x08, 0xec, 0xc0, 0x74, 0x3d, 0x7e, + 0x30, 0xab, 0xa1, 0xd2, 0x34, 0x4a, 0x9c, 0x4f, 0xb8, 0xbe, 0xdd, 0xbc, 0x3b, 0x95, 0x47, 0xa0, + 0xdf, 0x63, 0xe8, 0x77, 0x70, 0x33, 0x01, 0x7d, 0xc4, 0x79, 0xe9, 0x66, 0xfb, 0xff, 0x3c, 0x94, + 0x9f, 0x19, 0xa6, 0xe5, 0x11, 0xcb, 0xb0, 0x7a, 0x04, 0x9d, 0x42, 0x8e, 0x45, 0xea, 0xa8, 0x23, + 0x56, 0xcb, 0xb6, 0x51, 0x47, 0x1c, 0xaa, 0x69, 0xe2, 0x75, 0x06, 0xdc, 0xc4, 0x2b, 0x14, 0x78, + 0x18, 0x88, 0x6e, 0xb1, 0x52, 0x24, 0x9d, 0xf4, 0x4b, 0xc8, 0x8b, 0xd7, 0xbe, 0x88, 0xa0, 0x50, + 0xf1, 0xa7, 0x79, 0x2b, 0xb9, 0x33, 0x69, 0x2f, 0xab, 0x30, 0x2e, 0xe3, 0xa3, 0x38, 0x13, 0x80, + 0xa0, 0xc6, 0x1e, 0x5d, 0xd1, 0x58, 0x49, 0xbe, 0xb9, 0x9e, 0xce, 0x90, 0x64, 0x53, 0x15, 0xb3, + 0xef, 0xf3, 0x52, 0xdc, 0x3f, 0x86, 0xf9, 0xa7, 0x86, 0x7b, 0x8e, 0x22, 0xb1, 0x57, 0xf9, 0x56, + 0xac, 0xd9, 0x4c, 0xea, 0x12, 0x28, 0x77, 0x18, 0xca, 0x4d, 0xee, 0xca, 0x54, 0x94, 0x73, 0xc3, + 0xa5, 0x41, 0x0d, 0xf5, 0x21, 0xcf, 0x3f, 0x1d, 0x8b, 0xda, 0x2f, 0xf4, 0xf9, 0x59, 0xd4, 0x7e, + 0xe1, 0xaf, 0xcd, 0xae, 0x47, 0x19, 0x41, 0x51, 0x7e, 0xab, 0x85, 0x22, 0x0f, 0xf7, 0x91, 0xef, + 0xba, 0x9a, 0x6b, 0x69, 0xdd, 0x02, 0xeb, 0x2e, 0xc3, 0xba, 0x8d, 0x1b, 0xb1, 0xb5, 0x12, 0x9c, + 0x8f, 0xb4, 0x07, 0xef, 0x6b, 0xe8, 0x47, 0x00, 0xc1, 0xb3, 0x44, 0xec, 0x04, 0x46, 0x5f, 0x38, + 0x62, 0x27, 0x30, 0xf6, 0xa2, 0x81, 0x37, 0x19, 0xee, 0x06, 0xbe, 0x1b, 0xc5, 0xf5, 0x1c, 0xc3, + 0x72, 0x5f, 0x12, 0xe7, 0x3d, 0x5e, 0x65, 0x75, 0xcf, 0xcd, 0x11, 0x9d, 0xb2, 0x03, 0x25, 0xbf, + 0xea, 0x1c, 0xf5, 0xb6, 0xd1, 0x6a, 0x78, 0xd4, 0xdb, 0xc6, 0xca, 0xd5, 0x61, 0xb7, 0x13, 0xda, + 0x2d, 0x92, 0x95, 0x1e, 0xc0, 0x5f, 0xd4, 0x61, 0x9e, 0x66, 0xdd, 0x34, 0x39, 0x09, 0xea, 0x26, + 0xd1, 0xd9, 0xc7, 0xaa, 0xa8, 0xd1, 0xd9, 0xc7, 0x4b, 0x2e, 0xe1, 0xe4, 0x84, 0x5e, 0xb2, 0x5a, + 0xbc, 0x44, 0x41, 0x67, 0x6a, 0x43, 0x59, 0x29, 0xac, 0xa0, 0x04, 0x61, 0xe1, 0xf2, 0x6c, 0x34, + 0xdc, 0x25, 0x54, 0x65, 0xf0, 0x1b, 0x0c, 0x6f, 0x85, 0x87, 0x3b, 0x86, 0xd7, 0xe7, 0x1c, 0x14, + 0x50, 0xcc, 0x4e, 0x9c, 0xfb, 0x84, 0xd9, 0x85, 0xcf, 0xfe, 0x7a, 0x3a, 0x43, 0xea, 0xec, 0x82, + 0x83, 0xff, 0x0a, 0x2a, 0x6a, 0x79, 0x05, 0x25, 0x28, 0x1f, 0x29, 0x29, 0x47, 0xe3, 0x48, 0x52, + 0x75, 0x26, 0xec, 0xd9, 0x18, 0xa4, 0xa1, 0xb0, 0x51, 0xe0, 0x01, 0x14, 0x44, 0xbd, 0x25, 0xc9, + 0xa4, 0xe1, 0xf2, 0x73, 0x92, 0x49, 0x23, 0xc5, 0x9a, 0x70, 0xf6, 0xcc, 0x10, 0xe9, 0x95, 0x52, + 0xc6, 0x6a, 0x81, 0xf6, 0x84, 0x78, 0x69, 0x68, 0x41, 0x25, 0x33, 0x0d, 0x4d, 0xb9, 0xce, 0xa7, + 0xa1, 0x9d, 0x11, 0x4f, 0xf8, 0x03, 0x79, 0x4d, 0x46, 0x29, 0xc2, 0xd4, 0xf8, 0x88, 0xa7, 0xb1, + 0x24, 0x5d, 0x6e, 0x02, 0x40, 0x19, 0x1c, 0x2f, 0x01, 0x82, 0x6a, 0x50, 0x34, 0x63, 0x4d, 0xac, + 0x82, 0x47, 0x33, 0xd6, 0xe4, 0x82, 0x52, 0xd8, 0xf7, 0x05, 0xb8, 0xfc, 0x6e, 0x45, 0x91, 0x7f, + 0xa6, 0x01, 0x8a, 0x17, 0x8e, 0xd0, 0xc3, 0x64, 0xe9, 0x89, 0xb5, 0xf5, 0xe6, 0xbb, 0xaf, 0xc7, + 0x9c, 0x14, 0xce, 0x02, 0x95, 0x7a, 0x8c, 0x7b, 0xf4, 0x8a, 0x2a, 0xf5, 0x97, 0x1a, 0x54, 0x43, + 0x55, 0x27, 0x74, 0x3f, 0x65, 0x4d, 0x23, 0x25, 0xf7, 0xe6, 0xdb, 0xd7, 0xf2, 0x25, 0xa5, 0xf2, + 0xca, 0x0e, 0x90, 0x77, 0x9a, 0x9f, 0x68, 0x50, 0x0b, 0x57, 0xa9, 0x50, 0x8a, 0xec, 0x58, 0xc9, + 0xbe, 0xb9, 0x71, 0x3d, 0xe3, 0xf4, 0xe5, 0x09, 0xae, 0x33, 0x03, 0x28, 0x88, 0xba, 0x56, 0xd2, + 0xc6, 0x0f, 0x17, 0xfb, 0x93, 0x36, 0x7e, 0xa4, 0x28, 0x96, 0xb0, 0xf1, 0x1d, 0x7b, 0x40, 0x94, + 0x63, 0x26, 0x0a, 0x5f, 0x69, 0x68, 0xd3, 0x8f, 0x59, 0xa4, 0x6a, 0x96, 0x86, 0x16, 0x1c, 0x33, + 0x59, 0xf1, 0x42, 0x29, 0xc2, 0xae, 0x39, 0x66, 0xd1, 0x82, 0x59, 0xc2, 0x31, 0x63, 0x80, 0xca, + 0x31, 0x0b, 0x6a, 0x53, 0x49, 0xc7, 0x2c, 0xf6, 0x76, 0x91, 0x74, 0xcc, 0xe2, 0xe5, 0xad, 0x84, + 0x75, 0x64, 0xb8, 0xa1, 0x63, 0xb6, 0x94, 0x50, 0xc6, 0x42, 0xef, 0xa6, 0x18, 0x31, 0xf1, 0x49, + 0xa4, 0xf9, 0xde, 0x6b, 0x72, 0xa7, 0xee, 0x71, 0x6e, 0x7e, 0xb9, 0xc7, 0xff, 0x56, 0x83, 0xe5, + 0xa4, 0x12, 0x18, 0x4a, 0xc1, 0x49, 0x79, 0x4a, 0x69, 0x6e, 0xbe, 0x2e, 0xfb, 0x74, 0x6b, 0xf9, + 0xbb, 0xfe, 0x71, 0xfd, 0x5f, 0xbf, 0x5c, 0xd3, 0xfe, 0xe3, 0xcb, 0x35, 0xed, 0xbf, 0xbf, 0x5c, + 0xd3, 0xfe, 0xee, 0x7f, 0xd6, 0xe6, 0x4e, 0xf3, 0xec, 0x3f, 0x1a, 0x7f, 0xfb, 0x37, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xee, 0x4f, 0x63, 0x90, 0xed, 0x3c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3433,8 +6422,9 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for KV service - +// KVClient is the client API for KV service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type KVClient interface { // Range gets the keys in the range from the key-value store. Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) @@ -3467,7 +6457,7 @@ func NewKVClient(cc *grpc.ClientConn) KVClient { func (c *kVClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) { out := new(RangeResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/Range", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.KV/Range", in, out, opts...) if err != nil { return nil, err } @@ -3476,7 +6466,7 @@ func (c *kVClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.Cal func (c *kVClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { out := new(PutResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/Put", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.KV/Put", in, out, opts...) if err != nil { return nil, err } @@ -3485,7 +6475,7 @@ func (c *kVClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOpt func (c *kVClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) { out := new(DeleteRangeResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/DeleteRange", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.KV/DeleteRange", in, out, opts...) if err != nil { return nil, err } @@ -3494,7 +6484,7 @@ func (c *kVClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts func (c *kVClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) { out := new(TxnResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/Txn", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.KV/Txn", in, out, opts...) if err != nil { return nil, err } @@ -3503,15 +6493,14 @@ func (c *kVClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOpt func (c *kVClient) Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) { out := new(CompactionResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/Compact", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.KV/Compact", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for KV service - +// KVServer is the server API for KV service. type KVServer interface { // Range gets the keys in the range from the key-value store. Range(context.Context, *RangeRequest) (*RangeResponse, error) @@ -3534,6 +6523,26 @@ type KVServer interface { Compact(context.Context, *CompactionRequest) (*CompactionResponse, error) } +// UnimplementedKVServer can be embedded to have forward compatible implementations. +type UnimplementedKVServer struct { +} + +func (*UnimplementedKVServer) Range(ctx context.Context, req *RangeRequest) (*RangeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Range not implemented") +} +func (*UnimplementedKVServer) Put(ctx context.Context, req *PutRequest) (*PutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Put not implemented") +} +func (*UnimplementedKVServer) DeleteRange(ctx context.Context, req *DeleteRangeRequest) (*DeleteRangeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRange not implemented") +} +func (*UnimplementedKVServer) Txn(ctx context.Context, req *TxnRequest) (*TxnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Txn not implemented") +} +func (*UnimplementedKVServer) Compact(ctx context.Context, req *CompactionRequest) (*CompactionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Compact not implemented") +} + func RegisterKVServer(s *grpc.Server, srv KVServer) { s.RegisterService(&_KV_serviceDesc, srv) } @@ -3657,8 +6666,9 @@ var _KV_serviceDesc = grpc.ServiceDesc{ Metadata: "rpc.proto", } -// Client API for Watch service - +// WatchClient is the client API for Watch service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type WatchClient interface { // Watch watches for events happening or that have happened. Both input and output // are streams; the input stream is for creating and canceling watchers and the output @@ -3677,7 +6687,7 @@ func NewWatchClient(cc *grpc.ClientConn) WatchClient { } func (c *watchClient) Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Watch_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Watch/Watch", opts...) + stream, err := c.cc.NewStream(ctx, &_Watch_serviceDesc.Streams[0], "/etcdserverpb.Watch/Watch", opts...) if err != nil { return nil, err } @@ -3707,8 +6717,7 @@ func (x *watchWatchClient) Recv() (*WatchResponse, error) { return m, nil } -// Server API for Watch service - +// WatchServer is the server API for Watch service. type WatchServer interface { // Watch watches for events happening or that have happened. Both input and output // are streams; the input stream is for creating and canceling watchers and the output @@ -3718,6 +6727,14 @@ type WatchServer interface { Watch(Watch_WatchServer) error } +// UnimplementedWatchServer can be embedded to have forward compatible implementations. +type UnimplementedWatchServer struct { +} + +func (*UnimplementedWatchServer) Watch(srv Watch_WatchServer) error { + return status.Errorf(codes.Unimplemented, "method Watch not implemented") +} + func RegisterWatchServer(s *grpc.Server, srv WatchServer) { s.RegisterService(&_Watch_serviceDesc, srv) } @@ -3763,8 +6780,9 @@ var _Watch_serviceDesc = grpc.ServiceDesc{ Metadata: "rpc.proto", } -// Client API for Lease service - +// LeaseClient is the client API for Lease service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type LeaseClient interface { // LeaseGrant creates a lease which expires if the server does not receive a keepAlive // within a given time to live period. All keys attached to the lease will be expired and @@ -3791,7 +6809,7 @@ func NewLeaseClient(cc *grpc.ClientConn) LeaseClient { func (c *leaseClient) LeaseGrant(ctx context.Context, in *LeaseGrantRequest, opts ...grpc.CallOption) (*LeaseGrantResponse, error) { out := new(LeaseGrantResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseGrant", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Lease/LeaseGrant", in, out, opts...) if err != nil { return nil, err } @@ -3800,7 +6818,7 @@ func (c *leaseClient) LeaseGrant(ctx context.Context, in *LeaseGrantRequest, opt func (c *leaseClient) LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) { out := new(LeaseRevokeResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseRevoke", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Lease/LeaseRevoke", in, out, opts...) if err != nil { return nil, err } @@ -3808,7 +6826,7 @@ func (c *leaseClient) LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, o } func (c *leaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Lease_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Lease/LeaseKeepAlive", opts...) + stream, err := c.cc.NewStream(ctx, &_Lease_serviceDesc.Streams[0], "/etcdserverpb.Lease/LeaseKeepAlive", opts...) if err != nil { return nil, err } @@ -3840,7 +6858,7 @@ func (x *leaseLeaseKeepAliveClient) Recv() (*LeaseKeepAliveResponse, error) { func (c *leaseClient) LeaseTimeToLive(ctx context.Context, in *LeaseTimeToLiveRequest, opts ...grpc.CallOption) (*LeaseTimeToLiveResponse, error) { out := new(LeaseTimeToLiveResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseTimeToLive", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Lease/LeaseTimeToLive", in, out, opts...) if err != nil { return nil, err } @@ -3849,15 +6867,14 @@ func (c *leaseClient) LeaseTimeToLive(ctx context.Context, in *LeaseTimeToLiveRe func (c *leaseClient) LeaseLeases(ctx context.Context, in *LeaseLeasesRequest, opts ...grpc.CallOption) (*LeaseLeasesResponse, error) { out := new(LeaseLeasesResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseLeases", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Lease/LeaseLeases", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for Lease service - +// LeaseServer is the server API for Lease service. type LeaseServer interface { // LeaseGrant creates a lease which expires if the server does not receive a keepAlive // within a given time to live period. All keys attached to the lease will be expired and @@ -3874,6 +6891,26 @@ type LeaseServer interface { LeaseLeases(context.Context, *LeaseLeasesRequest) (*LeaseLeasesResponse, error) } +// UnimplementedLeaseServer can be embedded to have forward compatible implementations. +type UnimplementedLeaseServer struct { +} + +func (*UnimplementedLeaseServer) LeaseGrant(ctx context.Context, req *LeaseGrantRequest) (*LeaseGrantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LeaseGrant not implemented") +} +func (*UnimplementedLeaseServer) LeaseRevoke(ctx context.Context, req *LeaseRevokeRequest) (*LeaseRevokeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LeaseRevoke not implemented") +} +func (*UnimplementedLeaseServer) LeaseKeepAlive(srv Lease_LeaseKeepAliveServer) error { + return status.Errorf(codes.Unimplemented, "method LeaseKeepAlive not implemented") +} +func (*UnimplementedLeaseServer) LeaseTimeToLive(ctx context.Context, req *LeaseTimeToLiveRequest) (*LeaseTimeToLiveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LeaseTimeToLive not implemented") +} +func (*UnimplementedLeaseServer) LeaseLeases(ctx context.Context, req *LeaseLeasesRequest) (*LeaseLeasesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LeaseLeases not implemented") +} + func RegisterLeaseServer(s *grpc.Server, srv LeaseServer) { s.RegisterService(&_Lease_serviceDesc, srv) } @@ -4008,8 +7045,9 @@ var _Lease_serviceDesc = grpc.ServiceDesc{ Metadata: "rpc.proto", } -// Client API for Cluster service - +// ClusterClient is the client API for Cluster service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ClusterClient interface { // MemberAdd adds a member into the cluster. MemberAdd(ctx context.Context, in *MemberAddRequest, opts ...grpc.CallOption) (*MemberAddResponse, error) @@ -4033,7 +7071,7 @@ func NewClusterClient(cc *grpc.ClientConn) ClusterClient { func (c *clusterClient) MemberAdd(ctx context.Context, in *MemberAddRequest, opts ...grpc.CallOption) (*MemberAddResponse, error) { out := new(MemberAddResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberAdd", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberAdd", in, out, opts...) if err != nil { return nil, err } @@ -4042,7 +7080,7 @@ func (c *clusterClient) MemberAdd(ctx context.Context, in *MemberAddRequest, opt func (c *clusterClient) MemberRemove(ctx context.Context, in *MemberRemoveRequest, opts ...grpc.CallOption) (*MemberRemoveResponse, error) { out := new(MemberRemoveResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberRemove", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberRemove", in, out, opts...) if err != nil { return nil, err } @@ -4051,7 +7089,7 @@ func (c *clusterClient) MemberRemove(ctx context.Context, in *MemberRemoveReques func (c *clusterClient) MemberUpdate(ctx context.Context, in *MemberUpdateRequest, opts ...grpc.CallOption) (*MemberUpdateResponse, error) { out := new(MemberUpdateResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberUpdate", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberUpdate", in, out, opts...) if err != nil { return nil, err } @@ -4060,7 +7098,7 @@ func (c *clusterClient) MemberUpdate(ctx context.Context, in *MemberUpdateReques func (c *clusterClient) MemberList(ctx context.Context, in *MemberListRequest, opts ...grpc.CallOption) (*MemberListResponse, error) { out := new(MemberListResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberList", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberList", in, out, opts...) if err != nil { return nil, err } @@ -4069,15 +7107,14 @@ func (c *clusterClient) MemberList(ctx context.Context, in *MemberListRequest, o func (c *clusterClient) MemberPromote(ctx context.Context, in *MemberPromoteRequest, opts ...grpc.CallOption) (*MemberPromoteResponse, error) { out := new(MemberPromoteResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberPromote", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberPromote", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for Cluster service - +// ClusterServer is the server API for Cluster service. type ClusterServer interface { // MemberAdd adds a member into the cluster. MemberAdd(context.Context, *MemberAddRequest) (*MemberAddResponse, error) @@ -4091,6 +7128,26 @@ type ClusterServer interface { MemberPromote(context.Context, *MemberPromoteRequest) (*MemberPromoteResponse, error) } +// UnimplementedClusterServer can be embedded to have forward compatible implementations. +type UnimplementedClusterServer struct { +} + +func (*UnimplementedClusterServer) MemberAdd(ctx context.Context, req *MemberAddRequest) (*MemberAddResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MemberAdd not implemented") +} +func (*UnimplementedClusterServer) MemberRemove(ctx context.Context, req *MemberRemoveRequest) (*MemberRemoveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MemberRemove not implemented") +} +func (*UnimplementedClusterServer) MemberUpdate(ctx context.Context, req *MemberUpdateRequest) (*MemberUpdateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MemberUpdate not implemented") +} +func (*UnimplementedClusterServer) MemberList(ctx context.Context, req *MemberListRequest) (*MemberListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MemberList not implemented") +} +func (*UnimplementedClusterServer) MemberPromote(ctx context.Context, req *MemberPromoteRequest) (*MemberPromoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MemberPromote not implemented") +} + func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { s.RegisterService(&_Cluster_serviceDesc, srv) } @@ -4214,8 +7271,9 @@ var _Cluster_serviceDesc = grpc.ServiceDesc{ Metadata: "rpc.proto", } -// Client API for Maintenance service - +// MaintenanceClient is the client API for Maintenance service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MaintenanceClient interface { // Alarm activates, deactivates, and queries alarms regarding cluster health. Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error) @@ -4237,6 +7295,10 @@ type MaintenanceClient interface { Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (Maintenance_SnapshotClient, error) // MoveLeader requests current leader node to transfer its leadership to transferee. MoveLeader(ctx context.Context, in *MoveLeaderRequest, opts ...grpc.CallOption) (*MoveLeaderResponse, error) + // Downgrade requests downgrades, verifies feasibility or cancels downgrade + // on the cluster version. + // Supported since etcd 3.5. + Downgrade(ctx context.Context, in *DowngradeRequest, opts ...grpc.CallOption) (*DowngradeResponse, error) } type maintenanceClient struct { @@ -4249,7 +7311,7 @@ func NewMaintenanceClient(cc *grpc.ClientConn) MaintenanceClient { func (c *maintenanceClient) Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error) { out := new(AlarmResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Alarm", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Alarm", in, out, opts...) if err != nil { return nil, err } @@ -4258,7 +7320,7 @@ func (c *maintenanceClient) Alarm(ctx context.Context, in *AlarmRequest, opts .. func (c *maintenanceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Status", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Status", in, out, opts...) if err != nil { return nil, err } @@ -4267,7 +7329,7 @@ func (c *maintenanceClient) Status(ctx context.Context, in *StatusRequest, opts func (c *maintenanceClient) Defragment(ctx context.Context, in *DefragmentRequest, opts ...grpc.CallOption) (*DefragmentResponse, error) { out := new(DefragmentResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Defragment", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Defragment", in, out, opts...) if err != nil { return nil, err } @@ -4276,7 +7338,7 @@ func (c *maintenanceClient) Defragment(ctx context.Context, in *DefragmentReques func (c *maintenanceClient) Hash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*HashResponse, error) { out := new(HashResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Hash", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Hash", in, out, opts...) if err != nil { return nil, err } @@ -4285,7 +7347,7 @@ func (c *maintenanceClient) Hash(ctx context.Context, in *HashRequest, opts ...g func (c *maintenanceClient) HashKV(ctx context.Context, in *HashKVRequest, opts ...grpc.CallOption) (*HashKVResponse, error) { out := new(HashKVResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/HashKV", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/HashKV", in, out, opts...) if err != nil { return nil, err } @@ -4293,7 +7355,7 @@ func (c *maintenanceClient) HashKV(ctx context.Context, in *HashKVRequest, opts } func (c *maintenanceClient) Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (Maintenance_SnapshotClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Maintenance_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Maintenance/Snapshot", opts...) + stream, err := c.cc.NewStream(ctx, &_Maintenance_serviceDesc.Streams[0], "/etcdserverpb.Maintenance/Snapshot", opts...) if err != nil { return nil, err } @@ -4326,15 +7388,23 @@ func (x *maintenanceSnapshotClient) Recv() (*SnapshotResponse, error) { func (c *maintenanceClient) MoveLeader(ctx context.Context, in *MoveLeaderRequest, opts ...grpc.CallOption) (*MoveLeaderResponse, error) { out := new(MoveLeaderResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/MoveLeader", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/MoveLeader", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for Maintenance service +func (c *maintenanceClient) Downgrade(ctx context.Context, in *DowngradeRequest, opts ...grpc.CallOption) (*DowngradeResponse, error) { + out := new(DowngradeResponse) + err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Downgrade", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} +// MaintenanceServer is the server API for Maintenance service. type MaintenanceServer interface { // Alarm activates, deactivates, and queries alarms regarding cluster health. Alarm(context.Context, *AlarmRequest) (*AlarmResponse, error) @@ -4356,6 +7426,39 @@ type MaintenanceServer interface { Snapshot(*SnapshotRequest, Maintenance_SnapshotServer) error // MoveLeader requests current leader node to transfer its leadership to transferee. MoveLeader(context.Context, *MoveLeaderRequest) (*MoveLeaderResponse, error) + // Downgrade requests downgrades, verifies feasibility or cancels downgrade + // on the cluster version. + // Supported since etcd 3.5. + Downgrade(context.Context, *DowngradeRequest) (*DowngradeResponse, error) +} + +// UnimplementedMaintenanceServer can be embedded to have forward compatible implementations. +type UnimplementedMaintenanceServer struct { +} + +func (*UnimplementedMaintenanceServer) Alarm(ctx context.Context, req *AlarmRequest) (*AlarmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Alarm not implemented") +} +func (*UnimplementedMaintenanceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} +func (*UnimplementedMaintenanceServer) Defragment(ctx context.Context, req *DefragmentRequest) (*DefragmentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Defragment not implemented") +} +func (*UnimplementedMaintenanceServer) Hash(ctx context.Context, req *HashRequest) (*HashResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Hash not implemented") +} +func (*UnimplementedMaintenanceServer) HashKV(ctx context.Context, req *HashKVRequest) (*HashKVResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HashKV not implemented") +} +func (*UnimplementedMaintenanceServer) Snapshot(req *SnapshotRequest, srv Maintenance_SnapshotServer) error { + return status.Errorf(codes.Unimplemented, "method Snapshot not implemented") +} +func (*UnimplementedMaintenanceServer) MoveLeader(ctx context.Context, req *MoveLeaderRequest) (*MoveLeaderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MoveLeader not implemented") +} +func (*UnimplementedMaintenanceServer) Downgrade(ctx context.Context, req *DowngradeRequest) (*DowngradeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Downgrade not implemented") } func RegisterMaintenanceServer(s *grpc.Server, srv MaintenanceServer) { @@ -4491,6 +7594,24 @@ func _Maintenance_MoveLeader_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Maintenance_Downgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DowngradeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MaintenanceServer).Downgrade(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/etcdserverpb.Maintenance/Downgrade", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MaintenanceServer).Downgrade(ctx, req.(*DowngradeRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Maintenance_serviceDesc = grpc.ServiceDesc{ ServiceName: "etcdserverpb.Maintenance", HandlerType: (*MaintenanceServer)(nil), @@ -4519,6 +7640,10 @@ var _Maintenance_serviceDesc = grpc.ServiceDesc{ MethodName: "MoveLeader", Handler: _Maintenance_MoveLeader_Handler, }, + { + MethodName: "Downgrade", + Handler: _Maintenance_Downgrade_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -4530,13 +7655,16 @@ var _Maintenance_serviceDesc = grpc.ServiceDesc{ Metadata: "rpc.proto", } -// Client API for Auth service - +// AuthClient is the client API for Auth service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type AuthClient interface { // AuthEnable enables authentication. AuthEnable(ctx context.Context, in *AuthEnableRequest, opts ...grpc.CallOption) (*AuthEnableResponse, error) // AuthDisable disables authentication. AuthDisable(ctx context.Context, in *AuthDisableRequest, opts ...grpc.CallOption) (*AuthDisableResponse, error) + // AuthStatus displays authentication status. + AuthStatus(ctx context.Context, in *AuthStatusRequest, opts ...grpc.CallOption) (*AuthStatusResponse, error) // Authenticate processes an authenticate request. Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error) // UserAdd adds a new user. User name cannot be empty. @@ -4577,7 +7705,7 @@ func NewAuthClient(cc *grpc.ClientConn) AuthClient { func (c *authClient) AuthEnable(ctx context.Context, in *AuthEnableRequest, opts ...grpc.CallOption) (*AuthEnableResponse, error) { out := new(AuthEnableResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/AuthEnable", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/AuthEnable", in, out, opts...) if err != nil { return nil, err } @@ -4586,7 +7714,16 @@ func (c *authClient) AuthEnable(ctx context.Context, in *AuthEnableRequest, opts func (c *authClient) AuthDisable(ctx context.Context, in *AuthDisableRequest, opts ...grpc.CallOption) (*AuthDisableResponse, error) { out := new(AuthDisableResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/AuthDisable", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/AuthDisable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authClient) AuthStatus(ctx context.Context, in *AuthStatusRequest, opts ...grpc.CallOption) (*AuthStatusResponse, error) { + out := new(AuthStatusResponse) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/AuthStatus", in, out, opts...) if err != nil { return nil, err } @@ -4595,7 +7732,7 @@ func (c *authClient) AuthDisable(ctx context.Context, in *AuthDisableRequest, op func (c *authClient) Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error) { out := new(AuthenticateResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/Authenticate", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/Authenticate", in, out, opts...) if err != nil { return nil, err } @@ -4604,7 +7741,7 @@ func (c *authClient) Authenticate(ctx context.Context, in *AuthenticateRequest, func (c *authClient) UserAdd(ctx context.Context, in *AuthUserAddRequest, opts ...grpc.CallOption) (*AuthUserAddResponse, error) { out := new(AuthUserAddResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserAdd", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserAdd", in, out, opts...) if err != nil { return nil, err } @@ -4613,7 +7750,7 @@ func (c *authClient) UserAdd(ctx context.Context, in *AuthUserAddRequest, opts . func (c *authClient) UserGet(ctx context.Context, in *AuthUserGetRequest, opts ...grpc.CallOption) (*AuthUserGetResponse, error) { out := new(AuthUserGetResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserGet", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserGet", in, out, opts...) if err != nil { return nil, err } @@ -4622,7 +7759,7 @@ func (c *authClient) UserGet(ctx context.Context, in *AuthUserGetRequest, opts . func (c *authClient) UserList(ctx context.Context, in *AuthUserListRequest, opts ...grpc.CallOption) (*AuthUserListResponse, error) { out := new(AuthUserListResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserList", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserList", in, out, opts...) if err != nil { return nil, err } @@ -4631,7 +7768,7 @@ func (c *authClient) UserList(ctx context.Context, in *AuthUserListRequest, opts func (c *authClient) UserDelete(ctx context.Context, in *AuthUserDeleteRequest, opts ...grpc.CallOption) (*AuthUserDeleteResponse, error) { out := new(AuthUserDeleteResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserDelete", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserDelete", in, out, opts...) if err != nil { return nil, err } @@ -4640,7 +7777,7 @@ func (c *authClient) UserDelete(ctx context.Context, in *AuthUserDeleteRequest, func (c *authClient) UserChangePassword(ctx context.Context, in *AuthUserChangePasswordRequest, opts ...grpc.CallOption) (*AuthUserChangePasswordResponse, error) { out := new(AuthUserChangePasswordResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserChangePassword", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserChangePassword", in, out, opts...) if err != nil { return nil, err } @@ -4649,7 +7786,7 @@ func (c *authClient) UserChangePassword(ctx context.Context, in *AuthUserChangeP func (c *authClient) UserGrantRole(ctx context.Context, in *AuthUserGrantRoleRequest, opts ...grpc.CallOption) (*AuthUserGrantRoleResponse, error) { out := new(AuthUserGrantRoleResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserGrantRole", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserGrantRole", in, out, opts...) if err != nil { return nil, err } @@ -4658,7 +7795,7 @@ func (c *authClient) UserGrantRole(ctx context.Context, in *AuthUserGrantRoleReq func (c *authClient) UserRevokeRole(ctx context.Context, in *AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (*AuthUserRevokeRoleResponse, error) { out := new(AuthUserRevokeRoleResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserRevokeRole", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserRevokeRole", in, out, opts...) if err != nil { return nil, err } @@ -4667,7 +7804,7 @@ func (c *authClient) UserRevokeRole(ctx context.Context, in *AuthUserRevokeRoleR func (c *authClient) RoleAdd(ctx context.Context, in *AuthRoleAddRequest, opts ...grpc.CallOption) (*AuthRoleAddResponse, error) { out := new(AuthRoleAddResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleAdd", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleAdd", in, out, opts...) if err != nil { return nil, err } @@ -4676,7 +7813,7 @@ func (c *authClient) RoleAdd(ctx context.Context, in *AuthRoleAddRequest, opts . func (c *authClient) RoleGet(ctx context.Context, in *AuthRoleGetRequest, opts ...grpc.CallOption) (*AuthRoleGetResponse, error) { out := new(AuthRoleGetResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleGet", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleGet", in, out, opts...) if err != nil { return nil, err } @@ -4685,7 +7822,7 @@ func (c *authClient) RoleGet(ctx context.Context, in *AuthRoleGetRequest, opts . func (c *authClient) RoleList(ctx context.Context, in *AuthRoleListRequest, opts ...grpc.CallOption) (*AuthRoleListResponse, error) { out := new(AuthRoleListResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleList", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleList", in, out, opts...) if err != nil { return nil, err } @@ -4694,7 +7831,7 @@ func (c *authClient) RoleList(ctx context.Context, in *AuthRoleListRequest, opts func (c *authClient) RoleDelete(ctx context.Context, in *AuthRoleDeleteRequest, opts ...grpc.CallOption) (*AuthRoleDeleteResponse, error) { out := new(AuthRoleDeleteResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleDelete", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleDelete", in, out, opts...) if err != nil { return nil, err } @@ -4703,7 +7840,7 @@ func (c *authClient) RoleDelete(ctx context.Context, in *AuthRoleDeleteRequest, func (c *authClient) RoleGrantPermission(ctx context.Context, in *AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (*AuthRoleGrantPermissionResponse, error) { out := new(AuthRoleGrantPermissionResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleGrantPermission", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleGrantPermission", in, out, opts...) if err != nil { return nil, err } @@ -4712,20 +7849,21 @@ func (c *authClient) RoleGrantPermission(ctx context.Context, in *AuthRoleGrantP func (c *authClient) RoleRevokePermission(ctx context.Context, in *AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (*AuthRoleRevokePermissionResponse, error) { out := new(AuthRoleRevokePermissionResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleRevokePermission", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleRevokePermission", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for Auth service - +// AuthServer is the server API for Auth service. type AuthServer interface { // AuthEnable enables authentication. AuthEnable(context.Context, *AuthEnableRequest) (*AuthEnableResponse, error) // AuthDisable disables authentication. AuthDisable(context.Context, *AuthDisableRequest) (*AuthDisableResponse, error) + // AuthStatus displays authentication status. + AuthStatus(context.Context, *AuthStatusRequest) (*AuthStatusResponse, error) // Authenticate processes an authenticate request. Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error) // UserAdd adds a new user. User name cannot be empty. @@ -4756,6 +7894,62 @@ type AuthServer interface { RoleRevokePermission(context.Context, *AuthRoleRevokePermissionRequest) (*AuthRoleRevokePermissionResponse, error) } +// UnimplementedAuthServer can be embedded to have forward compatible implementations. +type UnimplementedAuthServer struct { +} + +func (*UnimplementedAuthServer) AuthEnable(ctx context.Context, req *AuthEnableRequest) (*AuthEnableResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuthEnable not implemented") +} +func (*UnimplementedAuthServer) AuthDisable(ctx context.Context, req *AuthDisableRequest) (*AuthDisableResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuthDisable not implemented") +} +func (*UnimplementedAuthServer) AuthStatus(ctx context.Context, req *AuthStatusRequest) (*AuthStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuthStatus not implemented") +} +func (*UnimplementedAuthServer) Authenticate(ctx context.Context, req *AuthenticateRequest) (*AuthenticateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented") +} +func (*UnimplementedAuthServer) UserAdd(ctx context.Context, req *AuthUserAddRequest) (*AuthUserAddResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserAdd not implemented") +} +func (*UnimplementedAuthServer) UserGet(ctx context.Context, req *AuthUserGetRequest) (*AuthUserGetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserGet not implemented") +} +func (*UnimplementedAuthServer) UserList(ctx context.Context, req *AuthUserListRequest) (*AuthUserListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserList not implemented") +} +func (*UnimplementedAuthServer) UserDelete(ctx context.Context, req *AuthUserDeleteRequest) (*AuthUserDeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserDelete not implemented") +} +func (*UnimplementedAuthServer) UserChangePassword(ctx context.Context, req *AuthUserChangePasswordRequest) (*AuthUserChangePasswordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserChangePassword not implemented") +} +func (*UnimplementedAuthServer) UserGrantRole(ctx context.Context, req *AuthUserGrantRoleRequest) (*AuthUserGrantRoleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserGrantRole not implemented") +} +func (*UnimplementedAuthServer) UserRevokeRole(ctx context.Context, req *AuthUserRevokeRoleRequest) (*AuthUserRevokeRoleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserRevokeRole not implemented") +} +func (*UnimplementedAuthServer) RoleAdd(ctx context.Context, req *AuthRoleAddRequest) (*AuthRoleAddResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoleAdd not implemented") +} +func (*UnimplementedAuthServer) RoleGet(ctx context.Context, req *AuthRoleGetRequest) (*AuthRoleGetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoleGet not implemented") +} +func (*UnimplementedAuthServer) RoleList(ctx context.Context, req *AuthRoleListRequest) (*AuthRoleListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoleList not implemented") +} +func (*UnimplementedAuthServer) RoleDelete(ctx context.Context, req *AuthRoleDeleteRequest) (*AuthRoleDeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoleDelete not implemented") +} +func (*UnimplementedAuthServer) RoleGrantPermission(ctx context.Context, req *AuthRoleGrantPermissionRequest) (*AuthRoleGrantPermissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoleGrantPermission not implemented") +} +func (*UnimplementedAuthServer) RoleRevokePermission(ctx context.Context, req *AuthRoleRevokePermissionRequest) (*AuthRoleRevokePermissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoleRevokePermission not implemented") +} + func RegisterAuthServer(s *grpc.Server, srv AuthServer) { s.RegisterService(&_Auth_serviceDesc, srv) } @@ -4796,6 +7990,24 @@ func _Auth_AuthDisable_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Auth_AuthStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AuthStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).AuthStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/etcdserverpb.Auth/AuthStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).AuthStatus(ctx, req.(*AuthStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Auth_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthenticateRequest) if err := dec(in); err != nil { @@ -5060,6 +8272,10 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ MethodName: "AuthDisable", Handler: _Auth_AuthDisable_Handler, }, + { + MethodName: "AuthStatus", + Handler: _Auth_AuthStatus_Handler, + }, { MethodName: "Authenticate", Handler: _Auth_Authenticate_Handler, @@ -5124,7 +8340,7 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ func (m *ResponseHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5132,37 +8348,46 @@ func (m *ResponseHeader) Marshal() (dAtA []byte, err error) { } func (m *ResponseHeader) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ClusterId != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ClusterId)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.MemberId != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MemberId)) + if m.RaftTerm != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) + i-- + dAtA[i] = 0x20 } if m.Revision != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + i-- + dAtA[i] = 0x18 } - if m.RaftTerm != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) + if m.MemberId != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.MemberId)) + i-- + dAtA[i] = 0x10 + } + if m.ClusterId != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.ClusterId)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *RangeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5170,99 +8395,110 @@ func (m *RangeRequest) Marshal() (dAtA []byte, err error) { } func (m *RangeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Limit != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) + if m.MaxCreateRevision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.MaxCreateRevision)) + i-- + dAtA[i] = 0x68 } - if m.Revision != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + if m.MinCreateRevision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.MinCreateRevision)) + i-- + dAtA[i] = 0x60 } - if m.SortOrder != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.SortOrder)) + if m.MaxModRevision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.MaxModRevision)) + i-- + dAtA[i] = 0x58 } - if m.SortTarget != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.SortTarget)) + if m.MinModRevision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.MinModRevision)) + i-- + dAtA[i] = 0x50 } - if m.Serializable { - dAtA[i] = 0x38 - i++ - if m.Serializable { + if m.CountOnly { + i-- + if m.CountOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x48 } if m.KeysOnly { - dAtA[i] = 0x40 - i++ + i-- if m.KeysOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x40 } - if m.CountOnly { - dAtA[i] = 0x48 - i++ - if m.CountOnly { + if m.Serializable { + i-- + if m.Serializable { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x38 } - if m.MinModRevision != 0 { - dAtA[i] = 0x50 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MinModRevision)) + if m.SortTarget != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.SortTarget)) + i-- + dAtA[i] = 0x30 } - if m.MaxModRevision != 0 { - dAtA[i] = 0x58 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MaxModRevision)) + if m.SortOrder != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.SortOrder)) + i-- + dAtA[i] = 0x28 } - if m.MinCreateRevision != 0 { - dAtA[i] = 0x60 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MinCreateRevision)) + if m.Revision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + i-- + dAtA[i] = 0x20 } - if m.MaxCreateRevision != 0 { - dAtA[i] = 0x68 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MaxCreateRevision)) + if m.Limit != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x18 + } + if len(m.RangeEnd) > 0 { + i -= len(m.RangeEnd) + copy(dAtA[i:], m.RangeEnd) + i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RangeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5270,54 +8506,67 @@ func (m *RangeResponse) Marshal() (dAtA []byte, err error) { } func (m *RangeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RangeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n1, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Kvs) > 0 { - for _, msg := range m.Kvs { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.Count != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x20 } if m.More { - dAtA[i] = 0x18 - i++ + i-- if m.More { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.Count != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Count)) + if len(m.Kvs) > 0 { + for iNdEx := len(m.Kvs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Kvs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } - return i, nil + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *PutRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5325,64 +8574,75 @@ func (m *PutRequest) Marshal() (dAtA []byte, err error) { } func (m *PutRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) - } - if m.Lease != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Lease)) - } - if m.PrevKv { - dAtA[i] = 0x20 - i++ - if m.PrevKv { + if m.IgnoreLease { + i-- + if m.IgnoreLease { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } if m.IgnoreValue { - dAtA[i] = 0x28 - i++ + i-- if m.IgnoreValue { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - if m.IgnoreLease { - dAtA[i] = 0x30 - i++ - if m.IgnoreLease { + if m.PrevKv { + i-- + if m.PrevKv { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - return i, nil + if m.Lease != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Lease)) + i-- + dAtA[i] = 0x18 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *PutResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5390,37 +8650,50 @@ func (m *PutResponse) Marshal() (dAtA []byte, err error) { } func (m *PutResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n2, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.PrevKv != nil { + { + size, err := m.PrevKv.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.PrevKv.Size())) - n3, err := m.PrevKv.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteRangeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5428,39 +8701,50 @@ func (m *DeleteRangeRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteRangeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteRangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.PrevKv { - dAtA[i] = 0x18 - i++ + i-- if m.PrevKv { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 + } + if len(m.RangeEnd) > 0 { + i -= len(m.RangeEnd) + copy(dAtA[i:], m.RangeEnd) + i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteRangeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5468,44 +8752,57 @@ func (m *DeleteRangeResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteRangeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteRangeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n4, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.PrevKvs) > 0 { + for iNdEx := len(m.PrevKvs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PrevKvs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i += n4 } if m.Deleted != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.Deleted)) + i-- + dAtA[i] = 0x10 } - if len(m.PrevKvs) > 0 { - for _, msg := range m.PrevKvs { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RequestOp) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5513,80 +8810,119 @@ func (m *RequestOp) Marshal() (dAtA []byte, err error) { } func (m *RequestOp) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Request != nil { - nn5, err := m.Request.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Request.Size() + i -= size + if _, err := m.Request.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn5 } - return i, nil + return len(dAtA) - i, nil } func (m *RequestOp_RequestRange) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestOp_RequestRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.RequestRange != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RequestRange.Size())) - n6, err := m.RequestRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.RequestRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RequestOp_RequestPut) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestOp_RequestPut) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.RequestPut != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RequestPut.Size())) - n7, err := m.RequestPut.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.RequestPut.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *RequestOp_RequestDeleteRange) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestOp_RequestDeleteRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.RequestDeleteRange != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RequestDeleteRange.Size())) - n8, err := m.RequestDeleteRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.RequestDeleteRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *RequestOp_RequestTxn) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RequestOp_RequestTxn) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.RequestTxn != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RequestTxn.Size())) - n9, err := m.RequestTxn.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.RequestTxn.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *ResponseOp) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5594,80 +8930,119 @@ func (m *ResponseOp) Marshal() (dAtA []byte, err error) { } func (m *ResponseOp) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponseOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Response != nil { - nn10, err := m.Response.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Response.Size() + i -= size + if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn10 } - return i, nil + return len(dAtA) - i, nil } func (m *ResponseOp_ResponseRange) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponseOp_ResponseRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ResponseRange != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ResponseRange.Size())) - n11, err := m.ResponseRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ResponseRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ResponseOp_ResponsePut) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponseOp_ResponsePut) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ResponsePut != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ResponsePut.Size())) - n12, err := m.ResponsePut.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ResponsePut.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *ResponseOp_ResponseDeleteRange) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponseOp_ResponseDeleteRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ResponseDeleteRange != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ResponseDeleteRange.Size())) - n13, err := m.ResponseDeleteRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ResponseDeleteRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *ResponseOp_ResponseTxn) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResponseOp_ResponseTxn) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ResponseTxn != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ResponseTxn.Size())) - n14, err := m.ResponseTxn.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ResponseTxn.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *Compare) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5675,86 +9050,125 @@ func (m *Compare) Marshal() (dAtA []byte, err error) { } func (m *Compare) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Compare) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Result != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Result)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Target != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Target)) + if len(m.RangeEnd) > 0 { + i -= len(m.RangeEnd) + copy(dAtA[i:], m.RangeEnd) + i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) + i-- + dAtA[i] = 0x4 + i-- + dAtA[i] = 0x82 + } + if m.TargetUnion != nil { + { + size := m.TargetUnion.Size() + i -= size + if _, err := m.TargetUnion.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } if len(m.Key) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.Key) + copy(dAtA[i:], m.Key) i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + i-- + dAtA[i] = 0x1a } - if m.TargetUnion != nil { - nn15, err := m.TargetUnion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn15 + if m.Target != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Target)) + i-- + dAtA[i] = 0x10 } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x4 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) + if m.Result != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Result)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *Compare_Version) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x20 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Compare_Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintRpc(dAtA, i, uint64(m.Version)) - return i, nil + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil } func (m *Compare_CreateRevision) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x28 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Compare_CreateRevision) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintRpc(dAtA, i, uint64(m.CreateRevision)) - return i, nil + i-- + dAtA[i] = 0x28 + return len(dAtA) - i, nil } func (m *Compare_ModRevision) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x30 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Compare_ModRevision) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintRpc(dAtA, i, uint64(m.ModRevision)) - return i, nil + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil } func (m *Compare_Value) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Compare_Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Value != nil { - dAtA[i] = 0x3a - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *Compare_Lease) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x40 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Compare_Lease) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintRpc(dAtA, i, uint64(m.Lease)) - return i, nil + i-- + dAtA[i] = 0x40 + return len(dAtA) - i, nil } func (m *TxnRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5762,53 +9176,68 @@ func (m *TxnRequest) Marshal() (dAtA []byte, err error) { } func (m *TxnRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TxnRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Compare) > 0 { - for _, msg := range m.Compare { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Failure) > 0 { + for iNdEx := len(m.Failure) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Failure[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } if len(m.Success) > 0 { - for _, msg := range m.Success { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Success) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Success[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if len(m.Failure) > 0 { - for _, msg := range m.Failure { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Compare) > 0 { + for iNdEx := len(m.Compare) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Compare[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *TxnResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5816,49 +9245,62 @@ func (m *TxnResponse) Marshal() (dAtA []byte, err error) { } func (m *TxnResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TxnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n16, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Responses) > 0 { + for iNdEx := len(m.Responses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Responses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i += n16 } if m.Succeeded { - dAtA[i] = 0x10 - i++ + i-- if m.Succeeded { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if len(m.Responses) > 0 { - for _, msg := range m.Responses { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CompactionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5866,32 +9308,41 @@ func (m *CompactionRequest) Marshal() (dAtA []byte, err error) { } func (m *CompactionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompactionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Revision != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Physical { - dAtA[i] = 0x10 - i++ + i-- if m.Physical { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Revision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *CompactionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5899,27 +9350,38 @@ func (m *CompactionResponse) Marshal() (dAtA []byte, err error) { } func (m *CompactionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompactionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n17, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HashRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5927,17 +9389,26 @@ func (m *HashRequest) Marshal() (dAtA []byte, err error) { } func (m *HashRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *HashKVRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5945,22 +9416,31 @@ func (m *HashKVRequest) Marshal() (dAtA []byte, err error) { } func (m *HashKVRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HashKVRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Revision != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *HashKVResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5968,37 +9448,48 @@ func (m *HashKVResponse) Marshal() (dAtA []byte, err error) { } func (m *HashKVResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HashKVResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n18, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.CompactRevision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) + i-- + dAtA[i] = 0x18 } if m.Hash != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.Hash)) + i-- + dAtA[i] = 0x10 } - if m.CompactRevision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HashResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6006,32 +9497,43 @@ func (m *HashResponse) Marshal() (dAtA []byte, err error) { } func (m *HashResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n19, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n19 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Hash != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.Hash)) + i-- + dAtA[i] = 0x10 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SnapshotRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6039,17 +9541,26 @@ func (m *SnapshotRequest) Marshal() (dAtA []byte, err error) { } func (m *SnapshotRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *SnapshotResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6057,38 +9568,50 @@ func (m *SnapshotResponse) Marshal() (dAtA []byte, err error) { } func (m *SnapshotResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n20, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Blob) > 0 { + i -= len(m.Blob) + copy(dAtA[i:], m.Blob) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Blob))) + i-- + dAtA[i] = 0x1a } if m.RemainingBytes != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.RemainingBytes)) + i-- + dAtA[i] = 0x10 } - if len(m.Blob) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Blob))) - i += copy(dAtA[i:], m.Blob) + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *WatchRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6096,66 +9619,98 @@ func (m *WatchRequest) Marshal() (dAtA []byte, err error) { } func (m *WatchRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.RequestUnion != nil { - nn21, err := m.RequestUnion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.RequestUnion.Size() + i -= size + if _, err := m.RequestUnion.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn21 } - return i, nil + return len(dAtA) - i, nil } func (m *WatchRequest_CreateRequest) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchRequest_CreateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.CreateRequest != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.CreateRequest.Size())) - n22, err := m.CreateRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.CreateRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n22 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *WatchRequest_CancelRequest) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchRequest_CancelRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.CancelRequest != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.CancelRequest.Size())) - n23, err := m.CancelRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.CancelRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n23 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *WatchRequest_ProgressRequest) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchRequest_ProgressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ProgressRequest != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ProgressRequest.Size())) - n24, err := m.ProgressRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ProgressRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n24 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *WatchCreateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6163,86 +9718,98 @@ func (m *WatchCreateRequest) Marshal() (dAtA []byte, err error) { } func (m *WatchCreateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchCreateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) + if m.Fragment { + i-- + if m.Fragment { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 } - if m.StartRevision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.StartRevision)) + if m.WatchId != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) + i-- + dAtA[i] = 0x38 } - if m.ProgressNotify { - dAtA[i] = 0x20 - i++ - if m.ProgressNotify { + if m.PrevKv { + i-- + if m.PrevKv { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } if len(m.Filters) > 0 { - dAtA26 := make([]byte, len(m.Filters)*10) - var j25 int + dAtA22 := make([]byte, len(m.Filters)*10) + var j21 int for _, num := range m.Filters { for num >= 1<<7 { - dAtA26[j25] = uint8(uint64(num)&0x7f | 0x80) + dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j25++ + j21++ } - dAtA26[j25] = uint8(num) - j25++ + dAtA22[j21] = uint8(num) + j21++ } + i -= j21 + copy(dAtA[i:], dAtA22[:j21]) + i = encodeVarintRpc(dAtA, i, uint64(j21)) + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintRpc(dAtA, i, uint64(j25)) - i += copy(dAtA[i:], dAtA26[:j25]) } - if m.PrevKv { - dAtA[i] = 0x30 - i++ - if m.PrevKv { + if m.ProgressNotify { + i-- + if m.ProgressNotify { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - if m.WatchId != 0 { - dAtA[i] = 0x38 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) + if m.StartRevision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.StartRevision)) + i-- + dAtA[i] = 0x18 } - if m.Fragment { - dAtA[i] = 0x40 - i++ - if m.Fragment { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + if len(m.RangeEnd) > 0 { + i -= len(m.RangeEnd) + copy(dAtA[i:], m.RangeEnd) + i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *WatchCancelRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6250,22 +9817,31 @@ func (m *WatchCancelRequest) Marshal() (dAtA []byte, err error) { } func (m *WatchCancelRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchCancelRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.WatchId != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *WatchProgressRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6273,17 +9849,26 @@ func (m *WatchProgressRequest) Marshal() (dAtA []byte, err error) { } func (m *WatchProgressRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchProgressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *WatchResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6291,85 +9876,99 @@ func (m *WatchResponse) Marshal() (dAtA []byte, err error) { } func (m *WatchResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n27, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.WatchId != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } } - if m.Created { - dAtA[i] = 0x18 - i++ - if m.Created { + if m.Fragment { + i-- + if m.Fragment { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x38 + } + if len(m.CancelReason) > 0 { + i -= len(m.CancelReason) + copy(dAtA[i:], m.CancelReason) + i = encodeVarintRpc(dAtA, i, uint64(len(m.CancelReason))) + i-- + dAtA[i] = 0x32 + } + if m.CompactRevision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) + i-- + dAtA[i] = 0x28 } if m.Canceled { - dAtA[i] = 0x20 - i++ + i-- if m.Canceled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.CompactRevision != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) - } - if len(m.CancelReason) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.CancelReason))) - i += copy(dAtA[i:], m.CancelReason) + i-- + dAtA[i] = 0x20 } - if m.Fragment { - dAtA[i] = 0x38 - i++ - if m.Fragment { + if m.Created { + i-- + if m.Created { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if len(m.Events) > 0 { - for _, msg := range m.Events { - dAtA[i] = 0x5a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.WatchId != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) + i-- + dAtA[i] = 0x10 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseGrantRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6377,27 +9976,36 @@ func (m *LeaseGrantRequest) Marshal() (dAtA []byte, err error) { } func (m *LeaseGrantRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseGrantRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.TTL != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ID != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x10 + } + if m.TTL != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseGrantResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6405,43 +10013,55 @@ func (m *LeaseGrantResponse) Marshal() (dAtA []byte, err error) { } func (m *LeaseGrantResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseGrantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n28, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n28 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.ID != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x22 } if m.TTL != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) + i-- + dAtA[i] = 0x18 } - if len(m.Error) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Error))) - i += copy(dAtA[i:], m.Error) + if m.ID != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x10 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseRevokeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6449,22 +10069,31 @@ func (m *LeaseRevokeRequest) Marshal() (dAtA []byte, err error) { } func (m *LeaseRevokeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseRevokeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseRevokeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6472,27 +10101,38 @@ func (m *LeaseRevokeResponse) Marshal() (dAtA []byte, err error) { } func (m *LeaseRevokeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseRevokeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n29, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n29 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseCheckpoint) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6500,27 +10140,36 @@ func (m *LeaseCheckpoint) Marshal() (dAtA []byte, err error) { } func (m *LeaseCheckpoint) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseCheckpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Remaining_TTL != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.Remaining_TTL)) + i-- + dAtA[i] = 0x10 + } + if m.ID != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseCheckpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6528,29 +10177,40 @@ func (m *LeaseCheckpointRequest) Marshal() (dAtA []byte, err error) { } func (m *LeaseCheckpointRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseCheckpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Checkpoints) > 0 { - for _, msg := range m.Checkpoints { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Checkpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Checkpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseCheckpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6558,27 +10218,38 @@ func (m *LeaseCheckpointResponse) Marshal() (dAtA []byte, err error) { } func (m *LeaseCheckpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseCheckpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n30, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n30 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseKeepAliveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6586,22 +10257,31 @@ func (m *LeaseKeepAliveRequest) Marshal() (dAtA []byte, err error) { } func (m *LeaseKeepAliveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseKeepAliveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseKeepAliveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6609,70 +10289,90 @@ func (m *LeaseKeepAliveResponse) Marshal() (dAtA []byte, err error) { } func (m *LeaseKeepAliveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseKeepAliveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n31, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n31 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.TTL != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) + i-- + dAtA[i] = 0x18 } if m.ID != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x10 } - if m.TTL != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseTimeToLiveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } -func (m *LeaseTimeToLiveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int +func (m *LeaseTimeToLiveRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseTimeToLiveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Keys { - dAtA[i] = 0x10 - i++ + i-- if m.Keys { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 + } + if m.ID != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseTimeToLiveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6680,50 +10380,62 @@ func (m *LeaseTimeToLiveResponse) Marshal() (dAtA []byte, err error) { } func (m *LeaseTimeToLiveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseTimeToLiveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n32, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Keys) > 0 { + for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Keys[iNdEx]) + copy(dAtA[i:], m.Keys[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Keys[iNdEx]))) + i-- + dAtA[i] = 0x2a } - i += n32 } - if m.ID != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + if m.GrantedTTL != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.GrantedTTL)) + i-- + dAtA[i] = 0x20 } if m.TTL != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) + i-- + dAtA[i] = 0x18 } - if m.GrantedTTL != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.GrantedTTL)) + if m.ID != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x10 } - if len(m.Keys) > 0 { - for _, b := range m.Keys { - dAtA[i] = 0x2a - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(b))) - i += copy(dAtA[i:], b) + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseLeasesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6731,17 +10443,26 @@ func (m *LeaseLeasesRequest) Marshal() (dAtA []byte, err error) { } func (m *LeaseLeasesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseLeasesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *LeaseStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6749,22 +10470,31 @@ func (m *LeaseStatus) Marshal() (dAtA []byte, err error) { } func (m *LeaseStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *LeaseLeasesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6772,39 +10502,52 @@ func (m *LeaseLeasesResponse) Marshal() (dAtA []byte, err error) { } func (m *LeaseLeasesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseLeasesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n33, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n33 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Leases) > 0 { - for _, msg := range m.Leases { + for iNdEx := len(m.Leases) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Leases[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Member) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6812,68 +10555,66 @@ func (m *Member) Marshal() (dAtA []byte, err error) { } func (m *Member) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Member) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.IsLearner { + i-- + if m.IsLearner { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x28 } if len(m.ClientURLs) > 0 { - for _, s := range m.ClientURLs { + for iNdEx := len(m.ClientURLs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ClientURLs[iNdEx]) + copy(dAtA[i:], m.ClientURLs[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.ClientURLs[iNdEx]))) + i-- dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.IsLearner { - dAtA[i] = 0x28 - i++ - if m.IsLearner { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.PeerURLs) > 0 { + for iNdEx := len(m.PeerURLs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PeerURLs[iNdEx]) + copy(dAtA[i:], m.PeerURLs[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.PeerURLs[iNdEx]))) + i-- + dAtA[i] = 0x1a } - i++ } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.ID != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *MemberAddRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6881,42 +10622,45 @@ func (m *MemberAddRequest) Marshal() (dAtA []byte, err error) { } func (m *MemberAddRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberAddRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.IsLearner { - dAtA[i] = 0x10 - i++ + i-- if m.IsLearner { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 + } + if len(m.PeerURLs) > 0 { + for iNdEx := len(m.PeerURLs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PeerURLs[iNdEx]) + copy(dAtA[i:], m.PeerURLs[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.PeerURLs[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *MemberAddResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6924,49 +10668,64 @@ func (m *MemberAddResponse) Marshal() (dAtA []byte, err error) { } func (m *MemberAddResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberAddResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n34, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Members) > 0 { + for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i += n34 } if m.Member != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Member.Size())) - n35, err := m.Member.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Member.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n35 + i-- + dAtA[i] = 0x12 } - if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MemberRemoveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6974,22 +10733,31 @@ func (m *MemberRemoveRequest) Marshal() (dAtA []byte, err error) { } func (m *MemberRemoveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberRemoveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *MemberRemoveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6997,39 +10765,52 @@ func (m *MemberRemoveResponse) Marshal() (dAtA []byte, err error) { } func (m *MemberRemoveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberRemoveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n36, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n36 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Members) > 0 { - for _, msg := range m.Members { + for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MemberUpdateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7037,37 +10818,40 @@ func (m *MemberUpdateRequest) Marshal() (dAtA []byte, err error) { } func (m *MemberUpdateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberUpdateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { + for iNdEx := len(m.PeerURLs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PeerURLs[iNdEx]) + copy(dAtA[i:], m.PeerURLs[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.PeerURLs[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - return i, nil + if m.ID != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *MemberUpdateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7075,39 +10859,52 @@ func (m *MemberUpdateResponse) Marshal() (dAtA []byte, err error) { } func (m *MemberUpdateResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberUpdateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n37, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n37 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Members) > 0 { - for _, msg := range m.Members { + for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MemberListRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7115,17 +10912,36 @@ func (m *MemberListRequest) Marshal() (dAtA []byte, err error) { } func (m *MemberListRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Linearizable { + i-- + if m.Linearizable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *MemberListResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7133,39 +10949,52 @@ func (m *MemberListResponse) Marshal() (dAtA []byte, err error) { } func (m *MemberListResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n38, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n38 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Members) > 0 { - for _, msg := range m.Members { + for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MemberPromoteRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7173,22 +11002,31 @@ func (m *MemberPromoteRequest) Marshal() (dAtA []byte, err error) { } func (m *MemberPromoteRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberPromoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *MemberPromoteResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7196,39 +11034,52 @@ func (m *MemberPromoteResponse) Marshal() (dAtA []byte, err error) { } func (m *MemberPromoteResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemberPromoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n39, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n39 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Members) > 0 { - for _, msg := range m.Members { + for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DefragmentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7236,17 +11087,26 @@ func (m *DefragmentRequest) Marshal() (dAtA []byte, err error) { } func (m *DefragmentRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DefragmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *DefragmentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7254,27 +11114,38 @@ func (m *DefragmentResponse) Marshal() (dAtA []byte, err error) { } func (m *DefragmentResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DefragmentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n40, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n40 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MoveLeaderRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7282,22 +11153,31 @@ func (m *MoveLeaderRequest) Marshal() (dAtA []byte, err error) { } func (m *MoveLeaderRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MoveLeaderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.TargetID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.TargetID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *MoveLeaderResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7305,27 +11185,38 @@ func (m *MoveLeaderResponse) Marshal() (dAtA []byte, err error) { } func (m *MoveLeaderResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MoveLeaderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n41, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n41 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AlarmRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7333,32 +11224,41 @@ func (m *AlarmRequest) Marshal() (dAtA []byte, err error) { } func (m *AlarmRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AlarmRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Action != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Action)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Alarm != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Alarm)) + i-- + dAtA[i] = 0x18 } if m.MemberID != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.MemberID)) + i-- + dAtA[i] = 0x10 } - if m.Alarm != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Alarm)) + if m.Action != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *AlarmMember) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7366,27 +11266,36 @@ func (m *AlarmMember) Marshal() (dAtA []byte, err error) { } func (m *AlarmMember) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AlarmMember) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemberID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MemberID)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Alarm != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.Alarm)) + i-- + dAtA[i] = 0x10 + } + if m.MemberID != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.MemberID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *AlarmResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7394,39 +11303,137 @@ func (m *AlarmResponse) Marshal() (dAtA []byte, err error) { } func (m *AlarmResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AlarmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n42, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n42 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Alarms) > 0 { - for _, msg := range m.Alarms { + for iNdEx := len(m.Alarms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Alarms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DowngradeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DowngradeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DowngradeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if m.Action != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DowngradeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DowngradeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DowngradeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *StatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7434,17 +11441,26 @@ func (m *StatusRequest) Marshal() (dAtA []byte, err error) { } func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *StatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7452,88 +11468,94 @@ func (m *StatusResponse) Marshal() (dAtA []byte, err error) { } func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n43, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n43 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Version) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Version))) - i += copy(dAtA[i:], m.Version) + if m.IsLearner { + i-- + if m.IsLearner { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 } - if m.DbSize != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.DbSize)) + if m.DbSizeInUse != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.DbSizeInUse)) + i-- + dAtA[i] = 0x48 } - if m.Leader != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Leader)) + if len(m.Errors) > 0 { + for iNdEx := len(m.Errors) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Errors[iNdEx]) + copy(dAtA[i:], m.Errors[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Errors[iNdEx]))) + i-- + dAtA[i] = 0x42 + } } - if m.RaftIndex != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RaftIndex)) + if m.RaftAppliedIndex != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.RaftAppliedIndex)) + i-- + dAtA[i] = 0x38 } if m.RaftTerm != 0 { - dAtA[i] = 0x30 - i++ i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) + i-- + dAtA[i] = 0x30 } - if m.RaftAppliedIndex != 0 { - dAtA[i] = 0x38 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RaftAppliedIndex)) + if m.RaftIndex != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.RaftIndex)) + i-- + dAtA[i] = 0x28 } - if len(m.Errors) > 0 { - for _, s := range m.Errors { - dAtA[i] = 0x42 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.Leader != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.Leader)) + i-- + dAtA[i] = 0x20 } - if m.DbSizeInUse != 0 { - dAtA[i] = 0x48 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.DbSizeInUse)) + if m.DbSize != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.DbSize)) + i-- + dAtA[i] = 0x18 } - if m.IsLearner { - dAtA[i] = 0x50 - i++ - if m.IsLearner { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i++ + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthEnableRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7541,17 +11563,26 @@ func (m *AuthEnableRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthEnableRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthEnableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *AuthDisableRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7559,17 +11590,53 @@ func (m *AuthDisableRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthDisableRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthDisableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *AuthStatusRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AuthStatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *AuthenticateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7577,29 +11644,40 @@ func (m *AuthenticateRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthenticateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthenticateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Password) + copy(dAtA[i:], m.Password) i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserAddRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7607,39 +11685,59 @@ func (m *AuthUserAddRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthUserAddRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserAddRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.HashedPassword) > 0 { + i -= len(m.HashedPassword) + copy(dAtA[i:], m.HashedPassword) + i = encodeVarintRpc(dAtA, i, uint64(len(m.HashedPassword))) + i-- + dAtA[i] = 0x22 + } + if m.Options != nil { + { + size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Password) + copy(dAtA[i:], m.Password) i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) + i-- + dAtA[i] = 0x12 } - if m.Options != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Options.Size())) - n44, err := m.Options.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n44 + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserGetRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7647,23 +11745,33 @@ func (m *AuthUserGetRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthUserGetRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserGetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserDeleteRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7671,23 +11779,33 @@ func (m *AuthUserDeleteRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthUserDeleteRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserDeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserChangePasswordRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7695,29 +11813,47 @@ func (m *AuthUserChangePasswordRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthUserChangePasswordRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserChangePasswordRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.HashedPassword) > 0 { + i -= len(m.HashedPassword) + copy(dAtA[i:], m.HashedPassword) + i = encodeVarintRpc(dAtA, i, uint64(len(m.HashedPassword))) + i-- + dAtA[i] = 0x1a } if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Password) + copy(dAtA[i:], m.Password) i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserGrantRoleRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7725,29 +11861,40 @@ func (m *AuthUserGrantRoleRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthUserGrantRoleRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserGrantRoleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.User) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.User))) - i += copy(dAtA[i:], m.User) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Role) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Role) + copy(dAtA[i:], m.Role) i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintRpc(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *AuthUserRevokeRoleRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7755,29 +11902,40 @@ func (m *AuthUserRevokeRoleRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthUserRevokeRoleRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserRevokeRoleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Role) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Role) + copy(dAtA[i:], m.Role) i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleAddRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7785,23 +11943,33 @@ func (m *AuthRoleAddRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleAddRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleAddRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleGetRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7809,23 +11977,33 @@ func (m *AuthRoleGetRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleGetRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleGetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Role) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Role) + copy(dAtA[i:], m.Role) i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserListRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7833,17 +12011,26 @@ func (m *AuthUserListRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthUserListRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *AuthRoleListRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7851,17 +12038,26 @@ func (m *AuthRoleListRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleListRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil } func (m *AuthRoleDeleteRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7869,23 +12065,33 @@ func (m *AuthRoleDeleteRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleDeleteRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleDeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Role) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Role) + copy(dAtA[i:], m.Role) i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleGrantPermissionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7893,33 +12099,45 @@ func (m *AuthRoleGrantPermissionRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleGrantPermissionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleGrantPermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Perm != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Perm.Size())) - n45, err := m.Perm.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Perm.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n45 + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleRevokePermissionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7927,35 +12145,47 @@ func (m *AuthRoleRevokePermissionRequest) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleRevokePermissionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleRevokePermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Role) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.RangeEnd) > 0 { + i -= len(m.RangeEnd) + copy(dAtA[i:], m.RangeEnd) + i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) + i-- + dAtA[i] = 0x1a } if len(m.Key) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Key) + copy(dAtA[i:], m.Key) i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + i-- + dAtA[i] = 0x12 } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthEnableResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7963,27 +12193,38 @@ func (m *AuthEnableResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthEnableResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthEnableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n46, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n46 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthDisableResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7991,27 +12232,92 @@ func (m *AuthDisableResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthDisableResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthDisableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n47, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + return len(dAtA) - i, nil +} + +func (m *AuthStatusResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AuthStatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.AuthRevision != 0 { + i = encodeVarintRpc(dAtA, i, uint64(m.AuthRevision)) + i-- + dAtA[i] = 0x18 + } + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n47 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthenticateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8019,33 +12325,45 @@ func (m *AuthenticateResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthenticateResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthenticateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n48, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n48 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Token) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Token) + copy(dAtA[i:], m.Token) i = encodeVarintRpc(dAtA, i, uint64(len(m.Token))) - i += copy(dAtA[i:], m.Token) + i-- + dAtA[i] = 0x12 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserAddResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8053,27 +12371,38 @@ func (m *AuthUserAddResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthUserAddResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserAddResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n49, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n49 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserGetResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8081,42 +12410,47 @@ func (m *AuthUserGetResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthUserGetResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserGetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n50, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n50 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Roles) > 0 { - for _, s := range m.Roles { + for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Roles[iNdEx]) + copy(dAtA[i:], m.Roles[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Roles[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserDeleteResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8124,27 +12458,38 @@ func (m *AuthUserDeleteResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthUserDeleteResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserDeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n51, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n51 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserChangePasswordResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8152,27 +12497,38 @@ func (m *AuthUserChangePasswordResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthUserChangePasswordResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserChangePasswordResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n52, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n52 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserGrantRoleResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8180,27 +12536,38 @@ func (m *AuthUserGrantRoleResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthUserGrantRoleResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserGrantRoleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n53, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n53 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserRevokeRoleResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8208,27 +12575,38 @@ func (m *AuthUserRevokeRoleResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthUserRevokeRoleResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserRevokeRoleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n54, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n54 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleAddResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8236,27 +12614,38 @@ func (m *AuthRoleAddResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleAddResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleAddResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n55, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n55 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleGetResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8264,39 +12653,52 @@ func (m *AuthRoleGetResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleGetResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleGetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n56, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n56 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Perm) > 0 { - for _, msg := range m.Perm { + for iNdEx := len(m.Perm) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Perm[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleListResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8304,42 +12706,47 @@ func (m *AuthRoleListResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleListResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n57, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n57 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Roles) > 0 { - for _, s := range m.Roles { + for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Roles[iNdEx]) + copy(dAtA[i:], m.Roles[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Roles[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthUserListResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8347,42 +12754,47 @@ func (m *AuthUserListResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthUserListResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthUserListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n58, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n58 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Users) > 0 { - for _, s := range m.Users { + for iNdEx := len(m.Users) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Users[iNdEx]) + copy(dAtA[i:], m.Users[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.Users[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + } + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleDeleteResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8390,27 +12802,38 @@ func (m *AuthRoleDeleteResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleDeleteResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleDeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n59, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n59 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleGrantPermissionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8418,27 +12841,38 @@ func (m *AuthRoleGrantPermissionResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleGrantPermissionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleGrantPermissionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n60, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n60 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AuthRoleRevokePermissionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8446,33 +12880,49 @@ func (m *AuthRoleRevokePermissionResponse) Marshal() (dAtA []byte, err error) { } func (m *AuthRoleRevokePermissionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthRoleRevokePermissionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n61, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRpc(dAtA, i, uint64(size)) } - i += n61 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { + offset -= sovRpc(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ResponseHeader) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ClusterId != 0 { @@ -8487,10 +12937,16 @@ func (m *ResponseHeader) Size() (n int) { if m.RaftTerm != 0 { n += 1 + sovRpc(uint64(m.RaftTerm)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RangeRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Key) @@ -8534,10 +12990,16 @@ func (m *RangeRequest) Size() (n int) { if m.MaxCreateRevision != 0 { n += 1 + sovRpc(uint64(m.MaxCreateRevision)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RangeResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -8556,10 +13018,16 @@ func (m *RangeResponse) Size() (n int) { if m.Count != 0 { n += 1 + sovRpc(uint64(m.Count)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *PutRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Key) @@ -8582,10 +13050,16 @@ func (m *PutRequest) Size() (n int) { if m.IgnoreLease { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *PutResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -8596,10 +13070,16 @@ func (m *PutResponse) Size() (n int) { l = m.PrevKv.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *DeleteRangeRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Key) @@ -8613,10 +13093,16 @@ func (m *DeleteRangeRequest) Size() (n int) { if m.PrevKv { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *DeleteRangeResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -8632,19 +13118,31 @@ func (m *DeleteRangeResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RequestOp) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Request != nil { n += m.Request.Size() } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RequestOp_RequestRange) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.RequestRange != nil { @@ -8654,6 +13152,9 @@ func (m *RequestOp_RequestRange) Size() (n int) { return n } func (m *RequestOp_RequestPut) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.RequestPut != nil { @@ -8663,6 +13164,9 @@ func (m *RequestOp_RequestPut) Size() (n int) { return n } func (m *RequestOp_RequestDeleteRange) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.RequestDeleteRange != nil { @@ -8672,6 +13176,9 @@ func (m *RequestOp_RequestDeleteRange) Size() (n int) { return n } func (m *RequestOp_RequestTxn) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.RequestTxn != nil { @@ -8681,15 +13188,24 @@ func (m *RequestOp_RequestTxn) Size() (n int) { return n } func (m *ResponseOp) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Response != nil { n += m.Response.Size() } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ResponseOp_ResponseRange) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ResponseRange != nil { @@ -8699,6 +13215,9 @@ func (m *ResponseOp_ResponseRange) Size() (n int) { return n } func (m *ResponseOp_ResponsePut) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ResponsePut != nil { @@ -8708,6 +13227,9 @@ func (m *ResponseOp_ResponsePut) Size() (n int) { return n } func (m *ResponseOp_ResponseDeleteRange) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ResponseDeleteRange != nil { @@ -8717,6 +13239,9 @@ func (m *ResponseOp_ResponseDeleteRange) Size() (n int) { return n } func (m *ResponseOp_ResponseTxn) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ResponseTxn != nil { @@ -8726,6 +13251,9 @@ func (m *ResponseOp_ResponseTxn) Size() (n int) { return n } func (m *Compare) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Result != 0 { @@ -8745,28 +13273,43 @@ func (m *Compare) Size() (n int) { if l > 0 { n += 2 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Compare_Version) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l n += 1 + sovRpc(uint64(m.Version)) return n } func (m *Compare_CreateRevision) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l n += 1 + sovRpc(uint64(m.CreateRevision)) return n } func (m *Compare_ModRevision) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l n += 1 + sovRpc(uint64(m.ModRevision)) return n } func (m *Compare_Value) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Value != nil { @@ -8776,12 +13319,18 @@ func (m *Compare_Value) Size() (n int) { return n } func (m *Compare_Lease) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l n += 1 + sovRpc(uint64(m.Lease)) return n } func (m *TxnRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Compare) > 0 { @@ -8802,10 +13351,16 @@ func (m *TxnRequest) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *TxnResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -8821,10 +13376,16 @@ func (m *TxnResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *CompactionRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Revision != 0 { @@ -8833,35 +13394,59 @@ func (m *CompactionRequest) Size() (n int) { if m.Physical { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *CompactionResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *HashRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *HashKVRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Revision != 0 { n += 1 + sovRpc(uint64(m.Revision)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *HashKVResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -8874,10 +13459,16 @@ func (m *HashKVResponse) Size() (n int) { if m.CompactRevision != 0 { n += 1 + sovRpc(uint64(m.CompactRevision)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *HashResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -8887,16 +13478,28 @@ func (m *HashResponse) Size() (n int) { if m.Hash != 0 { n += 1 + sovRpc(uint64(m.Hash)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *SnapshotRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *SnapshotResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -8910,19 +13513,31 @@ func (m *SnapshotResponse) Size() (n int) { if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *WatchRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.RequestUnion != nil { n += m.RequestUnion.Size() } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *WatchRequest_CreateRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.CreateRequest != nil { @@ -8932,6 +13547,9 @@ func (m *WatchRequest_CreateRequest) Size() (n int) { return n } func (m *WatchRequest_CancelRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.CancelRequest != nil { @@ -8941,6 +13559,9 @@ func (m *WatchRequest_CancelRequest) Size() (n int) { return n } func (m *WatchRequest_ProgressRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ProgressRequest != nil { @@ -8950,6 +13571,9 @@ func (m *WatchRequest_ProgressRequest) Size() (n int) { return n } func (m *WatchCreateRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Key) @@ -8982,25 +13606,43 @@ func (m *WatchCreateRequest) Size() (n int) { if m.Fragment { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *WatchCancelRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.WatchId != 0 { n += 1 + sovRpc(uint64(m.WatchId)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *WatchProgressRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *WatchResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9032,10 +13674,16 @@ func (m *WatchResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseGrantRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.TTL != 0 { @@ -9044,10 +13692,16 @@ func (m *LeaseGrantRequest) Size() (n int) { if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseGrantResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9064,29 +13718,47 @@ func (m *LeaseGrantResponse) Size() (n int) { if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseRevokeRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseRevokeResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseCheckpoint) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { @@ -9095,10 +13767,16 @@ func (m *LeaseCheckpoint) Size() (n int) { if m.Remaining_TTL != 0 { n += 1 + sovRpc(uint64(m.Remaining_TTL)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseCheckpointRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Checkpoints) > 0 { @@ -9107,29 +13785,47 @@ func (m *LeaseCheckpointRequest) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseCheckpointResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseKeepAliveRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseKeepAliveResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9142,10 +13838,16 @@ func (m *LeaseKeepAliveResponse) Size() (n int) { if m.TTL != 0 { n += 1 + sovRpc(uint64(m.TTL)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseTimeToLiveRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { @@ -9154,10 +13856,16 @@ func (m *LeaseTimeToLiveRequest) Size() (n int) { if m.Keys { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseTimeToLiveResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9179,25 +13887,43 @@ func (m *LeaseTimeToLiveResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseLeasesRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseStatus) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *LeaseLeasesResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9210,10 +13936,16 @@ func (m *LeaseLeasesResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Member) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { @@ -9238,10 +13970,16 @@ func (m *Member) Size() (n int) { if m.IsLearner { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberAddRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.PeerURLs) > 0 { @@ -9253,10 +13991,16 @@ func (m *MemberAddRequest) Size() (n int) { if m.IsLearner { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberAddResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9273,19 +14017,31 @@ func (m *MemberAddResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberRemoveRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberRemoveResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9298,10 +14054,16 @@ func (m *MemberRemoveResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberUpdateRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { @@ -9313,10 +14075,16 @@ func (m *MemberUpdateRequest) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberUpdateResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9329,16 +14097,31 @@ func (m *MemberUpdateResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberListRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.Linearizable { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberListResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9351,19 +14134,31 @@ func (m *MemberListResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberPromoteRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MemberPromoteResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9376,45 +14171,75 @@ func (m *MemberPromoteResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *DefragmentRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *DefragmentResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MoveLeaderRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.TargetID != 0 { n += 1 + sovRpc(uint64(m.TargetID)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MoveLeaderResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AlarmRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Action != 0 { @@ -9426,10 +14251,16 @@ func (m *AlarmRequest) Size() (n int) { if m.Alarm != 0 { n += 1 + sovRpc(uint64(m.Alarm)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AlarmMember) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.MemberID != 0 { @@ -9438,32 +14269,89 @@ func (m *AlarmMember) Size() (n int) { if m.Alarm != 0 { n += 1 + sovRpc(uint64(m.Alarm)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AlarmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + if len(m.Alarms) > 0 { + for _, e := range m.Alarms { + l = e.Size() + n += 1 + l + sovRpc(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DowngradeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Action != 0 { + n += 1 + sovRpc(uint64(m.Action)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DowngradeResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } - if len(m.Alarms) > 0 { - for _, e := range m.Alarms { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } return n } func (m *StatusRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *StatusResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9501,22 +14389,52 @@ func (m *StatusResponse) Size() (n int) { if m.IsLearner { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthEnableRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthDisableRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AuthStatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthenticateRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -9527,10 +14445,16 @@ func (m *AuthenticateRequest) Size() (n int) { if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserAddRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -9545,30 +14469,52 @@ func (m *AuthUserAddRequest) Size() (n int) { l = m.Options.Size() n += 1 + l + sovRpc(uint64(l)) } + l = len(m.HashedPassword) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserGetRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserDeleteRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserChangePasswordRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -9579,10 +14525,20 @@ func (m *AuthUserChangePasswordRequest) Size() (n int) { if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + l = len(m.HashedPassword) + if l > 0 { + n += 1 + l + sovRpc(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserGrantRoleRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.User) @@ -9593,10 +14549,16 @@ func (m *AuthUserGrantRoleRequest) Size() (n int) { if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserRevokeRoleRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -9607,52 +14569,88 @@ func (m *AuthUserRevokeRoleRequest) Size() (n int) { if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleAddRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleGetRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Role) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserListRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleListRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleDeleteRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Role) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleGrantPermissionRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -9663,10 +14661,16 @@ func (m *AuthRoleGrantPermissionRequest) Size() (n int) { l = m.Perm.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleRevokePermissionRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Role) @@ -9681,30 +14685,70 @@ func (m *AuthRoleRevokePermissionRequest) Size() (n int) { if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthEnableResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthDisableResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRpc(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AuthStatusResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.Enabled { + n += 2 + } + if m.AuthRevision != 0 { + n += 1 + sovRpc(uint64(m.AuthRevision)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthenticateResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9715,20 +14759,32 @@ func (m *AuthenticateResponse) Size() (n int) { if l > 0 { n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserAddResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserGetResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9741,60 +14797,96 @@ func (m *AuthUserGetResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserDeleteResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserChangePasswordResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserGrantRoleResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserRevokeRoleResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleAddResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleGetResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9807,10 +14899,16 @@ func (m *AuthRoleGetResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleListResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9823,10 +14921,16 @@ func (m *AuthRoleListResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthUserListResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { @@ -9839,48 +14943,62 @@ func (m *AuthUserListResponse) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleDeleteResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleGrantPermissionResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AuthRoleRevokePermissionResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func sovRpc(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozRpc(x uint64) (n int) { return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -9900,7 +15018,7 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -9928,7 +15046,7 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ClusterId |= (uint64(b) & 0x7F) << shift + m.ClusterId |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -9947,7 +15065,7 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MemberId |= (uint64(b) & 0x7F) << shift + m.MemberId |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -9966,7 +15084,7 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift + m.Revision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -9985,7 +15103,7 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RaftTerm |= (uint64(b) & 0x7F) << shift + m.RaftTerm |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -9996,12 +15114,13 @@ func (m *ResponseHeader) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10026,7 +15145,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -10054,7 +15173,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10063,6 +15182,9 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10085,7 +15207,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10094,6 +15216,9 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10116,7 +15241,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Limit |= (int64(b) & 0x7F) << shift + m.Limit |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -10135,7 +15260,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift + m.Revision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -10154,7 +15279,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SortOrder |= (RangeRequest_SortOrder(b) & 0x7F) << shift + m.SortOrder |= RangeRequest_SortOrder(b&0x7F) << shift if b < 0x80 { break } @@ -10173,7 +15298,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SortTarget |= (RangeRequest_SortTarget(b) & 0x7F) << shift + m.SortTarget |= RangeRequest_SortTarget(b&0x7F) << shift if b < 0x80 { break } @@ -10192,7 +15317,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10212,7 +15337,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10232,7 +15357,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10252,7 +15377,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinModRevision |= (int64(b) & 0x7F) << shift + m.MinModRevision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -10271,7 +15396,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxModRevision |= (int64(b) & 0x7F) << shift + m.MaxModRevision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -10290,7 +15415,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinCreateRevision |= (int64(b) & 0x7F) << shift + m.MinCreateRevision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -10309,7 +15434,7 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxCreateRevision |= (int64(b) & 0x7F) << shift + m.MaxCreateRevision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -10320,12 +15445,13 @@ func (m *RangeRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10350,7 +15476,7 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -10378,7 +15504,7 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10387,6 +15513,9 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10411,7 +15540,7 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10420,6 +15549,9 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10442,7 +15574,7 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10462,7 +15594,7 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Count |= (int64(b) & 0x7F) << shift + m.Count |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -10473,12 +15605,13 @@ func (m *RangeResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10503,7 +15636,7 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -10531,7 +15664,7 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10540,6 +15673,9 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10562,7 +15698,7 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10571,6 +15707,9 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10593,7 +15732,7 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Lease |= (int64(b) & 0x7F) << shift + m.Lease |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -10612,7 +15751,7 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10632,7 +15771,7 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10652,7 +15791,7 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10664,12 +15803,13 @@ func (m *PutRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10694,7 +15834,7 @@ func (m *PutResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -10722,7 +15862,7 @@ func (m *PutResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10731,6 +15871,9 @@ func (m *PutResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10755,7 +15898,7 @@ func (m *PutResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10764,6 +15907,9 @@ func (m *PutResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10780,12 +15926,13 @@ func (m *PutResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10810,7 +15957,7 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -10838,7 +15985,7 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10847,6 +15994,9 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10869,7 +16019,7 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10878,6 +16028,9 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -10900,7 +16053,7 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10912,12 +16065,13 @@ func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10942,7 +16096,7 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -10970,7 +16124,7 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -10979,6 +16133,9 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11003,7 +16160,7 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Deleted |= (int64(b) & 0x7F) << shift + m.Deleted |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -11022,7 +16179,7 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11031,6 +16188,9 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11045,12 +16205,13 @@ func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11075,7 +16236,7 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -11103,7 +16264,7 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11112,6 +16273,9 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11135,7 +16299,7 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11144,6 +16308,9 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11167,7 +16334,7 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11176,6 +16343,9 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11199,7 +16369,7 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11208,6 +16378,9 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11223,12 +16396,13 @@ func (m *RequestOp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11253,7 +16427,7 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -11281,7 +16455,7 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11290,6 +16464,9 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11313,7 +16490,7 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11322,6 +16499,9 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11345,7 +16525,7 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11354,6 +16534,9 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11377,7 +16560,7 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11386,6 +16569,9 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11401,12 +16587,13 @@ func (m *ResponseOp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11431,7 +16618,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -11459,7 +16646,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Result |= (Compare_CompareResult(b) & 0x7F) << shift + m.Result |= Compare_CompareResult(b&0x7F) << shift if b < 0x80 { break } @@ -11478,7 +16665,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Target |= (Compare_CompareTarget(b) & 0x7F) << shift + m.Target |= Compare_CompareTarget(b&0x7F) << shift if b < 0x80 { break } @@ -11497,7 +16684,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11506,6 +16693,9 @@ func (m *Compare) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11528,7 +16718,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int64(b) & 0x7F) << shift + v |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -11548,7 +16738,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int64(b) & 0x7F) << shift + v |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -11568,7 +16758,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int64(b) & 0x7F) << shift + v |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -11588,7 +16778,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11597,6 +16787,9 @@ func (m *Compare) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11618,7 +16811,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int64(b) & 0x7F) << shift + v |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -11638,7 +16831,7 @@ func (m *Compare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11647,6 +16840,9 @@ func (m *Compare) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11661,12 +16857,13 @@ func (m *Compare) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11691,7 +16888,7 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -11719,7 +16916,7 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11728,6 +16925,9 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11750,7 +16950,7 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11759,6 +16959,9 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11781,7 +16984,7 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11790,6 +16993,9 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11804,12 +17010,13 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11834,7 +17041,7 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -11862,7 +17069,7 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11871,6 +17078,9 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11895,7 +17105,7 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11915,7 +17125,7 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -11924,6 +17134,9 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -11938,12 +17151,13 @@ func (m *TxnResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11968,7 +17182,7 @@ func (m *CompactionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -11996,7 +17210,7 @@ func (m *CompactionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift + m.Revision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -12015,7 +17229,7 @@ func (m *CompactionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12027,12 +17241,13 @@ func (m *CompactionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12057,7 +17272,7 @@ func (m *CompactionResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12085,7 +17300,7 @@ func (m *CompactionResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12094,6 +17309,9 @@ func (m *CompactionResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12110,12 +17328,13 @@ func (m *CompactionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12140,7 +17359,7 @@ func (m *HashRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12160,12 +17379,13 @@ func (m *HashRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12190,7 +17410,7 @@ func (m *HashKVRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12218,7 +17438,7 @@ func (m *HashKVRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift + m.Revision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -12229,12 +17449,13 @@ func (m *HashKVRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12259,7 +17480,7 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12287,7 +17508,7 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12296,6 +17517,9 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12320,7 +17544,7 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Hash |= (uint32(b) & 0x7F) << shift + m.Hash |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -12339,7 +17563,7 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CompactRevision |= (int64(b) & 0x7F) << shift + m.CompactRevision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -12350,12 +17574,13 @@ func (m *HashKVResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12380,7 +17605,7 @@ func (m *HashResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12408,7 +17633,7 @@ func (m *HashResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12417,6 +17642,9 @@ func (m *HashResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12441,7 +17669,7 @@ func (m *HashResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Hash |= (uint32(b) & 0x7F) << shift + m.Hash |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -12452,12 +17680,13 @@ func (m *HashResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12482,7 +17711,7 @@ func (m *SnapshotRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12502,12 +17731,13 @@ func (m *SnapshotRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12532,7 +17762,7 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12560,7 +17790,7 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12569,6 +17799,9 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12593,7 +17826,7 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RemainingBytes |= (uint64(b) & 0x7F) << shift + m.RemainingBytes |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12612,7 +17845,7 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12621,6 +17854,9 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12635,12 +17871,13 @@ func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12665,7 +17902,7 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12693,7 +17930,7 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12702,6 +17939,9 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12725,7 +17965,7 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12734,6 +17974,9 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12757,7 +18000,7 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12766,6 +18009,9 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12781,12 +18027,13 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12811,7 +18058,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -12839,7 +18086,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12848,6 +18095,9 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12870,7 +18120,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12879,6 +18129,9 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -12901,7 +18154,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.StartRevision |= (int64(b) & 0x7F) << shift + m.StartRevision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -12920,7 +18173,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12938,7 +18191,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift + v |= WatchCreateRequest_FilterType(b&0x7F) << shift if b < 0x80 { break } @@ -12955,7 +18208,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - packedLen |= (int(b) & 0x7F) << shift + packedLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -12964,9 +18217,16 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + if elementCount != 0 && len(m.Filters) == 0 { + m.Filters = make([]WatchCreateRequest_FilterType, 0, elementCount) + } for iNdEx < postIndex { var v WatchCreateRequest_FilterType for shift := uint(0); ; shift += 7 { @@ -12978,7 +18238,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift + v |= WatchCreateRequest_FilterType(b&0x7F) << shift if b < 0x80 { break } @@ -13002,7 +18262,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13022,7 +18282,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WatchId |= (int64(b) & 0x7F) << shift + m.WatchId |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13041,7 +18301,7 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13053,12 +18313,13 @@ func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13083,7 +18344,7 @@ func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13111,7 +18372,7 @@ func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WatchId |= (int64(b) & 0x7F) << shift + m.WatchId |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13122,12 +18383,13 @@ func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13152,7 +18414,7 @@ func (m *WatchProgressRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13172,12 +18434,13 @@ func (m *WatchProgressRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13202,7 +18465,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13230,7 +18493,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13239,6 +18502,9 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -13263,7 +18529,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.WatchId |= (int64(b) & 0x7F) << shift + m.WatchId |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13282,7 +18548,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13302,7 +18568,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13322,7 +18588,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CompactRevision |= (int64(b) & 0x7F) << shift + m.CompactRevision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13341,7 +18607,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13351,6 +18617,9 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -13370,7 +18639,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13390,7 +18659,7 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13399,6 +18668,9 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -13413,12 +18685,13 @@ func (m *WatchResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13443,7 +18716,7 @@ func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13471,7 +18744,7 @@ func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift + m.TTL |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13490,7 +18763,7 @@ func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13501,12 +18774,13 @@ func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13531,7 +18805,7 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13559,7 +18833,7 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13568,6 +18842,9 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -13592,7 +18869,7 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13611,7 +18888,7 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift + m.TTL |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13630,7 +18907,7 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13640,6 +18917,9 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -13651,12 +18931,13 @@ func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13681,7 +18962,7 @@ func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13709,7 +18990,7 @@ func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13720,12 +19001,13 @@ func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13750,7 +19032,7 @@ func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13778,7 +19060,7 @@ func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13787,6 +19069,9 @@ func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -13803,12 +19088,13 @@ func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13833,7 +19119,7 @@ func (m *LeaseCheckpoint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13861,7 +19147,7 @@ func (m *LeaseCheckpoint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13880,7 +19166,7 @@ func (m *LeaseCheckpoint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Remaining_TTL |= (int64(b) & 0x7F) << shift + m.Remaining_TTL |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -13891,12 +19177,13 @@ func (m *LeaseCheckpoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13921,7 +19208,7 @@ func (m *LeaseCheckpointRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -13949,7 +19236,7 @@ func (m *LeaseCheckpointRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -13958,6 +19245,9 @@ func (m *LeaseCheckpointRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -13972,12 +19262,13 @@ func (m *LeaseCheckpointRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14002,7 +19293,7 @@ func (m *LeaseCheckpointResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14030,7 +19321,7 @@ func (m *LeaseCheckpointResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -14039,6 +19330,9 @@ func (m *LeaseCheckpointResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14055,12 +19349,13 @@ func (m *LeaseCheckpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14085,7 +19380,7 @@ func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14113,7 +19408,7 @@ func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -14124,12 +19419,13 @@ func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14154,7 +19450,7 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14182,7 +19478,7 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -14191,6 +19487,9 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14215,7 +19514,7 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -14234,7 +19533,7 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift + m.TTL |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -14245,12 +19544,13 @@ func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14275,7 +19575,7 @@ func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14303,7 +19603,7 @@ func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -14322,7 +19622,7 @@ func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -14334,12 +19634,13 @@ func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14364,7 +19665,7 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14392,7 +19693,7 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -14401,6 +19702,9 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14425,7 +19729,7 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -14444,7 +19748,7 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift + m.TTL |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -14463,7 +19767,7 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.GrantedTTL |= (int64(b) & 0x7F) << shift + m.GrantedTTL |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -14482,7 +19786,7 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -14491,6 +19795,9 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14503,12 +19810,13 @@ func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14533,7 +19841,7 @@ func (m *LeaseLeasesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14553,12 +19861,13 @@ func (m *LeaseLeasesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14583,7 +19892,7 @@ func (m *LeaseStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14611,7 +19920,7 @@ func (m *LeaseStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift + m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -14622,12 +19931,13 @@ func (m *LeaseStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14652,7 +19962,7 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14680,7 +19990,7 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -14689,6 +19999,9 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14713,7 +20026,7 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -14722,6 +20035,9 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14736,12 +20052,13 @@ func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14766,7 +20083,7 @@ func (m *Member) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14794,7 +20111,7 @@ func (m *Member) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.ID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14813,7 +20130,7 @@ func (m *Member) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14823,6 +20140,9 @@ func (m *Member) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14842,7 +20162,7 @@ func (m *Member) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14852,6 +20172,9 @@ func (m *Member) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14871,7 +20194,7 @@ func (m *Member) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14881,6 +20204,9 @@ func (m *Member) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14900,7 +20226,7 @@ func (m *Member) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -14912,12 +20238,13 @@ func (m *Member) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14942,7 +20269,7 @@ func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14970,7 +20297,7 @@ func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -14980,6 +20307,9 @@ func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -14999,7 +20329,7 @@ func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15011,12 +20341,13 @@ func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15041,7 +20372,7 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15069,7 +20400,7 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15078,6 +20409,9 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15102,7 +20436,7 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15111,6 +20445,9 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15135,7 +20472,7 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15144,6 +20481,9 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15158,12 +20498,13 @@ func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15188,7 +20529,7 @@ func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15216,7 +20557,7 @@ func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.ID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15227,12 +20568,13 @@ func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15257,7 +20599,7 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15285,7 +20627,7 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15294,6 +20636,9 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15318,7 +20663,7 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15327,6 +20672,9 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15341,12 +20689,13 @@ func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15371,7 +20720,7 @@ func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15399,7 +20748,7 @@ func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.ID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15418,7 +20767,7 @@ func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15428,6 +20777,9 @@ func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15439,12 +20791,13 @@ func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15469,7 +20822,7 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15497,7 +20850,7 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15506,6 +20859,9 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15530,7 +20886,7 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15539,6 +20895,9 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15553,12 +20912,13 @@ func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15583,7 +20943,7 @@ func (m *MemberListRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15597,18 +20957,39 @@ func (m *MemberListRequest) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MemberListRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Linearizable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Linearizable = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15633,7 +21014,7 @@ func (m *MemberListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15661,7 +21042,7 @@ func (m *MemberListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15670,6 +21051,9 @@ func (m *MemberListResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15694,7 +21078,7 @@ func (m *MemberListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15703,6 +21087,9 @@ func (m *MemberListResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15717,12 +21104,13 @@ func (m *MemberListResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15747,7 +21135,7 @@ func (m *MemberPromoteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15775,7 +21163,7 @@ func (m *MemberPromoteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift + m.ID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15786,12 +21174,13 @@ func (m *MemberPromoteRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15816,7 +21205,7 @@ func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15844,7 +21233,7 @@ func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15853,6 +21242,9 @@ func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15877,7 +21269,7 @@ func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -15886,6 +21278,9 @@ func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -15900,12 +21295,13 @@ func (m *MemberPromoteResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15930,7 +21326,7 @@ func (m *DefragmentRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -15950,12 +21346,13 @@ func (m *DefragmentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -15980,7 +21377,7 @@ func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16008,7 +21405,7 @@ func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -16017,6 +21414,9 @@ func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -16033,12 +21433,13 @@ func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16063,7 +21464,7 @@ func (m *MoveLeaderRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16091,7 +21492,7 @@ func (m *MoveLeaderRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TargetID |= (uint64(b) & 0x7F) << shift + m.TargetID |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16102,12 +21503,13 @@ func (m *MoveLeaderRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16132,7 +21534,7 @@ func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16150,7 +21552,221 @@ func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - var msglen int + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AlarmRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AlarmRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AlarmRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + m.Action = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Action |= AlarmRequest_AlarmAction(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) + } + m.MemberID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MemberID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) + } + m.Alarm = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Alarm |= AlarmType(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AlarmMember) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AlarmMember: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AlarmMember: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) + } + m.MemberID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MemberID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) + } + m.Alarm = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16160,37 +21776,24 @@ func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.Alarm |= AlarmType(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16200,7 +21803,7 @@ func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AlarmRequest) Unmarshal(dAtA []byte) error { +func (m *AlarmResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16215,7 +21818,7 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16223,17 +21826,17 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AlarmRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AlarmResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AlarmResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } - m.Action = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16243,16 +21846,33 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Action |= (AlarmRequest_AlarmAction(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Alarms", wireType) } - m.MemberID = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16262,42 +21882,39 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MemberID |= (uint64(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) + if msglen < 0 { + return ErrInvalidLengthRpc } - m.Alarm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Alarm |= (AlarmType(b) & 0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Alarms = append(m.Alarms, &AlarmMember{}) + if err := m.Alarms[len(m.Alarms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16307,7 +21924,7 @@ func (m *AlarmRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AlarmMember) Unmarshal(dAtA []byte) error { +func (m *DowngradeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16322,7 +21939,7 @@ func (m *AlarmMember) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16330,17 +21947,17 @@ func (m *AlarmMember) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AlarmMember: wiretype end group for non-group") + return fmt.Errorf("proto: DowngradeRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmMember: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DowngradeRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) } - m.MemberID = 0 + m.Action = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16350,16 +21967,16 @@ func (m *AlarmMember) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MemberID |= (uint64(b) & 0x7F) << shift + m.Action |= DowngradeRequest_DowngradeAction(b&0x7F) << shift if b < 0x80 { break } } case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - m.Alarm = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16369,23 +21986,37 @@ func (m *AlarmMember) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Alarm |= (AlarmType(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16395,7 +22026,7 @@ func (m *AlarmMember) Unmarshal(dAtA []byte) error { } return nil } -func (m *AlarmResponse) Unmarshal(dAtA []byte) error { +func (m *DowngradeResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -16410,7 +22041,7 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16418,10 +22049,10 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AlarmResponse: wiretype end group for non-group") + return fmt.Errorf("proto: DowngradeResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DowngradeResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -16438,7 +22069,7 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -16447,6 +22078,9 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -16459,9 +22093,9 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarms", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc @@ -16471,22 +22105,23 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { return ErrInvalidLengthRpc } - postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Alarms = append(m.Alarms, &AlarmMember{}) - if err := m.Alarms[len(m.Alarms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -16494,12 +22129,13 @@ func (m *AlarmResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16524,7 +22160,7 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16544,12 +22180,13 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16574,7 +22211,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16602,7 +22239,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -16611,6 +22248,9 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -16635,7 +22275,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16645,6 +22285,9 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -16664,7 +22307,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DbSize |= (int64(b) & 0x7F) << shift + m.DbSize |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -16683,7 +22326,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Leader |= (uint64(b) & 0x7F) << shift + m.Leader |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16702,7 +22345,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RaftIndex |= (uint64(b) & 0x7F) << shift + m.RaftIndex |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16721,7 +22364,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RaftTerm |= (uint64(b) & 0x7F) << shift + m.RaftTerm |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16740,7 +22383,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RaftAppliedIndex |= (uint64(b) & 0x7F) << shift + m.RaftAppliedIndex |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16759,7 +22402,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16769,6 +22412,9 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -16788,7 +22434,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DbSizeInUse |= (int64(b) & 0x7F) << shift + m.DbSizeInUse |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -16807,7 +22453,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -16819,12 +22465,13 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16849,7 +22496,7 @@ func (m *AuthEnableRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16869,12 +22516,13 @@ func (m *AuthEnableRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16899,7 +22547,7 @@ func (m *AuthDisableRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16919,12 +22567,64 @@ func (m *AuthDisableRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthStatusRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuthStatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -16949,7 +22649,7 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16977,7 +22677,7 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -16987,6 +22687,9 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17006,7 +22709,7 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17016,6 +22719,9 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17027,12 +22733,13 @@ func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17057,7 +22764,7 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17085,7 +22792,7 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17095,6 +22802,9 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17114,7 +22824,7 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17124,6 +22834,9 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17143,7 +22856,7 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -17152,6 +22865,9 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17162,18 +22878,51 @@ func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HashedPassword", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HashedPassword = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17198,7 +22947,7 @@ func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17226,7 +22975,7 @@ func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17236,6 +22985,9 @@ func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17247,12 +22999,13 @@ func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17277,7 +23030,7 @@ func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17305,7 +23058,7 @@ func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17315,6 +23068,9 @@ func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17326,12 +23082,13 @@ func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17356,7 +23113,7 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17372,7 +23129,39 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17384,7 +23173,7 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17394,14 +23183,17 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HashedPassword", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17413,7 +23205,7 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17423,10 +23215,13 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } - m.Password = string(dAtA[iNdEx:postIndex]) + m.HashedPassword = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -17434,12 +23229,13 @@ func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17464,7 +23260,7 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17492,7 +23288,7 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17502,6 +23298,9 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17521,7 +23320,7 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17531,6 +23330,9 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17542,12 +23344,13 @@ func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17572,7 +23375,7 @@ func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17600,7 +23403,7 @@ func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17610,6 +23413,9 @@ func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17629,7 +23435,7 @@ func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17639,6 +23445,9 @@ func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17650,12 +23459,13 @@ func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17680,7 +23490,7 @@ func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17708,7 +23518,7 @@ func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17718,6 +23528,9 @@ func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17729,12 +23542,13 @@ func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17759,7 +23573,7 @@ func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17787,7 +23601,7 @@ func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17797,6 +23611,9 @@ func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17808,12 +23625,13 @@ func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17838,7 +23656,7 @@ func (m *AuthUserListRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17858,12 +23676,13 @@ func (m *AuthUserListRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17888,7 +23707,7 @@ func (m *AuthRoleListRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17908,12 +23727,13 @@ func (m *AuthRoleListRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -17938,7 +23758,7 @@ func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17966,7 +23786,7 @@ func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -17976,6 +23796,9 @@ func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -17987,12 +23810,13 @@ func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18017,7 +23841,7 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18045,7 +23869,7 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18055,6 +23879,9 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18074,7 +23901,7 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18083,6 +23910,9 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18099,12 +23929,13 @@ func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18129,7 +23960,7 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18157,7 +23988,7 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18167,6 +23998,9 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18186,7 +24020,7 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18195,6 +24029,9 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18217,7 +24054,7 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18226,6 +24063,9 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18240,12 +24080,13 @@ func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18270,7 +24111,7 @@ func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18298,7 +24139,7 @@ func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18307,6 +24148,9 @@ func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18323,12 +24167,13 @@ func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18353,7 +24198,7 @@ func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18381,7 +24226,94 @@ func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &ResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthStatusResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuthStatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18390,6 +24322,9 @@ func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18400,18 +24335,58 @@ func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthRevision", wireType) + } + m.AuthRevision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuthRevision |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18436,7 +24411,7 @@ func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18464,7 +24439,7 @@ func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18473,6 +24448,9 @@ func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18497,7 +24475,7 @@ func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18507,6 +24485,9 @@ func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18518,12 +24499,13 @@ func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18548,7 +24530,7 @@ func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18576,7 +24558,7 @@ func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18585,6 +24567,9 @@ func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18601,12 +24586,13 @@ func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18631,7 +24617,7 @@ func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18659,7 +24645,7 @@ func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18668,6 +24654,9 @@ func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18692,7 +24681,7 @@ func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18702,6 +24691,9 @@ func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18713,12 +24705,13 @@ func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18743,7 +24736,7 @@ func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18771,7 +24764,7 @@ func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18780,6 +24773,9 @@ func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18796,12 +24792,13 @@ func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18826,7 +24823,7 @@ func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18854,7 +24851,7 @@ func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18863,6 +24860,9 @@ func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18879,12 +24879,13 @@ func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18909,7 +24910,7 @@ func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -18937,7 +24938,7 @@ func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -18946,6 +24947,9 @@ func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -18962,12 +24966,13 @@ func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -18992,7 +24997,7 @@ func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19020,7 +25025,7 @@ func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -19029,6 +25034,9 @@ func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19045,12 +25053,13 @@ func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -19075,7 +25084,7 @@ func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19103,7 +25112,7 @@ func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -19112,6 +25121,9 @@ func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19128,12 +25140,13 @@ func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -19158,7 +25171,7 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19186,7 +25199,7 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -19195,6 +25208,9 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19219,7 +25235,7 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -19228,6 +25244,9 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19242,12 +25261,13 @@ func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -19272,7 +25292,7 @@ func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19300,7 +25320,7 @@ func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -19309,6 +25329,9 @@ func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19333,7 +25356,7 @@ func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19343,6 +25366,9 @@ func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19354,12 +25380,13 @@ func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -19384,7 +25411,7 @@ func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19412,7 +25439,7 @@ func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -19421,6 +25448,9 @@ func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19445,7 +25475,7 @@ func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19455,6 +25485,9 @@ func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19466,12 +25499,13 @@ func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -19496,7 +25530,7 @@ func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19524,7 +25558,7 @@ func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -19533,6 +25567,9 @@ func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19549,12 +25586,13 @@ func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -19579,7 +25617,7 @@ func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19607,7 +25645,7 @@ func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -19616,6 +25654,9 @@ func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19632,12 +25673,13 @@ func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -19662,7 +25704,7 @@ func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -19690,7 +25732,7 @@ func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -19699,6 +25741,9 @@ func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRpc + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -19715,12 +25760,13 @@ func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -19733,6 +25779,7 @@ func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { func skipRpc(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -19764,10 +25811,8 @@ func skipRpc(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -19784,305 +25829,34 @@ func skipRpc(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthRpc } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRpc(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRpc + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthRpc + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("rpc.proto", fileDescriptorRpc) } - -var fileDescriptorRpc = []byte{ - // 3928 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x5b, 0x5b, 0x6f, 0x23, 0xc9, - 0x75, 0x56, 0x93, 0xe2, 0xed, 0xf0, 0x22, 0xaa, 0x74, 0x19, 0x0e, 0x67, 0x46, 0xa3, 0xad, 0xd9, - 0xd9, 0xd5, 0xce, 0xec, 0x8a, 0x6b, 0xd9, 0x4e, 0x80, 0x49, 0xe2, 0x58, 0x23, 0x71, 0x67, 0xb4, - 0xd2, 0x88, 0xda, 0x16, 0x67, 0xf6, 0x02, 0x23, 0x42, 0x8b, 0x2c, 0x49, 0x1d, 0x91, 0xdd, 0x74, - 0x77, 0x93, 0x23, 0x6d, 0x2e, 0x0e, 0x0c, 0xc7, 0x40, 0xf2, 0x68, 0x03, 0x41, 0xf2, 0x90, 0xa7, - 0x20, 0x08, 0xfc, 0x90, 0xe7, 0x00, 0xf9, 0x05, 0x79, 0xca, 0x05, 0xf9, 0x03, 0xc1, 0xc6, 0x2f, - 0xc9, 0xaf, 0x30, 0xea, 0xd6, 0x5d, 0x7d, 0xa3, 0xc6, 0xa6, 0x77, 0x5f, 0xa4, 0xae, 0x53, 0xa7, - 0xce, 0x39, 0x75, 0xaa, 0xea, 0x9c, 0xd3, 0x5f, 0x17, 0xa1, 0xe4, 0x8c, 0x7a, 0x9b, 0x23, 0xc7, - 0xf6, 0x6c, 0x54, 0x21, 0x5e, 0xaf, 0xef, 0x12, 0x67, 0x42, 0x9c, 0xd1, 0x69, 0x73, 0xf9, 0xdc, - 0x3e, 0xb7, 0x59, 0x47, 0x8b, 0x3e, 0x71, 0x9e, 0xe6, 0x6d, 0xca, 0xd3, 0x1a, 0x4e, 0x7a, 0x3d, - 0xf6, 0x67, 0x74, 0xda, 0xba, 0x9c, 0x88, 0xae, 0x3b, 0xac, 0xcb, 0x18, 0x7b, 0x17, 0xec, 0xcf, - 0xe8, 0x94, 0xfd, 0x13, 0x9d, 0x77, 0xcf, 0x6d, 0xfb, 0x7c, 0x40, 0x5a, 0xc6, 0xc8, 0x6c, 0x19, - 0x96, 0x65, 0x7b, 0x86, 0x67, 0xda, 0x96, 0xcb, 0x7b, 0xf1, 0x5f, 0x6a, 0x50, 0xd3, 0x89, 0x3b, - 0xb2, 0x2d, 0x97, 0x3c, 0x27, 0x46, 0x9f, 0x38, 0xe8, 0x1e, 0x40, 0x6f, 0x30, 0x76, 0x3d, 0xe2, - 0x9c, 0x98, 0xfd, 0x86, 0xb6, 0xae, 0x6d, 0xcc, 0xeb, 0x25, 0x41, 0xd9, 0xeb, 0xa3, 0x3b, 0x50, - 0x1a, 0x92, 0xe1, 0x29, 0xef, 0xcd, 0xb0, 0xde, 0x22, 0x27, 0xec, 0xf5, 0x51, 0x13, 0x8a, 0x0e, - 0x99, 0x98, 0xae, 0x69, 0x5b, 0x8d, 0xec, 0xba, 0xb6, 0x91, 0xd5, 0xfd, 0x36, 0x1d, 0xe8, 0x18, - 0x67, 0xde, 0x89, 0x47, 0x9c, 0x61, 0x63, 0x9e, 0x0f, 0xa4, 0x84, 0x2e, 0x71, 0x86, 0xf8, 0x27, - 0x39, 0xa8, 0xe8, 0x86, 0x75, 0x4e, 0x74, 0xf2, 0xc3, 0x31, 0x71, 0x3d, 0x54, 0x87, 0xec, 0x25, - 0xb9, 0x66, 0xea, 0x2b, 0x3a, 0x7d, 0xe4, 0xe3, 0xad, 0x73, 0x72, 0x42, 0x2c, 0xae, 0xb8, 0x42, - 0xc7, 0x5b, 0xe7, 0xa4, 0x6d, 0xf5, 0xd1, 0x32, 0xe4, 0x06, 0xe6, 0xd0, 0xf4, 0x84, 0x56, 0xde, - 0x08, 0x99, 0x33, 0x1f, 0x31, 0x67, 0x07, 0xc0, 0xb5, 0x1d, 0xef, 0xc4, 0x76, 0xfa, 0xc4, 0x69, - 0xe4, 0xd6, 0xb5, 0x8d, 0xda, 0xd6, 0xdb, 0x9b, 0xea, 0x42, 0x6c, 0xaa, 0x06, 0x6d, 0x1e, 0xdb, - 0x8e, 0xd7, 0xa1, 0xbc, 0x7a, 0xc9, 0x95, 0x8f, 0xe8, 0x23, 0x28, 0x33, 0x21, 0x9e, 0xe1, 0x9c, - 0x13, 0xaf, 0x91, 0x67, 0x52, 0x1e, 0xde, 0x20, 0xa5, 0xcb, 0x98, 0x75, 0xa6, 0x9e, 0x3f, 0x23, - 0x0c, 0x15, 0x97, 0x38, 0xa6, 0x31, 0x30, 0xbf, 0x34, 0x4e, 0x07, 0xa4, 0x51, 0x58, 0xd7, 0x36, - 0x8a, 0x7a, 0x88, 0x46, 0xe7, 0x7f, 0x49, 0xae, 0xdd, 0x13, 0xdb, 0x1a, 0x5c, 0x37, 0x8a, 0x8c, - 0xa1, 0x48, 0x09, 0x1d, 0x6b, 0x70, 0xcd, 0x16, 0xcd, 0x1e, 0x5b, 0x1e, 0xef, 0x2d, 0xb1, 0xde, - 0x12, 0xa3, 0xb0, 0xee, 0x0d, 0xa8, 0x0f, 0x4d, 0xeb, 0x64, 0x68, 0xf7, 0x4f, 0x7c, 0x87, 0x00, - 0x73, 0x48, 0x6d, 0x68, 0x5a, 0x2f, 0xec, 0xbe, 0x2e, 0xdd, 0x42, 0x39, 0x8d, 0xab, 0x30, 0x67, - 0x59, 0x70, 0x1a, 0x57, 0x2a, 0xe7, 0x26, 0x2c, 0x51, 0x99, 0x3d, 0x87, 0x18, 0x1e, 0x09, 0x98, - 0x2b, 0x8c, 0x79, 0x71, 0x68, 0x5a, 0x3b, 0xac, 0x27, 0xc4, 0x6f, 0x5c, 0xc5, 0xf8, 0xab, 0x82, - 0xdf, 0xb8, 0x0a, 0xf3, 0xe3, 0x4d, 0x28, 0xf9, 0x3e, 0x47, 0x45, 0x98, 0x3f, 0xec, 0x1c, 0xb6, - 0xeb, 0x73, 0x08, 0x20, 0xbf, 0x7d, 0xbc, 0xd3, 0x3e, 0xdc, 0xad, 0x6b, 0xa8, 0x0c, 0x85, 0xdd, - 0x36, 0x6f, 0x64, 0xf0, 0x53, 0x80, 0xc0, 0xbb, 0xa8, 0x00, 0xd9, 0xfd, 0xf6, 0xe7, 0xf5, 0x39, - 0xca, 0xf3, 0xaa, 0xad, 0x1f, 0xef, 0x75, 0x0e, 0xeb, 0x1a, 0x1d, 0xbc, 0xa3, 0xb7, 0xb7, 0xbb, - 0xed, 0x7a, 0x86, 0x72, 0xbc, 0xe8, 0xec, 0xd6, 0xb3, 0xa8, 0x04, 0xb9, 0x57, 0xdb, 0x07, 0x2f, - 0xdb, 0xf5, 0x79, 0xfc, 0x73, 0x0d, 0xaa, 0x62, 0xbd, 0xf8, 0x99, 0x40, 0xdf, 0x81, 0xfc, 0x05, - 0x3b, 0x17, 0x6c, 0x2b, 0x96, 0xb7, 0xee, 0x46, 0x16, 0x37, 0x74, 0x76, 0x74, 0xc1, 0x8b, 0x30, - 0x64, 0x2f, 0x27, 0x6e, 0x23, 0xb3, 0x9e, 0xdd, 0x28, 0x6f, 0xd5, 0x37, 0xf9, 0x81, 0xdd, 0xdc, - 0x27, 0xd7, 0xaf, 0x8c, 0xc1, 0x98, 0xe8, 0xb4, 0x13, 0x21, 0x98, 0x1f, 0xda, 0x0e, 0x61, 0x3b, - 0xb6, 0xa8, 0xb3, 0x67, 0xba, 0x8d, 0xd9, 0xa2, 0x89, 0xdd, 0xca, 0x1b, 0xf8, 0x17, 0x1a, 0xc0, - 0xd1, 0xd8, 0x4b, 0x3f, 0x1a, 0xcb, 0x90, 0x9b, 0x50, 0xc1, 0xe2, 0x58, 0xf0, 0x06, 0x3b, 0x13, - 0xc4, 0x70, 0x89, 0x7f, 0x26, 0x68, 0x03, 0xdd, 0x82, 0xc2, 0xc8, 0x21, 0x93, 0x93, 0xcb, 0x09, - 0x53, 0x52, 0xd4, 0xf3, 0xb4, 0xb9, 0x3f, 0x41, 0x6f, 0x41, 0xc5, 0x3c, 0xb7, 0x6c, 0x87, 0x9c, - 0x70, 0x59, 0x39, 0xd6, 0x5b, 0xe6, 0x34, 0x66, 0xb7, 0xc2, 0xc2, 0x05, 0xe7, 0x55, 0x96, 0x03, - 0x4a, 0xc2, 0x16, 0x94, 0x99, 0xa9, 0x33, 0xb9, 0xef, 0xbd, 0xc0, 0xc6, 0x0c, 0x1b, 0x16, 0x77, - 0xa1, 0xb0, 0x1a, 0xff, 0x00, 0xd0, 0x2e, 0x19, 0x10, 0x8f, 0xcc, 0x12, 0x3d, 0x14, 0x9f, 0x64, - 0x55, 0x9f, 0xe0, 0x9f, 0x69, 0xb0, 0x14, 0x12, 0x3f, 0xd3, 0xb4, 0x1a, 0x50, 0xe8, 0x33, 0x61, - 0xdc, 0x82, 0xac, 0x2e, 0x9b, 0xe8, 0x31, 0x14, 0x85, 0x01, 0x6e, 0x23, 0x9b, 0xb2, 0x69, 0x0a, - 0xdc, 0x26, 0x17, 0xff, 0x22, 0x03, 0x25, 0x31, 0xd1, 0xce, 0x08, 0x6d, 0x43, 0xd5, 0xe1, 0x8d, - 0x13, 0x36, 0x1f, 0x61, 0x51, 0x33, 0x3d, 0x08, 0x3d, 0x9f, 0xd3, 0x2b, 0x62, 0x08, 0x23, 0xa3, - 0xdf, 0x83, 0xb2, 0x14, 0x31, 0x1a, 0x7b, 0xc2, 0xe5, 0x8d, 0xb0, 0x80, 0x60, 0xff, 0x3d, 0x9f, - 0xd3, 0x41, 0xb0, 0x1f, 0x8d, 0x3d, 0xd4, 0x85, 0x65, 0x39, 0x98, 0xcf, 0x46, 0x98, 0x91, 0x65, - 0x52, 0xd6, 0xc3, 0x52, 0xe2, 0x4b, 0xf5, 0x7c, 0x4e, 0x47, 0x62, 0xbc, 0xd2, 0xa9, 0x9a, 0xe4, - 0x5d, 0xf1, 0xe0, 0x1d, 0x33, 0xa9, 0x7b, 0x65, 0xc5, 0x4d, 0xea, 0x5e, 0x59, 0x4f, 0x4b, 0x50, - 0x10, 0x2d, 0xfc, 0x2f, 0x19, 0x00, 0xb9, 0x1a, 0x9d, 0x11, 0xda, 0x85, 0x9a, 0x23, 0x5a, 0x21, - 0x6f, 0xdd, 0x49, 0xf4, 0x96, 0x58, 0xc4, 0x39, 0xbd, 0x2a, 0x07, 0x71, 0xe3, 0xbe, 0x07, 0x15, - 0x5f, 0x4a, 0xe0, 0xb0, 0xdb, 0x09, 0x0e, 0xf3, 0x25, 0x94, 0xe5, 0x00, 0xea, 0xb2, 0x4f, 0x61, - 0xc5, 0x1f, 0x9f, 0xe0, 0xb3, 0xb7, 0xa6, 0xf8, 0xcc, 0x17, 0xb8, 0x24, 0x25, 0xa8, 0x5e, 0x53, - 0x0d, 0x0b, 0xdc, 0x76, 0x3b, 0xc1, 0x6d, 0x71, 0xc3, 0xa8, 0xe3, 0x80, 0xe6, 0x4b, 0xde, 0xc4, - 0xff, 0x97, 0x85, 0xc2, 0x8e, 0x3d, 0x1c, 0x19, 0x0e, 0x5d, 0x8d, 0xbc, 0x43, 0xdc, 0xf1, 0xc0, - 0x63, 0xee, 0xaa, 0x6d, 0x3d, 0x08, 0x4b, 0x14, 0x6c, 0xf2, 0xbf, 0xce, 0x58, 0x75, 0x31, 0x84, - 0x0e, 0x16, 0xe9, 0x31, 0xf3, 0x06, 0x83, 0x45, 0x72, 0x14, 0x43, 0xe4, 0x41, 0xce, 0x06, 0x07, - 0xb9, 0x09, 0x85, 0x09, 0x71, 0x82, 0x94, 0xfe, 0x7c, 0x4e, 0x97, 0x04, 0xf4, 0x1e, 0x2c, 0x44, - 0xd3, 0x4b, 0x4e, 0xf0, 0xd4, 0x7a, 0xe1, 0x6c, 0xf4, 0x00, 0x2a, 0xa1, 0x1c, 0x97, 0x17, 0x7c, - 0xe5, 0xa1, 0x92, 0xe2, 0x56, 0x65, 0x5c, 0xa5, 0xf9, 0xb8, 0xf2, 0x7c, 0x4e, 0x46, 0xd6, 0x55, - 0x19, 0x59, 0x8b, 0x62, 0x94, 0x88, 0xad, 0xa1, 0x20, 0xf3, 0xfd, 0x70, 0x90, 0xc1, 0xdf, 0x87, - 0x6a, 0xc8, 0x41, 0x34, 0xef, 0xb4, 0x3f, 0x79, 0xb9, 0x7d, 0xc0, 0x93, 0xd4, 0x33, 0x96, 0x97, - 0xf4, 0xba, 0x46, 0x73, 0xdd, 0x41, 0xfb, 0xf8, 0xb8, 0x9e, 0x41, 0x55, 0x28, 0x1d, 0x76, 0xba, - 0x27, 0x9c, 0x2b, 0x8b, 0x9f, 0xf9, 0x12, 0x44, 0x92, 0x53, 0x72, 0xdb, 0x9c, 0x92, 0xdb, 0x34, - 0x99, 0xdb, 0x32, 0x41, 0x6e, 0x63, 0x69, 0xee, 0xa0, 0xbd, 0x7d, 0xdc, 0xae, 0xcf, 0x3f, 0xad, - 0x41, 0x85, 0xfb, 0xf7, 0x64, 0x6c, 0xd1, 0x54, 0xfb, 0x0f, 0x1a, 0x40, 0x70, 0x9a, 0x50, 0x0b, - 0x0a, 0x3d, 0xae, 0xa7, 0xa1, 0xb1, 0x60, 0xb4, 0x92, 0xb8, 0x64, 0xba, 0xe4, 0x42, 0xdf, 0x82, - 0x82, 0x3b, 0xee, 0xf5, 0x88, 0x2b, 0x53, 0xde, 0xad, 0x68, 0x3c, 0x14, 0xd1, 0x4a, 0x97, 0x7c, - 0x74, 0xc8, 0x99, 0x61, 0x0e, 0xc6, 0x2c, 0x01, 0x4e, 0x1f, 0x22, 0xf8, 0xf0, 0xdf, 0x69, 0x50, - 0x56, 0x36, 0xef, 0x6f, 0x18, 0x84, 0xef, 0x42, 0x89, 0xd9, 0x40, 0xfa, 0x22, 0x0c, 0x17, 0xf5, - 0x80, 0x80, 0x7e, 0x07, 0x4a, 0xf2, 0x04, 0xc8, 0x48, 0xdc, 0x48, 0x16, 0xdb, 0x19, 0xe9, 0x01, - 0x2b, 0xde, 0x87, 0x45, 0xe6, 0x95, 0x1e, 0x2d, 0xae, 0xa5, 0x1f, 0xd5, 0xf2, 0x53, 0x8b, 0x94, - 0x9f, 0x4d, 0x28, 0x8e, 0x2e, 0xae, 0x5d, 0xb3, 0x67, 0x0c, 0x84, 0x15, 0x7e, 0x1b, 0x7f, 0x0c, - 0x48, 0x15, 0x36, 0xcb, 0x74, 0x71, 0x15, 0xca, 0xcf, 0x0d, 0xf7, 0x42, 0x98, 0x84, 0x1f, 0x43, - 0x95, 0x36, 0xf7, 0x5f, 0xbd, 0x81, 0x8d, 0xec, 0xe5, 0x40, 0x72, 0xcf, 0xe4, 0x73, 0x04, 0xf3, - 0x17, 0x86, 0x7b, 0xc1, 0x26, 0x5a, 0xd5, 0xd9, 0x33, 0x7a, 0x0f, 0xea, 0x3d, 0x3e, 0xc9, 0x93, - 0xc8, 0x2b, 0xc3, 0x82, 0xa0, 0xfb, 0x95, 0xe0, 0x67, 0x50, 0xe1, 0x73, 0xf8, 0x6d, 0x1b, 0x81, - 0x17, 0x61, 0xe1, 0xd8, 0x32, 0x46, 0xee, 0x85, 0x2d, 0xb3, 0x1b, 0x9d, 0x74, 0x3d, 0xa0, 0xcd, - 0xa4, 0xf1, 0x5d, 0x58, 0x70, 0xc8, 0xd0, 0x30, 0x2d, 0xd3, 0x3a, 0x3f, 0x39, 0xbd, 0xf6, 0x88, - 0x2b, 0x5e, 0x98, 0x6a, 0x3e, 0xf9, 0x29, 0xa5, 0x52, 0xd3, 0x4e, 0x07, 0xf6, 0xa9, 0x08, 0x73, - 0xec, 0x19, 0xff, 0x34, 0x03, 0x95, 0x4f, 0x0d, 0xaf, 0x27, 0x97, 0x0e, 0xed, 0x41, 0xcd, 0x0f, - 0x6e, 0x8c, 0x22, 0x6c, 0x89, 0xa4, 0x58, 0x36, 0x46, 0x96, 0xd2, 0x32, 0x3b, 0x56, 0x7b, 0x2a, - 0x81, 0x89, 0x32, 0xac, 0x1e, 0x19, 0xf8, 0xa2, 0x32, 0xe9, 0xa2, 0x18, 0xa3, 0x2a, 0x4a, 0x25, - 0xa0, 0x0e, 0xd4, 0x47, 0x8e, 0x7d, 0xee, 0x10, 0xd7, 0xf5, 0x85, 0xf1, 0x34, 0x86, 0x13, 0x84, - 0x1d, 0x09, 0xd6, 0x40, 0xdc, 0xc2, 0x28, 0x4c, 0x7a, 0xba, 0x10, 0xd4, 0x33, 0x3c, 0x38, 0xfd, - 0x57, 0x06, 0x50, 0x7c, 0x52, 0xbf, 0x6e, 0x89, 0xf7, 0x10, 0x6a, 0xae, 0x67, 0x38, 0xb1, 0xcd, - 0x56, 0x65, 0x54, 0x3f, 0xe2, 0xbf, 0x0b, 0xbe, 0x41, 0x27, 0x96, 0xed, 0x99, 0x67, 0xd7, 0xa2, - 0x4a, 0xae, 0x49, 0xf2, 0x21, 0xa3, 0xa2, 0x36, 0x14, 0xce, 0xcc, 0x81, 0x47, 0x1c, 0xb7, 0x91, - 0x5b, 0xcf, 0x6e, 0xd4, 0xb6, 0x1e, 0xdf, 0xb4, 0x0c, 0x9b, 0x1f, 0x31, 0xfe, 0xee, 0xf5, 0x88, - 0xe8, 0x72, 0xac, 0x5a, 0x79, 0xe6, 0x43, 0xd5, 0xf8, 0x6d, 0x28, 0xbe, 0xa6, 0x22, 0xe8, 0x5b, - 0x76, 0x81, 0x17, 0x8b, 0xac, 0xcd, 0x5f, 0xb2, 0xcf, 0x1c, 0xe3, 0x7c, 0x48, 0x2c, 0x4f, 0xbe, - 0x07, 0xca, 0x36, 0x7e, 0x08, 0x10, 0xa8, 0xa1, 0x21, 0xff, 0xb0, 0x73, 0xf4, 0xb2, 0x5b, 0x9f, - 0x43, 0x15, 0x28, 0x1e, 0x76, 0x76, 0xdb, 0x07, 0x6d, 0x9a, 0x1f, 0x70, 0x4b, 0xba, 0x34, 0xb4, - 0x96, 0xaa, 0x4e, 0x2d, 0xa4, 0x13, 0xaf, 0xc2, 0x72, 0xd2, 0x02, 0xd2, 0x5a, 0xb4, 0x2a, 0x76, - 0xe9, 0x4c, 0x47, 0x45, 0x55, 0x9d, 0x09, 0x4f, 0xb7, 0x01, 0x05, 0xbe, 0x7b, 0xfb, 0xa2, 0x38, - 0x97, 0x4d, 0xea, 0x08, 0xbe, 0x19, 0x49, 0x5f, 0xac, 0x92, 0xdf, 0x4e, 0x0c, 0x2f, 0xb9, 0xc4, - 0xf0, 0x82, 0x1e, 0x40, 0xd5, 0x3f, 0x0d, 0x86, 0x2b, 0x6a, 0x81, 0x92, 0x5e, 0x91, 0x1b, 0x9d, - 0xd2, 0x42, 0x4e, 0x2f, 0x84, 0x9d, 0x8e, 0x1e, 0x42, 0x9e, 0x4c, 0x88, 0xe5, 0xb9, 0x8d, 0x32, - 0xcb, 0x18, 0x55, 0x59, 0xbb, 0xb7, 0x29, 0x55, 0x17, 0x9d, 0xf8, 0xbb, 0xb0, 0xc8, 0xde, 0x91, - 0x9e, 0x39, 0x86, 0xa5, 0xbe, 0xcc, 0x75, 0xbb, 0x07, 0xc2, 0xdd, 0xf4, 0x11, 0xd5, 0x20, 0xb3, - 0xb7, 0x2b, 0x9c, 0x90, 0xd9, 0xdb, 0xc5, 0x3f, 0xd6, 0x00, 0xa9, 0xe3, 0x66, 0xf2, 0x73, 0x44, - 0xb8, 0x54, 0x9f, 0x0d, 0xd4, 0x2f, 0x43, 0x8e, 0x38, 0x8e, 0xed, 0x30, 0x8f, 0x96, 0x74, 0xde, - 0xc0, 0x6f, 0x0b, 0x1b, 0x74, 0x32, 0xb1, 0x2f, 0xfd, 0x33, 0xc8, 0xa5, 0x69, 0xbe, 0xa9, 0xfb, - 0xb0, 0x14, 0xe2, 0x9a, 0x29, 0x73, 0x7d, 0x04, 0x0b, 0x4c, 0xd8, 0xce, 0x05, 0xe9, 0x5d, 0x8e, - 0x6c, 0xd3, 0x8a, 0xe9, 0xa3, 0x2b, 0x17, 0x04, 0x58, 0x3a, 0x0f, 0x3e, 0xb1, 0x8a, 0x4f, 0xec, - 0x76, 0x0f, 0xf0, 0xe7, 0xb0, 0x1a, 0x91, 0x23, 0xcd, 0xff, 0x43, 0x28, 0xf7, 0x7c, 0xa2, 0x2b, - 0x6a, 0x9d, 0x7b, 0x61, 0xe3, 0xa2, 0x43, 0xd5, 0x11, 0xb8, 0x03, 0xb7, 0x62, 0xa2, 0x67, 0x9a, - 0xf3, 0xbb, 0xb0, 0xc2, 0x04, 0xee, 0x13, 0x32, 0xda, 0x1e, 0x98, 0x93, 0x54, 0x4f, 0x8f, 0xc4, - 0xa4, 0x14, 0xc6, 0xaf, 0x77, 0x5f, 0xe0, 0xdf, 0x17, 0x1a, 0xbb, 0xe6, 0x90, 0x74, 0xed, 0x83, - 0x74, 0xdb, 0x68, 0x36, 0xbb, 0x24, 0xd7, 0xae, 0x28, 0x6b, 0xd8, 0x33, 0xfe, 0x47, 0x4d, 0xb8, - 0x4a, 0x1d, 0xfe, 0x35, 0xef, 0xe4, 0x35, 0x80, 0x73, 0x7a, 0x64, 0x48, 0x9f, 0x76, 0x70, 0x44, - 0x45, 0xa1, 0xf8, 0x76, 0xd2, 0xf8, 0x5d, 0x11, 0x76, 0x2e, 0x8b, 0x7d, 0xce, 0xfe, 0xf8, 0x51, - 0xee, 0x1e, 0x94, 0x19, 0xe1, 0xd8, 0x33, 0xbc, 0xb1, 0x1b, 0x5b, 0x8c, 0x3f, 0x17, 0xdb, 0x5e, - 0x0e, 0x9a, 0x69, 0x5e, 0xdf, 0x82, 0x3c, 0x7b, 0x99, 0x90, 0xa5, 0xf4, 0xed, 0x84, 0xfd, 0xc8, - 0xed, 0xd0, 0x05, 0x23, 0xfe, 0xa9, 0x06, 0xf9, 0x17, 0x0c, 0x82, 0x55, 0x4c, 0x9b, 0x97, 0x6b, - 0x61, 0x19, 0x43, 0x0e, 0x0c, 0x95, 0x74, 0xf6, 0xcc, 0x4a, 0x4f, 0x42, 0x9c, 0x97, 0xfa, 0x01, - 0x2f, 0x71, 0x4b, 0xba, 0xdf, 0xa6, 0x3e, 0xeb, 0x0d, 0x4c, 0x62, 0x79, 0xac, 0x77, 0x9e, 0xf5, - 0x2a, 0x14, 0x5a, 0x3d, 0x9b, 0xee, 0x01, 0x31, 0x1c, 0x4b, 0x80, 0xa6, 0x45, 0x3d, 0x20, 0xe0, - 0x03, 0xa8, 0x73, 0x3b, 0xb6, 0xfb, 0x7d, 0xa5, 0xc0, 0xf4, 0xb5, 0x69, 0x11, 0x6d, 0x21, 0x69, - 0x99, 0xa8, 0xb4, 0x7f, 0xd2, 0x60, 0x51, 0x11, 0x37, 0x93, 0x57, 0xdf, 0x87, 0x3c, 0x07, 0xa9, - 0x45, 0xa5, 0xb3, 0x1c, 0x1e, 0xc5, 0xd5, 0xe8, 0x82, 0x07, 0x6d, 0x42, 0x81, 0x3f, 0xc9, 0x77, - 0x80, 0x64, 0x76, 0xc9, 0x84, 0x1f, 0xc2, 0x92, 0x20, 0x91, 0xa1, 0x9d, 0x74, 0x30, 0xd8, 0x62, - 0xe0, 0x3f, 0x85, 0xe5, 0x30, 0xdb, 0x4c, 0x53, 0x52, 0x8c, 0xcc, 0xbc, 0x89, 0x91, 0xdb, 0xd2, - 0xc8, 0x97, 0xa3, 0xbe, 0x52, 0x47, 0x45, 0x77, 0x8c, 0xba, 0x5e, 0x99, 0xf0, 0x7a, 0x05, 0x13, - 0x90, 0x22, 0xbe, 0xd1, 0x09, 0x2c, 0xc9, 0xed, 0x70, 0x60, 0xba, 0x7e, 0xb9, 0xfe, 0x25, 0x20, - 0x95, 0xf8, 0x8d, 0x1a, 0xf4, 0x8e, 0x74, 0xc7, 0x91, 0x63, 0x0f, 0xed, 0x54, 0x97, 0xe2, 0x3f, - 0x83, 0x95, 0x08, 0xdf, 0x37, 0xed, 0xb7, 0x5d, 0x22, 0x8b, 0x15, 0xe9, 0xb7, 0x8f, 0x01, 0xa9, - 0xc4, 0x99, 0xb2, 0x56, 0x0b, 0x16, 0x5f, 0xd8, 0x13, 0x1a, 0xfe, 0x28, 0x35, 0x38, 0xf7, 0x1c, - 0x63, 0xf0, 0x5d, 0xe1, 0xb7, 0xa9, 0x72, 0x75, 0xc0, 0x4c, 0xca, 0xff, 0x43, 0x83, 0xca, 0xf6, - 0xc0, 0x70, 0x86, 0x52, 0xf1, 0xf7, 0x20, 0xcf, 0xdf, 0x9c, 0x05, 0x58, 0xf5, 0x4e, 0x58, 0x8c, - 0xca, 0xcb, 0x1b, 0xdb, 0xfc, 0x3d, 0x5b, 0x8c, 0xa2, 0x86, 0x8b, 0xef, 0x59, 0xbb, 0x91, 0xef, - 0x5b, 0xbb, 0xe8, 0x03, 0xc8, 0x19, 0x74, 0x08, 0x4b, 0x33, 0xb5, 0x28, 0x66, 0xc1, 0xa4, 0xb1, - 0xfa, 0x9e, 0x73, 0xe1, 0xef, 0x40, 0x59, 0xd1, 0x80, 0x0a, 0x90, 0x7d, 0xd6, 0x16, 0xc5, 0xf8, - 0xf6, 0x4e, 0x77, 0xef, 0x15, 0x07, 0x6b, 0x6a, 0x00, 0xbb, 0x6d, 0xbf, 0x9d, 0xc1, 0x9f, 0x89, - 0x51, 0x22, 0xa4, 0xab, 0xf6, 0x68, 0x69, 0xf6, 0x64, 0xde, 0xc8, 0x9e, 0x2b, 0xa8, 0x8a, 0xe9, - 0xcf, 0x9a, 0xa2, 0x98, 0xbc, 0x94, 0x14, 0xa5, 0x18, 0xaf, 0x0b, 0x46, 0xbc, 0x00, 0x55, 0x91, - 0xb4, 0xc4, 0xfe, 0xfb, 0xf7, 0x0c, 0xd4, 0x24, 0x65, 0x56, 0x50, 0x5d, 0xe2, 0x81, 0x3c, 0xc9, - 0xf9, 0x68, 0xe0, 0x2a, 0xe4, 0xfb, 0xa7, 0xc7, 0xe6, 0x97, 0xf2, 0x03, 0x88, 0x68, 0x51, 0xfa, - 0x80, 0xeb, 0xe1, 0x5f, 0x21, 0x45, 0x8b, 0x66, 0x23, 0xc7, 0x38, 0xf3, 0xf6, 0xac, 0x3e, 0xb9, - 0x62, 0xb9, 0x6d, 0x5e, 0x0f, 0x08, 0x0c, 0x28, 0x11, 0x5f, 0x2b, 0xd9, 0x0b, 0x82, 0xf2, 0xf5, - 0x12, 0x3d, 0x82, 0x3a, 0x7d, 0xde, 0x1e, 0x8d, 0x06, 0x26, 0xe9, 0x73, 0x01, 0x05, 0xc6, 0x13, - 0xa3, 0x53, 0xed, 0xac, 0xa4, 0x76, 0x1b, 0x45, 0x16, 0x5d, 0x45, 0x0b, 0xad, 0x43, 0x99, 0xdb, - 0xb7, 0x67, 0xbd, 0x74, 0x09, 0xfb, 0x84, 0x97, 0xd5, 0x55, 0x52, 0x38, 0x5b, 0x42, 0x34, 0x5b, - 0x2e, 0xc1, 0xe2, 0xf6, 0xd8, 0xbb, 0x68, 0x5b, 0xc6, 0xe9, 0x40, 0x46, 0x22, 0x5a, 0xce, 0x50, - 0xe2, 0xae, 0xe9, 0xaa, 0xd4, 0x36, 0x2c, 0x51, 0x2a, 0xb1, 0x3c, 0xb3, 0xa7, 0x64, 0x02, 0x59, - 0x2b, 0x68, 0x91, 0x5a, 0xc1, 0x70, 0xdd, 0xd7, 0xb6, 0xd3, 0x17, 0xee, 0xf5, 0xdb, 0x78, 0xc2, - 0x85, 0xbf, 0x74, 0x43, 0xf9, 0xfe, 0xd7, 0x94, 0x82, 0x3e, 0x84, 0x82, 0x3d, 0x62, 0x9f, 0xa4, - 0x05, 0x6e, 0xb0, 0xba, 0xc9, 0x3f, 0x62, 0x6f, 0x0a, 0xc1, 0x1d, 0xde, 0xab, 0x4b, 0x36, 0xbc, - 0x11, 0xe8, 0x7d, 0x46, 0xbc, 0x29, 0x7a, 0xf1, 0x63, 0x58, 0x91, 0x9c, 0x02, 0x26, 0x9f, 0xc2, - 0xdc, 0x81, 0x7b, 0x92, 0x79, 0xe7, 0xc2, 0xb0, 0xce, 0xc9, 0x91, 0x30, 0xf1, 0x37, 0xf5, 0xcf, - 0x53, 0x68, 0xf8, 0x76, 0xb2, 0x57, 0x37, 0x7b, 0xa0, 0x1a, 0x30, 0x76, 0xc5, 0x4e, 0x2f, 0xe9, - 0xec, 0x99, 0xd2, 0x1c, 0x7b, 0xe0, 0xd7, 0x6a, 0xf4, 0x19, 0xef, 0xc0, 0x6d, 0x29, 0x43, 0xbc, - 0x54, 0x85, 0x85, 0xc4, 0x0c, 0x4a, 0x12, 0x22, 0x1c, 0x46, 0x87, 0x4e, 0x5f, 0x28, 0x95, 0x33, - 0xec, 0x5a, 0x26, 0x53, 0x53, 0x64, 0xae, 0xf0, 0x3d, 0x44, 0x0d, 0x53, 0xd3, 0xb1, 0x20, 0x53, - 0x01, 0x2a, 0x59, 0x2c, 0x04, 0x25, 0xc7, 0x16, 0x22, 0x26, 0xfa, 0x07, 0xb0, 0xe6, 0x1b, 0x41, - 0xfd, 0x76, 0x44, 0x9c, 0xa1, 0xe9, 0xba, 0x0a, 0xb0, 0x9a, 0x34, 0xf1, 0x77, 0x60, 0x7e, 0x44, - 0x44, 0x24, 0x2c, 0x6f, 0x21, 0xb9, 0x89, 0x94, 0xc1, 0xac, 0x1f, 0xf7, 0xe1, 0xbe, 0x94, 0xce, - 0x3d, 0x9a, 0x28, 0x3e, 0x6a, 0x94, 0x84, 0x9b, 0x32, 0x29, 0x70, 0x53, 0x36, 0x02, 0xf6, 0x7f, - 0xcc, 0x1d, 0x29, 0x4f, 0xe3, 0x4c, 0x19, 0x6e, 0x9f, 0xfb, 0xd4, 0x3f, 0xc4, 0x33, 0x09, 0x3b, - 0x85, 0xe5, 0xf0, 0xd9, 0x9f, 0x29, 0xf8, 0x2e, 0x43, 0xce, 0xb3, 0x2f, 0x89, 0x0c, 0xbd, 0xbc, - 0x21, 0x0d, 0xf6, 0x03, 0xc3, 0x4c, 0x06, 0x1b, 0x81, 0x30, 0xb6, 0x25, 0x67, 0xb5, 0x97, 0xae, - 0xa6, 0xac, 0x6c, 0x79, 0x03, 0x1f, 0xc2, 0x6a, 0x34, 0x4c, 0xcc, 0x64, 0xf2, 0x2b, 0xbe, 0x81, - 0x93, 0x22, 0xc9, 0x4c, 0x72, 0x3f, 0x09, 0x82, 0x81, 0x12, 0x50, 0x66, 0x12, 0xa9, 0x43, 0x33, - 0x29, 0xbe, 0xfc, 0x36, 0xf6, 0xab, 0x1f, 0x6e, 0x66, 0x12, 0xe6, 0x06, 0xc2, 0x66, 0x5f, 0xfe, - 0x20, 0x46, 0x64, 0xa7, 0xc6, 0x08, 0x71, 0x48, 0x82, 0x28, 0xf6, 0x35, 0x6c, 0x3a, 0xa1, 0x23, - 0x08, 0xa0, 0xb3, 0xea, 0xa0, 0x39, 0xc4, 0xd7, 0xc1, 0x1a, 0x72, 0x63, 0xab, 0x61, 0x77, 0xa6, - 0xc5, 0xf8, 0x34, 0x88, 0x9d, 0xb1, 0xc8, 0x3c, 0x93, 0xe0, 0xcf, 0x60, 0x3d, 0x3d, 0x28, 0xcf, - 0x22, 0xf9, 0x51, 0x0b, 0x4a, 0x7e, 0x19, 0xac, 0xdc, 0x22, 0x2a, 0x43, 0xe1, 0xb0, 0x73, 0x7c, - 0xb4, 0xbd, 0xd3, 0xe6, 0xd7, 0x88, 0x76, 0x3a, 0xba, 0xfe, 0xf2, 0xa8, 0x5b, 0xcf, 0x6c, 0xfd, - 0x32, 0x0b, 0x99, 0xfd, 0x57, 0xe8, 0x73, 0xc8, 0xf1, 0x6f, 0xea, 0x53, 0x2e, 0x52, 0x34, 0xa7, - 0x5d, 0x1b, 0xc0, 0xb7, 0x7e, 0xfc, 0xdf, 0xbf, 0xfc, 0x79, 0x66, 0x11, 0x57, 0x5a, 0x93, 0x6f, - 0xb7, 0x2e, 0x27, 0x2d, 0x96, 0x1b, 0x9e, 0x68, 0x8f, 0xd0, 0x27, 0x90, 0x3d, 0x1a, 0x7b, 0x28, - 0xf5, 0x82, 0x45, 0x33, 0xfd, 0x26, 0x01, 0x5e, 0x61, 0x42, 0x17, 0x30, 0x08, 0xa1, 0xa3, 0xb1, - 0x47, 0x45, 0xfe, 0x10, 0xca, 0xea, 0x3d, 0x80, 0x1b, 0x6f, 0x5d, 0x34, 0x6f, 0xbe, 0x63, 0x80, - 0xef, 0x31, 0x55, 0xb7, 0x30, 0x12, 0xaa, 0xf8, 0x4d, 0x05, 0x75, 0x16, 0xdd, 0x2b, 0x0b, 0xa5, - 0xde, 0xc9, 0x68, 0xa6, 0x5f, 0x3b, 0x88, 0xcd, 0xc2, 0xbb, 0xb2, 0xa8, 0xc8, 0x3f, 0x16, 0x37, - 0x0e, 0x7a, 0x1e, 0xba, 0x9f, 0xf0, 0xc5, 0x59, 0xfd, 0xb6, 0xda, 0x5c, 0x4f, 0x67, 0x10, 0x4a, - 0xee, 0x32, 0x25, 0xab, 0x78, 0x51, 0x28, 0xe9, 0xf9, 0x2c, 0x4f, 0xb4, 0x47, 0x5b, 0x3d, 0xc8, - 0xb1, 0xef, 0x16, 0xe8, 0x0b, 0xf9, 0xd0, 0x4c, 0xf8, 0x80, 0x93, 0xb2, 0xd0, 0xa1, 0x2f, 0x1e, - 0x78, 0x99, 0x29, 0xaa, 0xe1, 0x12, 0x55, 0xc4, 0xbe, 0x5a, 0x3c, 0xd1, 0x1e, 0x6d, 0x68, 0x1f, - 0x6a, 0x5b, 0xff, 0x9c, 0x83, 0x1c, 0x03, 0xec, 0xd0, 0x25, 0x40, 0x80, 0xe1, 0x47, 0x67, 0x17, - 0xfb, 0x2a, 0x10, 0x9d, 0x5d, 0x1c, 0xfe, 0xc7, 0x4d, 0xa6, 0x74, 0x19, 0x2f, 0x50, 0xa5, 0x0c, - 0x07, 0x6c, 0x31, 0x68, 0x93, 0xfa, 0xf1, 0xaf, 0x34, 0x81, 0x57, 0xf2, 0xb3, 0x84, 0x92, 0xa4, - 0x85, 0x80, 0xfc, 0xe8, 0x76, 0x48, 0x00, 0xf1, 0xf1, 0x77, 0x99, 0xc2, 0x16, 0xae, 0x07, 0x0a, - 0x1d, 0xc6, 0xf1, 0x44, 0x7b, 0xf4, 0x45, 0x03, 0x2f, 0x09, 0x2f, 0x47, 0x7a, 0xd0, 0x8f, 0xa0, - 0x16, 0x06, 0xaa, 0xd1, 0x83, 0x04, 0x5d, 0x51, 0xbc, 0xbb, 0xf9, 0xf6, 0x74, 0x26, 0x61, 0xd3, - 0x1a, 0xb3, 0x49, 0x28, 0xe7, 0x9a, 0x2f, 0x09, 0x19, 0x19, 0x94, 0x49, 0xac, 0x01, 0xfa, 0x7b, - 0x4d, 0x7c, 0x47, 0x08, 0x90, 0x67, 0x94, 0x24, 0x3d, 0x86, 0x6b, 0x37, 0x1f, 0xde, 0xc0, 0x25, - 0x8c, 0xf8, 0x03, 0x66, 0xc4, 0xef, 0xe2, 0xe5, 0xc0, 0x08, 0xcf, 0x1c, 0x12, 0xcf, 0x16, 0x56, - 0x7c, 0x71, 0x17, 0xdf, 0x0a, 0x39, 0x27, 0xd4, 0x1b, 0x2c, 0x16, 0x47, 0x8f, 0x13, 0x17, 0x2b, - 0x84, 0x46, 0x27, 0x2e, 0x56, 0x18, 0x7a, 0x4e, 0x5a, 0x2c, 0x8e, 0x15, 0x27, 0x2d, 0x96, 0xdf, - 0xb3, 0xf5, 0xff, 0xf3, 0x50, 0xd8, 0xe1, 0x37, 0x7d, 0x91, 0x0d, 0x25, 0x1f, 0x7c, 0x45, 0x6b, - 0x49, 0x08, 0x53, 0xf0, 0x2e, 0xd1, 0xbc, 0x9f, 0xda, 0x2f, 0x0c, 0x7a, 0x8b, 0x19, 0x74, 0x07, - 0xaf, 0x52, 0xcd, 0xe2, 0x32, 0x71, 0x8b, 0xc3, 0x18, 0x2d, 0xa3, 0xdf, 0xa7, 0x8e, 0xf8, 0x13, - 0xa8, 0xa8, 0xe8, 0x28, 0x7a, 0x2b, 0x11, 0xd5, 0x52, 0x01, 0xd6, 0x26, 0x9e, 0xc6, 0x22, 0x34, - 0xbf, 0xcd, 0x34, 0xaf, 0xe1, 0xdb, 0x09, 0x9a, 0x1d, 0xc6, 0x1a, 0x52, 0xce, 0x91, 0xcd, 0x64, - 0xe5, 0x21, 0xe0, 0x34, 0x59, 0x79, 0x18, 0x18, 0x9d, 0xaa, 0x7c, 0xcc, 0x58, 0xa9, 0x72, 0x17, - 0x20, 0xc0, 0x30, 0x51, 0xa2, 0x2f, 0x95, 0x97, 0xa9, 0x68, 0x70, 0x88, 0xc3, 0x9f, 0x18, 0x33, - 0xb5, 0x62, 0xdf, 0x45, 0xd4, 0x0e, 0x4c, 0xd7, 0xe3, 0x07, 0xb3, 0x1a, 0x02, 0x25, 0x51, 0xe2, - 0x7c, 0xc2, 0xc8, 0x66, 0xf3, 0xc1, 0x54, 0x1e, 0xa1, 0xfd, 0x21, 0xd3, 0x7e, 0x1f, 0x37, 0x13, - 0xb4, 0x8f, 0x38, 0x2f, 0xdd, 0x6c, 0x7f, 0x9d, 0x87, 0xf2, 0x0b, 0xc3, 0xb4, 0x3c, 0x62, 0x19, - 0x56, 0x8f, 0xa0, 0x53, 0xc8, 0xb1, 0x4c, 0x1d, 0x0d, 0xc4, 0x2a, 0x60, 0x17, 0x0d, 0xc4, 0x21, - 0x34, 0x0b, 0xaf, 0x33, 0xc5, 0x4d, 0xbc, 0x42, 0x15, 0x0f, 0x03, 0xd1, 0x2d, 0x06, 0x42, 0xd1, - 0x49, 0x9f, 0x41, 0x5e, 0x7c, 0xc3, 0x89, 0x08, 0x0a, 0x81, 0x53, 0xcd, 0xbb, 0xc9, 0x9d, 0x49, - 0x7b, 0x59, 0x55, 0xe3, 0x32, 0x3e, 0xaa, 0x67, 0x02, 0x10, 0xa0, 0xab, 0xd1, 0x15, 0x8d, 0x81, - 0xb1, 0xcd, 0xf5, 0x74, 0x86, 0x24, 0x9f, 0xaa, 0x3a, 0xfb, 0x3e, 0x2f, 0xd5, 0xfb, 0x47, 0x30, - 0xff, 0xdc, 0x70, 0x2f, 0x50, 0x24, 0xf7, 0x2a, 0x37, 0x80, 0x9a, 0xcd, 0xa4, 0x2e, 0xa1, 0xe5, - 0x3e, 0xd3, 0x72, 0x9b, 0x87, 0x32, 0x55, 0xcb, 0x85, 0xe1, 0xd2, 0xa4, 0x86, 0xfa, 0x90, 0xe7, - 0x17, 0x82, 0xa2, 0xfe, 0x0b, 0x5d, 0x2a, 0x8a, 0xfa, 0x2f, 0x7c, 0x87, 0xe8, 0x66, 0x2d, 0x23, - 0x28, 0xca, 0x1b, 0x38, 0x28, 0xf2, 0x39, 0x36, 0x72, 0x5b, 0xa7, 0xb9, 0x96, 0xd6, 0x2d, 0x74, - 0x3d, 0x60, 0xba, 0xee, 0xe1, 0x46, 0x6c, 0xad, 0x04, 0xe7, 0x13, 0xed, 0xd1, 0x87, 0x1a, 0xfa, - 0x11, 0x40, 0x00, 0x48, 0xc7, 0x4e, 0x60, 0x14, 0xdb, 0x8e, 0x9d, 0xc0, 0x18, 0x96, 0x8d, 0x37, - 0x99, 0xde, 0x0d, 0xfc, 0x20, 0xaa, 0xd7, 0x73, 0x0c, 0xcb, 0x3d, 0x23, 0xce, 0x07, 0x1c, 0x74, - 0x74, 0x2f, 0xcc, 0x11, 0x3d, 0x0c, 0xff, 0xba, 0x00, 0xf3, 0xb4, 0x02, 0xa6, 0x85, 0x42, 0x00, - 0x1c, 0x44, 0x2d, 0x89, 0x01, 0x7c, 0x51, 0x4b, 0xe2, 0x98, 0x43, 0xb8, 0x50, 0x60, 0xbf, 0x11, - 0x21, 0x8c, 0x81, 0x3a, 0xda, 0x86, 0xb2, 0x82, 0x2c, 0xa0, 0x04, 0x61, 0x61, 0xe4, 0x30, 0x9a, - 0x7a, 0x12, 0x60, 0x09, 0x7c, 0x87, 0xe9, 0x5b, 0xe1, 0xa9, 0x87, 0xe9, 0xeb, 0x73, 0x0e, 0xaa, - 0xf0, 0x35, 0x54, 0x54, 0xf4, 0x01, 0x25, 0xc8, 0x8b, 0xa0, 0x92, 0xd1, 0x30, 0x9b, 0x04, 0x5e, - 0x84, 0x0f, 0xbe, 0xff, 0x3b, 0x18, 0xc9, 0x46, 0x15, 0x0f, 0xa0, 0x20, 0xe0, 0x88, 0xa4, 0x59, - 0x86, 0x21, 0xcc, 0xa4, 0x59, 0x46, 0xb0, 0x8c, 0x70, 0x71, 0xc9, 0x34, 0xd2, 0x37, 0x2e, 0x99, - 0xca, 0x84, 0xb6, 0x67, 0xc4, 0x4b, 0xd3, 0x16, 0xa0, 0x6b, 0x69, 0xda, 0x94, 0xb7, 0xdd, 0x34, - 0x6d, 0xe7, 0xc4, 0x13, 0xc7, 0x45, 0xbe, 0x45, 0xa2, 0x14, 0x61, 0x6a, 0xfa, 0xc0, 0xd3, 0x58, - 0x92, 0x6a, 0xff, 0x40, 0xa1, 0xcc, 0x1d, 0x57, 0x00, 0x01, 0x58, 0x12, 0x2d, 0xe8, 0x12, 0x11, - 0xd7, 0x68, 0x41, 0x97, 0x8c, 0xb7, 0x84, 0x43, 0x43, 0xa0, 0x97, 0xbf, 0x7a, 0x50, 0xcd, 0x3f, - 0xd3, 0x00, 0xc5, 0x71, 0x15, 0xf4, 0x38, 0x59, 0x7a, 0x22, 0x8e, 0xdb, 0x7c, 0xff, 0xcd, 0x98, - 0x93, 0xa2, 0x7d, 0x60, 0x52, 0x8f, 0x71, 0x8f, 0x5e, 0x53, 0xa3, 0xfe, 0x42, 0x83, 0x6a, 0x08, - 0x94, 0x41, 0xef, 0xa4, 0xac, 0x69, 0x04, 0x06, 0x6e, 0xbe, 0x7b, 0x23, 0x5f, 0x52, 0xa5, 0xab, - 0xec, 0x00, 0x59, 0xf2, 0xff, 0x44, 0x83, 0x5a, 0x18, 0xc4, 0x41, 0x29, 0xb2, 0x63, 0x30, 0x72, - 0x73, 0xe3, 0x66, 0xc6, 0xe9, 0xcb, 0x13, 0x54, 0xfb, 0x03, 0x28, 0x08, 0xd8, 0x27, 0x69, 0xe3, - 0x87, 0x01, 0xe8, 0xa4, 0x8d, 0x1f, 0xc1, 0x8c, 0x12, 0x36, 0xbe, 0x63, 0x0f, 0x88, 0x72, 0xcc, - 0x04, 0x2e, 0x94, 0xa6, 0x6d, 0xfa, 0x31, 0x8b, 0x80, 0x4a, 0x69, 0xda, 0x82, 0x63, 0x26, 0x01, - 0x21, 0x94, 0x22, 0xec, 0x86, 0x63, 0x16, 0xc5, 0x93, 0x12, 0x8e, 0x19, 0x53, 0xa8, 0x1c, 0xb3, - 0x00, 0xba, 0x49, 0x3a, 0x66, 0x31, 0x3c, 0x3d, 0xe9, 0x98, 0xc5, 0xd1, 0x9f, 0x84, 0x75, 0x64, - 0x7a, 0x43, 0xc7, 0x6c, 0x29, 0x01, 0xe5, 0x41, 0xef, 0xa7, 0x38, 0x31, 0x11, 0xa6, 0x6f, 0x7e, - 0xf0, 0x86, 0xdc, 0xa9, 0x7b, 0x9c, 0xbb, 0x5f, 0xee, 0xf1, 0xbf, 0xd1, 0x60, 0x39, 0x09, 0x21, - 0x42, 0x29, 0x7a, 0x52, 0xe0, 0xfd, 0xe6, 0xe6, 0x9b, 0xb2, 0x4f, 0xf7, 0x96, 0xbf, 0xeb, 0x9f, - 0xd6, 0xff, 0xed, 0xab, 0x35, 0xed, 0x3f, 0xbf, 0x5a, 0xd3, 0xfe, 0xe7, 0xab, 0x35, 0xed, 0x6f, - 0xff, 0x77, 0x6d, 0xee, 0x34, 0xcf, 0x7e, 0x5d, 0xf9, 0xed, 0x5f, 0x05, 0x00, 0x00, 0xff, 0xff, - 0x52, 0x4e, 0xd7, 0x33, 0xe4, 0x39, 0x00, 0x00, -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/rpc.proto b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.proto similarity index 95% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/rpc.proto rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.proto index 423eabada4e4..14391378ada9 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/etcdserverpb/rpc.proto +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package etcdserverpb; import "gogoproto/gogo.proto"; -import "etcd/mvcc/mvccpb/kv.proto"; -import "etcd/auth/authpb/auth.proto"; +import "etcd/api/mvccpb/kv.proto"; +import "etcd/api/authpb/auth.proto"; // for grpc-gateway import "google/api/annotations.proto"; @@ -237,6 +237,16 @@ service Maintenance { body: "*" }; } + + // Downgrade requests downgrades, verifies feasibility or cancels downgrade + // on the cluster version. + // Supported since etcd 3.5. + rpc Downgrade(DowngradeRequest) returns (DowngradeResponse) { + option (google.api.http) = { + post: "/v3/maintenance/downgrade" + body: "*" + }; + } } service Auth { @@ -256,6 +266,14 @@ service Auth { }; } + // AuthStatus displays authentication status. + rpc AuthStatus(AuthStatusRequest) returns (AuthStatusResponse) { + option (google.api.http) = { + post: "/v3/auth/status" + body: "*" + }; + } + // Authenticate processes an authenticate request. rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse) { option (google.api.http) = { @@ -898,6 +916,7 @@ message MemberUpdateResponse{ } message MemberListRequest { + bool linearizable = 1; } message MemberListResponse { @@ -969,6 +988,27 @@ message AlarmResponse { repeated AlarmMember alarms = 2; } +message DowngradeRequest { + enum DowngradeAction { + VALIDATE = 0; + ENABLE = 1; + CANCEL = 2; + } + + // action is the kind of downgrade request to issue. The action may + // VALIDATE the target version, DOWNGRADE the cluster version, + // or CANCEL the current downgrading job. + DowngradeAction action = 1; + // version is the target version to downgrade. + string version = 2; +} + +message DowngradeResponse { + ResponseHeader header = 1; + // version is the current cluster version. + string version = 2; +} + message StatusRequest { } @@ -1000,6 +1040,9 @@ message AuthEnableRequest { message AuthDisableRequest { } +message AuthStatusRequest { +} + message AuthenticateRequest { string name = 1; string password = 2; @@ -1009,6 +1052,7 @@ message AuthUserAddRequest { string name = 1; string password = 2; authpb.UserAddOptions options = 3; + string hashedPassword = 4; } message AuthUserGetRequest { @@ -1023,8 +1067,10 @@ message AuthUserDeleteRequest { message AuthUserChangePasswordRequest { // name is the name of the user whose password is being changed. string name = 1; - // password is the new password for the user. + // password is the new password for the user. Note that this field will be removed in the API layer. string password = 2; + // hashedPassword is the new password for the user. Note that this field will be initialized in the API layer. + string hashedPassword = 3; } message AuthUserGrantRoleRequest { @@ -1079,6 +1125,13 @@ message AuthDisableResponse { ResponseHeader header = 1; } +message AuthStatusResponse { + ResponseHeader header = 1; + bool enabled = 2; + // authRevision is the current revision of auth store + uint64 authRevision = 3; +} + message AuthenticateResponse { ResponseHeader header = 1; // token is an authorized token that can be used in succeeding RPCs diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.pb.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.pb.go new file mode 100644 index 000000000000..cf0d42818068 --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.pb.go @@ -0,0 +1,1454 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: membership.proto + +package membershippb + +import ( + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// RaftAttributes represents the raft related attributes of an etcd member. +type RaftAttributes struct { + // peerURLs is the list of peers in the raft cluster. + PeerUrls []string `protobuf:"bytes,1,rep,name=peer_urls,json=peerUrls,proto3" json:"peer_urls,omitempty"` + // isLearner indicates if the member is raft learner. + IsLearner bool `protobuf:"varint,2,opt,name=is_learner,json=isLearner,proto3" json:"is_learner,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RaftAttributes) Reset() { *m = RaftAttributes{} } +func (m *RaftAttributes) String() string { return proto.CompactTextString(m) } +func (*RaftAttributes) ProtoMessage() {} +func (*RaftAttributes) Descriptor() ([]byte, []int) { + return fileDescriptor_949fe0d019050ef5, []int{0} +} +func (m *RaftAttributes) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RaftAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RaftAttributes.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RaftAttributes) XXX_Merge(src proto.Message) { + xxx_messageInfo_RaftAttributes.Merge(m, src) +} +func (m *RaftAttributes) XXX_Size() int { + return m.Size() +} +func (m *RaftAttributes) XXX_DiscardUnknown() { + xxx_messageInfo_RaftAttributes.DiscardUnknown(m) +} + +var xxx_messageInfo_RaftAttributes proto.InternalMessageInfo + +// Attributes represents all the non-raft related attributes of an etcd member. +type Attributes struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + ClientUrls []string `protobuf:"bytes,2,rep,name=client_urls,json=clientUrls,proto3" json:"client_urls,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Attributes) Reset() { *m = Attributes{} } +func (m *Attributes) String() string { return proto.CompactTextString(m) } +func (*Attributes) ProtoMessage() {} +func (*Attributes) Descriptor() ([]byte, []int) { + return fileDescriptor_949fe0d019050ef5, []int{1} +} +func (m *Attributes) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Attributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Attributes.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Attributes) XXX_Merge(src proto.Message) { + xxx_messageInfo_Attributes.Merge(m, src) +} +func (m *Attributes) XXX_Size() int { + return m.Size() +} +func (m *Attributes) XXX_DiscardUnknown() { + xxx_messageInfo_Attributes.DiscardUnknown(m) +} + +var xxx_messageInfo_Attributes proto.InternalMessageInfo + +type Member struct { + ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + RaftAttributes *RaftAttributes `protobuf:"bytes,2,opt,name=raft_attributes,json=raftAttributes,proto3" json:"raft_attributes,omitempty"` + MemberAttributes *Attributes `protobuf:"bytes,3,opt,name=member_attributes,json=memberAttributes,proto3" json:"member_attributes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Member) Reset() { *m = Member{} } +func (m *Member) String() string { return proto.CompactTextString(m) } +func (*Member) ProtoMessage() {} +func (*Member) Descriptor() ([]byte, []int) { + return fileDescriptor_949fe0d019050ef5, []int{2} +} +func (m *Member) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Member) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Member.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Member) XXX_Merge(src proto.Message) { + xxx_messageInfo_Member.Merge(m, src) +} +func (m *Member) XXX_Size() int { + return m.Size() +} +func (m *Member) XXX_DiscardUnknown() { + xxx_messageInfo_Member.DiscardUnknown(m) +} + +var xxx_messageInfo_Member proto.InternalMessageInfo + +type ClusterVersionSetRequest struct { + Ver string `protobuf:"bytes,1,opt,name=ver,proto3" json:"ver,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClusterVersionSetRequest) Reset() { *m = ClusterVersionSetRequest{} } +func (m *ClusterVersionSetRequest) String() string { return proto.CompactTextString(m) } +func (*ClusterVersionSetRequest) ProtoMessage() {} +func (*ClusterVersionSetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_949fe0d019050ef5, []int{3} +} +func (m *ClusterVersionSetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClusterVersionSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClusterVersionSetRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClusterVersionSetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterVersionSetRequest.Merge(m, src) +} +func (m *ClusterVersionSetRequest) XXX_Size() int { + return m.Size() +} +func (m *ClusterVersionSetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterVersionSetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ClusterVersionSetRequest proto.InternalMessageInfo + +type ClusterMemberAttrSetRequest struct { + Member_ID uint64 `protobuf:"varint,1,opt,name=member_ID,json=memberID,proto3" json:"member_ID,omitempty"` + MemberAttributes *Attributes `protobuf:"bytes,2,opt,name=member_attributes,json=memberAttributes,proto3" json:"member_attributes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClusterMemberAttrSetRequest) Reset() { *m = ClusterMemberAttrSetRequest{} } +func (m *ClusterMemberAttrSetRequest) String() string { return proto.CompactTextString(m) } +func (*ClusterMemberAttrSetRequest) ProtoMessage() {} +func (*ClusterMemberAttrSetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_949fe0d019050ef5, []int{4} +} +func (m *ClusterMemberAttrSetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClusterMemberAttrSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClusterMemberAttrSetRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClusterMemberAttrSetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterMemberAttrSetRequest.Merge(m, src) +} +func (m *ClusterMemberAttrSetRequest) XXX_Size() int { + return m.Size() +} +func (m *ClusterMemberAttrSetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterMemberAttrSetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ClusterMemberAttrSetRequest proto.InternalMessageInfo + +type DowngradeInfoSetRequest struct { + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + Ver string `protobuf:"bytes,2,opt,name=ver,proto3" json:"ver,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DowngradeInfoSetRequest) Reset() { *m = DowngradeInfoSetRequest{} } +func (m *DowngradeInfoSetRequest) String() string { return proto.CompactTextString(m) } +func (*DowngradeInfoSetRequest) ProtoMessage() {} +func (*DowngradeInfoSetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_949fe0d019050ef5, []int{5} +} +func (m *DowngradeInfoSetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DowngradeInfoSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DowngradeInfoSetRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DowngradeInfoSetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DowngradeInfoSetRequest.Merge(m, src) +} +func (m *DowngradeInfoSetRequest) XXX_Size() int { + return m.Size() +} +func (m *DowngradeInfoSetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DowngradeInfoSetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DowngradeInfoSetRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*RaftAttributes)(nil), "membershippb.RaftAttributes") + proto.RegisterType((*Attributes)(nil), "membershippb.Attributes") + proto.RegisterType((*Member)(nil), "membershippb.Member") + proto.RegisterType((*ClusterVersionSetRequest)(nil), "membershippb.ClusterVersionSetRequest") + proto.RegisterType((*ClusterMemberAttrSetRequest)(nil), "membershippb.ClusterMemberAttrSetRequest") + proto.RegisterType((*DowngradeInfoSetRequest)(nil), "membershippb.DowngradeInfoSetRequest") +} + +func init() { proto.RegisterFile("membership.proto", fileDescriptor_949fe0d019050ef5) } + +var fileDescriptor_949fe0d019050ef5 = []byte{ + // 367 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x4e, 0xf2, 0x40, + 0x14, 0x85, 0x99, 0x42, 0xf8, 0xdb, 0xcb, 0x1f, 0xc4, 0x09, 0x89, 0x8d, 0x68, 0x25, 0x5d, 0xb1, + 0x30, 0x98, 0xe8, 0x13, 0xa0, 0xb0, 0x20, 0x81, 0xcd, 0x18, 0xdd, 0x92, 0x56, 0x2e, 0xd8, 0xa4, + 0x74, 0xea, 0xcc, 0x54, 0xd7, 0xbe, 0x85, 0x4f, 0xe0, 0xb3, 0xb0, 0xf4, 0x11, 0x14, 0x5f, 0xc4, + 0x74, 0x5a, 0x4a, 0x49, 0xdc, 0xb8, 0xbb, 0x3d, 0xbd, 0xf7, 0x9c, 0xf3, 0x35, 0x85, 0xd6, 0x0a, + 0x57, 0x3e, 0x0a, 0xf9, 0x18, 0xc4, 0xfd, 0x58, 0x70, 0xc5, 0xe9, 0xff, 0x9d, 0x12, 0xfb, 0xc7, + 0xed, 0x25, 0x5f, 0x72, 0xfd, 0xe2, 0x22, 0x9d, 0xb2, 0x1d, 0x77, 0x02, 0x4d, 0xe6, 0x2d, 0xd4, + 0x40, 0x29, 0x11, 0xf8, 0x89, 0x42, 0x49, 0x3b, 0x60, 0xc5, 0x88, 0x62, 0x96, 0x88, 0x50, 0xda, + 0xa4, 0x5b, 0xed, 0x59, 0xcc, 0x4c, 0x85, 0x3b, 0x11, 0x4a, 0x7a, 0x0a, 0x10, 0xc8, 0x59, 0x88, + 0x9e, 0x88, 0x50, 0xd8, 0x46, 0x97, 0xf4, 0x4c, 0x66, 0x05, 0x72, 0x92, 0x09, 0xee, 0x00, 0xa0, + 0xe4, 0x44, 0xa1, 0x16, 0x79, 0x2b, 0xb4, 0x49, 0x97, 0xf4, 0x2c, 0xa6, 0x67, 0x7a, 0x06, 0x8d, + 0x87, 0x30, 0xc0, 0x48, 0x65, 0xfe, 0x86, 0xf6, 0x87, 0x4c, 0x4a, 0x13, 0xdc, 0x77, 0x02, 0xf5, + 0xa9, 0xee, 0x4d, 0x9b, 0x60, 0x8c, 0x87, 0xfa, 0xba, 0xc6, 0x8c, 0xf1, 0x90, 0x8e, 0xe0, 0x40, + 0x78, 0x0b, 0x35, 0xf3, 0x8a, 0x08, 0xdd, 0xa0, 0x71, 0x79, 0xd2, 0x2f, 0x93, 0xf6, 0xf7, 0x81, + 0x58, 0x53, 0xec, 0x03, 0x8e, 0xe0, 0x30, 0x5b, 0x2f, 0x1b, 0x55, 0xb5, 0x91, 0xbd, 0x6f, 0x54, + 0x32, 0xc9, 0xbf, 0xee, 0x4e, 0x71, 0xcf, 0xc1, 0xbe, 0x09, 0x13, 0xa9, 0x50, 0xdc, 0xa3, 0x90, + 0x01, 0x8f, 0x6e, 0x51, 0x31, 0x7c, 0x4a, 0x50, 0x2a, 0xda, 0x82, 0xea, 0x33, 0x8a, 0x1c, 0x3c, + 0x1d, 0xdd, 0x57, 0x02, 0x9d, 0x7c, 0x7d, 0x5a, 0x38, 0x95, 0x2e, 0x3a, 0x60, 0xe5, 0xa5, 0x0a, + 0x64, 0x33, 0x13, 0x34, 0xf8, 0x2f, 0x8d, 0x8d, 0x3f, 0x37, 0x1e, 0xc1, 0xd1, 0x90, 0xbf, 0x44, + 0x4b, 0xe1, 0xcd, 0x71, 0x1c, 0x2d, 0x78, 0x29, 0xde, 0x86, 0x7f, 0x18, 0x79, 0x7e, 0x88, 0x73, + 0x1d, 0x6e, 0xb2, 0xed, 0xe3, 0x16, 0xc5, 0x28, 0x50, 0xae, 0xdb, 0xeb, 0x2f, 0xa7, 0xb2, 0xde, + 0x38, 0xe4, 0x63, 0xe3, 0x90, 0xcf, 0x8d, 0x43, 0xde, 0xbe, 0x9d, 0x8a, 0x5f, 0xd7, 0xff, 0xd3, + 0xd5, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x93, 0x7d, 0x0b, 0x87, 0x02, 0x00, 0x00, +} + +func (m *RaftAttributes) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RaftAttributes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RaftAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.IsLearner { + i-- + if m.IsLearner { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.PeerUrls) > 0 { + for iNdEx := len(m.PeerUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PeerUrls[iNdEx]) + copy(dAtA[i:], m.PeerUrls[iNdEx]) + i = encodeVarintMembership(dAtA, i, uint64(len(m.PeerUrls[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Attributes) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Attributes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Attributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ClientUrls) > 0 { + for iNdEx := len(m.ClientUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ClientUrls[iNdEx]) + copy(dAtA[i:], m.ClientUrls[iNdEx]) + i = encodeVarintMembership(dAtA, i, uint64(len(m.ClientUrls[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMembership(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Member) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Member) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Member) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.MemberAttributes != nil { + { + size, err := m.MemberAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMembership(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.RaftAttributes != nil { + { + size, err := m.RaftAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMembership(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ID != 0 { + i = encodeVarintMembership(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ClusterVersionSetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClusterVersionSetRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterVersionSetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Ver) > 0 { + i -= len(m.Ver) + copy(dAtA[i:], m.Ver) + i = encodeVarintMembership(dAtA, i, uint64(len(m.Ver))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ClusterMemberAttrSetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClusterMemberAttrSetRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterMemberAttrSetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.MemberAttributes != nil { + { + size, err := m.MemberAttributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMembership(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Member_ID != 0 { + i = encodeVarintMembership(dAtA, i, uint64(m.Member_ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DowngradeInfoSetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DowngradeInfoSetRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DowngradeInfoSetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Ver) > 0 { + i -= len(m.Ver) + copy(dAtA[i:], m.Ver) + i = encodeVarintMembership(dAtA, i, uint64(len(m.Ver))) + i-- + dAtA[i] = 0x12 + } + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintMembership(dAtA []byte, offset int, v uint64) int { + offset -= sovMembership(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RaftAttributes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PeerUrls) > 0 { + for _, s := range m.PeerUrls { + l = len(s) + n += 1 + l + sovMembership(uint64(l)) + } + } + if m.IsLearner { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Attributes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMembership(uint64(l)) + } + if len(m.ClientUrls) > 0 { + for _, s := range m.ClientUrls { + l = len(s) + n += 1 + l + sovMembership(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Member) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != 0 { + n += 1 + sovMembership(uint64(m.ID)) + } + if m.RaftAttributes != nil { + l = m.RaftAttributes.Size() + n += 1 + l + sovMembership(uint64(l)) + } + if m.MemberAttributes != nil { + l = m.MemberAttributes.Size() + n += 1 + l + sovMembership(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ClusterVersionSetRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Ver) + if l > 0 { + n += 1 + l + sovMembership(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ClusterMemberAttrSetRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Member_ID != 0 { + n += 1 + sovMembership(uint64(m.Member_ID)) + } + if m.MemberAttributes != nil { + l = m.MemberAttributes.Size() + n += 1 + l + sovMembership(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DowngradeInfoSetRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Enabled { + n += 2 + } + l = len(m.Ver) + if l > 0 { + n += 1 + l + sovMembership(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovMembership(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMembership(x uint64) (n int) { + return sovMembership(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RaftAttributes) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RaftAttributes: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RaftAttributes: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMembership + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerUrls = append(m.PeerUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsLearner = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Attributes) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Attributes: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Attributes: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMembership + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMembership + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientUrls = append(m.ClientUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Member) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Member: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Member: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMembership + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RaftAttributes == nil { + m.RaftAttributes = &RaftAttributes{} + } + if err := m.RaftAttributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMembership + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MemberAttributes == nil { + m.MemberAttributes = &Attributes{} + } + if err := m.MemberAttributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterVersionSetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterVersionSetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterVersionSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMembership + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterMemberAttrSetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterMemberAttrSetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterMemberAttrSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Member_ID", wireType) + } + m.Member_ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Member_ID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMembership + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MemberAttributes == nil { + m.MemberAttributes = &Attributes{} + } + if err := m.MemberAttributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DowngradeInfoSetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DowngradeInfoSetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DowngradeInfoSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMembership + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMembership(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMembership + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMembership + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMembership + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMembership + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMembership + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMembership + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMembership = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMembership = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMembership = fmt.Errorf("proto: unexpected end of group") +) diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.proto b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.proto new file mode 100644 index 000000000000..e63e9ecc994e --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package membershippb; + +import "gogoproto/gogo.proto"; + +option (gogoproto.marshaler_all) = true; +option (gogoproto.sizer_all) = true; +option (gogoproto.unmarshaler_all) = true; +option (gogoproto.goproto_getters_all) = false; + +// RaftAttributes represents the raft related attributes of an etcd member. +message RaftAttributes { + // peerURLs is the list of peers in the raft cluster. + repeated string peer_urls = 1; + // isLearner indicates if the member is raft learner. + bool is_learner = 2; +} + +// Attributes represents all the non-raft related attributes of an etcd member. +message Attributes { + string name = 1; + repeated string client_urls = 2; +} + +message Member { + uint64 ID = 1; + RaftAttributes raft_attributes = 2; + Attributes member_attributes = 3; +} + +message ClusterVersionSetRequest { + string ver = 1; +} + +message ClusterMemberAttrSetRequest { + uint64 member_ID = 1; + Attributes member_attributes = 2; +} + +message DowngradeInfoSetRequest { + bool enabled = 1; + string ver = 2; +} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/mvcc/mvccpb/kv.pb.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.pb.go similarity index 73% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/mvcc/mvccpb/kv.pb.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.pb.go index 23fe337a59bf..fc258d6c206d 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/mvcc/mvccpb/kv.pb.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.pb.go @@ -1,28 +1,16 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: kv.proto -/* - Package mvccpb is a generated protocol buffer package. - - It is generated from these files: - kv.proto - - It has these top-level messages: - KeyValue - Event -*/ package mvccpb import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - + fmt "fmt" + io "io" math "math" + math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" - - io "io" + proto "github.com/golang/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. @@ -34,7 +22,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type Event_EventType int32 @@ -47,6 +35,7 @@ var Event_EventType_name = map[int32]string{ 0: "PUT", 1: "DELETE", } + var Event_EventType_value = map[string]int32{ "PUT": 0, "DELETE": 1, @@ -55,7 +44,10 @@ var Event_EventType_value = map[string]int32{ func (x Event_EventType) String() string { return proto.EnumName(Event_EventType_name, int32(x)) } -func (Event_EventType) EnumDescriptor() ([]byte, []int) { return fileDescriptorKv, []int{1, 0} } + +func (Event_EventType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2216fe83c9c12408, []int{1, 0} +} type KeyValue struct { // key is the key in bytes. An empty key is not allowed. @@ -73,13 +65,44 @@ type KeyValue struct { // lease is the ID of the lease that attached to key. // When the attached lease expires, the key will be deleted. // If lease is 0, then no lease is attached to the key. - Lease int64 `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"` + Lease int64 `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KeyValue) Reset() { *m = KeyValue{} } +func (m *KeyValue) String() string { return proto.CompactTextString(m) } +func (*KeyValue) ProtoMessage() {} +func (*KeyValue) Descriptor() ([]byte, []int) { + return fileDescriptor_2216fe83c9c12408, []int{0} +} +func (m *KeyValue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *KeyValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_KeyValue.Merge(m, src) +} +func (m *KeyValue) XXX_Size() int { + return m.Size() +} +func (m *KeyValue) XXX_DiscardUnknown() { + xxx_messageInfo_KeyValue.DiscardUnknown(m) } -func (m *KeyValue) Reset() { *m = KeyValue{} } -func (m *KeyValue) String() string { return proto.CompactTextString(m) } -func (*KeyValue) ProtoMessage() {} -func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptorKv, []int{0} } +var xxx_messageInfo_KeyValue proto.InternalMessageInfo type Event struct { // type is the kind of event. If type is a PUT, it indicates @@ -91,25 +114,82 @@ type Event struct { // A PUT event with kv.Version=1 indicates the creation of a key. // A DELETE/EXPIRE event contains the deleted key with // its modification revision set to the revision of deletion. - Kv *KeyValue `protobuf:"bytes,2,opt,name=kv" json:"kv,omitempty"` + Kv *KeyValue `protobuf:"bytes,2,opt,name=kv,proto3" json:"kv,omitempty"` // prev_kv holds the key-value pair before the event happens. - PrevKv *KeyValue `protobuf:"bytes,3,opt,name=prev_kv,json=prevKv" json:"prev_kv,omitempty"` + PrevKv *KeyValue `protobuf:"bytes,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorKv, []int{1} } +func (m *Event) Reset() { *m = Event{} } +func (m *Event) String() string { return proto.CompactTextString(m) } +func (*Event) ProtoMessage() {} +func (*Event) Descriptor() ([]byte, []int) { + return fileDescriptor_2216fe83c9c12408, []int{1} +} +func (m *Event) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Event.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Event) XXX_Merge(src proto.Message) { + xxx_messageInfo_Event.Merge(m, src) +} +func (m *Event) XXX_Size() int { + return m.Size() +} +func (m *Event) XXX_DiscardUnknown() { + xxx_messageInfo_Event.DiscardUnknown(m) +} + +var xxx_messageInfo_Event proto.InternalMessageInfo func init() { + proto.RegisterEnum("mvccpb.Event_EventType", Event_EventType_name, Event_EventType_value) proto.RegisterType((*KeyValue)(nil), "mvccpb.KeyValue") proto.RegisterType((*Event)(nil), "mvccpb.Event") - proto.RegisterEnum("mvccpb.Event_EventType", Event_EventType_name, Event_EventType_value) } + +func init() { proto.RegisterFile("kv.proto", fileDescriptor_2216fe83c9c12408) } + +var fileDescriptor_2216fe83c9c12408 = []byte{ + // 303 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x41, 0x4e, 0xc2, 0x40, + 0x14, 0x86, 0x3b, 0x14, 0x0a, 0x3e, 0x08, 0x36, 0x13, 0x12, 0x27, 0x2e, 0x26, 0x95, 0x8d, 0x18, + 0x13, 0x4c, 0xf0, 0x06, 0xc6, 0xae, 0x70, 0x61, 0x1a, 0x74, 0x4b, 0x4a, 0x79, 0x21, 0xa4, 0x94, + 0x69, 0x4a, 0x9d, 0xa4, 0x37, 0x71, 0xef, 0xde, 0x73, 0xb0, 0xe4, 0x08, 0x52, 0x2f, 0x62, 0xfa, + 0xc6, 0xe2, 0xc6, 0xcd, 0xe4, 0xfd, 0xff, 0xff, 0x65, 0xe6, 0x7f, 0x03, 0x9d, 0x58, 0x8f, 0xd3, + 0x4c, 0xe5, 0x8a, 0x3b, 0x89, 0x8e, 0xa2, 0x74, 0x71, 0x39, 0x58, 0xa9, 0x95, 0x22, 0xeb, 0xae, + 0x9a, 0x4c, 0x3a, 0xfc, 0x64, 0xd0, 0x99, 0x62, 0xf1, 0x1a, 0x6e, 0xde, 0x90, 0xbb, 0x60, 0xc7, + 0x58, 0x08, 0xe6, 0xb1, 0x51, 0x2f, 0xa8, 0x46, 0x7e, 0x0d, 0xe7, 0x51, 0x86, 0x61, 0x8e, 0xf3, + 0x0c, 0xf5, 0x7a, 0xb7, 0x56, 0x5b, 0xd1, 0xf0, 0xd8, 0xc8, 0x0e, 0xfa, 0xc6, 0x0e, 0x7e, 0x5d, + 0x7e, 0x05, 0xbd, 0x44, 0x2d, 0xff, 0x28, 0x9b, 0xa8, 0x6e, 0xa2, 0x96, 0x27, 0x44, 0x40, 0x5b, + 0x63, 0x46, 0x69, 0x93, 0xd2, 0x5a, 0xf2, 0x01, 0xb4, 0x74, 0x55, 0x40, 0xb4, 0xe8, 0x65, 0x23, + 0x2a, 0x77, 0x83, 0xe1, 0x0e, 0x85, 0x43, 0xb4, 0x11, 0xc3, 0x0f, 0x06, 0x2d, 0x5f, 0xe3, 0x36, + 0xe7, 0xb7, 0xd0, 0xcc, 0x8b, 0x14, 0xa9, 0x6e, 0x7f, 0x72, 0x31, 0x36, 0x7b, 0x8e, 0x29, 0x34, + 0xe7, 0xac, 0x48, 0x31, 0x20, 0x88, 0x7b, 0xd0, 0x88, 0x35, 0x75, 0xef, 0x4e, 0xdc, 0x1a, 0xad, + 0x17, 0x0f, 0x1a, 0xb1, 0xe6, 0x37, 0xd0, 0x4e, 0x33, 0xd4, 0xf3, 0x58, 0x53, 0xf9, 0xff, 0x30, + 0xa7, 0x02, 0xa6, 0x7a, 0xe8, 0xc1, 0xd9, 0xe9, 0x7e, 0xde, 0x06, 0xfb, 0xf9, 0x65, 0xe6, 0x5a, + 0x1c, 0xc0, 0x79, 0xf4, 0x9f, 0xfc, 0x99, 0xef, 0xb2, 0x07, 0xb1, 0x3f, 0x4a, 0xeb, 0x70, 0x94, + 0xd6, 0xbe, 0x94, 0xec, 0x50, 0x4a, 0xf6, 0x55, 0x4a, 0xf6, 0xfe, 0x2d, 0xad, 0x85, 0x43, 0xff, + 0x7e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x45, 0x92, 0x5d, 0xa1, 0x01, 0x00, 0x00, +} + func (m *KeyValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -117,49 +197,60 @@ func (m *KeyValue) Marshal() (dAtA []byte, err error) { } func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintKv(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.CreateRevision != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.CreateRevision)) + if m.Lease != 0 { + i = encodeVarintKv(dAtA, i, uint64(m.Lease)) + i-- + dAtA[i] = 0x30 } - if m.ModRevision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.ModRevision)) + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintKv(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x2a } if m.Version != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintKv(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x20 } - if len(m.Value) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintKv(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + if m.ModRevision != 0 { + i = encodeVarintKv(dAtA, i, uint64(m.ModRevision)) + i-- + dAtA[i] = 0x18 } - if m.Lease != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.Lease)) + if m.CreateRevision != 0 { + i = encodeVarintKv(dAtA, i, uint64(m.CreateRevision)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintKv(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Event) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -167,48 +258,66 @@ func (m *Event) Marshal() (dAtA []byte, err error) { } func (m *Event) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.Type)) - } - if m.Kv != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.Kv.Size())) - n1, err := m.Kv.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.PrevKv != nil { + { + size, err := m.PrevKv.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintKv(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintKv(dAtA, i, uint64(m.PrevKv.Size())) - n2, err := m.PrevKv.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.Kv != nil { + { + size, err := m.Kv.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintKv(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Type != 0 { + i = encodeVarintKv(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintKv(dAtA []byte, offset int, v uint64) int { + offset -= sovKv(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *KeyValue) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Key) @@ -231,10 +340,16 @@ func (m *KeyValue) Size() (n int) { if m.Lease != 0 { n += 1 + sovKv(uint64(m.Lease)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Event) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Type != 0 { @@ -248,18 +363,14 @@ func (m *Event) Size() (n int) { l = m.PrevKv.Size() n += 1 + l + sovKv(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func sovKv(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozKv(x uint64) (n int) { return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -279,7 +390,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -307,7 +418,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -316,6 +427,9 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { return ErrInvalidLengthKv } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKv + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -338,7 +452,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CreateRevision |= (int64(b) & 0x7F) << shift + m.CreateRevision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -357,7 +471,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ModRevision |= (int64(b) & 0x7F) << shift + m.ModRevision |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -376,7 +490,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Version |= (int64(b) & 0x7F) << shift + m.Version |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -395,7 +509,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -404,6 +518,9 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { return ErrInvalidLengthKv } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKv + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -426,7 +543,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Lease |= (int64(b) & 0x7F) << shift + m.Lease |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -437,12 +554,13 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthKv } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -467,7 +585,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -495,7 +613,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Type |= (Event_EventType(b) & 0x7F) << shift + m.Type |= Event_EventType(b&0x7F) << shift if b < 0x80 { break } @@ -514,7 +632,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -523,6 +641,9 @@ func (m *Event) Unmarshal(dAtA []byte) error { return ErrInvalidLengthKv } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthKv + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -547,7 +668,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -556,6 +677,9 @@ func (m *Event) Unmarshal(dAtA []byte) error { return ErrInvalidLengthKv } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthKv + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -572,12 +696,13 @@ func (m *Event) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthKv } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -590,6 +715,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { func skipKv(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -621,10 +747,8 @@ func skipKv(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -641,78 +765,34 @@ func skipKv(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthKv } - return iNdEx, nil + iNdEx += length case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKv - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipKv(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupKv + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthKv + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupKv = fmt.Errorf("proto: unexpected end of group") ) - -func init() { proto.RegisterFile("kv.proto", fileDescriptorKv) } - -var fileDescriptorKv = []byte{ - // 303 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x41, 0x4e, 0xc2, 0x40, - 0x14, 0x86, 0x3b, 0x14, 0x0a, 0x3e, 0x08, 0x36, 0x13, 0x12, 0x27, 0x2e, 0x26, 0x95, 0x8d, 0x18, - 0x13, 0x4c, 0xf0, 0x06, 0xc6, 0xae, 0x70, 0x61, 0x1a, 0x74, 0x4b, 0x4a, 0x79, 0x21, 0xa4, 0x94, - 0x69, 0x4a, 0x9d, 0xa4, 0x37, 0x71, 0xef, 0xde, 0x73, 0xb0, 0xe4, 0x08, 0x52, 0x2f, 0x62, 0xfa, - 0xc6, 0xe2, 0xc6, 0xcd, 0xe4, 0xfd, 0xff, 0xff, 0x65, 0xe6, 0x7f, 0x03, 0x9d, 0x58, 0x8f, 0xd3, - 0x4c, 0xe5, 0x8a, 0x3b, 0x89, 0x8e, 0xa2, 0x74, 0x71, 0x39, 0x58, 0xa9, 0x95, 0x22, 0xeb, 0xae, - 0x9a, 0x4c, 0x3a, 0xfc, 0x64, 0xd0, 0x99, 0x62, 0xf1, 0x1a, 0x6e, 0xde, 0x90, 0xbb, 0x60, 0xc7, - 0x58, 0x08, 0xe6, 0xb1, 0x51, 0x2f, 0xa8, 0x46, 0x7e, 0x0d, 0xe7, 0x51, 0x86, 0x61, 0x8e, 0xf3, - 0x0c, 0xf5, 0x7a, 0xb7, 0x56, 0x5b, 0xd1, 0xf0, 0xd8, 0xc8, 0x0e, 0xfa, 0xc6, 0x0e, 0x7e, 0x5d, - 0x7e, 0x05, 0xbd, 0x44, 0x2d, 0xff, 0x28, 0x9b, 0xa8, 0x6e, 0xa2, 0x96, 0x27, 0x44, 0x40, 0x5b, - 0x63, 0x46, 0x69, 0x93, 0xd2, 0x5a, 0xf2, 0x01, 0xb4, 0x74, 0x55, 0x40, 0xb4, 0xe8, 0x65, 0x23, - 0x2a, 0x77, 0x83, 0xe1, 0x0e, 0x85, 0x43, 0xb4, 0x11, 0xc3, 0x0f, 0x06, 0x2d, 0x5f, 0xe3, 0x36, - 0xe7, 0xb7, 0xd0, 0xcc, 0x8b, 0x14, 0xa9, 0x6e, 0x7f, 0x72, 0x31, 0x36, 0x7b, 0x8e, 0x29, 0x34, - 0xe7, 0xac, 0x48, 0x31, 0x20, 0x88, 0x7b, 0xd0, 0x88, 0x35, 0x75, 0xef, 0x4e, 0xdc, 0x1a, 0xad, - 0x17, 0x0f, 0x1a, 0xb1, 0xe6, 0x37, 0xd0, 0x4e, 0x33, 0xd4, 0xf3, 0x58, 0x53, 0xf9, 0xff, 0x30, - 0xa7, 0x02, 0xa6, 0x7a, 0xe8, 0xc1, 0xd9, 0xe9, 0x7e, 0xde, 0x06, 0xfb, 0xf9, 0x65, 0xe6, 0x5a, - 0x1c, 0xc0, 0x79, 0xf4, 0x9f, 0xfc, 0x99, 0xef, 0xb2, 0x07, 0xb1, 0x3f, 0x4a, 0xeb, 0x70, 0x94, - 0xd6, 0xbe, 0x94, 0xec, 0x50, 0x4a, 0xf6, 0x55, 0x4a, 0xf6, 0xfe, 0x2d, 0xad, 0x85, 0x43, 0xff, - 0x7e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x45, 0x92, 0x5d, 0xa1, 0x01, 0x00, 0x00, -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/mvcc/mvccpb/kv.proto b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.proto similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/mvcc/mvccpb/kv.proto rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.proto diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes/doc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/doc.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes/doc.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/doc.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes/error.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/error.go similarity index 87% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes/error.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/error.go index e6a281460d52..5ea2cf88dd76 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes/error.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/error.go @@ -35,6 +35,8 @@ var ( ErrGRPCLeaseExist = status.New(codes.FailedPrecondition, "etcdserver: lease already exists").Err() ErrGRPCLeaseTTLTooLarge = status.New(codes.OutOfRange, "etcdserver: too large lease TTL").Err() + ErrGRPCWatchCanceled = status.New(codes.Canceled, "etcdserver: watch canceled").Err() + ErrGRPCMemberExist = status.New(codes.FailedPrecondition, "etcdserver: member ID already exist").Err() ErrGRPCPeerURLExist = status.New(codes.FailedPrecondition, "etcdserver: Peer URLs already exists").Err() ErrGRPCMemberNotEnoughStarted = status.New(codes.FailedPrecondition, "etcdserver: re-configuration failed due to not enough started members").Err() @@ -56,6 +58,7 @@ var ( ErrGRPCRoleNotFound = status.New(codes.FailedPrecondition, "etcdserver: role name not found").Err() ErrGRPCRoleEmpty = status.New(codes.InvalidArgument, "etcdserver: role name is empty").Err() ErrGRPCAuthFailed = status.New(codes.InvalidArgument, "etcdserver: authentication failed, invalid user ID or password").Err() + ErrGRPCPermissionNotGiven = status.New(codes.InvalidArgument, "etcdserver: permission not given").Err() ErrGRPCPermissionDenied = status.New(codes.PermissionDenied, "etcdserver: permission denied").Err() ErrGRPCRoleNotGranted = status.New(codes.FailedPrecondition, "etcdserver: role is not granted to the user").Err() ErrGRPCPermissionNotGranted = status.New(codes.FailedPrecondition, "etcdserver: permission is not granted to the role").Err() @@ -76,6 +79,15 @@ var ( ErrGPRCNotSupportedForLearner = status.New(codes.Unavailable, "etcdserver: rpc not supported for learner").Err() ErrGRPCBadLeaderTransferee = status.New(codes.FailedPrecondition, "etcdserver: bad leader transferee").Err() + ErrGRPCClusterVersionUnavailable = status.New(codes.Unavailable, "etcdserver: cluster version not found during downgrade").Err() + ErrGRPCWrongDowngradeVersionFormat = status.New(codes.InvalidArgument, "etcdserver: wrong downgrade target version format").Err() + ErrGRPCInvalidDowngradeTargetVersion = status.New(codes.InvalidArgument, "etcdserver: invalid downgrade target version").Err() + ErrGRPCDowngradeInProcess = status.New(codes.FailedPrecondition, "etcdserver: cluster has a downgrade job in progress").Err() + ErrGRPCNoInflightDowngrade = status.New(codes.FailedPrecondition, "etcdserver: no inflight downgrade job").Err() + + ErrGRPCCanceled = status.New(codes.Canceled, "etcdserver: request canceled").Err() + ErrGRPCDeadlineExceeded = status.New(codes.DeadlineExceeded, "etcdserver: context deadline exceeded").Err() + errStringToError = map[string]error{ ErrorDesc(ErrGRPCEmptyKey): ErrGRPCEmptyKey, ErrorDesc(ErrGRPCKeyNotFound): ErrGRPCKeyNotFound, @@ -132,6 +144,12 @@ var ( ErrorDesc(ErrGRPCCorrupt): ErrGRPCCorrupt, ErrorDesc(ErrGPRCNotSupportedForLearner): ErrGPRCNotSupportedForLearner, ErrorDesc(ErrGRPCBadLeaderTransferee): ErrGRPCBadLeaderTransferee, + + ErrorDesc(ErrGRPCClusterVersionUnavailable): ErrGRPCClusterVersionUnavailable, + ErrorDesc(ErrGRPCWrongDowngradeVersionFormat): ErrGRPCWrongDowngradeVersionFormat, + ErrorDesc(ErrGRPCInvalidDowngradeTargetVersion): ErrGRPCInvalidDowngradeTargetVersion, + ErrorDesc(ErrGRPCDowngradeInProcess): ErrGRPCDowngradeInProcess, + ErrorDesc(ErrGRPCNoInflightDowngrade): ErrGRPCNoInflightDowngrade, } ) @@ -190,6 +208,12 @@ var ( ErrUnhealthy = Error(ErrGRPCUnhealthy) ErrCorrupt = Error(ErrGRPCCorrupt) ErrBadLeaderTransferee = Error(ErrGRPCBadLeaderTransferee) + + ErrClusterVersionUnavailable = Error(ErrGRPCClusterVersionUnavailable) + ErrWrongDowngradeVersionFormat = Error(ErrGRPCWrongDowngradeVersionFormat) + ErrInvalidDowngradeTargetVersion = Error(ErrGRPCInvalidDowngradeTargetVersion) + ErrDowngradeInProcess = Error(ErrGRPCDowngradeInProcess) + ErrNoInflightDowngrade = Error(ErrGRPCNoInflightDowngrade) ) // EtcdError defines gRPC server errors. diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes/md.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/md.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes/md.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/md.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes/metadatafields.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/metadatafields.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes/metadatafields.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/metadatafields.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/version/version.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/version/version.go similarity index 98% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/version/version.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/version/version.go index ee97e461e7fa..95b62fd8b2ff 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/version/version.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/api/v3/version/version.go @@ -26,7 +26,7 @@ import ( var ( // MinClusterVersion is the min cluster version this etcd binary is compatible with. MinClusterVersion = "3.0.0" - Version = "3.4.13" + Version = "3.5.0" APIVersion = "unknown" // Git SHA Value will be set during build diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/LICENSE b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE similarity index 99% rename from cluster-autoscaler/vendor/github.com/coreos/pkg/LICENSE rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE index e06d2081865a..d64569567334 100644 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/LICENSE +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE @@ -1,4 +1,5 @@ -Apache License + + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -178,7 +179,7 @@ Apache License APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" + boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -186,7 +187,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -199,4 +200,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/dir_unix.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_unix.go similarity index 97% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/dir_unix.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_unix.go index 4ce15dc6bcf1..ca82f765c990 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/dir_unix.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_unix.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package fileutil diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/dir_windows.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_windows.go similarity index 98% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/dir_windows.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_windows.go index a10a90583c79..849c63c8769c 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/dir_windows.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_windows.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package fileutil diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/doc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/doc.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/doc.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/doc.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/fileutil.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/fileutil.go similarity index 71% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/fileutil.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/fileutil.go index f36136182b9e..e442c3c92e83 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/fileutil.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/fileutil.go @@ -21,7 +21,7 @@ import ( "os" "path/filepath" - "github.com/coreos/pkg/capnslog" + "go.uber.org/zap" ) const ( @@ -29,12 +29,13 @@ const ( PrivateFileMode = 0600 ) -var plog = capnslog.NewPackageLogger("go.etcd.io/etcd", "pkg/fileutil") - // IsDirWriteable checks if dir is writable by writing and removing a file // to dir. It returns nil if dir is writable. func IsDirWriteable(dir string) error { - f := filepath.Join(dir, ".touch") + f, err := filepath.Abs(filepath.Join(dir, ".touch")) + if err != nil { + return err + } if err := ioutil.WriteFile(f, []byte(""), PrivateFileMode); err != nil { return err } @@ -49,7 +50,11 @@ func TouchDirAll(dir string) error { if Exist(dir) { err := CheckDirPermission(dir, PrivateDirMode) if err != nil { - plog.Warningf("check file permission: %v", err) + lg, _ := zap.NewProduction() + if lg == nil { + lg = zap.NewExample() + } + lg.Warn("check file permission", zap.Error(err)) } } else { err := os.MkdirAll(dir, PrivateDirMode) @@ -86,6 +91,12 @@ func Exist(name string) bool { return err == nil } +// DirEmpty returns true if a directory empty and can access. +func DirEmpty(name string) bool { + ns, err := ReadDir(name) + return len(ns) == 0 && err == nil +} + // ZeroToEnd zeros a file starting from SEEK_CUR to its SEEK_END. May temporarily // shorten the length of the file. func ZeroToEnd(f *os.File) error { @@ -113,7 +124,7 @@ func ZeroToEnd(f *os.File) error { // Returns error if dir is empty or exist with a different permission than specified. func CheckDirPermission(dir string, perm os.FileMode) error { if !Exist(dir) { - return fmt.Errorf("directory %q empty, cannot check permission.", dir) + return fmt.Errorf("directory %q empty, cannot check permission", dir) } //check the existing permission on the directory dirInfo, err := os.Stat(dir) @@ -122,8 +133,40 @@ func CheckDirPermission(dir string, perm os.FileMode) error { } dirMode := dirInfo.Mode().Perm() if dirMode != perm { - err = fmt.Errorf("directory %q exist, but the permission is %q. The recommended permission is %q to prevent possible unprivileged access to the data.", dir, dirInfo.Mode(), os.FileMode(PrivateDirMode)) + err = fmt.Errorf("directory %q exist, but the permission is %q. The recommended permission is %q to prevent possible unprivileged access to the data", dir, dirInfo.Mode(), os.FileMode(PrivateDirMode)) + return err + } + return nil +} + +// RemoveMatchFile deletes file if matchFunc is true on an existing dir +// Returns error if the dir does not exist or remove file fail +func RemoveMatchFile(lg *zap.Logger, dir string, matchFunc func(fileName string) bool) error { + if lg == nil { + lg = zap.NewNop() + } + if !Exist(dir) { + return fmt.Errorf("directory %s does not exist", dir) + } + fileNames, err := ReadDir(dir) + if err != nil { return err } + var removeFailedFiles []string + for _, fileName := range fileNames { + if matchFunc(fileName) { + file := filepath.Join(dir, fileName) + if err = os.Remove(file); err != nil { + removeFailedFiles = append(removeFailedFiles, fileName) + lg.Error("remove file failed", + zap.String("file", file), + zap.Error(err)) + continue + } + } + } + if len(removeFailedFiles) != 0 { + return fmt.Errorf("remove file(s) %v error", removeFailedFiles) + } return nil } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_flock.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_flock.go similarity index 96% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_flock.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_flock.go index 542550bc8a96..dcdf226cdbfd 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_flock.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_flock.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows && !plan9 && !solaris // +build !windows,!plan9,!solaris package fileutil diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_linux.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_linux.go similarity index 87% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_linux.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_linux.go index b0abc98eeb00..d8952cc481b0 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_linux.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_linux.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package fileutil @@ -21,19 +22,14 @@ import ( "io" "os" "syscall" + + "golang.org/x/sys/unix" ) // This used to call syscall.Flock() but that call fails with EBADF on NFS. // An alternative is lockf() which works on NFS but that call lets a process lock // the same file twice. Instead, use Linux's non-standard open file descriptor // locks which will block if the process already holds the file lock. -// -// constants from /usr/include/bits/fcntl-linux.h -const ( - F_OFD_GETLK = 37 - F_OFD_SETLK = 37 - F_OFD_SETLKW = 38 -) var ( wrlck = syscall.Flock_t{ @@ -50,7 +46,7 @@ var ( func init() { // use open file descriptor locks if the system supports it getlk := syscall.Flock_t{Type: syscall.F_RDLCK} - if err := syscall.FcntlFlock(0, F_OFD_GETLK, &getlk); err == nil { + if err := syscall.FcntlFlock(0, unix.F_OFD_GETLK, &getlk); err == nil { linuxTryLockFile = ofdTryLockFile linuxLockFile = ofdLockFile } @@ -67,7 +63,7 @@ func ofdTryLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error } flock := wrlck - if err = syscall.FcntlFlock(f.Fd(), F_OFD_SETLK, &flock); err != nil { + if err = syscall.FcntlFlock(f.Fd(), unix.F_OFD_SETLK, &flock); err != nil { f.Close() if err == syscall.EWOULDBLOCK { err = ErrLocked @@ -88,7 +84,7 @@ func ofdLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { } flock := wrlck - err = syscall.FcntlFlock(f.Fd(), F_OFD_SETLKW, &flock) + err = syscall.FcntlFlock(f.Fd(), unix.F_OFD_SETLKW, &flock) if err != nil { f.Close() return nil, err diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_plan9.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_plan9.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_plan9.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_plan9.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_solaris.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_solaris.go similarity index 98% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_solaris.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_solaris.go index 352ca5590d13..683cc1db9c41 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_solaris.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_solaris.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build solaris // +build solaris package fileutil diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_unix.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_unix.go similarity index 94% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_unix.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_unix.go index ed01164de6e4..d89027e1fad6 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_unix.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_unix.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows && !plan9 && !solaris && !linux // +build !windows,!plan9,!solaris,!linux package fileutil diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_windows.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_windows.go similarity index 95% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_windows.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_windows.go index b1817230a3cf..5cbf2bc3d5e8 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/lock_windows.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_windows.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package fileutil @@ -28,7 +29,7 @@ var ( modkernel32 = syscall.NewLazyDLL("kernel32.dll") procLockFileEx = modkernel32.NewProc("LockFileEx") - errLocked = errors.New("The process cannot access the file because another process has locked a portion of the file.") + errLocked = errors.New("the process cannot access the file because another process has locked a portion of the file") ) const ( diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate_darwin.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_darwin.go similarity index 82% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate_darwin.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_darwin.go index 5a6dccfa796f..caab143dd301 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate_darwin.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_darwin.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build darwin // +build darwin package fileutil @@ -19,7 +20,8 @@ package fileutil import ( "os" "syscall" - "unsafe" + + "golang.org/x/sys/unix" ) func preallocExtend(f *os.File, sizeInBytes int64) error { @@ -32,18 +34,18 @@ func preallocExtend(f *os.File, sizeInBytes int64) error { func preallocFixed(f *os.File, sizeInBytes int64) error { // allocate all requested space or no space at all // TODO: allocate contiguous space on disk with F_ALLOCATECONTIG flag - fstore := &syscall.Fstore_t{ - Flags: syscall.F_ALLOCATEALL, - Posmode: syscall.F_PEOFPOSMODE, - Length: sizeInBytes} - p := unsafe.Pointer(fstore) - _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, f.Fd(), uintptr(syscall.F_PREALLOCATE), uintptr(p)) - if errno == 0 || errno == syscall.ENOTSUP { + fstore := &unix.Fstore_t{ + Flags: unix.F_ALLOCATEALL, + Posmode: unix.F_PEOFPOSMODE, + Length: sizeInBytes, + } + err := unix.FcntlFstore(f.Fd(), unix.F_PREALLOCATE, fstore) + if err == nil || err == unix.ENOTSUP { return nil } // wrong argument to fallocate syscall - if errno == syscall.EINVAL { + if err == unix.EINVAL { // filesystem "st_blocks" are allocated in the units of // "Allocation Block Size" (run "diskutil info /" command) var stat syscall.Stat_t @@ -61,5 +63,5 @@ func preallocFixed(f *os.File, sizeInBytes int64) error { return nil } } - return errno + return err } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate_unix.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unix.go similarity index 98% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate_unix.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unix.go index 50bd84f02ada..ebb8207c3408 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate_unix.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unix.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package fileutil diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate_unsupported.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unsupported.go similarity index 96% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate_unsupported.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unsupported.go index 162fbc5f7826..2c46dd490755 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/preallocate_unsupported.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unsupported.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !linux && !darwin // +build !linux,!darwin package fileutil diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/purge.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go similarity index 88% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/purge.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go index d116f340b6f4..e8ac0ca6f58a 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/purge.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go @@ -37,6 +37,9 @@ func PurgeFileWithDoneNotify(lg *zap.Logger, dirname string, suffix string, max // purgeFile is the internal implementation for PurgeFile which can post purged files to purgec if non-nil. // if donec is non-nil, the function closes it to notify its exit. func purgeFile(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}, purgec chan<- string, donec chan<- struct{}) <-chan error { + if lg == nil { + lg = zap.NewNop() + } errC := make(chan error, 1) go func() { if donec != nil { @@ -67,19 +70,11 @@ func purgeFile(lg *zap.Logger, dirname string, suffix string, max uint, interval return } if err = l.Close(); err != nil { - if lg != nil { - lg.Warn("failed to unlock/close", zap.String("path", l.Name()), zap.Error(err)) - } else { - plog.Errorf("error unlocking %s when purging file (%v)", l.Name(), err) - } + lg.Warn("failed to unlock/close", zap.String("path", l.Name()), zap.Error(err)) errC <- err return } - if lg != nil { - lg.Info("purged", zap.String("path", f)) - } else { - plog.Infof("purged file %s successfully", f) - } + lg.Info("purged", zap.String("path", f)) newfnames = newfnames[1:] } if purgec != nil { diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/read_dir.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/read_dir.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/read_dir.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/read_dir.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/sync.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync.go similarity index 96% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/sync.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync.go index 54dd41f4f351..0a0855309e9e 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/sync.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !linux && !darwin // +build !linux,!darwin package fileutil diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/sync_darwin.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_darwin.go similarity index 87% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/sync_darwin.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_darwin.go index c2f39bf204d2..1923b276ea07 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/sync_darwin.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_darwin.go @@ -12,13 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build darwin // +build darwin package fileutil import ( "os" - "syscall" + + "golang.org/x/sys/unix" ) // Fsync on HFS/OSX flushes the data on to the physical drive but the drive @@ -26,11 +28,8 @@ import ( // written in out-of-order sequence. Using F_FULLFSYNC ensures that the // physical drive's buffer will also get flushed to the media. func Fsync(f *os.File) error { - _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, f.Fd(), uintptr(syscall.F_FULLFSYNC), uintptr(0)) - if errno == 0 { - return nil - } - return errno + _, err := unix.FcntlInt(f.Fd(), unix.F_FULLFSYNC, 0) + return err } // Fdatasync on darwin platform invokes fcntl(F_FULLFSYNC) for actual persistence diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/sync_linux.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_linux.go similarity index 98% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/sync_linux.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_linux.go index 1bbced915e9b..b9398c23f947 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/fileutil/sync_linux.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_linux.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package fileutil diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/doc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/doc.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/doc.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/doc.go diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/log_hijack.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/log_level.go similarity index 58% rename from cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/log_hijack.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/log_level.go index 970086b9f973..6c95bcfe9f73 100644 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/log_hijack.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/log_level.go @@ -1,4 +1,4 @@ -// Copyright 2015 CoreOS, Inc. +// Copyright 2019 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,28 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -package capnslog +package logutil import ( - "log" + "go.uber.org/zap/zapcore" ) -func initHijack() { - pkg := NewPackageLogger("log", "") - w := packageWriter{pkg} - log.SetFlags(0) - log.SetPrefix("") - log.SetOutput(w) -} - -type packageWriter struct { - pl *PackageLogger -} +var DefaultLogLevel = "info" -func (p packageWriter) Write(b []byte) (int, error) { - if p.pl.level < INFO { - return 0, nil +// ConvertToZapLevel converts log level string to zapcore.Level. +func ConvertToZapLevel(lvl string) zapcore.Level { + var level zapcore.Level + if err := level.Set(lvl); err != nil { + panic(err) } - p.pl.internalLog(calldepth+2, INFO, string(b)) - return len(b), nil + return level } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_journal.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go similarity index 95% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_journal.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go index fcd39038107c..9daa3e0aab1d 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_journal.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package logutil @@ -24,9 +25,9 @@ import ( "os" "path/filepath" - "go.etcd.io/etcd/pkg/systemd" + "go.etcd.io/etcd/client/pkg/v3/systemd" - "github.com/coreos/go-systemd/journal" + "github.com/coreos/go-systemd/v22/journal" "go.uber.org/zap/zapcore" ) diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/systemd/doc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/doc.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/systemd/doc.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/doc.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/systemd/journal.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/journal.go similarity index 92% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/systemd/journal.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/journal.go index b861c69425cf..494ce372e7f2 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/systemd/journal.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/journal.go @@ -17,7 +17,7 @@ package systemd import "net" // DialJournal returns no error if the process can dial journal socket. -// Returns an error if dial failed, whichi indicates journald is not available +// Returns an error if dial failed, which indicates journald is not available // (e.g. run embedded etcd as docker daemon). // Reference: https://github.com/coreos/go-systemd/blob/master/journal/journal.go. func DialJournal() error { diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/cipher_suites.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/cipher_suites.go new file mode 100644 index 000000000000..f278a61f8a04 --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/cipher_suites.go @@ -0,0 +1,39 @@ +// Copyright 2018 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tlsutil + +import "crypto/tls" + +// GetCipherSuite returns the corresponding cipher suite, +// and boolean value if it is supported. +func GetCipherSuite(s string) (uint16, bool) { + for _, c := range tls.CipherSuites() { + if s == c.Name { + return c.ID, true + } + } + for _, c := range tls.InsecureCipherSuites() { + if s == c.Name { + return c.ID, true + } + } + switch s { + case "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305": + return tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, true + case "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305": + return tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, true + } + return 0, false +} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/tlsutil/doc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/doc.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/tlsutil/doc.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/doc.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/tlsutil/tlsutil.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/tlsutil.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/tlsutil/tlsutil.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/tlsutil.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/doc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/doc.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/doc.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/doc.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/keepalive_listener.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/keepalive_listener.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/limit_listen.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/limit_listen.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/limit_listen.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/limit_listen.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/listener.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go similarity index 69% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/listener.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go index 7260e4d079c1..992c773eaacc 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/listener.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go @@ -15,6 +15,7 @@ package transport import ( + "context" "crypto/ecdsa" "crypto/elliptic" "crypto/rand" @@ -31,26 +32,74 @@ import ( "strings" "time" - "go.etcd.io/etcd/pkg/fileutil" - "go.etcd.io/etcd/pkg/tlsutil" + "go.etcd.io/etcd/client/pkg/v3/fileutil" + "go.etcd.io/etcd/client/pkg/v3/tlsutil" "go.uber.org/zap" ) // NewListener creates a new listner. func NewListener(addr, scheme string, tlsinfo *TLSInfo) (l net.Listener, err error) { - if l, err = newListener(addr, scheme); err != nil { - return nil, err - } - return wrapTLS(scheme, tlsinfo, l) + return newListener(addr, scheme, WithTLSInfo(tlsinfo)) } -func newListener(addr string, scheme string) (net.Listener, error) { +// NewListenerWithOpts creates a new listener which accpets listener options. +func NewListenerWithOpts(addr, scheme string, opts ...ListenerOption) (net.Listener, error) { + return newListener(addr, scheme, opts...) +} + +func newListener(addr, scheme string, opts ...ListenerOption) (net.Listener, error) { if scheme == "unix" || scheme == "unixs" { // unix sockets via unix://laddr return NewUnixListener(addr) } - return net.Listen("tcp", addr) + + lnOpts := newListenOpts(opts...) + + switch { + case lnOpts.IsSocketOpts(): + // new ListenConfig with socket options. + config, err := newListenConfig(lnOpts.socketOpts) + if err != nil { + return nil, err + } + lnOpts.ListenConfig = config + // check for timeout + fallthrough + case lnOpts.IsTimeout(), lnOpts.IsSocketOpts(): + // timeout listener with socket options. + ln, err := lnOpts.ListenConfig.Listen(context.TODO(), "tcp", addr) + if err != nil { + return nil, err + } + lnOpts.Listener = &rwTimeoutListener{ + Listener: ln, + readTimeout: lnOpts.readTimeout, + writeTimeout: lnOpts.writeTimeout, + } + case lnOpts.IsTimeout(): + ln, err := net.Listen("tcp", addr) + if err != nil { + return nil, err + } + lnOpts.Listener = &rwTimeoutListener{ + Listener: ln, + readTimeout: lnOpts.readTimeout, + writeTimeout: lnOpts.writeTimeout, + } + default: + ln, err := net.Listen("tcp", addr) + if err != nil { + return nil, err + } + lnOpts.Listener = ln + } + + // only skip if not passing TLSInfo + if lnOpts.skipTLSInfoCheck && !lnOpts.IsTLS() { + return lnOpts.Listener, nil + } + return wrapTLS(scheme, lnOpts.tlsInfo, lnOpts.Listener) } func wrapTLS(scheme string, tlsinfo *TLSInfo, l net.Listener) (net.Listener, error) { @@ -63,9 +112,28 @@ func wrapTLS(scheme string, tlsinfo *TLSInfo, l net.Listener) (net.Listener, err return newTLSListener(l, tlsinfo, checkSAN) } +func newListenConfig(sopts *SocketOpts) (net.ListenConfig, error) { + lc := net.ListenConfig{} + if sopts != nil { + ctls := getControls(sopts) + if len(ctls) > 0 { + lc.Control = ctls.Control + } + } + return lc, nil +} + type TLSInfo struct { - CertFile string - KeyFile string + // CertFile is the _server_ cert, it will also be used as a _client_ certificate if ClientCertFile is empty + CertFile string + // KeyFile is the key for the CertFile + KeyFile string + // ClientCertFile is a _client_ cert for initiating connections when ClientCertAuth is defined. If ClientCertAuth + // is true but this value is empty, the CertFile will be used instead. + ClientCertFile string + // ClientKeyFile is the key for the ClientCertFile + ClientKeyFile string + TrustedCAFile string ClientCertAuth bool CRLFile string @@ -107,15 +175,23 @@ type TLSInfo struct { } func (info TLSInfo) String() string { - return fmt.Sprintf("cert = %s, key = %s, trusted-ca = %s, client-cert-auth = %v, crl-file = %s", info.CertFile, info.KeyFile, info.TrustedCAFile, info.ClientCertAuth, info.CRLFile) + return fmt.Sprintf("cert = %s, key = %s, client-cert=%s, client-key=%s, trusted-ca = %s, client-cert-auth = %v, crl-file = %s", info.CertFile, info.KeyFile, info.ClientCertFile, info.ClientKeyFile, info.TrustedCAFile, info.ClientCertAuth, info.CRLFile) } func (info TLSInfo) Empty() bool { return info.CertFile == "" && info.KeyFile == "" } -func SelfCert(lg *zap.Logger, dirpath string, hosts []string, additionalUsages ...x509.ExtKeyUsage) (info TLSInfo, err error) { +func SelfCert(lg *zap.Logger, dirpath string, hosts []string, selfSignedCertValidity uint, additionalUsages ...x509.ExtKeyUsage) (info TLSInfo, err error) { info.Logger = lg + if selfSignedCertValidity == 0 { + err = fmt.Errorf("selfSignedCertValidity is invalid,it should be greater than 0") + info.Logger.Warn( + "cannot generate cert", + zap.Error(err), + ) + return + } err = fileutil.TouchDirAll(dirpath) if err != nil { if info.Logger != nil { @@ -127,13 +203,21 @@ func SelfCert(lg *zap.Logger, dirpath string, hosts []string, additionalUsages . return } - certPath := filepath.Join(dirpath, "cert.pem") - keyPath := filepath.Join(dirpath, "key.pem") + certPath, err := filepath.Abs(filepath.Join(dirpath, "cert.pem")) + if err != nil { + return + } + keyPath, err := filepath.Abs(filepath.Join(dirpath, "key.pem")) + if err != nil { + return + } _, errcert := os.Stat(certPath) _, errkey := os.Stat(keyPath) if errcert == nil && errkey == nil { info.CertFile = certPath info.KeyFile = keyPath + info.ClientCertFile = certPath + info.ClientKeyFile = keyPath info.selfCert = true return } @@ -154,13 +238,20 @@ func SelfCert(lg *zap.Logger, dirpath string, hosts []string, additionalUsages . SerialNumber: serialNumber, Subject: pkix.Name{Organization: []string{"etcd"}}, NotBefore: time.Now(), - NotAfter: time.Now().Add(365 * (24 * time.Hour)), + NotAfter: time.Now().Add(time.Duration(selfSignedCertValidity) * 365 * (24 * time.Hour)), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, ExtKeyUsage: append([]x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, additionalUsages...), BasicConstraintsValid: true, } + if info.Logger != nil { + info.Logger.Warn( + "automatically generate certificates", + zap.Time("certificate-validity-bound-not-after", tmpl.NotAfter), + ) + } + for _, host := range hosts { h, _, _ := net.SplitHostPort(host) if ip := net.ParseIP(h); ip != nil { @@ -227,7 +318,7 @@ func SelfCert(lg *zap.Logger, dirpath string, hosts []string, additionalUsages . if info.Logger != nil { info.Logger.Info("created key file", zap.String("path", keyPath)) } - return SelfCert(lg, dirpath, hosts) + return SelfCert(lg, dirpath, hosts, selfSignedCertValidity) } // baseConfig is called on initial TLS handshake start. @@ -263,6 +354,17 @@ func (info TLSInfo) baseConfig() (*tls.Config, error) { return nil, err } + // Perform prevalidation of client cert and key if either are provided. This makes sure we crash before accepting any connections. + if (info.ClientKeyFile == "") != (info.ClientCertFile == "") { + return nil, fmt.Errorf("ClientKeyFile and ClientCertFile must both be present or both absent: key: %v, cert: %v]", info.ClientKeyFile, info.ClientCertFile) + } + if info.ClientCertFile != "" { + _, err := tlsutil.NewCert(info.ClientCertFile, info.ClientKeyFile, info.parseFunc) + if err != nil { + return nil, err + } + } + cfg := &tls.Config{ MinVersion: tls.VersionTLS12, ServerName: info.ServerName, @@ -327,13 +429,17 @@ func (info TLSInfo) baseConfig() (*tls.Config, error) { return cert, err } cfg.GetClientCertificate = func(unused *tls.CertificateRequestInfo) (cert *tls.Certificate, err error) { - cert, err = tlsutil.NewCert(info.CertFile, info.KeyFile, info.parseFunc) + certfile, keyfile := info.CertFile, info.KeyFile + if info.ClientCertFile != "" { + certfile, keyfile = info.ClientCertFile, info.ClientKeyFile + } + cert, err = tlsutil.NewCert(certfile, keyfile, info.parseFunc) if os.IsNotExist(err) { if info.Logger != nil { info.Logger.Warn( "failed to find client cert files", - zap.String("cert-file", info.CertFile), - zap.String("key-file", info.KeyFile), + zap.String("cert-file", certfile), + zap.String("key-file", keyfile), zap.Error(err), ) } @@ -341,8 +447,8 @@ func (info TLSInfo) baseConfig() (*tls.Config, error) { if info.Logger != nil { info.Logger.Warn( "failed to create client certificate", - zap.String("cert-file", info.CertFile), - zap.String("key-file", info.KeyFile), + zap.String("cert-file", certfile), + zap.String("key-file", keyfile), zap.Error(err), ) } @@ -368,6 +474,10 @@ func (info TLSInfo) ServerConfig() (*tls.Config, error) { return nil, err } + if info.Logger == nil { + info.Logger = zap.NewNop() + } + cfg.ClientAuth = tls.NoClientCert if info.TrustedCAFile != "" || info.ClientCertAuth { cfg.ClientAuth = tls.RequireAndVerifyClientCert @@ -375,6 +485,8 @@ func (info TLSInfo) ServerConfig() (*tls.Config, error) { cs := info.cafiles() if len(cs) > 0 { + info.Logger.Info("Loading cert pool", zap.Strings("cs", cs), + zap.Any("tlsinfo", info)) cp, err := tlsutil.NewCertPool(cs) if err != nil { return nil, err @@ -385,6 +497,11 @@ func (info TLSInfo) ServerConfig() (*tls.Config, error) { // "h2" NextProtos is necessary for enabling HTTP2 for go's HTTP server cfg.NextProtos = []string{"h2"} + // go1.13 enables TLS 1.3 by default + // and in TLS 1.3, cipher suites are not configurable + // setting Max TLS version to TLS 1.2 for go 1.13 + cfg.MaxVersion = tls.VersionTLS12 + return cfg, nil } @@ -418,7 +535,7 @@ func (info TLSInfo) ClientConfig() (*tls.Config, error) { if info.EmptyCN { hasNonEmptyCN := false cn := "" - tlsutil.NewCert(info.CertFile, info.KeyFile, func(certPEMBlock []byte, keyPEMBlock []byte) (tls.Certificate, error) { + _, err := tlsutil.NewCert(info.CertFile, info.KeyFile, func(certPEMBlock []byte, keyPEMBlock []byte) (tls.Certificate, error) { var block *pem.Block block, _ = pem.Decode(certPEMBlock) cert, err := x509.ParseCertificate(block.Bytes) @@ -431,11 +548,19 @@ func (info TLSInfo) ClientConfig() (*tls.Config, error) { } return tls.X509KeyPair(certPEMBlock, keyPEMBlock) }) + if err != nil { + return nil, err + } if hasNonEmptyCN { - return nil, fmt.Errorf("cert has non empty Common Name (%s)", cn) + return nil, fmt.Errorf("cert has non empty Common Name (%s): %s", cn, info.CertFile) } } + // go1.13 enables TLS 1.3 by default + // and in TLS 1.3, cipher suites are not configurable + // setting Max TLS version to TLS 1.2 for go 1.13 + cfg.MaxVersion = tls.VersionTLS12 + return cfg, nil } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go new file mode 100644 index 000000000000..ad4f6904da90 --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go @@ -0,0 +1,76 @@ +package transport + +import ( + "net" + "time" +) + +type ListenerOptions struct { + Listener net.Listener + ListenConfig net.ListenConfig + + socketOpts *SocketOpts + tlsInfo *TLSInfo + skipTLSInfoCheck bool + writeTimeout time.Duration + readTimeout time.Duration +} + +func newListenOpts(opts ...ListenerOption) *ListenerOptions { + lnOpts := &ListenerOptions{} + lnOpts.applyOpts(opts) + return lnOpts +} + +func (lo *ListenerOptions) applyOpts(opts []ListenerOption) { + for _, opt := range opts { + opt(lo) + } +} + +// IsTimeout returns true if the listener has a read/write timeout defined. +func (lo *ListenerOptions) IsTimeout() bool { return lo.readTimeout != 0 || lo.writeTimeout != 0 } + +// IsSocketOpts returns true if the listener options includes socket options. +func (lo *ListenerOptions) IsSocketOpts() bool { + if lo.socketOpts == nil { + return false + } + return lo.socketOpts.ReusePort || lo.socketOpts.ReuseAddress +} + +// IsTLS returns true if listner options includes TLSInfo. +func (lo *ListenerOptions) IsTLS() bool { + if lo.tlsInfo == nil { + return false + } + return !lo.tlsInfo.Empty() +} + +// ListenerOption are options which can be applied to the listener. +type ListenerOption func(*ListenerOptions) + +// WithTimeout allows for a read or write timeout to be applied to the listener. +func WithTimeout(read, write time.Duration) ListenerOption { + return func(lo *ListenerOptions) { + lo.writeTimeout = write + lo.readTimeout = read + } +} + +// WithSocketOpts defines socket options that will be applied to the listener. +func WithSocketOpts(s *SocketOpts) ListenerOption { + return func(lo *ListenerOptions) { lo.socketOpts = s } +} + +// WithTLSInfo adds TLS credentials to the listener. +func WithTLSInfo(t *TLSInfo) ListenerOption { + return func(lo *ListenerOptions) { lo.tlsInfo = t } +} + +// WithSkipTLSInfoCheck when true a transport can be created with an https scheme +// without passing TLSInfo, circumventing not presented error. Skipping this check +// also requires that TLSInfo is not passed. +func WithSkipTLSInfoCheck(skip bool) ListenerOption { + return func(lo *ListenerOptions) { lo.skipTLSInfoCheck = skip } +} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/listener_tls.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/listener_tls.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt.go new file mode 100644 index 000000000000..38548ddd7131 --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt.go @@ -0,0 +1,45 @@ +package transport + +import ( + "syscall" +) + +type Controls []func(network, addr string, conn syscall.RawConn) error + +func (ctls Controls) Control(network, addr string, conn syscall.RawConn) error { + for _, s := range ctls { + if err := s(network, addr, conn); err != nil { + return err + } + } + return nil +} + +type SocketOpts struct { + // ReusePort enables socket option SO_REUSEPORT [1] which allows rebind of + // a port already in use. User should keep in mind that flock can fail + // in which case lock on data file could result in unexpected + // condition. User should take caution to protect against lock race. + // [1] https://man7.org/linux/man-pages/man7/socket.7.html + ReusePort bool + // ReuseAddress enables a socket option SO_REUSEADDR which allows + // binding to an address in `TIME_WAIT` state. Useful to improve MTTR + // in cases where etcd slow to restart due to excessive `TIME_WAIT`. + // [1] https://man7.org/linux/man-pages/man7/socket.7.html + ReuseAddress bool +} + +func getControls(sopts *SocketOpts) Controls { + ctls := Controls{} + if sopts.ReuseAddress { + ctls = append(ctls, setReuseAddress) + } + if sopts.ReusePort { + ctls = append(ctls, setReusePort) + } + return ctls +} + +func (sopts *SocketOpts) Empty() bool { + return !sopts.ReuseAddress && !sopts.ReusePort +} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_unix.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_unix.go new file mode 100644 index 000000000000..432b52e0fcee --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_unix.go @@ -0,0 +1,22 @@ +//go:build !windows +// +build !windows + +package transport + +import ( + "syscall" + + "golang.org/x/sys/unix" +) + +func setReusePort(network, address string, conn syscall.RawConn) error { + return conn.Control(func(fd uintptr) { + syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT, 1) + }) +} + +func setReuseAddress(network, address string, conn syscall.RawConn) error { + return conn.Control(func(fd uintptr) { + syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEADDR, 1) + }) +} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_windows.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_windows.go new file mode 100644 index 000000000000..4e5af70b11eb --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_windows.go @@ -0,0 +1,19 @@ +//go:build windows +// +build windows + +package transport + +import ( + "fmt" + "syscall" +) + +func setReusePort(network, address string, c syscall.RawConn) error { + return fmt.Errorf("port reuse is not supported on Windows") +} + +// Windows supports SO_REUSEADDR, but it may cause undefined behavior, as +// there is no protection against port hijacking. +func setReuseAddress(network, addr string, conn syscall.RawConn) error { + return fmt.Errorf("address reuse is not supported on Windows") +} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_conn.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_conn.go similarity index 77% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_conn.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_conn.go index 7e8c02030fed..80e329394107 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_conn.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_conn.go @@ -21,13 +21,13 @@ import ( type timeoutConn struct { net.Conn - wtimeoutd time.Duration - rdtimeoutd time.Duration + writeTimeout time.Duration + readTimeout time.Duration } func (c timeoutConn) Write(b []byte) (n int, err error) { - if c.wtimeoutd > 0 { - if err := c.SetWriteDeadline(time.Now().Add(c.wtimeoutd)); err != nil { + if c.writeTimeout > 0 { + if err := c.SetWriteDeadline(time.Now().Add(c.writeTimeout)); err != nil { return 0, err } } @@ -35,8 +35,8 @@ func (c timeoutConn) Write(b []byte) (n int, err error) { } func (c timeoutConn) Read(b []byte) (n int, err error) { - if c.rdtimeoutd > 0 { - if err := c.SetReadDeadline(time.Now().Add(c.rdtimeoutd)); err != nil { + if c.readTimeout > 0 { + if err := c.SetReadDeadline(time.Now().Add(c.readTimeout)); err != nil { return 0, err } } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_dialer.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_dialer.go similarity index 91% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_dialer.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_dialer.go index 6ae39ecfc9b3..9c0245d31ad5 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_dialer.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_dialer.go @@ -28,9 +28,9 @@ type rwTimeoutDialer struct { func (d *rwTimeoutDialer) Dial(network, address string) (net.Conn, error) { conn, err := d.Dialer.Dial(network, address) tconn := &timeoutConn{ - rdtimeoutd: d.rdtimeoutd, - wtimeoutd: d.wtimeoutd, - Conn: conn, + readTimeout: d.rdtimeoutd, + writeTimeout: d.wtimeoutd, + Conn: conn, } return tconn, err } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_listener.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_listener.go similarity index 70% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_listener.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_listener.go index 273e99fe038d..5d74bd70c238 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_listener.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_listener.go @@ -22,26 +22,14 @@ import ( // NewTimeoutListener returns a listener that listens on the given address. // If read/write on the accepted connection blocks longer than its time limit, // it will return timeout error. -func NewTimeoutListener(addr string, scheme string, tlsinfo *TLSInfo, rdtimeoutd, wtimeoutd time.Duration) (net.Listener, error) { - ln, err := newListener(addr, scheme) - if err != nil { - return nil, err - } - ln = &rwTimeoutListener{ - Listener: ln, - rdtimeoutd: rdtimeoutd, - wtimeoutd: wtimeoutd, - } - if ln, err = wrapTLS(scheme, tlsinfo, ln); err != nil { - return nil, err - } - return ln, nil +func NewTimeoutListener(addr string, scheme string, tlsinfo *TLSInfo, readTimeout, writeTimeout time.Duration) (net.Listener, error) { + return newListener(addr, scheme, WithTimeout(readTimeout, writeTimeout), WithTLSInfo(tlsinfo)) } type rwTimeoutListener struct { net.Listener - wtimeoutd time.Duration - rdtimeoutd time.Duration + writeTimeout time.Duration + readTimeout time.Duration } func (rwln *rwTimeoutListener) Accept() (net.Conn, error) { @@ -50,8 +38,8 @@ func (rwln *rwTimeoutListener) Accept() (net.Conn, error) { return nil, err } return timeoutConn{ - Conn: c, - wtimeoutd: rwln.wtimeoutd, - rdtimeoutd: rwln.rdtimeoutd, + Conn: c, + writeTimeout: rwln.writeTimeout, + readTimeout: rwln.readTimeout, }, nil } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_transport.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/timeout_transport.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/tls.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/tls.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/tls.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/tls.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/transport.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/transport.go similarity index 74% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/transport.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/transport.go index 4a7fe69d2e19..648512772d37 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/transport.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/transport.go @@ -15,6 +15,7 @@ package transport import ( + "context" "net" "net/http" "strings" @@ -31,29 +32,34 @@ func NewTransport(info TLSInfo, dialtimeoutd time.Duration) (*http.Transport, er t := &http.Transport{ Proxy: http.ProxyFromEnvironment, - Dial: (&net.Dialer{ + DialContext: (&net.Dialer{ Timeout: dialtimeoutd, // value taken from http.DefaultTransport KeepAlive: 30 * time.Second, - }).Dial, + }).DialContext, // value taken from http.DefaultTransport TLSHandshakeTimeout: 10 * time.Second, TLSClientConfig: cfg, } - dialer := (&net.Dialer{ + dialer := &net.Dialer{ Timeout: dialtimeoutd, KeepAlive: 30 * time.Second, - }) - dial := func(net, addr string) (net.Conn, error) { - return dialer.Dial("unix", addr) } + dialContext := func(ctx context.Context, net, addr string) (net.Conn, error) { + return dialer.DialContext(ctx, "unix", addr) + } tu := &http.Transport{ Proxy: http.ProxyFromEnvironment, - Dial: dial, + DialContext: dialContext, TLSHandshakeTimeout: 10 * time.Second, TLSClientConfig: cfg, + // Cost of reopening connection on sockets is low, and they are mostly used in testing. + // Long living unix-transport connections were leading to 'leak' test flakes. + // Alternativly the returned Transport (t) should override CloseIdleConnections to + // forward it to 'tu' as well. + IdleConnTimeout: time.Microsecond, } ut := &unixTransport{tu} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/unix_listener.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/unix_listener.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/transport/unix_listener.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/transport/unix_listener.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/doc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/doc.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/doc.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/doc.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/id.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/id.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/id.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/id.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/set.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/set.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/slice.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/slice.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/slice.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/slice.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/urls.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/urls.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/urlsmap.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/urlsmap.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/types/urlsmap.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/types/urlsmap.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/LICENSE b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/README.md b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/README.md similarity index 71% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/README.md rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/README.md index 6c6fe7c67c49..1e037d7eb6b5 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/README.md +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/README.md @@ -8,7 +8,14 @@ ## Install ```bash -go get go.etcd.io/etcd/clientv3 +go get go.etcd.io/etcd/client/v3 +``` + +Warning: As etcd 3.5.0 was not yet released, the command above does not work. +After first pre-release of 3.5.0 [#12498](https://github.com/etcd-io/etcd/issues/12498), +etcd can be referenced using: +``` +go get go.etcd.io/etcd/client/v3@v3.5.0-pre ``` ## Get started @@ -41,14 +48,14 @@ if err != nil { // use the response ``` -For full compatibility, it is recommended to vendor builds using etcd's vendored packages, using tools like `golang/dep`, as in [vendor directories](https://golang.org/cmd/go/#hdr-Vendor_Directories). +For full compatibility, it is recommended to install released versions of clients using go modules. ## Error Handling etcd client returns 2 types of errors: 1. context error: canceled or deadline exceeded. -2. gRPC error: see [api/v3rpc/rpctypes](https://godoc.org/go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes). +2. gRPC error: see [api/v3rpc/rpctypes](https://godoc.org/go.etcd.io/etcd/api/v3rpc/rpctypes). Here is the example code to handle client errors: @@ -70,11 +77,11 @@ if err != nil { ## Metrics -The etcd client optionally exposes RPC metrics through [go-grpc-prometheus](https://github.com/grpc-ecosystem/go-grpc-prometheus). See the [examples](https://github.com/etcd-io/etcd/blob/master/clientv3/example_metrics_test.go). +The etcd client optionally exposes RPC metrics through [go-grpc-prometheus](https://github.com/grpc-ecosystem/go-grpc-prometheus). See the [examples](https://github.com/etcd-io/etcd/blob/main/tests/integration/clientv3/examples/example_metrics_test.go). ## Namespacing -The [namespace](https://godoc.org/go.etcd.io/etcd/clientv3/namespace) package provides `clientv3` interface wrappers to transparently isolate client requests to a user-defined prefix. +The [namespace](https://godoc.org/go.etcd.io/etcd/client/v3/namespace) package provides `clientv3` interface wrappers to transparently isolate client requests to a user-defined prefix. ## Request size limit @@ -82,4 +89,4 @@ Client request size limit is configurable via `clientv3.Config.MaxCallSendMsgSiz ## Examples -More code examples can be found at [GoDoc](https://godoc.org/go.etcd.io/etcd/clientv3). +More code [examples](https://github.com/etcd-io/etcd/tree/main/tests/integration/clientv3/examples) can be found at [GoDoc](https://pkg.go.dev/go.etcd.io/etcd/client/v3). diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/auth.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/auth.go similarity index 91% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/auth.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/auth.go index c954f1bf4746..a6f75d321592 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/auth.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/auth.go @@ -19,14 +19,15 @@ import ( "fmt" "strings" - "go.etcd.io/etcd/auth/authpb" - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + "go.etcd.io/etcd/api/v3/authpb" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" "google.golang.org/grpc" ) type ( AuthEnableResponse pb.AuthEnableResponse AuthDisableResponse pb.AuthDisableResponse + AuthStatusResponse pb.AuthStatusResponse AuthenticateResponse pb.AuthenticateResponse AuthUserAddResponse pb.AuthUserAddResponse AuthUserDeleteResponse pb.AuthUserDeleteResponse @@ -55,12 +56,18 @@ const ( type UserAddOptions authpb.UserAddOptions type Auth interface { + // Authenticate login and get token + Authenticate(ctx context.Context, name string, password string) (*AuthenticateResponse, error) + // AuthEnable enables auth of an etcd cluster. AuthEnable(ctx context.Context) (*AuthEnableResponse, error) // AuthDisable disables auth of an etcd cluster. AuthDisable(ctx context.Context) (*AuthDisableResponse, error) + // AuthStatus returns the status of auth of an etcd cluster. + AuthStatus(ctx context.Context) (*AuthStatusResponse, error) + // UserAdd adds a new user to an etcd cluster. UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error) @@ -117,6 +124,19 @@ func NewAuth(c *Client) Auth { return api } +func NewAuthFromAuthClient(remote pb.AuthClient, c *Client) Auth { + api := &authClient{remote: remote} + if c != nil { + api.callOpts = c.callOpts + } + return api +} + +func (auth *authClient) Authenticate(ctx context.Context, name string, password string) (*AuthenticateResponse, error) { + resp, err := auth.remote.Authenticate(ctx, &pb.AuthenticateRequest{Name: name, Password: password}, auth.callOpts...) + return (*AuthenticateResponse)(resp), toErr(ctx, err) +} + func (auth *authClient) AuthEnable(ctx context.Context) (*AuthEnableResponse, error) { resp, err := auth.remote.AuthEnable(ctx, &pb.AuthEnableRequest{}, auth.callOpts...) return (*AuthEnableResponse)(resp), toErr(ctx, err) @@ -127,6 +147,11 @@ func (auth *authClient) AuthDisable(ctx context.Context) (*AuthDisableResponse, return (*AuthDisableResponse)(resp), toErr(ctx, err) } +func (auth *authClient) AuthStatus(ctx context.Context) (*AuthStatusResponse, error) { + resp, err := auth.remote.AuthStatus(ctx, &pb.AuthStatusRequest{}, auth.callOpts...) + return (*AuthStatusResponse)(resp), toErr(ctx, err) +} + func (auth *authClient) UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error) { resp, err := auth.remote.UserAdd(ctx, &pb.AuthUserAddRequest{Name: name, Password: password, Options: &authpb.UserAddOptions{NoPassword: false}}, auth.callOpts...) return (*AuthUserAddResponse)(resp), toErr(ctx, err) @@ -209,34 +234,3 @@ func StrToPermissionType(s string) (PermissionType, error) { } return PermissionType(-1), fmt.Errorf("invalid permission type: %s", s) } - -type authenticator struct { - conn *grpc.ClientConn // conn in-use - remote pb.AuthClient - callOpts []grpc.CallOption -} - -func (auth *authenticator) authenticate(ctx context.Context, name string, password string) (*AuthenticateResponse, error) { - resp, err := auth.remote.Authenticate(ctx, &pb.AuthenticateRequest{Name: name, Password: password}, auth.callOpts...) - return (*AuthenticateResponse)(resp), toErr(ctx, err) -} - -func (auth *authenticator) close() { - auth.conn.Close() -} - -func newAuthenticator(ctx context.Context, target string, opts []grpc.DialOption, c *Client) (*authenticator, error) { - conn, err := grpc.DialContext(ctx, target, opts...) - if err != nil { - return nil, err - } - - api := &authenticator{ - conn: conn, - remote: pb.NewAuthClient(conn), - } - if c != nil { - api.callOpts = c.callOpts - } - return api, nil -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/client.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/client.go similarity index 65% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/client.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/client.go index a35ec679a029..fae7c7538806 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/client.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/client.go @@ -18,20 +18,15 @@ import ( "context" "errors" "fmt" - "net" - "os" "strconv" "strings" "sync" "time" - "github.com/google/uuid" - "go.etcd.io/etcd/clientv3/balancer" - "go.etcd.io/etcd/clientv3/balancer/picker" - "go.etcd.io/etcd/clientv3/balancer/resolver/endpoint" - "go.etcd.io/etcd/clientv3/credentials" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - "go.etcd.io/etcd/pkg/logutil" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + "go.etcd.io/etcd/client/v3/credentials" + "go.etcd.io/etcd/client/v3/internal/endpoint" + "go.etcd.io/etcd/client/v3/internal/resolver" "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -43,31 +38,8 @@ import ( var ( ErrNoAvailableEndpoints = errors.New("etcdclient: no available endpoints") ErrOldCluster = errors.New("etcdclient: old cluster version") - - roundRobinBalancerName = fmt.Sprintf("etcd-%s", picker.RoundrobinBalanced.String()) ) -func init() { - lg := zap.NewNop() - if os.Getenv("ETCD_CLIENT_DEBUG") != "" { - lcfg := logutil.DefaultZapLoggerConfig - lcfg.Level = zap.NewAtomicLevelAt(zap.DebugLevel) - - var err error - lg, err = lcfg.Build() // info level logging - if err != nil { - panic(err) - } - } - - // TODO: support custom balancer - balancer.RegisterBuilder(balancer.Config{ - Policy: picker.RoundrobinBalanced, - Name: roundRobinBalancerName, - Logger: lg, - }) -} - // Client provides and manages an etcd v3 client session. type Client struct { Cluster @@ -79,10 +51,10 @@ type Client struct { conn *grpc.ClientConn - cfg Config - creds grpccredentials.TransportCredentials - resolverGroup *endpoint.ResolverGroup - mu *sync.RWMutex + cfg Config + creds grpccredentials.TransportCredentials + resolver *resolver.EtcdManualResolver + mu *sync.RWMutex ctx context.Context cancel context.CancelFunc @@ -95,7 +67,8 @@ type Client struct { callOpts []grpc.CallOption - lg *zap.Logger + lgMu *sync.RWMutex + lg *zap.Logger } // New creates a new etcdv3 client from a given configuration. @@ -110,11 +83,21 @@ func New(cfg Config) (*Client, error) { // NewCtxClient creates a client with a context but no underlying grpc // connection. This is useful for embedded cases that override the // service interface implementations and do not need connection management. -func NewCtxClient(ctx context.Context) *Client { +func NewCtxClient(ctx context.Context, opts ...Option) *Client { cctx, cancel := context.WithCancel(ctx) - return &Client{ctx: cctx, cancel: cancel} + c := &Client{ctx: cctx, cancel: cancel, lgMu: new(sync.RWMutex)} + for _, opt := range opts { + opt(c) + } + if c.lg == nil { + c.lg = zap.NewNop() + } + return c } +// Option is a function type that can be passed as argument to NewCtxClient to configure client +type Option func(*Client) + // NewFromURL creates a new etcdv3 client from a URL. func NewFromURL(url string) (*Client, error) { return New(Config{Endpoints: []string{url}}) @@ -125,6 +108,35 @@ func NewFromURLs(urls []string) (*Client, error) { return New(Config{Endpoints: urls}) } +// WithZapLogger is a NewCtxClient option that overrides the logger +func WithZapLogger(lg *zap.Logger) Option { + return func(c *Client) { + c.lg = lg + } +} + +// WithLogger overrides the logger. +// +// Deprecated: Please use WithZapLogger or Logger field in clientv3.Config +// +// Does not changes grpcLogger, that can be explicitly configured +// using grpc_zap.ReplaceGrpcLoggerV2(..) method. +func (c *Client) WithLogger(lg *zap.Logger) *Client { + c.lgMu.Lock() + c.lg = lg + c.lgMu.Unlock() + return c +} + +// GetLogger gets the logger. +// NOTE: This method is for internal use of etcd-client library and should not be used as general-purpose logger. +func (c *Client) GetLogger() *zap.Logger { + c.lgMu.RLock() + l := c.lg + c.lgMu.RUnlock() + return l +} + // Close shuts down the client's etcd connections. func (c *Client) Close() error { c.cancel() @@ -134,9 +146,6 @@ func (c *Client) Close() error { if c.Lease != nil { c.Lease.Close() } - if c.resolverGroup != nil { - c.resolverGroup.Close() - } if c.conn != nil { return toErr(c.ctx, c.conn.Close()) } @@ -163,7 +172,8 @@ func (c *Client) SetEndpoints(eps ...string) { c.mu.Lock() defer c.mu.Unlock() c.cfg.Endpoints = eps - c.resolverGroup.SetEndpoints(eps) + + c.resolver.SetEndpoints(eps) } // Sync synchronizes client's endpoints with the known endpoints from the etcd membership. @@ -194,29 +204,12 @@ func (c *Client) autoSync() { err := c.Sync(ctx) cancel() if err != nil && err != c.ctx.Err() { - lg.Lvl(4).Infof("Auto sync endpoints failed: %v", err) + c.lg.Info("Auto sync endpoints failed.", zap.Error(err)) } } } } -func (c *Client) processCreds(scheme string) (creds grpccredentials.TransportCredentials) { - creds = c.creds - switch scheme { - case "unix": - case "http": - creds = nil - case "https", "unixs": - if creds != nil { - break - } - creds = credentials.NewBundle(credentials.Config{}).TransportCredentials() - default: - creds = nil - } - return creds -} - // dialSetupOpts gives the dial opts prior to any authentication. func (c *Client) dialSetupOpts(creds grpccredentials.TransportCredentials, dopts ...grpc.DialOption) (opts []grpc.DialOption, err error) { if c.cfg.DialKeepAliveTime > 0 { @@ -229,28 +222,21 @@ func (c *Client) dialSetupOpts(creds grpccredentials.TransportCredentials, dopts } opts = append(opts, dopts...) - dialer := endpoint.Dialer if creds != nil { opts = append(opts, grpc.WithTransportCredentials(creds)) - // gRPC load balancer workaround. See credentials.transportCredential for details. - if credsDialer, ok := creds.(TransportCredentialsWithDialer); ok { - dialer = credsDialer.Dialer - } } else { opts = append(opts, grpc.WithInsecure()) } - opts = append(opts, grpc.WithContextDialer(dialer)) // Interceptor retry and backoff. - // TODO: Replace all of clientv3/retry.go with interceptor based retry, or with - // https://github.com/grpc/proposal/blob/master/A6-client-retries.md#retry-policy - // once it is available. + // TODO: Replace all of clientv3/retry.go with RetryPolicy: + // https://github.com/grpc/grpc-proto/blob/cdd9ed5c3d3f87aef62f373b93361cf7bddc620d/grpc/service_config/service_config.proto#L130 rrBackoff := withBackoff(c.roundRobinQuorumBackoff(defaultBackoffWaitBetween, defaultBackoffJitterFraction)) opts = append(opts, // Disable stream retry by default since go-grpc-middleware/retry does not support client streams. // Streams that are safe to retry are enabled individually. - grpc.WithStreamInterceptor(c.streamClientInterceptor(c.lg, withMax(0), rrBackoff)), - grpc.WithUnaryInterceptor(c.unaryClientInterceptor(c.lg, withMax(defaultUnaryMaxRetries), rrBackoff)), + grpc.WithStreamInterceptor(c.streamClientInterceptor(withMax(0), rrBackoff)), + grpc.WithUnaryInterceptor(c.unaryClientInterceptor(withMax(defaultUnaryMaxRetries), rrBackoff)), ) return opts, nil @@ -258,94 +244,48 @@ func (c *Client) dialSetupOpts(creds grpccredentials.TransportCredentials, dopts // Dial connects to a single endpoint using the client's config. func (c *Client) Dial(ep string) (*grpc.ClientConn, error) { - creds, err := c.directDialCreds(ep) - if err != nil { - return nil, err - } - // Use the grpc passthrough resolver to directly dial a single endpoint. - // This resolver passes through the 'unix' and 'unixs' endpoints schemes used - // by etcd without modification, allowing us to directly dial endpoints and - // using the same dial functions that we use for load balancer dialing. - return c.dial(fmt.Sprintf("passthrough:///%s", ep), creds) + creds := c.credentialsForEndpoint(ep) + + // Using ad-hoc created resolver, to guarantee only explicitly given + // endpoint is used. + return c.dial(creds, grpc.WithResolvers(resolver.New(ep))) } func (c *Client) getToken(ctx context.Context) error { var err error // return last error in a case of fail - var auth *authenticator - - eps := c.Endpoints() - for _, ep := range eps { - // use dial options without dopts to avoid reusing the client balancer - var dOpts []grpc.DialOption - _, host, _ := endpoint.ParseEndpoint(ep) - target := c.resolverGroup.Target(host) - creds := c.dialWithBalancerCreds(ep) - dOpts, err = c.dialSetupOpts(creds, c.cfg.DialOptions...) - if err != nil { - err = fmt.Errorf("failed to configure auth dialer: %v", err) - continue - } - dOpts = append(dOpts, grpc.WithBalancerName(roundRobinBalancerName)) - auth, err = newAuthenticator(ctx, target, dOpts, c) - if err != nil { - continue - } - defer auth.close() - - var resp *AuthenticateResponse - resp, err = auth.authenticate(ctx, c.Username, c.Password) - if err != nil { - // return err without retrying other endpoints - if err == rpctypes.ErrAuthNotEnabled { - return err - } - continue - } - c.authTokenBundle.UpdateAuthToken(resp.Token) + if c.Username == "" || c.Password == "" { return nil } - return err + resp, err := c.Auth.Authenticate(ctx, c.Username, c.Password) + if err != nil { + if err == rpctypes.ErrAuthNotEnabled { + return nil + } + return err + } + c.authTokenBundle.UpdateAuthToken(resp.Token) + return nil } // dialWithBalancer dials the client's current load balanced resolver group. The scheme of the host // of the provided endpoint determines the scheme used for all endpoints of the client connection. -func (c *Client) dialWithBalancer(ep string, dopts ...grpc.DialOption) (*grpc.ClientConn, error) { - _, host, _ := endpoint.ParseEndpoint(ep) - target := c.resolverGroup.Target(host) - creds := c.dialWithBalancerCreds(ep) - return c.dial(target, creds, dopts...) +func (c *Client) dialWithBalancer(dopts ...grpc.DialOption) (*grpc.ClientConn, error) { + creds := c.credentialsForEndpoint(c.Endpoints()[0]) + opts := append(dopts, grpc.WithResolvers(c.resolver)) + return c.dial(creds, opts...) } // dial configures and dials any grpc balancer target. -func (c *Client) dial(target string, creds grpccredentials.TransportCredentials, dopts ...grpc.DialOption) (*grpc.ClientConn, error) { +func (c *Client) dial(creds grpccredentials.TransportCredentials, dopts ...grpc.DialOption) (*grpc.ClientConn, error) { opts, err := c.dialSetupOpts(creds, dopts...) if err != nil { return nil, fmt.Errorf("failed to configure dialer: %v", err) } - if c.Username != "" && c.Password != "" { c.authTokenBundle = credentials.NewBundle(credentials.Config{}) - - ctx, cancel := c.ctx, func() {} - if c.cfg.DialTimeout > 0 { - ctx, cancel = context.WithTimeout(ctx, c.cfg.DialTimeout) - } - - err = c.getToken(ctx) - if err != nil { - if toErr(ctx, err) != rpctypes.ErrAuthNotEnabled { - if err == ctx.Err() && ctx.Err() != c.ctx.Err() { - err = context.DeadlineExceeded - } - cancel() - return nil, err - } - } else { - opts = append(opts, grpc.WithPerRPCCredentials(c.authTokenBundle.PerRPCCredentials())) - } - cancel() + opts = append(opts, grpc.WithPerRPCCredentials(c.authTokenBundle.PerRPCCredentials())) } opts = append(opts, c.cfg.DialOptions...) @@ -357,6 +297,8 @@ func (c *Client) dial(target string, creds grpccredentials.TransportCredentials, defer cancel() // TODO: Is this right for cases where grpc.WithBlock() is not set on the dial options? } + initialEndpoints := strings.Join(c.cfg.Endpoints, ";") + target := fmt.Sprintf("%s://%p/#initially=[%s]", resolver.Schema, c, initialEndpoints) conn, err := grpc.DialContext(dctx, target, opts...) if err != nil { return nil, err @@ -364,36 +306,21 @@ func (c *Client) dial(target string, creds grpccredentials.TransportCredentials, return conn, nil } -func (c *Client) directDialCreds(ep string) (grpccredentials.TransportCredentials, error) { - _, host, scheme := endpoint.ParseEndpoint(ep) - creds := c.creds - if len(scheme) != 0 { - creds = c.processCreds(scheme) - if creds != nil { - clone := creds.Clone() - // Set the server name must to the endpoint hostname without port since grpc - // otherwise attempts to check if x509 cert is valid for the full endpoint - // including the scheme and port, which fails. - overrideServerName, _, err := net.SplitHostPort(host) - if err != nil { - // Either the host didn't have a port or the host could not be parsed. Either way, continue with the - // original host string. - overrideServerName = host - } - clone.OverrideServerName(overrideServerName) - creds = clone +func (c *Client) credentialsForEndpoint(ep string) grpccredentials.TransportCredentials { + r := endpoint.RequiresCredentials(ep) + switch r { + case endpoint.CREDS_DROP: + return nil + case endpoint.CREDS_OPTIONAL: + return c.creds + case endpoint.CREDS_REQUIRE: + if c.creds != nil { + return c.creds } + return credentials.NewBundle(credentials.Config{}).TransportCredentials() + default: + panic(fmt.Errorf("unsupported CredsRequirement: %v", r)) } - return creds, nil -} - -func (c *Client) dialWithBalancerCreds(ep string) grpccredentials.TransportCredentials { - _, _, scheme := endpoint.ParseEndpoint(ep) - creds := c.creds - if len(scheme) != 0 { - creds = c.processCreds(scheme) - } - return creds } func newClient(cfg *Config) (*Client, error) { @@ -420,14 +347,17 @@ func newClient(cfg *Config) (*Client, error) { cancel: cancel, mu: new(sync.RWMutex), callOpts: defaultCallOpts, + lgMu: new(sync.RWMutex), } - lcfg := logutil.DefaultZapLoggerConfig - if cfg.LogConfig != nil { - lcfg = *cfg.LogConfig - } var err error - client.lg, err = lcfg.Build() + if cfg.Logger != nil { + client.lg = cfg.Logger + } else if cfg.LogConfig != nil { + client.lg, err = cfg.LogConfig.Build() + } else { + client.lg, err = CreateDefaultZapLogger() + } if err != nil { return nil, err } @@ -441,7 +371,7 @@ func newClient(cfg *Config) (*Client, error) { return nil, fmt.Errorf("gRPC message recv limit (%d bytes) must be greater than send limit (%d bytes)", cfg.MaxCallRecvMsgSize, cfg.MaxCallSendMsgSize) } callOpts := []grpc.CallOption{ - defaultFailFast, + defaultWaitForReady, defaultMaxCallSendMsgSize, defaultMaxCallRecvMsgSize, } @@ -454,30 +384,21 @@ func newClient(cfg *Config) (*Client, error) { client.callOpts = callOpts } - // Prepare a 'endpoint:///' resolver for the client and create a endpoint target to pass - // to dial so the client knows to use this resolver. - client.resolverGroup, err = endpoint.NewResolverGroup(fmt.Sprintf("client-%s", uuid.New().String())) - if err != nil { - client.cancel() - return nil, err - } - client.resolverGroup.SetEndpoints(cfg.Endpoints) + client.resolver = resolver.New(cfg.Endpoints...) if len(cfg.Endpoints) < 1 { - return nil, fmt.Errorf("at least one Endpoint must is required in client config") + client.cancel() + return nil, fmt.Errorf("at least one Endpoint is required in client config") } - dialEndpoint := cfg.Endpoints[0] - // Use a provided endpoint target so that for https:// without any tls config given, then // grpc will assume the certificate server name is the endpoint host. - conn, err := client.dialWithBalancer(dialEndpoint, grpc.WithBalancerName(roundRobinBalancerName)) + conn, err := client.dialWithBalancer() if err != nil { client.cancel() - client.resolverGroup.Close() + client.resolver.Close() + // TODO: Error like `fmt.Errorf(dialing [%s] failed: %v, strings.Join(cfg.Endpoints, ";"), err)` would help with debugging a lot. return nil, err } - // TODO: With the old grpc balancer interface, we waited until the dial timeout - // for the balancer to be ready. Is there an equivalent wait we should do with the new grpc balancer interface? client.conn = conn client.Cluster = NewCluster(client) @@ -487,6 +408,20 @@ func newClient(cfg *Config) (*Client, error) { client.Auth = NewAuth(client) client.Maintenance = NewMaintenance(client) + //get token with established connection + ctx, cancel = client.ctx, func() {} + if client.cfg.DialTimeout > 0 { + ctx, cancel = context.WithTimeout(ctx, client.cfg.DialTimeout) + } + err = client.getToken(ctx) + if err != nil { + client.Close() + cancel() + //TODO: Consider fmt.Errorf("communicating with [%s] failed: %v", strings.Join(cfg.Endpoints, ";"), err) + return nil, err + } + cancel() + if cfg.RejectOldCluster { if err := client.checkVersion(); err != nil { client.Close() @@ -656,9 +591,3 @@ func IsConnCanceled(err error) bool { // <= gRPC v1.7.x returns 'errors.New("grpc: the client connection is closing")' return strings.Contains(err.Error(), "grpc: the client connection is closing") } - -// TransportCredentialsWithDialer is for a gRPC load balancer workaround. See credentials.transportCredential for details. -type TransportCredentialsWithDialer interface { - grpccredentials.TransportCredentials - Dialer(ctx context.Context, dialEp string) (net.Conn, error) -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/cluster.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/cluster.go similarity index 95% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/cluster.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/cluster.go index ce97e5c85b8a..92d7cdb56b0f 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/cluster.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/cluster.go @@ -17,8 +17,8 @@ package clientv3 import ( "context" - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" - "go.etcd.io/etcd/pkg/types" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" + "go.etcd.io/etcd/client/pkg/v3/types" "google.golang.org/grpc" ) @@ -124,7 +124,7 @@ func (c *cluster) MemberUpdate(ctx context.Context, id uint64, peerAddrs []strin func (c *cluster) MemberList(ctx context.Context) (*MemberListResponse, error) { // it is safe to retry on list. - resp, err := c.remote.MemberList(ctx, &pb.MemberListRequest{}, c.callOpts...) + resp, err := c.remote.MemberList(ctx, &pb.MemberListRequest{Linearizable: true}, c.callOpts...) if err == nil { return (*MemberListResponse)(resp), nil } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/compact_op.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/compact_op.go similarity index 96% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/compact_op.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/compact_op.go index 5779713d3dd4..a6e660aa8257 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/compact_op.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/compact_op.go @@ -15,7 +15,7 @@ package clientv3 import ( - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" ) // CompactOp represents a compact operation. diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/compare.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/compare.go similarity index 98% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/compare.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/compare.go index 01ed68e942a7..e2967cf38ed3 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/compare.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/compare.go @@ -15,7 +15,7 @@ package clientv3 import ( - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" ) type CompareTarget int diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/config.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/config.go similarity index 97% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/config.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/config.go index 11d447d57567..335a288732b5 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/config.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/config.go @@ -76,6 +76,10 @@ type Config struct { // other operations that do not have an explicit context. Context context.Context + // Logger sets client-side logger. + // If nil, fallback to building LogConfig. + Logger *zap.Logger + // LogConfig configures client-side logger. // If nil, use the default logger. // TODO: configure gRPC logger diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/credentials/credentials.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/credentials/credentials.go similarity index 65% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/credentials/credentials.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/credentials/credentials.go index 63389c08bffd..42f688eb359c 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/credentials/credentials.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/credentials/credentials.go @@ -22,8 +22,7 @@ import ( "net" "sync" - "go.etcd.io/etcd/clientv3/balancer/resolver/endpoint" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" grpccredentials "google.golang.org/grpc/credentials" ) @@ -66,46 +65,20 @@ func (b *bundle) NewWithMode(mode string) (grpccredentials.Bundle, error) { } // transportCredential implements "grpccredentials.TransportCredentials" interface. -// transportCredential wraps TransportCredentials to track which -// addresses are dialed for which endpoints, and then sets the authority when checking the endpoint's cert to the -// hostname or IP of the dialed endpoint. -// This is a workaround of a gRPC load balancer issue. gRPC uses the dialed target's service name as the authority when -// checking all endpoint certs, which does not work for etcd servers using their hostname or IP as the Subject Alternative Name -// in their TLS certs. -// To enable, include both WithTransportCredentials(creds) and WithContextDialer(creds.Dialer) -// when dialing. type transportCredential struct { gtc grpccredentials.TransportCredentials - mu sync.Mutex - // addrToEndpoint maps from the connection addresses that are dialed to the hostname or IP of the - // endpoint provided to the dialer when dialing - addrToEndpoint map[string]string } func newTransportCredential(cfg *tls.Config) *transportCredential { return &transportCredential{ - gtc: grpccredentials.NewTLS(cfg), - addrToEndpoint: map[string]string{}, + gtc: grpccredentials.NewTLS(cfg), } } func (tc *transportCredential) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (net.Conn, grpccredentials.AuthInfo, error) { - // Set the authority when checking the endpoint's cert to the hostname or IP of the dialed endpoint - tc.mu.Lock() - dialEp, ok := tc.addrToEndpoint[rawConn.RemoteAddr().String()] - tc.mu.Unlock() - if ok { - _, host, _ := endpoint.ParseEndpoint(dialEp) - authority = host - } return tc.gtc.ClientHandshake(ctx, authority, rawConn) } -// return true if given string is an IP. -func isIP(ep string) bool { - return net.ParseIP(ep) != nil -} - func (tc *transportCredential) ServerHandshake(rawConn net.Conn) (net.Conn, grpccredentials.AuthInfo, error) { return tc.gtc.ServerHandshake(rawConn) } @@ -115,15 +88,8 @@ func (tc *transportCredential) Info() grpccredentials.ProtocolInfo { } func (tc *transportCredential) Clone() grpccredentials.TransportCredentials { - copy := map[string]string{} - tc.mu.Lock() - for k, v := range tc.addrToEndpoint { - copy[k] = v - } - tc.mu.Unlock() return &transportCredential{ - gtc: tc.gtc.Clone(), - addrToEndpoint: copy, + gtc: tc.gtc.Clone(), } } @@ -131,17 +97,6 @@ func (tc *transportCredential) OverrideServerName(serverNameOverride string) err return tc.gtc.OverrideServerName(serverNameOverride) } -func (tc *transportCredential) Dialer(ctx context.Context, dialEp string) (net.Conn, error) { - // Keep track of which addresses are dialed for which endpoints - conn, err := endpoint.Dialer(ctx, dialEp) - if conn != nil { - tc.mu.Lock() - tc.addrToEndpoint[conn.RemoteAddr().String()] = dialEp - tc.mu.Unlock() - } - return conn, err -} - // perRPCCredential implements "grpccredentials.PerRPCCredentials" interface. type perRPCCredential struct { authToken string @@ -156,6 +111,9 @@ func (rc *perRPCCredential) GetRequestMetadata(ctx context.Context, s ...string) rc.authTokenMu.RLock() authToken := rc.authToken rc.authTokenMu.RUnlock() + if authToken == "" { + return nil, nil + } return map[string]string{rpctypes.TokenFieldNameGRPC: authToken}, nil } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/ctx.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/ctx.go similarity index 77% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/ctx.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/ctx.go index 542219837bbc..56b69cf2ede8 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/ctx.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/ctx.go @@ -16,10 +16,9 @@ package clientv3 import ( "context" - "strings" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - "go.etcd.io/etcd/version" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + "go.etcd.io/etcd/api/v3/version" "google.golang.org/grpc/metadata" ) @@ -33,7 +32,7 @@ func WithRequireLeader(ctx context.Context) context.Context { } copied := md.Copy() // avoid racey updates // overwrite/add 'hasleader' key/value - metadataSet(copied, rpctypes.MetadataRequireLeaderKey, rpctypes.MetadataHasLeader) + copied.Set(rpctypes.MetadataRequireLeaderKey, rpctypes.MetadataHasLeader) return metadata.NewOutgoingContext(ctx, copied) } @@ -46,19 +45,6 @@ func withVersion(ctx context.Context) context.Context { } copied := md.Copy() // avoid racey updates // overwrite/add version key/value - metadataSet(copied, rpctypes.MetadataClientAPIVersionKey, version.APIVersion) + copied.Set(rpctypes.MetadataClientAPIVersionKey, version.APIVersion) return metadata.NewOutgoingContext(ctx, copied) } - -func metadataGet(md metadata.MD, k string) []string { - k = strings.ToLower(k) - return md[k] -} - -func metadataSet(md metadata.MD, k string, vals ...string) { - if len(vals) == 0 { - return - } - k = strings.ToLower(k) - md[k] = vals -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/doc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/doc.go similarity index 93% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/doc.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/doc.go index 913cd28255b2..645d744a5a7f 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/doc.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/doc.go @@ -57,11 +57,11 @@ // The Client has internal state (watchers and leases), so Clients should be reused instead of created as needed. // Clients are safe for concurrent use by multiple goroutines. // -// etcd client returns 3 types of errors: +// etcd client returns 2 types of errors: // // 1. context error: canceled or deadline exceeded. -// 2. gRPC status error: e.g. when clock drifts in server-side before client's context deadline exceeded. -// 3. gRPC error: see https://github.com/etcd-io/etcd/blob/master/etcdserver/api/v3rpc/rpctypes/error.go +// 2. gRPC error: e.g. when clock drifts in server-side before client's context deadline exceeded. +// See https://github.com/etcd-io/etcd/blob/main/api/v3rpc/rpctypes/error.go // // Here is the example code to handle client errors: // diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/go.mod b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/go.mod new file mode 100644 index 000000000000..0756f098dae5 --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/go.mod @@ -0,0 +1,28 @@ +module go.etcd.io/etcd/client/v3 + +go 1.16 + +require ( + github.com/dustin/go-humanize v1.0.0 + github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 + github.com/prometheus/client_golang v1.11.0 + go.etcd.io/etcd/api/v3 v3.5.0 + go.etcd.io/etcd/client/pkg/v3 v3.5.0 + go.uber.org/zap v1.17.0 + google.golang.org/grpc v1.38.0 + sigs.k8s.io/yaml v1.2.0 +) + +replace ( + go.etcd.io/etcd/api/v3 => ../../api + go.etcd.io/etcd/client/pkg/v3 => ../pkg +) + +// Bad imports are sometimes causing attempts to pull that code. +// This makes the error more explicit. +replace ( + go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY + go.etcd.io/etcd/pkg/v3 => ./FORBIDDEN_DEPENDENCY + go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY + go.etcd.io/tests/v3 => ./FORBIDDEN_DEPENDENCY +) diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/go.sum b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/go.sum new file mode 100644 index 000000000000..b57fc4fb3491 --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/go.sum @@ -0,0 +1,269 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +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/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +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/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +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= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/internal/endpoint/endpoint.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/internal/endpoint/endpoint.go new file mode 100644 index 000000000000..1d3f1a7a2c7f --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/internal/endpoint/endpoint.go @@ -0,0 +1,137 @@ +// Copyright 2021 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package endpoint + +import ( + "fmt" + "net" + "net/url" + "path" + "strings" +) + +type CredsRequirement int + +const ( + // CREDS_REQUIRE - Credentials/certificate required for thi type of connection. + CREDS_REQUIRE CredsRequirement = iota + // CREDS_DROP - Credentials/certificate not needed and should get ignored. + CREDS_DROP + // CREDS_OPTIONAL - Credentials/certificate might be used if supplied + CREDS_OPTIONAL +) + +func extractHostFromHostPort(ep string) string { + host, _, err := net.SplitHostPort(ep) + if err != nil { + return ep + } + return host +} + +func extractHostFromPath(pathStr string) string { + return extractHostFromHostPort(path.Base(pathStr)) +} + +//mustSplit2 returns the values from strings.SplitN(s, sep, 2). +//If sep is not found, it returns ("", "", false) instead. +func mustSplit2(s, sep string) (string, string) { + spl := strings.SplitN(s, sep, 2) + if len(spl) < 2 { + panic(fmt.Errorf("token '%v' expected to have separator sep: `%v`", s, sep)) + } + return spl[0], spl[1] +} + +func schemeToCredsRequirement(schema string) CredsRequirement { + switch schema { + case "https", "unixs": + return CREDS_REQUIRE + case "http": + return CREDS_DROP + case "unix": + // Preserving previous behavior from: + // https://github.com/etcd-io/etcd/blob/dae29bb719dd69dc119146fc297a0628fcc1ccf8/client/v3/client.go#L212 + // that likely was a bug due to missing 'fallthrough'. + // At the same time it seems legit to let the users decide whether they + // want credential control or not (and 'unixs' schema is not a standard thing). + return CREDS_OPTIONAL + case "": + return CREDS_OPTIONAL + default: + return CREDS_OPTIONAL + } +} + +// This function translates endpoints names supported by etcd server into +// endpoints as supported by grpc with additional information +// (server_name for cert validation, requireCreds - whether certs are needed). +// The main differences: +// - etcd supports unixs & https names as opposed to unix & http to +// distinguish need to configure certificates. +// - etcd support http(s) names as opposed to tcp supported by grpc/dial method. +// - etcd supports unix(s)://local-file naming schema +// (as opposed to unix:local-file canonical name used by grpc for current dir files). +// - Within the unix(s) schemas, the last segment (filename) without 'port' (content after colon) +// is considered serverName - to allow local testing of cert-protected communication. +// See more: +// - https://github.com/grpc/grpc-go/blob/26c143bd5f59344a4b8a1e491e0f5e18aa97abc7/internal/grpcutil/target.go#L47 +// - https://golang.org/pkg/net/#Dial +// - https://github.com/grpc/grpc/blob/master/doc/naming.md +func translateEndpoint(ep string) (addr string, serverName string, requireCreds CredsRequirement) { + if strings.HasPrefix(ep, "unix:") || strings.HasPrefix(ep, "unixs:") { + if strings.HasPrefix(ep, "unix:///") || strings.HasPrefix(ep, "unixs:///") { + // absolute path case + schema, absolutePath := mustSplit2(ep, "://") + return "unix://" + absolutePath, extractHostFromPath(absolutePath), schemeToCredsRequirement(schema) + } + if strings.HasPrefix(ep, "unix://") || strings.HasPrefix(ep, "unixs://") { + // legacy etcd local path + schema, localPath := mustSplit2(ep, "://") + return "unix:" + localPath, extractHostFromPath(localPath), schemeToCredsRequirement(schema) + } + schema, localPath := mustSplit2(ep, ":") + return "unix:" + localPath, extractHostFromPath(localPath), schemeToCredsRequirement(schema) + } + + if strings.Contains(ep, "://") { + url, err := url.Parse(ep) + if err != nil { + return ep, extractHostFromHostPort(ep), CREDS_OPTIONAL + } + if url.Scheme == "http" || url.Scheme == "https" { + return url.Host, url.Hostname(), schemeToCredsRequirement(url.Scheme) + } + return ep, url.Hostname(), schemeToCredsRequirement(url.Scheme) + } + // Handles plain addresses like 10.0.0.44:437. + return ep, extractHostFromHostPort(ep), CREDS_OPTIONAL +} + +// RequiresCredentials returns whether given endpoint requires +// credentials/certificates for connection. +func RequiresCredentials(ep string) CredsRequirement { + _, _, requireCreds := translateEndpoint(ep) + return requireCreds +} + +// Interpret endpoint parses an endpoint of the form +// (http|https)://*|(unix|unixs)://) +// and returns low-level address (supported by 'net') to connect to, +// and a server name used for x509 certificate matching. +func Interpret(ep string) (address string, serverName string) { + addr, serverName, _ := translateEndpoint(ep) + return addr, serverName +} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/internal/resolver/resolver.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/internal/resolver/resolver.go new file mode 100644 index 000000000000..3ee3cb8e2bb9 --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/internal/resolver/resolver.go @@ -0,0 +1,74 @@ +// Copyright 2021 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resolver + +import ( + "go.etcd.io/etcd/client/v3/internal/endpoint" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/resolver/manual" + "google.golang.org/grpc/serviceconfig" +) + +const ( + Schema = "etcd-endpoints" +) + +// EtcdManualResolver is a Resolver (and resolver.Builder) that can be updated +// using SetEndpoints. +type EtcdManualResolver struct { + *manual.Resolver + endpoints []string + serviceConfig *serviceconfig.ParseResult +} + +func New(endpoints ...string) *EtcdManualResolver { + r := manual.NewBuilderWithScheme(Schema) + return &EtcdManualResolver{Resolver: r, endpoints: endpoints, serviceConfig: nil} +} + +// Build returns itself for Resolver, because it's both a builder and a resolver. +func (r *EtcdManualResolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { + r.serviceConfig = cc.ParseServiceConfig(`{"loadBalancingPolicy": "round_robin"}`) + if r.serviceConfig.Err != nil { + return nil, r.serviceConfig.Err + } + res, err := r.Resolver.Build(target, cc, opts) + if err != nil { + return nil, err + } + // Populates endpoints stored in r into ClientConn (cc). + r.updateState() + return res, nil +} + +func (r *EtcdManualResolver) SetEndpoints(endpoints []string) { + r.endpoints = endpoints + r.updateState() +} + +func (r EtcdManualResolver) updateState() { + if r.CC != nil { + addresses := make([]resolver.Address, len(r.endpoints)) + for i, ep := range r.endpoints { + addr, serverName := endpoint.Interpret(ep) + addresses[i] = resolver.Address{Addr: addr, ServerName: serverName} + } + state := resolver.State{ + Addresses: addresses, + ServiceConfig: r.serviceConfig, + } + r.UpdateState(state) + } +} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/kv.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/kv.go similarity index 99% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/kv.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/kv.go index 2b7864ad8b0b..5e9fb7d45896 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/kv.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/kv.go @@ -17,7 +17,7 @@ package clientv3 import ( "context" - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" "google.golang.org/grpc" ) diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/lease.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/lease.go similarity index 97% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/lease.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/lease.go index c2796fc969af..bd31e6b4a5b4 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/lease.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/lease.go @@ -19,8 +19,8 @@ import ( "sync" "time" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" "go.uber.org/zap" "google.golang.org/grpc" @@ -238,17 +238,17 @@ func (l *lessor) Revoke(ctx context.Context, id LeaseID) (*LeaseRevokeResponse, func (l *lessor) TimeToLive(ctx context.Context, id LeaseID, opts ...LeaseOption) (*LeaseTimeToLiveResponse, error) { r := toLeaseTimeToLiveRequest(id, opts...) resp, err := l.remote.LeaseTimeToLive(ctx, r, l.callOpts...) - if err == nil { - gresp := &LeaseTimeToLiveResponse{ - ResponseHeader: resp.GetHeader(), - ID: LeaseID(resp.ID), - TTL: resp.TTL, - GrantedTTL: resp.GrantedTTL, - Keys: resp.Keys, - } - return gresp, nil + if err != nil { + return nil, toErr(ctx, err) } - return nil, toErr(ctx, err) + gresp := &LeaseTimeToLiveResponse{ + ResponseHeader: resp.GetHeader(), + ID: LeaseID(resp.ID), + TTL: resp.TTL, + GrantedTTL: resp.GrantedTTL, + Keys: resp.Keys, + } + return gresp, nil } func (l *lessor) Leases(ctx context.Context) (*LeaseLeasesResponse, error) { diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/logger.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/logger.go new file mode 100644 index 000000000000..71a9e161ce84 --- /dev/null +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/logger.go @@ -0,0 +1,77 @@ +// Copyright 2016 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package clientv3 + +import ( + "log" + "os" + + "go.etcd.io/etcd/client/pkg/v3/logutil" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "go.uber.org/zap/zapgrpc" + "google.golang.org/grpc/grpclog" +) + +func init() { + // We override grpc logger only when the environment variable is set + // in order to not interfere by default with user's code or other libraries. + if os.Getenv("ETCD_CLIENT_DEBUG") != "" { + lg, err := CreateDefaultZapLogger() + if err != nil { + panic(err) + } + grpclog.SetLoggerV2(zapgrpc.NewLogger(lg)) + } +} + +// SetLogger sets grpc logger. +// +// Deprecated: use grpclog.SetLoggerV2 directly or grpc_zap.ReplaceGrpcLoggerV2. +func SetLogger(l grpclog.LoggerV2) { + grpclog.SetLoggerV2(l) +} + +// etcdClientDebugLevel translates ETCD_CLIENT_DEBUG into zap log level. +func etcdClientDebugLevel() zapcore.Level { + envLevel := os.Getenv("ETCD_CLIENT_DEBUG") + if envLevel == "" || envLevel == "true" { + return zapcore.InfoLevel + } + var l zapcore.Level + if err := l.Set(envLevel); err == nil { + log.Printf("Deprecated env ETCD_CLIENT_DEBUG value. Using default level: 'info'") + return zapcore.InfoLevel + } + return l +} + +// CreateDefaultZapLoggerConfig creates a logger config that is configurable using env variable: +// ETCD_CLIENT_DEBUG= debug|info|warn|error|dpanic|panic|fatal|true (true=info) +func CreateDefaultZapLoggerConfig() zap.Config { + lcfg := logutil.DefaultZapLoggerConfig + lcfg.Level = zap.NewAtomicLevelAt(etcdClientDebugLevel()) + return lcfg +} + +// CreateDefaultZapLogger creates a logger that is configurable using env variable: +// ETCD_CLIENT_DEBUG= debug|info|warn|error|dpanic|panic|fatal|true (true=info) +func CreateDefaultZapLogger() (*zap.Logger, error) { + c, err := CreateDefaultZapLoggerConfig().Build() + if err != nil { + return nil, err + } + return c.Named("etcd-client"), nil +} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/maintenance.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/maintenance.go similarity index 94% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/maintenance.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/maintenance.go index 809b8a3b4ba4..dbea530e66a2 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/maintenance.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/maintenance.go @@ -19,9 +19,8 @@ import ( "fmt" "io" - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" "go.uber.org/zap" - "google.golang.org/grpc" ) @@ -83,7 +82,19 @@ func NewMaintenance(c *Client) Maintenance { if err != nil { return nil, nil, fmt.Errorf("failed to dial endpoint %s with maintenance client: %v", endpoint, err) } - cancel := func() { conn.Close() } + + //get token with established connection + dctx := c.ctx + cancel := func() {} + if c.cfg.DialTimeout > 0 { + dctx, cancel = context.WithTimeout(c.ctx, c.cfg.DialTimeout) + } + err = c.getToken(dctx) + cancel() + if err != nil { + return nil, nil, fmt.Errorf("failed to getToken from endpoint %s with maintenance client: %v", endpoint, err) + } + cancel = func() { conn.Close() } return RetryMaintenanceClient(c, conn), cancel, nil }, remote: RetryMaintenanceClient(c, c.conn), diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/op.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/op.go similarity index 97% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/op.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/op.go index 81ae31fd8f32..bd0f1f2f2136 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/op.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/op.go @@ -14,7 +14,7 @@ package clientv3 -import pb "go.etcd.io/etcd/etcdserver/etcdserverpb" +import pb "go.etcd.io/etcd/api/v3/etcdserverpb" type opType int @@ -219,7 +219,7 @@ func (op Op) isWrite() bool { // OpGet returns "get" operation based on given key and operation options. func OpGet(key string, opts ...OpOption) Op { // WithPrefix and WithFromKey are not supported together - if isWithPrefix(opts) && isWithFromKey(opts) { + if IsOptsWithPrefix(opts) && IsOptsWithFromKey(opts) { panic("`WithPrefix` and `WithFromKey` cannot be set at the same time, choose one") } ret := Op{t: tRange, key: []byte(key)} @@ -230,7 +230,7 @@ func OpGet(key string, opts ...OpOption) Op { // OpDelete returns "delete" operation based on given key and operation options. func OpDelete(key string, opts ...OpOption) Op { // WithPrefix and WithFromKey are not supported together - if isWithPrefix(opts) && isWithFromKey(opts) { + if IsOptsWithPrefix(opts) && IsOptsWithFromKey(opts) { panic("`WithPrefix` and `WithFromKey` cannot be set at the same time, choose one") } ret := Op{t: tDeleteRange, key: []byte(key)} @@ -553,8 +553,8 @@ func toLeaseTimeToLiveRequest(id LeaseID, opts ...LeaseOption) *pb.LeaseTimeToLi return &pb.LeaseTimeToLiveRequest{ID: int64(id), Keys: ret.attachedKeys} } -// isWithPrefix returns true if WithPrefix is being called in the op -func isWithPrefix(opts []OpOption) bool { return isOpFuncCalled("WithPrefix", opts) } +// IsOptsWithPrefix returns true if WithPrefix option is called in the given opts. +func IsOptsWithPrefix(opts []OpOption) bool { return isOpFuncCalled("WithPrefix", opts) } -// isWithFromKey returns true if WithFromKey is being called in the op -func isWithFromKey(opts []OpOption) bool { return isOpFuncCalled("WithFromKey", opts) } +// IsOptsWithFromKey returns true if WithFromKey option is called in the given opts. +func IsOptsWithFromKey(opts []OpOption) bool { return isOpFuncCalled("WithFromKey", opts) } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/options.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/options.go similarity index 89% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/options.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/options.go index 700714c08637..cdae1b16a2aa 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/options.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/options.go @@ -23,10 +23,10 @@ import ( var ( // client-side handling retrying of request failures where data was not written to the wire or - // where server indicates it did not process the data. gRPC default is default is "FailFast(true)" - // but for etcd we default to "FailFast(false)" to minimize client request error responses due to + // where server indicates it did not process the data. gRPC default is default is "WaitForReady(false)" + // but for etcd we default to "WaitForReady(true)" to minimize client request error responses due to // transient failures. - defaultFailFast = grpc.FailFast(false) + defaultWaitForReady = grpc.WaitForReady(true) // client-side request send limit, gRPC default is math.MaxInt32 // Make sure that "client-side send limit < server-side default send/recv limit" @@ -59,7 +59,11 @@ var ( // defaultCallOpts defines a list of default "gRPC.CallOption". // Some options are exposed to "clientv3.Config". // Defaults will be overridden by the settings in "clientv3.Config". -var defaultCallOpts = []grpc.CallOption{defaultFailFast, defaultMaxCallSendMsgSize, defaultMaxCallRecvMsgSize} +var defaultCallOpts = []grpc.CallOption{ + defaultWaitForReady, + defaultMaxCallSendMsgSize, + defaultMaxCallRecvMsgSize, +} // MaxLeaseTTL is the maximum lease TTL value const MaxLeaseTTL = 9000000000 diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/retry.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/retry.go similarity index 96% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/retry.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/retry.go index 7e855de066a8..69ecc6314719 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/retry.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/retry.go @@ -17,8 +17,8 @@ package clientv3 import ( "context" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -222,6 +222,10 @@ func (rmc *retryMaintenanceClient) Defragment(ctx context.Context, in *pb.Defrag return rmc.mc.Defragment(ctx, in, opts...) } +func (rmc *retryMaintenanceClient) Downgrade(ctx context.Context, in *pb.DowngradeRequest, opts ...grpc.CallOption) (resp *pb.DowngradeResponse, err error) { + return rmc.mc.Downgrade(ctx, in, opts...) +} + type retryAuthClient struct { ac pb.AuthClient } @@ -257,6 +261,10 @@ func (rac *retryAuthClient) AuthDisable(ctx context.Context, in *pb.AuthDisableR return rac.ac.AuthDisable(ctx, in, opts...) } +func (rac *retryAuthClient) AuthStatus(ctx context.Context, in *pb.AuthStatusRequest, opts ...grpc.CallOption) (resp *pb.AuthStatusResponse, err error) { + return rac.ac.AuthStatus(ctx, in, opts...) +} + func (rac *retryAuthClient) UserAdd(ctx context.Context, in *pb.AuthUserAddRequest, opts ...grpc.CallOption) (resp *pb.AuthUserAddResponse, err error) { return rac.ac.UserAdd(ctx, in, opts...) } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/retry_interceptor.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go similarity index 89% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/retry_interceptor.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go index 2c266e55bec0..9586c334a3d5 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/retry_interceptor.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go @@ -23,7 +23,7 @@ import ( "sync" "time" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -35,7 +35,7 @@ import ( // // The default configuration of the interceptor is to not retry *at all*. This behaviour can be // changed through options (e.g. WithMax) on creation of the interceptor or on call (through grpc.CallOptions). -func (c *Client) unaryClientInterceptor(logger *zap.Logger, optFuncs ...retryOption) grpc.UnaryClientInterceptor { +func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClientInterceptor { intOpts := reuseOrNewWithCallOptions(defaultOptions, optFuncs) return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { ctx = withVersion(ctx) @@ -50,7 +50,7 @@ func (c *Client) unaryClientInterceptor(logger *zap.Logger, optFuncs ...retryOpt if err := waitRetryBackoff(ctx, attempt, callOpts); err != nil { return err } - logger.Debug( + c.GetLogger().Debug( "retrying of unary invoker", zap.String("target", cc.Target()), zap.Uint("attempt", attempt), @@ -59,7 +59,7 @@ func (c *Client) unaryClientInterceptor(logger *zap.Logger, optFuncs ...retryOpt if lastErr == nil { return nil } - logger.Warn( + c.GetLogger().Warn( "retrying of unary invoker failed", zap.String("target", cc.Target()), zap.Uint("attempt", attempt), @@ -74,9 +74,15 @@ func (c *Client) unaryClientInterceptor(logger *zap.Logger, optFuncs ...retryOpt continue } if callOpts.retryAuth && rpctypes.Error(lastErr) == rpctypes.ErrInvalidAuthToken { + // clear auth token before refreshing it. + // call c.Auth.Authenticate with an invalid token will always fail the auth check on the server-side, + // if the server has not apply the patch of pr #12165 (https://github.com/etcd-io/etcd/pull/12165) + // and a rpctypes.ErrInvalidAuthToken will recursively call c.getToken until system run out of resource. + c.authTokenBundle.UpdateAuthToken("") + gterr := c.getToken(ctx) if gterr != nil { - logger.Warn( + c.GetLogger().Warn( "retrying of unary invoker failed to fetch new auth token", zap.String("target", cc.Target()), zap.Error(gterr), @@ -101,10 +107,20 @@ func (c *Client) unaryClientInterceptor(logger *zap.Logger, optFuncs ...retryOpt // Retry logic is available *only for ServerStreams*, i.e. 1:n streams, as the internal logic needs // to buffer the messages sent by the client. If retry is enabled on any other streams (ClientStreams, // BidiStreams), the retry interceptor will fail the call. -func (c *Client) streamClientInterceptor(logger *zap.Logger, optFuncs ...retryOption) grpc.StreamClientInterceptor { +func (c *Client) streamClientInterceptor(optFuncs ...retryOption) grpc.StreamClientInterceptor { intOpts := reuseOrNewWithCallOptions(defaultOptions, optFuncs) return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { ctx = withVersion(ctx) + // getToken automatically + // TODO(cfc4n): keep this code block, remove codes about getToken in client.go after pr #12165 merged. + if c.authTokenBundle != nil { + // equal to c.Username != "" && c.Password != "" + err := c.getToken(ctx) + if err != nil && rpctypes.Error(err) != rpctypes.ErrAuthNotEnabled { + c.GetLogger().Error("clientv3/retry_interceptor: getToken failed", zap.Error(err)) + return nil, err + } + } grpcOpts, retryOpts := filterCallOptions(opts) callOpts := reuseOrNewWithCallOptions(intOpts, retryOpts) // short circuit for simplicity, and avoiding allocations. @@ -116,7 +132,7 @@ func (c *Client) streamClientInterceptor(logger *zap.Logger, optFuncs ...retryOp } newStreamer, err := streamer(ctx, desc, cc, method, grpcOpts...) if err != nil { - logger.Error("streamer failed to create ClientStream", zap.Error(err)) + c.GetLogger().Error("streamer failed to create ClientStream", zap.Error(err)) return nil, err // TODO(mwitkow): Maybe dial and transport errors should be retriable? } retryingStreamer := &serverStreamingRetryingStream{ @@ -230,6 +246,9 @@ func (s *serverStreamingRetryingStream) receiveMsgAndIndicateRetry(m interface{} return true, err } if s.callOpts.retryAuth && rpctypes.Error(err) == rpctypes.ErrInvalidAuthToken { + // clear auth token to avoid failure when call getToken + s.client.authTokenBundle.UpdateAuthToken("") + gterr := s.client.getToken(s.ctx) if gterr != nil { s.client.lg.Warn("retry failed to fetch new auth token", zap.Error(gterr)) @@ -294,7 +313,7 @@ func isSafeRetry(lg *zap.Logger, err error, callOpts *options) bool { } func isContextError(err error) bool { - return grpc.Code(err) == codes.DeadlineExceeded || grpc.Code(err) == codes.Canceled + return status.Code(err) == codes.DeadlineExceeded || status.Code(err) == codes.Canceled } func contextErrToGrpcErr(err error) error { diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/sort.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/sort.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/sort.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/sort.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/txn.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/txn.go similarity index 98% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/txn.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/txn.go index c19715da438e..22301fba6b14 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/txn.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/txn.go @@ -18,7 +18,7 @@ import ( "context" "sync" - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" "google.golang.org/grpc" ) diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/utils.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/utils.go similarity index 100% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/utils.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/utils.go diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/watch.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/watch.go similarity index 92% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/watch.go rename to cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/watch.go index 66e16ad63fe9..b73925ba128a 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/watch.go +++ b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/v3/watch.go @@ -21,9 +21,9 @@ import ( "sync" "time" - v3rpc "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" - mvccpb "go.etcd.io/etcd/mvcc/mvccpb" + pb "go.etcd.io/etcd/api/v3/etcdserverpb" + "go.etcd.io/etcd/api/v3/mvccpb" + v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" "go.uber.org/zap" "google.golang.org/grpc" @@ -48,6 +48,8 @@ type Watcher interface { // through the returned channel. If revisions waiting to be sent over the // watch are compacted, then the watch will be canceled by the server, the // client will post a compacted error watch response, and the channel will close. + // If the requested revision is 0 or unspecified, the returned channel will + // return watch events that happen after the server receives the watch request. // If the context "ctx" is canceled or timed out, returned "WatchChan" is closed, // and "WatchResponse" from this closed channel has zero events and nil "Err()". // The context "ctx" MUST be canceled, as soon as watcher is no longer being used, @@ -137,7 +139,7 @@ type watcher struct { callOpts []grpc.CallOption // mu protects the grpc streams map - mu sync.RWMutex + mu sync.Mutex // streams holds all the active grpc streams keyed by ctx value. streams map[string]*watchGrpcStream @@ -312,55 +314,63 @@ func (w *watcher) Watch(ctx context.Context, key string, opts ...OpOption) Watch ok := false ctxKey := streamKeyFromCtx(ctx) - // find or allocate appropriate grpc watch stream - w.mu.Lock() - if w.streams == nil { - // closed + var closeCh chan WatchResponse + for { + // find or allocate appropriate grpc watch stream + w.mu.Lock() + if w.streams == nil { + // closed + w.mu.Unlock() + ch := make(chan WatchResponse) + close(ch) + return ch + } + wgs := w.streams[ctxKey] + if wgs == nil { + wgs = w.newWatcherGrpcStream(ctx) + w.streams[ctxKey] = wgs + } + donec := wgs.donec + reqc := wgs.reqc w.mu.Unlock() - ch := make(chan WatchResponse) - close(ch) - return ch - } - wgs := w.streams[ctxKey] - if wgs == nil { - wgs = w.newWatcherGrpcStream(ctx) - w.streams[ctxKey] = wgs - } - donec := wgs.donec - reqc := wgs.reqc - w.mu.Unlock() - - // couldn't create channel; return closed channel - closeCh := make(chan WatchResponse, 1) - // submit request - select { - case reqc <- wr: - ok = true - case <-wr.ctx.Done(): - case <-donec: - if wgs.closeErr != nil { - closeCh <- WatchResponse{Canceled: true, closeErr: wgs.closeErr} - break + // couldn't create channel; return closed channel + if closeCh == nil { + closeCh = make(chan WatchResponse, 1) } - // retry; may have dropped stream from no ctxs - return w.Watch(ctx, key, opts...) - } - // receive channel - if ok { + // submit request select { - case ret := <-wr.retc: - return ret - case <-ctx.Done(): + case reqc <- wr: + ok = true + case <-wr.ctx.Done(): + ok = false case <-donec: + ok = false if wgs.closeErr != nil { closeCh <- WatchResponse{Canceled: true, closeErr: wgs.closeErr} break } // retry; may have dropped stream from no ctxs - return w.Watch(ctx, key, opts...) + continue } + + // receive channel + if ok { + select { + case ret := <-wr.retc: + return ret + case <-ctx.Done(): + case <-donec: + if wgs.closeErr != nil { + closeCh <- WatchResponse{Canceled: true, closeErr: wgs.closeErr} + break + } + // retry; may have dropped stream from no ctxs + continue + } + } + break } close(closeCh) @@ -408,10 +418,7 @@ func (w *watcher) RequestProgress(ctx context.Context) (err error) { case reqc <- pr: return nil case <-ctx.Done(): - if err == nil { - return ctx.Err() - } - return err + return ctx.Err() case <-donec: if wgs.closeErr != nil { return wgs.closeErr @@ -551,16 +558,12 @@ func (w *watchGrpcStream) run() { if len(w.resuming) == 1 { // head of resume queue, can register a new watcher if err := wc.Send(ws.initReq.toPB()); err != nil { - if w.lg != nil { - w.lg.Debug("error when sending request", zap.Error(err)) - } + w.lg.Debug("error when sending request", zap.Error(err)) } } case *progressRequest: if err := wc.Send(wreq.toPB()); err != nil { - if w.lg != nil { - w.lg.Debug("error when sending request", zap.Error(err)) - } + w.lg.Debug("error when sending request", zap.Error(err)) } } @@ -578,17 +581,17 @@ func (w *watchGrpcStream) run() { switch { case pbresp.Created: // response to head of queue creation - if ws := w.resuming[0]; ws != nil { - w.addSubstream(pbresp, ws) - w.dispatchEvent(pbresp) - w.resuming[0] = nil + if len(w.resuming) != 0 { + if ws := w.resuming[0]; ws != nil { + w.addSubstream(pbresp, ws) + w.dispatchEvent(pbresp) + w.resuming[0] = nil + } } if ws := w.nextResume(); ws != nil { if err := wc.Send(ws.initReq.toPB()); err != nil { - if w.lg != nil { - w.lg.Debug("error when sending request", zap.Error(err)) - } + w.lg.Debug("error when sending request", zap.Error(err)) } } @@ -634,13 +637,9 @@ func (w *watchGrpcStream) run() { }, } req := &pb.WatchRequest{RequestUnion: cr} - if w.lg != nil { - w.lg.Debug("sending watch cancel request for failed dispatch", zap.Int64("watch-id", pbresp.WatchId)) - } + w.lg.Debug("sending watch cancel request for failed dispatch", zap.Int64("watch-id", pbresp.WatchId)) if err := wc.Send(req); err != nil { - if w.lg != nil { - w.lg.Debug("failed to send watch cancel request", zap.Int64("watch-id", pbresp.WatchId), zap.Error(err)) - } + w.lg.Debug("failed to send watch cancel request", zap.Int64("watch-id", pbresp.WatchId), zap.Error(err)) } } @@ -655,9 +654,7 @@ func (w *watchGrpcStream) run() { } if ws := w.nextResume(); ws != nil { if err := wc.Send(ws.initReq.toPB()); err != nil { - if w.lg != nil { - w.lg.Debug("error when sending request", zap.Error(err)) - } + w.lg.Debug("error when sending request", zap.Error(err)) } } cancelSet = make(map[int64]struct{}) @@ -666,6 +663,12 @@ func (w *watchGrpcStream) run() { return case ws := <-w.closingc: + w.closeSubstream(ws) + delete(closing, ws) + // no more watchers on this stream, shutdown, skip cancellation + if len(w.substreams)+len(w.resuming) == 0 { + return + } if ws.id != -1 { // client is closing an established watch; close it on the server proactively instead of waiting // to close when the next message arrives @@ -676,21 +679,11 @@ func (w *watchGrpcStream) run() { }, } req := &pb.WatchRequest{RequestUnion: cr} - if w.lg != nil { - w.lg.Debug("sending watch cancel request for closed watcher", zap.Int64("watch-id", ws.id)) - } + w.lg.Debug("sending watch cancel request for closed watcher", zap.Int64("watch-id", ws.id)) if err := wc.Send(req); err != nil { - if w.lg != nil { - w.lg.Debug("failed to send watch cancel request", zap.Int64("watch-id", ws.id), zap.Error(err)) - } + w.lg.Debug("failed to send watch cancel request", zap.Int64("watch-id", ws.id), zap.Error(err)) } } - w.closeSubstream(ws) - delete(closing, ws) - // no more watchers on this stream, shutdown - if len(w.substreams)+len(w.resuming) == 0 { - return - } } } } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/balancer.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/balancer.go deleted file mode 100644 index d02a7eec7c37..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/balancer.go +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package balancer implements client balancer. -package balancer - -import ( - "strconv" - "sync" - "time" - - "go.etcd.io/etcd/clientv3/balancer/connectivity" - "go.etcd.io/etcd/clientv3/balancer/picker" - - "go.uber.org/zap" - "google.golang.org/grpc/balancer" - grpcconnectivity "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/resolver" - _ "google.golang.org/grpc/resolver/dns" // register DNS resolver - _ "google.golang.org/grpc/resolver/passthrough" // register passthrough resolver -) - -// Config defines balancer configurations. -type Config struct { - // Policy configures balancer policy. - Policy picker.Policy - - // Picker implements gRPC picker. - // Leave empty if "Policy" field is not custom. - // TODO: currently custom policy is not supported. - // Picker picker.Picker - - // Name defines an additional name for balancer. - // Useful for balancer testing to avoid register conflicts. - // If empty, defaults to policy name. - Name string - - // Logger configures balancer logging. - // If nil, logs are discarded. - Logger *zap.Logger -} - -// RegisterBuilder creates and registers a builder. Since this function calls balancer.Register, it -// must be invoked at initialization time. -func RegisterBuilder(cfg Config) { - bb := &builder{cfg} - balancer.Register(bb) - - bb.cfg.Logger.Debug( - "registered balancer", - zap.String("policy", bb.cfg.Policy.String()), - zap.String("name", bb.cfg.Name), - ) -} - -type builder struct { - cfg Config -} - -// Build is called initially when creating "ccBalancerWrapper". -// "grpc.Dial" is called to this client connection. -// Then, resolved addresses will be handled via "HandleResolvedAddrs". -func (b *builder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer { - bb := &baseBalancer{ - id: strconv.FormatInt(time.Now().UnixNano(), 36), - policy: b.cfg.Policy, - name: b.cfg.Name, - lg: b.cfg.Logger, - - addrToSc: make(map[resolver.Address]balancer.SubConn), - scToAddr: make(map[balancer.SubConn]resolver.Address), - scToSt: make(map[balancer.SubConn]grpcconnectivity.State), - - currentConn: nil, - connectivityRecorder: connectivity.New(b.cfg.Logger), - - // initialize picker always returns "ErrNoSubConnAvailable" - picker: picker.NewErr(balancer.ErrNoSubConnAvailable), - } - - // TODO: support multiple connections - bb.mu.Lock() - bb.currentConn = cc - bb.mu.Unlock() - - bb.lg.Info( - "built balancer", - zap.String("balancer-id", bb.id), - zap.String("policy", bb.policy.String()), - zap.String("resolver-target", cc.Target()), - ) - return bb -} - -// Name implements "grpc/balancer.Builder" interface. -func (b *builder) Name() string { return b.cfg.Name } - -// Balancer defines client balancer interface. -type Balancer interface { - // Balancer is called on specified client connection. Client initiates gRPC - // connection with "grpc.Dial(addr, grpc.WithBalancerName)", and then those resolved - // addresses are passed to "grpc/balancer.Balancer.HandleResolvedAddrs". - // For each resolved address, balancer calls "balancer.ClientConn.NewSubConn". - // "grpc/balancer.Balancer.HandleSubConnStateChange" is called when connectivity state - // changes, thus requires failover logic in this method. - balancer.Balancer - - // Picker calls "Pick" for every client request. - picker.Picker -} - -type baseBalancer struct { - id string - policy picker.Policy - name string - lg *zap.Logger - - mu sync.RWMutex - - addrToSc map[resolver.Address]balancer.SubConn - scToAddr map[balancer.SubConn]resolver.Address - scToSt map[balancer.SubConn]grpcconnectivity.State - - currentConn balancer.ClientConn - connectivityRecorder connectivity.Recorder - - picker picker.Picker -} - -// HandleResolvedAddrs implements "grpc/balancer.Balancer" interface. -// gRPC sends initial or updated resolved addresses from "Build". -func (bb *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) { - if err != nil { - bb.lg.Warn("HandleResolvedAddrs called with error", zap.String("balancer-id", bb.id), zap.Error(err)) - return - } - bb.lg.Info("resolved", - zap.String("picker", bb.picker.String()), - zap.String("balancer-id", bb.id), - zap.Strings("addresses", addrsToStrings(addrs)), - ) - - bb.mu.Lock() - defer bb.mu.Unlock() - - resolved := make(map[resolver.Address]struct{}) - for _, addr := range addrs { - resolved[addr] = struct{}{} - if _, ok := bb.addrToSc[addr]; !ok { - sc, err := bb.currentConn.NewSubConn([]resolver.Address{addr}, balancer.NewSubConnOptions{}) - if err != nil { - bb.lg.Warn("NewSubConn failed", zap.String("picker", bb.picker.String()), zap.String("balancer-id", bb.id), zap.Error(err), zap.String("address", addr.Addr)) - continue - } - bb.lg.Info("created subconn", zap.String("address", addr.Addr)) - bb.addrToSc[addr] = sc - bb.scToAddr[sc] = addr - bb.scToSt[sc] = grpcconnectivity.Idle - sc.Connect() - } - } - - for addr, sc := range bb.addrToSc { - if _, ok := resolved[addr]; !ok { - // was removed by resolver or failed to create subconn - bb.currentConn.RemoveSubConn(sc) - delete(bb.addrToSc, addr) - - bb.lg.Info( - "removed subconn", - zap.String("picker", bb.picker.String()), - zap.String("balancer-id", bb.id), - zap.String("address", addr.Addr), - zap.String("subconn", scToString(sc)), - ) - - // Keep the state of this sc in bb.scToSt until sc's state becomes Shutdown. - // The entry will be deleted in HandleSubConnStateChange. - // (DO NOT) delete(bb.scToAddr, sc) - // (DO NOT) delete(bb.scToSt, sc) - } - } -} - -// HandleSubConnStateChange implements "grpc/balancer.Balancer" interface. -func (bb *baseBalancer) HandleSubConnStateChange(sc balancer.SubConn, s grpcconnectivity.State) { - bb.mu.Lock() - defer bb.mu.Unlock() - - old, ok := bb.scToSt[sc] - if !ok { - bb.lg.Warn( - "state change for an unknown subconn", - zap.String("picker", bb.picker.String()), - zap.String("balancer-id", bb.id), - zap.String("subconn", scToString(sc)), - zap.Int("subconn-size", len(bb.scToAddr)), - zap.String("state", s.String()), - ) - return - } - - bb.lg.Info( - "state changed", - zap.String("picker", bb.picker.String()), - zap.String("balancer-id", bb.id), - zap.Bool("connected", s == grpcconnectivity.Ready), - zap.String("subconn", scToString(sc)), - zap.Int("subconn-size", len(bb.scToAddr)), - zap.String("address", bb.scToAddr[sc].Addr), - zap.String("old-state", old.String()), - zap.String("new-state", s.String()), - ) - - bb.scToSt[sc] = s - switch s { - case grpcconnectivity.Idle: - sc.Connect() - case grpcconnectivity.Shutdown: - // When an address was removed by resolver, b called RemoveSubConn but - // kept the sc's state in scToSt. Remove state for this sc here. - delete(bb.scToAddr, sc) - delete(bb.scToSt, sc) - } - - oldAggrState := bb.connectivityRecorder.GetCurrentState() - bb.connectivityRecorder.RecordTransition(old, s) - - // Update balancer picker when one of the following happens: - // - this sc became ready from not-ready - // - this sc became not-ready from ready - // - the aggregated state of balancer became TransientFailure from non-TransientFailure - // - the aggregated state of balancer became non-TransientFailure from TransientFailure - if (s == grpcconnectivity.Ready) != (old == grpcconnectivity.Ready) || - (bb.connectivityRecorder.GetCurrentState() == grpcconnectivity.TransientFailure) != (oldAggrState == grpcconnectivity.TransientFailure) { - bb.updatePicker() - } - - bb.currentConn.UpdateBalancerState(bb.connectivityRecorder.GetCurrentState(), bb.picker) -} - -func (bb *baseBalancer) updatePicker() { - if bb.connectivityRecorder.GetCurrentState() == grpcconnectivity.TransientFailure { - bb.picker = picker.NewErr(balancer.ErrTransientFailure) - bb.lg.Info( - "updated picker to transient error picker", - zap.String("picker", bb.picker.String()), - zap.String("balancer-id", bb.id), - zap.String("policy", bb.policy.String()), - ) - return - } - - // only pass ready subconns to picker - scToAddr := make(map[balancer.SubConn]resolver.Address) - for addr, sc := range bb.addrToSc { - if st, ok := bb.scToSt[sc]; ok && st == grpcconnectivity.Ready { - scToAddr[sc] = addr - } - } - - bb.picker = picker.New(picker.Config{ - Policy: bb.policy, - Logger: bb.lg, - SubConnToResolverAddress: scToAddr, - }) - bb.lg.Info( - "updated picker", - zap.String("picker", bb.picker.String()), - zap.String("balancer-id", bb.id), - zap.String("policy", bb.policy.String()), - zap.Strings("subconn-ready", scsToStrings(scToAddr)), - zap.Int("subconn-size", len(scToAddr)), - ) -} - -// Close implements "grpc/balancer.Balancer" interface. -// Close is a nop because base balancer doesn't have internal state to clean up, -// and it doesn't need to call RemoveSubConn for the SubConns. -func (bb *baseBalancer) Close() { - // TODO -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/connectivity/connectivity.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/connectivity/connectivity.go deleted file mode 100644 index 4c4ad363a7cf..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/connectivity/connectivity.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package connectivity implements client connectivity operations. -package connectivity - -import ( - "sync" - - "go.uber.org/zap" - "google.golang.org/grpc/connectivity" -) - -// Recorder records gRPC connectivity. -type Recorder interface { - GetCurrentState() connectivity.State - RecordTransition(oldState, newState connectivity.State) -} - -// New returns a new Recorder. -func New(lg *zap.Logger) Recorder { - return &recorder{lg: lg} -} - -// recorder takes the connectivity states of multiple SubConns -// and returns one aggregated connectivity state. -// ref. https://github.com/grpc/grpc-go/blob/master/balancer/balancer.go -type recorder struct { - lg *zap.Logger - - mu sync.RWMutex - - cur connectivity.State - - numReady uint64 // Number of addrConns in ready state. - numConnecting uint64 // Number of addrConns in connecting state. - numTransientFailure uint64 // Number of addrConns in transientFailure. -} - -func (rc *recorder) GetCurrentState() (state connectivity.State) { - rc.mu.RLock() - defer rc.mu.RUnlock() - return rc.cur -} - -// RecordTransition records state change happening in subConn and based on that -// it evaluates what aggregated state should be. -// -// - If at least one SubConn in Ready, the aggregated state is Ready; -// - Else if at least one SubConn in Connecting, the aggregated state is Connecting; -// - Else the aggregated state is TransientFailure. -// -// Idle and Shutdown are not considered. -// -// ref. https://github.com/grpc/grpc-go/blob/master/balancer/balancer.go -func (rc *recorder) RecordTransition(oldState, newState connectivity.State) { - rc.mu.Lock() - defer rc.mu.Unlock() - - for idx, state := range []connectivity.State{oldState, newState} { - updateVal := 2*uint64(idx) - 1 // -1 for oldState and +1 for new. - switch state { - case connectivity.Ready: - rc.numReady += updateVal - case connectivity.Connecting: - rc.numConnecting += updateVal - case connectivity.TransientFailure: - rc.numTransientFailure += updateVal - default: - rc.lg.Warn("connectivity recorder received unknown state", zap.String("connectivity-state", state.String())) - } - } - - switch { // must be exclusive, no overlap - case rc.numReady > 0: - rc.cur = connectivity.Ready - case rc.numConnecting > 0: - rc.cur = connectivity.Connecting - default: - rc.cur = connectivity.TransientFailure - } -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/picker.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/picker.go deleted file mode 100644 index bd1a5d25e8b8..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/picker.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package picker - -import ( - "fmt" - - "go.uber.org/zap" - "google.golang.org/grpc/balancer" - "google.golang.org/grpc/resolver" -) - -// Picker defines balancer Picker methods. -type Picker interface { - balancer.Picker - String() string -} - -// Config defines picker configuration. -type Config struct { - // Policy specifies etcd clientv3's built in balancer policy. - Policy Policy - - // Logger defines picker logging object. - Logger *zap.Logger - - // SubConnToResolverAddress maps each gRPC sub-connection to an address. - // Basically, it is a list of addresses that the Picker can pick from. - SubConnToResolverAddress map[balancer.SubConn]resolver.Address -} - -// Policy defines balancer picker policy. -type Policy uint8 - -const ( - // Error is error picker policy. - Error Policy = iota - - // RoundrobinBalanced balances loads over multiple endpoints - // and implements failover in roundrobin fashion. - RoundrobinBalanced - - // Custom defines custom balancer picker. - // TODO: custom picker is not supported yet. - Custom -) - -func (p Policy) String() string { - switch p { - case Error: - return "picker-error" - - case RoundrobinBalanced: - return "picker-roundrobin-balanced" - - case Custom: - panic("'custom' picker policy is not supported yet") - - default: - panic(fmt.Errorf("invalid balancer picker policy (%d)", p)) - } -} - -// New creates a new Picker. -func New(cfg Config) Picker { - switch cfg.Policy { - case Error: - panic("'error' picker policy is not supported here; use 'picker.NewErr'") - - case RoundrobinBalanced: - return newRoundrobinBalanced(cfg) - - case Custom: - panic("'custom' picker policy is not supported yet") - - default: - panic(fmt.Errorf("invalid balancer picker policy (%d)", cfg.Policy)) - } -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/roundrobin_balanced.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/roundrobin_balanced.go deleted file mode 100644 index e3971ecc4210..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/roundrobin_balanced.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package picker - -import ( - "context" - "sync" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "google.golang.org/grpc/balancer" - "google.golang.org/grpc/resolver" -) - -// newRoundrobinBalanced returns a new roundrobin balanced picker. -func newRoundrobinBalanced(cfg Config) Picker { - scs := make([]balancer.SubConn, 0, len(cfg.SubConnToResolverAddress)) - for sc := range cfg.SubConnToResolverAddress { - scs = append(scs, sc) - } - return &rrBalanced{ - p: RoundrobinBalanced, - lg: cfg.Logger, - scs: scs, - scToAddr: cfg.SubConnToResolverAddress, - } -} - -type rrBalanced struct { - p Policy - - lg *zap.Logger - - mu sync.RWMutex - next int - scs []balancer.SubConn - scToAddr map[balancer.SubConn]resolver.Address -} - -func (rb *rrBalanced) String() string { return rb.p.String() } - -// Pick is called for every client request. -func (rb *rrBalanced) Pick(ctx context.Context, opts balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { - rb.mu.RLock() - n := len(rb.scs) - rb.mu.RUnlock() - if n == 0 { - return nil, nil, balancer.ErrNoSubConnAvailable - } - - rb.mu.Lock() - cur := rb.next - sc := rb.scs[cur] - picked := rb.scToAddr[sc].Addr - rb.next = (rb.next + 1) % len(rb.scs) - rb.mu.Unlock() - - rb.lg.Debug( - "picked", - zap.String("picker", rb.p.String()), - zap.String("address", picked), - zap.Int("subconn-index", cur), - zap.Int("subconn-size", n), - ) - - doneFunc := func(info balancer.DoneInfo) { - // TODO: error handling? - fss := []zapcore.Field{ - zap.Error(info.Err), - zap.String("picker", rb.p.String()), - zap.String("address", picked), - zap.Bool("success", info.Err == nil), - zap.Bool("bytes-sent", info.BytesSent), - zap.Bool("bytes-received", info.BytesReceived), - } - if info.Err == nil { - rb.lg.Debug("balancer done", fss...) - } else { - rb.lg.Warn("balancer failed", fss...) - } - } - return sc, doneFunc, nil -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/resolver/endpoint/endpoint.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/resolver/endpoint/endpoint.go deleted file mode 100644 index 2837bd4180bd..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/resolver/endpoint/endpoint.go +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package endpoint resolves etcd entpoints using grpc targets of the form 'endpoint:///'. -package endpoint - -import ( - "context" - "fmt" - "net" - "net/url" - "strings" - "sync" - - "google.golang.org/grpc/resolver" -) - -const scheme = "endpoint" - -var ( - targetPrefix = fmt.Sprintf("%s://", scheme) - - bldr *builder -) - -func init() { - bldr = &builder{ - resolverGroups: make(map[string]*ResolverGroup), - } - resolver.Register(bldr) -} - -type builder struct { - mu sync.RWMutex - resolverGroups map[string]*ResolverGroup -} - -// NewResolverGroup creates a new ResolverGroup with the given id. -func NewResolverGroup(id string) (*ResolverGroup, error) { - return bldr.newResolverGroup(id) -} - -// ResolverGroup keeps all endpoints of resolvers using a common endpoint:/// target -// up-to-date. -type ResolverGroup struct { - mu sync.RWMutex - id string - endpoints []string - resolvers []*Resolver -} - -func (e *ResolverGroup) addResolver(r *Resolver) { - e.mu.Lock() - addrs := epsToAddrs(e.endpoints...) - e.resolvers = append(e.resolvers, r) - e.mu.Unlock() - r.cc.NewAddress(addrs) -} - -func (e *ResolverGroup) removeResolver(r *Resolver) { - e.mu.Lock() - for i, er := range e.resolvers { - if er == r { - e.resolvers = append(e.resolvers[:i], e.resolvers[i+1:]...) - break - } - } - e.mu.Unlock() -} - -// SetEndpoints updates the endpoints for ResolverGroup. All registered resolver are updated -// immediately with the new endpoints. -func (e *ResolverGroup) SetEndpoints(endpoints []string) { - addrs := epsToAddrs(endpoints...) - e.mu.Lock() - e.endpoints = endpoints - for _, r := range e.resolvers { - r.cc.NewAddress(addrs) - } - e.mu.Unlock() -} - -// Target constructs a endpoint target using the endpoint id of the ResolverGroup. -func (e *ResolverGroup) Target(endpoint string) string { - return Target(e.id, endpoint) -} - -// Target constructs a endpoint resolver target. -func Target(id, endpoint string) string { - return fmt.Sprintf("%s://%s/%s", scheme, id, endpoint) -} - -// IsTarget checks if a given target string in an endpoint resolver target. -func IsTarget(target string) bool { - return strings.HasPrefix(target, "endpoint://") -} - -func (e *ResolverGroup) Close() { - bldr.close(e.id) -} - -// Build creates or reuses an etcd resolver for the etcd cluster name identified by the authority part of the target. -func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { - if len(target.Authority) < 1 { - return nil, fmt.Errorf("'etcd' target scheme requires non-empty authority identifying etcd cluster being routed to") - } - id := target.Authority - es, err := b.getResolverGroup(id) - if err != nil { - return nil, fmt.Errorf("failed to build resolver: %v", err) - } - r := &Resolver{ - endpointID: id, - cc: cc, - } - es.addResolver(r) - return r, nil -} - -func (b *builder) newResolverGroup(id string) (*ResolverGroup, error) { - b.mu.RLock() - _, ok := b.resolverGroups[id] - b.mu.RUnlock() - if ok { - return nil, fmt.Errorf("Endpoint already exists for id: %s", id) - } - - es := &ResolverGroup{id: id} - b.mu.Lock() - b.resolverGroups[id] = es - b.mu.Unlock() - return es, nil -} - -func (b *builder) getResolverGroup(id string) (*ResolverGroup, error) { - b.mu.RLock() - es, ok := b.resolverGroups[id] - b.mu.RUnlock() - if !ok { - return nil, fmt.Errorf("ResolverGroup not found for id: %s", id) - } - return es, nil -} - -func (b *builder) close(id string) { - b.mu.Lock() - delete(b.resolverGroups, id) - b.mu.Unlock() -} - -func (b *builder) Scheme() string { - return scheme -} - -// Resolver provides a resolver for a single etcd cluster, identified by name. -type Resolver struct { - endpointID string - cc resolver.ClientConn - sync.RWMutex -} - -// TODO: use balancer.epsToAddrs -func epsToAddrs(eps ...string) (addrs []resolver.Address) { - addrs = make([]resolver.Address, 0, len(eps)) - for _, ep := range eps { - addrs = append(addrs, resolver.Address{Addr: ep}) - } - return addrs -} - -func (*Resolver) ResolveNow(o resolver.ResolveNowOptions) {} - -func (r *Resolver) Close() { - es, err := bldr.getResolverGroup(r.endpointID) - if err != nil { - return - } - es.removeResolver(r) -} - -// ParseEndpoint endpoint parses an endpoint of the form -// (http|https)://*|(unix|unixs)://) -// and returns a protocol ('tcp' or 'unix'), -// host (or filepath if a unix socket), -// scheme (http, https, unix, unixs). -func ParseEndpoint(endpoint string) (proto string, host string, scheme string) { - proto = "tcp" - host = endpoint - url, uerr := url.Parse(endpoint) - if uerr != nil || !strings.Contains(endpoint, "://") { - return proto, host, scheme - } - scheme = url.Scheme - - // strip scheme:// prefix since grpc dials by host - host = url.Host - switch url.Scheme { - case "http", "https": - case "unix", "unixs": - proto = "unix" - host = url.Host + url.Path - default: - proto, host = "", "" - } - return proto, host, scheme -} - -// ParseTarget parses a endpoint:/// string and returns the parsed id and endpoint. -// If the target is malformed, an error is returned. -func ParseTarget(target string) (string, string, error) { - noPrefix := strings.TrimPrefix(target, targetPrefix) - if noPrefix == target { - return "", "", fmt.Errorf("malformed target, %s prefix is required: %s", targetPrefix, target) - } - parts := strings.SplitN(noPrefix, "/", 2) - if len(parts) != 2 { - return "", "", fmt.Errorf("malformed target, expected %s:///, but got %s", scheme, target) - } - return parts[0], parts[1], nil -} - -// Dialer dials a endpoint using net.Dialer. -// Context cancelation and timeout are supported. -func Dialer(ctx context.Context, dialEp string) (net.Conn, error) { - proto, host, _ := ParseEndpoint(dialEp) - select { - case <-ctx.Done(): - return nil, ctx.Err() - default: - } - dialer := &net.Dialer{} - if deadline, ok := ctx.Deadline(); ok { - dialer.Deadline = deadline - } - return dialer.DialContext(ctx, proto, host) -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/utils.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/utils.go deleted file mode 100644 index 48eb87507404..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/utils.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package balancer - -import ( - "fmt" - "net/url" - "sort" - "sync/atomic" - "time" - - "google.golang.org/grpc/balancer" - "google.golang.org/grpc/resolver" -) - -func scToString(sc balancer.SubConn) string { - return fmt.Sprintf("%p", sc) -} - -func scsToStrings(scs map[balancer.SubConn]resolver.Address) (ss []string) { - ss = make([]string, 0, len(scs)) - for sc, a := range scs { - ss = append(ss, fmt.Sprintf("%s (%s)", a.Addr, scToString(sc))) - } - sort.Strings(ss) - return ss -} - -func addrsToStrings(addrs []resolver.Address) (ss []string) { - ss = make([]string, len(addrs)) - for i := range addrs { - ss[i] = addrs[i].Addr - } - sort.Strings(ss) - return ss -} - -func epsToAddrs(eps ...string) (addrs []resolver.Address) { - addrs = make([]resolver.Address, 0, len(eps)) - for _, ep := range eps { - u, err := url.Parse(ep) - if err != nil { - addrs = append(addrs, resolver.Address{Addr: ep, Type: resolver.Backend}) - continue - } - addrs = append(addrs, resolver.Address{Addr: u.Host, Type: resolver.Backend}) - } - return addrs -} - -var genN = new(uint32) - -func genName() string { - now := time.Now().UnixNano() - return fmt.Sprintf("%X%X", now, atomic.AddUint32(genN, 1)) -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/logger.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/logger.go deleted file mode 100644 index f5ae0109dadf..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/logger.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "io/ioutil" - "sync" - - "go.etcd.io/etcd/pkg/logutil" - - "google.golang.org/grpc/grpclog" -) - -var ( - lgMu sync.RWMutex - lg logutil.Logger -) - -type settableLogger struct { - l grpclog.LoggerV2 - mu sync.RWMutex -} - -func init() { - // disable client side logs by default - lg = &settableLogger{} - SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard)) -} - -// SetLogger sets client-side Logger. -func SetLogger(l grpclog.LoggerV2) { - lgMu.Lock() - lg = logutil.NewLogger(l) - // override grpclog so that any changes happen with locking - grpclog.SetLoggerV2(lg) - lgMu.Unlock() -} - -// GetLogger returns the current logutil.Logger. -func GetLogger() logutil.Logger { - lgMu.RLock() - l := lg - lgMu.RUnlock() - return l -} - -// NewLogger returns a new Logger with logutil.Logger. -func NewLogger(gl grpclog.LoggerV2) logutil.Logger { - return &settableLogger{l: gl} -} - -func (s *settableLogger) get() grpclog.LoggerV2 { - s.mu.RLock() - l := s.l - s.mu.RUnlock() - return l -} - -// implement the grpclog.LoggerV2 interface - -func (s *settableLogger) Info(args ...interface{}) { s.get().Info(args...) } -func (s *settableLogger) Infof(format string, args ...interface{}) { s.get().Infof(format, args...) } -func (s *settableLogger) Infoln(args ...interface{}) { s.get().Infoln(args...) } -func (s *settableLogger) Warning(args ...interface{}) { s.get().Warning(args...) } -func (s *settableLogger) Warningf(format string, args ...interface{}) { - s.get().Warningf(format, args...) -} -func (s *settableLogger) Warningln(args ...interface{}) { s.get().Warningln(args...) } -func (s *settableLogger) Error(args ...interface{}) { s.get().Error(args...) } -func (s *settableLogger) Errorf(format string, args ...interface{}) { - s.get().Errorf(format, args...) -} -func (s *settableLogger) Errorln(args ...interface{}) { s.get().Errorln(args...) } -func (s *settableLogger) Fatal(args ...interface{}) { s.get().Fatal(args...) } -func (s *settableLogger) Fatalf(format string, args ...interface{}) { s.get().Fatalf(format, args...) } -func (s *settableLogger) Fatalln(args ...interface{}) { s.get().Fatalln(args...) } -func (s *settableLogger) Print(args ...interface{}) { s.get().Info(args...) } -func (s *settableLogger) Printf(format string, args ...interface{}) { s.get().Infof(format, args...) } -func (s *settableLogger) Println(args ...interface{}) { s.get().Infoln(args...) } -func (s *settableLogger) V(l int) bool { return s.get().V(l) } -func (s *settableLogger) Lvl(lvl int) grpclog.LoggerV2 { - s.mu.RLock() - l := s.l - s.mu.RUnlock() - if l.V(lvl) { - return s - } - return logutil.NewDiscardLogger() -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/discard_logger.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/discard_logger.go deleted file mode 100644 index 81b0a9d0398b..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/discard_logger.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logutil - -import ( - "log" - - "google.golang.org/grpc/grpclog" -) - -// assert that "discardLogger" satisfy "Logger" interface -var _ Logger = &discardLogger{} - -// NewDiscardLogger returns a new Logger that discards everything except "fatal". -func NewDiscardLogger() Logger { return &discardLogger{} } - -type discardLogger struct{} - -func (l *discardLogger) Info(args ...interface{}) {} -func (l *discardLogger) Infoln(args ...interface{}) {} -func (l *discardLogger) Infof(format string, args ...interface{}) {} -func (l *discardLogger) Warning(args ...interface{}) {} -func (l *discardLogger) Warningln(args ...interface{}) {} -func (l *discardLogger) Warningf(format string, args ...interface{}) {} -func (l *discardLogger) Error(args ...interface{}) {} -func (l *discardLogger) Errorln(args ...interface{}) {} -func (l *discardLogger) Errorf(format string, args ...interface{}) {} -func (l *discardLogger) Fatal(args ...interface{}) { log.Fatal(args...) } -func (l *discardLogger) Fatalln(args ...interface{}) { log.Fatalln(args...) } -func (l *discardLogger) Fatalf(format string, args ...interface{}) { log.Fatalf(format, args...) } -func (l *discardLogger) V(lvl int) bool { - return false -} -func (l *discardLogger) Lvl(lvl int) grpclog.LoggerV2 { return l } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/log_level.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/log_level.go deleted file mode 100644 index d57e17394494..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/log_level.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logutil - -import ( - "fmt" - - "github.com/coreos/pkg/capnslog" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -var DefaultLogLevel = "info" - -// ConvertToZapLevel converts log level string to zapcore.Level. -func ConvertToZapLevel(lvl string) zapcore.Level { - switch lvl { - case "debug": - return zap.DebugLevel - case "info": - return zap.InfoLevel - case "warn": - return zap.WarnLevel - case "error": - return zap.ErrorLevel - case "dpanic": - return zap.DPanicLevel - case "panic": - return zap.PanicLevel - case "fatal": - return zap.FatalLevel - default: - panic(fmt.Sprintf("unknown level %q", lvl)) - } -} - -// ConvertToCapnslogLogLevel convert log level string to capnslog.LogLevel. -// TODO: deprecate this in 3.5 -func ConvertToCapnslogLogLevel(lvl string) capnslog.LogLevel { - switch lvl { - case "debug": - return capnslog.DEBUG - case "info": - return capnslog.INFO - case "warn": - return capnslog.WARNING - case "error": - return capnslog.ERROR - case "dpanic": - return capnslog.CRITICAL - case "panic": - return capnslog.CRITICAL - case "fatal": - return capnslog.CRITICAL - default: - panic(fmt.Sprintf("unknown level %q", lvl)) - } -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/logger.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/logger.go deleted file mode 100644 index e7da80eff1b0..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/logger.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logutil - -import "google.golang.org/grpc/grpclog" - -// Logger defines logging interface. -// TODO: deprecate in v3.5. -type Logger interface { - grpclog.LoggerV2 - - // Lvl returns logger if logger's verbosity level >= "lvl". - // Otherwise, logger that discards everything. - Lvl(lvl int) grpclog.LoggerV2 -} - -// assert that "defaultLogger" satisfy "Logger" interface -var _ Logger = &defaultLogger{} - -// NewLogger wraps "grpclog.LoggerV2" that implements "Logger" interface. -// -// For example: -// -// var defaultLogger Logger -// g := grpclog.NewLoggerV2WithVerbosity(os.Stderr, os.Stderr, os.Stderr, 4) -// defaultLogger = NewLogger(g) -// -func NewLogger(g grpclog.LoggerV2) Logger { return &defaultLogger{g: g} } - -type defaultLogger struct { - g grpclog.LoggerV2 -} - -func (l *defaultLogger) Info(args ...interface{}) { l.g.Info(args...) } -func (l *defaultLogger) Infoln(args ...interface{}) { l.g.Info(args...) } -func (l *defaultLogger) Infof(format string, args ...interface{}) { l.g.Infof(format, args...) } -func (l *defaultLogger) Warning(args ...interface{}) { l.g.Warning(args...) } -func (l *defaultLogger) Warningln(args ...interface{}) { l.g.Warning(args...) } -func (l *defaultLogger) Warningf(format string, args ...interface{}) { l.g.Warningf(format, args...) } -func (l *defaultLogger) Error(args ...interface{}) { l.g.Error(args...) } -func (l *defaultLogger) Errorln(args ...interface{}) { l.g.Error(args...) } -func (l *defaultLogger) Errorf(format string, args ...interface{}) { l.g.Errorf(format, args...) } -func (l *defaultLogger) Fatal(args ...interface{}) { l.g.Fatal(args...) } -func (l *defaultLogger) Fatalln(args ...interface{}) { l.g.Fatal(args...) } -func (l *defaultLogger) Fatalf(format string, args ...interface{}) { l.g.Fatalf(format, args...) } -func (l *defaultLogger) V(lvl int) bool { return l.g.V(lvl) } -func (l *defaultLogger) Lvl(lvl int) grpclog.LoggerV2 { - if l.g.V(lvl) { - return l - } - return &discardLogger{} -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/merge_logger.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/merge_logger.go deleted file mode 100644 index 866b6f7a8946..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/merge_logger.go +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logutil - -import ( - "fmt" - "sync" - "time" - - "github.com/coreos/pkg/capnslog" -) - -var ( - defaultMergePeriod = time.Second - defaultTimeOutputScale = 10 * time.Millisecond - - outputInterval = time.Second -) - -// line represents a log line that can be printed out -// through capnslog.PackageLogger. -type line struct { - level capnslog.LogLevel - str string -} - -func (l line) append(s string) line { - return line{ - level: l.level, - str: l.str + " " + s, - } -} - -// status represents the merge status of a line. -type status struct { - period time.Duration - - start time.Time // start time of latest merge period - count int // number of merged lines from starting -} - -func (s *status) isInMergePeriod(now time.Time) bool { - return s.period == 0 || s.start.Add(s.period).After(now) -} - -func (s *status) isEmpty() bool { return s.count == 0 } - -func (s *status) summary(now time.Time) string { - ts := s.start.Round(defaultTimeOutputScale) - took := now.Round(defaultTimeOutputScale).Sub(ts) - return fmt.Sprintf("[merged %d repeated lines in %s]", s.count, took) -} - -func (s *status) reset(now time.Time) { - s.start = now - s.count = 0 -} - -// MergeLogger supports merge logging, which merges repeated log lines -// and prints summary log lines instead. -// -// For merge logging, MergeLogger prints out the line when the line appears -// at the first time. MergeLogger holds the same log line printed within -// defaultMergePeriod, and prints out summary log line at the end of defaultMergePeriod. -// It stops merging when the line doesn't appear within the -// defaultMergePeriod. -type MergeLogger struct { - *capnslog.PackageLogger - - mu sync.Mutex // protect statusm - statusm map[line]*status -} - -func NewMergeLogger(logger *capnslog.PackageLogger) *MergeLogger { - l := &MergeLogger{ - PackageLogger: logger, - statusm: make(map[line]*status), - } - go l.outputLoop() - return l -} - -func (l *MergeLogger) MergeInfo(entries ...interface{}) { - l.merge(line{ - level: capnslog.INFO, - str: fmt.Sprint(entries...), - }) -} - -func (l *MergeLogger) MergeInfof(format string, args ...interface{}) { - l.merge(line{ - level: capnslog.INFO, - str: fmt.Sprintf(format, args...), - }) -} - -func (l *MergeLogger) MergeNotice(entries ...interface{}) { - l.merge(line{ - level: capnslog.NOTICE, - str: fmt.Sprint(entries...), - }) -} - -func (l *MergeLogger) MergeNoticef(format string, args ...interface{}) { - l.merge(line{ - level: capnslog.NOTICE, - str: fmt.Sprintf(format, args...), - }) -} - -func (l *MergeLogger) MergeWarning(entries ...interface{}) { - l.merge(line{ - level: capnslog.WARNING, - str: fmt.Sprint(entries...), - }) -} - -func (l *MergeLogger) MergeWarningf(format string, args ...interface{}) { - l.merge(line{ - level: capnslog.WARNING, - str: fmt.Sprintf(format, args...), - }) -} - -func (l *MergeLogger) MergeError(entries ...interface{}) { - l.merge(line{ - level: capnslog.ERROR, - str: fmt.Sprint(entries...), - }) -} - -func (l *MergeLogger) MergeErrorf(format string, args ...interface{}) { - l.merge(line{ - level: capnslog.ERROR, - str: fmt.Sprintf(format, args...), - }) -} - -func (l *MergeLogger) merge(ln line) { - l.mu.Lock() - - // increase count if the logger is merging the line - if status, ok := l.statusm[ln]; ok { - status.count++ - l.mu.Unlock() - return - } - - // initialize status of the line - l.statusm[ln] = &status{ - period: defaultMergePeriod, - start: time.Now(), - } - // release the lock before IO operation - l.mu.Unlock() - // print out the line at its first time - l.PackageLogger.Logf(ln.level, ln.str) -} - -func (l *MergeLogger) outputLoop() { - for now := range time.Tick(outputInterval) { - var outputs []line - - l.mu.Lock() - for ln, status := range l.statusm { - if status.isInMergePeriod(now) { - continue - } - if status.isEmpty() { - delete(l.statusm, ln) - continue - } - outputs = append(outputs, ln.append(status.summary(now))) - status.reset(now) - } - l.mu.Unlock() - - for _, o := range outputs { - l.PackageLogger.Logf(o.level, o.str) - } - } -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/package_logger.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/package_logger.go deleted file mode 100644 index 729cbdb57e4d..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/package_logger.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logutil - -import ( - "github.com/coreos/pkg/capnslog" - "google.golang.org/grpc/grpclog" -) - -// assert that "packageLogger" satisfy "Logger" interface -var _ Logger = &packageLogger{} - -// NewPackageLogger wraps "*capnslog.PackageLogger" that implements "Logger" interface. -// -// For example: -// -// var defaultLogger Logger -// defaultLogger = NewPackageLogger("go.etcd.io/etcd", "snapshot") -// -func NewPackageLogger(repo, pkg string) Logger { - return &packageLogger{p: capnslog.NewPackageLogger(repo, pkg)} -} - -type packageLogger struct { - p *capnslog.PackageLogger -} - -func (l *packageLogger) Info(args ...interface{}) { l.p.Info(args...) } -func (l *packageLogger) Infoln(args ...interface{}) { l.p.Info(args...) } -func (l *packageLogger) Infof(format string, args ...interface{}) { l.p.Infof(format, args...) } -func (l *packageLogger) Warning(args ...interface{}) { l.p.Warning(args...) } -func (l *packageLogger) Warningln(args ...interface{}) { l.p.Warning(args...) } -func (l *packageLogger) Warningf(format string, args ...interface{}) { l.p.Warningf(format, args...) } -func (l *packageLogger) Error(args ...interface{}) { l.p.Error(args...) } -func (l *packageLogger) Errorln(args ...interface{}) { l.p.Error(args...) } -func (l *packageLogger) Errorf(format string, args ...interface{}) { l.p.Errorf(format, args...) } -func (l *packageLogger) Fatal(args ...interface{}) { l.p.Fatal(args...) } -func (l *packageLogger) Fatalln(args ...interface{}) { l.p.Fatal(args...) } -func (l *packageLogger) Fatalf(format string, args ...interface{}) { l.p.Fatalf(format, args...) } -func (l *packageLogger) V(lvl int) bool { - return l.p.LevelAt(capnslog.LogLevel(lvl)) -} -func (l *packageLogger) Lvl(lvl int) grpclog.LoggerV2 { - if l.p.LevelAt(capnslog.LogLevel(lvl)) { - return l - } - return &discardLogger{} -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_grpc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_grpc.go deleted file mode 100644 index 3f48d813dab0..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_grpc.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logutil - -import ( - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "google.golang.org/grpc/grpclog" -) - -// NewGRPCLoggerV2 converts "*zap.Logger" to "grpclog.LoggerV2". -// It discards all INFO level logging in gRPC, if debug level -// is not enabled in "*zap.Logger". -func NewGRPCLoggerV2(lcfg zap.Config) (grpclog.LoggerV2, error) { - lg, err := lcfg.Build(zap.AddCallerSkip(1)) // to annotate caller outside of "logutil" - if err != nil { - return nil, err - } - return &zapGRPCLogger{lg: lg, sugar: lg.Sugar()}, nil -} - -// NewGRPCLoggerV2FromZapCore creates "grpclog.LoggerV2" from "zap.Core" -// and "zapcore.WriteSyncer". It discards all INFO level logging in gRPC, -// if debug level is not enabled in "*zap.Logger". -func NewGRPCLoggerV2FromZapCore(cr zapcore.Core, syncer zapcore.WriteSyncer) grpclog.LoggerV2 { - // "AddCallerSkip" to annotate caller outside of "logutil" - lg := zap.New(cr, zap.AddCaller(), zap.AddCallerSkip(1), zap.ErrorOutput(syncer)) - return &zapGRPCLogger{lg: lg, sugar: lg.Sugar()} -} - -type zapGRPCLogger struct { - lg *zap.Logger - sugar *zap.SugaredLogger -} - -func (zl *zapGRPCLogger) Info(args ...interface{}) { - if !zl.lg.Core().Enabled(zapcore.DebugLevel) { - return - } - zl.sugar.Info(args...) -} - -func (zl *zapGRPCLogger) Infoln(args ...interface{}) { - if !zl.lg.Core().Enabled(zapcore.DebugLevel) { - return - } - zl.sugar.Info(args...) -} - -func (zl *zapGRPCLogger) Infof(format string, args ...interface{}) { - if !zl.lg.Core().Enabled(zapcore.DebugLevel) { - return - } - zl.sugar.Infof(format, args...) -} - -func (zl *zapGRPCLogger) Warning(args ...interface{}) { - zl.sugar.Warn(args...) -} - -func (zl *zapGRPCLogger) Warningln(args ...interface{}) { - zl.sugar.Warn(args...) -} - -func (zl *zapGRPCLogger) Warningf(format string, args ...interface{}) { - zl.sugar.Warnf(format, args...) -} - -func (zl *zapGRPCLogger) Error(args ...interface{}) { - zl.sugar.Error(args...) -} - -func (zl *zapGRPCLogger) Errorln(args ...interface{}) { - zl.sugar.Error(args...) -} - -func (zl *zapGRPCLogger) Errorf(format string, args ...interface{}) { - zl.sugar.Errorf(format, args...) -} - -func (zl *zapGRPCLogger) Fatal(args ...interface{}) { - zl.sugar.Fatal(args...) -} - -func (zl *zapGRPCLogger) Fatalln(args ...interface{}) { - zl.sugar.Fatal(args...) -} - -func (zl *zapGRPCLogger) Fatalf(format string, args ...interface{}) { - zl.sugar.Fatalf(format, args...) -} - -func (zl *zapGRPCLogger) V(l int) bool { - // infoLog == 0 - if l <= 0 { // debug level, then we ignore info level in gRPC - return !zl.lg.Core().Enabled(zapcore.DebugLevel) - } - return true -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_raft.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_raft.go deleted file mode 100644 index f016b3054e35..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/logutil/zap_raft.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logutil - -import ( - "errors" - - "go.etcd.io/etcd/raft" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -// NewRaftLogger builds "raft.Logger" from "*zap.Config". -func NewRaftLogger(lcfg *zap.Config) (raft.Logger, error) { - if lcfg == nil { - return nil, errors.New("nil zap.Config") - } - lg, err := lcfg.Build(zap.AddCallerSkip(1)) // to annotate caller outside of "logutil" - if err != nil { - return nil, err - } - return &zapRaftLogger{lg: lg, sugar: lg.Sugar()}, nil -} - -// NewRaftLoggerZap converts "*zap.Logger" to "raft.Logger". -func NewRaftLoggerZap(lg *zap.Logger) raft.Logger { - return &zapRaftLogger{lg: lg, sugar: lg.Sugar()} -} - -// NewRaftLoggerFromZapCore creates "raft.Logger" from "zap.Core" -// and "zapcore.WriteSyncer". -func NewRaftLoggerFromZapCore(cr zapcore.Core, syncer zapcore.WriteSyncer) raft.Logger { - // "AddCallerSkip" to annotate caller outside of "logutil" - lg := zap.New(cr, zap.AddCaller(), zap.AddCallerSkip(1), zap.ErrorOutput(syncer)) - return &zapRaftLogger{lg: lg, sugar: lg.Sugar()} -} - -type zapRaftLogger struct { - lg *zap.Logger - sugar *zap.SugaredLogger -} - -func (zl *zapRaftLogger) Debug(args ...interface{}) { - zl.sugar.Debug(args...) -} - -func (zl *zapRaftLogger) Debugf(format string, args ...interface{}) { - zl.sugar.Debugf(format, args...) -} - -func (zl *zapRaftLogger) Error(args ...interface{}) { - zl.sugar.Error(args...) -} - -func (zl *zapRaftLogger) Errorf(format string, args ...interface{}) { - zl.sugar.Errorf(format, args...) -} - -func (zl *zapRaftLogger) Info(args ...interface{}) { - zl.sugar.Info(args...) -} - -func (zl *zapRaftLogger) Infof(format string, args ...interface{}) { - zl.sugar.Infof(format, args...) -} - -func (zl *zapRaftLogger) Warning(args ...interface{}) { - zl.sugar.Warn(args...) -} - -func (zl *zapRaftLogger) Warningf(format string, args ...interface{}) { - zl.sugar.Warnf(format, args...) -} - -func (zl *zapRaftLogger) Fatal(args ...interface{}) { - zl.sugar.Fatal(args...) -} - -func (zl *zapRaftLogger) Fatalf(format string, args ...interface{}) { - zl.sugar.Fatalf(format, args...) -} - -func (zl *zapRaftLogger) Panic(args ...interface{}) { - zl.sugar.Panic(args...) -} - -func (zl *zapRaftLogger) Panicf(format string, args ...interface{}) { - zl.sugar.Panicf(format, args...) -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/tlsutil/cipher_suites.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/tlsutil/cipher_suites.go deleted file mode 100644 index b5916bb54dce..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/pkg/tlsutil/cipher_suites.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tlsutil - -import "crypto/tls" - -// cipher suites implemented by Go -// https://github.com/golang/go/blob/dev.boringcrypto.go1.10/src/crypto/tls/cipher_suites.go -var cipherSuites = map[string]uint16{ - "TLS_RSA_WITH_RC4_128_SHA": tls.TLS_RSA_WITH_RC4_128_SHA, - "TLS_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, - "TLS_RSA_WITH_AES_128_CBC_SHA": tls.TLS_RSA_WITH_AES_128_CBC_SHA, - "TLS_RSA_WITH_AES_256_CBC_SHA": tls.TLS_RSA_WITH_AES_256_CBC_SHA, - "TLS_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_RSA_WITH_AES_128_CBC_SHA256, - "TLS_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_RSA_WITH_AES_128_GCM_SHA256, - "TLS_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_RSA_WITH_AES_256_GCM_SHA384, - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, - "TLS_ECDHE_RSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, -} - -// GetCipherSuite returns the corresponding cipher suite, -// and boolean value if it is supported. -func GetCipherSuite(s string) (uint16, bool) { - v, ok := cipherSuites[s] - return v, ok -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/OWNERS b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/OWNERS deleted file mode 100644 index ab781066e237..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/OWNERS +++ /dev/null @@ -1,19 +0,0 @@ -approvers: -- heyitsanthony -- philips -- fanminshi -- gyuho -- mitake -- jpbetz -- xiang90 -- bdarnell -reviewers: -- heyitsanthony -- philips -- fanminshi -- gyuho -- mitake -- jpbetz -- xiang90 -- bdarnell -- tschottdorf diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/README.md b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/README.md deleted file mode 100644 index 83cf04035c92..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/README.md +++ /dev/null @@ -1,197 +0,0 @@ -# Raft library - -Raft is a protocol with which a cluster of nodes can maintain a replicated state machine. -The state machine is kept in sync through the use of a replicated log. -For more details on Raft, see "In Search of an Understandable Consensus Algorithm" -(https://raft.github.io/raft.pdf) by Diego Ongaro and John Ousterhout. - -This Raft library is stable and feature complete. As of 2016, it is **the most widely used** Raft library in production, serving tens of thousands clusters each day. It powers distributed systems such as etcd, Kubernetes, Docker Swarm, Cloud Foundry Diego, CockroachDB, TiDB, Project Calico, Flannel, and more. - -Most Raft implementations have a monolithic design, including storage handling, messaging serialization, and network transport. This library instead follows a minimalistic design philosophy by only implementing the core raft algorithm. This minimalism buys flexibility, determinism, and performance. - -To keep the codebase small as well as provide flexibility, the library only implements the Raft algorithm; both network and disk IO are left to the user. Library users must implement their own transportation layer for message passing between Raft peers over the wire. Similarly, users must implement their own storage layer to persist the Raft log and state. - -In order to easily test the Raft library, its behavior should be deterministic. To achieve this determinism, the library models Raft as a state machine. The state machine takes a `Message` as input. A message can either be a local timer update or a network message sent from a remote peer. The state machine's output is a 3-tuple `{[]Messages, []LogEntries, NextState}` consisting of an array of `Messages`, `log entries`, and `Raft state changes`. For state machines with the same state, the same state machine input should always generate the same state machine output. - -A simple example application, _raftexample_, is also available to help illustrate how to use this package in practice: https://github.com/etcd-io/etcd/tree/master/contrib/raftexample - -# Features - -This raft implementation is a full feature implementation of Raft protocol. Features includes: - -- Leader election -- Log replication -- Log compaction -- Membership changes -- Leadership transfer extension -- Efficient linearizable read-only queries served by both the leader and followers - - leader checks with quorum and bypasses Raft log before processing read-only queries - - followers asks leader to get a safe read index before processing read-only queries -- More efficient lease-based linearizable read-only queries served by both the leader and followers - - leader bypasses Raft log and processing read-only queries locally - - followers asks leader to get a safe read index before processing read-only queries - - this approach relies on the clock of the all the machines in raft group - -This raft implementation also includes a few optional enhancements: - -- Optimistic pipelining to reduce log replication latency -- Flow control for log replication -- Batching Raft messages to reduce synchronized network I/O calls -- Batching log entries to reduce disk synchronized I/O -- Writing to leader's disk in parallel -- Internal proposal redirection from followers to leader -- Automatic stepping down when the leader loses quorum -- Protection against unbounded log growth when quorum is lost - -## Notable Users - -- [cockroachdb](https://github.com/cockroachdb/cockroach) A Scalable, Survivable, Strongly-Consistent SQL Database -- [dgraph](https://github.com/dgraph-io/dgraph) A Scalable, Distributed, Low Latency, High Throughput Graph Database -- [etcd](https://github.com/etcd-io/etcd) A distributed reliable key-value store -- [tikv](https://github.com/pingcap/tikv) A Distributed transactional key value database powered by Rust and Raft -- [swarmkit](https://github.com/docker/swarmkit) A toolkit for orchestrating distributed systems at any scale. -- [chain core](https://github.com/chain/chain) Software for operating permissioned, multi-asset blockchain networks - -## Usage - -The primary object in raft is a Node. Either start a Node from scratch using raft.StartNode or start a Node from some initial state using raft.RestartNode. - -To start a three-node cluster -```go - storage := raft.NewMemoryStorage() - c := &Config{ - ID: 0x01, - ElectionTick: 10, - HeartbeatTick: 1, - Storage: storage, - MaxSizePerMsg: 4096, - MaxInflightMsgs: 256, - } - // Set peer list to the other nodes in the cluster. - // Note that they need to be started separately as well. - n := raft.StartNode(c, []raft.Peer{{ID: 0x02}, {ID: 0x03}}) -``` - -Start a single node cluster, like so: -```go - // Create storage and config as shown above. - // Set peer list to itself, so this node can become the leader of this single-node cluster. - peers := []raft.Peer{{ID: 0x01}} - n := raft.StartNode(c, peers) -``` - -To allow a new node to join this cluster, do not pass in any peers. First, add the node to the existing cluster by calling `ProposeConfChange` on any existing node inside the cluster. Then, start the node with an empty peer list, like so: -```go - // Create storage and config as shown above. - n := raft.StartNode(c, nil) -``` - -To restart a node from previous state: -```go - storage := raft.NewMemoryStorage() - - // Recover the in-memory storage from persistent snapshot, state and entries. - storage.ApplySnapshot(snapshot) - storage.SetHardState(state) - storage.Append(entries) - - c := &Config{ - ID: 0x01, - ElectionTick: 10, - HeartbeatTick: 1, - Storage: storage, - MaxSizePerMsg: 4096, - MaxInflightMsgs: 256, - } - - // Restart raft without peer information. - // Peer information is already included in the storage. - n := raft.RestartNode(c) -``` - -After creating a Node, the user has a few responsibilities: - -First, read from the Node.Ready() channel and process the updates it contains. These steps may be performed in parallel, except as noted in step 2. - -1. Write Entries, HardState and Snapshot to persistent storage in order, i.e. Entries first, then HardState and Snapshot if they are not empty. If persistent storage supports atomic writes then all of them can be written together. Note that when writing an Entry with Index i, any previously-persisted entries with Index >= i must be discarded. - -2. Send all Messages to the nodes named in the To field. It is important that no messages be sent until the latest HardState has been persisted to disk, and all Entries written by any previous Ready batch (Messages may be sent while entries from the same batch are being persisted). To reduce the I/O latency, an optimization can be applied to make leader write to disk in parallel with its followers (as explained at section 10.2.1 in Raft thesis). If any Message has type MsgSnap, call Node.ReportSnapshot() after it has been sent (these messages may be large). Note: Marshalling messages is not thread-safe; it is important to make sure that no new entries are persisted while marshalling. The easiest way to achieve this is to serialise the messages directly inside the main raft loop. - -3. Apply Snapshot (if any) and CommittedEntries to the state machine. If any committed Entry has Type EntryConfChange, call Node.ApplyConfChange() to apply it to the node. The configuration change may be cancelled at this point by setting the NodeID field to zero before calling ApplyConfChange (but ApplyConfChange must be called one way or the other, and the decision to cancel must be based solely on the state machine and not external information such as the observed health of the node). - -4. Call Node.Advance() to signal readiness for the next batch of updates. This may be done at any time after step 1, although all updates must be processed in the order they were returned by Ready. - -Second, all persisted log entries must be made available via an implementation of the Storage interface. The provided MemoryStorage type can be used for this (if repopulating its state upon a restart), or a custom disk-backed implementation can be supplied. - -Third, after receiving a message from another node, pass it to Node.Step: - -```go - func recvRaftRPC(ctx context.Context, m raftpb.Message) { - n.Step(ctx, m) - } -``` - -Finally, call `Node.Tick()` at regular intervals (probably via a `time.Ticker`). Raft has two important timeouts: heartbeat and the election timeout. However, internally to the raft package time is represented by an abstract "tick". - -The total state machine handling loop will look something like this: - -```go - for { - select { - case <-s.Ticker: - n.Tick() - case rd := <-s.Node.Ready(): - saveToStorage(rd.HardState, rd.Entries, rd.Snapshot) - send(rd.Messages) - if !raft.IsEmptySnap(rd.Snapshot) { - processSnapshot(rd.Snapshot) - } - for _, entry := range rd.CommittedEntries { - process(entry) - if entry.Type == raftpb.EntryConfChange { - var cc raftpb.ConfChange - cc.Unmarshal(entry.Data) - s.Node.ApplyConfChange(cc) - } - } - s.Node.Advance() - case <-s.done: - return - } - } -``` - -To propose changes to the state machine from the node to take application data, serialize it into a byte slice and call: - -```go - n.Propose(ctx, data) -``` - -If the proposal is committed, data will appear in committed entries with type raftpb.EntryNormal. There is no guarantee that a proposed command will be committed; the command may have to be reproposed after a timeout. - -To add or remove node in a cluster, build ConfChange struct 'cc' and call: - -```go - n.ProposeConfChange(ctx, cc) -``` - -After config change is committed, some committed entry with type raftpb.EntryConfChange will be returned. This must be applied to node through: - -```go - var cc raftpb.ConfChange - cc.Unmarshal(data) - n.ApplyConfChange(cc) -``` - -Note: An ID represents a unique node in a cluster for all time. A -given ID MUST be used only once even if the old node has been removed. -This means that for example IP addresses make poor node IDs since they -may be reused. Node IDs must be non-zero. - -## Implementation notes - -This implementation is up to date with the final Raft thesis (https://github.com/ongardie/dissertation/blob/master/stanford.pdf), although this implementation of the membership change protocol differs somewhat from that described in chapter 4. The key invariant that membership changes happen one node at a time is preserved, but in our implementation the membership change takes effect when its entry is applied, not when it is added to the log (so the entry is committed under the old membership instead of the new). This is equivalent in terms of safety, since the old and new configurations are guaranteed to overlap. - -To ensure there is no attempt to commit two membership changes at once by matching log positions (which would be unsafe since they should have different quorum requirements), any proposed membership change is simply disallowed while any uncommitted change appears in the leader's log. - -This approach introduces a problem when removing a member from a two-member cluster: If one of the members dies before the other one receives the commit of the confchange entry, then the member cannot be removed any more since the cluster cannot make progress. For this reason it is highly recommended to use three or more nodes in every cluster. diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/bootstrap.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/bootstrap.go deleted file mode 100644 index bd82b2041af7..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/bootstrap.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import ( - "errors" - - pb "go.etcd.io/etcd/raft/raftpb" -) - -// Bootstrap initializes the RawNode for first use by appending configuration -// changes for the supplied peers. This method returns an error if the Storage -// is nonempty. -// -// It is recommended that instead of calling this method, applications bootstrap -// their state manually by setting up a Storage that has a first index > 1 and -// which stores the desired ConfState as its InitialState. -func (rn *RawNode) Bootstrap(peers []Peer) error { - if len(peers) == 0 { - return errors.New("must provide at least one peer to Bootstrap") - } - lastIndex, err := rn.raft.raftLog.storage.LastIndex() - if err != nil { - return err - } - - if lastIndex != 0 { - return errors.New("can't bootstrap a nonempty Storage") - } - - // We've faked out initial entries above, but nothing has been - // persisted. Start with an empty HardState (thus the first Ready will - // emit a HardState update for the app to persist). - rn.prevHardSt = emptyState - - // TODO(tbg): remove StartNode and give the application the right tools to - // bootstrap the initial membership in a cleaner way. - rn.raft.becomeFollower(1, None) - ents := make([]pb.Entry, len(peers)) - for i, peer := range peers { - cc := pb.ConfChange{Type: pb.ConfChangeAddNode, NodeID: peer.ID, Context: peer.Context} - data, err := cc.Marshal() - if err != nil { - return err - } - - ents[i] = pb.Entry{Type: pb.EntryConfChange, Term: 1, Index: uint64(i + 1), Data: data} - } - rn.raft.raftLog.append(ents...) - - // Now apply them, mainly so that the application can call Campaign - // immediately after StartNode in tests. Note that these nodes will - // be added to raft twice: here and when the application's Ready - // loop calls ApplyConfChange. The calls to addNode must come after - // all calls to raftLog.append so progress.next is set after these - // bootstrapping entries (it is an error if we try to append these - // entries since they have already been committed). - // We do not set raftLog.applied so the application will be able - // to observe all conf changes via Ready.CommittedEntries. - // - // TODO(bdarnell): These entries are still unstable; do we need to preserve - // the invariant that committed < unstable? - rn.raft.raftLog.committed = uint64(len(ents)) - for _, peer := range peers { - rn.raft.applyConfChange(pb.ConfChange{NodeID: peer.ID, Type: pb.ConfChangeAddNode}.AsV2()) - } - return nil -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/confchange/confchange.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/confchange/confchange.go deleted file mode 100644 index a0dc486df4f6..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/confchange/confchange.go +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package confchange - -import ( - "errors" - "fmt" - "strings" - - "go.etcd.io/etcd/raft/quorum" - pb "go.etcd.io/etcd/raft/raftpb" - "go.etcd.io/etcd/raft/tracker" -) - -// Changer facilitates configuration changes. It exposes methods to handle -// simple and joint consensus while performing the proper validation that allows -// refusing invalid configuration changes before they affect the active -// configuration. -type Changer struct { - Tracker tracker.ProgressTracker - LastIndex uint64 -} - -// EnterJoint verifies that the outgoing (=right) majority config of the joint -// config is empty and initializes it with a copy of the incoming (=left) -// majority config. That is, it transitions from -// -// (1 2 3)&&() -// to -// (1 2 3)&&(1 2 3). -// -// The supplied changes are then applied to the incoming majority config, -// resulting in a joint configuration that in terms of the Raft thesis[1] -// (Section 4.3) corresponds to `C_{new,old}`. -// -// [1]: https://github.com/ongardie/dissertation/blob/master/online-trim.pdf -func (c Changer) EnterJoint(autoLeave bool, ccs ...pb.ConfChangeSingle) (tracker.Config, tracker.ProgressMap, error) { - cfg, prs, err := c.checkAndCopy() - if err != nil { - return c.err(err) - } - if joint(cfg) { - err := errors.New("config is already joint") - return c.err(err) - } - if len(incoming(cfg.Voters)) == 0 { - // We allow adding nodes to an empty config for convenience (testing and - // bootstrap), but you can't enter a joint state. - err := errors.New("can't make a zero-voter config joint") - return c.err(err) - } - // Clear the outgoing config. - *outgoingPtr(&cfg.Voters) = quorum.MajorityConfig{} - // Copy incoming to outgoing. - for id := range incoming(cfg.Voters) { - outgoing(cfg.Voters)[id] = struct{}{} - } - - if err := c.apply(&cfg, prs, ccs...); err != nil { - return c.err(err) - } - cfg.AutoLeave = autoLeave - return checkAndReturn(cfg, prs) -} - -// LeaveJoint transitions out of a joint configuration. It is an error to call -// this method if the configuration is not joint, i.e. if the outgoing majority -// config Voters[1] is empty. -// -// The outgoing majority config of the joint configuration will be removed, -// that is, the incoming config is promoted as the sole decision maker. In the -// notation of the Raft thesis[1] (Section 4.3), this method transitions from -// `C_{new,old}` into `C_new`. -// -// At the same time, any staged learners (LearnersNext) the addition of which -// was held back by an overlapping voter in the former outgoing config will be -// inserted into Learners. -// -// [1]: https://github.com/ongardie/dissertation/blob/master/online-trim.pdf -func (c Changer) LeaveJoint() (tracker.Config, tracker.ProgressMap, error) { - cfg, prs, err := c.checkAndCopy() - if err != nil { - return c.err(err) - } - if !joint(cfg) { - err := errors.New("can't leave a non-joint config") - return c.err(err) - } - if len(outgoing(cfg.Voters)) == 0 { - err := fmt.Errorf("configuration is not joint: %v", cfg) - return c.err(err) - } - for id := range cfg.LearnersNext { - nilAwareAdd(&cfg.Learners, id) - prs[id].IsLearner = true - } - cfg.LearnersNext = nil - - for id := range outgoing(cfg.Voters) { - _, isVoter := incoming(cfg.Voters)[id] - _, isLearner := cfg.Learners[id] - - if !isVoter && !isLearner { - delete(prs, id) - } - } - *outgoingPtr(&cfg.Voters) = nil - cfg.AutoLeave = false - - return checkAndReturn(cfg, prs) -} - -// Simple carries out a series of configuration changes that (in aggregate) -// mutates the incoming majority config Voters[0] by at most one. This method -// will return an error if that is not the case, if the resulting quorum is -// zero, or if the configuration is in a joint state (i.e. if there is an -// outgoing configuration). -func (c Changer) Simple(ccs ...pb.ConfChangeSingle) (tracker.Config, tracker.ProgressMap, error) { - cfg, prs, err := c.checkAndCopy() - if err != nil { - return c.err(err) - } - if joint(cfg) { - err := errors.New("can't apply simple config change in joint config") - return c.err(err) - } - if err := c.apply(&cfg, prs, ccs...); err != nil { - return c.err(err) - } - if n := symdiff(incoming(c.Tracker.Voters), incoming(cfg.Voters)); n > 1 { - return tracker.Config{}, nil, errors.New("more than one voter changed without entering joint config") - } - if err := checkInvariants(cfg, prs); err != nil { - return tracker.Config{}, tracker.ProgressMap{}, nil - } - - return checkAndReturn(cfg, prs) -} - -// apply a change to the configuration. By convention, changes to voters are -// always made to the incoming majority config Voters[0]. Voters[1] is either -// empty or preserves the outgoing majority configuration while in a joint state. -func (c Changer) apply(cfg *tracker.Config, prs tracker.ProgressMap, ccs ...pb.ConfChangeSingle) error { - for _, cc := range ccs { - if cc.NodeID == 0 { - // etcd replaces the NodeID with zero if it decides (downstream of - // raft) to not apply a change, so we have to have explicit code - // here to ignore these. - continue - } - switch cc.Type { - case pb.ConfChangeAddNode: - c.makeVoter(cfg, prs, cc.NodeID) - case pb.ConfChangeAddLearnerNode: - c.makeLearner(cfg, prs, cc.NodeID) - case pb.ConfChangeRemoveNode: - c.remove(cfg, prs, cc.NodeID) - case pb.ConfChangeUpdateNode: - default: - return fmt.Errorf("unexpected conf type %d", cc.Type) - } - } - if len(incoming(cfg.Voters)) == 0 { - return errors.New("removed all voters") - } - return nil -} - -// makeVoter adds or promotes the given ID to be a voter in the incoming -// majority config. -func (c Changer) makeVoter(cfg *tracker.Config, prs tracker.ProgressMap, id uint64) { - pr := prs[id] - if pr == nil { - c.initProgress(cfg, prs, id, false /* isLearner */) - return - } - - pr.IsLearner = false - nilAwareDelete(&cfg.Learners, id) - nilAwareDelete(&cfg.LearnersNext, id) - incoming(cfg.Voters)[id] = struct{}{} - return -} - -// makeLearner makes the given ID a learner or stages it to be a learner once -// an active joint configuration is exited. -// -// The former happens when the peer is not a part of the outgoing config, in -// which case we either add a new learner or demote a voter in the incoming -// config. -// -// The latter case occurs when the configuration is joint and the peer is a -// voter in the outgoing config. In that case, we do not want to add the peer -// as a learner because then we'd have to track a peer as a voter and learner -// simultaneously. Instead, we add the learner to LearnersNext, so that it will -// be added to Learners the moment the outgoing config is removed by -// LeaveJoint(). -func (c Changer) makeLearner(cfg *tracker.Config, prs tracker.ProgressMap, id uint64) { - pr := prs[id] - if pr == nil { - c.initProgress(cfg, prs, id, true /* isLearner */) - return - } - if pr.IsLearner { - return - } - // Remove any existing voter in the incoming config... - c.remove(cfg, prs, id) - // ... but save the Progress. - prs[id] = pr - // Use LearnersNext if we can't add the learner to Learners directly, i.e. - // if the peer is still tracked as a voter in the outgoing config. It will - // be turned into a learner in LeaveJoint(). - // - // Otherwise, add a regular learner right away. - if _, onRight := outgoing(cfg.Voters)[id]; onRight { - nilAwareAdd(&cfg.LearnersNext, id) - } else { - pr.IsLearner = true - nilAwareAdd(&cfg.Learners, id) - } -} - -// remove this peer as a voter or learner from the incoming config. -func (c Changer) remove(cfg *tracker.Config, prs tracker.ProgressMap, id uint64) { - if _, ok := prs[id]; !ok { - return - } - - delete(incoming(cfg.Voters), id) - nilAwareDelete(&cfg.Learners, id) - nilAwareDelete(&cfg.LearnersNext, id) - - // If the peer is still a voter in the outgoing config, keep the Progress. - if _, onRight := outgoing(cfg.Voters)[id]; !onRight { - delete(prs, id) - } -} - -// initProgress initializes a new progress for the given node or learner. -func (c Changer) initProgress(cfg *tracker.Config, prs tracker.ProgressMap, id uint64, isLearner bool) { - if !isLearner { - incoming(cfg.Voters)[id] = struct{}{} - } else { - nilAwareAdd(&cfg.Learners, id) - } - prs[id] = &tracker.Progress{ - // Initializing the Progress with the last index means that the follower - // can be probed (with the last index). - // - // TODO(tbg): seems awfully optimistic. Using the first index would be - // better. The general expectation here is that the follower has no log - // at all (and will thus likely need a snapshot), though the app may - // have applied a snapshot out of band before adding the replica (thus - // making the first index the better choice). - Next: c.LastIndex, - Match: 0, - Inflights: tracker.NewInflights(c.Tracker.MaxInflight), - IsLearner: isLearner, - // When a node is first added, we should mark it as recently active. - // Otherwise, CheckQuorum may cause us to step down if it is invoked - // before the added node has had a chance to communicate with us. - RecentActive: true, - } -} - -// checkInvariants makes sure that the config and progress are compatible with -// each other. This is used to check both what the Changer is initialized with, -// as well as what it returns. -func checkInvariants(cfg tracker.Config, prs tracker.ProgressMap) error { - // NB: intentionally allow the empty config. In production we'll never see a - // non-empty config (we prevent it from being created) but we will need to - // be able to *create* an initial config, for example during bootstrap (or - // during tests). Instead of having to hand-code this, we allow - // transitioning from an empty config into any other legal and non-empty - // config. - for _, ids := range []map[uint64]struct{}{ - cfg.Voters.IDs(), - cfg.Learners, - cfg.LearnersNext, - } { - for id := range ids { - if _, ok := prs[id]; !ok { - return fmt.Errorf("no progress for %d", id) - } - } - } - - // Any staged learner was staged because it could not be directly added due - // to a conflicting voter in the outgoing config. - for id := range cfg.LearnersNext { - if _, ok := outgoing(cfg.Voters)[id]; !ok { - return fmt.Errorf("%d is in LearnersNext, but not Voters[1]", id) - } - if prs[id].IsLearner { - return fmt.Errorf("%d is in LearnersNext, but is already marked as learner", id) - } - } - // Conversely Learners and Voters doesn't intersect at all. - for id := range cfg.Learners { - if _, ok := outgoing(cfg.Voters)[id]; ok { - return fmt.Errorf("%d is in Learners and Voters[1]", id) - } - if _, ok := incoming(cfg.Voters)[id]; ok { - return fmt.Errorf("%d is in Learners and Voters[0]", id) - } - if !prs[id].IsLearner { - return fmt.Errorf("%d is in Learners, but is not marked as learner", id) - } - } - - if !joint(cfg) { - // We enforce that empty maps are nil instead of zero. - if outgoing(cfg.Voters) != nil { - return fmt.Errorf("Voters[1] must be nil when not joint") - } - if cfg.LearnersNext != nil { - return fmt.Errorf("LearnersNext must be nil when not joint") - } - if cfg.AutoLeave { - return fmt.Errorf("AutoLeave must be false when not joint") - } - } - - return nil -} - -// checkAndCopy copies the tracker's config and progress map (deeply enough for -// the purposes of the Changer) and returns those copies. It returns an error -// if checkInvariants does. -func (c Changer) checkAndCopy() (tracker.Config, tracker.ProgressMap, error) { - cfg := c.Tracker.Config.Clone() - prs := tracker.ProgressMap{} - - for id, pr := range c.Tracker.Progress { - // A shallow copy is enough because we only mutate the Learner field. - ppr := *pr - prs[id] = &ppr - } - return checkAndReturn(cfg, prs) -} - -// checkAndReturn calls checkInvariants on the input and returns either the -// resulting error or the input. -func checkAndReturn(cfg tracker.Config, prs tracker.ProgressMap) (tracker.Config, tracker.ProgressMap, error) { - if err := checkInvariants(cfg, prs); err != nil { - return tracker.Config{}, tracker.ProgressMap{}, err - } - return cfg, prs, nil -} - -// err returns zero values and an error. -func (c Changer) err(err error) (tracker.Config, tracker.ProgressMap, error) { - return tracker.Config{}, nil, err -} - -// nilAwareAdd populates a map entry, creating the map if necessary. -func nilAwareAdd(m *map[uint64]struct{}, id uint64) { - if *m == nil { - *m = map[uint64]struct{}{} - } - (*m)[id] = struct{}{} -} - -// nilAwareDelete deletes from a map, nil'ing the map itself if it is empty after. -func nilAwareDelete(m *map[uint64]struct{}, id uint64) { - if *m == nil { - return - } - delete(*m, id) - if len(*m) == 0 { - *m = nil - } -} - -// symdiff returns the count of the symmetric difference between the sets of -// uint64s, i.e. len( (l - r) \union (r - l)). -func symdiff(l, r map[uint64]struct{}) int { - var n int - pairs := [][2]quorum.MajorityConfig{ - {l, r}, // count elems in l but not in r - {r, l}, // count elems in r but not in l - } - for _, p := range pairs { - for id := range p[0] { - if _, ok := p[1][id]; !ok { - n++ - } - } - } - return n -} - -func joint(cfg tracker.Config) bool { - return len(outgoing(cfg.Voters)) > 0 -} - -func incoming(voters quorum.JointConfig) quorum.MajorityConfig { return voters[0] } -func outgoing(voters quorum.JointConfig) quorum.MajorityConfig { return voters[1] } -func outgoingPtr(voters *quorum.JointConfig) *quorum.MajorityConfig { return &voters[1] } - -// Describe prints the type and NodeID of the configuration changes as a -// space-delimited string. -func Describe(ccs ...pb.ConfChangeSingle) string { - var buf strings.Builder - for _, cc := range ccs { - if buf.Len() > 0 { - buf.WriteByte(' ') - } - fmt.Fprintf(&buf, "%s(%d)", cc.Type, cc.NodeID) - } - return buf.String() -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/confchange/restore.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/confchange/restore.go deleted file mode 100644 index 724068da00d4..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/confchange/restore.go +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package confchange - -import ( - pb "go.etcd.io/etcd/raft/raftpb" - "go.etcd.io/etcd/raft/tracker" -) - -// toConfChangeSingle translates a conf state into 1) a slice of operations creating -// first the config that will become the outgoing one, and then the incoming one, and -// b) another slice that, when applied to the config resulted from 1), represents the -// ConfState. -func toConfChangeSingle(cs pb.ConfState) (out []pb.ConfChangeSingle, in []pb.ConfChangeSingle) { - // Example to follow along this code: - // voters=(1 2 3) learners=(5) outgoing=(1 2 4 6) learners_next=(4) - // - // This means that before entering the joint config, the configuration - // had voters (1 2 4) and perhaps some learners that are already gone. - // The new set of voters is (1 2 3), i.e. (1 2) were kept around, and (4 6) - // are no longer voters; however 4 is poised to become a learner upon leaving - // the joint state. - // We can't tell whether 5 was a learner before entering the joint config, - // but it doesn't matter (we'll pretend that it wasn't). - // - // The code below will construct - // outgoing = add 1; add 2; add 4; add 6 - // incoming = remove 1; remove 2; remove 4; remove 6 - // add 1; add 2; add 3; - // add-learner 5; - // add-learner 4; - // - // So, when starting with an empty config, after applying 'outgoing' we have - // - // quorum=(1 2 4 6) - // - // From which we enter a joint state via 'incoming' - // - // quorum=(1 2 3)&&(1 2 4 6) learners=(5) learners_next=(4) - // - // as desired. - - for _, id := range cs.VotersOutgoing { - // If there are outgoing voters, first add them one by one so that the - // (non-joint) config has them all. - out = append(out, pb.ConfChangeSingle{ - Type: pb.ConfChangeAddNode, - NodeID: id, - }) - - } - - // We're done constructing the outgoing slice, now on to the incoming one - // (which will apply on top of the config created by the outgoing slice). - - // First, we'll remove all of the outgoing voters. - for _, id := range cs.VotersOutgoing { - in = append(in, pb.ConfChangeSingle{ - Type: pb.ConfChangeRemoveNode, - NodeID: id, - }) - } - // Then we'll add the incoming voters and learners. - for _, id := range cs.Voters { - in = append(in, pb.ConfChangeSingle{ - Type: pb.ConfChangeAddNode, - NodeID: id, - }) - } - for _, id := range cs.Learners { - in = append(in, pb.ConfChangeSingle{ - Type: pb.ConfChangeAddLearnerNode, - NodeID: id, - }) - } - // Same for LearnersNext; these are nodes we want to be learners but which - // are currently voters in the outgoing config. - for _, id := range cs.LearnersNext { - in = append(in, pb.ConfChangeSingle{ - Type: pb.ConfChangeAddLearnerNode, - NodeID: id, - }) - } - return out, in -} - -func chain(chg Changer, ops ...func(Changer) (tracker.Config, tracker.ProgressMap, error)) (tracker.Config, tracker.ProgressMap, error) { - for _, op := range ops { - cfg, prs, err := op(chg) - if err != nil { - return tracker.Config{}, nil, err - } - chg.Tracker.Config = cfg - chg.Tracker.Progress = prs - } - return chg.Tracker.Config, chg.Tracker.Progress, nil -} - -// Restore takes a Changer (which must represent an empty configuration), and -// runs a sequence of changes enacting the configuration described in the -// ConfState. -// -// TODO(tbg) it's silly that this takes a Changer. Unravel this by making sure -// the Changer only needs a ProgressMap (not a whole Tracker) at which point -// this can just take LastIndex and MaxInflight directly instead and cook up -// the results from that alone. -func Restore(chg Changer, cs pb.ConfState) (tracker.Config, tracker.ProgressMap, error) { - outgoing, incoming := toConfChangeSingle(cs) - - var ops []func(Changer) (tracker.Config, tracker.ProgressMap, error) - - if len(outgoing) == 0 { - // No outgoing config, so just apply the incoming changes one by one. - for _, cc := range incoming { - cc := cc // loop-local copy - ops = append(ops, func(chg Changer) (tracker.Config, tracker.ProgressMap, error) { - return chg.Simple(cc) - }) - } - } else { - // The ConfState describes a joint configuration. - // - // First, apply all of the changes of the outgoing config one by one, so - // that it temporarily becomes the incoming active config. For example, - // if the config is (1 2 3)&(2 3 4), this will establish (2 3 4)&(). - for _, cc := range outgoing { - cc := cc // loop-local copy - ops = append(ops, func(chg Changer) (tracker.Config, tracker.ProgressMap, error) { - return chg.Simple(cc) - }) - } - // Now enter the joint state, which rotates the above additions into the - // outgoing config, and adds the incoming config in. Continuing the - // example above, we'd get (1 2 3)&(2 3 4), i.e. the incoming operations - // would be removing 2,3,4 and then adding in 1,2,3 while transitioning - // into a joint state. - ops = append(ops, func(chg Changer) (tracker.Config, tracker.ProgressMap, error) { - return chg.EnterJoint(cs.AutoLeave, incoming...) - }) - } - - return chain(chg, ops...) -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/design.md b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/design.md deleted file mode 100644 index 7bc0531dce6f..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/design.md +++ /dev/null @@ -1,57 +0,0 @@ -## Progress - -Progress represents a follower’s progress in the view of the leader. Leader maintains progresses of all followers, and sends `replication message` to the follower based on its progress. - -`replication message` is a `msgApp` with log entries. - -A progress has two attribute: `match` and `next`. `match` is the index of the highest known matched entry. If leader knows nothing about follower’s replication status, `match` is set to zero. `next` is the index of the first entry that will be replicated to the follower. Leader puts entries from `next` to its latest one in next `replication message`. - -A progress is in one of the three state: `probe`, `replicate`, `snapshot`. - -``` - +--------------------------------------------------------+ - | send snapshot | - | | - +---------+----------+ +----------v---------+ - +---> probe | | snapshot | - | | max inflight = 1 <----------------------------------+ max inflight = 0 | - | +---------+----------+ +--------------------+ - | | 1. snapshot success - | | (next=snapshot.index + 1) - | | 2. snapshot failure - | | (no change) - | | 3. receives msgAppResp(rej=false&&index>lastsnap.index) - | | (match=m.index,next=match+1) -receives msgAppResp(rej=true) -(next=match+1)| | - | | - | | - | | receives msgAppResp(rej=false&&index>match) - | | (match=m.index,next=match+1) - | | - | | - | | - | +---------v----------+ - | | replicate | - +---+ max inflight = n | - +--------------------+ -``` - -When the progress of a follower is in `probe` state, leader sends at most one `replication message` per heartbeat interval. The leader sends `replication message` slowly and probing the actual progress of the follower. A `msgHeartbeatResp` or a `msgAppResp` with reject might trigger the sending of the next `replication message`. - -When the progress of a follower is in `replicate` state, leader sends `replication message`, then optimistically increases `next` to the latest entry sent. This is an optimized state for fast replicating log entries to the follower. - -When the progress of a follower is in `snapshot` state, leader stops sending any `replication message`. - -A newly elected leader sets the progresses of all the followers to `probe` state with `match` = 0 and `next` = last index. The leader slowly (at most once per heartbeat) sends `replication message` to the follower and probes its progress. - -A progress changes to `replicate` when the follower replies with a non-rejection `msgAppResp`, which implies that it has matched the index sent. At this point, leader starts to stream log entries to the follower fast. The progress will fall back to `probe` when the follower replies a rejection `msgAppResp` or the link layer reports the follower is unreachable. We aggressively reset `next` to `match`+1 since if we receive any `msgAppResp` soon, both `match` and `next` will increase directly to the `index` in `msgAppResp`. (We might end up with sending some duplicate entries when aggressively reset `next` too low. see open question) - -A progress changes from `probe` to `snapshot` when the follower falls very far behind and requires a snapshot. After sending `msgSnap`, the leader waits until the success, failure or abortion of the previous snapshot sent. The progress will go back to `probe` after the sending result is applied. - -### Flow Control - -1. limit the max size of message sent per message. Max should be configurable. -Lower the cost at probing state as we limit the size per message; lower the penalty when aggressively decreased to a too low `next` - -2. limit the # of in flight messages < N when in `replicate` state. N should be configurable. Most implementation will have a sending buffer on top of its actual network transport layer (not blocking raft node). We want to make sure raft does not overflow that buffer, which can cause message dropping and triggering a bunch of unnecessary resending repeatedly. diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/doc.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/doc.go deleted file mode 100644 index 68fe6f0a6edd..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/doc.go +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* -Package raft sends and receives messages in the Protocol Buffer format -defined in the raftpb package. - -Raft is a protocol with which a cluster of nodes can maintain a replicated state machine. -The state machine is kept in sync through the use of a replicated log. -For more details on Raft, see "In Search of an Understandable Consensus Algorithm" -(https://raft.github.io/raft.pdf) by Diego Ongaro and John Ousterhout. - -A simple example application, _raftexample_, is also available to help illustrate -how to use this package in practice: -https://github.com/etcd-io/etcd/tree/master/contrib/raftexample - -Usage - -The primary object in raft is a Node. You either start a Node from scratch -using raft.StartNode or start a Node from some initial state using raft.RestartNode. - -To start a node from scratch: - - storage := raft.NewMemoryStorage() - c := &Config{ - ID: 0x01, - ElectionTick: 10, - HeartbeatTick: 1, - Storage: storage, - MaxSizePerMsg: 4096, - MaxInflightMsgs: 256, - } - n := raft.StartNode(c, []raft.Peer{{ID: 0x02}, {ID: 0x03}}) - -To restart a node from previous state: - - storage := raft.NewMemoryStorage() - - // recover the in-memory storage from persistent - // snapshot, state and entries. - storage.ApplySnapshot(snapshot) - storage.SetHardState(state) - storage.Append(entries) - - c := &Config{ - ID: 0x01, - ElectionTick: 10, - HeartbeatTick: 1, - Storage: storage, - MaxSizePerMsg: 4096, - MaxInflightMsgs: 256, - } - - // restart raft without peer information. - // peer information is already included in the storage. - n := raft.RestartNode(c) - -Now that you are holding onto a Node you have a few responsibilities: - -First, you must read from the Node.Ready() channel and process the updates -it contains. These steps may be performed in parallel, except as noted in step -2. - -1. Write HardState, Entries, and Snapshot to persistent storage if they are -not empty. Note that when writing an Entry with Index i, any -previously-persisted entries with Index >= i must be discarded. - -2. Send all Messages to the nodes named in the To field. It is important that -no messages be sent until the latest HardState has been persisted to disk, -and all Entries written by any previous Ready batch (Messages may be sent while -entries from the same batch are being persisted). To reduce the I/O latency, an -optimization can be applied to make leader write to disk in parallel with its -followers (as explained at section 10.2.1 in Raft thesis). If any Message has type -MsgSnap, call Node.ReportSnapshot() after it has been sent (these messages may be -large). - -Note: Marshalling messages is not thread-safe; it is important that you -make sure that no new entries are persisted while marshalling. -The easiest way to achieve this is to serialize the messages directly inside -your main raft loop. - -3. Apply Snapshot (if any) and CommittedEntries to the state machine. -If any committed Entry has Type EntryConfChange, call Node.ApplyConfChange() -to apply it to the node. The configuration change may be cancelled at this point -by setting the NodeID field to zero before calling ApplyConfChange -(but ApplyConfChange must be called one way or the other, and the decision to cancel -must be based solely on the state machine and not external information such as -the observed health of the node). - -4. Call Node.Advance() to signal readiness for the next batch of updates. -This may be done at any time after step 1, although all updates must be processed -in the order they were returned by Ready. - -Second, all persisted log entries must be made available via an -implementation of the Storage interface. The provided MemoryStorage -type can be used for this (if you repopulate its state upon a -restart), or you can supply your own disk-backed implementation. - -Third, when you receive a message from another node, pass it to Node.Step: - - func recvRaftRPC(ctx context.Context, m raftpb.Message) { - n.Step(ctx, m) - } - -Finally, you need to call Node.Tick() at regular intervals (probably -via a time.Ticker). Raft has two important timeouts: heartbeat and the -election timeout. However, internally to the raft package time is -represented by an abstract "tick". - -The total state machine handling loop will look something like this: - - for { - select { - case <-s.Ticker: - n.Tick() - case rd := <-s.Node.Ready(): - saveToStorage(rd.State, rd.Entries, rd.Snapshot) - send(rd.Messages) - if !raft.IsEmptySnap(rd.Snapshot) { - processSnapshot(rd.Snapshot) - } - for _, entry := range rd.CommittedEntries { - process(entry) - if entry.Type == raftpb.EntryConfChange { - var cc raftpb.ConfChange - cc.Unmarshal(entry.Data) - s.Node.ApplyConfChange(cc) - } - } - s.Node.Advance() - case <-s.done: - return - } - } - -To propose changes to the state machine from your node take your application -data, serialize it into a byte slice and call: - - n.Propose(ctx, data) - -If the proposal is committed, data will appear in committed entries with type -raftpb.EntryNormal. There is no guarantee that a proposed command will be -committed; you may have to re-propose after a timeout. - -To add or remove a node in a cluster, build ConfChange struct 'cc' and call: - - n.ProposeConfChange(ctx, cc) - -After config change is committed, some committed entry with type -raftpb.EntryConfChange will be returned. You must apply it to node through: - - var cc raftpb.ConfChange - cc.Unmarshal(data) - n.ApplyConfChange(cc) - -Note: An ID represents a unique node in a cluster for all time. A -given ID MUST be used only once even if the old node has been removed. -This means that for example IP addresses make poor node IDs since they -may be reused. Node IDs must be non-zero. - -Implementation notes - -This implementation is up to date with the final Raft thesis -(https://github.com/ongardie/dissertation/blob/master/stanford.pdf), although our -implementation of the membership change protocol differs somewhat from -that described in chapter 4. The key invariant that membership changes -happen one node at a time is preserved, but in our implementation the -membership change takes effect when its entry is applied, not when it -is added to the log (so the entry is committed under the old -membership instead of the new). This is equivalent in terms of safety, -since the old and new configurations are guaranteed to overlap. - -To ensure that we do not attempt to commit two membership changes at -once by matching log positions (which would be unsafe since they -should have different quorum requirements), we simply disallow any -proposed membership change while any uncommitted change appears in -the leader's log. - -This approach introduces a problem when you try to remove a member -from a two-member cluster: If one of the members dies before the -other one receives the commit of the confchange entry, then the member -cannot be removed any more since the cluster cannot make progress. -For this reason it is highly recommended to use three or more nodes in -every cluster. - -MessageType - -Package raft sends and receives message in Protocol Buffer format (defined -in raftpb package). Each state (follower, candidate, leader) implements its -own 'step' method ('stepFollower', 'stepCandidate', 'stepLeader') when -advancing with the given raftpb.Message. Each step is determined by its -raftpb.MessageType. Note that every step is checked by one common method -'Step' that safety-checks the terms of node and incoming message to prevent -stale log entries: - - 'MsgHup' is used for election. If a node is a follower or candidate, the - 'tick' function in 'raft' struct is set as 'tickElection'. If a follower or - candidate has not received any heartbeat before the election timeout, it - passes 'MsgHup' to its Step method and becomes (or remains) a candidate to - start a new election. - - 'MsgBeat' is an internal type that signals the leader to send a heartbeat of - the 'MsgHeartbeat' type. If a node is a leader, the 'tick' function in - the 'raft' struct is set as 'tickHeartbeat', and triggers the leader to - send periodic 'MsgHeartbeat' messages to its followers. - - 'MsgProp' proposes to append data to its log entries. This is a special - type to redirect proposals to leader. Therefore, send method overwrites - raftpb.Message's term with its HardState's term to avoid attaching its - local term to 'MsgProp'. When 'MsgProp' is passed to the leader's 'Step' - method, the leader first calls the 'appendEntry' method to append entries - to its log, and then calls 'bcastAppend' method to send those entries to - its peers. When passed to candidate, 'MsgProp' is dropped. When passed to - follower, 'MsgProp' is stored in follower's mailbox(msgs) by the send - method. It is stored with sender's ID and later forwarded to leader by - rafthttp package. - - 'MsgApp' contains log entries to replicate. A leader calls bcastAppend, - which calls sendAppend, which sends soon-to-be-replicated logs in 'MsgApp' - type. When 'MsgApp' is passed to candidate's Step method, candidate reverts - back to follower, because it indicates that there is a valid leader sending - 'MsgApp' messages. Candidate and follower respond to this message in - 'MsgAppResp' type. - - 'MsgAppResp' is response to log replication request('MsgApp'). When - 'MsgApp' is passed to candidate or follower's Step method, it responds by - calling 'handleAppendEntries' method, which sends 'MsgAppResp' to raft - mailbox. - - 'MsgVote' requests votes for election. When a node is a follower or - candidate and 'MsgHup' is passed to its Step method, then the node calls - 'campaign' method to campaign itself to become a leader. Once 'campaign' - method is called, the node becomes candidate and sends 'MsgVote' to peers - in cluster to request votes. When passed to leader or candidate's Step - method and the message's Term is lower than leader's or candidate's, - 'MsgVote' will be rejected ('MsgVoteResp' is returned with Reject true). - If leader or candidate receives 'MsgVote' with higher term, it will revert - back to follower. When 'MsgVote' is passed to follower, it votes for the - sender only when sender's last term is greater than MsgVote's term or - sender's last term is equal to MsgVote's term but sender's last committed - index is greater than or equal to follower's. - - 'MsgVoteResp' contains responses from voting request. When 'MsgVoteResp' is - passed to candidate, the candidate calculates how many votes it has won. If - it's more than majority (quorum), it becomes leader and calls 'bcastAppend'. - If candidate receives majority of votes of denials, it reverts back to - follower. - - 'MsgPreVote' and 'MsgPreVoteResp' are used in an optional two-phase election - protocol. When Config.PreVote is true, a pre-election is carried out first - (using the same rules as a regular election), and no node increases its term - number unless the pre-election indicates that the campaigning node would win. - This minimizes disruption when a partitioned node rejoins the cluster. - - 'MsgSnap' requests to install a snapshot message. When a node has just - become a leader or the leader receives 'MsgProp' message, it calls - 'bcastAppend' method, which then calls 'sendAppend' method to each - follower. In 'sendAppend', if a leader fails to get term or entries, - the leader requests snapshot by sending 'MsgSnap' type message. - - 'MsgSnapStatus' tells the result of snapshot install message. When a - follower rejected 'MsgSnap', it indicates the snapshot request with - 'MsgSnap' had failed from network issues which causes the network layer - to fail to send out snapshots to its followers. Then leader considers - follower's progress as probe. When 'MsgSnap' were not rejected, it - indicates that the snapshot succeeded and the leader sets follower's - progress to probe and resumes its log replication. - - 'MsgHeartbeat' sends heartbeat from leader. When 'MsgHeartbeat' is passed - to candidate and message's term is higher than candidate's, the candidate - reverts back to follower and updates its committed index from the one in - this heartbeat. And it sends the message to its mailbox. When - 'MsgHeartbeat' is passed to follower's Step method and message's term is - higher than follower's, the follower updates its leaderID with the ID - from the message. - - 'MsgHeartbeatResp' is a response to 'MsgHeartbeat'. When 'MsgHeartbeatResp' - is passed to leader's Step method, the leader knows which follower - responded. And only when the leader's last committed index is greater than - follower's Match index, the leader runs 'sendAppend` method. - - 'MsgUnreachable' tells that request(message) wasn't delivered. When - 'MsgUnreachable' is passed to leader's Step method, the leader discovers - that the follower that sent this 'MsgUnreachable' is not reachable, often - indicating 'MsgApp' is lost. When follower's progress state is replicate, - the leader sets it back to probe. - -*/ -package raft diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/log.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/log.go deleted file mode 100644 index 77eedfccbad7..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/log.go +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import ( - "fmt" - "log" - - pb "go.etcd.io/etcd/raft/raftpb" -) - -type raftLog struct { - // storage contains all stable entries since the last snapshot. - storage Storage - - // unstable contains all unstable entries and snapshot. - // they will be saved into storage. - unstable unstable - - // committed is the highest log position that is known to be in - // stable storage on a quorum of nodes. - committed uint64 - // applied is the highest log position that the application has - // been instructed to apply to its state machine. - // Invariant: applied <= committed - applied uint64 - - logger Logger - - // maxNextEntsSize is the maximum number aggregate byte size of the messages - // returned from calls to nextEnts. - maxNextEntsSize uint64 -} - -// newLog returns log using the given storage and default options. It -// recovers the log to the state that it just commits and applies the -// latest snapshot. -func newLog(storage Storage, logger Logger) *raftLog { - return newLogWithSize(storage, logger, noLimit) -} - -// newLogWithSize returns a log using the given storage and max -// message size. -func newLogWithSize(storage Storage, logger Logger, maxNextEntsSize uint64) *raftLog { - if storage == nil { - log.Panic("storage must not be nil") - } - log := &raftLog{ - storage: storage, - logger: logger, - maxNextEntsSize: maxNextEntsSize, - } - firstIndex, err := storage.FirstIndex() - if err != nil { - panic(err) // TODO(bdarnell) - } - lastIndex, err := storage.LastIndex() - if err != nil { - panic(err) // TODO(bdarnell) - } - log.unstable.offset = lastIndex + 1 - log.unstable.logger = logger - // Initialize our committed and applied pointers to the time of the last compaction. - log.committed = firstIndex - 1 - log.applied = firstIndex - 1 - - return log -} - -func (l *raftLog) String() string { - return fmt.Sprintf("committed=%d, applied=%d, unstable.offset=%d, len(unstable.Entries)=%d", l.committed, l.applied, l.unstable.offset, len(l.unstable.entries)) -} - -// maybeAppend returns (0, false) if the entries cannot be appended. Otherwise, -// it returns (last index of new entries, true). -func (l *raftLog) maybeAppend(index, logTerm, committed uint64, ents ...pb.Entry) (lastnewi uint64, ok bool) { - if l.matchTerm(index, logTerm) { - lastnewi = index + uint64(len(ents)) - ci := l.findConflict(ents) - switch { - case ci == 0: - case ci <= l.committed: - l.logger.Panicf("entry %d conflict with committed entry [committed(%d)]", ci, l.committed) - default: - offset := index + 1 - l.append(ents[ci-offset:]...) - } - l.commitTo(min(committed, lastnewi)) - return lastnewi, true - } - return 0, false -} - -func (l *raftLog) append(ents ...pb.Entry) uint64 { - if len(ents) == 0 { - return l.lastIndex() - } - if after := ents[0].Index - 1; after < l.committed { - l.logger.Panicf("after(%d) is out of range [committed(%d)]", after, l.committed) - } - l.unstable.truncateAndAppend(ents) - return l.lastIndex() -} - -// findConflict finds the index of the conflict. -// It returns the first pair of conflicting entries between the existing -// entries and the given entries, if there are any. -// If there is no conflicting entries, and the existing entries contains -// all the given entries, zero will be returned. -// If there is no conflicting entries, but the given entries contains new -// entries, the index of the first new entry will be returned. -// An entry is considered to be conflicting if it has the same index but -// a different term. -// The first entry MUST have an index equal to the argument 'from'. -// The index of the given entries MUST be continuously increasing. -func (l *raftLog) findConflict(ents []pb.Entry) uint64 { - for _, ne := range ents { - if !l.matchTerm(ne.Index, ne.Term) { - if ne.Index <= l.lastIndex() { - l.logger.Infof("found conflict at index %d [existing term: %d, conflicting term: %d]", - ne.Index, l.zeroTermOnErrCompacted(l.term(ne.Index)), ne.Term) - } - return ne.Index - } - } - return 0 -} - -func (l *raftLog) unstableEntries() []pb.Entry { - if len(l.unstable.entries) == 0 { - return nil - } - return l.unstable.entries -} - -// nextEnts returns all the available entries for execution. -// If applied is smaller than the index of snapshot, it returns all committed -// entries after the index of snapshot. -func (l *raftLog) nextEnts() (ents []pb.Entry) { - off := max(l.applied+1, l.firstIndex()) - if l.committed+1 > off { - ents, err := l.slice(off, l.committed+1, l.maxNextEntsSize) - if err != nil { - l.logger.Panicf("unexpected error when getting unapplied entries (%v)", err) - } - return ents - } - return nil -} - -// hasNextEnts returns if there is any available entries for execution. This -// is a fast check without heavy raftLog.slice() in raftLog.nextEnts(). -func (l *raftLog) hasNextEnts() bool { - off := max(l.applied+1, l.firstIndex()) - return l.committed+1 > off -} - -func (l *raftLog) snapshot() (pb.Snapshot, error) { - if l.unstable.snapshot != nil { - return *l.unstable.snapshot, nil - } - return l.storage.Snapshot() -} - -func (l *raftLog) firstIndex() uint64 { - if i, ok := l.unstable.maybeFirstIndex(); ok { - return i - } - index, err := l.storage.FirstIndex() - if err != nil { - panic(err) // TODO(bdarnell) - } - return index -} - -func (l *raftLog) lastIndex() uint64 { - if i, ok := l.unstable.maybeLastIndex(); ok { - return i - } - i, err := l.storage.LastIndex() - if err != nil { - panic(err) // TODO(bdarnell) - } - return i -} - -func (l *raftLog) commitTo(tocommit uint64) { - // never decrease commit - if l.committed < tocommit { - if l.lastIndex() < tocommit { - l.logger.Panicf("tocommit(%d) is out of range [lastIndex(%d)]. Was the raft log corrupted, truncated, or lost?", tocommit, l.lastIndex()) - } - l.committed = tocommit - } -} - -func (l *raftLog) appliedTo(i uint64) { - if i == 0 { - return - } - if l.committed < i || i < l.applied { - l.logger.Panicf("applied(%d) is out of range [prevApplied(%d), committed(%d)]", i, l.applied, l.committed) - } - l.applied = i -} - -func (l *raftLog) stableTo(i, t uint64) { l.unstable.stableTo(i, t) } - -func (l *raftLog) stableSnapTo(i uint64) { l.unstable.stableSnapTo(i) } - -func (l *raftLog) lastTerm() uint64 { - t, err := l.term(l.lastIndex()) - if err != nil { - l.logger.Panicf("unexpected error when getting the last term (%v)", err) - } - return t -} - -func (l *raftLog) term(i uint64) (uint64, error) { - // the valid term range is [index of dummy entry, last index] - dummyIndex := l.firstIndex() - 1 - if i < dummyIndex || i > l.lastIndex() { - // TODO: return an error instead? - return 0, nil - } - - if t, ok := l.unstable.maybeTerm(i); ok { - return t, nil - } - - t, err := l.storage.Term(i) - if err == nil { - return t, nil - } - if err == ErrCompacted || err == ErrUnavailable { - return 0, err - } - panic(err) // TODO(bdarnell) -} - -func (l *raftLog) entries(i, maxsize uint64) ([]pb.Entry, error) { - if i > l.lastIndex() { - return nil, nil - } - return l.slice(i, l.lastIndex()+1, maxsize) -} - -// allEntries returns all entries in the log. -func (l *raftLog) allEntries() []pb.Entry { - ents, err := l.entries(l.firstIndex(), noLimit) - if err == nil { - return ents - } - if err == ErrCompacted { // try again if there was a racing compaction - return l.allEntries() - } - // TODO (xiangli): handle error? - panic(err) -} - -// isUpToDate determines if the given (lastIndex,term) log is more up-to-date -// by comparing the index and term of the last entries in the existing logs. -// If the logs have last entries with different terms, then the log with the -// later term is more up-to-date. If the logs end with the same term, then -// whichever log has the larger lastIndex is more up-to-date. If the logs are -// the same, the given log is up-to-date. -func (l *raftLog) isUpToDate(lasti, term uint64) bool { - return term > l.lastTerm() || (term == l.lastTerm() && lasti >= l.lastIndex()) -} - -func (l *raftLog) matchTerm(i, term uint64) bool { - t, err := l.term(i) - if err != nil { - return false - } - return t == term -} - -func (l *raftLog) maybeCommit(maxIndex, term uint64) bool { - if maxIndex > l.committed && l.zeroTermOnErrCompacted(l.term(maxIndex)) == term { - l.commitTo(maxIndex) - return true - } - return false -} - -func (l *raftLog) restore(s pb.Snapshot) { - l.logger.Infof("log [%s] starts to restore snapshot [index: %d, term: %d]", l, s.Metadata.Index, s.Metadata.Term) - l.committed = s.Metadata.Index - l.unstable.restore(s) -} - -// slice returns a slice of log entries from lo through hi-1, inclusive. -func (l *raftLog) slice(lo, hi, maxSize uint64) ([]pb.Entry, error) { - err := l.mustCheckOutOfBounds(lo, hi) - if err != nil { - return nil, err - } - if lo == hi { - return nil, nil - } - var ents []pb.Entry - if lo < l.unstable.offset { - storedEnts, err := l.storage.Entries(lo, min(hi, l.unstable.offset), maxSize) - if err == ErrCompacted { - return nil, err - } else if err == ErrUnavailable { - l.logger.Panicf("entries[%d:%d) is unavailable from storage", lo, min(hi, l.unstable.offset)) - } else if err != nil { - panic(err) // TODO(bdarnell) - } - - // check if ents has reached the size limitation - if uint64(len(storedEnts)) < min(hi, l.unstable.offset)-lo { - return storedEnts, nil - } - - ents = storedEnts - } - if hi > l.unstable.offset { - unstable := l.unstable.slice(max(lo, l.unstable.offset), hi) - if len(ents) > 0 { - combined := make([]pb.Entry, len(ents)+len(unstable)) - n := copy(combined, ents) - copy(combined[n:], unstable) - ents = combined - } else { - ents = unstable - } - } - return limitSize(ents, maxSize), nil -} - -// l.firstIndex <= lo <= hi <= l.firstIndex + len(l.entries) -func (l *raftLog) mustCheckOutOfBounds(lo, hi uint64) error { - if lo > hi { - l.logger.Panicf("invalid slice %d > %d", lo, hi) - } - fi := l.firstIndex() - if lo < fi { - return ErrCompacted - } - - length := l.lastIndex() + 1 - fi - if lo < fi || hi > fi+length { - l.logger.Panicf("slice[%d,%d) out of bound [%d,%d]", lo, hi, fi, l.lastIndex()) - } - return nil -} - -func (l *raftLog) zeroTermOnErrCompacted(t uint64, err error) uint64 { - if err == nil { - return t - } - if err == ErrCompacted { - return 0 - } - l.logger.Panicf("unexpected error (%v)", err) - return 0 -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/log_unstable.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/log_unstable.go deleted file mode 100644 index 1bff5a7bdcb9..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/log_unstable.go +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import pb "go.etcd.io/etcd/raft/raftpb" - -// unstable.entries[i] has raft log position i+unstable.offset. -// Note that unstable.offset may be less than the highest log -// position in storage; this means that the next write to storage -// might need to truncate the log before persisting unstable.entries. -type unstable struct { - // the incoming unstable snapshot, if any. - snapshot *pb.Snapshot - // all entries that have not yet been written to storage. - entries []pb.Entry - offset uint64 - - logger Logger -} - -// maybeFirstIndex returns the index of the first possible entry in entries -// if it has a snapshot. -func (u *unstable) maybeFirstIndex() (uint64, bool) { - if u.snapshot != nil { - return u.snapshot.Metadata.Index + 1, true - } - return 0, false -} - -// maybeLastIndex returns the last index if it has at least one -// unstable entry or snapshot. -func (u *unstable) maybeLastIndex() (uint64, bool) { - if l := len(u.entries); l != 0 { - return u.offset + uint64(l) - 1, true - } - if u.snapshot != nil { - return u.snapshot.Metadata.Index, true - } - return 0, false -} - -// maybeTerm returns the term of the entry at index i, if there -// is any. -func (u *unstable) maybeTerm(i uint64) (uint64, bool) { - if i < u.offset { - if u.snapshot != nil && u.snapshot.Metadata.Index == i { - return u.snapshot.Metadata.Term, true - } - return 0, false - } - - last, ok := u.maybeLastIndex() - if !ok { - return 0, false - } - if i > last { - return 0, false - } - - return u.entries[i-u.offset].Term, true -} - -func (u *unstable) stableTo(i, t uint64) { - gt, ok := u.maybeTerm(i) - if !ok { - return - } - // if i < offset, term is matched with the snapshot - // only update the unstable entries if term is matched with - // an unstable entry. - if gt == t && i >= u.offset { - u.entries = u.entries[i+1-u.offset:] - u.offset = i + 1 - u.shrinkEntriesArray() - } -} - -// shrinkEntriesArray discards the underlying array used by the entries slice -// if most of it isn't being used. This avoids holding references to a bunch of -// potentially large entries that aren't needed anymore. Simply clearing the -// entries wouldn't be safe because clients might still be using them. -func (u *unstable) shrinkEntriesArray() { - // We replace the array if we're using less than half of the space in - // it. This number is fairly arbitrary, chosen as an attempt to balance - // memory usage vs number of allocations. It could probably be improved - // with some focused tuning. - const lenMultiple = 2 - if len(u.entries) == 0 { - u.entries = nil - } else if len(u.entries)*lenMultiple < cap(u.entries) { - newEntries := make([]pb.Entry, len(u.entries)) - copy(newEntries, u.entries) - u.entries = newEntries - } -} - -func (u *unstable) stableSnapTo(i uint64) { - if u.snapshot != nil && u.snapshot.Metadata.Index == i { - u.snapshot = nil - } -} - -func (u *unstable) restore(s pb.Snapshot) { - u.offset = s.Metadata.Index + 1 - u.entries = nil - u.snapshot = &s -} - -func (u *unstable) truncateAndAppend(ents []pb.Entry) { - after := ents[0].Index - switch { - case after == u.offset+uint64(len(u.entries)): - // after is the next index in the u.entries - // directly append - u.entries = append(u.entries, ents...) - case after <= u.offset: - u.logger.Infof("replace the unstable entries from index %d", after) - // The log is being truncated to before our current offset - // portion, so set the offset and replace the entries - u.offset = after - u.entries = ents - default: - // truncate to after and copy to u.entries - // then append - u.logger.Infof("truncate the unstable entries before index %d", after) - u.entries = append([]pb.Entry{}, u.slice(u.offset, after)...) - u.entries = append(u.entries, ents...) - } -} - -func (u *unstable) slice(lo uint64, hi uint64) []pb.Entry { - u.mustCheckOutOfBounds(lo, hi) - return u.entries[lo-u.offset : hi-u.offset] -} - -// u.offset <= lo <= hi <= u.offset+len(u.entries) -func (u *unstable) mustCheckOutOfBounds(lo, hi uint64) { - if lo > hi { - u.logger.Panicf("invalid unstable.slice %d > %d", lo, hi) - } - upper := u.offset + uint64(len(u.entries)) - if lo < u.offset || hi > upper { - u.logger.Panicf("unstable.slice[%d,%d) out of bound [%d,%d]", lo, hi, u.offset, upper) - } -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/logger.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/logger.go deleted file mode 100644 index 6d89629650d7..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/logger.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import ( - "fmt" - "io/ioutil" - "log" - "os" - "sync" -) - -type Logger interface { - Debug(v ...interface{}) - Debugf(format string, v ...interface{}) - - Error(v ...interface{}) - Errorf(format string, v ...interface{}) - - Info(v ...interface{}) - Infof(format string, v ...interface{}) - - Warning(v ...interface{}) - Warningf(format string, v ...interface{}) - - Fatal(v ...interface{}) - Fatalf(format string, v ...interface{}) - - Panic(v ...interface{}) - Panicf(format string, v ...interface{}) -} - -func SetLogger(l Logger) { - raftLoggerMu.Lock() - raftLogger = l - raftLoggerMu.Unlock() -} - -var ( - defaultLogger = &DefaultLogger{Logger: log.New(os.Stderr, "raft", log.LstdFlags)} - discardLogger = &DefaultLogger{Logger: log.New(ioutil.Discard, "", 0)} - raftLoggerMu sync.Mutex - raftLogger = Logger(defaultLogger) -) - -const ( - calldepth = 2 -) - -// DefaultLogger is a default implementation of the Logger interface. -type DefaultLogger struct { - *log.Logger - debug bool -} - -func (l *DefaultLogger) EnableTimestamps() { - l.SetFlags(l.Flags() | log.Ldate | log.Ltime) -} - -func (l *DefaultLogger) EnableDebug() { - l.debug = true -} - -func (l *DefaultLogger) Debug(v ...interface{}) { - if l.debug { - l.Output(calldepth, header("DEBUG", fmt.Sprint(v...))) - } -} - -func (l *DefaultLogger) Debugf(format string, v ...interface{}) { - if l.debug { - l.Output(calldepth, header("DEBUG", fmt.Sprintf(format, v...))) - } -} - -func (l *DefaultLogger) Info(v ...interface{}) { - l.Output(calldepth, header("INFO", fmt.Sprint(v...))) -} - -func (l *DefaultLogger) Infof(format string, v ...interface{}) { - l.Output(calldepth, header("INFO", fmt.Sprintf(format, v...))) -} - -func (l *DefaultLogger) Error(v ...interface{}) { - l.Output(calldepth, header("ERROR", fmt.Sprint(v...))) -} - -func (l *DefaultLogger) Errorf(format string, v ...interface{}) { - l.Output(calldepth, header("ERROR", fmt.Sprintf(format, v...))) -} - -func (l *DefaultLogger) Warning(v ...interface{}) { - l.Output(calldepth, header("WARN", fmt.Sprint(v...))) -} - -func (l *DefaultLogger) Warningf(format string, v ...interface{}) { - l.Output(calldepth, header("WARN", fmt.Sprintf(format, v...))) -} - -func (l *DefaultLogger) Fatal(v ...interface{}) { - l.Output(calldepth, header("FATAL", fmt.Sprint(v...))) - os.Exit(1) -} - -func (l *DefaultLogger) Fatalf(format string, v ...interface{}) { - l.Output(calldepth, header("FATAL", fmt.Sprintf(format, v...))) - os.Exit(1) -} - -func (l *DefaultLogger) Panic(v ...interface{}) { - l.Logger.Panic(v...) -} - -func (l *DefaultLogger) Panicf(format string, v ...interface{}) { - l.Logger.Panicf(format, v...) -} - -func header(lvl, msg string) string { - return fmt.Sprintf("%s: %s", lvl, msg) -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/node.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/node.go deleted file mode 100644 index ab6185b99ec2..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/node.go +++ /dev/null @@ -1,584 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import ( - "context" - "errors" - - pb "go.etcd.io/etcd/raft/raftpb" -) - -type SnapshotStatus int - -const ( - SnapshotFinish SnapshotStatus = 1 - SnapshotFailure SnapshotStatus = 2 -) - -var ( - emptyState = pb.HardState{} - - // ErrStopped is returned by methods on Nodes that have been stopped. - ErrStopped = errors.New("raft: stopped") -) - -// SoftState provides state that is useful for logging and debugging. -// The state is volatile and does not need to be persisted to the WAL. -type SoftState struct { - Lead uint64 // must use atomic operations to access; keep 64-bit aligned. - RaftState StateType -} - -func (a *SoftState) equal(b *SoftState) bool { - return a.Lead == b.Lead && a.RaftState == b.RaftState -} - -// Ready encapsulates the entries and messages that are ready to read, -// be saved to stable storage, committed or sent to other peers. -// All fields in Ready are read-only. -type Ready struct { - // The current volatile state of a Node. - // SoftState will be nil if there is no update. - // It is not required to consume or store SoftState. - *SoftState - - // The current state of a Node to be saved to stable storage BEFORE - // Messages are sent. - // HardState will be equal to empty state if there is no update. - pb.HardState - - // ReadStates can be used for node to serve linearizable read requests locally - // when its applied index is greater than the index in ReadState. - // Note that the readState will be returned when raft receives msgReadIndex. - // The returned is only valid for the request that requested to read. - ReadStates []ReadState - - // Entries specifies entries to be saved to stable storage BEFORE - // Messages are sent. - Entries []pb.Entry - - // Snapshot specifies the snapshot to be saved to stable storage. - Snapshot pb.Snapshot - - // CommittedEntries specifies entries to be committed to a - // store/state-machine. These have previously been committed to stable - // store. - CommittedEntries []pb.Entry - - // Messages specifies outbound messages to be sent AFTER Entries are - // committed to stable storage. - // If it contains a MsgSnap message, the application MUST report back to raft - // when the snapshot has been received or has failed by calling ReportSnapshot. - Messages []pb.Message - - // MustSync indicates whether the HardState and Entries must be synchronously - // written to disk or if an asynchronous write is permissible. - MustSync bool -} - -func isHardStateEqual(a, b pb.HardState) bool { - return a.Term == b.Term && a.Vote == b.Vote && a.Commit == b.Commit -} - -// IsEmptyHardState returns true if the given HardState is empty. -func IsEmptyHardState(st pb.HardState) bool { - return isHardStateEqual(st, emptyState) -} - -// IsEmptySnap returns true if the given Snapshot is empty. -func IsEmptySnap(sp pb.Snapshot) bool { - return sp.Metadata.Index == 0 -} - -func (rd Ready) containsUpdates() bool { - return rd.SoftState != nil || !IsEmptyHardState(rd.HardState) || - !IsEmptySnap(rd.Snapshot) || len(rd.Entries) > 0 || - len(rd.CommittedEntries) > 0 || len(rd.Messages) > 0 || len(rd.ReadStates) != 0 -} - -// appliedCursor extracts from the Ready the highest index the client has -// applied (once the Ready is confirmed via Advance). If no information is -// contained in the Ready, returns zero. -func (rd Ready) appliedCursor() uint64 { - if n := len(rd.CommittedEntries); n > 0 { - return rd.CommittedEntries[n-1].Index - } - if index := rd.Snapshot.Metadata.Index; index > 0 { - return index - } - return 0 -} - -// Node represents a node in a raft cluster. -type Node interface { - // Tick increments the internal logical clock for the Node by a single tick. Election - // timeouts and heartbeat timeouts are in units of ticks. - Tick() - // Campaign causes the Node to transition to candidate state and start campaigning to become leader. - Campaign(ctx context.Context) error - // Propose proposes that data be appended to the log. Note that proposals can be lost without - // notice, therefore it is user's job to ensure proposal retries. - Propose(ctx context.Context, data []byte) error - // ProposeConfChange proposes a configuration change. Like any proposal, the - // configuration change may be dropped with or without an error being - // returned. In particular, configuration changes are dropped unless the - // leader has certainty that there is no prior unapplied configuration - // change in its log. - // - // The method accepts either a pb.ConfChange (deprecated) or pb.ConfChangeV2 - // message. The latter allows arbitrary configuration changes via joint - // consensus, notably including replacing a voter. Passing a ConfChangeV2 - // message is only allowed if all Nodes participating in the cluster run a - // version of this library aware of the V2 API. See pb.ConfChangeV2 for - // usage details and semantics. - ProposeConfChange(ctx context.Context, cc pb.ConfChangeI) error - - // Step advances the state machine using the given message. ctx.Err() will be returned, if any. - Step(ctx context.Context, msg pb.Message) error - - // Ready returns a channel that returns the current point-in-time state. - // Users of the Node must call Advance after retrieving the state returned by Ready. - // - // NOTE: No committed entries from the next Ready may be applied until all committed entries - // and snapshots from the previous one have finished. - Ready() <-chan Ready - - // Advance notifies the Node that the application has saved progress up to the last Ready. - // It prepares the node to return the next available Ready. - // - // The application should generally call Advance after it applies the entries in last Ready. - // - // However, as an optimization, the application may call Advance while it is applying the - // commands. For example. when the last Ready contains a snapshot, the application might take - // a long time to apply the snapshot data. To continue receiving Ready without blocking raft - // progress, it can call Advance before finishing applying the last ready. - Advance() - // ApplyConfChange applies a config change (previously passed to - // ProposeConfChange) to the node. This must be called whenever a config - // change is observed in Ready.CommittedEntries. - // - // Returns an opaque non-nil ConfState protobuf which must be recorded in - // snapshots. - ApplyConfChange(cc pb.ConfChangeI) *pb.ConfState - - // TransferLeadership attempts to transfer leadership to the given transferee. - TransferLeadership(ctx context.Context, lead, transferee uint64) - - // ReadIndex request a read state. The read state will be set in the ready. - // Read state has a read index. Once the application advances further than the read - // index, any linearizable read requests issued before the read request can be - // processed safely. The read state will have the same rctx attached. - ReadIndex(ctx context.Context, rctx []byte) error - - // Status returns the current status of the raft state machine. - Status() Status - // ReportUnreachable reports the given node is not reachable for the last send. - ReportUnreachable(id uint64) - // ReportSnapshot reports the status of the sent snapshot. The id is the raft ID of the follower - // who is meant to receive the snapshot, and the status is SnapshotFinish or SnapshotFailure. - // Calling ReportSnapshot with SnapshotFinish is a no-op. But, any failure in applying a - // snapshot (for e.g., while streaming it from leader to follower), should be reported to the - // leader with SnapshotFailure. When leader sends a snapshot to a follower, it pauses any raft - // log probes until the follower can apply the snapshot and advance its state. If the follower - // can't do that, for e.g., due to a crash, it could end up in a limbo, never getting any - // updates from the leader. Therefore, it is crucial that the application ensures that any - // failure in snapshot sending is caught and reported back to the leader; so it can resume raft - // log probing in the follower. - ReportSnapshot(id uint64, status SnapshotStatus) - // Stop performs any necessary termination of the Node. - Stop() -} - -type Peer struct { - ID uint64 - Context []byte -} - -// StartNode returns a new Node given configuration and a list of raft peers. -// It appends a ConfChangeAddNode entry for each given peer to the initial log. -// -// Peers must not be zero length; call RestartNode in that case. -func StartNode(c *Config, peers []Peer) Node { - if len(peers) == 0 { - panic("no peers given; use RestartNode instead") - } - rn, err := NewRawNode(c) - if err != nil { - panic(err) - } - rn.Bootstrap(peers) - - n := newNode(rn) - - go n.run() - return &n -} - -// RestartNode is similar to StartNode but does not take a list of peers. -// The current membership of the cluster will be restored from the Storage. -// If the caller has an existing state machine, pass in the last log index that -// has been applied to it; otherwise use zero. -func RestartNode(c *Config) Node { - rn, err := NewRawNode(c) - if err != nil { - panic(err) - } - n := newNode(rn) - go n.run() - return &n -} - -type msgWithResult struct { - m pb.Message - result chan error -} - -// node is the canonical implementation of the Node interface -type node struct { - propc chan msgWithResult - recvc chan pb.Message - confc chan pb.ConfChangeV2 - confstatec chan pb.ConfState - readyc chan Ready - advancec chan struct{} - tickc chan struct{} - done chan struct{} - stop chan struct{} - status chan chan Status - - rn *RawNode -} - -func newNode(rn *RawNode) node { - return node{ - propc: make(chan msgWithResult), - recvc: make(chan pb.Message), - confc: make(chan pb.ConfChangeV2), - confstatec: make(chan pb.ConfState), - readyc: make(chan Ready), - advancec: make(chan struct{}), - // make tickc a buffered chan, so raft node can buffer some ticks when the node - // is busy processing raft messages. Raft node will resume process buffered - // ticks when it becomes idle. - tickc: make(chan struct{}, 128), - done: make(chan struct{}), - stop: make(chan struct{}), - status: make(chan chan Status), - rn: rn, - } -} - -func (n *node) Stop() { - select { - case n.stop <- struct{}{}: - // Not already stopped, so trigger it - case <-n.done: - // Node has already been stopped - no need to do anything - return - } - // Block until the stop has been acknowledged by run() - <-n.done -} - -func (n *node) run() { - var propc chan msgWithResult - var readyc chan Ready - var advancec chan struct{} - var rd Ready - - r := n.rn.raft - - lead := None - - for { - if advancec != nil { - readyc = nil - } else if n.rn.HasReady() { - // Populate a Ready. Note that this Ready is not guaranteed to - // actually be handled. We will arm readyc, but there's no guarantee - // that we will actually send on it. It's possible that we will - // service another channel instead, loop around, and then populate - // the Ready again. We could instead force the previous Ready to be - // handled first, but it's generally good to emit larger Readys plus - // it simplifies testing (by emitting less frequently and more - // predictably). - rd = n.rn.readyWithoutAccept() - readyc = n.readyc - } - - if lead != r.lead { - if r.hasLeader() { - if lead == None { - r.logger.Infof("raft.node: %x elected leader %x at term %d", r.id, r.lead, r.Term) - } else { - r.logger.Infof("raft.node: %x changed leader from %x to %x at term %d", r.id, lead, r.lead, r.Term) - } - propc = n.propc - } else { - r.logger.Infof("raft.node: %x lost leader %x at term %d", r.id, lead, r.Term) - propc = nil - } - lead = r.lead - } - - select { - // TODO: maybe buffer the config propose if there exists one (the way - // described in raft dissertation) - // Currently it is dropped in Step silently. - case pm := <-propc: - m := pm.m - m.From = r.id - err := r.Step(m) - if pm.result != nil { - pm.result <- err - close(pm.result) - } - case m := <-n.recvc: - // filter out response message from unknown From. - if pr := r.prs.Progress[m.From]; pr != nil || !IsResponseMsg(m.Type) { - r.Step(m) - } - case cc := <-n.confc: - _, okBefore := r.prs.Progress[r.id] - cs := r.applyConfChange(cc) - // If the node was removed, block incoming proposals. Note that we - // only do this if the node was in the config before. Nodes may be - // a member of the group without knowing this (when they're catching - // up on the log and don't have the latest config) and we don't want - // to block the proposal channel in that case. - // - // NB: propc is reset when the leader changes, which, if we learn - // about it, sort of implies that we got readded, maybe? This isn't - // very sound and likely has bugs. - if _, okAfter := r.prs.Progress[r.id]; okBefore && !okAfter { - var found bool - for _, sl := range [][]uint64{cs.Voters, cs.VotersOutgoing} { - for _, id := range sl { - if id == r.id { - found = true - } - } - } - if !found { - propc = nil - } - } - select { - case n.confstatec <- cs: - case <-n.done: - } - case <-n.tickc: - n.rn.Tick() - case readyc <- rd: - n.rn.acceptReady(rd) - advancec = n.advancec - case <-advancec: - n.rn.Advance(rd) - rd = Ready{} - advancec = nil - case c := <-n.status: - c <- getStatus(r) - case <-n.stop: - close(n.done) - return - } - } -} - -// Tick increments the internal logical clock for this Node. Election timeouts -// and heartbeat timeouts are in units of ticks. -func (n *node) Tick() { - select { - case n.tickc <- struct{}{}: - case <-n.done: - default: - n.rn.raft.logger.Warningf("%x (leader %v) A tick missed to fire. Node blocks too long!", n.rn.raft.id, n.rn.raft.id == n.rn.raft.lead) - } -} - -func (n *node) Campaign(ctx context.Context) error { return n.step(ctx, pb.Message{Type: pb.MsgHup}) } - -func (n *node) Propose(ctx context.Context, data []byte) error { - return n.stepWait(ctx, pb.Message{Type: pb.MsgProp, Entries: []pb.Entry{{Data: data}}}) -} - -func (n *node) Step(ctx context.Context, m pb.Message) error { - // ignore unexpected local messages receiving over network - if IsLocalMsg(m.Type) { - // TODO: return an error? - return nil - } - return n.step(ctx, m) -} - -func confChangeToMsg(c pb.ConfChangeI) (pb.Message, error) { - typ, data, err := pb.MarshalConfChange(c) - if err != nil { - return pb.Message{}, err - } - return pb.Message{Type: pb.MsgProp, Entries: []pb.Entry{{Type: typ, Data: data}}}, nil -} - -func (n *node) ProposeConfChange(ctx context.Context, cc pb.ConfChangeI) error { - msg, err := confChangeToMsg(cc) - if err != nil { - return err - } - return n.Step(ctx, msg) -} - -func (n *node) step(ctx context.Context, m pb.Message) error { - return n.stepWithWaitOption(ctx, m, false) -} - -func (n *node) stepWait(ctx context.Context, m pb.Message) error { - return n.stepWithWaitOption(ctx, m, true) -} - -// Step advances the state machine using msgs. The ctx.Err() will be returned, -// if any. -func (n *node) stepWithWaitOption(ctx context.Context, m pb.Message, wait bool) error { - if m.Type != pb.MsgProp { - select { - case n.recvc <- m: - return nil - case <-ctx.Done(): - return ctx.Err() - case <-n.done: - return ErrStopped - } - } - ch := n.propc - pm := msgWithResult{m: m} - if wait { - pm.result = make(chan error, 1) - } - select { - case ch <- pm: - if !wait { - return nil - } - case <-ctx.Done(): - return ctx.Err() - case <-n.done: - return ErrStopped - } - select { - case err := <-pm.result: - if err != nil { - return err - } - case <-ctx.Done(): - return ctx.Err() - case <-n.done: - return ErrStopped - } - return nil -} - -func (n *node) Ready() <-chan Ready { return n.readyc } - -func (n *node) Advance() { - select { - case n.advancec <- struct{}{}: - case <-n.done: - } -} - -func (n *node) ApplyConfChange(cc pb.ConfChangeI) *pb.ConfState { - var cs pb.ConfState - select { - case n.confc <- cc.AsV2(): - case <-n.done: - } - select { - case cs = <-n.confstatec: - case <-n.done: - } - return &cs -} - -func (n *node) Status() Status { - c := make(chan Status) - select { - case n.status <- c: - return <-c - case <-n.done: - return Status{} - } -} - -func (n *node) ReportUnreachable(id uint64) { - select { - case n.recvc <- pb.Message{Type: pb.MsgUnreachable, From: id}: - case <-n.done: - } -} - -func (n *node) ReportSnapshot(id uint64, status SnapshotStatus) { - rej := status == SnapshotFailure - - select { - case n.recvc <- pb.Message{Type: pb.MsgSnapStatus, From: id, Reject: rej}: - case <-n.done: - } -} - -func (n *node) TransferLeadership(ctx context.Context, lead, transferee uint64) { - select { - // manually set 'from' and 'to', so that leader can voluntarily transfers its leadership - case n.recvc <- pb.Message{Type: pb.MsgTransferLeader, From: transferee, To: lead}: - case <-n.done: - case <-ctx.Done(): - } -} - -func (n *node) ReadIndex(ctx context.Context, rctx []byte) error { - return n.step(ctx, pb.Message{Type: pb.MsgReadIndex, Entries: []pb.Entry{{Data: rctx}}}) -} - -func newReady(r *raft, prevSoftSt *SoftState, prevHardSt pb.HardState) Ready { - rd := Ready{ - Entries: r.raftLog.unstableEntries(), - CommittedEntries: r.raftLog.nextEnts(), - Messages: r.msgs, - } - if softSt := r.softState(); !softSt.equal(prevSoftSt) { - rd.SoftState = softSt - } - if hardSt := r.hardState(); !isHardStateEqual(hardSt, prevHardSt) { - rd.HardState = hardSt - } - if r.raftLog.unstable.snapshot != nil { - rd.Snapshot = *r.raftLog.unstable.snapshot - } - if len(r.readStates) != 0 { - rd.ReadStates = r.readStates - } - rd.MustSync = MustSync(r.hardState(), prevHardSt, len(rd.Entries)) - return rd -} - -// MustSync returns true if the hard state and count of Raft entries indicate -// that a synchronous write to persistent storage is required. -func MustSync(st, prevst pb.HardState, entsnum int) bool { - // Persistent state on all servers: - // (Updated on stable storage before responding to RPCs) - // currentTerm - // votedFor - // log entries[] - return entsnum != 0 || st.Vote != prevst.Vote || st.Term != prevst.Term -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/joint.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/joint.go deleted file mode 100644 index e3741e0b0a96..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/joint.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package quorum - -// JointConfig is a configuration of two groups of (possibly overlapping) -// majority configurations. Decisions require the support of both majorities. -type JointConfig [2]MajorityConfig - -func (c JointConfig) String() string { - if len(c[1]) > 0 { - return c[0].String() + "&&" + c[1].String() - } - return c[0].String() -} - -// IDs returns a newly initialized map representing the set of voters present -// in the joint configuration. -func (c JointConfig) IDs() map[uint64]struct{} { - m := map[uint64]struct{}{} - for _, cc := range c { - for id := range cc { - m[id] = struct{}{} - } - } - return m -} - -// Describe returns a (multi-line) representation of the commit indexes for the -// given lookuper. -func (c JointConfig) Describe(l AckedIndexer) string { - return MajorityConfig(c.IDs()).Describe(l) -} - -// CommittedIndex returns the largest committed index for the given joint -// quorum. An index is jointly committed if it is committed in both constituent -// majorities. -func (c JointConfig) CommittedIndex(l AckedIndexer) Index { - idx0 := c[0].CommittedIndex(l) - idx1 := c[1].CommittedIndex(l) - if idx0 < idx1 { - return idx0 - } - return idx1 -} - -// VoteResult takes a mapping of voters to yes/no (true/false) votes and returns -// a result indicating whether the vote is pending, lost, or won. A joint quorum -// requires both majority quorums to vote in favor. -func (c JointConfig) VoteResult(votes map[uint64]bool) VoteResult { - r1 := c[0].VoteResult(votes) - r2 := c[1].VoteResult(votes) - - if r1 == r2 { - // If they agree, return the agreed state. - return r1 - } - if r1 == VoteLost || r2 == VoteLost { - // If either config has lost, loss is the only possible outcome. - return VoteLost - } - // One side won, the other one is pending, so the whole outcome is. - return VotePending -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/majority.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/majority.go deleted file mode 100644 index 8858a36b6341..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/majority.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package quorum - -import ( - "fmt" - "math" - "sort" - "strings" -) - -// MajorityConfig is a set of IDs that uses majority quorums to make decisions. -type MajorityConfig map[uint64]struct{} - -func (c MajorityConfig) String() string { - sl := make([]uint64, 0, len(c)) - for id := range c { - sl = append(sl, id) - } - sort.Slice(sl, func(i, j int) bool { return sl[i] < sl[j] }) - var buf strings.Builder - buf.WriteByte('(') - for i := range sl { - if i > 0 { - buf.WriteByte(' ') - } - fmt.Fprint(&buf, sl[i]) - } - buf.WriteByte(')') - return buf.String() -} - -// Describe returns a (multi-line) representation of the commit indexes for the -// given lookuper. -func (c MajorityConfig) Describe(l AckedIndexer) string { - if len(c) == 0 { - return "" - } - type tup struct { - id uint64 - idx Index - ok bool // idx found? - bar int // length of bar displayed for this tup - } - - // Below, populate .bar so that the i-th largest commit index has bar i (we - // plot this as sort of a progress bar). The actual code is a bit more - // complicated and also makes sure that equal index => equal bar. - - n := len(c) - info := make([]tup, 0, n) - for id := range c { - idx, ok := l.AckedIndex(id) - info = append(info, tup{id: id, idx: idx, ok: ok}) - } - - // Sort by index - sort.Slice(info, func(i, j int) bool { - if info[i].idx == info[j].idx { - return info[i].id < info[j].id - } - return info[i].idx < info[j].idx - }) - - // Populate .bar. - for i := range info { - if i > 0 && info[i-1].idx < info[i].idx { - info[i].bar = i - } - } - - // Sort by ID. - sort.Slice(info, func(i, j int) bool { - return info[i].id < info[j].id - }) - - var buf strings.Builder - - // Print. - fmt.Fprint(&buf, strings.Repeat(" ", n)+" idx\n") - for i := range info { - bar := info[i].bar - if !info[i].ok { - fmt.Fprint(&buf, "?"+strings.Repeat(" ", n)) - } else { - fmt.Fprint(&buf, strings.Repeat("x", bar)+">"+strings.Repeat(" ", n-bar)) - } - fmt.Fprintf(&buf, " %5d (id=%d)\n", info[i].idx, info[i].id) - } - return buf.String() -} - -// Slice returns the MajorityConfig as a sorted slice. -func (c MajorityConfig) Slice() []uint64 { - var sl []uint64 - for id := range c { - sl = append(sl, id) - } - sort.Slice(sl, func(i, j int) bool { return sl[i] < sl[j] }) - return sl -} - -func insertionSort(sl []uint64) { - a, b := 0, len(sl) - for i := a + 1; i < b; i++ { - for j := i; j > a && sl[j] < sl[j-1]; j-- { - sl[j], sl[j-1] = sl[j-1], sl[j] - } - } -} - -// CommittedIndex computes the committed index from those supplied via the -// provided AckedIndexer (for the active config). -func (c MajorityConfig) CommittedIndex(l AckedIndexer) Index { - n := len(c) - if n == 0 { - // This plays well with joint quorums which, when one half is the zero - // MajorityConfig, should behave like the other half. - return math.MaxUint64 - } - - // Use an on-stack slice to collect the committed indexes when n <= 7 - // (otherwise we alloc). The alternative is to stash a slice on - // MajorityConfig, but this impairs usability (as is, MajorityConfig is just - // a map, and that's nice). The assumption is that running with a - // replication factor of >7 is rare, and in cases in which it happens - // performance is a lesser concern (additionally the performance - // implications of an allocation here are far from drastic). - var stk [7]uint64 - var srt []uint64 - if len(stk) >= n { - srt = stk[:n] - } else { - srt = make([]uint64, n) - } - - { - // Fill the slice with the indexes observed. Any unused slots will be - // left as zero; these correspond to voters that may report in, but - // haven't yet. We fill from the right (since the zeroes will end up on - // the left after sorting below anyway). - i := n - 1 - for id := range c { - if idx, ok := l.AckedIndex(id); ok { - srt[i] = uint64(idx) - i-- - } - } - } - - // Sort by index. Use a bespoke algorithm (copied from the stdlib's sort - // package) to keep srt on the stack. - insertionSort(srt) - - // The smallest index into the array for which the value is acked by a - // quorum. In other words, from the end of the slice, move n/2+1 to the - // left (accounting for zero-indexing). - pos := n - (n/2 + 1) - return Index(srt[pos]) -} - -// VoteResult takes a mapping of voters to yes/no (true/false) votes and returns -// a result indicating whether the vote is pending (i.e. neither a quorum of -// yes/no has been reached), won (a quorum of yes has been reached), or lost (a -// quorum of no has been reached). -func (c MajorityConfig) VoteResult(votes map[uint64]bool) VoteResult { - if len(c) == 0 { - // By convention, the elections on an empty config win. This comes in - // handy with joint quorums because it'll make a half-populated joint - // quorum behave like a majority quorum. - return VoteWon - } - - ny := [2]int{} // vote counts for no and yes, respectively - - var missing int - for id := range c { - v, ok := votes[id] - if !ok { - missing++ - continue - } - if v { - ny[1]++ - } else { - ny[0]++ - } - } - - q := len(c)/2 + 1 - if ny[1] >= q { - return VoteWon - } - if ny[1]+missing >= q { - return VotePending - } - return VoteLost -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/quorum.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/quorum.go deleted file mode 100644 index 2899e46c96dc..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/quorum.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package quorum - -import ( - "math" - "strconv" -) - -// Index is a Raft log position. -type Index uint64 - -func (i Index) String() string { - if i == math.MaxUint64 { - return "∞" - } - return strconv.FormatUint(uint64(i), 10) -} - -// AckedIndexer allows looking up a commit index for a given ID of a voter -// from a corresponding MajorityConfig. -type AckedIndexer interface { - AckedIndex(voterID uint64) (idx Index, found bool) -} - -type mapAckIndexer map[uint64]Index - -func (m mapAckIndexer) AckedIndex(id uint64) (Index, bool) { - idx, ok := m[id] - return idx, ok -} - -// VoteResult indicates the outcome of a vote. -// -//go:generate stringer -type=VoteResult -type VoteResult uint8 - -const ( - // VotePending indicates that the decision of the vote depends on future - // votes, i.e. neither "yes" or "no" has reached quorum yet. - VotePending VoteResult = 1 + iota - // VoteLost indicates that the quorum has voted "no". - VoteLost - // VoteWon indicates that the quorum has voted "yes". - VoteWon -) diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/voteresult_string.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/voteresult_string.go deleted file mode 100644 index 9eca8fd0c96b..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/quorum/voteresult_string.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by "stringer -type=VoteResult"; DO NOT EDIT. - -package quorum - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[VotePending-1] - _ = x[VoteLost-2] - _ = x[VoteWon-3] -} - -const _VoteResult_name = "VotePendingVoteLostVoteWon" - -var _VoteResult_index = [...]uint8{0, 11, 19, 26} - -func (i VoteResult) String() string { - i -= 1 - if i >= VoteResult(len(_VoteResult_index)-1) { - return "VoteResult(" + strconv.FormatInt(int64(i+1), 10) + ")" - } - return _VoteResult_name[_VoteResult_index[i]:_VoteResult_index[i+1]] -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raft.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raft.go deleted file mode 100644 index d3c3f42574b1..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raft.go +++ /dev/null @@ -1,1656 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import ( - "bytes" - "errors" - "fmt" - "math" - "math/rand" - "sort" - "strings" - "sync" - "time" - - "go.etcd.io/etcd/raft/confchange" - "go.etcd.io/etcd/raft/quorum" - pb "go.etcd.io/etcd/raft/raftpb" - "go.etcd.io/etcd/raft/tracker" -) - -// None is a placeholder node ID used when there is no leader. -const None uint64 = 0 -const noLimit = math.MaxUint64 - -// Possible values for StateType. -const ( - StateFollower StateType = iota - StateCandidate - StateLeader - StatePreCandidate - numStates -) - -type ReadOnlyOption int - -const ( - // ReadOnlySafe guarantees the linearizability of the read only request by - // communicating with the quorum. It is the default and suggested option. - ReadOnlySafe ReadOnlyOption = iota - // ReadOnlyLeaseBased ensures linearizability of the read only request by - // relying on the leader lease. It can be affected by clock drift. - // If the clock drift is unbounded, leader might keep the lease longer than it - // should (clock can move backward/pause without any bound). ReadIndex is not safe - // in that case. - ReadOnlyLeaseBased -) - -// Possible values for CampaignType -const ( - // campaignPreElection represents the first phase of a normal election when - // Config.PreVote is true. - campaignPreElection CampaignType = "CampaignPreElection" - // campaignElection represents a normal (time-based) election (the second phase - // of the election when Config.PreVote is true). - campaignElection CampaignType = "CampaignElection" - // campaignTransfer represents the type of leader transfer - campaignTransfer CampaignType = "CampaignTransfer" -) - -// ErrProposalDropped is returned when the proposal is ignored by some cases, -// so that the proposer can be notified and fail fast. -var ErrProposalDropped = errors.New("raft proposal dropped") - -// lockedRand is a small wrapper around rand.Rand to provide -// synchronization among multiple raft groups. Only the methods needed -// by the code are exposed (e.g. Intn). -type lockedRand struct { - mu sync.Mutex - rand *rand.Rand -} - -func (r *lockedRand) Intn(n int) int { - r.mu.Lock() - v := r.rand.Intn(n) - r.mu.Unlock() - return v -} - -var globalRand = &lockedRand{ - rand: rand.New(rand.NewSource(time.Now().UnixNano())), -} - -// CampaignType represents the type of campaigning -// the reason we use the type of string instead of uint64 -// is because it's simpler to compare and fill in raft entries -type CampaignType string - -// StateType represents the role of a node in a cluster. -type StateType uint64 - -var stmap = [...]string{ - "StateFollower", - "StateCandidate", - "StateLeader", - "StatePreCandidate", -} - -func (st StateType) String() string { - return stmap[uint64(st)] -} - -// Config contains the parameters to start a raft. -type Config struct { - // ID is the identity of the local raft. ID cannot be 0. - ID uint64 - - // peers contains the IDs of all nodes (including self) in the raft cluster. It - // should only be set when starting a new raft cluster. Restarting raft from - // previous configuration will panic if peers is set. peer is private and only - // used for testing right now. - peers []uint64 - - // learners contains the IDs of all learner nodes (including self if the - // local node is a learner) in the raft cluster. learners only receives - // entries from the leader node. It does not vote or promote itself. - learners []uint64 - - // ElectionTick is the number of Node.Tick invocations that must pass between - // elections. That is, if a follower does not receive any message from the - // leader of current term before ElectionTick has elapsed, it will become - // candidate and start an election. ElectionTick must be greater than - // HeartbeatTick. We suggest ElectionTick = 10 * HeartbeatTick to avoid - // unnecessary leader switching. - ElectionTick int - // HeartbeatTick is the number of Node.Tick invocations that must pass between - // heartbeats. That is, a leader sends heartbeat messages to maintain its - // leadership every HeartbeatTick ticks. - HeartbeatTick int - - // Storage is the storage for raft. raft generates entries and states to be - // stored in storage. raft reads the persisted entries and states out of - // Storage when it needs. raft reads out the previous state and configuration - // out of storage when restarting. - Storage Storage - // Applied is the last applied index. It should only be set when restarting - // raft. raft will not return entries to the application smaller or equal to - // Applied. If Applied is unset when restarting, raft might return previous - // applied entries. This is a very application dependent configuration. - Applied uint64 - - // MaxSizePerMsg limits the max byte size of each append message. Smaller - // value lowers the raft recovery cost(initial probing and message lost - // during normal operation). On the other side, it might affect the - // throughput during normal replication. Note: math.MaxUint64 for unlimited, - // 0 for at most one entry per message. - MaxSizePerMsg uint64 - // MaxCommittedSizePerReady limits the size of the committed entries which - // can be applied. - MaxCommittedSizePerReady uint64 - // MaxUncommittedEntriesSize limits the aggregate byte size of the - // uncommitted entries that may be appended to a leader's log. Once this - // limit is exceeded, proposals will begin to return ErrProposalDropped - // errors. Note: 0 for no limit. - MaxUncommittedEntriesSize uint64 - // MaxInflightMsgs limits the max number of in-flight append messages during - // optimistic replication phase. The application transportation layer usually - // has its own sending buffer over TCP/UDP. Setting MaxInflightMsgs to avoid - // overflowing that sending buffer. TODO (xiangli): feedback to application to - // limit the proposal rate? - MaxInflightMsgs int - - // CheckQuorum specifies if the leader should check quorum activity. Leader - // steps down when quorum is not active for an electionTimeout. - CheckQuorum bool - - // PreVote enables the Pre-Vote algorithm described in raft thesis section - // 9.6. This prevents disruption when a node that has been partitioned away - // rejoins the cluster. - PreVote bool - - // ReadOnlyOption specifies how the read only request is processed. - // - // ReadOnlySafe guarantees the linearizability of the read only request by - // communicating with the quorum. It is the default and suggested option. - // - // ReadOnlyLeaseBased ensures linearizability of the read only request by - // relying on the leader lease. It can be affected by clock drift. - // If the clock drift is unbounded, leader might keep the lease longer than it - // should (clock can move backward/pause without any bound). ReadIndex is not safe - // in that case. - // CheckQuorum MUST be enabled if ReadOnlyOption is ReadOnlyLeaseBased. - ReadOnlyOption ReadOnlyOption - - // Logger is the logger used for raft log. For multinode which can host - // multiple raft group, each raft group can have its own logger - Logger Logger - - // DisableProposalForwarding set to true means that followers will drop - // proposals, rather than forwarding them to the leader. One use case for - // this feature would be in a situation where the Raft leader is used to - // compute the data of a proposal, for example, adding a timestamp from a - // hybrid logical clock to data in a monotonically increasing way. Forwarding - // should be disabled to prevent a follower with an inaccurate hybrid - // logical clock from assigning the timestamp and then forwarding the data - // to the leader. - DisableProposalForwarding bool -} - -func (c *Config) validate() error { - if c.ID == None { - return errors.New("cannot use none as id") - } - - if c.HeartbeatTick <= 0 { - return errors.New("heartbeat tick must be greater than 0") - } - - if c.ElectionTick <= c.HeartbeatTick { - return errors.New("election tick must be greater than heartbeat tick") - } - - if c.Storage == nil { - return errors.New("storage cannot be nil") - } - - if c.MaxUncommittedEntriesSize == 0 { - c.MaxUncommittedEntriesSize = noLimit - } - - // default MaxCommittedSizePerReady to MaxSizePerMsg because they were - // previously the same parameter. - if c.MaxCommittedSizePerReady == 0 { - c.MaxCommittedSizePerReady = c.MaxSizePerMsg - } - - if c.MaxInflightMsgs <= 0 { - return errors.New("max inflight messages must be greater than 0") - } - - if c.Logger == nil { - c.Logger = raftLogger - } - - if c.ReadOnlyOption == ReadOnlyLeaseBased && !c.CheckQuorum { - return errors.New("CheckQuorum must be enabled when ReadOnlyOption is ReadOnlyLeaseBased") - } - - return nil -} - -type raft struct { - id uint64 - - Term uint64 - Vote uint64 - - readStates []ReadState - - // the log - raftLog *raftLog - - maxMsgSize uint64 - maxUncommittedSize uint64 - // TODO(tbg): rename to trk. - prs tracker.ProgressTracker - - state StateType - - // isLearner is true if the local raft node is a learner. - isLearner bool - - msgs []pb.Message - - // the leader id - lead uint64 - // leadTransferee is id of the leader transfer target when its value is not zero. - // Follow the procedure defined in raft thesis 3.10. - leadTransferee uint64 - // Only one conf change may be pending (in the log, but not yet - // applied) at a time. This is enforced via pendingConfIndex, which - // is set to a value >= the log index of the latest pending - // configuration change (if any). Config changes are only allowed to - // be proposed if the leader's applied index is greater than this - // value. - pendingConfIndex uint64 - // an estimate of the size of the uncommitted tail of the Raft log. Used to - // prevent unbounded log growth. Only maintained by the leader. Reset on - // term changes. - uncommittedSize uint64 - - readOnly *readOnly - - // number of ticks since it reached last electionTimeout when it is leader - // or candidate. - // number of ticks since it reached last electionTimeout or received a - // valid message from current leader when it is a follower. - electionElapsed int - - // number of ticks since it reached last heartbeatTimeout. - // only leader keeps heartbeatElapsed. - heartbeatElapsed int - - checkQuorum bool - preVote bool - - heartbeatTimeout int - electionTimeout int - // randomizedElectionTimeout is a random number between - // [electiontimeout, 2 * electiontimeout - 1]. It gets reset - // when raft changes its state to follower or candidate. - randomizedElectionTimeout int - disableProposalForwarding bool - - tick func() - step stepFunc - - logger Logger -} - -func newRaft(c *Config) *raft { - if err := c.validate(); err != nil { - panic(err.Error()) - } - raftlog := newLogWithSize(c.Storage, c.Logger, c.MaxCommittedSizePerReady) - hs, cs, err := c.Storage.InitialState() - if err != nil { - panic(err) // TODO(bdarnell) - } - - if len(c.peers) > 0 || len(c.learners) > 0 { - if len(cs.Voters) > 0 || len(cs.Learners) > 0 { - // TODO(bdarnell): the peers argument is always nil except in - // tests; the argument should be removed and these tests should be - // updated to specify their nodes through a snapshot. - panic("cannot specify both newRaft(peers, learners) and ConfState.(Voters, Learners)") - } - cs.Voters = c.peers - cs.Learners = c.learners - } - - r := &raft{ - id: c.ID, - lead: None, - isLearner: false, - raftLog: raftlog, - maxMsgSize: c.MaxSizePerMsg, - maxUncommittedSize: c.MaxUncommittedEntriesSize, - prs: tracker.MakeProgressTracker(c.MaxInflightMsgs), - electionTimeout: c.ElectionTick, - heartbeatTimeout: c.HeartbeatTick, - logger: c.Logger, - checkQuorum: c.CheckQuorum, - preVote: c.PreVote, - readOnly: newReadOnly(c.ReadOnlyOption), - disableProposalForwarding: c.DisableProposalForwarding, - } - - cfg, prs, err := confchange.Restore(confchange.Changer{ - Tracker: r.prs, - LastIndex: raftlog.lastIndex(), - }, cs) - if err != nil { - panic(err) - } - assertConfStatesEquivalent(r.logger, cs, r.switchToConfig(cfg, prs)) - - if !IsEmptyHardState(hs) { - r.loadState(hs) - } - if c.Applied > 0 { - raftlog.appliedTo(c.Applied) - } - r.becomeFollower(r.Term, None) - - var nodesStrs []string - for _, n := range r.prs.VoterNodes() { - nodesStrs = append(nodesStrs, fmt.Sprintf("%x", n)) - } - - r.logger.Infof("newRaft %x [peers: [%s], term: %d, commit: %d, applied: %d, lastindex: %d, lastterm: %d]", - r.id, strings.Join(nodesStrs, ","), r.Term, r.raftLog.committed, r.raftLog.applied, r.raftLog.lastIndex(), r.raftLog.lastTerm()) - return r -} - -func (r *raft) hasLeader() bool { return r.lead != None } - -func (r *raft) softState() *SoftState { return &SoftState{Lead: r.lead, RaftState: r.state} } - -func (r *raft) hardState() pb.HardState { - return pb.HardState{ - Term: r.Term, - Vote: r.Vote, - Commit: r.raftLog.committed, - } -} - -// send persists state to stable storage and then sends to its mailbox. -func (r *raft) send(m pb.Message) { - m.From = r.id - if m.Type == pb.MsgVote || m.Type == pb.MsgVoteResp || m.Type == pb.MsgPreVote || m.Type == pb.MsgPreVoteResp { - if m.Term == 0 { - // All {pre-,}campaign messages need to have the term set when - // sending. - // - MsgVote: m.Term is the term the node is campaigning for, - // non-zero as we increment the term when campaigning. - // - MsgVoteResp: m.Term is the new r.Term if the MsgVote was - // granted, non-zero for the same reason MsgVote is - // - MsgPreVote: m.Term is the term the node will campaign, - // non-zero as we use m.Term to indicate the next term we'll be - // campaigning for - // - MsgPreVoteResp: m.Term is the term received in the original - // MsgPreVote if the pre-vote was granted, non-zero for the - // same reasons MsgPreVote is - panic(fmt.Sprintf("term should be set when sending %s", m.Type)) - } - } else { - if m.Term != 0 { - panic(fmt.Sprintf("term should not be set when sending %s (was %d)", m.Type, m.Term)) - } - // do not attach term to MsgProp, MsgReadIndex - // proposals are a way to forward to the leader and - // should be treated as local message. - // MsgReadIndex is also forwarded to leader. - if m.Type != pb.MsgProp && m.Type != pb.MsgReadIndex { - m.Term = r.Term - } - } - r.msgs = append(r.msgs, m) -} - -// sendAppend sends an append RPC with new entries (if any) and the -// current commit index to the given peer. -func (r *raft) sendAppend(to uint64) { - r.maybeSendAppend(to, true) -} - -// maybeSendAppend sends an append RPC with new entries to the given peer, -// if necessary. Returns true if a message was sent. The sendIfEmpty -// argument controls whether messages with no entries will be sent -// ("empty" messages are useful to convey updated Commit indexes, but -// are undesirable when we're sending multiple messages in a batch). -func (r *raft) maybeSendAppend(to uint64, sendIfEmpty bool) bool { - pr := r.prs.Progress[to] - if pr.IsPaused() { - return false - } - m := pb.Message{} - m.To = to - - term, errt := r.raftLog.term(pr.Next - 1) - ents, erre := r.raftLog.entries(pr.Next, r.maxMsgSize) - if len(ents) == 0 && !sendIfEmpty { - return false - } - - if errt != nil || erre != nil { // send snapshot if we failed to get term or entries - if !pr.RecentActive { - r.logger.Debugf("ignore sending snapshot to %x since it is not recently active", to) - return false - } - - m.Type = pb.MsgSnap - snapshot, err := r.raftLog.snapshot() - if err != nil { - if err == ErrSnapshotTemporarilyUnavailable { - r.logger.Debugf("%x failed to send snapshot to %x because snapshot is temporarily unavailable", r.id, to) - return false - } - panic(err) // TODO(bdarnell) - } - if IsEmptySnap(snapshot) { - panic("need non-empty snapshot") - } - m.Snapshot = snapshot - sindex, sterm := snapshot.Metadata.Index, snapshot.Metadata.Term - r.logger.Debugf("%x [firstindex: %d, commit: %d] sent snapshot[index: %d, term: %d] to %x [%s]", - r.id, r.raftLog.firstIndex(), r.raftLog.committed, sindex, sterm, to, pr) - pr.BecomeSnapshot(sindex) - r.logger.Debugf("%x paused sending replication messages to %x [%s]", r.id, to, pr) - } else { - m.Type = pb.MsgApp - m.Index = pr.Next - 1 - m.LogTerm = term - m.Entries = ents - m.Commit = r.raftLog.committed - if n := len(m.Entries); n != 0 { - switch pr.State { - // optimistically increase the next when in StateReplicate - case tracker.StateReplicate: - last := m.Entries[n-1].Index - pr.OptimisticUpdate(last) - pr.Inflights.Add(last) - case tracker.StateProbe: - pr.ProbeSent = true - default: - r.logger.Panicf("%x is sending append in unhandled state %s", r.id, pr.State) - } - } - } - r.send(m) - return true -} - -// sendHeartbeat sends a heartbeat RPC to the given peer. -func (r *raft) sendHeartbeat(to uint64, ctx []byte) { - // Attach the commit as min(to.matched, r.committed). - // When the leader sends out heartbeat message, - // the receiver(follower) might not be matched with the leader - // or it might not have all the committed entries. - // The leader MUST NOT forward the follower's commit to - // an unmatched index. - commit := min(r.prs.Progress[to].Match, r.raftLog.committed) - m := pb.Message{ - To: to, - Type: pb.MsgHeartbeat, - Commit: commit, - Context: ctx, - } - - r.send(m) -} - -// bcastAppend sends RPC, with entries to all peers that are not up-to-date -// according to the progress recorded in r.prs. -func (r *raft) bcastAppend() { - r.prs.Visit(func(id uint64, _ *tracker.Progress) { - if id == r.id { - return - } - r.sendAppend(id) - }) -} - -// bcastHeartbeat sends RPC, without entries to all the peers. -func (r *raft) bcastHeartbeat() { - lastCtx := r.readOnly.lastPendingRequestCtx() - if len(lastCtx) == 0 { - r.bcastHeartbeatWithCtx(nil) - } else { - r.bcastHeartbeatWithCtx([]byte(lastCtx)) - } -} - -func (r *raft) bcastHeartbeatWithCtx(ctx []byte) { - r.prs.Visit(func(id uint64, _ *tracker.Progress) { - if id == r.id { - return - } - r.sendHeartbeat(id, ctx) - }) -} - -func (r *raft) advance(rd Ready) { - // If entries were applied (or a snapshot), update our cursor for - // the next Ready. Note that if the current HardState contains a - // new Commit index, this does not mean that we're also applying - // all of the new entries due to commit pagination by size. - if index := rd.appliedCursor(); index > 0 { - r.raftLog.appliedTo(index) - if r.prs.Config.AutoLeave && index >= r.pendingConfIndex && r.state == StateLeader { - // If the current (and most recent, at least for this leader's term) - // configuration should be auto-left, initiate that now. - ccdata, err := (&pb.ConfChangeV2{}).Marshal() - if err != nil { - panic(err) - } - ent := pb.Entry{ - Type: pb.EntryConfChangeV2, - Data: ccdata, - } - if !r.appendEntry(ent) { - // If we could not append the entry, bump the pending conf index - // so that we'll try again later. - // - // TODO(tbg): test this case. - r.pendingConfIndex = r.raftLog.lastIndex() - } else { - r.logger.Infof("initiating automatic transition out of joint configuration %s", r.prs.Config) - } - } - } - r.reduceUncommittedSize(rd.CommittedEntries) - - if len(rd.Entries) > 0 { - e := rd.Entries[len(rd.Entries)-1] - r.raftLog.stableTo(e.Index, e.Term) - } - if !IsEmptySnap(rd.Snapshot) { - r.raftLog.stableSnapTo(rd.Snapshot.Metadata.Index) - } -} - -// maybeCommit attempts to advance the commit index. Returns true if -// the commit index changed (in which case the caller should call -// r.bcastAppend). -func (r *raft) maybeCommit() bool { - mci := r.prs.Committed() - return r.raftLog.maybeCommit(mci, r.Term) -} - -func (r *raft) reset(term uint64) { - if r.Term != term { - r.Term = term - r.Vote = None - } - r.lead = None - - r.electionElapsed = 0 - r.heartbeatElapsed = 0 - r.resetRandomizedElectionTimeout() - - r.abortLeaderTransfer() - - r.prs.ResetVotes() - r.prs.Visit(func(id uint64, pr *tracker.Progress) { - *pr = tracker.Progress{ - Match: 0, - Next: r.raftLog.lastIndex() + 1, - Inflights: tracker.NewInflights(r.prs.MaxInflight), - IsLearner: pr.IsLearner, - } - if id == r.id { - pr.Match = r.raftLog.lastIndex() - } - }) - - r.pendingConfIndex = 0 - r.uncommittedSize = 0 - r.readOnly = newReadOnly(r.readOnly.option) -} - -func (r *raft) appendEntry(es ...pb.Entry) (accepted bool) { - li := r.raftLog.lastIndex() - for i := range es { - es[i].Term = r.Term - es[i].Index = li + 1 + uint64(i) - } - // Track the size of this uncommitted proposal. - if !r.increaseUncommittedSize(es) { - r.logger.Debugf( - "%x appending new entries to log would exceed uncommitted entry size limit; dropping proposal", - r.id, - ) - // Drop the proposal. - return false - } - // use latest "last" index after truncate/append - li = r.raftLog.append(es...) - r.prs.Progress[r.id].MaybeUpdate(li) - // Regardless of maybeCommit's return, our caller will call bcastAppend. - r.maybeCommit() - return true -} - -// tickElection is run by followers and candidates after r.electionTimeout. -func (r *raft) tickElection() { - r.electionElapsed++ - - if r.promotable() && r.pastElectionTimeout() { - r.electionElapsed = 0 - r.Step(pb.Message{From: r.id, Type: pb.MsgHup}) - } -} - -// tickHeartbeat is run by leaders to send a MsgBeat after r.heartbeatTimeout. -func (r *raft) tickHeartbeat() { - r.heartbeatElapsed++ - r.electionElapsed++ - - if r.electionElapsed >= r.electionTimeout { - r.electionElapsed = 0 - if r.checkQuorum { - r.Step(pb.Message{From: r.id, Type: pb.MsgCheckQuorum}) - } - // If current leader cannot transfer leadership in electionTimeout, it becomes leader again. - if r.state == StateLeader && r.leadTransferee != None { - r.abortLeaderTransfer() - } - } - - if r.state != StateLeader { - return - } - - if r.heartbeatElapsed >= r.heartbeatTimeout { - r.heartbeatElapsed = 0 - r.Step(pb.Message{From: r.id, Type: pb.MsgBeat}) - } -} - -func (r *raft) becomeFollower(term uint64, lead uint64) { - r.step = stepFollower - r.reset(term) - r.tick = r.tickElection - r.lead = lead - r.state = StateFollower - r.logger.Infof("%x became follower at term %d", r.id, r.Term) -} - -func (r *raft) becomeCandidate() { - // TODO(xiangli) remove the panic when the raft implementation is stable - if r.state == StateLeader { - panic("invalid transition [leader -> candidate]") - } - r.step = stepCandidate - r.reset(r.Term + 1) - r.tick = r.tickElection - r.Vote = r.id - r.state = StateCandidate - r.logger.Infof("%x became candidate at term %d", r.id, r.Term) -} - -func (r *raft) becomePreCandidate() { - // TODO(xiangli) remove the panic when the raft implementation is stable - if r.state == StateLeader { - panic("invalid transition [leader -> pre-candidate]") - } - // Becoming a pre-candidate changes our step functions and state, - // but doesn't change anything else. In particular it does not increase - // r.Term or change r.Vote. - r.step = stepCandidate - r.prs.ResetVotes() - r.tick = r.tickElection - r.lead = None - r.state = StatePreCandidate - r.logger.Infof("%x became pre-candidate at term %d", r.id, r.Term) -} - -func (r *raft) becomeLeader() { - // TODO(xiangli) remove the panic when the raft implementation is stable - if r.state == StateFollower { - panic("invalid transition [follower -> leader]") - } - r.step = stepLeader - r.reset(r.Term) - r.tick = r.tickHeartbeat - r.lead = r.id - r.state = StateLeader - // Followers enter replicate mode when they've been successfully probed - // (perhaps after having received a snapshot as a result). The leader is - // trivially in this state. Note that r.reset() has initialized this - // progress with the last index already. - r.prs.Progress[r.id].BecomeReplicate() - - // Conservatively set the pendingConfIndex to the last index in the - // log. There may or may not be a pending config change, but it's - // safe to delay any future proposals until we commit all our - // pending log entries, and scanning the entire tail of the log - // could be expensive. - r.pendingConfIndex = r.raftLog.lastIndex() - - emptyEnt := pb.Entry{Data: nil} - if !r.appendEntry(emptyEnt) { - // This won't happen because we just called reset() above. - r.logger.Panic("empty entry was dropped") - } - // As a special case, don't count the initial empty entry towards the - // uncommitted log quota. This is because we want to preserve the - // behavior of allowing one entry larger than quota if the current - // usage is zero. - r.reduceUncommittedSize([]pb.Entry{emptyEnt}) - r.logger.Infof("%x became leader at term %d", r.id, r.Term) -} - -// campaign transitions the raft instance to candidate state. This must only be -// called after verifying that this is a legitimate transition. -func (r *raft) campaign(t CampaignType) { - if !r.promotable() { - // This path should not be hit (callers are supposed to check), but - // better safe than sorry. - r.logger.Warningf("%x is unpromotable; campaign() should have been called", r.id) - } - var term uint64 - var voteMsg pb.MessageType - if t == campaignPreElection { - r.becomePreCandidate() - voteMsg = pb.MsgPreVote - // PreVote RPCs are sent for the next term before we've incremented r.Term. - term = r.Term + 1 - } else { - r.becomeCandidate() - voteMsg = pb.MsgVote - term = r.Term - } - if _, _, res := r.poll(r.id, voteRespMsgType(voteMsg), true); res == quorum.VoteWon { - // We won the election after voting for ourselves (which must mean that - // this is a single-node cluster). Advance to the next state. - if t == campaignPreElection { - r.campaign(campaignElection) - } else { - r.becomeLeader() - } - return - } - var ids []uint64 - { - idMap := r.prs.Voters.IDs() - ids = make([]uint64, 0, len(idMap)) - for id := range idMap { - ids = append(ids, id) - } - sort.Slice(ids, func(i, j int) bool { return ids[i] < ids[j] }) - } - for _, id := range ids { - if id == r.id { - continue - } - r.logger.Infof("%x [logterm: %d, index: %d] sent %s request to %x at term %d", - r.id, r.raftLog.lastTerm(), r.raftLog.lastIndex(), voteMsg, id, r.Term) - - var ctx []byte - if t == campaignTransfer { - ctx = []byte(t) - } - r.send(pb.Message{Term: term, To: id, Type: voteMsg, Index: r.raftLog.lastIndex(), LogTerm: r.raftLog.lastTerm(), Context: ctx}) - } -} - -func (r *raft) poll(id uint64, t pb.MessageType, v bool) (granted int, rejected int, result quorum.VoteResult) { - if v { - r.logger.Infof("%x received %s from %x at term %d", r.id, t, id, r.Term) - } else { - r.logger.Infof("%x received %s rejection from %x at term %d", r.id, t, id, r.Term) - } - r.prs.RecordVote(id, v) - return r.prs.TallyVotes() -} - -func (r *raft) Step(m pb.Message) error { - // Handle the message term, which may result in our stepping down to a follower. - switch { - case m.Term == 0: - // local message - case m.Term > r.Term: - if m.Type == pb.MsgVote || m.Type == pb.MsgPreVote { - force := bytes.Equal(m.Context, []byte(campaignTransfer)) - inLease := r.checkQuorum && r.lead != None && r.electionElapsed < r.electionTimeout - if !force && inLease { - // If a server receives a RequestVote request within the minimum election timeout - // of hearing from a current leader, it does not update its term or grant its vote - r.logger.Infof("%x [logterm: %d, index: %d, vote: %x] ignored %s from %x [logterm: %d, index: %d] at term %d: lease is not expired (remaining ticks: %d)", - r.id, r.raftLog.lastTerm(), r.raftLog.lastIndex(), r.Vote, m.Type, m.From, m.LogTerm, m.Index, r.Term, r.electionTimeout-r.electionElapsed) - return nil - } - } - switch { - case m.Type == pb.MsgPreVote: - // Never change our term in response to a PreVote - case m.Type == pb.MsgPreVoteResp && !m.Reject: - // We send pre-vote requests with a term in our future. If the - // pre-vote is granted, we will increment our term when we get a - // quorum. If it is not, the term comes from the node that - // rejected our vote so we should become a follower at the new - // term. - default: - r.logger.Infof("%x [term: %d] received a %s message with higher term from %x [term: %d]", - r.id, r.Term, m.Type, m.From, m.Term) - if m.Type == pb.MsgApp || m.Type == pb.MsgHeartbeat || m.Type == pb.MsgSnap { - r.becomeFollower(m.Term, m.From) - } else { - r.becomeFollower(m.Term, None) - } - } - - case m.Term < r.Term: - if (r.checkQuorum || r.preVote) && (m.Type == pb.MsgHeartbeat || m.Type == pb.MsgApp) { - // We have received messages from a leader at a lower term. It is possible - // that these messages were simply delayed in the network, but this could - // also mean that this node has advanced its term number during a network - // partition, and it is now unable to either win an election or to rejoin - // the majority on the old term. If checkQuorum is false, this will be - // handled by incrementing term numbers in response to MsgVote with a - // higher term, but if checkQuorum is true we may not advance the term on - // MsgVote and must generate other messages to advance the term. The net - // result of these two features is to minimize the disruption caused by - // nodes that have been removed from the cluster's configuration: a - // removed node will send MsgVotes (or MsgPreVotes) which will be ignored, - // but it will not receive MsgApp or MsgHeartbeat, so it will not create - // disruptive term increases, by notifying leader of this node's activeness. - // The above comments also true for Pre-Vote - // - // When follower gets isolated, it soon starts an election ending - // up with a higher term than leader, although it won't receive enough - // votes to win the election. When it regains connectivity, this response - // with "pb.MsgAppResp" of higher term would force leader to step down. - // However, this disruption is inevitable to free this stuck node with - // fresh election. This can be prevented with Pre-Vote phase. - r.send(pb.Message{To: m.From, Type: pb.MsgAppResp}) - } else if m.Type == pb.MsgPreVote { - // Before Pre-Vote enable, there may have candidate with higher term, - // but less log. After update to Pre-Vote, the cluster may deadlock if - // we drop messages with a lower term. - r.logger.Infof("%x [logterm: %d, index: %d, vote: %x] rejected %s from %x [logterm: %d, index: %d] at term %d", - r.id, r.raftLog.lastTerm(), r.raftLog.lastIndex(), r.Vote, m.Type, m.From, m.LogTerm, m.Index, r.Term) - r.send(pb.Message{To: m.From, Term: r.Term, Type: pb.MsgPreVoteResp, Reject: true}) - } else { - // ignore other cases - r.logger.Infof("%x [term: %d] ignored a %s message with lower term from %x [term: %d]", - r.id, r.Term, m.Type, m.From, m.Term) - } - return nil - } - - switch m.Type { - case pb.MsgHup: - if r.state != StateLeader { - if !r.promotable() { - r.logger.Warningf("%x is unpromotable and can not campaign; ignoring MsgHup", r.id) - return nil - } - ents, err := r.raftLog.slice(r.raftLog.applied+1, r.raftLog.committed+1, noLimit) - if err != nil { - r.logger.Panicf("unexpected error getting unapplied entries (%v)", err) - } - if n := numOfPendingConf(ents); n != 0 && r.raftLog.committed > r.raftLog.applied { - r.logger.Warningf("%x cannot campaign at term %d since there are still %d pending configuration changes to apply", r.id, r.Term, n) - return nil - } - - r.logger.Infof("%x is starting a new election at term %d", r.id, r.Term) - if r.preVote { - r.campaign(campaignPreElection) - } else { - r.campaign(campaignElection) - } - } else { - r.logger.Debugf("%x ignoring MsgHup because already leader", r.id) - } - - case pb.MsgVote, pb.MsgPreVote: - // We can vote if this is a repeat of a vote we've already cast... - canVote := r.Vote == m.From || - // ...we haven't voted and we don't think there's a leader yet in this term... - (r.Vote == None && r.lead == None) || - // ...or this is a PreVote for a future term... - (m.Type == pb.MsgPreVote && m.Term > r.Term) - // ...and we believe the candidate is up to date. - if canVote && r.raftLog.isUpToDate(m.Index, m.LogTerm) { - // Note: it turns out that that learners must be allowed to cast votes. - // This seems counter- intuitive but is necessary in the situation in which - // a learner has been promoted (i.e. is now a voter) but has not learned - // about this yet. - // For example, consider a group in which id=1 is a learner and id=2 and - // id=3 are voters. A configuration change promoting 1 can be committed on - // the quorum `{2,3}` without the config change being appended to the - // learner's log. If the leader (say 2) fails, there are de facto two - // voters remaining. Only 3 can win an election (due to its log containing - // all committed entries), but to do so it will need 1 to vote. But 1 - // considers itself a learner and will continue to do so until 3 has - // stepped up as leader, replicates the conf change to 1, and 1 applies it. - // Ultimately, by receiving a request to vote, the learner realizes that - // the candidate believes it to be a voter, and that it should act - // accordingly. The candidate's config may be stale, too; but in that case - // it won't win the election, at least in the absence of the bug discussed - // in: - // https://github.com/etcd-io/etcd/issues/7625#issuecomment-488798263. - r.logger.Infof("%x [logterm: %d, index: %d, vote: %x] cast %s for %x [logterm: %d, index: %d] at term %d", - r.id, r.raftLog.lastTerm(), r.raftLog.lastIndex(), r.Vote, m.Type, m.From, m.LogTerm, m.Index, r.Term) - // When responding to Msg{Pre,}Vote messages we include the term - // from the message, not the local term. To see why, consider the - // case where a single node was previously partitioned away and - // it's local term is now out of date. If we include the local term - // (recall that for pre-votes we don't update the local term), the - // (pre-)campaigning node on the other end will proceed to ignore - // the message (it ignores all out of date messages). - // The term in the original message and current local term are the - // same in the case of regular votes, but different for pre-votes. - r.send(pb.Message{To: m.From, Term: m.Term, Type: voteRespMsgType(m.Type)}) - if m.Type == pb.MsgVote { - // Only record real votes. - r.electionElapsed = 0 - r.Vote = m.From - } - } else { - r.logger.Infof("%x [logterm: %d, index: %d, vote: %x] rejected %s from %x [logterm: %d, index: %d] at term %d", - r.id, r.raftLog.lastTerm(), r.raftLog.lastIndex(), r.Vote, m.Type, m.From, m.LogTerm, m.Index, r.Term) - r.send(pb.Message{To: m.From, Term: r.Term, Type: voteRespMsgType(m.Type), Reject: true}) - } - - default: - err := r.step(r, m) - if err != nil { - return err - } - } - return nil -} - -type stepFunc func(r *raft, m pb.Message) error - -func stepLeader(r *raft, m pb.Message) error { - // These message types do not require any progress for m.From. - switch m.Type { - case pb.MsgBeat: - r.bcastHeartbeat() - return nil - case pb.MsgCheckQuorum: - // The leader should always see itself as active. As a precaution, handle - // the case in which the leader isn't in the configuration any more (for - // example if it just removed itself). - // - // TODO(tbg): I added a TODO in removeNode, it doesn't seem that the - // leader steps down when removing itself. I might be missing something. - if pr := r.prs.Progress[r.id]; pr != nil { - pr.RecentActive = true - } - if !r.prs.QuorumActive() { - r.logger.Warningf("%x stepped down to follower since quorum is not active", r.id) - r.becomeFollower(r.Term, None) - } - // Mark everyone (but ourselves) as inactive in preparation for the next - // CheckQuorum. - r.prs.Visit(func(id uint64, pr *tracker.Progress) { - if id != r.id { - pr.RecentActive = false - } - }) - return nil - case pb.MsgProp: - if len(m.Entries) == 0 { - r.logger.Panicf("%x stepped empty MsgProp", r.id) - } - if r.prs.Progress[r.id] == nil { - // If we are not currently a member of the range (i.e. this node - // was removed from the configuration while serving as leader), - // drop any new proposals. - return ErrProposalDropped - } - if r.leadTransferee != None { - r.logger.Debugf("%x [term %d] transfer leadership to %x is in progress; dropping proposal", r.id, r.Term, r.leadTransferee) - return ErrProposalDropped - } - - for i := range m.Entries { - e := &m.Entries[i] - var cc pb.ConfChangeI - if e.Type == pb.EntryConfChange { - var ccc pb.ConfChange - if err := ccc.Unmarshal(e.Data); err != nil { - panic(err) - } - cc = ccc - } else if e.Type == pb.EntryConfChangeV2 { - var ccc pb.ConfChangeV2 - if err := ccc.Unmarshal(e.Data); err != nil { - panic(err) - } - cc = ccc - } - if cc != nil { - alreadyPending := r.pendingConfIndex > r.raftLog.applied - alreadyJoint := len(r.prs.Config.Voters[1]) > 0 - wantsLeaveJoint := len(cc.AsV2().Changes) == 0 - - var refused string - if alreadyPending { - refused = fmt.Sprintf("possible unapplied conf change at index %d (applied to %d)", r.pendingConfIndex, r.raftLog.applied) - } else if alreadyJoint && !wantsLeaveJoint { - refused = "must transition out of joint config first" - } else if !alreadyJoint && wantsLeaveJoint { - refused = "not in joint state; refusing empty conf change" - } - - if refused != "" { - r.logger.Infof("%x ignoring conf change %v at config %s: %s", r.id, cc, r.prs.Config, refused) - m.Entries[i] = pb.Entry{Type: pb.EntryNormal} - } else { - r.pendingConfIndex = r.raftLog.lastIndex() + uint64(i) + 1 - } - } - } - - if !r.appendEntry(m.Entries...) { - return ErrProposalDropped - } - r.bcastAppend() - return nil - case pb.MsgReadIndex: - // If more than the local vote is needed, go through a full broadcast, - // otherwise optimize. - if !r.prs.IsSingleton() { - if r.raftLog.zeroTermOnErrCompacted(r.raftLog.term(r.raftLog.committed)) != r.Term { - // Reject read only request when this leader has not committed any log entry at its term. - return nil - } - - // thinking: use an interally defined context instead of the user given context. - // We can express this in terms of the term and index instead of a user-supplied value. - // This would allow multiple reads to piggyback on the same message. - switch r.readOnly.option { - case ReadOnlySafe: - r.readOnly.addRequest(r.raftLog.committed, m) - // The local node automatically acks the request. - r.readOnly.recvAck(r.id, m.Entries[0].Data) - r.bcastHeartbeatWithCtx(m.Entries[0].Data) - case ReadOnlyLeaseBased: - ri := r.raftLog.committed - if m.From == None || m.From == r.id { // from local member - r.readStates = append(r.readStates, ReadState{Index: ri, RequestCtx: m.Entries[0].Data}) - } else { - r.send(pb.Message{To: m.From, Type: pb.MsgReadIndexResp, Index: ri, Entries: m.Entries}) - } - } - } else { // only one voting member (the leader) in the cluster - if m.From == None || m.From == r.id { // from leader itself - r.readStates = append(r.readStates, ReadState{Index: r.raftLog.committed, RequestCtx: m.Entries[0].Data}) - } else { // from learner member - r.send(pb.Message{To: m.From, Type: pb.MsgReadIndexResp, Index: r.raftLog.committed, Entries: m.Entries}) - } - } - - return nil - } - - // All other message types require a progress for m.From (pr). - pr := r.prs.Progress[m.From] - if pr == nil { - r.logger.Debugf("%x no progress available for %x", r.id, m.From) - return nil - } - switch m.Type { - case pb.MsgAppResp: - pr.RecentActive = true - - if m.Reject { - r.logger.Debugf("%x received MsgAppResp(MsgApp was rejected, lastindex: %d) from %x for index %d", - r.id, m.RejectHint, m.From, m.Index) - if pr.MaybeDecrTo(m.Index, m.RejectHint) { - r.logger.Debugf("%x decreased progress of %x to [%s]", r.id, m.From, pr) - if pr.State == tracker.StateReplicate { - pr.BecomeProbe() - } - r.sendAppend(m.From) - } - } else { - oldPaused := pr.IsPaused() - if pr.MaybeUpdate(m.Index) { - switch { - case pr.State == tracker.StateProbe: - pr.BecomeReplicate() - case pr.State == tracker.StateSnapshot && pr.Match >= pr.PendingSnapshot: - // TODO(tbg): we should also enter this branch if a snapshot is - // received that is below pr.PendingSnapshot but which makes it - // possible to use the log again. - r.logger.Debugf("%x recovered from needing snapshot, resumed sending replication messages to %x [%s]", r.id, m.From, pr) - // Transition back to replicating state via probing state - // (which takes the snapshot into account). If we didn't - // move to replicating state, that would only happen with - // the next round of appends (but there may not be a next - // round for a while, exposing an inconsistent RaftStatus). - pr.BecomeProbe() - pr.BecomeReplicate() - case pr.State == tracker.StateReplicate: - pr.Inflights.FreeLE(m.Index) - } - - if r.maybeCommit() { - r.bcastAppend() - } else if oldPaused { - // If we were paused before, this node may be missing the - // latest commit index, so send it. - r.sendAppend(m.From) - } - // We've updated flow control information above, which may - // allow us to send multiple (size-limited) in-flight messages - // at once (such as when transitioning from probe to - // replicate, or when freeTo() covers multiple messages). If - // we have more entries to send, send as many messages as we - // can (without sending empty messages for the commit index) - for r.maybeSendAppend(m.From, false) { - } - // Transfer leadership is in progress. - if m.From == r.leadTransferee && pr.Match == r.raftLog.lastIndex() { - r.logger.Infof("%x sent MsgTimeoutNow to %x after received MsgAppResp", r.id, m.From) - r.sendTimeoutNow(m.From) - } - } - } - case pb.MsgHeartbeatResp: - pr.RecentActive = true - pr.ProbeSent = false - - // free one slot for the full inflights window to allow progress. - if pr.State == tracker.StateReplicate && pr.Inflights.Full() { - pr.Inflights.FreeFirstOne() - } - if pr.Match < r.raftLog.lastIndex() { - r.sendAppend(m.From) - } - - if r.readOnly.option != ReadOnlySafe || len(m.Context) == 0 { - return nil - } - - if r.prs.Voters.VoteResult(r.readOnly.recvAck(m.From, m.Context)) != quorum.VoteWon { - return nil - } - - rss := r.readOnly.advance(m) - for _, rs := range rss { - req := rs.req - if req.From == None || req.From == r.id { // from local member - r.readStates = append(r.readStates, ReadState{Index: rs.index, RequestCtx: req.Entries[0].Data}) - } else { - r.send(pb.Message{To: req.From, Type: pb.MsgReadIndexResp, Index: rs.index, Entries: req.Entries}) - } - } - case pb.MsgSnapStatus: - if pr.State != tracker.StateSnapshot { - return nil - } - // TODO(tbg): this code is very similar to the snapshot handling in - // MsgAppResp above. In fact, the code there is more correct than the - // code here and should likely be updated to match (or even better, the - // logic pulled into a newly created Progress state machine handler). - if !m.Reject { - pr.BecomeProbe() - r.logger.Debugf("%x snapshot succeeded, resumed sending replication messages to %x [%s]", r.id, m.From, pr) - } else { - // NB: the order here matters or we'll be probing erroneously from - // the snapshot index, but the snapshot never applied. - pr.PendingSnapshot = 0 - pr.BecomeProbe() - r.logger.Debugf("%x snapshot failed, resumed sending replication messages to %x [%s]", r.id, m.From, pr) - } - // If snapshot finish, wait for the MsgAppResp from the remote node before sending - // out the next MsgApp. - // If snapshot failure, wait for a heartbeat interval before next try - pr.ProbeSent = true - case pb.MsgUnreachable: - // During optimistic replication, if the remote becomes unreachable, - // there is huge probability that a MsgApp is lost. - if pr.State == tracker.StateReplicate { - pr.BecomeProbe() - } - r.logger.Debugf("%x failed to send message to %x because it is unreachable [%s]", r.id, m.From, pr) - case pb.MsgTransferLeader: - if pr.IsLearner { - r.logger.Debugf("%x is learner. Ignored transferring leadership", r.id) - return nil - } - leadTransferee := m.From - lastLeadTransferee := r.leadTransferee - if lastLeadTransferee != None { - if lastLeadTransferee == leadTransferee { - r.logger.Infof("%x [term %d] transfer leadership to %x is in progress, ignores request to same node %x", - r.id, r.Term, leadTransferee, leadTransferee) - return nil - } - r.abortLeaderTransfer() - r.logger.Infof("%x [term %d] abort previous transferring leadership to %x", r.id, r.Term, lastLeadTransferee) - } - if leadTransferee == r.id { - r.logger.Debugf("%x is already leader. Ignored transferring leadership to self", r.id) - return nil - } - // Transfer leadership to third party. - r.logger.Infof("%x [term %d] starts to transfer leadership to %x", r.id, r.Term, leadTransferee) - // Transfer leadership should be finished in one electionTimeout, so reset r.electionElapsed. - r.electionElapsed = 0 - r.leadTransferee = leadTransferee - if pr.Match == r.raftLog.lastIndex() { - r.sendTimeoutNow(leadTransferee) - r.logger.Infof("%x sends MsgTimeoutNow to %x immediately as %x already has up-to-date log", r.id, leadTransferee, leadTransferee) - } else { - r.sendAppend(leadTransferee) - } - } - return nil -} - -// stepCandidate is shared by StateCandidate and StatePreCandidate; the difference is -// whether they respond to MsgVoteResp or MsgPreVoteResp. -func stepCandidate(r *raft, m pb.Message) error { - // Only handle vote responses corresponding to our candidacy (while in - // StateCandidate, we may get stale MsgPreVoteResp messages in this term from - // our pre-candidate state). - var myVoteRespType pb.MessageType - if r.state == StatePreCandidate { - myVoteRespType = pb.MsgPreVoteResp - } else { - myVoteRespType = pb.MsgVoteResp - } - switch m.Type { - case pb.MsgProp: - r.logger.Infof("%x no leader at term %d; dropping proposal", r.id, r.Term) - return ErrProposalDropped - case pb.MsgApp: - r.becomeFollower(m.Term, m.From) // always m.Term == r.Term - r.handleAppendEntries(m) - case pb.MsgHeartbeat: - r.becomeFollower(m.Term, m.From) // always m.Term == r.Term - r.handleHeartbeat(m) - case pb.MsgSnap: - r.becomeFollower(m.Term, m.From) // always m.Term == r.Term - r.handleSnapshot(m) - case myVoteRespType: - gr, rj, res := r.poll(m.From, m.Type, !m.Reject) - r.logger.Infof("%x has received %d %s votes and %d vote rejections", r.id, gr, m.Type, rj) - switch res { - case quorum.VoteWon: - if r.state == StatePreCandidate { - r.campaign(campaignElection) - } else { - r.becomeLeader() - r.bcastAppend() - } - case quorum.VoteLost: - // pb.MsgPreVoteResp contains future term of pre-candidate - // m.Term > r.Term; reuse r.Term - r.becomeFollower(r.Term, None) - } - case pb.MsgTimeoutNow: - r.logger.Debugf("%x [term %d state %v] ignored MsgTimeoutNow from %x", r.id, r.Term, r.state, m.From) - } - return nil -} - -func stepFollower(r *raft, m pb.Message) error { - switch m.Type { - case pb.MsgProp: - if r.lead == None { - r.logger.Infof("%x no leader at term %d; dropping proposal", r.id, r.Term) - return ErrProposalDropped - } else if r.disableProposalForwarding { - r.logger.Infof("%x not forwarding to leader %x at term %d; dropping proposal", r.id, r.lead, r.Term) - return ErrProposalDropped - } - m.To = r.lead - r.send(m) - case pb.MsgApp: - r.electionElapsed = 0 - r.lead = m.From - r.handleAppendEntries(m) - case pb.MsgHeartbeat: - r.electionElapsed = 0 - r.lead = m.From - r.handleHeartbeat(m) - case pb.MsgSnap: - r.electionElapsed = 0 - r.lead = m.From - r.handleSnapshot(m) - case pb.MsgTransferLeader: - if r.lead == None { - r.logger.Infof("%x no leader at term %d; dropping leader transfer msg", r.id, r.Term) - return nil - } - m.To = r.lead - r.send(m) - case pb.MsgTimeoutNow: - if r.promotable() { - r.logger.Infof("%x [term %d] received MsgTimeoutNow from %x and starts an election to get leadership.", r.id, r.Term, m.From) - // Leadership transfers never use pre-vote even if r.preVote is true; we - // know we are not recovering from a partition so there is no need for the - // extra round trip. - r.campaign(campaignTransfer) - } else { - r.logger.Infof("%x received MsgTimeoutNow from %x but is not promotable", r.id, m.From) - } - case pb.MsgReadIndex: - if r.lead == None { - r.logger.Infof("%x no leader at term %d; dropping index reading msg", r.id, r.Term) - return nil - } - m.To = r.lead - r.send(m) - case pb.MsgReadIndexResp: - if len(m.Entries) != 1 { - r.logger.Errorf("%x invalid format of MsgReadIndexResp from %x, entries count: %d", r.id, m.From, len(m.Entries)) - return nil - } - r.readStates = append(r.readStates, ReadState{Index: m.Index, RequestCtx: m.Entries[0].Data}) - } - return nil -} - -func (r *raft) handleAppendEntries(m pb.Message) { - if m.Index < r.raftLog.committed { - r.send(pb.Message{To: m.From, Type: pb.MsgAppResp, Index: r.raftLog.committed}) - return - } - - if mlastIndex, ok := r.raftLog.maybeAppend(m.Index, m.LogTerm, m.Commit, m.Entries...); ok { - r.send(pb.Message{To: m.From, Type: pb.MsgAppResp, Index: mlastIndex}) - } else { - r.logger.Debugf("%x [logterm: %d, index: %d] rejected MsgApp [logterm: %d, index: %d] from %x", - r.id, r.raftLog.zeroTermOnErrCompacted(r.raftLog.term(m.Index)), m.Index, m.LogTerm, m.Index, m.From) - r.send(pb.Message{To: m.From, Type: pb.MsgAppResp, Index: m.Index, Reject: true, RejectHint: r.raftLog.lastIndex()}) - } -} - -func (r *raft) handleHeartbeat(m pb.Message) { - r.raftLog.commitTo(m.Commit) - r.send(pb.Message{To: m.From, Type: pb.MsgHeartbeatResp, Context: m.Context}) -} - -func (r *raft) handleSnapshot(m pb.Message) { - sindex, sterm := m.Snapshot.Metadata.Index, m.Snapshot.Metadata.Term - if r.restore(m.Snapshot) { - r.logger.Infof("%x [commit: %d] restored snapshot [index: %d, term: %d]", - r.id, r.raftLog.committed, sindex, sterm) - r.send(pb.Message{To: m.From, Type: pb.MsgAppResp, Index: r.raftLog.lastIndex()}) - } else { - r.logger.Infof("%x [commit: %d] ignored snapshot [index: %d, term: %d]", - r.id, r.raftLog.committed, sindex, sterm) - r.send(pb.Message{To: m.From, Type: pb.MsgAppResp, Index: r.raftLog.committed}) - } -} - -// restore recovers the state machine from a snapshot. It restores the log and the -// configuration of state machine. If this method returns false, the snapshot was -// ignored, either because it was obsolete or because of an error. -func (r *raft) restore(s pb.Snapshot) bool { - if s.Metadata.Index <= r.raftLog.committed { - return false - } - if r.state != StateFollower { - // This is defense-in-depth: if the leader somehow ended up applying a - // snapshot, it could move into a new term without moving into a - // follower state. This should never fire, but if it did, we'd have - // prevented damage by returning early, so log only a loud warning. - // - // At the time of writing, the instance is guaranteed to be in follower - // state when this method is called. - r.logger.Warningf("%x attempted to restore snapshot as leader; should never happen", r.id) - r.becomeFollower(r.Term+1, None) - return false - } - - // More defense-in-depth: throw away snapshot if recipient is not in the - // config. This shouuldn't ever happen (at the time of writing) but lots of - // code here and there assumes that r.id is in the progress tracker. - found := false - cs := s.Metadata.ConfState - for _, set := range [][]uint64{ - cs.Voters, - cs.Learners, - } { - for _, id := range set { - if id == r.id { - found = true - break - } - } - } - if !found { - r.logger.Warningf( - "%x attempted to restore snapshot but it is not in the ConfState %v; should never happen", - r.id, cs, - ) - return false - } - - // Now go ahead and actually restore. - - if r.raftLog.matchTerm(s.Metadata.Index, s.Metadata.Term) { - r.logger.Infof("%x [commit: %d, lastindex: %d, lastterm: %d] fast-forwarded commit to snapshot [index: %d, term: %d]", - r.id, r.raftLog.committed, r.raftLog.lastIndex(), r.raftLog.lastTerm(), s.Metadata.Index, s.Metadata.Term) - r.raftLog.commitTo(s.Metadata.Index) - return false - } - - r.raftLog.restore(s) - - // Reset the configuration and add the (potentially updated) peers in anew. - r.prs = tracker.MakeProgressTracker(r.prs.MaxInflight) - cfg, prs, err := confchange.Restore(confchange.Changer{ - Tracker: r.prs, - LastIndex: r.raftLog.lastIndex(), - }, cs) - - if err != nil { - // This should never happen. Either there's a bug in our config change - // handling or the client corrupted the conf change. - panic(fmt.Sprintf("unable to restore config %+v: %s", cs, err)) - } - - assertConfStatesEquivalent(r.logger, cs, r.switchToConfig(cfg, prs)) - - pr := r.prs.Progress[r.id] - pr.MaybeUpdate(pr.Next - 1) // TODO(tbg): this is untested and likely unneeded - - r.logger.Infof("%x [commit: %d, lastindex: %d, lastterm: %d] restored snapshot [index: %d, term: %d]", - r.id, r.raftLog.committed, r.raftLog.lastIndex(), r.raftLog.lastTerm(), s.Metadata.Index, s.Metadata.Term) - return true -} - -// promotable indicates whether state machine can be promoted to leader, -// which is true when its own id is in progress list. -func (r *raft) promotable() bool { - pr := r.prs.Progress[r.id] - return pr != nil && !pr.IsLearner -} - -func (r *raft) applyConfChange(cc pb.ConfChangeV2) pb.ConfState { - cfg, prs, err := func() (tracker.Config, tracker.ProgressMap, error) { - changer := confchange.Changer{ - Tracker: r.prs, - LastIndex: r.raftLog.lastIndex(), - } - if cc.LeaveJoint() { - return changer.LeaveJoint() - } else if autoLeave, ok := cc.EnterJoint(); ok { - return changer.EnterJoint(autoLeave, cc.Changes...) - } - return changer.Simple(cc.Changes...) - }() - - if err != nil { - // TODO(tbg): return the error to the caller. - panic(err) - } - - return r.switchToConfig(cfg, prs) -} - -// switchToConfig reconfigures this node to use the provided configuration. It -// updates the in-memory state and, when necessary, carries out additional -// actions such as reacting to the removal of nodes or changed quorum -// requirements. -// -// The inputs usually result from restoring a ConfState or applying a ConfChange. -func (r *raft) switchToConfig(cfg tracker.Config, prs tracker.ProgressMap) pb.ConfState { - r.prs.Config = cfg - r.prs.Progress = prs - - r.logger.Infof("%x switched to configuration %s", r.id, r.prs.Config) - cs := r.prs.ConfState() - pr, ok := r.prs.Progress[r.id] - - // Update whether the node itself is a learner, resetting to false when the - // node is removed. - r.isLearner = ok && pr.IsLearner - - if (!ok || r.isLearner) && r.state == StateLeader { - // This node is leader and was removed or demoted. We prevent demotions - // at the time writing but hypothetically we handle them the same way as - // removing the leader: stepping down into the next Term. - // - // TODO(tbg): step down (for sanity) and ask follower with largest Match - // to TimeoutNow (to avoid interruption). This might still drop some - // proposals but it's better than nothing. - // - // TODO(tbg): test this branch. It is untested at the time of writing. - return cs - } - - // The remaining steps only make sense if this node is the leader and there - // are other nodes. - if r.state != StateLeader || len(cs.Voters) == 0 { - return cs - } - - if r.maybeCommit() { - // If the configuration change means that more entries are committed now, - // broadcast/append to everyone in the updated config. - r.bcastAppend() - } else { - // Otherwise, still probe the newly added replicas; there's no reason to - // let them wait out a heartbeat interval (or the next incoming - // proposal). - r.prs.Visit(func(id uint64, pr *tracker.Progress) { - r.maybeSendAppend(id, false /* sendIfEmpty */) - }) - } - // If the the leadTransferee was removed, abort the leadership transfer. - if _, tOK := r.prs.Progress[r.leadTransferee]; !tOK && r.leadTransferee != 0 { - r.abortLeaderTransfer() - } - - return cs -} - -func (r *raft) loadState(state pb.HardState) { - if state.Commit < r.raftLog.committed || state.Commit > r.raftLog.lastIndex() { - r.logger.Panicf("%x state.commit %d is out of range [%d, %d]", r.id, state.Commit, r.raftLog.committed, r.raftLog.lastIndex()) - } - r.raftLog.committed = state.Commit - r.Term = state.Term - r.Vote = state.Vote -} - -// pastElectionTimeout returns true iff r.electionElapsed is greater -// than or equal to the randomized election timeout in -// [electiontimeout, 2 * electiontimeout - 1]. -func (r *raft) pastElectionTimeout() bool { - return r.electionElapsed >= r.randomizedElectionTimeout -} - -func (r *raft) resetRandomizedElectionTimeout() { - r.randomizedElectionTimeout = r.electionTimeout + globalRand.Intn(r.electionTimeout) -} - -func (r *raft) sendTimeoutNow(to uint64) { - r.send(pb.Message{To: to, Type: pb.MsgTimeoutNow}) -} - -func (r *raft) abortLeaderTransfer() { - r.leadTransferee = None -} - -// increaseUncommittedSize computes the size of the proposed entries and -// determines whether they would push leader over its maxUncommittedSize limit. -// If the new entries would exceed the limit, the method returns false. If not, -// the increase in uncommitted entry size is recorded and the method returns -// true. -func (r *raft) increaseUncommittedSize(ents []pb.Entry) bool { - var s uint64 - for _, e := range ents { - s += uint64(PayloadSize(e)) - } - - if r.uncommittedSize > 0 && r.uncommittedSize+s > r.maxUncommittedSize { - // If the uncommitted tail of the Raft log is empty, allow any size - // proposal. Otherwise, limit the size of the uncommitted tail of the - // log and drop any proposal that would push the size over the limit. - return false - } - r.uncommittedSize += s - return true -} - -// reduceUncommittedSize accounts for the newly committed entries by decreasing -// the uncommitted entry size limit. -func (r *raft) reduceUncommittedSize(ents []pb.Entry) { - if r.uncommittedSize == 0 { - // Fast-path for followers, who do not track or enforce the limit. - return - } - - var s uint64 - for _, e := range ents { - s += uint64(PayloadSize(e)) - } - if s > r.uncommittedSize { - // uncommittedSize may underestimate the size of the uncommitted Raft - // log tail but will never overestimate it. Saturate at 0 instead of - // allowing overflow. - r.uncommittedSize = 0 - } else { - r.uncommittedSize -= s - } -} - -func numOfPendingConf(ents []pb.Entry) int { - n := 0 - for i := range ents { - if ents[i].Type == pb.EntryConfChange { - n++ - } - } - return n -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/confchange.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/confchange.go deleted file mode 100644 index 46a7a70212e4..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/confchange.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raftpb - -import ( - "fmt" - "strconv" - "strings" - - "github.com/gogo/protobuf/proto" -) - -// ConfChangeI abstracts over ConfChangeV2 and (legacy) ConfChange to allow -// treating them in a unified manner. -type ConfChangeI interface { - AsV2() ConfChangeV2 - AsV1() (ConfChange, bool) -} - -// MarshalConfChange calls Marshal on the underlying ConfChange or ConfChangeV2 -// and returns the result along with the corresponding EntryType. -func MarshalConfChange(c ConfChangeI) (EntryType, []byte, error) { - var typ EntryType - var ccdata []byte - var err error - if ccv1, ok := c.AsV1(); ok { - typ = EntryConfChange - ccdata, err = ccv1.Marshal() - } else { - ccv2 := c.AsV2() - typ = EntryConfChangeV2 - ccdata, err = ccv2.Marshal() - } - return typ, ccdata, err -} - -// AsV2 returns a V2 configuration change carrying out the same operation. -func (c ConfChange) AsV2() ConfChangeV2 { - return ConfChangeV2{ - Changes: []ConfChangeSingle{{ - Type: c.Type, - NodeID: c.NodeID, - }}, - Context: c.Context, - } -} - -// AsV1 returns the ConfChange and true. -func (c ConfChange) AsV1() (ConfChange, bool) { - return c, true -} - -// AsV2 is the identity. -func (c ConfChangeV2) AsV2() ConfChangeV2 { return c } - -// AsV1 returns ConfChange{} and false. -func (c ConfChangeV2) AsV1() (ConfChange, bool) { return ConfChange{}, false } - -// EnterJoint returns two bools. The second bool is true if and only if this -// config change will use Joint Consensus, which is the case if it contains more -// than one change or if the use of Joint Consensus was requested explicitly. -// The first bool can only be true if second one is, and indicates whether the -// Joint State will be left automatically. -func (c *ConfChangeV2) EnterJoint() (autoLeave bool, ok bool) { - // NB: in theory, more config changes could qualify for the "simple" - // protocol but it depends on the config on top of which the changes apply. - // For example, adding two learners is not OK if both nodes are part of the - // base config (i.e. two voters are turned into learners in the process of - // applying the conf change). In practice, these distinctions should not - // matter, so we keep it simple and use Joint Consensus liberally. - if c.Transition != ConfChangeTransitionAuto || len(c.Changes) > 1 { - // Use Joint Consensus. - var autoLeave bool - switch c.Transition { - case ConfChangeTransitionAuto: - autoLeave = true - case ConfChangeTransitionJointImplicit: - autoLeave = true - case ConfChangeTransitionJointExplicit: - default: - panic(fmt.Sprintf("unknown transition: %+v", c)) - } - return autoLeave, true - } - return false, false -} - -// LeaveJoint is true if the configuration change leaves a joint configuration. -// This is the case if the ConfChangeV2 is zero, with the possible exception of -// the Context field. -func (c *ConfChangeV2) LeaveJoint() bool { - cpy := *c - cpy.Context = nil - return proto.Equal(&cpy, &ConfChangeV2{}) -} - -// ConfChangesFromString parses a Space-delimited sequence of operations into a -// slice of ConfChangeSingle. The supported operations are: -// - vn: make n a voter, -// - ln: make n a learner, -// - rn: remove n, and -// - un: update n. -func ConfChangesFromString(s string) ([]ConfChangeSingle, error) { - var ccs []ConfChangeSingle - toks := strings.Split(strings.TrimSpace(s), " ") - if toks[0] == "" { - toks = nil - } - for _, tok := range toks { - if len(tok) < 2 { - return nil, fmt.Errorf("unknown token %s", tok) - } - var cc ConfChangeSingle - switch tok[0] { - case 'v': - cc.Type = ConfChangeAddNode - case 'l': - cc.Type = ConfChangeAddLearnerNode - case 'r': - cc.Type = ConfChangeRemoveNode - case 'u': - cc.Type = ConfChangeUpdateNode - default: - return nil, fmt.Errorf("unknown input: %s", tok) - } - id, err := strconv.ParseUint(tok[1:], 10, 64) - if err != nil { - return nil, err - } - cc.NodeID = id - ccs = append(ccs, cc) - } - return ccs, nil -} - -// ConfChangesToString is the inverse to ConfChangesFromString. -func ConfChangesToString(ccs []ConfChangeSingle) string { - var buf strings.Builder - for i, cc := range ccs { - if i > 0 { - buf.WriteByte(' ') - } - switch cc.Type { - case ConfChangeAddNode: - buf.WriteByte('v') - case ConfChangeAddLearnerNode: - buf.WriteByte('l') - case ConfChangeRemoveNode: - buf.WriteByte('r') - case ConfChangeUpdateNode: - buf.WriteByte('u') - default: - buf.WriteString("unknown") - } - fmt.Fprintf(&buf, "%d", cc.NodeID) - } - return buf.String() -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/confstate.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/confstate.go deleted file mode 100644 index 4bda93214b2a..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/confstate.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raftpb - -import ( - "fmt" - "reflect" - "sort" -) - -// Equivalent returns a nil error if the inputs describe the same configuration. -// On mismatch, returns a descriptive error showing the differences. -func (cs ConfState) Equivalent(cs2 ConfState) error { - cs1 := cs - orig1, orig2 := cs1, cs2 - s := func(sl *[]uint64) { - *sl = append([]uint64(nil), *sl...) - sort.Slice(*sl, func(i, j int) bool { return (*sl)[i] < (*sl)[j] }) - } - - for _, cs := range []*ConfState{&cs1, &cs2} { - s(&cs.Voters) - s(&cs.Learners) - s(&cs.VotersOutgoing) - s(&cs.LearnersNext) - cs.XXX_unrecognized = nil - } - - if !reflect.DeepEqual(cs1, cs2) { - return fmt.Errorf("ConfStates not equivalent after sorting:\n%+#v\n%+#v\nInputs were:\n%+#v\n%+#v", cs1, cs2, orig1, orig2) - } - return nil -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/raft.pb.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/raft.pb.go deleted file mode 100644 index fcf259c89bec..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/raft.pb.go +++ /dev/null @@ -1,2646 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: raft.proto - -/* - Package raftpb is a generated protocol buffer package. - - It is generated from these files: - raft.proto - - It has these top-level messages: - Entry - SnapshotMetadata - Snapshot - Message - HardState - ConfState - ConfChange - ConfChangeSingle - ConfChangeV2 -*/ -package raftpb - -import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - - math "math" - - _ "github.com/gogo/protobuf/gogoproto" - - io "io" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type EntryType int32 - -const ( - EntryNormal EntryType = 0 - EntryConfChange EntryType = 1 - EntryConfChangeV2 EntryType = 2 -) - -var EntryType_name = map[int32]string{ - 0: "EntryNormal", - 1: "EntryConfChange", - 2: "EntryConfChangeV2", -} -var EntryType_value = map[string]int32{ - "EntryNormal": 0, - "EntryConfChange": 1, - "EntryConfChangeV2": 2, -} - -func (x EntryType) Enum() *EntryType { - p := new(EntryType) - *p = x - return p -} -func (x EntryType) String() string { - return proto.EnumName(EntryType_name, int32(x)) -} -func (x *EntryType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EntryType_value, data, "EntryType") - if err != nil { - return err - } - *x = EntryType(value) - return nil -} -func (EntryType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} } - -type MessageType int32 - -const ( - MsgHup MessageType = 0 - MsgBeat MessageType = 1 - MsgProp MessageType = 2 - MsgApp MessageType = 3 - MsgAppResp MessageType = 4 - MsgVote MessageType = 5 - MsgVoteResp MessageType = 6 - MsgSnap MessageType = 7 - MsgHeartbeat MessageType = 8 - MsgHeartbeatResp MessageType = 9 - MsgUnreachable MessageType = 10 - MsgSnapStatus MessageType = 11 - MsgCheckQuorum MessageType = 12 - MsgTransferLeader MessageType = 13 - MsgTimeoutNow MessageType = 14 - MsgReadIndex MessageType = 15 - MsgReadIndexResp MessageType = 16 - MsgPreVote MessageType = 17 - MsgPreVoteResp MessageType = 18 -) - -var MessageType_name = map[int32]string{ - 0: "MsgHup", - 1: "MsgBeat", - 2: "MsgProp", - 3: "MsgApp", - 4: "MsgAppResp", - 5: "MsgVote", - 6: "MsgVoteResp", - 7: "MsgSnap", - 8: "MsgHeartbeat", - 9: "MsgHeartbeatResp", - 10: "MsgUnreachable", - 11: "MsgSnapStatus", - 12: "MsgCheckQuorum", - 13: "MsgTransferLeader", - 14: "MsgTimeoutNow", - 15: "MsgReadIndex", - 16: "MsgReadIndexResp", - 17: "MsgPreVote", - 18: "MsgPreVoteResp", -} -var MessageType_value = map[string]int32{ - "MsgHup": 0, - "MsgBeat": 1, - "MsgProp": 2, - "MsgApp": 3, - "MsgAppResp": 4, - "MsgVote": 5, - "MsgVoteResp": 6, - "MsgSnap": 7, - "MsgHeartbeat": 8, - "MsgHeartbeatResp": 9, - "MsgUnreachable": 10, - "MsgSnapStatus": 11, - "MsgCheckQuorum": 12, - "MsgTransferLeader": 13, - "MsgTimeoutNow": 14, - "MsgReadIndex": 15, - "MsgReadIndexResp": 16, - "MsgPreVote": 17, - "MsgPreVoteResp": 18, -} - -func (x MessageType) Enum() *MessageType { - p := new(MessageType) - *p = x - return p -} -func (x MessageType) String() string { - return proto.EnumName(MessageType_name, int32(x)) -} -func (x *MessageType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MessageType_value, data, "MessageType") - if err != nil { - return err - } - *x = MessageType(value) - return nil -} -func (MessageType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{1} } - -// ConfChangeTransition specifies the behavior of a configuration change with -// respect to joint consensus. -type ConfChangeTransition int32 - -const ( - // Automatically use the simple protocol if possible, otherwise fall back - // to ConfChangeJointImplicit. Most applications will want to use this. - ConfChangeTransitionAuto ConfChangeTransition = 0 - // Use joint consensus unconditionally, and transition out of them - // automatically (by proposing a zero configuration change). - // - // This option is suitable for applications that want to minimize the time - // spent in the joint configuration and do not store the joint configuration - // in the state machine (outside of InitialState). - ConfChangeTransitionJointImplicit ConfChangeTransition = 1 - // Use joint consensus and remain in the joint configuration until the - // application proposes a no-op configuration change. This is suitable for - // applications that want to explicitly control the transitions, for example - // to use a custom payload (via the Context field). - ConfChangeTransitionJointExplicit ConfChangeTransition = 2 -) - -var ConfChangeTransition_name = map[int32]string{ - 0: "ConfChangeTransitionAuto", - 1: "ConfChangeTransitionJointImplicit", - 2: "ConfChangeTransitionJointExplicit", -} -var ConfChangeTransition_value = map[string]int32{ - "ConfChangeTransitionAuto": 0, - "ConfChangeTransitionJointImplicit": 1, - "ConfChangeTransitionJointExplicit": 2, -} - -func (x ConfChangeTransition) Enum() *ConfChangeTransition { - p := new(ConfChangeTransition) - *p = x - return p -} -func (x ConfChangeTransition) String() string { - return proto.EnumName(ConfChangeTransition_name, int32(x)) -} -func (x *ConfChangeTransition) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ConfChangeTransition_value, data, "ConfChangeTransition") - if err != nil { - return err - } - *x = ConfChangeTransition(value) - return nil -} -func (ConfChangeTransition) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} } - -type ConfChangeType int32 - -const ( - ConfChangeAddNode ConfChangeType = 0 - ConfChangeRemoveNode ConfChangeType = 1 - ConfChangeUpdateNode ConfChangeType = 2 - ConfChangeAddLearnerNode ConfChangeType = 3 -) - -var ConfChangeType_name = map[int32]string{ - 0: "ConfChangeAddNode", - 1: "ConfChangeRemoveNode", - 2: "ConfChangeUpdateNode", - 3: "ConfChangeAddLearnerNode", -} -var ConfChangeType_value = map[string]int32{ - "ConfChangeAddNode": 0, - "ConfChangeRemoveNode": 1, - "ConfChangeUpdateNode": 2, - "ConfChangeAddLearnerNode": 3, -} - -func (x ConfChangeType) Enum() *ConfChangeType { - p := new(ConfChangeType) - *p = x - return p -} -func (x ConfChangeType) String() string { - return proto.EnumName(ConfChangeType_name, int32(x)) -} -func (x *ConfChangeType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ConfChangeType_value, data, "ConfChangeType") - if err != nil { - return err - } - *x = ConfChangeType(value) - return nil -} -func (ConfChangeType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{3} } - -type Entry struct { - Term uint64 `protobuf:"varint,2,opt,name=Term" json:"Term"` - Index uint64 `protobuf:"varint,3,opt,name=Index" json:"Index"` - Type EntryType `protobuf:"varint,1,opt,name=Type,enum=raftpb.EntryType" json:"Type"` - Data []byte `protobuf:"bytes,4,opt,name=Data" json:"Data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Entry) Reset() { *m = Entry{} } -func (m *Entry) String() string { return proto.CompactTextString(m) } -func (*Entry) ProtoMessage() {} -func (*Entry) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} } - -type SnapshotMetadata struct { - ConfState ConfState `protobuf:"bytes,1,opt,name=conf_state,json=confState" json:"conf_state"` - Index uint64 `protobuf:"varint,2,opt,name=index" json:"index"` - Term uint64 `protobuf:"varint,3,opt,name=term" json:"term"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SnapshotMetadata) Reset() { *m = SnapshotMetadata{} } -func (m *SnapshotMetadata) String() string { return proto.CompactTextString(m) } -func (*SnapshotMetadata) ProtoMessage() {} -func (*SnapshotMetadata) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{1} } - -type Snapshot struct { - Data []byte `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` - Metadata SnapshotMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Snapshot) Reset() { *m = Snapshot{} } -func (m *Snapshot) String() string { return proto.CompactTextString(m) } -func (*Snapshot) ProtoMessage() {} -func (*Snapshot) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} } - -type Message struct { - Type MessageType `protobuf:"varint,1,opt,name=type,enum=raftpb.MessageType" json:"type"` - To uint64 `protobuf:"varint,2,opt,name=to" json:"to"` - From uint64 `protobuf:"varint,3,opt,name=from" json:"from"` - Term uint64 `protobuf:"varint,4,opt,name=term" json:"term"` - LogTerm uint64 `protobuf:"varint,5,opt,name=logTerm" json:"logTerm"` - Index uint64 `protobuf:"varint,6,opt,name=index" json:"index"` - Entries []Entry `protobuf:"bytes,7,rep,name=entries" json:"entries"` - Commit uint64 `protobuf:"varint,8,opt,name=commit" json:"commit"` - Snapshot Snapshot `protobuf:"bytes,9,opt,name=snapshot" json:"snapshot"` - Reject bool `protobuf:"varint,10,opt,name=reject" json:"reject"` - RejectHint uint64 `protobuf:"varint,11,opt,name=rejectHint" json:"rejectHint"` - Context []byte `protobuf:"bytes,12,opt,name=context" json:"context,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{3} } - -type HardState struct { - Term uint64 `protobuf:"varint,1,opt,name=term" json:"term"` - Vote uint64 `protobuf:"varint,2,opt,name=vote" json:"vote"` - Commit uint64 `protobuf:"varint,3,opt,name=commit" json:"commit"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *HardState) Reset() { *m = HardState{} } -func (m *HardState) String() string { return proto.CompactTextString(m) } -func (*HardState) ProtoMessage() {} -func (*HardState) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{4} } - -type ConfState struct { - // The voters in the incoming config. (If the configuration is not joint, - // then the outgoing config is empty). - Voters []uint64 `protobuf:"varint,1,rep,name=voters" json:"voters,omitempty"` - // The learners in the incoming config. - Learners []uint64 `protobuf:"varint,2,rep,name=learners" json:"learners,omitempty"` - // The voters in the outgoing config. - VotersOutgoing []uint64 `protobuf:"varint,3,rep,name=voters_outgoing,json=votersOutgoing" json:"voters_outgoing,omitempty"` - // The nodes that will become learners when the outgoing config is removed. - // These nodes are necessarily currently in nodes_joint (or they would have - // been added to the incoming config right away). - LearnersNext []uint64 `protobuf:"varint,4,rep,name=learners_next,json=learnersNext" json:"learners_next,omitempty"` - // If set, the config is joint and Raft will automatically transition into - // the final config (i.e. remove the outgoing config) when this is safe. - AutoLeave bool `protobuf:"varint,5,opt,name=auto_leave,json=autoLeave" json:"auto_leave"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ConfState) Reset() { *m = ConfState{} } -func (m *ConfState) String() string { return proto.CompactTextString(m) } -func (*ConfState) ProtoMessage() {} -func (*ConfState) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{5} } - -type ConfChange struct { - Type ConfChangeType `protobuf:"varint,2,opt,name=type,enum=raftpb.ConfChangeType" json:"type"` - NodeID uint64 `protobuf:"varint,3,opt,name=node_id,json=nodeId" json:"node_id"` - Context []byte `protobuf:"bytes,4,opt,name=context" json:"context,omitempty"` - // NB: this is used only by etcd to thread through a unique identifier. - // Ideally it should really use the Context instead. No counterpart to - // this field exists in ConfChangeV2. - ID uint64 `protobuf:"varint,1,opt,name=id" json:"id"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ConfChange) Reset() { *m = ConfChange{} } -func (m *ConfChange) String() string { return proto.CompactTextString(m) } -func (*ConfChange) ProtoMessage() {} -func (*ConfChange) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{6} } - -// ConfChangeSingle is an individual configuration change operation. Multiple -// such operations can be carried out atomically via a ConfChangeV2. -type ConfChangeSingle struct { - Type ConfChangeType `protobuf:"varint,1,opt,name=type,enum=raftpb.ConfChangeType" json:"type"` - NodeID uint64 `protobuf:"varint,2,opt,name=node_id,json=nodeId" json:"node_id"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ConfChangeSingle) Reset() { *m = ConfChangeSingle{} } -func (m *ConfChangeSingle) String() string { return proto.CompactTextString(m) } -func (*ConfChangeSingle) ProtoMessage() {} -func (*ConfChangeSingle) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{7} } - -// ConfChangeV2 messages initiate configuration changes. They support both the -// simple "one at a time" membership change protocol and full Joint Consensus -// allowing for arbitrary changes in membership. -// -// The supplied context is treated as an opaque payload and can be used to -// attach an action on the state machine to the application of the config change -// proposal. Note that contrary to Joint Consensus as outlined in the Raft -// paper[1], configuration changes become active when they are *applied* to the -// state machine (not when they are appended to the log). -// -// The simple protocol can be used whenever only a single change is made. -// -// Non-simple changes require the use of Joint Consensus, for which two -// configuration changes are run. The first configuration change specifies the -// desired changes and transitions the Raft group into the joint configuration, -// in which quorum requires a majority of both the pre-changes and post-changes -// configuration. Joint Consensus avoids entering fragile intermediate -// configurations that could compromise survivability. For example, without the -// use of Joint Consensus and running across three availability zones with a -// replication factor of three, it is not possible to replace a voter without -// entering an intermediate configuration that does not survive the outage of -// one availability zone. -// -// The provided ConfChangeTransition specifies how (and whether) Joint Consensus -// is used, and assigns the task of leaving the joint configuration either to -// Raft or the application. Leaving the joint configuration is accomplished by -// proposing a ConfChangeV2 with only and optionally the Context field -// populated. -// -// For details on Raft membership changes, see: -// -// [1]: https://github.com/ongardie/dissertation/blob/master/online-trim.pdf -type ConfChangeV2 struct { - Transition ConfChangeTransition `protobuf:"varint,1,opt,name=transition,enum=raftpb.ConfChangeTransition" json:"transition"` - Changes []ConfChangeSingle `protobuf:"bytes,2,rep,name=changes" json:"changes"` - Context []byte `protobuf:"bytes,3,opt,name=context" json:"context,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ConfChangeV2) Reset() { *m = ConfChangeV2{} } -func (m *ConfChangeV2) String() string { return proto.CompactTextString(m) } -func (*ConfChangeV2) ProtoMessage() {} -func (*ConfChangeV2) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{8} } - -func init() { - proto.RegisterType((*Entry)(nil), "raftpb.Entry") - proto.RegisterType((*SnapshotMetadata)(nil), "raftpb.SnapshotMetadata") - proto.RegisterType((*Snapshot)(nil), "raftpb.Snapshot") - proto.RegisterType((*Message)(nil), "raftpb.Message") - proto.RegisterType((*HardState)(nil), "raftpb.HardState") - proto.RegisterType((*ConfState)(nil), "raftpb.ConfState") - proto.RegisterType((*ConfChange)(nil), "raftpb.ConfChange") - proto.RegisterType((*ConfChangeSingle)(nil), "raftpb.ConfChangeSingle") - proto.RegisterType((*ConfChangeV2)(nil), "raftpb.ConfChangeV2") - proto.RegisterEnum("raftpb.EntryType", EntryType_name, EntryType_value) - proto.RegisterEnum("raftpb.MessageType", MessageType_name, MessageType_value) - proto.RegisterEnum("raftpb.ConfChangeTransition", ConfChangeTransition_name, ConfChangeTransition_value) - proto.RegisterEnum("raftpb.ConfChangeType", ConfChangeType_name, ConfChangeType_value) -} -func (m *Entry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Entry) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Type)) - dAtA[i] = 0x10 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Term)) - dAtA[i] = 0x18 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Index)) - if m.Data != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRaft(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *SnapshotMetadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotMetadata) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.ConfState.Size())) - n1, err := m.ConfState.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - dAtA[i] = 0x10 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Index)) - dAtA[i] = 0x18 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Term)) - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Snapshot) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Data != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRaft(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Metadata.Size())) - n2, err := m.Metadata.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Type)) - dAtA[i] = 0x10 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.To)) - dAtA[i] = 0x18 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.From)) - dAtA[i] = 0x20 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Term)) - dAtA[i] = 0x28 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.LogTerm)) - dAtA[i] = 0x30 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Index)) - if len(m.Entries) > 0 { - for _, msg := range m.Entries { - dAtA[i] = 0x3a - i++ - i = encodeVarintRaft(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - dAtA[i] = 0x40 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Commit)) - dAtA[i] = 0x4a - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Snapshot.Size())) - n3, err := m.Snapshot.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 - dAtA[i] = 0x50 - i++ - if m.Reject { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - dAtA[i] = 0x58 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.RejectHint)) - if m.Context != nil { - dAtA[i] = 0x62 - i++ - i = encodeVarintRaft(dAtA, i, uint64(len(m.Context))) - i += copy(dAtA[i:], m.Context) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *HardState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HardState) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Term)) - dAtA[i] = 0x10 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Vote)) - dAtA[i] = 0x18 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Commit)) - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ConfState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfState) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Voters) > 0 { - for _, num := range m.Voters { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(num)) - } - } - if len(m.Learners) > 0 { - for _, num := range m.Learners { - dAtA[i] = 0x10 - i++ - i = encodeVarintRaft(dAtA, i, uint64(num)) - } - } - if len(m.VotersOutgoing) > 0 { - for _, num := range m.VotersOutgoing { - dAtA[i] = 0x18 - i++ - i = encodeVarintRaft(dAtA, i, uint64(num)) - } - } - if len(m.LearnersNext) > 0 { - for _, num := range m.LearnersNext { - dAtA[i] = 0x20 - i++ - i = encodeVarintRaft(dAtA, i, uint64(num)) - } - } - dAtA[i] = 0x28 - i++ - if m.AutoLeave { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ConfChange) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfChange) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.ID)) - dAtA[i] = 0x10 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Type)) - dAtA[i] = 0x18 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.NodeID)) - if m.Context != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRaft(dAtA, i, uint64(len(m.Context))) - i += copy(dAtA[i:], m.Context) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ConfChangeSingle) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfChangeSingle) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Type)) - dAtA[i] = 0x10 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.NodeID)) - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ConfChangeV2) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConfChangeV2) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Transition)) - if len(m.Changes) > 0 { - for _, msg := range m.Changes { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaft(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Context != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRaft(dAtA, i, uint64(len(m.Context))) - i += copy(dAtA[i:], m.Context) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeVarintRaft(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Entry) Size() (n int) { - var l int - _ = l - n += 1 + sovRaft(uint64(m.Type)) - n += 1 + sovRaft(uint64(m.Term)) - n += 1 + sovRaft(uint64(m.Index)) - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovRaft(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SnapshotMetadata) Size() (n int) { - var l int - _ = l - l = m.ConfState.Size() - n += 1 + l + sovRaft(uint64(l)) - n += 1 + sovRaft(uint64(m.Index)) - n += 1 + sovRaft(uint64(m.Term)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Snapshot) Size() (n int) { - var l int - _ = l - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovRaft(uint64(l)) - } - l = m.Metadata.Size() - n += 1 + l + sovRaft(uint64(l)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Message) Size() (n int) { - var l int - _ = l - n += 1 + sovRaft(uint64(m.Type)) - n += 1 + sovRaft(uint64(m.To)) - n += 1 + sovRaft(uint64(m.From)) - n += 1 + sovRaft(uint64(m.Term)) - n += 1 + sovRaft(uint64(m.LogTerm)) - n += 1 + sovRaft(uint64(m.Index)) - if len(m.Entries) > 0 { - for _, e := range m.Entries { - l = e.Size() - n += 1 + l + sovRaft(uint64(l)) - } - } - n += 1 + sovRaft(uint64(m.Commit)) - l = m.Snapshot.Size() - n += 1 + l + sovRaft(uint64(l)) - n += 2 - n += 1 + sovRaft(uint64(m.RejectHint)) - if m.Context != nil { - l = len(m.Context) - n += 1 + l + sovRaft(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *HardState) Size() (n int) { - var l int - _ = l - n += 1 + sovRaft(uint64(m.Term)) - n += 1 + sovRaft(uint64(m.Vote)) - n += 1 + sovRaft(uint64(m.Commit)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ConfState) Size() (n int) { - var l int - _ = l - if len(m.Voters) > 0 { - for _, e := range m.Voters { - n += 1 + sovRaft(uint64(e)) - } - } - if len(m.Learners) > 0 { - for _, e := range m.Learners { - n += 1 + sovRaft(uint64(e)) - } - } - if len(m.VotersOutgoing) > 0 { - for _, e := range m.VotersOutgoing { - n += 1 + sovRaft(uint64(e)) - } - } - if len(m.LearnersNext) > 0 { - for _, e := range m.LearnersNext { - n += 1 + sovRaft(uint64(e)) - } - } - n += 2 - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ConfChange) Size() (n int) { - var l int - _ = l - n += 1 + sovRaft(uint64(m.ID)) - n += 1 + sovRaft(uint64(m.Type)) - n += 1 + sovRaft(uint64(m.NodeID)) - if m.Context != nil { - l = len(m.Context) - n += 1 + l + sovRaft(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ConfChangeSingle) Size() (n int) { - var l int - _ = l - n += 1 + sovRaft(uint64(m.Type)) - n += 1 + sovRaft(uint64(m.NodeID)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ConfChangeV2) Size() (n int) { - var l int - _ = l - n += 1 + sovRaft(uint64(m.Transition)) - if len(m.Changes) > 0 { - for _, e := range m.Changes { - l = e.Size() - n += 1 + l + sovRaft(uint64(l)) - } - } - if m.Context != nil { - l = len(m.Context) - n += 1 + l + sovRaft(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovRaft(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozRaft(x uint64) (n int) { - return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Entry) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Entry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= (EntryType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) - } - m.Term = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Term |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotMetadata) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ConfState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) - } - m.Term = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Term |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Snapshot) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Snapshot: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= (MessageType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - m.To = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.To |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - m.From = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.From |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) - } - m.Term = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Term |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LogTerm", wireType) - } - m.LogTerm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LogTerm |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Entries = append(m.Entries, Entry{}) - if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) - } - m.Commit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Commit |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reject", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Reject = bool(v != 0) - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RejectHint", wireType) - } - m.RejectHint = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RejectHint |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...) - if m.Context == nil { - m.Context = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HardState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HardState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HardState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) - } - m.Term = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Term |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) - } - m.Vote = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Vote |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) - } - m.Commit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Commit |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConfState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Voters = append(m.Voters, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + packedLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Voters = append(m.Voters, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Voters", wireType) - } - case 2: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Learners = append(m.Learners, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + packedLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Learners = append(m.Learners, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Learners", wireType) - } - case 3: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.VotersOutgoing = append(m.VotersOutgoing, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + packedLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.VotersOutgoing = append(m.VotersOutgoing, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field VotersOutgoing", wireType) - } - case 4: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LearnersNext = append(m.LearnersNext, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + packedLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LearnersNext = append(m.LearnersNext, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field LearnersNext", wireType) - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AutoLeave", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AutoLeave = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfChange) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConfChange: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfChange: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= (ConfChangeType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - m.NodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NodeID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...) - if m.Context == nil { - m.Context = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfChangeSingle) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConfChangeSingle: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfChangeSingle: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= (ConfChangeType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - m.NodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NodeID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfChangeV2) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConfChangeV2: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfChangeV2: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Transition", wireType) - } - m.Transition = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Transition |= (ConfChangeTransition(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Changes = append(m.Changes, ConfChangeSingle{}) - if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaft - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...) - if m.Context == nil { - m.Context = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaft(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRaft(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthRaft - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRaft(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") -) - -func init() { proto.RegisterFile("raft.proto", fileDescriptorRaft) } - -var fileDescriptorRaft = []byte{ - // 1009 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0xe3, 0x36, - 0x17, 0xb5, 0x64, 0xc5, 0x3f, 0xd7, 0x8e, 0xc3, 0xdc, 0xc9, 0x37, 0x20, 0x82, 0xc0, 0xe3, 0xcf, - 0xd3, 0x62, 0x8c, 0x14, 0x93, 0x16, 0x5e, 0x14, 0x45, 0x77, 0xf9, 0x19, 0x20, 0x29, 0xe2, 0x74, - 0xea, 0x64, 0xb2, 0x28, 0x50, 0x04, 0x8c, 0x45, 0x2b, 0x6a, 0x2d, 0x51, 0xa0, 0xe8, 0x34, 0xd9, - 0x14, 0x45, 0x9f, 0xa2, 0x9b, 0xd9, 0xf6, 0x01, 0xfa, 0x14, 0x59, 0x0e, 0xd0, 0xfd, 0xa0, 0x93, - 0xbe, 0x48, 0x41, 0x8a, 0xb2, 0x65, 0x27, 0x98, 0x45, 0x77, 0xe4, 0x39, 0x87, 0xf7, 0x9e, 0x7b, - 0x79, 0x45, 0x01, 0x48, 0x36, 0x56, 0x3b, 0x89, 0x14, 0x4a, 0x60, 0x45, 0xaf, 0x93, 0xcb, 0xcd, - 0x8d, 0x40, 0x04, 0xc2, 0x40, 0x9f, 0xeb, 0x55, 0xc6, 0x76, 0x7f, 0x81, 0x95, 0x57, 0xb1, 0x92, - 0xb7, 0xf8, 0x19, 0x78, 0x67, 0xb7, 0x09, 0xa7, 0x4e, 0xc7, 0xe9, 0xb5, 0xfa, 0xeb, 0x3b, 0xd9, - 0xa9, 0x1d, 0x43, 0x6a, 0x62, 0xcf, 0xbb, 0x7b, 0xff, 0xac, 0x34, 0x34, 0x22, 0xa4, 0xe0, 0x9d, - 0x71, 0x19, 0x51, 0xb7, 0xe3, 0xf4, 0xbc, 0x19, 0xc3, 0x65, 0x84, 0x9b, 0xb0, 0x72, 0x14, 0xfb, - 0xfc, 0x86, 0x96, 0x0b, 0x54, 0x06, 0x21, 0x82, 0x77, 0xc0, 0x14, 0xa3, 0x5e, 0xc7, 0xe9, 0x35, - 0x87, 0x66, 0xdd, 0xfd, 0xd5, 0x01, 0x72, 0x1a, 0xb3, 0x24, 0xbd, 0x12, 0x6a, 0xc0, 0x15, 0xf3, - 0x99, 0x62, 0xf8, 0x25, 0xc0, 0x48, 0xc4, 0xe3, 0x8b, 0x54, 0x31, 0x95, 0x39, 0x6a, 0xcc, 0x1d, - 0xed, 0x8b, 0x78, 0x7c, 0xaa, 0x09, 0x1b, 0xbc, 0x3e, 0xca, 0x01, 0x9d, 0x3c, 0x34, 0xc9, 0x8b, - 0xbe, 0x32, 0x48, 0x5b, 0x56, 0xda, 0x72, 0xd1, 0x97, 0x41, 0xba, 0xdf, 0x43, 0x2d, 0x77, 0xa0, - 0x2d, 0x6a, 0x07, 0x26, 0x67, 0x73, 0x68, 0xd6, 0xf8, 0x35, 0xd4, 0x22, 0xeb, 0xcc, 0x04, 0x6e, - 0xf4, 0x69, 0xee, 0x65, 0xd9, 0xb9, 0x8d, 0x3b, 0xd3, 0x77, 0xdf, 0x96, 0xa1, 0x3a, 0xe0, 0x69, - 0xca, 0x02, 0x8e, 0x2f, 0xc1, 0x53, 0xf3, 0x0e, 0x3f, 0xc9, 0x63, 0x58, 0xba, 0xd8, 0x63, 0x2d, - 0xc3, 0x0d, 0x70, 0x95, 0x58, 0xa8, 0xc4, 0x55, 0x42, 0x97, 0x31, 0x96, 0x62, 0xa9, 0x0c, 0x8d, - 0xcc, 0x0a, 0xf4, 0x96, 0x0b, 0xc4, 0x36, 0x54, 0x27, 0x22, 0x30, 0x17, 0xb6, 0x52, 0x20, 0x73, - 0x70, 0xde, 0xb6, 0xca, 0xc3, 0xb6, 0xbd, 0x84, 0x2a, 0x8f, 0x95, 0x0c, 0x79, 0x4a, 0xab, 0x9d, - 0x72, 0xaf, 0xd1, 0x5f, 0x5d, 0x98, 0x8c, 0x3c, 0x94, 0xd5, 0xe0, 0x16, 0x54, 0x46, 0x22, 0x8a, - 0x42, 0x45, 0x6b, 0x85, 0x58, 0x16, 0xc3, 0x3e, 0xd4, 0x52, 0xdb, 0x31, 0x5a, 0x37, 0x9d, 0x24, - 0xcb, 0x9d, 0xcc, 0x3b, 0x98, 0xeb, 0x74, 0x44, 0xc9, 0x7f, 0xe4, 0x23, 0x45, 0xa1, 0xe3, 0xf4, - 0x6a, 0x79, 0xc4, 0x0c, 0xc3, 0x4f, 0x00, 0xb2, 0xd5, 0x61, 0x18, 0x2b, 0xda, 0x28, 0xe4, 0x2c, - 0xe0, 0x48, 0xa1, 0x3a, 0x12, 0xb1, 0xe2, 0x37, 0x8a, 0x36, 0xcd, 0xc5, 0xe6, 0xdb, 0xee, 0x0f, - 0x50, 0x3f, 0x64, 0xd2, 0xcf, 0xc6, 0x27, 0xef, 0xa0, 0xf3, 0xa0, 0x83, 0x14, 0xbc, 0x6b, 0xa1, - 0xf8, 0xe2, 0xbc, 0x6b, 0xa4, 0x50, 0x70, 0xf9, 0x61, 0xc1, 0xdd, 0x3f, 0x1d, 0xa8, 0xcf, 0xe6, - 0x15, 0x9f, 0x42, 0x45, 0x9f, 0x91, 0x29, 0x75, 0x3a, 0xe5, 0x9e, 0x37, 0xb4, 0x3b, 0xdc, 0x84, - 0xda, 0x84, 0x33, 0x19, 0x6b, 0xc6, 0x35, 0xcc, 0x6c, 0x8f, 0x2f, 0x60, 0x2d, 0x53, 0x5d, 0x88, - 0xa9, 0x0a, 0x44, 0x18, 0x07, 0xb4, 0x6c, 0x24, 0xad, 0x0c, 0xfe, 0xd6, 0xa2, 0xf8, 0x1c, 0x56, - 0xf3, 0x43, 0x17, 0xb1, 0xae, 0xd4, 0x33, 0xb2, 0x66, 0x0e, 0x9e, 0xf0, 0x1b, 0x85, 0xcf, 0x01, - 0xd8, 0x54, 0x89, 0x8b, 0x09, 0x67, 0xd7, 0xdc, 0x0c, 0x43, 0xde, 0xd0, 0xba, 0xc6, 0x8f, 0x35, - 0xdc, 0x7d, 0xeb, 0x00, 0x68, 0xd3, 0xfb, 0x57, 0x2c, 0x0e, 0xf4, 0x47, 0xe5, 0x86, 0xbe, 0xed, - 0x09, 0x68, 0xed, 0xfd, 0xfb, 0x67, 0xee, 0xd1, 0xc1, 0xd0, 0x0d, 0x7d, 0xfc, 0xc2, 0x8e, 0xb4, - 0x6b, 0x46, 0xfa, 0x69, 0xf1, 0x13, 0xcd, 0x4e, 0x3f, 0x98, 0xea, 0x17, 0x50, 0x8d, 0x85, 0xcf, - 0x2f, 0x42, 0xdf, 0x36, 0xac, 0x65, 0x43, 0x56, 0x4e, 0x84, 0xcf, 0x8f, 0x0e, 0x86, 0x15, 0x4d, - 0x1f, 0xf9, 0xc5, 0x3b, 0xf3, 0x16, 0xef, 0x2c, 0x02, 0x32, 0x4f, 0x70, 0x1a, 0xc6, 0xc1, 0x84, - 0xcf, 0x8c, 0x38, 0xff, 0xc5, 0x88, 0xfb, 0x31, 0x23, 0xdd, 0x3f, 0x1c, 0x68, 0xce, 0xe3, 0x9c, - 0xf7, 0x71, 0x0f, 0x40, 0x49, 0x16, 0xa7, 0xa1, 0x0a, 0x45, 0x6c, 0x33, 0x6e, 0x3d, 0x92, 0x71, - 0xa6, 0xc9, 0x27, 0x72, 0x7e, 0x0a, 0xbf, 0x82, 0xea, 0xc8, 0xa8, 0xb2, 0x1b, 0x2f, 0x3c, 0x29, - 0xcb, 0xa5, 0xe5, 0x5f, 0x98, 0x95, 0x17, 0xfb, 0x52, 0x5e, 0xe8, 0xcb, 0xf6, 0x21, 0xd4, 0x67, - 0xaf, 0x35, 0xae, 0x41, 0xc3, 0x6c, 0x4e, 0x84, 0x8c, 0xd8, 0x84, 0x94, 0xf0, 0x09, 0xac, 0x19, - 0x60, 0x1e, 0x9f, 0x38, 0xf8, 0x3f, 0x58, 0x5f, 0x02, 0xcf, 0xfb, 0xc4, 0xdd, 0xfe, 0xcb, 0x85, - 0x46, 0xe1, 0x59, 0x42, 0x80, 0xca, 0x20, 0x0d, 0x0e, 0xa7, 0x09, 0x29, 0x61, 0x03, 0xaa, 0x83, - 0x34, 0xd8, 0xe3, 0x4c, 0x11, 0xc7, 0x6e, 0x5e, 0x4b, 0x91, 0x10, 0xd7, 0xaa, 0x76, 0x93, 0x84, - 0x94, 0xb1, 0x05, 0x90, 0xad, 0x87, 0x3c, 0x4d, 0x88, 0x67, 0x85, 0xe7, 0x42, 0x71, 0xb2, 0xa2, - 0xbd, 0xd9, 0x8d, 0x61, 0x2b, 0x96, 0xd5, 0x4f, 0x00, 0xa9, 0x22, 0x81, 0xa6, 0x4e, 0xc6, 0x99, - 0x54, 0x97, 0x3a, 0x4b, 0x0d, 0x37, 0x80, 0x14, 0x11, 0x73, 0xa8, 0x8e, 0x08, 0xad, 0x41, 0x1a, - 0xbc, 0x89, 0x25, 0x67, 0xa3, 0x2b, 0x76, 0x39, 0xe1, 0x04, 0x70, 0x1d, 0x56, 0x6d, 0x20, 0xfd, - 0xc5, 0x4d, 0x53, 0xd2, 0xb0, 0xb2, 0xfd, 0x2b, 0x3e, 0xfa, 0xe9, 0xbb, 0xa9, 0x90, 0xd3, 0x88, - 0x34, 0x75, 0xd9, 0x83, 0x34, 0x30, 0x17, 0x34, 0xe6, 0xf2, 0x98, 0x33, 0x9f, 0x4b, 0xb2, 0x6a, - 0x4f, 0x9f, 0x85, 0x11, 0x17, 0x53, 0x75, 0x22, 0x7e, 0x26, 0x2d, 0x6b, 0x66, 0xc8, 0x99, 0x6f, - 0x7e, 0x61, 0x64, 0xcd, 0x9a, 0x99, 0x21, 0xc6, 0x0c, 0xb1, 0xf5, 0xbe, 0x96, 0xdc, 0x94, 0xb8, - 0x6e, 0xb3, 0xda, 0xbd, 0xd1, 0xe0, 0xf6, 0x6f, 0x0e, 0x6c, 0x3c, 0x36, 0x1e, 0xb8, 0x05, 0xf4, - 0x31, 0x7c, 0x77, 0xaa, 0x04, 0x29, 0xe1, 0xa7, 0xf0, 0xff, 0xc7, 0xd8, 0x6f, 0x44, 0x18, 0xab, - 0xa3, 0x28, 0x99, 0x84, 0xa3, 0x50, 0x5f, 0xc5, 0xc7, 0x64, 0xaf, 0x6e, 0xac, 0xcc, 0xdd, 0xbe, - 0x85, 0xd6, 0xe2, 0x47, 0xa1, 0x9b, 0x31, 0x47, 0x76, 0x7d, 0x5f, 0x8f, 0x3f, 0x29, 0x21, 0x2d, - 0x9a, 0x1d, 0xf2, 0x48, 0x5c, 0x73, 0xc3, 0x38, 0x8b, 0xcc, 0x9b, 0xc4, 0x67, 0x2a, 0x63, 0xdc, - 0xc5, 0x42, 0x76, 0x7d, 0xff, 0x38, 0x7b, 0x7b, 0x0c, 0x5b, 0xde, 0xa3, 0x77, 0x1f, 0xda, 0xa5, - 0x77, 0x1f, 0xda, 0xa5, 0xbb, 0xfb, 0xb6, 0xf3, 0xee, 0xbe, 0xed, 0xfc, 0x7d, 0xdf, 0x76, 0x7e, - 0xff, 0xa7, 0x5d, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x87, 0x11, 0x6d, 0xd6, 0xaf, 0x08, 0x00, - 0x00, -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/raft.proto b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/raft.proto deleted file mode 100644 index 23d62ec2fb02..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/raftpb/raft.proto +++ /dev/null @@ -1,177 +0,0 @@ -syntax = "proto2"; -package raftpb; - -import "gogoproto/gogo.proto"; - -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.goproto_enum_prefix_all) = false; - -enum EntryType { - EntryNormal = 0; - EntryConfChange = 1; // corresponds to pb.ConfChange - EntryConfChangeV2 = 2; // corresponds to pb.ConfChangeV2 -} - -message Entry { - optional uint64 Term = 2 [(gogoproto.nullable) = false]; // must be 64-bit aligned for atomic operations - optional uint64 Index = 3 [(gogoproto.nullable) = false]; // must be 64-bit aligned for atomic operations - optional EntryType Type = 1 [(gogoproto.nullable) = false]; - optional bytes Data = 4; -} - -message SnapshotMetadata { - optional ConfState conf_state = 1 [(gogoproto.nullable) = false]; - optional uint64 index = 2 [(gogoproto.nullable) = false]; - optional uint64 term = 3 [(gogoproto.nullable) = false]; -} - -message Snapshot { - optional bytes data = 1; - optional SnapshotMetadata metadata = 2 [(gogoproto.nullable) = false]; -} - -enum MessageType { - MsgHup = 0; - MsgBeat = 1; - MsgProp = 2; - MsgApp = 3; - MsgAppResp = 4; - MsgVote = 5; - MsgVoteResp = 6; - MsgSnap = 7; - MsgHeartbeat = 8; - MsgHeartbeatResp = 9; - MsgUnreachable = 10; - MsgSnapStatus = 11; - MsgCheckQuorum = 12; - MsgTransferLeader = 13; - MsgTimeoutNow = 14; - MsgReadIndex = 15; - MsgReadIndexResp = 16; - MsgPreVote = 17; - MsgPreVoteResp = 18; -} - -message Message { - optional MessageType type = 1 [(gogoproto.nullable) = false]; - optional uint64 to = 2 [(gogoproto.nullable) = false]; - optional uint64 from = 3 [(gogoproto.nullable) = false]; - optional uint64 term = 4 [(gogoproto.nullable) = false]; - optional uint64 logTerm = 5 [(gogoproto.nullable) = false]; - optional uint64 index = 6 [(gogoproto.nullable) = false]; - repeated Entry entries = 7 [(gogoproto.nullable) = false]; - optional uint64 commit = 8 [(gogoproto.nullable) = false]; - optional Snapshot snapshot = 9 [(gogoproto.nullable) = false]; - optional bool reject = 10 [(gogoproto.nullable) = false]; - optional uint64 rejectHint = 11 [(gogoproto.nullable) = false]; - optional bytes context = 12; -} - -message HardState { - optional uint64 term = 1 [(gogoproto.nullable) = false]; - optional uint64 vote = 2 [(gogoproto.nullable) = false]; - optional uint64 commit = 3 [(gogoproto.nullable) = false]; -} - -// ConfChangeTransition specifies the behavior of a configuration change with -// respect to joint consensus. -enum ConfChangeTransition { - // Automatically use the simple protocol if possible, otherwise fall back - // to ConfChangeJointImplicit. Most applications will want to use this. - ConfChangeTransitionAuto = 0; - // Use joint consensus unconditionally, and transition out of them - // automatically (by proposing a zero configuration change). - // - // This option is suitable for applications that want to minimize the time - // spent in the joint configuration and do not store the joint configuration - // in the state machine (outside of InitialState). - ConfChangeTransitionJointImplicit = 1; - // Use joint consensus and remain in the joint configuration until the - // application proposes a no-op configuration change. This is suitable for - // applications that want to explicitly control the transitions, for example - // to use a custom payload (via the Context field). - ConfChangeTransitionJointExplicit = 2; -} - -message ConfState { - // The voters in the incoming config. (If the configuration is not joint, - // then the outgoing config is empty). - repeated uint64 voters = 1; - // The learners in the incoming config. - repeated uint64 learners = 2; - // The voters in the outgoing config. - repeated uint64 voters_outgoing = 3; - // The nodes that will become learners when the outgoing config is removed. - // These nodes are necessarily currently in nodes_joint (or they would have - // been added to the incoming config right away). - repeated uint64 learners_next = 4; - // If set, the config is joint and Raft will automatically transition into - // the final config (i.e. remove the outgoing config) when this is safe. - optional bool auto_leave = 5 [(gogoproto.nullable) = false]; -} - -enum ConfChangeType { - ConfChangeAddNode = 0; - ConfChangeRemoveNode = 1; - ConfChangeUpdateNode = 2; - ConfChangeAddLearnerNode = 3; -} - -message ConfChange { - optional ConfChangeType type = 2 [(gogoproto.nullable) = false]; - optional uint64 node_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "NodeID" ]; - optional bytes context = 4; - - // NB: this is used only by etcd to thread through a unique identifier. - // Ideally it should really use the Context instead. No counterpart to - // this field exists in ConfChangeV2. - optional uint64 id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "ID" ]; -} - -// ConfChangeSingle is an individual configuration change operation. Multiple -// such operations can be carried out atomically via a ConfChangeV2. -message ConfChangeSingle { - optional ConfChangeType type = 1 [(gogoproto.nullable) = false]; - optional uint64 node_id = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "NodeID"]; -} - -// ConfChangeV2 messages initiate configuration changes. They support both the -// simple "one at a time" membership change protocol and full Joint Consensus -// allowing for arbitrary changes in membership. -// -// The supplied context is treated as an opaque payload and can be used to -// attach an action on the state machine to the application of the config change -// proposal. Note that contrary to Joint Consensus as outlined in the Raft -// paper[1], configuration changes become active when they are *applied* to the -// state machine (not when they are appended to the log). -// -// The simple protocol can be used whenever only a single change is made. -// -// Non-simple changes require the use of Joint Consensus, for which two -// configuration changes are run. The first configuration change specifies the -// desired changes and transitions the Raft group into the joint configuration, -// in which quorum requires a majority of both the pre-changes and post-changes -// configuration. Joint Consensus avoids entering fragile intermediate -// configurations that could compromise survivability. For example, without the -// use of Joint Consensus and running across three availability zones with a -// replication factor of three, it is not possible to replace a voter without -// entering an intermediate configuration that does not survive the outage of -// one availability zone. -// -// The provided ConfChangeTransition specifies how (and whether) Joint Consensus -// is used, and assigns the task of leaving the joint configuration either to -// Raft or the application. Leaving the joint configuration is accomplished by -// proposing a ConfChangeV2 with only and optionally the Context field -// populated. -// -// For details on Raft membership changes, see: -// -// [1]: https://github.com/ongardie/dissertation/blob/master/online-trim.pdf -message ConfChangeV2 { - optional ConfChangeTransition transition = 1 [(gogoproto.nullable) = false]; - repeated ConfChangeSingle changes = 2 [(gogoproto.nullable) = false]; - optional bytes context = 3; -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/rawnode.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/rawnode.go deleted file mode 100644 index 90eb69493c65..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/rawnode.go +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import ( - "errors" - - pb "go.etcd.io/etcd/raft/raftpb" - "go.etcd.io/etcd/raft/tracker" -) - -// ErrStepLocalMsg is returned when try to step a local raft message -var ErrStepLocalMsg = errors.New("raft: cannot step raft local message") - -// ErrStepPeerNotFound is returned when try to step a response message -// but there is no peer found in raft.prs for that node. -var ErrStepPeerNotFound = errors.New("raft: cannot step as peer not found") - -// RawNode is a thread-unsafe Node. -// The methods of this struct correspond to the methods of Node and are described -// more fully there. -type RawNode struct { - raft *raft - prevSoftSt *SoftState - prevHardSt pb.HardState -} - -// NewRawNode instantiates a RawNode from the given configuration. -// -// See Bootstrap() for bootstrapping an initial state; this replaces the former -// 'peers' argument to this method (with identical behavior). However, It is -// recommended that instead of calling Bootstrap, applications bootstrap their -// state manually by setting up a Storage that has a first index > 1 and which -// stores the desired ConfState as its InitialState. -func NewRawNode(config *Config) (*RawNode, error) { - r := newRaft(config) - rn := &RawNode{ - raft: r, - } - rn.prevSoftSt = r.softState() - rn.prevHardSt = r.hardState() - return rn, nil -} - -// Tick advances the internal logical clock by a single tick. -func (rn *RawNode) Tick() { - rn.raft.tick() -} - -// TickQuiesced advances the internal logical clock by a single tick without -// performing any other state machine processing. It allows the caller to avoid -// periodic heartbeats and elections when all of the peers in a Raft group are -// known to be at the same state. Expected usage is to periodically invoke Tick -// or TickQuiesced depending on whether the group is "active" or "quiesced". -// -// WARNING: Be very careful about using this method as it subverts the Raft -// state machine. You should probably be using Tick instead. -func (rn *RawNode) TickQuiesced() { - rn.raft.electionElapsed++ -} - -// Campaign causes this RawNode to transition to candidate state. -func (rn *RawNode) Campaign() error { - return rn.raft.Step(pb.Message{ - Type: pb.MsgHup, - }) -} - -// Propose proposes data be appended to the raft log. -func (rn *RawNode) Propose(data []byte) error { - return rn.raft.Step(pb.Message{ - Type: pb.MsgProp, - From: rn.raft.id, - Entries: []pb.Entry{ - {Data: data}, - }}) -} - -// ProposeConfChange proposes a config change. See (Node).ProposeConfChange for -// details. -func (rn *RawNode) ProposeConfChange(cc pb.ConfChangeI) error { - m, err := confChangeToMsg(cc) - if err != nil { - return err - } - return rn.raft.Step(m) -} - -// ApplyConfChange applies a config change to the local node. -func (rn *RawNode) ApplyConfChange(cc pb.ConfChangeI) *pb.ConfState { - cs := rn.raft.applyConfChange(cc.AsV2()) - return &cs -} - -// Step advances the state machine using the given message. -func (rn *RawNode) Step(m pb.Message) error { - // ignore unexpected local messages receiving over network - if IsLocalMsg(m.Type) { - return ErrStepLocalMsg - } - if pr := rn.raft.prs.Progress[m.From]; pr != nil || !IsResponseMsg(m.Type) { - return rn.raft.Step(m) - } - return ErrStepPeerNotFound -} - -// Ready returns the outstanding work that the application needs to handle. This -// includes appending and applying entries or a snapshot, updating the HardState, -// and sending messages. The returned Ready() *must* be handled and subsequently -// passed back via Advance(). -func (rn *RawNode) Ready() Ready { - rd := rn.readyWithoutAccept() - rn.acceptReady(rd) - return rd -} - -// readyWithoutAccept returns a Ready. This is a read-only operation, i.e. there -// is no obligation that the Ready must be handled. -func (rn *RawNode) readyWithoutAccept() Ready { - return newReady(rn.raft, rn.prevSoftSt, rn.prevHardSt) -} - -// acceptReady is called when the consumer of the RawNode has decided to go -// ahead and handle a Ready. Nothing must alter the state of the RawNode between -// this call and the prior call to Ready(). -func (rn *RawNode) acceptReady(rd Ready) { - if rd.SoftState != nil { - rn.prevSoftSt = rd.SoftState - } - if len(rd.ReadStates) != 0 { - rn.raft.readStates = nil - } - rn.raft.msgs = nil -} - -// HasReady called when RawNode user need to check if any Ready pending. -// Checking logic in this method should be consistent with Ready.containsUpdates(). -func (rn *RawNode) HasReady() bool { - r := rn.raft - if !r.softState().equal(rn.prevSoftSt) { - return true - } - if hardSt := r.hardState(); !IsEmptyHardState(hardSt) && !isHardStateEqual(hardSt, rn.prevHardSt) { - return true - } - if r.raftLog.unstable.snapshot != nil && !IsEmptySnap(*r.raftLog.unstable.snapshot) { - return true - } - if len(r.msgs) > 0 || len(r.raftLog.unstableEntries()) > 0 || r.raftLog.hasNextEnts() { - return true - } - if len(r.readStates) != 0 { - return true - } - return false -} - -// Advance notifies the RawNode that the application has applied and saved progress in the -// last Ready results. -func (rn *RawNode) Advance(rd Ready) { - if !IsEmptyHardState(rd.HardState) { - rn.prevHardSt = rd.HardState - } - rn.raft.advance(rd) -} - -// Status returns the current status of the given group. This allocates, see -// BasicStatus and WithProgress for allocation-friendlier choices. -func (rn *RawNode) Status() Status { - status := getStatus(rn.raft) - return status -} - -// BasicStatus returns a BasicStatus. Notably this does not contain the -// Progress map; see WithProgress for an allocation-free way to inspect it. -func (rn *RawNode) BasicStatus() BasicStatus { - return getBasicStatus(rn.raft) -} - -// ProgressType indicates the type of replica a Progress corresponds to. -type ProgressType byte - -const ( - // ProgressTypePeer accompanies a Progress for a regular peer replica. - ProgressTypePeer ProgressType = iota - // ProgressTypeLearner accompanies a Progress for a learner replica. - ProgressTypeLearner -) - -// WithProgress is a helper to introspect the Progress for this node and its -// peers. -func (rn *RawNode) WithProgress(visitor func(id uint64, typ ProgressType, pr tracker.Progress)) { - rn.raft.prs.Visit(func(id uint64, pr *tracker.Progress) { - typ := ProgressTypePeer - if pr.IsLearner { - typ = ProgressTypeLearner - } - p := *pr - p.Inflights = nil - visitor(id, typ, p) - }) -} - -// ReportUnreachable reports the given node is not reachable for the last send. -func (rn *RawNode) ReportUnreachable(id uint64) { - _ = rn.raft.Step(pb.Message{Type: pb.MsgUnreachable, From: id}) -} - -// ReportSnapshot reports the status of the sent snapshot. -func (rn *RawNode) ReportSnapshot(id uint64, status SnapshotStatus) { - rej := status == SnapshotFailure - - _ = rn.raft.Step(pb.Message{Type: pb.MsgSnapStatus, From: id, Reject: rej}) -} - -// TransferLeader tries to transfer leadership to the given transferee. -func (rn *RawNode) TransferLeader(transferee uint64) { - _ = rn.raft.Step(pb.Message{Type: pb.MsgTransferLeader, From: transferee}) -} - -// ReadIndex requests a read state. The read state will be set in ready. -// Read State has a read index. Once the application advances further than the read -// index, any linearizable read requests issued before the read request can be -// processed safely. The read state will have the same rctx attached. -func (rn *RawNode) ReadIndex(rctx []byte) { - _ = rn.raft.Step(pb.Message{Type: pb.MsgReadIndex, Entries: []pb.Entry{{Data: rctx}}}) -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/read_only.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/read_only.go deleted file mode 100644 index 6987f1bd7d7e..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/read_only.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import pb "go.etcd.io/etcd/raft/raftpb" - -// ReadState provides state for read only query. -// It's caller's responsibility to call ReadIndex first before getting -// this state from ready, it's also caller's duty to differentiate if this -// state is what it requests through RequestCtx, eg. given a unique id as -// RequestCtx -type ReadState struct { - Index uint64 - RequestCtx []byte -} - -type readIndexStatus struct { - req pb.Message - index uint64 - // NB: this never records 'false', but it's more convenient to use this - // instead of a map[uint64]struct{} due to the API of quorum.VoteResult. If - // this becomes performance sensitive enough (doubtful), quorum.VoteResult - // can change to an API that is closer to that of CommittedIndex. - acks map[uint64]bool -} - -type readOnly struct { - option ReadOnlyOption - pendingReadIndex map[string]*readIndexStatus - readIndexQueue []string -} - -func newReadOnly(option ReadOnlyOption) *readOnly { - return &readOnly{ - option: option, - pendingReadIndex: make(map[string]*readIndexStatus), - } -} - -// addRequest adds a read only reuqest into readonly struct. -// `index` is the commit index of the raft state machine when it received -// the read only request. -// `m` is the original read only request message from the local or remote node. -func (ro *readOnly) addRequest(index uint64, m pb.Message) { - s := string(m.Entries[0].Data) - if _, ok := ro.pendingReadIndex[s]; ok { - return - } - ro.pendingReadIndex[s] = &readIndexStatus{index: index, req: m, acks: make(map[uint64]bool)} - ro.readIndexQueue = append(ro.readIndexQueue, s) -} - -// recvAck notifies the readonly struct that the raft state machine received -// an acknowledgment of the heartbeat that attached with the read only request -// context. -func (ro *readOnly) recvAck(id uint64, context []byte) map[uint64]bool { - rs, ok := ro.pendingReadIndex[string(context)] - if !ok { - return nil - } - - rs.acks[id] = true - return rs.acks -} - -// advance advances the read only request queue kept by the readonly struct. -// It dequeues the requests until it finds the read only request that has -// the same context as the given `m`. -func (ro *readOnly) advance(m pb.Message) []*readIndexStatus { - var ( - i int - found bool - ) - - ctx := string(m.Context) - rss := []*readIndexStatus{} - - for _, okctx := range ro.readIndexQueue { - i++ - rs, ok := ro.pendingReadIndex[okctx] - if !ok { - panic("cannot find corresponding read state from pending map") - } - rss = append(rss, rs) - if okctx == ctx { - found = true - break - } - } - - if found { - ro.readIndexQueue = ro.readIndexQueue[i:] - for _, rs := range rss { - delete(ro.pendingReadIndex, string(rs.req.Entries[0].Data)) - } - return rss - } - - return nil -} - -// lastPendingRequestCtx returns the context of the last pending read only -// request in readonly struct. -func (ro *readOnly) lastPendingRequestCtx() string { - if len(ro.readIndexQueue) == 0 { - return "" - } - return ro.readIndexQueue[len(ro.readIndexQueue)-1] -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/status.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/status.go deleted file mode 100644 index adc60486d9ce..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/status.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import ( - "fmt" - - pb "go.etcd.io/etcd/raft/raftpb" - "go.etcd.io/etcd/raft/tracker" -) - -// Status contains information about this Raft peer and its view of the system. -// The Progress is only populated on the leader. -type Status struct { - BasicStatus - Config tracker.Config - Progress map[uint64]tracker.Progress -} - -// BasicStatus contains basic information about the Raft peer. It does not allocate. -type BasicStatus struct { - ID uint64 - - pb.HardState - SoftState - - Applied uint64 - - LeadTransferee uint64 -} - -func getProgressCopy(r *raft) map[uint64]tracker.Progress { - m := make(map[uint64]tracker.Progress) - r.prs.Visit(func(id uint64, pr *tracker.Progress) { - var p tracker.Progress - p = *pr - p.Inflights = pr.Inflights.Clone() - pr = nil - - m[id] = p - }) - return m -} - -func getBasicStatus(r *raft) BasicStatus { - s := BasicStatus{ - ID: r.id, - LeadTransferee: r.leadTransferee, - } - s.HardState = r.hardState() - s.SoftState = *r.softState() - s.Applied = r.raftLog.applied - return s -} - -// getStatus gets a copy of the current raft status. -func getStatus(r *raft) Status { - var s Status - s.BasicStatus = getBasicStatus(r) - if s.RaftState == StateLeader { - s.Progress = getProgressCopy(r) - } - s.Config = r.prs.Config.Clone() - return s -} - -// MarshalJSON translates the raft status into JSON. -// TODO: try to simplify this by introducing ID type into raft -func (s Status) MarshalJSON() ([]byte, error) { - j := fmt.Sprintf(`{"id":"%x","term":%d,"vote":"%x","commit":%d,"lead":"%x","raftState":%q,"applied":%d,"progress":{`, - s.ID, s.Term, s.Vote, s.Commit, s.Lead, s.RaftState, s.Applied) - - if len(s.Progress) == 0 { - j += "}," - } else { - for k, v := range s.Progress { - subj := fmt.Sprintf(`"%x":{"match":%d,"next":%d,"state":%q},`, k, v.Match, v.Next, v.State) - j += subj - } - // remove the trailing "," - j = j[:len(j)-1] + "}," - } - - j += fmt.Sprintf(`"leadtransferee":"%x"}`, s.LeadTransferee) - return []byte(j), nil -} - -func (s Status) String() string { - b, err := s.MarshalJSON() - if err != nil { - raftLogger.Panicf("unexpected error: %v", err) - } - return string(b) -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/storage.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/storage.go deleted file mode 100644 index 6be574590e0c..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/storage.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import ( - "errors" - "sync" - - pb "go.etcd.io/etcd/raft/raftpb" -) - -// ErrCompacted is returned by Storage.Entries/Compact when a requested -// index is unavailable because it predates the last snapshot. -var ErrCompacted = errors.New("requested index is unavailable due to compaction") - -// ErrSnapOutOfDate is returned by Storage.CreateSnapshot when a requested -// index is older than the existing snapshot. -var ErrSnapOutOfDate = errors.New("requested index is older than the existing snapshot") - -// ErrUnavailable is returned by Storage interface when the requested log entries -// are unavailable. -var ErrUnavailable = errors.New("requested entry at index is unavailable") - -// ErrSnapshotTemporarilyUnavailable is returned by the Storage interface when the required -// snapshot is temporarily unavailable. -var ErrSnapshotTemporarilyUnavailable = errors.New("snapshot is temporarily unavailable") - -// Storage is an interface that may be implemented by the application -// to retrieve log entries from storage. -// -// If any Storage method returns an error, the raft instance will -// become inoperable and refuse to participate in elections; the -// application is responsible for cleanup and recovery in this case. -type Storage interface { - // TODO(tbg): split this into two interfaces, LogStorage and StateStorage. - - // InitialState returns the saved HardState and ConfState information. - InitialState() (pb.HardState, pb.ConfState, error) - // Entries returns a slice of log entries in the range [lo,hi). - // MaxSize limits the total size of the log entries returned, but - // Entries returns at least one entry if any. - Entries(lo, hi, maxSize uint64) ([]pb.Entry, error) - // Term returns the term of entry i, which must be in the range - // [FirstIndex()-1, LastIndex()]. The term of the entry before - // FirstIndex is retained for matching purposes even though the - // rest of that entry may not be available. - Term(i uint64) (uint64, error) - // LastIndex returns the index of the last entry in the log. - LastIndex() (uint64, error) - // FirstIndex returns the index of the first log entry that is - // possibly available via Entries (older entries have been incorporated - // into the latest Snapshot; if storage only contains the dummy entry the - // first log entry is not available). - FirstIndex() (uint64, error) - // Snapshot returns the most recent snapshot. - // If snapshot is temporarily unavailable, it should return ErrSnapshotTemporarilyUnavailable, - // so raft state machine could know that Storage needs some time to prepare - // snapshot and call Snapshot later. - Snapshot() (pb.Snapshot, error) -} - -// MemoryStorage implements the Storage interface backed by an -// in-memory array. -type MemoryStorage struct { - // Protects access to all fields. Most methods of MemoryStorage are - // run on the raft goroutine, but Append() is run on an application - // goroutine. - sync.Mutex - - hardState pb.HardState - snapshot pb.Snapshot - // ents[i] has raft log position i+snapshot.Metadata.Index - ents []pb.Entry -} - -// NewMemoryStorage creates an empty MemoryStorage. -func NewMemoryStorage() *MemoryStorage { - return &MemoryStorage{ - // When starting from scratch populate the list with a dummy entry at term zero. - ents: make([]pb.Entry, 1), - } -} - -// InitialState implements the Storage interface. -func (ms *MemoryStorage) InitialState() (pb.HardState, pb.ConfState, error) { - return ms.hardState, ms.snapshot.Metadata.ConfState, nil -} - -// SetHardState saves the current HardState. -func (ms *MemoryStorage) SetHardState(st pb.HardState) error { - ms.Lock() - defer ms.Unlock() - ms.hardState = st - return nil -} - -// Entries implements the Storage interface. -func (ms *MemoryStorage) Entries(lo, hi, maxSize uint64) ([]pb.Entry, error) { - ms.Lock() - defer ms.Unlock() - offset := ms.ents[0].Index - if lo <= offset { - return nil, ErrCompacted - } - if hi > ms.lastIndex()+1 { - raftLogger.Panicf("entries' hi(%d) is out of bound lastindex(%d)", hi, ms.lastIndex()) - } - // only contains dummy entries. - if len(ms.ents) == 1 { - return nil, ErrUnavailable - } - - ents := ms.ents[lo-offset : hi-offset] - return limitSize(ents, maxSize), nil -} - -// Term implements the Storage interface. -func (ms *MemoryStorage) Term(i uint64) (uint64, error) { - ms.Lock() - defer ms.Unlock() - offset := ms.ents[0].Index - if i < offset { - return 0, ErrCompacted - } - if int(i-offset) >= len(ms.ents) { - return 0, ErrUnavailable - } - return ms.ents[i-offset].Term, nil -} - -// LastIndex implements the Storage interface. -func (ms *MemoryStorage) LastIndex() (uint64, error) { - ms.Lock() - defer ms.Unlock() - return ms.lastIndex(), nil -} - -func (ms *MemoryStorage) lastIndex() uint64 { - return ms.ents[0].Index + uint64(len(ms.ents)) - 1 -} - -// FirstIndex implements the Storage interface. -func (ms *MemoryStorage) FirstIndex() (uint64, error) { - ms.Lock() - defer ms.Unlock() - return ms.firstIndex(), nil -} - -func (ms *MemoryStorage) firstIndex() uint64 { - return ms.ents[0].Index + 1 -} - -// Snapshot implements the Storage interface. -func (ms *MemoryStorage) Snapshot() (pb.Snapshot, error) { - ms.Lock() - defer ms.Unlock() - return ms.snapshot, nil -} - -// ApplySnapshot overwrites the contents of this Storage object with -// those of the given snapshot. -func (ms *MemoryStorage) ApplySnapshot(snap pb.Snapshot) error { - ms.Lock() - defer ms.Unlock() - - //handle check for old snapshot being applied - msIndex := ms.snapshot.Metadata.Index - snapIndex := snap.Metadata.Index - if msIndex >= snapIndex { - return ErrSnapOutOfDate - } - - ms.snapshot = snap - ms.ents = []pb.Entry{{Term: snap.Metadata.Term, Index: snap.Metadata.Index}} - return nil -} - -// CreateSnapshot makes a snapshot which can be retrieved with Snapshot() and -// can be used to reconstruct the state at that point. -// If any configuration changes have been made since the last compaction, -// the result of the last ApplyConfChange must be passed in. -func (ms *MemoryStorage) CreateSnapshot(i uint64, cs *pb.ConfState, data []byte) (pb.Snapshot, error) { - ms.Lock() - defer ms.Unlock() - if i <= ms.snapshot.Metadata.Index { - return pb.Snapshot{}, ErrSnapOutOfDate - } - - offset := ms.ents[0].Index - if i > ms.lastIndex() { - raftLogger.Panicf("snapshot %d is out of bound lastindex(%d)", i, ms.lastIndex()) - } - - ms.snapshot.Metadata.Index = i - ms.snapshot.Metadata.Term = ms.ents[i-offset].Term - if cs != nil { - ms.snapshot.Metadata.ConfState = *cs - } - ms.snapshot.Data = data - return ms.snapshot, nil -} - -// Compact discards all log entries prior to compactIndex. -// It is the application's responsibility to not attempt to compact an index -// greater than raftLog.applied. -func (ms *MemoryStorage) Compact(compactIndex uint64) error { - ms.Lock() - defer ms.Unlock() - offset := ms.ents[0].Index - if compactIndex <= offset { - return ErrCompacted - } - if compactIndex > ms.lastIndex() { - raftLogger.Panicf("compact %d is out of bound lastindex(%d)", compactIndex, ms.lastIndex()) - } - - i := compactIndex - offset - ents := make([]pb.Entry, 1, 1+uint64(len(ms.ents))-i) - ents[0].Index = ms.ents[i].Index - ents[0].Term = ms.ents[i].Term - ents = append(ents, ms.ents[i+1:]...) - ms.ents = ents - return nil -} - -// Append the new entries to storage. -// TODO (xiangli): ensure the entries are continuous and -// entries[0].Index > ms.entries[0].Index -func (ms *MemoryStorage) Append(entries []pb.Entry) error { - if len(entries) == 0 { - return nil - } - - ms.Lock() - defer ms.Unlock() - - first := ms.firstIndex() - last := entries[0].Index + uint64(len(entries)) - 1 - - // shortcut if there is no new entry. - if last < first { - return nil - } - // truncate compacted entries - if first > entries[0].Index { - entries = entries[first-entries[0].Index:] - } - - offset := entries[0].Index - ms.ents[0].Index - switch { - case uint64(len(ms.ents)) > offset: - ms.ents = append([]pb.Entry{}, ms.ents[:offset]...) - ms.ents = append(ms.ents, entries...) - case uint64(len(ms.ents)) == offset: - ms.ents = append(ms.ents, entries...) - default: - raftLogger.Panicf("missing log entry [last: %d, append at: %d]", - ms.lastIndex(), entries[0].Index) - } - return nil -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/inflights.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/inflights.go deleted file mode 100644 index 1a056341ab51..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/inflights.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tracker - -// Inflights limits the number of MsgApp (represented by the largest index -// contained within) sent to followers but not yet acknowledged by them. Callers -// use Full() to check whether more messages can be sent, call Add() whenever -// they are sending a new append, and release "quota" via FreeLE() whenever an -// ack is received. -type Inflights struct { - // the starting index in the buffer - start int - // number of inflights in the buffer - count int - - // the size of the buffer - size int - - // buffer contains the index of the last entry - // inside one message. - buffer []uint64 -} - -// NewInflights sets up an Inflights that allows up to 'size' inflight messages. -func NewInflights(size int) *Inflights { - return &Inflights{ - size: size, - } -} - -// Clone returns an *Inflights that is identical to but shares no memory with -// the receiver. -func (in *Inflights) Clone() *Inflights { - ins := *in - ins.buffer = append([]uint64(nil), in.buffer...) - return &ins -} - -// Add notifies the Inflights that a new message with the given index is being -// dispatched. Full() must be called prior to Add() to verify that there is room -// for one more message, and consecutive calls to add Add() must provide a -// monotonic sequence of indexes. -func (in *Inflights) Add(inflight uint64) { - if in.Full() { - panic("cannot add into a Full inflights") - } - next := in.start + in.count - size := in.size - if next >= size { - next -= size - } - if next >= len(in.buffer) { - in.grow() - } - in.buffer[next] = inflight - in.count++ -} - -// grow the inflight buffer by doubling up to inflights.size. We grow on demand -// instead of preallocating to inflights.size to handle systems which have -// thousands of Raft groups per process. -func (in *Inflights) grow() { - newSize := len(in.buffer) * 2 - if newSize == 0 { - newSize = 1 - } else if newSize > in.size { - newSize = in.size - } - newBuffer := make([]uint64, newSize) - copy(newBuffer, in.buffer) - in.buffer = newBuffer -} - -// FreeLE frees the inflights smaller or equal to the given `to` flight. -func (in *Inflights) FreeLE(to uint64) { - if in.count == 0 || to < in.buffer[in.start] { - // out of the left side of the window - return - } - - idx := in.start - var i int - for i = 0; i < in.count; i++ { - if to < in.buffer[idx] { // found the first large inflight - break - } - - // increase index and maybe rotate - size := in.size - if idx++; idx >= size { - idx -= size - } - } - // free i inflights and set new start index - in.count -= i - in.start = idx - if in.count == 0 { - // inflights is empty, reset the start index so that we don't grow the - // buffer unnecessarily. - in.start = 0 - } -} - -// FreeFirstOne releases the first inflight. This is a no-op if nothing is -// inflight. -func (in *Inflights) FreeFirstOne() { in.FreeLE(in.buffer[in.start]) } - -// Full returns true if no more messages can be sent at the moment. -func (in *Inflights) Full() bool { - return in.count == in.size -} - -// Count returns the number of inflight messages. -func (in *Inflights) Count() int { return in.count } - -// reset frees all inflights. -func (in *Inflights) reset() { - in.count = 0 - in.start = 0 -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/progress.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/progress.go deleted file mode 100644 index 62c81f45af81..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/progress.go +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tracker - -import ( - "fmt" - "sort" - "strings" -) - -// Progress represents a follower’s progress in the view of the leader. Leader -// maintains progresses of all followers, and sends entries to the follower -// based on its progress. -// -// NB(tbg): Progress is basically a state machine whose transitions are mostly -// strewn around `*raft.raft`. Additionally, some fields are only used when in a -// certain State. All of this isn't ideal. -type Progress struct { - Match, Next uint64 - // State defines how the leader should interact with the follower. - // - // When in StateProbe, leader sends at most one replication message - // per heartbeat interval. It also probes actual progress of the follower. - // - // When in StateReplicate, leader optimistically increases next - // to the latest entry sent after sending replication message. This is - // an optimized state for fast replicating log entries to the follower. - // - // When in StateSnapshot, leader should have sent out snapshot - // before and stops sending any replication message. - State StateType - - // PendingSnapshot is used in StateSnapshot. - // If there is a pending snapshot, the pendingSnapshot will be set to the - // index of the snapshot. If pendingSnapshot is set, the replication process of - // this Progress will be paused. raft will not resend snapshot until the pending one - // is reported to be failed. - PendingSnapshot uint64 - - // RecentActive is true if the progress is recently active. Receiving any messages - // from the corresponding follower indicates the progress is active. - // RecentActive can be reset to false after an election timeout. - // - // TODO(tbg): the leader should always have this set to true. - RecentActive bool - - // ProbeSent is used while this follower is in StateProbe. When ProbeSent is - // true, raft should pause sending replication message to this peer until - // ProbeSent is reset. See ProbeAcked() and IsPaused(). - ProbeSent bool - - // Inflights is a sliding window for the inflight messages. - // Each inflight message contains one or more log entries. - // The max number of entries per message is defined in raft config as MaxSizePerMsg. - // Thus inflight effectively limits both the number of inflight messages - // and the bandwidth each Progress can use. - // When inflights is Full, no more message should be sent. - // When a leader sends out a message, the index of the last - // entry should be added to inflights. The index MUST be added - // into inflights in order. - // When a leader receives a reply, the previous inflights should - // be freed by calling inflights.FreeLE with the index of the last - // received entry. - Inflights *Inflights - - // IsLearner is true if this progress is tracked for a learner. - IsLearner bool -} - -// ResetState moves the Progress into the specified State, resetting ProbeSent, -// PendingSnapshot, and Inflights. -func (pr *Progress) ResetState(state StateType) { - pr.ProbeSent = false - pr.PendingSnapshot = 0 - pr.State = state - pr.Inflights.reset() -} - -func max(a, b uint64) uint64 { - if a > b { - return a - } - return b -} - -func min(a, b uint64) uint64 { - if a > b { - return b - } - return a -} - -// ProbeAcked is called when this peer has accepted an append. It resets -// ProbeSent to signal that additional append messages should be sent without -// further delay. -func (pr *Progress) ProbeAcked() { - pr.ProbeSent = false -} - -// BecomeProbe transitions into StateProbe. Next is reset to Match+1 or, -// optionally and if larger, the index of the pending snapshot. -func (pr *Progress) BecomeProbe() { - // If the original state is StateSnapshot, progress knows that - // the pending snapshot has been sent to this peer successfully, then - // probes from pendingSnapshot + 1. - if pr.State == StateSnapshot { - pendingSnapshot := pr.PendingSnapshot - pr.ResetState(StateProbe) - pr.Next = max(pr.Match+1, pendingSnapshot+1) - } else { - pr.ResetState(StateProbe) - pr.Next = pr.Match + 1 - } -} - -// BecomeReplicate transitions into StateReplicate, resetting Next to Match+1. -func (pr *Progress) BecomeReplicate() { - pr.ResetState(StateReplicate) - pr.Next = pr.Match + 1 -} - -// BecomeSnapshot moves the Progress to StateSnapshot with the specified pending -// snapshot index. -func (pr *Progress) BecomeSnapshot(snapshoti uint64) { - pr.ResetState(StateSnapshot) - pr.PendingSnapshot = snapshoti -} - -// MaybeUpdate is called when an MsgAppResp arrives from the follower, with the -// index acked by it. The method returns false if the given n index comes from -// an outdated message. Otherwise it updates the progress and returns true. -func (pr *Progress) MaybeUpdate(n uint64) bool { - var updated bool - if pr.Match < n { - pr.Match = n - updated = true - pr.ProbeAcked() - } - if pr.Next < n+1 { - pr.Next = n + 1 - } - return updated -} - -// OptimisticUpdate signals that appends all the way up to and including index n -// are in-flight. As a result, Next is increased to n+1. -func (pr *Progress) OptimisticUpdate(n uint64) { pr.Next = n + 1 } - -// MaybeDecrTo adjusts the Progress to the receipt of a MsgApp rejection. The -// arguments are the index the follower rejected to append to its log, and its -// last index. -// -// Rejections can happen spuriously as messages are sent out of order or -// duplicated. In such cases, the rejection pertains to an index that the -// Progress already knows were previously acknowledged, and false is returned -// without changing the Progress. -// -// If the rejection is genuine, Next is lowered sensibly, and the Progress is -// cleared for sending log entries. -func (pr *Progress) MaybeDecrTo(rejected, last uint64) bool { - if pr.State == StateReplicate { - // The rejection must be stale if the progress has matched and "rejected" - // is smaller than "match". - if rejected <= pr.Match { - return false - } - // Directly decrease next to match + 1. - // - // TODO(tbg): why not use last if it's larger? - pr.Next = pr.Match + 1 - return true - } - - // The rejection must be stale if "rejected" does not match next - 1. This - // is because non-replicating followers are probed one entry at a time. - if pr.Next-1 != rejected { - return false - } - - if pr.Next = min(rejected, last+1); pr.Next < 1 { - pr.Next = 1 - } - pr.ProbeSent = false - return true -} - -// IsPaused returns whether sending log entries to this node has been throttled. -// This is done when a node has rejected recent MsgApps, is currently waiting -// for a snapshot, or has reached the MaxInflightMsgs limit. In normal -// operation, this is false. A throttled node will be contacted less frequently -// until it has reached a state in which it's able to accept a steady stream of -// log entries again. -func (pr *Progress) IsPaused() bool { - switch pr.State { - case StateProbe: - return pr.ProbeSent - case StateReplicate: - return pr.Inflights.Full() - case StateSnapshot: - return true - default: - panic("unexpected state") - } -} - -func (pr *Progress) String() string { - var buf strings.Builder - fmt.Fprintf(&buf, "%s match=%d next=%d", pr.State, pr.Match, pr.Next) - if pr.IsLearner { - fmt.Fprint(&buf, " learner") - } - if pr.IsPaused() { - fmt.Fprint(&buf, " paused") - } - if pr.PendingSnapshot > 0 { - fmt.Fprintf(&buf, " pendingSnap=%d", pr.PendingSnapshot) - } - if !pr.RecentActive { - fmt.Fprintf(&buf, " inactive") - } - if n := pr.Inflights.Count(); n > 0 { - fmt.Fprintf(&buf, " inflight=%d", n) - if pr.Inflights.Full() { - fmt.Fprint(&buf, "[full]") - } - } - return buf.String() -} - -// ProgressMap is a map of *Progress. -type ProgressMap map[uint64]*Progress - -// String prints the ProgressMap in sorted key order, one Progress per line. -func (m ProgressMap) String() string { - ids := make([]uint64, 0, len(m)) - for k := range m { - ids = append(ids, k) - } - sort.Slice(ids, func(i, j int) bool { - return ids[i] < ids[j] - }) - var buf strings.Builder - for _, id := range ids { - fmt.Fprintf(&buf, "%d: %s\n", id, m[id]) - } - return buf.String() -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/state.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/state.go deleted file mode 100644 index 285b4b8f5802..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/state.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tracker - -// StateType is the state of a tracked follower. -type StateType uint64 - -const ( - // StateProbe indicates a follower whose last index isn't known. Such a - // follower is "probed" (i.e. an append sent periodically) to narrow down - // its last index. In the ideal (and common) case, only one round of probing - // is necessary as the follower will react with a hint. Followers that are - // probed over extended periods of time are often offline. - StateProbe StateType = iota - // StateReplicate is the state steady in which a follower eagerly receives - // log entries to append to its log. - StateReplicate - // StateSnapshot indicates a follower that needs log entries not available - // from the leader's Raft log. Such a follower needs a full snapshot to - // return to StateReplicate. - StateSnapshot -) - -var prstmap = [...]string{ - "StateProbe", - "StateReplicate", - "StateSnapshot", -} - -func (st StateType) String() string { return prstmap[uint64(st)] } diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/tracker.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/tracker.go deleted file mode 100644 index a4581143d1e9..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/tracker/tracker.go +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tracker - -import ( - "fmt" - "sort" - "strings" - - "go.etcd.io/etcd/raft/quorum" - pb "go.etcd.io/etcd/raft/raftpb" -) - -// Config reflects the configuration tracked in a ProgressTracker. -type Config struct { - Voters quorum.JointConfig - // AutoLeave is true if the configuration is joint and a transition to the - // incoming configuration should be carried out automatically by Raft when - // this is possible. If false, the configuration will be joint until the - // application initiates the transition manually. - AutoLeave bool - // Learners is a set of IDs corresponding to the learners active in the - // current configuration. - // - // Invariant: Learners and Voters does not intersect, i.e. if a peer is in - // either half of the joint config, it can't be a learner; if it is a - // learner it can't be in either half of the joint config. This invariant - // simplifies the implementation since it allows peers to have clarity about - // its current role without taking into account joint consensus. - Learners map[uint64]struct{} - // When we turn a voter into a learner during a joint consensus transition, - // we cannot add the learner directly when entering the joint state. This is - // because this would violate the invariant that the intersection of - // voters and learners is empty. For example, assume a Voter is removed and - // immediately re-added as a learner (or in other words, it is demoted): - // - // Initially, the configuration will be - // - // voters: {1 2 3} - // learners: {} - // - // and we want to demote 3. Entering the joint configuration, we naively get - // - // voters: {1 2} & {1 2 3} - // learners: {3} - // - // but this violates the invariant (3 is both voter and learner). Instead, - // we get - // - // voters: {1 2} & {1 2 3} - // learners: {} - // next_learners: {3} - // - // Where 3 is now still purely a voter, but we are remembering the intention - // to make it a learner upon transitioning into the final configuration: - // - // voters: {1 2} - // learners: {3} - // next_learners: {} - // - // Note that next_learners is not used while adding a learner that is not - // also a voter in the joint config. In this case, the learner is added - // right away when entering the joint configuration, so that it is caught up - // as soon as possible. - LearnersNext map[uint64]struct{} -} - -func (c Config) String() string { - var buf strings.Builder - fmt.Fprintf(&buf, "voters=%s", c.Voters) - if c.Learners != nil { - fmt.Fprintf(&buf, " learners=%s", quorum.MajorityConfig(c.Learners).String()) - } - if c.LearnersNext != nil { - fmt.Fprintf(&buf, " learners_next=%s", quorum.MajorityConfig(c.LearnersNext).String()) - } - if c.AutoLeave { - fmt.Fprintf(&buf, " autoleave") - } - return buf.String() -} - -// Clone returns a copy of the Config that shares no memory with the original. -func (c *Config) Clone() Config { - clone := func(m map[uint64]struct{}) map[uint64]struct{} { - if m == nil { - return nil - } - mm := make(map[uint64]struct{}, len(m)) - for k := range m { - mm[k] = struct{}{} - } - return mm - } - return Config{ - Voters: quorum.JointConfig{clone(c.Voters[0]), clone(c.Voters[1])}, - Learners: clone(c.Learners), - LearnersNext: clone(c.LearnersNext), - } -} - -// ProgressTracker tracks the currently active configuration and the information -// known about the nodes and learners in it. In particular, it tracks the match -// index for each peer which in turn allows reasoning about the committed index. -type ProgressTracker struct { - Config - - Progress ProgressMap - - Votes map[uint64]bool - - MaxInflight int -} - -// MakeProgressTracker initializes a ProgressTracker. -func MakeProgressTracker(maxInflight int) ProgressTracker { - p := ProgressTracker{ - MaxInflight: maxInflight, - Config: Config{ - Voters: quorum.JointConfig{ - quorum.MajorityConfig{}, - nil, // only populated when used - }, - Learners: nil, // only populated when used - LearnersNext: nil, // only populated when used - }, - Votes: map[uint64]bool{}, - Progress: map[uint64]*Progress{}, - } - return p -} - -// ConfState returns a ConfState representing the active configuration. -func (p *ProgressTracker) ConfState() pb.ConfState { - return pb.ConfState{ - Voters: p.Voters[0].Slice(), - VotersOutgoing: p.Voters[1].Slice(), - Learners: quorum.MajorityConfig(p.Learners).Slice(), - LearnersNext: quorum.MajorityConfig(p.LearnersNext).Slice(), - AutoLeave: p.AutoLeave, - } -} - -// IsSingleton returns true if (and only if) there is only one voting member -// (i.e. the leader) in the current configuration. -func (p *ProgressTracker) IsSingleton() bool { - return len(p.Voters[0]) == 1 && len(p.Voters[1]) == 0 -} - -type matchAckIndexer map[uint64]*Progress - -var _ quorum.AckedIndexer = matchAckIndexer(nil) - -// AckedIndex implements IndexLookuper. -func (l matchAckIndexer) AckedIndex(id uint64) (quorum.Index, bool) { - pr, ok := l[id] - if !ok { - return 0, false - } - return quorum.Index(pr.Match), true -} - -// Committed returns the largest log index known to be committed based on what -// the voting members of the group have acknowledged. -func (p *ProgressTracker) Committed() uint64 { - return uint64(p.Voters.CommittedIndex(matchAckIndexer(p.Progress))) -} - -func insertionSort(sl []uint64) { - a, b := 0, len(sl) - for i := a + 1; i < b; i++ { - for j := i; j > a && sl[j] < sl[j-1]; j-- { - sl[j], sl[j-1] = sl[j-1], sl[j] - } - } -} - -// Visit invokes the supplied closure for all tracked progresses in stable order. -func (p *ProgressTracker) Visit(f func(id uint64, pr *Progress)) { - n := len(p.Progress) - // We need to sort the IDs and don't want to allocate since this is hot code. - // The optimization here mirrors that in `(MajorityConfig).CommittedIndex`, - // see there for details. - var sl [7]uint64 - ids := sl[:] - if len(sl) >= n { - ids = sl[:n] - } else { - ids = make([]uint64, n) - } - for id := range p.Progress { - n-- - ids[n] = id - } - insertionSort(ids) - for _, id := range ids { - f(id, p.Progress[id]) - } -} - -// QuorumActive returns true if the quorum is active from the view of the local -// raft state machine. Otherwise, it returns false. -func (p *ProgressTracker) QuorumActive() bool { - votes := map[uint64]bool{} - p.Visit(func(id uint64, pr *Progress) { - if pr.IsLearner { - return - } - votes[id] = pr.RecentActive - }) - - return p.Voters.VoteResult(votes) == quorum.VoteWon -} - -// VoterNodes returns a sorted slice of voters. -func (p *ProgressTracker) VoterNodes() []uint64 { - m := p.Voters.IDs() - nodes := make([]uint64, 0, len(m)) - for id := range m { - nodes = append(nodes, id) - } - sort.Slice(nodes, func(i, j int) bool { return nodes[i] < nodes[j] }) - return nodes -} - -// LearnerNodes returns a sorted slice of learners. -func (p *ProgressTracker) LearnerNodes() []uint64 { - if len(p.Learners) == 0 { - return nil - } - nodes := make([]uint64, 0, len(p.Learners)) - for id := range p.Learners { - nodes = append(nodes, id) - } - sort.Slice(nodes, func(i, j int) bool { return nodes[i] < nodes[j] }) - return nodes -} - -// ResetVotes prepares for a new round of vote counting via recordVote. -func (p *ProgressTracker) ResetVotes() { - p.Votes = map[uint64]bool{} -} - -// RecordVote records that the node with the given id voted for this Raft -// instance if v == true (and declined it otherwise). -func (p *ProgressTracker) RecordVote(id uint64, v bool) { - _, ok := p.Votes[id] - if !ok { - p.Votes[id] = v - } -} - -// TallyVotes returns the number of granted and rejected Votes, and whether the -// election outcome is known. -func (p *ProgressTracker) TallyVotes() (granted int, rejected int, _ quorum.VoteResult) { - // Make sure to populate granted/rejected correctly even if the Votes slice - // contains members no longer part of the configuration. This doesn't really - // matter in the way the numbers are used (they're informational), but might - // as well get it right. - for id, pr := range p.Progress { - if pr.IsLearner { - continue - } - v, voted := p.Votes[id] - if !voted { - continue - } - if v { - granted++ - } else { - rejected++ - } - } - result := p.Voters.VoteResult(p.Votes) - return granted, rejected, result -} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/util.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/util.go deleted file mode 100644 index 785cf735d5db..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/raft/util.go +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package raft - -import ( - "bytes" - "fmt" - "strings" - - pb "go.etcd.io/etcd/raft/raftpb" -) - -func (st StateType) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf("%q", st.String())), nil -} - -func min(a, b uint64) uint64 { - if a > b { - return b - } - return a -} - -func max(a, b uint64) uint64 { - if a > b { - return a - } - return b -} - -func IsLocalMsg(msgt pb.MessageType) bool { - return msgt == pb.MsgHup || msgt == pb.MsgBeat || msgt == pb.MsgUnreachable || - msgt == pb.MsgSnapStatus || msgt == pb.MsgCheckQuorum -} - -func IsResponseMsg(msgt pb.MessageType) bool { - return msgt == pb.MsgAppResp || msgt == pb.MsgVoteResp || msgt == pb.MsgHeartbeatResp || msgt == pb.MsgUnreachable || msgt == pb.MsgPreVoteResp -} - -// voteResponseType maps vote and prevote message types to their corresponding responses. -func voteRespMsgType(msgt pb.MessageType) pb.MessageType { - switch msgt { - case pb.MsgVote: - return pb.MsgVoteResp - case pb.MsgPreVote: - return pb.MsgPreVoteResp - default: - panic(fmt.Sprintf("not a vote message: %s", msgt)) - } -} - -func DescribeHardState(hs pb.HardState) string { - var buf strings.Builder - fmt.Fprintf(&buf, "Term:%d", hs.Term) - if hs.Vote != 0 { - fmt.Fprintf(&buf, " Vote:%d", hs.Vote) - } - fmt.Fprintf(&buf, " Commit:%d", hs.Commit) - return buf.String() -} - -func DescribeSoftState(ss SoftState) string { - return fmt.Sprintf("Lead:%d State:%s", ss.Lead, ss.RaftState) -} - -func DescribeConfState(state pb.ConfState) string { - return fmt.Sprintf( - "Voters:%v VotersOutgoing:%v Learners:%v LearnersNext:%v AutoLeave:%v", - state.Voters, state.VotersOutgoing, state.Learners, state.LearnersNext, state.AutoLeave, - ) -} - -func DescribeSnapshot(snap pb.Snapshot) string { - m := snap.Metadata - return fmt.Sprintf("Index:%d Term:%d ConfState:%s", m.Index, m.Term, DescribeConfState(m.ConfState)) -} - -func DescribeReady(rd Ready, f EntryFormatter) string { - var buf strings.Builder - if rd.SoftState != nil { - fmt.Fprint(&buf, DescribeSoftState(*rd.SoftState)) - buf.WriteByte('\n') - } - if !IsEmptyHardState(rd.HardState) { - fmt.Fprintf(&buf, "HardState %s", DescribeHardState(rd.HardState)) - buf.WriteByte('\n') - } - if len(rd.ReadStates) > 0 { - fmt.Fprintf(&buf, "ReadStates %v\n", rd.ReadStates) - } - if len(rd.Entries) > 0 { - buf.WriteString("Entries:\n") - fmt.Fprint(&buf, DescribeEntries(rd.Entries, f)) - } - if !IsEmptySnap(rd.Snapshot) { - fmt.Fprintf(&buf, "Snapshot %s\n", DescribeSnapshot(rd.Snapshot)) - } - if len(rd.CommittedEntries) > 0 { - buf.WriteString("CommittedEntries:\n") - fmt.Fprint(&buf, DescribeEntries(rd.CommittedEntries, f)) - } - if len(rd.Messages) > 0 { - buf.WriteString("Messages:\n") - for _, msg := range rd.Messages { - fmt.Fprint(&buf, DescribeMessage(msg, f)) - buf.WriteByte('\n') - } - } - if buf.Len() > 0 { - return fmt.Sprintf("Ready MustSync=%t:\n%s", rd.MustSync, buf.String()) - } - return "" -} - -// EntryFormatter can be implemented by the application to provide human-readable formatting -// of entry data. Nil is a valid EntryFormatter and will use a default format. -type EntryFormatter func([]byte) string - -// DescribeMessage returns a concise human-readable description of a -// Message for debugging. -func DescribeMessage(m pb.Message, f EntryFormatter) string { - var buf bytes.Buffer - fmt.Fprintf(&buf, "%x->%x %v Term:%d Log:%d/%d", m.From, m.To, m.Type, m.Term, m.LogTerm, m.Index) - if m.Reject { - fmt.Fprintf(&buf, " Rejected (Hint: %d)", m.RejectHint) - } - if m.Commit != 0 { - fmt.Fprintf(&buf, " Commit:%d", m.Commit) - } - if len(m.Entries) > 0 { - fmt.Fprintf(&buf, " Entries:[") - for i, e := range m.Entries { - if i != 0 { - buf.WriteString(", ") - } - buf.WriteString(DescribeEntry(e, f)) - } - fmt.Fprintf(&buf, "]") - } - if !IsEmptySnap(m.Snapshot) { - fmt.Fprintf(&buf, " Snapshot: %s", DescribeSnapshot(m.Snapshot)) - } - return buf.String() -} - -// PayloadSize is the size of the payload of this Entry. Notably, it does not -// depend on its Index or Term. -func PayloadSize(e pb.Entry) int { - return len(e.Data) -} - -// DescribeEntry returns a concise human-readable description of an -// Entry for debugging. -func DescribeEntry(e pb.Entry, f EntryFormatter) string { - if f == nil { - f = func(data []byte) string { return fmt.Sprintf("%q", data) } - } - - formatConfChange := func(cc pb.ConfChangeI) string { - // TODO(tbg): give the EntryFormatter a type argument so that it gets - // a chance to expose the Context. - return pb.ConfChangesToString(cc.AsV2().Changes) - } - - var formatted string - switch e.Type { - case pb.EntryNormal: - formatted = f(e.Data) - case pb.EntryConfChange: - var cc pb.ConfChange - if err := cc.Unmarshal(e.Data); err != nil { - formatted = err.Error() - } else { - formatted = formatConfChange(cc) - } - case pb.EntryConfChangeV2: - var cc pb.ConfChangeV2 - if err := cc.Unmarshal(e.Data); err != nil { - formatted = err.Error() - } else { - formatted = formatConfChange(cc) - } - } - if formatted != "" { - formatted = " " + formatted - } - return fmt.Sprintf("%d/%d %s%s", e.Term, e.Index, e.Type, formatted) -} - -// DescribeEntries calls DescribeEntry for each Entry, adding a newline to -// each. -func DescribeEntries(ents []pb.Entry, f EntryFormatter) string { - var buf bytes.Buffer - for _, e := range ents { - _, _ = buf.WriteString(DescribeEntry(e, f) + "\n") - } - return buf.String() -} - -func limitSize(ents []pb.Entry, maxSize uint64) []pb.Entry { - if len(ents) == 0 { - return ents - } - size := ents[0].Size() - var limit int - for limit = 1; limit < len(ents); limit++ { - size += ents[limit].Size() - if uint64(size) > maxSize { - break - } - } - return ents[:limit] -} - -func assertConfStatesEquivalent(l Logger, cs1, cs2 pb.ConfState) { - err := cs1.Equivalent(cs2) - if err == nil { - return - } - l.Panic(err) -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/.gitignore b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/.gitignore new file mode 100644 index 000000000000..21ab270fe08b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/.gitignore @@ -0,0 +1,13 @@ +.DS_Store +Thumbs.db + +.tools/ +.idea/ +.vscode/ +*.iml +*.so +coverage.* +example + +instrumentation/google.golang.org/grpc/otelgrpc/example/server/server +instrumentation/google.golang.org/grpc/otelgrpc/example/client/client \ No newline at end of file diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/.golangci.yml b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/.golangci.yml new file mode 100644 index 000000000000..cef170f7c7f7 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/.golangci.yml @@ -0,0 +1,32 @@ +# See https://github.com/golangci/golangci-lint#config-file +run: + issues-exit-code: 1 #Default + tests: true #Default + +linters: + enable: + - misspell + - goimports + - golint + - gofmt + +issues: + exclude-rules: + # helpers in tests often (rightfully) pass a *testing.T as their first argument + - path: _test\.go + text: "context.Context should be the first parameter of a function" + linters: + - golint + # Yes, they are, but it's okay in a test + - path: _test\.go + text: "exported func.*returns unexported type.*which can be annoying to use" + linters: + - golint + +linters-settings: + misspell: + locale: US + #ignore-words: + # - someword + goimports: + local-prefixes: go.opentelemetry.io diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CHANGELOG.md b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CHANGELOG.md new file mode 100644 index 000000000000..1fcf34b2abb6 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CHANGELOG.md @@ -0,0 +1,319 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.20.0] - 2021-04-23 + +### Changed + +- The `go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo` instrumentation now accepts a `WithCommandAttributeDisabled`, + so the caller can specify whether to opt-out of tracing the mongo command. (#712) +- Upgrade to v0.20.0 of `go.opentelemetry.io/otel`. (#758) +- The B3 and Jaeger propagators now store their debug or deferred state in the context.Context instead of the SpanContext. (#758) + +## [0.19.0] - 2021-03-19 + +### Changed + +- Upgrade to v0.19.0 of `go.opentelemetry.io/otel`. + +## [0.18.0] - 2021-03-04 + +### Fixed + +- `otelmemcache` no longer sets span status to OK instead of leaving it unset. (#477) +- Fix goroutine leak in gRPC `StreamClientInterceptor`. (#581) + +### Removed + +- Remove service name from `otelmemcache` configuration and span attributes. (#477) + +## [0.17.0] - 2021-02-15 + +### Added + +- Add `ot-tracer` propagator (#562) + +### Changed + +- Rename project default branch from `master` to `main`. + +### Fixed + +- Added failure message for AWS ECS resource detector for better debugging (#568) +- Goroutine leak in gRPC StreamClientInterceptor while streamer returns an error. (#581) + +## [0.16.0] - 2021-01-13 + +### Fixed + +- Fix module path for AWS ECS resource detector (#517) + +## [0.15.1] - 2020-12-14 + +### Added + +- Add registry link check to `Makefile` and pre-release script. (#446) +- A new AWS X-Ray ID Generator (#459) +- Migrate CircleCI jobs to GitHub Actions (#476) +- Add CodeQL GitHub Action (#506) +- Add gosec workflow to GitHub Actions (#507) + +### Fixed + +- Fixes the body replacement in otelhttp to not to mutate a nil body. (#484) + +## [0.15.0] - 2020-12-11 + +### Added + +- A new Amazon EKS resource detector. (#465) +- A new `gcp.CloudRun` detector for detecting resource from a Cloud Run instance. (#455) + +## [0.14.0] - 2020-11-20 + +### Added + +- `otelhttp.{Get,Head,Post,PostForm}` convenience wrappers for their `http` counterparts. (#390) +- The AWS detector now adds the cloud zone, host image ID, host type, and host name to the returned `Resource`. (#410) +- Add Amazon ECS Resource Detector for AWS X-Ray. (#466) +- Add propagator for AWS X-Ray (#462) + +### Changed + +- Add semantic version to `Tracer` / `Meter` created by instrumentation packages `otelsaram`, `otelrestful`, `otelmongo`, `otelhttp` and `otelhttptrace`. (#412) +- Update instrumentation guidelines about tracer / meter semantic version. (#412) +- Replace internal tracer and meter helpers by helpers from `go.opentelemetry.io/otel`. (#414) +- gRPC instrumentation sets span attribute `rpc.grpc.status_code`. (#453) + +## Fixed + +- `/detectors/aws` no longer fails if instance metadata is not available (e.g. not running in AWS) (#401) +- The AWS detector now returns a partial resource and an appropriate error if it encounters an error part way through determining a `Resource` identity. (#410) +- The `host` instrumentation unit test has been updated to not depend on the system it runs on. (#426) + +## [0.13.0] - 2020-10-09 + +## Added + +- A Jaeger propagator. (#375) + +## Changed + +- The `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc` package instrumentation no longer accepts a `Tracer` as an argument to the interceptor function. + Instead, a new `WithTracerProvider` option is added to configure the `TracerProvider` used when creating the `Tracer` for the instrumentation. (#373) +- The `go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron` instrumentation now accepts a `TracerProvider` rather than a `Tracer`. (#374) +- Remove `go.opentelemetry.io/otel/sdk` dependency from instrumentation. (#381) +- Use `httpsnoop` in `go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux` to ensure `http.ResponseWriter` additional interfaces are preserved. (#388) + +### Fixed + +- The `go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho.Middleware` no longer sends duplicate errors to the global `ErrorHandler`. (#377, #364) +- The import comment in `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` is now correctly quoted. (#379) +- The B3 propagator sets the sample bitmask when the sampling decision is `debug`. (#369) + +## [0.12.0] - 2020-09-25 + +### Changed + +- Replace `WithTracer` with `WithTracerProvider` in the `go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron` instrumentation. (#374) + +### Added + +- Benchmark tests for the gRPC instrumentation. (#296) +- Integration testing for the gRPC instrumentation. (#297) +- Allow custom labels to be added to net/http metrics. (#306) +- Added B3 propagator, moving it out of open.telemetry.io/otel repo. (#344) + +### Changed + +- Unify instrumentation about provider options for `go.mongodb.org/mongo-driver`, `gin-gonic/gin`, `gorilla/mux`, + `labstack/echo`, `emicklei/go-restful`, `bradfitz/gomemcache`, `Shopify/sarama`, `net/http` and `beego`. (#303) +- Update instrumentation guidelines about uniform provider options. Also, update style guide. (#303) +- Make config struct of instrumentation unexported. (#303) +- Instrumentations have been updated to adhere to the [configuration style guide's](https://github.com/open-telemetry/opentelemetry-go/blob/master/CONTRIBUTING.md#config) + updated recommendation to use `newConfig()` instead of `configure()`. (#336) +- A new instrumentation naming scheme is implemented to avoid package name conflicts for instrumented packages while still remaining discoverable. (#359) + - `google.golang.org/grpc` -> `google.golang.org/grpc/otelgrpc` + - `go.mongodb.org/mongo-driver` -> `go.mongodb.org/mongo-driver/mongo/otelmongo` + - `net/http` -> `net/http/otelhttp` + - `net/http/httptrace` -> `net/http/httptrace/otelhttptrace` + - `github.com/labstack/echo` -> `github.com/labstack/echo/otelecho` + - `github.com/bradfitz/gomemcache` -> `github.com/bradfitz/gomemcache/memcache/otelmemcache` + - `github.com/gin-gonic/gin` -> `github.com/gin-gonic/gin/otelgin` + - `github.com/gocql/gocql` -> `github.com/gocql/gocql/otelgocql` + - `github.com/emicklei/go-restful` -> `github.com/emicklei/go-restful/otelrestful` + - `github.com/Shopify/sarama` -> `github.com/Shopify/sarama/otelsarama` + - `github.com/gorilla/mux` -> `github.com/gorilla/mux/otelmux` + - `github.com/astaxie/beego` -> `github.com/astaxie/beego/otelbeego` + - `gopkg.in/macaron.v1` -> `gopkg.in/macaron.v1/otelmacaron` +- Rename `OTelBeegoHandler` to `Handler` in the `go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego` package. (#359) + +## [0.11.0] - 2020-08-25 + +### Added + +- Top-level `Version()` and `SemVersion()` functions defining the current version of the contrib package. (#225) +- Instrumentation for the `github.com/astaxie/beego` package. (#200) +- Instrumentation for the `github.com/bradfitz/gomemcache` package. (#204) +- Host metrics instrumentation. (#231) +- Cortex histogram and distribution support. (#237) +- Cortex example project. (#238) +- Cortex HTTP authentication. (#246) + +### Changed + +- Remove service name as a parameter of Sarama instrumentation. (#221) +- Replace `WithTracer` with `WithTracerProvider` in Sarama instrumentation. (#221) +- Switch to use common top-level module `SemVersion()` when creating versioned tracer in `bradfitz/gomemcache`. (#226) +- Use `IntegrationShouldRun` in `gomemcache_test`. (#254) +- Use Go 1.15 for CI builds. (#236) +- Improved configuration for `runtime` instrumentation. (#224) + +### Fixed + +- Update dependabot configuration to include newly added `bradfitz/gomemcache` package. (#226) +- Correct `runtime` instrumentation name. (#241) + +## [0.10.1] - 2020-08-13 + +### Added + +- The `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc` module has been added to replace the instrumentation that had previoiusly existed in the `go.opentelemetry.io/otel/instrumentation/grpctrace` package. (#189) +- Instrumentation for the stdlib `net/http` and `net/http/httptrace` packages. (#190) +- Initial Cortex exporter. (#202, #205, #210, #211, #215) + +### Fixed + +- Bump google.golang.org/grpc from 1.30.0 to 1.31.0. (#166) +- Bump go.mongodb.org/mongo-driver from 1.3.5 to 1.4.0 in /instrumentation/go.mongodb.org/mongo-driver. (#170) +- Bump google.golang.org/grpc in /instrumentation/github.com/gin-gonic/gin. (#173) +- Bump google.golang.org/grpc in /instrumentation/github.com/labstack/echo. (#176) +- Bump google.golang.org/grpc from 1.30.0 to 1.31.0 in /instrumentation/github.com/Shopify/sarama. (#179) +- Bump cloud.google.com/go from 0.61.0 to 0.63.0 in /detectors/gcp. (#181, #199) +- Bump github.com/aws/aws-sdk-go from 1.33.15 to 1.34.1 in /detectors/aws. (#184, #192, #193, #198, #201, #203) +- Bump github.com/golangci/golangci-lint from 1.29.0 to 1.30.0 in /tools. (#186) +- Setup CI to run tests that require external resources (Cassandra and MongoDB). (#191) +- Bump github.com/Shopify/sarama from 1.26.4 to 1.27.0 in /instrumentation/github.com/Shopify/sarama. (#206) + +## [0.10.0] - 2020-07-31 + +This release upgrades its [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.10.0) dependency to v0.10.0 and includes new instrumentation for popular Kafka and Cassandra clients. + +### Added + +- A detector that generate resources from GCE instance. (#132) +- A detector that generate resources from AWS instances. (#139) +- Instrumentation for the Kafka client github.com/Shopify/sarama. (#134, #153) +- Links and status message for mock span in the internal testing library. (#134) +- Instrumentation for the Cassandra client github.com/gocql/gocql. (#137) +- A detector that generate resources from GKE clusters. (#154) + +### Fixed + +- Bump github.com/aws/aws-sdk-go from 1.33.8 to 1.33.15 in /detectors/aws. (#155, #157, #159, #162) +- Bump github.com/golangci/golangci-lint from 1.28.3 to 1.29.0 in /tools. (#146) + +## [0.9.0] - 2020-07-20 + +This release upgrades its [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.9.0) dependency to v0.9.0. + +### Fixed + +- Bump github.com/emicklei/go-restful/v3 from 3.0.0 to 3.2.0 in /instrumentation/github.com/emicklei/go-restful. (#133) +- Update dependabot configuration to correctly check all included packages. (#131) +- Update `RELEASING.md` with correct `tag.sh` command. (#130) + +## [0.8.0] - 2020-07-10 + +This release upgrades its [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.8.0) dependency to v0.8.0, includes minor fixes, and new instrumentation. + +### Added + +- Create this `CHANGELOG.md`. (#114) +- Add `emicklei/go-restful/v3` trace instrumentation. (#115) + +### Changed + +- Update `CONTRIBUTING.md` to ask for updates to `CHANGELOG.md` with each pull request. (#114) +- Move all `github.com` package instrumentation under a `github.com` directory. (#118) + +### Fixed + +- Update README to include information about external instrumentation. + To start, this includes native instrumentation found in the `go-redis/redis` package. (#117) +- Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.2 in /tools. (#122, #123, #125) +- Bump go.mongodb.org/mongo-driver from 1.3.4 to 1.3.5 in /instrumentation/go.mongodb.org/mongo-driver. (#124) + +## [0.7.0] - 2020-06-29 + +This release upgrades its [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.7.0) dependency to v0.7.0. + +### Added + +- Create `RELEASING.md` instructions. (#101) +- Apply transitive dependabot go.mod updates as part of a new automatic Github workflow. (#94) +- New dependabot integration to automate package upgrades. (#61) +- Add automatic tag generation script for release. (#60) + +### Changed + +- Upgrade Datadog metrics exporter to include Resource tags. (#46) +- Added output validation to Datadog example. (#96) +- Move Macaron package to match layout guidelines. (#92) +- Update top-level README and instrumentation README. (#92) +- Bump google.golang.org/grpc from 1.29.1 to 1.30.0. (#99) +- Bump github.com/golangci/golangci-lint from 1.21.0 to 1.27.0 in /tools. (#77) +- Bump go.mongodb.org/mongo-driver from 1.3.2 to 1.3.4 in /instrumentation/go.mongodb.org/mongo-driver. (#76) +- Bump github.com/stretchr/testify from 1.5.1 to 1.6.1. (#74) +- Bump gopkg.in/macaron.v1 from 1.3.5 to 1.3.9 in /instrumentation/macaron. (#68) +- Bump github.com/gin-gonic/gin from 1.6.2 to 1.6.3 in /instrumentation/gin-gonic/gin. (#73) +- Bump github.com/DataDog/datadog-go from 3.5.0+incompatible to 3.7.2+incompatible in /exporters/metric/datadog. (#78) +- Replaced `internal/trace/http.go` helpers with `api/standard` helpers from otel-go repo. (#112) + +## [0.6.1] - 2020-06-08 + +First official tagged release of `contrib` repository. + +### Added + +- `labstack/echo` trace instrumentation (#42) +- `mongodb` trace instrumentation (#26) +- Go Runtime metrics (#9) +- `gorilla/mux` trace instrumentation (#19) +- `gin-gonic` trace instrumentation (#15) +- `macaron` trace instrumentation (#20) +- `dogstatsd` metrics exporter (#10) +- `datadog` metrics exporter (#22) +- Tags to all modules in repository +- Repository folder structure and automated build (#3) + +### Changes + +- Prefix support for dogstatsd (#34) +- Update Go Runtime package to use batch observer (#44) + +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go-contrib/compare/v0.20.0...HEAD +[0.20.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.20.0 +[0.19.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.19.0 +[0.18.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.18.0 +[0.17.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.17.0 +[0.16.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.16.0 +[0.15.1]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.15.1 +[0.15.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.15.0 +[0.14.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.14.0 +[0.13.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.13.0 +[0.12.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.12.0 +[0.11.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.11.0 +[0.10.1]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.10.1 +[0.10.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.10.0 +[0.9.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.9.0 +[0.8.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.8.0 +[0.7.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.7.0 +[0.6.1]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.6.1 diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CODEOWNERS b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CODEOWNERS new file mode 100644 index 000000000000..196df9cfd896 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CODEOWNERS @@ -0,0 +1,17 @@ +##################################################### +# +# List of approvers for this repository +# +##################################################### +# +# Learn about membership in OpenTelemetry community: +# https://github.com/open-telemetry/community/blob/main/community-membership.md +# +# +# Learn about CODEOWNERS file format: +# https://help.github.com/en/articles/about-code-owners +# + +* @jmacd @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @paivagustavo + +CODEOWNERS @MrAlias @Aneurysm9 diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CONTRIBUTING.md b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CONTRIBUTING.md new file mode 100644 index 000000000000..0c7bb21bd0fa --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/CONTRIBUTING.md @@ -0,0 +1,135 @@ +# Contributing to opentelemetry-go-contrib + +The Go special interest group (SIG) meets regularly. See the +OpenTelemetry +[community](https://github.com/open-telemetry/community#golang-sdk) +repo for information on this and other language SIGs. + +See the [public meeting +notes](https://docs.google.com/document/d/1A63zSWX0x2CyCK_LoNhmQC4rqhLpYXJzXbEPDUQ2n6w/edit#heading=h.9tngw7jdwd6b) +for a summary description of past meetings. To request edit access, +join the meeting or get in touch on +[Slack](https://cloud-native.slack.com/archives/C01NPAXACKT). + +## Development + +There are some generated files checked into the repo. To make sure +that the generated files are up-to-date, run `make` (or `make +precommit` - the `precommit` target is the default). + +The `precommit` target also fixes the formatting of the code and +checks the status of the go module files. + +If after running `make precommit` the output of `git status` contains +`nothing to commit, working tree clean` then it means that everything +is up-to-date and properly formatted. + +## Pull Requests + +### How to Send Pull Requests + +Everyone is welcome to contribute code to `opentelemetry-go-contrib` via +GitHub pull requests (PRs). + +To create a new PR, fork the project in GitHub and clone the upstream +repo: + +```sh +$ git clone https://github.com/open-telemetry/opentelemetry-go-contrib +``` +This would put the project in the `opentelemetry-go-contrib` directory in +current working directory. + +Enter the newly created directory and add your fork as a new remote: + +```sh +$ git remote add git@github.com:/opentelemetry-go +``` + +Check out a new branch, make modifications, run linters and tests, update +`CHANGELOG.md` and push the branch to your fork: + +```sh +$ git checkout -b +# edit files +# update changelog +$ make precommit +$ git add -p +$ git commit +$ git push +``` + +Open a pull request against the main `opentelemetry-go-contrib` repo. Be sure to add the pull +request ID to the entry you added to `CHANGELOG.md`. + +### How to Receive Comments + +* If the PR is not ready for review, please put `[WIP]` in the title, + tag it as `work-in-progress`, or mark it as + [`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/). +* Make sure CLA is signed and CI is clear. + +### How to Get PRs Merged + +A PR is considered to be **ready to merge** when: + +* It has received two approvals from Approvers/Maintainers (at + different companies). +* Feedback has been addressed. +* Any substantive changes to your PR will require that you clear any prior + Approval reviews, this includes changes resulting from other feedback. Unless + the approver explicitly stated that their approval will persist across + changes it should be assumed that the PR needs their review again. Other + project members (e.g. approvers, maintainers) can help with this if there are + any questions or if you forget to clear reviews. +* It has been open for review for at least one working day. This gives + people reasonable time to review. +* Trivial change (typo, cosmetic, doc, etc.) doesn't have to wait for + one day. +* `CHANGELOG.md` has been updated to reflect what has been + added, changed, removed, or fixed. +* Urgent fix can take exception as long as it has been actively + communicated. + +Any Maintainer can merge the PR once it is **ready to merge**. + +## Style Guide + +* Make sure to run `make precommit` - this will find and fix the code + formatting. +* Check [opentelemetry-go Style Guide](https://github.com/open-telemetry/opentelemetry-go/blob/main/CONTRIBUTING.md#style-guide) + +## Adding a new Contrib package + +To add a new contrib package follow an existing one. An empty Sample instrumentation +provides base structure with an example and a test. Each contrib package +should be its own module. A contrib package may contain more than one go package. + +### Folder Structure +- instrumentation/\ (**Common**) +- instrumentation/\/trace (**specific to trace**) +- instrumentation/\/metrics (**specific to metrics**) + +#### Example +- instrumentation/gorm/trace +- instrumentation/kafka/metrics + +## Approvers and Maintainers + +Approvers: + +- [Evan Torrie](https://github.com/evantorrie), Verizon Media +- [Josh MacDonald](https://github.com/jmacd), LightStep +- [Sam Xie](https://github.com/XSAM) +- [David Ashpole](https://github.com/dashpole), Google +- [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep + +Maintainers: + +- [Anthony Mirabella](https://github.com/Aneurysm9), Centene +- [Tyler Yahn](https://github.com/MrAlias), New Relic + +### Become an Approver or a Maintainer + +See the [community membership document in OpenTelemetry community +repo](https://github.com/open-telemetry/community/blob/main/community-membership.md). diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/LICENSE.txt b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/LICENSE similarity index 88% rename from cluster-autoscaler/vendor/github.com/spf13/afero/LICENSE.txt rename to cluster-autoscaler/vendor/go.opentelemetry.io/contrib/LICENSE index 298f0e2665e5..261eeb9e9f8b 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/LICENSE.txt +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/LICENSE @@ -1,4 +1,4 @@ - Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -172,3 +172,30 @@ defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/Makefile b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/Makefile new file mode 100644 index 000000000000..4ad59562cc3c --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/Makefile @@ -0,0 +1,203 @@ +TOOLS_MOD_DIR := ./tools + +# All source code and documents. Used in spell check. +ALL_DOCS := $(shell find . -name '*.md' -type f | sort) +# All directories with go.mod files related to opentelemetry library. Used for building, testing and linting. +ALL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)) +ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./example|^$(TOOLS_MOD_DIR)' | sort) + +# URLs to check if all contrib entries exist in the registry. +REGISTRY_BASE_URL = https://raw.githubusercontent.com/open-telemetry/opentelemetry.io/main/content/en/registry +CONTRIB_REPO_URL = https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main + +# Mac OS Catalina 10.5.x doesn't support 386. Hence skip 386 test +SKIP_386_TEST = false +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) + SW_VERS := $(shell sw_vers -productVersion) + ifeq ($(shell echo $(SW_VERS) | egrep '^(10.1[5-9]|1[1-9]|[2-9])'), $(SW_VERS)) + SKIP_386_TEST = true + endif +endif + + +GOTEST_MIN = go test -v -timeout 30s +GOTEST = $(GOTEST_MIN) -race +GOTEST_WITH_COVERAGE = $(GOTEST) -coverprofile=coverage.out -covermode=atomic -coverpkg=./... + +.DEFAULT_GOAL := precommit + +.PHONY: precommit + +TOOLS_DIR := $(abspath ./.tools) + +$(TOOLS_DIR)/golangci-lint: $(TOOLS_MOD_DIR)/go.mod $(TOOLS_MOD_DIR)/go.sum $(TOOLS_MOD_DIR)/tools.go + cd $(TOOLS_MOD_DIR) && \ + go build -o $(TOOLS_DIR)/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint + +$(TOOLS_DIR)/misspell: $(TOOLS_MOD_DIR)/go.mod $(TOOLS_MOD_DIR)/go.sum $(TOOLS_MOD_DIR)/tools.go + cd $(TOOLS_MOD_DIR) && \ + go build -o $(TOOLS_DIR)/misspell github.com/client9/misspell/cmd/misspell + +$(TOOLS_DIR)/stringer: $(TOOLS_MOD_DIR)/go.mod $(TOOLS_MOD_DIR)/go.sum $(TOOLS_MOD_DIR)/tools.go + cd $(TOOLS_MOD_DIR) && \ + go build -o $(TOOLS_DIR)/stringer golang.org/x/tools/cmd/stringer + +precommit: dependabot-check license-check generate build lint test + +.PHONY: test-with-coverage +test-with-coverage: + set -e; \ + printf "" > coverage.txt; \ + for dir in $(ALL_COVERAGE_MOD_DIRS); do \ + echo "go test ./... + coverage in $${dir}"; \ + (cd "$${dir}" && \ + $(GOTEST_WITH_COVERAGE) ./... && \ + go tool cover -html=coverage.out -o coverage.html); \ + [ -f "$${dir}/coverage.out" ] && cat "$${dir}/coverage.out" >> coverage.txt; \ + done; \ + sed -i.bak -e '2,$$ { /^mode: /d; }' coverage.txt && rm coverage.txt.bak + +.PHONY: ci +ci: precommit check-clean-work-tree test-with-coverage test-386 + +.PHONY: test-gocql +test-gocql: + @if ./tools/should_build.sh gocql; then \ + set -e; \ + docker run --name cass-integ --rm -p 9042:9042 -d cassandra:3; \ + CMD=cassandra IMG_NAME=cass-integ ./tools/wait.sh; \ + (cd instrumentation/github.com/gocql/gocql/otelgocql && \ + $(GOTEST_WITH_COVERAGE) . && \ + go tool cover -html=coverage.out -o coverage.html); \ + docker stop cass-integ; \ + fi + +.PHONY: test-mongo-driver +test-mongo-driver: + @if ./tools/should_build.sh mongo-driver; then \ + set -e; \ + docker run --name mongo-integ --rm -p 27017:27017 -d mongo; \ + CMD=mongo IMG_NAME=mongo-integ ./tools/wait.sh; \ + (cd instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo && \ + $(GOTEST_WITH_COVERAGE) . && \ + go tool cover -html=coverage.out -o coverage.html); \ + docker stop mongo-integ; \ + fi + +.PHONY: test-gomemcache +test-gomemcache: + @if ./tools/should_build.sh gomemcache; then \ + set -e; \ + docker run --name gomemcache-integ --rm -p 11211:11211 -d memcached; \ + CMD=gomemcache IMG_NAME=gomemcache-integ ./tools/wait.sh; \ + (cd instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache && \ + $(GOTEST_WITH_COVERAGE) . && \ + go tool cover -html=coverage.out -o coverage.html); \ + docker stop gomemcache-integ ; \ + fi + +.PHONY: check-clean-work-tree +check-clean-work-tree: + @if ! git diff --quiet; then \ + echo; \ + echo 'Working tree is not clean, did you forget to run "make precommit"?'; \ + echo; \ + git status; \ + exit 1; \ + fi + +.PHONY: build +build: + # TODO: Fix this on windows. + set -e; for dir in $(ALL_GO_MOD_DIRS); do \ + echo "compiling all packages in $${dir}"; \ + (cd "$${dir}" && \ + go build ./... && \ + go test -run xxxxxMatchNothingxxxxx ./... >/dev/null); \ + done + +.PHONY: test +test: + set -e; for dir in $(ALL_GO_MOD_DIRS); do \ + echo "go test ./... + race in $${dir}"; \ + (cd "$${dir}" && \ + $(GOTEST) ./...); \ + done + +.PHONY: test-386 +test-386: + if [ $(SKIP_386_TEST) = true ] ; then \ + echo "skipping the test for GOARCH 386 as it is not supported on the current OS"; \ + else \ + set -e; for dir in $(ALL_GO_MOD_DIRS); do \ + echo "go test ./... GOARCH 386 in $${dir}"; \ + (cd "$${dir}" && \ + GOARCH=386 $(GOTEST_MIN) ./...); \ + done; \ + fi + +.PHONY: lint +lint: $(TOOLS_DIR)/golangci-lint $(TOOLS_DIR)/misspell + set -e; for dir in $(ALL_GO_MOD_DIRS); do \ + echo "golangci-lint in $${dir}"; \ + (cd "$${dir}" && \ + $(TOOLS_DIR)/golangci-lint run --fix && \ + $(TOOLS_DIR)/golangci-lint run); \ + done + $(TOOLS_DIR)/misspell -w $(ALL_DOCS) + set -e; for dir in $(ALL_GO_MOD_DIRS) $(TOOLS_MOD_DIR); do \ + echo "go mod tidy in $${dir}"; \ + (cd "$${dir}" && \ + go mod tidy); \ + done + +.PHONY: generate +generate: $(TOOLS_DIR)/stringer + PATH="$(TOOLS_DIR):$${PATH}" go generate ./... + +.PHONY: license-check +license-check: + @licRes=$$(for f in $$(find . -type f \( -iname '*.go' -o -iname '*.sh' \) ! -path './vendor/*' ! -path './exporters/otlp/internal/opentelemetry-proto/*') ; do \ + awk '/Copyright The OpenTelemetry Authors|generated|GENERATED/ && NR<=3 { found=1; next } END { if (!found) print FILENAME }' $$f; \ + done); \ + if [ -n "$${licRes}" ]; then \ + echo "license header checking failed:"; echo "$${licRes}"; \ + exit 1; \ + fi + +.PHONY: registry-links-check +registry-links-check: + @checkRes=$$( \ + for f in $$( find ./instrumentation ./exporters ./detectors ! -path './instrumentation/net/*' -type f -name 'go.mod' -exec dirname {} \; | egrep -v '/example|/utils' | sort ) \ + ./instrumentation/net/http; do \ + TYPE="instrumentation"; \ + if $$(echo "$$f" | grep -q "exporters"); then \ + TYPE="exporter"; \ + fi; \ + if $$(echo "$$f" | grep -q "detectors"); then \ + TYPE="detector"; \ + fi; \ + NAME=$$(echo "$$f" | sed -e 's/.*\///' -e 's/.*otel//'); \ + LINK=$(CONTRIB_REPO_URL)/$$(echo "$$f" | sed -e 's/..//' -e 's/\/otel.*$$//'); \ + if ! $$(curl -s $(REGISTRY_BASE_URL)/$${TYPE}-go-$${NAME}.md | grep -q "$${LINK}"); then \ + echo "$$f"; \ + fi \ + done; \ + ); \ + if [ -n "$$checkRes" ]; then \ + echo "WARNING: registry link check failed for the following packages:"; echo "$${checkRes}"; \ + fi + +.PHONY: dependabot-check +dependabot-check: + @result=$$( \ + for f in $$( find . -type f -name go.mod -exec dirname {} \; | sed 's/^.\/\?/\//' ); \ + do grep -q "$$f" .github/dependabot.yml \ + || echo "$$f"; \ + done; \ + ); \ + if [ -n "$$result" ]; then \ + echo "missing go.mod dependabot check:"; echo "$$result"; \ + exit 1; \ + fi diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/README.md b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/README.md new file mode 100644 index 000000000000..28585affe92a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/README.md @@ -0,0 +1,25 @@ +# OpenTelemetry-Go Contrib + +[![build_and_test](https://github.com/open-telemetry/opentelemetry-go-contrib/workflows/build_and_test/badge.svg)](https://github.com/open-telemetry/opentelemetry-go-contrib/actions?query=workflow%3Abuild_and_test+branch%3Amain) +[![Docs](https://godoc.org/go.opentelemetry.io/contrib?status.svg)](https://pkg.go.dev/go.opentelemetry.io/contrib) +[![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/contrib)](https://goreportcard.com/report/go.opentelemetry.io/contrib) +[![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT) + +Collection of 3rd-party instrumentation and exporters for [OpenTelemetry-Go](https://github.com/open-telemetry/opentelemetry-go). + +## Contents + +- [Instrumentation](./instrumentation/): Packages providing OpenTelemetry instrumentation for 3rd-party libraries. +- [Exporters](./exporters/): Packages providing OpenTelemetry exporters for 3rd-party telemetry systems. +- [Propagators](./propagators/): Packages providing OpenTelemetry context propagators for 3rd-party propagation formats. +- [Detectors](./detectors/): Packages providing OpenTelemetry resource detectors for 3rd-party cloud computing environments. + +## Project Status + +This project is currently in a pre-GA phase. Our progress towards a GA release +candidate is tracked in [this project +board](https://github.com/orgs/open-telemetry/projects/5). + +## Contributing + +For information on how to contribute, consult [the contributing guidelines](./CONTRIBUTING.md) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/RELEASING.md b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/RELEASING.md new file mode 100644 index 000000000000..f7fd359c477a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/RELEASING.md @@ -0,0 +1,96 @@ +# Release Process + +There are two types of release for the `go.opentelemetry.io/contrib` repo +and submodules. + +1. **Case 1** A release due to changes independent of the +`go.opentelemetry.io/otel` module, e.g. perhaps a critical bug fix in +one of the contrib modules. + +2. **Case 2** A release due to a breaking API change in +`go.opentelemetry.io/otel` which all modules in this repo +depend on. + +## Pre-Release + +Update go.mod for submodules to depend on the upcoming new release of +the module in this repo, `go.opentelemetry.io/contrib`. Decide on the +next version of the semantic tag to apply to the contrib +module based on whether you fall into Case 1 or Case 2. + +### Case 1 + +If the changes are all internal to this repo, then the new tag will +most often be a patch or minor version upgrade to the existing tag on +this module. Let's call this ``. + +### Case 2 + +If a new release is required due to breaking changes in +`go.opentelemetry.io/otel`, then the new semantic tag for this repo +should be bumped to match the `go.opentelemetry.io/otel` new tag. +Let's call this ``. The script checks that +`go.opentelemetry.io/otel@v` is a valid tag, so you need +to wait until that tag has been pushed in the main repo. + +In nearly all cases, `` should be the same as +``. + +1. Run `pre_release.sh` script to create a branch `pre_release_`. + The script will also run `go mod tidy` and `make ci`. + + * **Case 1** `./pre_release.sh -t ` + * **Case 2** `./pre_release.sh -o [-t ]` + +2. If you used `-o ` to rewrite the modules to depend on + a new version of `go.opentelemetry.io/otel`, there will likely be + breaking changes that require fixes to the files in this + `contrib` repo. Make the appropriate fixes to address any API + breaks and run through the + + ``` + git commit -m "fixes due to API changes" + make precommit + ``` + + cycle until everything passes + +4. Push the changes to upstream. + + ``` + git diff main + git push + ``` + +5. Create a PR on github and merge the PR once approved. + + +### Tag +Now create a `` on the commit hash of the changes made in pre-release step, + +1. Run the tag.sh script. + + ``` + ./tag.sh + ``` +2. Push tags upstream. Make sure you push upstream for all the sub-module tags as well. + + ``` + git push upstream + git push upstream + ... + ``` + +## Release +Now create a release for the new `` on github. +The release body should include all the release notes in the Changelog for this release. +Additionally, the `tag.sh` script generates commit logs since last release which can be used to suppliment the release notes. + + + + + + + + + diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/contrib.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/contrib.go new file mode 100644 index 000000000000..92c1ddfee98b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/contrib.go @@ -0,0 +1,28 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package contrib contains common values used across all +// instrumentation, exporter, and detector contributions. +package contrib // import "go.opentelemetry.io/contrib" + +// Version is the current release version of OpenTelemetry Contrib in use. +func Version() string { + return "0.20.0" + // This string is updated by the pre_release.sh script during release +} + +// SemVersion is the semantic version to be supplied to tracer/meter creation. +func SemVersion() string { + return "semver:" + Version() +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/doc.go new file mode 100644 index 000000000000..6c55ff6a2b6e --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/doc.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This package provides all of its functionality through its +// submodules. The submodules in the exporters directory provide +// implementations for trace and metric exporters for third-party +// collectors, and submodules in the instrumentation directory provide the +// instrumentation for the popular go libraries. +package contrib diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/go.mod b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/go.mod new file mode 100644 index 000000000000..3a96b217dec0 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/go.mod @@ -0,0 +1,3 @@ +module go.opentelemetry.io/contrib + +go 1.14 diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/go.sum b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/go.sum new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/LICENSE b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go new file mode 100644 index 000000000000..0816b9f5daa3 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otelhttp + +import ( + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// DefaultClient is the default Client and is used by Get, Head, Post and PostForm. +// Please be careful of intitialization order - for example, if you change +// the global propagator, the DefaultClient might still be using the old one +var DefaultClient = &http.Client{Transport: NewTransport(http.DefaultTransport)} + +// Get is a convenient replacement for http.Get that adds a span around the request. +func Get(ctx context.Context, url string) (resp *http.Response, err error) { + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, err + } + return DefaultClient.Do(req) +} + +// Head is a convenient replacement for http.Head that adds a span around the request. +func Head(ctx context.Context, url string) (resp *http.Response, err error) { + req, err := http.NewRequestWithContext(ctx, "HEAD", url, nil) + if err != nil { + return nil, err + } + return DefaultClient.Do(req) +} + +// Post is a convenient replacement for http.Post that adds a span around the request. +func Post(ctx context.Context, url, contentType string, body io.Reader) (resp *http.Response, err error) { + req, err := http.NewRequestWithContext(ctx, "POST", url, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", contentType) + return DefaultClient.Do(req) +} + +// PostForm is a convenient replacement for http.PostForm that adds a span around the request. +func PostForm(ctx context.Context, url string, data url.Values) (resp *http.Response, err error) { + return Post(ctx, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go new file mode 100644 index 000000000000..a5b356289cef --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go @@ -0,0 +1,41 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otelhttp + +import ( + "net/http" + + "go.opentelemetry.io/otel/attribute" +) + +// Attribute keys that can be added to a span. +const ( + ReadBytesKey = attribute.Key("http.read_bytes") // if anything was read from the request body, the total number of bytes read + ReadErrorKey = attribute.Key("http.read_error") // If an error occurred while reading a request, the string of the error (io.EOF is not recorded) + WroteBytesKey = attribute.Key("http.wrote_bytes") // if anything was written to the response writer, the total number of bytes written + WriteErrorKey = attribute.Key("http.write_error") // if an error occurred while writing a reply, the string of the error (io.EOF is not recorded) +) + +// Server HTTP metrics +const ( + RequestCount = "http.server.request_count" // Incoming request count total + RequestContentLength = "http.server.request_content_length" // Incoming request bytes total + ResponseContentLength = "http.server.response_content_length" // Incoming response bytes total + ServerLatency = "http.server.duration" // Incoming end to end duration, microseconds +) + +// Filter is a predicate used to determine whether a given http.request should +// be traced. A Filter must return true if the request should be traced. +type Filter func(*http.Request) bool diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go new file mode 100644 index 000000000000..3bc203c451dd --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go @@ -0,0 +1,173 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otelhttp + +import ( + "net/http" + + "go.opentelemetry.io/contrib" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/global" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" +) + +const ( + instrumentationName = "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" +) + +// config represents the configuration options available for the http.Handler +// and http.Transport types. +type config struct { + Tracer trace.Tracer + Meter metric.Meter + Propagators propagation.TextMapPropagator + SpanStartOptions []trace.SpanOption + ReadEvent bool + WriteEvent bool + Filters []Filter + SpanNameFormatter func(string, *http.Request) string + + TracerProvider trace.TracerProvider + MeterProvider metric.MeterProvider +} + +// Option Interface used for setting *optional* config properties +type Option interface { + Apply(*config) +} + +// OptionFunc provides a convenience wrapper for simple Options +// that can be represented as functions. +type OptionFunc func(*config) + +func (o OptionFunc) Apply(c *config) { + o(c) +} + +// newConfig creates a new config struct and applies opts to it. +func newConfig(opts ...Option) *config { + c := &config{ + Propagators: otel.GetTextMapPropagator(), + TracerProvider: otel.GetTracerProvider(), + MeterProvider: global.GetMeterProvider(), + } + for _, opt := range opts { + opt.Apply(c) + } + + c.Tracer = c.TracerProvider.Tracer( + instrumentationName, + trace.WithInstrumentationVersion(contrib.SemVersion()), + ) + c.Meter = c.MeterProvider.Meter( + instrumentationName, + metric.WithInstrumentationVersion(contrib.SemVersion()), + ) + + return c +} + +// WithTracerProvider specifies a tracer provider to use for creating a tracer. +// If none is specified, the global provider is used. +func WithTracerProvider(provider trace.TracerProvider) Option { + return OptionFunc(func(cfg *config) { + cfg.TracerProvider = provider + }) +} + +// WithMeterProvider specifies a meter provider to use for creating a meter. +// If none is specified, the global provider is used. +func WithMeterProvider(provider metric.MeterProvider) Option { + return OptionFunc(func(cfg *config) { + cfg.MeterProvider = provider + }) +} + +// WithPublicEndpoint configures the Handler to link the span with an incoming +// span context. If this option is not provided, then the association is a child +// association instead of a link. +func WithPublicEndpoint() Option { + return OptionFunc(func(c *config) { + c.SpanStartOptions = append(c.SpanStartOptions, trace.WithNewRoot()) + }) +} + +// WithPropagators configures specific propagators. If this +// option isn't specified then +func WithPropagators(ps propagation.TextMapPropagator) Option { + return OptionFunc(func(c *config) { + c.Propagators = ps + }) +} + +// WithSpanOptions configures an additional set of +// trace.SpanOptions, which are applied to each new span. +func WithSpanOptions(opts ...trace.SpanOption) Option { + return OptionFunc(func(c *config) { + c.SpanStartOptions = append(c.SpanStartOptions, opts...) + }) +} + +// WithFilter adds a filter to the list of filters used by the handler. +// If any filter indicates to exclude a request then the request will not be +// traced. All filters must allow a request to be traced for a Span to be created. +// If no filters are provided then all requests are traced. +// Filters will be invoked for each processed request, it is advised to make them +// simple and fast. +func WithFilter(f Filter) Option { + return OptionFunc(func(c *config) { + c.Filters = append(c.Filters, f) + }) +} + +type event int + +// Different types of events that can be recorded, see WithMessageEvents +const ( + ReadEvents event = iota + WriteEvents +) + +// WithMessageEvents configures the Handler to record the specified events +// (span.AddEvent) on spans. By default only summary attributes are added at the +// end of the request. +// +// Valid events are: +// * ReadEvents: Record the number of bytes read after every http.Request.Body.Read +// using the ReadBytesKey +// * WriteEvents: Record the number of bytes written after every http.ResponeWriter.Write +// using the WriteBytesKey +func WithMessageEvents(events ...event) Option { + return OptionFunc(func(c *config) { + for _, e := range events { + switch e { + case ReadEvents: + c.ReadEvent = true + case WriteEvents: + c.WriteEvent = true + } + } + }) +} + +// WithSpanNameFormatter takes a function that will be called on every +// request and the returned string will become the Span Name +func WithSpanNameFormatter(f func(operation string, r *http.Request) string) Option { + return OptionFunc(func(c *config) { + c.SpanNameFormatter = f + }) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go new file mode 100644 index 000000000000..38c7f01c71a1 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go @@ -0,0 +1,18 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package otelhttp provides an http.Handler and functions that are intended +// to be used to add tracing by wrapping existing handlers (with Handler) and +// routes WithRouteTag. +package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.mod b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.mod new file mode 100644 index 000000000000..fdeefbeac2bc --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.mod @@ -0,0 +1,15 @@ +module go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp + +go 1.14 + +replace go.opentelemetry.io/contrib => ../../../.. + +require ( + github.com/felixge/httpsnoop v1.0.1 + github.com/stretchr/testify v1.7.0 + go.opentelemetry.io/contrib v0.20.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/oteltest v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.sum b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.sum new file mode 100644 index 000000000000..88a41f1c9025 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.sum @@ -0,0 +1,25 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +go.opentelemetry.io/otel v0.20.0 h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go new file mode 100644 index 000000000000..c912548b0661 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go @@ -0,0 +1,225 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otelhttp + +import ( + "io" + "net/http" + "time" + + "github.com/felixge/httpsnoop" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/semconv" + "go.opentelemetry.io/otel/trace" +) + +var _ http.Handler = &Handler{} + +// Handler is http middleware that corresponds to the http.Handler interface and +// is designed to wrap a http.Mux (or equivalent), while individual routes on +// the mux are wrapped with WithRouteTag. A Handler will add various attributes +// to the span using the attribute.Keys defined in this package. +type Handler struct { + operation string + handler http.Handler + + tracer trace.Tracer + meter metric.Meter + propagators propagation.TextMapPropagator + spanStartOptions []trace.SpanOption + readEvent bool + writeEvent bool + filters []Filter + spanNameFormatter func(string, *http.Request) string + counters map[string]metric.Int64Counter + valueRecorders map[string]metric.Int64ValueRecorder +} + +func defaultHandlerFormatter(operation string, _ *http.Request) string { + return operation +} + +// NewHandler wraps the passed handler, functioning like middleware, in a span +// named after the operation and with any provided Options. +func NewHandler(handler http.Handler, operation string, opts ...Option) http.Handler { + h := Handler{ + handler: handler, + operation: operation, + } + + defaultOpts := []Option{ + WithSpanOptions(trace.WithSpanKind(trace.SpanKindServer)), + WithSpanNameFormatter(defaultHandlerFormatter), + } + + c := newConfig(append(defaultOpts, opts...)...) + h.configure(c) + h.createMeasures() + + return &h +} + +func (h *Handler) configure(c *config) { + h.tracer = c.Tracer + h.meter = c.Meter + h.propagators = c.Propagators + h.spanStartOptions = c.SpanStartOptions + h.readEvent = c.ReadEvent + h.writeEvent = c.WriteEvent + h.filters = c.Filters + h.spanNameFormatter = c.SpanNameFormatter +} + +func handleErr(err error) { + if err != nil { + otel.Handle(err) + } +} + +func (h *Handler) createMeasures() { + h.counters = make(map[string]metric.Int64Counter) + h.valueRecorders = make(map[string]metric.Int64ValueRecorder) + + requestBytesCounter, err := h.meter.NewInt64Counter(RequestContentLength) + handleErr(err) + + responseBytesCounter, err := h.meter.NewInt64Counter(ResponseContentLength) + handleErr(err) + + serverLatencyMeasure, err := h.meter.NewInt64ValueRecorder(ServerLatency) + handleErr(err) + + h.counters[RequestContentLength] = requestBytesCounter + h.counters[ResponseContentLength] = responseBytesCounter + h.valueRecorders[ServerLatency] = serverLatencyMeasure +} + +// ServeHTTP serves HTTP requests (http.Handler) +func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + requestStartTime := time.Now() + for _, f := range h.filters { + if !f(r) { + // Simply pass through to the handler if a filter rejects the request + h.handler.ServeHTTP(w, r) + return + } + } + + opts := append([]trace.SpanOption{ + trace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", r)...), + trace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(r)...), + trace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(h.operation, "", r)...), + }, h.spanStartOptions...) // start with the configured options + + ctx := h.propagators.Extract(r.Context(), propagation.HeaderCarrier(r.Header)) + ctx, span := h.tracer.Start(ctx, h.spanNameFormatter(h.operation, r), opts...) + defer span.End() + + readRecordFunc := func(int64) {} + if h.readEvent { + readRecordFunc = func(n int64) { + span.AddEvent("read", trace.WithAttributes(ReadBytesKey.Int64(n))) + } + } + + var bw bodyWrapper + // if request body is nil we don't want to mutate the body as it will affect + // the identity of it in a unforeseeable way because we assert ReadCloser + // fullfills a certain interface and it is indeed nil. + if r.Body != nil { + bw.ReadCloser = r.Body + bw.record = readRecordFunc + r.Body = &bw + } + + writeRecordFunc := func(int64) {} + if h.writeEvent { + writeRecordFunc = func(n int64) { + span.AddEvent("write", trace.WithAttributes(WroteBytesKey.Int64(n))) + } + } + + rww := &respWriterWrapper{ResponseWriter: w, record: writeRecordFunc, ctx: ctx, props: h.propagators} + + // Wrap w to use our ResponseWriter methods while also exposing + // other interfaces that w may implement (http.CloseNotifier, + // http.Flusher, http.Hijacker, http.Pusher, io.ReaderFrom). + + w = httpsnoop.Wrap(w, httpsnoop.Hooks{ + Header: func(httpsnoop.HeaderFunc) httpsnoop.HeaderFunc { + return rww.Header + }, + Write: func(httpsnoop.WriteFunc) httpsnoop.WriteFunc { + return rww.Write + }, + WriteHeader: func(httpsnoop.WriteHeaderFunc) httpsnoop.WriteHeaderFunc { + return rww.WriteHeader + }, + }) + + labeler := &Labeler{} + ctx = injectLabeler(ctx, labeler) + + h.handler.ServeHTTP(w, r.WithContext(ctx)) + + setAfterServeAttributes(span, bw.read, rww.written, rww.statusCode, bw.err, rww.err) + + // Add metrics + attributes := append(labeler.Get(), semconv.HTTPServerMetricAttributesFromHTTPRequest(h.operation, r)...) + h.counters[RequestContentLength].Add(ctx, bw.read, attributes...) + h.counters[ResponseContentLength].Add(ctx, rww.written, attributes...) + + elapsedTime := time.Since(requestStartTime).Microseconds() + + h.valueRecorders[ServerLatency].Record(ctx, elapsedTime, attributes...) +} + +func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int, rerr, werr error) { + attributes := []attribute.KeyValue{} + + // TODO: Consider adding an event after each read and write, possibly as an + // option (defaulting to off), so as to not create needlessly verbose spans. + if read > 0 { + attributes = append(attributes, ReadBytesKey.Int64(read)) + } + if rerr != nil && rerr != io.EOF { + attributes = append(attributes, ReadErrorKey.String(rerr.Error())) + } + if wrote > 0 { + attributes = append(attributes, WroteBytesKey.Int64(wrote)) + } + if statusCode > 0 { + attributes = append(attributes, semconv.HTTPAttributesFromHTTPStatusCode(statusCode)...) + span.SetStatus(semconv.SpanStatusFromHTTPStatusCode(statusCode)) + } + if werr != nil && werr != io.EOF { + attributes = append(attributes, WriteErrorKey.String(werr.Error())) + } + span.SetAttributes(attributes...) +} + +// WithRouteTag annotates a span with the provided route name using the +// RouteKey Tag. +func WithRouteTag(route string, h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + span := trace.SpanFromContext(r.Context()) + span.SetAttributes(semconv.HTTPRouteKey.String(route)) + h.ServeHTTP(w, r) + }) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go new file mode 100644 index 000000000000..a1d102e769e4 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go @@ -0,0 +1,65 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otelhttp + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel/attribute" +) + +// Labeler is used to allow instrumented HTTP handlers to add custom attributes to +// the metrics recorded by the net/http instrumentation. +type Labeler struct { + mu sync.Mutex + attributes []attribute.KeyValue +} + +// Add attributes to a Labeler. +func (l *Labeler) Add(ls ...attribute.KeyValue) { + l.mu.Lock() + defer l.mu.Unlock() + l.attributes = append(l.attributes, ls...) +} + +// Labels returns a copy of the attributes added to the Labeler. +func (l *Labeler) Get() []attribute.KeyValue { + l.mu.Lock() + defer l.mu.Unlock() + ret := make([]attribute.KeyValue, len(l.attributes)) + copy(ret, l.attributes) + return ret +} + +type labelerContextKeyType int + +const lablelerContextKey labelerContextKeyType = 0 + +func injectLabeler(ctx context.Context, l *Labeler) context.Context { + return context.WithValue(ctx, lablelerContextKey, l) +} + +// LabelerFromContext retrieves a Labeler instance from the provided context if +// one is available. If no Labeler was found in the provided context a new, empty +// Labeler is returned and the second return value is false. In this case it is +// safe to use the Labeler but any attributes added to it will not be used. +func LabelerFromContext(ctx context.Context) (*Labeler, bool) { + l, ok := ctx.Value(lablelerContextKey).(*Labeler) + if !ok { + l = &Labeler{} + } + return l, ok +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go new file mode 100644 index 000000000000..4c855bfb4774 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go @@ -0,0 +1,136 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otelhttp + +import ( + "context" + "io" + "net/http" + + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/semconv" + "go.opentelemetry.io/otel/trace" +) + +// Transport implements the http.RoundTripper interface and wraps +// outbound HTTP(S) requests with a span. +type Transport struct { + rt http.RoundTripper + + tracer trace.Tracer + propagators propagation.TextMapPropagator + spanStartOptions []trace.SpanOption + filters []Filter + spanNameFormatter func(string, *http.Request) string +} + +var _ http.RoundTripper = &Transport{} + +// NewTransport wraps the provided http.RoundTripper with one that +// starts a span and injects the span context into the outbound request headers. +// +// If the provided http.RoundTripper is nil, http.DefaultTransport will be used +// as the base http.RoundTripper +func NewTransport(base http.RoundTripper, opts ...Option) *Transport { + if base == nil { + base = http.DefaultTransport + } + + t := Transport{ + rt: base, + } + + defaultOpts := []Option{ + WithSpanOptions(trace.WithSpanKind(trace.SpanKindClient)), + WithSpanNameFormatter(defaultTransportFormatter), + } + + c := newConfig(append(defaultOpts, opts...)...) + t.applyConfig(c) + + return &t +} + +func (t *Transport) applyConfig(c *config) { + t.tracer = c.Tracer + t.propagators = c.Propagators + t.spanStartOptions = c.SpanStartOptions + t.filters = c.Filters + t.spanNameFormatter = c.SpanNameFormatter +} + +func defaultTransportFormatter(_ string, r *http.Request) string { + return r.Method +} + +// RoundTrip creates a Span and propagates its context via the provided request's headers +// before handing the request to the configured base RoundTripper. The created span will +// end when the response body is closed or when a read from the body returns io.EOF. +func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { + for _, f := range t.filters { + if !f(r) { + // Simply pass through to the base RoundTripper if a filter rejects the request + return t.rt.RoundTrip(r) + } + } + + opts := append([]trace.SpanOption{}, t.spanStartOptions...) // start with the configured options + + ctx, span := t.tracer.Start(r.Context(), t.spanNameFormatter("", r), opts...) + + r = r.WithContext(ctx) + span.SetAttributes(semconv.HTTPClientAttributesFromHTTPRequest(r)...) + t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header)) + + res, err := t.rt.RoundTrip(r) + if err != nil { + span.RecordError(err) + span.End() + return res, err + } + + span.SetAttributes(semconv.HTTPAttributesFromHTTPStatusCode(res.StatusCode)...) + span.SetStatus(semconv.SpanStatusFromHTTPStatusCode(res.StatusCode)) + res.Body = &wrappedBody{ctx: ctx, span: span, body: res.Body} + + return res, err +} + +type wrappedBody struct { + ctx context.Context + span trace.Span + body io.ReadCloser +} + +var _ io.ReadCloser = &wrappedBody{} + +func (wb *wrappedBody) Read(b []byte) (int, error) { + n, err := wb.body.Read(b) + + switch err { + case nil: + // nothing to do here but fall through to the return + case io.EOF: + wb.span.End() + default: + wb.span.RecordError(err) + } + return n, err +} + +func (wb *wrappedBody) Close() error { + wb.span.End() + return wb.body.Close() +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go new file mode 100644 index 000000000000..ec787c820a01 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go @@ -0,0 +1,96 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otelhttp + +import ( + "context" + "io" + "net/http" + + "go.opentelemetry.io/otel/propagation" +) + +var _ io.ReadCloser = &bodyWrapper{} + +// bodyWrapper wraps a http.Request.Body (an io.ReadCloser) to track the number +// of bytes read and the last error +type bodyWrapper struct { + io.ReadCloser + record func(n int64) // must not be nil + + read int64 + err error +} + +func (w *bodyWrapper) Read(b []byte) (int, error) { + n, err := w.ReadCloser.Read(b) + n1 := int64(n) + w.read += n1 + w.err = err + w.record(n1) + return n, err +} + +func (w *bodyWrapper) Close() error { + return w.ReadCloser.Close() +} + +var _ http.ResponseWriter = &respWriterWrapper{} + +// respWriterWrapper wraps a http.ResponseWriter in order to track the number of +// bytes written, the last error, and to catch the returned statusCode +// TODO: The wrapped http.ResponseWriter doesn't implement any of the optional +// types (http.Hijacker, http.Pusher, http.CloseNotifier, http.Flusher, etc) +// that may be useful when using it in real life situations. +type respWriterWrapper struct { + http.ResponseWriter + record func(n int64) // must not be nil + + // used to inject the header + ctx context.Context + + props propagation.TextMapPropagator + + written int64 + statusCode int + err error + wroteHeader bool +} + +func (w *respWriterWrapper) Header() http.Header { + return w.ResponseWriter.Header() +} + +func (w *respWriterWrapper) Write(p []byte) (int, error) { + if !w.wroteHeader { + w.WriteHeader(http.StatusOK) + } + n, err := w.ResponseWriter.Write(p) + n1 := int64(n) + w.record(n1) + w.written += n1 + w.err = err + return n, err +} + +func (w *respWriterWrapper) WriteHeader(statusCode int) { + if w.wroteHeader { + return + } + w.wroteHeader = true + w.statusCode = statusCode + w.props.Inject(w.ctx, propagation.HeaderCarrier(w.Header())) + w.ResponseWriter.WriteHeader(statusCode) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/pre_release.sh b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/pre_release.sh new file mode 100644 index 000000000000..971e86b4db28 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/pre_release.sh @@ -0,0 +1,158 @@ +#!/usr/bin/env bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# This script is used for +# a) creating a new tagged release of go.opentelemetry.io/contrib +# b) bumping the referenced version of go.opentelemetry.io/otel +# +# The options can be used together or individually. +# +set -e + +declare CONTRIB_TAG +declare OTEL_TAG + +help() { + printf "\n" + printf "Usage: %s [-o otel_tag] [-t tag]\n" "$0" + printf "\t-o Otel release tag. Update all go.mod to reference go.opentelemetry.io/otel .\n" + printf "\t-t New Contrib unreleased tag. Update all go.mod files with this tag.\n" + exit 1 # Exit script after printing help +} + +while getopts "t:o:" opt +do + case "$opt" in + t ) CONTRIB_TAG="$OPTARG" ;; + o ) OTEL_TAG="$OPTARG" ;; + ? ) help ;; # Print help + esac +done + +declare -r SEMVER_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" + +validate_tag() { + local tag_=$1 + if [[ "${tag_}" =~ ${SEMVER_REGEX} ]]; then + printf "%s is valid semver tag.\n" "${tag_}" + else + printf "%s is not a valid semver tag.\n" "${tag_}" + return 1 + fi +} + +# Print help in case parameters are empty +if [[ -z "$CONTRIB_TAG" && -z "$OTEL_TAG" ]] +then + printf "At least one of '-o' or '-t' must be specified.\n" + help +fi + + +## Validate tags first +if [ -n "${OTEL_TAG}" ]; then + validate_tag "${OTEL_TAG}" || exit $? + + # check that OTEL_TAG is a currently released tag for go.opentelemetry.io/otel + TMPDIR=$(mktemp -d "/tmp/otel-contrib.XXXXXX") || exit 1 + trap "rm -fr ${TMPDIR}" EXIT + (cd "${TMPDIR}" && go mod init tagtest) + # requires go 1.14 for support of '-modfile' + if ! go get -modfile="${TMPDIR}/go.mod" -d -v "go.opentelemetry.io/otel@${OTEL_TAG}"; then + printf "go.opentelemetry.io/otel %s does not exist. Please supply a valid tag\n" "${OTEL_TAG}" + exit 1 + fi +fi +if [ -n "${CONTRIB_TAG}" ]; then + validate_tag "${CONTRIB_TAG}" || exit $? + TAG_FOUND=$(git tag --list "${CONTRIB_TAG}") + if [[ ${TAG_FOUND} = "${CONTRIB_TAG}" ]] ; then + printf "Tag %s already exists in this repo\n" "${CONTRIB_TAG}" + exit 1 + fi +else + CONTRIB_TAG=${OTEL_TAG} # if contrib_tag not specified, but OTEL_TAG is, then set it to OTEL_TAG +fi + +# Get version for contrib.go +OTEL_CONTRIB_VERSION=$(echo "${CONTRIB_TAG}" | egrep -o "${SEMVER_REGEX}") +# Strip leading v +OTEL_CONTRIB_VERSION="${OTEL_CONTRIB_VERSION#v}" + +cd "$(dirname "$0")" + +if ! git diff --quiet; then \ + printf "Working tree is not clean, can't proceed\n" + git status + git diff + exit 1 +fi + +# Update contrib.go version definition +cp contrib.go contrib.go.bak +sed "s/\(return \"\)[0-9]*\.[0-9]*\.[0-9]*\"/\1${OTEL_CONTRIB_VERSION}\"/" ./contrib.go.bak > ./contrib.go +rm -f ./contrib.go.bak + +declare -r BRANCH_NAME=pre_release_${CONTRIB_TAG} + +patch_gomods() { + local pkg_=$1 + local tag_=$2 + # now do the same for all the directories underneath + PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | egrep -v 'tools' | sed 's|^\.\/||' | sort) + # quote any '.' characters in the pkg name + local quoted_pkg_=${pkg_//./\\.} + for dir in $PACKAGE_DIRS; do + cp "${dir}/go.mod" "${dir}/go.mod.bak" + sed "s|${quoted_pkg_}\([^ ]*\) v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[^0-9]*.*$|${pkg_}\1 ${tag_}|" "${dir}/go.mod.bak" >"${dir}/go.mod" + rm -f "${dir}/go.mod.bak" + done +} + +# branch off from existing main +git checkout -b "${BRANCH_NAME}" main + +# Update go.mods +if [ -n "${OTEL_TAG}" ]; then + # first update the top most module + go get "go.opentelemetry.io/otel@${OTEL_TAG}" + patch_gomods go.opentelemetry.io/otel "${OTEL_TAG}" +fi + +if [ -n "${CONTRIB_TAG}" ]; then + patch_gomods go.opentelemetry.io/contrib "${CONTRIB_TAG}" +fi + +git diff +# Run lint to update go.sum +make lint + +# Add changes and commit. +git add . +make ci +# Check whether registry links are up to date +make registry-links-check + +declare COMMIT_MSG="" +if [ -n "${OTEL_TAG}" ]; then + COMMIT_MSG+="Bumping otel version to ${OTEL_TAG}" +fi +COMMIT_MSG+=". Prepare for releasing ${CONTRIB_TAG}" +git commit -m "${COMMIT_MSG}" + +printf "Now run following to verify the changes.\ngit diff main\n" +printf "\nThen push the changes to upstream\n" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/tag.sh b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/tag.sh new file mode 100644 index 000000000000..2a0ef1d26c23 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/tag.sh @@ -0,0 +1,178 @@ +#!/usr/bin/env bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +readonly PROGNAME=$(basename "$0") +readonly PROGDIR=$(readlink -m "$(dirname "$0")") + +readonly EXCLUDE_PACKAGES="tools" +readonly SEMVER_REGEX="v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?" + +usage() { + cat <<- EOF +Usage: $PROGNAME [OPTIONS] SEMVER_TAG COMMIT_HASH + +Creates git tag for all Go packages in project. + +OPTIONS: + -h --help Show this help. + +ARGUMENTS: + SEMVER_TAG Semantic version to tag with. + COMMIT_HASH Git commit hash to tag. +EOF +} + +cmdline() { + local arg commit + + for arg + do + local delim="" + case "$arg" in + # Translate long form options to short form. + --help) args="${args}-h ";; + # Pass through for everything else. + *) [[ "${arg:0:1}" == "-" ]] || delim="\"" + args="${args}${delim}${arg}${delim} ";; + esac + done + + # Reset and process short form options. + eval set -- "$args" + + while getopts "h" OPTION + do + case $OPTION in + h) + usage + exit 0 + ;; + *) + echo "unknown option: $OPTION" + usage + exit 1 + ;; + esac + done + + # Positional arguments. + shift $((OPTIND-1)) + readonly TAG="$1" + if [ -z "$TAG" ] + then + echo "missing SEMVER_TAG" + usage + exit 1 + fi + if [[ ! "$TAG" =~ $SEMVER_REGEX ]] + then + printf "invalid semantic version: %s\n" "$TAG" + exit 2 + fi + if [[ "$( git tag --list "$TAG" )" ]] + then + printf "tag already exists: %s\n" "$TAG" + exit 2 + fi + + shift + commit="$1" + if [ -z "$commit" ] + then + echo "missing COMMIT_HASH" + usage + exit 1 + fi + # Verify rev is for a commit and unify hashes into a complete SHA1. + readonly SHA="$( git rev-parse --quiet --verify "${commit}^{commit}" )" + if [ -z "$SHA" ] + then + printf "invalid commit hash: %s\n" "$commit" + exit 2 + fi + if [ "$( git merge-base "$SHA" HEAD )" != "$SHA" ] + then + printf "commit '%s' not found on this branch\n" "$commit" + exit 2 + fi +} + +package_dirs() { + # Return a list of package directories in the form: + # + # package/directory/a + # package/directory/b + # deeper/package/directory/a + # ... + # + # Making sure to exclude any packages in the EXCLUDE_PACKAGES regexp. + find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; \ + | grep -E -v "$EXCLUDE_PACKAGES" \ + | sed 's/^\.\///' \ + | sort +} + +git_tag() { + local tag="$1" + local commit="$2" + + git tag -a "$tag" -s -m "Version $tag" "$commit" +} + +previous_version() { + local current="$1" + + # Requires git > 2.0 + git tag -l --sort=v:refname \ + | grep -E "^${SEMVER_REGEX}$" \ + | grep -v "$current" \ + | tail -1 +} + +print_changes() { + local tag="$1" + local previous + + previous="$( previous_version "$tag" )" + if [ -n "$previous" ] + then + printf "\nRaw changes made between %s and %s\n" "$previous" "$tag" + printf "======================================\n" + git --no-pager log --pretty=oneline "${previous}..$tag" + fi +} + +main() { + local dir + + cmdline "$@" + + cd "$PROGDIR" || exit 3 + + # Create tag for root package. + git_tag "$TAG" "$SHA" + printf "created tag: %s\n" "$TAG" + + # Create tag for all sub-packages. + for dir in $( package_dirs ) + do + git_tag "${dir}/$TAG" "$SHA" + printf "created tag: %s\n" "${dir}/$TAG" + done + + print_changes "$TAG" +} +main "$@" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.gitignore b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.gitignore new file mode 100644 index 000000000000..69f09e575fce --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.gitignore @@ -0,0 +1,19 @@ +.DS_Store +Thumbs.db + +.tools/ +.idea/ +.vscode/ +*.iml +*.so +coverage.* + +gen/ + +/example/jaeger/jaeger +/example/namedtracer/namedtracer +/example/opencensus/opencensus +/example/prometheus/prometheus +/example/prom-collector/prom-collector +/example/zipkin/zipkin +/example/otel-collector/otel-collector diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.gitmodules b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.gitmodules new file mode 100644 index 000000000000..38a1f56982ba --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.gitmodules @@ -0,0 +1,3 @@ +[submodule "opentelemetry-proto"] + path = exporters/otlp/internal/opentelemetry-proto + url = https://github.com/open-telemetry/opentelemetry-proto diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.golangci.yml b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.golangci.yml new file mode 100644 index 000000000000..2ef168198c27 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.golangci.yml @@ -0,0 +1,32 @@ +# See https://github.com/golangci/golangci-lint#config-file +run: + issues-exit-code: 1 #Default + tests: true #Default + +linters: + enable: + - misspell + - goimports + - golint + - gofmt + +issues: + exclude-rules: + # helpers in tests often (rightfully) pass a *testing.T as their first argument + - path: _test\.go + text: "context.Context should be the first parameter of a function" + linters: + - golint + # Yes, they are, but it's okay in a test + - path: _test\.go + text: "exported func.*returns unexported type.*which can be annoying to use" + linters: + - golint + +linters-settings: + misspell: + locale: US + ignore-words: + - cancelled + goimports: + local-prefixes: go.opentelemetry.io diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/CHANGELOG.md new file mode 100644 index 000000000000..2702ccda2550 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -0,0 +1,1319 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +### Changed + +### Deprecated + +### Removed + +### Fixed + +### Security + +## [0.20.0] - 2021-04-23 + +### Added + +- The OTLP exporter now has two new convenience functions, `NewExportPipeline` and `InstallNewPipeline`, setup and install the exporter in tracing and metrics pipelines. (#1373) +- Adds semantic conventions for exceptions. (#1492) +- Added Jaeger Environment variables: `OTEL_EXPORTER_JAEGER_AGENT_HOST`, `OTEL_EXPORTER_JAEGER_AGENT_PORT` + These environment variables can be used to override Jaeger agent hostname and port (#1752) +- Option `ExportTimeout` was added to batch span processor. (#1755) +- `trace.TraceFlags` is now a defined type over `byte` and `WithSampled(bool) TraceFlags` and `IsSampled() bool` methods have been added to it. (#1770) +- The `Event` and `Link` struct types from the `go.opentelemetry.io/otel` package now include a `DroppedAttributeCount` field to record the number of attributes that were not recorded due to configured limits being reached. (#1771) +- The Jaeger exporter now reports dropped attributes for a Span event in the exported log. (#1771) +- Adds test to check BatchSpanProcessor ignores `OnEnd` and `ForceFlush` post `Shutdown`. (#1772) +- Extract resource attributes from the `OTEL_RESOURCE_ATTRIBUTES` environment variable and merge them with the `resource.Default` resource as well as resources provided to the `TracerProvider` and metric `Controller`. (#1785) +- Added `WithOSType` resource configuration option to set OS (Operating System) type resource attribute (`os.type`). (#1788) +- Added `WithProcess*` resource configuration options to set Process resource attributes. (#1788) + - `process.pid` + - `process.executable.name` + - `process.executable.path` + - `process.command_args` + - `process.owner` + - `process.runtime.name` + - `process.runtime.version` + - `process.runtime.description` +- Adds `k8s.node.name` and `k8s.node.uid` attribute keys to the `semconv` package. (#1789) +- Added support for configuring OTLP/HTTP and OTLP/gRPC Endpoints, TLS Certificates, Headers, Compression and Timeout via Environment Variables. (#1758, #1769 and #1811) + - `OTEL_EXPORTER_OTLP_ENDPOINT` + - `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` + - `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` + - `OTEL_EXPORTER_OTLP_HEADERS` + - `OTEL_EXPORTER_OTLP_TRACES_HEADERS` + - `OTEL_EXPORTER_OTLP_METRICS_HEADERS` + - `OTEL_EXPORTER_OTLP_COMPRESSION` + - `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` + - `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` + - `OTEL_EXPORTER_OTLP_TIMEOUT` + - `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` + - `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` + - `OTEL_EXPORTER_OTLP_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE` +- Adds `otlpgrpc.WithTimeout` option for configuring timeout to the otlp/gRPC exporter. (#1821) + +### Fixed + +- The `Span.IsRecording` implementation from `go.opentelemetry.io/otel/sdk/trace` always returns false when not being sampled. (#1750) +- The Jaeger exporter now correctly sets tags for the Span status code and message. + This means it uses the correct tag keys (`"otel.status_code"`, `"otel.status_description"`) and does not set the status message as a tag unless it is set on the span. (#1761) +- The Jaeger exporter now correctly records Span event's names using the `"event"` key for a tag. + Additionally, this tag is overridden, as specified in the OTel specification, if the event contains an attribute with that key. (#1768) +- Zipkin Exporter: Ensure mapping between OTel and Zipkin span data complies with the specification. (#1688) +- Fixed typo for default service name in Jaeger Exporter. (#1797) +- Fix flaky OTLP for the reconnnection of the client connection. (#1527, #1814) + +### Changed + +- Span `RecordError` now records an `exception` event to comply with the semantic convention specification. (#1492) +- Jaeger exporter was updated to use thrift v0.14.1. (#1712) +- Migrate from using internally built and maintained version of the OTLP to the one hosted at `go.opentelemetry.io/proto/otlp`. (#1713) +- Migrate from using `github.com/gogo/protobuf` to `google.golang.org/protobuf` to match `go.opentelemetry.io/proto/otlp`. (#1713) +- The storage of a local or remote Span in a `context.Context` using its SpanContext is unified to store just the current Span. + The Span's SpanContext can now self-identify as being remote or not. + This means that `"go.opentelemetry.io/otel/trace".ContextWithRemoteSpanContext` will now overwrite any existing current Span, not just existing remote Spans, and make it the current Span in a `context.Context`. (#1731) +- Improve OTLP/gRPC exporter connection errors. (#1737) +- Information about a parent span context in a `"go.opentelemetry.io/otel/export/trace".SpanSnapshot` is unified in a new `Parent` field. + The existing `ParentSpanID` and `HasRemoteParent` fields are removed in favor of this. (#1748) +- The `ParentContext` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is updated to hold a `context.Context` containing the parent span. + This changes it to make `SamplingParameters` conform with the OpenTelemetry specification. (#1749) +- Updated Jaeger Environment Variables: `JAEGER_ENDPOINT`, `JAEGER_USER`, `JAEGER_PASSWORD` + to `OTEL_EXPORTER_JAEGER_ENDPOINT`, `OTEL_EXPORTER_JAEGER_USER`, `OTEL_EXPORTER_JAEGER_PASSWORD` + in compliance with OTel spec (#1752) +- Modify `BatchSpanProcessor.ForceFlush` to abort after timeout/cancellation. (#1757) +- The `DroppedAttributeCount` field of the `Span` in the `go.opentelemetry.io/otel` package now only represents the number of attributes dropped for the span itself. + It no longer is a conglomerate of itself, events, and link attributes that have been dropped. (#1771) +- Make `ExportSpans` in Jaeger Exporter honor context deadline. (#1773) +- Modify Zipkin Exporter default service name, use default resouce's serviceName instead of empty. (#1777) +- The `go.opentelemetry.io/otel/sdk/export/trace` package is merged into the `go.opentelemetry.io/otel/sdk/trace` package. (#1778) +- The prometheus.InstallNewPipeline example is moved from comment to example test (#1796) +- The convenience functions for the stdout exporter have been updated to return the `TracerProvider` implementation and enable the shutdown of the exporter. (#1800) +- Replace the flush function returned from the Jaeger exporter's convenience creation functions (`InstallNewPipeline` and `NewExportPipeline`) with the `TracerProvider` implementation they create. + This enables the caller to shutdown and flush using the related `TracerProvider` methods. (#1822) +- Updated the Jaeger exporter to have a default enpoint, `http://localhost:14250`, for the collector. (#1824) +- Changed the function `WithCollectorEndpoint` in the Jaeger exporter to no longer accept an endpoint as an argument. + The endpoint can be passed with the `CollectorEndpointOption` using the `WithEndpoint` function or by setting the `OTEL_EXPORTER_JAEGER_ENDPOINT` environment variable value appropriately. (#1824) +- The Jaeger exporter no longer batches exported spans itself, instead it relies on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter creation functions (`NewRawExporter`, `NewExportPipeline`, and `InstallNewPipeline`) no longer accept the removed `Option` type as a variadic argument. (#1830) + +### Removed + +- Removed Jaeger Environment variables: `JAEGER_SERVICE_NAME`, `JAEGER_DISABLED`, `JAEGER_TAGS` + These environment variables will no longer be used to override values of the Jaeger exporter (#1752) +- No longer set the links for a `Span` in `go.opentelemetry.io/otel/sdk/trace` that is configured to be a new root. + This is unspecified behavior that the OpenTelemetry community plans to standardize in the future. + To prevent backwards incompatible changes when it is specified, these links are removed. (#1726) +- Setting error status while recording error with Span from oteltest package. (#1729) +- The concept of a remote and local Span stored in a context is unified to just the current Span. + Because of this `"go.opentelemetry.io/otel/trace".RemoteSpanContextFromContext` is removed as it is no longer needed. + Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContex` can be used to return the current Span. + If needed, that Span's `SpanContext.IsRemote()` can then be used to determine if it is remote or not. (#1731) +- The `HasRemoteParent` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is removed. + This field is redundant to the information returned from the `Remote` method of the `SpanContext` held in the `ParentContext` field. (#1749) +- The `trace.FlagsDebug` and `trace.FlagsDeferred` constants have been removed and will be localized to the B3 propagator. (#1770) +- Remove `Process` configuration, `WithProcessFromEnv` and `ProcessFromEnv`, and type from the Jaeger exporter package. + The information that could be configured in the `Process` struct should be configured in a `Resource` instead. (#1776, #1804) +- Remove the `WithDisabled` option from the Jaeger exporter. + To disable the exporter unregister it from the `TracerProvider` or use a no-operation `TracerProvider`. (#1806) +- Removed the functions `CollectorEndpointFromEnv` and `WithCollectorEndpointOptionFromEnv` from the Jaeger exporter. + These functions for retrieving specific environment variable values are redundant of other internal functions and + are not intended for end user use. (#1824) +- Removed the Jaeger exporter `WithSDKOptions` `Option`. + This option was used to set SDK options for the exporter creation convenience functions. + These functions are provided as a way to easily setup or install the exporter with what are deemed reasonable SDK settings for common use cases. + If the SDK needs to be configured differently, the `NewRawExporter` function and direct setup of the SDK with the desired settings should be used. (#1825) +- The `WithBufferMaxCount` and `WithBatchMaxCount` `Option`s from the Jaeger exporter are removed. + The exporter no longer batches exports, instead relying on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter `Option` type is removed. + The type is no longer used by the exporter to configure anything. + All of the previous configuration these options provided were duplicates of SDK configuration. + They have all been removed in favor of using the SDK configuration and focuses the exporter configuration to be only about the endpoints it will send telemetry to. (#1830) + +## [0.19.0] - 2021-03-18 + +### Added + +- Added `Marshaler` config option to `otlphttp` to enable otlp over json or protobufs. (#1586) +- A `ForceFlush` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` to flush all registered `SpanProcessor`s. (#1608) +- Added `WithSampler` and `WithSpanLimits` to tracer provider. (#1633, #1702) +- `"go.opentelemetry.io/otel/trace".SpanContext` now has a `remote` property, and `IsRemote()` predicate, that is true when the `SpanContext` has been extracted from remote context data. (#1701) +- A `Valid` method to the `"go.opentelemetry.io/otel/attribute".KeyValue` type. (#1703) + +### Changed + +- `trace.SpanContext` is now immutable and has no exported fields. (#1573) + - `trace.NewSpanContext()` can be used in conjunction with the `trace.SpanContextConfig` struct to initialize a new `SpanContext` where all values are known. +- Update the `ForceFlush` method signature to the `"go.opentelemetry.io/otel/sdk/trace".SpanProcessor` to accept a `context.Context` and return an error. (#1608) +- Update the `Shutdown` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` return an error on shutdown failure. (#1608) +- The SimpleSpanProcessor will now shut down the enclosed `SpanExporter` and gracefully ignore subsequent calls to `OnEnd` after `Shutdown` is called. (#1612) +- `"go.opentelemetry.io/sdk/metric/controller.basic".WithPusher` is replaced with `WithExporter` to provide consistent naming across project. (#1656) +- Added non-empty string check for trace `Attribute` keys. (#1659) +- Add `description` to SpanStatus only when `StatusCode` is set to error. (#1662) +- Jaeger exporter falls back to `resource.Default`'s `service.name` if the exported Span does not have one. (#1673) +- Jaeger exporter populates Jaeger's Span Process from Resource. (#1673) +- Renamed the `LabelSet` method of `"go.opentelemetry.io/otel/sdk/resource".Resource` to `Set`. (#1692) +- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1693) +- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1693) + +### Removed + +- Removed `serviceName` parameter from Zipkin exporter and uses resource instead. (#1549) +- Removed `WithConfig` from tracer provider to avoid overriding configuration. (#1633) +- Removed the exported `SimpleSpanProcessor` and `BatchSpanProcessor` structs. + These are now returned as a SpanProcessor interface from their respective constructors. (#1638) +- Removed `WithRecord()` from `trace.SpanOption` when creating a span. (#1660) +- Removed setting status to `Error` while recording an error as a span event in `RecordError`. (#1663) +- Removed `jaeger.WithProcess` configuration option. (#1673) +- Removed `ApplyConfig` method from `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` and the now unneeded `Config` struct. (#1693) + +### Fixed + +- Jaeger Exporter: Ensure mapping between OTEL and Jaeger span data complies with the specification. (#1626) +- `SamplingResult.TraceState` is correctly propagated to a newly created span's `SpanContext`. (#1655) +- The `otel-collector` example now correctly flushes metric events prior to shutting down the exporter. (#1678) +- Do not set span status message in `SpanStatusFromHTTPStatusCode` if it can be inferred from `http.status_code`. (#1681) +- Synchronization issues in global trace delegate implementation. (#1686) +- Reduced excess memory usage by global `TracerProvider`. (#1687) + +## [0.18.0] - 2021-03-03 + +### Added + +- Added `resource.Default()` for use with meter and tracer providers. (#1507) +- `AttributePerEventCountLimit` and `AttributePerLinkCountLimit` for `SpanLimits`. (#1535) +- Added `Keys()` method to `propagation.TextMapCarrier` and `propagation.HeaderCarrier` to adapt `http.Header` to this interface. (#1544) +- Added `code` attributes to `go.opentelemetry.io/otel/semconv` package. (#1558) +- Compatibility testing suite in the CI system for the following systems. (#1567) + | OS | Go Version | Architecture | + | ------- | ---------- | ------------ | + | Ubuntu | 1.15 | amd64 | + | Ubuntu | 1.14 | amd64 | + | Ubuntu | 1.15 | 386 | + | Ubuntu | 1.14 | 386 | + | MacOS | 1.15 | amd64 | + | MacOS | 1.14 | amd64 | + | Windows | 1.15 | amd64 | + | Windows | 1.14 | amd64 | + | Windows | 1.15 | 386 | + | Windows | 1.14 | 386 | + +### Changed + +- Replaced interface `oteltest.SpanRecorder` with its existing implementation + `StandardSpanRecorder`. (#1542) +- Default span limit values to 128. (#1535) +- Rename `MaxEventsPerSpan`, `MaxAttributesPerSpan` and `MaxLinksPerSpan` to `EventCountLimit`, `AttributeCountLimit` and `LinkCountLimit`, and move these fields into `SpanLimits`. (#1535) +- Renamed the `otel/label` package to `otel/attribute`. (#1541) +- Vendor the Jaeger exporter's dependency on Apache Thrift. (#1551) +- Parallelize the CI linting and testing. (#1567) +- Stagger timestamps in exact aggregator tests. (#1569) +- Changed all examples to use `WithBatchTimeout(5 * time.Second)` rather than `WithBatchTimeout(5)`. (#1621) +- Prevent end-users from implementing some interfaces (#1575) +``` + "otel/exporters/otlp/otlphttp".Option + "otel/exporters/stdout".Option + "otel/oteltest".Option + "otel/trace".TracerOption + "otel/trace".SpanOption + "otel/trace".EventOption + "otel/trace".LifeCycleOption + "otel/trace".InstrumentationOption + "otel/sdk/resource".Option + "otel/sdk/trace".ParentBasedSamplerOption + "otel/sdk/trace".ReadOnlySpan + "otel/sdk/trace".ReadWriteSpan +``` +### Removed + +- Removed attempt to resample spans upon changing the span name with `span.SetName()`. (#1545) +- The `test-benchmark` is no longer a dependency of the `precommit` make target. (#1567) +- Removed the `test-386` make target. + This was replaced with a full compatibility testing suite (i.e. multi OS/arch) in the CI system. (#1567) + +### Fixed + +- The sequential timing check of timestamps in the stdout exporter are now setup explicitly to be sequential (#1571). (#1572) +- Windows build of Jaeger tests now compiles with OS specific functions (#1576). (#1577) +- The sequential timing check of timestamps of go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue are now setup explicitly to be sequential (#1578). (#1579) +- Validate tracestate header keys with vendors according to the W3C TraceContext specification (#1475). (#1581) +- The OTLP exporter includes related labels for translations of a GaugeArray (#1563). (#1570) + +## [0.17.0] - 2021-02-12 + +### Changed + +- Rename project default branch from `master` to `main`. (#1505) +- Reverse order in which `Resource` attributes are merged, per change in spec. (#1501) +- Add tooling to maintain "replace" directives in go.mod files automatically. (#1528) +- Create new modules: otel/metric, otel/trace, otel/oteltest, otel/sdk/export/metric, otel/sdk/metric (#1528) +- Move metric-related public global APIs from otel to otel/metric/global. (#1528) + +## Fixed + +- Fixed otlpgrpc reconnection issue. +- The example code in the README.md of `go.opentelemetry.io/otel/exporters/otlp` is moved to a compiled example test and used the new `WithAddress` instead of `WithEndpoint`. (#1513) +- The otel-collector example now uses the default OTLP receiver port of the collector. + +## [0.16.0] - 2021-01-13 + +### Added + +- Add the `ReadOnlySpan` and `ReadWriteSpan` interfaces to provide better control for accessing span data. (#1360) +- `NewGRPCDriver` function returns a `ProtocolDriver` that maintains a single gRPC connection to the collector. (#1369) +- Added documentation about the project's versioning policy. (#1388) +- Added `NewSplitDriver` for OTLP exporter that allows sending traces and metrics to different endpoints. (#1418) +- Added codeql worfklow to GitHub Actions (#1428) +- Added Gosec workflow to GitHub Actions (#1429) +- Add new HTTP driver for OTLP exporter in `exporters/otlp/otlphttp`. Currently it only supports the binary protobuf payloads. (#1420) +- Add an OpenCensus exporter bridge. (#1444) + +### Changed + +- Rename `internal/testing` to `internal/internaltest`. (#1449) +- Rename `export.SpanData` to `export.SpanSnapshot` and use it only for exporting spans. (#1360) +- Store the parent's full `SpanContext` rather than just its span ID in the `span` struct. (#1360) +- Improve span duration accuracy. (#1360) +- Migrated CI/CD from CircleCI to GitHub Actions (#1382) +- Remove duplicate checkout from GitHub Actions workflow (#1407) +- Metric `array` aggregator renamed `exact` to match its `aggregation.Kind` (#1412) +- Metric `exact` aggregator includes per-point timestamps (#1412) +- Metric stdout exporter uses MinMaxSumCount aggregator for ValueRecorder instruments (#1412) +- `NewExporter` from `exporters/otlp` now takes a `ProtocolDriver` as a parameter. (#1369) +- Many OTLP Exporter options became gRPC ProtocolDriver options. (#1369) +- Unify endpoint API that related to OTel exporter. (#1401) +- Optimize metric histogram aggregator to re-use its slice of buckets. (#1435) +- Metric aggregator Count() and histogram Bucket.Counts are consistently `uint64`. (1430) +- Histogram aggregator accepts functional options, uses default boundaries if none given. (#1434) +- `SamplingResult` now passed a `Tracestate` from the parent `SpanContext` (#1432) +- Moved gRPC driver for OTLP exporter to `exporters/otlp/otlpgrpc`. (#1420) +- The `TraceContext` propagator now correctly propagates `TraceState` through the `SpanContext`. (#1447) +- Metric Push and Pull Controller components are combined into a single "basic" Controller: + - `WithExporter()` and `Start()` to configure Push behavior + - `Start()` is optional; use `Collect()` and `ForEach()` for Pull behavior + - `Start()` and `Stop()` accept Context. (#1378) +- The `Event` type is moved from the `otel/sdk/export/trace` package to the `otel/trace` API package. (#1452) + +### Removed + +- Remove `errUninitializedSpan` as its only usage is now obsolete. (#1360) +- Remove Metric export functionality related to quantiles and summary data points: this is not specified (#1412) +- Remove DDSketch metric aggregator; our intention is to re-introduce this as an option of the histogram aggregator after [new OTLP histogram data types](https://github.com/open-telemetry/opentelemetry-proto/pull/226) are released (#1412) + +### Fixed + +- `BatchSpanProcessor.Shutdown()` will now shutdown underlying `export.SpanExporter`. (#1443) + +## [0.15.0] - 2020-12-10 + +### Added + +- The `WithIDGenerator` `TracerProviderOption` is added to the `go.opentelemetry.io/otel/trace` package to configure an `IDGenerator` for the `TracerProvider`. (#1363) + +### Changed + +- The Zipkin exporter now uses the Span status code to determine. (#1328) +- `NewExporter` and `Start` functions in `go.opentelemetry.io/otel/exporters/otlp` now receive `context.Context` as a first parameter. (#1357) +- Move the OpenCensus example into `example` directory. (#1359) +- Moved the SDK's `internal.IDGenerator` interface in to the `sdk/trace` package to enable support for externally-defined ID generators. (#1363) +- Bump `github.com/google/go-cmp` from 0.5.3 to 0.5.4 (#1374) +- Bump `github.com/golangci/golangci-lint` in `/internal/tools` (#1375) + +### Fixed + +- Metric SDK `SumObserver` and `UpDownSumObserver` instruments correctness fixes. (#1381) + +## [0.14.0] - 2020-11-19 + +### Added + +- An `EventOption` and the related `NewEventConfig` function are added to the `go.opentelemetry.io/otel` package to configure Span events. (#1254) +- A `TextMapPropagator` and associated `TextMapCarrier` are added to the `go.opentelemetry.io/otel/oteltest` package to test `TextMap` type propagators and their use. (#1259) +- `SpanContextFromContext` returns `SpanContext` from context. (#1255) +- `TraceState` has been added to `SpanContext`. (#1340) +- `DeploymentEnvironmentKey` added to `go.opentelemetry.io/otel/semconv` package. (#1323) +- Add an OpenCensus to OpenTelemetry tracing bridge. (#1305) +- Add a parent context argument to `SpanProcessor.OnStart` to follow the specification. (#1333) +- Add missing tests for `sdk/trace/attributes_map.go`. (#1337) + +### Changed + +- Move the `go.opentelemetry.io/otel/api/trace` package into `go.opentelemetry.io/otel/trace` with the following changes. (#1229) (#1307) + - `ID` has been renamed to `TraceID`. + - `IDFromHex` has been renamed to `TraceIDFromHex`. + - `EmptySpanContext` is removed. +- Move the `go.opentelemetry.io/otel/api/trace/tracetest` package into `go.opentelemetry.io/otel/oteltest`. (#1229) +- OTLP Exporter updates: + - supports OTLP v0.6.0 (#1230, #1354) + - supports configurable aggregation temporality (default: Cumulative, optional: Stateless). (#1296) +- The Sampler is now called on local child spans. (#1233) +- The `Kind` type from the `go.opentelemetry.io/otel/api/metric` package was renamed to `InstrumentKind` to more specifically describe what it is and avoid semantic ambiguity. (#1240) +- The `MetricKind` method of the `Descriptor` type in the `go.opentelemetry.io/otel/api/metric` package was renamed to `Descriptor.InstrumentKind`. + This matches the returned type and fixes misuse of the term metric. (#1240) +- Move test harness from the `go.opentelemetry.io/otel/api/apitest` package into `go.opentelemetry.io/otel/oteltest`. (#1241) +- Move the `go.opentelemetry.io/otel/api/metric/metrictest` package into `go.opentelemetry.io/oteltest` as part of #964. (#1252) +- Move the `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric` as part of #1303. (#1321) +- Move the `go.opentelemetry.io/otel/api/metric/registry` package into `go.opentelemetry.io/otel/metric/registry` as a part of #1303. (#1316) +- Move the `Number` type (together with related functions) from `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric/number` as a part of #1303. (#1316) +- The function signature of the Span `AddEvent` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required name and a variable number of `EventOption`s. (#1254) +- The function signature of the Span `RecordError` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required error value and a variable number of `EventOption`s. (#1254) +- Move the `go.opentelemetry.io/otel/api/global` package to `go.opentelemetry.io/otel`. (#1262) (#1330) +- Move the `Version` function from `go.opentelemetry.io/otel/sdk` to `go.opentelemetry.io/otel`. (#1330) +- Rename correlation context header from `"otcorrelations"` to `"baggage"` to match the OpenTelemetry specification. (#1267) +- Fix `Code.UnmarshalJSON` to work with valid JSON only. (#1276) +- The `resource.New()` method changes signature to support builtin attributes and functional options, including `telemetry.sdk.*` and + `host.name` semantic conventions; the former method is renamed `resource.NewWithAttributes`. (#1235) +- The Prometheus exporter now exports non-monotonic counters (i.e. `UpDownCounter`s) as gauges. (#1210) +- Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310) +- Updated span collection limits for attribute, event and link counts to 1000 (#1318) +- Renamed `semconv.HTTPUrlKey` to `semconv.HTTPURLKey`. (#1338) + +### Removed + +- The `ErrInvalidHexID`, `ErrInvalidTraceIDLength`, `ErrInvalidSpanIDLength`, `ErrInvalidSpanIDLength`, or `ErrNilSpanID` from the `go.opentelemetry.io/otel` package are unexported now. (#1243) +- The `AddEventWithTimestamp` method on the `Span` interface in `go.opentelemetry.io/otel` is removed due to its redundancy. + It is replaced by using the `AddEvent` method with a `WithTimestamp` option. (#1254) +- The `MockSpan` and `MockTracer` types are removed from `go.opentelemetry.io/otel/oteltest`. + `Tracer` and `Span` from the same module should be used in their place instead. (#1306) +- `WorkerCount` option is removed from `go.opentelemetry.io/otel/exporters/otlp`. (#1350) +- Remove the following labels types: INT32, UINT32, UINT64 and FLOAT32. (#1314) + +### Fixed + +- Rename `MergeItererator` to `MergeIterator` in the `go.opentelemetry.io/otel/label` package. (#1244) +- The `go.opentelemetry.io/otel/api/global` packages global TextMapPropagator now delegates functionality to a globally set delegate for all previously returned propagators. (#1258) +- Fix condition in `label.Any`. (#1299) +- Fix global `TracerProvider` to pass options to its configured provider. (#1329) +- Fix missing handler for `ExactKind` aggregator in OTLP metrics transformer (#1309) + +## [0.13.0] - 2020-10-08 + +### Added + +- OTLP Metric exporter supports Histogram aggregation. (#1209) +- The `Code` struct from the `go.opentelemetry.io/otel/codes` package now supports JSON marshaling and unmarshaling as well as implements the `Stringer` interface. (#1214) +- A Baggage API to implement the OpenTelemetry specification. (#1217) +- Add Shutdown method to sdk/trace/provider, shutdown processors in the order they were registered. (#1227) + +### Changed + +- Set default propagator to no-op propagator. (#1184) +- The `HTTPSupplier`, `HTTPExtractor`, `HTTPInjector`, and `HTTPPropagator` from the `go.opentelemetry.io/otel/api/propagation` package were replaced with unified `TextMapCarrier` and `TextMapPropagator` in the `go.opentelemetry.io/otel/propagation` package. (#1212) (#1325) +- The `New` function from the `go.opentelemetry.io/otel/api/propagation` package was replaced with `NewCompositeTextMapPropagator` in the `go.opentelemetry.io/otel` package. (#1212) +- The status codes of the `go.opentelemetry.io/otel/codes` package have been updated to match the latest OpenTelemetry specification. + They now are `Unset`, `Error`, and `Ok`. + They no longer track the gRPC codes. (#1214) +- The `StatusCode` field of the `SpanData` struct in the `go.opentelemetry.io/otel/sdk/export/trace` package now uses the codes package from this package instead of the gRPC project. (#1214) +- Move the `go.opentelemetry.io/otel/api/baggage` package into `go.opentelemetry.io/otel/baggage`. (#1217) (#1325) +- A `Shutdown` method of `SpanProcessor` and all its implementations receives a context and returns an error. (#1264) + +### Fixed + +- Copies of data from arrays and slices passed to `go.opentelemetry.io/otel/label.ArrayValue()` are now used in the returned `Value` instead of using the mutable data itself. (#1226) + +### Removed + +- The `ExtractHTTP` and `InjectHTTP` functions from the `go.opentelemetry.io/otel/api/propagation` package were removed. (#1212) +- The `Propagators` interface from the `go.opentelemetry.io/otel/api/propagation` package was removed to conform to the OpenTelemetry specification. + The explicit `TextMapPropagator` type can be used in its place as this is the `Propagator` type the specification defines. (#1212) +- The `SetAttribute` method of the `Span` from the `go.opentelemetry.io/otel/api/trace` package was removed given its redundancy with the `SetAttributes` method. (#1216) +- The internal implementation of Baggage storage is removed in favor of using the new Baggage API functionality. (#1217) +- Remove duplicate hostname key `HostHostNameKey` in Resource semantic conventions. (#1219) +- Nested array/slice support has been removed. (#1226) + +## [0.12.0] - 2020-09-24 + +### Added + +- A `SpanConfigure` function in `go.opentelemetry.io/otel/api/trace` to create a new `SpanConfig` from `SpanOption`s. (#1108) +- In the `go.opentelemetry.io/otel/api/trace` package, `NewTracerConfig` was added to construct new `TracerConfig`s. + This addition was made to conform with our project option conventions. (#1155) +- Instrumentation library information was added to the Zipkin exporter. (#1119) +- The `SpanProcessor` interface now has a `ForceFlush()` method. (#1166) +- More semantic conventions for k8s as resource attributes. (#1167) + +### Changed + +- Add reconnecting udp connection type to Jaeger exporter. + This change adds a new optional implementation of the udp conn interface used to detect changes to an agent's host dns record. + It then adopts the new destination address to ensure the exporter doesn't get stuck. This change was ported from jaegertracing/jaeger-client-go#520. (#1063) +- Replace `StartOption` and `EndOption` in `go.opentelemetry.io/otel/api/trace` with `SpanOption`. + This change is matched by replacing the `StartConfig` and `EndConfig` with a unified `SpanConfig`. (#1108) +- Replace the `LinkedTo` span option in `go.opentelemetry.io/otel/api/trace` with `WithLinks`. + This is be more consistent with our other option patterns, i.e. passing the item to be configured directly instead of its component parts, and provides a cleaner function signature. (#1108) +- The `go.opentelemetry.io/otel/api/trace` `TracerOption` was changed to an interface to conform to project option conventions. (#1109) +- Move the `B3` and `TraceContext` from within the `go.opentelemetry.io/otel/api/trace` package to their own `go.opentelemetry.io/otel/propagators` package. + This removal of the propagators is reflective of the OpenTelemetry specification for these propagators as well as cleans up the `go.opentelemetry.io/otel/api/trace` API. (#1118) +- Rename Jaeger tags used for instrumentation library information to reflect changes in OpenTelemetry specification. (#1119) +- Rename `ProbabilitySampler` to `TraceIDRatioBased` and change semantics to ignore parent span sampling status. (#1115) +- Move `tools` package under `internal`. (#1141) +- Move `go.opentelemetry.io/otel/api/correlation` package to `go.opentelemetry.io/otel/api/baggage`. (#1142) + The `correlation.CorrelationContext` propagator has been renamed `baggage.Baggage`. Other exported functions and types are unchanged. +- Rename `ParentOrElse` sampler to `ParentBased` and allow setting samplers depending on parent span. (#1153) +- In the `go.opentelemetry.io/otel/api/trace` package, `SpanConfigure` was renamed to `NewSpanConfig`. (#1155) +- Change `dependabot.yml` to add a `Skip Changelog` label to dependabot-sourced PRs. (#1161) +- The [configuration style guide](https://github.com/open-telemetry/opentelemetry-go/blob/master/CONTRIBUTING.md#config) has been updated to + recommend the use of `newConfig()` instead of `configure()`. (#1163) +- The `otlp.Config` type has been unexported and changed to `otlp.config`, along with its initializer. (#1163) +- Ensure exported interface types include parameter names and update the + Style Guide to reflect this styling rule. (#1172) +- Don't consider unset environment variable for resource detection to be an error. (#1170) +- Rename `go.opentelemetry.io/otel/api/metric.ConfigureInstrument` to `NewInstrumentConfig` and + `go.opentelemetry.io/otel/api/metric.ConfigureMeter` to `NewMeterConfig`. +- ValueObserver instruments use LastValue aggregator by default. (#1165) +- OTLP Metric exporter supports LastValue aggregation. (#1165) +- Move the `go.opentelemetry.io/otel/api/unit` package to `go.opentelemetry.io/otel/unit`. (#1185) +- Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) +- Rename `NoopProvider` to `NoopMeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) +- Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metric/metrictest` package. (#1190) +- Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric/registry` package. (#1190) +- Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metri/registryc` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) +- Rename `NoopProvider` to `NoopTracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) +- Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) +- Rename `WrapperProvider` to `WrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) +- Rename `NewWrapperProvider` to `NewWrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) +- Rename `Provider` method of the pull controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/pull` package. (#1190) +- Rename `Provider` method of the push controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/push` package. (#1190) +- Rename `ProviderOptions` to `TracerProviderConfig` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `ProviderOption` to `TracerProviderOption` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Renamed `SamplingDecision` values to comply with OpenTelemetry specification change. (#1192) +- Renamed Zipkin attribute names from `ot.status_code & ot.status_description` to `otel.status_code & otel.status_description`. (#1201) +- The default SDK now invokes registered `SpanProcessor`s in the order they were registered with the `TracerProvider`. (#1195) +- Add test of spans being processed by the `SpanProcessor`s in the order they were registered. (#1203) + +### Removed + +- Remove the B3 propagator from `go.opentelemetry.io/otel/propagators`. It is now located in the + `go.opentelemetry.io/contrib/propagators/` module. (#1191) +- Remove the semantic convention for HTTP status text, `HTTPStatusTextKey` from package `go.opentelemetry.io/otel/semconv`. (#1194) + +### Fixed + +- Zipkin example no longer mentions `ParentSampler`, corrected to `ParentBased`. (#1171) +- Fix missing shutdown processor in otel-collector example. (#1186) +- Fix missing shutdown processor in basic and namedtracer examples. (#1197) + +## [0.11.0] - 2020-08-24 + +### Added + +- Support for exporting array-valued attributes via OTLP. (#992) +- `Noop` and `InMemory` `SpanBatcher` implementations to help with testing integrations. (#994) +- Support for filtering metric label sets. (#1047) +- A dimensionality-reducing metric Processor. (#1057) +- Integration tests for more OTel Collector Attribute types. (#1062) +- A new `WithSpanProcessor` `ProviderOption` is added to the `go.opentelemetry.io/otel/sdk/trace` package to create a `Provider` and automatically register the `SpanProcessor`. (#1078) + +### Changed + +- Rename `sdk/metric/processor/test` to `sdk/metric/processor/processortest`. (#1049) +- Rename `sdk/metric/controller/test` to `sdk/metric/controller/controllertest`. (#1049) +- Rename `api/testharness` to `api/apitest`. (#1049) +- Rename `api/trace/testtrace` to `api/trace/tracetest`. (#1049) +- Change Metric Processor to merge multiple observations. (#1024) +- The `go.opentelemetry.io/otel/bridge/opentracing` bridge package has been made into its own module. + This removes the package dependencies of this bridge from the rest of the OpenTelemetry based project. (#1038) +- Renamed `go.opentelemetry.io/otel/api/standard` package to `go.opentelemetry.io/otel/semconv` to avoid the ambiguous and generic name `standard` and better describe the package as containing OpenTelemetry semantic conventions. (#1016) +- The environment variable used for resource detection has been changed from `OTEL_RESOURCE_LABELS` to `OTEL_RESOURCE_ATTRIBUTES` (#1042) +- Replace `WithSyncer` with `WithBatcher` in examples. (#1044) +- Replace the `google.golang.org/grpc/codes` dependency in the API with an equivalent `go.opentelemetry.io/otel/codes` package. (#1046) +- Merge the `go.opentelemetry.io/otel/api/label` and `go.opentelemetry.io/otel/api/kv` into the new `go.opentelemetry.io/otel/label` package. (#1060) +- Unify Callback Function Naming. + Rename `*Callback` with `*Func`. (#1061) +- CI builds validate against last two versions of Go, dropping 1.13 and adding 1.15. (#1064) +- The `go.opentelemetry.io/otel/sdk/export/trace` interfaces `SpanSyncer` and `SpanBatcher` have been replaced with a specification compliant `Exporter` interface. + This interface still supports the export of `SpanData`, but only as a slice. + Implementation are also required now to return any error from `ExportSpans` if one occurs as well as implement a `Shutdown` method for exporter clean-up. (#1078) +- The `go.opentelemetry.io/otel/sdk/trace` `NewBatchSpanProcessor` function no longer returns an error. + If a `nil` exporter is passed as an argument to this function, instead of it returning an error, it now returns a `BatchSpanProcessor` that handles the export of `SpanData` by not taking any action. (#1078) +- The `go.opentelemetry.io/otel/sdk/trace` `NewProvider` function to create a `Provider` no longer returns an error, instead only a `*Provider`. + This change is related to `NewBatchSpanProcessor` not returning an error which was the only error this function would return. (#1078) + +### Removed + +- Duplicate, unused API sampler interface. (#999) + Use the [`Sampler` interface](https://github.com/open-telemetry/opentelemetry-go/blob/v0.11.0/sdk/trace/sampling.go) provided by the SDK instead. +- The `grpctrace` instrumentation was moved to the `go.opentelemetry.io/contrib` repository and out of this repository. + This move includes moving the `grpc` example to the `go.opentelemetry.io/contrib` as well. (#1027) +- The `WithSpan` method of the `Tracer` interface. + The functionality this method provided was limited compared to what a user can provide themselves. + It was removed with the understanding that if there is sufficient user need it can be added back based on actual user usage. (#1043) +- The `RegisterSpanProcessor` and `UnregisterSpanProcessor` functions. + These were holdovers from an approach prior to the TracerProvider design. They were not used anymore. (#1077) +- The `oterror` package. (#1026) +- The `othttp` and `httptrace` instrumentations were moved to `go.opentelemetry.io/contrib`. (#1032) + +### Fixed + +- The `semconv.HTTPServerMetricAttributesFromHTTPRequest()` function no longer generates the high-cardinality `http.request.content.length` label. (#1031) +- Correct instrumentation version tag in Jaeger exporter. (#1037) +- The SDK span will now set an error event if the `End` method is called during a panic (i.e. it was deferred). (#1043) +- Move internally generated protobuf code from the `go.opentelemetry.io/otel` to the OTLP exporter to reduce dependency overhead. (#1050) +- The `otel-collector` example referenced outdated collector processors. (#1006) + +## [0.10.0] - 2020-07-29 + +This release migrates the default OpenTelemetry SDK into its own Go module, decoupling the SDK from the API and reducing dependencies for instrumentation packages. + +### Added + +- The Zipkin exporter now has `NewExportPipeline` and `InstallNewPipeline` constructor functions to match the common pattern. + These function build a new exporter with default SDK options and register the exporter with the `global` package respectively. (#944) +- Add propagator option for gRPC instrumentation. (#986) +- The `testtrace` package now tracks the `trace.SpanKind` for each span. (#987) + +### Changed + +- Replace the `RegisterGlobal` `Option` in the Jaeger exporter with an `InstallNewPipeline` constructor function. + This matches the other exporter constructor patterns and will register a new exporter after building it with default configuration. (#944) +- The trace (`go.opentelemetry.io/otel/exporters/trace/stdout`) and metric (`go.opentelemetry.io/otel/exporters/metric/stdout`) `stdout` exporters are now merged into a single exporter at `go.opentelemetry.io/otel/exporters/stdout`. + This new exporter was made into its own Go module to follow the pattern of all exporters and decouple it from the `go.opentelemetry.io/otel` module. (#956, #963) +- Move the `go.opentelemetry.io/otel/exporters/test` test package to `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#962) +- The `go.opentelemetry.io/otel/api/kv/value` package was merged into the parent `go.opentelemetry.io/otel/api/kv` package. (#968) + - `value.Bool` was replaced with `kv.BoolValue`. + - `value.Int64` was replaced with `kv.Int64Value`. + - `value.Uint64` was replaced with `kv.Uint64Value`. + - `value.Float64` was replaced with `kv.Float64Value`. + - `value.Int32` was replaced with `kv.Int32Value`. + - `value.Uint32` was replaced with `kv.Uint32Value`. + - `value.Float32` was replaced with `kv.Float32Value`. + - `value.String` was replaced with `kv.StringValue`. + - `value.Int` was replaced with `kv.IntValue`. + - `value.Uint` was replaced with `kv.UintValue`. + - `value.Array` was replaced with `kv.ArrayValue`. +- Rename `Infer` to `Any` in the `go.opentelemetry.io/otel/api/kv` package. (#972) +- Change `othttp` to use the `httpsnoop` package to wrap the `ResponseWriter` so that optional interfaces (`http.Hijacker`, `http.Flusher`, etc.) that are implemented by the original `ResponseWriter`are also implemented by the wrapped `ResponseWriter`. (#979) +- Rename `go.opentelemetry.io/otel/sdk/metric/aggregator/test` package to `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest`. (#980) +- Make the SDK into its own Go module called `go.opentelemetry.io/otel/sdk`. (#985) +- Changed the default trace `Sampler` from `AlwaysOn` to `ParentOrElse(AlwaysOn)`. (#989) + +### Removed + +- The `IndexedAttribute` function from the `go.opentelemetry.io/otel/api/label` package was removed in favor of `IndexedLabel` which it was synonymous with. (#970) + +### Fixed + +- Bump github.com/golangci/golangci-lint from 1.28.3 to 1.29.0 in /tools. (#953) +- Bump github.com/google/go-cmp from 0.5.0 to 0.5.1. (#957) +- Use `global.Handle` for span export errors in the OTLP exporter. (#946) +- Correct Go language formatting in the README documentation. (#961) +- Remove default SDK dependencies from the `go.opentelemetry.io/otel/api` package. (#977) +- Remove default SDK dependencies from the `go.opentelemetry.io/otel/instrumentation` package. (#983) +- Move documented examples for `go.opentelemetry.io/otel/instrumentation/grpctrace` interceptors into Go example tests. (#984) + +## [0.9.0] - 2020-07-20 + +### Added + +- A new Resource Detector interface is included to allow resources to be automatically detected and included. (#939) +- A Detector to automatically detect resources from an environment variable. (#939) +- Github action to generate protobuf Go bindings locally in `internal/opentelemetry-proto-gen`. (#938) +- OTLP .proto files from `open-telemetry/opentelemetry-proto` imported as a git submodule under `internal/opentelemetry-proto`. + References to `github.com/open-telemetry/opentelemetry-proto` changed to `go.opentelemetry.io/otel/internal/opentelemetry-proto-gen`. (#942) + +### Changed + +- Non-nil value `struct`s for key-value pairs will be marshalled using JSON rather than `Sprintf`. (#948) + +### Removed + +- Removed dependency on `github.com/open-telemetry/opentelemetry-collector`. (#943) + +## [0.8.0] - 2020-07-09 + +### Added + +- The `B3Encoding` type to represent the B3 encoding(s) the B3 propagator can inject. + A value for HTTP supported encodings (Multiple Header: `MultipleHeader`, Single Header: `SingleHeader`) are included. (#882) +- The `FlagsDeferred` trace flag to indicate if the trace sampling decision has been deferred. (#882) +- The `FlagsDebug` trace flag to indicate if the trace is a debug trace. (#882) +- Add `peer.service` semantic attribute. (#898) +- Add database-specific semantic attributes. (#899) +- Add semantic convention for `faas.coldstart` and `container.id`. (#909) +- Add http content size semantic conventions. (#905) +- Include `http.request_content_length` in HTTP request basic attributes. (#905) +- Add semantic conventions for operating system process resource attribute keys. (#919) +- The Jaeger exporter now has a `WithBatchMaxCount` option to specify the maximum number of spans sent in a batch. (#931) + +### Changed + +- Update `CONTRIBUTING.md` to ask for updates to `CHANGELOG.md` with each pull request. (#879) +- Use lowercase header names for B3 Multiple Headers. (#881) +- The B3 propagator `SingleHeader` field has been replaced with `InjectEncoding`. + This new field can be set to combinations of the `B3Encoding` bitmasks and will inject trace information in these encodings. + If no encoding is set, the propagator will default to `MultipleHeader` encoding. (#882) +- The B3 propagator now extracts from either HTTP encoding of B3 (Single Header or Multiple Header) based on what is contained in the header. + Preference is given to Single Header encoding with Multiple Header being the fallback if Single Header is not found or is invalid. + This behavior change is made to dynamically support all correctly encoded traces received instead of having to guess the expected encoding prior to receiving. (#882) +- Extend semantic conventions for RPC. (#900) +- To match constant naming conventions in the `api/standard` package, the `FaaS*` key names are appended with a suffix of `Key`. (#920) + - `"api/standard".FaaSName` -> `FaaSNameKey` + - `"api/standard".FaaSID` -> `FaaSIDKey` + - `"api/standard".FaaSVersion` -> `FaaSVersionKey` + - `"api/standard".FaaSInstance` -> `FaaSInstanceKey` + +### Removed + +- The `FlagsUnused` trace flag is removed. + The purpose of this flag was to act as the inverse of `FlagsSampled`, the inverse of `FlagsSampled` is used instead. (#882) +- The B3 header constants (`B3SingleHeader`, `B3DebugFlagHeader`, `B3TraceIDHeader`, `B3SpanIDHeader`, `B3SampledHeader`, `B3ParentSpanIDHeader`) are removed. + If B3 header keys are needed [the authoritative OpenZipkin package constants](https://pkg.go.dev/github.com/openzipkin/zipkin-go@v0.2.2/propagation/b3?tab=doc#pkg-constants) should be used instead. (#882) + +### Fixed + +- The B3 Single Header name is now correctly `b3` instead of the previous `X-B3`. (#881) +- The B3 propagator now correctly supports sampling only values (`b3: 0`, `b3: 1`, or `b3: d`) for a Single B3 Header. (#882) +- The B3 propagator now propagates the debug flag. + This removes the behavior of changing the debug flag into a set sampling bit. + Instead, this now follow the B3 specification and omits the `X-B3-Sampling` header. (#882) +- The B3 propagator now tracks "unset" sampling state (meaning "defer the decision") and does not set the `X-B3-Sampling` header when injecting. (#882) +- Bump github.com/itchyny/gojq from 0.10.3 to 0.10.4 in /tools. (#883) +- Bump github.com/opentracing/opentracing-go from v1.1.1-0.20190913142402-a7454ce5950e to v1.2.0. (#885) +- The tracing time conversion for OTLP spans is now correctly set to `UnixNano`. (#896) +- Ensure span status is not set to `Unknown` when no HTTP status code is provided as it is assumed to be `200 OK`. (#908) +- Ensure `httptrace.clientTracer` closes `http.headers` span. (#912) +- Prometheus exporter will not apply stale updates or forget inactive metrics. (#903) +- Add test for api.standard `HTTPClientAttributesFromHTTPRequest`. (#905) +- Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.1 in /tools. (#901, #913) +- Update otel-colector example to use the v0.5.0 collector. (#915) +- The `grpctrace` instrumentation uses a span name conforming to the OpenTelemetry semantic conventions (does not contain a leading slash (`/`)). (#922) +- The `grpctrace` instrumentation includes an `rpc.method` attribute now set to the gRPC method name. (#900, #922) +- The `grpctrace` instrumentation `rpc.service` attribute now contains the package name if one exists. + This is in accordance with OpenTelemetry semantic conventions. (#922) +- Correlation Context extractor will no longer insert an empty map into the returned context when no valid values are extracted. (#923) +- Bump google.golang.org/api from 0.28.0 to 0.29.0 in /exporters/trace/jaeger. (#925) +- Bump github.com/itchyny/gojq from 0.10.4 to 0.11.0 in /tools. (#926) +- Bump github.com/golangci/golangci-lint from 1.28.1 to 1.28.2 in /tools. (#930) + +## [0.7.0] - 2020-06-26 + +This release implements the v0.5.0 version of the OpenTelemetry specification. + +### Added + +- The othttp instrumentation now includes default metrics. (#861) +- This CHANGELOG file to track all changes in the project going forward. +- Support for array type attributes. (#798) +- Apply transitive dependabot go.mod dependency updates as part of a new automatic Github workflow. (#844) +- Timestamps are now passed to exporters for each export. (#835) +- Add new `Accumulation` type to metric SDK to transport telemetry from `Accumulator`s to `Processor`s. + This replaces the prior `Record` `struct` use for this purpose. (#835) +- New dependabot integration to automate package upgrades. (#814) +- `Meter` and `Tracer` implementations accept instrumentation version version as an optional argument. + This instrumentation version is passed on to exporters. (#811) (#805) (#802) +- The OTLP exporter includes the instrumentation version in telemetry it exports. (#811) +- Environment variables for Jaeger exporter are supported. (#796) +- New `aggregation.Kind` in the export metric API. (#808) +- New example that uses OTLP and the collector. (#790) +- Handle errors in the span `SetName` during span initialization. (#791) +- Default service config to enable retries for retry-able failed requests in the OTLP exporter and an option to override this default. (#777) +- New `go.opentelemetry.io/otel/api/oterror` package to uniformly support error handling and definitions for the project. (#778) +- New `global` default implementation of the `go.opentelemetry.io/otel/api/oterror.Handler` interface to be used to handle errors prior to an user defined `Handler`. + There is also functionality for the user to register their `Handler` as well as a convenience function `Handle` to handle an error with this global `Handler`(#778) +- Options to specify propagators for httptrace and grpctrace instrumentation. (#784) +- The required `application/json` header for the Zipkin exporter is included in all exports. (#774) +- Integrate HTTP semantics helpers from the contrib repository into the `api/standard` package. #769 + +### Changed + +- Rename `Integrator` to `Processor` in the metric SDK. (#863) +- Rename `AggregationSelector` to `AggregatorSelector`. (#859) +- Rename `SynchronizedCopy` to `SynchronizedMove`. (#858) +- Rename `simple` integrator to `basic` integrator. (#857) +- Merge otlp collector examples. (#841) +- Change the metric SDK to support cumulative, delta, and pass-through exporters directly. + With these changes, cumulative and delta specific exporters are able to request the correct kind of aggregation from the SDK. (#840) +- The `Aggregator.Checkpoint` API is renamed to `SynchronizedCopy` and adds an argument, a different `Aggregator` into which the copy is stored. (#812) +- The `export.Aggregator` contract is that `Update()` and `SynchronizedCopy()` are synchronized with each other. + All the aggregation interfaces (`Sum`, `LastValue`, ...) are not meant to be synchronized, as the caller is expected to synchronize aggregators at a higher level after the `Accumulator`. + Some of the `Aggregators` used unnecessary locking and that has been cleaned up. (#812) +- Use of `metric.Number` was replaced by `int64` now that we use `sync.Mutex` in the `MinMaxSumCount` and `Histogram` `Aggregators`. (#812) +- Replace `AlwaysParentSample` with `ParentSample(fallback)` to match the OpenTelemetry v0.5.0 specification. (#810) +- Rename `sdk/export/metric/aggregator` to `sdk/export/metric/aggregation`. #808 +- Send configured headers with every request in the OTLP exporter, instead of just on connection creation. (#806) +- Update error handling for any one off error handlers, replacing, instead, with the `global.Handle` function. (#791) +- Rename `plugin` directory to `instrumentation` to match the OpenTelemetry specification. (#779) +- Makes the argument order to Histogram and DDSketch `New()` consistent. (#781) + +### Removed + +- `Uint64NumberKind` and related functions from the API. (#864) +- Context arguments from `Aggregator.Checkpoint` and `Integrator.Process` as they were unused. (#803) +- `SpanID` is no longer included in parameters for sampling decision to match the OpenTelemetry specification. (#775) + +### Fixed + +- Upgrade OTLP exporter to opentelemetry-proto matching the opentelemetry-collector v0.4.0 release. (#866) +- Allow changes to `go.sum` and `go.mod` when running dependabot tidy-up. (#871) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1. (#824) +- Bump github.com/prometheus/client_golang from 1.7.0 to 1.7.1 in /exporters/metric/prometheus. (#867) +- Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/jaeger. (#853) +- Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/zipkin. (#854) +- Bumps github.com/golang/protobuf from 1.3.2 to 1.4.2 (#848) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/otlp (#817) +- Bump github.com/golangci/golangci-lint from 1.25.1 to 1.27.0 in /tools (#828) +- Bump github.com/prometheus/client_golang from 1.5.0 to 1.7.0 in /exporters/metric/prometheus (#838) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/jaeger (#829) +- Bump github.com/benbjohnson/clock from 1.0.0 to 1.0.3 (#815) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/zipkin (#823) +- Bump github.com/itchyny/gojq from 0.10.1 to 0.10.3 in /tools (#830) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/metric/prometheus (#822) +- Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/zipkin (#820) +- Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/jaeger (#831) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 (#836) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/trace/jaeger (#837) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/otlp (#839) +- Bump google.golang.org/api from 0.20.0 to 0.28.0 in /exporters/trace/jaeger (#843) +- Set span status from HTTP status code in the othttp instrumentation. (#832) +- Fixed typo in push controller comment. (#834) +- The `Aggregator` testing has been updated and cleaned. (#812) +- `metric.Number(0)` expressions are replaced by `0` where possible. (#812) +- Fixed `global` `handler_test.go` test failure. #804 +- Fixed `BatchSpanProcessor.Shutdown` to wait until all spans are processed. (#766) +- Fixed OTLP example's accidental early close of exporter. (#807) +- Ensure zipkin exporter reads and closes response body. (#788) +- Update instrumentation to use `api/standard` keys instead of custom keys. (#782) +- Clean up tools and RELEASING documentation. (#762) + +## [0.6.0] - 2020-05-21 + +### Added + +- Support for `Resource`s in the prometheus exporter. (#757) +- New pull controller. (#751) +- New `UpDownSumObserver` instrument. (#750) +- OpenTelemetry collector demo. (#711) +- New `SumObserver` instrument. (#747) +- New `UpDownCounter` instrument. (#745) +- New timeout `Option` and configuration function `WithTimeout` to the push controller. (#742) +- New `api/standards` package to implement semantic conventions and standard key-value generation. (#731) + +### Changed + +- Rename `Register*` functions in the metric API to `New*` for all `Observer` instruments. (#761) +- Use `[]float64` for histogram boundaries, not `[]metric.Number`. (#758) +- Change OTLP example to use exporter as a trace `Syncer` instead of as an unneeded `Batcher`. (#756) +- Replace `WithResourceAttributes()` with `WithResource()` in the trace SDK. (#754) +- The prometheus exporter now uses the new pull controller. (#751) +- Rename `ScheduleDelayMillis` to `BatchTimeout` in the trace `BatchSpanProcessor`.(#752) +- Support use of synchronous instruments in asynchronous callbacks (#725) +- Move `Resource` from the `Export` method parameter into the metric export `Record`. (#739) +- Rename `Observer` instrument to `ValueObserver`. (#734) +- The push controller now has a method (`Provider()`) to return a `metric.Provider` instead of the old `Meter` method that acted as a `metric.Provider`. (#738) +- Replace `Measure` instrument by `ValueRecorder` instrument. (#732) +- Rename correlation context header from `"Correlation-Context"` to `"otcorrelations"` to match the OpenTelemetry specification. 727) + +### Fixed + +- Ensure gRPC `ClientStream` override methods do not panic in grpctrace package. (#755) +- Disable parts of `BatchSpanProcessor` test until a fix is found. (#743) +- Fix `string` case in `kv` `Infer` function. (#746) +- Fix panic in grpctrace client interceptors. (#740) +- Refactor the `api/metrics` push controller and add `CheckpointSet` synchronization. (#737) +- Rewrite span batch process queue batching logic. (#719) +- Remove the push controller named Meter map. (#738) +- Fix Histogram aggregator initial state (fix #735). (#736) +- Ensure golang alpine image is running `golang-1.14` for examples. (#733) +- Added test for grpctrace `UnaryInterceptorClient`. (#695) +- Rearrange `api/metric` code layout. (#724) + +## [0.5.0] - 2020-05-13 + +### Added + +- Batch `Observer` callback support. (#717) +- Alias `api` types to root package of project. (#696) +- Create basic `othttp.Transport` for simple client instrumentation. (#678) +- `SetAttribute(string, interface{})` to the trace API. (#674) +- Jaeger exporter option that allows user to specify custom http client. (#671) +- `Stringer` and `Infer` methods to `key`s. (#662) + +### Changed + +- Rename `NewKey` in the `kv` package to just `Key`. (#721) +- Move `core` and `key` to `kv` package. (#720) +- Make the metric API `Meter` a `struct` so the abstract `MeterImpl` can be passed and simplify implementation. (#709) +- Rename SDK `Batcher` to `Integrator` to match draft OpenTelemetry SDK specification. (#710) +- Rename SDK `Ungrouped` integrator to `simple.Integrator` to match draft OpenTelemetry SDK specification. (#710) +- Rename SDK `SDK` `struct` to `Accumulator` to match draft OpenTelemetry SDK specification. (#710) +- Move `Number` from `core` to `api/metric` package. (#706) +- Move `SpanContext` from `core` to `trace` package. (#692) +- Change traceparent header from `Traceparent` to `traceparent` to implement the W3C specification. (#681) + +### Fixed + +- Update tooling to run generators in all submodules. (#705) +- gRPC interceptor regexp to match methods without a service name. (#683) +- Use a `const` for padding 64-bit B3 trace IDs. (#701) +- Update `mockZipkin` listen address from `:0` to `127.0.0.1:0`. (#700) +- Left-pad 64-bit B3 trace IDs with zero. (#698) +- Propagate at least the first W3C tracestate header. (#694) +- Remove internal `StateLocker` implementation. (#688) +- Increase instance size CI system uses. (#690) +- Add a `key` benchmark and use reflection in `key.Infer()`. (#679) +- Fix internal `global` test by using `global.Meter` with `RecordBatch()`. (#680) +- Reimplement histogram using mutex instead of `StateLocker`. (#669) +- Switch `MinMaxSumCount` to a mutex lock implementation instead of `StateLocker`. (#667) +- Update documentation to not include any references to `WithKeys`. (#672) +- Correct misspelling. (#668) +- Fix clobbering of the span context if extraction fails. (#656) +- Bump `golangci-lint` and work around the corrupting bug. (#666) (#670) + +## [0.4.3] - 2020-04-24 + +### Added + +- `Dockerfile` and `docker-compose.yml` to run example code. (#635) +- New `grpctrace` package that provides gRPC client and server interceptors for both unary and stream connections. (#621) +- New `api/label` package, providing common label set implementation. (#651) +- Support for JSON marshaling of `Resources`. (#654) +- `TraceID` and `SpanID` implementations for `Stringer` interface. (#642) +- `RemoteAddrKey` in the othttp plugin to include the HTTP client address in top-level spans. (#627) +- `WithSpanFormatter` option to the othttp plugin. (#617) +- Updated README to include section for compatible libraries and include reference to the contrib repository. (#612) +- The prometheus exporter now supports exporting histograms. (#601) +- A `String` method to the `Resource` to return a hashable identifier for a now unique resource. (#613) +- An `Iter` method to the `Resource` to return an array `AttributeIterator`. (#613) +- An `Equal` method to the `Resource` test the equivalence of resources. (#613) +- An iterable structure (`AttributeIterator`) for `Resource` attributes. + +### Changed + +- zipkin export's `NewExporter` now requires a `serviceName` argument to ensure this needed values is provided. (#644) +- Pass `Resources` through the metrics export pipeline. (#659) + +### Removed + +- `WithKeys` option from the metric API. (#639) + +### Fixed + +- Use the `label.Set.Equivalent` value instead of an encoding in the batcher. (#658) +- Correct typo `trace.Exporter` to `trace.SpanSyncer` in comments. (#653) +- Use type names for return values in jaeger exporter. (#648) +- Increase the visibility of the `api/key` package by updating comments and fixing usages locally. (#650) +- `Checkpoint` only after `Update`; Keep records in the `sync.Map` longer. (#647) +- Do not cache `reflect.ValueOf()` in metric Labels. (#649) +- Batch metrics exported from the OTLP exporter based on `Resource` and labels. (#626) +- Add error wrapping to the prometheus exporter. (#631) +- Update the OTLP exporter batching of traces to use a unique `string` representation of an associated `Resource` as the batching key. (#623) +- Update OTLP `SpanData` transform to only include the `ParentSpanID` if one exists. (#614) +- Update `Resource` internal representation to uniquely and reliably identify resources. (#613) +- Check return value from `CheckpointSet.ForEach` in prometheus exporter. (#622) +- Ensure spans created by httptrace client tracer reflect operation structure. (#618) +- Create a new recorder rather than reuse when multiple observations in same epoch for asynchronous instruments. #610 +- The default port the OTLP exporter uses to connect to the OpenTelemetry collector is updated to match the one the collector listens on by default. (#611) + + +## [0.4.2] - 2020-03-31 + +### Fixed + +- Fix `pre_release.sh` to update version in `sdk/opentelemetry.go`. (#607) +- Fix time conversion from internal to OTLP in OTLP exporter. (#606) + +## [0.4.1] - 2020-03-31 + +### Fixed + +- Update `tag.sh` to create signed tags. (#604) + +## [0.4.0] - 2020-03-30 + +### Added + +- New API package `api/metric/registry` that exposes a `MeterImpl` wrapper for use by SDKs to generate unique instruments. (#580) +- Script to verify examples after a new release. (#579) + +### Removed + +- The dogstatsd exporter due to lack of support. + This additionally removes support for statsd. (#591) +- `LabelSet` from the metric API. + This is replaced by a `[]core.KeyValue` slice. (#595) +- `Labels` from the metric API's `Meter` interface. (#595) + +### Changed + +- The metric `export.Labels` became an interface which the SDK implements and the `export` package provides a simple, immutable implementation of this interface intended for testing purposes. (#574) +- Renamed `internal/metric.Meter` to `MeterImpl`. (#580) +- Renamed `api/global/internal.obsImpl` to `asyncImpl`. (#580) + +### Fixed + +- Corrected missing return in mock span. (#582) +- Update License header for all source files to match CNCF guidelines and include a test to ensure it is present. (#586) (#596) +- Update to v0.3.0 of the OTLP in the OTLP exporter. (#588) +- Update pre-release script to be compatible between GNU and BSD based systems. (#592) +- Add a `RecordBatch` benchmark. (#594) +- Moved span transforms of the OTLP exporter to the internal package. (#593) +- Build both go-1.13 and go-1.14 in circleci to test for all supported versions of Go. (#569) +- Removed unneeded allocation on empty labels in OLTP exporter. (#597) +- Update `BatchedSpanProcessor` to process the queue until no data but respect max batch size. (#599) +- Update project documentation godoc.org links to pkg.go.dev. (#602) + +## [0.3.0] - 2020-03-21 + +This is a first official beta release, which provides almost fully complete metrics, tracing, and context propagation functionality. +There is still a possibility of breaking changes. + +### Added + +- Add `Observer` metric instrument. (#474) +- Add global `Propagators` functionality to enable deferred initialization for propagators registered before the first Meter SDK is installed. (#494) +- Simplified export setup pipeline for the jaeger exporter to match other exporters. (#459) +- The zipkin trace exporter. (#495) +- The OTLP exporter to export metric and trace telemetry to the OpenTelemetry collector. (#497) (#544) (#545) +- The `StatusMessage` field was add to the trace `Span`. (#524) +- Context propagation in OpenTracing bridge in terms of OpenTelemetry context propagation. (#525) +- The `Resource` type was added to the SDK. (#528) +- The global API now supports a `Tracer` and `Meter` function as shortcuts to getting a global `*Provider` and calling these methods directly. (#538) +- The metric API now defines a generic `MeterImpl` interface to support general purpose `Meter` construction. + Additionally, `SyncImpl` and `AsyncImpl` are added to support general purpose instrument construction. (#560) +- A metric `Kind` is added to represent the `MeasureKind`, `ObserverKind`, and `CounterKind`. (#560) +- Scripts to better automate the release process. (#576) + +### Changed + +- Default to to use `AlwaysSampler` instead of `ProbabilitySampler` to match OpenTelemetry specification. (#506) +- Renamed `AlwaysSampleSampler` to `AlwaysOnSampler` in the trace API. (#511) +- Renamed `NeverSampleSampler` to `AlwaysOffSampler` in the trace API. (#511) +- The `Status` field of the `Span` was changed to `StatusCode` to disambiguate with the added `StatusMessage`. (#524) +- Updated the trace `Sampler` interface conform to the OpenTelemetry specification. (#531) +- Rename metric API `Options` to `Config`. (#541) +- Rename metric `Counter` aggregator to be `Sum`. (#541) +- Unify metric options into `Option` from instrument specific options. (#541) +- The trace API's `TraceProvider` now support `Resource`s. (#545) +- Correct error in zipkin module name. (#548) +- The jaeger trace exporter now supports `Resource`s. (#551) +- Metric SDK now supports `Resource`s. + The `WithResource` option was added to configure a `Resource` on creation and the `Resource` method was added to the metric `Descriptor` to return the associated `Resource`. (#552) +- Replace `ErrNoLastValue` and `ErrEmptyDataSet` by `ErrNoData` in the metric SDK. (#557) +- The stdout trace exporter now supports `Resource`s. (#558) +- The metric `Descriptor` is now included at the API instead of the SDK. (#560) +- Replace `Ordered` with an iterator in `export.Labels`. (#567) + +### Removed + +- The vendor specific Stackdriver. It is now hosted on 3rd party vendor infrastructure. (#452) +- The `Unregister` method for metric observers as it is not in the OpenTelemetry specification. (#560) +- `GetDescriptor` from the metric SDK. (#575) +- The `Gauge` instrument from the metric API. (#537) + +### Fixed + +- Make histogram aggregator checkpoint consistent. (#438) +- Update README with import instructions and how to build and test. (#505) +- The default label encoding was updated to be unique. (#508) +- Use `NewRoot` in the othttp plugin for public endpoints. (#513) +- Fix data race in `BatchedSpanProcessor`. (#518) +- Skip test-386 for Mac OS 10.15.x (Catalina and upwards). #521 +- Use a variable-size array to represent ordered labels in maps. (#523) +- Update the OTLP protobuf and update changed import path. (#532) +- Use `StateLocker` implementation in `MinMaxSumCount`. (#546) +- Eliminate goroutine leak in histogram stress test. (#547) +- Update OTLP exporter with latest protobuf. (#550) +- Add filters to the othttp plugin. (#556) +- Provide an implementation of the `Header*` filters that do not depend on Go 1.14. (#565) +- Encode labels once during checkpoint. + The checkpoint function is executed in a single thread so we can do the encoding lazily before passing the encoded version of labels to the exporter. + This is a cheap and quick way to avoid encoding the labels on every collection interval. (#572) +- Run coverage over all packages in `COVERAGE_MOD_DIR`. (#573) + +## [0.2.3] - 2020-03-04 + +### Added + +- `RecordError` method on `Span`s in the trace API to Simplify adding error events to spans. (#473) +- Configurable push frequency for exporters setup pipeline. (#504) + +### Changed + +- Rename the `exporter` directory to `exporters`. + The `go.opentelemetry.io/otel/exporter/trace/jaeger` package was mistakenly released with a `v1.0.0` tag instead of `v0.1.0`. + This resulted in all subsequent releases not becoming the default latest. + A consequence of this was that all `go get`s pulled in the incompatible `v0.1.0` release of that package when pulling in more recent packages from other otel packages. + Renaming the `exporter` directory to `exporters` fixes this issue by renaming the package and therefore clearing any existing dependency tags. + Consequentially, this action also renames *all* exporter packages. (#502) + +### Removed + +- The `CorrelationContextHeader` constant in the `correlation` package is no longer exported. (#503) + +## [0.2.2] - 2020-02-27 + +### Added + +- `HTTPSupplier` interface in the propagation API to specify methods to retrieve and store a single value for a key to be associated with a carrier. (#467) +- `HTTPExtractor` interface in the propagation API to extract information from an `HTTPSupplier` into a context. (#467) +- `HTTPInjector` interface in the propagation API to inject information into an `HTTPSupplier.` (#467) +- `Config` and configuring `Option` to the propagator API. (#467) +- `Propagators` interface in the propagation API to contain the set of injectors and extractors for all supported carrier formats. (#467) +- `HTTPPropagator` interface in the propagation API to inject and extract from an `HTTPSupplier.` (#467) +- `WithInjectors` and `WithExtractors` functions to the propagator API to configure injectors and extractors to use. (#467) +- `ExtractHTTP` and `InjectHTTP` functions to apply configured HTTP extractors and injectors to a passed context. (#467) +- Histogram aggregator. (#433) +- `DefaultPropagator` function and have it return `trace.TraceContext` as the default context propagator. (#456) +- `AlwaysParentSample` sampler to the trace API. (#455) +- `WithNewRoot` option function to the trace API to specify the created span should be considered a root span. (#451) + + +### Changed + +- Renamed `WithMap` to `ContextWithMap` in the correlation package. (#481) +- Renamed `FromContext` to `MapFromContext` in the correlation package. (#481) +- Move correlation context propagation to correlation package. (#479) +- Do not default to putting remote span context into links. (#480) +- Propagators extrac +- `Tracer.WithSpan` updated to accept `StartOptions`. (#472) +- Renamed `MetricKind` to `Kind` to not stutter in the type usage. (#432) +- Renamed the `export` package to `metric` to match directory structure. (#432) +- Rename the `api/distributedcontext` package to `api/correlation`. (#444) +- Rename the `api/propagators` package to `api/propagation`. (#444) +- Move the propagators from the `propagators` package into the `trace` API package. (#444) +- Update `Float64Gauge`, `Int64Gauge`, `Float64Counter`, `Int64Counter`, `Float64Measure`, and `Int64Measure` metric methods to use value receivers instead of pointers. (#462) +- Moved all dependencies of tools package to a tools directory. (#466) + +### Removed + +- Binary propagators. (#467) +- NOOP propagator. (#467) + +### Fixed + +- Upgraded `github.com/golangci/golangci-lint` from `v1.21.0` to `v1.23.6` in `tools/`. (#492) +- Fix a possible nil-dereference crash (#478) +- Correct comments for `InstallNewPipeline` in the stdout exporter. (#483) +- Correct comments for `InstallNewPipeline` in the dogstatsd exporter. (#484) +- Correct comments for `InstallNewPipeline` in the prometheus exporter. (#482) +- Initialize `onError` based on `Config` in prometheus exporter. (#486) +- Correct module name in prometheus exporter README. (#475) +- Removed tracer name prefix from span names. (#430) +- Fix `aggregator_test.go` import package comment. (#431) +- Improved detail in stdout exporter. (#436) +- Fix a dependency issue (generate target should depend on stringer, not lint target) in Makefile. (#442) +- Reorders the Makefile targets within `precommit` target so we generate files and build the code before doing linting, so we can get much nicer errors about syntax errors from the compiler. (#442) +- Reword function documentation in gRPC plugin. (#446) +- Send the `span.kind` tag to Jaeger from the jaeger exporter. (#441) +- Fix `metadataSupplier` in the jaeger exporter to overwrite the header if existing instead of appending to it. (#441) +- Upgraded to Go 1.13 in CI. (#465) +- Correct opentelemetry.io URL in trace SDK documentation. (#464) +- Refactored reference counting logic in SDK determination of stale records. (#468) +- Add call to `runtime.Gosched` in instrument `acquireHandle` logic to not block the collector. (#469) + +## [0.2.1.1] - 2020-01-13 + +### Fixed + +- Use stateful batcher on Prometheus exporter fixing regresion introduced in #395. (#428) + +## [0.2.1] - 2020-01-08 + +### Added + +- Global meter forwarding implementation. + This enables deferred initialization for metric instruments registered before the first Meter SDK is installed. (#392) +- Global trace forwarding implementation. + This enables deferred initialization for tracers registered before the first Trace SDK is installed. (#406) +- Standardize export pipeline creation in all exporters. (#395) +- A testing, organization, and comments for 64-bit field alignment. (#418) +- Script to tag all modules in the project. (#414) + +### Changed + +- Renamed `propagation` package to `propagators`. (#362) +- Renamed `B3Propagator` propagator to `B3`. (#362) +- Renamed `TextFormatPropagator` propagator to `TextFormat`. (#362) +- Renamed `BinaryPropagator` propagator to `Binary`. (#362) +- Renamed `BinaryFormatPropagator` propagator to `BinaryFormat`. (#362) +- Renamed `NoopTextFormatPropagator` propagator to `NoopTextFormat`. (#362) +- Renamed `TraceContextPropagator` propagator to `TraceContext`. (#362) +- Renamed `SpanOption` to `StartOption` in the trace API. (#369) +- Renamed `StartOptions` to `StartConfig` in the trace API. (#369) +- Renamed `EndOptions` to `EndConfig` in the trace API. (#369) +- `Number` now has a pointer receiver for its methods. (#375) +- Renamed `CurrentSpan` to `SpanFromContext` in the trace API. (#379) +- Renamed `SetCurrentSpan` to `ContextWithSpan` in the trace API. (#379) +- Renamed `Message` in Event to `Name` in the trace API. (#389) +- Prometheus exporter no longer aggregates metrics, instead it only exports them. (#385) +- Renamed `HandleImpl` to `BoundInstrumentImpl` in the metric API. (#400) +- Renamed `Float64CounterHandle` to `Float64CounterBoundInstrument` in the metric API. (#400) +- Renamed `Int64CounterHandle` to `Int64CounterBoundInstrument` in the metric API. (#400) +- Renamed `Float64GaugeHandle` to `Float64GaugeBoundInstrument` in the metric API. (#400) +- Renamed `Int64GaugeHandle` to `Int64GaugeBoundInstrument` in the metric API. (#400) +- Renamed `Float64MeasureHandle` to `Float64MeasureBoundInstrument` in the metric API. (#400) +- Renamed `Int64MeasureHandle` to `Int64MeasureBoundInstrument` in the metric API. (#400) +- Renamed `Release` method for bound instruments in the metric API to `Unbind`. (#400) +- Renamed `AcquireHandle` method for bound instruments in the metric API to `Bind`. (#400) +- Renamed the `File` option in the stdout exporter to `Writer`. (#404) +- Renamed all `Options` to `Config` for all metric exports where this wasn't already the case. + +### Fixed + +- Aggregator import path corrected. (#421) +- Correct links in README. (#368) +- The README was updated to match latest code changes in its examples. (#374) +- Don't capitalize error statements. (#375) +- Fix ignored errors. (#375) +- Fix ambiguous variable naming. (#375) +- Removed unnecessary type casting. (#375) +- Use named parameters. (#375) +- Updated release schedule. (#378) +- Correct http-stackdriver example module name. (#394) +- Removed the `http.request` span in `httptrace` package. (#397) +- Add comments in the metrics SDK (#399) +- Initialize checkpoint when creating ddsketch aggregator to prevent panic when merging into a empty one. (#402) (#403) +- Add documentation of compatible exporters in the README. (#405) +- Typo fix. (#408) +- Simplify span check logic in SDK tracer implementation. (#419) + +## [0.2.0] - 2019-12-03 + +### Added + +- Unary gRPC tracing example. (#351) +- Prometheus exporter. (#334) +- Dogstatsd metrics exporter. (#326) + +### Changed + +- Rename `MaxSumCount` aggregation to `MinMaxSumCount` and add the `Min` interface for this aggregation. (#352) +- Rename `GetMeter` to `Meter`. (#357) +- Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) +- Rename `HTTPB3Propagator` to `B3Propagator`. (#355) +- Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) +- Move `/global` package to `/api/global`. (#356) +- Rename `GetTracer` to `Tracer`. (#347) + +### Removed + +- `SetAttribute` from the `Span` interface in the trace API. (#361) +- `AddLink` from the `Span` interface in the trace API. (#349) +- `Link` from the `Span` interface in the trace API. (#349) + +### Fixed + +- Exclude example directories from coverage report. (#365) +- Lint make target now implements automatic fixes with `golangci-lint` before a second run to report the remaining issues. (#360) +- Drop `GO111MODULE` environment variable in Makefile as Go 1.13 is the project specified minimum version and this is environment variable is not needed for that version of Go. (#359) +- Run the race checker for all test. (#354) +- Redundant commands in the Makefile are removed. (#354) +- Split the `generate` and `lint` targets of the Makefile. (#354) +- Renames `circle-ci` target to more generic `ci` in Makefile. (#354) +- Add example Prometheus binary to gitignore. (#358) +- Support negative numbers with the `MaxSumCount`. (#335) +- Resolve race conditions in `push_test.go` identified in #339. (#340) +- Use `/usr/bin/env bash` as a shebang in scripts rather than `/bin/bash`. (#336) +- Trace benchmark now tests both `AlwaysSample` and `NeverSample`. + Previously it was testing `AlwaysSample` twice. (#325) +- Trace benchmark now uses a `[]byte` for `TraceID` to fix failing test. (#325) +- Added a trace benchmark to test variadic functions in `setAttribute` vs `setAttributes` (#325) +- The `defaultkeys` batcher was only using the encoded label set as its map key while building a checkpoint. + This allowed distinct label sets through, but any metrics sharing a label set could be overwritten or merged incorrectly. + This was corrected. (#333) + + +## [0.1.2] - 2019-11-18 + +### Fixed + +- Optimized the `simplelru` map for attributes to reduce the number of allocations. (#328) +- Removed unnecessary unslicing of parameters that are already a slice. (#324) + +## [0.1.1] - 2019-11-18 + +This release contains a Metrics SDK with stdout exporter and supports basic aggregations such as counter, gauges, array, maxsumcount, and ddsketch. + +### Added + +- Metrics stdout export pipeline. (#265) +- Array aggregation for raw measure metrics. (#282) +- The core.Value now have a `MarshalJSON` method. (#281) + +### Removed + +- `WithService`, `WithResources`, and `WithComponent` methods of tracers. (#314) +- Prefix slash in `Tracer.Start()` for the Jaeger example. (#292) + +### Changed + +- Allocation in LabelSet construction to reduce GC overhead. (#318) +- `trace.WithAttributes` to append values instead of replacing (#315) +- Use a formula for tolerance in sampling tests. (#298) +- Move export types into trace and metric-specific sub-directories. (#289) +- `SpanKind` back to being based on an `int` type. (#288) + +### Fixed + +- URL to OpenTelemetry website in README. (#323) +- Name of othttp default tracer. (#321) +- `ExportSpans` for the stackdriver exporter now handles `nil` context. (#294) +- CI modules cache to correctly restore/save from/to the cache. (#316) +- Fix metric SDK race condition between `LoadOrStore` and the assignment `rec.recorder = i.meter.exporter.AggregatorFor(rec)`. (#293) +- README now reflects the new code structure introduced with these changes. (#291) +- Make the basic example work. (#279) + +## [0.1.0] - 2019-11-04 + +This is the first release of open-telemetry go library. +It contains api and sdk for trace and meter. + +### Added + +- Initial OpenTelemetry trace and metric API prototypes. +- Initial OpenTelemetry trace, metric, and export SDK packages. +- A wireframe bridge to support compatibility with OpenTracing. +- Example code for a basic, http-stackdriver, http, jaeger, and named tracer setup. +- Exporters for Jaeger, Stackdriver, and stdout. +- Propagators for binary, B3, and trace-context protocols. +- Project information and guidelines in the form of a README and CONTRIBUTING. +- Tools to build the project and a Makefile to automate the process. +- Apache-2.0 license. +- CircleCI build CI manifest files. +- CODEOWNERS file to track owners of this project. + + +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v0.20.0...HEAD +[0.20.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.20.0 +[0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.19.0 +[0.18.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.18.0 +[0.17.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.17.0 +[0.16.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.16.0 +[0.15.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.15.0 +[0.14.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.14.0 +[0.13.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.13.0 +[0.12.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.12.0 +[0.11.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.11.0 +[0.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.10.0 +[0.9.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.9.0 +[0.8.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.8.0 +[0.7.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.7.0 +[0.6.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.6.0 +[0.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.5.0 +[0.4.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.3 +[0.4.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.2 +[0.4.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.1 +[0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.0 +[0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.3.0 +[0.2.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.3 +[0.2.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.2 +[0.2.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1.1 +[0.2.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1 +[0.2.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.0 +[0.1.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.2 +[0.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.1 +[0.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.0 diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/CODEOWNERS b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/CODEOWNERS new file mode 100644 index 000000000000..196df9cfd896 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/CODEOWNERS @@ -0,0 +1,17 @@ +##################################################### +# +# List of approvers for this repository +# +##################################################### +# +# Learn about membership in OpenTelemetry community: +# https://github.com/open-telemetry/community/blob/main/community-membership.md +# +# +# Learn about CODEOWNERS file format: +# https://help.github.com/en/articles/about-code-owners +# + +* @jmacd @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @paivagustavo + +CODEOWNERS @MrAlias @Aneurysm9 diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md new file mode 100644 index 000000000000..51ab52c6384c --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md @@ -0,0 +1,380 @@ +# Contributing to opentelemetry-go + +The Go special interest group (SIG) meets regularly. See the +OpenTelemetry +[community](https://github.com/open-telemetry/community#golang-sdk) +repo for information on this and other language SIGs. + +See the [public meeting +notes](https://docs.google.com/document/d/1A63zSWX0x2CyCK_LoNhmQC4rqhLpYXJzXbEPDUQ2n6w/edit#heading=h.9tngw7jdwd6b) +for a summary description of past meetings. To request edit access, +join the meeting or get in touch on +[Slack](https://cloud-native.slack.com/archives/C01NPAXACKT). + +## Development + +You can view and edit the source code by cloning this repository: + +```bash +git clone https://github.com/open-telemetry/opentelemetry-go.git +``` + +Run `make test` to run the tests instead of `go test`. + +There are some generated files checked into the repo. To make sure +that the generated files are up-to-date, run `make` (or `make +precommit` - the `precommit` target is the default). + +The `precommit` target also fixes the formatting of the code and +checks the status of the go module files. + +If after running `make precommit` the output of `git status` contains +`nothing to commit, working tree clean` then it means that everything +is up-to-date and properly formatted. + +## Pull Requests + +### How to Send Pull Requests + +Everyone is welcome to contribute code to `opentelemetry-go` via +GitHub pull requests (PRs). + +To create a new PR, fork the project in GitHub and clone the upstream +repo: + +```sh +$ go get -d go.opentelemetry.io/otel +``` + +(This may print some warning about "build constraints exclude all Go +files", just ignore it.) + +This will put the project in `${GOPATH}/src/go.opentelemetry.io/otel`. You +can alternatively use `git` directly with: + +```sh +$ git clone https://github.com/open-telemetry/opentelemetry-go +``` + +(Note that `git clone` is *not* using the `go.opentelemetry.io/otel` name - +that name is a kind of a redirector to GitHub that `go get` can +understand, but `git` does not.) + +This would put the project in the `opentelemetry-go` directory in +current working directory. + +Enter the newly created directory and add your fork as a new remote: + +```sh +$ git remote add git@github.com:/opentelemetry-go +``` + +Check out a new branch, make modifications, run linters and tests, update +`CHANGELOG.md`, and push the branch to your fork: + +```sh +$ git checkout -b +# edit files +# update changelog +$ make precommit +$ git add -p +$ git commit +$ git push +``` + +Open a pull request against the main `opentelemetry-go` repo. Be sure to add the pull +request ID to the entry you added to `CHANGELOG.md`. + +### How to Receive Comments + +* If the PR is not ready for review, please put `[WIP]` in the title, + tag it as `work-in-progress`, or mark it as + [`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/). +* Make sure CLA is signed and CI is clear. + +### How to Get PRs Merged + +A PR is considered to be **ready to merge** when: + +* It has received two approvals from Collaborators/Maintainers (at + different companies). This is not enforced through technical means + and a PR may be **ready to merge** with a single approval if the change + and its approach have been discussed and consensus reached. +* Feedback has been addressed. +* Any substantive changes to your PR will require that you clear any prior + Approval reviews, this includes changes resulting from other feedback. Unless + the approver explicitly stated that their approval will persist across + changes it should be assumed that the PR needs their review again. Other + project members (e.g. approvers, maintainers) can help with this if there are + any questions or if you forget to clear reviews. +* It has been open for review for at least one working day. This gives + people reasonable time to review. +* Trivial changes (typo, cosmetic, doc, etc.) do not have to wait for + one day and may be merged with a single Maintainer's approval. +* `CHANGELOG.md` has been updated to reflect what has been + added, changed, removed, or fixed. +* Urgent fix can take exception as long as it has been actively + communicated. + +Any Maintainer can merge the PR once it is **ready to merge**. + +## Design Choices + +As with other OpenTelemetry clients, opentelemetry-go follows the +[opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification). + +It's especially valuable to read through the [library +guidelines](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/library-guidelines.md). + +### Focus on Capabilities, Not Structure Compliance + +OpenTelemetry is an evolving specification, one where the desires and +use cases are clear, but the method to satisfy those uses cases are +not. + +As such, Contributions should provide functionality and behavior that +conforms to the specification, but the interface and structure is +flexible. + +It is preferable to have contributions follow the idioms of the +language rather than conform to specific API names or argument +patterns in the spec. + +For a deeper discussion, see: +https://github.com/open-telemetry/opentelemetry-specification/issues/165 + +## Style Guide + +One of the primary goals of this project is that it is actually used by +developers. With this goal in mind the project strives to build +user-friendly and idiomatic Go code adhering to the Go community's best +practices. + +For a non-comprehensive but foundational overview of these best practices +the [Effective Go](https://golang.org/doc/effective_go.html) documentation +is an excellent starting place. + +As a convenience for developers building this project the `make precommit` +will format, lint, validate, and in some cases fix the changes you plan to +submit. This check will need to pass for your changes to be able to be +merged. + +In addition to idiomatic Go, the project has adopted certain standards for +implementations of common patterns. These standards should be followed as a +default, and if they are not followed documentation needs to be included as +to the reasons why. + +### Configuration + +When creating an instantiation function for a complex `struct` it is useful +to allow variable number of options to be applied. However, the strong type +system of Go restricts the function design options. There are a few ways to +solve this problem, but we have landed on the following design. + +#### `config` + +Configuration should be held in a `struct` named `config`, or prefixed with +specific type name this Configuration applies to if there are multiple +`config` in the package. This `struct` must contain configuration options. + +```go +// config contains configuration options for a thing. +type config struct { + // options ... +} +``` + +In general the `config` `struct` will not need to be used externally to the +package and should be unexported. If, however, it is expected that the user +will likely want to build custom options for the configuration, the `config` +should be exported. Please, include in the documentation for the `config` +how the user can extend the configuration. + +It is important that `config` are not shared across package boundaries. +Meaning a `config` from one package should not be directly used by another. + +Optionally, it is common to include a `newConfig` function (with the same +naming scheme). This function wraps any defaults setting and looping over +all options to create a configured `config`. + +```go +// newConfig returns an appropriately configured config. +func newConfig([]Option) config { + // Set default values for config. + config := config{/* […] */} + for _, option := range options { + option.Apply(&config) + } + // Preform any validation here. + return config +} +``` + +If validation of the `config` options is also preformed this can return an +error as well that is expected to be handled by the instantiation function +or propagated to the user. + +Given the design goal of not having the user need to work with the `config`, +the `newConfig` function should also be unexported. + +#### `Option` + +To set the value of the options a `config` contains, a corresponding +`Option` interface type should be used. + +```go +type Option interface { + Apply(*config) +} +``` + +The name of the interface should be prefixed in the same way the +corresponding `config` is (if at all). + +#### Options + +All user configurable options for a `config` must have a related unexported +implementation of the `Option` interface and an exported configuration +function that wraps this implementation. + +The wrapping function name should be prefixed with `With*` (or in the +special case of a boolean options `Without*`) and should have the following +function signature. + +```go +func With*(…) Option { … } +``` + +##### `bool` Options + +```go +type defaultFalseOption bool + +func (o defaultFalseOption) Apply(c *config) { + c.Bool = bool(o) +} + +// WithOption sets a T* to have an option included. +func WithOption() Option { + return defaultFalseOption(true) +} +``` + +```go +type defaultTrueOption bool + +func (o defaultTrueOption) Apply(c *config) { + c.Bool = bool(o) +} + +// WithoutOption sets a T* to have Bool option excluded. +func WithoutOption() Option { + return defaultTrueOption(false) +} +```` + +##### Declared Type Options + +```go +type myTypeOption struct { + MyType MyType +} + +func (o myTypeOption) Apply(c *config) { + c.MyType = o.MyType +} + +// WithMyType sets T* to have include MyType. +func WithMyType(t MyType) Option { + return myTypeOption{t} +} +``` + +#### Instantiation + +Using this configuration pattern to configure instantiation with a `New*` +function. + +```go +func NewT*(options ...Option) T* {…} +``` + +Any required parameters can be declared before the variadic `options`. + +#### Dealing with Overlap + +Sometimes there are multiple complex `struct` that share common +configuration and also have distinct configuration. To avoid repeated +portions of `config`s, a common `config` can be used with the union of +options being handled with the `Option` interface. + +For example. + +```go +// config holds options for all animals. +type config struct { + Weight float64 + Color string + MaxAltitude float64 +} + +// DogOption apply Dog specific options. +type DogOption interface { + ApplyDog(*config) +} + +// BirdOption apply Bird specific options. +type BirdOption interface { + ApplyBird(*config) +} + +// Option apply options for all animals. +type Option interface { + BirdOption + DogOption +} + +type weightOption float64 +func (o weightOption) ApplyDog(c *config) { c.Weight = float64(o) } +func (o weightOption) ApplyBird(c *config) { c.Weight = float64(o) } +func WithWeight(w float64) Option { return weightOption(w) } + +type furColorOption string +func (o furColorOption) ApplyDog(c *config) { c.Color = string(o) } +func WithFurColor(c string) DogOption { return furColorOption(c) } + +type maxAltitudeOption float64 +func (o maxAltitudeOption) ApplyBird(c *config) { c.MaxAltitude = float64(o) } +func WithMaxAltitude(a float64) BirdOption { return maxAltitudeOption(a) } + +func NewDog(name string, o ...DogOption) Dog {…} +func NewBird(name string, o ...BirdOption) Bird {…} +``` + +### Interface Type + +To allow other developers to better comprehend the code, it is important +to ensure it is sufficiently documented. One simple measure that contributes +to this aim is self-documenting by naming method parameters. Therefore, +where appropriate, methods of every exported interface type should have +their parameters appropriately named. + +## Approvers and Maintainers + +Approvers: + +- [Evan Torrie](https://github.com/evantorrie), Verizon Media +- [Josh MacDonald](https://github.com/jmacd), LightStep +- [Sam Xie](https://github.com/XSAM) +- [David Ashpole](https://github.com/dashpole), Google +- [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep + +Maintainers: + +- [Anthony Mirabella](https://github.com/Aneurysm9), AWS +- [Tyler Yahn](https://github.com/MrAlias), Splunk + +### Become an Approver or a Maintainer + +See the [community membership document in OpenTelemetry community +repo](https://github.com/open-telemetry/community/blob/main/community-membership.md). diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/LICENSE b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/Makefile b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/Makefile new file mode 100644 index 000000000000..b290b667101a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/Makefile @@ -0,0 +1,179 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +EXAMPLES := $(shell ./get_main_pkgs.sh ./example) +TOOLS_MOD_DIR := ./internal/tools + +# All source code and documents. Used in spell check. +ALL_DOCS := $(shell find . -name '*.md' -type f | sort) +# All directories with go.mod files related to opentelemetry library. Used for building, testing and linting. +ALL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./example' | sort)) $(shell find ./example -type f -name 'go.mod' -exec dirname {} \; | sort) +ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./example|^$(TOOLS_MOD_DIR)' | sort) + +GO = go +TIMEOUT = 60 + +.DEFAULT_GOAL := precommit + +.PHONY: precommit ci +precommit: dependabot-check license-check lint build examples test-default +ci: precommit check-clean-work-tree test-coverage + +# Tools + +TOOLS = $(CURDIR)/.tools + +$(TOOLS): + @mkdir -p $@ +$(TOOLS)/%: | $(TOOLS) + cd $(TOOLS_MOD_DIR) && \ + $(GO) build -o $@ $(PACKAGE) + +CROSSLINK = $(TOOLS)/crosslink +$(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/crosslink + +GOLANGCI_LINT = $(TOOLS)/golangci-lint +$(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint + +MISSPELL = $(TOOLS)/misspell +$(TOOLS)/misspell: PACKAGE= github.com/client9/misspell/cmd/misspell + +STRINGER = $(TOOLS)/stringer +$(TOOLS)/stringer: PACKAGE=golang.org/x/tools/cmd/stringer + +$(TOOLS)/gojq: PACKAGE=github.com/itchyny/gojq/cmd/gojq + +.PHONY: tools +tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(STRINGER) $(TOOLS)/gojq + + +# Build + +.PHONY: examples generate build +examples: + @set -e; for dir in $(EXAMPLES); do \ + echo "$(GO) build $${dir}/..."; \ + (cd "$${dir}" && \ + $(GO) build .); \ + done + +generate: $(STRINGER) + set -e; for dir in $(ALL_GO_MOD_DIRS); do \ + echo "$(GO) generate $${dir}/..."; \ + (cd "$${dir}" && \ + PATH="$(TOOLS):$${PATH}" $(GO) generate ./...); \ + done + +build: generate + # Build all package code including testing code. + set -e; for dir in $(ALL_GO_MOD_DIRS); do \ + echo "$(GO) build $${dir}/..."; \ + (cd "$${dir}" && \ + $(GO) build ./... && \ + $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -vet=off -run xxxxxMatchNothingxxxxx >/dev/null); \ + done + +# Tests + +TEST_TARGETS := test-default test-bench test-short test-verbose test-race +.PHONY: $(TEST_TARGETS) test +test-default: ARGS=-v -race +test-bench: ARGS=-run=xxxxxMatchNothingxxxxx -test.benchtime=1ms -bench=. +test-short: ARGS=-short +test-verbose: ARGS=-v +test-race: ARGS=-race +$(TEST_TARGETS): test +test: + @set -e; for dir in $(ALL_GO_MOD_DIRS); do \ + echo "$(GO) test -timeout $(TIMEOUT)s $(ARGS) $${dir}/..."; \ + (cd "$${dir}" && \ + $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -timeout $(TIMEOUT)s $(ARGS)); \ + done + +COVERAGE_MODE = atomic +COVERAGE_PROFILE = coverage.out +.PHONY: test-coverage +test-coverage: + @set -e; \ + printf "" > coverage.txt; \ + for dir in $(ALL_COVERAGE_MOD_DIRS); do \ + echo "$(GO) test -coverpkg=./... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" $${dir}/..."; \ + (cd "$${dir}" && \ + $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -coverpkg=./... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" && \ + $(GO) tool cover -html=coverage.out -o coverage.html); \ + [ -f "$${dir}/coverage.out" ] && cat "$${dir}/coverage.out" >> coverage.txt; \ + done; \ + sed -i.bak -e '2,$$ { /^mode: /d; }' coverage.txt + +.PHONY: lint +lint: misspell lint-modules | $(GOLANGCI_LINT) + set -e; for dir in $(ALL_GO_MOD_DIRS); do \ + echo "golangci-lint in $${dir}"; \ + (cd "$${dir}" && \ + $(GOLANGCI_LINT) run --fix && \ + $(GOLANGCI_LINT) run); \ + done + +.PHONY: misspell +misspell: | $(MISSPELL) + $(MISSPELL) -w $(ALL_DOCS) + +.PHONY: lint-modules +lint-modules: | $(CROSSLINK) + set -e; for dir in $(ALL_GO_MOD_DIRS) $(TOOLS_MOD_DIR); do \ + echo "$(GO) mod tidy in $${dir}"; \ + (cd "$${dir}" && \ + $(GO) mod tidy); \ + done + echo "cross-linking all go modules" + $(CROSSLINK) + +.PHONY: license-check +license-check: + @licRes=$$(for f in $$(find . -type f \( -iname '*.go' -o -iname '*.sh' \) ! -path '**/third_party/*' ! -path './exporters/otlp/internal/opentelemetry-proto/*') ; do \ + awk '/Copyright The OpenTelemetry Authors|generated|GENERATED/ && NR<=3 { found=1; next } END { if (!found) print FILENAME }' $$f; \ + done); \ + if [ -n "$${licRes}" ]; then \ + echo "license header checking failed:"; echo "$${licRes}"; \ + exit 1; \ + fi + +.PHONY: dependabot-check +dependabot-check: + @result=$$( \ + for f in $$( find . -type f -name go.mod -exec dirname {} \; | sed 's/^.\/\?/\//' ); \ + do grep -q "$$f" .github/dependabot.yml \ + || echo "$$f"; \ + done; \ + ); \ + if [ -n "$$result" ]; then \ + echo "missing go.mod dependabot check:"; echo "$$result"; \ + exit 1; \ + fi + +.PHONY: check-clean-work-tree +check-clean-work-tree: + @if ! git diff --quiet; then \ + echo; \ + echo 'Working tree is not clean, did you forget to run "make precommit"?'; \ + echo; \ + git status; \ + exit 1; \ + fi diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/README.md b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/README.md new file mode 100644 index 000000000000..c841ba896e56 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/README.md @@ -0,0 +1,92 @@ +# OpenTelemetry-Go + +[![CI](https://github.com/open-telemetry/opentelemetry-go/workflows/ci/badge.svg)](https://github.com/open-telemetry/opentelemetry-go/actions?query=workflow%3Aci+branch%3Amain) +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel)](https://pkg.go.dev/go.opentelemetry.io/otel) +[![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/otel)](https://goreportcard.com/report/go.opentelemetry.io/otel) +[![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT) + + +The Go [OpenTelemetry](https://opentelemetry.io/) implementation. + +## Project Status + +**Warning**: this project is currently in a pre-GA phase. Backwards +incompatible changes may be introduced in subsequent minor version releases as +we work to track the evolving OpenTelemetry specification and user feedback. + +Our progress towards a GA release candidate is tracked in [this project +board](https://github.com/orgs/open-telemetry/projects/5). This release +candidate will follow semantic versioning and will be released with a major +version greater than zero. + +Progress and status specific to this repository is tracked in our local +[project boards](https://github.com/open-telemetry/opentelemetry-go/projects) +and +[milestones](https://github.com/open-telemetry/opentelemetry-go/milestones). + +Project versioning information and stability guarantees can be found in the +[versioning documentation](./VERSIONING.md). + +### Compatibility + +This project is tested on the following systems. + +| OS | Go Version | Architecture | +| ------- | ---------- | ------------ | +| Ubuntu | 1.15 | amd64 | +| Ubuntu | 1.14 | amd64 | +| Ubuntu | 1.15 | 386 | +| Ubuntu | 1.14 | 386 | +| MacOS | 1.15 | amd64 | +| MacOS | 1.14 | amd64 | +| Windows | 1.15 | amd64 | +| Windows | 1.14 | amd64 | +| Windows | 1.15 | 386 | +| Windows | 1.14 | 386 | + +While this project should work for other systems, no compatibility guarantees +are made for those systems currently. + +## Getting Started + +You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/go/getting-started/). + +OpenTelemetry's goal is to provide a single set of APIs to capture distributed +traces and metrics from your application and send them to an observability +platform. This project allows you to do just that for applications written in +Go. There are two steps to this process: instrument your application, and +configure an exporter. + +### Instrumentation + +To start capturing distributed traces and metric events from your application +it first needs to be instrumented. The easiest way to do this is by using an +instrumentation library for your code. Be sure to check out [the officially +supported instrumentation +libraries](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation). + +If you need to extend the telemetry an instrumentation library provides or want +to build your own instrumentation for your application directly you will need +to use the +[go.opentelemetry.io/otel/api](https://pkg.go.dev/go.opentelemetry.io/otel/api) +package. The included [examples](./example/) are a good way to see some +practical uses of this process. + +### Export + +Now that your application is instrumented to collect telemetry, it needs an +export pipeline to send that telemetry to an observability platform. + +You can find officially supported exporters [here](./exporters/) and in the +companion [contrib +repository](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/exporters/metric). +Additionally, there are many vendor specific or 3rd party exporters for +OpenTelemetry. These exporters are broken down by +[trace](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/export/trace?tab=importedby) +and +[metric](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/export/metric?tab=importedby) +support. + +## Contributing + +See the [contributing documentation](CONTRIBUTING.md). diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/RELEASING.md b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/RELEASING.md new file mode 100644 index 000000000000..71d23b47a546 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/RELEASING.md @@ -0,0 +1,81 @@ +# Release Process + +## Pre-Release + +Update go.mod for submodules to depend on the new release which will happen in the next step. + +1. Run the pre-release script. It creates a branch `pre_release_` that will contain all release changes. + + ``` + ./pre_release.sh -t + ``` + +2. Verify the changes. + + ``` + git diff main + ``` + + This should have changed the version for all modules to be ``. + +3. Update the [Changelog](./CHANGELOG.md). + - Make sure all relevant changes for this release are included and are in language that non-contributors to the project can understand. + To verify this, you can look directly at the commits since the ``. + + ``` + git --no-pager log --pretty=oneline "..HEAD" + ``` + + - Move all the `Unreleased` changes into a new section following the title scheme (`[] - `). + - Update all the appropriate links at the bottom. + +4. Push the changes to upstream and create a Pull Request on GitHub. + Be sure to include the curated changes from the [Changelog](./CHANGELOG.md) in the description. + + +## Tag + +Once the Pull Request with all the version changes has been approved and merged it is time to tag the merged commit. + +***IMPORTANT***: It is critical you use the same tag that you used in the Pre-Release step! +Failure to do so will leave things in a broken state. + +***IMPORTANT***: [There is currently no way to remove an incorrectly tagged version of a Go module](https://github.com/golang/go/issues/34189). +It is critical you make sure the version you push upstream is correct. +[Failure to do so will lead to minor emergencies and tough to work around](https://github.com/open-telemetry/opentelemetry-go/issues/331). + +1. Run the tag.sh script using the `` of the commit on the main branch for the merged Pull Request. + + ``` + ./tag.sh + ``` + +2. Push tags to the upstream remote (not your fork: `github.com/open-telemetry/opentelemetry-go.git`). + Make sure you push all sub-modules as well. + + ``` + git push upstream + git push upstream + ... + ``` + +## Release + +Finally create a Release for the new `` on GitHub. +The release body should include all the release notes from the Changelog for this release. +Additionally, the `tag.sh` script generates commit logs since last release which can be used to supplement the release notes. + +## Verify Examples + +After releasing verify that examples build outside of the repository. + +``` +./verify_examples.sh +``` + +The script copies examples into a different directory removes any `replace` declarations in `go.mod` and builds them. +This ensures they build with the published release, not the local copy. + +## Contrib Repository + +Once verified be sure to [make a release for the `contrib` repository](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md) that uses this release. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/VERSIONING.md b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/VERSIONING.md new file mode 100644 index 000000000000..3579b794ee97 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/VERSIONING.md @@ -0,0 +1,217 @@ +# Versioning + +This document describes the versioning policy for this repository. This policy +is designed so the following goals can be achieved. + +**Users are provided a codebase of value that is stable and secure.** + +## Policy + +* Versioning of this project will be idiomatic of a Go project using [Go + modules](https://github.com/golang/go/wiki/Modules). + * [Semantic import + versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) + will be used. + * Versions will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html). + * If a module is version `v2` or higher, the major version of the module + must be included as a `/vN` at the end of the module paths used in + `go.mod` files (e.g., `module go.opentelemetry.io/otel/v2`, `require + go.opentelemetry.io/otel/v2 v2.0.1`) and in the package import path + (e.g., `import "go.opentelemetry.io/otel/v2/trace"`). This includes the + paths used in `go get` commands (e.g., `go get + go.opentelemetry.io/otel/v2@v2.0.1`. Note there is both a `/v2` and a + `@v2.0.1` in that example. One way to think about it is that the module + name now includes the `/v2`, so include `/v2` whenever you are using the + module name). + * If a module is version `v0` or `v1`, do not include the major version in + either the module path or the import path. + * Modules will be used to encapsulate signals and components. + * Experimental modules still under active development will be versioned at + `v0` to imply the stability guarantee defined by + [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). + + > Major version zero (0.y.z) is for initial development. Anything MAY + > change at any time. The public API SHOULD NOT be considered stable. + + * Mature modules for which we guarantee a stable public API will be versioned + with a major version greater than `v0`. + * The decision to make a module stable will be made on a case-by-case + basis by the maintainers of this project. + * Experimental modules will start their versioning at `v0.0.0` and will + increment their minor version when backwards incompatible changes are + released and increment their patch version when backwards compatible + changes are released. + * All stable modules that use the same major version number will use the + same entire version number. + * Stable modules may be released with an incremented minor or patch + version even though that module has not been changed, but rather so + that it will remain at the same version as other stable modules that + did undergo change. + * When an experimental module becomes stable a new stable module version + will be released and will include this now stable module. The new + stable module version will be an increment of the minor version number + and will be applied to all existing stable modules as well as the newly + stable module being released. +* Versioning of the associated [contrib + repository](https://github.com/open-telemetry/opentelemetry-go-contrib) of + this project will be idiomatic of a Go project using [Go + modules](https://github.com/golang/go/wiki/Modules). + * [Semantic import + versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) + will be used. + * Versions will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html). + * If a module is version `v2` or higher, the + major version of the module must be included as a `/vN` at the end of the + module paths used in `go.mod` files (e.g., `module + go.opentelemetry.io/contrib/instrumentation/host/v2`, `require + go.opentelemetry.io/contrib/instrumentation/host/v2 v2.0.1`) and in the + package import path (e.g., `import + "go.opentelemetry.io/contrib/instrumentation/host/v2"`). This includes + the paths used in `go get` commands (e.g., `go get + go.opentelemetry.io/contrib/instrumentation/host/v2@v2.0.1`. Note there + is both a `/v2` and a `@v2.0.1` in that example. One way to think about + it is that the module name now includes the `/v2`, so include `/v2` + whenever you are using the module name). + * If a module is version `v0` or `v1`, do not include the major version + in either the module path or the import path. + * In addition to public APIs, telemetry produced by stable instrumentation + will remain stable and backwards compatible. This is to avoid breaking + alerts and dashboard. + * Modules will be used to encapsulate instrumentation, detectors, exporters, + propagators, and any other independent sets of related components. + * Experimental modules still under active development will be versioned at + `v0` to imply the stability guarantee defined by + [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). + + > Major version zero (0.y.z) is for initial development. Anything MAY + > change at any time. The public API SHOULD NOT be considered stable. + + * Mature modules for which we guarantee a stable public API and telemetry will + be versioned with a major version greater than `v0`. + * Experimental modules will start their versioning at `v0.0.0` and will + increment their minor version when backwards incompatible changes are + released and increment their patch version when backwards compatible + changes are released. + * Stable contrib modules cannot depend on experimental modules from this + project. + * All stable contrib modules of the same major version with this project + will use the same entire version as this project. + * Stable modules may be released with an incremented minor or patch + version even though that module's code has not been changed. Instead + the only change that will have been included is to have updated that + modules dependency on this project's stable APIs. + * When an experimental module in contrib becomes stable a new stable + module version will be released and will include this now stable + module. The new stable module version will be an increment of the minor + version number and will be applied to all existing stable contrib + modules, this project's modules, and the newly stable module being + released. + * Contrib modules will be kept up to date with this project's releases. + * Due to the dependency contrib modules will implicitly have on this + project's modules the release of stable contrib modules to match the + released version number will be staggered after this project's release. + There is no explicit time guarantee for how long after this projects + release the contrib release will be. Effort should be made to keep them + as close in time as possible. + * No additional stable release in this project can be made until the + contrib repository has a matching stable release. + * No release can be made in the contrib repository after this project's + stable release except for a stable release of the contrib repository. +* GitHub releases will be made for all releases. +* Go modules will be made available at Go package mirrors. + +## Example Versioning Lifecycle + +To better understand the implementation of the above policy the following +example is provided. This project is simplified to include only the following +modules and their versions: + +* `otel`: `v0.14.0` +* `otel/trace`: `v0.14.0` +* `otel/metric`: `v0.14.0` +* `otel/baggage`: `v0.14.0` +* `otel/sdk/trace`: `v0.14.0` +* `otel/sdk/metric`: `v0.14.0` + +These modules have been developed to a point where the `otel/trace`, +`otel/baggage`, and `otel/sdk/trace` modules have reached a point that they +should be considered for a stable release. The `otel/metric` and +`otel/sdk/metric` are still under active development and the `otel` module +depends on both `otel/trace` and `otel/metric`. + +The `otel` package is refactored to remove its dependencies on `otel/metric` so +it can be released as stable as well. With that done the following release +candidates are made: + +* `otel`: `v1.0.0-rc.1` +* `otel/trace`: `v1.0.0-rc.1` +* `otel/baggage`: `v1.0.0-rc.1` +* `otel/sdk/trace`: `v1.0.0-rc.1` + +The `otel/metric` and `otel/sdk/metric` modules remain at `v0.14.0`. + +A few minor issues are discovered in the `otel/trace` package. These issues are +resolved with some minor, but backwards incompatible, changes and are released +as a second release candidate: + +* `otel`: `v1.0.0-rc.2` +* `otel/trace`: `v1.0.0-rc.2` +* `otel/baggage`: `v1.0.0-rc.2` +* `otel/sdk/trace`: `v1.0.0-rc.2` + +Notice that all module version numbers are incremented to adhere to our +versioning policy. + +After these release candidates have been evaluated to satisfaction, they are +released as version `v1.0.0`. + +* `otel`: `v1.0.0` +* `otel/trace`: `v1.0.0` +* `otel/baggage`: `v1.0.0` +* `otel/sdk/trace`: `v1.0.0` + +Since both the `go` utility and the Go module system support [the semantic +versioning definition of +precedence](https://semver.org/spec/v2.0.0.html#spec-item-11), this release +will correctly be interpreted as the successor to the previous release +candidates. + +Active development of this project continues. The `otel/metric` module now has +backwards incompatible changes to its API that need to be released and the +`otel/baggage` module has a minor bug fix that needs to be released. The +following release is made: + +* `otel`: `v1.0.1` +* `otel/trace`: `v1.0.1` +* `otel/metric`: `v0.15.0` +* `otel/baggage`: `v1.0.1` +* `otel/sdk/trace`: `v1.0.1` +* `otel/sdk/metric`: `v0.15.0` + +Notice that, again, all stable module versions are incremented in unison and +the `otel/sdk/metric` package, which depends on the `otel/metric` package, also +bumped its version. This bump of the `otel/sdk/metric` package makes sense +given their coupling, though it is not explicitly required by our versioning +policy. + +As we progress, the `otel/metric` and `otel/sdk/metric` packages have reached a +point where they should be evaluated for stability. The `otel` module is +reintegrated with the `otel/metric` package and the following release is made: + +* `otel`: `v1.1.0-rc.1` +* `otel/trace`: `v1.1.0-rc.1` +* `otel/metric`: `v1.1.0-rc.1` +* `otel/baggage`: `v1.1.0-rc.1` +* `otel/sdk/trace`: `v1.1.0-rc.1` +* `otel/sdk/metric`: `v1.1.0-rc.1` + +All the modules are evaluated and determined to a viable stable release. They +are then released as version `v1.1.0` (the minor version is incremented to +indicate the addition of new signal). + +* `otel`: `v1.1.0` +* `otel/trace`: `v1.1.0` +* `otel/metric`: `v1.1.0` +* `otel/baggage`: `v1.1.0` +* `otel/sdk/trace`: `v1.1.0` +* `otel/sdk/metric`: `v1.1.0` diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/doc.go new file mode 100644 index 000000000000..44bc32c9e072 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/doc.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// package attribute provides key and value attributes. +// +// This package is currently in a pre-GA phase. Backwards incompatible changes +// may be introduced in subsequent minor version releases as we work to track +// the evolving OpenTelemetry specification and user feedback. +package attribute // import "go.opentelemetry.io/otel/attribute" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/encoder.go new file mode 100644 index 000000000000..8b940f78dc4a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/encoder.go @@ -0,0 +1,150 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "bytes" + "sync" + "sync/atomic" +) + +type ( + // Encoder is a mechanism for serializing a label set into a + // specific string representation that supports caching, to + // avoid repeated serialization. An example could be an + // exporter encoding the label set into a wire representation. + Encoder interface { + // Encode returns the serialized encoding of the label + // set using its Iterator. This result may be cached + // by a attribute.Set. + Encode(iterator Iterator) string + + // ID returns a value that is unique for each class of + // label encoder. Label encoders allocate these using + // `NewEncoderID`. + ID() EncoderID + } + + // EncoderID is used to identify distinct Encoder + // implementations, for caching encoded results. + EncoderID struct { + value uint64 + } + + // defaultLabelEncoder uses a sync.Pool of buffers to reduce + // the number of allocations used in encoding labels. This + // implementation encodes a comma-separated list of key=value, + // with '/'-escaping of '=', ',', and '\'. + defaultLabelEncoder struct { + // pool is a pool of labelset builders. The buffers in this + // pool grow to a size that most label encodings will not + // allocate new memory. + pool sync.Pool // *bytes.Buffer + } +) + +// escapeChar is used to ensure uniqueness of the label encoding where +// keys or values contain either '=' or ','. Since there is no parser +// needed for this encoding and its only requirement is to be unique, +// this choice is arbitrary. Users will see these in some exporters +// (e.g., stdout), so the backslash ('\') is used as a conventional choice. +const escapeChar = '\\' + +var ( + _ Encoder = &defaultLabelEncoder{} + + // encoderIDCounter is for generating IDs for other label + // encoders. + encoderIDCounter uint64 + + defaultEncoderOnce sync.Once + defaultEncoderID = NewEncoderID() + defaultEncoderInstance *defaultLabelEncoder +) + +// NewEncoderID returns a unique label encoder ID. It should be +// called once per each type of label encoder. Preferably in init() or +// in var definition. +func NewEncoderID() EncoderID { + return EncoderID{value: atomic.AddUint64(&encoderIDCounter, 1)} +} + +// DefaultEncoder returns a label encoder that encodes labels +// in such a way that each escaped label's key is followed by an equal +// sign and then by an escaped label's value. All key-value pairs are +// separated by a comma. +// +// Escaping is done by prepending a backslash before either a +// backslash, equal sign or a comma. +func DefaultEncoder() Encoder { + defaultEncoderOnce.Do(func() { + defaultEncoderInstance = &defaultLabelEncoder{ + pool: sync.Pool{ + New: func() interface{} { + return &bytes.Buffer{} + }, + }, + } + }) + return defaultEncoderInstance +} + +// Encode is a part of an implementation of the LabelEncoder +// interface. +func (d *defaultLabelEncoder) Encode(iter Iterator) string { + buf := d.pool.Get().(*bytes.Buffer) + defer d.pool.Put(buf) + buf.Reset() + + for iter.Next() { + i, keyValue := iter.IndexedLabel() + if i > 0 { + _, _ = buf.WriteRune(',') + } + copyAndEscape(buf, string(keyValue.Key)) + + _, _ = buf.WriteRune('=') + + if keyValue.Value.Type() == STRING { + copyAndEscape(buf, keyValue.Value.AsString()) + } else { + _, _ = buf.WriteString(keyValue.Value.Emit()) + } + } + return buf.String() +} + +// ID is a part of an implementation of the LabelEncoder interface. +func (*defaultLabelEncoder) ID() EncoderID { + return defaultEncoderID +} + +// copyAndEscape escapes `=`, `,` and its own escape character (`\`), +// making the default encoding unique. +func copyAndEscape(buf *bytes.Buffer, val string) { + for _, ch := range val { + switch ch { + case '=', ',', escapeChar: + buf.WriteRune(escapeChar) + } + buf.WriteRune(ch) + } +} + +// Valid returns true if this encoder ID was allocated by +// `NewEncoderID`. Invalid encoder IDs will not be cached. +func (id EncoderID) Valid() bool { + return id.value != 0 +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/iterator.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/iterator.go new file mode 100644 index 000000000000..e03aabb62bd3 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/iterator.go @@ -0,0 +1,143 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +// Iterator allows iterating over the set of labels in order, +// sorted by key. +type Iterator struct { + storage *Set + idx int +} + +// MergeIterator supports iterating over two sets of labels while +// eliminating duplicate values from the combined set. The first +// iterator value takes precedence. +type MergeIterator struct { + one oneIterator + two oneIterator + current KeyValue +} + +type oneIterator struct { + iter Iterator + done bool + label KeyValue +} + +// Next moves the iterator to the next position. Returns false if there +// are no more labels. +func (i *Iterator) Next() bool { + i.idx++ + return i.idx < i.Len() +} + +// Label returns current KeyValue. Must be called only after Next returns +// true. +func (i *Iterator) Label() KeyValue { + kv, _ := i.storage.Get(i.idx) + return kv +} + +// Attribute is a synonym for Label(). +func (i *Iterator) Attribute() KeyValue { + return i.Label() +} + +// IndexedLabel returns current index and attribute. Must be called only +// after Next returns true. +func (i *Iterator) IndexedLabel() (int, KeyValue) { + return i.idx, i.Label() +} + +// Len returns a number of labels in the iterator's `*Set`. +func (i *Iterator) Len() int { + return i.storage.Len() +} + +// ToSlice is a convenience function that creates a slice of labels +// from the passed iterator. The iterator is set up to start from the +// beginning before creating the slice. +func (i *Iterator) ToSlice() []KeyValue { + l := i.Len() + if l == 0 { + return nil + } + i.idx = -1 + slice := make([]KeyValue, 0, l) + for i.Next() { + slice = append(slice, i.Label()) + } + return slice +} + +// NewMergeIterator returns a MergeIterator for merging two label sets +// Duplicates are resolved by taking the value from the first set. +func NewMergeIterator(s1, s2 *Set) MergeIterator { + mi := MergeIterator{ + one: makeOne(s1.Iter()), + two: makeOne(s2.Iter()), + } + return mi +} + +func makeOne(iter Iterator) oneIterator { + oi := oneIterator{ + iter: iter, + } + oi.advance() + return oi +} + +func (oi *oneIterator) advance() { + if oi.done = !oi.iter.Next(); !oi.done { + oi.label = oi.iter.Label() + } +} + +// Next returns true if there is another label available. +func (m *MergeIterator) Next() bool { + if m.one.done && m.two.done { + return false + } + if m.one.done { + m.current = m.two.label + m.two.advance() + return true + } + if m.two.done { + m.current = m.one.label + m.one.advance() + return true + } + if m.one.label.Key == m.two.label.Key { + m.current = m.one.label // first iterator label value wins + m.one.advance() + m.two.advance() + return true + } + if m.one.label.Key < m.two.label.Key { + m.current = m.one.label + m.one.advance() + return true + } + m.current = m.two.label + m.two.advance() + return true +} + +// Label returns the current value after Next() returns true. +func (m *MergeIterator) Label() KeyValue { + return m.current +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/key.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/key.go new file mode 100644 index 000000000000..492c438a9f54 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/key.go @@ -0,0 +1,102 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +// Key represents the key part in key-value pairs. It's a string. The +// allowed character set in the key depends on the use of the key. +type Key string + +// Bool creates a KeyValue instance with a BOOL Value. +// +// If creating both key and a bool value at the same time, then +// instead of calling Key(name).Bool(value) consider using a +// convenience function provided by the api/key package - +// key.Bool(name, value). +func (k Key) Bool(v bool) KeyValue { + return KeyValue{ + Key: k, + Value: BoolValue(v), + } +} + +// Int64 creates a KeyValue instance with an INT64 Value. +// +// If creating both key and an int64 value at the same time, then +// instead of calling Key(name).Int64(value) consider using a +// convenience function provided by the api/key package - +// key.Int64(name, value). +func (k Key) Int64(v int64) KeyValue { + return KeyValue{ + Key: k, + Value: Int64Value(v), + } +} + +// Float64 creates a KeyValue instance with a FLOAT64 Value. +// +// If creating both key and a float64 value at the same time, then +// instead of calling Key(name).Float64(value) consider using a +// convenience function provided by the api/key package - +// key.Float64(name, value). +func (k Key) Float64(v float64) KeyValue { + return KeyValue{ + Key: k, + Value: Float64Value(v), + } +} + +// String creates a KeyValue instance with a STRING Value. +// +// If creating both key and a string value at the same time, then +// instead of calling Key(name).String(value) consider using a +// convenience function provided by the api/key package - +// key.String(name, value). +func (k Key) String(v string) KeyValue { + return KeyValue{ + Key: k, + Value: StringValue(v), + } +} + +// Int creates a KeyValue instance with an INT64 Value. +// +// If creating both key and an int value at the same time, then +// instead of calling Key(name).Int(value) consider using a +// convenience function provided by the api/key package - +// key.Int(name, value). +func (k Key) Int(v int) KeyValue { + return KeyValue{ + Key: k, + Value: IntValue(v), + } +} + +// Defined returns true for non-empty keys. +func (k Key) Defined() bool { + return len(k) != 0 +} + +// Array creates a KeyValue instance with a ARRAY Value. +// +// If creating both key and a array value at the same time, then +// instead of calling Key(name).String(value) consider using a +// convenience function provided by the api/key package - +// key.Array(name, value). +func (k Key) Array(v interface{}) KeyValue { + return KeyValue{ + Key: k, + Value: ArrayValue(v), + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/kv.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/kv.go new file mode 100644 index 000000000000..2fcc8863f733 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/kv.go @@ -0,0 +1,108 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "encoding/json" + "fmt" + "reflect" +) + +// KeyValue holds a key and value pair. +type KeyValue struct { + Key Key + Value Value +} + +// Valid returns if kv is a valid OpenTelemetry attribute. +func (kv KeyValue) Valid() bool { + return kv.Key != "" && kv.Value.Type() != INVALID +} + +// Bool creates a new key-value pair with a passed name and a bool +// value. +func Bool(k string, v bool) KeyValue { + return Key(k).Bool(v) +} + +// Int64 creates a new key-value pair with a passed name and an int64 +// value. +func Int64(k string, v int64) KeyValue { + return Key(k).Int64(v) +} + +// Float64 creates a new key-value pair with a passed name and a float64 +// value. +func Float64(k string, v float64) KeyValue { + return Key(k).Float64(v) +} + +// String creates a new key-value pair with a passed name and a string +// value. +func String(k, v string) KeyValue { + return Key(k).String(v) +} + +// Stringer creates a new key-value pair with a passed name and a string +// value generated by the passed Stringer interface. +func Stringer(k string, v fmt.Stringer) KeyValue { + return Key(k).String(v.String()) +} + +// Int creates a new key-value pair instance with a passed name and +// either an int32 or an int64 value, depending on whether the int +// type is 32 or 64 bits wide. +func Int(k string, v int) KeyValue { + return Key(k).Int(v) +} + +// Array creates a new key-value pair with a passed name and a array. +// Only arrays of primitive type are supported. +func Array(k string, v interface{}) KeyValue { + return Key(k).Array(v) +} + +// Any creates a new key-value pair instance with a passed name and +// automatic type inference. This is slower, and not type-safe. +func Any(k string, value interface{}) KeyValue { + if value == nil { + return String(k, "") + } + + if stringer, ok := value.(fmt.Stringer); ok { + return String(k, stringer.String()) + } + + rv := reflect.ValueOf(value) + + switch rv.Kind() { + case reflect.Array, reflect.Slice: + return Array(k, value) + case reflect.Bool: + return Bool(k, rv.Bool()) + case reflect.Int, reflect.Int8, reflect.Int16: + return Int(k, int(rv.Int())) + case reflect.Int64: + return Int64(k, rv.Int()) + case reflect.Float64: + return Float64(k, rv.Float()) + case reflect.String: + return String(k, rv.String()) + } + if b, err := json.Marshal(value); b != nil && err == nil { + return String(k, string(b)) + } + return String(k, fmt.Sprint(value)) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/set.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/set.go new file mode 100644 index 000000000000..882dc112f728 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/set.go @@ -0,0 +1,471 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "encoding/json" + "reflect" + "sort" + "sync" +) + +type ( + // Set is the representation for a distinct label set. It + // manages an immutable set of labels, with an internal cache + // for storing label encodings. + // + // This type supports the `Equivalent` method of comparison + // using values of type `Distinct`. + // + // This type is used to implement: + // 1. Metric labels + // 2. Resource sets + // 3. Correlation map (TODO) + Set struct { + equivalent Distinct + + lock sync.Mutex + encoders [maxConcurrentEncoders]EncoderID + encoded [maxConcurrentEncoders]string + } + + // Distinct wraps a variable-size array of `KeyValue`, + // constructed with keys in sorted order. This can be used as + // a map key or for equality checking between Sets. + Distinct struct { + iface interface{} + } + + // Filter supports removing certain labels from label sets. + // When the filter returns true, the label will be kept in + // the filtered label set. When the filter returns false, the + // label is excluded from the filtered label set, and the + // label instead appears in the `removed` list of excluded labels. + Filter func(KeyValue) bool + + // Sortable implements `sort.Interface`, used for sorting + // `KeyValue`. This is an exported type to support a + // memory optimization. A pointer to one of these is needed + // for the call to `sort.Stable()`, which the caller may + // provide in order to avoid an allocation. See + // `NewSetWithSortable()`. + Sortable []KeyValue +) + +var ( + // keyValueType is used in `computeDistinctReflect`. + keyValueType = reflect.TypeOf(KeyValue{}) + + // emptySet is returned for empty label sets. + emptySet = &Set{ + equivalent: Distinct{ + iface: [0]KeyValue{}, + }, + } +) + +const maxConcurrentEncoders = 3 + +// EmptySet returns a reference to a Set with no elements. +// +// This is a convenience provided for optimized calling utility. +func EmptySet() *Set { + return emptySet +} + +// reflect abbreviates `reflect.ValueOf`. +func (d Distinct) reflect() reflect.Value { + return reflect.ValueOf(d.iface) +} + +// Valid returns true if this value refers to a valid `*Set`. +func (d Distinct) Valid() bool { + return d.iface != nil +} + +// Len returns the number of labels in this set. +func (l *Set) Len() int { + if l == nil || !l.equivalent.Valid() { + return 0 + } + return l.equivalent.reflect().Len() +} + +// Get returns the KeyValue at ordered position `idx` in this set. +func (l *Set) Get(idx int) (KeyValue, bool) { + if l == nil { + return KeyValue{}, false + } + value := l.equivalent.reflect() + + if idx >= 0 && idx < value.Len() { + // Note: The Go compiler successfully avoids an allocation for + // the interface{} conversion here: + return value.Index(idx).Interface().(KeyValue), true + } + + return KeyValue{}, false +} + +// Value returns the value of a specified key in this set. +func (l *Set) Value(k Key) (Value, bool) { + if l == nil { + return Value{}, false + } + rValue := l.equivalent.reflect() + vlen := rValue.Len() + + idx := sort.Search(vlen, func(idx int) bool { + return rValue.Index(idx).Interface().(KeyValue).Key >= k + }) + if idx >= vlen { + return Value{}, false + } + keyValue := rValue.Index(idx).Interface().(KeyValue) + if k == keyValue.Key { + return keyValue.Value, true + } + return Value{}, false +} + +// HasValue tests whether a key is defined in this set. +func (l *Set) HasValue(k Key) bool { + if l == nil { + return false + } + _, ok := l.Value(k) + return ok +} + +// Iter returns an iterator for visiting the labels in this set. +func (l *Set) Iter() Iterator { + return Iterator{ + storage: l, + idx: -1, + } +} + +// ToSlice returns the set of labels belonging to this set, sorted, +// where keys appear no more than once. +func (l *Set) ToSlice() []KeyValue { + iter := l.Iter() + return iter.ToSlice() +} + +// Equivalent returns a value that may be used as a map key. The +// Distinct type guarantees that the result will equal the equivalent +// Distinct value of any label set with the same elements as this, +// where sets are made unique by choosing the last value in the input +// for any given key. +func (l *Set) Equivalent() Distinct { + if l == nil || !l.equivalent.Valid() { + return emptySet.equivalent + } + return l.equivalent +} + +// Equals returns true if the argument set is equivalent to this set. +func (l *Set) Equals(o *Set) bool { + return l.Equivalent() == o.Equivalent() +} + +// Encoded returns the encoded form of this set, according to +// `encoder`. The result will be cached in this `*Set`. +func (l *Set) Encoded(encoder Encoder) string { + if l == nil || encoder == nil { + return "" + } + + id := encoder.ID() + if !id.Valid() { + // Invalid IDs are not cached. + return encoder.Encode(l.Iter()) + } + + var lookup *string + l.lock.Lock() + for idx := 0; idx < maxConcurrentEncoders; idx++ { + if l.encoders[idx] == id { + lookup = &l.encoded[idx] + break + } + } + l.lock.Unlock() + + if lookup != nil { + return *lookup + } + + r := encoder.Encode(l.Iter()) + + l.lock.Lock() + defer l.lock.Unlock() + + for idx := 0; idx < maxConcurrentEncoders; idx++ { + if l.encoders[idx] == id { + return l.encoded[idx] + } + if !l.encoders[idx].Valid() { + l.encoders[idx] = id + l.encoded[idx] = r + return r + } + } + + // TODO: This is a performance cliff. Find a way for this to + // generate a warning. + return r +} + +func empty() Set { + return Set{ + equivalent: emptySet.equivalent, + } +} + +// NewSet returns a new `Set`. See the documentation for +// `NewSetWithSortableFiltered` for more details. +// +// Except for empty sets, this method adds an additional allocation +// compared with calls that include a `*Sortable`. +func NewSet(kvs ...KeyValue) Set { + // Check for empty set. + if len(kvs) == 0 { + return empty() + } + s, _ := NewSetWithSortableFiltered(kvs, new(Sortable), nil) + return s //nolint +} + +// NewSetWithSortable returns a new `Set`. See the documentation for +// `NewSetWithSortableFiltered` for more details. +// +// This call includes a `*Sortable` option as a memory optimization. +func NewSetWithSortable(kvs []KeyValue, tmp *Sortable) Set { + // Check for empty set. + if len(kvs) == 0 { + return empty() + } + s, _ := NewSetWithSortableFiltered(kvs, tmp, nil) + return s //nolint +} + +// NewSetWithFiltered returns a new `Set`. See the documentation for +// `NewSetWithSortableFiltered` for more details. +// +// This call includes a `Filter` to include/exclude label keys from +// the return value. Excluded keys are returned as a slice of label +// values. +func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) { + // Check for empty set. + if len(kvs) == 0 { + return empty(), nil + } + return NewSetWithSortableFiltered(kvs, new(Sortable), filter) +} + +// NewSetWithSortableFiltered returns a new `Set`. +// +// Duplicate keys are eliminated by taking the last value. This +// re-orders the input slice so that unique last-values are contiguous +// at the end of the slice. +// +// This ensures the following: +// +// - Last-value-wins semantics +// - Caller sees the reordering, but doesn't lose values +// - Repeated call preserve last-value wins. +// +// Note that methods are defined on `*Set`, although this returns `Set`. +// Callers can avoid memory allocations by: +// +// - allocating a `Sortable` for use as a temporary in this method +// - allocating a `Set` for storing the return value of this +// constructor. +// +// The result maintains a cache of encoded labels, by attribute.EncoderID. +// This value should not be copied after its first use. +// +// The second `[]KeyValue` return value is a list of labels that were +// excluded by the Filter (if non-nil). +func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (Set, []KeyValue) { + // Check for empty set. + if len(kvs) == 0 { + return empty(), nil + } + + *tmp = kvs + + // Stable sort so the following de-duplication can implement + // last-value-wins semantics. + sort.Stable(tmp) + + *tmp = nil + + position := len(kvs) - 1 + offset := position - 1 + + // The requirements stated above require that the stable + // result be placed in the end of the input slice, while + // overwritten values are swapped to the beginning. + // + // De-duplicate with last-value-wins semantics. Preserve + // duplicate values at the beginning of the input slice. + for ; offset >= 0; offset-- { + if kvs[offset].Key == kvs[position].Key { + continue + } + position-- + kvs[offset], kvs[position] = kvs[position], kvs[offset] + } + if filter != nil { + return filterSet(kvs[position:], filter) + } + return Set{ + equivalent: computeDistinct(kvs[position:]), + }, nil +} + +// filterSet reorders `kvs` so that included keys are contiguous at +// the end of the slice, while excluded keys precede the included keys. +func filterSet(kvs []KeyValue, filter Filter) (Set, []KeyValue) { + var excluded []KeyValue + + // Move labels that do not match the filter so + // they're adjacent before calling computeDistinct(). + distinctPosition := len(kvs) + + // Swap indistinct keys forward and distinct keys toward the + // end of the slice. + offset := len(kvs) - 1 + for ; offset >= 0; offset-- { + if filter(kvs[offset]) { + distinctPosition-- + kvs[offset], kvs[distinctPosition] = kvs[distinctPosition], kvs[offset] + continue + } + } + excluded = kvs[:distinctPosition] + + return Set{ + equivalent: computeDistinct(kvs[distinctPosition:]), + }, excluded +} + +// Filter returns a filtered copy of this `Set`. See the +// documentation for `NewSetWithSortableFiltered` for more details. +func (l *Set) Filter(re Filter) (Set, []KeyValue) { + if re == nil { + return Set{ + equivalent: l.equivalent, + }, nil + } + + // Note: This could be refactored to avoid the temporary slice + // allocation, if it proves to be expensive. + return filterSet(l.ToSlice(), re) +} + +// computeDistinct returns a `Distinct` using either the fixed- or +// reflect-oriented code path, depending on the size of the input. +// The input slice is assumed to already be sorted and de-duplicated. +func computeDistinct(kvs []KeyValue) Distinct { + iface := computeDistinctFixed(kvs) + if iface == nil { + iface = computeDistinctReflect(kvs) + } + return Distinct{ + iface: iface, + } +} + +// computeDistinctFixed computes a `Distinct` for small slices. It +// returns nil if the input is too large for this code path. +func computeDistinctFixed(kvs []KeyValue) interface{} { + switch len(kvs) { + case 1: + ptr := new([1]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 2: + ptr := new([2]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 3: + ptr := new([3]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 4: + ptr := new([4]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 5: + ptr := new([5]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 6: + ptr := new([6]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 7: + ptr := new([7]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 8: + ptr := new([8]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 9: + ptr := new([9]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 10: + ptr := new([10]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + default: + return nil + } +} + +// computeDistinctReflect computes a `Distinct` using reflection, +// works for any size input. +func computeDistinctReflect(kvs []KeyValue) interface{} { + at := reflect.New(reflect.ArrayOf(len(kvs), keyValueType)).Elem() + for i, keyValue := range kvs { + *(at.Index(i).Addr().Interface().(*KeyValue)) = keyValue + } + return at.Interface() +} + +// MarshalJSON returns the JSON encoding of the `*Set`. +func (l *Set) MarshalJSON() ([]byte, error) { + return json.Marshal(l.equivalent.iface) +} + +// Len implements `sort.Interface`. +func (l *Sortable) Len() int { + return len(*l) +} + +// Swap implements `sort.Interface`. +func (l *Sortable) Swap(i, j int) { + (*l)[i], (*l)[j] = (*l)[j], (*l)[i] +} + +// Less implements `sort.Interface`. +func (l *Sortable) Less(i, j int) bool { + return (*l)[i].Key < (*l)[j].Key +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/type_string.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/type_string.go new file mode 100644 index 000000000000..1f2c7dccfa51 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/type_string.go @@ -0,0 +1,28 @@ +// Code generated by "stringer -type=Type"; DO NOT EDIT. + +package attribute + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[INVALID-0] + _ = x[BOOL-1] + _ = x[INT64-2] + _ = x[FLOAT64-3] + _ = x[STRING-4] + _ = x[ARRAY-5] +} + +const _Type_name = "INVALIDBOOLINT64FLOAT64STRINGARRAY" + +var _Type_index = [...]uint8{0, 7, 11, 16, 23, 29, 34} + +func (i Type) String() string { + if i < 0 || i >= Type(len(_Type_index)-1) { + return "Type(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Type_name[_Type_index[i]:_Type_index[i+1]] +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/value.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/value.go new file mode 100644 index 000000000000..7b979409e300 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/value.go @@ -0,0 +1,204 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "encoding/json" + "fmt" + "reflect" + "strconv" + + "go.opentelemetry.io/otel/internal" +) + +//go:generate stringer -type=Type + +// Type describes the type of the data Value holds. +type Type int + +// Value represents the value part in key-value pairs. +type Value struct { + vtype Type + numeric uint64 + stringly string + // TODO Lazy value type? + + array interface{} +} + +const ( + // INVALID is used for a Value with no value set. + INVALID Type = iota + // BOOL is a boolean Type Value. + BOOL + // INT64 is a 64-bit signed integral Type Value. + INT64 + // FLOAT64 is a 64-bit floating point Type Value. + FLOAT64 + // STRING is a string Type Value. + STRING + // ARRAY is an array Type Value used to store 1-dimensional slices or + // arrays of bool, int, int32, int64, uint, uint32, uint64, float, + // float32, float64, or string types. + ARRAY +) + +// BoolValue creates a BOOL Value. +func BoolValue(v bool) Value { + return Value{ + vtype: BOOL, + numeric: internal.BoolToRaw(v), + } +} + +// Int64Value creates an INT64 Value. +func Int64Value(v int64) Value { + return Value{ + vtype: INT64, + numeric: internal.Int64ToRaw(v), + } +} + +// Float64Value creates a FLOAT64 Value. +func Float64Value(v float64) Value { + return Value{ + vtype: FLOAT64, + numeric: internal.Float64ToRaw(v), + } +} + +// StringValue creates a STRING Value. +func StringValue(v string) Value { + return Value{ + vtype: STRING, + stringly: v, + } +} + +// IntValue creates an INT64 Value. +func IntValue(v int) Value { + return Int64Value(int64(v)) +} + +// ArrayValue creates an ARRAY value from an array or slice. +// Only arrays or slices of bool, int, int64, float, float64, or string types are allowed. +// Specifically, arrays and slices can not contain other arrays, slices, structs, or non-standard +// types. If the passed value is not an array or slice of these types an +// INVALID value is returned. +func ArrayValue(v interface{}) Value { + switch reflect.TypeOf(v).Kind() { + case reflect.Array, reflect.Slice: + // get array type regardless of dimensions + typ := reflect.TypeOf(v).Elem() + kind := typ.Kind() + switch kind { + case reflect.Bool, reflect.Int, reflect.Int64, + reflect.Float64, reflect.String: + val := reflect.ValueOf(v) + length := val.Len() + frozen := reflect.Indirect(reflect.New(reflect.ArrayOf(length, typ))) + reflect.Copy(frozen, val) + return Value{ + vtype: ARRAY, + array: frozen.Interface(), + } + default: + return Value{vtype: INVALID} + } + } + return Value{vtype: INVALID} +} + +// Type returns a type of the Value. +func (v Value) Type() Type { + return v.vtype +} + +// AsBool returns the bool value. Make sure that the Value's type is +// BOOL. +func (v Value) AsBool() bool { + return internal.RawToBool(v.numeric) +} + +// AsInt64 returns the int64 value. Make sure that the Value's type is +// INT64. +func (v Value) AsInt64() int64 { + return internal.RawToInt64(v.numeric) +} + +// AsFloat64 returns the float64 value. Make sure that the Value's +// type is FLOAT64. +func (v Value) AsFloat64() float64 { + return internal.RawToFloat64(v.numeric) +} + +// AsString returns the string value. Make sure that the Value's type +// is STRING. +func (v Value) AsString() string { + return v.stringly +} + +// AsArray returns the array Value as an interface{}. +func (v Value) AsArray() interface{} { + return v.array +} + +type unknownValueType struct{} + +// AsInterface returns Value's data as interface{}. +func (v Value) AsInterface() interface{} { + switch v.Type() { + case ARRAY: + return v.AsArray() + case BOOL: + return v.AsBool() + case INT64: + return v.AsInt64() + case FLOAT64: + return v.AsFloat64() + case STRING: + return v.stringly + } + return unknownValueType{} +} + +// Emit returns a string representation of Value's data. +func (v Value) Emit() string { + switch v.Type() { + case ARRAY: + return fmt.Sprint(v.array) + case BOOL: + return strconv.FormatBool(v.AsBool()) + case INT64: + return strconv.FormatInt(v.AsInt64(), 10) + case FLOAT64: + return fmt.Sprint(v.AsFloat64()) + case STRING: + return v.stringly + default: + return "unknown" + } +} + +// MarshalJSON returns the JSON encoding of the Value. +func (v Value) MarshalJSON() ([]byte, error) { + var jsonVal struct { + Type string + Value interface{} + } + jsonVal.Type = v.Type().String() + jsonVal.Value = v.AsInterface() + return json.Marshal(jsonVal) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/codes/codes.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/codes/codes.go new file mode 100644 index 000000000000..064a9279fd14 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/codes/codes.go @@ -0,0 +1,106 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package codes // import "go.opentelemetry.io/otel/codes" + +import ( + "encoding/json" + "fmt" + "strconv" +) + +const ( + // Unset is the default status code. + Unset Code = 0 + // Error indicates the operation contains an error. + Error Code = 1 + // Ok indicates operation has been validated by an Application developers + // or Operator to have completed successfully, or contain no error. + Ok Code = 2 + + maxCode = 3 +) + +// Code is an 32-bit representation of a status state. +type Code uint32 + +var codeToStr = map[Code]string{ + Unset: "Unset", + Error: "Error", + Ok: "Ok", +} + +var strToCode = map[string]Code{ + `"Unset"`: Unset, + `"Error"`: Error, + `"Ok"`: Ok, +} + +// String returns the Code as a string. +func (c Code) String() string { + return codeToStr[c] +} + +// UnmarshalJSON unmarshals b into the Code. +// +// This is based on the functionality in the gRPC codes package: +// https://github.com/grpc/grpc-go/blob/bb64fee312b46ebee26be43364a7a966033521b1/codes/codes.go#L218-L244 +func (c *Code) UnmarshalJSON(b []byte) error { + // From json.Unmarshaler: By convention, to approximate the behavior of + // Unmarshal itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as + // a no-op. + if string(b) == "null" { + return nil + } + if c == nil { + return fmt.Errorf("nil receiver passed to UnmarshalJSON") + } + + var x interface{} + if err := json.Unmarshal(b, &x); err != nil { + return err + } + switch x.(type) { + case string: + if jc, ok := strToCode[string(b)]; ok { + *c = jc + return nil + } + return fmt.Errorf("invalid code: %q", string(b)) + case float64: + if ci, err := strconv.ParseUint(string(b), 10, 32); err == nil { + if ci >= maxCode { + return fmt.Errorf("invalid code: %q", ci) + } + + *c = Code(ci) + return nil + } + return fmt.Errorf("invalid code: %q", string(b)) + default: + return fmt.Errorf("invalid code: %q", string(b)) + } +} + +// MarshalJSON returns c as the JSON encoding of c. +func (c *Code) MarshalJSON() ([]byte, error) { + if c == nil { + return []byte("null"), nil + } + str, ok := codeToStr[*c] + if !ok { + return nil, fmt.Errorf("invalid code: %d", *c) + } + return []byte(fmt.Sprintf("%q", str)), nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/codes/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/codes/doc.go new file mode 100644 index 000000000000..fcf89ba1ac0c --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/codes/doc.go @@ -0,0 +1,25 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package codes defines the canonical error codes used by OpenTelemetry. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track +the evolving OpenTelemetry specification and user feedback. + +It conforms to [the OpenTelemetry +specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#statuscanonicalcode). +*/ +package codes // import "go.opentelemetry.io/otel/codes" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/doc.go new file mode 100644 index 000000000000..771ce81cc2f0 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/doc.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package otel provides global access to the OpenTelemetry API. The subpackages of +the otel package provide an implementation of the OpenTelemetry API. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track the +evolving OpenTelemetry specification and user feedback. + +The provided API is used to instrument code and measure data about that code's +performance and operation. The measured data, by default, is not processed or +transmitted anywhere. An implementation of the OpenTelemetry SDK, like the +default SDK implementation (go.opentelemetry.io/otel/sdk), and associated +exporters are used to process and transport this data. + +To read the getting started guide, see https://opentelemetry.io/docs/go/getting-started/. + +To read more about tracing, see go.opentelemetry.io/otel/trace. + +To read more about metrics, see go.opentelemetry.io/otel/metric. + +To read more about propagation, see go.opentelemetry.io/otel/propagation and +go.opentelemetry.io/otel/baggage. +*/ +package otel // import "go.opentelemetry.io/otel" diff --git a/cluster-autoscaler/vendor/github.com/spf13/afero/const_win_unix.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/error_handler.go similarity index 61% rename from cluster-autoscaler/vendor/github.com/spf13/afero/const_win_unix.go rename to cluster-autoscaler/vendor/go.opentelemetry.io/otel/error_handler.go index 968fc2783e5e..ac42f8be0723 100644 --- a/cluster-autoscaler/vendor/github.com/spf13/afero/const_win_unix.go +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/error_handler.go @@ -1,25 +1,22 @@ -// Copyright © 2016 Steve Francia . +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 +// +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +build !darwin -// +build !openbsd -// +build !freebsd -// +build !dragonfly -// +build !netbsd - -package afero -import ( - "syscall" -) +package otel // import "go.opentelemetry.io/otel" -const BADFD = syscall.EBADFD +// ErrorHandler handles irremediable events. +type ErrorHandler interface { + // Handle handles any error deemed irremediable by an OpenTelemetry + // component. + Handle(error) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/LICENSE b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/README.md b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/README.md new file mode 100644 index 000000000000..0cd71f330bc6 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/README.md @@ -0,0 +1,31 @@ +# OpenTelemetry Collector Go Exporter + +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp) + +This exporter exports OpenTelemetry spans and metrics to the OpenTelemetry Collector. + + +## Installation and Setup + +The exporter can be installed using standard `go` functionality. + +```bash +$ go get -u go.opentelemetry.io/otel/exporters/otlp +``` + +A new exporter can be created using the `NewExporter` function. + +## Retries + +The exporter will not, by default, retry failed requests to the collector. +However, it is configured in a way that it can be easily enabled. + +To enable retries, the `GRPC_GO_RETRY` environment variable needs to be set to `on`. For example, + +``` +GRPC_GO_RETRY=on go run . +``` + +The [default service config](https://github.com/grpc/proposal/blob/master/A6-client-retries.md) used by default is defined to retry failed requests with exponential backoff (`0.3seconds * (2)^retry`) with [a max of `5` retries](https://github.com/open-telemetry/oteps/blob/be2a3fcbaa417ebbf5845cd485d34fdf0ab4a2a4/text/0035-opentelemetry-protocol.md#export-response)). + +These retries are only attempted for reponses that are [deemed "retry-able" by the collector](https://github.com/grpc/proposal/blob/master/A6-client-retries.md#validation-of-retrypolicy). diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/doc.go new file mode 100644 index 000000000000..d0897bc8cf26 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/doc.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package otlp contains an exporter for the OpenTelemetry protocol buffers. +// +// This package is currently in a pre-GA phase. Backwards incompatible changes +// may be introduced in subsequent minor version releases as we work to track +// the evolving OpenTelemetry specification and user feedback. +package otlp // import "go.opentelemetry.io/otel/exporters/otlp" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/go.mod b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/go.mod new file mode 100644 index 000000000000..fe4fdba85356 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/go.mod @@ -0,0 +1,62 @@ +module go.opentelemetry.io/otel/exporters/otlp + +go 1.14 + +replace ( + go.opentelemetry.io/otel => ../.. + go.opentelemetry.io/otel/sdk => ../../sdk +) + +require ( + github.com/google/go-cmp v0.5.5 + github.com/stretchr/testify v1.7.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/export/metric v0.20.0 + go.opentelemetry.io/otel/sdk/metric v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 + go.opentelemetry.io/proto/otlp v0.7.0 + google.golang.org/grpc v1.37.0 + google.golang.org/protobuf v1.26.0 +) + +replace go.opentelemetry.io/otel/bridge/opencensus => ../../bridge/opencensus + +replace go.opentelemetry.io/otel/bridge/opentracing => ../../bridge/opentracing + +replace go.opentelemetry.io/otel/example/jaeger => ../../example/jaeger + +replace go.opentelemetry.io/otel/example/namedtracer => ../../example/namedtracer + +replace go.opentelemetry.io/otel/example/opencensus => ../../example/opencensus + +replace go.opentelemetry.io/otel/example/otel-collector => ../../example/otel-collector + +replace go.opentelemetry.io/otel/example/prom-collector => ../../example/prom-collector + +replace go.opentelemetry.io/otel/example/prometheus => ../../example/prometheus + +replace go.opentelemetry.io/otel/example/zipkin => ../../example/zipkin + +replace go.opentelemetry.io/otel/exporters/metric/prometheus => ../metric/prometheus + +replace go.opentelemetry.io/otel/exporters/otlp => ./ + +replace go.opentelemetry.io/otel/exporters/stdout => ../stdout + +replace go.opentelemetry.io/otel/exporters/trace/jaeger => ../trace/jaeger + +replace go.opentelemetry.io/otel/exporters/trace/zipkin => ../trace/zipkin + +replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools + +replace go.opentelemetry.io/otel/metric => ../../metric + +replace go.opentelemetry.io/otel/oteltest => ../../oteltest + +replace go.opentelemetry.io/otel/sdk/export/metric => ../../sdk/export/metric + +replace go.opentelemetry.io/otel/sdk/metric => ../../sdk/metric + +replace go.opentelemetry.io/otel/trace => ../../trace diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/go.sum b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/go.sum new file mode 100644 index 000000000000..65606007acef --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/go.sum @@ -0,0 +1,123 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +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/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/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-20180830151530-49385e6e1522/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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0 h1:uSZWeQJX5j11bIQ4AJoj+McDBo29cY1MCoC1wO3ts+c= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +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= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/envconfig.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/envconfig.go new file mode 100644 index 000000000000..b52f3dc537a8 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/envconfig.go @@ -0,0 +1,196 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlpconfig + +import ( + "crypto/tls" + "fmt" + "io/ioutil" + "net/url" + "os" + "strconv" + "strings" + "time" + + "go.opentelemetry.io/otel/exporters/otlp" + + "go.opentelemetry.io/otel" +) + +func ApplyGRPCEnvConfigs(cfg *Config) { + e := EnvOptionsReader{ + GetEnv: os.Getenv, + ReadFile: ioutil.ReadFile, + } + + e.ApplyGRPCEnvConfigs(cfg) +} + +func ApplyHTTPEnvConfigs(cfg *Config) { + e := EnvOptionsReader{ + GetEnv: os.Getenv, + ReadFile: ioutil.ReadFile, + } + + e.ApplyHTTPEnvConfigs(cfg) +} + +type EnvOptionsReader struct { + GetEnv func(string) string + ReadFile func(filename string) ([]byte, error) +} + +func (e *EnvOptionsReader) ApplyHTTPEnvConfigs(cfg *Config) { + opts := e.GetOptionsFromEnv() + for _, opt := range opts { + opt.ApplyHTTPOption(cfg) + } +} + +func (e *EnvOptionsReader) ApplyGRPCEnvConfigs(cfg *Config) { + opts := e.GetOptionsFromEnv() + for _, opt := range opts { + opt.ApplyGRPCOption(cfg) + } +} + +func (e *EnvOptionsReader) GetOptionsFromEnv() []GenericOption { + var opts []GenericOption + + // Endpoint + if v, ok := e.getEnvValue("ENDPOINT"); ok { + opts = append(opts, WithEndpoint(v)) + } + if v, ok := e.getEnvValue("TRACES_ENDPOINT"); ok { + opts = append(opts, WithTracesEndpoint(v)) + } + if v, ok := e.getEnvValue("METRICS_ENDPOINT"); ok { + opts = append(opts, WithMetricsEndpoint(v)) + } + + // Certificate File + if path, ok := e.getEnvValue("CERTIFICATE"); ok { + if tls, err := e.readTLSConfig(path); err == nil { + opts = append(opts, WithTLSClientConfig(tls)) + } else { + otel.Handle(fmt.Errorf("failed to configure otlp exporter certificate '%s': %w", path, err)) + } + } + if path, ok := e.getEnvValue("TRACES_CERTIFICATE"); ok { + if tls, err := e.readTLSConfig(path); err == nil { + opts = append(opts, WithTracesTLSClientConfig(tls)) + } else { + otel.Handle(fmt.Errorf("failed to configure otlp traces exporter certificate '%s': %w", path, err)) + } + } + if path, ok := e.getEnvValue("METRICS_CERTIFICATE"); ok { + if tls, err := e.readTLSConfig(path); err == nil { + opts = append(opts, WithMetricsTLSClientConfig(tls)) + } else { + otel.Handle(fmt.Errorf("failed to configure otlp metrics exporter certificate '%s': %w", path, err)) + } + } + + // Headers + if h, ok := e.getEnvValue("HEADERS"); ok { + opts = append(opts, WithHeaders(stringToHeader(h))) + } + if h, ok := e.getEnvValue("TRACES_HEADERS"); ok { + opts = append(opts, WithTracesHeaders(stringToHeader(h))) + } + if h, ok := e.getEnvValue("METRICS_HEADERS"); ok { + opts = append(opts, WithMetricsHeaders(stringToHeader(h))) + } + + // Compression + if c, ok := e.getEnvValue("COMPRESSION"); ok { + opts = append(opts, WithCompression(stringToCompression(c))) + } + if c, ok := e.getEnvValue("TRACES_COMPRESSION"); ok { + opts = append(opts, WithTracesCompression(stringToCompression(c))) + } + if c, ok := e.getEnvValue("METRICS_COMPRESSION"); ok { + opts = append(opts, WithMetricsCompression(stringToCompression(c))) + } + + // Timeout + if t, ok := e.getEnvValue("TIMEOUT"); ok { + if d, err := strconv.Atoi(t); err == nil { + opts = append(opts, WithTimeout(time.Duration(d)*time.Millisecond)) + } + } + if t, ok := e.getEnvValue("TRACES_TIMEOUT"); ok { + if d, err := strconv.Atoi(t); err == nil { + opts = append(opts, WithTracesTimeout(time.Duration(d)*time.Millisecond)) + } + } + if t, ok := e.getEnvValue("METRICS_TIMEOUT"); ok { + if d, err := strconv.Atoi(t); err == nil { + opts = append(opts, WithMetricsTimeout(time.Duration(d)*time.Millisecond)) + } + } + + return opts +} + +// getEnvValue gets an OTLP environment variable value of the specified key using the GetEnv function. +// This function already prepends the OTLP prefix to all key lookup. +func (e *EnvOptionsReader) getEnvValue(key string) (string, bool) { + v := strings.TrimSpace(e.GetEnv(fmt.Sprintf("OTEL_EXPORTER_OTLP_%s", key))) + return v, v != "" +} + +func (e *EnvOptionsReader) readTLSConfig(path string) (*tls.Config, error) { + b, err := e.ReadFile(path) + if err != nil { + return nil, err + } + return CreateTLSConfig(b) +} + +func stringToCompression(value string) otlp.Compression { + switch value { + case "gzip": + return otlp.GzipCompression + } + + return otlp.NoCompression +} + +func stringToHeader(value string) map[string]string { + headersPairs := strings.Split(value, ",") + headers := make(map[string]string) + + for _, header := range headersPairs { + nameValue := strings.SplitN(header, "=", 2) + if len(nameValue) < 2 { + continue + } + name, err := url.QueryUnescape(nameValue[0]) + if err != nil { + continue + } + trimmedName := strings.TrimSpace(name) + value, err := url.QueryUnescape(nameValue[1]) + if err != nil { + continue + } + trimmedValue := strings.TrimSpace(value) + + headers[trimmedName] = trimmedValue + } + + return headers +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/options.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/options.go new file mode 100644 index 000000000000..3fd4a30dd38a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/options.go @@ -0,0 +1,376 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig" + +import ( + "crypto/tls" + "fmt" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + + "go.opentelemetry.io/otel/exporters/otlp" +) + +const ( + // DefaultMaxAttempts describes how many times the driver + // should retry the sending of the payload in case of a + // retryable error. + DefaultMaxAttempts int = 5 + // DefaultTracesPath is a default URL path for endpoint that + // receives spans. + DefaultTracesPath string = "/v1/traces" + // DefaultMetricsPath is a default URL path for endpoint that + // receives metrics. + DefaultMetricsPath string = "/v1/metrics" + // DefaultBackoff is a default base backoff time used in the + // exponential backoff strategy. + DefaultBackoff time.Duration = 300 * time.Millisecond + // DefaultTimeout is a default max waiting time for the backend to process + // each span or metrics batch. + DefaultTimeout time.Duration = 10 * time.Second + // DefaultServiceConfig is the gRPC service config used if none is + // provided by the user. + DefaultServiceConfig = `{ + "methodConfig":[{ + "name":[ + { "service":"opentelemetry.proto.collector.metrics.v1.MetricsService" }, + { "service":"opentelemetry.proto.collector.trace.v1.TraceService" } + ], + "retryPolicy":{ + "MaxAttempts":5, + "InitialBackoff":"0.3s", + "MaxBackoff":"5s", + "BackoffMultiplier":2, + "RetryableStatusCodes":[ + "CANCELLED", + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "ABORTED", + "OUT_OF_RANGE", + "UNAVAILABLE", + "DATA_LOSS" + ] + } + }] +}` +) + +type ( + SignalConfig struct { + Endpoint string + Insecure bool + TLSCfg *tls.Config + Headers map[string]string + Compression otlp.Compression + Timeout time.Duration + URLPath string + + // gRPC configurations + GRPCCredentials credentials.TransportCredentials + } + + Config struct { + // Signal specific configurations + Metrics SignalConfig + Traces SignalConfig + + // General configurations + MaxAttempts int + Backoff time.Duration + + // HTTP configuration + Marshaler otlp.Marshaler + + // gRPC configurations + ReconnectionPeriod time.Duration + ServiceConfig string + DialOptions []grpc.DialOption + } +) + +func NewDefaultConfig() Config { + c := Config{ + Traces: SignalConfig{ + Endpoint: fmt.Sprintf("%s:%d", otlp.DefaultCollectorHost, otlp.DefaultCollectorPort), + URLPath: DefaultTracesPath, + Compression: otlp.NoCompression, + Timeout: DefaultTimeout, + }, + Metrics: SignalConfig{ + Endpoint: fmt.Sprintf("%s:%d", otlp.DefaultCollectorHost, otlp.DefaultCollectorPort), + URLPath: DefaultMetricsPath, + Compression: otlp.NoCompression, + Timeout: DefaultTimeout, + }, + MaxAttempts: DefaultMaxAttempts, + Backoff: DefaultBackoff, + ServiceConfig: DefaultServiceConfig, + } + + return c +} + +type ( + // GenericOption applies an option to the HTTP or gRPC driver. + GenericOption interface { + ApplyHTTPOption(*Config) + ApplyGRPCOption(*Config) + + // A private method to prevent users implementing the + // interface and so future additions to it will not + // violate compatibility. + private() + } + + // HTTPOption applies an option to the HTTP driver. + HTTPOption interface { + ApplyHTTPOption(*Config) + + // A private method to prevent users implementing the + // interface and so future additions to it will not + // violate compatibility. + private() + } + + // GRPCOption applies an option to the gRPC driver. + GRPCOption interface { + ApplyGRPCOption(*Config) + + // A private method to prevent users implementing the + // interface and so future additions to it will not + // violate compatibility. + private() + } +) + +// genericOption is an option that applies the same logic +// for both gRPC and HTTP. +type genericOption struct { + fn func(*Config) +} + +func (g *genericOption) ApplyGRPCOption(cfg *Config) { + g.fn(cfg) +} + +func (g *genericOption) ApplyHTTPOption(cfg *Config) { + g.fn(cfg) +} + +func (genericOption) private() {} + +func newGenericOption(fn func(cfg *Config)) GenericOption { + return &genericOption{fn: fn} +} + +// splitOption is an option that applies different logics +// for gRPC and HTTP. +type splitOption struct { + httpFn func(*Config) + grpcFn func(*Config) +} + +func (g *splitOption) ApplyGRPCOption(cfg *Config) { + g.grpcFn(cfg) +} + +func (g *splitOption) ApplyHTTPOption(cfg *Config) { + g.httpFn(cfg) +} + +func (splitOption) private() {} + +func newSplitOption(httpFn func(cfg *Config), grpcFn func(cfg *Config)) GenericOption { + return &splitOption{httpFn: httpFn, grpcFn: grpcFn} +} + +// httpOption is an option that is only applied to the HTTP driver. +type httpOption struct { + fn func(*Config) +} + +func (h *httpOption) ApplyHTTPOption(cfg *Config) { + h.fn(cfg) +} + +func (httpOption) private() {} + +func NewHTTPOption(fn func(cfg *Config)) HTTPOption { + return &httpOption{fn: fn} +} + +// grpcOption is an option that is only applied to the gRPC driver. +type grpcOption struct { + fn func(*Config) +} + +func (h *grpcOption) ApplyGRPCOption(cfg *Config) { + h.fn(cfg) +} + +func (grpcOption) private() {} + +func NewGRPCOption(fn func(cfg *Config)) GRPCOption { + return &grpcOption{fn: fn} +} + +// Generic Options + +func WithEndpoint(endpoint string) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Endpoint = endpoint + cfg.Metrics.Endpoint = endpoint + }) +} + +func WithTracesEndpoint(endpoint string) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Endpoint = endpoint + }) +} + +func WithMetricsEndpoint(endpoint string) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Metrics.Endpoint = endpoint + }) +} + +func WithCompression(compression otlp.Compression) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Compression = compression + cfg.Metrics.Compression = compression + }) +} + +func WithTracesCompression(compression otlp.Compression) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Compression = compression + }) +} + +func WithMetricsCompression(compression otlp.Compression) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Metrics.Compression = compression + }) +} + +func WithTracesURLPath(urlPath string) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.URLPath = urlPath + }) +} + +func WithMetricsURLPath(urlPath string) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Metrics.URLPath = urlPath + }) +} + +func WithMaxAttempts(maxAttempts int) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.MaxAttempts = maxAttempts + }) +} + +func WithBackoff(duration time.Duration) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Backoff = duration + }) +} + +func WithTLSClientConfig(tlsCfg *tls.Config) GenericOption { + return newSplitOption(func(cfg *Config) { + cfg.Traces.TLSCfg = tlsCfg.Clone() + cfg.Metrics.TLSCfg = tlsCfg.Clone() + }, func(cfg *Config) { + cfg.Traces.GRPCCredentials = credentials.NewTLS(tlsCfg) + cfg.Metrics.GRPCCredentials = credentials.NewTLS(tlsCfg) + }) +} + +func WithTracesTLSClientConfig(tlsCfg *tls.Config) GenericOption { + return newSplitOption(func(cfg *Config) { + cfg.Traces.TLSCfg = tlsCfg.Clone() + }, func(cfg *Config) { + cfg.Traces.GRPCCredentials = credentials.NewTLS(tlsCfg) + }) +} + +func WithMetricsTLSClientConfig(tlsCfg *tls.Config) GenericOption { + return newSplitOption(func(cfg *Config) { + cfg.Metrics.TLSCfg = tlsCfg.Clone() + }, func(cfg *Config) { + cfg.Metrics.GRPCCredentials = credentials.NewTLS(tlsCfg) + }) +} + +func WithInsecure() GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Insecure = true + cfg.Metrics.Insecure = true + }) +} + +func WithInsecureTraces() GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Insecure = true + }) +} + +func WithInsecureMetrics() GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Metrics.Insecure = true + }) +} + +func WithHeaders(headers map[string]string) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Headers = headers + cfg.Metrics.Headers = headers + }) +} + +func WithTracesHeaders(headers map[string]string) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Headers = headers + }) +} + +func WithMetricsHeaders(headers map[string]string) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Metrics.Headers = headers + }) +} + +func WithTimeout(duration time.Duration) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Timeout = duration + cfg.Metrics.Timeout = duration + }) +} + +func WithTracesTimeout(duration time.Duration) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Traces.Timeout = duration + }) +} + +func WithMetricsTimeout(duration time.Duration) GenericOption { + return newGenericOption(func(cfg *Config) { + cfg.Metrics.Timeout = duration + }) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/tls.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/tls.go new file mode 100644 index 000000000000..0cbddb865332 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/tls.go @@ -0,0 +1,69 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlpconfig + +import ( + "crypto/tls" + "crypto/x509" + "errors" + "io/ioutil" +) + +const ( + WeakCertificate = ` +-----BEGIN CERTIFICATE----- +MIIBhzCCASygAwIBAgIRANHpHgAWeTnLZpTSxCKs0ggwCgYIKoZIzj0EAwIwEjEQ +MA4GA1UEChMHb3RlbC1nbzAeFw0yMTA0MDExMzU5MDNaFw0yMTA0MDExNDU5MDNa +MBIxEDAOBgNVBAoTB290ZWwtZ28wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAS9 +nWSkmPCxShxnp43F+PrOtbGV7sNfkbQ/kxzi9Ego0ZJdiXxkmv/C05QFddCW7Y0Z +sJCLHGogQsYnWJBXUZOVo2MwYTAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYI +KwYBBQUHAwEwDAYDVR0TAQH/BAIwADAsBgNVHREEJTAjgglsb2NhbGhvc3SHEAAA +AAAAAAAAAAAAAAAAAAGHBH8AAAEwCgYIKoZIzj0EAwIDSQAwRgIhANwZVVKvfvQ/ +1HXsTvgH+xTQswOwSSKYJ1cVHQhqK7ZbAiEAus8NxpTRnp5DiTMuyVmhVNPB+bVH +Lhnm4N/QDk5rek0= +-----END CERTIFICATE----- +` + WeakPrivateKey = ` +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgN8HEXiXhvByrJ1zK +SFT6Y2l2KqDWwWzKf+t4CyWrNKehRANCAAS9nWSkmPCxShxnp43F+PrOtbGV7sNf +kbQ/kxzi9Ego0ZJdiXxkmv/C05QFddCW7Y0ZsJCLHGogQsYnWJBXUZOV +-----END PRIVATE KEY----- +` +) + +// ReadTLSConfigFromFile reads a PEM certificate file and creates +// a tls.Config that will use this certifate to verify a server certificate. +func ReadTLSConfigFromFile(path string) (*tls.Config, error) { + b, err := ioutil.ReadFile(path) + if err != nil { + return nil, err + } + + return CreateTLSConfig(b) +} + +// CreateTLSConfig creates a tls.Config from a raw certificate bytes +// to verify a server certificate. +func CreateTLSConfig(certBytes []byte) (*tls.Config, error) { + cp := x509.NewCertPool() + if ok := cp.AppendCertsFromPEM(certBytes); !ok { + return nil, errors.New("failed to append certificate to the cert pool") + } + + return &tls.Config{ + RootCAs: cp, + }, nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/attribute.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/attribute.go new file mode 100644 index 000000000000..5902cad6ae2b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/attribute.go @@ -0,0 +1,141 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package transform + +import ( + "reflect" + + "go.opentelemetry.io/otel/attribute" + commonpb "go.opentelemetry.io/proto/otlp/common/v1" + + "go.opentelemetry.io/otel/sdk/resource" +) + +// Attributes transforms a slice of KeyValues into a slice of OTLP attribute key-values. +func Attributes(attrs []attribute.KeyValue) []*commonpb.KeyValue { + if len(attrs) == 0 { + return nil + } + + out := make([]*commonpb.KeyValue, 0, len(attrs)) + for _, kv := range attrs { + out = append(out, toAttribute(kv)) + } + return out +} + +// ResourceAttributes transforms a Resource into a slice of OTLP attribute key-values. +func ResourceAttributes(resource *resource.Resource) []*commonpb.KeyValue { + if resource.Len() == 0 { + return nil + } + + out := make([]*commonpb.KeyValue, 0, resource.Len()) + for iter := resource.Iter(); iter.Next(); { + out = append(out, toAttribute(iter.Attribute())) + } + + return out +} + +func toAttribute(v attribute.KeyValue) *commonpb.KeyValue { + result := &commonpb.KeyValue{ + Key: string(v.Key), + Value: new(commonpb.AnyValue), + } + switch v.Value.Type() { + case attribute.BOOL: + result.Value.Value = &commonpb.AnyValue_BoolValue{ + BoolValue: v.Value.AsBool(), + } + case attribute.INT64: + result.Value.Value = &commonpb.AnyValue_IntValue{ + IntValue: v.Value.AsInt64(), + } + case attribute.FLOAT64: + result.Value.Value = &commonpb.AnyValue_DoubleValue{ + DoubleValue: v.Value.AsFloat64(), + } + case attribute.STRING: + result.Value.Value = &commonpb.AnyValue_StringValue{ + StringValue: v.Value.AsString(), + } + case attribute.ARRAY: + result.Value.Value = &commonpb.AnyValue_ArrayValue{ + ArrayValue: &commonpb.ArrayValue{ + Values: arrayValues(v), + }, + } + default: + result.Value.Value = &commonpb.AnyValue_StringValue{ + StringValue: "INVALID", + } + } + return result +} + +func arrayValues(kv attribute.KeyValue) []*commonpb.AnyValue { + a := kv.Value.AsArray() + aType := reflect.TypeOf(a) + var valueFunc func(reflect.Value) *commonpb.AnyValue + switch aType.Elem().Kind() { + case reflect.Bool: + valueFunc = func(v reflect.Value) *commonpb.AnyValue { + return &commonpb.AnyValue{ + Value: &commonpb.AnyValue_BoolValue{ + BoolValue: v.Bool(), + }, + } + } + case reflect.Int, reflect.Int64: + valueFunc = func(v reflect.Value) *commonpb.AnyValue { + return &commonpb.AnyValue{ + Value: &commonpb.AnyValue_IntValue{ + IntValue: v.Int(), + }, + } + } + case reflect.Uintptr: + valueFunc = func(v reflect.Value) *commonpb.AnyValue { + return &commonpb.AnyValue{ + Value: &commonpb.AnyValue_IntValue{ + IntValue: int64(v.Uint()), + }, + } + } + case reflect.Float64: + valueFunc = func(v reflect.Value) *commonpb.AnyValue { + return &commonpb.AnyValue{ + Value: &commonpb.AnyValue_DoubleValue{ + DoubleValue: v.Float(), + }, + } + } + case reflect.String: + valueFunc = func(v reflect.Value) *commonpb.AnyValue { + return &commonpb.AnyValue{ + Value: &commonpb.AnyValue_StringValue{ + StringValue: v.String(), + }, + } + } + } + + results := make([]*commonpb.AnyValue, aType.Len()) + for i, aValue := 0, reflect.ValueOf(a); i < aValue.Len(); i++ { + results[i] = valueFunc(aValue.Index(i)) + } + return results +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/instrumentation.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/instrumentation.go new file mode 100644 index 000000000000..4ed5f96646c7 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/instrumentation.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package transform + +import ( + commonpb "go.opentelemetry.io/proto/otlp/common/v1" + + "go.opentelemetry.io/otel/sdk/instrumentation" +) + +func instrumentationLibrary(il instrumentation.Library) *commonpb.InstrumentationLibrary { + if il == (instrumentation.Library{}) { + return nil + } + return &commonpb.InstrumentationLibrary{ + Name: il.Name, + Version: il.Version, + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/metric.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/metric.go new file mode 100644 index 000000000000..1922b9b9c69b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/metric.go @@ -0,0 +1,631 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package transform provides translations for opentelemetry-go concepts and +// structures to otlp structures. +package transform + +import ( + "context" + "errors" + "fmt" + "strings" + "sync" + "time" + + "go.opentelemetry.io/otel/attribute" + commonpb "go.opentelemetry.io/proto/otlp/common/v1" + metricpb "go.opentelemetry.io/proto/otlp/metrics/v1" + resourcepb "go.opentelemetry.io/proto/otlp/resource/v1" + + "go.opentelemetry.io/otel/metric/number" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/resource" +) + +var ( + // ErrUnimplementedAgg is returned when a transformation of an unimplemented + // aggregator is attempted. + ErrUnimplementedAgg = errors.New("unimplemented aggregator") + + // ErrIncompatibleAgg is returned when + // aggregation.Kind implies an interface conversion that has + // failed + ErrIncompatibleAgg = errors.New("incompatible aggregation type") + + // ErrUnknownValueType is returned when a transformation of an unknown value + // is attempted. + ErrUnknownValueType = errors.New("invalid value type") + + // ErrContextCanceled is returned when a context cancellation halts a + // transformation. + ErrContextCanceled = errors.New("context canceled") + + // ErrTransforming is returned when an unexected error is encoutered transforming. + ErrTransforming = errors.New("transforming failed") +) + +// result is the product of transforming Records into OTLP Metrics. +type result struct { + Resource *resource.Resource + InstrumentationLibrary instrumentation.Library + Metric *metricpb.Metric + Err error +} + +// toNanos returns the number of nanoseconds since the UNIX epoch. +func toNanos(t time.Time) uint64 { + if t.IsZero() { + return 0 + } + return uint64(t.UnixNano()) +} + +// CheckpointSet transforms all records contained in a checkpoint into +// batched OTLP ResourceMetrics. +func CheckpointSet(ctx context.Context, exportSelector export.ExportKindSelector, cps export.CheckpointSet, numWorkers uint) ([]*metricpb.ResourceMetrics, error) { + records, errc := source(ctx, exportSelector, cps) + + // Start a fixed number of goroutines to transform records. + transformed := make(chan result) + var wg sync.WaitGroup + wg.Add(int(numWorkers)) + for i := uint(0); i < numWorkers; i++ { + go func() { + defer wg.Done() + transformer(ctx, exportSelector, records, transformed) + }() + } + go func() { + wg.Wait() + close(transformed) + }() + + // Synchronously collect the transformed records and transmit. + rms, err := sink(ctx, transformed) + if err != nil { + return nil, err + } + + // source is complete, check for any errors. + if err := <-errc; err != nil { + return nil, err + } + return rms, nil +} + +// source starts a goroutine that sends each one of the Records yielded by +// the CheckpointSet on the returned chan. Any error encoutered will be sent +// on the returned error chan after seeding is complete. +func source(ctx context.Context, exportSelector export.ExportKindSelector, cps export.CheckpointSet) (<-chan export.Record, <-chan error) { + errc := make(chan error, 1) + out := make(chan export.Record) + // Seed records into process. + go func() { + defer close(out) + // No select is needed since errc is buffered. + errc <- cps.ForEach(exportSelector, func(r export.Record) error { + select { + case <-ctx.Done(): + return ErrContextCanceled + case out <- r: + } + return nil + }) + }() + return out, errc +} + +// transformer transforms records read from the passed in chan into +// OTLP Metrics which are sent on the out chan. +func transformer(ctx context.Context, exportSelector export.ExportKindSelector, in <-chan export.Record, out chan<- result) { + for r := range in { + m, err := Record(exportSelector, r) + // Propagate errors, but do not send empty results. + if err == nil && m == nil { + continue + } + res := result{ + Resource: r.Resource(), + InstrumentationLibrary: instrumentation.Library{ + Name: r.Descriptor().InstrumentationName(), + Version: r.Descriptor().InstrumentationVersion(), + }, + Metric: m, + Err: err, + } + select { + case <-ctx.Done(): + return + case out <- res: + } + } +} + +// sink collects transformed Records and batches them. +// +// Any errors encoutered transforming input will be reported with an +// ErrTransforming as well as the completed ResourceMetrics. It is up to the +// caller to handle any incorrect data in these ResourceMetrics. +func sink(ctx context.Context, in <-chan result) ([]*metricpb.ResourceMetrics, error) { + var errStrings []string + + type resourceBatch struct { + Resource *resourcepb.Resource + // Group by instrumentation library name and then the MetricDescriptor. + InstrumentationLibraryBatches map[instrumentation.Library]map[string]*metricpb.Metric + } + + // group by unique Resource string. + grouped := make(map[attribute.Distinct]resourceBatch) + for res := range in { + if res.Err != nil { + errStrings = append(errStrings, res.Err.Error()) + continue + } + + rID := res.Resource.Equivalent() + rb, ok := grouped[rID] + if !ok { + rb = resourceBatch{ + Resource: Resource(res.Resource), + InstrumentationLibraryBatches: make(map[instrumentation.Library]map[string]*metricpb.Metric), + } + grouped[rID] = rb + } + + mb, ok := rb.InstrumentationLibraryBatches[res.InstrumentationLibrary] + if !ok { + mb = make(map[string]*metricpb.Metric) + rb.InstrumentationLibraryBatches[res.InstrumentationLibrary] = mb + } + + mID := res.Metric.GetName() + m, ok := mb[mID] + if !ok { + mb[mID] = res.Metric + continue + } + switch res.Metric.Data.(type) { + case *metricpb.Metric_IntGauge: + m.GetIntGauge().DataPoints = append(m.GetIntGauge().DataPoints, res.Metric.GetIntGauge().DataPoints...) + case *metricpb.Metric_IntHistogram: + m.GetIntHistogram().DataPoints = append(m.GetIntHistogram().DataPoints, res.Metric.GetIntHistogram().DataPoints...) + case *metricpb.Metric_IntSum: + m.GetIntSum().DataPoints = append(m.GetIntSum().DataPoints, res.Metric.GetIntSum().DataPoints...) + case *metricpb.Metric_DoubleGauge: + m.GetDoubleGauge().DataPoints = append(m.GetDoubleGauge().DataPoints, res.Metric.GetDoubleGauge().DataPoints...) + case *metricpb.Metric_DoubleHistogram: + m.GetDoubleHistogram().DataPoints = append(m.GetDoubleHistogram().DataPoints, res.Metric.GetDoubleHistogram().DataPoints...) + case *metricpb.Metric_DoubleSum: + m.GetDoubleSum().DataPoints = append(m.GetDoubleSum().DataPoints, res.Metric.GetDoubleSum().DataPoints...) + default: + } + } + + if len(grouped) == 0 { + return nil, nil + } + + var rms []*metricpb.ResourceMetrics + for _, rb := range grouped { + rm := &metricpb.ResourceMetrics{Resource: rb.Resource} + for il, mb := range rb.InstrumentationLibraryBatches { + ilm := &metricpb.InstrumentationLibraryMetrics{ + Metrics: make([]*metricpb.Metric, 0, len(mb)), + } + if il != (instrumentation.Library{}) { + ilm.InstrumentationLibrary = &commonpb.InstrumentationLibrary{ + Name: il.Name, + Version: il.Version, + } + } + for _, m := range mb { + ilm.Metrics = append(ilm.Metrics, m) + } + rm.InstrumentationLibraryMetrics = append(rm.InstrumentationLibraryMetrics, ilm) + } + rms = append(rms, rm) + } + + // Report any transform errors. + if len(errStrings) > 0 { + return rms, fmt.Errorf("%w:\n -%s", ErrTransforming, strings.Join(errStrings, "\n -")) + } + return rms, nil +} + +// Record transforms a Record into an OTLP Metric. An ErrIncompatibleAgg +// error is returned if the Record Aggregator is not supported. +func Record(exportSelector export.ExportKindSelector, r export.Record) (*metricpb.Metric, error) { + agg := r.Aggregation() + switch agg.Kind() { + case aggregation.MinMaxSumCountKind: + mmsc, ok := agg.(aggregation.MinMaxSumCount) + if !ok { + return nil, fmt.Errorf("%w: %T", ErrIncompatibleAgg, agg) + } + return minMaxSumCount(r, mmsc) + + case aggregation.HistogramKind: + h, ok := agg.(aggregation.Histogram) + if !ok { + return nil, fmt.Errorf("%w: %T", ErrIncompatibleAgg, agg) + } + return histogramPoint(r, exportSelector.ExportKindFor(r.Descriptor(), aggregation.HistogramKind), h) + + case aggregation.SumKind: + s, ok := agg.(aggregation.Sum) + if !ok { + return nil, fmt.Errorf("%w: %T", ErrIncompatibleAgg, agg) + } + sum, err := s.Sum() + if err != nil { + return nil, err + } + return sumPoint(r, sum, r.StartTime(), r.EndTime(), exportSelector.ExportKindFor(r.Descriptor(), aggregation.SumKind), r.Descriptor().InstrumentKind().Monotonic()) + + case aggregation.LastValueKind: + lv, ok := agg.(aggregation.LastValue) + if !ok { + return nil, fmt.Errorf("%w: %T", ErrIncompatibleAgg, agg) + } + value, tm, err := lv.LastValue() + if err != nil { + return nil, err + } + return gaugePoint(r, value, time.Time{}, tm) + + case aggregation.ExactKind: + e, ok := agg.(aggregation.Points) + if !ok { + return nil, fmt.Errorf("%w: %T", ErrIncompatibleAgg, agg) + } + pts, err := e.Points() + if err != nil { + return nil, err + } + + return gaugeArray(r, pts) + + default: + return nil, fmt.Errorf("%w: %T", ErrUnimplementedAgg, agg) + } +} + +func gaugeArray(record export.Record, points []aggregation.Point) (*metricpb.Metric, error) { + desc := record.Descriptor() + labels := record.Labels() + m := &metricpb.Metric{ + Name: desc.Name(), + Description: desc.Description(), + Unit: string(desc.Unit()), + } + + pbLabels := stringKeyValues(labels.Iter()) + + switch nk := desc.NumberKind(); nk { + case number.Int64Kind: + var pts []*metricpb.IntDataPoint + for _, s := range points { + pts = append(pts, &metricpb.IntDataPoint{ + Labels: pbLabels, + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Value: s.Number.CoerceToInt64(nk), + }) + } + m.Data = &metricpb.Metric_IntGauge{ + IntGauge: &metricpb.IntGauge{ + DataPoints: pts, + }, + } + + case number.Float64Kind: + var pts []*metricpb.DoubleDataPoint + for _, s := range points { + pts = append(pts, &metricpb.DoubleDataPoint{ + Labels: pbLabels, + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Value: s.Number.CoerceToFloat64(nk), + }) + } + m.Data = &metricpb.Metric_DoubleGauge{ + DoubleGauge: &metricpb.DoubleGauge{ + DataPoints: pts, + }, + } + + default: + return nil, fmt.Errorf("%w: %v", ErrUnknownValueType, nk) + } + + return m, nil +} + +func gaugePoint(record export.Record, num number.Number, start, end time.Time) (*metricpb.Metric, error) { + desc := record.Descriptor() + labels := record.Labels() + + m := &metricpb.Metric{ + Name: desc.Name(), + Description: desc.Description(), + Unit: string(desc.Unit()), + } + + switch n := desc.NumberKind(); n { + case number.Int64Kind: + m.Data = &metricpb.Metric_IntGauge{ + IntGauge: &metricpb.IntGauge{ + DataPoints: []*metricpb.IntDataPoint{ + { + Value: num.CoerceToInt64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(start), + TimeUnixNano: toNanos(end), + }, + }, + }, + } + case number.Float64Kind: + m.Data = &metricpb.Metric_DoubleGauge{ + DoubleGauge: &metricpb.DoubleGauge{ + DataPoints: []*metricpb.DoubleDataPoint{ + { + Value: num.CoerceToFloat64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(start), + TimeUnixNano: toNanos(end), + }, + }, + }, + } + default: + return nil, fmt.Errorf("%w: %v", ErrUnknownValueType, n) + } + + return m, nil +} + +func exportKindToTemporality(ek export.ExportKind) metricpb.AggregationTemporality { + switch ek { + case export.DeltaExportKind: + return metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA + case export.CumulativeExportKind: + return metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE + } + return metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + +func sumPoint(record export.Record, num number.Number, start, end time.Time, ek export.ExportKind, monotonic bool) (*metricpb.Metric, error) { + desc := record.Descriptor() + labels := record.Labels() + + m := &metricpb.Metric{ + Name: desc.Name(), + Description: desc.Description(), + Unit: string(desc.Unit()), + } + + switch n := desc.NumberKind(); n { + case number.Int64Kind: + m.Data = &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + IsMonotonic: monotonic, + AggregationTemporality: exportKindToTemporality(ek), + DataPoints: []*metricpb.IntDataPoint{ + { + Value: num.CoerceToInt64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(start), + TimeUnixNano: toNanos(end), + }, + }, + }, + } + case number.Float64Kind: + m.Data = &metricpb.Metric_DoubleSum{ + DoubleSum: &metricpb.DoubleSum{ + IsMonotonic: monotonic, + AggregationTemporality: exportKindToTemporality(ek), + DataPoints: []*metricpb.DoubleDataPoint{ + { + Value: num.CoerceToFloat64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(start), + TimeUnixNano: toNanos(end), + }, + }, + }, + } + default: + return nil, fmt.Errorf("%w: %v", ErrUnknownValueType, n) + } + + return m, nil +} + +// minMaxSumCountValue returns the values of the MinMaxSumCount Aggregator +// as discrete values. +func minMaxSumCountValues(a aggregation.MinMaxSumCount) (min, max, sum number.Number, count uint64, err error) { + if min, err = a.Min(); err != nil { + return + } + if max, err = a.Max(); err != nil { + return + } + if sum, err = a.Sum(); err != nil { + return + } + if count, err = a.Count(); err != nil { + return + } + return +} + +// minMaxSumCount transforms a MinMaxSumCount Aggregator into an OTLP Metric. +func minMaxSumCount(record export.Record, a aggregation.MinMaxSumCount) (*metricpb.Metric, error) { + desc := record.Descriptor() + labels := record.Labels() + min, max, sum, count, err := minMaxSumCountValues(a) + if err != nil { + return nil, err + } + + m := &metricpb.Metric{ + Name: desc.Name(), + Description: desc.Description(), + Unit: string(desc.Unit()), + } + + buckets := []uint64{min.AsRaw(), max.AsRaw()} + bounds := []float64{0.0, 100.0} + + switch n := desc.NumberKind(); n { + case number.Int64Kind: + m.Data = &metricpb.Metric_IntHistogram{ + IntHistogram: &metricpb.IntHistogram{ + DataPoints: []*metricpb.IntHistogramDataPoint{ + { + Sum: sum.CoerceToInt64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Count: uint64(count), + BucketCounts: buckets, + ExplicitBounds: bounds, + }, + }, + }, + } + case number.Float64Kind: + m.Data = &metricpb.Metric_DoubleHistogram{ + DoubleHistogram: &metricpb.DoubleHistogram{ + DataPoints: []*metricpb.DoubleHistogramDataPoint{ + { + Sum: sum.CoerceToFloat64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Count: uint64(count), + BucketCounts: buckets, + ExplicitBounds: bounds, + }, + }, + }, + } + default: + return nil, fmt.Errorf("%w: %v", ErrUnknownValueType, n) + } + return m, nil +} + +func histogramValues(a aggregation.Histogram) (boundaries []float64, counts []uint64, err error) { + var buckets aggregation.Buckets + if buckets, err = a.Histogram(); err != nil { + return + } + boundaries, counts = buckets.Boundaries, buckets.Counts + if len(counts) != len(boundaries)+1 { + err = ErrTransforming + return + } + return +} + +// histogram transforms a Histogram Aggregator into an OTLP Metric. +func histogramPoint(record export.Record, ek export.ExportKind, a aggregation.Histogram) (*metricpb.Metric, error) { + desc := record.Descriptor() + labels := record.Labels() + boundaries, counts, err := histogramValues(a) + if err != nil { + return nil, err + } + + count, err := a.Count() + if err != nil { + return nil, err + } + + sum, err := a.Sum() + if err != nil { + return nil, err + } + + m := &metricpb.Metric{ + Name: desc.Name(), + Description: desc.Description(), + Unit: string(desc.Unit()), + } + switch n := desc.NumberKind(); n { + case number.Int64Kind: + m.Data = &metricpb.Metric_IntHistogram{ + IntHistogram: &metricpb.IntHistogram{ + AggregationTemporality: exportKindToTemporality(ek), + DataPoints: []*metricpb.IntHistogramDataPoint{ + { + Sum: sum.CoerceToInt64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Count: uint64(count), + BucketCounts: counts, + ExplicitBounds: boundaries, + }, + }, + }, + } + case number.Float64Kind: + m.Data = &metricpb.Metric_DoubleHistogram{ + DoubleHistogram: &metricpb.DoubleHistogram{ + AggregationTemporality: exportKindToTemporality(ek), + DataPoints: []*metricpb.DoubleHistogramDataPoint{ + { + Sum: sum.CoerceToFloat64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Count: uint64(count), + BucketCounts: counts, + ExplicitBounds: boundaries, + }, + }, + }, + } + default: + return nil, fmt.Errorf("%w: %v", ErrUnknownValueType, n) + } + + return m, nil +} + +// stringKeyValues transforms a label iterator into an OTLP StringKeyValues. +func stringKeyValues(iter attribute.Iterator) []*commonpb.StringKeyValue { + l := iter.Len() + if l == 0 { + return nil + } + result := make([]*commonpb.StringKeyValue, 0, l) + for iter.Next() { + kv := iter.Label() + result = append(result, &commonpb.StringKeyValue{ + Key: string(kv.Key), + Value: kv.Value.Emit(), + }) + } + return result +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/resource.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/resource.go new file mode 100644 index 000000000000..5be53566bf8e --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/resource.go @@ -0,0 +1,29 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package transform + +import ( + resourcepb "go.opentelemetry.io/proto/otlp/resource/v1" + + "go.opentelemetry.io/otel/sdk/resource" +) + +// Resource transforms a Resource into an OTLP Resource. +func Resource(r *resource.Resource) *resourcepb.Resource { + if r == nil { + return nil + } + return &resourcepb.Resource{Attributes: ResourceAttributes(r)} +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/span.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/span.go new file mode 100644 index 000000000000..d24cb1e6e591 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/span.go @@ -0,0 +1,218 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package transform + +import ( + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + tracepb "go.opentelemetry.io/proto/otlp/trace/v1" + + "go.opentelemetry.io/otel/sdk/instrumentation" + tracesdk "go.opentelemetry.io/otel/sdk/trace" + "go.opentelemetry.io/otel/trace" +) + +const ( + maxMessageEventsPerSpan = 128 +) + +// SpanData transforms a slice of SpanSnapshot into a slice of OTLP +// ResourceSpans. +func SpanData(sdl []*tracesdk.SpanSnapshot) []*tracepb.ResourceSpans { + if len(sdl) == 0 { + return nil + } + + rsm := make(map[attribute.Distinct]*tracepb.ResourceSpans) + + type ilsKey struct { + r attribute.Distinct + il instrumentation.Library + } + ilsm := make(map[ilsKey]*tracepb.InstrumentationLibrarySpans) + + var resources int + for _, sd := range sdl { + if sd == nil { + continue + } + + rKey := sd.Resource.Equivalent() + iKey := ilsKey{ + r: rKey, + il: sd.InstrumentationLibrary, + } + ils, iOk := ilsm[iKey] + if !iOk { + // Either the resource or instrumentation library were unknown. + ils = &tracepb.InstrumentationLibrarySpans{ + InstrumentationLibrary: instrumentationLibrary(sd.InstrumentationLibrary), + Spans: []*tracepb.Span{}, + } + } + ils.Spans = append(ils.Spans, span(sd)) + ilsm[iKey] = ils + + rs, rOk := rsm[rKey] + if !rOk { + resources++ + // The resource was unknown. + rs = &tracepb.ResourceSpans{ + Resource: Resource(sd.Resource), + InstrumentationLibrarySpans: []*tracepb.InstrumentationLibrarySpans{ils}, + } + rsm[rKey] = rs + continue + } + + // The resource has been seen before. Check if the instrumentation + // library lookup was unknown because if so we need to add it to the + // ResourceSpans. Otherwise, the instrumentation library has already + // been seen and the append we did above will be included it in the + // InstrumentationLibrarySpans reference. + if !iOk { + rs.InstrumentationLibrarySpans = append(rs.InstrumentationLibrarySpans, ils) + } + } + + // Transform the categorized map into a slice + rss := make([]*tracepb.ResourceSpans, 0, resources) + for _, rs := range rsm { + rss = append(rss, rs) + } + return rss +} + +// span transforms a Span into an OTLP span. +func span(sd *tracesdk.SpanSnapshot) *tracepb.Span { + if sd == nil { + return nil + } + + tid := sd.SpanContext.TraceID() + sid := sd.SpanContext.SpanID() + + s := &tracepb.Span{ + TraceId: tid[:], + SpanId: sid[:], + TraceState: sd.SpanContext.TraceState().String(), + Status: status(sd.StatusCode, sd.StatusMessage), + StartTimeUnixNano: uint64(sd.StartTime.UnixNano()), + EndTimeUnixNano: uint64(sd.EndTime.UnixNano()), + Links: links(sd.Links), + Kind: spanKind(sd.SpanKind), + Name: sd.Name, + Attributes: Attributes(sd.Attributes), + Events: spanEvents(sd.MessageEvents), + DroppedAttributesCount: uint32(sd.DroppedAttributeCount), + DroppedEventsCount: uint32(sd.DroppedMessageEventCount), + DroppedLinksCount: uint32(sd.DroppedLinkCount), + } + + if psid := sd.Parent.SpanID(); psid.IsValid() { + s.ParentSpanId = psid[:] + } + + return s +} + +// status transform a span code and message into an OTLP span status. +func status(status codes.Code, message string) *tracepb.Status { + var c tracepb.Status_StatusCode + switch status { + case codes.Error: + c = tracepb.Status_STATUS_CODE_ERROR + default: + c = tracepb.Status_STATUS_CODE_OK + } + return &tracepb.Status{ + Code: c, + Message: message, + } +} + +// links transforms span Links to OTLP span links. +func links(links []trace.Link) []*tracepb.Span_Link { + if len(links) == 0 { + return nil + } + + sl := make([]*tracepb.Span_Link, 0, len(links)) + for _, otLink := range links { + // This redefinition is necessary to prevent otLink.*ID[:] copies + // being reused -- in short we need a new otLink per iteration. + otLink := otLink + + tid := otLink.TraceID() + sid := otLink.SpanID() + + sl = append(sl, &tracepb.Span_Link{ + TraceId: tid[:], + SpanId: sid[:], + Attributes: Attributes(otLink.Attributes), + }) + } + return sl +} + +// spanEvents transforms span Events to an OTLP span events. +func spanEvents(es []trace.Event) []*tracepb.Span_Event { + if len(es) == 0 { + return nil + } + + evCount := len(es) + if evCount > maxMessageEventsPerSpan { + evCount = maxMessageEventsPerSpan + } + events := make([]*tracepb.Span_Event, 0, evCount) + messageEvents := 0 + + // Transform message events + for _, e := range es { + if messageEvents >= maxMessageEventsPerSpan { + break + } + messageEvents++ + events = append(events, + &tracepb.Span_Event{ + Name: e.Name, + TimeUnixNano: uint64(e.Time.UnixNano()), + Attributes: Attributes(e.Attributes), + // TODO (rghetia) : Add Drop Counts when supported. + }, + ) + } + + return events +} + +// spanKind transforms a SpanKind to an OTLP span kind. +func spanKind(kind trace.SpanKind) tracepb.Span_SpanKind { + switch kind { + case trace.SpanKindInternal: + return tracepb.Span_SPAN_KIND_INTERNAL + case trace.SpanKindClient: + return tracepb.Span_SPAN_KIND_CLIENT + case trace.SpanKindServer: + return tracepb.Span_SPAN_KIND_SERVER + case trace.SpanKindProducer: + return tracepb.Span_SPAN_KIND_PRODUCER + case trace.SpanKindConsumer: + return tracepb.Span_SPAN_KIND_CONSUMER + default: + return tracepb.Span_SPAN_KIND_UNSPECIFIED + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/options.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/options.go new file mode 100644 index 000000000000..7cfaa35d3cc0 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/options.go @@ -0,0 +1,45 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlp // import "go.opentelemetry.io/otel/exporters/otlp" + +import ( + metricsdk "go.opentelemetry.io/otel/sdk/export/metric" +) + +const ( + // DefaultCollectorPort is the port the Exporter will attempt connect to + // if no collector port is provided. + DefaultCollectorPort uint16 = 4317 + // DefaultCollectorHost is the host address the Exporter will attempt + // connect to if no collector address is provided. + DefaultCollectorHost string = "localhost" +) + +// ExporterOption are setting options passed to an Exporter on creation. +type ExporterOption func(*config) + +type config struct { + exportKindSelector metricsdk.ExportKindSelector +} + +// WithMetricExportKindSelector defines the ExportKindSelector used +// for selecting AggregationTemporality (i.e., Cumulative vs. Delta +// aggregation). If not specified otherwise, exporter will use a +// cumulative export kind selector. +func WithMetricExportKindSelector(selector metricsdk.ExportKindSelector) ExporterOption { + return func(cfg *config) { + cfg.exportKindSelector = selector + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/optiontypes.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/optiontypes.go new file mode 100644 index 000000000000..682625f45489 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/optiontypes.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlp // import "go.opentelemetry.io/otel/exporters/otlp" + +// Compression describes the compression used for payloads sent to the +// collector. +type Compression int + +const ( + // NoCompression tells the driver to send payloads without + // compression. + NoCompression Compression = iota + // GzipCompression tells the driver to send payloads after + // compressing them with gzip. + GzipCompression +) + +// Marshaler describes the kind of message format sent to the collector +type Marshaler int + +const ( + // MarshalProto tells the driver to send using the protobuf binary format. + MarshalProto Marshaler = iota + // MarshalJSON tells the driver to send using json format. + MarshalJSON +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlp.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlp.go new file mode 100644 index 000000000000..098d93b423ab --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlp.go @@ -0,0 +1,179 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlp // import "go.opentelemetry.io/otel/exporters/otlp" + +import ( + "context" + "errors" + "sync" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/metric" + metricsdk "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/selector/simple" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + + "go.opentelemetry.io/otel/sdk/metric/controller/basic" + processor "go.opentelemetry.io/otel/sdk/metric/processor/basic" + tracesdk "go.opentelemetry.io/otel/sdk/trace" +) + +// Exporter is an OpenTelemetry exporter. It exports both traces and metrics +// from OpenTelemetry instrumented to code using OpenTelemetry protocol +// buffers to a configurable receiver. +type Exporter struct { + cfg config + driver ProtocolDriver + + mu sync.RWMutex + started bool + + startOnce sync.Once + stopOnce sync.Once +} + +var _ tracesdk.SpanExporter = (*Exporter)(nil) +var _ metricsdk.Exporter = (*Exporter)(nil) + +// NewExporter constructs a new Exporter and starts it. +func NewExporter(ctx context.Context, driver ProtocolDriver, opts ...ExporterOption) (*Exporter, error) { + exp := NewUnstartedExporter(driver, opts...) + if err := exp.Start(ctx); err != nil { + return nil, err + } + return exp, nil +} + +// NewUnstartedExporter constructs a new Exporter and does not start it. +func NewUnstartedExporter(driver ProtocolDriver, opts ...ExporterOption) *Exporter { + cfg := config{ + // Note: the default ExportKindSelector is specified + // as Cumulative: + // https://github.com/open-telemetry/opentelemetry-specification/issues/731 + exportKindSelector: metricsdk.CumulativeExportKindSelector(), + } + for _, opt := range opts { + opt(&cfg) + } + return &Exporter{ + cfg: cfg, + driver: driver, + } +} + +var ( + errAlreadyStarted = errors.New("already started") +) + +// Start establishes connections to the OpenTelemetry collector. Starting an +// already started exporter returns an error. +func (e *Exporter) Start(ctx context.Context) error { + var err = errAlreadyStarted + e.startOnce.Do(func() { + e.mu.Lock() + e.started = true + e.mu.Unlock() + err = e.driver.Start(ctx) + }) + + return err +} + +// Shutdown closes all connections and releases resources currently being used +// by the exporter. If the exporter is not started this does nothing. A shut +// down exporter can't be started again. Shutting down an already shut down +// exporter does nothing. +func (e *Exporter) Shutdown(ctx context.Context) error { + e.mu.RLock() + started := e.started + e.mu.RUnlock() + + if !started { + return nil + } + + var err error + + e.stopOnce.Do(func() { + err = e.driver.Stop(ctx) + e.mu.Lock() + e.started = false + e.mu.Unlock() + }) + + return err +} + +// Export transforms and batches metric Records into OTLP Metrics and +// transmits them to the configured collector. +func (e *Exporter) Export(parent context.Context, cps metricsdk.CheckpointSet) error { + return e.driver.ExportMetrics(parent, cps, e.cfg.exportKindSelector) +} + +// ExportKindFor reports back to the OpenTelemetry SDK sending this Exporter +// metric telemetry that it needs to be provided in a configured format. +func (e *Exporter) ExportKindFor(desc *metric.Descriptor, kind aggregation.Kind) metricsdk.ExportKind { + return e.cfg.exportKindSelector.ExportKindFor(desc, kind) +} + +// ExportSpans transforms and batches trace SpanSnapshots into OTLP Trace and +// transmits them to the configured collector. +func (e *Exporter) ExportSpans(ctx context.Context, ss []*tracesdk.SpanSnapshot) error { + return e.driver.ExportTraces(ctx, ss) +} + +// NewExportPipeline sets up a complete export pipeline +// with the recommended TracerProvider setup. +func NewExportPipeline(ctx context.Context, driver ProtocolDriver, exporterOpts ...ExporterOption) (*Exporter, + *sdktrace.TracerProvider, *basic.Controller, error) { + + exp, err := NewExporter(ctx, driver, exporterOpts...) + if err != nil { + return nil, nil, nil, err + } + + tracerProvider := sdktrace.NewTracerProvider( + sdktrace.WithBatcher(exp), + ) + + cntr := basic.New( + processor.New( + simple.NewWithInexpensiveDistribution(), + exp, + ), + ) + + return exp, tracerProvider, cntr, nil +} + +// InstallNewPipeline instantiates a NewExportPipeline with the +// recommended configuration and registers it globally. +func InstallNewPipeline(ctx context.Context, driver ProtocolDriver, exporterOpts ...ExporterOption) (*Exporter, + *sdktrace.TracerProvider, *basic.Controller, error) { + + exp, tp, cntr, err := NewExportPipeline(ctx, driver, exporterOpts...) + if err != nil { + return nil, nil, nil, err + } + + otel.SetTracerProvider(tp) + err = cntr.Start(ctx) + if err != nil { + return nil, nil, nil, err + } + + return exp, tp, cntr, err +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/connection.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/connection.go new file mode 100644 index 000000000000..d904b56e058a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/connection.go @@ -0,0 +1,278 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlpgrpc + +import ( + "context" + "math/rand" + "sync" + "sync/atomic" + "time" + "unsafe" + + "google.golang.org/grpc/encoding/gzip" + + "go.opentelemetry.io/otel/exporters/otlp" + "go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig" + + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +type connection struct { + // Ensure pointer is 64-bit aligned for atomic operations on both 32 and 64 bit machines. + lastConnectErrPtr unsafe.Pointer + + // mu protects the connection as it is accessed by the + // exporter goroutines and background connection goroutine + mu sync.Mutex + cc *grpc.ClientConn + + // these fields are read-only after constructor is finished + cfg otlpconfig.Config + sCfg otlpconfig.SignalConfig + metadata metadata.MD + newConnectionHandler func(cc *grpc.ClientConn) + + // these channels are created once + disconnectedCh chan bool + backgroundConnectionDoneCh chan struct{} + stopCh chan struct{} + + // this is for tests, so they can replace the closing + // routine without a worry of modifying some global variable + // or changing it back to original after the test is done + closeBackgroundConnectionDoneCh func(ch chan struct{}) +} + +func newConnection(cfg otlpconfig.Config, sCfg otlpconfig.SignalConfig, handler func(cc *grpc.ClientConn)) *connection { + c := new(connection) + c.newConnectionHandler = handler + c.cfg = cfg + c.sCfg = sCfg + if len(c.sCfg.Headers) > 0 { + c.metadata = metadata.New(c.sCfg.Headers) + } + c.closeBackgroundConnectionDoneCh = func(ch chan struct{}) { + close(ch) + } + return c +} + +func (c *connection) startConnection(ctx context.Context) { + c.stopCh = make(chan struct{}) + c.disconnectedCh = make(chan bool, 1) + c.backgroundConnectionDoneCh = make(chan struct{}) + + if err := c.connect(ctx); err == nil { + c.setStateConnected() + } else { + c.setStateDisconnected(err) + } + go c.indefiniteBackgroundConnection() +} + +func (c *connection) lastConnectError() error { + errPtr := (*error)(atomic.LoadPointer(&c.lastConnectErrPtr)) + if errPtr == nil { + return nil + } + return *errPtr +} + +func (c *connection) saveLastConnectError(err error) { + var errPtr *error + if err != nil { + errPtr = &err + } + atomic.StorePointer(&c.lastConnectErrPtr, unsafe.Pointer(errPtr)) +} + +func (c *connection) setStateDisconnected(err error) { + c.saveLastConnectError(err) + select { + case c.disconnectedCh <- true: + default: + } + c.newConnectionHandler(nil) +} + +func (c *connection) setStateConnected() { + c.saveLastConnectError(nil) +} + +func (c *connection) connected() bool { + return c.lastConnectError() == nil +} + +const defaultConnReattemptPeriod = 10 * time.Second + +func (c *connection) indefiniteBackgroundConnection() { + defer func() { + c.closeBackgroundConnectionDoneCh(c.backgroundConnectionDoneCh) + }() + + connReattemptPeriod := c.cfg.ReconnectionPeriod + if connReattemptPeriod <= 0 { + connReattemptPeriod = defaultConnReattemptPeriod + } + + // No strong seeding required, nano time can + // already help with pseudo uniqueness. + rng := rand.New(rand.NewSource(time.Now().UnixNano() + rand.Int63n(1024))) + + // maxJitterNanos: 70% of the connectionReattemptPeriod + maxJitterNanos := int64(0.7 * float64(connReattemptPeriod)) + + for { + // Otherwise these will be the normal scenarios to enable + // reconnection if we trip out. + // 1. If we've stopped, return entirely + // 2. Otherwise block until we are disconnected, and + // then retry connecting + select { + case <-c.stopCh: + return + + case <-c.disconnectedCh: + // Quickly check if we haven't stopped at the + // same time. + select { + case <-c.stopCh: + return + + default: + } + + // Normal scenario that we'll wait for + } + + if err := c.connect(context.Background()); err == nil { + c.setStateConnected() + } else { + // this code is unreachable in most cases + // c.connect does not establish connection + c.setStateDisconnected(err) + } + + // Apply some jitter to avoid lockstep retrials of other + // collector-exporters. Lockstep retrials could result in an + // innocent DDOS, by clogging the machine's resources and network. + jitter := time.Duration(rng.Int63n(maxJitterNanos)) + select { + case <-c.stopCh: + return + case <-time.After(connReattemptPeriod + jitter): + } + } +} + +func (c *connection) connect(ctx context.Context) error { + cc, err := c.dialToCollector(ctx) + if err != nil { + return err + } + c.setConnection(cc) + c.newConnectionHandler(cc) + return nil +} + +// setConnection sets cc as the client connection and returns true if +// the connection state changed. +func (c *connection) setConnection(cc *grpc.ClientConn) bool { + c.mu.Lock() + defer c.mu.Unlock() + + // If previous clientConn is same as the current then just return. + // This doesn't happen right now as this func is only called with new ClientConn. + // It is more about future-proofing. + if c.cc == cc { + return false + } + + // If the previous clientConn was non-nil, close it + if c.cc != nil { + _ = c.cc.Close() + } + c.cc = cc + return true +} + +func (c *connection) dialToCollector(ctx context.Context) (*grpc.ClientConn, error) { + dialOpts := []grpc.DialOption{} + if c.cfg.ServiceConfig != "" { + dialOpts = append(dialOpts, grpc.WithDefaultServiceConfig(c.cfg.ServiceConfig)) + } + if c.sCfg.GRPCCredentials != nil { + dialOpts = append(dialOpts, grpc.WithTransportCredentials(c.sCfg.GRPCCredentials)) + } else if c.sCfg.Insecure { + dialOpts = append(dialOpts, grpc.WithInsecure()) + } + if c.sCfg.Compression == otlp.GzipCompression { + dialOpts = append(dialOpts, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) + } + if len(c.cfg.DialOptions) != 0 { + dialOpts = append(dialOpts, c.cfg.DialOptions...) + } + + ctx, cancel := c.contextWithStop(ctx) + defer cancel() + ctx = c.contextWithMetadata(ctx) + return grpc.DialContext(ctx, c.sCfg.Endpoint, dialOpts...) +} + +func (c *connection) contextWithMetadata(ctx context.Context) context.Context { + if c.metadata.Len() > 0 { + return metadata.NewOutgoingContext(ctx, c.metadata) + } + return ctx +} + +func (c *connection) shutdown(ctx context.Context) error { + close(c.stopCh) + // Ensure that the backgroundConnector returns + select { + case <-c.backgroundConnectionDoneCh: + case <-ctx.Done(): + return ctx.Err() + } + + c.mu.Lock() + cc := c.cc + c.cc = nil + c.mu.Unlock() + + if cc != nil { + return cc.Close() + } + + return nil +} + +func (c *connection) contextWithStop(ctx context.Context) (context.Context, context.CancelFunc) { + // Unify the parent context Done signal with the connection's + // stop channel. + ctx, cancel := context.WithCancel(ctx) + go func(ctx context.Context, cancel context.CancelFunc) { + select { + case <-ctx.Done(): + // Nothing to do, either cancelled or deadline + // happened. + case <-c.stopCh: + cancel() + } + }(ctx, cancel) + return ctx, cancel +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/doc.go new file mode 100644 index 000000000000..68f53fb0aab1 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/doc.go @@ -0,0 +1,25 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package otlpgrpc provides an implementation of otlp.ProtocolDriver +that connects to the collector and sends traces and metrics using +gRPC. + +This package is currently in a pre-GA phase. Backwards incompatible +changes may be introduced in subsequent minor version releases as we +work to track the evolving OpenTelemetry specification and user +feedback. +*/ +package otlpgrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlpgrpc" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/driver.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/driver.go new file mode 100644 index 000000000000..c5df20566c7b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/driver.go @@ -0,0 +1,195 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlpgrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlpgrpc" + +import ( + "context" + "errors" + "fmt" + "sync" + + "go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig" + + "google.golang.org/grpc" + + "go.opentelemetry.io/otel/exporters/otlp" + "go.opentelemetry.io/otel/exporters/otlp/internal/transform" + metricsdk "go.opentelemetry.io/otel/sdk/export/metric" + tracesdk "go.opentelemetry.io/otel/sdk/trace" + colmetricpb "go.opentelemetry.io/proto/otlp/collector/metrics/v1" + coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1" + metricpb "go.opentelemetry.io/proto/otlp/metrics/v1" + tracepb "go.opentelemetry.io/proto/otlp/trace/v1" +) + +type driver struct { + metricsDriver metricsDriver + tracesDriver tracesDriver +} + +type metricsDriver struct { + connection *connection + + lock sync.Mutex + metricsClient colmetricpb.MetricsServiceClient +} + +type tracesDriver struct { + connection *connection + + lock sync.Mutex + tracesClient coltracepb.TraceServiceClient +} + +var ( + errNoClient = errors.New("no client") +) + +// NewDriver creates a new gRPC protocol driver. +func NewDriver(opts ...Option) otlp.ProtocolDriver { + cfg := otlpconfig.NewDefaultConfig() + otlpconfig.ApplyGRPCEnvConfigs(&cfg) + for _, opt := range opts { + opt.ApplyGRPCOption(&cfg) + } + + d := &driver{} + + d.tracesDriver = tracesDriver{ + connection: newConnection(cfg, cfg.Traces, d.tracesDriver.handleNewConnection), + } + + d.metricsDriver = metricsDriver{ + connection: newConnection(cfg, cfg.Metrics, d.metricsDriver.handleNewConnection), + } + return d +} + +func (md *metricsDriver) handleNewConnection(cc *grpc.ClientConn) { + md.lock.Lock() + defer md.lock.Unlock() + if cc != nil { + md.metricsClient = colmetricpb.NewMetricsServiceClient(cc) + } else { + md.metricsClient = nil + } +} + +func (td *tracesDriver) handleNewConnection(cc *grpc.ClientConn) { + td.lock.Lock() + defer td.lock.Unlock() + if cc != nil { + td.tracesClient = coltracepb.NewTraceServiceClient(cc) + } else { + td.tracesClient = nil + } +} + +// Start implements otlp.ProtocolDriver. It establishes a connection +// to the collector. +func (d *driver) Start(ctx context.Context) error { + d.tracesDriver.connection.startConnection(ctx) + d.metricsDriver.connection.startConnection(ctx) + return nil +} + +// Stop implements otlp.ProtocolDriver. It shuts down the connection +// to the collector. +func (d *driver) Stop(ctx context.Context) error { + if err := d.tracesDriver.connection.shutdown(ctx); err != nil { + return err + } + + return d.metricsDriver.connection.shutdown(ctx) +} + +// ExportMetrics implements otlp.ProtocolDriver. It transforms metrics +// to protobuf binary format and sends the result to the collector. +func (d *driver) ExportMetrics(ctx context.Context, cps metricsdk.CheckpointSet, selector metricsdk.ExportKindSelector) error { + if !d.metricsDriver.connection.connected() { + return fmt.Errorf("metrics exporter is disconnected from the server %s: %w", d.metricsDriver.connection.sCfg.Endpoint, d.metricsDriver.connection.lastConnectError()) + } + ctx, cancel := d.metricsDriver.connection.contextWithStop(ctx) + defer cancel() + ctx, tCancel := context.WithTimeout(ctx, d.metricsDriver.connection.sCfg.Timeout) + defer tCancel() + + rms, err := transform.CheckpointSet(ctx, selector, cps, 1) + if err != nil { + return err + } + if len(rms) == 0 { + return nil + } + + return d.metricsDriver.uploadMetrics(ctx, rms) +} + +func (md *metricsDriver) uploadMetrics(ctx context.Context, protoMetrics []*metricpb.ResourceMetrics) error { + ctx = md.connection.contextWithMetadata(ctx) + err := func() error { + md.lock.Lock() + defer md.lock.Unlock() + if md.metricsClient == nil { + return errNoClient + } + _, err := md.metricsClient.Export(ctx, &colmetricpb.ExportMetricsServiceRequest{ + ResourceMetrics: protoMetrics, + }) + return err + }() + if err != nil { + md.connection.setStateDisconnected(err) + } + return err +} + +// ExportTraces implements otlp.ProtocolDriver. It transforms spans to +// protobuf binary format and sends the result to the collector. +func (d *driver) ExportTraces(ctx context.Context, ss []*tracesdk.SpanSnapshot) error { + if !d.tracesDriver.connection.connected() { + return fmt.Errorf("traces exporter is disconnected from the server %s: %w", d.tracesDriver.connection.sCfg.Endpoint, d.tracesDriver.connection.lastConnectError()) + } + ctx, cancel := d.tracesDriver.connection.contextWithStop(ctx) + defer cancel() + ctx, tCancel := context.WithTimeout(ctx, d.tracesDriver.connection.sCfg.Timeout) + defer tCancel() + + protoSpans := transform.SpanData(ss) + if len(protoSpans) == 0 { + return nil + } + + return d.tracesDriver.uploadTraces(ctx, protoSpans) +} + +func (td *tracesDriver) uploadTraces(ctx context.Context, protoSpans []*tracepb.ResourceSpans) error { + ctx = td.connection.contextWithMetadata(ctx) + err := func() error { + td.lock.Lock() + defer td.lock.Unlock() + if td.tracesClient == nil { + return errNoClient + } + _, err := td.tracesClient.Export(ctx, &coltracepb.ExportTraceServiceRequest{ + ResourceSpans: protoSpans, + }) + return err + }() + if err != nil { + td.connection.setStateDisconnected(err) + } + return err +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/options.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/options.go new file mode 100644 index 000000000000..dd7201f94a73 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/options.go @@ -0,0 +1,202 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlpgrpc + +import ( + "fmt" + "time" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/exporters/otlp" + "go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +// Option applies an option to the gRPC driver. +type Option interface { + otlpconfig.GRPCOption +} + +// WithInsecure disables client transport security for the exporter's gRPC connection +// just like grpc.WithInsecure() https://pkg.go.dev/google.golang.org/grpc#WithInsecure +// does. Note, by default, client security is required unless WithInsecure is used. +func WithInsecure() Option { + return otlpconfig.WithInsecure() +} + +// WithTracesInsecure disables client transport security for the traces exporter's gRPC connection +// just like grpc.WithInsecure() https://pkg.go.dev/google.golang.org/grpc#WithInsecure +// does. Note, by default, client security is required unless WithInsecure is used. +func WithTracesInsecure() Option { + return otlpconfig.WithInsecureTraces() +} + +// WithInsecureMetrics disables client transport security for the metrics exporter's gRPC connection +// just like grpc.WithInsecure() https://pkg.go.dev/google.golang.org/grpc#WithInsecure +// does. Note, by default, client security is required unless WithInsecure is used. +func WithInsecureMetrics() Option { + return otlpconfig.WithInsecureMetrics() +} + +// WithEndpoint allows one to set the endpoint that the exporter will +// connect to the collector on. If unset, it will instead try to use +// connect to DefaultCollectorHost:DefaultCollectorPort. +func WithEndpoint(endpoint string) Option { + return otlpconfig.WithEndpoint(endpoint) +} + +// WithTracesEndpoint allows one to set the traces endpoint that the exporter will +// connect to the collector on. If unset, it will instead try to use +// connect to DefaultCollectorHost:DefaultCollectorPort. +func WithTracesEndpoint(endpoint string) Option { + return otlpconfig.WithTracesEndpoint(endpoint) +} + +// WithMetricsEndpoint allows one to set the metrics endpoint that the exporter will +// connect to the collector on. If unset, it will instead try to use +// connect to DefaultCollectorHost:DefaultCollectorPort. +func WithMetricsEndpoint(endpoint string) Option { + return otlpconfig.WithMetricsEndpoint(endpoint) +} + +// WithReconnectionPeriod allows one to set the delay between next connection attempt +// after failing to connect with the collector. +func WithReconnectionPeriod(rp time.Duration) otlpconfig.GRPCOption { + return otlpconfig.NewGRPCOption(func(cfg *otlpconfig.Config) { + cfg.ReconnectionPeriod = rp + }) +} + +func compressorToCompression(compressor string) otlp.Compression { + switch compressor { + case "gzip": + return otlp.GzipCompression + } + + otel.Handle(fmt.Errorf("invalid compression type: '%s', using no compression as default", compressor)) + return otlp.NoCompression +} + +// WithCompressor will set the compressor for the gRPC client to use when sending requests. +// It is the responsibility of the caller to ensure that the compressor set has been registered +// with google.golang.org/grpc/encoding. This can be done by encoding.RegisterCompressor. Some +// compressors auto-register on import, such as gzip, which can be registered by calling +// `import _ "google.golang.org/grpc/encoding/gzip"`. +func WithCompressor(compressor string) Option { + return otlpconfig.WithCompression(compressorToCompression(compressor)) +} + +// WithTracesCompression will set the compressor for the gRPC client to use when sending traces requests. +// It is the responsibility of the caller to ensure that the compressor set has been registered +// with google.golang.org/grpc/encoding. This can be done by encoding.RegisterCompressor. Some +// compressors auto-register on import, such as gzip, which can be registered by calling +// `import _ "google.golang.org/grpc/encoding/gzip"`. +func WithTracesCompression(compressor string) Option { + return otlpconfig.WithTracesCompression(compressorToCompression(compressor)) +} + +// WithMetricsCompression will set the compressor for the gRPC client to use when sending metrics requests. +// It is the responsibility of the caller to ensure that the compressor set has been registered +// with google.golang.org/grpc/encoding. This can be done by encoding.RegisterCompressor. Some +// compressors auto-register on import, such as gzip, which can be registered by calling +// `import _ "google.golang.org/grpc/encoding/gzip"`. +func WithMetricsCompression(compressor string) Option { + return otlpconfig.WithMetricsCompression(compressorToCompression(compressor)) +} + +// WithHeaders will send the provided headers with gRPC requests. +func WithHeaders(headers map[string]string) Option { + return otlpconfig.WithHeaders(headers) +} + +// WithTracesHeaders will send the provided headers with gRPC traces requests. +func WithTracesHeaders(headers map[string]string) Option { + return otlpconfig.WithTracesHeaders(headers) +} + +// WithMetricsHeaders will send the provided headers with gRPC metrics requests. +func WithMetricsHeaders(headers map[string]string) Option { + return otlpconfig.WithMetricsHeaders(headers) +} + +// WithTLSCredentials allows the connection to use TLS credentials +// when talking to the server. It takes in grpc.TransportCredentials instead +// of say a Certificate file or a tls.Certificate, because the retrieving of +// these credentials can be done in many ways e.g. plain file, in code tls.Config +// or by certificate rotation, so it is up to the caller to decide what to use. +func WithTLSCredentials(creds credentials.TransportCredentials) Option { + return otlpconfig.NewGRPCOption(func(cfg *otlpconfig.Config) { + cfg.Traces.GRPCCredentials = creds + cfg.Metrics.GRPCCredentials = creds + }) +} + +// WithTracesTLSCredentials allows the connection to use TLS credentials +// when talking to the traces server. It takes in grpc.TransportCredentials instead +// of say a Certificate file or a tls.Certificate, because the retrieving of +// these credentials can be done in many ways e.g. plain file, in code tls.Config +// or by certificate rotation, so it is up to the caller to decide what to use. +func WithTracesTLSCredentials(creds credentials.TransportCredentials) Option { + return otlpconfig.NewGRPCOption(func(cfg *otlpconfig.Config) { + cfg.Traces.GRPCCredentials = creds + }) +} + +// WithMetricsTLSCredentials allows the connection to use TLS credentials +// when talking to the metrics server. It takes in grpc.TransportCredentials instead +// of say a Certificate file or a tls.Certificate, because the retrieving of +// these credentials can be done in many ways e.g. plain file, in code tls.Config +// or by certificate rotation, so it is up to the caller to decide what to use. +func WithMetricsTLSCredentials(creds credentials.TransportCredentials) Option { + return otlpconfig.NewGRPCOption(func(cfg *otlpconfig.Config) { + cfg.Metrics.GRPCCredentials = creds + }) +} + +// WithServiceConfig defines the default gRPC service config used. +func WithServiceConfig(serviceConfig string) Option { + return otlpconfig.NewGRPCOption(func(cfg *otlpconfig.Config) { + cfg.ServiceConfig = serviceConfig + }) +} + +// WithDialOption opens support to any grpc.DialOption to be used. If it conflicts +// with some other configuration the GRPC specified via the collector the ones here will +// take preference since they are set last. +func WithDialOption(opts ...grpc.DialOption) Option { + return otlpconfig.NewGRPCOption(func(cfg *otlpconfig.Config) { + cfg.DialOptions = opts + }) +} + +// WithTimeout tells the driver the max waiting time for the backend to process +// each spans or metrics batch. If unset, the default will be 10 seconds. +func WithTimeout(duration time.Duration) Option { + return otlpconfig.WithTimeout(duration) +} + +// WithTracesTimeout tells the driver the max waiting time for the backend to process +// each spans batch. If unset, the default will be 10 seconds. +func WithTracesTimeout(duration time.Duration) Option { + return otlpconfig.WithTracesTimeout(duration) +} + +// WithMetricsTimeout tells the driver the max waiting time for the backend to process +// each metrics batch. If unset, the default will be 10 seconds. +func WithMetricsTimeout(duration time.Duration) Option { + return otlpconfig.WithMetricsTimeout(duration) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/protocoldriver.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/protocoldriver.go new file mode 100644 index 000000000000..7c45cefb9fdf --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/protocoldriver.go @@ -0,0 +1,145 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otlp // import "go.opentelemetry.io/otel/exporters/otlp" + +import ( + "context" + "sync" + + metricsdk "go.opentelemetry.io/otel/sdk/export/metric" + tracesdk "go.opentelemetry.io/otel/sdk/trace" +) + +// ProtocolDriver is an interface used by OTLP exporter. It's +// responsible for connecting to and disconnecting from the collector, +// and for transforming traces and metrics into wire format and +// transmitting them to the collector. +type ProtocolDriver interface { + // Start should establish connection(s) to endpoint(s). It is + // called just once by the exporter, so the implementation + // does not need to worry about idempotence and locking. + Start(ctx context.Context) error + // Stop should close the connections. The function is called + // only once by the exporter, so the implementation does not + // need to worry about idempotence, but it may be called + // concurrently with ExportMetrics or ExportTraces, so proper + // locking is required. The function serves as a + // synchronization point - after the function returns, the + // process of closing connections is assumed to be finished. + Stop(ctx context.Context) error + // ExportMetrics should transform the passed metrics to the + // wire format and send it to the collector. May be called + // concurrently with ExportTraces, so the manager needs to + // take this into account by doing proper locking. + ExportMetrics(ctx context.Context, cps metricsdk.CheckpointSet, selector metricsdk.ExportKindSelector) error + // ExportTraces should transform the passed traces to the wire + // format and send it to the collector. May be called + // concurrently with ExportMetrics, so the manager needs to + // take this into account by doing proper locking. + ExportTraces(ctx context.Context, ss []*tracesdk.SpanSnapshot) error +} + +// SplitConfig is used to configure a split driver. +type SplitConfig struct { + // ForMetrics driver will be used for sending metrics to the + // collector. + ForMetrics ProtocolDriver + // ForTraces driver will be used for sending spans to the + // collector. + ForTraces ProtocolDriver +} + +type splitDriver struct { + metric ProtocolDriver + trace ProtocolDriver +} + +var _ ProtocolDriver = (*splitDriver)(nil) + +// NewSplitDriver creates a protocol driver which contains two other +// protocol drivers and will forward traces to one of them and metrics +// to another. +func NewSplitDriver(cfg SplitConfig) ProtocolDriver { + return &splitDriver{ + metric: cfg.ForMetrics, + trace: cfg.ForTraces, + } +} + +// Start implements ProtocolDriver. It starts both drivers at the same +// time. +func (d *splitDriver) Start(ctx context.Context) error { + wg := sync.WaitGroup{} + wg.Add(2) + var ( + metricErr error + traceErr error + ) + go func() { + defer wg.Done() + metricErr = d.metric.Start(ctx) + }() + go func() { + defer wg.Done() + traceErr = d.trace.Start(ctx) + }() + wg.Wait() + if metricErr != nil { + return metricErr + } + if traceErr != nil { + return traceErr + } + return nil +} + +// Stop implements ProtocolDriver. It stops both drivers at the same +// time. +func (d *splitDriver) Stop(ctx context.Context) error { + wg := sync.WaitGroup{} + wg.Add(2) + var ( + metricErr error + traceErr error + ) + go func() { + defer wg.Done() + metricErr = d.metric.Stop(ctx) + }() + go func() { + defer wg.Done() + traceErr = d.trace.Stop(ctx) + }() + wg.Wait() + if metricErr != nil { + return metricErr + } + if traceErr != nil { + return traceErr + } + return nil +} + +// ExportMetrics implements ProtocolDriver. It forwards the call to +// the driver used for sending metrics. +func (d *splitDriver) ExportMetrics(ctx context.Context, cps metricsdk.CheckpointSet, selector metricsdk.ExportKindSelector) error { + return d.metric.ExportMetrics(ctx, cps, selector) +} + +// ExportTraces implements ProtocolDriver. It forwards the call to the +// driver used for sending spans. +func (d *splitDriver) ExportTraces(ctx context.Context, ss []*tracesdk.SpanSnapshot) error { + return d.trace.ExportTraces(ctx, ss) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh new file mode 100644 index 000000000000..9a58fb1d372e --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +top_dir='.' +if [[ $# -gt 0 ]]; then + top_dir="${1}" +fi + +p=$(pwd) +mod_dirs=() + +# Note `mapfile` does not exist in older bash versions: +# https://stackoverflow.com/questions/41475261/need-alternative-to-readarray-mapfile-for-script-on-older-version-of-bash + +while IFS= read -r line; do + mod_dirs+=("$line") +done < <(find "${top_dir}" -type f -name 'go.mod' -exec dirname {} \; | sort) + +for mod_dir in "${mod_dirs[@]}"; do + cd "${mod_dir}" + + while IFS= read -r line; do + echo ".${line#${p}}" + done < <(go list --find -f '{{.Name}}|{{.Dir}}' ./... | grep '^main|' | cut -f 2- -d '|') + cd "${p}" +done diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/go.mod b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/go.mod new file mode 100644 index 000000000000..a0e9267ad36a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/go.mod @@ -0,0 +1,55 @@ +module go.opentelemetry.io/otel + +go 1.14 + +require ( + github.com/google/go-cmp v0.5.5 + github.com/stretchr/testify v1.7.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/oteltest v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 +) + +replace go.opentelemetry.io/otel => ./ + +replace go.opentelemetry.io/otel/bridge/opencensus => ./bridge/opencensus + +replace go.opentelemetry.io/otel/bridge/opentracing => ./bridge/opentracing + +replace go.opentelemetry.io/otel/example/jaeger => ./example/jaeger + +replace go.opentelemetry.io/otel/example/namedtracer => ./example/namedtracer + +replace go.opentelemetry.io/otel/example/opencensus => ./example/opencensus + +replace go.opentelemetry.io/otel/example/otel-collector => ./example/otel-collector + +replace go.opentelemetry.io/otel/example/prom-collector => ./example/prom-collector + +replace go.opentelemetry.io/otel/example/prometheus => ./example/prometheus + +replace go.opentelemetry.io/otel/example/zipkin => ./example/zipkin + +replace go.opentelemetry.io/otel/exporters/metric/prometheus => ./exporters/metric/prometheus + +replace go.opentelemetry.io/otel/exporters/otlp => ./exporters/otlp + +replace go.opentelemetry.io/otel/exporters/stdout => ./exporters/stdout + +replace go.opentelemetry.io/otel/exporters/trace/jaeger => ./exporters/trace/jaeger + +replace go.opentelemetry.io/otel/exporters/trace/zipkin => ./exporters/trace/zipkin + +replace go.opentelemetry.io/otel/internal/tools => ./internal/tools + +replace go.opentelemetry.io/otel/sdk => ./sdk + +replace go.opentelemetry.io/otel/metric => ./metric + +replace go.opentelemetry.io/otel/oteltest => ./oteltest + +replace go.opentelemetry.io/otel/sdk/export/metric => ./sdk/export/metric + +replace go.opentelemetry.io/otel/sdk/metric => ./sdk/metric + +replace go.opentelemetry.io/otel/trace => ./trace diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/go.sum b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/go.sum new file mode 100644 index 000000000000..b69f2e56da0f --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/handler.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/handler.go new file mode 100644 index 000000000000..27e1caa30d9f --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/handler.go @@ -0,0 +1,89 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "log" + "os" + "sync" + "sync/atomic" +) + +var ( + // globalErrorHandler provides an ErrorHandler that can be used + // throughout an OpenTelemetry instrumented project. When a user + // specified ErrorHandler is registered (`SetErrorHandler`) all calls to + // `Handle` and will be delegated to the registered ErrorHandler. + globalErrorHandler = &loggingErrorHandler{ + l: log.New(os.Stderr, "", log.LstdFlags), + } + + // delegateErrorHandlerOnce ensures that a user provided ErrorHandler is + // only ever registered once. + delegateErrorHandlerOnce sync.Once + + // Comiple time check that loggingErrorHandler implements ErrorHandler. + _ ErrorHandler = (*loggingErrorHandler)(nil) +) + +// loggingErrorHandler logs all errors to STDERR. +type loggingErrorHandler struct { + delegate atomic.Value + + l *log.Logger +} + +// setDelegate sets the ErrorHandler delegate if one is not already set. +func (h *loggingErrorHandler) setDelegate(d ErrorHandler) { + if h.delegate.Load() != nil { + // Delegate already registered + return + } + h.delegate.Store(d) +} + +// Handle implements ErrorHandler. +func (h *loggingErrorHandler) Handle(err error) { + if d := h.delegate.Load(); d != nil { + d.(ErrorHandler).Handle(err) + return + } + h.l.Print(err) +} + +// GetErrorHandler returns the global ErrorHandler instance. If no ErrorHandler +// instance has been set (`SetErrorHandler`), the default ErrorHandler which +// logs errors to STDERR is returned. +func GetErrorHandler() ErrorHandler { + return globalErrorHandler +} + +// SetErrorHandler sets the global ErrorHandler to be h. +func SetErrorHandler(h ErrorHandler) { + delegateErrorHandlerOnce.Do(func() { + current := GetErrorHandler() + if current == h { + return + } + if internalHandler, ok := current.(*loggingErrorHandler); ok { + internalHandler.setDelegate(h) + } + }) +} + +// Handle is a convience function for ErrorHandler().Handle(err) +func Handle(err error) { + GetErrorHandler().Handle(err) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go new file mode 100644 index 000000000000..b1f7daf8d86a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go @@ -0,0 +1,338 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package baggage provides types and functions to manage W3C Baggage. +package baggage + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" +) + +type rawMap map[attribute.Key]attribute.Value +type keySet map[attribute.Key]struct{} + +// Map is an immutable storage for correlations. +type Map struct { + m rawMap +} + +// MapUpdate contains information about correlation changes to be +// made. +type MapUpdate struct { + // DropSingleK contains a single key to be dropped from + // correlations. Use this to avoid an overhead of a slice + // allocation if there is only one key to drop. + DropSingleK attribute.Key + // DropMultiK contains all the keys to be dropped from + // correlations. + DropMultiK []attribute.Key + + // SingleKV contains a single key-value pair to be added to + // correlations. Use this to avoid an overhead of a slice + // allocation if there is only one key-value pair to add. + SingleKV attribute.KeyValue + // MultiKV contains all the key-value pairs to be added to + // correlations. + MultiKV []attribute.KeyValue +} + +func newMap(raw rawMap) Map { + return Map{ + m: raw, + } +} + +// NewEmptyMap creates an empty correlations map. +func NewEmptyMap() Map { + return newMap(nil) +} + +// NewMap creates a map with the contents of the update applied. In +// this function, having an update with DropSingleK or DropMultiK +// makes no sense - those fields are effectively ignored. +func NewMap(update MapUpdate) Map { + return NewEmptyMap().Apply(update) +} + +// Apply creates a copy of the map with the contents of the update +// applied. Apply will first drop the keys from DropSingleK and +// DropMultiK, then add key-value pairs from SingleKV and MultiKV. +func (m Map) Apply(update MapUpdate) Map { + delSet, addSet := getModificationSets(update) + mapSize := getNewMapSize(m.m, delSet, addSet) + + r := make(rawMap, mapSize) + for k, v := range m.m { + // do not copy items we want to drop + if _, ok := delSet[k]; ok { + continue + } + // do not copy items we would overwrite + if _, ok := addSet[k]; ok { + continue + } + r[k] = v + } + if update.SingleKV.Key.Defined() { + r[update.SingleKV.Key] = update.SingleKV.Value + } + for _, kv := range update.MultiKV { + r[kv.Key] = kv.Value + } + if len(r) == 0 { + r = nil + } + return newMap(r) +} + +func getModificationSets(update MapUpdate) (delSet, addSet keySet) { + deletionsCount := len(update.DropMultiK) + if update.DropSingleK.Defined() { + deletionsCount++ + } + if deletionsCount > 0 { + delSet = make(map[attribute.Key]struct{}, deletionsCount) + for _, k := range update.DropMultiK { + delSet[k] = struct{}{} + } + if update.DropSingleK.Defined() { + delSet[update.DropSingleK] = struct{}{} + } + } + + additionsCount := len(update.MultiKV) + if update.SingleKV.Key.Defined() { + additionsCount++ + } + if additionsCount > 0 { + addSet = make(map[attribute.Key]struct{}, additionsCount) + for _, k := range update.MultiKV { + addSet[k.Key] = struct{}{} + } + if update.SingleKV.Key.Defined() { + addSet[update.SingleKV.Key] = struct{}{} + } + } + + return +} + +func getNewMapSize(m rawMap, delSet, addSet keySet) int { + mapSizeDiff := 0 + for k := range addSet { + if _, ok := m[k]; !ok { + mapSizeDiff++ + } + } + for k := range delSet { + if _, ok := m[k]; ok { + if _, inAddSet := addSet[k]; !inAddSet { + mapSizeDiff-- + } + } + } + return len(m) + mapSizeDiff +} + +// Value gets a value from correlations map and returns a boolean +// value indicating whether the key exist in the map. +func (m Map) Value(k attribute.Key) (attribute.Value, bool) { + value, ok := m.m[k] + return value, ok +} + +// HasValue returns a boolean value indicating whether the key exist +// in the map. +func (m Map) HasValue(k attribute.Key) bool { + _, has := m.Value(k) + return has +} + +// Len returns a length of the map. +func (m Map) Len() int { + return len(m.m) +} + +// Foreach calls a passed callback once on each key-value pair until +// all the key-value pairs of the map were iterated or the callback +// returns false, whichever happens first. +func (m Map) Foreach(f func(attribute.KeyValue) bool) { + for k, v := range m.m { + if !f(attribute.KeyValue{ + Key: k, + Value: v, + }) { + return + } + } +} + +type correlationsType struct{} + +// SetHookFunc describes a type of a callback that is called when +// storing baggage in the context. +type SetHookFunc func(context.Context) context.Context + +// GetHookFunc describes a type of a callback that is called when +// getting baggage from the context. +type GetHookFunc func(context.Context, Map) Map + +// value under this key is either of type Map or correlationsData +var correlationsKey = &correlationsType{} + +type correlationsData struct { + m Map + setHook SetHookFunc + getHook GetHookFunc +} + +func (d correlationsData) isHookless() bool { + return d.setHook == nil && d.getHook == nil +} + +type hookKind int + +const ( + hookKindSet hookKind = iota + hookKindGet +) + +func (d *correlationsData) overrideHook(kind hookKind, setHook SetHookFunc, getHook GetHookFunc) { + switch kind { + case hookKindSet: + d.setHook = setHook + case hookKindGet: + d.getHook = getHook + } +} + +// ContextWithSetHook installs a hook function that will be invoked +// every time ContextWithMap is called. To avoid unnecessary callback +// invocations (recursive or not), the callback can temporarily clear +// the hooks from the context with the ContextWithNoHooks function. +// +// Note that NewContext also calls ContextWithMap, so the hook will be +// invoked. +// +// Passing nil SetHookFunc creates a context with no set hook to call. +// +// This function should not be used by applications or libraries. It +// is mostly for interoperation with other observability APIs. +func ContextWithSetHook(ctx context.Context, hook SetHookFunc) context.Context { + return contextWithHook(ctx, hookKindSet, hook, nil) +} + +// ContextWithGetHook installs a hook function that will be invoked +// every time MapFromContext is called. To avoid unnecessary callback +// invocations (recursive or not), the callback can temporarily clear +// the hooks from the context with the ContextWithNoHooks function. +// +// Note that NewContext also calls MapFromContext, so the hook will be +// invoked. +// +// Passing nil GetHookFunc creates a context with no get hook to call. +// +// This function should not be used by applications or libraries. It +// is mostly for interoperation with other observability APIs. +func ContextWithGetHook(ctx context.Context, hook GetHookFunc) context.Context { + return contextWithHook(ctx, hookKindGet, nil, hook) +} + +func contextWithHook(ctx context.Context, kind hookKind, setHook SetHookFunc, getHook GetHookFunc) context.Context { + switch v := ctx.Value(correlationsKey).(type) { + case correlationsData: + v.overrideHook(kind, setHook, getHook) + if v.isHookless() { + return context.WithValue(ctx, correlationsKey, v.m) + } + return context.WithValue(ctx, correlationsKey, v) + case Map: + return contextWithOneHookAndMap(ctx, kind, setHook, getHook, v) + default: + m := NewEmptyMap() + return contextWithOneHookAndMap(ctx, kind, setHook, getHook, m) + } +} + +func contextWithOneHookAndMap(ctx context.Context, kind hookKind, setHook SetHookFunc, getHook GetHookFunc, m Map) context.Context { + d := correlationsData{m: m} + d.overrideHook(kind, setHook, getHook) + if d.isHookless() { + return ctx + } + return context.WithValue(ctx, correlationsKey, d) +} + +// ContextWithNoHooks creates a context with all the hooks +// disabled. Also returns old set and get hooks. This function can be +// used to temporarily clear the context from hooks and then reinstate +// them by calling ContextWithSetHook and ContextWithGetHook functions +// passing the hooks returned by this function. +// +// This function should not be used by applications or libraries. It +// is mostly for interoperation with other observability APIs. +func ContextWithNoHooks(ctx context.Context) (context.Context, SetHookFunc, GetHookFunc) { + switch v := ctx.Value(correlationsKey).(type) { + case correlationsData: + return context.WithValue(ctx, correlationsKey, v.m), v.setHook, v.getHook + default: + return ctx, nil, nil + } +} + +// ContextWithMap returns a context with the Map entered into it. +func ContextWithMap(ctx context.Context, m Map) context.Context { + switch v := ctx.Value(correlationsKey).(type) { + case correlationsData: + v.m = m + ctx = context.WithValue(ctx, correlationsKey, v) + if v.setHook != nil { + ctx = v.setHook(ctx) + } + return ctx + default: + return context.WithValue(ctx, correlationsKey, m) + } +} + +// ContextWithNoCorrelationData returns a context stripped of correlation +// data. +func ContextWithNoCorrelationData(ctx context.Context) context.Context { + return context.WithValue(ctx, correlationsKey, nil) +} + +// NewContext returns a context with the map from passed context +// updated with the passed key-value pairs. +func NewContext(ctx context.Context, keyvalues ...attribute.KeyValue) context.Context { + return ContextWithMap(ctx, MapFromContext(ctx).Apply(MapUpdate{ + MultiKV: keyvalues, + })) +} + +// MapFromContext gets the current Map from a Context. +func MapFromContext(ctx context.Context) Map { + switch v := ctx.Value(correlationsKey).(type) { + case correlationsData: + if v.getHook != nil { + return v.getHook(ctx, v.m) + } + return v.m + case Map: + return v + default: + return NewEmptyMap() + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/meter.go new file mode 100644 index 000000000000..36f9edeb8c6b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/meter.go @@ -0,0 +1,348 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global + +import ( + "context" + "sync" + "sync/atomic" + "unsafe" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/number" + "go.opentelemetry.io/otel/metric/registry" +) + +// This file contains the forwarding implementation of MeterProvider used as +// the default global instance. Metric events using instruments provided by +// this implementation are no-ops until the first Meter implementation is set +// as the global provider. +// +// The implementation here uses Mutexes to maintain a list of active Meters in +// the MeterProvider and Instruments in each Meter, under the assumption that +// these interfaces are not performance-critical. +// +// We have the invariant that setDelegate() will be called before a new +// MeterProvider implementation is registered as the global provider. Mutexes +// in the MeterProvider and Meters ensure that each instrument has a delegate +// before the global provider is set. +// +// Bound instrument operations are implemented by delegating to the +// instrument after it is registered, with a sync.Once initializer to +// protect against races with Release(). +// +// Metric uniqueness checking is implemented by calling the exported +// methods of the api/metric/registry package. + +type meterKey struct { + Name, Version string +} + +type meterProvider struct { + delegate metric.MeterProvider + + // lock protects `delegate` and `meters`. + lock sync.Mutex + + // meters maintains a unique entry for every named Meter + // that has been registered through the global instance. + meters map[meterKey]*meterEntry +} + +type meterImpl struct { + delegate unsafe.Pointer // (*metric.MeterImpl) + + lock sync.Mutex + syncInsts []*syncImpl + asyncInsts []*asyncImpl +} + +type meterEntry struct { + unique metric.MeterImpl + impl meterImpl +} + +type instrument struct { + descriptor metric.Descriptor +} + +type syncImpl struct { + delegate unsafe.Pointer // (*metric.SyncImpl) + + instrument +} + +type asyncImpl struct { + delegate unsafe.Pointer // (*metric.AsyncImpl) + + instrument + + runner metric.AsyncRunner +} + +// SyncImpler is implemented by all of the sync metric +// instruments. +type SyncImpler interface { + SyncImpl() metric.SyncImpl +} + +// AsyncImpler is implemented by all of the async +// metric instruments. +type AsyncImpler interface { + AsyncImpl() metric.AsyncImpl +} + +type syncHandle struct { + delegate unsafe.Pointer // (*metric.BoundInstrumentImpl) + + inst *syncImpl + labels []attribute.KeyValue + + initialize sync.Once +} + +var _ metric.MeterProvider = &meterProvider{} +var _ metric.MeterImpl = &meterImpl{} +var _ metric.InstrumentImpl = &syncImpl{} +var _ metric.BoundSyncImpl = &syncHandle{} +var _ metric.AsyncImpl = &asyncImpl{} + +func (inst *instrument) Descriptor() metric.Descriptor { + return inst.descriptor +} + +// MeterProvider interface and delegation + +func newMeterProvider() *meterProvider { + return &meterProvider{ + meters: map[meterKey]*meterEntry{}, + } +} + +func (p *meterProvider) setDelegate(provider metric.MeterProvider) { + p.lock.Lock() + defer p.lock.Unlock() + + p.delegate = provider + for key, entry := range p.meters { + entry.impl.setDelegate(key.Name, key.Version, provider) + } + p.meters = nil +} + +func (p *meterProvider) Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter { + p.lock.Lock() + defer p.lock.Unlock() + + if p.delegate != nil { + return p.delegate.Meter(instrumentationName, opts...) + } + + key := meterKey{ + Name: instrumentationName, + Version: metric.NewMeterConfig(opts...).InstrumentationVersion, + } + entry, ok := p.meters[key] + if !ok { + entry = &meterEntry{} + entry.unique = registry.NewUniqueInstrumentMeterImpl(&entry.impl) + p.meters[key] = entry + + } + return metric.WrapMeterImpl(entry.unique, key.Name, metric.WithInstrumentationVersion(key.Version)) +} + +// Meter interface and delegation + +func (m *meterImpl) setDelegate(name, version string, provider metric.MeterProvider) { + m.lock.Lock() + defer m.lock.Unlock() + + d := new(metric.MeterImpl) + *d = provider.Meter(name, metric.WithInstrumentationVersion(version)).MeterImpl() + m.delegate = unsafe.Pointer(d) + + for _, inst := range m.syncInsts { + inst.setDelegate(*d) + } + m.syncInsts = nil + for _, obs := range m.asyncInsts { + obs.setDelegate(*d) + } + m.asyncInsts = nil +} + +func (m *meterImpl) NewSyncInstrument(desc metric.Descriptor) (metric.SyncImpl, error) { + m.lock.Lock() + defer m.lock.Unlock() + + if meterPtr := (*metric.MeterImpl)(atomic.LoadPointer(&m.delegate)); meterPtr != nil { + return (*meterPtr).NewSyncInstrument(desc) + } + + inst := &syncImpl{ + instrument: instrument{ + descriptor: desc, + }, + } + m.syncInsts = append(m.syncInsts, inst) + return inst, nil +} + +// Synchronous delegation + +func (inst *syncImpl) setDelegate(d metric.MeterImpl) { + implPtr := new(metric.SyncImpl) + + var err error + *implPtr, err = d.NewSyncInstrument(inst.descriptor) + + if err != nil { + // TODO: There is no standard way to deliver this error to the user. + // See https://github.com/open-telemetry/opentelemetry-go/issues/514 + // Note that the default SDK will not generate any errors yet, this is + // only for added safety. + panic(err) + } + + atomic.StorePointer(&inst.delegate, unsafe.Pointer(implPtr)) +} + +func (inst *syncImpl) Implementation() interface{} { + if implPtr := (*metric.SyncImpl)(atomic.LoadPointer(&inst.delegate)); implPtr != nil { + return (*implPtr).Implementation() + } + return inst +} + +func (inst *syncImpl) Bind(labels []attribute.KeyValue) metric.BoundSyncImpl { + if implPtr := (*metric.SyncImpl)(atomic.LoadPointer(&inst.delegate)); implPtr != nil { + return (*implPtr).Bind(labels) + } + return &syncHandle{ + inst: inst, + labels: labels, + } +} + +func (bound *syncHandle) Unbind() { + bound.initialize.Do(func() {}) + + implPtr := (*metric.BoundSyncImpl)(atomic.LoadPointer(&bound.delegate)) + + if implPtr == nil { + return + } + + (*implPtr).Unbind() +} + +// Async delegation + +func (m *meterImpl) NewAsyncInstrument( + desc metric.Descriptor, + runner metric.AsyncRunner, +) (metric.AsyncImpl, error) { + + m.lock.Lock() + defer m.lock.Unlock() + + if meterPtr := (*metric.MeterImpl)(atomic.LoadPointer(&m.delegate)); meterPtr != nil { + return (*meterPtr).NewAsyncInstrument(desc, runner) + } + + inst := &asyncImpl{ + instrument: instrument{ + descriptor: desc, + }, + runner: runner, + } + m.asyncInsts = append(m.asyncInsts, inst) + return inst, nil +} + +func (obs *asyncImpl) Implementation() interface{} { + if implPtr := (*metric.AsyncImpl)(atomic.LoadPointer(&obs.delegate)); implPtr != nil { + return (*implPtr).Implementation() + } + return obs +} + +func (obs *asyncImpl) setDelegate(d metric.MeterImpl) { + implPtr := new(metric.AsyncImpl) + + var err error + *implPtr, err = d.NewAsyncInstrument(obs.descriptor, obs.runner) + + if err != nil { + // TODO: There is no standard way to deliver this error to the user. + // See https://github.com/open-telemetry/opentelemetry-go/issues/514 + // Note that the default SDK will not generate any errors yet, this is + // only for added safety. + panic(err) + } + + atomic.StorePointer(&obs.delegate, unsafe.Pointer(implPtr)) +} + +// Metric updates + +func (m *meterImpl) RecordBatch(ctx context.Context, labels []attribute.KeyValue, measurements ...metric.Measurement) { + if delegatePtr := (*metric.MeterImpl)(atomic.LoadPointer(&m.delegate)); delegatePtr != nil { + (*delegatePtr).RecordBatch(ctx, labels, measurements...) + } +} + +func (inst *syncImpl) RecordOne(ctx context.Context, number number.Number, labels []attribute.KeyValue) { + if instPtr := (*metric.SyncImpl)(atomic.LoadPointer(&inst.delegate)); instPtr != nil { + (*instPtr).RecordOne(ctx, number, labels) + } +} + +// Bound instrument initialization + +func (bound *syncHandle) RecordOne(ctx context.Context, number number.Number) { + instPtr := (*metric.SyncImpl)(atomic.LoadPointer(&bound.inst.delegate)) + if instPtr == nil { + return + } + var implPtr *metric.BoundSyncImpl + bound.initialize.Do(func() { + implPtr = new(metric.BoundSyncImpl) + *implPtr = (*instPtr).Bind(bound.labels) + atomic.StorePointer(&bound.delegate, unsafe.Pointer(implPtr)) + }) + if implPtr == nil { + implPtr = (*metric.BoundSyncImpl)(atomic.LoadPointer(&bound.delegate)) + } + // This may still be nil if instrument was created and bound + // without a delegate, then the instrument was set to have a + // delegate and unbound. + if implPtr == nil { + return + } + (*implPtr).RecordOne(ctx, number) +} + +func AtomicFieldOffsets() map[string]uintptr { + return map[string]uintptr{ + "meterProvider.delegate": unsafe.Offsetof(meterProvider{}.delegate), + "meterImpl.delegate": unsafe.Offsetof(meterImpl{}.delegate), + "syncImpl.delegate": unsafe.Offsetof(syncImpl{}.delegate), + "asyncImpl.delegate": unsafe.Offsetof(asyncImpl{}.delegate), + "syncHandle.delegate": unsafe.Offsetof(syncHandle{}.delegate), + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/propagator.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/propagator.go new file mode 100644 index 000000000000..1c8b8589b08c --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/propagator.go @@ -0,0 +1,82 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel/propagation" +) + +// textMapPropagator is a default TextMapPropagator that delegates calls to a +// registered delegate if one is set, otherwise it defaults to delegating the +// calls to a the default no-op propagation.TextMapPropagator. +type textMapPropagator struct { + mtx sync.Mutex + once sync.Once + delegate propagation.TextMapPropagator + noop propagation.TextMapPropagator +} + +// Compile-time guarantee that textMapPropagator implements the +// propagation.TextMapPropagator interface. +var _ propagation.TextMapPropagator = (*textMapPropagator)(nil) + +func newTextMapPropagator() *textMapPropagator { + return &textMapPropagator{ + noop: propagation.NewCompositeTextMapPropagator(), + } +} + +// SetDelegate sets a delegate propagation.TextMapPropagator that all calls are +// forwarded to. Delegation can only be performed once, all subsequent calls +// perform no delegation. +func (p *textMapPropagator) SetDelegate(delegate propagation.TextMapPropagator) { + if delegate == nil { + return + } + + p.mtx.Lock() + p.once.Do(func() { p.delegate = delegate }) + p.mtx.Unlock() +} + +// effectiveDelegate returns the current delegate of p if one is set, +// otherwise the default noop TextMapPropagator is returned. This method +// can be called concurrently. +func (p *textMapPropagator) effectiveDelegate() propagation.TextMapPropagator { + p.mtx.Lock() + defer p.mtx.Unlock() + if p.delegate != nil { + return p.delegate + } + return p.noop +} + +// Inject set cross-cutting concerns from the Context into the carrier. +func (p *textMapPropagator) Inject(ctx context.Context, carrier propagation.TextMapCarrier) { + p.effectiveDelegate().Inject(ctx, carrier) +} + +// Extract reads cross-cutting concerns from the carrier into a Context. +func (p *textMapPropagator) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context { + return p.effectiveDelegate().Extract(ctx, carrier) +} + +// Fields returns the keys whose values are set with Inject. +func (p *textMapPropagator) Fields() []string { + return p.effectiveDelegate().Fields() +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/state.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/state.go new file mode 100644 index 000000000000..f3bf0035100f --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/state.go @@ -0,0 +1,143 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global + +import ( + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" +) + +type ( + tracerProviderHolder struct { + tp trace.TracerProvider + } + + meterProviderHolder struct { + mp metric.MeterProvider + } + + propagatorsHolder struct { + tm propagation.TextMapPropagator + } +) + +var ( + globalTracer = defaultTracerValue() + globalMeter = defaultMeterValue() + globalPropagators = defaultPropagatorsValue() + + delegateMeterOnce sync.Once + delegateTraceOnce sync.Once + delegateTextMapPropagatorOnce sync.Once +) + +// TracerProvider is the internal implementation for global.TracerProvider. +func TracerProvider() trace.TracerProvider { + return globalTracer.Load().(tracerProviderHolder).tp +} + +// SetTracerProvider is the internal implementation for global.SetTracerProvider. +func SetTracerProvider(tp trace.TracerProvider) { + delegateTraceOnce.Do(func() { + current := TracerProvider() + if current == tp { + // Setting the provider to the prior default is nonsense, panic. + // Panic is acceptable because we are likely still early in the + // process lifetime. + panic("invalid TracerProvider, the global instance cannot be reinstalled") + } else if def, ok := current.(*tracerProvider); ok { + def.setDelegate(tp) + } + + }) + globalTracer.Store(tracerProviderHolder{tp: tp}) +} + +// MeterProvider is the internal implementation for global.MeterProvider. +func MeterProvider() metric.MeterProvider { + return globalMeter.Load().(meterProviderHolder).mp +} + +// SetMeterProvider is the internal implementation for global.SetMeterProvider. +func SetMeterProvider(mp metric.MeterProvider) { + delegateMeterOnce.Do(func() { + current := MeterProvider() + + if current == mp { + // Setting the provider to the prior default is nonsense, panic. + // Panic is acceptable because we are likely still early in the + // process lifetime. + panic("invalid MeterProvider, the global instance cannot be reinstalled") + } else if def, ok := current.(*meterProvider); ok { + def.setDelegate(mp) + } + }) + globalMeter.Store(meterProviderHolder{mp: mp}) +} + +// TextMapPropagator is the internal implementation for global.TextMapPropagator. +func TextMapPropagator() propagation.TextMapPropagator { + return globalPropagators.Load().(propagatorsHolder).tm +} + +// SetTextMapPropagator is the internal implementation for global.SetTextMapPropagator. +func SetTextMapPropagator(p propagation.TextMapPropagator) { + // For the textMapPropagator already returned by TextMapPropagator + // delegate to p. + delegateTextMapPropagatorOnce.Do(func() { + if current := TextMapPropagator(); current == p { + // Setting the provider to the prior default is nonsense, panic. + // Panic is acceptable because we are likely still early in the + // process lifetime. + panic("invalid TextMapPropagator, the global instance cannot be reinstalled") + } else if def, ok := current.(*textMapPropagator); ok { + def.SetDelegate(p) + } + }) + // Return p when subsequent calls to TextMapPropagator are made. + globalPropagators.Store(propagatorsHolder{tm: p}) +} + +func defaultTracerValue() *atomic.Value { + v := &atomic.Value{} + v.Store(tracerProviderHolder{tp: &tracerProvider{}}) + return v +} + +func defaultMeterValue() *atomic.Value { + v := &atomic.Value{} + v.Store(meterProviderHolder{mp: newMeterProvider()}) + return v +} + +func defaultPropagatorsValue() *atomic.Value { + v := &atomic.Value{} + v.Store(propagatorsHolder{tm: newTextMapPropagator()}) + return v +} + +// ResetForTest restores the initial global state, for testing purposes. +func ResetForTest() { + globalTracer = defaultTracerValue() + globalMeter = defaultMeterValue() + globalPropagators = defaultPropagatorsValue() + delegateMeterOnce = sync.Once{} + delegateTraceOnce = sync.Once{} + delegateTextMapPropagatorOnce = sync.Once{} +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/trace.go new file mode 100644 index 000000000000..d7f71dc06c65 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/trace.go @@ -0,0 +1,147 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global + +/* +This file contains the forwarding implementation of the TracerProvider used as +the default global instance. Prior to initialization of an SDK, Tracers +returned by the global TracerProvider will provide no-op functionality. This +means that all Span created prior to initialization are no-op Spans. + +Once an SDK has been initialized, all provided no-op Tracers are swapped for +Tracers provided by the SDK defined TracerProvider. However, any Span started +prior to this initialization does not change its behavior. Meaning, the Span +remains a no-op Span. + +The implementation to track and swap Tracers locks all new Tracer creation +until the swap is complete. This assumes that this operation is not +performance-critical. If that assumption is incorrect, be sure to configure an +SDK prior to any Tracer creation. +*/ + +import ( + "context" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/internal/trace/noop" + "go.opentelemetry.io/otel/trace" +) + +// tracerProvider is a placeholder for a configured SDK TracerProvider. +// +// All TracerProvider functionality is forwarded to a delegate once +// configured. +type tracerProvider struct { + mtx sync.Mutex + tracers map[il]*tracer + delegate trace.TracerProvider +} + +// Compile-time guarantee that tracerProvider implements the TracerProvider +// interface. +var _ trace.TracerProvider = &tracerProvider{} + +// setDelegate configures p to delegate all TracerProvider functionality to +// provider. +// +// All Tracers provided prior to this function call are switched out to be +// Tracers provided by provider. +// +// It is guaranteed by the caller that this happens only once. +func (p *tracerProvider) setDelegate(provider trace.TracerProvider) { + p.mtx.Lock() + defer p.mtx.Unlock() + + p.delegate = provider + + if len(p.tracers) == 0 { + return + } + + for _, t := range p.tracers { + t.setDelegate(provider) + } + + p.tracers = nil +} + +// Tracer implements TracerProvider. +func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.Tracer { + p.mtx.Lock() + defer p.mtx.Unlock() + + if p.delegate != nil { + return p.delegate.Tracer(name, opts...) + } + + // At this moment it is guaranteed that no sdk is installed, save the tracer in the tracers map. + + key := il{ + name: name, + version: trace.NewTracerConfig(opts...).InstrumentationVersion, + } + + if p.tracers == nil { + p.tracers = make(map[il]*tracer) + } + + if val, ok := p.tracers[key]; ok { + return val + } + + t := &tracer{name: name, opts: opts} + p.tracers[key] = t + return t +} + +type il struct { + name string + version string +} + +// tracer is a placeholder for a trace.Tracer. +// +// All Tracer functionality is forwarded to a delegate once configured. +// Otherwise, all functionality is forwarded to a NoopTracer. +type tracer struct { + name string + opts []trace.TracerOption + + delegate atomic.Value +} + +// Compile-time guarantee that tracer implements the trace.Tracer interface. +var _ trace.Tracer = &tracer{} + +// setDelegate configures t to delegate all Tracer functionality to Tracers +// created by provider. +// +// All subsequent calls to the Tracer methods will be passed to the delegate. +// +// It is guaranteed by the caller that this happens only once. +func (t *tracer) setDelegate(provider trace.TracerProvider) { + t.delegate.Store(provider.Tracer(t.name, t.opts...)) +} + +// Start implements trace.Tracer by forwarding the call to t.delegate if +// set, otherwise it forwards the call to a NoopTracer. +func (t *tracer) Start(ctx context.Context, name string, opts ...trace.SpanOption) (context.Context, trace.Span) { + delegate := t.delegate.Load() + if delegate != nil { + return delegate.(trace.Tracer).Start(ctx, name, opts...) + } + return noop.Tracer.Start(ctx, name, opts...) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/metric/async.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/metric/async.go new file mode 100644 index 000000000000..f05faca8a904 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/metric/async.go @@ -0,0 +1,148 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric + +import ( + "context" + "errors" + "fmt" + "sync" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" +) + +var ErrInvalidAsyncRunner = errors.New("unknown async runner type") + +// AsyncCollector is an interface used between the MeterImpl and the +// AsyncInstrumentState helper below. This interface is implemented by +// the SDK to provide support for running observer callbacks. +type AsyncCollector interface { + // CollectAsync passes a batch of observations to the MeterImpl. + CollectAsync(labels []attribute.KeyValue, observation ...metric.Observation) +} + +// AsyncInstrumentState manages an ordered set of asynchronous +// instruments and the distinct runners, taking into account batch +// observer callbacks. +type AsyncInstrumentState struct { + lock sync.Mutex + + // errorOnce will use the otel.Handler to report an error + // once in case of an invalid runner attempting to run. + errorOnce sync.Once + + // runnerMap keeps the set of runners that will run each + // collection interval. Singletons are entered with a real + // instrument each, batch observers are entered with a nil + // instrument, ensuring that when a singleton callback is used + // repeatedly, it is executed repeatedly in the interval, while + // when a batch callback is used repeatedly, it only executes + // once per interval. + runnerMap map[asyncRunnerPair]struct{} + + // runners maintains the set of runners in the order they were + // registered. + runners []asyncRunnerPair + + // instruments maintains the set of instruments in the order + // they were registered. + instruments []metric.AsyncImpl +} + +// asyncRunnerPair is a map entry for Observer callback runners. +type asyncRunnerPair struct { + // runner is used as a map key here. The API ensures + // that all callbacks are pointers for this reason. + runner metric.AsyncRunner + + // inst refers to a non-nil instrument when `runner` is a + // AsyncSingleRunner. + inst metric.AsyncImpl +} + +// NewAsyncInstrumentState returns a new *AsyncInstrumentState, for +// use by MeterImpl to manage running the set of observer callbacks in +// the correct order. +func NewAsyncInstrumentState() *AsyncInstrumentState { + return &AsyncInstrumentState{ + runnerMap: map[asyncRunnerPair]struct{}{}, + } +} + +// Instruments returns the asynchronous instruments managed by this +// object, the set that should be checkpointed after observers are +// run. +func (a *AsyncInstrumentState) Instruments() []metric.AsyncImpl { + a.lock.Lock() + defer a.lock.Unlock() + return a.instruments +} + +// Register adds a new asynchronous instrument to by managed by this +// object. This should be called during NewAsyncInstrument() and +// assumes that errors (e.g., duplicate registration) have already +// been checked. +func (a *AsyncInstrumentState) Register(inst metric.AsyncImpl, runner metric.AsyncRunner) { + a.lock.Lock() + defer a.lock.Unlock() + + a.instruments = append(a.instruments, inst) + + // asyncRunnerPair reflects this callback in the asyncRunners + // list. If this is a batch runner, the instrument is nil. + // If this is a single-Observer runner, the instrument is + // included. This ensures that batch callbacks are called + // once and single callbacks are called once per instrument. + rp := asyncRunnerPair{ + runner: runner, + } + if _, ok := runner.(metric.AsyncSingleRunner); ok { + rp.inst = inst + } + + if _, ok := a.runnerMap[rp]; !ok { + a.runnerMap[rp] = struct{}{} + a.runners = append(a.runners, rp) + } +} + +// Run executes the complete set of observer callbacks. +func (a *AsyncInstrumentState) Run(ctx context.Context, collector AsyncCollector) { + a.lock.Lock() + runners := a.runners + a.lock.Unlock() + + for _, rp := range runners { + // The runner must be a single or batch runner, no + // other implementations are possible because the + // interface has un-exported methods. + + if singleRunner, ok := rp.runner.(metric.AsyncSingleRunner); ok { + singleRunner.Run(ctx, rp.inst, collector.CollectAsync) + continue + } + + if multiRunner, ok := rp.runner.(metric.AsyncBatchRunner); ok { + multiRunner.Run(ctx, collector.CollectAsync) + continue + } + + a.errorOnce.Do(func() { + otel.Handle(fmt.Errorf("%w: type %T (reported once)", ErrInvalidAsyncRunner, rp)) + }) + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go new file mode 100644 index 000000000000..0d806b1c8972 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go @@ -0,0 +1,55 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal + +import ( + "math" + "unsafe" +) + +func BoolToRaw(b bool) uint64 { + if b { + return 1 + } + return 0 +} + +func RawToBool(r uint64) bool { + return r != 0 +} + +func Int64ToRaw(i int64) uint64 { + return uint64(i) +} + +func RawToInt64(r uint64) int64 { + return int64(r) +} + +func Float64ToRaw(f float64) uint64 { + return math.Float64bits(f) +} + +func RawToFloat64(r uint64) float64 { + return math.Float64frombits(r) +} + +func RawPtrToFloat64Ptr(r *uint64) *float64 { + return (*float64)(unsafe.Pointer(r)) +} + +func RawPtrToInt64Ptr(r *uint64) *int64 { + return (*int64)(unsafe.Pointer(r)) +} diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/err.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/trace/noop/noop.go similarity index 55% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/err.go rename to cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/trace/noop/noop.go index f4b941d6529e..765c21a289cb 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/err.go +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/trace/noop/noop.go @@ -1,4 +1,4 @@ -// Copyright 2018 The etcd Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,28 +12,24 @@ // See the License for the specific language governing permissions and // limitations under the License. -package picker +// Package noop provides noop tracing implementations for tracer and span. +package noop import ( "context" - "google.golang.org/grpc/balancer" + "go.opentelemetry.io/otel/trace" ) -// NewErr returns a picker that always returns err on "Pick". -func NewErr(err error) Picker { - return &errPicker{p: Error, err: err} -} - -type errPicker struct { - p Policy - err error -} +var ( + // Tracer is a noop tracer that starts noop spans. + Tracer trace.Tracer -func (ep *errPicker) String() string { - return ep.p.String() -} + // Span is a noop Span. + Span trace.Span +) -func (ep *errPicker) Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { - return nil, nil, ep.err +func init() { + Tracer = trace.NewNoopTracerProvider().Tracer("") + _, Span = Tracer.Start(context.Background(), "") } diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/LICENSE b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/config.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/config.go new file mode 100644 index 000000000000..02f0ff8e0cb8 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/config.go @@ -0,0 +1,128 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "go.opentelemetry.io/otel/unit" +) + +// InstrumentConfig contains options for metric instrument descriptors. +type InstrumentConfig struct { + // Description describes the instrument in human-readable terms. + Description string + // Unit describes the measurement unit for a instrument. + Unit unit.Unit + // InstrumentationName is the name of the library providing + // instrumentation. + InstrumentationName string + // InstrumentationVersion is the version of the library providing + // instrumentation. + InstrumentationVersion string +} + +// InstrumentOption is an interface for applying metric instrument options. +type InstrumentOption interface { + // ApplyMeter is used to set a InstrumentOption value of a + // InstrumentConfig. + ApplyInstrument(*InstrumentConfig) +} + +// NewInstrumentConfig creates a new InstrumentConfig +// and applies all the given options. +func NewInstrumentConfig(opts ...InstrumentOption) InstrumentConfig { + var config InstrumentConfig + for _, o := range opts { + o.ApplyInstrument(&config) + } + return config +} + +// WithDescription applies provided description. +func WithDescription(desc string) InstrumentOption { + return descriptionOption(desc) +} + +type descriptionOption string + +func (d descriptionOption) ApplyInstrument(config *InstrumentConfig) { + config.Description = string(d) +} + +// WithUnit applies provided unit. +func WithUnit(unit unit.Unit) InstrumentOption { + return unitOption(unit) +} + +type unitOption unit.Unit + +func (u unitOption) ApplyInstrument(config *InstrumentConfig) { + config.Unit = unit.Unit(u) +} + +// WithInstrumentationName sets the instrumentation name. +func WithInstrumentationName(name string) InstrumentOption { + return instrumentationNameOption(name) +} + +type instrumentationNameOption string + +func (i instrumentationNameOption) ApplyInstrument(config *InstrumentConfig) { + config.InstrumentationName = string(i) +} + +// MeterConfig contains options for Meters. +type MeterConfig struct { + // InstrumentationVersion is the version of the library providing + // instrumentation. + InstrumentationVersion string +} + +// MeterOption is an interface for applying Meter options. +type MeterOption interface { + // ApplyMeter is used to set a MeterOption value of a MeterConfig. + ApplyMeter(*MeterConfig) +} + +// NewMeterConfig creates a new MeterConfig and applies +// all the given options. +func NewMeterConfig(opts ...MeterOption) MeterConfig { + var config MeterConfig + for _, o := range opts { + o.ApplyMeter(&config) + } + return config +} + +// InstrumentationOption is an interface for applying instrumentation specific +// options. +type InstrumentationOption interface { + InstrumentOption + MeterOption +} + +// WithInstrumentationVersion sets the instrumentation version. +func WithInstrumentationVersion(version string) InstrumentationOption { + return instrumentationVersionOption(version) +} + +type instrumentationVersionOption string + +func (i instrumentationVersionOption) ApplyMeter(config *MeterConfig) { + config.InstrumentationVersion = string(i) +} + +func (i instrumentationVersionOption) ApplyInstrument(config *InstrumentConfig) { + config.InstrumentationVersion = string(i) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/doc.go new file mode 100644 index 000000000000..7889ff000f7c --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/doc.go @@ -0,0 +1,67 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package metric provides an implementation of the metrics part of the +OpenTelemetry API. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track the +evolving OpenTelemetry specification and user feedback. + +Measurements can be made about an operation being performed or the state of a +system in general. These measurements can be crucial to the reliable operation +of code and provide valuable insights about the inner workings of a system. + +Measurements are made using instruments provided by this package. The type of +instrument used will depend on the type of measurement being made and of what +part of a system is being measured. + +Instruments are categorized as Synchronous or Asynchronous and independently +as Adding or Grouping. Synchronous instruments are called by the user with a +Context. Asynchronous instruments are called by the SDK during collection. +Additive instruments are semantically intended for capturing a sum. Grouping +instruments are intended for capturing a distribution. + +Additive instruments may be monotonic, in which case they are non-decreasing +and naturally define a rate. + +The synchronous instrument names are: + + Counter: additive, monotonic + UpDownCounter: additive + ValueRecorder: grouping + +and the asynchronous instruments are: + + SumObserver: additive, monotonic + UpDownSumObserver: additive + ValueObserver: grouping + +All instruments are provided with support for either float64 or int64 input +values. + +An instrument is created using a Meter. Additionally, a Meter is used to +record batches of synchronous measurements or asynchronous observations. A +Meter is obtained using a MeterProvider. A Meter, like a Tracer, is unique to +the instrumentation it instruments and must be named and versioned when +created with a MeterProvider with the name and version of the instrumentation +library. + +Instrumentation should be designed to accept a MeterProvider from which it can +create its own unique Meter. Alternatively, the registered global +MeterProvider from the go.opentelemetry.io/otel package can be used as a +default. +*/ +package metric // import "go.opentelemetry.io/otel/metric" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/global/metric.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/global/metric.go new file mode 100644 index 000000000000..8d16d34d486e --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/global/metric.go @@ -0,0 +1,49 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/metric/global" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/metric" +) + +// Meter creates an implementation of the Meter interface from the global +// MeterProvider. The instrumentationName must be the name of the library +// providing instrumentation. This name may be the same as the instrumented +// code only if that code provides built-in instrumentation. If the +// instrumentationName is empty, then a implementation defined default name +// will be used instead. +// +// This is short for MeterProvider().Meter(name) +func Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter { + return GetMeterProvider().Meter(instrumentationName, opts...) +} + +// GetMeterProvider returns the registered global meter provider. If +// none is registered then a default meter provider is returned that +// forwards the Meter interface to the first registered Meter. +// +// Use the meter provider to create a named meter. E.g. +// meter := global.MeterProvider().Meter("example.com/foo") +// or +// meter := global.Meter("example.com/foo") +func GetMeterProvider() metric.MeterProvider { + return global.MeterProvider() +} + +// SetMeterProvider registers `mp` as the global meter provider. +func SetMeterProvider(mp metric.MeterProvider) { + global.SetMeterProvider(mp) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/go.mod b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/go.mod new file mode 100644 index 000000000000..47bc47badde6 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/go.mod @@ -0,0 +1,54 @@ +module go.opentelemetry.io/otel/metric + +go 1.14 + +replace go.opentelemetry.io/otel => ../ + +replace go.opentelemetry.io/otel/bridge/opencensus => ../bridge/opencensus + +replace go.opentelemetry.io/otel/bridge/opentracing => ../bridge/opentracing + +replace go.opentelemetry.io/otel/example/jaeger => ../example/jaeger + +replace go.opentelemetry.io/otel/example/namedtracer => ../example/namedtracer + +replace go.opentelemetry.io/otel/example/opencensus => ../example/opencensus + +replace go.opentelemetry.io/otel/example/otel-collector => ../example/otel-collector + +replace go.opentelemetry.io/otel/example/prom-collector => ../example/prom-collector + +replace go.opentelemetry.io/otel/example/prometheus => ../example/prometheus + +replace go.opentelemetry.io/otel/example/zipkin => ../example/zipkin + +replace go.opentelemetry.io/otel/exporters/metric/prometheus => ../exporters/metric/prometheus + +replace go.opentelemetry.io/otel/exporters/otlp => ../exporters/otlp + +replace go.opentelemetry.io/otel/exporters/stdout => ../exporters/stdout + +replace go.opentelemetry.io/otel/exporters/trace/jaeger => ../exporters/trace/jaeger + +replace go.opentelemetry.io/otel/exporters/trace/zipkin => ../exporters/trace/zipkin + +replace go.opentelemetry.io/otel/internal/tools => ../internal/tools + +replace go.opentelemetry.io/otel/metric => ./ + +replace go.opentelemetry.io/otel/oteltest => ../oteltest + +replace go.opentelemetry.io/otel/sdk => ../sdk + +replace go.opentelemetry.io/otel/sdk/export/metric => ../sdk/export/metric + +replace go.opentelemetry.io/otel/sdk/metric => ../sdk/metric + +replace go.opentelemetry.io/otel/trace => ../trace + +require ( + github.com/google/go-cmp v0.5.5 + github.com/stretchr/testify v1.7.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/oteltest v0.20.0 +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/go.sum b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/go.sum new file mode 100644 index 000000000000..b69f2e56da0f --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/instrumentkind_string.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/instrumentkind_string.go new file mode 100644 index 000000000000..2805e22500c7 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/instrumentkind_string.go @@ -0,0 +1,28 @@ +// Code generated by "stringer -type=InstrumentKind"; DO NOT EDIT. + +package metric + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[ValueRecorderInstrumentKind-0] + _ = x[ValueObserverInstrumentKind-1] + _ = x[CounterInstrumentKind-2] + _ = x[UpDownCounterInstrumentKind-3] + _ = x[SumObserverInstrumentKind-4] + _ = x[UpDownSumObserverInstrumentKind-5] +} + +const _InstrumentKind_name = "ValueRecorderInstrumentKindValueObserverInstrumentKindCounterInstrumentKindUpDownCounterInstrumentKindSumObserverInstrumentKindUpDownSumObserverInstrumentKind" + +var _InstrumentKind_index = [...]uint8{0, 27, 54, 75, 102, 127, 158} + +func (i InstrumentKind) String() string { + if i < 0 || i >= InstrumentKind(len(_InstrumentKind_index)-1) { + return "InstrumentKind(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _InstrumentKind_name[_InstrumentKind_index[i]:_InstrumentKind_index[i+1]] +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric.go new file mode 100644 index 000000000000..b591985df686 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric.go @@ -0,0 +1,577 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric/number" + "go.opentelemetry.io/otel/unit" +) + +// MeterProvider supports named Meter instances. +type MeterProvider interface { + // Meter creates an implementation of the Meter interface. + // The instrumentationName must be the name of the library providing + // instrumentation. This name may be the same as the instrumented code + // only if that code provides built-in instrumentation. If the + // instrumentationName is empty, then a implementation defined default + // name will be used instead. + Meter(instrumentationName string, opts ...MeterOption) Meter +} + +// Meter is the creator of metric instruments. +// +// An uninitialized Meter is a no-op implementation. +type Meter struct { + impl MeterImpl + name, version string +} + +// RecordBatch atomically records a batch of measurements. +func (m Meter) RecordBatch(ctx context.Context, ls []attribute.KeyValue, ms ...Measurement) { + if m.impl == nil { + return + } + m.impl.RecordBatch(ctx, ls, ms...) +} + +// NewBatchObserver creates a new BatchObserver that supports +// making batches of observations for multiple instruments. +func (m Meter) NewBatchObserver(callback BatchObserverFunc) BatchObserver { + return BatchObserver{ + meter: m, + runner: newBatchAsyncRunner(callback), + } +} + +// NewInt64Counter creates a new integer Counter instrument with the +// given name, customized with options. May return an error if the +// name is invalid (e.g., empty) or improperly registered (e.g., +// duplicate registration). +func (m Meter) NewInt64Counter(name string, options ...InstrumentOption) (Int64Counter, error) { + return wrapInt64CounterInstrument( + m.newSync(name, CounterInstrumentKind, number.Int64Kind, options)) +} + +// NewFloat64Counter creates a new floating point Counter with the +// given name, customized with options. May return an error if the +// name is invalid (e.g., empty) or improperly registered (e.g., +// duplicate registration). +func (m Meter) NewFloat64Counter(name string, options ...InstrumentOption) (Float64Counter, error) { + return wrapFloat64CounterInstrument( + m.newSync(name, CounterInstrumentKind, number.Float64Kind, options)) +} + +// NewInt64UpDownCounter creates a new integer UpDownCounter instrument with the +// given name, customized with options. May return an error if the +// name is invalid (e.g., empty) or improperly registered (e.g., +// duplicate registration). +func (m Meter) NewInt64UpDownCounter(name string, options ...InstrumentOption) (Int64UpDownCounter, error) { + return wrapInt64UpDownCounterInstrument( + m.newSync(name, UpDownCounterInstrumentKind, number.Int64Kind, options)) +} + +// NewFloat64UpDownCounter creates a new floating point UpDownCounter with the +// given name, customized with options. May return an error if the +// name is invalid (e.g., empty) or improperly registered (e.g., +// duplicate registration). +func (m Meter) NewFloat64UpDownCounter(name string, options ...InstrumentOption) (Float64UpDownCounter, error) { + return wrapFloat64UpDownCounterInstrument( + m.newSync(name, UpDownCounterInstrumentKind, number.Float64Kind, options)) +} + +// NewInt64ValueRecorder creates a new integer ValueRecorder instrument with the +// given name, customized with options. May return an error if the +// name is invalid (e.g., empty) or improperly registered (e.g., +// duplicate registration). +func (m Meter) NewInt64ValueRecorder(name string, opts ...InstrumentOption) (Int64ValueRecorder, error) { + return wrapInt64ValueRecorderInstrument( + m.newSync(name, ValueRecorderInstrumentKind, number.Int64Kind, opts)) +} + +// NewFloat64ValueRecorder creates a new floating point ValueRecorder with the +// given name, customized with options. May return an error if the +// name is invalid (e.g., empty) or improperly registered (e.g., +// duplicate registration). +func (m Meter) NewFloat64ValueRecorder(name string, opts ...InstrumentOption) (Float64ValueRecorder, error) { + return wrapFloat64ValueRecorderInstrument( + m.newSync(name, ValueRecorderInstrumentKind, number.Float64Kind, opts)) +} + +// NewInt64ValueObserver creates a new integer ValueObserver instrument +// with the given name, running a given callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (m Meter) NewInt64ValueObserver(name string, callback Int64ObserverFunc, opts ...InstrumentOption) (Int64ValueObserver, error) { + if callback == nil { + return wrapInt64ValueObserverInstrument(NoopAsync{}, nil) + } + return wrapInt64ValueObserverInstrument( + m.newAsync(name, ValueObserverInstrumentKind, number.Int64Kind, opts, + newInt64AsyncRunner(callback))) +} + +// NewFloat64ValueObserver creates a new floating point ValueObserver with +// the given name, running a given callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (m Meter) NewFloat64ValueObserver(name string, callback Float64ObserverFunc, opts ...InstrumentOption) (Float64ValueObserver, error) { + if callback == nil { + return wrapFloat64ValueObserverInstrument(NoopAsync{}, nil) + } + return wrapFloat64ValueObserverInstrument( + m.newAsync(name, ValueObserverInstrumentKind, number.Float64Kind, opts, + newFloat64AsyncRunner(callback))) +} + +// NewInt64SumObserver creates a new integer SumObserver instrument +// with the given name, running a given callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (m Meter) NewInt64SumObserver(name string, callback Int64ObserverFunc, opts ...InstrumentOption) (Int64SumObserver, error) { + if callback == nil { + return wrapInt64SumObserverInstrument(NoopAsync{}, nil) + } + return wrapInt64SumObserverInstrument( + m.newAsync(name, SumObserverInstrumentKind, number.Int64Kind, opts, + newInt64AsyncRunner(callback))) +} + +// NewFloat64SumObserver creates a new floating point SumObserver with +// the given name, running a given callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (m Meter) NewFloat64SumObserver(name string, callback Float64ObserverFunc, opts ...InstrumentOption) (Float64SumObserver, error) { + if callback == nil { + return wrapFloat64SumObserverInstrument(NoopAsync{}, nil) + } + return wrapFloat64SumObserverInstrument( + m.newAsync(name, SumObserverInstrumentKind, number.Float64Kind, opts, + newFloat64AsyncRunner(callback))) +} + +// NewInt64UpDownSumObserver creates a new integer UpDownSumObserver instrument +// with the given name, running a given callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (m Meter) NewInt64UpDownSumObserver(name string, callback Int64ObserverFunc, opts ...InstrumentOption) (Int64UpDownSumObserver, error) { + if callback == nil { + return wrapInt64UpDownSumObserverInstrument(NoopAsync{}, nil) + } + return wrapInt64UpDownSumObserverInstrument( + m.newAsync(name, UpDownSumObserverInstrumentKind, number.Int64Kind, opts, + newInt64AsyncRunner(callback))) +} + +// NewFloat64UpDownSumObserver creates a new floating point UpDownSumObserver with +// the given name, running a given callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (m Meter) NewFloat64UpDownSumObserver(name string, callback Float64ObserverFunc, opts ...InstrumentOption) (Float64UpDownSumObserver, error) { + if callback == nil { + return wrapFloat64UpDownSumObserverInstrument(NoopAsync{}, nil) + } + return wrapFloat64UpDownSumObserverInstrument( + m.newAsync(name, UpDownSumObserverInstrumentKind, number.Float64Kind, opts, + newFloat64AsyncRunner(callback))) +} + +// NewInt64ValueObserver creates a new integer ValueObserver instrument +// with the given name, running in a batch callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (b BatchObserver) NewInt64ValueObserver(name string, opts ...InstrumentOption) (Int64ValueObserver, error) { + if b.runner == nil { + return wrapInt64ValueObserverInstrument(NoopAsync{}, nil) + } + return wrapInt64ValueObserverInstrument( + b.meter.newAsync(name, ValueObserverInstrumentKind, number.Int64Kind, opts, b.runner)) +} + +// NewFloat64ValueObserver creates a new floating point ValueObserver with +// the given name, running in a batch callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (b BatchObserver) NewFloat64ValueObserver(name string, opts ...InstrumentOption) (Float64ValueObserver, error) { + if b.runner == nil { + return wrapFloat64ValueObserverInstrument(NoopAsync{}, nil) + } + return wrapFloat64ValueObserverInstrument( + b.meter.newAsync(name, ValueObserverInstrumentKind, number.Float64Kind, opts, + b.runner)) +} + +// NewInt64SumObserver creates a new integer SumObserver instrument +// with the given name, running in a batch callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (b BatchObserver) NewInt64SumObserver(name string, opts ...InstrumentOption) (Int64SumObserver, error) { + if b.runner == nil { + return wrapInt64SumObserverInstrument(NoopAsync{}, nil) + } + return wrapInt64SumObserverInstrument( + b.meter.newAsync(name, SumObserverInstrumentKind, number.Int64Kind, opts, b.runner)) +} + +// NewFloat64SumObserver creates a new floating point SumObserver with +// the given name, running in a batch callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (b BatchObserver) NewFloat64SumObserver(name string, opts ...InstrumentOption) (Float64SumObserver, error) { + if b.runner == nil { + return wrapFloat64SumObserverInstrument(NoopAsync{}, nil) + } + return wrapFloat64SumObserverInstrument( + b.meter.newAsync(name, SumObserverInstrumentKind, number.Float64Kind, opts, + b.runner)) +} + +// NewInt64UpDownSumObserver creates a new integer UpDownSumObserver instrument +// with the given name, running in a batch callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (b BatchObserver) NewInt64UpDownSumObserver(name string, opts ...InstrumentOption) (Int64UpDownSumObserver, error) { + if b.runner == nil { + return wrapInt64UpDownSumObserverInstrument(NoopAsync{}, nil) + } + return wrapInt64UpDownSumObserverInstrument( + b.meter.newAsync(name, UpDownSumObserverInstrumentKind, number.Int64Kind, opts, b.runner)) +} + +// NewFloat64UpDownSumObserver creates a new floating point UpDownSumObserver with +// the given name, running in a batch callback, and customized with +// options. May return an error if the name is invalid (e.g., empty) +// or improperly registered (e.g., duplicate registration). +func (b BatchObserver) NewFloat64UpDownSumObserver(name string, opts ...InstrumentOption) (Float64UpDownSumObserver, error) { + if b.runner == nil { + return wrapFloat64UpDownSumObserverInstrument(NoopAsync{}, nil) + } + return wrapFloat64UpDownSumObserverInstrument( + b.meter.newAsync(name, UpDownSumObserverInstrumentKind, number.Float64Kind, opts, + b.runner)) +} + +// MeterImpl returns the underlying MeterImpl of this Meter. +func (m Meter) MeterImpl() MeterImpl { + return m.impl +} + +// newAsync constructs one new asynchronous instrument. +func (m Meter) newAsync( + name string, + mkind InstrumentKind, + nkind number.Kind, + opts []InstrumentOption, + runner AsyncRunner, +) ( + AsyncImpl, + error, +) { + if m.impl == nil { + return NoopAsync{}, nil + } + desc := NewDescriptor(name, mkind, nkind, opts...) + desc.config.InstrumentationName = m.name + desc.config.InstrumentationVersion = m.version + return m.impl.NewAsyncInstrument(desc, runner) +} + +// newSync constructs one new synchronous instrument. +func (m Meter) newSync( + name string, + metricKind InstrumentKind, + numberKind number.Kind, + opts []InstrumentOption, +) ( + SyncImpl, + error, +) { + if m.impl == nil { + return NoopSync{}, nil + } + desc := NewDescriptor(name, metricKind, numberKind, opts...) + desc.config.InstrumentationName = m.name + desc.config.InstrumentationVersion = m.version + return m.impl.NewSyncInstrument(desc) +} + +// MeterMust is a wrapper for Meter interfaces that panics when any +// instrument constructor encounters an error. +type MeterMust struct { + meter Meter +} + +// BatchObserverMust is a wrapper for BatchObserver that panics when +// any instrument constructor encounters an error. +type BatchObserverMust struct { + batch BatchObserver +} + +// Must constructs a MeterMust implementation from a Meter, allowing +// the application to panic when any instrument constructor yields an +// error. +func Must(meter Meter) MeterMust { + return MeterMust{meter: meter} +} + +// NewInt64Counter calls `Meter.NewInt64Counter` and returns the +// instrument, panicking if it encounters an error. +func (mm MeterMust) NewInt64Counter(name string, cos ...InstrumentOption) Int64Counter { + if inst, err := mm.meter.NewInt64Counter(name, cos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewFloat64Counter calls `Meter.NewFloat64Counter` and returns the +// instrument, panicking if it encounters an error. +func (mm MeterMust) NewFloat64Counter(name string, cos ...InstrumentOption) Float64Counter { + if inst, err := mm.meter.NewFloat64Counter(name, cos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewInt64UpDownCounter calls `Meter.NewInt64UpDownCounter` and returns the +// instrument, panicking if it encounters an error. +func (mm MeterMust) NewInt64UpDownCounter(name string, cos ...InstrumentOption) Int64UpDownCounter { + if inst, err := mm.meter.NewInt64UpDownCounter(name, cos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewFloat64UpDownCounter calls `Meter.NewFloat64UpDownCounter` and returns the +// instrument, panicking if it encounters an error. +func (mm MeterMust) NewFloat64UpDownCounter(name string, cos ...InstrumentOption) Float64UpDownCounter { + if inst, err := mm.meter.NewFloat64UpDownCounter(name, cos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewInt64ValueRecorder calls `Meter.NewInt64ValueRecorder` and returns the +// instrument, panicking if it encounters an error. +func (mm MeterMust) NewInt64ValueRecorder(name string, mos ...InstrumentOption) Int64ValueRecorder { + if inst, err := mm.meter.NewInt64ValueRecorder(name, mos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewFloat64ValueRecorder calls `Meter.NewFloat64ValueRecorder` and returns the +// instrument, panicking if it encounters an error. +func (mm MeterMust) NewFloat64ValueRecorder(name string, mos ...InstrumentOption) Float64ValueRecorder { + if inst, err := mm.meter.NewFloat64ValueRecorder(name, mos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewInt64ValueObserver calls `Meter.NewInt64ValueObserver` and +// returns the instrument, panicking if it encounters an error. +func (mm MeterMust) NewInt64ValueObserver(name string, callback Int64ObserverFunc, oos ...InstrumentOption) Int64ValueObserver { + if inst, err := mm.meter.NewInt64ValueObserver(name, callback, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewFloat64ValueObserver calls `Meter.NewFloat64ValueObserver` and +// returns the instrument, panicking if it encounters an error. +func (mm MeterMust) NewFloat64ValueObserver(name string, callback Float64ObserverFunc, oos ...InstrumentOption) Float64ValueObserver { + if inst, err := mm.meter.NewFloat64ValueObserver(name, callback, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewInt64SumObserver calls `Meter.NewInt64SumObserver` and +// returns the instrument, panicking if it encounters an error. +func (mm MeterMust) NewInt64SumObserver(name string, callback Int64ObserverFunc, oos ...InstrumentOption) Int64SumObserver { + if inst, err := mm.meter.NewInt64SumObserver(name, callback, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewFloat64SumObserver calls `Meter.NewFloat64SumObserver` and +// returns the instrument, panicking if it encounters an error. +func (mm MeterMust) NewFloat64SumObserver(name string, callback Float64ObserverFunc, oos ...InstrumentOption) Float64SumObserver { + if inst, err := mm.meter.NewFloat64SumObserver(name, callback, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewInt64UpDownSumObserver calls `Meter.NewInt64UpDownSumObserver` and +// returns the instrument, panicking if it encounters an error. +func (mm MeterMust) NewInt64UpDownSumObserver(name string, callback Int64ObserverFunc, oos ...InstrumentOption) Int64UpDownSumObserver { + if inst, err := mm.meter.NewInt64UpDownSumObserver(name, callback, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewFloat64UpDownSumObserver calls `Meter.NewFloat64UpDownSumObserver` and +// returns the instrument, panicking if it encounters an error. +func (mm MeterMust) NewFloat64UpDownSumObserver(name string, callback Float64ObserverFunc, oos ...InstrumentOption) Float64UpDownSumObserver { + if inst, err := mm.meter.NewFloat64UpDownSumObserver(name, callback, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewBatchObserver returns a wrapper around BatchObserver that panics +// when any instrument constructor returns an error. +func (mm MeterMust) NewBatchObserver(callback BatchObserverFunc) BatchObserverMust { + return BatchObserverMust{ + batch: mm.meter.NewBatchObserver(callback), + } +} + +// NewInt64ValueObserver calls `BatchObserver.NewInt64ValueObserver` and +// returns the instrument, panicking if it encounters an error. +func (bm BatchObserverMust) NewInt64ValueObserver(name string, oos ...InstrumentOption) Int64ValueObserver { + if inst, err := bm.batch.NewInt64ValueObserver(name, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewFloat64ValueObserver calls `BatchObserver.NewFloat64ValueObserver` and +// returns the instrument, panicking if it encounters an error. +func (bm BatchObserverMust) NewFloat64ValueObserver(name string, oos ...InstrumentOption) Float64ValueObserver { + if inst, err := bm.batch.NewFloat64ValueObserver(name, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewInt64SumObserver calls `BatchObserver.NewInt64SumObserver` and +// returns the instrument, panicking if it encounters an error. +func (bm BatchObserverMust) NewInt64SumObserver(name string, oos ...InstrumentOption) Int64SumObserver { + if inst, err := bm.batch.NewInt64SumObserver(name, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewFloat64SumObserver calls `BatchObserver.NewFloat64SumObserver` and +// returns the instrument, panicking if it encounters an error. +func (bm BatchObserverMust) NewFloat64SumObserver(name string, oos ...InstrumentOption) Float64SumObserver { + if inst, err := bm.batch.NewFloat64SumObserver(name, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewInt64UpDownSumObserver calls `BatchObserver.NewInt64UpDownSumObserver` and +// returns the instrument, panicking if it encounters an error. +func (bm BatchObserverMust) NewInt64UpDownSumObserver(name string, oos ...InstrumentOption) Int64UpDownSumObserver { + if inst, err := bm.batch.NewInt64UpDownSumObserver(name, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// NewFloat64UpDownSumObserver calls `BatchObserver.NewFloat64UpDownSumObserver` and +// returns the instrument, panicking if it encounters an error. +func (bm BatchObserverMust) NewFloat64UpDownSumObserver(name string, oos ...InstrumentOption) Float64UpDownSumObserver { + if inst, err := bm.batch.NewFloat64UpDownSumObserver(name, oos...); err != nil { + panic(err) + } else { + return inst + } +} + +// Descriptor contains all the settings that describe an instrument, +// including its name, metric kind, number kind, and the configurable +// options. +type Descriptor struct { + name string + instrumentKind InstrumentKind + numberKind number.Kind + config InstrumentConfig +} + +// NewDescriptor returns a Descriptor with the given contents. +func NewDescriptor(name string, ikind InstrumentKind, nkind number.Kind, opts ...InstrumentOption) Descriptor { + return Descriptor{ + name: name, + instrumentKind: ikind, + numberKind: nkind, + config: NewInstrumentConfig(opts...), + } +} + +// Name returns the metric instrument's name. +func (d Descriptor) Name() string { + return d.name +} + +// InstrumentKind returns the specific kind of instrument. +func (d Descriptor) InstrumentKind() InstrumentKind { + return d.instrumentKind +} + +// Description provides a human-readable description of the metric +// instrument. +func (d Descriptor) Description() string { + return d.config.Description +} + +// Unit describes the units of the metric instrument. Unitless +// metrics return the empty string. +func (d Descriptor) Unit() unit.Unit { + return d.config.Unit +} + +// NumberKind returns whether this instrument is declared over int64, +// float64, or uint64 values. +func (d Descriptor) NumberKind() number.Kind { + return d.numberKind +} + +// InstrumentationName returns the name of the library that provided +// instrumentation for this instrument. +func (d Descriptor) InstrumentationName() string { + return d.config.InstrumentationName +} + +// InstrumentationVersion returns the version of the library that provided +// instrumentation for this instrument. +func (d Descriptor) InstrumentationVersion() string { + return d.config.InstrumentationVersion +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_instrument.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_instrument.go new file mode 100644 index 000000000000..6f3fc997cb9f --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_instrument.go @@ -0,0 +1,777 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:generate stringer -type=InstrumentKind + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + "errors" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric/number" +) + +// ErrSDKReturnedNilImpl is returned when a new `MeterImpl` returns nil. +var ErrSDKReturnedNilImpl = errors.New("SDK returned a nil implementation") + +// InstrumentKind describes the kind of instrument. +type InstrumentKind int8 + +const ( + // ValueRecorderInstrumentKind indicates a ValueRecorder instrument. + ValueRecorderInstrumentKind InstrumentKind = iota + // ValueObserverInstrumentKind indicates an ValueObserver instrument. + ValueObserverInstrumentKind + + // CounterInstrumentKind indicates a Counter instrument. + CounterInstrumentKind + // UpDownCounterInstrumentKind indicates a UpDownCounter instrument. + UpDownCounterInstrumentKind + + // SumObserverInstrumentKind indicates a SumObserver instrument. + SumObserverInstrumentKind + // UpDownSumObserverInstrumentKind indicates a UpDownSumObserver + // instrument. + UpDownSumObserverInstrumentKind +) + +// Synchronous returns whether this is a synchronous kind of instrument. +func (k InstrumentKind) Synchronous() bool { + switch k { + case CounterInstrumentKind, UpDownCounterInstrumentKind, ValueRecorderInstrumentKind: + return true + } + return false +} + +// Asynchronous returns whether this is an asynchronous kind of instrument. +func (k InstrumentKind) Asynchronous() bool { + return !k.Synchronous() +} + +// Adding returns whether this kind of instrument adds its inputs (as opposed to Grouping). +func (k InstrumentKind) Adding() bool { + switch k { + case CounterInstrumentKind, UpDownCounterInstrumentKind, SumObserverInstrumentKind, UpDownSumObserverInstrumentKind: + return true + } + return false +} + +// Grouping returns whether this kind of instrument groups its inputs (as opposed to Adding). +func (k InstrumentKind) Grouping() bool { + return !k.Adding() +} + +// Monotonic returns whether this kind of instrument exposes a non-decreasing sum. +func (k InstrumentKind) Monotonic() bool { + switch k { + case CounterInstrumentKind, SumObserverInstrumentKind: + return true + } + return false +} + +// PrecomputedSum returns whether this kind of instrument receives precomputed sums. +func (k InstrumentKind) PrecomputedSum() bool { + return k.Adding() && k.Asynchronous() +} + +// Observation is used for reporting an asynchronous batch of metric +// values. Instances of this type should be created by asynchronous +// instruments (e.g., Int64ValueObserver.Observation()). +type Observation struct { + // number needs to be aligned for 64-bit atomic operations. + number number.Number + instrument AsyncImpl +} + +// Int64ObserverFunc is a type of callback that integral +// observers run. +type Int64ObserverFunc func(context.Context, Int64ObserverResult) + +// Float64ObserverFunc is a type of callback that floating point +// observers run. +type Float64ObserverFunc func(context.Context, Float64ObserverResult) + +// BatchObserverFunc is a callback argument for use with any +// Observer instrument that will be reported as a batch of +// observations. +type BatchObserverFunc func(context.Context, BatchObserverResult) + +// Int64ObserverResult is passed to an observer callback to capture +// observations for one asynchronous integer metric instrument. +type Int64ObserverResult struct { + instrument AsyncImpl + function func([]attribute.KeyValue, ...Observation) +} + +// Float64ObserverResult is passed to an observer callback to capture +// observations for one asynchronous floating point metric instrument. +type Float64ObserverResult struct { + instrument AsyncImpl + function func([]attribute.KeyValue, ...Observation) +} + +// BatchObserverResult is passed to a batch observer callback to +// capture observations for multiple asynchronous instruments. +type BatchObserverResult struct { + function func([]attribute.KeyValue, ...Observation) +} + +// Observe captures a single integer value from the associated +// instrument callback, with the given labels. +func (ir Int64ObserverResult) Observe(value int64, labels ...attribute.KeyValue) { + ir.function(labels, Observation{ + instrument: ir.instrument, + number: number.NewInt64Number(value), + }) +} + +// Observe captures a single floating point value from the associated +// instrument callback, with the given labels. +func (fr Float64ObserverResult) Observe(value float64, labels ...attribute.KeyValue) { + fr.function(labels, Observation{ + instrument: fr.instrument, + number: number.NewFloat64Number(value), + }) +} + +// Observe captures a multiple observations from the associated batch +// instrument callback, with the given labels. +func (br BatchObserverResult) Observe(labels []attribute.KeyValue, obs ...Observation) { + br.function(labels, obs...) +} + +// AsyncRunner is expected to convert into an AsyncSingleRunner or an +// AsyncBatchRunner. SDKs will encounter an error if the AsyncRunner +// does not satisfy one of these interfaces. +type AsyncRunner interface { + // AnyRunner() is a non-exported method with no functional use + // other than to make this a non-empty interface. + AnyRunner() +} + +// AsyncSingleRunner is an interface implemented by single-observer +// callbacks. +type AsyncSingleRunner interface { + // Run accepts a single instrument and function for capturing + // observations of that instrument. Each call to the function + // receives one captured observation. (The function accepts + // multiple observations so the same implementation can be + // used for batch runners.) + Run(ctx context.Context, single AsyncImpl, capture func([]attribute.KeyValue, ...Observation)) + + AsyncRunner +} + +// AsyncBatchRunner is an interface implemented by batch-observer +// callbacks. +type AsyncBatchRunner interface { + // Run accepts a function for capturing observations of + // multiple instruments. + Run(ctx context.Context, capture func([]attribute.KeyValue, ...Observation)) + + AsyncRunner +} + +var _ AsyncSingleRunner = (*Int64ObserverFunc)(nil) +var _ AsyncSingleRunner = (*Float64ObserverFunc)(nil) +var _ AsyncBatchRunner = (*BatchObserverFunc)(nil) + +// newInt64AsyncRunner returns a single-observer callback for integer Observer instruments. +func newInt64AsyncRunner(c Int64ObserverFunc) AsyncSingleRunner { + return &c +} + +// newFloat64AsyncRunner returns a single-observer callback for floating point Observer instruments. +func newFloat64AsyncRunner(c Float64ObserverFunc) AsyncSingleRunner { + return &c +} + +// newBatchAsyncRunner returns a batch-observer callback use with multiple Observer instruments. +func newBatchAsyncRunner(c BatchObserverFunc) AsyncBatchRunner { + return &c +} + +// AnyRunner implements AsyncRunner. +func (*Int64ObserverFunc) AnyRunner() {} + +// AnyRunner implements AsyncRunner. +func (*Float64ObserverFunc) AnyRunner() {} + +// AnyRunner implements AsyncRunner. +func (*BatchObserverFunc) AnyRunner() {} + +// Run implements AsyncSingleRunner. +func (i *Int64ObserverFunc) Run(ctx context.Context, impl AsyncImpl, function func([]attribute.KeyValue, ...Observation)) { + (*i)(ctx, Int64ObserverResult{ + instrument: impl, + function: function, + }) +} + +// Run implements AsyncSingleRunner. +func (f *Float64ObserverFunc) Run(ctx context.Context, impl AsyncImpl, function func([]attribute.KeyValue, ...Observation)) { + (*f)(ctx, Float64ObserverResult{ + instrument: impl, + function: function, + }) +} + +// Run implements AsyncBatchRunner. +func (b *BatchObserverFunc) Run(ctx context.Context, function func([]attribute.KeyValue, ...Observation)) { + (*b)(ctx, BatchObserverResult{ + function: function, + }) +} + +// wrapInt64ValueObserverInstrument converts an AsyncImpl into Int64ValueObserver. +func wrapInt64ValueObserverInstrument(asyncInst AsyncImpl, err error) (Int64ValueObserver, error) { + common, err := checkNewAsync(asyncInst, err) + return Int64ValueObserver{asyncInstrument: common}, err +} + +// wrapFloat64ValueObserverInstrument converts an AsyncImpl into Float64ValueObserver. +func wrapFloat64ValueObserverInstrument(asyncInst AsyncImpl, err error) (Float64ValueObserver, error) { + common, err := checkNewAsync(asyncInst, err) + return Float64ValueObserver{asyncInstrument: common}, err +} + +// wrapInt64SumObserverInstrument converts an AsyncImpl into Int64SumObserver. +func wrapInt64SumObserverInstrument(asyncInst AsyncImpl, err error) (Int64SumObserver, error) { + common, err := checkNewAsync(asyncInst, err) + return Int64SumObserver{asyncInstrument: common}, err +} + +// wrapFloat64SumObserverInstrument converts an AsyncImpl into Float64SumObserver. +func wrapFloat64SumObserverInstrument(asyncInst AsyncImpl, err error) (Float64SumObserver, error) { + common, err := checkNewAsync(asyncInst, err) + return Float64SumObserver{asyncInstrument: common}, err +} + +// wrapInt64UpDownSumObserverInstrument converts an AsyncImpl into Int64UpDownSumObserver. +func wrapInt64UpDownSumObserverInstrument(asyncInst AsyncImpl, err error) (Int64UpDownSumObserver, error) { + common, err := checkNewAsync(asyncInst, err) + return Int64UpDownSumObserver{asyncInstrument: common}, err +} + +// wrapFloat64UpDownSumObserverInstrument converts an AsyncImpl into Float64UpDownSumObserver. +func wrapFloat64UpDownSumObserverInstrument(asyncInst AsyncImpl, err error) (Float64UpDownSumObserver, error) { + common, err := checkNewAsync(asyncInst, err) + return Float64UpDownSumObserver{asyncInstrument: common}, err +} + +// BatchObserver represents an Observer callback that can report +// observations for multiple instruments. +type BatchObserver struct { + meter Meter + runner AsyncBatchRunner +} + +// Int64ValueObserver is a metric that captures a set of int64 values at a +// point in time. +type Int64ValueObserver struct { + asyncInstrument +} + +// Float64ValueObserver is a metric that captures a set of float64 values +// at a point in time. +type Float64ValueObserver struct { + asyncInstrument +} + +// Int64SumObserver is a metric that captures a precomputed sum of +// int64 values at a point in time. +type Int64SumObserver struct { + asyncInstrument +} + +// Float64SumObserver is a metric that captures a precomputed sum of +// float64 values at a point in time. +type Float64SumObserver struct { + asyncInstrument +} + +// Int64UpDownSumObserver is a metric that captures a precomputed sum of +// int64 values at a point in time. +type Int64UpDownSumObserver struct { + asyncInstrument +} + +// Float64UpDownSumObserver is a metric that captures a precomputed sum of +// float64 values at a point in time. +type Float64UpDownSumObserver struct { + asyncInstrument +} + +// Observation returns an Observation, a BatchObserverFunc +// argument, for an asynchronous integer instrument. +// This returns an implementation-level object for use by the SDK, +// users should not refer to this. +func (i Int64ValueObserver) Observation(v int64) Observation { + return Observation{ + number: number.NewInt64Number(v), + instrument: i.instrument, + } +} + +// Observation returns an Observation, a BatchObserverFunc +// argument, for an asynchronous integer instrument. +// This returns an implementation-level object for use by the SDK, +// users should not refer to this. +func (f Float64ValueObserver) Observation(v float64) Observation { + return Observation{ + number: number.NewFloat64Number(v), + instrument: f.instrument, + } +} + +// Observation returns an Observation, a BatchObserverFunc +// argument, for an asynchronous integer instrument. +// This returns an implementation-level object for use by the SDK, +// users should not refer to this. +func (i Int64SumObserver) Observation(v int64) Observation { + return Observation{ + number: number.NewInt64Number(v), + instrument: i.instrument, + } +} + +// Observation returns an Observation, a BatchObserverFunc +// argument, for an asynchronous integer instrument. +// This returns an implementation-level object for use by the SDK, +// users should not refer to this. +func (f Float64SumObserver) Observation(v float64) Observation { + return Observation{ + number: number.NewFloat64Number(v), + instrument: f.instrument, + } +} + +// Observation returns an Observation, a BatchObserverFunc +// argument, for an asynchronous integer instrument. +// This returns an implementation-level object for use by the SDK, +// users should not refer to this. +func (i Int64UpDownSumObserver) Observation(v int64) Observation { + return Observation{ + number: number.NewInt64Number(v), + instrument: i.instrument, + } +} + +// Observation returns an Observation, a BatchObserverFunc +// argument, for an asynchronous integer instrument. +// This returns an implementation-level object for use by the SDK, +// users should not refer to this. +func (f Float64UpDownSumObserver) Observation(v float64) Observation { + return Observation{ + number: number.NewFloat64Number(v), + instrument: f.instrument, + } +} + +// Measurement is used for reporting a synchronous batch of metric +// values. Instances of this type should be created by synchronous +// instruments (e.g., Int64Counter.Measurement()). +type Measurement struct { + // number needs to be aligned for 64-bit atomic operations. + number number.Number + instrument SyncImpl +} + +// syncInstrument contains a SyncImpl. +type syncInstrument struct { + instrument SyncImpl +} + +// syncBoundInstrument contains a BoundSyncImpl. +type syncBoundInstrument struct { + boundInstrument BoundSyncImpl +} + +// asyncInstrument contains a AsyncImpl. +type asyncInstrument struct { + instrument AsyncImpl +} + +// SyncImpl returns the instrument that created this measurement. +// This returns an implementation-level object for use by the SDK, +// users should not refer to this. +func (m Measurement) SyncImpl() SyncImpl { + return m.instrument +} + +// Number returns a number recorded in this measurement. +func (m Measurement) Number() number.Number { + return m.number +} + +// AsyncImpl returns the instrument that created this observation. +// This returns an implementation-level object for use by the SDK, +// users should not refer to this. +func (m Observation) AsyncImpl() AsyncImpl { + return m.instrument +} + +// Number returns a number recorded in this observation. +func (m Observation) Number() number.Number { + return m.number +} + +// AsyncImpl implements AsyncImpl. +func (a asyncInstrument) AsyncImpl() AsyncImpl { + return a.instrument +} + +// SyncImpl returns the implementation object for synchronous instruments. +func (s syncInstrument) SyncImpl() SyncImpl { + return s.instrument +} + +func (s syncInstrument) bind(labels []attribute.KeyValue) syncBoundInstrument { + return newSyncBoundInstrument(s.instrument.Bind(labels)) +} + +func (s syncInstrument) float64Measurement(value float64) Measurement { + return newMeasurement(s.instrument, number.NewFloat64Number(value)) +} + +func (s syncInstrument) int64Measurement(value int64) Measurement { + return newMeasurement(s.instrument, number.NewInt64Number(value)) +} + +func (s syncInstrument) directRecord(ctx context.Context, number number.Number, labels []attribute.KeyValue) { + s.instrument.RecordOne(ctx, number, labels) +} + +func (h syncBoundInstrument) directRecord(ctx context.Context, number number.Number) { + h.boundInstrument.RecordOne(ctx, number) +} + +// Unbind calls SyncImpl.Unbind. +func (h syncBoundInstrument) Unbind() { + h.boundInstrument.Unbind() +} + +// checkNewAsync receives an AsyncImpl and potential +// error, and returns the same types, checking for and ensuring that +// the returned interface is not nil. +func checkNewAsync(instrument AsyncImpl, err error) (asyncInstrument, error) { + if instrument == nil { + if err == nil { + err = ErrSDKReturnedNilImpl + } + instrument = NoopAsync{} + } + return asyncInstrument{ + instrument: instrument, + }, err +} + +// checkNewSync receives an SyncImpl and potential +// error, and returns the same types, checking for and ensuring that +// the returned interface is not nil. +func checkNewSync(instrument SyncImpl, err error) (syncInstrument, error) { + if instrument == nil { + if err == nil { + err = ErrSDKReturnedNilImpl + } + // Note: an alternate behavior would be to synthesize a new name + // or group all duplicately-named instruments of a certain type + // together and use a tag for the original name, e.g., + // name = 'invalid.counter.int64' + // label = 'original-name=duplicate-counter-name' + instrument = NoopSync{} + } + return syncInstrument{ + instrument: instrument, + }, err +} + +func newSyncBoundInstrument(boundInstrument BoundSyncImpl) syncBoundInstrument { + return syncBoundInstrument{ + boundInstrument: boundInstrument, + } +} + +func newMeasurement(instrument SyncImpl, number number.Number) Measurement { + return Measurement{ + instrument: instrument, + number: number, + } +} + +// wrapInt64CounterInstrument converts a SyncImpl into Int64Counter. +func wrapInt64CounterInstrument(syncInst SyncImpl, err error) (Int64Counter, error) { + common, err := checkNewSync(syncInst, err) + return Int64Counter{syncInstrument: common}, err +} + +// wrapFloat64CounterInstrument converts a SyncImpl into Float64Counter. +func wrapFloat64CounterInstrument(syncInst SyncImpl, err error) (Float64Counter, error) { + common, err := checkNewSync(syncInst, err) + return Float64Counter{syncInstrument: common}, err +} + +// wrapInt64UpDownCounterInstrument converts a SyncImpl into Int64UpDownCounter. +func wrapInt64UpDownCounterInstrument(syncInst SyncImpl, err error) (Int64UpDownCounter, error) { + common, err := checkNewSync(syncInst, err) + return Int64UpDownCounter{syncInstrument: common}, err +} + +// wrapFloat64UpDownCounterInstrument converts a SyncImpl into Float64UpDownCounter. +func wrapFloat64UpDownCounterInstrument(syncInst SyncImpl, err error) (Float64UpDownCounter, error) { + common, err := checkNewSync(syncInst, err) + return Float64UpDownCounter{syncInstrument: common}, err +} + +// wrapInt64ValueRecorderInstrument converts a SyncImpl into Int64ValueRecorder. +func wrapInt64ValueRecorderInstrument(syncInst SyncImpl, err error) (Int64ValueRecorder, error) { + common, err := checkNewSync(syncInst, err) + return Int64ValueRecorder{syncInstrument: common}, err +} + +// wrapFloat64ValueRecorderInstrument converts a SyncImpl into Float64ValueRecorder. +func wrapFloat64ValueRecorderInstrument(syncInst SyncImpl, err error) (Float64ValueRecorder, error) { + common, err := checkNewSync(syncInst, err) + return Float64ValueRecorder{syncInstrument: common}, err +} + +// Float64Counter is a metric that accumulates float64 values. +type Float64Counter struct { + syncInstrument +} + +// Int64Counter is a metric that accumulates int64 values. +type Int64Counter struct { + syncInstrument +} + +// BoundFloat64Counter is a bound instrument for Float64Counter. +// +// It inherits the Unbind function from syncBoundInstrument. +type BoundFloat64Counter struct { + syncBoundInstrument +} + +// BoundInt64Counter is a boundInstrument for Int64Counter. +// +// It inherits the Unbind function from syncBoundInstrument. +type BoundInt64Counter struct { + syncBoundInstrument +} + +// Bind creates a bound instrument for this counter. The labels are +// associated with values recorded via subsequent calls to Record. +func (c Float64Counter) Bind(labels ...attribute.KeyValue) (h BoundFloat64Counter) { + h.syncBoundInstrument = c.bind(labels) + return +} + +// Bind creates a bound instrument for this counter. The labels are +// associated with values recorded via subsequent calls to Record. +func (c Int64Counter) Bind(labels ...attribute.KeyValue) (h BoundInt64Counter) { + h.syncBoundInstrument = c.bind(labels) + return +} + +// Measurement creates a Measurement object to use with batch +// recording. +func (c Float64Counter) Measurement(value float64) Measurement { + return c.float64Measurement(value) +} + +// Measurement creates a Measurement object to use with batch +// recording. +func (c Int64Counter) Measurement(value int64) Measurement { + return c.int64Measurement(value) +} + +// Add adds the value to the counter's sum. The labels should contain +// the keys and values to be associated with this value. +func (c Float64Counter) Add(ctx context.Context, value float64, labels ...attribute.KeyValue) { + c.directRecord(ctx, number.NewFloat64Number(value), labels) +} + +// Add adds the value to the counter's sum. The labels should contain +// the keys and values to be associated with this value. +func (c Int64Counter) Add(ctx context.Context, value int64, labels ...attribute.KeyValue) { + c.directRecord(ctx, number.NewInt64Number(value), labels) +} + +// Add adds the value to the counter's sum using the labels +// previously bound to this counter via Bind() +func (b BoundFloat64Counter) Add(ctx context.Context, value float64) { + b.directRecord(ctx, number.NewFloat64Number(value)) +} + +// Add adds the value to the counter's sum using the labels +// previously bound to this counter via Bind() +func (b BoundInt64Counter) Add(ctx context.Context, value int64) { + b.directRecord(ctx, number.NewInt64Number(value)) +} + +// Float64UpDownCounter is a metric instrument that sums floating +// point values. +type Float64UpDownCounter struct { + syncInstrument +} + +// Int64UpDownCounter is a metric instrument that sums integer values. +type Int64UpDownCounter struct { + syncInstrument +} + +// BoundFloat64UpDownCounter is a bound instrument for Float64UpDownCounter. +// +// It inherits the Unbind function from syncBoundInstrument. +type BoundFloat64UpDownCounter struct { + syncBoundInstrument +} + +// BoundInt64UpDownCounter is a boundInstrument for Int64UpDownCounter. +// +// It inherits the Unbind function from syncBoundInstrument. +type BoundInt64UpDownCounter struct { + syncBoundInstrument +} + +// Bind creates a bound instrument for this counter. The labels are +// associated with values recorded via subsequent calls to Record. +func (c Float64UpDownCounter) Bind(labels ...attribute.KeyValue) (h BoundFloat64UpDownCounter) { + h.syncBoundInstrument = c.bind(labels) + return +} + +// Bind creates a bound instrument for this counter. The labels are +// associated with values recorded via subsequent calls to Record. +func (c Int64UpDownCounter) Bind(labels ...attribute.KeyValue) (h BoundInt64UpDownCounter) { + h.syncBoundInstrument = c.bind(labels) + return +} + +// Measurement creates a Measurement object to use with batch +// recording. +func (c Float64UpDownCounter) Measurement(value float64) Measurement { + return c.float64Measurement(value) +} + +// Measurement creates a Measurement object to use with batch +// recording. +func (c Int64UpDownCounter) Measurement(value int64) Measurement { + return c.int64Measurement(value) +} + +// Add adds the value to the counter's sum. The labels should contain +// the keys and values to be associated with this value. +func (c Float64UpDownCounter) Add(ctx context.Context, value float64, labels ...attribute.KeyValue) { + c.directRecord(ctx, number.NewFloat64Number(value), labels) +} + +// Add adds the value to the counter's sum. The labels should contain +// the keys and values to be associated with this value. +func (c Int64UpDownCounter) Add(ctx context.Context, value int64, labels ...attribute.KeyValue) { + c.directRecord(ctx, number.NewInt64Number(value), labels) +} + +// Add adds the value to the counter's sum using the labels +// previously bound to this counter via Bind() +func (b BoundFloat64UpDownCounter) Add(ctx context.Context, value float64) { + b.directRecord(ctx, number.NewFloat64Number(value)) +} + +// Add adds the value to the counter's sum using the labels +// previously bound to this counter via Bind() +func (b BoundInt64UpDownCounter) Add(ctx context.Context, value int64) { + b.directRecord(ctx, number.NewInt64Number(value)) +} + +// Float64ValueRecorder is a metric that records float64 values. +type Float64ValueRecorder struct { + syncInstrument +} + +// Int64ValueRecorder is a metric that records int64 values. +type Int64ValueRecorder struct { + syncInstrument +} + +// BoundFloat64ValueRecorder is a bound instrument for Float64ValueRecorder. +// +// It inherits the Unbind function from syncBoundInstrument. +type BoundFloat64ValueRecorder struct { + syncBoundInstrument +} + +// BoundInt64ValueRecorder is a bound instrument for Int64ValueRecorder. +// +// It inherits the Unbind function from syncBoundInstrument. +type BoundInt64ValueRecorder struct { + syncBoundInstrument +} + +// Bind creates a bound instrument for this ValueRecorder. The labels are +// associated with values recorded via subsequent calls to Record. +func (c Float64ValueRecorder) Bind(labels ...attribute.KeyValue) (h BoundFloat64ValueRecorder) { + h.syncBoundInstrument = c.bind(labels) + return +} + +// Bind creates a bound instrument for this ValueRecorder. The labels are +// associated with values recorded via subsequent calls to Record. +func (c Int64ValueRecorder) Bind(labels ...attribute.KeyValue) (h BoundInt64ValueRecorder) { + h.syncBoundInstrument = c.bind(labels) + return +} + +// Measurement creates a Measurement object to use with batch +// recording. +func (c Float64ValueRecorder) Measurement(value float64) Measurement { + return c.float64Measurement(value) +} + +// Measurement creates a Measurement object to use with batch +// recording. +func (c Int64ValueRecorder) Measurement(value int64) Measurement { + return c.int64Measurement(value) +} + +// Record adds a new value to the list of ValueRecorder's records. The +// labels should contain the keys and values to be associated with +// this value. +func (c Float64ValueRecorder) Record(ctx context.Context, value float64, labels ...attribute.KeyValue) { + c.directRecord(ctx, number.NewFloat64Number(value), labels) +} + +// Record adds a new value to the ValueRecorder's distribution. The +// labels should contain the keys and values to be associated with +// this value. +func (c Int64ValueRecorder) Record(ctx context.Context, value int64, labels ...attribute.KeyValue) { + c.directRecord(ctx, number.NewInt64Number(value), labels) +} + +// Record adds a new value to the ValueRecorder's distribution using the labels +// previously bound to the ValueRecorder via Bind(). +func (b BoundFloat64ValueRecorder) Record(ctx context.Context, value float64) { + b.directRecord(ctx, number.NewFloat64Number(value)) +} + +// Record adds a new value to the ValueRecorder's distribution using the labels +// previously bound to the ValueRecorder via Bind(). +func (b BoundInt64ValueRecorder) Record(ctx context.Context, value int64) { + b.directRecord(ctx, number.NewInt64Number(value)) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_noop.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_noop.go new file mode 100644 index 000000000000..30e57b6945bf --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_noop.go @@ -0,0 +1,59 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric/number" +) + +type NoopMeterProvider struct{} + +type noopInstrument struct{} +type noopBoundInstrument struct{} +type NoopSync struct{ noopInstrument } +type NoopAsync struct{ noopInstrument } + +var _ MeterProvider = NoopMeterProvider{} +var _ SyncImpl = NoopSync{} +var _ BoundSyncImpl = noopBoundInstrument{} +var _ AsyncImpl = NoopAsync{} + +func (NoopMeterProvider) Meter(_ string, _ ...MeterOption) Meter { + return Meter{} +} + +func (noopInstrument) Implementation() interface{} { + return nil +} + +func (noopInstrument) Descriptor() Descriptor { + return Descriptor{} +} + +func (noopBoundInstrument) RecordOne(context.Context, number.Number) { +} + +func (noopBoundInstrument) Unbind() { +} + +func (NoopSync) Bind([]attribute.KeyValue) BoundSyncImpl { + return noopBoundInstrument{} +} + +func (NoopSync) RecordOne(context.Context, number.Number, []attribute.KeyValue) { +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_sdkapi.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_sdkapi.go new file mode 100644 index 000000000000..94164f7b4858 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/metric_sdkapi.go @@ -0,0 +1,95 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric/number" +) + +// MeterImpl is the interface an SDK must implement to supply a Meter +// implementation. +type MeterImpl interface { + // RecordBatch atomically records a batch of measurements. + RecordBatch(ctx context.Context, labels []attribute.KeyValue, measurement ...Measurement) + + // NewSyncInstrument returns a newly constructed + // synchronous instrument implementation or an error, should + // one occur. + NewSyncInstrument(descriptor Descriptor) (SyncImpl, error) + + // NewAsyncInstrument returns a newly constructed + // asynchronous instrument implementation or an error, should + // one occur. + NewAsyncInstrument( + descriptor Descriptor, + runner AsyncRunner, + ) (AsyncImpl, error) +} + +// InstrumentImpl is a common interface for synchronous and +// asynchronous instruments. +type InstrumentImpl interface { + // Implementation returns the underlying implementation of the + // instrument, which allows the implementation to gain access + // to its own representation especially from a `Measurement`. + Implementation() interface{} + + // Descriptor returns a copy of the instrument's Descriptor. + Descriptor() Descriptor +} + +// SyncImpl is the implementation-level interface to a generic +// synchronous instrument (e.g., ValueRecorder and Counter instruments). +type SyncImpl interface { + InstrumentImpl + + // Bind creates an implementation-level bound instrument, + // binding a label set with this instrument implementation. + Bind(labels []attribute.KeyValue) BoundSyncImpl + + // RecordOne captures a single synchronous metric event. + RecordOne(ctx context.Context, number number.Number, labels []attribute.KeyValue) +} + +// BoundSyncImpl is the implementation-level interface to a +// generic bound synchronous instrument +type BoundSyncImpl interface { + + // RecordOne captures a single synchronous metric event. + RecordOne(ctx context.Context, number number.Number) + + // Unbind frees the resources associated with this bound instrument. It + // does not affect the metric this bound instrument was created through. + Unbind() +} + +// AsyncImpl is an implementation-level interface to an +// asynchronous instrument (e.g., Observer instruments). +type AsyncImpl interface { + InstrumentImpl +} + +// WrapMeterImpl constructs a `Meter` implementation from a +// `MeterImpl` implementation. +func WrapMeterImpl(impl MeterImpl, instrumentationName string, opts ...MeterOption) Meter { + return Meter{ + impl: impl, + name: instrumentationName, + version: NewMeterConfig(opts...).InstrumentationVersion, + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/doc.go new file mode 100644 index 000000000000..0649ff875e70 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/doc.go @@ -0,0 +1,23 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package number provides a number abstraction for instruments that +either support int64 or float64 input values. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track the +evolving OpenTelemetry specification and user feedback. +*/ +package number // import "go.opentelemetry.io/otel/metric/number" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/kind_string.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/kind_string.go new file mode 100644 index 000000000000..6288c7ea295f --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/kind_string.go @@ -0,0 +1,24 @@ +// Code generated by "stringer -type=Kind"; DO NOT EDIT. + +package number + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[Int64Kind-0] + _ = x[Float64Kind-1] +} + +const _Kind_name = "Int64KindFloat64Kind" + +var _Kind_index = [...]uint8{0, 9, 20} + +func (i Kind) String() string { + if i < 0 || i >= Kind(len(_Kind_index)-1) { + return "Kind(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Kind_name[_Kind_index[i]:_Kind_index[i+1]] +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/number.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/number.go new file mode 100644 index 000000000000..3ec95e2014d7 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/number/number.go @@ -0,0 +1,538 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package number // import "go.opentelemetry.io/otel/metric/number" + +//go:generate stringer -type=Kind + +import ( + "fmt" + "math" + "sync/atomic" + + "go.opentelemetry.io/otel/internal" +) + +// Kind describes the data type of the Number. +type Kind int8 + +const ( + // Int64Kind means that the Number stores int64. + Int64Kind Kind = iota + // Float64Kind means that the Number stores float64. + Float64Kind +) + +// Zero returns a zero value for a given Kind +func (k Kind) Zero() Number { + switch k { + case Int64Kind: + return NewInt64Number(0) + case Float64Kind: + return NewFloat64Number(0.) + default: + return Number(0) + } +} + +// Minimum returns the minimum representable value +// for a given Kind +func (k Kind) Minimum() Number { + switch k { + case Int64Kind: + return NewInt64Number(math.MinInt64) + case Float64Kind: + return NewFloat64Number(-1. * math.MaxFloat64) + default: + return Number(0) + } +} + +// Maximum returns the maximum representable value +// for a given Kind +func (k Kind) Maximum() Number { + switch k { + case Int64Kind: + return NewInt64Number(math.MaxInt64) + case Float64Kind: + return NewFloat64Number(math.MaxFloat64) + default: + return Number(0) + } +} + +// Number represents either an integral or a floating point value. It +// needs to be accompanied with a source of Kind that describes +// the actual type of the value stored within Number. +type Number uint64 + +// - constructors + +// NewNumberFromRaw creates a new Number from a raw value. +func NewNumberFromRaw(r uint64) Number { + return Number(r) +} + +// NewInt64Number creates an integral Number. +func NewInt64Number(i int64) Number { + return NewNumberFromRaw(internal.Int64ToRaw(i)) +} + +// NewFloat64Number creates a floating point Number. +func NewFloat64Number(f float64) Number { + return NewNumberFromRaw(internal.Float64ToRaw(f)) +} + +// NewNumberSignChange returns a number with the same magnitude and +// the opposite sign. `kind` must describe the kind of number in `nn`. +func NewNumberSignChange(kind Kind, nn Number) Number { + switch kind { + case Int64Kind: + return NewInt64Number(-nn.AsInt64()) + case Float64Kind: + return NewFloat64Number(-nn.AsFloat64()) + } + return nn +} + +// - as x + +// AsNumber gets the Number. +func (n *Number) AsNumber() Number { + return *n +} + +// AsRaw gets the uninterpreted raw value. Might be useful for some +// atomic operations. +func (n *Number) AsRaw() uint64 { + return uint64(*n) +} + +// AsInt64 assumes that the value contains an int64 and returns it as +// such. +func (n *Number) AsInt64() int64 { + return internal.RawToInt64(n.AsRaw()) +} + +// AsFloat64 assumes that the measurement value contains a float64 and +// returns it as such. +func (n *Number) AsFloat64() float64 { + return internal.RawToFloat64(n.AsRaw()) +} + +// - as x atomic + +// AsNumberAtomic gets the Number atomically. +func (n *Number) AsNumberAtomic() Number { + return NewNumberFromRaw(n.AsRawAtomic()) +} + +// AsRawAtomic gets the uninterpreted raw value atomically. Might be +// useful for some atomic operations. +func (n *Number) AsRawAtomic() uint64 { + return atomic.LoadUint64(n.AsRawPtr()) +} + +// AsInt64Atomic assumes that the number contains an int64 and returns +// it as such atomically. +func (n *Number) AsInt64Atomic() int64 { + return atomic.LoadInt64(n.AsInt64Ptr()) +} + +// AsFloat64Atomic assumes that the measurement value contains a +// float64 and returns it as such atomically. +func (n *Number) AsFloat64Atomic() float64 { + return internal.RawToFloat64(n.AsRawAtomic()) +} + +// - as x ptr + +// AsRawPtr gets the pointer to the raw, uninterpreted raw +// value. Might be useful for some atomic operations. +func (n *Number) AsRawPtr() *uint64 { + return (*uint64)(n) +} + +// AsInt64Ptr assumes that the number contains an int64 and returns a +// pointer to it. +func (n *Number) AsInt64Ptr() *int64 { + return internal.RawPtrToInt64Ptr(n.AsRawPtr()) +} + +// AsFloat64Ptr assumes that the number contains a float64 and returns a +// pointer to it. +func (n *Number) AsFloat64Ptr() *float64 { + return internal.RawPtrToFloat64Ptr(n.AsRawPtr()) +} + +// - coerce + +// CoerceToInt64 casts the number to int64. May result in +// data/precision loss. +func (n *Number) CoerceToInt64(kind Kind) int64 { + switch kind { + case Int64Kind: + return n.AsInt64() + case Float64Kind: + return int64(n.AsFloat64()) + default: + // you get what you deserve + return 0 + } +} + +// CoerceToFloat64 casts the number to float64. May result in +// data/precision loss. +func (n *Number) CoerceToFloat64(kind Kind) float64 { + switch kind { + case Int64Kind: + return float64(n.AsInt64()) + case Float64Kind: + return n.AsFloat64() + default: + // you get what you deserve + return 0 + } +} + +// - set + +// SetNumber sets the number to the passed number. Both should be of +// the same kind. +func (n *Number) SetNumber(nn Number) { + *n.AsRawPtr() = nn.AsRaw() +} + +// SetRaw sets the number to the passed raw value. Both number and the +// raw number should represent the same kind. +func (n *Number) SetRaw(r uint64) { + *n.AsRawPtr() = r +} + +// SetInt64 assumes that the number contains an int64 and sets it to +// the passed value. +func (n *Number) SetInt64(i int64) { + *n.AsInt64Ptr() = i +} + +// SetFloat64 assumes that the number contains a float64 and sets it +// to the passed value. +func (n *Number) SetFloat64(f float64) { + *n.AsFloat64Ptr() = f +} + +// - set atomic + +// SetNumberAtomic sets the number to the passed number +// atomically. Both should be of the same kind. +func (n *Number) SetNumberAtomic(nn Number) { + atomic.StoreUint64(n.AsRawPtr(), nn.AsRaw()) +} + +// SetRawAtomic sets the number to the passed raw value +// atomically. Both number and the raw number should represent the +// same kind. +func (n *Number) SetRawAtomic(r uint64) { + atomic.StoreUint64(n.AsRawPtr(), r) +} + +// SetInt64Atomic assumes that the number contains an int64 and sets +// it to the passed value atomically. +func (n *Number) SetInt64Atomic(i int64) { + atomic.StoreInt64(n.AsInt64Ptr(), i) +} + +// SetFloat64Atomic assumes that the number contains a float64 and +// sets it to the passed value atomically. +func (n *Number) SetFloat64Atomic(f float64) { + atomic.StoreUint64(n.AsRawPtr(), internal.Float64ToRaw(f)) +} + +// - swap + +// SwapNumber sets the number to the passed number and returns the old +// number. Both this number and the passed number should be of the +// same kind. +func (n *Number) SwapNumber(nn Number) Number { + old := *n + n.SetNumber(nn) + return old +} + +// SwapRaw sets the number to the passed raw value and returns the old +// raw value. Both number and the raw number should represent the same +// kind. +func (n *Number) SwapRaw(r uint64) uint64 { + old := n.AsRaw() + n.SetRaw(r) + return old +} + +// SwapInt64 assumes that the number contains an int64, sets it to the +// passed value and returns the old int64 value. +func (n *Number) SwapInt64(i int64) int64 { + old := n.AsInt64() + n.SetInt64(i) + return old +} + +// SwapFloat64 assumes that the number contains an float64, sets it to +// the passed value and returns the old float64 value. +func (n *Number) SwapFloat64(f float64) float64 { + old := n.AsFloat64() + n.SetFloat64(f) + return old +} + +// - swap atomic + +// SwapNumberAtomic sets the number to the passed number and returns +// the old number atomically. Both this number and the passed number +// should be of the same kind. +func (n *Number) SwapNumberAtomic(nn Number) Number { + return NewNumberFromRaw(atomic.SwapUint64(n.AsRawPtr(), nn.AsRaw())) +} + +// SwapRawAtomic sets the number to the passed raw value and returns +// the old raw value atomically. Both number and the raw number should +// represent the same kind. +func (n *Number) SwapRawAtomic(r uint64) uint64 { + return atomic.SwapUint64(n.AsRawPtr(), r) +} + +// SwapInt64Atomic assumes that the number contains an int64, sets it +// to the passed value and returns the old int64 value atomically. +func (n *Number) SwapInt64Atomic(i int64) int64 { + return atomic.SwapInt64(n.AsInt64Ptr(), i) +} + +// SwapFloat64Atomic assumes that the number contains an float64, sets +// it to the passed value and returns the old float64 value +// atomically. +func (n *Number) SwapFloat64Atomic(f float64) float64 { + return internal.RawToFloat64(atomic.SwapUint64(n.AsRawPtr(), internal.Float64ToRaw(f))) +} + +// - add + +// AddNumber assumes that this and the passed number are of the passed +// kind and adds the passed number to this number. +func (n *Number) AddNumber(kind Kind, nn Number) { + switch kind { + case Int64Kind: + n.AddInt64(nn.AsInt64()) + case Float64Kind: + n.AddFloat64(nn.AsFloat64()) + } +} + +// AddRaw assumes that this number and the passed raw value are of the +// passed kind and adds the passed raw value to this number. +func (n *Number) AddRaw(kind Kind, r uint64) { + n.AddNumber(kind, NewNumberFromRaw(r)) +} + +// AddInt64 assumes that the number contains an int64 and adds the +// passed int64 to it. +func (n *Number) AddInt64(i int64) { + *n.AsInt64Ptr() += i +} + +// AddFloat64 assumes that the number contains a float64 and adds the +// passed float64 to it. +func (n *Number) AddFloat64(f float64) { + *n.AsFloat64Ptr() += f +} + +// - add atomic + +// AddNumberAtomic assumes that this and the passed number are of the +// passed kind and adds the passed number to this number atomically. +func (n *Number) AddNumberAtomic(kind Kind, nn Number) { + switch kind { + case Int64Kind: + n.AddInt64Atomic(nn.AsInt64()) + case Float64Kind: + n.AddFloat64Atomic(nn.AsFloat64()) + } +} + +// AddRawAtomic assumes that this number and the passed raw value are +// of the passed kind and adds the passed raw value to this number +// atomically. +func (n *Number) AddRawAtomic(kind Kind, r uint64) { + n.AddNumberAtomic(kind, NewNumberFromRaw(r)) +} + +// AddInt64Atomic assumes that the number contains an int64 and adds +// the passed int64 to it atomically. +func (n *Number) AddInt64Atomic(i int64) { + atomic.AddInt64(n.AsInt64Ptr(), i) +} + +// AddFloat64Atomic assumes that the number contains a float64 and +// adds the passed float64 to it atomically. +func (n *Number) AddFloat64Atomic(f float64) { + for { + o := n.AsFloat64Atomic() + if n.CompareAndSwapFloat64(o, o+f) { + break + } + } +} + +// - compare and swap (atomic only) + +// CompareAndSwapNumber does the atomic CAS operation on this +// number. This number and passed old and new numbers should be of the +// same kind. +func (n *Number) CompareAndSwapNumber(on, nn Number) bool { + return atomic.CompareAndSwapUint64(n.AsRawPtr(), on.AsRaw(), nn.AsRaw()) +} + +// CompareAndSwapRaw does the atomic CAS operation on this +// number. This number and passed old and new raw values should be of +// the same kind. +func (n *Number) CompareAndSwapRaw(or, nr uint64) bool { + return atomic.CompareAndSwapUint64(n.AsRawPtr(), or, nr) +} + +// CompareAndSwapInt64 assumes that this number contains an int64 and +// does the atomic CAS operation on it. +func (n *Number) CompareAndSwapInt64(oi, ni int64) bool { + return atomic.CompareAndSwapInt64(n.AsInt64Ptr(), oi, ni) +} + +// CompareAndSwapFloat64 assumes that this number contains a float64 and +// does the atomic CAS operation on it. +func (n *Number) CompareAndSwapFloat64(of, nf float64) bool { + return atomic.CompareAndSwapUint64(n.AsRawPtr(), internal.Float64ToRaw(of), internal.Float64ToRaw(nf)) +} + +// - compare + +// CompareNumber compares two Numbers given their kind. Both numbers +// should have the same kind. This returns: +// 0 if the numbers are equal +// -1 if the subject `n` is less than the argument `nn` +// +1 if the subject `n` is greater than the argument `nn` +func (n *Number) CompareNumber(kind Kind, nn Number) int { + switch kind { + case Int64Kind: + return n.CompareInt64(nn.AsInt64()) + case Float64Kind: + return n.CompareFloat64(nn.AsFloat64()) + default: + // you get what you deserve + return 0 + } +} + +// CompareRaw compares two numbers, where one is input as a raw +// uint64, interpreting both values as a `kind` of number. +func (n *Number) CompareRaw(kind Kind, r uint64) int { + return n.CompareNumber(kind, NewNumberFromRaw(r)) +} + +// CompareInt64 assumes that the Number contains an int64 and performs +// a comparison between the value and the other value. It returns the +// typical result of the compare function: -1 if the value is less +// than the other, 0 if both are equal, 1 if the value is greater than +// the other. +func (n *Number) CompareInt64(i int64) int { + this := n.AsInt64() + if this < i { + return -1 + } else if this > i { + return 1 + } + return 0 +} + +// CompareFloat64 assumes that the Number contains a float64 and +// performs a comparison between the value and the other value. It +// returns the typical result of the compare function: -1 if the value +// is less than the other, 0 if both are equal, 1 if the value is +// greater than the other. +// +// Do not compare NaN values. +func (n *Number) CompareFloat64(f float64) int { + this := n.AsFloat64() + if this < f { + return -1 + } else if this > f { + return 1 + } + return 0 +} + +// - relations to zero + +// IsPositive returns true if the actual value is greater than zero. +func (n *Number) IsPositive(kind Kind) bool { + return n.compareWithZero(kind) > 0 +} + +// IsNegative returns true if the actual value is less than zero. +func (n *Number) IsNegative(kind Kind) bool { + return n.compareWithZero(kind) < 0 +} + +// IsZero returns true if the actual value is equal to zero. +func (n *Number) IsZero(kind Kind) bool { + return n.compareWithZero(kind) == 0 +} + +// - misc + +// Emit returns a string representation of the raw value of the +// Number. A %d is used for integral values, %f for floating point +// values. +func (n *Number) Emit(kind Kind) string { + switch kind { + case Int64Kind: + return fmt.Sprintf("%d", n.AsInt64()) + case Float64Kind: + return fmt.Sprintf("%f", n.AsFloat64()) + default: + return "" + } +} + +// AsInterface returns the number as an interface{}, typically used +// for Kind-correct JSON conversion. +func (n *Number) AsInterface(kind Kind) interface{} { + switch kind { + case Int64Kind: + return n.AsInt64() + case Float64Kind: + return n.AsFloat64() + default: + return math.NaN() + } +} + +// - private stuff + +func (n *Number) compareWithZero(kind Kind) int { + switch kind { + case Int64Kind: + return n.CompareInt64(0) + case Float64Kind: + return n.CompareFloat64(0.) + default: + // you get what you deserve + return 0 + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/registry/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/registry/doc.go new file mode 100644 index 000000000000..a53ba4554557 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/registry/doc.go @@ -0,0 +1,24 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package registry provides a non-standalone implementation of +MeterProvider that adds uniqueness checking for instrument descriptors +on top of other MeterProvider it wraps. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track the +evolving OpenTelemetry specification and user feedback. +*/ +package registry // import "go.opentelemetry.io/otel/metric/registry" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/registry/registry.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/registry/registry.go new file mode 100644 index 000000000000..0a42a0fdf8dc --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/registry/registry.go @@ -0,0 +1,170 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package registry // import "go.opentelemetry.io/otel/metric/registry" + +import ( + "context" + "fmt" + "sync" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" +) + +// MeterProvider is a standard MeterProvider for wrapping `MeterImpl` +type MeterProvider struct { + impl metric.MeterImpl +} + +var _ metric.MeterProvider = (*MeterProvider)(nil) + +// uniqueInstrumentMeterImpl implements the metric.MeterImpl interface, adding +// uniqueness checking for instrument descriptors. Use NewUniqueInstrumentMeter +// to wrap an implementation with uniqueness checking. +type uniqueInstrumentMeterImpl struct { + lock sync.Mutex + impl metric.MeterImpl + state map[key]metric.InstrumentImpl +} + +var _ metric.MeterImpl = (*uniqueInstrumentMeterImpl)(nil) + +type key struct { + instrumentName string + instrumentationName string + InstrumentationVersion string +} + +// NewMeterProvider returns a new provider that implements instrument +// name-uniqueness checking. +func NewMeterProvider(impl metric.MeterImpl) *MeterProvider { + return &MeterProvider{ + impl: NewUniqueInstrumentMeterImpl(impl), + } +} + +// Meter implements MeterProvider. +func (p *MeterProvider) Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter { + return metric.WrapMeterImpl(p.impl, instrumentationName, opts...) +} + +// ErrMetricKindMismatch is the standard error for mismatched metric +// instrument definitions. +var ErrMetricKindMismatch = fmt.Errorf( + "a metric was already registered by this name with another kind or number type") + +// NewUniqueInstrumentMeterImpl returns a wrapped metric.MeterImpl with +// the addition of uniqueness checking. +func NewUniqueInstrumentMeterImpl(impl metric.MeterImpl) metric.MeterImpl { + return &uniqueInstrumentMeterImpl{ + impl: impl, + state: map[key]metric.InstrumentImpl{}, + } +} + +// RecordBatch implements metric.MeterImpl. +func (u *uniqueInstrumentMeterImpl) RecordBatch(ctx context.Context, labels []attribute.KeyValue, ms ...metric.Measurement) { + u.impl.RecordBatch(ctx, labels, ms...) +} + +func keyOf(descriptor metric.Descriptor) key { + return key{ + descriptor.Name(), + descriptor.InstrumentationName(), + descriptor.InstrumentationVersion(), + } +} + +// NewMetricKindMismatchError formats an error that describes a +// mismatched metric instrument definition. +func NewMetricKindMismatchError(desc metric.Descriptor) error { + return fmt.Errorf("metric was %s (%s %s)registered as a %s %s: %w", + desc.Name(), + desc.InstrumentationName(), + desc.InstrumentationVersion(), + desc.NumberKind(), + desc.InstrumentKind(), + ErrMetricKindMismatch) +} + +// Compatible determines whether two metric.Descriptors are considered +// the same for the purpose of uniqueness checking. +func Compatible(candidate, existing metric.Descriptor) bool { + return candidate.InstrumentKind() == existing.InstrumentKind() && + candidate.NumberKind() == existing.NumberKind() +} + +// checkUniqueness returns an ErrMetricKindMismatch error if there is +// a conflict between a descriptor that was already registered and the +// `descriptor` argument. If there is an existing compatible +// registration, this returns the already-registered instrument. If +// there is no conflict and no prior registration, returns (nil, nil). +func (u *uniqueInstrumentMeterImpl) checkUniqueness(descriptor metric.Descriptor) (metric.InstrumentImpl, error) { + impl, ok := u.state[keyOf(descriptor)] + if !ok { + return nil, nil + } + + if !Compatible(descriptor, impl.Descriptor()) { + return nil, NewMetricKindMismatchError(impl.Descriptor()) + } + + return impl, nil +} + +// NewSyncInstrument implements metric.MeterImpl. +func (u *uniqueInstrumentMeterImpl) NewSyncInstrument(descriptor metric.Descriptor) (metric.SyncImpl, error) { + u.lock.Lock() + defer u.lock.Unlock() + + impl, err := u.checkUniqueness(descriptor) + + if err != nil { + return nil, err + } else if impl != nil { + return impl.(metric.SyncImpl), nil + } + + syncInst, err := u.impl.NewSyncInstrument(descriptor) + if err != nil { + return nil, err + } + u.state[keyOf(descriptor)] = syncInst + return syncInst, nil +} + +// NewAsyncInstrument implements metric.MeterImpl. +func (u *uniqueInstrumentMeterImpl) NewAsyncInstrument( + descriptor metric.Descriptor, + runner metric.AsyncRunner, +) (metric.AsyncImpl, error) { + u.lock.Lock() + defer u.lock.Unlock() + + impl, err := u.checkUniqueness(descriptor) + + if err != nil { + return nil, err + } else if impl != nil { + return impl.(metric.AsyncImpl), nil + } + + asyncInst, err := u.impl.NewAsyncInstrument(descriptor, runner) + if err != nil { + return nil, err + } + u.state[keyOf(descriptor)] = asyncInst + return asyncInst, nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/pre_release.sh b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/pre_release.sh new file mode 100644 index 000000000000..0de22169cfcb --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/pre_release.sh @@ -0,0 +1,95 @@ +#!/bin/bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +help() +{ + printf "\n" + printf "Usage: $0 -t tag\n" + printf "\t-t Unreleased tag. Update all go.mod with this tag.\n" + exit 1 # Exit script after printing help +} + +while getopts "t:" opt +do + case "$opt" in + t ) TAG="$OPTARG" ;; + ? ) help ;; # Print help + esac +done + +# Print help in case parameters are empty +if [ -z "$TAG" ] +then + printf "Tag is missing\n"; + help +fi + +# Validate semver +SEMVER_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" +if [[ "${TAG}" =~ ${SEMVER_REGEX} ]]; then + printf "${TAG} is valid semver tag.\n" +else + printf "${TAG} is not a valid semver tag.\n" + exit -1 +fi + +TAG_FOUND=`git tag --list ${TAG}` +if [[ ${TAG_FOUND} = ${TAG} ]] ; then + printf "Tag ${TAG} already exists\n" + exit -1 +fi + +# Get version for version.go +OTEL_VERSION=$(echo "${TAG}" | grep -o '^v[0-9]\+\.[0-9]\+\.[0-9]\+') +# Strip leading v +OTEL_VERSION="${OTEL_VERSION#v}" + +cd $(dirname $0) + +if ! git diff --quiet; then \ + printf "Working tree is not clean, can't proceed with the release process\n" + git status + git diff + exit 1 +fi + +# Update version.go +cp ./version.go ./version.go.bak +sed "s/\(return \"\)[0-9]*\.[0-9]*\.[0-9]*\"/\1${OTEL_VERSION}\"/" ./version.go.bak >./version.go +rm -f ./version.go.bak + +# Update go.mod +git checkout -b pre_release_${TAG} main +PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | egrep -v 'tools' | sed 's/^\.\///' | sort) + +for dir in $PACKAGE_DIRS; do + cp "${dir}/go.mod" "${dir}/go.mod.bak" + sed "s/opentelemetry.io\/otel\([^ ]*\) v[0-9]*\.[0-9]*\.[0-9]/opentelemetry.io\/otel\1 ${TAG}/" "${dir}/go.mod.bak" >"${dir}/go.mod" + rm -f "${dir}/go.mod.bak" +done + +# Run lint to update go.sum +make lint + +# Add changes and commit. +git add . +make ci +git commit -m "Prepare for releasing $TAG" + +printf "Now run following to verify the changes.\ngit diff main\n" +printf "\nThen push the changes to upstream\n" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation.go new file mode 100644 index 000000000000..d29aaa32c0b5 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/propagation" +) + +// GetTextMapPropagator returns the global TextMapPropagator. If none has been +// set, a No-Op TextMapPropagator is returned. +func GetTextMapPropagator() propagation.TextMapPropagator { + return global.TextMapPropagator() +} + +// SetTextMapPropagator sets propagator as the global TextMapPropagator. +func SetTextMapPropagator(propagator propagation.TextMapPropagator) { + global.SetTextMapPropagator(propagator) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/baggage.go new file mode 100644 index 000000000000..bc76191892e3 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/baggage.go @@ -0,0 +1,111 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + "net/url" + "strings" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/internal/baggage" +) + +const baggageHeader = "baggage" + +// Baggage is a propagator that supports the W3C Baggage format. +// +// This propagates user-defined baggage associated with a trace. The complete +// specification is defined at https://w3c.github.io/baggage/. +type Baggage struct{} + +var _ TextMapPropagator = Baggage{} + +// Inject sets baggage key-values from ctx into the carrier. +func (b Baggage) Inject(ctx context.Context, carrier TextMapCarrier) { + baggageMap := baggage.MapFromContext(ctx) + firstIter := true + var headerValueBuilder strings.Builder + baggageMap.Foreach(func(kv attribute.KeyValue) bool { + if !firstIter { + headerValueBuilder.WriteRune(',') + } + firstIter = false + headerValueBuilder.WriteString(url.QueryEscape(strings.TrimSpace((string)(kv.Key)))) + headerValueBuilder.WriteRune('=') + headerValueBuilder.WriteString(url.QueryEscape(strings.TrimSpace(kv.Value.Emit()))) + return true + }) + if headerValueBuilder.Len() > 0 { + headerString := headerValueBuilder.String() + carrier.Set(baggageHeader, headerString) + } +} + +// Extract returns a copy of parent with the baggage from the carrier added. +func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context.Context { + bVal := carrier.Get(baggageHeader) + if bVal == "" { + return parent + } + + baggageValues := strings.Split(bVal, ",") + keyValues := make([]attribute.KeyValue, 0, len(baggageValues)) + for _, baggageValue := range baggageValues { + valueAndProps := strings.Split(baggageValue, ";") + if len(valueAndProps) < 1 { + continue + } + nameValue := strings.Split(valueAndProps[0], "=") + if len(nameValue) < 2 { + continue + } + name, err := url.QueryUnescape(nameValue[0]) + if err != nil { + continue + } + trimmedName := strings.TrimSpace(name) + value, err := url.QueryUnescape(nameValue[1]) + if err != nil { + continue + } + trimmedValue := strings.TrimSpace(value) + + // TODO (skaris): properties defiend https://w3c.github.io/correlation-context/, are currently + // just put as part of the value. + var trimmedValueWithProps strings.Builder + trimmedValueWithProps.WriteString(trimmedValue) + for _, prop := range valueAndProps[1:] { + trimmedValueWithProps.WriteRune(';') + trimmedValueWithProps.WriteString(prop) + } + + keyValues = append(keyValues, attribute.String(trimmedName, trimmedValueWithProps.String())) + } + + if len(keyValues) > 0 { + // Only update the context if valid values were found + return baggage.ContextWithMap(parent, baggage.NewMap(baggage.MapUpdate{ + MultiKV: keyValues, + })) + } + + return parent +} + +// Fields returns the keys who's values are set with Inject. +func (b Baggage) Fields() []string { + return []string{baggageHeader} +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/doc.go new file mode 100644 index 000000000000..89573f1baa91 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/doc.go @@ -0,0 +1,28 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package propagation contains OpenTelemetry context propagators. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track the +evolving OpenTelemetry specification and user feedback. + +OpenTelemetry propagators are used to extract and inject context data from and +into messages exchanged by applications. The propagator supported by this +package is the W3C Trace Context encoding +(https://www.w3.org/TR/trace-context/), and W3C Baggage +(https://w3c.github.io/baggage/). +*/ +package propagation // import "go.opentelemetry.io/otel/propagation" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/propagation.go new file mode 100644 index 000000000000..9cfeb347a378 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/propagation.go @@ -0,0 +1,105 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + "net/http" +) + +// TextMapCarrier is the storage medium used by a TextMapPropagator. +type TextMapCarrier interface { + // Get returns the value associated with the passed key. + Get(key string) string + // Set stores the key-value pair. + Set(key string, value string) + // Keys lists the keys stored in this carrier. + Keys() []string +} + +// HeaderCarrier adapts http.Header to satisfy the TextMapCarrier interface. +type HeaderCarrier http.Header + +// Get returns the value associated with the passed key. +func (hc HeaderCarrier) Get(key string) string { + return http.Header(hc).Get(key) +} + +// Set stores the key-value pair. +func (hc HeaderCarrier) Set(key string, value string) { + http.Header(hc).Set(key, value) +} + +// Keys lists the keys stored in this carrier. +func (hc HeaderCarrier) Keys() []string { + keys := make([]string, 0, len(hc)) + for k := range hc { + keys = append(keys, k) + } + return keys +} + +// TextMapPropagator propagates cross-cutting concerns as key-value text +// pairs within a carrier that travels in-band across process boundaries. +type TextMapPropagator interface { + // Inject set cross-cutting concerns from the Context into the carrier. + Inject(ctx context.Context, carrier TextMapCarrier) + // Extract reads cross-cutting concerns from the carrier into a Context. + Extract(ctx context.Context, carrier TextMapCarrier) context.Context + // Fields returns the keys who's values are set with Inject. + Fields() []string +} + +type compositeTextMapPropagator []TextMapPropagator + +func (p compositeTextMapPropagator) Inject(ctx context.Context, carrier TextMapCarrier) { + for _, i := range p { + i.Inject(ctx, carrier) + } +} + +func (p compositeTextMapPropagator) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { + for _, i := range p { + ctx = i.Extract(ctx, carrier) + } + return ctx +} + +func (p compositeTextMapPropagator) Fields() []string { + unique := make(map[string]struct{}) + for _, i := range p { + for _, k := range i.Fields() { + unique[k] = struct{}{} + } + } + + fields := make([]string, 0, len(unique)) + for k := range unique { + fields = append(fields, k) + } + return fields +} + +// NewCompositeTextMapPropagator returns a unified TextMapPropagator from the +// group of passed TextMapPropagator. This allows different cross-cutting +// concerns to be propagates in a unified manner. +// +// The returned TextMapPropagator will inject and extract cross-cutting +// concerns in the order the TextMapPropagators were provided. Additionally, +// the Fields method will return a de-duplicated slice of the keys that are +// set with the Inject method. +func NewCompositeTextMapPropagator(p ...TextMapPropagator) TextMapPropagator { + return compositeTextMapPropagator(p) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/trace_context.go new file mode 100644 index 000000000000..82de416bea64 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/propagation/trace_context.go @@ -0,0 +1,178 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + "encoding/hex" + "fmt" + "regexp" + "strings" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" +) + +const ( + supportedVersion = 0 + maxVersion = 254 + traceparentHeader = "traceparent" + tracestateHeader = "tracestate" +) + +// TraceContext is a propagator that supports the W3C Trace Context format +// (https://www.w3.org/TR/trace-context/) +// +// This propagator will propagate the traceparent and tracestate headers to +// guarantee traces are not broken. It is up to the users of this propagator +// to choose if they want to participate in a trace by modifying the +// traceparent header and relevant parts of the tracestate header containing +// their proprietary information. +type TraceContext struct{} + +var _ TextMapPropagator = TraceContext{} +var traceCtxRegExp = regexp.MustCompile("^(?P[0-9a-f]{2})-(?P[a-f0-9]{32})-(?P[a-f0-9]{16})-(?P[a-f0-9]{2})(?:-.*)?$") + +// Inject set tracecontext from the Context into the carrier. +func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) { + sc := trace.SpanContextFromContext(ctx) + if !sc.IsValid() { + return + } + + carrier.Set(tracestateHeader, sc.TraceState().String()) + + // Clear all flags other than the trace-context supported sampling bit. + flags := sc.TraceFlags() & trace.FlagsSampled + + h := fmt.Sprintf("%.2x-%s-%s-%s", + supportedVersion, + sc.TraceID(), + sc.SpanID(), + flags) + carrier.Set(traceparentHeader, h) +} + +// Extract reads tracecontext from the carrier into a returned Context. +// +// The returned Context will be a copy of ctx and contain the extracted +// tracecontext as the remote SpanContext. If the extracted tracecontext is +// invalid, the passed ctx will be returned directly instead. +func (tc TraceContext) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { + sc := tc.extract(carrier) + if !sc.IsValid() { + return ctx + } + return trace.ContextWithRemoteSpanContext(ctx, sc) +} + +func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext { + h := carrier.Get(traceparentHeader) + if h == "" { + return trace.SpanContext{} + } + + matches := traceCtxRegExp.FindStringSubmatch(h) + + if len(matches) == 0 { + return trace.SpanContext{} + } + + if len(matches) < 5 { // four subgroups plus the overall match + return trace.SpanContext{} + } + + if len(matches[1]) != 2 { + return trace.SpanContext{} + } + ver, err := hex.DecodeString(matches[1]) + if err != nil { + return trace.SpanContext{} + } + version := int(ver[0]) + if version > maxVersion { + return trace.SpanContext{} + } + + if version == 0 && len(matches) != 5 { // four subgroups plus the overall match + return trace.SpanContext{} + } + + if len(matches[2]) != 32 { + return trace.SpanContext{} + } + + var scc trace.SpanContextConfig + + scc.TraceID, err = trace.TraceIDFromHex(matches[2][:32]) + if err != nil { + return trace.SpanContext{} + } + + if len(matches[3]) != 16 { + return trace.SpanContext{} + } + scc.SpanID, err = trace.SpanIDFromHex(matches[3]) + if err != nil { + return trace.SpanContext{} + } + + if len(matches[4]) != 2 { + return trace.SpanContext{} + } + opts, err := hex.DecodeString(matches[4]) + if err != nil || len(opts) < 1 || (version == 0 && opts[0] > 2) { + return trace.SpanContext{} + } + // Clear all flags other than the trace-context supported sampling bit. + scc.TraceFlags = trace.TraceFlags(opts[0]) & trace.FlagsSampled + + scc.TraceState = parseTraceState(carrier.Get(tracestateHeader)) + scc.Remote = true + + sc := trace.NewSpanContext(scc) + if !sc.IsValid() { + return trace.SpanContext{} + } + + return sc +} + +// Fields returns the keys who's values are set with Inject. +func (tc TraceContext) Fields() []string { + return []string{traceparentHeader, tracestateHeader} +} + +func parseTraceState(in string) trace.TraceState { + if in == "" { + return trace.TraceState{} + } + + kvs := []attribute.KeyValue{} + for _, entry := range strings.Split(in, ",") { + parts := strings.SplitN(entry, "=", 2) + if len(parts) != 2 { + // Parse failure, abort! + return trace.TraceState{} + } + kvs = append(kvs, attribute.String(parts[0], parts[1])) + } + + // Ignoring error here as "failure to parse tracestate MUST NOT + // affect the parsing of traceparent." + // https://www.w3.org/TR/trace-context/#tracestate-header + ts, _ := trace.TraceStateFromKeyValues(kvs...) + return ts +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/LICENSE b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/LICENSE b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/aggregation/aggregation.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/aggregation/aggregation.go new file mode 100644 index 000000000000..73e98aaa855e --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/aggregation/aggregation.go @@ -0,0 +1,154 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aggregation // import "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + +import ( + "fmt" + "time" + + "go.opentelemetry.io/otel/metric/number" +) + +// These interfaces describe the various ways to access state from an +// Aggregation. + +type ( + // Aggregation is an interface returned by the Aggregator + // containing an interval of metric data. + Aggregation interface { + // Kind returns a short identifying string to identify + // the Aggregator that was used to produce the + // Aggregation (e.g., "Sum"). + Kind() Kind + } + + // Sum returns an aggregated sum. + Sum interface { + Aggregation + Sum() (number.Number, error) + } + + // Count returns the number of values that were aggregated. + Count interface { + Aggregation + Count() (uint64, error) + } + + // Min returns the minimum value over the set of values that were aggregated. + Min interface { + Aggregation + Min() (number.Number, error) + } + + // Max returns the maximum value over the set of values that were aggregated. + Max interface { + Aggregation + Max() (number.Number, error) + } + + // LastValue returns the latest value that was aggregated. + LastValue interface { + Aggregation + LastValue() (number.Number, time.Time, error) + } + + // Points returns the raw values that were aggregated. + Points interface { + Aggregation + + // Points returns points in the order they were + // recorded. Points are approximately ordered by + // timestamp, but this is not guaranteed. + Points() ([]Point, error) + } + + // Point is a raw data point, consisting of a number and value. + Point struct { + number.Number + time.Time + } + + // Buckets represents histogram buckets boundaries and counts. + // + // For a Histogram with N defined boundaries, e.g, [x, y, z]. + // There are N+1 counts: [-inf, x), [x, y), [y, z), [z, +inf] + Buckets struct { + // Boundaries are floating point numbers, even when + // aggregating integers. + Boundaries []float64 + + // Counts holds the count in each bucket. + Counts []uint64 + } + + // Histogram returns the count of events in pre-determined buckets. + Histogram interface { + Aggregation + Count() (uint64, error) + Sum() (number.Number, error) + Histogram() (Buckets, error) + } + + // MinMaxSumCount supports the Min, Max, Sum, and Count interfaces. + MinMaxSumCount interface { + Aggregation + Min() (number.Number, error) + Max() (number.Number, error) + Sum() (number.Number, error) + Count() (uint64, error) + } +) + +type ( + // Kind is a short name for the Aggregator that produces an + // Aggregation, used for descriptive purpose only. Kind is a + // string to allow user-defined Aggregators. + // + // When deciding how to handle an Aggregation, Exporters are + // encouraged to decide based on conversion to the above + // interfaces based on strength, not on Kind value, when + // deciding how to expose metric data. This enables + // user-supplied Aggregators to replace builtin Aggregators. + // + // For example, test for a Distribution before testing for a + // MinMaxSumCount, test for a Histogram before testing for a + // Sum, and so on. + Kind string +) + +const ( + SumKind Kind = "Sum" + MinMaxSumCountKind Kind = "MinMaxSumCount" + HistogramKind Kind = "Histogram" + LastValueKind Kind = "Lastvalue" + ExactKind Kind = "Exact" +) + +var ( + ErrNegativeInput = fmt.Errorf("negative value is out of range for this instrument") + ErrNaNInput = fmt.Errorf("NaN value is an invalid input") + ErrInconsistentType = fmt.Errorf("inconsistent aggregator types") + ErrNoSubtraction = fmt.Errorf("aggregator does not subtract") + + // ErrNoData is returned when (due to a race with collection) + // the Aggregator is check-pointed before the first value is set. + // The aggregator should simply be skipped in this case. + ErrNoData = fmt.Errorf("no data collected by this aggregator") +) + +// String returns the string value of Kind. +func (k Kind) String() string { + return string(k) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/exportkind_string.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/exportkind_string.go new file mode 100644 index 000000000000..a92c1c1f2de2 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/exportkind_string.go @@ -0,0 +1,25 @@ +// Code generated by "stringer -type=ExportKind"; DO NOT EDIT. + +package metric + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[CumulativeExportKind-1] + _ = x[DeltaExportKind-2] +} + +const _ExportKind_name = "CumulativeExportKindDeltaExportKind" + +var _ExportKind_index = [...]uint8{0, 20, 35} + +func (i ExportKind) String() string { + i -= 1 + if i < 0 || i >= ExportKind(len(_ExportKind_index)-1) { + return "ExportKind(" + strconv.FormatInt(int64(i+1), 10) + ")" + } + return _ExportKind_name[_ExportKind_index[i]:_ExportKind_index[i+1]] +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/go.mod b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/go.mod new file mode 100644 index 000000000000..170d38157fad --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/go.mod @@ -0,0 +1,54 @@ +module go.opentelemetry.io/otel/sdk/export/metric + +go 1.14 + +replace go.opentelemetry.io/otel => ../../.. + +replace go.opentelemetry.io/otel/bridge/opencensus => ../../../bridge/opencensus + +replace go.opentelemetry.io/otel/bridge/opentracing => ../../../bridge/opentracing + +replace go.opentelemetry.io/otel/example/jaeger => ../../../example/jaeger + +replace go.opentelemetry.io/otel/example/namedtracer => ../../../example/namedtracer + +replace go.opentelemetry.io/otel/example/opencensus => ../../../example/opencensus + +replace go.opentelemetry.io/otel/example/otel-collector => ../../../example/otel-collector + +replace go.opentelemetry.io/otel/example/prom-collector => ../../../example/prom-collector + +replace go.opentelemetry.io/otel/example/prometheus => ../../../example/prometheus + +replace go.opentelemetry.io/otel/example/zipkin => ../../../example/zipkin + +replace go.opentelemetry.io/otel/exporters/metric/prometheus => ../../../exporters/metric/prometheus + +replace go.opentelemetry.io/otel/exporters/otlp => ../../../exporters/otlp + +replace go.opentelemetry.io/otel/exporters/stdout => ../../../exporters/stdout + +replace go.opentelemetry.io/otel/exporters/trace/jaeger => ../../../exporters/trace/jaeger + +replace go.opentelemetry.io/otel/exporters/trace/zipkin => ../../../exporters/trace/zipkin + +replace go.opentelemetry.io/otel/internal/tools => ../../../internal/tools + +replace go.opentelemetry.io/otel/metric => ../../../metric + +replace go.opentelemetry.io/otel/oteltest => ../../../oteltest + +replace go.opentelemetry.io/otel/sdk => ../.. + +replace go.opentelemetry.io/otel/sdk/export/metric => ./ + +replace go.opentelemetry.io/otel/sdk/metric => ../../metric + +replace go.opentelemetry.io/otel/trace => ../../../trace + +require ( + github.com/stretchr/testify v1.7.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/go.sum b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/go.sum new file mode 100644 index 000000000000..b69f2e56da0f --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/metric.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/metric.go new file mode 100644 index 000000000000..55965a2392ae --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/export/metric/metric.go @@ -0,0 +1,445 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:generate stringer -type=ExportKind + +package metric // import "go.opentelemetry.io/otel/sdk/export/metric" + +import ( + "context" + "sync" + "time" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/number" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/resource" +) + +// Processor is responsible for deciding which kind of aggregation to +// use (via AggregatorSelector), gathering exported results from the +// SDK during collection, and deciding over which dimensions to group +// the exported data. +// +// The SDK supports binding only one of these interfaces, as it has +// the sole responsibility of determining which Aggregator to use for +// each record. +// +// The embedded AggregatorSelector interface is called (concurrently) +// in instrumentation context to select the appropriate Aggregator for +// an instrument. +// +// The `Process` method is called during collection in a +// single-threaded context from the SDK, after the aggregator is +// checkpointed, allowing the processor to build the set of metrics +// currently being exported. +type Processor interface { + // AggregatorSelector is responsible for selecting the + // concrete type of Aggregator used for a metric in the SDK. + // + // This may be a static decision based on fields of the + // Descriptor, or it could use an external configuration + // source to customize the treatment of each metric + // instrument. + // + // The result from AggregatorSelector.AggregatorFor should be + // the same type for a given Descriptor or else nil. The same + // type should be returned for a given descriptor, because + // Aggregators only know how to Merge with their own type. If + // the result is nil, the metric instrument will be disabled. + // + // Note that the SDK only calls AggregatorFor when new records + // require an Aggregator. This does not provide a way to + // disable metrics with active records. + AggregatorSelector + + // Process is called by the SDK once per internal record, + // passing the export Accumulation (a Descriptor, the corresponding + // Labels, and the checkpointed Aggregator). This call has no + // Context argument because it is expected to perform only + // computation. An SDK is not expected to call exporters from + // with Process, use a controller for that (see + // ./controllers/{pull,push}. + Process(accum Accumulation) error +} + +// AggregatorSelector supports selecting the kind of Aggregator to +// use at runtime for a specific metric instrument. +type AggregatorSelector interface { + // AggregatorFor allocates a variable number of aggregators of + // a kind suitable for the requested export. This method + // initializes a `...*Aggregator`, to support making a single + // allocation. + // + // When the call returns without initializing the *Aggregator + // to a non-nil value, the metric instrument is explicitly + // disabled. + // + // This must return a consistent type to avoid confusion in + // later stages of the metrics export process, i.e., when + // Merging or Checkpointing aggregators for a specific + // instrument. + // + // Note: This is context-free because the aggregator should + // not relate to the incoming context. This call should not + // block. + AggregatorFor(descriptor *metric.Descriptor, aggregator ...*Aggregator) +} + +// Checkpointer is the interface used by a Controller to coordinate +// the Processor with Accumulator(s) and Exporter(s). The +// StartCollection() and FinishCollection() methods start and finish a +// collection interval. Controllers call the Accumulator(s) during +// collection to process Accumulations. +type Checkpointer interface { + // Processor processes metric data for export. The Process + // method is bracketed by StartCollection and FinishCollection + // calls. The embedded AggregatorSelector can be called at + // any time. + Processor + + // CheckpointSet returns the current data set. This may be + // called before and after collection. The + // implementation is required to return the same value + // throughout its lifetime, since CheckpointSet exposes a + // sync.Locker interface. The caller is responsible for + // locking the CheckpointSet before initiating collection. + CheckpointSet() CheckpointSet + + // StartCollection begins a collection interval. + StartCollection() + + // FinishCollection ends a collection interval. + FinishCollection() error +} + +// Aggregator implements a specific aggregation behavior, e.g., a +// behavior to track a sequence of updates to an instrument. Sum-only +// instruments commonly use a simple Sum aggregator, but for the +// distribution instruments (ValueRecorder, ValueObserver) there are a +// number of possible aggregators with different cost and accuracy +// tradeoffs. +// +// Note that any Aggregator may be attached to any instrument--this is +// the result of the OpenTelemetry API/SDK separation. It is possible +// to attach a Sum aggregator to a ValueRecorder instrument or a +// MinMaxSumCount aggregator to a Counter instrument. +type Aggregator interface { + // Aggregation returns an Aggregation interface to access the + // current state of this Aggregator. The caller is + // responsible for synchronization and must not call any the + // other methods in this interface concurrently while using + // the Aggregation. + Aggregation() aggregation.Aggregation + + // Update receives a new measured value and incorporates it + // into the aggregation. Update() calls may be called + // concurrently. + // + // Descriptor.NumberKind() should be consulted to determine + // whether the provided number is an int64 or float64. + // + // The Context argument comes from user-level code and could be + // inspected for a `correlation.Map` or `trace.SpanContext`. + Update(ctx context.Context, number number.Number, descriptor *metric.Descriptor) error + + // SynchronizedMove is called during collection to finish one + // period of aggregation by atomically saving the + // currently-updating state into the argument Aggregator AND + // resetting the current value to the zero state. + // + // SynchronizedMove() is called concurrently with Update(). These + // two methods must be synchronized with respect to each + // other, for correctness. + // + // After saving a synchronized copy, the Aggregator can be converted + // into one or more of the interfaces in the `aggregation` sub-package, + // according to kind of Aggregator that was selected. + // + // This method will return an InconsistentAggregatorError if + // this Aggregator cannot be copied into the destination due + // to an incompatible type. + // + // This call has no Context argument because it is expected to + // perform only computation. + // + // When called with a nil `destination`, this Aggregator is reset + // and the current value is discarded. + SynchronizedMove(destination Aggregator, descriptor *metric.Descriptor) error + + // Merge combines the checkpointed state from the argument + // Aggregator into this Aggregator. Merge is not synchronized + // with respect to Update or SynchronizedMove. + // + // The owner of an Aggregator being merged is responsible for + // synchronization of both Aggregator states. + Merge(aggregator Aggregator, descriptor *metric.Descriptor) error +} + +// Subtractor is an optional interface implemented by some +// Aggregators. An Aggregator must support `Subtract()` in order to +// be configured for a Precomputed-Sum instrument (SumObserver, +// UpDownSumObserver) using a DeltaExporter. +type Subtractor interface { + // Subtract subtracts the `operand` from this Aggregator and + // outputs the value in `result`. + Subtract(operand, result Aggregator, descriptor *metric.Descriptor) error +} + +// Exporter handles presentation of the checkpoint of aggregate +// metrics. This is the final stage of a metrics export pipeline, +// where metric data are formatted for a specific system. +type Exporter interface { + // Export is called immediately after completing a collection + // pass in the SDK. + // + // The Context comes from the controller that initiated + // collection. + // + // The CheckpointSet interface refers to the Processor that just + // completed collection. + Export(ctx context.Context, checkpointSet CheckpointSet) error + + // ExportKindSelector is an interface used by the Processor + // in deciding whether to compute Delta or Cumulative + // Aggregations when passing Records to this Exporter. + ExportKindSelector +} + +// ExportKindSelector is a sub-interface of Exporter used to indicate +// whether the Processor should compute Delta or Cumulative +// Aggregations. +type ExportKindSelector interface { + // ExportKindFor should return the correct ExportKind that + // should be used when exporting data for the given metric + // instrument and Aggregator kind. + ExportKindFor(descriptor *metric.Descriptor, aggregatorKind aggregation.Kind) ExportKind +} + +// CheckpointSet allows a controller to access a complete checkpoint of +// aggregated metrics from the Processor. This is passed to the +// Exporter which may then use ForEach to iterate over the collection +// of aggregated metrics. +type CheckpointSet interface { + // ForEach iterates over aggregated checkpoints for all + // metrics that were updated during the last collection + // period. Each aggregated checkpoint returned by the + // function parameter may return an error. + // + // The ExportKindSelector argument is used to determine + // whether the Record is computed using Delta or Cumulative + // aggregation. + // + // ForEach tolerates ErrNoData silently, as this is + // expected from the Meter implementation. Any other kind + // of error will immediately halt ForEach and return + // the error to the caller. + ForEach(kindSelector ExportKindSelector, recordFunc func(Record) error) error + + // Locker supports locking the checkpoint set. Collection + // into the checkpoint set cannot take place (in case of a + // stateful processor) while it is locked. + // + // The Processor attached to the Accumulator MUST be called + // with the lock held. + sync.Locker + + // RLock acquires a read lock corresponding to this Locker. + RLock() + // RUnlock releases a read lock corresponding to this Locker. + RUnlock() +} + +// Metadata contains the common elements for exported metric data that +// are shared by the Accumulator->Processor and Processor->Exporter +// steps. +type Metadata struct { + descriptor *metric.Descriptor + labels *attribute.Set + resource *resource.Resource +} + +// Accumulation contains the exported data for a single metric instrument +// and label set, as prepared by an Accumulator for the Processor. +type Accumulation struct { + Metadata + aggregator Aggregator +} + +// Record contains the exported data for a single metric instrument +// and label set, as prepared by the Processor for the Exporter. +// This includes the effective start and end time for the aggregation. +type Record struct { + Metadata + aggregation aggregation.Aggregation + start time.Time + end time.Time +} + +// Descriptor describes the metric instrument being exported. +func (m Metadata) Descriptor() *metric.Descriptor { + return m.descriptor +} + +// Labels describes the labels associated with the instrument and the +// aggregated data. +func (m Metadata) Labels() *attribute.Set { + return m.labels +} + +// Resource contains common attributes that apply to this metric event. +func (m Metadata) Resource() *resource.Resource { + return m.resource +} + +// NewAccumulation allows Accumulator implementations to construct new +// Accumulations to send to Processors. The Descriptor, Labels, Resource, +// and Aggregator represent aggregate metric events received over a single +// collection period. +func NewAccumulation(descriptor *metric.Descriptor, labels *attribute.Set, resource *resource.Resource, aggregator Aggregator) Accumulation { + return Accumulation{ + Metadata: Metadata{ + descriptor: descriptor, + labels: labels, + resource: resource, + }, + aggregator: aggregator, + } +} + +// Aggregator returns the checkpointed aggregator. It is safe to +// access the checkpointed state without locking. +func (r Accumulation) Aggregator() Aggregator { + return r.aggregator +} + +// NewRecord allows Processor implementations to construct export +// records. The Descriptor, Labels, and Aggregator represent +// aggregate metric events received over a single collection period. +func NewRecord(descriptor *metric.Descriptor, labels *attribute.Set, resource *resource.Resource, aggregation aggregation.Aggregation, start, end time.Time) Record { + return Record{ + Metadata: Metadata{ + descriptor: descriptor, + labels: labels, + resource: resource, + }, + aggregation: aggregation, + start: start, + end: end, + } +} + +// Aggregation returns the aggregation, an interface to the record and +// its aggregator, dependent on the kind of both the input and exporter. +func (r Record) Aggregation() aggregation.Aggregation { + return r.aggregation +} + +// StartTime is the start time of the interval covered by this aggregation. +func (r Record) StartTime() time.Time { + return r.start +} + +// EndTime is the end time of the interval covered by this aggregation. +func (r Record) EndTime() time.Time { + return r.end +} + +// ExportKind indicates the kind of data exported by an exporter. +// These bits may be OR-d together when multiple exporters are in use. +type ExportKind int + +const ( + // CumulativeExportKind indicates that an Exporter expects a + // Cumulative Aggregation. + CumulativeExportKind ExportKind = 1 + + // DeltaExportKind indicates that an Exporter expects a + // Delta Aggregation. + DeltaExportKind ExportKind = 2 +) + +// Includes tests whether `kind` includes a specific kind of +// exporter. +func (kind ExportKind) Includes(has ExportKind) bool { + return kind&has != 0 +} + +// MemoryRequired returns whether an exporter of this kind requires +// memory to export correctly. +func (kind ExportKind) MemoryRequired(mkind metric.InstrumentKind) bool { + switch mkind { + case metric.ValueRecorderInstrumentKind, metric.ValueObserverInstrumentKind, + metric.CounterInstrumentKind, metric.UpDownCounterInstrumentKind: + // Delta-oriented instruments: + return kind.Includes(CumulativeExportKind) + + case metric.SumObserverInstrumentKind, metric.UpDownSumObserverInstrumentKind: + // Cumulative-oriented instruments: + return kind.Includes(DeltaExportKind) + } + // Something unexpected is happening--we could panic. This + // will become an error when the exporter tries to access a + // checkpoint, presumably, so let it be. + return false +} + +type ( + constantExportKindSelector ExportKind + statelessExportKindSelector struct{} +) + +var ( + _ ExportKindSelector = constantExportKindSelector(0) + _ ExportKindSelector = statelessExportKindSelector{} +) + +// ConstantExportKindSelector returns an ExportKindSelector that returns +// a constant ExportKind, one that is either always cumulative or always delta. +func ConstantExportKindSelector(kind ExportKind) ExportKindSelector { + return constantExportKindSelector(kind) +} + +// CumulativeExportKindSelector returns an ExportKindSelector that +// always returns CumulativeExportKind. +func CumulativeExportKindSelector() ExportKindSelector { + return ConstantExportKindSelector(CumulativeExportKind) +} + +// DeltaExportKindSelector returns an ExportKindSelector that +// always returns DeltaExportKind. +func DeltaExportKindSelector() ExportKindSelector { + return ConstantExportKindSelector(DeltaExportKind) +} + +// StatelessExportKindSelector returns an ExportKindSelector that +// always returns the ExportKind that avoids long-term memory +// requirements. +func StatelessExportKindSelector() ExportKindSelector { + return statelessExportKindSelector{} +} + +// ExportKindFor implements ExportKindSelector. +func (c constantExportKindSelector) ExportKindFor(_ *metric.Descriptor, _ aggregation.Kind) ExportKind { + return ExportKind(c) +} + +// ExportKindFor implements ExportKindSelector. +func (s statelessExportKindSelector) ExportKindFor(desc *metric.Descriptor, kind aggregation.Kind) ExportKind { + if kind == aggregation.SumKind && desc.InstrumentKind().PrecomputedSum() { + return CumulativeExportKind + } + return DeltaExportKind +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go new file mode 100644 index 000000000000..c897c04de37a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go @@ -0,0 +1,35 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package instrumentation provides an instrumentation library structure to be +passed to both the OpenTelemetry Tracer and Meter components. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track the +evolving OpenTelemetry specification and user feedback. + +For more information see +[this](https://github.com/open-telemetry/oteps/blob/main/text/0083-component.md). +*/ +package instrumentation // import "go.opentelemetry.io/otel/sdk/instrumentation" + +// Library represents the instrumentation library. +type Library struct { + // Name is the name of the instrumentation library. This should be the + // Go package name of that library. + Name string + // Version is the version of the instrumentation library. + Version string +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go new file mode 100644 index 000000000000..84a02306e64c --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go @@ -0,0 +1,37 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal // import "go.opentelemetry.io/otel/sdk/internal" + +import ( + "fmt" + "time" + + "go.opentelemetry.io/otel" +) + +// UserAgent is the user agent to be added to the outgoing +// requests from the exporters. +var UserAgent = fmt.Sprintf("opentelemetry-go/%s", otel.Version()) + +// MonotonicEndTime returns the end time at present +// but offset from start, monotonically. +// +// The monotonic clock is used in subtractions hence +// the duration since start added back to start gives +// end as a monotonic time. +// See https://golang.org/pkg/time/#hdr-Monotonic_Clocks +func MonotonicEndTime(start time.Time) time.Time { + return start.Add(time.Since(start)) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/sanitize.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/sanitize.go new file mode 100644 index 000000000000..e6d8b7d59989 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/sanitize.go @@ -0,0 +1,50 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal + +import ( + "strings" + "unicode" +) + +const labelKeySizeLimit = 100 + +// Sanitize returns a string that is trunacated to 100 characters if it's too +// long, and replaces non-alphanumeric characters to underscores. +func Sanitize(s string) string { + if len(s) == 0 { + return s + } + if len(s) > labelKeySizeLimit { + s = s[:labelKeySizeLimit] + } + s = strings.Map(sanitizeRune, s) + if unicode.IsDigit(rune(s[0])) { + s = "key_" + s + } + if s[0] == '_' { + s = "key" + s + } + return s +} + +// converts anything that is not a letter or digit to an underscore +func sanitizeRune(r rune) rune { + if unicode.IsLetter(r) || unicode.IsDigit(r) { + return r + } + // Everything else turns into an underscore + return '_' +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/LICENSE b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/aggregator.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/aggregator.go new file mode 100644 index 000000000000..afda991e8638 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/aggregator.go @@ -0,0 +1,52 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aggregator // import "go.opentelemetry.io/otel/sdk/metric/aggregator" + +import ( + "fmt" + "math" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/number" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" +) + +// NewInconsistentAggregatorError formats an error describing an attempt to +// Checkpoint or Merge different-type aggregators. The result can be unwrapped as +// an ErrInconsistentType. +func NewInconsistentAggregatorError(a1, a2 export.Aggregator) error { + return fmt.Errorf("%w: %T and %T", aggregation.ErrInconsistentType, a1, a2) +} + +// RangeTest is a common routine for testing for valid input values. +// This rejects NaN values. This rejects negative values when the +// metric instrument does not support negative values, including +// monotonic counter metrics and absolute ValueRecorder metrics. +func RangeTest(num number.Number, descriptor *metric.Descriptor) error { + numberKind := descriptor.NumberKind() + + if numberKind == number.Float64Kind && math.IsNaN(num.AsFloat64()) { + return aggregation.ErrNaNInput + } + + switch descriptor.InstrumentKind() { + case metric.CounterInstrumentKind, metric.SumObserverInstrumentKind: + if num.IsNegative(numberKind) { + return aggregation.ErrNegativeInput + } + } + return nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/exact/exact.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/exact/exact.go new file mode 100644 index 000000000000..c2c7adaf2565 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/exact/exact.go @@ -0,0 +1,130 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package exact // import "go.opentelemetry.io/otel/sdk/metric/aggregator/exact" + +import ( + "context" + "sync" + "time" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/number" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/aggregator" +) + +type ( + // Aggregator aggregates events that form a distribution, keeping + // an array with the exact set of values. + Aggregator struct { + lock sync.Mutex + samples []aggregation.Point + } +) + +var _ export.Aggregator = &Aggregator{} +var _ aggregation.Points = &Aggregator{} +var _ aggregation.Count = &Aggregator{} + +// New returns cnt many new exact aggregators, which aggregate recorded +// measurements by storing them in an array. This type uses a mutex +// for Update() and SynchronizedMove() concurrency. +func New(cnt int) []Aggregator { + return make([]Aggregator, cnt) +} + +// Aggregation returns an interface for reading the state of this aggregator. +func (c *Aggregator) Aggregation() aggregation.Aggregation { + return c +} + +// Kind returns aggregation.ExactKind. +func (c *Aggregator) Kind() aggregation.Kind { + return aggregation.ExactKind +} + +// Count returns the number of values in the checkpoint. +func (c *Aggregator) Count() (uint64, error) { + return uint64(len(c.samples)), nil +} + +// Points returns access to the raw data set. +func (c *Aggregator) Points() ([]aggregation.Point, error) { + return c.samples, nil +} + +// SynchronizedMove saves the current state to oa and resets the current state to +// the empty set, taking a lock to prevent concurrent Update() calls. +func (c *Aggregator) SynchronizedMove(oa export.Aggregator, desc *metric.Descriptor) error { + o, _ := oa.(*Aggregator) + + if oa != nil && o == nil { + return aggregator.NewInconsistentAggregatorError(c, oa) + } + + c.lock.Lock() + defer c.lock.Unlock() + + if o != nil { + o.samples = c.samples + } + c.samples = nil + + return nil +} + +// Update adds the recorded measurement to the current data set. +// Update takes a lock to prevent concurrent Update() and SynchronizedMove() +// calls. +func (c *Aggregator) Update(_ context.Context, number number.Number, desc *metric.Descriptor) error { + now := time.Now() + c.lock.Lock() + defer c.lock.Unlock() + c.samples = append(c.samples, aggregation.Point{ + Number: number, + Time: now, + }) + + return nil +} + +// Merge combines two data sets into one. +func (c *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error { + o, _ := oa.(*Aggregator) + if o == nil { + return aggregator.NewInconsistentAggregatorError(c, oa) + } + + c.samples = combine(c.samples, o.samples) + return nil +} + +func combine(a, b []aggregation.Point) []aggregation.Point { + result := make([]aggregation.Point, 0, len(a)+len(b)) + + for len(a) != 0 && len(b) != 0 { + if a[0].Time.Before(b[0].Time) { + result = append(result, a[0]) + a = a[1:] + } else { + result = append(result, b[0]) + b = b[1:] + } + } + result = append(result, a...) + result = append(result, b...) + return result +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/histogram/histogram.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/histogram/histogram.go new file mode 100644 index 000000000000..ea3ecdbb5b23 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/histogram/histogram.go @@ -0,0 +1,270 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package histogram // import "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" + +import ( + "context" + "sort" + "sync" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/number" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/aggregator" +) + +// Note: This code uses a Mutex to govern access to the exclusive +// aggregator state. This is in contrast to a lock-free approach +// (as in the Go prometheus client) that was reverted here: +// https://github.com/open-telemetry/opentelemetry-go/pull/669 + +type ( + // Aggregator observe events and counts them in pre-determined buckets. + // It also calculates the sum and count of all events. + Aggregator struct { + lock sync.Mutex + boundaries []float64 + kind number.Kind + state *state + } + + // config describes how the histogram is aggregated. + config struct { + // explicitBoundaries support arbitrary bucketing schemes. This + // is the general case. + explicitBoundaries []float64 + } + + // Option configures a histogram config. + Option interface { + // apply sets one or more config fields. + apply(*config) + } + + // state represents the state of a histogram, consisting of + // the sum and counts for all observed values and + // the less than equal bucket count for the pre-determined boundaries. + state struct { + bucketCounts []uint64 + sum number.Number + count uint64 + } +) + +// WithExplicitBoundaries sets the ExplicitBoundaries configuration option of a config. +func WithExplicitBoundaries(explicitBoundaries []float64) Option { + return explicitBoundariesOption{explicitBoundaries} +} + +type explicitBoundariesOption struct { + boundaries []float64 +} + +func (o explicitBoundariesOption) apply(config *config) { + config.explicitBoundaries = o.boundaries +} + +// defaultExplicitBoundaries have been copied from prometheus.DefBuckets. +// +// Note we anticipate the use of a high-precision histogram sketch as +// the standard histogram aggregator for OTLP export. +// (https://github.com/open-telemetry/opentelemetry-specification/issues/982). +var defaultFloat64ExplicitBoundaries = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10} + +// defaultInt64ExplicitBoundaryMultiplier determines the default +// integer histogram boundaries. +const defaultInt64ExplicitBoundaryMultiplier = 1e6 + +// defaultInt64ExplicitBoundaries applies a multiplier to the default +// float64 boundaries: [ 5K, 10K, 25K, ..., 2.5M, 5M, 10M ] +var defaultInt64ExplicitBoundaries = func(bounds []float64) (asint []float64) { + for _, f := range bounds { + asint = append(asint, defaultInt64ExplicitBoundaryMultiplier*f) + } + return +}(defaultFloat64ExplicitBoundaries) + +var _ export.Aggregator = &Aggregator{} +var _ aggregation.Sum = &Aggregator{} +var _ aggregation.Count = &Aggregator{} +var _ aggregation.Histogram = &Aggregator{} + +// New returns a new aggregator for computing Histograms. +// +// A Histogram observe events and counts them in pre-defined buckets. +// And also provides the total sum and count of all observations. +// +// Note that this aggregator maintains each value using independent +// atomic operations, which introduces the possibility that +// checkpoints are inconsistent. +func New(cnt int, desc *metric.Descriptor, opts ...Option) []Aggregator { + var cfg config + + if desc.NumberKind() == number.Int64Kind { + cfg.explicitBoundaries = defaultInt64ExplicitBoundaries + } else { + cfg.explicitBoundaries = defaultFloat64ExplicitBoundaries + } + + for _, opt := range opts { + opt.apply(&cfg) + } + + aggs := make([]Aggregator, cnt) + + // Boundaries MUST be ordered otherwise the histogram could not + // be properly computed. + sortedBoundaries := make([]float64, len(cfg.explicitBoundaries)) + + copy(sortedBoundaries, cfg.explicitBoundaries) + sort.Float64s(sortedBoundaries) + + for i := range aggs { + aggs[i] = Aggregator{ + kind: desc.NumberKind(), + boundaries: sortedBoundaries, + } + aggs[i].state = aggs[i].newState() + } + return aggs +} + +// Aggregation returns an interface for reading the state of this aggregator. +func (c *Aggregator) Aggregation() aggregation.Aggregation { + return c +} + +// Kind returns aggregation.HistogramKind. +func (c *Aggregator) Kind() aggregation.Kind { + return aggregation.HistogramKind +} + +// Sum returns the sum of all values in the checkpoint. +func (c *Aggregator) Sum() (number.Number, error) { + return c.state.sum, nil +} + +// Count returns the number of values in the checkpoint. +func (c *Aggregator) Count() (uint64, error) { + return c.state.count, nil +} + +// Histogram returns the count of events in pre-determined buckets. +func (c *Aggregator) Histogram() (aggregation.Buckets, error) { + return aggregation.Buckets{ + Boundaries: c.boundaries, + Counts: c.state.bucketCounts, + }, nil +} + +// SynchronizedMove saves the current state into oa and resets the current state to +// the empty set. Since no locks are taken, there is a chance that +// the independent Sum, Count and Bucket Count are not consistent with each +// other. +func (c *Aggregator) SynchronizedMove(oa export.Aggregator, desc *metric.Descriptor) error { + o, _ := oa.(*Aggregator) + + if oa != nil && o == nil { + return aggregator.NewInconsistentAggregatorError(c, oa) + } + + if o != nil { + // Swap case: This is the ordinary case for a + // synchronous instrument, where the SDK allocates two + // Aggregators and lock contention is anticipated. + // Reset the target state before swapping it under the + // lock below. + o.clearState() + } + + c.lock.Lock() + if o != nil { + c.state, o.state = o.state, c.state + } else { + // No swap case: This is the ordinary case for an + // asynchronous instrument, where the SDK allocates a + // single Aggregator and there is no anticipated lock + // contention. + c.clearState() + } + c.lock.Unlock() + + return nil +} + +func (c *Aggregator) newState() *state { + return &state{ + bucketCounts: make([]uint64, len(c.boundaries)+1), + } +} + +func (c *Aggregator) clearState() { + for i := range c.state.bucketCounts { + c.state.bucketCounts[i] = 0 + } + c.state.sum = 0 + c.state.count = 0 +} + +// Update adds the recorded measurement to the current data set. +func (c *Aggregator) Update(_ context.Context, number number.Number, desc *metric.Descriptor) error { + kind := desc.NumberKind() + asFloat := number.CoerceToFloat64(kind) + + bucketID := len(c.boundaries) + for i, boundary := range c.boundaries { + if asFloat < boundary { + bucketID = i + break + } + } + // Note: Binary-search was compared using the benchmarks. The following + // code is equivalent to the linear search above: + // + // bucketID := sort.Search(len(c.boundaries), func(i int) bool { + // return asFloat < c.boundaries[i] + // }) + // + // The binary search wins for very large boundary sets, but + // the linear search performs better up through arrays between + // 256 and 512 elements, which is a relatively large histogram, so we + // continue to prefer linear search. + + c.lock.Lock() + defer c.lock.Unlock() + + c.state.count++ + c.state.sum.AddNumber(kind, number) + c.state.bucketCounts[bucketID]++ + + return nil +} + +// Merge combines two histograms that have the same buckets into a single one. +func (c *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error { + o, _ := oa.(*Aggregator) + if o == nil { + return aggregator.NewInconsistentAggregatorError(c, oa) + } + + c.state.sum.AddNumber(desc.NumberKind(), o.state.sum) + c.state.count += o.state.count + + for i := 0; i < len(c.state.bucketCounts); i++ { + c.state.bucketCounts[i] += o.state.bucketCounts[i] + } + return nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue/lastvalue.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue/lastvalue.go new file mode 100644 index 000000000000..3cc5f7055cfd --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue/lastvalue.go @@ -0,0 +1,135 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lastvalue // import "go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue" + +import ( + "context" + "sync/atomic" + "time" + "unsafe" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/number" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/aggregator" +) + +type ( + + // Aggregator aggregates lastValue events. + Aggregator struct { + // value is an atomic pointer to *lastValueData. It is never nil. + value unsafe.Pointer + } + + // lastValueData stores the current value of a lastValue along with + // a sequence number to determine the winner of a race. + lastValueData struct { + // value is the int64- or float64-encoded Set() data + // + // value needs to be aligned for 64-bit atomic operations. + value number.Number + + // timestamp indicates when this record was submitted. + // this can be used to pick a winner when multiple + // records contain lastValue data for the same labels due + // to races. + timestamp time.Time + } +) + +var _ export.Aggregator = &Aggregator{} +var _ aggregation.LastValue = &Aggregator{} + +// An unset lastValue has zero timestamp and zero value. +var unsetLastValue = &lastValueData{} + +// New returns a new lastValue aggregator. This aggregator retains the +// last value and timestamp that were recorded. +func New(cnt int) []Aggregator { + aggs := make([]Aggregator, cnt) + for i := range aggs { + aggs[i] = Aggregator{ + value: unsafe.Pointer(unsetLastValue), + } + } + return aggs +} + +// Aggregation returns an interface for reading the state of this aggregator. +func (g *Aggregator) Aggregation() aggregation.Aggregation { + return g +} + +// Kind returns aggregation.LastValueKind. +func (g *Aggregator) Kind() aggregation.Kind { + return aggregation.LastValueKind +} + +// LastValue returns the last-recorded lastValue value and the +// corresponding timestamp. The error value aggregation.ErrNoData +// will be returned if (due to a race condition) the checkpoint was +// computed before the first value was set. +func (g *Aggregator) LastValue() (number.Number, time.Time, error) { + gd := (*lastValueData)(g.value) + if gd == unsetLastValue { + return 0, time.Time{}, aggregation.ErrNoData + } + return gd.value.AsNumber(), gd.timestamp, nil +} + +// SynchronizedMove atomically saves the current value. +func (g *Aggregator) SynchronizedMove(oa export.Aggregator, _ *metric.Descriptor) error { + if oa == nil { + atomic.StorePointer(&g.value, unsafe.Pointer(unsetLastValue)) + return nil + } + o, _ := oa.(*Aggregator) + if o == nil { + return aggregator.NewInconsistentAggregatorError(g, oa) + } + o.value = atomic.SwapPointer(&g.value, unsafe.Pointer(unsetLastValue)) + return nil +} + +// Update atomically sets the current "last" value. +func (g *Aggregator) Update(_ context.Context, number number.Number, desc *metric.Descriptor) error { + ngd := &lastValueData{ + value: number, + timestamp: time.Now(), + } + atomic.StorePointer(&g.value, unsafe.Pointer(ngd)) + return nil +} + +// Merge combines state from two aggregators. The most-recently set +// value is chosen. +func (g *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error { + o, _ := oa.(*Aggregator) + if o == nil { + return aggregator.NewInconsistentAggregatorError(g, oa) + } + + ggd := (*lastValueData)(atomic.LoadPointer(&g.value)) + ogd := (*lastValueData)(atomic.LoadPointer(&o.value)) + + if ggd.timestamp.After(ogd.timestamp) { + return nil + } + + g.value = unsafe.Pointer(ogd) + return nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount/mmsc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount/mmsc.go new file mode 100644 index 000000000000..e21fd75ab736 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount/mmsc.go @@ -0,0 +1,165 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package minmaxsumcount // import "go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount" + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/number" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/aggregator" +) + +type ( + // Aggregator aggregates events that form a distribution, + // keeping only the min, max, sum, and count. + Aggregator struct { + lock sync.Mutex + kind number.Kind + state + } + + state struct { + sum number.Number + min number.Number + max number.Number + count uint64 + } +) + +var _ export.Aggregator = &Aggregator{} +var _ aggregation.MinMaxSumCount = &Aggregator{} + +// New returns a new aggregator for computing the min, max, sum, and +// count. +// +// This type uses a mutex for Update() and SynchronizedMove() concurrency. +func New(cnt int, desc *metric.Descriptor) []Aggregator { + kind := desc.NumberKind() + aggs := make([]Aggregator, cnt) + for i := range aggs { + aggs[i] = Aggregator{ + kind: kind, + state: emptyState(kind), + } + } + return aggs +} + +// Aggregation returns an interface for reading the state of this aggregator. +func (c *Aggregator) Aggregation() aggregation.Aggregation { + return c +} + +// Kind returns aggregation.MinMaxSumCountKind. +func (c *Aggregator) Kind() aggregation.Kind { + return aggregation.MinMaxSumCountKind +} + +// Sum returns the sum of values in the checkpoint. +func (c *Aggregator) Sum() (number.Number, error) { + return c.sum, nil +} + +// Count returns the number of values in the checkpoint. +func (c *Aggregator) Count() (uint64, error) { + return c.count, nil +} + +// Min returns the minimum value in the checkpoint. +// The error value aggregation.ErrNoData will be returned +// if there were no measurements recorded during the checkpoint. +func (c *Aggregator) Min() (number.Number, error) { + if c.count == 0 { + return 0, aggregation.ErrNoData + } + return c.min, nil +} + +// Max returns the maximum value in the checkpoint. +// The error value aggregation.ErrNoData will be returned +// if there were no measurements recorded during the checkpoint. +func (c *Aggregator) Max() (number.Number, error) { + if c.count == 0 { + return 0, aggregation.ErrNoData + } + return c.max, nil +} + +// SynchronizedMove saves the current state into oa and resets the current state to +// the empty set. +func (c *Aggregator) SynchronizedMove(oa export.Aggregator, desc *metric.Descriptor) error { + o, _ := oa.(*Aggregator) + + if oa != nil && o == nil { + return aggregator.NewInconsistentAggregatorError(c, oa) + } + c.lock.Lock() + if o != nil { + o.state = c.state + } + c.state = emptyState(c.kind) + c.lock.Unlock() + + return nil +} + +func emptyState(kind number.Kind) state { + return state{ + count: 0, + sum: 0, + min: kind.Maximum(), + max: kind.Minimum(), + } +} + +// Update adds the recorded measurement to the current data set. +func (c *Aggregator) Update(_ context.Context, number number.Number, desc *metric.Descriptor) error { + kind := desc.NumberKind() + + c.lock.Lock() + defer c.lock.Unlock() + c.count++ + c.sum.AddNumber(kind, number) + if number.CompareNumber(kind, c.min) < 0 { + c.min = number + } + if number.CompareNumber(kind, c.max) > 0 { + c.max = number + } + return nil +} + +// Merge combines two data sets into one. +func (c *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error { + o, _ := oa.(*Aggregator) + if o == nil { + return aggregator.NewInconsistentAggregatorError(c, oa) + } + + c.count += o.count + c.sum.AddNumber(desc.NumberKind(), o.sum) + + if c.min.CompareNumber(desc.NumberKind(), o.min) > 0 { + c.min.SetNumber(o.min) + } + if c.max.CompareNumber(desc.NumberKind(), o.max) < 0 { + c.max.SetNumber(o.max) + } + return nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/sum/sum.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/sum/sum.go new file mode 100644 index 000000000000..fc96ddb4cbad --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/sum/sum.go @@ -0,0 +1,106 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package sum // import "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" + +import ( + "context" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/number" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/metric/aggregator" +) + +// Aggregator aggregates counter events. +type Aggregator struct { + // current holds current increments to this counter record + // current needs to be aligned for 64-bit atomic operations. + value number.Number +} + +var _ export.Aggregator = &Aggregator{} +var _ export.Subtractor = &Aggregator{} +var _ aggregation.Sum = &Aggregator{} + +// New returns a new counter aggregator implemented by atomic +// operations. This aggregator implements the aggregation.Sum +// export interface. +func New(cnt int) []Aggregator { + return make([]Aggregator, cnt) +} + +// Aggregation returns an interface for reading the state of this aggregator. +func (c *Aggregator) Aggregation() aggregation.Aggregation { + return c +} + +// Kind returns aggregation.SumKind. +func (c *Aggregator) Kind() aggregation.Kind { + return aggregation.SumKind +} + +// Sum returns the last-checkpointed sum. This will never return an +// error. +func (c *Aggregator) Sum() (number.Number, error) { + return c.value, nil +} + +// SynchronizedMove atomically saves the current value into oa and resets the +// current sum to zero. +func (c *Aggregator) SynchronizedMove(oa export.Aggregator, _ *metric.Descriptor) error { + if oa == nil { + c.value.SetRawAtomic(0) + return nil + } + o, _ := oa.(*Aggregator) + if o == nil { + return aggregator.NewInconsistentAggregatorError(c, oa) + } + o.value = c.value.SwapNumberAtomic(number.Number(0)) + return nil +} + +// Update atomically adds to the current value. +func (c *Aggregator) Update(_ context.Context, num number.Number, desc *metric.Descriptor) error { + c.value.AddNumberAtomic(desc.NumberKind(), num) + return nil +} + +// Merge combines two counters by adding their sums. +func (c *Aggregator) Merge(oa export.Aggregator, desc *metric.Descriptor) error { + o, _ := oa.(*Aggregator) + if o == nil { + return aggregator.NewInconsistentAggregatorError(c, oa) + } + c.value.AddNumber(desc.NumberKind(), o.value) + return nil +} + +func (c *Aggregator) Subtract(opAgg, resAgg export.Aggregator, descriptor *metric.Descriptor) error { + op, _ := opAgg.(*Aggregator) + if op == nil { + return aggregator.NewInconsistentAggregatorError(c, opAgg) + } + + res, _ := resAgg.(*Aggregator) + if res == nil { + return aggregator.NewInconsistentAggregatorError(c, resAgg) + } + + res.value = c.value + res.value.AddNumber(descriptor.NumberKind(), number.NewNumberSignChange(descriptor.NumberKind(), op.value)) + return nil +} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/build_info_pre_1.12.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/atomicfields.go similarity index 56% rename from cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/build_info_pre_1.12.go rename to cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/atomicfields.go index 6609e2877c0b..bcb56b7eaa17 100644 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/build_info_pre_1.12.go +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/atomicfields.go @@ -1,9 +1,10 @@ -// Copyright 2019 The Prometheus Authors +// Copyright The OpenTelemetry Authors +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -11,12 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build !go1.12 +package metric // import "go.opentelemetry.io/otel/sdk/metric" -package prometheus +import "unsafe" -// readBuildInfo is a wrapper around debug.ReadBuildInfo for Go versions before -// 1.12. Remove this whole file once the minimum supported Go version is 1.12. -func readBuildInfo() (path, version, sum string) { - return "unknown", "unknown", "unknown" +func AtomicFieldOffsets() map[string]uintptr { + return map[string]uintptr{ + "record.refMapped.value": unsafe.Offsetof(record{}.refMapped.value), + "record.updateCount": unsafe.Offsetof(record{}.updateCount), + } } diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/config.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/config.go new file mode 100644 index 000000000000..87be85b90006 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/config.go @@ -0,0 +1,122 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package basic // import "go.opentelemetry.io/otel/sdk/metric/controller/basic" + +import ( + "time" + + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/resource" +) + +// Config contains configuration for a basic Controller. +type Config struct { + // Resource is the OpenTelemetry resource associated with all Meters + // created by the Controller. + Resource *resource.Resource + + // CollectPeriod is the interval between calls to Collect a + // checkpoint. + // + // When pulling metrics and not exporting, this is the minimum + // time between calls to Collect. In a pull-only + // configuration, collection is performed on demand; set + // CollectPeriod to 0 always recompute the export record set. + // + // When exporting metrics, this must be > 0. + // + // Default value is 10s. + CollectPeriod time.Duration + + // CollectTimeout is the timeout of the Context passed to + // Collect() and subsequently to Observer instrument callbacks. + // + // Default value is 10s. If zero, no Collect timeout is applied. + CollectTimeout time.Duration + + // Exporter is used for exporting metric data. + // + // Note: Exporters such as Prometheus that pull data do not implement + // export.Exporter. These will directly call Collect() and ForEach(). + Exporter export.Exporter + + // PushTimeout is the timeout of the Context when a exporter is configured. + // + // Default value is 10s. If zero, no Export timeout is applied. + PushTimeout time.Duration +} + +// Option is the interface that applies the value to a configuration option. +type Option interface { + // Apply sets the Option value of a Config. + Apply(*Config) +} + +// WithResource sets the Resource configuration option of a Config by merging it +// with the Resource configuration in the environment. +func WithResource(r *resource.Resource) Option { + res := resource.Merge(resource.Environment(), r) + return resourceOption{res} +} + +type resourceOption struct{ *resource.Resource } + +func (o resourceOption) Apply(config *Config) { + config.Resource = o.Resource +} + +// WithCollectPeriod sets the CollectPeriod configuration option of a Config. +func WithCollectPeriod(period time.Duration) Option { + return collectPeriodOption(period) +} + +type collectPeriodOption time.Duration + +func (o collectPeriodOption) Apply(config *Config) { + config.CollectPeriod = time.Duration(o) +} + +// WithCollectTimeout sets the CollectTimeout configuration option of a Config. +func WithCollectTimeout(timeout time.Duration) Option { + return collectTimeoutOption(timeout) +} + +type collectTimeoutOption time.Duration + +func (o collectTimeoutOption) Apply(config *Config) { + config.CollectTimeout = time.Duration(o) +} + +// WithExporter sets the exporter configuration option of a Config. +func WithExporter(exporter export.Exporter) Option { + return exporterOption{exporter} +} + +type exporterOption struct{ exporter export.Exporter } + +func (o exporterOption) Apply(config *Config) { + config.Exporter = o.exporter +} + +// WithPushTimeout sets the PushTimeout configuration option of a Config. +func WithPushTimeout(timeout time.Duration) Option { + return pushTimeoutOption(timeout) +} + +type pushTimeoutOption time.Duration + +func (o pushTimeoutOption) Apply(config *Config) { + config.PushTimeout = time.Duration(o) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/controller.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/controller.go new file mode 100644 index 000000000000..9a2e12777b4c --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/controller.go @@ -0,0 +1,312 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package basic // import "go.opentelemetry.io/otel/sdk/metric/controller/basic" + +import ( + "context" + "fmt" + "sync" + "time" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/registry" + export "go.opentelemetry.io/otel/sdk/export/metric" + sdk "go.opentelemetry.io/otel/sdk/metric" + controllerTime "go.opentelemetry.io/otel/sdk/metric/controller/time" + "go.opentelemetry.io/otel/sdk/resource" +) + +// DefaultPeriod is used for: +// +// - the minimum time between calls to Collect() +// - the timeout for Export() +// - the timeout for Collect(). +const DefaultPeriod = 10 * time.Second + +// ErrControllerStarted indicates that a controller was started more +// than once. +var ErrControllerStarted = fmt.Errorf("controller already started") + +// Controller organizes and synchronizes collection of metric data in +// both "pull" and "push" configurations. This supports two distinct +// modes: +// +// - Push and Pull: Start() must be called to begin calling the exporter; +// Collect() is called periodically by a background thread after starting +// the controller. +// - Pull-Only: Start() is optional in this case, to call Collect periodically. +// If Start() is not called, Collect() can be called manually to initiate +// collection +// +// The controller supports mixing push and pull access to metric data +// using the export.CheckpointSet RWLock interface. Collection will +// be blocked by a pull request in the basic controller. +type Controller struct { + lock sync.Mutex + accumulator *sdk.Accumulator + provider *registry.MeterProvider + checkpointer export.Checkpointer + exporter export.Exporter + wg sync.WaitGroup + stopCh chan struct{} + clock controllerTime.Clock + ticker controllerTime.Ticker + + collectPeriod time.Duration + collectTimeout time.Duration + pushTimeout time.Duration + + // collectedTime is used only in configurations with no + // exporter, when ticker != nil. + collectedTime time.Time +} + +// New constructs a Controller using the provided checkpointer and +// options (including optional exporter) to configure a metric +// export pipeline. +func New(checkpointer export.Checkpointer, opts ...Option) *Controller { + c := &Config{ + CollectPeriod: DefaultPeriod, + CollectTimeout: DefaultPeriod, + PushTimeout: DefaultPeriod, + } + for _, opt := range opts { + opt.Apply(c) + } + if c.Resource == nil { + c.Resource = resource.Default() + } + + impl := sdk.NewAccumulator( + checkpointer, + c.Resource, + ) + return &Controller{ + provider: registry.NewMeterProvider(impl), + accumulator: impl, + checkpointer: checkpointer, + exporter: c.Exporter, + stopCh: nil, + clock: controllerTime.RealClock{}, + + collectPeriod: c.CollectPeriod, + collectTimeout: c.CollectTimeout, + pushTimeout: c.PushTimeout, + } +} + +// SetClock supports setting a mock clock for testing. This must be +// called before Start(). +func (c *Controller) SetClock(clock controllerTime.Clock) { + c.lock.Lock() + defer c.lock.Unlock() + c.clock = clock +} + +// MeterProvider returns a MeterProvider instance for this controller. +func (c *Controller) MeterProvider() metric.MeterProvider { + return c.provider +} + +// Start begins a ticker that periodically collects and exports +// metrics with the configured interval. This is required for calling +// a configured Exporter (see WithExporter) and is otherwise optional +// when only pulling metric data. +// +// The passed context is passed to Collect() and subsequently to +// asynchronous instrument callbacks. Returns an error when the +// controller was already started. +// +// Note that it is not necessary to Start a controller when only +// pulling data; use the Collect() and ForEach() methods directly in +// this case. +func (c *Controller) Start(ctx context.Context) error { + c.lock.Lock() + defer c.lock.Unlock() + + if c.stopCh != nil { + return ErrControllerStarted + } + + c.wg.Add(1) + c.stopCh = make(chan struct{}) + c.ticker = c.clock.Ticker(c.collectPeriod) + go c.runTicker(ctx, c.stopCh) + return nil +} + +// Stop waits for the background goroutine to return and then collects +// and exports metrics one last time before returning. The passed +// context is passed to the final Collect() and subsequently to the +// final asynchronous instruments. +// +// Note that Stop() will not cancel an ongoing collection or export. +func (c *Controller) Stop(ctx context.Context) error { + c.lock.Lock() + defer c.lock.Unlock() + + if c.stopCh == nil { + return nil + } + + close(c.stopCh) + c.stopCh = nil + c.wg.Wait() + c.ticker.Stop() + c.ticker = nil + + return c.collect(ctx) +} + +// runTicker collection on ticker events until the stop channel is closed. +func (c *Controller) runTicker(ctx context.Context, stopCh chan struct{}) { + defer c.wg.Done() + for { + select { + case <-stopCh: + return + case <-c.ticker.C(): + if err := c.collect(ctx); err != nil { + otel.Handle(err) + } + } + } +} + +// collect computes a checkpoint and optionally exports it. +func (c *Controller) collect(ctx context.Context) error { + if err := c.checkpoint(ctx, func() bool { + return true + }); err != nil { + return err + } + if c.exporter == nil { + return nil + } + // Note: this is not subject to collectTimeout. This blocks the next + // collection despite collectTimeout because it holds a lock. + if err := c.export(ctx); err != nil { + return err + } + return nil +} + +// checkpoint calls the Accumulator and Checkpointer interfaces to +// compute the CheckpointSet. This applies the configured collection +// timeout. Note that this does not try to cancel a Collect or Export +// when Stop() is called. +func (c *Controller) checkpoint(ctx context.Context, cond func() bool) error { + ckpt := c.checkpointer.CheckpointSet() + ckpt.Lock() + defer ckpt.Unlock() + + if !cond() { + return nil + } + c.checkpointer.StartCollection() + + if c.collectTimeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, c.collectTimeout) + defer cancel() + } + + _ = c.accumulator.Collect(ctx) + + var err error + select { + case <-ctx.Done(): + err = ctx.Err() + default: + // The context wasn't done, ok. + } + + // Finish the checkpoint whether the accumulator timed out or not. + if cerr := c.checkpointer.FinishCollection(); cerr != nil { + if err == nil { + err = cerr + } else { + err = fmt.Errorf("%s: %w", cerr.Error(), err) + } + } + + return err +} + +// export calls the exporter with a read lock on the CheckpointSet, +// applying the configured export timeout. +func (c *Controller) export(ctx context.Context) error { + ckpt := c.checkpointer.CheckpointSet() + ckpt.RLock() + defer ckpt.RUnlock() + + if c.pushTimeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, c.pushTimeout) + defer cancel() + } + + return c.exporter.Export(ctx, ckpt) +} + +// Foreach gives the caller read-locked access to the current +// export.CheckpointSet. +func (c *Controller) ForEach(ks export.ExportKindSelector, f func(export.Record) error) error { + ckpt := c.checkpointer.CheckpointSet() + ckpt.RLock() + defer ckpt.RUnlock() + + return ckpt.ForEach(ks, f) +} + +// IsRunning returns true if the controller was started via Start(), +// indicating that the current export.CheckpointSet is being kept +// up-to-date. +func (c *Controller) IsRunning() bool { + c.lock.Lock() + defer c.lock.Unlock() + return c.ticker != nil +} + +// Collect requests a collection. The collection will be skipped if +// the last collection is aged less than the configured collection +// period. +func (c *Controller) Collect(ctx context.Context) error { + if c.IsRunning() { + // When there's a non-nil ticker, there's a goroutine + // computing checkpoints with the collection period. + return ErrControllerStarted + } + + return c.checkpoint(ctx, c.shouldCollect) +} + +// shouldCollect returns true if the collector should collect now, +// based on the timestamp, the last collection time, and the +// configured period. +func (c *Controller) shouldCollect() bool { + // This is called with the CheckpointSet exclusive + // lock held. + if c.collectPeriod == 0 { + return true + } + now := c.clock.Now() + if now.Sub(c.collectedTime) < c.collectPeriod { + return false + } + c.collectedTime = now + return true +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/time/time.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/time/time.go new file mode 100644 index 000000000000..08bc44dbf735 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/controller/time/time.go @@ -0,0 +1,59 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package time // import "go.opentelemetry.io/otel/sdk/metric/controller/time" + +import ( + "time" + lib "time" +) + +// Several types below are created to match "github.com/benbjohnson/clock" +// so that it remains a test-only dependency. + +type Clock interface { + Now() lib.Time + Ticker(duration lib.Duration) Ticker +} + +type Ticker interface { + Stop() + C() <-chan lib.Time +} + +type RealClock struct { +} + +type RealTicker struct { + ticker *lib.Ticker +} + +var _ Clock = RealClock{} +var _ Ticker = RealTicker{} + +func (RealClock) Now() time.Time { + return time.Now() +} + +func (RealClock) Ticker(period time.Duration) Ticker { + return RealTicker{time.NewTicker(period)} +} + +func (t RealTicker) Stop() { + t.ticker.Stop() +} + +func (t RealTicker) C() <-chan time.Time { + return t.ticker.C +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go new file mode 100644 index 000000000000..c6ac21c497ab --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/doc.go @@ -0,0 +1,141 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package metric implements the OpenTelemetry metric API. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track the +evolving OpenTelemetry specification and user feedback. + +The Accumulator type supports configurable metrics export behavior through a +collection of export interfaces that support various export strategies, +described below. + +The OpenTelemetry metric API consists of methods for constructing synchronous +and asynchronous instruments. There are two constructors per instrument for +the two kinds of number (int64, float64). + +Synchronous instruments are managed by a sync.Map containing a *record +with the current state for each synchronous instrument. A bound +instrument encapsulates a direct pointer to the record, allowing +bound metric events to bypass a sync.Map lookup. A lock-free +algorithm is used to protect against races when adding and removing +items from the sync.Map. + +Asynchronous instruments are managed by an internal +AsyncInstrumentState, which coordinates calling batch and single +instrument callbacks. + +Internal Structure + +Each observer also has its own kind of record stored in the SDK. This +record contains a set of recorders for every specific label set used in the +callback. + +A sync.Map maintains the mapping of current instruments and label sets to +internal records. To create a new bound instrument, the SDK consults the Map to +locate an existing record, otherwise it constructs a new record. The SDK +maintains a count of the number of references to each record, ensuring +that records are not reclaimed from the Map while they are still active +from the user's perspective. + +Metric collection is performed via a single-threaded call to Collect that +sweeps through all records in the SDK, checkpointing their state. When a +record is discovered that has no references and has not been updated since +the prior collection pass, it is removed from the Map. + +Both synchronous and asynchronous instruments have an associated +aggregator, which maintains the current state resulting from all metric +events since its last checkpoint. Aggregators may be lock-free or they may +use locking, but they should expect to be called concurrently. Aggregators +must be capable of merging with another aggregator of the same type. + +Export Pipeline + +While the SDK serves to maintain a current set of records and +coordinate collection, the behavior of a metrics export pipeline is +configured through the export types in +go.opentelemetry.io/otel/sdk/export/metric. It is important to keep +in mind the context these interfaces are called from. There are two +contexts, instrumentation context, where a user-level goroutine that +enters the SDK resulting in a new record, and collection context, +where a system-level thread performs a collection pass through the +SDK. + +Descriptor is a struct that describes the metric instrument to the +export pipeline, containing the name, units, description, metric kind, +number kind (int64 or float64). A Descriptor accompanies metric data +as it passes through the export pipeline. + +The AggregatorSelector interface supports choosing the method of +aggregation to apply to a particular instrument, by delegating the +construction of an Aggregator to this interface. Given the Descriptor, +the AggregatorFor method returns an implementation of Aggregator. If this +interface returns nil, the metric will be disabled. The aggregator should +be matched to the capabilities of the exporter. Selecting the aggregator +for Adding instruments is relatively straightforward, but many options +are available for aggregating distributions from Grouping instruments. + +Aggregator is an interface which implements a concrete strategy for +aggregating metric updates. Several Aggregator implementations are +provided by the SDK. Aggregators may be lock-free or use locking, +depending on their structure and semantics. Aggregators implement an +Update method, called in instrumentation context, to receive a single +metric event. Aggregators implement a Checkpoint method, called in +collection context, to save a checkpoint of the current state. +Aggregators implement a Merge method, also called in collection +context, that combines state from two aggregators into one. Each SDK +record has an associated aggregator. + +Processor is an interface which sits between the SDK and an exporter. +The Processor embeds an AggregatorSelector, used by the SDK to assign +new Aggregators. The Processor supports a Process() API for submitting +checkpointed aggregators to the processor, and a CheckpointSet() API +for producing a complete checkpoint for the exporter. Two default +Processor implementations are provided, the "defaultkeys" Processor groups +aggregate metrics by their recommended Descriptor.Keys(), the +"simple" Processor aggregates metrics at full dimensionality. + +LabelEncoder is an optional optimization that allows an exporter to +provide the serialization logic for labels. This allows avoiding +duplicate serialization of labels, once as a unique key in the SDK (or +Processor) and once in the exporter. + +CheckpointSet is an interface between the Processor and the Exporter. +After completing a collection pass, the Processor.CheckpointSet() method +returns a CheckpointSet, which the Exporter uses to iterate over all +the updated metrics. + +Record is a struct containing the state of an individual exported +metric. This is the result of one collection interface for one +instrument and one label set. + +Labels is a struct containing an ordered set of labels, the +corresponding unique encoding, and the encoder that produced it. + +Exporter is the final stage of an export pipeline. It is called with +a CheckpointSet capable of enumerating all the updated metrics. + +Controller is not an export interface per se, but it orchestrates the +export pipeline. For example, a "push" controller will establish a +periodic timer to regularly collect and export metrics. A "pull" +controller will await a pull request before initiating metric +collection. Either way, the job of the controller is to call the SDK +Collect() method, then read the checkpoint, then invoke the exporter. +Controllers are expected to implement the public metric.MeterProvider +API, meaning they can be installed as the global Meter provider. + +*/ +package metric // import "go.opentelemetry.io/otel/sdk/metric" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/go.mod b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/go.mod new file mode 100644 index 000000000000..6ad529662cf2 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/go.mod @@ -0,0 +1,56 @@ +module go.opentelemetry.io/otel/sdk/metric + +go 1.14 + +replace go.opentelemetry.io/otel => ../.. + +replace go.opentelemetry.io/otel/bridge/opencensus => ../../bridge/opencensus + +replace go.opentelemetry.io/otel/bridge/opentracing => ../../bridge/opentracing + +replace go.opentelemetry.io/otel/example/jaeger => ../../example/jaeger + +replace go.opentelemetry.io/otel/example/namedtracer => ../../example/namedtracer + +replace go.opentelemetry.io/otel/example/opencensus => ../../example/opencensus + +replace go.opentelemetry.io/otel/example/otel-collector => ../../example/otel-collector + +replace go.opentelemetry.io/otel/example/prom-collector => ../../example/prom-collector + +replace go.opentelemetry.io/otel/example/prometheus => ../../example/prometheus + +replace go.opentelemetry.io/otel/example/zipkin => ../../example/zipkin + +replace go.opentelemetry.io/otel/exporters/metric/prometheus => ../../exporters/metric/prometheus + +replace go.opentelemetry.io/otel/exporters/otlp => ../../exporters/otlp + +replace go.opentelemetry.io/otel/exporters/stdout => ../../exporters/stdout + +replace go.opentelemetry.io/otel/exporters/trace/jaeger => ../../exporters/trace/jaeger + +replace go.opentelemetry.io/otel/exporters/trace/zipkin => ../../exporters/trace/zipkin + +replace go.opentelemetry.io/otel/internal/tools => ../../internal/tools + +replace go.opentelemetry.io/otel/metric => ../../metric + +replace go.opentelemetry.io/otel/oteltest => ../../oteltest + +replace go.opentelemetry.io/otel/sdk => ../ + +replace go.opentelemetry.io/otel/sdk/export/metric => ../export/metric + +replace go.opentelemetry.io/otel/sdk/metric => ./ + +replace go.opentelemetry.io/otel/trace => ../../trace + +require ( + github.com/benbjohnson/clock v1.0.3 // do not upgrade to v1.1.x because it would require Go >= 1.15 + github.com/stretchr/testify v1.7.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/export/metric v0.20.0 +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/go.sum b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/go.sum new file mode 100644 index 000000000000..dcd830455045 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/go.sum @@ -0,0 +1,17 @@ +github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/basic.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/basic.go new file mode 100644 index 000000000000..39d1972dc9bc --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/basic.go @@ -0,0 +1,377 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package basic // import "go.opentelemetry.io/otel/sdk/metric/processor/basic" + +import ( + "errors" + "fmt" + "sync" + "time" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" + "go.opentelemetry.io/otel/sdk/resource" +) + +type ( + Processor struct { + export.ExportKindSelector + export.AggregatorSelector + + state + } + + stateKey struct { + // TODO: This code is organized to support multiple + // accumulators which could theoretically produce the + // data for the same instrument with the same + // resources, and this code has logic to combine data + // properly from multiple accumulators. However, the + // use of *metric.Descriptor in the stateKey makes + // such combination impossible, because each + // accumulator allocates its own instruments. This + // can be fixed by using the instrument name and kind + // instead of the descriptor pointer. See + // https://github.com/open-telemetry/opentelemetry-go/issues/862. + descriptor *metric.Descriptor + distinct attribute.Distinct + resource attribute.Distinct + } + + stateValue struct { + // labels corresponds to the stateKey.distinct field. + labels *attribute.Set + + // resource corresponds to the stateKey.resource field. + resource *resource.Resource + + // updated indicates the last sequence number when this value had + // Process() called by an accumulator. + updated int64 + + // stateful indicates that a cumulative aggregation is + // being maintained, taken from the process start time. + stateful bool + + // currentOwned indicates that "current" was allocated + // by the processor in order to merge results from + // multiple Accumulators during a single collection + // round, which may happen either because: + // (1) multiple Accumulators output the same Accumulation. + // (2) one Accumulator is configured with dimensionality reduction. + currentOwned bool + + // current refers to the output from a single Accumulator + // (if !currentOwned) or it refers to an Aggregator + // owned by the processor used to accumulate multiple + // values in a single collection round. + current export.Aggregator + + // delta, if non-nil, refers to an Aggregator owned by + // the processor used to compute deltas between + // precomputed sums. + delta export.Aggregator + + // cumulative, if non-nil, refers to an Aggregator owned + // by the processor used to store the last cumulative + // value. + cumulative export.Aggregator + } + + state struct { + config Config + + // RWMutex implements locking for the `CheckpointSet` interface. + sync.RWMutex + values map[stateKey]*stateValue + + // Note: the timestamp logic currently assumes all + // exports are deltas. + + processStart time.Time + intervalStart time.Time + intervalEnd time.Time + + // startedCollection and finishedCollection are the + // number of StartCollection() and FinishCollection() + // calls, used to ensure that the sequence of starts + // and finishes are correctly balanced. + + startedCollection int64 + finishedCollection int64 + } +) + +var _ export.Processor = &Processor{} +var _ export.Checkpointer = &Processor{} +var _ export.CheckpointSet = &state{} +var ErrInconsistentState = fmt.Errorf("inconsistent processor state") +var ErrInvalidExportKind = fmt.Errorf("invalid export kind") + +// New returns a basic Processor that is also a Checkpointer using the provided +// AggregatorSelector to select Aggregators. The ExportKindSelector +// is consulted to determine the kind(s) of exporter that will consume +// data, so that this Processor can prepare to compute Delta or +// Cumulative Aggregations as needed. +func New(aselector export.AggregatorSelector, eselector export.ExportKindSelector, opts ...Option) *Processor { + now := time.Now() + p := &Processor{ + AggregatorSelector: aselector, + ExportKindSelector: eselector, + state: state{ + values: map[stateKey]*stateValue{}, + processStart: now, + intervalStart: now, + }, + } + for _, opt := range opts { + opt.ApplyProcessor(&p.config) + } + return p +} + +// Process implements export.Processor. +func (b *Processor) Process(accum export.Accumulation) error { + if b.startedCollection != b.finishedCollection+1 { + return ErrInconsistentState + } + desc := accum.Descriptor() + key := stateKey{ + descriptor: desc, + distinct: accum.Labels().Equivalent(), + resource: accum.Resource().Equivalent(), + } + agg := accum.Aggregator() + + // Check if there is an existing value. + value, ok := b.state.values[key] + if !ok { + stateful := b.ExportKindFor(desc, agg.Aggregation().Kind()).MemoryRequired(desc.InstrumentKind()) + + newValue := &stateValue{ + labels: accum.Labels(), + resource: accum.Resource(), + updated: b.state.finishedCollection, + stateful: stateful, + current: agg, + } + if stateful { + if desc.InstrumentKind().PrecomputedSum() { + // If we know we need to compute deltas, allocate two aggregators. + b.AggregatorFor(desc, &newValue.cumulative, &newValue.delta) + } else { + // In this case we are certain not to need a delta, only allocate + // a cumulative aggregator. + b.AggregatorFor(desc, &newValue.cumulative) + } + } + b.state.values[key] = newValue + return nil + } + + // Advance the update sequence number. + sameCollection := b.state.finishedCollection == value.updated + value.updated = b.state.finishedCollection + + // At this point in the code, we have located an existing + // value for some stateKey. This can be because: + // + // (a) stateful aggregation is being used, the entry was + // entered during a prior collection, and this is the first + // time processing an accumulation for this stateKey in the + // current collection. Since this is the first time + // processing an accumulation for this stateKey during this + // collection, we don't know yet whether there are multiple + // accumulators at work. If there are multiple accumulators, + // they'll hit case (b) the second time through. + // + // (b) multiple accumulators are being used, whether stateful + // or not. + // + // Case (a) occurs when the instrument and the exporter + // require memory to work correctly, either because the + // instrument reports a PrecomputedSum to a DeltaExporter or + // the reverse, a non-PrecomputedSum instrument with a + // CumulativeExporter. This logic is encapsulated in + // ExportKind.MemoryRequired(InstrumentKind). + // + // Case (b) occurs when the variable `sameCollection` is true, + // indicating that the stateKey for Accumulation has already + // been seen in the same collection. When this happens, it + // implies that multiple Accumulators are being used, or that + // a single Accumulator has been configured with a label key + // filter. + + if !sameCollection { + if !value.currentOwned { + // This is the first Accumulation we've seen + // for this stateKey during this collection. + // Just keep a reference to the Accumulator's + // Aggregator. All the other cases copy + // Aggregator state. + value.current = agg + return nil + } + return agg.SynchronizedMove(value.current, desc) + } + + // If the current is not owned, take ownership of a copy + // before merging below. + if !value.currentOwned { + tmp := value.current + b.AggregatorSelector.AggregatorFor(desc, &value.current) + value.currentOwned = true + if err := tmp.SynchronizedMove(value.current, desc); err != nil { + return err + } + } + + // Combine this Accumulation with the prior Accumulation. + return value.current.Merge(agg, desc) +} + +// CheckpointSet returns the associated CheckpointSet. Use the +// CheckpointSet Locker interface to synchronize access to this +// object. The CheckpointSet.ForEach() method cannot be called +// concurrently with Process(). +func (b *Processor) CheckpointSet() export.CheckpointSet { + return &b.state +} + +// StartCollection signals to the Processor one or more Accumulators +// will begin calling Process() calls during collection. +func (b *Processor) StartCollection() { + if b.startedCollection != 0 { + b.intervalStart = b.intervalEnd + } + b.startedCollection++ +} + +// FinishCollection signals to the Processor that a complete +// collection has finished and that ForEach will be called to access +// the CheckpointSet. +func (b *Processor) FinishCollection() error { + b.intervalEnd = time.Now() + if b.startedCollection != b.finishedCollection+1 { + return ErrInconsistentState + } + defer func() { b.finishedCollection++ }() + + for key, value := range b.values { + mkind := key.descriptor.InstrumentKind() + stale := value.updated != b.finishedCollection + stateless := !value.stateful + + // The following branch updates stateful aggregators. Skip + // these updates if the aggregator is not stateful or if the + // aggregator is stale. + if stale || stateless { + // If this processor does not require memeory, + // stale, stateless entries can be removed. + // This implies that they were not updated + // over the previous full collection interval. + if stale && stateless && !b.config.Memory { + delete(b.values, key) + } + continue + } + + // Update Aggregator state to support exporting either a + // delta or a cumulative aggregation. + var err error + if mkind.PrecomputedSum() { + if currentSubtractor, ok := value.current.(export.Subtractor); ok { + // This line is equivalent to: + // value.delta = currentSubtractor - value.cumulative + err = currentSubtractor.Subtract(value.cumulative, value.delta, key.descriptor) + + if err == nil { + err = value.current.SynchronizedMove(value.cumulative, key.descriptor) + } + } else { + err = aggregation.ErrNoSubtraction + } + } else { + // This line is equivalent to: + // value.cumulative = value.cumulative + value.delta + err = value.cumulative.Merge(value.current, key.descriptor) + } + if err != nil { + return err + } + } + return nil +} + +// ForEach iterates through the CheckpointSet, passing an +// export.Record with the appropriate Cumulative or Delta aggregation +// to an exporter. +func (b *state) ForEach(exporter export.ExportKindSelector, f func(export.Record) error) error { + if b.startedCollection != b.finishedCollection { + return ErrInconsistentState + } + for key, value := range b.values { + mkind := key.descriptor.InstrumentKind() + + var agg aggregation.Aggregation + var start time.Time + + // If the processor does not have Config.Memory and it was not updated + // in the prior round, do not visit this value. + if !b.config.Memory && value.updated != (b.finishedCollection-1) { + continue + } + + ekind := exporter.ExportKindFor(key.descriptor, value.current.Aggregation().Kind()) + switch ekind { + case export.CumulativeExportKind: + // If stateful, the sum has been computed. If stateless, the + // input was already cumulative. Either way, use the checkpointed + // value: + if value.stateful { + agg = value.cumulative.Aggregation() + } else { + agg = value.current.Aggregation() + } + start = b.processStart + + case export.DeltaExportKind: + // Precomputed sums are a special case. + if mkind.PrecomputedSum() { + agg = value.delta.Aggregation() + } else { + agg = value.current.Aggregation() + } + start = b.intervalStart + + default: + return fmt.Errorf("%v: %w", ekind, ErrInvalidExportKind) + } + + if err := f(export.NewRecord( + key.descriptor, + value.labels, + value.resource, + agg, + start, + b.intervalEnd, + )); err != nil && !errors.Is(err, aggregation.ErrNoData) { + return err + } + } + return nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/config.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/config.go new file mode 100644 index 000000000000..bf9d976c809e --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/config.go @@ -0,0 +1,42 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package basic // import "go.opentelemetry.io/otel/sdk/metric/processor/basic" + +// Config contains the options for configuring a basic metric processor. +type Config struct { + // Memory controls whether the processor remembers metric + // instruments and label sets that were previously reported. + // When Memory is true, CheckpointSet.ForEach() will visit + // metrics that were not updated in the most recent interval. + Memory bool +} + +type Option interface { + ApplyProcessor(*Config) +} + +// WithMemory sets the memory behavior of a Processor. If this is +// true, the processor will report metric instruments and label sets +// that were previously reported but not updated in the most recent +// interval. +func WithMemory(memory bool) Option { + return memoryOption(memory) +} + +type memoryOption bool + +func (m memoryOption) ApplyProcessor(config *Config) { + config.Memory = bool(m) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/refcount_mapped.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/refcount_mapped.go new file mode 100644 index 000000000000..9abfb9cca703 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/refcount_mapped.go @@ -0,0 +1,59 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/sdk/metric" + +import ( + "sync/atomic" +) + +// refcountMapped atomically counts the number of references (usages) of an entry +// while also keeping a state of mapped/unmapped into a different data structure +// (an external map or list for example). +// +// refcountMapped uses an atomic value where the least significant bit is used to +// keep the state of mapping ('1' is used for unmapped and '0' is for mapped) and +// the rest of the bits are used for refcounting. +type refcountMapped struct { + // refcount has to be aligned for 64-bit atomic operations. + value int64 +} + +// ref returns true if the entry is still mapped and increases the +// reference usages, if unmapped returns false. +func (rm *refcountMapped) ref() bool { + // Check if this entry was marked as unmapped between the moment + // we got a reference to it (or will be removed very soon) and here. + return atomic.AddInt64(&rm.value, 2)&1 == 0 +} + +func (rm *refcountMapped) unref() { + atomic.AddInt64(&rm.value, -2) +} + +// tryUnmap flips the mapped bit to "unmapped" state and returns true if both of the +// following conditions are true upon entry to this function: +// * There are no active references; +// * The mapped bit is in "mapped" state. +// Otherwise no changes are done to mapped bit and false is returned. +func (rm *refcountMapped) tryUnmap() bool { + if atomic.LoadInt64(&rm.value) != 0 { + return false + } + return atomic.CompareAndSwapInt64( + &rm.value, + 0, + 1, + ) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/sdk.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/sdk.go new file mode 100644 index 000000000000..268fa742da78 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/sdk.go @@ -0,0 +1,555 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/sdk/metric" + +import ( + "context" + "fmt" + "runtime" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + internal "go.opentelemetry.io/otel/internal/metric" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/number" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/metric/aggregator" + "go.opentelemetry.io/otel/sdk/resource" +) + +type ( + // Accumulator implements the OpenTelemetry Meter API. The + // Accumulator is bound to a single export.Processor in + // `NewAccumulator()`. + // + // The Accumulator supports a Collect() API to gather and export + // current data. Collect() should be arranged according to + // the processor model. Push-based processors will setup a + // timer to call Collect() periodically. Pull-based processors + // will call Collect() when a pull request arrives. + Accumulator struct { + // current maps `mapkey` to *record. + current sync.Map + + // asyncInstruments is a set of + // `*asyncInstrument` instances + asyncLock sync.Mutex + asyncInstruments *internal.AsyncInstrumentState + + // currentEpoch is the current epoch number. It is + // incremented in `Collect()`. + currentEpoch int64 + + // processor is the configured processor+configuration. + processor export.Processor + + // collectLock prevents simultaneous calls to Collect(). + collectLock sync.Mutex + + // asyncSortSlice has a single purpose - as a temporary + // place for sorting during labels creation to avoid + // allocation. It is cleared after use. + asyncSortSlice attribute.Sortable + + // resource is applied to all records in this Accumulator. + resource *resource.Resource + } + + syncInstrument struct { + instrument + } + + // mapkey uniquely describes a metric instrument in terms of + // its InstrumentID and the encoded form of its labels. + mapkey struct { + descriptor *metric.Descriptor + ordered attribute.Distinct + } + + // record maintains the state of one metric instrument. Due + // the use of lock-free algorithms, there may be more than one + // `record` in existence at a time, although at most one can + // be referenced from the `Accumulator.current` map. + record struct { + // refMapped keeps track of refcounts and the mapping state to the + // Accumulator.current map. + refMapped refcountMapped + + // updateCount is incremented on every Update. + updateCount int64 + + // collectedCount is set to updateCount on collection, + // supports checking for no updates during a round. + collectedCount int64 + + // storage is the stored label set for this record, + // except in cases where a label set is shared due to + // batch recording. + storage attribute.Set + + // labels is the processed label set for this record. + // this may refer to the `storage` field in another + // record if this label set is shared resulting from + // `RecordBatch`. + labels *attribute.Set + + // sortSlice has a single purpose - as a temporary + // place for sorting during labels creation to avoid + // allocation. + sortSlice attribute.Sortable + + // inst is a pointer to the corresponding instrument. + inst *syncInstrument + + // current implements the actual RecordOne() API, + // depending on the type of aggregation. If nil, the + // metric was disabled by the exporter. + current export.Aggregator + checkpoint export.Aggregator + } + + instrument struct { + meter *Accumulator + descriptor metric.Descriptor + } + + asyncInstrument struct { + instrument + // recorders maps ordered labels to the pair of + // labelset and recorder + recorders map[attribute.Distinct]*labeledRecorder + } + + labeledRecorder struct { + observedEpoch int64 + labels *attribute.Set + observed export.Aggregator + } +) + +var ( + _ metric.MeterImpl = &Accumulator{} + _ metric.AsyncImpl = &asyncInstrument{} + _ metric.SyncImpl = &syncInstrument{} + _ metric.BoundSyncImpl = &record{} + + ErrUninitializedInstrument = fmt.Errorf("use of an uninitialized instrument") +) + +func (inst *instrument) Descriptor() metric.Descriptor { + return inst.descriptor +} + +func (a *asyncInstrument) Implementation() interface{} { + return a +} + +func (s *syncInstrument) Implementation() interface{} { + return s +} + +func (a *asyncInstrument) observe(num number.Number, labels *attribute.Set) { + if err := aggregator.RangeTest(num, &a.descriptor); err != nil { + otel.Handle(err) + return + } + recorder := a.getRecorder(labels) + if recorder == nil { + // The instrument is disabled according to the + // AggregatorSelector. + return + } + if err := recorder.Update(context.Background(), num, &a.descriptor); err != nil { + otel.Handle(err) + return + } +} + +func (a *asyncInstrument) getRecorder(labels *attribute.Set) export.Aggregator { + lrec, ok := a.recorders[labels.Equivalent()] + if ok { + // Note: SynchronizedMove(nil) can't return an error + _ = lrec.observed.SynchronizedMove(nil, &a.descriptor) + lrec.observedEpoch = a.meter.currentEpoch + a.recorders[labels.Equivalent()] = lrec + return lrec.observed + } + var rec export.Aggregator + a.meter.processor.AggregatorFor(&a.descriptor, &rec) + if a.recorders == nil { + a.recorders = make(map[attribute.Distinct]*labeledRecorder) + } + // This may store nil recorder in the map, thus disabling the + // asyncInstrument for the labelset for good. This is intentional, + // but will be revisited later. + a.recorders[labels.Equivalent()] = &labeledRecorder{ + observed: rec, + labels: labels, + observedEpoch: a.meter.currentEpoch, + } + return rec +} + +// acquireHandle gets or creates a `*record` corresponding to `kvs`, +// the input labels. The second argument `labels` is passed in to +// support re-use of the orderedLabels computed by a previous +// measurement in the same batch. This performs two allocations +// in the common case. +func (s *syncInstrument) acquireHandle(kvs []attribute.KeyValue, labelPtr *attribute.Set) *record { + var rec *record + var equiv attribute.Distinct + + if labelPtr == nil { + // This memory allocation may not be used, but it's + // needed for the `sortSlice` field, to avoid an + // allocation while sorting. + rec = &record{} + rec.storage = attribute.NewSetWithSortable(kvs, &rec.sortSlice) + rec.labels = &rec.storage + equiv = rec.storage.Equivalent() + } else { + equiv = labelPtr.Equivalent() + } + + // Create lookup key for sync.Map (one allocation, as this + // passes through an interface{}) + mk := mapkey{ + descriptor: &s.descriptor, + ordered: equiv, + } + + if actual, ok := s.meter.current.Load(mk); ok { + // Existing record case. + existingRec := actual.(*record) + if existingRec.refMapped.ref() { + // At this moment it is guaranteed that the entry is in + // the map and will not be removed. + return existingRec + } + // This entry is no longer mapped, try to add a new entry. + } + + if rec == nil { + rec = &record{} + rec.labels = labelPtr + } + rec.refMapped = refcountMapped{value: 2} + rec.inst = s + + s.meter.processor.AggregatorFor(&s.descriptor, &rec.current, &rec.checkpoint) + + for { + // Load/Store: there's a memory allocation to place `mk` into + // an interface here. + if actual, loaded := s.meter.current.LoadOrStore(mk, rec); loaded { + // Existing record case. Cannot change rec here because if fail + // will try to add rec again to avoid new allocations. + oldRec := actual.(*record) + if oldRec.refMapped.ref() { + // At this moment it is guaranteed that the entry is in + // the map and will not be removed. + return oldRec + } + // This loaded entry is marked as unmapped (so Collect will remove + // it from the map immediately), try again - this is a busy waiting + // strategy to wait until Collect() removes this entry from the map. + // + // This can be improved by having a list of "Unmapped" entries for + // one time only usages, OR we can make this a blocking path and use + // a Mutex that protects the delete operation (delete only if the old + // record is associated with the key). + + // Let collector get work done to remove the entry from the map. + runtime.Gosched() + continue + } + // The new entry was added to the map, good to go. + return rec + } +} + +// The order of the input array `kvs` may be sorted after the function is called. +func (s *syncInstrument) Bind(kvs []attribute.KeyValue) metric.BoundSyncImpl { + return s.acquireHandle(kvs, nil) +} + +// The order of the input array `kvs` may be sorted after the function is called. +func (s *syncInstrument) RecordOne(ctx context.Context, num number.Number, kvs []attribute.KeyValue) { + h := s.acquireHandle(kvs, nil) + defer h.Unbind() + h.RecordOne(ctx, num) +} + +// NewAccumulator constructs a new Accumulator for the given +// processor. This Accumulator supports only a single processor. +// +// The Accumulator does not start any background process to collect itself +// periodically, this responsibility lies with the processor, typically, +// depending on the type of export. For example, a pull-based +// processor will call Collect() when it receives a request to scrape +// current metric values. A push-based processor should configure its +// own periodic collection. +func NewAccumulator(processor export.Processor, resource *resource.Resource) *Accumulator { + return &Accumulator{ + processor: processor, + asyncInstruments: internal.NewAsyncInstrumentState(), + resource: resource, + } +} + +// NewSyncInstrument implements metric.MetricImpl. +func (m *Accumulator) NewSyncInstrument(descriptor metric.Descriptor) (metric.SyncImpl, error) { + return &syncInstrument{ + instrument: instrument{ + descriptor: descriptor, + meter: m, + }, + }, nil +} + +// NewAsyncInstrument implements metric.MetricImpl. +func (m *Accumulator) NewAsyncInstrument(descriptor metric.Descriptor, runner metric.AsyncRunner) (metric.AsyncImpl, error) { + a := &asyncInstrument{ + instrument: instrument{ + descriptor: descriptor, + meter: m, + }, + } + m.asyncLock.Lock() + defer m.asyncLock.Unlock() + m.asyncInstruments.Register(a, runner) + return a, nil +} + +// Collect traverses the list of active records and observers and +// exports data for each active instrument. Collect() may not be +// called concurrently. +// +// During the collection pass, the export.Processor will receive +// one Export() call per current aggregation. +// +// Returns the number of records that were checkpointed. +func (m *Accumulator) Collect(ctx context.Context) int { + m.collectLock.Lock() + defer m.collectLock.Unlock() + + checkpointed := m.observeAsyncInstruments(ctx) + checkpointed += m.collectSyncInstruments() + m.currentEpoch++ + + return checkpointed +} + +func (m *Accumulator) collectSyncInstruments() int { + checkpointed := 0 + + m.current.Range(func(key interface{}, value interface{}) bool { + // Note: always continue to iterate over the entire + // map by returning `true` in this function. + inuse := value.(*record) + + mods := atomic.LoadInt64(&inuse.updateCount) + coll := inuse.collectedCount + + if mods != coll { + // Updates happened in this interval, + // checkpoint and continue. + checkpointed += m.checkpointRecord(inuse) + inuse.collectedCount = mods + return true + } + + // Having no updates since last collection, try to unmap: + if unmapped := inuse.refMapped.tryUnmap(); !unmapped { + // The record is referenced by a binding, continue. + return true + } + + // If any other goroutines are now trying to re-insert this + // entry in the map, they are busy calling Gosched() awaiting + // this deletion: + m.current.Delete(inuse.mapkey()) + + // There's a potential race between `LoadInt64` and + // `tryUnmap` in this function. Since this is the + // last we'll see of this record, checkpoint + mods = atomic.LoadInt64(&inuse.updateCount) + if mods != coll { + checkpointed += m.checkpointRecord(inuse) + } + return true + }) + + return checkpointed +} + +// CollectAsync implements internal.AsyncCollector. +// The order of the input array `kvs` may be sorted after the function is called. +func (m *Accumulator) CollectAsync(kv []attribute.KeyValue, obs ...metric.Observation) { + labels := attribute.NewSetWithSortable(kv, &m.asyncSortSlice) + + for _, ob := range obs { + if a := m.fromAsync(ob.AsyncImpl()); a != nil { + a.observe(ob.Number(), &labels) + } + } +} + +func (m *Accumulator) observeAsyncInstruments(ctx context.Context) int { + m.asyncLock.Lock() + defer m.asyncLock.Unlock() + + asyncCollected := 0 + + m.asyncInstruments.Run(ctx, m) + + for _, inst := range m.asyncInstruments.Instruments() { + if a := m.fromAsync(inst); a != nil { + asyncCollected += m.checkpointAsync(a) + } + } + + return asyncCollected +} + +func (m *Accumulator) checkpointRecord(r *record) int { + if r.current == nil { + return 0 + } + err := r.current.SynchronizedMove(r.checkpoint, &r.inst.descriptor) + if err != nil { + otel.Handle(err) + return 0 + } + + a := export.NewAccumulation(&r.inst.descriptor, r.labels, m.resource, r.checkpoint) + err = m.processor.Process(a) + if err != nil { + otel.Handle(err) + } + return 1 +} + +func (m *Accumulator) checkpointAsync(a *asyncInstrument) int { + if len(a.recorders) == 0 { + return 0 + } + checkpointed := 0 + for encodedLabels, lrec := range a.recorders { + lrec := lrec + epochDiff := m.currentEpoch - lrec.observedEpoch + if epochDiff == 0 { + if lrec.observed != nil { + a := export.NewAccumulation(&a.descriptor, lrec.labels, m.resource, lrec.observed) + err := m.processor.Process(a) + if err != nil { + otel.Handle(err) + } + checkpointed++ + } + } else if epochDiff > 1 { + // This is second collection cycle with no + // observations for this labelset. Remove the + // recorder. + delete(a.recorders, encodedLabels) + } + } + if len(a.recorders) == 0 { + a.recorders = nil + } + return checkpointed +} + +// RecordBatch enters a batch of metric events. +// The order of the input array `kvs` may be sorted after the function is called. +func (m *Accumulator) RecordBatch(ctx context.Context, kvs []attribute.KeyValue, measurements ...metric.Measurement) { + // Labels will be computed the first time acquireHandle is + // called. Subsequent calls to acquireHandle will re-use the + // previously computed value instead of recomputing the + // ordered labels. + var labelsPtr *attribute.Set + for i, meas := range measurements { + s := m.fromSync(meas.SyncImpl()) + if s == nil { + continue + } + h := s.acquireHandle(kvs, labelsPtr) + + // Re-use labels for the next measurement. + if i == 0 { + labelsPtr = h.labels + } + + defer h.Unbind() + h.RecordOne(ctx, meas.Number()) + } +} + +// RecordOne implements metric.SyncImpl. +func (r *record) RecordOne(ctx context.Context, num number.Number) { + if r.current == nil { + // The instrument is disabled according to the AggregatorSelector. + return + } + if err := aggregator.RangeTest(num, &r.inst.descriptor); err != nil { + otel.Handle(err) + return + } + if err := r.current.Update(ctx, num, &r.inst.descriptor); err != nil { + otel.Handle(err) + return + } + // Record was modified, inform the Collect() that things need + // to be collected while the record is still mapped. + atomic.AddInt64(&r.updateCount, 1) +} + +// Unbind implements metric.SyncImpl. +func (r *record) Unbind() { + r.refMapped.unref() +} + +func (r *record) mapkey() mapkey { + return mapkey{ + descriptor: &r.inst.descriptor, + ordered: r.labels.Equivalent(), + } +} + +// fromSync gets a sync implementation object, checking for +// uninitialized instruments and instruments created by another SDK. +func (m *Accumulator) fromSync(sync metric.SyncImpl) *syncInstrument { + if sync != nil { + if inst, ok := sync.Implementation().(*syncInstrument); ok { + return inst + } + } + otel.Handle(ErrUninitializedInstrument) + return nil +} + +// fromSync gets an async implementation object, checking for +// uninitialized instruments and instruments created by another SDK. +func (m *Accumulator) fromAsync(async metric.AsyncImpl) *asyncInstrument { + if async != nil { + if inst, ok := async.Implementation().(*asyncInstrument); ok { + return inst + } + } + otel.Handle(ErrUninitializedInstrument) + return nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/selector/simple/simple.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/selector/simple/simple.go new file mode 100644 index 000000000000..bb5760994ace --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/metric/selector/simple/simple.go @@ -0,0 +1,120 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package simple // import "go.opentelemetry.io/otel/sdk/metric/selector/simple" + +import ( + "go.opentelemetry.io/otel/metric" + export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/metric/aggregator/exact" + "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" + "go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue" + "go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount" + "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" +) + +type ( + selectorInexpensive struct{} + selectorExact struct{} + selectorHistogram struct { + options []histogram.Option + } +) + +var ( + _ export.AggregatorSelector = selectorInexpensive{} + _ export.AggregatorSelector = selectorExact{} + _ export.AggregatorSelector = selectorHistogram{} +) + +// NewWithInexpensiveDistribution returns a simple aggregator selector +// that uses minmaxsumcount aggregators for `ValueRecorder` +// instruments. This selector is faster and uses less memory than the +// others in this package because minmaxsumcount aggregators maintain +// the least information about the distribution among these choices. +func NewWithInexpensiveDistribution() export.AggregatorSelector { + return selectorInexpensive{} +} + +// NewWithExactDistribution returns a simple aggregator selector that +// uses exact aggregators for `ValueRecorder` instruments. This +// selector uses more memory than the others in this package because +// exact aggregators maintain the most information about the +// distribution among these choices. +func NewWithExactDistribution() export.AggregatorSelector { + return selectorExact{} +} + +// NewWithHistogramDistribution returns a simple aggregator selector +// that uses histogram aggregators for `ValueRecorder` instruments. +// This selector is a good default choice for most metric exporters. +func NewWithHistogramDistribution(options ...histogram.Option) export.AggregatorSelector { + return selectorHistogram{options: options} +} + +func sumAggs(aggPtrs []*export.Aggregator) { + aggs := sum.New(len(aggPtrs)) + for i := range aggPtrs { + *aggPtrs[i] = &aggs[i] + } +} + +func lastValueAggs(aggPtrs []*export.Aggregator) { + aggs := lastvalue.New(len(aggPtrs)) + for i := range aggPtrs { + *aggPtrs[i] = &aggs[i] + } +} + +func (selectorInexpensive) AggregatorFor(descriptor *metric.Descriptor, aggPtrs ...*export.Aggregator) { + switch descriptor.InstrumentKind() { + case metric.ValueObserverInstrumentKind: + lastValueAggs(aggPtrs) + case metric.ValueRecorderInstrumentKind: + aggs := minmaxsumcount.New(len(aggPtrs), descriptor) + for i := range aggPtrs { + *aggPtrs[i] = &aggs[i] + } + default: + sumAggs(aggPtrs) + } +} + +func (selectorExact) AggregatorFor(descriptor *metric.Descriptor, aggPtrs ...*export.Aggregator) { + switch descriptor.InstrumentKind() { + case metric.ValueObserverInstrumentKind: + lastValueAggs(aggPtrs) + case metric.ValueRecorderInstrumentKind: + aggs := exact.New(len(aggPtrs)) + for i := range aggPtrs { + *aggPtrs[i] = &aggs[i] + } + default: + sumAggs(aggPtrs) + } +} + +func (s selectorHistogram) AggregatorFor(descriptor *metric.Descriptor, aggPtrs ...*export.Aggregator) { + switch descriptor.InstrumentKind() { + case metric.ValueObserverInstrumentKind: + lastValueAggs(aggPtrs) + case metric.ValueRecorderInstrumentKind: + aggs := histogram.New(len(aggPtrs), descriptor, s.options...) + for i := range aggPtrs { + *aggPtrs[i] = &aggs[i] + } + default: + sumAggs(aggPtrs) + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go new file mode 100644 index 000000000000..c754e221eea4 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go @@ -0,0 +1,64 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource // import "go.opentelemetry.io/otel/sdk/resource" + +import ( + "context" + "errors" + "fmt" +) + +var ( + // ErrPartialResource is returned by a detector when complete source + // information for a Resource is unavailable or the source information + // contains invalid values that are omitted from the returned Resource. + ErrPartialResource = errors.New("partial resource") +) + +// Detector detects OpenTelemetry resource information +type Detector interface { + // Detect returns an initialized Resource based on gathered information. + // If the source information to construct a Resource contains invalid + // values, a Resource is returned with the valid parts of the source + // information used for initialization along with an appropriately + // wrapped ErrPartialResource error. + Detect(ctx context.Context) (*Resource, error) +} + +// Detect calls all input detectors sequentially and merges each result with the previous one. +// It returns the merged error too. +func Detect(ctx context.Context, detectors ...Detector) (*Resource, error) { + var autoDetectedRes *Resource + var errInfo []string + for _, detector := range detectors { + if detector == nil { + continue + } + res, err := detector.Detect(ctx) + if err != nil { + errInfo = append(errInfo, err.Error()) + if !errors.Is(err, ErrPartialResource) { + continue + } + } + autoDetectedRes = Merge(autoDetectedRes, res) + } + + var aggregatedError error + if len(errInfo) > 0 { + aggregatedError = fmt.Errorf("detecting resources: %s", errInfo) + } + return autoDetectedRes, aggregatedError +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go new file mode 100644 index 000000000000..c80ab697c6fa --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go @@ -0,0 +1,103 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource // import "go.opentelemetry.io/otel/sdk/resource" + +import ( + "context" + "fmt" + "os" + "path/filepath" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/semconv" +) + +type ( + // TelemetrySDK is a Detector that provides information about + // the OpenTelemetry SDK used. This Detector is included as a + // builtin. If these resource attributes are not wanted, use + // the WithTelemetrySDK(nil) or WithoutBuiltin() options to + // explicitly disable them. + TelemetrySDK struct{} + + // Host is a Detector that provides information about the host + // being run on. This Detector is included as a builtin. If + // these resource attributes are not wanted, use the + // WithHost(nil) or WithoutBuiltin() options to explicitly + // disable them. + Host struct{} + + stringDetector struct { + K attribute.Key + F func() (string, error) + } + + defaultServiceNameDetector struct{} +) + +var ( + _ Detector = TelemetrySDK{} + _ Detector = Host{} + _ Detector = stringDetector{} + _ Detector = defaultServiceNameDetector{} +) + +// Detect returns a *Resource that describes the OpenTelemetry SDK used. +func (TelemetrySDK) Detect(context.Context) (*Resource, error) { + return NewWithAttributes( + semconv.TelemetrySDKNameKey.String("opentelemetry"), + semconv.TelemetrySDKLanguageKey.String("go"), + semconv.TelemetrySDKVersionKey.String(otel.Version()), + ), nil +} + +// Detect returns a *Resource that describes the host being run on. +func (Host) Detect(ctx context.Context) (*Resource, error) { + return StringDetector(semconv.HostNameKey, os.Hostname).Detect(ctx) +} + +// StringDetector returns a Detector that will produce a *Resource +// containing the string as a value corresponding to k. +func StringDetector(k attribute.Key, f func() (string, error)) Detector { + return stringDetector{K: k, F: f} +} + +// Detect implements Detector. +func (sd stringDetector) Detect(ctx context.Context) (*Resource, error) { + value, err := sd.F() + if err != nil { + return nil, fmt.Errorf("%s: %w", string(sd.K), err) + } + a := sd.K.String(value) + if !a.Valid() { + return nil, fmt.Errorf("invalid attribute: %q -> %q", a.Key, a.Value.Emit()) + } + return NewWithAttributes(sd.K.String(value)), nil +} + +// Detect implements Detector +func (defaultServiceNameDetector) Detect(ctx context.Context) (*Resource, error) { + return StringDetector( + semconv.ServiceNameKey, + func() (string, error) { + executable, err := os.Executable() + if err != nil { + return "unknown_service:go", nil + } + return "unknown_service:" + filepath.Base(executable), nil + }, + ).Detect(ctx) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/config.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/config.go new file mode 100644 index 000000000000..0365caa26a87 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/config.go @@ -0,0 +1,165 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource // import "go.opentelemetry.io/otel/sdk/resource" + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" +) + +// config contains configuration for Resource creation. +type config struct { + // detectors that will be evaluated. + detectors []Detector + + // telemetrySDK is used to specify non-default + // `telemetry.sdk.*` attributes. + telemetrySDK Detector + + // HostResource is used to specify non-default `host.*` + // attributes. + host Detector + + // FromEnv is used to specify non-default OTEL_RESOURCE_ATTRIBUTES + // attributes. + fromEnv Detector +} + +// Option is the interface that applies a configuration option. +type Option interface { + // Apply sets the Option value of a config. + Apply(*config) + + // A private method to prevent users implementing the + // interface and so future additions to it will not + // violate compatibility. + private() +} + +type option struct{} + +func (option) private() {} + +// WithAttributes adds attributes to the configured Resource. +func WithAttributes(attributes ...attribute.KeyValue) Option { + return WithDetectors(detectAttributes{attributes}) +} + +type detectAttributes struct { + attributes []attribute.KeyValue +} + +func (d detectAttributes) Detect(context.Context) (*Resource, error) { + return NewWithAttributes(d.attributes...), nil +} + +// WithDetectors adds detectors to be evaluated for the configured resource. +func WithDetectors(detectors ...Detector) Option { + return detectorsOption{detectors: detectors} +} + +type detectorsOption struct { + option + detectors []Detector +} + +// Apply implements Option. +func (o detectorsOption) Apply(cfg *config) { + cfg.detectors = append(cfg.detectors, o.detectors...) +} + +// WithTelemetrySDK overrides the builtin `telemetry.sdk.*` +// attributes. Use nil to disable these attributes entirely. +func WithTelemetrySDK(d Detector) Option { + return telemetrySDKOption{Detector: d} +} + +type telemetrySDKOption struct { + option + Detector +} + +// Apply implements Option. +func (o telemetrySDKOption) Apply(cfg *config) { + cfg.telemetrySDK = o.Detector +} + +// WithHost overrides the builtin `host.*` attributes. Use nil to +// disable these attributes entirely. +func WithHost(d Detector) Option { + return hostOption{Detector: d} +} + +type hostOption struct { + option + Detector +} + +// Apply implements Option. +func (o hostOption) Apply(cfg *config) { + cfg.host = o.Detector +} + +// WithFromEnv overrides the builtin detector for +// OTEL_RESOURCE_ATTRIBUTES. Use nil to disable environment checking. +func WithFromEnv(d Detector) Option { + return fromEnvOption{Detector: d} +} + +type fromEnvOption struct { + option + Detector +} + +// Apply implements Option. +func (o fromEnvOption) Apply(cfg *config) { + cfg.fromEnv = o.Detector +} + +// WithoutBuiltin disables all the builtin detectors, including the +// telemetry.sdk.*, host.*, and the environment detector. +func WithoutBuiltin() Option { + return noBuiltinOption{} +} + +type noBuiltinOption struct { + option +} + +// Apply implements Option. +func (o noBuiltinOption) Apply(cfg *config) { + cfg.host = nil + cfg.telemetrySDK = nil + cfg.fromEnv = nil +} + +// New returns a Resource combined from the provided attributes, +// user-provided detectors and builtin detectors. +func New(ctx context.Context, opts ...Option) (*Resource, error) { + cfg := config{ + telemetrySDK: TelemetrySDK{}, + host: Host{}, + fromEnv: FromEnv{}, + } + for _, opt := range opts { + opt.Apply(&cfg) + } + detectors := append( + []Detector{cfg.telemetrySDK, cfg.host, cfg.fromEnv}, + cfg.detectors..., + ) + return Detect(ctx, detectors...) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go new file mode 100644 index 000000000000..fe34f896af51 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go @@ -0,0 +1,32 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package resource provides detecting and representing resources. +// +// This package is currently in a pre-GA phase. Backwards incompatible changes +// may be introduced in subsequent minor version releases as we work to track +// the evolving OpenTelemetry specification and user feedback. +// +// The fundamental struct is a Resource which holds identifying information +// about the entities for which telemetry is exported. +// +// To automatically construct Resources from an environment a Detector +// interface is defined. Implementations of this interface can be passed to +// the Detect function to generate a Resource from the merged information. +// +// To load a user defined Resource from the environment variable +// OTEL_RESOURCE_ATTRIBUTES the FromEnv Detector can be used. It will interpret +// the value as a list of comma delimited key/value pairs +// (e.g. `=,=,...`). +package resource // import "go.opentelemetry.io/otel/sdk/resource" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/env.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/env.go new file mode 100644 index 000000000000..defb455382b6 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/env.go @@ -0,0 +1,72 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource // import "go.opentelemetry.io/otel/sdk/resource" + +import ( + "context" + "fmt" + "os" + "strings" + + "go.opentelemetry.io/otel/attribute" +) + +// envVar is the environment variable name OpenTelemetry Resource information can be assigned to. +const envVar = "OTEL_RESOURCE_ATTRIBUTES" + +var ( + // errMissingValue is returned when a resource value is missing. + errMissingValue = fmt.Errorf("%w: missing value", ErrPartialResource) +) + +// FromEnv is a Detector that implements the Detector and collects +// resources from environment. This Detector is included as a +// builtin. If these resource attributes are not wanted, use the +// WithFromEnv(nil) or WithoutBuiltin() options to explicitly disable +// them. +type FromEnv struct{} + +// compile time assertion that FromEnv implements Detector interface +var _ Detector = FromEnv{} + +// Detect collects resources from environment +func (FromEnv) Detect(context.Context) (*Resource, error) { + attrs := strings.TrimSpace(os.Getenv(envVar)) + + if attrs == "" { + return Empty(), nil + } + return constructOTResources(attrs) +} + +func constructOTResources(s string) (*Resource, error) { + pairs := strings.Split(s, ",") + attrs := []attribute.KeyValue{} + var invalid []string + for _, p := range pairs { + field := strings.SplitN(p, "=", 2) + if len(field) != 2 { + invalid = append(invalid, p) + continue + } + k, v := strings.TrimSpace(field[0]), strings.TrimSpace(field[1]) + attrs = append(attrs, attribute.String(k, v)) + } + var err error + if len(invalid) > 0 { + err = fmt.Errorf("%w: %v", errMissingValue, invalid) + } + return NewWithAttributes(attrs...), err +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/os.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/os.go new file mode 100644 index 000000000000..816d209217af --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/os.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource // import "go.opentelemetry.io/otel/sdk/resource" + +import ( + "context" + "strings" + + "go.opentelemetry.io/otel/semconv" +) + +type osTypeDetector struct{} + +// Detect returns a *Resource that describes the operating system type the +// service is running on. +func (osTypeDetector) Detect(ctx context.Context) (*Resource, error) { + osType := runtimeOS() + + return NewWithAttributes( + semconv.OSTypeKey.String(strings.ToLower(osType)), + ), nil +} + +// WithOSType adds an attribute with the operating system type to the configured Resource. +func WithOSType() Option { + return WithDetectors(osTypeDetector{}) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/process.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/process.go new file mode 100644 index 000000000000..f15f97ec5ac9 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/process.go @@ -0,0 +1,237 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource // import "go.opentelemetry.io/otel/sdk/resource" + +import ( + "context" + "fmt" + "os" + "os/user" + "path/filepath" + "runtime" + + "go.opentelemetry.io/otel/semconv" +) + +type pidProvider func() int +type executablePathProvider func() (string, error) +type commandArgsProvider func() []string +type ownerProvider func() (*user.User, error) +type runtimeNameProvider func() string +type runtimeVersionProvider func() string +type runtimeOSProvider func() string +type runtimeArchProvider func() string + +var ( + defaultPidProvider pidProvider = os.Getpid + defaultExecutablePathProvider executablePathProvider = os.Executable + defaultCommandArgsProvider commandArgsProvider = func() []string { return os.Args } + defaultOwnerProvider ownerProvider = user.Current + defaultRuntimeNameProvider runtimeNameProvider = func() string { return runtime.Compiler } + defaultRuntimeVersionProvider runtimeVersionProvider = runtime.Version + defaultRuntimeOSProvider runtimeOSProvider = func() string { return runtime.GOOS } + defaultRuntimeArchProvider runtimeArchProvider = func() string { return runtime.GOARCH } +) + +var ( + pid = defaultPidProvider + executablePath = defaultExecutablePathProvider + commandArgs = defaultCommandArgsProvider + owner = defaultOwnerProvider + runtimeName = defaultRuntimeNameProvider + runtimeVersion = defaultRuntimeVersionProvider + runtimeOS = defaultRuntimeOSProvider + runtimeArch = defaultRuntimeArchProvider +) + +func setDefaultOSProviders() { + setOSProviders( + defaultPidProvider, + defaultExecutablePathProvider, + defaultCommandArgsProvider, + ) +} + +func setOSProviders( + pidProvider pidProvider, + executablePathProvider executablePathProvider, + commandArgsProvider commandArgsProvider, +) { + pid = pidProvider + executablePath = executablePathProvider + commandArgs = commandArgsProvider +} + +func setDefaultRuntimeProviders() { + setRuntimeProviders( + defaultRuntimeNameProvider, + defaultRuntimeVersionProvider, + defaultRuntimeOSProvider, + defaultRuntimeArchProvider, + ) +} + +func setRuntimeProviders( + runtimeNameProvider runtimeNameProvider, + runtimeVersionProvider runtimeVersionProvider, + runtimeOSProvider runtimeOSProvider, + runtimeArchProvider runtimeArchProvider, +) { + runtimeName = runtimeNameProvider + runtimeVersion = runtimeVersionProvider + runtimeOS = runtimeOSProvider + runtimeArch = runtimeArchProvider +} + +func setDefaultUserProviders() { + setUserProviders(defaultOwnerProvider) +} + +func setUserProviders(ownerProvider ownerProvider) { + owner = ownerProvider +} + +type processPIDDetector struct{} +type processExecutableNameDetector struct{} +type processExecutablePathDetector struct{} +type processCommandArgsDetector struct{} +type processOwnerDetector struct{} +type processRuntimeNameDetector struct{} +type processRuntimeVersionDetector struct{} +type processRuntimeDescriptionDetector struct{} + +// Detect returns a *Resource that describes the process identifier (PID) of the +// executing process. +func (processPIDDetector) Detect(ctx context.Context) (*Resource, error) { + return NewWithAttributes(semconv.ProcessPIDKey.Int(pid())), nil +} + +// Detect returns a *Resource that describes the name of the process executable. +func (processExecutableNameDetector) Detect(ctx context.Context) (*Resource, error) { + executableName := filepath.Base(commandArgs()[0]) + + return NewWithAttributes(semconv.ProcessExecutableNameKey.String(executableName)), nil +} + +// Detect returns a *Resource that describes the full path of the process executable. +func (processExecutablePathDetector) Detect(ctx context.Context) (*Resource, error) { + executablePath, err := executablePath() + if err != nil { + return nil, err + } + + return NewWithAttributes(semconv.ProcessExecutablePathKey.String(executablePath)), nil +} + +// Detect returns a *Resource that describes all the command arguments as received +// by the process. +func (processCommandArgsDetector) Detect(ctx context.Context) (*Resource, error) { + return NewWithAttributes(semconv.ProcessCommandArgsKey.Array(commandArgs())), nil +} + +// Detect returns a *Resource that describes the username of the user that owns the +// process. +func (processOwnerDetector) Detect(ctx context.Context) (*Resource, error) { + owner, err := owner() + if err != nil { + return nil, err + } + + return NewWithAttributes(semconv.ProcessOwnerKey.String(owner.Username)), nil +} + +// Detect returns a *Resource that describes the name of the compiler used to compile +// this process image. +func (processRuntimeNameDetector) Detect(ctx context.Context) (*Resource, error) { + return NewWithAttributes(semconv.ProcessRuntimeNameKey.String(runtimeName())), nil +} + +// Detect returns a *Resource that describes the version of the runtime of this process. +func (processRuntimeVersionDetector) Detect(ctx context.Context) (*Resource, error) { + return NewWithAttributes(semconv.ProcessRuntimeVersionKey.String(runtimeVersion())), nil +} + +// Detect returns a *Resource that describes the runtime of this process. +func (processRuntimeDescriptionDetector) Detect(ctx context.Context) (*Resource, error) { + runtimeDescription := fmt.Sprintf( + "go version %s %s/%s", runtimeVersion(), runtimeOS(), runtimeArch()) + + return NewWithAttributes( + semconv.ProcessRuntimeDescriptionKey.String(runtimeDescription), + ), nil +} + +// WithProcessPID adds an attribute with the process identifier (PID) to the +// configured Resource. +func WithProcessPID() Option { + return WithDetectors(processPIDDetector{}) +} + +// WithProcessExecutableName adds an attribute with the name of the process +// executable to the configured Resource. +func WithProcessExecutableName() Option { + return WithDetectors(processExecutableNameDetector{}) +} + +// WithProcessExecutablePath adds an attribute with the full path to the process +// executable to the configured Resource. +func WithProcessExecutablePath() Option { + return WithDetectors(processExecutablePathDetector{}) +} + +// WithProcessCommandArgs adds an attribute with all the command arguments (including +// the command/executable itself) as received by the process the configured Resource. +func WithProcessCommandArgs() Option { + return WithDetectors(processCommandArgsDetector{}) +} + +// WithProcessOwner adds an attribute with the username of the user that owns the process +// to the configured Resource. +func WithProcessOwner() Option { + return WithDetectors(processOwnerDetector{}) +} + +// WithProcessRuntimeName adds an attribute with the name of the runtime of this +// process to the configured Resource. +func WithProcessRuntimeName() Option { + return WithDetectors(processRuntimeNameDetector{}) +} + +// WithProcessRuntimeVersion adds an attribute with the version of the runtime of +// this process to the configured Resource. +func WithProcessRuntimeVersion() Option { + return WithDetectors(processRuntimeVersionDetector{}) +} + +// WithProcessRuntimeDescription adds an attribute with an additional description +// about the runtime of the process to the configured Resource. +func WithProcessRuntimeDescription() Option { + return WithDetectors(processRuntimeDescriptionDetector{}) +} + +// WithProcess adds all the Process attributes to the configured Resource. +// See individual WithProcess* functions to configure specific attributes. +func WithProcess() Option { + return WithDetectors( + processPIDDetector{}, + processExecutableNameDetector{}, + processExecutablePathDetector{}, + processCommandArgsDetector{}, + processOwnerDetector{}, + processRuntimeNameDetector{}, + processRuntimeVersionDetector{}, + processRuntimeDescriptionDetector{}, + ) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go new file mode 100644 index 000000000000..2e5d10151cc6 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go @@ -0,0 +1,196 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource // import "go.opentelemetry.io/otel/sdk/resource" + +import ( + "context" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" +) + +// Resource describes an entity about which identifying information +// and metadata is exposed. Resource is an immutable object, +// equivalent to a map from key to unique value. +// +// Resources should be passed and stored as pointers +// (`*resource.Resource`). The `nil` value is equivalent to an empty +// Resource. +type Resource struct { + attrs attribute.Set +} + +var ( + emptyResource Resource + + defaultResource *Resource = func(r *Resource, err error) *Resource { + if err != nil { + otel.Handle(err) + } + return r + }(Detect(context.Background(), defaultServiceNameDetector{}, FromEnv{}, TelemetrySDK{})) +) + +// NewWithAttributes creates a resource from attrs. If attrs contains +// duplicate keys, the last value will be used. If attrs contains any invalid +// items those items will be dropped. +func NewWithAttributes(attrs ...attribute.KeyValue) *Resource { + if len(attrs) == 0 { + return &emptyResource + } + + // Ensure attributes comply with the specification: + // https://github.com/open-telemetry/opentelemetry-specification/blob/v1.0.1/specification/common/common.md#attributes + s, _ := attribute.NewSetWithFiltered(attrs, func(kv attribute.KeyValue) bool { + return kv.Valid() + }) + + // If attrs only contains invalid entries do not allocate a new resource. + if s.Len() == 0 { + return &emptyResource + } + + return &Resource{s} //nolint +} + +// String implements the Stringer interface and provides a +// human-readable form of the resource. +// +// Avoid using this representation as the key in a map of resources, +// use Equivalent() as the key instead. +func (r *Resource) String() string { + if r == nil { + return "" + } + return r.attrs.Encoded(attribute.DefaultEncoder()) +} + +// Attributes returns a copy of attributes from the resource in a sorted order. +// To avoid allocating a new slice, use an iterator. +func (r *Resource) Attributes() []attribute.KeyValue { + if r == nil { + r = Empty() + } + return r.attrs.ToSlice() +} + +// Iter returns an interator of the Resource attributes. +// This is ideal to use if you do not want a copy of the attributes. +func (r *Resource) Iter() attribute.Iterator { + if r == nil { + r = Empty() + } + return r.attrs.Iter() +} + +// Equal returns true when a Resource is equivalent to this Resource. +func (r *Resource) Equal(eq *Resource) bool { + if r == nil { + r = Empty() + } + if eq == nil { + eq = Empty() + } + return r.Equivalent() == eq.Equivalent() +} + +// Merge creates a new resource by combining resource a and b. +// +// If there are common keys between resource a and b, then the value +// from resource b will overwrite the value from resource a, even +// if resource b's value is empty. +func Merge(a, b *Resource) *Resource { + if a == nil && b == nil { + return Empty() + } + if a == nil { + return b + } + if b == nil { + return a + } + + // Note: 'b' attributes will overwrite 'a' with last-value-wins in attribute.Key() + // Meaning this is equivalent to: append(a.Attributes(), b.Attributes()...) + mi := attribute.NewMergeIterator(b.Set(), a.Set()) + combine := make([]attribute.KeyValue, 0, a.Len()+b.Len()) + for mi.Next() { + combine = append(combine, mi.Label()) + } + return NewWithAttributes(combine...) +} + +// Empty returns an instance of Resource with no attributes. It is +// equivalent to a `nil` Resource. +func Empty() *Resource { + return &emptyResource +} + +// Default returns an instance of Resource with a default +// "service.name" and OpenTelemetrySDK attributes +func Default() *Resource { + return defaultResource +} + +// Environment returns an instance of Resource with attributes +// extracted from the OTEL_RESOURCE_ATTRIBUTES environment variable. +func Environment() *Resource { + detector := &FromEnv{} + resource, err := detector.Detect(context.Background()) + if err == nil { + otel.Handle(err) + } + return resource +} + +// Equivalent returns an object that can be compared for equality +// between two resources. This value is suitable for use as a key in +// a map. +func (r *Resource) Equivalent() attribute.Distinct { + return r.Set().Equivalent() +} + +// Set returns the equivalent *attribute.Set of this resources attributes. +func (r *Resource) Set() *attribute.Set { + if r == nil { + r = Empty() + } + return &r.attrs +} + +// MarshalJSON encodes the resource attributes as a JSON list of { "Key": +// "...", "Value": ... } pairs in order sorted by key. +func (r *Resource) MarshalJSON() ([]byte, error) { + if r == nil { + r = Empty() + } + return r.attrs.MarshalJSON() +} + +// Len returns the number of unique key-values in this Resource. +func (r *Resource) Len() int { + if r == nil { + return 0 + } + return r.attrs.Len() +} + +// Encoded returns an encoded representation of the resource. +func (r *Resource) Encoded(enc attribute.Encoder) string { + if r == nil { + return "" + } + return r.attrs.Encoded(enc) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/attributesmap.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/attributesmap.go new file mode 100644 index 000000000000..b891c8178b7a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/attributesmap.go @@ -0,0 +1,91 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import ( + "container/list" + + "go.opentelemetry.io/otel/attribute" +) + +// attributesMap is a capped map of attributes, holding the most recent attributes. +// Eviction is done via a LRU method, the oldest entry is removed to create room for a new entry. +// Updates are allowed and they refresh the usage of the key. +// +// This is based from https://github.com/hashicorp/golang-lru/blob/master/simplelru/lru.go +// With a subset of the its operations and specific for holding attribute.KeyValue +type attributesMap struct { + attributes map[attribute.Key]*list.Element + evictList *list.List + droppedCount int + capacity int +} + +func newAttributesMap(capacity int) *attributesMap { + lm := &attributesMap{ + attributes: make(map[attribute.Key]*list.Element), + evictList: list.New(), + capacity: capacity, + } + return lm +} + +func (am *attributesMap) add(kv attribute.KeyValue) { + // Check for existing item + if ent, ok := am.attributes[kv.Key]; ok { + am.evictList.MoveToFront(ent) + ent.Value = &kv + return + } + + // Add new item + entry := am.evictList.PushFront(&kv) + am.attributes[kv.Key] = entry + + // Verify size not exceeded + if am.evictList.Len() > am.capacity { + am.removeOldest() + am.droppedCount++ + } +} + +// toKeyValue copies the attributesMap into a slice of attribute.KeyValue and +// returns it. If the map is empty, a nil is returned. +// TODO: Is it more efficient to return a pointer to the slice? +func (am *attributesMap) toKeyValue() []attribute.KeyValue { + len := am.evictList.Len() + if len == 0 { + return nil + } + + attributes := make([]attribute.KeyValue, 0, len) + for ent := am.evictList.Back(); ent != nil; ent = ent.Prev() { + if value, ok := ent.Value.(*attribute.KeyValue); ok { + attributes = append(attributes, *value) + } + } + + return attributes +} + +// removeOldest removes the oldest item from the cache. +func (am *attributesMap) removeOldest() { + ent := am.evictList.Back() + if ent != nil { + am.evictList.Remove(ent) + kv := ent.Value.(*attribute.KeyValue) + delete(am.attributes, kv.Key) + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go new file mode 100644 index 000000000000..f63aa7a940f7 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go @@ -0,0 +1,328 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import ( + "context" + "runtime" + "sync" + "sync/atomic" + "time" + + "go.opentelemetry.io/otel" +) + +const ( + DefaultMaxQueueSize = 2048 + DefaultBatchTimeout = 5000 * time.Millisecond + DefaultExportTimeout = 30000 * time.Millisecond + DefaultMaxExportBatchSize = 512 +) + +type BatchSpanProcessorOption func(o *BatchSpanProcessorOptions) + +type BatchSpanProcessorOptions struct { + // MaxQueueSize is the maximum queue size to buffer spans for delayed processing. If the + // queue gets full it drops the spans. Use BlockOnQueueFull to change this behavior. + // The default value of MaxQueueSize is 2048. + MaxQueueSize int + + // BatchTimeout is the maximum duration for constructing a batch. Processor + // forcefully sends available spans when timeout is reached. + // The default value of BatchTimeout is 5000 msec. + BatchTimeout time.Duration + + // ExportTimeout specifies the maximum duration for exporting spans. If the timeout + // is reached, the export will be cancelled. + // The default value of ExportTimeout is 30000 msec. + ExportTimeout time.Duration + + // MaxExportBatchSize is the maximum number of spans to process in a single batch. + // If there are more than one batch worth of spans then it processes multiple batches + // of spans one batch after the other without any delay. + // The default value of MaxExportBatchSize is 512. + MaxExportBatchSize int + + // BlockOnQueueFull blocks onEnd() and onStart() method if the queue is full + // AND if BlockOnQueueFull is set to true. + // Blocking option should be used carefully as it can severely affect the performance of an + // application. + BlockOnQueueFull bool +} + +// batchSpanProcessor is a SpanProcessor that batches asynchronously-received +// SpanSnapshots and sends them to a trace.Exporter when complete. +type batchSpanProcessor struct { + e SpanExporter + o BatchSpanProcessorOptions + + queue chan *SpanSnapshot + dropped uint32 + + batch []*SpanSnapshot + batchMutex sync.Mutex + timer *time.Timer + stopWait sync.WaitGroup + stopOnce sync.Once + stopCh chan struct{} +} + +var _ SpanProcessor = (*batchSpanProcessor)(nil) + +// NewBatchSpanProcessor creates a new SpanProcessor that will send completed +// span batches to the exporter with the supplied options. +// +// If the exporter is nil, the span processor will preform no action. +func NewBatchSpanProcessor(exporter SpanExporter, options ...BatchSpanProcessorOption) SpanProcessor { + o := BatchSpanProcessorOptions{ + BatchTimeout: DefaultBatchTimeout, + ExportTimeout: DefaultExportTimeout, + MaxQueueSize: DefaultMaxQueueSize, + MaxExportBatchSize: DefaultMaxExportBatchSize, + } + for _, opt := range options { + opt(&o) + } + bsp := &batchSpanProcessor{ + e: exporter, + o: o, + batch: make([]*SpanSnapshot, 0, o.MaxExportBatchSize), + timer: time.NewTimer(o.BatchTimeout), + queue: make(chan *SpanSnapshot, o.MaxQueueSize), + stopCh: make(chan struct{}), + } + + bsp.stopWait.Add(1) + go func() { + defer bsp.stopWait.Done() + bsp.processQueue() + bsp.drainQueue() + }() + + return bsp +} + +// OnStart method does nothing. +func (bsp *batchSpanProcessor) OnStart(parent context.Context, s ReadWriteSpan) {} + +// OnEnd method enqueues a ReadOnlySpan for later processing. +func (bsp *batchSpanProcessor) OnEnd(s ReadOnlySpan) { + // Do not enqueue spans if we are just going to drop them. + if bsp.e == nil { + return + } + bsp.enqueue(s.Snapshot()) +} + +// Shutdown flushes the queue and waits until all spans are processed. +// It only executes once. Subsequent call does nothing. +func (bsp *batchSpanProcessor) Shutdown(ctx context.Context) error { + var err error + bsp.stopOnce.Do(func() { + wait := make(chan struct{}) + go func() { + close(bsp.stopCh) + bsp.stopWait.Wait() + if bsp.e != nil { + if err := bsp.e.Shutdown(ctx); err != nil { + otel.Handle(err) + } + } + close(wait) + }() + // Wait until the wait group is done or the context is cancelled + select { + case <-wait: + case <-ctx.Done(): + err = ctx.Err() + } + }) + return err +} + +// ForceFlush exports all ended spans that have not yet been exported. +func (bsp *batchSpanProcessor) ForceFlush(ctx context.Context) error { + var err error + if bsp.e != nil { + wait := make(chan struct{}) + go func() { + if err := bsp.exportSpans(ctx); err != nil { + otel.Handle(err) + } + close(wait) + }() + // Wait until the export is finished or the context is cancelled/timed out + select { + case <-wait: + case <-ctx.Done(): + err = ctx.Err() + } + } + return err +} + +func WithMaxQueueSize(size int) BatchSpanProcessorOption { + return func(o *BatchSpanProcessorOptions) { + o.MaxQueueSize = size + } +} + +func WithMaxExportBatchSize(size int) BatchSpanProcessorOption { + return func(o *BatchSpanProcessorOptions) { + o.MaxExportBatchSize = size + } +} + +func WithBatchTimeout(delay time.Duration) BatchSpanProcessorOption { + return func(o *BatchSpanProcessorOptions) { + o.BatchTimeout = delay + } +} + +func WithExportTimeout(timeout time.Duration) BatchSpanProcessorOption { + return func(o *BatchSpanProcessorOptions) { + o.ExportTimeout = timeout + } +} + +func WithBlocking() BatchSpanProcessorOption { + return func(o *BatchSpanProcessorOptions) { + o.BlockOnQueueFull = true + } +} + +// exportSpans is a subroutine of processing and draining the queue. +func (bsp *batchSpanProcessor) exportSpans(ctx context.Context) error { + bsp.timer.Reset(bsp.o.BatchTimeout) + + bsp.batchMutex.Lock() + defer bsp.batchMutex.Unlock() + + if bsp.o.ExportTimeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, bsp.o.ExportTimeout) + defer cancel() + } + + if len(bsp.batch) > 0 { + if err := bsp.e.ExportSpans(ctx, bsp.batch); err != nil { + return err + } + bsp.batch = bsp.batch[:0] + } + return nil +} + +// processQueue removes spans from the `queue` channel until processor +// is shut down. It calls the exporter in batches of up to MaxExportBatchSize +// waiting up to BatchTimeout to form a batch. +func (bsp *batchSpanProcessor) processQueue() { + defer bsp.timer.Stop() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + for { + select { + case <-bsp.stopCh: + return + case <-bsp.timer.C: + if err := bsp.exportSpans(ctx); err != nil { + otel.Handle(err) + } + case sd := <-bsp.queue: + bsp.batchMutex.Lock() + bsp.batch = append(bsp.batch, sd) + shouldExport := len(bsp.batch) == bsp.o.MaxExportBatchSize + bsp.batchMutex.Unlock() + if shouldExport { + if !bsp.timer.Stop() { + <-bsp.timer.C + } + if err := bsp.exportSpans(ctx); err != nil { + otel.Handle(err) + } + } + } + } +} + +// drainQueue awaits the any caller that had added to bsp.stopWait +// to finish the enqueue, then exports the final batch. +func (bsp *batchSpanProcessor) drainQueue() { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + for { + select { + case sd := <-bsp.queue: + if sd == nil { + if err := bsp.exportSpans(ctx); err != nil { + otel.Handle(err) + } + return + } + + bsp.batchMutex.Lock() + bsp.batch = append(bsp.batch, sd) + shouldExport := len(bsp.batch) == bsp.o.MaxExportBatchSize + bsp.batchMutex.Unlock() + + if shouldExport { + if err := bsp.exportSpans(ctx); err != nil { + otel.Handle(err) + } + } + default: + close(bsp.queue) + } + } +} + +func (bsp *batchSpanProcessor) enqueue(sd *SpanSnapshot) { + if !sd.SpanContext.IsSampled() { + return + } + + // This ensures the bsp.queue<- below does not panic as the + // processor shuts down. + defer func() { + x := recover() + switch err := x.(type) { + case nil: + return + case runtime.Error: + if err.Error() == "send on closed channel" { + return + } + } + panic(x) + }() + + select { + case <-bsp.stopCh: + return + default: + } + + if bsp.o.BlockOnQueueFull { + bsp.queue <- sd + return + } + + select { + case bsp.queue <- sd: + default: + atomic.AddUint32(&bsp.dropped, 1) + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/config.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/config.go new file mode 100644 index 000000000000..61a30439251f --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/config.go @@ -0,0 +1,68 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +// SpanLimits represents the limits of a span. +type SpanLimits struct { + // AttributeCountLimit is the maximum allowed span attribute count. + AttributeCountLimit int + + // EventCountLimit is the maximum allowed span event count. + EventCountLimit int + + // LinkCountLimit is the maximum allowed span link count. + LinkCountLimit int + + // AttributePerEventCountLimit is the maximum allowed attribute per span event count. + AttributePerEventCountLimit int + + // AttributePerLinkCountLimit is the maximum allowed attribute per span link count. + AttributePerLinkCountLimit int +} + +func (sl *SpanLimits) ensureDefault() { + if sl.EventCountLimit <= 0 { + sl.EventCountLimit = DefaultEventCountLimit + } + if sl.AttributeCountLimit <= 0 { + sl.AttributeCountLimit = DefaultAttributeCountLimit + } + if sl.LinkCountLimit <= 0 { + sl.LinkCountLimit = DefaultLinkCountLimit + } + if sl.AttributePerEventCountLimit <= 0 { + sl.AttributePerEventCountLimit = DefaultAttributePerEventCountLimit + } + if sl.AttributePerLinkCountLimit <= 0 { + sl.AttributePerLinkCountLimit = DefaultAttributePerLinkCountLimit + } +} + +const ( + // DefaultAttributeCountLimit is the default maximum allowed span attribute count. + DefaultAttributeCountLimit = 128 + + // DefaultEventCountLimit is the default maximum allowed span event count. + DefaultEventCountLimit = 128 + + // DefaultLinkCountLimit is the default maximum allowed span link count. + DefaultLinkCountLimit = 128 + + // DefaultAttributePerEventCountLimit is the default maximum allowed attribute per span event count. + DefaultAttributePerEventCountLimit = 128 + + // DefaultAttributePerLinkCountLimit is the default maximum allowed attribute per span link count. + DefaultAttributePerLinkCountLimit = 128 +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go new file mode 100644 index 000000000000..fd6ead864575 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go @@ -0,0 +1,25 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package trace contains support for OpenTelemetry distributed tracing. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track the +evolving OpenTelemetry specification and user feedback. + +The following assumes a basic familiarity with OpenTelemetry concepts. +See https://opentelemetry.io. +*/ +package trace // import "go.opentelemetry.io/otel/sdk/trace" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go new file mode 100644 index 000000000000..3c5817a6a02e --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +type evictedQueue struct { + queue []interface{} + capacity int + droppedCount int +} + +func newEvictedQueue(capacity int) *evictedQueue { + eq := &evictedQueue{ + capacity: capacity, + queue: make([]interface{}, 0), + } + + return eq +} + +func (eq *evictedQueue) add(value interface{}) { + if len(eq.queue) == eq.capacity { + eq.queue = eq.queue[1:] + eq.droppedCount++ + } + eq.queue = append(eq.queue, value) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go new file mode 100644 index 000000000000..e60a421cde9e --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go @@ -0,0 +1,67 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import ( + "context" + crand "crypto/rand" + "encoding/binary" + "math/rand" + "sync" + + "go.opentelemetry.io/otel/trace" +) + +// IDGenerator allows custom generators for TraceID and SpanID. +type IDGenerator interface { + NewIDs(ctx context.Context) (trace.TraceID, trace.SpanID) + NewSpanID(ctx context.Context, traceID trace.TraceID) trace.SpanID +} + +type randomIDGenerator struct { + sync.Mutex + randSource *rand.Rand +} + +var _ IDGenerator = &randomIDGenerator{} + +// NewSpanID returns a non-zero span ID from a randomly-chosen sequence. +func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.TraceID) trace.SpanID { + gen.Lock() + defer gen.Unlock() + sid := trace.SpanID{} + gen.randSource.Read(sid[:]) + return sid +} + +// NewIDs returns a non-zero trace ID and a non-zero span ID from a +// randomly-chosen sequence. +func (gen *randomIDGenerator) NewIDs(ctx context.Context) (trace.TraceID, trace.SpanID) { + gen.Lock() + defer gen.Unlock() + tid := trace.TraceID{} + gen.randSource.Read(tid[:]) + sid := trace.SpanID{} + gen.randSource.Read(sid[:]) + return tid, sid +} + +func defaultIDGenerator() IDGenerator { + gen := &randomIDGenerator{} + var rngSeed int64 + _ = binary.Read(crand.Reader, binary.LittleEndian, &rngSeed) + gen.randSource = rand.New(rand.NewSource(rngSeed)) + return gen +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go new file mode 100644 index 000000000000..601c239c0e04 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go @@ -0,0 +1,324 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import ( + "context" + "fmt" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/trace" + + "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/resource" +) + +const ( + defaultTracerName = "go.opentelemetry.io/otel/sdk/tracer" +) + +// TODO (MrAlias): unify this API option design: +// https://github.com/open-telemetry/opentelemetry-go/issues/536 + +// TracerProviderConfig +type TracerProviderConfig struct { + processors []SpanProcessor + + // sampler is the default sampler used when creating new spans. + sampler Sampler + + // idGenerator is used to generate all Span and Trace IDs when needed. + idGenerator IDGenerator + + // spanLimits defines the attribute, event, and link limits for spans. + spanLimits SpanLimits + + // resource contains attributes representing an entity that produces telemetry. + resource *resource.Resource +} + +type TracerProviderOption func(*TracerProviderConfig) + +type TracerProvider struct { + mu sync.Mutex + namedTracer map[instrumentation.Library]*tracer + spanProcessors atomic.Value + sampler Sampler + idGenerator IDGenerator + spanLimits SpanLimits + resource *resource.Resource +} + +var _ trace.TracerProvider = &TracerProvider{} + +// NewTracerProvider returns a new and configured TracerProvider. +// +// By default the returned TracerProvider is configured with: +// - a ParentBased(AlwaysSample) Sampler +// - a random number IDGenerator +// - the resource.Default() Resource +// - the default SpanLimits. +// +// The passed opts are used to override these default values and configure the +// returned TracerProvider appropriately. +func NewTracerProvider(opts ...TracerProviderOption) *TracerProvider { + o := &TracerProviderConfig{} + + for _, opt := range opts { + opt(o) + } + + ensureValidTracerProviderConfig(o) + + tp := &TracerProvider{ + namedTracer: make(map[instrumentation.Library]*tracer), + sampler: o.sampler, + idGenerator: o.idGenerator, + spanLimits: o.spanLimits, + resource: o.resource, + } + + for _, sp := range o.processors { + tp.RegisterSpanProcessor(sp) + } + + return tp +} + +// Tracer returns a Tracer with the given name and options. If a Tracer for +// the given name and options does not exist it is created, otherwise the +// existing Tracer is returned. +// +// If name is empty, DefaultTracerName is used instead. +// +// This method is safe to be called concurrently. +func (p *TracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.Tracer { + c := trace.NewTracerConfig(opts...) + + p.mu.Lock() + defer p.mu.Unlock() + if name == "" { + name = defaultTracerName + } + il := instrumentation.Library{ + Name: name, + Version: c.InstrumentationVersion, + } + t, ok := p.namedTracer[il] + if !ok { + t = &tracer{ + provider: p, + instrumentationLibrary: il, + } + p.namedTracer[il] = t + } + return t +} + +// RegisterSpanProcessor adds the given SpanProcessor to the list of SpanProcessors +func (p *TracerProvider) RegisterSpanProcessor(s SpanProcessor) { + p.mu.Lock() + defer p.mu.Unlock() + new := spanProcessorStates{} + if old, ok := p.spanProcessors.Load().(spanProcessorStates); ok { + new = append(new, old...) + } + newSpanSync := &spanProcessorState{ + sp: s, + state: &sync.Once{}, + } + new = append(new, newSpanSync) + p.spanProcessors.Store(new) +} + +// UnregisterSpanProcessor removes the given SpanProcessor from the list of SpanProcessors +func (p *TracerProvider) UnregisterSpanProcessor(s SpanProcessor) { + p.mu.Lock() + defer p.mu.Unlock() + spss := spanProcessorStates{} + old, ok := p.spanProcessors.Load().(spanProcessorStates) + if !ok || len(old) == 0 { + return + } + spss = append(spss, old...) + + // stop the span processor if it is started and remove it from the list + var stopOnce *spanProcessorState + var idx int + for i, sps := range spss { + if sps.sp == s { + stopOnce = sps + idx = i + } + } + if stopOnce != nil { + stopOnce.state.Do(func() { + if err := s.Shutdown(context.Background()); err != nil { + otel.Handle(err) + } + }) + } + if len(spss) > 1 { + copy(spss[idx:], spss[idx+1:]) + } + spss[len(spss)-1] = nil + spss = spss[:len(spss)-1] + + p.spanProcessors.Store(spss) +} + +// ForceFlush immediately exports all spans that have not yet been exported for +// all the registered span processors. +func (p *TracerProvider) ForceFlush(ctx context.Context) error { + spss, ok := p.spanProcessors.Load().(spanProcessorStates) + if !ok { + return fmt.Errorf("failed to load span processors") + } + if len(spss) == 0 { + return nil + } + + for _, sps := range spss { + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + + if err := sps.sp.ForceFlush(ctx); err != nil { + return err + } + } + return nil +} + +// Shutdown shuts down the span processors in the order they were registered. +func (p *TracerProvider) Shutdown(ctx context.Context) error { + spss, ok := p.spanProcessors.Load().(spanProcessorStates) + if !ok { + return fmt.Errorf("failed to load span processors") + } + if len(spss) == 0 { + return nil + } + + for _, sps := range spss { + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + + var err error + sps.state.Do(func() { + err = sps.sp.Shutdown(ctx) + }) + if err != nil { + return err + } + } + return nil +} + +// WithSyncer registers the exporter with the TracerProvider using a +// SimpleSpanProcessor. +func WithSyncer(e SpanExporter) TracerProviderOption { + return WithSpanProcessor(NewSimpleSpanProcessor(e)) +} + +// WithBatcher registers the exporter with the TracerProvider using a +// BatchSpanProcessor configured with the passed opts. +func WithBatcher(e SpanExporter, opts ...BatchSpanProcessorOption) TracerProviderOption { + return WithSpanProcessor(NewBatchSpanProcessor(e, opts...)) +} + +// WithSpanProcessor registers the SpanProcessor with a TracerProvider. +func WithSpanProcessor(sp SpanProcessor) TracerProviderOption { + return func(opts *TracerProviderConfig) { + opts.processors = append(opts.processors, sp) + } +} + +// WithResource returns a TracerProviderOption that will configure the +// Resource r as a TracerProvider's Resource. The configured Resource is +// referenced by all the Tracers the TracerProvider creates. It represents the +// entity producing telemetry. +// +// If this option is not used, the TracerProvider will use the +// resource.Default() Resource by default. +func WithResource(r *resource.Resource) TracerProviderOption { + return func(opts *TracerProviderConfig) { + opts.resource = resource.Merge(resource.Environment(), r) + } +} + +// WithIDGenerator returns a TracerProviderOption that will configure the +// IDGenerator g as a TracerProvider's IDGenerator. The configured IDGenerator +// is used by the Tracers the TracerProvider creates to generate new Span and +// Trace IDs. +// +// If this option is not used, the TracerProvider will use a random number +// IDGenerator by default. +func WithIDGenerator(g IDGenerator) TracerProviderOption { + return func(opts *TracerProviderConfig) { + if g != nil { + opts.idGenerator = g + } + } +} + +// WithSampler returns a TracerProviderOption that will configure the Sampler +// s as a TracerProvider's Sampler. The configured Sampler is used by the +// Tracers the TracerProvider creates to make their sampling decisions for the +// Spans they create. +// +// If this option is not used, the TracerProvider will use a +// ParentBased(AlwaysSample) Sampler by default. +func WithSampler(s Sampler) TracerProviderOption { + return func(opts *TracerProviderConfig) { + if s != nil { + opts.sampler = s + } + } +} + +// WithSpanLimits returns a TracerProviderOption that will configure the +// SpanLimits sl as a TracerProvider's SpanLimits. The configured SpanLimits +// are used used by the Tracers the TracerProvider and the Spans they create +// to limit tracing resources used. +// +// If this option is not used, the TracerProvider will use the default +// SpanLimits. +func WithSpanLimits(sl SpanLimits) TracerProviderOption { + return func(opts *TracerProviderConfig) { + opts.spanLimits = sl + } +} + +// ensureValidTracerProviderConfig ensures that given TracerProviderConfig is valid. +func ensureValidTracerProviderConfig(cfg *TracerProviderConfig) { + if cfg.sampler == nil { + cfg.sampler = ParentBased(AlwaysSample()) + } + if cfg.idGenerator == nil { + cfg.idGenerator = defaultIDGenerator() + } + cfg.spanLimits.ensureDefault() + if cfg.resource == nil { + cfg.resource = resource.Default() + } +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go new file mode 100644 index 000000000000..86fc3108dc31 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go @@ -0,0 +1,290 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import ( + "context" + "encoding/binary" + "fmt" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" +) + +// Sampler decides whether a trace should be sampled and exported. +type Sampler interface { + ShouldSample(parameters SamplingParameters) SamplingResult + Description() string +} + +// SamplingParameters contains the values passed to a Sampler. +type SamplingParameters struct { + ParentContext context.Context + TraceID trace.TraceID + Name string + Kind trace.SpanKind + Attributes []attribute.KeyValue + Links []trace.Link +} + +// SamplingDecision indicates whether a span is dropped, recorded and/or sampled. +type SamplingDecision uint8 + +// Valid sampling decisions +const ( + // Drop will not record the span and all attributes/events will be dropped + Drop SamplingDecision = iota + + // Record indicates the span's `IsRecording() == true`, but `Sampled` flag + // *must not* be set + RecordOnly + + // RecordAndSample has span's `IsRecording() == true` and `Sampled` flag + // *must* be set + RecordAndSample +) + +// SamplingResult conveys a SamplingDecision, set of Attributes and a Tracestate. +type SamplingResult struct { + Decision SamplingDecision + Attributes []attribute.KeyValue + Tracestate trace.TraceState +} + +type traceIDRatioSampler struct { + traceIDUpperBound uint64 + description string +} + +func (ts traceIDRatioSampler) ShouldSample(p SamplingParameters) SamplingResult { + psc := trace.SpanContextFromContext(p.ParentContext) + x := binary.BigEndian.Uint64(p.TraceID[0:8]) >> 1 + if x < ts.traceIDUpperBound { + return SamplingResult{ + Decision: RecordAndSample, + Tracestate: psc.TraceState(), + } + } + return SamplingResult{ + Decision: Drop, + Tracestate: psc.TraceState(), + } +} + +func (ts traceIDRatioSampler) Description() string { + return ts.description +} + +// TraceIDRatioBased samples a given fraction of traces. Fractions >= 1 will +// always sample. Fractions < 0 are treated as zero. To respect the +// parent trace's `SampledFlag`, the `TraceIDRatioBased` sampler should be used +// as a delegate of a `Parent` sampler. +//nolint:golint // golint complains about stutter of `trace.TraceIDRatioBased` +func TraceIDRatioBased(fraction float64) Sampler { + if fraction >= 1 { + return AlwaysSample() + } + + if fraction <= 0 { + fraction = 0 + } + + return &traceIDRatioSampler{ + traceIDUpperBound: uint64(fraction * (1 << 63)), + description: fmt.Sprintf("TraceIDRatioBased{%g}", fraction), + } +} + +type alwaysOnSampler struct{} + +func (as alwaysOnSampler) ShouldSample(p SamplingParameters) SamplingResult { + return SamplingResult{ + Decision: RecordAndSample, + Tracestate: trace.SpanContextFromContext(p.ParentContext).TraceState(), + } +} + +func (as alwaysOnSampler) Description() string { + return "AlwaysOnSampler" +} + +// AlwaysSample returns a Sampler that samples every trace. +// Be careful about using this sampler in a production application with +// significant traffic: a new trace will be started and exported for every +// request. +func AlwaysSample() Sampler { + return alwaysOnSampler{} +} + +type alwaysOffSampler struct{} + +func (as alwaysOffSampler) ShouldSample(p SamplingParameters) SamplingResult { + return SamplingResult{ + Decision: Drop, + Tracestate: trace.SpanContextFromContext(p.ParentContext).TraceState(), + } +} + +func (as alwaysOffSampler) Description() string { + return "AlwaysOffSampler" +} + +// NeverSample returns a Sampler that samples no traces. +func NeverSample() Sampler { + return alwaysOffSampler{} +} + +// ParentBased returns a composite sampler which behaves differently, +// based on the parent of the span. If the span has no parent, +// the root(Sampler) is used to make sampling decision. If the span has +// a parent, depending on whether the parent is remote and whether it +// is sampled, one of the following samplers will apply: +// - remoteParentSampled(Sampler) (default: AlwaysOn) +// - remoteParentNotSampled(Sampler) (default: AlwaysOff) +// - localParentSampled(Sampler) (default: AlwaysOn) +// - localParentNotSampled(Sampler) (default: AlwaysOff) +func ParentBased(root Sampler, samplers ...ParentBasedSamplerOption) Sampler { + return parentBased{ + root: root, + config: configureSamplersForParentBased(samplers), + } +} + +type parentBased struct { + root Sampler + config config +} + +func configureSamplersForParentBased(samplers []ParentBasedSamplerOption) config { + c := config{ + remoteParentSampled: AlwaysSample(), + remoteParentNotSampled: NeverSample(), + localParentSampled: AlwaysSample(), + localParentNotSampled: NeverSample(), + } + + for _, so := range samplers { + so.Apply(&c) + } + + return c +} + +// config is a group of options for parentBased sampler. +type config struct { + remoteParentSampled, remoteParentNotSampled Sampler + localParentSampled, localParentNotSampled Sampler +} + +// ParentBasedSamplerOption configures the sampler for a particular sampling case. +type ParentBasedSamplerOption interface { + Apply(*config) + + // A private method to prevent users implementing the + // interface and so future additions to it will not + // violate compatibility. + private() +} + +// WithRemoteParentSampled sets the sampler for the case of sampled remote parent. +func WithRemoteParentSampled(s Sampler) ParentBasedSamplerOption { + return remoteParentSampledOption{s} +} + +type remoteParentSampledOption struct { + s Sampler +} + +func (o remoteParentSampledOption) Apply(config *config) { + config.remoteParentSampled = o.s +} + +func (remoteParentSampledOption) private() {} + +// WithRemoteParentNotSampled sets the sampler for the case of remote parent +// which is not sampled. +func WithRemoteParentNotSampled(s Sampler) ParentBasedSamplerOption { + return remoteParentNotSampledOption{s} +} + +type remoteParentNotSampledOption struct { + s Sampler +} + +func (o remoteParentNotSampledOption) Apply(config *config) { + config.remoteParentNotSampled = o.s +} + +func (remoteParentNotSampledOption) private() {} + +// WithLocalParentSampled sets the sampler for the case of sampled local parent. +func WithLocalParentSampled(s Sampler) ParentBasedSamplerOption { + return localParentSampledOption{s} +} + +type localParentSampledOption struct { + s Sampler +} + +func (o localParentSampledOption) Apply(config *config) { + config.localParentSampled = o.s +} + +func (localParentSampledOption) private() {} + +// WithLocalParentNotSampled sets the sampler for the case of local parent +// which is not sampled. +func WithLocalParentNotSampled(s Sampler) ParentBasedSamplerOption { + return localParentNotSampledOption{s} +} + +type localParentNotSampledOption struct { + s Sampler +} + +func (o localParentNotSampledOption) Apply(config *config) { + config.localParentNotSampled = o.s +} + +func (localParentNotSampledOption) private() {} + +func (pb parentBased) ShouldSample(p SamplingParameters) SamplingResult { + psc := trace.SpanContextFromContext(p.ParentContext) + if psc.IsValid() { + if psc.IsRemote() { + if psc.IsSampled() { + return pb.config.remoteParentSampled.ShouldSample(p) + } + return pb.config.remoteParentNotSampled.ShouldSample(p) + } + + if psc.IsSampled() { + return pb.config.localParentSampled.ShouldSample(p) + } + return pb.config.localParentNotSampled.ShouldSample(p) + } + return pb.root.ShouldSample(p) +} + +func (pb parentBased) Description() string { + return fmt.Sprintf("ParentBased{root:%s,remoteParentSampled:%s,"+ + "remoteParentNotSampled:%s,localParentSampled:%s,localParentNotSampled:%s}", + pb.root.Description(), + pb.config.remoteParentSampled.Description(), + pb.config.remoteParentNotSampled.Description(), + pb.config.localParentSampled.Description(), + pb.config.localParentNotSampled.Description(), + ) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go new file mode 100644 index 000000000000..b66a87a2a3f7 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go @@ -0,0 +1,80 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel" +) + +// simpleSpanProcessor is a SpanProcessor that synchronously sends all +// completed Spans to a trace.Exporter immediately. +type simpleSpanProcessor struct { + exporterMu sync.RWMutex + exporter SpanExporter + stopOnce sync.Once +} + +var _ SpanProcessor = (*simpleSpanProcessor)(nil) + +// NewSimpleSpanProcessor returns a new SpanProcessor that will synchronously +// send completed spans to the exporter immediately. +func NewSimpleSpanProcessor(exporter SpanExporter) SpanProcessor { + ssp := &simpleSpanProcessor{ + exporter: exporter, + } + return ssp +} + +// OnStart does nothing. +func (ssp *simpleSpanProcessor) OnStart(context.Context, ReadWriteSpan) {} + +// OnEnd immediately exports a ReadOnlySpan. +func (ssp *simpleSpanProcessor) OnEnd(s ReadOnlySpan) { + ssp.exporterMu.RLock() + defer ssp.exporterMu.RUnlock() + + if ssp.exporter != nil && s.SpanContext().TraceFlags().IsSampled() { + ss := s.Snapshot() + if err := ssp.exporter.ExportSpans(context.Background(), []*SpanSnapshot{ss}); err != nil { + otel.Handle(err) + } + } +} + +// Shutdown shuts down the exporter this SimpleSpanProcessor exports to. +func (ssp *simpleSpanProcessor) Shutdown(ctx context.Context) error { + var err error + ssp.stopOnce.Do(func() { + ssp.exporterMu.Lock() + exporter := ssp.exporter + // Set exporter to nil so subsequent calls to OnEnd are ignored + // gracefully. + ssp.exporter = nil + ssp.exporterMu.Unlock() + + // Clear the ssp.exporter prior to shutting it down so if that creates + // a span that needs to be exported there is no deadlock. + err = exporter.Shutdown(ctx) + }) + return err +} + +// ForceFlush does nothing as there is no data to flush. +func (ssp *simpleSpanProcessor) ForceFlush(context.Context) error { + return nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span.go new file mode 100644 index 000000000000..f13967d2b599 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span.go @@ -0,0 +1,617 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import ( + "context" + "fmt" + "reflect" + "sync" + "time" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/semconv" + "go.opentelemetry.io/otel/trace" + + "go.opentelemetry.io/otel/sdk/instrumentation" + "go.opentelemetry.io/otel/sdk/internal" + "go.opentelemetry.io/otel/sdk/resource" +) + +// ReadOnlySpan allows reading information from the data structure underlying a +// trace.Span. It is used in places where reading information from a span is +// necessary but changing the span isn't necessary or allowed. +// TODO: Should we make the methods unexported? The purpose of this interface +// is controlling access to `span` fields, not having multiple implementations. +type ReadOnlySpan interface { + Name() string + SpanContext() trace.SpanContext + Parent() trace.SpanContext + SpanKind() trace.SpanKind + StartTime() time.Time + EndTime() time.Time + Attributes() []attribute.KeyValue + Links() []trace.Link + Events() []trace.Event + StatusCode() codes.Code + StatusMessage() string + Tracer() trace.Tracer + IsRecording() bool + InstrumentationLibrary() instrumentation.Library + Resource() *resource.Resource + Snapshot() *SpanSnapshot + + // A private method to prevent users implementing the + // interface and so future additions to it will not + // violate compatibility. + private() +} + +// ReadWriteSpan exposes the same methods as trace.Span and in addition allows +// reading information from the underlying data structure. +// This interface exposes the union of the methods of trace.Span (which is a +// "write-only" span) and ReadOnlySpan. New methods for writing or reading span +// information should be added under trace.Span or ReadOnlySpan, respectively. +type ReadWriteSpan interface { + trace.Span + ReadOnlySpan +} + +// span is an implementation of the OpenTelemetry Span API representing the +// individual component of a trace. +type span struct { + // mu protects the contents of this span. + mu sync.Mutex + + // parent holds the parent span of this span as a trace.SpanContext. + parent trace.SpanContext + + // spanKind represents the kind of this span as a trace.SpanKind. + spanKind trace.SpanKind + + // name is the name of this span. + name string + + // startTime is the time at which this span was started. + startTime time.Time + + // endTime is the time at which this span was ended. It contains the zero + // value of time.Time until the span is ended. + endTime time.Time + + // statusCode represents the status of this span as a codes.Code value. + statusCode codes.Code + + // statusMessage represents the status of this span as a string. + statusMessage string + + // childSpanCount holds the number of child spans created for this span. + childSpanCount int + + // resource contains attributes representing an entity that produced this + // span. + resource *resource.Resource + + // instrumentationLibrary defines the instrumentation library used to + // provide instrumentation. + instrumentationLibrary instrumentation.Library + + // spanContext holds the SpanContext of this span. + spanContext trace.SpanContext + + // attributes are capped at configured limit. When the capacity is reached + // an oldest entry is removed to create room for a new entry. + attributes *attributesMap + + // messageEvents are stored in FIFO queue capped by configured limit. + messageEvents *evictedQueue + + // links are stored in FIFO queue capped by configured limit. + links *evictedQueue + + // executionTracerTaskEnd ends the execution tracer span. + executionTracerTaskEnd func() + + // tracer is the SDK tracer that created this span. + tracer *tracer + + // spanLimits holds the limits to this span. + spanLimits SpanLimits +} + +var _ trace.Span = &span{} + +// SpanContext returns the SpanContext of this span. +func (s *span) SpanContext() trace.SpanContext { + if s == nil { + return trace.SpanContext{} + } + return s.spanContext +} + +// IsRecording returns if this span is being recorded. If this span has ended +// this will return false. +func (s *span) IsRecording() bool { + if s == nil { + return false + } + s.mu.Lock() + defer s.mu.Unlock() + + return !s.startTime.IsZero() && s.endTime.IsZero() +} + +// SetStatus sets the status of this span in the form of a code and a +// message. This overrides the existing value of this span's status if one +// exists. Message will be set only if status is error. If this span is not being +// recorded than this method does nothing. +func (s *span) SetStatus(code codes.Code, msg string) { + if !s.IsRecording() { + return + } + s.mu.Lock() + s.statusCode = code + if code == codes.Error { + s.statusMessage = msg + } + s.mu.Unlock() +} + +// SetAttributes sets attributes of this span. +// +// If a key from attributes already exists the value associated with that key +// will be overwritten with the value contained in attributes. +// +// If this span is not being recorded than this method does nothing. +func (s *span) SetAttributes(attributes ...attribute.KeyValue) { + if !s.IsRecording() { + return + } + s.copyToCappedAttributes(attributes...) +} + +// End ends the span. This method does nothing if the span is already ended or +// is not being recorded. +// +// The only SpanOption currently supported is WithTimestamp which will set the +// end time for a Span's life-cycle. +// +// If this method is called while panicking an error event is added to the +// Span before ending it and the panic is continued. +func (s *span) End(options ...trace.SpanOption) { + // Do not start by checking if the span is being recorded which requires + // acquiring a lock. Make a minimal check that the span is not nil. + if s == nil { + return + } + + // Store the end time as soon as possible to avoid artificially increasing + // the span's duration in case some operation below takes a while. + et := internal.MonotonicEndTime(s.startTime) + + // Do relative expensive check now that we have an end time and see if we + // need to do any more processing. + if !s.IsRecording() { + return + } + + if recovered := recover(); recovered != nil { + // Record but don't stop the panic. + defer panic(recovered) + s.addEvent( + semconv.ExceptionEventName, + trace.WithAttributes( + semconv.ExceptionTypeKey.String(typeStr(recovered)), + semconv.ExceptionMessageKey.String(fmt.Sprint(recovered)), + ), + ) + } + + if s.executionTracerTaskEnd != nil { + s.executionTracerTaskEnd() + } + + config := trace.NewSpanConfig(options...) + + s.mu.Lock() + // Setting endTime to non-zero marks the span as ended and not recording. + if config.Timestamp.IsZero() { + s.endTime = et + } else { + s.endTime = config.Timestamp + } + s.mu.Unlock() + + sps, ok := s.tracer.provider.spanProcessors.Load().(spanProcessorStates) + mustExportOrProcess := ok && len(sps) > 0 + if mustExportOrProcess { + for _, sp := range sps { + sp.sp.OnEnd(s) + } + } +} + +// RecordError will record err as a span event for this span. An additional call to +// SetStatus is required if the Status of the Span should be set to Error, this method +// does not change the Span status. If this span is not being recorded or err is nil +// than this method does nothing. +func (s *span) RecordError(err error, opts ...trace.EventOption) { + if s == nil || err == nil || !s.IsRecording() { + return + } + + opts = append(opts, trace.WithAttributes( + semconv.ExceptionTypeKey.String(typeStr(err)), + semconv.ExceptionMessageKey.String(err.Error()), + )) + s.addEvent(semconv.ExceptionEventName, opts...) +} + +func typeStr(i interface{}) string { + t := reflect.TypeOf(i) + if t.PkgPath() == "" && t.Name() == "" { + // Likely a builtin type. + return t.String() + } + return fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()) +} + +// Tracer returns the Tracer that created this span. +func (s *span) Tracer() trace.Tracer { + return s.tracer +} + +// AddEvent adds an event with the provided name and options. If this span is +// not being recorded than this method does nothing. +func (s *span) AddEvent(name string, o ...trace.EventOption) { + if !s.IsRecording() { + return + } + s.addEvent(name, o...) +} + +func (s *span) addEvent(name string, o ...trace.EventOption) { + c := trace.NewEventConfig(o...) + + // Discard over limited attributes + var discarded int + if len(c.Attributes) > s.spanLimits.AttributePerEventCountLimit { + discarded = len(c.Attributes) - s.spanLimits.AttributePerEventCountLimit + c.Attributes = c.Attributes[:s.spanLimits.AttributePerEventCountLimit] + } + + s.mu.Lock() + defer s.mu.Unlock() + s.messageEvents.add(trace.Event{ + Name: name, + Attributes: c.Attributes, + DroppedAttributeCount: discarded, + Time: c.Timestamp, + }) +} + +// SetName sets the name of this span. If this span is not being recorded than +// this method does nothing. +func (s *span) SetName(name string) { + if !s.IsRecording() { + return + } + + s.mu.Lock() + defer s.mu.Unlock() + s.name = name +} + +// Name returns the name of this span. +func (s *span) Name() string { + s.mu.Lock() + defer s.mu.Unlock() + return s.name +} + +// Name returns the SpanContext of this span's parent span. +func (s *span) Parent() trace.SpanContext { + s.mu.Lock() + defer s.mu.Unlock() + return s.parent +} + +// SpanKind returns the SpanKind of this span. +func (s *span) SpanKind() trace.SpanKind { + s.mu.Lock() + defer s.mu.Unlock() + return s.spanKind +} + +// StartTime returns the time this span started. +func (s *span) StartTime() time.Time { + s.mu.Lock() + defer s.mu.Unlock() + return s.startTime +} + +// EndTime returns the time this span ended. For spans that have not yet +// ended, the returned value will be the zero value of time.Time. +func (s *span) EndTime() time.Time { + s.mu.Lock() + defer s.mu.Unlock() + return s.endTime +} + +// Attributes returns the attributes of this span. +func (s *span) Attributes() []attribute.KeyValue { + s.mu.Lock() + defer s.mu.Unlock() + if s.attributes.evictList.Len() == 0 { + return []attribute.KeyValue{} + } + return s.attributes.toKeyValue() +} + +// Links returns the links of this span. +func (s *span) Links() []trace.Link { + s.mu.Lock() + defer s.mu.Unlock() + if len(s.links.queue) == 0 { + return []trace.Link{} + } + return s.interfaceArrayToLinksArray() +} + +// Events returns the events of this span. +func (s *span) Events() []trace.Event { + s.mu.Lock() + defer s.mu.Unlock() + if len(s.messageEvents.queue) == 0 { + return []trace.Event{} + } + return s.interfaceArrayToMessageEventArray() +} + +// StatusCode returns the status code of this span. +func (s *span) StatusCode() codes.Code { + s.mu.Lock() + defer s.mu.Unlock() + return s.statusCode +} + +// StatusMessage returns the status message of this span. +func (s *span) StatusMessage() string { + s.mu.Lock() + defer s.mu.Unlock() + return s.statusMessage +} + +// InstrumentationLibrary returns the instrumentation.Library associated with +// the Tracer that created this span. +func (s *span) InstrumentationLibrary() instrumentation.Library { + s.mu.Lock() + defer s.mu.Unlock() + return s.instrumentationLibrary +} + +// Resource returns the Resource associated with the Tracer that created this +// span. +func (s *span) Resource() *resource.Resource { + s.mu.Lock() + defer s.mu.Unlock() + return s.resource +} + +func (s *span) addLink(link trace.Link) { + if !s.IsRecording() { + return + } + s.mu.Lock() + defer s.mu.Unlock() + + // Discard over limited attributes + if len(link.Attributes) > s.spanLimits.AttributePerLinkCountLimit { + link.DroppedAttributeCount = len(link.Attributes) - s.spanLimits.AttributePerLinkCountLimit + link.Attributes = link.Attributes[:s.spanLimits.AttributePerLinkCountLimit] + } + + s.links.add(link) +} + +// Snapshot creates a snapshot representing the current state of the span as an +// export.SpanSnapshot and returns a pointer to it. +func (s *span) Snapshot() *SpanSnapshot { + var sd SpanSnapshot + s.mu.Lock() + defer s.mu.Unlock() + + sd.ChildSpanCount = s.childSpanCount + sd.EndTime = s.endTime + sd.InstrumentationLibrary = s.instrumentationLibrary + sd.Name = s.name + sd.Parent = s.parent + sd.Resource = s.resource + sd.SpanContext = s.spanContext + sd.SpanKind = s.spanKind + sd.StartTime = s.startTime + sd.StatusCode = s.statusCode + sd.StatusMessage = s.statusMessage + + if s.attributes.evictList.Len() > 0 { + sd.Attributes = s.attributes.toKeyValue() + sd.DroppedAttributeCount = s.attributes.droppedCount + } + if len(s.messageEvents.queue) > 0 { + sd.MessageEvents = s.interfaceArrayToMessageEventArray() + sd.DroppedMessageEventCount = s.messageEvents.droppedCount + } + if len(s.links.queue) > 0 { + sd.Links = s.interfaceArrayToLinksArray() + sd.DroppedLinkCount = s.links.droppedCount + } + return &sd +} + +func (s *span) interfaceArrayToLinksArray() []trace.Link { + linkArr := make([]trace.Link, 0) + for _, value := range s.links.queue { + linkArr = append(linkArr, value.(trace.Link)) + } + return linkArr +} + +func (s *span) interfaceArrayToMessageEventArray() []trace.Event { + messageEventArr := make([]trace.Event, 0) + for _, value := range s.messageEvents.queue { + messageEventArr = append(messageEventArr, value.(trace.Event)) + } + return messageEventArr +} + +func (s *span) copyToCappedAttributes(attributes ...attribute.KeyValue) { + s.mu.Lock() + defer s.mu.Unlock() + for _, a := range attributes { + // Ensure attributes conform to the specification: + // https://github.com/open-telemetry/opentelemetry-specification/blob/v1.0.1/specification/common/common.md#attributes + if a.Valid() { + s.attributes.add(a) + } + } +} + +func (s *span) addChild() { + if !s.IsRecording() { + return + } + s.mu.Lock() + s.childSpanCount++ + s.mu.Unlock() +} + +func (*span) private() {} + +func startSpanInternal(ctx context.Context, tr *tracer, name string, o *trace.SpanConfig) *span { + span := &span{} + + provider := tr.provider + + // If told explicitly to make this a new root use a zero value SpanContext + // as a parent which contains an invalid trace ID and is not remote. + var psc trace.SpanContext + if !o.NewRoot { + psc = trace.SpanContextFromContext(ctx) + } + + // If there is a valid parent trace ID, use it to ensure the continuity of + // the trace. Always generate a new span ID so other components can rely + // on a unique span ID, even if the Span is non-recording. + var tid trace.TraceID + var sid trace.SpanID + if !psc.TraceID().IsValid() { + tid, sid = provider.idGenerator.NewIDs(ctx) + } else { + tid = psc.TraceID() + sid = provider.idGenerator.NewSpanID(ctx, tid) + } + + spanLimits := provider.spanLimits + span.attributes = newAttributesMap(spanLimits.AttributeCountLimit) + span.messageEvents = newEvictedQueue(spanLimits.EventCountLimit) + span.links = newEvictedQueue(spanLimits.LinkCountLimit) + span.spanLimits = spanLimits + + samplingResult := provider.sampler.ShouldSample(SamplingParameters{ + ParentContext: ctx, + TraceID: tid, + Name: name, + Kind: o.SpanKind, + Attributes: o.Attributes, + Links: o.Links, + }) + + scc := trace.SpanContextConfig{ + TraceID: tid, + SpanID: sid, + TraceState: samplingResult.Tracestate, + } + if isSampled(samplingResult) { + scc.TraceFlags = psc.TraceFlags() | trace.FlagsSampled + } else { + scc.TraceFlags = psc.TraceFlags() &^ trace.FlagsSampled + } + span.spanContext = trace.NewSpanContext(scc) + + if !isRecording(samplingResult) { + return span + } + + startTime := o.Timestamp + if startTime.IsZero() { + startTime = time.Now() + } + span.startTime = startTime + + span.spanKind = trace.ValidateSpanKind(o.SpanKind) + span.name = name + span.parent = psc + span.resource = provider.resource + span.instrumentationLibrary = tr.instrumentationLibrary + + span.SetAttributes(samplingResult.Attributes...) + + return span +} + +func isRecording(s SamplingResult) bool { + return s.Decision == RecordOnly || s.Decision == RecordAndSample +} + +func isSampled(s SamplingResult) bool { + return s.Decision == RecordAndSample +} + +// SpanSnapshot is a snapshot of a span which contains all the information +// collected by the span. Its main purpose is exporting completed spans. +// Although SpanSnapshot fields can be accessed and potentially modified, +// SpanSnapshot should be treated as immutable. Changes to the span from which +// the SpanSnapshot was created are NOT reflected in the SpanSnapshot. +type SpanSnapshot struct { + SpanContext trace.SpanContext + Parent trace.SpanContext + SpanKind trace.SpanKind + Name string + StartTime time.Time + // The wall clock time of EndTime will be adjusted to always be offset + // from StartTime by the duration of the span. + EndTime time.Time + Attributes []attribute.KeyValue + MessageEvents []trace.Event + Links []trace.Link + StatusCode codes.Code + StatusMessage string + + // DroppedAttributeCount contains dropped attributes for the span itself. + DroppedAttributeCount int + DroppedMessageEventCount int + DroppedLinkCount int + + // ChildSpanCount holds the number of child span created for this span. + ChildSpanCount int + + // Resource contains attributes representing an entity that produced this span. + Resource *resource.Resource + + // InstrumentationLibrary defines the instrumentation library used to + // provide instrumentation. + InstrumentationLibrary instrumentation.Library +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go new file mode 100644 index 000000000000..40e121069d1c --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import "context" + +// SpanExporter handles the delivery of SpanSnapshot structs to external +// receivers. This is the final component in the trace export pipeline. +type SpanExporter interface { + // ExportSpans exports a batch of SpanSnapshots. + // + // This function is called synchronously, so there is no concurrency + // safety requirement. However, due to the synchronous calling pattern, + // it is critical that all timeouts and cancellations contained in the + // passed context must be honored. + // + // Any retry logic must be contained in this function. The SDK that + // calls this function will not implement any retry logic. All errors + // returned by this function are considered unrecoverable and will be + // reported to a configured error Handler. + ExportSpans(ctx context.Context, ss []*SpanSnapshot) error + // Shutdown notifies the exporter of a pending halt to operations. The + // exporter is expected to preform any cleanup or synchronization it + // requires while honoring all timeouts and cancellations contained in + // the passed context. + Shutdown(ctx context.Context) error +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go new file mode 100644 index 000000000000..73f49815e8e5 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go @@ -0,0 +1,56 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import ( + "context" + "sync" +) + +// SpanProcessor is a processing pipeline for spans in the trace signal. +// SpanProcessors registered with a TracerProvider and are called at the start +// and end of a Span's lifecycle, and are called in the order they are +// registered. +type SpanProcessor interface { + // OnStart is called when a span is started. It is called synchronously + // and should not block. + OnStart(parent context.Context, s ReadWriteSpan) + + // OnEnd is called when span is finished. It is called synchronously and + // hence not block. + OnEnd(s ReadOnlySpan) + + // Shutdown is called when the SDK shuts down. Any cleanup or release of + // resources held by the processor should be done in this call. + // + // Calls to OnStart, OnEnd, or ForceFlush after this has been called + // should be ignored. + // + // All timeouts and cancellations contained in ctx must be honored, this + // should not block indefinitely. + Shutdown(ctx context.Context) error + + // ForceFlush exports all ended spans to the configured Exporter that have not yet + // been exported. It should only be called when absolutely necessary, such as when + // using a FaaS provider that may suspend the process after an invocation, but before + // the Processor can export the completed spans. + ForceFlush(ctx context.Context) error +} + +type spanProcessorState struct { + sp SpanProcessor + state *sync.Once +} +type spanProcessorStates []*spanProcessorState diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go new file mode 100644 index 000000000000..b7869eddd2e0 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go @@ -0,0 +1,75 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/sdk/trace" + +import ( + "context" + rt "runtime/trace" + + "go.opentelemetry.io/otel/trace" + + "go.opentelemetry.io/otel/sdk/instrumentation" +) + +type tracer struct { + provider *TracerProvider + instrumentationLibrary instrumentation.Library +} + +var _ trace.Tracer = &tracer{} + +// Start starts a Span and returns it along with a context containing it. +// +// The Span is created with the provided name and as a child of any existing +// span context found in the passed context. The created Span will be +// configured appropriately by any SpanOption passed. Any Timestamp option +// passed will be used as the start time of the Span's life-cycle. +func (tr *tracer) Start(ctx context.Context, name string, options ...trace.SpanOption) (context.Context, trace.Span) { + config := trace.NewSpanConfig(options...) + + // For local spans created by this SDK, track child span count. + if p := trace.SpanFromContext(ctx); p != nil { + if sdkSpan, ok := p.(*span); ok { + sdkSpan.addChild() + } + } + + span := startSpanInternal(ctx, tr, name, config) + for _, l := range config.Links { + span.addLink(l) + } + span.SetAttributes(config.Attributes...) + + span.tracer = tr + + if span.IsRecording() { + sps, _ := tr.provider.spanProcessors.Load().(spanProcessorStates) + for _, sp := range sps { + sp.sp.OnStart(ctx, span) + } + } + + ctx, span.executionTracerTaskEnd = func(ctx context.Context) (context.Context, func()) { + if !rt.IsEnabled() { + // Avoid additional overhead if + // runtime/trace is not enabled. + return ctx, func() {} + } + nctx, task := rt.NewTask(ctx, name) + return nctx, task.End + }(ctx) + + return trace.ContextWithSpan(ctx, span), span +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/doc.go new file mode 100644 index 000000000000..9a729fdecb11 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/doc.go @@ -0,0 +1,24 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package semconv implements OpenTelemetry semantic conventions. +// +// This package is currently in a pre-GA phase. Backwards incompatible changes +// may be introduced in subsequent minor version releases as we work to track +// the evolving OpenTelemetry specification and user feedback. +// +// OpenTelemetry semantic conventions are agreed standardized naming +// patterns for OpenTelemetry things. This package aims to be the +// centralized place to interact with these conventions. +package semconv // import "go.opentelemetry.io/otel/semconv" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/exception.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/exception.go new file mode 100644 index 000000000000..97002611228a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/exception.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package semconv + +import "go.opentelemetry.io/otel/attribute" + +// Semantic conventions for exception attribute keys. +const ( + // The Go type containing the error or exception. + ExceptionTypeKey = attribute.Key("exception.type") + + // The exception message. + ExceptionMessageKey = attribute.Key("exception.message") + + // A stacktrace as a string. This most commonly will come from + // "runtime/debug".Stack. + ExceptionStacktraceKey = attribute.Key("exception.stacktrace") + + // If the exception event is recorded at a point where it is known + // that the exception is escaping the scope of the span this + // attribute is set to true. + ExceptionEscapedKey = attribute.Key("exception.escaped") +) + +const ( + // ExceptionEventName is the name of the Span event representing an exception. + ExceptionEventName = "exception" +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/http.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/http.go new file mode 100644 index 000000000000..d8160f924251 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/http.go @@ -0,0 +1,297 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package semconv // import "go.opentelemetry.io/otel/semconv" + +import ( + "fmt" + "net" + "net/http" + "strconv" + "strings" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" +) + +// NetAttributesFromHTTPRequest generates attributes of the net +// namespace as specified by the OpenTelemetry specification for a +// span. The network parameter is a string that net.Dial function +// from standard library can understand. +func NetAttributesFromHTTPRequest(network string, request *http.Request) []attribute.KeyValue { + attrs := []attribute.KeyValue{} + + switch network { + case "tcp", "tcp4", "tcp6": + attrs = append(attrs, NetTransportTCP) + case "udp", "udp4", "udp6": + attrs = append(attrs, NetTransportUDP) + case "ip", "ip4", "ip6": + attrs = append(attrs, NetTransportIP) + case "unix", "unixgram", "unixpacket": + attrs = append(attrs, NetTransportUnix) + default: + attrs = append(attrs, NetTransportOther) + } + + peerName, peerIP, peerPort := "", "", 0 + { + hostPart := request.RemoteAddr + portPart := "" + if idx := strings.LastIndex(hostPart, ":"); idx >= 0 { + hostPart = request.RemoteAddr[:idx] + portPart = request.RemoteAddr[idx+1:] + } + if hostPart != "" { + if ip := net.ParseIP(hostPart); ip != nil { + peerIP = ip.String() + } else { + peerName = hostPart + } + + if portPart != "" { + numPort, err := strconv.ParseUint(portPart, 10, 16) + if err == nil { + peerPort = (int)(numPort) + } else { + peerName, peerIP = "", "" + } + } + } + } + if peerName != "" { + attrs = append(attrs, NetPeerNameKey.String(peerName)) + } + if peerIP != "" { + attrs = append(attrs, NetPeerIPKey.String(peerIP)) + } + if peerPort != 0 { + attrs = append(attrs, NetPeerPortKey.Int(peerPort)) + } + + hostIP, hostName, hostPort := "", "", 0 + for _, someHost := range []string{request.Host, request.Header.Get("Host"), request.URL.Host} { + hostPart := "" + if idx := strings.LastIndex(someHost, ":"); idx >= 0 { + strPort := someHost[idx+1:] + numPort, err := strconv.ParseUint(strPort, 10, 16) + if err == nil { + hostPort = (int)(numPort) + } + hostPart = someHost[:idx] + } else { + hostPart = someHost + } + if hostPart != "" { + ip := net.ParseIP(hostPart) + if ip != nil { + hostIP = ip.String() + } else { + hostName = hostPart + } + break + } else { + hostPort = 0 + } + } + if hostIP != "" { + attrs = append(attrs, NetHostIPKey.String(hostIP)) + } + if hostName != "" { + attrs = append(attrs, NetHostNameKey.String(hostName)) + } + if hostPort != 0 { + attrs = append(attrs, NetHostPortKey.Int(hostPort)) + } + + return attrs +} + +// EndUserAttributesFromHTTPRequest generates attributes of the +// enduser namespace as specified by the OpenTelemetry specification +// for a span. +func EndUserAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { + if username, _, ok := request.BasicAuth(); ok { + return []attribute.KeyValue{EnduserIDKey.String(username)} + } + return nil +} + +// HTTPClientAttributesFromHTTPRequest generates attributes of the +// http namespace as specified by the OpenTelemetry specification for +// a span on the client side. +func HTTPClientAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { + attrs := []attribute.KeyValue{} + + if request.Method != "" { + attrs = append(attrs, HTTPMethodKey.String(request.Method)) + } else { + attrs = append(attrs, HTTPMethodKey.String(http.MethodGet)) + } + + attrs = append(attrs, HTTPURLKey.String(request.URL.String())) + + return append(attrs, httpCommonAttributesFromHTTPRequest(request)...) +} + +func httpCommonAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { + attrs := []attribute.KeyValue{} + if ua := request.UserAgent(); ua != "" { + attrs = append(attrs, HTTPUserAgentKey.String(ua)) + } + if request.ContentLength > 0 { + attrs = append(attrs, HTTPRequestContentLengthKey.Int64(request.ContentLength)) + } + + return append(attrs, httpBasicAttributesFromHTTPRequest(request)...) +} + +func httpBasicAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { + // as these attributes are used by HTTPServerMetricAttributesFromHTTPRequest, they should be low-cardinality + attrs := []attribute.KeyValue{} + + if request.TLS != nil { + attrs = append(attrs, HTTPSchemeHTTPS) + } else { + attrs = append(attrs, HTTPSchemeHTTP) + } + + if request.Host != "" { + attrs = append(attrs, HTTPHostKey.String(request.Host)) + } + + flavor := "" + if request.ProtoMajor == 1 { + flavor = fmt.Sprintf("1.%d", request.ProtoMinor) + } else if request.ProtoMajor == 2 { + flavor = "2" + } + if flavor != "" { + attrs = append(attrs, HTTPFlavorKey.String(flavor)) + } + + return attrs +} + +// HTTPServerMetricAttributesFromHTTPRequest generates low-cardinality attributes +// to be used with server-side HTTP metrics. +func HTTPServerMetricAttributesFromHTTPRequest(serverName string, request *http.Request) []attribute.KeyValue { + attrs := []attribute.KeyValue{} + if serverName != "" { + attrs = append(attrs, HTTPServerNameKey.String(serverName)) + } + return append(attrs, httpBasicAttributesFromHTTPRequest(request)...) +} + +// HTTPServerAttributesFromHTTPRequest generates attributes of the +// http namespace as specified by the OpenTelemetry specification for +// a span on the server side. Currently, only basic authentication is +// supported. +func HTTPServerAttributesFromHTTPRequest(serverName, route string, request *http.Request) []attribute.KeyValue { + attrs := []attribute.KeyValue{ + HTTPMethodKey.String(request.Method), + HTTPTargetKey.String(request.RequestURI), + } + + if serverName != "" { + attrs = append(attrs, HTTPServerNameKey.String(serverName)) + } + if route != "" { + attrs = append(attrs, HTTPRouteKey.String(route)) + } + if values, ok := request.Header["X-Forwarded-For"]; ok && len(values) > 0 { + attrs = append(attrs, HTTPClientIPKey.String(values[0])) + } + + return append(attrs, httpCommonAttributesFromHTTPRequest(request)...) +} + +// HTTPAttributesFromHTTPStatusCode generates attributes of the http +// namespace as specified by the OpenTelemetry specification for a +// span. +func HTTPAttributesFromHTTPStatusCode(code int) []attribute.KeyValue { + attrs := []attribute.KeyValue{ + HTTPStatusCodeKey.Int(code), + } + return attrs +} + +type codeRange struct { + fromInclusive int + toInclusive int +} + +func (r codeRange) contains(code int) bool { + return r.fromInclusive <= code && code <= r.toInclusive +} + +var validRangesPerCategory = map[int][]codeRange{ + 1: { + {http.StatusContinue, http.StatusEarlyHints}, + }, + 2: { + {http.StatusOK, http.StatusAlreadyReported}, + {http.StatusIMUsed, http.StatusIMUsed}, + }, + 3: { + {http.StatusMultipleChoices, http.StatusUseProxy}, + {http.StatusTemporaryRedirect, http.StatusPermanentRedirect}, + }, + 4: { + {http.StatusBadRequest, http.StatusTeapot}, // yes, teapot is so useful… + {http.StatusMisdirectedRequest, http.StatusUpgradeRequired}, + {http.StatusPreconditionRequired, http.StatusTooManyRequests}, + {http.StatusRequestHeaderFieldsTooLarge, http.StatusRequestHeaderFieldsTooLarge}, + {http.StatusUnavailableForLegalReasons, http.StatusUnavailableForLegalReasons}, + }, + 5: { + {http.StatusInternalServerError, http.StatusLoopDetected}, + {http.StatusNotExtended, http.StatusNetworkAuthenticationRequired}, + }, +} + +// SpanStatusFromHTTPStatusCode generates a status code and a message +// as specified by the OpenTelemetry specification for a span. +func SpanStatusFromHTTPStatusCode(code int) (codes.Code, string) { + spanCode, valid := validateHTTPStatusCode(code) + if !valid { + return spanCode, fmt.Sprintf("Invalid HTTP status code %d", code) + } + return spanCode, "" +} + +// Validates the HTTP status code and returns corresponding span status code. +// If the `code` is not a valid HTTP status code, returns span status Error +// and false. +func validateHTTPStatusCode(code int) (codes.Code, bool) { + category := code / 100 + ranges, ok := validRangesPerCategory[category] + if !ok { + return codes.Error, false + } + ok = false + for _, crange := range ranges { + ok = crange.contains(code) + if ok { + break + } + } + if !ok { + return codes.Error, false + } + if category > 0 && category < 4 { + return codes.Unset, true + } + return codes.Error, true +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/resource.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/resource.go new file mode 100644 index 000000000000..69a9b5a6f33a --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/resource.go @@ -0,0 +1,257 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package semconv // import "go.opentelemetry.io/otel/semconv" + +import "go.opentelemetry.io/otel/attribute" + +// Semantic conventions for service resource attribute keys. +const ( + // Name of the service. + ServiceNameKey = attribute.Key("service.name") + + // A namespace for `service.name`. This needs to have meaning that helps + // to distinguish a group of services. For example, the team name that + // owns a group of services. `service.name` is expected to be unique + // within the same namespace. + ServiceNamespaceKey = attribute.Key("service.namespace") + + // A unique identifier of the service instance. In conjunction with the + // `service.name` and `service.namespace` this must be unique. + ServiceInstanceIDKey = attribute.Key("service.instance.id") + + // The version of the service API. + ServiceVersionKey = attribute.Key("service.version") +) + +// Semantic conventions for telemetry SDK resource attribute keys. +const ( + // The name of the telemetry SDK. + // + // The default OpenTelemetry SDK provided by the OpenTelemetry project + // MUST set telemetry.sdk.name to the value `opentelemetry`. + // + // If another SDK is used, this attribute MUST be set to the import path + // of that SDK's package. + // + // The value `opentelemetry` is reserved and MUST NOT be used by + // non-OpenTelemetry SDKs. + TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") + + // The language of the telemetry SDK. + TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") + + // The version string of the telemetry SDK. + TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") +) + +// Semantic conventions for telemetry SDK resource attributes. +var ( + TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go") +) + +// Semantic conventions for container resource attribute keys. +const ( + // A uniquely identifying name for the Container. + ContainerNameKey = attribute.Key("container.name") + + // Container ID, usually a UUID, as for example used to + // identify Docker containers. The UUID might be abbreviated. + ContainerIDKey = attribute.Key("container.id") + + // Name of the image the container was built on. + ContainerImageNameKey = attribute.Key("container.image.name") + + // Container image tag. + ContainerImageTagKey = attribute.Key("container.image.tag") +) + +// Semantic conventions for Function-as-a-Service resource attribute keys. +const ( + // A uniquely identifying name for the FaaS. + FaaSNameKey = attribute.Key("faas.name") + + // The unique name of the function being executed. + FaaSIDKey = attribute.Key("faas.id") + + // The version of the function being executed. + FaaSVersionKey = attribute.Key("faas.version") + + // The execution environment identifier. + FaaSInstanceKey = attribute.Key("faas.instance") +) + +// Semantic conventions for operating system process resource attribute keys. +const ( + // Process identifier (PID). + ProcessPIDKey = attribute.Key("process.pid") + // The name of the process executable. On Linux based systems, can be + // set to the `Name` in `proc/[pid]/status`. On Windows, can be set to + // the base name of `GetProcessImageFileNameW`. + ProcessExecutableNameKey = attribute.Key("process.executable.name") + // The full path to the process executable. On Linux based systems, can + // be set to the target of `proc/[pid]/exe`. On Windows, can be set to + // the result of `GetProcessImageFileNameW`. + ProcessExecutablePathKey = attribute.Key("process.executable.path") + // The command used to launch the process (i.e. the command name). On + // Linux based systems, can be set to the zeroth string in + // `proc/[pid]/cmdline`. On Windows, can be set to the first parameter + // extracted from `GetCommandLineW`. + ProcessCommandKey = attribute.Key("process.command") + // The full command used to launch the process. The value can be either + // a list of strings representing the ordered list of arguments, or a + // single string representing the full command. On Linux based systems, + // can be set to the list of null-delimited strings extracted from + // `proc/[pid]/cmdline`. On Windows, can be set to the result of + // `GetCommandLineW`. + ProcessCommandLineKey = attribute.Key("process.command_line") + // All the command arguments (including the command/executable itself) + // as received by the process. On Linux-based systems (and some other + // Unixoid systems supporting procfs), can be set according to the list + // of null-delimited strings extracted from `proc/[pid]/cmdline`. For + // libc-based executables, this would be the full argv vector passed to + // `main`. + ProcessCommandArgsKey = attribute.Key("process.command_args") + // The username of the user that owns the process. + ProcessOwnerKey = attribute.Key("process.owner") + // The name of the runtime of this process. For compiled native + // binaries, this SHOULD be the name of the compiler. + ProcessRuntimeNameKey = attribute.Key("process.runtime.name") + // The version of the runtime of this process, as returned by the + // runtime without modification. + ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") + // An additional description about the runtime of the process, for + // example a specific vendor customization of the runtime environment. + ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") +) + +// Semantic conventions for Kubernetes resource attribute keys. +const ( + // A uniquely identifying name for the Kubernetes cluster. Kubernetes + // does not have cluster names as an internal concept so this may be + // set to any meaningful value within the environment. For example, + // GKE clusters have a name which can be used for this attribute. + K8SClusterNameKey = attribute.Key("k8s.cluster.name") + + // The name of the Node. + K8SNodeNameKey = attribute.Key("k8s.node.name") + + // The UID of the Node. + K8SNodeUIDKey = attribute.Key("k8s.node.uid") + + // The name of the namespace that the pod is running in. + K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") + + // The uid of the Pod. + K8SPodUIDKey = attribute.Key("k8s.pod.uid") + + // The name of the pod. + K8SPodNameKey = attribute.Key("k8s.pod.name") + + // The name of the Container in a Pod template. + K8SContainerNameKey = attribute.Key("k8s.container.name") + + // The uid of the ReplicaSet. + K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") + + // The name of the ReplicaSet. + K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") + + // The uid of the Deployment. + K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") + + // The name of the deployment. + K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") + + // The uid of the StatefulSet. + K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") + + // The name of the StatefulSet. + K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") + + // The uid of the DaemonSet. + K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") + + // The name of the DaemonSet. + K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") + + // The uid of the Job. + K8SJobUIDKey = attribute.Key("k8s.job.uid") + + // The name of the Job. + K8SJobNameKey = attribute.Key("k8s.job.name") + + // The uid of the CronJob. + K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") + + // The name of the CronJob. + K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") +) + +// Semantic conventions for OS resource attribute keys. +const ( + // The operating system type. + OSTypeKey = attribute.Key("os.type") + // Human readable (not intended to be parsed) OS version information. + OSDescriptionKey = attribute.Key("os.description") +) + +// Semantic conventions for host resource attribute keys. +const ( + // A uniquely identifying name for the host: 'hostname', FQDN, or user specified name + HostNameKey = attribute.Key("host.name") + + // Unique host ID. For cloud environments this will be the instance ID. + HostIDKey = attribute.Key("host.id") + + // Type of host. For cloud environments this will be the machine type. + HostTypeKey = attribute.Key("host.type") + + // Name of the OS or VM image the host is running. + HostImageNameKey = attribute.Key("host.image.name") + + // Identifier of the image the host is running. + HostImageIDKey = attribute.Key("host.image.id") + + // Version of the image the host is running. + HostImageVersionKey = attribute.Key("host.image.version") +) + +// Semantic conventions for cloud environment resource attribute keys. +const ( + // Name of the cloud provider. + CloudProviderKey = attribute.Key("cloud.provider") + + // The account ID from the cloud provider used for authorization. + CloudAccountIDKey = attribute.Key("cloud.account.id") + + // Geographical region where this resource is. + CloudRegionKey = attribute.Key("cloud.region") + + // Zone of the region where this resource is. + CloudZoneKey = attribute.Key("cloud.zone") +) + +// Semantic conventions for common cloud provider resource attributes. +var ( + CloudProviderAWS = CloudProviderKey.String("aws") + CloudProviderAzure = CloudProviderKey.String("azure") + CloudProviderGCP = CloudProviderKey.String("gcp") +) + +// Semantic conventions for deployment attributes. +const ( + // Name of the deployment environment (aka deployment tier); e.g. (staging, production). + DeploymentEnvironmentKey = attribute.Key("deployment.environment") +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/trace.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/trace.go new file mode 100644 index 000000000000..145fc6076896 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/trace.go @@ -0,0 +1,376 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package semconv // import "go.opentelemetry.io/otel/semconv" + +import "go.opentelemetry.io/otel/attribute" + +// Semantic conventions for attribute keys used for network related +// operations. +const ( + // Transport protocol used. + NetTransportKey = attribute.Key("net.transport") + + // Remote address of the peer. + NetPeerIPKey = attribute.Key("net.peer.ip") + + // Remote port number. + NetPeerPortKey = attribute.Key("net.peer.port") + + // Remote hostname or similar. + NetPeerNameKey = attribute.Key("net.peer.name") + + // Local host IP. Useful in case of a multi-IP host. + NetHostIPKey = attribute.Key("net.host.ip") + + // Local host port. + NetHostPortKey = attribute.Key("net.host.port") + + // Local hostname or similar. + NetHostNameKey = attribute.Key("net.host.name") +) + +// Semantic conventions for common transport protocol attributes. +var ( + NetTransportTCP = NetTransportKey.String("IP.TCP") + NetTransportUDP = NetTransportKey.String("IP.UDP") + NetTransportIP = NetTransportKey.String("IP") + NetTransportUnix = NetTransportKey.String("Unix") + NetTransportPipe = NetTransportKey.String("pipe") + NetTransportInProc = NetTransportKey.String("inproc") + NetTransportOther = NetTransportKey.String("other") +) + +// General attribute keys for spans. +const ( + // Service name of the remote service. Should equal the actual + // `service.name` resource attribute of the remote service, if any. + PeerServiceKey = attribute.Key("peer.service") +) + +// Semantic conventions for attribute keys used to identify an authorized +// user. +const ( + // Username or the client identifier extracted from the access token or + // authorization header in the inbound request from outside the system. + EnduserIDKey = attribute.Key("enduser.id") + + // Actual or assumed role the client is making the request with. + EnduserRoleKey = attribute.Key("enduser.role") + + // Scopes or granted authorities the client currently possesses. + EnduserScopeKey = attribute.Key("enduser.scope") +) + +// Semantic conventions for attribute keys for HTTP. +const ( + // HTTP request method. + HTTPMethodKey = attribute.Key("http.method") + + // Full HTTP request URL in the form: + // scheme://host[:port]/path?query[#fragment]. + HTTPURLKey = attribute.Key("http.url") + + // The full request target as passed in a HTTP request line or + // equivalent, e.g. "/path/12314/?q=ddds#123". + HTTPTargetKey = attribute.Key("http.target") + + // The value of the HTTP host header. + HTTPHostKey = attribute.Key("http.host") + + // The URI scheme identifying the used protocol. + HTTPSchemeKey = attribute.Key("http.scheme") + + // HTTP response status code. + HTTPStatusCodeKey = attribute.Key("http.status_code") + + // Kind of HTTP protocol used. + HTTPFlavorKey = attribute.Key("http.flavor") + + // Value of the HTTP User-Agent header sent by the client. + HTTPUserAgentKey = attribute.Key("http.user_agent") + + // The primary server name of the matched virtual host. + HTTPServerNameKey = attribute.Key("http.server_name") + + // The matched route served (path template). For example, + // "/users/:userID?". + HTTPRouteKey = attribute.Key("http.route") + + // The IP address of the original client behind all proxies, if known + // (e.g. from X-Forwarded-For). + HTTPClientIPKey = attribute.Key("http.client_ip") + + // The size of the request payload body in bytes. + HTTPRequestContentLengthKey = attribute.Key("http.request_content_length") + + // The size of the uncompressed request payload body after transport decoding. + // Not set if transport encoding not used. + HTTPRequestContentLengthUncompressedKey = attribute.Key("http.request_content_length_uncompressed") + + // The size of the response payload body in bytes. + HTTPResponseContentLengthKey = attribute.Key("http.response_content_length") + + // The size of the uncompressed response payload body after transport decoding. + // Not set if transport encoding not used. + HTTPResponseContentLengthUncompressedKey = attribute.Key("http.response_content_length_uncompressed") +) + +// Semantic conventions for common HTTP attributes. +var ( + // Semantic conventions for HTTP(S) URI schemes. + HTTPSchemeHTTP = HTTPSchemeKey.String("http") + HTTPSchemeHTTPS = HTTPSchemeKey.String("https") + + // Semantic conventions for HTTP protocols. + HTTPFlavor1_0 = HTTPFlavorKey.String("1.0") + HTTPFlavor1_1 = HTTPFlavorKey.String("1.1") + HTTPFlavor2 = HTTPFlavorKey.String("2") + HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY") + HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC") +) + +// Semantic conventions for attribute keys for database connections. +const ( + // Identifier for the database system (DBMS) being used. + DBSystemKey = attribute.Key("db.system") + + // Database Connection String with embedded credentials removed. + DBConnectionStringKey = attribute.Key("db.connection_string") + + // Username for accessing database. + DBUserKey = attribute.Key("db.user") +) + +// Semantic conventions for common database system attributes. +var ( + DBSystemDB2 = DBSystemKey.String("db2") // IBM DB2 + DBSystemDerby = DBSystemKey.String("derby") // Apache Derby + DBSystemHive = DBSystemKey.String("hive") // Apache Hive + DBSystemMariaDB = DBSystemKey.String("mariadb") // MariaDB + DBSystemMSSql = DBSystemKey.String("mssql") // Microsoft SQL Server + DBSystemMySQL = DBSystemKey.String("mysql") // MySQL + DBSystemOracle = DBSystemKey.String("oracle") // Oracle Database + DBSystemPostgres = DBSystemKey.String("postgresql") // PostgreSQL + DBSystemSqlite = DBSystemKey.String("sqlite") // SQLite + DBSystemTeradata = DBSystemKey.String("teradata") // Teradata + DBSystemOtherSQL = DBSystemKey.String("other_sql") // Some other Sql database. Fallback only + DBSystemCassandra = DBSystemKey.String("cassandra") // Cassandra + DBSystemCosmosDB = DBSystemKey.String("cosmosdb") // Microsoft Azure CosmosDB + DBSystemCouchbase = DBSystemKey.String("couchbase") // Couchbase + DBSystemCouchDB = DBSystemKey.String("couchdb") // CouchDB + DBSystemDynamoDB = DBSystemKey.String("dynamodb") // Amazon DynamoDB + DBSystemHBase = DBSystemKey.String("hbase") // HBase + DBSystemMongodb = DBSystemKey.String("mongodb") // MongoDB + DBSystemNeo4j = DBSystemKey.String("neo4j") // Neo4j + DBSystemRedis = DBSystemKey.String("redis") // Redis +) + +// Semantic conventions for attribute keys for database calls. +const ( + // Database instance name. + DBNameKey = attribute.Key("db.name") + + // A database statement for the given database type. + DBStatementKey = attribute.Key("db.statement") + + // A database operation for the given database type. + DBOperationKey = attribute.Key("db.operation") +) + +// Database technology-specific attributes +const ( + // Name of the Cassandra keyspace accessed. Use instead of `db.name`. + DBCassandraKeyspaceKey = attribute.Key("db.cassandra.keyspace") + + // HBase namespace accessed. Use instead of `db.name`. + DBHBaseNamespaceKey = attribute.Key("db.hbase.namespace") + + // Index of Redis database accessed. Use instead of `db.name`. + DBRedisDBIndexKey = attribute.Key("db.redis.database_index") + + // Collection being accessed within the database in `db.name`. + DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") +) + +// Semantic conventions for attribute keys for RPC. +const ( + // A string identifying the remoting system. + RPCSystemKey = attribute.Key("rpc.system") + + // The full name of the service being called. + RPCServiceKey = attribute.Key("rpc.service") + + // The name of the method being called. + RPCMethodKey = attribute.Key("rpc.method") + + // Name of message transmitted or received. + RPCNameKey = attribute.Key("name") + + // Type of message transmitted or received. + RPCMessageTypeKey = attribute.Key("message.type") + + // Identifier of message transmitted or received. + RPCMessageIDKey = attribute.Key("message.id") + + // The compressed size of the message transmitted or received in bytes. + RPCMessageCompressedSizeKey = attribute.Key("message.compressed_size") + + // The uncompressed size of the message transmitted or received in + // bytes. + RPCMessageUncompressedSizeKey = attribute.Key("message.uncompressed_size") +) + +// Semantic conventions for common RPC attributes. +var ( + // Semantic convention for gRPC as the remoting system. + RPCSystemGRPC = RPCSystemKey.String("grpc") + + // Semantic convention for a message named message. + RPCNameMessage = RPCNameKey.String("message") + + // Semantic conventions for RPC message types. + RPCMessageTypeSent = RPCMessageTypeKey.String("SENT") + RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED") +) + +// Semantic conventions for attribute keys for messaging systems. +const ( + // A unique identifier describing the messaging system. For example, + // kafka, rabbitmq or activemq. + MessagingSystemKey = attribute.Key("messaging.system") + + // The message destination name, e.g. MyQueue or MyTopic. + MessagingDestinationKey = attribute.Key("messaging.destination") + + // The kind of message destination. + MessagingDestinationKindKey = attribute.Key("messaging.destination_kind") + + // Describes if the destination is temporary or not. + MessagingTempDestinationKey = attribute.Key("messaging.temp_destination") + + // The name of the transport protocol. + MessagingProtocolKey = attribute.Key("messaging.protocol") + + // The version of the transport protocol. + MessagingProtocolVersionKey = attribute.Key("messaging.protocol_version") + + // Messaging service URL. + MessagingURLKey = attribute.Key("messaging.url") + + // Identifier used by the messaging system for a message. + MessagingMessageIDKey = attribute.Key("messaging.message_id") + + // Identifier used by the messaging system for a conversation. + MessagingConversationIDKey = attribute.Key("messaging.conversation_id") + + // The (uncompressed) size of the message payload in bytes. + MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message_payload_size_bytes") + + // The compressed size of the message payload in bytes. + MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message_payload_compressed_size_bytes") + + // Identifies which part and kind of message consumption is being + // preformed. + MessagingOperationKey = attribute.Key("messaging.operation") + + // RabbitMQ specific attribute describing the destination routing key. + MessagingRabbitMQRoutingKeyKey = attribute.Key("messaging.rabbitmq.routing_key") +) + +// Semantic conventions for common messaging system attributes. +var ( + // Semantic conventions for message destinations. + MessagingDestinationKindKeyQueue = MessagingDestinationKindKey.String("queue") + MessagingDestinationKindKeyTopic = MessagingDestinationKindKey.String("topic") + + // Semantic convention for message destinations that are temporary. + MessagingTempDestination = MessagingTempDestinationKey.Bool(true) + + // Semantic convention for the operation parts of message consumption. + // This does not include a "send" attribute as that is explicitly not + // allowed in the OpenTelemetry specification. + MessagingOperationReceive = MessagingOperationKey.String("receive") + MessagingOperationProcess = MessagingOperationKey.String("process") +) + +// Semantic conventions for attribute keys for FaaS systems. +const ( + + // Type of the trigger on which the function is executed. + FaaSTriggerKey = attribute.Key("faas.trigger") + + // String containing the execution identifier of the function. + FaaSExecutionKey = attribute.Key("faas.execution") + + // A boolean indicating that the serverless function is executed + // for the first time (aka cold start). + FaaSColdstartKey = attribute.Key("faas.coldstart") + + // The name of the source on which the operation was performed. + // For example, in Cloud Storage or S3 corresponds to the bucket name, + // and in Cosmos DB to the database name. + FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") + + // The type of the operation that was performed on the data. + FaaSDocumentOperationKey = attribute.Key("faas.document.operation") + + // A string containing the time when the data was accessed. + FaaSDocumentTimeKey = attribute.Key("faas.document.time") + + // The document name/table subjected to the operation. + FaaSDocumentNameKey = attribute.Key("faas.document.name") + + // The function invocation time. + FaaSTimeKey = attribute.Key("faas.time") + + // The schedule period as Cron Expression. + FaaSCronKey = attribute.Key("faas.cron") +) + +// Semantic conventions for common FaaS system attributes. +var ( + // Semantic conventions for the types of triggers. + FaasTriggerDatasource = FaaSTriggerKey.String("datasource") + FaasTriggerHTTP = FaaSTriggerKey.String("http") + FaasTriggerPubSub = FaaSTriggerKey.String("pubsub") + FaasTriggerTimer = FaaSTriggerKey.String("timer") + FaasTriggerOther = FaaSTriggerKey.String("other") + + // Semantic conventions for the types of operations performed. + FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") + FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") + FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") +) + +// Semantic conventions for source code attributes. +const ( + // The method or function name, or equivalent (usually rightmost part of + // the code unit's name). + CodeFunctionKey = attribute.Key("code.function") + + // The "namespace" within which `code.function` is defined. Usually the + // qualified class or module name, such that + // `code.namespace` + some separator + `code.function` form a unique + // identifier for the code unit. + CodeNamespaceKey = attribute.Key("code.namespace") + + // The source code file name that identifies the code unit as uniquely as + // possible (preferably an absolute file path). + CodeFilepathKey = attribute.Key("code.filepath") + + // The line number in `code.filepath` best representing the operation. + // It SHOULD point within the code unit named in `code.function`. + CodeLineNumberKey = attribute.Key("code.lineno") +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/tag.sh b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/tag.sh new file mode 100644 index 000000000000..70767c70377e --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/tag.sh @@ -0,0 +1,178 @@ +#!/usr/bin/env bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +readonly PROGNAME=$(basename "$0") +readonly PROGDIR=$(readlink -m "$(dirname "$0")") + +readonly EXCLUDE_PACKAGES="internal/tools" +readonly SEMVER_REGEX="v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?" + +usage() { + cat <<- EOF +Usage: $PROGNAME [OPTIONS] SEMVER_TAG COMMIT_HASH + +Creates git tag for all Go packages in project. + +OPTIONS: + -h --help Show this help. + +ARGUMENTS: + SEMVER_TAG Semantic version to tag with. + COMMIT_HASH Git commit hash to tag. +EOF +} + +cmdline() { + local arg commit + + for arg + do + local delim="" + case "$arg" in + # Translate long form options to short form. + --help) args="${args}-h ";; + # Pass through for everything else. + *) [[ "${arg:0:1}" == "-" ]] || delim="\"" + args="${args}${delim}${arg}${delim} ";; + esac + done + + # Reset and process short form options. + eval set -- "$args" + + while getopts "h" OPTION + do + case $OPTION in + h) + usage + exit 0 + ;; + *) + echo "unknown option: $OPTION" + usage + exit 1 + ;; + esac + done + + # Positional arguments. + shift $((OPTIND-1)) + readonly TAG="$1" + if [ -z "$TAG" ] + then + echo "missing SEMVER_TAG" + usage + exit 1 + fi + if [[ ! "$TAG" =~ $SEMVER_REGEX ]] + then + printf "invalid semantic version: %s\n" "$TAG" + exit 2 + fi + if [[ "$( git tag --list "$TAG" )" ]] + then + printf "tag already exists: %s\n" "$TAG" + exit 2 + fi + + shift + commit="$1" + if [ -z "$commit" ] + then + echo "missing COMMIT_HASH" + usage + exit 1 + fi + # Verify rev is for a commit and unify hashes into a complete SHA1. + readonly SHA="$( git rev-parse --quiet --verify "${commit}^{commit}" )" + if [ -z "$SHA" ] + then + printf "invalid commit hash: %s\n" "$commit" + exit 2 + fi + if [ "$( git merge-base "$SHA" HEAD )" != "$SHA" ] + then + printf "commit '%s' not found on this branch\n" "$commit" + exit 2 + fi +} + +package_dirs() { + # Return a list of package directories in the form: + # + # package/directory/a + # package/directory/b + # deeper/package/directory/a + # ... + # + # Making sure to exclude any packages in the EXCLUDE_PACKAGES regexp. + find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; \ + | grep -E -v "$EXCLUDE_PACKAGES" \ + | sed 's/^\.\///' \ + | sort +} + +git_tag() { + local tag="$1" + local commit="$2" + + git tag -a "$tag" -s -m "Version $tag" "$commit" +} + +previous_version() { + local current="$1" + + # Requires git > 2.0 + git tag -l --sort=v:refname \ + | grep -E "^${SEMVER_REGEX}$" \ + | grep -v "$current" \ + | tail -1 +} + +print_changes() { + local tag="$1" + local previous + + previous="$( previous_version "$tag" )" + if [ -n "$previous" ] + then + printf "\nRaw changes made between %s and %s\n" "$previous" "$tag" + printf "======================================\n" + git --no-pager log --pretty=oneline "${previous}..$tag" + fi +} + +main() { + local dir + + cmdline "$@" + + cd "$PROGDIR" || exit 3 + + # Create tag for root package. + git_tag "$TAG" "$SHA" + printf "created tag: %s\n" "$TAG" + + # Create tag for all sub-packages. + for dir in $( package_dirs ) + do + git_tag "${dir}/$TAG" "$SHA" + printf "created tag: %s\n" "${dir}/$TAG" + done + + print_changes "$TAG" +} +main "$@" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace.go new file mode 100644 index 000000000000..1d5ffb8ea574 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace.go @@ -0,0 +1,44 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/trace" +) + +// Tracer creates a named tracer that implements Tracer interface. +// If the name is an empty string then provider uses default name. +// +// This is short for GetTracerProvider().Tracer(name) +func Tracer(name string) trace.Tracer { + return GetTracerProvider().Tracer(name) +} + +// GetTracerProvider returns the registered global trace provider. +// If none is registered then an instance of NoopTracerProvider is returned. +// +// Use the trace provider to create a named tracer. E.g. +// tracer := global.GetTracerProvider().Tracer("example.com/foo") +// or +// tracer := global.Tracer("example.com/foo") +func GetTracerProvider() trace.TracerProvider { + return global.TracerProvider() +} + +// SetTracerProvider registers `tp` as the global trace provider. +func SetTracerProvider(tp trace.TracerProvider) { + global.SetTracerProvider(tp) +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/LICENSE b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/config.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/config.go new file mode 100644 index 000000000000..ea30ee35f153 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/config.go @@ -0,0 +1,205 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace + +import ( + "time" + + "go.opentelemetry.io/otel/attribute" +) + +// TracerConfig is a group of options for a Tracer. +type TracerConfig struct { + // InstrumentationVersion is the version of the library providing + // instrumentation. + InstrumentationVersion string +} + +// NewTracerConfig applies all the options to a returned TracerConfig. +func NewTracerConfig(options ...TracerOption) *TracerConfig { + config := new(TracerConfig) + for _, option := range options { + option.ApplyTracer(config) + } + return config +} + +// TracerOption applies an option to a TracerConfig. +type TracerOption interface { + ApplyTracer(*TracerConfig) + + // A private method to prevent users implementing the + // interface and so future additions to it will not + // violate compatibility. + private() +} + +// SpanConfig is a group of options for a Span. +type SpanConfig struct { + // Attributes describe the associated qualities of a Span. + Attributes []attribute.KeyValue + // Timestamp is a time in a Span life-cycle. + Timestamp time.Time + // Links are the associations a Span has with other Spans. + Links []Link + // NewRoot identifies a Span as the root Span for a new trace. This is + // commonly used when an existing trace crosses trust boundaries and the + // remote parent span context should be ignored for security. + NewRoot bool + // SpanKind is the role a Span has in a trace. + SpanKind SpanKind +} + +// NewSpanConfig applies all the options to a returned SpanConfig. +// No validation is performed on the returned SpanConfig (e.g. no uniqueness +// checking or bounding of data), it is left to the SDK to perform this +// action. +func NewSpanConfig(options ...SpanOption) *SpanConfig { + c := new(SpanConfig) + for _, option := range options { + option.ApplySpan(c) + } + return c +} + +// SpanOption applies an option to a SpanConfig. +type SpanOption interface { + ApplySpan(*SpanConfig) + + // A private method to prevent users implementing the + // interface and so future additions to it will not + // violate compatibility. + private() +} + +// NewEventConfig applies all the EventOptions to a returned SpanConfig. If no +// timestamp option is passed, the returned SpanConfig will have a Timestamp +// set to the call time, otherwise no validation is performed on the returned +// SpanConfig. +func NewEventConfig(options ...EventOption) *SpanConfig { + c := new(SpanConfig) + for _, option := range options { + option.ApplyEvent(c) + } + if c.Timestamp.IsZero() { + c.Timestamp = time.Now() + } + return c +} + +// EventOption applies span event options to a SpanConfig. +type EventOption interface { + ApplyEvent(*SpanConfig) + + // A private method to prevent users implementing the + // interface and so future additions to it will not + // violate compatibility. + private() +} + +// LifeCycleOption applies span life-cycle options to a SpanConfig. These +// options set values releated to events in a spans life-cycle like starting, +// ending, experiencing an error and other user defined notable events. +type LifeCycleOption interface { + SpanOption + EventOption +} + +type attributeSpanOption []attribute.KeyValue + +func (o attributeSpanOption) ApplySpan(c *SpanConfig) { o.apply(c) } +func (o attributeSpanOption) ApplyEvent(c *SpanConfig) { o.apply(c) } +func (attributeSpanOption) private() {} +func (o attributeSpanOption) apply(c *SpanConfig) { + c.Attributes = append(c.Attributes, []attribute.KeyValue(o)...) +} + +// WithAttributes adds the attributes related to a span life-cycle event. +// These attributes are used to describe the work a Span represents when this +// option is provided to a Span's start or end events. Otherwise, these +// attributes provide additional information about the event being recorded +// (e.g. error, state change, processing progress, system event). +// +// If multiple of these options are passed the attributes of each successive +// option will extend the attributes instead of overwriting. There is no +// guarantee of uniqueness in the resulting attributes. +func WithAttributes(attributes ...attribute.KeyValue) LifeCycleOption { + return attributeSpanOption(attributes) +} + +type timestampSpanOption time.Time + +func (o timestampSpanOption) ApplySpan(c *SpanConfig) { o.apply(c) } +func (o timestampSpanOption) ApplyEvent(c *SpanConfig) { o.apply(c) } +func (timestampSpanOption) private() {} +func (o timestampSpanOption) apply(c *SpanConfig) { c.Timestamp = time.Time(o) } + +// WithTimestamp sets the time of a Span life-cycle moment (e.g. started, +// stopped, errored). +func WithTimestamp(t time.Time) LifeCycleOption { + return timestampSpanOption(t) +} + +type linksSpanOption []Link + +func (o linksSpanOption) ApplySpan(c *SpanConfig) { c.Links = append(c.Links, []Link(o)...) } +func (linksSpanOption) private() {} + +// WithLinks adds links to a Span. The links are added to the existing Span +// links, i.e. this does not overwrite. +func WithLinks(links ...Link) SpanOption { + return linksSpanOption(links) +} + +type newRootSpanOption bool + +func (o newRootSpanOption) ApplySpan(c *SpanConfig) { c.NewRoot = bool(o) } +func (newRootSpanOption) private() {} + +// WithNewRoot specifies that the Span should be treated as a root Span. Any +// existing parent span context will be ignored when defining the Span's trace +// identifiers. +func WithNewRoot() SpanOption { + return newRootSpanOption(true) +} + +type spanKindSpanOption SpanKind + +func (o spanKindSpanOption) ApplySpan(c *SpanConfig) { c.SpanKind = SpanKind(o) } +func (o spanKindSpanOption) private() {} + +// WithSpanKind sets the SpanKind of a Span. +func WithSpanKind(kind SpanKind) SpanOption { + return spanKindSpanOption(kind) +} + +// InstrumentationOption is an interface for applying instrumentation specific +// options. +type InstrumentationOption interface { + TracerOption +} + +// WithInstrumentationVersion sets the instrumentation version. +func WithInstrumentationVersion(version string) InstrumentationOption { + return instrumentationVersionOption(version) +} + +type instrumentationVersionOption string + +func (i instrumentationVersionOption) ApplyTracer(config *TracerConfig) { + config.InstrumentationVersion = string(i) +} + +func (instrumentationVersionOption) private() {} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/context.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/context.go new file mode 100644 index 000000000000..76f9a083c409 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/context.go @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import "context" + +type traceContextKeyType int + +const currentSpanKey traceContextKeyType = iota + +// ContextWithSpan returns a copy of parent with span set as the current Span. +func ContextWithSpan(parent context.Context, span Span) context.Context { + return context.WithValue(parent, currentSpanKey, span) +} + +// ContextWithSpanContext returns a copy of parent with sc as the current +// Span. The Span implementation that wraps sc is non-recording and performs +// no operations other than to return sc as the SpanContext from the +// SpanContext method. +func ContextWithSpanContext(parent context.Context, sc SpanContext) context.Context { + return ContextWithSpan(parent, nonRecordingSpan{sc: sc}) +} + +// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicly +// as a remote SpanContext and as the current Span. The Span implementation +// that wraps rsc is non-recording and performs no operations other than to +// return rsc as the SpanContext from the SpanContext method. +func ContextWithRemoteSpanContext(parent context.Context, rsc SpanContext) context.Context { + return ContextWithSpanContext(parent, rsc.WithRemote(true)) +} + +// SpanFromContext returns the current Span from ctx. +// +// If no Span is currently set in ctx an implementation of a Span that +// performs no operations is returned. +func SpanFromContext(ctx context.Context) Span { + if ctx == nil { + return noopSpan{} + } + if span, ok := ctx.Value(currentSpanKey).(Span); ok { + return span + } + return noopSpan{} +} + +// SpanContextFromContext returns the current Span's SpanContext. +func SpanContextFromContext(ctx context.Context) SpanContext { + return SpanFromContext(ctx).SpanContext() +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/doc.go new file mode 100644 index 000000000000..c962f3bc6229 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/doc.go @@ -0,0 +1,70 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package trace provides an implementation of the tracing part of the +OpenTelemetry API. + +This package is currently in a pre-GA phase. Backwards incompatible changes +may be introduced in subsequent minor version releases as we work to track the +evolving OpenTelemetry specification and user feedback. + +To participate in distributed traces a Span needs to be created for the +operation being performed as part of a traced workflow. It its simplest form: + + var tracer trace.Tracer + + func init() { + tracer = otel.Tracer("instrumentation/package/name") + } + + func operation(ctx context.Context) { + var span trace.Span + ctx, span = tracer.Start(ctx, "operation") + defer span.End() + // ... + } + +A Tracer is unique to the instrumentation and is used to create Spans. +Instrumentation should be designed to accept a TracerProvider from which it +can create its own unique Tracer. Alternatively, the registered global +TracerProvider from the go.opentelemetry.io/otel package can be used as +a default. + + const ( + name = "instrumentation/package/name" + version = "0.1.0" + ) + + type Instrumentation struct { + tracer trace.Tracer + } + + func NewInstrumentation(tp trace.TracerProvider) *Instrumentation { + if tp == nil { + tp = otel.TracerProvider() + } + return &Instrumentation{ + tracer: tp.Tracer(name, trace.WithInstrumentationVersion(version)), + } + } + + func operation(ctx context.Context, inst *Instrumentation) { + var span trace.Span + ctx, span = inst.tracer.Start(ctx, "operation") + defer span.End() + // ... + } +*/ +package trace // import "go.opentelemetry.io/otel/trace" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/go.mod b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/go.mod new file mode 100644 index 000000000000..914e4f4384a3 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/go.mod @@ -0,0 +1,53 @@ +module go.opentelemetry.io/otel/trace + +go 1.14 + +replace go.opentelemetry.io/otel => ../ + +replace go.opentelemetry.io/otel/bridge/opencensus => ../bridge/opencensus + +replace go.opentelemetry.io/otel/bridge/opentracing => ../bridge/opentracing + +replace go.opentelemetry.io/otel/example/jaeger => ../example/jaeger + +replace go.opentelemetry.io/otel/example/namedtracer => ../example/namedtracer + +replace go.opentelemetry.io/otel/example/opencensus => ../example/opencensus + +replace go.opentelemetry.io/otel/example/otel-collector => ../example/otel-collector + +replace go.opentelemetry.io/otel/example/prom-collector => ../example/prom-collector + +replace go.opentelemetry.io/otel/example/prometheus => ../example/prometheus + +replace go.opentelemetry.io/otel/example/zipkin => ../example/zipkin + +replace go.opentelemetry.io/otel/exporters/metric/prometheus => ../exporters/metric/prometheus + +replace go.opentelemetry.io/otel/exporters/otlp => ../exporters/otlp + +replace go.opentelemetry.io/otel/exporters/stdout => ../exporters/stdout + +replace go.opentelemetry.io/otel/exporters/trace/jaeger => ../exporters/trace/jaeger + +replace go.opentelemetry.io/otel/exporters/trace/zipkin => ../exporters/trace/zipkin + +replace go.opentelemetry.io/otel/internal/tools => ../internal/tools + +replace go.opentelemetry.io/otel/metric => ../metric + +replace go.opentelemetry.io/otel/oteltest => ../oteltest + +replace go.opentelemetry.io/otel/sdk => ../sdk + +replace go.opentelemetry.io/otel/sdk/export/metric => ../sdk/export/metric + +replace go.opentelemetry.io/otel/sdk/metric => ../sdk/metric + +replace go.opentelemetry.io/otel/trace => ./ + +require ( + github.com/google/go-cmp v0.5.5 + github.com/stretchr/testify v1.7.0 + go.opentelemetry.io/otel v0.20.0 +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/go.sum b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/go.sum new file mode 100644 index 000000000000..b69f2e56da0f --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/nonrecording.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/nonrecording.go new file mode 100644 index 000000000000..88fcb81611f9 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/nonrecording.go @@ -0,0 +1,27 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +// nonRecordingSpan is a minimal implementation of a Span that wraps a +// SpanContext. It performs no operations other than to return the wrapped +// SpanContext. +type nonRecordingSpan struct { + noopSpan + + sc SpanContext +} + +// SpanContext returns the wrapped SpanContext. +func (s nonRecordingSpan) SpanContext() SpanContext { return s.sc } diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/noop.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/noop.go new file mode 100644 index 000000000000..4a20f20cb41d --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/noop.go @@ -0,0 +1,84 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" +) + +// NewNoopTracerProvider returns an implementation of TracerProvider that +// performs no operations. The Tracer and Spans created from the returned +// TracerProvider also perform no operations. +func NewNoopTracerProvider() TracerProvider { + return noopTracerProvider{} +} + +type noopTracerProvider struct{} + +var _ TracerProvider = noopTracerProvider{} + +// Tracer returns noop implementation of Tracer. +func (p noopTracerProvider) Tracer(string, ...TracerOption) Tracer { + return noopTracer{} +} + +// noopTracer is an implementation of Tracer that preforms no operations. +type noopTracer struct{} + +var _ Tracer = noopTracer{} + +// Start starts a noop span. +func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanOption) (context.Context, Span) { + span := noopSpan{} + return ContextWithSpan(ctx, span), span +} + +// noopSpan is an implementation of Span that preforms no operations. +type noopSpan struct{} + +var _ Span = noopSpan{} + +// SpanContext returns an empty span context. +func (noopSpan) SpanContext() SpanContext { return SpanContext{} } + +// IsRecording always returns false. +func (noopSpan) IsRecording() bool { return false } + +// SetStatus does nothing. +func (noopSpan) SetStatus(codes.Code, string) {} + +// SetError does nothing. +func (noopSpan) SetError(bool) {} + +// SetAttributes does nothing. +func (noopSpan) SetAttributes(...attribute.KeyValue) {} + +// End does nothing. +func (noopSpan) End(...SpanOption) {} + +// RecordError does nothing. +func (noopSpan) RecordError(error, ...EventOption) {} + +// Tracer returns the Tracer that created this Span. +func (noopSpan) Tracer() Tracer { return noopTracer{} } + +// AddEvent does nothing. +func (noopSpan) AddEvent(string, ...EventOption) {} + +// SetName does nothing. +func (noopSpan) SetName(string) {} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/trace.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/trace.go new file mode 100644 index 000000000000..d372e7d9d722 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/trace/trace.go @@ -0,0 +1,673 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + "regexp" + "strings" + "time" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" +) + +const ( + // FlagsSampled is a bitmask with the sampled bit set. A SpanContext + // with the sampling bit set means the span is sampled. + FlagsSampled = TraceFlags(0x01) + + errInvalidHexID errorConst = "trace-id and span-id can only contain [0-9a-f] characters, all lowercase" + + errInvalidTraceIDLength errorConst = "hex encoded trace-id must have length equals to 32" + errNilTraceID errorConst = "trace-id can't be all zero" + + errInvalidSpanIDLength errorConst = "hex encoded span-id must have length equals to 16" + errNilSpanID errorConst = "span-id can't be all zero" + + // based on the W3C Trace Context specification, see https://www.w3.org/TR/trace-context-1/#tracestate-header + traceStateKeyFormat = `[a-z][_0-9a-z\-\*\/]{0,255}` + traceStateKeyFormatWithMultiTenantVendor = `[a-z0-9][_0-9a-z\-\*\/]{0,240}@[a-z][_0-9a-z\-\*\/]{0,13}` + traceStateValueFormat = `[\x20-\x2b\x2d-\x3c\x3e-\x7e]{0,255}[\x21-\x2b\x2d-\x3c\x3e-\x7e]` + + traceStateMaxListMembers = 32 + + errInvalidTraceStateKeyValue errorConst = "provided key or value is not valid according to the" + + " W3C Trace Context specification" + errInvalidTraceStateMembersNumber errorConst = "trace state would exceed the maximum limit of members (32)" + errInvalidTraceStateDuplicate errorConst = "trace state key/value pairs with duplicate keys provided" +) + +type errorConst string + +func (e errorConst) Error() string { + return string(e) +} + +// TraceID is a unique identity of a trace. +// nolint:golint +type TraceID [16]byte + +var nilTraceID TraceID +var _ json.Marshaler = nilTraceID + +// IsValid checks whether the trace TraceID is valid. A valid trace ID does +// not consist of zeros only. +func (t TraceID) IsValid() bool { + return !bytes.Equal(t[:], nilTraceID[:]) +} + +// MarshalJSON implements a custom marshal function to encode TraceID +// as a hex string. +func (t TraceID) MarshalJSON() ([]byte, error) { + return json.Marshal(t.String()) +} + +// String returns the hex string representation form of a TraceID +func (t TraceID) String() string { + return hex.EncodeToString(t[:]) +} + +// SpanID is a unique identity of a span in a trace. +type SpanID [8]byte + +var nilSpanID SpanID +var _ json.Marshaler = nilSpanID + +// IsValid checks whether the SpanID is valid. A valid SpanID does not consist +// of zeros only. +func (s SpanID) IsValid() bool { + return !bytes.Equal(s[:], nilSpanID[:]) +} + +// MarshalJSON implements a custom marshal function to encode SpanID +// as a hex string. +func (s SpanID) MarshalJSON() ([]byte, error) { + return json.Marshal(s.String()) +} + +// String returns the hex string representation form of a SpanID +func (s SpanID) String() string { + return hex.EncodeToString(s[:]) +} + +// TraceIDFromHex returns a TraceID from a hex string if it is compliant with +// the W3C trace-context specification. See more at +// https://www.w3.org/TR/trace-context/#trace-id +// nolint:golint +func TraceIDFromHex(h string) (TraceID, error) { + t := TraceID{} + if len(h) != 32 { + return t, errInvalidTraceIDLength + } + + if err := decodeHex(h, t[:]); err != nil { + return t, err + } + + if !t.IsValid() { + return t, errNilTraceID + } + return t, nil +} + +// SpanIDFromHex returns a SpanID from a hex string if it is compliant +// with the w3c trace-context specification. +// See more at https://www.w3.org/TR/trace-context/#parent-id +func SpanIDFromHex(h string) (SpanID, error) { + s := SpanID{} + if len(h) != 16 { + return s, errInvalidSpanIDLength + } + + if err := decodeHex(h, s[:]); err != nil { + return s, err + } + + if !s.IsValid() { + return s, errNilSpanID + } + return s, nil +} + +func decodeHex(h string, b []byte) error { + for _, r := range h { + switch { + case 'a' <= r && r <= 'f': + continue + case '0' <= r && r <= '9': + continue + default: + return errInvalidHexID + } + } + + decoded, err := hex.DecodeString(h) + if err != nil { + return err + } + + copy(b, decoded) + return nil +} + +// TraceState provides additional vendor-specific trace identification information +// across different distributed tracing systems. It represents an immutable list consisting +// of key/value pairs. There can be a maximum of 32 entries in the list. +// +// Key and value of each list member must be valid according to the W3C Trace Context specification +// (see https://www.w3.org/TR/trace-context-1/#key and https://www.w3.org/TR/trace-context-1/#value +// respectively). +// +// Trace state must be valid according to the W3C Trace Context specification at all times. All +// mutating operations validate their input and, in case of valid parameters, return a new TraceState. +type TraceState struct { //nolint:golint + // TODO @matej-g: Consider implementing this as attribute.Set, see + // comment https://github.com/open-telemetry/opentelemetry-go/pull/1340#discussion_r540599226 + kvs []attribute.KeyValue +} + +var _ json.Marshaler = TraceState{} +var _ json.Marshaler = SpanContext{} + +var keyFormatRegExp = regexp.MustCompile( + `^((` + traceStateKeyFormat + `)|(` + traceStateKeyFormatWithMultiTenantVendor + `))$`, +) +var valueFormatRegExp = regexp.MustCompile(`^(` + traceStateValueFormat + `)$`) + +// MarshalJSON implements a custom marshal function to encode trace state. +func (ts TraceState) MarshalJSON() ([]byte, error) { + return json.Marshal(ts.kvs) +} + +// String returns trace state as a string valid according to the +// W3C Trace Context specification. +func (ts TraceState) String() string { + var sb strings.Builder + + for i, kv := range ts.kvs { + sb.WriteString((string)(kv.Key)) + sb.WriteByte('=') + sb.WriteString(kv.Value.Emit()) + + if i != len(ts.kvs)-1 { + sb.WriteByte(',') + } + } + + return sb.String() +} + +// Get returns a value for given key from the trace state. +// If no key is found or provided key is invalid, returns an empty value. +func (ts TraceState) Get(key attribute.Key) attribute.Value { + if !isTraceStateKeyValid(key) { + return attribute.Value{} + } + + for _, kv := range ts.kvs { + if kv.Key == key { + return kv.Value + } + } + + return attribute.Value{} +} + +// Insert adds a new key/value, if one doesn't exists; otherwise updates the existing entry. +// The new or updated entry is always inserted at the beginning of the TraceState, i.e. +// on the left side, as per the W3C Trace Context specification requirement. +func (ts TraceState) Insert(entry attribute.KeyValue) (TraceState, error) { + if !isTraceStateKeyValueValid(entry) { + return ts, errInvalidTraceStateKeyValue + } + + ckvs := ts.copyKVsAndDeleteEntry(entry.Key) + if len(ckvs)+1 > traceStateMaxListMembers { + return ts, errInvalidTraceStateMembersNumber + } + + ckvs = append(ckvs, attribute.KeyValue{}) + copy(ckvs[1:], ckvs) + ckvs[0] = entry + + return TraceState{ckvs}, nil +} + +// Delete removes specified entry from the trace state. +func (ts TraceState) Delete(key attribute.Key) (TraceState, error) { + if !isTraceStateKeyValid(key) { + return ts, errInvalidTraceStateKeyValue + } + + return TraceState{ts.copyKVsAndDeleteEntry(key)}, nil +} + +// IsEmpty returns true if the TraceState does not contain any entries +func (ts TraceState) IsEmpty() bool { + return len(ts.kvs) == 0 +} + +func (ts TraceState) copyKVsAndDeleteEntry(key attribute.Key) []attribute.KeyValue { + ckvs := make([]attribute.KeyValue, len(ts.kvs)) + copy(ckvs, ts.kvs) + for i, kv := range ts.kvs { + if kv.Key == key { + ckvs = append(ckvs[:i], ckvs[i+1:]...) + break + } + } + + return ckvs +} + +// TraceStateFromKeyValues is a convenience method to create a new TraceState from +// provided key/value pairs. +func TraceStateFromKeyValues(kvs ...attribute.KeyValue) (TraceState, error) { //nolint:golint + if len(kvs) == 0 { + return TraceState{}, nil + } + + if len(kvs) > traceStateMaxListMembers { + return TraceState{}, errInvalidTraceStateMembersNumber + } + + km := make(map[attribute.Key]bool) + for _, kv := range kvs { + if !isTraceStateKeyValueValid(kv) { + return TraceState{}, errInvalidTraceStateKeyValue + } + _, ok := km[kv.Key] + if ok { + return TraceState{}, errInvalidTraceStateDuplicate + } + km[kv.Key] = true + } + + ckvs := make([]attribute.KeyValue, len(kvs)) + copy(ckvs, kvs) + return TraceState{ckvs}, nil +} + +func isTraceStateKeyValid(key attribute.Key) bool { + return keyFormatRegExp.MatchString(string(key)) +} + +func isTraceStateKeyValueValid(kv attribute.KeyValue) bool { + return isTraceStateKeyValid(kv.Key) && + valueFormatRegExp.MatchString(kv.Value.Emit()) +} + +// TraceFlags contains flags that can be set on a SpanContext +type TraceFlags byte //nolint:golint + +// IsSampled returns if the sampling bit is set in the TraceFlags. +func (tf TraceFlags) IsSampled() bool { + return tf&FlagsSampled == FlagsSampled +} + +// WithSampled sets the sampling bit in a new copy of the TraceFlags. +func (tf TraceFlags) WithSampled(sampled bool) TraceFlags { + if sampled { + return tf | FlagsSampled + } + + return tf &^ FlagsSampled +} + +// MarshalJSON implements a custom marshal function to encode TraceFlags +// as a hex string. +func (tf TraceFlags) MarshalJSON() ([]byte, error) { + return json.Marshal(tf.String()) +} + +// String returns the hex string representation form of TraceFlags +func (tf TraceFlags) String() string { + return hex.EncodeToString([]byte{byte(tf)}[:]) +} + +// SpanContextConfig contains mutable fields usable for constructing +// an immutable SpanContext. +type SpanContextConfig struct { + TraceID TraceID + SpanID SpanID + TraceFlags TraceFlags + TraceState TraceState + Remote bool +} + +// NewSpanContext constructs a SpanContext using values from the provided +// SpanContextConfig. +func NewSpanContext(config SpanContextConfig) SpanContext { + return SpanContext{ + traceID: config.TraceID, + spanID: config.SpanID, + traceFlags: config.TraceFlags, + traceState: config.TraceState, + remote: config.Remote, + } +} + +// SpanContext contains identifying trace information about a Span. +type SpanContext struct { + traceID TraceID + spanID SpanID + traceFlags TraceFlags + traceState TraceState + remote bool +} + +// IsValid returns if the SpanContext is valid. A valid span context has a +// valid TraceID and SpanID. +func (sc SpanContext) IsValid() bool { + return sc.HasTraceID() && sc.HasSpanID() +} + +// IsRemote indicates whether the SpanContext represents a remotely-created Span. +func (sc SpanContext) IsRemote() bool { + return sc.remote +} + +// WithRemote returns a copy of sc with the Remote property set to remote. +func (sc SpanContext) WithRemote(remote bool) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: remote, + } +} + +// TraceID returns the TraceID from the SpanContext. +func (sc SpanContext) TraceID() TraceID { + return sc.traceID +} + +// HasTraceID checks if the SpanContext has a valid TraceID. +func (sc SpanContext) HasTraceID() bool { + return sc.traceID.IsValid() +} + +// WithTraceID returns a new SpanContext with the TraceID replaced. +func (sc SpanContext) WithTraceID(traceID TraceID) SpanContext { + return SpanContext{ + traceID: traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// SpanID returns the SpanID from the SpanContext. +func (sc SpanContext) SpanID() SpanID { + return sc.spanID +} + +// HasSpanID checks if the SpanContext has a valid SpanID. +func (sc SpanContext) HasSpanID() bool { + return sc.spanID.IsValid() +} + +// WithSpanID returns a new SpanContext with the SpanID replaced. +func (sc SpanContext) WithSpanID(spanID SpanID) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// TraceFlags returns the flags from the SpanContext. +func (sc SpanContext) TraceFlags() TraceFlags { + return sc.traceFlags +} + +// IsSampled returns if the sampling bit is set in the SpanContext's TraceFlags. +func (sc SpanContext) IsSampled() bool { + return sc.traceFlags.IsSampled() +} + +// WithTraceFlags returns a new SpanContext with the TraceFlags replaced. +func (sc SpanContext) WithTraceFlags(flags TraceFlags) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: flags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// TraceState returns the TraceState from the SpanContext. +func (sc SpanContext) TraceState() TraceState { + return sc.traceState +} + +// WithTraceState returns a new SpanContext with the TraceState replaced. +func (sc SpanContext) WithTraceState(state TraceState) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: state, + remote: sc.remote, + } +} + +// Equal is a predicate that determines whether two SpanContext values are equal. +func (sc SpanContext) Equal(other SpanContext) bool { + return sc.traceID == other.traceID && + sc.spanID == other.spanID && + sc.traceFlags == other.traceFlags && + sc.traceState.String() == other.traceState.String() && + sc.remote == other.remote +} + +// MarshalJSON implements a custom marshal function to encode a SpanContext. +func (sc SpanContext) MarshalJSON() ([]byte, error) { + return json.Marshal(SpanContextConfig{ + TraceID: sc.traceID, + SpanID: sc.spanID, + TraceFlags: sc.traceFlags, + TraceState: sc.traceState, + Remote: sc.remote, + }) +} + +// Span is the individual component of a trace. It represents a single named +// and timed operation of a workflow that is traced. A Tracer is used to +// create a Span and it is then up to the operation the Span represents to +// properly end the Span when the operation itself ends. +type Span interface { + // Tracer returns the Tracer that created the Span. Tracer MUST NOT be + // nil. + Tracer() Tracer + + // End completes the Span. The Span is considered complete and ready to be + // delivered through the rest of the telemetry pipeline after this method + // is called. Therefore, updates to the Span are not allowed after this + // method has been called. + End(options ...SpanOption) + + // AddEvent adds an event with the provided name and options. + AddEvent(name string, options ...EventOption) + + // IsRecording returns the recording state of the Span. It will return + // true if the Span is active and events can be recorded. + IsRecording() bool + + // RecordError will record err as an exception span event for this span. An + // additional call toSetStatus is required if the Status of the Span should + // be set to Error, this method does not change the Span status. If this + // span is not being recorded or err is nil than this method does nothing. + RecordError(err error, options ...EventOption) + + // SpanContext returns the SpanContext of the Span. The returned + // SpanContext is usable even after the End has been called for the Span. + SpanContext() SpanContext + + // SetStatus sets the status of the Span in the form of a code and a + // message. SetStatus overrides the value of previous calls to SetStatus + // on the Span. + SetStatus(code codes.Code, msg string) + + // SetName sets the Span name. + SetName(name string) + + // SetAttributes sets kv as attributes of the Span. If a key from kv + // already exists for an attribute of the Span it will be overwritten with + // the value contained in kv. + SetAttributes(kv ...attribute.KeyValue) +} + +// Event is a thing that happened during a Span's lifetime. +type Event struct { + // Name is the name of this event + Name string + + // Attributes describe the aspects of the event. + Attributes []attribute.KeyValue + + // DroppedAttributeCount is the number of attributes that were not + // recorded due to configured limits being reached. + DroppedAttributeCount int + + // Time at which this event was recorded. + Time time.Time +} + +// Link is the relationship between two Spans. The relationship can be within +// the same Trace or across different Traces. +// +// For example, a Link is used in the following situations: +// +// 1. Batch Processing: A batch of operations may contain operations +// associated with one or more traces/spans. Since there can only be one +// parent SpanContext, a Link is used to keep reference to the +// SpanContext of all operations in the batch. +// 2. Public Endpoint: A SpanContext for an in incoming client request on a +// public endpoint should be considered untrusted. In such a case, a new +// trace with its own identity and sampling decision needs to be created, +// but this new trace needs to be related to the original trace in some +// form. A Link is used to keep reference to the original SpanContext and +// track the relationship. +type Link struct { + // SpanContext of the linked Span. + SpanContext + + // Attributes describe the aspects of the link. + Attributes []attribute.KeyValue + + // DroppedAttributeCount is the number of attributes that were not + // recorded due to configured limits being reached. + DroppedAttributeCount int +} + +// SpanKind is the role a Span plays in a Trace. +type SpanKind int + +// As a convenience, these match the proto definition, see +// https://github.com/open-telemetry/opentelemetry-proto/blob/30d237e1ff3ab7aa50e0922b5bebdd93505090af/opentelemetry/proto/trace/v1/trace.proto#L101-L129 +// +// The unspecified value is not a valid `SpanKind`. Use `ValidateSpanKind()` +// to coerce a span kind to a valid value. +const ( + // SpanKindUnspecified is an unspecified SpanKind and is not a valid + // SpanKind. SpanKindUnspecified should be replaced with SpanKindInternal + // if it is received. + SpanKindUnspecified SpanKind = 0 + // SpanKindInternal is a SpanKind for a Span that represents an internal + // operation within an application. + SpanKindInternal SpanKind = 1 + // SpanKindServer is a SpanKind for a Span that represents the operation + // of handling a request from a client. + SpanKindServer SpanKind = 2 + // SpanKindClient is a SpanKind for a Span that represents the operation + // of client making a request to a server. + SpanKindClient SpanKind = 3 + // SpanKindProducer is a SpanKind for a Span that represents the operation + // of a producer sending a message to a message broker. Unlike + // SpanKindClient and SpanKindServer, there is often no direct + // relationship between this kind of Span and a SpanKindConsumer kind. A + // SpanKindProducer Span will end once the message is accepted by the + // message broker which might not overlap with the processing of that + // message. + SpanKindProducer SpanKind = 4 + // SpanKindConsumer is a SpanKind for a Span that represents the operation + // of a consumer receiving a message from a message broker. Like + // SpanKindProducer Spans, there is often no direct relationship between + // this Span and the Span that produced the message. + SpanKindConsumer SpanKind = 5 +) + +// ValidateSpanKind returns a valid span kind value. This will coerce +// invalid values into the default value, SpanKindInternal. +func ValidateSpanKind(spanKind SpanKind) SpanKind { + switch spanKind { + case SpanKindInternal, + SpanKindServer, + SpanKindClient, + SpanKindProducer, + SpanKindConsumer: + // valid + return spanKind + default: + return SpanKindInternal + } +} + +// String returns the specified name of the SpanKind in lower-case. +func (sk SpanKind) String() string { + switch sk { + case SpanKindInternal: + return "internal" + case SpanKindServer: + return "server" + case SpanKindClient: + return "client" + case SpanKindProducer: + return "producer" + case SpanKindConsumer: + return "consumer" + default: + return "unspecified" + } +} + +// Tracer is the creator of Spans. +type Tracer interface { + // Start creates a span. + Start(ctx context.Context, spanName string, opts ...SpanOption) (context.Context, Span) +} + +// TracerProvider provides access to instrumentation Tracers. +type TracerProvider interface { + // Tracer creates an implementation of the Tracer interface. + // The instrumentationName must be the name of the library providing + // instrumentation. This name may be the same as the instrumented code + // only if that code provides built-in instrumentation. If the + // instrumentationName is empty, then a implementation defined default + // name will be used instead. + // + // This method must be concurrency safe. + Tracer(instrumentationName string, opts ...TracerOption) Tracer +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/unit/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/unit/doc.go new file mode 100644 index 000000000000..0d77a750cc32 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/unit/doc.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package unit provides units. +// +// This package is currently in a pre-GA phase. Backwards incompatible changes +// may be introduced in subsequent minor version releases as we work to track +// the evolving OpenTelemetry specification and user feedback. +package unit // import "go.opentelemetry.io/otel/unit" diff --git a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/init_windows.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/unit/unit.go similarity index 73% rename from cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/init_windows.go rename to cluster-autoscaler/vendor/go.opentelemetry.io/otel/unit/unit.go index 45530506537f..523bfe1d0a12 100644 --- a/cluster-autoscaler/vendor/github.com/coreos/pkg/capnslog/init_windows.go +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/unit/unit.go @@ -1,4 +1,4 @@ -// Copyright 2015 CoreOS, Inc. +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,14 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -package capnslog +package unit // import "go.opentelemetry.io/otel/unit" -import "os" +type Unit string -func init() { - initHijack() - - // Go `log` package uses os.Stderr. - SetFormatter(NewPrettyFormatter(os.Stderr, false)) - SetGlobalLogLevel(INFO) -} +const ( + Dimensionless Unit = "1" + Bytes Unit = "By" + Milliseconds Unit = "ms" +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/verify_examples.sh b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/verify_examples.sh new file mode 100644 index 000000000000..dbb61a422795 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/verify_examples.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +cd $(dirname $0) +TOOLS_DIR=$(pwd)/.tools + +if [ -z "${GOPATH}" ] ; then + printf "GOPATH is not defined.\n" + exit -1 +fi + +if [ ! -d "${GOPATH}" ] ; then + printf "GOPATH ${GOPATH} is invalid \n" + exit -1 +fi + +# Pre-requisites +if ! git diff --quiet; then \ + git status + printf "\n\nError: working tree is not clean\n" + exit -1 +fi + +if [ "$(git tag --contains $(git log -1 --pretty=format:"%H"))" = "" ] ; then + printf "$(git log -1)" + printf "\n\nError: HEAD is not pointing to a tagged version" +fi + +make ${TOOLS_DIR}/gojq + +DIR_TMP="${GOPATH}/src/oteltmp/" +rm -rf $DIR_TMP +mkdir -p $DIR_TMP + +printf "Copy examples to ${DIR_TMP}\n" +cp -a ./example ${DIR_TMP} + +# Update go.mod files +printf "Update go.mod: rename module and remove replace\n" + +PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | egrep 'example' | sed 's/^\.\///' | sort) + +for dir in $PACKAGE_DIRS; do + printf " Update go.mod for $dir\n" + (cd "${DIR_TMP}/${dir}" && \ + # replaces is ("mod1" "mod2" …) + replaces=($(go mod edit -json | ${TOOLS_DIR}/gojq '.Replace[].Old.Path')) && \ + # strip double quotes + replaces=("${replaces[@]%\"}") && \ + replaces=("${replaces[@]#\"}") && \ + # make an array (-dropreplace=mod1 -dropreplace=mod2 …) + dropreplaces=("${replaces[@]/#/-dropreplace=}") && \ + go mod edit -module "oteltmp/${dir}" "${dropreplaces[@]}" && \ + go mod tidy) +done +printf "Update done:\n\n" + +# Build directories that contain main package. These directories are different than +# directories that contain go.mod files. +printf "Build examples:\n" +EXAMPLES=$(./get_main_pkgs.sh ./example) +for ex in $EXAMPLES; do + printf " Build $ex in ${DIR_TMP}/${ex}\n" + (cd "${DIR_TMP}/${ex}" && \ + go build .) +done + +# Cleanup +printf "Remove copied files.\n" +rm -rf $DIR_TMP diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/version.go similarity index 73% rename from cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/doc.go rename to cluster-autoscaler/vendor/go.opentelemetry.io/otel/version.go index 35dabf5532f4..81be6f368172 100644 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/clientv3/balancer/picker/doc.go +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/version.go @@ -1,4 +1,4 @@ -// Copyright 2018 The etcd Authors +// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,5 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package picker defines/implements client balancer picker policy. -package picker +package otel // import "go.opentelemetry.io/otel" + +// Version is the current release version of OpenTelemetry in use. +func Version() string { + return "0.20.0" +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/LICENSE b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.go new file mode 100644 index 000000000000..d496a141b0a8 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.go @@ -0,0 +1,255 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.13.0 +// source: opentelemetry/proto/collector/metrics/v1/metrics_service.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + v1 "go.opentelemetry.io/proto/otlp/metrics/v1" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ExportMetricsServiceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // An array of ResourceMetrics. + // For data coming from a single resource this array will typically contain one + // element. Intermediary nodes (such as OpenTelemetry Collector) that receive + // data from multiple origins typically batch the data before forwarding further and + // in that case this array will contain multiple elements. + ResourceMetrics []*v1.ResourceMetrics `protobuf:"bytes,1,rep,name=resource_metrics,json=resourceMetrics,proto3" json:"resource_metrics,omitempty"` +} + +func (x *ExportMetricsServiceRequest) Reset() { + *x = ExportMetricsServiceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportMetricsServiceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportMetricsServiceRequest) ProtoMessage() {} + +func (x *ExportMetricsServiceRequest) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_collector_metrics_v1_metrics_service_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 ExportMetricsServiceRequest.ProtoReflect.Descriptor instead. +func (*ExportMetricsServiceRequest) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDescGZIP(), []int{0} +} + +func (x *ExportMetricsServiceRequest) GetResourceMetrics() []*v1.ResourceMetrics { + if x != nil { + return x.ResourceMetrics + } + return nil +} + +type ExportMetricsServiceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ExportMetricsServiceResponse) Reset() { + *x = ExportMetricsServiceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportMetricsServiceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportMetricsServiceResponse) ProtoMessage() {} + +func (x *ExportMetricsServiceResponse) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_msgTypes[1] + 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 ExportMetricsServiceResponse.ProtoReflect.Descriptor instead. +func (*ExportMetricsServiceResponse) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDescGZIP(), []int{1} +} + +var File_opentelemetry_proto_collector_metrics_v1_metrics_service_proto protoreflect.FileDescriptor + +var file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDesc = []byte{ + 0x0a, 0x3e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x28, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x2c, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x79, 0x0a, 0x1b, 0x45, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5a, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x73, 0x22, 0x1e, 0x0a, 0x1c, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0xac, 0x01, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x99, 0x01, 0x0a, 0x06, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x12, 0x45, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x46, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x79, 0x0a, 0x2b, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, + 0x31, 0x42, 0x13, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDescOnce sync.Once + file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDescData = file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDesc +) + +func file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDescGZIP() []byte { + file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDescOnce.Do(func() { + file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDescData) + }) + return file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDescData +} + +var file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_goTypes = []interface{}{ + (*ExportMetricsServiceRequest)(nil), // 0: opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + (*ExportMetricsServiceResponse)(nil), // 1: opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + (*v1.ResourceMetrics)(nil), // 2: opentelemetry.proto.metrics.v1.ResourceMetrics +} +var file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_depIdxs = []int32{ + 2, // 0: opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resource_metrics:type_name -> opentelemetry.proto.metrics.v1.ResourceMetrics + 0, // 1: opentelemetry.proto.collector.metrics.v1.MetricsService.Export:input_type -> opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + 1, // 2: opentelemetry.proto.collector.metrics.v1.MetricsService.Export:output_type -> opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_init() } +func file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_init() { + if File_opentelemetry_proto_collector_metrics_v1_metrics_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportMetricsServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportMetricsServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_goTypes, + DependencyIndexes: file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_depIdxs, + MessageInfos: file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_msgTypes, + }.Build() + File_opentelemetry_proto_collector_metrics_v1_metrics_service_proto = out.File + file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_rawDesc = nil + file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_goTypes = nil + file_opentelemetry_proto_collector_metrics_v1_metrics_service_proto_depIdxs = nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.gw.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.gw.go new file mode 100644 index 000000000000..f0dc06e5f5eb --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.gw.go @@ -0,0 +1,169 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: opentelemetry/proto/collector/metrics/v1/metrics_service.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_MetricsService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client MetricsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ExportMetricsServiceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Export(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MetricsService_Export_0(ctx context.Context, marshaler runtime.Marshaler, server MetricsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ExportMetricsServiceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Export(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterMetricsServiceHandlerServer registers the http handlers for service MetricsService to "mux". +// UnaryRPC :call MetricsServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMetricsServiceHandlerFromEndpoint instead. +func RegisterMetricsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MetricsServiceServer) error { + + mux.Handle("POST", pattern_MetricsService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MetricsService_Export_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_MetricsService_Export_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterMetricsServiceHandlerFromEndpoint is same as RegisterMetricsServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMetricsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMetricsServiceHandler(ctx, mux, conn) +} + +// RegisterMetricsServiceHandler registers the http handlers for service MetricsService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMetricsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMetricsServiceHandlerClient(ctx, mux, NewMetricsServiceClient(conn)) +} + +// RegisterMetricsServiceHandlerClient registers the http handlers for service MetricsService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MetricsServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MetricsServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MetricsServiceClient" to call the correct interceptors. +func RegisterMetricsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MetricsServiceClient) error { + + mux.Handle("POST", pattern_MetricsService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MetricsService_Export_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_MetricsService_Export_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_MetricsService_Export_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "metrics"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_MetricsService_Export_0 = runtime.ForwardResponseMessage +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go new file mode 100644 index 000000000000..eca49e5c4f32 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go @@ -0,0 +1,101 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion7 + +// MetricsServiceClient is the client API for MetricsService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MetricsServiceClient interface { + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(ctx context.Context, in *ExportMetricsServiceRequest, opts ...grpc.CallOption) (*ExportMetricsServiceResponse, error) +} + +type metricsServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMetricsServiceClient(cc grpc.ClientConnInterface) MetricsServiceClient { + return &metricsServiceClient{cc} +} + +func (c *metricsServiceClient) Export(ctx context.Context, in *ExportMetricsServiceRequest, opts ...grpc.CallOption) (*ExportMetricsServiceResponse, error) { + out := new(ExportMetricsServiceResponse) + err := c.cc.Invoke(ctx, "/opentelemetry.proto.collector.metrics.v1.MetricsService/Export", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MetricsServiceServer is the server API for MetricsService service. +// All implementations must embed UnimplementedMetricsServiceServer +// for forward compatibility +type MetricsServiceServer interface { + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(context.Context, *ExportMetricsServiceRequest) (*ExportMetricsServiceResponse, error) + mustEmbedUnimplementedMetricsServiceServer() +} + +// UnimplementedMetricsServiceServer must be embedded to have forward compatible implementations. +type UnimplementedMetricsServiceServer struct { +} + +func (UnimplementedMetricsServiceServer) Export(context.Context, *ExportMetricsServiceRequest) (*ExportMetricsServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Export not implemented") +} +func (UnimplementedMetricsServiceServer) mustEmbedUnimplementedMetricsServiceServer() {} + +// UnsafeMetricsServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MetricsServiceServer will +// result in compilation errors. +type UnsafeMetricsServiceServer interface { + mustEmbedUnimplementedMetricsServiceServer() +} + +func RegisterMetricsServiceServer(s grpc.ServiceRegistrar, srv MetricsServiceServer) { + s.RegisterService(&_MetricsService_serviceDesc, srv) +} + +func _MetricsService_Export_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportMetricsServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricsServiceServer).Export(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/opentelemetry.proto.collector.metrics.v1.MetricsService/Export", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricsServiceServer).Export(ctx, req.(*ExportMetricsServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _MetricsService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "opentelemetry.proto.collector.metrics.v1.MetricsService", + HandlerType: (*MetricsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Export", + Handler: _MetricsService_Export_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "opentelemetry/proto/collector/metrics/v1/metrics_service.proto", +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_config.pb.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_config.pb.go new file mode 100644 index 000000000000..07f7e9b1fa35 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_config.pb.go @@ -0,0 +1,573 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.13.0 +// source: opentelemetry/proto/trace/v1/trace_config.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// How spans should be sampled: +// - Always off +// - Always on +// - Always follow the parent Span's decision (off if no parent). +type ConstantSampler_ConstantDecision int32 + +const ( + ConstantSampler_ALWAYS_OFF ConstantSampler_ConstantDecision = 0 + ConstantSampler_ALWAYS_ON ConstantSampler_ConstantDecision = 1 + ConstantSampler_ALWAYS_PARENT ConstantSampler_ConstantDecision = 2 +) + +// Enum value maps for ConstantSampler_ConstantDecision. +var ( + ConstantSampler_ConstantDecision_name = map[int32]string{ + 0: "ALWAYS_OFF", + 1: "ALWAYS_ON", + 2: "ALWAYS_PARENT", + } + ConstantSampler_ConstantDecision_value = map[string]int32{ + "ALWAYS_OFF": 0, + "ALWAYS_ON": 1, + "ALWAYS_PARENT": 2, + } +) + +func (x ConstantSampler_ConstantDecision) Enum() *ConstantSampler_ConstantDecision { + p := new(ConstantSampler_ConstantDecision) + *p = x + return p +} + +func (x ConstantSampler_ConstantDecision) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConstantSampler_ConstantDecision) Descriptor() protoreflect.EnumDescriptor { + return file_opentelemetry_proto_trace_v1_trace_config_proto_enumTypes[0].Descriptor() +} + +func (ConstantSampler_ConstantDecision) Type() protoreflect.EnumType { + return &file_opentelemetry_proto_trace_v1_trace_config_proto_enumTypes[0] +} + +func (x ConstantSampler_ConstantDecision) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConstantSampler_ConstantDecision.Descriptor instead. +func (ConstantSampler_ConstantDecision) EnumDescriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{1, 0} +} + +// Global configuration of the trace service. All fields must be specified, or +// the default (zero) values will be used for each type. +type TraceConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The global default sampler used to make decisions on span sampling. + // + // Types that are assignable to Sampler: + // *TraceConfig_ConstantSampler + // *TraceConfig_TraceIdRatioBased + // *TraceConfig_RateLimitingSampler + Sampler isTraceConfig_Sampler `protobuf_oneof:"sampler"` + // The global default max number of attributes per span. + MaxNumberOfAttributes int64 `protobuf:"varint,4,opt,name=max_number_of_attributes,json=maxNumberOfAttributes,proto3" json:"max_number_of_attributes,omitempty"` + // The global default max number of annotation events per span. + MaxNumberOfTimedEvents int64 `protobuf:"varint,5,opt,name=max_number_of_timed_events,json=maxNumberOfTimedEvents,proto3" json:"max_number_of_timed_events,omitempty"` + // The global default max number of attributes per timed event. + MaxNumberOfAttributesPerTimedEvent int64 `protobuf:"varint,6,opt,name=max_number_of_attributes_per_timed_event,json=maxNumberOfAttributesPerTimedEvent,proto3" json:"max_number_of_attributes_per_timed_event,omitempty"` + // The global default max number of link entries per span. + MaxNumberOfLinks int64 `protobuf:"varint,7,opt,name=max_number_of_links,json=maxNumberOfLinks,proto3" json:"max_number_of_links,omitempty"` + // The global default max number of attributes per span. + MaxNumberOfAttributesPerLink int64 `protobuf:"varint,8,opt,name=max_number_of_attributes_per_link,json=maxNumberOfAttributesPerLink,proto3" json:"max_number_of_attributes_per_link,omitempty"` +} + +func (x *TraceConfig) Reset() { + *x = TraceConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceConfig) ProtoMessage() {} + +func (x *TraceConfig) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_config_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 TraceConfig.ProtoReflect.Descriptor instead. +func (*TraceConfig) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{0} +} + +func (m *TraceConfig) GetSampler() isTraceConfig_Sampler { + if m != nil { + return m.Sampler + } + return nil +} + +func (x *TraceConfig) GetConstantSampler() *ConstantSampler { + if x, ok := x.GetSampler().(*TraceConfig_ConstantSampler); ok { + return x.ConstantSampler + } + return nil +} + +func (x *TraceConfig) GetTraceIdRatioBased() *TraceIdRatioBased { + if x, ok := x.GetSampler().(*TraceConfig_TraceIdRatioBased); ok { + return x.TraceIdRatioBased + } + return nil +} + +func (x *TraceConfig) GetRateLimitingSampler() *RateLimitingSampler { + if x, ok := x.GetSampler().(*TraceConfig_RateLimitingSampler); ok { + return x.RateLimitingSampler + } + return nil +} + +func (x *TraceConfig) GetMaxNumberOfAttributes() int64 { + if x != nil { + return x.MaxNumberOfAttributes + } + return 0 +} + +func (x *TraceConfig) GetMaxNumberOfTimedEvents() int64 { + if x != nil { + return x.MaxNumberOfTimedEvents + } + return 0 +} + +func (x *TraceConfig) GetMaxNumberOfAttributesPerTimedEvent() int64 { + if x != nil { + return x.MaxNumberOfAttributesPerTimedEvent + } + return 0 +} + +func (x *TraceConfig) GetMaxNumberOfLinks() int64 { + if x != nil { + return x.MaxNumberOfLinks + } + return 0 +} + +func (x *TraceConfig) GetMaxNumberOfAttributesPerLink() int64 { + if x != nil { + return x.MaxNumberOfAttributesPerLink + } + return 0 +} + +type isTraceConfig_Sampler interface { + isTraceConfig_Sampler() +} + +type TraceConfig_ConstantSampler struct { + ConstantSampler *ConstantSampler `protobuf:"bytes,1,opt,name=constant_sampler,json=constantSampler,proto3,oneof"` +} + +type TraceConfig_TraceIdRatioBased struct { + TraceIdRatioBased *TraceIdRatioBased `protobuf:"bytes,2,opt,name=trace_id_ratio_based,json=traceIdRatioBased,proto3,oneof"` +} + +type TraceConfig_RateLimitingSampler struct { + RateLimitingSampler *RateLimitingSampler `protobuf:"bytes,3,opt,name=rate_limiting_sampler,json=rateLimitingSampler,proto3,oneof"` +} + +func (*TraceConfig_ConstantSampler) isTraceConfig_Sampler() {} + +func (*TraceConfig_TraceIdRatioBased) isTraceConfig_Sampler() {} + +func (*TraceConfig_RateLimitingSampler) isTraceConfig_Sampler() {} + +// Sampler that always makes a constant decision on span sampling. +type ConstantSampler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Decision ConstantSampler_ConstantDecision `protobuf:"varint,1,opt,name=decision,proto3,enum=opentelemetry.proto.trace.v1.ConstantSampler_ConstantDecision" json:"decision,omitempty"` +} + +func (x *ConstantSampler) Reset() { + *x = ConstantSampler{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConstantSampler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConstantSampler) ProtoMessage() {} + +func (x *ConstantSampler) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[1] + 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 ConstantSampler.ProtoReflect.Descriptor instead. +func (*ConstantSampler) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{1} +} + +func (x *ConstantSampler) GetDecision() ConstantSampler_ConstantDecision { + if x != nil { + return x.Decision + } + return ConstantSampler_ALWAYS_OFF +} + +// Sampler that tries to uniformly sample traces with a given ratio. +// The ratio of sampling a trace is equal to that of the specified ratio. +type TraceIdRatioBased struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The desired ratio of sampling. Must be within [0.0, 1.0]. + SamplingRatio float64 `protobuf:"fixed64,1,opt,name=samplingRatio,proto3" json:"samplingRatio,omitempty"` +} + +func (x *TraceIdRatioBased) Reset() { + *x = TraceIdRatioBased{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceIdRatioBased) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceIdRatioBased) ProtoMessage() {} + +func (x *TraceIdRatioBased) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[2] + 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 TraceIdRatioBased.ProtoReflect.Descriptor instead. +func (*TraceIdRatioBased) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{2} +} + +func (x *TraceIdRatioBased) GetSamplingRatio() float64 { + if x != nil { + return x.SamplingRatio + } + return 0 +} + +// Sampler that tries to sample with a rate per time window. +type RateLimitingSampler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Rate per second. + Qps int64 `protobuf:"varint,1,opt,name=qps,proto3" json:"qps,omitempty"` +} + +func (x *RateLimitingSampler) Reset() { + *x = RateLimitingSampler{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RateLimitingSampler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RateLimitingSampler) ProtoMessage() {} + +func (x *RateLimitingSampler) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[3] + 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 RateLimitingSampler.ProtoReflect.Descriptor instead. +func (*RateLimitingSampler) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescGZIP(), []int{3} +} + +func (x *RateLimitingSampler) GetQps() int64 { + if x != nil { + return x.Qps + } + return 0 +} + +var File_opentelemetry_proto_trace_v1_trace_config_proto protoreflect.FileDescriptor + +var file_opentelemetry_proto_trace_v1_trace_config_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x1c, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x22, + 0x84, 0x05, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x5a, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x74, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x74, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x12, 0x62, 0x0a, 0x14, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x5f, 0x62, 0x61, + 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, + 0x52, 0x61, 0x74, 0x69, 0x6f, 0x42, 0x61, 0x73, 0x65, 0x64, 0x48, 0x00, 0x52, 0x11, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x49, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x42, 0x61, 0x73, 0x65, 0x64, 0x12, + 0x67, 0x0a, 0x15, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x6e, 0x67, + 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, + 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x72, 0x48, 0x00, 0x52, 0x13, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x6e, + 0x67, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x18, 0x6d, 0x61, 0x78, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x6d, 0x61, 0x78, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0x12, 0x3a, 0x0a, 0x1a, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, + 0x6f, 0x66, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x6d, 0x61, 0x78, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x4f, 0x66, 0x54, 0x69, 0x6d, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x54, 0x0a, + 0x28, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x22, 0x6d, 0x61, 0x78, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x50, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x64, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x5f, 0x6f, 0x66, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x10, 0x6d, 0x61, 0x78, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x4c, 0x69, 0x6e, + 0x6b, 0x73, 0x12, 0x47, 0x0a, 0x21, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x5f, 0x6f, 0x66, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x70, + 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1c, 0x6d, + 0x61, 0x78, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x50, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x09, 0x0a, 0x07, 0x73, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x22, 0xb3, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x74, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x12, 0x5a, 0x0a, 0x08, 0x64, 0x65, + 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3e, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x74, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x74, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x65, + 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x44, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x74, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x4c, + 0x57, 0x41, 0x59, 0x53, 0x5f, 0x4f, 0x46, 0x46, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x4c, + 0x57, 0x41, 0x59, 0x53, 0x5f, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x4c, 0x57, + 0x41, 0x59, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x22, 0x39, 0x0a, 0x11, + 0x54, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x42, 0x61, 0x73, 0x65, + 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, + 0x69, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0d, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, + 0x6e, 0x67, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x22, 0x27, 0x0a, 0x13, 0x52, 0x61, 0x74, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x12, 0x10, + 0x0a, 0x03, 0x71, 0x70, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x71, 0x70, 0x73, + 0x42, 0x68, 0x0a, 0x1f, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x42, 0x10, 0x54, 0x72, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescOnce sync.Once + file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescData = file_opentelemetry_proto_trace_v1_trace_config_proto_rawDesc +) + +func file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescGZIP() []byte { + file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescOnce.Do(func() { + file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescData) + }) + return file_opentelemetry_proto_trace_v1_trace_config_proto_rawDescData +} + +var file_opentelemetry_proto_trace_v1_trace_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_opentelemetry_proto_trace_v1_trace_config_proto_goTypes = []interface{}{ + (ConstantSampler_ConstantDecision)(0), // 0: opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision + (*TraceConfig)(nil), // 1: opentelemetry.proto.trace.v1.TraceConfig + (*ConstantSampler)(nil), // 2: opentelemetry.proto.trace.v1.ConstantSampler + (*TraceIdRatioBased)(nil), // 3: opentelemetry.proto.trace.v1.TraceIdRatioBased + (*RateLimitingSampler)(nil), // 4: opentelemetry.proto.trace.v1.RateLimitingSampler +} +var file_opentelemetry_proto_trace_v1_trace_config_proto_depIdxs = []int32{ + 2, // 0: opentelemetry.proto.trace.v1.TraceConfig.constant_sampler:type_name -> opentelemetry.proto.trace.v1.ConstantSampler + 3, // 1: opentelemetry.proto.trace.v1.TraceConfig.trace_id_ratio_based:type_name -> opentelemetry.proto.trace.v1.TraceIdRatioBased + 4, // 2: opentelemetry.proto.trace.v1.TraceConfig.rate_limiting_sampler:type_name -> opentelemetry.proto.trace.v1.RateLimitingSampler + 0, // 3: opentelemetry.proto.trace.v1.ConstantSampler.decision:type_name -> opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_opentelemetry_proto_trace_v1_trace_config_proto_init() } +func file_opentelemetry_proto_trace_v1_trace_config_proto_init() { + if File_opentelemetry_proto_trace_v1_trace_config_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConstantSampler); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceIdRatioBased); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RateLimitingSampler); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*TraceConfig_ConstantSampler)(nil), + (*TraceConfig_TraceIdRatioBased)(nil), + (*TraceConfig_RateLimitingSampler)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_opentelemetry_proto_trace_v1_trace_config_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_opentelemetry_proto_trace_v1_trace_config_proto_goTypes, + DependencyIndexes: file_opentelemetry_proto_trace_v1_trace_config_proto_depIdxs, + EnumInfos: file_opentelemetry_proto_trace_v1_trace_config_proto_enumTypes, + MessageInfos: file_opentelemetry_proto_trace_v1_trace_config_proto_msgTypes, + }.Build() + File_opentelemetry_proto_trace_v1_trace_config_proto = out.File + file_opentelemetry_proto_trace_v1_trace_config_proto_rawDesc = nil + file_opentelemetry_proto_trace_v1_trace_config_proto_goTypes = nil + file_opentelemetry_proto_trace_v1_trace_config_proto_depIdxs = nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.go new file mode 100644 index 000000000000..402614f1d3c5 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.go @@ -0,0 +1,252 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.13.0 +// source: opentelemetry/proto/collector/trace/v1/trace_service.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + v1 "go.opentelemetry.io/proto/otlp/trace/v1" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ExportTraceServiceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // An array of ResourceSpans. + // For data coming from a single resource this array will typically contain one + // element. Intermediary nodes (such as OpenTelemetry Collector) that receive + // data from multiple origins typically batch the data before forwarding further and + // in that case this array will contain multiple elements. + ResourceSpans []*v1.ResourceSpans `protobuf:"bytes,1,rep,name=resource_spans,json=resourceSpans,proto3" json:"resource_spans,omitempty"` +} + +func (x *ExportTraceServiceRequest) Reset() { + *x = ExportTraceServiceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_collector_trace_v1_trace_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportTraceServiceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportTraceServiceRequest) ProtoMessage() {} + +func (x *ExportTraceServiceRequest) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_collector_trace_v1_trace_service_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 ExportTraceServiceRequest.ProtoReflect.Descriptor instead. +func (*ExportTraceServiceRequest) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDescGZIP(), []int{0} +} + +func (x *ExportTraceServiceRequest) GetResourceSpans() []*v1.ResourceSpans { + if x != nil { + return x.ResourceSpans + } + return nil +} + +type ExportTraceServiceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ExportTraceServiceResponse) Reset() { + *x = ExportTraceServiceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_collector_trace_v1_trace_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExportTraceServiceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportTraceServiceResponse) ProtoMessage() {} + +func (x *ExportTraceServiceResponse) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_collector_trace_v1_trace_service_proto_msgTypes[1] + 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 ExportTraceServiceResponse.ProtoReflect.Descriptor instead. +func (*ExportTraceServiceResponse) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDescGZIP(), []int{1} +} + +var File_opentelemetry_proto_collector_trace_v1_trace_service_proto protoreflect.FileDescriptor + +var file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDesc = []byte{ + 0x0a, 0x3a, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x26, 0x6f, 0x70, + 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x28, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6f, + 0x0a, 0x19, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x52, 0x0a, 0x0e, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x73, + 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x22, + 0x1c, 0x0a, 0x1a, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa2, 0x01, + 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x91, + 0x01, 0x0a, 0x06, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x41, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x72, 0x61, 0x63, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x73, 0x0a, 0x29, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, + 0x11, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDescOnce sync.Once + file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDescData = file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDesc +) + +func file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDescGZIP() []byte { + file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDescOnce.Do(func() { + file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDescData) + }) + return file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDescData +} + +var file_opentelemetry_proto_collector_trace_v1_trace_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_opentelemetry_proto_collector_trace_v1_trace_service_proto_goTypes = []interface{}{ + (*ExportTraceServiceRequest)(nil), // 0: opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + (*ExportTraceServiceResponse)(nil), // 1: opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + (*v1.ResourceSpans)(nil), // 2: opentelemetry.proto.trace.v1.ResourceSpans +} +var file_opentelemetry_proto_collector_trace_v1_trace_service_proto_depIdxs = []int32{ + 2, // 0: opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resource_spans:type_name -> opentelemetry.proto.trace.v1.ResourceSpans + 0, // 1: opentelemetry.proto.collector.trace.v1.TraceService.Export:input_type -> opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + 1, // 2: opentelemetry.proto.collector.trace.v1.TraceService.Export:output_type -> opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_opentelemetry_proto_collector_trace_v1_trace_service_proto_init() } +func file_opentelemetry_proto_collector_trace_v1_trace_service_proto_init() { + if File_opentelemetry_proto_collector_trace_v1_trace_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_opentelemetry_proto_collector_trace_v1_trace_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportTraceServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_collector_trace_v1_trace_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExportTraceServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_opentelemetry_proto_collector_trace_v1_trace_service_proto_goTypes, + DependencyIndexes: file_opentelemetry_proto_collector_trace_v1_trace_service_proto_depIdxs, + MessageInfos: file_opentelemetry_proto_collector_trace_v1_trace_service_proto_msgTypes, + }.Build() + File_opentelemetry_proto_collector_trace_v1_trace_service_proto = out.File + file_opentelemetry_proto_collector_trace_v1_trace_service_proto_rawDesc = nil + file_opentelemetry_proto_collector_trace_v1_trace_service_proto_goTypes = nil + file_opentelemetry_proto_collector_trace_v1_trace_service_proto_depIdxs = nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.gw.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.gw.go new file mode 100644 index 000000000000..18dff3d03e7b --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service.pb.gw.go @@ -0,0 +1,169 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: opentelemetry/proto/collector/trace/v1/trace_service.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_TraceService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client TraceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ExportTraceServiceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Export(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_TraceService_Export_0(ctx context.Context, marshaler runtime.Marshaler, server TraceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ExportTraceServiceRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Export(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterTraceServiceHandlerServer registers the http handlers for service TraceService to "mux". +// UnaryRPC :call TraceServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTraceServiceHandlerFromEndpoint instead. +func RegisterTraceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TraceServiceServer) error { + + mux.Handle("POST", pattern_TraceService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_TraceService_Export_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_TraceService_Export_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterTraceServiceHandlerFromEndpoint is same as RegisterTraceServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterTraceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterTraceServiceHandler(ctx, mux, conn) +} + +// RegisterTraceServiceHandler registers the http handlers for service TraceService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterTraceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterTraceServiceHandlerClient(ctx, mux, NewTraceServiceClient(conn)) +} + +// RegisterTraceServiceHandlerClient registers the http handlers for service TraceService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TraceServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TraceServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "TraceServiceClient" to call the correct interceptors. +func RegisterTraceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TraceServiceClient) error { + + mux.Handle("POST", pattern_TraceService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_TraceService_Export_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_TraceService_Export_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_TraceService_Export_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "trace"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_TraceService_Export_0 = runtime.ForwardResponseMessage +) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go new file mode 100644 index 000000000000..4e4c24c0c875 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go @@ -0,0 +1,101 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion7 + +// TraceServiceClient is the client API for TraceService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type TraceServiceClient interface { + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(ctx context.Context, in *ExportTraceServiceRequest, opts ...grpc.CallOption) (*ExportTraceServiceResponse, error) +} + +type traceServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTraceServiceClient(cc grpc.ClientConnInterface) TraceServiceClient { + return &traceServiceClient{cc} +} + +func (c *traceServiceClient) Export(ctx context.Context, in *ExportTraceServiceRequest, opts ...grpc.CallOption) (*ExportTraceServiceResponse, error) { + out := new(ExportTraceServiceResponse) + err := c.cc.Invoke(ctx, "/opentelemetry.proto.collector.trace.v1.TraceService/Export", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TraceServiceServer is the server API for TraceService service. +// All implementations must embed UnimplementedTraceServiceServer +// for forward compatibility +type TraceServiceServer interface { + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(context.Context, *ExportTraceServiceRequest) (*ExportTraceServiceResponse, error) + mustEmbedUnimplementedTraceServiceServer() +} + +// UnimplementedTraceServiceServer must be embedded to have forward compatible implementations. +type UnimplementedTraceServiceServer struct { +} + +func (UnimplementedTraceServiceServer) Export(context.Context, *ExportTraceServiceRequest) (*ExportTraceServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Export not implemented") +} +func (UnimplementedTraceServiceServer) mustEmbedUnimplementedTraceServiceServer() {} + +// UnsafeTraceServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TraceServiceServer will +// result in compilation errors. +type UnsafeTraceServiceServer interface { + mustEmbedUnimplementedTraceServiceServer() +} + +func RegisterTraceServiceServer(s grpc.ServiceRegistrar, srv TraceServiceServer) { + s.RegisterService(&_TraceService_serviceDesc, srv) +} + +func _TraceService_Export_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportTraceServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TraceServiceServer).Export(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/opentelemetry.proto.collector.trace.v1.TraceService/Export", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TraceServiceServer).Export(ctx, req.(*ExportTraceServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _TraceService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "opentelemetry.proto.collector.trace.v1.TraceService", + HandlerType: (*TraceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Export", + Handler: _TraceService_Export_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "opentelemetry/proto/collector/trace/v1/trace_service.proto", +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go new file mode 100644 index 000000000000..567e55849adc --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go @@ -0,0 +1,659 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.13.0 +// source: opentelemetry/proto/common/v1/common.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// AnyValue is used to represent any type of attribute value. AnyValue may contain a +// primitive value such as a string or integer or it may contain an arbitrary nested +// object containing arrays, key-value lists and primitives. +type AnyValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The value is one of the listed fields. It is valid for all values to be unspecified + // in which case this AnyValue is considered to be "null". + // + // Types that are assignable to Value: + // *AnyValue_StringValue + // *AnyValue_BoolValue + // *AnyValue_IntValue + // *AnyValue_DoubleValue + // *AnyValue_ArrayValue + // *AnyValue_KvlistValue + Value isAnyValue_Value `protobuf_oneof:"value"` +} + +func (x *AnyValue) Reset() { + *x = AnyValue{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnyValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnyValue) ProtoMessage() {} + +func (x *AnyValue) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_common_v1_common_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 AnyValue.ProtoReflect.Descriptor instead. +func (*AnyValue) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP(), []int{0} +} + +func (m *AnyValue) GetValue() isAnyValue_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *AnyValue) GetStringValue() string { + if x, ok := x.GetValue().(*AnyValue_StringValue); ok { + return x.StringValue + } + return "" +} + +func (x *AnyValue) GetBoolValue() bool { + if x, ok := x.GetValue().(*AnyValue_BoolValue); ok { + return x.BoolValue + } + return false +} + +func (x *AnyValue) GetIntValue() int64 { + if x, ok := x.GetValue().(*AnyValue_IntValue); ok { + return x.IntValue + } + return 0 +} + +func (x *AnyValue) GetDoubleValue() float64 { + if x, ok := x.GetValue().(*AnyValue_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (x *AnyValue) GetArrayValue() *ArrayValue { + if x, ok := x.GetValue().(*AnyValue_ArrayValue); ok { + return x.ArrayValue + } + return nil +} + +func (x *AnyValue) GetKvlistValue() *KeyValueList { + if x, ok := x.GetValue().(*AnyValue_KvlistValue); ok { + return x.KvlistValue + } + return nil +} + +type isAnyValue_Value interface { + isAnyValue_Value() +} + +type AnyValue_StringValue struct { + StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3,oneof"` +} + +type AnyValue_BoolValue struct { + BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"` +} + +type AnyValue_IntValue struct { + IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"` +} + +type AnyValue_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,4,opt,name=double_value,json=doubleValue,proto3,oneof"` +} + +type AnyValue_ArrayValue struct { + ArrayValue *ArrayValue `protobuf:"bytes,5,opt,name=array_value,json=arrayValue,proto3,oneof"` +} + +type AnyValue_KvlistValue struct { + KvlistValue *KeyValueList `protobuf:"bytes,6,opt,name=kvlist_value,json=kvlistValue,proto3,oneof"` +} + +func (*AnyValue_StringValue) isAnyValue_Value() {} + +func (*AnyValue_BoolValue) isAnyValue_Value() {} + +func (*AnyValue_IntValue) isAnyValue_Value() {} + +func (*AnyValue_DoubleValue) isAnyValue_Value() {} + +func (*AnyValue_ArrayValue) isAnyValue_Value() {} + +func (*AnyValue_KvlistValue) isAnyValue_Value() {} + +// ArrayValue is a list of AnyValue messages. We need ArrayValue as a message +// since oneof in AnyValue does not allow repeated fields. +type ArrayValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Array of values. The array may be empty (contain 0 elements). + Values []*AnyValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *ArrayValue) Reset() { + *x = ArrayValue{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArrayValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArrayValue) ProtoMessage() {} + +func (x *ArrayValue) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[1] + 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 ArrayValue.ProtoReflect.Descriptor instead. +func (*ArrayValue) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP(), []int{1} +} + +func (x *ArrayValue) GetValues() []*AnyValue { + if x != nil { + return x.Values + } + return nil +} + +// KeyValueList is a list of KeyValue messages. We need KeyValueList as a message +// since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need +// a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to +// avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches +// are semantically equivalent. +type KeyValueList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A collection of key/value pairs of key-value pairs. The list may be empty (may + // contain 0 elements). + Values []*KeyValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *KeyValueList) Reset() { + *x = KeyValueList{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyValueList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyValueList) ProtoMessage() {} + +func (x *KeyValueList) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[2] + 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 KeyValueList.ProtoReflect.Descriptor instead. +func (*KeyValueList) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP(), []int{2} +} + +func (x *KeyValueList) GetValues() []*KeyValue { + if x != nil { + return x.Values + } + return nil +} + +// KeyValue is a key-value pair that is used to store Span attributes, Link +// attributes, etc. +type KeyValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value *AnyValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *KeyValue) Reset() { + *x = KeyValue{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyValue) ProtoMessage() {} + +func (x *KeyValue) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[3] + 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 KeyValue.ProtoReflect.Descriptor instead. +func (*KeyValue) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP(), []int{3} +} + +func (x *KeyValue) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *KeyValue) GetValue() *AnyValue { + if x != nil { + return x.Value + } + return nil +} + +// StringKeyValue is a pair of key/value strings. This is the simpler (and faster) version +// of KeyValue that only supports string values. +type StringKeyValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *StringKeyValue) Reset() { + *x = StringKeyValue{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StringKeyValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringKeyValue) ProtoMessage() {} + +func (x *StringKeyValue) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[4] + 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 StringKeyValue.ProtoReflect.Descriptor instead. +func (*StringKeyValue) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP(), []int{4} +} + +func (x *StringKeyValue) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *StringKeyValue) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// InstrumentationLibrary is a message representing the instrumentation library information +// such as the fully qualified name and version. +type InstrumentationLibrary struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // An empty instrumentation library name means the name is unknown. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *InstrumentationLibrary) Reset() { + *x = InstrumentationLibrary{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstrumentationLibrary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstrumentationLibrary) ProtoMessage() {} + +func (x *InstrumentationLibrary) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[5] + 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 InstrumentationLibrary.ProtoReflect.Descriptor instead. +func (*InstrumentationLibrary) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP(), []int{5} +} + +func (x *InstrumentationLibrary) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *InstrumentationLibrary) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +var File_opentelemetry_proto_common_v1_common_proto protoreflect.FileDescriptor + +var file_opentelemetry_proto_common_v1_common_proto_rawDesc = []byte{ + 0x0a, 0x2a, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x6f, 0x70, + 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0xbd, 0x02, 0x0a, 0x08, + 0x41, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, + 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, + 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, + 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x4c, 0x0a, 0x0b, 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x72, 0x72, 0x61, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x50, 0x0a, 0x0c, 0x6b, 0x76, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6b, 0x76, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4d, 0x0a, 0x0a, 0x41, + 0x72, 0x72, 0x61, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x79, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x0c, 0x4b, 0x65, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x06, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x5b, 0x0a, 0x08, 0x4b, + 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x38, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x46, 0x0a, 0x16, 0x49, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x5b, 0x0a, 0x20, 0x69, 0x6f, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0b, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, + 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, + 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_opentelemetry_proto_common_v1_common_proto_rawDescOnce sync.Once + file_opentelemetry_proto_common_v1_common_proto_rawDescData = file_opentelemetry_proto_common_v1_common_proto_rawDesc +) + +func file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP() []byte { + file_opentelemetry_proto_common_v1_common_proto_rawDescOnce.Do(func() { + file_opentelemetry_proto_common_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_common_v1_common_proto_rawDescData) + }) + return file_opentelemetry_proto_common_v1_common_proto_rawDescData +} + +var file_opentelemetry_proto_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_opentelemetry_proto_common_v1_common_proto_goTypes = []interface{}{ + (*AnyValue)(nil), // 0: opentelemetry.proto.common.v1.AnyValue + (*ArrayValue)(nil), // 1: opentelemetry.proto.common.v1.ArrayValue + (*KeyValueList)(nil), // 2: opentelemetry.proto.common.v1.KeyValueList + (*KeyValue)(nil), // 3: opentelemetry.proto.common.v1.KeyValue + (*StringKeyValue)(nil), // 4: opentelemetry.proto.common.v1.StringKeyValue + (*InstrumentationLibrary)(nil), // 5: opentelemetry.proto.common.v1.InstrumentationLibrary +} +var file_opentelemetry_proto_common_v1_common_proto_depIdxs = []int32{ + 1, // 0: opentelemetry.proto.common.v1.AnyValue.array_value:type_name -> opentelemetry.proto.common.v1.ArrayValue + 2, // 1: opentelemetry.proto.common.v1.AnyValue.kvlist_value:type_name -> opentelemetry.proto.common.v1.KeyValueList + 0, // 2: opentelemetry.proto.common.v1.ArrayValue.values:type_name -> opentelemetry.proto.common.v1.AnyValue + 3, // 3: opentelemetry.proto.common.v1.KeyValueList.values:type_name -> opentelemetry.proto.common.v1.KeyValue + 0, // 4: opentelemetry.proto.common.v1.KeyValue.value:type_name -> opentelemetry.proto.common.v1.AnyValue + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_opentelemetry_proto_common_v1_common_proto_init() } +func file_opentelemetry_proto_common_v1_common_proto_init() { + if File_opentelemetry_proto_common_v1_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_opentelemetry_proto_common_v1_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnyValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_common_v1_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArrayValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_common_v1_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyValueList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_common_v1_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_common_v1_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StringKeyValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_common_v1_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstrumentationLibrary); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_opentelemetry_proto_common_v1_common_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*AnyValue_StringValue)(nil), + (*AnyValue_BoolValue)(nil), + (*AnyValue_IntValue)(nil), + (*AnyValue_DoubleValue)(nil), + (*AnyValue_ArrayValue)(nil), + (*AnyValue_KvlistValue)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_opentelemetry_proto_common_v1_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_opentelemetry_proto_common_v1_common_proto_goTypes, + DependencyIndexes: file_opentelemetry_proto_common_v1_common_proto_depIdxs, + MessageInfos: file_opentelemetry_proto_common_v1_common_proto_msgTypes, + }.Build() + File_opentelemetry_proto_common_v1_common_proto = out.File + file_opentelemetry_proto_common_v1_common_proto_rawDesc = nil + file_opentelemetry_proto_common_v1_common_proto_goTypes = nil + file_opentelemetry_proto_common_v1_common_proto_depIdxs = nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go new file mode 100644 index 000000000000..64364a184dab --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go @@ -0,0 +1,2469 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.13.0 +// source: opentelemetry/proto/metrics/v1/metrics.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + v11 "go.opentelemetry.io/proto/otlp/common/v1" + v1 "go.opentelemetry.io/proto/otlp/resource/v1" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// AggregationTemporality defines how a metric aggregator reports aggregated +// values. It describes how those values relate to the time interval over +// which they are aggregated. +type AggregationTemporality int32 + +const ( + // UNSPECIFIED is the default AggregationTemporality, it MUST not be used. + AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED AggregationTemporality = 0 + // DELTA is an AggregationTemporality for a metric aggregator which reports + // changes since last report time. Successive metrics contain aggregation of + // values from continuous and non-overlapping intervals. + // + // The values for a DELTA metric are based only on the time interval + // associated with one measurement cycle. There is no dependency on + // previous measurements like is the case for CUMULATIVE metrics. + // + // For example, consider a system measuring the number of requests that + // it receives and reports the sum of these requests every second as a + // DELTA metric: + // + // 1. The system starts receiving at time=t_0. + // 2. A request is received, the system measures 1 request. + // 3. A request is received, the system measures 1 request. + // 4. A request is received, the system measures 1 request. + // 5. The 1 second collection cycle ends. A metric is exported for the + // number of requests received over the interval of time t_0 to + // t_0+1 with a value of 3. + // 6. A request is received, the system measures 1 request. + // 7. A request is received, the system measures 1 request. + // 8. The 1 second collection cycle ends. A metric is exported for the + // number of requests received over the interval of time t_0+1 to + // t_0+2 with a value of 2. + AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA AggregationTemporality = 1 + // CUMULATIVE is an AggregationTemporality for a metric aggregator which + // reports changes since a fixed start time. This means that current values + // of a CUMULATIVE metric depend on all previous measurements since the + // start time. Because of this, the sender is required to retain this state + // in some form. If this state is lost or invalidated, the CUMULATIVE metric + // values MUST be reset and a new fixed start time following the last + // reported measurement time sent MUST be used. + // + // For example, consider a system measuring the number of requests that + // it receives and reports the sum of these requests every second as a + // CUMULATIVE metric: + // + // 1. The system starts receiving at time=t_0. + // 2. A request is received, the system measures 1 request. + // 3. A request is received, the system measures 1 request. + // 4. A request is received, the system measures 1 request. + // 5. The 1 second collection cycle ends. A metric is exported for the + // number of requests received over the interval of time t_0 to + // t_0+1 with a value of 3. + // 6. A request is received, the system measures 1 request. + // 7. A request is received, the system measures 1 request. + // 8. The 1 second collection cycle ends. A metric is exported for the + // number of requests received over the interval of time t_0 to + // t_0+2 with a value of 5. + // 9. The system experiences a fault and loses state. + // 10. The system recovers and resumes receiving at time=t_1. + // 11. A request is received, the system measures 1 request. + // 12. The 1 second collection cycle ends. A metric is exported for the + // number of requests received over the interval of time t_1 to + // t_0+1 with a value of 1. + // + // Note: Even though, when reporting changes since last report time, using + // CUMULATIVE is valid, it is not recommended. This may cause problems for + // systems that do not use start_time to determine when the aggregation + // value was reset (e.g. Prometheus). + AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE AggregationTemporality = 2 +) + +// Enum value maps for AggregationTemporality. +var ( + AggregationTemporality_name = map[int32]string{ + 0: "AGGREGATION_TEMPORALITY_UNSPECIFIED", + 1: "AGGREGATION_TEMPORALITY_DELTA", + 2: "AGGREGATION_TEMPORALITY_CUMULATIVE", + } + AggregationTemporality_value = map[string]int32{ + "AGGREGATION_TEMPORALITY_UNSPECIFIED": 0, + "AGGREGATION_TEMPORALITY_DELTA": 1, + "AGGREGATION_TEMPORALITY_CUMULATIVE": 2, + } +) + +func (x AggregationTemporality) Enum() *AggregationTemporality { + p := new(AggregationTemporality) + *p = x + return p +} + +func (x AggregationTemporality) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AggregationTemporality) Descriptor() protoreflect.EnumDescriptor { + return file_opentelemetry_proto_metrics_v1_metrics_proto_enumTypes[0].Descriptor() +} + +func (AggregationTemporality) Type() protoreflect.EnumType { + return &file_opentelemetry_proto_metrics_v1_metrics_proto_enumTypes[0] +} + +func (x AggregationTemporality) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AggregationTemporality.Descriptor instead. +func (AggregationTemporality) EnumDescriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{0} +} + +// A collection of InstrumentationLibraryMetrics from a Resource. +type ResourceMetrics struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource for the metrics in this message. + // If this field is not set then no resource info is known. + Resource *v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + // A list of metrics that originate from a resource. + InstrumentationLibraryMetrics []*InstrumentationLibraryMetrics `protobuf:"bytes,2,rep,name=instrumentation_library_metrics,json=instrumentationLibraryMetrics,proto3" json:"instrumentation_library_metrics,omitempty"` +} + +func (x *ResourceMetrics) Reset() { + *x = ResourceMetrics{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceMetrics) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceMetrics) ProtoMessage() {} + +func (x *ResourceMetrics) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_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 ResourceMetrics.ProtoReflect.Descriptor instead. +func (*ResourceMetrics) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{0} +} + +func (x *ResourceMetrics) GetResource() *v1.Resource { + if x != nil { + return x.Resource + } + return nil +} + +func (x *ResourceMetrics) GetInstrumentationLibraryMetrics() []*InstrumentationLibraryMetrics { + if x != nil { + return x.InstrumentationLibraryMetrics + } + return nil +} + +// A collection of Metrics produced by an InstrumentationLibrary. +type InstrumentationLibraryMetrics struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The instrumentation library information for the metrics in this message. + // Semantically when InstrumentationLibrary isn't set, it is equivalent with + // an empty instrumentation library name (unknown). + InstrumentationLibrary *v11.InstrumentationLibrary `protobuf:"bytes,1,opt,name=instrumentation_library,json=instrumentationLibrary,proto3" json:"instrumentation_library,omitempty"` + // A list of metrics that originate from an instrumentation library. + Metrics []*Metric `protobuf:"bytes,2,rep,name=metrics,proto3" json:"metrics,omitempty"` +} + +func (x *InstrumentationLibraryMetrics) Reset() { + *x = InstrumentationLibraryMetrics{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstrumentationLibraryMetrics) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstrumentationLibraryMetrics) ProtoMessage() {} + +func (x *InstrumentationLibraryMetrics) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[1] + 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 InstrumentationLibraryMetrics.ProtoReflect.Descriptor instead. +func (*InstrumentationLibraryMetrics) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{1} +} + +func (x *InstrumentationLibraryMetrics) GetInstrumentationLibrary() *v11.InstrumentationLibrary { + if x != nil { + return x.InstrumentationLibrary + } + return nil +} + +func (x *InstrumentationLibraryMetrics) GetMetrics() []*Metric { + if x != nil { + return x.Metrics + } + return nil +} + +// Defines a Metric which has one or more timeseries. +// +// The data model and relation between entities is shown in the +// diagram below. Here, "DataPoint" is the term used to refer to any +// one of the specific data point value types, and "points" is the term used +// to refer to any one of the lists of points contained in the Metric. +// +// - Metric is composed of a metadata and data. +// - Metadata part contains a name, description, unit. +// - Data is one of the possible types (Gauge, Sum, Histogram, etc.). +// - DataPoint contains timestamps, labels, and one of the possible value type +// fields. +// +// Metric +// +------------+ +// |name | +// |description | +// |unit | +------------------------------------+ +// |data |---> |Gauge, Sum, Histogram, Summary, ... | +// +------------+ +------------------------------------+ +// +// Data [One of Gauge, Sum, Histogram, Summary, ...] +// +-----------+ +// |... | // Metadata about the Data. +// |points |--+ +// +-----------+ | +// | +---------------------------+ +// | |DataPoint 1 | +// v |+------+------+ +------+ | +// +-----+ ||label |label |...|label | | +// | 1 |-->||value1|value2|...|valueN| | +// +-----+ |+------+------+ +------+ | +// | . | |+-----+ | +// | . | ||value| | +// | . | |+-----+ | +// | . | +---------------------------+ +// | . | . +// | . | . +// | . | . +// | . | +---------------------------+ +// | . | |DataPoint M | +// +-----+ |+------+------+ +------+ | +// | M |-->||label |label |...|label | | +// +-----+ ||value1|value2|...|valueN| | +// |+------+------+ +------+ | +// |+-----+ | +// ||value| | +// |+-----+ | +// +---------------------------+ +// +// All DataPoint types have three common fields: +// - Labels zero or more key-value pairs associated with the data point. +// - StartTimeUnixNano MUST be set to the start of the interval when the data's +// type includes an AggregationTemporality. This field is not set otherwise. +// - TimeUnixNano MUST be set to: +// - the moment when an aggregation is reported (independent of the +// aggregation temporality). +// - the instantaneous time of the event. +type Metric struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // name of the metric, including its DNS name prefix. It must be unique. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // description of the metric, which can be used in documentation. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // unit in which the metric value is reported. Follows the format + // described by http://unitsofmeasure.org/ucum.html. + Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"` + // Data determines the aggregation type (if any) of the metric, what is the + // reported value type for the data points, as well as the relatationship to + // the time interval over which they are reported. + // + // TODO: Update table after the decision on: + // https://github.com/open-telemetry/opentelemetry-specification/issues/731. + // By default, metrics recording using the OpenTelemetry API are exported as + // (the table does not include MeasurementValueType to avoid extra rows): + // + // Instrument Type + // ---------------------------------------------- + // Counter Sum(aggregation_temporality=delta;is_monotonic=true) + // UpDownCounter Sum(aggregation_temporality=delta;is_monotonic=false) + // ValueRecorder TBD + // SumObserver Sum(aggregation_temporality=cumulative;is_monotonic=true) + // UpDownSumObserver Sum(aggregation_temporality=cumulative;is_monotonic=false) + // ValueObserver Gauge() + // + // Types that are assignable to Data: + // *Metric_IntGauge + // *Metric_DoubleGauge + // *Metric_IntSum + // *Metric_DoubleSum + // *Metric_IntHistogram + // *Metric_DoubleHistogram + // *Metric_DoubleSummary + Data isMetric_Data `protobuf_oneof:"data"` +} + +func (x *Metric) Reset() { + *x = Metric{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metric) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metric) ProtoMessage() {} + +func (x *Metric) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[2] + 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 Metric.ProtoReflect.Descriptor instead. +func (*Metric) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{2} +} + +func (x *Metric) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Metric) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Metric) GetUnit() string { + if x != nil { + return x.Unit + } + return "" +} + +func (m *Metric) GetData() isMetric_Data { + if m != nil { + return m.Data + } + return nil +} + +func (x *Metric) GetIntGauge() *IntGauge { + if x, ok := x.GetData().(*Metric_IntGauge); ok { + return x.IntGauge + } + return nil +} + +func (x *Metric) GetDoubleGauge() *DoubleGauge { + if x, ok := x.GetData().(*Metric_DoubleGauge); ok { + return x.DoubleGauge + } + return nil +} + +func (x *Metric) GetIntSum() *IntSum { + if x, ok := x.GetData().(*Metric_IntSum); ok { + return x.IntSum + } + return nil +} + +func (x *Metric) GetDoubleSum() *DoubleSum { + if x, ok := x.GetData().(*Metric_DoubleSum); ok { + return x.DoubleSum + } + return nil +} + +func (x *Metric) GetIntHistogram() *IntHistogram { + if x, ok := x.GetData().(*Metric_IntHistogram); ok { + return x.IntHistogram + } + return nil +} + +func (x *Metric) GetDoubleHistogram() *DoubleHistogram { + if x, ok := x.GetData().(*Metric_DoubleHistogram); ok { + return x.DoubleHistogram + } + return nil +} + +func (x *Metric) GetDoubleSummary() *DoubleSummary { + if x, ok := x.GetData().(*Metric_DoubleSummary); ok { + return x.DoubleSummary + } + return nil +} + +type isMetric_Data interface { + isMetric_Data() +} + +type Metric_IntGauge struct { + IntGauge *IntGauge `protobuf:"bytes,4,opt,name=int_gauge,json=intGauge,proto3,oneof"` +} + +type Metric_DoubleGauge struct { + DoubleGauge *DoubleGauge `protobuf:"bytes,5,opt,name=double_gauge,json=doubleGauge,proto3,oneof"` +} + +type Metric_IntSum struct { + IntSum *IntSum `protobuf:"bytes,6,opt,name=int_sum,json=intSum,proto3,oneof"` +} + +type Metric_DoubleSum struct { + DoubleSum *DoubleSum `protobuf:"bytes,7,opt,name=double_sum,json=doubleSum,proto3,oneof"` +} + +type Metric_IntHistogram struct { + IntHistogram *IntHistogram `protobuf:"bytes,8,opt,name=int_histogram,json=intHistogram,proto3,oneof"` +} + +type Metric_DoubleHistogram struct { + DoubleHistogram *DoubleHistogram `protobuf:"bytes,9,opt,name=double_histogram,json=doubleHistogram,proto3,oneof"` +} + +type Metric_DoubleSummary struct { + DoubleSummary *DoubleSummary `protobuf:"bytes,11,opt,name=double_summary,json=doubleSummary,proto3,oneof"` +} + +func (*Metric_IntGauge) isMetric_Data() {} + +func (*Metric_DoubleGauge) isMetric_Data() {} + +func (*Metric_IntSum) isMetric_Data() {} + +func (*Metric_DoubleSum) isMetric_Data() {} + +func (*Metric_IntHistogram) isMetric_Data() {} + +func (*Metric_DoubleHistogram) isMetric_Data() {} + +func (*Metric_DoubleSummary) isMetric_Data() {} + +// Gauge represents the type of a int scalar metric that always exports the +// "current value" for every data point. It should be used for an "unknown" +// aggregation. +// +// A Gauge does not support different aggregation temporalities. Given the +// aggregation is unknown, points cannot be combined using the same +// aggregation, regardless of aggregation temporalities. Therefore, +// AggregationTemporality is not included. Consequently, this also means +// "StartTimeUnixNano" is ignored for all data points. +type IntGauge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataPoints []*IntDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` +} + +func (x *IntGauge) Reset() { + *x = IntGauge{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IntGauge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IntGauge) ProtoMessage() {} + +func (x *IntGauge) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[3] + 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 IntGauge.ProtoReflect.Descriptor instead. +func (*IntGauge) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{3} +} + +func (x *IntGauge) GetDataPoints() []*IntDataPoint { + if x != nil { + return x.DataPoints + } + return nil +} + +// Gauge represents the type of a double scalar metric that always exports the +// "current value" for every data point. It should be used for an "unknown" +// aggregation. +// +// A Gauge does not support different aggregation temporalities. Given the +// aggregation is unknown, points cannot be combined using the same +// aggregation, regardless of aggregation temporalities. Therefore, +// AggregationTemporality is not included. Consequently, this also means +// "StartTimeUnixNano" is ignored for all data points. +type DoubleGauge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataPoints []*DoubleDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` +} + +func (x *DoubleGauge) Reset() { + *x = DoubleGauge{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleGauge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleGauge) ProtoMessage() {} + +func (x *DoubleGauge) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[4] + 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 DoubleGauge.ProtoReflect.Descriptor instead. +func (*DoubleGauge) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{4} +} + +func (x *DoubleGauge) GetDataPoints() []*DoubleDataPoint { + if x != nil { + return x.DataPoints + } + return nil +} + +// Sum represents the type of a numeric int scalar metric that is calculated as +// a sum of all reported measurements over a time interval. +type IntSum struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataPoints []*IntDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + // aggregation_temporality describes if the aggregator reports delta changes + // since last report time, or cumulative changes since a fixed start time. + AggregationTemporality AggregationTemporality `protobuf:"varint,2,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.metrics.v1.AggregationTemporality" json:"aggregation_temporality,omitempty"` + // If "true" means that the sum is monotonic. + IsMonotonic bool `protobuf:"varint,3,opt,name=is_monotonic,json=isMonotonic,proto3" json:"is_monotonic,omitempty"` +} + +func (x *IntSum) Reset() { + *x = IntSum{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IntSum) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IntSum) ProtoMessage() {} + +func (x *IntSum) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[5] + 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 IntSum.ProtoReflect.Descriptor instead. +func (*IntSum) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{5} +} + +func (x *IntSum) GetDataPoints() []*IntDataPoint { + if x != nil { + return x.DataPoints + } + return nil +} + +func (x *IntSum) GetAggregationTemporality() AggregationTemporality { + if x != nil { + return x.AggregationTemporality + } + return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + +func (x *IntSum) GetIsMonotonic() bool { + if x != nil { + return x.IsMonotonic + } + return false +} + +// Sum represents the type of a numeric double scalar metric that is calculated +// as a sum of all reported measurements over a time interval. +type DoubleSum struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataPoints []*DoubleDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + // aggregation_temporality describes if the aggregator reports delta changes + // since last report time, or cumulative changes since a fixed start time. + AggregationTemporality AggregationTemporality `protobuf:"varint,2,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.metrics.v1.AggregationTemporality" json:"aggregation_temporality,omitempty"` + // If "true" means that the sum is monotonic. + IsMonotonic bool `protobuf:"varint,3,opt,name=is_monotonic,json=isMonotonic,proto3" json:"is_monotonic,omitempty"` +} + +func (x *DoubleSum) Reset() { + *x = DoubleSum{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleSum) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleSum) ProtoMessage() {} + +func (x *DoubleSum) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[6] + 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 DoubleSum.ProtoReflect.Descriptor instead. +func (*DoubleSum) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{6} +} + +func (x *DoubleSum) GetDataPoints() []*DoubleDataPoint { + if x != nil { + return x.DataPoints + } + return nil +} + +func (x *DoubleSum) GetAggregationTemporality() AggregationTemporality { + if x != nil { + return x.AggregationTemporality + } + return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + +func (x *DoubleSum) GetIsMonotonic() bool { + if x != nil { + return x.IsMonotonic + } + return false +} + +// Represents the type of a metric that is calculated by aggregating as a +// Histogram of all reported int measurements over a time interval. +type IntHistogram struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataPoints []*IntHistogramDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + // aggregation_temporality describes if the aggregator reports delta changes + // since last report time, or cumulative changes since a fixed start time. + AggregationTemporality AggregationTemporality `protobuf:"varint,2,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.metrics.v1.AggregationTemporality" json:"aggregation_temporality,omitempty"` +} + +func (x *IntHistogram) Reset() { + *x = IntHistogram{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IntHistogram) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IntHistogram) ProtoMessage() {} + +func (x *IntHistogram) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[7] + 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 IntHistogram.ProtoReflect.Descriptor instead. +func (*IntHistogram) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{7} +} + +func (x *IntHistogram) GetDataPoints() []*IntHistogramDataPoint { + if x != nil { + return x.DataPoints + } + return nil +} + +func (x *IntHistogram) GetAggregationTemporality() AggregationTemporality { + if x != nil { + return x.AggregationTemporality + } + return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + +// Represents the type of a metric that is calculated by aggregating as a +// Histogram of all reported double measurements over a time interval. +type DoubleHistogram struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataPoints []*DoubleHistogramDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + // aggregation_temporality describes if the aggregator reports delta changes + // since last report time, or cumulative changes since a fixed start time. + AggregationTemporality AggregationTemporality `protobuf:"varint,2,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.metrics.v1.AggregationTemporality" json:"aggregation_temporality,omitempty"` +} + +func (x *DoubleHistogram) Reset() { + *x = DoubleHistogram{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleHistogram) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleHistogram) ProtoMessage() {} + +func (x *DoubleHistogram) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[8] + 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 DoubleHistogram.ProtoReflect.Descriptor instead. +func (*DoubleHistogram) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{8} +} + +func (x *DoubleHistogram) GetDataPoints() []*DoubleHistogramDataPoint { + if x != nil { + return x.DataPoints + } + return nil +} + +func (x *DoubleHistogram) GetAggregationTemporality() AggregationTemporality { + if x != nil { + return x.AggregationTemporality + } + return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + +// DoubleSummary metric data are used to convey quantile summaries, +// a Prometheus (see: https://prometheus.io/docs/concepts/metric_types/#summary) +// and OpenMetrics (see: https://github.com/OpenObservability/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45) +// data type. These data points cannot always be merged in a meaningful way. +// While they can be useful in some applications, histogram data points are +// recommended for new applications. +type DoubleSummary struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataPoints []*DoubleSummaryDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` +} + +func (x *DoubleSummary) Reset() { + *x = DoubleSummary{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleSummary) ProtoMessage() {} + +func (x *DoubleSummary) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[9] + 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 DoubleSummary.ProtoReflect.Descriptor instead. +func (*DoubleSummary) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{9} +} + +func (x *DoubleSummary) GetDataPoints() []*DoubleSummaryDataPoint { + if x != nil { + return x.DataPoints + } + return nil +} + +// IntDataPoint is a single data point in a timeseries that describes the +// time-varying values of a int64 metric. +type IntDataPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The set of labels that uniquely identify this timeseries. + Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + // start_time_unix_nano is the last time when the aggregation value was reset + // to "zero". For some metric types this is ignored, see data types for more + // details. + // + // The aggregation value is over the time interval (start_time_unix_nano, + // time_unix_nano]. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + // + // Value of 0 indicates that the timestamp is unspecified. In that case the + // timestamp may be decided by the backend. + StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` + // time_unix_nano is the moment when this aggregation value was reported. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // value itself. + Value int64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` + // (Optional) List of exemplars collected from + // measurements that were used to form the data point + Exemplars []*IntExemplar `protobuf:"bytes,5,rep,name=exemplars,proto3" json:"exemplars,omitempty"` +} + +func (x *IntDataPoint) Reset() { + *x = IntDataPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IntDataPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IntDataPoint) ProtoMessage() {} + +func (x *IntDataPoint) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[10] + 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 IntDataPoint.ProtoReflect.Descriptor instead. +func (*IntDataPoint) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{10} +} + +func (x *IntDataPoint) GetLabels() []*v11.StringKeyValue { + if x != nil { + return x.Labels + } + return nil +} + +func (x *IntDataPoint) GetStartTimeUnixNano() uint64 { + if x != nil { + return x.StartTimeUnixNano + } + return 0 +} + +func (x *IntDataPoint) GetTimeUnixNano() uint64 { + if x != nil { + return x.TimeUnixNano + } + return 0 +} + +func (x *IntDataPoint) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *IntDataPoint) GetExemplars() []*IntExemplar { + if x != nil { + return x.Exemplars + } + return nil +} + +// DoubleDataPoint is a single data point in a timeseries that describes the +// time-varying value of a double metric. +type DoubleDataPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The set of labels that uniquely identify this timeseries. + Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + // start_time_unix_nano is the last time when the aggregation value was reset + // to "zero". For some metric types this is ignored, see data types for more + // details. + // + // The aggregation value is over the time interval (start_time_unix_nano, + // time_unix_nano]. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + // + // Value of 0 indicates that the timestamp is unspecified. In that case the + // timestamp may be decided by the backend. + StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` + // time_unix_nano is the moment when this aggregation value was reported. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // value itself. + Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` + // (Optional) List of exemplars collected from + // measurements that were used to form the data point + Exemplars []*DoubleExemplar `protobuf:"bytes,5,rep,name=exemplars,proto3" json:"exemplars,omitempty"` +} + +func (x *DoubleDataPoint) Reset() { + *x = DoubleDataPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleDataPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleDataPoint) ProtoMessage() {} + +func (x *DoubleDataPoint) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[11] + 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 DoubleDataPoint.ProtoReflect.Descriptor instead. +func (*DoubleDataPoint) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{11} +} + +func (x *DoubleDataPoint) GetLabels() []*v11.StringKeyValue { + if x != nil { + return x.Labels + } + return nil +} + +func (x *DoubleDataPoint) GetStartTimeUnixNano() uint64 { + if x != nil { + return x.StartTimeUnixNano + } + return 0 +} + +func (x *DoubleDataPoint) GetTimeUnixNano() uint64 { + if x != nil { + return x.TimeUnixNano + } + return 0 +} + +func (x *DoubleDataPoint) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *DoubleDataPoint) GetExemplars() []*DoubleExemplar { + if x != nil { + return x.Exemplars + } + return nil +} + +// IntHistogramDataPoint is a single data point in a timeseries that describes +// the time-varying values of a Histogram of int values. A Histogram contains +// summary statistics for a population of values, it may optionally contain +// the distribution of those values across a set of buckets. +type IntHistogramDataPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The set of labels that uniquely identify this timeseries. + Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + // start_time_unix_nano is the last time when the aggregation value was reset + // to "zero". For some metric types this is ignored, see data types for more + // details. + // + // The aggregation value is over the time interval (start_time_unix_nano, + // time_unix_nano]. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + // + // Value of 0 indicates that the timestamp is unspecified. In that case the + // timestamp may be decided by the backend. + StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` + // time_unix_nano is the moment when this aggregation value was reported. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // count is the number of values in the population. Must be non-negative. This + // value must be equal to the sum of the "count" fields in buckets if a + // histogram is provided. + Count uint64 `protobuf:"fixed64,4,opt,name=count,proto3" json:"count,omitempty"` + // sum of the values in the population. If count is zero then this field + // must be zero. This value must be equal to the sum of the "sum" fields in + // buckets if a histogram is provided. + Sum int64 `protobuf:"fixed64,5,opt,name=sum,proto3" json:"sum,omitempty"` + // bucket_counts is an optional field contains the count values of histogram + // for each bucket. + // + // The sum of the bucket_counts must equal the value in the count field. + // + // The number of elements in bucket_counts array must be by one greater than + // the number of elements in explicit_bounds array. + BucketCounts []uint64 `protobuf:"fixed64,6,rep,packed,name=bucket_counts,json=bucketCounts,proto3" json:"bucket_counts,omitempty"` + // explicit_bounds specifies buckets with explicitly defined bounds for values. + // The bucket boundaries are described by "bounds" field. + // + // This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket + // at index i are: + // + // (-infinity, bounds[i]) for i == 0 + // [bounds[i-1], bounds[i]) for 0 < i < N-1 + // [bounds[i], +infinity) for i == N-1 + // The values in bounds array must be strictly increasing. + // + // Note: only [a, b) intervals are currently supported for each bucket except the first one. + // If we decide to also support (a, b] intervals we should add support for these by defining + // a boolean value which decides what type of intervals to use. + ExplicitBounds []float64 `protobuf:"fixed64,7,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"` + // (Optional) List of exemplars collected from + // measurements that were used to form the data point + Exemplars []*IntExemplar `protobuf:"bytes,8,rep,name=exemplars,proto3" json:"exemplars,omitempty"` +} + +func (x *IntHistogramDataPoint) Reset() { + *x = IntHistogramDataPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IntHistogramDataPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IntHistogramDataPoint) ProtoMessage() {} + +func (x *IntHistogramDataPoint) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[12] + 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 IntHistogramDataPoint.ProtoReflect.Descriptor instead. +func (*IntHistogramDataPoint) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{12} +} + +func (x *IntHistogramDataPoint) GetLabels() []*v11.StringKeyValue { + if x != nil { + return x.Labels + } + return nil +} + +func (x *IntHistogramDataPoint) GetStartTimeUnixNano() uint64 { + if x != nil { + return x.StartTimeUnixNano + } + return 0 +} + +func (x *IntHistogramDataPoint) GetTimeUnixNano() uint64 { + if x != nil { + return x.TimeUnixNano + } + return 0 +} + +func (x *IntHistogramDataPoint) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *IntHistogramDataPoint) GetSum() int64 { + if x != nil { + return x.Sum + } + return 0 +} + +func (x *IntHistogramDataPoint) GetBucketCounts() []uint64 { + if x != nil { + return x.BucketCounts + } + return nil +} + +func (x *IntHistogramDataPoint) GetExplicitBounds() []float64 { + if x != nil { + return x.ExplicitBounds + } + return nil +} + +func (x *IntHistogramDataPoint) GetExemplars() []*IntExemplar { + if x != nil { + return x.Exemplars + } + return nil +} + +// HistogramDataPoint is a single data point in a timeseries that describes the +// time-varying values of a Histogram of double values. A Histogram contains +// summary statistics for a population of values, it may optionally contain the +// distribution of those values across a set of buckets. +type DoubleHistogramDataPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The set of labels that uniquely identify this timeseries. + Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + // start_time_unix_nano is the last time when the aggregation value was reset + // to "zero". For some metric types this is ignored, see data types for more + // details. + // + // The aggregation value is over the time interval (start_time_unix_nano, + // time_unix_nano]. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + // + // Value of 0 indicates that the timestamp is unspecified. In that case the + // timestamp may be decided by the backend. + StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` + // time_unix_nano is the moment when this aggregation value was reported. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // count is the number of values in the population. Must be non-negative. This + // value must be equal to the sum of the "count" fields in buckets if a + // histogram is provided. + Count uint64 `protobuf:"fixed64,4,opt,name=count,proto3" json:"count,omitempty"` + // sum of the values in the population. If count is zero then this field + // must be zero. This value must be equal to the sum of the "sum" fields in + // buckets if a histogram is provided. + Sum float64 `protobuf:"fixed64,5,opt,name=sum,proto3" json:"sum,omitempty"` + // bucket_counts is an optional field contains the count values of histogram + // for each bucket. + // + // The sum of the bucket_counts must equal the value in the count field. + // + // The number of elements in bucket_counts array must be by one greater than + // the number of elements in explicit_bounds array. + BucketCounts []uint64 `protobuf:"fixed64,6,rep,packed,name=bucket_counts,json=bucketCounts,proto3" json:"bucket_counts,omitempty"` + // explicit_bounds specifies buckets with explicitly defined bounds for values. + // The bucket boundaries are described by "bounds" field. + // + // This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket + // at index i are: + // + // (-infinity, bounds[i]) for i == 0 + // [bounds[i-1], bounds[i]) for 0 < i < N-1 + // [bounds[i], +infinity) for i == N-1 + // The values in bounds array must be strictly increasing. + // + // Note: only [a, b) intervals are currently supported for each bucket except the first one. + // If we decide to also support (a, b] intervals we should add support for these by defining + // a boolean value which decides what type of intervals to use. + ExplicitBounds []float64 `protobuf:"fixed64,7,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"` + // (Optional) List of exemplars collected from + // measurements that were used to form the data point + Exemplars []*DoubleExemplar `protobuf:"bytes,8,rep,name=exemplars,proto3" json:"exemplars,omitempty"` +} + +func (x *DoubleHistogramDataPoint) Reset() { + *x = DoubleHistogramDataPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleHistogramDataPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleHistogramDataPoint) ProtoMessage() {} + +func (x *DoubleHistogramDataPoint) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[13] + 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 DoubleHistogramDataPoint.ProtoReflect.Descriptor instead. +func (*DoubleHistogramDataPoint) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{13} +} + +func (x *DoubleHistogramDataPoint) GetLabels() []*v11.StringKeyValue { + if x != nil { + return x.Labels + } + return nil +} + +func (x *DoubleHistogramDataPoint) GetStartTimeUnixNano() uint64 { + if x != nil { + return x.StartTimeUnixNano + } + return 0 +} + +func (x *DoubleHistogramDataPoint) GetTimeUnixNano() uint64 { + if x != nil { + return x.TimeUnixNano + } + return 0 +} + +func (x *DoubleHistogramDataPoint) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *DoubleHistogramDataPoint) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +func (x *DoubleHistogramDataPoint) GetBucketCounts() []uint64 { + if x != nil { + return x.BucketCounts + } + return nil +} + +func (x *DoubleHistogramDataPoint) GetExplicitBounds() []float64 { + if x != nil { + return x.ExplicitBounds + } + return nil +} + +func (x *DoubleHistogramDataPoint) GetExemplars() []*DoubleExemplar { + if x != nil { + return x.Exemplars + } + return nil +} + +// DoubleSummaryDataPoint is a single data point in a timeseries that describes the +// time-varying values of a Summary metric. +type DoubleSummaryDataPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The set of labels that uniquely identify this timeseries. + Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + // start_time_unix_nano is the last time when the aggregation value was reset + // to "zero". For some metric types this is ignored, see data types for more + // details. + // + // The aggregation value is over the time interval (start_time_unix_nano, + // time_unix_nano]. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + // + // Value of 0 indicates that the timestamp is unspecified. In that case the + // timestamp may be decided by the backend. + StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` + // time_unix_nano is the moment when this aggregation value was reported. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // count is the number of values in the population. Must be non-negative. + Count uint64 `protobuf:"fixed64,4,opt,name=count,proto3" json:"count,omitempty"` + // sum of the values in the population. If count is zero then this field + // must be zero. + Sum float64 `protobuf:"fixed64,5,opt,name=sum,proto3" json:"sum,omitempty"` + // (Optional) list of values at different quantiles of the distribution calculated + // from the current snapshot. The quantiles must be strictly increasing. + QuantileValues []*DoubleSummaryDataPoint_ValueAtQuantile `protobuf:"bytes,6,rep,name=quantile_values,json=quantileValues,proto3" json:"quantile_values,omitempty"` +} + +func (x *DoubleSummaryDataPoint) Reset() { + *x = DoubleSummaryDataPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleSummaryDataPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleSummaryDataPoint) ProtoMessage() {} + +func (x *DoubleSummaryDataPoint) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[14] + 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 DoubleSummaryDataPoint.ProtoReflect.Descriptor instead. +func (*DoubleSummaryDataPoint) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{14} +} + +func (x *DoubleSummaryDataPoint) GetLabels() []*v11.StringKeyValue { + if x != nil { + return x.Labels + } + return nil +} + +func (x *DoubleSummaryDataPoint) GetStartTimeUnixNano() uint64 { + if x != nil { + return x.StartTimeUnixNano + } + return 0 +} + +func (x *DoubleSummaryDataPoint) GetTimeUnixNano() uint64 { + if x != nil { + return x.TimeUnixNano + } + return 0 +} + +func (x *DoubleSummaryDataPoint) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *DoubleSummaryDataPoint) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +func (x *DoubleSummaryDataPoint) GetQuantileValues() []*DoubleSummaryDataPoint_ValueAtQuantile { + if x != nil { + return x.QuantileValues + } + return nil +} + +// A representation of an exemplar, which is a sample input int measurement. +// Exemplars also hold information about the environment when the measurement +// was recorded, for example the span and trace ID of the active span when the +// exemplar was recorded. +type IntExemplar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The set of labels that were filtered out by the aggregator, but recorded + // alongside the original measurement. Only labels that were filtered out + // by the aggregator should be included + FilteredLabels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=filtered_labels,json=filteredLabels,proto3" json:"filtered_labels,omitempty"` + // time_unix_nano is the exact time when this exemplar was recorded + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // Numerical int value of the measurement that was recorded. + Value int64 `protobuf:"fixed64,3,opt,name=value,proto3" json:"value,omitempty"` + // (Optional) Span ID of the exemplar trace. + // span_id may be missing if the measurement is not recorded inside a trace + // or if the trace is not sampled. + SpanId []byte `protobuf:"bytes,4,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + // (Optional) Trace ID of the exemplar trace. + // trace_id may be missing if the measurement is not recorded inside a trace + // or if the trace is not sampled. + TraceId []byte `protobuf:"bytes,5,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` +} + +func (x *IntExemplar) Reset() { + *x = IntExemplar{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IntExemplar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IntExemplar) ProtoMessage() {} + +func (x *IntExemplar) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[15] + 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 IntExemplar.ProtoReflect.Descriptor instead. +func (*IntExemplar) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{15} +} + +func (x *IntExemplar) GetFilteredLabels() []*v11.StringKeyValue { + if x != nil { + return x.FilteredLabels + } + return nil +} + +func (x *IntExemplar) GetTimeUnixNano() uint64 { + if x != nil { + return x.TimeUnixNano + } + return 0 +} + +func (x *IntExemplar) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *IntExemplar) GetSpanId() []byte { + if x != nil { + return x.SpanId + } + return nil +} + +func (x *IntExemplar) GetTraceId() []byte { + if x != nil { + return x.TraceId + } + return nil +} + +// A representation of an exemplar, which is a sample input double measurement. +// Exemplars also hold information about the environment when the measurement +// was recorded, for example the span and trace ID of the active span when the +// exemplar was recorded. +type DoubleExemplar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The set of labels that were filtered out by the aggregator, but recorded + // alongside the original measurement. Only labels that were filtered out + // by the aggregator should be included + FilteredLabels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=filtered_labels,json=filteredLabels,proto3" json:"filtered_labels,omitempty"` + // time_unix_nano is the exact time when this exemplar was recorded + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // Numerical double value of the measurement that was recorded. + Value float64 `protobuf:"fixed64,3,opt,name=value,proto3" json:"value,omitempty"` + // (Optional) Span ID of the exemplar trace. + // span_id may be missing if the measurement is not recorded inside a trace + // or if the trace is not sampled. + SpanId []byte `protobuf:"bytes,4,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + // (Optional) Trace ID of the exemplar trace. + // trace_id may be missing if the measurement is not recorded inside a trace + // or if the trace is not sampled. + TraceId []byte `protobuf:"bytes,5,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` +} + +func (x *DoubleExemplar) Reset() { + *x = DoubleExemplar{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleExemplar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleExemplar) ProtoMessage() {} + +func (x *DoubleExemplar) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[16] + 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 DoubleExemplar.ProtoReflect.Descriptor instead. +func (*DoubleExemplar) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{16} +} + +func (x *DoubleExemplar) GetFilteredLabels() []*v11.StringKeyValue { + if x != nil { + return x.FilteredLabels + } + return nil +} + +func (x *DoubleExemplar) GetTimeUnixNano() uint64 { + if x != nil { + return x.TimeUnixNano + } + return 0 +} + +func (x *DoubleExemplar) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *DoubleExemplar) GetSpanId() []byte { + if x != nil { + return x.SpanId + } + return nil +} + +func (x *DoubleExemplar) GetTraceId() []byte { + if x != nil { + return x.TraceId + } + return nil +} + +// Represents the value at a given quantile of a distribution. +// +// To record Min and Max values following conventions are used: +// - The 1.0 quantile is equivalent to the maximum value observed. +// - The 0.0 quantile is equivalent to the minimum value observed. +// +// See the following issue for more context: +// https://github.com/open-telemetry/opentelemetry-proto/issues/125 +type DoubleSummaryDataPoint_ValueAtQuantile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The quantile of a distribution. Must be in the interval + // [0.0, 1.0]. + Quantile float64 `protobuf:"fixed64,1,opt,name=quantile,proto3" json:"quantile,omitempty"` + // The value at the given quantile of a distribution. + Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *DoubleSummaryDataPoint_ValueAtQuantile) Reset() { + *x = DoubleSummaryDataPoint_ValueAtQuantile{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleSummaryDataPoint_ValueAtQuantile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleSummaryDataPoint_ValueAtQuantile) ProtoMessage() {} + +func (x *DoubleSummaryDataPoint_ValueAtQuantile) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[17] + 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 DoubleSummaryDataPoint_ValueAtQuantile.ProtoReflect.Descriptor instead. +func (*DoubleSummaryDataPoint_ValueAtQuantile) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *DoubleSummaryDataPoint_ValueAtQuantile) GetQuantile() float64 { + if x != nil { + return x.Quantile + } + return 0 +} + +func (x *DoubleSummaryDataPoint_ValueAtQuantile) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +var File_opentelemetry_proto_metrics_v1_metrics_proto protoreflect.FileDescriptor + +var file_opentelemetry_proto_metrics_v1_metrics_proto_rawDesc = []byte{ + 0x0a, 0x2c, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x76, 0x31, + 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, + 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x2a, + 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe0, 0x01, 0x0a, 0x0f, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x45, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x85, 0x01, 0x0a, 0x1f, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x1d, + 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, + 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0xd1, 0x01, + 0x0a, 0x1d, 0x49, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, + 0x6e, 0x0a, 0x17, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x35, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x16, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, + 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x73, 0x22, 0x8f, 0x05, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x47, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x67, 0x61, + 0x75, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x47, 0x61, + 0x75, 0x67, 0x65, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x47, 0x61, 0x75, 0x67, 0x65, 0x12, + 0x50, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x47, 0x61, 0x75, + 0x67, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x47, 0x61, 0x75, 0x67, + 0x65, 0x12, 0x41, 0x0a, 0x07, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, + 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x53, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, + 0x74, 0x53, 0x75, 0x6d, 0x12, 0x4a, 0x0a, 0x0a, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x73, + 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x53, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x09, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x6d, + 0x12, 0x53, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x5c, 0x0a, 0x10, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, + 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, + 0x48, 0x00, 0x52, 0x0f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, + 0x72, 0x61, 0x6d, 0x12, 0x56, 0x0a, 0x0e, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x75, + 0x62, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x22, 0x59, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x47, 0x61, 0x75, 0x67, 0x65, 0x12, + 0x4d, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x5f, + 0x0a, 0x0b, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x47, 0x61, 0x75, 0x67, 0x65, 0x12, 0x50, 0x0a, + 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, + 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, + 0xeb, 0x01, 0x0a, 0x06, 0x49, 0x6e, 0x74, 0x53, 0x75, 0x6d, 0x12, 0x4d, 0x0a, 0x0b, 0x64, 0x61, + 0x74, 0x61, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x49, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x64, + 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x6f, 0x0a, 0x17, 0x61, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, + 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x69, + 0x74, 0x79, 0x52, 0x16, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, + 0x5f, 0x6d, 0x6f, 0x6e, 0x6f, 0x74, 0x6f, 0x6e, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0b, 0x69, 0x73, 0x4d, 0x6f, 0x6e, 0x6f, 0x74, 0x6f, 0x6e, 0x69, 0x63, 0x22, 0xf1, 0x01, + 0x0a, 0x09, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x50, 0x0a, 0x0b, 0x64, + 0x61, 0x74, 0x61, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x6f, 0x0a, + 0x17, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x65, 0x6d, + 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6f, + 0x72, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x16, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x21, + 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x6d, 0x6f, 0x6e, 0x6f, 0x74, 0x6f, 0x6e, 0x69, 0x63, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x4d, 0x6f, 0x6e, 0x6f, 0x74, 0x6f, 0x6e, 0x69, + 0x63, 0x22, 0xd7, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, + 0x61, 0x6d, 0x12, 0x56, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x74, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, + 0x64, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x6f, 0x0a, 0x17, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, + 0x69, 0x74, 0x79, 0x52, 0x16, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0xdd, 0x01, 0x0a, 0x0f, + 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, + 0x59, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, + 0x64, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x6f, 0x0a, 0x17, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, + 0x69, 0x74, 0x79, 0x52, 0x16, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x68, 0x0a, 0x0d, 0x44, + 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x57, 0x0a, 0x0b, + 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x36, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x8d, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x74, 0x44, 0x61, 0x74, + 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2f, 0x0a, + 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, + 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x11, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x24, + 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, + 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x10, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x49, 0x0a, 0x09, 0x65, 0x78, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, + 0x6e, 0x74, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x09, 0x65, 0x78, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x72, 0x73, 0x22, 0x93, 0x02, 0x0a, 0x0f, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, + 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x11, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, + 0x6f, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, + 0x61, 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, + 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4c, 0x0a, + 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, + 0x52, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x22, 0xf6, 0x02, 0x0a, 0x15, + 0x49, 0x6e, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x61, 0x74, 0x61, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2f, 0x0a, 0x14, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, + 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x11, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x24, 0x0a, + 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, + 0x61, 0x6e, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x06, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x10, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x06, 0x52, 0x0c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x5f, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x6c, 0x69, + 0x63, 0x69, 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x49, 0x0a, 0x09, 0x65, 0x78, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, + 0x74, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x72, 0x73, 0x22, 0xfc, 0x02, 0x0a, 0x18, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x48, + 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x12, 0x45, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x11, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x69, 0x6d, + 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x06, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x06, 0x52, 0x0c, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0f, + 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x5f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x42, + 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x4c, 0x0a, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x72, 0x73, 0x22, 0x94, 0x03, 0x0a, 0x16, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x53, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x45, + 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x06, 0x52, 0x11, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, + 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, + 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, + 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x06, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x03, 0x73, 0x75, 0x6d, 0x12, 0x6f, 0x0a, 0x0f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x46, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x74, 0x51, 0x75, 0x61, + 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x52, 0x0e, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x43, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x41, 0x74, + 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, + 0x74, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, + 0x74, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xd5, 0x01, 0x0a, 0x0b, 0x49, + 0x6e, 0x74, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x12, 0x56, 0x0a, 0x0f, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, + 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, + 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x10, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x06, 0x73, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x49, 0x64, 0x22, 0xd8, 0x01, 0x0a, 0x0e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x45, 0x78, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x12, 0x56, 0x0a, 0x0f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, + 0x64, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x24, 0x0a, + 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, + 0x61, 0x6e, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x61, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61, 0x6e, + 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x2a, 0x8c, 0x01, + 0x0a, 0x16, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, + 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x27, 0x0a, 0x23, 0x41, 0x47, 0x47, 0x52, + 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x45, 0x4d, 0x50, 0x4f, 0x52, 0x41, 0x4c, + 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x54, 0x45, 0x4d, 0x50, 0x4f, 0x52, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x44, 0x45, 0x4c, + 0x54, 0x41, 0x10, 0x01, 0x12, 0x26, 0x0a, 0x22, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x45, 0x4d, 0x50, 0x4f, 0x52, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, + 0x43, 0x55, 0x4d, 0x55, 0x4c, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x42, 0x5e, 0x0a, 0x21, + 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, + 0x31, 0x42, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x29, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, + 0x70, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescOnce sync.Once + file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescData = file_opentelemetry_proto_metrics_v1_metrics_proto_rawDesc +) + +func file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP() []byte { + file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescOnce.Do(func() { + file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescData) + }) + return file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescData +} + +var file_opentelemetry_proto_metrics_v1_metrics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_opentelemetry_proto_metrics_v1_metrics_proto_goTypes = []interface{}{ + (AggregationTemporality)(0), // 0: opentelemetry.proto.metrics.v1.AggregationTemporality + (*ResourceMetrics)(nil), // 1: opentelemetry.proto.metrics.v1.ResourceMetrics + (*InstrumentationLibraryMetrics)(nil), // 2: opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics + (*Metric)(nil), // 3: opentelemetry.proto.metrics.v1.Metric + (*IntGauge)(nil), // 4: opentelemetry.proto.metrics.v1.IntGauge + (*DoubleGauge)(nil), // 5: opentelemetry.proto.metrics.v1.DoubleGauge + (*IntSum)(nil), // 6: opentelemetry.proto.metrics.v1.IntSum + (*DoubleSum)(nil), // 7: opentelemetry.proto.metrics.v1.DoubleSum + (*IntHistogram)(nil), // 8: opentelemetry.proto.metrics.v1.IntHistogram + (*DoubleHistogram)(nil), // 9: opentelemetry.proto.metrics.v1.DoubleHistogram + (*DoubleSummary)(nil), // 10: opentelemetry.proto.metrics.v1.DoubleSummary + (*IntDataPoint)(nil), // 11: opentelemetry.proto.metrics.v1.IntDataPoint + (*DoubleDataPoint)(nil), // 12: opentelemetry.proto.metrics.v1.DoubleDataPoint + (*IntHistogramDataPoint)(nil), // 13: opentelemetry.proto.metrics.v1.IntHistogramDataPoint + (*DoubleHistogramDataPoint)(nil), // 14: opentelemetry.proto.metrics.v1.DoubleHistogramDataPoint + (*DoubleSummaryDataPoint)(nil), // 15: opentelemetry.proto.metrics.v1.DoubleSummaryDataPoint + (*IntExemplar)(nil), // 16: opentelemetry.proto.metrics.v1.IntExemplar + (*DoubleExemplar)(nil), // 17: opentelemetry.proto.metrics.v1.DoubleExemplar + (*DoubleSummaryDataPoint_ValueAtQuantile)(nil), // 18: opentelemetry.proto.metrics.v1.DoubleSummaryDataPoint.ValueAtQuantile + (*v1.Resource)(nil), // 19: opentelemetry.proto.resource.v1.Resource + (*v11.InstrumentationLibrary)(nil), // 20: opentelemetry.proto.common.v1.InstrumentationLibrary + (*v11.StringKeyValue)(nil), // 21: opentelemetry.proto.common.v1.StringKeyValue +} +var file_opentelemetry_proto_metrics_v1_metrics_proto_depIdxs = []int32{ + 19, // 0: opentelemetry.proto.metrics.v1.ResourceMetrics.resource:type_name -> opentelemetry.proto.resource.v1.Resource + 2, // 1: opentelemetry.proto.metrics.v1.ResourceMetrics.instrumentation_library_metrics:type_name -> opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics + 20, // 2: opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics.instrumentation_library:type_name -> opentelemetry.proto.common.v1.InstrumentationLibrary + 3, // 3: opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics.metrics:type_name -> opentelemetry.proto.metrics.v1.Metric + 4, // 4: opentelemetry.proto.metrics.v1.Metric.int_gauge:type_name -> opentelemetry.proto.metrics.v1.IntGauge + 5, // 5: opentelemetry.proto.metrics.v1.Metric.double_gauge:type_name -> opentelemetry.proto.metrics.v1.DoubleGauge + 6, // 6: opentelemetry.proto.metrics.v1.Metric.int_sum:type_name -> opentelemetry.proto.metrics.v1.IntSum + 7, // 7: opentelemetry.proto.metrics.v1.Metric.double_sum:type_name -> opentelemetry.proto.metrics.v1.DoubleSum + 8, // 8: opentelemetry.proto.metrics.v1.Metric.int_histogram:type_name -> opentelemetry.proto.metrics.v1.IntHistogram + 9, // 9: opentelemetry.proto.metrics.v1.Metric.double_histogram:type_name -> opentelemetry.proto.metrics.v1.DoubleHistogram + 10, // 10: opentelemetry.proto.metrics.v1.Metric.double_summary:type_name -> opentelemetry.proto.metrics.v1.DoubleSummary + 11, // 11: opentelemetry.proto.metrics.v1.IntGauge.data_points:type_name -> opentelemetry.proto.metrics.v1.IntDataPoint + 12, // 12: opentelemetry.proto.metrics.v1.DoubleGauge.data_points:type_name -> opentelemetry.proto.metrics.v1.DoubleDataPoint + 11, // 13: opentelemetry.proto.metrics.v1.IntSum.data_points:type_name -> opentelemetry.proto.metrics.v1.IntDataPoint + 0, // 14: opentelemetry.proto.metrics.v1.IntSum.aggregation_temporality:type_name -> opentelemetry.proto.metrics.v1.AggregationTemporality + 12, // 15: opentelemetry.proto.metrics.v1.DoubleSum.data_points:type_name -> opentelemetry.proto.metrics.v1.DoubleDataPoint + 0, // 16: opentelemetry.proto.metrics.v1.DoubleSum.aggregation_temporality:type_name -> opentelemetry.proto.metrics.v1.AggregationTemporality + 13, // 17: opentelemetry.proto.metrics.v1.IntHistogram.data_points:type_name -> opentelemetry.proto.metrics.v1.IntHistogramDataPoint + 0, // 18: opentelemetry.proto.metrics.v1.IntHistogram.aggregation_temporality:type_name -> opentelemetry.proto.metrics.v1.AggregationTemporality + 14, // 19: opentelemetry.proto.metrics.v1.DoubleHistogram.data_points:type_name -> opentelemetry.proto.metrics.v1.DoubleHistogramDataPoint + 0, // 20: opentelemetry.proto.metrics.v1.DoubleHistogram.aggregation_temporality:type_name -> opentelemetry.proto.metrics.v1.AggregationTemporality + 15, // 21: opentelemetry.proto.metrics.v1.DoubleSummary.data_points:type_name -> opentelemetry.proto.metrics.v1.DoubleSummaryDataPoint + 21, // 22: opentelemetry.proto.metrics.v1.IntDataPoint.labels:type_name -> opentelemetry.proto.common.v1.StringKeyValue + 16, // 23: opentelemetry.proto.metrics.v1.IntDataPoint.exemplars:type_name -> opentelemetry.proto.metrics.v1.IntExemplar + 21, // 24: opentelemetry.proto.metrics.v1.DoubleDataPoint.labels:type_name -> opentelemetry.proto.common.v1.StringKeyValue + 17, // 25: opentelemetry.proto.metrics.v1.DoubleDataPoint.exemplars:type_name -> opentelemetry.proto.metrics.v1.DoubleExemplar + 21, // 26: opentelemetry.proto.metrics.v1.IntHistogramDataPoint.labels:type_name -> opentelemetry.proto.common.v1.StringKeyValue + 16, // 27: opentelemetry.proto.metrics.v1.IntHistogramDataPoint.exemplars:type_name -> opentelemetry.proto.metrics.v1.IntExemplar + 21, // 28: opentelemetry.proto.metrics.v1.DoubleHistogramDataPoint.labels:type_name -> opentelemetry.proto.common.v1.StringKeyValue + 17, // 29: opentelemetry.proto.metrics.v1.DoubleHistogramDataPoint.exemplars:type_name -> opentelemetry.proto.metrics.v1.DoubleExemplar + 21, // 30: opentelemetry.proto.metrics.v1.DoubleSummaryDataPoint.labels:type_name -> opentelemetry.proto.common.v1.StringKeyValue + 18, // 31: opentelemetry.proto.metrics.v1.DoubleSummaryDataPoint.quantile_values:type_name -> opentelemetry.proto.metrics.v1.DoubleSummaryDataPoint.ValueAtQuantile + 21, // 32: opentelemetry.proto.metrics.v1.IntExemplar.filtered_labels:type_name -> opentelemetry.proto.common.v1.StringKeyValue + 21, // 33: opentelemetry.proto.metrics.v1.DoubleExemplar.filtered_labels:type_name -> opentelemetry.proto.common.v1.StringKeyValue + 34, // [34:34] is the sub-list for method output_type + 34, // [34:34] is the sub-list for method input_type + 34, // [34:34] is the sub-list for extension type_name + 34, // [34:34] is the sub-list for extension extendee + 0, // [0:34] is the sub-list for field type_name +} + +func init() { file_opentelemetry_proto_metrics_v1_metrics_proto_init() } +func file_opentelemetry_proto_metrics_v1_metrics_proto_init() { + if File_opentelemetry_proto_metrics_v1_metrics_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceMetrics); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstrumentationLibraryMetrics); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metric); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IntGauge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleGauge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IntSum); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleSum); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IntHistogram); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleHistogram); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleSummary); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IntDataPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleDataPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IntHistogramDataPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleHistogramDataPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleSummaryDataPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IntExemplar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleExemplar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleSummaryDataPoint_ValueAtQuantile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*Metric_IntGauge)(nil), + (*Metric_DoubleGauge)(nil), + (*Metric_IntSum)(nil), + (*Metric_DoubleSum)(nil), + (*Metric_IntHistogram)(nil), + (*Metric_DoubleHistogram)(nil), + (*Metric_DoubleSummary)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_opentelemetry_proto_metrics_v1_metrics_proto_rawDesc, + NumEnums: 1, + NumMessages: 18, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_opentelemetry_proto_metrics_v1_metrics_proto_goTypes, + DependencyIndexes: file_opentelemetry_proto_metrics_v1_metrics_proto_depIdxs, + EnumInfos: file_opentelemetry_proto_metrics_v1_metrics_proto_enumTypes, + MessageInfos: file_opentelemetry_proto_metrics_v1_metrics_proto_msgTypes, + }.Build() + File_opentelemetry_proto_metrics_v1_metrics_proto = out.File + file_opentelemetry_proto_metrics_v1_metrics_proto_rawDesc = nil + file_opentelemetry_proto_metrics_v1_metrics_proto_goTypes = nil + file_opentelemetry_proto_metrics_v1_metrics_proto_depIdxs = nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go new file mode 100644 index 000000000000..ac347acb2335 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go @@ -0,0 +1,194 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.13.0 +// source: opentelemetry/proto/resource/v1/resource.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + v1 "go.opentelemetry.io/proto/otlp/common/v1" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// Resource information. +type Resource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Set of labels that describe the resource. + Attributes []*v1.KeyValue `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty"` + // dropped_attributes_count is the number of dropped attributes. If the value is 0, then + // no attributes were dropped. + DroppedAttributesCount uint32 `protobuf:"varint,2,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` +} + +func (x *Resource) Reset() { + *x = Resource{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_resource_v1_resource_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Resource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Resource) ProtoMessage() {} + +func (x *Resource) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_resource_v1_resource_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 Resource.ProtoReflect.Descriptor instead. +func (*Resource) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_resource_v1_resource_proto_rawDescGZIP(), []int{0} +} + +func (x *Resource) GetAttributes() []*v1.KeyValue { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Resource) GetDroppedAttributesCount() uint32 { + if x != nil { + return x.DroppedAttributesCount + } + return 0 +} + +var File_opentelemetry_proto_resource_v1_resource_proto protoreflect.FileDescriptor + +var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x1f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x2a, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, + 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, + 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x0a, + 0x22, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_opentelemetry_proto_resource_v1_resource_proto_rawDescOnce sync.Once + file_opentelemetry_proto_resource_v1_resource_proto_rawDescData = file_opentelemetry_proto_resource_v1_resource_proto_rawDesc +) + +func file_opentelemetry_proto_resource_v1_resource_proto_rawDescGZIP() []byte { + file_opentelemetry_proto_resource_v1_resource_proto_rawDescOnce.Do(func() { + file_opentelemetry_proto_resource_v1_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_resource_v1_resource_proto_rawDescData) + }) + return file_opentelemetry_proto_resource_v1_resource_proto_rawDescData +} + +var file_opentelemetry_proto_resource_v1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_opentelemetry_proto_resource_v1_resource_proto_goTypes = []interface{}{ + (*Resource)(nil), // 0: opentelemetry.proto.resource.v1.Resource + (*v1.KeyValue)(nil), // 1: opentelemetry.proto.common.v1.KeyValue +} +var file_opentelemetry_proto_resource_v1_resource_proto_depIdxs = []int32{ + 1, // 0: opentelemetry.proto.resource.v1.Resource.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_opentelemetry_proto_resource_v1_resource_proto_init() } +func file_opentelemetry_proto_resource_v1_resource_proto_init() { + if File_opentelemetry_proto_resource_v1_resource_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_opentelemetry_proto_resource_v1_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Resource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_opentelemetry_proto_resource_v1_resource_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_opentelemetry_proto_resource_v1_resource_proto_goTypes, + DependencyIndexes: file_opentelemetry_proto_resource_v1_resource_proto_depIdxs, + MessageInfos: file_opentelemetry_proto_resource_v1_resource_proto_msgTypes, + }.Build() + File_opentelemetry_proto_resource_v1_resource_proto = out.File + file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = nil + file_opentelemetry_proto_resource_v1_resource_proto_goTypes = nil + file_opentelemetry_proto_resource_v1_resource_proto_depIdxs = nil +} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go new file mode 100644 index 000000000000..f37084af8842 --- /dev/null +++ b/cluster-autoscaler/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go @@ -0,0 +1,1206 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.13.0 +// source: opentelemetry/proto/trace/v1/trace.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + v11 "go.opentelemetry.io/proto/otlp/common/v1" + v1 "go.opentelemetry.io/proto/otlp/resource/v1" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// SpanKind is the type of span. Can be used to specify additional relationships between spans +// in addition to a parent/child relationship. +type Span_SpanKind int32 + +const ( + // Unspecified. Do NOT use as default. + // Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED. + Span_SPAN_KIND_UNSPECIFIED Span_SpanKind = 0 + // Indicates that the span represents an internal operation within an application, + // as opposed to an operations happening at the boundaries. Default value. + Span_SPAN_KIND_INTERNAL Span_SpanKind = 1 + // Indicates that the span covers server-side handling of an RPC or other + // remote network request. + Span_SPAN_KIND_SERVER Span_SpanKind = 2 + // Indicates that the span describes a request to some remote service. + Span_SPAN_KIND_CLIENT Span_SpanKind = 3 + // Indicates that the span describes a producer sending a message to a broker. + // Unlike CLIENT and SERVER, there is often no direct critical path latency relationship + // between producer and consumer spans. A PRODUCER span ends when the message was accepted + // by the broker while the logical processing of the message might span a much longer time. + Span_SPAN_KIND_PRODUCER Span_SpanKind = 4 + // Indicates that the span describes consumer receiving a message from a broker. + // Like the PRODUCER kind, there is often no direct critical path latency relationship + // between producer and consumer spans. + Span_SPAN_KIND_CONSUMER Span_SpanKind = 5 +) + +// Enum value maps for Span_SpanKind. +var ( + Span_SpanKind_name = map[int32]string{ + 0: "SPAN_KIND_UNSPECIFIED", + 1: "SPAN_KIND_INTERNAL", + 2: "SPAN_KIND_SERVER", + 3: "SPAN_KIND_CLIENT", + 4: "SPAN_KIND_PRODUCER", + 5: "SPAN_KIND_CONSUMER", + } + Span_SpanKind_value = map[string]int32{ + "SPAN_KIND_UNSPECIFIED": 0, + "SPAN_KIND_INTERNAL": 1, + "SPAN_KIND_SERVER": 2, + "SPAN_KIND_CLIENT": 3, + "SPAN_KIND_PRODUCER": 4, + "SPAN_KIND_CONSUMER": 5, + } +) + +func (x Span_SpanKind) Enum() *Span_SpanKind { + p := new(Span_SpanKind) + *p = x + return p +} + +func (x Span_SpanKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Span_SpanKind) Descriptor() protoreflect.EnumDescriptor { + return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0].Descriptor() +} + +func (Span_SpanKind) Type() protoreflect.EnumType { + return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0] +} + +func (x Span_SpanKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Span_SpanKind.Descriptor instead. +func (Span_SpanKind) EnumDescriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{2, 0} +} + +type Status_DeprecatedStatusCode int32 + +const ( + Status_DEPRECATED_STATUS_CODE_OK Status_DeprecatedStatusCode = 0 + Status_DEPRECATED_STATUS_CODE_CANCELLED Status_DeprecatedStatusCode = 1 + Status_DEPRECATED_STATUS_CODE_UNKNOWN_ERROR Status_DeprecatedStatusCode = 2 + Status_DEPRECATED_STATUS_CODE_INVALID_ARGUMENT Status_DeprecatedStatusCode = 3 + Status_DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED Status_DeprecatedStatusCode = 4 + Status_DEPRECATED_STATUS_CODE_NOT_FOUND Status_DeprecatedStatusCode = 5 + Status_DEPRECATED_STATUS_CODE_ALREADY_EXISTS Status_DeprecatedStatusCode = 6 + Status_DEPRECATED_STATUS_CODE_PERMISSION_DENIED Status_DeprecatedStatusCode = 7 + Status_DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED Status_DeprecatedStatusCode = 8 + Status_DEPRECATED_STATUS_CODE_FAILED_PRECONDITION Status_DeprecatedStatusCode = 9 + Status_DEPRECATED_STATUS_CODE_ABORTED Status_DeprecatedStatusCode = 10 + Status_DEPRECATED_STATUS_CODE_OUT_OF_RANGE Status_DeprecatedStatusCode = 11 + Status_DEPRECATED_STATUS_CODE_UNIMPLEMENTED Status_DeprecatedStatusCode = 12 + Status_DEPRECATED_STATUS_CODE_INTERNAL_ERROR Status_DeprecatedStatusCode = 13 + Status_DEPRECATED_STATUS_CODE_UNAVAILABLE Status_DeprecatedStatusCode = 14 + Status_DEPRECATED_STATUS_CODE_DATA_LOSS Status_DeprecatedStatusCode = 15 + Status_DEPRECATED_STATUS_CODE_UNAUTHENTICATED Status_DeprecatedStatusCode = 16 +) + +// Enum value maps for Status_DeprecatedStatusCode. +var ( + Status_DeprecatedStatusCode_name = map[int32]string{ + 0: "DEPRECATED_STATUS_CODE_OK", + 1: "DEPRECATED_STATUS_CODE_CANCELLED", + 2: "DEPRECATED_STATUS_CODE_UNKNOWN_ERROR", + 3: "DEPRECATED_STATUS_CODE_INVALID_ARGUMENT", + 4: "DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED", + 5: "DEPRECATED_STATUS_CODE_NOT_FOUND", + 6: "DEPRECATED_STATUS_CODE_ALREADY_EXISTS", + 7: "DEPRECATED_STATUS_CODE_PERMISSION_DENIED", + 8: "DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED", + 9: "DEPRECATED_STATUS_CODE_FAILED_PRECONDITION", + 10: "DEPRECATED_STATUS_CODE_ABORTED", + 11: "DEPRECATED_STATUS_CODE_OUT_OF_RANGE", + 12: "DEPRECATED_STATUS_CODE_UNIMPLEMENTED", + 13: "DEPRECATED_STATUS_CODE_INTERNAL_ERROR", + 14: "DEPRECATED_STATUS_CODE_UNAVAILABLE", + 15: "DEPRECATED_STATUS_CODE_DATA_LOSS", + 16: "DEPRECATED_STATUS_CODE_UNAUTHENTICATED", + } + Status_DeprecatedStatusCode_value = map[string]int32{ + "DEPRECATED_STATUS_CODE_OK": 0, + "DEPRECATED_STATUS_CODE_CANCELLED": 1, + "DEPRECATED_STATUS_CODE_UNKNOWN_ERROR": 2, + "DEPRECATED_STATUS_CODE_INVALID_ARGUMENT": 3, + "DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED": 4, + "DEPRECATED_STATUS_CODE_NOT_FOUND": 5, + "DEPRECATED_STATUS_CODE_ALREADY_EXISTS": 6, + "DEPRECATED_STATUS_CODE_PERMISSION_DENIED": 7, + "DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED": 8, + "DEPRECATED_STATUS_CODE_FAILED_PRECONDITION": 9, + "DEPRECATED_STATUS_CODE_ABORTED": 10, + "DEPRECATED_STATUS_CODE_OUT_OF_RANGE": 11, + "DEPRECATED_STATUS_CODE_UNIMPLEMENTED": 12, + "DEPRECATED_STATUS_CODE_INTERNAL_ERROR": 13, + "DEPRECATED_STATUS_CODE_UNAVAILABLE": 14, + "DEPRECATED_STATUS_CODE_DATA_LOSS": 15, + "DEPRECATED_STATUS_CODE_UNAUTHENTICATED": 16, + } +) + +func (x Status_DeprecatedStatusCode) Enum() *Status_DeprecatedStatusCode { + p := new(Status_DeprecatedStatusCode) + *p = x + return p +} + +func (x Status_DeprecatedStatusCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status_DeprecatedStatusCode) Descriptor() protoreflect.EnumDescriptor { + return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1].Descriptor() +} + +func (Status_DeprecatedStatusCode) Type() protoreflect.EnumType { + return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1] +} + +func (x Status_DeprecatedStatusCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status_DeprecatedStatusCode.Descriptor instead. +func (Status_DeprecatedStatusCode) EnumDescriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{3, 0} +} + +// For the semantics of status codes see +// https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-status +type Status_StatusCode int32 + +const ( + // The default status. + Status_STATUS_CODE_UNSET Status_StatusCode = 0 + // The Span has been validated by an Application developers or Operator to have + // completed successfully. + Status_STATUS_CODE_OK Status_StatusCode = 1 + // The Span contains an error. + Status_STATUS_CODE_ERROR Status_StatusCode = 2 +) + +// Enum value maps for Status_StatusCode. +var ( + Status_StatusCode_name = map[int32]string{ + 0: "STATUS_CODE_UNSET", + 1: "STATUS_CODE_OK", + 2: "STATUS_CODE_ERROR", + } + Status_StatusCode_value = map[string]int32{ + "STATUS_CODE_UNSET": 0, + "STATUS_CODE_OK": 1, + "STATUS_CODE_ERROR": 2, + } +) + +func (x Status_StatusCode) Enum() *Status_StatusCode { + p := new(Status_StatusCode) + *p = x + return p +} + +func (x Status_StatusCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status_StatusCode) Descriptor() protoreflect.EnumDescriptor { + return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[2].Descriptor() +} + +func (Status_StatusCode) Type() protoreflect.EnumType { + return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[2] +} + +func (x Status_StatusCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status_StatusCode.Descriptor instead. +func (Status_StatusCode) EnumDescriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{3, 1} +} + +// A collection of InstrumentationLibrarySpans from a Resource. +type ResourceSpans struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource for the spans in this message. + // If this field is not set then no resource info is known. + Resource *v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + // A list of InstrumentationLibrarySpans that originate from a resource. + InstrumentationLibrarySpans []*InstrumentationLibrarySpans `protobuf:"bytes,2,rep,name=instrumentation_library_spans,json=instrumentationLibrarySpans,proto3" json:"instrumentation_library_spans,omitempty"` +} + +func (x *ResourceSpans) Reset() { + *x = ResourceSpans{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceSpans) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceSpans) ProtoMessage() {} + +func (x *ResourceSpans) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_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 ResourceSpans.ProtoReflect.Descriptor instead. +func (*ResourceSpans) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{0} +} + +func (x *ResourceSpans) GetResource() *v1.Resource { + if x != nil { + return x.Resource + } + return nil +} + +func (x *ResourceSpans) GetInstrumentationLibrarySpans() []*InstrumentationLibrarySpans { + if x != nil { + return x.InstrumentationLibrarySpans + } + return nil +} + +// A collection of Spans produced by an InstrumentationLibrary. +type InstrumentationLibrarySpans struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The instrumentation library information for the spans in this message. + // Semantically when InstrumentationLibrary isn't set, it is equivalent with + // an empty instrumentation library name (unknown). + InstrumentationLibrary *v11.InstrumentationLibrary `protobuf:"bytes,1,opt,name=instrumentation_library,json=instrumentationLibrary,proto3" json:"instrumentation_library,omitempty"` + // A list of Spans that originate from an instrumentation library. + Spans []*Span `protobuf:"bytes,2,rep,name=spans,proto3" json:"spans,omitempty"` +} + +func (x *InstrumentationLibrarySpans) Reset() { + *x = InstrumentationLibrarySpans{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstrumentationLibrarySpans) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstrumentationLibrarySpans) ProtoMessage() {} + +func (x *InstrumentationLibrarySpans) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[1] + 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 InstrumentationLibrarySpans.ProtoReflect.Descriptor instead. +func (*InstrumentationLibrarySpans) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{1} +} + +func (x *InstrumentationLibrarySpans) GetInstrumentationLibrary() *v11.InstrumentationLibrary { + if x != nil { + return x.InstrumentationLibrary + } + return nil +} + +func (x *InstrumentationLibrarySpans) GetSpans() []*Span { + if x != nil { + return x.Spans + } + return nil +} + +// Span represents a single operation within a trace. Spans can be +// nested to form a trace tree. Spans may also be linked to other spans +// from the same or different trace and form graphs. Often, a trace +// contains a root span that describes the end-to-end latency, and one +// or more subspans for its sub-operations. A trace can also contain +// multiple root spans, or none at all. Spans do not need to be +// contiguous - there may be gaps or overlaps between spans in a trace. +// +// The next available field id is 17. +type Span struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A unique identifier for a trace. All spans from the same trace share + // the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes + // is considered invalid. + // + // This field is semantically required. Receiver should generate new + // random trace_id if empty or invalid trace_id was received. + // + // This field is required. + TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` + // A unique identifier for a span within a trace, assigned when the span + // is created. The ID is an 8-byte array. An ID with all zeroes is considered + // invalid. + // + // This field is semantically required. Receiver should generate new + // random span_id if empty or invalid span_id was received. + // + // This field is required. + SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + // trace_state conveys information about request position in multiple distributed tracing graphs. + // It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header + // See also https://github.com/w3c/distributed-tracing for more details about this field. + TraceState string `protobuf:"bytes,3,opt,name=trace_state,json=traceState,proto3" json:"trace_state,omitempty"` + // The `span_id` of this span's parent span. If this is a root span, then this + // field must be empty. The ID is an 8-byte array. + ParentSpanId []byte `protobuf:"bytes,4,opt,name=parent_span_id,json=parentSpanId,proto3" json:"parent_span_id,omitempty"` + // A description of the span's operation. + // + // For example, the name can be a qualified method name or a file name + // and a line number where the operation is called. A best practice is to use + // the same display name at the same call point in an application. + // This makes it easier to correlate spans in different traces. + // + // This field is semantically required to be set to non-empty string. + // When null or empty string received - receiver may use string "name" + // as a replacement. There might be smarted algorithms implemented by + // receiver to fix the empty span name. + // + // This field is required. + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + // Distinguishes between spans generated in a particular context. For example, + // two spans with the same name may be distinguished using `CLIENT` (caller) + // and `SERVER` (callee) to identify queueing latency associated with the span. + Kind Span_SpanKind `protobuf:"varint,6,opt,name=kind,proto3,enum=opentelemetry.proto.trace.v1.Span_SpanKind" json:"kind,omitempty"` + // start_time_unix_nano is the start time of the span. On the client side, this is the time + // kept by the local machine where the span execution starts. On the server side, this + // is the time when the server's application handler starts running. + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // + // This field is semantically required and it is expected that end_time >= start_time. + StartTimeUnixNano uint64 `protobuf:"fixed64,7,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` + // end_time_unix_nano is the end time of the span. On the client side, this is the time + // kept by the local machine where the span execution ends. On the server side, this + // is the time when the server application handler stops running. + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // + // This field is semantically required and it is expected that end_time >= start_time. + EndTimeUnixNano uint64 `protobuf:"fixed64,8,opt,name=end_time_unix_nano,json=endTimeUnixNano,proto3" json:"end_time_unix_nano,omitempty"` + // attributes is a collection of key/value pairs. The value can be a string, + // an integer, a double or the Boolean values `true` or `false`. Note, global attributes + // like server name can be set using the resource API. Examples of attributes: + // + // "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" + // "/http/server_latency": 300 + // "abc.com/myattribute": true + // "abc.com/score": 10.239 + Attributes []*v11.KeyValue `protobuf:"bytes,9,rep,name=attributes,proto3" json:"attributes,omitempty"` + // dropped_attributes_count is the number of attributes that were discarded. Attributes + // can be discarded because their keys are too long or because there are too many + // attributes. If this value is 0, then no attributes were dropped. + DroppedAttributesCount uint32 `protobuf:"varint,10,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` + // events is a collection of Event items. + Events []*Span_Event `protobuf:"bytes,11,rep,name=events,proto3" json:"events,omitempty"` + // dropped_events_count is the number of dropped events. If the value is 0, then no + // events were dropped. + DroppedEventsCount uint32 `protobuf:"varint,12,opt,name=dropped_events_count,json=droppedEventsCount,proto3" json:"dropped_events_count,omitempty"` + // links is a collection of Links, which are references from this span to a span + // in the same or different trace. + Links []*Span_Link `protobuf:"bytes,13,rep,name=links,proto3" json:"links,omitempty"` + // dropped_links_count is the number of dropped links after the maximum size was + // enforced. If this value is 0, then no links were dropped. + DroppedLinksCount uint32 `protobuf:"varint,14,opt,name=dropped_links_count,json=droppedLinksCount,proto3" json:"dropped_links_count,omitempty"` + // An optional final status for this span. Semantically when Status isn't set, it means + // span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). + Status *Status `protobuf:"bytes,15,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *Span) Reset() { + *x = Span{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Span) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Span) ProtoMessage() {} + +func (x *Span) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[2] + 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 Span.ProtoReflect.Descriptor instead. +func (*Span) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{2} +} + +func (x *Span) GetTraceId() []byte { + if x != nil { + return x.TraceId + } + return nil +} + +func (x *Span) GetSpanId() []byte { + if x != nil { + return x.SpanId + } + return nil +} + +func (x *Span) GetTraceState() string { + if x != nil { + return x.TraceState + } + return "" +} + +func (x *Span) GetParentSpanId() []byte { + if x != nil { + return x.ParentSpanId + } + return nil +} + +func (x *Span) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Span) GetKind() Span_SpanKind { + if x != nil { + return x.Kind + } + return Span_SPAN_KIND_UNSPECIFIED +} + +func (x *Span) GetStartTimeUnixNano() uint64 { + if x != nil { + return x.StartTimeUnixNano + } + return 0 +} + +func (x *Span) GetEndTimeUnixNano() uint64 { + if x != nil { + return x.EndTimeUnixNano + } + return 0 +} + +func (x *Span) GetAttributes() []*v11.KeyValue { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Span) GetDroppedAttributesCount() uint32 { + if x != nil { + return x.DroppedAttributesCount + } + return 0 +} + +func (x *Span) GetEvents() []*Span_Event { + if x != nil { + return x.Events + } + return nil +} + +func (x *Span) GetDroppedEventsCount() uint32 { + if x != nil { + return x.DroppedEventsCount + } + return 0 +} + +func (x *Span) GetLinks() []*Span_Link { + if x != nil { + return x.Links + } + return nil +} + +func (x *Span) GetDroppedLinksCount() uint32 { + if x != nil { + return x.DroppedLinksCount + } + return 0 +} + +func (x *Span) GetStatus() *Status { + if x != nil { + return x.Status + } + return nil +} + +// The Status type defines a logical error model that is suitable for different +// programming environments, including REST APIs and RPC APIs. +type Status struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The deprecated status code. This is an optional field. + // + // This field is deprecated and is replaced by the `code` field below. See backward + // compatibility notes below. According to our stability guarantees this field + // will be removed in 12 months, on Oct 22, 2021. All usage of old senders and + // receivers that do not understand the `code` field MUST be phased out by then. + // + // Deprecated: Do not use. + DeprecatedCode Status_DeprecatedStatusCode `protobuf:"varint,1,opt,name=deprecated_code,json=deprecatedCode,proto3,enum=opentelemetry.proto.trace.v1.Status_DeprecatedStatusCode" json:"deprecated_code,omitempty"` + // A developer-facing human readable error message. + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + // The status code. + Code Status_StatusCode `protobuf:"varint,3,opt,name=code,proto3,enum=opentelemetry.proto.trace.v1.Status_StatusCode" json:"code,omitempty"` +} + +func (x *Status) Reset() { + *x = Status{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[3] + 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 Status.ProtoReflect.Descriptor instead. +func (*Status) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{3} +} + +// Deprecated: Do not use. +func (x *Status) GetDeprecatedCode() Status_DeprecatedStatusCode { + if x != nil { + return x.DeprecatedCode + } + return Status_DEPRECATED_STATUS_CODE_OK +} + +func (x *Status) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *Status) GetCode() Status_StatusCode { + if x != nil { + return x.Code + } + return Status_STATUS_CODE_UNSET +} + +// Event is a time-stamped annotation of the span, consisting of user-supplied +// text description and key-value pairs. +type Span_Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // time_unix_nano is the time the event occurred. + TimeUnixNano uint64 `protobuf:"fixed64,1,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // name of the event. + // This field is semantically required to be set to non-empty string. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // attributes is a collection of attribute key/value pairs on the event. + Attributes []*v11.KeyValue `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty"` + // dropped_attributes_count is the number of dropped attributes. If the value is 0, + // then no attributes were dropped. + DroppedAttributesCount uint32 `protobuf:"varint,4,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` +} + +func (x *Span_Event) Reset() { + *x = Span_Event{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Span_Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Span_Event) ProtoMessage() {} + +func (x *Span_Event) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[4] + 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 Span_Event.ProtoReflect.Descriptor instead. +func (*Span_Event) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *Span_Event) GetTimeUnixNano() uint64 { + if x != nil { + return x.TimeUnixNano + } + return 0 +} + +func (x *Span_Event) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Span_Event) GetAttributes() []*v11.KeyValue { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Span_Event) GetDroppedAttributesCount() uint32 { + if x != nil { + return x.DroppedAttributesCount + } + return 0 +} + +// A pointer from the current span to another span in the same trace or in a +// different trace. For example, this can be used in batching operations, +// where a single batch handler processes multiple requests from different +// traces or when the handler receives a request from a different project. +type Span_Link struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A unique identifier of a trace that this linked span is part of. The ID is a + // 16-byte array. + TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` + // A unique identifier for the linked span. The ID is an 8-byte array. + SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + // The trace_state associated with the link. + TraceState string `protobuf:"bytes,3,opt,name=trace_state,json=traceState,proto3" json:"trace_state,omitempty"` + // attributes is a collection of attribute key/value pairs on the link. + Attributes []*v11.KeyValue `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty"` + // dropped_attributes_count is the number of dropped attributes. If the value is 0, + // then no attributes were dropped. + DroppedAttributesCount uint32 `protobuf:"varint,5,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` +} + +func (x *Span_Link) Reset() { + *x = Span_Link{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Span_Link) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Span_Link) ProtoMessage() {} + +func (x *Span_Link) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[5] + 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 Span_Link.ProtoReflect.Descriptor instead. +func (*Span_Link) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *Span_Link) GetTraceId() []byte { + if x != nil { + return x.TraceId + } + return nil +} + +func (x *Span_Link) GetSpanId() []byte { + if x != nil { + return x.SpanId + } + return nil +} + +func (x *Span_Link) GetTraceState() string { + if x != nil { + return x.TraceState + } + return "" +} + +func (x *Span_Link) GetAttributes() []*v11.KeyValue { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Span_Link) GetDroppedAttributesCount() uint32 { + if x != nil { + return x.DroppedAttributesCount + } + return 0 +} + +var File_opentelemetry_proto_trace_v1_trace_proto protoreflect.FileDescriptor + +var file_opentelemetry_proto_trace_v1_trace_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x2a, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x12, 0x45, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x7d, 0x0a, + 0x1d, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x52, + 0x1b, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x22, 0xc7, 0x01, 0x0a, + 0x1b, 0x49, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x12, 0x6e, 0x0a, 0x17, + 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, + 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x52, 0x16, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x38, 0x0a, 0x05, + 0x73, 0x70, 0x61, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x52, + 0x05, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x22, 0x9c, 0x0a, 0x0a, 0x04, 0x53, 0x70, 0x61, 0x6e, 0x12, + 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, + 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61, + 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, + 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, + 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, + 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, + 0x2f, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, + 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x06, 0x52, 0x11, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, + 0x12, 0x2b, 0x0a, 0x12, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, + 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0f, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x47, 0x0a, + 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, + 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x40, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x12, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x0d, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x6c, 0x69, + 0x6e, 0x6b, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x6c, + 0x69, 0x6e, 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x11, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x1a, 0xc4, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x74, + 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, + 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, + 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xde, 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x6e, + 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, + 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, + 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x08, 0x53, 0x70, + 0x61, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, + 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, + 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x50, 0x41, + 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, + 0x14, 0x0a, 0x10, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4c, 0x49, + 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, + 0x4e, 0x44, 0x5f, 0x50, 0x52, 0x4f, 0x44, 0x55, 0x43, 0x45, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, + 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x55, + 0x4d, 0x45, 0x52, 0x10, 0x05, 0x22, 0xfc, 0x07, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x66, 0x0a, 0x0f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x39, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, + 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x43, 0x6f, 0x64, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, + 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xda, 0x05, 0x0a, 0x14, 0x44, 0x65, 0x70, 0x72, + 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x4b, 0x10, 0x00, 0x12, + 0x24, 0x0a, 0x20, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, + 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x28, 0x0a, 0x24, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, + 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, + 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x12, + 0x2b, 0x0a, 0x27, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, + 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x2c, 0x0a, 0x28, + 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x45, 0x41, 0x44, 0x4c, 0x49, 0x4e, 0x45, 0x5f, + 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x04, 0x12, 0x24, 0x0a, 0x20, 0x44, 0x45, + 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x05, + 0x12, 0x29, 0x0a, 0x25, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, + 0x44, 0x59, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x06, 0x12, 0x2c, 0x0a, 0x28, 0x44, + 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, + 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x07, 0x12, 0x2d, 0x0a, 0x29, 0x44, 0x45, 0x50, + 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, + 0x4f, 0x44, 0x45, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x45, 0x58, 0x48, + 0x41, 0x55, 0x53, 0x54, 0x45, 0x44, 0x10, 0x08, 0x12, 0x2e, 0x0a, 0x2a, 0x44, 0x45, 0x50, 0x52, + 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, + 0x44, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x50, 0x52, 0x45, 0x43, 0x4f, 0x4e, + 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, 0x12, 0x22, 0x0a, 0x1e, 0x44, 0x45, 0x50, 0x52, + 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, + 0x44, 0x45, 0x5f, 0x41, 0x42, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x0a, 0x12, 0x27, 0x0a, 0x23, + 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, + 0x4e, 0x47, 0x45, 0x10, 0x0b, 0x12, 0x28, 0x0a, 0x24, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, + 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, + 0x55, 0x4e, 0x49, 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x0c, 0x12, + 0x29, 0x0a, 0x25, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, + 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x0d, 0x12, 0x26, 0x0a, 0x22, 0x44, 0x45, + 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, + 0x10, 0x0e, 0x12, 0x24, 0x0a, 0x20, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x41, 0x54, + 0x41, 0x5f, 0x4c, 0x4f, 0x53, 0x53, 0x10, 0x0f, 0x12, 0x2a, 0x0a, 0x26, 0x44, 0x45, 0x50, 0x52, + 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, + 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x44, 0x10, 0x10, 0x22, 0x4e, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, + 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x45, 0x54, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x15, 0x0a, + 0x11, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x10, 0x02, 0x42, 0x58, 0x0a, 0x1f, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x72, 0x61, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_opentelemetry_proto_trace_v1_trace_proto_rawDescOnce sync.Once + file_opentelemetry_proto_trace_v1_trace_proto_rawDescData = file_opentelemetry_proto_trace_v1_trace_proto_rawDesc +) + +func file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP() []byte { + file_opentelemetry_proto_trace_v1_trace_proto_rawDescOnce.Do(func() { + file_opentelemetry_proto_trace_v1_trace_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_trace_v1_trace_proto_rawDescData) + }) + return file_opentelemetry_proto_trace_v1_trace_proto_rawDescData +} + +var file_opentelemetry_proto_trace_v1_trace_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_opentelemetry_proto_trace_v1_trace_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_opentelemetry_proto_trace_v1_trace_proto_goTypes = []interface{}{ + (Span_SpanKind)(0), // 0: opentelemetry.proto.trace.v1.Span.SpanKind + (Status_DeprecatedStatusCode)(0), // 1: opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode + (Status_StatusCode)(0), // 2: opentelemetry.proto.trace.v1.Status.StatusCode + (*ResourceSpans)(nil), // 3: opentelemetry.proto.trace.v1.ResourceSpans + (*InstrumentationLibrarySpans)(nil), // 4: opentelemetry.proto.trace.v1.InstrumentationLibrarySpans + (*Span)(nil), // 5: opentelemetry.proto.trace.v1.Span + (*Status)(nil), // 6: opentelemetry.proto.trace.v1.Status + (*Span_Event)(nil), // 7: opentelemetry.proto.trace.v1.Span.Event + (*Span_Link)(nil), // 8: opentelemetry.proto.trace.v1.Span.Link + (*v1.Resource)(nil), // 9: opentelemetry.proto.resource.v1.Resource + (*v11.InstrumentationLibrary)(nil), // 10: opentelemetry.proto.common.v1.InstrumentationLibrary + (*v11.KeyValue)(nil), // 11: opentelemetry.proto.common.v1.KeyValue +} +var file_opentelemetry_proto_trace_v1_trace_proto_depIdxs = []int32{ + 9, // 0: opentelemetry.proto.trace.v1.ResourceSpans.resource:type_name -> opentelemetry.proto.resource.v1.Resource + 4, // 1: opentelemetry.proto.trace.v1.ResourceSpans.instrumentation_library_spans:type_name -> opentelemetry.proto.trace.v1.InstrumentationLibrarySpans + 10, // 2: opentelemetry.proto.trace.v1.InstrumentationLibrarySpans.instrumentation_library:type_name -> opentelemetry.proto.common.v1.InstrumentationLibrary + 5, // 3: opentelemetry.proto.trace.v1.InstrumentationLibrarySpans.spans:type_name -> opentelemetry.proto.trace.v1.Span + 0, // 4: opentelemetry.proto.trace.v1.Span.kind:type_name -> opentelemetry.proto.trace.v1.Span.SpanKind + 11, // 5: opentelemetry.proto.trace.v1.Span.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue + 7, // 6: opentelemetry.proto.trace.v1.Span.events:type_name -> opentelemetry.proto.trace.v1.Span.Event + 8, // 7: opentelemetry.proto.trace.v1.Span.links:type_name -> opentelemetry.proto.trace.v1.Span.Link + 6, // 8: opentelemetry.proto.trace.v1.Span.status:type_name -> opentelemetry.proto.trace.v1.Status + 1, // 9: opentelemetry.proto.trace.v1.Status.deprecated_code:type_name -> opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode + 2, // 10: opentelemetry.proto.trace.v1.Status.code:type_name -> opentelemetry.proto.trace.v1.Status.StatusCode + 11, // 11: opentelemetry.proto.trace.v1.Span.Event.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue + 11, // 12: opentelemetry.proto.trace.v1.Span.Link.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_opentelemetry_proto_trace_v1_trace_proto_init() } +func file_opentelemetry_proto_trace_v1_trace_proto_init() { + if File_opentelemetry_proto_trace_v1_trace_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceSpans); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstrumentationLibrarySpans); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Span); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Span_Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_opentelemetry_proto_trace_v1_trace_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Span_Link); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_opentelemetry_proto_trace_v1_trace_proto_rawDesc, + NumEnums: 3, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_opentelemetry_proto_trace_v1_trace_proto_goTypes, + DependencyIndexes: file_opentelemetry_proto_trace_v1_trace_proto_depIdxs, + EnumInfos: file_opentelemetry_proto_trace_v1_trace_proto_enumTypes, + MessageInfos: file_opentelemetry_proto_trace_v1_trace_proto_msgTypes, + }.Build() + File_opentelemetry_proto_trace_v1_trace_proto = out.File + file_opentelemetry_proto_trace_v1_trace_proto_rawDesc = nil + file_opentelemetry_proto_trace_v1_trace_proto_goTypes = nil + file_opentelemetry_proto_trace_v1_trace_proto_depIdxs = nil +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/.codecov.yml b/cluster-autoscaler/vendor/go.uber.org/atomic/.codecov.yml index 6d4d1be7b574..571116cc39c6 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/.codecov.yml +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/.codecov.yml @@ -13,3 +13,7 @@ coverage: if_not_found: success # if parent is not found report status as success, error, or failure if_ci_failed: error # if ci fails report status as success, error, or failure +# Also update COVER_IGNORE_PKGS in the Makefile. +ignore: + - /internal/gen-atomicint/ + - /internal/gen-valuewrapper/ diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/.travis.yml b/cluster-autoscaler/vendor/go.uber.org/atomic/.travis.yml index 4e73268b6029..13d0a4f25404 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/.travis.yml +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/.travis.yml @@ -8,8 +8,8 @@ env: matrix: include: - - go: 1.12.x - - go: 1.13.x + - go: oldstable + - go: stable env: LINT=1 cache: diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/CHANGELOG.md b/cluster-autoscaler/vendor/go.uber.org/atomic/CHANGELOG.md index aef8b6ebc418..24c0274dc321 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/CHANGELOG.md +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.7.0] - 2020-09-14 +### Added +- Support JSON serialization and deserialization of primitive atomic types. +- Support Text marshalling and unmarshalling for string atomics. + +### Changed +- Disallow incorrect comparison of atomic values in a non-atomic way. + +### Removed +- Remove dependency on `golang.org/x/{lint, tools}`. + ## [1.6.0] - 2020-02-24 ### Changed - Drop library dependency on `golang.org/x/{lint, tools}`. @@ -52,6 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release. +[1.7.0]: https://github.com/uber-go/atomic/compare/v1.6.0...v1.7.0 [1.6.0]: https://github.com/uber-go/atomic/compare/v1.5.1...v1.6.0 [1.5.1]: https://github.com/uber-go/atomic/compare/v1.5.0...v1.5.1 [1.5.0]: https://github.com/uber-go/atomic/compare/v1.4.0...v1.5.0 diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/Makefile b/cluster-autoscaler/vendor/go.uber.org/atomic/Makefile index 39af0fb63f2f..1b1376d42533 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/Makefile +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/Makefile @@ -2,8 +2,16 @@ export GOBIN ?= $(shell pwd)/bin GOLINT = $(GOBIN)/golint +GEN_ATOMICINT = $(GOBIN)/gen-atomicint +GEN_ATOMICWRAPPER = $(GOBIN)/gen-atomicwrapper +STATICCHECK = $(GOBIN)/staticcheck -GO_FILES ?= *.go +GO_FILES ?= $(shell find . '(' -path .git -o -path vendor ')' -prune -o -name '*.go' -print) + +# Also update ignore section in .codecov.yml. +COVER_IGNORE_PKGS = \ + go.uber.org/atomic/internal/gen-atomicint \ + go.uber.org/atomic/internal/gen-atomicwrapper .PHONY: build build: @@ -20,16 +28,51 @@ gofmt: @[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" && cat $(FMT_LOG) && false) $(GOLINT): - go install golang.org/x/lint/golint + cd tools && go install golang.org/x/lint/golint + +$(STATICCHECK): + cd tools && go install honnef.co/go/tools/cmd/staticcheck + +$(GEN_ATOMICWRAPPER): $(wildcard ./internal/gen-atomicwrapper/*) + go build -o $@ ./internal/gen-atomicwrapper + +$(GEN_ATOMICINT): $(wildcard ./internal/gen-atomicint/*) + go build -o $@ ./internal/gen-atomicint .PHONY: golint golint: $(GOLINT) $(GOLINT) ./... +.PHONY: staticcheck +staticcheck: $(STATICCHECK) + $(STATICCHECK) ./... + .PHONY: lint -lint: gofmt golint +lint: gofmt golint staticcheck generatenodirty + +# comma separated list of packages to consider for code coverage. +COVER_PKG = $(shell \ + go list -find ./... | \ + grep -v $(foreach pkg,$(COVER_IGNORE_PKGS),-e "^$(pkg)$$") | \ + paste -sd, -) .PHONY: cover cover: - go test -coverprofile=cover.out -coverpkg ./... -v ./... + go test -coverprofile=cover.out -coverpkg $(COVER_PKG) -v ./... go tool cover -html=cover.out -o cover.html + +.PHONY: generate +generate: $(GEN_ATOMICINT) $(GEN_ATOMICWRAPPER) + go generate ./... + +.PHONY: generatenodirty +generatenodirty: + @[ -z "$$(git status --porcelain)" ] || ( \ + echo "Working tree is dirty. Commit your changes first."; \ + exit 1 ) + @make generate + @status=$$(git status --porcelain); \ + [ -z "$$status" ] || ( \ + echo "Working tree is dirty after `make generate`:"; \ + echo "$$status"; \ + echo "Please ensure that the generated code is up-to-date." ) diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/atomic.go b/cluster-autoscaler/vendor/go.uber.org/atomic/atomic.go deleted file mode 100644 index ad5fa0980a7e..000000000000 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/atomic.go +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// Package atomic provides simple wrappers around numerics to enforce atomic -// access. -package atomic - -import ( - "math" - "sync/atomic" - "time" -) - -// Int32 is an atomic wrapper around an int32. -type Int32 struct{ v int32 } - -// NewInt32 creates an Int32. -func NewInt32(i int32) *Int32 { - return &Int32{i} -} - -// Load atomically loads the wrapped value. -func (i *Int32) Load() int32 { - return atomic.LoadInt32(&i.v) -} - -// Add atomically adds to the wrapped int32 and returns the new value. -func (i *Int32) Add(n int32) int32 { - return atomic.AddInt32(&i.v, n) -} - -// Sub atomically subtracts from the wrapped int32 and returns the new value. -func (i *Int32) Sub(n int32) int32 { - return atomic.AddInt32(&i.v, -n) -} - -// Inc atomically increments the wrapped int32 and returns the new value. -func (i *Int32) Inc() int32 { - return i.Add(1) -} - -// Dec atomically decrements the wrapped int32 and returns the new value. -func (i *Int32) Dec() int32 { - return i.Sub(1) -} - -// CAS is an atomic compare-and-swap. -func (i *Int32) CAS(old, new int32) bool { - return atomic.CompareAndSwapInt32(&i.v, old, new) -} - -// Store atomically stores the passed value. -func (i *Int32) Store(n int32) { - atomic.StoreInt32(&i.v, n) -} - -// Swap atomically swaps the wrapped int32 and returns the old value. -func (i *Int32) Swap(n int32) int32 { - return atomic.SwapInt32(&i.v, n) -} - -// Int64 is an atomic wrapper around an int64. -type Int64 struct{ v int64 } - -// NewInt64 creates an Int64. -func NewInt64(i int64) *Int64 { - return &Int64{i} -} - -// Load atomically loads the wrapped value. -func (i *Int64) Load() int64 { - return atomic.LoadInt64(&i.v) -} - -// Add atomically adds to the wrapped int64 and returns the new value. -func (i *Int64) Add(n int64) int64 { - return atomic.AddInt64(&i.v, n) -} - -// Sub atomically subtracts from the wrapped int64 and returns the new value. -func (i *Int64) Sub(n int64) int64 { - return atomic.AddInt64(&i.v, -n) -} - -// Inc atomically increments the wrapped int64 and returns the new value. -func (i *Int64) Inc() int64 { - return i.Add(1) -} - -// Dec atomically decrements the wrapped int64 and returns the new value. -func (i *Int64) Dec() int64 { - return i.Sub(1) -} - -// CAS is an atomic compare-and-swap. -func (i *Int64) CAS(old, new int64) bool { - return atomic.CompareAndSwapInt64(&i.v, old, new) -} - -// Store atomically stores the passed value. -func (i *Int64) Store(n int64) { - atomic.StoreInt64(&i.v, n) -} - -// Swap atomically swaps the wrapped int64 and returns the old value. -func (i *Int64) Swap(n int64) int64 { - return atomic.SwapInt64(&i.v, n) -} - -// Uint32 is an atomic wrapper around an uint32. -type Uint32 struct{ v uint32 } - -// NewUint32 creates a Uint32. -func NewUint32(i uint32) *Uint32 { - return &Uint32{i} -} - -// Load atomically loads the wrapped value. -func (i *Uint32) Load() uint32 { - return atomic.LoadUint32(&i.v) -} - -// Add atomically adds to the wrapped uint32 and returns the new value. -func (i *Uint32) Add(n uint32) uint32 { - return atomic.AddUint32(&i.v, n) -} - -// Sub atomically subtracts from the wrapped uint32 and returns the new value. -func (i *Uint32) Sub(n uint32) uint32 { - return atomic.AddUint32(&i.v, ^(n - 1)) -} - -// Inc atomically increments the wrapped uint32 and returns the new value. -func (i *Uint32) Inc() uint32 { - return i.Add(1) -} - -// Dec atomically decrements the wrapped int32 and returns the new value. -func (i *Uint32) Dec() uint32 { - return i.Sub(1) -} - -// CAS is an atomic compare-and-swap. -func (i *Uint32) CAS(old, new uint32) bool { - return atomic.CompareAndSwapUint32(&i.v, old, new) -} - -// Store atomically stores the passed value. -func (i *Uint32) Store(n uint32) { - atomic.StoreUint32(&i.v, n) -} - -// Swap atomically swaps the wrapped uint32 and returns the old value. -func (i *Uint32) Swap(n uint32) uint32 { - return atomic.SwapUint32(&i.v, n) -} - -// Uint64 is an atomic wrapper around a uint64. -type Uint64 struct{ v uint64 } - -// NewUint64 creates a Uint64. -func NewUint64(i uint64) *Uint64 { - return &Uint64{i} -} - -// Load atomically loads the wrapped value. -func (i *Uint64) Load() uint64 { - return atomic.LoadUint64(&i.v) -} - -// Add atomically adds to the wrapped uint64 and returns the new value. -func (i *Uint64) Add(n uint64) uint64 { - return atomic.AddUint64(&i.v, n) -} - -// Sub atomically subtracts from the wrapped uint64 and returns the new value. -func (i *Uint64) Sub(n uint64) uint64 { - return atomic.AddUint64(&i.v, ^(n - 1)) -} - -// Inc atomically increments the wrapped uint64 and returns the new value. -func (i *Uint64) Inc() uint64 { - return i.Add(1) -} - -// Dec atomically decrements the wrapped uint64 and returns the new value. -func (i *Uint64) Dec() uint64 { - return i.Sub(1) -} - -// CAS is an atomic compare-and-swap. -func (i *Uint64) CAS(old, new uint64) bool { - return atomic.CompareAndSwapUint64(&i.v, old, new) -} - -// Store atomically stores the passed value. -func (i *Uint64) Store(n uint64) { - atomic.StoreUint64(&i.v, n) -} - -// Swap atomically swaps the wrapped uint64 and returns the old value. -func (i *Uint64) Swap(n uint64) uint64 { - return atomic.SwapUint64(&i.v, n) -} - -// Bool is an atomic Boolean. -type Bool struct{ v uint32 } - -// NewBool creates a Bool. -func NewBool(initial bool) *Bool { - return &Bool{boolToInt(initial)} -} - -// Load atomically loads the Boolean. -func (b *Bool) Load() bool { - return truthy(atomic.LoadUint32(&b.v)) -} - -// CAS is an atomic compare-and-swap. -func (b *Bool) CAS(old, new bool) bool { - return atomic.CompareAndSwapUint32(&b.v, boolToInt(old), boolToInt(new)) -} - -// Store atomically stores the passed value. -func (b *Bool) Store(new bool) { - atomic.StoreUint32(&b.v, boolToInt(new)) -} - -// Swap sets the given value and returns the previous value. -func (b *Bool) Swap(new bool) bool { - return truthy(atomic.SwapUint32(&b.v, boolToInt(new))) -} - -// Toggle atomically negates the Boolean and returns the previous value. -func (b *Bool) Toggle() bool { - for { - old := b.Load() - if b.CAS(old, !old) { - return old - } - } -} - -func truthy(n uint32) bool { - return n == 1 -} - -func boolToInt(b bool) uint32 { - if b { - return 1 - } - return 0 -} - -// Float64 is an atomic wrapper around float64. -type Float64 struct { - v uint64 -} - -// NewFloat64 creates a Float64. -func NewFloat64(f float64) *Float64 { - return &Float64{math.Float64bits(f)} -} - -// Load atomically loads the wrapped value. -func (f *Float64) Load() float64 { - return math.Float64frombits(atomic.LoadUint64(&f.v)) -} - -// Store atomically stores the passed value. -func (f *Float64) Store(s float64) { - atomic.StoreUint64(&f.v, math.Float64bits(s)) -} - -// Add atomically adds to the wrapped float64 and returns the new value. -func (f *Float64) Add(s float64) float64 { - for { - old := f.Load() - new := old + s - if f.CAS(old, new) { - return new - } - } -} - -// Sub atomically subtracts from the wrapped float64 and returns the new value. -func (f *Float64) Sub(s float64) float64 { - return f.Add(-s) -} - -// CAS is an atomic compare-and-swap. -func (f *Float64) CAS(old, new float64) bool { - return atomic.CompareAndSwapUint64(&f.v, math.Float64bits(old), math.Float64bits(new)) -} - -// Duration is an atomic wrapper around time.Duration -// https://godoc.org/time#Duration -type Duration struct { - v Int64 -} - -// NewDuration creates a Duration. -func NewDuration(d time.Duration) *Duration { - return &Duration{v: *NewInt64(int64(d))} -} - -// Load atomically loads the wrapped value. -func (d *Duration) Load() time.Duration { - return time.Duration(d.v.Load()) -} - -// Store atomically stores the passed value. -func (d *Duration) Store(n time.Duration) { - d.v.Store(int64(n)) -} - -// Add atomically adds to the wrapped time.Duration and returns the new value. -func (d *Duration) Add(n time.Duration) time.Duration { - return time.Duration(d.v.Add(int64(n))) -} - -// Sub atomically subtracts from the wrapped time.Duration and returns the new value. -func (d *Duration) Sub(n time.Duration) time.Duration { - return time.Duration(d.v.Sub(int64(n))) -} - -// Swap atomically swaps the wrapped time.Duration and returns the old value. -func (d *Duration) Swap(n time.Duration) time.Duration { - return time.Duration(d.v.Swap(int64(n))) -} - -// CAS is an atomic compare-and-swap. -func (d *Duration) CAS(old, new time.Duration) bool { - return d.v.CAS(int64(old), int64(new)) -} - -// Value shadows the type of the same name from sync/atomic -// https://godoc.org/sync/atomic#Value -type Value struct{ atomic.Value } diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/bool.go b/cluster-autoscaler/vendor/go.uber.org/atomic/bool.go new file mode 100644 index 000000000000..9cf1914b1f82 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/bool.go @@ -0,0 +1,81 @@ +// @generated Code generated by gen-atomicwrapper. + +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import ( + "encoding/json" +) + +// Bool is an atomic type-safe wrapper for bool values. +type Bool struct { + _ nocmp // disallow non-atomic comparison + + v Uint32 +} + +var _zeroBool bool + +// NewBool creates a new Bool. +func NewBool(v bool) *Bool { + x := &Bool{} + if v != _zeroBool { + x.Store(v) + } + return x +} + +// Load atomically loads the wrapped bool. +func (x *Bool) Load() bool { + return truthy(x.v.Load()) +} + +// Store atomically stores the passed bool. +func (x *Bool) Store(v bool) { + x.v.Store(boolToInt(v)) +} + +// CAS is an atomic compare-and-swap for bool values. +func (x *Bool) CAS(o, n bool) bool { + return x.v.CAS(boolToInt(o), boolToInt(n)) +} + +// Swap atomically stores the given bool and returns the old +// value. +func (x *Bool) Swap(o bool) bool { + return truthy(x.v.Swap(boolToInt(o))) +} + +// MarshalJSON encodes the wrapped bool into JSON. +func (x *Bool) MarshalJSON() ([]byte, error) { + return json.Marshal(x.Load()) +} + +// UnmarshalJSON decodes a bool from JSON. +func (x *Bool) UnmarshalJSON(b []byte) error { + var v bool + if err := json.Unmarshal(b, &v); err != nil { + return err + } + x.Store(v) + return nil +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/bool_ext.go b/cluster-autoscaler/vendor/go.uber.org/atomic/bool_ext.go new file mode 100644 index 000000000000..c7bf7a827a81 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/bool_ext.go @@ -0,0 +1,53 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import ( + "strconv" +) + +//go:generate bin/gen-atomicwrapper -name=Bool -type=bool -wrapped=Uint32 -pack=boolToInt -unpack=truthy -cas -swap -json -file=bool.go + +func truthy(n uint32) bool { + return n == 1 +} + +func boolToInt(b bool) uint32 { + if b { + return 1 + } + return 0 +} + +// Toggle atomically negates the Boolean and returns the previous value. +func (b *Bool) Toggle() bool { + for { + old := b.Load() + if b.CAS(old, !old) { + return old + } + } +} + +// String encodes the wrapped value as a string. +func (b *Bool) String() string { + return strconv.FormatBool(b.Load()) +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/doc.go b/cluster-autoscaler/vendor/go.uber.org/atomic/doc.go new file mode 100644 index 000000000000..ae7390ee6887 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/doc.go @@ -0,0 +1,23 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// Package atomic provides simple wrappers around numerics to enforce atomic +// access. +package atomic diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/duration.go b/cluster-autoscaler/vendor/go.uber.org/atomic/duration.go new file mode 100644 index 000000000000..027cfcb20bf5 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/duration.go @@ -0,0 +1,82 @@ +// @generated Code generated by gen-atomicwrapper. + +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import ( + "encoding/json" + "time" +) + +// Duration is an atomic type-safe wrapper for time.Duration values. +type Duration struct { + _ nocmp // disallow non-atomic comparison + + v Int64 +} + +var _zeroDuration time.Duration + +// NewDuration creates a new Duration. +func NewDuration(v time.Duration) *Duration { + x := &Duration{} + if v != _zeroDuration { + x.Store(v) + } + return x +} + +// Load atomically loads the wrapped time.Duration. +func (x *Duration) Load() time.Duration { + return time.Duration(x.v.Load()) +} + +// Store atomically stores the passed time.Duration. +func (x *Duration) Store(v time.Duration) { + x.v.Store(int64(v)) +} + +// CAS is an atomic compare-and-swap for time.Duration values. +func (x *Duration) CAS(o, n time.Duration) bool { + return x.v.CAS(int64(o), int64(n)) +} + +// Swap atomically stores the given time.Duration and returns the old +// value. +func (x *Duration) Swap(o time.Duration) time.Duration { + return time.Duration(x.v.Swap(int64(o))) +} + +// MarshalJSON encodes the wrapped time.Duration into JSON. +func (x *Duration) MarshalJSON() ([]byte, error) { + return json.Marshal(x.Load()) +} + +// UnmarshalJSON decodes a time.Duration from JSON. +func (x *Duration) UnmarshalJSON(b []byte) error { + var v time.Duration + if err := json.Unmarshal(b, &v); err != nil { + return err + } + x.Store(v) + return nil +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/duration_ext.go b/cluster-autoscaler/vendor/go.uber.org/atomic/duration_ext.go new file mode 100644 index 000000000000..6273b66bd659 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/duration_ext.go @@ -0,0 +1,40 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import "time" + +//go:generate bin/gen-atomicwrapper -name=Duration -type=time.Duration -wrapped=Int64 -pack=int64 -unpack=time.Duration -cas -swap -json -imports time -file=duration.go + +// Add atomically adds to the wrapped time.Duration and returns the new value. +func (d *Duration) Add(n time.Duration) time.Duration { + return time.Duration(d.v.Add(int64(n))) +} + +// Sub atomically subtracts from the wrapped time.Duration and returns the new value. +func (d *Duration) Sub(n time.Duration) time.Duration { + return time.Duration(d.v.Sub(int64(n))) +} + +// String encodes the wrapped value as a string. +func (d *Duration) String() string { + return d.Load().String() +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/error.go b/cluster-autoscaler/vendor/go.uber.org/atomic/error.go index 0489d19badbd..a6166fbea01e 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/error.go +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/error.go @@ -1,4 +1,6 @@ -// Copyright (c) 2016 Uber Technologies, Inc. +// @generated Code generated by gen-atomicwrapper. + +// Copyright (c) 2020 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,36 +22,30 @@ package atomic -// Error is an atomic type-safe wrapper around Value for errors -type Error struct{ v Value } - -// errorHolder is non-nil holder for error object. -// atomic.Value panics on saving nil object, so err object needs to be -// wrapped with valid object first. -type errorHolder struct{ err error } +// Error is an atomic type-safe wrapper for error values. +type Error struct { + _ nocmp // disallow non-atomic comparison -// NewError creates new atomic error object -func NewError(err error) *Error { - e := &Error{} - if err != nil { - e.Store(err) - } - return e + v Value } -// Load atomically loads the wrapped error -func (e *Error) Load() error { - v := e.v.Load() - if v == nil { - return nil +var _zeroError error + +// NewError creates a new Error. +func NewError(v error) *Error { + x := &Error{} + if v != _zeroError { + x.Store(v) } + return x +} - eh := v.(errorHolder) - return eh.err +// Load atomically loads the wrapped error. +func (x *Error) Load() error { + return unpackError(x.v.Load()) } -// Store atomically stores error. -// NOTE: a holder object is allocated on each Store call. -func (e *Error) Store(err error) { - e.v.Store(errorHolder{err: err}) +// Store atomically stores the passed error. +func (x *Error) Store(v error) { + x.v.Store(packError(v)) } diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/error_ext.go b/cluster-autoscaler/vendor/go.uber.org/atomic/error_ext.go new file mode 100644 index 000000000000..ffe0be21cb01 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/error_ext.go @@ -0,0 +1,39 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +// atomic.Value panics on nil inputs, or if the underlying type changes. +// Stabilize by always storing a custom struct that we control. + +//go:generate bin/gen-atomicwrapper -name=Error -type=error -wrapped=Value -pack=packError -unpack=unpackError -file=error.go + +type packedError struct{ Value error } + +func packError(v error) interface{} { + return packedError{v} +} + +func unpackError(v interface{}) error { + if err, ok := v.(packedError); ok { + return err.Value + } + return nil +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/float64.go b/cluster-autoscaler/vendor/go.uber.org/atomic/float64.go new file mode 100644 index 000000000000..0719060207da --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/float64.go @@ -0,0 +1,76 @@ +// @generated Code generated by gen-atomicwrapper. + +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import ( + "encoding/json" + "math" +) + +// Float64 is an atomic type-safe wrapper for float64 values. +type Float64 struct { + _ nocmp // disallow non-atomic comparison + + v Uint64 +} + +var _zeroFloat64 float64 + +// NewFloat64 creates a new Float64. +func NewFloat64(v float64) *Float64 { + x := &Float64{} + if v != _zeroFloat64 { + x.Store(v) + } + return x +} + +// Load atomically loads the wrapped float64. +func (x *Float64) Load() float64 { + return math.Float64frombits(x.v.Load()) +} + +// Store atomically stores the passed float64. +func (x *Float64) Store(v float64) { + x.v.Store(math.Float64bits(v)) +} + +// CAS is an atomic compare-and-swap for float64 values. +func (x *Float64) CAS(o, n float64) bool { + return x.v.CAS(math.Float64bits(o), math.Float64bits(n)) +} + +// MarshalJSON encodes the wrapped float64 into JSON. +func (x *Float64) MarshalJSON() ([]byte, error) { + return json.Marshal(x.Load()) +} + +// UnmarshalJSON decodes a float64 from JSON. +func (x *Float64) UnmarshalJSON(b []byte) error { + var v float64 + if err := json.Unmarshal(b, &v); err != nil { + return err + } + x.Store(v) + return nil +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/float64_ext.go b/cluster-autoscaler/vendor/go.uber.org/atomic/float64_ext.go new file mode 100644 index 000000000000..927b1add74e5 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/float64_ext.go @@ -0,0 +1,47 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import "strconv" + +//go:generate bin/gen-atomicwrapper -name=Float64 -type=float64 -wrapped=Uint64 -pack=math.Float64bits -unpack=math.Float64frombits -cas -json -imports math -file=float64.go + +// Add atomically adds to the wrapped float64 and returns the new value. +func (f *Float64) Add(s float64) float64 { + for { + old := f.Load() + new := old + s + if f.CAS(old, new) { + return new + } + } +} + +// Sub atomically subtracts from the wrapped float64 and returns the new value. +func (f *Float64) Sub(s float64) float64 { + return f.Add(-s) +} + +// String encodes the wrapped value as a string. +func (f *Float64) String() string { + // 'g' is the behavior for floats with %v. + return strconv.FormatFloat(f.Load(), 'g', -1, 64) +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/gen.go b/cluster-autoscaler/vendor/go.uber.org/atomic/gen.go new file mode 100644 index 000000000000..50d6b248588f --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/gen.go @@ -0,0 +1,26 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +//go:generate bin/gen-atomicint -name=Int32 -wrapped=int32 -file=int32.go +//go:generate bin/gen-atomicint -name=Int64 -wrapped=int64 -file=int64.go +//go:generate bin/gen-atomicint -name=Uint32 -wrapped=uint32 -unsigned -file=uint32.go +//go:generate bin/gen-atomicint -name=Uint64 -wrapped=uint64 -unsigned -file=uint64.go diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/go.mod b/cluster-autoscaler/vendor/go.uber.org/atomic/go.mod index a935daebb9f4..daa7599fe191 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/go.mod +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/go.mod @@ -3,8 +3,6 @@ module go.uber.org/atomic require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/stretchr/testify v1.3.0 - golang.org/x/lint v0.0.0-20190930215403-16217165b5de - golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c // indirect ) go 1.13 diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/go.sum b/cluster-autoscaler/vendor/go.uber.org/atomic/go.sum index 51b2b62afbcf..4f76e62c1f3d 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/go.sum +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/go.sum @@ -7,16 +7,3 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c h1:IGkKhmfzcztjm6gYkykvu/NiS8kaqbCWAEWWAyf8J5U= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/int32.go b/cluster-autoscaler/vendor/go.uber.org/atomic/int32.go new file mode 100644 index 000000000000..18ae56493ee9 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/int32.go @@ -0,0 +1,102 @@ +// @generated Code generated by gen-atomicint. + +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import ( + "encoding/json" + "strconv" + "sync/atomic" +) + +// Int32 is an atomic wrapper around int32. +type Int32 struct { + _ nocmp // disallow non-atomic comparison + + v int32 +} + +// NewInt32 creates a new Int32. +func NewInt32(i int32) *Int32 { + return &Int32{v: i} +} + +// Load atomically loads the wrapped value. +func (i *Int32) Load() int32 { + return atomic.LoadInt32(&i.v) +} + +// Add atomically adds to the wrapped int32 and returns the new value. +func (i *Int32) Add(n int32) int32 { + return atomic.AddInt32(&i.v, n) +} + +// Sub atomically subtracts from the wrapped int32 and returns the new value. +func (i *Int32) Sub(n int32) int32 { + return atomic.AddInt32(&i.v, -n) +} + +// Inc atomically increments the wrapped int32 and returns the new value. +func (i *Int32) Inc() int32 { + return i.Add(1) +} + +// Dec atomically decrements the wrapped int32 and returns the new value. +func (i *Int32) Dec() int32 { + return i.Sub(1) +} + +// CAS is an atomic compare-and-swap. +func (i *Int32) CAS(old, new int32) bool { + return atomic.CompareAndSwapInt32(&i.v, old, new) +} + +// Store atomically stores the passed value. +func (i *Int32) Store(n int32) { + atomic.StoreInt32(&i.v, n) +} + +// Swap atomically swaps the wrapped int32 and returns the old value. +func (i *Int32) Swap(n int32) int32 { + return atomic.SwapInt32(&i.v, n) +} + +// MarshalJSON encodes the wrapped int32 into JSON. +func (i *Int32) MarshalJSON() ([]byte, error) { + return json.Marshal(i.Load()) +} + +// UnmarshalJSON decodes JSON into the wrapped int32. +func (i *Int32) UnmarshalJSON(b []byte) error { + var v int32 + if err := json.Unmarshal(b, &v); err != nil { + return err + } + i.Store(v) + return nil +} + +// String encodes the wrapped value as a string. +func (i *Int32) String() string { + v := i.Load() + return strconv.FormatInt(int64(v), 10) +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/int64.go b/cluster-autoscaler/vendor/go.uber.org/atomic/int64.go new file mode 100644 index 000000000000..2bcbbfaa9532 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/int64.go @@ -0,0 +1,102 @@ +// @generated Code generated by gen-atomicint. + +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import ( + "encoding/json" + "strconv" + "sync/atomic" +) + +// Int64 is an atomic wrapper around int64. +type Int64 struct { + _ nocmp // disallow non-atomic comparison + + v int64 +} + +// NewInt64 creates a new Int64. +func NewInt64(i int64) *Int64 { + return &Int64{v: i} +} + +// Load atomically loads the wrapped value. +func (i *Int64) Load() int64 { + return atomic.LoadInt64(&i.v) +} + +// Add atomically adds to the wrapped int64 and returns the new value. +func (i *Int64) Add(n int64) int64 { + return atomic.AddInt64(&i.v, n) +} + +// Sub atomically subtracts from the wrapped int64 and returns the new value. +func (i *Int64) Sub(n int64) int64 { + return atomic.AddInt64(&i.v, -n) +} + +// Inc atomically increments the wrapped int64 and returns the new value. +func (i *Int64) Inc() int64 { + return i.Add(1) +} + +// Dec atomically decrements the wrapped int64 and returns the new value. +func (i *Int64) Dec() int64 { + return i.Sub(1) +} + +// CAS is an atomic compare-and-swap. +func (i *Int64) CAS(old, new int64) bool { + return atomic.CompareAndSwapInt64(&i.v, old, new) +} + +// Store atomically stores the passed value. +func (i *Int64) Store(n int64) { + atomic.StoreInt64(&i.v, n) +} + +// Swap atomically swaps the wrapped int64 and returns the old value. +func (i *Int64) Swap(n int64) int64 { + return atomic.SwapInt64(&i.v, n) +} + +// MarshalJSON encodes the wrapped int64 into JSON. +func (i *Int64) MarshalJSON() ([]byte, error) { + return json.Marshal(i.Load()) +} + +// UnmarshalJSON decodes JSON into the wrapped int64. +func (i *Int64) UnmarshalJSON(b []byte) error { + var v int64 + if err := json.Unmarshal(b, &v); err != nil { + return err + } + i.Store(v) + return nil +} + +// String encodes the wrapped value as a string. +func (i *Int64) String() string { + v := i.Load() + return strconv.FormatInt(int64(v), 10) +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/nocmp.go b/cluster-autoscaler/vendor/go.uber.org/atomic/nocmp.go new file mode 100644 index 000000000000..a8201cb4a18e --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/nocmp.go @@ -0,0 +1,35 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +// nocmp is an uncomparable struct. Embed this inside another struct to make +// it uncomparable. +// +// type Foo struct { +// nocmp +// // ... +// } +// +// This DOES NOT: +// +// - Disallow shallow copies of structs +// - Disallow comparison of pointers to uncomparable structs +type nocmp [0]func() diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/string.go b/cluster-autoscaler/vendor/go.uber.org/atomic/string.go index ede8136face1..225b7a2be0aa 100644 --- a/cluster-autoscaler/vendor/go.uber.org/atomic/string.go +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/string.go @@ -1,4 +1,6 @@ -// Copyright (c) 2016 Uber Technologies, Inc. +// @generated Code generated by gen-atomicwrapper. + +// Copyright (c) 2020 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,30 +22,33 @@ package atomic -// String is an atomic type-safe wrapper around Value for strings. -type String struct{ v Value } +// String is an atomic type-safe wrapper for string values. +type String struct { + _ nocmp // disallow non-atomic comparison + + v Value +} + +var _zeroString string -// NewString creates a String. -func NewString(str string) *String { - s := &String{} - if str != "" { - s.Store(str) +// NewString creates a new String. +func NewString(v string) *String { + x := &String{} + if v != _zeroString { + x.Store(v) } - return s + return x } // Load atomically loads the wrapped string. -func (s *String) Load() string { - v := s.v.Load() - if v == nil { - return "" +func (x *String) Load() string { + if v := x.v.Load(); v != nil { + return v.(string) } - return v.(string) + return _zeroString } // Store atomically stores the passed string. -// Note: Converting the string to an interface{} to store in the Value -// requires an allocation. -func (s *String) Store(str string) { - s.v.Store(str) +func (x *String) Store(v string) { + x.v.Store(v) } diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/string_ext.go b/cluster-autoscaler/vendor/go.uber.org/atomic/string_ext.go new file mode 100644 index 000000000000..3a9558213d0d --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/string_ext.go @@ -0,0 +1,43 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +//go:generate bin/gen-atomicwrapper -name=String -type=string -wrapped=Value -file=string.go + +// String returns the wrapped value. +func (s *String) String() string { + return s.Load() +} + +// MarshalText encodes the wrapped string into a textual form. +// +// This makes it encodable as JSON, YAML, XML, and more. +func (s *String) MarshalText() ([]byte, error) { + return []byte(s.Load()), nil +} + +// UnmarshalText decodes text and replaces the wrapped string with it. +// +// This makes it decodable from JSON, YAML, XML, and more. +func (s *String) UnmarshalText(b []byte) error { + s.Store(string(b)) + return nil +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/uint32.go b/cluster-autoscaler/vendor/go.uber.org/atomic/uint32.go new file mode 100644 index 000000000000..a973aba1a60b --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/uint32.go @@ -0,0 +1,102 @@ +// @generated Code generated by gen-atomicint. + +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import ( + "encoding/json" + "strconv" + "sync/atomic" +) + +// Uint32 is an atomic wrapper around uint32. +type Uint32 struct { + _ nocmp // disallow non-atomic comparison + + v uint32 +} + +// NewUint32 creates a new Uint32. +func NewUint32(i uint32) *Uint32 { + return &Uint32{v: i} +} + +// Load atomically loads the wrapped value. +func (i *Uint32) Load() uint32 { + return atomic.LoadUint32(&i.v) +} + +// Add atomically adds to the wrapped uint32 and returns the new value. +func (i *Uint32) Add(n uint32) uint32 { + return atomic.AddUint32(&i.v, n) +} + +// Sub atomically subtracts from the wrapped uint32 and returns the new value. +func (i *Uint32) Sub(n uint32) uint32 { + return atomic.AddUint32(&i.v, ^(n - 1)) +} + +// Inc atomically increments the wrapped uint32 and returns the new value. +func (i *Uint32) Inc() uint32 { + return i.Add(1) +} + +// Dec atomically decrements the wrapped uint32 and returns the new value. +func (i *Uint32) Dec() uint32 { + return i.Sub(1) +} + +// CAS is an atomic compare-and-swap. +func (i *Uint32) CAS(old, new uint32) bool { + return atomic.CompareAndSwapUint32(&i.v, old, new) +} + +// Store atomically stores the passed value. +func (i *Uint32) Store(n uint32) { + atomic.StoreUint32(&i.v, n) +} + +// Swap atomically swaps the wrapped uint32 and returns the old value. +func (i *Uint32) Swap(n uint32) uint32 { + return atomic.SwapUint32(&i.v, n) +} + +// MarshalJSON encodes the wrapped uint32 into JSON. +func (i *Uint32) MarshalJSON() ([]byte, error) { + return json.Marshal(i.Load()) +} + +// UnmarshalJSON decodes JSON into the wrapped uint32. +func (i *Uint32) UnmarshalJSON(b []byte) error { + var v uint32 + if err := json.Unmarshal(b, &v); err != nil { + return err + } + i.Store(v) + return nil +} + +// String encodes the wrapped value as a string. +func (i *Uint32) String() string { + v := i.Load() + return strconv.FormatUint(uint64(v), 10) +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/uint64.go b/cluster-autoscaler/vendor/go.uber.org/atomic/uint64.go new file mode 100644 index 000000000000..3b6c71fd5a37 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/uint64.go @@ -0,0 +1,102 @@ +// @generated Code generated by gen-atomicint. + +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import ( + "encoding/json" + "strconv" + "sync/atomic" +) + +// Uint64 is an atomic wrapper around uint64. +type Uint64 struct { + _ nocmp // disallow non-atomic comparison + + v uint64 +} + +// NewUint64 creates a new Uint64. +func NewUint64(i uint64) *Uint64 { + return &Uint64{v: i} +} + +// Load atomically loads the wrapped value. +func (i *Uint64) Load() uint64 { + return atomic.LoadUint64(&i.v) +} + +// Add atomically adds to the wrapped uint64 and returns the new value. +func (i *Uint64) Add(n uint64) uint64 { + return atomic.AddUint64(&i.v, n) +} + +// Sub atomically subtracts from the wrapped uint64 and returns the new value. +func (i *Uint64) Sub(n uint64) uint64 { + return atomic.AddUint64(&i.v, ^(n - 1)) +} + +// Inc atomically increments the wrapped uint64 and returns the new value. +func (i *Uint64) Inc() uint64 { + return i.Add(1) +} + +// Dec atomically decrements the wrapped uint64 and returns the new value. +func (i *Uint64) Dec() uint64 { + return i.Sub(1) +} + +// CAS is an atomic compare-and-swap. +func (i *Uint64) CAS(old, new uint64) bool { + return atomic.CompareAndSwapUint64(&i.v, old, new) +} + +// Store atomically stores the passed value. +func (i *Uint64) Store(n uint64) { + atomic.StoreUint64(&i.v, n) +} + +// Swap atomically swaps the wrapped uint64 and returns the old value. +func (i *Uint64) Swap(n uint64) uint64 { + return atomic.SwapUint64(&i.v, n) +} + +// MarshalJSON encodes the wrapped uint64 into JSON. +func (i *Uint64) MarshalJSON() ([]byte, error) { + return json.Marshal(i.Load()) +} + +// UnmarshalJSON decodes JSON into the wrapped uint64. +func (i *Uint64) UnmarshalJSON(b []byte) error { + var v uint64 + if err := json.Unmarshal(b, &v); err != nil { + return err + } + i.Store(v) + return nil +} + +// String encodes the wrapped value as a string. +func (i *Uint64) String() string { + v := i.Load() + return strconv.FormatUint(uint64(v), 10) +} diff --git a/cluster-autoscaler/vendor/go.uber.org/atomic/value.go b/cluster-autoscaler/vendor/go.uber.org/atomic/value.go new file mode 100644 index 000000000000..671f3a382475 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/atomic/value.go @@ -0,0 +1,31 @@ +// Copyright (c) 2020 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package atomic + +import "sync/atomic" + +// Value shadows the type of the same name from sync/atomic +// https://godoc.org/sync/atomic#Value +type Value struct { + atomic.Value + + _ nocmp // disallow non-atomic comparison +} diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/.travis.yml b/cluster-autoscaler/vendor/go.uber.org/multierr/.travis.yml index 786c917a397e..8636ab42ad14 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/.travis.yml +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/.travis.yml @@ -4,17 +4,11 @@ go_import_path: go.uber.org/multierr env: global: - - GO15VENDOREXPERIMENT=1 - GO111MODULE=on go: - - 1.11.x - - 1.12.x - - 1.13.x - -cache: - directories: - - vendor + - oldstable + - stable before_install: - go version diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/CHANGELOG.md b/cluster-autoscaler/vendor/go.uber.org/multierr/CHANGELOG.md index 3110c5af0b3a..6f1db9ef4a0a 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/CHANGELOG.md +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/CHANGELOG.md @@ -1,6 +1,12 @@ Releases ======== +v1.6.0 (2020-09-14) +=================== + +- Actually drop library dependency on development-time tooling. + + v1.5.0 (2020-02-24) =================== diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/Makefile b/cluster-autoscaler/vendor/go.uber.org/multierr/Makefile index 416018237e32..316004400b89 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/Makefile +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/Makefile @@ -21,12 +21,12 @@ gofmt: .PHONY: golint golint: - @go install golang.org/x/lint/golint + @cd tools && go install golang.org/x/lint/golint @$(GOBIN)/golint ./... .PHONY: staticcheck staticcheck: - @go install honnef.co/go/tools/cmd/staticcheck + @cd tools && go install honnef.co/go/tools/cmd/staticcheck @$(GOBIN)/staticcheck ./... .PHONY: lint @@ -38,5 +38,5 @@ cover: go tool cover -html=cover.out -o cover.html update-license: - @go install go.uber.org/tools/update-license + @cd tools && go install go.uber.org/tools/update-license @$(GOBIN)/update-license $(GO_FILES) diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/error.go b/cluster-autoscaler/vendor/go.uber.org/multierr/error.go index 04eb9618c10b..5c9b67d5379e 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/error.go +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/error.go @@ -54,7 +54,7 @@ // // errors := multierr.Errors(err) // if len(errors) > 0 { -// fmt.Println("The following errors occurred:") +// fmt.Println("The following errors occurred:", errors) // } // // Advanced Usage diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/go.mod b/cluster-autoscaler/vendor/go.uber.org/multierr/go.mod index 58d5f90bbd7f..ff8bdf95fcf9 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/go.mod +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/go.mod @@ -4,9 +4,5 @@ go 1.12 require ( github.com/stretchr/testify v1.3.0 - go.uber.org/atomic v1.6.0 - go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee - golang.org/x/lint v0.0.0-20190930215403-16217165b5de - golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 // indirect - honnef.co/go/tools v0.0.1-2019.2.3 + go.uber.org/atomic v1.7.0 ) diff --git a/cluster-autoscaler/vendor/go.uber.org/multierr/go.sum b/cluster-autoscaler/vendor/go.uber.org/multierr/go.sum index 557fbba28f8a..ecfc28657825 100644 --- a/cluster-autoscaler/vendor/go.uber.org/multierr/go.sum +++ b/cluster-autoscaler/vendor/go.uber.org/multierr/go.sum @@ -1,45 +1,11 @@ -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 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/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c h1:IGkKhmfzcztjm6gYkykvu/NiS8kaqbCWAEWWAyf8J5U= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/.travis.yml b/cluster-autoscaler/vendor/go.uber.org/zap/.travis.yml deleted file mode 100644 index cfdc69f413e7..000000000000 --- a/cluster-autoscaler/vendor/go.uber.org/zap/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: go -sudo: false - -go_import_path: go.uber.org/zap -env: - global: - - TEST_TIMEOUT_SCALE=10 - - GO111MODULE=on - -matrix: - include: - - go: 1.13.x - - go: 1.14.x - env: LINT=1 - -script: - - test -z "$LINT" || make lint - - make test - - make bench - -after_success: - - make cover - - bash <(curl -s https://codecov.io/bash) diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/CHANGELOG.md b/cluster-autoscaler/vendor/go.uber.org/zap/CHANGELOG.md index fa817e6a1036..3b99bf0ac84f 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/CHANGELOG.md +++ b/cluster-autoscaler/vendor/go.uber.org/zap/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 1.17.0 (25 May 2021) + +Bugfixes: +* [#867][]: Encode `` for nil `error` instead of a panic. +* [#931][], [#936][]: Update minimum version constraints to address + vulnerabilities in dependencies. + +Enhancements: +* [#865][]: Improve alignment of fields of the Logger struct, reducing its + size from 96 to 80 bytes. +* [#881][]: Support `grpclog.LoggerV2` in zapgrpc. +* [#903][]: Support URL-encoded POST requests to the AtomicLevel HTTP handler + with the `application/x-www-form-urlencoded` content type. +* [#912][]: Support multi-field encoding with `zap.Inline`. +* [#913][]: Speed up SugaredLogger for calls with a single string. +* [#928][]: Add support for filtering by field name to `zaptest/observer`. + +Thanks to @ash2k, @FMLS, @jimmystewpot, @Oncilla, @tsoslow, @tylitianrui, @withshubh, and @wziww for their contributions to this release. + ## 1.16.0 (1 Sep 2020) Bugfixes: @@ -430,3 +449,12 @@ upgrade to the upcoming stable release. [#854]: https://github.com/uber-go/zap/pull/854 [#861]: https://github.com/uber-go/zap/pull/861 [#862]: https://github.com/uber-go/zap/pull/862 +[#865]: https://github.com/uber-go/zap/pull/865 +[#867]: https://github.com/uber-go/zap/pull/867 +[#881]: https://github.com/uber-go/zap/pull/881 +[#903]: https://github.com/uber-go/zap/pull/903 +[#912]: https://github.com/uber-go/zap/pull/912 +[#913]: https://github.com/uber-go/zap/pull/913 +[#928]: https://github.com/uber-go/zap/pull/928 +[#931]: https://github.com/uber-go/zap/pull/931 +[#936]: https://github.com/uber-go/zap/pull/936 diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/CONTRIBUTING.md b/cluster-autoscaler/vendor/go.uber.org/zap/CONTRIBUTING.md index 9454bbaf026a..5cd965687138 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/CONTRIBUTING.md +++ b/cluster-autoscaler/vendor/go.uber.org/zap/CONTRIBUTING.md @@ -25,12 +25,6 @@ git remote add upstream https://github.com/uber-go/zap.git git fetch upstream ``` -Install zap's dependencies: - -``` -make dependencies -``` - Make sure that the tests and the linters pass: ``` diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/FAQ.md b/cluster-autoscaler/vendor/go.uber.org/zap/FAQ.md index 5ec728875076..b183b20bc139 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/FAQ.md +++ b/cluster-autoscaler/vendor/go.uber.org/zap/FAQ.md @@ -27,6 +27,13 @@ abstraction, and it lets us add methods without introducing breaking changes. Your applications should define and depend upon an interface that includes just the methods you use. +### Why are some of my logs missing? + +Logs are dropped intentionally by zap when sampling is enabled. The production +configuration (as returned by `NewProductionConfig()` enables sampling which will +cause repeated logs within a second to be sampled. See more details on why sampling +is enabled in [Why sample application logs](https://github.com/uber-go/zap/blob/master/FAQ.md#why-sample-application-logs). + ### Why sample application logs? Applications often experience runs of errors, either because of a bug or @@ -150,6 +157,7 @@ We're aware of the following extensions, but haven't used them ourselves: | `github.com/fgrosse/zaptest` | Ginkgo | | `github.com/blendle/zapdriver` | Stackdriver | | `github.com/moul/zapgorm` | Gorm | +| `github.com/moul/zapfilter` | Advanced filtering rules | [go-proverbs]: https://go-proverbs.github.io/ [import-path]: https://golang.org/cmd/go/#hdr-Remote_import_paths diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/Makefile b/cluster-autoscaler/vendor/go.uber.org/zap/Makefile index dfaf6406e974..9b1bc3b0e1d8 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/Makefile +++ b/cluster-autoscaler/vendor/go.uber.org/zap/Makefile @@ -7,7 +7,7 @@ BENCH_FLAGS ?= -cpuprofile=cpu.pprof -memprofile=mem.pprof -benchmem # Directories containing independent Go modules. # # We track coverage only for the main module. -MODULE_DIRS = . ./benchmarks +MODULE_DIRS = . ./benchmarks ./zapgrpc/internal/test # Many Go tools take file globs or directories as arguments instead of packages. GO_FILES := $(shell \ @@ -33,12 +33,18 @@ lint: $(GOLINT) $(STATICCHECK) @echo "Checking for license headers..." @./checklicense.sh | tee -a lint.log @[ ! -s lint.log ] + @echo "Checking 'go mod tidy'..." + @make tidy + @if ! git diff --quiet; then \ + echo "'go mod tidy' resulted in changes or working tree is dirty:"; \ + git --no-pager diff; \ + fi $(GOLINT): - go install golang.org/x/lint/golint + cd tools && go install golang.org/x/lint/golint $(STATICCHECK): - go install honnef.co/go/tools/cmd/staticcheck + cd tools && go install honnef.co/go/tools/cmd/staticcheck .PHONY: test test: @@ -61,3 +67,7 @@ bench: updatereadme: rm -f README.md cat .readme.tmpl | go run internal/readme/readme.go > README.md + +.PHONY: tidy +tidy: + @$(foreach dir,$(MODULE_DIRS),(cd $(dir) && go mod tidy) &&) true diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/README.md b/cluster-autoscaler/vendor/go.uber.org/zap/README.md index bcea28a196f0..1e64d6cffc13 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/README.md +++ b/cluster-autoscaler/vendor/go.uber.org/zap/README.md @@ -123,10 +123,10 @@ Released under the [MIT License](LICENSE.txt). benchmarking against slightly older versions of other packages. Versions are pinned in the [benchmarks/go.mod][] file. [↩](#anchor-versions) -[doc-img]: https://godoc.org/go.uber.org/zap?status.svg -[doc]: https://godoc.org/go.uber.org/zap -[ci-img]: https://travis-ci.com/uber-go/zap.svg?branch=master -[ci]: https://travis-ci.com/uber-go/zap +[doc-img]: https://pkg.go.dev/badge/go.uber.org/zap +[doc]: https://pkg.go.dev/go.uber.org/zap +[ci-img]: https://github.com/uber-go/zap/actions/workflows/go.yml/badge.svg +[ci]: https://github.com/uber-go/zap/actions/workflows/go.yml [cov-img]: https://codecov.io/gh/uber-go/zap/branch/master/graph/badge.svg [cov]: https://codecov.io/gh/uber-go/zap [benchmarking suite]: https://github.com/uber-go/zap/tree/master/benchmarks diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/field.go b/cluster-autoscaler/vendor/go.uber.org/zap/field.go index 3c0d7d957870..bbb745db5bdc 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/field.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/field.go @@ -400,6 +400,16 @@ func Object(key string, val zapcore.ObjectMarshaler) Field { return Field{Key: key, Type: zapcore.ObjectMarshalerType, Interface: val} } +// Inline constructs a Field that is similar to Object, but it +// will add the elements of the provided ObjectMarshaler to the +// current namespace. +func Inline(val zapcore.ObjectMarshaler) Field { + return zapcore.Field{ + Type: zapcore.InlineMarshalerType, + Interface: val, + } +} + // Any takes a key and an arbitrary value and chooses the best way to represent // them as a field, falling back to a reflection-based approach only if // necessary. diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/go.mod b/cluster-autoscaler/vendor/go.uber.org/zap/go.mod index 6ef4db70edd5..6578a354546c 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/go.mod +++ b/cluster-autoscaler/vendor/go.uber.org/zap/go.mod @@ -4,10 +4,9 @@ go 1.13 require ( github.com/pkg/errors v0.8.1 - github.com/stretchr/testify v1.4.0 - go.uber.org/atomic v1.6.0 - go.uber.org/multierr v1.5.0 - golang.org/x/lint v0.0.0-20190930215403-16217165b5de - gopkg.in/yaml.v2 v2.2.2 - honnef.co/go/tools v0.0.1-2019.2.3 + github.com/stretchr/testify v1.7.0 + go.uber.org/atomic v1.7.0 + go.uber.org/multierr v1.6.0 + gopkg.in/yaml.v2 v2.2.8 + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/go.sum b/cluster-autoscaler/vendor/go.uber.org/zap/go.sum index 99cdb93ea0a2..911a87ae1c4f 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/go.sum +++ b/cluster-autoscaler/vendor/go.uber.org/zap/go.sum @@ -1,56 +1,22 @@ -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.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/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c h1:IGkKhmfzcztjm6gYkykvu/NiS8kaqbCWAEWWAyf8J5U= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/http_handler.go b/cluster-autoscaler/vendor/go.uber.org/zap/http_handler.go index 1b0ecaca9c15..1297c33b3285 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/http_handler.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/http_handler.go @@ -23,6 +23,7 @@ package zap import ( "encoding/json" "fmt" + "io" "net/http" "go.uber.org/zap/zapcore" @@ -31,47 +32,63 @@ import ( // ServeHTTP is a simple JSON endpoint that can report on or change the current // logging level. // -// GET requests return a JSON description of the current logging level. PUT -// requests change the logging level and expect a payload like: +// GET +// +// The GET request returns a JSON description of the current logging level like: // {"level":"info"} // -// It's perfectly safe to change the logging level while a program is running. +// PUT +// +// The PUT request changes the logging level. It is perfectly safe to change the +// logging level while a program is running. Two content types are supported: +// +// Content-Type: application/x-www-form-urlencoded +// +// With this content type, the level can be provided through the request body or +// a query parameter. The log level is URL encoded like: +// +// level=debug +// +// The request body takes precedence over the query parameter, if both are +// specified. +// +// This content type is the default for a curl PUT request. Following are two +// example curl requests that both set the logging level to debug. +// +// curl -X PUT localhost:8080/log/level?level=debug +// curl -X PUT localhost:8080/log/level -d level=debug +// +// For any other content type, the payload is expected to be JSON encoded and +// look like: +// +// {"level":"info"} +// +// An example curl request could look like this: +// +// curl -X PUT localhost:8080/log/level -H "Content-Type: application/json" -d '{"level":"debug"}' +// func (lvl AtomicLevel) ServeHTTP(w http.ResponseWriter, r *http.Request) { type errorResponse struct { Error string `json:"error"` } type payload struct { - Level *zapcore.Level `json:"level"` + Level zapcore.Level `json:"level"` } enc := json.NewEncoder(w) switch r.Method { - case http.MethodGet: - current := lvl.Level() - enc.Encode(payload{Level: ¤t}) - + enc.Encode(payload{Level: lvl.Level()}) case http.MethodPut: - var req payload - - if errmess := func() string { - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - return fmt.Sprintf("Request body must be well-formed JSON: %v", err) - } - if req.Level == nil { - return "Must specify a logging level." - } - return "" - }(); errmess != "" { + requestedLvl, err := decodePutRequest(r.Header.Get("Content-Type"), r) + if err != nil { w.WriteHeader(http.StatusBadRequest) - enc.Encode(errorResponse{Error: errmess}) + enc.Encode(errorResponse{Error: err.Error()}) return } - - lvl.SetLevel(*req.Level) - enc.Encode(req) - + lvl.SetLevel(requestedLvl) + enc.Encode(payload{Level: lvl.Level()}) default: w.WriteHeader(http.StatusMethodNotAllowed) enc.Encode(errorResponse{ @@ -79,3 +96,37 @@ func (lvl AtomicLevel) ServeHTTP(w http.ResponseWriter, r *http.Request) { }) } } + +// Decodes incoming PUT requests and returns the requested logging level. +func decodePutRequest(contentType string, r *http.Request) (zapcore.Level, error) { + if contentType == "application/x-www-form-urlencoded" { + return decodePutURL(r) + } + return decodePutJSON(r.Body) +} + +func decodePutURL(r *http.Request) (zapcore.Level, error) { + lvl := r.FormValue("level") + if lvl == "" { + return 0, fmt.Errorf("must specify logging level") + } + var l zapcore.Level + if err := l.UnmarshalText([]byte(lvl)); err != nil { + return 0, err + } + return l, nil +} + +func decodePutJSON(body io.Reader) (zapcore.Level, error) { + var pld struct { + Level *zapcore.Level `json:"level"` + } + if err := json.NewDecoder(body).Decode(&pld); err != nil { + return 0, fmt.Errorf("malformed request body: %v", err) + } + if pld.Level == nil { + return 0, fmt.Errorf("must specify logging level") + } + return *pld.Level, nil + +} diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/logger.go b/cluster-autoscaler/vendor/go.uber.org/zap/logger.go index ea484aed1021..553f258e74a4 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/logger.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/logger.go @@ -42,14 +42,15 @@ type Logger struct { core zapcore.Core development bool + addCaller bool + onFatal zapcore.CheckWriteAction // default is WriteThenFatal + name string errorOutput zapcore.WriteSyncer - addCaller bool - addStack zapcore.LevelEnabler + addStack zapcore.LevelEnabler callerSkip int - onFatal zapcore.CheckWriteAction // default is WriteThenFatal } // New constructs a new Logger from the provided zapcore.Core and Options. If @@ -334,7 +335,7 @@ func getCallerFrame(skip int) (frame runtime.Frame, ok bool) { const skipOffset = 2 // skip getCallerFrame and Callers pc := make([]uintptr, 1) - numFrames := runtime.Callers(skip+skipOffset, pc[:]) + numFrames := runtime.Callers(skip+skipOffset, pc) if numFrames < 1 { return } diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/sugar.go b/cluster-autoscaler/vendor/go.uber.org/zap/sugar.go index 77ca227f47f9..4084dada79c5 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/sugar.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/sugar.go @@ -222,19 +222,30 @@ func (s *SugaredLogger) log(lvl zapcore.Level, template string, fmtArgs []interf return } - // Format with Sprint, Sprintf, or neither. - msg := template - if msg == "" && len(fmtArgs) > 0 { - msg = fmt.Sprint(fmtArgs...) - } else if msg != "" && len(fmtArgs) > 0 { - msg = fmt.Sprintf(template, fmtArgs...) - } - + msg := getMessage(template, fmtArgs) if ce := s.base.Check(lvl, msg); ce != nil { ce.Write(s.sweetenFields(context)...) } } +// getMessage format with Sprint, Sprintf, or neither. +func getMessage(template string, fmtArgs []interface{}) string { + if len(fmtArgs) == 0 { + return template + } + + if template != "" { + return fmt.Sprintf(template, fmtArgs...) + } + + if len(fmtArgs) == 1 { + if str, ok := fmtArgs[0].(string); ok { + return str + } + } + return fmt.Sprint(fmtArgs...) +} + func (s *SugaredLogger) sweetenFields(args []interface{}) []Field { if len(args) == 0 { return nil diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/console_encoder.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/console_encoder.go index 3b68f8c0c51c..2307af404c5e 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/console_encoder.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/console_encoder.go @@ -56,7 +56,7 @@ type consoleEncoder struct { // encoder configuration, it will omit any element whose key is set to the empty // string. func NewConsoleEncoder(cfg EncoderConfig) Encoder { - if len(cfg.ConsoleSeparator) == 0 { + if cfg.ConsoleSeparator == "" { // Use a default delimiter of '\t' for backwards compatibility cfg.ConsoleSeparator = "\t" } diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/error.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/error.go index 9ba2272c3f76..f2a07d786412 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/error.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/error.go @@ -22,6 +22,7 @@ package zapcore import ( "fmt" + "reflect" "sync" ) @@ -42,7 +43,23 @@ import ( // ... // ], // } -func encodeError(key string, err error, enc ObjectEncoder) error { +func encodeError(key string, err error, enc ObjectEncoder) (retErr error) { + // Try to capture panics (from nil references or otherwise) when calling + // the Error() method + defer func() { + if rerr := recover(); rerr != nil { + // If it's a nil pointer, just say "". The likeliest causes are a + // error that fails to guard against nil or a nil pointer for a + // value receiver, and in either case, "" is a nice result. + if v := reflect.ValueOf(err); v.Kind() == reflect.Ptr && v.IsNil() { + enc.AddString(key, "") + return + } + + retErr = fmt.Errorf("PANIC=%v", rerr) + } + }() + basic := err.Error() enc.AddString(key, basic) diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/field.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/field.go index 7e255d63e0dd..95bdb0a126f4 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/field.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/field.go @@ -92,6 +92,10 @@ const ( ErrorType // SkipType indicates that the field is a no-op. SkipType + + // InlineMarshalerType indicates that the field carries an ObjectMarshaler + // that should be inlined. + InlineMarshalerType ) // A Field is a marshaling operation used to add a key-value pair to a logger's @@ -115,6 +119,8 @@ func (f Field) AddTo(enc ObjectEncoder) { err = enc.AddArray(f.Key, f.Interface.(ArrayMarshaler)) case ObjectMarshalerType: err = enc.AddObject(f.Key, f.Interface.(ObjectMarshaler)) + case InlineMarshalerType: + err = f.Interface.(ObjectMarshaler).MarshalLogObject(enc) case BinaryType: enc.AddBinary(f.Key, f.Interface.([]byte)) case BoolType: @@ -167,7 +173,7 @@ func (f Field) AddTo(enc ObjectEncoder) { case StringerType: err = encodeStringer(f.Key, f.Interface, enc) case ErrorType: - encodeError(f.Key, f.Interface.(error), enc) + err = encodeError(f.Key, f.Interface.(error), enc) case SkipType: break default: diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/write_syncer.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/write_syncer.go index 209e25fe2241..d4a1af3d0786 100644 --- a/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/write_syncer.go +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapcore/write_syncer.go @@ -91,8 +91,7 @@ func NewMultiWriteSyncer(ws ...WriteSyncer) WriteSyncer { if len(ws) == 1 { return ws[0] } - // Copy to protect against https://github.com/golang/go/issues/7809 - return multiWriteSyncer(append([]WriteSyncer(nil), ws...)) + return multiWriteSyncer(ws) } // See https://golang.org/src/io/multi.go diff --git a/cluster-autoscaler/vendor/go.uber.org/zap/zapgrpc/zapgrpc.go b/cluster-autoscaler/vendor/go.uber.org/zap/zapgrpc/zapgrpc.go new file mode 100644 index 000000000000..356e12741e09 --- /dev/null +++ b/cluster-autoscaler/vendor/go.uber.org/zap/zapgrpc/zapgrpc.go @@ -0,0 +1,241 @@ +// Copyright (c) 2016 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// Package zapgrpc provides a logger that is compatible with grpclog. +package zapgrpc // import "go.uber.org/zap/zapgrpc" + +import ( + "fmt" + + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +// See https://github.com/grpc/grpc-go/blob/v1.35.0/grpclog/loggerv2.go#L77-L86 +const ( + grpcLvlInfo = 0 + grpcLvlWarn = 1 + grpcLvlError = 2 + grpcLvlFatal = 3 +) + +var ( + // _grpcToZapLevel maps gRPC log levels to zap log levels. + // See https://pkg.go.dev/go.uber.org/zap@v1.16.0/zapcore#Level + _grpcToZapLevel = map[int]zapcore.Level{ + grpcLvlInfo: zapcore.InfoLevel, + grpcLvlWarn: zapcore.WarnLevel, + grpcLvlError: zapcore.ErrorLevel, + grpcLvlFatal: zapcore.FatalLevel, + } +) + +// An Option overrides a Logger's default configuration. +type Option interface { + apply(*Logger) +} + +type optionFunc func(*Logger) + +func (f optionFunc) apply(log *Logger) { + f(log) +} + +// WithDebug configures a Logger to print at zap's DebugLevel instead of +// InfoLevel. +// It only affects the Printf, Println and Print methods, which are only used in the gRPC v1 grpclog.Logger API. +// Deprecated: use grpclog.SetLoggerV2() for v2 API. +func WithDebug() Option { + return optionFunc(func(logger *Logger) { + logger.print = &printer{ + enab: logger.levelEnabler, + level: zapcore.DebugLevel, + print: logger.delegate.Debug, + printf: logger.delegate.Debugf, + } + }) +} + +// withWarn redirects the fatal level to the warn level, which makes testing +// easier. This is intentionally unexported. +func withWarn() Option { + return optionFunc(func(logger *Logger) { + logger.fatal = &printer{ + enab: logger.levelEnabler, + level: zapcore.WarnLevel, + print: logger.delegate.Warn, + printf: logger.delegate.Warnf, + } + }) +} + +// NewLogger returns a new Logger. +func NewLogger(l *zap.Logger, options ...Option) *Logger { + logger := &Logger{ + delegate: l.Sugar(), + levelEnabler: l.Core(), + } + logger.print = &printer{ + enab: logger.levelEnabler, + level: zapcore.InfoLevel, + print: logger.delegate.Info, + printf: logger.delegate.Infof, + } + logger.fatal = &printer{ + enab: logger.levelEnabler, + level: zapcore.FatalLevel, + print: logger.delegate.Fatal, + printf: logger.delegate.Fatalf, + } + for _, option := range options { + option.apply(logger) + } + return logger +} + +// printer implements Print, Printf, and Println operations for a Zap level. +// +// We use it to customize Debug vs Info, and Warn vs Fatal for Print and Fatal +// respectively. +type printer struct { + enab zapcore.LevelEnabler + level zapcore.Level + print func(...interface{}) + printf func(string, ...interface{}) +} + +func (v *printer) Print(args ...interface{}) { + v.print(args...) +} + +func (v *printer) Printf(format string, args ...interface{}) { + v.printf(format, args...) +} + +func (v *printer) Println(args ...interface{}) { + if v.enab.Enabled(v.level) { + v.print(sprintln(args)) + } +} + +// Logger adapts zap's Logger to be compatible with grpclog.LoggerV2 and the deprecated grpclog.Logger. +type Logger struct { + delegate *zap.SugaredLogger + levelEnabler zapcore.LevelEnabler + print *printer + fatal *printer + // printToDebug bool + // fatalToWarn bool +} + +// Print implements grpclog.Logger. +// Deprecated: use Info(). +func (l *Logger) Print(args ...interface{}) { + l.print.Print(args...) +} + +// Printf implements grpclog.Logger. +// Deprecated: use Infof(). +func (l *Logger) Printf(format string, args ...interface{}) { + l.print.Printf(format, args...) +} + +// Println implements grpclog.Logger. +// Deprecated: use Info(). +func (l *Logger) Println(args ...interface{}) { + l.print.Println(args...) +} + +// Info implements grpclog.LoggerV2. +func (l *Logger) Info(args ...interface{}) { + l.delegate.Info(args...) +} + +// Infoln implements grpclog.LoggerV2. +func (l *Logger) Infoln(args ...interface{}) { + if l.levelEnabler.Enabled(zapcore.InfoLevel) { + l.delegate.Info(sprintln(args)) + } +} + +// Infof implements grpclog.LoggerV2. +func (l *Logger) Infof(format string, args ...interface{}) { + l.delegate.Infof(format, args...) +} + +// Warning implements grpclog.LoggerV2. +func (l *Logger) Warning(args ...interface{}) { + l.delegate.Warn(args...) +} + +// Warningln implements grpclog.LoggerV2. +func (l *Logger) Warningln(args ...interface{}) { + if l.levelEnabler.Enabled(zapcore.WarnLevel) { + l.delegate.Warn(sprintln(args)) + } +} + +// Warningf implements grpclog.LoggerV2. +func (l *Logger) Warningf(format string, args ...interface{}) { + l.delegate.Warnf(format, args...) +} + +// Error implements grpclog.LoggerV2. +func (l *Logger) Error(args ...interface{}) { + l.delegate.Error(args...) +} + +// Errorln implements grpclog.LoggerV2. +func (l *Logger) Errorln(args ...interface{}) { + if l.levelEnabler.Enabled(zapcore.ErrorLevel) { + l.delegate.Error(sprintln(args)) + } +} + +// Errorf implements grpclog.LoggerV2. +func (l *Logger) Errorf(format string, args ...interface{}) { + l.delegate.Errorf(format, args...) +} + +// Fatal implements grpclog.LoggerV2. +func (l *Logger) Fatal(args ...interface{}) { + l.fatal.Print(args...) +} + +// Fatalln implements grpclog.LoggerV2. +func (l *Logger) Fatalln(args ...interface{}) { + l.fatal.Println(args...) +} + +// Fatalf implements grpclog.LoggerV2. +func (l *Logger) Fatalf(format string, args ...interface{}) { + l.fatal.Printf(format, args...) +} + +// V implements grpclog.LoggerV2. +func (l *Logger) V(level int) bool { + return l.levelEnabler.Enabled(_grpcToZapLevel[level]) +} + +func sprintln(args []interface{}) string { + s := fmt.Sprintln(args...) + // Drop the new line character added by Sprintln + return s[:len(s)-1] +} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/ed25519.go b/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/ed25519.go deleted file mode 100644 index 71ad917dadd8..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/ed25519.go +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// In Go 1.13, the ed25519 package was promoted to the standard library as -// crypto/ed25519, and this package became a wrapper for the standard library one. -// -//go:build !go1.13 -// +build !go1.13 - -// Package ed25519 implements the Ed25519 signature algorithm. See -// https://ed25519.cr.yp.to/. -// -// These functions are also compatible with the “Ed25519” function defined in -// RFC 8032. However, unlike RFC 8032's formulation, this package's private key -// representation includes a public key suffix to make multiple signing -// operations with the same key more efficient. This package refers to the RFC -// 8032 private key as the “seed”. -package ed25519 - -// This code is a port of the public domain, “ref10” implementation of ed25519 -// from SUPERCOP. - -import ( - "bytes" - "crypto" - cryptorand "crypto/rand" - "crypto/sha512" - "errors" - "io" - "strconv" - - "golang.org/x/crypto/ed25519/internal/edwards25519" -) - -const ( - // PublicKeySize is the size, in bytes, of public keys as used in this package. - PublicKeySize = 32 - // PrivateKeySize is the size, in bytes, of private keys as used in this package. - PrivateKeySize = 64 - // SignatureSize is the size, in bytes, of signatures generated and verified by this package. - SignatureSize = 64 - // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032. - SeedSize = 32 -) - -// PublicKey is the type of Ed25519 public keys. -type PublicKey []byte - -// PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer. -type PrivateKey []byte - -// Public returns the PublicKey corresponding to priv. -func (priv PrivateKey) Public() crypto.PublicKey { - publicKey := make([]byte, PublicKeySize) - copy(publicKey, priv[32:]) - return PublicKey(publicKey) -} - -// Seed returns the private key seed corresponding to priv. It is provided for -// interoperability with RFC 8032. RFC 8032's private keys correspond to seeds -// in this package. -func (priv PrivateKey) Seed() []byte { - seed := make([]byte, SeedSize) - copy(seed, priv[:32]) - return seed -} - -// Sign signs the given message with priv. -// Ed25519 performs two passes over messages to be signed and therefore cannot -// handle pre-hashed messages. Thus opts.HashFunc() must return zero to -// indicate the message hasn't been hashed. This can be achieved by passing -// crypto.Hash(0) as the value for opts. -func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) { - if opts.HashFunc() != crypto.Hash(0) { - return nil, errors.New("ed25519: cannot sign hashed message") - } - - return Sign(priv, message), nil -} - -// GenerateKey generates a public/private key pair using entropy from rand. -// If rand is nil, crypto/rand.Reader will be used. -func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) { - if rand == nil { - rand = cryptorand.Reader - } - - seed := make([]byte, SeedSize) - if _, err := io.ReadFull(rand, seed); err != nil { - return nil, nil, err - } - - privateKey := NewKeyFromSeed(seed) - publicKey := make([]byte, PublicKeySize) - copy(publicKey, privateKey[32:]) - - return publicKey, privateKey, nil -} - -// NewKeyFromSeed calculates a private key from a seed. It will panic if -// len(seed) is not SeedSize. This function is provided for interoperability -// with RFC 8032. RFC 8032's private keys correspond to seeds in this -// package. -func NewKeyFromSeed(seed []byte) PrivateKey { - if l := len(seed); l != SeedSize { - panic("ed25519: bad seed length: " + strconv.Itoa(l)) - } - - digest := sha512.Sum512(seed) - digest[0] &= 248 - digest[31] &= 127 - digest[31] |= 64 - - var A edwards25519.ExtendedGroupElement - var hBytes [32]byte - copy(hBytes[:], digest[:]) - edwards25519.GeScalarMultBase(&A, &hBytes) - var publicKeyBytes [32]byte - A.ToBytes(&publicKeyBytes) - - privateKey := make([]byte, PrivateKeySize) - copy(privateKey, seed) - copy(privateKey[32:], publicKeyBytes[:]) - - return privateKey -} - -// Sign signs the message with privateKey and returns a signature. It will -// panic if len(privateKey) is not PrivateKeySize. -func Sign(privateKey PrivateKey, message []byte) []byte { - if l := len(privateKey); l != PrivateKeySize { - panic("ed25519: bad private key length: " + strconv.Itoa(l)) - } - - h := sha512.New() - h.Write(privateKey[:32]) - - var digest1, messageDigest, hramDigest [64]byte - var expandedSecretKey [32]byte - h.Sum(digest1[:0]) - copy(expandedSecretKey[:], digest1[:]) - expandedSecretKey[0] &= 248 - expandedSecretKey[31] &= 63 - expandedSecretKey[31] |= 64 - - h.Reset() - h.Write(digest1[32:]) - h.Write(message) - h.Sum(messageDigest[:0]) - - var messageDigestReduced [32]byte - edwards25519.ScReduce(&messageDigestReduced, &messageDigest) - var R edwards25519.ExtendedGroupElement - edwards25519.GeScalarMultBase(&R, &messageDigestReduced) - - var encodedR [32]byte - R.ToBytes(&encodedR) - - h.Reset() - h.Write(encodedR[:]) - h.Write(privateKey[32:]) - h.Write(message) - h.Sum(hramDigest[:0]) - var hramDigestReduced [32]byte - edwards25519.ScReduce(&hramDigestReduced, &hramDigest) - - var s [32]byte - edwards25519.ScMulAdd(&s, &hramDigestReduced, &expandedSecretKey, &messageDigestReduced) - - signature := make([]byte, SignatureSize) - copy(signature[:], encodedR[:]) - copy(signature[32:], s[:]) - - return signature -} - -// Verify reports whether sig is a valid signature of message by publicKey. It -// will panic if len(publicKey) is not PublicKeySize. -func Verify(publicKey PublicKey, message, sig []byte) bool { - if l := len(publicKey); l != PublicKeySize { - panic("ed25519: bad public key length: " + strconv.Itoa(l)) - } - - if len(sig) != SignatureSize || sig[63]&224 != 0 { - return false - } - - var A edwards25519.ExtendedGroupElement - var publicKeyBytes [32]byte - copy(publicKeyBytes[:], publicKey) - if !A.FromBytes(&publicKeyBytes) { - return false - } - edwards25519.FeNeg(&A.X, &A.X) - edwards25519.FeNeg(&A.T, &A.T) - - h := sha512.New() - h.Write(sig[:32]) - h.Write(publicKey[:]) - h.Write(message) - var digest [64]byte - h.Sum(digest[:0]) - - var hReduced [32]byte - edwards25519.ScReduce(&hReduced, &digest) - - var R edwards25519.ProjectiveGroupElement - var s [32]byte - copy(s[:], sig[32:]) - - // https://tools.ietf.org/html/rfc8032#section-5.1.7 requires that s be in - // the range [0, order) in order to prevent signature malleability. - if !edwards25519.ScMinimal(&s) { - return false - } - - edwards25519.GeDoubleScalarMultVartime(&R, &hReduced, &A, &s) - - var checkR [32]byte - R.ToBytes(&checkR) - return bytes.Equal(sig[:32], checkR[:]) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go b/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go deleted file mode 100644 index b5974dc8b27b..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/ed25519_go113.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.13 -// +build go1.13 - -// Package ed25519 implements the Ed25519 signature algorithm. See -// https://ed25519.cr.yp.to/. -// -// These functions are also compatible with the “Ed25519” function defined in -// RFC 8032. However, unlike RFC 8032's formulation, this package's private key -// representation includes a public key suffix to make multiple signing -// operations with the same key more efficient. This package refers to the RFC -// 8032 private key as the “seed”. -// -// Beginning with Go 1.13, the functionality of this package was moved to the -// standard library as crypto/ed25519. This package only acts as a compatibility -// wrapper. -package ed25519 - -import ( - "crypto/ed25519" - "io" -) - -const ( - // PublicKeySize is the size, in bytes, of public keys as used in this package. - PublicKeySize = 32 - // PrivateKeySize is the size, in bytes, of private keys as used in this package. - PrivateKeySize = 64 - // SignatureSize is the size, in bytes, of signatures generated and verified by this package. - SignatureSize = 64 - // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032. - SeedSize = 32 -) - -// PublicKey is the type of Ed25519 public keys. -// -// This type is an alias for crypto/ed25519's PublicKey type. -// See the crypto/ed25519 package for the methods on this type. -type PublicKey = ed25519.PublicKey - -// PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer. -// -// This type is an alias for crypto/ed25519's PrivateKey type. -// See the crypto/ed25519 package for the methods on this type. -type PrivateKey = ed25519.PrivateKey - -// GenerateKey generates a public/private key pair using entropy from rand. -// If rand is nil, crypto/rand.Reader will be used. -func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) { - return ed25519.GenerateKey(rand) -} - -// NewKeyFromSeed calculates a private key from a seed. It will panic if -// len(seed) is not SeedSize. This function is provided for interoperability -// with RFC 8032. RFC 8032's private keys correspond to seeds in this -// package. -func NewKeyFromSeed(seed []byte) PrivateKey { - return ed25519.NewKeyFromSeed(seed) -} - -// Sign signs the message with privateKey and returns a signature. It will -// panic if len(privateKey) is not PrivateKeySize. -func Sign(privateKey PrivateKey, message []byte) []byte { - return ed25519.Sign(privateKey, message) -} - -// Verify reports whether sig is a valid signature of message by publicKey. It -// will panic if len(publicKey) is not PublicKeySize. -func Verify(publicKey PublicKey, message, sig []byte) bool { - return ed25519.Verify(publicKey, message, sig) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go b/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go deleted file mode 100644 index e39f086c1d87..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go +++ /dev/null @@ -1,1422 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package edwards25519 - -// These values are from the public domain, “ref10” implementation of ed25519 -// from SUPERCOP. - -// d is a constant in the Edwards curve equation. -var d = FieldElement{ - -10913610, 13857413, -15372611, 6949391, 114729, -8787816, -6275908, -3247719, -18696448, -12055116, -} - -// d2 is 2*d. -var d2 = FieldElement{ - -21827239, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438, 29715968, 9444199, -} - -// SqrtM1 is the square-root of -1 in the field. -var SqrtM1 = FieldElement{ - -32595792, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654, 326686, 11406482, -} - -// A is a constant in the Montgomery-form of curve25519. -var A = FieldElement{ - 486662, 0, 0, 0, 0, 0, 0, 0, 0, 0, -} - -// bi contains precomputed multiples of the base-point. See the Ed25519 paper -// for a discussion about how these values are used. -var bi = [8]PreComputedGroupElement{ - { - FieldElement{25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605}, - FieldElement{-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378}, - FieldElement{-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546}, - }, - { - FieldElement{15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024}, - FieldElement{16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574}, - FieldElement{30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357}, - }, - { - FieldElement{10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380}, - FieldElement{4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306}, - FieldElement{19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942}, - }, - { - FieldElement{5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766}, - FieldElement{-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701}, - FieldElement{28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300}, - }, - { - FieldElement{-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877}, - FieldElement{-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951}, - FieldElement{4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784}, - }, - { - FieldElement{-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436}, - FieldElement{25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918}, - FieldElement{23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877}, - }, - { - FieldElement{-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800}, - FieldElement{-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305}, - FieldElement{-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300}, - }, - { - FieldElement{-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876}, - FieldElement{-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619}, - FieldElement{-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683}, - }, -} - -// base contains precomputed multiples of the base-point. See the Ed25519 paper -// for a discussion about how these values are used. -var base = [32][8]PreComputedGroupElement{ - { - { - FieldElement{25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605}, - FieldElement{-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378}, - FieldElement{-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546}, - }, - { - FieldElement{-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303}, - FieldElement{-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081}, - FieldElement{26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697}, - }, - { - FieldElement{15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024}, - FieldElement{16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574}, - FieldElement{30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357}, - }, - { - FieldElement{-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540}, - FieldElement{23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397}, - FieldElement{7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325}, - }, - { - FieldElement{10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380}, - FieldElement{4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306}, - FieldElement{19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942}, - }, - { - FieldElement{-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777}, - FieldElement{-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737}, - FieldElement{-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652}, - }, - { - FieldElement{5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766}, - FieldElement{-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701}, - FieldElement{28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300}, - }, - { - FieldElement{14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726}, - FieldElement{-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955}, - FieldElement{27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425}, - }, - }, - { - { - FieldElement{-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171}, - FieldElement{27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510}, - FieldElement{17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660}, - }, - { - FieldElement{-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639}, - FieldElement{29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963}, - FieldElement{5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950}, - }, - { - FieldElement{-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568}, - FieldElement{12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335}, - FieldElement{25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628}, - }, - { - FieldElement{-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007}, - FieldElement{-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772}, - FieldElement{-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653}, - }, - { - FieldElement{2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567}, - FieldElement{13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686}, - FieldElement{21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372}, - }, - { - FieldElement{-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887}, - FieldElement{-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954}, - FieldElement{-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953}, - }, - { - FieldElement{24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833}, - FieldElement{-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532}, - FieldElement{-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876}, - }, - { - FieldElement{2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268}, - FieldElement{33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214}, - FieldElement{1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038}, - }, - }, - { - { - FieldElement{6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800}, - FieldElement{4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645}, - FieldElement{-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664}, - }, - { - FieldElement{1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933}, - FieldElement{-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182}, - FieldElement{-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222}, - }, - { - FieldElement{-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991}, - FieldElement{20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880}, - FieldElement{9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092}, - }, - { - FieldElement{-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295}, - FieldElement{19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788}, - FieldElement{8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553}, - }, - { - FieldElement{-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026}, - FieldElement{11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347}, - FieldElement{-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033}, - }, - { - FieldElement{-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395}, - FieldElement{-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278}, - FieldElement{1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890}, - }, - { - FieldElement{32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995}, - FieldElement{-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596}, - FieldElement{-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891}, - }, - { - FieldElement{31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060}, - FieldElement{11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608}, - FieldElement{-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606}, - }, - }, - { - { - FieldElement{7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389}, - FieldElement{-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016}, - FieldElement{-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341}, - }, - { - FieldElement{-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505}, - FieldElement{14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553}, - FieldElement{-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655}, - }, - { - FieldElement{15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220}, - FieldElement{12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631}, - FieldElement{-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099}, - }, - { - FieldElement{26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556}, - FieldElement{14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749}, - FieldElement{236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930}, - }, - { - FieldElement{1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391}, - FieldElement{5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253}, - FieldElement{20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066}, - }, - { - FieldElement{24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958}, - FieldElement{-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082}, - FieldElement{-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383}, - }, - { - FieldElement{-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521}, - FieldElement{-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807}, - FieldElement{23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948}, - }, - { - FieldElement{9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134}, - FieldElement{-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455}, - FieldElement{27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629}, - }, - }, - { - { - FieldElement{-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069}, - FieldElement{-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746}, - FieldElement{24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919}, - }, - { - FieldElement{11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837}, - FieldElement{8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906}, - FieldElement{-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771}, - }, - { - FieldElement{-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817}, - FieldElement{10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098}, - FieldElement{10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409}, - }, - { - FieldElement{-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504}, - FieldElement{-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727}, - FieldElement{28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420}, - }, - { - FieldElement{-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003}, - FieldElement{-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605}, - FieldElement{-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384}, - }, - { - FieldElement{-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701}, - FieldElement{-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683}, - FieldElement{29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708}, - }, - { - FieldElement{-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563}, - FieldElement{-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260}, - FieldElement{-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387}, - }, - { - FieldElement{-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672}, - FieldElement{23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686}, - FieldElement{-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665}, - }, - }, - { - { - FieldElement{11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182}, - FieldElement{-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277}, - FieldElement{14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628}, - }, - { - FieldElement{-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474}, - FieldElement{-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539}, - FieldElement{-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822}, - }, - { - FieldElement{-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970}, - FieldElement{19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756}, - FieldElement{-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508}, - }, - { - FieldElement{-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683}, - FieldElement{-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655}, - FieldElement{-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158}, - }, - { - FieldElement{-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125}, - FieldElement{-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839}, - FieldElement{-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664}, - }, - { - FieldElement{27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294}, - FieldElement{-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899}, - FieldElement{-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070}, - }, - { - FieldElement{3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294}, - FieldElement{-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949}, - FieldElement{-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083}, - }, - { - FieldElement{31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420}, - FieldElement{-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940}, - FieldElement{29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396}, - }, - }, - { - { - FieldElement{-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567}, - FieldElement{20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127}, - FieldElement{-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294}, - }, - { - FieldElement{-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887}, - FieldElement{22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964}, - FieldElement{16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195}, - }, - { - FieldElement{9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244}, - FieldElement{24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999}, - FieldElement{-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762}, - }, - { - FieldElement{-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274}, - FieldElement{-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236}, - FieldElement{-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605}, - }, - { - FieldElement{-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761}, - FieldElement{-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884}, - FieldElement{-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482}, - }, - { - FieldElement{-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638}, - FieldElement{-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490}, - FieldElement{-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170}, - }, - { - FieldElement{5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736}, - FieldElement{10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124}, - FieldElement{-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392}, - }, - { - FieldElement{8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029}, - FieldElement{6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048}, - FieldElement{28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958}, - }, - }, - { - { - FieldElement{24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593}, - FieldElement{26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071}, - FieldElement{-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692}, - }, - { - FieldElement{11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687}, - FieldElement{-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441}, - FieldElement{-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001}, - }, - { - FieldElement{-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460}, - FieldElement{-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007}, - FieldElement{-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762}, - }, - { - FieldElement{15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005}, - FieldElement{-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674}, - FieldElement{4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035}, - }, - { - FieldElement{7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590}, - FieldElement{-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957}, - FieldElement{-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812}, - }, - { - FieldElement{33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740}, - FieldElement{-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122}, - FieldElement{-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158}, - }, - { - FieldElement{8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885}, - FieldElement{26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140}, - FieldElement{19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857}, - }, - { - FieldElement{801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155}, - FieldElement{19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260}, - FieldElement{19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483}, - }, - }, - { - { - FieldElement{-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677}, - FieldElement{32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815}, - FieldElement{22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751}, - }, - { - FieldElement{-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203}, - FieldElement{-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208}, - FieldElement{1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230}, - }, - { - FieldElement{16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850}, - FieldElement{-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389}, - FieldElement{-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968}, - }, - { - FieldElement{-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689}, - FieldElement{14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880}, - FieldElement{5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304}, - }, - { - FieldElement{30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632}, - FieldElement{-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412}, - FieldElement{20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566}, - }, - { - FieldElement{-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038}, - FieldElement{-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232}, - FieldElement{-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943}, - }, - { - FieldElement{17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856}, - FieldElement{23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738}, - FieldElement{15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971}, - }, - { - FieldElement{-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718}, - FieldElement{-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697}, - FieldElement{-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883}, - }, - }, - { - { - FieldElement{5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912}, - FieldElement{-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358}, - FieldElement{3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849}, - }, - { - FieldElement{29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307}, - FieldElement{-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977}, - FieldElement{-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335}, - }, - { - FieldElement{-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644}, - FieldElement{-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616}, - FieldElement{-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735}, - }, - { - FieldElement{-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099}, - FieldElement{29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341}, - FieldElement{-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336}, - }, - { - FieldElement{-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646}, - FieldElement{31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425}, - FieldElement{-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388}, - }, - { - FieldElement{-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743}, - FieldElement{-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822}, - FieldElement{-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462}, - }, - { - FieldElement{18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985}, - FieldElement{9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702}, - FieldElement{-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797}, - }, - { - FieldElement{21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293}, - FieldElement{27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100}, - FieldElement{19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688}, - }, - }, - { - { - FieldElement{12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186}, - FieldElement{2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610}, - FieldElement{-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707}, - }, - { - FieldElement{7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220}, - FieldElement{915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025}, - FieldElement{32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044}, - }, - { - FieldElement{32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992}, - FieldElement{-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027}, - FieldElement{21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197}, - }, - { - FieldElement{8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901}, - FieldElement{31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952}, - FieldElement{19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878}, - }, - { - FieldElement{-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390}, - FieldElement{32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730}, - FieldElement{2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730}, - }, - { - FieldElement{-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180}, - FieldElement{-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272}, - FieldElement{-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715}, - }, - { - FieldElement{-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970}, - FieldElement{-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772}, - FieldElement{-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865}, - }, - { - FieldElement{15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750}, - FieldElement{20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373}, - FieldElement{32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348}, - }, - }, - { - { - FieldElement{9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144}, - FieldElement{-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195}, - FieldElement{5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086}, - }, - { - FieldElement{-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684}, - FieldElement{-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518}, - FieldElement{-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233}, - }, - { - FieldElement{-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793}, - FieldElement{-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794}, - FieldElement{580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435}, - }, - { - FieldElement{23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921}, - FieldElement{13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518}, - FieldElement{2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563}, - }, - { - FieldElement{14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278}, - FieldElement{-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024}, - FieldElement{4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030}, - }, - { - FieldElement{10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783}, - FieldElement{27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717}, - FieldElement{6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844}, - }, - { - FieldElement{14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333}, - FieldElement{16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048}, - FieldElement{22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760}, - }, - { - FieldElement{-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760}, - FieldElement{-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757}, - FieldElement{-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112}, - }, - }, - { - { - FieldElement{-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468}, - FieldElement{3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184}, - FieldElement{10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289}, - }, - { - FieldElement{15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066}, - FieldElement{24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882}, - FieldElement{13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226}, - }, - { - FieldElement{16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101}, - FieldElement{29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279}, - FieldElement{-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811}, - }, - { - FieldElement{27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709}, - FieldElement{20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714}, - FieldElement{-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121}, - }, - { - FieldElement{9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464}, - FieldElement{12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847}, - FieldElement{13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400}, - }, - { - FieldElement{4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414}, - FieldElement{-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158}, - FieldElement{17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045}, - }, - { - FieldElement{-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415}, - FieldElement{-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459}, - FieldElement{-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079}, - }, - { - FieldElement{21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412}, - FieldElement{-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743}, - FieldElement{-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836}, - }, - }, - { - { - FieldElement{12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022}, - FieldElement{18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429}, - FieldElement{-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065}, - }, - { - FieldElement{30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861}, - FieldElement{10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000}, - FieldElement{-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101}, - }, - { - FieldElement{32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815}, - FieldElement{29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642}, - FieldElement{10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966}, - }, - { - FieldElement{25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574}, - FieldElement{-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742}, - FieldElement{-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689}, - }, - { - FieldElement{12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020}, - FieldElement{-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772}, - FieldElement{3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982}, - }, - { - FieldElement{-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953}, - FieldElement{-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218}, - FieldElement{-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265}, - }, - { - FieldElement{29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073}, - FieldElement{-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325}, - FieldElement{-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798}, - }, - { - FieldElement{-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870}, - FieldElement{-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863}, - FieldElement{-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927}, - }, - }, - { - { - FieldElement{-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267}, - FieldElement{-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663}, - FieldElement{22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862}, - }, - { - FieldElement{-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673}, - FieldElement{15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943}, - FieldElement{15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020}, - }, - { - FieldElement{-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238}, - FieldElement{11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064}, - FieldElement{14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795}, - }, - { - FieldElement{15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052}, - FieldElement{-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904}, - FieldElement{29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531}, - }, - { - FieldElement{-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979}, - FieldElement{-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841}, - FieldElement{10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431}, - }, - { - FieldElement{10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324}, - FieldElement{-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940}, - FieldElement{10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320}, - }, - { - FieldElement{-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184}, - FieldElement{14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114}, - FieldElement{30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878}, - }, - { - FieldElement{12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784}, - FieldElement{-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091}, - FieldElement{-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585}, - }, - }, - { - { - FieldElement{-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208}, - FieldElement{10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864}, - FieldElement{17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661}, - }, - { - FieldElement{7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233}, - FieldElement{26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212}, - FieldElement{-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525}, - }, - { - FieldElement{-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068}, - FieldElement{9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397}, - FieldElement{-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988}, - }, - { - FieldElement{5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889}, - FieldElement{32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038}, - FieldElement{14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697}, - }, - { - FieldElement{20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875}, - FieldElement{-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905}, - FieldElement{-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656}, - }, - { - FieldElement{11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818}, - FieldElement{27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714}, - FieldElement{10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203}, - }, - { - FieldElement{20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931}, - FieldElement{-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024}, - FieldElement{-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084}, - }, - { - FieldElement{-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204}, - FieldElement{20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817}, - FieldElement{27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667}, - }, - }, - { - { - FieldElement{11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504}, - FieldElement{-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768}, - FieldElement{-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255}, - }, - { - FieldElement{6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790}, - FieldElement{1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438}, - FieldElement{-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333}, - }, - { - FieldElement{17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971}, - FieldElement{31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905}, - FieldElement{29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409}, - }, - { - FieldElement{12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409}, - FieldElement{6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499}, - FieldElement{-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363}, - }, - { - FieldElement{28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664}, - FieldElement{-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324}, - FieldElement{-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940}, - }, - { - FieldElement{13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990}, - FieldElement{-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914}, - FieldElement{-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290}, - }, - { - FieldElement{24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257}, - FieldElement{-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433}, - FieldElement{-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236}, - }, - { - FieldElement{-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045}, - FieldElement{11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093}, - FieldElement{-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347}, - }, - }, - { - { - FieldElement{-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191}, - FieldElement{-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507}, - FieldElement{-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906}, - }, - { - FieldElement{3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018}, - FieldElement{-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109}, - FieldElement{-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926}, - }, - { - FieldElement{-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528}, - FieldElement{8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625}, - FieldElement{-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286}, - }, - { - FieldElement{2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033}, - FieldElement{27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866}, - FieldElement{21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896}, - }, - { - FieldElement{30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075}, - FieldElement{26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347}, - FieldElement{-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437}, - }, - { - FieldElement{-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165}, - FieldElement{-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588}, - FieldElement{-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193}, - }, - { - FieldElement{-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017}, - FieldElement{-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883}, - FieldElement{21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961}, - }, - { - FieldElement{8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043}, - FieldElement{29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663}, - FieldElement{-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362}, - }, - }, - { - { - FieldElement{-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860}, - FieldElement{2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466}, - FieldElement{-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063}, - }, - { - FieldElement{-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997}, - FieldElement{-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295}, - FieldElement{-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369}, - }, - { - FieldElement{9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385}, - FieldElement{18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109}, - FieldElement{2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906}, - }, - { - FieldElement{4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424}, - FieldElement{-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185}, - FieldElement{7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962}, - }, - { - FieldElement{-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325}, - FieldElement{10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593}, - FieldElement{696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404}, - }, - { - FieldElement{-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644}, - FieldElement{17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801}, - FieldElement{26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804}, - }, - { - FieldElement{-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884}, - FieldElement{-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577}, - FieldElement{-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849}, - }, - { - FieldElement{32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473}, - FieldElement{-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644}, - FieldElement{-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319}, - }, - }, - { - { - FieldElement{-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599}, - FieldElement{-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768}, - FieldElement{-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084}, - }, - { - FieldElement{-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328}, - FieldElement{-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369}, - FieldElement{20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920}, - }, - { - FieldElement{12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815}, - FieldElement{-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025}, - FieldElement{-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397}, - }, - { - FieldElement{-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448}, - FieldElement{6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981}, - FieldElement{30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165}, - }, - { - FieldElement{32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501}, - FieldElement{17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073}, - FieldElement{-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861}, - }, - { - FieldElement{14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845}, - FieldElement{-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211}, - FieldElement{18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870}, - }, - { - FieldElement{10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096}, - FieldElement{33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803}, - FieldElement{-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168}, - }, - { - FieldElement{30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965}, - FieldElement{-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505}, - FieldElement{18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598}, - }, - }, - { - { - FieldElement{5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782}, - FieldElement{5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900}, - FieldElement{-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479}, - }, - { - FieldElement{-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208}, - FieldElement{8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232}, - FieldElement{17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719}, - }, - { - FieldElement{16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271}, - FieldElement{-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326}, - FieldElement{-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132}, - }, - { - FieldElement{14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300}, - FieldElement{8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570}, - FieldElement{15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670}, - }, - { - FieldElement{-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994}, - FieldElement{-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913}, - FieldElement{31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317}, - }, - { - FieldElement{-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730}, - FieldElement{842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096}, - FieldElement{-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078}, - }, - { - FieldElement{-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411}, - FieldElement{-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905}, - FieldElement{-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654}, - }, - { - FieldElement{-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870}, - FieldElement{-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498}, - FieldElement{12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579}, - }, - }, - { - { - FieldElement{14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677}, - FieldElement{10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647}, - FieldElement{-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743}, - }, - { - FieldElement{-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468}, - FieldElement{21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375}, - FieldElement{-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155}, - }, - { - FieldElement{6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725}, - FieldElement{-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612}, - FieldElement{-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943}, - }, - { - FieldElement{-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944}, - FieldElement{30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928}, - FieldElement{9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406}, - }, - { - FieldElement{22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139}, - FieldElement{-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963}, - FieldElement{-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693}, - }, - { - FieldElement{1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734}, - FieldElement{-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680}, - FieldElement{-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410}, - }, - { - FieldElement{-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931}, - FieldElement{-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654}, - FieldElement{22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710}, - }, - { - FieldElement{29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180}, - FieldElement{-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684}, - FieldElement{-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895}, - }, - }, - { - { - FieldElement{22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501}, - FieldElement{-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413}, - FieldElement{6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880}, - }, - { - FieldElement{-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874}, - FieldElement{22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962}, - FieldElement{-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899}, - }, - { - FieldElement{21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152}, - FieldElement{9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063}, - FieldElement{7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080}, - }, - { - FieldElement{-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146}, - FieldElement{-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183}, - FieldElement{-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133}, - }, - { - FieldElement{-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421}, - FieldElement{-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622}, - FieldElement{-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197}, - }, - { - FieldElement{2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663}, - FieldElement{31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753}, - FieldElement{4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755}, - }, - { - FieldElement{-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862}, - FieldElement{-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118}, - FieldElement{26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171}, - }, - { - FieldElement{15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380}, - FieldElement{16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824}, - FieldElement{28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270}, - }, - }, - { - { - FieldElement{-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438}, - FieldElement{-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584}, - FieldElement{-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562}, - }, - { - FieldElement{30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471}, - FieldElement{18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610}, - FieldElement{19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269}, - }, - { - FieldElement{-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650}, - FieldElement{14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369}, - FieldElement{19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461}, - }, - { - FieldElement{30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462}, - FieldElement{-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793}, - FieldElement{-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218}, - }, - { - FieldElement{-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226}, - FieldElement{18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019}, - FieldElement{-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037}, - }, - { - FieldElement{31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171}, - FieldElement{-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132}, - FieldElement{-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841}, - }, - { - FieldElement{21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181}, - FieldElement{-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210}, - FieldElement{-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040}, - }, - { - FieldElement{3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935}, - FieldElement{24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105}, - FieldElement{-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814}, - }, - }, - { - { - FieldElement{793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852}, - FieldElement{5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581}, - FieldElement{-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646}, - }, - { - FieldElement{10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844}, - FieldElement{10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025}, - FieldElement{27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453}, - }, - { - FieldElement{-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068}, - FieldElement{4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192}, - FieldElement{-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921}, - }, - { - FieldElement{-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259}, - FieldElement{-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426}, - FieldElement{-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072}, - }, - { - FieldElement{-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305}, - FieldElement{13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832}, - FieldElement{28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943}, - }, - { - FieldElement{-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011}, - FieldElement{24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447}, - FieldElement{17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494}, - }, - { - FieldElement{-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245}, - FieldElement{-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859}, - FieldElement{28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915}, - }, - { - FieldElement{16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707}, - FieldElement{10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848}, - FieldElement{-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224}, - }, - }, - { - { - FieldElement{-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391}, - FieldElement{15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215}, - FieldElement{-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101}, - }, - { - FieldElement{23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713}, - FieldElement{21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849}, - FieldElement{-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930}, - }, - { - FieldElement{-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940}, - FieldElement{-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031}, - FieldElement{-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404}, - }, - { - FieldElement{-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243}, - FieldElement{-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116}, - FieldElement{-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525}, - }, - { - FieldElement{-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509}, - FieldElement{-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883}, - FieldElement{15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865}, - }, - { - FieldElement{-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660}, - FieldElement{4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273}, - FieldElement{-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138}, - }, - { - FieldElement{-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560}, - FieldElement{-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135}, - FieldElement{2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941}, - }, - { - FieldElement{-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739}, - FieldElement{18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756}, - FieldElement{-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819}, - }, - }, - { - { - FieldElement{-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347}, - FieldElement{-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028}, - FieldElement{21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075}, - }, - { - FieldElement{16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799}, - FieldElement{-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609}, - FieldElement{-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817}, - }, - { - FieldElement{-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989}, - FieldElement{-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523}, - FieldElement{4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278}, - }, - { - FieldElement{31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045}, - FieldElement{19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377}, - FieldElement{24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480}, - }, - { - FieldElement{17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016}, - FieldElement{510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426}, - FieldElement{18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525}, - }, - { - FieldElement{13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396}, - FieldElement{9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080}, - FieldElement{12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892}, - }, - { - FieldElement{15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275}, - FieldElement{11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074}, - FieldElement{20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140}, - }, - { - FieldElement{-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717}, - FieldElement{-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101}, - FieldElement{24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127}, - }, - }, - { - { - FieldElement{-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632}, - FieldElement{-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415}, - FieldElement{-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160}, - }, - { - FieldElement{31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876}, - FieldElement{22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625}, - FieldElement{-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478}, - }, - { - FieldElement{27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164}, - FieldElement{26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595}, - FieldElement{-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248}, - }, - { - FieldElement{-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858}, - FieldElement{15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193}, - FieldElement{8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184}, - }, - { - FieldElement{-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942}, - FieldElement{-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635}, - FieldElement{21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948}, - }, - { - FieldElement{11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935}, - FieldElement{-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415}, - FieldElement{-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416}, - }, - { - FieldElement{-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018}, - FieldElement{4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778}, - FieldElement{366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659}, - }, - { - FieldElement{-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385}, - FieldElement{18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503}, - FieldElement{476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329}, - }, - }, - { - { - FieldElement{20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056}, - FieldElement{-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838}, - FieldElement{24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948}, - }, - { - FieldElement{-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691}, - FieldElement{-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118}, - FieldElement{-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517}, - }, - { - FieldElement{-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269}, - FieldElement{-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904}, - FieldElement{-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589}, - }, - { - FieldElement{-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193}, - FieldElement{-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910}, - FieldElement{-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930}, - }, - { - FieldElement{-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667}, - FieldElement{25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481}, - FieldElement{-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876}, - }, - { - FieldElement{22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640}, - FieldElement{-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278}, - FieldElement{-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112}, - }, - { - FieldElement{26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272}, - FieldElement{17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012}, - FieldElement{-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221}, - }, - { - FieldElement{30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046}, - FieldElement{13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345}, - FieldElement{-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310}, - }, - }, - { - { - FieldElement{19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937}, - FieldElement{31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636}, - FieldElement{-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008}, - }, - { - FieldElement{-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429}, - FieldElement{-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576}, - FieldElement{31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066}, - }, - { - FieldElement{-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490}, - FieldElement{-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104}, - FieldElement{33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053}, - }, - { - FieldElement{31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275}, - FieldElement{-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511}, - FieldElement{22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095}, - }, - { - FieldElement{-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439}, - FieldElement{23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939}, - FieldElement{-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424}, - }, - { - FieldElement{2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310}, - FieldElement{3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608}, - FieldElement{-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079}, - }, - { - FieldElement{-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101}, - FieldElement{21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418}, - FieldElement{18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576}, - }, - { - FieldElement{30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356}, - FieldElement{9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996}, - FieldElement{-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099}, - }, - }, - { - { - FieldElement{-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728}, - FieldElement{-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658}, - FieldElement{-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242}, - }, - { - FieldElement{-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001}, - FieldElement{-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766}, - FieldElement{18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373}, - }, - { - FieldElement{26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458}, - FieldElement{-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628}, - FieldElement{-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657}, - }, - { - FieldElement{-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062}, - FieldElement{25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616}, - FieldElement{31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014}, - }, - { - FieldElement{24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383}, - FieldElement{-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814}, - FieldElement{-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718}, - }, - { - FieldElement{30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417}, - FieldElement{2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222}, - FieldElement{33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444}, - }, - { - FieldElement{-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597}, - FieldElement{23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970}, - FieldElement{1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799}, - }, - { - FieldElement{-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647}, - FieldElement{13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511}, - FieldElement{-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032}, - }, - }, - { - { - FieldElement{9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834}, - FieldElement{-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461}, - FieldElement{29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062}, - }, - { - FieldElement{-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516}, - FieldElement{-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547}, - FieldElement{-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240}, - }, - { - FieldElement{-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038}, - FieldElement{-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741}, - FieldElement{16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103}, - }, - { - FieldElement{-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747}, - FieldElement{-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323}, - FieldElement{31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016}, - }, - { - FieldElement{-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373}, - FieldElement{15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228}, - FieldElement{-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141}, - }, - { - FieldElement{16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399}, - FieldElement{11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831}, - FieldElement{-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376}, - }, - { - FieldElement{-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313}, - FieldElement{-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958}, - FieldElement{-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577}, - }, - { - FieldElement{-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743}, - FieldElement{29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684}, - FieldElement{-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476}, - }, - }, -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go b/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go deleted file mode 100644 index fd03c252af42..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go +++ /dev/null @@ -1,1793 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package edwards25519 - -import "encoding/binary" - -// This code is a port of the public domain, “ref10” implementation of ed25519 -// from SUPERCOP. - -// FieldElement represents an element of the field GF(2^255 - 19). An element -// t, entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 -// t[3]+2^102 t[4]+...+2^230 t[9]. Bounds on each t[i] vary depending on -// context. -type FieldElement [10]int32 - -var zero FieldElement - -func FeZero(fe *FieldElement) { - copy(fe[:], zero[:]) -} - -func FeOne(fe *FieldElement) { - FeZero(fe) - fe[0] = 1 -} - -func FeAdd(dst, a, b *FieldElement) { - dst[0] = a[0] + b[0] - dst[1] = a[1] + b[1] - dst[2] = a[2] + b[2] - dst[3] = a[3] + b[3] - dst[4] = a[4] + b[4] - dst[5] = a[5] + b[5] - dst[6] = a[6] + b[6] - dst[7] = a[7] + b[7] - dst[8] = a[8] + b[8] - dst[9] = a[9] + b[9] -} - -func FeSub(dst, a, b *FieldElement) { - dst[0] = a[0] - b[0] - dst[1] = a[1] - b[1] - dst[2] = a[2] - b[2] - dst[3] = a[3] - b[3] - dst[4] = a[4] - b[4] - dst[5] = a[5] - b[5] - dst[6] = a[6] - b[6] - dst[7] = a[7] - b[7] - dst[8] = a[8] - b[8] - dst[9] = a[9] - b[9] -} - -func FeCopy(dst, src *FieldElement) { - copy(dst[:], src[:]) -} - -// Replace (f,g) with (g,g) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -func FeCMove(f, g *FieldElement, b int32) { - b = -b - f[0] ^= b & (f[0] ^ g[0]) - f[1] ^= b & (f[1] ^ g[1]) - f[2] ^= b & (f[2] ^ g[2]) - f[3] ^= b & (f[3] ^ g[3]) - f[4] ^= b & (f[4] ^ g[4]) - f[5] ^= b & (f[5] ^ g[5]) - f[6] ^= b & (f[6] ^ g[6]) - f[7] ^= b & (f[7] ^ g[7]) - f[8] ^= b & (f[8] ^ g[8]) - f[9] ^= b & (f[9] ^ g[9]) -} - -func load3(in []byte) int64 { - var r int64 - r = int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - return r -} - -func load4(in []byte) int64 { - var r int64 - r = int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - r |= int64(in[3]) << 24 - return r -} - -func FeFromBytes(dst *FieldElement, src *[32]byte) { - h0 := load4(src[:]) - h1 := load3(src[4:]) << 6 - h2 := load3(src[7:]) << 5 - h3 := load3(src[10:]) << 3 - h4 := load3(src[13:]) << 2 - h5 := load4(src[16:]) - h6 := load3(src[20:]) << 7 - h7 := load3(src[23:]) << 5 - h8 := load3(src[26:]) << 4 - h9 := (load3(src[29:]) & 8388607) << 2 - - FeCombine(dst, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -// FeToBytes marshals h to s. -// Preconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Write p=2^255-19; q=floor(h/p). -// Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))). -// -// Proof: -// Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4. -// Also have |h-2^230 h9|<2^230 so |19 2^(-255)(h-2^230 h9)|<1/4. -// -// Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9). -// Then 0> 25 - q = (h[0] + q) >> 26 - q = (h[1] + q) >> 25 - q = (h[2] + q) >> 26 - q = (h[3] + q) >> 25 - q = (h[4] + q) >> 26 - q = (h[5] + q) >> 25 - q = (h[6] + q) >> 26 - q = (h[7] + q) >> 25 - q = (h[8] + q) >> 26 - q = (h[9] + q) >> 25 - - // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. - h[0] += 19 * q - // Goal: Output h-2^255 q, which is between 0 and 2^255-20. - - carry[0] = h[0] >> 26 - h[1] += carry[0] - h[0] -= carry[0] << 26 - carry[1] = h[1] >> 25 - h[2] += carry[1] - h[1] -= carry[1] << 25 - carry[2] = h[2] >> 26 - h[3] += carry[2] - h[2] -= carry[2] << 26 - carry[3] = h[3] >> 25 - h[4] += carry[3] - h[3] -= carry[3] << 25 - carry[4] = h[4] >> 26 - h[5] += carry[4] - h[4] -= carry[4] << 26 - carry[5] = h[5] >> 25 - h[6] += carry[5] - h[5] -= carry[5] << 25 - carry[6] = h[6] >> 26 - h[7] += carry[6] - h[6] -= carry[6] << 26 - carry[7] = h[7] >> 25 - h[8] += carry[7] - h[7] -= carry[7] << 25 - carry[8] = h[8] >> 26 - h[9] += carry[8] - h[8] -= carry[8] << 26 - carry[9] = h[9] >> 25 - h[9] -= carry[9] << 25 - // h10 = carry9 - - // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20. - // Have h[0]+...+2^230 h[9] between 0 and 2^255-1; - // evidently 2^255 h10-2^255 q = 0. - // Goal: Output h[0]+...+2^230 h[9]. - - s[0] = byte(h[0] >> 0) - s[1] = byte(h[0] >> 8) - s[2] = byte(h[0] >> 16) - s[3] = byte((h[0] >> 24) | (h[1] << 2)) - s[4] = byte(h[1] >> 6) - s[5] = byte(h[1] >> 14) - s[6] = byte((h[1] >> 22) | (h[2] << 3)) - s[7] = byte(h[2] >> 5) - s[8] = byte(h[2] >> 13) - s[9] = byte((h[2] >> 21) | (h[3] << 5)) - s[10] = byte(h[3] >> 3) - s[11] = byte(h[3] >> 11) - s[12] = byte((h[3] >> 19) | (h[4] << 6)) - s[13] = byte(h[4] >> 2) - s[14] = byte(h[4] >> 10) - s[15] = byte(h[4] >> 18) - s[16] = byte(h[5] >> 0) - s[17] = byte(h[5] >> 8) - s[18] = byte(h[5] >> 16) - s[19] = byte((h[5] >> 24) | (h[6] << 1)) - s[20] = byte(h[6] >> 7) - s[21] = byte(h[6] >> 15) - s[22] = byte((h[6] >> 23) | (h[7] << 3)) - s[23] = byte(h[7] >> 5) - s[24] = byte(h[7] >> 13) - s[25] = byte((h[7] >> 21) | (h[8] << 4)) - s[26] = byte(h[8] >> 4) - s[27] = byte(h[8] >> 12) - s[28] = byte((h[8] >> 20) | (h[9] << 6)) - s[29] = byte(h[9] >> 2) - s[30] = byte(h[9] >> 10) - s[31] = byte(h[9] >> 18) -} - -func FeIsNegative(f *FieldElement) byte { - var s [32]byte - FeToBytes(&s, f) - return s[0] & 1 -} - -func FeIsNonZero(f *FieldElement) int32 { - var s [32]byte - FeToBytes(&s, f) - var x uint8 - for _, b := range s { - x |= b - } - x |= x >> 4 - x |= x >> 2 - x |= x >> 1 - return int32(x & 1) -} - -// FeNeg sets h = -f -// -// Preconditions: -// |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func FeNeg(h, f *FieldElement) { - h[0] = -f[0] - h[1] = -f[1] - h[2] = -f[2] - h[3] = -f[3] - h[4] = -f[4] - h[5] = -f[5] - h[6] = -f[6] - h[7] = -f[7] - h[8] = -f[8] - h[9] = -f[9] -} - -func FeCombine(h *FieldElement, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) { - var c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 int64 - - /* - |h0| <= (1.1*1.1*2^52*(1+19+19+19+19)+1.1*1.1*2^50*(38+38+38+38+38)) - i.e. |h0| <= 1.2*2^59; narrower ranges for h2, h4, h6, h8 - |h1| <= (1.1*1.1*2^51*(1+1+19+19+19+19+19+19+19+19)) - i.e. |h1| <= 1.5*2^58; narrower ranges for h3, h5, h7, h9 - */ - - c0 = (h0 + (1 << 25)) >> 26 - h1 += c0 - h0 -= c0 << 26 - c4 = (h4 + (1 << 25)) >> 26 - h5 += c4 - h4 -= c4 << 26 - /* |h0| <= 2^25 */ - /* |h4| <= 2^25 */ - /* |h1| <= 1.51*2^58 */ - /* |h5| <= 1.51*2^58 */ - - c1 = (h1 + (1 << 24)) >> 25 - h2 += c1 - h1 -= c1 << 25 - c5 = (h5 + (1 << 24)) >> 25 - h6 += c5 - h5 -= c5 << 25 - /* |h1| <= 2^24; from now on fits into int32 */ - /* |h5| <= 2^24; from now on fits into int32 */ - /* |h2| <= 1.21*2^59 */ - /* |h6| <= 1.21*2^59 */ - - c2 = (h2 + (1 << 25)) >> 26 - h3 += c2 - h2 -= c2 << 26 - c6 = (h6 + (1 << 25)) >> 26 - h7 += c6 - h6 -= c6 << 26 - /* |h2| <= 2^25; from now on fits into int32 unchanged */ - /* |h6| <= 2^25; from now on fits into int32 unchanged */ - /* |h3| <= 1.51*2^58 */ - /* |h7| <= 1.51*2^58 */ - - c3 = (h3 + (1 << 24)) >> 25 - h4 += c3 - h3 -= c3 << 25 - c7 = (h7 + (1 << 24)) >> 25 - h8 += c7 - h7 -= c7 << 25 - /* |h3| <= 2^24; from now on fits into int32 unchanged */ - /* |h7| <= 2^24; from now on fits into int32 unchanged */ - /* |h4| <= 1.52*2^33 */ - /* |h8| <= 1.52*2^33 */ - - c4 = (h4 + (1 << 25)) >> 26 - h5 += c4 - h4 -= c4 << 26 - c8 = (h8 + (1 << 25)) >> 26 - h9 += c8 - h8 -= c8 << 26 - /* |h4| <= 2^25; from now on fits into int32 unchanged */ - /* |h8| <= 2^25; from now on fits into int32 unchanged */ - /* |h5| <= 1.01*2^24 */ - /* |h9| <= 1.51*2^58 */ - - c9 = (h9 + (1 << 24)) >> 25 - h0 += c9 * 19 - h9 -= c9 << 25 - /* |h9| <= 2^24; from now on fits into int32 unchanged */ - /* |h0| <= 1.8*2^37 */ - - c0 = (h0 + (1 << 25)) >> 26 - h1 += c0 - h0 -= c0 << 26 - /* |h0| <= 2^25; from now on fits into int32 unchanged */ - /* |h1| <= 1.01*2^24 */ - - h[0] = int32(h0) - h[1] = int32(h1) - h[2] = int32(h2) - h[3] = int32(h3) - h[4] = int32(h4) - h[5] = int32(h5) - h[6] = int32(h6) - h[7] = int32(h7) - h[8] = int32(h8) - h[9] = int32(h9) -} - -// FeMul calculates h = f * g -// Can overlap h with f or g. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// |g| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -// -// Notes on implementation strategy: -// -// Using schoolbook multiplication. -// Karatsuba would save a little in some cost models. -// -// Most multiplications by 2 and 19 are 32-bit precomputations; -// cheaper than 64-bit postcomputations. -// -// There is one remaining multiplication by 19 in the carry chain; -// one *19 precomputation can be merged into this, -// but the resulting data flow is considerably less clean. -// -// There are 12 carries below. -// 10 of them are 2-way parallelizable and vectorizable. -// Can get away with 11 carries, but then data flow is much deeper. -// -// With tighter constraints on inputs, can squeeze carries into int32. -func FeMul(h, f, g *FieldElement) { - f0 := int64(f[0]) - f1 := int64(f[1]) - f2 := int64(f[2]) - f3 := int64(f[3]) - f4 := int64(f[4]) - f5 := int64(f[5]) - f6 := int64(f[6]) - f7 := int64(f[7]) - f8 := int64(f[8]) - f9 := int64(f[9]) - - f1_2 := int64(2 * f[1]) - f3_2 := int64(2 * f[3]) - f5_2 := int64(2 * f[5]) - f7_2 := int64(2 * f[7]) - f9_2 := int64(2 * f[9]) - - g0 := int64(g[0]) - g1 := int64(g[1]) - g2 := int64(g[2]) - g3 := int64(g[3]) - g4 := int64(g[4]) - g5 := int64(g[5]) - g6 := int64(g[6]) - g7 := int64(g[7]) - g8 := int64(g[8]) - g9 := int64(g[9]) - - g1_19 := int64(19 * g[1]) /* 1.4*2^29 */ - g2_19 := int64(19 * g[2]) /* 1.4*2^30; still ok */ - g3_19 := int64(19 * g[3]) - g4_19 := int64(19 * g[4]) - g5_19 := int64(19 * g[5]) - g6_19 := int64(19 * g[6]) - g7_19 := int64(19 * g[7]) - g8_19 := int64(19 * g[8]) - g9_19 := int64(19 * g[9]) - - h0 := f0*g0 + f1_2*g9_19 + f2*g8_19 + f3_2*g7_19 + f4*g6_19 + f5_2*g5_19 + f6*g4_19 + f7_2*g3_19 + f8*g2_19 + f9_2*g1_19 - h1 := f0*g1 + f1*g0 + f2*g9_19 + f3*g8_19 + f4*g7_19 + f5*g6_19 + f6*g5_19 + f7*g4_19 + f8*g3_19 + f9*g2_19 - h2 := f0*g2 + f1_2*g1 + f2*g0 + f3_2*g9_19 + f4*g8_19 + f5_2*g7_19 + f6*g6_19 + f7_2*g5_19 + f8*g4_19 + f9_2*g3_19 - h3 := f0*g3 + f1*g2 + f2*g1 + f3*g0 + f4*g9_19 + f5*g8_19 + f6*g7_19 + f7*g6_19 + f8*g5_19 + f9*g4_19 - h4 := f0*g4 + f1_2*g3 + f2*g2 + f3_2*g1 + f4*g0 + f5_2*g9_19 + f6*g8_19 + f7_2*g7_19 + f8*g6_19 + f9_2*g5_19 - h5 := f0*g5 + f1*g4 + f2*g3 + f3*g2 + f4*g1 + f5*g0 + f6*g9_19 + f7*g8_19 + f8*g7_19 + f9*g6_19 - h6 := f0*g6 + f1_2*g5 + f2*g4 + f3_2*g3 + f4*g2 + f5_2*g1 + f6*g0 + f7_2*g9_19 + f8*g8_19 + f9_2*g7_19 - h7 := f0*g7 + f1*g6 + f2*g5 + f3*g4 + f4*g3 + f5*g2 + f6*g1 + f7*g0 + f8*g9_19 + f9*g8_19 - h8 := f0*g8 + f1_2*g7 + f2*g6 + f3_2*g5 + f4*g4 + f5_2*g3 + f6*g2 + f7_2*g1 + f8*g0 + f9_2*g9_19 - h9 := f0*g9 + f1*g8 + f2*g7 + f3*g6 + f4*g5 + f5*g4 + f6*g3 + f7*g2 + f8*g1 + f9*g0 - - FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -func feSquare(f *FieldElement) (h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) { - f0 := int64(f[0]) - f1 := int64(f[1]) - f2 := int64(f[2]) - f3 := int64(f[3]) - f4 := int64(f[4]) - f5 := int64(f[5]) - f6 := int64(f[6]) - f7 := int64(f[7]) - f8 := int64(f[8]) - f9 := int64(f[9]) - f0_2 := int64(2 * f[0]) - f1_2 := int64(2 * f[1]) - f2_2 := int64(2 * f[2]) - f3_2 := int64(2 * f[3]) - f4_2 := int64(2 * f[4]) - f5_2 := int64(2 * f[5]) - f6_2 := int64(2 * f[6]) - f7_2 := int64(2 * f[7]) - f5_38 := 38 * f5 // 1.31*2^30 - f6_19 := 19 * f6 // 1.31*2^30 - f7_38 := 38 * f7 // 1.31*2^30 - f8_19 := 19 * f8 // 1.31*2^30 - f9_38 := 38 * f9 // 1.31*2^30 - - h0 = f0*f0 + f1_2*f9_38 + f2_2*f8_19 + f3_2*f7_38 + f4_2*f6_19 + f5*f5_38 - h1 = f0_2*f1 + f2*f9_38 + f3_2*f8_19 + f4*f7_38 + f5_2*f6_19 - h2 = f0_2*f2 + f1_2*f1 + f3_2*f9_38 + f4_2*f8_19 + f5_2*f7_38 + f6*f6_19 - h3 = f0_2*f3 + f1_2*f2 + f4*f9_38 + f5_2*f8_19 + f6*f7_38 - h4 = f0_2*f4 + f1_2*f3_2 + f2*f2 + f5_2*f9_38 + f6_2*f8_19 + f7*f7_38 - h5 = f0_2*f5 + f1_2*f4 + f2_2*f3 + f6*f9_38 + f7_2*f8_19 - h6 = f0_2*f6 + f1_2*f5_2 + f2_2*f4 + f3_2*f3 + f7_2*f9_38 + f8*f8_19 - h7 = f0_2*f7 + f1_2*f6 + f2_2*f5 + f3_2*f4 + f8*f9_38 - h8 = f0_2*f8 + f1_2*f7_2 + f2_2*f6 + f3_2*f5_2 + f4*f4 + f9*f9_38 - h9 = f0_2*f9 + f1_2*f8 + f2_2*f7 + f3_2*f6 + f4_2*f5 - - return -} - -// FeSquare calculates h = f*f. Can overlap h with f. -// -// Preconditions: -// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. -func FeSquare(h, f *FieldElement) { - h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 := feSquare(f) - FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -// FeSquare2 sets h = 2 * f * f -// -// Can overlap h with f. -// -// Preconditions: -// |f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc. -// -// Postconditions: -// |h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc. -// See fe_mul.c for discussion of implementation strategy. -func FeSquare2(h, f *FieldElement) { - h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 := feSquare(f) - - h0 += h0 - h1 += h1 - h2 += h2 - h3 += h3 - h4 += h4 - h5 += h5 - h6 += h6 - h7 += h7 - h8 += h8 - h9 += h9 - - FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) -} - -func FeInvert(out, z *FieldElement) { - var t0, t1, t2, t3 FieldElement - var i int - - FeSquare(&t0, z) // 2^1 - FeSquare(&t1, &t0) // 2^2 - for i = 1; i < 2; i++ { // 2^3 - FeSquare(&t1, &t1) - } - FeMul(&t1, z, &t1) // 2^3 + 2^0 - FeMul(&t0, &t0, &t1) // 2^3 + 2^1 + 2^0 - FeSquare(&t2, &t0) // 2^4 + 2^2 + 2^1 - FeMul(&t1, &t1, &t2) // 2^4 + 2^3 + 2^2 + 2^1 + 2^0 - FeSquare(&t2, &t1) // 5,4,3,2,1 - for i = 1; i < 5; i++ { // 9,8,7,6,5 - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) // 9,8,7,6,5,4,3,2,1,0 - FeSquare(&t2, &t1) // 10..1 - for i = 1; i < 10; i++ { // 19..10 - FeSquare(&t2, &t2) - } - FeMul(&t2, &t2, &t1) // 19..0 - FeSquare(&t3, &t2) // 20..1 - for i = 1; i < 20; i++ { // 39..20 - FeSquare(&t3, &t3) - } - FeMul(&t2, &t3, &t2) // 39..0 - FeSquare(&t2, &t2) // 40..1 - for i = 1; i < 10; i++ { // 49..10 - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) // 49..0 - FeSquare(&t2, &t1) // 50..1 - for i = 1; i < 50; i++ { // 99..50 - FeSquare(&t2, &t2) - } - FeMul(&t2, &t2, &t1) // 99..0 - FeSquare(&t3, &t2) // 100..1 - for i = 1; i < 100; i++ { // 199..100 - FeSquare(&t3, &t3) - } - FeMul(&t2, &t3, &t2) // 199..0 - FeSquare(&t2, &t2) // 200..1 - for i = 1; i < 50; i++ { // 249..50 - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) // 249..0 - FeSquare(&t1, &t1) // 250..1 - for i = 1; i < 5; i++ { // 254..5 - FeSquare(&t1, &t1) - } - FeMul(out, &t1, &t0) // 254..5,3,1,0 -} - -func fePow22523(out, z *FieldElement) { - var t0, t1, t2 FieldElement - var i int - - FeSquare(&t0, z) - for i = 1; i < 1; i++ { - FeSquare(&t0, &t0) - } - FeSquare(&t1, &t0) - for i = 1; i < 2; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t1, z, &t1) - FeMul(&t0, &t0, &t1) - FeSquare(&t0, &t0) - for i = 1; i < 1; i++ { - FeSquare(&t0, &t0) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t1, &t0) - for i = 1; i < 5; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t1, &t0) - for i = 1; i < 10; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t1, &t1, &t0) - FeSquare(&t2, &t1) - for i = 1; i < 20; i++ { - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) - FeSquare(&t1, &t1) - for i = 1; i < 10; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t1, &t0) - for i = 1; i < 50; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t1, &t1, &t0) - FeSquare(&t2, &t1) - for i = 1; i < 100; i++ { - FeSquare(&t2, &t2) - } - FeMul(&t1, &t2, &t1) - FeSquare(&t1, &t1) - for i = 1; i < 50; i++ { - FeSquare(&t1, &t1) - } - FeMul(&t0, &t1, &t0) - FeSquare(&t0, &t0) - for i = 1; i < 2; i++ { - FeSquare(&t0, &t0) - } - FeMul(out, &t0, z) -} - -// Group elements are members of the elliptic curve -x^2 + y^2 = 1 + d * x^2 * -// y^2 where d = -121665/121666. -// -// Several representations are used: -// ProjectiveGroupElement: (X:Y:Z) satisfying x=X/Z, y=Y/Z -// ExtendedGroupElement: (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT -// CompletedGroupElement: ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T -// PreComputedGroupElement: (y+x,y-x,2dxy) - -type ProjectiveGroupElement struct { - X, Y, Z FieldElement -} - -type ExtendedGroupElement struct { - X, Y, Z, T FieldElement -} - -type CompletedGroupElement struct { - X, Y, Z, T FieldElement -} - -type PreComputedGroupElement struct { - yPlusX, yMinusX, xy2d FieldElement -} - -type CachedGroupElement struct { - yPlusX, yMinusX, Z, T2d FieldElement -} - -func (p *ProjectiveGroupElement) Zero() { - FeZero(&p.X) - FeOne(&p.Y) - FeOne(&p.Z) -} - -func (p *ProjectiveGroupElement) Double(r *CompletedGroupElement) { - var t0 FieldElement - - FeSquare(&r.X, &p.X) - FeSquare(&r.Z, &p.Y) - FeSquare2(&r.T, &p.Z) - FeAdd(&r.Y, &p.X, &p.Y) - FeSquare(&t0, &r.Y) - FeAdd(&r.Y, &r.Z, &r.X) - FeSub(&r.Z, &r.Z, &r.X) - FeSub(&r.X, &t0, &r.Y) - FeSub(&r.T, &r.T, &r.Z) -} - -func (p *ProjectiveGroupElement) ToBytes(s *[32]byte) { - var recip, x, y FieldElement - - FeInvert(&recip, &p.Z) - FeMul(&x, &p.X, &recip) - FeMul(&y, &p.Y, &recip) - FeToBytes(s, &y) - s[31] ^= FeIsNegative(&x) << 7 -} - -func (p *ExtendedGroupElement) Zero() { - FeZero(&p.X) - FeOne(&p.Y) - FeOne(&p.Z) - FeZero(&p.T) -} - -func (p *ExtendedGroupElement) Double(r *CompletedGroupElement) { - var q ProjectiveGroupElement - p.ToProjective(&q) - q.Double(r) -} - -func (p *ExtendedGroupElement) ToCached(r *CachedGroupElement) { - FeAdd(&r.yPlusX, &p.Y, &p.X) - FeSub(&r.yMinusX, &p.Y, &p.X) - FeCopy(&r.Z, &p.Z) - FeMul(&r.T2d, &p.T, &d2) -} - -func (p *ExtendedGroupElement) ToProjective(r *ProjectiveGroupElement) { - FeCopy(&r.X, &p.X) - FeCopy(&r.Y, &p.Y) - FeCopy(&r.Z, &p.Z) -} - -func (p *ExtendedGroupElement) ToBytes(s *[32]byte) { - var recip, x, y FieldElement - - FeInvert(&recip, &p.Z) - FeMul(&x, &p.X, &recip) - FeMul(&y, &p.Y, &recip) - FeToBytes(s, &y) - s[31] ^= FeIsNegative(&x) << 7 -} - -func (p *ExtendedGroupElement) FromBytes(s *[32]byte) bool { - var u, v, v3, vxx, check FieldElement - - FeFromBytes(&p.Y, s) - FeOne(&p.Z) - FeSquare(&u, &p.Y) - FeMul(&v, &u, &d) - FeSub(&u, &u, &p.Z) // y = y^2-1 - FeAdd(&v, &v, &p.Z) // v = dy^2+1 - - FeSquare(&v3, &v) - FeMul(&v3, &v3, &v) // v3 = v^3 - FeSquare(&p.X, &v3) - FeMul(&p.X, &p.X, &v) - FeMul(&p.X, &p.X, &u) // x = uv^7 - - fePow22523(&p.X, &p.X) // x = (uv^7)^((q-5)/8) - FeMul(&p.X, &p.X, &v3) - FeMul(&p.X, &p.X, &u) // x = uv^3(uv^7)^((q-5)/8) - - var tmpX, tmp2 [32]byte - - FeSquare(&vxx, &p.X) - FeMul(&vxx, &vxx, &v) - FeSub(&check, &vxx, &u) // vx^2-u - if FeIsNonZero(&check) == 1 { - FeAdd(&check, &vxx, &u) // vx^2+u - if FeIsNonZero(&check) == 1 { - return false - } - FeMul(&p.X, &p.X, &SqrtM1) - - FeToBytes(&tmpX, &p.X) - for i, v := range tmpX { - tmp2[31-i] = v - } - } - - if FeIsNegative(&p.X) != (s[31] >> 7) { - FeNeg(&p.X, &p.X) - } - - FeMul(&p.T, &p.X, &p.Y) - return true -} - -func (p *CompletedGroupElement) ToProjective(r *ProjectiveGroupElement) { - FeMul(&r.X, &p.X, &p.T) - FeMul(&r.Y, &p.Y, &p.Z) - FeMul(&r.Z, &p.Z, &p.T) -} - -func (p *CompletedGroupElement) ToExtended(r *ExtendedGroupElement) { - FeMul(&r.X, &p.X, &p.T) - FeMul(&r.Y, &p.Y, &p.Z) - FeMul(&r.Z, &p.Z, &p.T) - FeMul(&r.T, &p.X, &p.Y) -} - -func (p *PreComputedGroupElement) Zero() { - FeOne(&p.yPlusX) - FeOne(&p.yMinusX) - FeZero(&p.xy2d) -} - -func geAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yPlusX) - FeMul(&r.Y, &r.Y, &q.yMinusX) - FeMul(&r.T, &q.T2d, &p.T) - FeMul(&r.X, &p.Z, &q.Z) - FeAdd(&t0, &r.X, &r.X) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeAdd(&r.Z, &t0, &r.T) - FeSub(&r.T, &t0, &r.T) -} - -func geSub(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yMinusX) - FeMul(&r.Y, &r.Y, &q.yPlusX) - FeMul(&r.T, &q.T2d, &p.T) - FeMul(&r.X, &p.Z, &q.Z) - FeAdd(&t0, &r.X, &r.X) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeSub(&r.Z, &t0, &r.T) - FeAdd(&r.T, &t0, &r.T) -} - -func geMixedAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *PreComputedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yPlusX) - FeMul(&r.Y, &r.Y, &q.yMinusX) - FeMul(&r.T, &q.xy2d, &p.T) - FeAdd(&t0, &p.Z, &p.Z) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeAdd(&r.Z, &t0, &r.T) - FeSub(&r.T, &t0, &r.T) -} - -func geMixedSub(r *CompletedGroupElement, p *ExtendedGroupElement, q *PreComputedGroupElement) { - var t0 FieldElement - - FeAdd(&r.X, &p.Y, &p.X) - FeSub(&r.Y, &p.Y, &p.X) - FeMul(&r.Z, &r.X, &q.yMinusX) - FeMul(&r.Y, &r.Y, &q.yPlusX) - FeMul(&r.T, &q.xy2d, &p.T) - FeAdd(&t0, &p.Z, &p.Z) - FeSub(&r.X, &r.Z, &r.Y) - FeAdd(&r.Y, &r.Z, &r.Y) - FeSub(&r.Z, &t0, &r.T) - FeAdd(&r.T, &t0, &r.T) -} - -func slide(r *[256]int8, a *[32]byte) { - for i := range r { - r[i] = int8(1 & (a[i>>3] >> uint(i&7))) - } - - for i := range r { - if r[i] != 0 { - for b := 1; b <= 6 && i+b < 256; b++ { - if r[i+b] != 0 { - if r[i]+(r[i+b]<= -15 { - r[i] -= r[i+b] << uint(b) - for k := i + b; k < 256; k++ { - if r[k] == 0 { - r[k] = 1 - break - } - r[k] = 0 - } - } else { - break - } - } - } - } - } -} - -// GeDoubleScalarMultVartime sets r = a*A + b*B -// where a = a[0]+256*a[1]+...+256^31 a[31]. -// and b = b[0]+256*b[1]+...+256^31 b[31]. -// B is the Ed25519 base point (x,4/5) with x positive. -func GeDoubleScalarMultVartime(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElement, b *[32]byte) { - var aSlide, bSlide [256]int8 - var Ai [8]CachedGroupElement // A,3A,5A,7A,9A,11A,13A,15A - var t CompletedGroupElement - var u, A2 ExtendedGroupElement - var i int - - slide(&aSlide, a) - slide(&bSlide, b) - - A.ToCached(&Ai[0]) - A.Double(&t) - t.ToExtended(&A2) - - for i := 0; i < 7; i++ { - geAdd(&t, &A2, &Ai[i]) - t.ToExtended(&u) - u.ToCached(&Ai[i+1]) - } - - r.Zero() - - for i = 255; i >= 0; i-- { - if aSlide[i] != 0 || bSlide[i] != 0 { - break - } - } - - for ; i >= 0; i-- { - r.Double(&t) - - if aSlide[i] > 0 { - t.ToExtended(&u) - geAdd(&t, &u, &Ai[aSlide[i]/2]) - } else if aSlide[i] < 0 { - t.ToExtended(&u) - geSub(&t, &u, &Ai[(-aSlide[i])/2]) - } - - if bSlide[i] > 0 { - t.ToExtended(&u) - geMixedAdd(&t, &u, &bi[bSlide[i]/2]) - } else if bSlide[i] < 0 { - t.ToExtended(&u) - geMixedSub(&t, &u, &bi[(-bSlide[i])/2]) - } - - t.ToProjective(r) - } -} - -// equal returns 1 if b == c and 0 otherwise, assuming that b and c are -// non-negative. -func equal(b, c int32) int32 { - x := uint32(b ^ c) - x-- - return int32(x >> 31) -} - -// negative returns 1 if b < 0 and 0 otherwise. -func negative(b int32) int32 { - return (b >> 31) & 1 -} - -func PreComputedGroupElementCMove(t, u *PreComputedGroupElement, b int32) { - FeCMove(&t.yPlusX, &u.yPlusX, b) - FeCMove(&t.yMinusX, &u.yMinusX, b) - FeCMove(&t.xy2d, &u.xy2d, b) -} - -func selectPoint(t *PreComputedGroupElement, pos int32, b int32) { - var minusT PreComputedGroupElement - bNegative := negative(b) - bAbs := b - (((-bNegative) & b) << 1) - - t.Zero() - for i := int32(0); i < 8; i++ { - PreComputedGroupElementCMove(t, &base[pos][i], equal(bAbs, i+1)) - } - FeCopy(&minusT.yPlusX, &t.yMinusX) - FeCopy(&minusT.yMinusX, &t.yPlusX) - FeNeg(&minusT.xy2d, &t.xy2d) - PreComputedGroupElementCMove(t, &minusT, bNegative) -} - -// GeScalarMultBase computes h = a*B, where -// a = a[0]+256*a[1]+...+256^31 a[31] -// B is the Ed25519 base point (x,4/5) with x positive. -// -// Preconditions: -// a[31] <= 127 -func GeScalarMultBase(h *ExtendedGroupElement, a *[32]byte) { - var e [64]int8 - - for i, v := range a { - e[2*i] = int8(v & 15) - e[2*i+1] = int8((v >> 4) & 15) - } - - // each e[i] is between 0 and 15 and e[63] is between 0 and 7. - - carry := int8(0) - for i := 0; i < 63; i++ { - e[i] += carry - carry = (e[i] + 8) >> 4 - e[i] -= carry << 4 - } - e[63] += carry - // each e[i] is between -8 and 8. - - h.Zero() - var t PreComputedGroupElement - var r CompletedGroupElement - for i := int32(1); i < 64; i += 2 { - selectPoint(&t, i/2, int32(e[i])) - geMixedAdd(&r, h, &t) - r.ToExtended(h) - } - - var s ProjectiveGroupElement - - h.Double(&r) - r.ToProjective(&s) - s.Double(&r) - r.ToProjective(&s) - s.Double(&r) - r.ToProjective(&s) - s.Double(&r) - r.ToExtended(h) - - for i := int32(0); i < 64; i += 2 { - selectPoint(&t, i/2, int32(e[i])) - geMixedAdd(&r, h, &t) - r.ToExtended(h) - } -} - -// The scalars are GF(2^252 + 27742317777372353535851937790883648493). - -// Input: -// a[0]+256*a[1]+...+256^31*a[31] = a -// b[0]+256*b[1]+...+256^31*b[31] = b -// c[0]+256*c[1]+...+256^31*c[31] = c -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -func ScMulAdd(s, a, b, c *[32]byte) { - a0 := 2097151 & load3(a[:]) - a1 := 2097151 & (load4(a[2:]) >> 5) - a2 := 2097151 & (load3(a[5:]) >> 2) - a3 := 2097151 & (load4(a[7:]) >> 7) - a4 := 2097151 & (load4(a[10:]) >> 4) - a5 := 2097151 & (load3(a[13:]) >> 1) - a6 := 2097151 & (load4(a[15:]) >> 6) - a7 := 2097151 & (load3(a[18:]) >> 3) - a8 := 2097151 & load3(a[21:]) - a9 := 2097151 & (load4(a[23:]) >> 5) - a10 := 2097151 & (load3(a[26:]) >> 2) - a11 := (load4(a[28:]) >> 7) - b0 := 2097151 & load3(b[:]) - b1 := 2097151 & (load4(b[2:]) >> 5) - b2 := 2097151 & (load3(b[5:]) >> 2) - b3 := 2097151 & (load4(b[7:]) >> 7) - b4 := 2097151 & (load4(b[10:]) >> 4) - b5 := 2097151 & (load3(b[13:]) >> 1) - b6 := 2097151 & (load4(b[15:]) >> 6) - b7 := 2097151 & (load3(b[18:]) >> 3) - b8 := 2097151 & load3(b[21:]) - b9 := 2097151 & (load4(b[23:]) >> 5) - b10 := 2097151 & (load3(b[26:]) >> 2) - b11 := (load4(b[28:]) >> 7) - c0 := 2097151 & load3(c[:]) - c1 := 2097151 & (load4(c[2:]) >> 5) - c2 := 2097151 & (load3(c[5:]) >> 2) - c3 := 2097151 & (load4(c[7:]) >> 7) - c4 := 2097151 & (load4(c[10:]) >> 4) - c5 := 2097151 & (load3(c[13:]) >> 1) - c6 := 2097151 & (load4(c[15:]) >> 6) - c7 := 2097151 & (load3(c[18:]) >> 3) - c8 := 2097151 & load3(c[21:]) - c9 := 2097151 & (load4(c[23:]) >> 5) - c10 := 2097151 & (load3(c[26:]) >> 2) - c11 := (load4(c[28:]) >> 7) - var carry [23]int64 - - s0 := c0 + a0*b0 - s1 := c1 + a0*b1 + a1*b0 - s2 := c2 + a0*b2 + a1*b1 + a2*b0 - s3 := c3 + a0*b3 + a1*b2 + a2*b1 + a3*b0 - s4 := c4 + a0*b4 + a1*b3 + a2*b2 + a3*b1 + a4*b0 - s5 := c5 + a0*b5 + a1*b4 + a2*b3 + a3*b2 + a4*b1 + a5*b0 - s6 := c6 + a0*b6 + a1*b5 + a2*b4 + a3*b3 + a4*b2 + a5*b1 + a6*b0 - s7 := c7 + a0*b7 + a1*b6 + a2*b5 + a3*b4 + a4*b3 + a5*b2 + a6*b1 + a7*b0 - s8 := c8 + a0*b8 + a1*b7 + a2*b6 + a3*b5 + a4*b4 + a5*b3 + a6*b2 + a7*b1 + a8*b0 - s9 := c9 + a0*b9 + a1*b8 + a2*b7 + a3*b6 + a4*b5 + a5*b4 + a6*b3 + a7*b2 + a8*b1 + a9*b0 - s10 := c10 + a0*b10 + a1*b9 + a2*b8 + a3*b7 + a4*b6 + a5*b5 + a6*b4 + a7*b3 + a8*b2 + a9*b1 + a10*b0 - s11 := c11 + a0*b11 + a1*b10 + a2*b9 + a3*b8 + a4*b7 + a5*b6 + a6*b5 + a7*b4 + a8*b3 + a9*b2 + a10*b1 + a11*b0 - s12 := a1*b11 + a2*b10 + a3*b9 + a4*b8 + a5*b7 + a6*b6 + a7*b5 + a8*b4 + a9*b3 + a10*b2 + a11*b1 - s13 := a2*b11 + a3*b10 + a4*b9 + a5*b8 + a6*b7 + a7*b6 + a8*b5 + a9*b4 + a10*b3 + a11*b2 - s14 := a3*b11 + a4*b10 + a5*b9 + a6*b8 + a7*b7 + a8*b6 + a9*b5 + a10*b4 + a11*b3 - s15 := a4*b11 + a5*b10 + a6*b9 + a7*b8 + a8*b7 + a9*b6 + a10*b5 + a11*b4 - s16 := a5*b11 + a6*b10 + a7*b9 + a8*b8 + a9*b7 + a10*b6 + a11*b5 - s17 := a6*b11 + a7*b10 + a8*b9 + a9*b8 + a10*b7 + a11*b6 - s18 := a7*b11 + a8*b10 + a9*b9 + a10*b8 + a11*b7 - s19 := a8*b11 + a9*b10 + a10*b9 + a11*b8 - s20 := a9*b11 + a10*b10 + a11*b9 - s21 := a10*b11 + a11*b10 - s22 := a11 * b11 - s23 := int64(0) - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - carry[18] = (s18 + (1 << 20)) >> 21 - s19 += carry[18] - s18 -= carry[18] << 21 - carry[20] = (s20 + (1 << 20)) >> 21 - s21 += carry[20] - s20 -= carry[20] << 21 - carry[22] = (s22 + (1 << 20)) >> 21 - s23 += carry[22] - s22 -= carry[22] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - carry[17] = (s17 + (1 << 20)) >> 21 - s18 += carry[17] - s17 -= carry[17] << 21 - carry[19] = (s19 + (1 << 20)) >> 21 - s20 += carry[19] - s19 -= carry[19] << 21 - carry[21] = (s21 + (1 << 20)) >> 21 - s22 += carry[21] - s21 -= carry[21] << 21 - - s11 += s23 * 666643 - s12 += s23 * 470296 - s13 += s23 * 654183 - s14 -= s23 * 997805 - s15 += s23 * 136657 - s16 -= s23 * 683901 - s23 = 0 - - s10 += s22 * 666643 - s11 += s22 * 470296 - s12 += s22 * 654183 - s13 -= s22 * 997805 - s14 += s22 * 136657 - s15 -= s22 * 683901 - s22 = 0 - - s9 += s21 * 666643 - s10 += s21 * 470296 - s11 += s21 * 654183 - s12 -= s21 * 997805 - s13 += s21 * 136657 - s14 -= s21 * 683901 - s21 = 0 - - s8 += s20 * 666643 - s9 += s20 * 470296 - s10 += s20 * 654183 - s11 -= s20 * 997805 - s12 += s20 * 136657 - s13 -= s20 * 683901 - s20 = 0 - - s7 += s19 * 666643 - s8 += s19 * 470296 - s9 += s19 * 654183 - s10 -= s19 * 997805 - s11 += s19 * 136657 - s12 -= s19 * 683901 - s19 = 0 - - s6 += s18 * 666643 - s7 += s18 * 470296 - s8 += s18 * 654183 - s9 -= s18 * 997805 - s10 += s18 * 136657 - s11 -= s18 * 683901 - s18 = 0 - - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - - s5 += s17 * 666643 - s6 += s17 * 470296 - s7 += s17 * 654183 - s8 -= s17 * 997805 - s9 += s17 * 136657 - s10 -= s17 * 683901 - s17 = 0 - - s4 += s16 * 666643 - s5 += s16 * 470296 - s6 += s16 * 654183 - s7 -= s16 * 997805 - s8 += s16 * 136657 - s9 -= s16 * 683901 - s16 = 0 - - s3 += s15 * 666643 - s4 += s15 * 470296 - s5 += s15 * 654183 - s6 -= s15 * 997805 - s7 += s15 * 136657 - s8 -= s15 * 683901 - s15 = 0 - - s2 += s14 * 666643 - s3 += s14 * 470296 - s4 += s14 * 654183 - s5 -= s14 * 997805 - s6 += s14 * 136657 - s7 -= s14 * 683901 - s14 = 0 - - s1 += s13 * 666643 - s2 += s13 * 470296 - s3 += s13 * 654183 - s4 -= s13 * 997805 - s5 += s13 * 136657 - s6 -= s13 * 683901 - s13 = 0 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[11] = s11 >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - s[0] = byte(s0 >> 0) - s[1] = byte(s0 >> 8) - s[2] = byte((s0 >> 16) | (s1 << 5)) - s[3] = byte(s1 >> 3) - s[4] = byte(s1 >> 11) - s[5] = byte((s1 >> 19) | (s2 << 2)) - s[6] = byte(s2 >> 6) - s[7] = byte((s2 >> 14) | (s3 << 7)) - s[8] = byte(s3 >> 1) - s[9] = byte(s3 >> 9) - s[10] = byte((s3 >> 17) | (s4 << 4)) - s[11] = byte(s4 >> 4) - s[12] = byte(s4 >> 12) - s[13] = byte((s4 >> 20) | (s5 << 1)) - s[14] = byte(s5 >> 7) - s[15] = byte((s5 >> 15) | (s6 << 6)) - s[16] = byte(s6 >> 2) - s[17] = byte(s6 >> 10) - s[18] = byte((s6 >> 18) | (s7 << 3)) - s[19] = byte(s7 >> 5) - s[20] = byte(s7 >> 13) - s[21] = byte(s8 >> 0) - s[22] = byte(s8 >> 8) - s[23] = byte((s8 >> 16) | (s9 << 5)) - s[24] = byte(s9 >> 3) - s[25] = byte(s9 >> 11) - s[26] = byte((s9 >> 19) | (s10 << 2)) - s[27] = byte(s10 >> 6) - s[28] = byte((s10 >> 14) | (s11 << 7)) - s[29] = byte(s11 >> 1) - s[30] = byte(s11 >> 9) - s[31] = byte(s11 >> 17) -} - -// Input: -// s[0]+256*s[1]+...+256^63*s[63] = s -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = s mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -func ScReduce(out *[32]byte, s *[64]byte) { - s0 := 2097151 & load3(s[:]) - s1 := 2097151 & (load4(s[2:]) >> 5) - s2 := 2097151 & (load3(s[5:]) >> 2) - s3 := 2097151 & (load4(s[7:]) >> 7) - s4 := 2097151 & (load4(s[10:]) >> 4) - s5 := 2097151 & (load3(s[13:]) >> 1) - s6 := 2097151 & (load4(s[15:]) >> 6) - s7 := 2097151 & (load3(s[18:]) >> 3) - s8 := 2097151 & load3(s[21:]) - s9 := 2097151 & (load4(s[23:]) >> 5) - s10 := 2097151 & (load3(s[26:]) >> 2) - s11 := 2097151 & (load4(s[28:]) >> 7) - s12 := 2097151 & (load4(s[31:]) >> 4) - s13 := 2097151 & (load3(s[34:]) >> 1) - s14 := 2097151 & (load4(s[36:]) >> 6) - s15 := 2097151 & (load3(s[39:]) >> 3) - s16 := 2097151 & load3(s[42:]) - s17 := 2097151 & (load4(s[44:]) >> 5) - s18 := 2097151 & (load3(s[47:]) >> 2) - s19 := 2097151 & (load4(s[49:]) >> 7) - s20 := 2097151 & (load4(s[52:]) >> 4) - s21 := 2097151 & (load3(s[55:]) >> 1) - s22 := 2097151 & (load4(s[57:]) >> 6) - s23 := (load4(s[60:]) >> 3) - - s11 += s23 * 666643 - s12 += s23 * 470296 - s13 += s23 * 654183 - s14 -= s23 * 997805 - s15 += s23 * 136657 - s16 -= s23 * 683901 - s23 = 0 - - s10 += s22 * 666643 - s11 += s22 * 470296 - s12 += s22 * 654183 - s13 -= s22 * 997805 - s14 += s22 * 136657 - s15 -= s22 * 683901 - s22 = 0 - - s9 += s21 * 666643 - s10 += s21 * 470296 - s11 += s21 * 654183 - s12 -= s21 * 997805 - s13 += s21 * 136657 - s14 -= s21 * 683901 - s21 = 0 - - s8 += s20 * 666643 - s9 += s20 * 470296 - s10 += s20 * 654183 - s11 -= s20 * 997805 - s12 += s20 * 136657 - s13 -= s20 * 683901 - s20 = 0 - - s7 += s19 * 666643 - s8 += s19 * 470296 - s9 += s19 * 654183 - s10 -= s19 * 997805 - s11 += s19 * 136657 - s12 -= s19 * 683901 - s19 = 0 - - s6 += s18 * 666643 - s7 += s18 * 470296 - s8 += s18 * 654183 - s9 -= s18 * 997805 - s10 += s18 * 136657 - s11 -= s18 * 683901 - s18 = 0 - - var carry [17]int64 - - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - - s5 += s17 * 666643 - s6 += s17 * 470296 - s7 += s17 * 654183 - s8 -= s17 * 997805 - s9 += s17 * 136657 - s10 -= s17 * 683901 - s17 = 0 - - s4 += s16 * 666643 - s5 += s16 * 470296 - s6 += s16 * 654183 - s7 -= s16 * 997805 - s8 += s16 * 136657 - s9 -= s16 * 683901 - s16 = 0 - - s3 += s15 * 666643 - s4 += s15 * 470296 - s5 += s15 * 654183 - s6 -= s15 * 997805 - s7 += s15 * 136657 - s8 -= s15 * 683901 - s15 = 0 - - s2 += s14 * 666643 - s3 += s14 * 470296 - s4 += s14 * 654183 - s5 -= s14 * 997805 - s6 += s14 * 136657 - s7 -= s14 * 683901 - s14 = 0 - - s1 += s13 * 666643 - s2 += s13 * 470296 - s3 += s13 * 654183 - s4 -= s13 * 997805 - s5 += s13 * 136657 - s6 -= s13 * 683901 - s13 = 0 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[11] = s11 >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - out[0] = byte(s0 >> 0) - out[1] = byte(s0 >> 8) - out[2] = byte((s0 >> 16) | (s1 << 5)) - out[3] = byte(s1 >> 3) - out[4] = byte(s1 >> 11) - out[5] = byte((s1 >> 19) | (s2 << 2)) - out[6] = byte(s2 >> 6) - out[7] = byte((s2 >> 14) | (s3 << 7)) - out[8] = byte(s3 >> 1) - out[9] = byte(s3 >> 9) - out[10] = byte((s3 >> 17) | (s4 << 4)) - out[11] = byte(s4 >> 4) - out[12] = byte(s4 >> 12) - out[13] = byte((s4 >> 20) | (s5 << 1)) - out[14] = byte(s5 >> 7) - out[15] = byte((s5 >> 15) | (s6 << 6)) - out[16] = byte(s6 >> 2) - out[17] = byte(s6 >> 10) - out[18] = byte((s6 >> 18) | (s7 << 3)) - out[19] = byte(s7 >> 5) - out[20] = byte(s7 >> 13) - out[21] = byte(s8 >> 0) - out[22] = byte(s8 >> 8) - out[23] = byte((s8 >> 16) | (s9 << 5)) - out[24] = byte(s9 >> 3) - out[25] = byte(s9 >> 11) - out[26] = byte((s9 >> 19) | (s10 << 2)) - out[27] = byte(s10 >> 6) - out[28] = byte((s10 >> 14) | (s11 << 7)) - out[29] = byte(s11 >> 1) - out[30] = byte(s11 >> 9) - out[31] = byte(s11 >> 17) -} - -// order is the order of Curve25519 in little-endian form. -var order = [4]uint64{0x5812631a5cf5d3ed, 0x14def9dea2f79cd6, 0, 0x1000000000000000} - -// ScMinimal returns true if the given scalar is less than the order of the -// curve. -func ScMinimal(scalar *[32]byte) bool { - for i := 3; ; i-- { - v := binary.LittleEndian.Uint64(scalar[i*8:]) - if v > order[i] { - return false - } else if v < order[i] { - break - } else if i == 0 { - return false - } - } - - return true -} diff --git a/cluster-autoscaler/vendor/golang.org/x/net/html/parse.go b/cluster-autoscaler/vendor/golang.org/x/net/html/parse.go index f91466f7cd74..038941d70852 100644 --- a/cluster-autoscaler/vendor/golang.org/x/net/html/parse.go +++ b/cluster-autoscaler/vendor/golang.org/x/net/html/parse.go @@ -663,6 +663,24 @@ func inHeadIM(p *parser) bool { // Ignore the token. return true case a.Template: + // TODO: remove this divergence from the HTML5 spec. + // + // We don't handle all of the corner cases when mixing foreign + // content (i.e. or ) with